diff --git a/FetchTools.java b/FetchTools.java new file mode 100644 index 00000000..e746a08d --- /dev/null +++ b/FetchTools.java @@ -0,0 +1,54 @@ +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; + +public class FetchTools { + public static void main(String[] args) throws Exception { + HttpClient client = HttpClient.newBuilder().build(); + + HttpRequest sseReq = HttpRequest.newBuilder() + .uri(URI.create("https://axhubmcp.devjun.net/mcp/custom/cmm")) + .GET() + .build(); + + HttpResponse sseRes = client.send(sseReq, HttpResponse.BodyHandlers.ofInputStream()); + BufferedReader reader = new BufferedReader(new InputStreamReader(sseRes.body(), StandardCharsets.UTF_8)); + + String line; + String postUrl = null; + while ((line = reader.readLine()) != null) { + if (line.startsWith("event:endpoint")) { + String dataLine = reader.readLine(); // data:http... + postUrl = dataLine.substring(5).trim(); + break; + } + } + + if (postUrl != null) { + String payload = "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"tools/list\"}"; + HttpRequest postReq = HttpRequest.newBuilder() + .uri(URI.create(postUrl)) + .header("Content-Type", "application/json") + .POST(HttpRequest.BodyPublishers.ofString(payload)) + .build(); + + client.send(postReq, HttpResponse.BodyHandlers.discarding()); + + // Now read the rest of SSE + while ((line = reader.readLine()) != null) { + if (line.startsWith("event:message")) { + String dataLine = reader.readLine(); + if (dataLine.startsWith("data:")) { + String json = dataLine.substring(5).trim(); + System.out.println(json); + System.exit(0); + } + } + } + } + } +} diff --git a/dap-was-cus/src/main/java/io/shinhanlife/dap/mcc/biz/crm/converter/CrmToolConverter.java b/dap-was-cus/src/main/java/io/shinhanlife/dap/mcc/biz/crm/converter/CrmToolConverter.java new file mode 100644 index 00000000..18dd0a90 --- /dev/null +++ b/dap-was-cus/src/main/java/io/shinhanlife/dap/mcc/biz/crm/converter/CrmToolConverter.java @@ -0,0 +1,5 @@ +package io.shinhanlife.dap.mcc.biz.crm.converter; + +/** Per-Tool converters are generated beside this compatibility marker. */ +public interface CrmToolConverter { +} diff --git a/dap-was-cus/src/main/java/io/shinhanlife/dap/mcc/biz/gat/converter/SystemNoticeConverter.java b/dap-was-cus/src/main/java/io/shinhanlife/dap/mcc/biz/gat/converter/SystemNoticeConverter.java new file mode 100644 index 00000000..ab296f81 --- /dev/null +++ b/dap-was-cus/src/main/java/io/shinhanlife/dap/mcc/biz/gat/converter/SystemNoticeConverter.java @@ -0,0 +1,5 @@ +package io.shinhanlife.dap.mcc.biz.gat.converter; + +/** Per-Tool converters are generated beside this compatibility marker. */ +public interface SystemNoticeConverter { +} diff --git a/dap-was-cus/src/main/java/io/shinhanlife/dap/mcc/biz/gat/usecase/SystemNoticeUseCase.java b/dap-was-cus/src/main/java/io/shinhanlife/dap/mcc/biz/gat/usecase/SystemNoticeUseCase.java new file mode 100644 index 00000000..a7446635 --- /dev/null +++ b/dap-was-cus/src/main/java/io/shinhanlife/dap/mcc/biz/gat/usecase/SystemNoticeUseCase.java @@ -0,0 +1,14 @@ +package io.shinhanlife.dap.mcc.biz.gat.usecase; + +import org.springaicommunity.mcp.annotation.McpTool; +import io.shinhanlife.dap.lib.annotation.GrowToolHint; +import io.shinhanlife.dap.mcc.biz.gat.dto.GaActivityStatusRequest; +import io.shinhanlife.dap.mcc.biz.gat.dto.GaActivityStatusResponse; + +public interface SystemNoticeUseCase { + + @McpTool(name = "gat_ga_status", title = "GA 현황 조회", description = "GA 활동 현황을 조회하는 도구입니다.") + @GrowToolHint(register = true, categoryKey = "gat", mappingId = "CLHTTP00001") + GaActivityStatusResponse gaActivityStatus(GaActivityStatusRequest req); + +} diff --git a/dap-was-cus/src/main/java/io/shinhanlife/dap/mcc/biz/gat/usecase/impl/SystemNoticeUseCaseImpl.java b/dap-was-cus/src/main/java/io/shinhanlife/dap/mcc/biz/gat/usecase/impl/SystemNoticeUseCaseImpl.java new file mode 100644 index 00000000..86c0fa89 --- /dev/null +++ b/dap-was-cus/src/main/java/io/shinhanlife/dap/mcc/biz/gat/usecase/impl/SystemNoticeUseCaseImpl.java @@ -0,0 +1,30 @@ +package io.shinhanlife.dap.mcc.biz.gat.usecase.impl; + +import io.shinhanlife.dap.mcc.biz.gat.usecase.SystemNoticeUseCase; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import io.shinhanlife.dap.mcc.biz.gat.dto.GaActivityStatusRequest; +import io.shinhanlife.dap.mcc.biz.gat.dto.GaActivityStatusResponse; +import io.shinhanlife.dap.mcc.biz.gat.converter.GaActivityStatusConverter; +import io.shinhanlife.dap.mcc.infra.itrf.http.ga_activity_status.GaActivityStatusClient; +import io.shinhanlife.dap.mcc.infra.itrf.http.ga_activity_status.io.GaActivityStatusHttpRequest; +import io.shinhanlife.dap.mcc.infra.itrf.http.ga_activity_status.io.GaActivityStatusHttpResponse; + +@Service +@RequiredArgsConstructor +public class SystemNoticeUseCaseImpl implements SystemNoticeUseCase { + + private final GaActivityStatusClient gaActivityStatusClient; + private final GaActivityStatusConverter gaActivityStatusConverter; + + @Override + public GaActivityStatusResponse gaActivityStatus(GaActivityStatusRequest req) { + GaActivityStatusHttpRequest request = gaActivityStatusConverter.toRequest(req); + GaActivityStatusHttpResponse response = gaActivityStatusClient.call(request, GaActivityStatusHttpResponse.class); + GaActivityStatusResponse toolResponse = gaActivityStatusConverter.toResponse(response); + if (toolResponse == null) toolResponse = new GaActivityStatusResponse(); + toolResponse.setResultCode("SUCCESS"); + return toolResponse; + } + +} diff --git a/dap-was-cus/src/main/resources/glow/application-glow-local.yml b/dap-was-cus/src/main/resources/glow/application-glow-local.yml new file mode 100644 index 00000000..c021e67e --- /dev/null +++ b/dap-was-cus/src/main/resources/glow/application-glow-local.yml @@ -0,0 +1,20 @@ +spring: + config: + activate: + on-profile: local + +glow: + communication: + http: + api-list: + - name: ga-activity-status + domain: ${AXHUB_GA_ACTIVITY_STATUS_HTTP_DOMAIN:http://localhost:${server.port}} + url: ${AXHUB_GA_ACTIVITY_STATUS_HTTP_URL:/api/mock/http/crm_ga_status} + method: POST + content-type: application/json;charset=UTF-8 + biz-pod: false + +axhub: + mock: + http: + enabled: true diff --git a/dap-was-cus/src/main/resources/mock-responses/gat_ga_status.json b/dap-was-cus/src/main/resources/mock-responses/gat_ga_status.json new file mode 100644 index 00000000..ac60560b --- /dev/null +++ b/dap-was-cus/src/main/resources/mock-responses/gat_ga_status.json @@ -0,0 +1,4 @@ +{ + "resultCode" : "SUCCESS", + "activityInfo" : "활동량: 1200, 참여자: 300" +} diff --git a/dap-was-cus/src/main/resources/tool-definitions/gat/gat_ga_status.yml b/dap-was-cus/src/main/resources/tool-definitions/gat/gat_ga_status.yml new file mode 100644 index 00000000..e81c9c71 --- /dev/null +++ b/dap-was-cus/src/main/resources/tool-definitions/gat/gat_ga_status.yml @@ -0,0 +1,30 @@ +name: gat_ga_status +display_name: "GA 현황 조회" +version: 1.0.0 +category_key: gat +description: + function: "GA 활동 데이터를 조회하고 현재 상태를 반환합니다." + when_to_use: "사용자가 GA 활동 현황을 확인하고자 할 때" + when_not_to_use: "GA와 무관한 데이터 요청이나 권한이 없는 경우" + io_limits: "입력은 GA 고유 식별자 문자열, 출력은 상태 코드와 상세 정보 JSON" +display_description: "GA 활동 현황을 확인합니다." +example_queries: + - "GA12345 현황 조회" + - "GA2023 활동 현황" + - "GA 최근 7일 통계" +read_only: true +destructive: false +idempotent: true +parameters_schema: + type: object + properties: + gaId: + type: string + description: "GA 고유 식별자 (형식: ^GA\\d{5}$) (예시: GA12345, GA67890)" + required: + - gaId + additionalProperties: false +tags: ["GA", "조회"] +legacy_interface_id: "CLHTTP00001" +required_env_keys: [] +owner_org: "MCP_TOOL" diff --git a/dap-was-lib/src/main/java/io/shinhanlife/dap/lib/mcp/McpRequestHeaderFilter.java b/dap-was-lib/src/main/java/io/shinhanlife/dap/lib/mcp/McpRequestHeaderFilter.java index b7c8d896..42922349 100644 --- a/dap-was-lib/src/main/java/io/shinhanlife/dap/lib/mcp/McpRequestHeaderFilter.java +++ b/dap-was-lib/src/main/java/io/shinhanlife/dap/lib/mcp/McpRequestHeaderFilter.java @@ -7,11 +7,17 @@ import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; import org.springframework.stereotype.Component; import org.springframework.web.filter.OncePerRequestFilter; +import io.shinhanlife.dap.lib.session.mci.AxhubSessionService; +import io.shinhanlife.dap.lib.session.dto.SessionDto; +import org.springframework.beans.factory.annotation.Autowired; -/** Captures optional correlation and employee headers for an MCP HTTP call. */ +/** Captures optional correlation and employee headers for an MCP HTTP call and creates mock session. */ @Component public class McpRequestHeaderFilter extends OncePerRequestFilter { + @Autowired + private AxhubSessionService sessionService; + @Override protected boolean shouldNotFilter(HttpServletRequest request) { return !request.getRequestURI().endsWith("/mcp"); @@ -20,12 +26,24 @@ public class McpRequestHeaderFilter extends OncePerRequestFilter { @Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { + String empNo = request.getHeader("employee-no"); + McpRequestHeaderContext.set(new McpRequestHeaders( request.getHeader("x-request-id"), request.getHeader("guid"), request.getHeader("mcp-session-id"), - request.getHeader("employee-no"), + empNo, request.getHeader("virtual-employee-no"))); + + // Fetch session info via MCI using employee-no + if (empNo != null && !empNo.isEmpty()) { + SessionDto sessionDto = sessionService.fetchUserSession(empNo); + if (sessionDto != null) { + // Set to request attribute so SessionUtil can find it + request.setAttribute("userInfo", sessionDto); + } + } + try { filterChain.doFilter(request, response); } finally { diff --git a/dap-was-lib/src/main/java/io/shinhanlife/dap/lib/session/mci/AxhubSessionService.java b/dap-was-lib/src/main/java/io/shinhanlife/dap/lib/session/mci/AxhubSessionService.java new file mode 100644 index 00000000..c50066d6 --- /dev/null +++ b/dap-was-lib/src/main/java/io/shinhanlife/dap/lib/session/mci/AxhubSessionService.java @@ -0,0 +1,59 @@ +package io.shinhanlife.dap.lib.session.mci; + +import io.shinhanlife.dap.lib.integration.mci.component.AxhubMciComponent; +import io.shinhanlife.dap.lib.session.dto.SessionDto; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.List; + +@Slf4j +@Service +@RequiredArgsConstructor +public class AxhubSessionService { + + private final AxhubMciComponent mciComponent; + + public SessionDto fetchUserSession(String employeeNo) { + if (employeeNo == null || employeeNo.trim().isEmpty()) { + return null; + } + + try { + ONBSA0790_I request = ONBSA0790_I.builder() + .plnrPrafScrnInqrInDto(ONBSA0790_I.PlnrPrafScrnInqrInDto.builder() + .prafNo(employeeNo) + .build()) + .build(); + + // callTo makes a synchronous MCI call. + var responseTransfer = mciComponent.callTo("ONBSA0790", "ONBSA", request, ONBSA0790_O.class); + ONBSA0790_O response = responseTransfer.getBody(); + + if (response != null && response.getPrafInfoDto() != null && !response.getPrafInfoDto().isEmpty()) { + ONBSA0790_O.PrafInfoDto info = response.getPrafInfoDto().get(0); + + SessionDto sessionDto = new SessionDto(); + sessionDto.setOgnzNo(info.getOgnzAsrtCd()); + sessionDto.setPrafNo(info.getPrafNo()); + sessionDto.setStrYmd(LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd"))); + sessionDto.setBrafNo(info.getBrafNo()); + sessionDto.setPsmrAsrtCd(info.getPsmrAsrtCd()); + sessionDto.setSbsnRulpAsrtCd(info.getSbsnRulpAsrtCd()); + sessionDto.setBsduCd(info.getBsduCd()); + sessionDto.setBsquCd(info.getBsquCd()); + sessionDto.setOgnzAsrtCd(info.getOgnzAsrtCd()); + sessionDto.setOgnzLeveCd(info.getOgnzLeveCd()); + + log.info("[AxhubSessionService] MCI ONBSA0790 조회 성공: 사번={}, 조직코드={}", employeeNo, info.getOgnzAsrtCd()); + return sessionDto; + } + } catch (Exception e) { + log.error("[AxhubSessionService] MCI ONBSA0790 사원 정보 조회 실패 (사번: {})", employeeNo, e); + } + return null; + } +} diff --git a/dap-was-lib/src/main/java/io/shinhanlife/dap/lib/session/mci/ONBSA0790_I.java b/dap-was-lib/src/main/java/io/shinhanlife/dap/lib/session/mci/ONBSA0790_I.java new file mode 100644 index 00000000..d49065c1 --- /dev/null +++ b/dap-was-lib/src/main/java/io/shinhanlife/dap/lib/session/mci/ONBSA0790_I.java @@ -0,0 +1,25 @@ +package io.shinhanlife.dap.lib.session.mci; + +import io.shinhanlife.glow.communication.module.mci.annotation.GlowTrgmField; +import lombok.*; + +@Getter +@Setter +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class ONBSA0790_I { + + @GlowTrgmField(order = 1, length = 100, description = "설계사인사화면조회입력DTO") + private PlnrPrafScrnInqrInDto plnrPrafScrnInqrInDto; + + @Getter + @Setter + @Builder + @NoArgsConstructor + @AllArgsConstructor + public static class PlnrPrafScrnInqrInDto { + @GlowTrgmField(order = 1, length = 7, description = "인사번호") + private String prafNo; + } +} diff --git a/dap-was-lib/src/main/java/io/shinhanlife/dap/lib/session/mci/ONBSA0790_O.java b/dap-was-lib/src/main/java/io/shinhanlife/dap/lib/session/mci/ONBSA0790_O.java new file mode 100644 index 00000000..ea51d238 --- /dev/null +++ b/dap-was-lib/src/main/java/io/shinhanlife/dap/lib/session/mci/ONBSA0790_O.java @@ -0,0 +1,53 @@ +package io.shinhanlife.dap.lib.session.mci; + +import io.shinhanlife.glow.communication.module.mci.annotation.GlowTrgmField; +import lombok.*; +import java.util.List; + +@Getter +@Setter +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class ONBSA0790_O { + + @GlowTrgmField(order = 1, length = 1000, description = "인사정보DTO리스트") + private List prafInfoDto; + + @Getter + @Setter + @Builder + @NoArgsConstructor + @AllArgsConstructor + public static class PrafInfoDto { + @GlowTrgmField(order = 1, length = 7, description = "인사번호") + private String prafNo; + + @GlowTrgmField(order = 2, length = 2, description = "인사유형코드") + private String prafTypeCd; + + @GlowTrgmField(order = 3, length = 100, description = "인사명") + private String prafNm; + + @GlowTrgmField(order = 22, length = 3, description = "영업직책코드") + private String bsduCd; + + @GlowTrgmField(order = 28, length = 6, description = "조직분류코드") + private String ognzAsrtCd; + + @GlowTrgmField(order = 29, length = 6, description = "인사조직분류코드") + private String psmrAsrtCd; + + @GlowTrgmField(order = 30, length = 6, description = "영업규정분류코드") + private String sbsnRulpAsrtCd; + + @GlowTrgmField(order = 31, length = 6, description = "조직레벨코드") + private String ognzLeveCd; + + @GlowTrgmField(order = 32, length = 7, description = "지점번호") + private String brafNo; + + @GlowTrgmField(order = 33, length = 7, description = "영업소코드") + private String bsquCd; + } +} diff --git a/dap-was-lib/src/main/java/io/shinhanlife/dap/lib/util/SessionUtil.java b/dap-was-lib/src/main/java/io/shinhanlife/dap/lib/util/SessionUtil.java index e155b981..e4217a88 100644 --- a/dap-was-lib/src/main/java/io/shinhanlife/dap/lib/util/SessionUtil.java +++ b/dap-was-lib/src/main/java/io/shinhanlife/dap/lib/util/SessionUtil.java @@ -1,6 +1,7 @@ package io.shinhanlife.dap.lib.util; import io.shinhanlife.dap.lib.session.dto.SessionDto; +import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpSession; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; @@ -28,7 +29,16 @@ public class SessionUtil { public static SessionDto getSession() { ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); if (attributes == null) return null; - HttpSession session = attributes.getRequest().getSession(false); + + // 1. Check HTTP Request Attribute first (populated by McpRequestHeaderFilter) + HttpServletRequest request = attributes.getRequest(); + SessionDto requestSession = (SessionDto) request.getAttribute(SESSION_KEY); + if (requestSession != null) { + return requestSession; + } + + // 2. Fallback to standard HttpSession + HttpSession session = request.getSession(false); if (session == null) return null; return (SessionDto) session.getAttribute(SESSION_KEY); } diff --git a/dap-was-pro/src/main/java/io/shinhanlife/dap/mcc/biz/agt/converter/AgentInquiryConverter.java b/dap-was-pro/src/main/java/io/shinhanlife/dap/mcc/biz/agt/converter/AgentInquiryConverter.java new file mode 100644 index 00000000..7e8b3d31 --- /dev/null +++ b/dap-was-pro/src/main/java/io/shinhanlife/dap/mcc/biz/agt/converter/AgentInquiryConverter.java @@ -0,0 +1,5 @@ +package io.shinhanlife.dap.mcc.biz.agt.converter; + +/** Per-Tool converters are generated beside this compatibility marker. */ +public interface AgentInquiryConverter { +} diff --git a/dap-was-pro/src/main/resources/mock-responses/agt_ga_status.json b/dap-was-pro/src/main/resources/mock-responses/agt_ga_status.json new file mode 100644 index 00000000..d73a65b9 --- /dev/null +++ b/dap-was-pro/src/main/resources/mock-responses/agt_ga_status.json @@ -0,0 +1,4 @@ +{ + "resultCode" : "SUCCESS", + "summary" : "GA 활동 현황 데이터를 반환했습니다." +} diff --git a/dap-was-pro/src/main/resources/tool-definitions/agt/agt_ga_status.yml b/dap-was-pro/src/main/resources/tool-definitions/agt/agt_ga_status.yml new file mode 100644 index 00000000..b627a7bb --- /dev/null +++ b/dap-was-pro/src/main/resources/tool-definitions/agt/agt_ga_status.yml @@ -0,0 +1,47 @@ +name: agt_ga_status +display_name: "GA 활동 현황 조회" +version: 1.0.0 +category_key: agt +description: + function: "GA 활동 데이터를 조회하고 요약한다." + when_to_use: "사용자가 특정 기간의 GA 활동 지표를 확인하고자 할 때" + when_not_to_use: "사용자가 GA가 아닌 다른 시스템의 데이터를 요청하거나, 비정형적인 요청을 할 때" + io_limits: "입력은 시작일·종료일, 메트릭, 차원 선택이며, 출력은 JSON 형식의 요약 데이터이다." +display_description: "GA 활동 현황 조회" +example_queries: + - "지난 7일간 페이지뷰 통계" + - "2024년 9월 일일 방문자 수" + - "지역별 전환율 비교" + - "전체 세션 평균 체류 시간" + - "트래픽 소스별 방문자 수" +read_only: true +destructive: false +idempotent: true +parameters_schema: + type: object + properties: + startDate: + type: string + description: "시작 날짜 (YYYY-MM-DD) (형식: ^\\d{4}-\\d{2}-\\d{2}$) (예시: 2024-09-01)" + endDate: + type: string + description: "종료 날짜 (YYYY-MM-DD) (형식: ^\\d{4}-\\d{2}-\\d{2}$) (예시: 2024-09-30)" + metric: + type: string + description: "요청할 메트릭 이름 (예시: pageViews, sessionDuration)" + dimension: + type: string + description: "선택한 차원 필드 (예시: country, device)" + format: + type: string + description: "출력 형식 선택 (예시: json, csv)" + required: + - startDate + - endDate + - metric + - format + additionalProperties: false +tags: ["Analytics", "Reporting"] +legacy_interface_id: "CLATTP00001" +required_env_keys: [] +owner_org: "MCP_TOOL" diff --git a/dap-was-sys/src/main/java/io/shinhanlife/dap/mcc/biz/pct/converter/SystemNoticeConverter.java b/dap-was-sys/src/main/java/io/shinhanlife/dap/mcc/biz/pct/converter/SystemNoticeConverter.java new file mode 100644 index 00000000..1eed116c --- /dev/null +++ b/dap-was-sys/src/main/java/io/shinhanlife/dap/mcc/biz/pct/converter/SystemNoticeConverter.java @@ -0,0 +1,5 @@ +package io.shinhanlife.dap.mcc.biz.pct.converter; + +/** Per-Tool converters are generated beside this compatibility marker. */ +public interface SystemNoticeConverter { +} diff --git a/dap-was-sys/src/main/resources/glow/application-glow-local.yml b/dap-was-sys/src/main/resources/glow/application-glow-local.yml new file mode 100644 index 00000000..11be9460 --- /dev/null +++ b/dap-was-sys/src/main/resources/glow/application-glow-local.yml @@ -0,0 +1,25 @@ +spring: + config: + activate: + on-profile: local + +glow: + communication: + http: + api-list: + - name: ga-status-api + domain: ${AXHUB_GA_STATUS_API_HTTP_DOMAIN:http://localhost:${server.port}} + url: ${AXHUB_GA_STATUS_API_HTTP_URL:/api/mock/http/pct_ga_status} + method: POST + content-type: application/json;charset=UTF-8 + biz-pod: false + - name: ga-activity-status + domain: ${AXHUB_GA_ACTIVITY_STATUS_HTTP_DOMAIN:http://localhost:${server.port}} + url: ${AXHUB_GA_ACTIVITY_STATUS_HTTP_URL:/api/mock/http/pct_ga_status} + method: POST + content-type: application/json;charset=UTF-8 + biz-pod: false +axhub: + mock: + http: + enabled: true diff --git a/dap-was-sys/src/main/resources/mock-responses/pct_ga_status.json b/dap-was-sys/src/main/resources/mock-responses/pct_ga_status.json new file mode 100644 index 00000000..600e1d99 --- /dev/null +++ b/dap-was-sys/src/main/resources/mock-responses/pct_ga_status.json @@ -0,0 +1,5 @@ +{ + "resultCode" : "SUCCESS", + "totalSessions" : 12345, + "userCount" : 9876 +} diff --git a/dap-was-sys/src/main/resources/tool-definitions/pct/pct_ga_status.yml b/dap-was-sys/src/main/resources/tool-definitions/pct/pct_ga_status.yml new file mode 100644 index 00000000..2f7c5da3 --- /dev/null +++ b/dap-was-sys/src/main/resources/tool-definitions/pct/pct_ga_status.yml @@ -0,0 +1,39 @@ +name: pct_ga_status +display_name: "GA 활동 현황 조회" +version: 1.0.0 +category_key: pct +description: + function: "GA 활동 데이터를 조회합니다." + when_to_use: "사용자가 GA 활동 현황을 확인하려면" + when_not_to_use: "사용자가 GA가 아닌 다른 시스템을 요청하거나, 유효하지 않은 파라미터를 제공할 경우" + io_limits: "입력: propertyId, startDate, endDate; 출력: resultCode, totalSessions, userCount" +display_description: "GA 활동 현황을 확인합니다." +example_queries: + - "GA 활동 현황 조회" + - "GA 활동 현황 조회?propertyId=1234&startDate=2024-01-01&endDate=2024-01-31" + - "GA 활동 현황 조회?propertyId=5678&startDate=2024-02-01&endDate=2024-02-28" + - "GA 활동 현황 조회?propertyId=9012&startDate=2024-03-01&endDate=2024-03-31" +read_only: true +destructive: false +idempotent: true +parameters_schema: + type: object + properties: + propertyId: + type: string + description: "GA 프로퍼티 ID (형식: ^[0-9]{1,12}$) (예시: 123456789)" + startDate: + type: string + description: "시작 날짜 (YYYY-MM-DD) (형식: ^\\d{4}-\\d{2}-\\d{2}$) (예시: 2024-01-01)" + endDate: + type: string + description: "종료 날짜 (YYYY-MM-DD) (형식: ^\\d{4}-\\d{2}-\\d{2}$) (예시: 2024-01-31)" + required: + - propertyId + - startDate + - endDate + additionalProperties: false +tags: ["GA", "활동", "현황", "조회"] +legacy_interface_id: "CLHTTP00001" +required_env_keys: [] +owner_org: "MCP_TOOL" diff --git a/docs/tool-guide/01-Tool-개발환경-가이드.md b/docs/tool-guide/01-Tool-개발환경-가이드.md new file mode 100644 index 00000000..04324e4b --- /dev/null +++ b/docs/tool-guide/01-Tool-개발환경-가이드.md @@ -0,0 +1,196 @@ +# AX HUB Tool 개발 환경 가이드 + +## 1. 문서 목적 + +이 문서는 AX HUB의 **Tool Pod 개발자**가 로컬 PC와 신한라이프 내부망에서 동일한 방식으로 소스를 빌드하고 실행하기 위한 기준을 정리한다. + +이 문서의 범위는 `dap-was-lib`와 Tool Pod(`dap-was-cus`, `dap-was-sal`, `dap-was-pro`, `dap-was-sys`)이다. 외부 라우팅 계층의 구성과 운영 방법은 다루지 않는다. + +## 2. 기준 기술 환경 + +| 항목 | 현재 기준 | 용도 | +|---|---:|---| +| Java | 21 | 컴파일 및 Tool Pod 실행 | +| Spring Boot | 3.5.11 | Tool Pod 애플리케이션 기반 | +| Gradle Wrapper | 8.14.3 | 빌드 표준화 | +| MCP Java SDK | 2.0.0 | MCP 서버와 JSON 전송 처리 | +| Spring AI BOM | 1.1.8 | Boot 3.5 계열 의존성 정렬 | +| MCP Annotations | 0.9.0 | `@McpTool`, `@McpToolParam` 제공 | +| MapStruct | 1.5.5.Final | Tool DTO와 연계 전문 변환 | +| Lombok | 1.18.32 | DTO·생성자 반복 코드 축소 | +| JSON Schema Validator | 2.0.0 | MCP SDK 2.0.0 호환 Schema 검증 | + +> `com.networknt:json-schema-validator`는 반드시 현재 지정된 `2.0.0`을 유지한다. 3.x를 혼용하면 MCP SDK가 기대하는 `Schema.validate(JsonNode)` 규격과 달라 `NoSuchMethodError`가 발생할 수 있다. + +## 3. Tool 모듈 구성 + +| 모듈 | 기본 포트 | 역할 | +|---|---:|---| +| `dap-was-lib` | 해당 없음 | MCP 서버 설정, Tool 탐색·실행, Schema, V17 메타데이터, MCI·HTTP 연동, 공통 로그·헤더 처리 | +| `dap-was-cus` | 8084 | 고객 관련 Tool Pod | +| `dap-was-sal` | 8082 | 영업 관련 Tool Pod | +| `dap-was-pro` | 8085 | 상품 관련 Tool Pod | +| `dap-was-sys` | 8086 | 시스템 관련 Tool Pod | + +각 실행 모듈은 `dap-was-lib`를 의존하고 다음 패키지를 스캔한다. + +```java +@SpringBootApplication(scanBasePackages = { + "io.shinhanlife.dap.mcc", + "io.shinhanlife.dap.lib" +}) +@Import(ToolMcpServerConfiguration.class) +``` + +따라서 업무 Tool은 `io.shinhanlife.dap.mcc` 아래에, 공통 기능은 `io.shinhanlife.dap.lib` 아래에 둔다. + +## 4. 개발 PC 준비 + +### 4.1 필수 설치 항목 + +1. JDK 21 +2. IntelliJ IDEA 또는 Eclipse 기반 개발도구 +3. Git +4. Docker Desktop 또는 사내 표준 컨테이너 실행 환경(통합 테스트 시) + +별도 Gradle 설치는 필요하지 않다. 저장소에 포함된 `gradlew.bat`를 사용한다. + +### 4.2 IntelliJ 설정 + +- Project SDK: JDK 21 +- Gradle JVM: JDK 21 +- Build and run using: Gradle 권장 +- File Encoding: UTF-8 +- Annotation Processing: 활성화 +- 줄바꿈: Git 정책에 맞춰 유지 + +한글 주석이나 문자열이 깨지는 경우 파일을 UTF-8로 다시 저장하고, Java 파일 첫 바이트에 BOM(`\ufeff`)이 들어가지 않았는지 확인한다. Java 소스는 **UTF-8 without BOM**을 사용한다. + +## 5. 프로파일과 설정 파일 + +각 Tool Pod는 다음 구조를 사용한다. + +```text +src/main/resources/ +├─ application.yml +├─ application-local.yml +├─ application-dev.yml +├─ application-test.yml +└─ application-prod.yml +``` + +프로파일 파일은 공통 라이브러리의 Glow 설정을 가져온다. + +```yaml +spring: + config: + activate: + on-profile: local + import: + - classpath:glow/application-glow.yml + - classpath:glow/application-glow-local.yml +``` + +| 프로파일 | 용도 | +|---|---| +| `local` | 개발자 PC, H2 및 로컬 Mock 사용 | +| `dev` | 개발계 MCI·HTTP 연계 | +| `test` | 테스트 환경 연계 | +| `prod` | 운영 환경 연계 | + +실행 프로파일은 다음 중 하나로 지정한다. + +```powershell +$env:SPRING_PROFILES_ACTIVE = "local" +.\gradlew.bat :dap-was-cus:bootRun +``` + +또는 IntelliJ Run Configuration의 `Active profiles`에 `local`을 입력한다. + +## 6. 주요 환경 변수 + +환경별 주소와 보안 값은 Java 코드에 직접 작성하지 않고 환경 변수로 주입한다. + +| 환경 변수 | 의미 | local 기본값 예시 | +|---|---|---| +| `SPRING_PROFILES_ACTIVE` | 실행 프로파일 | `local` | +| `PORT` | Tool Pod 포트 | 모듈별 기본 포트 | +| `AXHUB_TOOL_URL` | 현재 Tool Pod의 공개 기준 URL | `http://localhost:${server.port}` | +| `GLOW_COMMUNICATION_MCI_HOST` | MCI 호스트 | `http://localhost` | +| `GLOW_COMMUNICATION_MCI_PORT` | MCI 포트 | `8080` | +| `AXHUB_{API_NAME}_HTTP_DOMAIN` | HTTP API 도메인 | Tool별 설정값 | +| `AXHUB_{API_NAME}_HTTP_URL` | HTTP API 경로 | Tool별 설정값 | + +비밀번호, 인증키, 암호화키는 YAML 기본값으로 커밋하지 않는다. + +## 7. 빌드와 실행 + +### 7.1 공통 라이브러리 검증 + +```powershell +.\gradlew.bat :dap-was-lib:clean :dap-was-lib:test +``` + +### 7.2 Tool Pod 컴파일 + +```powershell +.\gradlew.bat :dap-was-cus:compileJava +.\gradlew.bat :dap-was-sal:compileJava +.\gradlew.bat :dap-was-pro:compileJava +.\gradlew.bat :dap-was-sys:compileJava +``` + +### 7.3 Tool Pod 실행 + +```powershell +.\gradlew.bat :dap-was-cus:bootRun +``` + +실행 후 확인할 Tool Pod 자체 주소는 다음과 같다. + +| 기능 | 주소 예시 | +|---|---| +| MCP 표준 엔드포인트 | `http://localhost:8084/mcp` | +| Tool Manifest | `http://localhost:8084/tool-manifest` | +| Tool 테스트 콘솔 | `http://localhost:8084/tool-test-console.html` | +| Tool 직접 실행 | `POST http://localhost:8084/mcp/{toolName}` | + +포트는 실행한 Pod에 맞게 바꾼다. + +## 8. Redis와 Docker 사용 기준 + +- Tool DTO 작성, 컴파일, 단위 테스트에는 Docker가 필요하지 않다. +- 로컬 HTTP Mock이나 MCI Mock을 사용할 때만 관련 컨테이너를 실행한다. +- Redis가 없어도 Tool 목록과 Tool 자체 실행을 확인할 수 있도록 개발한다. +- Redis를 사용하는 부가 기능을 시험할 때만 Redis를 실행한다. + +즉, Tool 개발의 최소 실행 단위는 **JDK 21 + 해당 Tool Pod**이다. + +## 9. 내부망 반입 준비 + +신한라이프 내부망에는 다음 항목을 사전에 준비한다. + +1. JDK 21 또는 Java 21 컨테이너 이미지 +2. Gradle Wrapper 8.14.3 배포 파일 +3. 사내 Nexus의 전체 Maven 의존성 +4. Glow Framework 사내 JAR와 그 전이 의존성 +5. MCP SDK 2.0.0 및 JSON Schema Validator 2.0.0 +6. 사내 인증서와 JVM TrustStore +7. MCI·HTTP 대상 주소, 포트, ACL +8. 환경별 설정값과 Secret 주입 방식 + +컨테이너 빌드 시 사내 Registry에 Java 21 빌드·실행 이미지가 미러링되어 있어야 한다. 이미지 경로는 Dockerfile의 `FROM`만 사내 경로로 치환하고, Java 버전은 21로 유지한다. + +## 10. 환경 점검 체크리스트 + +- [ ] `java -version`이 21이다. +- [ ] Gradle JVM이 JDK 21이다. +- [ ] `gradlew.bat --version`이 정상 실행된다. +- [ ] `:dap-was-lib:test`가 성공한다. +- [ ] 대상 Tool Pod의 `compileJava`가 성공한다. +- [ ] local 프로파일로 Tool Pod가 기동된다. +- [ ] `/tool-manifest`에서 Tool 목록이 조회된다. +- [ ] `/tool-test-console.html`에서 샘플 Tool이 실행된다. +- [ ] MCI·HTTP 연계 주소와 ACL이 환경별로 준비되어 있다. +- [ ] 소스와 설정 파일의 한글이 UTF-8로 정상 표시된다. + diff --git a/docs/tool-guide/02-Tool-설계-가이드.md b/docs/tool-guide/02-Tool-설계-가이드.md new file mode 100644 index 00000000..c079635e --- /dev/null +++ b/docs/tool-guide/02-Tool-설계-가이드.md @@ -0,0 +1,342 @@ +# AX HUB Tool 설계 가이드 + +## 1. 설계 목표 + +Tool은 AI가 기능을 정확히 선택하고, 입력값을 안전하게 전달하며, 레거시 응답을 사람이 이해할 수 있는 형태로 반환하도록 설계한다. + +핵심 원칙은 다음과 같다. + +1. Tool의 업무 목적과 호출 조건을 명확히 작성한다. +2. AI용 DTO와 MCI·HTTP 전문 DTO를 분리한다. +3. 입력과 출력의 JSON Schema를 구체적으로 정의한다. +4. endpoint, timeout, 인증 값은 설정으로 분리한다. +5. 동일한 Tool명은 빌드 단계에서 차단한다. + +## 2. Tool명 규칙 + +현재 V17 검증 규칙은 다음과 같다. + +```regex +^[a-z][a-z0-9_]{2,63}$ +``` + +권장 형식은 `{업무도메인}_{업무기능}_{행위}`이다. + +```text +cmm_claim_search +cmm_comcode_lookup +smp_exchange_inquiry +ins_insurance_processor +``` + +설계 규칙: + +- 소문자 영문, 숫자, 언더스코어만 사용한다. +- Pod명(`cus`, `sal`, `pro`, `sys`)은 Tool명에 넣지 않는다. +- 마침표와 공백을 사용하지 않는다. +- 구현 클래스명이나 인터페이스 ID만으로 이름을 만들지 않는다. +- 이름은 한 번 배포한 뒤 호환성을 위해 가급적 변경하지 않는다. + +`mcp.namespace`를 설정하면 런타임 등록명 앞에 namespace가 붙을 수 있으므로, 기본값인 빈 문자열 사용 여부를 Pod 운영 기준과 함께 확정한다. + +## 3. 업무 패키지 구조 + +```text +io.shinhanlife.dap.mcc +├─ biz.{category} +│ ├─ dto +│ ├─ converter +│ └─ usecase +│ └─ impl +└─ infra.itrf + ├─ mci.{clientSystemCode} + │ └─ io + └─ http.{httpApiName} + └─ io +``` + +각 계층의 책임은 다음과 같다. + +| 계층 | 책임 | +|---|---| +| `biz.*.dto` | AI가 이해하는 Tool 요청·응답 모델 | +| `biz.*.converter` | Tool DTO와 연계 전문 DTO 변환 | +| `biz.*.usecase` | `@McpTool`로 노출할 업무 계약 | +| `biz.*.usecase.impl` | 변환, Client 호출, 응답 해석 | +| `infra.itrf.mci.*` | MCI 인터페이스별 Client와 요청·응답 전문 | +| `infra.itrf.http.*` | HTTP API별 Client와 요청·응답 전문 | + +한 UseCase 인터페이스에는 관련된 Tool 함수를 여러 개 선언할 수 있다. 이때 구현체에도 동일한 메서드를 추가하고, 각 메서드마다 독립된 `@McpTool`과 `@GrowToolHint`를 지정한다. 공통 추상 UseCase 상속은 필수가 아니다. + +## 4. Tool 선언 + +```java +@McpTool( + name = "cmm_claim_search", + title = "보험금 청구 상태 조회", + description = "청구번호 또는 계약번호로 보험금 청구 상태를 조회합니다." +) +@GrowToolHint( + register = true, + categoryKey = "cmm", + mappingId = "CLCNNB00001" +) +ClaimSearchResponse searchClaim(ClaimSearchRequest request); +``` + +| 항목 | 작성 기준 | +|---|---| +| `name` | 시스템 식별용 영문 Tool명 | +| `title` | 사용자 화면에 표시할 짧은 업무명 | +| `description` | Tool이 실제로 수행하는 기능 설명 | +| `categoryKey` | 업무 분류 코드 | +| `mappingId` | MCI 인터페이스 ID 또는 업무 연계 식별자 | +| `register` | `false`이면 개발 중인 Tool을 외부 노출 대상에서 제외 | + +`title`과 `description`은 같은 문장을 반복하지 않는다. `title`은 짧은 명칭, `description`은 대상·조건·결과를 포함한 한두 문장으로 작성한다. + +## 5. Tool Schema V17 메타데이터 + +각 Tool에는 다음 경로의 정의 파일을 둔다. + +```text +src/main/resources/tool-definitions/{categoryKey}/{toolName}.yml +``` + +필수 구성 예시는 다음과 같다. + +```yaml +name: cmm_claim_search +display_name: 보험금 청구 상태 조회 +version: 1.0.0 +category_key: cmm +description: + function: 청구번호 또는 계약번호를 기준으로 청구 상태와 심사 결과를 조회한다. + when_to_use: 기존 청구 건의 진행 상태나 지급 결과를 확인할 때 사용한다. + when_not_to_use: 신규 보험금 청구 접수나 기존 청구 변경에는 사용하지 않는다. + io_limits: 청구번호 또는 계약번호 중 하나 이상이 필요하며 조회 기능만 제공한다. +display_description: 보험금 청구 상태와 심사 결과를 조회합니다. +example_queries: + - 내 보험금 청구가 어디까지 진행됐는지 알려줘 + - 계약번호로 최근 청구 상태를 확인해줘 + - 청구 심사 결과가 나왔는지 조회해줘 +read_only: true +destructive: false +idempotent: true +parameters_schema: + type: object + properties: + claimNo: + type: string + description: 조회할 보험금 청구번호 + additionalProperties: false +tags: [보험금, 청구조회] +legacy_interface_id: CLCNNB00001 +required_env_keys: [] +owner_org: MCP_TOOL +``` + +V17 검증 기준: + +- `name`은 Tool명 정규식을 만족해야 한다. +- 표시명, 버전, 분류, 4종 설명은 비어 있으면 안 된다. +- 자연어 예시 질의는 3~10개이며 Tool명을 직접 포함하지 않는다. +- `read_only`, `destructive`, `idempotent`를 명시한다. +- Schema 최상위 타입은 `object`이다. +- 모든 속성에 `description`이 있어야 한다. +- `additionalProperties`는 `false`이다. + +## 6. Input Schema 설계 + +### 6.1 단순한 요청 + +필드 수가 적고 조건이 단순하면 DTO의 `@Schema`, `@McpToolParam`과 타입 정보를 이용해 생성한다. + +```java +@Schema( + description = "보험금 청구번호", + example = "CLM202608100001", + requiredMode = Schema.RequiredMode.REQUIRED +) +private String claimNo; +``` + +### 6.2 복잡한 요청 + +중첩 객체, 조건부 필드, 정규식, 배열 제약처럼 복잡한 규칙은 JSON 리소스로 관리한다. + +```text +src/main/resources/tool-schemas/{categoryKey}/{schema-name}-input-schema.json +``` + +```java +@GrowToolHint( + categoryKey = "cmm", + inputSchemaResource = "classpath:tool-schemas/cmm/claim-search-resource-input-schema.json" +) +``` + +명시한 `inputSchemaResource`가 있으면 리소스 Schema를 우선 사용한다. 리소스가 없을 때 DTO 기반 Schema를 사용한다. + +## 7. Output Schema 설계 + +단순한 응답 DTO는 클래스에 `@McpOutputSchema`를 붙인다. + +```java +@McpOutputSchema +public class ClaimSearchResponse { + // fields +} +``` + +복잡한 응답은 다음 리소스를 사용한다. + +```text +src/main/resources/tool-schemas/{categoryKey}/{schema-name}-output-schema.json +``` + +```java +@GrowToolHint( + categoryKey = "cmm", + outputSchemaResource = "classpath:tool-schemas/cmm/claim-search-resource-output-schema.json" +) +``` + +우선순위는 **명시 JSON 리소스 → `@McpOutputSchema` DTO 생성 → 미사용** 순서다. Output Schema를 명시한 Tool만 실행 결과를 해당 Schema로 검증한다. + +## 8. 응답 DTO 작성 규칙 + +1. 코드와 라벨을 함께 제공한다: `status`, `statusLabel`. +2. null의 의미를 필드 설명에 명시한다: “심사 전이면 null이며 0원으로 해석하지 않는다.” +3. 조건부 필드는 조건을 설명한다: “status가 REJECTED일 때만 값이 있다.” +4. 배열에는 정렬 기준을 설명한다: “접수일 내림차순.” +5. 결과가 잘릴 수 있으면 `hasMore` 같은 필드를 제공한다. +6. 민감정보는 가능한 한 응답에 포함하지 않는다. 마스킹은 생략이 불가능할 때의 보조 수단이다. +7. 레거시 원문 응답을 그대로 반환하지 않고 Tool 응답 DTO에 필요한 값만 매핑한다. + +배열 요소가 복합 객체이면 응답 DTO 안에 의미 있는 inner class를 정의할 수 있다. + +```java +public class ActivityStatusResponse { + private List items; + + public static class ActivityItem { + private String status; + private String statusLabel; + } +} +``` + +## 9. MCI 연동 설계 + +권장 호출 흐름은 다음과 같다. + +```text +Tool Request + → UseCaseImpl + → Converter.toMciRequest() + → Mci{System}Client + → AxhubMciComponent + → GlowMciComponent + → Converter.toResponse() + → Tool Response +``` + +파일 구성 예: + +```text +Onnba3011Request.java +Onnba3011Response.java +Onnba3011Converter.java +Onnba3011UseCase.java +Onnba3011UseCaseImpl.java +MciCfpaClient.java +CLCNNB00001_I.java +CLCNNB00001_O.java +``` + +UseCaseImpl에서 직접 MCI 전문 필드를 하나씩 조립하지 않는다. 변환은 Converter에 두고, MCI Client는 변환이 끝난 전문을 받는다. + +## 10. Glow HTTP 연동 설계 + +권장 호출 흐름은 다음과 같다. + +```text +Tool Request + → UseCaseImpl + → Converter.toHttpRequest() + → {HttpApiName}Client + → AxhubHttpComponent + → GlowHttpComponent + → Converter.toResponse() + → Tool Response +``` + +Client는 설정의 API 이름만 참조한다. + +```java +@Component +@RequiredArgsConstructor +public class InsuranceClient { + private static final String API_NAME = "insurance"; + private final AxhubHttpComponent http; + + public O call(I request, Class responseType) { + return http.call(API_NAME, request, responseType); + } +} +``` + +URL과 HTTP 메서드는 `glow.communication.http.api-list`에 정의한다. + +```yaml +glow: + communication: + http: + api-list: + - name: insurance + domain: ${AXHUB_INSURANCE_HTTP_DOMAIN:http://localhost:${server.port}} + url: ${AXHUB_INSURANCE_HTTP_URL:/api/mock/http/ins_insurance_processor} + method: POST + content-type: application/json;charset=UTF-8 + biz-pod: false +``` + +`name`은 Client의 `API_NAME`과 같아야 한다. 업무 Java 코드에는 실제 host, port, path를 하드코딩하지 않는다. + +## 11. 공통 헤더와 추적성 + +Tool 호출 시 다음 헤더는 선택적으로 받을 수 있다. + +| 헤더 | 의미 | +|---|---| +| `trace-id` | 전체 업무 흐름 추적 ID. 연속 호출 동안 유지 | +| `request-id` | 개별 요청 ID. HTTP 호출 단위로 새 값 사용 가능 | +| `employee-id` | 암호화된 사번. 현재 필수 아님 | +| `X-Request-Id` | 호환용 요청 ID | + +`AxhubHttpComponent`는 현재 요청 Context의 `trace-id`, `request-id`, 암호화 사번을 Glow HTTP 요청 헤더로 전달한다. 민감 헤더와 DTO 원문은 일반 로그에 그대로 남기지 않는다. + +## 12. 빌드 시 자동 검증 + +```powershell +.\gradlew.bat validateMcpToolNames +.\gradlew.bat validateToolSchemaV17 +``` + +- `validateMcpToolNames`: 모든 Tool 모듈의 `@McpTool(name)` 중복 검사 +- `validateToolSchemaV17`: `@McpTool`과 V17 정의 파일의 필수 규칙 검사 +- 각 Tool Pod의 `bootJar`는 두 검증 Task에 의존하므로 오류가 있으면 배포 JAR이 생성되지 않는다. + +## 13. Tool 설계 완료 조건 + +- [ ] Tool명이 규칙에 맞고 중복되지 않는다. +- [ ] title, description, 사용/비사용 조건이 구체적이다. +- [ ] V17 Tool 정의 파일이 존재한다. +- [ ] AI DTO와 MCI·HTTP 전문 DTO가 분리되어 있다. +- [ ] Converter가 요청과 응답을 담당한다. +- [ ] endpoint와 timeout이 설정으로 분리되어 있다. +- [ ] Input/Output Schema의 단순·복잡 기준을 적용했다. +- [ ] 응답의 코드·라벨, null 의미, 조건, 배열 정렬, 잘림 여부를 설명했다. +- [ ] 불필요한 개인정보를 입출력에서 제거했다. + diff --git a/docs/tool-guide/03-Tool-개발가이드-1차.md b/docs/tool-guide/03-Tool-개발가이드-1차.md new file mode 100644 index 00000000..611b73b7 --- /dev/null +++ b/docs/tool-guide/03-Tool-개발가이드-1차.md @@ -0,0 +1,344 @@ +# AX HUB Tool 개발 가이드 1차본 + +## 1. 목적과 적용 범위 + +이 문서는 신규 Tool을 설계한 뒤 실제 소스에 구현하고 단위·연계 테스트까지 완료하는 절차를 설명한다. + +대상은 다음 Tool 모듈이다. + +- `dap-was-cus` +- `dap-was-sal` +- `dap-was-pro` +- `dap-was-sys` +- 공통 기능이 필요한 경우 `dap-was-lib` + +## 2. 개발 전 준비 자료 + +Tool 개발 착수 전에 다음 내용을 확보한다. + +1. Tool 업무명과 자연어 사용 예시 +2. 입력·출력 항목 정의 +3. 필수값, 형식, 길이, 코드값 +4. 조회/변경 여부와 사용자 승인 필요 여부 +5. MCI 인터페이스 ID 또는 HTTP API명 +6. 요청·응답 전문 및 오류 코드 정의 +7. 개발·테스트 환경 endpoint와 ACL +8. 개인정보 포함 여부와 처리 기준 + +## 3. 대상 Tool Pod 선택 + +| Pod | 선택 기준 | 기본 포트 | +|---|---|---:| +| CUS | 고객 업무 | 8084 | +| SAL | 영업 업무 | 8082 | +| PRO | 상품 업무 | 8085 | +| SYS | 시스템·공통 시스템 업무 | 8086 | + +Tool명에는 Pod명을 넣지 않는다. Pod는 배포와 장애 격리 단위이고 Tool명은 업무 기능 식별자다. + +## 4. 구현 방식 선택 + +| 방식 | 선택 기준 | 핵심 Client | +|---|---|---| +| MCI | 인터페이스 ID와 정형 전문으로 연계 | `Mci{SystemCode}Client` | +| HTTP | JSON 기반 사내 API로 연계 | `{HttpApiName}Client` | +| 내부 로직 | 외부 연계 없이 계산·조회 가능 | UseCaseImpl 내부 서비스 | + +외부 연계가 있어도 Tool UseCase의 입출력은 항상 AI가 이해할 수 있는 업무 DTO로 유지한다. + +## 5. Scaffold로 기본 소스 생성 + +Scaffold 입력 시 최소한 다음 값을 정확히 지정한다. + +| 항목 | 예시 | 설명 | +|---|---|---| +| Target Module | `dap-was-sal` | 소스가 생성될 Tool Pod | +| Domain Category | `cmm` | 업무 패키지 및 Schema 경로 | +| Base Name | `ClaimSearch` | Java 클래스명 기준 | +| Tool Name | `cmm_claim_search` | MCP Tool 식별자 | +| Title | `보험금 청구 상태 조회` | 화면 표시용 짧은 명칭 | +| Description | `청구번호 또는 계약번호로 상태를 조회합니다.` | 기능 설명 | +| Routing Type | `MCI` 또는 `HTTP` | 연계 방식 | +| Interface ID | `CLCNNB00001` | MCI 선택 시 | +| Client System Code | `CFPA` | MCI Client 패키지/이름 기준 | +| HTTP API Name | `insurance` | HTTP 설정과 Client 연결 키 | + +기존 UseCase에 함수를 추가할 경우 대상 UseCase를 선택한다. Scaffold는 UseCase 인터페이스와 UseCaseImpl 양쪽에 같은 메서드를 추가해야 한다. MCI뿐 아니라 HTTP와 내부 로직도 여러 함수 구성을 지원해야 한다. + +## 6. 생성 결과 확인 + +### 6.1 공통 업무 파일 + +```text +biz/{category}/dto/{BaseName}Request.java +biz/{category}/dto/{BaseName}Response.java +biz/{category}/converter/{BaseName}Converter.java +biz/{category}/usecase/{BaseName}UseCase.java +biz/{category}/usecase/impl/{BaseName}UseCaseImpl.java +``` + +### 6.2 MCI 선택 시 + +```text +infra/itrf/mci/{clientSystemCode}/Mci{ClientSystemCode}Client.java +infra/itrf/mci/{clientSystemCode}/io/{InterfaceId}_I.java +infra/itrf/mci/{clientSystemCode}/io/{InterfaceId}_O.java +``` + +### 6.3 HTTP 선택 시 + +```text +infra/itrf/http/{httpApiName}/{HttpApiName}Client.java +infra/itrf/http/{httpApiName}/io/{BaseName}HttpRequest.java +infra/itrf/http/{httpApiName}/io/{BaseName}HttpResponse.java +``` + +### 6.4 리소스 + +```text +tool-definitions/{categoryKey}/{toolName}.yml +tool-schemas/{categoryKey}/*-input-schema.json +tool-schemas/{categoryKey}/*-output-schema.json +mock-responses/{toolName}.json +``` + +복잡한 Schema를 사용하지 않으면 JSON Schema 파일은 생략할 수 있다. + +## 7. DTO 작성 + +### 7.1 Request DTO + +- 자연어에서 추출할 수 있는 업무 용어로 필드명을 정한다. +- 필수값과 예시를 명시한다. +- 날짜, 금액, 코드의 형식을 description에 적는다. +- 중첩 구조는 의미 있는 inner class 또는 별도 DTO로 만든다. +- `List`과 `List`를 구분하고 복합 배열은 요소 필드를 정의한다. + +### 7.2 Response DTO + +- 레거시 전문 전체가 아닌 사용자에게 필요한 정보만 반환한다. +- 상태 코드와 상태명을 같이 제공한다. +- null과 빈 문자열을 구분한다. +- 배열 정렬 기준과 추가 결과 존재 여부를 설명한다. +- Output Schema를 사용할 때 실제 반환값이 Schema의 타입과 required 조건을 만족해야 한다. + +## 8. Converter 구현 + +Converter는 다음 두 방향을 담당한다. + +```text +Tool Request → MCI/HTTP Request +MCI/HTTP Response → Tool Response +``` + +MapStruct를 기본으로 사용하되, 날짜·코드·중첩 객체처럼 자동 매핑이 어려운 항목은 명시적으로 변환한다. + +```java +@Mapper(componentModel = "spring") +public interface ClaimSearchConverter { + CLCNNB00001_I toMciRequest(ClaimSearchRequest request); + ClaimSearchResponse toResponse(CLCNNB00001_O response); +} +``` + +필드명이 같더라도 중요한 업무 값은 테스트로 매핑 결과를 확인한다. + +## 9. MCI Tool 구현 절차 + +1. 인터페이스 ID와 요청·응답 전문을 확정한다. +2. `{InterfaceId}_I`, `{InterfaceId}_O`에 전문 구조를 구현한다. +3. Converter에서 Tool DTO와 전문 DTO를 변환한다. +4. `Mci{SystemCode}Client`가 `AxhubMciComponent`를 호출하도록 한다. +5. UseCaseImpl은 변환된 전문을 Client에 전달한다. +6. 응답 전문을 Tool Response로 변환한다. +7. 전문 오류 코드와 통신 예외를 사용자용 오류로 매핑한다. + +권장 UseCaseImpl 형태: + +```java +public ClaimSearchResponse searchClaim(ClaimSearchRequest request) { + CLCNNB00001_I mciRequest = converter.toMciRequest(request); + CLCNNB00001_O mciResponse = mciClient.call(mciRequest); + return converter.toResponse(mciResponse); +} +``` + +## 10. HTTP Tool 구현 절차 + +1. HTTP API Name, domain, url, method, content type을 확정한다. +2. HTTP 요청·응답 DTO를 작성한다. +3. `{HttpApiName}Client`를 작성한다. +4. Converter에서 Tool DTO와 HTTP DTO를 변환한다. +5. UseCaseImpl이 Client를 호출하고 응답을 변환한다. +6. 환경별 `application-glow-*.yml`에 API 설정을 반영한다. + +```yaml +glow: + communication: + http: + connection-timeout: 5 + read-timeout: 5 + api-list: + - name: insurance + domain: ${AXHUB_INSURANCE_HTTP_DOMAIN:http://localhost:${server.port}} + url: ${AXHUB_INSURANCE_HTTP_URL:/api/mock/http/ins_insurance_processor} + method: POST + content-type: application/json;charset=UTF-8 + biz-pod: false +``` + +`domain + url`이 최종 호출 주소가 된다. `name`은 Java Client의 `API_NAME`과 반드시 일치해야 한다. + +## 11. V17 메타데이터 작성 + +`tool-definitions/{categoryKey}/{toolName}.yml`에서 다음 항목을 업무 기준으로 수정한다. + +- `display_name` +- `description.function` +- `description.when_to_use` +- `description.when_not_to_use` +- `description.io_limits` +- `display_description` +- `example_queries` 3~10개 +- `read_only`, `destructive`, `idempotent` +- `parameters_schema` +- `tags` +- `legacy_interface_id` +- `required_env_keys` +- `owner_org` + +AI 자동 채움 결과는 초안으로만 사용하고, Tool 개발자가 인터페이스 정의서와 실제 소스를 기준으로 검수한다. + +## 12. Input/Output Schema 적용 + +### 단순 Tool + +- Request 필드에 `@Schema` 또는 `@McpToolParam` +- Response 클래스에 `@McpOutputSchema` +- DTO 기반 자동 Schema 생성 + +### 복잡한 Tool + +- `tool-schemas/{categoryKey}`에 JSON 파일 작성 +- `@GrowToolHint.inputSchemaResource` 지정 +- `@GrowToolHint.outputSchemaResource` 지정 +- 조건부 필드, 배열 요소, null 허용 여부까지 명시 + +JSON Schema에서 null을 허용하려면 타입 규칙에 명시해야 한다. Java 응답이 null을 반환하는데 Schema가 `string`이나 `integer`만 허용하면 실행 결과 검증에서 실패한다. + +## 13. 로컬 Mock 테스트 + +local 프로파일에서는 공통 Mock HTTP endpoint를 사용할 수 있다. + +```text +POST /api/mock/http/{toolName} +``` + +Mock 응답 파일은 다음 경로에서 Tool명과 맞춰 관리한다. + +```text +src/main/resources/mock-responses/{toolName}.json +``` + +파일명이 다르거나 classpath에 포함되지 않으면 `Not found in blob store`와 같은 오류가 발생할 수 있다. 파일명, 대소문자, 리소스 경로를 확인한다. + +## 14. Tool 테스트 콘솔 + +Tool Pod 실행 후 다음 주소로 접속한다. + +```text +http://localhost:{podPort}/tool-test-console.html +``` + +테스트 순서: + +1. Tool 목록 새로고침 +2. 대상 Tool 선택 +3. Schema 기반 샘플 요청 확인 +4. 정상 요청 실행 +5. 필수값 누락·형식 오류·경계값 실행 +6. 응답 결과와 Output Schema 검증 확인 +7. `trace-id`, `request-id` 및 처리 시간 확인 +8. 테스트 케이스 저장 후 회귀 테스트 + +## 15. 자동 검증 명령 + +```powershell +# 공통 단위 테스트 +.\gradlew.bat :dap-was-lib:test + +# 대상 Pod 테스트 +.\gradlew.bat :dap-was-cus:test + +# Tool명 중복 +.\gradlew.bat validateMcpToolNames + +# Tool Schema V17 +.\gradlew.bat validateToolSchemaV17 + +# 배포 산출물 생성: 위 두 검증이 자동 선행됨 +.\gradlew.bat :dap-was-cus:bootJar +``` + +Docker는 컴파일과 일반 단위 테스트에 필요하지 않다. 실제 HTTP/MCI Mock 컨테이너를 사용하는 연계 테스트에서만 실행한다. + +## 16. 장애 확인 순서 + +### Tool이 목록에 없을 때 + +1. UseCase 메서드에 `@McpTool`이 있는지 확인한다. +2. UseCase 구현체가 Spring Bean인지 확인한다. +3. `@GrowToolHint.register` 값을 확인한다. +4. Tool명과 V17 정의 파일의 `name`이 같은지 확인한다. +5. 애플리케이션의 component scan 범위를 확인한다. + +### HTTP 호출이 실패할 때 + +1. Client의 `API_NAME`을 확인한다. +2. `glow.communication.http.api-list[].name`과 비교한다. +3. `domain + url`을 확인한다. +4. method와 content-type을 확인한다. +5. timeout, 인증서, DNS, ACL을 확인한다. + +### MCI 호출이 실패할 때 + +1. 인터페이스 ID와 수신 서비스 ID를 확인한다. +2. host, port, uri를 확인한다. +3. 요청 전문 필드와 인코딩을 확인한다. +4. 공통 헤더와 세션성 값의 필요 여부를 확인한다. +5. MCI 응답 헤더의 결과 코드와 메시지를 확인한다. + +### Output Schema 검증이 실패할 때 + +1. 실제 응답 JSON을 확인한다. +2. null 허용 여부를 확인한다. +3. integer/string/array/object 타입을 비교한다. +4. required 필드가 실제로 항상 존재하는지 확인한다. +5. JSON Schema와 `@McpOutputSchema` 중 어떤 방식이 선택됐는지 확인한다. + +## 17. 개발 완료 체크리스트 + +- [ ] 올바른 Tool Pod와 category를 선택했다. +- [ ] Tool명이 정규식과 업무 명명 규칙을 만족한다. +- [ ] `@McpTool`의 title과 description을 구분해 작성했다. +- [ ] V17 정의 파일을 업무 내용으로 검수했다. +- [ ] Request/Response DTO와 연계 DTO를 분리했다. +- [ ] Converter 테스트를 작성했다. +- [ ] MCI 또는 HTTP Client가 공통 Component를 사용한다. +- [ ] endpoint와 Secret을 코드에 하드코딩하지 않았다. +- [ ] 정상·필수값 누락·타입 오류·경계값을 테스트했다. +- [ ] 응답에 불필요한 개인정보가 없다. +- [ ] Tool명 중복 검사와 V17 검증이 성공한다. +- [ ] 대상 Pod의 단위 테스트와 `bootJar`가 성공한다. +- [ ] Tool 테스트 콘솔에서 실제 실행 결과를 확인했다. + +## 18. 1차본 이후 보완 대상 + +다음 항목은 운영 표준이 확정되면 2차본에 반영한다. + +- 업무 도메인별 Pod 배치 기준의 상세화 +- 인증·암호화 사번 처리 최종 규격 +- 연계 오류 코드의 공통 사용자 메시지 표준 +- Tool별 SLA, Retry, Circuit Breaker 기준 +- 성능·부하·보안 테스트 기준 +- 운영 모니터링과 장애 대응 절차 diff --git a/docs/tool-guide/__pycache__/build_tool_guides_docx.cpython-312.pyc b/docs/tool-guide/__pycache__/build_tool_guides_docx.cpython-312.pyc new file mode 100644 index 00000000..1a44ca21 Binary files /dev/null and b/docs/tool-guide/__pycache__/build_tool_guides_docx.cpython-312.pyc differ diff --git a/docs/tool-guide/__pycache__/verify_tool_guides_docx.cpython-312.pyc b/docs/tool-guide/__pycache__/verify_tool_guides_docx.cpython-312.pyc new file mode 100644 index 00000000..eccc81c7 Binary files /dev/null and b/docs/tool-guide/__pycache__/verify_tool_guides_docx.cpython-312.pyc differ diff --git a/docs/tool-guide/build_tool_guides_docx.py b/docs/tool-guide/build_tool_guides_docx.py new file mode 100644 index 00000000..054e04be --- /dev/null +++ b/docs/tool-guide/build_tool_guides_docx.py @@ -0,0 +1,633 @@ +from __future__ import annotations + +import re +from pathlib import Path + +from docx import Document +from docx.enum.section import WD_SECTION +from docx.enum.table import WD_CELL_VERTICAL_ALIGNMENT, WD_TABLE_ALIGNMENT +from docx.enum.text import WD_ALIGN_PARAGRAPH, WD_BREAK, WD_LINE_SPACING +from docx.oxml import OxmlElement +from docx.oxml.ns import qn +from docx.shared import Inches, Pt, RGBColor + + +ROOT = Path(__file__).resolve().parent +OUTPUT_DIR = ROOT / "docx-professional" + +SOURCES = [ + ( + ROOT / "01-Tool-개발환경-가이드.md", + "개발 환경 가이드", + "Tool Pod 개발 환경과 내부망 반입 기준", + ("개발 환경", "실행·검증", "내부망 반입"), + ), + ( + ROOT / "02-Tool-설계-가이드.md", + "Tool 설계 가이드", + "명명·구조·Schema·MCI·Glow HTTP 설계 기준", + ("명명·패키지", "Input·Output Schema", "MCI·Glow HTTP"), + ), + ( + ROOT / "03-Tool-개발가이드-1차.md", + "Tool 개발 가이드 1차본", + "신규 Tool 구현·검증·완료 절차", + ("Scaffold", "구현·연계", "테스트·완료"), + ), +] + +FONT_BODY = "맑은 고딕" +FONT_CODE = "Consolas" +BLUE = "2E74B5" +DARK_BLUE = "1F4D78" +NAVY = "0B2545" +INK = "24364B" +MUTED = "667085" +LIGHT_BLUE = "E8EEF5" +LIGHT_GRAY = "F4F6F9" +SOFT_BLUE = "F1F6FB" +TABLE_ALT = "F8FAFC" +BORDER = "C9D2DE" +WHITE = "FFFFFF" +GOLD = "B88928" +CONTENT_DXA = 9360 +TABLE_INDENT_DXA = 120 + + +def set_run_font(run, name=FONT_BODY, size=None, color=None, bold=None, italic=None): + run.font.name = name + run._element.get_or_add_rPr().rFonts.set(qn("w:ascii"), name) + run._element.get_or_add_rPr().rFonts.set(qn("w:hAnsi"), name) + run._element.get_or_add_rPr().rFonts.set(qn("w:eastAsia"), name) + if size is not None: + run.font.size = Pt(size) + if color is not None: + run.font.color.rgb = RGBColor.from_string(color) + if bold is not None: + run.bold = bold + if italic is not None: + run.italic = italic + + +def set_cell_shading(cell, fill): + tc_pr = cell._tc.get_or_add_tcPr() + shd = tc_pr.find(qn("w:shd")) + if shd is None: + shd = OxmlElement("w:shd") + tc_pr.append(shd) + shd.set(qn("w:fill"), fill) + + +def set_cell_margins(cell, top=80, start=120, bottom=80, end=120): + tc = cell._tc + tc_pr = tc.get_or_add_tcPr() + tc_mar = tc_pr.first_child_found_in("w:tcMar") + if tc_mar is None: + tc_mar = OxmlElement("w:tcMar") + tc_pr.append(tc_mar) + for edge, value in (("top", top), ("start", start), ("bottom", bottom), ("end", end)): + node = tc_mar.find(qn(f"w:{edge}")) + if node is None: + node = OxmlElement(f"w:{edge}") + tc_mar.append(node) + node.set(qn("w:w"), str(value)) + node.set(qn("w:type"), "dxa") + + +def set_table_geometry(table, widths): + total = sum(widths) + if total != CONTENT_DXA: + widths[-1] += CONTENT_DXA - total + table.alignment = WD_TABLE_ALIGNMENT.LEFT + table.autofit = False + tbl_pr = table._tbl.tblPr + tbl_w = tbl_pr.find(qn("w:tblW")) + if tbl_w is None: + tbl_w = OxmlElement("w:tblW") + tbl_pr.append(tbl_w) + tbl_w.set(qn("w:w"), str(CONTENT_DXA)) + tbl_w.set(qn("w:type"), "dxa") + tbl_ind = tbl_pr.find(qn("w:tblInd")) + if tbl_ind is None: + tbl_ind = OxmlElement("w:tblInd") + tbl_pr.append(tbl_ind) + tbl_ind.set(qn("w:w"), str(TABLE_INDENT_DXA)) + tbl_ind.set(qn("w:type"), "dxa") + grid = table._tbl.tblGrid + for child in list(grid): + grid.remove(child) + for width in widths: + col = OxmlElement("w:gridCol") + col.set(qn("w:w"), str(width)) + grid.append(col) + for row in table.rows: + for idx, cell in enumerate(row.cells): + cell.width = Inches(widths[idx] / 1440) + tc_w = cell._tc.get_or_add_tcPr().find(qn("w:tcW")) + if tc_w is None: + tc_w = OxmlElement("w:tcW") + cell._tc.get_or_add_tcPr().append(tc_w) + tc_w.set(qn("w:w"), str(widths[idx])) + tc_w.set(qn("w:type"), "dxa") + set_cell_margins(cell) + cell.vertical_alignment = WD_CELL_VERTICAL_ALIGNMENT.CENTER + + +def repeat_table_header(row): + tr_pr = row._tr.get_or_add_trPr() + header = OxmlElement("w:tblHeader") + header.set(qn("w:val"), "true") + tr_pr.append(header) + + +def add_page_number(paragraph): + run = paragraph.add_run() + begin = OxmlElement("w:fldChar") + begin.set(qn("w:fldCharType"), "begin") + instruction = OxmlElement("w:instrText") + instruction.set(qn("xml:space"), "preserve") + instruction.text = " PAGE " + separate = OxmlElement("w:fldChar") + separate.set(qn("w:fldCharType"), "separate") + text = OxmlElement("w:t") + text.text = "1" + end = OxmlElement("w:fldChar") + end.set(qn("w:fldCharType"), "end") + run._r.extend([begin, instruction, separate, text, end]) + set_run_font(run, size=9, color=MUTED) + + +def add_bottom_border(paragraph, color=BORDER, size="6"): + p_pr = paragraph._p.get_or_add_pPr() + p_bdr = p_pr.find(qn("w:pBdr")) + if p_bdr is None: + p_bdr = OxmlElement("w:pBdr") + p_pr.append(p_bdr) + bottom = OxmlElement("w:bottom") + bottom.set(qn("w:val"), "single") + bottom.set(qn("w:sz"), size) + bottom.set(qn("w:space"), "1") + bottom.set(qn("w:color"), color) + p_bdr.append(bottom) + + +def add_top_border(paragraph, color=BORDER, size="6"): + p_pr = paragraph._p.get_or_add_pPr() + p_bdr = p_pr.find(qn("w:pBdr")) + if p_bdr is None: + p_bdr = OxmlElement("w:pBdr") + p_pr.append(p_bdr) + top = OxmlElement("w:top") + top.set(qn("w:val"), "single") + top.set(qn("w:sz"), size) + top.set(qn("w:space"), "1") + top.set(qn("w:color"), color) + p_bdr.append(top) + + +def add_left_border(paragraph, color=BLUE, size="18"): + p_pr = paragraph._p.get_or_add_pPr() + p_bdr = p_pr.find(qn("w:pBdr")) + if p_bdr is None: + p_bdr = OxmlElement("w:pBdr") + p_pr.append(p_bdr) + left = OxmlElement("w:left") + left.set(qn("w:val"), "single") + left.set(qn("w:sz"), size) + left.set(qn("w:space"), "8") + left.set(qn("w:color"), color) + p_bdr.append(left) + + +def configure_styles(doc): + normal = doc.styles["Normal"] + normal.font.name = FONT_BODY + normal._element.rPr.rFonts.set(qn("w:eastAsia"), FONT_BODY) + normal.font.size = Pt(11) + normal.font.color.rgb = RGBColor.from_string(INK) + normal.paragraph_format.space_before = Pt(0) + normal.paragraph_format.space_after = Pt(6) + normal.paragraph_format.line_spacing = 1.25 + + specs = { + "Title": (30, NAVY, 0, 8), + "Subtitle": (13.5, MUTED, 0, 18), + "Heading 1": (16, NAVY, 18, 10), + "Heading 2": (13, BLUE, 14, 7), + "Heading 3": (12, DARK_BLUE, 10, 5), + } + for style_name, (size, color, before, after) in specs.items(): + style = doc.styles[style_name] + style.font.name = FONT_BODY + style._element.rPr.rFonts.set(qn("w:eastAsia"), FONT_BODY) + style.font.size = Pt(size) + style.font.color.rgb = RGBColor.from_string(color) + style.font.bold = style_name != "Subtitle" + style.paragraph_format.space_before = Pt(before) + style.paragraph_format.space_after = Pt(after) + style.paragraph_format.keep_with_next = True + + for style_name in ("List Bullet", "List Number"): + style = doc.styles[style_name] + style.font.name = FONT_BODY + style._element.rPr.rFonts.set(qn("w:eastAsia"), FONT_BODY) + style.font.size = Pt(11) + style.paragraph_format.left_indent = Inches(0.375) + style.paragraph_format.first_line_indent = Inches(-0.188) + style.paragraph_format.space_after = Pt(4) + style.paragraph_format.line_spacing = 1.25 + + +def configure_section_geometry(section): + section.page_width = Inches(8.5) + section.page_height = Inches(11) + section.top_margin = Inches(1) + section.bottom_margin = Inches(1) + section.left_margin = Inches(1) + section.right_margin = Inches(1) + section.header_distance = Inches(0.492) + section.footer_distance = Inches(0.492) + + +def clear_paragraph(paragraph): + for child in list(paragraph._p): + if child.tag != qn("w:pPr"): + paragraph._p.remove(child) + + +def set_page_number_start(section, start=1): + sect_pr = section._sectPr + page_num = sect_pr.find(qn("w:pgNumType")) + if page_num is None: + page_num = OxmlElement("w:pgNumType") + sect_pr.append(page_num) + page_num.set(qn("w:start"), str(start)) + + +def configure_cover_section(section): + configure_section_geometry(section) + section.header.is_linked_to_previous = False + section.footer.is_linked_to_previous = False + clear_paragraph(section.header.paragraphs[0]) + clear_paragraph(section.footer.paragraphs[0]) + + +def configure_content_section(section, short_title): + configure_section_geometry(section) + section.header.is_linked_to_previous = False + section.footer.is_linked_to_previous = False + set_page_number_start(section, 1) + + header_p = section.header.paragraphs[0] + clear_paragraph(header_p) + header_p.paragraph_format.space_after = Pt(4) + header_p.paragraph_format.tab_stops.add_tab_stop(Inches(6.5)) + left = header_p.add_run(short_title) + set_run_font(left, size=8.5, color=NAVY, bold=True) + right = header_p.add_run("\tAX HUB · TOOL DEVELOPMENT STANDARD") + set_run_font(right, size=8.2, color=MUTED) + add_bottom_border(header_p, "D7DEE8", "4") + + footer_p = section.footer.paragraphs[0] + clear_paragraph(footer_p) + footer_p.paragraph_format.tab_stops.add_tab_stop(Inches(6.5)) + left = footer_p.add_run("INTERNAL USE · TOOL POD DEVELOPMENT") + set_run_font(left, size=8.2, color=MUTED) + right = footer_p.add_run("\t") + set_run_font(right, size=8.2, color=MUTED) + add_page_number(footer_p) + + +def add_inline(paragraph, text, default_size=11, default_color=None): + token_pattern = re.compile(r"(\*\*.+?\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\))") + cursor = 0 + for match in token_pattern.finditer(text): + if match.start() > cursor: + run = paragraph.add_run(text[cursor:match.start()]) + set_run_font(run, size=default_size, color=default_color) + token = match.group(0) + if token.startswith("**"): + run = paragraph.add_run(token[2:-2]) + set_run_font(run, size=default_size, color=default_color, bold=True) + elif token.startswith("`"): + run = paragraph.add_run(token[1:-1]) + set_run_font(run, name=FONT_CODE, size=max(8.5, default_size - 1), color=DARK_BLUE) + shd = OxmlElement("w:shd") + shd.set(qn("w:fill"), "EEF2F6") + run._r.get_or_add_rPr().append(shd) + else: + label, url = re.match(r"\[([^\]]+)\]\(([^)]+)\)", token).groups() + run = paragraph.add_run(label) + set_run_font(run, size=default_size, color=BLUE) + run.underline = True + cursor = match.end() + if cursor < len(text): + run = paragraph.add_run(text[cursor:]) + set_run_font(run, size=default_size, color=default_color) + + +def add_cover(doc, title, subtitle, doc_type, highlights): + p = doc.add_paragraph() + p.alignment = WD_ALIGN_PARAGRAPH.CENTER + p.paragraph_format.space_before = Pt(88) + p.paragraph_format.space_after = Pt(20) + r = p.add_run("AX HUB | TOOL DEVELOPMENT STANDARD") + set_run_font(r, size=9.5, color=GOLD, bold=True) + + title_p = doc.add_paragraph(style="Title") + title_p.alignment = WD_ALIGN_PARAGRAPH.CENTER + title_p.paragraph_format.space_after = Pt(10) + add_inline(title_p, title, default_size=30, default_color=NAVY) + + subtitle_p = doc.add_paragraph(style="Subtitle") + subtitle_p.alignment = WD_ALIGN_PARAGRAPH.CENTER + add_inline(subtitle_p, subtitle, default_size=13.5, default_color=DARK_BLUE) + + rule = doc.add_paragraph() + rule.paragraph_format.left_indent = Inches(1.55) + rule.paragraph_format.right_indent = Inches(1.55) + rule.paragraph_format.space_after = Pt(24) + add_bottom_border(rule, GOLD, "10") + + focus = doc.add_paragraph() + focus.alignment = WD_ALIGN_PARAGRAPH.CENTER + focus.paragraph_format.space_after = Pt(86) + focus_run = focus.add_run(" · ".join(highlights)) + set_run_font(focus_run, size=10.5, color=BLUE, bold=True) + + rows = [ + ("문서 구분", doc_type), + ("기준 버전", "1차본 | 2026-08-14"), + ("적용 범위", "dap-was-lib 및 Tool Pod (CUS · SAL · PRO · SYS)"), + ] + for label, value in rows: + p = doc.add_paragraph() + p.alignment = WD_ALIGN_PARAGRAPH.CENTER + p.paragraph_format.first_line_indent = Inches(0) + p.paragraph_format.space_after = Pt(5) + label_run = p.add_run(f"{label} | ") + set_run_font(label_run, size=9.2, color=MUTED, bold=True) + value_run = p.add_run(value) + set_run_font(value_run, size=9.5, color=INK) + + +def extract_section_titles(markdown_text): + return [ + line.removeprefix("## ").strip() + for line in markdown_text.splitlines() + if line.startswith("## ") + ] + + +def add_document_overview(doc, subtitle, markdown_text): + heading = doc.add_heading("문서 안내", level=1) + add_bottom_border(heading, LIGHT_BLUE, "8") + + lead = doc.add_paragraph() + lead.paragraph_format.space_after = Pt(10) + run = lead.add_run(subtitle) + set_run_font(run, size=11.5, color=NAVY, bold=True) + + p = doc.add_paragraph() + p.paragraph_format.left_indent = Inches(0.12) + p.paragraph_format.right_indent = Inches(0.12) + p.paragraph_format.space_before = Pt(2) + p.paragraph_format.space_after = Pt(12) + p_pr = p._p.get_or_add_pPr() + shd = OxmlElement("w:shd") + shd.set(qn("w:fill"), SOFT_BLUE) + p_pr.append(shd) + add_left_border(p, BLUE, "20") + marker = p.add_run("READING GUIDE ") + set_run_font(marker, size=9, color=BLUE, bold=True) + body = p.add_run("이 문서는 Tool Pod 개발자가 설계·구현·검증 과정에서 바로 참고할 수 있도록 현재 소스 기준으로 정리했습니다.") + set_run_font(body, size=10.2, color=INK) + + section_heading = doc.add_heading("주요 구성", level=2) + section_heading.paragraph_format.space_after = Pt(6) + for title in extract_section_titles(markdown_text): + item = doc.add_paragraph(style="List Bullet") + add_inline(item, title, default_size=10.2, default_color=INK) + + rule = doc.add_paragraph() + rule.paragraph_format.space_before = Pt(6) + rule.paragraph_format.space_after = Pt(4) + add_bottom_border(rule, "D7DEE8", "4") + + +def is_table_separator(line): + cells = [c.strip() for c in line.strip().strip("|").split("|")] + return bool(cells) and all(re.fullmatch(r":?-{3,}:?", cell or "") for cell in cells) + + +def parse_table(lines, start): + rows = [] + idx = start + while idx < len(lines) and lines[idx].strip().startswith("|"): + if not is_table_separator(lines[idx]): + rows.append([c.strip() for c in lines[idx].strip().strip("|").split("|")]) + idx += 1 + return rows, idx + + +def table_widths(rows): + col_count = max(len(row) for row in rows) + weights = [] + for col in range(col_count): + max_len = max(len(row[col]) if col < len(row) else 0 for row in rows) + weights.append(max(8, min(max_len, 48))) + total = sum(weights) + widths = [max(900, round(CONTENT_DXA * weight / total)) for weight in weights] + scale = CONTENT_DXA / sum(widths) + widths = [round(width * scale) for width in widths] + widths[-1] += CONTENT_DXA - sum(widths) + return widths + + +def add_markdown_table(doc, rows): + if not rows: + return + col_count = max(len(row) for row in rows) + table = doc.add_table(rows=len(rows), cols=col_count) + table.style = "Table Grid" + for row_idx, values in enumerate(rows): + for col_idx in range(col_count): + cell = table.cell(row_idx, col_idx) + cell.text = "" + p = cell.paragraphs[0] + p.paragraph_format.space_before = Pt(0) + p.paragraph_format.space_after = Pt(0) + p.paragraph_format.line_spacing = 1.15 + value = values[col_idx] if col_idx < len(values) else "" + add_inline(p, value, default_size=8.8 if col_count >= 4 else 9.2) + if row_idx == 0: + set_cell_shading(cell, NAVY) + p.alignment = WD_ALIGN_PARAGRAPH.CENTER + for run in p.runs: + run.bold = True + run.font.color.rgb = RGBColor.from_string(WHITE) + elif row_idx % 2 == 0: + set_cell_shading(cell, TABLE_ALT) + if row_idx > 0: + column_values = [row[col_idx] if col_idx < len(row) else "" for row in rows[1:]] + if column_values and max(len(value) for value in column_values) <= 12: + p.alignment = WD_ALIGN_PARAGRAPH.CENTER + repeat_table_header(table.rows[0]) + set_table_geometry(table, table_widths(rows)) + after = doc.add_paragraph() + after.paragraph_format.space_after = Pt(2) + + +def add_code_block(doc, code_lines): + if not code_lines: + return + p = doc.add_paragraph() + p.paragraph_format.left_indent = Inches(0.12) + p.paragraph_format.right_indent = Inches(0.12) + p.paragraph_format.space_before = Pt(3) + p.paragraph_format.space_after = Pt(8) + p.paragraph_format.line_spacing = 1.0 + p.paragraph_format.keep_together = len(code_lines) <= 12 + p_pr = p._p.get_or_add_pPr() + shd = OxmlElement("w:shd") + shd.set(qn("w:fill"), "F5F7FA") + p_pr.append(shd) + add_left_border(p, BLUE, "16") + for index, line in enumerate(code_lines): + run = p.add_run(line) + set_run_font(run, name=FONT_CODE, size=8.2, color=NAVY) + if index < len(code_lines) - 1: + run.add_break() + + +def add_callout(doc, text): + p = doc.add_paragraph() + p.paragraph_format.left_indent = Inches(0.12) + p.paragraph_format.right_indent = Inches(0.12) + p.paragraph_format.space_before = Pt(3) + p.paragraph_format.space_after = Pt(8) + p_pr = p._p.get_or_add_pPr() + shd = OxmlElement("w:shd") + shd.set(qn("w:fill"), SOFT_BLUE) + p_pr.append(shd) + add_left_border(p) + marker = p.add_run("NOTE ") + set_run_font(marker, size=9.5, color=BLUE, bold=True) + add_inline(p, text, default_size=10) + + +def add_markdown_body(doc, markdown_text): + lines = markdown_text.splitlines() + first_h1_seen = False + in_code = False + code_lines = [] + idx = 0 + while idx < len(lines): + raw = lines[idx] + line = raw.rstrip() + stripped = line.strip() + + if stripped.startswith("```"): + if in_code: + add_code_block(doc, code_lines) + code_lines = [] + in_code = False + else: + in_code = True + idx += 1 + continue + if in_code: + code_lines.append(line) + idx += 1 + continue + if not stripped: + idx += 1 + continue + if stripped.startswith("# ") and not first_h1_seen: + first_h1_seen = True + idx += 1 + continue + if stripped.startswith("### "): + doc.add_heading(stripped[4:], level=2) + idx += 1 + continue + if stripped.startswith("## "): + heading = doc.add_heading(stripped[3:], level=1) + add_bottom_border(heading, LIGHT_BLUE, "8") + idx += 1 + continue + if stripped.startswith("# "): + heading = doc.add_heading(stripped[2:], level=1) + add_bottom_border(heading, LIGHT_BLUE, "8") + idx += 1 + continue + if stripped.startswith("|") and idx + 1 < len(lines) and is_table_separator(lines[idx + 1]): + rows, idx = parse_table(lines, idx) + add_markdown_table(doc, rows) + continue + if stripped.startswith("> "): + add_callout(doc, stripped[2:]) + idx += 1 + continue + match_ordered = re.match(r"^\d+\.\s+(.*)$", stripped) + if match_ordered: + p = doc.add_paragraph(style="List Number") + add_inline(p, match_ordered.group(1)) + idx += 1 + continue + if stripped.startswith("- [ ] "): + p = doc.add_paragraph(style="List Bullet") + add_inline(p, "☐ " + stripped[6:]) + idx += 1 + continue + if stripped.startswith("- "): + p = doc.add_paragraph(style="List Bullet") + add_inline(p, stripped[2:]) + idx += 1 + continue + p = doc.add_paragraph() + add_inline(p, stripped) + idx += 1 + if code_lines: + add_code_block(doc, code_lines) + + +def set_document_properties(doc, title): + props = doc.core_properties + props.title = title + props.subject = "AX HUB Tool 개발 표준" + props.author = "AX HUB MCP & TOOL" + props.keywords = "AX HUB, Tool Pod, MCP, Glow, MCI, HTTP" + props.comments = "Tool Pod 개발자용 문서" + + +def build(source_path, short_title, subtitle, highlights): + markdown = source_path.read_text(encoding="utf-8") + first_line = markdown.splitlines()[0] + full_title = first_line.removeprefix("# ").strip() + + doc = Document() + configure_styles(doc) + set_document_properties(doc, full_title) + configure_cover_section(doc.sections[0]) + add_cover(doc, full_title, subtitle, short_title, highlights) + + content_section = doc.add_section(WD_SECTION.NEW_PAGE) + configure_content_section(content_section, short_title) + add_document_overview(doc, subtitle, markdown) + add_markdown_body(doc, markdown) + + output = OUTPUT_DIR / f"{source_path.stem}.docx" + doc.save(output) + return output + + +def main(): + OUTPUT_DIR.mkdir(parents=True, exist_ok=True) + for source, short_title, subtitle, highlights in SOURCES: + output = build(source, short_title, subtitle, highlights) + print(output) + + +if __name__ == "__main__": + main() diff --git a/docs/tool-guide/docx-professional/01-Tool-개발환경-가이드.docx b/docs/tool-guide/docx-professional/01-Tool-개발환경-가이드.docx new file mode 100644 index 00000000..414c2c52 Binary files /dev/null and b/docs/tool-guide/docx-professional/01-Tool-개발환경-가이드.docx differ diff --git a/docs/tool-guide/docx-professional/02-Tool-설계-가이드.docx b/docs/tool-guide/docx-professional/02-Tool-설계-가이드.docx new file mode 100644 index 00000000..965e75ba Binary files /dev/null and b/docs/tool-guide/docx-professional/02-Tool-설계-가이드.docx differ diff --git a/docs/tool-guide/docx-professional/03-Tool-개발가이드-1차.docx b/docs/tool-guide/docx-professional/03-Tool-개발가이드-1차.docx new file mode 100644 index 00000000..baecf4aa Binary files /dev/null and b/docs/tool-guide/docx-professional/03-Tool-개발가이드-1차.docx differ diff --git a/docs/tool-guide/docx/01-Tool-개발환경-가이드.docx b/docs/tool-guide/docx/01-Tool-개발환경-가이드.docx new file mode 100644 index 00000000..f44657f9 Binary files /dev/null and b/docs/tool-guide/docx/01-Tool-개발환경-가이드.docx differ diff --git a/docs/tool-guide/docx/02-Tool-설계-가이드.docx b/docs/tool-guide/docx/02-Tool-설계-가이드.docx new file mode 100644 index 00000000..2d50093f Binary files /dev/null and b/docs/tool-guide/docx/02-Tool-설계-가이드.docx differ diff --git a/docs/tool-guide/docx/03-Tool-개발가이드-1차.docx b/docs/tool-guide/docx/03-Tool-개발가이드-1차.docx new file mode 100644 index 00000000..3b2d3a92 Binary files /dev/null and b/docs/tool-guide/docx/03-Tool-개발가이드-1차.docx differ diff --git a/docs/tool-guide/verify_tool_guides_docx.py b/docs/tool-guide/verify_tool_guides_docx.py new file mode 100644 index 00000000..1b13921f --- /dev/null +++ b/docs/tool-guide/verify_tool_guides_docx.py @@ -0,0 +1,132 @@ +from __future__ import annotations + +import re +import zipfile +from pathlib import Path + +from docx import Document +from docx.oxml.ns import qn + + +ROOT = Path(__file__).resolve().parent +DOCX_DIR = ROOT / "docx-professional" + + +def dxa(value): + return round(value.inches * 1440) + + +def all_text(doc): + values = [p.text for p in doc.paragraphs] + for table in doc.tables: + for row in table.rows: + values.extend(cell.text for cell in row.cells) + return "\n".join(values) + + +def table_geometry_errors(table, index): + errors = [] + tbl_pr = table._tbl.tblPr + tbl_w = tbl_pr.find(qn("w:tblW")) + if tbl_w is None or tbl_w.get(qn("w:w")) != "9360": + errors.append(f"table {index}: tblW != 9360") + tbl_ind = tbl_pr.find(qn("w:tblInd")) + if tbl_ind is None or tbl_ind.get(qn("w:w")) != "120": + errors.append(f"table {index}: tblInd != 120") + grid_widths = [int(c.get(qn("w:w"))) for c in table._tbl.tblGrid] + if sum(grid_widths) != 9360: + errors.append(f"table {index}: grid sum={sum(grid_widths)}") + for row_index, row in enumerate(table.rows): + widths = [] + for cell in row.cells: + tc_w = cell._tc.get_or_add_tcPr().find(qn("w:tcW")) + if tc_w is None: + errors.append(f"table {index} row {row_index}: missing tcW") + continue + widths.append(int(tc_w.get(qn("w:w")))) + if widths and sum(widths) != 9360: + errors.append(f"table {index} row {row_index}: cell sum={sum(widths)}") + return errors + + +def verify(source, output): + errors = [] + with zipfile.ZipFile(output) as package: + bad = package.testzip() + if bad: + errors.append(f"broken ZIP member: {bad}") + + doc = Document(output) + text = all_text(doc) + source_text = source.read_text(encoding="utf-8") + expected_title = source_text.splitlines()[0].removeprefix("# ").strip() + if expected_title not in text: + errors.append("title missing") + for heading in re.findall(r"^##\s+(.+)$", source_text, re.MULTILINE): + if heading not in text: + errors.append(f"heading missing: {heading}") + if "�" in text or "\ufeff" in text: + errors.append("invalid/replacement Unicode character") + if re.search(r"\b(gateway|portal|router)\b", text, re.IGNORECASE): + errors.append("out-of-scope routing term found") + if len(doc.paragraphs) < 35: + errors.append(f"too few paragraphs: {len(doc.paragraphs)}") + if len(doc.tables) < 2: + errors.append(f"too few tables: {len(doc.tables)}") + + for section_index, section in enumerate(doc.sections): + values = { + "page_width": dxa(section.page_width), + "page_height": dxa(section.page_height), + "top_margin": dxa(section.top_margin), + "bottom_margin": dxa(section.bottom_margin), + "left_margin": dxa(section.left_margin), + "right_margin": dxa(section.right_margin), + } + expected = { + "page_width": 12240, + "page_height": 15840, + "top_margin": 1440, + "bottom_margin": 1440, + "left_margin": 1440, + "right_margin": 1440, + } + for key, expected_value in expected.items(): + if abs(values[key] - expected_value) > 2: + errors.append(f"section {section_index}: {key}={values[key]}") + footer_xml = section.footer._element.xml + if section_index > 0 and " PAGE " not in footer_xml: + errors.append(f"section {section_index}: page field missing") + + for index, table in enumerate(doc.tables): + errors.extend(table_geometry_errors(table, index)) + + return { + "file": output.name, + "paragraphs": len(doc.paragraphs), + "tables": len(doc.tables), + "sections": len(doc.sections), + "errors": errors, + } + + +def main(): + pairs = [ + (ROOT / "01-Tool-개발환경-가이드.md", DOCX_DIR / "01-Tool-개발환경-가이드.docx"), + (ROOT / "02-Tool-설계-가이드.md", DOCX_DIR / "02-Tool-설계-가이드.docx"), + (ROOT / "03-Tool-개발가이드-1차.md", DOCX_DIR / "03-Tool-개발가이드-1차.docx"), + ] + failed = False + for source, output in pairs: + result = verify(source, output) + print(f"{result['file']}: paragraphs={result['paragraphs']}, tables={result['tables']}, sections={result['sections']}") + for error in result["errors"]: + failed = True + print(f" ERROR: {error}") + if failed: + raise SystemExit(1) + print("DOCX structural QA passed") + + +if __name__ == "__main__": + main() diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 00000000..94c31f8f --- /dev/null +++ b/gradle.properties @@ -0,0 +1 @@ +org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 diff --git a/scratch/fetch_mcp_tools.py b/scratch/fetch_mcp_tools.py new file mode 100644 index 00000000..32731475 --- /dev/null +++ b/scratch/fetch_mcp_tools.py @@ -0,0 +1,42 @@ +import requests +import json +import sseclient +import threading +import sys + +def main(): + url = "https://axhubmcp.devjun.net/mcp/custom/cmm" + + # 1. Start SSE connection + response = requests.get(url, stream=True, verify=False) + client = sseclient.SSEClient(response) + + post_url = None + + # We will read events in a background thread to not block the main thread + for event in client.events(): + if event.event == 'endpoint': + # 2. Get POST endpoint + post_url = event.data + if not post_url.startswith('http'): + # Assuming relative URL, construct absolute + from urllib.parse import urljoin + post_url = urljoin(url, post_url) + + # Send tools/list request + payload = { + "jsonrpc": "2.0", + "id": 1, + "method": "tools/list" + } + requests.post(post_url, json=payload, verify=False) + + elif event.event == 'message': + data = json.loads(event.data) + if data.get('id') == 1: + # 3. Print tools/list response + print(json.dumps(data, indent=2, ensure_ascii=False)) + sys.exit(0) + +if __name__ == '__main__': + main() diff --git a/scratch/print_tools_json.py b/scratch/print_tools_json.py new file mode 100644 index 00000000..47d7d3a7 --- /dev/null +++ b/scratch/print_tools_json.py @@ -0,0 +1,40 @@ +import yaml +import json +import glob +import sys + +def main(): + tools = [] + + # cmm 폴더의 yaml 파일들을 읽습니다. + files = glob.glob('dap-was-cus/src/main/resources/tool-definitions/cmm/*.yml') + if not files: + files = glob.glob('dap-was-sal/src/main/resources/tool-definitions/cmm/*.yml') + + for f in files: + with open(f, 'r', encoding='utf-8') as file: + data = yaml.safe_load(file) + + # MCP JSON Schema 규격에 맞게 변환 + tool = { + "name": data.get("name"), + "description": data.get("description", {}).get("function", "") if isinstance(data.get("description"), dict) else data.get("description", ""), + "inputSchema": data.get("parameters_schema", { + "type": "object", + "properties": {} + }) + } + tools.append(tool) + + response = { + "jsonrpc": "2.0", + "id": 1, + "result": { + "tools": tools + } + } + + print(json.dumps(response, indent=2, ensure_ascii=False)) + +if __name__ == '__main__': + main() diff --git a/tmp_ppt_aa/node_modules/@oai/artifact-tool/LICENSE.md b/tmp_ppt_aa/node_modules/@oai/artifact-tool/LICENSE.md new file mode 100644 index 00000000..605c0d8a --- /dev/null +++ b/tmp_ppt_aa/node_modules/@oai/artifact-tool/LICENSE.md @@ -0,0 +1,18 @@ +PROPRIETARY AND CONFIDENTIAL + +Copyright © 2026 OpenAI, L.L.C. +All rights reserved. + +This software and any associated materials (the "Software") are proprietary and confidential information of OpenAI, L.L.C. + +Subject to your compliance with this license, OpenAI, L.L.C. grants you a non-exclusive, non-transferable, revocable, limited license to use the Software solely for internal evaluation and testing purposes. + +You may not, without prior written permission from OpenAI, L.L.C.: +- Copy, modify, distribute, sublicense, sell, lease, or otherwise make the Software available to any third party +- Use the Software for production, commercial, or benchmarking purposes +- Reverse engineer, decompile, disassemble, or otherwise attempt to derive the source code, underlying ideas, algorithms, or models of the Software +- Remove or obscure any proprietary notices + +The Software is provided "AS IS", without warranty of any kind, express or implied, including but not limited to warranties of merchantability, fitness for a particular purpose, or non-infringement. + +This license is effective until terminated. OpenAI, L.L.C. may terminate this license at any time, with or without notice. Upon termination, you must immediately cease all use of the Software and destroy all copies in your possession or control. diff --git a/tmp_ppt_aa/node_modules/@oai/artifact-tool/dist/artifact_tool.mjs b/tmp_ppt_aa/node_modules/@oai/artifact-tool/dist/artifact_tool.mjs new file mode 100644 index 00000000..ba6037a8 --- /dev/null +++ b/tmp_ppt_aa/node_modules/@oai/artifact-tool/dist/artifact_tool.mjs @@ -0,0 +1,3213 @@ +import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url); +var sEr=Object.create;var GBe=Object.defineProperty;var lEr=Object.getOwnPropertyDescriptor;var cEr=Object.getOwnPropertyNames;var uEr=Object.getPrototypeOf;var dEr=Object.prototype.hasOwnProperty;var mce=(e=>typeof require!=="undefined"?require:typeof Proxy!=="undefined"?new Proxy(e,{get:(t,n)=>(typeof require!=="undefined"?require:t)[n]}):e)(function(e){if(typeof require!=="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Ce=(e,t)=>()=>(e&&(t=e(e=0)),t);var _r=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Oo=(e,t)=>{for(var n in t)GBe(e,n,{get:t[n],enumerable:true})};var fEr=(e,t,n,r)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let i of cEr(t))if(!dEr.call(e,i)&&i!==n)GBe(e,i,{get:()=>t[i],enumerable:!(r=lEr(t,i))||r.enumerable})}return e};var Ui=(e,t,n)=>(n=e!=null?sEr(uEr(e)):{},fEr(t||!e||!e.__esModule?GBe(n,"default",{value:e,enumerable:true}):n,e));function bEr(e){return e&&e>0?e:hEr}function _Ct(e){return Math.ceil(bEr(e))}function og(e,t){if(e==null||e<=0)return vCt;return e*_Ct(t)}function xEr(e){if(e==null||e<=0)return 0;const t=e;if(t>=1){return Math.floor((t*256+Math.floor(128/7))/256*7)}return Math.max(0,Math.floor(t*12))}function rIo(e){if(e==null||e<=0)return vCt;const t=xEr(e);return t+5}function cz(e,t){if(!Number.isFinite(e)||e<=0){return 0}const n=e/_Ct(t);return Math.round(n*100)/100}function Bu(e){const t=e==null||e===0?ig:e;return t*96/72}function gce(e){if(!Number.isFinite(e??0)){return ig}return(e??0)*72/96}function PI(e){const t=e>0?e:11;return{padLr:Math.max(gEr,Math.floor(t*pEr)),padTb:Math.max(yEr,Math.floor(t*mEr))}}function gf(e){let t="";e+=1;while(e){const n=(e-1)%26;t=String.fromCharCode(65+n)+t;e=Math.floor((e-n)/26)}return t}function ps(e){const t=e.match(/[A-Z]+/);if(!t)return 0;let n=0;for(const r of t[0])n=n*26+(r.charCodeAt(0)-64);return n-1}function vl(e){const t=e.match(/\d+/);return t?parseInt(t[0],10)-1:0}function HBe(e){const t=e.replace(/^0x/i,"");if(t.length===8){const n=1;const r=parseInt(t.slice(2,4),16);const i=parseInt(t.slice(4,6),16);const o=parseInt(t.slice(6,8),16);return`rgba(${r}, ${i}, ${o}, ${n.toFixed(3)})`}if(t.length===6)return`#${t}`;return"#ffffff"}function uz(e){if(e==null)return void 0;if(e===64)return"#000000";const t=["#000000","#FFFFFF","#FF0000","#00FF00","#0000FF","#FFFF00","#FF00FF","#00FFFF","#000000","#FFFFFF","#FF0000","#00FF00","#0000FF","#FFFF00","#FF00FF","#00FFFF","#800000","#008000","#000080","#808000","#800080","#008080","#C0C0C0","#808080","#9999FF","#993366","#FFFFCC","#CCFFFF","#660066","#FF8080","#0066CC","#CCCCFF","#000080","#FF00FF","#FFFF00","#00FFFF","#800080","#800000","#008080","#0000FF","#00CCFF","#CCFFFF","#CCFFCC","#FFFF99","#99CCFF","#FF99CC","#CC99FF","#FFCC99","#3366FF","#33CCCC","#99CC00","#FFCC00","#FF9900","#FF6600","#666699","#969696","#003366","#339966","#003300","#333300","#993300","#993366","#333399","#333333"];return t[e]}var LA,vCt,lz,ig,Nl,Ol,hEr,pEr,mEr,gEr,yEr;var Yl=Ce(()=>{LA=8.43;vCt=64;lz=59;ig=15;Nl=40;Ol=20;hEr=7;pEr=.1;mEr=0;gEr=2;yEr=4/3});function fi(e){const t=q2(e);if(!t)return null;const n=t.split(":");const r=n[0];if(!r)return null;const i=n[1]??r;const o=vl(r);const a=ps(r);const s=vl(i);const l=ps(i);const u={startRow:Math.min(o,s),startCol:Math.min(a,l),endRow:Math.max(o,s),endCol:Math.max(a,l)};return{ref:Io(u),bounds:u}}function Io(e){const t=ho(e.startRow,e.startCol);const n=ho(e.endRow,e.endCol);return t===n?t:`${t}:${n}`}function ho(e,t){return`${gf(t)}${e+1}`}function q2(e){const t=e.trim();if(!t)return null;const n=t.includes("!")?t.slice(t.indexOf("!")+1):t;return n.replace(/\$/g,"").toUpperCase()}function x0(e){return{rows:e.endRow-e.startRow+1,cols:e.endCol-e.startCol+1}}function S4(e,t){return e.startRow<=t.endRow&&e.endRow>=t.startRow&&e.startCol<=t.endCol&&e.endCol>=t.startCol}function Pl(e){const t=e.startsWith("=")?e.slice(1):e;const n=t.indexOf("!");if(n===-1){const a=fi(t);return{ref:a?.ref??t}}const r=t.slice(0,n);const i=t.slice(n+1);const o=fi(i);return{sheetName:vEr(r),ref:o?.ref??i}}function vEr(e){if(e.startsWith("'")&&e.endsWith("'")&&e.length>=2){return e.slice(1,-1).replace(/''/g,"'")}return e}var bs=Ce(()=>{Yl()});var Ype=_r((Wpe,FX)=>{(function(e){var t=typeof Wpe=="object"&&Wpe;var n=typeof FX=="object"&&FX&&FX.exports==t&&FX;var r=typeof global=="object"&&global;if(r.global===r||r.window===r){e=r}var i=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;var o=/[\x01-\x7F]/g;var a=/[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g;var s=/<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g;var l={"\xAD":"shy","\u200C":"zwnj","\u200D":"zwj","\u200E":"lrm","\u2063":"ic","\u2062":"it","\u2061":"af","\u200F":"rlm","\u200B":"ZeroWidthSpace","\u2060":"NoBreak","\u0311":"DownBreve","\u20DB":"tdot","\u20DC":"DotDot"," ":"Tab","\n":"NewLine","\u2008":"puncsp","\u205F":"MediumSpace","\u2009":"thinsp","\u200A":"hairsp","\u2004":"emsp13","\u2002":"ensp","\u2005":"emsp14","\u2003":"emsp","\u2007":"numsp","\xA0":"nbsp","\u205F\u200A":"ThickSpace","\u203E":"oline","_":"lowbar","\u2010":"dash","\u2013":"ndash","\u2014":"mdash","\u2015":"horbar",",":"comma",";":"semi","\u204F":"bsemi",":":"colon","\u2A74":"Colone","!":"excl","\xA1":"iexcl","?":"quest","\xBF":"iquest",".":"period","\u2025":"nldr","\u2026":"mldr","\xB7":"middot","'":"apos","\u2018":"lsquo","\u2019":"rsquo","\u201A":"sbquo","\u2039":"lsaquo","\u203A":"rsaquo",'"':"quot","\u201C":"ldquo","\u201D":"rdquo","\u201E":"bdquo","\xAB":"laquo","\xBB":"raquo","(":"lpar",")":"rpar","[":"lsqb","]":"rsqb","{":"lcub","}":"rcub","\u2308":"lceil","\u2309":"rceil","\u230A":"lfloor","\u230B":"rfloor","\u2985":"lopar","\u2986":"ropar","\u298B":"lbrke","\u298C":"rbrke","\u298D":"lbrkslu","\u298E":"rbrksld","\u298F":"lbrksld","\u2990":"rbrkslu","\u2991":"langd","\u2992":"rangd","\u2993":"lparlt","\u2994":"rpargt","\u2995":"gtlPar","\u2996":"ltrPar","\u27E6":"lobrk","\u27E7":"robrk","\u27E8":"lang","\u27E9":"rang","\u27EA":"Lang","\u27EB":"Rang","\u27EC":"loang","\u27ED":"roang","\u2772":"lbbrk","\u2773":"rbbrk","\u2016":"Vert","\xA7":"sect","\xB6":"para","@":"commat","*":"ast","/":"sol","undefined":null,"&":"amp","#":"num","%":"percnt","\u2030":"permil","\u2031":"pertenk","\u2020":"dagger","\u2021":"Dagger","\u2022":"bull","\u2043":"hybull","\u2032":"prime","\u2033":"Prime","\u2034":"tprime","\u2057":"qprime","\u2035":"bprime","\u2041":"caret","`":"grave","\xB4":"acute","\u02DC":"tilde","^":"Hat","\xAF":"macr","\u02D8":"breve","\u02D9":"dot","\xA8":"die","\u02DA":"ring","\u02DD":"dblac","\xB8":"cedil","\u02DB":"ogon","\u02C6":"circ","\u02C7":"caron","\xB0":"deg","\xA9":"copy","\xAE":"reg","\u2117":"copysr","\u2118":"wp","\u211E":"rx","\u2127":"mho","\u2129":"iiota","\u2190":"larr","\u219A":"nlarr","\u2192":"rarr","\u219B":"nrarr","\u2191":"uarr","\u2193":"darr","\u2194":"harr","\u21AE":"nharr","\u2195":"varr","\u2196":"nwarr","\u2197":"nearr","\u2198":"searr","\u2199":"swarr","\u219D":"rarrw","\u219D\u0338":"nrarrw","\u219E":"Larr","\u219F":"Uarr","\u21A0":"Rarr","\u21A1":"Darr","\u21A2":"larrtl","\u21A3":"rarrtl","\u21A4":"mapstoleft","\u21A5":"mapstoup","\u21A6":"map","\u21A7":"mapstodown","\u21A9":"larrhk","\u21AA":"rarrhk","\u21AB":"larrlp","\u21AC":"rarrlp","\u21AD":"harrw","\u21B0":"lsh","\u21B1":"rsh","\u21B2":"ldsh","\u21B3":"rdsh","\u21B5":"crarr","\u21B6":"cularr","\u21B7":"curarr","\u21BA":"olarr","\u21BB":"orarr","\u21BC":"lharu","\u21BD":"lhard","\u21BE":"uharr","\u21BF":"uharl","\u21C0":"rharu","\u21C1":"rhard","\u21C2":"dharr","\u21C3":"dharl","\u21C4":"rlarr","\u21C5":"udarr","\u21C6":"lrarr","\u21C7":"llarr","\u21C8":"uuarr","\u21C9":"rrarr","\u21CA":"ddarr","\u21CB":"lrhar","\u21CC":"rlhar","\u21D0":"lArr","\u21CD":"nlArr","\u21D1":"uArr","\u21D2":"rArr","\u21CF":"nrArr","\u21D3":"dArr","\u21D4":"iff","\u21CE":"nhArr","\u21D5":"vArr","\u21D6":"nwArr","\u21D7":"neArr","\u21D8":"seArr","\u21D9":"swArr","\u21DA":"lAarr","\u21DB":"rAarr","\u21DD":"zigrarr","\u21E4":"larrb","\u21E5":"rarrb","\u21F5":"duarr","\u21FD":"loarr","\u21FE":"roarr","\u21FF":"hoarr","\u2200":"forall","\u2201":"comp","\u2202":"part","\u2202\u0338":"npart","\u2203":"exist","\u2204":"nexist","\u2205":"empty","\u2207":"Del","\u2208":"in","\u2209":"notin","\u220B":"ni","\u220C":"notni","\u03F6":"bepsi","\u220F":"prod","\u2210":"coprod","\u2211":"sum","+":"plus","\xB1":"pm","\xF7":"div","\xD7":"times","<":"lt","\u226E":"nlt","<\u20D2":"nvlt","=":"equals","\u2260":"ne","=\u20E5":"bne","\u2A75":"Equal",">":"gt","\u226F":"ngt",">\u20D2":"nvgt","\xAC":"not","|":"vert","\xA6":"brvbar","\u2212":"minus","\u2213":"mp","\u2214":"plusdo","\u2044":"frasl","\u2216":"setmn","\u2217":"lowast","\u2218":"compfn","\u221A":"Sqrt","\u221D":"prop","\u221E":"infin","\u221F":"angrt","\u2220":"ang","\u2220\u20D2":"nang","\u2221":"angmsd","\u2222":"angsph","\u2223":"mid","\u2224":"nmid","\u2225":"par","\u2226":"npar","\u2227":"and","\u2228":"or","\u2229":"cap","\u2229\uFE00":"caps","\u222A":"cup","\u222A\uFE00":"cups","\u222B":"int","\u222C":"Int","\u222D":"tint","\u2A0C":"qint","\u222E":"oint","\u222F":"Conint","\u2230":"Cconint","\u2231":"cwint","\u2232":"cwconint","\u2233":"awconint","\u2234":"there4","\u2235":"becaus","\u2236":"ratio","\u2237":"Colon","\u2238":"minusd","\u223A":"mDDot","\u223B":"homtht","\u223C":"sim","\u2241":"nsim","\u223C\u20D2":"nvsim","\u223D":"bsim","\u223D\u0331":"race","\u223E":"ac","\u223E\u0333":"acE","\u223F":"acd","\u2240":"wr","\u2242":"esim","\u2242\u0338":"nesim","\u2243":"sime","\u2244":"nsime","\u2245":"cong","\u2247":"ncong","\u2246":"simne","\u2248":"ap","\u2249":"nap","\u224A":"ape","\u224B":"apid","\u224B\u0338":"napid","\u224C":"bcong","\u224D":"CupCap","\u226D":"NotCupCap","\u224D\u20D2":"nvap","\u224E":"bump","\u224E\u0338":"nbump","\u224F":"bumpe","\u224F\u0338":"nbumpe","\u2250":"doteq","\u2250\u0338":"nedot","\u2251":"eDot","\u2252":"efDot","\u2253":"erDot","\u2254":"colone","\u2255":"ecolon","\u2256":"ecir","\u2257":"cire","\u2259":"wedgeq","\u225A":"veeeq","\u225C":"trie","\u225F":"equest","\u2261":"equiv","\u2262":"nequiv","\u2261\u20E5":"bnequiv","\u2264":"le","\u2270":"nle","\u2264\u20D2":"nvle","\u2265":"ge","\u2271":"nge","\u2265\u20D2":"nvge","\u2266":"lE","\u2266\u0338":"nlE","\u2267":"gE","\u2267\u0338":"ngE","\u2268\uFE00":"lvnE","\u2268":"lnE","\u2269":"gnE","\u2269\uFE00":"gvnE","\u226A":"ll","\u226A\u0338":"nLtv","\u226A\u20D2":"nLt","\u226B":"gg","\u226B\u0338":"nGtv","\u226B\u20D2":"nGt","\u226C":"twixt","\u2272":"lsim","\u2274":"nlsim","\u2273":"gsim","\u2275":"ngsim","\u2276":"lg","\u2278":"ntlg","\u2277":"gl","\u2279":"ntgl","\u227A":"pr","\u2280":"npr","\u227B":"sc","\u2281":"nsc","\u227C":"prcue","\u22E0":"nprcue","\u227D":"sccue","\u22E1":"nsccue","\u227E":"prsim","\u227F":"scsim","\u227F\u0338":"NotSucceedsTilde","\u2282":"sub","\u2284":"nsub","\u2282\u20D2":"vnsub","\u2283":"sup","\u2285":"nsup","\u2283\u20D2":"vnsup","\u2286":"sube","\u2288":"nsube","\u2287":"supe","\u2289":"nsupe","\u228A\uFE00":"vsubne","\u228A":"subne","\u228B\uFE00":"vsupne","\u228B":"supne","\u228D":"cupdot","\u228E":"uplus","\u228F":"sqsub","\u228F\u0338":"NotSquareSubset","\u2290":"sqsup","\u2290\u0338":"NotSquareSuperset","\u2291":"sqsube","\u22E2":"nsqsube","\u2292":"sqsupe","\u22E3":"nsqsupe","\u2293":"sqcap","\u2293\uFE00":"sqcaps","\u2294":"sqcup","\u2294\uFE00":"sqcups","\u2295":"oplus","\u2296":"ominus","\u2297":"otimes","\u2298":"osol","\u2299":"odot","\u229A":"ocir","\u229B":"oast","\u229D":"odash","\u229E":"plusb","\u229F":"minusb","\u22A0":"timesb","\u22A1":"sdotb","\u22A2":"vdash","\u22AC":"nvdash","\u22A3":"dashv","\u22A4":"top","\u22A5":"bot","\u22A7":"models","\u22A8":"vDash","\u22AD":"nvDash","\u22A9":"Vdash","\u22AE":"nVdash","\u22AA":"Vvdash","\u22AB":"VDash","\u22AF":"nVDash","\u22B0":"prurel","\u22B2":"vltri","\u22EA":"nltri","\u22B3":"vrtri","\u22EB":"nrtri","\u22B4":"ltrie","\u22EC":"nltrie","\u22B4\u20D2":"nvltrie","\u22B5":"rtrie","\u22ED":"nrtrie","\u22B5\u20D2":"nvrtrie","\u22B6":"origof","\u22B7":"imof","\u22B8":"mumap","\u22B9":"hercon","\u22BA":"intcal","\u22BB":"veebar","\u22BD":"barvee","\u22BE":"angrtvb","\u22BF":"lrtri","\u22C0":"Wedge","\u22C1":"Vee","\u22C2":"xcap","\u22C3":"xcup","\u22C4":"diam","\u22C5":"sdot","\u22C6":"Star","\u22C7":"divonx","\u22C8":"bowtie","\u22C9":"ltimes","\u22CA":"rtimes","\u22CB":"lthree","\u22CC":"rthree","\u22CD":"bsime","\u22CE":"cuvee","\u22CF":"cuwed","\u22D0":"Sub","\u22D1":"Sup","\u22D2":"Cap","\u22D3":"Cup","\u22D4":"fork","\u22D5":"epar","\u22D6":"ltdot","\u22D7":"gtdot","\u22D8":"Ll","\u22D8\u0338":"nLl","\u22D9":"Gg","\u22D9\u0338":"nGg","\u22DA\uFE00":"lesg","\u22DA":"leg","\u22DB":"gel","\u22DB\uFE00":"gesl","\u22DE":"cuepr","\u22DF":"cuesc","\u22E6":"lnsim","\u22E7":"gnsim","\u22E8":"prnsim","\u22E9":"scnsim","\u22EE":"vellip","\u22EF":"ctdot","\u22F0":"utdot","\u22F1":"dtdot","\u22F2":"disin","\u22F3":"isinsv","\u22F4":"isins","\u22F5":"isindot","\u22F5\u0338":"notindot","\u22F6":"notinvc","\u22F7":"notinvb","\u22F9":"isinE","\u22F9\u0338":"notinE","\u22FA":"nisd","\u22FB":"xnis","\u22FC":"nis","\u22FD":"notnivc","\u22FE":"notnivb","\u2305":"barwed","\u2306":"Barwed","\u230C":"drcrop","\u230D":"dlcrop","\u230E":"urcrop","\u230F":"ulcrop","\u2310":"bnot","\u2312":"profline","\u2313":"profsurf","\u2315":"telrec","\u2316":"target","\u231C":"ulcorn","\u231D":"urcorn","\u231E":"dlcorn","\u231F":"drcorn","\u2322":"frown","\u2323":"smile","\u232D":"cylcty","\u232E":"profalar","\u2336":"topbot","\u233D":"ovbar","\u233F":"solbar","\u237C":"angzarr","\u23B0":"lmoust","\u23B1":"rmoust","\u23B4":"tbrk","\u23B5":"bbrk","\u23B6":"bbrktbrk","\u23DC":"OverParenthesis","\u23DD":"UnderParenthesis","\u23DE":"OverBrace","\u23DF":"UnderBrace","\u23E2":"trpezium","\u23E7":"elinters","\u2423":"blank","\u2500":"boxh","\u2502":"boxv","\u250C":"boxdr","\u2510":"boxdl","\u2514":"boxur","\u2518":"boxul","\u251C":"boxvr","\u2524":"boxvl","\u252C":"boxhd","\u2534":"boxhu","\u253C":"boxvh","\u2550":"boxH","\u2551":"boxV","\u2552":"boxdR","\u2553":"boxDr","\u2554":"boxDR","\u2555":"boxdL","\u2556":"boxDl","\u2557":"boxDL","\u2558":"boxuR","\u2559":"boxUr","\u255A":"boxUR","\u255B":"boxuL","\u255C":"boxUl","\u255D":"boxUL","\u255E":"boxvR","\u255F":"boxVr","\u2560":"boxVR","\u2561":"boxvL","\u2562":"boxVl","\u2563":"boxVL","\u2564":"boxHd","\u2565":"boxhD","\u2566":"boxHD","\u2567":"boxHu","\u2568":"boxhU","\u2569":"boxHU","\u256A":"boxvH","\u256B":"boxVh","\u256C":"boxVH","\u2580":"uhblk","\u2584":"lhblk","\u2588":"block","\u2591":"blk14","\u2592":"blk12","\u2593":"blk34","\u25A1":"squ","\u25AA":"squf","\u25AB":"EmptyVerySmallSquare","\u25AD":"rect","\u25AE":"marker","\u25B1":"fltns","\u25B3":"xutri","\u25B4":"utrif","\u25B5":"utri","\u25B8":"rtrif","\u25B9":"rtri","\u25BD":"xdtri","\u25BE":"dtrif","\u25BF":"dtri","\u25C2":"ltrif","\u25C3":"ltri","\u25CA":"loz","\u25CB":"cir","\u25EC":"tridot","\u25EF":"xcirc","\u25F8":"ultri","\u25F9":"urtri","\u25FA":"lltri","\u25FB":"EmptySmallSquare","\u25FC":"FilledSmallSquare","\u2605":"starf","\u2606":"star","\u260E":"phone","\u2640":"female","\u2642":"male","\u2660":"spades","\u2663":"clubs","\u2665":"hearts","\u2666":"diams","\u266A":"sung","\u2713":"check","\u2717":"cross","\u2720":"malt","\u2736":"sext","\u2758":"VerticalSeparator","\u27C8":"bsolhsub","\u27C9":"suphsol","\u27F5":"xlarr","\u27F6":"xrarr","\u27F7":"xharr","\u27F8":"xlArr","\u27F9":"xrArr","\u27FA":"xhArr","\u27FC":"xmap","\u27FF":"dzigrarr","\u2902":"nvlArr","\u2903":"nvrArr","\u2904":"nvHarr","\u2905":"Map","\u290C":"lbarr","\u290D":"rbarr","\u290E":"lBarr","\u290F":"rBarr","\u2910":"RBarr","\u2911":"DDotrahd","\u2912":"UpArrowBar","\u2913":"DownArrowBar","\u2916":"Rarrtl","\u2919":"latail","\u291A":"ratail","\u291B":"lAtail","\u291C":"rAtail","\u291D":"larrfs","\u291E":"rarrfs","\u291F":"larrbfs","\u2920":"rarrbfs","\u2923":"nwarhk","\u2924":"nearhk","\u2925":"searhk","\u2926":"swarhk","\u2927":"nwnear","\u2928":"toea","\u2929":"tosa","\u292A":"swnwar","\u2933":"rarrc","\u2933\u0338":"nrarrc","\u2935":"cudarrr","\u2936":"ldca","\u2937":"rdca","\u2938":"cudarrl","\u2939":"larrpl","\u293C":"curarrm","\u293D":"cularrp","\u2945":"rarrpl","\u2948":"harrcir","\u2949":"Uarrocir","\u294A":"lurdshar","\u294B":"ldrushar","\u294E":"LeftRightVector","\u294F":"RightUpDownVector","\u2950":"DownLeftRightVector","\u2951":"LeftUpDownVector","\u2952":"LeftVectorBar","\u2953":"RightVectorBar","\u2954":"RightUpVectorBar","\u2955":"RightDownVectorBar","\u2956":"DownLeftVectorBar","\u2957":"DownRightVectorBar","\u2958":"LeftUpVectorBar","\u2959":"LeftDownVectorBar","\u295A":"LeftTeeVector","\u295B":"RightTeeVector","\u295C":"RightUpTeeVector","\u295D":"RightDownTeeVector","\u295E":"DownLeftTeeVector","\u295F":"DownRightTeeVector","\u2960":"LeftUpTeeVector","\u2961":"LeftDownTeeVector","\u2962":"lHar","\u2963":"uHar","\u2964":"rHar","\u2965":"dHar","\u2966":"luruhar","\u2967":"ldrdhar","\u2968":"ruluhar","\u2969":"rdldhar","\u296A":"lharul","\u296B":"llhard","\u296C":"rharul","\u296D":"lrhard","\u296E":"udhar","\u296F":"duhar","\u2970":"RoundImplies","\u2971":"erarr","\u2972":"simrarr","\u2973":"larrsim","\u2974":"rarrsim","\u2975":"rarrap","\u2976":"ltlarr","\u2978":"gtrarr","\u2979":"subrarr","\u297B":"suplarr","\u297C":"lfisht","\u297D":"rfisht","\u297E":"ufisht","\u297F":"dfisht","\u299A":"vzigzag","\u299C":"vangrt","\u299D":"angrtvbd","\u29A4":"ange","\u29A5":"range","\u29A6":"dwangle","\u29A7":"uwangle","\u29A8":"angmsdaa","\u29A9":"angmsdab","\u29AA":"angmsdac","\u29AB":"angmsdad","\u29AC":"angmsdae","\u29AD":"angmsdaf","\u29AE":"angmsdag","\u29AF":"angmsdah","\u29B0":"bemptyv","\u29B1":"demptyv","\u29B2":"cemptyv","\u29B3":"raemptyv","\u29B4":"laemptyv","\u29B5":"ohbar","\u29B6":"omid","\u29B7":"opar","\u29B9":"operp","\u29BB":"olcross","\u29BC":"odsold","\u29BE":"olcir","\u29BF":"ofcir","\u29C0":"olt","\u29C1":"ogt","\u29C2":"cirscir","\u29C3":"cirE","\u29C4":"solb","\u29C5":"bsolb","\u29C9":"boxbox","\u29CD":"trisb","\u29CE":"rtriltri","\u29CF":"LeftTriangleBar","\u29CF\u0338":"NotLeftTriangleBar","\u29D0":"RightTriangleBar","\u29D0\u0338":"NotRightTriangleBar","\u29DC":"iinfin","\u29DD":"infintie","\u29DE":"nvinfin","\u29E3":"eparsl","\u29E4":"smeparsl","\u29E5":"eqvparsl","\u29EB":"lozf","\u29F4":"RuleDelayed","\u29F6":"dsol","\u2A00":"xodot","\u2A01":"xoplus","\u2A02":"xotime","\u2A04":"xuplus","\u2A06":"xsqcup","\u2A0D":"fpartint","\u2A10":"cirfnint","\u2A11":"awint","\u2A12":"rppolint","\u2A13":"scpolint","\u2A14":"npolint","\u2A15":"pointint","\u2A16":"quatint","\u2A17":"intlarhk","\u2A22":"pluscir","\u2A23":"plusacir","\u2A24":"simplus","\u2A25":"plusdu","\u2A26":"plussim","\u2A27":"plustwo","\u2A29":"mcomma","\u2A2A":"minusdu","\u2A2D":"loplus","\u2A2E":"roplus","\u2A2F":"Cross","\u2A30":"timesd","\u2A31":"timesbar","\u2A33":"smashp","\u2A34":"lotimes","\u2A35":"rotimes","\u2A36":"otimesas","\u2A37":"Otimes","\u2A38":"odiv","\u2A39":"triplus","\u2A3A":"triminus","\u2A3B":"tritime","\u2A3C":"iprod","\u2A3F":"amalg","\u2A40":"capdot","\u2A42":"ncup","\u2A43":"ncap","\u2A44":"capand","\u2A45":"cupor","\u2A46":"cupcap","\u2A47":"capcup","\u2A48":"cupbrcap","\u2A49":"capbrcup","\u2A4A":"cupcup","\u2A4B":"capcap","\u2A4C":"ccups","\u2A4D":"ccaps","\u2A50":"ccupssm","\u2A53":"And","\u2A54":"Or","\u2A55":"andand","\u2A56":"oror","\u2A57":"orslope","\u2A58":"andslope","\u2A5A":"andv","\u2A5B":"orv","\u2A5C":"andd","\u2A5D":"ord","\u2A5F":"wedbar","\u2A66":"sdote","\u2A6A":"simdot","\u2A6D":"congdot","\u2A6D\u0338":"ncongdot","\u2A6E":"easter","\u2A6F":"apacir","\u2A70":"apE","\u2A70\u0338":"napE","\u2A71":"eplus","\u2A72":"pluse","\u2A73":"Esim","\u2A77":"eDDot","\u2A78":"equivDD","\u2A79":"ltcir","\u2A7A":"gtcir","\u2A7B":"ltquest","\u2A7C":"gtquest","\u2A7D":"les","\u2A7D\u0338":"nles","\u2A7E":"ges","\u2A7E\u0338":"nges","\u2A7F":"lesdot","\u2A80":"gesdot","\u2A81":"lesdoto","\u2A82":"gesdoto","\u2A83":"lesdotor","\u2A84":"gesdotol","\u2A85":"lap","\u2A86":"gap","\u2A87":"lne","\u2A88":"gne","\u2A89":"lnap","\u2A8A":"gnap","\u2A8B":"lEg","\u2A8C":"gEl","\u2A8D":"lsime","\u2A8E":"gsime","\u2A8F":"lsimg","\u2A90":"gsiml","\u2A91":"lgE","\u2A92":"glE","\u2A93":"lesges","\u2A94":"gesles","\u2A95":"els","\u2A96":"egs","\u2A97":"elsdot","\u2A98":"egsdot","\u2A99":"el","\u2A9A":"eg","\u2A9D":"siml","\u2A9E":"simg","\u2A9F":"simlE","\u2AA0":"simgE","\u2AA1":"LessLess","\u2AA1\u0338":"NotNestedLessLess","\u2AA2":"GreaterGreater","\u2AA2\u0338":"NotNestedGreaterGreater","\u2AA4":"glj","\u2AA5":"gla","\u2AA6":"ltcc","\u2AA7":"gtcc","\u2AA8":"lescc","\u2AA9":"gescc","\u2AAA":"smt","\u2AAB":"lat","\u2AAC":"smte","\u2AAC\uFE00":"smtes","\u2AAD":"late","\u2AAD\uFE00":"lates","\u2AAE":"bumpE","\u2AAF":"pre","\u2AAF\u0338":"npre","\u2AB0":"sce","\u2AB0\u0338":"nsce","\u2AB3":"prE","\u2AB4":"scE","\u2AB5":"prnE","\u2AB6":"scnE","\u2AB7":"prap","\u2AB8":"scap","\u2AB9":"prnap","\u2ABA":"scnap","\u2ABB":"Pr","\u2ABC":"Sc","\u2ABD":"subdot","\u2ABE":"supdot","\u2ABF":"subplus","\u2AC0":"supplus","\u2AC1":"submult","\u2AC2":"supmult","\u2AC3":"subedot","\u2AC4":"supedot","\u2AC5":"subE","\u2AC5\u0338":"nsubE","\u2AC6":"supE","\u2AC6\u0338":"nsupE","\u2AC7":"subsim","\u2AC8":"supsim","\u2ACB\uFE00":"vsubnE","\u2ACB":"subnE","\u2ACC\uFE00":"vsupnE","\u2ACC":"supnE","\u2ACF":"csub","\u2AD0":"csup","\u2AD1":"csube","\u2AD2":"csupe","\u2AD3":"subsup","\u2AD4":"supsub","\u2AD5":"subsub","\u2AD6":"supsup","\u2AD7":"suphsub","\u2AD8":"supdsub","\u2AD9":"forkv","\u2ADA":"topfork","\u2ADB":"mlcp","\u2AE4":"Dashv","\u2AE6":"Vdashl","\u2AE7":"Barv","\u2AE8":"vBar","\u2AE9":"vBarv","\u2AEB":"Vbar","\u2AEC":"Not","\u2AED":"bNot","\u2AEE":"rnmid","\u2AEF":"cirmid","\u2AF0":"midcir","\u2AF1":"topcir","\u2AF2":"nhpar","\u2AF3":"parsim","\u2AFD":"parsl","\u2AFD\u20E5":"nparsl","\u266D":"flat","\u266E":"natur","\u266F":"sharp","\xA4":"curren","\xA2":"cent","$":"dollar","\xA3":"pound","\xA5":"yen","\u20AC":"euro","\xB9":"sup1","\xBD":"half","\u2153":"frac13","\xBC":"frac14","\u2155":"frac15","\u2159":"frac16","\u215B":"frac18","\xB2":"sup2","\u2154":"frac23","\u2156":"frac25","\xB3":"sup3","\xBE":"frac34","\u2157":"frac35","\u215C":"frac38","\u2158":"frac45","\u215A":"frac56","\u215D":"frac58","\u215E":"frac78","\u{1D4B6}":"ascr","\u{1D552}":"aopf","\u{1D51E}":"afr","\u{1D538}":"Aopf","\u{1D504}":"Afr","\u{1D49C}":"Ascr","\xAA":"ordf","\xE1":"aacute","\xC1":"Aacute","\xE0":"agrave","\xC0":"Agrave","\u0103":"abreve","\u0102":"Abreve","\xE2":"acirc","\xC2":"Acirc","\xE5":"aring","\xC5":"angst","\xE4":"auml","\xC4":"Auml","\xE3":"atilde","\xC3":"Atilde","\u0105":"aogon","\u0104":"Aogon","\u0101":"amacr","\u0100":"Amacr","\xE6":"aelig","\xC6":"AElig","\u{1D4B7}":"bscr","\u{1D553}":"bopf","\u{1D51F}":"bfr","\u{1D539}":"Bopf","\u212C":"Bscr","\u{1D505}":"Bfr","\u{1D520}":"cfr","\u{1D4B8}":"cscr","\u{1D554}":"copf","\u212D":"Cfr","\u{1D49E}":"Cscr","\u2102":"Copf","\u0107":"cacute","\u0106":"Cacute","\u0109":"ccirc","\u0108":"Ccirc","\u010D":"ccaron","\u010C":"Ccaron","\u010B":"cdot","\u010A":"Cdot","\xE7":"ccedil","\xC7":"Ccedil","\u2105":"incare","\u{1D521}":"dfr","\u2146":"dd","\u{1D555}":"dopf","\u{1D4B9}":"dscr","\u{1D49F}":"Dscr","\u{1D507}":"Dfr","\u2145":"DD","\u{1D53B}":"Dopf","\u010F":"dcaron","\u010E":"Dcaron","\u0111":"dstrok","\u0110":"Dstrok","\xF0":"eth","\xD0":"ETH","\u2147":"ee","\u212F":"escr","\u{1D522}":"efr","\u{1D556}":"eopf","\u2130":"Escr","\u{1D508}":"Efr","\u{1D53C}":"Eopf","\xE9":"eacute","\xC9":"Eacute","\xE8":"egrave","\xC8":"Egrave","\xEA":"ecirc","\xCA":"Ecirc","\u011B":"ecaron","\u011A":"Ecaron","\xEB":"euml","\xCB":"Euml","\u0117":"edot","\u0116":"Edot","\u0119":"eogon","\u0118":"Eogon","\u0113":"emacr","\u0112":"Emacr","\u{1D523}":"ffr","\u{1D557}":"fopf","\u{1D4BB}":"fscr","\u{1D509}":"Ffr","\u{1D53D}":"Fopf","\u2131":"Fscr","\uFB00":"fflig","\uFB03":"ffilig","\uFB04":"ffllig","\uFB01":"filig","fj":"fjlig","\uFB02":"fllig","\u0192":"fnof","\u210A":"gscr","\u{1D558}":"gopf","\u{1D524}":"gfr","\u{1D4A2}":"Gscr","\u{1D53E}":"Gopf","\u{1D50A}":"Gfr","\u01F5":"gacute","\u011F":"gbreve","\u011E":"Gbreve","\u011D":"gcirc","\u011C":"Gcirc","\u0121":"gdot","\u0120":"Gdot","\u0122":"Gcedil","\u{1D525}":"hfr","\u210E":"planckh","\u{1D4BD}":"hscr","\u{1D559}":"hopf","\u210B":"Hscr","\u210C":"Hfr","\u210D":"Hopf","\u0125":"hcirc","\u0124":"Hcirc","\u210F":"hbar","\u0127":"hstrok","\u0126":"Hstrok","\u{1D55A}":"iopf","\u{1D526}":"ifr","\u{1D4BE}":"iscr","\u2148":"ii","\u{1D540}":"Iopf","\u2110":"Iscr","\u2111":"Im","\xED":"iacute","\xCD":"Iacute","\xEC":"igrave","\xCC":"Igrave","\xEE":"icirc","\xCE":"Icirc","\xEF":"iuml","\xCF":"Iuml","\u0129":"itilde","\u0128":"Itilde","\u0130":"Idot","\u012F":"iogon","\u012E":"Iogon","\u012B":"imacr","\u012A":"Imacr","\u0133":"ijlig","\u0132":"IJlig","\u0131":"imath","\u{1D4BF}":"jscr","\u{1D55B}":"jopf","\u{1D527}":"jfr","\u{1D4A5}":"Jscr","\u{1D50D}":"Jfr","\u{1D541}":"Jopf","\u0135":"jcirc","\u0134":"Jcirc","\u0237":"jmath","\u{1D55C}":"kopf","\u{1D4C0}":"kscr","\u{1D528}":"kfr","\u{1D4A6}":"Kscr","\u{1D542}":"Kopf","\u{1D50E}":"Kfr","\u0137":"kcedil","\u0136":"Kcedil","\u{1D529}":"lfr","\u{1D4C1}":"lscr","\u2113":"ell","\u{1D55D}":"lopf","\u2112":"Lscr","\u{1D50F}":"Lfr","\u{1D543}":"Lopf","\u013A":"lacute","\u0139":"Lacute","\u013E":"lcaron","\u013D":"Lcaron","\u013C":"lcedil","\u013B":"Lcedil","\u0142":"lstrok","\u0141":"Lstrok","\u0140":"lmidot","\u013F":"Lmidot","\u{1D52A}":"mfr","\u{1D55E}":"mopf","\u{1D4C2}":"mscr","\u{1D510}":"Mfr","\u{1D544}":"Mopf","\u2133":"Mscr","\u{1D52B}":"nfr","\u{1D55F}":"nopf","\u{1D4C3}":"nscr","\u2115":"Nopf","\u{1D4A9}":"Nscr","\u{1D511}":"Nfr","\u0144":"nacute","\u0143":"Nacute","\u0148":"ncaron","\u0147":"Ncaron","\xF1":"ntilde","\xD1":"Ntilde","\u0146":"ncedil","\u0145":"Ncedil","\u2116":"numero","\u014B":"eng","\u014A":"ENG","\u{1D560}":"oopf","\u{1D52C}":"ofr","\u2134":"oscr","\u{1D4AA}":"Oscr","\u{1D512}":"Ofr","\u{1D546}":"Oopf","\xBA":"ordm","\xF3":"oacute","\xD3":"Oacute","\xF2":"ograve","\xD2":"Ograve","\xF4":"ocirc","\xD4":"Ocirc","\xF6":"ouml","\xD6":"Ouml","\u0151":"odblac","\u0150":"Odblac","\xF5":"otilde","\xD5":"Otilde","\xF8":"oslash","\xD8":"Oslash","\u014D":"omacr","\u014C":"Omacr","\u0153":"oelig","\u0152":"OElig","\u{1D52D}":"pfr","\u{1D4C5}":"pscr","\u{1D561}":"popf","\u2119":"Popf","\u{1D513}":"Pfr","\u{1D4AB}":"Pscr","\u{1D562}":"qopf","\u{1D52E}":"qfr","\u{1D4C6}":"qscr","\u{1D4AC}":"Qscr","\u{1D514}":"Qfr","\u211A":"Qopf","\u0138":"kgreen","\u{1D52F}":"rfr","\u{1D563}":"ropf","\u{1D4C7}":"rscr","\u211B":"Rscr","\u211C":"Re","\u211D":"Ropf","\u0155":"racute","\u0154":"Racute","\u0159":"rcaron","\u0158":"Rcaron","\u0157":"rcedil","\u0156":"Rcedil","\u{1D564}":"sopf","\u{1D4C8}":"sscr","\u{1D530}":"sfr","\u{1D54A}":"Sopf","\u{1D516}":"Sfr","\u{1D4AE}":"Sscr","\u24C8":"oS","\u015B":"sacute","\u015A":"Sacute","\u015D":"scirc","\u015C":"Scirc","\u0161":"scaron","\u0160":"Scaron","\u015F":"scedil","\u015E":"Scedil","\xDF":"szlig","\u{1D531}":"tfr","\u{1D4C9}":"tscr","\u{1D565}":"topf","\u{1D4AF}":"Tscr","\u{1D517}":"Tfr","\u{1D54B}":"Topf","\u0165":"tcaron","\u0164":"Tcaron","\u0163":"tcedil","\u0162":"Tcedil","\u2122":"trade","\u0167":"tstrok","\u0166":"Tstrok","\u{1D4CA}":"uscr","\u{1D566}":"uopf","\u{1D532}":"ufr","\u{1D54C}":"Uopf","\u{1D518}":"Ufr","\u{1D4B0}":"Uscr","\xFA":"uacute","\xDA":"Uacute","\xF9":"ugrave","\xD9":"Ugrave","\u016D":"ubreve","\u016C":"Ubreve","\xFB":"ucirc","\xDB":"Ucirc","\u016F":"uring","\u016E":"Uring","\xFC":"uuml","\xDC":"Uuml","\u0171":"udblac","\u0170":"Udblac","\u0169":"utilde","\u0168":"Utilde","\u0173":"uogon","\u0172":"Uogon","\u016B":"umacr","\u016A":"Umacr","\u{1D533}":"vfr","\u{1D567}":"vopf","\u{1D4CB}":"vscr","\u{1D519}":"Vfr","\u{1D54D}":"Vopf","\u{1D4B1}":"Vscr","\u{1D568}":"wopf","\u{1D4CC}":"wscr","\u{1D534}":"wfr","\u{1D4B2}":"Wscr","\u{1D54E}":"Wopf","\u{1D51A}":"Wfr","\u0175":"wcirc","\u0174":"Wcirc","\u{1D535}":"xfr","\u{1D4CD}":"xscr","\u{1D569}":"xopf","\u{1D54F}":"Xopf","\u{1D51B}":"Xfr","\u{1D4B3}":"Xscr","\u{1D536}":"yfr","\u{1D4CE}":"yscr","\u{1D56A}":"yopf","\u{1D4B4}":"Yscr","\u{1D51C}":"Yfr","\u{1D550}":"Yopf","\xFD":"yacute","\xDD":"Yacute","\u0177":"ycirc","\u0176":"Ycirc","\xFF":"yuml","\u0178":"Yuml","\u{1D4CF}":"zscr","\u{1D537}":"zfr","\u{1D56B}":"zopf","\u2128":"Zfr","\u2124":"Zopf","\u{1D4B5}":"Zscr","\u017A":"zacute","\u0179":"Zacute","\u017E":"zcaron","\u017D":"Zcaron","\u017C":"zdot","\u017B":"Zdot","\u01B5":"imped","\xFE":"thorn","\xDE":"THORN","\u0149":"napos","\u03B1":"alpha","\u0391":"Alpha","\u03B2":"beta","\u0392":"Beta","\u03B3":"gamma","\u0393":"Gamma","\u03B4":"delta","\u0394":"Delta","\u03B5":"epsi","\u03F5":"epsiv","\u0395":"Epsilon","\u03DD":"gammad","\u03DC":"Gammad","\u03B6":"zeta","\u0396":"Zeta","\u03B7":"eta","\u0397":"Eta","\u03B8":"theta","\u03D1":"thetav","\u0398":"Theta","\u03B9":"iota","\u0399":"Iota","\u03BA":"kappa","\u03F0":"kappav","\u039A":"Kappa","\u03BB":"lambda","\u039B":"Lambda","\u03BC":"mu","\xB5":"micro","\u039C":"Mu","\u03BD":"nu","\u039D":"Nu","\u03BE":"xi","\u039E":"Xi","\u03BF":"omicron","\u039F":"Omicron","\u03C0":"pi","\u03D6":"piv","\u03A0":"Pi","\u03C1":"rho","\u03F1":"rhov","\u03A1":"Rho","\u03C3":"sigma","\u03A3":"Sigma","\u03C2":"sigmaf","\u03C4":"tau","\u03A4":"Tau","\u03C5":"upsi","\u03A5":"Upsilon","\u03D2":"Upsi","\u03C6":"phi","\u03D5":"phiv","\u03A6":"Phi","\u03C7":"chi","\u03A7":"Chi","\u03C8":"psi","\u03A8":"Psi","\u03C9":"omega","\u03A9":"ohm","\u0430":"acy","\u0410":"Acy","\u0431":"bcy","\u0411":"Bcy","\u0432":"vcy","\u0412":"Vcy","\u0433":"gcy","\u0413":"Gcy","\u0453":"gjcy","\u0403":"GJcy","\u0434":"dcy","\u0414":"Dcy","\u0452":"djcy","\u0402":"DJcy","\u0435":"iecy","\u0415":"IEcy","\u0451":"iocy","\u0401":"IOcy","\u0454":"jukcy","\u0404":"Jukcy","\u0436":"zhcy","\u0416":"ZHcy","\u0437":"zcy","\u0417":"Zcy","\u0455":"dscy","\u0405":"DScy","\u0438":"icy","\u0418":"Icy","\u0456":"iukcy","\u0406":"Iukcy","\u0457":"yicy","\u0407":"YIcy","\u0439":"jcy","\u0419":"Jcy","\u0458":"jsercy","\u0408":"Jsercy","\u043A":"kcy","\u041A":"Kcy","\u045C":"kjcy","\u040C":"KJcy","\u043B":"lcy","\u041B":"Lcy","\u0459":"ljcy","\u0409":"LJcy","\u043C":"mcy","\u041C":"Mcy","\u043D":"ncy","\u041D":"Ncy","\u045A":"njcy","\u040A":"NJcy","\u043E":"ocy","\u041E":"Ocy","\u043F":"pcy","\u041F":"Pcy","\u0440":"rcy","\u0420":"Rcy","\u0441":"scy","\u0421":"Scy","\u0442":"tcy","\u0422":"Tcy","\u045B":"tshcy","\u040B":"TSHcy","\u0443":"ucy","\u0423":"Ucy","\u045E":"ubrcy","\u040E":"Ubrcy","\u0444":"fcy","\u0424":"Fcy","\u0445":"khcy","\u0425":"KHcy","\u0446":"tscy","\u0426":"TScy","\u0447":"chcy","\u0427":"CHcy","\u045F":"dzcy","\u040F":"DZcy","\u0448":"shcy","\u0428":"SHcy","\u0449":"shchcy","\u0429":"SHCHcy","\u044A":"hardcy","\u042A":"HARDcy","\u044B":"ycy","\u042B":"Ycy","\u044C":"softcy","\u042C":"SOFTcy","\u044D":"ecy","\u042D":"Ecy","\u044E":"yucy","\u042E":"YUcy","\u044F":"yacy","\u042F":"YAcy","\u2135":"aleph","\u2136":"beth","\u2137":"gimel","\u2138":"daleth"};var u=/["&'<>`]/g;var d={'"':""","&":"&","'":"'","<":"<",">":">","`":"`"};var f=/&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/;var h=/[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;var m=/&(CounterClockwiseContourIntegral|DoubleLongLeftRightArrow|ClockwiseContourIntegral|NotNestedGreaterGreater|NotSquareSupersetEqual|DiacriticalDoubleAcute|NotRightTriangleEqual|NotSucceedsSlantEqual|NotPrecedesSlantEqual|CloseCurlyDoubleQuote|NegativeVeryThinSpace|DoubleContourIntegral|FilledVerySmallSquare|CapitalDifferentialD|OpenCurlyDoubleQuote|EmptyVerySmallSquare|NestedGreaterGreater|DoubleLongRightArrow|NotLeftTriangleEqual|NotGreaterSlantEqual|ReverseUpEquilibrium|DoubleLeftRightArrow|NotSquareSubsetEqual|NotDoubleVerticalBar|RightArrowLeftArrow|NotGreaterFullEqual|NotRightTriangleBar|SquareSupersetEqual|DownLeftRightVector|DoubleLongLeftArrow|leftrightsquigarrow|LeftArrowRightArrow|NegativeMediumSpace|blacktriangleright|RightDownVectorBar|PrecedesSlantEqual|RightDoubleBracket|SucceedsSlantEqual|NotLeftTriangleBar|RightTriangleEqual|SquareIntersection|RightDownTeeVector|ReverseEquilibrium|NegativeThickSpace|longleftrightarrow|Longleftrightarrow|LongLeftRightArrow|DownRightTeeVector|DownRightVectorBar|GreaterSlantEqual|SquareSubsetEqual|LeftDownVectorBar|LeftDoubleBracket|VerticalSeparator|rightleftharpoons|NotGreaterGreater|NotSquareSuperset|blacktriangleleft|blacktriangledown|NegativeThinSpace|LeftDownTeeVector|NotLessSlantEqual|leftrightharpoons|DoubleUpDownArrow|DoubleVerticalBar|LeftTriangleEqual|FilledSmallSquare|twoheadrightarrow|NotNestedLessLess|DownLeftTeeVector|DownLeftVectorBar|RightAngleBracket|NotTildeFullEqual|NotReverseElement|RightUpDownVector|DiacriticalTilde|NotSucceedsTilde|circlearrowright|NotPrecedesEqual|rightharpoondown|DoubleRightArrow|NotSucceedsEqual|NonBreakingSpace|NotRightTriangle|LessEqualGreater|RightUpTeeVector|LeftAngleBracket|GreaterFullEqual|DownArrowUpArrow|RightUpVectorBar|twoheadleftarrow|GreaterEqualLess|downharpoonright|RightTriangleBar|ntrianglerighteq|NotSupersetEqual|LeftUpDownVector|DiacriticalAcute|rightrightarrows|vartriangleright|UpArrowDownArrow|DiacriticalGrave|UnderParenthesis|EmptySmallSquare|LeftUpVectorBar|leftrightarrows|DownRightVector|downharpoonleft|trianglerighteq|ShortRightArrow|OverParenthesis|DoubleLeftArrow|DoubleDownArrow|NotSquareSubset|bigtriangledown|ntrianglelefteq|UpperRightArrow|curvearrowright|vartriangleleft|NotLeftTriangle|nleftrightarrow|LowerRightArrow|NotHumpDownHump|NotGreaterTilde|rightthreetimes|LeftUpTeeVector|NotGreaterEqual|straightepsilon|LeftTriangleBar|rightsquigarrow|ContourIntegral|rightleftarrows|CloseCurlyQuote|RightDownVector|LeftRightVector|nLeftrightarrow|leftharpoondown|circlearrowleft|SquareSuperset|OpenCurlyQuote|hookrightarrow|HorizontalLine|DiacriticalDot|NotLessGreater|ntriangleright|DoubleRightTee|InvisibleComma|InvisibleTimes|LowerLeftArrow|DownLeftVector|NotSubsetEqual|curvearrowleft|trianglelefteq|NotVerticalBar|TildeFullEqual|downdownarrows|NotGreaterLess|RightTeeVector|ZeroWidthSpace|looparrowright|LongRightArrow|doublebarwedge|ShortLeftArrow|ShortDownArrow|RightVectorBar|GreaterGreater|ReverseElement|rightharpoonup|LessSlantEqual|leftthreetimes|upharpoonright|rightarrowtail|LeftDownVector|Longrightarrow|NestedLessLess|UpperLeftArrow|nshortparallel|leftleftarrows|leftrightarrow|Leftrightarrow|LeftRightArrow|longrightarrow|upharpoonleft|RightArrowBar|ApplyFunction|LeftTeeVector|leftarrowtail|NotEqualTilde|varsubsetneqq|varsupsetneqq|RightTeeArrow|SucceedsEqual|SucceedsTilde|LeftVectorBar|SupersetEqual|hookleftarrow|DifferentialD|VerticalTilde|VeryThinSpace|blacktriangle|bigtriangleup|LessFullEqual|divideontimes|leftharpoonup|UpEquilibrium|ntriangleleft|RightTriangle|measuredangle|shortparallel|longleftarrow|Longleftarrow|LongLeftArrow|DoubleLeftTee|Poincareplane|PrecedesEqual|triangleright|DoubleUpArrow|RightUpVector|fallingdotseq|looparrowleft|PrecedesTilde|NotTildeEqual|NotTildeTilde|smallsetminus|Proportional|triangleleft|triangledown|UnderBracket|NotHumpEqual|exponentiale|ExponentialE|NotLessTilde|HilbertSpace|RightCeiling|blacklozenge|varsupsetneq|HumpDownHump|GreaterEqual|VerticalLine|LeftTeeArrow|NotLessEqual|DownTeeArrow|LeftTriangle|varsubsetneq|Intersection|NotCongruent|DownArrowBar|LeftUpVector|LeftArrowBar|risingdotseq|GreaterTilde|RoundImplies|SquareSubset|ShortUpArrow|NotSuperset|quaternions|precnapprox|backepsilon|preccurlyeq|OverBracket|blacksquare|MediumSpace|VerticalBar|circledcirc|circleddash|CircleMinus|CircleTimes|LessGreater|curlyeqprec|curlyeqsucc|diamondsuit|UpDownArrow|Updownarrow|RuleDelayed|Rrightarrow|updownarrow|RightVector|nRightarrow|nrightarrow|eqslantless|LeftCeiling|Equilibrium|SmallCircle|expectation|NotSucceeds|thickapprox|GreaterLess|SquareUnion|NotPrecedes|NotLessLess|straightphi|succnapprox|succcurlyeq|SubsetEqual|sqsupseteq|Proportion|Laplacetrf|ImaginaryI|supsetneqq|NotGreater|gtreqqless|NotElement|ThickSpace|TildeEqual|TildeTilde|Fouriertrf|rmoustache|EqualTilde|eqslantgtr|UnderBrace|LeftVector|UpArrowBar|nLeftarrow|nsubseteqq|subsetneqq|nsupseteqq|nleftarrow|succapprox|lessapprox|UpTeeArrow|upuparrows|curlywedge|lesseqqgtr|varepsilon|varnothing|RightFloor|complement|CirclePlus|sqsubseteq|Lleftarrow|circledast|RightArrow|Rightarrow|rightarrow|lmoustache|Bernoullis|precapprox|mapstoleft|mapstodown|longmapsto|dotsquare|downarrow|DoubleDot|nsubseteq|supsetneq|leftarrow|nsupseteq|subsetneq|ThinSpace|ngeqslant|subseteqq|HumpEqual|NotSubset|triangleq|NotCupCap|lesseqgtr|heartsuit|TripleDot|Leftarrow|Coproduct|Congruent|varpropto|complexes|gvertneqq|LeftArrow|LessTilde|supseteqq|MinusPlus|CircleDot|nleqslant|NotExists|gtreqless|nparallel|UnionPlus|LeftFloor|checkmark|CenterDot|centerdot|Mellintrf|gtrapprox|bigotimes|OverBrace|spadesuit|therefore|pitchfork|rationals|PlusMinus|Backslash|Therefore|DownBreve|backsimeq|backprime|DownArrow|nshortmid|Downarrow|lvertneqq|eqvparsl|imagline|imagpart|infintie|integers|Integral|intercal|LessLess|Uarrocir|intlarhk|sqsupset|angmsdaf|sqsubset|llcorner|vartheta|cupbrcap|lnapprox|Superset|SuchThat|succnsim|succneqq|angmsdag|biguplus|curlyvee|trpezium|Succeeds|NotTilde|bigwedge|angmsdah|angrtvbd|triminus|cwconint|fpartint|lrcorner|smeparsl|subseteq|urcorner|lurdshar|laemptyv|DDotrahd|approxeq|ldrushar|awconint|mapstoup|backcong|shortmid|triangle|geqslant|gesdotol|timesbar|circledR|circledS|setminus|multimap|naturals|scpolint|ncongdot|RightTee|boxminus|gnapprox|boxtimes|andslope|thicksim|angmsdaa|varsigma|cirfnint|rtriltri|angmsdab|rppolint|angmsdac|barwedge|drbkarow|clubsuit|thetasym|bsolhsub|capbrcup|dzigrarr|doteqdot|DotEqual|dotminus|UnderBar|NotEqual|realpart|otimesas|ulcorner|hksearow|hkswarow|parallel|PartialD|elinters|emptyset|plusacir|bbrktbrk|angmsdad|pointint|bigoplus|angmsdae|Precedes|bigsqcup|varkappa|notindot|supseteq|precneqq|precnsim|profalar|profline|profsurf|leqslant|lesdotor|raemptyv|subplus|notnivb|notnivc|subrarr|zigrarr|vzigzag|submult|subedot|Element|between|cirscir|larrbfs|larrsim|lotimes|lbrksld|lbrkslu|lozenge|ldrdhar|dbkarow|bigcirc|epsilon|simrarr|simplus|ltquest|Epsilon|luruhar|gtquest|maltese|npolint|eqcolon|npreceq|bigodot|ddagger|gtrless|bnequiv|harrcir|ddotseq|equivDD|backsim|demptyv|nsqsube|nsqsupe|Upsilon|nsubset|upsilon|minusdu|nsucceq|swarrow|nsupset|coloneq|searrow|boxplus|napprox|natural|asympeq|alefsym|congdot|nearrow|bigstar|diamond|supplus|tritime|LeftTee|nvinfin|triplus|NewLine|nvltrie|nvrtrie|nwarrow|nexists|Diamond|ruluhar|Implies|supmult|angzarr|suplarr|suphsub|questeq|because|digamma|Because|olcross|bemptyv|omicron|Omicron|rotimes|NoBreak|intprod|angrtvb|orderof|uwangle|suphsol|lesdoto|orslope|DownTee|realine|cudarrl|rdldhar|OverBar|supedot|lessdot|supdsub|topfork|succsim|rbrkslu|rbrksld|pertenk|cudarrr|isindot|planckh|lessgtr|pluscir|gesdoto|plussim|plustwo|lesssim|cularrp|rarrsim|Cayleys|notinva|notinvb|notinvc|UpArrow|Uparrow|uparrow|NotLess|dwangle|precsim|Product|curarrm|Cconint|dotplus|rarrbfs|ccupssm|Cedilla|cemptyv|notniva|quatint|frac35|frac38|frac45|frac56|frac58|frac78|tridot|xoplus|gacute|gammad|Gammad|lfisht|lfloor|bigcup|sqsupe|gbreve|Gbreve|lharul|sqsube|sqcups|Gcedil|apacir|llhard|lmidot|Lmidot|lmoust|andand|sqcaps|approx|Abreve|spades|circeq|tprime|divide|topcir|Assign|topbot|gesdot|divonx|xuplus|timesd|gesles|atilde|solbar|SOFTcy|loplus|timesb|lowast|lowbar|dlcorn|dlcrop|softcy|dollar|lparlt|thksim|lrhard|Atilde|lsaquo|smashp|bigvee|thinsp|wreath|bkarow|lsquor|lstrok|Lstrok|lthree|ltimes|ltlarr|DotDot|simdot|ltrPar|weierp|xsqcup|angmsd|sigmav|sigmaf|zeetrf|Zcaron|zcaron|mapsto|vsupne|thetav|cirmid|marker|mcomma|Zacute|vsubnE|there4|gtlPar|vsubne|bottom|gtrarr|SHCHcy|shchcy|midast|midcir|middot|minusb|minusd|gtrdot|bowtie|sfrown|mnplus|models|colone|seswar|Colone|mstpos|searhk|gtrsim|nacute|Nacute|boxbox|telrec|hairsp|Tcedil|nbumpe|scnsim|ncaron|Ncaron|ncedil|Ncedil|hamilt|Scedil|nearhk|hardcy|HARDcy|tcedil|Tcaron|commat|nequiv|nesear|tcaron|target|hearts|nexist|varrho|scedil|Scaron|scaron|hellip|Sacute|sacute|hercon|swnwar|compfn|rtimes|rthree|rsquor|rsaquo|zacute|wedgeq|homtht|barvee|barwed|Barwed|rpargt|horbar|conint|swarhk|roplus|nltrie|hslash|hstrok|Hstrok|rmoust|Conint|bprime|hybull|hyphen|iacute|Iacute|supsup|supsub|supsim|varphi|coprod|brvbar|agrave|Supset|supset|igrave|Igrave|notinE|Agrave|iiiint|iinfin|copysr|wedbar|Verbar|vangrt|becaus|incare|verbar|inodot|bullet|drcorn|intcal|drcrop|cularr|vellip|Utilde|bumpeq|cupcap|dstrok|Dstrok|CupCap|cupcup|cupdot|eacute|Eacute|supdot|iquest|easter|ecaron|Ecaron|ecolon|isinsv|utilde|itilde|Itilde|curarr|succeq|Bumpeq|cacute|ulcrop|nparsl|Cacute|nprcue|egrave|Egrave|nrarrc|nrarrw|subsup|subsub|nrtrie|jsercy|nsccue|Jsercy|kappav|kcedil|Kcedil|subsim|ulcorn|nsimeq|egsdot|veebar|kgreen|capand|elsdot|Subset|subset|curren|aacute|lacute|Lacute|emptyv|ntilde|Ntilde|lagran|lambda|Lambda|capcap|Ugrave|langle|subdot|emsp13|numero|emsp14|nvdash|nvDash|nVdash|nVDash|ugrave|ufisht|nvHarr|larrfs|nvlArr|larrhk|larrlp|larrpl|nvrArr|Udblac|nwarhk|larrtl|nwnear|oacute|Oacute|latail|lAtail|sstarf|lbrace|odblac|Odblac|lbrack|udblac|odsold|eparsl|lcaron|Lcaron|ograve|Ograve|lcedil|Lcedil|Aacute|ssmile|ssetmn|squarf|ldquor|capcup|ominus|cylcty|rharul|eqcirc|dagger|rfloor|rfisht|Dagger|daleth|equals|origof|capdot|equest|dcaron|Dcaron|rdquor|oslash|Oslash|otilde|Otilde|otimes|Otimes|urcrop|Ubreve|ubreve|Yacute|Uacute|uacute|Rcedil|rcedil|urcorn|parsim|Rcaron|Vdashl|rcaron|Tstrok|percnt|period|permil|Exists|yacute|rbrack|rbrace|phmmat|ccaron|Ccaron|planck|ccedil|plankv|tstrok|female|plusdo|plusdu|ffilig|plusmn|ffllig|Ccedil|rAtail|dfisht|bernou|ratail|Rarrtl|rarrtl|angsph|rarrpl|rarrlp|rarrhk|xwedge|xotime|forall|ForAll|Vvdash|vsupnE|preceq|bigcap|frac12|frac13|frac14|primes|rarrfs|prnsim|frac15|Square|frac16|square|lesdot|frac18|frac23|propto|prurel|rarrap|rangle|puncsp|frac25|Racute|qprime|racute|lesges|frac34|abreve|AElig|eqsim|utdot|setmn|urtri|Equal|Uring|seArr|uring|searr|dashv|Dashv|mumap|nabla|iogon|Iogon|sdote|sdotb|scsim|napid|napos|equiv|natur|Acirc|dblac|erarr|nbump|iprod|erDot|ucirc|awint|esdot|angrt|ncong|isinE|scnap|Scirc|scirc|ndash|isins|Ubrcy|nearr|neArr|isinv|nedot|ubrcy|acute|Ycirc|iukcy|Iukcy|xutri|nesim|caret|jcirc|Jcirc|caron|twixt|ddarr|sccue|exist|jmath|sbquo|ngeqq|angst|ccaps|lceil|ngsim|UpTee|delta|Delta|rtrif|nharr|nhArr|nhpar|rtrie|jukcy|Jukcy|kappa|rsquo|Kappa|nlarr|nlArr|TSHcy|rrarr|aogon|Aogon|fflig|xrarr|tshcy|ccirc|nleqq|filig|upsih|nless|dharl|nlsim|fjlig|ropar|nltri|dharr|robrk|roarr|fllig|fltns|roang|rnmid|subnE|subne|lAarr|trisb|Ccirc|acirc|ccups|blank|VDash|forkv|Vdash|langd|cedil|blk12|blk14|laquo|strns|diams|notin|vDash|larrb|blk34|block|disin|uplus|vdash|vBarv|aelig|starf|Wedge|check|xrArr|lates|lbarr|lBarr|notni|lbbrk|bcong|frasl|lbrke|frown|vrtri|vprop|vnsup|gamma|Gamma|wedge|xodot|bdquo|srarr|doteq|ldquo|boxdl|boxdL|gcirc|Gcirc|boxDl|boxDL|boxdr|boxdR|boxDr|TRADE|trade|rlhar|boxDR|vnsub|npart|vltri|rlarr|boxhd|boxhD|nprec|gescc|nrarr|nrArr|boxHd|boxHD|boxhu|boxhU|nrtri|boxHu|clubs|boxHU|times|colon|Colon|gimel|xlArr|Tilde|nsime|tilde|nsmid|nspar|THORN|thorn|xlarr|nsube|nsubE|thkap|xhArr|comma|nsucc|boxul|boxuL|nsupe|nsupE|gneqq|gnsim|boxUl|boxUL|grave|boxur|boxuR|boxUr|boxUR|lescc|angle|bepsi|boxvh|varpi|boxvH|numsp|Theta|gsime|gsiml|theta|boxVh|boxVH|boxvl|gtcir|gtdot|boxvL|boxVl|boxVL|crarr|cross|Cross|nvsim|boxvr|nwarr|nwArr|sqsup|dtdot|Uogon|lhard|lharu|dtrif|ocirc|Ocirc|lhblk|duarr|odash|sqsub|Hacek|sqcup|llarr|duhar|oelig|OElig|ofcir|boxvR|uogon|lltri|boxVr|csube|uuarr|ohbar|csupe|ctdot|olarr|olcir|harrw|oline|sqcap|omacr|Omacr|omega|Omega|boxVR|aleph|lneqq|lnsim|loang|loarr|rharu|lobrk|hcirc|operp|oplus|rhard|Hcirc|orarr|Union|order|ecirc|Ecirc|cuepr|szlig|cuesc|breve|reals|eDDot|Breve|hoarr|lopar|utrif|rdquo|Umacr|umacr|efDot|swArr|ultri|alpha|rceil|ovbar|swarr|Wcirc|wcirc|smtes|smile|bsemi|lrarr|aring|parsl|lrhar|bsime|uhblk|lrtri|cupor|Aring|uharr|uharl|slarr|rbrke|bsolb|lsime|rbbrk|RBarr|lsimg|phone|rBarr|rbarr|icirc|lsquo|Icirc|emacr|Emacr|ratio|simne|plusb|simlE|simgE|simeq|pluse|ltcir|ltdot|empty|xharr|xdtri|iexcl|Alpha|ltrie|rarrw|pound|ltrif|xcirc|bumpe|prcue|bumpE|asymp|amacr|cuvee|Sigma|sigma|iiint|udhar|iiota|ijlig|IJlig|supnE|imacr|Imacr|prime|Prime|image|prnap|eogon|Eogon|rarrc|mdash|mDDot|cuwed|imath|supne|imped|Amacr|udarr|prsim|micro|rarrb|cwint|raquo|infin|eplus|range|rangd|Ucirc|radic|minus|amalg|veeeq|rAarr|epsiv|ycirc|quest|sharp|quot|zwnj|Qscr|race|qscr|Qopf|qopf|qint|rang|Rang|Zscr|zscr|Zopf|zopf|rarr|rArr|Rarr|Pscr|pscr|prop|prod|prnE|prec|ZHcy|zhcy|prap|Zeta|zeta|Popf|popf|Zdot|plus|zdot|Yuml|yuml|phiv|YUcy|yucy|Yscr|yscr|perp|Yopf|yopf|part|para|YIcy|Ouml|rcub|yicy|YAcy|rdca|ouml|osol|Oscr|rdsh|yacy|real|oscr|xvee|andd|rect|andv|Xscr|oror|ordm|ordf|xscr|ange|aopf|Aopf|rHar|Xopf|opar|Oopf|xopf|xnis|rhov|oopf|omid|xmap|oint|apid|apos|ogon|ascr|Ascr|odot|odiv|xcup|xcap|ocir|oast|nvlt|nvle|nvgt|nvge|nvap|Wscr|wscr|auml|ntlg|ntgl|nsup|nsub|nsim|Nscr|nscr|nsce|Wopf|ring|npre|wopf|npar|Auml|Barv|bbrk|Nopf|nopf|nmid|nLtv|beta|ropf|Ropf|Beta|beth|nles|rpar|nleq|bnot|bNot|nldr|NJcy|rscr|Rscr|Vscr|vscr|rsqb|njcy|bopf|nisd|Bopf|rtri|Vopf|nGtv|ngtr|vopf|boxh|boxH|boxv|nges|ngeq|boxV|bscr|scap|Bscr|bsim|Vert|vert|bsol|bull|bump|caps|cdot|ncup|scnE|ncap|nbsp|napE|Cdot|cent|sdot|Vbar|nang|vBar|chcy|Mscr|mscr|sect|semi|CHcy|Mopf|mopf|sext|circ|cire|mldr|mlcp|cirE|comp|shcy|SHcy|vArr|varr|cong|copf|Copf|copy|COPY|malt|male|macr|lvnE|cscr|ltri|sime|ltcc|simg|Cscr|siml|csub|Uuml|lsqb|lsim|uuml|csup|Lscr|lscr|utri|smid|lpar|cups|smte|lozf|darr|Lopf|Uscr|solb|lopf|sopf|Sopf|lneq|uscr|spar|dArr|lnap|Darr|dash|Sqrt|LJcy|ljcy|lHar|dHar|Upsi|upsi|diam|lesg|djcy|DJcy|leqq|dopf|Dopf|dscr|Dscr|dscy|ldsh|ldca|squf|DScy|sscr|Sscr|dsol|lcub|late|star|Star|Uopf|Larr|lArr|larr|uopf|dtri|dzcy|sube|subE|Lang|lang|Kscr|kscr|Kopf|kopf|KJcy|kjcy|KHcy|khcy|DZcy|ecir|edot|eDot|Jscr|jscr|succ|Jopf|jopf|Edot|uHar|emsp|ensp|Iuml|iuml|eopf|isin|Iscr|iscr|Eopf|epar|sung|epsi|escr|sup1|sup2|sup3|Iota|iota|supe|supE|Iopf|iopf|IOcy|iocy|Escr|esim|Esim|imof|Uarr|QUOT|uArr|uarr|euml|IEcy|iecy|Idot|Euml|euro|excl|Hscr|hscr|Hopf|hopf|TScy|tscy|Tscr|hbar|tscr|flat|tbrk|fnof|hArr|harr|half|fopf|Fopf|tdot|gvnE|fork|trie|gtcc|fscr|Fscr|gdot|gsim|Gscr|gscr|Gopf|gopf|gneq|Gdot|tosa|gnap|Topf|topf|geqq|toea|GJcy|gjcy|tint|gesl|mid|Sfr|ggg|top|ges|gla|glE|glj|geq|gne|gEl|gel|gnE|Gcy|gcy|gap|Tfr|tfr|Tcy|tcy|Hat|Tau|Ffr|tau|Tab|hfr|Hfr|ffr|Fcy|fcy|icy|Icy|iff|ETH|eth|ifr|Ifr|Eta|eta|int|Int|Sup|sup|ucy|Ucy|Sum|sum|jcy|ENG|ufr|Ufr|eng|Jcy|jfr|els|ell|egs|Efr|efr|Jfr|uml|kcy|Kcy|Ecy|ecy|kfr|Kfr|lap|Sub|sub|lat|lcy|Lcy|leg|Dot|dot|lEg|leq|les|squ|div|die|lfr|Lfr|lgE|Dfr|dfr|Del|deg|Dcy|dcy|lne|lnE|sol|loz|smt|Cup|lrm|cup|lsh|Lsh|sim|shy|map|Map|mcy|Mcy|mfr|Mfr|mho|gfr|Gfr|sfr|cir|Chi|chi|nap|Cfr|vcy|Vcy|cfr|Scy|scy|ncy|Ncy|vee|Vee|Cap|cap|nfr|scE|sce|Nfr|nge|ngE|nGg|vfr|Vfr|ngt|bot|nGt|nis|niv|Rsh|rsh|nle|nlE|bne|Bfr|bfr|nLl|nlt|nLt|Bcy|bcy|not|Not|rlm|wfr|Wfr|npr|nsc|num|ocy|ast|Ocy|ofr|xfr|Xfr|Ofr|ogt|ohm|apE|olt|Rho|ape|rho|Rfr|rfr|ord|REG|ang|reg|orv|And|and|AMP|Rcy|amp|Afr|ycy|Ycy|yen|yfr|Yfr|rcy|par|pcy|Pcy|pfr|Pfr|phi|Phi|afr|Acy|acy|zcy|Zcy|piv|acE|acd|zfr|Zfr|pre|prE|psi|Psi|qfr|Qfr|zwj|Or|ge|Gg|gt|gg|el|oS|lt|Lt|LT|Re|lg|gl|eg|ne|Im|it|le|DD|wp|wr|nu|Nu|dd|lE|Sc|sc|pi|Pi|ee|af|ll|Ll|rx|gE|xi|pm|Xi|ic|pr|Pr|in|ni|mp|mu|ac|Mu|or|ap|Gt|GT|ii);|&(Aacute|Agrave|Atilde|Ccedil|Eacute|Egrave|Iacute|Igrave|Ntilde|Oacute|Ograve|Oslash|Otilde|Uacute|Ugrave|Yacute|aacute|agrave|atilde|brvbar|ccedil|curren|divide|eacute|egrave|frac12|frac14|frac34|iacute|igrave|iquest|middot|ntilde|oacute|ograve|oslash|otilde|plusmn|uacute|ugrave|yacute|AElig|Acirc|Aring|Ecirc|Icirc|Ocirc|THORN|Ucirc|acirc|acute|aelig|aring|cedil|ecirc|icirc|iexcl|laquo|micro|ocirc|pound|raquo|szlig|thorn|times|ucirc|Auml|COPY|Euml|Iuml|Ouml|QUOT|Uuml|auml|cent|copy|euml|iuml|macr|nbsp|ordf|ordm|ouml|para|quot|sect|sup1|sup2|sup3|uuml|yuml|AMP|ETH|REG|amp|deg|eth|not|reg|shy|uml|yen|GT|LT|gt|lt)(?!;)([=a-zA-Z0-9]?)|&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+)/g;var g={"aacute":"\xE1","Aacute":"\xC1","abreve":"\u0103","Abreve":"\u0102","ac":"\u223E","acd":"\u223F","acE":"\u223E\u0333","acirc":"\xE2","Acirc":"\xC2","acute":"\xB4","acy":"\u0430","Acy":"\u0410","aelig":"\xE6","AElig":"\xC6","af":"\u2061","afr":"\u{1D51E}","Afr":"\u{1D504}","agrave":"\xE0","Agrave":"\xC0","alefsym":"\u2135","aleph":"\u2135","alpha":"\u03B1","Alpha":"\u0391","amacr":"\u0101","Amacr":"\u0100","amalg":"\u2A3F","amp":"&","AMP":"&","and":"\u2227","And":"\u2A53","andand":"\u2A55","andd":"\u2A5C","andslope":"\u2A58","andv":"\u2A5A","ang":"\u2220","ange":"\u29A4","angle":"\u2220","angmsd":"\u2221","angmsdaa":"\u29A8","angmsdab":"\u29A9","angmsdac":"\u29AA","angmsdad":"\u29AB","angmsdae":"\u29AC","angmsdaf":"\u29AD","angmsdag":"\u29AE","angmsdah":"\u29AF","angrt":"\u221F","angrtvb":"\u22BE","angrtvbd":"\u299D","angsph":"\u2222","angst":"\xC5","angzarr":"\u237C","aogon":"\u0105","Aogon":"\u0104","aopf":"\u{1D552}","Aopf":"\u{1D538}","ap":"\u2248","apacir":"\u2A6F","ape":"\u224A","apE":"\u2A70","apid":"\u224B","apos":"'","ApplyFunction":"\u2061","approx":"\u2248","approxeq":"\u224A","aring":"\xE5","Aring":"\xC5","ascr":"\u{1D4B6}","Ascr":"\u{1D49C}","Assign":"\u2254","ast":"*","asymp":"\u2248","asympeq":"\u224D","atilde":"\xE3","Atilde":"\xC3","auml":"\xE4","Auml":"\xC4","awconint":"\u2233","awint":"\u2A11","backcong":"\u224C","backepsilon":"\u03F6","backprime":"\u2035","backsim":"\u223D","backsimeq":"\u22CD","Backslash":"\u2216","Barv":"\u2AE7","barvee":"\u22BD","barwed":"\u2305","Barwed":"\u2306","barwedge":"\u2305","bbrk":"\u23B5","bbrktbrk":"\u23B6","bcong":"\u224C","bcy":"\u0431","Bcy":"\u0411","bdquo":"\u201E","becaus":"\u2235","because":"\u2235","Because":"\u2235","bemptyv":"\u29B0","bepsi":"\u03F6","bernou":"\u212C","Bernoullis":"\u212C","beta":"\u03B2","Beta":"\u0392","beth":"\u2136","between":"\u226C","bfr":"\u{1D51F}","Bfr":"\u{1D505}","bigcap":"\u22C2","bigcirc":"\u25EF","bigcup":"\u22C3","bigodot":"\u2A00","bigoplus":"\u2A01","bigotimes":"\u2A02","bigsqcup":"\u2A06","bigstar":"\u2605","bigtriangledown":"\u25BD","bigtriangleup":"\u25B3","biguplus":"\u2A04","bigvee":"\u22C1","bigwedge":"\u22C0","bkarow":"\u290D","blacklozenge":"\u29EB","blacksquare":"\u25AA","blacktriangle":"\u25B4","blacktriangledown":"\u25BE","blacktriangleleft":"\u25C2","blacktriangleright":"\u25B8","blank":"\u2423","blk12":"\u2592","blk14":"\u2591","blk34":"\u2593","block":"\u2588","bne":"=\u20E5","bnequiv":"\u2261\u20E5","bnot":"\u2310","bNot":"\u2AED","bopf":"\u{1D553}","Bopf":"\u{1D539}","bot":"\u22A5","bottom":"\u22A5","bowtie":"\u22C8","boxbox":"\u29C9","boxdl":"\u2510","boxdL":"\u2555","boxDl":"\u2556","boxDL":"\u2557","boxdr":"\u250C","boxdR":"\u2552","boxDr":"\u2553","boxDR":"\u2554","boxh":"\u2500","boxH":"\u2550","boxhd":"\u252C","boxhD":"\u2565","boxHd":"\u2564","boxHD":"\u2566","boxhu":"\u2534","boxhU":"\u2568","boxHu":"\u2567","boxHU":"\u2569","boxminus":"\u229F","boxplus":"\u229E","boxtimes":"\u22A0","boxul":"\u2518","boxuL":"\u255B","boxUl":"\u255C","boxUL":"\u255D","boxur":"\u2514","boxuR":"\u2558","boxUr":"\u2559","boxUR":"\u255A","boxv":"\u2502","boxV":"\u2551","boxvh":"\u253C","boxvH":"\u256A","boxVh":"\u256B","boxVH":"\u256C","boxvl":"\u2524","boxvL":"\u2561","boxVl":"\u2562","boxVL":"\u2563","boxvr":"\u251C","boxvR":"\u255E","boxVr":"\u255F","boxVR":"\u2560","bprime":"\u2035","breve":"\u02D8","Breve":"\u02D8","brvbar":"\xA6","bscr":"\u{1D4B7}","Bscr":"\u212C","bsemi":"\u204F","bsim":"\u223D","bsime":"\u22CD","bsol":"\\","bsolb":"\u29C5","bsolhsub":"\u27C8","bull":"\u2022","bullet":"\u2022","bump":"\u224E","bumpe":"\u224F","bumpE":"\u2AAE","bumpeq":"\u224F","Bumpeq":"\u224E","cacute":"\u0107","Cacute":"\u0106","cap":"\u2229","Cap":"\u22D2","capand":"\u2A44","capbrcup":"\u2A49","capcap":"\u2A4B","capcup":"\u2A47","capdot":"\u2A40","CapitalDifferentialD":"\u2145","caps":"\u2229\uFE00","caret":"\u2041","caron":"\u02C7","Cayleys":"\u212D","ccaps":"\u2A4D","ccaron":"\u010D","Ccaron":"\u010C","ccedil":"\xE7","Ccedil":"\xC7","ccirc":"\u0109","Ccirc":"\u0108","Cconint":"\u2230","ccups":"\u2A4C","ccupssm":"\u2A50","cdot":"\u010B","Cdot":"\u010A","cedil":"\xB8","Cedilla":"\xB8","cemptyv":"\u29B2","cent":"\xA2","centerdot":"\xB7","CenterDot":"\xB7","cfr":"\u{1D520}","Cfr":"\u212D","chcy":"\u0447","CHcy":"\u0427","check":"\u2713","checkmark":"\u2713","chi":"\u03C7","Chi":"\u03A7","cir":"\u25CB","circ":"\u02C6","circeq":"\u2257","circlearrowleft":"\u21BA","circlearrowright":"\u21BB","circledast":"\u229B","circledcirc":"\u229A","circleddash":"\u229D","CircleDot":"\u2299","circledR":"\xAE","circledS":"\u24C8","CircleMinus":"\u2296","CirclePlus":"\u2295","CircleTimes":"\u2297","cire":"\u2257","cirE":"\u29C3","cirfnint":"\u2A10","cirmid":"\u2AEF","cirscir":"\u29C2","ClockwiseContourIntegral":"\u2232","CloseCurlyDoubleQuote":"\u201D","CloseCurlyQuote":"\u2019","clubs":"\u2663","clubsuit":"\u2663","colon":":","Colon":"\u2237","colone":"\u2254","Colone":"\u2A74","coloneq":"\u2254","comma":",","commat":"@","comp":"\u2201","compfn":"\u2218","complement":"\u2201","complexes":"\u2102","cong":"\u2245","congdot":"\u2A6D","Congruent":"\u2261","conint":"\u222E","Conint":"\u222F","ContourIntegral":"\u222E","copf":"\u{1D554}","Copf":"\u2102","coprod":"\u2210","Coproduct":"\u2210","copy":"\xA9","COPY":"\xA9","copysr":"\u2117","CounterClockwiseContourIntegral":"\u2233","crarr":"\u21B5","cross":"\u2717","Cross":"\u2A2F","cscr":"\u{1D4B8}","Cscr":"\u{1D49E}","csub":"\u2ACF","csube":"\u2AD1","csup":"\u2AD0","csupe":"\u2AD2","ctdot":"\u22EF","cudarrl":"\u2938","cudarrr":"\u2935","cuepr":"\u22DE","cuesc":"\u22DF","cularr":"\u21B6","cularrp":"\u293D","cup":"\u222A","Cup":"\u22D3","cupbrcap":"\u2A48","cupcap":"\u2A46","CupCap":"\u224D","cupcup":"\u2A4A","cupdot":"\u228D","cupor":"\u2A45","cups":"\u222A\uFE00","curarr":"\u21B7","curarrm":"\u293C","curlyeqprec":"\u22DE","curlyeqsucc":"\u22DF","curlyvee":"\u22CE","curlywedge":"\u22CF","curren":"\xA4","curvearrowleft":"\u21B6","curvearrowright":"\u21B7","cuvee":"\u22CE","cuwed":"\u22CF","cwconint":"\u2232","cwint":"\u2231","cylcty":"\u232D","dagger":"\u2020","Dagger":"\u2021","daleth":"\u2138","darr":"\u2193","dArr":"\u21D3","Darr":"\u21A1","dash":"\u2010","dashv":"\u22A3","Dashv":"\u2AE4","dbkarow":"\u290F","dblac":"\u02DD","dcaron":"\u010F","Dcaron":"\u010E","dcy":"\u0434","Dcy":"\u0414","dd":"\u2146","DD":"\u2145","ddagger":"\u2021","ddarr":"\u21CA","DDotrahd":"\u2911","ddotseq":"\u2A77","deg":"\xB0","Del":"\u2207","delta":"\u03B4","Delta":"\u0394","demptyv":"\u29B1","dfisht":"\u297F","dfr":"\u{1D521}","Dfr":"\u{1D507}","dHar":"\u2965","dharl":"\u21C3","dharr":"\u21C2","DiacriticalAcute":"\xB4","DiacriticalDot":"\u02D9","DiacriticalDoubleAcute":"\u02DD","DiacriticalGrave":"`","DiacriticalTilde":"\u02DC","diam":"\u22C4","diamond":"\u22C4","Diamond":"\u22C4","diamondsuit":"\u2666","diams":"\u2666","die":"\xA8","DifferentialD":"\u2146","digamma":"\u03DD","disin":"\u22F2","div":"\xF7","divide":"\xF7","divideontimes":"\u22C7","divonx":"\u22C7","djcy":"\u0452","DJcy":"\u0402","dlcorn":"\u231E","dlcrop":"\u230D","dollar":"$","dopf":"\u{1D555}","Dopf":"\u{1D53B}","dot":"\u02D9","Dot":"\xA8","DotDot":"\u20DC","doteq":"\u2250","doteqdot":"\u2251","DotEqual":"\u2250","dotminus":"\u2238","dotplus":"\u2214","dotsquare":"\u22A1","doublebarwedge":"\u2306","DoubleContourIntegral":"\u222F","DoubleDot":"\xA8","DoubleDownArrow":"\u21D3","DoubleLeftArrow":"\u21D0","DoubleLeftRightArrow":"\u21D4","DoubleLeftTee":"\u2AE4","DoubleLongLeftArrow":"\u27F8","DoubleLongLeftRightArrow":"\u27FA","DoubleLongRightArrow":"\u27F9","DoubleRightArrow":"\u21D2","DoubleRightTee":"\u22A8","DoubleUpArrow":"\u21D1","DoubleUpDownArrow":"\u21D5","DoubleVerticalBar":"\u2225","downarrow":"\u2193","Downarrow":"\u21D3","DownArrow":"\u2193","DownArrowBar":"\u2913","DownArrowUpArrow":"\u21F5","DownBreve":"\u0311","downdownarrows":"\u21CA","downharpoonleft":"\u21C3","downharpoonright":"\u21C2","DownLeftRightVector":"\u2950","DownLeftTeeVector":"\u295E","DownLeftVector":"\u21BD","DownLeftVectorBar":"\u2956","DownRightTeeVector":"\u295F","DownRightVector":"\u21C1","DownRightVectorBar":"\u2957","DownTee":"\u22A4","DownTeeArrow":"\u21A7","drbkarow":"\u2910","drcorn":"\u231F","drcrop":"\u230C","dscr":"\u{1D4B9}","Dscr":"\u{1D49F}","dscy":"\u0455","DScy":"\u0405","dsol":"\u29F6","dstrok":"\u0111","Dstrok":"\u0110","dtdot":"\u22F1","dtri":"\u25BF","dtrif":"\u25BE","duarr":"\u21F5","duhar":"\u296F","dwangle":"\u29A6","dzcy":"\u045F","DZcy":"\u040F","dzigrarr":"\u27FF","eacute":"\xE9","Eacute":"\xC9","easter":"\u2A6E","ecaron":"\u011B","Ecaron":"\u011A","ecir":"\u2256","ecirc":"\xEA","Ecirc":"\xCA","ecolon":"\u2255","ecy":"\u044D","Ecy":"\u042D","eDDot":"\u2A77","edot":"\u0117","eDot":"\u2251","Edot":"\u0116","ee":"\u2147","efDot":"\u2252","efr":"\u{1D522}","Efr":"\u{1D508}","eg":"\u2A9A","egrave":"\xE8","Egrave":"\xC8","egs":"\u2A96","egsdot":"\u2A98","el":"\u2A99","Element":"\u2208","elinters":"\u23E7","ell":"\u2113","els":"\u2A95","elsdot":"\u2A97","emacr":"\u0113","Emacr":"\u0112","empty":"\u2205","emptyset":"\u2205","EmptySmallSquare":"\u25FB","emptyv":"\u2205","EmptyVerySmallSquare":"\u25AB","emsp":"\u2003","emsp13":"\u2004","emsp14":"\u2005","eng":"\u014B","ENG":"\u014A","ensp":"\u2002","eogon":"\u0119","Eogon":"\u0118","eopf":"\u{1D556}","Eopf":"\u{1D53C}","epar":"\u22D5","eparsl":"\u29E3","eplus":"\u2A71","epsi":"\u03B5","epsilon":"\u03B5","Epsilon":"\u0395","epsiv":"\u03F5","eqcirc":"\u2256","eqcolon":"\u2255","eqsim":"\u2242","eqslantgtr":"\u2A96","eqslantless":"\u2A95","Equal":"\u2A75","equals":"=","EqualTilde":"\u2242","equest":"\u225F","Equilibrium":"\u21CC","equiv":"\u2261","equivDD":"\u2A78","eqvparsl":"\u29E5","erarr":"\u2971","erDot":"\u2253","escr":"\u212F","Escr":"\u2130","esdot":"\u2250","esim":"\u2242","Esim":"\u2A73","eta":"\u03B7","Eta":"\u0397","eth":"\xF0","ETH":"\xD0","euml":"\xEB","Euml":"\xCB","euro":"\u20AC","excl":"!","exist":"\u2203","Exists":"\u2203","expectation":"\u2130","exponentiale":"\u2147","ExponentialE":"\u2147","fallingdotseq":"\u2252","fcy":"\u0444","Fcy":"\u0424","female":"\u2640","ffilig":"\uFB03","fflig":"\uFB00","ffllig":"\uFB04","ffr":"\u{1D523}","Ffr":"\u{1D509}","filig":"\uFB01","FilledSmallSquare":"\u25FC","FilledVerySmallSquare":"\u25AA","fjlig":"fj","flat":"\u266D","fllig":"\uFB02","fltns":"\u25B1","fnof":"\u0192","fopf":"\u{1D557}","Fopf":"\u{1D53D}","forall":"\u2200","ForAll":"\u2200","fork":"\u22D4","forkv":"\u2AD9","Fouriertrf":"\u2131","fpartint":"\u2A0D","frac12":"\xBD","frac13":"\u2153","frac14":"\xBC","frac15":"\u2155","frac16":"\u2159","frac18":"\u215B","frac23":"\u2154","frac25":"\u2156","frac34":"\xBE","frac35":"\u2157","frac38":"\u215C","frac45":"\u2158","frac56":"\u215A","frac58":"\u215D","frac78":"\u215E","frasl":"\u2044","frown":"\u2322","fscr":"\u{1D4BB}","Fscr":"\u2131","gacute":"\u01F5","gamma":"\u03B3","Gamma":"\u0393","gammad":"\u03DD","Gammad":"\u03DC","gap":"\u2A86","gbreve":"\u011F","Gbreve":"\u011E","Gcedil":"\u0122","gcirc":"\u011D","Gcirc":"\u011C","gcy":"\u0433","Gcy":"\u0413","gdot":"\u0121","Gdot":"\u0120","ge":"\u2265","gE":"\u2267","gel":"\u22DB","gEl":"\u2A8C","geq":"\u2265","geqq":"\u2267","geqslant":"\u2A7E","ges":"\u2A7E","gescc":"\u2AA9","gesdot":"\u2A80","gesdoto":"\u2A82","gesdotol":"\u2A84","gesl":"\u22DB\uFE00","gesles":"\u2A94","gfr":"\u{1D524}","Gfr":"\u{1D50A}","gg":"\u226B","Gg":"\u22D9","ggg":"\u22D9","gimel":"\u2137","gjcy":"\u0453","GJcy":"\u0403","gl":"\u2277","gla":"\u2AA5","glE":"\u2A92","glj":"\u2AA4","gnap":"\u2A8A","gnapprox":"\u2A8A","gne":"\u2A88","gnE":"\u2269","gneq":"\u2A88","gneqq":"\u2269","gnsim":"\u22E7","gopf":"\u{1D558}","Gopf":"\u{1D53E}","grave":"`","GreaterEqual":"\u2265","GreaterEqualLess":"\u22DB","GreaterFullEqual":"\u2267","GreaterGreater":"\u2AA2","GreaterLess":"\u2277","GreaterSlantEqual":"\u2A7E","GreaterTilde":"\u2273","gscr":"\u210A","Gscr":"\u{1D4A2}","gsim":"\u2273","gsime":"\u2A8E","gsiml":"\u2A90","gt":">","Gt":"\u226B","GT":">","gtcc":"\u2AA7","gtcir":"\u2A7A","gtdot":"\u22D7","gtlPar":"\u2995","gtquest":"\u2A7C","gtrapprox":"\u2A86","gtrarr":"\u2978","gtrdot":"\u22D7","gtreqless":"\u22DB","gtreqqless":"\u2A8C","gtrless":"\u2277","gtrsim":"\u2273","gvertneqq":"\u2269\uFE00","gvnE":"\u2269\uFE00","Hacek":"\u02C7","hairsp":"\u200A","half":"\xBD","hamilt":"\u210B","hardcy":"\u044A","HARDcy":"\u042A","harr":"\u2194","hArr":"\u21D4","harrcir":"\u2948","harrw":"\u21AD","Hat":"^","hbar":"\u210F","hcirc":"\u0125","Hcirc":"\u0124","hearts":"\u2665","heartsuit":"\u2665","hellip":"\u2026","hercon":"\u22B9","hfr":"\u{1D525}","Hfr":"\u210C","HilbertSpace":"\u210B","hksearow":"\u2925","hkswarow":"\u2926","hoarr":"\u21FF","homtht":"\u223B","hookleftarrow":"\u21A9","hookrightarrow":"\u21AA","hopf":"\u{1D559}","Hopf":"\u210D","horbar":"\u2015","HorizontalLine":"\u2500","hscr":"\u{1D4BD}","Hscr":"\u210B","hslash":"\u210F","hstrok":"\u0127","Hstrok":"\u0126","HumpDownHump":"\u224E","HumpEqual":"\u224F","hybull":"\u2043","hyphen":"\u2010","iacute":"\xED","Iacute":"\xCD","ic":"\u2063","icirc":"\xEE","Icirc":"\xCE","icy":"\u0438","Icy":"\u0418","Idot":"\u0130","iecy":"\u0435","IEcy":"\u0415","iexcl":"\xA1","iff":"\u21D4","ifr":"\u{1D526}","Ifr":"\u2111","igrave":"\xEC","Igrave":"\xCC","ii":"\u2148","iiiint":"\u2A0C","iiint":"\u222D","iinfin":"\u29DC","iiota":"\u2129","ijlig":"\u0133","IJlig":"\u0132","Im":"\u2111","imacr":"\u012B","Imacr":"\u012A","image":"\u2111","ImaginaryI":"\u2148","imagline":"\u2110","imagpart":"\u2111","imath":"\u0131","imof":"\u22B7","imped":"\u01B5","Implies":"\u21D2","in":"\u2208","incare":"\u2105","infin":"\u221E","infintie":"\u29DD","inodot":"\u0131","int":"\u222B","Int":"\u222C","intcal":"\u22BA","integers":"\u2124","Integral":"\u222B","intercal":"\u22BA","Intersection":"\u22C2","intlarhk":"\u2A17","intprod":"\u2A3C","InvisibleComma":"\u2063","InvisibleTimes":"\u2062","iocy":"\u0451","IOcy":"\u0401","iogon":"\u012F","Iogon":"\u012E","iopf":"\u{1D55A}","Iopf":"\u{1D540}","iota":"\u03B9","Iota":"\u0399","iprod":"\u2A3C","iquest":"\xBF","iscr":"\u{1D4BE}","Iscr":"\u2110","isin":"\u2208","isindot":"\u22F5","isinE":"\u22F9","isins":"\u22F4","isinsv":"\u22F3","isinv":"\u2208","it":"\u2062","itilde":"\u0129","Itilde":"\u0128","iukcy":"\u0456","Iukcy":"\u0406","iuml":"\xEF","Iuml":"\xCF","jcirc":"\u0135","Jcirc":"\u0134","jcy":"\u0439","Jcy":"\u0419","jfr":"\u{1D527}","Jfr":"\u{1D50D}","jmath":"\u0237","jopf":"\u{1D55B}","Jopf":"\u{1D541}","jscr":"\u{1D4BF}","Jscr":"\u{1D4A5}","jsercy":"\u0458","Jsercy":"\u0408","jukcy":"\u0454","Jukcy":"\u0404","kappa":"\u03BA","Kappa":"\u039A","kappav":"\u03F0","kcedil":"\u0137","Kcedil":"\u0136","kcy":"\u043A","Kcy":"\u041A","kfr":"\u{1D528}","Kfr":"\u{1D50E}","kgreen":"\u0138","khcy":"\u0445","KHcy":"\u0425","kjcy":"\u045C","KJcy":"\u040C","kopf":"\u{1D55C}","Kopf":"\u{1D542}","kscr":"\u{1D4C0}","Kscr":"\u{1D4A6}","lAarr":"\u21DA","lacute":"\u013A","Lacute":"\u0139","laemptyv":"\u29B4","lagran":"\u2112","lambda":"\u03BB","Lambda":"\u039B","lang":"\u27E8","Lang":"\u27EA","langd":"\u2991","langle":"\u27E8","lap":"\u2A85","Laplacetrf":"\u2112","laquo":"\xAB","larr":"\u2190","lArr":"\u21D0","Larr":"\u219E","larrb":"\u21E4","larrbfs":"\u291F","larrfs":"\u291D","larrhk":"\u21A9","larrlp":"\u21AB","larrpl":"\u2939","larrsim":"\u2973","larrtl":"\u21A2","lat":"\u2AAB","latail":"\u2919","lAtail":"\u291B","late":"\u2AAD","lates":"\u2AAD\uFE00","lbarr":"\u290C","lBarr":"\u290E","lbbrk":"\u2772","lbrace":"{","lbrack":"[","lbrke":"\u298B","lbrksld":"\u298F","lbrkslu":"\u298D","lcaron":"\u013E","Lcaron":"\u013D","lcedil":"\u013C","Lcedil":"\u013B","lceil":"\u2308","lcub":"{","lcy":"\u043B","Lcy":"\u041B","ldca":"\u2936","ldquo":"\u201C","ldquor":"\u201E","ldrdhar":"\u2967","ldrushar":"\u294B","ldsh":"\u21B2","le":"\u2264","lE":"\u2266","LeftAngleBracket":"\u27E8","leftarrow":"\u2190","Leftarrow":"\u21D0","LeftArrow":"\u2190","LeftArrowBar":"\u21E4","LeftArrowRightArrow":"\u21C6","leftarrowtail":"\u21A2","LeftCeiling":"\u2308","LeftDoubleBracket":"\u27E6","LeftDownTeeVector":"\u2961","LeftDownVector":"\u21C3","LeftDownVectorBar":"\u2959","LeftFloor":"\u230A","leftharpoondown":"\u21BD","leftharpoonup":"\u21BC","leftleftarrows":"\u21C7","leftrightarrow":"\u2194","Leftrightarrow":"\u21D4","LeftRightArrow":"\u2194","leftrightarrows":"\u21C6","leftrightharpoons":"\u21CB","leftrightsquigarrow":"\u21AD","LeftRightVector":"\u294E","LeftTee":"\u22A3","LeftTeeArrow":"\u21A4","LeftTeeVector":"\u295A","leftthreetimes":"\u22CB","LeftTriangle":"\u22B2","LeftTriangleBar":"\u29CF","LeftTriangleEqual":"\u22B4","LeftUpDownVector":"\u2951","LeftUpTeeVector":"\u2960","LeftUpVector":"\u21BF","LeftUpVectorBar":"\u2958","LeftVector":"\u21BC","LeftVectorBar":"\u2952","leg":"\u22DA","lEg":"\u2A8B","leq":"\u2264","leqq":"\u2266","leqslant":"\u2A7D","les":"\u2A7D","lescc":"\u2AA8","lesdot":"\u2A7F","lesdoto":"\u2A81","lesdotor":"\u2A83","lesg":"\u22DA\uFE00","lesges":"\u2A93","lessapprox":"\u2A85","lessdot":"\u22D6","lesseqgtr":"\u22DA","lesseqqgtr":"\u2A8B","LessEqualGreater":"\u22DA","LessFullEqual":"\u2266","LessGreater":"\u2276","lessgtr":"\u2276","LessLess":"\u2AA1","lesssim":"\u2272","LessSlantEqual":"\u2A7D","LessTilde":"\u2272","lfisht":"\u297C","lfloor":"\u230A","lfr":"\u{1D529}","Lfr":"\u{1D50F}","lg":"\u2276","lgE":"\u2A91","lHar":"\u2962","lhard":"\u21BD","lharu":"\u21BC","lharul":"\u296A","lhblk":"\u2584","ljcy":"\u0459","LJcy":"\u0409","ll":"\u226A","Ll":"\u22D8","llarr":"\u21C7","llcorner":"\u231E","Lleftarrow":"\u21DA","llhard":"\u296B","lltri":"\u25FA","lmidot":"\u0140","Lmidot":"\u013F","lmoust":"\u23B0","lmoustache":"\u23B0","lnap":"\u2A89","lnapprox":"\u2A89","lne":"\u2A87","lnE":"\u2268","lneq":"\u2A87","lneqq":"\u2268","lnsim":"\u22E6","loang":"\u27EC","loarr":"\u21FD","lobrk":"\u27E6","longleftarrow":"\u27F5","Longleftarrow":"\u27F8","LongLeftArrow":"\u27F5","longleftrightarrow":"\u27F7","Longleftrightarrow":"\u27FA","LongLeftRightArrow":"\u27F7","longmapsto":"\u27FC","longrightarrow":"\u27F6","Longrightarrow":"\u27F9","LongRightArrow":"\u27F6","looparrowleft":"\u21AB","looparrowright":"\u21AC","lopar":"\u2985","lopf":"\u{1D55D}","Lopf":"\u{1D543}","loplus":"\u2A2D","lotimes":"\u2A34","lowast":"\u2217","lowbar":"_","LowerLeftArrow":"\u2199","LowerRightArrow":"\u2198","loz":"\u25CA","lozenge":"\u25CA","lozf":"\u29EB","lpar":"(","lparlt":"\u2993","lrarr":"\u21C6","lrcorner":"\u231F","lrhar":"\u21CB","lrhard":"\u296D","lrm":"\u200E","lrtri":"\u22BF","lsaquo":"\u2039","lscr":"\u{1D4C1}","Lscr":"\u2112","lsh":"\u21B0","Lsh":"\u21B0","lsim":"\u2272","lsime":"\u2A8D","lsimg":"\u2A8F","lsqb":"[","lsquo":"\u2018","lsquor":"\u201A","lstrok":"\u0142","Lstrok":"\u0141","lt":"<","Lt":"\u226A","LT":"<","ltcc":"\u2AA6","ltcir":"\u2A79","ltdot":"\u22D6","lthree":"\u22CB","ltimes":"\u22C9","ltlarr":"\u2976","ltquest":"\u2A7B","ltri":"\u25C3","ltrie":"\u22B4","ltrif":"\u25C2","ltrPar":"\u2996","lurdshar":"\u294A","luruhar":"\u2966","lvertneqq":"\u2268\uFE00","lvnE":"\u2268\uFE00","macr":"\xAF","male":"\u2642","malt":"\u2720","maltese":"\u2720","map":"\u21A6","Map":"\u2905","mapsto":"\u21A6","mapstodown":"\u21A7","mapstoleft":"\u21A4","mapstoup":"\u21A5","marker":"\u25AE","mcomma":"\u2A29","mcy":"\u043C","Mcy":"\u041C","mdash":"\u2014","mDDot":"\u223A","measuredangle":"\u2221","MediumSpace":"\u205F","Mellintrf":"\u2133","mfr":"\u{1D52A}","Mfr":"\u{1D510}","mho":"\u2127","micro":"\xB5","mid":"\u2223","midast":"*","midcir":"\u2AF0","middot":"\xB7","minus":"\u2212","minusb":"\u229F","minusd":"\u2238","minusdu":"\u2A2A","MinusPlus":"\u2213","mlcp":"\u2ADB","mldr":"\u2026","mnplus":"\u2213","models":"\u22A7","mopf":"\u{1D55E}","Mopf":"\u{1D544}","mp":"\u2213","mscr":"\u{1D4C2}","Mscr":"\u2133","mstpos":"\u223E","mu":"\u03BC","Mu":"\u039C","multimap":"\u22B8","mumap":"\u22B8","nabla":"\u2207","nacute":"\u0144","Nacute":"\u0143","nang":"\u2220\u20D2","nap":"\u2249","napE":"\u2A70\u0338","napid":"\u224B\u0338","napos":"\u0149","napprox":"\u2249","natur":"\u266E","natural":"\u266E","naturals":"\u2115","nbsp":"\xA0","nbump":"\u224E\u0338","nbumpe":"\u224F\u0338","ncap":"\u2A43","ncaron":"\u0148","Ncaron":"\u0147","ncedil":"\u0146","Ncedil":"\u0145","ncong":"\u2247","ncongdot":"\u2A6D\u0338","ncup":"\u2A42","ncy":"\u043D","Ncy":"\u041D","ndash":"\u2013","ne":"\u2260","nearhk":"\u2924","nearr":"\u2197","neArr":"\u21D7","nearrow":"\u2197","nedot":"\u2250\u0338","NegativeMediumSpace":"\u200B","NegativeThickSpace":"\u200B","NegativeThinSpace":"\u200B","NegativeVeryThinSpace":"\u200B","nequiv":"\u2262","nesear":"\u2928","nesim":"\u2242\u0338","NestedGreaterGreater":"\u226B","NestedLessLess":"\u226A","NewLine":"\n","nexist":"\u2204","nexists":"\u2204","nfr":"\u{1D52B}","Nfr":"\u{1D511}","nge":"\u2271","ngE":"\u2267\u0338","ngeq":"\u2271","ngeqq":"\u2267\u0338","ngeqslant":"\u2A7E\u0338","nges":"\u2A7E\u0338","nGg":"\u22D9\u0338","ngsim":"\u2275","ngt":"\u226F","nGt":"\u226B\u20D2","ngtr":"\u226F","nGtv":"\u226B\u0338","nharr":"\u21AE","nhArr":"\u21CE","nhpar":"\u2AF2","ni":"\u220B","nis":"\u22FC","nisd":"\u22FA","niv":"\u220B","njcy":"\u045A","NJcy":"\u040A","nlarr":"\u219A","nlArr":"\u21CD","nldr":"\u2025","nle":"\u2270","nlE":"\u2266\u0338","nleftarrow":"\u219A","nLeftarrow":"\u21CD","nleftrightarrow":"\u21AE","nLeftrightarrow":"\u21CE","nleq":"\u2270","nleqq":"\u2266\u0338","nleqslant":"\u2A7D\u0338","nles":"\u2A7D\u0338","nless":"\u226E","nLl":"\u22D8\u0338","nlsim":"\u2274","nlt":"\u226E","nLt":"\u226A\u20D2","nltri":"\u22EA","nltrie":"\u22EC","nLtv":"\u226A\u0338","nmid":"\u2224","NoBreak":"\u2060","NonBreakingSpace":"\xA0","nopf":"\u{1D55F}","Nopf":"\u2115","not":"\xAC","Not":"\u2AEC","NotCongruent":"\u2262","NotCupCap":"\u226D","NotDoubleVerticalBar":"\u2226","NotElement":"\u2209","NotEqual":"\u2260","NotEqualTilde":"\u2242\u0338","NotExists":"\u2204","NotGreater":"\u226F","NotGreaterEqual":"\u2271","NotGreaterFullEqual":"\u2267\u0338","NotGreaterGreater":"\u226B\u0338","NotGreaterLess":"\u2279","NotGreaterSlantEqual":"\u2A7E\u0338","NotGreaterTilde":"\u2275","NotHumpDownHump":"\u224E\u0338","NotHumpEqual":"\u224F\u0338","notin":"\u2209","notindot":"\u22F5\u0338","notinE":"\u22F9\u0338","notinva":"\u2209","notinvb":"\u22F7","notinvc":"\u22F6","NotLeftTriangle":"\u22EA","NotLeftTriangleBar":"\u29CF\u0338","NotLeftTriangleEqual":"\u22EC","NotLess":"\u226E","NotLessEqual":"\u2270","NotLessGreater":"\u2278","NotLessLess":"\u226A\u0338","NotLessSlantEqual":"\u2A7D\u0338","NotLessTilde":"\u2274","NotNestedGreaterGreater":"\u2AA2\u0338","NotNestedLessLess":"\u2AA1\u0338","notni":"\u220C","notniva":"\u220C","notnivb":"\u22FE","notnivc":"\u22FD","NotPrecedes":"\u2280","NotPrecedesEqual":"\u2AAF\u0338","NotPrecedesSlantEqual":"\u22E0","NotReverseElement":"\u220C","NotRightTriangle":"\u22EB","NotRightTriangleBar":"\u29D0\u0338","NotRightTriangleEqual":"\u22ED","NotSquareSubset":"\u228F\u0338","NotSquareSubsetEqual":"\u22E2","NotSquareSuperset":"\u2290\u0338","NotSquareSupersetEqual":"\u22E3","NotSubset":"\u2282\u20D2","NotSubsetEqual":"\u2288","NotSucceeds":"\u2281","NotSucceedsEqual":"\u2AB0\u0338","NotSucceedsSlantEqual":"\u22E1","NotSucceedsTilde":"\u227F\u0338","NotSuperset":"\u2283\u20D2","NotSupersetEqual":"\u2289","NotTilde":"\u2241","NotTildeEqual":"\u2244","NotTildeFullEqual":"\u2247","NotTildeTilde":"\u2249","NotVerticalBar":"\u2224","npar":"\u2226","nparallel":"\u2226","nparsl":"\u2AFD\u20E5","npart":"\u2202\u0338","npolint":"\u2A14","npr":"\u2280","nprcue":"\u22E0","npre":"\u2AAF\u0338","nprec":"\u2280","npreceq":"\u2AAF\u0338","nrarr":"\u219B","nrArr":"\u21CF","nrarrc":"\u2933\u0338","nrarrw":"\u219D\u0338","nrightarrow":"\u219B","nRightarrow":"\u21CF","nrtri":"\u22EB","nrtrie":"\u22ED","nsc":"\u2281","nsccue":"\u22E1","nsce":"\u2AB0\u0338","nscr":"\u{1D4C3}","Nscr":"\u{1D4A9}","nshortmid":"\u2224","nshortparallel":"\u2226","nsim":"\u2241","nsime":"\u2244","nsimeq":"\u2244","nsmid":"\u2224","nspar":"\u2226","nsqsube":"\u22E2","nsqsupe":"\u22E3","nsub":"\u2284","nsube":"\u2288","nsubE":"\u2AC5\u0338","nsubset":"\u2282\u20D2","nsubseteq":"\u2288","nsubseteqq":"\u2AC5\u0338","nsucc":"\u2281","nsucceq":"\u2AB0\u0338","nsup":"\u2285","nsupe":"\u2289","nsupE":"\u2AC6\u0338","nsupset":"\u2283\u20D2","nsupseteq":"\u2289","nsupseteqq":"\u2AC6\u0338","ntgl":"\u2279","ntilde":"\xF1","Ntilde":"\xD1","ntlg":"\u2278","ntriangleleft":"\u22EA","ntrianglelefteq":"\u22EC","ntriangleright":"\u22EB","ntrianglerighteq":"\u22ED","nu":"\u03BD","Nu":"\u039D","num":"#","numero":"\u2116","numsp":"\u2007","nvap":"\u224D\u20D2","nvdash":"\u22AC","nvDash":"\u22AD","nVdash":"\u22AE","nVDash":"\u22AF","nvge":"\u2265\u20D2","nvgt":">\u20D2","nvHarr":"\u2904","nvinfin":"\u29DE","nvlArr":"\u2902","nvle":"\u2264\u20D2","nvlt":"<\u20D2","nvltrie":"\u22B4\u20D2","nvrArr":"\u2903","nvrtrie":"\u22B5\u20D2","nvsim":"\u223C\u20D2","nwarhk":"\u2923","nwarr":"\u2196","nwArr":"\u21D6","nwarrow":"\u2196","nwnear":"\u2927","oacute":"\xF3","Oacute":"\xD3","oast":"\u229B","ocir":"\u229A","ocirc":"\xF4","Ocirc":"\xD4","ocy":"\u043E","Ocy":"\u041E","odash":"\u229D","odblac":"\u0151","Odblac":"\u0150","odiv":"\u2A38","odot":"\u2299","odsold":"\u29BC","oelig":"\u0153","OElig":"\u0152","ofcir":"\u29BF","ofr":"\u{1D52C}","Ofr":"\u{1D512}","ogon":"\u02DB","ograve":"\xF2","Ograve":"\xD2","ogt":"\u29C1","ohbar":"\u29B5","ohm":"\u03A9","oint":"\u222E","olarr":"\u21BA","olcir":"\u29BE","olcross":"\u29BB","oline":"\u203E","olt":"\u29C0","omacr":"\u014D","Omacr":"\u014C","omega":"\u03C9","Omega":"\u03A9","omicron":"\u03BF","Omicron":"\u039F","omid":"\u29B6","ominus":"\u2296","oopf":"\u{1D560}","Oopf":"\u{1D546}","opar":"\u29B7","OpenCurlyDoubleQuote":"\u201C","OpenCurlyQuote":"\u2018","operp":"\u29B9","oplus":"\u2295","or":"\u2228","Or":"\u2A54","orarr":"\u21BB","ord":"\u2A5D","order":"\u2134","orderof":"\u2134","ordf":"\xAA","ordm":"\xBA","origof":"\u22B6","oror":"\u2A56","orslope":"\u2A57","orv":"\u2A5B","oS":"\u24C8","oscr":"\u2134","Oscr":"\u{1D4AA}","oslash":"\xF8","Oslash":"\xD8","osol":"\u2298","otilde":"\xF5","Otilde":"\xD5","otimes":"\u2297","Otimes":"\u2A37","otimesas":"\u2A36","ouml":"\xF6","Ouml":"\xD6","ovbar":"\u233D","OverBar":"\u203E","OverBrace":"\u23DE","OverBracket":"\u23B4","OverParenthesis":"\u23DC","par":"\u2225","para":"\xB6","parallel":"\u2225","parsim":"\u2AF3","parsl":"\u2AFD","part":"\u2202","PartialD":"\u2202","pcy":"\u043F","Pcy":"\u041F","percnt":"%","period":".","permil":"\u2030","perp":"\u22A5","pertenk":"\u2031","pfr":"\u{1D52D}","Pfr":"\u{1D513}","phi":"\u03C6","Phi":"\u03A6","phiv":"\u03D5","phmmat":"\u2133","phone":"\u260E","pi":"\u03C0","Pi":"\u03A0","pitchfork":"\u22D4","piv":"\u03D6","planck":"\u210F","planckh":"\u210E","plankv":"\u210F","plus":"+","plusacir":"\u2A23","plusb":"\u229E","pluscir":"\u2A22","plusdo":"\u2214","plusdu":"\u2A25","pluse":"\u2A72","PlusMinus":"\xB1","plusmn":"\xB1","plussim":"\u2A26","plustwo":"\u2A27","pm":"\xB1","Poincareplane":"\u210C","pointint":"\u2A15","popf":"\u{1D561}","Popf":"\u2119","pound":"\xA3","pr":"\u227A","Pr":"\u2ABB","prap":"\u2AB7","prcue":"\u227C","pre":"\u2AAF","prE":"\u2AB3","prec":"\u227A","precapprox":"\u2AB7","preccurlyeq":"\u227C","Precedes":"\u227A","PrecedesEqual":"\u2AAF","PrecedesSlantEqual":"\u227C","PrecedesTilde":"\u227E","preceq":"\u2AAF","precnapprox":"\u2AB9","precneqq":"\u2AB5","precnsim":"\u22E8","precsim":"\u227E","prime":"\u2032","Prime":"\u2033","primes":"\u2119","prnap":"\u2AB9","prnE":"\u2AB5","prnsim":"\u22E8","prod":"\u220F","Product":"\u220F","profalar":"\u232E","profline":"\u2312","profsurf":"\u2313","prop":"\u221D","Proportion":"\u2237","Proportional":"\u221D","propto":"\u221D","prsim":"\u227E","prurel":"\u22B0","pscr":"\u{1D4C5}","Pscr":"\u{1D4AB}","psi":"\u03C8","Psi":"\u03A8","puncsp":"\u2008","qfr":"\u{1D52E}","Qfr":"\u{1D514}","qint":"\u2A0C","qopf":"\u{1D562}","Qopf":"\u211A","qprime":"\u2057","qscr":"\u{1D4C6}","Qscr":"\u{1D4AC}","quaternions":"\u210D","quatint":"\u2A16","quest":"?","questeq":"\u225F","quot":'"',"QUOT":'"',"rAarr":"\u21DB","race":"\u223D\u0331","racute":"\u0155","Racute":"\u0154","radic":"\u221A","raemptyv":"\u29B3","rang":"\u27E9","Rang":"\u27EB","rangd":"\u2992","range":"\u29A5","rangle":"\u27E9","raquo":"\xBB","rarr":"\u2192","rArr":"\u21D2","Rarr":"\u21A0","rarrap":"\u2975","rarrb":"\u21E5","rarrbfs":"\u2920","rarrc":"\u2933","rarrfs":"\u291E","rarrhk":"\u21AA","rarrlp":"\u21AC","rarrpl":"\u2945","rarrsim":"\u2974","rarrtl":"\u21A3","Rarrtl":"\u2916","rarrw":"\u219D","ratail":"\u291A","rAtail":"\u291C","ratio":"\u2236","rationals":"\u211A","rbarr":"\u290D","rBarr":"\u290F","RBarr":"\u2910","rbbrk":"\u2773","rbrace":"}","rbrack":"]","rbrke":"\u298C","rbrksld":"\u298E","rbrkslu":"\u2990","rcaron":"\u0159","Rcaron":"\u0158","rcedil":"\u0157","Rcedil":"\u0156","rceil":"\u2309","rcub":"}","rcy":"\u0440","Rcy":"\u0420","rdca":"\u2937","rdldhar":"\u2969","rdquo":"\u201D","rdquor":"\u201D","rdsh":"\u21B3","Re":"\u211C","real":"\u211C","realine":"\u211B","realpart":"\u211C","reals":"\u211D","rect":"\u25AD","reg":"\xAE","REG":"\xAE","ReverseElement":"\u220B","ReverseEquilibrium":"\u21CB","ReverseUpEquilibrium":"\u296F","rfisht":"\u297D","rfloor":"\u230B","rfr":"\u{1D52F}","Rfr":"\u211C","rHar":"\u2964","rhard":"\u21C1","rharu":"\u21C0","rharul":"\u296C","rho":"\u03C1","Rho":"\u03A1","rhov":"\u03F1","RightAngleBracket":"\u27E9","rightarrow":"\u2192","Rightarrow":"\u21D2","RightArrow":"\u2192","RightArrowBar":"\u21E5","RightArrowLeftArrow":"\u21C4","rightarrowtail":"\u21A3","RightCeiling":"\u2309","RightDoubleBracket":"\u27E7","RightDownTeeVector":"\u295D","RightDownVector":"\u21C2","RightDownVectorBar":"\u2955","RightFloor":"\u230B","rightharpoondown":"\u21C1","rightharpoonup":"\u21C0","rightleftarrows":"\u21C4","rightleftharpoons":"\u21CC","rightrightarrows":"\u21C9","rightsquigarrow":"\u219D","RightTee":"\u22A2","RightTeeArrow":"\u21A6","RightTeeVector":"\u295B","rightthreetimes":"\u22CC","RightTriangle":"\u22B3","RightTriangleBar":"\u29D0","RightTriangleEqual":"\u22B5","RightUpDownVector":"\u294F","RightUpTeeVector":"\u295C","RightUpVector":"\u21BE","RightUpVectorBar":"\u2954","RightVector":"\u21C0","RightVectorBar":"\u2953","ring":"\u02DA","risingdotseq":"\u2253","rlarr":"\u21C4","rlhar":"\u21CC","rlm":"\u200F","rmoust":"\u23B1","rmoustache":"\u23B1","rnmid":"\u2AEE","roang":"\u27ED","roarr":"\u21FE","robrk":"\u27E7","ropar":"\u2986","ropf":"\u{1D563}","Ropf":"\u211D","roplus":"\u2A2E","rotimes":"\u2A35","RoundImplies":"\u2970","rpar":")","rpargt":"\u2994","rppolint":"\u2A12","rrarr":"\u21C9","Rrightarrow":"\u21DB","rsaquo":"\u203A","rscr":"\u{1D4C7}","Rscr":"\u211B","rsh":"\u21B1","Rsh":"\u21B1","rsqb":"]","rsquo":"\u2019","rsquor":"\u2019","rthree":"\u22CC","rtimes":"\u22CA","rtri":"\u25B9","rtrie":"\u22B5","rtrif":"\u25B8","rtriltri":"\u29CE","RuleDelayed":"\u29F4","ruluhar":"\u2968","rx":"\u211E","sacute":"\u015B","Sacute":"\u015A","sbquo":"\u201A","sc":"\u227B","Sc":"\u2ABC","scap":"\u2AB8","scaron":"\u0161","Scaron":"\u0160","sccue":"\u227D","sce":"\u2AB0","scE":"\u2AB4","scedil":"\u015F","Scedil":"\u015E","scirc":"\u015D","Scirc":"\u015C","scnap":"\u2ABA","scnE":"\u2AB6","scnsim":"\u22E9","scpolint":"\u2A13","scsim":"\u227F","scy":"\u0441","Scy":"\u0421","sdot":"\u22C5","sdotb":"\u22A1","sdote":"\u2A66","searhk":"\u2925","searr":"\u2198","seArr":"\u21D8","searrow":"\u2198","sect":"\xA7","semi":";","seswar":"\u2929","setminus":"\u2216","setmn":"\u2216","sext":"\u2736","sfr":"\u{1D530}","Sfr":"\u{1D516}","sfrown":"\u2322","sharp":"\u266F","shchcy":"\u0449","SHCHcy":"\u0429","shcy":"\u0448","SHcy":"\u0428","ShortDownArrow":"\u2193","ShortLeftArrow":"\u2190","shortmid":"\u2223","shortparallel":"\u2225","ShortRightArrow":"\u2192","ShortUpArrow":"\u2191","shy":"\xAD","sigma":"\u03C3","Sigma":"\u03A3","sigmaf":"\u03C2","sigmav":"\u03C2","sim":"\u223C","simdot":"\u2A6A","sime":"\u2243","simeq":"\u2243","simg":"\u2A9E","simgE":"\u2AA0","siml":"\u2A9D","simlE":"\u2A9F","simne":"\u2246","simplus":"\u2A24","simrarr":"\u2972","slarr":"\u2190","SmallCircle":"\u2218","smallsetminus":"\u2216","smashp":"\u2A33","smeparsl":"\u29E4","smid":"\u2223","smile":"\u2323","smt":"\u2AAA","smte":"\u2AAC","smtes":"\u2AAC\uFE00","softcy":"\u044C","SOFTcy":"\u042C","sol":"/","solb":"\u29C4","solbar":"\u233F","sopf":"\u{1D564}","Sopf":"\u{1D54A}","spades":"\u2660","spadesuit":"\u2660","spar":"\u2225","sqcap":"\u2293","sqcaps":"\u2293\uFE00","sqcup":"\u2294","sqcups":"\u2294\uFE00","Sqrt":"\u221A","sqsub":"\u228F","sqsube":"\u2291","sqsubset":"\u228F","sqsubseteq":"\u2291","sqsup":"\u2290","sqsupe":"\u2292","sqsupset":"\u2290","sqsupseteq":"\u2292","squ":"\u25A1","square":"\u25A1","Square":"\u25A1","SquareIntersection":"\u2293","SquareSubset":"\u228F","SquareSubsetEqual":"\u2291","SquareSuperset":"\u2290","SquareSupersetEqual":"\u2292","SquareUnion":"\u2294","squarf":"\u25AA","squf":"\u25AA","srarr":"\u2192","sscr":"\u{1D4C8}","Sscr":"\u{1D4AE}","ssetmn":"\u2216","ssmile":"\u2323","sstarf":"\u22C6","star":"\u2606","Star":"\u22C6","starf":"\u2605","straightepsilon":"\u03F5","straightphi":"\u03D5","strns":"\xAF","sub":"\u2282","Sub":"\u22D0","subdot":"\u2ABD","sube":"\u2286","subE":"\u2AC5","subedot":"\u2AC3","submult":"\u2AC1","subne":"\u228A","subnE":"\u2ACB","subplus":"\u2ABF","subrarr":"\u2979","subset":"\u2282","Subset":"\u22D0","subseteq":"\u2286","subseteqq":"\u2AC5","SubsetEqual":"\u2286","subsetneq":"\u228A","subsetneqq":"\u2ACB","subsim":"\u2AC7","subsub":"\u2AD5","subsup":"\u2AD3","succ":"\u227B","succapprox":"\u2AB8","succcurlyeq":"\u227D","Succeeds":"\u227B","SucceedsEqual":"\u2AB0","SucceedsSlantEqual":"\u227D","SucceedsTilde":"\u227F","succeq":"\u2AB0","succnapprox":"\u2ABA","succneqq":"\u2AB6","succnsim":"\u22E9","succsim":"\u227F","SuchThat":"\u220B","sum":"\u2211","Sum":"\u2211","sung":"\u266A","sup":"\u2283","Sup":"\u22D1","sup1":"\xB9","sup2":"\xB2","sup3":"\xB3","supdot":"\u2ABE","supdsub":"\u2AD8","supe":"\u2287","supE":"\u2AC6","supedot":"\u2AC4","Superset":"\u2283","SupersetEqual":"\u2287","suphsol":"\u27C9","suphsub":"\u2AD7","suplarr":"\u297B","supmult":"\u2AC2","supne":"\u228B","supnE":"\u2ACC","supplus":"\u2AC0","supset":"\u2283","Supset":"\u22D1","supseteq":"\u2287","supseteqq":"\u2AC6","supsetneq":"\u228B","supsetneqq":"\u2ACC","supsim":"\u2AC8","supsub":"\u2AD4","supsup":"\u2AD6","swarhk":"\u2926","swarr":"\u2199","swArr":"\u21D9","swarrow":"\u2199","swnwar":"\u292A","szlig":"\xDF","Tab":" ","target":"\u2316","tau":"\u03C4","Tau":"\u03A4","tbrk":"\u23B4","tcaron":"\u0165","Tcaron":"\u0164","tcedil":"\u0163","Tcedil":"\u0162","tcy":"\u0442","Tcy":"\u0422","tdot":"\u20DB","telrec":"\u2315","tfr":"\u{1D531}","Tfr":"\u{1D517}","there4":"\u2234","therefore":"\u2234","Therefore":"\u2234","theta":"\u03B8","Theta":"\u0398","thetasym":"\u03D1","thetav":"\u03D1","thickapprox":"\u2248","thicksim":"\u223C","ThickSpace":"\u205F\u200A","thinsp":"\u2009","ThinSpace":"\u2009","thkap":"\u2248","thksim":"\u223C","thorn":"\xFE","THORN":"\xDE","tilde":"\u02DC","Tilde":"\u223C","TildeEqual":"\u2243","TildeFullEqual":"\u2245","TildeTilde":"\u2248","times":"\xD7","timesb":"\u22A0","timesbar":"\u2A31","timesd":"\u2A30","tint":"\u222D","toea":"\u2928","top":"\u22A4","topbot":"\u2336","topcir":"\u2AF1","topf":"\u{1D565}","Topf":"\u{1D54B}","topfork":"\u2ADA","tosa":"\u2929","tprime":"\u2034","trade":"\u2122","TRADE":"\u2122","triangle":"\u25B5","triangledown":"\u25BF","triangleleft":"\u25C3","trianglelefteq":"\u22B4","triangleq":"\u225C","triangleright":"\u25B9","trianglerighteq":"\u22B5","tridot":"\u25EC","trie":"\u225C","triminus":"\u2A3A","TripleDot":"\u20DB","triplus":"\u2A39","trisb":"\u29CD","tritime":"\u2A3B","trpezium":"\u23E2","tscr":"\u{1D4C9}","Tscr":"\u{1D4AF}","tscy":"\u0446","TScy":"\u0426","tshcy":"\u045B","TSHcy":"\u040B","tstrok":"\u0167","Tstrok":"\u0166","twixt":"\u226C","twoheadleftarrow":"\u219E","twoheadrightarrow":"\u21A0","uacute":"\xFA","Uacute":"\xDA","uarr":"\u2191","uArr":"\u21D1","Uarr":"\u219F","Uarrocir":"\u2949","ubrcy":"\u045E","Ubrcy":"\u040E","ubreve":"\u016D","Ubreve":"\u016C","ucirc":"\xFB","Ucirc":"\xDB","ucy":"\u0443","Ucy":"\u0423","udarr":"\u21C5","udblac":"\u0171","Udblac":"\u0170","udhar":"\u296E","ufisht":"\u297E","ufr":"\u{1D532}","Ufr":"\u{1D518}","ugrave":"\xF9","Ugrave":"\xD9","uHar":"\u2963","uharl":"\u21BF","uharr":"\u21BE","uhblk":"\u2580","ulcorn":"\u231C","ulcorner":"\u231C","ulcrop":"\u230F","ultri":"\u25F8","umacr":"\u016B","Umacr":"\u016A","uml":"\xA8","UnderBar":"_","UnderBrace":"\u23DF","UnderBracket":"\u23B5","UnderParenthesis":"\u23DD","Union":"\u22C3","UnionPlus":"\u228E","uogon":"\u0173","Uogon":"\u0172","uopf":"\u{1D566}","Uopf":"\u{1D54C}","uparrow":"\u2191","Uparrow":"\u21D1","UpArrow":"\u2191","UpArrowBar":"\u2912","UpArrowDownArrow":"\u21C5","updownarrow":"\u2195","Updownarrow":"\u21D5","UpDownArrow":"\u2195","UpEquilibrium":"\u296E","upharpoonleft":"\u21BF","upharpoonright":"\u21BE","uplus":"\u228E","UpperLeftArrow":"\u2196","UpperRightArrow":"\u2197","upsi":"\u03C5","Upsi":"\u03D2","upsih":"\u03D2","upsilon":"\u03C5","Upsilon":"\u03A5","UpTee":"\u22A5","UpTeeArrow":"\u21A5","upuparrows":"\u21C8","urcorn":"\u231D","urcorner":"\u231D","urcrop":"\u230E","uring":"\u016F","Uring":"\u016E","urtri":"\u25F9","uscr":"\u{1D4CA}","Uscr":"\u{1D4B0}","utdot":"\u22F0","utilde":"\u0169","Utilde":"\u0168","utri":"\u25B5","utrif":"\u25B4","uuarr":"\u21C8","uuml":"\xFC","Uuml":"\xDC","uwangle":"\u29A7","vangrt":"\u299C","varepsilon":"\u03F5","varkappa":"\u03F0","varnothing":"\u2205","varphi":"\u03D5","varpi":"\u03D6","varpropto":"\u221D","varr":"\u2195","vArr":"\u21D5","varrho":"\u03F1","varsigma":"\u03C2","varsubsetneq":"\u228A\uFE00","varsubsetneqq":"\u2ACB\uFE00","varsupsetneq":"\u228B\uFE00","varsupsetneqq":"\u2ACC\uFE00","vartheta":"\u03D1","vartriangleleft":"\u22B2","vartriangleright":"\u22B3","vBar":"\u2AE8","Vbar":"\u2AEB","vBarv":"\u2AE9","vcy":"\u0432","Vcy":"\u0412","vdash":"\u22A2","vDash":"\u22A8","Vdash":"\u22A9","VDash":"\u22AB","Vdashl":"\u2AE6","vee":"\u2228","Vee":"\u22C1","veebar":"\u22BB","veeeq":"\u225A","vellip":"\u22EE","verbar":"|","Verbar":"\u2016","vert":"|","Vert":"\u2016","VerticalBar":"\u2223","VerticalLine":"|","VerticalSeparator":"\u2758","VerticalTilde":"\u2240","VeryThinSpace":"\u200A","vfr":"\u{1D533}","Vfr":"\u{1D519}","vltri":"\u22B2","vnsub":"\u2282\u20D2","vnsup":"\u2283\u20D2","vopf":"\u{1D567}","Vopf":"\u{1D54D}","vprop":"\u221D","vrtri":"\u22B3","vscr":"\u{1D4CB}","Vscr":"\u{1D4B1}","vsubne":"\u228A\uFE00","vsubnE":"\u2ACB\uFE00","vsupne":"\u228B\uFE00","vsupnE":"\u2ACC\uFE00","Vvdash":"\u22AA","vzigzag":"\u299A","wcirc":"\u0175","Wcirc":"\u0174","wedbar":"\u2A5F","wedge":"\u2227","Wedge":"\u22C0","wedgeq":"\u2259","weierp":"\u2118","wfr":"\u{1D534}","Wfr":"\u{1D51A}","wopf":"\u{1D568}","Wopf":"\u{1D54E}","wp":"\u2118","wr":"\u2240","wreath":"\u2240","wscr":"\u{1D4CC}","Wscr":"\u{1D4B2}","xcap":"\u22C2","xcirc":"\u25EF","xcup":"\u22C3","xdtri":"\u25BD","xfr":"\u{1D535}","Xfr":"\u{1D51B}","xharr":"\u27F7","xhArr":"\u27FA","xi":"\u03BE","Xi":"\u039E","xlarr":"\u27F5","xlArr":"\u27F8","xmap":"\u27FC","xnis":"\u22FB","xodot":"\u2A00","xopf":"\u{1D569}","Xopf":"\u{1D54F}","xoplus":"\u2A01","xotime":"\u2A02","xrarr":"\u27F6","xrArr":"\u27F9","xscr":"\u{1D4CD}","Xscr":"\u{1D4B3}","xsqcup":"\u2A06","xuplus":"\u2A04","xutri":"\u25B3","xvee":"\u22C1","xwedge":"\u22C0","yacute":"\xFD","Yacute":"\xDD","yacy":"\u044F","YAcy":"\u042F","ycirc":"\u0177","Ycirc":"\u0176","ycy":"\u044B","Ycy":"\u042B","yen":"\xA5","yfr":"\u{1D536}","Yfr":"\u{1D51C}","yicy":"\u0457","YIcy":"\u0407","yopf":"\u{1D56A}","Yopf":"\u{1D550}","yscr":"\u{1D4CE}","Yscr":"\u{1D4B4}","yucy":"\u044E","YUcy":"\u042E","yuml":"\xFF","Yuml":"\u0178","zacute":"\u017A","Zacute":"\u0179","zcaron":"\u017E","Zcaron":"\u017D","zcy":"\u0437","Zcy":"\u0417","zdot":"\u017C","Zdot":"\u017B","zeetrf":"\u2128","ZeroWidthSpace":"\u200B","zeta":"\u03B6","Zeta":"\u0396","zfr":"\u{1D537}","Zfr":"\u2128","zhcy":"\u0436","ZHcy":"\u0416","zigrarr":"\u21DD","zopf":"\u{1D56B}","Zopf":"\u2124","zscr":"\u{1D4CF}","Zscr":"\u{1D4B5}","zwj":"\u200D","zwnj":"\u200C"};var x={"aacute":"\xE1","Aacute":"\xC1","acirc":"\xE2","Acirc":"\xC2","acute":"\xB4","aelig":"\xE6","AElig":"\xC6","agrave":"\xE0","Agrave":"\xC0","amp":"&","AMP":"&","aring":"\xE5","Aring":"\xC5","atilde":"\xE3","Atilde":"\xC3","auml":"\xE4","Auml":"\xC4","brvbar":"\xA6","ccedil":"\xE7","Ccedil":"\xC7","cedil":"\xB8","cent":"\xA2","copy":"\xA9","COPY":"\xA9","curren":"\xA4","deg":"\xB0","divide":"\xF7","eacute":"\xE9","Eacute":"\xC9","ecirc":"\xEA","Ecirc":"\xCA","egrave":"\xE8","Egrave":"\xC8","eth":"\xF0","ETH":"\xD0","euml":"\xEB","Euml":"\xCB","frac12":"\xBD","frac14":"\xBC","frac34":"\xBE","gt":">","GT":">","iacute":"\xED","Iacute":"\xCD","icirc":"\xEE","Icirc":"\xCE","iexcl":"\xA1","igrave":"\xEC","Igrave":"\xCC","iquest":"\xBF","iuml":"\xEF","Iuml":"\xCF","laquo":"\xAB","lt":"<","LT":"<","macr":"\xAF","micro":"\xB5","middot":"\xB7","nbsp":"\xA0","not":"\xAC","ntilde":"\xF1","Ntilde":"\xD1","oacute":"\xF3","Oacute":"\xD3","ocirc":"\xF4","Ocirc":"\xD4","ograve":"\xF2","Ograve":"\xD2","ordf":"\xAA","ordm":"\xBA","oslash":"\xF8","Oslash":"\xD8","otilde":"\xF5","Otilde":"\xD5","ouml":"\xF6","Ouml":"\xD6","para":"\xB6","plusmn":"\xB1","pound":"\xA3","quot":'"',"QUOT":'"',"raquo":"\xBB","reg":"\xAE","REG":"\xAE","sect":"\xA7","shy":"\xAD","sup1":"\xB9","sup2":"\xB2","sup3":"\xB3","szlig":"\xDF","thorn":"\xFE","THORN":"\xDE","times":"\xD7","uacute":"\xFA","Uacute":"\xDA","ucirc":"\xFB","Ucirc":"\xDB","ugrave":"\xF9","Ugrave":"\xD9","uml":"\xA8","uuml":"\xFC","Uuml":"\xDC","yacute":"\xFD","Yacute":"\xDD","yen":"\xA5","yuml":"\xFF"};var w={"0":"\uFFFD","128":"\u20AC","130":"\u201A","131":"\u0192","132":"\u201E","133":"\u2026","134":"\u2020","135":"\u2021","136":"\u02C6","137":"\u2030","138":"\u0160","139":"\u2039","140":"\u0152","142":"\u017D","145":"\u2018","146":"\u2019","147":"\u201C","148":"\u201D","149":"\u2022","150":"\u2013","151":"\u2014","152":"\u02DC","153":"\u2122","154":"\u0161","155":"\u203A","156":"\u0153","158":"\u017E","159":"\u0178"};var _=[1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65e3,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111];var C=String.fromCharCode;var A={};var P=A.hasOwnProperty;var L=function(te,J){return P.call(te,J)};var I=function(te,J){var oe=-1;var se=te.length;while(++oe=55296&&te<=57343||te>1114111){if(J){W("character reference outside the permissible Unicode range")}return"\uFFFD"}if(L(w,te)){if(J){W("disallowed character reference")}return w[te]}if(J&&I(_,te)){W("disallowed character reference")}if(te>65535){te-=65536;oe+=C(te>>>10&1023|55296);te=56320|te&1023}oe+=C(te);return oe};var z=function(te){return"&#x"+te.toString(16).toUpperCase()+";"};var U=function(te){return"&#"+te+";"};var W=function(te){throw Error("Parse error: "+te)};var H=function(te,J){J=N(J,H.options);var oe=J.strict;if(oe&&h.test(te)){W("forbidden code point")}var se=J.encodeEverything;var re=J.useNamedReferences;var ce=J.allowUnsafeSymbols;var ue=J.decimal?U:z;var xe=function(be){return ue(be.charCodeAt(0))};if(se){te=te.replace(o,function(be){if(re&&L(l,be)){return"&"+l[be]+";"}return xe(be)});if(re){te=te.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒").replace(/fj/g,"fj")}if(re){te=te.replace(s,function(be){return"&"+l[be]+";"})}}else if(re){if(!ce){te=te.replace(u,function(be){return"&"+l[be]+";"})}te=te.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒");te=te.replace(s,function(be){return"&"+l[be]+";"})}else if(!ce){te=te.replace(u,xe)}return te.replace(i,function(be){var Ie=be.charCodeAt(0);var he=be.charCodeAt(1);var ve=(Ie-55296)*1024+he-56320+65536;return ue(ve)}).replace(a,xe)};H.options={"allowUnsafeSymbols":false,"encodeEverything":false,"strict":false,"useNamedReferences":false,"decimal":false};var $=function(te,J){J=N(J,$.options);var oe=J.strict;if(oe&&f.test(te)){W("malformed character reference")}return te.replace(m,function(se,re,ce,ue,xe,be,Ie,he,ve){var ge;var Ve;var Le;var $e;var Ee;var tt;if(re){Ee=re;return g[Ee]}if(ce){Ee=ce;tt=ue;if(tt&&J.isAttributeValue){if(oe&&tt=="="){W("`&` did not start a character reference")}return se}else{if(oe){W("named character reference was not terminated by a semicolon")}return x[Ee]+(tt||"")}}if(xe){Le=xe;Ve=be;if(oe&&!Ve){W("character reference was not terminated by a semicolon")}ge=parseInt(Le,10);return O(ge,oe)}if(Ie){$e=Ie;Ve=he;if(oe&&!Ve){W("character reference was not terminated by a semicolon")}ge=parseInt($e,16);return O(ge,oe)}if(oe){W("named character reference was not terminated by a semicolon")}return se})};$.options={"isAttributeValue":false,"strict":false};var K=function(te){return te.replace(u,function(J){return d[J]})};var X={"version":"1.2.0","encode":H,"decode":$,"escape":K,"unescape":$};if(typeof define=="function"&&typeof define.amd=="object"&&define.amd){define(function(){return X})}else if(t&&!t.nodeType){if(n){n.exports=X}else{for(var j in X){L(X,j)&&(t[j]=X[j])}}}else{e.he=X}})(Wpe)});var NX=_r(V6e=>{"use strict";Object.defineProperty(V6e,"__esModule",{value:true});var LMt=Ype();var U6e=class{constructor(t=null,n){this.parentNode=t;this.childNodes=[];Object.defineProperty(this,"range",{enumerable:false,writable:true,configurable:true,value:n!==null&&n!==void 0?n:[-1,-1]})}remove(){if(this.parentNode){const t=this.parentNode.childNodes;this.parentNode.childNodes=t.filter(n=>{return this!==n});this.parentNode=null}return this}get innerText(){return this.rawText}get textContent(){return(0,LMt.decode)(this.rawText)}set textContent(t){this.rawText=(0,LMt.encode)(t)}};V6e.default=U6e});var Tz=_r(G6e=>{"use strict";Object.defineProperty(G6e,"__esModule",{value:true});var $6e;(function(e){e[e["ELEMENT_NODE"]=1]="ELEMENT_NODE";e[e["TEXT_NODE"]=3]="TEXT_NODE";e[e["COMMENT_NODE"]=8]="COMMENT_NODE"})($6e||($6e={}));G6e.default=$6e});var W6e=_r(OX=>{"use strict";var DMt=OX&&OX.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(OX,"__esModule",{value:true});var BSr=DMt(NX());var zSr=DMt(Tz());var H6e=class e extends BSr.default{clone(){return new e(this.rawText,null,void 0,this.rawTagName)}constructor(t,n=null,r,i="!--"){super(n,r);this.rawText=t;this.rawTagName=i;this.nodeType=zSr.default.COMMENT_NODE}get text(){return this.rawText}toString(){return``}};OX.default=H6e});var BX=_r(Ed=>{"use strict";Object.defineProperty(Ed,"__esModule",{value:true});Ed.Doctype=Ed.CDATA=Ed.Tag=Ed.Style=Ed.Script=Ed.Comment=Ed.Directive=Ed.Text=Ed.Root=Ed.isTag=Ed.ElementType=void 0;var g1;(function(e){e["Root"]="root";e["Text"]="text";e["Directive"]="directive";e["Comment"]="comment";e["Script"]="script";e["Style"]="style";e["Tag"]="tag";e["CDATA"]="cdata";e["Doctype"]="doctype"})(g1=Ed.ElementType||(Ed.ElementType={}));function USr(e){return e.type===g1.Tag||e.type===g1.Script||e.type===g1.Style}Ed.isTag=USr;Ed.Root=g1.Root;Ed.Text=g1.Text;Ed.Directive=g1.Directive;Ed.Comment=g1.Comment;Ed.Script=g1.Script;Ed.Style=g1.Style;Ed.Tag=g1.Tag;Ed.CDATA=g1.CDATA;Ed.Doctype=g1.Doctype});var j6e=_r(el=>{"use strict";var KI=el&&el.__extends||function(){var e=function(t,n){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)if(Object.prototype.hasOwnProperty.call(i,o))r[o]=i[o]};return e(t,n)};return function(t,n){if(typeof n!=="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();var zX=el&&el.__assign||function(){zX=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0?this.children[this.children.length-1]:null},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"childNodes",{get:function(){return this.children},set:function(n){this.children=n},enumerable:false,configurable:true});return t}(q6e);el.NodeWithChildren=Xpe;var BMt=function(e){KI(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;n.type=zb.ElementType.CDATA;return n}Object.defineProperty(t.prototype,"nodeType",{get:function(){return 4},enumerable:false,configurable:true});return t}(Xpe);el.CDATA=BMt;var zMt=function(e){KI(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;n.type=zb.ElementType.Root;return n}Object.defineProperty(t.prototype,"nodeType",{get:function(){return 9},enumerable:false,configurable:true});return t}(Xpe);el.Document=zMt;var UMt=function(e){KI(t,e);function t(n,r,i,o){if(i===void 0){i=[]}if(o===void 0){o=n==="script"?zb.ElementType.Script:n==="style"?zb.ElementType.Style:zb.ElementType.Tag}var a=e.call(this,i)||this;a.name=n;a.attribs=r;a.type=o;return a}Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"tagName",{get:function(){return this.name},set:function(n){this.name=n},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"attributes",{get:function(){var n=this;return Object.keys(this.attribs).map(function(r){var i,o;return{name:r,value:n.attribs[r],namespace:(i=n["x-attribsNamespace"])===null||i===void 0?void 0:i[r],prefix:(o=n["x-attribsPrefix"])===null||o===void 0?void 0:o[r]}})},enumerable:false,configurable:true});return t}(Xpe);el.Element=UMt;function VMt(e){return(0,zb.isTag)(e)}el.isTag=VMt;function $Mt(e){return e.type===zb.ElementType.CDATA}el.isCDATA=$Mt;function GMt(e){return e.type===zb.ElementType.Text}el.isText=GMt;function HMt(e){return e.type===zb.ElementType.Comment}el.isComment=HMt;function WMt(e){return e.type===zb.ElementType.Directive}el.isDirective=WMt;function YMt(e){return e.type===zb.ElementType.Root}el.isDocument=YMt;function VSr(e){return Object.prototype.hasOwnProperty.call(e,"children")}el.hasChildren=VSr;function X6e(e,t){if(t===void 0){t=false}var n;if(GMt(e)){n=new FMt(e.data)}else if(HMt(e)){n=new NMt(e.data)}else if(VMt(e)){var r=t?Y6e(e.children):[];var i=new UMt(e.name,zX({},e.attribs),r);r.forEach(function(l){return l.parent=i});if(e.namespace!=null){i.namespace=e.namespace}if(e["x-attribsNamespace"]){i["x-attribsNamespace"]=zX({},e["x-attribsNamespace"])}if(e["x-attribsPrefix"]){i["x-attribsPrefix"]=zX({},e["x-attribsPrefix"])}n=i}else if($Mt(e)){var r=t?Y6e(e.children):[];var o=new BMt(r);r.forEach(function(u){return u.parent=o});n=o}else if(YMt(e)){var r=t?Y6e(e.children):[];var a=new zMt(r);r.forEach(function(u){return u.parent=a});if(e["x-mode"]){a["x-mode"]=e["x-mode"]}n=a}else if(WMt(e)){var s=new OMt(e.name,e.data);if(e["x-name"]!=null){s["x-name"]=e["x-name"];s["x-publicId"]=e["x-publicId"];s["x-systemId"]=e["x-systemId"]}n=s}else{throw new Error("Not implemented yet: ".concat(e.type))}n.startIndex=e.startIndex;n.endIndex=e.endIndex;if(e.sourceCodeLocation!=null){n.sourceCodeLocation=e.sourceCodeLocation}return n}el.cloneNode=X6e;function Y6e(e){var t=e.map(function(r){return X6e(r,true)});for(var n=1;n{"use strict";var $Sr=hE&&hE.__createBinding||(Object.create?function(e,t,n,r){if(r===void 0)r=n;var i=Object.getOwnPropertyDescriptor(t,n);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,r,i)}:function(e,t,n,r){if(r===void 0)r=n;e[r]=t[n]});var GSr=hE&&hE.__exportStar||function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))$Sr(t,e,n)};Object.defineProperty(hE,"__esModule",{value:true});hE.DomHandler=void 0;var K6e=BX();var ZI=j6e();GSr(j6e(),hE);var qMt={withStartIndices:false,withEndIndices:false,xmlMode:false};var XMt=function(){function e(t,n,r){this.dom=[];this.root=new ZI.Document(this.dom);this.done=false;this.tagStack=[this.root];this.lastNode=null;this.parser=null;if(typeof n==="function"){r=n;n=qMt}if(typeof t==="object"){n=t;t=void 0}this.callback=t!==null&&t!==void 0?t:null;this.options=n!==null&&n!==void 0?n:qMt;this.elementCB=r!==null&&r!==void 0?r:null}e.prototype.onparserinit=function(t){this.parser=t};e.prototype.onreset=function(){this.dom=[];this.root=new ZI.Document(this.dom);this.done=false;this.tagStack=[this.root];this.lastNode=null;this.parser=null};e.prototype.onend=function(){if(this.done)return;this.done=true;this.parser=null;this.handleCallback(null)};e.prototype.onerror=function(t){this.handleCallback(t)};e.prototype.onclosetag=function(){this.lastNode=null;var t=this.tagStack.pop();if(this.options.withEndIndices){t.endIndex=this.parser.endIndex}if(this.elementCB)this.elementCB(t)};e.prototype.onopentag=function(t,n){var r=this.options.xmlMode?K6e.ElementType.Tag:void 0;var i=new ZI.Element(t,n,void 0,r);this.addNode(i);this.tagStack.push(i)};e.prototype.ontext=function(t){var n=this.lastNode;if(n&&n.type===K6e.ElementType.Text){n.data+=t;if(this.options.withEndIndices){n.endIndex=this.parser.endIndex}}else{var r=new ZI.Text(t);this.addNode(r);this.lastNode=r}};e.prototype.oncomment=function(t){if(this.lastNode&&this.lastNode.type===K6e.ElementType.Comment){this.lastNode.data+=t;return}var n=new ZI.Comment(t);this.addNode(n);this.lastNode=n};e.prototype.oncommentend=function(){this.lastNode=null};e.prototype.oncdatastart=function(){var t=new ZI.Text("");var n=new ZI.CDATA([t]);this.addNode(n);t.parent=n;this.lastNode=t};e.prototype.oncdataend=function(){this.lastNode=null};e.prototype.onprocessinginstruction=function(t,n){var r=new ZI.ProcessingInstruction(t,n);this.addNode(r)};e.prototype.handleCallback=function(t){if(typeof this.callback==="function"){this.callback(t,this.dom)}else if(t){throw t}};e.prototype.addNode=function(t){var n=this.tagStack[this.tagStack.length-1];var r=n.children[n.children.length-1];if(this.options.withStartIndices){t.startIndex=this.parser.startIndex}if(this.options.withEndIndices){t.endIndex=this.parser.endIndex}n.children.push(t);if(r){t.prev=r;r.next=t}t.parent=n;this.lastNode=null};return e}();hE.DomHandler=XMt;hE.default=XMt});var jMt=_r(Z6e=>{"use strict";Object.defineProperty(Z6e,"__esModule",{value:true});Z6e.default=new Uint16Array('\u1D41<\xD5\u0131\u028A\u049D\u057B\u05D0\u0675\u06DE\u07A2\u07D6\u080F\u0A4A\u0A91\u0DA1\u0E6D\u0F09\u0F26\u10CA\u1228\u12E1\u1415\u149D\u14C3\u14DF\u1525\0\0\0\0\0\0\u156B\u16CD\u198D\u1C12\u1DDD\u1F7E\u2060\u21B0\u228D\u23C0\u23FB\u2442\u2824\u2912\u2D08\u2E48\u2FCE\u3016\u32BA\u3639\u37AC\u38FE\u3A28\u3A71\u3AE0\u3B2E\u0800EMabcfglmnoprstu\\bfms\x7F\x84\x8B\x90\x95\x98\xA6\xB3\xB9\xC8\xCFlig\u803B\xC6\u40C6P\u803B&\u4026cute\u803B\xC1\u40C1reve;\u4102\u0100iyx}rc\u803B\xC2\u40C2;\u4410r;\uC000\u{1D504}rave\u803B\xC0\u40C0pha;\u4391acr;\u4100d;\u6A53\u0100gp\x9D\xA1on;\u4104f;\uC000\u{1D538}plyFunction;\u6061ing\u803B\xC5\u40C5\u0100cs\xBE\xC3r;\uC000\u{1D49C}ign;\u6254ilde\u803B\xC3\u40C3ml\u803B\xC4\u40C4\u0400aceforsu\xE5\xFB\xFE\u0117\u011C\u0122\u0127\u012A\u0100cr\xEA\xF2kslash;\u6216\u0176\xF6\xF8;\u6AE7ed;\u6306y;\u4411\u0180crt\u0105\u010B\u0114ause;\u6235noullis;\u612Ca;\u4392r;\uC000\u{1D505}pf;\uC000\u{1D539}eve;\u42D8c\xF2\u0113mpeq;\u624E\u0700HOacdefhilorsu\u014D\u0151\u0156\u0180\u019E\u01A2\u01B5\u01B7\u01BA\u01DC\u0215\u0273\u0278\u027Ecy;\u4427PY\u803B\xA9\u40A9\u0180cpy\u015D\u0162\u017Aute;\u4106\u0100;i\u0167\u0168\u62D2talDifferentialD;\u6145leys;\u612D\u0200aeio\u0189\u018E\u0194\u0198ron;\u410Cdil\u803B\xC7\u40C7rc;\u4108nint;\u6230ot;\u410A\u0100dn\u01A7\u01ADilla;\u40B8terDot;\u40B7\xF2\u017Fi;\u43A7rcle\u0200DMPT\u01C7\u01CB\u01D1\u01D6ot;\u6299inus;\u6296lus;\u6295imes;\u6297o\u0100cs\u01E2\u01F8kwiseContourIntegral;\u6232eCurly\u0100DQ\u0203\u020FoubleQuote;\u601Duote;\u6019\u0200lnpu\u021E\u0228\u0247\u0255on\u0100;e\u0225\u0226\u6237;\u6A74\u0180git\u022F\u0236\u023Aruent;\u6261nt;\u622FourIntegral;\u622E\u0100fr\u024C\u024E;\u6102oduct;\u6210nterClockwiseContourIntegral;\u6233oss;\u6A2Fcr;\uC000\u{1D49E}p\u0100;C\u0284\u0285\u62D3ap;\u624D\u0580DJSZacefios\u02A0\u02AC\u02B0\u02B4\u02B8\u02CB\u02D7\u02E1\u02E6\u0333\u048D\u0100;o\u0179\u02A5trahd;\u6911cy;\u4402cy;\u4405cy;\u440F\u0180grs\u02BF\u02C4\u02C7ger;\u6021r;\u61A1hv;\u6AE4\u0100ay\u02D0\u02D5ron;\u410E;\u4414l\u0100;t\u02DD\u02DE\u6207a;\u4394r;\uC000\u{1D507}\u0100af\u02EB\u0327\u0100cm\u02F0\u0322ritical\u0200ADGT\u0300\u0306\u0316\u031Ccute;\u40B4o\u0174\u030B\u030D;\u42D9bleAcute;\u42DDrave;\u4060ilde;\u42DCond;\u62C4ferentialD;\u6146\u0470\u033D\0\0\0\u0342\u0354\0\u0405f;\uC000\u{1D53B}\u0180;DE\u0348\u0349\u034D\u40A8ot;\u60DCqual;\u6250ble\u0300CDLRUV\u0363\u0372\u0382\u03CF\u03E2\u03F8ontourIntegra\xEC\u0239o\u0274\u0379\0\0\u037B\xBB\u0349nArrow;\u61D3\u0100eo\u0387\u03A4ft\u0180ART\u0390\u0396\u03A1rrow;\u61D0ightArrow;\u61D4e\xE5\u02CAng\u0100LR\u03AB\u03C4eft\u0100AR\u03B3\u03B9rrow;\u67F8ightArrow;\u67FAightArrow;\u67F9ight\u0100AT\u03D8\u03DErrow;\u61D2ee;\u62A8p\u0241\u03E9\0\0\u03EFrrow;\u61D1ownArrow;\u61D5erticalBar;\u6225n\u0300ABLRTa\u0412\u042A\u0430\u045E\u047F\u037Crrow\u0180;BU\u041D\u041E\u0422\u6193ar;\u6913pArrow;\u61F5reve;\u4311eft\u02D2\u043A\0\u0446\0\u0450ightVector;\u6950eeVector;\u695Eector\u0100;B\u0459\u045A\u61BDar;\u6956ight\u01D4\u0467\0\u0471eeVector;\u695Fector\u0100;B\u047A\u047B\u61C1ar;\u6957ee\u0100;A\u0486\u0487\u62A4rrow;\u61A7\u0100ct\u0492\u0497r;\uC000\u{1D49F}rok;\u4110\u0800NTacdfglmopqstux\u04BD\u04C0\u04C4\u04CB\u04DE\u04E2\u04E7\u04EE\u04F5\u0521\u052F\u0536\u0552\u055D\u0560\u0565G;\u414AH\u803B\xD0\u40D0cute\u803B\xC9\u40C9\u0180aiy\u04D2\u04D7\u04DCron;\u411Arc\u803B\xCA\u40CA;\u442Dot;\u4116r;\uC000\u{1D508}rave\u803B\xC8\u40C8ement;\u6208\u0100ap\u04FA\u04FEcr;\u4112ty\u0253\u0506\0\0\u0512mallSquare;\u65FBerySmallSquare;\u65AB\u0100gp\u0526\u052Aon;\u4118f;\uC000\u{1D53C}silon;\u4395u\u0100ai\u053C\u0549l\u0100;T\u0542\u0543\u6A75ilde;\u6242librium;\u61CC\u0100ci\u0557\u055Ar;\u6130m;\u6A73a;\u4397ml\u803B\xCB\u40CB\u0100ip\u056A\u056Fsts;\u6203onentialE;\u6147\u0280cfios\u0585\u0588\u058D\u05B2\u05CCy;\u4424r;\uC000\u{1D509}lled\u0253\u0597\0\0\u05A3mallSquare;\u65FCerySmallSquare;\u65AA\u0370\u05BA\0\u05BF\0\0\u05C4f;\uC000\u{1D53D}All;\u6200riertrf;\u6131c\xF2\u05CB\u0600JTabcdfgorst\u05E8\u05EC\u05EF\u05FA\u0600\u0612\u0616\u061B\u061D\u0623\u066C\u0672cy;\u4403\u803B>\u403Emma\u0100;d\u05F7\u05F8\u4393;\u43DCreve;\u411E\u0180eiy\u0607\u060C\u0610dil;\u4122rc;\u411C;\u4413ot;\u4120r;\uC000\u{1D50A};\u62D9pf;\uC000\u{1D53E}eater\u0300EFGLST\u0635\u0644\u064E\u0656\u065B\u0666qual\u0100;L\u063E\u063F\u6265ess;\u62DBullEqual;\u6267reater;\u6AA2ess;\u6277lantEqual;\u6A7Eilde;\u6273cr;\uC000\u{1D4A2};\u626B\u0400Aacfiosu\u0685\u068B\u0696\u069B\u069E\u06AA\u06BE\u06CARDcy;\u442A\u0100ct\u0690\u0694ek;\u42C7;\u405Eirc;\u4124r;\u610ClbertSpace;\u610B\u01F0\u06AF\0\u06B2f;\u610DizontalLine;\u6500\u0100ct\u06C3\u06C5\xF2\u06A9rok;\u4126mp\u0144\u06D0\u06D8ownHum\xF0\u012Fqual;\u624F\u0700EJOacdfgmnostu\u06FA\u06FE\u0703\u0707\u070E\u071A\u071E\u0721\u0728\u0744\u0778\u078B\u078F\u0795cy;\u4415lig;\u4132cy;\u4401cute\u803B\xCD\u40CD\u0100iy\u0713\u0718rc\u803B\xCE\u40CE;\u4418ot;\u4130r;\u6111rave\u803B\xCC\u40CC\u0180;ap\u0720\u072F\u073F\u0100cg\u0734\u0737r;\u412AinaryI;\u6148lie\xF3\u03DD\u01F4\u0749\0\u0762\u0100;e\u074D\u074E\u622C\u0100gr\u0753\u0758ral;\u622Bsection;\u62C2isible\u0100CT\u076C\u0772omma;\u6063imes;\u6062\u0180gpt\u077F\u0783\u0788on;\u412Ef;\uC000\u{1D540}a;\u4399cr;\u6110ilde;\u4128\u01EB\u079A\0\u079Ecy;\u4406l\u803B\xCF\u40CF\u0280cfosu\u07AC\u07B7\u07BC\u07C2\u07D0\u0100iy\u07B1\u07B5rc;\u4134;\u4419r;\uC000\u{1D50D}pf;\uC000\u{1D541}\u01E3\u07C7\0\u07CCr;\uC000\u{1D4A5}rcy;\u4408kcy;\u4404\u0380HJacfos\u07E4\u07E8\u07EC\u07F1\u07FD\u0802\u0808cy;\u4425cy;\u440Cppa;\u439A\u0100ey\u07F6\u07FBdil;\u4136;\u441Ar;\uC000\u{1D50E}pf;\uC000\u{1D542}cr;\uC000\u{1D4A6}\u0580JTaceflmost\u0825\u0829\u082C\u0850\u0863\u09B3\u09B8\u09C7\u09CD\u0A37\u0A47cy;\u4409\u803B<\u403C\u0280cmnpr\u0837\u083C\u0841\u0844\u084Dute;\u4139bda;\u439Bg;\u67EAlacetrf;\u6112r;\u619E\u0180aey\u0857\u085C\u0861ron;\u413Ddil;\u413B;\u441B\u0100fs\u0868\u0970t\u0500ACDFRTUVar\u087E\u08A9\u08B1\u08E0\u08E6\u08FC\u092F\u095B\u0390\u096A\u0100nr\u0883\u088FgleBracket;\u67E8row\u0180;BR\u0899\u089A\u089E\u6190ar;\u61E4ightArrow;\u61C6eiling;\u6308o\u01F5\u08B7\0\u08C3bleBracket;\u67E6n\u01D4\u08C8\0\u08D2eeVector;\u6961ector\u0100;B\u08DB\u08DC\u61C3ar;\u6959loor;\u630Aight\u0100AV\u08EF\u08F5rrow;\u6194ector;\u694E\u0100er\u0901\u0917e\u0180;AV\u0909\u090A\u0910\u62A3rrow;\u61A4ector;\u695Aiangle\u0180;BE\u0924\u0925\u0929\u62B2ar;\u69CFqual;\u62B4p\u0180DTV\u0937\u0942\u094CownVector;\u6951eeVector;\u6960ector\u0100;B\u0956\u0957\u61BFar;\u6958ector\u0100;B\u0965\u0966\u61BCar;\u6952ight\xE1\u039Cs\u0300EFGLST\u097E\u098B\u0995\u099D\u09A2\u09ADqualGreater;\u62DAullEqual;\u6266reater;\u6276ess;\u6AA1lantEqual;\u6A7Dilde;\u6272r;\uC000\u{1D50F}\u0100;e\u09BD\u09BE\u62D8ftarrow;\u61DAidot;\u413F\u0180npw\u09D4\u0A16\u0A1Bg\u0200LRlr\u09DE\u09F7\u0A02\u0A10eft\u0100AR\u09E6\u09ECrrow;\u67F5ightArrow;\u67F7ightArrow;\u67F6eft\u0100ar\u03B3\u0A0Aight\xE1\u03BFight\xE1\u03CAf;\uC000\u{1D543}er\u0100LR\u0A22\u0A2CeftArrow;\u6199ightArrow;\u6198\u0180cht\u0A3E\u0A40\u0A42\xF2\u084C;\u61B0rok;\u4141;\u626A\u0400acefiosu\u0A5A\u0A5D\u0A60\u0A77\u0A7C\u0A85\u0A8B\u0A8Ep;\u6905y;\u441C\u0100dl\u0A65\u0A6FiumSpace;\u605Flintrf;\u6133r;\uC000\u{1D510}nusPlus;\u6213pf;\uC000\u{1D544}c\xF2\u0A76;\u439C\u0480Jacefostu\u0AA3\u0AA7\u0AAD\u0AC0\u0B14\u0B19\u0D91\u0D97\u0D9Ecy;\u440Acute;\u4143\u0180aey\u0AB4\u0AB9\u0ABEron;\u4147dil;\u4145;\u441D\u0180gsw\u0AC7\u0AF0\u0B0Eative\u0180MTV\u0AD3\u0ADF\u0AE8ediumSpace;\u600Bhi\u0100cn\u0AE6\u0AD8\xEB\u0AD9eryThi\xEE\u0AD9ted\u0100GL\u0AF8\u0B06reaterGreate\xF2\u0673essLes\xF3\u0A48Line;\u400Ar;\uC000\u{1D511}\u0200Bnpt\u0B22\u0B28\u0B37\u0B3Areak;\u6060BreakingSpace;\u40A0f;\u6115\u0680;CDEGHLNPRSTV\u0B55\u0B56\u0B6A\u0B7C\u0BA1\u0BEB\u0C04\u0C5E\u0C84\u0CA6\u0CD8\u0D61\u0D85\u6AEC\u0100ou\u0B5B\u0B64ngruent;\u6262pCap;\u626DoubleVerticalBar;\u6226\u0180lqx\u0B83\u0B8A\u0B9Bement;\u6209ual\u0100;T\u0B92\u0B93\u6260ilde;\uC000\u2242\u0338ists;\u6204reater\u0380;EFGLST\u0BB6\u0BB7\u0BBD\u0BC9\u0BD3\u0BD8\u0BE5\u626Fqual;\u6271ullEqual;\uC000\u2267\u0338reater;\uC000\u226B\u0338ess;\u6279lantEqual;\uC000\u2A7E\u0338ilde;\u6275ump\u0144\u0BF2\u0BFDownHump;\uC000\u224E\u0338qual;\uC000\u224F\u0338e\u0100fs\u0C0A\u0C27tTriangle\u0180;BE\u0C1A\u0C1B\u0C21\u62EAar;\uC000\u29CF\u0338qual;\u62ECs\u0300;EGLST\u0C35\u0C36\u0C3C\u0C44\u0C4B\u0C58\u626Equal;\u6270reater;\u6278ess;\uC000\u226A\u0338lantEqual;\uC000\u2A7D\u0338ilde;\u6274ested\u0100GL\u0C68\u0C79reaterGreater;\uC000\u2AA2\u0338essLess;\uC000\u2AA1\u0338recedes\u0180;ES\u0C92\u0C93\u0C9B\u6280qual;\uC000\u2AAF\u0338lantEqual;\u62E0\u0100ei\u0CAB\u0CB9verseElement;\u620CghtTriangle\u0180;BE\u0CCB\u0CCC\u0CD2\u62EBar;\uC000\u29D0\u0338qual;\u62ED\u0100qu\u0CDD\u0D0CuareSu\u0100bp\u0CE8\u0CF9set\u0100;E\u0CF0\u0CF3\uC000\u228F\u0338qual;\u62E2erset\u0100;E\u0D03\u0D06\uC000\u2290\u0338qual;\u62E3\u0180bcp\u0D13\u0D24\u0D4Eset\u0100;E\u0D1B\u0D1E\uC000\u2282\u20D2qual;\u6288ceeds\u0200;EST\u0D32\u0D33\u0D3B\u0D46\u6281qual;\uC000\u2AB0\u0338lantEqual;\u62E1ilde;\uC000\u227F\u0338erset\u0100;E\u0D58\u0D5B\uC000\u2283\u20D2qual;\u6289ilde\u0200;EFT\u0D6E\u0D6F\u0D75\u0D7F\u6241qual;\u6244ullEqual;\u6247ilde;\u6249erticalBar;\u6224cr;\uC000\u{1D4A9}ilde\u803B\xD1\u40D1;\u439D\u0700Eacdfgmoprstuv\u0DBD\u0DC2\u0DC9\u0DD5\u0DDB\u0DE0\u0DE7\u0DFC\u0E02\u0E20\u0E22\u0E32\u0E3F\u0E44lig;\u4152cute\u803B\xD3\u40D3\u0100iy\u0DCE\u0DD3rc\u803B\xD4\u40D4;\u441Eblac;\u4150r;\uC000\u{1D512}rave\u803B\xD2\u40D2\u0180aei\u0DEE\u0DF2\u0DF6cr;\u414Cga;\u43A9cron;\u439Fpf;\uC000\u{1D546}enCurly\u0100DQ\u0E0E\u0E1AoubleQuote;\u601Cuote;\u6018;\u6A54\u0100cl\u0E27\u0E2Cr;\uC000\u{1D4AA}ash\u803B\xD8\u40D8i\u016C\u0E37\u0E3Cde\u803B\xD5\u40D5es;\u6A37ml\u803B\xD6\u40D6er\u0100BP\u0E4B\u0E60\u0100ar\u0E50\u0E53r;\u603Eac\u0100ek\u0E5A\u0E5C;\u63DEet;\u63B4arenthesis;\u63DC\u0480acfhilors\u0E7F\u0E87\u0E8A\u0E8F\u0E92\u0E94\u0E9D\u0EB0\u0EFCrtialD;\u6202y;\u441Fr;\uC000\u{1D513}i;\u43A6;\u43A0usMinus;\u40B1\u0100ip\u0EA2\u0EADncareplan\xE5\u069Df;\u6119\u0200;eio\u0EB9\u0EBA\u0EE0\u0EE4\u6ABBcedes\u0200;EST\u0EC8\u0EC9\u0ECF\u0EDA\u627Aqual;\u6AAFlantEqual;\u627Cilde;\u627Eme;\u6033\u0100dp\u0EE9\u0EEEuct;\u620Fortion\u0100;a\u0225\u0EF9l;\u621D\u0100ci\u0F01\u0F06r;\uC000\u{1D4AB};\u43A8\u0200Ufos\u0F11\u0F16\u0F1B\u0F1FOT\u803B"\u4022r;\uC000\u{1D514}pf;\u611Acr;\uC000\u{1D4AC}\u0600BEacefhiorsu\u0F3E\u0F43\u0F47\u0F60\u0F73\u0FA7\u0FAA\u0FAD\u1096\u10A9\u10B4\u10BEarr;\u6910G\u803B\xAE\u40AE\u0180cnr\u0F4E\u0F53\u0F56ute;\u4154g;\u67EBr\u0100;t\u0F5C\u0F5D\u61A0l;\u6916\u0180aey\u0F67\u0F6C\u0F71ron;\u4158dil;\u4156;\u4420\u0100;v\u0F78\u0F79\u611Cerse\u0100EU\u0F82\u0F99\u0100lq\u0F87\u0F8Eement;\u620Builibrium;\u61CBpEquilibrium;\u696Fr\xBB\u0F79o;\u43A1ght\u0400ACDFTUVa\u0FC1\u0FEB\u0FF3\u1022\u1028\u105B\u1087\u03D8\u0100nr\u0FC6\u0FD2gleBracket;\u67E9row\u0180;BL\u0FDC\u0FDD\u0FE1\u6192ar;\u61E5eftArrow;\u61C4eiling;\u6309o\u01F5\u0FF9\0\u1005bleBracket;\u67E7n\u01D4\u100A\0\u1014eeVector;\u695Dector\u0100;B\u101D\u101E\u61C2ar;\u6955loor;\u630B\u0100er\u102D\u1043e\u0180;AV\u1035\u1036\u103C\u62A2rrow;\u61A6ector;\u695Biangle\u0180;BE\u1050\u1051\u1055\u62B3ar;\u69D0qual;\u62B5p\u0180DTV\u1063\u106E\u1078ownVector;\u694FeeVector;\u695Cector\u0100;B\u1082\u1083\u61BEar;\u6954ector\u0100;B\u1091\u1092\u61C0ar;\u6953\u0100pu\u109B\u109Ef;\u611DndImplies;\u6970ightarrow;\u61DB\u0100ch\u10B9\u10BCr;\u611B;\u61B1leDelayed;\u69F4\u0680HOacfhimoqstu\u10E4\u10F1\u10F7\u10FD\u1119\u111E\u1151\u1156\u1161\u1167\u11B5\u11BB\u11BF\u0100Cc\u10E9\u10EEHcy;\u4429y;\u4428FTcy;\u442Ccute;\u415A\u0280;aeiy\u1108\u1109\u110E\u1113\u1117\u6ABCron;\u4160dil;\u415Erc;\u415C;\u4421r;\uC000\u{1D516}ort\u0200DLRU\u112A\u1134\u113E\u1149ownArrow\xBB\u041EeftArrow\xBB\u089AightArrow\xBB\u0FDDpArrow;\u6191gma;\u43A3allCircle;\u6218pf;\uC000\u{1D54A}\u0272\u116D\0\0\u1170t;\u621Aare\u0200;ISU\u117B\u117C\u1189\u11AF\u65A1ntersection;\u6293u\u0100bp\u118F\u119Eset\u0100;E\u1197\u1198\u628Fqual;\u6291erset\u0100;E\u11A8\u11A9\u6290qual;\u6292nion;\u6294cr;\uC000\u{1D4AE}ar;\u62C6\u0200bcmp\u11C8\u11DB\u1209\u120B\u0100;s\u11CD\u11CE\u62D0et\u0100;E\u11CD\u11D5qual;\u6286\u0100ch\u11E0\u1205eeds\u0200;EST\u11ED\u11EE\u11F4\u11FF\u627Bqual;\u6AB0lantEqual;\u627Dilde;\u627FTh\xE1\u0F8C;\u6211\u0180;es\u1212\u1213\u1223\u62D1rset\u0100;E\u121C\u121D\u6283qual;\u6287et\xBB\u1213\u0580HRSacfhiors\u123E\u1244\u1249\u1255\u125E\u1271\u1276\u129F\u12C2\u12C8\u12D1ORN\u803B\xDE\u40DEADE;\u6122\u0100Hc\u124E\u1252cy;\u440By;\u4426\u0100bu\u125A\u125C;\u4009;\u43A4\u0180aey\u1265\u126A\u126Fron;\u4164dil;\u4162;\u4422r;\uC000\u{1D517}\u0100ei\u127B\u1289\u01F2\u1280\0\u1287efore;\u6234a;\u4398\u0100cn\u128E\u1298kSpace;\uC000\u205F\u200ASpace;\u6009lde\u0200;EFT\u12AB\u12AC\u12B2\u12BC\u623Cqual;\u6243ullEqual;\u6245ilde;\u6248pf;\uC000\u{1D54B}ipleDot;\u60DB\u0100ct\u12D6\u12DBr;\uC000\u{1D4AF}rok;\u4166\u0AE1\u12F7\u130E\u131A\u1326\0\u132C\u1331\0\0\0\0\0\u1338\u133D\u1377\u1385\0\u13FF\u1404\u140A\u1410\u0100cr\u12FB\u1301ute\u803B\xDA\u40DAr\u0100;o\u1307\u1308\u619Fcir;\u6949r\u01E3\u1313\0\u1316y;\u440Eve;\u416C\u0100iy\u131E\u1323rc\u803B\xDB\u40DB;\u4423blac;\u4170r;\uC000\u{1D518}rave\u803B\xD9\u40D9acr;\u416A\u0100di\u1341\u1369er\u0100BP\u1348\u135D\u0100ar\u134D\u1350r;\u405Fac\u0100ek\u1357\u1359;\u63DFet;\u63B5arenthesis;\u63DDon\u0100;P\u1370\u1371\u62C3lus;\u628E\u0100gp\u137B\u137Fon;\u4172f;\uC000\u{1D54C}\u0400ADETadps\u1395\u13AE\u13B8\u13C4\u03E8\u13D2\u13D7\u13F3rrow\u0180;BD\u1150\u13A0\u13A4ar;\u6912ownArrow;\u61C5ownArrow;\u6195quilibrium;\u696Eee\u0100;A\u13CB\u13CC\u62A5rrow;\u61A5own\xE1\u03F3er\u0100LR\u13DE\u13E8eftArrow;\u6196ightArrow;\u6197i\u0100;l\u13F9\u13FA\u43D2on;\u43A5ing;\u416Ecr;\uC000\u{1D4B0}ilde;\u4168ml\u803B\xDC\u40DC\u0480Dbcdefosv\u1427\u142C\u1430\u1433\u143E\u1485\u148A\u1490\u1496ash;\u62ABar;\u6AEBy;\u4412ash\u0100;l\u143B\u143C\u62A9;\u6AE6\u0100er\u1443\u1445;\u62C1\u0180bty\u144C\u1450\u147Aar;\u6016\u0100;i\u144F\u1455cal\u0200BLST\u1461\u1465\u146A\u1474ar;\u6223ine;\u407Ceparator;\u6758ilde;\u6240ThinSpace;\u600Ar;\uC000\u{1D519}pf;\uC000\u{1D54D}cr;\uC000\u{1D4B1}dash;\u62AA\u0280cefos\u14A7\u14AC\u14B1\u14B6\u14BCirc;\u4174dge;\u62C0r;\uC000\u{1D51A}pf;\uC000\u{1D54E}cr;\uC000\u{1D4B2}\u0200fios\u14CB\u14D0\u14D2\u14D8r;\uC000\u{1D51B};\u439Epf;\uC000\u{1D54F}cr;\uC000\u{1D4B3}\u0480AIUacfosu\u14F1\u14F5\u14F9\u14FD\u1504\u150F\u1514\u151A\u1520cy;\u442Fcy;\u4407cy;\u442Ecute\u803B\xDD\u40DD\u0100iy\u1509\u150Drc;\u4176;\u442Br;\uC000\u{1D51C}pf;\uC000\u{1D550}cr;\uC000\u{1D4B4}ml;\u4178\u0400Hacdefos\u1535\u1539\u153F\u154B\u154F\u155D\u1560\u1564cy;\u4416cute;\u4179\u0100ay\u1544\u1549ron;\u417D;\u4417ot;\u417B\u01F2\u1554\0\u155BoWidt\xE8\u0AD9a;\u4396r;\u6128pf;\u6124cr;\uC000\u{1D4B5}\u0BE1\u1583\u158A\u1590\0\u15B0\u15B6\u15BF\0\0\0\0\u15C6\u15DB\u15EB\u165F\u166D\0\u1695\u169B\u16B2\u16B9\0\u16BEcute\u803B\xE1\u40E1reve;\u4103\u0300;Ediuy\u159C\u159D\u15A1\u15A3\u15A8\u15AD\u623E;\uC000\u223E\u0333;\u623Frc\u803B\xE2\u40E2te\u80BB\xB4\u0306;\u4430lig\u803B\xE6\u40E6\u0100;r\xB2\u15BA;\uC000\u{1D51E}rave\u803B\xE0\u40E0\u0100ep\u15CA\u15D6\u0100fp\u15CF\u15D4sym;\u6135\xE8\u15D3ha;\u43B1\u0100ap\u15DFc\u0100cl\u15E4\u15E7r;\u4101g;\u6A3F\u0264\u15F0\0\0\u160A\u0280;adsv\u15FA\u15FB\u15FF\u1601\u1607\u6227nd;\u6A55;\u6A5Clope;\u6A58;\u6A5A\u0380;elmrsz\u1618\u1619\u161B\u161E\u163F\u164F\u1659\u6220;\u69A4e\xBB\u1619sd\u0100;a\u1625\u1626\u6221\u0461\u1630\u1632\u1634\u1636\u1638\u163A\u163C\u163E;\u69A8;\u69A9;\u69AA;\u69AB;\u69AC;\u69AD;\u69AE;\u69AFt\u0100;v\u1645\u1646\u621Fb\u0100;d\u164C\u164D\u62BE;\u699D\u0100pt\u1654\u1657h;\u6222\xBB\xB9arr;\u637C\u0100gp\u1663\u1667on;\u4105f;\uC000\u{1D552}\u0380;Eaeiop\u12C1\u167B\u167D\u1682\u1684\u1687\u168A;\u6A70cir;\u6A6F;\u624Ad;\u624Bs;\u4027rox\u0100;e\u12C1\u1692\xF1\u1683ing\u803B\xE5\u40E5\u0180cty\u16A1\u16A6\u16A8r;\uC000\u{1D4B6};\u402Amp\u0100;e\u12C1\u16AF\xF1\u0288ilde\u803B\xE3\u40E3ml\u803B\xE4\u40E4\u0100ci\u16C2\u16C8onin\xF4\u0272nt;\u6A11\u0800Nabcdefiklnoprsu\u16ED\u16F1\u1730\u173C\u1743\u1748\u1778\u177D\u17E0\u17E6\u1839\u1850\u170D\u193D\u1948\u1970ot;\u6AED\u0100cr\u16F6\u171Ek\u0200ceps\u1700\u1705\u170D\u1713ong;\u624Cpsilon;\u43F6rime;\u6035im\u0100;e\u171A\u171B\u623Dq;\u62CD\u0176\u1722\u1726ee;\u62BDed\u0100;g\u172C\u172D\u6305e\xBB\u172Drk\u0100;t\u135C\u1737brk;\u63B6\u0100oy\u1701\u1741;\u4431quo;\u601E\u0280cmprt\u1753\u175B\u1761\u1764\u1768aus\u0100;e\u010A\u0109ptyv;\u69B0s\xE9\u170Cno\xF5\u0113\u0180ahw\u176F\u1771\u1773;\u43B2;\u6136een;\u626Cr;\uC000\u{1D51F}g\u0380costuvw\u178D\u179D\u17B3\u17C1\u17D5\u17DB\u17DE\u0180aiu\u1794\u1796\u179A\xF0\u0760rc;\u65EFp\xBB\u1371\u0180dpt\u17A4\u17A8\u17ADot;\u6A00lus;\u6A01imes;\u6A02\u0271\u17B9\0\0\u17BEcup;\u6A06ar;\u6605riangle\u0100du\u17CD\u17D2own;\u65BDp;\u65B3plus;\u6A04e\xE5\u1444\xE5\u14ADarow;\u690D\u0180ako\u17ED\u1826\u1835\u0100cn\u17F2\u1823k\u0180lst\u17FA\u05AB\u1802ozenge;\u69EBriangle\u0200;dlr\u1812\u1813\u1818\u181D\u65B4own;\u65BEeft;\u65C2ight;\u65B8k;\u6423\u01B1\u182B\0\u1833\u01B2\u182F\0\u1831;\u6592;\u65914;\u6593ck;\u6588\u0100eo\u183E\u184D\u0100;q\u1843\u1846\uC000=\u20E5uiv;\uC000\u2261\u20E5t;\u6310\u0200ptwx\u1859\u185E\u1867\u186Cf;\uC000\u{1D553}\u0100;t\u13CB\u1863om\xBB\u13CCtie;\u62C8\u0600DHUVbdhmptuv\u1885\u1896\u18AA\u18BB\u18D7\u18DB\u18EC\u18FF\u1905\u190A\u1910\u1921\u0200LRlr\u188E\u1890\u1892\u1894;\u6557;\u6554;\u6556;\u6553\u0280;DUdu\u18A1\u18A2\u18A4\u18A6\u18A8\u6550;\u6566;\u6569;\u6564;\u6567\u0200LRlr\u18B3\u18B5\u18B7\u18B9;\u655D;\u655A;\u655C;\u6559\u0380;HLRhlr\u18CA\u18CB\u18CD\u18CF\u18D1\u18D3\u18D5\u6551;\u656C;\u6563;\u6560;\u656B;\u6562;\u655Fox;\u69C9\u0200LRlr\u18E4\u18E6\u18E8\u18EA;\u6555;\u6552;\u6510;\u650C\u0280;DUdu\u06BD\u18F7\u18F9\u18FB\u18FD;\u6565;\u6568;\u652C;\u6534inus;\u629Flus;\u629Eimes;\u62A0\u0200LRlr\u1919\u191B\u191D\u191F;\u655B;\u6558;\u6518;\u6514\u0380;HLRhlr\u1930\u1931\u1933\u1935\u1937\u1939\u193B\u6502;\u656A;\u6561;\u655E;\u653C;\u6524;\u651C\u0100ev\u0123\u1942bar\u803B\xA6\u40A6\u0200ceio\u1951\u1956\u195A\u1960r;\uC000\u{1D4B7}mi;\u604Fm\u0100;e\u171A\u171Cl\u0180;bh\u1968\u1969\u196B\u405C;\u69C5sub;\u67C8\u016C\u1974\u197El\u0100;e\u1979\u197A\u6022t\xBB\u197Ap\u0180;Ee\u012F\u1985\u1987;\u6AAE\u0100;q\u06DC\u06DB\u0CE1\u19A7\0\u19E8\u1A11\u1A15\u1A32\0\u1A37\u1A50\0\0\u1AB4\0\0\u1AC1\0\0\u1B21\u1B2E\u1B4D\u1B52\0\u1BFD\0\u1C0C\u0180cpr\u19AD\u19B2\u19DDute;\u4107\u0300;abcds\u19BF\u19C0\u19C4\u19CA\u19D5\u19D9\u6229nd;\u6A44rcup;\u6A49\u0100au\u19CF\u19D2p;\u6A4Bp;\u6A47ot;\u6A40;\uC000\u2229\uFE00\u0100eo\u19E2\u19E5t;\u6041\xEE\u0693\u0200aeiu\u19F0\u19FB\u1A01\u1A05\u01F0\u19F5\0\u19F8s;\u6A4Don;\u410Ddil\u803B\xE7\u40E7rc;\u4109ps\u0100;s\u1A0C\u1A0D\u6A4Cm;\u6A50ot;\u410B\u0180dmn\u1A1B\u1A20\u1A26il\u80BB\xB8\u01ADptyv;\u69B2t\u8100\xA2;e\u1A2D\u1A2E\u40A2r\xE4\u01B2r;\uC000\u{1D520}\u0180cei\u1A3D\u1A40\u1A4Dy;\u4447ck\u0100;m\u1A47\u1A48\u6713ark\xBB\u1A48;\u43C7r\u0380;Ecefms\u1A5F\u1A60\u1A62\u1A6B\u1AA4\u1AAA\u1AAE\u65CB;\u69C3\u0180;el\u1A69\u1A6A\u1A6D\u42C6q;\u6257e\u0261\u1A74\0\0\u1A88rrow\u0100lr\u1A7C\u1A81eft;\u61BAight;\u61BB\u0280RSacd\u1A92\u1A94\u1A96\u1A9A\u1A9F\xBB\u0F47;\u64C8st;\u629Birc;\u629Aash;\u629Dnint;\u6A10id;\u6AEFcir;\u69C2ubs\u0100;u\u1ABB\u1ABC\u6663it\xBB\u1ABC\u02EC\u1AC7\u1AD4\u1AFA\0\u1B0Aon\u0100;e\u1ACD\u1ACE\u403A\u0100;q\xC7\xC6\u026D\u1AD9\0\0\u1AE2a\u0100;t\u1ADE\u1ADF\u402C;\u4040\u0180;fl\u1AE8\u1AE9\u1AEB\u6201\xEE\u1160e\u0100mx\u1AF1\u1AF6ent\xBB\u1AE9e\xF3\u024D\u01E7\u1AFE\0\u1B07\u0100;d\u12BB\u1B02ot;\u6A6Dn\xF4\u0246\u0180fry\u1B10\u1B14\u1B17;\uC000\u{1D554}o\xE4\u0254\u8100\xA9;s\u0155\u1B1Dr;\u6117\u0100ao\u1B25\u1B29rr;\u61B5ss;\u6717\u0100cu\u1B32\u1B37r;\uC000\u{1D4B8}\u0100bp\u1B3C\u1B44\u0100;e\u1B41\u1B42\u6ACF;\u6AD1\u0100;e\u1B49\u1B4A\u6AD0;\u6AD2dot;\u62EF\u0380delprvw\u1B60\u1B6C\u1B77\u1B82\u1BAC\u1BD4\u1BF9arr\u0100lr\u1B68\u1B6A;\u6938;\u6935\u0270\u1B72\0\0\u1B75r;\u62DEc;\u62DFarr\u0100;p\u1B7F\u1B80\u61B6;\u693D\u0300;bcdos\u1B8F\u1B90\u1B96\u1BA1\u1BA5\u1BA8\u622Arcap;\u6A48\u0100au\u1B9B\u1B9Ep;\u6A46p;\u6A4Aot;\u628Dr;\u6A45;\uC000\u222A\uFE00\u0200alrv\u1BB5\u1BBF\u1BDE\u1BE3rr\u0100;m\u1BBC\u1BBD\u61B7;\u693Cy\u0180evw\u1BC7\u1BD4\u1BD8q\u0270\u1BCE\0\0\u1BD2re\xE3\u1B73u\xE3\u1B75ee;\u62CEedge;\u62CFen\u803B\xA4\u40A4earrow\u0100lr\u1BEE\u1BF3eft\xBB\u1B80ight\xBB\u1BBDe\xE4\u1BDD\u0100ci\u1C01\u1C07onin\xF4\u01F7nt;\u6231lcty;\u632D\u0980AHabcdefhijlorstuwz\u1C38\u1C3B\u1C3F\u1C5D\u1C69\u1C75\u1C8A\u1C9E\u1CAC\u1CB7\u1CFB\u1CFF\u1D0D\u1D7B\u1D91\u1DAB\u1DBB\u1DC6\u1DCDr\xF2\u0381ar;\u6965\u0200glrs\u1C48\u1C4D\u1C52\u1C54ger;\u6020eth;\u6138\xF2\u1133h\u0100;v\u1C5A\u1C5B\u6010\xBB\u090A\u016B\u1C61\u1C67arow;\u690Fa\xE3\u0315\u0100ay\u1C6E\u1C73ron;\u410F;\u4434\u0180;ao\u0332\u1C7C\u1C84\u0100gr\u02BF\u1C81r;\u61CAtseq;\u6A77\u0180glm\u1C91\u1C94\u1C98\u803B\xB0\u40B0ta;\u43B4ptyv;\u69B1\u0100ir\u1CA3\u1CA8sht;\u697F;\uC000\u{1D521}ar\u0100lr\u1CB3\u1CB5\xBB\u08DC\xBB\u101E\u0280aegsv\u1CC2\u0378\u1CD6\u1CDC\u1CE0m\u0180;os\u0326\u1CCA\u1CD4nd\u0100;s\u0326\u1CD1uit;\u6666amma;\u43DDin;\u62F2\u0180;io\u1CE7\u1CE8\u1CF8\u40F7de\u8100\xF7;o\u1CE7\u1CF0ntimes;\u62C7n\xF8\u1CF7cy;\u4452c\u026F\u1D06\0\0\u1D0Arn;\u631Eop;\u630D\u0280lptuw\u1D18\u1D1D\u1D22\u1D49\u1D55lar;\u4024f;\uC000\u{1D555}\u0280;emps\u030B\u1D2D\u1D37\u1D3D\u1D42q\u0100;d\u0352\u1D33ot;\u6251inus;\u6238lus;\u6214quare;\u62A1blebarwedg\xE5\xFAn\u0180adh\u112E\u1D5D\u1D67ownarrow\xF3\u1C83arpoon\u0100lr\u1D72\u1D76ef\xF4\u1CB4igh\xF4\u1CB6\u0162\u1D7F\u1D85karo\xF7\u0F42\u026F\u1D8A\0\0\u1D8Ern;\u631Fop;\u630C\u0180cot\u1D98\u1DA3\u1DA6\u0100ry\u1D9D\u1DA1;\uC000\u{1D4B9};\u4455l;\u69F6rok;\u4111\u0100dr\u1DB0\u1DB4ot;\u62F1i\u0100;f\u1DBA\u1816\u65BF\u0100ah\u1DC0\u1DC3r\xF2\u0429a\xF2\u0FA6angle;\u69A6\u0100ci\u1DD2\u1DD5y;\u445Fgrarr;\u67FF\u0900Dacdefglmnopqrstux\u1E01\u1E09\u1E19\u1E38\u0578\u1E3C\u1E49\u1E61\u1E7E\u1EA5\u1EAF\u1EBD\u1EE1\u1F2A\u1F37\u1F44\u1F4E\u1F5A\u0100Do\u1E06\u1D34o\xF4\u1C89\u0100cs\u1E0E\u1E14ute\u803B\xE9\u40E9ter;\u6A6E\u0200aioy\u1E22\u1E27\u1E31\u1E36ron;\u411Br\u0100;c\u1E2D\u1E2E\u6256\u803B\xEA\u40EAlon;\u6255;\u444Dot;\u4117\u0100Dr\u1E41\u1E45ot;\u6252;\uC000\u{1D522}\u0180;rs\u1E50\u1E51\u1E57\u6A9Aave\u803B\xE8\u40E8\u0100;d\u1E5C\u1E5D\u6A96ot;\u6A98\u0200;ils\u1E6A\u1E6B\u1E72\u1E74\u6A99nters;\u63E7;\u6113\u0100;d\u1E79\u1E7A\u6A95ot;\u6A97\u0180aps\u1E85\u1E89\u1E97cr;\u4113ty\u0180;sv\u1E92\u1E93\u1E95\u6205et\xBB\u1E93p\u01001;\u1E9D\u1EA4\u0133\u1EA1\u1EA3;\u6004;\u6005\u6003\u0100gs\u1EAA\u1EAC;\u414Bp;\u6002\u0100gp\u1EB4\u1EB8on;\u4119f;\uC000\u{1D556}\u0180als\u1EC4\u1ECE\u1ED2r\u0100;s\u1ECA\u1ECB\u62D5l;\u69E3us;\u6A71i\u0180;lv\u1EDA\u1EDB\u1EDF\u43B5on\xBB\u1EDB;\u43F5\u0200csuv\u1EEA\u1EF3\u1F0B\u1F23\u0100io\u1EEF\u1E31rc\xBB\u1E2E\u0269\u1EF9\0\0\u1EFB\xED\u0548ant\u0100gl\u1F02\u1F06tr\xBB\u1E5Dess\xBB\u1E7A\u0180aei\u1F12\u1F16\u1F1Als;\u403Dst;\u625Fv\u0100;D\u0235\u1F20D;\u6A78parsl;\u69E5\u0100Da\u1F2F\u1F33ot;\u6253rr;\u6971\u0180cdi\u1F3E\u1F41\u1EF8r;\u612Fo\xF4\u0352\u0100ah\u1F49\u1F4B;\u43B7\u803B\xF0\u40F0\u0100mr\u1F53\u1F57l\u803B\xEB\u40EBo;\u60AC\u0180cip\u1F61\u1F64\u1F67l;\u4021s\xF4\u056E\u0100eo\u1F6C\u1F74ctatio\xEE\u0559nential\xE5\u0579\u09E1\u1F92\0\u1F9E\0\u1FA1\u1FA7\0\0\u1FC6\u1FCC\0\u1FD3\0\u1FE6\u1FEA\u2000\0\u2008\u205Allingdotse\xF1\u1E44y;\u4444male;\u6640\u0180ilr\u1FAD\u1FB3\u1FC1lig;\u8000\uFB03\u0269\u1FB9\0\0\u1FBDg;\u8000\uFB00ig;\u8000\uFB04;\uC000\u{1D523}lig;\u8000\uFB01lig;\uC000fj\u0180alt\u1FD9\u1FDC\u1FE1t;\u666Dig;\u8000\uFB02ns;\u65B1of;\u4192\u01F0\u1FEE\0\u1FF3f;\uC000\u{1D557}\u0100ak\u05BF\u1FF7\u0100;v\u1FFC\u1FFD\u62D4;\u6AD9artint;\u6A0D\u0100ao\u200C\u2055\u0100cs\u2011\u2052\u03B1\u201A\u2030\u2038\u2045\u2048\0\u2050\u03B2\u2022\u2025\u2027\u202A\u202C\0\u202E\u803B\xBD\u40BD;\u6153\u803B\xBC\u40BC;\u6155;\u6159;\u615B\u01B3\u2034\0\u2036;\u6154;\u6156\u02B4\u203E\u2041\0\0\u2043\u803B\xBE\u40BE;\u6157;\u615C5;\u6158\u01B6\u204C\0\u204E;\u615A;\u615D8;\u615El;\u6044wn;\u6322cr;\uC000\u{1D4BB}\u0880Eabcdefgijlnorstv\u2082\u2089\u209F\u20A5\u20B0\u20B4\u20F0\u20F5\u20FA\u20FF\u2103\u2112\u2138\u0317\u213E\u2152\u219E\u0100;l\u064D\u2087;\u6A8C\u0180cmp\u2090\u2095\u209Dute;\u41F5ma\u0100;d\u209C\u1CDA\u43B3;\u6A86reve;\u411F\u0100iy\u20AA\u20AErc;\u411D;\u4433ot;\u4121\u0200;lqs\u063E\u0642\u20BD\u20C9\u0180;qs\u063E\u064C\u20C4lan\xF4\u0665\u0200;cdl\u0665\u20D2\u20D5\u20E5c;\u6AA9ot\u0100;o\u20DC\u20DD\u6A80\u0100;l\u20E2\u20E3\u6A82;\u6A84\u0100;e\u20EA\u20ED\uC000\u22DB\uFE00s;\u6A94r;\uC000\u{1D524}\u0100;g\u0673\u061Bmel;\u6137cy;\u4453\u0200;Eaj\u065A\u210C\u210E\u2110;\u6A92;\u6AA5;\u6AA4\u0200Eaes\u211B\u211D\u2129\u2134;\u6269p\u0100;p\u2123\u2124\u6A8Arox\xBB\u2124\u0100;q\u212E\u212F\u6A88\u0100;q\u212E\u211Bim;\u62E7pf;\uC000\u{1D558}\u0100ci\u2143\u2146r;\u610Am\u0180;el\u066B\u214E\u2150;\u6A8E;\u6A90\u8300>;cdlqr\u05EE\u2160\u216A\u216E\u2173\u2179\u0100ci\u2165\u2167;\u6AA7r;\u6A7Aot;\u62D7Par;\u6995uest;\u6A7C\u0280adels\u2184\u216A\u2190\u0656\u219B\u01F0\u2189\0\u218Epro\xF8\u209Er;\u6978q\u0100lq\u063F\u2196les\xF3\u2088i\xED\u066B\u0100en\u21A3\u21ADrtneqq;\uC000\u2269\uFE00\xC5\u21AA\u0500Aabcefkosy\u21C4\u21C7\u21F1\u21F5\u21FA\u2218\u221D\u222F\u2268\u227Dr\xF2\u03A0\u0200ilmr\u21D0\u21D4\u21D7\u21DBrs\xF0\u1484f\xBB\u2024il\xF4\u06A9\u0100dr\u21E0\u21E4cy;\u444A\u0180;cw\u08F4\u21EB\u21EFir;\u6948;\u61ADar;\u610Firc;\u4125\u0180alr\u2201\u220E\u2213rts\u0100;u\u2209\u220A\u6665it\xBB\u220Alip;\u6026con;\u62B9r;\uC000\u{1D525}s\u0100ew\u2223\u2229arow;\u6925arow;\u6926\u0280amopr\u223A\u223E\u2243\u225E\u2263rr;\u61FFtht;\u623Bk\u0100lr\u2249\u2253eftarrow;\u61A9ightarrow;\u61AAf;\uC000\u{1D559}bar;\u6015\u0180clt\u226F\u2274\u2278r;\uC000\u{1D4BD}as\xE8\u21F4rok;\u4127\u0100bp\u2282\u2287ull;\u6043hen\xBB\u1C5B\u0AE1\u22A3\0\u22AA\0\u22B8\u22C5\u22CE\0\u22D5\u22F3\0\0\u22F8\u2322\u2367\u2362\u237F\0\u2386\u23AA\u23B4cute\u803B\xED\u40ED\u0180;iy\u0771\u22B0\u22B5rc\u803B\xEE\u40EE;\u4438\u0100cx\u22BC\u22BFy;\u4435cl\u803B\xA1\u40A1\u0100fr\u039F\u22C9;\uC000\u{1D526}rave\u803B\xEC\u40EC\u0200;ino\u073E\u22DD\u22E9\u22EE\u0100in\u22E2\u22E6nt;\u6A0Ct;\u622Dfin;\u69DCta;\u6129lig;\u4133\u0180aop\u22FE\u231A\u231D\u0180cgt\u2305\u2308\u2317r;\u412B\u0180elp\u071F\u230F\u2313in\xE5\u078Ear\xF4\u0720h;\u4131f;\u62B7ed;\u41B5\u0280;cfot\u04F4\u232C\u2331\u233D\u2341are;\u6105in\u0100;t\u2338\u2339\u621Eie;\u69DDdo\xF4\u2319\u0280;celp\u0757\u234C\u2350\u235B\u2361al;\u62BA\u0100gr\u2355\u2359er\xF3\u1563\xE3\u234Darhk;\u6A17rod;\u6A3C\u0200cgpt\u236F\u2372\u2376\u237By;\u4451on;\u412Ff;\uC000\u{1D55A}a;\u43B9uest\u803B\xBF\u40BF\u0100ci\u238A\u238Fr;\uC000\u{1D4BE}n\u0280;Edsv\u04F4\u239B\u239D\u23A1\u04F3;\u62F9ot;\u62F5\u0100;v\u23A6\u23A7\u62F4;\u62F3\u0100;i\u0777\u23AElde;\u4129\u01EB\u23B8\0\u23BCcy;\u4456l\u803B\xEF\u40EF\u0300cfmosu\u23CC\u23D7\u23DC\u23E1\u23E7\u23F5\u0100iy\u23D1\u23D5rc;\u4135;\u4439r;\uC000\u{1D527}ath;\u4237pf;\uC000\u{1D55B}\u01E3\u23EC\0\u23F1r;\uC000\u{1D4BF}rcy;\u4458kcy;\u4454\u0400acfghjos\u240B\u2416\u2422\u2427\u242D\u2431\u2435\u243Bppa\u0100;v\u2413\u2414\u43BA;\u43F0\u0100ey\u241B\u2420dil;\u4137;\u443Ar;\uC000\u{1D528}reen;\u4138cy;\u4445cy;\u445Cpf;\uC000\u{1D55C}cr;\uC000\u{1D4C0}\u0B80ABEHabcdefghjlmnoprstuv\u2470\u2481\u2486\u248D\u2491\u250E\u253D\u255A\u2580\u264E\u265E\u2665\u2679\u267D\u269A\u26B2\u26D8\u275D\u2768\u278B\u27C0\u2801\u2812\u0180art\u2477\u247A\u247Cr\xF2\u09C6\xF2\u0395ail;\u691Barr;\u690E\u0100;g\u0994\u248B;\u6A8Bar;\u6962\u0963\u24A5\0\u24AA\0\u24B1\0\0\0\0\0\u24B5\u24BA\0\u24C6\u24C8\u24CD\0\u24F9ute;\u413Amptyv;\u69B4ra\xEE\u084Cbda;\u43BBg\u0180;dl\u088E\u24C1\u24C3;\u6991\xE5\u088E;\u6A85uo\u803B\xAB\u40ABr\u0400;bfhlpst\u0899\u24DE\u24E6\u24E9\u24EB\u24EE\u24F1\u24F5\u0100;f\u089D\u24E3s;\u691Fs;\u691D\xEB\u2252p;\u61ABl;\u6939im;\u6973l;\u61A2\u0180;ae\u24FF\u2500\u2504\u6AABil;\u6919\u0100;s\u2509\u250A\u6AAD;\uC000\u2AAD\uFE00\u0180abr\u2515\u2519\u251Drr;\u690Crk;\u6772\u0100ak\u2522\u252Cc\u0100ek\u2528\u252A;\u407B;\u405B\u0100es\u2531\u2533;\u698Bl\u0100du\u2539\u253B;\u698F;\u698D\u0200aeuy\u2546\u254B\u2556\u2558ron;\u413E\u0100di\u2550\u2554il;\u413C\xEC\u08B0\xE2\u2529;\u443B\u0200cqrs\u2563\u2566\u256D\u257Da;\u6936uo\u0100;r\u0E19\u1746\u0100du\u2572\u2577har;\u6967shar;\u694Bh;\u61B2\u0280;fgqs\u258B\u258C\u0989\u25F3\u25FF\u6264t\u0280ahlrt\u2598\u25A4\u25B7\u25C2\u25E8rrow\u0100;t\u0899\u25A1a\xE9\u24F6arpoon\u0100du\u25AF\u25B4own\xBB\u045Ap\xBB\u0966eftarrows;\u61C7ight\u0180ahs\u25CD\u25D6\u25DErrow\u0100;s\u08F4\u08A7arpoon\xF3\u0F98quigarro\xF7\u21F0hreetimes;\u62CB\u0180;qs\u258B\u0993\u25FAlan\xF4\u09AC\u0280;cdgs\u09AC\u260A\u260D\u261D\u2628c;\u6AA8ot\u0100;o\u2614\u2615\u6A7F\u0100;r\u261A\u261B\u6A81;\u6A83\u0100;e\u2622\u2625\uC000\u22DA\uFE00s;\u6A93\u0280adegs\u2633\u2639\u263D\u2649\u264Bppro\xF8\u24C6ot;\u62D6q\u0100gq\u2643\u2645\xF4\u0989gt\xF2\u248C\xF4\u099Bi\xED\u09B2\u0180ilr\u2655\u08E1\u265Asht;\u697C;\uC000\u{1D529}\u0100;E\u099C\u2663;\u6A91\u0161\u2669\u2676r\u0100du\u25B2\u266E\u0100;l\u0965\u2673;\u696Alk;\u6584cy;\u4459\u0280;acht\u0A48\u2688\u268B\u2691\u2696r\xF2\u25C1orne\xF2\u1D08ard;\u696Bri;\u65FA\u0100io\u269F\u26A4dot;\u4140ust\u0100;a\u26AC\u26AD\u63B0che\xBB\u26AD\u0200Eaes\u26BB\u26BD\u26C9\u26D4;\u6268p\u0100;p\u26C3\u26C4\u6A89rox\xBB\u26C4\u0100;q\u26CE\u26CF\u6A87\u0100;q\u26CE\u26BBim;\u62E6\u0400abnoptwz\u26E9\u26F4\u26F7\u271A\u272F\u2741\u2747\u2750\u0100nr\u26EE\u26F1g;\u67ECr;\u61FDr\xEB\u08C1g\u0180lmr\u26FF\u270D\u2714eft\u0100ar\u09E6\u2707ight\xE1\u09F2apsto;\u67FCight\xE1\u09FDparrow\u0100lr\u2725\u2729ef\xF4\u24EDight;\u61AC\u0180afl\u2736\u2739\u273Dr;\u6985;\uC000\u{1D55D}us;\u6A2Dimes;\u6A34\u0161\u274B\u274Fst;\u6217\xE1\u134E\u0180;ef\u2757\u2758\u1800\u65CAnge\xBB\u2758ar\u0100;l\u2764\u2765\u4028t;\u6993\u0280achmt\u2773\u2776\u277C\u2785\u2787r\xF2\u08A8orne\xF2\u1D8Car\u0100;d\u0F98\u2783;\u696D;\u600Eri;\u62BF\u0300achiqt\u2798\u279D\u0A40\u27A2\u27AE\u27BBquo;\u6039r;\uC000\u{1D4C1}m\u0180;eg\u09B2\u27AA\u27AC;\u6A8D;\u6A8F\u0100bu\u252A\u27B3o\u0100;r\u0E1F\u27B9;\u601Arok;\u4142\u8400<;cdhilqr\u082B\u27D2\u2639\u27DC\u27E0\u27E5\u27EA\u27F0\u0100ci\u27D7\u27D9;\u6AA6r;\u6A79re\xE5\u25F2mes;\u62C9arr;\u6976uest;\u6A7B\u0100Pi\u27F5\u27F9ar;\u6996\u0180;ef\u2800\u092D\u181B\u65C3r\u0100du\u2807\u280Dshar;\u694Ahar;\u6966\u0100en\u2817\u2821rtneqq;\uC000\u2268\uFE00\xC5\u281E\u0700Dacdefhilnopsu\u2840\u2845\u2882\u288E\u2893\u28A0\u28A5\u28A8\u28DA\u28E2\u28E4\u0A83\u28F3\u2902Dot;\u623A\u0200clpr\u284E\u2852\u2863\u287Dr\u803B\xAF\u40AF\u0100et\u2857\u2859;\u6642\u0100;e\u285E\u285F\u6720se\xBB\u285F\u0100;s\u103B\u2868to\u0200;dlu\u103B\u2873\u2877\u287Bow\xEE\u048Cef\xF4\u090F\xF0\u13D1ker;\u65AE\u0100oy\u2887\u288Cmma;\u6A29;\u443Cash;\u6014asuredangle\xBB\u1626r;\uC000\u{1D52A}o;\u6127\u0180cdn\u28AF\u28B4\u28C9ro\u803B\xB5\u40B5\u0200;acd\u1464\u28BD\u28C0\u28C4s\xF4\u16A7ir;\u6AF0ot\u80BB\xB7\u01B5us\u0180;bd\u28D2\u1903\u28D3\u6212\u0100;u\u1D3C\u28D8;\u6A2A\u0163\u28DE\u28E1p;\u6ADB\xF2\u2212\xF0\u0A81\u0100dp\u28E9\u28EEels;\u62A7f;\uC000\u{1D55E}\u0100ct\u28F8\u28FDr;\uC000\u{1D4C2}pos\xBB\u159D\u0180;lm\u2909\u290A\u290D\u43BCtimap;\u62B8\u0C00GLRVabcdefghijlmoprstuvw\u2942\u2953\u297E\u2989\u2998\u29DA\u29E9\u2A15\u2A1A\u2A58\u2A5D\u2A83\u2A95\u2AA4\u2AA8\u2B04\u2B07\u2B44\u2B7F\u2BAE\u2C34\u2C67\u2C7C\u2CE9\u0100gt\u2947\u294B;\uC000\u22D9\u0338\u0100;v\u2950\u0BCF\uC000\u226B\u20D2\u0180elt\u295A\u2972\u2976ft\u0100ar\u2961\u2967rrow;\u61CDightarrow;\u61CE;\uC000\u22D8\u0338\u0100;v\u297B\u0C47\uC000\u226A\u20D2ightarrow;\u61CF\u0100Dd\u298E\u2993ash;\u62AFash;\u62AE\u0280bcnpt\u29A3\u29A7\u29AC\u29B1\u29CCla\xBB\u02DEute;\u4144g;\uC000\u2220\u20D2\u0280;Eiop\u0D84\u29BC\u29C0\u29C5\u29C8;\uC000\u2A70\u0338d;\uC000\u224B\u0338s;\u4149ro\xF8\u0D84ur\u0100;a\u29D3\u29D4\u666El\u0100;s\u29D3\u0B38\u01F3\u29DF\0\u29E3p\u80BB\xA0\u0B37mp\u0100;e\u0BF9\u0C00\u0280aeouy\u29F4\u29FE\u2A03\u2A10\u2A13\u01F0\u29F9\0\u29FB;\u6A43on;\u4148dil;\u4146ng\u0100;d\u0D7E\u2A0Aot;\uC000\u2A6D\u0338p;\u6A42;\u443Dash;\u6013\u0380;Aadqsx\u0B92\u2A29\u2A2D\u2A3B\u2A41\u2A45\u2A50rr;\u61D7r\u0100hr\u2A33\u2A36k;\u6924\u0100;o\u13F2\u13F0ot;\uC000\u2250\u0338ui\xF6\u0B63\u0100ei\u2A4A\u2A4Ear;\u6928\xED\u0B98ist\u0100;s\u0BA0\u0B9Fr;\uC000\u{1D52B}\u0200Eest\u0BC5\u2A66\u2A79\u2A7C\u0180;qs\u0BBC\u2A6D\u0BE1\u0180;qs\u0BBC\u0BC5\u2A74lan\xF4\u0BE2i\xED\u0BEA\u0100;r\u0BB6\u2A81\xBB\u0BB7\u0180Aap\u2A8A\u2A8D\u2A91r\xF2\u2971rr;\u61AEar;\u6AF2\u0180;sv\u0F8D\u2A9C\u0F8C\u0100;d\u2AA1\u2AA2\u62FC;\u62FAcy;\u445A\u0380AEadest\u2AB7\u2ABA\u2ABE\u2AC2\u2AC5\u2AF6\u2AF9r\xF2\u2966;\uC000\u2266\u0338rr;\u619Ar;\u6025\u0200;fqs\u0C3B\u2ACE\u2AE3\u2AEFt\u0100ar\u2AD4\u2AD9rro\xF7\u2AC1ightarro\xF7\u2A90\u0180;qs\u0C3B\u2ABA\u2AEAlan\xF4\u0C55\u0100;s\u0C55\u2AF4\xBB\u0C36i\xED\u0C5D\u0100;r\u0C35\u2AFEi\u0100;e\u0C1A\u0C25i\xE4\u0D90\u0100pt\u2B0C\u2B11f;\uC000\u{1D55F}\u8180\xAC;in\u2B19\u2B1A\u2B36\u40ACn\u0200;Edv\u0B89\u2B24\u2B28\u2B2E;\uC000\u22F9\u0338ot;\uC000\u22F5\u0338\u01E1\u0B89\u2B33\u2B35;\u62F7;\u62F6i\u0100;v\u0CB8\u2B3C\u01E1\u0CB8\u2B41\u2B43;\u62FE;\u62FD\u0180aor\u2B4B\u2B63\u2B69r\u0200;ast\u0B7B\u2B55\u2B5A\u2B5Flle\xEC\u0B7Bl;\uC000\u2AFD\u20E5;\uC000\u2202\u0338lint;\u6A14\u0180;ce\u0C92\u2B70\u2B73u\xE5\u0CA5\u0100;c\u0C98\u2B78\u0100;e\u0C92\u2B7D\xF1\u0C98\u0200Aait\u2B88\u2B8B\u2B9D\u2BA7r\xF2\u2988rr\u0180;cw\u2B94\u2B95\u2B99\u619B;\uC000\u2933\u0338;\uC000\u219D\u0338ghtarrow\xBB\u2B95ri\u0100;e\u0CCB\u0CD6\u0380chimpqu\u2BBD\u2BCD\u2BD9\u2B04\u0B78\u2BE4\u2BEF\u0200;cer\u0D32\u2BC6\u0D37\u2BC9u\xE5\u0D45;\uC000\u{1D4C3}ort\u026D\u2B05\0\0\u2BD6ar\xE1\u2B56m\u0100;e\u0D6E\u2BDF\u0100;q\u0D74\u0D73su\u0100bp\u2BEB\u2BED\xE5\u0CF8\xE5\u0D0B\u0180bcp\u2BF6\u2C11\u2C19\u0200;Ees\u2BFF\u2C00\u0D22\u2C04\u6284;\uC000\u2AC5\u0338et\u0100;e\u0D1B\u2C0Bq\u0100;q\u0D23\u2C00c\u0100;e\u0D32\u2C17\xF1\u0D38\u0200;Ees\u2C22\u2C23\u0D5F\u2C27\u6285;\uC000\u2AC6\u0338et\u0100;e\u0D58\u2C2Eq\u0100;q\u0D60\u2C23\u0200gilr\u2C3D\u2C3F\u2C45\u2C47\xEC\u0BD7lde\u803B\xF1\u40F1\xE7\u0C43iangle\u0100lr\u2C52\u2C5Ceft\u0100;e\u0C1A\u2C5A\xF1\u0C26ight\u0100;e\u0CCB\u2C65\xF1\u0CD7\u0100;m\u2C6C\u2C6D\u43BD\u0180;es\u2C74\u2C75\u2C79\u4023ro;\u6116p;\u6007\u0480DHadgilrs\u2C8F\u2C94\u2C99\u2C9E\u2CA3\u2CB0\u2CB6\u2CD3\u2CE3ash;\u62ADarr;\u6904p;\uC000\u224D\u20D2ash;\u62AC\u0100et\u2CA8\u2CAC;\uC000\u2265\u20D2;\uC000>\u20D2nfin;\u69DE\u0180Aet\u2CBD\u2CC1\u2CC5rr;\u6902;\uC000\u2264\u20D2\u0100;r\u2CCA\u2CCD\uC000<\u20D2ie;\uC000\u22B4\u20D2\u0100At\u2CD8\u2CDCrr;\u6903rie;\uC000\u22B5\u20D2im;\uC000\u223C\u20D2\u0180Aan\u2CF0\u2CF4\u2D02rr;\u61D6r\u0100hr\u2CFA\u2CFDk;\u6923\u0100;o\u13E7\u13E5ear;\u6927\u1253\u1A95\0\0\0\0\0\0\0\0\0\0\0\0\0\u2D2D\0\u2D38\u2D48\u2D60\u2D65\u2D72\u2D84\u1B07\0\0\u2D8D\u2DAB\0\u2DC8\u2DCE\0\u2DDC\u2E19\u2E2B\u2E3E\u2E43\u0100cs\u2D31\u1A97ute\u803B\xF3\u40F3\u0100iy\u2D3C\u2D45r\u0100;c\u1A9E\u2D42\u803B\xF4\u40F4;\u443E\u0280abios\u1AA0\u2D52\u2D57\u01C8\u2D5Alac;\u4151v;\u6A38old;\u69BClig;\u4153\u0100cr\u2D69\u2D6Dir;\u69BF;\uC000\u{1D52C}\u036F\u2D79\0\0\u2D7C\0\u2D82n;\u42DBave\u803B\xF2\u40F2;\u69C1\u0100bm\u2D88\u0DF4ar;\u69B5\u0200acit\u2D95\u2D98\u2DA5\u2DA8r\xF2\u1A80\u0100ir\u2D9D\u2DA0r;\u69BEoss;\u69BBn\xE5\u0E52;\u69C0\u0180aei\u2DB1\u2DB5\u2DB9cr;\u414Dga;\u43C9\u0180cdn\u2DC0\u2DC5\u01CDron;\u43BF;\u69B6pf;\uC000\u{1D560}\u0180ael\u2DD4\u2DD7\u01D2r;\u69B7rp;\u69B9\u0380;adiosv\u2DEA\u2DEB\u2DEE\u2E08\u2E0D\u2E10\u2E16\u6228r\xF2\u1A86\u0200;efm\u2DF7\u2DF8\u2E02\u2E05\u6A5Dr\u0100;o\u2DFE\u2DFF\u6134f\xBB\u2DFF\u803B\xAA\u40AA\u803B\xBA\u40BAgof;\u62B6r;\u6A56lope;\u6A57;\u6A5B\u0180clo\u2E1F\u2E21\u2E27\xF2\u2E01ash\u803B\xF8\u40F8l;\u6298i\u016C\u2E2F\u2E34de\u803B\xF5\u40F5es\u0100;a\u01DB\u2E3As;\u6A36ml\u803B\xF6\u40F6bar;\u633D\u0AE1\u2E5E\0\u2E7D\0\u2E80\u2E9D\0\u2EA2\u2EB9\0\0\u2ECB\u0E9C\0\u2F13\0\0\u2F2B\u2FBC\0\u2FC8r\u0200;ast\u0403\u2E67\u2E72\u0E85\u8100\xB6;l\u2E6D\u2E6E\u40B6le\xEC\u0403\u0269\u2E78\0\0\u2E7Bm;\u6AF3;\u6AFDy;\u443Fr\u0280cimpt\u2E8B\u2E8F\u2E93\u1865\u2E97nt;\u4025od;\u402Eil;\u6030enk;\u6031r;\uC000\u{1D52D}\u0180imo\u2EA8\u2EB0\u2EB4\u0100;v\u2EAD\u2EAE\u43C6;\u43D5ma\xF4\u0A76ne;\u660E\u0180;tv\u2EBF\u2EC0\u2EC8\u43C0chfork\xBB\u1FFD;\u43D6\u0100au\u2ECF\u2EDFn\u0100ck\u2ED5\u2EDDk\u0100;h\u21F4\u2EDB;\u610E\xF6\u21F4s\u0480;abcdemst\u2EF3\u2EF4\u1908\u2EF9\u2EFD\u2F04\u2F06\u2F0A\u2F0E\u402Bcir;\u6A23ir;\u6A22\u0100ou\u1D40\u2F02;\u6A25;\u6A72n\u80BB\xB1\u0E9Dim;\u6A26wo;\u6A27\u0180ipu\u2F19\u2F20\u2F25ntint;\u6A15f;\uC000\u{1D561}nd\u803B\xA3\u40A3\u0500;Eaceinosu\u0EC8\u2F3F\u2F41\u2F44\u2F47\u2F81\u2F89\u2F92\u2F7E\u2FB6;\u6AB3p;\u6AB7u\xE5\u0ED9\u0100;c\u0ECE\u2F4C\u0300;acens\u0EC8\u2F59\u2F5F\u2F66\u2F68\u2F7Eppro\xF8\u2F43urlye\xF1\u0ED9\xF1\u0ECE\u0180aes\u2F6F\u2F76\u2F7Approx;\u6AB9qq;\u6AB5im;\u62E8i\xED\u0EDFme\u0100;s\u2F88\u0EAE\u6032\u0180Eas\u2F78\u2F90\u2F7A\xF0\u2F75\u0180dfp\u0EEC\u2F99\u2FAF\u0180als\u2FA0\u2FA5\u2FAAlar;\u632Eine;\u6312urf;\u6313\u0100;t\u0EFB\u2FB4\xEF\u0EFBrel;\u62B0\u0100ci\u2FC0\u2FC5r;\uC000\u{1D4C5};\u43C8ncsp;\u6008\u0300fiopsu\u2FDA\u22E2\u2FDF\u2FE5\u2FEB\u2FF1r;\uC000\u{1D52E}pf;\uC000\u{1D562}rime;\u6057cr;\uC000\u{1D4C6}\u0180aeo\u2FF8\u3009\u3013t\u0100ei\u2FFE\u3005rnion\xF3\u06B0nt;\u6A16st\u0100;e\u3010\u3011\u403F\xF1\u1F19\xF4\u0F14\u0A80ABHabcdefhilmnoprstux\u3040\u3051\u3055\u3059\u30E0\u310E\u312B\u3147\u3162\u3172\u318E\u3206\u3215\u3224\u3229\u3258\u326E\u3272\u3290\u32B0\u32B7\u0180art\u3047\u304A\u304Cr\xF2\u10B3\xF2\u03DDail;\u691Car\xF2\u1C65ar;\u6964\u0380cdenqrt\u3068\u3075\u3078\u307F\u308F\u3094\u30CC\u0100eu\u306D\u3071;\uC000\u223D\u0331te;\u4155i\xE3\u116Emptyv;\u69B3g\u0200;del\u0FD1\u3089\u308B\u308D;\u6992;\u69A5\xE5\u0FD1uo\u803B\xBB\u40BBr\u0580;abcfhlpstw\u0FDC\u30AC\u30AF\u30B7\u30B9\u30BC\u30BE\u30C0\u30C3\u30C7\u30CAp;\u6975\u0100;f\u0FE0\u30B4s;\u6920;\u6933s;\u691E\xEB\u225D\xF0\u272El;\u6945im;\u6974l;\u61A3;\u619D\u0100ai\u30D1\u30D5il;\u691Ao\u0100;n\u30DB\u30DC\u6236al\xF3\u0F1E\u0180abr\u30E7\u30EA\u30EEr\xF2\u17E5rk;\u6773\u0100ak\u30F3\u30FDc\u0100ek\u30F9\u30FB;\u407D;\u405D\u0100es\u3102\u3104;\u698Cl\u0100du\u310A\u310C;\u698E;\u6990\u0200aeuy\u3117\u311C\u3127\u3129ron;\u4159\u0100di\u3121\u3125il;\u4157\xEC\u0FF2\xE2\u30FA;\u4440\u0200clqs\u3134\u3137\u313D\u3144a;\u6937dhar;\u6969uo\u0100;r\u020E\u020Dh;\u61B3\u0180acg\u314E\u315F\u0F44l\u0200;ips\u0F78\u3158\u315B\u109Cn\xE5\u10BBar\xF4\u0FA9t;\u65AD\u0180ilr\u3169\u1023\u316Esht;\u697D;\uC000\u{1D52F}\u0100ao\u3177\u3186r\u0100du\u317D\u317F\xBB\u047B\u0100;l\u1091\u3184;\u696C\u0100;v\u318B\u318C\u43C1;\u43F1\u0180gns\u3195\u31F9\u31FCht\u0300ahlrst\u31A4\u31B0\u31C2\u31D8\u31E4\u31EErrow\u0100;t\u0FDC\u31ADa\xE9\u30C8arpoon\u0100du\u31BB\u31BFow\xEE\u317Ep\xBB\u1092eft\u0100ah\u31CA\u31D0rrow\xF3\u0FEAarpoon\xF3\u0551ightarrows;\u61C9quigarro\xF7\u30CBhreetimes;\u62CCg;\u42DAingdotse\xF1\u1F32\u0180ahm\u320D\u3210\u3213r\xF2\u0FEAa\xF2\u0551;\u600Foust\u0100;a\u321E\u321F\u63B1che\xBB\u321Fmid;\u6AEE\u0200abpt\u3232\u323D\u3240\u3252\u0100nr\u3237\u323Ag;\u67EDr;\u61FEr\xEB\u1003\u0180afl\u3247\u324A\u324Er;\u6986;\uC000\u{1D563}us;\u6A2Eimes;\u6A35\u0100ap\u325D\u3267r\u0100;g\u3263\u3264\u4029t;\u6994olint;\u6A12ar\xF2\u31E3\u0200achq\u327B\u3280\u10BC\u3285quo;\u603Ar;\uC000\u{1D4C7}\u0100bu\u30FB\u328Ao\u0100;r\u0214\u0213\u0180hir\u3297\u329B\u32A0re\xE5\u31F8mes;\u62CAi\u0200;efl\u32AA\u1059\u1821\u32AB\u65B9tri;\u69CEluhar;\u6968;\u611E\u0D61\u32D5\u32DB\u32DF\u332C\u3338\u3371\0\u337A\u33A4\0\0\u33EC\u33F0\0\u3428\u3448\u345A\u34AD\u34B1\u34CA\u34F1\0\u3616\0\0\u3633cute;\u415Bqu\xEF\u27BA\u0500;Eaceinpsy\u11ED\u32F3\u32F5\u32FF\u3302\u330B\u330F\u331F\u3326\u3329;\u6AB4\u01F0\u32FA\0\u32FC;\u6AB8on;\u4161u\xE5\u11FE\u0100;d\u11F3\u3307il;\u415Frc;\u415D\u0180Eas\u3316\u3318\u331B;\u6AB6p;\u6ABAim;\u62E9olint;\u6A13i\xED\u1204;\u4441ot\u0180;be\u3334\u1D47\u3335\u62C5;\u6A66\u0380Aacmstx\u3346\u334A\u3357\u335B\u335E\u3363\u336Drr;\u61D8r\u0100hr\u3350\u3352\xEB\u2228\u0100;o\u0A36\u0A34t\u803B\xA7\u40A7i;\u403Bwar;\u6929m\u0100in\u3369\xF0nu\xF3\xF1t;\u6736r\u0100;o\u3376\u2055\uC000\u{1D530}\u0200acoy\u3382\u3386\u3391\u33A0rp;\u666F\u0100hy\u338B\u338Fcy;\u4449;\u4448rt\u026D\u3399\0\0\u339Ci\xE4\u1464ara\xEC\u2E6F\u803B\xAD\u40AD\u0100gm\u33A8\u33B4ma\u0180;fv\u33B1\u33B2\u33B2\u43C3;\u43C2\u0400;deglnpr\u12AB\u33C5\u33C9\u33CE\u33D6\u33DE\u33E1\u33E6ot;\u6A6A\u0100;q\u12B1\u12B0\u0100;E\u33D3\u33D4\u6A9E;\u6AA0\u0100;E\u33DB\u33DC\u6A9D;\u6A9Fe;\u6246lus;\u6A24arr;\u6972ar\xF2\u113D\u0200aeit\u33F8\u3408\u340F\u3417\u0100ls\u33FD\u3404lsetm\xE9\u336Ahp;\u6A33parsl;\u69E4\u0100dl\u1463\u3414e;\u6323\u0100;e\u341C\u341D\u6AAA\u0100;s\u3422\u3423\u6AAC;\uC000\u2AAC\uFE00\u0180flp\u342E\u3433\u3442tcy;\u444C\u0100;b\u3438\u3439\u402F\u0100;a\u343E\u343F\u69C4r;\u633Ff;\uC000\u{1D564}a\u0100dr\u344D\u0402es\u0100;u\u3454\u3455\u6660it\xBB\u3455\u0180csu\u3460\u3479\u349F\u0100au\u3465\u346Fp\u0100;s\u1188\u346B;\uC000\u2293\uFE00p\u0100;s\u11B4\u3475;\uC000\u2294\uFE00u\u0100bp\u347F\u348F\u0180;es\u1197\u119C\u3486et\u0100;e\u1197\u348D\xF1\u119D\u0180;es\u11A8\u11AD\u3496et\u0100;e\u11A8\u349D\xF1\u11AE\u0180;af\u117B\u34A6\u05B0r\u0165\u34AB\u05B1\xBB\u117Car\xF2\u1148\u0200cemt\u34B9\u34BE\u34C2\u34C5r;\uC000\u{1D4C8}tm\xEE\xF1i\xEC\u3415ar\xE6\u11BE\u0100ar\u34CE\u34D5r\u0100;f\u34D4\u17BF\u6606\u0100an\u34DA\u34EDight\u0100ep\u34E3\u34EApsilo\xEE\u1EE0h\xE9\u2EAFs\xBB\u2852\u0280bcmnp\u34FB\u355E\u1209\u358B\u358E\u0480;Edemnprs\u350E\u350F\u3511\u3515\u351E\u3523\u352C\u3531\u3536\u6282;\u6AC5ot;\u6ABD\u0100;d\u11DA\u351Aot;\u6AC3ult;\u6AC1\u0100Ee\u3528\u352A;\u6ACB;\u628Alus;\u6ABFarr;\u6979\u0180eiu\u353D\u3552\u3555t\u0180;en\u350E\u3545\u354Bq\u0100;q\u11DA\u350Feq\u0100;q\u352B\u3528m;\u6AC7\u0100bp\u355A\u355C;\u6AD5;\u6AD3c\u0300;acens\u11ED\u356C\u3572\u3579\u357B\u3326ppro\xF8\u32FAurlye\xF1\u11FE\xF1\u11F3\u0180aes\u3582\u3588\u331Bppro\xF8\u331Aq\xF1\u3317g;\u666A\u0680123;Edehlmnps\u35A9\u35AC\u35AF\u121C\u35B2\u35B4\u35C0\u35C9\u35D5\u35DA\u35DF\u35E8\u35ED\u803B\xB9\u40B9\u803B\xB2\u40B2\u803B\xB3\u40B3;\u6AC6\u0100os\u35B9\u35BCt;\u6ABEub;\u6AD8\u0100;d\u1222\u35C5ot;\u6AC4s\u0100ou\u35CF\u35D2l;\u67C9b;\u6AD7arr;\u697Bult;\u6AC2\u0100Ee\u35E4\u35E6;\u6ACC;\u628Blus;\u6AC0\u0180eiu\u35F4\u3609\u360Ct\u0180;en\u121C\u35FC\u3602q\u0100;q\u1222\u35B2eq\u0100;q\u35E7\u35E4m;\u6AC8\u0100bp\u3611\u3613;\u6AD4;\u6AD6\u0180Aan\u361C\u3620\u362Drr;\u61D9r\u0100hr\u3626\u3628\xEB\u222E\u0100;o\u0A2B\u0A29war;\u692Alig\u803B\xDF\u40DF\u0BE1\u3651\u365D\u3660\u12CE\u3673\u3679\0\u367E\u36C2\0\0\0\0\0\u36DB\u3703\0\u3709\u376C\0\0\0\u3787\u0272\u3656\0\0\u365Bget;\u6316;\u43C4r\xEB\u0E5F\u0180aey\u3666\u366B\u3670ron;\u4165dil;\u4163;\u4442lrec;\u6315r;\uC000\u{1D531}\u0200eiko\u3686\u369D\u36B5\u36BC\u01F2\u368B\0\u3691e\u01004f\u1284\u1281a\u0180;sv\u3698\u3699\u369B\u43B8ym;\u43D1\u0100cn\u36A2\u36B2k\u0100as\u36A8\u36AEppro\xF8\u12C1im\xBB\u12ACs\xF0\u129E\u0100as\u36BA\u36AE\xF0\u12C1rn\u803B\xFE\u40FE\u01EC\u031F\u36C6\u22E7es\u8180\xD7;bd\u36CF\u36D0\u36D8\u40D7\u0100;a\u190F\u36D5r;\u6A31;\u6A30\u0180eps\u36E1\u36E3\u3700\xE1\u2A4D\u0200;bcf\u0486\u36EC\u36F0\u36F4ot;\u6336ir;\u6AF1\u0100;o\u36F9\u36FC\uC000\u{1D565}rk;\u6ADA\xE1\u3362rime;\u6034\u0180aip\u370F\u3712\u3764d\xE5\u1248\u0380adempst\u3721\u374D\u3740\u3751\u3757\u375C\u375Fngle\u0280;dlqr\u3730\u3731\u3736\u3740\u3742\u65B5own\xBB\u1DBBeft\u0100;e\u2800\u373E\xF1\u092E;\u625Cight\u0100;e\u32AA\u374B\xF1\u105Aot;\u65ECinus;\u6A3Alus;\u6A39b;\u69CDime;\u6A3Bezium;\u63E2\u0180cht\u3772\u377D\u3781\u0100ry\u3777\u377B;\uC000\u{1D4C9};\u4446cy;\u445Brok;\u4167\u0100io\u378B\u378Ex\xF4\u1777head\u0100lr\u3797\u37A0eftarro\xF7\u084Fightarrow\xBB\u0F5D\u0900AHabcdfghlmoprstuw\u37D0\u37D3\u37D7\u37E4\u37F0\u37FC\u380E\u381C\u3823\u3834\u3851\u385D\u386B\u38A9\u38CC\u38D2\u38EA\u38F6r\xF2\u03EDar;\u6963\u0100cr\u37DC\u37E2ute\u803B\xFA\u40FA\xF2\u1150r\u01E3\u37EA\0\u37EDy;\u445Eve;\u416D\u0100iy\u37F5\u37FArc\u803B\xFB\u40FB;\u4443\u0180abh\u3803\u3806\u380Br\xF2\u13ADlac;\u4171a\xF2\u13C3\u0100ir\u3813\u3818sht;\u697E;\uC000\u{1D532}rave\u803B\xF9\u40F9\u0161\u3827\u3831r\u0100lr\u382C\u382E\xBB\u0957\xBB\u1083lk;\u6580\u0100ct\u3839\u384D\u026F\u383F\0\0\u384Arn\u0100;e\u3845\u3846\u631Cr\xBB\u3846op;\u630Fri;\u65F8\u0100al\u3856\u385Acr;\u416B\u80BB\xA8\u0349\u0100gp\u3862\u3866on;\u4173f;\uC000\u{1D566}\u0300adhlsu\u114B\u3878\u387D\u1372\u3891\u38A0own\xE1\u13B3arpoon\u0100lr\u3888\u388Cef\xF4\u382Digh\xF4\u382Fi\u0180;hl\u3899\u389A\u389C\u43C5\xBB\u13FAon\xBB\u389Aparrows;\u61C8\u0180cit\u38B0\u38C4\u38C8\u026F\u38B6\0\0\u38C1rn\u0100;e\u38BC\u38BD\u631Dr\xBB\u38BDop;\u630Eng;\u416Fri;\u65F9cr;\uC000\u{1D4CA}\u0180dir\u38D9\u38DD\u38E2ot;\u62F0lde;\u4169i\u0100;f\u3730\u38E8\xBB\u1813\u0100am\u38EF\u38F2r\xF2\u38A8l\u803B\xFC\u40FCangle;\u69A7\u0780ABDacdeflnoprsz\u391C\u391F\u3929\u392D\u39B5\u39B8\u39BD\u39DF\u39E4\u39E8\u39F3\u39F9\u39FD\u3A01\u3A20r\xF2\u03F7ar\u0100;v\u3926\u3927\u6AE8;\u6AE9as\xE8\u03E1\u0100nr\u3932\u3937grt;\u699C\u0380eknprst\u34E3\u3946\u394B\u3952\u395D\u3964\u3996app\xE1\u2415othin\xE7\u1E96\u0180hir\u34EB\u2EC8\u3959op\xF4\u2FB5\u0100;h\u13B7\u3962\xEF\u318D\u0100iu\u3969\u396Dgm\xE1\u33B3\u0100bp\u3972\u3984setneq\u0100;q\u397D\u3980\uC000\u228A\uFE00;\uC000\u2ACB\uFE00setneq\u0100;q\u398F\u3992\uC000\u228B\uFE00;\uC000\u2ACC\uFE00\u0100hr\u399B\u399Fet\xE1\u369Ciangle\u0100lr\u39AA\u39AFeft\xBB\u0925ight\xBB\u1051y;\u4432ash\xBB\u1036\u0180elr\u39C4\u39D2\u39D7\u0180;be\u2DEA\u39CB\u39CFar;\u62BBq;\u625Alip;\u62EE\u0100bt\u39DC\u1468a\xF2\u1469r;\uC000\u{1D533}tr\xE9\u39AEsu\u0100bp\u39EF\u39F1\xBB\u0D1C\xBB\u0D59pf;\uC000\u{1D567}ro\xF0\u0EFBtr\xE9\u39B4\u0100cu\u3A06\u3A0Br;\uC000\u{1D4CB}\u0100bp\u3A10\u3A18n\u0100Ee\u3980\u3A16\xBB\u397En\u0100Ee\u3992\u3A1E\xBB\u3990igzag;\u699A\u0380cefoprs\u3A36\u3A3B\u3A56\u3A5B\u3A54\u3A61\u3A6Airc;\u4175\u0100di\u3A40\u3A51\u0100bg\u3A45\u3A49ar;\u6A5Fe\u0100;q\u15FA\u3A4F;\u6259erp;\u6118r;\uC000\u{1D534}pf;\uC000\u{1D568}\u0100;e\u1479\u3A66at\xE8\u1479cr;\uC000\u{1D4CC}\u0AE3\u178E\u3A87\0\u3A8B\0\u3A90\u3A9B\0\0\u3A9D\u3AA8\u3AAB\u3AAF\0\0\u3AC3\u3ACE\0\u3AD8\u17DC\u17DFtr\xE9\u17D1r;\uC000\u{1D535}\u0100Aa\u3A94\u3A97r\xF2\u03C3r\xF2\u09F6;\u43BE\u0100Aa\u3AA1\u3AA4r\xF2\u03B8r\xF2\u09EBa\xF0\u2713is;\u62FB\u0180dpt\u17A4\u3AB5\u3ABE\u0100fl\u3ABA\u17A9;\uC000\u{1D569}im\xE5\u17B2\u0100Aa\u3AC7\u3ACAr\xF2\u03CEr\xF2\u0A01\u0100cq\u3AD2\u17B8r;\uC000\u{1D4CD}\u0100pt\u17D6\u3ADCr\xE9\u17D4\u0400acefiosu\u3AF0\u3AFD\u3B08\u3B0C\u3B11\u3B15\u3B1B\u3B21c\u0100uy\u3AF6\u3AFBte\u803B\xFD\u40FD;\u444F\u0100iy\u3B02\u3B06rc;\u4177;\u444Bn\u803B\xA5\u40A5r;\uC000\u{1D536}cy;\u4457pf;\uC000\u{1D56A}cr;\uC000\u{1D4CE}\u0100cm\u3B26\u3B29y;\u444El\u803B\xFF\u40FF\u0500acdefhiosw\u3B42\u3B48\u3B54\u3B58\u3B64\u3B69\u3B6D\u3B74\u3B7A\u3B80cute;\u417A\u0100ay\u3B4D\u3B52ron;\u417E;\u4437ot;\u417C\u0100et\u3B5D\u3B61tr\xE6\u155Fa;\u43B6r;\uC000\u{1D537}cy;\u4436grarr;\u61DDpf;\uC000\u{1D56B}cr;\uC000\u{1D4CF}\u0100jn\u3B85\u3B87;\u600Dj;\u600C'.split("").map(function(e){return e.charCodeAt(0)}))});var KMt=_r(J6e=>{"use strict";Object.defineProperty(J6e,"__esModule",{value:true});J6e.default=new Uint16Array("\u0200aglq \x1B\u026D\0\0p;\u4026os;\u4027t;\u403Et;\u403Cuot;\u4022".split("").map(function(e){return e.charCodeAt(0)}))});var e8e=_r(JI=>{"use strict";var Q6e;Object.defineProperty(JI,"__esModule",{value:true});JI.replaceCodePoint=JI.fromCodePoint=void 0;var HSr=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);JI.fromCodePoint=(Q6e=String.fromCodePoint)!==null&&Q6e!==void 0?Q6e:function(e){var t="";if(e>65535){e-=65536;t+=String.fromCharCode(e>>>10&1023|55296);e=56320|e&1023}t+=String.fromCharCode(e);return t};function ZMt(e){var t;if(e>=55296&&e<=57343||e>1114111){return 65533}return(t=HSr.get(e))!==null&&t!==void 0?t:e}JI.replaceCodePoint=ZMt;function WSr(e){return(0,JI.fromCodePoint)(ZMt(e))}JI.default=WSr});var i8e=_r(Tl=>{"use strict";var YSr=Tl&&Tl.__createBinding||(Object.create?function(e,t,n,r){if(r===void 0)r=n;var i=Object.getOwnPropertyDescriptor(t,n);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,r,i)}:function(e,t,n,r){if(r===void 0)r=n;e[r]=t[n]});var qSr=Tl&&Tl.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var XSr=Tl&&Tl.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null){for(var n in e)if(n!=="default"&&Object.prototype.hasOwnProperty.call(e,n))YSr(t,e,n)}qSr(t,e);return t};var JMt=Tl&&Tl.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(Tl,"__esModule",{value:true});Tl.decodeXML=Tl.decodeHTMLStrict=Tl.decodeHTMLAttribute=Tl.decodeHTML=Tl.determineBranch=Tl.EntityDecoder=Tl.DecodingMode=Tl.BinTrieFlags=Tl.fromCodePoint=Tl.replaceCodePoint=Tl.decodeCodePoint=Tl.xmlDecodeTree=Tl.htmlDecodeTree=void 0;var QMt=JMt(jMt());Tl.htmlDecodeTree=QMt.default;var eLt=JMt(KMt());Tl.xmlDecodeTree=eLt.default;var n8e=XSr(e8e());Tl.decodeCodePoint=n8e.default;var tLt=e8e();Object.defineProperty(Tl,"replaceCodePoint",{enumerable:true,get:function(){return tLt.replaceCodePoint}});Object.defineProperty(Tl,"fromCodePoint",{enumerable:true,get:function(){return tLt.fromCodePoint}});var gm;(function(e){e[e["NUM"]=35]="NUM";e[e["SEMI"]=59]="SEMI";e[e["EQUALS"]=61]="EQUALS";e[e["ZERO"]=48]="ZERO";e[e["NINE"]=57]="NINE";e[e["LOWER_A"]=97]="LOWER_A";e[e["LOWER_F"]=102]="LOWER_F";e[e["LOWER_X"]=120]="LOWER_X";e[e["LOWER_Z"]=122]="LOWER_Z";e[e["UPPER_A"]=65]="UPPER_A";e[e["UPPER_F"]=70]="UPPER_F";e[e["UPPER_Z"]=90]="UPPER_Z"})(gm||(gm={}));var jSr=32;var hN;(function(e){e[e["VALUE_LENGTH"]=49152]="VALUE_LENGTH";e[e["BRANCH_LENGTH"]=16256]="BRANCH_LENGTH";e[e["JUMP_TABLE"]=127]="JUMP_TABLE"})(hN=Tl.BinTrieFlags||(Tl.BinTrieFlags={}));function t8e(e){return e>=gm.ZERO&&e<=gm.NINE}function KSr(e){return e>=gm.UPPER_A&&e<=gm.UPPER_F||e>=gm.LOWER_A&&e<=gm.LOWER_F}function ZSr(e){return e>=gm.UPPER_A&&e<=gm.UPPER_Z||e>=gm.LOWER_A&&e<=gm.LOWER_Z||t8e(e)}function JSr(e){return e===gm.EQUALS||ZSr(e)}var mm;(function(e){e[e["EntityStart"]=0]="EntityStart";e[e["NumericStart"]=1]="NumericStart";e[e["NumericDecimal"]=2]="NumericDecimal";e[e["NumericHex"]=3]="NumericHex";e[e["NamedEntity"]=4]="NamedEntity"})(mm||(mm={}));var pE;(function(e){e[e["Legacy"]=0]="Legacy";e[e["Strict"]=1]="Strict";e[e["Attribute"]=2]="Attribute"})(pE=Tl.DecodingMode||(Tl.DecodingMode={}));var nLt=function(){function e(t,n,r){this.decodeTree=t;this.emitCodePoint=n;this.errors=r;this.state=mm.EntityStart;this.consumed=1;this.result=0;this.treeIndex=0;this.excess=1;this.decodeMode=pE.Strict}e.prototype.startEntity=function(t){this.decodeMode=t;this.state=mm.EntityStart;this.result=0;this.treeIndex=0;this.excess=1;this.consumed=1};e.prototype.write=function(t,n){switch(this.state){case mm.EntityStart:{if(t.charCodeAt(n)===gm.NUM){this.state=mm.NumericStart;this.consumed+=1;return this.stateNumericStart(t,n+1)}this.state=mm.NamedEntity;return this.stateNamedEntity(t,n)}case mm.NumericStart:{return this.stateNumericStart(t,n)}case mm.NumericDecimal:{return this.stateNumericDecimal(t,n)}case mm.NumericHex:{return this.stateNumericHex(t,n)}case mm.NamedEntity:{return this.stateNamedEntity(t,n)}}};e.prototype.stateNumericStart=function(t,n){if(n>=t.length){return-1}if((t.charCodeAt(n)|jSr)===gm.LOWER_X){this.state=mm.NumericHex;this.consumed+=1;return this.stateNumericHex(t,n+1)}this.state=mm.NumericDecimal;return this.stateNumericDecimal(t,n)};e.prototype.addToNumericResult=function(t,n,r,i){if(n!==r){var o=r-n;this.result=this.result*Math.pow(i,o)+parseInt(t.substr(n,o),i);this.consumed+=o}};e.prototype.stateNumericHex=function(t,n){var r=n;while(n>14;for(;n>14;if(o!==0){if(a===gm.SEMI){return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess)}if(this.decodeMode!==pE.Strict){this.result=this.treeIndex;this.consumed+=this.excess;this.excess=0}}}return-1};e.prototype.emitNotTerminatedNamedEntity=function(){var t;var n=this,r=n.result,i=n.decodeTree;var o=(i[r]&hN.VALUE_LENGTH)>>14;this.emitNamedEntityData(r,o,this.consumed);(t=this.errors)===null||t===void 0?void 0:t.missingSemicolonAfterCharacterReference();return this.consumed};e.prototype.emitNamedEntityData=function(t,n,r){var i=this.decodeTree;this.emitCodePoint(n===1?i[t]&~hN.VALUE_LENGTH:i[t+1],r);if(n===3){this.emitCodePoint(i[t+2],r)}return r};e.prototype.end=function(){var t;switch(this.state){case mm.NamedEntity:{return this.result!==0&&(this.decodeMode!==pE.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0}case mm.NumericDecimal:{return this.emitNumericEntity(0,2)}case mm.NumericHex:{return this.emitNumericEntity(0,3)}case mm.NumericStart:{(t=this.errors)===null||t===void 0?void 0:t.absenceOfDigitsInNumericCharacterReference(this.consumed);return 0}case mm.EntityStart:{return 0}}};return e}();Tl.EntityDecoder=nLt;function rLt(e){var t="";var n=new nLt(e,function(r){return t+=(0,n8e.fromCodePoint)(r)});return function r(i,o){var a=0;var s=0;while((s=i.indexOf("&",s))>=0){t+=i.slice(a,s);n.startEntity(o);var l=n.write(i,s+1);if(l<0){a=s+n.end();break}a=s+l;s=l===0?a+1:a}var u=t+i.slice(a);t="";return u}}function iLt(e,t,n,r){var i=(t&hN.BRANCH_LENGTH)>>7;var o=t&hN.JUMP_TABLE;if(i===0){return o!==0&&r===o?n:-1}if(o){var a=r-o;return a<0||a>=i?-1:e[n+a]-1}var s=n;var l=s+i-1;while(s<=l){var u=s+l>>>1;var d=e[u];if(dr){l=u-1}else{return e[u+i]}}return-1}Tl.determineBranch=iLt;var r8e=rLt(QMt.default);var QSr=rLt(eLt.default);function eAr(e,t){if(t===void 0){t=pE.Legacy}return r8e(e,t)}Tl.decodeHTML=eAr;function tAr(e){return r8e(e,pE.Attribute)}Tl.decodeHTMLAttribute=tAr;function nAr(e){return r8e(e,pE.Strict)}Tl.decodeHTMLStrict=nAr;function rAr(e){return QSr(e,pE.Strict)}Tl.decodeXML=rAr});var oLt=_r(o8e=>{"use strict";Object.defineProperty(o8e,"__esModule",{value:true});function jpe(e){for(var t=1;t{"use strict";Object.defineProperty(xp,"__esModule",{value:true});xp.escapeText=xp.escapeAttribute=xp.escapeUTF8=xp.escape=xp.encodeXML=xp.getCodePoint=xp.xmlReplacer=void 0;xp.xmlReplacer=/["&'<>$\x80-\uFFFF]/g;var aLt=new Map([[34,"""],[38,"&"],[39,"'"],[60,"<"],[62,">"]]);xp.getCodePoint=String.prototype.codePointAt!=null?function(e,t){return e.codePointAt(t)}:function(e,t){return(e.charCodeAt(t)&64512)===55296?(e.charCodeAt(t)-55296)*1024+e.charCodeAt(t+1)-56320+65536:e.charCodeAt(t)};function sLt(e){var t="";var n=0;var r;while((r=xp.xmlReplacer.exec(e))!==null){var i=r.index;var o=e.charCodeAt(i);var a=aLt.get(o);if(a!==void 0){t+=e.substring(n,i)+a;n=i+1}else{t+="".concat(e.substring(n,i),"&#x").concat((0,xp.getCodePoint)(e,i).toString(16),";");n=xp.xmlReplacer.lastIndex+=Number((o&64512)===55296)}}return t+e.substr(n)}xp.encodeXML=sLt;xp.escape=sLt;function a8e(e,t){return function n(r){var i;var o=0;var a="";while(i=e.exec(r)){if(o!==i.index){a+=r.substring(o,i.index)}a+=t.get(i[0].charCodeAt(0));o=i.index+1}return a+r.substring(o)}}xp.escapeUTF8=a8e(/[&<>'"]/g,aLt);xp.escapeAttribute=a8e(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]]));xp.escapeText=a8e(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]]))});var s8e=_r(QI=>{"use strict";var iAr=QI&&QI.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(QI,"__esModule",{value:true});QI.encodeNonAsciiHTML=QI.encodeHTML=void 0;var oAr=iAr(oLt());var lLt=Kpe();var aAr=/[\t\n!-,./:-@[-`\f{-}$\x80-\uFFFF]/g;function sAr(e){return cLt(aAr,e)}QI.encodeHTML=sAr;function lAr(e){return cLt(lLt.xmlReplacer,e)}QI.encodeNonAsciiHTML=lAr;function cLt(e,t){var n="";var r=0;var i;while((i=e.exec(t))!==null){var o=i.index;n+=t.substring(r,o);var a=t.charCodeAt(o);var s=oAr.default.get(a);if(typeof s==="object"){if(o+1{"use strict";Object.defineProperty(Ca,"__esModule",{value:true});Ca.decodeXMLStrict=Ca.decodeHTML5Strict=Ca.decodeHTML4Strict=Ca.decodeHTML5=Ca.decodeHTML4=Ca.decodeHTMLAttribute=Ca.decodeHTMLStrict=Ca.decodeHTML=Ca.decodeXML=Ca.DecodingMode=Ca.EntityDecoder=Ca.encodeHTML5=Ca.encodeHTML4=Ca.encodeNonAsciiHTML=Ca.encodeHTML=Ca.escapeText=Ca.escapeAttribute=Ca.escapeUTF8=Ca.escape=Ca.encodeXML=Ca.encode=Ca.decodeStrict=Ca.decode=Ca.EncodingMode=Ca.EntityLevel=void 0;var l8e=i8e();var uLt=s8e();var Zpe=Kpe();var wz;(function(e){e[e["XML"]=0]="XML";e[e["HTML"]=1]="HTML"})(wz=Ca.EntityLevel||(Ca.EntityLevel={}));var UX;(function(e){e[e["UTF8"]=0]="UTF8";e[e["ASCII"]=1]="ASCII";e[e["Extensive"]=2]="Extensive";e[e["Attribute"]=3]="Attribute";e[e["Text"]=4]="Text"})(UX=Ca.EncodingMode||(Ca.EncodingMode={}));function dLt(e,t){if(t===void 0){t=wz.XML}var n=typeof t==="number"?t:t.level;if(n===wz.HTML){var r=typeof t==="object"?t.mode:void 0;return(0,l8e.decodeHTML)(e,r)}return(0,l8e.decodeXML)(e)}Ca.decode=dLt;function cAr(e,t){var n;if(t===void 0){t=wz.XML}var r=typeof t==="number"?{level:t}:t;(n=r.mode)!==null&&n!==void 0?n:r.mode=l8e.DecodingMode.Strict;return dLt(e,r)}Ca.decodeStrict=cAr;function uAr(e,t){if(t===void 0){t=wz.XML}var n=typeof t==="number"?{level:t}:t;if(n.mode===UX.UTF8)return(0,Zpe.escapeUTF8)(e);if(n.mode===UX.Attribute)return(0,Zpe.escapeAttribute)(e);if(n.mode===UX.Text)return(0,Zpe.escapeText)(e);if(n.level===wz.HTML){if(n.mode===UX.ASCII){return(0,uLt.encodeNonAsciiHTML)(e)}return(0,uLt.encodeHTML)(e)}return(0,Zpe.encodeXML)(e)}Ca.encode=uAr;var VX=Kpe();Object.defineProperty(Ca,"encodeXML",{enumerable:true,get:function(){return VX.encodeXML}});Object.defineProperty(Ca,"escape",{enumerable:true,get:function(){return VX.escape}});Object.defineProperty(Ca,"escapeUTF8",{enumerable:true,get:function(){return VX.escapeUTF8}});Object.defineProperty(Ca,"escapeAttribute",{enumerable:true,get:function(){return VX.escapeAttribute}});Object.defineProperty(Ca,"escapeText",{enumerable:true,get:function(){return VX.escapeText}});var Jpe=s8e();Object.defineProperty(Ca,"encodeHTML",{enumerable:true,get:function(){return Jpe.encodeHTML}});Object.defineProperty(Ca,"encodeNonAsciiHTML",{enumerable:true,get:function(){return Jpe.encodeNonAsciiHTML}});Object.defineProperty(Ca,"encodeHTML4",{enumerable:true,get:function(){return Jpe.encodeHTML}});Object.defineProperty(Ca,"encodeHTML5",{enumerable:true,get:function(){return Jpe.encodeHTML}});var AT=i8e();Object.defineProperty(Ca,"EntityDecoder",{enumerable:true,get:function(){return AT.EntityDecoder}});Object.defineProperty(Ca,"DecodingMode",{enumerable:true,get:function(){return AT.DecodingMode}});Object.defineProperty(Ca,"decodeXML",{enumerable:true,get:function(){return AT.decodeXML}});Object.defineProperty(Ca,"decodeHTML",{enumerable:true,get:function(){return AT.decodeHTML}});Object.defineProperty(Ca,"decodeHTMLStrict",{enumerable:true,get:function(){return AT.decodeHTMLStrict}});Object.defineProperty(Ca,"decodeHTMLAttribute",{enumerable:true,get:function(){return AT.decodeHTMLAttribute}});Object.defineProperty(Ca,"decodeHTML4",{enumerable:true,get:function(){return AT.decodeHTML}});Object.defineProperty(Ca,"decodeHTML5",{enumerable:true,get:function(){return AT.decodeHTML}});Object.defineProperty(Ca,"decodeHTML4Strict",{enumerable:true,get:function(){return AT.decodeHTMLStrict}});Object.defineProperty(Ca,"decodeHTML5Strict",{enumerable:true,get:function(){return AT.decodeHTMLStrict}});Object.defineProperty(Ca,"decodeXMLStrict",{enumerable:true,get:function(){return AT.decodeXML}})});var hLt=_r(Ez=>{"use strict";Object.defineProperty(Ez,"__esModule",{value:true});Ez.attributeNames=Ez.elementNames=void 0;Ez.elementNames=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(function(e){return[e.toLowerCase(),e]}));Ez.attributeNames=new Map(["definitionURL","attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(function(e){return[e.toLowerCase(),e]}))});var gLt=_r(y1=>{"use strict";var Cz=y1&&y1.__assign||function(){Cz=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0){r+=eme(e.children,t)}if(t.xmlMode||!pLt.has(e.name)){r+="")}}return r}function _Ar(e){return"<".concat(e.data,">")}function TAr(e,t){var n;var r=e.data||"";if(((n=t.encodeEntities)!==null&&n!==void 0?n:t.decodeEntities)!==false&&!(!t.xmlMode&&e.parent&&pAr.has(e.parent.name))){r=t.xmlMode||t.encodeEntities!=="utf8"?(0,Qpe.encodeXML)(r):(0,Qpe.escapeText)(r)}return r}function wAr(e){return"")}function EAr(e){return"")}});var d8e=_r($A=>{"use strict";var CAr=$A&&$A.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty($A,"__esModule",{value:true});$A.getOuterHTML=yLt;$A.getInnerHTML=kAr;$A.getText=tme;$A.textContent=c8e;$A.innerText=u8e;var mE=fN();var SAr=CAr(gLt());var AAr=BX();function yLt(e,t){return(0,SAr.default)(e,t)}function kAr(e,t){return(0,mE.hasChildren)(e)?e.children.map(function(n){return yLt(n,t)}).join(""):""}function tme(e){if(Array.isArray(e))return e.map(tme).join("");if((0,mE.isTag)(e))return e.name==="br"?"\n":tme(e.children);if((0,mE.isCDATA)(e))return tme(e.children);if((0,mE.isText)(e))return e.data;return""}function c8e(e){if(Array.isArray(e))return e.map(c8e).join("");if((0,mE.hasChildren)(e)&&!(0,mE.isComment)(e)){return c8e(e.children)}if((0,mE.isText)(e))return e.data;return""}function u8e(e){if(Array.isArray(e))return e.map(u8e).join("");if((0,mE.hasChildren)(e)&&(e.type===AAr.ElementType.Tag||(0,mE.isCDATA)(e))){return u8e(e.children)}if((0,mE.isText)(e))return e.data;return""}});var vLt=_r(gE=>{"use strict";Object.defineProperty(gE,"__esModule",{value:true});gE.getChildren=bLt;gE.getParent=xLt;gE.getSiblings=RAr;gE.getAttributeValue=PAr;gE.hasAttrib=IAr;gE.getName=MAr;gE.nextElementSibling=LAr;gE.prevElementSibling=DAr;var f8e=fN();function bLt(e){return(0,f8e.hasChildren)(e)?e.children:[]}function xLt(e){return e.parent||null}function RAr(e){var t,n;var r=xLt(e);if(r!=null)return bLt(r);var i=[e];var o=e.prev,a=e.next;while(o!=null){i.unshift(o);t=o,o=t.prev}while(a!=null){i.push(a);n=a,a=n.next}return i}function PAr(e,t){var n;return(n=e.attribs)===null||n===void 0?void 0:n[t]}function IAr(e,t){return e.attribs!=null&&Object.prototype.hasOwnProperty.call(e.attribs,t)&&e.attribs[t]!=null}function MAr(e){return e.name}function LAr(e){var t;var n=e.next;while(n!==null&&!(0,f8e.isTag)(n))t=n,n=t.next;return n}function DAr(e){var t;var n=e.prev;while(n!==null&&!(0,f8e.isTag)(n))t=n,n=t.prev;return n}});var _Lt=_r(e3=>{"use strict";Object.defineProperty(e3,"__esModule",{value:true});e3.removeElement=$X;e3.replaceElement=FAr;e3.appendChild=NAr;e3.append=OAr;e3.prependChild=BAr;e3.prepend=zAr;function $X(e){if(e.prev)e.prev.next=e.next;if(e.next)e.next.prev=e.prev;if(e.parent){var t=e.parent.children;var n=t.lastIndexOf(e);if(n>=0){t.splice(n,1)}}e.next=null;e.prev=null;e.parent=null}function FAr(e,t){var n=t.prev=e.prev;if(n){n.next=t}var r=t.next=e.next;if(r){r.prev=t}var i=t.parent=e.parent;if(i){var o=i.children;o[o.lastIndexOf(e)]=t;e.parent=null}}function NAr(e,t){$X(t);t.next=null;t.parent=e;if(e.children.push(t)>1){var n=e.children[e.children.length-2];n.next=t;t.prev=n}else{t.prev=null}}function OAr(e,t){$X(t);var n=e.parent;var r=e.next;t.next=r;t.prev=e;e.next=t;t.parent=n;if(r){r.prev=t;if(n){var i=n.children;i.splice(i.lastIndexOf(r),0,t)}}else if(n){n.children.push(t)}}function BAr(e,t){$X(t);t.parent=e;t.prev=null;if(e.children.unshift(t)!==1){var n=e.children[1];n.prev=t;t.next=n}else{t.next=null}}function zAr(e,t){$X(t);var n=e.parent;if(n){var r=n.children;r.splice(r.indexOf(e),0,t)}if(e.prev){e.prev.next=t}t.parent=n;t.prev=e.prev;t.next=e;e.prev=t}});var h8e=_r(t3=>{"use strict";Object.defineProperty(t3,"__esModule",{value:true});t3.filter=UAr;t3.find=TLt;t3.findOneChild=VAr;t3.findOne=wLt;t3.existsOne=ELt;t3.findAll=$Ar;var pN=fN();function UAr(e,t,n,r){if(n===void 0){n=true}if(r===void 0){r=Infinity}return TLt(e,Array.isArray(t)?t:[t],n,r)}function TLt(e,t,n,r){var i=[];var o=[Array.isArray(t)?t:[t]];var a=[0];for(;;){if(a[0]>=o[0].length){if(a.length===1){return i}o.shift();a.shift();continue}var s=o[0][a[0]++];if(e(s)){i.push(s);if(--r<=0)return i}if(n&&(0,pN.hasChildren)(s)&&s.children.length>0){a.unshift(0);o.unshift(s.children)}}}function VAr(e,t){return t.find(e)}function wLt(e,t,n){if(n===void 0){n=true}var r=Array.isArray(t)?t:[t];for(var i=0;i0){var a=wLt(e,o.children,true);if(a)return a}}return null}function ELt(e,t){return(Array.isArray(t)?t:[t]).some(function(n){return(0,pN.isTag)(n)&&e(n)||(0,pN.hasChildren)(n)&&ELt(e,n.children)})}function $Ar(e,t){var n=[];var r=[Array.isArray(t)?t:[t]];var i=[0];for(;;){if(i[0]>=r[0].length){if(r.length===1){return n}r.shift();i.shift();continue}var o=r[0][i[0]++];if((0,pN.isTag)(o)&&e(o))n.push(o);if((0,pN.hasChildren)(o)&&o.children.length>0){i.unshift(0);r.unshift(o.children)}}}});var m8e=_r(n3=>{"use strict";Object.defineProperty(n3,"__esModule",{value:true});n3.testElement=HAr;n3.getElements=WAr;n3.getElementById=YAr;n3.getElementsByTagName=qAr;n3.getElementsByClassName=XAr;n3.getElementsByTagType=jAr;var mN=fN();var GX=h8e();var nme={tag_name:function(e){if(typeof e==="function"){return function(t){return(0,mN.isTag)(t)&&e(t.name)}}else if(e==="*"){return mN.isTag}return function(t){return(0,mN.isTag)(t)&&t.name===e}},tag_type:function(e){if(typeof e==="function"){return function(t){return e(t.type)}}return function(t){return t.type===e}},tag_contains:function(e){if(typeof e==="function"){return function(t){return(0,mN.isText)(t)&&e(t.data)}}return function(t){return(0,mN.isText)(t)&&t.data===e}}};function p8e(e,t){if(typeof t==="function"){return function(n){return(0,mN.isTag)(n)&&t(n.attribs[e])}}return function(n){return(0,mN.isTag)(n)&&n.attribs[e]===t}}function GAr(e,t){return function(n){return e(n)||t(n)}}function CLt(e){var t=Object.keys(e).map(function(n){var r=e[n];return Object.prototype.hasOwnProperty.call(nme,n)?nme[n](r):p8e(n,r)});return t.length===0?null:t.reduce(GAr)}function HAr(e,t){var n=CLt(e);return n?n(t):true}function WAr(e,t,n,r){if(r===void 0){r=Infinity}var i=CLt(e);return i?(0,GX.filter)(i,t,n,r):[]}function YAr(e,t,n){if(n===void 0){n=true}if(!Array.isArray(t))t=[t];return(0,GX.findOne)(p8e("id",e),t,n)}function qAr(e,t,n,r){if(n===void 0){n=true}if(r===void 0){r=Infinity}return(0,GX.filter)(nme["tag_name"](e),t,n,r)}function XAr(e,t,n,r){if(n===void 0){n=true}if(r===void 0){r=Infinity}return(0,GX.filter)(p8e("class",e),t,n,r)}function jAr(e,t,n,r){if(n===void 0){n=true}if(r===void 0){r=Infinity}return(0,GX.filter)(nme["tag_type"](e),t,n,r)}});var kLt=_r(gN=>{"use strict";Object.defineProperty(gN,"__esModule",{value:true});gN.DocumentPosition=void 0;gN.removeSubsets=KAr;gN.compareDocumentPosition=ALt;gN.uniqueSort=ZAr;var SLt=fN();function KAr(e){var t=e.length;while(--t>=0){var n=e[t];if(t>0&&e.lastIndexOf(n,t-1)>=0){e.splice(t,1);continue}for(var r=n.parent;r;r=r.parent){if(e.includes(r)){e.splice(t,1);break}}}return e}var kT;(function(e){e[e["DISCONNECTED"]=1]="DISCONNECTED";e[e["PRECEDING"]=2]="PRECEDING";e[e["FOLLOWING"]=4]="FOLLOWING";e[e["CONTAINS"]=8]="CONTAINS";e[e["CONTAINED_BY"]=16]="CONTAINED_BY"})(kT||(gN.DocumentPosition=kT={}));function ALt(e,t){var n=[];var r=[];if(e===t){return 0}var i=(0,SLt.hasChildren)(e)?e:e.parent;while(i){n.unshift(i);i=i.parent}i=(0,SLt.hasChildren)(t)?t:t.parent;while(i){r.unshift(i);i=i.parent}var o=Math.min(n.length,r.length);var a=0;while(al.indexOf(d)){if(s===t){return kT.FOLLOWING|kT.CONTAINED_BY}return kT.FOLLOWING}if(s===e){return kT.PRECEDING|kT.CONTAINS}return kT.PRECEDING}function ZAr(e){e=e.filter(function(t,n,r){return!r.includes(t,n+1)});e.sort(function(t,n){var r=ALt(t,n);if(r&kT.PRECEDING){return-1}else if(r&kT.FOLLOWING){return 1}return 0});return e}});var PLt=_r(g8e=>{"use strict";Object.defineProperty(g8e,"__esModule",{value:true});g8e.getFeed=QAr;var JAr=d8e();var HX=m8e();function QAr(e){var t=rme(ikr,e);return!t?null:t.name==="feed"?ekr(t):tkr(t)}function ekr(e){var t;var n=e.children;var r={type:"atom",items:(0,HX.getElementsByTagName)("entry",n).map(function(a){var s;var l=a.children;var u={media:RLt(l)};Ub(u,"id","id",l);Ub(u,"title","title",l);var d=(s=rme("link",l))===null||s===void 0?void 0:s.attribs["href"];if(d){u.link=d}var f=r3("summary",l)||r3("content",l);if(f){u.description=f}var h=r3("updated",l);if(h){u.pubDate=new Date(h)}return u})};Ub(r,"id","id",n);Ub(r,"title","title",n);var i=(t=rme("link",n))===null||t===void 0?void 0:t.attribs["href"];if(i){r.link=i}Ub(r,"description","subtitle",n);var o=r3("updated",n);if(o){r.updated=new Date(o)}Ub(r,"author","email",n,true);return r}function tkr(e){var t,n;var r=(n=(t=rme("channel",e.children))===null||t===void 0?void 0:t.children)!==null&&n!==void 0?n:[];var i={type:e.name.substr(0,3),id:"",items:(0,HX.getElementsByTagName)("item",e.children).map(function(a){var s=a.children;var l={media:RLt(s)};Ub(l,"id","guid",s);Ub(l,"title","title",s);Ub(l,"link","link",s);Ub(l,"description","description",s);var u=r3("pubDate",s)||r3("dc:date",s);if(u)l.pubDate=new Date(u);return l})};Ub(i,"title","title",r);Ub(i,"link","link",r);Ub(i,"description","description",r);var o=r3("lastBuildDate",r);if(o){i.updated=new Date(o)}Ub(i,"author","managingEditor",r,true);return i}var nkr=["url","type","lang"];var rkr=["fileSize","bitrate","framerate","samplingrate","channels","duration","height","width"];function RLt(e){return(0,HX.getElementsByTagName)("media:content",e).map(function(t){var n=t.attribs;var r={medium:n["medium"],isDefault:!!n["isDefault"]};for(var i=0,o=nkr;i{"use strict";var okr=Cd&&Cd.__createBinding||(Object.create?function(e,t,n,r){if(r===void 0)r=n;var i=Object.getOwnPropertyDescriptor(t,n);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,r,i)}:function(e,t,n,r){if(r===void 0)r=n;e[r]=t[n]});var yN=Cd&&Cd.__exportStar||function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))okr(t,e,n)};Object.defineProperty(Cd,"__esModule",{value:true});Cd.hasChildren=Cd.isDocument=Cd.isComment=Cd.isText=Cd.isCDATA=Cd.isTag=void 0;yN(d8e(),Cd);yN(vLt(),Cd);yN(_Lt(),Cd);yN(h8e(),Cd);yN(m8e(),Cd);yN(kLt(),Cd);yN(PLt(),Cd);var Sz=fN();Object.defineProperty(Cd,"isTag",{enumerable:true,get:function(){return Sz.isTag}});Object.defineProperty(Cd,"isCDATA",{enumerable:true,get:function(){return Sz.isCDATA}});Object.defineProperty(Cd,"isText",{enumerable:true,get:function(){return Sz.isText}});Object.defineProperty(Cd,"isComment",{enumerable:true,get:function(){return Sz.isComment}});Object.defineProperty(Cd,"isDocument",{enumerable:true,get:function(){return Sz.isDocument}});Object.defineProperty(Cd,"hasChildren",{enumerable:true,get:function(){return Sz.hasChildren}})});var bN=_r((PDo,MLt)=>{MLt.exports={trueFunc:function e(){return true},falseFunc:function e(){return false}}});var ime=_r(yE=>{"use strict";Object.defineProperty(yE,"__esModule",{value:true});yE.AttributeAction=yE.IgnoreCaseMode=yE.SelectorType=void 0;var akr;(function(e){e["Attribute"]="attribute";e["Pseudo"]="pseudo";e["PseudoElement"]="pseudo-element";e["Tag"]="tag";e["Universal"]="universal";e["Adjacent"]="adjacent";e["Child"]="child";e["Descendant"]="descendant";e["Parent"]="parent";e["Sibling"]="sibling";e["ColumnCombinator"]="column-combinator"})(akr=yE.SelectorType||(yE.SelectorType={}));yE.IgnoreCaseMode={Unknown:null,QuirksMode:"quirks",IgnoreCase:true,CaseSensitive:false};var skr;(function(e){e["Any"]="any";e["Element"]="element";e["End"]="end";e["Equals"]="equals";e["Exists"]="exists";e["Hyphen"]="hyphen";e["Not"]="not";e["Start"]="start"})(skr=yE.AttributeAction||(yE.AttributeAction={}))});var OLt=_r(Az=>{"use strict";Object.defineProperty(Az,"__esModule",{value:true});Az.parse=Az.isTraversal=void 0;var Oc=ime();var LLt=/^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/;var lkr=/\\([\da-f]{1,6}\s?|(\s)|.)/gi;var ckr=new Map([[126,Oc.AttributeAction.Element],[94,Oc.AttributeAction.Start],[36,Oc.AttributeAction.End],[42,Oc.AttributeAction.Any],[33,Oc.AttributeAction.Not],[124,Oc.AttributeAction.Hyphen]]);var ukr=new Set(["has","not","matches","is","where","host","host-context"]);function FLt(e){switch(e.type){case Oc.SelectorType.Adjacent:case Oc.SelectorType.Child:case Oc.SelectorType.Descendant:case Oc.SelectorType.Parent:case Oc.SelectorType.Sibling:case Oc.SelectorType.ColumnCombinator:return true;default:return false}}Az.isTraversal=FLt;var dkr=new Set(["contains","icontains"]);function fkr(e,t,n){var r=parseInt(t,16)-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,r&1023|56320)}function WX(e){return e.replace(lkr,fkr)}function y8e(e){return e===39||e===34}function DLt(e){return e===32||e===9||e===10||e===12||e===13}function hkr(e){var t=[];var n=NLt(t,"".concat(e),0);if(n0&&n0&&FLt(r[r.length-1])){throw new Error("Did not expect successive traversals.")}}function u($){if(r.length>0&&r[r.length-1].type===Oc.SelectorType.Descendant){r[r.length-1].type=$;return}l();r.push({type:$})}function d($,K){r.push({type:Oc.SelectorType.Attribute,name:$,action:K,value:i(1),namespace:null,ignoreCase:"quirks"})}function f(){if(r.length&&r[r.length-1].type===Oc.SelectorType.Descendant){r.pop()}if(r.length===0){throw new Error("Empty sub-selector")}e.push(r)}o(0);if(t.length===n){return n}e:while(n{"use strict";var ome=Rz&&Rz.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r ":" > ";case Vf.SelectorType.Parent:return t===0?"< ":" < ";case Vf.SelectorType.Sibling:return t===0?"~ ":" ~ ";case Vf.SelectorType.Adjacent:return t===0?"+ ":" + ";case Vf.SelectorType.Descendant:return" ";case Vf.SelectorType.ColumnCombinator:return t===0?"|| ":" || ";case Vf.SelectorType.Universal:return e.namespace==="*"&&t+10?r+e.slice(n):e}});var YX=_r(b1=>{"use strict";var ykr=b1&&b1.__createBinding||(Object.create?function(e,t,n,r){if(r===void 0)r=n;var i=Object.getOwnPropertyDescriptor(t,n);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,r,i)}:function(e,t,n,r){if(r===void 0)r=n;e[r]=t[n]});var bkr=b1&&b1.__exportStar||function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))ykr(t,e,n)};Object.defineProperty(b1,"__esModule",{value:true});b1.stringify=b1.parse=b1.isTraversal=void 0;bkr(ime(),b1);var WLt=OLt();Object.defineProperty(b1,"isTraversal",{enumerable:true,get:function(){return WLt.isTraversal}});Object.defineProperty(b1,"parse",{enumerable:true,get:function(){return WLt.parse}});var xkr=HLt();Object.defineProperty(b1,"stringify",{enumerable:true,get:function(){return xkr.stringify}})});var b8e=_r(qX=>{"use strict";Object.defineProperty(qX,"__esModule",{value:true});qX.isTraversal=void 0;var x1=YX();var YLt=new Map([[x1.SelectorType.Universal,50],[x1.SelectorType.Tag,30],[x1.SelectorType.Attribute,1],[x1.SelectorType.Pseudo,0]]);function vkr(e){return!YLt.has(e.type)}qX.isTraversal=vkr;var _kr=new Map([[x1.AttributeAction.Exists,10],[x1.AttributeAction.Equals,8],[x1.AttributeAction.Not,7],[x1.AttributeAction.Start,6],[x1.AttributeAction.End,6],[x1.AttributeAction.Any,5]]);function Tkr(e){var t=e.map(qLt);for(var n=1;n=0&&r>=1}}else if(e.type===x1.SelectorType.Pseudo){if(!e.data){r=3}else if(e.name==="has"||e.name==="contains"){r=0}else if(Array.isArray(e.data)){r=Math.min.apply(Math,e.data.map(function(i){return Math.min.apply(Math,i.map(qLt))}));if(r<0){r=0}}else{r=2}}return r}});var jLt=_r(Pz=>{"use strict";var wkr=Pz&&Pz.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(Pz,"__esModule",{value:true});Pz.attributeRules=void 0;var ame=wkr(bN());var Ekr=/[-[\]{}()*+?.,\\^$|#\s]/g;function XLt(e){return e.replace(Ekr,"\\$&")}var Ckr=new Set(["accept","accept-charset","align","alink","axis","bgcolor","charset","checked","clear","codetype","color","compact","declare","defer","dir","direction","disabled","enctype","face","frame","hreflang","http-equiv","lang","language","link","media","method","multiple","nohref","noresize","noshade","nowrap","readonly","rel","rev","rules","scope","scrolling","selected","shape","target","text","type","valign","valuetype","vlink"]);function xN(e,t){return typeof e.ignoreCase==="boolean"?e.ignoreCase:e.ignoreCase==="quirks"?!!t.quirksMode:!t.xmlMode&&Ckr.has(e.name)}Pz.attributeRules={equals:function(e,t,n){var r=n.adapter;var i=t.name;var o=t.value;if(xN(t,n)){o=o.toLowerCase();return function(a){var s=r.getAttributeValue(a,i);return s!=null&&s.length===o.length&&s.toLowerCase()===o&&e(a)}}return function(a){return r.getAttributeValue(a,i)===o&&e(a)}},hyphen:function(e,t,n){var r=n.adapter;var i=t.name;var o=t.value;var a=o.length;if(xN(t,n)){o=o.toLowerCase();return function s(l){var u=r.getAttributeValue(l,i);return u!=null&&(u.length===a||u.charAt(a)==="-")&&u.substr(0,a).toLowerCase()===o&&e(l)}}return function s(l){var u=r.getAttributeValue(l,i);return u!=null&&(u.length===a||u.charAt(a)==="-")&&u.substr(0,a)===o&&e(l)}},element:function(e,t,n){var r=n.adapter;var i=t.name,o=t.value;if(/\s/.test(o)){return ame.default.falseFunc}var a=new RegExp("(?:^|\\s)".concat(XLt(o),"(?:$|\\s)"),xN(t,n)?"i":"");return function s(l){var u=r.getAttributeValue(l,i);return u!=null&&u.length>=o.length&&a.test(u)&&e(l)}},exists:function(e,t,n){var r=t.name;var i=n.adapter;return function(o){return i.hasAttrib(o,r)&&e(o)}},start:function(e,t,n){var r=n.adapter;var i=t.name;var o=t.value;var a=o.length;if(a===0){return ame.default.falseFunc}if(xN(t,n)){o=o.toLowerCase();return function(s){var l=r.getAttributeValue(s,i);return l!=null&&l.length>=a&&l.substr(0,a).toLowerCase()===o&&e(s)}}return function(s){var l;return!!((l=r.getAttributeValue(s,i))===null||l===void 0?void 0:l.startsWith(o))&&e(s)}},end:function(e,t,n){var r=n.adapter;var i=t.name;var o=t.value;var a=-o.length;if(a===0){return ame.default.falseFunc}if(xN(t,n)){o=o.toLowerCase();return function(s){var l;return((l=r.getAttributeValue(s,i))===null||l===void 0?void 0:l.substr(a).toLowerCase())===o&&e(s)}}return function(s){var l;return!!((l=r.getAttributeValue(s,i))===null||l===void 0?void 0:l.endsWith(o))&&e(s)}},any:function(e,t,n){var r=n.adapter;var i=t.name,o=t.value;if(o===""){return ame.default.falseFunc}if(xN(t,n)){var a=new RegExp(XLt(o),"i");return function s(l){var u=r.getAttributeValue(l,i);return u!=null&&u.length>=o.length&&a.test(u)&&e(l)}}return function(s){var l;return!!((l=r.getAttributeValue(s,i))===null||l===void 0?void 0:l.includes(o))&&e(s)}},not:function(e,t,n){var r=n.adapter;var i=t.name;var o=t.value;if(o===""){return function(a){return!!r.getAttributeValue(a,i)&&e(a)}}else if(xN(t,n)){o=o.toLowerCase();return function(a){var s=r.getAttributeValue(a,i);return(s==null||s.length!==o.length||s.toLowerCase()!==o)&&e(a)}}return function(a){return r.getAttributeValue(a,i)!==o&&e(a)}}}});var ZLt=_r(sme=>{"use strict";Object.defineProperty(sme,"__esModule",{value:true});sme.parse=void 0;var Skr=new Set([9,10,12,13,32]);var KLt="0".charCodeAt(0);var Akr="9".charCodeAt(0);function kkr(e){e=e.trim().toLowerCase();if(e==="even"){return[2,0]}else if(e==="odd"){return[2,1]}var t=0;var n=0;var r=o();var i=a();if(t=KLt&&e.charCodeAt(t)<=Akr){u=u*10+(e.charCodeAt(t)-KLt);t++}return t===l?null:u}function s(){while(t{"use strict";var Rkr=i3&&i3.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(i3,"__esModule",{value:true});i3.generate=i3.compile=void 0;var JLt=Rkr(bN());function Pkr(e){var t=e[0];var n=e[1]-1;if(n<0&&t<=0)return JLt.default.falseFunc;if(t===-1)return function(o){return o<=n};if(t===0)return function(o){return o===n};if(t===1)return n<0?JLt.default.trueFunc:function(o){return o>=n};var r=Math.abs(t);var i=(n%r+r)%r;return t>1?function(o){return o>=n&&o%r===i}:function(o){return o<=n&&o%r===i}}i3.compile=Pkr;function Ikr(e){var t=e[0];var n=e[1]-1;var r=0;if(t<0){var i=-t;var o=(n%i+i)%i;return function(){var a=o+i*r++;return a>n?null:a}}if(t===0)return n<0?function(){return null}:function(){return r++===0?n:null};if(n<0){n+=t*Math.ceil(-n/t)}return function(){return t*r+++n}}i3.generate=Ikr});var eDt=_r(RT=>{"use strict";Object.defineProperty(RT,"__esModule",{value:true});RT.sequence=RT.generate=RT.compile=RT.parse=void 0;var x8e=ZLt();Object.defineProperty(RT,"parse",{enumerable:true,get:function(){return x8e.parse}});var lme=QLt();Object.defineProperty(RT,"compile",{enumerable:true,get:function(){return lme.compile}});Object.defineProperty(RT,"generate",{enumerable:true,get:function(){return lme.generate}});function Mkr(e){return(0,lme.compile)((0,x8e.parse)(e))}RT.default=Mkr;function Lkr(e){return(0,lme.generate)((0,x8e.parse)(e))}RT.sequence=Lkr});var nDt=_r(vN=>{"use strict";var tDt=vN&&vN.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(vN,"__esModule",{value:true});vN.filters=void 0;var cme=tDt(eDt());var v1=tDt(bN());function ume(e,t){return function(n){var r=t.getParent(n);return r!=null&&t.isTag(r)&&e(n)}}vN.filters={contains:function(e,t,n){var r=n.adapter;return function i(o){return e(o)&&r.getText(o).includes(t)}},icontains:function(e,t,n){var r=n.adapter;var i=t.toLowerCase();return function o(a){return e(a)&&r.getText(a).toLowerCase().includes(i)}},"nth-child":function(e,t,n){var r=n.adapter,i=n.equals;var o=(0,cme.default)(t);if(o===v1.default.falseFunc)return v1.default.falseFunc;if(o===v1.default.trueFunc)return ume(e,r);return function a(s){var l=r.getSiblings(s);var u=0;for(var d=0;d=0;d--){if(i(s,l[d]))break;if(r.isTag(l[d])){u++}}return o(u)&&e(s)}},"nth-of-type":function(e,t,n){var r=n.adapter,i=n.equals;var o=(0,cme.default)(t);if(o===v1.default.falseFunc)return v1.default.falseFunc;if(o===v1.default.trueFunc)return ume(e,r);return function a(s){var l=r.getSiblings(s);var u=0;for(var d=0;d=0;d--){var f=l[d];if(i(s,f))break;if(r.isTag(f)&&r.getName(f)===r.getName(s)){u++}}return o(u)&&e(s)}},root:function(e,t,n){var r=n.adapter;return function(i){var o=r.getParent(i);return(o==null||!r.isTag(o))&&e(i)}},scope:function(e,t,n,r){var i=n.equals;if(!r||r.length===0){return vN.filters["root"](e,t,n)}if(r.length===1){return function(o){return i(r[0],o)&&e(o)}}return function(o){return r.includes(o)&&e(o)}},hover:v8e("isHovered"),visited:v8e("isVisited"),active:v8e("isActive")};function v8e(e){return function t(n,r,i){var o=i.adapter;var a=o[e];if(typeof a!=="function"){return v1.default.falseFunc}return function s(l){return a(l)&&n(l)}}}});var rDt=_r(Iz=>{"use strict";Object.defineProperty(Iz,"__esModule",{value:true});Iz.verifyPseudoArgs=Iz.pseudos=void 0;Iz.pseudos={empty:function(e,t){var n=t.adapter;return!n.getChildren(e).some(function(r){return n.isTag(r)||n.getText(r)!==""})},"first-child":function(e,t){var n=t.adapter,r=t.equals;if(n.prevElementSibling){return n.prevElementSibling(e)==null}var i=n.getSiblings(e).find(function(o){return n.isTag(o)});return i!=null&&r(e,i)},"last-child":function(e,t){var n=t.adapter,r=t.equals;var i=n.getSiblings(e);for(var o=i.length-1;o>=0;o--){if(r(e,i[o]))return true;if(n.isTag(i[o]))break}return false},"first-of-type":function(e,t){var n=t.adapter,r=t.equals;var i=n.getSiblings(e);var o=n.getName(e);for(var a=0;a=0;a--){var s=i[a];if(r(e,s))return true;if(n.isTag(s)&&n.getName(s)===o){break}}return false},"only-of-type":function(e,t){var n=t.adapter,r=t.equals;var i=n.getName(e);return n.getSiblings(e).every(function(o){return r(e,o)||!n.isTag(o)||n.getName(o)!==i})},"only-child":function(e,t){var n=t.adapter,r=t.equals;return n.getSiblings(e).every(function(i){return r(e,i)||!n.isTag(i)})}};function Dkr(e,t,n,r){if(n===null){if(e.length>r){throw new Error("Pseudo-class :".concat(t," requires an argument"))}}else if(e.length===r){throw new Error("Pseudo-class :".concat(t," doesn't have any arguments"))}}Iz.verifyPseudoArgs=Dkr});var iDt=_r(dme=>{"use strict";Object.defineProperty(dme,"__esModule",{value:true});dme.aliases=void 0;dme.aliases={"any-link":":is(a, area, link)[href]",link:":any-link:not(:visited)",disabled:":is(\n :is(button, input, select, textarea, optgroup, option)[disabled],\n optgroup[disabled] > option,\n fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *)\n )",enabled:":not(:disabled)",checked:":is(:is(input[type=radio], input[type=checkbox])[checked], option:selected)",required:":is(input, select, textarea)[required]",optional:":is(input, select, textarea):not([required])",selected:"option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)",checkbox:"[type=checkbox]",file:"[type=file]",password:"[type=password]",radio:"[type=radio]",reset:"[type=reset]",image:"[type=image]",submit:"[type=submit]",parent:":not(:empty)",header:":is(h1, h2, h3, h4, h5, h6)",button:":is(button, input[type=button])",input:":is(input, textarea, select, button)",text:"input:is(:not([type!='']), [type=text])"}});var fme=_r(C0=>{"use strict";var oDt=C0&&C0.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r{"use strict";Object.defineProperty(bE,"__esModule",{value:true});bE.compilePseudoSelector=bE.aliases=bE.pseudos=bE.filters=void 0;var Okr=YX();var E8e=nDt();Object.defineProperty(bE,"filters",{enumerable:true,get:function(){return E8e.filters}});var XX=rDt();Object.defineProperty(bE,"pseudos",{enumerable:true,get:function(){return XX.pseudos}});var lDt=iDt();Object.defineProperty(bE,"aliases",{enumerable:true,get:function(){return lDt.aliases}});var w8e=fme();function Bkr(e,t,n,r,i){var o;var a=t.name,s=t.data;if(Array.isArray(s)){if(!(a in w8e.subselects)){throw new Error("Unknown pseudo-class :".concat(a,"(").concat(s,")"))}return w8e.subselects[a](e,s,n,r,i)}var l=(o=n.pseudos)===null||o===void 0?void 0:o[a];var u=typeof l==="string"?l:lDt.aliases[a];if(typeof u==="string"){if(s!=null){throw new Error("Pseudo ".concat(a," doesn't have any arguments"))}var d=(0,Okr.parse)(u);return w8e.subselects["is"](e,d,n,r,i)}if(typeof l==="function"){(0,XX.verifyPseudoArgs)(l,a,s,1);return function(h){return l(h,s)&&e(h)}}if(a in E8e.filters){return E8e.filters[a](e,s,n,r)}if(a in XX.pseudos){var f=XX.pseudos[a];(0,XX.verifyPseudoArgs)(f,a,s,2);return function(h){return f(h,n,s)&&e(h)}}throw new Error("Unknown pseudo-class :".concat(a))}bE.compilePseudoSelector=Bkr});var cDt=_r(hme=>{"use strict";Object.defineProperty(hme,"__esModule",{value:true});hme.compileGeneralSelector=void 0;var zkr=jLt();var Ukr=C8e();var IT=YX();function S8e(e,t){var n=t.getParent(e);if(n&&t.isTag(n)){return n}return null}function Vkr(e,t,n,r,i){var o=n.adapter,a=n.equals;switch(t.type){case IT.SelectorType.PseudoElement:{throw new Error("Pseudo-elements are not supported by css-select")}case IT.SelectorType.ColumnCombinator:{throw new Error("Column combinators are not yet supported by css-select")}case IT.SelectorType.Attribute:{if(t.namespace!=null){throw new Error("Namespaced attributes are not yet supported by css-select")}if(!n.xmlMode||n.lowerCaseAttributeNames){t.name=t.name.toLowerCase()}return zkr.attributeRules[t.action](e,t,n)}case IT.SelectorType.Pseudo:{return(0,Ukr.compilePseudoSelector)(e,t,n,r,i)}case IT.SelectorType.Tag:{if(t.namespace!=null){throw new Error("Namespaced tag names are not yet supported by css-select")}var s=t.name;if(!n.xmlMode||n.lowerCaseTags){s=s.toLowerCase()}return function u(d){return o.getName(d)===s&&e(d)}}case IT.SelectorType.Descendant:{if(n.cacheResults===false||typeof WeakSet==="undefined"){return function u(d){var f=d;while(f=S8e(f,o)){if(e(f)){return true}}return false}}var l=new WeakSet;return function u(d){var f=d;while(f=S8e(f,o)){if(!l.has(f)){if(o.isTag(f)&&e(f)){return true}l.add(f)}}return false}}case"_flexibleDescendant":{return function u(d){var f=d;do{if(e(f))return true}while(f=S8e(f,o));return false}}case IT.SelectorType.Parent:{return function u(d){return o.getChildren(d).some(function(f){return o.isTag(f)&&e(f)})}}case IT.SelectorType.Child:{return function u(d){var f=o.getParent(d);return f!=null&&o.isTag(f)&&e(f)}}case IT.SelectorType.Sibling:{return function u(d){var f=o.getSiblings(d);for(var h=0;h{"use strict";var $kr=xy&&xy.__createBinding||(Object.create?function(e,t,n,r){if(r===void 0)r=n;var i=Object.getOwnPropertyDescriptor(t,n);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,r,i)}:function(e,t,n,r){if(r===void 0)r=n;e[r]=t[n]});var Gkr=xy&&xy.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var Hkr=xy&&xy.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null){for(var n in e)if(n!=="default"&&Object.prototype.hasOwnProperty.call(e,n))$kr(t,e,n)}Gkr(t,e);return t};var Wkr=xy&&xy.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(xy,"__esModule",{value:true});xy.compileToken=xy.compileUnsafe=xy.compile=void 0;var HA=YX();var o3=Wkr(bN());var A8e=Hkr(b8e());var Ykr=cDt();var uDt=fme();function qkr(e,t,n){var r=dDt(e,t,n);return(0,uDt.ensureIsTag)(r,t.adapter)}xy.compile=qkr;function dDt(e,t,n){var r=typeof e==="string"?(0,HA.parse)(e):e;return k8e(r,t,n)}xy.compileUnsafe=dDt;function fDt(e){return e.type===HA.SelectorType.Pseudo&&(e.name==="scope"||Array.isArray(e.data)&&e.data.some(function(t){return t.some(fDt)}))}var Xkr={type:HA.SelectorType.Descendant};var jkr={type:"_flexibleDescendant"};var Kkr={type:HA.SelectorType.Pseudo,name:"scope",data:null};function Zkr(e,t,n){var r=t.adapter;var i=!!(n===null||n===void 0?void 0:n.every(function(l){var u=r.isTag(l)&&r.getParent(l);return l===uDt.PLACEHOLDER_ELEMENT||u&&r.isTag(u)}));for(var o=0,a=e;o0&&(0,A8e.isTraversal)(s[0])&&s[0].type!==HA.SelectorType.Descendant){}else if(i&&!s.some(fDt)){s.unshift(Xkr)}else{continue}s.unshift(Kkr)}}function k8e(e,t,n){var r;e.forEach(A8e.default);n=(r=t.context)!==null&&r!==void 0?r:n;var i=Array.isArray(n);var o=n&&(Array.isArray(n)?n:[n]);if(t.relativeSelector!==false){Zkr(e,t,o)}else if(e.some(function(l){return l.length>0&&(0,A8e.isTraversal)(l[0])})){throw new Error("Relative selectors are not allowed when the `relativeSelector` option is disabled")}var a=false;var s=e.map(function(l){if(l.length>=2){var u=l[0],d=l[1];if(u.type!==HA.SelectorType.Pseudo||u.name!=="scope"){}else if(i&&d.type===HA.SelectorType.Descendant){l[1]=jkr}else if(d.type===HA.SelectorType.Adjacent||d.type===HA.SelectorType.Sibling){a=true}}return Jkr(l,t,o)}).reduce(Qkr,o3.default.falseFunc);s.shouldTestNextSiblings=a;return s}xy.compileToken=k8e;function Jkr(e,t,n){var r;return e.reduce(function(i,o){return i===o3.default.falseFunc?o3.default.falseFunc:(0,Ykr.compileGeneralSelector)(i,o,t,n,k8e)},(r=t.rootFunc)!==null&&r!==void 0?r:o3.default.trueFunc)}function Qkr(e,t){if(t===o3.default.falseFunc||e===o3.default.trueFunc){return e}if(e===o3.default.falseFunc||t===o3.default.trueFunc){return t}return function n(r){return e(r)||t(r)}}});var xDt=_r(Tc=>{"use strict";var eRr=Tc&&Tc.__createBinding||(Object.create?function(e,t,n,r){if(r===void 0)r=n;var i=Object.getOwnPropertyDescriptor(t,n);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,r,i)}:function(e,t,n,r){if(r===void 0)r=n;e[r]=t[n]});var tRr=Tc&&Tc.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var nRr=Tc&&Tc.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null){for(var n in e)if(n!=="default"&&Object.prototype.hasOwnProperty.call(e,n))eRr(t,e,n)}tRr(t,e);return t};var rRr=Tc&&Tc.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(Tc,"__esModule",{value:true});Tc.aliases=Tc.pseudos=Tc.filters=Tc.is=Tc.selectOne=Tc.selectAll=Tc.prepareContext=Tc._compileToken=Tc._compileUnsafe=Tc.compile=void 0;var pDt=nRr(ILt());var mDt=rRr(bN());var jX=hDt();var iRr=fme();var gDt=function(e,t){return e===t};var oRr={adapter:pDt,equals:gDt};function R8e(e){var t,n,r,i;var o=e!==null&&e!==void 0?e:oRr;(t=o.adapter)!==null&&t!==void 0?t:o.adapter=pDt;(n=o.equals)!==null&&n!==void 0?n:o.equals=(i=(r=o.adapter)===null||r===void 0?void 0:r.equals)!==null&&i!==void 0?i:gDt;return o}function P8e(e){return function t(n,r,i){var o=R8e(r);return e(n,o,i)}}Tc.compile=P8e(jX.compile);Tc._compileUnsafe=P8e(jX.compileUnsafe);Tc._compileToken=P8e(jX.compileToken);function yDt(e){return function t(n,r,i){var o=R8e(i);if(typeof n!=="function"){n=(0,jX.compileUnsafe)(n,o,r)}var a=bDt(r,o.adapter,n.shouldTestNextSiblings);return e(n,a,o)}}function bDt(e,t,n){if(n===void 0){n=false}if(n){e=aRr(e,t)}return Array.isArray(e)?t.removeSubsets(e):t.getChildren(e)}Tc.prepareContext=bDt;function aRr(e,t){var n=Array.isArray(e)?e.slice(0):[e];var r=n.length;for(var i=0;i{"use strict";Object.defineProperty(M8e,"__esModule",{value:true});function lRr(e){return e[e.length-1]}M8e.default=lRr});var CDt=_r(KX=>{"use strict";var cRr=KX&&KX.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(KX,"__esModule",{value:true});var uRr=cRr(Tz());function pme(e){return e&&e.nodeType===uRr.default.ELEMENT_NODE}function _Dt(e,t){return pme(e)?e.getAttribute(t):void 0}function dRr(e){return(e&&e.rawTagName||"").toLowerCase()}function ZX(e){return e&&e.childNodes}function L8e(e){return e?e.parentNode:null}function fRr(e){return e.text}function hRr(e){let t=e.length;let n;let r;let i;while(--t>-1){n=r=e[t];e[t]=null;i=true;while(r){if(e.indexOf(r)>-1){i=false;e.splice(t,1);break}r=L8e(r)}if(i){e[t]=n}}return e}function TDt(e,t){return t.some(n=>{return pme(n)?e(n)||TDt(e,ZX(n)):false})}function pRr(e){const t=L8e(e);return t?ZX(t):[]}function mRr(e,t){return _Dt(e,t)!==void 0}function wDt(e,t){let n=null;for(let r=0,i=t===null||t===void 0?void 0:t.length;r0){n=wDt(e,a)}}}return n}function EDt(e,t){let n=[];for(let r=0,i=t.length;r{"use strict";Object.defineProperty(F8e,"__esModule",{value:true});var D8e=class{constructor(t=false,n){this.addClosingSlash=t;if(Array.isArray(n)){this.voidTags=n.reduce((r,i)=>{return r.add(i.toLowerCase()).add(i.toUpperCase()).add(i)},new Set)}else{this.voidTags=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"].reduce((r,i)=>{return r.add(i.toLowerCase()).add(i.toUpperCase()).add(i)},new Set)}}formatNode(t,n,r){const i=this.addClosingSlash;const o=i&&n&&!n.endsWith(" ")?" ":"";const a=i?`${o}/`:"";return this.isVoidElement(t.toLowerCase())?`<${t}${n}${a}>`:`<${t}${n}>${r}`}isVoidElement(t){return this.voidTags.has(t)}};F8e.default=D8e});var O8e=_r(JX=>{"use strict";var kDt=JX&&JX.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(JX,"__esModule",{value:true});var gRr=Ype();var yRr=kDt(NX());var bRr=kDt(Tz());var N8e=class e extends yRr.default{clone(){return new e(this._rawText,null)}constructor(t,n=null,r){super(n,r);this.nodeType=bRr.default.TEXT_NODE;this.rawTagName="";this._rawText=t}get rawText(){return this._rawText}set rawText(t){this._rawText=t;this._trimmedRawText=void 0;this._trimmedText=void 0}get trimmedRawText(){if(this._trimmedRawText!==void 0)return this._trimmedRawText;this._trimmedRawText=ADt(this.rawText);return this._trimmedRawText}get trimmedText(){if(this._trimmedText!==void 0)return this._trimmedText;this._trimmedText=ADt(this.text);return this._trimmedText}get text(){return(0,gRr.decode)(this.rawText)}get isWhitespace(){return/^(\s| )*$/.test(this.rawText)}toString(){return this.rawText}};JX.default=N8e;function ADt(e){let t=0;let n;let r;while(t>=0&&t0&&/[^\S\r\n]/.test(e[n-1]);const o=r{"use strict";var s3=YA&&YA.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(YA,"__esModule",{value:true});YA.parse=YA.base_parse=void 0;var mme=xDt();var xRr=s3(Ype());var a3=s3(vDt());var gme=s3(CDt());var MDt=s3(SDt());var vRr=s3(W6e());var B8e=s3(NX());var _N=s3(O8e());var xE=s3(Tz());function QX(e){return JSON.parse(JSON.stringify(xRr.default.decode(e)))}var _Rr=["h1","h2","h3","h4","h5","h6","header","hgroup"];var TRr=["details","dialog","dd","div","dt"];var wRr=["fieldset","figcaption","figure","footer","form"];var ERr=["table","td","tr"];var CRr=["address","article","aside","blockquote","br","hr","li","main","nav","ol","p","pre","section","ul"];var z8e=new Set;function SRr(...e){const t=n=>{for(let r=0;rnull){this._set=new Set(t);this._afterUpdate=n}add(t){this._validate(t);this._set.add(t);this._afterUpdate(this)}replace(t,n){this._validate(n);this._set.delete(t);this._set.add(n);this._afterUpdate(this)}remove(t){this._set.delete(t)&&this._afterUpdate(this)}toggle(t){this._validate(t);if(this._set.has(t))this._set.delete(t);else this._set.add(t);this._afterUpdate(this)}contains(t){return this._set.has(t)}get length(){return this._set.size}values(){return this._set.values()}get value(){return Array.from(this._set.values())}toString(){return Array.from(this._set.values()).join(" ")}};var tj=class e extends B8e.default{quoteAttribute(t){if(t==null){return"null"}return JSON.stringify(t.replace(/"/g,""")).replace(/\\t/g," ").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\/g,"")}constructor(t,n,r="",i=null,o,a=new MDt.default,s={}){super(i,o);this.rawAttrs=r;this.voidTag=a;this.nodeType=xE.default.ELEMENT_NODE;this.rawTagName=t;this.rawAttrs=r||"";this._id=n.id||"";this.childNodes=[];this._parseOptions=s;this.classList=new U8e(n.class?n.class.split(/\s+/):[],l=>this.setAttribute("class",l.toString()));if(n.id){if(!r){this.rawAttrs=`id="${n.id}"`}}if(n.class){if(!r){const l=`class="${this.classList.toString()}"`;if(this.rawAttrs){this.rawAttrs+=` ${l}`}else{this.rawAttrs=l}}}}removeChild(t){this.childNodes=this.childNodes.filter(n=>{return n!==t});return this}exchangeChild(t,n){const r=this.childNodes;this.childNodes=r.map(i=>{if(i===t){return n}return i});return this}get tagName(){return this.rawTagName?this.rawTagName.toUpperCase():this.rawTagName}set tagName(t){this.rawTagName=t.toLowerCase()}get localName(){return this.rawTagName.toLowerCase()}get isVoidElement(){return this.voidTag.isVoidElement(this.localName)}get id(){return this._id}set id(t){this.setAttribute("id",t)}get rawText(){if(/^br$/i.test(this.rawTagName)){return"\n"}return this.childNodes.reduce((t,n)=>{return t+=n.rawText},"")}get textContent(){return QX(this.rawText)}set textContent(t){const n=[new _N.default(t,this)];this.childNodes=n}get text(){return QX(this.rawText)}get structuredText(){let t=[];const n=[t];function r(i){if(i.nodeType===xE.default.ELEMENT_NODE){if(z8e.has(i.rawTagName)){if(t.length>0){n.push(t=[])}i.childNodes.forEach(r);if(t.length>0){n.push(t=[])}}else{i.childNodes.forEach(r)}}else if(i.nodeType===xE.default.TEXT_NODE){if(i.isWhitespace){t.prependWhitespace=true}else{let o=i.trimmedText;if(t.prependWhitespace){o=` ${o}`;t.prependWhitespace=false}t.push(o)}}}r(this);return n.map(i=>{return i.join("").replace(/\s{2,}/g," ")}).join("\n").replace(/\s+$/,"")}toString(){const t=this.rawTagName;if(t){const n=this.rawAttrs?` ${this.rawAttrs}`:"";return this.voidTag.formatNode(t,n,this.innerHTML)}return this.innerHTML}get innerHTML(){return this.childNodes.map(t=>{return t.toString()}).join("")}set innerHTML(t){const n=Mz(t,this._parseOptions);const r=n.childNodes.length?n.childNodes:[new _N.default(t,this)];vE(r,this);vE(this.childNodes,null);this.childNodes=r}set_content(t,n={}){if(t instanceof B8e.default){t=[t]}else if(typeof t=="string"){n=Object.assign(Object.assign({},this._parseOptions),n);const r=Mz(t,n);t=r.childNodes.length?r.childNodes:[new _N.default(r.innerHTML,this)]}vE(this.childNodes,null);vE(t,this);this.childNodes=t;return this}replaceWith(...t){const n=this.parentNode;const r=t.map(o=>{if(o instanceof B8e.default){return[o]}else if(typeof o=="string"){const a=Mz(o,this._parseOptions);return a.childNodes.length?a.childNodes:[new _N.default(o,this)]}return[]}).flat();const i=n.childNodes.findIndex(o=>{return o===this});vE([this],null);n.childNodes=[...n.childNodes.slice(0,i),...vE(r,n),...n.childNodes.slice(i+1)];return this}get outerHTML(){return this.toString()}trimRight(t){for(let n=0;n-1){r.rawText=r.rawText.substr(0,i);this.childNodes.length=n+1}}}return this}get structure(){const t=[];let n=0;function r(o){t.push(" ".repeat(n)+o)}function i(o){const a=o._id?`#${o._id}`:"";const s=o.classList.length?`.${o.classList.value.join(".")}`:"";r(`${o.rawTagName}${a}${s}`);n++;o.childNodes.forEach(l=>{if(l.nodeType===xE.default.ELEMENT_NODE){i(l)}else if(l.nodeType===xE.default.TEXT_NODE){if(!l.isWhitespace){r("#text")}}});n--}i(this);return t.join("\n")}removeWhitespace(){let t=0;this.childNodes.forEach(r=>{if(r.nodeType===xE.default.TEXT_NODE){if(r.isWhitespace){return}r.rawText=r.trimmedRawText}else if(r.nodeType===xE.default.ELEMENT_NODE){r.removeWhitespace()}this.childNodes[t++]=r});this.childNodes.length=t;const n=Object.keys(this.rawAttributes).map(r=>{const i=this.rawAttributes[r];return`${r}=${JSON.stringify(i)}`}).join(" ");this.rawAttrs=n;delete this._rawAttrs;return this}querySelectorAll(t){return(0,mme.selectAll)(t,this,{xmlMode:true,adapter:gme.default})}querySelector(t){return(0,mme.selectOne)(t,this,{xmlMode:true,adapter:gme.default})}matches(t){return(0,mme.is)(this,t,{xmlMode:true,adapter:gme.default})}getElementsByTagName(t){const n=t.toUpperCase();const r=[];const i=[];let o=this;let a=0;while(a!==void 0){let s;do{s=o.childNodes[a++]}while(a0){i.push(a);o=s;a=0}}}return r}getElementById(t){const n=[];let r=this;let i=0;while(i!==void 0){let o;do{o=r.childNodes[i++]}while(i0){n.push(i);r=o;i=0}}}return null}closest(t){const n=new Map;let r=this;let i=null;function o(a,s){let l=null;for(let u=0,d=s.length;u{const i=this.quoteAttribute(n[r]);if(i==="null"||i==='""')return r;return`${r}=${i}`}).join(" ");if(t==="id"){this._id=""}return this}hasAttribute(t){return t.toLowerCase()in this.attrs}getAttribute(t){return this.attrs[t.toLowerCase()]}setAttribute(t,n){if(arguments.length<2){throw new Error("Failed to execute 'setAttribute' on 'Element'")}const r=t.toLowerCase();const i=this.rawAttributes;for(const o in i){if(o.toLowerCase()===r){t=o;break}}i[t]=String(n);if(this._attrs){this._attrs[r]=QX(i[t])}this.rawAttrs=Object.keys(i).map(o=>{const a=this.quoteAttribute(i[o]);if(a==="null"||a==='""')return o;return`${o}=${a}`}).join(" ");if(t==="id"){this._id=n}return this}setAttributes(t){if(this._attrs){delete this._attrs}if(this._rawAttrs){delete this._rawAttrs}this.rawAttrs=Object.keys(t).map(n=>{const r=t[n];if(r==="null"||r==='""')return n;return`${n}=${this.quoteAttribute(String(r))}`}).join(" ");if("id"in t){this._id=t["id"]}return this}insertAdjacentHTML(t,n){if(arguments.length<2){throw new Error("2 arguments required")}const r=Mz(n,this._parseOptions);if(t==="afterend"){this.after(...r.childNodes)}else if(t==="afterbegin"){this.prepend(...r.childNodes)}else if(t==="beforeend"){this.append(...r.childNodes)}else if(t==="beforebegin"){this.before(...r.childNodes)}else{throw new Error(`The value provided ('${t}') is not one of 'beforebegin', 'afterbegin', 'beforeend', or 'afterend'`)}return this}prepend(...t){const n=yme(t);vE(n,this);this.childNodes.unshift(...n)}append(...t){const n=yme(t);vE(n,this);this.childNodes.push(...n)}before(...t){const n=yme(t);const r=this.parentNode.childNodes;vE(n,this.parentNode);r.splice(r.indexOf(this),0,...n)}after(...t){const n=yme(t);const r=this.parentNode.childNodes;vE(n,this.parentNode);r.splice(r.indexOf(this)+1,0,...n)}get nextSibling(){if(this.parentNode){const t=this.parentNode.childNodes;let n=0;while(n0){const r=t[--n];if(this===r)return t[n-1]||null}return null}}get previousElementSibling(){if(this.parentNode){const t=this.parentNode.childNodes;let n=t.length;let r=false;while(n>0){const i=t[--n];if(r){if(i instanceof e){return i||null}}else if(this===i){r=true}}return null}}get children(){const t=[];for(const n of this.childNodes){if(n instanceof e){t.push(n)}}return t}get firstChild(){return this.childNodes[0]}get firstElementChild(){return this.children[0]}get lastChild(){return(0,a3.default)(this.childNodes)}get lastElementChild(){return this.children[this.children.length-1]}get childElementCount(){return this.children.length}get classNames(){return this.classList.toString()}clone(){return Mz(this.toString(),this._parseOptions).firstChild}};YA.default=tj;var WA=/|<(\/?)([a-zA-Z][-.:0-9_a-zA-Z@\xB7\xC0-\xD6\xD8-\xF6\u00F8-\u03A1\u03A3-\u03D9\u03DB-\u03EF\u03F7-\u03FF\u0400-\u04FF\u0500-\u052F\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E00-\u1E9B\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2126\u212A-\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA78E\uA790-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64-\uAB65\uFB00-\uFB06\uFB13-\uFB17\uFF21-\uFF3A\uFF41-\uFF5A\x37F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]*)((?:\s+[^>]*?(?:(?:'[^']*')|(?:"[^"]*"))?)*)\s*(\/?)>/gu;var ARr=/(?:^|\s)(id|class)\s*=\s*((?:'[^']*')|(?:"[^"]*")|\S+)/gi;var RDt={li:{li:true,LI:true},LI:{li:true,LI:true},p:{p:true,div:true,P:true,DIV:true},P:{p:true,div:true,P:true,DIV:true},b:{div:true,DIV:true},B:{div:true,DIV:true},td:{td:true,th:true,TD:true,TH:true},TD:{td:true,th:true,TD:true,TH:true},th:{td:true,th:true,TD:true,TH:true},TH:{td:true,th:true,TD:true,TH:true},h1:{h1:true,H1:true},H1:{h1:true,H1:true},h2:{h2:true,H2:true},H2:{h2:true,H2:true},h3:{h3:true,H3:true},H3:{h3:true,H3:true},h4:{h4:true,H4:true},H4:{h4:true,H4:true},h5:{h5:true,H5:true},H5:{h5:true,H5:true},h6:{h6:true,H6:true},H6:{h6:true,H6:true}};var PDt={li:{ul:true,ol:true,UL:true,OL:true},LI:{ul:true,ol:true,UL:true,OL:true},a:{div:true,DIV:true},A:{div:true,DIV:true},b:{div:true,DIV:true},B:{div:true,DIV:true},i:{div:true,DIV:true},I:{div:true,DIV:true},p:{div:true,DIV:true},P:{div:true,DIV:true},td:{tr:true,table:true,TR:true,TABLE:true},TD:{tr:true,table:true,TR:true,TABLE:true},th:{tr:true,table:true,TR:true,TABLE:true},TH:{tr:true,table:true,TR:true,TABLE:true}};var IDt={p:{a:true,audio:true,del:true,ins:true,map:true,noscript:true,video:true}};var ej="documentfragmentcontainer";function LDt(e,t={}){var n,r;const i=new MDt.default((n=t===null||t===void 0?void 0:t.voidTag)===null||n===void 0?void 0:n.closingSlash,(r=t===null||t===void 0?void 0:t.voidTag)===null||r===void 0?void 0:r.tags);const o=t.blockTextElements||{script:true,noscript:true,style:true,pre:true};const a=Object.keys(o);const s=a.map(I=>new RegExp(`^${I}$`,"i"));const l=a.filter(I=>Boolean(o[I])).map(I=>new RegExp(`^${I}$`,"i"));function u(I){return l.some(N=>N.test(I))}function d(I){return s.some(N=>N.test(I))}const f=(I,N)=>[I-L,N-L];const h=new tj(null,{},"",null,[0,e.length],i,t);let m=h;const g=[h];let x=-1;let w=void 0;let _;e=`<${ej}>${e}`;const{lowerCaseTagName:C,fixNestedATags:A}=t;const P=e.length-(ej.length+2);const L=ej.length+2;while(_=WA.exec(e)){let{0:I,1:N,2:O,3:z,4:U}=_;const W=I.length;const H=WA.lastIndex-W;const $=WA.lastIndex;if(x>-1){if(x+W<$){const K=e.substring(x,H);m.appendChild(new _N.default(K,m,f(x,H)))}}x=WA.lastIndex;if(O===ej)continue;if(I[1]==="!"){if(t.comment){const K=e.substring(H+4,$-3);m.appendChild(new vRr.default(K,m,f(H,$)))}continue}if(C)O=O.toLowerCase();if(!N){const K={};for(let J;J=ARr.exec(z);){const{1:oe,2:se}=J;const re=se[0]===`'`||se[0]===`"`;K[oe.toLowerCase()]=re?se.slice(1,se.length-1):se}const X=m.rawTagName;if(!U&&!t.preserveTagNesting&&RDt[X]){if(RDt[X][O]){g.pop();m=(0,a3.default)(g)}}if(A&&(O==="a"||O==="A")){if(w!==void 0){g.splice(w);m=(0,a3.default)(g)}w=g.length}const j=WA.lastIndex;const te=j-W;m=m.appendChild(new tj(O,K,z.slice(1),null,f(te,j),i,t));g.push(m);if(d(O)){const J=``;const oe=C?e.toLocaleLowerCase().indexOf(J,WA.lastIndex):e.indexOf(J,WA.lastIndex);const se=oe===-1?P:oe;if(u(O)){const re=e.substring(j,se);if(re.length>0&&/\S/.test(re)){m.appendChild(new _N.default(re,m,f(j,se)))}}if(oe===-1){x=WA.lastIndex=e.length+1}else{x=WA.lastIndex=oe+J.length;N="/"}}}if(N||U||i.isVoidElement(O)){while(true){if(w!=null&&(O==="a"||O==="A"))w=void 0;if(m.rawTagName===O){m.range[1]=f(-1,Math.max(x,$))[1];g.pop();m=(0,a3.default)(g);break}else{const K=m.tagName;if(PDt[K]){if(PDt[K][O]){g.pop();m=(0,a3.default)(g);continue}}const X=m.rawTagName?m.rawTagName.toLowerCase():"";if(IDt[X]){const j=O.toLowerCase();if(g.length>1){const te=g[g.length-2];if(te&&te.rawTagName&&te.rawTagName.toLowerCase()===j&&!IDt[X][j]){m.range[1]=f(-1,Math.max(x,$))[1];g.pop();m=(0,a3.default)(g);continue}}}if(t.closeAllByClosing===true){let j;for(j=g.length-2;j>=0;j--){if(g[j].rawTagName===O)break}if(j>=0){while(g.length>j){m.range[1]=f(-1,Math.max(x,$))[1];g.pop();m=(0,a3.default)(g)}continue}}break}}}}return g}YA.base_parse=LDt;function Mz(e,t={}){const n=LDt(e,t);const[r]=n;while(n.length>1){const i=n.pop();const o=(0,a3.default)(n);if(i.parentNode&&i.parentNode.parentNode){if(i.parentNode===o&&i.tagName===o.tagName){if(t.parseNoneClosedTags!==true){o.removeChild(i);i.childNodes.forEach(a=>{o.parentNode.appendChild(a)});n.pop()}}else{if(t.parseNoneClosedTags!==true){o.removeChild(i);i.childNodes.forEach(a=>{o.appendChild(a)})}}}else{}}return r}YA.parse=Mz;function yme(e){return e.map(t=>{if(typeof t==="string"){return new _N.default(t)}t.remove();return t})}function vE(e,t){return e.map(n=>{n.parentNode=t;return n})}});var DDt=_r(xme=>{"use strict";Object.defineProperty(xme,"__esModule",{value:true});xme.default=void 0;var kRr=bme();Object.defineProperty(xme,"default",{enumerable:true,get:function(){return kRr.parse}})});var FDt=_r(V8e=>{"use strict";Object.defineProperty(V8e,"__esModule",{value:true});var RRr=bme();function PRr(e,t={}){const n=(0,RRr.base_parse)(e,t);return Boolean(n.length===1)}V8e.default=PRr});var vme=_r(vp=>{"use strict";var TN=vp&&vp.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(vp,"__esModule",{value:true});vp.NodeType=vp.TextNode=vp.Node=vp.valid=vp.CommentNode=vp.HTMLElement=vp.parse=void 0;var NDt=TN(W6e());vp.CommentNode=NDt.default;var ODt=TN(bme());vp.HTMLElement=ODt.default;var BDt=TN(NX());vp.Node=BDt.default;var zDt=TN(O8e());vp.TextNode=zDt.default;var UDt=TN(Tz());vp.NodeType=UDt.default;var VDt=TN(DDt());var $Dt=TN(FDt());vp.valid=$Dt.default;function qA(e,t={}){return(0,VDt.default)(e,t)}vp.default=qA;vp.parse=qA;qA.parse=VDt.default;qA.HTMLElement=ODt.default;qA.CommentNode=NDt.default;qA.valid=$Dt.default;qA.Node=BDt.default;qA.TextNode=zDt.default;qA.NodeType=UDt.default});var _3=_r((z5o,J7e)=>{var iOt={};var ADr=function e(t){t.version="0.11.2";function n(he){var ve="",ge=he.length-1;while(ge>=0)ve+=he.charAt(ge--);return ve}function r(he,ve){var ge="";while(ge.length=ve?ge:r("0",ve-ge.length)+ge}function o(he,ve){var ge=""+he;return ge.length>=ve?ge:r(" ",ve-ge.length)+ge}function a(he,ve){var ge=""+he;return ge.length>=ve?ge:ge+r(" ",ve-ge.length)}function s(he,ve){var ge=""+Math.round(he);return ge.length>=ve?ge:r("0",ve-ge.length)+ge}function l(he,ve){var ge=""+he;return ge.length>=ve?ge:r("0",ve-ge.length)+ge}var u=Math.pow(2,32);function d(he,ve){if(he>u||he<-u)return s(he,ve);var ge=Math.round(he);return l(ge,ve)}function f(he,ve){ve=ve||0;return he.length>=7+ve&&(he.charCodeAt(ve)|32)===103&&(he.charCodeAt(ve+1)|32)===101&&(he.charCodeAt(ve+2)|32)===110&&(he.charCodeAt(ve+3)|32)===101&&(he.charCodeAt(ve+4)|32)===114&&(he.charCodeAt(ve+5)|32)===97&&(he.charCodeAt(ve+6)|32)===108}var h=[["Sun","Sunday"],["Mon","Monday"],["Tue","Tuesday"],["Wed","Wednesday"],["Thu","Thursday"],["Fri","Friday"],["Sat","Saturday"]];var m=[["J","Jan","January"],["F","Feb","February"],["M","Mar","March"],["A","Apr","April"],["M","May","May"],["J","Jun","June"],["J","Jul","July"],["A","Aug","August"],["S","Sep","September"],["O","Oct","October"],["N","Nov","November"],["D","Dec","December"]];function g(he){he[0]="General";he[1]="0";he[2]="0.00";he[3]="#,##0";he[4]="#,##0.00";he[9]="0%";he[10]="0.00%";he[11]="0.00E+00";he[12]="# ?/?";he[13]="# ??/??";he[14]="m/d/yy";he[15]="d-mmm-yy";he[16]="d-mmm";he[17]="mmm-yy";he[18]="h:mm AM/PM";he[19]="h:mm:ss AM/PM";he[20]="h:mm";he[21]="h:mm:ss";he[22]="m/d/yy h:mm";he[37]="#,##0 ;(#,##0)";he[38]="#,##0 ;[Red](#,##0)";he[39]="#,##0.00;(#,##0.00)";he[40]="#,##0.00;[Red](#,##0.00)";he[45]="mm:ss";he[46]="[h]:mm:ss";he[47]="mmss.0";he[48]="##0.0E+0";he[49]="@";he[56]='"\u4E0A\u5348/\u4E0B\u5348 "hh"\u6642"mm"\u5206"ss"\u79D2 "'}var x={};g(x);var w=[];var _=0;for(_=5;_<=8;++_)w[_]=32+_;for(_=23;_<=26;++_)w[_]=0;for(_=27;_<=31;++_)w[_]=14;for(_=50;_<=58;++_)w[_]=14;for(_=59;_<=62;++_)w[_]=_-58;for(_=67;_<=68;++_)w[_]=_-58;for(_=72;_<=75;++_)w[_]=_-58;for(_=67;_<=68;++_)w[_]=_-57;for(_=76;_<=78;++_)w[_]=_-56;for(_=79;_<=81;++_)w[_]=_-34;var C=[];C[5]=C[63]='"$"#,##0_);\\("$"#,##0\\)';C[6]=C[64]='"$"#,##0_);[Red]\\("$"#,##0\\)';C[7]=C[65]='"$"#,##0.00_);\\("$"#,##0.00\\)';C[8]=C[66]='"$"#,##0.00_);[Red]\\("$"#,##0.00\\)';C[41]='_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)';C[42]='_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)';C[43]='_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)';C[44]='_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)';function A(he,ve,ge){var Ve=he<0?-1:1;var Le=he*Ve;var $e=0,Ee=1,tt=0;var yt=1,mt=0,ct=0;var Ge=Math.floor(Le);while(mtve){if(mt>ve){ct=yt;tt=$e}else{ct=mt;tt=Ee}}if(!ge)return[0,Ve*tt,ct];var it=Math.floor(Ve*tt/ct);return[it,Ve*tt-it*ct,ct]}function P(he,ve,ge){if(he>2958465||he<0)return null;var Ve=he|0,Le=Math.floor(86400*(he-Ve)),$e=0;var Ee=[];var tt={D:Ve,T:Le,u:86400*(he-Ve)-Le,y:0,m:0,d:0,H:0,M:0,S:0,q:0};if(Math.abs(tt.u)<1e-6)tt.u=0;if(ve&&ve.date1904)Ve+=1462;if(tt.u>.9999){tt.u=0;if(++Le==86400){tt.T=Le=0;++Ve;++tt.D}}if(Ve===60){Ee=ge?[1317,10,29]:[1900,2,29];$e=3}else if(Ve===0){Ee=ge?[1317,8,29]:[1900,1,0];$e=6}else{if(Ve>60)--Ve;var yt=new Date(1900,0,1);yt.setDate(yt.getDate()+Ve-1);Ee=[yt.getFullYear(),yt.getMonth()+1,yt.getDate()];$e=yt.getDay();if(Ve<60)$e=($e+6)%7;if(ge)$e=H(yt,Ee)}tt.y=Ee[0];tt.m=Ee[1];tt.d=Ee[2];tt.S=Le%60;Le=Math.floor(Le/60);tt.M=Le%60;Le=Math.floor(Le/60);tt.H=Le;tt.q=$e;return tt}t.parse_date_code=P;var L=new Date(1899,11,31,0,0,0);var I=L.getTime();var N=new Date(1900,2,1,0,0,0);function O(he,ve){var ge=he.getTime();if(ve)ge-=1461*24*60*60*1e3;else if(he>=N)ge+=24*60*60*1e3;return(ge-(I+(he.getTimezoneOffset()-L.getTimezoneOffset())*6e4))/(24*60*60*1e3)}function z(he){return he.toString(10)}t._general_int=z;var U=function he(){var ve=/(?:\.0*|(\.\d*[1-9])0+)$/;function ge(mt){return mt.indexOf(".")==-1?mt:mt.replace(ve,"$1")}var Ve=/(?:\.0*|(\.\d*[1-9])0+)[Ee]/;var Le=/(E[+-])(\d)$/;function $e(mt){if(mt.indexOf("E")==-1)return mt;return mt.replace(Ve,"$1E").replace(Le,"$10$2")}function Ee(mt){var ct=mt<0?12:11;var Ge=ge(mt.toFixed(12));if(Ge.length<=ct)return Ge;Ge=mt.toPrecision(10);if(Ge.length<=ct)return Ge;return mt.toExponential(5)}function tt(mt){var ct=ge(mt.toFixed(11));return ct.length>(mt<0?12:11)||ct==="0"||ct==="-0"?mt.toPrecision(6):ct}function yt(mt){var ct=Math.floor(Math.log(Math.abs(mt))*Math.LOG10E),Ge;if(ct>=-4&&ct<=-1)Ge=mt.toPrecision(10+ct);else if(Math.abs(ct)<=9)Ge=Ee(mt);else if(ct===10)Ge=mt.toFixed(10).substr(0,12);else Ge=tt(mt);return ge($e(Ge.toUpperCase()))}return yt}();t._general_num=U;function W(he,ve){switch(typeof he){case"string":return he;case"boolean":return he?"TRUE":"FALSE";case"number":return(he|0)===he?he.toString(10):U(he);case"undefined":return"";case"object":if(he==null)return"";if(he instanceof Date)return be(14,O(he,ve&&ve.date1904),ve)}throw new Error("unsupported value in General format: "+he)}t._general=W;function H(he,ve){ve[0]-=581;var ge=he.getDay();if(he<60)ge=(ge+6)%7;return ge}var $="\u0E50\u0E51\u0E52\u0E53\u0E54\u0E55\u0E56\u0E57\u0E58\u0E59".split("");function K(he,ve,ge,Ve){var Le="",$e=0,Ee=0,tt=ge.y,yt,mt=0;switch(he){case 98:tt=ge.y+543;case 121:switch(ve.length){case 1:case 2:yt=tt%100;mt=2;break;default:yt=tt%1e4;mt=4;break}break;case 109:switch(ve.length){case 1:case 2:yt=ge.m;mt=ve.length;break;case 3:return m[ge.m-1][1];case 5:return m[ge.m-1][0];default:return m[ge.m-1][2]}break;case 100:switch(ve.length){case 1:case 2:yt=ge.d;mt=ve.length;break;case 3:return h[ge.q][0];default:return h[ge.q][1]}break;case 104:switch(ve.length){case 1:case 2:yt=1+(ge.H+11)%12;mt=ve.length;break;default:throw"bad hour format: "+ve}break;case 72:switch(ve.length){case 1:case 2:yt=ge.H;mt=ve.length;break;default:throw"bad hour format: "+ve}break;case 77:switch(ve.length){case 1:case 2:yt=ge.M;mt=ve.length;break;default:throw"bad minute format: "+ve}break;case 115:if(ve!="s"&&ve!="ss"&&ve!=".0"&&ve!=".00"&&ve!=".000")throw"bad second format: "+ve;if(ge.u===0&&(ve=="s"||ve=="ss"))return i(ge.S,ve.length);if(Ve>=2)Ee=Ve===3?1e3:100;else Ee=Ve===1?10:1;$e=Math.round(Ee*(ge.S+ge.u));if($e>=60*Ee)$e=0;if(ve==="s")return $e===0?"0":""+$e/Ee;Le=i($e,2+Ve);if(ve==="ss")return Le.substr(0,2);return"."+Le.substr(2,ve.length-1);case 90:switch(ve){case"[h]":case"[hh]":yt=ge.D*24+ge.H;break;case"[m]":case"[mm]":yt=(ge.D*24+ge.H)*60+ge.M;break;case"[s]":case"[ss]":yt=((ge.D*24+ge.H)*60+ge.M)*60+Math.round(ge.S+ge.u);break;default:throw"bad abstime format: "+ve}mt=ve.length===3?1:2;break;case 101:yt=tt;mt=1;break}var ct=mt>0?i(yt,mt):"";return ct}function X(he){var ve=3;if(he.length<=ve)return he;var ge=he.length%ve,Ve=he.substr(0,ge);for(;ge!=he.length;ge+=ve)Ve+=(Ve.length>0?",":"")+he.substr(ge,ve);return Ve}var j=function he(){var ve=/%/g;function ge(Qe,ze,Me){var ye=ze.replace(ve,""),Ne=ze.length-ye.length;return j(Qe,ye,Me*Math.pow(10,2*Ne))+r("%",Ne)}function Ve(Qe,ze,Me){var ye=ze.length-1;while(ze.charCodeAt(ye-1)===44)--ye;return j(Qe,ze.substr(0,ye),Me/Math.pow(10,3*(ze.length-ye)))}function Le(Qe,ze){var Me;var ye=Qe.indexOf("E")-Qe.indexOf(".")-1;if(Qe.match(/^#+0.0E\+0$/)){if(ze==0)return"0.0E+0";else if(ze<0)return"-"+Le(Qe,-ze);var Ne=Qe.indexOf(".");if(Ne===-1)Ne=Qe.indexOf("E");var Ae=Math.floor(Math.log(ze)*Math.LOG10E)%Ne;if(Ae<0)Ae+=Ne;Me=(ze/Math.pow(10,Ae)).toPrecision(ye+1+(Ne+Ae)%Ne);if(Me.indexOf("e")===-1){var dt=Math.floor(Math.log(ze)*Math.LOG10E);if(Me.indexOf(".")===-1)Me=Me.charAt(0)+"."+Me.substr(1)+"E+"+(dt-Me.length+Ae);else Me+="E+"+(dt-Ae);while(Me.substr(0,2)==="0."){Me=Me.charAt(0)+Me.substr(2,Ne)+"."+Me.substr(2+Ne);Me=Me.replace(/^0+([1-9])/,"$1").replace(/^0+\./,"0.")}Me=Me.replace(/\+-/,"-")}Me=Me.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(Oe,Wt,kt,qt){return Wt+kt+qt.substr(0,(Ne+Ae)%Ne)+"."+qt.substr(Ae)+"E"})}else Me=ze.toExponential(ye);if(Qe.match(/E\+00$/)&&Me.match(/e[+-]\d$/))Me=Me.substr(0,Me.length-1)+"0"+Me.charAt(Me.length-1);if(Qe.match(/E\-/)&&Me.match(/e\+/))Me=Me.replace(/e\+/,"e");return Me.replace("e","E")}var $e=/# (\?+)( ?)\/( ?)(\d+)/;function Ee(Qe,ze,Me){var ye=parseInt(Qe[4],10),Ne=Math.round(ze*ye),Ae=Math.floor(Ne/ye);var dt=Ne-Ae*ye,Oe=ye;return Me+(Ae===0?"":""+Ae)+" "+(dt===0?r(" ",Qe[1].length+1+Qe[4].length):o(dt,Qe[1].length)+Qe[2]+"/"+Qe[3]+i(Oe,Qe[4].length))}function tt(Qe,ze,Me){return Me+(ze===0?"":""+ze)+r(" ",Qe[1].length+2+Qe[4].length)}var yt=/^#*0*\.([0#]+)/;var mt=/\).*[0#]/;var ct=/\(###\) ###\\?-####/;function Ge(Qe){var ze="",Me;for(var ye=0;ye!=Qe.length;++ye)switch(Me=Qe.charCodeAt(ye)){case 35:break;case 63:ze+=" ";break;case 48:ze+="0";break;default:ze+=String.fromCharCode(Me)}return ze}function it(Qe,ze){var Me=Math.pow(10,ze);return""+Math.round(Qe*Me)/Me}function bt(Qe,ze){var Me=Qe-Math.floor(Qe),ye=Math.pow(10,ze);if(ze<(""+Math.round(Me*ye)).length)return 0;return Math.round(Me*ye)}function He(Qe,ze){if(ze<(""+Math.round((Qe-Math.floor(Qe))*Math.pow(10,ze))).length){return 1}return 0}function Je(Qe){if(Qe<2147483647&&Qe>-2147483648)return""+(Qe>=0?Qe|0:Qe-1|0);return""+Math.floor(Qe)}function Te(Qe,ze,Me){if(Qe.charCodeAt(0)===40&&!ze.match(mt)){var ye=ze.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");if(Me>=0)return Te("n",ye,Me);return"("+Te("n",ye,-Me)+")"}if(ze.charCodeAt(ze.length-1)===44)return Ve(Qe,ze,Me);if(ze.indexOf("%")!==-1)return ge(Qe,ze,Me);if(ze.indexOf("E")!==-1)return Le(ze,Me);if(ze.charCodeAt(0)===36)return"$"+Te(Qe,ze.substr(ze.charAt(1)==" "?2:1),Me);var Ne;var Ae,dt,Oe,Wt=Math.abs(Me),kt=Me<0?"-":"";if(ze.match(/^00+$/))return kt+d(Wt,ze.length);if(ze.match(/^[#?]+$/)){Ne=d(Me,0);if(Ne==="0")Ne="";return Ne.length>ze.length?Ne:Ge(ze.substr(0,ze.length-Ne.length))+Ne}if(Ae=ze.match($e))return Ee(Ae,Wt,kt);if(ze.match(/^#+0+$/))return kt+d(Wt,ze.length-ze.indexOf("0"));if(Ae=ze.match(yt)){Ne=it(Me,Ae[1].length).replace(/^([^\.]+)$/,"$1."+Ge(Ae[1])).replace(/\.$/,"."+Ge(Ae[1])).replace(/\.(\d*)$/,function(Sn,Kt){return"."+Kt+r("0",Ge(Ae[1]).length-Kt.length)});return ze.indexOf("0.")!==-1?Ne:Ne.replace(/^0\./,".")}ze=ze.replace(/^#+([0.])/,"$1");if(Ae=ze.match(/^(0*)\.(#*)$/)){return kt+it(Wt,Ae[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,Ae[1].length?"0.":".")}if(Ae=ze.match(/^#{1,3},##0(\.?)$/))return kt+X(d(Wt,0));if(Ae=ze.match(/^#,##0\.([#0]*0)$/)){return Me<0?"-"+Te(Qe,ze,-Me):X(""+(Math.floor(Me)+He(Me,Ae[1].length)))+"."+i(bt(Me,Ae[1].length),Ae[1].length)}if(Ae=ze.match(/^#,#*,#0/))return Te(Qe,ze.replace(/^#,#*,/,""),Me);if(Ae=ze.match(/^([0#]+)(\\?-([0#]+))+$/)){Ne=n(Te(Qe,ze.replace(/[\\-]/g,""),Me));dt=0;return n(n(ze.replace(/\\/g,"")).replace(/[0#]/g,function(Sn){return dt=0)return qe("n",ye,Me);return"("+qe("n",ye,-Me)+")"}if(ze.charCodeAt(ze.length-1)===44)return we(Qe,ze,Me);if(ze.indexOf("%")!==-1)return Ze(Qe,ze,Me);if(ze.indexOf("E")!==-1)return Be(ze,Me);if(ze.charCodeAt(0)===36)return"$"+qe(Qe,ze.substr(ze.charAt(1)==" "?2:1),Me);var Ne;var Ae,dt,Oe,Wt=Math.abs(Me),kt=Me<0?"-":"";if(ze.match(/^00+$/))return kt+i(Wt,ze.length);if(ze.match(/^[#?]+$/)){Ne=""+Me;if(Me===0)Ne="";return Ne.length>ze.length?Ne:Ge(ze.substr(0,ze.length-Ne.length))+Ne}if(Ae=ze.match($e))return tt(Ae,Wt,kt);if(ze.match(/^#+0+$/))return kt+i(Wt,ze.length-ze.indexOf("0"));if(Ae=ze.match(yt)){Ne=(""+Me).replace(/^([^\.]+)$/,"$1."+Ge(Ae[1])).replace(/\.$/,"."+Ge(Ae[1]));Ne=Ne.replace(/\.(\d*)$/,function(Sn,Kt){return"."+Kt+r("0",Ge(Ae[1]).length-Kt.length)});return ze.indexOf("0.")!==-1?Ne:Ne.replace(/^0\./,".")}ze=ze.replace(/^#+([0.])/,"$1");if(Ae=ze.match(/^(0*)\.(#*)$/)){return kt+(""+Wt).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,Ae[1].length?"0.":".")}if(Ae=ze.match(/^#{1,3},##0(\.?)$/))return kt+X(""+Wt);if(Ae=ze.match(/^#,##0\.([#0]*0)$/)){return Me<0?"-"+qe(Qe,ze,-Me):X(""+Me)+"."+r("0",Ae[1].length)}if(Ae=ze.match(/^#,#*,#0/))return qe(Qe,ze.replace(/^#,#*,/,""),Me);if(Ae=ze.match(/^([0#]+)(\\?-([0#]+))+$/)){Ne=n(qe(Qe,ze.replace(/[\\-]/g,""),Me));dt=0;return n(n(ze.replace(/\\/g,"")).replace(/[0#]/g,function(Sn){return dt-1||ge=="\\"&&he.charAt(ve+1)=="-"&&"0#".indexOf(he.charAt(ve+2))>-1)){}break;case"?":while(he.charAt(++ve)===ge){}break;case"*":++ve;if(he.charAt(ve)==" "||he.charAt(ve)=="*")++ve;break;case"(":case")":++ve;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":while(ve-1){}break;case" ":++ve;break;default:++ve;break}}return false}t.is_date=oe;function se(he,ve,ge,Ve){var Le=[],$e="",Ee=0,tt="",yt="t",mt,ct,Ge;var it="H";while(Ee=12?"P":"A";Je.t="T";it="h";Ee+=3}else if(he.substr(Ee,5).toUpperCase()==="AM/PM"){if(mt!=null)Je.v=mt.H>=12?"PM":"AM";Je.t="T";Ee+=5;it="h"}else if(he.substr(Ee,5).toUpperCase()==="\u4E0A\u5348/\u4E0B\u5348"){if(mt!=null)Je.v=mt.H>=12?"\u4E0B\u5348":"\u4E0A\u5348";Je.t="T";Ee+=5;it="h"}else{Je.t="t";++Ee}if(mt==null&&Je.t==="T")return"";Le[Le.length]=Je;yt=tt;break;case"[":$e=tt;while(he.charAt(Ee++)!=="]"&&Ee-1){$e=($e.match(/\$([^-\[\]]*)/)||[])[1]||"$";if(!oe(he))Le[Le.length]={t:"t",v:$e}}break;case".":if(mt!=null){$e=tt;while(++Ee-1)$e+=tt;Le[Le.length]={t:"n",v:$e};break;case"?":$e=tt;while(he.charAt(++Ee)===tt)$e+=tt;Le[Le.length]={t:tt,v:$e};yt=tt;break;case"*":++Ee;if(he.charAt(Ee)==" "||he.charAt(Ee)=="*")++Ee;break;case"(":case")":Le[Le.length]={t:Ve===1?"t":tt,v:tt};++Ee;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":$e=tt;while(Ee-1)$e+=he.charAt(Ee);Le[Le.length]={t:"D",v:$e};break;case" ":Le[Le.length]={t:tt,v:tt};++Ee;break;case"$":Le[Le.length]={t:"t",v:"$"};++Ee;break;default:if(",$-+/():!^&'~{}<>=\u20ACacfijklopqrtuvwxzP".indexOf(tt)===-1)throw new Error("unrecognized character "+tt+" in "+he);Le[Le.length]={t:"t",v:tt};++Ee;break}}var Te=0,we=0,Ze;for(Ee=Le.length-1,yt="t";Ee>=0;--Ee){switch(Le[Ee].t){case"h":case"H":Le[Ee].t=it;yt="h";if(Te<1)Te=1;break;case"s":if(Ze=Le[Ee].v.match(/\.0+$/))we=Math.max(we,Ze[0].length-1);if(Te<3)Te=3;case"d":case"y":case"M":case"e":yt=Le[Ee].t;break;case"m":if(yt==="s"){Le[Ee].t="M";if(Te<2)Te=2}break;case"X":break;case"Z":if(Te<1&&Le[Ee].v.match(/[Hh]/))Te=1;if(Te<2&&Le[Ee].v.match(/[Mm]/))Te=2;if(Te<3&&Le[Ee].v.match(/[Ss]/))Te=3}}switch(Te){case 0:break;case 1:if(mt.u>=.5){mt.u=0;++mt.S}if(mt.S>=60){mt.S=0;++mt.M}if(mt.M>=60){mt.M=0;++mt.H}break;case 2:if(mt.u>=.5){mt.u=0;++mt.S}if(mt.S>=60){mt.S=0;++mt.M}break}var Be="",qe;for(Ee=0;Ee0){if(Be.charCodeAt(0)==40){ze=ve<0&&Be.charCodeAt(0)===45?-ve:ve;Me=j("n",Be,ze)}else{ze=ve<0&&Ve>1?-ve:ve;Me=j("n",Be,ze);if(ze<0&&Le[0]&&Le[0].t=="t"){Me=Me.substr(1);Le[0].v="-"+Le[0].v}}qe=Me.length-1;var ye=Le.length;for(Ee=0;Ee-1){ye=Ee;break}var Ne=Le.length;if(ye===Le.length&&Me.indexOf("E")===-1){for(Ee=Le.length-1;Ee>=0;--Ee){if(Le[Ee]==null||"n?".indexOf(Le[Ee].t)===-1)continue;if(qe>=Le[Ee].v.length-1){qe-=Le[Ee].v.length;Le[Ee].v=Me.substr(qe+1,Le[Ee].v.length)}else if(qe<0)Le[Ee].v="";else{Le[Ee].v=Me.substr(0,qe+1);qe=-1}Le[Ee].t="t";Ne=Ee}if(qe>=0&&Ne=0;--Ee){if(Le[Ee]==null||"n?".indexOf(Le[Ee].t)===-1)continue;ct=Le[Ee].v.indexOf(".")>-1&&Ee===ye?Le[Ee].v.indexOf(".")-1:Le[Ee].v.length-1;Qe=Le[Ee].v.substr(ct+1);for(;ct>=0;--ct){if(qe>=0&&(Le[Ee].v.charAt(ct)==="0"||Le[Ee].v.charAt(ct)==="#"))Qe=Me.charAt(qe--)+Qe}Le[Ee].v=Qe;Le[Ee].t="t";Ne=Ee}if(qe>=0&&Ne-1&&Ee===ye?Le[Ee].v.indexOf(".")+1:0;Qe=Le[Ee].v.substr(0,ct);for(;ct-1){ze=Ve>1&&ve<0&&Ee>0&&Le[Ee-1].v==="-"?-ve:ve;Le[Ee].v=j(Le[Ee].t,Le[Ee].v,ze);Le[Ee].t="t"}var Ae="";for(Ee=0;Ee!==Le.length;++Ee)if(Le[Ee]!=null)Ae+=Le[Ee].v;return Ae}t._eval=se;var re=/\[[=<>]/;var ce=/\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;function ue(he,ve){if(ve==null)return false;var ge=parseFloat(ve[2]);switch(ve[1]){case"=":if(he==ge)return true;break;case">":if(he>ge)return true;break;case"<":if(he":if(he!=ge)return true;break;case">=":if(he>=ge)return true;break;case"<=":if(he<=ge)return true;break}return false}function xe(he,ve){var ge=te(he);var Ve=ge.length,Le=ge[Ve-1].indexOf("@");if(Ve<4&&Le>-1)--Ve;if(ge.length>4)throw new Error("cannot find right format for |"+ge.join("|")+"|");if(typeof ve!=="number")return[4,ge.length===4||Le>-1?ge[ge.length-1]:"@"];switch(ge.length){case 1:ge=Le>-1?["General","General","General",ge[0]]:[ge[0],ge[0],ge[0],"@"];break;case 2:ge=Le>-1?[ge[0],ge[0],ge[0],ge[1]]:[ge[0],ge[1],ge[0],"@"];break;case 3:ge=Le>-1?[ge[0],ge[1],ge[0],ge[2]]:[ge[0],ge[1],ge[2],"@"];break;case 4:break}var $e=ve>0?ge[0]:ve<0?ge[1]:ge[2];if(ge[0].indexOf("[")===-1&&ge[1].indexOf("[")===-1)return[Ve,$e];if(ge[0].match(re)!=null||ge[1].match(re)!=null){var Ee=ge[0].match(ce);var tt=ge[1].match(ce);return ue(ve,Ee)?[Ve,ge[0]]:ue(ve,tt)?[Ve,ge[1]]:[Ve,ge[Ee!=null&&tt!=null?2:1]]}return[Ve,$e]}function be(he,ve,ge){if(ge==null)ge={};var Ve="";switch(typeof he){case"string":if(he=="m/d/yy"&&ge.dateNF)Ve=ge.dateNF;else Ve=he;break;case"number":if(he==14&&ge.dateNF)Ve=ge.dateNF;else Ve=(ge.table!=null?ge.table:x)[he];if(Ve==null)Ve=ge.table&&ge.table[w[he]]||x[w[he]];if(Ve==null)Ve=C[he]||"General";break}if(f(Ve,0))return W(ve,ge);if(ve instanceof Date)ve=O(ve,ge.date1904);var Le=xe(Ve,ve);if(f(Le[1]))return W(ve,ge);if(ve===true)ve="TRUE";else if(ve===false)ve="FALSE";else if(ve===""||ve==null)return"";return se(Le[1],ve,ge,Le[0])}function Ie(he,ve){if(typeof ve!="number"){ve=+ve||-1;for(var ge=0;ge<392;++ge){if(x[ge]==void 0){if(ve<0)ve=ge;continue}if(x[ge]==he){ve=ge;break}}if(ve<0)ve=391}x[ve]=he;return ve}t.load=Ie;t._table=x;t.get_table=function he(){return x};t.load_table=function he(ve){for(var ge=0;ge!=392;++ge)if(ve[ge]!==void 0)Ie(ve[ge],ge)};t.init_table=g;t.format=be};ADr(iOt);if(typeof J7e!=="undefined"&&typeof DO_NOT_EXPORT_SSF==="undefined")J7e.exports=iOt});function aBt(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function ON(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}var Vj=Ce(()=>{});function LE(e){return e=ON(Math.abs(e)),e?e[1]:NaN}var $j=Ce(()=>{Vj()});function sBt(e,t){return function(n,r){var i=n.length,o=[],a=0,s=e[0],l=0;while(i>0&&s>0){if(l+s+1>r)s=Math.max(1,r-l);o.push(n.substring(i-=s,i+s));if((l+=s+1)>r)break;s=e[a=(a+1)%e.length]}return o.reverse().join(t)}}var lBt=Ce(()=>{});function cBt(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var uBt=Ce(()=>{});function DE(e){if(!(t=bNr.exec(e)))throw new Error("invalid format: "+e);var t;return new Yye({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function Yye(e){this.fill=e.fill===void 0?" ":e.fill+"";this.align=e.align===void 0?">":e.align+"";this.sign=e.sign===void 0?"-":e.sign+"";this.symbol=e.symbol===void 0?"":e.symbol+"";this.zero=!!e.zero;this.width=e.width===void 0?void 0:+e.width;this.comma=!!e.comma;this.precision=e.precision===void 0?void 0:+e.precision;this.trim=!!e.trim;this.type=e.type===void 0?"":e.type+""}var bNr;var Fze=Ce(()=>{bNr=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;DE.prototype=Yye.prototype;Yye.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type}});function dBt(e){e:for(var t=e.length,n=1,r=-1,i;n0)r=0;break}}return r>0?e.slice(0,r)+e.slice(i+1):e}var fBt=Ce(()=>{});function hBt(e,t){var n=ON(e,t);if(!n)return Gj=void 0,e.toPrecision(t);var r=n[0],i=n[1],o=i-(Gj=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+ON(e,Math.max(0,t+o-1))[0]}var Gj;var Nze=Ce(()=>{Vj()});function Oze(e,t){var n=ON(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}var pBt=Ce(()=>{Vj()});var Bze;var mBt=Ce(()=>{Vj();Nze();pBt();Bze={"%":(e,t)=>(e*100).toFixed(t),"b":e=>Math.round(e).toString(2),"c":e=>e+"","d":aBt,"e":(e,t)=>e.toExponential(t),"f":(e,t)=>e.toFixed(t),"g":(e,t)=>e.toPrecision(t),"o":e=>Math.round(e).toString(8),"p":(e,t)=>Oze(e*100,t),"r":Oze,"s":hBt,"X":e=>Math.round(e).toString(16).toUpperCase(),"x":e=>Math.round(e).toString(16)}});function zze(e){return e}var gBt=Ce(()=>{});function Hj(e){var t=e.grouping===void 0||e.thousands===void 0?zze:sBt(yBt.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?zze:cBt(yBt.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"\u2212":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(f,h){f=DE(f);var m=f.fill,g=f.align,x=f.sign,w=f.symbol,_=f.zero,C=f.width,A=f.comma,P=f.precision,L=f.trim,I=f.type;if(I==="n")A=true,I="g";else if(!Bze[I])P===void 0&&(P=12),L=true,I="g";if(_||m==="0"&&g==="=")_=true,m="0",g="=";var N=(h&&h.prefix!==void 0?h.prefix:"")+(w==="$"?n:w==="#"&&/[boxX]/.test(I)?"0"+I.toLowerCase():""),O=(w==="$"?r:/[%p]/.test(I)?a:"")+(h&&h.suffix!==void 0?h.suffix:"");var z=Bze[I],U=/[defgprs%]/.test(I);P=P===void 0?6:/[gprs]/.test(I)?Math.max(1,Math.min(21,P)):Math.max(0,Math.min(20,P));function W(H){var $=N,K=O,X,j,te;if(I==="c"){K=z(H)+K;H=""}else{H=+H;var J=H<0||1/H<0;H=isNaN(H)?l:z(Math.abs(H),P);if(L)H=dBt(H);if(J&&+H===0&&x!=="+")J=false;$=(J?x==="("?x:s:x==="-"||x==="("?"":x)+$;K=(I==="s"&&!isNaN(H)&&Gj!==void 0?bBt[8+Gj/3]:"")+K+(J&&x==="("?")":"");if(U){X=-1,j=H.length;while(++Xte||te>57){K=(te===46?i+H.slice(X+1):H.slice(X))+K;H=H.slice(0,X);break}}}}if(A&&!_)H=t(H,Infinity);var oe=$.length+H.length+K.length,se=oe>1)+$+H+K+se.slice(oe);break;default:H=se+$+H+K;break}return o(H)}W.toString=function(){return f+""};return W}function d(f,h){var m=Math.max(-8,Math.min(8,Math.floor(LE(h)/3)))*3,g=Math.pow(10,-m),x=u((f=DE(f),f.type="f",f),{suffix:bBt[8+m/3]});return function(w){return x(g*w)}}return{format:u,formatPrefix:d}}var yBt,bBt;var Uze=Ce(()=>{$j();lBt();uBt();Fze();fBt();mBt();Nze();gBt();yBt=Array.prototype.map;bBt=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"]});function Vze(e){qye=Hj(e);Oh=qye.format;Xye=qye.formatPrefix;return qye}var qye,Oh,Xye;var xBt=Ce(()=>{Uze();Vze({thousands:",",grouping:[3],currency:["$",""]})});function $ze(e){return Math.max(0,-LE(Math.abs(e)))}var vBt=Ce(()=>{$j()});function Gze(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(LE(t)/3)))*3-LE(Math.abs(e)))}var _Bt=Ce(()=>{$j()});function Hze(e,t){e=Math.abs(e),t=Math.abs(t)-e;return Math.max(0,LE(t)-LE(e))+1}var TBt=Ce(()=>{$j()});var uk=Ce(()=>{xBt();Uze();Fze();vBt();_Bt();TBt()});function wBt(e){var t=e.length/6|0,n=new Array(t),r=0;while(r{});var Wj;var CBt=Ce(()=>{EBt();Wj=wBt("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab")});function BN(e,t,n){e.prototype=t.prototype=n;n.constructor=e}function i9(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}var Wze=Ce(()=>{});function I3(){}function ABt(){return this.rgb().formatHex()}function SNr(){return this.rgb().formatHex8()}function ANr(){return DBt(this).formatHsl()}function kBt(){return this.rgb().formatRgb()}function Kd(e){var t,n;e=(e+"").trim().toLowerCase();return(t=xNr.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?RBt(t):n===3?new hg(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?jye(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?jye(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=vNr.exec(e))?new hg(t[1],t[2],t[3],1):(t=_Nr.exec(e))?new hg(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=TNr.exec(e))?jye(t[1],t[2],t[3],t[4]):(t=wNr.exec(e))?jye(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=ENr.exec(e))?MBt(t[1],t[2]/100,t[3]/100,1):(t=CNr.exec(e))?MBt(t[1],t[2]/100,t[3]/100,t[4]):SBt.hasOwnProperty(e)?RBt(SBt[e]):e==="transparent"?new hg(NaN,NaN,NaN,0):null}function RBt(e){return new hg(e>>16&255,e>>8&255,e&255,1)}function jye(e,t,n,r){if(r<=0)e=t=n=NaN;return new hg(e,t,n,r)}function qze(e){if(!(e instanceof I3))e=Kd(e);if(!e)return new hg;e=e.rgb();return new hg(e.r,e.g,e.b,e.opacity)}function a9(e,t,n,r){return arguments.length===1?qze(e):new hg(e,t,n,r==null?1:r)}function hg(e,t,n,r){this.r=+e;this.g=+t;this.b=+n;this.opacity=+r}function PBt(){return`#${zN(this.r)}${zN(this.g)}${zN(this.b)}`}function kNr(){return`#${zN(this.r)}${zN(this.g)}${zN(this.b)}${zN((isNaN(this.opacity)?1:this.opacity)*255)}`}function IBt(){const e=Jye(this.opacity);return`${e===1?"rgb(":"rgba("}${UN(this.r)}, ${UN(this.g)}, ${UN(this.b)}${e===1?")":`, ${e})`}`}function Jye(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function UN(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function zN(e){e=UN(e);return(e<16?"0":"")+e.toString(16)}function MBt(e,t,n,r){if(r<=0)e=t=n=NaN;else if(n<=0||n>=1)e=t=NaN;else if(t<=0)e=NaN;return new UT(e,t,n,r)}function DBt(e){if(e instanceof UT)return new UT(e.h,e.s,e.l,e.opacity);if(!(e instanceof I3))e=Kd(e);if(!e)return new UT;if(e instanceof UT)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;if(s){if(t===o)a=(n-r)/s+(n0&&l<1?0:a}return new UT(a,s,l,e.opacity)}function FBt(e,t,n,r){return arguments.length===1?DBt(e):new UT(e,t,n,r==null?1:r)}function UT(e,t,n,r){this.h=+e;this.s=+t;this.l=+n;this.opacity=+r}function LBt(e){e=(e||0)%360;return e<0?e+360:e}function Kye(e){return Math.max(0,Math.min(1,e||0))}function Yze(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var Yj,Zye,o9,qj,FE,xNr,vNr,_Nr,TNr,wNr,ENr,CNr,SBt;var Xze=Ce(()=>{Wze();Yj=.7;Zye=1/Yj;o9="\\s*([+-]?\\d+)\\s*";qj="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*";FE="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*";xNr=/^#([0-9a-f]{3,8})$/;vNr=new RegExp(`^rgb\\(${o9},${o9},${o9}\\)$`);_Nr=new RegExp(`^rgb\\(${FE},${FE},${FE}\\)$`);TNr=new RegExp(`^rgba\\(${o9},${o9},${o9},${qj}\\)$`);wNr=new RegExp(`^rgba\\(${FE},${FE},${FE},${qj}\\)$`);ENr=new RegExp(`^hsl\\(${qj},${FE},${FE}\\)$`);CNr=new RegExp(`^hsla\\(${qj},${FE},${FE},${qj}\\)$`);SBt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};BN(I3,Kd,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ABt,formatHex:ABt,formatHex8:SNr,formatHsl:ANr,formatRgb:kBt,toString:kBt});BN(hg,a9,i9(I3,{brighter(e){e=e==null?Zye:Math.pow(Zye,e);return new hg(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){e=e==null?Yj:Math.pow(Yj,e);return new hg(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new hg(UN(this.r),UN(this.g),UN(this.b),Jye(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&(-.5<=this.g&&this.g<255.5)&&(-.5<=this.b&&this.b<255.5)&&(0<=this.opacity&&this.opacity<=1)},hex:PBt,formatHex:PBt,formatHex8:kNr,formatRgb:IBt,toString:IBt}));BN(UT,FBt,i9(I3,{brighter(e){e=e==null?Zye:Math.pow(Zye,e);return new UT(this.h,this.s,this.l*e,this.opacity)},darker(e){e=e==null?Yj:Math.pow(Yj,e);return new UT(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new hg(Yze(e>=240?e-240:e+120,i,r),Yze(e,i,r),Yze(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new UT(LBt(this.h),Kye(this.s),Kye(this.l),Jye(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&(0<=this.l&&this.l<=1)&&(0<=this.opacity&&this.opacity<=1)},formatHsl(){const e=Jye(this.opacity);return`${e===1?"hsl(":"hsla("}${LBt(this.h)}, ${Kye(this.s)*100}%, ${Kye(this.l)*100}%${e===1?")":`, ${e})`}`}}))});var NBt,OBt;var BBt=Ce(()=>{NBt=Math.PI/180;OBt=180/Math.PI});function HBt(e){if(e instanceof NE)return new NE(e.l,e.a,e.b,e.opacity);if(e instanceof dk)return WBt(e);if(!(e instanceof hg))e=qze(e);var t=Jze(e.r),n=Jze(e.g),r=Jze(e.b),i=jze((.2225045*t+.7168786*n+.0606169*r)/UBt),o,a;if(t===n&&n===r)o=a=i;else{o=jze((.4360747*t+.3850649*n+.1430804*r)/zBt);a=jze((.0139322*t+.0971045*n+.7141733*r)/VBt)}return new NE(116*i-16,500*(o-i),200*(i-a),e.opacity)}function Qze(e,t,n,r){return arguments.length===1?HBt(e):new NE(e,t,n,r==null?1:r)}function NE(e,t,n,r){this.l=+e;this.a=+t;this.b=+n;this.opacity=+r}function jze(e){return e>RNr?Math.pow(e,1/3):e/GBt+$Bt}function Kze(e){return e>s9?e*e*e:GBt*(e-$Bt)}function Zze(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Jze(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function PNr(e){if(e instanceof dk)return new dk(e.h,e.c,e.l,e.opacity);if(!(e instanceof NE))e=HBt(e);if(e.a===0&&e.b===0)return new dk(NaN,0{Wze();Xze();BBt();Qye=18;zBt=.96422;UBt=1;VBt=.82521;$Bt=4/29;s9=6/29;GBt=3*s9*s9;RNr=s9*s9*s9;BN(NE,Qze,i9(I3,{brighter(e){return new NE(this.l+Qye*(e==null?1:e),this.a,this.b,this.opacity)},darker(e){return new NE(this.l-Qye*(e==null?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;t=zBt*Kze(t);e=UBt*Kze(e);n=VBt*Kze(n);return new hg(Zze(3.1338561*t-1.6168667*e-.4906146*n),Zze(-.9787684*t+1.9161415*e+.033454*n),Zze(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));BN(dk,Xj,i9(I3,{brighter(e){return new dk(this.h,this.c,this.l+Qye*(e==null?1:e),this.opacity)},darker(e){return new dk(this.h,this.c,this.l-Qye*(e==null?1:e),this.opacity)},rgb(){return WBt(this).rgb()}}))});var VT=Ce(()=>{Xze();YBt()});function e9e(e,t,n,r,i){var o=e*e,a=o*e;return((1-3*e+3*o-a)*t+(4-6*o+3*a)*n+(1+3*e+3*o-3*a)*r+a*i)/6}function qBt(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),i=e[r],o=e[r+1],a=r>0?e[r-1]:2*i-o,s=r{});function XBt(e){var t=e.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*t),i=e[(r+t-1)%t],o=e[r%t],a=e[(r+1)%t],s=e[(r+2)%t];return e9e((n-r/t)*t,i,o,a,s)}}var jBt=Ce(()=>{t9e()});var l9;var n9e=Ce(()=>{l9=e=>()=>e});function KBt(e,t){return function(n){return e+n*t}}function INr(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function ZBt(e,t){var n=t-e;return n?KBt(e,n>180||n<-180?n-360*Math.round(n/360):n):l9(isNaN(e)?t:e)}function JBt(e){return(e=+e)===1?fk:function(t,n){return n-t?INr(t,n,e):l9(isNaN(t)?n:t)}}function fk(e,t){var n=t-e;return n?KBt(e,n):l9(isNaN(e)?t:e)}var r9e=Ce(()=>{n9e()});function QBt(e){return function(t){var n=t.length,r=new Array(n),i=new Array(n),o=new Array(n),a,s;for(a=0;a{VT();t9e();jBt();r9e();VN=function e(t){var n=JBt(t);function r(i,o){var a=n((i=a9(i)).r,(o=a9(o)).r),s=n(i.g,o.g),l=n(i.b,o.b),u=fk(i.opacity,o.opacity);return function(d){i.r=a(d);i.g=s(d);i.b=l(d);i.opacity=u(d);return i+""}}r.gamma=e;return r}(1);MNr=QBt(qBt);LNr=QBt(XBt)});function e6t(e,t){if(!t)t=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(o){for(i=0;i{});function r6t(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n),a;for(a=0;a{e0e()});function o6t(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}var a6t=Ce(()=>{});function pg(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var jj=Ce(()=>{});function s6t(e,t){var n={},r={},i;if(e===null||typeof e!=="object")e={};if(t===null||typeof t!=="object")t={};for(i in t){if(i in e){n[i]=$N(e[i],t[i])}else{r[i]=t[i]}}return function(o){for(i in n)r[i]=n[i](o);return r}}var l6t=Ce(()=>{e0e()});function DNr(e){return function(){return e}}function FNr(e){return function(t){return e(t)+""}}function Kj(e,t){var n=a9e.lastIndex=o9e.lastIndex=0,r,i,o,a=-1,s=[],l=[];e=e+"",t=t+"";while((r=a9e.exec(e))&&(i=o9e.exec(t))){if((o=i.index)>n){o=t.slice(n,o);if(s[a])s[a]+=o;else s[++a]=o}if((r=r[0])===(i=i[0])){if(s[a])s[a]+=i;else s[++a]=i}else{s[++a]=null;l.push({i:a,x:pg(r,i)})}n=o9e.lastIndex}if(n{jj();a9e=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;o9e=new RegExp(a9e.source,"g")});function $N(e,t){var n=typeof t,r;return t==null||n==="boolean"?l9(t):(n==="number"?pg:n==="string"?(r=Kd(t))?(t=r,VN):Kj:t instanceof Kd?VN:t instanceof Date?o6t:t6t(t)?e6t:Array.isArray(t)?r6t:typeof t.valueOf!=="function"&&typeof t.toString!=="function"||isNaN(t)?s6t:pg)(e,t)}var e0e=Ce(()=>{VT();i9e();i6t();a6t();jj();l6t();s9e();n9e();n6t()});function l9e(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var c6t=Ce(()=>{});function c9e(e,t,n,r,i,o){var a,s,l;if(a=Math.sqrt(e*e+t*t))e/=a,t/=a;if(l=e*n+t*r)n-=e*l,r-=t*l;if(s=Math.sqrt(n*n+r*r))n/=s,r/=s,l/=s;if(e*r{u6t=180/Math.PI;t0e={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1}});function f6t(e){const t=new(typeof DOMMatrix==="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?t0e:c9e(t.a,t.b,t.c,t.d,t.e,t.f)}function h6t(e){if(e==null)return t0e;if(!n0e)n0e=document.createElementNS("http://www.w3.org/2000/svg","g");n0e.setAttribute("transform",e);if(!(e=n0e.transform.baseVal.consolidate()))return t0e;e=e.matrix;return c9e(e.a,e.b,e.c,e.d,e.e,e.f)}var n0e;var p6t=Ce(()=>{d6t()});function m6t(e,t,n,r){function i(u){return u.length?u.pop()+" ":""}function o(u,d,f,h,m,g){if(u!==f||d!==h){var x=m.push("translate(",null,t,null,n);g.push({i:x-4,x:pg(u,f)},{i:x-2,x:pg(d,h)})}else if(f||h){m.push("translate("+f+t+h+n)}}function a(u,d,f,h){if(u!==d){if(u-d>180)d+=360;else if(d-u>180)u+=360;h.push({i:f.push(i(f)+"rotate(",null,r)-2,x:pg(u,d)})}else if(d){f.push(i(f)+"rotate("+d+r)}}function s(u,d,f,h){if(u!==d){h.push({i:f.push(i(f)+"skewX(",null,r)-2,x:pg(u,d)})}else if(d){f.push(i(f)+"skewX("+d+r)}}function l(u,d,f,h,m,g){if(u!==f||d!==h){var x=m.push(i(m)+"scale(",null,",",null,")");g.push({i:x-4,x:pg(u,f)},{i:x-2,x:pg(d,h)})}else if(f!==1||h!==1){m.push(i(m)+"scale("+f+","+h+")")}}return function(u,d){var f=[],h=[];u=e(u),d=e(d);o(u.translateX,u.translateY,d.translateX,d.translateY,f,h);a(u.rotate,d.rotate,f,h);s(u.skewX,d.skewX,f,h);l(u.scaleX,u.scaleY,d.scaleX,d.scaleY,f,h);u=d=null;return function(m){var g=-1,x=h.length,w;while(++g{jj();p6t();u9e=m6t(f6t,"px, ","px)","deg)");d9e=m6t(h6t,", ",")",")")});function y6t(e){return function(t,n){var r=e((t=Xj(t)).h,(n=Xj(n)).h),i=fk(t.c,n.c),o=fk(t.l,n.l),a=fk(t.opacity,n.opacity);return function(s){t.h=r(s);t.c=i(s);t.l=o(s);t.opacity=a(s);return t+""}}}var f9e,NNr;var b6t=Ce(()=>{VT();r9e();f9e=y6t(ZBt);NNr=y6t(fk)});var c9=Ce(()=>{e0e();jj();c6t();s9e();g6t();i9e();b6t()});var h9e=Ce(()=>{CBt()});function GN(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}var p9e=Ce(()=>{});function m9e(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}var _6t=Ce(()=>{});function HN(e){let t,n,r;if(e.length!==2){t=GN;n=(s,l)=>GN(e(s),l);r=(s,l)=>e(s)-l}else{t=e===GN||e===m9e?e:ONr;n=e;r=e}function i(s,l,u=0,d=s.length){if(u>>1;if(n(s[f],l)<0)u=f+1;else d=f}while(u>>1;if(n(s[f],l)<=0)u=f+1;else d=f}while(uu&&r(s[f-1],l)>-r(s[f],l)?f-1:f}return{left:i,center:a,right:o}}function ONr(){return 0}var g9e=Ce(()=>{p9e();_6t()});function Zj(e){return e===null?NaN:+e}var y9e=Ce(()=>{});var T6t,w6t,BNr,zNr,b9e;var E6t=Ce(()=>{p9e();g9e();y9e();T6t=HN(GN);w6t=T6t.right;BNr=T6t.left;zNr=HN(Zj).center;b9e=w6t});function x9e(e,t){let n=0;let r;let i=0;let o=0;if(t===void 0){for(let a of e){if(a!=null&&(a=+a)>=a){r=a-i;i+=r/++n;o+=r*(a-i)}}}else{let a=-1;for(let s of e){if((s=t(s,++a,e))!=null&&(s=+s)>=s){r=s-i;i+=r/++n;o+=r*(s-i)}}}if(n>1)return o/(n-1)}var C6t=Ce(()=>{});function o0e(e,t){const n=x9e(e,t);return n?Math.sqrt(n):n}var S6t=Ce(()=>{C6t()});function Cy(e,t){let n;let r;if(t===void 0){for(const i of e){if(i!=null){if(n===void 0){if(i>=i)n=r=i}else{if(n>i)n=i;if(r=o)n=r=o}else{if(n>o)n=o;if(r{});function k6t({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function UNr({_intern:e,_key:t},n){const r=t(n);if(e.has(r))return e.get(r);e.set(r,n);return n}function VNr({_intern:e,_key:t},n){const r=t(n);if(e.has(r)){n=e.get(r);e.delete(r)}return n}function $Nr(e){return e!==null&&typeof e==="object"?e.valueOf():e}var u9;var R6t=Ce(()=>{u9=class extends Map{constructor(t,n=$Nr){super();Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}});if(t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(k6t(this,t))}has(t){return super.has(k6t(this,t))}set(t,n){return super.set(UNr(this,t),n)}delete(t){return super.delete(VNr(this,t))}}});function a0e(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=GNr?10:o>=HNr?5:o>=WNr?2:1;let s,l,u;if(i<0){u=Math.pow(10,-i)/a;s=Math.round(e*u);l=Math.round(t*u);if(s/ut)--l;u=-u}else{u=Math.pow(10,i)*a;s=Math.round(e/u);l=Math.round(t/u);if(s*ut)--l}if(l0))return[];if(e===t)return[e];const r=t=i))return[];const s=o-i+1,l=new Array(s);if(r){if(a<0)for(let u=0;u{GNr=Math.sqrt(50);HNr=Math.sqrt(10);WNr=Math.sqrt(2)});function pk(e,t){let n;if(t===void 0){for(const r of e){if(r!=null&&(n=r)){n=r}}}else{let r=-1;for(let i of e){if((i=t(i,++r,e))!=null&&(n=i)){n=i}}}return n}var I6t=Ce(()=>{});function s0e(e,t){let n;if(t===void 0){for(const r of e){if(r!=null&&(n>r||n===void 0&&r>=r)){n=r}}}else{let r=-1;for(let i of e){if((i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)){n=i}}}return n}var M6t=Ce(()=>{});function v9e(e,t,n=Zj){if(!(r=e.length)||isNaN(t=+t))return;if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,o=Math.floor(i),a=+n(e[o],o,e),s=+n(e[o+1],o+1,e);return a+(s-a)*(i-o)}var L6t=Ce(()=>{y9e()});function l0e(e,t){let n=0;let r=0;if(t===void 0){for(let i of e){if(i!=null&&(i=+i)>=i){++n,r+=i}}}else{let i=-1;for(let o of e){if((o=t(o,++i,e))!=null&&(o=+o)>=o){++n,r+=o}}}if(n)return r/n}var D6t=Ce(()=>{});function c0e(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(i);while(++r{});function mk(e,t){let n=0;if(t===void 0){for(let r of e){if(r=+r){n+=r}}}else{let r=-1;for(let i of e){if(i=+t(i,++r,e)){n+=i}}}return n}var N6t=Ce(()=>{});var zh=Ce(()=>{E6t();g9e();S6t();A6t();I6t();D6t();M6t();L6t();F6t();N6t();P6t();R6t()});function Qv(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}var YN=Ce(()=>{});function mg(){var e=new u9,t=[],n=[],r=_9e;function i(o){let a=e.get(o);if(a===void 0){if(r!==_9e)return r;e.set(o,a=t.push(o)-1)}return n[a%n.length]}i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new u9;for(const a of o){if(e.has(a))continue;e.set(a,t.push(a)-1)}return i};i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()};i.unknown=function(o){return arguments.length?(r=o,i):r};i.copy=function(){return mg(t,n).unknown(r)};Qv.apply(i,arguments);return i}var _9e;var T9e=Ce(()=>{zh();YN();_9e=Symbol("implicit")});function Gb(){var e=mg().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,o,a,s=false,l=0,u=0,d=.5;delete e.unknown;function f(){var h=t().length,m=i{zh();YN();T9e()});function E9e(e){return function(){return e}}var z6t=Ce(()=>{});function C9e(e){return+e}var U6t=Ce(()=>{});function $T(e){return e}function S9e(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:E9e(isNaN(t)?NaN:.5)}function YNr(e,t){var n;if(e>t)n=e,e=t,t=n;return function(r){return Math.max(e,Math.min(t,r))}}function qNr(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];if(i2?XNr:qNr;l=u=null;return f}function f(h){return h==null||isNaN(h=+h)?o:(l||(l=s(e.map(r),t,n)))(r(a(h)))}f.invert=function(h){return a(i((u||(u=s(t,e.map(r),pg)))(h)))};f.domain=function(h){return arguments.length?(e=Array.from(h,C9e),d()):e.slice()};f.range=function(h){return arguments.length?(t=Array.from(h),d()):t.slice()};f.rangeRound=function(h){return t=Array.from(h),n=l9e,d()};f.clamp=function(h){return arguments.length?(a=h?true:$T,d()):a!==$T};f.interpolate=function(h){return arguments.length?(n=h,d()):n};f.unknown=function(h){return arguments.length?(o=h,f):o};return function(h,m){r=h,i=m;return d()}}function eK(){return Qj()($T,$T)}var V6t;var tK=Ce(()=>{zh();c9();z6t();U6t();V6t=[0,1]});function A9e(e,t,n,r){var i=hk(e,t,n),o;r=DE(r==null?",f":r);switch(r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));if(r.precision==null&&!isNaN(o=Gze(i,a)))r.precision=o;return Xye(r,a)}case"":case"e":case"g":case"p":case"r":{if(r.precision==null&&!isNaN(o=Hze(i,Math.max(Math.abs(e),Math.abs(t)))))r.precision=o-(r.type==="e");break}case"f":case"%":{if(r.precision==null&&!isNaN(o=$ze(i)))r.precision=o-(r.type==="%")*2;break}}return Oh(r)}var $6t=Ce(()=>{zh();uk()});function k9e(e){var t=e.domain;e.ticks=function(n){var r=t();return WN(r[0],r[r.length-1],n==null?10:n)};e.tickFormat=function(n,r){var i=t();return A9e(i[0],i[i.length-1],n==null?10:n,r)};e.nice=function(n){if(n==null)n=10;var r=t();var i=0;var o=r.length-1;var a=r[i];var s=r[o];var l;var u;var d=10;if(s0){u=Jj(a,s,n);if(u===l){r[i]=a;r[o]=s;return t(r)}else if(u>0){a=Math.floor(a/u)*u;s=Math.ceil(s/u)*u}else if(u<0){a=Math.ceil(a*u)/u;s=Math.floor(s*u)/u}else{break}l=u}return e};return e}function wc(){var e=eK();e.copy=function(){return L3(e,wc())};Qv.apply(e,arguments);return k9e(e)}var R9e=Ce(()=>{zh();tK();YN();$6t()});function nK(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],o=e[r],a;if(o{});function G6t(e){return Math.log(e)}function H6t(e){return Math.exp(e)}function jNr(e){return-Math.log(-e)}function KNr(e){return-Math.exp(-e)}function ZNr(e){return isFinite(e)?+("1e"+e):e<0?0:e}function JNr(e){return e===10?ZNr:e===Math.E?Math.exp:t=>Math.pow(e,t)}function QNr(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function W6t(e){return(t,n)=>-e(-t,n)}function eOr(e){const t=e(G6t,H6t);const n=t.domain;let r=10;let i;let o;function a(){i=QNr(r),o=JNr(r);if(n()[0]<0){i=W6t(i),o=W6t(o);e(jNr,KNr)}else{e(G6t,H6t)}return t}t.base=function(s){return arguments.length?(r=+s,a()):r};t.domain=function(s){return arguments.length?(n(s),a()):n()};t.ticks=s=>{const l=n();let u=l[0];let d=l[l.length-1];const f=d0)for(;h<=m;++h){for(g=1;gd)break;_.push(x)}}else for(;h<=m;++h){for(g=r-1;g>=1;--g){x=h>0?g/o(-h):g*o(h);if(xd)break;_.push(x)}}if(_.length*2{if(s==null)s=10;if(l==null)l=r===10?"s":",";if(typeof l!=="function"){if(!(r%1)&&(l=DE(l)).precision==null)l.trim=true;l=Oh(l)}if(s===Infinity)return l;const u=Math.max(1,r*s/t.ticks().length);return d=>{let f=d/o(Math.round(i(d)));if(f*r{return n(nK(n(),{floor:s=>o(Math.floor(i(s))),ceil:s=>o(Math.ceil(i(s)))}))};return t}function rK(){const e=eOr(Qj()).domain([1,10]);e.copy=()=>L3(e,rK()).base(e.base());Qv.apply(e,arguments);return e}var Y6t=Ce(()=>{zh();uk();P9e();tK();YN()});function q6t(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function tOr(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function nOr(e){return e<0?-e*e:e*e}function rOr(e){var t=e($T,$T),n=1;function r(){return n===1?e($T,$T):n===.5?e(tOr,nOr):e(q6t(n),q6t(1/n))}t.exponent=function(i){return arguments.length?(n=+i,r()):n};return k9e(t)}function u0e(){var e=rOr(Qj());e.copy=function(){return L3(e,u0e()).exponent(e.exponent())};Qv.apply(e,arguments);return e}function I9e(){return u0e.apply(null,arguments).exponent(.5)}var X6t=Ce(()=>{R9e();tK();YN()});function Vu(e,t,n,r){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}i.floor=o=>{return e(o=new Date(+o)),o};i.ceil=o=>{return e(o=new Date(o-1)),t(o,1),e(o),o};i.round=o=>{const a=i(o),s=i.ceil(o);return o-a{return t(o=new Date(+o),a==null?1:Math.floor(a)),o};i.range=(o,a,s)=>{const l=[];o=i.ceil(o);s=s==null?1:Math.floor(s);if(!(o0))return l;let u;do l.push(u=new Date(+o)),t(o,s),e(o);while(u{return Vu(a=>{if(a>=a)while(e(a),!o(a))a.setTime(a-1)},(a,s)=>{if(a>=a){if(s<0)while(++s<=0){while(t(a,-1),!o(a)){}}else while(--s>=0){while(t(a,1),!o(a)){}}}})};if(n){i.count=(o,a)=>{M9e.setTime(+o),L9e.setTime(+a);e(M9e),e(L9e);return Math.floor(n(M9e,L9e))};i.every=o=>{o=Math.floor(o);return!isFinite(o)||!(o>0)?null:!(o>1)?i:i.filter(r?a=>r(a)%o===0:a=>i.count(0,a)%o===0)}}return i}var M9e,L9e;var gk=Ce(()=>{M9e=new Date;L9e=new Date});var BE,j6t;var D9e=Ce(()=>{gk();BE=Vu(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>{return t-e});BE.every=e=>{e=Math.floor(e);if(!isFinite(e)||!(e>0))return null;if(!(e>1))return BE;return Vu(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>{return(n-t)/e})};j6t=BE.range});var S1,gg,GT,HT,iK,F9e,d0e;var qN=Ce(()=>{S1=1e3;gg=S1*60;GT=gg*60;HT=GT*24;iK=HT*7;F9e=HT*30;d0e=HT*365});var A1,K6t;var N9e=Ce(()=>{gk();qN();A1=Vu(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*S1)},(e,t)=>{return(t-e)/S1},e=>{return e.getUTCSeconds()});K6t=A1.range});var yk,iOr,f0e,oOr;var O9e=Ce(()=>{gk();qN();yk=Vu(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*S1)},(e,t)=>{e.setTime(+e+t*gg)},(e,t)=>{return(t-e)/gg},e=>{return e.getMinutes()});iOr=yk.range;f0e=Vu(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*gg)},(e,t)=>{return(t-e)/gg},e=>{return e.getUTCMinutes()});oOr=f0e.range});var bk,aOr,h0e,sOr;var B9e=Ce(()=>{gk();qN();bk=Vu(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*S1-e.getMinutes()*gg)},(e,t)=>{e.setTime(+e+t*GT)},(e,t)=>{return(t-e)/GT},e=>{return e.getHours()});aOr=bk.range;h0e=Vu(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*GT)},(e,t)=>{return(t-e)/GT},e=>{return e.getUTCHours()});sOr=h0e.range});var e_,lOr,oK,cOr,p0e,uOr;var z9e=Ce(()=>{gk();qN();e_=Vu(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*gg)/HT,e=>e.getDate()-1);lOr=e_.range;oK=Vu(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>{return(t-e)/HT},e=>{return e.getUTCDate()-1});cOr=oK.range;p0e=Vu(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>{return(t-e)/HT},e=>{return Math.floor(e/HT)});uOr=p0e.range});function XN(e){return Vu(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7);t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>{return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*gg)/iK})}function jN(e){return Vu(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7);t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>{return(n-t)/iK})}var WT,D3,m0e,g0e,zE,y0e,b0e,Z6t,dOr,fOr,hOr,pOr,mOr,gOr,KN,d9,J6t,Q6t,F3,e8t,t8t,n8t,yOr,bOr,xOr,vOr,_Or,TOr;var U9e=Ce(()=>{gk();qN();WT=XN(0);D3=XN(1);m0e=XN(2);g0e=XN(3);zE=XN(4);y0e=XN(5);b0e=XN(6);Z6t=WT.range;dOr=D3.range;fOr=m0e.range;hOr=g0e.range;pOr=zE.range;mOr=y0e.range;gOr=b0e.range;KN=jN(0);d9=jN(1);J6t=jN(2);Q6t=jN(3);F3=jN(4);e8t=jN(5);t8t=jN(6);n8t=KN.range;yOr=d9.range;bOr=J6t.range;xOr=Q6t.range;vOr=F3.range;_Or=e8t.range;TOr=t8t.range});var xk,wOr,x0e,EOr;var V9e=Ce(()=>{gk();xk=Vu(e=>{e.setDate(1);e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>{return t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12},e=>{return e.getMonth()});wOr=xk.range;x0e=Vu(e=>{e.setUTCDate(1);e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>{return t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12},e=>{return e.getUTCMonth()});EOr=x0e.range});var k1,COr,YT,SOr;var $9e=Ce(()=>{gk();k1=Vu(e=>{e.setMonth(0,1);e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>{return t.getFullYear()-e.getFullYear()},e=>{return e.getFullYear()});k1.every=e=>{return!isFinite(e=Math.floor(e))||!(e>0)?null:Vu(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e);t.setMonth(0,1);t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)})};COr=k1.range;YT=Vu(e=>{e.setUTCMonth(0,1);e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>{return t.getUTCFullYear()-e.getUTCFullYear()},e=>{return e.getUTCFullYear()});YT.every=e=>{return!isFinite(e=Math.floor(e))||!(e>0)?null:Vu(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e);t.setUTCMonth(0,1);t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)})};SOr=YT.range});function r8t(e,t,n,r,i,o){const a=[[A1,1,S1],[A1,5,5*S1],[A1,15,15*S1],[A1,30,30*S1],[o,1,gg],[o,5,5*gg],[o,15,15*gg],[o,30,30*gg],[i,1,GT],[i,3,3*GT],[i,6,6*GT],[i,12,12*GT],[r,1,HT],[r,2,2*HT],[n,1,iK],[t,1,F9e],[t,3,3*F9e],[e,1,d0e]];function s(u,d,f){const h=dw).right(a,h);if(m===a.length)return e.every(hk(u/d0e,d/d0e,f));if(m===0)return BE.every(Math.max(hk(u,d,f),1));const[g,x]=a[h/a[m-1][2]{zh();qN();D9e();N9e();O9e();B9e();z9e();U9e();V9e();$9e();[AOr,kOr]=r8t(YT,x0e,KN,p0e,h0e,f0e);[G9e,H9e]=r8t(k1,xk,WT,e_,bk,yk)});var v0e=Ce(()=>{D9e();N9e();O9e();B9e();z9e();U9e();V9e();$9e();i8t()});function W9e(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);t.setFullYear(e.y);return t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Y9e(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));t.setUTCFullYear(e.y);return t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function aK(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function q9e(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,a=e.shortDays,s=e.months,l=e.shortMonths;var u=sK(i),d=lK(i),f=sK(o),h=lK(o),m=sK(a),g=lK(a),x=sK(s),w=lK(s),_=sK(l),C=lK(l);var A={"a":te,"A":J,"b":oe,"B":se,"c":null,"d":u8t,"e":u8t,"f":ZOr,"g":s5r,"G":c5r,"H":XOr,"I":jOr,"j":KOr,"L":m8t,"m":JOr,"M":QOr,"p":re,"q":ce,"Q":h8t,"s":p8t,"S":e5r,"u":t5r,"U":n5r,"V":r5r,"w":i5r,"W":o5r,"x":null,"X":null,"y":a5r,"Y":l5r,"Z":u5r,"%":f8t};var P={"a":ue,"A":xe,"b":be,"B":Ie,"c":null,"d":d8t,"e":d8t,"f":p5r,"g":E5r,"G":S5r,"H":d5r,"I":f5r,"j":h5r,"L":y8t,"m":m5r,"M":g5r,"p":he,"q":ve,"Q":h8t,"s":p8t,"S":y5r,"u":b5r,"U":x5r,"V":v5r,"w":_5r,"W":T5r,"x":null,"X":null,"y":w5r,"Y":C5r,"Z":A5r,"%":f8t};var L={"a":U,"A":W,"b":H,"B":$,"c":K,"d":l8t,"e":l8t,"f":HOr,"g":s8t,"G":a8t,"H":c8t,"I":c8t,"j":UOr,"L":GOr,"m":zOr,"M":VOr,"p":z,"q":BOr,"Q":YOr,"s":qOr,"S":$Or,"u":LOr,"U":DOr,"V":FOr,"w":MOr,"W":NOr,"x":X,"X":j,"y":s8t,"Y":a8t,"Z":OOr,"%":WOr};A.x=I(n,A);A.X=I(r,A);A.c=I(t,A);P.x=I(n,P);P.X=I(r,P);P.c=I(t,P);function I(ge,Ve){return function(Le){var $e=[],Ee=-1,tt=0,yt=ge.length,mt,ct,Ge;if(!(Le instanceof Date))Le=new Date(+Le);while(++Ee53)return null;if(!("w"in $e))$e.w=1;if("Z"in $e){tt=Y9e(aK($e.y,0,1)),yt=tt.getUTCDay();tt=yt>4||yt===0?d9.ceil(tt):d9(tt);tt=oK.offset(tt,($e.V-1)*7);$e.y=tt.getUTCFullYear();$e.m=tt.getUTCMonth();$e.d=tt.getUTCDate()+($e.w+6)%7}else{tt=W9e(aK($e.y,0,1)),yt=tt.getDay();tt=yt>4||yt===0?D3.ceil(tt):D3(tt);tt=e_.offset(tt,($e.V-1)*7);$e.y=tt.getFullYear();$e.m=tt.getMonth();$e.d=tt.getDate()+($e.w+6)%7}}else if("W"in $e||"U"in $e){if(!("w"in $e))$e.w="u"in $e?$e.u%7:"W"in $e?1:0;yt="Z"in $e?Y9e(aK($e.y,0,1)).getUTCDay():W9e(aK($e.y,0,1)).getDay();$e.m=0;$e.d="W"in $e?($e.w+6)%7+$e.W*7-(yt+5)%7:$e.w+$e.U*7-(yt+6)%7}if("Z"in $e){$e.H+=$e.Z/100|0;$e.M+=$e.Z%100;return Y9e($e)}return W9e($e)}}function O(ge,Ve,Le,$e){var Ee=0,tt=Ve.length,yt=Le.length,mt,ct;while(Ee=yt)return-1;mt=Ve.charCodeAt(Ee++);if(mt===37){mt=Ve.charAt(Ee++);ct=L[mt in o8t?Ve.charAt(Ee++):mt];if(!ct||($e=ct(ge,Le,$e))<0)return-1}else if(mt!=Le.charCodeAt($e++)){return-1}}return $e}function z(ge,Ve,Le){var $e=u.exec(Ve.slice(Le));return $e?(ge.p=d.get($e[0].toLowerCase()),Le+$e[0].length):-1}function U(ge,Ve,Le){var $e=m.exec(Ve.slice(Le));return $e?(ge.w=g.get($e[0].toLowerCase()),Le+$e[0].length):-1}function W(ge,Ve,Le){var $e=f.exec(Ve.slice(Le));return $e?(ge.w=h.get($e[0].toLowerCase()),Le+$e[0].length):-1}function H(ge,Ve,Le){var $e=_.exec(Ve.slice(Le));return $e?(ge.m=C.get($e[0].toLowerCase()),Le+$e[0].length):-1}function $(ge,Ve,Le){var $e=x.exec(Ve.slice(Le));return $e?(ge.m=w.get($e[0].toLowerCase()),Le+$e[0].length):-1}function K(ge,Ve,Le){return O(ge,t,Ve,Le)}function X(ge,Ve,Le){return O(ge,n,Ve,Le)}function j(ge,Ve,Le){return O(ge,r,Ve,Le)}function te(ge){return a[ge.getDay()]}function J(ge){return o[ge.getDay()]}function oe(ge){return l[ge.getMonth()]}function se(ge){return s[ge.getMonth()]}function re(ge){return i[+(ge.getHours()>=12)]}function ce(ge){return 1+~~(ge.getMonth()/3)}function ue(ge){return a[ge.getUTCDay()]}function xe(ge){return o[ge.getUTCDay()]}function be(ge){return l[ge.getUTCMonth()]}function Ie(ge){return s[ge.getUTCMonth()]}function he(ge){return i[+(ge.getUTCHours()>=12)]}function ve(ge){return 1+~~(ge.getUTCMonth()/3)}return{format:function(ge){var Ve=I(ge+="",A);Ve.toString=function(){return ge};return Ve},parse:function(ge){var Ve=N(ge+="",false);Ve.toString=function(){return ge};return Ve},utcFormat:function(ge){var Ve=I(ge+="",P);Ve.toString=function(){return ge};return Ve},utcParse:function(ge){var Ve=N(ge+="",true);Ve.toString=function(){return ge};return Ve}}}function Ec(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o[t.toLowerCase(),n]))}function MOr(e,t,n){var r=vm.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function LOr(e,t,n){var r=vm.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function DOr(e,t,n){var r=vm.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function FOr(e,t,n){var r=vm.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function NOr(e,t,n){var r=vm.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function a8t(e,t,n){var r=vm.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function s8t(e,t,n){var r=vm.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function OOr(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function BOr(e,t,n){var r=vm.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function zOr(e,t,n){var r=vm.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function l8t(e,t,n){var r=vm.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function UOr(e,t,n){var r=vm.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function c8t(e,t,n){var r=vm.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function VOr(e,t,n){var r=vm.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function $Or(e,t,n){var r=vm.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function GOr(e,t,n){var r=vm.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function HOr(e,t,n){var r=vm.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function WOr(e,t,n){var r=ROr.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function YOr(e,t,n){var r=vm.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function qOr(e,t,n){var r=vm.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function u8t(e,t){return Ec(e.getDate(),t,2)}function XOr(e,t){return Ec(e.getHours(),t,2)}function jOr(e,t){return Ec(e.getHours()%12||12,t,2)}function KOr(e,t){return Ec(1+e_.count(k1(e),e),t,3)}function m8t(e,t){return Ec(e.getMilliseconds(),t,3)}function ZOr(e,t){return m8t(e,t)+"000"}function JOr(e,t){return Ec(e.getMonth()+1,t,2)}function QOr(e,t){return Ec(e.getMinutes(),t,2)}function e5r(e,t){return Ec(e.getSeconds(),t,2)}function t5r(e){var t=e.getDay();return t===0?7:t}function n5r(e,t){return Ec(WT.count(k1(e)-1,e),t,2)}function g8t(e){var t=e.getDay();return t>=4||t===0?zE(e):zE.ceil(e)}function r5r(e,t){e=g8t(e);return Ec(zE.count(k1(e),e)+(k1(e).getDay()===4),t,2)}function i5r(e){return e.getDay()}function o5r(e,t){return Ec(D3.count(k1(e)-1,e),t,2)}function a5r(e,t){return Ec(e.getFullYear()%100,t,2)}function s5r(e,t){e=g8t(e);return Ec(e.getFullYear()%100,t,2)}function l5r(e,t){return Ec(e.getFullYear()%1e4,t,4)}function c5r(e,t){var n=e.getDay();e=n>=4||n===0?zE(e):zE.ceil(e);return Ec(e.getFullYear()%1e4,t,4)}function u5r(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ec(t/60|0,"0",2)+Ec(t%60,"0",2)}function d8t(e,t){return Ec(e.getUTCDate(),t,2)}function d5r(e,t){return Ec(e.getUTCHours(),t,2)}function f5r(e,t){return Ec(e.getUTCHours()%12||12,t,2)}function h5r(e,t){return Ec(1+oK.count(YT(e),e),t,3)}function y8t(e,t){return Ec(e.getUTCMilliseconds(),t,3)}function p5r(e,t){return y8t(e,t)+"000"}function m5r(e,t){return Ec(e.getUTCMonth()+1,t,2)}function g5r(e,t){return Ec(e.getUTCMinutes(),t,2)}function y5r(e,t){return Ec(e.getUTCSeconds(),t,2)}function b5r(e){var t=e.getUTCDay();return t===0?7:t}function x5r(e,t){return Ec(KN.count(YT(e)-1,e),t,2)}function b8t(e){var t=e.getUTCDay();return t>=4||t===0?F3(e):F3.ceil(e)}function v5r(e,t){e=b8t(e);return Ec(F3.count(YT(e),e)+(YT(e).getUTCDay()===4),t,2)}function _5r(e){return e.getUTCDay()}function T5r(e,t){return Ec(d9.count(YT(e)-1,e),t,2)}function w5r(e,t){return Ec(e.getUTCFullYear()%100,t,2)}function E5r(e,t){e=b8t(e);return Ec(e.getUTCFullYear()%100,t,2)}function C5r(e,t){return Ec(e.getUTCFullYear()%1e4,t,4)}function S5r(e,t){var n=e.getUTCDay();e=n>=4||n===0?F3(e):F3.ceil(e);return Ec(e.getUTCFullYear()%1e4,t,4)}function A5r(){return"+0000"}function f8t(){return"%"}function h8t(e){return+e}function p8t(e){return Math.floor(+e/1e3)}var o8t,vm,ROr,POr;var x8t=Ce(()=>{v0e();o8t={"-":"","_":" ","0":"0"};vm=/^\s*\d+/;ROr=/^%/;POr=/[\\^$*+?|[\]().{}]/g});function X9e(e){f9=q9e(e);ZN=f9.format;v8t=f9.parse;_8t=f9.utcFormat;T8t=f9.utcParse;return f9}var f9,ZN,v8t,_8t,T8t;var w8t=Ce(()=>{x8t();X9e({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]})});var j9e=Ce(()=>{w8t()});function k5r(e){return new Date(e)}function R5r(e){return e instanceof Date?+e:+new Date(+e)}function E8t(e,t,n,r,i,o,a,s,l,u){var d=eK(),f=d.invert,h=d.domain;var m=u(".%L"),g=u(":%S"),x=u("%I:%M"),w=u("%I %p"),_=u("%a %d"),C=u("%b %d"),A=u("%B"),P=u("%Y");function L(I){return(l(I){v0e();j9e();tK();YN();P9e()});var R1=Ce(()=>{B6t();R9e();Y6t();T9e();X6t();C8t()});function cu(e){return function t(){return e}}var uK=Ce(()=>{});function X8t(e){return e>1?0:e<-1?b9:Math.acos(e)}function eUe(e){return e>=1?dK:e<=-1?-dK:Math.asin(e)}var Q9e,yg,N3,q8t,k0e,qT,nO,_m,b9,dK,x9;var R0e=Ce(()=>{Q9e=Math.abs;yg=Math.atan2;N3=Math.cos;q8t=Math.max;k0e=Math.min;qT=Math.sin;nO=Math.sqrt;_m=1e-12;b9=Math.PI;dK=b9/2;x9=2*b9});function j8t(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return j8t;const n=10**t;return function(r){this._+=r[0];for(let i=1,o=r.length;i{tUe=Math.PI;nUe=2*tUe;rO=1e-6;$5r=nUe-rO;iO=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null;this._="";this._append=t==null?j8t:G5r(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){if(this._x1!==null){this._x1=this._x0,this._y1=this._y0;this._append`Z`}}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,o,a){this._append`C${+t},${+n},${+r},${+i},${this._x1=+o},${this._y1=+a}`}arcTo(t,n,r,i,o){t=+t,n=+n,r=+r,i=+i,o=+o;if(o<0)throw new Error(`negative radius: ${o}`);let a=this._x1,s=this._y1,l=r-t,u=i-n,d=a-t,f=s-n,h=d*d+f*f;if(this._x1===null){this._append`M${this._x1=t},${this._y1=n}`}else if(!(h>rO));else if(!(Math.abs(f*l-u*d)>rO)||!o){this._append`L${this._x1=t},${this._y1=n}`}else{let m=r-a,g=i-s,x=l*l+u*u,w=m*m+g*g,_=Math.sqrt(x),C=Math.sqrt(h),A=o*Math.tan((tUe-Math.acos((x+h-w)/(2*_*C)))/2),P=A/C,L=A/_;if(Math.abs(P-1)>rO){this._append`L${t+P*d},${n+P*f}`}this._append`A${o},${o},0,0,${+(f*m>d*g)},${this._x1=t+L*l},${this._y1=n+L*u}`}}arc(t,n,r,i,o,a){t=+t,n=+n,r=+r,a=!!a;if(r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(i),l=r*Math.sin(i),u=t+s,d=n+l,f=1^a,h=a?i-o:o-i;if(this._x1===null){this._append`M${u},${d}`}else if(Math.abs(this._x1-u)>rO||Math.abs(this._y1-d)>rO){this._append`L${u},${d}`}if(!r)return;if(h<0)h=h%nUe+nUe;if(h>$5r){this._append`A${r},${r},0,1,${f},${t-s},${n-l}A${r},${r},0,1,${f},${this._x1=u},${this._y1=d}`}else if(h>rO){this._append`A${r},${r},0,${+(h>=tUe)},${f},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`}}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};K8t.prototype=iO.prototype});var rUe=Ce(()=>{Z8t()});function P0e(e){let t=3;e.digits=function(n){if(!arguments.length)return t;if(n==null){t=null}else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e};return()=>new iO(t)}var iUe=Ce(()=>{rUe()});function H5r(e){return e.innerRadius}function W5r(e){return e.outerRadius}function Y5r(e){return e.startAngle}function q5r(e){return e.endAngle}function X5r(e){return e&&e.padAngle}function j5r(e,t,n,r,i,o,a,s){var l=n-e,u=r-t,d=a-i,f=s-o,h=f*l-d*u;if(h*h<_m)return;h=(d*(t-o)-f*(e-i))/h;return[e+h*l,t+h*u]}function I0e(e,t,n,r,i,o,a){var s=e-n,l=t-r,u=(a?o:-o)/nO(s*s+l*l),d=u*l,f=-u*s,h=e+d,m=t+f,g=n+d,x=r+f,w=(h+g)/2,_=(m+x)/2,C=g-h,A=x-m,P=C*C+A*A,L=i-o,I=h*x-g*m,N=(A<0?-1:1)*nO(q8t(0,L*L*P-I*I)),O=(I*A-C*N)/P,z=(-I*C-A*N)/P,U=(I*A+C*N)/P,W=(-I*C+A*N)/P,H=O-w,$=z-_,K=U-w,X=W-_;if(H*H+$*$>K*K+X*X)O=U,z=W;return{cx:O,cy:z,x01:-d,y01:-f,x11:O*(i/L-1),y11:z*(i/L-1)}}function Hb(){var e=H5r,t=W5r,n=cu(0),r=null,i=Y5r,o=q5r,a=X5r,s=null,l=P0e(u);function u(){var d,f,h=+e.apply(this,arguments),m=+t.apply(this,arguments),g=i.apply(this,arguments)-dK,x=o.apply(this,arguments)-dK,w=Q9e(x-g),_=x>g;if(!s)s=d=l();if(m_m))s.moveTo(0,0);else if(w>x9-_m){s.moveTo(m*N3(g),m*qT(g));s.arc(0,0,m,g,x,!_);if(h>_m){s.moveTo(h*N3(x),h*qT(x));s.arc(0,0,h,x,g,_)}}else{var C=g,A=x,P=g,L=x,I=w,N=w,O=a.apply(this,arguments)/2,z=O>_m&&(r?+r.apply(this,arguments):nO(h*h+m*m)),U=k0e(Q9e(m-h)/2,+n.apply(this,arguments)),W=U,H=U,$,K;if(z>_m){var X=eUe(z/h*qT(O)),j=eUe(z/m*qT(O));if((I-=X*2)>_m)X*=_?1:-1,P+=X,L-=X;else I=0,P=L=(g+x)/2;if((N-=j*2)>_m)j*=_?1:-1,C+=j,A-=j;else N=0,C=A=(g+x)/2}var te=m*N3(C),J=m*qT(C),oe=h*N3(L),se=h*qT(L);if(U>_m){var re=m*N3(A),ce=m*qT(A),ue=h*N3(P),xe=h*qT(P),be;if(w_m))s.moveTo(te,J);else if(H>_m){$=I0e(ue,xe,te,J,m,H,_);K=I0e(re,ce,oe,se,m,H,_);s.moveTo($.cx+$.x01,$.cy+$.y01);if(H_m)||!(I>_m))s.lineTo(oe,se);else if(W>_m){$=I0e(oe,se,re,ce,h,-W,_);K=I0e(te,J,ue,xe,h,-W,_);s.lineTo($.cx+$.x01,$.cy+$.y01);if(W{uK();R0e();iUe()});function v9(e){return typeof e==="object"&&"length"in e?e:Array.from(e)}var uHo;var M0e=Ce(()=>{uHo=Array.prototype.slice});function Q8t(e){this._context=e}function I1(e){return new Q8t(e)}var oUe=Ce(()=>{Q8t.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){if(this._line||this._line!==0&&this._point===1)this._context.closePath();this._line=1-this._line},point:function(e,t){e=+e,t=+t;switch(this._point){case 0:this._point=1;this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}}});function e7t(e){return e[0]}function t7t(e){return e[1]}var n7t=Ce(()=>{});function Wb(e,t){var n=cu(true),r=null,i=I1,o=null,a=P0e(s);e=typeof e==="function"?e:e===void 0?e7t:cu(e);t=typeof t==="function"?t:t===void 0?t7t:cu(t);function s(l){var u,d=(l=v9(l)).length,f,h=false,m;if(r==null)o=i(m=a());for(u=0;u<=d;++u){if(!(u{M0e();uK();oUe();iUe();n7t()});function i7t(e,t){return te?1:t>=e?0:NaN}var o7t=Ce(()=>{});function a7t(e){return e}var s7t=Ce(()=>{});function oO(){var e=a7t,t=i7t,n=null,r=cu(0),i=cu(x9),o=cu(0);function a(s){var l,u=(s=v9(s)).length,d,f,h=0,m=new Array(u),g=new Array(u),x=+r.apply(this,arguments),w=Math.min(x9,Math.max(-x9,i.apply(this,arguments)-x)),_,C=Math.min(Math.abs(w)/u,o.apply(this,arguments)),A=C*(w<0?-1:1),P;for(l=0;l0){h+=P}}if(t!=null)m.sort(function(L,I){return t(g[L],g[I])});else if(n!=null)m.sort(function(L,I){return n(s[L],s[I])});for(l=0,f=h?(w-u*A)/h:0;l0?P*f:0)+A,g[d]={data:s[d],index:l,value:P,startAngle:x,endAngle:_,padAngle:C}}return g}a.value=function(s){return arguments.length?(e=typeof s==="function"?s:cu(+s),a):e};a.sortValues=function(s){return arguments.length?(t=s,n=null,a):t};a.sort=function(s){return arguments.length?(n=s,t=null,a):n};a.startAngle=function(s){return arguments.length?(r=typeof s==="function"?s:cu(+s),a):r};a.endAngle=function(s){return arguments.length?(i=typeof s==="function"?s:cu(+s),a):i};a.padAngle=function(s){return arguments.length?(o=typeof s==="function"?s:cu(+s),a):o};return a}var l7t=Ce(()=>{M0e();uK();o7t();s7t();R0e()});function fK(e){return new L0e(e,true)}function hK(e){return new L0e(e,false)}var L0e;var c7t=Ce(()=>{L0e=class{constructor(t,n){this._context=t;this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){if(this._line||this._line!==0&&this._point===1)this._context.closePath();this._line=1-this._line}point(t,n){t=+t,n=+n;switch(this._point){case 0:{this._point=1;if(this._line)this._context.lineTo(t,n);else this._context.moveTo(t,n);break}case 1:this._point=2;default:{if(this._x)this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n);else this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}});function t_(){}var pK=Ce(()=>{});function _9(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function mK(e){this._context=e}function UE(e){return new mK(e)}var gK=Ce(()=>{mK.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN;this._point=0},lineEnd:function(){switch(this._point){case 3:_9(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}if(this._line||this._line!==0&&this._point===1)this._context.closePath();this._line=1-this._line},point:function(e,t){e=+e,t=+t;switch(this._point){case 0:this._point=1;this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:_9(this,e,t);break}this._x0=this._x1,this._x1=e;this._y0=this._y1,this._y1=t}}});function u7t(e){this._context=e}function aUe(e){return new u7t(e)}var d7t=Ce(()=>{pK();gK();u7t.prototype={areaStart:t_,areaEnd:t_,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN;this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2);this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3);this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3);this._context.closePath();break}case 3:{this.point(this._x2,this._y2);this.point(this._x3,this._y3);this.point(this._x4,this._y4);break}}},point:function(e,t){e=+e,t=+t;switch(this._point){case 0:this._point=1;this._x2=e,this._y2=t;break;case 1:this._point=2;this._x3=e,this._y3=t;break;case 2:this._point=3;this._x4=e,this._y4=t;this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:_9(this,e,t);break}this._x0=this._x1,this._x1=e;this._y0=this._y1,this._y1=t}}});function f7t(e){this._context=e}function sUe(e){return new f7t(e)}var h7t=Ce(()=>{gK();f7t.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN;this._point=0},lineEnd:function(){if(this._line||this._line!==0&&this._point===3)this._context.closePath();this._line=1-this._line},point:function(e,t){e=+e,t=+t;switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:_9(this,e,t);break}this._x0=this._x1,this._x1=e;this._y0=this._y1,this._y1=t}}});function p7t(e,t){this._basis=new mK(e);this._beta=t}var lUe;var m7t=Ce(()=>{gK();p7t.prototype={lineStart:function(){this._x=[];this._y=[];this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0){var r=e[0],i=t[0],o=e[n]-r,a=t[n]-i,s=-1,l;while(++s<=n){l=s/n;this._basis.point(this._beta*e[s]+(1-this._beta)*(r+l*o),this._beta*t[s]+(1-this._beta)*(i+l*a))}}this._x=this._y=null;this._basis.lineEnd()},point:function(e,t){this._x.push(+e);this._y.push(+t)}};lUe=function e(t){function n(r){return t===1?new mK(r):new p7t(r,t)}n.beta=function(r){return e(+r)};return n}(.85)});function T9(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function D0e(e,t){this._context=e;this._k=(1-t)/6}var yK;var bK=Ce(()=>{D0e.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN;this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:T9(this,this._x1,this._y1);break}if(this._line||this._line!==0&&this._point===1)this._context.closePath();this._line=1-this._line},point:function(e,t){e=+e,t=+t;switch(this._point){case 0:this._point=1;this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;this._x1=e,this._y1=t;break;case 2:this._point=3;default:T9(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e;this._y0=this._y1,this._y1=this._y2,this._y2=t}};yK=function e(t){function n(r){return new D0e(r,t)}n.tension=function(r){return e(+r)};return n}(0)});function F0e(e,t){this._context=e;this._k=(1-t)/6}var cUe;var uUe=Ce(()=>{pK();bK();F0e.prototype={areaStart:t_,areaEnd:t_,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN;this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3);this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3);this._context.closePath();break}case 3:{this.point(this._x3,this._y3);this.point(this._x4,this._y4);this.point(this._x5,this._y5);break}}},point:function(e,t){e=+e,t=+t;switch(this._point){case 0:this._point=1;this._x3=e,this._y3=t;break;case 1:this._point=2;this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3;this._x5=e,this._y5=t;break;default:T9(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e;this._y0=this._y1,this._y1=this._y2,this._y2=t}};cUe=function e(t){function n(r){return new F0e(r,t)}n.tension=function(r){return e(+r)};return n}(0)});function N0e(e,t){this._context=e;this._k=(1-t)/6}var dUe;var fUe=Ce(()=>{bK();N0e.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN;this._point=0},lineEnd:function(){if(this._line||this._line!==0&&this._point===3)this._context.closePath();this._line=1-this._line},point:function(e,t){e=+e,t=+t;switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:T9(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e;this._y0=this._y1,this._y1=this._y2,this._y2=t}};dUe=function e(t){function n(r){return new N0e(r,t)}n.tension=function(r){return e(+r)};return n}(0)});function xK(e,t,n){var r=e._x1,i=e._y1,o=e._x2,a=e._y2;if(e._l01_a>_m){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/l;i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>_m){var u=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,d=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*u+e._x1*e._l23_2a-t*e._l12_2a)/d;a=(a*u+e._y1*e._l23_2a-n*e._l12_2a)/d}e._context.bezierCurveTo(r,i,o,a,e._x2,e._y2)}function g7t(e,t){this._context=e;this._alpha=t}var aO;var O0e=Ce(()=>{R0e();bK();g7t.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN;this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}if(this._line||this._line!==0&&this._point===1)this._context.closePath();this._line=1-this._line},point:function(e,t){e=+e,t=+t;if(this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:xK(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a;this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a;this._x0=this._x1,this._x1=this._x2,this._x2=e;this._y0=this._y1,this._y1=this._y2,this._y2=t}};aO=function e(t){function n(r){return t?new g7t(r,t):new D0e(r,0)}n.alpha=function(r){return e(+r)};return n}(.5)});function y7t(e,t){this._context=e;this._alpha=t}var hUe;var b7t=Ce(()=>{uUe();pK();O0e();y7t.prototype={areaStart:t_,areaEnd:t_,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN;this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3);this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3);this._context.closePath();break}case 3:{this.point(this._x3,this._y3);this.point(this._x4,this._y4);this.point(this._x5,this._y5);break}}},point:function(e,t){e=+e,t=+t;if(this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;this._x3=e,this._y3=t;break;case 1:this._point=2;this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3;this._x5=e,this._y5=t;break;default:xK(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a;this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a;this._x0=this._x1,this._x1=this._x2,this._x2=e;this._y0=this._y1,this._y1=this._y2,this._y2=t}};hUe=function e(t){function n(r){return t?new y7t(r,t):new F0e(r,0)}n.alpha=function(r){return e(+r)};return n}(.5)});function x7t(e,t){this._context=e;this._alpha=t}var pUe;var v7t=Ce(()=>{fUe();O0e();x7t.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN;this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){if(this._line||this._line!==0&&this._point===3)this._context.closePath();this._line=1-this._line},point:function(e,t){e=+e,t=+t;if(this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:xK(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a;this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a;this._x0=this._x1,this._x1=this._x2,this._x2=e;this._y0=this._y1,this._y1=this._y2,this._y2=t}};pUe=function e(t){function n(r){return t?new x7t(r,t):new N0e(r,0)}n.alpha=function(r){return e(+r)};return n}(.5)});function _7t(e){this._context=e}function mUe(e){return new _7t(e)}var T7t=Ce(()=>{pK();_7t.prototype={areaStart:t_,areaEnd:t_,lineStart:function(){this._point=0},lineEnd:function(){if(this._point)this._context.closePath()},point:function(e,t){e=+e,t=+t;if(this._point)this._context.lineTo(e,t);else this._point=1,this._context.moveTo(e,t)}}});function w7t(e){return e<0?-1:1}function E7t(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(w7t(o)+w7t(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function C7t(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function gUe(e,t,n){var r=e._x0,i=e._y0,o=e._x1,a=e._y1,s=(o-r)/3;e._context.bezierCurveTo(r+s,i+s*t,o-s,a-s*n,o,a)}function B0e(e){this._context=e}function S7t(e){this._context=new A7t(e)}function A7t(e){this._context=e}function sO(e){return new B0e(e)}function vK(e){return new S7t(e)}var k7t=Ce(()=>{B0e.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN;this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:gUe(this,this._t0,C7t(this,this._t0));break}if(this._line||this._line!==0&&this._point===1)this._context.closePath();this._line=1-this._line},point:function(e,t){var n=NaN;e=+e,t=+t;if(e===this._x1&&t===this._y1)return;switch(this._point){case 0:this._point=1;this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;gUe(this,C7t(this,n=E7t(this,e,t)),n);break;default:gUe(this,this._t0,n=E7t(this,e,t));break}this._x0=this._x1,this._x1=e;this._y0=this._y1,this._y1=t;this._t0=n}};(S7t.prototype=Object.create(B0e.prototype)).point=function(e,t){B0e.prototype.point.call(this,t,e)};A7t.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}}});function P7t(e){this._context=e}function R7t(e){var t,n=e.length-1,r,i=new Array(n),o=new Array(n),a=new Array(n);i[0]=0,o[0]=2,a[0]=e[0]+2*e[1];for(t=1;t=0;--t)i[t]=(a[t]-i[t+1])/o[t];o[n-1]=(e[n]+i[n-1])/2;for(t=0;t{P7t.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[];this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n){this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]);if(n===2){this._context.lineTo(e[1],t[1])}else{var r=R7t(e),i=R7t(t);for(var o=0,a=1;a{z0e.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN;this._point=0},lineEnd:function(){if(0=0)this._t=1-this._t,this._line=1-this._line},point:function(e,t){e=+e,t=+t;switch(this._point){case 0:this._point=1;this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0){this._context.lineTo(this._x,t);this._context.lineTo(e,t)}else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y);this._context.lineTo(n,t)}break}}this._x=e,this._y=t}}});function CK(e,t){if(!((a=e.length)>1))return;for(var n=1,r,i,o=e[t[0]],a,s=o.length;n{});function VE(e){var t=e.length,n=new Array(t);while(--t>=0)n[t]=t;return n}var bUe=Ce(()=>{});function K5r(e,t){return e[t]}function Z5r(e){const t=[];t.key=e;return t}function lO(){var e=cu([]),t=VE,n=CK,r=K5r;function i(o){var a=Array.from(e.apply(this,arguments),Z5r),s,l=a.length,u=-1,d;for(const f of o){for(s=0,++u;s{M0e();uK();yUe();bUe()});function cO(e,t){if(!((r=e.length)>0))return;for(var n,r,i=0,o=e[0].length,a;i{yUe()});function uO(e,t){if(!((l=e.length)>0))return;for(var n,r=0,i,o,a,s,l,u=e[t[0]].length;r0){i[0]=a,i[1]=a+=o}else if(o<0){i[1]=s,i[0]=s+=o}else{i[0]=0,i[1]=o}}}}var F7t=Ce(()=>{});var $E=Ce(()=>{J8t();r7t();l7t();d7t();h7t();gK();c7t();m7t();uUe();fUe();bK();b7t();v7t();O0e();T7t();oUe();k7t();I7t();M7t();L7t();D7t();F7t();bUe()});function _Br(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else while(--r>=0)t+=n[r].value;e.value=t}function ozt(){return this.eachAfter(_Br)}var azt=Ce(()=>{});function szt(e,t){let n=-1;for(const r of this){e.call(t,r,++n,this)}return this}var lzt=Ce(()=>{});function czt(e,t){var n=this,r=[n],i,o,a=-1;while(n=r.pop()){e.call(t,n,++a,this);if(i=n.children){for(o=i.length-1;o>=0;--o){r.push(i[o])}}}return this}var uzt=Ce(()=>{});function dzt(e,t){var n=this,r=[n],i=[],o,a,s,l=-1;while(n=r.pop()){i.push(n);if(o=n.children){for(a=0,s=o.length;a{});function hzt(e,t){let n=-1;for(const r of this){if(e.call(t,r,++n,this)){return r}}}var pzt=Ce(()=>{});function mzt(e){return this.eachAfter(function(t){var n=+e(t.data)||0,r=t.children,i=r&&r.length;while(--i>=0)n+=r[i].value;t.value=n})}var gzt=Ce(()=>{});function yzt(e){return this.eachBefore(function(t){if(t.children){t.children.sort(e)}})}var bzt=Ce(()=>{});function xzt(e){var t=this,n=TBr(t,e),r=[t];while(t!==n){t=t.parent;r.push(t)}var i=r.length;while(e!==n){r.splice(i,0,e);e=e.parent}return r}function TBr(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;e=n.pop();t=r.pop();while(e===t){i=e;e=n.pop();t=r.pop()}return i}var vzt=Ce(()=>{});function _zt(){var e=this,t=[e];while(e=e.parent){t.push(e)}return t}var Tzt=Ce(()=>{});function wzt(){return Array.from(this)}var Ezt=Ce(()=>{});function Czt(){var e=[];this.eachBefore(function(t){if(!t.children){e.push(t)}});return e}var Szt=Ce(()=>{});function Azt(){var e=this,t=[];e.each(function(n){if(n!==e){t.push({source:n.parent,target:n})}});return t}var kzt=Ce(()=>{});function*Rzt(){var e=this,t,n=[e],r,i,o;do{t=n.reverse(),n=[];while(e=t.pop()){yield e;if(r=e.children){for(i=0,o=r.length;i{});function HE(e,t){if(e instanceof Map){e=[void 0,e];if(t===void 0)t=CBr}else if(t===void 0){t=EBr}var n=new IK(e),r,i=[n],o,a,s,l;while(r=i.pop()){if((a=t(r.data))&&(l=(a=Array.from(a)).length)){r.children=a;for(s=l-1;s>=0;--s){i.push(o=a[s]=new IK(a[s]));o.parent=r;o.depth=r.depth+1}}}return n.eachBefore(ABr)}function wBr(){return HE(this).eachBefore(SBr)}function EBr(e){return e.children}function CBr(e){return Array.isArray(e)?e[1]:null}function SBr(e){if(e.data.value!==void 0)e.value=e.data.value;e.data=e.data.data}function ABr(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function IK(e){this.data=e;this.depth=this.height=0;this.parent=null}var Izt=Ce(()=>{azt();lzt();uzt();fzt();pzt();gzt();bzt();vzt();Tzt();Ezt();Szt();kzt();Pzt();IK.prototype=HE.prototype={constructor:IK,count:ozt,each:szt,eachAfter:dzt,eachBefore:czt,find:hzt,sum:mzt,sort:yzt,path:xzt,ancestors:_zt,descendants:wzt,leaves:Czt,links:Azt,copy:wBr,[Symbol.iterator]:Rzt}});function Mzt(e){if(typeof e!=="function")throw new Error;return e}var Lzt=Ce(()=>{});function k9(){return 0}function R9(e){return function(){return e}}var Dzt=Ce(()=>{});function q0e(e){e.x0=Math.round(e.x0);e.y0=Math.round(e.y0);e.x1=Math.round(e.x1);e.y1=Math.round(e.y1)}var EUe=Ce(()=>{});function X0e(e,t,n,r,i){var o=e.children,a,s=-1,l=o.length,u=e.value&&(r-t)/e.value;while(++s{});function SUe(){var e=1,t=1,n=0,r=false;function i(a){var s=a.height+1;a.x0=a.y0=n;a.x1=e;a.y1=t/s;a.eachBefore(o(t,s));if(r)a.eachBefore(q0e);return a}function o(a,s){return function(l){if(l.children){X0e(l,l.x0,a*(l.depth+1)/s,l.x1,a*(l.depth+2)/s)}var u=l.x0,d=l.y0,f=l.x1-n,h=l.y1-n;if(f{EUe();CUe()});function Nzt(e,t,n,r,i){var o=e.children,a,s=-1,l=o.length,u=e.value&&(i-n)/e.value;while(++s{});function RBr(e,t,n,r,i,o){var a=[],s=t.children,l,u,d=0,f=0,h=s.length,m,g,x=t.value,w,_,C,A,P,L,I;while(dC)C=u;I=w*w*L;A=Math.max(C/I,I/_);if(A>P){w-=u;break}P=A}a.push(l={value:w,dice:m{CUe();Ozt();kBr=(1+Math.sqrt(5))/2;MK=function e(t){function n(r,i,o,a,s){RBr(t,r,i,o,a,s)}n.ratio=function(r){return e((r=+r)>1?r:1)};return n}(kBr)});function LK(){var e=MK,t=false,n=1,r=1,i=[0],o=k9,a=k9,s=k9,l=k9,u=k9;function d(h){h.x0=h.y0=0;h.x1=n;h.y1=r;h.eachBefore(f);i=[0];if(t)h.eachBefore(q0e);return h}function f(h){var m=i[h.depth],g=h.x0+m,x=h.y0+m,w=h.x1-m,_=h.y1-m;if(w{EUe();AUe();Lzt();Dzt()});var j0e=Ce(()=>{Izt();Fzt();Bzt();AUe()});function PWt(e,t=0){return(bg[e[t+0]]+bg[e[t+1]]+bg[e[t+2]]+bg[e[t+3]]+"-"+bg[e[t+4]]+bg[e[t+5]]+"-"+bg[e[t+6]]+bg[e[t+7]]+"-"+bg[e[t+8]]+bg[e[t+9]]+"-"+bg[e[t+10]]+bg[e[t+11]]+bg[e[t+12]]+bg[e[t+13]]+bg[e[t+14]]+bg[e[t+15]]).toLowerCase()}var bg;var IWt=Ce(()=>{bg=[];for(let e=0;e<256;++e){bg.push((e+256).toString(16).slice(1))}});import{randomFillSync as LXr}from"node:crypto";function TGe(){if(_ve>Tve.length-16){LXr(Tve);_ve=0}return Tve.slice(_ve,_ve+=16)}var Tve,_ve;var MWt=Ce(()=>{Tve=new Uint8Array(256);_ve=Tve.length});import{randomUUID as DXr}from"node:crypto";var wGe;var LWt=Ce(()=>{wGe={randomUUID:DXr}});function FXr(e,t,n){e=e||{};const r=e.random??e.rng?.()??TGe();if(r.length<16){throw new Error("Random bytes length must be >= 16")}r[6]=r[6]&15|64;r[8]=r[8]&63|128;if(t){n=n||0;if(n<0||n+16>t.length){throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`)}for(let i=0;i<16;++i){t[n+i]=r[i]}return t}return PWt(r)}function NXr(e,t,n){if(wGe.randomUUID&&!t&&!e){return wGe.randomUUID()}return FXr(e,t,n)}var cw;var DWt=Ce(()=>{LWt();MWt();IWt();cw=NXr});var IU=Ce(()=>{DWt()});var gjt=_r((Sma,mjt)=>{function rjt(e){if(e instanceof Map){e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}}else if(e instanceof Set){e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}}Object.freeze(e);Object.getOwnPropertyNames(e).forEach(t=>{const n=e[t];const r=typeof n;if((r==="object"||r==="function")&&!Object.isFrozen(n)){rjt(n)}});return e}var A_e=class{constructor(t){if(t.data===void 0)t.data={};this.data=t.data;this.isMatchIgnored=false}ignoreMatch(){this.isMatchIgnored=true}};function ijt(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function SM(e,...t){const n=Object.create(null);for(const r in e){n[r]=e[r]}t.forEach(function(r){for(const i in r){n[i]=r[i]}});return n}var Mei="";var ZXt=e=>{return!!e.scope};var Lei=(e,{prefix:t})=>{if(e.startsWith("language:")){return e.replace("language:","language-")}if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${t}${e}`};var yWe=class{constructor(t,n){this.buffer="";this.classPrefix=n.classPrefix;t.walk(this)}addText(t){this.buffer+=ijt(t)}openNode(t){if(!ZXt(t))return;const n=Lei(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){if(!ZXt(t))return;this.buffer+=Mei}value(){return this.buffer}span(t){this.buffer+=``}};var JXt=(e={})=>{const t={children:[]};Object.assign(t,e);return t};var bWe=class e{constructor(){this.rootNode=JXt();this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const n=JXt({scope:t});this.add(n);this.stack.push(n)}closeNode(){if(this.stack.length>1){return this.stack.pop()}return void 0}closeAllNodes(){while(this.closeNode());}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){if(typeof n==="string"){t.addText(n)}else if(n.children){t.openNode(n);n.children.forEach(r=>this._walk(t,r));t.closeNode(n)}return t}static _collapse(t){if(typeof t==="string")return;if(!t.children)return;if(t.children.every(n=>typeof n==="string")){t.children=[t.children.join("")]}else{t.children.forEach(n=>{e._collapse(n)})}}};var xWe=class extends bWe{constructor(t){super();this.options=t}addText(t){if(t===""){return}this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){const r=t.root;if(n)r.scope=`language:${n}`;this.add(r)}toHTML(){const t=new yWe(this,this.options);return t.value()}finalize(){this.closeAllNodes();return true}};function $J(e){if(!e)return null;if(typeof e==="string")return e;return e.source}function ojt(e){return h5("(?=",e,")")}function Dei(e){return h5("(?:",e,")*")}function Fei(e){return h5("(?:",e,")?")}function h5(...e){const t=e.map(n=>$J(n)).join("");return t}function Nei(e){const t=e[e.length-1];if(typeof t==="object"&&t.constructor===Object){e.splice(e.length-1,1);return t}else{return{}}}function _We(...e){const t=Nei(e);const n="("+(t.capture?"":"?:")+e.map(r=>$J(r)).join("|")+")";return n}function ajt(e){return new RegExp(e.toString()+"|").exec("").length-1}function Oei(e,t){const n=e&&e.exec(t);return n&&n.index===0}var Bei=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function TWe(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const i=n;let o=$J(r);let a="";while(o.length>0){const s=Bei.exec(o);if(!s){a+=o;break}a+=o.substring(0,s.index);o=o.substring(s.index+s[0].length);if(s[0][0]==="\\"&&s[1]){a+="\\"+String(Number(s[1])+i)}else{a+=s[0];if(s[0]==="("){n++}}}return a}).map(r=>`(${r})`).join(t)}var zei=/\b\B/;var sjt="[a-zA-Z]\\w*";var wWe="[a-zA-Z_]\\w*";var ljt="\\b\\d+(\\.\\d+)?";var cjt="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)";var ujt="\\b(0b[01]+)";var Uei="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";var Vei=(e={})=>{const t=/^#![ ]*\//;if(e.binary){e.begin=h5(t,/.*\b/,e.binary,/\b.*/)}return SM({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{if(n.index!==0)r.ignoreMatch()}},e)};var GJ={begin:"\\\\[\\s\\S]",relevance:0};var $ei={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[GJ]};var Gei={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[GJ]};var Hei={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/};var R_e=function(e,t,n={}){const r=SM({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:true,relevance:0});const i=_We("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);r.contains.push({begin:h5(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")});return r};var Wei=R_e("//","$");var Yei=R_e("/\\*","\\*/");var qei=R_e("#","$");var Xei={scope:"number",begin:ljt,relevance:0};var jei={scope:"number",begin:cjt,relevance:0};var Kei={scope:"number",begin:ujt,relevance:0};var Zei={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[GJ,{begin:/\[/,end:/\]/,relevance:0,contains:[GJ]}]};var Jei={scope:"title",begin:sjt,relevance:0};var Qei={scope:"title",begin:wWe,relevance:0};var eti={begin:"\\.\\s*"+wWe,relevance:0};var tti=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{if(n.data._beginMatch!==t[1])n.ignoreMatch()}})};var S_e=Object.freeze({__proto__:null,APOS_STRING_MODE:$ei,BACKSLASH_ESCAPE:GJ,BINARY_NUMBER_MODE:Kei,BINARY_NUMBER_RE:ujt,COMMENT:R_e,C_BLOCK_COMMENT_MODE:Yei,C_LINE_COMMENT_MODE:Wei,C_NUMBER_MODE:jei,C_NUMBER_RE:cjt,END_SAME_AS_BEGIN:tti,HASH_COMMENT_MODE:qei,IDENT_RE:sjt,MATCH_NOTHING_RE:zei,METHOD_GUARD:eti,NUMBER_MODE:Xei,NUMBER_RE:ljt,PHRASAL_WORDS_MODE:Hei,QUOTE_STRING_MODE:Gei,REGEXP_MODE:Zei,RE_STARTERS_RE:Uei,SHEBANG:Vei,TITLE_MODE:Jei,UNDERSCORE_IDENT_RE:wWe,UNDERSCORE_TITLE_MODE:Qei});function nti(e,t){const n=e.input[e.index-1];if(n==="."){t.ignoreMatch()}}function rti(e,t){if(e.className!==void 0){e.scope=e.className;delete e.className}}function iti(e,t){if(!t)return;if(!e.beginKeywords)return;e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)";e.__beforeBegin=nti;e.keywords=e.keywords||e.beginKeywords;delete e.beginKeywords;if(e.relevance===void 0)e.relevance=0}function oti(e,t){if(!Array.isArray(e.illegal))return;e.illegal=_We(...e.illegal)}function ati(e,t){if(!e.match)return;if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match;delete e.match}function sti(e,t){if(e.relevance===void 0)e.relevance=1}var lti=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(r=>{delete e[r]});e.keywords=n.keywords;e.begin=h5(n.beforeMatch,ojt(n.begin));e.starts={relevance:0,contains:[Object.assign(n,{endsParent:true})]};e.relevance=0;delete n.beforeMatch};var cti=["of","and","for","in","not","or","if","then","parent","list","value"];var uti="keyword";function djt(e,t,n=uti){const r=Object.create(null);if(typeof e==="string"){i(n,e.split(" "))}else if(Array.isArray(e)){i(n,e)}else{Object.keys(e).forEach(function(o){Object.assign(r,djt(e[o],t,o))})}return r;function i(o,a){if(t){a=a.map(s=>s.toLowerCase())}a.forEach(function(s){const l=s.split("|");r[l[0]]=[o,dti(l[0],l[1])]})}}function dti(e,t){if(t){return Number(t)}return fti(e)?0:1}function fti(e){return cti.includes(e.toLowerCase())}var QXt={};var f5=e=>{console.error(e)};var ejt=(e,...t)=>{console.log(`WARN: ${e}`,...t)};var dV=(e,t)=>{if(QXt[`${e}/${t}`])return;console.log(`Deprecated as of ${e}. ${t}`);QXt[`${e}/${t}`]=true};var k_e=new Error;function fjt(e,t,{key:n}){let r=0;const i=e[n];const o={};const a={};for(let s=1;s<=t.length;s++){a[s+r]=i[s];o[s+r]=true;r+=ajt(t[s-1])}e[n]=a;e[n]._emit=o;e[n]._multi=true}function hti(e){if(!Array.isArray(e.begin))return;if(e.skip||e.excludeBegin||e.returnBegin){f5("skip, excludeBegin, returnBegin not compatible with beginScope: {}");throw k_e}if(typeof e.beginScope!=="object"||e.beginScope===null){f5("beginScope must be object");throw k_e}fjt(e,e.begin,{key:"beginScope"});e.begin=TWe(e.begin,{joinWith:""})}function pti(e){if(!Array.isArray(e.end))return;if(e.skip||e.excludeEnd||e.returnEnd){f5("skip, excludeEnd, returnEnd not compatible with endScope: {}");throw k_e}if(typeof e.endScope!=="object"||e.endScope===null){f5("endScope must be object");throw k_e}fjt(e,e.end,{key:"endScope"});e.end=TWe(e.end,{joinWith:""})}function mti(e){if(e.scope&&typeof e.scope==="object"&&e.scope!==null){e.beginScope=e.scope;delete e.scope}}function gti(e){mti(e);if(typeof e.beginScope==="string"){e.beginScope={_wrap:e.beginScope}}if(typeof e.endScope==="string"){e.endScope={_wrap:e.endScope}}hti(e);pti(e)}function yti(e){function t(a,s){return new RegExp($J(a),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(s?"g":""))}class n{constructor(){this.matchIndexes={};this.regexes=[];this.matchAt=1;this.position=0}addRule(s,l){l.position=this.position++;this.matchIndexes[this.matchAt]=l;this.regexes.push([l,s]);this.matchAt+=ajt(s)+1}compile(){if(this.regexes.length===0){this.exec=()=>null}const s=this.regexes.map(l=>l[1]);this.matcherRe=t(TWe(s,{joinWith:"|"}),true);this.lastIndex=0}exec(s){this.matcherRe.lastIndex=this.lastIndex;const l=this.matcherRe.exec(s);if(!l){return null}const u=l.findIndex((f,h)=>h>0&&f!==void 0);const d=this.matchIndexes[u];l.splice(0,u);return Object.assign(l,d)}}class r{constructor(){this.rules=[];this.multiRegexes=[];this.count=0;this.lastIndex=0;this.regexIndex=0}getMatcher(s){if(this.multiRegexes[s])return this.multiRegexes[s];const l=new n;this.rules.slice(s).forEach(([u,d])=>l.addRule(u,d));l.compile();this.multiRegexes[s]=l;return l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(s,l){this.rules.push([s,l]);if(l.type==="begin")this.count++}exec(s){const l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let u=l.exec(s);if(this.resumingScanAtSamePosition()){if(u&&u.index===this.lastIndex);else{const d=this.getMatcher(0);d.lastIndex=this.lastIndex+1;u=d.exec(s)}}if(u){this.regexIndex+=u.position+1;if(this.regexIndex===this.count){this.considerAll()}}return u}}function i(a){const s=new r;a.contains.forEach(l=>s.addRule(l.begin,{rule:l,type:"begin"}));if(a.terminatorEnd){s.addRule(a.terminatorEnd,{type:"end"})}if(a.illegal){s.addRule(a.illegal,{type:"illegal"})}return s}function o(a,s){const l=a;if(a.isCompiled)return l;[rti,ati,gti,lti].forEach(d=>d(a,s));e.compilerExtensions.forEach(d=>d(a,s));a.__beforeBegin=null;[iti,oti,sti].forEach(d=>d(a,s));a.isCompiled=true;let u=null;if(typeof a.keywords==="object"&&a.keywords.$pattern){a.keywords=Object.assign({},a.keywords);u=a.keywords.$pattern;delete a.keywords.$pattern}u=u||/\w+/;if(a.keywords){a.keywords=djt(a.keywords,e.case_insensitive)}l.keywordPatternRe=t(u,true);if(s){if(!a.begin)a.begin=/\B|\b/;l.beginRe=t(l.begin);if(!a.end&&!a.endsWithParent)a.end=/\B|\b/;if(a.end)l.endRe=t(l.end);l.terminatorEnd=$J(l.end)||"";if(a.endsWithParent&&s.terminatorEnd){l.terminatorEnd+=(a.end?"|":"")+s.terminatorEnd}}if(a.illegal)l.illegalRe=t(a.illegal);if(!a.contains)a.contains=[];a.contains=[].concat(...a.contains.map(function(d){return bti(d==="self"?a:d)}));a.contains.forEach(function(d){o(d,l)});if(a.starts){o(a.starts,s)}l.matcher=i(l);return l}if(!e.compilerExtensions)e.compilerExtensions=[];if(e.contains&&e.contains.includes("self")){throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.")}e.classNameAliases=SM(e.classNameAliases||{});return o(e)}function hjt(e){if(!e)return false;return e.endsWithParent||hjt(e.starts)}function bti(e){if(e.variants&&!e.cachedVariants){e.cachedVariants=e.variants.map(function(t){return SM(e,{variants:null},t)})}if(e.cachedVariants){return e.cachedVariants}if(hjt(e)){return SM(e,{starts:e.starts?SM(e.starts):null})}if(Object.isFrozen(e)){return SM(e)}return e}var xti="11.11.1";var vWe=class extends Error{constructor(t,n){super(t);this.name="HTMLInjectionError";this.html=n}};var gWe=ijt;var tjt=SM;var njt=Symbol("nomatch");var vti=7;var pjt=function(e){const t=Object.create(null);const n=Object.create(null);const r=[];let i=true;const o="Could not find the language '{}', did you forget to load/include a language module?";const a={disableAutodetect:true,name:"Plain text",contains:[]};let s={ignoreUnescapedHTML:false,throwUnescapedHTML:false,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:xWe};function l(j){return s.noHighlightRe.test(j)}function u(j){let te=j.className+" ";te+=j.parentNode?j.parentNode.className:"";const J=s.languageDetectRe.exec(te);if(J){const oe=O(J[1]);if(!oe){ejt(o.replace("{}",J[1]));ejt("Falling back to no-highlight mode for this block.",j)}return oe?J[1]:"no-highlight"}return te.split(/\s+/).find(oe=>l(oe)||O(oe))}function d(j,te,J){let oe="";let se="";if(typeof te==="object"){oe=j;J=te.ignoreIllegals;se=te.language}else{dV("10.7.0","highlight(lang, code, ...args) has been deprecated.");dV("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277");se=j;oe=te}if(J===void 0){J=true}const re={code:oe,language:se};K("before:highlight",re);const ce=re.result?re.result:f(re.language,re.code,J);ce.code=re.code;K("after:highlight",ce);return ce}function f(j,te,J,oe){const se=Object.create(null);function re(Be,qe){return Be.keywords[qe]}function ce(){if(!Ge.keywords){bt.addText(He);return}let Be=0;Ge.keywordPatternRe.lastIndex=0;let qe=Ge.keywordPatternRe.exec(He);let Qe="";while(qe){Qe+=He.substring(Be,qe.index);const ze=yt.case_insensitive?qe[0].toLowerCase():qe[0];const Me=re(Ge,ze);if(Me){const[ye,Ne]=Me;bt.addText(Qe);Qe="";se[ze]=(se[ze]||0)+1;if(se[ze]<=vti)Je+=Ne;if(ye.startsWith("_")){Qe+=qe[0]}else{const Ae=yt.classNameAliases[ye]||ye;be(qe[0],Ae)}}else{Qe+=qe[0]}Be=Ge.keywordPatternRe.lastIndex;qe=Ge.keywordPatternRe.exec(He)}Qe+=He.substring(Be);bt.addText(Qe)}function ue(){if(He==="")return;let Be=null;if(typeof Ge.subLanguage==="string"){if(!t[Ge.subLanguage]){bt.addText(He);return}Be=f(Ge.subLanguage,He,true,it[Ge.subLanguage]);it[Ge.subLanguage]=Be._top}else{Be=m(He,Ge.subLanguage.length?Ge.subLanguage:null)}if(Ge.relevance>0){Je+=Be.relevance}bt.__addSublanguage(Be._emitter,Be.language)}function xe(){if(Ge.subLanguage!=null){ue()}else{ce()}He=""}function be(Be,qe){if(Be==="")return;bt.startScope(qe);bt.addText(Be);bt.endScope()}function Ie(Be,qe){let Qe=1;const ze=qe.length-1;while(Qe<=ze){if(!Be._emit[Qe]){Qe++;continue}const Me=yt.classNameAliases[Be[Qe]]||Be[Qe];const ye=qe[Qe];if(Me){be(ye,Me)}else{He=ye;ce();He=""}Qe++}}function he(Be,qe){if(Be.scope&&typeof Be.scope==="string"){bt.openNode(yt.classNameAliases[Be.scope]||Be.scope)}if(Be.beginScope){if(Be.beginScope._wrap){be(He,yt.classNameAliases[Be.beginScope._wrap]||Be.beginScope._wrap);He=""}else if(Be.beginScope._multi){Ie(Be.beginScope,qe);He=""}}Ge=Object.create(Be,{parent:{value:Ge}});return Ge}function ve(Be,qe,Qe){let ze=Oei(Be.endRe,Qe);if(ze){if(Be["on:end"]){const Me=new A_e(Be);Be["on:end"](qe,Me);if(Me.isMatchIgnored)ze=false}if(ze){while(Be.endsParent&&Be.parent){Be=Be.parent}return Be}}if(Be.endsWithParent){return ve(Be.parent,qe,Qe)}}function ge(Be){if(Ge.matcher.regexIndex===0){He+=Be[0];return 1}else{Ze=true;return 0}}function Ve(Be){const qe=Be[0];const Qe=Be.rule;const ze=new A_e(Qe);const Me=[Qe.__beforeBegin,Qe["on:begin"]];for(const ye of Me){if(!ye)continue;ye(Be,ze);if(ze.isMatchIgnored)return ge(qe)}if(Qe.skip){He+=qe}else{if(Qe.excludeBegin){He+=qe}xe();if(!Qe.returnBegin&&!Qe.excludeBegin){He=qe}}he(Qe,Be);return Qe.returnBegin?0:qe.length}function Le(Be){const qe=Be[0];const Qe=te.substring(Be.index);const ze=ve(Ge,Be,Qe);if(!ze){return njt}const Me=Ge;if(Ge.endScope&&Ge.endScope._wrap){xe();be(qe,Ge.endScope._wrap)}else if(Ge.endScope&&Ge.endScope._multi){xe();Ie(Ge.endScope,Be)}else if(Me.skip){He+=qe}else{if(!(Me.returnEnd||Me.excludeEnd)){He+=qe}xe();if(Me.excludeEnd){He=qe}}do{if(Ge.scope){bt.closeNode()}if(!Ge.skip&&!Ge.subLanguage){Je+=Ge.relevance}Ge=Ge.parent}while(Ge!==ze.parent);if(ze.starts){he(ze.starts,Be)}return Me.returnEnd?0:qe.length}function $e(){const Be=[];for(let qe=Ge;qe!==yt;qe=qe.parent){if(qe.scope){Be.unshift(qe.scope)}}Be.forEach(qe=>bt.openNode(qe))}let Ee={};function tt(Be,qe){const Qe=qe&&qe[0];He+=Be;if(Qe==null){xe();return 0}if(Ee.type==="begin"&&qe.type==="end"&&Ee.index===qe.index&&Qe===""){He+=te.slice(qe.index,qe.index+1);if(!i){const ze=new Error(`0 width match regex (${j})`);ze.languageName=j;ze.badRule=Ee.rule;throw ze}return 1}Ee=qe;if(qe.type==="begin"){return Ve(qe)}else if(qe.type==="illegal"&&!J){const ze=new Error('Illegal lexeme "'+Qe+'" for mode "'+(Ge.scope||"")+'"');ze.mode=Ge;throw ze}else if(qe.type==="end"){const ze=Le(qe);if(ze!==njt){return ze}}if(qe.type==="illegal"&&Qe===""){He+="\n";return 1}if(we>1e5&&we>qe.index*3){const ze=new Error("potential infinite loop, way more iterations than matches");throw ze}He+=Qe;return Qe.length}const yt=O(j);if(!yt){f5(o.replace("{}",j));throw new Error('Unknown language: "'+j+'"')}const mt=yti(yt);let ct="";let Ge=oe||mt;const it={};const bt=new s.__emitter(s);$e();let He="";let Je=0;let Te=0;let we=0;let Ze=false;try{if(!yt.__emitTokens){Ge.matcher.considerAll();for(;;){we++;if(Ze){Ze=false}else{Ge.matcher.considerAll()}Ge.matcher.lastIndex=Te;const Be=Ge.matcher.exec(te);if(!Be)break;const qe=te.substring(Te,Be.index);const Qe=tt(qe,Be);Te=Be.index+Qe}tt(te.substring(Te))}else{yt.__emitTokens(te,bt)}bt.finalize();ct=bt.toHTML();return{language:j,value:ct,relevance:Je,illegal:false,_emitter:bt,_top:Ge}}catch(Be){if(Be.message&&Be.message.includes("Illegal")){return{language:j,value:gWe(te),illegal:true,relevance:0,_illegalBy:{message:Be.message,index:Te,context:te.slice(Te-100,Te+100),mode:Be.mode,resultSoFar:ct},_emitter:bt}}else if(i){return{language:j,value:gWe(te),illegal:false,relevance:0,errorRaised:Be,_emitter:bt,_top:Ge}}else{throw Be}}}function h(j){const te={value:gWe(j),illegal:false,relevance:0,_top:a,_emitter:new s.__emitter(s)};te._emitter.addText(j);return te}function m(j,te){te=te||s.languages||Object.keys(t);const J=h(j);const oe=te.filter(O).filter(U).map(xe=>f(xe,j,false));oe.unshift(J);const se=oe.sort((xe,be)=>{if(xe.relevance!==be.relevance)return be.relevance-xe.relevance;if(xe.language&&be.language){if(O(xe.language).supersetOf===be.language){return 1}else if(O(be.language).supersetOf===xe.language){return-1}}return 0});const[re,ce]=se;const ue=re;ue.secondBest=ce;return ue}function g(j,te,J){const oe=te&&n[te]||J;j.classList.add("hljs");j.classList.add(`language-${oe}`)}function x(j){let te=null;const J=u(j);if(l(J))return;K("before:highlightElement",{el:j,language:J});if(j.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",j);return}if(j.children.length>0){if(!s.ignoreUnescapedHTML){console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk.");console.warn("https://github.com/highlightjs/highlight.js/wiki/security");console.warn("The element with unescaped HTML:");console.warn(j)}if(s.throwUnescapedHTML){const re=new vWe("One of your code blocks includes unescaped HTML.",j.innerHTML);throw re}}te=j;const oe=te.textContent;const se=J?d(oe,{language:J,ignoreIllegals:true}):m(oe);j.innerHTML=se.value;j.dataset.highlighted="yes";g(j,J,se.language);j.result={language:se.language,re:se.relevance,relevance:se.relevance};if(se.secondBest){j.secondBest={language:se.secondBest.language,relevance:se.secondBest.relevance}}K("after:highlightElement",{el:j,result:se,text:oe})}function w(j){s=tjt(s,j)}const _=()=>{P();dV("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function C(){P();dV("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let A=false;function P(){function j(){P()}if(document.readyState==="loading"){if(!A){window.addEventListener("DOMContentLoaded",j,false)}A=true;return}const te=document.querySelectorAll(s.cssSelector);te.forEach(x)}function L(j,te){let J=null;try{J=te(e)}catch(oe){f5("Language definition for '{}' could not be registered.".replace("{}",j));if(!i){throw oe}else{f5(oe)}J=a}if(!J.name)J.name=j;t[j]=J;J.rawDefinition=te.bind(null,e);if(J.aliases){z(J.aliases,{languageName:j})}}function I(j){delete t[j];for(const te of Object.keys(n)){if(n[te]===j){delete n[te]}}}function N(){return Object.keys(t)}function O(j){j=(j||"").toLowerCase();return t[j]||t[n[j]]}function z(j,{languageName:te}){if(typeof j==="string"){j=[j]}j.forEach(J=>{n[J.toLowerCase()]=te})}function U(j){const te=O(j);return te&&!te.disableAutodetect}function W(j){if(j["before:highlightBlock"]&&!j["before:highlightElement"]){j["before:highlightElement"]=te=>{j["before:highlightBlock"](Object.assign({block:te.el},te))}}if(j["after:highlightBlock"]&&!j["after:highlightElement"]){j["after:highlightElement"]=te=>{j["after:highlightBlock"](Object.assign({block:te.el},te))}}}function H(j){W(j);r.push(j)}function $(j){const te=r.indexOf(j);if(te!==-1){r.splice(te,1)}}function K(j,te){const J=j;r.forEach(function(oe){if(oe[J]){oe[J](te)}})}function X(j){dV("10.7.0","highlightBlock will be removed entirely in v12.0");dV("10.7.0","Please use highlightElement now.");return x(j)}Object.assign(e,{highlight:d,highlightAuto:m,highlightAll:P,highlightElement:x,highlightBlock:X,configure:w,initHighlighting:_,initHighlightingOnLoad:C,registerLanguage:L,unregisterLanguage:I,listLanguages:N,getLanguage:O,registerAliases:z,autoDetection:U,inherit:tjt,addPlugin:H,removePlugin:$});e.debugMode=function(){i=false};e.safeMode=function(){i=true};e.versionString=xti;e.regex={concat:h5,lookahead:ojt,either:_We,optional:Fei,anyNumberOfTimes:Dei};for(const j in S_e){if(typeof S_e[j]==="object"){rjt(S_e[j])}}Object.assign(e,S_e);return e};var fV=pjt({});fV.newInstance=()=>pjt({});mjt.exports=fV;fV.HighlightJS=fV;fV.default=fV});var bjt=_r((Ama,yjt)=>{function _ti(e){const t=e.regex;const n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u);const r=/[\p{L}0-9._:-]+/u;const i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/};const o={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]};const a=e.inherit(o,{begin:/\(/,end:/\)/});const s=e.inherit(e.APOS_STRING_MODE,{className:"string"});const l=e.inherit(e.QUOTE_STRING_MODE,{className:"string"});const u={endsWithParent:true,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:true,unicodeRegex:true,contains:[{className:"meta",begin://,relevance:10,contains:[o,l,s,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[o,a,l,s]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:true,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:true,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:u}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:true}]}]}}yjt.exports=_ti});var vjt=_r((kma,xjt)=>{function Tti(e){const t=e.regex;const n={};const r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,`(?![\\w\\d])(?![$])`)},r]});const i={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]};const o=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}});const a={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}};const s={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);const l={match:/\\"/};const u={className:"string",begin:/'/,end:/'/};const d={match:/\\'/};const f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]};const h=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"];const m=e.SHEBANG({binary:`(${h.join("|")})`,relevance:10});const g={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:true,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};const x=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"];const w=["true","false"];const _={match:/(\/[a-z._-]+)+/};const C=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"];const A=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"];const P=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"];const L=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:x,literal:w,built_in:[...C,...A,"set","shopt",...P,...L]},contains:[m,e.SHEBANG(),g,f,o,a,_,s,l,u,d,n]}}xjt.exports=Tti});var Tjt=_r((Rma,_jt)=>{function wti(e){const t=e.regex;const n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]});const r="decltype\\(auto\\)";const i="[a-zA-Z_]\\w*::";const o="<[^<>]+>";const a="("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional(o)+")";const s={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]};const l="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)";const u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+l+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]};const d={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0};const f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]};const h={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0};const m=t.optional(i)+e.IDENT_RE+"\\s*\\(";const g=["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"];const x=["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"];const w={keyword:g,type:x,literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"};const _=[f,s,n,e.C_BLOCK_COMMENT_MODE,d,u];const C={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:_.concat([{begin:/\(/,end:/\)/,keywords:w,contains:_.concat(["self"]),relevance:0}]),relevance:0};const A={begin:"("+a+"[\\*&\\s]+)+"+m,returnBegin:true,end:/[{;=]/,excludeEnd:true,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:w,relevance:0},{begin:m,returnBegin:true,contains:[e.inherit(h,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,s,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,s]}]},s,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C",aliases:["h"],keywords:w,disableAutodetect:true,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:f,strings:u,keywords:w}}}_jt.exports=wti});var Ejt=_r((Pma,wjt)=>{function Eti(e){const t=e.regex;const n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]});const r="decltype\\(auto\\)";const i="[a-zA-Z_]\\w*::";const o="<[^<>]+>";const a="(?!struct)("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional(o)+")";const s={className:"type",begin:"\\b[a-z\\d_]*_t\\b"};const l="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)";const u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+l+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]};const d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0};const f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]};const h={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0};const m=t.optional(i)+e.IDENT_RE+"\\s*\\(";const g=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"];const x=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"];const w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"];const _=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"];const C=["NULL","false","nullopt","nullptr","true"];const A=["_Pragma"];const P={type:x,keyword:g,literal:C,built_in:A,_type_hints:w};const L={className:"function.dispatch",relevance:0,keywords:{_hint:_},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))};const I=[L,f,s,n,e.C_BLOCK_COMMENT_MODE,d,u];const N={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:P,contains:I.concat([{begin:/\(/,end:/\)/,keywords:P,contains:I.concat(["self"]),relevance:0}]),relevance:0};const O={className:"function",begin:"("+a+"[\\*&\\s]+)+"+m,returnBegin:true,end:/[{;=]/,excludeEnd:true,keywords:P,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:P,relevance:0},{begin:m,returnBegin:true,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:true,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:P,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,s,{begin:/\(/,end:/\)/,keywords:P,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,s]}]},s,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:P,illegal:"",keywords:P,contains:["self",s]},{begin:e.IDENT_RE+"::",keywords:P},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}wjt.exports=Eti});var Sjt=_r((Ima,Cjt)=>{function Cti(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"];const n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"];const r=["default","false","null","true"];const i=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"];const o=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"];const a={keyword:i.concat(o),built_in:t,literal:r};const s=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"});const l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0};const u={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1};const d={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]};const f=e.inherit(d,{illegal:/\n/});const h={className:"subst",begin:/\{/,end:/\}/,keywords:a};const m=e.inherit(h,{illegal:/\n/});const g={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,m]};const x={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]};const w=e.inherit(x,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},m]});h.contains=[x,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.C_BLOCK_COMMENT_MODE];m.contains=[w,g,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const _={variants:[u,x,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]};const C={begin:"<",end:">",contains:[{beginKeywords:"in out"},s]};const A=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?";const P={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:a,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:true,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:""},{begin:""}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},_,l,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},s,C,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[s,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[s,C,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:true,end:"\\]",excludeEnd:true,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+A+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:true,end:/\s*[{;=]/,excludeEnd:true,keywords:a,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:true,contains:[e.TITLE_MODE,C],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:true,excludeEnd:true,keywords:a,relevance:0,contains:[_,l,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},P]}}Cjt.exports=Cti});var kjt=_r((Mma,Ajt)=>{var Sti=e=>{return{IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}};var Ati=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"];var kti=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"];var Rti=[...Ati,...kti];var Pti=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse();var Iti=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse();var Mti=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse();var Lti=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function Dti(e){const t=e.regex;const n=Sti(e);const r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/};const i="and or not only";const o=/@-?\w[\w]*(-\w+)*/;const a="[a-zA-Z-][a-zA-Z0-9_-]*";const s=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:true,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+a,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Iti.join("|")+")"},{begin:":(:)?("+Mti.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Lti.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...s,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...s,{className:"string",begin:/[^)]/,endsWithParent:true,excludeEnd:true}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:o},{begin:/\s/,endsWithParent:true,excludeEnd:true,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:Pti.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...s,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Rti.join("|")+")\\b"}]}}Ajt.exports=Dti});var Pjt=_r((Lma,Rjt)=>{function Fti(e){const t=e.regex;const n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0};const r={begin:"^[-\\*]{3,}",end:"$"};const i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]};const o={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:true};const a={begin:/^\[[^\n]+\]:/,returnBegin:true,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:true,excludeEnd:true},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:true}]};const s=/[A-Za-z][A-Za-z0-9+.-]*/;const l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,s,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:true,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:true,returnEnd:true},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:true,excludeEnd:true},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:true,excludeEnd:true}]};const u={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]};const d={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]};const f=e.inherit(u,{contains:[]});const h=e.inherit(d,{contains:[]});u.contains.push(h);d.contains.push(f);let m=[n,l];[u,d,f,h].forEach(_=>{_.contains=_.contains.concat(m)});m=m.concat(u,d);const g={className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:m},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:m}]}]};const x={className:"quote",begin:"^>\\s+",contains:m,end:"$"};const w={scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/};return{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[g,n,o,u,d,x,i,r,l,a,w]}}Rjt.exports=Fti});var Mjt=_r((Dma,Ijt)=>{function Nti(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}Ijt.exports=Nti});var Djt=_r((Fma,Ljt)=>{function Oti(e){const t=e.regex;const n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)";const r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/);const i=t.concat(r,/(::\w+)*/);const o=["include","extend","prepend","public","private","protected","raise","throw"];const a={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...o],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]};const s={className:"doctag",begin:"@[A-Za-z]+"};const l={begin:"#<",end:">"};const u=[e.COMMENT("#","$",{contains:[s]}),e.COMMENT("^=begin","^=end",{contains:[s],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)];const d={className:"subst",begin:/#\{/,end:/\}/,keywords:a};const f={className:"string",contains:[e.BACKSLASH_ESCAPE,d],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,d]})]}]};const h="[1-9](_?[0-9])*|0";const m="[0-9](_?[0-9])*";const g={className:"number",relevance:0,variants:[{begin:`\\b(${h})(\\.(${m}))?([eE][+-]?(${m})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]};const x={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:true,endsParent:true,keywords:a}]};const w={match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:a};const _={variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:a};const C={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};const A={match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[x]};const P={relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}};const L={relevance:0,match:r,scope:"title.class"};const I=[f,_,w,P,C,L,A,{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[f,{begin:n}],relevance:0},g,{className:"variable",begin:`(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])`},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:true,excludeEnd:true,relevance:0,keywords:a},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,d],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(l,u),relevance:0}].concat(l,u);d.contains=I;x.contains=I;const N="[>?]>";const O="[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]";const z="(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>";const U=[{begin:/^\s*=>/,starts:{end:"$",contains:I}},{className:"meta.prompt",begin:"^("+N+"|"+O+"|"+z+")(?=[ ])",starts:{end:"$",keywords:a,contains:I}}];u.unshift(l);return{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(U).concat(u).concat(I)}}Ljt.exports=Oti});var Njt=_r((Nma,Fjt)=>{function Bti(e){const t=["true","false","iota","nil"];const n=["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"];const r=["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"];const i=["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"];const o={keyword:i,type:r,literal:t,built_in:n};return{name:"Go",aliases:["golang"],keywords:o,illegal:"{function zti(e){const t=e.regex;const n=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:true,disableAutodetect:false,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:true,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:true},{scope:"symbol",begin:t.concat(n,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}Ojt.exports=zti});var Ujt=_r((Bma,zjt)=>{function Uti(e){const t=e.regex;const n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]};const r=e.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const i={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]};const o={className:"literal",begin:/\bon|off|true|false|yes|no\b/};const a={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]};const s={begin:/\[/,end:/\]/,contains:[r,o,i,a,n,"self"],relevance:0};const l=/[A-Za-z0-9_-]+/;const u=/"(\\"|[^"])*"/;const d=/'[^']*'/;const f=t.either(l,u,d);const h=t.concat(f,"(\\s*\\.\\s*",f,")*",t.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:true,illegal:/\S/,contains:[r,{className:"section",begin:/\[+/,end:/\]+/},{begin:h,className:"attr",starts:{end:/$/,contains:[r,s,o,i,a,n]}}]}}zjt.exports=Uti});var Hjt=_r((zma,Gjt)=>{var hV="[0-9](_*[0-9])*";var P_e=`\\.(${hV})`;var I_e="[0-9a-fA-F](_*[0-9a-fA-F])*";var Vjt={className:"number",variants:[{begin:`(\\b(${hV})((${P_e})|\\.)?|(${P_e}))[eE][+-]?(${hV})[fFdD]?\\b`},{begin:`\\b(${hV})((${P_e})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${P_e})[fFdD]?\\b`},{begin:`\\b(${hV})[fFdD]\\b`},{begin:`\\b0[xX]((${I_e})\\.?|(${I_e})?\\.(${I_e}))[pP][+-]?(${hV})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${I_e})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function $jt(e,t,n){if(n===-1)return"";return e.replace(t,r=>{return $jt(e,t,n-1)})}function Vti(e){const t=e.regex;const n="[\xC0-\u02B8a-zA-Z_$][\xC0-\u02B8a-zA-Z_$0-9]*";const r=n+$jt("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2);const i=["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"];const o=["super","this"];const a=["false","true","null"];const s=["char","boolean","long","float","int","byte","short","double"];const l={keyword:i,literal:a,type:s,built_in:o};const u={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]};const d={className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:true};return{name:"Java",aliases:["jsp"],keywords:l,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[d,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:l,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,Vjt,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},Vjt,u]}}Gjt.exports=Vti});var Kjt=_r((Uma,jjt)=>{var Wjt="[A-Za-z$_][0-9A-Za-z$_]*";var $ti=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"];var Gti=["true","false","null","undefined","NaN","Infinity"];var Yjt=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"];var qjt=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"];var Xjt=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"];var Hti=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"];var Wti=[].concat(Xjt,Yjt,qjt);function Yti(e){const t=e.regex;const n=(J,{after:oe})=>{const se="",end:""};const o=/<[A-Za-z0-9\\._:-]+\s*\/>/;const a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(J,oe)=>{const se=J[0].length+J.index;const re=J.input[se];if(re==="<"||re===","){oe.ignoreMatch();return}if(re===">"){if(!n(J,{after:se})){oe.ignoreMatch()}}let ce;const ue=J.input.substring(se);if(ce=ue.match(/^\s*=/)){oe.ignoreMatch();return}if(ce=ue.match(/^\s+extends\s+/)){if(ce.index===0){oe.ignoreMatch();return}}}};const s={$pattern:Wjt,keyword:$ti,literal:Gti,built_in:Wti,"variable.language":Hti};const l="[0-9](_?[0-9])*";const u=`\\.(${l})`;const d=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`;const f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${l})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0};const h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]};const m={begin:".?html`",end:"",starts:{end:"`",returnEnd:false,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}};const g={begin:".?css`",end:"",starts:{end:"`",returnEnd:false,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}};const x={begin:".?gql`",end:"",starts:{end:"`",returnEnd:false,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}};const w={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]};const _=e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:true,excludeBegin:true,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:true,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]});const C={className:"comment",variants:[_,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]};const A=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,x,w,{match:/\$\d+/},f];h.contains=A.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(A)});const P=[].concat(C,h.contains);const L=P.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:["self"].concat(P)}]);const I={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:true,excludeEnd:true,keywords:s,contains:L};const N={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]};const O={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Yjt,...qjt]}};const z={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/};const U={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[I],illegal:/%/};const W={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function H(J){return t.concat("(?!",J.join("|"),")")}const $={match:t.concat(/\b/,H([...Xjt,"super","import"].map(J=>`${J}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0};const K={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:true,keywords:"prototype",className:"property",relevance:0};const X={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},I]};const j="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>";const te={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(j)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[I]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:L,CLASS_REFERENCE:O},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),z,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,x,w,C,{match:/\$\d+/},f,O,{scope:"attr",match:r+t.lookahead(":"),relevance:0},te,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[C,e.REGEXP_MODE,{className:"function",begin:j,returnBegin:true,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:true},{begin:/(\s*)\(/,end:/\)/,excludeBegin:true,excludeEnd:true,keywords:s,contains:L}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:true,contains:["self"]}]}]},U,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:true,label:"func.def",contains:[I,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},K,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[I]},$,W,N,X,{match:/\$[(.]/}]}}jjt.exports=Yti});var Jjt=_r((Vma,Zjt)=>{function qti(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01};const n={match:/[{}[\],:]/,className:"punctuation",relevance:0};const r=["true","false","null"];const i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}Zjt.exports=qti});var eKt=_r(($ma,Qjt)=>{var pV="[0-9](_*[0-9])*";var M_e=`\\.(${pV})`;var L_e="[0-9a-fA-F](_*[0-9a-fA-F])*";var Xti={className:"number",variants:[{begin:`(\\b(${pV})((${M_e})|\\.)?|(${M_e}))[eE][+-]?(${pV})[fFdD]?\\b`},{begin:`\\b(${pV})((${M_e})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${M_e})[fFdD]?\\b`},{begin:`\\b(${pV})[fFdD]\\b`},{begin:`\\b0[xX]((${L_e})\\.?|(${L_e})?\\.(${L_e}))[pP][+-]?(${pV})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${L_e})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function jti(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"};const n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}};const r={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"};const i={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]};const o={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE};const a={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[o,i]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,o,i]}]};i.contains.push(a);const s={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"};const l={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(a,{className:"string"}),"self"]}]};const u=Xti;const d=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]});const f={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]};const h=f;h.variants[1].contains=[f];f.variants[1].contains=[h];return{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,d,n,r,s,l,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:true,excludeEnd:true,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:true,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:true,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:true,contains:[f,e.C_LINE_COMMENT_MODE,d],relevance:0},e.C_LINE_COMMENT_MODE,d,s,l,a,e.C_NUMBER_MODE]},d]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:true,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:true,excludeEnd:true,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:true,returnEnd:true},s,l]},a,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:"\n"},u]}}Qjt.exports=jti});var iKt=_r((Gma,rKt)=>{var Kti=e=>{return{IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}};var Zti=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"];var Jti=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"];var Qti=[...Zti,...Jti];var eni=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse();var tKt=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse();var nKt=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse();var tni=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();var nni=tKt.concat(nKt).sort().reverse();function rni(e){const t=Kti(e);const n=nni;const r="and or not only";const i="[\\w-]+";const o="("+i+"|@\\{"+i+"\\})";const a=[];const s=[];const l=function(A){return{className:"string",begin:"~?"+A+".*?"+A}};const u=function(A,P,L){return{className:A,begin:P,relevance:L}};const d={$pattern:/[a-z-]+/,keyword:r,attribute:eni.join(" ")};const f={begin:"\\(",end:"\\)",contains:s,keywords:d,relevance:0};s.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,l("'"),l('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:true}},t.HEXCOLOR,f,u("variable","@@?"+i,10),u("variable","@\\{"+i+"\\}"),u("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:true,excludeEnd:true},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const h=s.concat({begin:/\{/,end:/\}/,contains:a});const m={beginKeywords:"when",endsWithParent:true,contains:[{beginKeywords:"and not"}].concat(s)};const g={begin:o+"\\s*:",returnBegin:true,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+tni.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:true,illegal:"[<=$]",relevance:0,contains:s}}]};const x={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:d,returnEnd:true,contains:s,relevance:0}};const w={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:true,contains:h}};const _={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:o,end:/\{/}],returnBegin:true,returnEnd:true,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,m,u("keyword","all\\b"),u("variable","@\\{"+i+"\\}"),{begin:"\\b("+Qti.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,u("selector-tag",o,0),u("selector-id","#"+o),u("selector-class","\\."+o,0),u("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+tKt.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+nKt.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]};const C={begin:i+`:(:)?(${n.join("|")})`,returnBegin:true,contains:[_]};a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,x,w,C,g,_,m,t.FUNCTION_DISPATCH);return{name:"Less",case_insensitive:true,illegal:`[=>'/<($"]`,contains:a}}rKt.exports=rni});var aKt=_r((Hma,oKt)=>{function ini(e){const t="\\[=*\\[";const n="\\]=*\\]";const r={begin:t,end:n,contains:["self"]};const i=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:true,contains:i}].concat(i)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[r],relevance:5}])}}oKt.exports=ini});var lKt=_r((Wma,sKt)=>{function oni(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%{function ani(e){const t=e.regex;const n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"];const r=/[dualxmsipngr]{0,12}/;const i={$pattern:/[\w.]+/,keyword:n.join(" ")};const o={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i};const a={begin:/->\{/,end:/\}/};const s={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/};const l={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,`(?![A-Za-z])(?![@$%])`)},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[s]};const u={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0};const d=[e.BACKSLASH_ESCAPE,o,l];const f=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/];const h=(x,w,_="\\1")=>{const C=_==="\\1"?_:t.concat(_,w);return t.concat(t.concat("(?:",x,")"),w,/(?:\\.|[^\\\/])*?/,C,/(?:\\.|[^\\\/])*?/,_,r)};const m=(x,w,_)=>{return t.concat(t.concat("(?:",x,")"),w,/(?:\\.|[^\\\/])*?/,_,r)};const g=[l,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:true}),a,{className:"string",contains:d,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},u,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:h("s|tr|y",t.either(...f,{capture:true}))},{begin:h("s|tr|y","\\(","\\)")},{begin:h("s|tr|y","\\[","\\]")},{begin:h("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:m("(?:m|qr)?",/\//,/\//)},{begin:m("m|qr",t.either(...f,{capture:true}),/\1/)},{begin:m("m|qr",/\(/,/\)/)},{begin:m("m|qr",/\[/,/\]/)},{begin:m("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:true,relevance:5,contains:[e.TITLE_MODE,s]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:true,relevance:5,contains:[e.TITLE_MODE,s,u]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];o.contains=g;a.contains=g;return{name:"Perl",aliases:["pl","pm"],keywords:i,contains:g}}cKt.exports=ani});var fKt=_r((qma,dKt)=>{function sni(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"};const n=/[a-zA-Z@][a-zA-Z0-9_]*/;const r=["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"];const i=["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"];const o=["false","true","FALSE","TRUE","nil","YES","NO","NULL"];const a=["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"];const s={"variable.language":["this","super"],$pattern:n,keyword:i,literal:o,built_in:a,type:r};const l={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:s,illegal:"/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+l.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:true,keywords:l,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}dKt.exports=sni});var pKt=_r((Xma,hKt)=>{function lni(e){const t=e.regex;const n=/(?![A-Za-z0-9])(?![$])/;const r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n);const i=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n);const o=t.concat(/[A-Z]+/,n);const a={scope:"variable",match:"\\$+"+r};const s={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]};const l={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]};const u=e.inherit(e.APOS_STRING_MODE,{illegal:null});const d=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(l)});const f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(l),"on:begin":(K,X)=>{X.data._beginMatch=K[1]||K[2]},"on:end":(K,X)=>{if(X.data._beginMatch!==K[1])X.ignoreMatch()}};const h=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/});const m="[ \n]";const g={scope:"string",variants:[d,u,f,h]};const x={scope:"number",variants:[{begin:`\\b0[bB][01]+(?:_[01]+)*\\b`},{begin:`\\b0[oO][0-7]+(?:_[0-7]+)*\\b`},{begin:`\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b`},{begin:`(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?`}],relevance:0};const w=["false","null","true"];const _=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"];const C=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"];const A=K=>{const X=[];K.forEach(j=>{X.push(j);if(j.toLowerCase()===j){X.push(j.toUpperCase())}else{X.push(j.toLowerCase())}});return X};const P={keyword:_,literal:A(w),built_in:C};const L=K=>{return K.map(X=>{return X.replace(/\|\d+$/,"")})};const I={variants:[{match:[/new/,t.concat(m,"+"),t.concat("(?!",L(C).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]};const N=t.concat(r,"\\b(?!\\()");const O={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),N],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),N],scope:{1:"title.class",3:"variable.constant"}},{match:[i,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]};const z={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))};const U={relevance:0,begin:/\(/,end:/\)/,keywords:P,contains:[z,a,O,e.C_BLOCK_COMMENT_MODE,g,x,I]};const W={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",L(_).join("\\b|"),"|",L(C).join("\\b|"),"\\b)"),r,t.concat(m,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[U]};U.contains.push(W);const H=[z,O,e.C_BLOCK_COMMENT_MODE,g,x,I];const $={begin:t.concat(/#\[\s*\\?/,t.either(i,o)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:w,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:w,keyword:["new","array"]},contains:["self",...H]},...H,{scope:"meta",variants:[{match:i},{match:o}]}]};return{case_insensitive:false,keywords:P,contains:[$,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:true}]}},s,{scope:"variable.language",match:/\$this\b/},a,W,O,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},I,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:true,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:true},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:true,excludeEnd:true,keywords:P,contains:["self",$,a,O,e.C_BLOCK_COMMENT_MODE,g,x]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:true,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},g,x]}}hKt.exports=lni});var gKt=_r((jma,mKt)=>{function cni(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:true},{begin:'b"',end:'"',skip:true},{begin:"b'",end:"'",skip:true},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:true}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:true})]}]}}mKt.exports=cni});var bKt=_r((Kma,yKt)=>{function uni(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:true}}yKt.exports=uni});var vKt=_r((Zma,xKt)=>{function dni(e){const t=e.regex;const n=/[\p{XID_Start}_]\p{XID_Continue}*/u;const r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"];const i=["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"];const o=["__debug__","Ellipsis","False","None","NotImplemented","True"];const a=["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"];const s={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:i,literal:o,type:a};const l={className:"meta",begin:/^(>>>|\.\.\.) /};const u={className:"subst",begin:/\{/,end:/\}/,keywords:s,illegal:/#/};const d={begin:/\{\{/,relevance:0};const f={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l,d,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,d,u]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]};const h="[0-9](_?[0-9])*";const m=`(\\b(${h}))?\\.(${h})|\\b(${h})\\.`;const g=`\\b|${r.join("|")}`;const x={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${m}))[eE][+-]?(${h})[jJ]?(?=${g})`},{begin:`(${m})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${g})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${g})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${g})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${g})`},{begin:`\\b(${h})[jJ](?=${g})`}]};const w={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:s,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:true}]};const _={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:true},{begin:/\(/,end:/\)/,excludeBegin:true,excludeEnd:true,keywords:s,contains:["self",l,x,f,e.HASH_COMMENT_MODE]}]};u.contains=[f,x,l];return{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:true,keywords:s,illegal:/(<\/|\?)|=>/,contains:[l,x,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,w,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[_]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[x,_,f]}]}}xKt.exports=dni});var TKt=_r((Jma,_Kt)=>{function fni(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}_Kt.exports=fni});var EKt=_r((Qma,wKt)=>{function hni(e){const t=e.regex;const n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/;const r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/);const i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/;const o=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:true}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:true}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[o,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:o},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}wKt.exports=hni});var SKt=_r((ega,CKt)=>{function pni(e){const t=e.regex;const n=/(r#)?/;const r=t.concat(n,e.UNDERSCORE_IDENT_RE);const i=t.concat(n,e.IDENT_RE);const o={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,t.lookahead(/\s*\(/))};const a="([ui](8|16|32|64|128|size)|f(32|64))?";const s=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"];const l=["true","false","Some","None","Ok","Err"];const u=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"];const d=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:d,keyword:s,literal:l,built_in:u},illegal:""},o]}}CKt.exports=pni});var kKt=_r((tga,AKt)=>{var mni=e=>{return{IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}};var gni=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"];var yni=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"];var bni=[...gni,...yni];var xni=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse();var vni=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse();var _ni=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse();var Tni=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function wni(e){const t=mni(e);const n=_ni;const r=vni;const i="@[a-z-]+";const o="and or not only";const a="[a-zA-Z-][a-zA-Z0-9_-]*";const s={className:"variable",begin:"(\\$"+a+")\\b",relevance:0};return{name:"SCSS",case_insensitive:true,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+bni.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},s,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Tni.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,s,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:true,keywords:{$pattern:/[a-z-]+/,keyword:o,attribute:xni.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},s,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}AKt.exports=wni});var PKt=_r((nga,RKt)=>{function Eni(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}RKt.exports=Eni});var MKt=_r((rga,IKt)=>{function Cni(e){const t=e.regex;const n=e.COMMENT("--","$");const r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]};const i={begin:/"/,end:/"/,contains:[{match:/""/}]};const o=["true","false","unknown"];const a=["double precision","large object","with timezone","without timezone"];const s=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"];const l=["add","asc","collation","desc","final","first","last","view"];const u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"];const d=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"];const f=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"];const h=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"];const m=d;const g=[...u,...l].filter(L=>{return!d.includes(L)});const x={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/};const w={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0};const _={match:t.concat(/\b/,t.either(...m),/\s*\(/),relevance:0,keywords:{built_in:m}};function C(L){return t.concat(/\b/,t.either(...L.map(I=>{return I.replace(/\s+/,"\\s+")})),/\b/)}const A={scope:"keyword",match:C(h),relevance:0};function P(L,{exceptions:I,when:N}={}){const O=N;I=I||[];return L.map(z=>{if(z.match(/\|\d+$/)||I.includes(z)){return z}else if(O(z)){return`${z}|0`}else{return z}})}return{name:"SQL",case_insensitive:true,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:P(g,{when:L=>L.length<3}),literal:o,type:s,built_in:f},contains:[{scope:"type",match:C(a)},A,_,x,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,w]}}IKt.exports=Cni});var VKt=_r((iga,UKt)=>{function NKt(e){if(!e)return null;if(typeof e==="string")return e;return e.source}function HJ(e){return Au("(?=",e,")")}function Au(...e){const t=e.map(n=>NKt(n)).join("");return t}function Sni(e){const t=e[e.length-1];if(typeof t==="object"&&t.constructor===Object){e.splice(e.length-1,1);return t}else{return{}}}function z0(...e){const t=Sni(e);const n="("+(t.capture?"":"?:")+e.map(r=>NKt(r)).join("|")+")";return n}var SWe=e=>Au(/\b/,e,/\w$/.test(e)?/\b/:/\B/);var Ani=["Protocol","Type"].map(SWe);var LKt=["init","self"].map(SWe);var kni=["Any","Self"];var EWe=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"];var DKt=["false","nil","true"];var Rni=["assignment","associativity","higherThan","left","lowerThan","none","right"];var Pni=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"];var FKt=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"];var OKt=z0(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/);var BKt=z0(OKt,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/);var CWe=Au(OKt,BKt,"*");var zKt=z0(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/);var F_e=z0(zKt,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/);var xC=Au(zKt,F_e,"*");var D_e=Au(/[A-Z]/,F_e,"*");var Ini=["attached","autoclosure",Au(/convention\(/,z0("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Au(/objc\(/,xC,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"];var Mni=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function Lni(e){const t={match:/\s+/,relevance:0};const n=e.COMMENT("/\\*","\\*/",{contains:["self"]});const r=[e.C_LINE_COMMENT_MODE,n];const i={match:[/\./,z0(...Ani,...LKt)],className:{2:"keyword"}};const o={match:Au(/\./,z0(...EWe)),relevance:0};const a=EWe.filter(mt=>typeof mt==="string").concat(["_|0"]);const s=EWe.filter(mt=>typeof mt!=="string").concat(kni).map(SWe);const l={variants:[{className:"keyword",match:z0(...s,...LKt)}]};const u={$pattern:z0(/\b\w+/,/#\w+/),keyword:a.concat(Pni),literal:DKt};const d=[i,o,l];const f={match:Au(/\./,z0(...FKt)),relevance:0};const h={className:"built_in",match:Au(/\b/,z0(...FKt),/(?=\()/)};const m=[f,h];const g={match:/->/,relevance:0};const x={className:"operator",relevance:0,variants:[{match:CWe},{match:`\\.(\\.|${BKt})+`}]};const w=[g,x];const _="([0-9]_*)+";const C="([0-9a-fA-F]_*)+";const A={className:"number",relevance:0,variants:[{match:`\\b(${_})(\\.(${_}))?([eE][+-]?(${_}))?\\b`},{match:`\\b0x(${C})(\\.(${C}))?([pP][+-]?(${_}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]};const P=(mt="")=>({className:"subst",variants:[{match:Au(/\\/,mt,/[0\\tnr"']/)},{match:Au(/\\/,mt,/u\{[0-9a-fA-F]{1,8}\}/)}]});const L=(mt="")=>({className:"subst",match:Au(/\\/,mt,/[\t ]*(?:[\r\n]|\r\n)/)});const I=(mt="")=>({className:"subst",label:"interpol",begin:Au(/\\/,mt,/\(/),end:/\)/});const N=(mt="")=>({begin:Au(mt,/"""/),end:Au(/"""/,mt),contains:[P(mt),L(mt),I(mt)]});const O=(mt="")=>({begin:Au(mt,/"/),end:Au(/"/,mt),contains:[P(mt),I(mt)]});const z={className:"string",variants:[N(),N("#"),N("##"),N("###"),O(),O("#"),O("##"),O("###")]};const U=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}];const W={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:U};const H=mt=>{const ct=Au(mt,/\//);const Ge=Au(/\//,mt);return{begin:ct,end:Ge,contains:[...U,{scope:"comment",begin:`#(?!.*${Ge})`,end:/$/}]}};const $={scope:"regexp",variants:[H("###"),H("##"),H("#"),W]};const K={match:Au(/`/,xC,/`/)};const X={className:"variable",match:/\$\d+/};const j={className:"variable",match:`\\$${F_e}+`};const te=[K,X,j];const J={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:Mni,contains:[...w,A,z]}]}};const oe={scope:"keyword",match:Au(/@/,z0(...Ini),HJ(z0(/\(/,/\s+/)))};const se={scope:"meta",match:Au(/@/,xC)};const re=[J,oe,se];const ce={match:HJ(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Au(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,F_e,"+")},{className:"type",match:D_e,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Au(/\s+&\s+/,HJ(D_e)),relevance:0}]};const ue={begin://,keywords:u,contains:[...r,...d,...re,g,ce]};ce.contains.push(ue);const xe={match:Au(xC,/\s*:/),keywords:"_|0",relevance:0};const be={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",xe,...r,$,...d,...m,...w,A,z,...te,...re,ce]};const Ie={begin://,keywords:"repeat each",contains:[...r,ce]};const he={begin:z0(HJ(Au(xC,/\s*:/)),HJ(Au(xC,/\s+/,xC,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:xC}]};const ve={begin:/\(/,end:/\)/,keywords:u,contains:[he,...r,...d,...w,A,z,...re,ce,be],endsParent:true,illegal:/["']/};const ge={match:[/(func|macro)/,/\s+/,z0(K.match,xC,CWe)],className:{1:"keyword",3:"title.function"},contains:[Ie,ve,t],illegal:[/\[/,/%/]};const Ve={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[Ie,ve,t],illegal:/\[|%/};const Le={match:[/operator/,/\s+/,CWe],className:{1:"keyword",3:"title"}};const $e={begin:[/precedencegroup/,/\s+/,D_e],className:{1:"keyword",3:"title"},contains:[ce],keywords:[...Rni,...DKt],end:/}/};const Ee={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}};const tt={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}};const yt={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,xC,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[Ie,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:D_e},...d],relevance:0}]};for(const mt of z.variants){const ct=mt.contains.find(it=>it.label==="interpol");ct.keywords=u;const Ge=[...d,...m,...w,A,z,...te];ct.contains=[...Ge,{begin:/\(/,end:/\)/,contains:["self",...Ge]}]}return{name:"Swift",keywords:u,contains:[...r,ge,Ve,Ee,tt,yt,Le,$e,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},$,...d,...m,...w,A,z,...te,...re,ce,be]}}UKt.exports=Lni});var GKt=_r((oga,$Kt)=>{function Dni(e){const t="true false yes no null";const n="[\\w#;/?:@&=+$,.~*'()[\\]]+";const r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]};const i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]};const o={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]};const a={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]};const s=e.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]});const l="[0-9]{4}(-[0-9][0-9]){0,2}";const u="([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?";const d="(\\.[0-9]*)?";const f="([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?";const h={className:"number",begin:"\\b"+l+u+d+f+"\\b"};const m={end:",",endsWithParent:true,excludeEnd:true,keywords:t,relevance:0};const g={begin:/\{/,end:/\}/,contains:[m],illegal:"\\n",relevance:0};const x={begin:"\\[",end:"\\]",contains:[m],illegal:"\\n",relevance:0};const w=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:true,excludeEnd:true,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},h,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},g,x,o,a];const _=[...w];_.pop();_.push(s);m.contains=_;return{name:"YAML",case_insensitive:true,aliases:["yml"],contains:w}}$Kt.exports=Dni});var JKt=_r((aga,ZKt)=>{var N_e="[A-Za-z$_][0-9A-Za-z$_]*";var HKt=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"];var WKt=["true","false","null","undefined","NaN","Infinity"];var YKt=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"];var qKt=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"];var XKt=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"];var jKt=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"];var KKt=[].concat(XKt,YKt,qKt);function Fni(e){const t=e.regex;const n=(J,{after:oe})=>{const se="",end:""};const o=/<[A-Za-z0-9\\._:-]+\s*\/>/;const a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(J,oe)=>{const se=J[0].length+J.index;const re=J.input[se];if(re==="<"||re===","){oe.ignoreMatch();return}if(re===">"){if(!n(J,{after:se})){oe.ignoreMatch()}}let ce;const ue=J.input.substring(se);if(ce=ue.match(/^\s*=/)){oe.ignoreMatch();return}if(ce=ue.match(/^\s+extends\s+/)){if(ce.index===0){oe.ignoreMatch();return}}}};const s={$pattern:N_e,keyword:HKt,literal:WKt,built_in:KKt,"variable.language":jKt};const l="[0-9](_?[0-9])*";const u=`\\.(${l})`;const d=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`;const f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${l})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0};const h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]};const m={begin:".?html`",end:"",starts:{end:"`",returnEnd:false,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}};const g={begin:".?css`",end:"",starts:{end:"`",returnEnd:false,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}};const x={begin:".?gql`",end:"",starts:{end:"`",returnEnd:false,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}};const w={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]};const _=e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:true,excludeBegin:true,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:true,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]});const C={className:"comment",variants:[_,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]};const A=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,x,w,{match:/\$\d+/},f];h.contains=A.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(A)});const P=[].concat(C,h.contains);const L=P.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:["self"].concat(P)}]);const I={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:true,excludeEnd:true,keywords:s,contains:L};const N={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]};const O={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...YKt,...qKt]}};const z={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/};const U={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[I],illegal:/%/};const W={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function H(J){return t.concat("(?!",J.join("|"),")")}const $={match:t.concat(/\b/,H([...XKt,"super","import"].map(J=>`${J}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0};const K={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:true,keywords:"prototype",className:"property",relevance:0};const X={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},I]};const j="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>";const te={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(j)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[I]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:L,CLASS_REFERENCE:O},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),z,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,x,w,C,{match:/\$\d+/},f,O,{scope:"attr",match:r+t.lookahead(":"),relevance:0},te,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[C,e.REGEXP_MODE,{className:"function",begin:j,returnBegin:true,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:true},{begin:/(\s*)\(/,end:/\)/,excludeBegin:true,excludeEnd:true,keywords:s,contains:L}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:true,contains:["self"]}]}]},U,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:true,label:"func.def",contains:[I,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},K,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[I]},$,W,N,X,{match:/\$[(.]/}]}}function Nni(e){const t=e.regex;const n=Fni(e);const r=N_e;const i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"];const o={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}};const a={beginKeywords:"interface",end:/\{/,excludeEnd:true,keywords:{keyword:"interface extends",built_in:i},contains:[n.exports.CLASS_REFERENCE]};const s={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/};const l=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"];const u={$pattern:N_e,keyword:HKt.concat(l),literal:WKt,built_in:KKt.concat(i),"variable.language":jKt};const d={className:"meta",begin:"@"+r};const f=(x,w,_)=>{const C=x.contains.findIndex(A=>A.label===w);if(C===-1){throw new Error("can not find mode to replace")}x.contains.splice(C,1,_)};Object.assign(n.keywords,u);n.exports.PARAMS_CONTAINS.push(d);const h=n.contains.find(x=>x.scope==="attr");const m=Object.assign({},h,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,h,m]);n.contains=n.contains.concat([d,o,a,m]);f(n,"shebang",e.SHEBANG());f(n,"use_strict",s);const g=n.contains.find(x=>x.label==="func.def");g.relevance=0;Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]});return n}ZKt.exports=Nni});var eZt=_r((sga,QKt)=>{function Oni(e){const t=e.regex;const n={className:"string",begin:/"(""|[^/n])"C\b/};const r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]};const i=/\d{1,2}\/\d{1,2}\/\d{4}/;const o=/\d{4}-\d{1,2}-\d{1,2}/;const a=/(\d|1[012])(:\d+){0,2} *(AM|PM)/;const s=/\d{1,2}(:\d{1,2}){1,2}/;const l={className:"literal",variants:[{begin:t.concat(/# */,t.either(o,i),/ *#/)},{begin:t.concat(/# */,s,/ *#/)},{begin:t.concat(/# */,a,/ *#/)},{begin:t.concat(/# */,t.either(o,i),/ +/,t.either(a,s),/ *#/)}]};const u={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]};const d={className:"label",begin:/^\w+:/};const f=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]});const h=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});const m={className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[h]};return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:true,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,l,u,d,f,h,m]}}QKt.exports=Oni});var nZt=_r((lga,tZt)=>{function Bni(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/);const r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"];const i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}};const o={className:"variable",begin:/\$[\w_]+/};const a={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0};const s={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/};const l={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"};const u={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};const d={match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,t,d,o,a,i,e.QUOTE_STRING_MODE,l,u,s]}}tZt.exports=Bni});var iZt=_r((cga,rZt)=>{var qs=gjt();qs.registerLanguage("xml",bjt());qs.registerLanguage("bash",vjt());qs.registerLanguage("c",Tjt());qs.registerLanguage("cpp",Ejt());qs.registerLanguage("csharp",Sjt());qs.registerLanguage("css",kjt());qs.registerLanguage("markdown",Pjt());qs.registerLanguage("diff",Mjt());qs.registerLanguage("ruby",Djt());qs.registerLanguage("go",Njt());qs.registerLanguage("graphql",Bjt());qs.registerLanguage("ini",Ujt());qs.registerLanguage("java",Hjt());qs.registerLanguage("javascript",Kjt());qs.registerLanguage("json",Jjt());qs.registerLanguage("kotlin",eKt());qs.registerLanguage("less",iKt());qs.registerLanguage("lua",aKt());qs.registerLanguage("makefile",lKt());qs.registerLanguage("perl",uKt());qs.registerLanguage("objectivec",fKt());qs.registerLanguage("php",pKt());qs.registerLanguage("php-template",gKt());qs.registerLanguage("plaintext",bKt());qs.registerLanguage("python",vKt());qs.registerLanguage("python-repl",TKt());qs.registerLanguage("r",EKt());qs.registerLanguage("rust",SKt());qs.registerLanguage("scss",kKt());qs.registerLanguage("shell",PKt());qs.registerLanguage("sql",MKt());qs.registerLanguage("swift",VKt());qs.registerLanguage("yaml",GKt());qs.registerLanguage("typescript",JKt());qs.registerLanguage("vbnet",eZt());qs.registerLanguage("wasm",nZt());qs.HighlightJS=qs;qs.default=qs;rZt.exports=qs});var qri,W_e;var BWe=Ce(()=>{qri=typeof global=="object"&&global&&global.Object===Object&&global;W_e=qri});var Xri,jri,Gf;var w_=Ce(()=>{BWe();Xri=typeof self=="object"&&self&&self.Object===Object&&self;jri=W_e||Xri||Function("return this")();Gf=jri});var Kri,Pm;var p5=Ce(()=>{w_();Kri=Gf.Symbol;Pm=Kri});function Qri(e){var t=Zri.call(e,qJ),n=e[qJ];try{e[qJ]=void 0;var r=true}catch(o){}var i=Jri.call(e);if(r){if(t){e[qJ]=n}else{delete e[qJ]}}return i}var FZt,Zri,Jri,qJ,NZt;var OZt=Ce(()=>{p5();FZt=Object.prototype;Zri=FZt.hasOwnProperty;Jri=FZt.toString;qJ=Pm?Pm.toStringTag:void 0;NZt=Qri});function nii(e){return tii.call(e)}var eii,tii,BZt;var zZt=Ce(()=>{eii=Object.prototype;tii=eii.toString;BZt=nii});function oii(e){if(e==null){return e===void 0?iii:rii}return UZt&&UZt in Object(e)?NZt(e):BZt(e)}var rii,iii,UZt,V0;var AM=Ce(()=>{p5();OZt();zZt();rii="[object Null]";iii="[object Undefined]";UZt=Pm?Pm.toStringTag:void 0;V0=oii});function aii(e){return e!=null&&typeof e=="object"}var hh;var gw=Ce(()=>{hh=aii});function lii(e){return typeof e=="symbol"||hh(e)&&V0(e)==sii}var sii,H1;var m5=Ce(()=>{AM();gw();sii="[object Symbol]";H1=lii});function cii(e,t){var n=-1,r=e==null?0:e.length,i=Array(r);while(++n{_C=cii});var uii,Us;var Yh=Ce(()=>{uii=Array.isArray;Us=uii});function GZt(e){if(typeof e=="string"){return e}if(Us(e)){return _C(e,GZt)+""}if(H1(e)){return $Zt?$Zt.call(e):""}var t=e+"";return t=="0"&&1/e==-dii?"-0":t}var dii,VZt,$Zt,HZt;var WZt=Ce(()=>{p5();XJ();Yh();m5();dii=1/0;VZt=Pm?Pm.prototype:void 0;$Zt=VZt?VZt.toString:void 0;HZt=GZt});function hii(e){var t=e.length;while(t--&&fii.test(e.charAt(t))){}return t}var fii,YZt;var qZt=Ce(()=>{fii=/\s/;YZt=hii});function mii(e){return e?e.slice(0,YZt(e)+1).replace(pii,""):e}var pii,XZt;var jZt=Ce(()=>{qZt();pii=/^\s+/;XZt=mii});function gii(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ef;var E_=Ce(()=>{ef=gii});function _ii(e){if(typeof e=="number"){return e}if(H1(e)){return KZt}if(ef(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ef(t)?t+"":t}if(typeof e!="string"){return e===0?e:+e}e=XZt(e);var n=bii.test(e);return n||xii.test(e)?vii(e.slice(2),n?2:8):yii.test(e)?KZt:+e}var KZt,yii,bii,xii,vii,ZZt;var JZt=Ce(()=>{jZt();E_();m5();KZt=0/0;yii=/^[-+]0x[0-9a-f]+$/i;bii=/^0b[01]+$/i;xii=/^0o[0-7]+$/i;vii=parseInt;ZZt=_ii});function wii(e){if(!e){return e===0?e:0}e=ZZt(e);if(e===QZt||e===-QZt){var t=e<0?-1:1;return t*Tii}return e===e?e:0}var QZt,Tii,yV;var zWe=Ce(()=>{JZt();QZt=1/0;Tii=17976931348623157e292;yV=wii});function Eii(e){var t=yV(e),n=t%1;return t===t?n?t-n:t:0}var eJt;var tJt=Ce(()=>{zWe();eJt=Eii});function Cii(e){return e}var sx;var kM=Ce(()=>{sx=Cii});function Pii(e){if(!ef(e)){return false}var t=V0(e);return t==Aii||t==kii||t==Sii||t==Rii}var Sii,Aii,kii,Rii,W1;var jJ=Ce(()=>{AM();E_();Sii="[object AsyncFunction]";Aii="[object Function]";kii="[object GeneratorFunction]";Rii="[object Proxy]";W1=Pii});var Iii,Y_e;var nJt=Ce(()=>{w_();Iii=Gf["__core-js_shared__"];Y_e=Iii});function Mii(e){return!!rJt&&rJt in e}var rJt,iJt;var oJt=Ce(()=>{nJt();rJt=function(){var e=/[^.]+$/.exec(Y_e&&Y_e.keys&&Y_e.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();iJt=Mii});function Fii(e){if(e!=null){try{return Dii.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var Lii,Dii,rR;var UWe=Ce(()=>{Lii=Function.prototype;Dii=Lii.toString;rR=Fii});function Gii(e){if(!ef(e)||iJt(e)){return false}var t=W1(e)?$ii:Oii;return t.test(rR(e))}var Nii,Oii,Bii,zii,Uii,Vii,$ii,aJt;var sJt=Ce(()=>{jJ();oJt();E_();UWe();Nii=/[\\^$.*+?()[\]{}|]/g;Oii=/^\[object .+?Constructor\]$/;Bii=Function.prototype;zii=Object.prototype;Uii=Bii.toString;Vii=zii.hasOwnProperty;$ii=RegExp("^"+Uii.call(Vii).replace(Nii,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");aJt=Gii});function Hii(e,t){return e==null?void 0:e[t]}var lJt;var cJt=Ce(()=>{lJt=Hii});function Wii(e,t){var n=lJt(e,t);return aJt(n)?n:void 0}var lx;var RM=Ce(()=>{sJt();cJt();lx=Wii});var Yii,q_e;var uJt=Ce(()=>{RM();w_();Yii=lx(Gf,"WeakMap");q_e=Yii});var dJt,qii,fJt;var hJt=Ce(()=>{E_();dJt=Object.create;qii=function(){function e(){}return function(t){if(!ef(t)){return{}}if(dJt){return dJt(t)}e.prototype=t;var n=new e;e.prototype=void 0;return n}}();fJt=qii});function Xii(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var pJt;var mJt=Ce(()=>{pJt=Xii});function jii(){}var gJt;var yJt=Ce(()=>{gJt=jii});function Kii(e,t){var n=-1,r=e.length;t||(t=Array(r));while(++n{X_e=Kii});function eoi(e){var t=0,n=0;return function(){var r=Qii(),i=Jii-(r-n);n=r;if(i>0){if(++t>=Zii){return arguments[0]}}else{t=0}return e.apply(void 0,arguments)}}var Zii,Jii,Qii,bJt;var xJt=Ce(()=>{Zii=800;Jii=16;Qii=Date.now;bJt=eoi});function toi(e){return function(){return e}}var Dd;var $We=Ce(()=>{Dd=toi});var noi,bV;var GWe=Ce(()=>{RM();noi=function(){try{var e=lx(Object,"defineProperty");e({},"",{});return e}catch(t){}}();bV=noi});var roi,vJt;var _Jt=Ce(()=>{$We();GWe();kM();roi=!bV?sx:function(e,t){return bV(e,"toString",{"configurable":true,"enumerable":false,"value":Dd(t),"writable":true})};vJt=roi});var ioi,j_e;var HWe=Ce(()=>{_Jt();xJt();ioi=bJt(vJt);j_e=ioi});function ooi(e,t){var n=-1,r=e==null?0:e.length;while(++n{K_e=ooi});function aoi(e,t,n,r){var i=e.length,o=n+(r?1:-1);while(r?o--:++o{Z_e=aoi});function soi(e){return e!==e}var TJt;var wJt=Ce(()=>{TJt=soi});function loi(e,t,n){var r=n-1,i=e.length;while(++r{EJt=loi});function coi(e,t,n){return t===t?EJt(e,t,n):Z_e(e,TJt,n)}var SJt;var AJt=Ce(()=>{YWe();wJt();CJt();SJt=coi});function uoi(e,t){var n=e==null?0:e.length;return!!n&&SJt(e,t,0)>-1}var kJt;var RJt=Ce(()=>{AJt();kJt=uoi});function hoi(e,t){var n=typeof e;t=t==null?doi:t;return!!t&&(n=="number"||n!="symbol"&&foi.test(e))&&(e>-1&&e%1==0&&e{doi=9007199254740991;foi=/^(?:0|[1-9]\d*)$/;PM=hoi});function poi(e,t,n){if(t=="__proto__"&&bV){bV(e,t,{"configurable":true,"enumerable":true,"value":n,"writable":true})}else{e[t]=n}}var IM;var ZJ=Ce(()=>{GWe();IM=poi});function moi(e,t){return e===t||e!==e&&t!==t}var C_;var g5=Ce(()=>{C_=moi});function boi(e,t,n){var r=e[t];if(!(yoi.call(e,t)&&C_(r,n))||n===void 0&&!(t in e)){IM(e,t,n)}}var goi,yoi,MM;var JJ=Ce(()=>{ZJ();g5();goi=Object.prototype;yoi=goi.hasOwnProperty;MM=boi});function xoi(e,t,n,r){var i=!n;n||(n={});var o=-1,a=t.length;while(++o{JJ();ZJ();TC=xoi});function voi(e,t,n){t=PJt(t===void 0?e.length-1:t,0);return function(){var r=arguments,i=-1,o=PJt(r.length-t,0),a=Array(o);while(++i{mJt();PJt=Math.max;J_e=voi});function _oi(e,t){return j_e(J_e(e,t,sx),e+"")}var LM;var QJ=Ce(()=>{kM();qWe();HWe();LM=_oi});function woi(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Toi}var Toi,vV;var Q_e=Ce(()=>{Toi=9007199254740991;vV=woi});function Eoi(e){return e!=null&&vV(e.length)&&!W1(e)}var Im;var wC=Ce(()=>{jJ();Q_e();Im=Eoi});function Coi(e,t,n){if(!ef(n)){return false}var r=typeof t;if(r=="number"?Im(n)&&PM(t,n.length):r=="string"&&t in n){return C_(n[t],e)}return false}var iR;var eQ=Ce(()=>{g5();wC();KJ();E_();iR=Coi});function Soi(e){return LM(function(t,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;o=e.length>3&&typeof o=="function"?(i--,o):void 0;if(a&&iR(n[0],n[1],a)){o=i<3?void 0:o;i=1}t=Object(t);while(++r{QJ();eQ();IJt=Soi});function koi(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Aoi;return e===n}var Aoi,DM;var tQ=Ce(()=>{Aoi=Object.prototype;DM=koi});function Roi(e,t){var n=-1,r=Array(e);while(++n{LJt=Roi});function Ioi(e){return hh(e)&&V0(e)==Poi}var Poi,XWe;var FJt=Ce(()=>{AM();gw();Poi="[object Arguments]";XWe=Ioi});var NJt,Moi,Loi,Doi,yw;var _V=Ce(()=>{FJt();gw();NJt=Object.prototype;Moi=NJt.hasOwnProperty;Loi=NJt.propertyIsEnumerable;Doi=XWe(function(){return arguments}())?XWe:function(e){return hh(e)&&Moi.call(e,"callee")&&!Loi.call(e,"callee")};yw=Doi});function Foi(){return false}var OJt;var BJt=Ce(()=>{OJt=Foi});var VJt,zJt,Noi,UJt,Ooi,Boi,bw;var TV=Ce(()=>{w_();BJt();VJt=typeof exports=="object"&&exports&&!exports.nodeType&&exports;zJt=VJt&&typeof module=="object"&&module&&!module.nodeType&&module;Noi=zJt&&zJt.exports===VJt;UJt=Noi?Gf.Buffer:void 0;Ooi=UJt?UJt.isBuffer:void 0;Boi=Ooi||OJt;bw=Boi});function cai(e){return hh(e)&&vV(e.length)&&!!Fd[V0(e)]}var zoi,Uoi,Voi,$oi,Goi,Hoi,Woi,Yoi,qoi,Xoi,joi,Koi,Zoi,Joi,Qoi,eai,tai,nai,rai,iai,oai,aai,sai,lai,Fd,$Jt;var GJt=Ce(()=>{AM();Q_e();gw();zoi="[object Arguments]";Uoi="[object Array]";Voi="[object Boolean]";$oi="[object Date]";Goi="[object Error]";Hoi="[object Function]";Woi="[object Map]";Yoi="[object Number]";qoi="[object Object]";Xoi="[object RegExp]";joi="[object Set]";Koi="[object String]";Zoi="[object WeakMap]";Joi="[object ArrayBuffer]";Qoi="[object DataView]";eai="[object Float32Array]";tai="[object Float64Array]";nai="[object Int8Array]";rai="[object Int16Array]";iai="[object Int32Array]";oai="[object Uint8Array]";aai="[object Uint8ClampedArray]";sai="[object Uint16Array]";lai="[object Uint32Array]";Fd={};Fd[eai]=Fd[tai]=Fd[nai]=Fd[rai]=Fd[iai]=Fd[oai]=Fd[aai]=Fd[sai]=Fd[lai]=true;Fd[zoi]=Fd[Uoi]=Fd[Joi]=Fd[Voi]=Fd[Qoi]=Fd[$oi]=Fd[Goi]=Fd[Hoi]=Fd[Woi]=Fd[Yoi]=Fd[qoi]=Fd[Xoi]=Fd[joi]=Fd[Koi]=Fd[Zoi]=false;$Jt=cai});function uai(e){return function(t){return e(t)}}var FM;var nQ=Ce(()=>{FM=uai});var HJt,rQ,dai,jWe,fai,oR;var eTe=Ce(()=>{BWe();HJt=typeof exports=="object"&&exports&&!exports.nodeType&&exports;rQ=HJt&&typeof module=="object"&&module&&!module.nodeType&&module;dai=rQ&&rQ.exports===HJt;jWe=dai&&W_e.process;fai=function(){try{var e=rQ&&rQ.require&&rQ.require("util").types;if(e){return e}return jWe&&jWe.binding&&jWe.binding("util")}catch(t){}}();oR=fai});var WJt,hai,NM;var iQ=Ce(()=>{GJt();nQ();eTe();WJt=oR&&oR.isTypedArray;hai=WJt?FM(WJt):$Jt;NM=hai});function gai(e,t){var n=Us(e),r=!n&&yw(e),i=!n&&!r&&bw(e),o=!n&&!r&&!i&&NM(e),a=n||r||i||o,s=a?LJt(e.length,String):[],l=s.length;for(var u in e){if((t||mai.call(e,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||PM(u,l)))){s.push(u)}}return s}var pai,mai,tTe;var KWe=Ce(()=>{DJt();_V();Yh();TV();KJ();iQ();pai=Object.prototype;mai=pai.hasOwnProperty;tTe=gai});function yai(e,t){return function(n){return e(t(n))}}var nTe;var ZWe=Ce(()=>{nTe=yai});var bai,YJt;var qJt=Ce(()=>{ZWe();bai=nTe(Object.keys,Object);YJt=bai});function _ai(e){if(!DM(e)){return YJt(e)}var t=[];for(var n in Object(e)){if(vai.call(e,n)&&n!="constructor"){t.push(n)}}return t}var xai,vai,wV;var rTe=Ce(()=>{tQ();qJt();xai=Object.prototype;vai=xai.hasOwnProperty;wV=_ai});function Tai(e){return Im(e)?tTe(e):wV(e)}var hu;var aR=Ce(()=>{KWe();rTe();wC();hu=Tai});function wai(e){var t=[];if(e!=null){for(var n in Object(e)){t.push(n)}}return t}var XJt;var jJt=Ce(()=>{XJt=wai});function Sai(e){if(!ef(e)){return XJt(e)}var t=DM(e),n=[];for(var r in e){if(!(r=="constructor"&&(t||!Cai.call(e,r)))){n.push(r)}}return n}var Eai,Cai,KJt;var ZJt=Ce(()=>{E_();tQ();jJt();Eai=Object.prototype;Cai=Eai.hasOwnProperty;KJt=Sai});function Aai(e){return Im(e)?tTe(e,true):KJt(e)}var cx;var OM=Ce(()=>{KWe();ZJt();wC();cx=Aai});function Pai(e,t){if(Us(e)){return false}var n=typeof e;if(n=="number"||n=="symbol"||n=="boolean"||e==null||H1(e)){return true}return Rai.test(e)||!kai.test(e)||t!=null&&e in Object(t)}var kai,Rai,EV;var iTe=Ce(()=>{Yh();m5();kai=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;Rai=/^\w*$/;EV=Pai});var Iai,sR;var oQ=Ce(()=>{RM();Iai=lx(Object,"create");sR=Iai});function Mai(){this.__data__=sR?sR(null):{};this.size=0}var JJt;var QJt=Ce(()=>{oQ();JJt=Mai});function Lai(e){var t=this.has(e)&&delete this.__data__[e];this.size-=t?1:0;return t}var eQt;var tQt=Ce(()=>{eQt=Lai});function Oai(e){var t=this.__data__;if(sR){var n=t[e];return n===Dai?void 0:n}return Nai.call(t,e)?t[e]:void 0}var Dai,Fai,Nai,nQt;var rQt=Ce(()=>{oQ();Dai="__lodash_hash_undefined__";Fai=Object.prototype;Nai=Fai.hasOwnProperty;nQt=Oai});function Uai(e){var t=this.__data__;return sR?t[e]!==void 0:zai.call(t,e)}var Bai,zai,iQt;var oQt=Ce(()=>{oQ();Bai=Object.prototype;zai=Bai.hasOwnProperty;iQt=Uai});function $ai(e,t){var n=this.__data__;this.size+=this.has(e)?0:1;n[e]=sR&&t===void 0?Vai:t;return this}var Vai,aQt;var sQt=Ce(()=>{oQ();Vai="__lodash_hash_undefined__";aQt=$ai});function CV(e){var t=-1,n=e==null?0:e.length;this.clear();while(++t{QJt();tQt();rQt();oQt();sQt();CV.prototype.clear=JJt;CV.prototype["delete"]=eQt;CV.prototype.get=nQt;CV.prototype.has=iQt;CV.prototype.set=aQt;JWe=CV});function Gai(){this.__data__=[];this.size=0}var cQt;var uQt=Ce(()=>{cQt=Gai});function Hai(e,t){var n=e.length;while(n--){if(C_(e[n][0],t)){return n}}return-1}var BM;var aQ=Ce(()=>{g5();BM=Hai});function qai(e){var t=this.__data__,n=BM(t,e);if(n<0){return false}var r=t.length-1;if(n==r){t.pop()}else{Yai.call(t,n,1)}--this.size;return true}var Wai,Yai,dQt;var fQt=Ce(()=>{aQ();Wai=Array.prototype;Yai=Wai.splice;dQt=qai});function Xai(e){var t=this.__data__,n=BM(t,e);return n<0?void 0:t[n][1]}var hQt;var pQt=Ce(()=>{aQ();hQt=Xai});function jai(e){return BM(this.__data__,e)>-1}var mQt;var gQt=Ce(()=>{aQ();mQt=jai});function Kai(e,t){var n=this.__data__,r=BM(n,e);if(r<0){++this.size;n.push([e,t])}else{n[r][1]=t}return this}var yQt;var bQt=Ce(()=>{aQ();yQt=Kai});function SV(e){var t=-1,n=e==null?0:e.length;this.clear();while(++t{uQt();fQt();pQt();gQt();bQt();SV.prototype.clear=cQt;SV.prototype["delete"]=dQt;SV.prototype.get=hQt;SV.prototype.has=mQt;SV.prototype.set=yQt;zM=SV});var Zai,UM;var oTe=Ce(()=>{RM();w_();Zai=lx(Gf,"Map");UM=Zai});function Jai(){this.size=0;this.__data__={"hash":new JWe,"map":new(UM||zM),"string":new JWe}}var xQt;var vQt=Ce(()=>{lQt();sQ();oTe();xQt=Jai});function Qai(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var _Qt;var TQt=Ce(()=>{_Qt=Qai});function esi(e,t){var n=e.__data__;return _Qt(t)?n[typeof t=="string"?"string":"hash"]:n.map}var VM;var lQ=Ce(()=>{TQt();VM=esi});function tsi(e){var t=VM(this,e)["delete"](e);this.size-=t?1:0;return t}var wQt;var EQt=Ce(()=>{lQ();wQt=tsi});function nsi(e){return VM(this,e).get(e)}var CQt;var SQt=Ce(()=>{lQ();CQt=nsi});function rsi(e){return VM(this,e).has(e)}var AQt;var kQt=Ce(()=>{lQ();AQt=rsi});function isi(e,t){var n=VM(this,e),r=n.size;n.set(e,t);this.size+=n.size==r?0:1;return this}var RQt;var PQt=Ce(()=>{lQ();RQt=isi});function AV(e){var t=-1,n=e==null?0:e.length;this.clear();while(++t{vQt();EQt();SQt();kQt();PQt();AV.prototype.clear=xQt;AV.prototype["delete"]=wQt;AV.prototype.get=CQt;AV.prototype.has=AQt;AV.prototype.set=RQt;y5=AV});function QWe(e,t){if(typeof e!="function"||t!=null&&typeof t!="function"){throw new TypeError(osi)}var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i)){return o.get(i)}var a=e.apply(this,r);n.cache=o.set(i,a)||o;return a};n.cache=new(QWe.Cache||y5);return n}var osi,IQt;var MQt=Ce(()=>{aTe();osi="Expected a function";QWe.Cache=y5;IQt=QWe});function ssi(e){var t=IQt(e,function(r){if(n.size===asi){n.clear()}return r});var n=t.cache;return t}var asi,LQt;var DQt=Ce(()=>{MQt();asi=500;LQt=ssi});var lsi,csi,usi,FQt;var NQt=Ce(()=>{DQt();lsi=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;csi=/\\(\\)?/g;usi=LQt(function(e){var t=[];if(e.charCodeAt(0)===46){t.push("")}e.replace(lsi,function(n,r,i,o){t.push(i?o.replace(csi,"$1"):r||n)});return t});FQt=usi});function dsi(e){return e==null?"":HZt(e)}var sTe;var eYe=Ce(()=>{WZt();sTe=dsi});function fsi(e,t){if(Us(e)){return e}return EV(e,t)?[e]:FQt(sTe(e))}var $M;var cQ=Ce(()=>{Yh();iTe();NQt();eYe();$M=fsi});function psi(e){if(typeof e=="string"||H1(e)){return e}var t=e+"";return t=="0"&&1/e==-hsi?"-0":t}var hsi,EC;var kV=Ce(()=>{m5();hsi=1/0;EC=psi});function msi(e,t){t=$M(t,e);var n=0,r=t.length;while(e!=null&&n{cQ();kV();GM=msi});function gsi(e,t,n){var r=e==null?void 0:GM(e,t);return r===void 0?n:r}var OQt;var BQt=Ce(()=>{uQ();OQt=gsi});function ysi(e,t){var n=-1,r=t.length,i=e.length;while(++n{RV=ysi});function bsi(e){return Us(e)||yw(e)||!!(zQt&&e&&e[zQt])}var zQt,UQt;var VQt=Ce(()=>{p5();_V();Yh();zQt=Pm?Pm.isConcatSpreadable:void 0;UQt=bsi});function $Qt(e,t,n,r,i){var o=-1,a=e.length;n||(n=UQt);i||(i=[]);while(++o0&&n(s)){if(t>1){$Qt(s,t-1,n,r,i)}else{RV(i,s)}}else if(!r){i[i.length]=s}}return i}var PV;var cTe=Ce(()=>{lTe();VQt();PV=$Qt});function xsi(e){var t=e==null?0:e.length;return t?PV(e,1):[]}var ph;var tYe=Ce(()=>{cTe();ph=xsi});function vsi(e){return j_e(J_e(e,void 0,ph),e+"")}var GQt;var HQt=Ce(()=>{tYe();qWe();HWe();GQt=vsi});var _si,IV;var uTe=Ce(()=>{ZWe();_si=nTe(Object.getPrototypeOf,Object);IV=_si});function Asi(e){if(!hh(e)||V0(e)!=Tsi){return false}var t=IV(e);if(t===null){return true}var n=Csi.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&WQt.call(n)==Ssi}var Tsi,wsi,Esi,WQt,Csi,Ssi,YQt;var qQt=Ce(()=>{AM();uTe();gw();Tsi="[object Object]";wsi=Function.prototype;Esi=Object.prototype;WQt=wsi.toString;Csi=Esi.hasOwnProperty;Ssi=WQt.call(Object);YQt=Asi});function Nsi(e){return Fsi.test(e)}var ksi,Rsi,Psi,Isi,Msi,Lsi,Dsi,Fsi,XQt;var jQt=Ce(()=>{ksi="\\ud800-\\udfff";Rsi="\\u0300-\\u036f";Psi="\\ufe20-\\ufe2f";Isi="\\u20d0-\\u20ff";Msi=Rsi+Psi+Isi;Lsi="\\ufe0e\\ufe0f";Dsi="\\u200d";Fsi=RegExp("["+Dsi+ksi+Msi+Lsi+"]");XQt=Nsi});function Osi(e,t,n,r){var i=-1,o=e==null?0:e.length;if(r&&o){n=e[++i]}while(++i{KQt=Osi});function Bsi(){this.__data__=new zM;this.size=0}var JQt;var QQt=Ce(()=>{sQ();JQt=Bsi});function zsi(e){var t=this.__data__,n=t["delete"](e);this.size=t.size;return n}var een;var ten=Ce(()=>{een=zsi});function Usi(e){return this.__data__.get(e)}var nen;var ren=Ce(()=>{nen=Usi});function Vsi(e){return this.__data__.has(e)}var ien;var oen=Ce(()=>{ien=Vsi});function Gsi(e,t){var n=this.__data__;if(n instanceof zM){var r=n.__data__;if(!UM||r.length<$si-1){r.push([e,t]);this.size=++n.size;return this}n=this.__data__=new y5(r)}n.set(e,t);this.size=n.size;return this}var $si,aen;var sen=Ce(()=>{sQ();oTe();aTe();$si=200;aen=Gsi});function MV(e){var t=this.__data__=new zM(e);this.size=t.size}var CC;var dQ=Ce(()=>{sQ();QQt();ten();ren();oen();sen();MV.prototype.clear=JQt;MV.prototype["delete"]=een;MV.prototype.get=nen;MV.prototype.has=ien;MV.prototype.set=aen;CC=MV});function Hsi(e,t){return e&&TC(t,hu(t),e)}var len;var cen=Ce(()=>{xV();aR();len=Hsi});function Wsi(e,t){return e&&TC(t,cx(t),e)}var uen;var den=Ce(()=>{xV();OM();uen=Wsi});function qsi(e,t){if(t){return e.slice()}var n=e.length,r=pen?pen(n):new e.constructor(n);e.copy(r);return r}var men,fen,Ysi,hen,pen,dTe;var nYe=Ce(()=>{w_();men=typeof exports=="object"&&exports&&!exports.nodeType&&exports;fen=men&&typeof module=="object"&&module&&!module.nodeType&&module;Ysi=fen&&fen.exports===men;hen=Ysi?Gf.Buffer:void 0;pen=hen?hen.allocUnsafe:void 0;dTe=qsi});function Xsi(e,t){var n=-1,r=e==null?0:e.length,i=0,o=[];while(++n{fTe=Xsi});function jsi(){return[]}var hTe;var iYe=Ce(()=>{hTe=jsi});var Ksi,Zsi,gen,Jsi,LV;var pTe=Ce(()=>{rYe();iYe();Ksi=Object.prototype;Zsi=Ksi.propertyIsEnumerable;gen=Object.getOwnPropertySymbols;Jsi=!gen?hTe:function(e){if(e==null){return[]}e=Object(e);return fTe(gen(e),function(t){return Zsi.call(e,t)})};LV=Jsi});function Qsi(e,t){return TC(e,LV(e),t)}var yen;var ben=Ce(()=>{xV();pTe();yen=Qsi});var eli,tli,mTe;var oYe=Ce(()=>{lTe();uTe();pTe();iYe();eli=Object.getOwnPropertySymbols;tli=!eli?hTe:function(e){var t=[];while(e){RV(t,LV(e));e=IV(e)}return t};mTe=tli});function nli(e,t){return TC(e,mTe(e),t)}var xen;var ven=Ce(()=>{xV();oYe();xen=nli});function rli(e,t,n){var r=t(e);return Us(e)?r:RV(r,n(e))}var gTe;var aYe=Ce(()=>{lTe();Yh();gTe=rli});function ili(e){return gTe(e,hu,LV)}var fQ;var sYe=Ce(()=>{aYe();pTe();aR();fQ=ili});function oli(e){return gTe(e,cx,mTe)}var _en;var Ten=Ce(()=>{aYe();oYe();OM();_en=oli});var ali,yTe;var wen=Ce(()=>{RM();w_();ali=lx(Gf,"DataView");yTe=ali});var sli,bTe;var Een=Ce(()=>{RM();w_();sli=lx(Gf,"Promise");bTe=sli});var lli,HM;var lYe=Ce(()=>{RM();w_();lli=lx(Gf,"Set");HM=lli});var Cen,cli,Sen,Aen,ken,Ren,uli,dli,fli,hli,pli,b5,Y1;var x5=Ce(()=>{wen();oTe();Een();lYe();uJt();AM();UWe();Cen="[object Map]";cli="[object Object]";Sen="[object Promise]";Aen="[object Set]";ken="[object WeakMap]";Ren="[object DataView]";uli=rR(yTe);dli=rR(UM);fli=rR(bTe);hli=rR(HM);pli=rR(q_e);b5=V0;if(yTe&&b5(new yTe(new ArrayBuffer(1)))!=Ren||UM&&b5(new UM)!=Cen||bTe&&b5(bTe.resolve())!=Sen||HM&&b5(new HM)!=Aen||q_e&&b5(new q_e)!=ken){b5=function(e){var t=V0(e),n=t==cli?e.constructor:void 0,r=n?rR(n):"";if(r){switch(r){case uli:return Ren;case dli:return Cen;case fli:return Sen;case hli:return Aen;case pli:return ken}}return t}}Y1=b5});function yli(e){var t=e.length,n=new e.constructor(t);if(t&&typeof e[0]=="string"&&gli.call(e,"index")){n.index=e.index;n.input=e.input}return n}var mli,gli,Pen;var Ien=Ce(()=>{mli=Object.prototype;gli=mli.hasOwnProperty;Pen=yli});var bli,DV;var cYe=Ce(()=>{w_();bli=Gf.Uint8Array;DV=bli});function xli(e){var t=new e.constructor(e.byteLength);new DV(t).set(new DV(e));return t}var FV;var xTe=Ce(()=>{cYe();FV=xli});function vli(e,t){var n=t?FV(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var Men;var Len=Ce(()=>{xTe();Men=vli});function Tli(e){var t=new e.constructor(e.source,_li.exec(e));t.lastIndex=e.lastIndex;return t}var _li,Den;var Fen=Ce(()=>{_li=/\w*$/;Den=Tli});function wli(e){return Oen?Object(Oen.call(e)):{}}var Nen,Oen,Ben;var zen=Ce(()=>{p5();Nen=Pm?Pm.prototype:void 0;Oen=Nen?Nen.valueOf:void 0;Ben=wli});function Eli(e,t){var n=t?FV(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var vTe;var uYe=Ce(()=>{xTe();vTe=Eli});function Hli(e,t,n){var r=e.constructor;switch(t){case Lli:return FV(e);case Cli:case Sli:return new r(+e);case Dli:return Men(e,n);case Fli:case Nli:case Oli:case Bli:case zli:case Uli:case Vli:case $li:case Gli:return vTe(e,n);case Ali:return new r;case kli:case Ili:return new r(e);case Rli:return Den(e);case Pli:return new r;case Mli:return Ben(e)}}var Cli,Sli,Ali,kli,Rli,Pli,Ili,Mli,Lli,Dli,Fli,Nli,Oli,Bli,zli,Uli,Vli,$li,Gli,Uen;var Ven=Ce(()=>{xTe();Len();Fen();zen();uYe();Cli="[object Boolean]";Sli="[object Date]";Ali="[object Map]";kli="[object Number]";Rli="[object RegExp]";Pli="[object Set]";Ili="[object String]";Mli="[object Symbol]";Lli="[object ArrayBuffer]";Dli="[object DataView]";Fli="[object Float32Array]";Nli="[object Float64Array]";Oli="[object Int8Array]";Bli="[object Int16Array]";zli="[object Int32Array]";Uli="[object Uint8Array]";Vli="[object Uint8ClampedArray]";$li="[object Uint16Array]";Gli="[object Uint32Array]";Uen=Hli});function Wli(e){return typeof e.constructor=="function"&&!DM(e)?fJt(IV(e)):{}}var _Te;var dYe=Ce(()=>{hJt();uTe();tQ();_Te=Wli});function qli(e){return hh(e)&&Y1(e)==Yli}var Yli,$en;var Gen=Ce(()=>{x5();gw();Yli="[object Map]";$en=qli});var Hen,Xli,Wen;var Yen=Ce(()=>{Gen();nQ();eTe();Hen=oR&&oR.isMap;Xli=Hen?FM(Hen):$en;Wen=Xli});function Kli(e){return hh(e)&&Y1(e)==jli}var jli,qen;var Xen=Ce(()=>{x5();gw();jli="[object Set]";qen=Kli});var jen,Zli,Ken;var Zen=Ce(()=>{Xen();nQ();eTe();jen=oR&&oR.isSet;Zli=jen?FM(jen):qen;Ken=Zli});function TTe(e,t,n,r,i,o){var a,s=t&Jli,l=t&Qli,u=t&eci;if(n){a=i?n(e,r,i,o):n(e)}if(a!==void 0){return a}if(!ef(e)){return e}var d=Us(e);if(d){a=Pen(e);if(!s){return X_e(e,a)}}else{var f=Y1(e),h=f==Qen||f==oci;if(bw(e)){return dTe(e,s)}if(f==etn||f==Jen||h&&!i){a=l||h?{}:_Te(e);if(!s){return l?xen(e,uen(a,e)):yen(e,len(a,e))}}else{if(!od[f]){return i?e:{}}a=Uen(e,f,s)}}o||(o=new CC);var m=o.get(e);if(m){return m}o.set(e,a);if(Ken(e)){e.forEach(function(w){a.add(TTe(w,t,n,w,e,o))})}else if(Wen(e)){e.forEach(function(w,_){a.set(_,TTe(w,t,n,_,e,o))})}var g=u?l?_en:fQ:l?cx:hu;var x=d?void 0:g(e);K_e(x||e,function(w,_){if(x){_=w;w=e[_]}MM(a,_,TTe(w,t,n,_,e,o))});return a}var Jli,Qli,eci,Jen,tci,nci,rci,ici,Qen,oci,aci,sci,etn,lci,cci,uci,dci,fci,hci,pci,mci,gci,yci,bci,xci,vci,_ci,Tci,wci,od,wTe;var fYe=Ce(()=>{dQ();WWe();JJ();cen();den();nYe();VWe();ben();ven();sYe();Ten();x5();Ien();Ven();dYe();Yh();TV();Yen();E_();Zen();aR();OM();Jli=1;Qli=2;eci=4;Jen="[object Arguments]";tci="[object Array]";nci="[object Boolean]";rci="[object Date]";ici="[object Error]";Qen="[object Function]";oci="[object GeneratorFunction]";aci="[object Map]";sci="[object Number]";etn="[object Object]";lci="[object RegExp]";cci="[object Set]";uci="[object String]";dci="[object Symbol]";fci="[object WeakMap]";hci="[object ArrayBuffer]";pci="[object DataView]";mci="[object Float32Array]";gci="[object Float64Array]";yci="[object Int8Array]";bci="[object Int16Array]";xci="[object Int32Array]";vci="[object Uint8Array]";_ci="[object Uint8ClampedArray]";Tci="[object Uint16Array]";wci="[object Uint32Array]";od={};od[Jen]=od[tci]=od[hci]=od[pci]=od[nci]=od[rci]=od[mci]=od[gci]=od[yci]=od[bci]=od[xci]=od[aci]=od[sci]=od[etn]=od[lci]=od[cci]=od[uci]=od[dci]=od[vci]=od[_ci]=od[Tci]=od[wci]=true;od[ici]=od[Qen]=od[fci]=false;wTe=TTe});function Cci(e){return wTe(e,Eci)}var Eci,hYe;var ttn=Ce(()=>{fYe();Eci=4;hYe=Cci});function kci(e){return wTe(e,Sci|Aci)}var Sci,Aci,hQ;var ntn=Ce(()=>{fYe();Sci=1;Aci=4;hQ=kci});function Pci(e){this.__data__.set(e,Rci);return this}var Rci,rtn;var itn=Ce(()=>{Rci="__lodash_hash_undefined__";rtn=Pci});function Ici(e){return this.__data__.has(e)}var otn;var atn=Ce(()=>{otn=Ici});function ETe(e){var t=-1,n=e==null?0:e.length;this.__data__=new y5;while(++t{aTe();itn();atn();ETe.prototype.add=ETe.prototype.push=rtn;ETe.prototype.has=otn;CTe=ETe});function Mci(e,t){var n=-1,r=e==null?0:e.length;while(++n{stn=Mci});function Lci(e,t){return e.has(t)}var STe;var mYe=Ce(()=>{STe=Lci});function Nci(e,t,n,r,i,o){var a=n&Dci,s=e.length,l=t.length;if(s!=l&&!(a&&l>s)){return false}var u=o.get(e);var d=o.get(t);if(u&&d){return u==t&&d==e}var f=-1,h=true,m=n&Fci?new CTe:void 0;o.set(e,t);o.set(t,e);while(++f{pYe();ltn();mYe();Dci=1;Fci=2;ATe=Nci});function Oci(e){var t=-1,n=Array(e.size);e.forEach(function(r,i){n[++t]=[i,r]});return n}var ctn;var utn=Ce(()=>{ctn=Oci});function Bci(e){var t=-1,n=Array(e.size);e.forEach(function(r){n[++t]=r});return n}var NV;var kTe=Ce(()=>{NV=Bci});function Jci(e,t,n,r,i,o,a){switch(n){case Zci:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset){return false}e=e.buffer;t=t.buffer;case Kci:if(e.byteLength!=t.byteLength||!o(new DV(e),new DV(t))){return false}return true;case Vci:case $ci:case Wci:return C_(+e,+t);case Gci:return e.name==t.name&&e.message==t.message;case Yci:case Xci:return e==t+"";case Hci:var s=ctn;case qci:var l=r&zci;s||(s=NV);if(e.size!=t.size&&!l){return false}var u=a.get(e);if(u){return u==t}r|=Uci;a.set(e,t);var d=ATe(s(e),s(t),r,i,o,a);a["delete"](e);return d;case jci:if(yYe){return yYe.call(e)==yYe.call(t)}}return false}var zci,Uci,Vci,$ci,Gci,Hci,Wci,Yci,qci,Xci,jci,Kci,Zci,dtn,yYe,ftn;var htn=Ce(()=>{p5();cYe();g5();gYe();utn();kTe();zci=1;Uci=2;Vci="[object Boolean]";$ci="[object Date]";Gci="[object Error]";Hci="[object Map]";Wci="[object Number]";Yci="[object RegExp]";qci="[object Set]";Xci="[object String]";jci="[object Symbol]";Kci="[object ArrayBuffer]";Zci="[object DataView]";dtn=Pm?Pm.prototype:void 0;yYe=dtn?dtn.valueOf:void 0;ftn=Jci});function nui(e,t,n,r,i,o){var a=n&Qci,s=fQ(e),l=s.length,u=fQ(t),d=u.length;if(l!=d&&!a){return false}var f=l;while(f--){var h=s[f];if(!(a?h in t:tui.call(t,h))){return false}}var m=o.get(e);var g=o.get(t);if(m&&g){return m==t&&g==e}var x=true;o.set(e,t);o.set(t,e);var w=a;while(++f{sYe();Qci=1;eui=Object.prototype;tui=eui.hasOwnProperty;ptn=nui});function oui(e,t,n,r,i,o){var a=Us(e),s=Us(t),l=a?ytn:Y1(e),u=s?ytn:Y1(t);l=l==gtn?RTe:l;u=u==gtn?RTe:u;var d=l==RTe,f=u==RTe,h=l==u;if(h&&bw(e)){if(!bw(t)){return false}a=true;d=false}if(h&&!d){o||(o=new CC);return a||NM(e)?ATe(e,t,n,r,i,o):ftn(e,t,l,n,r,i,o)}if(!(n&rui)){var m=d&&btn.call(e,"__wrapped__"),g=f&&btn.call(t,"__wrapped__");if(m||g){var x=m?e.value():e,w=g?t.value():t;o||(o=new CC);return i(x,w,n,r,o)}}if(!h){return false}o||(o=new CC);return ptn(e,t,n,r,i,o)}var rui,gtn,ytn,RTe,iui,btn,xtn;var vtn=Ce(()=>{dQ();gYe();htn();mtn();x5();Yh();TV();iQ();rui=1;gtn="[object Arguments]";ytn="[object Array]";RTe="[object Object]";iui=Object.prototype;btn=iui.hasOwnProperty;xtn=oui});function _tn(e,t,n,r,i){if(e===t){return true}if(e==null||t==null||!hh(e)&&!hh(t)){return e!==e&&t!==t}return xtn(e,t,n,r,_tn,i)}var PTe;var bYe=Ce(()=>{vtn();gw();PTe=_tn});function lui(e,t,n,r){var i=n.length,o=i,a=!r;if(e==null){return!o}e=Object(e);while(i--){var s=n[i];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e)){return false}}while(++i{dQ();bYe();aui=1;sui=2;Ttn=lui});function cui(e){return e===e&&!ef(e)}var ITe;var xYe=Ce(()=>{E_();ITe=cui});function uui(e){var t=hu(e),n=t.length;while(n--){var r=t[n],i=e[r];t[n]=[r,i,ITe(i)]}return t}var Etn;var Ctn=Ce(()=>{xYe();aR();Etn=uui});function dui(e,t){return function(n){if(n==null){return false}return n[e]===t&&(t!==void 0||e in Object(n))}}var MTe;var vYe=Ce(()=>{MTe=dui});function fui(e){var t=Etn(e);if(t.length==1&&t[0][2]){return MTe(t[0][0],t[0][1])}return function(n){return n===e||Ttn(n,e,t)}}var Stn;var Atn=Ce(()=>{wtn();Ctn();vYe();Stn=fui});function hui(e,t){return e!=null&&t in Object(e)}var ktn;var Rtn=Ce(()=>{ktn=hui});function pui(e,t,n){t=$M(t,e);var r=-1,i=t.length,o=false;while(++r{cQ();_V();Yh();KJ();Q_e();kV();LTe=pui});function mui(e,t){return e!=null&<e(e,t,ktn)}var DTe;var TYe=Ce(()=>{Rtn();_Ye();DTe=mui});function bui(e,t){if(EV(e)&&ITe(t)){return MTe(EC(e),t)}return function(n){var r=OQt(n,e);return r===void 0&&r===t?DTe(n,e):PTe(t,r,gui|yui)}}var gui,yui,Ptn;var Itn=Ce(()=>{bYe();BQt();TYe();iTe();xYe();vYe();kV();gui=1;yui=2;Ptn=bui});function xui(e){return function(t){return t==null?void 0:t[e]}}var FTe;var wYe=Ce(()=>{FTe=xui});function vui(e){return function(t){return GM(t,e)}}var Mtn;var Ltn=Ce(()=>{uQ();Mtn=vui});function _ui(e){return EV(e)?FTe(EC(e)):Mtn(e)}var Dtn;var Ftn=Ce(()=>{wYe();Ltn();iTe();kV();Dtn=_ui});function Tui(e){if(typeof e=="function"){return e}if(e==null){return sx}if(typeof e=="object"){return Us(e)?Ptn(e[0],e[1]):Stn(e)}return Dtn(e)}var Oy;var lR=Ce(()=>{Atn();Itn();kM();Yh();Ftn();Oy=Tui});function wui(e){return function(t,n,r){var i=-1,o=Object(t),a=r(t),s=a.length;while(s--){var l=a[e?s:++i];if(n(o[l],l,o)===false){break}}return t}}var Ntn;var Otn=Ce(()=>{Ntn=wui});var Eui,OV;var NTe=Ce(()=>{Otn();Eui=Ntn();OV=Eui});function Cui(e,t){return e&&OV(e,t,hu)}var BV;var OTe=Ce(()=>{NTe();aR();BV=Cui});function Sui(e,t){return function(n,r){if(n==null){return n}if(!Im(n)){return e(n,r)}var i=n.length,o=t?i:-1,a=Object(n);while(t?o--:++o{wC();Btn=Sui});var Aui,WM;var pQ=Ce(()=>{OTe();ztn();Aui=Btn(BV);WM=Aui});var kui,v5;var Utn=Ce(()=>{w_();kui=function(){return Gf.Date.now()};v5=kui});var Vtn,Rui,Pui,mQ;var $tn=Ce(()=>{QJ();g5();eQ();OM();Vtn=Object.prototype;Rui=Vtn.hasOwnProperty;Pui=LM(function(e,t){e=Object(e);var n=-1;var r=t.length;var i=r>2?t[2]:void 0;if(i&&iR(t[0],t[1],i)){r=1}while(++n{ZJ();g5();gQ=Iui});function Mui(e){return hh(e)&&Im(e)}var BTe;var CYe=Ce(()=>{wC();gw();BTe=Mui});function Lui(e,t){if(t==="constructor"&&typeof e[t]==="function"){return}if(t=="__proto__"){return}return e[t]}var yQ;var SYe=Ce(()=>{yQ=Lui});function Dui(e){return TC(e,cx(e))}var Gtn;var Htn=Ce(()=>{xV();OM();Gtn=Dui});function Fui(e,t,n,r,i,o,a){var s=yQ(e,n),l=yQ(t,n),u=a.get(l);if(u){gQ(e,n,u);return}var d=o?o(s,l,n+"",e,t,a):void 0;var f=d===void 0;if(f){var h=Us(l),m=!h&&bw(l),g=!h&&!m&&NM(l);d=l;if(h||m||g){if(Us(s)){d=s}else if(BTe(s)){d=X_e(s)}else if(m){f=false;d=dTe(l,true)}else if(g){f=false;d=vTe(l,true)}else{d=[]}}else if(YQt(l)||yw(l)){d=s;if(yw(s)){d=Gtn(s)}else if(!ef(s)||W1(s)){d=_Te(l)}}else{f=false}}if(f){a.set(l,d);i(d,l,r,o,a);a["delete"](l)}gQ(e,n,d)}var Wtn;var Ytn=Ce(()=>{EYe();nYe();uYe();VWe();dYe();_V();Yh();CYe();TV();jJ();E_();qQt();iQ();SYe();Htn();Wtn=Fui});function qtn(e,t,n,r,i){if(e===t){return}OV(t,function(o,a){i||(i=new CC);if(ef(o)){Wtn(e,t,a,n,qtn,r,i)}else{var s=r?r(yQ(e,a),o,a+"",e,t,i):void 0;if(s===void 0){s=o}gQ(e,a,s)}},cx)}var Xtn;var jtn=Ce(()=>{dQ();EYe();NTe();Ytn();E_();OM();SYe();Xtn=qtn});function Nui(e,t,n){var r=-1,i=e==null?0:e.length;while(++r{Ktn=Nui});function Oui(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var $0;var Jtn=Ce(()=>{$0=Oui});function Bui(e){return typeof e=="function"?e:sx}var zV;var zTe=Ce(()=>{kM();zV=Bui});function zui(e,t){var n=Us(e)?K_e:WM;return n(e,zV(t))}var Rn;var AYe=Ce(()=>{WWe();pQ();zTe();Yh();Rn=zui});var Qtn=Ce(()=>{AYe()});function Uui(e,t){var n=[];WM(e,function(r,i,o){if(t(r,i,o)){n.push(r)}});return n}var enn;var tnn=Ce(()=>{pQ();enn=Uui});function Vui(e,t){var n=Us(e)?fTe:enn;return n(e,Oy(t,3))}var pu;var nnn=Ce(()=>{rYe();tnn();lR();Yh();pu=Vui});function $ui(e){return function(t,n,r){var i=Object(t);if(!Im(t)){var o=Oy(n,3);t=hu(t);n=function(s){return o(i[s],s,i)}}var a=e(t,n,r);return a>-1?i[o?t[a]:a]:void 0}}var rnn;var inn=Ce(()=>{lR();wC();aR();rnn=$ui});function Hui(e,t,n){var r=e==null?0:e.length;if(!r){return-1}var i=n==null?0:eJt(n);if(i<0){i=Gui(r+i,0)}return Z_e(e,Oy(t,3),i)}var Gui,onn;var ann=Ce(()=>{YWe();lR();tJt();Gui=Math.max;onn=Hui});var Wui,xw;var snn=Ce(()=>{inn();ann();Wui=rnn(onn);xw=Wui});function Yui(e,t){var n=-1,r=Im(e)?Array(e.length):[];WM(e,function(i,o,a){r[++n]=t(i,o,a)});return r}var UTe;var kYe=Ce(()=>{pQ();wC();UTe=Yui});function qui(e,t){var n=Us(e)?_C:UTe;return n(e,Oy(t,3))}var na;var lnn=Ce(()=>{XJ();lR();kYe();Yh();na=qui});function Xui(e,t){return e==null?e:OV(e,zV(t),cx)}var bQ;var cnn=Ce(()=>{NTe();zTe();OM();bQ=Xui});function jui(e,t){return e&&BV(e,zV(t))}var xQ;var unn=Ce(()=>{OTe();zTe();xQ=jui});function Kui(e,t){return e>t}var dnn;var fnn=Ce(()=>{dnn=Kui});function Qui(e,t){return e!=null&&Jui.call(e,t)}var Zui,Jui,hnn;var pnn=Ce(()=>{Zui=Object.prototype;Jui=Zui.hasOwnProperty;hnn=Qui});function edi(e,t){return e!=null&<e(e,t,hnn)}var cR;var mnn=Ce(()=>{pnn();_Ye();cR=edi});function ndi(e){return typeof e=="string"||!Us(e)&&hh(e)&&V0(e)==tdi}var tdi,gnn;var ynn=Ce(()=>{AM();Yh();gw();tdi="[object String]";gnn=ndi});function rdi(e,t){return _C(t,function(n){return e[n]})}var bnn;var xnn=Ce(()=>{XJ();bnn=rdi});function idi(e){return e==null?[]:bnn(e,hu(e))}var Nd;var vnn=Ce(()=>{xnn();aR();Nd=idi});function cdi(e){if(e==null){return true}if(Im(e)&&(Us(e)||typeof e=="string"||typeof e.splice=="function"||bw(e)||NM(e)||yw(e))){return!e.length}var t=Y1(e);if(t==odi||t==adi){return!e.size}if(DM(e)){return!wV(e).length}for(var n in e){if(ldi.call(e,n)){return false}}return true}var odi,adi,sdi,ldi,_5;var _nn=Ce(()=>{rTe();x5();_V();Yh();wC();TV();tQ();iQ();odi="[object Map]";adi="[object Set]";sdi=Object.prototype;ldi=sdi.hasOwnProperty;_5=cdi});function udi(e){return e===void 0}var ns;var Tnn=Ce(()=>{ns=udi});function ddi(e,t){return e{VTe=ddi});function fdi(e,t){var n={};t=Oy(t,3);BV(e,function(r,i,o){IM(n,i,t(r,i,o))});return n}var q1;var wnn=Ce(()=>{ZJ();OTe();lR();q1=fdi});function hdi(e,t,n){var r=-1,i=e.length;while(++r{m5();UV=hdi});function pdi(e){return e&&e.length?UV(e,sx,dnn):void 0}var Hu;var Enn=Ce(()=>{$Te();fnn();kM();Hu=pdi});var mdi,vw;var Cnn=Ce(()=>{jtn();MJt();mdi=IJt(function(e,t,n){Xtn(e,t,n)});vw=mdi});function gdi(e){return e&&e.length?UV(e,sx,VTe):void 0}var xg;var Snn=Ce(()=>{$Te();RYe();kM();xg=gdi});function ydi(e,t){return e&&e.length?UV(e,Oy(t,2),VTe):void 0}var X1;var Ann=Ce(()=>{$Te();lR();RYe();X1=ydi});function bdi(e,t,n,r){if(!ef(e)){return e}t=$M(t,e);var i=-1,o=t.length,a=o-1,s=e;while(s!=null&&++i{JJ();cQ();KJ();E_();kV();knn=bdi});function xdi(e,t,n){var r=-1,i=t.length,o={};while(++r{uQ();Rnn();cQ();Pnn=xdi});function vdi(e,t){var n=e.length;e.sort(t);while(n--){e[n]=e[n].value}return e}var Mnn;var Lnn=Ce(()=>{Mnn=vdi});function _di(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,o=H1(e);var a=t!==void 0,s=t===null,l=t===t,u=H1(t);if(!s&&!u&&!o&&e>t||o&&a&&l&&!s&&!u||r&&a&&l||!n&&l||!i){return 1}if(!r&&!o&&!u&&e{m5();Dnn=_di});function Tdi(e,t,n){var r=-1,i=e.criteria,o=t.criteria,a=i.length,s=n.length;while(++r=s){return l}var u=n[r];return l*(u=="desc"?-1:1)}}return e.index-t.index}var Nnn;var Onn=Ce(()=>{Fnn();Nnn=Tdi});function wdi(e,t,n){if(t.length){t=_C(t,function(o){if(Us(o)){return function(a){return GM(a,o.length===1?o[0]:o)}}return o})}else{t=[sx]}var r=-1;t=_C(t,FM(Oy));var i=UTe(e,function(o,a,s){var l=_C(t,function(u){return u(o)});return{"criteria":l,"index":++r,"value":o}});return Mnn(i,function(o,a){return Nnn(o,a,n)})}var Bnn;var znn=Ce(()=>{XJ();uQ();lR();kYe();Lnn();nQ();Onn();kM();Yh();Bnn=wdi});var Edi,Unn;var Vnn=Ce(()=>{wYe();Edi=FTe("length");Unn=Edi});function Ndi(e){var t=$nn.lastIndex=0;while($nn.test(e)){++t}return t}var Gnn,Cdi,Sdi,Adi,kdi,Rdi,Pdi,PYe,IYe,Idi,Hnn,Wnn,Ynn,Mdi,qnn,Xnn,Ldi,Ddi,Fdi,$nn,jnn;var Knn=Ce(()=>{Gnn="\\ud800-\\udfff";Cdi="\\u0300-\\u036f";Sdi="\\ufe20-\\ufe2f";Adi="\\u20d0-\\u20ff";kdi=Cdi+Sdi+Adi;Rdi="\\ufe0e\\ufe0f";Pdi="["+Gnn+"]";PYe="["+kdi+"]";IYe="\\ud83c[\\udffb-\\udfff]";Idi="(?:"+PYe+"|"+IYe+")";Hnn="[^"+Gnn+"]";Wnn="(?:\\ud83c[\\udde6-\\uddff]){2}";Ynn="[\\ud800-\\udbff][\\udc00-\\udfff]";Mdi="\\u200d";qnn=Idi+"?";Xnn="["+Rdi+"]?";Ldi="(?:"+Mdi+"(?:"+[Hnn,Wnn,Ynn].join("|")+")"+Xnn+qnn+")*";Ddi=Xnn+qnn+Ldi;Fdi="(?:"+[Hnn+PYe+"?",PYe,Wnn,Ynn,Pdi].join("|")+")";$nn=RegExp(IYe+"(?="+IYe+")|"+Fdi+Ddi,"g");jnn=Ndi});function Odi(e){return XQt(e)?jnn(e):Unn(e)}var Znn;var Jnn=Ce(()=>{Vnn();jQt();Knn();Znn=Odi});function Bdi(e,t){return Pnn(e,t,function(n,r){return DTe(e,r)})}var Qnn;var ern=Ce(()=>{Inn();TYe();Qnn=Bdi});var zdi,j1;var trn=Ce(()=>{ern();HQt();zdi=GQt(function(e,t){return e==null?{}:Qnn(e,t)});j1=zdi});function $di(e,t,n,r){var i=-1,o=Vdi(Udi((t-e)/(n||1)),0),a=Array(o);while(o--){a[r?o:++i]=e;e+=n}return a}var Udi,Vdi,nrn;var rrn=Ce(()=>{Udi=Math.ceil;Vdi=Math.max;nrn=$di});function Gdi(e){return function(t,n,r){if(r&&typeof r!="number"&&iR(t,n,r)){n=r=void 0}t=yV(t);if(n===void 0){n=t;t=0}else{n=yV(n)}r=r===void 0?t{rrn();eQ();zWe();irn=Gdi});var Hdi,Tf;var arn=Ce(()=>{orn();Hdi=irn();Tf=Hdi});function Wdi(e,t,n,r,i){i(e,function(o,a,s){n=r?(r=false,o):t(n,o,a,s)});return n}var srn;var lrn=Ce(()=>{srn=Wdi});function Ydi(e,t,n){var r=Us(e)?KQt:srn,i=arguments.length<3;return r(e,Oy(t,4),n,i,WM)}var kp;var crn=Ce(()=>{ZQt();pQ();lR();lrn();Yh();kp=Ydi});function jdi(e){if(e==null){return 0}if(Im(e)){return gnn(e)?Znn(e):e.length}var t=Y1(e);if(t==qdi||t==Xdi){return e.size}return wV(e).length}var qdi,Xdi,vQ;var urn=Ce(()=>{rTe();x5();wC();ynn();Jnn();qdi="[object Map]";Xdi="[object Set]";vQ=jdi});var Kdi,Rp;var drn=Ce(()=>{cTe();znn();QJ();eQ();Kdi=LM(function(e,t){if(e==null){return[]}var n=t.length;if(n>1&&iR(e,t[0],t[1])){t=[]}else if(n>2&&iR(t[0],t[1],t[2])){t=[t[0]]}return Bnn(e,PV(t,1),[])});Rp=Kdi});var Zdi,Jdi,frn;var hrn=Ce(()=>{lYe();yJt();kTe();Zdi=1/0;Jdi=!(HM&&1/NV(new HM([,-0]))[1]==Zdi)?gJt:function(e){return new HM(e)};frn=Jdi});function efi(e,t,n){var r=-1,i=kJt,o=e.length,a=true,s=[],l=s;if(n){a=false;i=Ktn}else if(o>=Qdi){var u=t?null:frn(e);if(u){return NV(u)}a=false;i=STe;l=new CTe}else{l=t?[]:s}e:while(++r{pYe();RJt();Ztn();mYe();hrn();kTe();Qdi=200;prn=efi});var tfi,_Q;var grn=Ce(()=>{cTe();QJ();mrn();CYe();tfi=LM(function(e){return prn(PV(e,1,BTe,true))});_Q=tfi});function rfi(e){var t=++nfi;return sTe(e)+t}var nfi,K1;var yrn=Ce(()=>{eYe();nfi=0;K1=rfi});function ifi(e,t,n){var r=-1,i=e.length,o=t.length,a={};while(++r{brn=ifi});function ofi(e,t){return brn(e||[],t||[],MM)}var T5;var vrn=Ce(()=>{JJ();xrn();T5=ofi});var oa=Ce(()=>{ttn();ntn();$We();$tn();Qtn();nnn();snn();tYe();AYe();cnn();unn();mnn();Yh();_nn();jJ();Tnn();aR();Jtn();lnn();wnn();Enn();Cnn();Snn();Ann();Utn();trn();arn();crn();urn();drn();grn();yrn();vnn();vrn();});var bon,B,ZM;var Yo=Ce(()=>{bon=Object.defineProperty;B=(e,t)=>bon(e,"name",{value:t,configurable:true});ZM=(e,t)=>{for(var n in t)bon(e,n,{get:t[n],enumerable:true})}});var uwe=_r((uqe,dqe)=>{!function(e,t){"object"==typeof uqe&&"undefined"!=typeof dqe?dqe.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs=t()}(uqe,function(){"use strict";var e=1e3,t=6e4,n=36e5,r="millisecond",i="second",o="minute",a="hour",s="day",l="week",u="month",d="quarter",f="year",h="date",m="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,x=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,w={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(H){var $=["th","st","nd","rd"],K=H%100;return"["+H+($[(K-20)%10]||$[K]||$[0])+"]"}},_=function(H,$,K){var X=String(H);return!X||X.length>=$?H:""+Array($+1-X.length).join(K)+H},C={s:_,z:function(H){var $=-H.utcOffset(),K=Math.abs($),X=Math.floor(K/60),j=K%60;return($<=0?"+":"-")+_(X,2,"0")+":"+_(j,2,"0")},m:function H($,K){if($.date()1)return H(J[0])}else{var oe=$.name;P[oe]=$,j=oe}return!X&&j&&(A=j),j||!X&&A},O=function(H,$){if(I(H))return H.clone();var K="object"==typeof $?$:{};return K.date=H,K.args=arguments,new U(K)},z=C;z.l=N,z.i=I,z.w=function(H,$){return O(H,{locale:$.$L,utc:$.$u,x:$.$x,$offset:$.$offset})};var U=function(){function H(K){this.$L=N(K.locale,null,true),this.parse(K),this.$x=this.$x||K.x||{},this[L]=true}var $=H.prototype;return $.parse=function(K){this.$d=function(X){var j=X.date,te=X.utc;if(null===j)return new Date(NaN);if(z.u(j))return new Date;if(j instanceof Date)return new Date(j);if("string"==typeof j&&!/Z$/i.test(j)){var J=j.match(g);if(J){var oe=J[2]-1||0,se=(J[7]||"0").substring(0,3);return te?new Date(Date.UTC(J[1],oe,J[3]||1,J[4]||0,J[5]||0,J[6]||0,se)):new Date(J[1],oe,J[3]||1,J[4]||0,J[5]||0,J[6]||0,se)}}return new Date(j)}(K),this.init()},$.init=function(){var K=this.$d;this.$y=K.getFullYear(),this.$M=K.getMonth(),this.$D=K.getDate(),this.$W=K.getDay(),this.$H=K.getHours(),this.$m=K.getMinutes(),this.$s=K.getSeconds(),this.$ms=K.getMilliseconds()},$.$utils=function(){return z},$.isValid=function(){return!(this.$d.toString()===m)},$.isSame=function(K,X){var j=O(K);return this.startOf(X)<=j&&j<=this.endOf(X)},$.isAfter=function(K,X){return O(K){Yo();xon=Ui(uwe(),1);uR={trace:0,debug:1,info:2,warn:3,error:4,fatal:5};wt={trace:B((...e)=>{},"trace"),debug:B((...e)=>{},"debug"),info:B((...e)=>{},"info"),warn:B((...e)=>{},"warn"),error:B((...e)=>{},"error"),fatal:B((...e)=>{},"fatal")};MQ=B(function(e="fatal"){let t=uR.fatal;if(typeof e==="string"){if(e.toLowerCase()in uR){t=uR[e]}}else if(typeof e==="number"){t=e}wt.trace=()=>{};wt.debug=()=>{};wt.info=()=>{};wt.warn=()=>{};wt.error=()=>{};wt.fatal=()=>{};if(t<=uR.fatal){wt.fatal=console.error?console.error.bind(console,S_("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",S_("FATAL"))}if(t<=uR.error){wt.error=console.error?console.error.bind(console,S_("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",S_("ERROR"))}if(t<=uR.warn){wt.warn=console.warn?console.warn.bind(console,S_("WARN"),"color: orange"):console.log.bind(console,`\x1B[33m`,S_("WARN"))}if(t<=uR.info){wt.info=console.info?console.info.bind(console,S_("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",S_("INFO"))}if(t<=uR.debug){wt.debug=console.debug?console.debug.bind(console,S_("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",S_("DEBUG"))}if(t<=uR.trace){wt.trace=console.debug?console.debug.bind(console,S_("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",S_("TRACE"))}},"setLogLevel");S_=B(e=>{const t=(0,xon.default)().format("ss.SSS");return`%c${t} : ${e} : `},"format")});var dwe,von;var _on=Ce(()=>{dwe={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:e=>e>=255?255:e<0?0:e,g:e=>e>=255?255:e<0?0:e,b:e=>e>=255?255:e<0?0:e,h:e=>e%360,s:e=>e>=100?100:e<0?0:e,l:e=>e>=100?100:e<0?0:e,a:e=>e>=1?1:e<0?0:e},toLinear:e=>{const t=e/255;return e>.03928?Math.pow((t+.055)/1.055,2.4):t/12.92},hue2rgb:(e,t,n)=>{if(n<0)n+=1;if(n>1)n-=1;if(n<1/6)return e+(t-e)*6*n;if(n<1/2)return t;if(n<2/3)return e+(t-e)*(2/3-n)*6;return e},hsl2rgb:({h:e,s:t,l:n},r)=>{if(!t)return n*2.55;e/=360;t/=100;n/=100;const i=n<.5?n*(1+t):n+t-n*t;const o=2*n-i;switch(r){case"r":return dwe.hue2rgb(o,i,e+1/3)*255;case"g":return dwe.hue2rgb(o,i,e)*255;case"b":return dwe.hue2rgb(o,i,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:n},r)=>{e/=255;t/=255;n/=255;const i=Math.max(e,t,n);const o=Math.min(e,t,n);const a=(i+o)/2;if(r==="l")return a*100;if(i===o)return 0;const s=i-o;const l=a>.5?s/(2-i-o):s/(i+o);if(r==="s")return l*100;switch(i){case e:return((t-n)/s+(t{Nmi={clamp:(e,t,n)=>{if(t>n)return Math.min(t,Math.max(n,e));return Math.min(n,Math.max(t,e))},round:e=>{return Math.round(e*1e10)/1e10}};Ton=Nmi});var Omi,Eon;var Con=Ce(()=>{Omi={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}};Eon=Omi});var Bmi,ua;var AC=Ce(()=>{_on();won();Con();Bmi={channel:von,lang:Ton,unit:Eon};ua=Bmi});var dR,Pp;var LQ=Ce(()=>{AC();dR={};for(let e=0;e<=255;e++)dR[e]=ua.unit.dec2hex(e);Pp={ALL:0,RGB:1,HSL:2}});var fqe,Son;var Aon=Ce(()=>{LQ();fqe=class{constructor(){this.type=Pp.ALL}get(){return this.type}set(t){if(this.type&&this.type!==t)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=t}reset(){this.type=Pp.ALL}is(t){return this.type===t}};Son=fqe});var hqe,kon;var Ron=Ce(()=>{AC();Aon();LQ();hqe=class{constructor(t,n){this.color=n;this.changed=false;this.data=t;this.type=new Son}set(t,n){this.color=n;this.changed=false;this.data=t;this.type.type=Pp.ALL;return this}_ensureHSL(){const t=this.data;const{h:n,s:r,l:i}=t;if(n===void 0)t.h=ua.channel.rgb2hsl(t,"h");if(r===void 0)t.s=ua.channel.rgb2hsl(t,"s");if(i===void 0)t.l=ua.channel.rgb2hsl(t,"l")}_ensureRGB(){const t=this.data;const{r:n,g:r,b:i}=t;if(n===void 0)t.r=ua.channel.hsl2rgb(t,"r");if(r===void 0)t.g=ua.channel.hsl2rgb(t,"g");if(i===void 0)t.b=ua.channel.hsl2rgb(t,"b")}get r(){const t=this.data;const n=t.r;if(!this.type.is(Pp.HSL)&&n!==void 0)return n;this._ensureHSL();return ua.channel.hsl2rgb(t,"r")}get g(){const t=this.data;const n=t.g;if(!this.type.is(Pp.HSL)&&n!==void 0)return n;this._ensureHSL();return ua.channel.hsl2rgb(t,"g")}get b(){const t=this.data;const n=t.b;if(!this.type.is(Pp.HSL)&&n!==void 0)return n;this._ensureHSL();return ua.channel.hsl2rgb(t,"b")}get h(){const t=this.data;const n=t.h;if(!this.type.is(Pp.RGB)&&n!==void 0)return n;this._ensureRGB();return ua.channel.rgb2hsl(t,"h")}get s(){const t=this.data;const n=t.s;if(!this.type.is(Pp.RGB)&&n!==void 0)return n;this._ensureRGB();return ua.channel.rgb2hsl(t,"s")}get l(){const t=this.data;const n=t.l;if(!this.type.is(Pp.RGB)&&n!==void 0)return n;this._ensureRGB();return ua.channel.rgb2hsl(t,"l")}get a(){return this.data.a}set r(t){this.type.set(Pp.RGB);this.changed=true;this.data.r=t}set g(t){this.type.set(Pp.RGB);this.changed=true;this.data.g=t}set b(t){this.type.set(Pp.RGB);this.changed=true;this.data.b=t}set h(t){this.type.set(Pp.HSL);this.changed=true;this.data.h=t}set s(t){this.type.set(Pp.HSL);this.changed=true;this.data.s=t}set l(t){this.type.set(Pp.HSL);this.changed=true;this.data.l=t}set a(t){this.changed=true;this.data.a=t}};kon=hqe});var zmi,JM;var DQ=Ce(()=>{Ron();zmi=new kon({r:0,g:0,b:0,a:0},"transparent");JM=zmi});var Pon,R5;var pqe=Ce(()=>{DQ();LQ();Pon={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(Pon.re);if(!t)return;const n=t[1];const r=parseInt(n,16);const i=n.length;const o=i%4===0;const a=i>4;const s=a?1:17;const l=a?8:4;const u=o?0:-1;const d=a?255:15;return JM.set({r:(r>>l*(u+3)&d)*s,g:(r>>l*(u+2)&d)*s,b:(r>>l*(u+1)&d)*s,a:o?(r&d)*s/255:1},e)},stringify:e=>{const{r:t,g:n,b:r,a:i}=e;if(i<1){return`#${dR[Math.round(t)]}${dR[Math.round(n)]}${dR[Math.round(r)]}${dR[Math.round(i*255)]}`}else{return`#${dR[Math.round(t)]}${dR[Math.round(n)]}${dR[Math.round(r)]}`}}};R5=Pon});var fwe,FQ;var Ion=Ce(()=>{AC();DQ();fwe={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:e=>{const t=e.match(fwe.hueRe);if(t){const[,n,r]=t;switch(r){case"grad":return ua.channel.clamp.h(parseFloat(n)*.9);case"rad":return ua.channel.clamp.h(parseFloat(n)*180/Math.PI);case"turn":return ua.channel.clamp.h(parseFloat(n)*360)}}return ua.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(t!==104&&t!==72)return;const n=e.match(fwe.re);if(!n)return;const[,r,i,o,a,s]=n;return JM.set({h:fwe._hue2deg(r),s:ua.channel.clamp.s(parseFloat(i)),l:ua.channel.clamp.l(parseFloat(o)),a:a?ua.channel.clamp.a(s?parseFloat(a)/100:parseFloat(a)):1},e)},stringify:e=>{const{h:t,s:n,l:r,a:i}=e;if(i<1){return`hsla(${ua.lang.round(t)}, ${ua.lang.round(n)}%, ${ua.lang.round(r)}%, ${i})`}else{return`hsl(${ua.lang.round(t)}, ${ua.lang.round(n)}%, ${ua.lang.round(r)}%)`}}};FQ=fwe});var hwe,mqe;var Mon=Ce(()=>{pqe();hwe={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:e=>{e=e.toLowerCase();const t=hwe.colors[e];if(!t)return;return R5.parse(t)},stringify:e=>{const t=R5.stringify(e);for(const n in hwe.colors){if(hwe.colors[n]===t)return n}return}};mqe=hwe});var Lon,NQ;var Don=Ce(()=>{AC();DQ();Lon={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:e=>{const t=e.charCodeAt(0);if(t!==114&&t!==82)return;const n=e.match(Lon.re);if(!n)return;const[,r,i,o,a,s,l,u,d]=n;return JM.set({r:ua.channel.clamp.r(i?parseFloat(r)*2.55:parseFloat(r)),g:ua.channel.clamp.g(a?parseFloat(o)*2.55:parseFloat(o)),b:ua.channel.clamp.b(l?parseFloat(s)*2.55:parseFloat(s)),a:u?ua.channel.clamp.a(d?parseFloat(u)/100:parseFloat(u)):1},e)},stringify:e=>{const{r:t,g:n,b:r,a:i}=e;if(i<1){return`rgba(${ua.lang.round(t)}, ${ua.lang.round(n)}, ${ua.lang.round(r)}, ${ua.lang.round(i)})`}else{return`rgb(${ua.lang.round(t)}, ${ua.lang.round(n)}, ${ua.lang.round(r)})`}}};NQ=Lon});var Umi,Ip;var fR=Ce(()=>{pqe();Ion();Mon();Don();LQ();Umi={format:{keyword:mqe,hex:R5,rgb:NQ,rgba:NQ,hsl:FQ,hsla:FQ},parse:e=>{if(typeof e!=="string")return e;const t=R5.parse(e)||NQ.parse(e)||FQ.parse(e)||mqe.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>{if(!e.changed&&e.color)return e.color;if(e.type.is(Pp.HSL)||e.data.r===void 0){return FQ.stringify(e)}else if(e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)){return NQ.stringify(e)}else{return R5.stringify(e)}}};Ip=Umi});var Vmi,pwe;var gqe=Ce(()=>{AC();fR();Vmi=(e,t)=>{const n=Ip.parse(e);for(const r in t){n[r]=ua.channel.clamp[r](t[r])}return Ip.stringify(n)};pwe=Vmi});var $mi,mh;var yqe=Ce(()=>{AC();DQ();fR();gqe();$mi=(e,t,n=0,r=1)=>{if(typeof e!=="number")return pwe(e,{a:t});const i=JM.set({r:ua.channel.clamp.r(e),g:ua.channel.clamp.g(t),b:ua.channel.clamp.b(n),a:ua.channel.clamp.a(r)});return Ip.stringify(i)};mh=$mi});var Gmi,P5;var Fon=Ce(()=>{AC();fR();Gmi=(e,t)=>{return ua.lang.round(Ip.parse(e)[t])};P5=Gmi});var Hmi,Non;var Oon=Ce(()=>{AC();fR();Hmi=e=>{const{r:t,g:n,b:r}=Ip.parse(e);const i=.2126*ua.channel.toLinear(t)+.7152*ua.channel.toLinear(n)+.0722*ua.channel.toLinear(r);return ua.lang.round(i)};Non=Hmi});var Wmi,Bon;var zon=Ce(()=>{Oon();Wmi=e=>{return Non(e)>=.5};Bon=Wmi});var Ymi,$c;var Uon=Ce(()=>{zon();Ymi=e=>{return!Bon(e)};$c=Ymi});var qmi,YV;var mwe=Ce(()=>{AC();fR();qmi=(e,t,n)=>{const r=Ip.parse(e);const i=r[t];const o=ua.channel.clamp[t](i+n);if(i!==o)r[t]=o;return Ip.stringify(r)};YV=qmi});var Xmi,Nr;var Von=Ce(()=>{mwe();Xmi=(e,t)=>{return YV(e,"l",t)};Nr=Xmi});var jmi,Or;var $on=Ce(()=>{mwe();jmi=(e,t)=>{return YV(e,"l",-t)};Or=jmi});var Kmi,gwe;var Gon=Ce(()=>{mwe();Kmi=(e,t)=>{return YV(e,"a",-t)};gwe=Kmi});var Zmi,$t;var Hon=Ce(()=>{fR();gqe();Zmi=(e,t)=>{const n=Ip.parse(e);const r={};for(const i in t){if(!t[i])continue;r[i]=n[i]+t[i]}return pwe(e,r)};$t=Zmi});var Jmi,Won;var Yon=Ce(()=>{fR();yqe();Jmi=(e,t,n=50)=>{const{r,g:i,b:o,a}=Ip.parse(e);const{r:s,g:l,b:u,a:d}=Ip.parse(t);const f=n/100;const h=f*2-1;const m=a-d;const g=h*m===-1?h:(h+m)/(1+h*m);const x=(g+1)/2;const w=1-x;const _=r*x+s*w;const C=i*x+l*w;const A=o*x+u*w;const P=a*f+d*(1-f);return mh(_,C,A,P)};Won=Jmi});var Qmi,mr;var qon=Ce(()=>{fR();Yon();Qmi=(e,t=100)=>{const n=Ip.parse(e);n.r=255-n.r;n.g=255-n.g;n.b=255-n.b;return Won(n,e,t)};mr=Qmi});var Xon=Ce(()=>{yqe();Fon();Uon();Von();$on();Gon();Hon();qon()});var qh=Ce(()=>{Xon()});function jon(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n1?n-1:0),i=1;i2&&arguments[2]!==void 0?arguments[2]:zQ;if(Kon){Kon(e,null)}if(!eL(t)){return e}let r=t.length;while(r--){let i=t[r];if(typeof i==="string"){const o=n(i);if(o!==i){if(!ogi(t)){t[r]=o}i=o}}e[i]=true}return e}function pgi(e){for(let t=0;t0&&arguments[0]!==void 0?arguments[0]:Pgi();const t=Pn=>fan(Pn);t.version="3.4.13";t.removed=[];if(!e||!e.document||e.document.nodeType!==Z1.document||!e.Element){t.isSupported=false;return t}let n=e.document;const r=n;const i=r.currentScript;e.DocumentFragment;const o=e.HTMLTemplateElement,a=e.Node,s=e.Element,l=e.NodeFilter,u=e.NamedNodeMap;u===void 0?e.NamedNodeMap||e.MozNamedAttrMap:u;e.HTMLFormElement;const d=e.DOMParser,f=e.trustedTypes;const h=s.prototype;const m=_w(h,"cloneNode");const g=_w(h,"remove");const x=_w(h,"nextSibling");const w=_w(h,"childNodes");const _=_w(h,"parentNode");const C=_w(h,"shadowRoot");const A=_w(h,"attributes");const P=a&&a.prototype?_w(a.prototype,"nodeType"):null;const L=a&&a.prototype?_w(a.prototype,"nodeName"):null;const I=a&&a.prototype?_w(a.prototype,"ownerDocument"):null;if(typeof o==="function"){const Pn=n.createElement("template");if(Pn.content&&Pn.content.ownerDocument){n=Pn.content.ownerDocument}}let N;let O="";let z;let U=false;let W=0;const H=function Pn(){if(W>0){throw I5('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')}};const $=function Pn(Ot){H();W++;try{return N.createHTML(Ot)}finally{W--}};const K=function Pn(Ot){H();W++;try{return N.createScriptURL(Ot)}finally{W--}};const X=function Pn(){if(!U){z=Igi(f,i);U=true}return z};const j=n,te=j.implementation,J=j.createNodeIterator,oe=j.createDocumentFragment,se=j.getElementsByTagName;const re=r.importNode;let ce=can();t.isSupported=typeof uan==="function"&&typeof _==="function"&&te&&te.createHTMLDocument!==void 0;const ue=xgi,xe=vgi,be=_gi,Ie=Tgi,he=wgi,ve=Egi,ge=Cgi,Ve=Agi;let Le=aan;let $e=null;const Ee=ic({},[...nan,...vqe,..._qe,...Tqe,...ran]);let tt=null;const yt=ic({},[...ian,...wqe,...oan,...ywe]);let mt=Object.seal(jV(null,{tagNameCheck:{writable:true,configurable:false,enumerable:true,value:null},attributeNameCheck:{writable:true,configurable:false,enumerable:true,value:null},allowCustomizedBuiltInElements:{writable:true,configurable:false,enumerable:true,value:false}}));let ct=null;let Ge=null;const it=Object.seal(jV(null,{tagCheck:{writable:true,configurable:false,enumerable:true,value:null},attributeCheck:{writable:true,configurable:false,enumerable:true,value:null}}));let bt=true;let He=true;let Je=false;let Te=true;let we=false;let Ze=true;let Be=false;let qe=false;let Qe=null;let ze=null;let Me=false;let ye=false;let Ne=false;let Ae=false;let dt=true;let Oe=false;const Wt="user-content-";let kt=true;let qt=false;let _t={};let sn=null;const Jt=ic({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Sn=null;const Kt=ic({},["audio","video","img","source","image","track"]);let mn=null;const At=ic({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]);const lr="http://www.w3.org/1998/Math/MathML";const on="http://www.w3.org/2000/svg";const cr="http://www.w3.org/1999/xhtml";let Hr=cr;let Mr=false;let Er=null;const vr=ic({},[lr,on,cr],xqe);const Yr=vg(["mi","mo","mn","ms","mtext"]);let nt=ic({},Yr);const Rr=vg(["annotation-xml"]);let Xr=ic({},Rr);const dr=ic({},["title","style","font","a","script"]);let rn=null;const St=["application/xhtml+xml","text/html"];const Ut="text/html";let Pt=null;let an=null;const Xt=n.createElement("form");const Cn=function Pn(Ot){return Ot instanceof RegExp||Ot instanceof Function};const rr=function Pn(){let Ot=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(an&&an===Ot){return}if(!Ot||typeof Ot!=="object"){Ot={}}Ot=By(Ot);rn=St.indexOf(Ot.PARSER_MEDIA_TYPE)===-1?Ut:Ot.PARSER_MEDIA_TYPE;Pt=rn==="application/xhtml+xml"?xqe:zQ;$e=QM(Ot,"ALLOWED_TAGS",Ee,{transform:Pt});tt=QM(Ot,"ALLOWED_ATTR",yt,{transform:Pt});Er=QM(Ot,"ALLOWED_NAMESPACES",vr,{transform:xqe});mn=QM(Ot,"ADD_URI_SAFE_ATTR",At,{transform:Pt,base:At});Sn=QM(Ot,"ADD_DATA_URI_TAGS",Kt,{transform:Pt,base:Kt});sn=QM(Ot,"FORBID_CONTENTS",Jt,{transform:Pt});ct=QM(Ot,"FORBID_TAGS",By({}),{transform:Pt});Ge=QM(Ot,"FORBID_ATTR",By({}),{transform:Pt});_t=Lm(Ot,"USE_PROFILES")?Ot.USE_PROFILES&&typeof Ot.USE_PROFILES==="object"?By(Ot.USE_PROFILES):Ot.USE_PROFILES:false;bt=Ot.ALLOW_ARIA_ATTR!==false;He=Ot.ALLOW_DATA_ATTR!==false;Je=Ot.ALLOW_UNKNOWN_PROTOCOLS||false;Te=Ot.ALLOW_SELF_CLOSE_IN_ATTR!==false;we=Ot.SAFE_FOR_TEMPLATES||false;Ze=Ot.SAFE_FOR_XML!==false;Be=Ot.WHOLE_DOCUMENT||false;ye=Ot.RETURN_DOM||false;Ne=Ot.RETURN_DOM_FRAGMENT||false;Ae=Ot.RETURN_TRUSTED_TYPE||false;Me=Ot.FORCE_BODY||false;dt=Ot.SANITIZE_DOM!==false;Oe=Ot.SANITIZE_NAMED_PROPS||false;kt=Ot.KEEP_CONTENT!==false;qt=Ot.IN_PLACE||false;Le=ggi(Ot.ALLOWED_URI_REGEXP)?Ot.ALLOWED_URI_REGEXP:aan;Hr=typeof Ot.NAMESPACE==="string"?Ot.NAMESPACE:cr;nt=Lm(Ot,"MATHML_TEXT_INTEGRATION_POINTS")&&Ot.MATHML_TEXT_INTEGRATION_POINTS&&typeof Ot.MATHML_TEXT_INTEGRATION_POINTS==="object"?By(Ot.MATHML_TEXT_INTEGRATION_POINTS):ic({},Yr);Xr=Lm(Ot,"HTML_INTEGRATION_POINTS")&&Ot.HTML_INTEGRATION_POINTS&&typeof Ot.HTML_INTEGRATION_POINTS==="object"?By(Ot.HTML_INTEGRATION_POINTS):ic({},Rr);const Nn=Lm(Ot,"CUSTOM_ELEMENT_HANDLING")&&Ot.CUSTOM_ELEMENT_HANDLING&&typeof Ot.CUSTOM_ELEMENT_HANDLING==="object"?By(Ot.CUSTOM_ELEMENT_HANDLING):jV(null);mt=jV(null);if(Lm(Nn,"tagNameCheck")&&Cn(Nn.tagNameCheck)){mt.tagNameCheck=Nn.tagNameCheck}if(Lm(Nn,"attributeNameCheck")&&Cn(Nn.attributeNameCheck)){mt.attributeNameCheck=Nn.attributeNameCheck}if(Lm(Nn,"allowCustomizedBuiltInElements")&&typeof Nn.allowCustomizedBuiltInElements==="boolean"){mt.allowCustomizedBuiltInElements=Nn.allowCustomizedBuiltInElements}_g(mt);if(we){He=false}if(Ne){ye=true}if(_t){$e=ic({},ran);tt=jV(null);if(_t.html===true){ic($e,nan);ic(tt,ian)}if(_t.svg===true){ic($e,vqe);ic(tt,wqe);ic(tt,ywe)}if(_t.svgFilters===true){ic($e,_qe);ic(tt,wqe);ic(tt,ywe)}if(_t.mathMl===true){ic($e,Tqe);ic(tt,oan);ic(tt,ywe)}}it.tagCheck=null;it.attributeCheck=null;if(Lm(Ot,"ADD_TAGS")){if(typeof Ot.ADD_TAGS==="function"){it.tagCheck=Ot.ADD_TAGS}else if(eL(Ot.ADD_TAGS)){if($e===Ee){$e=By($e)}ic($e,Ot.ADD_TAGS,Pt)}}if(Lm(Ot,"ADD_ATTR")){if(typeof Ot.ADD_ATTR==="function"){it.attributeCheck=Ot.ADD_ATTR}else if(eL(Ot.ADD_ATTR)){if(tt===yt){tt=By(tt)}ic(tt,Ot.ADD_ATTR,Pt)}}if(Lm(Ot,"ADD_URI_SAFE_ATTR")&&eL(Ot.ADD_URI_SAFE_ATTR)){ic(mn,Ot.ADD_URI_SAFE_ATTR,Pt)}if(Lm(Ot,"FORBID_CONTENTS")&&eL(Ot.FORBID_CONTENTS)){if(sn===Jt){sn=By(sn)}ic(sn,Ot.FORBID_CONTENTS,Pt)}if(Lm(Ot,"ADD_FORBID_CONTENTS")&&eL(Ot.ADD_FORBID_CONTENTS)){if(sn===Jt){sn=By(sn)}ic(sn,Ot.ADD_FORBID_CONTENTS,Pt)}if(kt){$e["#text"]=true}if(Be){ic($e,["html","head","body"])}if($e.table){ic($e,["tbody"]);delete ct.tbody}if(Ot.TRUSTED_TYPES_POLICY){if(typeof Ot.TRUSTED_TYPES_POLICY.createHTML!=="function"){throw I5('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.')}if(typeof Ot.TRUSTED_TYPES_POLICY.createScriptURL!=="function"){throw I5('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.')}const nr=N;N=Ot.TRUSTED_TYPES_POLICY;try{O=$("")}catch(Ur){N=nr;throw Ur}}else if(Ot.TRUSTED_TYPES_POLICY===null){N=void 0;O=""}else{if(N===void 0){N=X()}if(N&&typeof O==="string"){O=$("")}}if(vg){vg(Ot)}an=Ot};const hr=ic({},[...vqe,..._qe,...ygi]);const Et=ic({},[...Tqe,...bgi]);const Tn=function Pn(Ot,Nn,nr){if(Nn.namespaceURI===cr){return Ot==="svg"}if(Nn.namespaceURI===lr){return Ot==="svg"&&(nr==="annotation-xml"||nt[nr])}return Boolean(hr[Ot])};const ft=function Pn(Ot,Nn,nr){if(Nn.namespaceURI===cr){return Ot==="math"}if(Nn.namespaceURI===on){return Ot==="math"&&Xr[nr]}return Boolean(Et[Ot])};const zt=function Pn(Ot,Nn,nr){if(Nn.namespaceURI===on&&!Xr[nr]){return false}if(Nn.namespaceURI===lr&&!nt[nr]){return false}return!Et[Ot]&&(dr[Ot]||!hr[Ot])};const Gt=function Pn(Ot){let Nn=_(Ot);if(!Nn||!Nn.tagName){Nn={namespaceURI:Hr,tagName:"template"}}const nr=zQ(Ot.tagName);const Ur=zQ(Nn.tagName);if(!Er[Ot.namespaceURI]){return false}if(Ot.namespaceURI===on){return Tn(nr,Nn,Ur)}if(Ot.namespaceURI===lr){return ft(nr,Nn,Ur)}if(Ot.namespaceURI===cr){return zt(nr,Nn,Ur)}if(rn==="application/xhtml+xml"&&Er[Ot.namespaceURI]){return true}return false};const gn=function Pn(Ot){XV(t.removed,{element:Ot});try{_(Ot).removeChild(Ot)}catch(Nn){g(Ot);if(!_(Ot)){throw I5("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}}};const Fn=function Pn(Ot){jr(Ot);const Nn=w(Ot);if(Nn){const Ur=[];qV(Nn,bi=>{XV(Ur,bi)});qV(Ur,bi=>{try{g(bi)}catch($i){}})}const nr=A(Ot);if(nr){for(let Ur=nr.length-1;Ur>=0;--Ur){const bi=nr[Ur];const $i=bi&&bi.name;if(typeof $i==="string"){try{Ot.removeAttribute($i)}catch(Zi){}}}}};const Tr=function Pn(Ot,Nn){try{XV(t.removed,{attribute:Nn.getAttributeNode(Ot),from:Nn})}catch(nr){XV(t.removed,{attribute:null,from:Nn})}Nn.removeAttribute(Ot);if(Ot==="is"){if(ye||Ne){try{gn(Nn)}catch(nr){}}else{try{Nn.setAttribute(Ot,"")}catch(nr){}}}};const Jr=function Pn(Ot){const Nn=A(Ot);if(!Nn){return}for(let nr=Nn.length-1;nr>=0;--nr){const Ur=Nn[nr];const bi=Ur&&Ur.name;if(typeof bi!=="string"||tt[Pt(bi)]){continue}try{Ot.removeAttribute(bi)}catch($i){}}};const jr=function Pn(Ot){const Nn=[Ot];while(Nn.length>0){const nr=Nn.pop();const Ur=P?P(nr):nr.nodeType;if(Ur===Z1.element){Jr(nr)}const bi=w(nr);if(bi){for(let $i=bi.length-1;$i>=0;--$i){Nn.push(bi[$i])}}}};const sr=function Pn(Ot){if(!Ze){return}const Nn=[Ot];while(Nn.length>0){const nr=Nn.pop();const Ur=P?P(nr):nr.nodeType;if(Ur===Z1.processingInstruction||Ur===Z1.comment&&Mm(lan,nr.data)){try{g(nr)}catch($i){}continue}if(Ur===Z1.element){const $i=nr;const Zi=Pt(L?L(nr):nr.nodeName);try{if($i.hasAttribute&&$i.hasAttribute("patchsrc")){$i.removeAttribute("patchsrc")}if($i.hasAttribute&&$i.hasAttribute("for")&&Zi!=="label"&&Zi!=="output"){$i.removeAttribute("for")}}catch(Fo){}}const bi=w(nr);if(bi){for(let $i=bi.length-1;$i>=0;--$i){Nn.push(bi[$i])}}}};const bn=function Pn(Ot){let Nn=null;let nr=null;if(Me){Ot=""+Ot}else{const $i=Jon(Ot,/^[\r\n\t ]+/);nr=$i&&$i[0]}if(rn==="application/xhtml+xml"&&Hr===cr){Ot=''+Ot+""}const Ur=N?$(Ot):Ot;if(Hr===cr){try{Nn=new d().parseFromString(Ur,rn)}catch($i){}}if(!Nn||!Nn.documentElement){Nn=te.createDocument(Hr,"template",null);try{Nn.documentElement.innerHTML=Mr?O:Ur}catch($i){}}const bi=Nn.body||Nn.documentElement;if(Ot&&nr){bi.insertBefore(n.createTextNode(nr),bi.childNodes[0]||null)}if(Hr===cr){return se.call(Nn,Be?"html":"body")[0]}return Be?Nn.documentElement:bi};const ir=function Pn(Ot){const Nn=I?I(Ot):Ot.ownerDocument;return J.call(Nn||Ot,Ot,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)};const Jn=function Pn(Ot){Ot=OQ(Ot,ue," ");Ot=OQ(Ot,xe," ");Ot=OQ(Ot,be," ");return Ot};const er=function Pn(Ot){var Nn;Ot.normalize();const nr=I?I(Ot):Ot.ownerDocument;const Ur=J.call(nr||Ot,Ot,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let bi=Ur.nextNode();while(bi){bi.data=Jn(bi.data);bi=Ur.nextNode()}const $i=(Nn=Ot.querySelectorAll)===null||Nn===void 0?void 0:Nn.call(Ot,"template");if($i){qV($i,Zi=>{if(Vt(Zi.content)){er(Zi.content)}})}};const Pr=function Pn(Ot){const Nn=L?L(Ot):null;if(typeof Nn!=="string"){return false}if(Pt(Nn)!=="form"){return false}return typeof Ot.nodeName!=="string"||typeof Ot.textContent!=="string"||typeof Ot.removeChild!=="function"||Ot.attributes!==A(Ot)||typeof Ot.removeAttribute!=="function"||typeof Ot.setAttribute!=="function"||typeof Ot.namespaceURI!=="string"||typeof Ot.insertBefore!=="function"||typeof Ot.hasChildNodes!=="function"||Ot.nodeType!==P(Ot)||Ot.childNodes!==w(Ot)};const Vt=function Pn(Ot){if(!P||typeof Ot!=="object"||Ot===null){return false}try{return P(Ot)===Z1.documentFragment}catch(Nn){return false}};const di=function Pn(Ot){if(!P||typeof Ot!=="object"||Ot===null){return false}try{return typeof P(Ot)==="number"}catch(Nn){return false}};function ln(Pn,Ot,Nn){if(Pn.length===0){return}qV(Pn,nr=>{nr.call(t,Ot,Nn,an)})}const yi=function Pn(Ot,Nn){if(Ze&&Ot.hasChildNodes()&&!di(Ot.firstElementChild)&&Mm(san,Ot.textContent)&&Mm(san,Ot.innerHTML)){return true}if(Ze&&Ot.namespaceURI===cr&&Nn==="style"&&di(Ot.firstElementChild)){return true}if(Ot.nodeType===Z1.processingInstruction){return true}if(Ze&&Ot.nodeType===Z1.comment&&Mm(lan,Ot.data)){return true}return false};const yo=function Pn(Ot,Nn,nr){if(!ct[Nn]&&en(Nn)){if(mt.tagNameCheck instanceof RegExp&&Mm(mt.tagNameCheck,Nn)){return false}if(mt.tagNameCheck instanceof Function&&mt.tagNameCheck(Nn)){return false}}if(kt&&!sn[Nn]){const Ur=_(Ot);const bi=w(Ot);if(bi&&Ur){const $i=bi.length;for(let Zi=$i-1;Zi>=0;--Zi){const Fo=Ot===nr?m(bi[Zi],true):bi[Zi];Ur.insertBefore(Fo,x(Ot))}}}gn(Ot);return true};const Pa=function Pn(Ot,Nn,nr,Ur){if(Ot.length===0){return Nn}return Nn===nr||Nn===Ur?By(Nn):Nn};const Ms=function Pn(Ot,Nn){ln(ce.beforeSanitizeElements,Ot,null);if(Ot!==Nn&&_(Ot)===null){if(qt){jr(Ot)}return true}if(Pr(Ot)){gn(Ot);return true}const nr=Pt(L?L(Ot):Ot.nodeName);$e=Pa(ce.uponSanitizeElement,$e,Ee,Qe);ln(ce.uponSanitizeElement,Ot,{tagName:nr,allowedTags:$e});if(Ot!==Nn&&_(Ot)===null){if(qt){jr(Ot)}return true}if(yi(Ot,nr)){gn(Ot);return true}if(ct[nr]||!(it.tagCheck instanceof Function&&it.tagCheck(nr))&&!$e[nr]){const bi=yo(Ot,nr,Nn);if(bi===false){ln(ce.afterSanitizeElements,Ot,null)}return bi}const Ur=P?P(Ot):Ot.nodeType;if(Ur===Z1.element&&!Gt(Ot)){gn(Ot);return true}if((nr==="noscript"||nr==="noembed"||nr==="noframes")&&Mm(kgi,Ot.innerHTML)){gn(Ot);return true}if(we&&Ot.nodeType===Z1.text){const bi=Jn(Ot.textContent);if(Ot.textContent!==bi){XV(t.removed,{element:Ot.cloneNode()});Ot.textContent=bi}}ln(ce.afterSanitizeElements,Ot,null);return false};const ds=function Pn(Ot,Nn,nr){if(Ge[Nn]){return false}if(Ze&&Nn==="patchsrc"){return false}if(Ze&&Nn==="for"&&Ot!=="label"&&Ot!=="output"){return false}if(dt&&(Nn==="id"||Nn==="name")&&(nr in n||nr in Xt)){return false}const Ur=tt[Nn]||it.attributeCheck instanceof Function&&it.attributeCheck(Nn,Ot);if(He&&Mm(Ie,Nn));else if(bt&&Mm(he,Nn));else if(!Ur){if(en(Ot)&&(mt.tagNameCheck instanceof RegExp&&Mm(mt.tagNameCheck,Ot)||mt.tagNameCheck instanceof Function&&mt.tagNameCheck(Ot))&&(mt.attributeNameCheck instanceof RegExp&&Mm(mt.attributeNameCheck,Nn)||mt.attributeNameCheck instanceof Function&&mt.attributeNameCheck(Nn,Ot))||Nn==="is"&&mt.allowCustomizedBuiltInElements&&(mt.tagNameCheck instanceof RegExp&&Mm(mt.tagNameCheck,nr)||mt.tagNameCheck instanceof Function&&mt.tagNameCheck(nr)));else{return false}}else if(mn[Nn]);else if(Mm(Le,OQ(nr,ge,"")));else if((Nn==="src"||Nn==="xlink:href"||Nn==="href")&&Ot!=="script"&&Qon(nr,"data:")===0&&Sn[Ot]);else if(Je&&!Mm(ve,OQ(nr,ge,"")));else if(nr){return false}else;return true};const st=ic({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]);const en=function Pn(Ot){return!st[zQ(Ot)]&&Mm(Ve,Ot)};const yn=function Pn(Ot,Nn,nr,Ur){if(N&&typeof f==="object"&&typeof f.getAttributeType==="function"&&!nr){switch(f.getAttributeType(Ot,Nn)){case"TrustedHTML":{return $(Ur)}case"TrustedScriptURL":{return K(Ur)}}}return Ur};const jn=function Pn(Ot,Nn,nr,Ur){try{if(nr){Ot.setAttributeNS(nr,Nn,Ur)}else{Ot.setAttribute(Nn,Ur)}if(Pr(Ot)){gn(Ot)}else{Zon(t.removed)}}catch(bi){Tr(Nn,Ot)}};const xr=function Pn(Ot){ln(ce.beforeSanitizeAttributes,Ot,null);const Nn=Ot.attributes;if(!Nn||Pr(Ot)){return}tt=Pa(ce.uponSanitizeAttribute,tt,yt,ze);const nr={attrName:"",attrValue:"",keepAttr:true,allowedAttributes:tt,forceKeepAttr:void 0};let Ur=Nn.length;const bi=Pt(Ot.nodeName);while(Ur--){const $i=Nn[Ur];const Zi=$i.name,Fo=$i.namespaceURI,Ao=$i.value;const Ho=Pt(Zi);const Ia=Ao;let ba=Zi==="value"?Ia:ugi(Ia);nr.attrName=Ho;nr.attrValue=ba;nr.keepAttr=true;nr.forceKeepAttr=void 0;ln(ce.uponSanitizeAttribute,Ot,nr);ba=nr.attrValue;if(Oe&&(Ho==="id"||Ho==="name")&&Qon(ba,Wt)!==0){Tr(Zi,Ot);ba=Wt+ba}if(Ze&&Mm(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,ba)){Tr(Zi,Ot);continue}if(Ho==="attributename"&&Jon(ba,"href")){Tr(Zi,Ot);continue}if(nr.forceKeepAttr){continue}if(!nr.keepAttr){Tr(Zi,Ot);continue}if(!Te&&Mm(Rgi,ba)){Tr(Zi,Ot);continue}if(we){ba=Jn(ba)}if(!ds(bi,Ho,ba)){Tr(Zi,Ot);continue}ba=yn(bi,Ho,Fo,ba);if(ba!==Ia){jn(Ot,Zi,Fo,ba)}}ln(ce.afterSanitizeAttributes,Ot,null)};const wr=function Pn(Ot){let Nn=null;const nr=ir(Ot);ln(ce.beforeSanitizeShadowDOM,Ot,null);while(Nn=nr.nextNode()){ln(ce.uponSanitizeShadowNode,Nn,null);Ms(Nn,Ot);xr(Nn);if(Vt(Nn.content)){wr(Nn.content)}const Ur=P?P(Nn):Nn.nodeType;if(Ur===Z1.element){const bi=C(Nn);if(Vt(bi)){Dr(bi);wr(bi)}}}ln(ce.afterSanitizeShadowDOM,Ot,null)};const Dr=function Pn(Ot){const Nn=[{node:Ot,shadow:null}];while(Nn.length>0){const nr=Nn.pop();if(nr.shadow){wr(nr.shadow);continue}const Ur=nr.node;const bi=P?P(Ur):Ur.nodeType;const $i=bi===Z1.element;const Zi=w(Ur);if(Zi){for(let Fo=Zi.length-1;Fo>=0;--Fo){Nn.push({node:Zi[Fo],shadow:null})}}if($i){const Fo=L?L(Ur):null;if(typeof Fo==="string"&&Pt(Fo)==="template"){const Ao=Ur.content;if(Vt(Ao)){Nn.push({node:Ao,shadow:null})}}}if($i){const Fo=C(Ur);if(Vt(Fo)){Nn.push({node:null,shadow:Fo},{node:Fo,shadow:null})}}}};t.sanitize=function(Pn){let Ot=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};let Nn=null;let nr=null;let Ur=null;let bi=null;Mr=!Pn;if(Mr){Pn=""}if(typeof Pn!=="string"&&!di(Pn)){Pn=mgi(Pn);if(typeof Pn!=="string"){throw I5("dirty is not a string, aborting")}}if(!t.isSupported){return Pn}if(qe){$e=Qe;tt=ze}else{rr(Ot)}if(ce.uponSanitizeElement.length>0||ce.uponSanitizeAttribute.length>0){$e=By($e)}if(ce.uponSanitizeAttribute.length>0){tt=By(tt)}t.removed=[];const $i=qt&&typeof Pn!=="string"&&di(Pn);if($i){sr(Pn);const Ao=L?L(Pn):Pn.nodeName;if(typeof Ao==="string"){const Ho=Pt(Ao);if(!$e[Ho]||ct[Ho]){Fn(Pn);throw I5("root node is forbidden and cannot be sanitized in-place")}}if(Pr(Pn)){Fn(Pn);throw I5("root node is clobbered and cannot be sanitized in-place")}try{Dr(Pn)}catch(Ho){Fn(Pn);throw Ho}}else if(di(Pn)){Nn=bn("");nr=Nn.ownerDocument.importNode(Pn,true);if(nr.nodeType===Z1.element&&nr.nodeName==="BODY"){Nn=nr}else if(nr.nodeName==="HTML"){Nn=nr}else{Nn.appendChild(nr)}Dr(nr)}else{if(!ye&&!we&&!Be&&Pn.indexOf("<")===-1){return N&&Ae?$(Pn):Pn}Nn=bn(Pn);if(!Nn){return ye?null:Ae?O:""}}if(Nn&&Me){gn(Nn.firstChild)}const Zi=$i?Pn:Nn;try{const Ao=ir(Zi);while(Ur=Ao.nextNode()){Ms(Ur,Zi);xr(Ur);if(Vt(Ur.content)){wr(Ur.content)}}}catch(Ao){if($i){Fn(Pn);qV(t.removed,Ho=>{if(Ho.element){jr(Ho.element)}})}throw Ao}if($i){qV(t.removed,Ao=>{if(Ao.element){jr(Ao.element)}});if(we){er(Pn)}return Pn}if(ye){if(we){er(Nn)}if(Ne){bi=oe.call(Nn.ownerDocument);while(Nn.firstChild){bi.appendChild(Nn.firstChild)}}else{bi=Nn}if(tt.shadowroot||tt.shadowrootmode){bi=re.call(r,bi,true)}return bi}let Fo=Be?Nn.outerHTML:Nn.innerHTML;if(Be&&$e["!doctype"]&&Nn.ownerDocument&&Nn.ownerDocument.doctype&&Nn.ownerDocument.doctype.name&&Mm(Sgi,Nn.ownerDocument.doctype.name)){Fo="\n"+Fo}if(we){Fo=Jn(Fo)}return N&&Ae?$(Fo):Fo};t.setConfig=function(){let Pn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};rr(Pn);qe=true;Qe=$e;ze=tt};t.clearConfig=function(){an=null;qe=false;Qe=null;ze=null;N=z;O=""};t.isValidAttribute=function(Pn,Ot,Nn){if(!an){rr({})}const nr=Pt(Pn);const Ur=Pt(Ot);return ds(nr,Ur,Nn)};t.addHook=function(Pn,Ot){if(typeof Ot!=="function"){return}if(!Lm(ce,Pn)){return}XV(ce[Pn],Ot)};t.removeHook=function(Pn,Ot){if(!Lm(ce,Pn)){return void 0}if(Ot!==void 0){const Nn=lgi(ce[Pn],Ot);return Nn===-1?void 0:cgi(ce[Pn],Nn,1)[0]}return Zon(ce[Pn])};t.removeHooks=function(Pn){if(!Lm(ce,Pn)){return}ce[Pn]=[]};t.removeAllHooks=function(){ce=can()};return t}var uan,Kon,ogi,agi,sgi,vg,_g,jV,dan,Eqe,Cqe,qV,lgi,Zon,XV,cgi,eL,zQ,xqe,Jon,OQ,Qon,ugi,dgi,fgi,ean,tan,Lm,BQ,Mm,I5,nan,vqe,_qe,ygi,Tqe,bgi,ran,ian,wqe,oan,ywe,xgi,vgi,_gi,Tgi,wgi,aan,Egi,Cgi,Sgi,Agi,san,lan,kgi,Rgi,Z1,Pgi,Igi,can,QM,ux;var KV=Ce(()=>{uan=Object.entries;Kon=Object.setPrototypeOf;ogi=Object.isFrozen;agi=Object.getPrototypeOf;sgi=Object.getOwnPropertyDescriptor;vg=Object.freeze;_g=Object.seal;jV=Object.create;dan=typeof Reflect!=="undefined"&&Reflect;Eqe=dan.apply;Cqe=dan.construct;if(!vg){vg=function e(t){return t}}if(!_g){_g=function e(t){return t}}if(!Eqe){Eqe=function e(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o1?n-1:0),i=1;i/g);_gi=_g(/\${[\w\W]*/g);Tgi=_g(/^data-[\-\w.\u00B7-\uFFFF]+$/);wgi=_g(/^aria-[\-\w]+$/);aan=_g(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i);Egi=_g(/^(?:\w+script|data):/i);Cgi=_g(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g);Sgi=_g(/^html$/i);Agi=_g(/^[a-z][.\w]*(-[.\w]+)+$/i);san=_g(/<[/\w!]/g);lan=_g(/<[/\w]/g);kgi=_g(/<\/no(script|embed|frames)/i);Rgi=_g(/\/>/i);Z1={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12};Pgi=function e(){return typeof window==="undefined"?null:window};Igi=function e(t,n){if(typeof t!=="object"||typeof t.createPolicy!=="function"){return null}let r=null;const i="data-tt-policy-suffix";if(n&&n.hasAttribute(i)){r=n.getAttribute(i)}const o="dompurify"+(r?"#"+r:"");try{return t.createPolicy(o,{createHTML(a){return a},createScriptURL(a){return a}})}catch(a){console.warn("TrustedTypes policy "+o+" could not be created.");return null}};can=function e(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};QM=function e(t,n,r,i){return Lm(t,n)&&eL(t[n])?ic(i.base?By(i.base):{},t[n],i.transform):r};ux=fan()});var Xsn={};Oo(Xsn,{ParseError:()=>Xi,SETTINGS_SCHEMA:()=>Pwe,__defineFunction:()=>Co,__defineMacro:()=>dn,__defineSymbol:()=>et,__domTree:()=>qsn,__parse:()=>Gsn,__renderToDomTree:()=>Zwe,__renderToHTMLTree:()=>Wsn,__setFontMetrics:()=>Qan,default:()=>v0i,render:()=>vXe,renderToString:()=>$sn,version:()=>Ysn});function Bgi(e){if(typeof e!=="string"){return e.enum[0]}switch(e){case"boolean":return false;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function zgi(e){if(e.default!==void 0){return e.default}var t=Array.isArray(e.type)?e.type[0]:e.type;return Bgi(t)}function Ugi(e,t,n,r){var i=n[t];e[t]=i!==void 0?r.processor?r.processor(i):i:zgi(r)}function qgi(e){for(var t=0;t=i[0]&&e<=i[1]){return n.name}}}return null}function Xan(e){for(var t=0;t=Rwe[t]&&e<=Rwe[t+1]){return true}}return false}function iyi(e){return"toText"in e}function lyi(e){if(e instanceof W0){return e}else{throw new Error("Expected symbolNode but got "+String(e)+".")}}function cyi(e){if(e instanceof oL){return e}else{throw new Error("Expected span but got "+String(e)+".")}}function Qan(e,t){PC[e]=t}function lXe(e,t,n){if(!PC[t]){throw new Error("Font metrics not found for font: "+t+".")}var r=e.charCodeAt(0);var i=PC[t][r];if(!i&&e[0]in pan){r=pan[e[0]].charCodeAt(0);i=PC[t][r]}if(!i&&n==="text"){if(Xan(r)){i=PC[t][77]}}if(i){return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}}function dyi(e){var t;if(e>=5){t=0}else if(e>=3){t=1}else{t=2}if(!Sqe[t]){var n=Sqe[t]={cssEmPerMu:bwe.quad[t]/18};for(var r in bwe){if(bwe.hasOwnProperty(r)){n[r]=bwe[r][t]}}}return Sqe[t]}function et(e,t,n,r,i,o){tf[e][i]={font:t,group:n,replace:r};if(o&&r){tf[e][r]=tf[e][i]}}function Co(e){var{type:t,names:n,props:r,handler:i,htmlBuilder:o,mathmlBuilder:a}=e;var s={type:t,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0?true:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:i};for(var l=0;l0){o.push(Ewe(a,t));a=[]}o.push(r[s])}}if(a.length>0){o.push(Ewe(a,t))}var u;if(n){u=Ewe(Lp(n,t,true),t);u.classes=["tag"];o.push(u)}else if(i){o.push(i)}var d=Ni(["katex-html"],o);d.setAttribute("aria-hidden","true");if(u){var f=u.children[0];f.style.height=to(d.height+d.depth);if(d.depth){f.style.verticalAlign=to(-d.depth)}}return d}function ssn(e){return new rL(e)}function Rqe(e){if(!e){return false}if(e.type==="mi"&&e.children.length===1){var t=e.children[0];return t instanceof Hf&&t.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var n=e.children[0];return n instanceof Hf&&n.text===","}else{return false}}function Ean(e,t,n,r,i){var o=ev(e,n);var a;if(o.length===1&&o[0]instanceof Hi&&Syi.has(o[0].type)){a=o[0]}else{a=new Hi("mrow",o)}var s=new Hi("annotation",[new Hf(t)]);s.setAttribute("encoding","application/x-tex");var l=new Hi("semantics",[a,s]);var u=new Hi("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML");if(r){u.setAttribute("display","block")}var d=i?"katex":"katex-mathml";return Ni([d],[u])}function Oyi(e){return e in Fyi}function Xs(e,t){if(!e||e.type!==t){throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)))}return e}function Hwe(e){var t=Wwe(e);if(!t){throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)))}return t}function Wwe(e){if(e&&(e.type==="atom"||Nyi.hasOwnProperty(e.type))){return e}return null}function fsn(e,t){var n=Lp(e.body,t,true);return Ni([e.mclass],n,t)}function hsn(e,t){var n;var r=ev(e.body,t);if(e.mclass==="minner"){n=new Hi("mpadded",r)}else if(e.mclass==="mord"){if(e.isCharacterBox){n=r[0];n.type="mi"}else{n=new Hi("mi",r)}}else{if(e.isCharacterBox){n=r[0];n.type="mo"}else{n=new Hi("mo",r)}if(e.mclass==="mbin"){n.attributes.lspace="0.22em";n.attributes.rspace="0.22em"}else if(e.mclass==="mpunct"){n.attributes.lspace="0em";n.attributes.rspace="0.17em"}else if(e.mclass==="mopen"||e.mclass==="mclose"){n.attributes.lspace="0em";n.attributes.rspace="0em"}else if(e.mclass==="minner"){n.attributes.lspace="0.0556em";n.attributes.width="+0.1111em"}}return n}function Vyi(e,t,n){var r=zyi[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":{var i=n.callFunction("\\\\cdleft",[t[0]],[]);var o={type:"atom",text:r,mode:"math",family:"rel"};var a=n.callFunction("\\Big",[o],[]);var s=n.callFunction("\\\\cdright",[t[1]],[]);var l={type:"ordgroup",mode:"math",body:[i,a,s]};return n.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function $yi(e){var t=[];e.gullet.beginGroup();e.gullet.macros.set("\\cr","\\\\\\relax");e.gullet.beginGroup();while(true){t.push(e.parseExpression(false,"\\\\"));e.gullet.endGroup();e.gullet.beginGroup();var n=e.fetch().text;if(n==="&"||n==="\\\\"){e.consume()}else if(n==="\\end"){if(t[t.length-1].length===0){t.pop()}break}else{throw new Xi("Expected \\\\ or \\cr or \\end",e.nextToken)}}var r=[];var i=[r];for(var o=0;oAV".includes(u)){for(var f=0;f<2;f++){var h=true;for(var m=l+1;mAV=|." after @',a[l])}var g=Vyi(u,d,e);var x={type:"styling",body:[g],mode:"math",style:"display",resetFont:true};r.push(x);s=Aan()}}if(o%2===0){r.push(s)}else{r.shift()}r=[];i.push(r)}e.gullet.endGroup();e.gullet.endGroup();var w=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:true,rowGaps:[null],cols:w,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}function Pan(e){return"isMiddle"in e}function qwe(e,t){var n=Wwe(e);if(n&&Qyi.has(n.text)){return n}else if(n){throw new Xi("Invalid delimiter '"+n.text+"' after '"+t.funcName+"'",e)}else{throw new Xi("Invalid delimiter type '"+e.type+"'",e)}}function Ian(e){if(!e.body){throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}}function MC(e){var{type:t,names:n,props:r,handler:i,htmlBuilder:o,mathmlBuilder:a}=e;var s={type:t,numArgs:r.numArgs||0,allowedInText:false,numOptionalArgs:0,handler:i};for(var l=0;l1||!d)){x.pop()}if(_.length{Xi=class e extends Error{constructor(t,n){var r="KaTeX parse error: "+t;var i;var o;var a=n&&n.loc;if(a&&a.start<=a.end){var s=a.lexer.input;i=a.start;o=a.end;if(i===s.length){r+=" at end of input: "}else{r+=" at position "+(i+1)+": "}var l=s.slice(i,o).replace(/[^]/g,"$&\u0332");var u;if(i>15){u="\u2026"+s.slice(i-15,i)}else{u=s.slice(0,i)}var d;if(o+15e.replace(Mgi,"-$1").toLowerCase();Dgi={"&":"&",">":">","<":"<",'"':""","'":"'"};Fgi=/[&><"']/g;Uy=e=>String(e).replace(Fgi,t=>Dgi[t]);kwe=e=>{if(e.type==="ordgroup"){if(e.body.length===1){return kwe(e.body[0])}else{return e}}else if(e.type==="color"){if(e.body.length===1){return kwe(e.body[0])}else{return e}}else if(e.type==="font"){return kwe(e.body)}else{return e}};Ngi=new Set(["mathord","textord","atom"]);gR=e=>Ngi.has(kwe(e).type);Ogi=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);if(!t){return"_relative"}if(t[2]!==":"){return null}if(!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])){return null}return t[1].toLowerCase()};Pwe={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:true,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>{t.push(e);return t}},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:false},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:Infinity,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand ",cliProcessor:e=>e==="Infinity"?Infinity:parseInt(e)},globalGroup:{type:"boolean",cli:false}};HQ=class{constructor(t){if(t===void 0){t={}}this.displayMode=void 0;this.output=void 0;this.leqno=void 0;this.fleqn=void 0;this.throwOnError=void 0;this.errorColor=void 0;this.macros=void 0;this.minRuleThickness=void 0;this.colorIsTextColor=void 0;this.strict=void 0;this.trust=void 0;this.maxSize=void 0;this.maxExpand=void 0;this.globalGroup=void 0;t=t||{};for(var n of Object.keys(Pwe)){var r=Pwe[n];if(r){Ugi(this,n,t,r)}}}reportNonstrict(t,n,r){var i=this.strict;if(typeof i==="function"){i=i(t,n,r)}if(!i||i==="ignore"){return}else if(i===true||i==="error"){throw new Xi("LaTeX-incompatible input and strict mode is set to 'error': "+(n+" ["+t+"]"),r)}else if(i==="warn"){typeof console!=="undefined"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]"))}else{typeof console!=="undefined"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+n+" ["+t+"]"))}}useStrictBehavior(t,n,r){var i=this.strict;if(typeof i==="function"){try{i=i(t,n,r)}catch(o){i="error"}}if(!i||i==="ignore"){return false}else if(i===true||i==="error"){return true}else if(i==="warn"){typeof console!=="undefined"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]"));return false}else{typeof console!=="undefined"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+n+" ["+t+"]"));return false}}isTrusted(t){if("url"in t&&t.url&&!t.protocol){var n=Ogi(t.url);if(n==null){return false}t.protocol=n}var r=typeof this.trust==="function"?this.trust(t):this.trust;return Boolean(r)}};kC=class{constructor(t,n,r){this.id=void 0;this.size=void 0;this.cramped=void 0;this.id=t;this.size=n;this.cramped=r}sup(){return RC[Vgi[this.id]]}sub(){return RC[$gi[this.id]]}fracNum(){return RC[Ggi[this.id]]}fracDen(){return RC[Hgi[this.id]]}cramp(){return RC[Wgi[this.id]]}text(){return RC[Ygi[this.id]]}isTight(){return this.size>=2}};aXe=0;Iwe=1;JV=2;mR=3;WQ=4;A_=5;QV=6;H0=7;RC=[new kC(aXe,0,false),new kC(Iwe,0,true),new kC(JV,1,false),new kC(mR,1,true),new kC(WQ,2,false),new kC(A_,2,true),new kC(QV,3,false),new kC(H0,3,true)];Vgi=[WQ,A_,WQ,A_,QV,H0,QV,H0];$gi=[A_,A_,A_,A_,H0,H0,H0,H0];Ggi=[JV,mR,WQ,A_,QV,H0,QV,H0];Hgi=[mR,mR,A_,A_,H0,H0,H0,H0];Wgi=[Iwe,Iwe,mR,mR,A_,A_,H0,H0];Ygi=[aXe,Iwe,JV,mR,JV,mR,JV,mR];Ds={DISPLAY:RC[aXe],TEXT:RC[JV],SCRIPT:RC[WQ],SCRIPTSCRIPT:RC[QV]};Uqe=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];Rwe=[];Uqe.forEach(e=>e.blocks.forEach(t=>Rwe.push(...t)));Mp=e=>e+" "+e;ZV=80;Xgi=function e(t,n){return"M95,"+(622+t+n)+"\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl"+t/2.075+" -"+t+"\nc5.3,-9.3,12,-14,20,-14\nH400000v"+(40+t)+"H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM"+(834+t)+" "+n+"h400000v"+(40+t)+"h-400000z"};jgi=function e(t,n){return"M263,"+(601+t+n)+"c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl"+t/2.084+" -"+t+"\nc4.7,-7.3,11,-11,19,-11\nH40000v"+(40+t)+"H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM"+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"};Kgi=function e(t,n){return"M983 "+(10+t+n)+"\nl"+t/3.13+" -"+t+"\nc4,-6.7,10,-10,18,-10 H400000v"+(40+t)+"\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM"+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"};Zgi=function e(t,n){return"M424,"+(2398+t+n)+"\nc-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514\nc0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20\ns-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121\ns209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081\nl"+t/4.223+" -"+t+"c4,-6.7,10,-10,18,-10 H400000\nv"+(40+t)+"H1014.6\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185\nc-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2z M"+(1001+t)+" "+n+"\nh400000v"+(40+t)+"h-400000z"};Jgi=function e(t,n){return"M473,"+(2713+t+n)+"\nc339.3,-1799.3,509.3,-2700,510,-2702 l"+t/5.298+" -"+t+"\nc3.3,-7.3,9.3,-11,18,-11 H400000v"+(40+t)+"H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM"+(1001+t)+" "+n+"h400000v"+(40+t)+"H1017.7z"};Qgi=function e(t){var n=t/2;return"M400000 "+t+" H0 L"+n+" 0 l65 45 L145 "+(t-80)+" H400000z"};eyi=function e(t,n,r){var i=r-54-n-t;return"M702 "+(t+n)+"H400000"+(40+t)+"\nH742v"+i+"l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 "+n+"H400000v"+(40+t)+"H742z"};tyi=function e(t,n,r){n=1e3*n;var i="";switch(t){case"sqrtMain":i=Xgi(n,ZV);break;case"sqrtSize1":i=jgi(n,ZV);break;case"sqrtSize2":i=Kgi(n,ZV);break;case"sqrtSize3":i=Zgi(n,ZV);break;case"sqrtSize4":i=Jgi(n,ZV);break;case"sqrtTall":i=eyi(n,ZV,r)}return i};nyi=function e(t,n){switch(t){case"\u239C":return Mp("M291 0 H417 V"+n+" H291z");case"\u2223":return Mp("M145 0 H188 V"+n+" H145z");case"\u2225":return Mp("M145 0 H188 V"+n+" H145z")+Mp("M367 0 H410 V"+n+" H367z");case"\u239F":return Mp("M457 0 H583 V"+n+" H457z");case"\u23A2":return Mp("M319 0 H403 V"+n+" H319z");case"\u23A5":return Mp("M263 0 H347 V"+n+" H263z");case"\u23AA":return Mp("M384 0 H504 V"+n+" H384z");case"\u23D0":return Mp("M312 0 H355 V"+n+" H312z");case"\u2016":return Mp("M257 0 H300 V"+n+" H257z")+Mp("M478 0 H521 V"+n+" H478z");default:return""}};han={doubleleftarrow:"M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",doublerightarrow:"M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",leftarrow:"M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z",leftbrace:"M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z",leftbraceunder:"M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",leftgroup:"M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z",leftgroupunder:"M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",leftharpoon:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z",leftharpoonplus:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",leftharpoondown:"M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z",leftharpoondownplus:"M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z",lefthook:"M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z",leftlinesegment:Mp("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:Mp("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:Mp("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:Mp("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:"M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z",longequal:Mp("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:"M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z",midbraceunder:"M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z",oiintSize1:"M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8\n60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z",oiintSize2:"M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 110 84 276 504 276s502.4-166 502.4-276z",oiiintSize1:"M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z",oiiintSize2:"M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z",rightarrow:"M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n 151.7 139 205zm0 0v40h399900v-40z",rightbrace:"M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z",rightbraceunder:"M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z",rightgroup:"M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z",rightgroupunder:"M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z",rightharpoon:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z",rightharpoonplus:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z",rightharpoondown:"M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z",rightharpoondownplus:"M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z",righthook:"M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z",rightlinesegment:Mp("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:Mp("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:Mp("M399995 440 h-120 V150 H0 v-120 H399995z"),rightToFrom:"M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z",twoheadleftarrow:"M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z",twoheadrightarrow:"M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z",tilde1:"M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z",tilde2:"M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z",tilde3:"M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z",tilde4:"M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z",vec:"M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z",widehat1:"M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z",widehat2:"M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat3:"M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat4:"M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widecheck1:"M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z",widecheck2:"M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck3:"M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck4:"M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",baraboveleftarrow:"M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",rightarrowabovebar:"M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",baraboveshortleftharpoon:"M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",rightharpoonaboveshortbar:"M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z",shortbaraboveleftharpoon:"M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z",shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"};ryi=function e(t,n){switch(t){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+" v1759 v84 h347 v-84\nH403z M403 1759 V0 H319 V1759 v"+n+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+" v1759 H0 v84 H347z\nM347 1759 V0 H263 V1759 v"+n+" v1759 h84z";case"vert":return"M145 15 v585 v"+n+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-n+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+n+" v585 h43z";case"doublevert":return"M145 15 v585 v"+n+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-n+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+n+" v585 h43z\nM367 15 v585 v"+n+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-n+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M410 15 H367 v585 v"+n+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+n+" v1715 h263 v84 H319z\nMM319 602 V0 H403 V602 v"+n+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+n+" v1799 H0 v-84 H319z\nMM319 602 V0 H403 V602 v"+n+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+" v602 h84z\nM403 1759 V0 H319 V1759 v"+n+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+" v602 h84z\nM347 1759 V0 h-84 V1759 v"+n+" v602 h84z";case"lparen":return"M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1\nc-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,\n-36,557 l0,"+(n+84)+"c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,\n949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9\nc0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,\n-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189\nl0,-"+(n+92)+"c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,\n-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z";case"rparen":return"M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,\n63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5\nc11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,"+(n+9)+"\nc-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664\nc-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11\nc0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17\nc242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558\nl0,-"+(n+144)+"c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,\n-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z";default:throw new Error("Unknown stretchy delimiter.")}};rL=class{constructor(t){this.children=void 0;this.classes=void 0;this.height=void 0;this.depth=void 0;this.maxFontSize=void 0;this.style=void 0;this.children=t;this.classes=[];this.height=0;this.depth=0;this.maxFontSize=0;this.style={}}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createDocumentFragment();for(var n=0;n{if(iyi(t)){return t.toText()}throw new Error("Expected MathDomNode with toText, got "+t.constructor.name)}).join("")}};Vqe={"pt":1,"mm":7227/2540,"cm":7227/254,"in":72.27,"bp":803/800,"pc":12,"dd":1238/1157,"cc":14856/1157,"nd":685/642,"nc":1370/107,"sp":1/65536,"px":803/800};oyi={"ex":true,"em":true,"mu":true};jan=function e(t){if(typeof t!=="string"){t=t.unit}return t in Vqe||t in oyi||t==="ex"};Sf=function e(t,n){var r;if(t.unit in Vqe){r=Vqe[t.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier}else if(t.unit==="mu"){r=n.fontMetrics().cssEmPerMu}else{var i;if(n.style.isTight()){i=n.havingStyle(n.style.text())}else{i=n}if(t.unit==="ex"){r=i.fontMetrics().xHeight}else if(t.unit==="em"){r=i.fontMetrics().quad}else{throw new Xi("Invalid unit: '"+t.unit+"'")}if(i!==n){r*=i.sizeMultiplier/n.sizeMultiplier}}return Math.min(t.number*r,n.maxSize)};to=function e(t){return+t.toFixed(4)+"em"};iL=function e(t){return t.filter(n=>n).join(" ")};sXe=function e(t){var n="";for(var r of Object.keys(t)){var i=t[r];if(i!==void 0){n+=Lgi(r)+":"+i+";"}}return n};Kan=function e(t,n,r){this.classes=t||[];this.attributes={};this.height=0;this.depth=0;this.maxFontSize=0;this.style=r||{};if(n){if(n.style.isTight()){this.classes.push("mtight")}var i=n.getColor();if(i){this.style.color=i}}};Zan=function e(t){var n=document.createElement(t);n.className=iL(this.classes);Object.assign(n.style,this.style);for(var r of Object.keys(this.attributes)){n.setAttribute(r,this.attributes[r])}for(var i=0;i/=\x00-\x1f]/;Jan=function e(t){var n="<"+t;if(this.classes.length){n+=' class="'+Uy(iL(this.classes))+'"'}var r=sXe(this.style);if(r){n+=' style="'+Uy(r)+'"'}for(var i of Object.keys(this.attributes)){if(ayi.test(i)){throw new Xi("Invalid attribute name '"+i+"'")}n+=" "+i+'="'+Uy(this.attributes[i])+'"'}n+=">";for(var o=0;o";return n};oL=class{constructor(t,n,r,i){this.children=void 0;this.attributes=void 0;this.classes=void 0;this.height=void 0;this.depth=void 0;this.width=void 0;this.maxFontSize=void 0;this.style=void 0;this.italic=void 0;Kan.call(this,t,r,i);this.children=n||[]}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return Zan.call(this,"span")}toMarkup(){return Jan.call(this,"span")}};e$=class{constructor(t,n,r,i){this.children=void 0;this.attributes=void 0;this.classes=void 0;this.height=void 0;this.depth=void 0;this.maxFontSize=void 0;this.style=void 0;Kan.call(this,n,i);this.children=r||[];this.setAttribute("href",t)}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return Zan.call(this,"a")}toMarkup(){return Jan.call(this,"a")}};$qe=class{constructor(t,n,r){this.src=void 0;this.alt=void 0;this.classes=void 0;this.height=void 0;this.depth=void 0;this.maxFontSize=void 0;this.style=void 0;this.alt=n;this.src=t;this.classes=["mord"];this.height=0;this.depth=0;this.maxFontSize=0;this.style=r}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createElement("img");t.src=this.src;t.alt=this.alt;t.className="mord";Object.assign(t.style,this.style);return t}toMarkup(){var t=''+Uy(this.alt)+'0){n=document.createElement("span");n.style.marginRight=to(this.italic)}if(this.classes.length>0){n=n||document.createElement("span");n.className=iL(this.classes)}if(Object.keys(this.style).length>0){n=n||document.createElement("span");Object.assign(n.style,this.style)}if(n){n.appendChild(t);return n}else{return t}}toMarkup(){var t=false;var n="0){r+="margin-right:"+to(this.italic)+";"}r+=sXe(this.style);if(r){t=true;n+=' style="'+Uy(r)+'"'}var i=Uy(this.text);if(t){n+=">";n+=i;n+="";return n}else{return i}}};Tw=class{constructor(t,n){this.children=void 0;this.attributes=void 0;this.children=t||[];this.attributes=n||{}}toNode(){var t="http://www.w3.org/2000/svg";var n=document.createElementNS(t,"svg");for(var r of Object.keys(this.attributes)){n.setAttribute(r,this.attributes[r])}for(var i=0;i";return t}};IC=class{constructor(t,n){this.pathName=void 0;this.alternate=void 0;this.pathName=t;this.alternate=n}toNode(){var t="http://www.w3.org/2000/svg";var n=document.createElementNS(t,"path");if(this.alternate){n.setAttribute("d",this.alternate)}else{n.setAttribute("d",han[this.pathName])}return n}toMarkup(){if(this.alternate){return''}else{return''}}};YQ=class{constructor(t){this.attributes=void 0;this.attributes=t||{}}toNode(){var t="http://www.w3.org/2000/svg";var n=document.createElementNS(t,"line");for(var r of Object.keys(this.attributes)){n.setAttribute(r,this.attributes[r])}return n}toMarkup(){var t="e instanceof oL||e instanceof e$||e instanceof rL;PC={"AMS-Regular":{"32":[0,0,0,0,.25],"65":[0,.68889,0,0,.72222],"66":[0,.68889,0,0,.66667],"67":[0,.68889,0,0,.72222],"68":[0,.68889,0,0,.72222],"69":[0,.68889,0,0,.66667],"70":[0,.68889,0,0,.61111],"71":[0,.68889,0,0,.77778],"72":[0,.68889,0,0,.77778],"73":[0,.68889,0,0,.38889],"74":[.16667,.68889,0,0,.5],"75":[0,.68889,0,0,.77778],"76":[0,.68889,0,0,.66667],"77":[0,.68889,0,0,.94445],"78":[0,.68889,0,0,.72222],"79":[.16667,.68889,0,0,.77778],"80":[0,.68889,0,0,.61111],"81":[.16667,.68889,0,0,.77778],"82":[0,.68889,0,0,.72222],"83":[0,.68889,0,0,.55556],"84":[0,.68889,0,0,.66667],"85":[0,.68889,0,0,.72222],"86":[0,.68889,0,0,.72222],"87":[0,.68889,0,0,1],"88":[0,.68889,0,0,.72222],"89":[0,.68889,0,0,.72222],"90":[0,.68889,0,0,.66667],"107":[0,.68889,0,0,.55556],"160":[0,0,0,0,.25],"165":[0,.675,.025,0,.75],"174":[.15559,.69224,0,0,.94666],"240":[0,.68889,0,0,.55556],"295":[0,.68889,0,0,.54028],"710":[0,.825,0,0,2.33334],"732":[0,.9,0,0,2.33334],"770":[0,.825,0,0,2.33334],"771":[0,.9,0,0,2.33334],"989":[.08167,.58167,0,0,.77778],"1008":[0,.43056,.04028,0,.66667],"8245":[0,.54986,0,0,.275],"8463":[0,.68889,0,0,.54028],"8487":[0,.68889,0,0,.72222],"8498":[0,.68889,0,0,.55556],"8502":[0,.68889,0,0,.66667],"8503":[0,.68889,0,0,.44445],"8504":[0,.68889,0,0,.66667],"8513":[0,.68889,0,0,.63889],"8592":[-.03598,.46402,0,0,.5],"8594":[-.03598,.46402,0,0,.5],"8602":[-.13313,.36687,0,0,1],"8603":[-.13313,.36687,0,0,1],"8606":[.01354,.52239,0,0,1],"8608":[.01354,.52239,0,0,1],"8610":[.01354,.52239,0,0,1.11111],"8611":[.01354,.52239,0,0,1.11111],"8619":[0,.54986,0,0,1],"8620":[0,.54986,0,0,1],"8621":[-.13313,.37788,0,0,1.38889],"8622":[-.13313,.36687,0,0,1],"8624":[0,.69224,0,0,.5],"8625":[0,.69224,0,0,.5],"8630":[0,.43056,0,0,1],"8631":[0,.43056,0,0,1],"8634":[.08198,.58198,0,0,.77778],"8635":[.08198,.58198,0,0,.77778],"8638":[.19444,.69224,0,0,.41667],"8639":[.19444,.69224,0,0,.41667],"8642":[.19444,.69224,0,0,.41667],"8643":[.19444,.69224,0,0,.41667],"8644":[.1808,.675,0,0,1],"8646":[.1808,.675,0,0,1],"8647":[.1808,.675,0,0,1],"8648":[.19444,.69224,0,0,.83334],"8649":[.1808,.675,0,0,1],"8650":[.19444,.69224,0,0,.83334],"8651":[.01354,.52239,0,0,1],"8652":[.01354,.52239,0,0,1],"8653":[-.13313,.36687,0,0,1],"8654":[-.13313,.36687,0,0,1],"8655":[-.13313,.36687,0,0,1],"8666":[.13667,.63667,0,0,1],"8667":[.13667,.63667,0,0,1],"8669":[-.13313,.37788,0,0,1],"8672":[-.064,.437,0,0,1.334],"8674":[-.064,.437,0,0,1.334],"8705":[0,.825,0,0,.5],"8708":[0,.68889,0,0,.55556],"8709":[.08167,.58167,0,0,.77778],"8717":[0,.43056,0,0,.42917],"8722":[-.03598,.46402,0,0,.5],"8724":[.08198,.69224,0,0,.77778],"8726":[.08167,.58167,0,0,.77778],"8733":[0,.69224,0,0,.77778],"8736":[0,.69224,0,0,.72222],"8737":[0,.69224,0,0,.72222],"8738":[.03517,.52239,0,0,.72222],"8739":[.08167,.58167,0,0,.22222],"8740":[.25142,.74111,0,0,.27778],"8741":[.08167,.58167,0,0,.38889],"8742":[.25142,.74111,0,0,.5],"8756":[0,.69224,0,0,.66667],"8757":[0,.69224,0,0,.66667],"8764":[-.13313,.36687,0,0,.77778],"8765":[-.13313,.37788,0,0,.77778],"8769":[-.13313,.36687,0,0,.77778],"8770":[-.03625,.46375,0,0,.77778],"8774":[.30274,.79383,0,0,.77778],"8776":[-.01688,.48312,0,0,.77778],"8778":[.08167,.58167,0,0,.77778],"8782":[.06062,.54986,0,0,.77778],"8783":[.06062,.54986,0,0,.77778],"8785":[.08198,.58198,0,0,.77778],"8786":[.08198,.58198,0,0,.77778],"8787":[.08198,.58198,0,0,.77778],"8790":[0,.69224,0,0,.77778],"8791":[.22958,.72958,0,0,.77778],"8796":[.08198,.91667,0,0,.77778],"8806":[.25583,.75583,0,0,.77778],"8807":[.25583,.75583,0,0,.77778],"8808":[.25142,.75726,0,0,.77778],"8809":[.25142,.75726,0,0,.77778],"8812":[.25583,.75583,0,0,.5],"8814":[.20576,.70576,0,0,.77778],"8815":[.20576,.70576,0,0,.77778],"8816":[.30274,.79383,0,0,.77778],"8817":[.30274,.79383,0,0,.77778],"8818":[.22958,.72958,0,0,.77778],"8819":[.22958,.72958,0,0,.77778],"8822":[.1808,.675,0,0,.77778],"8823":[.1808,.675,0,0,.77778],"8828":[.13667,.63667,0,0,.77778],"8829":[.13667,.63667,0,0,.77778],"8830":[.22958,.72958,0,0,.77778],"8831":[.22958,.72958,0,0,.77778],"8832":[.20576,.70576,0,0,.77778],"8833":[.20576,.70576,0,0,.77778],"8840":[.30274,.79383,0,0,.77778],"8841":[.30274,.79383,0,0,.77778],"8842":[.13597,.63597,0,0,.77778],"8843":[.13597,.63597,0,0,.77778],"8847":[.03517,.54986,0,0,.77778],"8848":[.03517,.54986,0,0,.77778],"8858":[.08198,.58198,0,0,.77778],"8859":[.08198,.58198,0,0,.77778],"8861":[.08198,.58198,0,0,.77778],"8862":[0,.675,0,0,.77778],"8863":[0,.675,0,0,.77778],"8864":[0,.675,0,0,.77778],"8865":[0,.675,0,0,.77778],"8872":[0,.69224,0,0,.61111],"8873":[0,.69224,0,0,.72222],"8874":[0,.69224,0,0,.88889],"8876":[0,.68889,0,0,.61111],"8877":[0,.68889,0,0,.61111],"8878":[0,.68889,0,0,.72222],"8879":[0,.68889,0,0,.72222],"8882":[.03517,.54986,0,0,.77778],"8883":[.03517,.54986,0,0,.77778],"8884":[.13667,.63667,0,0,.77778],"8885":[.13667,.63667,0,0,.77778],"8888":[0,.54986,0,0,1.11111],"8890":[.19444,.43056,0,0,.55556],"8891":[.19444,.69224,0,0,.61111],"8892":[.19444,.69224,0,0,.61111],"8901":[0,.54986,0,0,.27778],"8903":[.08167,.58167,0,0,.77778],"8905":[.08167,.58167,0,0,.77778],"8906":[.08167,.58167,0,0,.77778],"8907":[0,.69224,0,0,.77778],"8908":[0,.69224,0,0,.77778],"8909":[-.03598,.46402,0,0,.77778],"8910":[0,.54986,0,0,.76042],"8911":[0,.54986,0,0,.76042],"8912":[.03517,.54986,0,0,.77778],"8913":[.03517,.54986,0,0,.77778],"8914":[0,.54986,0,0,.66667],"8915":[0,.54986,0,0,.66667],"8916":[0,.69224,0,0,.66667],"8918":[.0391,.5391,0,0,.77778],"8919":[.0391,.5391,0,0,.77778],"8920":[.03517,.54986,0,0,1.33334],"8921":[.03517,.54986,0,0,1.33334],"8922":[.38569,.88569,0,0,.77778],"8923":[.38569,.88569,0,0,.77778],"8926":[.13667,.63667,0,0,.77778],"8927":[.13667,.63667,0,0,.77778],"8928":[.30274,.79383,0,0,.77778],"8929":[.30274,.79383,0,0,.77778],"8934":[.23222,.74111,0,0,.77778],"8935":[.23222,.74111,0,0,.77778],"8936":[.23222,.74111,0,0,.77778],"8937":[.23222,.74111,0,0,.77778],"8938":[.20576,.70576,0,0,.77778],"8939":[.20576,.70576,0,0,.77778],"8940":[.30274,.79383,0,0,.77778],"8941":[.30274,.79383,0,0,.77778],"8994":[.19444,.69224,0,0,.77778],"8995":[.19444,.69224,0,0,.77778],"9416":[.15559,.69224,0,0,.90222],"9484":[0,.69224,0,0,.5],"9488":[0,.69224,0,0,.5],"9492":[0,.37788,0,0,.5],"9496":[0,.37788,0,0,.5],"9585":[.19444,.68889,0,0,.88889],"9586":[.19444,.74111,0,0,.88889],"9632":[0,.675,0,0,.77778],"9633":[0,.675,0,0,.77778],"9650":[0,.54986,0,0,.72222],"9651":[0,.54986,0,0,.72222],"9654":[.03517,.54986,0,0,.77778],"9660":[0,.54986,0,0,.72222],"9661":[0,.54986,0,0,.72222],"9664":[.03517,.54986,0,0,.77778],"9674":[.11111,.69224,0,0,.66667],"9733":[.19444,.69224,0,0,.94445],"10003":[0,.69224,0,0,.83334],"10016":[0,.69224,0,0,.83334],"10731":[.11111,.69224,0,0,.66667],"10846":[.19444,.75583,0,0,.61111],"10877":[.13667,.63667,0,0,.77778],"10878":[.13667,.63667,0,0,.77778],"10885":[.25583,.75583,0,0,.77778],"10886":[.25583,.75583,0,0,.77778],"10887":[.13597,.63597,0,0,.77778],"10888":[.13597,.63597,0,0,.77778],"10889":[.26167,.75726,0,0,.77778],"10890":[.26167,.75726,0,0,.77778],"10891":[.48256,.98256,0,0,.77778],"10892":[.48256,.98256,0,0,.77778],"10901":[.13667,.63667,0,0,.77778],"10902":[.13667,.63667,0,0,.77778],"10933":[.25142,.75726,0,0,.77778],"10934":[.25142,.75726,0,0,.77778],"10935":[.26167,.75726,0,0,.77778],"10936":[.26167,.75726,0,0,.77778],"10937":[.26167,.75726,0,0,.77778],"10938":[.26167,.75726,0,0,.77778],"10949":[.25583,.75583,0,0,.77778],"10950":[.25583,.75583,0,0,.77778],"10955":[.28481,.79383,0,0,.77778],"10956":[.28481,.79383,0,0,.77778],"57350":[.08167,.58167,0,0,.22222],"57351":[.08167,.58167,0,0,.38889],"57352":[.08167,.58167,0,0,.77778],"57353":[0,.43056,.04028,0,.66667],"57356":[.25142,.75726,0,0,.77778],"57357":[.25142,.75726,0,0,.77778],"57358":[.41951,.91951,0,0,.77778],"57359":[.30274,.79383,0,0,.77778],"57360":[.30274,.79383,0,0,.77778],"57361":[.41951,.91951,0,0,.77778],"57366":[.25142,.75726,0,0,.77778],"57367":[.25142,.75726,0,0,.77778],"57368":[.25142,.75726,0,0,.77778],"57369":[.25142,.75726,0,0,.77778],"57370":[.13597,.63597,0,0,.77778],"57371":[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{"32":[0,0,0,0,.25],"65":[0,.68333,0,.19445,.79847],"66":[0,.68333,.03041,.13889,.65681],"67":[0,.68333,.05834,.13889,.52653],"68":[0,.68333,.02778,.08334,.77139],"69":[0,.68333,.08944,.11111,.52778],"70":[0,.68333,.09931,.11111,.71875],"71":[.09722,.68333,.0593,.11111,.59487],"72":[0,.68333,.00965,.11111,.84452],"73":[0,.68333,.07382,0,.54452],"74":[.09722,.68333,.18472,.16667,.67778],"75":[0,.68333,.01445,.05556,.76195],"76":[0,.68333,0,.13889,.68972],"77":[0,.68333,0,.13889,1.2009],"78":[0,.68333,.14736,.08334,.82049],"79":[0,.68333,.02778,.11111,.79611],"80":[0,.68333,.08222,.08334,.69556],"81":[.09722,.68333,0,.11111,.81667],"82":[0,.68333,0,.08334,.8475],"83":[0,.68333,.075,.13889,.60556],"84":[0,.68333,.25417,0,.54464],"85":[0,.68333,.09931,.08334,.62583],"86":[0,.68333,.08222,0,.61278],"87":[0,.68333,.08222,.08334,.98778],"88":[0,.68333,.14643,.13889,.7133],"89":[.09722,.68333,.08222,.08334,.66834],"90":[0,.68333,.07944,.13889,.72473],"160":[0,0,0,0,.25]},"Fraktur-Regular":{"32":[0,0,0,0,.25],"33":[0,.69141,0,0,.29574],"34":[0,.69141,0,0,.21471],"38":[0,.69141,0,0,.73786],"39":[0,.69141,0,0,.21201],"40":[.24982,.74947,0,0,.38865],"41":[.24982,.74947,0,0,.38865],"42":[0,.62119,0,0,.27764],"43":[.08319,.58283,0,0,.75623],"44":[0,.10803,0,0,.27764],"45":[.08319,.58283,0,0,.75623],"46":[0,.10803,0,0,.27764],"47":[.24982,.74947,0,0,.50181],"48":[0,.47534,0,0,.50181],"49":[0,.47534,0,0,.50181],"50":[0,.47534,0,0,.50181],"51":[.18906,.47534,0,0,.50181],"52":[.18906,.47534,0,0,.50181],"53":[.18906,.47534,0,0,.50181],"54":[0,.69141,0,0,.50181],"55":[.18906,.47534,0,0,.50181],"56":[0,.69141,0,0,.50181],"57":[.18906,.47534,0,0,.50181],"58":[0,.47534,0,0,.21606],"59":[.12604,.47534,0,0,.21606],"61":[-.13099,.36866,0,0,.75623],"63":[0,.69141,0,0,.36245],"65":[0,.69141,0,0,.7176],"66":[0,.69141,0,0,.88397],"67":[0,.69141,0,0,.61254],"68":[0,.69141,0,0,.83158],"69":[0,.69141,0,0,.66278],"70":[.12604,.69141,0,0,.61119],"71":[0,.69141,0,0,.78539],"72":[.06302,.69141,0,0,.7203],"73":[0,.69141,0,0,.55448],"74":[.12604,.69141,0,0,.55231],"75":[0,.69141,0,0,.66845],"76":[0,.69141,0,0,.66602],"77":[0,.69141,0,0,1.04953],"78":[0,.69141,0,0,.83212],"79":[0,.69141,0,0,.82699],"80":[.18906,.69141,0,0,.82753],"81":[.03781,.69141,0,0,.82699],"82":[0,.69141,0,0,.82807],"83":[0,.69141,0,0,.82861],"84":[0,.69141,0,0,.66899],"85":[0,.69141,0,0,.64576],"86":[0,.69141,0,0,.83131],"87":[0,.69141,0,0,1.04602],"88":[0,.69141,0,0,.71922],"89":[.18906,.69141,0,0,.83293],"90":[.12604,.69141,0,0,.60201],"91":[.24982,.74947,0,0,.27764],"93":[.24982,.74947,0,0,.27764],"94":[0,.69141,0,0,.49965],"97":[0,.47534,0,0,.50046],"98":[0,.69141,0,0,.51315],"99":[0,.47534,0,0,.38946],"100":[0,.62119,0,0,.49857],"101":[0,.47534,0,0,.40053],"102":[.18906,.69141,0,0,.32626],"103":[.18906,.47534,0,0,.5037],"104":[.18906,.69141,0,0,.52126],"105":[0,.69141,0,0,.27899],"106":[0,.69141,0,0,.28088],"107":[0,.69141,0,0,.38946],"108":[0,.69141,0,0,.27953],"109":[0,.47534,0,0,.76676],"110":[0,.47534,0,0,.52666],"111":[0,.47534,0,0,.48885],"112":[.18906,.52396,0,0,.50046],"113":[.18906,.47534,0,0,.48912],"114":[0,.47534,0,0,.38919],"115":[0,.47534,0,0,.44266],"116":[0,.62119,0,0,.33301],"117":[0,.47534,0,0,.5172],"118":[0,.52396,0,0,.5118],"119":[0,.52396,0,0,.77351],"120":[.18906,.47534,0,0,.38865],"121":[.18906,.47534,0,0,.49884],"122":[.18906,.47534,0,0,.39054],"160":[0,0,0,0,.25],"8216":[0,.69141,0,0,.21471],"8217":[0,.69141,0,0,.21471],"58112":[0,.62119,0,0,.49749],"58113":[0,.62119,0,0,.4983],"58114":[.18906,.69141,0,0,.33328],"58115":[.18906,.69141,0,0,.32923],"58116":[.18906,.47534,0,0,.50343],"58117":[0,.69141,0,0,.33301],"58118":[0,.62119,0,0,.33409],"58119":[0,.47534,0,0,.50073]},"Main-Bold":{"32":[0,0,0,0,.25],"33":[0,.69444,0,0,.35],"34":[0,.69444,0,0,.60278],"35":[.19444,.69444,0,0,.95833],"36":[.05556,.75,0,0,.575],"37":[.05556,.75,0,0,.95833],"38":[0,.69444,0,0,.89444],"39":[0,.69444,0,0,.31944],"40":[.25,.75,0,0,.44722],"41":[.25,.75,0,0,.44722],"42":[0,.75,0,0,.575],"43":[.13333,.63333,0,0,.89444],"44":[.19444,.15556,0,0,.31944],"45":[0,.44444,0,0,.38333],"46":[0,.15556,0,0,.31944],"47":[.25,.75,0,0,.575],"48":[0,.64444,0,0,.575],"49":[0,.64444,0,0,.575],"50":[0,.64444,0,0,.575],"51":[0,.64444,0,0,.575],"52":[0,.64444,0,0,.575],"53":[0,.64444,0,0,.575],"54":[0,.64444,0,0,.575],"55":[0,.64444,0,0,.575],"56":[0,.64444,0,0,.575],"57":[0,.64444,0,0,.575],"58":[0,.44444,0,0,.31944],"59":[.19444,.44444,0,0,.31944],"60":[.08556,.58556,0,0,.89444],"61":[-.10889,.39111,0,0,.89444],"62":[.08556,.58556,0,0,.89444],"63":[0,.69444,0,0,.54305],"64":[0,.69444,0,0,.89444],"65":[0,.68611,0,0,.86944],"66":[0,.68611,0,0,.81805],"67":[0,.68611,0,0,.83055],"68":[0,.68611,0,0,.88194],"69":[0,.68611,0,0,.75555],"70":[0,.68611,0,0,.72361],"71":[0,.68611,0,0,.90416],"72":[0,.68611,0,0,.9],"73":[0,.68611,0,0,.43611],"74":[0,.68611,0,0,.59444],"75":[0,.68611,0,0,.90138],"76":[0,.68611,0,0,.69166],"77":[0,.68611,0,0,1.09166],"78":[0,.68611,0,0,.9],"79":[0,.68611,0,0,.86388],"80":[0,.68611,0,0,.78611],"81":[.19444,.68611,0,0,.86388],"82":[0,.68611,0,0,.8625],"83":[0,.68611,0,0,.63889],"84":[0,.68611,0,0,.8],"85":[0,.68611,0,0,.88472],"86":[0,.68611,.01597,0,.86944],"87":[0,.68611,.01597,0,1.18888],"88":[0,.68611,0,0,.86944],"89":[0,.68611,.02875,0,.86944],"90":[0,.68611,0,0,.70277],"91":[.25,.75,0,0,.31944],"92":[.25,.75,0,0,.575],"93":[.25,.75,0,0,.31944],"94":[0,.69444,0,0,.575],"95":[.31,.13444,.03194,0,.575],"97":[0,.44444,0,0,.55902],"98":[0,.69444,0,0,.63889],"99":[0,.44444,0,0,.51111],"100":[0,.69444,0,0,.63889],"101":[0,.44444,0,0,.52708],"102":[0,.69444,.10903,0,.35139],"103":[.19444,.44444,.01597,0,.575],"104":[0,.69444,0,0,.63889],"105":[0,.69444,0,0,.31944],"106":[.19444,.69444,0,0,.35139],"107":[0,.69444,0,0,.60694],"108":[0,.69444,0,0,.31944],"109":[0,.44444,0,0,.95833],"110":[0,.44444,0,0,.63889],"111":[0,.44444,0,0,.575],"112":[.19444,.44444,0,0,.63889],"113":[.19444,.44444,0,0,.60694],"114":[0,.44444,0,0,.47361],"115":[0,.44444,0,0,.45361],"116":[0,.63492,0,0,.44722],"117":[0,.44444,0,0,.63889],"118":[0,.44444,.01597,0,.60694],"119":[0,.44444,.01597,0,.83055],"120":[0,.44444,0,0,.60694],"121":[.19444,.44444,.01597,0,.60694],"122":[0,.44444,0,0,.51111],"123":[.25,.75,0,0,.575],"124":[.25,.75,0,0,.31944],"125":[.25,.75,0,0,.575],"126":[.35,.34444,0,0,.575],"160":[0,0,0,0,.25],"163":[0,.69444,0,0,.86853],"168":[0,.69444,0,0,.575],"172":[0,.44444,0,0,.76666],"176":[0,.69444,0,0,.86944],"177":[.13333,.63333,0,0,.89444],"184":[.17014,0,0,0,.51111],"198":[0,.68611,0,0,1.04166],"215":[.13333,.63333,0,0,.89444],"216":[.04861,.73472,0,0,.89444],"223":[0,.69444,0,0,.59722],"230":[0,.44444,0,0,.83055],"247":[.13333,.63333,0,0,.89444],"248":[.09722,.54167,0,0,.575],"305":[0,.44444,0,0,.31944],"338":[0,.68611,0,0,1.16944],"339":[0,.44444,0,0,.89444],"567":[.19444,.44444,0,0,.35139],"710":[0,.69444,0,0,.575],"711":[0,.63194,0,0,.575],"713":[0,.59611,0,0,.575],"714":[0,.69444,0,0,.575],"715":[0,.69444,0,0,.575],"728":[0,.69444,0,0,.575],"729":[0,.69444,0,0,.31944],"730":[0,.69444,0,0,.86944],"732":[0,.69444,0,0,.575],"733":[0,.69444,0,0,.575],"915":[0,.68611,0,0,.69166],"916":[0,.68611,0,0,.95833],"920":[0,.68611,0,0,.89444],"923":[0,.68611,0,0,.80555],"926":[0,.68611,0,0,.76666],"928":[0,.68611,0,0,.9],"931":[0,.68611,0,0,.83055],"933":[0,.68611,0,0,.89444],"934":[0,.68611,0,0,.83055],"936":[0,.68611,0,0,.89444],"937":[0,.68611,0,0,.83055],"8211":[0,.44444,.03194,0,.575],"8212":[0,.44444,.03194,0,1.14999],"8216":[0,.69444,0,0,.31944],"8217":[0,.69444,0,0,.31944],"8220":[0,.69444,0,0,.60278],"8221":[0,.69444,0,0,.60278],"8224":[.19444,.69444,0,0,.51111],"8225":[.19444,.69444,0,0,.51111],"8242":[0,.55556,0,0,.34444],"8407":[0,.72444,.15486,0,.575],"8463":[0,.69444,0,0,.66759],"8465":[0,.69444,0,0,.83055],"8467":[0,.69444,0,0,.47361],"8472":[.19444,.44444,0,0,.74027],"8476":[0,.69444,0,0,.83055],"8501":[0,.69444,0,0,.70277],"8592":[-.10889,.39111,0,0,1.14999],"8593":[.19444,.69444,0,0,.575],"8594":[-.10889,.39111,0,0,1.14999],"8595":[.19444,.69444,0,0,.575],"8596":[-.10889,.39111,0,0,1.14999],"8597":[.25,.75,0,0,.575],"8598":[.19444,.69444,0,0,1.14999],"8599":[.19444,.69444,0,0,1.14999],"8600":[.19444,.69444,0,0,1.14999],"8601":[.19444,.69444,0,0,1.14999],"8636":[-.10889,.39111,0,0,1.14999],"8637":[-.10889,.39111,0,0,1.14999],"8640":[-.10889,.39111,0,0,1.14999],"8641":[-.10889,.39111,0,0,1.14999],"8656":[-.10889,.39111,0,0,1.14999],"8657":[.19444,.69444,0,0,.70277],"8658":[-.10889,.39111,0,0,1.14999],"8659":[.19444,.69444,0,0,.70277],"8660":[-.10889,.39111,0,0,1.14999],"8661":[.25,.75,0,0,.70277],"8704":[0,.69444,0,0,.63889],"8706":[0,.69444,.06389,0,.62847],"8707":[0,.69444,0,0,.63889],"8709":[.05556,.75,0,0,.575],"8711":[0,.68611,0,0,.95833],"8712":[.08556,.58556,0,0,.76666],"8715":[.08556,.58556,0,0,.76666],"8722":[.13333,.63333,0,0,.89444],"8723":[.13333,.63333,0,0,.89444],"8725":[.25,.75,0,0,.575],"8726":[.25,.75,0,0,.575],"8727":[-.02778,.47222,0,0,.575],"8728":[-.02639,.47361,0,0,.575],"8729":[-.02639,.47361,0,0,.575],"8730":[.18,.82,0,0,.95833],"8733":[0,.44444,0,0,.89444],"8734":[0,.44444,0,0,1.14999],"8736":[0,.69224,0,0,.72222],"8739":[.25,.75,0,0,.31944],"8741":[.25,.75,0,0,.575],"8743":[0,.55556,0,0,.76666],"8744":[0,.55556,0,0,.76666],"8745":[0,.55556,0,0,.76666],"8746":[0,.55556,0,0,.76666],"8747":[.19444,.69444,.12778,0,.56875],"8764":[-.10889,.39111,0,0,.89444],"8768":[.19444,.69444,0,0,.31944],"8771":[.00222,.50222,0,0,.89444],"8773":[.027,.638,0,0,.894],"8776":[.02444,.52444,0,0,.89444],"8781":[.00222,.50222,0,0,.89444],"8801":[.00222,.50222,0,0,.89444],"8804":[.19667,.69667,0,0,.89444],"8805":[.19667,.69667,0,0,.89444],"8810":[.08556,.58556,0,0,1.14999],"8811":[.08556,.58556,0,0,1.14999],"8826":[.08556,.58556,0,0,.89444],"8827":[.08556,.58556,0,0,.89444],"8834":[.08556,.58556,0,0,.89444],"8835":[.08556,.58556,0,0,.89444],"8838":[.19667,.69667,0,0,.89444],"8839":[.19667,.69667,0,0,.89444],"8846":[0,.55556,0,0,.76666],"8849":[.19667,.69667,0,0,.89444],"8850":[.19667,.69667,0,0,.89444],"8851":[0,.55556,0,0,.76666],"8852":[0,.55556,0,0,.76666],"8853":[.13333,.63333,0,0,.89444],"8854":[.13333,.63333,0,0,.89444],"8855":[.13333,.63333,0,0,.89444],"8856":[.13333,.63333,0,0,.89444],"8857":[.13333,.63333,0,0,.89444],"8866":[0,.69444,0,0,.70277],"8867":[0,.69444,0,0,.70277],"8868":[0,.69444,0,0,.89444],"8869":[0,.69444,0,0,.89444],"8900":[-.02639,.47361,0,0,.575],"8901":[-.02639,.47361,0,0,.31944],"8902":[-.02778,.47222,0,0,.575],"8968":[.25,.75,0,0,.51111],"8969":[.25,.75,0,0,.51111],"8970":[.25,.75,0,0,.51111],"8971":[.25,.75,0,0,.51111],"8994":[-.13889,.36111,0,0,1.14999],"8995":[-.13889,.36111,0,0,1.14999],"9651":[.19444,.69444,0,0,1.02222],"9657":[-.02778,.47222,0,0,.575],"9661":[.19444,.69444,0,0,1.02222],"9667":[-.02778,.47222,0,0,.575],"9711":[.19444,.69444,0,0,1.14999],"9824":[.12963,.69444,0,0,.89444],"9825":[.12963,.69444,0,0,.89444],"9826":[.12963,.69444,0,0,.89444],"9827":[.12963,.69444,0,0,.89444],"9837":[0,.75,0,0,.44722],"9838":[.19444,.69444,0,0,.44722],"9839":[.19444,.69444,0,0,.44722],"10216":[.25,.75,0,0,.44722],"10217":[.25,.75,0,0,.44722],"10815":[0,.68611,0,0,.9],"10927":[.19667,.69667,0,0,.89444],"10928":[.19667,.69667,0,0,.89444],"57376":[.19444,.69444,0,0,0]},"Main-BoldItalic":{"32":[0,0,0,0,.25],"33":[0,.69444,.11417,0,.38611],"34":[0,.69444,.07939,0,.62055],"35":[.19444,.69444,.06833,0,.94444],"37":[.05556,.75,.12861,0,.94444],"38":[0,.69444,.08528,0,.88555],"39":[0,.69444,.12945,0,.35555],"40":[.25,.75,.15806,0,.47333],"41":[.25,.75,.03306,0,.47333],"42":[0,.75,.14333,0,.59111],"43":[.10333,.60333,.03306,0,.88555],"44":[.19444,.14722,0,0,.35555],"45":[0,.44444,.02611,0,.41444],"46":[0,.14722,0,0,.35555],"47":[.25,.75,.15806,0,.59111],"48":[0,.64444,.13167,0,.59111],"49":[0,.64444,.13167,0,.59111],"50":[0,.64444,.13167,0,.59111],"51":[0,.64444,.13167,0,.59111],"52":[.19444,.64444,.13167,0,.59111],"53":[0,.64444,.13167,0,.59111],"54":[0,.64444,.13167,0,.59111],"55":[.19444,.64444,.13167,0,.59111],"56":[0,.64444,.13167,0,.59111],"57":[0,.64444,.13167,0,.59111],"58":[0,.44444,.06695,0,.35555],"59":[.19444,.44444,.06695,0,.35555],"61":[-.10889,.39111,.06833,0,.88555],"63":[0,.69444,.11472,0,.59111],"64":[0,.69444,.09208,0,.88555],"65":[0,.68611,0,0,.86555],"66":[0,.68611,.0992,0,.81666],"67":[0,.68611,.14208,0,.82666],"68":[0,.68611,.09062,0,.87555],"69":[0,.68611,.11431,0,.75666],"70":[0,.68611,.12903,0,.72722],"71":[0,.68611,.07347,0,.89527],"72":[0,.68611,.17208,0,.8961],"73":[0,.68611,.15681,0,.47166],"74":[0,.68611,.145,0,.61055],"75":[0,.68611,.14208,0,.89499],"76":[0,.68611,0,0,.69777],"77":[0,.68611,.17208,0,1.07277],"78":[0,.68611,.17208,0,.8961],"79":[0,.68611,.09062,0,.85499],"80":[0,.68611,.0992,0,.78721],"81":[.19444,.68611,.09062,0,.85499],"82":[0,.68611,.02559,0,.85944],"83":[0,.68611,.11264,0,.64999],"84":[0,.68611,.12903,0,.7961],"85":[0,.68611,.17208,0,.88083],"86":[0,.68611,.18625,0,.86555],"87":[0,.68611,.18625,0,1.15999],"88":[0,.68611,.15681,0,.86555],"89":[0,.68611,.19803,0,.86555],"90":[0,.68611,.14208,0,.70888],"91":[.25,.75,.1875,0,.35611],"93":[.25,.75,.09972,0,.35611],"94":[0,.69444,.06709,0,.59111],"95":[.31,.13444,.09811,0,.59111],"97":[0,.44444,.09426,0,.59111],"98":[0,.69444,.07861,0,.53222],"99":[0,.44444,.05222,0,.53222],"100":[0,.69444,.10861,0,.59111],"101":[0,.44444,.085,0,.53222],"102":[.19444,.69444,.21778,0,.4],"103":[.19444,.44444,.105,0,.53222],"104":[0,.69444,.09426,0,.59111],"105":[0,.69326,.11387,0,.35555],"106":[.19444,.69326,.1672,0,.35555],"107":[0,.69444,.11111,0,.53222],"108":[0,.69444,.10861,0,.29666],"109":[0,.44444,.09426,0,.94444],"110":[0,.44444,.09426,0,.64999],"111":[0,.44444,.07861,0,.59111],"112":[.19444,.44444,.07861,0,.59111],"113":[.19444,.44444,.105,0,.53222],"114":[0,.44444,.11111,0,.50167],"115":[0,.44444,.08167,0,.48694],"116":[0,.63492,.09639,0,.385],"117":[0,.44444,.09426,0,.62055],"118":[0,.44444,.11111,0,.53222],"119":[0,.44444,.11111,0,.76777],"120":[0,.44444,.12583,0,.56055],"121":[.19444,.44444,.105,0,.56166],"122":[0,.44444,.13889,0,.49055],"126":[.35,.34444,.11472,0,.59111],"160":[0,0,0,0,.25],"168":[0,.69444,.11473,0,.59111],"176":[0,.69444,0,0,.94888],"184":[.17014,0,0,0,.53222],"198":[0,.68611,.11431,0,1.02277],"216":[.04861,.73472,.09062,0,.88555],"223":[.19444,.69444,.09736,0,.665],"230":[0,.44444,.085,0,.82666],"248":[.09722,.54167,.09458,0,.59111],"305":[0,.44444,.09426,0,.35555],"338":[0,.68611,.11431,0,1.14054],"339":[0,.44444,.085,0,.82666],"567":[.19444,.44444,.04611,0,.385],"710":[0,.69444,.06709,0,.59111],"711":[0,.63194,.08271,0,.59111],"713":[0,.59444,.10444,0,.59111],"714":[0,.69444,.08528,0,.59111],"715":[0,.69444,0,0,.59111],"728":[0,.69444,.10333,0,.59111],"729":[0,.69444,.12945,0,.35555],"730":[0,.69444,0,0,.94888],"732":[0,.69444,.11472,0,.59111],"733":[0,.69444,.11472,0,.59111],"915":[0,.68611,.12903,0,.69777],"916":[0,.68611,0,0,.94444],"920":[0,.68611,.09062,0,.88555],"923":[0,.68611,0,0,.80666],"926":[0,.68611,.15092,0,.76777],"928":[0,.68611,.17208,0,.8961],"931":[0,.68611,.11431,0,.82666],"933":[0,.68611,.10778,0,.88555],"934":[0,.68611,.05632,0,.82666],"936":[0,.68611,.10778,0,.88555],"937":[0,.68611,.0992,0,.82666],"8211":[0,.44444,.09811,0,.59111],"8212":[0,.44444,.09811,0,1.18221],"8216":[0,.69444,.12945,0,.35555],"8217":[0,.69444,.12945,0,.35555],"8220":[0,.69444,.16772,0,.62055],"8221":[0,.69444,.07939,0,.62055]},"Main-Italic":{"32":[0,0,0,0,.25],"33":[0,.69444,.12417,0,.30667],"34":[0,.69444,.06961,0,.51444],"35":[.19444,.69444,.06616,0,.81777],"37":[.05556,.75,.13639,0,.81777],"38":[0,.69444,.09694,0,.76666],"39":[0,.69444,.12417,0,.30667],"40":[.25,.75,.16194,0,.40889],"41":[.25,.75,.03694,0,.40889],"42":[0,.75,.14917,0,.51111],"43":[.05667,.56167,.03694,0,.76666],"44":[.19444,.10556,0,0,.30667],"45":[0,.43056,.02826,0,.35778],"46":[0,.10556,0,0,.30667],"47":[.25,.75,.16194,0,.51111],"48":[0,.64444,.13556,0,.51111],"49":[0,.64444,.13556,0,.51111],"50":[0,.64444,.13556,0,.51111],"51":[0,.64444,.13556,0,.51111],"52":[.19444,.64444,.13556,0,.51111],"53":[0,.64444,.13556,0,.51111],"54":[0,.64444,.13556,0,.51111],"55":[.19444,.64444,.13556,0,.51111],"56":[0,.64444,.13556,0,.51111],"57":[0,.64444,.13556,0,.51111],"58":[0,.43056,.0582,0,.30667],"59":[.19444,.43056,.0582,0,.30667],"61":[-.13313,.36687,.06616,0,.76666],"63":[0,.69444,.1225,0,.51111],"64":[0,.69444,.09597,0,.76666],"65":[0,.68333,0,0,.74333],"66":[0,.68333,.10257,0,.70389],"67":[0,.68333,.14528,0,.71555],"68":[0,.68333,.09403,0,.755],"69":[0,.68333,.12028,0,.67833],"70":[0,.68333,.13305,0,.65277],"71":[0,.68333,.08722,0,.77361],"72":[0,.68333,.16389,0,.74333],"73":[0,.68333,.15806,0,.38555],"74":[0,.68333,.14028,0,.525],"75":[0,.68333,.14528,0,.76888],"76":[0,.68333,0,0,.62722],"77":[0,.68333,.16389,0,.89666],"78":[0,.68333,.16389,0,.74333],"79":[0,.68333,.09403,0,.76666],"80":[0,.68333,.10257,0,.67833],"81":[.19444,.68333,.09403,0,.76666],"82":[0,.68333,.03868,0,.72944],"83":[0,.68333,.11972,0,.56222],"84":[0,.68333,.13305,0,.71555],"85":[0,.68333,.16389,0,.74333],"86":[0,.68333,.18361,0,.74333],"87":[0,.68333,.18361,0,.99888],"88":[0,.68333,.15806,0,.74333],"89":[0,.68333,.19383,0,.74333],"90":[0,.68333,.14528,0,.61333],"91":[.25,.75,.1875,0,.30667],"93":[.25,.75,.10528,0,.30667],"94":[0,.69444,.06646,0,.51111],"95":[.31,.12056,.09208,0,.51111],"97":[0,.43056,.07671,0,.51111],"98":[0,.69444,.06312,0,.46],"99":[0,.43056,.05653,0,.46],"100":[0,.69444,.10333,0,.51111],"101":[0,.43056,.07514,0,.46],"102":[.19444,.69444,.21194,0,.30667],"103":[.19444,.43056,.08847,0,.46],"104":[0,.69444,.07671,0,.51111],"105":[0,.65536,.1019,0,.30667],"106":[.19444,.65536,.14467,0,.30667],"107":[0,.69444,.10764,0,.46],"108":[0,.69444,.10333,0,.25555],"109":[0,.43056,.07671,0,.81777],"110":[0,.43056,.07671,0,.56222],"111":[0,.43056,.06312,0,.51111],"112":[.19444,.43056,.06312,0,.51111],"113":[.19444,.43056,.08847,0,.46],"114":[0,.43056,.10764,0,.42166],"115":[0,.43056,.08208,0,.40889],"116":[0,.61508,.09486,0,.33222],"117":[0,.43056,.07671,0,.53666],"118":[0,.43056,.10764,0,.46],"119":[0,.43056,.10764,0,.66444],"120":[0,.43056,.12042,0,.46389],"121":[.19444,.43056,.08847,0,.48555],"122":[0,.43056,.12292,0,.40889],"126":[.35,.31786,.11585,0,.51111],"160":[0,0,0,0,.25],"168":[0,.66786,.10474,0,.51111],"176":[0,.69444,0,0,.83129],"184":[.17014,0,0,0,.46],"198":[0,.68333,.12028,0,.88277],"216":[.04861,.73194,.09403,0,.76666],"223":[.19444,.69444,.10514,0,.53666],"230":[0,.43056,.07514,0,.71555],"248":[.09722,.52778,.09194,0,.51111],"338":[0,.68333,.12028,0,.98499],"339":[0,.43056,.07514,0,.71555],"710":[0,.69444,.06646,0,.51111],"711":[0,.62847,.08295,0,.51111],"713":[0,.56167,.10333,0,.51111],"714":[0,.69444,.09694,0,.51111],"715":[0,.69444,0,0,.51111],"728":[0,.69444,.10806,0,.51111],"729":[0,.66786,.11752,0,.30667],"730":[0,.69444,0,0,.83129],"732":[0,.66786,.11585,0,.51111],"733":[0,.69444,.1225,0,.51111],"915":[0,.68333,.13305,0,.62722],"916":[0,.68333,0,0,.81777],"920":[0,.68333,.09403,0,.76666],"923":[0,.68333,0,0,.69222],"926":[0,.68333,.15294,0,.66444],"928":[0,.68333,.16389,0,.74333],"931":[0,.68333,.12028,0,.71555],"933":[0,.68333,.11111,0,.76666],"934":[0,.68333,.05986,0,.71555],"936":[0,.68333,.11111,0,.76666],"937":[0,.68333,.10257,0,.71555],"8211":[0,.43056,.09208,0,.51111],"8212":[0,.43056,.09208,0,1.02222],"8216":[0,.69444,.12417,0,.30667],"8217":[0,.69444,.12417,0,.30667],"8220":[0,.69444,.1685,0,.51444],"8221":[0,.69444,.06961,0,.51444],"8463":[0,.68889,0,0,.54028]},"Main-Regular":{"32":[0,0,0,0,.25],"33":[0,.69444,0,0,.27778],"34":[0,.69444,0,0,.5],"35":[.19444,.69444,0,0,.83334],"36":[.05556,.75,0,0,.5],"37":[.05556,.75,0,0,.83334],"38":[0,.69444,0,0,.77778],"39":[0,.69444,0,0,.27778],"40":[.25,.75,0,0,.38889],"41":[.25,.75,0,0,.38889],"42":[0,.75,0,0,.5],"43":[.08333,.58333,0,0,.77778],"44":[.19444,.10556,0,0,.27778],"45":[0,.43056,0,0,.33333],"46":[0,.10556,0,0,.27778],"47":[.25,.75,0,0,.5],"48":[0,.64444,0,0,.5],"49":[0,.64444,0,0,.5],"50":[0,.64444,0,0,.5],"51":[0,.64444,0,0,.5],"52":[0,.64444,0,0,.5],"53":[0,.64444,0,0,.5],"54":[0,.64444,0,0,.5],"55":[0,.64444,0,0,.5],"56":[0,.64444,0,0,.5],"57":[0,.64444,0,0,.5],"58":[0,.43056,0,0,.27778],"59":[.19444,.43056,0,0,.27778],"60":[.0391,.5391,0,0,.77778],"61":[-.13313,.36687,0,0,.77778],"62":[.0391,.5391,0,0,.77778],"63":[0,.69444,0,0,.47222],"64":[0,.69444,0,0,.77778],"65":[0,.68333,0,0,.75],"66":[0,.68333,0,0,.70834],"67":[0,.68333,0,0,.72222],"68":[0,.68333,0,0,.76389],"69":[0,.68333,0,0,.68056],"70":[0,.68333,0,0,.65278],"71":[0,.68333,0,0,.78472],"72":[0,.68333,0,0,.75],"73":[0,.68333,0,0,.36111],"74":[0,.68333,0,0,.51389],"75":[0,.68333,0,0,.77778],"76":[0,.68333,0,0,.625],"77":[0,.68333,0,0,.91667],"78":[0,.68333,0,0,.75],"79":[0,.68333,0,0,.77778],"80":[0,.68333,0,0,.68056],"81":[.19444,.68333,0,0,.77778],"82":[0,.68333,0,0,.73611],"83":[0,.68333,0,0,.55556],"84":[0,.68333,0,0,.72222],"85":[0,.68333,0,0,.75],"86":[0,.68333,.01389,0,.75],"87":[0,.68333,.01389,0,1.02778],"88":[0,.68333,0,0,.75],"89":[0,.68333,.025,0,.75],"90":[0,.68333,0,0,.61111],"91":[.25,.75,0,0,.27778],"92":[.25,.75,0,0,.5],"93":[.25,.75,0,0,.27778],"94":[0,.69444,0,0,.5],"95":[.31,.12056,.02778,0,.5],"97":[0,.43056,0,0,.5],"98":[0,.69444,0,0,.55556],"99":[0,.43056,0,0,.44445],"100":[0,.69444,0,0,.55556],"101":[0,.43056,0,0,.44445],"102":[0,.69444,.07778,0,.30556],"103":[.19444,.43056,.01389,0,.5],"104":[0,.69444,0,0,.55556],"105":[0,.66786,0,0,.27778],"106":[.19444,.66786,0,0,.30556],"107":[0,.69444,0,0,.52778],"108":[0,.69444,0,0,.27778],"109":[0,.43056,0,0,.83334],"110":[0,.43056,0,0,.55556],"111":[0,.43056,0,0,.5],"112":[.19444,.43056,0,0,.55556],"113":[.19444,.43056,0,0,.52778],"114":[0,.43056,0,0,.39167],"115":[0,.43056,0,0,.39445],"116":[0,.61508,0,0,.38889],"117":[0,.43056,0,0,.55556],"118":[0,.43056,.01389,0,.52778],"119":[0,.43056,.01389,0,.72222],"120":[0,.43056,0,0,.52778],"121":[.19444,.43056,.01389,0,.52778],"122":[0,.43056,0,0,.44445],"123":[.25,.75,0,0,.5],"124":[.25,.75,0,0,.27778],"125":[.25,.75,0,0,.5],"126":[.35,.31786,0,0,.5],"160":[0,0,0,0,.25],"163":[0,.69444,0,0,.76909],"167":[.19444,.69444,0,0,.44445],"168":[0,.66786,0,0,.5],"172":[0,.43056,0,0,.66667],"176":[0,.69444,0,0,.75],"177":[.08333,.58333,0,0,.77778],"182":[.19444,.69444,0,0,.61111],"184":[.17014,0,0,0,.44445],"198":[0,.68333,0,0,.90278],"215":[.08333,.58333,0,0,.77778],"216":[.04861,.73194,0,0,.77778],"223":[0,.69444,0,0,.5],"230":[0,.43056,0,0,.72222],"247":[.08333,.58333,0,0,.77778],"248":[.09722,.52778,0,0,.5],"305":[0,.43056,0,0,.27778],"338":[0,.68333,0,0,1.01389],"339":[0,.43056,0,0,.77778],"567":[.19444,.43056,0,0,.30556],"710":[0,.69444,0,0,.5],"711":[0,.62847,0,0,.5],"713":[0,.56778,0,0,.5],"714":[0,.69444,0,0,.5],"715":[0,.69444,0,0,.5],"728":[0,.69444,0,0,.5],"729":[0,.66786,0,0,.27778],"730":[0,.69444,0,0,.75],"732":[0,.66786,0,0,.5],"733":[0,.69444,0,0,.5],"915":[0,.68333,0,0,.625],"916":[0,.68333,0,0,.83334],"920":[0,.68333,0,0,.77778],"923":[0,.68333,0,0,.69445],"926":[0,.68333,0,0,.66667],"928":[0,.68333,0,0,.75],"931":[0,.68333,0,0,.72222],"933":[0,.68333,0,0,.77778],"934":[0,.68333,0,0,.72222],"936":[0,.68333,0,0,.77778],"937":[0,.68333,0,0,.72222],"8211":[0,.43056,.02778,0,.5],"8212":[0,.43056,.02778,0,1],"8216":[0,.69444,0,0,.27778],"8217":[0,.69444,0,0,.27778],"8220":[0,.69444,0,0,.5],"8221":[0,.69444,0,0,.5],"8224":[.19444,.69444,0,0,.44445],"8225":[.19444,.69444,0,0,.44445],"8230":[0,.123,0,0,1.172],"8242":[0,.55556,0,0,.275],"8407":[0,.71444,.15382,0,.5],"8463":[0,.68889,0,0,.54028],"8465":[0,.69444,0,0,.72222],"8467":[0,.69444,0,.11111,.41667],"8472":[.19444,.43056,0,.11111,.63646],"8476":[0,.69444,0,0,.72222],"8501":[0,.69444,0,0,.61111],"8592":[-.13313,.36687,0,0,1],"8593":[.19444,.69444,0,0,.5],"8594":[-.13313,.36687,0,0,1],"8595":[.19444,.69444,0,0,.5],"8596":[-.13313,.36687,0,0,1],"8597":[.25,.75,0,0,.5],"8598":[.19444,.69444,0,0,1],"8599":[.19444,.69444,0,0,1],"8600":[.19444,.69444,0,0,1],"8601":[.19444,.69444,0,0,1],"8614":[.011,.511,0,0,1],"8617":[.011,.511,0,0,1.126],"8618":[.011,.511,0,0,1.126],"8636":[-.13313,.36687,0,0,1],"8637":[-.13313,.36687,0,0,1],"8640":[-.13313,.36687,0,0,1],"8641":[-.13313,.36687,0,0,1],"8652":[.011,.671,0,0,1],"8656":[-.13313,.36687,0,0,1],"8657":[.19444,.69444,0,0,.61111],"8658":[-.13313,.36687,0,0,1],"8659":[.19444,.69444,0,0,.61111],"8660":[-.13313,.36687,0,0,1],"8661":[.25,.75,0,0,.61111],"8704":[0,.69444,0,0,.55556],"8706":[0,.69444,.05556,.08334,.5309],"8707":[0,.69444,0,0,.55556],"8709":[.05556,.75,0,0,.5],"8711":[0,.68333,0,0,.83334],"8712":[.0391,.5391,0,0,.66667],"8715":[.0391,.5391,0,0,.66667],"8722":[.08333,.58333,0,0,.77778],"8723":[.08333,.58333,0,0,.77778],"8725":[.25,.75,0,0,.5],"8726":[.25,.75,0,0,.5],"8727":[-.03472,.46528,0,0,.5],"8728":[-.05555,.44445,0,0,.5],"8729":[-.05555,.44445,0,0,.5],"8730":[.2,.8,0,0,.83334],"8733":[0,.43056,0,0,.77778],"8734":[0,.43056,0,0,1],"8736":[0,.69224,0,0,.72222],"8739":[.25,.75,0,0,.27778],"8741":[.25,.75,0,0,.5],"8743":[0,.55556,0,0,.66667],"8744":[0,.55556,0,0,.66667],"8745":[0,.55556,0,0,.66667],"8746":[0,.55556,0,0,.66667],"8747":[.19444,.69444,.11111,0,.41667],"8764":[-.13313,.36687,0,0,.77778],"8768":[.19444,.69444,0,0,.27778],"8771":[-.03625,.46375,0,0,.77778],"8773":[-.022,.589,0,0,.778],"8776":[-.01688,.48312,0,0,.77778],"8781":[-.03625,.46375,0,0,.77778],"8784":[-.133,.673,0,0,.778],"8801":[-.03625,.46375,0,0,.77778],"8804":[.13597,.63597,0,0,.77778],"8805":[.13597,.63597,0,0,.77778],"8810":[.0391,.5391,0,0,1],"8811":[.0391,.5391,0,0,1],"8826":[.0391,.5391,0,0,.77778],"8827":[.0391,.5391,0,0,.77778],"8834":[.0391,.5391,0,0,.77778],"8835":[.0391,.5391,0,0,.77778],"8838":[.13597,.63597,0,0,.77778],"8839":[.13597,.63597,0,0,.77778],"8846":[0,.55556,0,0,.66667],"8849":[.13597,.63597,0,0,.77778],"8850":[.13597,.63597,0,0,.77778],"8851":[0,.55556,0,0,.66667],"8852":[0,.55556,0,0,.66667],"8853":[.08333,.58333,0,0,.77778],"8854":[.08333,.58333,0,0,.77778],"8855":[.08333,.58333,0,0,.77778],"8856":[.08333,.58333,0,0,.77778],"8857":[.08333,.58333,0,0,.77778],"8866":[0,.69444,0,0,.61111],"8867":[0,.69444,0,0,.61111],"8868":[0,.69444,0,0,.77778],"8869":[0,.69444,0,0,.77778],"8872":[.249,.75,0,0,.867],"8900":[-.05555,.44445,0,0,.5],"8901":[-.05555,.44445,0,0,.27778],"8902":[-.03472,.46528,0,0,.5],"8904":[.005,.505,0,0,.9],"8942":[.03,.903,0,0,.278],"8943":[-.19,.313,0,0,1.172],"8945":[-.1,.823,0,0,1.282],"8968":[.25,.75,0,0,.44445],"8969":[.25,.75,0,0,.44445],"8970":[.25,.75,0,0,.44445],"8971":[.25,.75,0,0,.44445],"8994":[-.14236,.35764,0,0,1],"8995":[-.14236,.35764,0,0,1],"9136":[.244,.744,0,0,.412],"9137":[.244,.745,0,0,.412],"9651":[.19444,.69444,0,0,.88889],"9657":[-.03472,.46528,0,0,.5],"9661":[.19444,.69444,0,0,.88889],"9667":[-.03472,.46528,0,0,.5],"9711":[.19444,.69444,0,0,1],"9824":[.12963,.69444,0,0,.77778],"9825":[.12963,.69444,0,0,.77778],"9826":[.12963,.69444,0,0,.77778],"9827":[.12963,.69444,0,0,.77778],"9837":[0,.75,0,0,.38889],"9838":[.19444,.69444,0,0,.38889],"9839":[.19444,.69444,0,0,.38889],"10216":[.25,.75,0,0,.38889],"10217":[.25,.75,0,0,.38889],"10222":[.244,.744,0,0,.412],"10223":[.244,.745,0,0,.412],"10229":[.011,.511,0,0,1.609],"10230":[.011,.511,0,0,1.638],"10231":[.011,.511,0,0,1.859],"10232":[.024,.525,0,0,1.609],"10233":[.024,.525,0,0,1.638],"10234":[.024,.525,0,0,1.858],"10236":[.011,.511,0,0,1.638],"10815":[0,.68333,0,0,.75],"10927":[.13597,.63597,0,0,.77778],"10928":[.13597,.63597,0,0,.77778],"57376":[.19444,.69444,0,0,0]},"Math-BoldItalic":{"32":[0,0,0,0,.25],"48":[0,.44444,0,0,.575],"49":[0,.44444,0,0,.575],"50":[0,.44444,0,0,.575],"51":[.19444,.44444,0,0,.575],"52":[.19444,.44444,0,0,.575],"53":[.19444,.44444,0,0,.575],"54":[0,.64444,0,0,.575],"55":[.19444,.44444,0,0,.575],"56":[0,.64444,0,0,.575],"57":[.19444,.44444,0,0,.575],"65":[0,.68611,0,0,.86944],"66":[0,.68611,.04835,0,.8664],"67":[0,.68611,.06979,0,.81694],"68":[0,.68611,.03194,0,.93812],"69":[0,.68611,.05451,0,.81007],"70":[0,.68611,.15972,0,.68889],"71":[0,.68611,0,0,.88673],"72":[0,.68611,.08229,0,.98229],"73":[0,.68611,.07778,0,.51111],"74":[0,.68611,.10069,0,.63125],"75":[0,.68611,.06979,0,.97118],"76":[0,.68611,0,0,.75555],"77":[0,.68611,.11424,0,1.14201],"78":[0,.68611,.11424,0,.95034],"79":[0,.68611,.03194,0,.83666],"80":[0,.68611,.15972,0,.72309],"81":[.19444,.68611,0,0,.86861],"82":[0,.68611,.00421,0,.87235],"83":[0,.68611,.05382,0,.69271],"84":[0,.68611,.15972,0,.63663],"85":[0,.68611,.11424,0,.80027],"86":[0,.68611,.25555,0,.67778],"87":[0,.68611,.15972,0,1.09305],"88":[0,.68611,.07778,0,.94722],"89":[0,.68611,.25555,0,.67458],"90":[0,.68611,.06979,0,.77257],"97":[0,.44444,0,0,.63287],"98":[0,.69444,0,0,.52083],"99":[0,.44444,0,0,.51342],"100":[0,.69444,0,0,.60972],"101":[0,.44444,0,0,.55361],"102":[.19444,.69444,.11042,0,.56806],"103":[.19444,.44444,.03704,0,.5449],"104":[0,.69444,0,0,.66759],"105":[0,.69326,0,0,.4048],"106":[.19444,.69326,.0622,0,.47083],"107":[0,.69444,.01852,0,.6037],"108":[0,.69444,.0088,0,.34815],"109":[0,.44444,0,0,1.0324],"110":[0,.44444,0,0,.71296],"111":[0,.44444,0,0,.58472],"112":[.19444,.44444,0,0,.60092],"113":[.19444,.44444,.03704,0,.54213],"114":[0,.44444,.03194,0,.5287],"115":[0,.44444,0,0,.53125],"116":[0,.63492,0,0,.41528],"117":[0,.44444,0,0,.68102],"118":[0,.44444,.03704,0,.56666],"119":[0,.44444,.02778,0,.83148],"120":[0,.44444,0,0,.65903],"121":[.19444,.44444,.03704,0,.59028],"122":[0,.44444,.04213,0,.55509],"160":[0,0,0,0,.25],"915":[0,.68611,.15972,0,.65694],"916":[0,.68611,0,0,.95833],"920":[0,.68611,.03194,0,.86722],"923":[0,.68611,0,0,.80555],"926":[0,.68611,.07458,0,.84125],"928":[0,.68611,.08229,0,.98229],"931":[0,.68611,.05451,0,.88507],"933":[0,.68611,.15972,0,.67083],"934":[0,.68611,0,0,.76666],"936":[0,.68611,.11653,0,.71402],"937":[0,.68611,.04835,0,.8789],"945":[0,.44444,0,0,.76064],"946":[.19444,.69444,.03403,0,.65972],"947":[.19444,.44444,.06389,0,.59003],"948":[0,.69444,.03819,0,.52222],"949":[0,.44444,0,0,.52882],"950":[.19444,.69444,.06215,0,.50833],"951":[.19444,.44444,.03704,0,.6],"952":[0,.69444,.03194,0,.5618],"953":[0,.44444,0,0,.41204],"954":[0,.44444,0,0,.66759],"955":[0,.69444,0,0,.67083],"956":[.19444,.44444,0,0,.70787],"957":[0,.44444,.06898,0,.57685],"958":[.19444,.69444,.03021,0,.50833],"959":[0,.44444,0,0,.58472],"960":[0,.44444,.03704,0,.68241],"961":[.19444,.44444,0,0,.6118],"962":[.09722,.44444,.07917,0,.42361],"963":[0,.44444,.03704,0,.68588],"964":[0,.44444,.13472,0,.52083],"965":[0,.44444,.03704,0,.63055],"966":[.19444,.44444,0,0,.74722],"967":[.19444,.44444,0,0,.71805],"968":[.19444,.69444,.03704,0,.75833],"969":[0,.44444,.03704,0,.71782],"977":[0,.69444,0,0,.69155],"981":[.19444,.69444,0,0,.7125],"982":[0,.44444,.03194,0,.975],"1009":[.19444,.44444,0,0,.6118],"1013":[0,.44444,0,0,.48333],"57649":[0,.44444,0,0,.39352],"57911":[.19444,.44444,0,0,.43889]},"Math-Italic":{"32":[0,0,0,0,.25],"48":[0,.43056,0,0,.5],"49":[0,.43056,0,0,.5],"50":[0,.43056,0,0,.5],"51":[.19444,.43056,0,0,.5],"52":[.19444,.43056,0,0,.5],"53":[.19444,.43056,0,0,.5],"54":[0,.64444,0,0,.5],"55":[.19444,.43056,0,0,.5],"56":[0,.64444,0,0,.5],"57":[.19444,.43056,0,0,.5],"65":[0,.68333,0,.13889,.75],"66":[0,.68333,.05017,.08334,.75851],"67":[0,.68333,.07153,.08334,.71472],"68":[0,.68333,.02778,.05556,.82792],"69":[0,.68333,.05764,.08334,.7382],"70":[0,.68333,.13889,.08334,.64306],"71":[0,.68333,0,.08334,.78625],"72":[0,.68333,.08125,.05556,.83125],"73":[0,.68333,.07847,.11111,.43958],"74":[0,.68333,.09618,.16667,.55451],"75":[0,.68333,.07153,.05556,.84931],"76":[0,.68333,0,.02778,.68056],"77":[0,.68333,.10903,.08334,.97014],"78":[0,.68333,.10903,.08334,.80347],"79":[0,.68333,.02778,.08334,.76278],"80":[0,.68333,.13889,.08334,.64201],"81":[.19444,.68333,0,.08334,.79056],"82":[0,.68333,.00773,.08334,.75929],"83":[0,.68333,.05764,.08334,.6132],"84":[0,.68333,.13889,.08334,.58438],"85":[0,.68333,.10903,.02778,.68278],"86":[0,.68333,.22222,0,.58333],"87":[0,.68333,.13889,0,.94445],"88":[0,.68333,.07847,.08334,.82847],"89":[0,.68333,.22222,0,.58056],"90":[0,.68333,.07153,.08334,.68264],"97":[0,.43056,0,0,.52859],"98":[0,.69444,0,0,.42917],"99":[0,.43056,0,.05556,.43276],"100":[0,.69444,0,.16667,.52049],"101":[0,.43056,0,.05556,.46563],"102":[.19444,.69444,.10764,.16667,.48959],"103":[.19444,.43056,.03588,.02778,.47697],"104":[0,.69444,0,0,.57616],"105":[0,.65952,0,0,.34451],"106":[.19444,.65952,.05724,0,.41181],"107":[0,.69444,.03148,0,.5206],"108":[0,.69444,.01968,.08334,.29838],"109":[0,.43056,0,0,.87801],"110":[0,.43056,0,0,.60023],"111":[0,.43056,0,.05556,.48472],"112":[.19444,.43056,0,.08334,.50313],"113":[.19444,.43056,.03588,.08334,.44641],"114":[0,.43056,.02778,.05556,.45116],"115":[0,.43056,0,.05556,.46875],"116":[0,.61508,0,.08334,.36111],"117":[0,.43056,0,.02778,.57246],"118":[0,.43056,.03588,.02778,.48472],"119":[0,.43056,.02691,.08334,.71592],"120":[0,.43056,0,.02778,.57153],"121":[.19444,.43056,.03588,.05556,.49028],"122":[0,.43056,.04398,.05556,.46505],"160":[0,0,0,0,.25],"915":[0,.68333,.13889,.08334,.61528],"916":[0,.68333,0,.16667,.83334],"920":[0,.68333,.02778,.08334,.76278],"923":[0,.68333,0,.16667,.69445],"926":[0,.68333,.07569,.08334,.74236],"928":[0,.68333,.08125,.05556,.83125],"931":[0,.68333,.05764,.08334,.77986],"933":[0,.68333,.13889,.05556,.58333],"934":[0,.68333,0,.08334,.66667],"936":[0,.68333,.11,.05556,.61222],"937":[0,.68333,.05017,.08334,.7724],"945":[0,.43056,.0037,.02778,.6397],"946":[.19444,.69444,.05278,.08334,.56563],"947":[.19444,.43056,.05556,0,.51773],"948":[0,.69444,.03785,.05556,.44444],"949":[0,.43056,0,.08334,.46632],"950":[.19444,.69444,.07378,.08334,.4375],"951":[.19444,.43056,.03588,.05556,.49653],"952":[0,.69444,.02778,.08334,.46944],"953":[0,.43056,0,.05556,.35394],"954":[0,.43056,0,0,.57616],"955":[0,.69444,0,0,.58334],"956":[.19444,.43056,0,.02778,.60255],"957":[0,.43056,.06366,.02778,.49398],"958":[.19444,.69444,.04601,.11111,.4375],"959":[0,.43056,0,.05556,.48472],"960":[0,.43056,.03588,0,.57003],"961":[.19444,.43056,0,.08334,.51702],"962":[.09722,.43056,.07986,.08334,.36285],"963":[0,.43056,.03588,0,.57141],"964":[0,.43056,.1132,.02778,.43715],"965":[0,.43056,.03588,.02778,.54028],"966":[.19444,.43056,0,.08334,.65417],"967":[.19444,.43056,0,.05556,.62569],"968":[.19444,.69444,.03588,.11111,.65139],"969":[0,.43056,.03588,0,.62245],"977":[0,.69444,0,.08334,.59144],"981":[.19444,.69444,0,.08334,.59583],"982":[0,.43056,.02778,0,.82813],"1009":[.19444,.43056,0,.08334,.51702],"1013":[0,.43056,0,.05556,.4059],"57649":[0,.43056,0,.02778,.32246],"57911":[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{"32":[0,0,0,0,.25],"33":[0,.69444,0,0,.36667],"34":[0,.69444,0,0,.55834],"35":[.19444,.69444,0,0,.91667],"36":[.05556,.75,0,0,.55],"37":[.05556,.75,0,0,1.02912],"38":[0,.69444,0,0,.83056],"39":[0,.69444,0,0,.30556],"40":[.25,.75,0,0,.42778],"41":[.25,.75,0,0,.42778],"42":[0,.75,0,0,.55],"43":[.11667,.61667,0,0,.85556],"44":[.10556,.13056,0,0,.30556],"45":[0,.45833,0,0,.36667],"46":[0,.13056,0,0,.30556],"47":[.25,.75,0,0,.55],"48":[0,.69444,0,0,.55],"49":[0,.69444,0,0,.55],"50":[0,.69444,0,0,.55],"51":[0,.69444,0,0,.55],"52":[0,.69444,0,0,.55],"53":[0,.69444,0,0,.55],"54":[0,.69444,0,0,.55],"55":[0,.69444,0,0,.55],"56":[0,.69444,0,0,.55],"57":[0,.69444,0,0,.55],"58":[0,.45833,0,0,.30556],"59":[.10556,.45833,0,0,.30556],"61":[-.09375,.40625,0,0,.85556],"63":[0,.69444,0,0,.51945],"64":[0,.69444,0,0,.73334],"65":[0,.69444,0,0,.73334],"66":[0,.69444,0,0,.73334],"67":[0,.69444,0,0,.70278],"68":[0,.69444,0,0,.79445],"69":[0,.69444,0,0,.64167],"70":[0,.69444,0,0,.61111],"71":[0,.69444,0,0,.73334],"72":[0,.69444,0,0,.79445],"73":[0,.69444,0,0,.33056],"74":[0,.69444,0,0,.51945],"75":[0,.69444,0,0,.76389],"76":[0,.69444,0,0,.58056],"77":[0,.69444,0,0,.97778],"78":[0,.69444,0,0,.79445],"79":[0,.69444,0,0,.79445],"80":[0,.69444,0,0,.70278],"81":[.10556,.69444,0,0,.79445],"82":[0,.69444,0,0,.70278],"83":[0,.69444,0,0,.61111],"84":[0,.69444,0,0,.73334],"85":[0,.69444,0,0,.76389],"86":[0,.69444,.01528,0,.73334],"87":[0,.69444,.01528,0,1.03889],"88":[0,.69444,0,0,.73334],"89":[0,.69444,.0275,0,.73334],"90":[0,.69444,0,0,.67223],"91":[.25,.75,0,0,.34306],"93":[.25,.75,0,0,.34306],"94":[0,.69444,0,0,.55],"95":[.35,.10833,.03056,0,.55],"97":[0,.45833,0,0,.525],"98":[0,.69444,0,0,.56111],"99":[0,.45833,0,0,.48889],"100":[0,.69444,0,0,.56111],"101":[0,.45833,0,0,.51111],"102":[0,.69444,.07639,0,.33611],"103":[.19444,.45833,.01528,0,.55],"104":[0,.69444,0,0,.56111],"105":[0,.69444,0,0,.25556],"106":[.19444,.69444,0,0,.28611],"107":[0,.69444,0,0,.53056],"108":[0,.69444,0,0,.25556],"109":[0,.45833,0,0,.86667],"110":[0,.45833,0,0,.56111],"111":[0,.45833,0,0,.55],"112":[.19444,.45833,0,0,.56111],"113":[.19444,.45833,0,0,.56111],"114":[0,.45833,.01528,0,.37222],"115":[0,.45833,0,0,.42167],"116":[0,.58929,0,0,.40417],"117":[0,.45833,0,0,.56111],"118":[0,.45833,.01528,0,.5],"119":[0,.45833,.01528,0,.74445],"120":[0,.45833,0,0,.5],"121":[.19444,.45833,.01528,0,.5],"122":[0,.45833,0,0,.47639],"126":[.35,.34444,0,0,.55],"160":[0,0,0,0,.25],"168":[0,.69444,0,0,.55],"176":[0,.69444,0,0,.73334],"180":[0,.69444,0,0,.55],"184":[.17014,0,0,0,.48889],"305":[0,.45833,0,0,.25556],"567":[.19444,.45833,0,0,.28611],"710":[0,.69444,0,0,.55],"711":[0,.63542,0,0,.55],"713":[0,.63778,0,0,.55],"728":[0,.69444,0,0,.55],"729":[0,.69444,0,0,.30556],"730":[0,.69444,0,0,.73334],"732":[0,.69444,0,0,.55],"733":[0,.69444,0,0,.55],"915":[0,.69444,0,0,.58056],"916":[0,.69444,0,0,.91667],"920":[0,.69444,0,0,.85556],"923":[0,.69444,0,0,.67223],"926":[0,.69444,0,0,.73334],"928":[0,.69444,0,0,.79445],"931":[0,.69444,0,0,.79445],"933":[0,.69444,0,0,.85556],"934":[0,.69444,0,0,.79445],"936":[0,.69444,0,0,.85556],"937":[0,.69444,0,0,.79445],"8211":[0,.45833,.03056,0,.55],"8212":[0,.45833,.03056,0,1.10001],"8216":[0,.69444,0,0,.30556],"8217":[0,.69444,0,0,.30556],"8220":[0,.69444,0,0,.55834],"8221":[0,.69444,0,0,.55834]},"SansSerif-Italic":{"32":[0,0,0,0,.25],"33":[0,.69444,.05733,0,.31945],"34":[0,.69444,.00316,0,.5],"35":[.19444,.69444,.05087,0,.83334],"36":[.05556,.75,.11156,0,.5],"37":[.05556,.75,.03126,0,.83334],"38":[0,.69444,.03058,0,.75834],"39":[0,.69444,.07816,0,.27778],"40":[.25,.75,.13164,0,.38889],"41":[.25,.75,.02536,0,.38889],"42":[0,.75,.11775,0,.5],"43":[.08333,.58333,.02536,0,.77778],"44":[.125,.08333,0,0,.27778],"45":[0,.44444,.01946,0,.33333],"46":[0,.08333,0,0,.27778],"47":[.25,.75,.13164,0,.5],"48":[0,.65556,.11156,0,.5],"49":[0,.65556,.11156,0,.5],"50":[0,.65556,.11156,0,.5],"51":[0,.65556,.11156,0,.5],"52":[0,.65556,.11156,0,.5],"53":[0,.65556,.11156,0,.5],"54":[0,.65556,.11156,0,.5],"55":[0,.65556,.11156,0,.5],"56":[0,.65556,.11156,0,.5],"57":[0,.65556,.11156,0,.5],"58":[0,.44444,.02502,0,.27778],"59":[.125,.44444,.02502,0,.27778],"61":[-.13,.37,.05087,0,.77778],"63":[0,.69444,.11809,0,.47222],"64":[0,.69444,.07555,0,.66667],"65":[0,.69444,0,0,.66667],"66":[0,.69444,.08293,0,.66667],"67":[0,.69444,.11983,0,.63889],"68":[0,.69444,.07555,0,.72223],"69":[0,.69444,.11983,0,.59722],"70":[0,.69444,.13372,0,.56945],"71":[0,.69444,.11983,0,.66667],"72":[0,.69444,.08094,0,.70834],"73":[0,.69444,.13372,0,.27778],"74":[0,.69444,.08094,0,.47222],"75":[0,.69444,.11983,0,.69445],"76":[0,.69444,0,0,.54167],"77":[0,.69444,.08094,0,.875],"78":[0,.69444,.08094,0,.70834],"79":[0,.69444,.07555,0,.73611],"80":[0,.69444,.08293,0,.63889],"81":[.125,.69444,.07555,0,.73611],"82":[0,.69444,.08293,0,.64584],"83":[0,.69444,.09205,0,.55556],"84":[0,.69444,.13372,0,.68056],"85":[0,.69444,.08094,0,.6875],"86":[0,.69444,.1615,0,.66667],"87":[0,.69444,.1615,0,.94445],"88":[0,.69444,.13372,0,.66667],"89":[0,.69444,.17261,0,.66667],"90":[0,.69444,.11983,0,.61111],"91":[.25,.75,.15942,0,.28889],"93":[.25,.75,.08719,0,.28889],"94":[0,.69444,.0799,0,.5],"95":[.35,.09444,.08616,0,.5],"97":[0,.44444,.00981,0,.48056],"98":[0,.69444,.03057,0,.51667],"99":[0,.44444,.08336,0,.44445],"100":[0,.69444,.09483,0,.51667],"101":[0,.44444,.06778,0,.44445],"102":[0,.69444,.21705,0,.30556],"103":[.19444,.44444,.10836,0,.5],"104":[0,.69444,.01778,0,.51667],"105":[0,.67937,.09718,0,.23889],"106":[.19444,.67937,.09162,0,.26667],"107":[0,.69444,.08336,0,.48889],"108":[0,.69444,.09483,0,.23889],"109":[0,.44444,.01778,0,.79445],"110":[0,.44444,.01778,0,.51667],"111":[0,.44444,.06613,0,.5],"112":[.19444,.44444,.0389,0,.51667],"113":[.19444,.44444,.04169,0,.51667],"114":[0,.44444,.10836,0,.34167],"115":[0,.44444,.0778,0,.38333],"116":[0,.57143,.07225,0,.36111],"117":[0,.44444,.04169,0,.51667],"118":[0,.44444,.10836,0,.46111],"119":[0,.44444,.10836,0,.68334],"120":[0,.44444,.09169,0,.46111],"121":[.19444,.44444,.10836,0,.46111],"122":[0,.44444,.08752,0,.43472],"126":[.35,.32659,.08826,0,.5],"160":[0,0,0,0,.25],"168":[0,.67937,.06385,0,.5],"176":[0,.69444,0,0,.73752],"184":[.17014,0,0,0,.44445],"305":[0,.44444,.04169,0,.23889],"567":[.19444,.44444,.04169,0,.26667],"710":[0,.69444,.0799,0,.5],"711":[0,.63194,.08432,0,.5],"713":[0,.60889,.08776,0,.5],"714":[0,.69444,.09205,0,.5],"715":[0,.69444,0,0,.5],"728":[0,.69444,.09483,0,.5],"729":[0,.67937,.07774,0,.27778],"730":[0,.69444,0,0,.73752],"732":[0,.67659,.08826,0,.5],"733":[0,.69444,.09205,0,.5],"915":[0,.69444,.13372,0,.54167],"916":[0,.69444,0,0,.83334],"920":[0,.69444,.07555,0,.77778],"923":[0,.69444,0,0,.61111],"926":[0,.69444,.12816,0,.66667],"928":[0,.69444,.08094,0,.70834],"931":[0,.69444,.11983,0,.72222],"933":[0,.69444,.09031,0,.77778],"934":[0,.69444,.04603,0,.72222],"936":[0,.69444,.09031,0,.77778],"937":[0,.69444,.08293,0,.72222],"8211":[0,.44444,.08616,0,.5],"8212":[0,.44444,.08616,0,1],"8216":[0,.69444,.07816,0,.27778],"8217":[0,.69444,.07816,0,.27778],"8220":[0,.69444,.14205,0,.5],"8221":[0,.69444,.00316,0,.5]},"SansSerif-Regular":{"32":[0,0,0,0,.25],"33":[0,.69444,0,0,.31945],"34":[0,.69444,0,0,.5],"35":[.19444,.69444,0,0,.83334],"36":[.05556,.75,0,0,.5],"37":[.05556,.75,0,0,.83334],"38":[0,.69444,0,0,.75834],"39":[0,.69444,0,0,.27778],"40":[.25,.75,0,0,.38889],"41":[.25,.75,0,0,.38889],"42":[0,.75,0,0,.5],"43":[.08333,.58333,0,0,.77778],"44":[.125,.08333,0,0,.27778],"45":[0,.44444,0,0,.33333],"46":[0,.08333,0,0,.27778],"47":[.25,.75,0,0,.5],"48":[0,.65556,0,0,.5],"49":[0,.65556,0,0,.5],"50":[0,.65556,0,0,.5],"51":[0,.65556,0,0,.5],"52":[0,.65556,0,0,.5],"53":[0,.65556,0,0,.5],"54":[0,.65556,0,0,.5],"55":[0,.65556,0,0,.5],"56":[0,.65556,0,0,.5],"57":[0,.65556,0,0,.5],"58":[0,.44444,0,0,.27778],"59":[.125,.44444,0,0,.27778],"61":[-.13,.37,0,0,.77778],"63":[0,.69444,0,0,.47222],"64":[0,.69444,0,0,.66667],"65":[0,.69444,0,0,.66667],"66":[0,.69444,0,0,.66667],"67":[0,.69444,0,0,.63889],"68":[0,.69444,0,0,.72223],"69":[0,.69444,0,0,.59722],"70":[0,.69444,0,0,.56945],"71":[0,.69444,0,0,.66667],"72":[0,.69444,0,0,.70834],"73":[0,.69444,0,0,.27778],"74":[0,.69444,0,0,.47222],"75":[0,.69444,0,0,.69445],"76":[0,.69444,0,0,.54167],"77":[0,.69444,0,0,.875],"78":[0,.69444,0,0,.70834],"79":[0,.69444,0,0,.73611],"80":[0,.69444,0,0,.63889],"81":[.125,.69444,0,0,.73611],"82":[0,.69444,0,0,.64584],"83":[0,.69444,0,0,.55556],"84":[0,.69444,0,0,.68056],"85":[0,.69444,0,0,.6875],"86":[0,.69444,.01389,0,.66667],"87":[0,.69444,.01389,0,.94445],"88":[0,.69444,0,0,.66667],"89":[0,.69444,.025,0,.66667],"90":[0,.69444,0,0,.61111],"91":[.25,.75,0,0,.28889],"93":[.25,.75,0,0,.28889],"94":[0,.69444,0,0,.5],"95":[.35,.09444,.02778,0,.5],"97":[0,.44444,0,0,.48056],"98":[0,.69444,0,0,.51667],"99":[0,.44444,0,0,.44445],"100":[0,.69444,0,0,.51667],"101":[0,.44444,0,0,.44445],"102":[0,.69444,.06944,0,.30556],"103":[.19444,.44444,.01389,0,.5],"104":[0,.69444,0,0,.51667],"105":[0,.67937,0,0,.23889],"106":[.19444,.67937,0,0,.26667],"107":[0,.69444,0,0,.48889],"108":[0,.69444,0,0,.23889],"109":[0,.44444,0,0,.79445],"110":[0,.44444,0,0,.51667],"111":[0,.44444,0,0,.5],"112":[.19444,.44444,0,0,.51667],"113":[.19444,.44444,0,0,.51667],"114":[0,.44444,.01389,0,.34167],"115":[0,.44444,0,0,.38333],"116":[0,.57143,0,0,.36111],"117":[0,.44444,0,0,.51667],"118":[0,.44444,.01389,0,.46111],"119":[0,.44444,.01389,0,.68334],"120":[0,.44444,0,0,.46111],"121":[.19444,.44444,.01389,0,.46111],"122":[0,.44444,0,0,.43472],"126":[.35,.32659,0,0,.5],"160":[0,0,0,0,.25],"168":[0,.67937,0,0,.5],"176":[0,.69444,0,0,.66667],"184":[.17014,0,0,0,.44445],"305":[0,.44444,0,0,.23889],"567":[.19444,.44444,0,0,.26667],"710":[0,.69444,0,0,.5],"711":[0,.63194,0,0,.5],"713":[0,.60889,0,0,.5],"714":[0,.69444,0,0,.5],"715":[0,.69444,0,0,.5],"728":[0,.69444,0,0,.5],"729":[0,.67937,0,0,.27778],"730":[0,.69444,0,0,.66667],"732":[0,.67659,0,0,.5],"733":[0,.69444,0,0,.5],"915":[0,.69444,0,0,.54167],"916":[0,.69444,0,0,.83334],"920":[0,.69444,0,0,.77778],"923":[0,.69444,0,0,.61111],"926":[0,.69444,0,0,.66667],"928":[0,.69444,0,0,.70834],"931":[0,.69444,0,0,.72222],"933":[0,.69444,0,0,.77778],"934":[0,.69444,0,0,.72222],"936":[0,.69444,0,0,.77778],"937":[0,.69444,0,0,.72222],"8211":[0,.44444,.02778,0,.5],"8212":[0,.44444,.02778,0,1],"8216":[0,.69444,0,0,.27778],"8217":[0,.69444,0,0,.27778],"8220":[0,.69444,0,0,.5],"8221":[0,.69444,0,0,.5]},"Script-Regular":{"32":[0,0,0,0,.25],"65":[0,.7,.22925,0,.80253],"66":[0,.7,.04087,0,.90757],"67":[0,.7,.1689,0,.66619],"68":[0,.7,.09371,0,.77443],"69":[0,.7,.18583,0,.56162],"70":[0,.7,.13634,0,.89544],"71":[0,.7,.17322,0,.60961],"72":[0,.7,.29694,0,.96919],"73":[0,.7,.19189,0,.80907],"74":[.27778,.7,.19189,0,1.05159],"75":[0,.7,.31259,0,.91364],"76":[0,.7,.19189,0,.87373],"77":[0,.7,.15981,0,1.08031],"78":[0,.7,.3525,0,.9015],"79":[0,.7,.08078,0,.73787],"80":[0,.7,.08078,0,1.01262],"81":[0,.7,.03305,0,.88282],"82":[0,.7,.06259,0,.85],"83":[0,.7,.19189,0,.86767],"84":[0,.7,.29087,0,.74697],"85":[0,.7,.25815,0,.79996],"86":[0,.7,.27523,0,.62204],"87":[0,.7,.27523,0,.80532],"88":[0,.7,.26006,0,.94445],"89":[0,.7,.2939,0,.70961],"90":[0,.7,.24037,0,.8212],"160":[0,0,0,0,.25]},"Size1-Regular":{"32":[0,0,0,0,.25],"40":[.35001,.85,0,0,.45834],"41":[.35001,.85,0,0,.45834],"47":[.35001,.85,0,0,.57778],"91":[.35001,.85,0,0,.41667],"92":[.35001,.85,0,0,.57778],"93":[.35001,.85,0,0,.41667],"123":[.35001,.85,0,0,.58334],"125":[.35001,.85,0,0,.58334],"160":[0,0,0,0,.25],"710":[0,.72222,0,0,.55556],"732":[0,.72222,0,0,.55556],"770":[0,.72222,0,0,.55556],"771":[0,.72222,0,0,.55556],"8214":[-99e-5,.601,0,0,.77778],"8593":[1e-5,.6,0,0,.66667],"8595":[1e-5,.6,0,0,.66667],"8657":[1e-5,.6,0,0,.77778],"8659":[1e-5,.6,0,0,.77778],"8719":[.25001,.75,0,0,.94445],"8720":[.25001,.75,0,0,.94445],"8721":[.25001,.75,0,0,1.05556],"8730":[.35001,.85,0,0,1],"8739":[-.00599,.606,0,0,.33333],"8741":[-.00599,.606,0,0,.55556],"8747":[.30612,.805,.19445,0,.47222],"8748":[.306,.805,.19445,0,.47222],"8749":[.306,.805,.19445,0,.47222],"8750":[.30612,.805,.19445,0,.47222],"8896":[.25001,.75,0,0,.83334],"8897":[.25001,.75,0,0,.83334],"8898":[.25001,.75,0,0,.83334],"8899":[.25001,.75,0,0,.83334],"8968":[.35001,.85,0,0,.47222],"8969":[.35001,.85,0,0,.47222],"8970":[.35001,.85,0,0,.47222],"8971":[.35001,.85,0,0,.47222],"9168":[-99e-5,.601,0,0,.66667],"10216":[.35001,.85,0,0,.47222],"10217":[.35001,.85,0,0,.47222],"10752":[.25001,.75,0,0,1.11111],"10753":[.25001,.75,0,0,1.11111],"10754":[.25001,.75,0,0,1.11111],"10756":[.25001,.75,0,0,.83334],"10758":[.25001,.75,0,0,.83334]},"Size2-Regular":{"32":[0,0,0,0,.25],"40":[.65002,1.15,0,0,.59722],"41":[.65002,1.15,0,0,.59722],"47":[.65002,1.15,0,0,.81111],"91":[.65002,1.15,0,0,.47222],"92":[.65002,1.15,0,0,.81111],"93":[.65002,1.15,0,0,.47222],"123":[.65002,1.15,0,0,.66667],"125":[.65002,1.15,0,0,.66667],"160":[0,0,0,0,.25],"710":[0,.75,0,0,1],"732":[0,.75,0,0,1],"770":[0,.75,0,0,1],"771":[0,.75,0,0,1],"8719":[.55001,1.05,0,0,1.27778],"8720":[.55001,1.05,0,0,1.27778],"8721":[.55001,1.05,0,0,1.44445],"8730":[.65002,1.15,0,0,1],"8747":[.86225,1.36,.44445,0,.55556],"8748":[.862,1.36,.44445,0,.55556],"8749":[.862,1.36,.44445,0,.55556],"8750":[.86225,1.36,.44445,0,.55556],"8896":[.55001,1.05,0,0,1.11111],"8897":[.55001,1.05,0,0,1.11111],"8898":[.55001,1.05,0,0,1.11111],"8899":[.55001,1.05,0,0,1.11111],"8968":[.65002,1.15,0,0,.52778],"8969":[.65002,1.15,0,0,.52778],"8970":[.65002,1.15,0,0,.52778],"8971":[.65002,1.15,0,0,.52778],"10216":[.65002,1.15,0,0,.61111],"10217":[.65002,1.15,0,0,.61111],"10752":[.55001,1.05,0,0,1.51112],"10753":[.55001,1.05,0,0,1.51112],"10754":[.55001,1.05,0,0,1.51112],"10756":[.55001,1.05,0,0,1.11111],"10758":[.55001,1.05,0,0,1.11111]},"Size3-Regular":{"32":[0,0,0,0,.25],"40":[.95003,1.45,0,0,.73611],"41":[.95003,1.45,0,0,.73611],"47":[.95003,1.45,0,0,1.04445],"91":[.95003,1.45,0,0,.52778],"92":[.95003,1.45,0,0,1.04445],"93":[.95003,1.45,0,0,.52778],"123":[.95003,1.45,0,0,.75],"125":[.95003,1.45,0,0,.75],"160":[0,0,0,0,.25],"710":[0,.75,0,0,1.44445],"732":[0,.75,0,0,1.44445],"770":[0,.75,0,0,1.44445],"771":[0,.75,0,0,1.44445],"8730":[.95003,1.45,0,0,1],"8968":[.95003,1.45,0,0,.58334],"8969":[.95003,1.45,0,0,.58334],"8970":[.95003,1.45,0,0,.58334],"8971":[.95003,1.45,0,0,.58334],"10216":[.95003,1.45,0,0,.75],"10217":[.95003,1.45,0,0,.75]},"Size4-Regular":{"32":[0,0,0,0,.25],"40":[1.25003,1.75,0,0,.79167],"41":[1.25003,1.75,0,0,.79167],"47":[1.25003,1.75,0,0,1.27778],"91":[1.25003,1.75,0,0,.58334],"92":[1.25003,1.75,0,0,1.27778],"93":[1.25003,1.75,0,0,.58334],"123":[1.25003,1.75,0,0,.80556],"125":[1.25003,1.75,0,0,.80556],"160":[0,0,0,0,.25],"710":[0,.825,0,0,1.8889],"732":[0,.825,0,0,1.8889],"770":[0,.825,0,0,1.8889],"771":[0,.825,0,0,1.8889],"8730":[1.25003,1.75,0,0,1],"8968":[1.25003,1.75,0,0,.63889],"8969":[1.25003,1.75,0,0,.63889],"8970":[1.25003,1.75,0,0,.63889],"8971":[1.25003,1.75,0,0,.63889],"9115":[.64502,1.155,0,0,.875],"9116":[1e-5,.6,0,0,.875],"9117":[.64502,1.155,0,0,.875],"9118":[.64502,1.155,0,0,.875],"9119":[1e-5,.6,0,0,.875],"9120":[.64502,1.155,0,0,.875],"9121":[.64502,1.155,0,0,.66667],"9122":[-99e-5,.601,0,0,.66667],"9123":[.64502,1.155,0,0,.66667],"9124":[.64502,1.155,0,0,.66667],"9125":[-99e-5,.601,0,0,.66667],"9126":[.64502,1.155,0,0,.66667],"9127":[1e-5,.9,0,0,.88889],"9128":[.65002,1.15,0,0,.88889],"9129":[.90001,0,0,0,.88889],"9130":[0,.3,0,0,.88889],"9131":[1e-5,.9,0,0,.88889],"9132":[.65002,1.15,0,0,.88889],"9133":[.90001,0,0,0,.88889],"9143":[.88502,.915,0,0,1.05556],"10216":[1.25003,1.75,0,0,.80556],"10217":[1.25003,1.75,0,0,.80556],"57344":[-.00499,.605,0,0,1.05556],"57345":[-.00499,.605,0,0,1.05556],"57680":[0,.12,0,0,.45],"57681":[0,.12,0,0,.45],"57682":[0,.12,0,0,.45],"57683":[0,.12,0,0,.45]},"Typewriter-Regular":{"32":[0,0,0,0,.525],"33":[0,.61111,0,0,.525],"34":[0,.61111,0,0,.525],"35":[0,.61111,0,0,.525],"36":[.08333,.69444,0,0,.525],"37":[.08333,.69444,0,0,.525],"38":[0,.61111,0,0,.525],"39":[0,.61111,0,0,.525],"40":[.08333,.69444,0,0,.525],"41":[.08333,.69444,0,0,.525],"42":[0,.52083,0,0,.525],"43":[-.08056,.53055,0,0,.525],"44":[.13889,.125,0,0,.525],"45":[-.08056,.53055,0,0,.525],"46":[0,.125,0,0,.525],"47":[.08333,.69444,0,0,.525],"48":[0,.61111,0,0,.525],"49":[0,.61111,0,0,.525],"50":[0,.61111,0,0,.525],"51":[0,.61111,0,0,.525],"52":[0,.61111,0,0,.525],"53":[0,.61111,0,0,.525],"54":[0,.61111,0,0,.525],"55":[0,.61111,0,0,.525],"56":[0,.61111,0,0,.525],"57":[0,.61111,0,0,.525],"58":[0,.43056,0,0,.525],"59":[.13889,.43056,0,0,.525],"60":[-.05556,.55556,0,0,.525],"61":[-.19549,.41562,0,0,.525],"62":[-.05556,.55556,0,0,.525],"63":[0,.61111,0,0,.525],"64":[0,.61111,0,0,.525],"65":[0,.61111,0,0,.525],"66":[0,.61111,0,0,.525],"67":[0,.61111,0,0,.525],"68":[0,.61111,0,0,.525],"69":[0,.61111,0,0,.525],"70":[0,.61111,0,0,.525],"71":[0,.61111,0,0,.525],"72":[0,.61111,0,0,.525],"73":[0,.61111,0,0,.525],"74":[0,.61111,0,0,.525],"75":[0,.61111,0,0,.525],"76":[0,.61111,0,0,.525],"77":[0,.61111,0,0,.525],"78":[0,.61111,0,0,.525],"79":[0,.61111,0,0,.525],"80":[0,.61111,0,0,.525],"81":[.13889,.61111,0,0,.525],"82":[0,.61111,0,0,.525],"83":[0,.61111,0,0,.525],"84":[0,.61111,0,0,.525],"85":[0,.61111,0,0,.525],"86":[0,.61111,0,0,.525],"87":[0,.61111,0,0,.525],"88":[0,.61111,0,0,.525],"89":[0,.61111,0,0,.525],"90":[0,.61111,0,0,.525],"91":[.08333,.69444,0,0,.525],"92":[.08333,.69444,0,0,.525],"93":[.08333,.69444,0,0,.525],"94":[0,.61111,0,0,.525],"95":[.09514,0,0,0,.525],"96":[0,.61111,0,0,.525],"97":[0,.43056,0,0,.525],"98":[0,.61111,0,0,.525],"99":[0,.43056,0,0,.525],"100":[0,.61111,0,0,.525],"101":[0,.43056,0,0,.525],"102":[0,.61111,0,0,.525],"103":[.22222,.43056,0,0,.525],"104":[0,.61111,0,0,.525],"105":[0,.61111,0,0,.525],"106":[.22222,.61111,0,0,.525],"107":[0,.61111,0,0,.525],"108":[0,.61111,0,0,.525],"109":[0,.43056,0,0,.525],"110":[0,.43056,0,0,.525],"111":[0,.43056,0,0,.525],"112":[.22222,.43056,0,0,.525],"113":[.22222,.43056,0,0,.525],"114":[0,.43056,0,0,.525],"115":[0,.43056,0,0,.525],"116":[0,.55358,0,0,.525],"117":[0,.43056,0,0,.525],"118":[0,.43056,0,0,.525],"119":[0,.43056,0,0,.525],"120":[0,.43056,0,0,.525],"121":[.22222,.43056,0,0,.525],"122":[0,.43056,0,0,.525],"123":[.08333,.69444,0,0,.525],"124":[.08333,.69444,0,0,.525],"125":[.08333,.69444,0,0,.525],"126":[0,.61111,0,0,.525],"127":[0,.61111,0,0,.525],"160":[0,0,0,0,.525],"176":[0,.61111,0,0,.525],"184":[.19445,0,0,0,.525],"305":[0,.43056,0,0,.525],"567":[.22222,.43056,0,0,.525],"711":[0,.56597,0,0,.525],"713":[0,.56555,0,0,.525],"714":[0,.61111,0,0,.525],"715":[0,.61111,0,0,.525],"728":[0,.61111,0,0,.525],"730":[0,.61111,0,0,.525],"770":[0,.61111,0,0,.525],"771":[0,.61111,0,0,.525],"776":[0,.61111,0,0,.525],"915":[0,.61111,0,0,.525],"916":[0,.61111,0,0,.525],"920":[0,.61111,0,0,.525],"923":[0,.61111,0,0,.525],"926":[0,.61111,0,0,.525],"928":[0,.61111,0,0,.525],"931":[0,.61111,0,0,.525],"933":[0,.61111,0,0,.525],"934":[0,.61111,0,0,.525],"936":[0,.61111,0,0,.525],"937":[0,.61111,0,0,.525],"8216":[0,.61111,0,0,.525],"8217":[0,.61111,0,0,.525],"8242":[0,.61111,0,0,.525],"9251":[.11111,.21944,0,0,.525]}};bwe={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]};pan={"\xC5":"A","\xD0":"D","\xDE":"o","\xE5":"a","\xF0":"d","\xFE":"o","\u0410":"A","\u0411":"B","\u0412":"B","\u0413":"F","\u0414":"A","\u0415":"E","\u0416":"K","\u0417":"3","\u0418":"N","\u0419":"N","\u041A":"K","\u041B":"N","\u041C":"M","\u041D":"H","\u041E":"O","\u041F":"N","\u0420":"P","\u0421":"C","\u0422":"T","\u0423":"y","\u0424":"O","\u0425":"X","\u0426":"U","\u0427":"h","\u0428":"W","\u0429":"W","\u042A":"B","\u042B":"X","\u042C":"B","\u042D":"3","\u042E":"X","\u042F":"R","\u0430":"a","\u0431":"b","\u0432":"a","\u0433":"r","\u0434":"y","\u0435":"e","\u0436":"m","\u0437":"e","\u0438":"n","\u0439":"n","\u043A":"n","\u043B":"n","\u043C":"m","\u043D":"n","\u043E":"o","\u043F":"n","\u0440":"p","\u0441":"c","\u0442":"o","\u0443":"y","\u0444":"b","\u0445":"x","\u0446":"n","\u0447":"n","\u0448":"w","\u0449":"w","\u044A":"a","\u044B":"m","\u044C":"a","\u044D":"e","\u044E":"m","\u044F":"r"};Sqe={};tf={"math":{},"text":{}};pt="math";Pi="text";Yt="main";Un="ams";nf="accent-token";zo="bin";Y0="close";r$="inner";Ba="mathord";Kh="op-token";Q1="open";XQ="punct";$n="rel";yR="spacing";fr="textord";et(pt,Yt,$n,"\u2261","\\equiv",true);et(pt,Yt,$n,"\u227A","\\prec",true);et(pt,Yt,$n,"\u227B","\\succ",true);et(pt,Yt,$n,"\u223C","\\sim",true);et(pt,Yt,$n,"\u22A5","\\perp");et(pt,Yt,$n,"\u2AAF","\\preceq",true);et(pt,Yt,$n,"\u2AB0","\\succeq",true);et(pt,Yt,$n,"\u2243","\\simeq",true);et(pt,Yt,$n,"\u2223","\\mid",true);et(pt,Yt,$n,"\u226A","\\ll",true);et(pt,Yt,$n,"\u226B","\\gg",true);et(pt,Yt,$n,"\u224D","\\asymp",true);et(pt,Yt,$n,"\u2225","\\parallel");et(pt,Yt,$n,"\u22C8","\\bowtie",true);et(pt,Yt,$n,"\u2323","\\smile",true);et(pt,Yt,$n,"\u2291","\\sqsubseteq",true);et(pt,Yt,$n,"\u2292","\\sqsupseteq",true);et(pt,Yt,$n,"\u2250","\\doteq",true);et(pt,Yt,$n,"\u2322","\\frown",true);et(pt,Yt,$n,"\u220B","\\ni",true);et(pt,Yt,$n,"\u221D","\\propto",true);et(pt,Yt,$n,"\u22A2","\\vdash",true);et(pt,Yt,$n,"\u22A3","\\dashv",true);et(pt,Yt,$n,"\u220B","\\owns");et(pt,Yt,XQ,".","\\ldotp");et(pt,Yt,XQ,"\u22C5","\\cdotp");et(pt,Yt,XQ,"\u22C5","\xB7");et(Pi,Yt,fr,"\u22C5","\xB7");et(pt,Yt,fr,"#","\\#");et(Pi,Yt,fr,"#","\\#");et(pt,Yt,fr,"&","\\&");et(Pi,Yt,fr,"&","\\&");et(pt,Yt,fr,"\u2135","\\aleph",true);et(pt,Yt,fr,"\u2200","\\forall",true);et(pt,Yt,fr,"\u210F","\\hbar",true);et(pt,Yt,fr,"\u2203","\\exists",true);et(pt,Yt,fr,"\u2207","\\nabla",true);et(pt,Yt,fr,"\u266D","\\flat",true);et(pt,Yt,fr,"\u2113","\\ell",true);et(pt,Yt,fr,"\u266E","\\natural",true);et(pt,Yt,fr,"\u2663","\\clubsuit",true);et(pt,Yt,fr,"\u2118","\\wp",true);et(pt,Yt,fr,"\u266F","\\sharp",true);et(pt,Yt,fr,"\u2662","\\diamondsuit",true);et(pt,Yt,fr,"\u211C","\\Re",true);et(pt,Yt,fr,"\u2661","\\heartsuit",true);et(pt,Yt,fr,"\u2111","\\Im",true);et(pt,Yt,fr,"\u2660","\\spadesuit",true);et(pt,Yt,fr,"\xA7","\\S",true);et(Pi,Yt,fr,"\xA7","\\S");et(pt,Yt,fr,"\xB6","\\P",true);et(Pi,Yt,fr,"\xB6","\\P");et(pt,Yt,fr,"\u2020","\\dag");et(Pi,Yt,fr,"\u2020","\\dag");et(Pi,Yt,fr,"\u2020","\\textdagger");et(pt,Yt,fr,"\u2021","\\ddag");et(Pi,Yt,fr,"\u2021","\\ddag");et(Pi,Yt,fr,"\u2021","\\textdaggerdbl");et(pt,Yt,Y0,"\u23B1","\\rmoustache",true);et(pt,Yt,Q1,"\u23B0","\\lmoustache",true);et(pt,Yt,Y0,"\u27EF","\\rgroup",true);et(pt,Yt,Q1,"\u27EE","\\lgroup",true);et(pt,Yt,zo,"\u2213","\\mp",true);et(pt,Yt,zo,"\u2296","\\ominus",true);et(pt,Yt,zo,"\u228E","\\uplus",true);et(pt,Yt,zo,"\u2293","\\sqcap",true);et(pt,Yt,zo,"\u2217","\\ast");et(pt,Yt,zo,"\u2294","\\sqcup",true);et(pt,Yt,zo,"\u25EF","\\bigcirc",true);et(pt,Yt,zo,"\u2219","\\bullet",true);et(pt,Yt,zo,"\u2021","\\ddagger");et(pt,Yt,zo,"\u2240","\\wr",true);et(pt,Yt,zo,"\u2A3F","\\amalg");et(pt,Yt,zo,"&","\\And");et(pt,Yt,$n,"\u27F5","\\longleftarrow",true);et(pt,Yt,$n,"\u21D0","\\Leftarrow",true);et(pt,Yt,$n,"\u27F8","\\Longleftarrow",true);et(pt,Yt,$n,"\u27F6","\\longrightarrow",true);et(pt,Yt,$n,"\u21D2","\\Rightarrow",true);et(pt,Yt,$n,"\u27F9","\\Longrightarrow",true);et(pt,Yt,$n,"\u2194","\\leftrightarrow",true);et(pt,Yt,$n,"\u27F7","\\longleftrightarrow",true);et(pt,Yt,$n,"\u21D4","\\Leftrightarrow",true);et(pt,Yt,$n,"\u27FA","\\Longleftrightarrow",true);et(pt,Yt,$n,"\u21A6","\\mapsto",true);et(pt,Yt,$n,"\u27FC","\\longmapsto",true);et(pt,Yt,$n,"\u2197","\\nearrow",true);et(pt,Yt,$n,"\u21A9","\\hookleftarrow",true);et(pt,Yt,$n,"\u21AA","\\hookrightarrow",true);et(pt,Yt,$n,"\u2198","\\searrow",true);et(pt,Yt,$n,"\u21BC","\\leftharpoonup",true);et(pt,Yt,$n,"\u21C0","\\rightharpoonup",true);et(pt,Yt,$n,"\u2199","\\swarrow",true);et(pt,Yt,$n,"\u21BD","\\leftharpoondown",true);et(pt,Yt,$n,"\u21C1","\\rightharpoondown",true);et(pt,Yt,$n,"\u2196","\\nwarrow",true);et(pt,Yt,$n,"\u21CC","\\rightleftharpoons",true);et(pt,Un,$n,"\u226E","\\nless",true);et(pt,Un,$n,"\uE010","\\@nleqslant");et(pt,Un,$n,"\uE011","\\@nleqq");et(pt,Un,$n,"\u2A87","\\lneq",true);et(pt,Un,$n,"\u2268","\\lneqq",true);et(pt,Un,$n,"\uE00C","\\@lvertneqq");et(pt,Un,$n,"\u22E6","\\lnsim",true);et(pt,Un,$n,"\u2A89","\\lnapprox",true);et(pt,Un,$n,"\u2280","\\nprec",true);et(pt,Un,$n,"\u22E0","\\npreceq",true);et(pt,Un,$n,"\u22E8","\\precnsim",true);et(pt,Un,$n,"\u2AB9","\\precnapprox",true);et(pt,Un,$n,"\u2241","\\nsim",true);et(pt,Un,$n,"\uE006","\\@nshortmid");et(pt,Un,$n,"\u2224","\\nmid",true);et(pt,Un,$n,"\u22AC","\\nvdash",true);et(pt,Un,$n,"\u22AD","\\nvDash",true);et(pt,Un,$n,"\u22EA","\\ntriangleleft");et(pt,Un,$n,"\u22EC","\\ntrianglelefteq",true);et(pt,Un,$n,"\u228A","\\subsetneq",true);et(pt,Un,$n,"\uE01A","\\@varsubsetneq");et(pt,Un,$n,"\u2ACB","\\subsetneqq",true);et(pt,Un,$n,"\uE017","\\@varsubsetneqq");et(pt,Un,$n,"\u226F","\\ngtr",true);et(pt,Un,$n,"\uE00F","\\@ngeqslant");et(pt,Un,$n,"\uE00E","\\@ngeqq");et(pt,Un,$n,"\u2A88","\\gneq",true);et(pt,Un,$n,"\u2269","\\gneqq",true);et(pt,Un,$n,"\uE00D","\\@gvertneqq");et(pt,Un,$n,"\u22E7","\\gnsim",true);et(pt,Un,$n,"\u2A8A","\\gnapprox",true);et(pt,Un,$n,"\u2281","\\nsucc",true);et(pt,Un,$n,"\u22E1","\\nsucceq",true);et(pt,Un,$n,"\u22E9","\\succnsim",true);et(pt,Un,$n,"\u2ABA","\\succnapprox",true);et(pt,Un,$n,"\u2246","\\ncong",true);et(pt,Un,$n,"\uE007","\\@nshortparallel");et(pt,Un,$n,"\u2226","\\nparallel",true);et(pt,Un,$n,"\u22AF","\\nVDash",true);et(pt,Un,$n,"\u22EB","\\ntriangleright");et(pt,Un,$n,"\u22ED","\\ntrianglerighteq",true);et(pt,Un,$n,"\uE018","\\@nsupseteqq");et(pt,Un,$n,"\u228B","\\supsetneq",true);et(pt,Un,$n,"\uE01B","\\@varsupsetneq");et(pt,Un,$n,"\u2ACC","\\supsetneqq",true);et(pt,Un,$n,"\uE019","\\@varsupsetneqq");et(pt,Un,$n,"\u22AE","\\nVdash",true);et(pt,Un,$n,"\u2AB5","\\precneqq",true);et(pt,Un,$n,"\u2AB6","\\succneqq",true);et(pt,Un,$n,"\uE016","\\@nsubseteqq");et(pt,Un,zo,"\u22B4","\\unlhd");et(pt,Un,zo,"\u22B5","\\unrhd");et(pt,Un,$n,"\u219A","\\nleftarrow",true);et(pt,Un,$n,"\u219B","\\nrightarrow",true);et(pt,Un,$n,"\u21CD","\\nLeftarrow",true);et(pt,Un,$n,"\u21CF","\\nRightarrow",true);et(pt,Un,$n,"\u21AE","\\nleftrightarrow",true);et(pt,Un,$n,"\u21CE","\\nLeftrightarrow",true);et(pt,Un,$n,"\u25B3","\\vartriangle");et(pt,Un,fr,"\u210F","\\hslash");et(pt,Un,fr,"\u25BD","\\triangledown");et(pt,Un,fr,"\u25CA","\\lozenge");et(pt,Un,fr,"\u24C8","\\circledS");et(pt,Un,fr,"\xAE","\\circledR");et(Pi,Un,fr,"\xAE","\\circledR");et(pt,Un,fr,"\u2221","\\measuredangle",true);et(pt,Un,fr,"\u2204","\\nexists");et(pt,Un,fr,"\u2127","\\mho");et(pt,Un,fr,"\u2132","\\Finv",true);et(pt,Un,fr,"\u2141","\\Game",true);et(pt,Un,fr,"\u2035","\\backprime");et(pt,Un,fr,"\u25B2","\\blacktriangle");et(pt,Un,fr,"\u25BC","\\blacktriangledown");et(pt,Un,fr,"\u25A0","\\blacksquare");et(pt,Un,fr,"\u29EB","\\blacklozenge");et(pt,Un,fr,"\u2605","\\bigstar");et(pt,Un,fr,"\u2222","\\sphericalangle",true);et(pt,Un,fr,"\u2201","\\complement",true);et(pt,Un,fr,"\xF0","\\eth",true);et(Pi,Yt,fr,"\xF0","\xF0");et(pt,Un,fr,"\u2571","\\diagup");et(pt,Un,fr,"\u2572","\\diagdown");et(pt,Un,fr,"\u25A1","\\square");et(pt,Un,fr,"\u25A1","\\Box");et(pt,Un,fr,"\u25CA","\\Diamond");et(pt,Un,fr,"\xA5","\\yen",true);et(Pi,Un,fr,"\xA5","\\yen",true);et(pt,Un,fr,"\u2713","\\checkmark",true);et(Pi,Un,fr,"\u2713","\\checkmark");et(pt,Un,fr,"\u2136","\\beth",true);et(pt,Un,fr,"\u2138","\\daleth",true);et(pt,Un,fr,"\u2137","\\gimel",true);et(pt,Un,fr,"\u03DD","\\digamma",true);et(pt,Un,fr,"\u03F0","\\varkappa");et(pt,Un,Q1,"\u250C","\\@ulcorner",true);et(pt,Un,Y0,"\u2510","\\@urcorner",true);et(pt,Un,Q1,"\u2514","\\@llcorner",true);et(pt,Un,Y0,"\u2518","\\@lrcorner",true);et(pt,Un,$n,"\u2266","\\leqq",true);et(pt,Un,$n,"\u2A7D","\\leqslant",true);et(pt,Un,$n,"\u2A95","\\eqslantless",true);et(pt,Un,$n,"\u2272","\\lesssim",true);et(pt,Un,$n,"\u2A85","\\lessapprox",true);et(pt,Un,$n,"\u224A","\\approxeq",true);et(pt,Un,zo,"\u22D6","\\lessdot");et(pt,Un,$n,"\u22D8","\\lll",true);et(pt,Un,$n,"\u2276","\\lessgtr",true);et(pt,Un,$n,"\u22DA","\\lesseqgtr",true);et(pt,Un,$n,"\u2A8B","\\lesseqqgtr",true);et(pt,Un,$n,"\u2251","\\doteqdot");et(pt,Un,$n,"\u2253","\\risingdotseq",true);et(pt,Un,$n,"\u2252","\\fallingdotseq",true);et(pt,Un,$n,"\u223D","\\backsim",true);et(pt,Un,$n,"\u22CD","\\backsimeq",true);et(pt,Un,$n,"\u2AC5","\\subseteqq",true);et(pt,Un,$n,"\u22D0","\\Subset",true);et(pt,Un,$n,"\u228F","\\sqsubset",true);et(pt,Un,$n,"\u227C","\\preccurlyeq",true);et(pt,Un,$n,"\u22DE","\\curlyeqprec",true);et(pt,Un,$n,"\u227E","\\precsim",true);et(pt,Un,$n,"\u2AB7","\\precapprox",true);et(pt,Un,$n,"\u22B2","\\vartriangleleft");et(pt,Un,$n,"\u22B4","\\trianglelefteq");et(pt,Un,$n,"\u22A8","\\vDash",true);et(pt,Un,$n,"\u22AA","\\Vvdash",true);et(pt,Un,$n,"\u2323","\\smallsmile");et(pt,Un,$n,"\u2322","\\smallfrown");et(pt,Un,$n,"\u224F","\\bumpeq",true);et(pt,Un,$n,"\u224E","\\Bumpeq",true);et(pt,Un,$n,"\u2267","\\geqq",true);et(pt,Un,$n,"\u2A7E","\\geqslant",true);et(pt,Un,$n,"\u2A96","\\eqslantgtr",true);et(pt,Un,$n,"\u2273","\\gtrsim",true);et(pt,Un,$n,"\u2A86","\\gtrapprox",true);et(pt,Un,zo,"\u22D7","\\gtrdot");et(pt,Un,$n,"\u22D9","\\ggg",true);et(pt,Un,$n,"\u2277","\\gtrless",true);et(pt,Un,$n,"\u22DB","\\gtreqless",true);et(pt,Un,$n,"\u2A8C","\\gtreqqless",true);et(pt,Un,$n,"\u2256","\\eqcirc",true);et(pt,Un,$n,"\u2257","\\circeq",true);et(pt,Un,$n,"\u225C","\\triangleq",true);et(pt,Un,$n,"\u223C","\\thicksim");et(pt,Un,$n,"\u2248","\\thickapprox");et(pt,Un,$n,"\u2AC6","\\supseteqq",true);et(pt,Un,$n,"\u22D1","\\Supset",true);et(pt,Un,$n,"\u2290","\\sqsupset",true);et(pt,Un,$n,"\u227D","\\succcurlyeq",true);et(pt,Un,$n,"\u22DF","\\curlyeqsucc",true);et(pt,Un,$n,"\u227F","\\succsim",true);et(pt,Un,$n,"\u2AB8","\\succapprox",true);et(pt,Un,$n,"\u22B3","\\vartriangleright");et(pt,Un,$n,"\u22B5","\\trianglerighteq");et(pt,Un,$n,"\u22A9","\\Vdash",true);et(pt,Un,$n,"\u2223","\\shortmid");et(pt,Un,$n,"\u2225","\\shortparallel");et(pt,Un,$n,"\u226C","\\between",true);et(pt,Un,$n,"\u22D4","\\pitchfork",true);et(pt,Un,$n,"\u221D","\\varpropto");et(pt,Un,$n,"\u25C0","\\blacktriangleleft");et(pt,Un,$n,"\u2234","\\therefore",true);et(pt,Un,$n,"\u220D","\\backepsilon");et(pt,Un,$n,"\u25B6","\\blacktriangleright");et(pt,Un,$n,"\u2235","\\because",true);et(pt,Un,$n,"\u22D8","\\llless");et(pt,Un,$n,"\u22D9","\\gggtr");et(pt,Un,zo,"\u22B2","\\lhd");et(pt,Un,zo,"\u22B3","\\rhd");et(pt,Un,$n,"\u2242","\\eqsim",true);et(pt,Yt,$n,"\u22C8","\\Join");et(pt,Un,$n,"\u2251","\\Doteq",true);et(pt,Un,zo,"\u2214","\\dotplus",true);et(pt,Un,zo,"\u2216","\\smallsetminus");et(pt,Un,zo,"\u22D2","\\Cap",true);et(pt,Un,zo,"\u22D3","\\Cup",true);et(pt,Un,zo,"\u2A5E","\\doublebarwedge",true);et(pt,Un,zo,"\u229F","\\boxminus",true);et(pt,Un,zo,"\u229E","\\boxplus",true);et(pt,Un,zo,"\u22C7","\\divideontimes",true);et(pt,Un,zo,"\u22C9","\\ltimes",true);et(pt,Un,zo,"\u22CA","\\rtimes",true);et(pt,Un,zo,"\u22CB","\\leftthreetimes",true);et(pt,Un,zo,"\u22CC","\\rightthreetimes",true);et(pt,Un,zo,"\u22CF","\\curlywedge",true);et(pt,Un,zo,"\u22CE","\\curlyvee",true);et(pt,Un,zo,"\u229D","\\circleddash",true);et(pt,Un,zo,"\u229B","\\circledast",true);et(pt,Un,zo,"\u22C5","\\centerdot");et(pt,Un,zo,"\u22BA","\\intercal",true);et(pt,Un,zo,"\u22D2","\\doublecap");et(pt,Un,zo,"\u22D3","\\doublecup");et(pt,Un,zo,"\u22A0","\\boxtimes",true);et(pt,Un,$n,"\u21E2","\\dashrightarrow",true);et(pt,Un,$n,"\u21E0","\\dashleftarrow",true);et(pt,Un,$n,"\u21C7","\\leftleftarrows",true);et(pt,Un,$n,"\u21C6","\\leftrightarrows",true);et(pt,Un,$n,"\u21DA","\\Lleftarrow",true);et(pt,Un,$n,"\u219E","\\twoheadleftarrow",true);et(pt,Un,$n,"\u21A2","\\leftarrowtail",true);et(pt,Un,$n,"\u21AB","\\looparrowleft",true);et(pt,Un,$n,"\u21CB","\\leftrightharpoons",true);et(pt,Un,$n,"\u21B6","\\curvearrowleft",true);et(pt,Un,$n,"\u21BA","\\circlearrowleft",true);et(pt,Un,$n,"\u21B0","\\Lsh",true);et(pt,Un,$n,"\u21C8","\\upuparrows",true);et(pt,Un,$n,"\u21BF","\\upharpoonleft",true);et(pt,Un,$n,"\u21C3","\\downharpoonleft",true);et(pt,Yt,$n,"\u22B6","\\origof",true);et(pt,Yt,$n,"\u22B7","\\imageof",true);et(pt,Un,$n,"\u22B8","\\multimap",true);et(pt,Un,$n,"\u21AD","\\leftrightsquigarrow",true);et(pt,Un,$n,"\u21C9","\\rightrightarrows",true);et(pt,Un,$n,"\u21C4","\\rightleftarrows",true);et(pt,Un,$n,"\u21A0","\\twoheadrightarrow",true);et(pt,Un,$n,"\u21A3","\\rightarrowtail",true);et(pt,Un,$n,"\u21AC","\\looparrowright",true);et(pt,Un,$n,"\u21B7","\\curvearrowright",true);et(pt,Un,$n,"\u21BB","\\circlearrowright",true);et(pt,Un,$n,"\u21B1","\\Rsh",true);et(pt,Un,$n,"\u21CA","\\downdownarrows",true);et(pt,Un,$n,"\u21BE","\\upharpoonright",true);et(pt,Un,$n,"\u21C2","\\downharpoonright",true);et(pt,Un,$n,"\u21DD","\\rightsquigarrow",true);et(pt,Un,$n,"\u21DD","\\leadsto");et(pt,Un,$n,"\u21DB","\\Rrightarrow",true);et(pt,Un,$n,"\u21BE","\\restriction");et(pt,Yt,fr,"\u2018","`");et(pt,Yt,fr,"$","\\$");et(Pi,Yt,fr,"$","\\$");et(Pi,Yt,fr,"$","\\textdollar");et(pt,Yt,fr,"%","\\%");et(Pi,Yt,fr,"%","\\%");et(pt,Yt,fr,"_","\\_");et(Pi,Yt,fr,"_","\\_");et(Pi,Yt,fr,"_","\\textunderscore");et(pt,Yt,fr,"\u2220","\\angle",true);et(pt,Yt,fr,"\u221E","\\infty",true);et(pt,Yt,fr,"\u2032","\\prime");et(pt,Yt,fr,"\u25B3","\\triangle");et(pt,Yt,fr,"\u0393","\\Gamma",true);et(pt,Yt,fr,"\u0394","\\Delta",true);et(pt,Yt,fr,"\u0398","\\Theta",true);et(pt,Yt,fr,"\u039B","\\Lambda",true);et(pt,Yt,fr,"\u039E","\\Xi",true);et(pt,Yt,fr,"\u03A0","\\Pi",true);et(pt,Yt,fr,"\u03A3","\\Sigma",true);et(pt,Yt,fr,"\u03A5","\\Upsilon",true);et(pt,Yt,fr,"\u03A6","\\Phi",true);et(pt,Yt,fr,"\u03A8","\\Psi",true);et(pt,Yt,fr,"\u03A9","\\Omega",true);et(pt,Yt,fr,"A","\u0391");et(pt,Yt,fr,"B","\u0392");et(pt,Yt,fr,"E","\u0395");et(pt,Yt,fr,"Z","\u0396");et(pt,Yt,fr,"H","\u0397");et(pt,Yt,fr,"I","\u0399");et(pt,Yt,fr,"K","\u039A");et(pt,Yt,fr,"M","\u039C");et(pt,Yt,fr,"N","\u039D");et(pt,Yt,fr,"O","\u039F");et(pt,Yt,fr,"P","\u03A1");et(pt,Yt,fr,"T","\u03A4");et(pt,Yt,fr,"X","\u03A7");et(pt,Yt,fr,"\xAC","\\neg",true);et(pt,Yt,fr,"\xAC","\\lnot");et(pt,Yt,fr,"\u22A4","\\top");et(pt,Yt,fr,"\u22A5","\\bot");et(pt,Yt,fr,"\u2205","\\emptyset");et(pt,Un,fr,"\u2205","\\varnothing");et(pt,Yt,Ba,"\u03B1","\\alpha",true);et(pt,Yt,Ba,"\u03B2","\\beta",true);et(pt,Yt,Ba,"\u03B3","\\gamma",true);et(pt,Yt,Ba,"\u03B4","\\delta",true);et(pt,Yt,Ba,"\u03F5","\\epsilon",true);et(pt,Yt,Ba,"\u03B6","\\zeta",true);et(pt,Yt,Ba,"\u03B7","\\eta",true);et(pt,Yt,Ba,"\u03B8","\\theta",true);et(pt,Yt,Ba,"\u03B9","\\iota",true);et(pt,Yt,Ba,"\u03BA","\\kappa",true);et(pt,Yt,Ba,"\u03BB","\\lambda",true);et(pt,Yt,Ba,"\u03BC","\\mu",true);et(pt,Yt,Ba,"\u03BD","\\nu",true);et(pt,Yt,Ba,"\u03BE","\\xi",true);et(pt,Yt,Ba,"\u03BF","\\omicron",true);et(pt,Yt,Ba,"\u03C0","\\pi",true);et(pt,Yt,Ba,"\u03C1","\\rho",true);et(pt,Yt,Ba,"\u03C3","\\sigma",true);et(pt,Yt,Ba,"\u03C4","\\tau",true);et(pt,Yt,Ba,"\u03C5","\\upsilon",true);et(pt,Yt,Ba,"\u03D5","\\phi",true);et(pt,Yt,Ba,"\u03C7","\\chi",true);et(pt,Yt,Ba,"\u03C8","\\psi",true);et(pt,Yt,Ba,"\u03C9","\\omega",true);et(pt,Yt,Ba,"\u03B5","\\varepsilon",true);et(pt,Yt,Ba,"\u03D1","\\vartheta",true);et(pt,Yt,Ba,"\u03D6","\\varpi",true);et(pt,Yt,Ba,"\u03F1","\\varrho",true);et(pt,Yt,Ba,"\u03C2","\\varsigma",true);et(pt,Yt,Ba,"\u03C6","\\varphi",true);et(pt,Yt,zo,"\u2217","*",true);et(pt,Yt,zo,"+","+");et(pt,Yt,zo,"\u2212","-",true);et(pt,Yt,zo,"\u22C5","\\cdot",true);et(pt,Yt,zo,"\u2218","\\circ",true);et(pt,Yt,zo,"\xF7","\\div",true);et(pt,Yt,zo,"\xB1","\\pm",true);et(pt,Yt,zo,"\xD7","\\times",true);et(pt,Yt,zo,"\u2229","\\cap",true);et(pt,Yt,zo,"\u222A","\\cup",true);et(pt,Yt,zo,"\u2216","\\setminus",true);et(pt,Yt,zo,"\u2227","\\land");et(pt,Yt,zo,"\u2228","\\lor");et(pt,Yt,zo,"\u2227","\\wedge",true);et(pt,Yt,zo,"\u2228","\\vee",true);et(pt,Yt,fr,"\u221A","\\surd");et(pt,Yt,Q1,"\u27E8","\\langle",true);et(pt,Yt,Q1,"\u2223","\\lvert");et(pt,Yt,Q1,"\u2225","\\lVert");et(pt,Yt,Y0,"?","?");et(pt,Yt,Y0,"!","!");et(pt,Yt,Y0,"\u27E9","\\rangle",true);et(pt,Yt,Y0,"\u2223","\\rvert");et(pt,Yt,Y0,"\u2225","\\rVert");et(pt,Yt,$n,"=","=");et(pt,Yt,$n,":",":");et(pt,Yt,$n,"\u2248","\\approx",true);et(pt,Yt,$n,"\u2245","\\cong",true);et(pt,Yt,$n,"\u2265","\\ge");et(pt,Yt,$n,"\u2265","\\geq",true);et(pt,Yt,$n,"\u2190","\\gets");et(pt,Yt,$n,">","\\gt",true);et(pt,Yt,$n,"\u2208","\\in",true);et(pt,Yt,$n,"\uE020","\\@not");et(pt,Yt,$n,"\u2282","\\subset",true);et(pt,Yt,$n,"\u2283","\\supset",true);et(pt,Yt,$n,"\u2286","\\subseteq",true);et(pt,Yt,$n,"\u2287","\\supseteq",true);et(pt,Un,$n,"\u2288","\\nsubseteq",true);et(pt,Un,$n,"\u2289","\\nsupseteq",true);et(pt,Yt,$n,"\u22A8","\\models");et(pt,Yt,$n,"\u2190","\\leftarrow",true);et(pt,Yt,$n,"\u2264","\\le");et(pt,Yt,$n,"\u2264","\\leq",true);et(pt,Yt,$n,"<","\\lt",true);et(pt,Yt,$n,"\u2192","\\rightarrow",true);et(pt,Yt,$n,"\u2192","\\to");et(pt,Un,$n,"\u2271","\\ngeq",true);et(pt,Un,$n,"\u2270","\\nleq",true);et(pt,Yt,yR,"\xA0","\\ ");et(pt,Yt,yR,"\xA0","\\space");et(pt,Yt,yR,"\xA0","\\nobreakspace");et(Pi,Yt,yR,"\xA0","\\ ");et(Pi,Yt,yR,"\xA0"," ");et(Pi,Yt,yR,"\xA0","\\space");et(Pi,Yt,yR,"\xA0","\\nobreakspace");et(pt,Yt,yR,"","\\nobreak");et(pt,Yt,yR,"","\\allowbreak");et(pt,Yt,XQ,",",",");et(pt,Yt,XQ,";",";");et(pt,Un,zo,"\u22BC","\\barwedge",true);et(pt,Un,zo,"\u22BB","\\veebar",true);et(pt,Yt,zo,"\u2299","\\odot",true);et(pt,Yt,zo,"\u2295","\\oplus",true);et(pt,Yt,zo,"\u2297","\\otimes",true);et(pt,Yt,fr,"\u2202","\\partial",true);et(pt,Yt,zo,"\u2298","\\oslash",true);et(pt,Un,zo,"\u229A","\\circledcirc",true);et(pt,Un,zo,"\u22A1","\\boxdot",true);et(pt,Yt,zo,"\u25B3","\\bigtriangleup");et(pt,Yt,zo,"\u25BD","\\bigtriangledown");et(pt,Yt,zo,"\u2020","\\dagger");et(pt,Yt,zo,"\u22C4","\\diamond");et(pt,Yt,zo,"\u22C6","\\star");et(pt,Yt,zo,"\u25C3","\\triangleleft");et(pt,Yt,zo,"\u25B9","\\triangleright");et(pt,Yt,Q1,"{","\\{");et(Pi,Yt,fr,"{","\\{");et(Pi,Yt,fr,"{","\\textbraceleft");et(pt,Yt,Y0,"}","\\}");et(Pi,Yt,fr,"}","\\}");et(Pi,Yt,fr,"}","\\textbraceright");et(pt,Yt,Q1,"{","\\lbrace");et(pt,Yt,Y0,"}","\\rbrace");et(pt,Yt,Q1,"[","\\lbrack",true);et(Pi,Yt,fr,"[","\\lbrack",true);et(pt,Yt,Y0,"]","\\rbrack",true);et(Pi,Yt,fr,"]","\\rbrack",true);et(pt,Yt,Q1,"(","\\lparen",true);et(pt,Yt,Y0,")","\\rparen",true);et(Pi,Yt,fr,"<","\\textless",true);et(Pi,Yt,fr,">","\\textgreater",true);et(pt,Yt,Q1,"\u230A","\\lfloor",true);et(pt,Yt,Y0,"\u230B","\\rfloor",true);et(pt,Yt,Q1,"\u2308","\\lceil",true);et(pt,Yt,Y0,"\u2309","\\rceil",true);et(pt,Yt,fr,"\\","\\backslash");et(pt,Yt,fr,"\u2223","|");et(pt,Yt,fr,"\u2223","\\vert");et(Pi,Yt,fr,"|","\\textbar",true);et(pt,Yt,fr,"\u2225","\\|");et(pt,Yt,fr,"\u2225","\\Vert");et(Pi,Yt,fr,"\u2225","\\textbardbl");et(Pi,Yt,fr,"~","\\textasciitilde");et(Pi,Yt,fr,"\\","\\textbackslash");et(Pi,Yt,fr,"^","\\textasciicircum");et(pt,Yt,$n,"\u2191","\\uparrow",true);et(pt,Yt,$n,"\u21D1","\\Uparrow",true);et(pt,Yt,$n,"\u2193","\\downarrow",true);et(pt,Yt,$n,"\u21D3","\\Downarrow",true);et(pt,Yt,$n,"\u2195","\\updownarrow",true);et(pt,Yt,$n,"\u21D5","\\Updownarrow",true);et(pt,Yt,Kh,"\u2210","\\coprod");et(pt,Yt,Kh,"\u22C1","\\bigvee");et(pt,Yt,Kh,"\u22C0","\\bigwedge");et(pt,Yt,Kh,"\u2A04","\\biguplus");et(pt,Yt,Kh,"\u22C2","\\bigcap");et(pt,Yt,Kh,"\u22C3","\\bigcup");et(pt,Yt,Kh,"\u222B","\\int");et(pt,Yt,Kh,"\u222B","\\intop");et(pt,Yt,Kh,"\u222C","\\iint");et(pt,Yt,Kh,"\u222D","\\iiint");et(pt,Yt,Kh,"\u220F","\\prod");et(pt,Yt,Kh,"\u2211","\\sum");et(pt,Yt,Kh,"\u2A02","\\bigotimes");et(pt,Yt,Kh,"\u2A01","\\bigoplus");et(pt,Yt,Kh,"\u2A00","\\bigodot");et(pt,Yt,Kh,"\u222E","\\oint");et(pt,Yt,Kh,"\u222F","\\oiint");et(pt,Yt,Kh,"\u2230","\\oiiint");et(pt,Yt,Kh,"\u2A06","\\bigsqcup");et(pt,Yt,Kh,"\u222B","\\smallint");et(Pi,Yt,r$,"\u2026","\\textellipsis");et(pt,Yt,r$,"\u2026","\\mathellipsis");et(Pi,Yt,r$,"\u2026","\\ldots",true);et(pt,Yt,r$,"\u2026","\\ldots",true);et(pt,Yt,r$,"\u22EF","\\@cdots",true);et(pt,Yt,r$,"\u22F1","\\ddots",true);et(pt,Yt,fr,"\u22EE","\\varvdots");et(Pi,Yt,fr,"\u22EE","\\varvdots");et(pt,Yt,nf,"\u02CA","\\acute");et(pt,Yt,nf,"\u02CB","\\grave");et(pt,Yt,nf,"\xA8","\\ddot");et(pt,Yt,nf,"~","\\tilde");et(pt,Yt,nf,"\u02C9","\\bar");et(pt,Yt,nf,"\u02D8","\\breve");et(pt,Yt,nf,"\u02C7","\\check");et(pt,Yt,nf,"^","\\hat");et(pt,Yt,nf,"\u20D7","\\vec");et(pt,Yt,nf,"\u02D9","\\dot");et(pt,Yt,nf,"\u02DA","\\mathring");et(pt,Yt,Ba,"\uE131","\\@imath");et(pt,Yt,Ba,"\uE237","\\@jmath");et(pt,Yt,fr,"\u0131","\u0131");et(pt,Yt,fr,"\u0237","\u0237");et(Pi,Yt,fr,"\u0131","\\i",true);et(Pi,Yt,fr,"\u0237","\\j",true);et(Pi,Yt,fr,"\xDF","\\ss",true);et(Pi,Yt,fr,"\xE6","\\ae",true);et(Pi,Yt,fr,"\u0153","\\oe",true);et(Pi,Yt,fr,"\xF8","\\o",true);et(Pi,Yt,fr,"\xC6","\\AE",true);et(Pi,Yt,fr,"\u0152","\\OE",true);et(Pi,Yt,fr,"\xD8","\\O",true);et(Pi,Yt,nf,"\u02CA","\\'");et(Pi,Yt,nf,"\u02CB","\\`");et(Pi,Yt,nf,"\u02C6","\\^");et(Pi,Yt,nf,"\u02DC","\\~");et(Pi,Yt,nf,"\u02C9","\\=");et(Pi,Yt,nf,"\u02D8","\\u");et(Pi,Yt,nf,"\u02D9","\\.");et(Pi,Yt,nf,"\xB8","\\c");et(Pi,Yt,nf,"\u02DA","\\r");et(Pi,Yt,nf,"\u02C7","\\v");et(Pi,Yt,nf,"\xA8",'\\"');et(Pi,Yt,nf,"\u02DD","\\H");et(Pi,Yt,nf,"\u25EF","\\textcircled");esn={"--":true,"---":true,"``":true,"''":true};et(Pi,Yt,fr,"\u2013","--",true);et(Pi,Yt,fr,"\u2013","\\textendash");et(Pi,Yt,fr,"\u2014","---",true);et(Pi,Yt,fr,"\u2014","\\textemdash");et(Pi,Yt,fr,"\u2018","`",true);et(Pi,Yt,fr,"\u2018","\\textquoteleft");et(Pi,Yt,fr,"\u2019","'",true);et(Pi,Yt,fr,"\u2019","\\textquoteright");et(Pi,Yt,fr,"\u201C","``",true);et(Pi,Yt,fr,"\u201C","\\textquotedblleft");et(Pi,Yt,fr,"\u201D","''",true);et(Pi,Yt,fr,"\u201D","\\textquotedblright");et(pt,Yt,fr,"\xB0","\\degree",true);et(Pi,Yt,fr,"\xB0","\\degree");et(Pi,Yt,fr,"\xB0","\\textdegree",true);et(pt,Yt,fr,"\xA3","\\pounds");et(pt,Yt,fr,"\xA3","\\mathsterling",true);et(Pi,Yt,fr,"\xA3","\\pounds");et(Pi,Yt,fr,"\xA3","\\textsterling",true);et(pt,Un,fr,"\u2720","\\maltese");et(Pi,Un,fr,"\u2720","\\maltese");man='0123456789/@."';for(xwe=0;xwe{var t=e.charCodeAt(0);var n=e.charCodeAt(1);var r=(t-55296)*1024+(n-56320)+65536;if(119808<=r&&r<120484){var i=Math.floor((r-119808)/26);return wan[i]}else if(120782<=r&&r<=120831){var o=Math.floor((r-120782)/10);return hyi[o]}else if(r===120485||r===120486){return wan[0]}else if(120486{if(iL(e.classes)!==iL(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize||e.italic!==0&&e.hasClass("mathnormal")){return false}if(e.classes.length===1){var n=e.classes[0];if(n==="mbin"||n==="mord"){return false}}for(var r of Object.keys(e.style)){if(e.style[r]!==t.style[r]){return false}}for(var i of Object.keys(t.style)){if(e.style[i]!==t.style[i]){return false}}return true};tsn=e=>{for(var t=0;tn){n=a.height}if(a.depth>r){r=a.depth}if(a.maxFontSize>i){i=a.maxFontSize}}t.height=n;t.depth=r;t.maxFontSize=i};Ni=function e(t,n,r,i){var o=new oL(t,n,r,i);uXe(o);return o};aL=(e,t,n,r)=>new oL(e,t,n,r);t$=function e(t,n,r){var i=Ni([t],[],n);i.height=Math.max(r||n.fontMetrics().defaultRuleThickness,n.minRuleThickness);i.style.borderBottomWidth=to(i.height);i.maxFontSize=1;return i};yyi=function e(t,n,r,i){var o=new e$(t,n,r,i);uXe(o);return o};bR=function e(t){var n=new rL(t);uXe(n);return n};n$=function e(t,n){if(t instanceof rL){return Ni([],[t],n)}return t};byi=function e(t){if(t.positionType==="individualShift"){var n=t.children;var r=[n[0]];var i=-n[0].shift-n[0].elem.depth;var o=i;for(var a=1;a{var n=Ni(["mspace"],[],t);var r=Sf(e,t);n.style.marginRight=to(r);return n};wwe=(e,t,n)=>{var r;var i;switch(e){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=e}if(t==="textbf"&&n==="textit"){i="BoldItalic"}else if(t==="textbf"){i="Bold"}else if(n==="textit"){i="Italic"}else{i="Regular"}return r+"-"+i};Xqe={"mathbf":{variant:"bold",fontName:"Main-Bold"},"mathrm":{variant:"normal",fontName:"Main-Regular"},"textit":{variant:"italic",fontName:"Main-Italic"},"mathit":{variant:"italic",fontName:"Main-Italic"},"mathnormal":{variant:"italic",fontName:"Math-Italic"},"mathsfit":{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},"mathbb":{variant:"double-struck",fontName:"AMS-Regular"},"mathcal":{variant:"script",fontName:"Caligraphic-Regular"},"mathfrak":{variant:"fraktur",fontName:"Fraktur-Regular"},"mathscr":{variant:"script",fontName:"Script-Regular"},"mathsf":{variant:"sans-serif",fontName:"SansSerif-Regular"},"mathtt":{variant:"monospace",fontName:"Typewriter-Regular"}};rsn={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]};isn=function e(t,n){var[r,i,o]=rsn[t];var a=new IC(r);var s=new Tw([a],{"width":to(i),"height":to(o),"style":"width:"+to(i),"viewBox":"0 0 "+1e3*i+" "+1e3*o,"preserveAspectRatio":"xMinYMin"});var l=aL(["overlay"],[s],n);l.height=o;l.style.height=to(o);l.style.width=to(i);return l};Cf={number:3,unit:"mu"};M5={number:4,unit:"mu"};pR={number:5,unit:"mu"};xyi={mord:{mop:Cf,mbin:M5,mrel:pR,minner:Cf},mop:{mord:Cf,mop:Cf,mrel:pR,minner:Cf},mbin:{mord:M5,mop:M5,mopen:M5,minner:M5},mrel:{mord:pR,mop:pR,mopen:pR,minner:pR},mopen:{},mclose:{mop:Cf,mbin:M5,mrel:pR,minner:Cf},mpunct:{mord:Cf,mop:Cf,mrel:pR,mopen:Cf,mclose:Cf,mpunct:Cf,minner:Cf},minner:{mord:Cf,mop:Cf,mbin:M5,mrel:pR,mopen:Cf,mpunct:Cf,minner:Cf}};vyi={mord:{mop:Cf},mop:{mord:Cf,mop:Cf},mbin:{},mrel:{},mopen:{},mclose:{mop:Cf},mpunct:{},minner:{mop:Cf}};osn={};Lwe={};Dwe={};Fwe=function e(t){return t.type==="ordgroup"&&t.body.length===1?t.body[0]:t};jh=function e(t){return t.type==="ordgroup"?t.body:[t]};_yi=new Set(["leftmost","mbin","mopen","mrel","mop","mpunct"]);Tyi=new Set(["rightmost","mrel","mclose","mpunct"]);wyi={"display":Ds.DISPLAY,"text":Ds.TEXT,"script":Ds.SCRIPT,"scriptscript":Ds.SCRIPTSCRIPT};Eyi={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"};Lp=function e(t,n,r,i){if(i===void 0){i=[null,null]}var o=[];for(var a=0;a{var w=x.classes[0];var _=g.classes[0];if(w==="mbin"&&Tyi.has(_)){x.classes[0]="mord"}else if(_==="mbin"&&_yi.has(w)){g.classes[0]="mord"}},{node:f},h,m);jqe(o,(g,x)=>{var w,_;var C=Zqe(x);var A=Zqe(g);var P=C&&A?g.hasClass("mtight")?(w=vyi[C])==null?void 0:w[A]:(_=xyi[C])==null?void 0:_[A]:null;if(P){return nsn(P,u)}},{node:f},h,m);return o};jqe=function e(t,n,r,i,o){if(i){t.push(i)}var a=0;for(;ah=>{t.splice(f+1,0,h);a++})(a)}if(i){t.pop()}};asn=function e(t){if(t instanceof rL||t instanceof e$||t instanceof oL&&t.hasClass("enclosing")){return t}return null};Kqe=function e(t,n){var r=asn(t);if(r){var i=r.children;if(i.length){if(n==="right"){return Kqe(i[i.length-1],"right")}else if(n==="left"){return Kqe(i[0],"left")}}}return t};Zqe=function e(t,n){if(!t){return null}if(n){t=Kqe(t,n)}var r=t.classes[0];return Eyi[r]||null};qQ=function e(t,n){var r=["nulldelimiter"].concat(t.baseSizingClasses());return Ni(n.concat(r))};Hc=function e(t,n,r){if(!t){return Ni()}if(Lwe[t.type]){var i=Lwe[t.type](t,n);if(r&&n.size!==r.size){i=Ni(n.sizingClasses(r),[i],n);var o=n.sizeMultiplier/r.sizeMultiplier;i.height*=o;i.depth*=o}return i}else{throw new Xi("Got group of unknown type: '"+t.type+"'")}};Hi=class{constructor(t,n,r){this.type=void 0;this.attributes=void 0;this.children=void 0;this.classes=void 0;this.type=t;this.attributes={};this.children=n||[];this.classes=r||[]}setAttribute(t,n){this.attributes[t]=n}getAttribute(t){return this.attributes[t]}toNode(){var t=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var n in this.attributes){if(Object.prototype.hasOwnProperty.call(this.attributes,n)){t.setAttribute(n,this.attributes[n])}}if(this.classes.length>0){t.className=iL(this.classes)}for(var r=0;r0){t+=' class ="'+Uy(iL(this.classes))+'"'}t+=">";for(var r=0;r";return t}toText(){return this.children.map(t=>t.toText()).join("")}};Hf=class{constructor(t){this.text=void 0;this.text=t}toNode(){return document.createTextNode(this.text)}toMarkup(){return Uy(this.toText())}toText(){return this.text}};Nwe=class{constructor(t){this.width=void 0;this.character=void 0;this.width=t;if(t>=.05555&&t<=.05556){this.character="\u200A"}else if(t>=.1666&&t<=.1667){this.character="\u2009"}else if(t>=.2222&&t<=.2223){this.character="\u2005"}else if(t>=.2777&&t<=.2778){this.character="\u2005\u200A"}else if(t>=-.05556&&t<=-.05555){this.character="\u200A\u2063"}else if(t>=-.1667&&t<=-.1666){this.character="\u2009\u2063"}else if(t>=-.2223&&t<=-.2222){this.character="\u205F\u2063"}else if(t>=-.2778&&t<=-.2777){this.character="\u2005\u2063"}else{this.character=null}}toNode(){if(this.character){return document.createTextNode(this.character)}else{var t=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");t.setAttribute("width",to(this.width));return t}}toMarkup(){if(this.character){return""+this.character+""}else{return''}}toText(){if(this.character){return this.character}else{return" "}}};Cyi=new Set(["\\imath","\\jmath"]);Syi=new Set(["mrow","mtable"]);k_=function e(t,n,r){if(tf[n][t]&&tf[n][t].replace&&t.charCodeAt(0)!==55349&&!(esn.hasOwnProperty(t)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))){t=tf[n][t].replace}return new Hf(t)};dXe=function e(t){if(t.length===1){return t[0]}else{return new Hi("mrow",t)}};Ayi={mathit:"italic",boldsymbol:e=>e.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"};fXe=(e,t)=>{if(e.mode==="text"){if(t.fontFamily==="texttt"){return"monospace"}else if(t.fontFamily==="textsf"){if(t.fontShape==="textit"&&t.fontWeight==="textbf"){return"sans-serif-bold-italic"}else if(t.fontShape==="textit"){return"sans-serif-italic"}else if(t.fontWeight==="textbf"){return"bold-sans-serif"}else{return"sans-serif"}}else if(t.fontShape==="textit"&&t.fontWeight==="textbf"){return"bold-italic"}else if(t.fontShape==="textit"){return"italic"}else if(t.fontWeight==="textbf"){return"bold"}}var n=t.font;if(!n||n==="mathnormal"){return null}var r=e.mode;var i=Ayi[n];if(i){return typeof i==="function"?i(e):i}var o=e.text;if(Cyi.has(o)){return null}if(tf[r][o]){var a=tf[r][o].replace;if(a){o=a}}var s=Xqe[n].fontName;if(lXe(o,s,r)){return Xqe[n].variant}return null};ev=function e(t,n,r){if(t.length===1){var i=Wu(t[0],n);if(r&&i instanceof Hi&&i.type==="mo"){i.setAttribute("lspace","0em");i.setAttribute("rspace","0em")}return[i]}var o=[];var a;for(var s=0;s=1&&(a.type==="mn"||Rqe(a))){var u=l.children[0];if(u instanceof Hi&&u.type==="mn"){u.children=[...a.children,...u.children];o.pop()}}else if(a.type==="mi"&&a.children.length===1){var d=a.children[0];if(d instanceof Hf&&d.text==="\u0338"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var f=l.children[0];if(f instanceof Hf&&f.text.length>0){f.text=f.text.slice(0,1)+"\u0338"+f.text.slice(1);o.pop()}}}}o.push(l);a=l}return o};sL=function e(t,n,r){return dXe(ev(t,n,r))};Wu=function e(t,n){if(!t){return new Hi("mrow")}if(Dwe[t.type]){return Dwe[t.type](t,n)}else{throw new Xi("Got group of unknown type: '"+t.type+"'")}};kyi=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]];Can=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488];San=function e(t,n){return n.size<2?t:kyi[t-1][n.size-1]};Owe=class e{constructor(t){this.style=void 0;this.color=void 0;this.size=void 0;this.textSize=void 0;this.phantom=void 0;this.font=void 0;this.fontFamily=void 0;this.fontWeight=void 0;this.fontShape=void 0;this.sizeMultiplier=void 0;this.maxSize=void 0;this.minRuleThickness=void 0;this._fontMetrics=void 0;this.style=t.style;this.color=t.color;this.size=t.size||e.BASESIZE;this.textSize=t.textSize||this.size;this.phantom=!!t.phantom;this.font=t.font||"";this.fontFamily=t.fontFamily||"";this.fontWeight=t.fontWeight||"";this.fontShape=t.fontShape||"";this.sizeMultiplier=Can[this.size-1];this.maxSize=t.maxSize;this.minRuleThickness=t.minRuleThickness;this._fontMetrics=void 0}extend(t){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};Object.assign(n,t);return new e(n)}havingStyle(t){if(this.style===t){return this}else{return this.extend({style:t,size:San(this.textSize,t)})}}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(t){if(this.size===t&&this.textSize===t){return this}else{return this.extend({style:this.style.text(),size:t,textSize:t,sizeMultiplier:Can[t-1]})}}havingBaseStyle(t){t=t||this.style.text();var n=San(e.BASESIZE,t);if(this.size===n&&this.textSize===e.BASESIZE&&this.style===t){return this}else{return this.extend({style:t,size:n})}}havingBaseSizing(){var t;switch(this.style.id){case 4:case 5:t=3;break;case 6:case 7:t=1;break;default:t=6}return this.extend({style:this.style.text(),size:t})}withColor(t){return this.extend({color:t})}withPhantom(){return this.extend({phantom:true})}withFont(t){return this.extend({font:t})}withTextFontFamily(t){return this.extend({fontFamily:t,font:""})}withTextFontWeight(t){return this.extend({fontWeight:t,font:""})}withTextFontShape(t){return this.extend({fontShape:t,font:""})}sizingClasses(t){if(t.size!==this.size){return["sizing","reset-size"+t.size,"size"+this.size]}else{return[]}}baseSizingClasses(){if(this.size!==e.BASESIZE){return["sizing","reset-size"+this.size,"size"+e.BASESIZE]}else{return[]}}fontMetrics(){if(!this._fontMetrics){this._fontMetrics=dyi(this.size)}return this._fontMetrics}getColor(){if(this.phantom){return"transparent"}else{return this.color}}};Owe.BASESIZE=6;lsn=function e(t){return new Owe({style:t.displayMode?Ds.DISPLAY:Ds.TEXT,maxSize:t.maxSize,minRuleThickness:t.minRuleThickness})};csn=function e(t,n){if(n.displayMode){var r=["katex-display"];if(n.leqno){r.push("leqno")}if(n.fleqn){r.push("fleqn")}t=Ni(r,[t])}return t};Ryi=function e(t,n,r){var i=lsn(r);var o;if(r.output==="mathml"){return Ean(t,n,i,r.displayMode,true)}else if(r.output==="html"){var a=Jqe(t,i);o=Ni(["katex"],[a])}else{var s=Ean(t,n,i,r.displayMode,false);var l=Jqe(t,i);o=Ni(["katex"],[s,l])}return csn(o,r)};Pyi=function e(t,n,r){var i=lsn(r);var o=Jqe(t,i);var a=Ni(["katex"],[o]);return csn(a,r)};Iyi={widehat:"^",widecheck:"\u02C7",widetilde:"~",utilde:"~",overleftarrow:"\u2190",underleftarrow:"\u2190",xleftarrow:"\u2190",overrightarrow:"\u2192",underrightarrow:"\u2192",xrightarrow:"\u2192",underbrace:"\u23DF",overbrace:"\u23DE",underbracket:"\u23B5",overbracket:"\u23B4",overgroup:"\u23E0",undergroup:"\u23E1",overleftrightarrow:"\u2194",underleftrightarrow:"\u2194",xleftrightarrow:"\u2194",Overrightarrow:"\u21D2",xRightarrow:"\u21D2",overleftharpoon:"\u21BC",xleftharpoonup:"\u21BC",overrightharpoon:"\u21C0",xrightharpoonup:"\u21C0",xLeftarrow:"\u21D0",xLeftrightarrow:"\u21D4",xhookleftarrow:"\u21A9",xhookrightarrow:"\u21AA",xmapsto:"\u21A6",xrightharpoondown:"\u21C1",xleftharpoondown:"\u21BD",xrightleftharpoons:"\u21CC",xleftrightharpoons:"\u21CB",xtwoheadleftarrow:"\u219E",xtwoheadrightarrow:"\u21A0",xlongequal:"=",xtofrom:"\u21C4",xrightleftarrows:"\u21C4",xrightequilibrium:"\u21CC",xleftequilibrium:"\u21CB","\\cdrightarrow":"\u2192","\\cdleftarrow":"\u2190","\\cdlongequal":"="};$we=function e(t){var n=new Hi("mo",[new Hf(Iyi[t.replace(/^\\/,"")])]);n.setAttribute("stretchy","true");return n};Myi={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]};Lyi=new Set(["widehat","widecheck","widetilde","utilde"]);Gwe=function e(t,n){function r(){var s=4e5;var l=t.label.slice(1);if(Lyi.has(l)&&"base"in t){var u=t.base.type==="ordgroup"?t.base.body.length:1;var d;var f;var h;if(u>5){if(l==="widehat"||l==="widecheck"){d=420;s=2364;h=.42;f=l+"4"}else{d=312;s=2340;h=.34;f="tilde4"}}else{var m=[1,1,2,2,3,3][u];if(l==="widehat"||l==="widecheck"){s=[0,1062,2364,2364,2364][m];d=[0,239,300,360,420][m];h=[0,.24,.3,.3,.36,.42][m];f=l+m}else{s=[0,600,1033,2339,2340][m];d=[0,260,286,306,312][m];h=[0,.26,.286,.3,.306,.34][m];f="tilde"+m}}var g=new IC(f);var x=new Tw([g],{"width":"100%","height":to(h),"viewBox":"0 0 "+s+" "+d,"preserveAspectRatio":"none"});return{span:aL([],[x],n),minWidth:0,height:h}}else{var w=[];var _=Myi[l];if(!_){throw new Error('No SVG data for "'+l+'".')}var[C,A,P]=_;var L=P/1e3;var I=C.length;var N;var O;if(I===1){if(_.length!==4){throw new Error('Expected 4-tuple for single-path SVG data "'+l+'".')}N=["hide-tail"];O=[_[3]]}else if(I===2){N=["halfarrow-left","halfarrow-right"];O=["xMinYMin","xMaxYMin"]}else if(I===3){N=["brace-left","brace-center","brace-right"];O=["xMinYMin","xMidYMin","xMaxYMin"]}else{throw new Error("Correct katexImagesData or update code here to support\n "+I+" children.")}for(var z=0;z0){i.style.minWidth=to(o)}return i};Dyi=function e(t,n,r,i,o){var a;var s=t.height+t.depth+r+i;if(/fbox|color|angl/.test(n)){a=Ni(["stretchy",n],[],o);if(n==="fbox"){var l=o.color&&o.getColor();if(l){a.style.borderColor=l}}}else{var u=[];if(/^[bx]cancel$/.test(n)){u.push(new YQ({"x1":"0","y1":"0","x2":"100%","y2":"100%","stroke-width":"0.046em"}))}if(/^x?cancel$/.test(n)){u.push(new YQ({"x1":"0","y1":"100%","x2":"100%","y2":"0","stroke-width":"0.046em"}))}var d=new Tw(u,{"width":"100%","height":to(s)});a=aL([],[d],o)}a.height=s;a.style.height=to(s);return a};Fyi={"bin":1,"close":1,"inner":1,"open":1,"punct":1,"rel":1};Nyi={"accent-token":1,"mathord":1,"op-token":1,"spacing":1,"textord":1};usn=e=>{if(e instanceof W0){return e}if(uyi(e)&&e.children.length===1){return usn(e.children[0])}};hXe=(e,t)=>{var n;var r;var i;if(e&&e.type==="supsub"){r=Xs(e.base,"accent");n=r.base;e.base=n;i=cyi(Hc(e,t));e.base=r}else{r=Xs(e,"accent");n=r.base}var o=Hc(n,t.havingCrampedStyle());var a=r.isShifty&&gR(n);var s=0;if(a){var l,u;s=(l=(u=usn(o))==null?void 0:u.skew)!=null?l:0}var d=r.label==="\\c";var f=d?o.height+o.depth:Math.min(o.height,t.fontMetrics().xHeight);var h;if(!r.isStretchy){var m;var g;if(r.label==="\\vec"){m=isn("vec",t);g=rsn.vec[1]}else{m=Vwe({type:"textord",mode:r.mode,text:r.label},t,"textord");m=lyi(m);m.italic=0;g=m.width;if(d){f+=m.depth}}h=Ni(["accent-body"],[m]);var x=r.label==="\\textcircled";if(x){h.classes.push("accent-full");f=o.height}var w=s;if(!x){w-=g/2}h.style.left=to(w);if(r.label==="\\textcircled"){h.style.top=".2em"}h=Gc({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"kern",size:-f},{type:"elem",elem:h}]})}else{h=Gwe(r,t);h=Gc({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"elem",elem:h,wrapperClasses:["svg-align"],wrapperStyle:s>0?{width:"calc(100% - "+to(2*s)+")",marginLeft:to(2*s)}:void 0}]})}var _=Ni(["mord","accent"],[h],t);if(i){i.children[0]=_;i.height=Math.max(_.height,i.height);i.classes[0]="mord";return i}else{return _}};dsn=(e,t)=>{var n=e.isStretchy?$we(e.label):new Hi("mo",[k_(e.label,e.mode)]);var r=new Hi("mover",[Wu(e.base,t),n]);r.setAttribute("accent","true");return r};Byi=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));Co({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{var n=Fwe(t[0]);var r=!Byi.test(e.funcName);var i=!r||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:hXe,mathmlBuilder:dsn});Co({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:true,allowedInMath:true,argTypes:["primitive"]},handler:(e,t)=>{var n=t[0];var r=e.parser.mode;if(r==="math"){e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode");r="text"}return{type:"accent",mode:r,label:e.funcName,isStretchy:false,isShifty:true,base:n}},htmlBuilder:hXe,mathmlBuilder:dsn});Co({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e;var i=t[0];return{type:"accentUnder",mode:n.mode,label:r,base:i}},htmlBuilder:(e,t)=>{var n=Hc(e.base,t);var r=Gwe(e,t);var i=e.label==="\\utilde"?.12:0;var o=Gc({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:n}]});return Ni(["mord","accentunder"],[o],t)},mathmlBuilder:(e,t)=>{var n=$we(e.label);var r=new Hi("munder",[Wu(e.base,t),n]);r.setAttribute("accentunder","true");return r}});Cwe=e=>{var t=new Hi("mpadded",e?[e]:[]);t.setAttribute("width","+0.6em");t.setAttribute("lspace","0.3em");return t};Co({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r,funcName:i}=e;return{type:"xArrow",mode:r.mode,label:i,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style;var r=t.havingStyle(n.sup());var i=n$(Hc(e.body,r,t),t);var o=e.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(o+"-arrow-pad");var a;if(e.below){r=t.havingStyle(n.sub());a=n$(Hc(e.below,r,t),t);a.classes.push(o+"-arrow-pad")}var s=Gwe(e,t);var l=-t.fontMetrics().axisHeight+.5*s.height;var u=-t.fontMetrics().axisHeight-.5*s.height-.111;if(i.depth>.25||e.label==="\\xleftequilibrium"){u-=i.depth}var d;if(a){var f=-t.fontMetrics().axisHeight+a.height+.5*s.height+.111;d=Gc({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:s,shift:l,wrapperClasses:["svg-align"]},{type:"elem",elem:a,shift:f}]})}else{d=Gc({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:s,shift:l,wrapperClasses:["svg-align"]}]})}return Ni(["mrel","x-arrow"],[d],t)},mathmlBuilder(e,t){var n=$we(e.label);n.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(e.body){var i=Cwe(Wu(e.body,t));if(e.below){var o=Cwe(Wu(e.below,t));r=new Hi("munderover",[n,o,i])}else{r=new Hi("mover",[n,i])}}else if(e.below){var a=Cwe(Wu(e.below,t));r=new Hi("munder",[n,a])}else{r=Cwe();r=new Hi("mover",[n,r])}return r}});Co({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:true},handler(e,t){var{parser:n,funcName:r}=e;var i=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:jh(i),isCharacterBox:gR(i)}},htmlBuilder:fsn,mathmlBuilder:hsn});Ywe=e=>{var t=e.type==="ordgroup"&&e.body.length?e.body[0]:e;if(t.type==="atom"&&(t.family==="bin"||t.family==="rel")){return"m"+t.family}else{return"mord"}};Co({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:Ywe(t[0]),body:jh(t[1]),isCharacterBox:gR(t[1])}}});Co({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var{parser:n,funcName:r}=e;var i=t[1];var o=t[0];var a;if(r!=="\\stackrel"){a=Ywe(i)}else{a="mrel"}var s={type:"op",mode:i.mode,limits:true,alwaysHandleSupSub:true,parentIsSupSub:false,symbol:false,suppressBaseShift:r!=="\\stackrel",body:jh(i)};var l={type:"supsub",mode:o.mode,base:s,sup:r==="\\underset"?null:o,sub:r==="\\underset"?o:null};return{type:"mclass",mode:n.mode,mclass:a,body:[l],isCharacterBox:gR(l)}},htmlBuilder:fsn,mathmlBuilder:hsn});Co({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:true},handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:Ywe(t[0]),body:jh(t[0])}},htmlBuilder(e,t){var n=Lp(e.body,t,true);var r=Ni([e.mclass],n,t);r.style.textShadow="0.02em 0.01em 0.04px";return r},mathmlBuilder(e,t){var n=ev(e.body,t);var r=new Hi("mstyle",n);r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px");return r}});zyi={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal","A":"\\uparrow","V":"\\downarrow","|":"\\Vert",".":"no arrow"};Aan=()=>{return{type:"styling",body:[],mode:"math",style:"display",resetFont:true}};kan=e=>{return e.type==="textord"&&e.text==="@"};Uyi=(e,t)=>{return(e.type==="mathord"||e.type==="atom")&&e.text===t};Co({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup());var r=n$(Hc(e.label,n,t),t);r.classes.push("cd-label-"+e.side);r.style.bottom=to(.8-r.depth);r.height=0;r.depth=0;return r},mathmlBuilder(e,t){var n=new Hi("mrow",[Wu(e.label,t)]);n=new Hi("mpadded",[n]);n.setAttribute("width","0");if(e.side==="left"){n.setAttribute("lspace","-1width")}n.setAttribute("voffset","0.7em");n=new Hi("mstyle",[n]);n.setAttribute("displaystyle","false");n.setAttribute("scriptlevel","1");return n}});Co({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=n$(Hc(e.fragment,t),t);n.classes.push("cd-vert-arrow");return n},mathmlBuilder(e,t){return new Hi("mrow",[Wu(e.fragment,t)])}});Co({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:true},handler(e,t){var{parser:n}=e;var r=Xs(t[0],"ordgroup");var i=r.body;var o="";for(var a=0;a=1114111){throw new Xi("\\@char with invalid code point "+o)}else if(l<=65535){u=String.fromCharCode(l)}else{l-=65536;u=String.fromCharCode((l>>10)+55296,(l&1023)+56320)}return{type:"textord",mode:n.mode,text:u}}});psn=(e,t)=>{var n=Lp(e.body,t.withColor(e.color),false);return bR(n)};msn=(e,t)=>{var n=ev(e.body,t.withColor(e.color));var r=new Hi("mstyle",n);r.setAttribute("mathcolor",e.color);return r};Co({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:true,argTypes:["color","original"]},handler(e,t){var{parser:n}=e;var r=Xs(t[0],"color-token").color;var i=t[1];return{type:"color",mode:n.mode,color:r,body:jh(i)}},htmlBuilder:psn,mathmlBuilder:msn});Co({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:true,argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:r}=e;var i=Xs(t[0],"color-token").color;n.gullet.macros.set("\\current@color",i);var o=n.parseExpression(true,r);return{type:"color",mode:n.mode,color:i,body:o}},htmlBuilder:psn,mathmlBuilder:msn});Co({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:true},handler(e,t,n){var{parser:r}=e;var i=r.gullet.future().text==="["?r.parseSizeGroup(true):null;var o=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:o,size:i&&Xs(i,"size").value}},htmlBuilder(e,t){var n=Ni(["mspace"],[],t);if(e.newLine){n.classes.push("newline");if(e.size){n.style.marginTop=to(Sf(e.size,t))}}return n},mathmlBuilder(e,t){var n=new Hi("mspace");if(e.newLine){n.setAttribute("linebreak","newline");if(e.size){n.setAttribute("height",to(Sf(e.size,t)))}}return n}});Qqe={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"};gsn=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t)){throw new Xi("Expected a control sequence",e)}return t};Gyi=e=>{var t=e.gullet.popToken();if(t.text==="="){t=e.gullet.popToken();if(t.text===" "){t=e.gullet.popToken()}}return t};ysn=(e,t,n,r)=>{var i=e.gullet.macros.get(n.text);if(i==null){n.noexpand=true;i={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}}e.gullet.macros.set(t,i,r)};Co({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:true},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(Qqe[r.text]){if(n==="\\global"||n==="\\\\globallong"){r.text=Qqe[r.text]}return Xs(t.parseFunction(),"internal")}throw new Xi("Invalid token after macro prefix",r)}});Co({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:true,primitive:true},handler(e){var{parser:t,funcName:n}=e;var r=t.gullet.popToken();var i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i)){throw new Xi("Expected a control sequence",r)}var o=0;var a;var s=[[]];while(t.gullet.future().text!=="{"){r=t.gullet.popToken();if(r.text==="#"){if(t.gullet.future().text==="{"){a=t.gullet.future();s[o].push("{");break}r=t.gullet.popToken();if(!/^[1-9]$/.test(r.text)){throw new Xi('Invalid argument number "'+r.text+'"')}if(parseInt(r.text)!==o+1){throw new Xi('Argument number "'+r.text+'" out of order')}o++;s.push([])}else if(r.text==="EOF"){throw new Xi("Expected a macro definition")}else{s[o].push(r.text)}}var{tokens:l}=t.gullet.consumeArg();if(a){l.unshift(a)}if(n==="\\edef"||n==="\\xdef"){l=t.gullet.expandTokens(l);l.reverse()}t.gullet.macros.set(i,{tokens:l,numArgs:o,delimiters:s},n===Qqe[n]);return{type:"internal",mode:t.mode}}});Co({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:true,primitive:true},handler(e){var{parser:t,funcName:n}=e;var r=gsn(t.gullet.popToken());t.gullet.consumeSpaces();var i=Gyi(t);ysn(t,r,i,n==="\\\\globallet");return{type:"internal",mode:t.mode}}});Co({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:true,primitive:true},handler(e){var{parser:t,funcName:n}=e;var r=gsn(t.gullet.popToken());var i=t.gullet.popToken();var o=t.gullet.popToken();ysn(t,r,o,n==="\\\\globalfuture");t.gullet.pushToken(o);t.gullet.pushToken(i);return{type:"internal",mode:t.mode}}});$Q=function e(t,n,r){var i=tf.math[t]&&tf.math[t].replace;var o=lXe(i||t,n,r);if(!o){throw new Error("Unsupported symbol "+t+" and font size "+n+".")}return o};pXe=function e(t,n,r,i){var o=r.havingBaseStyle(n);var a=Ni(i.concat(o.sizingClasses(r)),[t],r);var s=o.sizeMultiplier/r.sizeMultiplier;a.height*=s;a.depth*=s;a.maxFontSize=o.sizeMultiplier;return a};bsn=function e(t,n,r){var i=n.havingBaseStyle(r);var o=(1-n.sizeMultiplier/i.sizeMultiplier)*n.fontMetrics().axisHeight;t.classes.push("delimcenter");t.style.top=to(o);t.height-=o;t.depth+=o};Hyi=function e(t,n,r,i,o,a){var s=G0(t,"Main-Regular",o,i);var l=pXe(s,n,i,a);if(r){bsn(l,i,n)}return l};Wyi=function e(t,n,r,i){return G0(t,"Size"+n+"-Regular",r,i)};xsn=function e(t,n,r,i,o,a){var s=Wyi(t,n,o,i);var l=pXe(Ni(["delimsizing","size"+n],[s],i),Ds.TEXT,i,a);if(r){bsn(l,i,Ds.TEXT)}return l};Pqe=function e(t,n,r){var i;if(n==="Size1-Regular"){i="delim-size1"}else{i="delim-size4"}var o=Ni(["delimsizinginner",i],[Ni([],[G0(t,n,r)])]);return{type:"elem",elem:o}};Iqe=function e(t,n,r){var i=PC["Size4-Regular"][t.charCodeAt(0)]?PC["Size4-Regular"][t.charCodeAt(0)][4]:PC["Size1-Regular"][t.charCodeAt(0)][4];var o=new IC("inner",nyi(t,Math.round(1e3*n)));var a=new Tw([o],{"width":to(i),"height":to(n),"style":"width:"+to(i),"viewBox":"0 0 "+1e3*i+" "+Math.round(1e3*n),"preserveAspectRatio":"xMinYMin"});var s=aL([],[a],r);s.height=n;s.style.height=to(n);s.style.width=to(i);return{type:"elem",elem:s}};eXe=.008;Swe={type:"kern",size:-1*eXe};Yyi=new Set(["|","\\lvert","\\rvert","\\vert"]);qyi=new Set(["\\|","\\lVert","\\rVert","\\Vert"]);vsn=function e(t,n,r,i,o,a){var s;var l;var u;var d;var f="";var h=0;s=u=d=t;l=null;var m="Size1-Regular";if(t==="\\uparrow"){u=d="\u23D0"}else if(t==="\\Uparrow"){u=d="\u2016"}else if(t==="\\downarrow"){s=u="\u23D0"}else if(t==="\\Downarrow"){s=u="\u2016"}else if(t==="\\updownarrow"){s="\\uparrow";u="\u23D0";d="\\downarrow"}else if(t==="\\Updownarrow"){s="\\Uparrow";u="\u2016";d="\\Downarrow"}else if(Yyi.has(t)){u="\u2223";f="vert";h=333}else if(qyi.has(t)){u="\u2225";f="doublevert";h=556}else if(t==="["||t==="\\lbrack"){s="\u23A1";u="\u23A2";d="\u23A3";m="Size4-Regular";f="lbrack";h=667}else if(t==="]"||t==="\\rbrack"){s="\u23A4";u="\u23A5";d="\u23A6";m="Size4-Regular";f="rbrack";h=667}else if(t==="\\lfloor"||t==="\u230A"){u=s="\u23A2";d="\u23A3";m="Size4-Regular";f="lfloor";h=667}else if(t==="\\lceil"||t==="\u2308"){s="\u23A1";u=d="\u23A2";m="Size4-Regular";f="lceil";h=667}else if(t==="\\rfloor"||t==="\u230B"){u=s="\u23A5";d="\u23A6";m="Size4-Regular";f="rfloor";h=667}else if(t==="\\rceil"||t==="\u2309"){s="\u23A4";u=d="\u23A5";m="Size4-Regular";f="rceil";h=667}else if(t==="("||t==="\\lparen"){s="\u239B";u="\u239C";d="\u239D";m="Size4-Regular";f="lparen";h=875}else if(t===")"||t==="\\rparen"){s="\u239E";u="\u239F";d="\u23A0";m="Size4-Regular";f="rparen";h=875}else if(t==="\\{"||t==="\\lbrace"){s="\u23A7";l="\u23A8";d="\u23A9";u="\u23AA";m="Size4-Regular"}else if(t==="\\}"||t==="\\rbrace"){s="\u23AB";l="\u23AC";d="\u23AD";u="\u23AA";m="Size4-Regular"}else if(t==="\\lgroup"||t==="\u27EE"){s="\u23A7";d="\u23A9";u="\u23AA";m="Size4-Regular"}else if(t==="\\rgroup"||t==="\u27EF"){s="\u23AB";d="\u23AD";u="\u23AA";m="Size4-Regular"}else if(t==="\\lmoustache"||t==="\u23B0"){s="\u23A7";d="\u23AD";u="\u23AA";m="Size4-Regular"}else if(t==="\\rmoustache"||t==="\u23B1"){s="\u23AB";d="\u23A9";u="\u23AA";m="Size4-Regular"}var g=$Q(s,m,o);var x=g.height+g.depth;var w=$Q(u,m,o);var _=w.height+w.depth;var C=$Q(d,m,o);var A=C.height+C.depth;var P=0;var L=1;if(l!==null){var I=$Q(l,m,o);P=I.height+I.depth;L=2}var N=x+A+P;var O=Math.max(0,Math.ceil((n-N)/(L*_)));var z=N+O*L*_;var U=i.fontMetrics().axisHeight;if(r){U*=i.sizeMultiplier}var W=z/2-U;var H=[];if(f.length>0){var $=z-x-A;var K=Math.round(z*1e3);var X=ryi(f,Math.round($*1e3));var j=new IC(f,X);var te=to(h/1e3);var J=to(K/1e3);var oe=new Tw([j],{"width":te,"height":J,"viewBox":"0 0 "+h+" "+K});var se=aL([],[oe],i);se.height=K/1e3;se.style.width=te;se.style.height=J;H.push({type:"elem",elem:se})}else{H.push(Pqe(d,m,o));H.push(Swe);if(l===null){var re=z-x-A+2*eXe;H.push(Iqe(u,re,i))}else{var ce=(z-x-A-P)/2+2*eXe;H.push(Iqe(u,ce,i));H.push(Swe);H.push(Pqe(l,m,o));H.push(Swe);H.push(Iqe(u,ce,i))}H.push(Swe);H.push(Pqe(s,m,o))}var ue=i.havingBaseStyle(Ds.TEXT);var xe=Gc({positionType:"bottom",positionData:W,children:H});return pXe(Ni(["delimsizing","mult"],[xe],ue),Ds.TEXT,i,a)};Mqe=80;Lqe=.08;Dqe=function e(t,n,r,i,o){var a=tyi(t,i,r);var s=new IC(t,a);var l=new Tw([s],{"width":"400em","height":to(n),"viewBox":"0 0 400000 "+r,"preserveAspectRatio":"xMinYMin slice"});return aL(["hide-tail"],[l],o)};Xyi=function e(t,n){var r=n.havingBaseSizing();var i=Csn("\\surd",t*r.sizeMultiplier,Esn,r);var o=r.sizeMultiplier;var a=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness);var s;var l;var u;var d;var f;if(i.type==="small"){d=1e3+1e3*a+Mqe;if(t<1){o=1}else if(t<1.4){o=.7}l=(1+a+Lqe)/o;u=(1+a)/o;s=Dqe("sqrtMain",l,d,a,n);s.style.minWidth="0.853em";f=.833/o}else if(i.type==="large"){d=(1e3+Mqe)*GQ[i.size];u=(GQ[i.size]+a)/o;l=(GQ[i.size]+a+Lqe)/o;s=Dqe("sqrtSize"+i.size,l,d,a,n);s.style.minWidth="1.02em";f=1/o}else{l=t+a+Lqe;u=t+a;d=Math.floor(1e3*t+a)+Mqe;s=Dqe("sqrtTall",l,d,a,n);s.style.minWidth="0.742em";f=1.056}s.height=u;s.style.height=to(l);return{span:s,advanceWidth:f,ruleWidth:(n.fontMetrics().sqrtRuleThickness+a)*o}};_sn=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230A","\u230B","\\lceil","\\rceil","\u2308","\u2309","\\surd"]);jyi=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27EE","\u27EF","\\lmoustache","\\rmoustache","\u23B0","\u23B1"]);Tsn=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]);GQ=[0,1.2,1.8,2.4,3];wsn=function e(t,n,r,i,o){if(t==="<"||t==="\\lt"||t==="\u27E8"){t="\\langle"}else if(t===">"||t==="\\gt"||t==="\u27E9"){t="\\rangle"}if(_sn.has(t)||Tsn.has(t)){return xsn(t,n,false,r,i,o)}else if(jyi.has(t)){return vsn(t,GQ[n],false,r,i,o)}else{throw new Xi("Illegal delimiter: '"+t+"'")}};Kyi=[{type:"small",style:Ds.SCRIPTSCRIPT},{type:"small",style:Ds.SCRIPT},{type:"small",style:Ds.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}];Zyi=[{type:"small",style:Ds.SCRIPTSCRIPT},{type:"small",style:Ds.SCRIPT},{type:"small",style:Ds.TEXT},{type:"stack"}];Esn=[{type:"small",style:Ds.SCRIPTSCRIPT},{type:"small",style:Ds.SCRIPT},{type:"small",style:Ds.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];Jyi=function e(t){if(t.type==="small"){return"Main-Regular"}else if(t.type==="large"){return"Size"+t.size+"-Regular"}else if(t.type==="stack"){return"Size4-Regular"}else{var n=t.type;throw new Error("Add support for delim type '"+n+"' here.")}};Csn=function e(t,n,r,i){var o=Math.min(2,3-i.style.size);for(var a=o;an){return s}}return r[r.length-1]};tXe=function e(t,n,r,i,o,a){if(t==="<"||t==="\\lt"||t==="\u27E8"){t="\\langle"}else if(t===">"||t==="\\gt"||t==="\u27E9"){t="\\rangle"}var s;if(Tsn.has(t)){s=Kyi}else if(_sn.has(t)){s=Esn}else{s=Zyi}var l=Csn(t,n,s,i);if(l.type==="small"){return Hyi(t,l.style,r,i,o,a)}else if(l.type==="large"){return xsn(t,l.size,r,i,o,a)}else{return vsn(t,n,r,i,o,a)}};Fqe=function e(t,n,r,i,o,a){var s=i.fontMetrics().axisHeight*i.sizeMultiplier;var l=901;var u=5/i.fontMetrics().ptPerEm;var d=Math.max(n-s,r+s);var f=Math.max(d/500*l,2*d-u);return tXe(t,f,true,i,o,a)};Ran={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};Qyi=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230A","\u230B","\\lceil","\\rceil","\u2308","\u2309","<",">","\\langle","\u27E8","\\rangle","\u27E9","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27EE","\u27EF","\\lmoustache","\\rmoustache","\u23B0","\u23B1","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);Co({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{var n=qwe(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:Ran[e.funcName].size,mclass:Ran[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>{if(e.delim==="."){return Ni([e.mclass])}return wsn(e.delim,e.size,t,e.mode,[e.mclass])},mathmlBuilder:e=>{var t=[];if(e.delim!=="."){t.push(k_(e.delim,e.mode))}var n=new Hi("mo",t);if(e.mclass==="mopen"||e.mclass==="mclose"){n.setAttribute("fence","true")}else{n.setAttribute("fence","false")}n.setAttribute("stretchy","true");var r=to(GQ[e.size]);n.setAttribute("minsize",r);n.setAttribute("maxsize",r);return n}});Co({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:true},handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&typeof n!=="string"){throw new Xi("\\current@color set to non-string in \\right")}return{type:"leftright-right",mode:e.parser.mode,delim:qwe(t[0],e).text,color:n}}});Co({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:true},handler:(e,t)=>{var n=qwe(t[0],e);var r=e.parser;++r.leftrightDepth;var i=r.parseExpression(false);--r.leftrightDepth;r.expect("\\right",false);var o=Xs(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:i,left:n.text,right:o.delim,rightColor:o.color}},htmlBuilder:(e,t)=>{Ian(e);var n=Lp(e.body,t,true,["mopen","mclose"]);var r=0;var i=0;var o=false;for(var a=0;a{Ian(e);var n=ev(e.body,t);if(e.left!=="."){var r=new Hi("mo",[k_(e.left,e.mode)]);r.setAttribute("fence","true");n.unshift(r)}if(e.right!=="."){var i=new Hi("mo",[k_(e.right,e.mode)]);i.setAttribute("fence","true");if(e.rightColor){i.setAttribute("mathcolor",e.rightColor)}n.push(i)}return dXe(n)}});Co({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:true},handler:(e,t)=>{var n=qwe(t[0],e);if(!e.parser.leftrightDepth){throw new Xi("\\middle without preceding \\left",n)}return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;if(e.delim==="."){n=qQ(t,[])}else{n=wsn(e.delim,1,t,e.mode,[]);n.isMiddle={delim:e.delim,options:t}}return n},mathmlBuilder:(e,t)=>{var n=e.delim==="\\vert"||e.delim==="|"?k_("|","text"):k_(e.delim,e.mode);var r=new Hi("mo",[n]);r.setAttribute("fence","true");r.setAttribute("lspace","0.05em");r.setAttribute("rspace","0.05em");return r}});Xwe=(e,t)=>{var n=n$(Hc(e.body,t),t);var r=e.label.slice(1);var i=t.sizeMultiplier;var o;var a;var s=gR(e.body);if(r==="sout"){o=Ni(["stretchy","sout"]);o.height=t.fontMetrics().defaultRuleThickness/i;a=-.5*t.fontMetrics().xHeight}else if(r==="phase"){var l=Sf({number:.6,unit:"pt"},t);var u=Sf({number:.35,unit:"ex"},t);var d=t.havingBaseSizing();i=i/d.sizeMultiplier;var f=n.height+n.depth+l+u;n.style.paddingLeft=to(f/2+l);var h=Math.floor(1e3*f*i);var m=Qgi(h);var g=new Tw([new IC("phase",m)],{"width":"400em","height":to(h/1e3),"viewBox":"0 0 400000 "+h,"preserveAspectRatio":"xMinYMin slice"});o=aL(["hide-tail"],[g],t);o.style.height=to(f);a=n.depth+l+u}else{if(/cancel/.test(r)){if(!s){n.classes.push("cancel-pad")}}else if(r==="angl"){n.classes.push("anglpad")}else{n.classes.push("boxpad")}var x;var w;var _=0;if(/box/.test(r)){_=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);x=t.fontMetrics().fboxsep+(r==="colorbox"?0:_);w=x}else if(r==="angl"){_=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness);x=4*_;w=Math.max(0,.25-n.depth)}else{x=s?.2:0;w=x}o=Dyi(n,r,x,w,t);if(/fbox|boxed|fcolorbox/.test(r)){o.style.borderStyle="solid";o.style.borderWidth=to(_)}else if(r==="angl"&&_!==.049){o.style.borderTopWidth=to(_);o.style.borderRightWidth=to(_)}a=n.depth+w;if(e.backgroundColor){o.style.backgroundColor=e.backgroundColor;if(e.borderColor){o.style.borderColor=e.borderColor}}}var C;if(e.backgroundColor){C=Gc({positionType:"individualShift",children:[{type:"elem",elem:o,shift:a},{type:"elem",elem:n,shift:0}]})}else{var A=/cancel|phase/.test(r)?["svg-align"]:[];C=Gc({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:o,shift:a,wrapperClasses:A}]})}if(/cancel/.test(r)){C.height=n.height;C.depth=n.depth}if(/cancel/.test(r)&&!s){return Ni(["mord","cancel-lap"],[C],t)}else{return Ni(["mord"],[C],t)}};jwe=(e,t)=>{var n;var r=new Hi(e.label.includes("colorbox")?"mpadded":"menclose",[Wu(e.body,t)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm;r.setAttribute("width","+"+2*n+"pt");r.setAttribute("height","+"+2*n+"pt");r.setAttribute("lspace",n+"pt");r.setAttribute("voffset",n+"pt");if(e.label==="\\fcolorbox"){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute("style","border: "+to(i)+" solid "+e.borderColor)}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}if(e.backgroundColor){r.setAttribute("mathbackground",e.backgroundColor)}return r};Co({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:true,argTypes:["color","hbox"]},handler(e,t,n){var{parser:r,funcName:i}=e;var o=Xs(t[0],"color-token").color;var a=t[1];return{type:"enclose",mode:r.mode,label:i,backgroundColor:o,body:a}},htmlBuilder:Xwe,mathmlBuilder:jwe});Co({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:true,argTypes:["color","color","hbox"]},handler(e,t,n){var{parser:r,funcName:i}=e;var o=Xs(t[0],"color-token").color;var a=Xs(t[1],"color-token").color;var s=t[2];return{type:"enclose",mode:r.mode,label:i,backgroundColor:a,borderColor:o,body:s}},htmlBuilder:Xwe,mathmlBuilder:jwe});Co({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:true},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}});Co({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;var i=t[0];return{type:"enclose",mode:n.mode,label:r,body:i}},htmlBuilder:Xwe,mathmlBuilder:jwe});Co({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:true},handler(e,t){var{parser:n,funcName:r}=e;if(n.mode==="math"){n.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode")}var i=t[0];return{type:"enclose",mode:n.mode,label:r,body:i}},htmlBuilder:Xwe,mathmlBuilder:jwe});Co({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:false},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});Ssn={};Asn={};dx=class e{constructor(t,n,r){this.lexer=void 0;this.start=void 0;this.end=void 0;this.lexer=t;this.start=n;this.end=r}static range(t,n){if(!n){return t&&t.loc}else if(!t||!t.loc||!n.loc||t.loc.lexer!==n.loc.lexer){return null}else{return new e(t.loc.lexer,t.loc.start,n.loc.end)}}};J1=class e{constructor(t,n){this.text=void 0;this.loc=void 0;this.noexpand=void 0;this.treatAsRelax=void 0;this.text=t;this.loc=n}range(t,n){return new e(n,dx.range(this,t))}};Kwe=e=>{var t=e.parser.settings;if(!t.displayMode){throw new Xi("{"+e.envName+"} can be used only in display mode.")}};e0i=new Set(["gather","gather*"]);LC=function e(t,n){var r;var i;var o=t.body.length;var a=t.hLinesBeforeRow;var s=0;var l=new Array(o);var u=[];var d=Math.max(n.fontMetrics().arrayRuleWidth,n.minRuleThickness);var f=1/n.fontMetrics().ptPerEm;var h=5*f;if(t.colSeparationType&&t.colSeparationType==="small"){var m=n.havingStyle(Ds.SCRIPT).sizeMultiplier;h=.2778*(m/n.sizeMultiplier)}var g=t.colSeparationType==="CD"?Sf({number:3,unit:"ex"},n):12*f;var x=3*f;var w=t.arraystretch*g;var _=.7*w;var C=.3*w;var A=0;function P(Qe){for(var ze=0;ze0){A+=.25}u.push({pos:A,isDashed:Qe[ze]})}}P(a[0]);for(r=0;r0){W+=C;if(NQe)){for(r=0;r=s){continue}var ge=void 0;if(i>0||t.hskipBeforeAndAfter){var Ve,Le;ge=(Ve=(Le=ue)==null?void 0:Le.pregap)!=null?Ve:h;if(ge!==0){X=Ni(["arraycolsep"],[]);X.style.width=to(ge);K.push(X)}}var $e=[];for(r=0;r0){var He=t$("hline",n,d);var Je=t$("hdashline",n,d);var Te=[{type:"elem",elem:bt,shift:0}];while(u.length>0){var we=u.pop();var Ze=we.pos-H;if(we.isDashed){Te.push({type:"elem",elem:Je,shift:Ze})}else{Te.push({type:"elem",elem:He,shift:Ze})}}bt=Gc({positionType:"individualShift",children:Te})}if(te.length===0){return Ni(["mord"],[bt],n)}else{var Be=Gc({positionType:"individualShift",children:te});var qe=Ni(["tag"],[Be],n);return bR([bt,qe])}};t0i={c:"center ",l:"left ",r:"right "};DC=function e(t,n){var r=[];var i=new Hi("mtd",[],["mtr-glue"]);var o=new Hi("mtd",[],["mml-eqn-num"]);for(var a=0;a0){var g=t.cols;var x="";var w=false;var _=0;var C=g.length;if(g[0].type==="separator"){h+="top ";_=1}if(g[g.length-1].type==="separator"){h+="bottom ";C-=1}for(var A=_;A0?"left ":"";h+=z[z.length-1].length>0?"right ":"";for(var U=1;U0&&m){w=1}r[g]={type:"align",align:x,pregap:w,postgap:0}}a.colSeparationType=m?"align":"alignat";return a};MC({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=Wwe(t[0]);var r=n?[t[0]]:Xs(t[0],"ordgroup").body;var i=r.map(function(a){var s=Hwe(a);var l=s.text;if("lcr".includes(l)){return{type:"align",align:l}}else if(l==="|"){return{type:"separator",separator:"|"}}else if(l===":"){return{type:"separator",separator:":"}}throw new Xi("Unknown column alignment: "+l,a)});var o={cols:i,hskipBeforeAndAfter:true,maxNumCols:i.length};return lL(e.parser,o,gXe(e.envName))},htmlBuilder:LC,mathmlBuilder:DC});MC({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={"matrix":null,"pmatrix":["(",")"],"bmatrix":["[","]"],"Bmatrix":["\\{","\\}"],"vmatrix":["|","|"],"Vmatrix":["\\Vert","\\Vert"]}[e.envName.replace("*","")];var n="c";var r={hskipBeforeAndAfter:false,cols:[{type:"align",align:n}]};if(e.envName.charAt(e.envName.length-1)==="*"){var i=e.parser;i.consumeSpaces();if(i.fetch().text==="["){i.consume();i.consumeSpaces();n=i.fetch().text;if(!"lcr".includes(n)){throw new Xi("Expected l or c or r",i.nextToken)}i.consume();i.consumeSpaces();i.expect("]");i.consume();r.cols=[{type:"align",align:n}]}}var o=lL(e.parser,r,gXe(e.envName));var a=Math.max(0,...o.body.map(s=>s.length));o.cols=new Array(a).fill({type:"align",align:n});return t?{type:"leftright",mode:e.mode,body:[o],left:t[0],right:t[1],rightColor:void 0}:o},htmlBuilder:LC,mathmlBuilder:DC});MC({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t={arraystretch:.5};var n=lL(e.parser,t,"script");n.colSeparationType="small";return n},htmlBuilder:LC,mathmlBuilder:DC});MC({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=Wwe(t[0]);var r=n?[t[0]]:Xs(t[0],"ordgroup").body;var i=r.map(function(s){var l=Hwe(s);var u=l.text;if("lc".includes(u)){return{type:"align",align:u}}throw new Xi("Unknown column alignment: "+u,s)});if(i.length>1){throw new Xi("{subarray} can contain only one column")}var o={cols:i,hskipBeforeAndAfter:false,arraystretch:.5};var a=lL(e.parser,o,"script");if(a.body.length>0&&a.body[0].length>1){throw new Xi("{subarray} can contain only one column")}return a},htmlBuilder:LC,mathmlBuilder:DC});MC({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]};var n=lL(e.parser,t,gXe(e.envName));return{type:"leftright",mode:e.mode,body:[n],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:LC,mathmlBuilder:DC});MC({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:ksn,htmlBuilder:LC,mathmlBuilder:DC});MC({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){if(e0i.has(e.envName)){Kwe(e)}var t={cols:[{type:"align",align:"c"}],addJot:true,colSeparationType:"gather",autoTag:mXe(e.envName),emptySingleRow:true,leqno:e.parser.settings.leqno};return lL(e.parser,t,"display")},htmlBuilder:LC,mathmlBuilder:DC});MC({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:ksn,htmlBuilder:LC,mathmlBuilder:DC});MC({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Kwe(e);var t={autoTag:mXe(e.envName),emptySingleRow:true,singleRow:true,maxNumCols:1,leqno:e.parser.settings.leqno};return lL(e.parser,t,"display")},htmlBuilder:LC,mathmlBuilder:DC});MC({type:"array",names:["CD"],props:{numArgs:0},handler(e){Kwe(e);return $yi(e.parser)},htmlBuilder:LC,mathmlBuilder:DC});dn("\\nonumber","\\gdef\\@eqnsw{0}");dn("\\notag","\\nonumber");Co({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:true,allowedInMath:true},handler(e,t){throw new Xi(e.funcName+" valid only within array environment")}});Lan=Ssn;Co({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){var{parser:n,funcName:r}=e;var i=t[0];if(i.type!=="ordgroup"){throw new Xi("Invalid environment name",i)}var o="";for(var a=0;a{var n=e.font;var r=t.withFont(n);return Hc(e.body,r)};Psn=(e,t)=>{var n=e.font;var r=t.withFont(n);return Wu(e.body,r)};Dan={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};Co({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:true},handler:(e,t)=>{var{parser:n,funcName:r}=e;var i=Fwe(t[0]);var o=r;if(o in Dan){o=Dan[o]}return{type:"font",mode:n.mode,font:o.slice(1),body:i}},htmlBuilder:Rsn,mathmlBuilder:Psn});Co({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e;var r=t[0];return{type:"mclass",mode:n.mode,mclass:Ywe(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:gR(r)}}});Co({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:true},handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:i}=e;var{mode:o}=n;var a=n.parseExpression(true,i);return{type:"font",mode:o,font:"math"+r.slice(1),body:{type:"ordgroup",mode:n.mode,body:a}}},htmlBuilder:Rsn,mathmlBuilder:Psn});n0i=(e,t)=>{var n=t.style;var r=n.fracNum();var i=n.fracDen();var o;o=t.havingStyle(r);var a=Hc(e.numer,o,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm;var l=3.5/t.fontMetrics().ptPerEm;a.height=a.height0){g=3*h}else{g=7*h}x=t.fontMetrics().denom1}else{if(f>0){m=t.fontMetrics().num2;g=h}else{m=t.fontMetrics().num3;g=3*h}x=t.fontMetrics().denom2}var w;if(!d){var _=m-a.depth-(u.height-x);if(_{var n=new Hi("mfrac",[Wu(e.numer,t),Wu(e.denom,t)]);if(!e.hasBarLine){n.setAttribute("linethickness","0px")}else if(e.barSize){var r=Sf(e.barSize,t);n.setAttribute("linethickness",to(r))}if(e.leftDelim!=null||e.rightDelim!=null){var i=[];if(e.leftDelim!=null){var o=new Hi("mo",[new Hf(e.leftDelim.replace("\\",""))]);o.setAttribute("fence","true");i.push(o)}i.push(n);if(e.rightDelim!=null){var a=new Hi("mo",[new Hf(e.rightDelim.replace("\\",""))]);a.setAttribute("fence","true");i.push(a)}return dXe(i)}return n};Isn=(e,t)=>{if(!t){return e}var n={type:"styling",mode:e.mode,style:t,body:[e]};return n};Co({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:true},handler:(e,t)=>{var{parser:n,funcName:r}=e;var i=t[0];var o=t[1];var a;var s=null;var l=null;switch(r){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":a=true;break;case"\\\\atopfrac":a=false;break;case"\\dbinom":case"\\binom":case"\\tbinom":a=false;s="(";l=")";break;case"\\\\bracefrac":a=false;s="\\{";l="\\}";break;case"\\\\brackfrac":a=false;s="[";l="]";break;default:throw new Error("Unrecognized genfrac command")}var u=r==="\\cfrac";var d=null;if(u||r.startsWith("\\d")){d="display"}else if(r.startsWith("\\t")){d="text"}return Isn({type:"genfrac",mode:n.mode,numer:i,denom:o,continued:u,hasBarLine:a,leftDelim:s,rightDelim:l,barSize:null},d)},htmlBuilder:n0i,mathmlBuilder:r0i});Co({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:true},handler(e){var{parser:t,funcName:n,token:r}=e;var i;switch(n){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:t.mode,replaceWith:i,token:r}}});Fan=["display","text","script","scriptscript"];Nan=function e(t){var n=null;if(t.length>0){n=t;n=n==="."?null:n}return n};Co({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:true,argTypes:["math","math","size","text","math","math"]},handler(e,t){var{parser:n}=e;var r=t[4];var i=t[5];var o=Fwe(t[0]);var a=o.type==="atom"&&o.family==="open"?Nan(o.text):null;var s=Fwe(t[1]);var l=s.type==="atom"&&s.family==="close"?Nan(s.text):null;var u=Xs(t[2],"size");var d;var f=null;if(u.isBlank){d=true}else{f=u.value;d=f.number>0}var h=null;var m=t[3];if(m.type==="ordgroup"){if(m.body.length>0){var g=Xs(m.body[0],"textord");h=Fan[Number(g.text)]}}else{m=Xs(m,"textord");h=Fan[Number(m.text)]}return Isn({type:"genfrac",mode:n.mode,numer:r,denom:i,continued:false,hasBarLine:d,barSize:f,leftDelim:a,rightDelim:l},h)}});Co({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:true},handler(e,t){var{parser:n,funcName:r,token:i}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:Xs(t[0],"size").value,token:i}}});Co({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:n,funcName:r}=e;var i=t[0];var o=Xs(t[1],"infix").size;if(!o){throw new Error("\\\\abovefrac expected size, but got "+String(o))}var a=t[2];var s=o.number>0;return{type:"genfrac",mode:n.mode,numer:i,denom:a,continued:false,hasBarLine:s,barSize:o,leftDelim:null,rightDelim:null}}});Msn=(e,t)=>{var n=t.style;var r;var i;if(e.type==="supsub"){r=e.sup?Hc(e.sup,t.havingStyle(n.sup()),t):Hc(e.sub,t.havingStyle(n.sub()),t);i=Xs(e.base,"horizBrace")}else{i=Xs(e,"horizBrace")}var o=Hc(i.base,t.havingBaseStyle(Ds.DISPLAY));var a=Gwe(i,t);var s;if(i.isOver){s=Gc({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:a,wrapperClasses:["svg-align"]}]})}else{s=Gc({positionType:"bottom",positionData:o.depth+.1+a.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:o}]})}if(r){var l=Ni(["minner",i.isOver?"mover":"munder"],[s],t);if(i.isOver){s=Gc({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:r}]})}else{s=Gc({positionType:"bottom",positionData:l.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:l}]})}}return Ni(["minner",i.isOver?"mover":"munder"],[s],t)};i0i=(e,t)=>{var n=$we(e.label);return new Hi(e.isOver?"mover":"munder",[Wu(e.base,t),n])};Co({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"horizBrace",mode:n.mode,label:r,isOver:r.includes("\\over"),base:t[0]}},htmlBuilder:Msn,mathmlBuilder:i0i});Co({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:true},handler:(e,t)=>{var{parser:n}=e;var r=t[1];var i=Xs(t[0],"url").url;if(!n.settings.isTrusted({command:"\\href",url:i})){return n.formatUnsupportedCmd("\\href")}return{type:"href",mode:n.mode,href:i,body:jh(r)}},htmlBuilder:(e,t)=>{var n=Lp(e.body,t,false);return yyi(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=sL(e.body,t);if(!(n instanceof Hi)){n=new Hi("mrow",[n])}n.setAttribute("href",e.href);return n}});Co({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:true},handler:(e,t)=>{var{parser:n}=e;var r=Xs(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r})){return n.formatUnsupportedCmd("\\url")}var i=[];for(var o=0;o{var{parser:n,funcName:r,token:i}=e;var o=Xs(t[0],"raw").string;var a=t[1];if(n.settings.strict){n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode")}var s;var l={};switch(r){case"\\htmlClass":l.class=o;s={command:"\\htmlClass",class:o};break;case"\\htmlId":l.id=o;s={command:"\\htmlId",id:o};break;case"\\htmlStyle":l.style=o;s={command:"\\htmlStyle",style:o};break;case"\\htmlData":{var u=o.split(",");for(var d=0;d{var n=Lp(e.body,t,false);var r=["enclosing"];if(e.attributes.class){r.push(...e.attributes.class.trim().split(/\s+/))}var i=Ni(r,n,t);for(var o in e.attributes){if(o!=="class"&&e.attributes.hasOwnProperty(o)){i.setAttribute(o,e.attributes[o])}}return i},mathmlBuilder:(e,t)=>{return sL(e.body,t)}});Co({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:true,allowedInText:true},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:jh(t[0]),mathml:jh(t[1])}},htmlBuilder:(e,t)=>{var n=Lp(e.html,t,false);return bR(n)},mathmlBuilder:(e,t)=>{return sL(e.mathml,t)}});Nqe=function e(t){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(t)){return{number:+t,unit:"bp"}}else{var n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t);if(!n){throw new Xi("Invalid size: '"+t+"' in \\includegraphics")}var r={number:+(n[1]+n[2]),unit:n[3]};if(!jan(r)){throw new Xi("Invalid unit: '"+r.unit+"' in \\includegraphics.")}return r}};Co({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:false},handler:(e,t,n)=>{var{parser:r}=e;var i={number:0,unit:"em"};var o={number:.9,unit:"em"};var a={number:0,unit:"em"};var s="";if(n[0]){var l=Xs(n[0],"raw").string;var u=l.split(",");for(var d=0;d{var n=Sf(e.height,t);var r=0;if(e.totalheight.number>0){r=Sf(e.totalheight,t)-n}var i=0;if(e.width.number>0){i=Sf(e.width,t)}var o={height:to(n+r)};if(i>0){o.width=to(i)}if(r>0){o.verticalAlign=to(-r)}var a=new $qe(e.src,e.alt,o);a.height=n;a.depth=r;return a},mathmlBuilder:(e,t)=>{var n=new Hi("mglyph",[]);n.setAttribute("alt",e.alt);var r=Sf(e.height,t);var i=0;if(e.totalheight.number>0){i=Sf(e.totalheight,t)-r;n.setAttribute("valign",to(-i))}n.setAttribute("height",to(r+i));if(e.width.number>0){var o=Sf(e.width,t);n.setAttribute("width",to(o))}n.setAttribute("src",e.src);return n}});Co({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:true,allowedInText:true},handler(e,t){var{parser:n,funcName:r}=e;var i=Xs(t[0],"size");if(n.settings.strict){var o=r[1]==="m";var a=i.value.unit==="mu";if(o){if(!a){n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+i.value.unit+" units"))}if(n.mode!=="math"){n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")}}else{if(a){n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}}}return{type:"kern",mode:n.mode,dimension:i.value}},htmlBuilder(e,t){return nsn(e.dimension,t)},mathmlBuilder(e,t){var n=Sf(e.dimension,t);return new Nwe(n)}});Co({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:true},handler:(e,t)=>{var{parser:n,funcName:r}=e;var i=t[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(e,t)=>{var n;if(e.alignment==="clap"){n=Ni([],[Hc(e.body,t)]);n=Ni(["inner"],[n],t)}else{n=Ni(["inner"],[Hc(e.body,t)])}var r=Ni(["fix"],[]);var i=Ni([e.alignment],[n,r],t);var o=Ni(["strut"]);o.style.height=to(i.height+i.depth);if(i.depth){o.style.verticalAlign=to(-i.depth)}i.children.unshift(o);i=Ni(["thinbox"],[i],t);return Ni(["mord","vbox"],[i],t)},mathmlBuilder:(e,t)=>{var n=new Hi("mpadded",[Wu(e.body,t)]);if(e.alignment!=="rlap"){var r=e.alignment==="llap"?"-1":"-0.5";n.setAttribute("lspace",r+"width")}n.setAttribute("width","0px");return n}});Co({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:true,allowedInMath:false},handler(e,t){var{funcName:n,parser:r}=e;var i=r.mode;r.switchMode("math");var o=n==="\\("?"\\)":"$";var a=r.parseExpression(false,o);r.expect(o);r.switchMode(i);return{type:"styling",mode:r.mode,style:"text",resetFont:true,body:a}}});Co({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:true,allowedInMath:false},handler(e,t){throw new Xi("Mismatched "+e.funcName)}});Oan=(e,t)=>{switch(t.style.size){case Ds.DISPLAY.size:return e.display;case Ds.TEXT.size:return e.text;case Ds.SCRIPT.size:return e.script;case Ds.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Co({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:true},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:jh(t[0]),text:jh(t[1]),script:jh(t[2]),scriptscript:jh(t[3])}},htmlBuilder:(e,t)=>{var n=Oan(e,t);var r=Lp(n,t,false);return bR(r)},mathmlBuilder:(e,t)=>{var n=Oan(e,t);return sL(n,t)}});Lsn=(e,t,n,r,i,o,a)=>{e=Ni([],[e]);var s=n&&gR(n);var l;var u;if(t){var d=Hc(t,r.havingStyle(i.sup()),r);u={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-d.depth)}}if(n){var f=Hc(n,r.havingStyle(i.sub()),r);l={elem:f,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-f.height)}}var h;if(u&&l){var m=r.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+e.depth+a;h=Gc({positionType:"bottom",positionData:m,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:to(-o)},{type:"kern",size:l.kern},{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:to(o)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else if(l){var g=e.height-a;h=Gc({positionType:"top",positionData:g,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:to(-o)},{type:"kern",size:l.kern},{type:"elem",elem:e}]})}else if(u){var x=e.depth+a;h=Gc({positionType:"bottom",positionData:x,children:[{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:to(o)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else{return e}var w=[h];if(l&&o!==0&&!s){var _=Ni(["mspace"],[],r);_.style.marginRight=to(o);w.unshift(_)}return Ni(["mop","op-limits"],w,r)};Dsn=new Set(["\\smallint"]);i$=(e,t)=>{var n;var r;var i=false;var o;if(e.type==="supsub"){n=e.sup;r=e.sub;o=Xs(e.base,"op");i=true}else{o=Xs(e,"op")}var a=t.style;var s=false;if(a.size===Ds.DISPLAY.size&&o.symbol&&!Dsn.has(o.name)){s=true}var l;var u;if(o.symbol){var d=s?"Size2-Regular":"Size1-Regular";var f="";if(o.name==="\\oiint"||o.name==="\\oiiint"){f=o.name.slice(1);o.name=f==="oiint"?"\\iint":"\\iiint"}l=G0(o.name,d,"math",t,["mop","op-symbol",s?"large-op":"small-op"]);u=l.italic;if(f.length>0){var h=isn(f+"Size"+(s?"2":"1"),t);l=Gc({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:h,shift:s?.08:0}]});o.name="\\"+f;l.classes.unshift("mop");l.italic=u}}else if(o.body){var m=Lp(o.body,t,true);if(m.length===1&&m[0]instanceof W0){l=m[0];l.classes[0]="mop"}else{l=Ni(["mop"],m,t)}}else{var g=[];for(var x=1;x{var n;if(e.symbol){n=new Hi("mo",[k_(e.name,e.mode)]);if(Dsn.has(e.name)){n.setAttribute("largeop","false")}}else if(e.body){n=new Hi("mo",ev(e.body,t))}else{n=new Hi("mi",[new Hf(e.name.slice(1))]);var r=new Hi("mo",[k_("\u2061","text")]);if(e.parentIsSupSub){n=new Hi("mrow",[n,r])}else{n=ssn([n,r])}}return n};o0i={"\u220F":"\\prod","\u2210":"\\coprod","\u2211":"\\sum","\u22C0":"\\bigwedge","\u22C1":"\\bigvee","\u22C2":"\\bigcap","\u22C3":"\\bigcup","\u2A00":"\\bigodot","\u2A01":"\\bigoplus","\u2A02":"\\bigotimes","\u2A04":"\\biguplus","\u2A06":"\\bigsqcup"};Co({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\u220F","\u2210","\u2211","\u22C0","\u22C1","\u22C2","\u22C3","\u2A00","\u2A01","\u2A02","\u2A04","\u2A06"],props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:r}=e;var i=r;if(i.length===1){i=o0i[i]}return{type:"op",mode:n.mode,limits:true,parentIsSupSub:false,symbol:true,name:i}},htmlBuilder:i$,mathmlBuilder:jQ});Co({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:true},handler:(e,t)=>{var{parser:n}=e;var r=t[0];return{type:"op",mode:n.mode,limits:false,parentIsSupSub:false,symbol:false,body:jh(r)}},htmlBuilder:i$,mathmlBuilder:jQ});a0i={"\u222B":"\\int","\u222C":"\\iint","\u222D":"\\iiint","\u222E":"\\oint","\u222F":"\\oiint","\u2230":"\\oiiint"};Co({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:false,parentIsSupSub:false,symbol:false,name:n}},htmlBuilder:i$,mathmlBuilder:jQ});Co({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:true,parentIsSupSub:false,symbol:false,name:n}},htmlBuilder:i$,mathmlBuilder:jQ});Co({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\u222B","\u222C","\u222D","\u222E","\u222F","\u2230"],props:{numArgs:0,allowedInArgument:true},handler(e){var{parser:t,funcName:n}=e;var r=n;if(r.length===1){r=a0i[r]}return{type:"op",mode:t.mode,limits:false,parentIsSupSub:false,symbol:true,name:r}},htmlBuilder:i$,mathmlBuilder:jQ});Fsn=(e,t)=>{var n;var r;var i=false;var o;if(e.type==="supsub"){n=e.sup;r=e.sub;o=Xs(e.base,"operatorname");i=true}else{o=Xs(e,"operatorname")}var a;if(o.body.length>0){var s=o.body.map(f=>{var h="text"in f?f.text:void 0;if(typeof h==="string"){return{type:"textord",mode:f.mode,text:h}}else{return f}});var l=Lp(s,t.withFont("mathrm"),true);for(var u=0;u{var n=ev(e.body,t.withFont("mathrm"));var r=true;for(var i=0;id.toText()).join("");n=[new Hf(s)]}var l=new Hi("mi",n);l.setAttribute("mathvariant","normal");var u=new Hi("mo",[k_("\u2061","text")]);if(e.parentIsSupSub){return new Hi("mrow",[l,u])}else{return ssn([l,u])}};Co({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e;var i=t[0];return{type:"operatorname",mode:n.mode,body:jh(i),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:false,parentIsSupSub:false}},htmlBuilder:Fsn,mathmlBuilder:s0i});dn("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");D5({type:"ordgroup",htmlBuilder(e,t){if(e.semisimple){return bR(Lp(e.body,t,false))}return Ni(["mord"],Lp(e.body,t,true),t)},mathmlBuilder(e,t){return sL(e.body,t,true)}});Co({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e;var r=t[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(e,t){var n=Hc(e.body,t.havingCrampedStyle());var r=t$("overline-line",t);var i=t.fontMetrics().defaultRuleThickness;var o=Gc({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r},{type:"kern",size:i}]});return Ni(["mord","overline"],[o],t)},mathmlBuilder(e,t){var n=new Hi("mo",[new Hf("\u203E")]);n.setAttribute("stretchy","true");var r=new Hi("mover",[Wu(e.body,t),n]);r.setAttribute("accent","true");return r}});Co({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:true},handler:(e,t)=>{var{parser:n}=e;var r=t[0];return{type:"phantom",mode:n.mode,body:jh(r)}},htmlBuilder:(e,t)=>{var n=Lp(e.body,t.withPhantom(),false);return bR(n)},mathmlBuilder:(e,t)=>{var n=ev(e.body,t);return new Hi("mphantom",n)}});dn("\\hphantom","\\smash{\\phantom{#1}}");Co({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:true},handler:(e,t)=>{var{parser:n}=e;var r=t[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=Ni(["inner"],[Hc(e.body,t.withPhantom())]);var r=Ni(["fix"],[]);return Ni(["mord","rlap"],[n,r],t)},mathmlBuilder:(e,t)=>{var n=ev(jh(e.body),t);var r=new Hi("mphantom",n);var i=new Hi("mpadded",[r]);i.setAttribute("width","0px");return i}});Co({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:true},handler(e,t){var{parser:n}=e;var r=Xs(t[0],"size").value;var i=t[1];return{type:"raisebox",mode:n.mode,dy:r,body:i}},htmlBuilder(e,t){var n=Hc(e.body,t);var r=Sf(e.dy,t);return Gc({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new Hi("mpadded",[Wu(e.body,t)]);var r=e.dy.number+e.dy.unit;n.setAttribute("voffset",r);return n}});Co({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:true,allowedInArgument:true},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}});Co({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:true,allowedInMath:true,argTypes:["size","size","size"]},handler(e,t,n){var{parser:r}=e;var i=n[0];var o=Xs(t[0],"size");var a=Xs(t[1],"size");return{type:"rule",mode:r.mode,shift:i&&Xs(i,"size").value,width:o.value,height:a.value}},htmlBuilder(e,t){var n=Ni(["mord","rule"],[],t);var r=Sf(e.width,t);var i=Sf(e.height,t);var o=e.shift?Sf(e.shift,t):0;n.style.borderRightWidth=to(r);n.style.borderTopWidth=to(i);n.style.bottom=to(o);n.width=r;n.height=i+o;n.depth=-o;n.maxFontSize=i*1.125*t.sizeMultiplier;return n},mathmlBuilder(e,t){var n=Sf(e.width,t);var r=Sf(e.height,t);var i=e.shift?Sf(e.shift,t):0;var o=t.color&&t.getColor()||"black";var a=new Hi("mspace");a.setAttribute("mathbackground",o);a.setAttribute("width",to(n));a.setAttribute("height",to(r));var s=new Hi("mpadded",[a]);if(i>=0){s.setAttribute("height",to(i))}else{s.setAttribute("height",to(i));s.setAttribute("depth",to(-i))}s.setAttribute("voffset",to(i));return s}});Ban=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"];l0i=(e,t)=>{var n=t.havingSize(e.size);return Nsn(e.body,n,t)};Co({type:"sizing",names:Ban,props:{numArgs:0,allowedInText:true},handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:i}=e;var o=i.parseExpression(false,n);return{type:"sizing",mode:i.mode,size:Ban.indexOf(r)+1,body:o}},htmlBuilder:l0i,mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size);var r=ev(e.body,n);var i=new Hi("mstyle",r);i.setAttribute("mathsize",to(n.sizeMultiplier));return i}});Co({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:true},handler:(e,t,n)=>{var{parser:r}=e;var i=false;var o=false;var a=n[0]&&Xs(n[0],"ordgroup");if(a){var s;for(var l=0;l{var n=Ni([],[Hc(e.body,t)]);if(!e.smashHeight&&!e.smashDepth){return n}if(e.smashHeight){n.height=0}if(e.smashDepth){n.depth=0}if(e.smashHeight&&e.smashDepth){return Ni(["mord","smash"],[n],t)}if(n.children){for(var r=0;r{var n=new Hi("mpadded",[Wu(e.body,t)]);if(e.smashHeight){n.setAttribute("height","0px")}if(e.smashDepth){n.setAttribute("depth","0px")}return n}});Co({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r}=e;var i=n[0];var o=t[0];return{type:"sqrt",mode:r.mode,body:o,index:i}},htmlBuilder(e,t){var n=Hc(e.body,t.havingCrampedStyle());if(n.height===0){n.height=t.fontMetrics().xHeight}n=n$(n,t);var r=t.fontMetrics();var i=r.defaultRuleThickness;var o=i;if(t.style.idn.height+n.depth+a){a=(a+f-n.height-n.depth)/2}var h=l.height-n.height-a-u;n.style.paddingLeft=to(d);var m=Gc({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+h)},{type:"elem",elem:l},{type:"kern",size:u}]});if(!e.index){return Ni(["mord","sqrt"],[m],t)}else{var g=t.havingStyle(Ds.SCRIPTSCRIPT);var x=Hc(e.index,g,t);var w=.6*(m.height-m.depth);var _=Gc({positionType:"shift",positionData:-w,children:[{type:"elem",elem:x}]});var C=Ni(["root"],[_]);return Ni(["mord","sqrt"],[C,m],t)}},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new Hi("mroot",[Wu(n,t),Wu(r,t)]):new Hi("msqrt",[Wu(n,t)])}});nXe={"display":Ds.DISPLAY,"text":Ds.TEXT,"script":Ds.SCRIPT,"scriptscript":Ds.SCRIPTSCRIPT};Co({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:true,primitive:true},handler(e,t){var{breakOnTokenText:n,funcName:r,parser:i}=e;var o=i.parseExpression(true,n);var a=r.slice(1,r.length-5);if(!c0i(a)){throw new Error("Unknown style: "+a)}return{type:"styling",mode:i.mode,style:a,body:o}},htmlBuilder(e,t){var n=nXe[e.style];var r=t.havingStyle(n);if(e.resetFont){r=r.withFont("")}return Nsn(e.body,r,t)},mathmlBuilder(e,t){var n=nXe[e.style];var r=t.havingStyle(n);if(e.resetFont){r=r.withFont("")}var i=ev(e.body,r);var o=new Hi("mstyle",i);var a={"display":["0","true"],"text":["0","false"],"script":["1","false"],"scriptscript":["2","false"]};var s=a[e.style];o.setAttribute("scriptlevel",s[0]);o.setAttribute("displaystyle",s[1]);return o}});u0i=function e(t,n){var r=t.base;if(!r){return null}else if(r.type==="op"){var i=r.limits&&(n.style.size===Ds.DISPLAY.size||r.alwaysHandleSupSub);return i?i$:null}else if(r.type==="operatorname"){var o=r.alwaysHandleSupSub&&(n.style.size===Ds.DISPLAY.size||r.limits);return o?Fsn:null}else if(r.type==="accent"){return gR(r.base)?hXe:null}else if(r.type==="horizBrace"){var a=!t.sub;return a===r.isOver?Msn:null}else{return null}};D5({type:"supsub",htmlBuilder(e,t){var n=u0i(e,t);if(n){return n(e,t)}var{base:r,sup:i,sub:o}=e;var a=Hc(r,t);var s;var l;var u=t.fontMetrics();var d=0;var f=0;var h=r&&gR(r);if(i){var m=t.havingStyle(t.style.sup());s=Hc(i,m,t);if(!h){d=a.height-m.fontMetrics().supDrop*m.sizeMultiplier/t.sizeMultiplier}}if(o){var g=t.havingStyle(t.style.sub());l=Hc(o,g,t);if(!h){f=a.depth+g.fontMetrics().subDrop*g.sizeMultiplier/t.sizeMultiplier}}var x;if(t.style===Ds.DISPLAY){x=u.sup1}else if(t.style.cramped){x=u.sup3}else{x=u.sup2}var w=t.sizeMultiplier;var _=to(.5/u.ptPerEm/w);var C=null;if(l){var A=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");if(a instanceof W0||A){var P;C=to(-((P=a.italic)!=null?P:0))}}var L;if(s&&l){d=Math.max(d,x,s.depth+.25*u.xHeight);f=Math.max(f,u.sub2);var I=u.defaultRuleThickness;var N=4*I;if(d-s.depth-(l.height-f)0){d+=O;f-=O}}var z=[{type:"elem",elem:l,shift:f,marginRight:_,marginLeft:C},{type:"elem",elem:s,shift:-d,marginRight:_}];L=Gc({positionType:"individualShift",children:z})}else if(l){f=Math.max(f,u.sub1,l.height-.8*u.xHeight);var U=[{type:"elem",elem:l,marginLeft:C,marginRight:_}];L=Gc({positionType:"shift",positionData:f,children:U})}else if(s){d=Math.max(d,x,s.depth+.25*u.xHeight);L=Gc({positionType:"shift",positionData:-d,children:[{type:"elem",elem:s,marginRight:_}]})}else{throw new Error("supsub must have either sup or sub.")}var W=Zqe(a,"right")||"mord";return Ni([W],[a,Ni(["msupsub"],[L])],t)},mathmlBuilder(e,t){var n=false;var r;var i;if(e.base&&e.base.type==="horizBrace"){i=!!e.sup;if(i===e.base.isOver){n=true;r=e.base.isOver}}if(e.base&&(e.base.type==="op"||e.base.type==="operatorname")){e.base.parentIsSupSub=true}var o=[Wu(e.base,t)];if(e.sub){o.push(Wu(e.sub,t))}if(e.sup){o.push(Wu(e.sup,t))}var a;if(n){a=r?"mover":"munder"}else if(!e.sub){var s=e.base;if(s&&s.type==="op"&&s.limits&&(t.style===Ds.DISPLAY||s.alwaysHandleSupSub)){a="mover"}else if(s&&s.type==="operatorname"&&s.alwaysHandleSupSub&&(s.limits||t.style===Ds.DISPLAY)){a="mover"}else{a="msup"}}else if(!e.sup){var l=e.base;if(l&&l.type==="op"&&l.limits&&(t.style===Ds.DISPLAY||l.alwaysHandleSupSub)){a="munder"}else if(l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||t.style===Ds.DISPLAY)){a="munder"}else{a="msub"}}else{var u=e.base;if(u&&u.type==="op"&&u.limits&&t.style===Ds.DISPLAY){a="munderover"}else if(u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(t.style===Ds.DISPLAY||u.limits)){a="munderover"}else{a="msubsup"}}return new Hi(a,o)}});D5({type:"atom",htmlBuilder(e,t){return cXe(e.text,e.mode,t,["m"+e.family])},mathmlBuilder(e,t){var n=new Hi("mo",[k_(e.text,e.mode)]);if(e.family==="bin"){var r=fXe(e,t);if(r==="bold-italic"){n.setAttribute("mathvariant",r)}}else if(e.family==="punct"){n.setAttribute("separator","true")}else if(e.family==="open"||e.family==="close"){n.setAttribute("stretchy","false")}return n}});Osn={"mi":"italic","mn":"normal","mtext":"normal"};D5({type:"mathord",htmlBuilder(e,t){return Vwe(e,t,"mathord")},mathmlBuilder(e,t){var n=new Hi("mi",[k_(e.text,e.mode,t)]);var r=fXe(e,t)||"italic";if(r!==Osn[n.type]){n.setAttribute("mathvariant",r)}return n}});D5({type:"textord",htmlBuilder(e,t){return Vwe(e,t,"textord")},mathmlBuilder(e,t){var n=k_(e.text,e.mode,t);var r=fXe(e,t)||"normal";var i;if(e.mode==="text"){i=new Hi("mtext",[n])}else if(/[0-9]/.test(e.text)){i=new Hi("mn",[n])}else if(e.text==="\\prime"){i=new Hi("mo",[n])}else{i=new Hi("mi",[n])}if(r!==Osn[i.type]){i.setAttribute("mathvariant",r)}return i}});Oqe={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"};Bqe={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};D5({type:"spacing",htmlBuilder(e,t){if(Bqe.hasOwnProperty(e.text)){var n=Bqe[e.text].className||"";if(e.mode==="text"){var r=Vwe(e,t,"textord");r.classes.push(n);return r}else{return Ni(["mspace",n],[cXe(e.text,e.mode,t)],t)}}else if(Oqe.hasOwnProperty(e.text)){return Ni(["mspace",Oqe[e.text]],[],t)}else{throw new Xi('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,t){var n;if(Bqe.hasOwnProperty(e.text)){n=new Hi("mtext",[new Hf("\xA0")])}else if(Oqe.hasOwnProperty(e.text)){return new Hi("mspace")}else{throw new Xi('Unknown type of space "'+e.text+'"')}return n}});zan=()=>{var e=new Hi("mtd",[]);e.setAttribute("width","50%");return e};D5({type:"tag",mathmlBuilder(e,t){var n=new Hi("mtable",[new Hi("mtr",[zan(),new Hi("mtd",[sL(e.body,t)]),zan(),new Hi("mtd",[sL(e.tag,t)])])]);n.setAttribute("width","100%");return n}});Uan={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"};Van={"\\textbf":"textbf","\\textmd":"textmd"};d0i={"\\textit":"textit","\\textup":"textup"};$an=(e,t)=>{var n=e.font;if(!n){return t}else if(Uan[n]){return t.withTextFontFamily(Uan[n])}else if(Van[n]){return t.withTextFontWeight(Van[n])}else if(n==="\\emph"){return t.fontShape==="textit"?t.withTextFontShape("textup"):t.withTextFontShape("textit")}return t.withTextFontShape(d0i[n])};Co({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:true,allowedInText:true},handler(e,t){var{parser:n,funcName:r}=e;var i=t[0];return{type:"text",mode:n.mode,body:jh(i),font:r}},htmlBuilder(e,t){var n=$an(e,t);var r=Lp(e.body,n,true);return Ni(["mord","text"],r,n)},mathmlBuilder(e,t){var n=$an(e,t);return sL(e.body,n)}});Co({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:true},handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Hc(e.body,t);var r=t$("underline-line",t);var i=t.fontMetrics().defaultRuleThickness;var o=Gc({positionType:"top",positionData:n.height,children:[{type:"kern",size:i},{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n}]});return Ni(["mord","underline"],[o],t)},mathmlBuilder(e,t){var n=new Hi("mo",[new Hf("\u203E")]);n.setAttribute("stretchy","true");var r=new Hi("munder",[Wu(e.body,t),n]);r.setAttribute("accentunder","true");return r}});Co({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:false},handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Hc(e.body,t);var r=t.fontMetrics().axisHeight;var i=.5*(n.height-r-(n.depth+r));return Gc({positionType:"shift",positionData:i,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new Hi("mpadded",[Wu(e.body,t)],["vcenter"]);return new Hi("mrow",[n])}});Co({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:true},handler(e,t,n){throw new Xi("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){var n=Gan(e);var r=[];var i=t.havingStyle(t.style.text());for(var o=0;oe.body.replace(/ /g,e.star?"\u2423":"\xA0");nL=osn;Bsn="[ \r\n ]";f0i="\\\\[a-zA-Z@]+";h0i="\\\\[^\uD800-\uDFFF]";p0i="("+f0i+")"+Bsn+"*";m0i="\\\\(\n|[ \r ]+\n?)[ \r ]*";rXe="[\u0300-\u036F]";g0i=new RegExp(rXe+"+$");y0i="("+Bsn+"+)|"+(m0i+"|")+"([!-\\[\\]-\u2027\u202A-\uD7FF\uF900-\uFFFF]"+(rXe+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(rXe+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+p0i)+("|"+h0i+")");Bwe=class{constructor(t,n){this.input=void 0;this.settings=void 0;this.tokenRegex=void 0;this.catcodes=void 0;this.input=t;this.settings=n;this.tokenRegex=new RegExp(y0i,"g");this.catcodes={"%":14,"~":13}}setCatcode(t,n){this.catcodes[t]=n}lex(){var t=this.input;var n=this.tokenRegex.lastIndex;if(n===t.length){return new J1("EOF",new dx(this,n,n))}var r=this.tokenRegex.exec(t);if(r===null||r.index!==n){throw new Xi("Unexpected character: '"+t[n]+"'",new J1(t[n],new dx(this,n,n+1)))}var i=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[i]===14){var o=t.indexOf("\n",this.tokenRegex.lastIndex);if(o===-1){this.tokenRegex.lastIndex=t.length;this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")}else{this.tokenRegex.lastIndex=o+1}return this.lex()}return new J1(i,new dx(this,n,this.tokenRegex.lastIndex))}};iXe=class{constructor(t,n){if(t===void 0){t={}}if(n===void 0){n={}}this.current=void 0;this.builtins=void 0;this.undefStack=void 0;this.current=n;this.builtins=t;this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0){throw new Xi("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug")}var t=this.undefStack.pop();for(var n in t){if(t.hasOwnProperty(n)){if(t[n]==null){delete this.current[n]}else{this.current[n]=t[n]}}}}endGroups(){while(this.undefStack.length>0){this.endGroup()}}has(t){return this.current.hasOwnProperty(t)||this.builtins.hasOwnProperty(t)}get(t){if(this.current.hasOwnProperty(t)){return this.current[t]}else{return this.builtins[t]}}set(t,n,r){if(r===void 0){r=false}if(r){for(var i=0;i0){this.undefStack[this.undefStack.length-1][t]=n}}else{var o=this.undefStack[this.undefStack.length-1];if(o&&!o.hasOwnProperty(t)){o[t]=this.current[t]}}if(n==null){delete this.current[t]}else{this.current[t]=n}}};b0i=Asn;dn("\\noexpand",function(e){var t=e.popToken();if(e.isExpandable(t.text)){t.noexpand=true;t.treatAsRelax=true}return{tokens:[t],numArgs:0}});dn("\\expandafter",function(e){var t=e.popToken();e.expandOnce(true);return{tokens:[t],numArgs:0}});dn("\\@firstoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[0],numArgs:0}});dn("\\@secondoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[1],numArgs:0}});dn("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();if(t[0].length===1&&t[0][0].text===n.text){return{tokens:t[1],numArgs:0}}else{return{tokens:t[2],numArgs:0}}});dn("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");dn("\\TextOrMath",function(e){var t=e.consumeArgs(2);if(e.mode==="text"){return{tokens:t[0],numArgs:0}}else{return{tokens:t[1],numArgs:0}}});Han={"0":0,"1":1,"2":2,"3":3,"4":4,"5":5,"6":6,"7":7,"8":8,"9":9,"a":10,"A":10,"b":11,"B":11,"c":12,"C":12,"d":13,"D":13,"e":14,"E":14,"f":15,"F":15};dn("\\char",function(e){var t=e.popToken();var n;var r=0;if(t.text==="'"){n=8;t=e.popToken()}else if(t.text==='"'){n=16;t=e.popToken()}else if(t.text==="`"){t=e.popToken();if(t.text[0]==="\\"){r=t.text.charCodeAt(1)}else if(t.text==="EOF"){throw new Xi("\\char` missing argument")}else{r=t.text.charCodeAt(0)}}else{n=10}if(n){r=Han[t.text];if(r==null||r>=n){throw new Xi("Invalid base-"+n+" digit "+t.text)}var i;while((i=Han[e.future().text])!=null&&i{var i=e.consumeArg().tokens;if(i.length!==1){throw new Xi("\\newcommand's first argument must be a macro name")}var o=i[0].text;var a=e.isDefined(o);if(a&&!t){throw new Xi("\\newcommand{"+o+"} attempting to redefine "+(o+"; use \\renewcommand"))}if(!a&&!n){throw new Xi("\\renewcommand{"+o+"} when command "+o+" does not yet exist; use \\newcommand")}var s=0;i=e.consumeArg().tokens;if(i.length===1&&i[0].text==="["){var l="";var u=e.expandNextToken();while(u.text!=="]"&&u.text!=="EOF"){l+=u.text;u=e.expandNextToken()}if(!l.match(/^\s*[0-9]+\s*$/)){throw new Xi("Invalid number of arguments: "+l)}s=parseInt(l);i=e.consumeArg().tokens}if(!(a&&r)){e.macros.set(o,{tokens:i,numArgs:s})}return""};dn("\\newcommand",e=>yXe(e,false,true,false));dn("\\renewcommand",e=>yXe(e,true,false,false));dn("\\providecommand",e=>yXe(e,true,true,true));dn("\\message",e=>{var t=e.consumeArgs(1)[0];console.log(t.reverse().map(n=>n.text).join(""));return""});dn("\\errmessage",e=>{var t=e.consumeArgs(1)[0];console.error(t.reverse().map(n=>n.text).join(""));return""});dn("\\show",e=>{var t=e.popToken();var n=t.text;console.log(t,e.macros.get(n),nL[n],tf.math[n],tf.text[n]);return""});dn("\\bgroup","{");dn("\\egroup","}");dn("~","\\nobreakspace");dn("\\lq","`");dn("\\rq","'");dn("\\aa","\\r a");dn("\\AA","\\r A");dn("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`\xA9}");dn("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");dn("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`\xAE}");dn("\u212C","\\mathscr{B}");dn("\u2130","\\mathscr{E}");dn("\u2131","\\mathscr{F}");dn("\u210B","\\mathscr{H}");dn("\u2110","\\mathscr{I}");dn("\u2112","\\mathscr{L}");dn("\u2133","\\mathscr{M}");dn("\u211B","\\mathscr{R}");dn("\u212D","\\mathfrak{C}");dn("\u210C","\\mathfrak{H}");dn("\u2128","\\mathfrak{Z}");dn("\\Bbbk","\\Bbb{k}");dn("\\llap","\\mathllap{\\textrm{#1}}");dn("\\rlap","\\mathrlap{\\textrm{#1}}");dn("\\clap","\\mathclap{\\textrm{#1}}");dn("\\mathstrut","\\vphantom{(}");dn("\\underbar","\\underline{\\text{#1}}");dn("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');dn("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`\u2260}}");dn("\\ne","\\neq");dn("\u2260","\\neq");dn("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`\u2209}}");dn("\u2209","\\notin");dn("\u2258","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`\u2258}}");dn("\u2259","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`\u2258}}");dn("\u225A","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`\u225A}}");dn("\u225B","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`\u225B}}");dn("\u225D","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`\u225D}}");dn("\u225E","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`\u225E}}");dn("\u225F","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`\u225F}}");dn("\u27C2","\\perp");dn("\u203C","\\mathclose{!\\mkern-0.8mu!}");dn("\u220C","\\notni");dn("\u231C","\\ulcorner");dn("\u231D","\\urcorner");dn("\u231E","\\llcorner");dn("\u231F","\\lrcorner");dn("\xA9","\\copyright");dn("\xAE","\\textregistered");dn("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');dn("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');dn("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');dn("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');dn("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");dn("\u22EE","\\vdots");dn("\\varGamma","\\mathit{\\Gamma}");dn("\\varDelta","\\mathit{\\Delta}");dn("\\varTheta","\\mathit{\\Theta}");dn("\\varLambda","\\mathit{\\Lambda}");dn("\\varXi","\\mathit{\\Xi}");dn("\\varPi","\\mathit{\\Pi}");dn("\\varSigma","\\mathit{\\Sigma}");dn("\\varUpsilon","\\mathit{\\Upsilon}");dn("\\varPhi","\\mathit{\\Phi}");dn("\\varPsi","\\mathit{\\Psi}");dn("\\varOmega","\\mathit{\\Omega}");dn("\\substack","\\begin{subarray}{c}#1\\end{subarray}");dn("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");dn("\\boxed","\\fbox{$\\displaystyle{#1}$}");dn("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");dn("\\implies","\\DOTSB\\;\\Longrightarrow\\;");dn("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");dn("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");dn("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");Wan={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};x0i=new Set(["bin","rel"]);dn("\\dots",function(e){var t="\\dotso";var n=e.expandAfterFuture().text;if(n in Wan){t=Wan[n]}else if(n.slice(0,4)==="\\not"){t="\\dotsb"}else if(n in tf.math){if(x0i.has(tf.math[n].group)){t="\\dotsb"}}return t});bXe={")":true,"]":true,"\\rbrack":true,"\\}":true,"\\rbrace":true,"\\rangle":true,"\\rceil":true,"\\rfloor":true,"\\rgroup":true,"\\rmoustache":true,"\\right":true,"\\bigr":true,"\\biggr":true,"\\Bigr":true,"\\Biggr":true,"$":true,";":true,".":true,",":true};dn("\\dotso",function(e){var t=e.future().text;if(t in bXe){return"\\ldots\\,"}else{return"\\ldots"}});dn("\\dotsc",function(e){var t=e.future().text;if(t in bXe&&t!==","){return"\\ldots\\,"}else{return"\\ldots"}});dn("\\cdots",function(e){var t=e.future().text;if(t in bXe){return"\\@cdots\\,"}else{return"\\@cdots"}});dn("\\dotsb","\\cdots");dn("\\dotsm","\\cdots");dn("\\dotsi","\\!\\cdots");dn("\\dotsx","\\ldots\\,");dn("\\DOTSI","\\relax");dn("\\DOTSB","\\relax");dn("\\DOTSX","\\relax");dn("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");dn("\\,","\\tmspace+{3mu}{.1667em}");dn("\\thinspace","\\,");dn("\\>","\\mskip{4mu}");dn("\\:","\\tmspace+{4mu}{.2222em}");dn("\\medspace","\\:");dn("\\;","\\tmspace+{5mu}{.2777em}");dn("\\thickspace","\\;");dn("\\!","\\tmspace-{3mu}{.1667em}");dn("\\negthinspace","\\!");dn("\\negmedspace","\\tmspace-{4mu}{.2222em}");dn("\\negthickspace","\\tmspace-{5mu}{.277em}");dn("\\enspace","\\kern.5em ");dn("\\enskip","\\hskip.5em\\relax");dn("\\quad","\\hskip1em\\relax");dn("\\qquad","\\hskip2em\\relax");dn("\\tag","\\@ifstar\\tag@literal\\tag@paren");dn("\\tag@paren","\\tag@literal{({#1})}");dn("\\tag@literal",e=>{if(e.macros.get("\\df@tag")){throw new Xi("Multiple \\tag")}return"\\gdef\\df@tag{\\text{#1}}"});dn("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");dn("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");dn("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");dn("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");dn("\\newline","\\\\\\relax");dn("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");zsn=to(PC["Main-Regular"]["T".charCodeAt(0)][1]-.7*PC["Main-Regular"]["A".charCodeAt(0)][1]);dn("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+zsn+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");dn("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+zsn+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");dn("\\hspace","\\@ifstar\\@hspacer\\@hspace");dn("\\@hspace","\\hskip #1\\relax");dn("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");dn("\\ordinarycolon",":");dn("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");dn("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');dn("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');dn("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');dn("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');dn("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');dn("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');dn("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');dn("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');dn("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');dn("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');dn("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');dn("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');dn("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');dn("\u2237","\\dblcolon");dn("\u2239","\\eqcolon");dn("\u2254","\\coloneqq");dn("\u2255","\\eqqcolon");dn("\u2A74","\\Coloneqq");dn("\\ratio","\\vcentcolon");dn("\\coloncolon","\\dblcolon");dn("\\colonequals","\\coloneqq");dn("\\coloncolonequals","\\Coloneqq");dn("\\equalscolon","\\eqqcolon");dn("\\equalscoloncolon","\\Eqqcolon");dn("\\colonminus","\\coloneq");dn("\\coloncolonminus","\\Coloneq");dn("\\minuscolon","\\eqcolon");dn("\\minuscoloncolon","\\Eqcolon");dn("\\coloncolonapprox","\\Colonapprox");dn("\\coloncolonsim","\\Colonsim");dn("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");dn("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");dn("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");dn("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");dn("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`\u220C}}");dn("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");dn("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");dn("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");dn("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");dn("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");dn("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");dn("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");dn("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");dn("\\gvertneqq","\\html@mathml{\\@gvertneqq}{\u2269}");dn("\\lvertneqq","\\html@mathml{\\@lvertneqq}{\u2268}");dn("\\ngeqq","\\html@mathml{\\@ngeqq}{\u2271}");dn("\\ngeqslant","\\html@mathml{\\@ngeqslant}{\u2271}");dn("\\nleqq","\\html@mathml{\\@nleqq}{\u2270}");dn("\\nleqslant","\\html@mathml{\\@nleqslant}{\u2270}");dn("\\nshortmid","\\html@mathml{\\@nshortmid}{\u2224}");dn("\\nshortparallel","\\html@mathml{\\@nshortparallel}{\u2226}");dn("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{\u2288}");dn("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{\u2289}");dn("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{\u228A}");dn("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{\u2ACB}");dn("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{\u228B}");dn("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{\u2ACC}");dn("\\imath","\\html@mathml{\\@imath}{\u0131}");dn("\\jmath","\\html@mathml{\\@jmath}{\u0237}");dn("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`\u27E6}}");dn("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`\u27E7}}");dn("\u27E6","\\llbracket");dn("\u27E7","\\rrbracket");dn("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`\u2983}}");dn("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`\u2984}}");dn("\u2983","\\lBrace");dn("\u2984","\\rBrace");dn("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`\u29B5}}");dn("\u29B5","\\minuso");dn("\\darr","\\downarrow");dn("\\dArr","\\Downarrow");dn("\\Darr","\\Downarrow");dn("\\lang","\\langle");dn("\\rang","\\rangle");dn("\\uarr","\\uparrow");dn("\\uArr","\\Uparrow");dn("\\Uarr","\\Uparrow");dn("\\N","\\mathbb{N}");dn("\\R","\\mathbb{R}");dn("\\Z","\\mathbb{Z}");dn("\\alef","\\aleph");dn("\\alefsym","\\aleph");dn("\\Alpha","\\mathrm{A}");dn("\\Beta","\\mathrm{B}");dn("\\bull","\\bullet");dn("\\Chi","\\mathrm{X}");dn("\\clubs","\\clubsuit");dn("\\cnums","\\mathbb{C}");dn("\\Complex","\\mathbb{C}");dn("\\Dagger","\\ddagger");dn("\\diamonds","\\diamondsuit");dn("\\empty","\\emptyset");dn("\\Epsilon","\\mathrm{E}");dn("\\Eta","\\mathrm{H}");dn("\\exist","\\exists");dn("\\harr","\\leftrightarrow");dn("\\hArr","\\Leftrightarrow");dn("\\Harr","\\Leftrightarrow");dn("\\hearts","\\heartsuit");dn("\\image","\\Im");dn("\\infin","\\infty");dn("\\Iota","\\mathrm{I}");dn("\\isin","\\in");dn("\\Kappa","\\mathrm{K}");dn("\\larr","\\leftarrow");dn("\\lArr","\\Leftarrow");dn("\\Larr","\\Leftarrow");dn("\\lrarr","\\leftrightarrow");dn("\\lrArr","\\Leftrightarrow");dn("\\Lrarr","\\Leftrightarrow");dn("\\Mu","\\mathrm{M}");dn("\\natnums","\\mathbb{N}");dn("\\Nu","\\mathrm{N}");dn("\\Omicron","\\mathrm{O}");dn("\\plusmn","\\pm");dn("\\rarr","\\rightarrow");dn("\\rArr","\\Rightarrow");dn("\\Rarr","\\Rightarrow");dn("\\real","\\Re");dn("\\reals","\\mathbb{R}");dn("\\Reals","\\mathbb{R}");dn("\\Rho","\\mathrm{P}");dn("\\sdot","\\cdot");dn("\\sect","\\S");dn("\\spades","\\spadesuit");dn("\\sub","\\subset");dn("\\sube","\\subseteq");dn("\\supe","\\supseteq");dn("\\Tau","\\mathrm{T}");dn("\\thetasym","\\vartheta");dn("\\weierp","\\wp");dn("\\Zeta","\\mathrm{Z}");dn("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");dn("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");dn("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");dn("\\bra","\\mathinner{\\langle{#1}|}");dn("\\ket","\\mathinner{|{#1}\\rangle}");dn("\\braket","\\mathinner{\\langle{#1}\\rangle}");dn("\\Bra","\\left\\langle#1\\right|");dn("\\Ket","\\left|#1\\right\\rangle");Usn=e=>t=>{var n=t.consumeArg().tokens;var r=t.consumeArg().tokens;var i=t.consumeArg().tokens;var o=t.consumeArg().tokens;var a=t.macros.get("|");var s=t.macros.get("\\|");t.macros.beginGroup();var l=f=>h=>{if(e){h.macros.set("|",a);if(i.length){h.macros.set("\\|",s)}}var m=f;if(!f&&i.length){var g=h.future();if(g.text==="|"){h.popToken();m=true}}return{tokens:m?i:r,numArgs:0}};t.macros.set("|",l(false));if(i.length){t.macros.set("\\|",l(true))}var u=t.consumeArg().tokens;var d=t.expandTokens([...o,...u,...n]);t.macros.endGroup();return{tokens:d.reverse(),numArgs:0}};dn("\\bra@ket",Usn(false));dn("\\bra@set",Usn(true));dn("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");dn("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");dn("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");dn("\\angln","{\\angl n}");dn("\\blue","\\textcolor{##6495ed}{#1}");dn("\\orange","\\textcolor{##ffa500}{#1}");dn("\\pink","\\textcolor{##ff00af}{#1}");dn("\\red","\\textcolor{##df0030}{#1}");dn("\\green","\\textcolor{##28ae7b}{#1}");dn("\\gray","\\textcolor{gray}{#1}");dn("\\purple","\\textcolor{##9d38bd}{#1}");dn("\\blueA","\\textcolor{##ccfaff}{#1}");dn("\\blueB","\\textcolor{##80f6ff}{#1}");dn("\\blueC","\\textcolor{##63d9ea}{#1}");dn("\\blueD","\\textcolor{##11accd}{#1}");dn("\\blueE","\\textcolor{##0c7f99}{#1}");dn("\\tealA","\\textcolor{##94fff5}{#1}");dn("\\tealB","\\textcolor{##26edd5}{#1}");dn("\\tealC","\\textcolor{##01d1c1}{#1}");dn("\\tealD","\\textcolor{##01a995}{#1}");dn("\\tealE","\\textcolor{##208170}{#1}");dn("\\greenA","\\textcolor{##b6ffb0}{#1}");dn("\\greenB","\\textcolor{##8af281}{#1}");dn("\\greenC","\\textcolor{##74cf70}{#1}");dn("\\greenD","\\textcolor{##1fab54}{#1}");dn("\\greenE","\\textcolor{##0d923f}{#1}");dn("\\goldA","\\textcolor{##ffd0a9}{#1}");dn("\\goldB","\\textcolor{##ffbb71}{#1}");dn("\\goldC","\\textcolor{##ff9c39}{#1}");dn("\\goldD","\\textcolor{##e07d10}{#1}");dn("\\goldE","\\textcolor{##a75a05}{#1}");dn("\\redA","\\textcolor{##fca9a9}{#1}");dn("\\redB","\\textcolor{##ff8482}{#1}");dn("\\redC","\\textcolor{##f9685d}{#1}");dn("\\redD","\\textcolor{##e84d39}{#1}");dn("\\redE","\\textcolor{##bc2612}{#1}");dn("\\maroonA","\\textcolor{##ffbde0}{#1}");dn("\\maroonB","\\textcolor{##ff92c6}{#1}");dn("\\maroonC","\\textcolor{##ed5fa6}{#1}");dn("\\maroonD","\\textcolor{##ca337c}{#1}");dn("\\maroonE","\\textcolor{##9e034e}{#1}");dn("\\purpleA","\\textcolor{##ddd7ff}{#1}");dn("\\purpleB","\\textcolor{##c6b9fc}{#1}");dn("\\purpleC","\\textcolor{##aa87ff}{#1}");dn("\\purpleD","\\textcolor{##7854ab}{#1}");dn("\\purpleE","\\textcolor{##543b78}{#1}");dn("\\mintA","\\textcolor{##f5f9e8}{#1}");dn("\\mintB","\\textcolor{##edf2df}{#1}");dn("\\mintC","\\textcolor{##e0e5cc}{#1}");dn("\\grayA","\\textcolor{##f6f7f7}{#1}");dn("\\grayB","\\textcolor{##f0f1f2}{#1}");dn("\\grayC","\\textcolor{##e3e5e6}{#1}");dn("\\grayD","\\textcolor{##d6d8da}{#1}");dn("\\grayE","\\textcolor{##babec2}{#1}");dn("\\grayF","\\textcolor{##888d93}{#1}");dn("\\grayG","\\textcolor{##626569}{#1}");dn("\\grayH","\\textcolor{##3b3e40}{#1}");dn("\\grayI","\\textcolor{##21242c}{#1}");dn("\\kaBlue","\\textcolor{##314453}{#1}");dn("\\kaGreen","\\textcolor{##71B307}{#1}");Vsn={"^":true,"_":true,"\\limits":true,"\\nolimits":true};oXe=class{constructor(t,n,r){this.settings=void 0;this.expansionCount=void 0;this.lexer=void 0;this.macros=void 0;this.stack=void 0;this.mode=void 0;this.settings=n;this.expansionCount=0;this.feed(t);this.macros=new iXe(b0i,n.macros);this.mode=r;this.stack=[]}feed(t){this.lexer=new Bwe(t,this.settings)}switchMode(t){this.mode=t}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){if(this.stack.length===0){this.pushToken(this.lexer.lex())}return this.stack[this.stack.length-1]}popToken(){this.future();return this.stack.pop()}pushToken(t){this.stack.push(t)}pushTokens(t){this.stack.push(...t)}scanArgument(t){var n;var r;var i;if(t){this.consumeSpaces();if(this.future().text!=="["){return null}n=this.popToken();({tokens:i,end:r}=this.consumeArg(["]"]))}else{({tokens:i,start:n,end:r}=this.consumeArg())}this.pushToken(new J1("EOF",r.loc));this.pushTokens(i);return new J1("",dx.range(n,r))}consumeSpaces(){for(;;){var t=this.future();if(t.text===" "){this.stack.pop()}else{break}}}consumeArg(t){var n=[];var r=t&&t.length>0;if(!r){this.consumeSpaces()}var i=this.future();var o;var a=0;var s=0;do{o=this.popToken();n.push(o);if(o.text==="{"){++a}else if(o.text==="}"){--a;if(a===-1){throw new Xi("Extra }",o)}}else if(o.text==="EOF"){throw new Xi("Unexpected end of input in a macro argument, expected '"+(t&&r?t[s]:"}")+"'",o)}if(t&&r){if((a===0||a===1&&t[s]==="{")&&o.text===t[s]){++s;if(s===t.length){n.splice(-s,s);break}}else{s=0}}}while(a!==0||r);if(i.text==="{"&&n[n.length-1].text==="}"){n.pop();n.shift()}n.reverse();return{tokens:n,start:i,end:o}}consumeArgs(t,n){if(n){if(n.length!==t+1){throw new Xi("The length of delimiters doesn't match the number of args!")}var r=n[0];for(var i=0;ithis.settings.maxExpand){throw new Xi("Too many expansions: infinite loop or need to increase maxExpand setting")}}expandOnce(t){var n=this.popToken();var r=n.text;var i=!n.noexpand?this._getExpansion(r):null;if(i==null||t&&i.unexpandable){if(t&&i==null&&r[0]==="\\"&&!this.isDefined(r)){throw new Xi("Undefined control sequence: "+r)}this.pushToken(n);return false}this.countExpansion(1);var o=i.tokens;var a=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){o=o.slice();for(var s=o.length-1;s>=0;--s){var l=o[s];if(l.text==="#"){if(s===0){throw new Xi("Incomplete placeholder at end of macro body",l)}l=o[--s];if(l.text==="#"){o.splice(s+1,1)}else if(/^[1-9]$/.test(l.text)){o.splice(s,2,...a[+l.text-1])}else{throw new Xi("Not a valid argument number",l)}}}}this.pushTokens(o);return o.length}expandAfterFuture(){this.expandOnce();return this.future()}expandNextToken(){for(;;){if(this.expandOnce()===false){var t=this.stack.pop();if(t.treatAsRelax){t.text="\\relax"}return t}}}expandMacro(t){return this.macros.has(t)?this.expandTokens([new J1(t)]):void 0}expandTokens(t){var n=[];var r=this.stack.length;this.pushTokens(t);while(this.stack.length>r){if(this.expandOnce(true)===false){var i=this.stack.pop();if(i.treatAsRelax){i.noexpand=false;i.treatAsRelax=false}n.push(i)}}this.countExpansion(n.length);return n}expandMacroAsText(t){var n=this.expandMacro(t);if(n){return n.map(r=>r.text).join("")}else{return n}}_getExpansion(t){var n=this.macros.get(t);if(n==null){return n}if(t.length===1){var r=this.lexer.catcodes[t];if(r!=null&&r!==13){return}}var i=typeof n==="function"?n(this):n;if(typeof i==="string"){var o=0;if(i.includes("#")){var a=i.replace(/##/g,"");while(a.includes("#"+(o+1))){++o}}var s=new Bwe(i,this.settings);var l=[];var u=s.lex();while(u.text!=="EOF"){l.push(u);u=s.lex()}l.reverse();var d={tokens:l,numArgs:o};return d}return i}isDefined(t){return this.macros.has(t)||nL.hasOwnProperty(t)||tf.math.hasOwnProperty(t)||tf.text.hasOwnProperty(t)||Vsn.hasOwnProperty(t)}isExpandable(t){var n=this.macros.get(t);return n!=null?typeof n==="string"||typeof n==="function"||!n.unexpandable:nL.hasOwnProperty(t)&&!nL[t].primitive}};Yan=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/;Awe=Object.freeze({"\u208A":"+","\u208B":"-","\u208C":"=","\u208D":"(","\u208E":")","\u2080":"0","\u2081":"1","\u2082":"2","\u2083":"3","\u2084":"4","\u2085":"5","\u2086":"6","\u2087":"7","\u2088":"8","\u2089":"9","\u2090":"a","\u2091":"e","\u2095":"h","\u1D62":"i","\u2C7C":"j","\u2096":"k","\u2097":"l","\u2098":"m","\u2099":"n","\u2092":"o","\u209A":"p","\u1D63":"r","\u209B":"s","\u209C":"t","\u1D64":"u","\u1D65":"v","\u2093":"x","\u1D66":"\u03B2","\u1D67":"\u03B3","\u1D68":"\u03C1","\u1D69":"\u03D5","\u1D6A":"\u03C7","\u207A":"+","\u207B":"-","\u207C":"=","\u207D":"(","\u207E":")","\u2070":"0","\xB9":"1","\xB2":"2","\xB3":"3","\u2074":"4","\u2075":"5","\u2076":"6","\u2077":"7","\u2078":"8","\u2079":"9","\u1D2C":"A","\u1D2E":"B","\u1D30":"D","\u1D31":"E","\u1D33":"G","\u1D34":"H","\u1D35":"I","\u1D36":"J","\u1D37":"K","\u1D38":"L","\u1D39":"M","\u1D3A":"N","\u1D3C":"O","\u1D3E":"P","\u1D3F":"R","\u1D40":"T","\u1D41":"U","\u2C7D":"V","\u1D42":"W","\u1D43":"a","\u1D47":"b","\u1D9C":"c","\u1D48":"d","\u1D49":"e","\u1DA0":"f","\u1D4D":"g","\u02B0":"h","\u2071":"i","\u02B2":"j","\u1D4F":"k","\u02E1":"l","\u1D50":"m","\u207F":"n","\u1D52":"o","\u1D56":"p","\u02B3":"r","\u02E2":"s","\u1D57":"t","\u1D58":"u","\u1D5B":"v","\u02B7":"w","\u02E3":"x","\u02B8":"y","\u1DBB":"z","\u1D5D":"\u03B2","\u1D5E":"\u03B3","\u1D5F":"\u03B4","\u1D60":"\u03D5","\u1D61":"\u03C7","\u1DBF":"\u03B8"});zqe={"\u0301":{"text":"\\'","math":"\\acute"},"\u0300":{"text":"\\`","math":"\\grave"},"\u0308":{"text":'\\"',"math":"\\ddot"},"\u0303":{"text":"\\~","math":"\\tilde"},"\u0304":{"text":"\\=","math":"\\bar"},"\u0306":{"text":"\\u","math":"\\breve"},"\u030C":{"text":"\\v","math":"\\check"},"\u0302":{"text":"\\^","math":"\\hat"},"\u0307":{"text":"\\.","math":"\\dot"},"\u030A":{"text":"\\r","math":"\\mathring"},"\u030B":{"text":"\\H"},"\u0327":{"text":"\\c"}};qan={"\xE1":"a\u0301","\xE0":"a\u0300","\xE4":"a\u0308","\u01DF":"a\u0308\u0304","\xE3":"a\u0303","\u0101":"a\u0304","\u0103":"a\u0306","\u1EAF":"a\u0306\u0301","\u1EB1":"a\u0306\u0300","\u1EB5":"a\u0306\u0303","\u01CE":"a\u030C","\xE2":"a\u0302","\u1EA5":"a\u0302\u0301","\u1EA7":"a\u0302\u0300","\u1EAB":"a\u0302\u0303","\u0227":"a\u0307","\u01E1":"a\u0307\u0304","\xE5":"a\u030A","\u01FB":"a\u030A\u0301","\u1E03":"b\u0307","\u0107":"c\u0301","\u1E09":"c\u0327\u0301","\u010D":"c\u030C","\u0109":"c\u0302","\u010B":"c\u0307","\xE7":"c\u0327","\u010F":"d\u030C","\u1E0B":"d\u0307","\u1E11":"d\u0327","\xE9":"e\u0301","\xE8":"e\u0300","\xEB":"e\u0308","\u1EBD":"e\u0303","\u0113":"e\u0304","\u1E17":"e\u0304\u0301","\u1E15":"e\u0304\u0300","\u0115":"e\u0306","\u1E1D":"e\u0327\u0306","\u011B":"e\u030C","\xEA":"e\u0302","\u1EBF":"e\u0302\u0301","\u1EC1":"e\u0302\u0300","\u1EC5":"e\u0302\u0303","\u0117":"e\u0307","\u0229":"e\u0327","\u1E1F":"f\u0307","\u01F5":"g\u0301","\u1E21":"g\u0304","\u011F":"g\u0306","\u01E7":"g\u030C","\u011D":"g\u0302","\u0121":"g\u0307","\u0123":"g\u0327","\u1E27":"h\u0308","\u021F":"h\u030C","\u0125":"h\u0302","\u1E23":"h\u0307","\u1E29":"h\u0327","\xED":"i\u0301","\xEC":"i\u0300","\xEF":"i\u0308","\u1E2F":"i\u0308\u0301","\u0129":"i\u0303","\u012B":"i\u0304","\u012D":"i\u0306","\u01D0":"i\u030C","\xEE":"i\u0302","\u01F0":"j\u030C","\u0135":"j\u0302","\u1E31":"k\u0301","\u01E9":"k\u030C","\u0137":"k\u0327","\u013A":"l\u0301","\u013E":"l\u030C","\u013C":"l\u0327","\u1E3F":"m\u0301","\u1E41":"m\u0307","\u0144":"n\u0301","\u01F9":"n\u0300","\xF1":"n\u0303","\u0148":"n\u030C","\u1E45":"n\u0307","\u0146":"n\u0327","\xF3":"o\u0301","\xF2":"o\u0300","\xF6":"o\u0308","\u022B":"o\u0308\u0304","\xF5":"o\u0303","\u1E4D":"o\u0303\u0301","\u1E4F":"o\u0303\u0308","\u022D":"o\u0303\u0304","\u014D":"o\u0304","\u1E53":"o\u0304\u0301","\u1E51":"o\u0304\u0300","\u014F":"o\u0306","\u01D2":"o\u030C","\xF4":"o\u0302","\u1ED1":"o\u0302\u0301","\u1ED3":"o\u0302\u0300","\u1ED7":"o\u0302\u0303","\u022F":"o\u0307","\u0231":"o\u0307\u0304","\u0151":"o\u030B","\u1E55":"p\u0301","\u1E57":"p\u0307","\u0155":"r\u0301","\u0159":"r\u030C","\u1E59":"r\u0307","\u0157":"r\u0327","\u015B":"s\u0301","\u1E65":"s\u0301\u0307","\u0161":"s\u030C","\u1E67":"s\u030C\u0307","\u015D":"s\u0302","\u1E61":"s\u0307","\u015F":"s\u0327","\u1E97":"t\u0308","\u0165":"t\u030C","\u1E6B":"t\u0307","\u0163":"t\u0327","\xFA":"u\u0301","\xF9":"u\u0300","\xFC":"u\u0308","\u01D8":"u\u0308\u0301","\u01DC":"u\u0308\u0300","\u01D6":"u\u0308\u0304","\u01DA":"u\u0308\u030C","\u0169":"u\u0303","\u1E79":"u\u0303\u0301","\u016B":"u\u0304","\u1E7B":"u\u0304\u0308","\u016D":"u\u0306","\u01D4":"u\u030C","\xFB":"u\u0302","\u016F":"u\u030A","\u0171":"u\u030B","\u1E7D":"v\u0303","\u1E83":"w\u0301","\u1E81":"w\u0300","\u1E85":"w\u0308","\u0175":"w\u0302","\u1E87":"w\u0307","\u1E98":"w\u030A","\u1E8D":"x\u0308","\u1E8B":"x\u0307","\xFD":"y\u0301","\u1EF3":"y\u0300","\xFF":"y\u0308","\u1EF9":"y\u0303","\u0233":"y\u0304","\u0177":"y\u0302","\u1E8F":"y\u0307","\u1E99":"y\u030A","\u017A":"z\u0301","\u017E":"z\u030C","\u1E91":"z\u0302","\u017C":"z\u0307","\xC1":"A\u0301","\xC0":"A\u0300","\xC4":"A\u0308","\u01DE":"A\u0308\u0304","\xC3":"A\u0303","\u0100":"A\u0304","\u0102":"A\u0306","\u1EAE":"A\u0306\u0301","\u1EB0":"A\u0306\u0300","\u1EB4":"A\u0306\u0303","\u01CD":"A\u030C","\xC2":"A\u0302","\u1EA4":"A\u0302\u0301","\u1EA6":"A\u0302\u0300","\u1EAA":"A\u0302\u0303","\u0226":"A\u0307","\u01E0":"A\u0307\u0304","\xC5":"A\u030A","\u01FA":"A\u030A\u0301","\u1E02":"B\u0307","\u0106":"C\u0301","\u1E08":"C\u0327\u0301","\u010C":"C\u030C","\u0108":"C\u0302","\u010A":"C\u0307","\xC7":"C\u0327","\u010E":"D\u030C","\u1E0A":"D\u0307","\u1E10":"D\u0327","\xC9":"E\u0301","\xC8":"E\u0300","\xCB":"E\u0308","\u1EBC":"E\u0303","\u0112":"E\u0304","\u1E16":"E\u0304\u0301","\u1E14":"E\u0304\u0300","\u0114":"E\u0306","\u1E1C":"E\u0327\u0306","\u011A":"E\u030C","\xCA":"E\u0302","\u1EBE":"E\u0302\u0301","\u1EC0":"E\u0302\u0300","\u1EC4":"E\u0302\u0303","\u0116":"E\u0307","\u0228":"E\u0327","\u1E1E":"F\u0307","\u01F4":"G\u0301","\u1E20":"G\u0304","\u011E":"G\u0306","\u01E6":"G\u030C","\u011C":"G\u0302","\u0120":"G\u0307","\u0122":"G\u0327","\u1E26":"H\u0308","\u021E":"H\u030C","\u0124":"H\u0302","\u1E22":"H\u0307","\u1E28":"H\u0327","\xCD":"I\u0301","\xCC":"I\u0300","\xCF":"I\u0308","\u1E2E":"I\u0308\u0301","\u0128":"I\u0303","\u012A":"I\u0304","\u012C":"I\u0306","\u01CF":"I\u030C","\xCE":"I\u0302","\u0130":"I\u0307","\u0134":"J\u0302","\u1E30":"K\u0301","\u01E8":"K\u030C","\u0136":"K\u0327","\u0139":"L\u0301","\u013D":"L\u030C","\u013B":"L\u0327","\u1E3E":"M\u0301","\u1E40":"M\u0307","\u0143":"N\u0301","\u01F8":"N\u0300","\xD1":"N\u0303","\u0147":"N\u030C","\u1E44":"N\u0307","\u0145":"N\u0327","\xD3":"O\u0301","\xD2":"O\u0300","\xD6":"O\u0308","\u022A":"O\u0308\u0304","\xD5":"O\u0303","\u1E4C":"O\u0303\u0301","\u1E4E":"O\u0303\u0308","\u022C":"O\u0303\u0304","\u014C":"O\u0304","\u1E52":"O\u0304\u0301","\u1E50":"O\u0304\u0300","\u014E":"O\u0306","\u01D1":"O\u030C","\xD4":"O\u0302","\u1ED0":"O\u0302\u0301","\u1ED2":"O\u0302\u0300","\u1ED6":"O\u0302\u0303","\u022E":"O\u0307","\u0230":"O\u0307\u0304","\u0150":"O\u030B","\u1E54":"P\u0301","\u1E56":"P\u0307","\u0154":"R\u0301","\u0158":"R\u030C","\u1E58":"R\u0307","\u0156":"R\u0327","\u015A":"S\u0301","\u1E64":"S\u0301\u0307","\u0160":"S\u030C","\u1E66":"S\u030C\u0307","\u015C":"S\u0302","\u1E60":"S\u0307","\u015E":"S\u0327","\u0164":"T\u030C","\u1E6A":"T\u0307","\u0162":"T\u0327","\xDA":"U\u0301","\xD9":"U\u0300","\xDC":"U\u0308","\u01D7":"U\u0308\u0301","\u01DB":"U\u0308\u0300","\u01D5":"U\u0308\u0304","\u01D9":"U\u0308\u030C","\u0168":"U\u0303","\u1E78":"U\u0303\u0301","\u016A":"U\u0304","\u1E7A":"U\u0304\u0308","\u016C":"U\u0306","\u01D3":"U\u030C","\xDB":"U\u0302","\u016E":"U\u030A","\u0170":"U\u030B","\u1E7C":"V\u0303","\u1E82":"W\u0301","\u1E80":"W\u0300","\u1E84":"W\u0308","\u0174":"W\u0302","\u1E86":"W\u0307","\u1E8C":"X\u0308","\u1E8A":"X\u0307","\xDD":"Y\u0301","\u1EF2":"Y\u0300","\u0178":"Y\u0308","\u1EF8":"Y\u0303","\u0232":"Y\u0304","\u0176":"Y\u0302","\u1E8E":"Y\u0307","\u0179":"Z\u0301","\u017D":"Z\u030C","\u1E90":"Z\u0302","\u017B":"Z\u0307","\u03AC":"\u03B1\u0301","\u1F70":"\u03B1\u0300","\u1FB1":"\u03B1\u0304","\u1FB0":"\u03B1\u0306","\u03AD":"\u03B5\u0301","\u1F72":"\u03B5\u0300","\u03AE":"\u03B7\u0301","\u1F74":"\u03B7\u0300","\u03AF":"\u03B9\u0301","\u1F76":"\u03B9\u0300","\u03CA":"\u03B9\u0308","\u0390":"\u03B9\u0308\u0301","\u1FD2":"\u03B9\u0308\u0300","\u1FD1":"\u03B9\u0304","\u1FD0":"\u03B9\u0306","\u03CC":"\u03BF\u0301","\u1F78":"\u03BF\u0300","\u03CD":"\u03C5\u0301","\u1F7A":"\u03C5\u0300","\u03CB":"\u03C5\u0308","\u03B0":"\u03C5\u0308\u0301","\u1FE2":"\u03C5\u0308\u0300","\u1FE1":"\u03C5\u0304","\u1FE0":"\u03C5\u0306","\u03CE":"\u03C9\u0301","\u1F7C":"\u03C9\u0300","\u038E":"\u03A5\u0301","\u1FEA":"\u03A5\u0300","\u03AB":"\u03A5\u0308","\u1FE9":"\u03A5\u0304","\u1FE8":"\u03A5\u0306","\u038F":"\u03A9\u0301","\u1FFA":"\u03A9\u0300"};zwe=class e{constructor(t,n){this.mode=void 0;this.gullet=void 0;this.settings=void 0;this.leftrightDepth=void 0;this.nextToken=void 0;this.mode="math";this.gullet=new oXe(t,n,this.mode);this.settings=n;this.leftrightDepth=0;this.nextToken=null}expect(t,n){if(n===void 0){n=true}if(this.fetch().text!==t){throw new Xi("Expected '"+t+"', got '"+this.fetch().text+"'",this.fetch())}if(n){this.consume()}}consume(){this.nextToken=null}fetch(){if(this.nextToken==null){this.nextToken=this.gullet.expandNextToken()}return this.nextToken}switchMode(t){this.mode=t;this.gullet.switchMode(t)}parse(){if(!this.settings.globalGroup){this.gullet.beginGroup()}if(this.settings.colorIsTextColor){this.gullet.macros.set("\\color","\\textcolor")}try{var t=this.parseExpression(false);this.expect("EOF");if(!this.settings.globalGroup){this.gullet.endGroup()}return t}finally{this.gullet.endGroups()}}subparse(t){var n=this.nextToken;this.consume();this.gullet.pushToken(new J1("}"));this.gullet.pushTokens(t);var r=this.parseExpression(false);this.expect("}");this.nextToken=n;return r}parseExpression(t,n){var r=[];while(true){if(this.mode==="math"){this.consumeSpaces()}var i=this.fetch();if(e.endOfExpression.has(i.text)){break}if(n&&i.text===n){break}if(t&&nL[i.text]&&nL[i.text].infix){break}var o=this.parseAtom(n);if(!o){break}else if(o.type==="internal"){continue}r.push(o)}if(this.mode==="text"){this.formLigatures(r)}return this.handleInfixNodes(r)}handleInfixNodes(t){var n=-1;var r;for(var i=0;i=128){if(this.settings.strict){if(!Xan(n.charCodeAt(0))){this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),t)}else if(this.mode==="math"){this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',t)}}a={type:"textord",mode:"text",loc:dx.range(t),text:n}}else{return null}this.consume();if(o){for(var d=0;d{if(t.tagName==="A"&&t.hasAttribute("target")){t.setAttribute(e,t.getAttribute("target")??"")}});ux.addHook("afterSanitizeAttributes",t=>{if(t.tagName==="A"&&t.hasAttribute(e)){t.setAttribute("target",t.getAttribute(e)??"");t.removeAttribute(e);if(t.getAttribute("target")==="_blank"){t.setAttribute("rel","noopener")}}})}function i2e(e){return[...e.cssRules].map(t=>t.cssText).join("\n")}var _Xe,rf,NC,OC,rs,_0i,T0i,w0i,E0i,C0i,Vy,S0i,A0i,k0i,R0i,P0i,I0i,M0i,L0i,D0i,F0i,N0i,O0i,B0i,z0i,U0i,V0i,FC,Tg,eln,tln,$0i,ka,G0i,H0i,ZQ,wXe,N5,R_,fx,e2e,F5,KQ,JQ,nln,rln,iln,EXe,CXe,Ji,oln,aln,QQ,W0i,Ksn,sln,Y0i,n2e,oc,SXe,o$,q0i,AXe,cL,eee,r2e,lln,cln,O5,X0i,j0i,dln,Zsn,La,K0i,Z0i,J0i,Q0i,fln,B5,ebi,tbi,BC,TXe,nbi,rbi,Jsn,Jwe,of,a$,ibi,s$,Ti,obi,abi,Vs,zC,Qwe,sbi,lbi,hln,o2e,kXe,RXe,PXe,IXe,Da,Ka,is,os,as,ys,ss,Qsn,cbi,Mn,tee,a2e,s2e,nee,ubi,t2e,ree,l2e,dbi;var Ta=Ce(()=>{Aa();Yo();qh();qh();qh();qh();qh();qh();qh();qh();qh();qh();qh();qh();KV();_Xe=B((e,t,{depth:n=2}={})=>{const r={depth:n};if(Array.isArray(t)&&!Array.isArray(e)){t.forEach(i=>_Xe(e,i,r));return e}else if(Array.isArray(t)&&Array.isArray(e)){t.forEach(i=>{if(!e.includes(i)){e.push(i)}});return e}if(e===void 0||e===null||n<=0){if(e!==void 0&&e!==null&&typeof e==="object"&&typeof t==="object"){return Object.assign(e,t)}else{return t}}if(t!==void 0&&t!==null&&typeof e==="object"&&typeof t==="object"){const i=e;Object.entries(t).forEach(([o,a])=>{if(typeof a==="object"){if(a===null){return}if(!Object.hasOwn(e,o)){Object.defineProperty(e,o,{value:void 0,writable:true,enumerable:true,configurable:true})}if(i[o]===void 0){i[o]=Array.isArray(a)?[]:{}}if(typeof i[o]==="object"){i[o]=_Xe(i[o],a,{depth:n-1})}}else if(typeof i[o]!=="object"){if(Object.hasOwn(e,o)){i[o]=a}else{Object.defineProperty(e,o,{value:a,writable:true,enumerable:true,configurable:true})}}})}return e},"assignWithDepth");rf=_Xe;NC="#ffffff";OC="#f2f2f2";rs=B((e,t)=>t?$t(e,{s:-40,l:10}):$t(e,{s:-40,l:-10}),"mkBorder");_0i=class{static{B(this,"Theme")}constructor(){this.background="#f4f4f4";this.primaryColor="#fff4dd";this.noteBkgColor="#fff5ad";this.noteTextColor="#333";this.THEME_COLOR_LIMIT=12;this.radius=5;this.strokeWidth=1;this.fontFamily='"trebuchet ms", verdana, arial, sans-serif';this.fontSize="16px";this.useGradient=true;this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333");this.secondaryColor=this.secondaryColor||$t(this.primaryColor,{h:-120});this.tertiaryColor=this.tertiaryColor||$t(this.primaryColor,{h:180,l:5});this.primaryBorderColor=this.primaryBorderColor||rs(this.primaryColor,this.darkMode);this.secondaryBorderColor=this.secondaryBorderColor||rs(this.secondaryColor,this.darkMode);this.tertiaryBorderColor=this.tertiaryBorderColor||rs(this.tertiaryColor,this.darkMode);this.noteBorderColor=this.noteBorderColor||rs(this.noteBkgColor,this.darkMode);this.noteBkgColor=this.noteBkgColor||"#fff5ad";this.noteTextColor=this.noteTextColor||"#333";this.secondaryTextColor=this.secondaryTextColor||mr(this.secondaryColor);this.tertiaryTextColor=this.tertiaryTextColor||mr(this.tertiaryColor);this.lineColor=this.lineColor||mr(this.background);this.arrowheadColor=this.arrowheadColor||mr(this.background);this.textColor=this.textColor||this.primaryTextColor;this.border2=this.border2||this.tertiaryBorderColor;this.nodeBkg=this.nodeBkg||this.primaryColor;this.mainBkg=this.mainBkg||this.primaryColor;this.nodeBorder=this.nodeBorder||this.primaryBorderColor;this.clusterBkg=this.clusterBkg||this.tertiaryColor;this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor;this.defaultLinkColor=this.defaultLinkColor||this.lineColor;this.titleColor=this.titleColor||this.tertiaryTextColor;this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Or(this.secondaryColor,30):this.secondaryColor);this.nodeTextColor=this.nodeTextColor||this.primaryTextColor;this.actorBorder=this.actorBorder||this.primaryBorderColor;this.actorBkg=this.actorBkg||this.mainBkg;this.actorTextColor=this.actorTextColor||this.primaryTextColor;this.actorLineColor=this.actorLineColor||this.actorBorder;this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg;this.signalColor=this.signalColor||this.textColor;this.signalTextColor=this.signalTextColor||this.textColor;this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder;this.labelTextColor=this.labelTextColor||this.actorTextColor;this.loopTextColor=this.loopTextColor||this.actorTextColor;this.activationBorderColor=this.activationBorderColor||Or(this.secondaryColor,10);this.activationBkgColor=this.activationBkgColor||this.secondaryColor;this.sequenceNumberColor=this.sequenceNumberColor||mr(this.lineColor);this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor;this.altSectionBkgColor=this.altSectionBkgColor||"white";this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor;this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor;this.excludeBkgColor=this.excludeBkgColor||"#eeeeee";this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor;this.taskBkgColor=this.taskBkgColor||this.primaryColor;this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor;this.activeTaskBkgColor=this.activeTaskBkgColor||Nr(this.primaryColor,23);this.gridColor=this.gridColor||"lightgrey";this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey";this.doneTaskBorderColor=this.doneTaskBorderColor||"grey";this.critBorderColor=this.critBorderColor||"#ff8888";this.critBkgColor=this.critBkgColor||"red";this.todayLineColor=this.todayLineColor||"red";this.vertLineColor=this.vertLineColor||"navy";this.taskTextColor=this.taskTextColor||this.textColor;this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor;this.taskTextLightColor=this.taskTextLightColor||this.textColor;this.taskTextColor=this.taskTextColor||this.primaryTextColor;this.taskTextDarkColor=this.taskTextDarkColor||this.textColor;this.taskTextClickableColor=this.taskTextClickableColor||"#003163";this.noteFontWeight=this.noteFontWeight||"normal";this.fontWeight=this.fontWeight||"normal";this.personBorder=this.personBorder||this.primaryBorderColor;this.personBkg=this.personBkg||this.mainBkg;if(this.darkMode){this.rowOdd=this.rowOdd||Or(this.mainBkg,5)||"#ffffff";this.rowEven=this.rowEven||Or(this.mainBkg,10)}else{this.rowOdd=this.rowOdd||Nr(this.mainBkg,75)||"#ffffff";this.rowEven=this.rowEven||Nr(this.mainBkg,5)}this.transitionColor=this.transitionColor||this.lineColor;this.transitionLabelColor=this.transitionLabelColor||this.textColor;this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor;this.stateBkg=this.stateBkg||this.mainBkg;this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg;this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor;this.altBackground=this.altBackground||this.tertiaryColor;this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg;this.compositeBorder=this.compositeBorder||this.nodeBorder;this.innerEndBackground=this.nodeBorder;this.errorBkgColor=this.errorBkgColor||this.tertiaryColor;this.errorTextColor=this.errorTextColor||this.tertiaryTextColor;this.transitionColor=this.transitionColor||this.lineColor;this.specialStateColor=this.lineColor;this.cScale0=this.cScale0||this.primaryColor;this.cScale1=this.cScale1||this.secondaryColor;this.cScale2=this.cScale2||this.tertiaryColor;this.cScale3=this.cScale3||$t(this.primaryColor,{h:30});this.cScale4=this.cScale4||$t(this.primaryColor,{h:60});this.cScale5=this.cScale5||$t(this.primaryColor,{h:90});this.cScale6=this.cScale6||$t(this.primaryColor,{h:120});this.cScale7=this.cScale7||$t(this.primaryColor,{h:150});this.cScale8=this.cScale8||$t(this.primaryColor,{h:210,l:150});this.cScale9=this.cScale9||$t(this.primaryColor,{h:270});this.cScale10=this.cScale10||$t(this.primaryColor,{h:300});this.cScale11=this.cScale11||$t(this.primaryColor,{h:330});if(this.darkMode){for(let t=0;t{this[n]=e[n]});this.updateColors();t.forEach(n=>{this[n]=e[n]})}};T0i=B(e=>{const t=new _0i;t.calculate(e);return t},"getThemeVariables");w0i=class{static{B(this,"Theme")}constructor(){this.background="#333";this.primaryColor="#1f2020";this.secondaryColor=Nr(this.primaryColor,16);this.tertiaryColor=$t(this.primaryColor,{h:-160});this.primaryBorderColor=mr(this.background);this.secondaryBorderColor=rs(this.secondaryColor,this.darkMode);this.tertiaryBorderColor=rs(this.tertiaryColor,this.darkMode);this.primaryTextColor=mr(this.primaryColor);this.secondaryTextColor=mr(this.secondaryColor);this.tertiaryTextColor=mr(this.tertiaryColor);this.lineColor=mr(this.background);this.textColor=mr(this.background);this.mainBkg="#1f2020";this.secondBkg="calculated";this.mainContrastColor="lightgrey";this.darkTextColor=Nr(mr("#323D47"),10);this.lineColor="calculated";this.border1="#ccc";this.border2=mh(255,255,255,.25);this.arrowheadColor="calculated";this.fontFamily='"trebuchet ms", verdana, arial, sans-serif';this.fontSize="16px";this.labelBackground="#181818";this.textColor="#ccc";this.THEME_COLOR_LIMIT=12;this.radius=5;this.strokeWidth=1;this.nodeBkg="calculated";this.nodeBorder="calculated";this.clusterBkg="calculated";this.clusterBorder="calculated";this.defaultLinkColor="calculated";this.titleColor="#F9FFFE";this.edgeLabelBackground="calculated";this.actorBorder="calculated";this.actorBkg="calculated";this.actorTextColor="calculated";this.actorLineColor="calculated";this.signalColor="calculated";this.signalTextColor="calculated";this.labelBoxBkgColor="calculated";this.labelBoxBorderColor="calculated";this.labelTextColor="calculated";this.loopTextColor="calculated";this.noteBorderColor="calculated";this.noteBkgColor="#fff5ad";this.noteTextColor="calculated";this.activationBorderColor="calculated";this.activationBkgColor="calculated";this.sequenceNumberColor="black";this.clusterBkg="#302F3D";this.sectionBkgColor=Or("#EAE8D9",30);this.altSectionBkgColor="calculated";this.sectionBkgColor2="#EAE8D9";this.excludeBkgColor=Or(this.sectionBkgColor,10);this.taskBorderColor=mh(255,255,255,70);this.taskBkgColor="calculated";this.taskTextColor="calculated";this.taskTextLightColor="calculated";this.taskTextOutsideColor="calculated";this.taskTextClickableColor="#003163";this.activeTaskBorderColor=mh(255,255,255,50);this.activeTaskBkgColor="#81B1DB";this.gridColor="calculated";this.doneTaskBkgColor="calculated";this.doneTaskBorderColor="grey";this.critBorderColor="#E83737";this.critBkgColor="#E83737";this.taskTextDarkColor="calculated";this.todayLineColor="#DB5757";this.vertLineColor="#00BFFF";this.personBorder=this.primaryBorderColor;this.personBkg=this.mainBkg;this.archEdgeColor="calculated";this.archEdgeArrowColor="calculated";this.archEdgeWidth="3";this.archGroupBorderColor=this.primaryBorderColor;this.archGroupBorderWidth="2px";this.rowOdd=this.rowOdd||Nr(this.mainBkg,5)||"#ffffff";this.rowEven=this.rowEven||Or(this.mainBkg,10);this.labelColor="calculated";this.errorBkgColor="#a44141";this.errorTextColor="#ddd";this.useGradient=true;this.gradientStart=this.primaryBorderColor;this.gradientStop=this.secondaryBorderColor;this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))";this.noteFontWeight=this.noteFontWeight||"normal";this.fontWeight=this.fontWeight||"normal"}updateColors(){this.secondBkg=Nr(this.mainBkg,16);this.lineColor=this.mainContrastColor;this.arrowheadColor=this.mainContrastColor;this.nodeBkg=this.mainBkg;this.nodeBorder=this.border1;this.clusterBkg=this.secondBkg;this.clusterBorder=this.border2;this.defaultLinkColor=this.lineColor;this.edgeLabelBackground=Nr(this.labelBackground,25);this.actorBorder=this.border1;this.actorBkg=this.mainBkg;this.actorTextColor=this.mainContrastColor;this.actorLineColor=this.actorBorder;this.signalColor=this.mainContrastColor;this.signalTextColor=this.mainContrastColor;this.labelBoxBkgColor=this.actorBkg;this.labelBoxBorderColor=this.actorBorder;this.labelTextColor=this.mainContrastColor;this.loopTextColor=this.mainContrastColor;this.noteBorderColor=this.secondaryBorderColor;this.noteBkgColor=this.secondBkg;this.noteTextColor=this.secondaryTextColor;this.activationBorderColor=this.border1;this.activationBkgColor=this.secondBkg;this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;this.altSectionBkgColor=this.background;this.taskBkgColor=Nr(this.mainBkg,23);this.taskTextColor=this.darkTextColor;this.taskTextLightColor=this.mainContrastColor;this.taskTextOutsideColor=this.taskTextLightColor;this.gridColor=this.mainContrastColor;this.doneTaskBkgColor=this.mainContrastColor;this.taskTextDarkColor=mr(this.doneTaskBkgColor);this.archEdgeColor=this.lineColor;this.archEdgeArrowColor=this.lineColor;this.transitionColor=this.transitionColor||this.lineColor;this.transitionLabelColor=this.transitionLabelColor||this.textColor;this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor;this.stateBkg=this.stateBkg||this.mainBkg;this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg;this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor;this.altBackground=this.altBackground||"#555";this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg;this.compositeBorder=this.compositeBorder||this.nodeBorder;this.innerEndBackground=this.primaryBorderColor;this.specialStateColor="#f4f4f4";this.errorBkgColor=this.errorBkgColor||this.tertiaryColor;this.errorTextColor=this.errorTextColor||this.tertiaryTextColor;this.fillType0=this.primaryColor;this.fillType1=this.secondaryColor;this.fillType2=$t(this.primaryColor,{h:64});this.fillType3=$t(this.secondaryColor,{h:64});this.fillType4=$t(this.primaryColor,{h:-64});this.fillType5=$t(this.secondaryColor,{h:-64});this.fillType6=$t(this.primaryColor,{h:128});this.fillType7=$t(this.secondaryColor,{h:128});this.cScale1=this.cScale1||"#0b0000";this.cScale2=this.cScale2||"#4d1037";this.cScale3=this.cScale3||"#3f5258";this.cScale4=this.cScale4||"#4f2f1b";this.cScale5=this.cScale5||"#6e0a0a";this.cScale6=this.cScale6||"#3b0048";this.cScale7=this.cScale7||"#995a01";this.cScale8=this.cScale8||"#154706";this.cScale9=this.cScale9||"#161722";this.cScale10=this.cScale10||"#00296f";this.cScale11=this.cScale11||"#01629c";this.cScale12=this.cScale12||"#010029";this.cScale0=this.cScale0||this.primaryColor;this.cScale1=this.cScale1||this.secondaryColor;this.cScale2=this.cScale2||this.tertiaryColor;this.cScale3=this.cScale3||$t(this.primaryColor,{h:30});this.cScale4=this.cScale4||$t(this.primaryColor,{h:60});this.cScale5=this.cScale5||$t(this.primaryColor,{h:90});this.cScale6=this.cScale6||$t(this.primaryColor,{h:120});this.cScale7=this.cScale7||$t(this.primaryColor,{h:150});this.cScale8=this.cScale8||$t(this.primaryColor,{h:210});this.cScale9=this.cScale9||$t(this.primaryColor,{h:270});this.cScale10=this.cScale10||$t(this.primaryColor,{h:300});this.cScale11=this.cScale11||$t(this.primaryColor,{h:330});for(let e=0;e{this[n]=e[n]});this.updateColors();t.forEach(n=>{this[n]=e[n]})}};E0i=B(e=>{const t=new w0i;t.calculate(e);return t},"getThemeVariables");C0i=class{static{B(this,"Theme")}constructor(){this.background="#f4f4f4";this.primaryColor="#ECECFF";this.secondaryColor=$t(this.primaryColor,{h:120});this.secondaryColor="#ffffde";this.tertiaryColor=$t(this.primaryColor,{h:-160});this.primaryBorderColor=rs(this.primaryColor,this.darkMode);this.secondaryBorderColor=rs(this.secondaryColor,this.darkMode);this.tertiaryBorderColor=rs(this.tertiaryColor,this.darkMode);this.primaryTextColor=mr(this.primaryColor);this.secondaryTextColor=mr(this.secondaryColor);this.tertiaryTextColor=mr(this.tertiaryColor);this.lineColor=mr(this.background);this.textColor=mr(this.background);this.background="white";this.mainBkg="#ECECFF";this.secondBkg="#ffffde";this.lineColor="#333333";this.border1="#9370DB";this.primaryBorderColor=rs(this.primaryColor,this.darkMode);this.border2="#aaaa33";this.arrowheadColor="#333333";this.fontFamily='"trebuchet ms", verdana, arial, sans-serif';this.fontSize="16px";this.labelBackground="rgba(232,232,232, 0.8)";this.textColor="#333";this.THEME_COLOR_LIMIT=12;this.radius=5;this.strokeWidth=1;this.nodeBkg="calculated";this.nodeBorder="calculated";this.clusterBkg="calculated";this.clusterBorder="calculated";this.defaultLinkColor="calculated";this.titleColor="calculated";this.edgeLabelBackground="calculated";this.actorBorder="calculated";this.actorBkg="calculated";this.actorTextColor="black";this.actorLineColor="calculated";this.signalColor="calculated";this.signalTextColor="calculated";this.labelBoxBkgColor="calculated";this.labelBoxBorderColor="calculated";this.labelTextColor="calculated";this.loopTextColor="calculated";this.noteBorderColor="calculated";this.noteBkgColor="#fff5ad";this.noteTextColor="calculated";this.activationBorderColor="#666";this.activationBkgColor="#f4f4f4";this.sequenceNumberColor="white";this.clusterBkg="#FBFBFF";this.sectionBkgColor="calculated";this.altSectionBkgColor="calculated";this.sectionBkgColor2="calculated";this.excludeBkgColor="#eeeeee";this.taskBorderColor="calculated";this.taskBkgColor="calculated";this.taskTextLightColor="calculated";this.taskTextColor=this.taskTextLightColor;this.taskTextDarkColor="calculated";this.taskTextOutsideColor=this.taskTextDarkColor;this.taskTextClickableColor="calculated";this.activeTaskBorderColor="calculated";this.activeTaskBkgColor="calculated";this.gridColor="calculated";this.doneTaskBkgColor="calculated";this.doneTaskBorderColor="calculated";this.critBorderColor="calculated";this.critBkgColor="calculated";this.todayLineColor="calculated";this.vertLineColor="calculated";this.sectionBkgColor=mh(102,102,255,.49);this.altSectionBkgColor="white";this.sectionBkgColor2="#fff400";this.taskBorderColor="#534fbc";this.taskBkgColor="#8a90dd";this.taskTextLightColor="white";this.taskTextColor="calculated";this.taskTextDarkColor="black";this.taskTextOutsideColor="calculated";this.taskTextClickableColor="#003163";this.activeTaskBorderColor="#534fbc";this.activeTaskBkgColor="#bfc7ff";this.gridColor="lightgrey";this.doneTaskBkgColor="lightgrey";this.doneTaskBorderColor="grey";this.critBorderColor="#ff8888";this.critBkgColor="red";this.todayLineColor="red";this.vertLineColor="navy";this.noteFontWeight=this.noteFontWeight||"normal";this.fontWeight=this.fontWeight||"normal";this.personBorder=this.primaryBorderColor;this.personBkg=this.mainBkg;this.archEdgeColor="calculated";this.archEdgeArrowColor="calculated";this.archEdgeWidth="3";this.archGroupBorderColor=this.primaryBorderColor;this.archGroupBorderWidth="2px";this.rowOdd="calculated";this.rowEven="calculated";this.labelColor="black";this.errorBkgColor="#552222";this.errorTextColor="#552222";this.useGradient=false;this.gradientStart=this.primaryBorderColor;this.gradientStop=this.secondaryBorderColor;this.dropShadow="drop-shadow(1px 2px 2px rgba(185, 185, 185, 1))";this.updateColors()}updateColors(){this.cScale0=this.cScale0||this.primaryColor;this.cScale1=this.cScale1||this.secondaryColor;this.cScale2=this.cScale2||this.tertiaryColor;this.cScale3=this.cScale3||$t(this.primaryColor,{h:30});this.cScale4=this.cScale4||$t(this.primaryColor,{h:60});this.cScale5=this.cScale5||$t(this.primaryColor,{h:90});this.cScale6=this.cScale6||$t(this.primaryColor,{h:120});this.cScale7=this.cScale7||$t(this.primaryColor,{h:150});this.cScale8=this.cScale8||$t(this.primaryColor,{h:210});this.cScale9=this.cScale9||$t(this.primaryColor,{h:270});this.cScale10=this.cScale10||$t(this.primaryColor,{h:300});this.cScale11=this.cScale11||$t(this.primaryColor,{h:330});this["cScalePeer1"]=this["cScalePeer1"]||Or(this.secondaryColor,45);this["cScalePeer2"]=this["cScalePeer2"]||Or(this.tertiaryColor,40);for(let e=0;e{if(this[n]==="calculated"){this[n]=void 0}});if(typeof e!=="object"){this.updateColors();return}const t=Object.keys(e);t.forEach(n=>{this[n]=e[n]});this.updateColors();t.forEach(n=>{this[n]=e[n]})}};Vy=B(e=>{const t=new C0i;t.calculate(e);return t},"getThemeVariables");S0i=class{static{B(this,"Theme")}constructor(){this.background="#f4f4f4";this.primaryColor="#cde498";this.secondaryColor="#cdffb2";this.background="white";this.mainBkg="#cde498";this.secondBkg="#cdffb2";this.lineColor="green";this.border1="#13540c";this.border2="#6eaa49";this.arrowheadColor="green";this.fontFamily='"trebuchet ms", verdana, arial, sans-serif';this.fontSize="16px";this.tertiaryColor=Nr("#cde498",10);this.primaryBorderColor=rs(this.primaryColor,this.darkMode);this.secondaryBorderColor=rs(this.secondaryColor,this.darkMode);this.tertiaryBorderColor=rs(this.tertiaryColor,this.darkMode);this.primaryTextColor=mr(this.primaryColor);this.secondaryTextColor=mr(this.secondaryColor);this.tertiaryTextColor=mr(this.primaryColor);this.lineColor=mr(this.background);this.textColor=mr(this.background);this.THEME_COLOR_LIMIT=12;this.radius=5;this.strokeWidth=1;this.nodeBkg="calculated";this.nodeBorder="calculated";this.clusterBkg="calculated";this.clusterBorder="calculated";this.defaultLinkColor="calculated";this.titleColor="#333";this.edgeLabelBackground="#e8e8e8";this.actorBorder="calculated";this.actorBkg="calculated";this.actorTextColor="black";this.actorLineColor="calculated";this.signalColor="#333";this.signalTextColor="#333";this.labelBoxBkgColor="calculated";this.labelBoxBorderColor="#326932";this.labelTextColor="calculated";this.loopTextColor="calculated";this.noteBorderColor="calculated";this.noteBkgColor="#fff5ad";this.noteTextColor="calculated";this.activationBorderColor="#666";this.activationBkgColor="#f4f4f4";this.sequenceNumberColor="white";this.sectionBkgColor="#6eaa49";this.altSectionBkgColor="white";this.sectionBkgColor2="#6eaa49";this.excludeBkgColor="#eeeeee";this.taskBorderColor="calculated";this.taskBkgColor="#487e3a";this.taskTextLightColor="white";this.taskTextColor="calculated";this.taskTextDarkColor="black";this.taskTextOutsideColor="calculated";this.taskTextClickableColor="#003163";this.activeTaskBorderColor="calculated";this.activeTaskBkgColor="calculated";this.gridColor="lightgrey";this.doneTaskBkgColor="lightgrey";this.doneTaskBorderColor="grey";this.critBorderColor="#ff8888";this.critBkgColor="red";this.todayLineColor="red";this.vertLineColor="#00BFFF";this.personBorder=this.primaryBorderColor;this.personBkg=this.mainBkg;this.archEdgeColor="calculated";this.archEdgeArrowColor="calculated";this.archEdgeWidth="3";this.archGroupBorderColor=this.primaryBorderColor;this.archGroupBorderWidth="2px";this.noteFontWeight="normal";this.fontWeight="normal";this.labelColor="black";this.errorBkgColor="#552222";this.errorTextColor="#552222";this.useGradient=true;this.gradientStart=this.primaryBorderColor;this.gradientStop=this.secondaryBorderColor;this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))"}updateColors(){this.actorBorder=Or(this.mainBkg,20);this.actorBkg=this.mainBkg;this.labelBoxBkgColor=this.actorBkg;this.labelTextColor=this.actorTextColor;this.loopTextColor=this.actorTextColor;this.noteBorderColor=this.border2;this.noteTextColor=this.actorTextColor;this.actorLineColor=this.actorBorder;this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;this.cScale0=this.cScale0||this.primaryColor;this.cScale1=this.cScale1||this.secondaryColor;this.cScale2=this.cScale2||this.tertiaryColor;this.cScale3=this.cScale3||$t(this.primaryColor,{h:30});this.cScale4=this.cScale4||$t(this.primaryColor,{h:60});this.cScale5=this.cScale5||$t(this.primaryColor,{h:90});this.cScale6=this.cScale6||$t(this.primaryColor,{h:120});this.cScale7=this.cScale7||$t(this.primaryColor,{h:150});this.cScale8=this.cScale8||$t(this.primaryColor,{h:210});this.cScale9=this.cScale9||$t(this.primaryColor,{h:270});this.cScale10=this.cScale10||$t(this.primaryColor,{h:300});this.cScale11=this.cScale11||$t(this.primaryColor,{h:330});this["cScalePeer1"]=this["cScalePeer1"]||Or(this.secondaryColor,45);this["cScalePeer2"]=this["cScalePeer2"]||Or(this.tertiaryColor,40);for(let e=0;e{this[n]=e[n]});this.updateColors();t.forEach(n=>{this[n]=e[n]})}};A0i=B(e=>{const t=new S0i;t.calculate(e);return t},"getThemeVariables");k0i=class{static{B(this,"Theme")}constructor(){this.primaryColor="#eee";this.contrast="#707070";this.secondaryColor=Nr(this.contrast,55);this.background="#ffffff";this.tertiaryColor=$t(this.primaryColor,{h:-160});this.primaryBorderColor=rs(this.primaryColor,this.darkMode);this.secondaryBorderColor=rs(this.secondaryColor,this.darkMode);this.tertiaryBorderColor=rs(this.tertiaryColor,this.darkMode);this.primaryTextColor=mr(this.primaryColor);this.secondaryTextColor=mr(this.secondaryColor);this.tertiaryTextColor=mr(this.tertiaryColor);this.lineColor=mr(this.background);this.textColor=mr(this.background);this.mainBkg="#eee";this.secondBkg="calculated";this.lineColor="#666";this.border1="#999";this.border2="calculated";this.note="#ffa";this.text="#333";this.critical="#d42";this.done="#bbb";this.arrowheadColor="#333333";this.fontFamily='"trebuchet ms", verdana, arial, sans-serif';this.fontSize="16px";this.THEME_COLOR_LIMIT=12;this.radius=5;this.strokeWidth=1;this.nodeBkg="calculated";this.nodeBorder="calculated";this.clusterBkg="calculated";this.clusterBorder="calculated";this.defaultLinkColor="calculated";this.titleColor="calculated";this.edgeLabelBackground="white";this.actorBorder="calculated";this.actorBkg="calculated";this.actorTextColor="calculated";this.actorLineColor=this.actorBorder;this.signalColor="calculated";this.signalTextColor="calculated";this.labelBoxBkgColor="calculated";this.labelBoxBorderColor="calculated";this.labelTextColor="calculated";this.loopTextColor="calculated";this.noteBorderColor="calculated";this.noteBkgColor="calculated";this.noteTextColor="calculated";this.activationBorderColor="#666";this.activationBkgColor="#f4f4f4";this.sequenceNumberColor="white";this.sectionBkgColor="calculated";this.altSectionBkgColor="white";this.sectionBkgColor2="calculated";this.excludeBkgColor="#eeeeee";this.taskBorderColor="calculated";this.taskBkgColor="calculated";this.taskTextLightColor="white";this.taskTextColor="calculated";this.taskTextDarkColor="calculated";this.taskTextOutsideColor="calculated";this.taskTextClickableColor="#003163";this.activeTaskBorderColor="calculated";this.activeTaskBkgColor="calculated";this.gridColor="calculated";this.doneTaskBkgColor="calculated";this.doneTaskBorderColor="calculated";this.critBkgColor="calculated";this.critBorderColor="calculated";this.todayLineColor="calculated";this.vertLineColor="calculated";this.personBorder=this.primaryBorderColor;this.personBkg=this.mainBkg;this.archEdgeColor="calculated";this.archEdgeArrowColor="calculated";this.archEdgeWidth="3";this.archGroupBorderColor=this.primaryBorderColor;this.archGroupBorderWidth="2px";this.noteFontWeight="normal";this.fontWeight="normal";this.rowOdd=this.rowOdd||Nr(this.mainBkg,75)||"#ffffff";this.rowEven=this.rowEven||"#f4f4f4";this.labelColor="black";this.errorBkgColor="#552222";this.errorTextColor="#552222";this.useGradient=true;this.gradientStart=this.primaryBorderColor;this.gradientStop=this.secondaryBorderColor;this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){this.secondBkg=Nr(this.contrast,55);this.border2=this.contrast;this.actorBorder=Nr(this.border1,23);this.actorBkg=this.mainBkg;this.actorTextColor=this.text;this.actorLineColor=this.actorBorder;this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;this.signalColor=this.text;this.signalTextColor=this.text;this.labelBoxBkgColor=this.actorBkg;this.labelBoxBorderColor=this.actorBorder;this.labelTextColor=this.text;this.loopTextColor=this.text;this.noteBorderColor="#999";this.noteBkgColor="#666";this.noteTextColor="#fff";this.cScale0=this.cScale0||"#555";this.cScale1=this.cScale1||"#F4F4F4";this.cScale2=this.cScale2||"#555";this.cScale3=this.cScale3||"#BBB";this.cScale4=this.cScale4||"#777";this.cScale5=this.cScale5||"#999";this.cScale6=this.cScale6||"#DDD";this.cScale7=this.cScale7||"#FFF";this.cScale8=this.cScale8||"#DDD";this.cScale9=this.cScale9||"#BBB";this.cScale10=this.cScale10||"#999";this.cScale11=this.cScale11||"#777";for(let e=0;e{this[n]=e[n]});this.updateColors();t.forEach(n=>{this[n]=e[n]})}};R0i=B(e=>{const t=new k0i;t.calculate(e);return t},"getThemeVariables");P0i=class{static{B(this,"Theme")}constructor(){this.background="#ffffff";this.primaryColor="#cccccc";this.mainBkg="#ffffff";this.noteBkgColor="#fff5ad";this.noteTextColor="#333";this.THEME_COLOR_LIMIT=12;this.radius=3;this.strokeWidth=2;this.primaryBorderColor=rs(this.primaryColor,this.darkMode);this.fontFamily="arial, sans-serif";this.fontSize="14px";this.nodeBorder="#000000";this.stateBorder="#000000";this.useGradient=true;this.gradientStart="#0042eb";this.gradientStop="#eb0042";this.dropShadow="drop-shadow( 0px 1px 2px rgba(0, 0, 0, 0.25));";this.tertiaryColor="#ffffff";this.archEdgeColor="calculated";this.archEdgeArrowColor="calculated";this.archEdgeWidth="3";this.archGroupBorderColor=this.primaryBorderColor;this.archGroupBorderWidth="2px";this.noteFontWeight="normal";this.fontWeight="normal"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333");this.secondaryColor=this.secondaryColor||$t(this.primaryColor,{h:-120});this.tertiaryColor=this.tertiaryColor||$t(this.primaryColor,{h:180,l:5});this.primaryBorderColor=this.primaryBorderColor||rs(this.primaryColor,this.darkMode);this.secondaryBorderColor=this.secondaryBorderColor||rs(this.secondaryColor,this.darkMode);this.tertiaryBorderColor=this.tertiaryBorderColor||rs(this.tertiaryColor,this.darkMode);this.noteBorderColor=this.noteBorderColor||rs(this.noteBkgColor,this.darkMode);this.noteBkgColor=this.noteBkgColor||"#fff5ad";this.noteTextColor=this.noteTextColor||"#333";this.secondaryTextColor=this.secondaryTextColor||mr(this.secondaryColor);this.tertiaryTextColor=this.tertiaryTextColor||mr(this.tertiaryColor);this.lineColor=this.lineColor||mr(this.background);this.arrowheadColor=this.arrowheadColor||mr(this.background);this.textColor=this.textColor||this.primaryTextColor;this.border2=this.border2||this.tertiaryBorderColor;this.nodeBkg=this.nodeBkg||this.primaryColor;this.mainBkg=this.mainBkg||this.primaryColor;this.nodeBorder=this.nodeBorder||this.primaryBorderColor;this.clusterBkg=this.clusterBkg||this.tertiaryColor;this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor;this.defaultLinkColor=this.defaultLinkColor||this.lineColor;this.titleColor=this.titleColor||this.tertiaryTextColor;this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Or(this.secondaryColor,30):this.secondaryColor);this.nodeTextColor=this.nodeTextColor||this.primaryTextColor;this.actorBorder=this.actorBorder||this.primaryBorderColor;this.actorBkg=this.actorBkg||this.mainBkg;this.actorTextColor=this.actorTextColor||this.primaryTextColor;this.actorLineColor=this.actorLineColor||this.actorBorder;this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg;this.signalColor=this.signalColor||this.textColor;this.signalTextColor=this.signalTextColor||this.textColor;this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder;this.labelTextColor=this.labelTextColor||this.actorTextColor;this.loopTextColor=this.loopTextColor||this.actorTextColor;this.activationBorderColor=this.activationBorderColor||Or(this.secondaryColor,10);this.activationBkgColor=this.activationBkgColor||this.secondaryColor;this.sequenceNumberColor=this.sequenceNumberColor||mr(this.lineColor);this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE";const t="#E9E9F1";const n=$t(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||n;this.altSectionBkgColor=this.altSectionBkgColor||"white";this.sectionBkgColor=this.sectionBkgColor||t;this.sectionBkgColor2=this.sectionBkgColor2||e;this.excludeBkgColor=this.excludeBkgColor||"#eeeeee";this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor;this.taskBkgColor=this.taskBkgColor||e;this.activeTaskBorderColor=this.activeTaskBorderColor||e;this.activeTaskBkgColor=this.activeTaskBkgColor||Nr(e,23);this.gridColor=this.gridColor||"lightgrey";this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey";this.doneTaskBorderColor=this.doneTaskBorderColor||"grey";this.critBorderColor=this.critBorderColor||"#ff8888";this.critBkgColor=this.critBkgColor||"red";this.todayLineColor=this.todayLineColor||"red";this.taskTextColor=this.taskTextColor||this.textColor;this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor;this.vertLineColor=this.vertLineColor||this.primaryBorderColor;this.taskTextLightColor=this.taskTextLightColor||this.textColor;this.taskTextColor=this.taskTextColor||this.primaryTextColor;this.taskTextDarkColor=this.taskTextDarkColor||this.textColor;this.taskTextClickableColor=this.taskTextClickableColor||"#003163";this.archEdgeColor=this.lineColor;this.archEdgeArrowColor=this.lineColor;this.personBorder=this.personBorder||this.primaryBorderColor;this.personBkg=this.personBkg||this.mainBkg;this.transitionColor=this.transitionColor||this.lineColor;this.transitionLabelColor=this.transitionLabelColor||this.textColor;this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor;this.stateBkg=this.stateBkg||this.mainBkg;this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg;this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor;this.altBackground=this.altBackground||"#f0f0f0";this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg;this.compositeBorder=this.compositeBorder||this.nodeBorder;this.innerEndBackground=this.nodeBorder;this.errorBkgColor=this.errorBkgColor||this.tertiaryColor;this.errorTextColor=this.errorTextColor||this.tertiaryTextColor;this.transitionColor=this.transitionColor||this.lineColor;this.specialStateColor=this.lineColor;this.cScale0=this.cScale0||e;this.cScale1=this.cScale1||t;this.cScale2=this.cScale2||n;this.cScale3=this.cScale3||$t(e,{h:30});this.cScale4=this.cScale4||$t(e,{h:60});this.cScale5=this.cScale5||$t(e,{h:90});this.cScale6=this.cScale6||$t(e,{h:120});this.cScale7=this.cScale7||$t(e,{h:150});this.cScale8=this.cScale8||$t(e,{h:210,l:150});this.cScale9=this.cScale9||$t(e,{h:270});this.cScale10=this.cScale10||$t(e,{h:300});this.cScale11=this.cScale11||$t(e,{h:330});if(this.darkMode){for(let i=0;i{this[n]=e[n]});this.updateColors();t.forEach(n=>{this[n]=e[n]})}};I0i=B(e=>{const t=new P0i;t.calculate(e);return t},"getThemeVariables");M0i=class{static{B(this,"Theme")}constructor(){this.background="#333";this.primaryColor="#1f2020";this.secondaryColor=Nr(this.primaryColor,16);this.tertiaryColor=$t(this.primaryColor,{h:-160});this.primaryBorderColor=mr(this.background);this.secondaryBorderColor=rs(this.secondaryColor,this.darkMode);this.tertiaryBorderColor=rs(this.tertiaryColor,this.darkMode);this.primaryTextColor=mr(this.primaryColor);this.secondaryTextColor=mr(this.secondaryColor);this.tertiaryTextColor=mr(this.tertiaryColor);this.mainBkg="#2a2020";this.secondBkg="calculated";this.mainContrastColor="lightgrey";this.darkTextColor=Nr(mr("#323D47"),10);this.border1="#ccc";this.border2=mh(255,255,255,.25);this.arrowheadColor=mr(this.background);this.fontFamily="arial, sans-serif";this.fontSize="14px";this.labelBackground="#181818";this.textColor="#ccc";this.THEME_COLOR_LIMIT=12;this.radius=3;this.strokeWidth=1;this.noteBkgColor="#fff5ad";this.noteTextColor="#333";this.THEME_COLOR_LIMIT=12;this.fontFamily="arial, sans-serif";this.fontSize="14px";this.useGradient=true;this.gradientStart="#0042eb";this.gradientStop="#eb0042";this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.2))";this.archEdgeColor="calculated";this.archEdgeArrowColor="calculated";this.archEdgeWidth="3";this.archGroupBorderColor=this.primaryBorderColor;this.archGroupBorderWidth="2px";this.noteFontWeight="normal";this.fontWeight="normal"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333");this.secondaryColor=this.secondaryColor||$t(this.primaryColor,{h:-120});this.tertiaryColor=this.tertiaryColor||$t(this.primaryColor,{h:180,l:5});this.primaryBorderColor=this.primaryBorderColor||rs(this.primaryColor,this.darkMode);this.secondaryBorderColor=this.secondaryBorderColor||rs(this.secondaryColor,this.darkMode);this.tertiaryBorderColor=this.tertiaryBorderColor||rs(this.tertiaryColor,this.darkMode);this.noteBorderColor=this.noteBorderColor||rs(this.noteBkgColor,this.darkMode);this.noteBkgColor=this.noteBkgColor||"#fff5ad";this.noteTextColor=this.noteTextColor||"#333";this.secondaryTextColor=this.secondaryTextColor||mr(this.secondaryColor);this.tertiaryTextColor=this.tertiaryTextColor||mr(this.tertiaryColor);this.lineColor=this.lineColor||mr(this.background);this.arrowheadColor=this.arrowheadColor||mr(this.background);this.textColor=this.textColor||this.primaryTextColor;this.border2=this.border2||this.tertiaryBorderColor;this.nodeBkg=this.nodeBkg||this.primaryColor;this.mainBkg=this.mainBkg||this.primaryColor;this.nodeBorder=this.nodeBorder||this.border1;this.clusterBkg=this.clusterBkg||this.tertiaryColor;this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor;this.defaultLinkColor=this.defaultLinkColor||this.lineColor;this.titleColor=this.titleColor||this.tertiaryTextColor;this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Or(this.secondaryColor,30):this.secondaryColor);this.nodeTextColor=this.nodeTextColor||this.primaryTextColor;this.actorBorder=this.actorBorder||this.primaryBorderColor;this.actorBkg=this.actorBkg||this.mainBkg;this.actorTextColor=this.actorTextColor||this.primaryTextColor;this.actorLineColor=this.actorLineColor||this.actorBorder;this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg;this.signalColor=this.signalColor||this.textColor;this.signalTextColor=this.signalTextColor||this.textColor;this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder;this.labelTextColor=this.labelTextColor||this.actorTextColor;this.loopTextColor=this.loopTextColor||this.actorTextColor;this.activationBorderColor=this.activationBorderColor||Or(this.secondaryColor,10);this.activationBkgColor=this.activationBkgColor||this.secondaryColor;this.sequenceNumberColor=this.sequenceNumberColor||mr(this.lineColor);this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor;this.altSectionBkgColor=this.altSectionBkgColor||"white";this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor;this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor;this.excludeBkgColor=this.excludeBkgColor||"#eeeeee";this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor;this.taskBkgColor=this.taskBkgColor||this.primaryColor;this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor;this.activeTaskBkgColor=this.activeTaskBkgColor||Nr(this.primaryColor,23);this.gridColor=this.gridColor||"lightgrey";this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey";this.doneTaskBorderColor=this.doneTaskBorderColor||"grey";this.critBorderColor=this.critBorderColor||"#ff8888";this.critBkgColor=this.critBkgColor||"red";this.todayLineColor=this.todayLineColor||"red";this.vertLineColor=this.vertLineColor||this.primaryBorderColor;this.taskTextColor=this.taskTextColor||this.textColor;this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor;this.taskTextLightColor=this.taskTextLightColor||this.textColor;this.taskTextColor=this.taskTextColor||this.primaryTextColor;this.taskTextDarkColor=this.taskTextDarkColor||this.textColor;this.taskTextClickableColor=this.taskTextClickableColor||"#003163";this.archEdgeColor=this.lineColor;this.archEdgeArrowColor=this.lineColor;this.personBorder=this.personBorder||this.primaryBorderColor;this.personBkg=this.personBkg||this.mainBkg;this.transitionColor=this.transitionColor||this.lineColor;this.transitionLabelColor=this.transitionLabelColor||this.textColor;this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor;this.stateBkg=this.stateBkg||this.mainBkg;this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg;this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor;this.altBackground=this.altBackground||"#f0f0f0";this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg;this.compositeBorder=this.compositeBorder||this.nodeBorder;this.innerEndBackground=this.nodeBorder;this.errorBkgColor=this.errorBkgColor||this.tertiaryColor;this.errorTextColor=this.errorTextColor||this.tertiaryTextColor;this.transitionColor=this.transitionColor||this.lineColor;this.specialStateColor=this.lineColor;this.cScale0=this.cScale0||this.primaryColor;this.cScale1=this.cScale1||this.secondaryColor;this.cScale2=this.cScale2||this.tertiaryColor;this.cScale3=this.cScale3||$t(this.primaryColor,{h:30});this.cScale4=this.cScale4||$t(this.primaryColor,{h:60});this.cScale5=this.cScale5||$t(this.primaryColor,{h:90});this.cScale6=this.cScale6||$t(this.primaryColor,{h:120});this.cScale7=this.cScale7||$t(this.primaryColor,{h:150});this.cScale8=this.cScale8||$t(this.primaryColor,{h:210,l:150});this.cScale9=this.cScale9||$t(this.primaryColor,{h:270});this.cScale10=this.cScale10||$t(this.primaryColor,{h:300});this.cScale11=this.cScale11||$t(this.primaryColor,{h:330});if(this.darkMode){for(let t=0;t{this[n]=e[n]});this.updateColors();t.forEach(n=>{this[n]=e[n]})}};L0i=B(e=>{const t=new M0i;t.calculate(e);return t},"getThemeVariables");D0i=class{static{B(this,"Theme")}constructor(){this.background="#ffffff";this.primaryColor="#cccccc";this.mainBkg="#ffffff";this.noteBkgColor="#fff5ad";this.noteTextColor="#28253D";this.THEME_COLOR_LIMIT=12;this.radius=12;this.strokeWidth=2;this.primaryBorderColor=rs("#28253D",this.darkMode);this.fontFamily='"Recursive Variable", arial, sans-serif';this.fontSize="14px";this.nodeBorder="#28253D";this.stateBorder="#28253D";this.useGradient=false;this.gradientStart="#0042eb";this.gradientStop="#eb0042";this.dropShadow="url(#drop-shadow)";this.nodeShadow=true;this.tertiaryColor="#ffffff";this.clusterBkg="#F9F9FB";this.clusterBorder="#BDBCCC";this.noteBorderColor="#FACC15";this.archEdgeColor="calculated";this.archEdgeArrowColor="calculated";this.archEdgeWidth="3";this.archGroupBorderColor=this.primaryBorderColor;this.archGroupBorderWidth="2px";this.actorBorder="#28253D";this.filterColor="#000000"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D");this.secondaryColor=this.secondaryColor||$t(this.primaryColor,{h:-120});this.tertiaryColor=this.tertiaryColor||$t(this.primaryColor,{h:180,l:5});this.primaryBorderColor=this.primaryBorderColor||rs(this.primaryColor,this.darkMode);this.secondaryBorderColor=this.secondaryBorderColor||rs(this.secondaryColor,this.darkMode);this.tertiaryBorderColor=this.tertiaryBorderColor||rs(this.tertiaryColor,this.darkMode);this.noteBorderColor=this.noteBorderColor||rs(this.noteBkgColor,this.darkMode);this.noteBkgColor=this.noteBkgColor||"#FEF9C3";this.noteTextColor=this.noteTextColor||"#28253D";this.secondaryTextColor=this.secondaryTextColor||mr(this.secondaryColor);this.tertiaryTextColor=this.tertiaryTextColor||mr(this.tertiaryColor);this.lineColor=this.lineColor||mr(this.background);this.arrowheadColor=this.arrowheadColor||mr(this.background);this.textColor=this.textColor||this.primaryTextColor;this.border2=this.border2||this.tertiaryBorderColor;this.nodeBkg=this.nodeBkg||this.primaryColor;this.mainBkg=this.mainBkg||this.primaryColor;this.nodeBorder=this.nodeBorder||this.primaryBorderColor;this.clusterBkg=this.clusterBkg||this.tertiaryColor;this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor;this.defaultLinkColor=this.defaultLinkColor||this.lineColor;this.titleColor=this.titleColor||this.tertiaryTextColor;this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Or(this.secondaryColor,30):this.secondaryColor);this.nodeTextColor=this.nodeTextColor||this.primaryTextColor;this.noteFontWeight=600;this.actorBorder=this.actorBorder||this.primaryBorderColor;this.actorBkg=this.actorBkg||this.mainBkg;this.actorTextColor=this.actorTextColor||this.primaryTextColor;this.actorLineColor=this.actorLineColor||this.actorBorder;this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg;this.signalColor=this.signalColor||this.textColor;this.signalTextColor=this.signalTextColor||this.textColor;this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder;this.labelTextColor=this.labelTextColor||this.actorTextColor;this.loopTextColor=this.loopTextColor||this.actorTextColor;this.activationBorderColor=this.activationBorderColor||Or(this.secondaryColor,10);this.activationBkgColor=this.activationBkgColor||this.secondaryColor;this.sequenceNumberColor=this.sequenceNumberColor||mr(this.lineColor);this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE";const t="#E9E9F1";const n=$t(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||n;this.altSectionBkgColor=this.altSectionBkgColor||"white";this.sectionBkgColor=this.sectionBkgColor||t;this.sectionBkgColor2=this.sectionBkgColor2||e;this.excludeBkgColor=this.excludeBkgColor||"#eeeeee";this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor;this.taskBkgColor=this.taskBkgColor||e;this.activeTaskBorderColor=this.activeTaskBorderColor||e;this.activeTaskBkgColor=this.activeTaskBkgColor||Nr(e,23);this.gridColor=this.gridColor||"lightgrey";this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey";this.doneTaskBorderColor=this.doneTaskBorderColor||"grey";this.critBorderColor=this.critBorderColor||"#ff8888";this.critBkgColor=this.critBkgColor||"red";this.todayLineColor=this.todayLineColor||"red";this.taskTextColor=this.taskTextColor||this.textColor;this.vertLineColor=this.vertLineColor||this.primaryBorderColor;this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor;this.taskTextLightColor=this.taskTextLightColor||this.textColor;this.taskTextColor=this.taskTextColor||this.primaryTextColor;this.taskTextDarkColor=this.taskTextDarkColor||this.textColor;this.taskTextClickableColor=this.taskTextClickableColor||"#003163";this.archEdgeColor=this.lineColor;this.archEdgeArrowColor=this.lineColor;this.personBorder=this.personBorder||this.primaryBorderColor;this.personBkg=this.personBkg||this.mainBkg;this.transitionColor=this.transitionColor||this.lineColor;this.transitionLabelColor=this.transitionLabelColor||this.textColor;this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor;this.compositeTitleBackground="#F9F9FB";this.altBackground="#F9F9FB";this.stateEdgeLabelBackground="#FFFFFF";this.fontWeight=600;this.stateBkg=this.stateBkg||this.mainBkg;this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg;this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor;this.altBackground=this.altBackground||"#f0f0f0";this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg;this.compositeBorder=this.compositeBorder||this.nodeBorder;this.innerEndBackground=this.nodeBorder;this.errorBkgColor=this.errorBkgColor||this.tertiaryColor;this.errorTextColor=this.errorTextColor||this.tertiaryTextColor;this.transitionColor=this.transitionColor||this.lineColor;this.specialStateColor=this.lineColor;for(let i=0;i{this[n]=e[n]});this.updateColors();t.forEach(n=>{this[n]=e[n]})}};F0i=B(e=>{const t=new D0i;t.calculate(e);return t},"getThemeVariables");N0i=class{static{B(this,"Theme")}constructor(){this.background="#333";this.primaryColor="#1f2020";this.secondaryColor=Nr(this.primaryColor,16);this.tertiaryColor=$t(this.primaryColor,{h:-160});this.primaryBorderColor=mr(this.background);this.secondaryBorderColor=rs(this.secondaryColor,this.darkMode);this.tertiaryBorderColor=rs(this.tertiaryColor,this.darkMode);this.primaryTextColor=mr(this.primaryColor);this.secondaryTextColor=mr(this.secondaryColor);this.tertiaryTextColor=mr(this.tertiaryColor);this.mainBkg="#111113";this.secondBkg="calculated";this.mainContrastColor="lightgrey";this.darkTextColor=Nr(mr("#323D47"),10);this.border1="#ccc";this.border2=mh(255,255,255,.25);this.arrowheadColor=mr(this.background);this.fontFamily='"Recursive Variable", arial, sans-serif';this.fontSize="14px";this.labelBackground="#111113";this.textColor="#ccc";this.THEME_COLOR_LIMIT=12;this.radius=12;this.strokeWidth=2;this.noteBkgColor=this.noteBkgColor??"#FEF9C3";this.noteTextColor=this.noteTextColor??"#28253D";this.THEME_COLOR_LIMIT=12;this.fontFamily='"Recursive Variable", arial, sans-serif';this.fontSize="14px";this.nodeBorder="#FFFFFF";this.stateBorder="#FFFFFF";this.useGradient=false;this.gradientStart="#0042eb";this.gradientStop="#eb0042";this.dropShadow="url(#drop-shadow)";this.nodeShadow=true;this.archEdgeColor="calculated";this.archEdgeArrowColor="calculated";this.archEdgeWidth="3";this.archGroupBorderColor=this.primaryBorderColor;this.archGroupBorderWidth="2px";this.clusterBkg="#1E1A2E";this.clusterBorder="#BDBCCC";this.noteBorderColor="#FACC15";this.noteFontWeight=600;this.filterColor="#FFFFFF"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF");this.secondaryColor=this.secondaryColor||$t(this.primaryColor,{h:-120});this.tertiaryColor=this.tertiaryColor||$t(this.primaryColor,{h:180,l:5});this.primaryBorderColor=this.primaryBorderColor||rs(this.primaryColor,this.darkMode);this.secondaryBorderColor=this.secondaryBorderColor||rs(this.secondaryColor,this.darkMode);this.tertiaryBorderColor=this.tertiaryBorderColor||rs(this.tertiaryColor,this.darkMode);this.noteBorderColor=this.noteBorderColor||rs(this.noteBkgColor,this.darkMode);this.noteBkgColor=this.noteBkgColor||"#fff5ad";this.noteTextColor=this.noteTextColor||"#FFFFFF";this.secondaryTextColor=this.secondaryTextColor||mr(this.secondaryColor);this.tertiaryTextColor=this.tertiaryTextColor||mr(this.tertiaryColor);this.lineColor=this.lineColor||mr(this.background);this.arrowheadColor=this.arrowheadColor||mr(this.background);this.textColor=this.textColor||this.primaryTextColor;this.border2=this.border2||this.tertiaryBorderColor;this.nodeBkg=this.nodeBkg||this.primaryColor;this.mainBkg=this.mainBkg||this.primaryColor;this.nodeBorder=this.nodeBorder||this.border1;this.clusterBkg=this.clusterBkg||this.tertiaryColor;this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor;this.defaultLinkColor=this.defaultLinkColor||this.lineColor;this.titleColor=this.titleColor||this.tertiaryTextColor;this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Or(this.secondaryColor,30):this.secondaryColor);this.nodeTextColor=this.nodeTextColor||this.primaryTextColor;this.actorBorder="#FFFFFF";this.signalColor="#FFFFFF";this.labelBoxBorderColor="#BDBCCC";this.actorBorder=this.actorBorder||this.primaryBorderColor;this.actorBkg=this.actorBkg||this.mainBkg;this.actorTextColor=this.actorTextColor||this.primaryTextColor;this.actorLineColor=this.actorLineColor||this.actorBorder;this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg;this.signalColor=this.signalColor||this.textColor;this.signalTextColor=this.signalTextColor||this.textColor;this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder;this.labelTextColor=this.labelTextColor||this.actorTextColor;this.loopTextColor=this.loopTextColor||this.actorTextColor;this.activationBorderColor=this.activationBorderColor||Or(this.secondaryColor,10);this.activationBkgColor=this.activationBkgColor||this.secondaryColor;this.sequenceNumberColor=this.sequenceNumberColor||mr(this.lineColor);this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor;this.altSectionBkgColor=this.altSectionBkgColor||"white";this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor;this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor;this.excludeBkgColor=this.excludeBkgColor||"#eeeeee";this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor;this.taskBkgColor=this.taskBkgColor||this.primaryColor;this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor;this.activeTaskBkgColor=this.activeTaskBkgColor||Nr(this.primaryColor,23);this.gridColor=this.gridColor||"lightgrey";this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey";this.doneTaskBorderColor=this.doneTaskBorderColor||"grey";this.critBorderColor=this.critBorderColor||"#ff8888";this.critBkgColor=this.critBkgColor||"red";this.todayLineColor=this.todayLineColor||"red";this.taskTextColor=this.taskTextColor||this.textColor;this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor;this.taskTextLightColor=this.taskTextLightColor||this.textColor;this.taskTextColor=this.taskTextColor||this.primaryTextColor;this.taskTextDarkColor=this.taskTextDarkColor||this.textColor;this.taskTextClickableColor=this.taskTextClickableColor||"#003163";this.archEdgeColor=this.lineColor;this.archEdgeArrowColor=this.lineColor;this.personBorder=this.personBorder||this.primaryBorderColor;this.personBkg=this.personBkg||this.mainBkg;this.transitionColor=this.transitionColor||this.lineColor;this.transitionLabelColor=this.transitionLabelColor||this.textColor;this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor;this.vertLineColor=this.vertLineColor||this.primaryBorderColor;this.compositeBackground="#16141F";this.altBackground="#16141F";this.compositeTitleBackground="#16141F";this.stateEdgeLabelBackground="#16141F";this.fontWeight=600;this.stateBkg=this.stateBkg||this.mainBkg;this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg;this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor;this.altBackground=this.altBackground||"#f0f0f0";this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg;this.compositeBorder=this.compositeBorder||this.nodeBorder;this.innerEndBackground=this.nodeBorder;this.errorBkgColor=this.errorBkgColor||this.tertiaryColor;this.errorTextColor=this.errorTextColor||this.tertiaryTextColor;this.transitionColor=this.transitionColor||this.lineColor;this.specialStateColor=this.lineColor;this.cScale0=this.cScale0||this.primaryColor;this.cScale1=this.cScale1||this.secondaryColor;this.cScale2=this.cScale2||this.tertiaryColor;this.cScale3=this.cScale3||$t(this.primaryColor,{h:30});this.cScale4=this.cScale4||$t(this.primaryColor,{h:60});this.cScale5=this.cScale5||$t(this.primaryColor,{h:90});this.cScale6=this.cScale6||$t(this.primaryColor,{h:120});this.cScale7=this.cScale7||$t(this.primaryColor,{h:150});this.cScale8=this.cScale8||$t(this.primaryColor,{h:210,l:150});this.cScale9=this.cScale9||$t(this.primaryColor,{h:270});this.cScale10=this.cScale10||$t(this.primaryColor,{h:300});this.cScale11=this.cScale11||$t(this.primaryColor,{h:330});if(this.darkMode){for(let t=0;t{this[n]=e[n]});this.updateColors();t.forEach(n=>{this[n]=e[n]})}};O0i=B(e=>{const t=new N0i;t.calculate(e);return t},"getThemeVariables");B0i=class{static{B(this,"Theme")}constructor(){this.background="#ffffff";this.primaryColor="#cccccc";this.mainBkg="#ffffff";this.noteBkgColor="#fff5ad";this.noteTextColor="#28253D";this.THEME_COLOR_LIMIT=12;this.radius=12;this.strokeWidth=2;this.primaryBorderColor=rs(this.primaryColor,this.darkMode);this.fontFamily='"Recursive Variable", arial, sans-serif';this.fontSize="14px";this.nodeBorder="#28253D";this.stateBorder="#28253D";this.useGradient=false;this.gradientStart="#0042eb";this.gradientStop="#eb0042";this.dropShadow="url(#drop-shadow)";this.nodeShadow=true;this.tertiaryColor="#ffffff";this.archEdgeColor="calculated";this.archEdgeArrowColor="calculated";this.archEdgeWidth="3";this.archGroupBorderColor=this.primaryBorderColor;this.archGroupBorderWidth="2px";this.actorBorder="#28253D";this.noteBorderColor="#FACC15";this.noteFontWeight=600;this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"];this.bkgColorArray=["#FDF4FF","#F0FDFA","#FFF7ED","#ECFEFF","#F0FDF4","#F5F3FF","#FEF2F2","#FEFCE8","#EEF2FF","#F7FEE7","#F0F9FF","#FFF1F2"];this.filterColor="#000000"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D");this.secondaryColor=this.secondaryColor||$t(this.primaryColor,{h:-120});this.tertiaryColor=this.tertiaryColor||$t(this.primaryColor,{h:180,l:5});this.primaryBorderColor=this.primaryBorderColor||rs(this.primaryColor,this.darkMode);this.secondaryBorderColor=this.secondaryBorderColor||rs(this.secondaryColor,this.darkMode);this.tertiaryBorderColor=this.tertiaryBorderColor||rs(this.tertiaryColor,this.darkMode);this.noteBorderColor=this.noteBorderColor||rs(this.noteBkgColor,this.darkMode);this.noteBkgColor=this.noteBkgColor||"#fff5ad";this.noteTextColor=this.noteTextColor||"#28253D";this.secondaryTextColor=this.secondaryTextColor||mr(this.secondaryColor);this.tertiaryTextColor=this.tertiaryTextColor||mr(this.tertiaryColor);this.lineColor=this.lineColor||mr(this.background);this.arrowheadColor=this.arrowheadColor||mr(this.background);this.textColor=this.textColor||this.primaryTextColor;this.border2=this.border2||this.tertiaryBorderColor;this.nodeBkg=this.nodeBkg||this.primaryColor;this.mainBkg=this.mainBkg||this.primaryColor;this.nodeBorder=this.nodeBorder||this.primaryBorderColor;this.clusterBkg=this.clusterBkg||this.tertiaryColor;this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor;this.defaultLinkColor=this.defaultLinkColor||this.lineColor;this.titleColor=this.titleColor||this.tertiaryTextColor;this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Or(this.secondaryColor,30):this.secondaryColor);this.nodeTextColor=this.nodeTextColor||this.primaryTextColor;this.actorBorder=this.actorBorder||this.primaryBorderColor;this.actorBkg=this.actorBkg||this.mainBkg;this.actorTextColor=this.actorTextColor||this.primaryTextColor;this.actorLineColor=this.actorLineColor||this.actorBorder;this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg;this.signalColor=this.signalColor||this.textColor;this.signalTextColor=this.signalTextColor||this.textColor;this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder;this.labelTextColor=this.labelTextColor||this.actorTextColor;this.loopTextColor=this.loopTextColor||this.actorTextColor;this.activationBorderColor=this.activationBorderColor||Or(this.secondaryColor,10);this.activationBkgColor=this.activationBkgColor||this.secondaryColor;this.sequenceNumberColor=this.sequenceNumberColor||mr(this.lineColor);this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE";const t="#E9E9F1";const n=$t(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||n;this.altSectionBkgColor=this.altSectionBkgColor||"white";this.sectionBkgColor=this.sectionBkgColor||t;this.sectionBkgColor2=this.sectionBkgColor2||e;this.excludeBkgColor=this.excludeBkgColor||"#eeeeee";this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor;this.taskBkgColor=this.taskBkgColor||e;this.activeTaskBorderColor=this.activeTaskBorderColor||e;this.activeTaskBkgColor=this.activeTaskBkgColor||Nr(e,23);this.gridColor=this.gridColor||"lightgrey";this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey";this.doneTaskBorderColor=this.doneTaskBorderColor||"grey";this.critBorderColor=this.critBorderColor||"#ff8888";this.critBkgColor=this.critBkgColor||"red";this.todayLineColor=this.todayLineColor||"red";this.taskTextColor=this.taskTextColor||this.textColor;this.vertLineColor=this.vertLineColor||this.primaryBorderColor;this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor;this.taskTextLightColor=this.taskTextLightColor||this.textColor;this.taskTextColor=this.taskTextColor||this.primaryTextColor;this.taskTextDarkColor=this.taskTextDarkColor||this.textColor;this.taskTextClickableColor=this.taskTextClickableColor||"#003163";this.archEdgeColor=this.lineColor;this.archEdgeArrowColor=this.lineColor;this.personBorder=this.personBorder||this.primaryBorderColor;this.personBkg=this.personBkg||this.mainBkg;this.transitionColor=this.transitionColor||this.lineColor;this.transitionLabelColor=this.transitionLabelColor||this.textColor;this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor;this.stateBkg=this.stateBkg||this.mainBkg;this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg;this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor;this.altBackground=this.altBackground||"#f0f0f0";this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg;this.compositeBorder=this.compositeBorder||this.nodeBorder;this.innerEndBackground=this.nodeBorder;this.errorBkgColor=this.errorBkgColor||this.tertiaryColor;this.errorTextColor=this.errorTextColor||this.tertiaryTextColor;this.transitionColor=this.transitionColor||this.lineColor;this.specialStateColor=this.lineColor;this.cScale0=this.cScale0||"#f4a8ff";this.cScale1=this.cScale1||"#46ecd5";this.cScale2=this.cScale2||"#ffb86a";this.cScale3=this.cScale3||"#dab2ff";this.cScale4=this.cScale4||"#7bf1a8";this.cScale5=this.cScale5||"#c4b4ff";this.cScale6=this.cScale6||"#ffa2a2";this.cScale7=this.cScale7||"#ffdf20";this.cScale8=this.cScale8||"#a3b3ff";this.cScale9=this.cScale9||"#bbf451";this.cScale10=this.cScale10||"#74d4ff";this.cScale11=this.cScale11||"#ffa1ad";for(let i=0;i{this[n]=e[n]});this.updateColors();t.forEach(n=>{this[n]=e[n]})}};z0i=B(e=>{const t=new B0i;t.calculate(e);return t},"getThemeVariables");U0i=class{static{B(this,"Theme")}constructor(){this.background="#333";this.primaryColor="#1f2020";this.secondaryColor=Nr(this.primaryColor,16);this.tertiaryColor=$t(this.primaryColor,{h:-160});this.primaryBorderColor=mr(this.background);this.secondaryBorderColor=rs(this.secondaryColor,this.darkMode);this.tertiaryBorderColor=rs(this.tertiaryColor,this.darkMode);this.primaryTextColor=mr(this.primaryColor);this.secondaryTextColor=mr(this.secondaryColor);this.tertiaryTextColor=mr(this.tertiaryColor);this.mainBkg="#111113";this.secondBkg="calculated";this.mainContrastColor="lightgrey";this.darkTextColor=Nr(mr("#323D47"),10);this.border1="#ccc";this.border2=mh(255,255,255,.25);this.arrowheadColor=mr(this.background);this.fontFamily='"Recursive Variable", arial, sans-serif';this.fontSize="14px";this.labelBackground="#111113";this.textColor="#ccc";this.THEME_COLOR_LIMIT=12;this.radius=12;this.strokeWidth=2;this.noteBkgColor=this.noteBkgColor??"#FEF9C3";this.noteTextColor=this.noteTextColor??"#28253D";this.THEME_COLOR_LIMIT=12;this.fontFamily='"Recursive Variable", arial, sans-serif';this.fontSize="14px";this.nodeBorder="#FFFFFF";this.stateBorder="#FFFFFF";this.useGradient=false;this.gradientStart="#0042eb";this.gradientStop="#eb0042";this.dropShadow="url(#drop-shadow)";this.nodeShadow=true;this.archEdgeColor="calculated";this.archEdgeArrowColor="calculated";this.archEdgeWidth="3";this.archGroupBorderColor=this.primaryBorderColor;this.archGroupBorderWidth="2px";this.clusterBkg="#1E1A2E";this.clusterBorder="#BDBCCC";this.noteBorderColor="#FACC15";this.noteFontWeight=600;this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"];this.bkgColorArray=[];this.filterColor="#FFFFFF"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF");this.secondaryColor=this.secondaryColor||$t(this.primaryColor,{h:-120});this.tertiaryColor=this.tertiaryColor||$t(this.primaryColor,{h:180,l:5});this.primaryBorderColor=this.primaryBorderColor||rs(this.primaryColor,this.darkMode);this.secondaryBorderColor=this.secondaryBorderColor||rs(this.secondaryColor,this.darkMode);this.tertiaryBorderColor=this.tertiaryBorderColor||rs(this.tertiaryColor,this.darkMode);this.noteBorderColor=this.noteBorderColor||rs(this.noteBkgColor,this.darkMode);this.noteBkgColor=this.noteBkgColor||"#fff5ad";this.noteTextColor=this.noteTextColor||"#FFFFFF";this.secondaryTextColor=this.secondaryTextColor||mr(this.secondaryColor);this.tertiaryTextColor=this.tertiaryTextColor||mr(this.tertiaryColor);this.lineColor=this.lineColor||mr(this.background);this.arrowheadColor=this.arrowheadColor||mr(this.background);this.textColor=this.textColor||this.primaryTextColor;this.border2=this.border2||this.tertiaryBorderColor;this.nodeBkg=this.nodeBkg||this.primaryColor;this.mainBkg=this.mainBkg||this.primaryColor;this.nodeBorder=this.nodeBorder||this.border1;this.clusterBkg=this.clusterBkg||this.tertiaryColor;this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor;this.defaultLinkColor=this.defaultLinkColor||this.lineColor;this.titleColor=this.titleColor||this.tertiaryTextColor;this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Or(this.secondaryColor,30):this.secondaryColor);this.nodeTextColor=this.nodeTextColor||this.primaryTextColor;this.actorBorder="#FFFFFF";this.signalColor="#FFFFFF";this.labelBoxBorderColor="#BDBCCC";this.actorBorder=this.actorBorder||this.primaryBorderColor;this.actorBkg=this.actorBkg||this.mainBkg;this.actorTextColor=this.actorTextColor||this.primaryTextColor;this.actorLineColor=this.actorLineColor||this.actorBorder;this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg;this.signalColor=this.signalColor||this.textColor;this.signalTextColor=this.signalTextColor||this.textColor;this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder;this.labelTextColor=this.labelTextColor||this.actorTextColor;this.loopTextColor=this.loopTextColor||this.actorTextColor;this.activationBorderColor=this.activationBorderColor||Or(this.secondaryColor,10);this.activationBkgColor=this.activationBkgColor||this.secondaryColor;this.sequenceNumberColor=this.sequenceNumberColor||mr(this.lineColor);this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;this.rootLabelColor="#FFFFFF";this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor;this.altSectionBkgColor=this.altSectionBkgColor||"white";this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor;this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor;this.excludeBkgColor=this.excludeBkgColor||"#eeeeee";this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor;this.taskBkgColor=this.taskBkgColor||this.primaryColor;this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor;this.activeTaskBkgColor=this.activeTaskBkgColor||Nr(this.primaryColor,23);this.gridColor=this.gridColor||"lightgrey";this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey";this.doneTaskBorderColor=this.doneTaskBorderColor||"grey";this.critBorderColor=this.critBorderColor||"#ff8888";this.critBkgColor=this.critBkgColor||"red";this.todayLineColor=this.todayLineColor||"red";this.taskTextColor=this.taskTextColor||this.textColor;this.vertLineColor=this.vertLineColor||this.primaryBorderColor;this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor;this.taskTextLightColor=this.taskTextLightColor||this.textColor;this.taskTextColor=this.taskTextColor||this.primaryTextColor;this.taskTextDarkColor=this.taskTextDarkColor||this.textColor;this.taskTextClickableColor=this.taskTextClickableColor||"#003163";this.archEdgeColor=this.lineColor;this.archEdgeArrowColor=this.lineColor;this.personBorder=this.personBorder||this.primaryBorderColor;this.personBkg=this.personBkg||this.mainBkg;this.transitionColor=this.transitionColor||this.lineColor;this.transitionLabelColor=this.transitionLabelColor||this.textColor;this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor;this.stateBkg=this.stateBkg||this.mainBkg;this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg;this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor;this.altBackground=this.altBackground||"#f0f0f0";this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg;this.compositeBorder=this.compositeBorder||this.nodeBorder;this.innerEndBackground=this.nodeBorder;this.errorBkgColor=this.errorBkgColor||this.tertiaryColor;this.errorTextColor=this.errorTextColor||this.tertiaryTextColor;this.transitionColor=this.transitionColor||this.lineColor;this.specialStateColor=this.lineColor;this.cScale0=this.cScale0||"#f4a8ff";this.cScale1=this.cScale1||"#46ecd5";this.cScale2=this.cScale2||"#ffb86a";this.cScale3=this.cScale3||"#dab2ff";this.cScale4=this.cScale4||"#7bf1a8";this.cScale5=this.cScale5||"#c4b4ff";this.cScale6=this.cScale6||"#ffa2a2";this.cScale7=this.cScale7||"#ffdf20";this.cScale8=this.cScale8||"#a3b3ff";this.cScale9=this.cScale9||"#bbf451";this.cScale10=this.cScale10||"#74d4ff";this.cScale11=this.cScale11||"#ffa1ad";for(let t=0;t{this[n]=e[n]});this.updateColors();t.forEach(n=>{this[n]=e[n]})}};V0i=B(e=>{const t=new U0i;t.calculate(e);return t},"getThemeVariables");FC={base:{getThemeVariables:T0i},dark:{getThemeVariables:E0i},default:{getThemeVariables:Vy},forest:{getThemeVariables:A0i},neutral:{getThemeVariables:R0i},neo:{getThemeVariables:I0i},"neo-dark":{getThemeVariables:L0i},redux:{getThemeVariables:F0i},"redux-dark":{getThemeVariables:O0i},"redux-color":{getThemeVariables:z0i},"redux-dark-color":{getThemeVariables:V0i}};Tg={"flowchart":{"useMaxWidth":true,"titleTopMargin":25,"subGraphTitleMargin":{"top":0,"bottom":0},"diagramPadding":8,"htmlLabels":null,"nodeSpacing":50,"rankSpacing":50,"curve":"basis","padding":15,"defaultRenderer":"dagre-wrapper","wrappingWidth":200,"inheritDir":false},"swimlane":{"useMaxWidth":true,"lineHops":"arc","ignoreCrossLaneEdges":true,"optimizeRanksByCrossings":true,"automaticLaneOrdering":false},"sequence":{"useMaxWidth":true,"hideUnusedParticipants":false,"activationWidth":10,"diagramMarginX":50,"diagramMarginY":10,"actorMargin":50,"width":150,"height":65,"boxMargin":10,"boxTextMargin":5,"noteMargin":10,"messageMargin":35,"messageAlign":"center","mirrorActors":true,"forceMenus":false,"bottomMarginAdj":1,"rightAngles":false,"showSequenceNumbers":false,"actorFontSize":14,"actorFontFamily":'"Open Sans", sans-serif',"actorFontWeight":400,"noteFontSize":14,"noteFontFamily":'"trebuchet ms", verdana, arial, sans-serif',"noteFontWeight":400,"noteAlign":"center","messageFontSize":16,"messageFontFamily":'"trebuchet ms", verdana, arial, sans-serif',"messageFontWeight":400,"wrap":false,"wrapPadding":10,"labelBoxWidth":50,"labelBoxHeight":20},"gantt":{"useMaxWidth":true,"titleTopMargin":25,"barHeight":20,"barGap":4,"topPadding":50,"rightPadding":75,"leftPadding":75,"gridLineStartPadding":35,"fontSize":11,"sectionFontSize":11,"numberSectionStyles":4,"axisFormat":"%Y-%m-%d","topAxis":false,"displayMode":"","weekday":"sunday"},"journey":{"useMaxWidth":true,"diagramMarginX":50,"diagramMarginY":10,"leftMargin":150,"maxLabelWidth":360,"width":150,"height":50,"boxMargin":10,"boxTextMargin":5,"noteMargin":10,"messageMargin":35,"messageAlign":"center","bottomMarginAdj":1,"rightAngles":false,"taskFontSize":14,"taskFontFamily":'"Open Sans", sans-serif',"taskMargin":50,"activationWidth":10,"textPlacement":"fo","actorColours":["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],"sectionFills":["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],"sectionColours":["#fff"],"titleColor":"","titleFontFamily":'"trebuchet ms", verdana, arial, sans-serif',"titleFontSize":"4ex"},"class":{"useMaxWidth":true,"titleTopMargin":25,"arrowMarkerAbsolute":false,"dividerMargin":10,"padding":5,"textHeight":10,"defaultRenderer":"dagre-wrapper","htmlLabels":false,"hideEmptyMembersBox":false,"hierarchicalNamespaces":true},"state":{"useMaxWidth":true,"titleTopMargin":25,"dividerMargin":10,"sizeUnit":5,"padding":8,"textHeight":10,"titleShift":-15,"noteMargin":10,"forkWidth":70,"forkHeight":7,"miniPadding":2,"fontSizeFactor":5.02,"fontSize":24,"labelHeight":16,"edgeLengthFactor":"20","compositTitleSize":35,"radius":5,"defaultRenderer":"dagre-wrapper"},"er":{"useMaxWidth":true,"titleTopMargin":25,"diagramPadding":20,"layoutDirection":"TB","minEntityWidth":100,"minEntityHeight":75,"entityPadding":15,"nodeSpacing":140,"rankSpacing":80,"stroke":"gray","fill":"honeydew","fontSize":12},"pie":{"useMaxWidth":true,"textPosition":.75,"donutHole":0,"legendPosition":"right","highlightSlice":""},"quadrantChart":{"useMaxWidth":true,"chartWidth":500,"chartHeight":500,"titleFontSize":20,"titlePadding":10,"quadrantPadding":5,"xAxisLabelPadding":5,"yAxisLabelPadding":5,"xAxisLabelFontSize":16,"yAxisLabelFontSize":16,"quadrantLabelFontSize":16,"quadrantTextTopPadding":5,"pointTextPadding":5,"pointLabelFontSize":12,"pointRadius":5,"xAxisPosition":"top","yAxisPosition":"left","quadrantInternalBorderStrokeWidth":1,"quadrantExternalBorderStrokeWidth":2},"xyChart":{"useMaxWidth":true,"width":700,"height":500,"titleFontSize":20,"titlePadding":10,"showDataLabel":false,"showDataLabelOutsideBar":false,"showTitle":true,"xAxis":{"$ref":"#/$defs/XYChartAxisConfig","showLabel":true,"labelFontSize":14,"labelPadding":5,"showTitle":true,"titleFontSize":16,"titlePadding":5,"showTick":true,"tickLength":5,"tickWidth":2,"showAxisLine":true,"axisLineWidth":2,"labelRotation":0},"yAxis":{"$ref":"#/$defs/XYChartAxisConfig","showLabel":true,"labelFontSize":14,"labelPadding":5,"showTitle":true,"titleFontSize":16,"titlePadding":5,"showTick":true,"tickLength":5,"tickWidth":2,"showAxisLine":true,"axisLineWidth":2,"labelRotation":0},"chartOrientation":"vertical","plotReservedSpacePercent":50},"requirement":{"useMaxWidth":true,"rect_fill":"#f9f9f9","text_color":"#333","rect_border_size":"0.5px","rect_border_color":"#bbb","rect_min_width":200,"rect_min_height":200,"fontSize":14,"rect_padding":10,"line_height":20},"mindmap":{"useMaxWidth":true,"padding":10,"maxNodeWidth":200,"layoutAlgorithm":"cose-bilkent"},"ishikawa":{"useMaxWidth":true,"diagramPadding":20},"kanban":{"useMaxWidth":true,"padding":8,"sectionWidth":200,"ticketBaseUrl":""},"timeline":{"useMaxWidth":true,"diagramMarginX":50,"diagramMarginY":10,"leftMargin":150,"width":150,"height":50,"boxMargin":10,"boxTextMargin":5,"noteMargin":10,"messageMargin":35,"messageAlign":"center","bottomMarginAdj":1,"rightAngles":false,"taskFontSize":14,"taskFontFamily":'"Open Sans", sans-serif',"taskMargin":50,"activationWidth":10,"textPlacement":"fo","actorColours":["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],"sectionFills":["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],"sectionColours":["#fff"],"disableMulticolor":false},"gitGraph":{"useMaxWidth":true,"titleTopMargin":25,"diagramPadding":8,"nodeLabel":{"width":75,"height":100,"x":-25,"y":0},"mainBranchName":"main","mainBranchOrder":0,"showCommitLabel":true,"showBranches":true,"rotateCommitLabel":true,"parallelCommits":false,"arrowMarkerAbsolute":false},"c4":{"useMaxWidth":true,"diagramMarginX":50,"diagramMarginY":10,"c4ShapeMargin":50,"c4ShapePadding":20,"width":216,"height":60,"boxMargin":10,"c4ShapeInRow":4,"nextLinePaddingX":0,"c4BoundaryInRow":2,"personFontSize":14,"personFontFamily":'"Open Sans", sans-serif',"personFontWeight":"normal","external_personFontSize":14,"external_personFontFamily":'"Open Sans", sans-serif',"external_personFontWeight":"normal","systemFontSize":14,"systemFontFamily":'"Open Sans", sans-serif',"systemFontWeight":"normal","external_systemFontSize":14,"external_systemFontFamily":'"Open Sans", sans-serif',"external_systemFontWeight":"normal","system_dbFontSize":14,"system_dbFontFamily":'"Open Sans", sans-serif',"system_dbFontWeight":"normal","external_system_dbFontSize":14,"external_system_dbFontFamily":'"Open Sans", sans-serif',"external_system_dbFontWeight":"normal","system_queueFontSize":14,"system_queueFontFamily":'"Open Sans", sans-serif',"system_queueFontWeight":"normal","external_system_queueFontSize":14,"external_system_queueFontFamily":'"Open Sans", sans-serif',"external_system_queueFontWeight":"normal","boundaryFontSize":14,"boundaryFontFamily":'"Open Sans", sans-serif',"boundaryFontWeight":"normal","messageFontSize":12,"messageFontFamily":'"Open Sans", sans-serif',"messageFontWeight":"normal","containerFontSize":14,"containerFontFamily":'"Open Sans", sans-serif',"containerFontWeight":"normal","external_containerFontSize":14,"external_containerFontFamily":'"Open Sans", sans-serif',"external_containerFontWeight":"normal","container_dbFontSize":14,"container_dbFontFamily":'"Open Sans", sans-serif',"container_dbFontWeight":"normal","external_container_dbFontSize":14,"external_container_dbFontFamily":'"Open Sans", sans-serif',"external_container_dbFontWeight":"normal","container_queueFontSize":14,"container_queueFontFamily":'"Open Sans", sans-serif',"container_queueFontWeight":"normal","external_container_queueFontSize":14,"external_container_queueFontFamily":'"Open Sans", sans-serif',"external_container_queueFontWeight":"normal","componentFontSize":14,"componentFontFamily":'"Open Sans", sans-serif',"componentFontWeight":"normal","external_componentFontSize":14,"external_componentFontFamily":'"Open Sans", sans-serif',"external_componentFontWeight":"normal","component_dbFontSize":14,"component_dbFontFamily":'"Open Sans", sans-serif',"component_dbFontWeight":"normal","external_component_dbFontSize":14,"external_component_dbFontFamily":'"Open Sans", sans-serif',"external_component_dbFontWeight":"normal","component_queueFontSize":14,"component_queueFontFamily":'"Open Sans", sans-serif',"component_queueFontWeight":"normal","external_component_queueFontSize":14,"external_component_queueFontFamily":'"Open Sans", sans-serif',"external_component_queueFontWeight":"normal","wrap":true,"wrapPadding":10,"person_bg_color":"#08427B","person_border_color":"#073B6F","external_person_bg_color":"#686868","external_person_border_color":"#8A8A8A","system_bg_color":"#1168BD","system_border_color":"#3C7FC0","system_db_bg_color":"#1168BD","system_db_border_color":"#3C7FC0","system_queue_bg_color":"#1168BD","system_queue_border_color":"#3C7FC0","external_system_bg_color":"#999999","external_system_border_color":"#8A8A8A","external_system_db_bg_color":"#999999","external_system_db_border_color":"#8A8A8A","external_system_queue_bg_color":"#999999","external_system_queue_border_color":"#8A8A8A","container_bg_color":"#438DD5","container_border_color":"#3C7FC0","container_db_bg_color":"#438DD5","container_db_border_color":"#3C7FC0","container_queue_bg_color":"#438DD5","container_queue_border_color":"#3C7FC0","external_container_bg_color":"#B3B3B3","external_container_border_color":"#A6A6A6","external_container_db_bg_color":"#B3B3B3","external_container_db_border_color":"#A6A6A6","external_container_queue_bg_color":"#B3B3B3","external_container_queue_border_color":"#A6A6A6","component_bg_color":"#85BBF0","component_border_color":"#78A8D8","component_db_bg_color":"#85BBF0","component_db_border_color":"#78A8D8","component_queue_bg_color":"#85BBF0","component_queue_border_color":"#78A8D8","external_component_bg_color":"#CCCCCC","external_component_border_color":"#BFBFBF","external_component_db_bg_color":"#CCCCCC","external_component_db_border_color":"#BFBFBF","external_component_queue_bg_color":"#CCCCCC","external_component_queue_border_color":"#BFBFBF"},"sankey":{"useMaxWidth":true,"width":600,"height":400,"linkColor":"gradient","nodeAlignment":"justify","showValues":true,"prefix":"","suffix":"","nodeWidth":10,"nodePadding":12,"labelStyle":"legacy"},"block":{"useMaxWidth":true,"padding":8},"packet":{"useMaxWidth":true,"rowHeight":32,"bitWidth":32,"bitsPerRow":32,"showBits":true,"paddingX":5,"paddingY":5},"treeView":{"useMaxWidth":true,"rowIndent":10,"paddingX":5,"paddingY":5,"lineThickness":1,"showIcons":false,"defaultIconPack":"","filenameIcons":{},"extensionIcons":{}},"architecture":{"useMaxWidth":true,"padding":40,"iconSize":80,"fontSize":16,"randomize":false,"nodeSeparation":75,"idealEdgeLengthMultiplier":1.5,"edgeElasticity":.45,"numIter":2500,"seed":1},"eventmodeling":{"useMaxWidth":true,"padding":30,"rowHeight":32},"radar":{"useMaxWidth":true,"width":600,"height":600,"marginTop":50,"marginRight":50,"marginBottom":50,"marginLeft":50,"axisScaleFactor":1,"axisLabelFactor":1.05,"curveTension":.17},"venn":{"useMaxWidth":true,"width":800,"height":450,"padding":8,"useDebugLayout":false},"cynefin":{"useMaxWidth":true,"width":800,"height":600,"padding":40,"showDomainDescriptions":true,"boundaryAmplitude":8,"seed":0},"theme":"default","look":"classic","handDrawnSeed":0,"layout":"dagre","maxTextSize":5e4,"maxEdges":500,"darkMode":false,"fontFamily":'"trebuchet ms", verdana, arial, sans-serif;',"logLevel":5,"securityLevel":"strict","startOnLoad":true,"arrowMarkerAbsolute":false,"secure":["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],"legacyMathML":false,"forceLegacyMathML":false,"deterministicIds":false,"fontSize":16,"markdownAutoWrap":true,"suppressErrorRendering":false};eln={...Tg,deterministicIDSeed:void 0,elk:{mergeEdges:false,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:false,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:FC.default.getThemeVariables(),sequence:{...Tg.sequence,messageFont:B(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:B(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:B(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:false,hierarchicalNamespaces:true},gantt:{...Tg.gantt,tickInterval:void 0,useWidth:void 0},c4:{...Tg.c4,useWidth:void 0,personFont:B(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...Tg.flowchart,inheritDir:false},external_personFont:B(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:B(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:B(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:B(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:B(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:B(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:B(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:B(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:B(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:B(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:B(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:B(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:B(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:B(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:B(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:B(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:B(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:B(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:B(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:B(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:B(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...Tg.pie,useWidth:984},xyChart:{...Tg.xyChart,useWidth:void 0},requirement:{...Tg.requirement,useWidth:void 0},packet:{...Tg.packet},eventmodeling:{...Tg.eventmodeling},treeView:{...Tg.treeView,useWidth:void 0},radar:{...Tg.radar},railroad:{...Tg.railroad,fontSize:void 0,fontFamily:void 0,terminalFill:void 0,terminalStroke:void 0,terminalTextColor:void 0,nonTerminalFill:void 0,nonTerminalStroke:void 0,nonTerminalTextColor:void 0,lineColor:void 0,markerFill:void 0,commentFill:void 0,commentStroke:void 0,commentTextColor:void 0,specialFill:void 0,specialStroke:void 0,ruleNameColor:void 0},ishikawa:{...Tg.ishikawa},sankey:{...Tg.sankey,nodeColors:void 0},treemap:{useMaxWidth:true,padding:10,diagramPadding:8,showValues:true,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","},venn:{...Tg.venn},cynefin:{...Tg.cynefin}};tln=B((e,t="")=>Object.keys(e).reduce((n,r)=>{if(Array.isArray(e[r])){return n}else if(typeof e[r]==="object"&&e[r]!==null){return[...n,t+r,...tln(e[r],"")]}return[...n,t+r]},[]),"keyify");$0i=new Set(tln(eln,""));ka=eln;G0i={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/};H0i=B((e,t)=>{for(const n of Object.keys(e)){const r=e[n];if(n.startsWith("__")||n.includes("proto")||n.includes("constr")||typeof r!=="string"||!t.test(r)){wt.debug("sanitize deleting dictionary entry:",n,r);delete e[n]}}},"sanitizeDictionaryConfig");ZQ=B(e=>{wt.debug("sanitizeDirective called with",e);if(typeof e!=="object"||e==null){return}if(Array.isArray(e)){e.forEach(t=>ZQ(t));return}for(const t of Object.keys(e)){wt.debug("Checking key",t);if(t.startsWith("__")||t.includes("proto")||t.includes("constr")||!$0i.has(t)||e[t]==null){wt.debug("sanitize deleting key: ",t);delete e[t];continue}if(typeof e[t]==="object"){const r=G0i[t];if(r){H0i(e[t],r)}else{wt.debug("sanitizing object",t);ZQ(e[t])}continue}const n=["themeCSS","fontFamily","altFontFamily"];for(const r of n){if(t.includes(r)){wt.debug("sanitizing css option",t);e[t]=wXe(e[t])}}}if(e.themeVariables){for(const t of Object.keys(e.themeVariables)){const n=e.themeVariables[t];if(n?.match&&!n.match(/^[\d "#%(),.;A-Za-z]+$/)){e.themeVariables[t]=""}}}wt.debug("After sanitization",e)},"sanitizeDirective");wXe=B(e=>{let t=0;let n=0;for(const r of e){if(te===false||["false","null","0"].includes(String(e).trim().toLowerCase())?false:true,"evaluate");fx=rf({},N5);F5=[];KQ=rf({},N5);JQ=B((e,t)=>{let n=rf({},e);let r={};for(const i of t){oln(i);r=rf(r,i)}n=rf(n,r);if(r.theme&&r.theme in FC){const i=rf({},e2e);const o=rf(i.themeVariables||{},r.themeVariables);if(n.theme&&n.theme in FC){n.themeVariables=FC[n.theme].getThemeVariables(o)}}KQ=n;Y0i(KQ);return KQ},"updateCurrentConfig");nln=B(e=>{fx=rf({},N5);fx=rf(fx,e);if(e.theme&&FC[e.theme]){fx.themeVariables=FC[e.theme].getThemeVariables(e.themeVariables)}JQ(fx,F5);return fx},"setSiteConfig");rln=B(e=>{e2e=rf({},e)},"saveConfigFromInitialize");iln=B(e=>{fx=rf(fx,e);JQ(fx,F5);return fx},"updateSiteConfig");EXe=B(()=>{return rf({},fx)},"getSiteConfig");CXe=B(e=>{JQ(KQ,[e]);return Ji()},"setConfig");Ji=B(()=>{return rf({},KQ)},"getConfig");oln=B(e=>{if(!e){return}["secure",...fx.secure??[]].forEach(t=>{if(Object.hasOwn(e,t)){wt.debug(`Denied attempt to modify a secure key ${t}`,e[t]);delete e[t]}});Object.keys(e).forEach(t=>{if(t.startsWith("__")){delete e[t]}});Object.keys(e).forEach(t=>{if(typeof e[t]==="string"&&(e[t].includes("<")||e[t].includes(">")||e[t].includes("url(data:"))){delete e[t]}if(typeof e[t]==="object"){oln(e[t])}})},"sanitize");aln=B(e=>{ZQ(e);if(e.fontFamily&&!e.themeVariables?.fontFamily){e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}}F5.push(e);JQ(fx,F5)},"addDirective");QQ=B((e=fx)=>{F5=[];JQ(e,F5)},"reset");W0i={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",FLOWCHART_HTML_LABELS_DEPRECATED:"flowchart.htmlLabels is deprecated. Please use global htmlLabels instead."};Ksn={};sln=B(e=>{if(Ksn[e]){return}wt.warn(W0i[e]);Ksn[e]=true},"issueWarning");Y0i=B(e=>{if(!e){return}if(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup){sln("LAZY_LOAD_DEPRECATED")}},"checkConfig");n2e=B(()=>{let e={};if(e2e){e=rf(e,e2e)}for(const t of F5){e=rf(e,t)}return e},"getUserDefinedConfig");oc=B(e=>{if(e.flowchart?.htmlLabels!=void 0){sln("FLOWCHART_HTML_LABELS_DEPRECATED")}return R_(e.htmlLabels??e.flowchart?.htmlLabels??true)},"getEffectiveHtmlLabels");SXe=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s;o$=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi;q0i=/\s*%%.*\n/gm;AXe=class extends Error{static{B(this,"UnknownDiagramError")}constructor(e){super(e);this.name="UnknownDiagramError"}};cL={};eee=B(function(e,t){e=e.replace(SXe,"").replace(o$,"").replace(q0i,"\n");for(const[n,{detector:r}]of Object.entries(cL)){const i=r(e,t);if(i){return n}}throw new AXe(`No diagram type detected matching given configuration for text: ${e}`)},"detectType");r2e=B((...e)=>{for(const{id:t,detector:n,loader:r}of e){lln(t,n,r)}},"registerLazyLoadedDiagrams");lln=B((e,t,n)=>{if(cL[e]){wt.warn(`Detector with key ${e} already exists. Overwriting.`)}cL[e]={detector:t,loader:n};wt.debug(`Detector with key ${e} added${n?" with loader":""}`)},"addDetector");cln=B(e=>{return cL[e].loader},"getDiagramLoader");O5=//gi;X0i=B(e=>{if(!e){return[""]}const t=fln(e).replace(/\\n/g,"#br#");return t.split("#br#")},"getRows");j0i=(()=>{let e=false;return()=>{if(!e){uln();e=true}}})();B(uln,"setupDompurifyHooks");dln=B(e=>{j0i();const t=ux.sanitize(e);return t},"removeScript");Zsn=B((e,t)=>{if(oc(t)){const n=t.securityLevel;if(n==="antiscript"||n==="strict"||n==="sandbox"){e=dln(e)}else if(n!=="loose"){e=fln(e);e=e.replace(//g,">");e=e.replace(/=/g,"=");e=Q0i(e)}}return e},"sanitizeMore");La=B((e,t)=>{if(!e){return e}if(t.dompurifyConfig){e=ux.sanitize(Zsn(e,t),t.dompurifyConfig).toString()}else{e=ux.sanitize(Zsn(e,t),{FORBID_TAGS:["style"]}).toString()}return e},"sanitizeText");K0i=B((e,t)=>{if(typeof e==="string"){return La(e,t)}return e.flat().map(n=>La(n,t))},"sanitizeTextOrArray");Z0i=B(e=>{return O5.test(e)},"hasBreaks");J0i=B(e=>{return e.split(O5)},"splitBreaks");Q0i=B(e=>{return e.replace(/#br#/g,"
")},"placeholderToBreak");fln=B(e=>{return e.replace(O5,"#br#")},"breakToPlaceholder");B5=B(e=>{let t="";if(e){t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search;t=CSS.escape(t)}return t},"getUrl");ebi=B(function(...e){const t=e.filter(n=>{return!isNaN(n)});return Math.max(...t)},"getMax");tbi=B(function(...e){const t=e.filter(n=>{return!isNaN(n)});return Math.min(...t)},"getMin");BC=B(function(e){const t=e.split(/(,)/);const n=[];for(let r=0;r0&&r+1{return Math.max(0,e.split(t).length-1)},"countOccurrence");nbi=B((e,t)=>{const n=TXe(e,"~");const r=TXe(t,"~");return n===1&&r===1},"shouldCombineSets");rbi=B(e=>{const t=TXe(e,"~");let n=false;if(t<=1){return e}if(t%2!==0&&e.startsWith("~")){e=e.substring(1);n=true}const r=[...e];let i=r.indexOf("~");let o=r.lastIndexOf("~");while(i!==-1&&o!==-1&&i!==o){r[i]="<";r[o]=">";i=r.indexOf("~");o=r.lastIndexOf("~")}if(n){r.unshift("~")}return r.join("")},"processSet");Jsn=B(()=>window.MathMLElement!==void 0,"isMathMLSupported");Jwe=/\$\$(.*?)\$\$/g;of=B(e=>(e.match(Jwe)?.length??0)>0,"hasKatex");a$=B(async(e,t)=>{const n=document.createElement("div");n.innerHTML=await s$(e,t);n.id="katex-temp";n.style.visibility="hidden";n.style.position="absolute";n.style.top="0";const r=document.querySelector("body");r?.insertAdjacentElement("beforeend",n);const i={width:n.clientWidth,height:n.clientHeight};n.remove();return i},"calculateMathMLDimensions");ibi=B(async(e,t)=>{if(!of(e)){return e}if(!(Jsn()||t.legacyMathML||t.forceLegacyMathML)){return e.replace(Jwe,"MathML is unsupported in this environment.")}if(true){const{default:n}=await Promise.resolve().then(()=>(jsn(),Xsn));const r=t.forceLegacyMathML||!Jsn()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(O5).map(i=>of(i)?`
${i}
`:`
${i}
`).join("").replace(Jwe,(i,o)=>n.renderToString(o,{throwOnError:true,displayMode:true,output:r}).replace(/\n/g," ").replace(//g,""))}return e.replace(Jwe,"Katex is not supported in @mermaid-js/tiny. Please use the full mermaid library.")},"renderKatexUnsanitized");s$=B(async(e,t)=>{return La(await ibi(e,t),t)},"renderKatexSanitized");Ti={getRows:X0i,sanitizeText:La,sanitizeTextOrArray:K0i,hasBreaks:Z0i,splitBreaks:J0i,lineBreakRegex:O5,removeScript:dln,getUrl:B5,evaluate:R_,getMax:ebi,getMin:tbi};obi=B(function(e,t){for(let n of t){e.attr(n[0],n[1])}},"d3Attrs");abi=B(function(e,t,n){let r=new Map;if(n){r.set("width","100%");r.set("style",`max-width: ${t}px;`)}else{r.set("height",e);r.set("width",t)}return r},"calculateSvgSizeAttrs");Vs=B(function(e,t,n,r){const i=abi(t,n,r);obi(e,i)},"configureSvgSize");zC=B(function(e,t,n,r){const i=t.node().getBBox();const o=i.width;const a=i.height;wt.info(`SVG bounds: ${o}x${a}`,i);let s=0;let l=0;wt.info(`Graph bounds: ${s}x${l}`,e);s=o+n*2;l=a+n*2;wt.info(`Calculated bounds: ${s}x${l}`);Vs(t,l,s,r);const u=`${i.x-n} ${i.y-n} ${i.width+2*n} ${i.height+2*n}`;t.attr("viewBox",u)},"setupGraphViewbox");Qwe={};B(i2e,"cssStyleSheetToString");sbi=B((e,t,n,r)=>{let i="";if(e in Qwe&&Qwe[e]){i=Qwe[e]({...n,svgId:r})}else{wt.warn(`No theme found for ${e}`)}return`& { + font-family: ${n.fontFamily}; + font-size: ${n.fontSize}; + fill: ${n.textColor} + } + @keyframes edge-animation-frame { + from { + stroke-dashoffset: 0; + } + } + @keyframes dash { + to { + stroke-dashoffset: 0; + } + } + & .edge-animation-slow { + stroke-dasharray: 9,5 !important; + stroke-dashoffset: 900; + animation: dash 50s linear infinite; + stroke-linecap: round; + } + & .edge-animation-fast { + stroke-dasharray: 9,5 !important; + stroke-dashoffset: 900; + animation: dash 20s linear infinite; + stroke-linecap: round; + } + /* Classes common for multiple diagrams */ + + & .error-icon { + fill: ${n.errorBkgColor}; + } + & .error-text { + fill: ${n.errorTextColor}; + stroke: ${n.errorTextColor}; + } + + & .edge-thickness-normal { + stroke-width: ${n.strokeWidth??1}px; + } + & .edge-thickness-thick { + stroke-width: 3.5px + } + & .edge-pattern-solid { + stroke-dasharray: 0; + } + & .edge-thickness-invisible { + stroke-width: 0; + fill: none; + } + & .edge-pattern-dashed{ + stroke-dasharray: 3; + } + .edge-pattern-dotted { + stroke-dasharray: 2; + } + + & .marker { + fill: ${n.lineColor}; + stroke: ${n.lineColor}; + } + & .marker.cross { + stroke: ${n.lineColor}; + } + + & svg { + font-family: ${n.fontFamily}; + font-size: ${n.fontSize}; + } + & p { + margin: 0 + } + + ${i} + .node .neo-node { + stroke: ${n.nodeBorder}; + } + + [data-look="neo"].node rect, [data-look="neo"].cluster rect, [data-look="neo"].node polygon { + stroke: ${n.useGradient?"url("+r+"-gradient)":n.nodeBorder}; + filter: ${n.dropShadow?n.dropShadow.replace("url(#drop-shadow)",`url(${r}-drop-shadow)`):"none"}; + } + [data-look="neo"].swimlane.cluster rect { + filter: none; + } + + + [data-look="neo"].node path { + stroke: ${n.useGradient?"url("+r+"-gradient)":n.nodeBorder}; + stroke-width: ${n.strokeWidth??1}px; + } + + [data-look="neo"].node .outer-path { + filter: ${n.dropShadow?n.dropShadow.replace("url(#drop-shadow)",`url(${r}-drop-shadow)`):"none"}; + } + + [data-look="neo"].node .neo-line path { + stroke: ${n.nodeBorder}; + filter: none; + } + + [data-look="neo"].node circle{ + stroke: ${n.useGradient?"url("+r+"-gradient)":n.nodeBorder}; + filter: ${n.dropShadow?n.dropShadow.replace("url(#drop-shadow)",`url(${r}-drop-shadow)`):"none"}; + } + + [data-look="neo"].node circle .state-start{ + fill: #000000; + } + + [data-look="neo"].icon-shape .icon { + fill: ${n.useGradient?"url("+r+"-gradient)":n.nodeBorder}; + filter: ${n.dropShadow?n.dropShadow.replace("url(#drop-shadow)",`url(${r}-drop-shadow)`):"none"}; + } + + [data-look="neo"].icon-shape .icon-neo path { + stroke: ${n.useGradient?"url("+r+"-gradient)":n.nodeBorder}; + filter: ${n.dropShadow?n.dropShadow.replace("url(#drop-shadow)",`url(${r}-drop-shadow)`):"none"}; + } + + ${t} +`},"getStyles");lbi=B((e,t)=>{if(t!==void 0){Qwe[e]=t}},"addStylesForDiagram");hln=sbi;o2e={};ZM(o2e,{clear:()=>Da,getAccDescription:()=>as,getAccTitle:()=>is,getDiagramTitle:()=>ss,setAccDescription:()=>os,setAccTitle:()=>Ka,setDiagramTitle:()=>ys});kXe="";RXe="";PXe="";IXe=B(e=>La(e,Ji()),"sanitizeText");Da=B(()=>{kXe="";PXe="";RXe=""},"clear");Ka=B(e=>{kXe=IXe(e).replace(/^\s+/g,"")},"setAccTitle");is=B(()=>kXe,"getAccTitle");os=B(e=>{PXe=IXe(e).replace(/\n\s+/g,"\n")},"setAccDescription");as=B(()=>PXe,"getAccDescription");ys=B(e=>{RXe=IXe(e)},"setDiagramTitle");ss=B(()=>RXe,"getDiagramTitle");Qsn=wt;cbi=MQ;Mn=Ji;tee=CXe;a2e=N5;s2e=B(e=>La(e,Mn()),"sanitizeText");nee=zC;ubi=B(()=>{return o2e},"getCommonDb");t2e={};ree=B((e,t,n)=>{if(t2e[e]){Qsn.warn(`Diagram with id ${e} already registered. Overwriting.`)}t2e[e]=t;if(n){lln(e,n)}lbi(e,t.styles);t.injectUtils?.(Qsn,cbi,Mn,s2e,nee,ubi(),()=>{})},"registerDiagram");l2e=B(e=>{if(e in t2e){return t2e[e]}throw new dbi(e)},"getDiagram");dbi=class extends Error{static{B(this,"DiagramNotFoundError")}constructor(e){super(`Diagram ${e} not found.`)}}});function pln(e){return e}var mln=Ce(()=>{});function fbi(e){return"translate("+e+",0)"}function hbi(e){return"translate(0,"+e+")"}function pbi(e){return t=>+e(t)}function mbi(e,t){t=Math.max(0,e.bandwidth()-t*2)/2;if(e.round())t=Math.round(t);return n=>+e(n)+t}function gbi(){return!this.__axis}function yln(e,t){var n=[],r=null,i=null,o=6,a=6,s=3,l=typeof window!=="undefined"&&window.devicePixelRatio>1?0:.5,u=e===u2e||e===c2e?-1:1,d=e===c2e||e===MXe?"x":"y",f=e===u2e||e===LXe?fbi:hbi;function h(m){var g=r==null?t.ticks?t.ticks.apply(t,n):t.domain():r,x=i==null?t.tickFormat?t.tickFormat.apply(t,n):pln:i,w=Math.max(o,0)+s,_=t.range(),C=+_[0]+l,A=+_[_.length-1]+l,P=(t.bandwidth?mbi:pbi)(t.copy(),l),L=m.selection?m.selection():m,I=L.selectAll(".domain").data([null]),N=L.selectAll(".tick").data(g,t).order(),O=N.exit(),z=N.enter().append("g").attr("class","tick"),U=N.select("line"),W=N.select("text");I=I.merge(I.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor"));N=N.merge(z);U=U.merge(z.append("line").attr("stroke","currentColor").attr(d+"2",u*o));W=W.merge(z.append("text").attr("fill","currentColor").attr(d,u*w).attr("dy",e===u2e?"0em":e===LXe?"0.71em":"0.32em"));if(m!==L){I=I.transition(m);N=N.transition(m);U=U.transition(m);W=W.transition(m);O=O.transition(m).attr("opacity",gln).attr("transform",function(H){return isFinite(H=P(H))?f(H+l):this.getAttribute("transform")});z.attr("opacity",gln).attr("transform",function(H){var $=this.parentNode.__axis;return f(($&&isFinite($=$(H))?$:P(H))+l)})}O.remove();I.attr("d",e===c2e||e===MXe?a?"M"+u*a+","+C+"H"+l+"V"+A+"H"+u*a:"M"+l+","+C+"V"+A:a?"M"+C+","+u*a+"V"+l+"H"+A+"V"+u*a:"M"+C+","+l+"H"+A);N.attr("opacity",1).attr("transform",function(H){return f(P(H)+l)});U.attr(d+"2",u*o);W.attr(d,u*w).text(x);L.filter(gbi).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===MXe?"start":e===c2e?"end":"middle");L.each(function(){this.__axis=P})}h.scale=function(m){return arguments.length?(t=m,h):t};h.ticks=function(){return n=Array.from(arguments),h};h.tickArguments=function(m){return arguments.length?(n=m==null?[]:Array.from(m),h):n.slice()};h.tickValues=function(m){return arguments.length?(r=m==null?null:Array.from(m),h):r&&r.slice()};h.tickFormat=function(m){return arguments.length?(i=m,h):i};h.tickSize=function(m){return arguments.length?(o=a=+m,h):o};h.tickSizeInner=function(m){return arguments.length?(o=+m,h):o};h.tickSizeOuter=function(m){return arguments.length?(a=+m,h):a};h.tickPadding=function(m){return arguments.length?(s=+m,h):s};h.offset=function(m){return arguments.length?(l=+m,h):l};return h}function DXe(e){return yln(u2e,e)}function FXe(e){return yln(LXe,e)}var u2e,MXe,LXe,c2e,gln;var bln=Ce(()=>{mln();u2e=1;MXe=2;LXe=3;c2e=4;gln=1e-6});var xln=Ce(()=>{bln()});function _ln(){for(var e=0,t=arguments.length,n={},r;e=0)r=n.slice(i+1),n=n.slice(0,i);if(n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}function xbi(e,t){for(var n=0,r=e.length,i;n{ybi={value:()=>{}};d2e.prototype=_ln.prototype={constructor:d2e,on:function(e,t){var n=this._,r=bbi(e+"",n),i,o=-1,a=r.length;if(arguments.length<2){while(++o0)for(var n=new Array(i),r=0,i,o;r{Tln()});var f2e,BXe;var zXe=Ce(()=>{f2e="http://www.w3.org/1999/xhtml";BXe={svg:"http://www.w3.org/2000/svg",xhtml:f2e,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"}});function xR(e){var t=e+="",n=t.indexOf(":");if(n>=0&&(t=e.slice(0,n))!=="xmlns")e=e.slice(n+1);return BXe.hasOwnProperty(t)?{space:BXe[t],local:e}:e}var h2e=Ce(()=>{zXe()});function vbi(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===f2e&&t.documentElement.namespaceURI===f2e?t.createElement(e):t.createElementNS(n,e)}}function _bi(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function p2e(e){var t=xR(e);return(t.local?_bi:vbi)(t)}var UXe=Ce(()=>{h2e();zXe()});function Tbi(){}function z5(e){return e==null?Tbi:function(){return this.querySelector(e)}}var m2e=Ce(()=>{});function wln(e){if(typeof e!=="function")e=z5(e);for(var t=this._groups,n=t.length,r=new Array(n),i=0;i{ww();m2e()});function VXe(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}var Cln=Ce(()=>{});function wbi(){return[]}function iee(e){return e==null?wbi:function(){return this.querySelectorAll(e)}}var $Xe=Ce(()=>{});function Ebi(e){return function(){return VXe(e.apply(this,arguments))}}function Sln(e){if(typeof e==="function")e=Ebi(e);else e=iee(e);for(var t=this._groups,n=t.length,r=[],i=[],o=0;o{ww();Cln();$Xe()});function oee(e){return function(){return this.matches(e)}}function g2e(e){return function(t){return t.matches(e)}}var aee=Ce(()=>{});function Sbi(e){return function(){return Cbi.call(this.children,e)}}function Abi(){return this.firstElementChild}function kln(e){return this.select(e==null?Abi:Sbi(typeof e==="function"?e:g2e(e)))}var Cbi;var Rln=Ce(()=>{aee();Cbi=Array.prototype.find});function Rbi(){return Array.from(this.children)}function Pbi(e){return function(){return kbi.call(this.children,e)}}function Pln(e){return this.selectAll(e==null?Rbi:Pbi(typeof e==="function"?e:g2e(e)))}var kbi;var Iln=Ce(()=>{aee();kbi=Array.prototype.filter});function Mln(e){if(typeof e!=="function")e=oee(e);for(var t=this._groups,n=t.length,r=new Array(n),i=0;i{ww();aee()});function y2e(e){return new Array(e.length)}var GXe=Ce(()=>{});function Dln(){return new Wf(this._enter||this._groups.map(y2e),this._parents)}function see(e,t){this.ownerDocument=e.ownerDocument;this.namespaceURI=e.namespaceURI;this._next=null;this._parent=e;this.__data__=t}var HXe=Ce(()=>{GXe();ww();see.prototype={constructor:see,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}}});function Fln(e){return function(){return e}}var Nln=Ce(()=>{});function Ibi(e,t,n,r,i,o){var a=0,s,l=t.length,u=o.length;for(;a=A)A=C+1;while(!(L=w[A])&&++A{ww();HXe();Nln()});function zln(){return new Wf(this._exit||this._groups.map(y2e),this._parents)}var Uln=Ce(()=>{GXe();ww()});function Vln(e,t,n){var r=this.enter(),i=this,o=this.exit();if(typeof e==="function"){r=e(r);if(r)r=r.selection()}else{r=r.append(e+"")}if(t!=null){i=t(i);if(i)i=i.selection()}if(n==null)o.remove();else n(o);return r&&i?r.merge(i).order():i}var $ln=Ce(()=>{});function Gln(e){var t=e.selection?e.selection():e;for(var n=this._groups,r=t._groups,i=n.length,o=r.length,a=Math.min(i,o),s=new Array(i),l=0;l{ww()});function Wln(){for(var e=this._groups,t=-1,n=e.length;++t=0;){if(a=r[i]){if(o&&a.compareDocumentPosition(o)^4)o.parentNode.insertBefore(a,o);o=a}}}return this}var Yln=Ce(()=>{});function qln(e){if(!e)e=Fbi;function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var n=this._groups,r=n.length,i=new Array(r),o=0;ot?1:e>=t?0:NaN}var Xln=Ce(()=>{ww()});function jln(){var e=arguments[0];arguments[0]=this;e.apply(null,arguments);return this}var Kln=Ce(()=>{});function Zln(){return Array.from(this)}var Jln=Ce(()=>{});function Qln(){for(var e=this._groups,t=0,n=e.length;t{});function tcn(){let e=0;for(const t of this)++e;return e}var ncn=Ce(()=>{});function rcn(){return!this.node()}var icn=Ce(()=>{});function ocn(e){for(var t=this._groups,n=0,r=t.length;n{});function Nbi(e){return function(){this.removeAttribute(e)}}function Obi(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Bbi(e,t){return function(){this.setAttribute(e,t)}}function zbi(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Ubi(e,t){return function(){var n=t.apply(this,arguments);if(n==null)this.removeAttribute(e);else this.setAttribute(e,n)}}function Vbi(e,t){return function(){var n=t.apply(this,arguments);if(n==null)this.removeAttributeNS(e.space,e.local);else this.setAttributeNS(e.space,e.local,n)}}function scn(e,t){var n=xR(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Obi:Nbi:typeof t==="function"?n.local?Vbi:Ubi:n.local?zbi:Bbi)(n,t))}var lcn=Ce(()=>{h2e()});function b2e(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}var WXe=Ce(()=>{});function $bi(e){return function(){this.style.removeProperty(e)}}function Gbi(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Hbi(e,t,n){return function(){var r=t.apply(this,arguments);if(r==null)this.style.removeProperty(e);else this.style.setProperty(e,r,n)}}function ccn(e,t,n){return arguments.length>1?this.each((t==null?$bi:typeof t==="function"?Hbi:Gbi)(e,t,n==null?"":n)):uL(this.node(),e)}function uL(e,t){return e.style.getPropertyValue(t)||b2e(e).getComputedStyle(e,null).getPropertyValue(t)}var YXe=Ce(()=>{WXe()});function Wbi(e){return function(){delete this[e]}}function Ybi(e,t){return function(){this[e]=t}}function qbi(e,t){return function(){var n=t.apply(this,arguments);if(n==null)delete this[e];else this[e]=n}}function ucn(e,t){return arguments.length>1?this.each((t==null?Wbi:typeof t==="function"?qbi:Ybi)(e,t)):this.node()[e]}var dcn=Ce(()=>{});function fcn(e){return e.trim().split(/^|\s+/)}function qXe(e){return e.classList||new hcn(e)}function hcn(e){this._node=e;this._names=fcn(e.getAttribute("class")||"")}function pcn(e,t){var n=qXe(e),r=-1,i=t.length;while(++r{hcn.prototype={add:function(e){var t=this._names.indexOf(e);if(t<0){this._names.push(e);this._node.setAttribute("class",this._names.join(" "))}},remove:function(e){var t=this._names.indexOf(e);if(t>=0){this._names.splice(t,1);this._node.setAttribute("class",this._names.join(" "))}},contains:function(e){return this._names.indexOf(e)>=0}}});function Zbi(){this.textContent=""}function Jbi(e){return function(){this.textContent=e}}function Qbi(e){return function(){var t=e.apply(this,arguments);this.textContent=t==null?"":t}}function bcn(e){return arguments.length?this.each(e==null?Zbi:(typeof e==="function"?Qbi:Jbi)(e)):this.node().textContent}var xcn=Ce(()=>{});function exi(){this.innerHTML=""}function txi(e){return function(){this.innerHTML=e}}function nxi(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t==null?"":t}}function vcn(e){return arguments.length?this.each(e==null?exi:(typeof e==="function"?nxi:txi)(e)):this.node().innerHTML}var _cn=Ce(()=>{});function rxi(){if(this.nextSibling)this.parentNode.appendChild(this)}function Tcn(){return this.each(rxi)}var wcn=Ce(()=>{});function ixi(){if(this.previousSibling)this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ecn(){return this.each(ixi)}var Ccn=Ce(()=>{});function Scn(e){var t=typeof e==="function"?e:p2e(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}var Acn=Ce(()=>{UXe()});function oxi(){return null}function kcn(e,t){var n=typeof e==="function"?e:p2e(e),r=t==null?oxi:typeof t==="function"?t:z5(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}var Rcn=Ce(()=>{UXe();m2e()});function axi(){var e=this.parentNode;if(e)e.removeChild(this)}function Pcn(){return this.each(axi)}var Icn=Ce(()=>{});function sxi(){var e=this.cloneNode(false),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function lxi(){var e=this.cloneNode(true),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Mcn(e){return this.select(e?lxi:sxi)}var Lcn=Ce(()=>{});function Dcn(e){return arguments.length?this.property("__data__",e):this.node().__data__}var Fcn=Ce(()=>{});function cxi(e){return function(t){e.call(this,t,this.__data__)}}function uxi(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");if(r>=0)n=t.slice(r+1),t=t.slice(0,r);return{type:t,name:n}})}function dxi(e){return function(){var t=this.__on;if(!t)return;for(var n=0,r=-1,i=t.length,o;n{});function Bcn(e,t,n){var r=b2e(e),i=r.CustomEvent;if(typeof i==="function"){i=new i(t,n)}else{i=r.document.createEvent("Event");if(n)i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail;else i.initEvent(t,false,false)}e.dispatchEvent(i)}function hxi(e,t){return function(){return Bcn(this,e,t)}}function pxi(e,t){return function(){return Bcn(this,e,t.apply(this,arguments))}}function zcn(e,t){return this.each((typeof t==="function"?pxi:hxi)(e,t))}var Ucn=Ce(()=>{WXe()});function*Vcn(){for(var e=this._groups,t=0,n=e.length;t{});function Wf(e,t){this._groups=e;this._parents=t}function Gcn(){return new Wf([[document.documentElement]],XXe)}function mxi(){return this}var XXe,vR;var ww=Ce(()=>{Eln();Aln();Rln();Iln();Lln();Bln();HXe();Uln();$ln();Hln();Yln();Xln();Kln();Jln();ecn();ncn();icn();acn();lcn();YXe();dcn();ycn();xcn();_cn();wcn();Ccn();Acn();Rcn();Icn();Lcn();Fcn();Ocn();Ucn();$cn();XXe=[null];Wf.prototype=Gcn.prototype={constructor:Wf,select:wln,selectAll:Sln,selectChild:kln,selectChildren:Pln,filter:Mln,data:Oln,enter:Dln,exit:zln,join:Vln,merge:Gln,selection:mxi,order:Wln,sort:qln,call:jln,nodes:Zln,node:Qln,size:tcn,empty:rcn,each:ocn,attr:scn,style:ccn,property:ucn,classed:gcn,text:bcn,html:vcn,raise:Tcn,lower:Ecn,append:Scn,insert:kcn,remove:Pcn,clone:Mcn,datum:Dcn,on:Ncn,dispatch:zcn,[Symbol.iterator]:Vcn};vR=Gcn});function zr(e){return typeof e==="string"?new Wf([[document.querySelector(e)]],[document.documentElement]):new Wf([[e]],XXe)}var Hcn=Ce(()=>{ww()});var Ew=Ce(()=>{aee();h2e();Hcn();ww();m2e();$Xe();YXe()});var Wcn=Ce(()=>{});function hee(){return U5||(Xcn(gxi),U5=dee.now()+_2e)}function gxi(){U5=0}function fee(){this._call=this._time=this._next=null}function T2e(e,t,n){var r=new fee;r.restart(e,t,n);return r}function jcn(){hee();++l$;var e=x2e,t;while(e){if((t=U5-e._time)>=0)e._call.call(void 0,t);e=e._next}--l$}function Ycn(){U5=(v2e=dee.now())+_2e;l$=cee=0;try{jcn()}finally{l$=0;bxi();U5=0}}function yxi(){var e=dee.now(),t=e-v2e;if(t>qcn)_2e-=t,v2e=e}function bxi(){var e,t=x2e,n,r=Infinity;while(t){if(t._call){if(r>t._time)r=t._time;e=t,t=t._next}else{n=t._next,t._next=null;t=e?e._next=n:x2e=n}}uee=e;jXe(r)}function jXe(e){if(l$)return;if(cee)cee=clearTimeout(cee);var t=e-U5;if(t>24){if(e{l$=0;cee=0;lee=0;qcn=1e3;v2e=0;U5=0;_2e=0;dee=typeof performance==="object"&&performance.now?performance:Date;Xcn=typeof window==="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};fee.prototype=T2e.prototype={constructor:fee,restart:function(e,t,n){if(typeof e!=="function")throw new TypeError("callback is not a function");n=(n==null?hee():+n)+(t==null?0:+t);if(!this._next&&uee!==this){if(uee)uee._next=this;else x2e=this;uee=this}this._call=e;this._time=n;jXe()},stop:function(){if(this._call){this._call=null;this._time=Infinity;jXe()}}}});function w2e(e,t,n){var r=new fee;t=t==null?0:+t;r.restart(i=>{r.stop();e(i+t)},t,n);return r}var Kcn=Ce(()=>{KXe()});var E2e=Ce(()=>{KXe();Kcn()});function dL(e,t,n,r,i,o){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;_xi(e,n,{name:t,index:r,group:i,on:xxi,tween:vxi,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:Qcn})}function mee(e,t){var n=Dp(e,t);if(n.state>Qcn)throw new Error("too late; already scheduled");return n}function wg(e,t){var n=Dp(e,t);if(n.state>C2e)throw new Error("too late; already running");return n}function Dp(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function _xi(e,t,n){var r=e.__transition,i;r[t]=n;n.timer=T2e(o,0,n.time);function o(u){n.state=Zcn;n.timer.restart(a,n.delay,n.time);if(n.delay<=u)a(u-n.delay)}function a(u){var d,f,h,m;if(n.state!==Zcn)return l();for(d in r){m=r[d];if(m.name!==n.name)continue;if(m.state===C2e)return w2e(a);if(m.state===Jcn){m.state=pee;m.timer.stop();m.on.call("interrupt",e,e.__data__,m.index,m.group);delete r[d]}else if(+d{OXe();E2e();xxi=NXe("start","end","cancel","interrupt");vxi=[];Qcn=0;Zcn=1;S2e=2;C2e=3;Jcn=4;A2e=5;pee=6});function k2e(e,t){var n=e.__transition,r,i,o=true,a;if(!n)return;t=t==null?null:t+"";for(a in n){if((r=n[a]).name!==t){o=false;continue}i=r.state>S2e&&r.state{hx()});function tun(e){return this.each(function(){k2e(this,e)})}var nun=Ce(()=>{eun()});function Txi(e,t){var n,r;return function(){var i=wg(this,e),o=i.tween;if(o!==n){r=n=o;for(var a=0,s=r.length;a{hx()});function R2e(e,t){var n;return(typeof t==="number"?pg:t instanceof Kd?VN:(n=Kd(t))?(t=n,VN):Kj)(e,t)}var ZXe=Ce(()=>{VT();c9()});function Exi(e){return function(){this.removeAttribute(e)}}function Cxi(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Sxi(e,t,n){var r,i=n+"",o;return function(){var a=this.getAttribute(e);return a===i?null:a===r?o:o=t(r=a,n)}}function Axi(e,t,n){var r,i=n+"",o;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?o:o=t(r=a,n)}}function kxi(e,t,n){var r,i,o;return function(){var a,s=n(this),l;if(s==null)return void this.removeAttribute(e);a=this.getAttribute(e);l=s+"";return a===l?null:a===r&&l===i?o:(i=l,o=t(r=a,s))}}function Rxi(e,t,n){var r,i,o;return function(){var a,s=n(this),l;if(s==null)return void this.removeAttributeNS(e.space,e.local);a=this.getAttributeNS(e.space,e.local);l=s+"";return a===l?null:a===r&&l===i?o:(i=l,o=t(r=a,s))}}function iun(e,t){var n=xR(e),r=n==="transform"?d9e:R2e;return this.attrTween(e,typeof t==="function"?(n.local?Rxi:kxi)(n,r,c$(this,"attr."+e,t)):t==null?(n.local?Cxi:Exi)(n):(n.local?Axi:Sxi)(n,r,t))}var oun=Ce(()=>{c9();Ew();gee();ZXe()});function Pxi(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Ixi(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Mxi(e,t){var n,r;function i(){var o=t.apply(this,arguments);if(o!==r)n=(r=o)&&Ixi(e,o);return n}i._value=t;return i}function Lxi(e,t){var n,r;function i(){var o=t.apply(this,arguments);if(o!==r)n=(r=o)&&Pxi(e,o);return n}i._value=t;return i}function aun(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=="function")throw new Error;var r=xR(e);return this.tween(n,(r.local?Mxi:Lxi)(r,t))}var sun=Ce(()=>{Ew()});function Dxi(e,t){return function(){mee(this,e).delay=+t.apply(this,arguments)}}function Fxi(e,t){return t=+t,function(){mee(this,e).delay=t}}function lun(e){var t=this._id;return arguments.length?this.each((typeof e==="function"?Dxi:Fxi)(t,e)):Dp(this.node(),t).delay}var cun=Ce(()=>{hx()});function Nxi(e,t){return function(){wg(this,e).duration=+t.apply(this,arguments)}}function Oxi(e,t){return t=+t,function(){wg(this,e).duration=t}}function uun(e){var t=this._id;return arguments.length?this.each((typeof e==="function"?Nxi:Oxi)(t,e)):Dp(this.node(),t).duration}var dun=Ce(()=>{hx()});function Bxi(e,t){if(typeof t!=="function")throw new Error;return function(){wg(this,e).ease=t}}function fun(e){var t=this._id;return arguments.length?this.each(Bxi(t,e)):Dp(this.node(),t).ease}var hun=Ce(()=>{hx()});function zxi(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=="function")throw new Error;wg(this,e).ease=n}}function pun(e){if(typeof e!=="function")throw new Error;return this.each(zxi(this._id,e))}var mun=Ce(()=>{hx()});function gun(e){if(typeof e!=="function")e=oee(e);for(var t=this._groups,n=t.length,r=new Array(n),i=0;i{Ew();V5()});function bun(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,o=Math.min(r,i),a=new Array(r),s=0;s{V5()});function Uxi(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");if(n>=0)t=t.slice(0,n);return!t||t==="start"})}function Vxi(e,t,n){var r,i,o=Uxi(t)?mee:wg;return function(){var a=o(this,e),s=a.on;if(s!==r)(i=(r=s).copy()).on(t,n);a.on=i}}function vun(e,t){var n=this._id;return arguments.length<2?Dp(this.node(),n).on.on(e):this.each(Vxi(n,e,t))}var _un=Ce(()=>{hx()});function $xi(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;if(t)t.removeChild(this)}}function Tun(){return this.on("end.remove",$xi(this._id))}var wun=Ce(()=>{});function Eun(e){var t=this._name,n=this._id;if(typeof e!=="function")e=z5(e);for(var r=this._groups,i=r.length,o=new Array(i),a=0;a{Ew();V5();hx()});function Sun(e){var t=this._name,n=this._id;if(typeof e!=="function")e=iee(e);for(var r=this._groups,i=r.length,o=[],a=[],s=0;s{Ew();V5();hx()});function kun(){return new Gxi(this._groups,this._parents)}var Gxi;var Run=Ce(()=>{Ew();Gxi=vR.prototype.constructor});function Hxi(e,t){var n,r,i;return function(){var o=uL(this,e),a=(this.style.removeProperty(e),uL(this,e));return o===a?null:o===n&&a===r?i:i=t(n=o,r=a)}}function Pun(e){return function(){this.style.removeProperty(e)}}function Wxi(e,t,n){var r,i=n+"",o;return function(){var a=uL(this,e);return a===i?null:a===r?o:o=t(r=a,n)}}function Yxi(e,t,n){var r,i,o;return function(){var a=uL(this,e),s=n(this),l=s+"";if(s==null)l=s=(this.style.removeProperty(e),uL(this,e));return a===l?null:a===r&&l===i?o:(i=l,o=t(r=a,s))}}function qxi(e,t){var n,r,i,o="style."+t,a="end."+o,s;return function(){var l=wg(this,e),u=l.on,d=l.value[o]==null?s||(s=Pun(t)):void 0;if(u!==n||i!==d)(r=(n=u).copy()).on(a,i=d);l.on=r}}function Iun(e,t,n){var r=(e+="")==="transform"?u9e:R2e;return t==null?this.styleTween(e,Hxi(e,r)).on("end.style."+e,Pun(e)):typeof t==="function"?this.styleTween(e,Yxi(e,r,c$(this,"style."+e,t))).each(qxi(this._id,e)):this.styleTween(e,Wxi(e,r,t),n).on("end.style."+e,null)}var Mun=Ce(()=>{c9();Ew();hx();gee();ZXe()});function Xxi(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function jxi(e,t,n){var r,i;function o(){var a=t.apply(this,arguments);if(a!==i)r=(i=a)&&Xxi(e,a,n);return r}o._value=t;return o}function Lun(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=="function")throw new Error;return this.tween(r,jxi(e,t,n==null?"":n))}var Dun=Ce(()=>{});function Kxi(e){return function(){this.textContent=e}}function Zxi(e){return function(){var t=e(this);this.textContent=t==null?"":t}}function Fun(e){return this.tween("text",typeof e==="function"?Zxi(c$(this,"text",e)):Kxi(e==null?"":e+""))}var Nun=Ce(()=>{gee()});function Jxi(e){return function(t){this.textContent=e.call(this,t)}}function Qxi(e){var t,n;function r(){var i=e.apply(this,arguments);if(i!==n)t=(n=i)&&Jxi(i);return t}r._value=e;return r}function Oun(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=="function")throw new Error;return this.tween(t,Qxi(e))}var Bun=Ce(()=>{});function zun(){var e=this._name,t=this._id,n=P2e();for(var r=this._groups,i=r.length,o=0;o{V5();hx()});function Vun(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(o,a){var s={value:a},l={value:function(){if(--i===0)o()}};n.each(function(){var u=wg(this,r),d=u.on;if(d!==e){t=(e=d).copy();t._.cancel.push(s);t._.interrupt.push(s);t._.end.push(l)}u.on=t});if(i===0)o()})}var $un=Ce(()=>{hx()});function q0(e,t,n,r){this._groups=e;this._parents=t;this._name=n;this._id=r}function Gun(e){return vR().transition(e)}function P2e(){return++e1i}var e1i,_R;var V5=Ce(()=>{Ew();oun();sun();cun();dun();hun();mun();yun();xun();_un();wun();Cun();Aun();Run();Mun();Dun();Nun();Bun();Uun();gee();$un();e1i=0;_R=vR.prototype;q0.prototype=Gun.prototype={constructor:q0,select:Eun,selectAll:Sun,selectChild:_R.selectChild,selectChildren:_R.selectChildren,filter:gun,merge:bun,selection:kun,transition:zun,call:_R.call,nodes:_R.nodes,node:_R.node,size:_R.size,empty:_R.empty,each:_R.each,on:vun,attr:iun,attrTween:aun,style:Iun,styleTween:Lun,text:Fun,textTween:Oun,remove:Tun,tween:run,delay:lun,duration:uun,ease:fun,easeVarying:pun,end:Vun,[Symbol.iterator]:_R[Symbol.iterator]}});function I2e(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Hun=Ce(()=>{});var JXe=Ce(()=>{Hun()});function n1i(e,t){var n;while(!(n=e.__transition)||!(n=n[t])){if(!(e=e.parentNode)){throw new Error(`transition ${t} not found`)}}return n}function Wun(e){var t,n;if(e instanceof q0){t=e._id,e=e._name}else{t=P2e(),(n=t1i).time=hee(),e=e==null?null:e+""}for(var r=this._groups,i=r.length,o=0;o{V5();hx();JXe();E2e();t1i={time:null,delay:0,duration:250,ease:I2e}});var qun=Ce(()=>{Ew();nun();Yun();vR.prototype.interrupt=tun;vR.prototype.transition=Wun});var M2e=Ce(()=>{qun()});var Xun=Ce(()=>{});var jun=Ce(()=>{});var Kun=Ce(()=>{});function Zun(e){return[+e[0],+e[1]]}function r1i(e){return[Zun(e[0]),Zun(e[1])]}function QXe(e){return{type:e}}var yFa,bFa,xFa,vFa,_Fa,TFa;var Jun=Ce(()=>{M2e();Xun();jun();Kun();({abs:yFa,max:bFa,min:xFa}=Math);vFa={name:"x",handles:["w","e"].map(QXe),input:function(e,t){return e==null?null:[[+e[0],t[0][1]],[+e[1],t[1][1]]]},output:function(e){return e&&[e[0][0],e[1][0]]}};_Fa={name:"y",handles:["n","s"].map(QXe),input:function(e,t){return e==null?null:[[t[0][0],+e[0]],[t[1][0],+e[1]]]},output:function(e){return e&&[e[0][1],e[1][1]]}};TFa={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(QXe),input:function(e){return e==null?null:r1i(e)},output:function(e){return e}}});var Qun=Ce(()=>{Jun()});var edn=Ce(()=>{});var tdn=Ce(()=>{});var ndn=Ce(()=>{});var rdn=Ce(()=>{});var idn=Ce(()=>{});var odn=Ce(()=>{});var adn=Ce(()=>{});var sdn=Ce(()=>{});var ldn=Ce(()=>{});var cdn=Ce(()=>{});var udn=Ce(()=>{});var ddn=Ce(()=>{});function fL(e,t,n){this.k=e;this.x=t;this.y=n}function tje(e){while(!e.__zoom)if(!(e=e.parentNode))return eje;return e.__zoom}var eje;var nje=Ce(()=>{fL.prototype={constructor:fL,scale:function(e){return e===1?this:new fL(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new fL(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};eje=new fL(1,0,0);tje.prototype=fL.prototype});var fdn=Ce(()=>{});var hdn=Ce(()=>{M2e();udn();ddn();nje();fdn()});var pdn=Ce(()=>{hdn();nje()});var ks=Ce(()=>{zh();xln();Qun();edn();VT();tdn();ndn();OXe();Wcn();rdn();JXe();idn();adn();uk();sdn();j0e();c9();rUe();ldn();odn();cdn();R1();h9e();Ew();$E();v0e();j9e();E2e();M2e();pdn()});var Sc;var gh=Ce(()=>{Ta();Yo();ks();Sc=B(e=>{const{securityLevel:t}=Mn();let n=zr("body");if(t==="sandbox"){const i=zr(`#i${e}`);const o=i.node()?.contentDocument??document;n=zr(o.body)}const r=n.select(`#${e}`);return r},"selectSvgElement")});function xje(e){return typeof e==="undefined"||e===null}function ydn(e){return typeof e==="object"&&e!==null}function bdn(e){if(Array.isArray(e))return e;else if(xje(e))return[];return[e]}function xdn(e,t){var n,r,i,o;if(t){o=Object.keys(t);for(n=0,r=o.length;ns){o=" ... ";t=r-s+o.length}if(n-r>s){a=" ...";n=r+s-a.length}return{str:o+e.slice(t,n).replace(/\t/g,"\u2192")+a,pos:r-t+o.length}}function D2e(e,t){return Fp.repeat(" ",t-e.length)+e}function Tdn(e,t){t=Object.create(t||null);if(!e.buffer)return null;if(!t.maxLength)t.maxLength=79;if(typeof t.indent!=="number")t.indent=1;if(typeof t.linesBefore!=="number")t.linesBefore=3;if(typeof t.linesAfter!=="number")t.linesAfter=2;var n=/\r?\n|\r|\0/g;var r=[0];var i=[];var o;var a=-1;while(o=n.exec(e.buffer)){i.push(o.index);r.push(o.index+o[0].length);if(e.position<=o.index&&a<0){a=r.length-2}}if(a<0)a=r.length-1;var s="",l,u;var d=Math.min(e.line+t.linesAfter,i.length).toString().length;var f=t.maxLength-(t.indent+d+3);for(l=1;l<=t.linesBefore;l++){if(a-l<0)break;u=L2e(e.buffer,r[a-l],i[a-l],e.position-(r[a]-r[a-l]),f);s=Fp.repeat(" ",t.indent)+D2e((e.line-l+1).toString(),d)+" | "+u.str+"\n"+s}u=L2e(e.buffer,r[a],i[a],e.position,f);s+=Fp.repeat(" ",t.indent)+D2e((e.line+1).toString(),d)+" | "+u.str+"\n";s+=Fp.repeat("-",t.indent+d+3+u.pos)+"^\n";for(l=1;l<=t.linesAfter;l++){if(a+l>=i.length)break;u=L2e(e.buffer,r[a+l],i[a+l],e.position-(r[a]-r[a+l]),f);s+=Fp.repeat(" ",t.indent)+D2e((e.line+l+1).toString(),d)+" | "+u.str+"\n"}return s.replace(/\n$/,"")}function wdn(e){var t={};if(e!==null){Object.keys(e).forEach(function(n){e[n].forEach(function(r){t[String(r)]=n})})}return t}function Edn(e,t){t=t||{};Object.keys(t).forEach(function(n){if(d1i.indexOf(n)===-1){throw new px('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}});this.options=t;this.tag=e;this.kind=t["kind"]||null;this.resolve=t["resolve"]||function(){return true};this.construct=t["construct"]||function(n){return n};this.instanceOf=t["instanceOf"]||null;this.predicate=t["predicate"]||null;this.represent=t["represent"]||null;this.representName=t["representName"]||null;this.defaultStyle=t["defaultStyle"]||null;this.multi=t["multi"]||false;this.styleAliases=wdn(t["styleAliases"]||null);if(f1i.indexOf(this.kind)===-1){throw new px('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}}function ije(e,t){var n=[];e[t].forEach(function(r){var i=n.length;n.forEach(function(o,a){if(o.tag===r.tag&&o.kind===r.kind&&o.multi===r.multi){i=a}});n[i]=r});return n}function Cdn(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,n;function r(i){if(i.multi){e.multi[i.kind].push(i);e.multi["fallback"].push(i)}else{e[i.kind][i.tag]=e["fallback"][i.tag]=i}}B(r,"collectType");for(t=0,n=arguments.length;t=0){t=t.slice(1)}if(t===".inf"){return n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY}else if(t===".nan"){return NaN}return n*parseFloat(t,10)}function Udn(e,t){var n;if(isNaN(e)){switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}}else if(Number.POSITIVE_INFINITY===e){switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}}else if(Number.NEGATIVE_INFINITY===e){switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}}else if(Fp.isNegativeZero(e)){return"-0.0"}n=e.toString(10);return T1i.test(n)?n.replace("e",".e"):n}function Vdn(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Fp.isNegativeZero(e))}function Wdn(e){if(e===null)return false;if(Gdn.exec(e)!==null)return true;if(Hdn.exec(e)!==null)return true;return false}function Ydn(e){var t,n,r,i,o,a,s,l=0,u=null,d,f,h;t=Gdn.exec(e);if(t===null)t=Hdn.exec(e);if(t===null)throw new Error("Date resolve error");n=+t[1];r=+t[2]-1;i=+t[3];if(!t[4]){return new Date(Date.UTC(n,r,i))}o=+t[4];a=+t[5];s=+t[6];if(t[7]){l=t[7].slice(0,3);while(l.length<3){l+="0"}l=+l}if(t[9]){d=+t[10];f=+(t[11]||0);u=(d*60+f)*6e4;if(t[9]==="-")u=-u}h=new Date(Date.UTC(n,r,i,o,a,s,l));if(u)h.setTime(h.getTime()-u);return h}function qdn(e){return e.toISOString()}function Xdn(e){return e==="<<"||e===null}function jdn(e){if(e===null)return false;var t,n,r=0,i=e.length,o=_je;for(n=0;n64)continue;if(t<0)return false;r+=6}return r%8===0}function Kdn(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,o=_je,a=0,s=[];for(t=0;t>16&255);s.push(a>>8&255);s.push(a&255)}a=a<<6|o.indexOf(r.charAt(t))}n=i%4*6;if(n===0){s.push(a>>16&255);s.push(a>>8&255);s.push(a&255)}else if(n===18){s.push(a>>10&255);s.push(a>>2&255)}else if(n===12){s.push(a>>4&255)}return new Uint8Array(s)}function Zdn(e){var t="",n=0,r,i,o=e.length,a=_je;for(r=0;r>18&63];t+=a[n>>12&63];t+=a[n>>6&63];t+=a[n&63]}n=(n<<8)+e[r]}i=o%3;if(i===0){t+=a[n>>18&63];t+=a[n>>12&63];t+=a[n>>6&63];t+=a[n&63]}else if(i===2){t+=a[n>>10&63];t+=a[n>>4&63];t+=a[n<<2&63];t+=a[64]}else if(i===1){t+=a[n>>2&63];t+=a[n<<4&63];t+=a[64];t+=a[64]}return t}function Jdn(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}function Qdn(e){if(e===null)return true;var t=[],n,r,i,o,a,s=e;for(n=0,r=s.length;n>10)+55296,(e-65536&1023)+56320)}function Tje(e,t,n){if(t==="__proto__"){Object.defineProperty(e,t,{configurable:true,enumerable:true,writable:true,value:n})}else{e[t]=n}}function gfn(e,t){this.input=e;this.filename=t["filename"]||null;this.schema=t["schema"]||ofn;this.onWarning=t["onWarning"]||null;this.legacy=t["legacy"]||false;this.json=t["json"]||false;this.listener=t["listener"]||null;this.implicitTypes=this.schema.compiledImplicit;this.typeMap=this.schema.compiledTypeMap;this.length=e.length;this.position=0;this.line=0;this.lineStart=0;this.lineIndent=0;this.firstTabInLine=-1;this.documents=[]}function wje(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};n.snippet=u1i(n);return new px(t,n)}function da(e,t){throw wje(e,t)}function yee(e,t){if(e.onWarning){e.onWarning.call(null,wje(e,t))}}function TR(e,t,n,r){var i,o,a,s;if(t1){e.result+=Fp.repeat("\n",t-1)}}function yfn(e,t,n){var r,i,o,a,s,l,u,d,f=e.kind,h=e.result,m;m=e.input.charCodeAt(e.position);if(X0(m)||G5(m)||m===35||m===38||m===42||m===33||m===124||m===62||m===39||m===34||m===37||m===64||m===96){return false}if(m===63||m===45){i=e.input.charCodeAt(e.position+1);if(X0(i)||n&&G5(i)){return false}}e.kind="scalar";e.result="";o=a=e.position;s=false;while(m!==0){if(m===58){i=e.input.charCodeAt(e.position+1);if(X0(i)||n&&G5(i)){break}}else if(m===35){r=e.input.charCodeAt(e.position-1);if(X0(r)){break}}else if(e.position===e.lineStart&&_ee(e)||n&&G5(m)){break}else if(Cw(m)){l=e.line;u=e.lineStart;d=e.lineIndent;yh(e,false,-1);if(e.lineIndent>=t){s=true;m=e.input.charCodeAt(e.position);continue}else{e.position=a;e.line=l;e.lineStart=u;e.lineIndent=d;break}}if(s){TR(e,o,a,false);$2e(e,e.line-l);o=a=e.position;s=false}if(!hL(m)){a=e.position+1}m=e.input.charCodeAt(++e.position)}TR(e,o,a,false);if(e.result){return true}e.kind=f;e.result=h;return false}function bfn(e,t){var n,r,i;n=e.input.charCodeAt(e.position);if(n!==39){return false}e.kind="scalar";e.result="";e.position++;r=i=e.position;while((n=e.input.charCodeAt(e.position))!==0){if(n===39){TR(e,r,e.position,true);n=e.input.charCodeAt(++e.position);if(n===39){r=e.position;e.position++;i=e.position}else{return true}}else if(Cw(n)){TR(e,r,i,true);$2e(e,yh(e,false,t));r=i=e.position}else if(e.position===e.lineStart&&_ee(e)){da(e,"unexpected end of the document within a single quoted scalar")}else{e.position++;i=e.position}}da(e,"unexpected end of the stream within a single quoted scalar")}function xfn(e,t){var n,r,i,o,a,s;s=e.input.charCodeAt(e.position);if(s!==34){return false}e.kind="scalar";e.result="";e.position++;n=r=e.position;while((s=e.input.charCodeAt(e.position))!==0){if(s===34){TR(e,n,e.position,true);e.position++;return true}else if(s===92){TR(e,n,e.position,true);s=e.input.charCodeAt(++e.position);if(Cw(s)){yh(e,false,t)}else if(s<256&&pfn[s]){e.result+=mfn[s];e.position++}else if((a=dfn(s))>0){i=a;o=0;for(;i>0;i--){s=e.input.charCodeAt(++e.position);if((a=ufn(s))>=0){o=(o<<4)+a}else{da(e,"expected hexadecimal character")}}e.result+=hfn(o);e.position++}else{da(e,"unknown escape sequence")}n=r=e.position}else if(Cw(s)){TR(e,n,r,true);$2e(e,yh(e,false,t));n=r=e.position}else if(e.position===e.lineStart&&_ee(e)){da(e,"unexpected end of the document within a double quoted scalar")}else{e.position++;r=e.position}}da(e,"unexpected end of the stream within a double quoted scalar")}function vfn(e,t){var n=true,r,i,o,a=e.tag,s,l=e.anchor,u,d,f,h,m,g=Object.create(null),x,w,_,C;C=e.input.charCodeAt(e.position);if(C===91){d=93;m=false;s=[]}else if(C===123){d=125;m=true;s={}}else{return false}if(e.anchor!==null){e.anchorMap[e.anchor]=s}C=e.input.charCodeAt(++e.position);while(C!==0){yh(e,true,t);C=e.input.charCodeAt(e.position);if(C===d){e.position++;e.tag=a;e.anchor=l;e.kind=m?"mapping":"sequence";e.result=s;return true}else if(!n){da(e,"missed comma between flow collection entries")}else if(C===44){da(e,"expected the node content, but found ','")}w=x=_=null;f=h=false;if(C===63){u=e.input.charCodeAt(e.position+1);if(X0(u)){f=h=true;e.position++;yh(e,true,t)}}r=e.line;i=e.lineStart;o=e.position;W5(e,t,N2e,false,true);w=e.tag;x=e.result;yh(e,true,t);C=e.input.charCodeAt(e.position);if((h||e.line===r)&&C===58){f=true;C=e.input.charCodeAt(++e.position);yh(e,true,t);W5(e,t,N2e,false,true);_=e.result}if(m){H5(e,s,g,w,x,_,r,i,o)}else if(f){s.push(H5(e,null,g,w,x,_,r,i,o))}else{s.push(x)}yh(e,true,t);C=e.input.charCodeAt(e.position);if(C===44){n=true;C=e.input.charCodeAt(++e.position)}else{n=false}}da(e,"unexpected end of the stream within a flow collection")}function _fn(e,t){var n,r,i=rje,o=false,a=false,s=t,l=0,u=false,d,f;f=e.input.charCodeAt(e.position);if(f===124){r=false}else if(f===62){r=true}else{return false}e.kind="scalar";e.result="";while(f!==0){f=e.input.charCodeAt(++e.position);if(f===43||f===45){if(rje===i){i=f===43?mdn:F1i}else{da(e,"repeat of a chomping mode identifier")}}else if((d=ffn(f))>=0){if(d===0){da(e,"bad explicit indentation width of a block scalar; it cannot be less than one")}else if(!a){s=t+d-1;a=true}else{da(e,"repeat of an indentation width identifier")}}else{break}}if(hL(f)){do{f=e.input.charCodeAt(++e.position)}while(hL(f));if(f===35){do{f=e.input.charCodeAt(++e.position)}while(!Cw(f)&&f!==0)}}while(f!==0){V2e(e);e.lineIndent=0;f=e.input.charCodeAt(e.position);while((!a||e.lineIndents){s=e.lineIndent}if(Cw(f)){l++;continue}if(e.lineIndentt)&&l!==0){da(e,"bad indentation of a sequence entry")}else if(e.lineIndentt){if(w){a=e.line;s=e.lineStart;l=e.position}if(W5(e,t,O2e,true,i)){if(w){g=e.result}else{x=e.result}}if(!w){H5(e,f,h,m,g,x,a,s,l);m=g=x=null}yh(e,true,-1);C=e.input.charCodeAt(e.position)}if((e.line===o||e.lineIndent>t)&&C!==0){da(e,"bad indentation of a mapping entry")}else if(e.lineIndentt){l=1}else if(e.lineIndent===t){l=0}else if(e.lineIndentt){l=1}else if(e.lineIndent===t){l=0}else if(e.lineIndent tag; it should be "scalar", not "'+e.kind+'"')}for(f=0,h=e.implicitTypes.length;f")}if(e.result!==null&&g.kind!==e.kind){da(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+g.kind+'", not "'+e.kind+'"')}if(!g.resolve(e.result,e.tag)){da(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}else{e.result=g.construct(e.result,e.tag);if(e.anchor!==null){e.anchorMap[e.anchor]=e.result}}}if(e.listener!==null){e.listener("close",e)}return e.tag!==null||e.anchor!==null||d}function Sfn(e){var t=e.position,n,r,i,o=false,a;e.version=null;e.checkLineBreaks=e.legacy;e.tagMap=Object.create(null);e.anchorMap=Object.create(null);while((a=e.input.charCodeAt(e.position))!==0){yh(e,true,-1);a=e.input.charCodeAt(e.position);if(e.lineIndent>0||a!==37){break}o=true;a=e.input.charCodeAt(++e.position);n=e.position;while(a!==0&&!X0(a)){a=e.input.charCodeAt(++e.position)}r=e.input.slice(n,e.position);i=[];if(r.length<1){da(e,"directive name must not be less than one character in length")}while(a!==0){while(hL(a)){a=e.input.charCodeAt(++e.position)}if(a===35){do{a=e.input.charCodeAt(++e.position)}while(a!==0&&!Cw(a));break}if(Cw(a))break;n=e.position;while(a!==0&&!X0(a)){a=e.input.charCodeAt(++e.position)}i.push(e.input.slice(n,e.position))}if(a!==0)V2e(e);if(pL.call(gdn,r)){gdn[r](e,r,i)}else{yee(e,'unknown document directive "'+r+'"')}}yh(e,true,-1);if(e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45){e.position+=3;yh(e,true,-1)}else if(o){da(e,"directives end mark is expected")}W5(e,e.lineIndent-1,O2e,false,true);yh(e,true,-1);if(e.checkLineBreaks&&O1i.test(e.input.slice(t,e.position))){yee(e,"non-ASCII line breaks are interpreted as content")}e.documents.push(e.result);if(e.position===e.lineStart&&_ee(e)){if(e.input.charCodeAt(e.position)===46){e.position+=3;yh(e,true,-1)}return}if(e.position=55296&&n<=56319&&t+1=56320&&r<=57343){return(n-55296)*1024+r-56320+65536}}return n}function Sje(e){var t=/^\n* /;return t.test(e)}function Yfn(e,t,n,r,i,o,a,s){var l;var u=0;var d=null;var f=false;var h=false;var m=r!==-1;var g=-1;var x=Vfn(d$(e,0))&&$fn(d$(e,e.length-1));if(t||a){for(l=0;l=65536?l+=2:l++){u=d$(e,l);if(!h$(u)){return u$}x=x&&fje(u,d,s);d=u}}else{for(l=0;l=65536?l+=2:l++){u=d$(e,l);if(u===bee){f=true;if(m){h=h||l-g-1>r&&e[g+1]!==" ";g=l}}else if(!h$(u)){return u$}x=x&&fje(u,d,s);d=u}h=h||m&&(l-g-1>r&&e[g+1]!==" ")}if(!f&&!h){if(x&&!a&&!i(e)){return Gfn}return o===xee?u$:hje}if(n>9&&Sje(e)){return u$}if(!a){return h?Wfn:Hfn}return o===xee?u$:hje}function qfn(e,t,n,r,i){e.dump=function(){if(t.length===0){return e.quotingType===xee?'""':"''"}if(!e.noCompatMode){if(rvi.indexOf(t)!==-1||ivi.test(t)){return e.quotingType===xee?'"'+t+'"':"'"+t+"'"}}var o=e.indent*Math.max(1,n);var a=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o);var s=r||e.flowLevel>-1&&n>=e.flowLevel;function l(u){return Ufn(e,u)}B(l,"testAmbiguity");switch(Yfn(t,s,e.indent,a,l,e.quotingType,e.forceQuotes&&!r,i)){case Gfn:return t;case hje:return"'"+t.replace(/'/g,"''")+"'";case Hfn:return"|"+pje(t,e.indent)+mje(uje(t,o));case Wfn:return">"+pje(t,e.indent)+mje(uje(Xfn(t,a),o));case u$:return'"'+jfn(t)+'"';default:throw new px("impossible error: invalid scalar style")}}()}function pje(e,t){var n=Sje(e)?String(t):"";var r=e[e.length-1]==="\n";var i=r&&(e[e.length-2]==="\n"||e==="\n");var o=i?"+":r?"":"-";return n+o+"\n"}function mje(e){return e[e.length-1]==="\n"?e.slice(0,-1):e}function Xfn(e,t){var n=/(\n+)([^\n]*)/g;var r=function(){var u=e.indexOf("\n");u=u!==-1?u:e.length;n.lastIndex=u;return gje(e.slice(0,u),t)}();var i=e[0]==="\n"||e[0]===" ";var o;var a;while(a=n.exec(e)){var s=a[1],l=a[2];o=l[0]===" ";r+=s+(!i&&!o&&l!==""?"\n":"")+gje(l,t);i=o}return r}function gje(e,t){if(e===""||e[0]===" ")return e;var n=/ [^ ]/g;var r;var i=0,o,a=0,s=0;var l="";while(r=n.exec(e)){s=r.index;if(s-i>t){o=a>i?a:s;l+="\n"+e.slice(i,o);i=o+1}a=s}l+="\n";if(e.length-i>t&&a>i){l+=e.slice(i,a)+"\n"+e.slice(a+1)}else{l+=e.slice(i)}return l.slice(1)}function jfn(e){var t="";var n=0;var r;for(var i=0;i=65536?i+=2:i++){n=d$(e,i);r=Gy[n];if(!r&&h$(n)){t+=e[i];if(n>=65536)t+=e[i+1]}else{t+=r||Bfn(n)}}return t}function Kfn(e,t,n){var r="",i=e.tag,o,a,s;for(o=0,a=n.length;o1024)d+="? ";d+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" ");if(!UC(e,t,u,false,false)){continue}d+=e.dump;r+=d}e.tag=i;e.dump="{"+r+"}"}function Jfn(e,t,n,r){var i="",o=e.tag,a=Object.keys(n),s,l,u,d,f,h;if(e.sortKeys===true){a.sort()}else if(typeof e.sortKeys==="function"){a.sort(e.sortKeys)}else if(e.sortKeys){throw new px("sortKeys must be a boolean or a function")}for(s=0,l=a.length;s1024;if(f){if(e.dump&&bee===e.dump.charCodeAt(0)){h+="?"}else{h+="? "}}h+=e.dump;if(f){h+=z2e(e,t)}if(!UC(e,t+1,d,true,f)){continue}if(e.dump&&bee===e.dump.charCodeAt(0)){h+=":"}else{h+=": "}h+=e.dump;i+=h}e.tag=o;e.dump=i||"{}"}function bje(e,t,n){var r,i,o,a,s,l;i=n?e.explicitTypes:e.implicitTypes;for(o=0,a=i.length;o tag resolver accepts not "'+l+'" style')}e.dump=r}return true}}return false}function UC(e,t,n,r,i,o,a){e.tag=null;e.dump=n;if(!bje(e,n,false)){bje(e,n,true)}var s=Pfn.call(e.dump);var l=r;var u;if(r){r=e.flowLevel<0||e.flowLevel>t}var d=s==="[object Object]"||s==="[object Array]",f,h;if(d){f=e.duplicates.indexOf(n);h=f!==-1}if(e.tag!==null&&e.tag!=="?"||h||e.indent!==2&&t>0){i=false}if(h&&e.usedDuplicates[f]){e.dump="*ref_"+f}else{if(d&&h&&!e.usedDuplicates[f]){e.usedDuplicates[f]=true}if(s==="[object Object]"){if(r&&Object.keys(e.dump).length!==0){Jfn(e,t,e.dump,i);if(h){e.dump="&ref_"+f+e.dump}}else{Zfn(e,t,e.dump);if(h){e.dump="&ref_"+f+" "+e.dump}}}else if(s==="[object Array]"){if(r&&e.dump.length!==0){if(e.noArrayIndent&&!a&&t>0){yje(e,t-1,e.dump,i)}else{yje(e,t,e.dump,i)}if(h){e.dump="&ref_"+f+e.dump}}else{Kfn(e,t,e.dump);if(h){e.dump="&ref_"+f+" "+e.dump}}}else if(s==="[object String]"){if(e.tag!=="?"){qfn(e,e.dump,t,o,l)}}else if(s==="[object Undefined]"){return false}else{if(e.skipInvalid)return false;throw new px("unacceptable kind of an object to dump "+s)}if(e.tag!==null&&e.tag!=="?"){u=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21");if(e.tag[0]==="!"){u="!"+u}else if(u.slice(0,18)==="tag:yaml.org,2002:"){u="!!"+u.slice(18)}else{u="!<"+u+">"}e.dump=u+" "+e.dump}}return true}function Qfn(e,t){var n=[],r=[],i,o;U2e(e,n,r);for(i=0,o=r.length;i{Yo();B(xje,"isNothing");B(ydn,"isObject");B(bdn,"toArray");B(xdn,"extend");B(vdn,"repeat");B(_dn,"isNegativeZero");i1i=xje;o1i=ydn;a1i=bdn;s1i=vdn;l1i=_dn;c1i=xdn;Fp={isNothing:i1i,isObject:o1i,toArray:a1i,repeat:s1i,isNegativeZero:l1i,extend:c1i};B(vje,"formatError");B(f$,"YAMLException$1");f$.prototype=Object.create(Error.prototype);f$.prototype.constructor=f$;f$.prototype.toString=B(function e(t){return this.name+": "+vje(this,t)},"toString");px=f$;B(L2e,"getLine");B(D2e,"padStart");B(Tdn,"makeSnippet");u1i=Tdn;d1i=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"];f1i=["scalar","sequence","mapping"];B(wdn,"compileStyleAliases");B(Edn,"Type$1");$y=Edn;B(ije,"compileList");B(Cdn,"compileMap");B(F2e,"Schema$1");F2e.prototype.extend=B(function e(t){var n=[];var r=[];if(t instanceof $y){r.push(t)}else if(Array.isArray(t)){r=r.concat(t)}else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit))){if(t.implicit)n=n.concat(t.implicit);if(t.explicit)r=r.concat(t.explicit)}else{throw new px("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })")}n.forEach(function(o){if(!(o instanceof $y)){throw new px("Specified list of YAML types (or a single Type object) contains a non-Type object.")}if(o.loadKind&&o.loadKind!=="scalar"){throw new px("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}if(o.multi){throw new px("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}});r.forEach(function(o){if(!(o instanceof $y)){throw new px("Specified list of YAML types (or a single Type object) contains a non-Type object.")}});var i=Object.create(F2e.prototype);i.implicit=(this.implicit||[]).concat(n);i.explicit=(this.explicit||[]).concat(r);i.compiledImplicit=ije(i,"implicit");i.compiledExplicit=ije(i,"explicit");i.compiledTypeMap=Cdn(i.compiledImplicit,i.compiledExplicit);return i},"extend");h1i=F2e;p1i=new $y("tag:yaml.org,2002:str",{kind:"scalar",construct:B(function(e){return e!==null?e:""},"construct")});m1i=new $y("tag:yaml.org,2002:seq",{kind:"sequence",construct:B(function(e){return e!==null?e:[]},"construct")});g1i=new $y("tag:yaml.org,2002:map",{kind:"mapping",construct:B(function(e){return e!==null?e:{}},"construct")});y1i=new h1i({explicit:[p1i,m1i,g1i]});B(Sdn,"resolveYamlNull");B(Adn,"constructYamlNull");B(kdn,"isNull");b1i=new $y("tag:yaml.org,2002:null",{kind:"scalar",resolve:Sdn,construct:Adn,predicate:kdn,represent:{canonical:B(function(){return"~"},"canonical"),lowercase:B(function(){return"null"},"lowercase"),uppercase:B(function(){return"NULL"},"uppercase"),camelcase:B(function(){return"Null"},"camelcase"),empty:B(function(){return""},"empty")},defaultStyle:"lowercase"});B(Rdn,"resolveYamlBoolean");B(Pdn,"constructYamlBoolean");B(Idn,"isBoolean");x1i=new $y("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Rdn,construct:Pdn,predicate:Idn,represent:{lowercase:B(function(e){return e?"true":"false"},"lowercase"),uppercase:B(function(e){return e?"TRUE":"FALSE"},"uppercase"),camelcase:B(function(e){return e?"True":"False"},"camelcase")},defaultStyle:"lowercase"});B(Mdn,"isHexCode");B(Ldn,"isOctCode");B(Ddn,"isDecCode");B(Fdn,"resolveYamlInteger");B(Ndn,"constructYamlInteger");B(Odn,"isInteger");v1i=new $y("tag:yaml.org,2002:int",{kind:"scalar",resolve:Fdn,construct:Ndn,predicate:Odn,represent:{binary:B(function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},"binary"),octal:B(function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},"octal"),decimal:B(function(e){return e.toString(10)},"decimal"),hexadecimal:B(function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}});_1i=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");B(Bdn,"resolveYamlFloat");B(zdn,"constructYamlFloat");T1i=/^[-+]?[0-9]+e/;B(Udn,"representYamlFloat");B(Vdn,"isFloat");w1i=new $y("tag:yaml.org,2002:float",{kind:"scalar",resolve:Bdn,construct:zdn,predicate:Vdn,represent:Udn,defaultStyle:"lowercase"});$dn=y1i.extend({implicit:[b1i,x1i,v1i,w1i]});E1i=$dn;Gdn=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$");Hdn=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");B(Wdn,"resolveYamlTimestamp");B(Ydn,"constructYamlTimestamp");B(qdn,"representYamlTimestamp");C1i=new $y("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Wdn,construct:Ydn,instanceOf:Date,represent:qdn});B(Xdn,"resolveYamlMerge");S1i=new $y("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Xdn});_je="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";B(jdn,"resolveYamlBinary");B(Kdn,"constructYamlBinary");B(Zdn,"representYamlBinary");B(Jdn,"isBinary");A1i=new $y("tag:yaml.org,2002:binary",{kind:"scalar",resolve:jdn,construct:Kdn,predicate:Jdn,represent:Zdn});k1i=Object.prototype.hasOwnProperty;R1i=Object.prototype.toString;B(Qdn,"resolveYamlOmap");B(efn,"constructYamlOmap");P1i=new $y("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Qdn,construct:efn});I1i=Object.prototype.toString;B(tfn,"resolveYamlPairs");B(nfn,"constructYamlPairs");M1i=new $y("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:tfn,construct:nfn});L1i=Object.prototype.hasOwnProperty;B(rfn,"resolveYamlSet");B(ifn,"constructYamlSet");D1i=new $y("tag:yaml.org,2002:set",{kind:"mapping",resolve:rfn,construct:ifn});ofn=E1i.extend({implicit:[C1i,S1i],explicit:[A1i,P1i,M1i,D1i]});pL=Object.prototype.hasOwnProperty;N2e=1;afn=2;sfn=3;O2e=4;rje=1;F1i=2;mdn=3;N1i=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;O1i=/[\x85\u2028\u2029]/;B1i=/[,\[\]\{\}]/;lfn=/^(?:!|!!|![a-z\-]+!)$/i;cfn=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;B(oje,"_class");B(Cw,"is_EOL");B(hL,"is_WHITE_SPACE");B(X0,"is_WS_OR_EOL");B(G5,"is_FLOW_INDICATOR");B(ufn,"fromHexCode");B(dfn,"escapedHexLen");B(ffn,"fromDecimalCode");B(aje,"simpleEscapeSequence");B(hfn,"charFromCodepoint");B(Tje,"setProperty");pfn=new Array(256);mfn=new Array(256);for($5=0;$5<256;$5++){pfn[$5]=aje($5)?1:0;mfn[$5]=aje($5)}B(gfn,"State$1");B(wje,"generateError");B(da,"throwError");B(yee,"throwWarning");gdn={YAML:B(function e(t,n,r){var i,o,a;if(t.version!==null){da(t,"duplication of %YAML directive")}if(r.length!==1){da(t,"YAML directive accepts exactly one argument")}i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]);if(i===null){da(t,"ill-formed argument of the YAML directive")}o=parseInt(i[1],10);a=parseInt(i[2],10);if(o!==1){da(t,"unacceptable YAML version of the document")}t.version=r[0];t.checkLineBreaks=a<2;if(a!==1&&a!==2){yee(t,"unsupported YAML version of the document")}},"handleYamlDirective"),TAG:B(function e(t,n,r){var i,o;if(r.length!==2){da(t,"TAG directive accepts exactly two arguments")}i=r[0];o=r[1];if(!lfn.test(i)){da(t,"ill-formed tag handle (first argument) of the TAG directive")}if(pL.call(t.tagMap,i)){da(t,'there is a previously declared suffix for "'+i+'" tag handle')}if(!cfn.test(o)){da(t,"ill-formed tag prefix (second argument) of the TAG directive")}try{o=decodeURIComponent(o)}catch(a){da(t,"tag prefix is malformed: "+o)}t.tagMap[i]=o},"handleTagDirective")};B(TR,"captureSegment");B(sje,"mergeMappings");B(H5,"storeMappingPair");B(V2e,"readLineBreak");B(yh,"skipSeparationSpace");B(_ee,"testDocumentSeparator");B($2e,"writeFoldedLines");B(yfn,"readPlainScalar");B(bfn,"readSingleQuotedScalar");B(xfn,"readDoubleQuotedScalar");B(vfn,"readFlowCollection");B(_fn,"readBlockScalar");B(lje,"readBlockSequence");B(Tfn,"readBlockMapping");B(wfn,"readTagProperty");B(Efn,"readAnchorProperty");B(Cfn,"readAlias");B(W5,"composeNode");B(Sfn,"readDocument");B(Eje,"loadDocuments");B(Afn,"loadAll$1");B(kfn,"load$1");z1i=Afn;U1i=kfn;Rfn={loadAll:z1i,load:U1i};Pfn=Object.prototype.toString;Ifn=Object.prototype.hasOwnProperty;Cje=65279;V1i=9;bee=10;$1i=13;G1i=32;H1i=33;W1i=34;cje=35;Y1i=37;q1i=38;X1i=39;j1i=42;Mfn=44;K1i=45;B2e=58;Z1i=61;J1i=62;Q1i=63;evi=64;Lfn=91;Dfn=93;tvi=96;Ffn=123;nvi=124;Nfn=125;Gy={};Gy[0]="\\0";Gy[7]="\\a";Gy[8]="\\b";Gy[9]="\\t";Gy[10]="\\n";Gy[11]="\\v";Gy[12]="\\f";Gy[13]="\\r";Gy[27]="\\e";Gy[34]='\\"';Gy[92]="\\\\";Gy[133]="\\N";Gy[160]="\\_";Gy[8232]="\\L";Gy[8233]="\\P";rvi=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];ivi=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;B(Ofn,"compileStyleMap");B(Bfn,"encodeHex");ovi=1;xee=2;B(zfn,"State");B(uje,"indentString");B(z2e,"generateNextLine");B(Ufn,"testImplicitResolving");B(vee,"isWhitespace");B(h$,"isPrintable");B(dje,"isNsCharOrWhitespace");B(fje,"isPlainSafe");B(Vfn,"isPlainSafeFirst");B($fn,"isPlainSafeLast");B(d$,"codePointAt");B(Sje,"needIndentIndicator");Gfn=1;hje=2;Hfn=3;Wfn=4;u$=5;B(Yfn,"chooseScalarStyle");B(qfn,"writeScalar");B(pje,"blockHeader");B(mje,"dropEndingNewline");B(Xfn,"foldString");B(gje,"foldLine");B(jfn,"escapeString");B(Kfn,"writeFlowSequence");B(yje,"writeBlockSequence");B(Zfn,"writeFlowMapping");B(Jfn,"writeBlockMapping");B(bje,"detectType");B(UC,"writeNode");B(Qfn,"getDuplicateReferences");B(U2e,"inspectNode");B(ehn,"dump$1");avi=ehn;svi={dump:avi};B(G2e,"renamed");mL=$dn;gL=Rfn.load;U4a=Rfn.loadAll;V4a=svi.dump;$4a=G2e("safeLoad","load");G4a=G2e("safeLoadAll","loadAll");H4a=G2e("safeDump","dump");});var thn,q5,lvi,Tee,Ro,$o,cvi;var Eg=Ce(()=>{Ta();Yo();thn=B(e=>{const{handDrawnSeed:t}=Mn();return{fill:e,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:e,seed:t}},"solidStateFill");q5=B(e=>{const t=lvi([...e.cssCompiledStyles||[],...e.cssStyles||[],...e.labelStyle||[]]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles");lvi=B(e=>{const t=new Map;e.forEach(n=>{const[r,i]=n.split(":");t.set(r.trim(),i?.trim())});return t},"styles2Map");Tee=B(e=>{return e==="color"||e==="font-size"||e==="font-family"||e==="font-weight"||e==="font-style"||e==="text-decoration"||e==="text-align"||e==="text-transform"||e==="line-height"||e==="letter-spacing"||e==="word-spacing"||e==="text-shadow"||e==="text-overflow"||e==="white-space"||e==="word-wrap"||e==="word-break"||e==="overflow-wrap"||e==="hyphens"},"isLabelStyle");Ro=B(e=>{const{stylesArray:t}=q5(e);const n=[];const r=[];const i=[];const o=[];t.forEach(a=>{const s=a[0];if(Tee(s)){n.push(a.join(":")+" !important")}else{r.push(a.join(":")+" !important");if(s.includes("stroke")){i.push(a.join(":")+" !important")}if(s==="fill"){o.push(a.join(":")+" !important")}}});return{labelStyles:n.join(";"),nodeStyles:r.join(";"),stylesArray:t,borderStyles:i,backgroundStyles:o}},"styles2String");$o=B((e,t)=>{const{themeVariables:n,handDrawnSeed:r}=Mn();const{nodeBorder:i,mainBkg:o}=n;const{stylesMap:a}=q5(e);const s=Object.assign({roughness:.7,fill:a.get("fill")||o,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:a.get("stroke")||i,seed:r,strokeWidth:a.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:cvi(a.get("stroke-dasharray"))},t);return s},"userNodeOverrides");cvi=B(e=>{if(!e){return[0,0]}const t=e.trim().split(/\s+/).map(Number);if(t.length===1){const i=isNaN(t[0])?0:t[0];return[i,i]}const n=isNaN(t[0])?0:t[0];const r=isNaN(t[1])?0:t[1];return[n,r]},"getStrokeDashArray")});var nhn=_r(Dm=>{"use strict";Object.defineProperty(Dm,"__esModule",{value:true});Dm.BLANK_URL=Dm.relativeFirstCharacters=Dm.whitespaceEscapeCharsRegex=Dm.urlSchemeRegex=Dm.ctrlCharactersRegex=Dm.htmlCtrlEntityRegex=Dm.htmlEntitiesRegex=Dm.invalidProtocolRegex=void 0;Dm.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im;Dm.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g;Dm.htmlCtrlEntityRegex=/&(newline|tab);/gi;Dm.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim;Dm.urlSchemeRegex=/^.+(:|:)/gim;Dm.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g;Dm.relativeFirstCharacters=[".","/"];Dm.BLANK_URL="about:blank"});var p$=_r(Aje=>{"use strict";Object.defineProperty(Aje,"__esModule",{value:true});Aje.sanitizeUrl=hvi;var Hy=nhn();function uvi(e){return Hy.relativeFirstCharacters.indexOf(e[0])>-1}function dvi(e){var t=e.replace(Hy.ctrlCharactersRegex,"");return t.replace(Hy.htmlEntitiesRegex,function(n,r){return String.fromCharCode(r)})}function fvi(e){return URL.canParse(e)}function rhn(e){try{return decodeURIComponent(e)}catch(t){return e}}function hvi(e){if(!e){return Hy.BLANK_URL}var t;var n=rhn(e.trim());do{n=dvi(n).replace(Hy.htmlCtrlEntityRegex,"").replace(Hy.ctrlCharactersRegex,"").replace(Hy.whitespaceEscapeCharsRegex,"").trim();n=rhn(n);t=n.match(Hy.ctrlCharactersRegex)||n.match(Hy.htmlEntitiesRegex)||n.match(Hy.htmlCtrlEntityRegex)||n.match(Hy.whitespaceEscapeCharsRegex)}while(t&&t.length>0);var r=n;if(!r){return Hy.BLANK_URL}if(uvi(r)){return r}var i=r.trimStart();var o=i.match(Hy.urlSchemeRegex);if(!o){return r}var a=o[0].toLowerCase().trim();if(Hy.invalidProtocolRegex.test(a)){return Hy.BLANK_URL}var s=i.replace(/\\/g,"/");if(a==="mailto:"||a.includes("://")){return s}if(a==="http:"||a==="https:"){if(!fvi(s)){return Hy.BLANK_URL}var l=new URL(s);l.protocol=l.protocol.toLowerCase();l.hostname=l.hostname.toLowerCase();return l.toString()}return s}});function ihn(e){return Array.isArray(e)}var ohn=Ce(()=>{});function H2e(e){if(typeof e!=="object")return false;if(e==null)return false;if(Object.getPrototypeOf(e)===null)return true;if(Object.prototype.toString.call(e)!=="[object Object]"){const n=e[Symbol.toStringTag];if(n==null)return false;if(!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable)return false;return e.toString()===`[object ${n}]`}let t=e;while(Object.getPrototypeOf(t)!==null)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}var ahn=Ce(()=>{});function shn(){}var lhn=Ce(()=>{});function W2e(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}var kje=Ce(()=>{});function wR(e){if(e==null)return e===void 0?"[object Undefined]":"[object Null]";return Object.prototype.toString.call(e)}var wee=Ce(()=>{});var Y2e,m$,g$,y$,b$,q2e,X2e,j2e,K2e,Z2e,J2e,Q2e,eEe,tEe,nEe,rEe,iEe,oEe,aEe,sEe,lEe,cEe;var uEe=Ce(()=>{Y2e="[object RegExp]";m$="[object String]";g$="[object Number]";y$="[object Boolean]";b$="[object Arguments]";q2e="[object Symbol]";X2e="[object Date]";j2e="[object Map]";K2e="[object Set]";Z2e="[object Array]";J2e="[object ArrayBuffer]";Q2e="[object Object]";eEe="[object DataView]";tEe="[object Uint8Array]";nEe="[object Uint8ClampedArray]";rEe="[object Uint16Array]";iEe="[object Uint32Array]";oEe="[object Int8Array]";aEe="[object Int16Array]";sEe="[object Int32Array]";lEe="[object Float32Array]";cEe="[object Float64Array]"});var Rje;var chn=Ce(()=>{Rje=typeof globalThis==="object"&&globalThis||typeof window==="object"&&window||typeof self==="object"&&self||typeof global==="object"&&global||function(){return this}()});function x$(e){return typeof Rje.Buffer!=="undefined"&&Rje.Buffer.isBuffer(e)}var dEe=Ce(()=>{chn()});function uhn(e){return Number.isSafeInteger(e)&&e>=0}var dhn=Ce(()=>{});function fEe(e){return e!=null&&typeof e!=="function"&&uhn(e.length)}var Pje=Ce(()=>{dhn()});function fhn(e){return e==="__proto__"}var hhn=Ce(()=>{});function yL(e){return e==null||typeof e!=="object"&&typeof e!=="function"}var Eee=Ce(()=>{});function v$(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}var hEe=Ce(()=>{});function phn(e,t){return _$(e,void 0,e,new Map,t)}function _$(e,t,n,r=new Map,i=void 0){const o=i?.(e,t,n,r);if(o!==void 0)return o;if(yL(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){const a=new Array(e.length);r.set(e,a);for(let s=0;s{Eee();hEe();kje();wee();uEe();dEe()});function ghn(e,t){return phn(e,(n,r,i,o)=>{const a=t?.(n,r,i,o);if(a!==void 0)return a;if(typeof e!=="object")return;if(wR(e)==="[object Object]"&&typeof e.constructor!=="function"){const s={};o.set(e,s);P_(s,e,i,o);return s}switch(Object.prototype.toString.call(e)){case g$:case m$:case y$:{const s=new e.constructor(e?.valueOf());P_(s,e);return s}case b$:{const s={};P_(s,e);s.length=e.length;s[Symbol.iterator]=e[Symbol.iterator];return s}default:return}})}var yhn=Ce(()=>{wee();uEe();mhn()});function Ije(e){return ghn(e)}var bhn=Ce(()=>{yhn()});function Cee(e){return e!==null&&typeof e==="object"&&wR(e)==="[object Arguments]"}var Mje=Ce(()=>{wee()});function See(e){return typeof e==="object"&&e!==null}var Lje=Ce(()=>{});function xhn(e){return See(e)&&fEe(e)}var vhn=Ce(()=>{Pje();Lje()});function bL(e){return v$(e)}var pEe=Ce(()=>{hEe()});function _hn(e){const t=e?.constructor;return e===(typeof t==="function"?t.prototype:Object.prototype)}var Thn=Ce(()=>{});function X5(e,t){if(typeof e!=="function"||t!=null&&typeof t!=="function")throw new TypeError("Expected a function");const n=function(...r){const i=t?t.apply(this,r):r[0];const o=n.cache;if(o.has(i))return o.get(i);const a=e.apply(this,r);n.cache=o.set(i,a)||o;return a};n.cache=new(X5.Cache||Map);return n}var whn=Ce(()=>{X5.Cache=Map});function Fje(e){if(yL(e))return e;const t=wR(e);if(!mvi(e))return{};if(ihn(e)){const r=Array.from(e);if(e.length>0&&typeof e[0]==="string"&&Object.hasOwn(e,"index")){r.index=e.index;r.input=e.input}return r}if(bL(e)){const r=e;const i=r.constructor;return new i(r.buffer,r.byteOffset,r.length)}if(t==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(t==="[object DataView]"){const r=e;const i=r.buffer;const o=r.byteOffset;const a=r.byteLength;const s=new ArrayBuffer(a);const l=new Uint8Array(i,o,a);new Uint8Array(s).set(l);return new DataView(s)}if(t==="[object Boolean]"||t==="[object Number]"||t==="[object String]"){const r=e.constructor;const i=new r(e.valueOf());if(t==="[object String]")yvi(i,e);else Dje(i,e);return i}if(t==="[object Date]")return new Date(Number(e));if(t==="[object RegExp]"){const r=e;const i=new RegExp(r.source,r.flags);i.lastIndex=r.lastIndex;return i}if(t==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(t==="[object Map]"){const r=e;const i=new Map;r.forEach((o,a)=>{i.set(a,o)});return i}if(t==="[object Set]"){const r=e;const i=new Set;r.forEach(o=>{i.add(o)});return i}if(t==="[object Arguments]"){const r=e;const i={};Dje(i,r);i.length=r.length;i[Symbol.iterator]=r[Symbol.iterator];return i}const n={};bvi(n,e);Dje(n,e);gvi(n,e);return n}function mvi(e){switch(wR(e)){case b$:case Z2e:case J2e:case eEe:case y$:case X2e:case lEe:case cEe:case oEe:case aEe:case sEe:case j2e:case g$:case Q2e:case Y2e:case K2e:case m$:case q2e:case tEe:case nEe:case rEe:case iEe:return true;default:return false}}function Dje(e,t){for(const n in t)if(Object.hasOwn(t,n))e[n]=t[n]}function gvi(e,t){const n=Object.getOwnPropertySymbols(t);for(let r=0;r=n))e[r]=t[r]}function bvi(e,t){const n=Object.getPrototypeOf(t);if(n!==null){if(typeof t.constructor==="function")Object.setPrototypeOf(e,n)}}var Ehn=Ce(()=>{Eee();wee();uEe();ohn();pEe()});function Chn(e){if(yL(e))return e;if(Array.isArray(e)||v$(e)||e instanceof ArrayBuffer||typeof SharedArrayBuffer!=="undefined"&&e instanceof SharedArrayBuffer)return e.slice(0);const t=Object.getPrototypeOf(e);if(t==null)return Object.assign(Object.create(t),e);const n=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new n(e);if(e instanceof RegExp){const r=new n(e);r.lastIndex=e.lastIndex;return r}if(e instanceof DataView)return new n(e.buffer.slice(0));if(e instanceof Error){let r;if(e instanceof AggregateError)r=new n(e.errors,e.message,{cause:e.cause});else r=new n(e.message,{cause:e.cause});r.stack=e.stack;Object.assign(r,e);return r}if(typeof File!=="undefined"&&e instanceof File)return new n([e],e.name,{type:e.type,lastModified:e.lastModified});if(typeof e==="object")return Object.assign(Object.create(t),e);return e}var Shn=Ce(()=>{Eee();hEe()});function Ahn(e,...t){const n=t.slice(0,-1);const r=t[t.length-1];let i=e;for(let o=0;o{Eee();Shn();kje();dEe();hhn();ahn();bhn();Mje();Lje();vhn();pEe()});function Nje(e,...t){return Ahn(e,...t,shn)}var Rhn=Ce(()=>{lhn();khn()});function gEe(e){if(e==null)return true;if(fEe(e)){if(typeof e.splice!=="function"&&typeof e!=="string"&&!x$(e)&&!bL(e)&&!Cee(e))return false;return e.length===0}if(typeof e==="object"||typeof e==="function"){if(e instanceof Map||e instanceof Set)return e.size===0;const t=Object.keys(e);if(_hn(e))return t.filter(n=>n!=="constructor").length===0;return t.length===0}return true}var Phn=Ce(()=>{dEe();Pje();Mje();Thn();pEe()});var yEe=Ce(()=>{whn();Ehn();Rhn();Phn()});function xEe(e,t){if(!e){return t}const n=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return xvi[n]??t}function Nhn(e,t){const n=e.trim();if(!n){return void 0}if(t.securityLevel!=="loose"){return(0,Lhn.sanitizeUrl)(n)}return n}function Bje(e,t){if(!e||!t){return 0}return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function Ohn(e){let t;let n=0;e.forEach(i=>{n+=Bje(i,t);t=i});const r=n/2;return zje(e,r)}function Bhn(e){if(e.length===1){return e[0]}return Ohn(e)}function zhn(e,t,n){const r=structuredClone(n);wt.info("our points",r);if(t!=="start_left"&&t!=="start_right"){r.reverse()}const i=25+e;const o=zje(r,i);const a=10+e*.5;const s=Math.atan2(r[0].y-o.y,r[0].x-o.x);const l={x:0,y:0};if(t==="start_left"){l.x=Math.sin(s+Math.PI)*a+(r[0].x+o.x)/2;l.y=-Math.cos(s+Math.PI)*a+(r[0].y+o.y)/2}else if(t==="end_right"){l.x=Math.sin(s-Math.PI)*a+(r[0].x+o.x)/2-5;l.y=-Math.cos(s-Math.PI)*a+(r[0].y+o.y)/2-5}else if(t==="end_left"){l.x=Math.sin(s)*a+(r[0].x+o.x)/2-5;l.y=-Math.cos(s)*a+(r[0].y+o.y)/2-5}else{l.x=Math.sin(s)*a+(r[0].x+o.x)/2;l.y=-Math.cos(s)*a+(r[0].y+o.y)/2}return l}function vEe(e){let t="";let n="";for(const r of e){if(r!==void 0){if(r.startsWith("color:")||r.startsWith("text-align:")){n=n+r+";"}else{t=t+r+";"}}}return{style:t,labelStyle:n}}function Uhn(e){let t="";const n="0123456789abcdef";const r=n.length;for(let i=0;iMath.round(parseFloat(o)).toString());return i.includes(n.toString())||i.includes(r.toString())}var Lhn,Oje,xvi,vvi,_vi,Dhn,Fhn,Tvi,wvi,Ihn,zje,Evi,Mhn,Uje,Vje,Cvi,Svi,j5,Avi,kee,kvi,bEe,Rvi,Pvi,mx,Ko,Vhn,tv,VC;var nl=Ce(()=>{Ta();Aa();Yo();Lhn=Ui(p$(),1);ks();yEe();Oje="\u200B";xvi={curveBasis:UE,curveBasisClosed:aUe,curveBasisOpen:sUe,curveBumpX:fK,curveBumpY:hK,curveBundle:lUe,curveCardinalClosed:cUe,curveCardinalOpen:dUe,curveCardinal:yK,curveCatmullRomClosed:hUe,curveCatmullRomOpen:pUe,curveCatmullRom:aO,curveLinear:I1,curveLinearClosed:mUe,curveMonotoneX:sO,curveMonotoneY:vK,curveNatural:_K,curveStep:TK,curveStepAfter:EK,curveStepBefore:wK};vvi=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi;_vi=B(function(e,t){const n=Dhn(e,/(?:init\b)|(?:initialize\b)/);let r={};if(Array.isArray(n)){const a=n.map(s=>s.args);ZQ(a);r=rf(r,[...a])}else{r=n.args}if(!r){return}let i=eee(e,t);const o="config";if(r[o]!==void 0){if(i==="flowchart-v2"){i="flowchart"}r[i]=r[o];delete r[o]}return r},"detectInit");Dhn=B(function(e,t=null){try{const n=new RegExp(`[%]{2}(?![{]${vvi.source})(?=[}][%]{2}).* +`,"ig");e=e.trim().replace(n,"").replace(/'/gm,'"');wt.debug(`Detecting diagram directive${t!==null?" type:"+t:""} based on the text:${e}`);let r;const i=[];while((r=o$.exec(e))!==null){if(r.index===o$.lastIndex){o$.lastIndex++}if(r&&!t||t&&r[1]?.match(t)||t&&r[2]?.match(t)){const o=r[1]?r[1]:r[2];const a=r[3]?r[3].trim():r[4]?JSON.parse(r[4].trim()):null;i.push({type:o,args:a})}}if(i.length===0){return{type:e,args:null}}return i.length===1?i[0]:i}catch(n){wt.error(`ERROR: ${n.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`);return{type:void 0,args:null}}},"detectDirective");Fhn=B(function(e){return e.replace(o$,"")},"removeDirectives");Tvi=B(function(e,t){for(const[n,r]of t.entries()){if(r.match(e)){return n}}return-1},"isSubstringInArray");B(xEe,"interpolateToCurve");B(Nhn,"formatUrl");wvi=B((e,...t)=>{const n=e.split(".");const r=n.length-1;const i=n[r];let o=window;for(let a=0;a{const n=Math.pow(10,t);return Math.round(e*n)/n},"roundNumber");zje=B((e,t)=>{let n=void 0;let r=t;for(const i of e){if(n){const o=Bje(i,n);if(o===0){return n}if(o=1){return{x:i.x,y:i.y}}if(a>0&&a<1){return{x:Ihn((1-a)*n.x+a*i.x,5),y:Ihn((1-a)*n.y+a*i.y,5)}}}}n=i}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint");Evi=B((e,t,n)=>{wt.info(`our points ${JSON.stringify(t)}`);if(t[0]!==n){t=t.reverse()}const r=25;const i=zje(t,r);const o=e?10:5;const a=Math.atan2(t[0].y-i.y,t[0].x-i.x);const s={x:0,y:0};s.x=Math.sin(a)*o+(t[0].x+i.x)/2;s.y=-Math.cos(a)*o+(t[0].y+i.y)/2;return s},"calcCardinalityPosition");B(zhn,"calcTerminalLabelPosition");B(vEe,"getStylesFromArray");Mhn=0;Uje=B(()=>{Mhn++;return"id-"+Math.random().toString(36).substr(2,12)+"-"+Mhn},"generateId");B(Uhn,"makeRandomHex");Vje=B(e=>{return Uhn(e.length)},"random");Cvi=B(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj");Svi=B(function(e,t){const n=t.text.replace(Ti.lineBreakRegex," ");const[,r]=mx(t.fontSize);const i=e.append("text");i.attr("x",t.x);i.attr("y",t.y);i.style("text-anchor",t.anchor);i.style("font-family",t.fontFamily);i.style("font-size",r);i.style("font-weight",t.fontWeight);i.attr("fill",t.fill);if(t.class!==void 0){i.attr("class",t.class)}const o=i.append("tspan");o.attr("x",t.x+t.textMargin*2);o.attr("fill",t.fill);o.text(n);return i},"drawSimpleText");j5=X5((e,t,n)=>{if(!e){return e}n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"
"},n);if(Ti.lineBreakRegex.test(e)){return e}const r=e.split(" ").filter(Boolean);const i=[];let o="";r.forEach((a,s)=>{const l=Cg(`${a} `,n);const u=Cg(o,n);if(l>t){const{hyphenatedStrings:h,remainingWord:m}=Avi(a,t,"-",n);i.push(o,...h);o=m}else if(u+l>=t){i.push(o);o=a}else{o=[o,a].filter(Boolean).join(" ")}const d=s+1;const f=d===r.length;if(f){i.push(o)}});return i.filter(a=>a!=="").join(n.joinWith)},(e,t,n)=>`${e}${t}${n.fontSize}${n.fontWeight}${n.fontFamily}${n.joinWith}`);Avi=X5((e,t,n="-",r)=>{r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},r);const i=[...e];const o=[];let a="";i.forEach((s,l)=>{const u=`${a}${s}`;const d=Cg(u,r);if(d>=t){const f=l+1;const h=i.length===f;const m=`${u}${n}`;o.push(h?u:m);a=""}else{a=u}});return{hyphenatedStrings:o,remainingWord:a}},(e,t,n="-",r)=>`${e}${t}${n}${r.fontSize}${r.fontWeight}${r.fontFamily}`);B(Aee,"calculateTextHeight");B(Cg,"calculateTextWidth");kee=X5((e,t)=>{const{fontSize:n=12,fontFamily:r="Arial",fontWeight:i=400}=t;if(!e){return{width:0,height:0}}const[,o]=mx(n);const a=["sans-serif",r];const s=e.split(Ti.lineBreakRegex);const l=[];const u=zr("body");if(!u.remove){return{width:0,height:0,lineHeight:0}}const d=u.append("svg");for(const h of a){let m=0;const g={width:0,height:0,lineHeight:0};for(const x of s){const w=Cvi();w.text=x||Oje;const _=Svi(d,w).style("font-size",o).style("font-weight",i).style("font-family",h);const C=(_._groups||_)[0][0].getBBox();if(C.width===0&&C.height===0){throw new Error("svg element not in render tree")}g.width=Math.round(Math.max(g.width,C.width));m=Math.round(C.height);g.height+=m;g.lineHeight=Math.round(Math.max(g.lineHeight,m))}l.push(g)}d.remove();const f=isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1;return l[f]},(e,t)=>`${e}${t.fontSize}${t.fontWeight}${t.fontFamily}`);kvi=class{constructor(e=false,t){this.count=0;this.count=t?t.length:0;this.next=e?()=>this.count++:()=>Date.now()}static{B(this,"InitIDGenerator")}};Rvi=B(function(e){bEe=bEe||document.createElement("div");e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";");bEe.innerHTML=e;return unescape(bEe.textContent)},"entityDecode");B(_Ee,"isDetailedError");Pvi=B((e,t,n,r)=>{if(!r){return}const i=e.node()?.getBBox();if(!i){return}e.append("text").text(r).attr("text-anchor","middle").attr("x",i.x+i.width/2).attr("y",-n).attr("class",t)},"insertTitle");mx=B(e=>{if(typeof e==="number"){return[e,e+"px"]}const t=parseInt(e??"",10);if(Number.isNaN(t)){return[void 0,void 0]}else if(e===String(t)){return[t,e+"px"]}else{return[t,e]}},"parseFontSize");B(Cl,"cleanAndMerge");Ko={assignWithDepth:rf,wrapLabel:j5,calculateTextHeight:Aee,calculateTextWidth:Cg,calculateTextDimensions:kee,cleanAndMerge:Cl,detectInit:_vi,detectDirective:Dhn,isSubstringInArray:Tvi,interpolateToCurve:xEe,calcLabelPosition:Bhn,calcCardinalityPosition:Evi,calcTerminalLabelPosition:zhn,formatUrl:Nhn,getStylesFromArray:vEe,generateId:Uje,random:Vje,runFunc:wvi,entityDecode:Rvi,insertTitle:Pvi,isLabelCoordinateInPath:$hn,parseFontSize:mx,InitIDGenerator:kvi};Vhn=B(function(e){let t=e;t=t.replace(/style.*:\S*#.*;/g,function(n){return n.substring(0,n.length-1)});t=t.replace(/classDef.*:\S*#.*;/g,function(n){return n.substring(0,n.length-1)});t=t.replace(/#\w+;/g,function(n){const r=n.substring(1,n.length-1);const i=/^\+?\d+$/.test(r);if(i){return"\uFB02\xB0\xB0"+r+"\xB6\xDF"}else{return"\uFB02\xB0"+r+"\xB6\xDF"}});return t},"encodeEntities");tv=B(function(e){return e.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities");VC=B((e,t,{counter:n=0,prefix:r,suffix:i},o)=>{if(o){return o}return`${r?`${r}_`:""}${e}_${t}_${n}${i?`_${i}`:""}`},"getEdgeId");B(Zh,"handleUndefinedAttr");B($hn,"isLabelCoordinateInPath")});async function Ree(e,t){const n=e.getElementsByTagName("img");if(!n||n.length===0){return}const r=t.replace(/]*>/g,"").trim()==="";await Promise.all([...n].map(i=>new Promise(o=>{function a(){i.style.display="flex";i.style.flexDirection="column";if(r){const s=Mn().fontSize?Mn().fontSize:window.getComputedStyle(document.body).fontSize;const l=5;const[u=ka.fontSize]=mx(s);const d=u*l+"px";i.style.minWidth=d;i.style.maxWidth=d}else{i.style.width="100%"}o(i)}B(a,"setupImage");setTimeout(()=>{if(i.complete){a()}});i.addEventListener("error",a);i.addEventListener("load",a)})))}var Sw;var Sg=Ce(()=>{nl();Ta();Yo();Sw=B(({flowchart:e})=>{const t=e?.subGraphTitleMargin?.top??0;const n=e?.subGraphTitleMargin?.bottom??0;const r=t+n;return{subGraphTitleTopMargin:t,subGraphTitleBottomMargin:n,subGraphTitleTotalMargin:r}},"getSubGraphTitleMargins");B(Ree,"configureLabelImages")});var Ivi,T$,$je,Ghn;var TEe=Ce(()=>{Ivi=Object.freeze({left:0,top:0,width:16,height:16});T$=Object.freeze({rotate:0,vFlip:false,hFlip:false});$je=Object.freeze({...Ivi,...T$});Ghn=Object.freeze({...$je,body:"",hidden:false})});var Mvi,Hhn;var Whn=Ce(()=>{TEe();Mvi=Object.freeze({width:null,height:null});Hhn=Object.freeze({...Mvi,...T$})});var Gje,wEe;var Yhn=Ce(()=>{Gje=(e,t,n,r="")=>{const i=e.split(":");if(e.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const s=i.pop();const l=i.pop();const u={provider:i.length>0?i[0]:r,prefix:l,name:s};return t&&!wEe(u)?null:u}const o=i[0];const a=o.split("-");if(a.length>1){const s={provider:r,prefix:a.shift(),name:a.join("-")};return t&&!wEe(s)?null:s}if(n&&r===""){const s={provider:r,prefix:"",name:o};return t&&!wEe(s,n)?null:s}return null};wEe=(e,t)=>{if(!e)return false;return!!((t&&e.prefix===""||!!e.prefix)&&!!e.name)}});function qhn(e,t){const n={};if(!e.hFlip!==!t.hFlip)n.hFlip=true;if(!e.vFlip!==!t.vFlip)n.vFlip=true;const r=((e.rotate||0)+(t.rotate||0))%4;if(r)n.rotate=r;return n}var Xhn=Ce(()=>{});function Hje(e,t){const n=qhn(e,t);for(const r in Ghn)if(r in T$){if(r in e&&!(r in n))n[r]=T$[r]}else if(r in t)n[r]=t[r];else if(r in e)n[r]=e[r];return n}var jhn=Ce(()=>{TEe();Xhn()});function Khn(e,t){const n=e.icons;const r=e.aliases||Object.create(null);const i=Object.create(null);function o(a){if(n[a])return i[a]=[];if(!(a in i)){i[a]=null;const s=r[a]&&r[a].parent;const l=s&&o(s);if(l)i[a]=[s].concat(l)}return i[a]}(t||Object.keys(n).concat(Object.keys(r))).forEach(o);return i}var Zhn=Ce(()=>{});function Jhn(e,t,n){const r=e.icons;const i=e.aliases||Object.create(null);let o={};function a(s){o=Hje(r[s]||i[s],o)}a(t);n.forEach(a);return Hje(e,o)}function Wje(e,t){if(e.icons[t])return Jhn(e,t,[]);const n=Khn(e,[t])[t];return n?Jhn(e,t,n):null}var Qhn=Ce(()=>{jhn();Zhn()});function Yje(e,t,n){if(t===1)return e;n=n||100;if(typeof e==="number")return Math.ceil(e*t*n)/n;if(typeof e!=="string")return e;const r=e.split(Lvi);if(r===null||!r.length)return e;const i=[];let o=r.shift();let a=Dvi.test(o);while(true){if(a){const s=parseFloat(o);if(isNaN(s))i.push(o);else i.push(Math.ceil(s*t*n)/n)}else i.push(o);o=r.shift();if(o===void 0)return i.join("");a=!a}}var Lvi,Dvi;var epn=Ce(()=>{Lvi=/(-?[0-9.]*[0-9]+[0-9.]*)/g;Dvi=/^-?[0-9.]*[0-9]+[0-9.]*$/g});function Fvi(e,t="defs"){let n="";const r=e.indexOf("<"+t);while(r>=0){const i=e.indexOf(">",r);const o=e.indexOf("",o);if(a===-1)break;n+=e.slice(i+1,o).trim();e=e.slice(0,r).trim()+e.slice(a+1)}return{defs:n,content:e}}function Nvi(e,t){return e?""+e+""+t:t}function tpn(e,t,n){const r=Fvi(e);return Nvi(r.defs,t+r.content+n)}var npn=Ce(()=>{});function qje(e,t){const n={...$je,...e};const r={...Hhn,...t};const i={left:n.left,top:n.top,width:n.width,height:n.height};let o=n.body;[n,r].forEach(x=>{const w=[];const _=x.hFlip;const C=x.vFlip;let A=x.rotate;if(_)if(C)A+=2;else{w.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")");w.push("scale(-1 1)");i.top=i.left=0}else if(C){w.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")");w.push("scale(1 -1)");i.top=i.left=0}let P;if(A<0)A-=Math.floor(A/4)*4;A=A%4;switch(A){case 1:P=i.height/2+i.top;w.unshift("rotate(90 "+P.toString()+" "+P.toString()+")");break;case 2:w.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:P=i.width/2+i.left;w.unshift("rotate(-90 "+P.toString()+" "+P.toString()+")");break}if(A%2===1){if(i.left!==i.top){P=i.left;i.left=i.top;i.top=P}if(i.width!==i.height){P=i.width;i.width=i.height;i.height=P}}if(w.length)o=tpn(o,'',"")});const a=r.width;const s=r.height;const l=i.width;const u=i.height;let d;let f;if(a===null){f=s===null?"1em":s==="auto"?u:s;d=Yje(f,l/u)}else{d=a==="auto"?l:a;f=s===null?Yje(d,u/l):s==="auto"?u:s}const h={};const m=(x,w)=>{if(!Ovi(w))h[x]=w.toString()};m("width",d);m("height",f);const g=[i.left,i.top,l,u];h.viewBox=g.join(" ");return{attributes:h,viewBox:g,body:o}}var Ovi;var rpn=Ce(()=>{TEe();Whn();epn();npn();Ovi=e=>e==="unset"||e==="undefined"||e==="none"});function zvi(e){e=e.replace(/[0-9]+$/,"")||"a";const t=ipn.get(e)||0;ipn.set(e,t+1);return t?`${e}${t}`:e}function Xje(e){const t=[];let n;while(n=Bvi.exec(e))t.push(n[1]);if(!t.length)return e;const r="suffix"+(Math.random()*16777216|Date.now()).toString(16);t.forEach(i=>{const o=zvi(i);const a=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+o+r+"$3")});e=e.replace(new RegExp(r,"g"),"");return e}var Bvi,ipn;var opn=Ce(()=>{Bvi=/\sid="(\S+)"/g;ipn=new Map});function jje(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'"+e+""}var apn=Ce(()=>{});var spn=Ce(()=>{Yhn();Qhn();rpn();opn();apn()});var Zje,Kje,lpn,w$,cpn,upn,nv;var Jh=Ce(()=>{Ta();Aa();Yo();spn();Zje={body:'?',height:80,width:80};Kje=new Map;lpn=new Map;w$=B(e=>{for(const t of e){if(!t.name){throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.')}wt.debug("Registering icon pack:",t.name);if("loader"in t){lpn.set(t.name,t.loader)}else if("icons"in t){Kje.set(t.name,t.icons)}else{wt.error("Invalid icon loader:",t);throw new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}}},"registerIconPacks");cpn=B(async(e,t)=>{const n=Gje(e,true,t!==void 0);if(!n){throw new Error(`Invalid icon name: ${e}`)}const r=n.prefix||t;if(!r){throw new Error(`Icon name must contain a prefix: ${e}`)}let i=Kje.get(r);if(!i){const a=lpn.get(r);if(!a){throw new Error(`Icon set not found: ${n.prefix}`)}try{const s=await a();i={...s,prefix:r};Kje.set(r,i)}catch(s){wt.error(s);throw new Error(`Failed to load icon set: ${n.prefix}`)}}const o=Wje(i,n.name);if(!o){throw new Error(`Icon not found: ${e}`)}return o},"getRegisteredIconData");upn=B(async e=>{try{await cpn(e);return true}catch{return false}},"isIconAvailable");nv=B(async(e,t,n)=>{let r;try{r=await cpn(e,t?.fallbackPrefix)}catch(a){wt.error(a);r=Zje}const i=qje(r,t);const o=jje(Xje(i.body),{...i.attributes,...n});return La(o,Ji())},"getIconSVG")});function tKe(){return{async:false,breaks:false,extensions:null,gfm:true,hooks:null,pedantic:false,renderer:null,silent:false,tokenizer:null,walkTokens:null}}function ypn(e){Z5=e}function Ac(e,t=""){let n=typeof e=="string"?e:e.source,r={replace:(i,o)=>{let a=typeof o=="string"?o:o.source;return a=a.replace(j0.caret,"$1"),n=n.replace(i,a),r},getRegex:()=>new RegExp(n,t)};return r}function $C(e,t){if(t){if(j0.escapeTest.test(e))return e.replace(j0.escapeReplace,hpn)}else if(j0.escapeTestNoEncode.test(e))return e.replace(j0.escapeReplaceNoEncode,hpn);return e}function ppn(e){try{e=encodeURI(e).replace(j0.percentDecode,"%")}catch{return null}return e}function mpn(e,t){let n=e.replace(j0.findPipe,(o,a,s)=>{let l=false,u=a;for(;--u>=0&&s[u]==="\\";)l=!l;return l?"|":" |"}),r=n.split(j0.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length0?-2:-1}function gpn(e,t,n,r,i){let o=t.href,a=t.title||null,s=e[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=true;let l={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:o,title:a,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=false,l}function __i(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(` +`).map(o=>{let a=o.match(n.other.beginningSpace);if(a===null)return o;let[s]=a;return s.length>=i.length?o.slice(i.length):o}).join(` +`)}function Wc(e,t){return K5.parse(e,t)}var Z5,Lee,Uvi,j0,Vvi,$vi,Gvi,Dee,Hvi,nKe,bpn,xpn,Wvi,rKe,Yvi,iKe,qvi,Xvi,kEe,oKe,jvi,vpn,Kvi,aKe,dpn,Zvi,Jvi,Qvi,e_i,_pn,t_i,REe,sKe,Tpn,n_i,wpn,r_i,i_i,o_i,Epn,a_i,s_i,Cpn,l_i,c_i,u_i,d_i,f_i,h_i,p_i,CEe,m_i,Spn,Apn,g_i,fpn,lKe,y_i,Jje,b_i,EEe,Pee,x_i,hpn,SEe,Aw,AEe,cKe,kw,Mee,T_i,K5,s5a,l5a,c5a,u5a,d5a,f5a,h5a;var kpn=Ce(()=>{Z5=tKe();Lee={exec:()=>null};Uvi=(()=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")};Vvi=/^(?:[ \t]*(?:\n|$))+/;$vi=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;Gvi=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/;Dee=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;Hvi=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;nKe=/(?:[*+-]|\d{1,9}[.)])/;bpn=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;xpn=Ac(bpn).replace(/bull/g,nKe).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex();Wvi=Ac(bpn).replace(/bull/g,nKe).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex();rKe=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/;Yvi=/^[^\n]+/;iKe=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/;qvi=Ac(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",iKe).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex();Xvi=Ac(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,nKe).getRegex();kEe="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";oKe=/|$))/;jvi=Ac("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",oKe).replace("tag",kEe).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();vpn=Ac(rKe).replace("hr",Dee).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",kEe).getRegex();Kvi=Ac(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",vpn).getRegex();aKe={blockquote:Kvi,code:$vi,def:qvi,fences:Gvi,heading:Hvi,hr:Dee,html:jvi,lheading:xpn,list:Xvi,newline:Vvi,paragraph:vpn,table:Lee,text:Yvi};dpn=Ac("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Dee).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",kEe).getRegex();Zvi={...aKe,lheading:Wvi,table:dpn,paragraph:Ac(rKe).replace("hr",Dee).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",dpn).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",kEe).getRegex()};Jvi={...aKe,html:Ac(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",oKe).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Lee,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ac(rKe).replace("hr",Dee).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",xpn).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()};Qvi=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;e_i=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;_pn=/^( {2,}|\\)\n(?!\s*$)/;t_i=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Uvi?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex();Epn=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/;a_i=Ac(Epn,"u").replace(/punct/g,REe).getRegex();s_i=Ac(Epn,"u").replace(/punct/g,wpn).getRegex();Cpn="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";l_i=Ac(Cpn,"gu").replace(/notPunctSpace/g,Tpn).replace(/punctSpace/g,sKe).replace(/punct/g,REe).getRegex();c_i=Ac(Cpn,"gu").replace(/notPunctSpace/g,i_i).replace(/punctSpace/g,r_i).replace(/punct/g,wpn).getRegex();u_i=Ac("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Tpn).replace(/punctSpace/g,sKe).replace(/punct/g,REe).getRegex();d_i=Ac(/\\(punct)/,"gu").replace(/punct/g,REe).getRegex();f_i=Ac(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex();h_i=Ac(oKe).replace("(?:-->|$)","-->").getRegex();p_i=Ac("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",h_i).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();CEe=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/;m_i=Ac(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",CEe).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex();Spn=Ac(/^!?\[(label)\]\[(ref)\]/).replace("label",CEe).replace("ref",iKe).getRegex();Apn=Ac(/^!?\[(ref)\](?:\[\])?/).replace("ref",iKe).getRegex();g_i=Ac("reflink|nolink(?!\\()","g").replace("reflink",Spn).replace("nolink",Apn).getRegex();fpn=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/;lKe={_backpedal:Lee,anyPunctuation:d_i,autolink:f_i,blockSkip:o_i,br:_pn,code:e_i,del:Lee,emStrongLDelim:a_i,emStrongRDelimAst:l_i,emStrongRDelimUnd:u_i,escape:Qvi,link:m_i,nolink:Apn,punctuation:n_i,reflink:Spn,reflinkSearch:g_i,tag:p_i,text:t_i,url:Lee};y_i={...lKe,link:Ac(/^!?\[(label)\]\((.*?)\)/).replace("label",CEe).getRegex(),reflink:Ac(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",CEe).getRegex()};Jje={...lKe,emStrongRDelimAst:c_i,emStrongLDelim:s_i,url:Ac(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",fpn).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Ac(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"};hpn=e=>x_i[e];SEe=class{options;rules;lexer;constructor(e){this.options=e||Z5}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Iee(n,` +`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=__i(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let r=Iee(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Iee(t[0],` +`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=Iee(t[0],` +`).split(` +`),r="",i="",o=[];for(;n.length>0;){let a=false,s=[],l;for(l=0;l1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:false,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let o=this.rules.other.listItemRegex(n),a=false;for(;e;){let l=false,u="",d="";if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;u=t[0],e=e.substring(u.length);let f=t[2].split(` +`,1)[0].replace(this.rules.other.listReplaceTabs,_=>" ".repeat(3*_.length)),h=e.split(` +`,1)[0],m=!f.trim(),g=0;if(this.options.pedantic?(g=2,d=f.trimStart()):m?g=t[1].length+1:(g=t[2].search(this.rules.other.nonSpaceChar),g=g>4?1:g,d=f.slice(g),g+=t[1].length),m&&this.rules.other.blankLine.test(h)&&(u+=h+` +`,e=e.substring(h.length+1),l=true),!l){let _=this.rules.other.nextBulletRegex(g),C=this.rules.other.hrRegex(g),A=this.rules.other.fencesBeginRegex(g),P=this.rules.other.headingBeginRegex(g),L=this.rules.other.htmlBeginRegex(g);for(;e;){let I=e.split(` +`,1)[0],N;if(h=I,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),N=h):N=h.replace(this.rules.other.tabCharGlobal," "),A.test(h)||P.test(h)||L.test(h)||_.test(h)||C.test(h))break;if(N.search(this.rules.other.nonSpaceChar)>=g||!h.trim())d+=` +`+N.slice(g);else{if(m||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||A.test(f)||P.test(f)||C.test(f))break;d+=` +`+h}!m&&!h.trim()&&(m=true),u+=I+` +`,e=e.substring(I.length+1),f=N.slice(g)}}i.loose||(a?i.loose=true:this.rules.other.doubleBlankLine.test(u)&&(a=true));let x=null,w;this.options.gfm&&(x=this.rules.other.listIsTask.exec(d),x&&(w=x[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:u,task:!!x,checked:w,loose:false,text:d,tokens:[]}),i.raw+=u}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let l=0;lf.type==="space"),d=u.length>0&&u.some(f=>this.rules.other.anyLine.test(f.raw));i.loose=d}if(i.loose)for(let l=0;l({text:s,tokens:this.lexer.inline(s),header:false,align:o.align[l]})));return o}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===` +`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=true:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=false),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=true:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=false),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:false,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let o=Iee(n.slice(0,-1),"\\");if((n.length-o.length)%2===0)return}else{let o=v_i(t[2],"()");if(o===-2)return;if(o>-1){let a=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,a).trim(),t[3]=""}}let r=t[2],i="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(r);o&&(r=o[1],i=o[3])}else i=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),gpn(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=t[r.toLowerCase()];if(!i){let o=n[0].charAt(0);return{type:"text",raw:o,text:o}}return gpn(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){let i=[...r[0]].length-1,o,a,s=i,l=0,u=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,t=t.slice(-1*e.length+i);(r=u.exec(t))!=null;){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o)continue;if(a=[...o].length,r[3]||r[4]){s+=a;continue}else if((r[5]||r[6])&&i%3&&!((i+a)%3)){l+=a;continue}if(s-=a,s>0)continue;a=Math.min(a,a+s+l);let d=[...r[0]][0].length,f=e.slice(0,i+r.index+d+a);if(Math.min(i,a)%2){let m=f.slice(1,-1);return{type:"em",raw:f,text:m,tokens:this.lexer.inlineTokens(m)}}let h=f.slice(2,-2);return{type:"strong",raw:f,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let n,r;if(t[2]==="@")n=t[0],r="mailto:"+n;else{let i;do i=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(i!==t[0]);n=t[0],t[1]==="www."?r="http://"+t[0]:r=t[0]}return{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}};Aw=class Qje{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Z5,this.options.tokenizer=this.options.tokenizer||new SEe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:false,inRawBlock:false,top:true};let n={other:j0,block:EEe.normal,inline:Pee.normal};this.options.pedantic?(n.block=EEe.pedantic,n.inline=Pee.pedantic):this.options.gfm&&(n.block=EEe.gfm,this.options.breaks?n.inline=Pee.breaks:n.inline=Pee.gfm),this.tokenizer.rules=n}static get rules(){return{block:EEe,inline:Pee}}static lex(t,n){return new Qje(n).lex(t)}static lexInline(t,n){return new Qje(n).inlineTokens(t)}lex(t){t=t.replace(j0.carriageReturn,` +`),this.blockTokens(t,this.tokens);for(let n=0;n(i=a.call({lexer:this},t,n))?(t=t.substring(i.raw.length),n.push(i),true):false))continue;if(i=this.tokenizer.space(t)){t=t.substring(i.raw.length);let a=n.at(-1);i.raw.length===1&&a!==void 0?a.raw+=` +`:n.push(i);continue}if(i=this.tokenizer.code(t)){t=t.substring(i.raw.length);let a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(` +`)?"":` +`)+i.raw,a.text+=` +`+i.text,this.inlineQueue.at(-1).src=a.text):n.push(i);continue}if(i=this.tokenizer.fences(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.heading(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.hr(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.blockquote(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.list(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.html(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.def(t)){t=t.substring(i.raw.length);let a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(` +`)?"":` +`)+i.raw,a.text+=` +`+i.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},n.push(i));continue}if(i=this.tokenizer.table(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.lheading(t)){t=t.substring(i.raw.length),n.push(i);continue}let o=t;if(this.options.extensions?.startBlock){let a=1/0,s=t.slice(1),l;this.options.extensions.startBlock.forEach(u=>{l=u.call({lexer:this},s),typeof l=="number"&&l>=0&&(a=Math.min(a,l))}),a<1/0&&a>=0&&(o=t.substring(0,a+1))}if(this.state.top&&(i=this.tokenizer.paragraph(o))){let a=n.at(-1);r&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(` +`)?"":` +`)+i.raw,a.text+=` +`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(i),r=o.length!==t.length,t=t.substring(i.raw.length);continue}if(i=this.tokenizer.text(t)){t=t.substring(i.raw.length);let a=n.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(` +`)?"":` +`)+i.raw,a.text+=` +`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(i);continue}if(t){let a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=true,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){let r=t,i=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)l.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,i.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let o;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)o=i[2]?i[2].length:0,r=r.slice(0,i.index+o)+"["+"a".repeat(i[0].length-o-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let a=false,s="";for(;t;){a||(s=""),a=false;let l;if(this.options.extensions?.inline?.some(d=>(l=d.call({lexer:this},t,n))?(t=t.substring(l.raw.length),n.push(l),true):false))continue;if(l=this.tokenizer.escape(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.tag(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.link(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(l.raw.length);let d=n.at(-1);l.type==="text"&&d?.type==="text"?(d.raw+=l.raw,d.text+=l.text):n.push(l);continue}if(l=this.tokenizer.emStrong(t,r,s)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.codespan(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.br(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.del(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.autolink(t)){t=t.substring(l.raw.length),n.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(t))){t=t.substring(l.raw.length),n.push(l);continue}let u=t;if(this.options.extensions?.startInline){let d=1/0,f=t.slice(1),h;this.options.extensions.startInline.forEach(m=>{h=m.call({lexer:this},f),typeof h=="number"&&h>=0&&(d=Math.min(d,h))}),d<1/0&&d>=0&&(u=t.substring(0,d+1))}if(l=this.tokenizer.inlineText(u)){t=t.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(s=l.raw.slice(-1)),a=true;let d=n.at(-1);d?.type==="text"?(d.raw+=l.raw,d.text+=l.text):n.push(l);continue}if(t){let d="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return n}};AEe=class{options;parser;constructor(e){this.options=e||Z5}space(e){return""}code({text:e,lang:t,escaped:n}){let r=(t||"").match(j0.notSpaceStart)?.[0],i=e.replace(j0.endingNewline,"")+` +`;return r?'
'+(n?i:$C(i,true))+`
+`:"
"+(n?i:$C(i,true))+`
+`}blockquote({tokens:e}){return`
+${this.parser.parse(e)}
+`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`${this.parser.parseInline(e)} +`}hr(e){return`
+`}list(e){let t=e.ordered,n=e.start,r="";for(let a=0;a +`+r+" +`}listitem(e){let t="";if(e.task){let n=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type==="paragraph"?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=n+" "+$C(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=true)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:true}):t+=n+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`
  • ${t}
  • +`}checkbox({checked:e}){return"'}paragraph({tokens:e}){return`

    ${this.parser.parseInline(e)}

    +`}table(e){let t="",n="";for(let i=0;i${r}`),` + +`+t+` +`+r+`
    +`}tablerow({text:e}){return` +${e} +`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+` +`}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${$C(e,true)}`}br(e){return"
    "}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=ppn(e);if(i===null)return r;e=i;let o='
    ",o}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=ppn(e);if(i===null)return $C(n);e=i;let o=`${n}{let a=i[o].flat(1/0);n=n.concat(this.walkTokens(a,t))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||false,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let o=t.renderers[i.name];o?t.renderers[i.name]=function(...a){let s=i.renderer.apply(this,a);return s===false&&(s=o.apply(this,a)),s}:t.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=t[i.level];o?o.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),r.extensions=t),n.renderer){let i=this.defaults.renderer||new AEe(this.defaults);for(let o in n.renderer){if(!(o in i))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let a=o,s=n.renderer[a],l=i[a];i[a]=(...u)=>{let d=s.apply(i,u);return d===false&&(d=l.apply(i,u)),d||""}}r.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new SEe(this.defaults);for(let o in n.tokenizer){if(!(o in i))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let a=o,s=n.tokenizer[a],l=i[a];i[a]=(...u)=>{let d=s.apply(i,u);return d===false&&(d=l.apply(i,u)),d}}r.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new Mee;for(let o in n.hooks){if(!(o in i))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let a=o,s=n.hooks[a],l=i[a];Mee.passThroughHooks.has(o)?i[a]=u=>{if(this.defaults.async&&Mee.passThroughHooksRespectAsync.has(o))return(async()=>{let f=await s.call(i,u);return l.call(i,f)})();let d=s.call(i,u);return l.call(i,d)}:i[a]=(...u)=>{if(this.defaults.async)return(async()=>{let f=await s.apply(i,u);return f===false&&(f=await l.apply(i,u)),f})();let d=s.apply(i,u);return d===false&&(d=l.apply(i,u)),d}}r.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,o=n.walkTokens;r.walkTokens=function(a){let s=[];return s.push(o.call(this,a)),i&&(s=s.concat(i.call(this,a))),s}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Aw.lex(e,t??this.defaults)}parser(e,t){return kw.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},o=this.onError(!!i.silent,!!i.async);if(this.defaults.async===true&&r.async===false)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let a=i.hooks?await i.hooks.preprocess(t):t,s=await(i.hooks?await i.hooks.provideLexer():e?Aw.lex:Aw.lexInline)(a,i),l=i.hooks?await i.hooks.processAllTokens(s):s;i.walkTokens&&await Promise.all(this.walkTokens(l,i.walkTokens));let u=await(i.hooks?await i.hooks.provideParser():e?kw.parse:kw.parseInline)(l,i);return i.hooks?await i.hooks.postprocess(u):u})().catch(o);try{i.hooks&&(t=i.hooks.preprocess(t));let a=(i.hooks?i.hooks.provideLexer():e?Aw.lex:Aw.lexInline)(t,i);i.hooks&&(a=i.hooks.processAllTokens(a)),i.walkTokens&&this.walkTokens(a,i.walkTokens);let s=(i.hooks?i.hooks.provideParser():e?kw.parse:kw.parseInline)(a,i);return i.hooks&&(s=i.hooks.postprocess(s)),s}catch(a){return o(a)}}}onError(e,t){return n=>{if(n.message+=` +Please report this to https://github.com/markedjs/marked.`,e){let r="

    An error occurred:

    "+$C(n.message+"",true)+"
    ";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}};K5=new T_i;Wc.options=Wc.setOptions=function(e){return K5.setOptions(e),Wc.defaults=K5.defaults,ypn(Wc.defaults),Wc};Wc.getDefaults=tKe;Wc.defaults=Z5;Wc.use=function(...e){return K5.use(...e),Wc.defaults=K5.defaults,ypn(Wc.defaults),Wc};Wc.walkTokens=function(e,t){return K5.walkTokens(e,t)};Wc.parseInline=K5.parseInline;Wc.Parser=kw;Wc.parser=kw.parse;Wc.Renderer=AEe;Wc.TextRenderer=cKe;Wc.Lexer=Aw;Wc.lexer=Aw.lex;Wc.Tokenizer=SEe;Wc.Hooks=Mee;Wc.parse=Wc;s5a=Wc.options;l5a=Wc.setOptions;c5a=Wc.use;u5a=Wc.walkTokens;d5a=Wc.parseInline;f5a=kw.parse;h5a=Aw.lex});function PEe(e){var t=[];for(var n=1;n{});function Ppn(e,{markdownAutoWrap:t}){const n=e.replace(//g,"\n");const r=n.replace(/\n{2,}/g,"\n");const i=PEe(r);if(t===false){}return i}function Ipn(e){return e.split(/\\n|\n|/gi).map(t=>t.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(n=>({content:n,type:"normal"}))??[])}function Mpn(e,t={}){const n=Ppn(e,t);const r=Wc.lexer(n);const i=[[]];let o=0;function a(s,l="normal"){if(s.type==="text"){const u=s.text.split("\n");u.forEach((d,f)=>{if(f!==0){o++;i.push([])}d.split(" ").forEach(h=>{h=h.replace(/'/g,`'`);if(h){i[o].push({content:h,type:l})}})})}else if(s.type==="strong"||s.type==="em"){s.tokens.forEach(u=>{a(u,s.type)})}else if(s.type==="html"){i[o].push({content:s.text,type:"normal"})}}B(a,"processNode");r.forEach(s=>{if(s.type==="paragraph"){s.tokens?.forEach(l=>{a(l)})}else if(s.type==="html"){i[o].push({content:s.text,type:"normal"})}else{i[o].push({content:s.raw,type:"normal"})}});return i}function Lpn(e){if(!e){return""}return`

    ${e.replace(/\\n|\n/g,"
    ")}

    `}function Dpn(e,{markdownAutoWrap:t}={}){const n=Wc.lexer(e);function r(i){if(i.type==="text"){if(t===false){return i.text.replace(/\n */g,"
    ").replace(/ /g," ")}return i.text.replace(/\n */g,"
    ")}else if(i.type==="strong"){return`${i.tokens?.map(r).join("")}`}else if(i.type==="em"){return`${i.tokens?.map(r).join("")}`}else if(i.type==="paragraph"){return`

    ${i.tokens?.map(r).join("")}

    `}else if(i.type==="space"){return""}else if(i.type==="html"){return`${i.text}`}else if(i.type==="escape"){return i.text}wt.warn(`Unsupported markdown: ${i.type}`);return i.raw}B(r,"output");return n.map(r).join("")}function Fpn(e){if(Intl.Segmenter){return[...new Intl.Segmenter().segment(e)].map(t=>t.segment)}return[...e]}function Npn(e,t){const n=Fpn(t.content);return hKe(e,[],n,t.type)}function hKe(e,t,n,r){if(n.length===0){return[{content:t.join(""),type:r},{content:"",type:r}]}const[i,...o]=n;const a=[...t,i];if(e([{content:a.join(""),type:r}])){return hKe(e,a,o,r)}if(t.length===0&&i){t.push(i);n.shift()}return[{content:t.join(""),type:r},{content:n.join(""),type:r}]}function Opn(e,t){if(e.some(({content:n})=>n.includes("\n"))){throw new Error("splitLineToFitWidth does not support newlines in the line")}return IEe(e,t)}function IEe(e,t,n=[],r=[]){if(e.length===0){if(r.length>0){n.push(r)}return n.length>0?n:[]}let i="";if(e[0].content===" "){i=" ";e.shift()}const o=e.shift()??{content:" ",type:"normal"};const a=[...r];if(i!==""){a.push({content:i,type:"normal"})}a.push(o);if(t(a)){return IEe(e,t,n,a)}if(r.length>0){n.push(r);e.unshift(o)}else if(o.content){const[s,l]=Npn(t,o);n.push([s]);if(l.content){e.unshift(l)}}return IEe(e,t,n)}function dKe(e,t){if(t){e.attr("style",t)}}async function Bpn(e,t,n,r,i=false,o=Ji()){const a=e.append("foreignObject");a.attr("width",`${Math.min(10*n,Rpn)}px`);a.attr("height",`${Math.min(10*n,Rpn)}px`);const s=a.append("xhtml:div");const l=of(t.label)?await s$(t.label.replace(Ti.lineBreakRegex,"\n"),o):La(t.label,o);const u=t.isNode?"nodeLabel":"edgeLabel";const d=s.append("span");d.html(l);dKe(d,t.labelStyle);d.attr("class",`${u} ${r}`);dKe(s,t.labelStyle);s.style("display","table-cell");s.style("white-space","nowrap");s.style("line-height","1.5");if(n!==Number.POSITIVE_INFINITY){s.style("max-width",n+"px");s.style("text-align","center")}s.attr("xmlns","http://www.w3.org/1999/xhtml");if(i){s.attr("class","labelBkg")}let f=s.node().getBoundingClientRect();if(f.width===n){s.style("display","table");s.style("white-space","break-spaces");s.style("width",n+"px");f=s.node().getBoundingClientRect()}return a.node()}function MEe(e,t,n,r=false){const i=e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*n-.1+"em").attr("dy",n+"em");if(r){i.attr("text-anchor","middle")}return i}function zpn(e,t,n){const r=e.append("text");const i=MEe(r,1,t);LEe(i,n);const o=i.node().getComputedTextLength();r.remove();return o}function pKe(e,t,n){const r=e.append("text");const i=MEe(r,1,t);LEe(i,[{content:n,type:"normal"}]);const o=i.node()?.getBoundingClientRect();if(o){r.remove()}return o}function Upn(e,t,n,r=false,i=false){const o=1.1;const a=t.append("g");const s=a.insert("rect").attr("class","background").attr("style","stroke: none");const l=a.append("text").attr("y","-10.1");if(i){l.attr("text-anchor","middle")}let u=0;for(const d of n){const f=B(m=>zpn(a,o,m)<=e,"checkWidth");const h=f(d)?[d]:Opn(d,f);for(const m of h){const g=MEe(l,u,o,i);LEe(g,m);u++}}if(r){const d=l.node().getBBox();const f=2;s.attr("x",d.x-f).attr("y",d.y-f).attr("width",d.width+2*f).attr("height",d.height+2*f);return a.node()}else{return l.node()}}function fKe(e){const t=/&(amp|lt|gt);/g;return e.replace(t,(n,r)=>{switch(r){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return n}})}function LEe(e,t){e.text("");t.forEach((n,r)=>{const i=e.append("tspan").attr("font-style",n.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",n.type==="strong"?"bold":"normal");if(r===0){i.text(fKe(n.content))}else{i.text(" "+fKe(n.content))}})}async function Vpn(e,t={}){const n=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(i,o,a)=>{n.push((async()=>{const s=`${o}:${a}`;if(await upn(s)){return await nv(s,void 0,{class:"label-icon"})}else{return``}})());return i});const r=await Promise.all(n);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>r.shift()??"")}var Rpn,Qh;var Np=Ce(()=>{Jh();nl();Ta();Aa();Yo();ks();kpn();uKe();B(Ppn,"preprocessMarkdown");B(Ipn,"nonMarkdownToLines");B(Mpn,"markdownToLines");B(Lpn,"nonMarkdownToHTML");B(Dpn,"markdownToHTML");B(Fpn,"splitTextToChars");B(Npn,"splitWordToFitWidth");B(hKe,"splitWordToFitWidthRecursion");B(Opn,"splitLineToFitWidth");B(IEe,"splitLineToFitWidthRecursion");B(dKe,"applyStyle");Rpn=16384;B(Bpn,"addHtmlSpan");B(MEe,"createTspan");B(zpn,"computeWidthOfText");B(pKe,"computeDimensionOfText");B(Upn,"createFormattedText");B(fKe,"decodeHTMLEntities");B(LEe,"updateTextContentAndStyles");B(Vpn,"replaceIconSubstring");Qh=B(async(e,t="",{style:n="",isTitle:r=false,classes:i="",useHtmlLabels:o=true,markdown:a=true,isNode:s=true,width:l=200,addSvgBackground:u=false}={},d)=>{wt.debug("XYZ createText",t,n,r,i,o,s,"addSvgBackground: ",u);if(o){const f=a?Dpn(t,d):Lpn(t);const h=await Vpn(tv(f),d);const m=t.replace(/\\\\/g,"\\");const g={isNode:s,label:of(t)?m:h,labelStyle:n.replace("fill:","color:")};const x=await Bpn(e,g,l,i,u,d);return x}else{const f=tv(t.replace(//g,"
    "));const h=a?Mpn(f.replace("
    ","
    "),d):Ipn(f);const m=Upn(l,e,h,t?u:false,!s);if(s){if(/stroke:/.exec(n)){n=n.replace("stroke:","lineColor:")}const g=n.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");zr(m).attr("style",g)}else{const g=n.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");zr(m).select("rect").attr("style",g.replace(/background:/g,"fill:"));const x=n.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");zr(m).select("text").attr("style",x)}if(r){zr(m).selectAll("tspan.text-outer-tspan").classed("title-row",true)}else{zr(m).selectAll("tspan.text-outer-tspan").classed("row",true)}return m}},"createText")});var jo=_r((P5a,rmn)=>{"use strict";var vKe=function(e,t){return vKe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},vKe(e,t)};function Kpn(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}vKe(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var xL=function(){return xL=Object.assign||function(e){for(var t,n=1,r=arguments.length;n2&&h.push(A)}const m=[];d=Math.max(d,.1);const g=[];for(const C of h)for(let A=0;AC.yminA.ymin?1:C.xA.x?1:C.ymax===A.ymax?0:(C.ymax-A.ymax)/Math.abs(C.ymax-A.ymax)),!g.length)return m;let x=[],w=g[0].ymin,_=0;for(;x.length||g.length;){if(g.length){let C=-1;for(let A=0;Aw);A++)C=A;g.splice(0,C+1).forEach(A=>{x.push({s:w,edge:A})})}if(x=x.filter(C=>!(C.edge.ymax<=w)),x.sort((C,A)=>C.edge.x===A.edge.x?0:(C.edge.x-A.edge.x)/Math.abs(C.edge.x-A.edge.x)),(1!==f||_%d==0)&&x.length>1)for(let C=0;C=x.length)break;const P=x[C].edge,L=x[A].edge;m.push([[Math.round(P.x),w],[Math.round(L.x),w]])}w+=f,x.forEach(C=>{C.edge.x=C.edge.x+f*C.edge.islope}),_++}return m}(a,o,r);if(i){for(const u of a)mKe(u,s,-i);!function(u,d,f){const h=[];u.forEach(m=>h.push(...m)),mKe(h,d,f)}(l,s,-i)}return l}function Oee(e,t){var n,r=t.hachureAngle+90,i=t.hachureGap;i<0&&(i=4*t.strokeWidth),i=Math.round(Math.max(i,.1));var o=1;return t.roughness>=1&&((null===(n=t.randomizer)||void 0===n?void 0:n.next())||Math.random())>.7&&(o=i),E_i(e,i,r,o||1)}var EKe=function(){function e(t){this.helper=t}return e.prototype.fillPolygons=function(t,n){return this._fillPolygons(t,n)},e.prototype._fillPolygons=function(t,n){var r=Oee(t,n);return{type:"fillSketch",ops:this.renderLines(r,n)}},e.prototype.renderLines=function(t,n){for(var r=[],i=0,o=t;ih[0]&&(f=s[1],h=s[0]);for(var m=Math.atan((h[1]-f[1])/(h[0]-f[0])),g=0;gd[0]&&(u=a[1],d=a[0]);for(var f=Math.atan((d[1]-u[1])/(d[0]-u[0])),h=0;hd%2?u+n:u+t);o.push({key:"C",data:l}),t=l[4],n=l[5];break}case"Q":o.push({key:"Q",data:[...s]}),t=s[2],n=s[3];break;case"q":{const l=s.map((u,d)=>d%2?u+n:u+t);o.push({key:"Q",data:l}),t=l[2],n=l[3];break}case"A":o.push({key:"A",data:[...s]}),t=s[5],n=s[6];break;case"a":t+=s[5],n+=s[6],o.push({key:"A",data:[s[0],s[1],s[2],s[3],s[4],t,n]});break;case"H":o.push({key:"H",data:[...s]}),t=s[0];break;case"h":t+=s[0],o.push({key:"H",data:[t]});break;case"V":o.push({key:"V",data:[...s]}),n=s[0];break;case"v":n+=s[0],o.push({key:"V",data:[n]});break;case"S":o.push({key:"S",data:[...s]}),t=s[2],n=s[3];break;case"s":{const l=s.map((u,d)=>d%2?u+n:u+t);o.push({key:"S",data:l}),t=l[2],n=l[3];break}case"T":o.push({key:"T",data:[...s]}),t=s[0],n=s[1];break;case"t":t+=s[0],n+=s[1],o.push({key:"T",data:[t,n]});break;case"Z":case"z":o.push({key:"Z",data:[]}),t=r,n=i}return o}function Jpn(e){const t=[];let n="",r=0,i=0,o=0,a=0,s=0,l=0;for(const{key:u,data:d}of e){switch(u){case"M":t.push({key:"M",data:[...d]}),[r,i]=d,[o,a]=d;break;case"C":t.push({key:"C",data:[...d]}),r=d[4],i=d[5],s=d[2],l=d[3];break;case"L":t.push({key:"L",data:[...d]}),[r,i]=d;break;case"H":r=d[0],t.push({key:"L",data:[r,i]});break;case"V":i=d[0],t.push({key:"L",data:[r,i]});break;case"S":{let f=0,h=0;"C"===n||"S"===n?(f=r+(r-s),h=i+(i-l)):(f=r,h=i),t.push({key:"C",data:[f,h,...d]}),s=d[0],l=d[1],r=d[2],i=d[3];break}case"T":{const[f,h]=d;let m=0,g=0;"Q"===n||"T"===n?(m=r+(r-s),g=i+(i-l)):(m=r,g=i);const x=r+2*(m-r)/3,w=i+2*(g-i)/3,_=f+2*(m-f)/3,C=h+2*(g-h)/3;t.push({key:"C",data:[x,w,_,C,f,h]}),s=m,l=g,r=f,i=h;break}case"Q":{const[f,h,m,g]=d,x=r+2*(f-r)/3,w=i+2*(h-i)/3,_=m+2*(f-m)/3,C=g+2*(h-g)/3;t.push({key:"C",data:[x,w,_,C,m,g]}),s=f,l=h,r=m,i=g;break}case"A":{const f=Math.abs(d[0]),h=Math.abs(d[1]),m=d[2],g=d[3],x=d[4],w=d[5],_=d[6];if(0===f||0===h)t.push({key:"C",data:[r,i,w,_,w,_]}),r=w,i=_;else if(r!==w||i!==_){Qpn(r,i,w,_,f,h,m,g,x).forEach(function(C){t.push({key:"C",data:C})}),r=w,i=_}break}case"Z":t.push({key:"Z",data:[]}),r=o,i=a}n=u}return t}function Fee(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function Qpn(e,t,n,r,i,o,a,s,l,u){const d=(f=a,Math.PI*f/180);var f;let h=[],m=0,g=0,x=0,w=0;if(u)[m,g,x,w]=u;else{[e,t]=Fee(e,t,-d),[n,r]=Fee(n,r,-d);const $=(e-n)/2,K=(t-r)/2;let X=$*$/(i*i)+K*K/(o*o);X>1&&(X=Math.sqrt(X),i*=X,o*=X);const j=i*i,te=o*o,J=j*te-j*K*K-te*$*$,oe=j*K*K+te*$*$,se=(s===l?-1:1)*Math.sqrt(Math.abs(J/oe));x=se*i*K/o+(e+n)/2,w=se*-o*$/i+(t+r)/2,m=Math.asin(parseFloat(((t-w)/o).toFixed(9))),g=Math.asin(parseFloat(((r-w)/o).toFixed(9))),eg&&(m-=2*Math.PI),!l&&g>m&&(g-=2*Math.PI)}let _=g-m;if(Math.abs(_)>120*Math.PI/180){const $=g,K=n,X=r;g=l&&g>m?m+120*Math.PI/180*1:m+120*Math.PI/180*-1,h=Qpn(n=x+i*Math.cos(g),r=w+o*Math.sin(g),K,X,i,o,a,0,l,[g,$,x,w])}_=g-m;const C=Math.cos(m),A=Math.sin(m),P=Math.cos(g),L=Math.sin(g),I=Math.tan(_/4),N=4/3*i*I,O=4/3*o*I,z=[e,t],U=[e+N*A,t-O*C],W=[n+N*L,r-O*P],H=[n,r];if(U[0]=2*z[0]-U[0],U[1]=2*z[1]-U[1],u)return[U,W,H].concat(h);{h=[U,W,H].concat(h);const $=[];for(let K=0;K2){for(var i=[],o=0;o2*Math.PI&&(m=0,g=2*Math.PI);var x=2*Math.PI/l.curveStepCount,w=Math.min(x/2,(g-m)/2),_=Xpn(w,u,d,f,h,m,g,1,l);if(!l.disableMultiStroke){var C=Xpn(w,u,d,f,h,m,g,1.5,l);_.push.apply(_,C)}return a&&(s?_.push.apply(_,C$(C$([],vL(u,d,u+f*Math.cos(m),d+h*Math.sin(m),l),false),vL(u,d,u+f*Math.cos(g),d+h*Math.sin(g),l),false)):_.push({op:"lineTo",data:[u,d]},{op:"lineTo",data:[u+f*Math.cos(m),d+h*Math.sin(m)]})),{type:"path",ops:_}}function Wpn(e,t){for(var n=[],r=[0,0],i=[0,0],o=0,a=Jpn(Zpn(CKe(e)));o2){n.push({op:"move",data:[o[0][0]+Wa(a,t),o[0][1]+Wa(a,t)]});for(var l=1;l500?.4:-.0016668*l+1.233334;var d=i.maxRandomnessOffset||0;d*d*100>s&&(d=l/10);var f=d/2,h=.2+.2*nmn(i),m=i.bowing*i.maxRandomnessOffset*(r-t)/200,g=i.bowing*i.maxRandomnessOffset*(e-n)/200;m=Wa(m,i,u),g=Wa(g,i,u);var x=[],w=function(){return Wa(f,i,u)},_=function(){return Wa(d,i,u)},C=i.preserveVertices;return o&&(a?x.push({op:"move",data:[e+(C?0:w()),t+(C?0:w())]}):x.push({op:"move",data:[e+(C?0:Wa(d,i,u)),t+(C?0:Wa(d,i,u))]})),a?x.push({op:"bcurveTo",data:[m+e+(n-e)*h+w(),g+t+(r-t)*h+w(),m+e+2*(n-e)*h+w(),g+t+2*(r-t)*h+w(),n+(C?0:w()),r+(C?0:w())]}):x.push({op:"bcurveTo",data:[m+e+(n-e)*h+_(),g+t+(r-t)*h+_(),m+e+2*(n-e)*h+_(),g+t+2*(r-t)*h+_(),n+(C?0:_()),r+(C?0:_())]}),x}function FEe(e,t,n){if(!e.length)return[];var r=[];r.push([e[0][0]+Wa(t,n),e[0][1]+Wa(t,n)]),r.push([e[0][0]+Wa(t,n),e[0][1]+Wa(t,n)]);for(var i=1;i3){var o=[],a=1-n.curveTightness;i.push({op:"move",data:[e[1][0],e[1][1]]});for(var s=1;s+21&&i.push(s)}else i.push(s);i.push(e[t+3])}else{const s=.5,l=e[t+0],u=e[t+1],d=e[t+2],f=e[t+3],h=J5(l,u,s),m=J5(u,d,s),g=J5(d,f,s),x=J5(h,m,s),w=J5(m,g,s),_=J5(x,w,s);wKe([l,h,x,_],0,n,i),wKe([_,w,g,f],0,n,i)}var o,a;return i}function N_i(e,t){return VEe(e,0,e.length,t)}function VEe(e,t,n,r,i){const o=i||[],a=e[t],s=e[n-1];let l=0,u=1;for(let d=t+1;dl&&(l=f,u=d)}return Math.sqrt(l)>r?(VEe(e,t,u+1,r,o),VEe(e,u,n,r,o)):(o.length||o.push(a),o.push(s)),o}function xKe(e,t=.15,n){const r=[],i=(e.length-1)/3;for(let o=0;o0?VEe(r,0,r.length,n):r}var rv="none";var $Ee=function(){function e(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:false,disableMultiStrokeFill:false,preserveVertices:false,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}return e.newSeed=function(){return Math.floor(Math.random()*Math.pow(2,31))},e.prototype._o=function(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions},e.prototype._d=function(t,n,r){return{shape:t,sets:n||[],options:r||this.defaultOptions}},e.prototype.line=function(t,n,r,i,o){var a=this._o(o);return this._d("line",[emn(t,n,r,i,a)],a)},e.prototype.rectangle=function(t,n,r,i,o){var a=this._o(o),s=[],l=L_i(t,n,r,i,a);if(a.fill){var u=[[t,n],[t+r,n],[t+r,n+i],[t,n+i]];"solid"===a.fillStyle?s.push(bKe([u],a)):s.push(E$([u],a))}return a.stroke!==rv&&s.push(l),this._d("rectangle",s,a)},e.prototype.ellipse=function(t,n,r,i,o){var a=this._o(o),s=[],l=tmn(r,i,a),u=_Ke(t,n,a,l);if(a.fill)if("solid"===a.fillStyle){var d=_Ke(t,n,a,l).opset;d.type="fillPath",s.push(d)}else s.push(E$([u.estimatedPoints],a));return a.stroke!==rv&&s.push(u.opset),this._d("ellipse",s,a)},e.prototype.circle=function(t,n,r,i){var o=this.ellipse(t,n,r,r,i);return o.shape="circle",o},e.prototype.linearPath=function(t,n){var r=this._o(n);return this._d("linearPath",[OEe(t,false,r)],r)},e.prototype.arc=function(t,n,r,i,o,a,s,l){void 0===s&&(s=false);var u=this._o(l),d=[],f=Hpn(t,n,r,i,o,a,s,true,u);if(s&&u.fill)if("solid"===u.fillStyle){var h=xL({},u);h.disableMultiStroke=true;var m=Hpn(t,n,r,i,o,a,true,false,h);m.type="fillPath",d.push(m)}else d.push(function(g,x,w,_,C,A,P){var L=g,I=x,N=Math.abs(w/2),O=Math.abs(_/2);N+=Wa(.01*N,P),O+=Wa(.01*O,P);for(var z=C,U=A;z<0;)z+=2*Math.PI,U+=2*Math.PI;U-z>2*Math.PI&&(z=0,U=2*Math.PI);for(var W=(U-z)/P.curveStepCount,H=[],$=z;$<=U;$+=W)H.push([L+N*Math.cos($),I+O*Math.sin($)]);return H.push([L+N*Math.cos(U),I+O*Math.sin(U)]),H.push([L,I]),E$([H],P)}(t,n,r,i,o,a,u));return u.stroke!==rv&&d.push(f),this._d("arc",d,u)},e.prototype.curve=function(t,n){var r=this._o(n),i=[],o=Gpn(t,r);if(r.fill&&r.fill!==rv)if("solid"===r.fillStyle){var a=Gpn(t,xL(xL({},r),{disableMultiStroke:true,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(a.ops)})}else{var s=[],l=t;if(l.length)for(var u=0,d="number"==typeof l[0][0]?[l]:l;u{C.length>=4&&w.push(...xKe(C,h)),C=[]},P=()=>{A(),w.length&&(x.push(w),w=[])};for(const{key:I,data:N}of g)switch(I){case"M":P(),_=[N[0],N[1]],w.push(_);break;case"L":A(),w.push([N[0],N[1]]);break;case"C":if(!C.length){const O=w.length?w[w.length-1]:_;C.push([O[0],O[1]])}C.push([N[0],N[1]]),C.push([N[2],N[3]]),C.push([N[4],N[5]]);break;case"Z":A(),w.push([_[0],_[1]])}if(P(),!m)return x;const L=[];for(const I of x){const N=N_i(I,m);N.length&&L.push(N)}return L}(t,1,s?4-4*(r.simplification||1):(1+r.roughness)/2),u=Wpn(t,r);if(o)if("solid"===r.fillStyle)if(1===l.length){var d=Wpn(t,xL(xL({},r),{disableMultiStroke:true,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(d.ops)})}else i.push(bKe(l,r));else i.push(E$(l,r));return a&&(s?l.forEach(function(f){i.push(OEe(f,false,r))}):i.push(u)),this._d("path",i,r)},e.prototype.opsToPath=function(t,n){for(var r="",i=0,o=t.ops;i=0?a.data.map(function(l){return+l.toFixed(n)}):a.data;switch(a.op){case"move":r+="M".concat(s[0]," ").concat(s[1]," ");break;case"bcurveTo":r+="C".concat(s[0]," ").concat(s[1],", ").concat(s[2]," ").concat(s[3],", ").concat(s[4]," ").concat(s[5]," ");break;case"lineTo":r+="L".concat(s[0]," ").concat(s[1]," ")}}return r.trim()},e.prototype.toPaths=function(t){for(var n=t.sets||[],r=t.options||this.defaultOptions,i=[],o=0,a=n;o=0?s.data.map(function(u){return+u.toFixed(r)}):s.data;switch(s.op){case"move":t.moveTo(l[0],l[1]);break;case"bcurveTo":t.bezierCurveTo(l[0],l[1],l[2],l[3],l[4],l[5]);break;case"lineTo":t.lineTo(l[0],l[1])}}"fillPath"===n.type?t.fill(i):t.stroke()},Object.defineProperty(e.prototype,"generator",{get:function(){return this.gen},enumerable:false,configurable:true}),e.prototype.getDefaultOptions=function(){return this.gen.defaultOptions},e.prototype.line=function(t,n,r,i,o){var a=this.gen.line(t,n,r,i,o);return this.draw(a),a},e.prototype.rectangle=function(t,n,r,i,o){var a=this.gen.rectangle(t,n,r,i,o);return this.draw(a),a},e.prototype.ellipse=function(t,n,r,i,o){var a=this.gen.ellipse(t,n,r,i,o);return this.draw(a),a},e.prototype.circle=function(t,n,r,i){var o=this.gen.circle(t,n,r,i);return this.draw(o),o},e.prototype.linearPath=function(t,n){var r=this.gen.linearPath(t,n);return this.draw(r),r},e.prototype.polygon=function(t,n){var r=this.gen.polygon(t,n);return this.draw(r),r},e.prototype.arc=function(t,n,r,i,o,a,s,l){void 0===s&&(s=false);var u=this.gen.arc(t,n,r,i,o,a,s,l);return this.draw(u),u},e.prototype.curve=function(t,n){var r=this.gen.curve(t,n);return this.draw(r),r},e.prototype.path=function(t,n){var r=this.gen.path(t,n);return this.draw(r),r},e}();var NEe="http://www.w3.org/2000/svg";var B_i=function(){function e(t,n){this.svg=t,this.gen=new $Ee(n)}return e.prototype.draw=function(t){for(var n=t.sets||[],r=t.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,o=i.createElementNS(NEe,"g"),a=t.options.fixedDecimalPlaceDigits,s=0,l=n;s`${r===0?"M":"L"}${n.x},${n.y}`);t.push("Z");return t.join(" ")}function _L(e,t,n,r,i,o){const a=[];const s=50;const l=n-e;const u=r-t;const d=l/o;const f=2*Math.PI/d;const h=t+u/2;for(let m=0;m<=s;m++){const g=m/s;const x=e+g*l;const w=h+i*Math.sin(f*(x-e));a.push({x,y:w})}return a}function zee(e,t,n,r,i,o){const a=[];const s=i*Math.PI/180;const l=o*Math.PI/180;const u=l-s;const d=u/(r-1);for(let f=0;fl.tagName==="path");const n=document.createElementNS("http://www.w3.org/2000/svg","path");const r=t.map(l=>l.getAttribute("d")).filter(l=>l!==null).join(" ");n.setAttribute("d",r);const i=t.find(l=>l.getAttribute("fill")!=="none");const o=t.find(l=>l.getAttribute("stroke")!=="none");const a=B((l,u)=>{return l?.getAttribute(u)??void 0},"getAttr");if(i){const l={fill:a(i,"fill"),"fill-opacity":a(i,"fill-opacity")??"1"};Object.entries(l).forEach(([u,d])=>{if(d){n.setAttribute(u,d)}})}if(o){const l={stroke:a(o,"stroke"),"stroke-width":a(o,"stroke-width")??"1","stroke-opacity":a(o,"stroke-opacity")??"1"};Object.entries(l).forEach(([u,d])=>{if(d){n.setAttribute(u,d)}})}const s=document.createElementNS("http://www.w3.org/2000/svg","g");s.appendChild(n);return s}function ymn(e,t){return e.intersect(t)}function bmn(e,t,n,r){var i=e.x;var o=e.y;var a=i-r.x;var s=o-r.y;var l=Math.sqrt(t*t*s*s+n*n*a*a);var u=Math.abs(t*n*a/l);if(r.x0}function Tmn(e,t,n){let r=e.x;let i=e.y;let o=[];let a=Number.POSITIVE_INFINITY;let s=Number.POSITIVE_INFINITY;if(typeof t.forEach==="function"){t.forEach(function(d){a=Math.min(a,d.x);s=Math.min(s,d.y)})}else{a=Math.min(a,t.x);s=Math.min(s,t.y)}let l=r-e.width/2-a;let u=i-e.height/2-s;for(let d=0;d1){o.sort(function(d,f){let h=d.x-n.x;let m=d.y-n.y;let g=Math.sqrt(h*h+m*m);let x=f.x-n.x;let w=f.y-n.y;let _=Math.sqrt(x*x+w*w);return g<_?-1:g===_?0:1})}return o[0]}function Emn(e,t){const{labelStyles:n}=Ro(t);t.labelStyle=n;const r=za(t);let i=r;if(!r){i="anchor"}const o=e.insert("g").attr("class",i).attr("id",t.domId||t.id);const a=1;const{cssStyles:s}=t;const l=wmn.default.svg(o);const u=$o(t,{fill:"black",stroke:"none",fillStyle:"solid"});if(t.look!=="handDrawn"){u.roughness=0}const d=l.circle(0,0,a*2,u);const f=o.insert(()=>d,":first-child");f.attr("class","anchor").attr("style",Zh(s));Qo(t,f);t.intersect=function(h){wt.info("Circle intersect",t,a,h);return Do.circle(t,a,h)};return o}function IKe(e,t,n,r,i,o,a){const s=20;const l=(e+n)/2;const u=(t+r)/2;const d=Math.atan2(r-t,n-e);const f=(n-e)/2;const h=(r-t)/2;const m=f/i;const g=h/o;const x=Math.sqrt(m**2+g**2);if(x>1){throw new Error("The given radii are too small to create an arc between the points.")}const w=Math.sqrt(1-x**2);const _=l+w*o*Math.sin(d)*(a?-1:1);const C=u-w*i*Math.cos(d)*(a?-1:1);const A=Math.atan2((t-C)/o,(e-_)/i);const P=Math.atan2((r-C)/o,(n-_)/i);let L=P-A;if(a&&L<0){L+=2*Math.PI}if(!a&&L>0){L-=2*Math.PI}const I=[];for(let N=0;Na-o);return i*(1-Math.sqrt(1-(e/r/2)**2))}async function Amn(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);t.labelStyle=n;const i=t.padding??0;const o=t.look==="neo"?16:i;const a=t.look==="neo"?12:i;const s=B(z=>z+a,"calcTotalHeight");const l=B(z=>{const U=z/2;const W=U/(2.5+z/50);return[W,U]},"calcEllipseRadius");const{shapeSvg:u,bbox:d}=await Ya(e,t,za(t));const f=s(t?.height?t?.height:d.height);const[h,m]=l(f);const g=Smn(f,h,m);const x=(t?.width?t?.width:d.width)+o*2+g;const w=x-g;const _=f;const{cssStyles:C}=t;const A=[{x:w/2,y:-_/2},{x:-w/2,y:-_/2},...IKe(-w/2,-_/2,-w/2,_/2,h,m,false),{x:w/2,y:_/2},...IKe(w/2,_/2,w/2,-_/2,h,m,true)];const P=Cmn.default.svg(u);const L=$o(t,{});if(t.look!=="handDrawn"){L.roughness=0;L.fillStyle="solid"}const I=ql(A);const N=P.path(I,L);const O=u.insert(()=>N,":first-child");O.attr("class","basic label-container outer-path");if(C&&t.look!=="handDrawn"){O.selectAll("path").attr("style",C)}if(r&&t.look!=="handDrawn"){O.selectAll("path").attr("style",r)}O.attr("transform",`translate(${h/2}, 0)`);Qo(t,O);t.intersect=function(z){const U=Do.polygon(t,A,z);return U};return u}function AR(e,t,n,r){return e.insert("polygon",":first-child").attr("points",r.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+n/2+")")}async function Rmn(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);t.labelStyle=n;const i=t.padding??0;const o=t.look==="neo"?28:i;const a=t.look==="neo"?24:i;const{shapeSvg:s,bbox:l}=await Ya(e,t,za(t));const u=(t?.width??l.width)+(t.look==="neo"?o*2:o+HEe);const d=(t?.height??l.height)+(t.look==="neo"?a*2:a);const f=0;const h=u;const m=-d;const g=0;const x=[{x:f+HEe,y:m},{x:h,y:m},{x:h,y:g},{x:f,y:g},{x:f,y:m+HEe},{x:f+HEe,y:m}];let w;const{cssStyles:_}=t;if(t.look==="handDrawn"){const C=kmn.default.svg(s);const A=$o(t,{});const P=ql(x);const L=C.path(P,A);w=s.insert(()=>L,":first-child").attr("transform",`translate(${-u/2}, ${d/2})`);if(_){w.attr("style",_)}}else{w=AR(s,u,d,x)}if(r){w.attr("style",r)}Qo(t,w);t.intersect=function(C){return Do.polygon(t,x,C)};return s}function Imn(e,t){const{nodeStyles:n}=Ro(t);t.label="";const r=e.insert("g").attr("class",za(t)).attr("id",t.domId??t.id);const{cssStyles:i}=t;const o=Math.max(28,t.width??0);const a=[{x:0,y:o/2},{x:o/2,y:0},{x:0,y:-o/2},{x:-o/2,y:0}];const s=Pmn.default.svg(r);const l=$o(t,{});if(t.look!=="handDrawn"){l.roughness=0;l.fillStyle="solid"}const u=ql(a);const d=s.path(u,l);const f=r.insert(()=>d,":first-child");if(i&&t.look!=="handDrawn"){f.selectAll("path").attr("style",i)}if(n&&t.look!=="handDrawn"){f.selectAll("path").attr("style",n)}t.width=28;t.height=28;t.intersect=function(h){return Do.polygon(t,a,h)};return r}async function MKe(e,t,n){const{labelStyles:r,nodeStyles:i}=Ro(t);t.labelStyle=r;const{shapeSvg:o,bbox:a,halfPadding:s}=await Ya(e,t,za(t));const l=16;const u=n?.padding??s;const d=t.look==="neo"?a.width/2+l*2:a.width/2+u;let f;const{cssStyles:h}=t;if(t.look==="handDrawn"){const m=Mmn.default.svg(o);const g=$o(t,{});const x=m.circle(0,0,d*2,g);f=o.insert(()=>x,":first-child");f.attr("class","basic label-container").attr("style",Zh(h))}else{f=o.insert("circle",":first-child").attr("class","basic label-container").attr("style",i).attr("r",d).attr("cx",0).attr("cy",0)}Qo(t,f);t.calcIntersect=function(m,g){const x=m.width/2;return Do.circle(m,x,g)};t.intersect=function(m){wt.info("Circle intersect",t,d,m);return Do.circle(t,d,m)};return o}function Dmn(e){const t=Math.cos(Math.PI/4);const n=Math.sin(Math.PI/4);const r=e*2;const i={x:r/2*t,y:r/2*n};const o={x:-(r/2)*t,y:r/2*n};const a={x:-(r/2)*t,y:-(r/2)*n};const s={x:r/2*t,y:-(r/2)*n};return`M ${o.x},${o.y} L ${s.x},${s.y} + M ${i.x},${i.y} L ${a.x},${a.y}`}function Fmn(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);t.labelStyle=n;t.label="";const i=e.insert("g").attr("class",za(t)).attr("id",t.domId??t.id);const o=Math.max(30,t?.width??0);const{cssStyles:a}=t;const s=Lmn.default.svg(i);const l=$o(t,{});if(t.look!=="handDrawn"){l.roughness=0;l.fillStyle="solid"}const u=s.circle(0,0,o*2,l);const d=Dmn(o);const f=s.path(d,l);const h=i.insert(()=>u,":first-child");h.insert(()=>f);h.attr("class","outer-path");if(a&&t.look!=="handDrawn"){h.selectAll("path").attr("style",a)}if(r&&t.look!=="handDrawn"){h.selectAll("path").attr("style",r)}Qo(t,h);t.intersect=function(m){wt.info("crossedCircle intersect",t,{radius:o,point:m});const g=Do.circle(t,o,m);return g};return i}function ER(e,t,n,r=100,i=0,o=180){const a=[];const s=i*Math.PI/180;const l=o*Math.PI/180;const u=l-s;const d=u/(r-1);for(let f=0;fL,":first-child").attr("stroke-opacity",0);I.insert(()=>A,":first-child");I.attr("class","text");if(h&&t.look!=="handDrawn"){I.selectAll("path").attr("style",h)}if(r&&t.look!=="handDrawn"){I.selectAll("path").attr("style",r)}I.attr("transform",`translate(${f}, 0)`);a.attr("transform",`translate(${-u/2+f-(o.x-(o.left??0))},${-d/2+(t.padding??0)/2-(o.y-(o.top??0))})`);Qo(t,I);t.intersect=function(N){const O=Do.polygon(t,g,N);return O};return i}function CR(e,t,n,r=100,i=0,o=180){const a=[];const s=i*Math.PI/180;const l=o*Math.PI/180;const u=l-s;const d=u/(r-1);for(let f=0;fL,":first-child").attr("stroke-opacity",0);I.insert(()=>A,":first-child");I.attr("class","text");if(h&&t.look!=="handDrawn"){I.selectAll("path").attr("style",h)}if(r&&t.look!=="handDrawn"){I.selectAll("path").attr("style",r)}I.attr("transform",`translate(${-f}, 0)`);a.attr("transform",`translate(${-u/2+(t.padding??0)/2-(o.x-(o.left??0))},${-d/2+(t.padding??0)/2-(o.y-(o.top??0))})`);Qo(t,I);t.intersect=function(N){const O=Do.polygon(t,g,N);return O};return i}function Ag(e,t,n,r=100,i=0,o=180){const a=[];const s=i*Math.PI/180;const l=o*Math.PI/180;const u=l-s;const d=u/(r-1);for(let f=0;fz,":first-child").attr("stroke-opacity",0);U.insert(()=>P,":first-child");U.insert(()=>N,":first-child");U.attr("class","text");if(h&&t.look!=="handDrawn"){U.selectAll("path").attr("style",h)}if(r&&t.look!=="handDrawn"){U.selectAll("path").attr("style",r)}U.attr("transform",`translate(${f-f/4}, 0)`);a.attr("transform",`translate(${-u/2+(t.padding??0)/2-(o.x-(o.left??0))},${-d/2+(t.padding??0)/2-(o.y-(o.top??0))})`);Qo(t,U);t.intersect=function(W){const H=Do.polygon(t,x,W);return H};return i}async function Gmn(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);t.labelStyle=n;const i=t.padding??0;const o=t.look==="neo"?16:i;const a=t.look==="neo"?12:i;const s=20,l=5;const{shapeSvg:u,bbox:d}=await Ya(e,t,za(t));const f=Math.max(s,(d.width+o*2)*1.25,t?.width??0);const h=Math.max(l,d.height+a*2,t?.height??0);const m=h/2;const{cssStyles:g}=t;const x=$mn.default.svg(u);const w=$o(t,{});if(t.look!=="handDrawn"){w.roughness=0;w.fillStyle="solid"}const _=f,C=h;const A=_-m;const P=C/4;const L=[{x:A,y:0},{x:P,y:0},{x:0,y:C/2},{x:P,y:C},{x:A,y:C},...zee(-A,-C/2,m,50,270,90)];const I=ql(L);const N=x.path(I,w);const O=u.insert(()=>N,":first-child");O.attr("class","basic label-container outer-path");if(g&&t.look!=="handDrawn"){O.selectChildren("path").attr("style",g)}if(r&&t.look!=="handDrawn"){O.selectChildren("path").attr("style",r)}O.attr("transform",`translate(${-f/2}, ${-h/2})`);Qo(t,O);t.intersect=function(z){const U=Do.polygon(t,L,z);return U};return u}async function Wmn(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);t.labelStyle=n;const i=t.padding??0;const o=t.look==="neo"?24:i;const a=t.look==="neo"?24:i;if(t.width||t.height){const w=t.width??0;t.width=(t.width??0)-a;if(t.widthL,":first-child");g=s.insert(()=>P,":first-child");g.attr("class","basic label-container");if(x){g.attr("style",x)}}else{const w=Q_i(0,0,d,m,f,h);g=s.insert("path",":first-child").attr("d",w).attr("class","basic label-container outer-path").attr("style",Zh(x)).attr("style",r)}g.attr("label-offset-y",h);g.attr("transform",`translate(${-d/2}, ${-(m/2+h)})`);Qo(t,g);u.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+(t.padding??0)/1.5-(l.y-(l.top??0))})`);t.intersect=function(w){const _=Do.rect(t,w);const C=_.x-(t.x??0);if(f!=0&&(Math.abs(C)<(t.width??0)/2||Math.abs(C)==(t.width??0)/2&&Math.abs(_.y-(t.y??0))>(t.height??0)/2-h)){let A=h*h*(1-C*C/(f*f));if(A>0){A=Math.sqrt(A)}A=h-A;if(w.y-(t.y??0)>0){A=-A}_.y+=A}return _};return s}async function R$(e,t,n){const{labelStyles:r,nodeStyles:i}=Ro(t);t.labelStyle=r;const{shapeSvg:o,bbox:a}=await Ya(e,t,za(t));const s=Math.max(a.width+n.labelPaddingX*2,t?.width||0);const l=Math.max(a.height+n.labelPaddingY*2,t?.height||0);const u=-s/2;const d=-l/2;let f;let{rx:h,ry:m}=t;const{cssStyles:g}=t;if(n?.rx&&n.ry){h=n.rx;m=n.ry}if(t.look==="handDrawn"){const x=Ymn.default.svg(o);const w=$o(t,{});const _=h||m?x.path(TL(u,d,s,l,h||0),w):x.rectangle(u,d,s,l,w);f=o.insert(()=>_,":first-child");f.attr("class","basic label-container").attr("style",Zh(g))}else{f=o.insert("rect",":first-child");f.attr("class","basic label-container").attr("style",i).attr("rx",Zh(h)).attr("ry",Zh(m)).attr("x",u).attr("y",d).attr("width",s).attr("height",l)}Qo(t,f);t.calcIntersect=function(x,w){return Do.rect(x,w)};t.intersect=function(x){return Do.rect(t,x)};return o}async function Xmn(e,t){const{cssClasses:n,labelPaddingX:r,labelPaddingY:i,padding:o,width:a,height:s}=t;const l={rx:0,ry:0,classes:n??"",labelPaddingX:r??(o??0)*2,labelPaddingY:i??o??0};const u=await R$(e,t,l);if(t.look==="handDrawn"){const m=qmn.default.svg(u);const g=$o(t,{});const x=u.select(".basic.label-container > path:nth-child(2)");const w=x.node();if(!w){return u}let _=null;if(w instanceof SVGGraphicsElement){_=w.getBBox()}else{return u}u.insert(()=>m.line(_.x,_.y,_.x+_.width,_.y,g),".basic.label-container g.label");u.insert(()=>m.line(_.x,_.y+_.height,_.x+_.width,_.y+_.height,g),".basic.label-container g.label");x.remove();return u}const d=u.select(".basic.label-container");const f=(Number(d.attr("width"))||a)??0;const h=(Number(d.attr("height"))||s)??0;if(f>0&&h>0){d.attr("stroke-dasharray",`${f} ${h}`)}return u}async function Kmn(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);t.labelStyle=n;const i=t.look==="neo"?16:t.padding??0;const o=t.look==="neo"?16:t.padding??0;const{shapeSvg:a,bbox:s,label:l}=await Ya(e,t,za(t));const u=s.width+i;const d=s.height+o;const f=d*.2;const h=-u/2;const m=-d/2-f/2;const{cssStyles:g}=t;const x=jmn.default.svg(a);const w=$o(t,{});if(t.look!=="handDrawn"){w.roughness=0;w.fillStyle="solid"}const _=[{x:h,y:m+f},{x:-h,y:m+f},{x:-h,y:-m},{x:h,y:-m},{x:h,y:m},{x:-h,y:m},{x:-h,y:m+f}];const C=x.polygon(_.map(P=>[P.x,P.y]),w);const A=a.insert(()=>C,":first-child");A.attr("class","basic label-container outer-path");if(g&&t.look!=="handDrawn"){A.selectAll("path").attr("style",g)}if(r&&t.look!=="handDrawn"){A.selectAll("path").attr("style",r)}l.attr("transform",`translate(${h+(t.padding??0)/2-(s.x-(s.left??0))}, ${m+f+(t.padding??0)/2-(s.y-(s.top??0))})`);Qo(t,A);t.intersect=function(P){const L=Do.rect(t,P);return L};return a}async function Jmn(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);const i=t.look==="neo"?12:5;t.labelStyle=n;const o=t.padding??0;const a=t.look==="neo"?16:o;const{shapeSvg:s,bbox:l}=await Ya(e,t,za(t));const u=(t?.width?t?.width/2:l.width/2)+(a??0);const d=u-i;let f;const{cssStyles:h}=t;if(t.look==="handDrawn"){const m=Zmn.default.svg(s);const g=$o(t,{roughness:.2,strokeWidth:2.5});const x=$o(t,{roughness:.2,strokeWidth:1.5});const w=m.circle(0,0,u*2,g);const _=m.circle(0,0,d*2,x);f=s.insert("g",":first-child");f.attr("class",Zh(t.cssClasses)).attr("style",Zh(h));f.node()?.appendChild(w);f.node()?.appendChild(_)}else{f=s.insert("g",":first-child");const m=f.insert("circle",":first-child");const g=f.insert("circle");f.attr("class","basic label-container").attr("style",r);m.attr("class","outer-circle").attr("style",r).attr("r",u).attr("cx",0).attr("cy",0);g.attr("class","inner-circle").attr("style",r).attr("r",d).attr("cx",0).attr("cy",0)}Qo(t,f);t.intersect=function(m){wt.info("DoubleCircle intersect",t,u,m);return Do.circle(t,u,m)};return s}function egn(e,t,{config:{themeVariables:n}}){const{labelStyles:r,nodeStyles:i}=Ro(t);t.label="";t.labelStyle=r;const o=e.insert("g").attr("class",za(t)).attr("id",t.domId??t.id);const a=7;const{cssStyles:s}=t;const l=Qmn.default.svg(o);const{nodeBorder:u}=n;const d=$o(t,{fillStyle:"solid"});if(t.look!=="handDrawn"){d.roughness=0}const f=l.circle(0,0,a*2,d);const h=o.insert(()=>f,":first-child");h.selectAll("path").attr("style",`fill: ${u} !important;`);if(s&&s.length>0&&t.look!=="handDrawn"){h.selectAll("path").attr("style",s)}if(i&&t.look!=="handDrawn"){h.selectAll("path").attr("style",i)}Qo(t,h);t.intersect=function(m){wt.info("filledCircle intersect",t,{radius:a,point:m});const g=Do.circle(t,a,m);return g};return o}async function ngn(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);t.labelStyle=n;const i=t.padding??0;const o=t.look==="neo"?i*2:i;if(t.width||t.height){t.height=t?.height??0;if(t.height_,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`).attr("class","outer-path");if(m&&t.look!=="handDrawn"){C.selectChildren("path").attr("style",m)}if(r&&t.look!=="handDrawn"){C.selectChildren("path").attr("style",r)}t.width=u;t.height=d;Qo(t,C);l.attr("transform",`translate(${-s.width/2-(s.x-(s.left??0))}, ${-d/2+(t.padding??0)/2+(s.y-(s.top??0))})`);t.intersect=function(A){wt.info("Triangle intersect",t,h,A);return Do.polygon(t,h,A)};return a}function ign(e,t,{dir:n,config:{state:r,themeVariables:i}}){const{nodeStyles:o}=Ro(t);t.label="";const a=e.insert("g").attr("class",za(t)).attr("id",t.domId??t.id);const{cssStyles:s}=t;let l=Math.max(70,t?.width??0);let u=Math.max(10,t?.height??0);if(n==="LR"){l=Math.max(10,t?.width??0);u=Math.max(70,t?.height??0)}const d=-1*l/2;const f=-1*u/2;const h=rgn.default.svg(a);const m=$o(t,{stroke:i.lineColor,fill:i.lineColor});if(t.look!=="handDrawn"){m.roughness=0;m.fillStyle="solid"}const g=h.rectangle(d,f,l,u,m);const x=a.insert(()=>g,":first-child");if(s&&t.look!=="handDrawn"){x.selectAll("path").attr("style",s)}if(o&&t.look!=="handDrawn"){x.selectAll("path").attr("style",o)}Qo(t,x);const w=r?.padding??0;if(t.width&&t.height){t.width+=w/2||0;t.height+=w/2||0}t.intersect=function(_){return Do.rect(t,_)};return a}async function agn(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);t.labelStyle=n;const i=15,o=10;const a=t.look==="neo"?16:t.padding??0;const s=t.look==="neo"?12:t.padding??0;if(t.width||t.height){t.height=(t?.height??0)-s*2;if(t.heightC,":first-child");A.attr("class","basic label-container outer-path");if(m&&t.look!=="handDrawn"){A.selectChildren("path").attr("style",m)}if(r&&t.look!=="handDrawn"){A.selectChildren("path").attr("style",r)}Qo(t,A);t.intersect=function(P){wt.info("Pill intersect",t,{radius:h,point:P});const L=Do.polygon(t,w,P);return L};return l}async function lgn(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);const i=t.look==="neo"?3.5:4;t.labelStyle=n;const o=t.padding??0;const a=70;const s=32;const l=t.look==="neo"?a:o;const u=t.look==="neo"?s:o;if(t.width||t.height){const C=t.height??0;const A=C/i;t.width=(t?.width??0)-2*A-u;t.height=(t.height??0)-l}const{shapeSvg:d,bbox:f}=await Ya(e,t,za(t));const h=(t?.height?t?.height:f.height)+l;const m=h/i;const g=(t?.width?t?.width:f.width)+2*m+u;const x=[{x:m,y:0},{x:g-m,y:0},{x:g,y:-h/2},{x:g-m,y:-h},{x:m,y:-h},{x:0,y:-h/2}];let w;const{cssStyles:_}=t;if(t.look==="handDrawn"){const C=sgn.default.svg(d);const A=$o(t,{});const P=nTi(0,0,g,h,m);const L=C.path(P,A);w=d.insert(()=>L,":first-child").attr("transform",`translate(${-g/2}, ${h/2})`);if(_){w.attr("style",_)}}else{w=AR(d,g,h,x)}if(r){w.attr("style",r)}t.width=g;t.height=h;Qo(t,w);t.intersect=function(C){return Do.polygon(t,x,C)};return d}async function ugn(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);t.label="";t.labelStyle=n;const{shapeSvg:i}=await Ya(e,t,za(t));const o=Math.max(30,t?.width??0);const a=Math.max(30,t?.height??0);const{cssStyles:s}=t;const l=cgn.default.svg(i);const u=$o(t,{});if(t.look!=="handDrawn"){u.roughness=0;u.fillStyle="solid"}const d=[{x:0,y:0},{x:o,y:0},{x:0,y:a},{x:o,y:a}];const f=ql(d);const h=l.path(f,u);const m=i.insert(()=>h,":first-child");m.attr("class","basic label-container outer-path");if(s&&t.look!=="handDrawn"){m.selectChildren("path").attr("style",s)}if(r&&t.look!=="handDrawn"){m.selectChildren("path").attr("style",r)}m.attr("transform",`translate(${-o/2}, ${-a/2})`);Qo(t,m);t.intersect=function(g){wt.info("Pill intersect",t,{points:d});const x=Do.polygon(t,d,g);return x};return i}async function fgn(e,t,{config:{themeVariables:n,flowchart:r}}){const{labelStyles:i}=Ro(t);t.labelStyle=i;const o=t.assetHeight??48;const a=t.assetWidth??48;const s=Math.max(o,a);const l=r?.wrappingWidth;t.width=Math.max(s,l??0);const{shapeSvg:u,bbox:d,label:f}=await Ya(e,t,"icon-shape default");const h=t.pos==="t";const m=s;const g=s;const{nodeBorder:x}=n;const{stylesMap:w}=q5(t);const _=-g/2;const C=-m/2;const A=t.label?8:0;const P=dgn.default.svg(u);const L=$o(t,{stroke:"none",fill:"none"});if(t.look!=="handDrawn"){L.roughness=0;L.fillStyle="solid"}const I=P.rectangle(_,C,g,m,L);const N=Math.max(g,d.width);const O=m+d.height+A;const z=P.rectangle(-N/2,-O/2,N,O,{...L,fill:"transparent",stroke:"none"});const U=u.insert(()=>I,":first-child");const W=u.insert(()=>z);if(t.icon){const H=u.append("g");H.html(`${await nv(t.icon,{height:s,width:s,fallbackPrefix:""})}`);const $=H.node().getBBox();const K=$.width;const X=$.height;const j=$.x;const te=$.y;H.attr("transform",`translate(${-K/2-j},${h?d.height/2+A/2-X/2-te:-d.height/2-A/2-X/2-te})`);H.attr("style",`color: ${w.get("stroke")??x};`)}f.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${h?-O/2:O/2-d.height})`);U.attr("transform",`translate(${0},${h?d.height/2+A/2:-d.height/2-A/2})`);Qo(t,W);t.intersect=function(H){wt.info("iconSquare intersect",t,H);if(!t.label){return Do.rect(t,H)}const $=t.x??0;const K=t.y??0;const X=t.height??0;let j=[];if(h){j=[{x:$-d.width/2,y:K-X/2},{x:$+d.width/2,y:K-X/2},{x:$+d.width/2,y:K-X/2+d.height+A},{x:$+g/2,y:K-X/2+d.height+A},{x:$+g/2,y:K+X/2},{x:$-g/2,y:K+X/2},{x:$-g/2,y:K-X/2+d.height+A},{x:$-d.width/2,y:K-X/2+d.height+A}]}else{j=[{x:$-g/2,y:K-X/2},{x:$+g/2,y:K-X/2},{x:$+g/2,y:K-X/2+m},{x:$+d.width/2,y:K-X/2+m},{x:$+d.width/2/2,y:K+X/2},{x:$-d.width/2,y:K+X/2},{x:$-d.width/2,y:K-X/2+m},{x:$-g/2,y:K-X/2+m}]}const te=Do.polygon(t,j,H);return te};return u}async function pgn(e,t,{config:{themeVariables:n,flowchart:r}}){const{labelStyles:i}=Ro(t);t.labelStyle=i;const o=t.assetHeight??48;const a=t.assetWidth??48;const s=Math.max(o,a);const l=r?.wrappingWidth;t.width=Math.max(s,l??0);const{shapeSvg:u,bbox:d,label:f}=await Ya(e,t,"icon-shape default");const h=20;const m=t.label?8:0;const g=t.pos==="t";const{nodeBorder:x,mainBkg:w}=n;const{stylesMap:_}=q5(t);const C=hgn.default.svg(u);const A=$o(t,{});if(t.look!=="handDrawn"){A.roughness=0;A.fillStyle="solid"}const P=_.get("fill");A.stroke=P??w;const L=u.append("g");if(t.icon){L.html(`${await nv(t.icon,{height:s,width:s,fallbackPrefix:""})}`)}const I=L.node().getBBox();const N=I.width;const O=I.height;const z=I.x;const U=I.y;const W=Math.max(N,O)*Math.SQRT2+h*2;const H=C.circle(0,0,W,A);const $=Math.max(W,d.width);const K=W+d.height+m;const X=C.rectangle(-$/2,-K/2,$,K,{...A,fill:"transparent",stroke:"none"});const j=u.insert(()=>H,":first-child");const te=u.insert(()=>X);L.attr("transform",`translate(${-N/2-z},${g?d.height/2+m/2-O/2-U:-d.height/2-m/2-O/2-U})`);L.attr("style",`color: ${_.get("stroke")??x};`);f.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${g?-K/2:K/2-d.height})`);j.attr("transform",`translate(${0},${g?d.height/2+m/2:-d.height/2-m/2})`);Qo(t,te);t.intersect=function(J){wt.info("iconSquare intersect",t,J);const oe=Do.rect(t,J);return oe};return u}async function ggn(e,t,{config:{themeVariables:n,flowchart:r}}){const{labelStyles:i}=Ro(t);t.labelStyle=i;const o=t.assetHeight??48;const a=t.assetWidth??48;const s=Math.max(o,a);const l=r?.wrappingWidth;t.width=Math.max(s,l??0);const{shapeSvg:u,bbox:d,halfPadding:f,label:h}=await Ya(e,t,"icon-shape default");const m=t.pos==="t";const g=s+f*2;const x=s+f*2;const{nodeBorder:w,mainBkg:_}=n;const{stylesMap:C}=q5(t);const A=-x/2;const P=-g/2;const L=t.label?8:0;const I=mgn.default.svg(u);const N=$o(t,{});if(t.look!=="handDrawn"){N.roughness=0;N.fillStyle="solid"}const O=C.get("fill");N.stroke=O??_;const z=I.path(TL(A,P,x,g,5),N);const U=Math.max(x,d.width);const W=g+d.height+L;const H=I.rectangle(-U/2,-W/2,U,W,{...N,fill:"transparent",stroke:"none"});const $=u.insert(()=>z,":first-child").attr("class","icon-shape2");const K=u.insert(()=>H);if(t.icon){const X=u.append("g");X.html(`${await nv(t.icon,{height:s,width:s,fallbackPrefix:""})}`);const j=X.node().getBBox();const te=j.width;const J=j.height;const oe=j.x;const se=j.y;X.attr("transform",`translate(${-te/2-oe},${m?d.height/2+L/2-J/2-se:-d.height/2-L/2-J/2-se})`);X.attr("style",`color: ${C.get("stroke")??w};`)}h.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${m?-W/2:W/2-d.height})`);$.attr("transform",`translate(${0},${m?d.height/2+L/2:-d.height/2-L/2})`);Qo(t,K);t.intersect=function(X){wt.info("iconSquare intersect",t,X);if(!t.label){return Do.rect(t,X)}const j=t.x??0;const te=t.y??0;const J=t.height??0;let oe=[];if(m){oe=[{x:j-d.width/2,y:te-J/2},{x:j+d.width/2,y:te-J/2},{x:j+d.width/2,y:te-J/2+d.height+L},{x:j+x/2,y:te-J/2+d.height+L},{x:j+x/2,y:te+J/2},{x:j-x/2,y:te+J/2},{x:j-x/2,y:te-J/2+d.height+L},{x:j-d.width/2,y:te-J/2+d.height+L}]}else{oe=[{x:j-x/2,y:te-J/2},{x:j+x/2,y:te-J/2},{x:j+x/2,y:te-J/2+g},{x:j+d.width/2,y:te-J/2+g},{x:j+d.width/2/2,y:te+J/2},{x:j-d.width/2,y:te+J/2},{x:j-d.width/2,y:te-J/2+g},{x:j-x/2,y:te-J/2+g}]}const se=Do.polygon(t,oe,X);return se};return u}async function bgn(e,t,{config:{themeVariables:n,flowchart:r}}){const{labelStyles:i}=Ro(t);t.labelStyle=i;const o=t.assetHeight??48;const a=t.assetWidth??48;const s=Math.max(o,a);const l=r?.wrappingWidth;t.width=Math.max(s,l??0);const{shapeSvg:u,bbox:d,halfPadding:f,label:h}=await Ya(e,t,"icon-shape default");const m=t.pos==="t";const g=s+f*2;const x=s+f*2;const{nodeBorder:w,mainBkg:_}=n;const{stylesMap:C}=q5(t);const A=-x/2;const P=-g/2;const L=t.label?8:0;const I=ygn.default.svg(u);const N=$o(t,{});if(t.look!=="handDrawn"){N.roughness=0;N.fillStyle="solid"}const O=C.get("fill");N.stroke=O??_;const z=I.path(TL(A,P,x,g,.1),N);const U=Math.max(x,d.width);const W=g+d.height+L;const H=I.rectangle(-U/2,-W/2,U,W,{...N,fill:"transparent",stroke:"none"});const $=u.insert(()=>z,":first-child");const K=u.insert(()=>H);if(t.icon){const X=u.append("g");X.html(`${await nv(t.icon,{height:s,width:s,fallbackPrefix:""})}`);const j=X.node().getBBox();const te=j.width;const J=j.height;const oe=j.x;const se=j.y;X.attr("transform",`translate(${-te/2-oe},${m?d.height/2+L/2-J/2-se:-d.height/2-L/2-J/2-se})`);X.attr("style",`color: ${C.get("stroke")??w};`)}h.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${m?-W/2:W/2-d.height})`);$.attr("transform",`translate(${0},${m?d.height/2+L/2:-d.height/2-L/2})`);Qo(t,K);t.intersect=function(X){wt.info("iconSquare intersect",t,X);if(!t.label){return Do.rect(t,X)}const j=t.x??0;const te=t.y??0;const J=t.height??0;let oe=[];if(m){oe=[{x:j-d.width/2,y:te-J/2},{x:j+d.width/2,y:te-J/2},{x:j+d.width/2,y:te-J/2+d.height+L},{x:j+x/2,y:te-J/2+d.height+L},{x:j+x/2,y:te+J/2},{x:j-x/2,y:te+J/2},{x:j-x/2,y:te-J/2+d.height+L},{x:j-d.width/2,y:te-J/2+d.height+L}]}else{oe=[{x:j-x/2,y:te-J/2},{x:j+x/2,y:te-J/2},{x:j+x/2,y:te-J/2+g},{x:j+d.width/2,y:te-J/2+g},{x:j+d.width/2/2,y:te+J/2},{x:j-d.width/2,y:te+J/2},{x:j-d.width/2,y:te-J/2+g},{x:j-x/2,y:te-J/2+g}]}const se=Do.polygon(t,oe,X);return se};return u}async function vgn(e,t,{config:{flowchart:n}}){const r=new Image;r.src=t?.img??"";await r.decode();const i=Number(r.naturalWidth.toString().replace("px",""));const o=Number(r.naturalHeight.toString().replace("px",""));t.imageAspectRatio=i/o;const{labelStyles:a}=Ro(t);t.labelStyle=a;const s=n?.wrappingWidth;t.defaultWidth=n?.wrappingWidth;const l=Math.max(t.label?s??0:0,t?.assetWidth??i);const u=t.constraint==="on"?t?.assetHeight?t.assetHeight*t.imageAspectRatio:l:l;const d=t.constraint==="on"?u/t.imageAspectRatio:t?.assetHeight??o;t.width=Math.max(u,s??0);const{shapeSvg:f,bbox:h,label:m}=await Ya(e,t,"image-shape default");const g=t.pos==="t";const x=-u/2;const w=-d/2;const _=t.label?8:0;const C=xgn.default.svg(f);const A=$o(t,{});if(t.look!=="handDrawn"){A.roughness=0;A.fillStyle="solid"}const P=C.rectangle(x,w,u,d,A);const L=Math.max(u,h.width);const I=d+h.height+_;const N=C.rectangle(-L/2,-I/2,L,I,{...A,fill:"none",stroke:"none"});const O=f.insert(()=>P,":first-child");const z=f.insert(()=>N);if(t.img){const U=f.append("image");U.attr("href",t.img);U.attr("width",u);U.attr("height",d);U.attr("preserveAspectRatio","none");U.attr("transform",`translate(${-u/2},${g?I/2-d:-I/2})`)}m.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${g?-d/2-h.height/2-_/2:d/2-h.height/2+_/2})`);O.attr("transform",`translate(${0},${g?h.height/2+_/2:-h.height/2-_/2})`);Qo(t,z);t.intersect=function(U){wt.info("iconSquare intersect",t,U);if(!t.label){return Do.rect(t,U)}const W=t.x??0;const H=t.y??0;const $=t.height??0;let K=[];if(g){K=[{x:W-h.width/2,y:H-$/2},{x:W+h.width/2,y:H-$/2},{x:W+h.width/2,y:H-$/2+h.height+_},{x:W+u/2,y:H-$/2+h.height+_},{x:W+u/2,y:H+$/2},{x:W-u/2,y:H+$/2},{x:W-u/2,y:H-$/2+h.height+_},{x:W-h.width/2,y:H-$/2+h.height+_}]}else{K=[{x:W-u/2,y:H-$/2},{x:W+u/2,y:H-$/2},{x:W+u/2,y:H-$/2+d},{x:W+h.width/2,y:H-$/2+d},{x:W+h.width/2/2,y:H+$/2},{x:W-h.width/2,y:H+$/2},{x:W-h.width/2,y:H-$/2+d},{x:W-u/2,y:H-$/2+d}]}const X=Do.polygon(t,K,U);return X};return f}async function Tgn(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);t.labelStyle=n;const i=t.padding??0;const o=i;const a=t.look==="neo"?i*2:i;const{shapeSvg:s,bbox:l}=await Ya(e,t,za(t));const u=Math.max(l.width+(a??0)*2,t?.width??0);const d=Math.max(l.height+(o??0)*2,t?.height??0);const f=[{x:0,y:0},{x:u,y:0},{x:u+3*d/6,y:-d},{x:-3*d/6,y:-d}];let h;const{cssStyles:m}=t;if(t.look==="handDrawn"){const g=_gn.default.svg(s);const x=$o(t,{});const w=ql(f);const _=g.path(w,x);h=s.insert(()=>_,":first-child").attr("transform",`translate(${-u/2}, ${d/2})`);if(m){h.attr("style",m)}}else{h=AR(s,u,d,f)}if(r){h.attr("style",r)}t.width=u;t.height=d;Qo(t,h);t.intersect=function(g){return Do.polygon(t,f,g)};return s}async function wgn(e,t){const{shapeSvg:n,bbox:r,label:i}=await Ya(e,t,"label");const o=n.insert("rect",":first-child");const a=.1;const s=.1;o.attr("width",a).attr("height",s);n.attr("class","label edgeLabel");i.attr("transform",`translate(${-(r.width/2)-(r.x-(r.left??0))}, ${-(r.height/2)-(r.y-(r.top??0))})`);Qo(t,o);t.intersect=function(l){return Do.rect(t,l)};return n}async function Cgn(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);t.labelStyle=n;const i=t.padding??0;const o=i;const a=t.look==="neo"?i*2:i;const{shapeSvg:s,bbox:l}=await Ya(e,t,za(t));const u=(t?.height??l.height)+o;const d=(t?.width??l.width)+a;const f=[{x:0,y:0},{x:d+3*u/6,y:0},{x:d,y:-u},{x:-(3*u)/6,y:-u}];let h;const{cssStyles:m}=t;if(t.look==="handDrawn"){const g=Egn.default.svg(s);const x=$o(t,{});const w=ql(f);const _=g.path(w,x);h=s.insert(()=>_,":first-child").attr("transform",`translate(${-d/2}, ${u/2})`);if(m){h.attr("style",m)}}else{h=AR(s,d,u,f)}if(r){h.attr("style",r)}t.width=d;t.height=u;Qo(t,h);t.intersect=function(g){return Do.polygon(t,f,g)};return s}async function Agn(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);t.labelStyle=n;const i=t.padding??0;const o=i;const a=t.look==="neo"?i*2:i;const{shapeSvg:s,bbox:l}=await Ya(e,t,za(t));const u=(t?.height??l.height)+o;const d=(t?.width??l.width)+a;const f=[{x:-3*u/6,y:0},{x:d,y:0},{x:d+3*u/6,y:-u},{x:0,y:-u}];let h;const{cssStyles:m}=t;if(t.look==="handDrawn"){const g=Sgn.default.svg(s);const x=$o(t,{});const w=ql(f);const _=g.path(w,x);h=s.insert(()=>_,":first-child").attr("transform",`translate(${-d/2}, ${u/2})`);if(m){h.attr("style",m)}}else{h=AR(s,d,u,f)}if(r){h.attr("style",r)}t.width=d;t.height=u;Qo(t,h);t.intersect=function(g){return Do.polygon(t,f,g)};return s}function Rgn(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);t.label="";t.labelStyle=n;const i=e.insert("g").attr("class",za(t)).attr("id",t.domId??t.id);const{cssStyles:o}=t;const a=Math.max(35,t?.width??0);const s=Math.max(35,t?.height??0);const l=7;const u=[{x:a,y:0},{x:0,y:s+l/2},{x:a-2*l,y:s+l/2},{x:0,y:2*s},{x:a,y:s-l/2},{x:2*l,y:s-l/2}];const d=kgn.default.svg(i);const f=$o(t,{});if(t.look!=="handDrawn"){f.roughness=0;f.fillStyle="solid"}const h=ql(u);const m=d.path(h,f);const g=i.insert(()=>m,":first-child");g.attr("class","outer-path");if(o&&t.look!=="handDrawn"){g.selectAll("path").attr("style",o)}if(r&&t.look!=="handDrawn"){g.selectAll("path").attr("style",r)}g.attr("transform",`translate(-${a/2},${-s})`);Qo(t,g);t.intersect=function(x){wt.info("lightningBolt intersect",t,x);const w=Do.polygon(t,u,x);return w};return i}async function Ign(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);t.labelStyle=n;const i=t.padding??0;const o=t.look==="neo"?16:i;const a=t.look==="neo"?24:i;if(t.width||t.height){const _=t.width??0;t.width=(t.width??0)-o;if(t.widthI,":first-child");N.attr("class","line");x=s.insert(()=>L,":first-child");x.attr("class","basic label-container");if(w){x.attr("style",w)}}else{const _=rTi(0,0,d,m,f,h,g);x=s.insert("path",":first-child").attr("d",_).attr("class","basic label-container outer-path").attr("style",Zh(w)).attr("style",r)}x.attr("label-offset-y",h);x.attr("transform",`translate(${-d/2}, ${-(m/2+h)})`);Qo(t,x);u.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+h-(l.y-(l.top??0))})`);t.intersect=function(_){const C=Do.rect(t,_);const A=C.x-(t.x??0);if(f!=0&&(Math.abs(A)<(t.width??0)/2||Math.abs(A)==(t.width??0)/2&&Math.abs(C.y-(t.y??0))>(t.height??0)/2-h)){let P=h*h*(1-A*A/(f*f));if(P>0){P=Math.sqrt(P)}P=h-P;if(_.y-(t.y??0)>0){P=-P}C.y+=P}return C};return s}async function Lgn(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);t.labelStyle=n;const i=t.padding??0;const o=t.look==="neo"?16:i;const a=t.look==="neo"?12:i;if(t.width||t.height){const P=t.width;t.width=(P??0)*10/11-o*2;if(t.width<10){t.width=10}t.height=(t?.height??0)-a*2;if(t.height<10){t.height=10}}const{shapeSvg:s,bbox:l,label:u}=await Ya(e,t,za(t));const d=(t?.width?t?.width:l.width)+(o??0)*2;const f=(t?.height?t?.height:l.height)+(a??0)*2;const h=t.look==="neo"?f/4:f/8;const m=f+h;const{cssStyles:g}=t;const x=Mgn.default.svg(s);const w=$o(t,{});if(t.look!=="handDrawn"){w.roughness=0;w.fillStyle="solid"}const _=[{x:-d/2-d/2*.1,y:-m/2},{x:-d/2-d/2*.1,y:m/2},..._L(-d/2-d/2*.1,m/2,d/2+d/2*.1,m/2,h,.8),{x:d/2+d/2*.1,y:-m/2},{x:-d/2-d/2*.1,y:-m/2},{x:-d/2,y:-m/2},{x:-d/2,y:m/2*1.1},{x:-d/2,y:-m/2}];const C=x.polygon(_.map(P=>[P.x,P.y]),w);const A=s.insert(()=>C,":first-child");A.attr("class","basic label-container outer-path");if(g&&t.look!=="handDrawn"){A.selectAll("path").attr("style",g)}if(r&&t.look!=="handDrawn"){A.selectAll("path").attr("style",r)}A.attr("transform",`translate(0,${-h/2})`);u.attr("transform",`translate(${-d/2+(t.padding??0)+d/2*.1/2-(l.x-(l.left??0))},${-f/2+(t.padding??0)-h/2-(l.y-(l.top??0))})`);Qo(t,A);t.intersect=function(P){const L=Do.polygon(t,_,P);return L};return s}async function Fgn(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);t.labelStyle=n;const i=t.padding??0;const o=t.look==="neo"?16:i;const a=t.look==="neo"?12:i;const s=t.look==="neo"?10:5;if(t.width||t.height){t.width=Math.max((t?.width??0)-o*2-2*s,10);t.height=Math.max((t?.height??0)-a*2-2*s,10)}const{shapeSvg:l,bbox:u,label:d}=await Ya(e,t,za(t));const f=(t?.width?t?.width:u.width)+o*2+2*s;const h=(t?.height?t?.height:u.height)+a*2+2*s;const m=f-2*s;const g=h-2*s;const x=-m/2;const w=-g/2;const{cssStyles:_}=t;const C=Dgn.default.svg(l);const A=$o(t,{});const P=[{x:x-s,y:w+s},{x:x-s,y:w+g+s},{x:x+m-s,y:w+g+s},{x:x+m-s,y:w+g},{x:x+m,y:w+g},{x:x+m,y:w+g-s},{x:x+m+s,y:w+g-s},{x:x+m+s,y:w-s},{x:x+s,y:w-s},{x:x+s,y:w},{x,y:w},{x,y:w+s}];const L=[{x,y:w+s},{x:x+m-s,y:w+s},{x:x+m-s,y:w+g},{x:x+m,y:w+g},{x:x+m,y:w},{x,y:w}];if(t.look!=="handDrawn"){A.roughness=0;A.fillStyle="solid"}const I=ql(P);let N=C.path(I,A);const O=ql(L);let z=C.path(O,A);if(t.look!=="handDrawn"){N=kKe(N);z=kKe(z)}const U=l.insert("g",":first-child");U.insert(()=>N);U.insert(()=>z);U.attr("class","basic label-container outer-path");if(_&&t.look!=="handDrawn"){U.selectAll("path").attr("style",_)}if(r&&t.look!=="handDrawn"){U.selectAll("path").attr("style",r)}d.attr("transform",`translate(${-(u.width/2)-s-(u.x-(u.left??0))}, ${-(u.height/2)+s-(u.y-(u.top??0))})`);Qo(t,U);t.intersect=function(W){const H=Do.polygon(t,P,W);return H};return l}async function Ogn(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);t.labelStyle=n;const{shapeSvg:i,bbox:o,label:a}=await Ya(e,t,za(t));const s=t.padding??0;const l=t.look==="neo"?16:s;const u=t.look==="neo"?12:s;let d=true;if(t.width||t.height){d=false;t.width=(t?.width??0)-l*2;t.height=(t?.height??0)-u*3}const f=Math.max(o.width,t?.width??0)+l*2;const h=Math.max(o.height,t?.height??0)+u*3;const m=t.look==="neo"?h/4:h/8;const g=h+(d?m/2:-m/2);const x=-f/2;const w=-g/2;const _=10;const{cssStyles:C}=t;const A=_L(x-_,w+g+_,x+f-_,w+g+_,m,.8);const P=A?.[A.length-1];const L=[{x:x-_,y:w+_},{x:x-_,y:w+g+_},...A,{x:x+f-_,y:P.y-_},{x:x+f,y:P.y-_},{x:x+f,y:P.y-2*_},{x:x+f+_,y:P.y-2*_},{x:x+f+_,y:w-_},{x:x+_,y:w-_},{x:x+_,y:w},{x,y:w},{x,y:w+_}];const I=[{x,y:w+_},{x:x+f-_,y:w+_},{x:x+f-_,y:P.y-_},{x:x+f,y:P.y-_},{x:x+f,y:w},{x,y:w}];const N=Ngn.default.svg(i);const O=$o(t,{});if(t.look!=="handDrawn"){O.roughness=0;O.fillStyle="solid"}const z=ql(L);const U=N.path(z,O);const W=ql(I);const H=N.path(W,O);const $=i.insert(()=>U,":first-child");$.insert(()=>H);$.attr("class","basic label-container outer-path");if(C&&t.look!=="handDrawn"){$.selectAll("path").attr("style",C)}if(r&&t.look!=="handDrawn"){$.selectAll("path").attr("style",r)}$.attr("transform",`translate(0,${-m/2})`);a.attr("transform",`translate(${-(o.width/2)-_-(o.x-(o.left??0))}, ${-(o.height/2)+_-m/2-(o.y-(o.top??0))})`);Qo(t,$);t.intersect=function(K){const X=Do.polygon(t,L,K);return X};return i}async function zgn(e,t,{config:{themeVariables:n}}){const{labelStyles:r,nodeStyles:i}=Ro(t);t.labelStyle=r;const o=t.useHtmlLabels||oc(Ji());if(!o){t.centerLabel=true}const{shapeSvg:a,bbox:s,label:l}=await Ya(e,t,za(t));const u=Math.max(s.width+(t.padding??0)*2,t?.width??0);const d=Math.max(s.height+(t.padding??0)*2,t?.height??0);const f=-u/2;const h=-d/2;const{cssStyles:m}=t;const g=Bgn.default.svg(a);const x=$o(t,{fill:n.noteBkgColor,stroke:n.noteBorderColor});if(t.look!=="handDrawn"){x.roughness=0;x.fillStyle="solid"}const w=g.rectangle(f,h,u,d,x);const _=a.insert(()=>w,":first-child");_.attr("class","basic label-container outer-path");l.attr("class","label noteLabel");if(m&&t.look!=="handDrawn"){_.selectAll("path").attr("style",m)}if(i&&t.look!=="handDrawn"){_.selectAll("path").attr("style",i)}l.attr("transform",`translate(${-s.width/2-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`);Qo(t,_);t.intersect=function(C){return Do.rect(t,C)};return a}async function Vgn(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);t.labelStyle=n;const{shapeSvg:i,bbox:o}=await Ya(e,t,za(t));const a=o.width+(t.padding??0);const s=o.height+(t.padding??0);const l=a+s;const u=.5;const d=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}];let f;const{cssStyles:h}=t;if(t.look==="handDrawn"){const m=Ugn.default.svg(i);const g=$o(t,{});const x=aTi(0,0,l);const w=m.path(x,g);f=i.insert(()=>w,":first-child").attr("transform",`translate(${-l/2+u}, ${l/2})`);if(h){f.attr("style",h)}}else{f=AR(i,l,l,d);f.attr("transform",`translate(${-l/2+u}, ${l/2})`)}if(r){f.attr("style",r)}Qo(t,f);t.calcIntersect=function(m,g){const x=m.width;const w=[{x:x/2,y:0},{x,y:-x/2},{x:x/2,y:-x},{x:0,y:-x/2}];const _=Do.polygon(m,w,g);return{x:_.x-.5,y:_.y-.5}};t.intersect=function(m){return this.calcIntersect(t,m)};return i}async function Ggn(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);t.labelStyle=n;const i=t.padding??0;const o=t.look==="neo"?21:i??0;const a=t.look==="neo"?12:i??0;const{shapeSvg:s,bbox:l,label:u}=await Ya(e,t,za(t));const d=(t?.width??l.width)+(t.look==="neo"?o*2:o);const f=(t?.height??l.height)+(t.look==="neo"?a*2:a);const h=-d/2;const m=-f/2;const g=m/2;const x=[{x:h+g,y:m},{x:h,y:0},{x:h+g,y:-m},{x:-h,y:-m},{x:-h,y:m}];const{cssStyles:w}=t;const _=$gn.default.svg(s);const C=$o(t,{});if(t.look!=="handDrawn"){C.roughness=0;C.fillStyle="solid"}const A=ql(x);const P=_.path(A,C);const L=s.insert(()=>P,":first-child");L.attr("class","basic label-container outer-path");if(w&&t.look!=="handDrawn"){L.selectAll("path").attr("style",w)}if(r&&t.look!=="handDrawn"){L.selectAll("path").attr("style",r)}L.attr("transform",`translate(${-g/2},0)`);u.attr("transform",`translate(${-g/2-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`);Qo(t,L);t.intersect=function(I){return Do.polygon(t,x,I)};return s}async function Wgn(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);t.labelStyle=n;let i;if(!t.cssClasses){i="node default"}else{i="node "+t.cssClasses}const o=e.insert("g").attr("class",i).attr("id",t.domId||t.id);const a=o.insert("g");const s=o.insert("g").attr("class","label").attr("style",r);const l=t.description;const u=t.label;const d=await SR(s,u,t.labelStyle,true,true);let f={width:0,height:0};if(oc(Mn())){const O=d.children[0];const z=zr(d);f=O.getBoundingClientRect();z.attr("width",f.width);z.attr("height",f.height)}wt.info("Text 2",l);const h=l||[];const m=d.getBBox();const g=await SR(s,Array.isArray(h)?h.join("
    "):h,t.labelStyle,true,true);const x=g.children[0];const w=zr(g);f=x.getBoundingClientRect();w.attr("width",f.width);w.attr("height",f.height);const _=(t.padding||0)/2;zr(g).attr("transform","translate( "+(f.width>m.width?0:(m.width-f.width)/2)+", "+(m.height+_+5)+")");zr(d).attr("transform","translate( "+(f.width{wt.debug("Rough node insert CXC",U);return W},":first-child");I=o.insert(()=>{wt.debug("Rough node insert CXC",U);return U},":first-child")}else{I=a.insert("rect",":first-child");N=a.insert("line");I.attr("class","outer title-state").attr("style",r).attr("x",-f.width/2-_).attr("y",-f.height/2-_).attr("width",f.width+(t.padding||0)).attr("height",f.height+(t.padding||0));N.attr("class","divider").attr("x1",-f.width/2-_).attr("x2",f.width/2+_).attr("y1",-f.height/2-_+m.height+_).attr("y2",-f.height/2-_+m.height+_)}Qo(t,I);t.intersect=function(O){return Do.rect(t,O)};return o}async function Ygn(e,t,{config:{themeVariables:n}}){const r=n?.radius??5;const i={rx:r,ry:r,classes:"",labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1};return R$(e,t,i)}async function Xgn(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);t.labelStyle=n;const i=t.look==="neo"?16:t.padding??0;const o=t.look==="neo"?12:t.padding??0;const{shapeSvg:a,bbox:s,label:l}=await Ya(e,t,za(t));const u=(t?.width??s.width)+i*2+(t.look==="neo"?Q5:Q5*2);const d=(t?.height??s.height)+o*2;const f=u-Q5;const h=d;const m=Q5-u/2;const g=-d/2;const{cssStyles:x}=t;const w=qgn.default.svg(a);const _=$o(t,{});if(t.look!=="handDrawn"){_.roughness=0;_.fillStyle="solid"}const C=[{x:m,y:g},{x:m+f,y:g},{x:m+f,y:g+h},{x:m-Q5,y:g+h},{x:m-Q5,y:g},{x:m,y:g},{x:m,y:g+h}];const A=w.polygon(C.map(L=>[L.x,L.y]),_);const P=a.insert(()=>A,":first-child");P.attr("class","basic label-container outer-path").attr("style",Zh(x));if(r&&t.look!=="handDrawn"){P.selectAll("path").attr("style",r)}if(x&&t.look!=="handDrawn"){P.selectAll("path").attr("style",r)}l.attr("transform",`translate(${Q5/2-s.width/2-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`);Qo(t,P);t.intersect=function(L){return Do.rect(t,L)};return a}async function Kgn(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);t.labelStyle=n;const i=t.padding??0;const o=t.look==="neo"?16:i;const a=t.look==="neo"?12:i;if(t.width||t.height){t.width=Math.max((t?.width??0)-o*2,10);t.height=Math.max((t?.height??0)/1.5-a*2,10)}const{shapeSvg:s,bbox:l,label:u}=await Ya(e,t,za(t));const d=(t?.width?t?.width:l.width)+o*2;const f=((t?.height?t?.height:l.height)+a*2)*1.5;const h=d;const m=f/1.5;const g=-h/2;const x=-m/2;const{cssStyles:w}=t;const _=jgn.default.svg(s);const C=$o(t,{});if(t.look!=="handDrawn"){C.roughness=0;C.fillStyle="solid"}const A=[{x:g,y:x},{x:g,y:x+m},{x:g+h,y:x+m},{x:g+h,y:x-m/2}];const P=ql(A);const L=_.path(P,C);const I=s.insert(()=>L,":first-child");I.attr("class","basic label-container outer-path");if(w&&t.look!=="handDrawn"){I.selectChildren("path").attr("style",w)}if(r&&t.look!=="handDrawn"){I.selectChildren("path").attr("style",r)}I.attr("transform",`translate(0, ${m/4})`);u.attr("transform",`translate(${-h/2+(t.padding??0)-(l.x-(l.left??0))}, ${-m/4+(t.padding??0)-(l.y-(l.top??0))})`);Qo(t,I);t.intersect=function(N){const O=Do.polygon(t,A,N);return O};return s}async function Zgn(e,t){const n=t.padding??0;const r=t.look==="neo"?16:n*2;const i=t.look==="neo"?12:n;const o={rx:0,ry:0,classes:"",labelPaddingX:t.labelPaddingX??r,labelPaddingY:i};return R$(e,t,o)}async function Qgn(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);t.labelStyle=n;const i=t.padding??0;const o=t.look==="neo"?20:i;const a=t.look==="neo"?12:i;const{shapeSvg:s,bbox:l}=await Ya(e,t,za(t));const u=l.height+(t.look==="neo"?a*2:a);const d=l.width+u/4+(t.look==="neo"?o*2:o);const f=u/2;const{cssStyles:h}=t;const m=Jgn.default.svg(s);const g=$o(t,{});if(t.look!=="handDrawn"){g.roughness=0;g.fillStyle="solid"}const x=[{x:-d/2+f,y:-u/2},{x:d/2-f,y:-u/2},...zee(-d/2+f,0,f,50,90,270),{x:d/2-f,y:u/2},...zee(d/2-f,0,f,50,270,450)];const w=ql(x);const _=m.path(w,g);const C=s.insert(()=>_,":first-child");C.attr("class","basic label-container outer-path");if(h&&t.look!=="handDrawn"){C.selectChildren("path").attr("style",h)}if(r&&t.look!=="handDrawn"){C.selectChildren("path").attr("style",r)}Qo(t,C);t.intersect=function(A){const P=Do.polygon(t,x,A);return P};return s}async function eyn(e,t){const n={rx:t.look==="neo"?3:5,ry:t.look==="neo"?3:5,classes:"flowchart-node"};return R$(e,t,n)}function nyn(e,t,{config:{themeVariables:n}}){const{labelStyles:r,nodeStyles:i}=Ro(t);t.labelStyle=r;const{cssStyles:o}=t;const{lineColor:a,stateBorder:s,nodeBorder:l,nodeShadow:u}=n;if(t.width||t.height){if((t.width??0)<14){t.width=14}if((t.height??0)<14){t.height=14}}if(!t.width){t.width=14}if(!t.height){t.height=14}const d=e.insert("g").attr("class","node default").attr("id",t.domId??t.id);const f=tyn.default.svg(d);const h=$o(t,{});if(t.look!=="handDrawn"){h.roughness=0;h.fillStyle="solid"}const m=f.circle(0,0,t.width,{...h,stroke:a,strokeWidth:2});const g=s??l;const x=(t.width??0)*5/14;const w=f.circle(0,0,x,{...h,fill:g,stroke:g,strokeWidth:2,fillStyle:"solid"});const _=d.insert(()=>m,":first-child");_.insert(()=>w);if(t.look!=="handDrawn"){_.attr("class","outer-path")}if(o){_.selectAll("path").attr("style",o)}if(i){_.selectAll("path").attr("style",i)}if(t.width<25&&u&&t.look!=="handDrawn"){const C=e.node()?.ownerSVGElement?.id??"";const A=C?`${C}-drop-shadow-small`:"drop-shadow-small";_.attr("style",`filter:url(#${A})`)}Qo(t,_);t.intersect=function(C){return Do.circle(t,(t.width??0)/2,C)};return d}function iyn(e,t,{config:{themeVariables:n}}){const{lineColor:r,nodeShadow:i}=n;if(t.width||t.height){if((t.width??0)<14){t.width=14}if((t.height??0)<14){t.height=14}}if(!t.width){t.width=14}if(!t.height){t.height=14}const o=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let a;if(t.look==="handDrawn"){const s=ryn.default.svg(o);const l=s.circle(0,0,t.width,thn(r));a=o.insert(()=>l);a.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14)}else{a=o.insert("circle",":first-child");a.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14)}if(t.width<25&&i&&t.look!=="handDrawn"){const s=e.node()?.ownerSVGElement?.id??"";const l=s?`${s}-drop-shadow-small`:"drop-shadow-small";a.attr("style",`filter:url(#${l})`)}Qo(t,a);t.intersect=function(s){return Do.circle(t,(t.width??7)/2,s)};return o}async function ayn(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);t.labelStyle=n;const i=t?.padding??8;const o=t.look==="neo"?28:i;const a=t.look==="neo"?12:i;const{shapeSvg:s,bbox:l}=await Ya(e,t,za(t));const u=(t?.width??l.width)+2*S$+o;const d=(t?.height??l.height)+a;const f=u-2*S$;const h=d;const m=-u/2;const g=-d/2;const x=[{x:0,y:0},{x:f,y:0},{x:f,y:-h},{x:0,y:-h},{x:0,y:0},{x:-8,y:0},{x:f+8,y:0},{x:f+8,y:-h},{x:-8,y:-h},{x:-8,y:0}];if(t.look==="handDrawn"){const w=oyn.default.svg(s);const _=$o(t,{});const C=w.rectangle(m,g,f+16,h,_);const A=w.line(m+S$,g,m+S$,g+h,_);const P=w.line(m+S$+f,g,m+S$+f,g+h,_);s.insert(()=>A,":first-child");s.insert(()=>P,":first-child");const L=s.insert(()=>C,":first-child");const{cssStyles:I}=t;L.attr("class","basic label-container").attr("style",Zh(I));Qo(t,L)}else{const w=AR(s,f,h,x);if(r){w.attr("style",r)}Qo(t,w)}t.intersect=function(w){return Do.polygon(t,x,w)};return s}async function lyn(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);t.labelStyle=n;const i=t.padding??0;const o=t.look==="neo"?16:i;const a=t.look==="neo"?12:i;if(t.width||t.height){t.height=Math.max((t?.height??0)-a*2,10);t.width=Math.max((t?.width??0)-o*2-AKe*(t.height+a*2),10)}const{shapeSvg:s,bbox:l}=await Ya(e,t,za(t));const u=(t?.height?t?.height:l.height)+a*2;const d=AKe*u;const f=AKe*u;const h=(t?.width?t?.width:l.width)+o*2+d;const m=h-d;const g=u;const x=-m/2;const w=-g/2;const{cssStyles:_}=t;const C=syn.default.svg(s);const A=$o(t,{});const P=[{x:x-d/2,y:w},{x:x+m+d/2,y:w},{x:x+m+d/2,y:w+g},{x:x-d/2,y:w+g}];const L=[{x:x+m-d/2,y:w+g},{x:x+m+d/2,y:w+g},{x:x+m+d/2,y:w+g-f}];if(t.look!=="handDrawn"){A.roughness=0;A.fillStyle="solid"}const I=ql(P);const N=C.path(I,A);const O=ql(L);const z=C.path(O,{...A,fillStyle:"solid"});const U=s.insert(()=>z,":first-child");U.insert(()=>N,":first-child");U.attr("class","basic label-container outer-path");if(_&&t.look!=="handDrawn"){U.selectAll("path").attr("style",_)}if(r&&t.look!=="handDrawn"){U.selectAll("path").attr("style",r)}Qo(t,U);t.intersect=function(W){const H=Do.polygon(t,P,W);return H};return s}async function uyn(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);t.labelStyle=n;const{shapeSvg:i,bbox:o,label:a}=await Ya(e,t,za(t));const s=Math.max(o.width+(t.padding??0)*2,t?.width??0);const l=Math.max(o.height+(t.padding??0)*2,t?.height??0);const u=l/8;const d=.2*s;const f=.2*l;const h=l+u;const{cssStyles:m}=t;const g=cyn.default.svg(i);const x=$o(t,{});if(t.look!=="handDrawn"){x.roughness=0;x.fillStyle="solid"}const w=[{x:-s/2-s/2*.1,y:h/2},..._L(-s/2-s/2*.1,h/2,s/2+s/2*.1,h/2,u,.8),{x:s/2+s/2*.1,y:-h/2},{x:-s/2-s/2*.1,y:-h/2}];const _=-s/2+s/2*.1;const C=-h/2-f*.4;const A=[{x:_+s-d,y:(C+l)*1.3},{x:_+s,y:C+l-f},{x:_+s,y:(C+l)*.9},..._L(_+s,(C+l)*1.25,_+s-d,(C+l)*1.3,-l*.02,.5)];const P=ql(w);const L=g.path(P,x);const I=ql(A);const N=g.path(I,{...x,fillStyle:"solid"});const O=i.insert(()=>N,":first-child");O.insert(()=>L,":first-child");O.attr("class","basic label-container outer-path");if(m&&t.look!=="handDrawn"){O.selectAll("path").attr("style",m)}if(r&&t.look!=="handDrawn"){O.selectAll("path").attr("style",r)}O.attr("transform",`translate(0,${-u/2})`);a.attr("transform",`translate(${-s/2+(t.padding??0)-(o.x-(o.left??0))},${-l/2+(t.padding??0)-u/2-(o.y-(o.top??0))})`);Qo(t,O);t.intersect=function(z){const U=Do.polygon(t,w,z);return U};return i}async function dyn(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);t.labelStyle=n;const{shapeSvg:i,bbox:o}=await Ya(e,t,za(t));const a=Math.max(o.width+(t.padding??0),t?.width||0);const s=Math.max(o.height+(t.padding??0),t?.height||0);const l=-a/2;const u=-s/2;const d=i.insert("rect",":first-child");d.attr("class","text").attr("style",r).attr("rx",0).attr("ry",0).attr("x",l).attr("y",u).attr("width",a).attr("height",s);Qo(t,d);t.intersect=function(f){return Do.rect(t,f)};return i}async function hyn(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);t.labelStyle=n;const i=t.padding??0;const o=t.look==="neo"?12:i/2;if(t.width||t.height){const x=t.height??0;t.height=(t.height??0)-o;if(t.heightA,":first-child");g=a.insert(()=>C,":first-child");g.attr("class","basic label-container");if(m){g.attr("style",m)}}else{const x=sTi(0,0,h,u,f,d);g=a.insert("path",":first-child").attr("d",x).attr("class","basic label-container").attr("style",Zh(m)).attr("style",r);g.attr("class","basic label-container outer-path");if(m){g.selectAll("path").attr("style",m)}if(r){g.selectAll("path").attr("style",r)}}g.attr("label-offset-x",f);g.attr("transform",`translate(${-h/2}, ${u/2} )`);l.attr("transform",`translate(${-(s.width/2)-f-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`);Qo(t,g);t.intersect=function(x){const w=Do.rect(t,x);const _=w.y-(t.y??0);if(d!=0&&(Math.abs(_)<(t.height??0)/2||Math.abs(_)==(t.height??0)/2&&Math.abs(w.x-(t.x??0))>(t.width??0)/2-f)){let C=f*f*(1-_*_/(d*d));if(C!=0){C=Math.sqrt(Math.abs(C))}C=f-C;if(x.x-(t.x??0)>0){C=-C}w.x+=C}return w};return a}async function myn(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);t.labelStyle=n;const i=t.padding??0;const o=t.look==="neo"?i:i;const a=t.look==="neo"?i*2:i;const{shapeSvg:s,bbox:l}=await Ya(e,t,za(t));const u=(t?.height??l.height)+o;const d=(t?.width??l.width)+a;const f=[{x:-3*u/6,y:0},{x:d+3*u/6,y:0},{x:d,y:-u},{x:0,y:-u}];let h;const{cssStyles:m}=t;if(t.look==="handDrawn"){const g=pyn.default.svg(s);const x=$o(t,{});const w=ql(f);const _=g.path(w,x);h=s.insert(()=>_,":first-child").attr("transform",`translate(${-d/2}, ${u/2})`);if(m){h.attr("style",m)}}else{h=AR(s,d,u,f)}if(r){h.attr("style",r)}t.width=d;t.height=u;Qo(t,h);t.intersect=function(g){return Do.polygon(t,f,g)};return s}async function yyn(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);t.labelStyle=n;const i=t.padding??0;const o=t.look==="neo"?16:i;const a=t.look==="neo"?12:i;const s=15,l=5;if(t.width||t.height){t.height=(t.height??0)-a*2;if(t.heightC,":first-child");A.attr("class","basic label-container outer-path");if(m&&t.look!=="handDrawn"){A.selectChildren("path").attr("style",m)}if(r&&t.look!=="handDrawn"){A.selectChildren("path").attr("style",r)}Qo(t,A);t.intersect=function(P){const L=Do.polygon(t,w,P);return L};return u}async function xyn(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);t.labelStyle=n;const i=t.padding??0;const o=t.look==="neo"?i*2:i;if(t.width||t.height){t.width=((t?.width??0)-o)/2;if(t.widthC,":first-child").attr("transform",`translate(${-f/2}, ${f/2})`).attr("class","outer-path");if(g&&t.look!=="handDrawn"){A.selectChildren("path").attr("style",g)}if(r&&t.look!=="handDrawn"){A.selectChildren("path").attr("style",r)}t.width=d;t.height=f;Qo(t,A);l.attr("transform",`translate(${-s.width/2-(s.x-(s.left??0))}, ${f/2-(s.height+(t.padding??0)/(u?2:1)-(s.y-(s.top??0)))})`);t.intersect=function(P){wt.info("Triangle intersect",t,m,P);return Do.polygon(t,m,P)};return a}async function _yn(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);t.labelStyle=n;const i=t.padding??0;const o=t.look==="neo"?16:i;const a=t.look==="neo"?12:i;let s=true;if(t.width||t.height){s=false;t.width=(t?.width??0)-o*2;if(t.width<10){t.width=10}t.height=(t?.height??0)-a*2;if(t.height<10){t.height=10}}const{shapeSvg:l,bbox:u,label:d}=await Ya(e,t,za(t));const f=(t?.width?t?.width:u.width)+(o??0)*2;const h=(t?.height?t?.height:u.height)+(a??0)*2;const m=t.look==="neo"?h/4:h/8;const g=h+(s?m:-m);const{cssStyles:x}=t;const w=14;const _=w-f;const C=_>0?_/2:0;const A=vyn.default.svg(l);const P=$o(t,{});if(t.look!=="handDrawn"){P.roughness=0;P.fillStyle="solid"}const L=[{x:-f/2-C,y:g/2},..._L(-f/2-C,g/2,f/2+C,g/2,m,.8),{x:f/2+C,y:-g/2},{x:-f/2-C,y:-g/2}];const I=ql(L);const N=A.path(I,P);const O=l.insert(()=>N,":first-child");O.attr("class","basic label-container outer-path");if(x&&t.look!=="handDrawn"){O.selectAll("path").attr("style",x)}if(r&&t.look!=="handDrawn"){O.selectAll("path").attr("style",r)}O.attr("transform",`translate(0,${-m/2})`);d.attr("transform",`translate(${-f/2+(t.padding??0)-(u.x-(u.left??0))},${-h/2+(t.padding??0)-m-(u.y-(u.top??0))})`);Qo(t,O);t.intersect=function(z){const U=Do.polygon(t,L,z);return U};return l}async function wyn(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);t.labelStyle=n;const i=t.padding??0;const o=t.look==="neo"?16:i;const a=t.look==="neo"?20:i;if(t.width||t.height){t.width=t?.width??0;if(t.width<20){t.width=20}t.height=t?.height??0;if(t.height<10){t.height=10}const P=Math.min(t.height*.2,t.height/4);t.height=Math.ceil(t.height-a-P*(20/9));t.width=t.width-o*2}const{shapeSvg:s,bbox:l}=await Ya(e,t,za(t));const u=(t?.width?t?.width:l.width)+o*2;const d=(t?.height?t?.height:l.height)+a;const f=d/8;const h=d+f*2;const{cssStyles:m}=t;const g=Tyn.default.svg(s);const x=$o(t,{});if(t.look!=="handDrawn"){x.roughness=0;x.fillStyle="solid"}const w=[{x:-u/2,y:h/2},..._L(-u/2,h/2,u/2,h/2,f,1),{x:u/2,y:-h/2},..._L(u/2,-h/2,-u/2,-h/2,f,-1)];const _=ql(w);const C=g.path(_,x);const A=s.insert(()=>C,":first-child");A.attr("class","basic label-container");if(m&&t.look!=="handDrawn"){A.selectAll("path").attr("style",m)}if(r&&t.look!=="handDrawn"){A.selectAll("path").attr("style",r)}Qo(t,A);t.intersect=function(P){const L=Do.polygon(t,w,P);return L};return s}async function Cyn(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);t.labelStyle=n;const i=t.look==="neo"?16:t.padding??0;const o=t.look==="neo"?12:t.padding??0;if(t.width||t.height){t.width=Math.max((t?.width??0)-i*2-Yf,10);t.height=Math.max((t?.height??0)-o*2-Yf,10)}const{shapeSvg:a,bbox:s,label:l}=await Ya(e,t,za(t));const u=(t?.width?t?.width:s.width)+i*2+Yf;const d=(t?.height?t?.height:s.height)+o*2+Yf;const f=u-Yf;const h=d-Yf;const m=-f/2;const g=-h/2;const{cssStyles:x}=t;const w=Eyn.default.svg(a);const _=$o(t,{});const C=[{x:m-Yf,y:g-Yf},{x:m-Yf,y:g+h},{x:m+f,y:g+h},{x:m+f,y:g-Yf}];const A=`M${m-Yf},${g-Yf} L${m+f},${g-Yf} L${m+f},${g+h} L${m-Yf},${g+h} L${m-Yf},${g-Yf} + M${m-Yf},${g} L${m+f},${g} + M${m},${g-Yf} L${m},${g+h}`;if(t.look!=="handDrawn"){_.roughness=0;_.fillStyle="solid"}const P=w.path(A,_);const L=a.insert(()=>P,":first-child");L.attr("transform",`translate(${Yf/2}, ${Yf/2})`);L.attr("class","basic label-container outer-path");if(x&&t.look!=="handDrawn"){L.selectAll("path").attr("style",x)}if(r&&t.look!=="handDrawn"){L.selectAll("path").attr("style",r)}l.attr("transform",`translate(${-(s.width/2)+Yf/2-(s.x-(s.left??0))}, ${-(s.height/2)+Yf/2-(s.y-(s.top??0))})`);Qo(t,L);t.intersect=function(I){const N=Do.polygon(t,C,I);return N};return a}async function LKe(e,t){const n=t;if(n.alias){t.label=n.alias}const{theme:r,themeVariables:i}=Ji();const{rowEven:o,rowOdd:a,nodeBorder:s,borderColorArray:l}=i;if(t.look==="handDrawn"){const{themeVariables:Ie}=Ji();const{background:he}=Ie;const ve={...t,id:t.id+"-background",domId:(t.domId||t.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${he}`]};await LKe(e,ve)}const u=Ji();t.useHtmlLabels=u.htmlLabels;let d=u.er?.diagramPadding??10;let f=u.er?.entityPadding??6;const{cssStyles:h}=t;const{labelStyles:m,nodeStyles:g}=Ro(t);if(n.attributes.length===0&&t.label){const Ie={rx:0,ry:0,labelPaddingX:d,labelPaddingY:d*1.5,classes:""};if(Cg(t.label,u)+Ie.labelPaddingX*20){const Ie=_.width+d*2-(L+I+N+O);L+=Ie/W;I+=Ie/W;if(N>0){N+=Ie/W}if(O>0){O+=Ie/W}}const $=L+I+N+O;const K=Syn.default.svg(w);const X=$o(t,{});if(t.look!=="handDrawn"){X.roughness=0;X.fillStyle="solid"}let j=0;if(P.length>0){j=P.reduce((Ie,he)=>Ie+(he?.rowHeight??0),0)}const te=Math.max(H.width+d*2,t?.width||0,$);const J=Math.max((j??0)+_.height,t?.height||0);const oe=-te/2;const se=-J/2;w.selectAll("g:not(:first-child)").each((Ie,he,ve)=>{const ge=zr(ve[he]);const Ve=ge.attr("transform");let Le=0;let $e=0;if(Ve){const Ee=RegExp(/translate\(([^,]+),([^)]+)\)/);const tt=Ee.exec(Ve);if(tt){Le=parseFloat(tt[1]);$e=parseFloat(tt[2]);if(ge.attr("class").includes("attribute-name")){Le+=L}else if(ge.attr("class").includes("attribute-keys")){Le+=L+I}else if(ge.attr("class").includes("attribute-comment")){Le+=L+I+N}}}ge.attr("transform",`translate(${oe+d/2+Le}, ${$e+se+_.height+f/2})`)});w.select(".name").attr("transform","translate("+-_.width/2+", "+(se+f/2)+")");if(r!=null&&pmn.has(r)){const Ie=n.colorIndex??0;w.attr("data-color-id",`color-${Ie%l.length}`)}const re=K.rectangle(oe,se,te,J,X);const ce=w.insert(()=>re,":first-child").attr("class","outer-path").attr("style",h.join(""));A.push(0);for(const[Ie,he]of P.entries()){const ve=Ie+1;const ge=ve%2===0&&he.yOffset!==0;const Ve=K.rectangle(oe,_.height+se+he?.yOffset,te,he?.rowHeight,{...X,fill:ge?o:a,stroke:s});w.insert(()=>Ve,"g.label").attr("style",h.join("")).attr("class",`row-rect-${ge?"even":"odd"}`)}const ue=1e-4;let xe=k$(oe,_.height+se,te+oe,_.height+se,ue);let be=K.polygon(xe.map(Ie=>[Ie.x,Ie.y]),X);w.insert(()=>be).attr("class","divider");xe=k$(L+oe,_.height+se,L+oe,J+se,ue);be=K.polygon(xe.map(Ie=>[Ie.x,Ie.y]),X);w.insert(()=>be).attr("class","divider");if(z){const Ie=L+I+oe;xe=k$(Ie,_.height+se,Ie,J+se,ue);be=K.polygon(xe.map(he=>[he.x,he.y]),X);w.insert(()=>be).attr("class","divider")}if(U){const Ie=L+I+N+oe;xe=k$(Ie,_.height+se,Ie,J+se,ue);be=K.polygon(xe.map(he=>[he.x,he.y]),X);w.insert(()=>be).attr("class","divider")}for(const Ie of A){const he=_.height+se+Ie;xe=k$(oe,he,te+oe,he,ue);be=K.polygon(xe.map(ve=>[ve.x,ve.y]),X);w.insert(()=>be).attr("class","divider")}Qo(t,ce);if(g&&t.look!=="handDrawn"){if(r!=null&&uTi.has(r)){w.selectAll("path").attr("style",g)}else{const Ie=g.split(";");const he=Ie?.filter(ve=>{return ve.includes("stroke")})?.map(ve=>`${ve}`).join("; ");w.selectAll("path").attr("style",he??"");w.selectAll(".row-rect-even path").attr("style",g)}}t.intersect=function(Ie){return Do.rect(t,Ie)};return w}async function A$(e,t,n,r=0,i=0,o=[],a=""){const s=e.insert("g").attr("class",`label ${o.join(" ")}`).attr("transform",`translate(${r}, ${i})`).attr("style",a);if(t!==BC(t)){t=BC(t);t=t.replaceAll("<","<").replaceAll(">",">")}const l=s.node().appendChild(await Qh(s,t,{width:Cg(t,n)+100,style:a,useHtmlLabels:n.htmlLabels},n));if(t.includes("<")||t.includes(">")){let d=l.children[0];d.textContent=d.textContent.replaceAll("<","<").replaceAll(">",">");while(d.childNodes[0]){d=d.childNodes[0];d.textContent=d.textContent.replaceAll("<","<").replaceAll(">",">")}}let u=l.getBBox();if(R_(n.htmlLabels)){const d=l.children[0];d.style.textAlign="start";const f=zr(l);u=d.getBoundingClientRect();f.attr("width",u.width);f.attr("height",u.height)}return u}function k$(e,t,n,r,i){if(e===n){return[{x:e-i/2,y:t},{x:e+i/2,y:t},{x:n+i/2,y:r},{x:n-i/2,y:r}]}return[{x:e,y:t-i/2},{x:e,y:t+i/2},{x:n,y:r+i/2},{x:n,y:r-i/2}]}async function kyn(e,t,n,r,i=n.class.padding??12){const o=!r?3:0;const a=e.insert("g").attr("class",za(t)).attr("id",t.domId||t.id);let s=null;let l=null;let u=null;let d=null;let f=0;let h=0;let m=0;s=a.insert("g").attr("class","annotation-group text");if(t.annotations.length>0){const C=t.annotations[0];await Bee(s,{text:`\xAB${C}\xBB`},0);const A=s.node().getBBox();f=A.height}l=a.insert("g").attr("class","label-group text");await Bee(l,t,0,["font-weight: bolder"]);const g=l.node().getBBox();h=g.height;u=a.insert("g").attr("class","members-group text");let x=0;for(const C of t.members){const A=await Bee(u,C,x,[C.parseClassifier()]);x+=A+o}m=u.node().getBBox().height;if(m<=0){m=i/2}d=a.insert("g").attr("class","methods-group text");let w=0;for(const C of t.methods){const A=await Bee(d,C,w,[C.parseClassifier()]);w+=A+o}let _=a.node().getBBox();if(s!==null){const C=s.node().getBBox();s.attr("transform",`translate(${-C.width/2})`)}l.attr("transform",`translate(${-g.width/2}, ${f})`);_=a.node().getBBox();u.attr("transform",`translate(${0}, ${f+h+i*2})`);_=a.node().getBBox();d.attr("transform",`translate(${0}, ${f+h+(m?m+i*4:i*2)})`);_=a.node().getBBox();return{shapeSvg:a,bbox:_}}async function Bee(e,t,n,r=[]){const i=e.insert("g").attr("class","label").attr("style",r.join("; "));const o=Ji();let a="useHtmlLabels"in t?t.useHtmlLabels:R_(o.htmlLabels)??true;let s="";if("text"in t){s=t.text}else{s=t.label}if(!a&&s.startsWith("\\")){s=s.substring(1)}if(of(s)){a=true}const l=await Qh(i,s2e(tv(s)),{width:Cg(s,o)+50,classes:"markdown-node-label",useHtmlLabels:a},o);let u;let d=1;if(!a){if(r.includes("font-weight: bolder")){zr(l).selectAll("tspan").attr("font-weight","")}d=l.children.length;const f=l.children[0];if(l.textContent===""||l.textContent.includes(">")){f.textContent=s[0]+s.substring(1).replaceAll(">",">").replaceAll("<","<").trim();const h=s[1]===" ";if(h){f.textContent=f.textContent[0]+" "+f.textContent.substring(1)}}if(f.textContent==="undefined"){f.textContent=""}u=l.getBBox()}else{const f=l.children[0];const h=zr(l);d=f.innerHTML.split("
    ").length;if(f.innerHTML.includes("")){d+=f.innerHTML.split("").length-1}const m=f.getElementsByTagName("img");if(m){const g=s.replace(/]*>/g,"").trim()==="";await Promise.all([...m].map(x=>new Promise(w=>{function _(){x.style.display="flex";x.style.flexDirection="column";if(g){const C=o.fontSize?.toString()??window.getComputedStyle(document.body).fontSize;const A=5;const P=parseInt(C,10)*A+"px";x.style.minWidth=P;x.style.maxWidth=P}else{x.style.width="100%"}w(x)}B(_,"setupImage");setTimeout(()=>{if(x.complete){_()}});x.addEventListener("error",_);x.addEventListener("load",_)})))}u=f.getBoundingClientRect();h.attr("width",u.width);h.attr("height",u.height)}i.attr("transform","translate(0,"+(-u.height/(2*d)+n)+")");return u.height}async function Ryn(e,t){const n=Mn();const{themeVariables:r}=n;const{useGradient:i}=r;const o=n.class.padding??12;const a=o;const s=t.useHtmlLabels??R_(n.htmlLabels)??true;const l=t;l.annotations=l.annotations??[];l.members=l.members??[];l.methods=l.methods??[];const{shapeSvg:u,bbox:d}=await kyn(e,t,n,s,a);const{labelStyles:f,nodeStyles:h}=Ro(t);t.labelStyle=f;t.cssStyles=l.styles||"";const m=l.styles?.join(";")||h||"";if(!t.cssStyles){t.cssStyles=m.replaceAll("!important","").split(";")}const g=l.members.length===0&&l.methods.length===0&&!n.class?.hideEmptyMembersBox;const x=Ayn.default.svg(u);const w=$o(t,{});if(t.look!=="handDrawn"){w.roughness=0;w.fillStyle="solid"}const _=Math.max(t.width??0,d.width);let C=Math.max(t.height??0,d.height);const A=(t.height??0)>d.height;if(l.members.length===0&&l.methods.length===0){C+=a}else if(l.members.length>0&&l.methods.length===0){C+=a*2}const P=-_/2;const L=-C/2;let I=g?o*2:l.members.length===0&&l.methods.length===0?-o:0;if(A){I=o*2}const N=x.rectangle(P-o,L-o-(g?o:l.members.length===0&&l.methods.length===0?-o/2:0),_+2*o,C+2*o+I,w);const O=u.insert(()=>N,":first-child");O.attr("class","basic label-container outer-path");const z=O.node().getBBox();const U=u.select(".annotation-group").node().getBBox().height-(g?o/2:0)||0;const W=u.select(".label-group").node().getBBox().height-(g?o/2:0)||0;const H=u.select(".members-group").node().getBBox().height-(g?o/2:0)||0;const $=(U+W+L+o-(L-o-(g?o:l.members.length===0&&l.methods.length===0?-o/2:0)))/2;u.selectAll(".text").each((K,X,j)=>{const te=zr(j[X]);const J=te.attr("transform");let oe=0;if(J){const ce=RegExp(/translate\(([^,]+),([^)]+)\)/);const ue=ce.exec(J);if(ue){oe=parseFloat(ue[2])}}let se=oe+L+o-(g?o:l.members.length===0&&l.methods.length===0?-o/2:0);if(te.attr("class").includes("methods-group")){const ce=Math.max(H,a/2);if(A){se=Math.max($,U+W+ce+L+a*2+o)+a*2}else{se=U+W+ce+L+a*4+o}}if(l.members.length===0&&l.methods.length===0&&n.class?.hideEmptyMembersBox){if(l.annotations.length>0){se=oe-a}else{se=oe}}if(!s){se-=4}let re=P;if(te.attr("class").includes("label-group")||te.attr("class").includes("annotation-group")){re=-te.node()?.getBBox().width/2||0;u.selectAll("text").each(function(ce,ue,xe){if(window.getComputedStyle(xe[ue]).textAnchor==="middle"){re=0}})}te.attr("transform",`translate(${re}, ${se})`)});if(l.members.length>0||l.methods.length>0||g){const K=U+W+L+o;const X=x.line(z.x,K,z.x+z.width,K+.001,w);const j=u.insert(()=>X);j.attr("class",`divider${t.look==="neo"&&!i?" neo-line":""}`).attr("style",m)}if(g||l.members.length>0||l.methods.length>0){const K=U+W+H+L+a*2+o;const X=x.line(z.x,A?Math.max($,K):K,z.x+z.width,(A?Math.max($,K):K)+.001,w);const j=u.insert(()=>X);j.attr("class",`divider${t.look==="neo"&&!i?" neo-line":""}`).attr("style",m)}if(l.look!=="handDrawn"){u.selectAll("path").attr("style",m)}O.select(":nth-child(2)").attr("style",m);u.selectAll(".divider").select("path").attr("style",m);if(t.labelStyle){u.selectAll("span").attr("style",t.labelStyle)}else{u.selectAll("span").attr("style",m)}if(!s){const K=RegExp(/color\s*:\s*([^;]*)/);const X=K.exec(m);if(X){const j=X[0].replace("color","fill");u.selectAll("tspan").attr("style",j)}else if(f){const j=K.exec(f);if(j){const te=j[0].replace("color","fill");u.selectAll("tspan").attr("style",te)}}}Qo(t,O);t.intersect=function(K){return Do.rect(t,K)};return u}async function Iyn(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);t.labelStyle=n;const i=t;const o=t;const a=20;const s=20;const l="verifyMethod"in t;const u=za(t);const{themeVariables:d}=Mn();const{borderColorArray:f,requirementEdgeLabelBackground:h}=d;const m=e.insert("g").attr("class",u).attr("id",t.domId??t.id);let g;if(l){g=await GC(m,`<<${i.type}>>`,0,t.labelStyle)}else{g=await GC(m,"<<Element>>",0,t.labelStyle)}let x=g;const w=await GC(m,i.name,x,t.labelStyle+"; font-weight: bold;");x+=w+s;if(l){const z=await GC(m,`${i.requirementId?`ID: ${i.requirementId}`:""}`,x,t.labelStyle);x+=z;const U=await GC(m,`${i.text?`Text: ${i.text}`:""}`,x,t.labelStyle);x+=U;const W=await GC(m,`${i.risk?`Risk: ${i.risk}`:""}`,x,t.labelStyle);x+=W;await GC(m,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:""}`,x,t.labelStyle)}else{const z=await GC(m,`${o.type?`Type: ${o.type}`:""}`,x,t.labelStyle);x+=z;await GC(m,`${o.docRef?`Doc Ref: ${o.docRef}`:""}`,x,t.labelStyle)}const _=(m.node()?.getBBox().width??200)+a;const C=(m.node()?.getBBox().height??200)+a;const A=-_/2;const P=-C/2;const L=Pyn.default.svg(m);const I=$o(t,{});if(t.look!=="handDrawn"){I.roughness=0;I.fillStyle="solid"}const N=L.rectangle(A,P,_,C,I);const O=m.insert(()=>N,":first-child");O.attr("class","basic label-container outer-path").attr("style",r);if(f?.length){const z=t.colorIndex??0;m.attr("data-color-id",`color-${z%f.length}`)}m.selectAll(".label").each((z,U,W)=>{const H=zr(W[U]);const $=H.attr("transform");let K=0;let X=0;if($){const J=RegExp(/translate\(([^,]+),([^)]+)\)/);const oe=J.exec($);if(oe){K=parseFloat(oe[1]);X=parseFloat(oe[2])}}const j=X-C/2;let te=A+a/2;if(U===0||U===1){te=K}H.attr("transform",`translate(${te}, ${j+a})`)});if(x>g+w+s){const z=P+g+w+s;let U;if(t.look==="neo"){const H=.001;const $=[[A,z],[A+_,z],[A+_,z+H],[A,z+H]];U=L.polygon($,I)}else{U=L.line(A,z,A+_,z,I)}const W=m.insert(()=>U);W.attr("class","divider")}Qo(t,O);t.intersect=function(z){return Do.rect(t,z)};if(r&&t.look!=="handDrawn"&&(h||f?.length)){m.selectAll("path").attr("style",r)}return m}async function GC(e,t,n,r=""){if(t===""){return 0}const i=e.insert("g").attr("class","label").attr("style",r);const o=Mn();const a=o.htmlLabels??true;const s=await Qh(i,s2e(tv(t)),{width:Cg(t,o)+50,classes:"markdown-node-label",useHtmlLabels:a,style:r},o);let l;if(!a){const u=s.children[0];for(const d of u.children){if(r){d.setAttribute("style",r)}}l=s.getBBox();l.height+=6}else{const u=s.children[0];const d=zr(s);l=u.getBoundingClientRect();d.attr("width",l.width);d.attr("height",l.height)}i.attr("transform",`translate(${-l.width/2},${-l.height/2+n})`);return l.height}async function Lyn(e,t,{config:n}){const{labelStyles:r,nodeStyles:i}=Ro(t);t.labelStyle=r||"";const o=10;const a=t.width;t.width=(t.width??200)-10;const{shapeSvg:s,bbox:l,label:u}=await Ya(e,t,za(t));const d=t.padding||10;let f="";let h;if("ticket"in t&&t.ticket&&n?.kanban?.ticketBaseUrl){f=n?.kanban?.ticketBaseUrl.replace("#TICKET#",t.ticket);h=s.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",f).attr("target","_blank")}const m={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||"",width:t.width,img:t.img,padding:t.padding||8,centerLabel:false};let g,x;if(h){({label:g,bbox:x}=await SKe(h,"ticket"in t&&t.ticket||"",m))}else{({label:g,bbox:x}=await SKe(s,"ticket"in t&&t.ticket||"",m))}const{label:w,bbox:_}=await SKe(s,"assigned"in t&&t.assigned||"",m);t.width=a;const C=10;const A=t?.width||0;const P=Math.max(x.height,_.height)/2;const L=Math.max(l.height+C*2,t?.height||0)+P;const I=-A/2;const N=-L/2;u.attr("transform","translate("+(d-A/2)+", "+(-P-l.height/2)+")");g.attr("transform","translate("+(d-A/2)+", "+(-P+l.height/2)+")");w.attr("transform","translate("+(d+A/2-_.width-2*o)+", "+(-P+l.height/2)+")");let O;const{rx:z,ry:U}=t;const{cssStyles:W}=t;if(t.look==="handDrawn"){const H=Myn.default.svg(s);const $=$o(t,{});const K=z||U?H.path(TL(I,N,A,L,z||0),$):H.rectangle(I,N,A,L,$);O=s.insert(()=>K,":first-child");O.attr("class","basic label-container").attr("style",W?W:null)}else{O=s.insert("rect",":first-child");O.attr("class","basic label-container __APA__").attr("style",i).attr("rx",z??5).attr("ry",U??5).attr("x",I).attr("y",N).attr("width",A).attr("height",L);const H="priority"in t&&t.priority;if(H){const $=s.append("line");const K=I+2;const X=N+Math.floor((z??0)/2);const j=N+L-Math.floor((z??0)/2);$.attr("x1",K).attr("y1",X).attr("x2",K).attr("y2",j).attr("stroke-width","4").attr("stroke",dTi(H))}}Qo(t,O);t.height=L;t.intersect=function(H){return Do.rect(t,H)};return s}async function Fyn(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);t.labelStyle=n;const{shapeSvg:i,bbox:o,halfPadding:a,label:s}=await Ya(e,t,za(t));const l=o.width+10*a;const u=o.height+8*a;const d=.15*l;const{cssStyles:f}=t;const h=o.width+20;const m=o.height+20;const g=Math.max(l,h);const x=Math.max(u,m);s.attr("transform",`translate(${-o.width/2}, ${-o.height/2})`);let w;const _=`M0 0 + a${d},${d} 1 0,0 ${g*.25},${-1*x*.1} + a${d},${d} 1 0,0 ${g*.25},${0} + a${d},${d} 1 0,0 ${g*.25},${0} + a${d},${d} 1 0,0 ${g*.25},${x*.1} + + a${d},${d} 1 0,0 ${g*.15},${x*.33} + a${d*.8},${d*.8} 1 0,0 0,${x*.34} + a${d},${d} 1 0,0 ${-1*g*.15},${x*.33} + + a${d},${d} 1 0,0 ${-1*g*.25},${x*.15} + a${d},${d} 1 0,0 ${-1*g*.25},0 + a${d},${d} 1 0,0 ${-1*g*.25},0 + a${d},${d} 1 0,0 ${-1*g*.25},${-1*x*.15} + + a${d},${d} 1 0,0 ${-1*g*.1},${-1*x*.33} + a${d*.8},${d*.8} 1 0,0 0,${-1*x*.34} + a${d},${d} 1 0,0 ${g*.1},${-1*x*.33} + H0 V0 Z`;if(t.look==="handDrawn"){const C=Dyn.default.svg(i);const A=$o(t,{});const P=C.path(_,A);w=i.insert(()=>P,":first-child");w.attr("class","basic label-container").attr("style",Zh(f))}else{w=i.insert("path",":first-child").attr("class","basic label-container").attr("style",r).attr("d",_)}w.attr("transform",`translate(${-g/2}, ${-x/2})`);Qo(t,w);t.calcIntersect=function(C,A){return Do.rect(C,A)};t.intersect=function(C){wt.info("Bang intersect",t,C);return Do.rect(t,C)};return i}async function Oyn(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);t.labelStyle=n;const{shapeSvg:i,bbox:o,halfPadding:a,label:s}=await Ya(e,t,za(t));const l=o.width+2*a;const u=o.height+2*a;const d=.15*l;const f=.25*l;const h=.35*l;const m=.2*l;const{cssStyles:g}=t;let x;const w=`M0 0 + a${d},${d} 0 0,1 ${l*.25},${-1*l*.1} + a${h},${h} 1 0,1 ${l*.4},${-1*l*.1} + a${f},${f} 1 0,1 ${l*.35},${l*.2} + + a${d},${d} 1 0,1 ${l*.15},${u*.35} + a${m},${m} 1 0,1 ${-1*l*.15},${u*.65} + + a${f},${d} 1 0,1 ${-1*l*.25},${l*.15} + a${h},${h} 1 0,1 ${-1*l*.5},0 + a${d},${d} 1 0,1 ${-1*l*.25},${-1*l*.15} + + a${d},${d} 1 0,1 ${-1*l*.1},${-1*u*.35} + a${m},${m} 1 0,1 ${l*.1},${-1*u*.65} + H0 V0 Z`;if(t.look==="handDrawn"){const _=Nyn.default.svg(i);const C=$o(t,{});const A=_.path(w,C);x=i.insert(()=>A,":first-child");x.attr("class","basic label-container").attr("style",Zh(g))}else{x=i.insert("path",":first-child").attr("class","basic label-container").attr("style",r).attr("d",w)}s.attr("transform",`translate(${-o.width/2}, ${-o.height/2})`);x.attr("transform",`translate(${-l/2}, ${-u/2})`);Qo(t,x);t.calcIntersect=function(_,C){return Do.rect(_,C)};t.intersect=function(_){wt.info("Cloud intersect",t,_);return Do.rect(t,_)};return i}async function Byn(e,t){const{labelStyles:n,nodeStyles:r}=Ro(t);t.labelStyle=n;const{shapeSvg:i,bbox:o,halfPadding:a,label:s}=await Ya(e,t,za(t));const l=o.width+8*a;const u=o.height+2*a;const d=5;const f=t.look==="neo"?` + M${-l/2} ${u/2-d} + v${-u+2*d} + q0,-${d} ${d},-${d} + h${l-2*d} + q${d},0 ${d},${d} + v${u-d} + H${-l/2} + Z + `:` + M${-l/2} ${u/2-d} + v${-u+2*d} + q0,-${d} ${d},-${d} + h${l-2*d} + q${d},0 ${d},${d} + v${u-2*d} + q0,${d} ${-d},${d} + h${-(l-2*d)} + q${-d},0 ${-d},${-d} + Z + `;if(!t.domId){throw new Error(`defaultMindmapNode: node "${t.id}" is missing a domId \u2014 was render.ts domId prefixing skipped?`)}const h=i.append("path").attr("id",t.domId).attr("class","node-bkg node-"+t.type).attr("style",r).attr("d",f);i.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",u/2).attr("x2",l/2).attr("y2",u/2);s.attr("transform",`translate(${-o.width/2}, ${-o.height/2})`);i.append(()=>s.node());Qo(t,h);t.calcIntersect=function(m,g){return Do.rect(m,g)};t.intersect=function(m){return Do.rect(t,m)};return i}async function zyn(e,t){const n={padding:t.padding??0};return MKe(e,t,n)}function DKe(e){return e in Uyn}async function kR(e,t,n){let r;let i;if(t.shape==="rect"){if(t.rx&&t.ry){t.shape="roundedRect"}else{t.shape="squareRect"}}const o=t.shape?Uyn[t.shape]:void 0;if(!o){throw new Error(`No such shape: ${t.shape}. Please check your syntax.`)}if(t.link){let a;if(n.config.securityLevel==="sandbox"){a="_top"}else if(t.linkTarget){a=t.linkTarget||"_blank"}r=e.insert("svg:a").attr("xlink:href",t.link).attr("target",a??null);i=await o(r,t,n)}else{i=await o(e,t,n);r=i}r.attr("data-look",Zh(t.look));if(t.tooltip){i.attr("title",t.tooltip)}YEe.set(t.id,r);if(t.haveCallback){r.attr("class",r.attr("class")+" clickable")}return r}var Uee,RKe,wmn,Cmn,kmn,Pmn,Mmn,Lmn,Nmn,Bmn,Umn,$mn,Hmn,Ymn,qmn,jmn,Zmn,Qmn,tgn,rgn,ogn,sgn,cgn,dgn,hgn,mgn,ygn,xgn,_gn,Egn,Sgn,kgn,Pgn,Mgn,Dgn,Ngn,Bgn,Ugn,$gn,Hgn,qgn,jgn,Jgn,tyn,ryn,oyn,syn,cyn,fyn,pyn,gyn,byn,vyn,Tyn,Eyn,Syn,Ayn,Pyn,Myn,Dyn,Nyn,Ya,SKe,Qo,za,U_i,eB,V_i,SR,TL,$_i,mmn,G_i,H_i,W_i,Y_i,q_i,X_i,gmn,wL,WEe,j_i,xmn,K_i,Z_i,J_i,Do,HEe,Q_i,eTi,tTi,imn,omn,amn,smn,nTi,rTi,iTi,oTi,lmn,cmn,aTi,Q5,S$,AKe,sTi,lTi,cTi,umn,dmn,fmn,hmn,Yf,pmn,uTi,dTi,fTi,hTi,Uyn,YEe,Vyn,qEe,tB;var kg=Ce(()=>{Eg();Sg();Np();Jh();nl();Ta();Aa();Yo();ks();ks();Uee=Ui(jo(),1);ks();RKe=Ui(jo(),1);wmn=Ui(jo(),1);Cmn=Ui(jo(),1);kmn=Ui(jo(),1);Pmn=Ui(jo(),1);Mmn=Ui(jo(),1);Lmn=Ui(jo(),1);Nmn=Ui(jo(),1);Bmn=Ui(jo(),1);Umn=Ui(jo(),1);$mn=Ui(jo(),1);Hmn=Ui(jo(),1);Ymn=Ui(jo(),1);qmn=Ui(jo(),1);jmn=Ui(jo(),1);Zmn=Ui(jo(),1);Qmn=Ui(jo(),1);tgn=Ui(jo(),1);rgn=Ui(jo(),1);ogn=Ui(jo(),1);sgn=Ui(jo(),1);cgn=Ui(jo(),1);dgn=Ui(jo(),1);hgn=Ui(jo(),1);mgn=Ui(jo(),1);ygn=Ui(jo(),1);xgn=Ui(jo(),1);_gn=Ui(jo(),1);Egn=Ui(jo(),1);Sgn=Ui(jo(),1);kgn=Ui(jo(),1);Pgn=Ui(jo(),1);Mgn=Ui(jo(),1);Dgn=Ui(jo(),1);Ngn=Ui(jo(),1);Bgn=Ui(jo(),1);Ugn=Ui(jo(),1);$gn=Ui(jo(),1);ks();Hgn=Ui(jo(),1);qgn=Ui(jo(),1);jgn=Ui(jo(),1);Jgn=Ui(jo(),1);tyn=Ui(jo(),1);ryn=Ui(jo(),1);oyn=Ui(jo(),1);syn=Ui(jo(),1);cyn=Ui(jo(),1);fyn=Ui(jo(),1);pyn=Ui(jo(),1);gyn=Ui(jo(),1);byn=Ui(jo(),1);vyn=Ui(jo(),1);Tyn=Ui(jo(),1);Eyn=Ui(jo(),1);Syn=Ui(jo(),1);ks();ks();Ayn=Ui(jo(),1);ks();Pyn=Ui(jo(),1);ks();Myn=Ui(jo(),1);Dyn=Ui(jo(),1);Nyn=Ui(jo(),1);Ya=B(async(e,t,n)=>{let r;const i=t.useHtmlLabels||R_(Mn()?.htmlLabels);if(!n){r="node default"}else{r=n}const o=e.insert("g").attr("class",r).attr("id",t.domId||t.id);const a=o.insert("g").attr("class","label").attr("style",Zh(t.labelStyle));let s;if(t.label===void 0){s=""}else{s=typeof t.label==="string"?t.label:t.label[0]}const l=!!t.icon||!!t.img;const u=t.labelType==="markdown";const d=await Qh(a,La(tv(s),Mn()),{useHtmlLabels:i,width:t.width||Mn().flowchart?.wrappingWidth,classes:u?"markdown-node-label":"",style:t.labelStyle,addSvgBackground:l,markdown:u},Mn());let f=d.getBBox();const h=(t?.padding??0)/2;if(i){const m=d.children[0];const g=zr(d);await Ree(m,s);f=m.getBoundingClientRect();g.attr("width",f.width);g.attr("height",f.height)}if(i){a.attr("transform","translate("+-f.width/2+", "+-f.height/2+")")}else{a.attr("transform","translate(0, "+-f.height/2+")")}if(t.centerLabel){a.attr("transform","translate("+-f.width/2+", "+-f.height/2+")")}a.insert("rect",":first-child");return{shapeSvg:o,bbox:f,halfPadding:h,label:a}},"labelHelper");SKe=B(async(e,t,n)=>{const r=n.useHtmlLabels??oc(Mn());const i=e.insert("g").attr("class","label").attr("style",n.labelStyle||"");const o=await Qh(i,La(tv(t),Mn()),{useHtmlLabels:r,width:n.width||Mn()?.flowchart?.wrappingWidth,style:n.labelStyle,addSvgBackground:!!n.icon||!!n.img});let a=o.getBBox();const s=n.padding/2;if(oc(Mn())){const l=o.children[0];const u=zr(o);a=l.getBoundingClientRect();u.attr("width",a.width);u.attr("height",a.height)}if(r){i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")")}else{i.attr("transform","translate(0, "+-a.height/2+")")}if(n.centerLabel){i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")")}i.insert("rect",":first-child");return{shapeSvg:e,bbox:a,halfPadding:s,label:i}},"insertLabel");Qo=B((e,t)=>{const n=t.node().getBBox();e.width=n.width;e.height=n.height},"updateNodeBounds");za=B((e,t)=>(e.look==="handDrawn"?"rough-node":"node")+" "+e.cssClasses+" "+(t||""),"getNodeClasses");B(ql,"createPathFromPoints");B(_L,"generateFullSineWavePoints");B(zee,"generateCirclePoints");B(kKe,"mergePaths");U_i=B((e,t)=>{var n=e.x;var r=e.y;var i=t.x-n;var o=t.y-r;var a=e.width/2;var s=e.height/2;var l,u;if(Math.abs(o)*a>Math.abs(i)*s){if(o<0){s=-s}l=o===0?0:s*i/o;u=s}else{if(i<0){a=-a}l=a;u=i===0?0:a*o/i}return{x:n+l,y:r+u}},"intersectRect");eB=U_i;V_i=B(async(e,t,n,r=false,i=false)=>{let o=t||"";if(typeof o==="object"){o=o[0]}const a=Mn();const s=oc(a);return await Qh(e,o,{style:n,isTitle:r,useHtmlLabels:s,markdown:false,isNode:i,width:Number.POSITIVE_INFINITY},a)},"createLabel");SR=V_i;TL=B((e,t,n,r,i)=>["M",e+i,t,"H",e+n-i,"A",i,i,0,0,1,e+n,t+i,"V",t+r-i,"A",i,i,0,0,1,e+n-i,t+r,"H",e+i,"A",i,i,0,0,1,e,t+r-i,"V",t+i,"A",i,i,0,0,1,e+i,t,"Z"].join(" "),"createRoundedRectPathD");$_i=B(async(e,t)=>{const n=Mn();const{themeVariables:r,handDrawnSeed:i}=n;const{clusterBkg:o,clusterBorder:a}=r;const s=a;const{labelStyles:l,nodeStyles:u,borderStyles:d,backgroundStyles:f}=Ro(t);const h=e.insert("g").attr("class","cluster swimlane "+(t.cssClasses||"")).attr("id",t.id).attr("data-id",t.id).attr("data-et","cluster").attr("data-look",t.look);const m=R_(n.flowchart.htmlLabels);const g=t.direction==="LR";const x=h.insert("g").attr("class","cluster-label swimlane-label");const w=await Qh(x,t.label,{style:t.labelStyle,useHtmlLabels:m,isNode:true,width:t.width});let _=w.getBBox();if(m){const $=w.children[0];const K=zr(w);_=$.getBoundingClientRect();K.attr("width",_.width);K.attr("height",_.height)}const C=t.padding??0;const A=t.width<=_.width+C?_.width+C:t.width;if(t.width<=_.width+C){t.diff=(A-t.width)/2-C}else{t.diff=-C}const P=t.height;const L=t.y-P/2;const I=t.y+P/2;const N=t.x-A/2;const O=t.swimlaneContentTop!==void 0?t.swimlaneContentTop:L+P/3;const z=g?4:0;const U=_.height+2*z;let W;let H;if(g){const $=Math.max(U,_.height+2*z);const K=N+$;const X=Math.max(0,A-$);if(t.look==="handDrawn"){const J=RKe.default.svg(h);const oe=$o(t,{roughness:.7,fill:o,stroke:s,fillWeight:3,seed:i});const se=$o(t,{roughness:.7,fill:"none",stroke:s,seed:i});const re=J.rectangle(N,L,$,P,oe);W=h.insert(()=>re,":first-child");const ce=J.rectangle(K,L,X,P,se);H=h.insert(()=>ce,":first-child");W.select("path:nth-child(2)").attr("style",d.join(";"));W.select("path").attr("style",f.join(";").replace("fill","stroke"))}else{W=h.insert("rect",":first-child");H=h.insert("rect",":first-child");W.attr("class","swimlane-title").attr("style",u).attr("x",N).attr("y",L).attr("width",$).attr("height",P).attr("fill",o).attr("stroke",s);H.attr("class","swimlane-body").attr("style",u).attr("x",K).attr("y",L).attr("width",X).attr("height",P).attr("fill","none").attr("stroke",s)}const j=N+$/2;const te=t.y;x.attr("transform",`translate(${j}, ${te}) rotate(-90) translate(${-_.width/2}, ${-_.height/2})`)}else{const $=Math.max(0,O-L);const K=Math.min(U,$);const X=L+K;const j=Math.max(0,I-X);const te=t.x-A/2;if(t.look==="handDrawn"){const se=RKe.default.svg(h);const re=$o(t,{roughness:.7,fill:o,stroke:s,fillWeight:3,seed:i});const ce=$o(t,{roughness:.7,fill:"none",stroke:s,seed:i});const ue=se.rectangle(te,L,A,K,re);W=h.insert(()=>ue,":first-child");const xe=se.rectangle(te,X,A,j,ce);H=h.insert(()=>xe,":first-child");W.select("path:nth-child(2)").attr("style",d.join(";"));W.select("path").attr("style",f.join(";").replace("fill","stroke"))}else{W=h.insert("rect",":first-child");H=h.insert("rect",":first-child");W.attr("class","swimlane-title").attr("style",u).attr("x",te).attr("y",L).attr("width",A).attr("height",K).attr("fill",o).attr("stroke",s);H.attr("class","swimlane-body").attr("style",u).attr("x",te).attr("y",X).attr("width",A).attr("height",j).attr("fill","none").attr("stroke",s)}const J=t.x-_.width/2;const oe=L+(K-_.height)/2;x.attr("transform",`translate(${J}, ${oe})`)}wt.trace("Swimlane data ",t,JSON.stringify(t));if(l){const $=x.select("span");if($){$.attr("style",l)}}t.offsetX=0;t.width=A;t.height=P;t.offsetY=_.height-C/2;t.intersect=function($){return eB(t,$)};return{cluster:h,labelBBox:_}},"swimlane");mmn=B(async(e,t)=>{wt.info("Creating subgraph rect for ",t.id,t);const n=Mn();const{themeVariables:r,handDrawnSeed:i}=n;const{clusterBkg:o,clusterBorder:a}=r;const{labelStyles:s,nodeStyles:l,borderStyles:u,backgroundStyles:d}=Ro(t);const f=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look);const h=oc(n);const m=f.insert("g").attr("class","cluster-label ");let g;if(t.labelType==="markdown"){g=await Qh(m,t.label,{style:t.labelStyle,useHtmlLabels:h,isNode:true,width:t.width})}else{g=await SR(m,t.label,t.labelStyle||"",false,true)}let x=g.getBBox();if(oc(n)){const N=g.children[0];const O=zr(g);x=N.getBoundingClientRect();O.attr("width",x.width);O.attr("height",x.height)}const w=t.width<=x.width+t.padding?x.width+t.padding:t.width;if(t.width<=x.width+t.padding){t.diff=(w-t.width)/2-t.padding}else{t.diff=-t.padding}const _=t.height;const C=t.x-w/2;const A=t.y-_/2;wt.trace("Data ",t,JSON.stringify(t));let P;if(t.look==="handDrawn"){const N=Uee.default.svg(f);const O=$o(t,{roughness:.7,fill:o,stroke:a,fillWeight:3,seed:i});const z=N.path(TL(C,A,w,_,0),O);P=f.insert(()=>{wt.debug("Rough node insert CXC",z);return z},":first-child");P.select("path:nth-child(2)").attr("style",u.join(";"));P.select("path").attr("style",d.join(";").replace("fill","stroke"))}else{P=f.insert("rect",":first-child");P.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",C).attr("y",A).attr("width",w).attr("height",_)}const{subGraphTitleTopMargin:L}=Sw(n);m.attr("transform",`translate(${t.x-x.width/2}, ${t.y-t.height/2+L})`);if(s){const N=m.select("span");if(N){N.attr("style",s)}}const I=P.node().getBBox();t.offsetX=0;t.width=I.width;t.height=I.height;t.offsetY=x.height-t.padding/2;t.intersect=function(N){return eB(t,N)};return{cluster:f,labelBBox:x}},"rect");G_i=B((e,t)=>{const n=e.insert("g").attr("class","note-cluster").attr("id",t.domId);const r=n.insert("rect",":first-child");const i=0*t.padding;const o=i/2;r.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-o).attr("y",t.y-t.height/2-o).attr("width",t.width+i).attr("height",t.height+i).attr("fill","none");const a=r.node().getBBox();t.width=a.width;t.height=a.height;t.intersect=function(s){return eB(t,s)};return{cluster:n,labelBBox:{width:0,height:0}}},"noteGroup");H_i=B(async(e,t)=>{const n=Mn();const{themeVariables:r,handDrawnSeed:i}=n;const{altBackground:o,compositeBackground:a,compositeTitleBackground:s,nodeBorder:l}=r;const u=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-id",t.id).attr("data-look",t.look);const d=u.insert("g",":first-child");const f=u.insert("g").attr("class","cluster-label");let h=u.append("rect");const m=await SR(f,t.label,t.labelStyle,void 0,true);let g=m.getBBox();if(oc(n)){const z=m.children[0];const U=zr(m);g=z.getBoundingClientRect();U.attr("width",g.width);U.attr("height",g.height)}const x=0*t.padding;const w=x/2;const _=(t.width<=g.width+t.padding?g.width+t.padding:t.width)+x;if(t.width<=g.width+t.padding){t.diff=(_-t.width)/2-t.padding}else{t.diff=-t.padding}const C=t.height+x;const A=t.height+x-g.height-6;const P=t.x-_/2;const L=t.y-C/2;t.width=_;const I=t.y-t.height/2-w+g.height+2;let N;if(t.look==="handDrawn"){const z=t.cssClasses.includes("statediagram-cluster-alt");const U=Uee.default.svg(u);const W=t.rx||t.ry?U.path(TL(P,L,_,C,10),{roughness:.7,fill:s,fillStyle:"solid",stroke:l,seed:i}):U.rectangle(P,L,_,C,{seed:i});N=u.insert(()=>W,":first-child");const H=U.rectangle(P,I,_,A,{fill:z?o:a,fillStyle:z?"hachure":"solid",stroke:l,seed:i});N=u.insert(()=>W,":first-child");h=u.insert(()=>H)}else{N=d.insert("rect",":first-child");const z="outer";N.attr("class",z).attr("x",P).attr("y",L).attr("width",_).attr("height",C).attr("data-look",t.look);h.attr("class","inner").attr("x",P).attr("y",I).attr("width",_).attr("height",A)}f.attr("transform",`translate(${t.x-g.width/2}, ${L+1-(oc(n)?0:3)})`);const O=N.node().getBBox();t.height=O.height;t.offsetX=0;t.offsetY=g.height-t.padding/2;t.labelBBox=g;t.intersect=function(z){return eB(t,z)};return{cluster:u,labelBBox:g}},"roundedWithTitle");W_i=B(async(e,t)=>{wt.info("Creating subgraph rect for ",t.id,t);const n=Mn();const{themeVariables:r,handDrawnSeed:i}=n;const{clusterBkg:o,clusterBorder:a}=r;const{labelStyles:s,nodeStyles:l,borderStyles:u,backgroundStyles:d}=Ro(t);const f=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look);const h=oc(n);const m=f.insert("g").attr("class","cluster-label ");const g=await Qh(m,t.label,{style:t.labelStyle,useHtmlLabels:h,isNode:true,width:t.width});let x=g.getBBox();if(oc(n)){const N=g.children[0];const O=zr(g);x=N.getBoundingClientRect();O.attr("width",x.width);O.attr("height",x.height)}const w=t.width<=x.width+t.padding?x.width+t.padding:t.width;if(t.width<=x.width+t.padding){t.diff=(w-t.width)/2-t.padding}else{t.diff=-t.padding}const _=t.height;const C=t.x-w/2;const A=t.y-_/2;wt.trace("Data ",t,JSON.stringify(t));let P;if(t.look==="handDrawn"){const N=Uee.default.svg(f);const O=$o(t,{roughness:.7,fill:o,stroke:a,fillWeight:4,seed:i});const z=N.path(TL(C,A,w,_,t.rx),O);P=f.insert(()=>{wt.debug("Rough node insert CXC",z);return z},":first-child");P.select("path:nth-child(2)").attr("style",u.join(";"));P.select("path").attr("style",d.join(";").replace("fill","stroke"))}else{P=f.insert("rect",":first-child");P.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",C).attr("y",A).attr("width",w).attr("height",_)}const{subGraphTitleTopMargin:L}=Sw(n);m.attr("transform",`translate(${t.x-x.width/2}, ${t.y-t.height/2+L})`);if(s){const N=m.select("span");if(N){N.attr("style",s)}}const I=P.node().getBBox();t.offsetX=0;t.width=I.width;t.height=I.height;t.offsetY=x.height-t.padding/2;t.intersect=function(N){return eB(t,N)};return{cluster:f,labelBBox:x}},"kanbanSection");Y_i=B((e,t)=>{const n=Mn();const{themeVariables:r,handDrawnSeed:i}=n;const{nodeBorder:o}=r;const a=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-look",t.look);const s=a.insert("g",":first-child");const l=0*t.padding;const u=t.width+l;t.diff=-t.padding;const d=t.height+l;const f=t.x-u/2;const h=t.y-d/2;t.width=u;let m;if(t.look==="handDrawn"){const x=Uee.default.svg(a);const w=x.rectangle(f,h,u,d,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:o,seed:i});m=a.insert(()=>w,":first-child")}else{m=s.insert("rect",":first-child");let x="outer";if(t.look==="neo"){x="divider"}else{x="divider"}m.attr("class",x).attr("x",f).attr("y",h).attr("width",u).attr("height",d).attr("data-look",t.look)}const g=m.node().getBBox();t.height=g.height;t.offsetX=0;t.offsetY=0;t.intersect=function(x){return eB(t,x)};return{cluster:a,labelBBox:{}}},"divider");q_i=mmn;X_i={rect:mmn,squareRect:q_i,roundedWithTitle:H_i,noteGroup:G_i,divider:Y_i,kanbanSection:W_i,swimlane:$_i};gmn=new Map;wL=B(async(e,t)=>{const n=t.shape||"rect";const r=await X_i[n](e,t);gmn.set(t.id,r);return r},"insertCluster");WEe=B(()=>{gmn=new Map},"clear");B(ymn,"intersectNode");j_i=ymn;B(bmn,"intersectEllipse");xmn=bmn;B(vmn,"intersectCircle");K_i=vmn;B(_mn,"intersectLine");B(PKe,"sameSign");Z_i=_mn;B(Tmn,"intersectPolygon");J_i=Tmn;Do={node:j_i,circle:K_i,ellipse:xmn,polygon:J_i,rect:eB};B(Emn,"anchor");B(IKe,"generateArcPoints");B(Smn,"calculateArcSagitta");B(Amn,"bowTieRect");B(AR,"insertPolygonShape");HEe=12;B(Rmn,"card");B(Imn,"choice");B(MKe,"circle");B(Dmn,"createLine");B(Fmn,"crossedCircle");B(ER,"generateCirclePoints");B(Omn,"curlyBraceLeft");B(CR,"generateCirclePoints");B(zmn,"curlyBraceRight");B(Ag,"generateCirclePoints");B(Vmn,"curlyBraces");B(Gmn,"curvedTrapezoid");Q_i=B((e,t,n,r,i,o)=>{return[`M${e},${t+o}`,`a${i},${o} 0,0,0 ${n},0`,`a${i},${o} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${o} 0,0,0 ${n},0`,`l0,${-r}`].join(" ")},"createCylinderPathD");eTi=B((e,t,n,r,i,o)=>{return[`M${e},${t+o}`,`M${e+n},${t+o}`,`a${i},${o} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${o} 0,0,0 ${n},0`,`l0,${-r}`].join(" ")},"createOuterCylinderPathD");tTi=B((e,t,n,r,i,o)=>{return[`M${e-n/2},${-r/2}`,`a${i},${o} 0,0,0 ${n},0`].join(" ")},"createInnerCylinderPathD");imn=8;omn=8;B(Wmn,"cylinder");B(R$,"drawRect");B(Xmn,"datastore");B(Kmn,"dividedRectangle");B(Jmn,"doublecircle");B(egn,"filledCircle");amn=10;smn=10;B(ngn,"flippedTriangle");B(ign,"forkJoin");B(agn,"halfRoundedRectangle");nTi=B((e,t,n,r,i)=>{return[`M${e+i},${t}`,`L${e+n-i},${t}`,`L${e+n},${t-r/2}`,`L${e+n-i},${t-r}`,`L${e+i},${t-r}`,`L${e},${t-r/2}`,"Z"].join(" ")},"createHexagonPathD");B(lgn,"hexagon");B(ugn,"hourglass");B(fgn,"icon");B(pgn,"iconCircle");B(ggn,"iconRounded");B(bgn,"iconSquare");B(vgn,"imageSquare");B(Tgn,"inv_trapezoid");B(wgn,"labelRect");B(Cgn,"lean_left");B(Agn,"lean_right");B(Rgn,"lightningBolt");rTi=B((e,t,n,r,i,o,a)=>{return[`M${e},${t+o}`,`a${i},${o} 0,0,0 ${n},0`,`a${i},${o} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${o} 0,0,0 ${n},0`,`l0,${-r}`,`M${e},${t+o+a}`,`a${i},${o} 0,0,0 ${n},0`].join(" ")},"createCylinderPathD");iTi=B((e,t,n,r,i,o,a)=>{return[`M${e},${t+o}`,`M${e+n},${t+o}`,`a${i},${o} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${o} 0,0,0 ${n},0`,`l0,${-r}`,`M${e},${t+o+a}`,`a${i},${o} 0,0,0 ${n},0`].join(" ")},"createOuterCylinderPathD");oTi=B((e,t,n,r,i,o)=>{return[`M${e-n/2},${-r/2}`,`a${i},${o} 0,0,0 ${n},0`].join(" ")},"createInnerCylinderPathD");lmn=10;cmn=10;B(Ign,"linedCylinder");B(Lgn,"linedWaveEdgedRect");B(Fgn,"multiRect");B(Ogn,"multiWaveEdgedRectangle");B(zgn,"note");aTi=B((e,t,n)=>{return[`M${e+n/2},${t}`,`L${e+n},${t-n/2}`,`L${e+n/2},${t-n}`,`L${e},${t-n/2}`,"Z"].join(" ")},"createDecisionBoxPathD");B(Vgn,"question");B(Ggn,"rect_left_inv_arrow");B(Wgn,"rectWithTitle");B(Ygn,"roundedRect");Q5=8;B(Xgn,"shadedProcess");B(Kgn,"slopedRect");B(Zgn,"squareRect");B(Qgn,"stadium");B(eyn,"state");B(nyn,"stateEnd");B(iyn,"stateStart");S$=8;B(ayn,"subroutine");AKe=.2;B(lyn,"taggedRect");B(uyn,"taggedWaveEdgedRectangle");B(dyn,"text");sTi=B((e,t,n,r,i,o)=>{return`M${e},${t} + a${i},${o} 0,0,1 ${0},${-r} + l${n},${0} + a${i},${o} 0,0,1 ${0},${r} + M${n},${-r} + a${i},${o} 0,0,0 ${0},${r} + l${-n},${0}`},"createCylinderPathD");lTi=B((e,t,n,r,i,o)=>{return[`M${e},${t}`,`M${e+n},${t}`,`a${i},${o} 0,0,0 ${0},${-r}`,`l${-n},0`,`a${i},${o} 0,0,0 ${0},${r}`,`l${n},0`].join(" ")},"createOuterCylinderPathD");cTi=B((e,t,n,r,i,o)=>{return[`M${e+n/2},${-r/2}`,`a${i},${o} 0,0,0 0,${r}`].join(" ")},"createInnerCylinderPathD");umn=5;dmn=10;B(hyn,"tiltedCylinder");B(myn,"trapezoid");B(yyn,"trapezoidalPentagon");fmn=10;hmn=10;B(xyn,"triangle");B(_yn,"waveEdgedRectangle");B(wyn,"waveRectangle");Yf=10;B(Cyn,"windowPane");pmn=new Set(["redux-color","redux-dark-color"]);uTi=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);B(LKe,"erBox");B(A$,"addText");B(k$,"lineToPolygon");B(kyn,"textHelper");B(Bee,"addText");B(Ryn,"classBox");B(Iyn,"requirementBox");B(GC,"addText");dTi=B(e=>{switch(e){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");B(Lyn,"kanbanItem");B(Fyn,"bang");B(Oyn,"cloud");B(Byn,"defaultMindmapNode");B(zyn,"mindmapCircle");fTi=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:Zgn},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:Ygn},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:Qgn},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:ayn},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:Wmn},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:Xmn},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:MKe},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:Fyn},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:Oyn},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:Vgn},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:lgn},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:Agn},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:Cgn},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:myn},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:Tgn},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:Jmn},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:dyn},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:Rmn},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:Xgn},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:iyn},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:nyn},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:ign},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:ugn},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:Omn},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:zmn},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:Vmn},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:Rgn},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:_yn},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:agn},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:hyn},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:Ign},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:Gmn},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:Kmn},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:xyn},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:Cyn},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:egn},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:yyn},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:ngn},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:Kgn},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:Ogn},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:Fgn},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:Amn},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:Fmn},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:uyn},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:lyn},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:wyn},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:Ggn},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:Lgn}];hTi=B(()=>{const e={state:eyn,choice:Imn,note:zgn,rectWithTitle:Wgn,labelRect:wgn,iconSquare:bgn,iconCircle:pgn,icon:fgn,iconRounded:ggn,imageSquare:vgn,anchor:Emn,kanbanItem:Lyn,mindmapCircle:zyn,defaultMindmapNode:Byn,classBox:Ryn,erBox:LKe,requirementBox:Iyn};const t=[...Object.entries(e),...fTi.flatMap(n=>{const r=[n.shortName,..."aliases"in n?n.aliases:[],..."internalAliases"in n?n.internalAliases:[]];return r.map(i=>[i,n.handler])})];return Object.fromEntries(t)},"generateShapeMap");Uyn=hTi();B(DKe,"isValidShape");YEe=new Map;B(kR,"insertNode");Vyn=B((e,t)=>{YEe.set(t.id,e)},"setNodeElem");qEe=B(()=>{YEe.clear()},"clear");tB=B(e=>{const t=YEe.get(e.id);wt.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const n=8;const r=e.diff||0;if(e.clusterNode){t.attr("transform","translate("+(e.x+r-e.width/2)+", "+(e.y-e.height/2-n)+")")}else{t.attr("transform","translate("+e.x+", "+e.y+")")}return r},"positionNode")});function Vee(e,t){if(e===void 0||t===void 0){return{angle:0,deltaX:0,deltaY:0}}e=af(e);t=af(t);const[n,r]=[e.x,e.y];const[i,o]=[t.x,t.y];const a=i-n;const s=o-r;return{angle:Math.atan(s/a),deltaX:a,deltaY:s}}var I_,ep,FKe,af,XEe;var K0=Ce(()=>{Yo();I_=B((e,t)=>{if(t){return"translate("+-e.width/2+", "+-e.height/2+")"}const n=e.x??0;const r=e.y??0;return"translate("+-(n+e.width/2)+", "+-(r+e.height/2)+")"},"computeLabelTransform");ep={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5};FKe={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};B(Vee,"calculateDeltaAndAngle");af=B(e=>{if(Array.isArray(e)){return{x:e[0],y:e[1]}}return e},"pointTransformer");XEe=B(e=>{return{x:B(function(t,n,r){let i=0;const o=af(r[0]).x=0?1:-1)}else if(n===r.length-1&&Object.hasOwn(ep,e.arrowTypeEnd)){const{angle:m,deltaX:g}=Vee(r[r.length-1],r[r.length-2]);i=ep[e.arrowTypeEnd]*Math.cos(m)*(g>=0?1:-1)}const a=Math.abs(af(t).x-af(r[r.length-1]).x);const s=Math.abs(af(t).y-af(r[r.length-1]).y);const l=Math.abs(af(t).x-af(r[0]).x);const u=Math.abs(af(t).y-af(r[0]).y);const d=ep[e.arrowTypeStart];const f=ep[e.arrowTypeEnd];const h=1;if(a0&&s0&&u=0?1:-1)}else if(n===r.length-1&&Object.hasOwn(ep,e.arrowTypeEnd)){const{angle:m,deltaY:g}=Vee(r[r.length-1],r[r.length-2]);i=ep[e.arrowTypeEnd]*Math.abs(Math.sin(m))*(g>=0?1:-1)}const a=Math.abs(af(t).y-af(r[r.length-1]).y);const s=Math.abs(af(t).x-af(r[r.length-1]).x);const l=Math.abs(af(t).y-af(r[0]).y);const u=Math.abs(af(t).x-af(r[0]).x);const d=ep[e.arrowTypeStart];const f=ep[e.arrowTypeEnd];const h=1;if(a0&&s0&&u{e("should calculate the angle and deltas between two points",()=>{t(Vee([0,0],[0,1])).toStrictEqual({angle:1.5707963267948966,deltaX:0,deltaY:1});t(Vee([1,0],[0,-1])).toStrictEqual({angle:.7853981633974483,deltaX:-1,deltaY:-1});t(Vee({x:1,y:0},[0,-1])).toStrictEqual({angle:.7853981633974483,deltaX:-1,deltaY:-1});t(Vee({x:1,y:0},{x:1,y:0})).toStrictEqual({angle:NaN,deltaX:0,deltaY:0})});e("should calculate the angle and deltas if one point in undefined",()=>{t(Vee(void 0,[0,1])).toStrictEqual({angle:0,deltaX:0,deltaY:0});t(Vee([0,1],void 0)).toStrictEqual({angle:0,deltaX:0,deltaY:0})})})}});function Gee(e,t){if(oc(Mn())&&e){e.style.width=t.length*9+"px";e.style.height="12px"}}function Yyn(e){const t=[];const n=[];for(let r=1;r5&&Math.abs(o.y-i.y)>5){t.push(o);n.push(r)}else if(i.y===o.y&&o.x===a.x&&Math.abs(o.x-i.x)>5&&Math.abs(o.y-a.y)>5){t.push(o);n.push(r)}}return{cornerPoints:t,cornerPointPositions:n}}function qyn(e,t){if(e.length<2){return""}let n="";const r=e.length;const i=1e-5;for(let o=0;o({...i}));if(e.length>=2&&ep[t.arrowTypeStart]){const i=ep[t.arrowTypeStart];const o=e[0];const a=e[1];const{angle:s}=NKe(o,a);const l=i*Math.cos(s);const u=i*Math.sin(s);n[0].x=o.x+l;n[0].y=o.y+u}const r=e.length;if(r>=2&&ep[t.arrowTypeEnd]){const i=ep[t.arrowTypeEnd];const o=e[r-1];const a=e[r-2];const{angle:s}=NKe(a,o);const l=i*Math.cos(s);const u=i*Math.sin(s);n[r-1].x=o.x-l;n[r-1].y=o.y-u}return n}var Wyn,pTi,mTi,gTi,$yn,yTi,P$,qf,jEe,$ee,nB,KEe,bTi,xTi,vTi,Gyn,Hyn,_Ti,TTi,I$,wTi,ETi,CTi,STi,ATi,kTi,RTi,PTi,ITi,MTi,LTi,DTi,FTi,NTi,OTi,BTi,zTi,UTi,VTi,$Ti,GTi,HTi,WTi,YTi,M$;var yx=Ce(()=>{kg();Eg();K0();Sg();Np();nl();Ta();Aa();Yo();ks();Wyn=Ui(jo(),1);pTi=B((e,t,n,r,i,o=false,a)=>{if(t.arrowTypeStart){$yn(e,"start",t.arrowTypeStart,n,r,i,o,a)}if(t.arrowTypeEnd){$yn(e,"end",t.arrowTypeEnd,n,r,i,o,a)}},"addEdgeMarkers");mTi={arrow_cross:{type:"cross",fill:false},arrow_point:{type:"point",fill:true},arrow_barb:{type:"barb",fill:true},arrow_barb_neo:{type:"barb",fill:true},arrow_circle:{type:"circle",fill:false},aggregation:{type:"aggregation",fill:false},extension:{type:"extension",fill:false},composition:{type:"composition",fill:true},dependency:{type:"dependency",fill:true},lollipop:{type:"lollipop",fill:false},only_one:{type:"onlyOne",fill:false},zero_or_one:{type:"zeroOrOne",fill:false},one_or_more:{type:"oneOrMore",fill:false},zero_or_more:{type:"zeroOrMore",fill:false},requirement_arrow:{type:"requirement_arrow",fill:false},requirement_contains:{type:"requirement_contains",fill:false}};gTi=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"];$yn=B((e,t,n,r,i,o,a=false,s)=>{const l=mTi[n];const u=l&&gTi.includes(l.type);if(!l){wt.warn(`Unknown arrow type: ${n}`);return}const d=l.type;const f=t==="start"?"Start":"End";const h=a&&u?"-margin":"";const m=`${i}_${o}-${d}${f}${h}`;if(s&&s.trim()!==""){const g=s.replace(/[^\dA-Za-z]/g,"_");const x=`${m}_${g}`;if(!document.getElementById(x)){const w=document.getElementById(m);if(w){const _=w.cloneNode(true);_.id=x;const C=_.querySelectorAll("path, circle, line");C.forEach(A=>{A.setAttribute("stroke",s);if(l.fill){A.setAttribute("fill",s)}});w.parentNode?.appendChild(_)}}e.attr(`marker-${t}`,`url(${r}#${x})`)}else{e.attr(`marker-${t}`,`url(${r}#${m})`)}},"addEdgeMarker");yTi=B(e=>{return typeof e==="string"?e:Mn()?.flowchart?.curve},"resolveEdgeCurveType");P$=new Map;qf=new Map;jEe=B(()=>{P$.clear();qf.clear()},"clear");$ee=B(e=>{if(!e){return""}if(typeof e==="string"){return e}return e.reduce((t,n)=>t+";"+n,"")},"getLabelStyles");nB=B(async(e,t)=>{const n=Mn();let r=oc(n);const{labelStyles:i}=Ro(t);t.labelStyle=i;const o=e.insert("g").attr("class","edgeLabel");const a=o.insert("g").attr("class","label").attr("data-id",t.id);const s=t.labelType==="markdown";const l=void 0;const u=await Qh(e,t.label,{style:$ee(t.labelStyle),useHtmlLabels:r,addSvgBackground:true,isNode:false,markdown:s,width:s?l:void 0},n);a.node().appendChild(u);wt.info("abc82",t,t.labelType);let d=u.getBBox();let f=d;if(r){const m=u.children[0];const g=zr(u);d=m.getBoundingClientRect();f=d;g.attr("width",d.width);g.attr("height",d.height)}else{const m=zr(u).select("text").node();if(m&&typeof m.getBBox==="function"){f=m.getBBox()}}a.attr("transform",I_(f,r));P$.set(t.id,o);t.width=d.width;t.height=d.height;let h;if(t.startLabelLeft){const m=e.insert("g").attr("class","edgeTerminals");const g=m.insert("g").attr("class","inner");const x=await SR(g,t.startLabelLeft,$ee(t.labelStyle)||"",false,false);h=x;let w=x.getBBox();if(r){const _=x.children[0];const C=zr(x);w=_.getBoundingClientRect();C.attr("width",w.width);C.attr("height",w.height)}g.attr("transform",I_(w,r));if(!qf.get(t.id)){qf.set(t.id,{})}qf.get(t.id).startLeft=m;Gee(h,t.startLabelLeft)}if(t.startLabelRight){const m=e.insert("g").attr("class","edgeTerminals");const g=m.insert("g").attr("class","inner");const x=await SR(g,t.startLabelRight,$ee(t.labelStyle)||"",false,false);h=x;let w=x.getBBox();if(r){const _=x.children[0];const C=zr(x);w=_.getBoundingClientRect();C.attr("width",w.width);C.attr("height",w.height)}g.attr("transform",I_(w,r));if(!qf.get(t.id)){qf.set(t.id,{})}qf.get(t.id).startRight=m;Gee(h,t.startLabelRight)}if(t.endLabelLeft){const m=e.insert("g").attr("class","edgeTerminals");const g=m.insert("g").attr("class","inner");const x=await SR(m,t.endLabelLeft,$ee(t.labelStyle)||"",false,false);h=x;let w=x.getBBox();if(r){const _=x.children[0];const C=zr(x);w=_.getBoundingClientRect();C.attr("width",w.width);C.attr("height",w.height)}g.attr("transform",I_(w,r));if(!qf.get(t.id)){qf.set(t.id,{})}qf.get(t.id).endLeft=m;Gee(h,t.endLabelLeft)}if(t.endLabelRight){const m=e.insert("g").attr("class","edgeTerminals");const g=m.insert("g").attr("class","inner");const x=await SR(m,t.endLabelRight,$ee(t.labelStyle)||"",false,false);h=x;let w=x.getBBox();if(r){const _=x.children[0];const C=zr(x);w=_.getBoundingClientRect();C.attr("width",w.width);C.attr("height",w.height)}g.attr("transform",I_(w,r));if(!qf.get(t.id)){qf.set(t.id,{})}qf.get(t.id).endRight=m;Gee(h,t.endLabelRight)}return u},"insertEdgeLabel");B(Gee,"setTerminalWidth");KEe=B((e,t)=>{wt.debug("Moving label abc88 ",e.id,e.label,P$.get(e.id),t);let n=t.updatedPath?t.updatedPath:t.originalPath;const r=Mn();const{subGraphTitleTotalMargin:i}=Sw(r);if(e.label){const o=P$.get(e.id);let a=e.x;let s=e.y;if(n){const l=Ko.calcLabelPosition(n);wt.debug("Moving label "+e.label+" from (",a,",",s,") to (",l.x,",",l.y,") abc88");if(t.updatedPath){a=l.x;s=l.y}}o.attr("transform",`translate(${a}, ${s+i/2})`)}if(e.startLabelLeft){const o=qf.get(e.id).startLeft;let a=e.x;let s=e.y;if(n){const l=Ko.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",n);a=l.x;s=l.y}o.attr("transform",`translate(${a}, ${s})`)}if(e.startLabelRight){const o=qf.get(e.id).startRight;let a=e.x;let s=e.y;if(n){const l=Ko.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",n);a=l.x;s=l.y}o.attr("transform",`translate(${a}, ${s})`)}if(e.endLabelLeft){const o=qf.get(e.id).endLeft;let a=e.x;let s=e.y;if(n){const l=Ko.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",n);a=l.x;s=l.y}o.attr("transform",`translate(${a}, ${s})`)}if(e.endLabelRight){const o=qf.get(e.id).endRight;let a=e.x;let s=e.y;if(n){const l=Ko.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",n);a=l.x;s=l.y}o.attr("transform",`translate(${a}, ${s})`)}},"positionEdgeLabel");bTi=B((e,t)=>{if(!e?.isLabelEdge||!e?.id?.endsWith("-to-label")||!Array.isArray(t)){return t}if(t.length!==2){return t}const[n,r]=t;const i=Math.abs(r.x-n.x);const o=Math.abs(r.y-n.y);if(i<.001||o<.001){return t}if(o>=i){return[n,{x:n.x,y:r.y},r]}return[n,{x:r.x,y:n.y},r]},"orthogonalizeToLabelClippedPoints");xTi=B((e,t)=>{const n=e.x;const r=e.y;const i=Math.abs(t.x-n);const o=Math.abs(t.y-r);const a=e.width/2;const s=e.height/2;return i>=a||o>=s},"outsideNode");vTi=B((e,t,n)=>{wt.debug(`intersection calc abc89: + outsidePoint: ${JSON.stringify(t)} + insidePoint : ${JSON.stringify(n)} + node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const r=e.x;const i=e.y;const o=Math.abs(r-n.x);const a=e.width/2;let s=n.xMath.abs(r-t.x)*l){let f=n.y{wt.warn("abc88 cutPathAtIntersect",e,t);let n=[];let r=e[0];let i=false;e.forEach(o=>{wt.info("abc88 checking point",o,t);if(!xTi(t,o)&&!i){const a=vTi(t,r,o);wt.debug("abc88 inside",o,r,a);wt.debug("abc88 intersection",a,t);let s=false;n.forEach(l=>{s=s||l.x===a.x&&l.y===a.y});if(!n.some(l=>l.x===a.x&&l.y===a.y)){n.push(a)}else{wt.warn("abc88 no intersect",a,n)}i=true}else{wt.warn("abc88 outside",o,r);r=o;if(!i){n.push(o)}}});wt.debug("returning points",n);return n},"cutPathAtIntersect");B(Yyn,"extractCornerPoints");Hyn=B(function(e,t,n){const r=t.x-e.x;const i=t.y-e.y;const o=Math.sqrt(r*r+i*i);const a=n/o;return{x:t.x-a*r,y:t.y-a*i}},"findAdjacentPoint");_Ti=B(function(e){const{cornerPointPositions:t}=Yyn(e);const n=[];for(let r=0;r10&&Math.abs(o.y-i.y)>=10){wt.debug("Corner point fixing",Math.abs(o.x-i.x),Math.abs(o.y-i.y));const m=5;if(a.x===s.x){h={x:u<0?s.x-m+f:s.x+m-f,y:d<0?s.y-f:s.y+f}}else{h={x:u<0?s.x-f:s.x+f,y:d<0?s.y-m+f:s.y+m-f}}}else{wt.debug("Corner point skipping fixing",Math.abs(o.x-i.x),Math.abs(o.y-i.y))}n.push(h,l)}else{n.push(e[r])}}return n},"fixCorners");TTi=B((e,t,n)=>{const r=e-t-n;const i=2;const o=2;const a=i+o;const s=Math.floor(r/a);const l=Array(s).fill(`${i} ${o}`).join(" ");const u=`0 ${t} ${l} ${n}`;return u},"generateDashArray");I$=B(function(e,t,n,r,i,o,a,s=false){if(!a){throw new Error(`insertEdge: missing diagramId for edge "${t.id}" \u2014 edge IDs require a diagram prefix for uniqueness`)}const{handDrawnSeed:l,layout:u}=Mn();let d=t.points;let f=false;const h=i;var m=o;const g=[];for(const J in t.cssCompiledStyles){if(Tee(J)){continue}g.push(t.cssCompiledStyles[J])}if(u==="swimlane"){if(m.intersect&&h.intersect&&Array.isArray(d)&&d.length>=2){if(d.length===2){d=[h.intersect(d[0]),m.intersect(d[1])]}else{const J=d.slice(1,-1);const oe=J[0];const se=J[J.length-1];const re=.5;const ce=Math.abs(d[d.length-1].x-se.x)!Number.isNaN(J.y));const _=yTi(t.curve);if(_!=="rounded"){w=_Ti(w)}let C=I1;switch(_){case"linear":C=I1;break;case"basis":C=UE;break;case"cardinal":C=yK;break;case"bumpX":C=fK;break;case"bumpY":C=hK;break;case"catmullRom":C=aO;break;case"monotoneX":C=sO;break;case"monotoneY":C=vK;break;case"natural":C=_K;break;case"step":C=TK;break;case"stepAfter":C=EK;break;case"stepBefore":C=wK;break;case"rounded":C=I1;break;default:C=UE}const{x:A,y:P}=XEe(t);const L=Wb().x(A).y(P).curve(C);let I;switch(t.thickness){case"normal":I="edge-thickness-normal";break;case"thick":I="edge-thickness-thick";break;case"invisible":I="edge-thickness-invisible";break;default:I="edge-thickness-normal"}switch(t.pattern){case"solid":I+=" edge-pattern-solid";break;case"dotted":I+=" edge-pattern-dotted";break;case"dashed":I+=" edge-pattern-dashed";break;default:I+=" edge-pattern-solid"}let N;let O=_==="rounded"?qyn(Xyn(w,t),5):L(w);const z=Array.isArray(t.style)?t.style:[t.style];let U=z.find(J=>J?.startsWith("stroke:"));let W="";if(t.animate){W="edge-animation-fast"}if(t.animation){W="edge-animation-"+t.animation}let H=false;if(t.look==="handDrawn"){const J=Wyn.default.svg(e);Object.assign([],w);const oe=J.path(O,{roughness:.3,seed:l});I+=" transition";N=zr(oe).select("path").attr("id",`${a}-${t.id}`).attr("class"," "+I+(t.classes?" "+t.classes:"")+(W?" "+W:"")).attr("style",z?z.reduce((re,ce)=>re+";"+ce,""):"");let se=N.attr("d");N.attr("d",se);e.node().appendChild(N.node())}else{const J=g.join(";");const oe=z?z.reduce((be,Ie)=>be+Ie+";",""):"";const se=(J?J+";"+oe+";":oe)+";"+(z?z.reduce((be,Ie)=>be+";"+Ie,""):"");N=e.append("path").attr("d",O).attr("id",`${a}-${t.id}`).attr("class"," "+I+(t.classes?" "+t.classes:"")+(W?" "+W:"")).attr("style",se);U=se.match(/stroke:([^;]+)/)?.[1];H=t.animate===true||!!t.animation||J.includes("animation");const re=N.node();const ce=typeof re.getTotalLength==="function"?re.getTotalLength():0;const ue=FKe[t.arrowTypeStart]||0;const xe=FKe[t.arrowTypeEnd]||0;if(t.look==="neo"&&!H){const be=t.pattern==="dotted"||t.pattern==="dashed"?TTi(ce,ue,xe):`0 ${ue} ${ce-ue-xe} ${xe}`;const Ie=`stroke-dasharray: ${be}; stroke-dashoffset: 0;`;N.attr("style",Ie+N.attr("style"))}}N.attr("data-edge",true);N.attr("data-et","edge");N.attr("data-id",t.id);N.attr("data-points",x);N.attr("data-look",Zh(t.look));if(t.showPoints){w.forEach(J=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",J.x).attr("cy",J.y)})}let $="";if(Mn().flowchart.arrowMarkerAbsolute||Mn().state.arrowMarkerAbsolute){$=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search;$=$.replace(/\(/g,"\\(").replace(/\)/g,"\\)")}wt.info("arrowTypeStart",t.arrowTypeStart);wt.info("arrowTypeEnd",t.arrowTypeEnd);const K=!H&&t?.look==="neo";pTi(N,t,$,a,r,K,U);const X=Math.floor(d.length/2);const j=d[X];if(!Ko.isLabelCoordinateInPath(j,N.attr("d"))){f=true}let te={};if(f){te.updatedPath=d}te.originalPath=t.points;return te},"insertEdge");B(qyn,"generateRoundedPath");B(NKe,"calculateDeltaAndAngle");B(Xyn,"applyMarkerOffsetsToPoints");wTi=B((e,t,n,r)=>{t.forEach(i=>{YTi[i](e,n,r)})},"insertMarkers");ETi=B((e,t,n)=>{wt.trace("Making markers for ",n);e.append("defs").append("marker").attr("id",n+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,7 L18,13 V 1 Z");e.append("defs").append("marker").attr("id",n+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z");e.append("marker").attr("id",n+"_"+t+"-extensionStart-margin").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,7 18,13 18,1").style("stroke-width",2).style("stroke-dasharray","0");e.append("defs").append("marker").attr("id",n+"_"+t+"-extensionEnd-margin").attr("class","marker extension "+t).attr("refX",9).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,1 10,13 18,7").style("stroke-width",2).style("stroke-dasharray","0")},"extension");CTi=B((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z");e.append("defs").append("marker").attr("id",n+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z");e.append("defs").append("marker").attr("id",n+"_"+t+"-compositionStart-margin").attr("class","marker composition "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("viewBox","0 0 15 15").attr("d","M 18,7 L9,13 L1,7 L9,1 Z");e.append("defs").append("marker").attr("id",n+"_"+t+"-compositionEnd-margin").attr("class","marker composition "+t).attr("refX",3.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition");STi=B((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z");e.append("defs").append("marker").attr("id",n+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z");e.append("defs").append("marker").attr("id",n+"_"+t+"-aggregationStart-margin").attr("class","marker aggregation "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z");e.append("defs").append("marker").attr("id",n+"_"+t+"-aggregationEnd-margin").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation");ATi=B((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z");e.append("defs").append("marker").attr("id",n+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z");e.append("defs").append("marker").attr("id",n+"_"+t+"-dependencyStart-margin").attr("class","marker dependency "+t).attr("refX",4).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 5,7 L9,13 L1,7 L9,1 Z");e.append("defs").append("marker").attr("id",n+"_"+t+"-dependencyEnd-margin").attr("class","marker dependency "+t).attr("refX",16).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency");kTi=B((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6);e.append("defs").append("marker").attr("id",n+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6);e.append("defs").append("marker").attr("id",n+"_"+t+"-lollipopStart-margin").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2);e.append("defs").append("marker").attr("id",n+"_"+t+"-lollipopEnd-margin").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2)},"lollipop");RTi=B((e,t,n)=>{e.append("marker").attr("id",n+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0");e.append("marker").attr("id",n+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0");e.append("marker").attr("id",n+"_"+t+"-pointEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",11.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10.5).attr("markerHeight",14).attr("orient","auto").append("path").attr("d","M 0 0 L 11.5 7 L 0 14 z").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0");e.append("marker").attr("id",n+"_"+t+"-pointStart-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",1).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11.5).attr("markerHeight",14).attr("orient","auto").append("polygon").attr("points","0,7 11.5,14 11.5,0").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"point");PTi=B((e,t,n)=>{e.append("marker").attr("id",n+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0");e.append("marker").attr("id",n+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0");e.append("marker").attr("id",n+"_"+t+"-circleEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refY",5).attr("refX",12.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0");e.append("marker").attr("id",n+"_"+t+"-circleStart-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"circle");ITi=B((e,t,n)=>{e.append("marker").attr("id",n+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0");e.append("marker").attr("id",n+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0");e.append("marker").attr("id",n+"_"+t+"-crossEnd-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",17.7).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5);e.append("marker").attr("id",n+"_"+t+"-crossStart-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",-3.5).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5).style("stroke-dasharray","1,0")},"cross");MTi=B((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb");LTi=B((e,t,n)=>{const r=Ji();const{themeVariables:i}=r;const{transitionColor:o}=i;e.append("defs").append("marker").attr("id",n+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z");e.append("defs").append("marker").attr("id",n+"_"+t+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${o}`)},"barbNeo");DTi=B((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18");e.append("defs").append("marker").attr("id",n+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one");FTi=B((e,t,n)=>{const r=e.append("defs").append("marker").attr("id",n+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");r.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6);r.append("path").attr("d","M9,0 L9,18");const i=e.append("defs").append("marker").attr("id",n+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6);i.append("path").attr("d","M21,0 L21,18")},"zero_or_one");NTi=B((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27");e.append("defs").append("marker").attr("id",n+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more");OTi=B((e,t,n)=>{const r=e.append("defs").append("marker").attr("id",n+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");r.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6);r.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const i=e.append("defs").append("marker").attr("id",n+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6);i.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more");BTi=B((e,t,n)=>{const r=Ji();const{themeVariables:i}=r;const{strokeWidth:o}=i;e.append("defs").append("marker").attr("id",n+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${o}`);e.append("defs").append("marker").attr("id",n+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${o}`)},"only_one_neo");zTi=B((e,t,n)=>{const r=Ji();const{themeVariables:i}=r;const{strokeWidth:o,mainBkg:a}=i;const s=e.append("defs").append("marker").attr("id",n+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");s.append("circle").attr("fill",a??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${o}`).attr("r",6);s.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${o}`);const l=e.append("defs").append("marker").attr("id",n+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");l.append("circle").attr("fill",a??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${o}`).attr("r",6);l.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${o}`)},"zero_or_one_neo");UTi=B((e,t,n)=>{const r=Ji();const{themeVariables:i}=r;const{strokeWidth:o}=i;e.append("defs").append("marker").attr("id",n+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${o}`);e.append("defs").append("marker").attr("id",n+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${o}`)},"one_or_more_neo");VTi=B((e,t,n)=>{const r=Ji();const{themeVariables:i}=r;const{strokeWidth:o,mainBkg:a}=i;const s=e.append("defs").append("marker").attr("id",n+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");s.append("circle").attr("fill",a??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${o}`);s.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${o}`);const l=e.append("defs").append("marker").attr("id",n+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");l.append("circle").attr("fill",a??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${o}`);l.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${o}`)},"zero_or_more_neo");$Ti=B((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0 + L20,10 + M20,10 + L0,20`)},"requirement_arrow");GTi=B((e,t,n)=>{const r=Ji();const{themeVariables:i}=r;const{strokeWidth:o}=i;e.append("defs").append("marker").attr("id",n+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${o}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0 + L20,10 + M20,10 + L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo");HTi=B((e,t,n)=>{const r=e.append("defs").append("marker").attr("id",n+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");r.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none");r.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10);r.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains");WTi=B((e,t,n)=>{const r=Ji();const{themeVariables:i}=r;const{strokeWidth:o}=i;const a=e.append("defs").append("marker").attr("id",n+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");a.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none");a.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10);a.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10);a.selectAll("*").attr("stroke-width",`${o}`)},"requirement_contains_neo");YTi={extension:ETi,composition:CTi,aggregation:STi,dependency:ATi,lollipop:kTi,point:RTi,circle:PTi,cross:ITi,barb:MTi,barbNeo:LTi,only_one:DTi,zero_or_one:FTi,one_or_more:NTi,zero_or_more:OTi,only_one_neo:BTi,zero_or_one_neo:zTi,one_or_more_neo:UTi,zero_or_more_neo:VTi,requirement_arrow:$Ti,requirement_contains:HTi,requirement_arrow_neo:GTi,requirement_contains_neo:WTi};M$=wTi});function Kyn(e,t){if(e[t]){e[t]++}else{e[t]=1}}function Zyn(e,t){if(!--e[t]){delete e[t]}}function Hee(e,t,n,r){var i=""+t;var o=""+n;if(!e&&i>o){var a=i;i=o;o=a}return i+jyn+o+jyn+(ns(r)?qTi:r)}function XTi(e,t,n,r){var i=""+t;var o=""+n;if(!e&&i>o){var a=i;i=o;o=a}var s={v:i,w:o};if(r){s.name=r}return s}function OKe(e,t){return Hee(e,t.v,t.w,t.name)}var qTi,rB,jyn,fc;var ZEe=Ce(()=>{oa();qTi="\0";rB="\0";jyn="";fc=class{constructor(t={}){this._isDirected=Object.prototype.hasOwnProperty.call(t,"directed")?t.directed:true;this._isMultigraph=Object.prototype.hasOwnProperty.call(t,"multigraph")?t.multigraph:false;this._isCompound=Object.prototype.hasOwnProperty.call(t,"compound")?t.compound:false;this._label=void 0;this._defaultNodeLabelFn=Dd(void 0);this._defaultEdgeLabelFn=Dd(void 0);this._nodes={};if(this._isCompound){this._parent={};this._children={};this._children[rB]={}}this._in={};this._preds={};this._out={};this._sucs={};this._edgeObjs={};this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){this._label=t;return this}graph(){return this._label}setDefaultNodeLabel(t){if(!W1(t)){t=Dd(t)}this._defaultNodeLabelFn=t;return this}nodeCount(){return this._nodeCount}nodes(){return hu(this._nodes)}sources(){var t=this;return pu(this.nodes(),function(n){return _5(t._in[n])})}sinks(){var t=this;return pu(this.nodes(),function(n){return _5(t._out[n])})}setNodes(t,n){var r=arguments;var i=this;Rn(t,function(o){if(r.length>1){i.setNode(o,n)}else{i.setNode(o)}});return this}setNode(t,n){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){if(arguments.length>1){this._nodes[t]=n}return this}this._nodes[t]=arguments.length>1?n:this._defaultNodeLabelFn(t);if(this._isCompound){this._parent[t]=rB;this._children[t]={};this._children[rB][t]=true}this._in[t]={};this._preds[t]={};this._out[t]={};this._sucs[t]={};++this._nodeCount;return this}node(t){return this._nodes[t]}hasNode(t){return Object.prototype.hasOwnProperty.call(this._nodes,t)}removeNode(t){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){var n=r=>this.removeEdge(this._edgeObjs[r]);delete this._nodes[t];if(this._isCompound){this._removeFromParentsChildList(t);delete this._parent[t];Rn(this.children(t),r=>{this.setParent(r)});delete this._children[t]}Rn(hu(this._in[t]),n);delete this._in[t];delete this._preds[t];Rn(hu(this._out[t]),n);delete this._out[t];delete this._sucs[t];--this._nodeCount}return this}setParent(t,n){if(!this._isCompound){throw new Error("Cannot set parent in a non-compound graph")}if(ns(n)){n=rB}else{n+="";for(var r=n;!ns(r);r=this.parent(r)){if(r===t){throw new Error("Setting "+n+" as parent of "+t+" would create a cycle")}}this.setNode(n)}this.setNode(t);this._removeFromParentsChildList(t);this._parent[t]=n;this._children[n][t]=true;return this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var n=this._parent[t];if(n!==rB){return n}}}children(t){if(ns(t)){t=rB}if(this._isCompound){var n=this._children[t];if(n){return hu(n)}}else if(t===rB){return this.nodes()}else if(this.hasNode(t)){return[]}}predecessors(t){var n=this._preds[t];if(n){return hu(n)}}successors(t){var n=this._sucs[t];if(n){return hu(n)}}neighbors(t){var n=this.predecessors(t);if(n){return _Q(n,this.successors(t))}}isLeaf(t){var n;if(this.isDirected()){n=this.successors(t)}else{n=this.neighbors(t)}return n.length===0}filterNodes(t){var n=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});n.setGraph(this.graph());var r=this;Rn(this._nodes,function(a,s){if(t(s)){n.setNode(s,a)}});Rn(this._edgeObjs,function(a){if(n.hasNode(a.v)&&n.hasNode(a.w)){n.setEdge(a,r.edge(a))}});var i={};function o(a){var s=r.parent(a);if(s===void 0||n.hasNode(s)){i[a]=s;return s}else if(s in i){return i[s]}else{return o(s)}}if(this._isCompound){Rn(n.nodes(),function(a){n.setParent(a,o(a))})}return n}setDefaultEdgeLabel(t){if(!W1(t)){t=Dd(t)}this._defaultEdgeLabelFn=t;return this}edgeCount(){return this._edgeCount}edges(){return Nd(this._edgeObjs)}setPath(t,n){var r=this;var i=arguments;kp(t,function(o,a){if(i.length>1){r.setEdge(o,a,n)}else{r.setEdge(o,a)}return a});return this}setEdge(){var t,n,r,i;var o=false;var a=arguments[0];if(typeof a==="object"&&a!==null&&"v"in a){t=a.v;n=a.w;r=a.name;if(arguments.length===2){i=arguments[1];o=true}}else{t=a;n=arguments[1];r=arguments[3];if(arguments.length>2){i=arguments[2];o=true}}t=""+t;n=""+n;if(!ns(r)){r=""+r}var s=Hee(this._isDirected,t,n,r);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,s)){if(o){this._edgeLabels[s]=i}return this}if(!ns(r)&&!this._isMultigraph){throw new Error("Cannot set a named edge when isMultigraph = false")}this.setNode(t);this.setNode(n);this._edgeLabels[s]=o?i:this._defaultEdgeLabelFn(t,n,r);var l=XTi(this._isDirected,t,n,r);t=l.v;n=l.w;Object.freeze(l);this._edgeObjs[s]=l;Kyn(this._preds[n],t);Kyn(this._sucs[t],n);this._in[n][s]=l;this._out[t][s]=l;this._edgeCount++;return this}edge(t,n,r){var i=arguments.length===1?OKe(this._isDirected,arguments[0]):Hee(this._isDirected,t,n,r);return this._edgeLabels[i]}hasEdge(t,n,r){var i=arguments.length===1?OKe(this._isDirected,arguments[0]):Hee(this._isDirected,t,n,r);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(t,n,r){var i=arguments.length===1?OKe(this._isDirected,arguments[0]):Hee(this._isDirected,t,n,r);var o=this._edgeObjs[i];if(o){t=o.v;n=o.w;delete this._edgeLabels[i];delete this._edgeObjs[i];Zyn(this._preds[n],t);Zyn(this._sucs[t],n);delete this._in[n][i];delete this._out[t][i];this._edgeCount--}return this}inEdges(t,n){var r=this._in[t];if(r){var i=Nd(r);if(!n){return i}return pu(i,function(o){return o.v===n})}}outEdges(t,n){var r=this._out[t];if(r){var i=Nd(r);if(!n){return i}return pu(i,function(o){return o.w===n})}}nodeEdges(t,n){var r=this.inEdges(t,n);if(r){return r.concat(this.outEdges(t,n))}}};fc.prototype._nodeCount=0;fc.prototype._edgeCount=0});var iv=Ce(()=>{ZEe()});function Rw(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:jTi(e),edges:KTi(e)};if(!ns(e.graph())){t.value=hYe(e.graph())}return t}function jTi(e){return na(e.nodes(),function(t){var n=e.node(t);var r=e.parent(t);var i={v:t};if(!ns(n)){i.value=n}if(!ns(r)){i.parent=r}return i})}function KTi(e){return na(e.edges(),function(t){var n=e.edge(t);var r={v:t.v,w:t.w};if(!ns(t.name)){r.name=t.name}if(!ns(n)){r.value=n}return r})}var BKe=Ce(()=>{oa();ZEe()});var _s,EL,e0n,JEe,iB,ZTi,zKe,t0n,JTi,oB,Qyn,n0n,r0n,i0n,o0n,a0n,QTi;var UKe=Ce(()=>{Aa();Yo();iv();BKe();_s=new Map;EL=new Map;e0n=new Map;JEe=B(()=>{EL.clear();e0n.clear();_s.clear()},"clear");iB=B((e,t)=>{const n=EL.get(t)||[];wt.trace("In isDescendant",t," ",e," = ",n.includes(e));return n.includes(e)},"isDescendant");ZTi=B((e,t)=>{const n=EL.get(t)||[];wt.info("Descendants of ",t," is ",n);wt.info("Edge is ",e);if(e.v===t||e.w===t){return false}if(!n){wt.debug("Tilt, ",t,",not in descendants");return false}return n.includes(e.v)||iB(e.v,t)||iB(e.w,t)||n.includes(e.w)},"edgeInCluster");zKe=B((e,t,n,r)=>{wt.warn("Copying children of ",e,"root",r,"data",t.node(e),r);const i=t.children(e)||[];if(e!==r){i.push(e)}wt.warn("Copying (nodes) clusterId",e,"nodes",i);i.forEach(o=>{if(t.children(o).length>0){zKe(o,t,n,r)}else{const a=t.node(o);wt.info("cp ",o," to ",r," with parent ",e);n.setNode(o,a);if(r!==t.parent(o)){wt.warn("Setting parent",o,t.parent(o));n.setParent(o,t.parent(o))}if(e!==r&&o!==e){wt.debug("Setting parent",o,e);n.setParent(o,e)}else{wt.info("In copy ",e,"root",r,"data",t.node(e),r);wt.debug("Not Setting parent for node=",o,"cluster!==rootId",e!==r,"node!==clusterId",o!==e)}const s=t.edges(o);wt.debug("Copying Edges",s);s.forEach(l=>{wt.info("Edge",l);const u=t.edge(l.v,l.w,l.name);wt.info("Edge data",u,r);try{if(ZTi(l,r)){const d=EL.get(r)||[];const f=d.includes(l.v)||iB(l.v,r)||l.v===r;const h=d.includes(l.w)||iB(l.w,r)||l.w===r;if(f&&h){wt.info("Copying as ",l.v,l.w,u,l.name);n.setEdge(l.v,l.w,u,l.name);wt.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))}else{const m=f?r:l.v;const g=h?r:l.w;wt.info("Rebinding cross-boundary edge as ",m,g,u,l.name);t.setEdge(m,g,u,l.name)}}else{wt.info("Skipping copy of edge ",l.v,"-->",l.w," rootId: ",r," clusterId:",e)}}catch(d){wt.error(d)}})}wt.debug("Removing node",o);t.removeNode(o)})},"copy");t0n=B((e,t)=>{const n=t.children(e);let r=[...n];for(const i of n){e0n.set(i,e);r=[...r,...t0n(i,t)]}return r},"extractDescendants");JTi=B((e,t,n)=>{const r=e.edges().filter(l=>l.v===t||l.w===t);const i=e.edges().filter(l=>l.v===n||l.w===n);const o=r.map(l=>{return{v:l.v===t?n:l.v,w:l.w===t?t:l.w}});const a=i.map(l=>{return{v:l.v,w:l.w}});const s=o.filter(l=>{return a.some(u=>l.v===u.v&&l.w===u.w)});return s},"findCommonEdges");oB=B((e,t,n)=>{const r=t.children(e);wt.trace("Searching children of id ",e,r);if(r.length<1){return e}let i;for(const o of r){const a=oB(o,t,n);const s=JTi(t,n,a);if(a){if(s.length>0){i=a}else{return a}}}return i},"findNonClusterChild");Qyn=B(e=>{if(!_s.has(e)){return e}if(!_s.get(e).externalConnections){return e}if(_s.has(e)){return _s.get(e).id}return e},"getAnchorId");n0n=B((e,t)=>{if(!e||t>10){wt.debug("Opting out, no graph ");return}else{wt.debug("Opting in, graph ")}e.nodes().forEach(function(n){const r=e.children(n);if(r.length>0){wt.warn("Cluster identified",n," Replacement id in edges: ",oB(n,e,n));EL.set(n,t0n(n,e));_s.set(n,{id:oB(n,e,n),clusterData:e.node(n)})}});e.nodes().forEach(function(n){const r=e.children(n);const i=e.edges();if(r.length>0){wt.debug("Cluster identified",n,EL);i.forEach(o=>{const a=iB(o.v,n);const s=iB(o.w,n);if(a^s){wt.warn("Edge: ",o," leaves cluster ",n);wt.warn("Descendants of XXX ",n,": ",EL.get(n));_s.get(n).externalConnections=true}})}else{wt.debug("Not a cluster ",n,EL)}});for(let n of _s.keys()){const r=_s.get(n).id;const i=e.parent(r);if(i!==n&&_s.has(i)&&!_s.get(i).externalConnections){_s.get(n).id=i}const o=e.edges().some(a=>a.v===n);if(r&&_s.get(n)?.externalConnections&&o&&a0n(e,r,n)){const a=QTi(e,n,e.parent(r));if(a){_s.get(n).id=a}}}e.edges().forEach(function(n){const r=e.edge(n);wt.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n));wt.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let i=n.v;let o=n.w;wt.warn("Fix XXX",_s,"ids:",n.v,n.w,"Translating: ",_s.get(n.v)," --- ",_s.get(n.w));if(_s.get(n.v)||_s.get(n.w)){wt.warn("Fixing and trying - removing XXX",n.v,n.w,n.name);i=Qyn(n.v);o=Qyn(n.w);e.removeEdge(n.v,n.w,n.name);if(i!==n.v){const a=e.parent(i);_s.get(a).externalConnections=true;r.fromCluster=n.v}if(o!==n.w){const a=e.parent(o);_s.get(a).externalConnections=true;r.toCluster=n.w}wt.warn("Fix Replacing with XXX",i,o,n.name);e.setEdge(i,o,r,n.name)}});wt.warn("Adjusted Graph",Rw(e));r0n(e,0);wt.trace(_s)},"adjustClustersAndEdges");r0n=B((e,t)=>{wt.warn("extractor - ",t,Rw(e),e.children("D"));if(t>10){wt.error("Bailing out");return}let n=e.nodes();let r=false;for(const i of n){const o=e.children(i);r=r||o.length>0}if(!r){wt.debug("Done, no node has children",e.nodes());return}wt.debug("Nodes = ",n,t);for(const i of n){wt.debug("Extracting node",i,_s,_s.has(i)&&!_s.get(i).externalConnections,!e.parent(i),e.node(i),e.children("D")," Depth ",t);if(!_s.has(i)){wt.debug("Not a cluster",i,t)}else if(_s.get(i)?.clusterData?.explicitDir&&e.children(i)&&e.children(i).length>0){wt.warn("Cluster with explicit dir, creating subgraph for children",i,t);const o=_s.get(i).clusterData.dir;const a=new fc({multigraph:true,compound:true}).setGraph({rankdir:o,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});zKe(i,e,a,i);const s=e.node(i)||{};e.setNode(i,{...s,clusterNode:true,id:i,clusterData:_s.get(i).clusterData,label:_s.get(i).label,graph:a});wt.warn("Subgraph for cluster with explicit dir created:",i,Rw(a))}else if(!_s.get(i).externalConnections&&e.children(i)&&e.children(i).length>0){wt.warn("Cluster without external connections, without a parent and with children",i,t);const o=e.graph();let a=o.rankdir==="TB"?"LR":"TB";if(_s.get(i)?.clusterData?.dir){a=_s.get(i).clusterData.dir;wt.warn("Fixing dir",_s.get(i).clusterData.dir,a)}const s=new fc({multigraph:true,compound:true}).setGraph({rankdir:a,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});zKe(i,e,s,i);const l=e.node(i)||{};e.setNode(i,{...l,clusterNode:true,id:i,clusterData:_s.get(i).clusterData,label:_s.get(i).label,graph:s});wt.debug("Old graph after copy",Rw(e))}else{wt.warn("Cluster ** ",i," **not meeting the criteria !externalConnections:",!_s.get(i).externalConnections," no parent: ",!e.parent(i)," children ",e.children(i)&&e.children(i).length>0,e.children("D"),t);wt.debug(_s)}}n=e.nodes();wt.warn("New list of nodes",n);for(const i of n){const o=e.node(i);wt.warn(" Now next level",i,o);if(o?.clusterNode){r0n(o.graph,t+1)}}},"extractor");i0n=B((e,t)=>{if(t.length===0){return[]}let n=Object.assign([],t);t.forEach(r=>{const i=e.children(r);const o=i0n(e,i);n=[...n,...o]});return n},"sorter");o0n=B(e=>i0n(e,e.children()),"sortNodesByHierarchy");a0n=B((e,t,n)=>{let r=e.parent(t);while(r&&r!==n){const i=_s.get(r);if(i&&!i.externalConnections){return true}r=e.parent(r)}return false},"isNodeInExtractableCluster");QTi=B((e,t,n)=>{const r=e.children(t)??[];for(const i of r){if(i===n||iB(i,n)){continue}const o=oB(i,e,t);if(!o){continue}if(!a0n(e,o,t)){return o}}return null},"findSafeAnchorNode")});function s0n(e){e._prev._next=e._next;e._next._prev=e._prev;delete e._next;delete e._prev}function ewi(e,t){if(e!=="_next"&&e!=="_prev"){return t}}var QEe;var l0n=Ce(()=>{QEe=class{constructor(){var t={};t._next=t._prev=t;this._sentinel=t}dequeue(){var t=this._sentinel;var n=t._prev;if(n!==t){s0n(n);return n}}enqueue(t){var n=this._sentinel;if(t._prev&&t._next){s0n(t)}t._next=n._next;n._next._prev=t;n._next=t;t._prev=n}toString(){var t=[];var n=this._sentinel;var r=n._prev;while(r!==n){t.push(JSON.stringify(r,ewi));r=r._prev}return"["+t.join(", ")+"]"}}});function c0n(e,t){if(e.nodeCount()<=1){return[]}var n=rwi(e,t||twi);var r=nwi(n.graph,n.buckets,n.zeroIdx);return ph(na(r,function(i){return e.outEdges(i.v,i.w)}))}function nwi(e,t,n){var r=[];var i=t[t.length-1];var o=t[0];var a;while(e.nodeCount()){while(a=o.dequeue()){VKe(e,t,n,a)}while(a=i.dequeue()){VKe(e,t,n,a)}if(e.nodeCount()){for(var s=t.length-2;s>0;--s){a=t[s].dequeue();if(a){r=r.concat(VKe(e,t,n,a,true));break}}}}return r}function VKe(e,t,n,r,i){var o=i?[]:void 0;Rn(e.inEdges(r.v),function(a){var s=e.edge(a);var l=e.node(a.v);if(i){o.push({v:a.v,w:a.w})}l.out-=s;$Ke(t,n,l)});Rn(e.outEdges(r.v),function(a){var s=e.edge(a);var l=a.w;var u=e.node(l);u["in"]-=s;$Ke(t,n,u)});e.removeNode(r.v);return o}function rwi(e,t){var n=new fc;var r=0;var i=0;Rn(e.nodes(),function(s){n.setNode(s,{v:s,in:0,out:0})});Rn(e.edges(),function(s){var l=n.edge(s.v,s.w)||0;var u=t(s);var d=l+u;n.setEdge(s.v,s.w,d);i=Math.max(i,n.node(s.v).out+=u);r=Math.max(r,n.node(s.w)["in"]+=u)});var o=Tf(i+r+3).map(function(){return new QEe});var a=r+1;Rn(n.nodes(),function(s){$Ke(o,a,n.node(s))});return{graph:n,buckets:o,zeroIdx:a}}function $Ke(e,t,n){if(!n.out){e[0].enqueue(n)}else if(!n["in"]){e[e.length-1].enqueue(n)}else{e[n.out-n["in"]+t].enqueue(n)}}var twi;var u0n=Ce(()=>{oa();iv();l0n();twi=Dd(1)});function d0n(e){var t=e.graph().acyclicer==="greedy"?c0n(e,n(e)):iwi(e);Rn(t,function(r){var i=e.edge(r);e.removeEdge(r);i.forwardName=r.name;i.reversed=true;e.setEdge(r.w,r.v,i,K1("rev"))});function n(r){return function(i){return r.edge(i).weight}}}function iwi(e){var t=[];var n={};var r={};function i(o){if(Object.prototype.hasOwnProperty.call(r,o)){return}r[o]=true;n[o]=true;Rn(e.outEdges(o),function(a){if(Object.prototype.hasOwnProperty.call(n,a.w)){t.push(a)}else{i(a.w)}});delete n[o]}Rn(e.nodes(),i);return t}function f0n(e){Rn(e.edges(),function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed;delete n.forwardName;e.setEdge(t.w,t.v,n,r)}})}var GKe=Ce(()=>{oa();u0n()});function HC(e,t,n,r){var i;do{i=K1(r)}while(e.hasNode(i));n.dummy=t;e.setNode(i,n);return i}function p0n(e){var t=new fc().setGraph(e.graph());Rn(e.nodes(),function(n){t.setNode(n,e.node(n))});Rn(e.edges(),function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1};var i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})});return t}function eCe(e){var t=new fc({multigraph:e.isMultigraph()}).setGraph(e.graph());Rn(e.nodes(),function(n){if(!e.children(n).length){t.setNode(n,e.node(n))}});Rn(e.edges(),function(n){t.setEdge(n,e.edge(n))});return t}function HKe(e,t){var n=e.x;var r=e.y;var i=t.x-n;var o=t.y-r;var a=e.width/2;var s=e.height/2;if(!i&&!o){throw new Error("Not possible to find intersection inside of the rectangle")}var l,u;if(Math.abs(o)*a>Math.abs(i)*s){if(o<0){s=-s}l=s*i/o;u=s}else{if(i<0){a=-a}l=a;u=a*o/i}return{x:n+l,y:r+u}}function CL(e){var t=na(Tf(YKe(e)+1),function(){return[]});Rn(e.nodes(),function(n){var r=e.node(n);var i=r.rank;if(!ns(i)){t[i][r.order]=n}});return t}function m0n(e){var t=xg(na(e.nodes(),function(n){return e.node(n).rank}));Rn(e.nodes(),function(n){var r=e.node(n);if(cR(r,"rank")){r.rank-=t}})}function g0n(e){var t=xg(na(e.nodes(),function(o){return e.node(o).rank}));var n=[];Rn(e.nodes(),function(o){var a=e.node(o).rank-t;if(!n[a]){n[a]=[]}n[a].push(o)});var r=0;var i=e.graph().nodeRankFactor;Rn(n,function(o,a){if(ns(o)&&a%i!==0){--r}else if(r){Rn(o,function(s){e.node(s).rank+=r})}})}function WKe(e,t,n,r){var i={width:0,height:0};if(arguments.length>=4){i.rank=n;i.order=r}return HC(e,"border",i,t)}function YKe(e){return Hu(na(e.nodes(),function(t){var n=e.node(t).rank;if(!ns(n)){return n}}))}function y0n(e,t){var n={lhs:[],rhs:[]};Rn(e,function(r){if(t(r)){n.lhs.push(r)}else{n.rhs.push(r)}});return n}function b0n(e,t){var n=v5();try{return t()}finally{console.log(e+" time: "+(v5()-n)+"ms")}}function x0n(e,t){return t()}var WC=Ce(()=>{oa();iv()});function _0n(e){function t(n){var r=e.children(n);var i=e.node(n);if(r.length){Rn(r,t)}if(Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[];i.borderRight=[];for(var o=i.minRank,a=i.maxRank+1;o{oa();WC()});function E0n(e){var t=e.graph().rankdir.toLowerCase();if(t==="lr"||t==="rl"){S0n(e)}}function C0n(e){var t=e.graph().rankdir.toLowerCase();if(t==="bt"||t==="rl"){owi(e)}if(t==="lr"||t==="rl"){awi(e);S0n(e)}}function S0n(e){Rn(e.nodes(),function(t){w0n(e.node(t))});Rn(e.edges(),function(t){w0n(e.edge(t))})}function w0n(e){var t=e.width;e.width=e.height;e.height=t}function owi(e){Rn(e.nodes(),function(t){qKe(e.node(t))});Rn(e.edges(),function(t){var n=e.edge(t);Rn(n.points,qKe);if(Object.prototype.hasOwnProperty.call(n,"y")){qKe(n)}})}function qKe(e){e.y=-e.y}function awi(e){Rn(e.nodes(),function(t){XKe(e.node(t))});Rn(e.edges(),function(t){var n=e.edge(t);Rn(n.points,XKe);if(Object.prototype.hasOwnProperty.call(n,"x")){XKe(n)}})}function XKe(e){var t=e.x;e.x=e.y;e.y=t}var A0n=Ce(()=>{oa()});function k0n(e){e.graph().dummyChains=[];Rn(e.edges(),function(t){lwi(e,t)})}function lwi(e,t){var n=t.v;var r=e.node(n).rank;var i=t.w;var o=e.node(i).rank;var a=t.name;var s=e.edge(t);var l=s.labelRank;if(o===r+1)return;e.removeEdge(t);var u=void 0;var d,f;for(f=0,++r;r{oa();WC()});function Yee(e){var t={};function n(r){var i=e.node(r);if(Object.prototype.hasOwnProperty.call(t,r)){return i.rank}t[r]=true;var o=xg(na(e.outEdges(r),function(a){return n(a.w)-e.edge(a).minlen}));if(o===Number.POSITIVE_INFINITY||o===void 0||o===null){o=0}return i.rank=o}Rn(e.sources(),n)}function aB(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var tCe=Ce(()=>{oa()});function nCe(e){var t=new fc({directed:false});var n=e.nodes()[0];var r=e.nodeCount();t.setNode(n,{});var i,o;while(cwi(t,e){oa();iv();tCe()});var I0n=Ce(()=>{});var ZKe=Ce(()=>{});var ABa;var JKe=Ce(()=>{oa();ZKe();ABa=Dd(1)});var M0n=Ce(()=>{JKe()});var QKe=Ce(()=>{});var L0n=Ce(()=>{QKe()});var DBa;var D0n=Ce(()=>{oa();DBa=Dd(1)});function eZe(e){var t={};var n={};var r=[];function i(o){if(Object.prototype.hasOwnProperty.call(n,o)){throw new qee}if(!Object.prototype.hasOwnProperty.call(t,o)){n[o]=true;t[o]=true;Rn(e.predecessors(o),i);delete n[o];r.push(o)}}Rn(e.sinks(),i);if(vQ(t)!==e.nodeCount()){throw new qee}return r}function qee(){}var tZe=Ce(()=>{oa();eZe.CycleException=qee;qee.prototype=new Error});var F0n=Ce(()=>{tZe()});function rCe(e,t,n){if(!Us(t)){t=[t]}var r=(e.isDirected()?e.successors:e.neighbors).bind(e);var i=[];var o={};Rn(t,function(a){if(!e.hasNode(a)){throw new Error("Graph does not have node: "+a)}N0n(e,a,n==="post",o,r,i)});return i}function N0n(e,t,n,r,i,o){if(!Object.prototype.hasOwnProperty.call(r,t)){r[t]=true;if(!n){o.push(t)}Rn(i(t),function(a){N0n(e,a,n,r,i,o)});if(n){o.push(t)}}}var nZe=Ce(()=>{oa()});function rZe(e,t){return rCe(e,t,"post")}var O0n=Ce(()=>{nZe()});function iZe(e,t){return rCe(e,t,"pre")}var B0n=Ce(()=>{nZe()});var z0n=Ce(()=>{ZKe();ZEe()});var U0n=Ce(()=>{I0n();JKe();M0n();L0n();D0n();F0n();O0n();B0n();z0n();QKe();tZe()});function AL(e){e=p0n(e);Yee(e);var t=nCe(e);aZe(t);oZe(t,e);var n,r;while(n=H0n(t)){r=W0n(t,e,n);Y0n(t,e,n,r)}}function oZe(e,t){var n=rZe(e,e.nodes());n=n.slice(0,n.length-1);Rn(n,function(r){gwi(e,t,r)})}function gwi(e,t,n){var r=e.node(n);var i=r.parent;e.edge(n,i).cutvalue=$0n(e,t,n)}function $0n(e,t,n){var r=e.node(n);var i=r.parent;var o=true;var a=t.edge(n,i);var s=0;if(!a){o=false;a=t.edge(i,n)}s=a.weight;Rn(t.nodeEdges(n),function(l){var u=l.v===n,d=u?l.w:l.v;if(d!==i){var f=u===o,h=t.edge(l).weight;s+=f?h:-h;if(bwi(e,n,d)){var m=e.edge(n,d).cutvalue;s+=f?-m:m}}});return s}function aZe(e,t){if(arguments.length<2){t=e.nodes()[0]}G0n(e,{},1,t)}function G0n(e,t,n,r,i){var o=n;var a=e.node(r);t[r]=true;Rn(e.neighbors(r),function(s){if(!Object.prototype.hasOwnProperty.call(t,s)){n=G0n(e,t,n,s,r)}});a.low=o;a.lim=n++;if(i){a.parent=i}else{delete a.parent}return n}function H0n(e){return xw(e.edges(),function(t){return e.edge(t).cutvalue<0})}function W0n(e,t,n){var r=n.v;var i=n.w;if(!t.hasEdge(r,i)){r=n.w;i=n.v}var o=e.node(r);var a=e.node(i);var s=o;var l=false;if(o.lim>a.lim){s=a;l=true}var u=pu(t.edges(),function(d){return l===V0n(e,e.node(d.v),s)&&l!==V0n(e,e.node(d.w),s)});return X1(u,function(d){return aB(t,d)})}function Y0n(e,t,n,r){var i=n.v;var o=n.w;e.removeEdge(i,o);e.setEdge(r.v,r.w,{});aZe(e);oZe(e,t);ywi(e,t)}function ywi(e,t){var n=xw(e.nodes(),function(i){return!t.node(i).parent});var r=iZe(e,n);r=r.slice(1);Rn(r,function(i){var o=e.node(i).parent,a=t.edge(i,o),s=false;if(!a){a=t.edge(o,i);s=true}t.node(i).rank=t.node(o).rank+(s?a.minlen:-a.minlen)})}function bwi(e,t,n){return e.hasEdge(t,n)}function V0n(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var q0n=Ce(()=>{oa();U0n();WC();KKe();tCe();AL.initLowLimValues=aZe;AL.initCutValues=oZe;AL.calcCutValue=$0n;AL.leaveEdge=H0n;AL.enterEdge=W0n;AL.exchangeEdges=Y0n});function sZe(e){switch(e.graph().ranker){case"network-simplex":X0n(e);break;case"tight-tree":vwi(e);break;case"longest-path":xwi(e);break;default:X0n(e)}}function vwi(e){Yee(e);nCe(e)}function X0n(e){AL(e)}var xwi;var lZe=Ce(()=>{KKe();q0n();tCe();xwi=Yee});function j0n(e){var t=HC(e,"root",{},"_root");var n=_wi(e);var r=Hu(Nd(n))-1;var i=2*r+1;e.graph().nestingRoot=t;Rn(e.edges(),function(a){e.edge(a).minlen*=i});var o=Twi(e)+1;Rn(e.children(),function(a){K0n(e,t,i,o,r,n,a)});e.graph().nodeRankFactor=i}function K0n(e,t,n,r,i,o,a){var s=e.children(a);if(!s.length){if(a!==t){e.setEdge(t,a,{weight:0,minlen:n})}return}var l=WKe(e,"_bt");var u=WKe(e,"_bb");var d=e.node(a);e.setParent(l,a);d.borderTop=l;e.setParent(u,a);d.borderBottom=u;Rn(s,function(f){K0n(e,t,n,r,i,o,f);var h=e.node(f);var m=h.borderTop?h.borderTop:f;var g=h.borderBottom?h.borderBottom:f;var x=h.borderTop?r:2*r;var w=m!==g?1:i-o[a]+1;e.setEdge(l,m,{weight:x,minlen:w,nestingEdge:true});e.setEdge(g,u,{weight:x,minlen:w,nestingEdge:true})});if(!e.parent(a)){e.setEdge(t,l,{weight:0,minlen:i+o[a]})}}function _wi(e){var t={};function n(r,i){var o=e.children(r);if(o&&o.length){Rn(o,function(a){n(a,i+1)})}t[r]=i}Rn(e.children(),function(r){n(r,1)});return t}function Twi(e){return kp(e.edges(),function(t,n){return t+e.edge(n).weight},0)}function Z0n(e){var t=e.graph();e.removeNode(t.nestingRoot);delete t.nestingRoot;Rn(e.edges(),function(n){var r=e.edge(n);if(r.nestingEdge){e.removeEdge(n)}})}var J0n=Ce(()=>{oa();WC()});function Q0n(e,t,n){var r={},i;Rn(n,function(o){var a=e.parent(o),s,l;while(a){s=e.parent(a);if(s){l=r[s];r[s]=a}else{l=i;i=a}if(l&&l!==a){t.setEdge(l,a);return}a=s}})}var ebn=Ce(()=>{oa()});function tbn(e,t,n){var r=Ewi(e),i=new fc({compound:true}).setGraph({root:r}).setDefaultNodeLabel(function(o){return e.node(o)});Rn(e.nodes(),function(o){var a=e.node(o),s=e.parent(o);if(a.rank===t||a.minRank<=t&&t<=a.maxRank){i.setNode(o);i.setParent(o,s||r);Rn(e[n](o),function(l){var u=l.v===o?l.w:l.v,d=i.edge(u,o),f=!ns(d)?d.weight:0;i.setEdge(u,o,{weight:e.edge(l).weight+f})});if(Object.prototype.hasOwnProperty.call(a,"minRank")){i.setNode(o,{borderLeft:a.borderLeft[t],borderRight:a.borderRight[t]})}}});return i}function Ewi(e){var t;while(e.hasNode(t=K1("_root")));return t}var nbn=Ce(()=>{oa();iv()});function rbn(e,t){var n=0;for(var r=1;r0){if(d%2){f+=s[d+1]}d=d-1>>1;s[d]+=u.weight}l+=u.weight*f}));return l}var ibn=Ce(()=>{oa()});function obn(e){var t={};var n=pu(e.nodes(),function(s){return!e.children(s).length});var r=Hu(na(n,function(s){return e.node(s).rank}));var i=na(Tf(r+1),function(){return[]});function o(s){if(cR(t,s))return;t[s]=true;var l=e.node(s);i[l.rank].push(s);Rn(e.successors(s),o)}var a=Rp(n,function(s){return e.node(s).rank});Rn(a,o);return i}var abn=Ce(()=>{oa()});function sbn(e,t){return na(t,function(n){var r=e.inEdges(n);if(!r.length){return{v:n}}else{var i=kp(r,function(o,a){var s=e.edge(a),l=e.node(a.v);return{sum:o.sum+s.weight*l.order,weight:o.weight+s.weight}},{sum:0,weight:0});return{v:n,barycenter:i.sum/i.weight,weight:i.weight}}})}var lbn=Ce(()=>{oa()});function cbn(e,t){var n={};Rn(e,function(i,o){var a=n[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:o};if(!ns(i.barycenter)){a.barycenter=i.barycenter;a.weight=i.weight}});Rn(t.edges(),function(i){var o=n[i.v];var a=n[i.w];if(!ns(o)&&!ns(a)){a.indegree++;o.out.push(n[i.w])}});var r=pu(n,function(i){return!i.indegree});return Swi(r)}function Swi(e){var t=[];function n(o){return function(a){if(a.merged){return}if(ns(a.barycenter)||ns(o.barycenter)||a.barycenter>=o.barycenter){Awi(o,a)}}}function r(o){return function(a){a["in"].push(o);if(--a.indegree===0){e.push(a)}}}while(e.length){var i=e.pop();t.push(i);Rn(i["in"].reverse(),n(i));Rn(i.out,r(i))}return na(pu(t,function(o){return!o.merged}),function(o){return j1(o,["vs","i","barycenter","weight"])})}function Awi(e,t){var n=0;var r=0;if(e.weight){n+=e.barycenter*e.weight;r+=e.weight}if(t.weight){n+=t.barycenter*t.weight;r+=t.weight}e.vs=t.vs.concat(e.vs);e.barycenter=n/r;e.weight=r;e.i=Math.min(t.i,e.i);t.merged=true}var ubn=Ce(()=>{oa()});function fbn(e,t){var n=y0n(e,function(d){return Object.prototype.hasOwnProperty.call(d,"barycenter")});var r=n.lhs,i=Rp(n.rhs,function(d){return-d.i}),o=[],a=0,s=0,l=0;r.sort(kwi(!!t));l=dbn(o,i,l);Rn(r,function(d){l+=d.vs.length;o.push(d.vs);a+=d.barycenter*d.weight;s+=d.weight;l=dbn(o,i,l)});var u={vs:ph(o)};if(s){u.barycenter=a/s;u.weight=s}return u}function dbn(e,t,n){var r;while(t.length&&(r=$0(t)).i<=n){t.pop();e.push(r.vs);n++}return n}function kwi(e){return function(t,n){if(t.barycentern.barycenter){return 1}return!e?t.i-n.i:n.i-t.i}}var hbn=Ce(()=>{oa();WC()});function cZe(e,t,n,r){var i=e.children(t);var o=e.node(t);var a=o?o.borderLeft:void 0;var s=o?o.borderRight:void 0;var l={};if(a){i=pu(i,function(g){return g!==a&&g!==s})}var u=sbn(e,i);Rn(u,function(g){if(e.children(g.v).length){var x=cZe(e,g.v,n,r);l[g.v]=x;if(Object.prototype.hasOwnProperty.call(x,"barycenter")){Pwi(g,x)}}});var d=cbn(u,n);Rwi(d,l);var f=fbn(d,r);if(a){f.vs=ph([a,f.vs,s]);if(e.predecessors(a).length){var h=e.node(e.predecessors(a)[0]),m=e.node(e.predecessors(s)[0]);if(!Object.prototype.hasOwnProperty.call(f,"barycenter")){f.barycenter=0;f.weight=0}f.barycenter=(f.barycenter*f.weight+h.order+m.order)/(f.weight+2);f.weight+=2}}return f}function Rwi(e,t){Rn(e,function(n){n.vs=ph(n.vs.map(function(r){if(t[r]){return t[r].vs}return r}))})}function Pwi(e,t){if(!ns(e.barycenter)){e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight);e.weight+=t.weight}else{e.barycenter=t.barycenter;e.weight=t.weight}}var pbn=Ce(()=>{oa();lbn();ubn();hbn()});function ybn(e){var t=YKe(e),n=mbn(e,Tf(1,t+1),"inEdges"),r=mbn(e,Tf(t-1,-1,-1),"outEdges");var i=obn(e);gbn(e,i);var o=Number.POSITIVE_INFINITY,a;for(var s=0,l=0;l<4;++s,++l){Iwi(s%2?n:r,s%4>=2);i=CL(e);var u=rbn(e,i);if(u{oa();iv();WC();ebn();nbn();ibn();abn();pbn()});function xbn(e){var t=Lwi(e);Rn(e.graph().dummyChains,function(n){var r=e.node(n);var i=r.edgeObj;var o=Mwi(e,t,i.v,i.w);var a=o.path;var s=o.lca;var l=0;var u=a[l];var d=true;while(n!==i.w){r=e.node(n);if(d){while((u=a[l])!==s&&e.node(u).maxRanka||s>t[l].lim));u=l;l=r;while((l=e.parent(l))!==u){o.push(l)}return{path:i.concat(o.reverse()),lca:u}}function Lwi(e){var t={};var n=0;function r(i){var o=n;Rn(e.children(i),r);t[i]={low:o,lim:n++}}Rn(e.children(),r);return t}var vbn=Ce(()=>{oa()});function Dwi(e,t){var n={};function r(i,o){var a=0,s=0,l=i.length,u=$0(o);Rn(o,function(d,f){var h=Nwi(e,d),m=h?e.node(h).order:l;if(h||d===u){Rn(o.slice(s,f+1),function(g){Rn(e.predecessors(g),function(x){var w=e.node(x),_=w.order;if((_u)){_bn(n,h,d)}})}})}function i(o,a){var s=-1,l,u=0;Rn(a,function(d,f){if(e.node(d).dummy==="border"){var h=e.predecessors(d);if(h.length){l=e.node(h[0]).order;r(a,u,f,s,l);u=f;s=l}}r(a,u,a.length,l,o.length)});return a}kp(t,i);return n}function Nwi(e,t){if(e.node(t).dummy){return xw(e.predecessors(t),function(n){return e.node(n).dummy})}}function _bn(e,t,n){if(t>n){var r=t;t=n;n=r}if(!Object.prototype.hasOwnProperty.call(e,t)){Object.defineProperty(e,t,{enumerable:true,configurable:true,value:{},writable:true})}var i=e[t];Object.defineProperty(i,n,{enumerable:true,configurable:true,value:true,writable:true})}function Owi(e,t,n){if(t>n){var r=t;t=n;n=r}return!!e[t]&&Object.prototype.hasOwnProperty.call(e[t],n)}function Bwi(e,t,n,r){var i={},o={},a={};Rn(t,function(s){Rn(s,function(l,u){i[l]=l;o[l]=l;a[l]=u})});Rn(t,function(s){var l=-1;Rn(s,function(u){var d=r(u);if(d.length){d=Rp(d,function(x){return a[x]});var f=(d.length-1)/2;for(var h=Math.floor(f),m=Math.ceil(f);h<=m;++h){var g=d[h];if(o[u]===u&&l{oa();iv();WC()});function Ebn(e){e=eCe(e);Ywi(e);xQ(Tbn(e),function(t,n){e.node(n).x=t})}function Ywi(e){var t=CL(e);var n=e.graph().ranksep;var r=0;Rn(t,function(i){var o=Hu(na(i,function(a){return e.node(a).height}));Rn(i,function(a){e.node(a).y=r+o/2});r+=o+n})}var Cbn=Ce(()=>{oa();WC();wbn()});function Xee(e,t){var n=t&&t.debugTiming?b0n:x0n;n("layout",()=>{var r=n(" buildLayoutGraph",()=>r2i(e));n(" runLayout",()=>qwi(r,n));n(" updateInputGraph",()=>Xwi(e,r))})}function qwi(e,t){t(" makeSpaceForEdgeLabels",()=>i2i(e));t(" removeSelfEdges",()=>h2i(e));t(" acyclic",()=>d0n(e));t(" nestingGraph.run",()=>j0n(e));t(" rank",()=>sZe(eCe(e)));t(" injectEdgeLabelProxies",()=>o2i(e));t(" removeEmptyRanks",()=>g0n(e));t(" nestingGraph.cleanup",()=>Z0n(e));t(" normalizeRanks",()=>m0n(e));t(" assignRankMinMax",()=>a2i(e));t(" removeEdgeLabelProxies",()=>s2i(e));t(" normalize.run",()=>k0n(e));t(" parentDummyChains",()=>xbn(e));t(" addBorderSegments",()=>_0n(e));t(" order",()=>ybn(e));t(" insertSelfEdges",()=>p2i(e));t(" adjustCoordinateSystem",()=>E0n(e));t(" position",()=>Ebn(e));t(" positionSelfEdges",()=>m2i(e));t(" removeBorderNodes",()=>f2i(e));t(" normalize.undo",()=>R0n(e));t(" fixupEdgeLabelCoords",()=>u2i(e));t(" undoCoordinateSystem",()=>C0n(e));t(" translateGraph",()=>l2i(e));t(" assignNodeIntersects",()=>c2i(e));t(" reversePoints",()=>d2i(e));t(" acyclic.undo",()=>f0n(e))}function Xwi(e,t){Rn(e.nodes(),function(n){var r=e.node(n);var i=t.node(n);if(r){r.x=i.x;r.y=i.y;if(t.children(n).length){r.width=i.width;r.height=i.height}}});Rn(e.edges(),function(n){var r=e.edge(n);var i=t.edge(n);r.points=i.points;if(Object.prototype.hasOwnProperty.call(i,"x")){r.x=i.x;r.y=i.y}});e.graph().width=t.graph().width;e.graph().height=t.graph().height}function r2i(e){var t=new fc({multigraph:true,compound:true});var n=dZe(e.graph());t.setGraph(vw({},Kwi,uZe(n,jwi),j1(n,Zwi)));Rn(e.nodes(),function(r){var i=dZe(e.node(r));t.setNode(r,mQ(uZe(i,Jwi),Qwi));t.setParent(r,e.parent(r))});Rn(e.edges(),function(r){var i=dZe(e.edge(r));t.setEdge(r,vw({},t2i,uZe(i,e2i),j1(i,n2i)))});return t}function i2i(e){var t=e.graph();t.ranksep/=2;Rn(e.edges(),function(n){var r=e.edge(n);r.minlen*=2;if(r.labelpos.toLowerCase()!=="c"){if(t.rankdir==="TB"||t.rankdir==="BT"){r.width+=r.labeloffset}else{r.height+=r.labeloffset}}})}function o2i(e){Rn(e.edges(),function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v);var i=e.node(t.w);var o={rank:(i.rank-r.rank)/2+r.rank,e:t};HC(e,"edge-proxy",o,"_ep")}})}function a2i(e){var t=0;Rn(e.nodes(),function(n){var r=e.node(n);if(r.borderTop){r.minRank=e.node(r.borderTop).rank;r.maxRank=e.node(r.borderBottom).rank;t=Hu(t,r.maxRank)}});e.graph().maxRank=t}function s2i(e){Rn(e.nodes(),function(t){var n=e.node(t);if(n.dummy==="edge-proxy"){e.edge(n.e).labelRank=n.rank;e.removeNode(t)}})}function l2i(e){var t=Number.POSITIVE_INFINITY;var n=0;var r=Number.POSITIVE_INFINITY;var i=0;var o=e.graph();var a=o.marginx||0;var s=o.marginy||0;function l(u){var d=u.x;var f=u.y;var h=u.width;var m=u.height;t=Math.min(t,d-h/2);n=Math.max(n,d+h/2);r=Math.min(r,f-m/2);i=Math.max(i,f+m/2)}Rn(e.nodes(),function(u){l(e.node(u))});Rn(e.edges(),function(u){var d=e.edge(u);if(Object.prototype.hasOwnProperty.call(d,"x")){l(d)}});t-=a;r-=s;Rn(e.nodes(),function(u){var d=e.node(u);d.x-=t;d.y-=r});Rn(e.edges(),function(u){var d=e.edge(u);Rn(d.points,function(f){f.x-=t;f.y-=r});if(Object.prototype.hasOwnProperty.call(d,"x")){d.x-=t}if(Object.prototype.hasOwnProperty.call(d,"y")){d.y-=r}});o.width=n-t+a;o.height=i-r+s}function c2i(e){Rn(e.edges(),function(t){var n=e.edge(t);var r=e.node(t.v);var i=e.node(t.w);var o,a;if(!n.points){n.points=[];o=i;a=r}else{o=n.points[0];a=n.points[n.points.length-1]}n.points.unshift(HKe(r,o));n.points.push(HKe(i,a))})}function u2i(e){Rn(e.edges(),function(t){var n=e.edge(t);if(Object.prototype.hasOwnProperty.call(n,"x")){if(n.labelpos==="l"||n.labelpos==="r"){n.width-=n.labeloffset}switch(n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}}})}function d2i(e){Rn(e.edges(),function(t){var n=e.edge(t);if(n.reversed){n.points.reverse()}})}function f2i(e){Rn(e.nodes(),function(t){if(e.children(t).length){var n=e.node(t);var r=e.node(n.borderTop);var i=e.node(n.borderBottom);var o=e.node($0(n.borderLeft));var a=e.node($0(n.borderRight));n.width=Math.abs(a.x-o.x);n.height=Math.abs(i.y-r.y);n.x=o.x+n.width/2;n.y=r.y+n.height/2}});Rn(e.nodes(),function(t){if(e.node(t).dummy==="border"){e.removeNode(t)}})}function h2i(e){Rn(e.edges(),function(t){if(t.v===t.w){var n=e.node(t.v);if(!n.selfEdges){n.selfEdges=[]}n.selfEdges.push({e:t,label:e.edge(t)});e.removeEdge(t)}})}function p2i(e){var t=CL(e);Rn(t,function(n){var r=0;Rn(n,function(i,o){var a=e.node(i);a.order=o+r;Rn(a.selfEdges,function(s){HC(e,"selfedge",{width:s.label.width,height:s.label.height,rank:a.rank,order:o+ ++r,e:s.e,label:s.label},"_se")});delete a.selfEdges})})}function m2i(e){Rn(e.nodes(),function(t){var n=e.node(t);if(n.dummy==="selfedge"){var r=e.node(n.e.v);var i=r.x+r.width/2;var o=r.y;var a=n.x-i;var s=r.height/2;e.setEdge(n.e,n.label);e.removeNode(t);n.label.points=[{x:i+2*a/3,y:o-s},{x:i+5*a/6,y:o-s},{x:i+a,y:o},{x:i+5*a/6,y:o+s},{x:i+2*a/3,y:o+s}];n.label.x=n.x;n.label.y=n.y}})}function uZe(e,t){return q1(j1(e,t),Number)}function dZe(e){var t={};Rn(e,function(n,r){t[r.toLowerCase()]=n});return t}var jwi,Kwi,Zwi,Jwi,Qwi,e2i,t2i,n2i;var Sbn=Ce(()=>{oa();iv();T0n();A0n();GKe();jKe();lZe();J0n();bbn();vbn();Cbn();WC();jwi=["nodesep","edgesep","ranksep","marginx","marginy"];Kwi={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"};Zwi=["acyclicer","ranker","rankdir","align"];Jwi=["width","height"];Qwi={width:0,height:0};e2i=["minlen","weight","width","height","labeloffset"];t2i={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"};n2i=["labelpos"]});var fZe=Ce(()=>{GKe();Sbn();jKe();lZe()});var Ibn={};Oo(Ibn,{getEdgesToRender:()=>Rbn,render:()=>v2i});var Abn,kbn,g2i,y2i,b2i,x2i,Rbn,Pbn,v2i;var Mbn=Ce(()=>{UKe();yx();kg();Eg();K0();Sg();Np();Jh();nl();Ta();Aa();Yo();fZe();BKe();iv();Abn=B((e,t,n)=>Math.max(t,Math.min(n,e)),"clamp");kbn=B((e="TB")=>{switch(e){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide");g2i=B(e=>e==="flowchart"||e==="flowchart-v2"||e==="stateDiagram","shouldMergeSelfLoopSegments");y2i=B((e,t,n,r,i)=>{const o=[];const a=new Set;n.forEach(({start:d,end:f})=>{if(d!==r){a.add(d)}if(f!==r){a.add(f)}});a.forEach(d=>{const f=e.node(d);if(typeof f?.x==="number"&&typeof f?.y==="number"){o.push(f)}});if(o.length===0){n.forEach(({edge:d})=>{(d.points??[]).forEach(f=>{if(typeof f?.x==="number"&&typeof f?.y==="number"){o.push(f)}})})}if(o.length===0){return kbn(i)}const s=o.reduce((d,f)=>({x:d.x+f.x/o.length,y:d.y+f.y/o.length}),{x:0,y:0});const l=s.x-t.x;const u=s.y-t.y;if(Math.abs(l)>Math.abs(u)){return l>0?"right":"left"}if(Math.abs(u)>0){return u>0?"bottom":"top"}return kbn(i)},"getSelfLoopSide");b2i=B((e,t="top",n=0,r=0)=>{const i=e.x;const o=e.y-n;const a=e.width/2;const s=e.height/2;const l=Math.max(36,Math.min(100,e.width*.8));const u=Abn(Math.max(r,e.width*.35),36,l);const d=Abn(Math.min(e.width,e.height)*.45,24,48);switch(t){case"bottom":{const f=o+s;return[{x:i-u/2,y:f},{x:i-u/2,y:f+d},{x:i+u/2,y:f+d},{x:i+u/2,y:f}]}case"right":{const f=i+a;return[{x:f,y:o-u/2},{x:f+d,y:o-u/2},{x:f+d,y:o+u/2},{x:f,y:o+u/2}]}case"left":{const f=i-a;return[{x:f,y:o-u/2},{x:f-d,y:o-u/2},{x:f-d,y:o+u/2},{x:f,y:o+u/2}]}case"top":default:{const f=o-s;return[{x:i-u/2,y:f},{x:i-u/2,y:f-d},{x:i+u/2,y:f-d},{x:i+u/2,y:f}]}}},"getSelfLoopPoints");x2i=B((e,t,n="top",r=0,i={})=>{const o=4;const a=e.x;const s=e.y-r;const l=i.width??0;const u=i.height??0;switch(n){case"bottom":return{x:a,y:Math.max(...t.map(d=>d.y))+u/2+o};case"right":return{x:Math.max(...t.map(d=>d.x))+l/2+o,y:s};case"left":return{x:Math.min(...t.map(d=>d.x))-l/2-o,y:s};case"top":default:return{x:a,y:Math.min(...t.map(d=>d.y))-u/2-o}}},"getSelfLoopLabelPosition");Rbn=B((e,t=0,{mergeSelfLoops:n=true}={})=>{const r=new Map;const i=[];const o=e.graph()?.rankdir;e.edges().forEach(a=>{const s=e.edge(a);if(n&&s.selfLoop){const l=s.selfLoop.id;if(!r.has(l)){r.set(l,[])}r.get(l).push({edge:s,start:a.v,end:a.w})}else{i.push({edge:s,start:a.v,end:a.w})}});r.forEach(a=>{if(a.length!==3){a.forEach(_=>i.push(_));return}a.sort((_,C)=>_.edge.selfLoop.order-C.edge.selfLoop.order);const[s,l,u]=a;const d=s.edge.originalEdge??l.edge.originalEdge??u.edge.originalEdge??l.edge;const f=e.node(d.start);if(!f){a.forEach(_=>i.push(_));return}const h={width:l.edge.width,height:l.edge.height};const m=y2i(e,f,a,d.start,o);const g=b2i(f,m,t,h.width??0);const x=x2i(f,g,m,t,h);const w={...l.edge,...d,id:d.id,points:g,start:d.start,end:d.end,x:x.x,y:x.y,width:h.width,height:h.height,labelStyle:l.edge.labelStyle,fromCluster:s.edge.fromCluster??l.edge.fromCluster??u.edge.fromCluster,toCluster:s.edge.toCluster??l.edge.toCluster??u.edge.toCluster};delete w.selfLoop;delete w.originalEdge;i.push({edge:w,start:w.start,end:w.end})});return i},"getEdgesToRender");Pbn=B(async(e,t,n,r,i,o)=>{wt.warn("Graph in recursive render:XAX",Rw(t),i);const a=t.graph().rankdir;wt.trace("Dir in recursive render - dir:",a);const s=e.insert("g").attr("class","root");if(!t.nodes()){wt.info("No nodes found for",t)}else{wt.info("Recursive render XXX",t.nodes())}if(t.edges().length>0){wt.info("Recursive edges",t.edge(t.edges()[0]))}const l=s.insert("g").attr("class","clusters");const u=s.insert("g").attr("class","edgePaths");const d=s.insert("g").attr("class","edgeLabels");const f=s.insert("g").attr("class","nodes");const h=g2i(n);await Promise.all(t.nodes().map(async function(C){const A=t.node(C);if(i!==void 0){const P=JSON.parse(JSON.stringify(i.clusterData));wt.trace("Setting data for parent cluster XXX\n Node.id = ",C,"\n data=",P.height,"\nParent cluster",i.height);t.setNode(i.id,P);if(!t.parent(C)){wt.trace("Setting parent",C,i.id);t.setParent(C,i.id,P)}}wt.info("(Insert) Node XXX"+C+": "+JSON.stringify(t.node(C)));if(A?.clusterNode){wt.info("Cluster identified XBX",C,A.width,t.node(C));const{ranksep:P,nodesep:L}=t.graph();A.graph.setGraph({...A.graph.graph(),ranksep:P+25,nodesep:L});const I=await Pbn(f,A.graph,n,r,t.node(C),o);const N=I.elem;Qo(A,N);A.diff=I.diff||0;wt.info("New compound node after recursive render XAX",C,"width",A.width,"height",A.height);Vyn(N,A)}else{if(t.children(C).length>0){wt.trace("Cluster - the non recursive path XBX",C,A.id,A,A.width,"Graph:",t);wt.trace(oB(A.id,t));_s.set(A.id,{id:oB(A.id,t),node:A})}else{wt.trace("Node - the non recursive path XAX",C,f,t.node(C),a);await kR(f,t.node(C),{config:o,dir:a})}}}));const m=B(async()=>{const C=t.edges().map(async function(A){const P=t.edge(A.v,A.w,A.name);wt.info("Edge "+A.v+" -> "+A.w+": "+JSON.stringify(A));wt.info("Edge "+A.v+" -> "+A.w+": ",A," ",JSON.stringify(t.edge(A)));wt.info("Fix",_s,"ids:",A.v,A.w,"Translating: ",_s.get(A.v),_s.get(A.w));if(h&&P.selfLoop){if(P.selfLoop.order!==1){return}const L=P.id;P.id=P.selfLoop.id;await nB(d,P);P.id=L;return}await nB(d,P)});await Promise.all(C)},"processEdges");await m();wt.info("Graph before layout:",JSON.stringify(Rw(t)));wt.info("############################################# XXX");wt.info("### Layout ### XXX");wt.info("############################################# XXX");Xee(t);wt.info("Graph after layout:",JSON.stringify(Rw(t)));let g=0;let{subGraphTitleTotalMargin:x}=Sw(o);await Promise.all(o0n(t).map(async function(C){const A=t.node(C);wt.info("Position XBX => "+C+": ("+A.x,","+A.y,") width: ",A.width," height: ",A.height);if(A?.clusterNode){A.y+=x;wt.info("A tainted cluster node XBX1",C,A.id,A.width,A.height,A.x,A.y,t.parent(C));_s.get(A.id).node=A;tB(A)}else{if(t.children(C).length>0){wt.info("A pure cluster node XBX1",C,A.id,A.x,A.y,A.width,A.height,t.parent(C));A.height+=x;t.node(A.parentId);const P=A?.padding/2||0;const L=A?.labelBBox?.height||0;const I=L-P||0;wt.debug("OffsetY",I,"labelHeight",L,"halfPadding",P);await wL(l,A);_s.get(A.id).node=A}else{const P=t.node(A.parentId);A.y+=x/2;wt.info("A regular node XBX1 - using the padding",A.id,"parent",A.parentId,A.width,A.height,A.x,A.y,"offsetY",A.offsetY,"parent",P,P?.offsetY,A);tB(A)}}}));const w=x/2;const _=Rbn(t,w,{mergeSelfLoops:h});_.forEach(function({edge:C,start:A,end:P}){wt.info("Edge "+A+" -> "+P+": "+JSON.stringify(C),C);C.points.forEach(O=>O.y+=w);const L=t.node(A);const I=t.node(P);const N=I$(u,C,_s,n,L,I,r);KEe(C,N)});t.nodes().forEach(function(C){const A=t.node(C);wt.info(C,A.type,A.diff);if(A.isGroup){g=A.diff}});wt.warn("Returning from recursive render XAX",s,g);return{elem:s,diff:g}},"recursiveRender");v2i=B(async(e,t)=>{const n=new fc({multigraph:true,compound:true}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.config?.flowchart?.nodeSpacing||e.nodeSpacing,ranksep:e.config?.rankSpacing||e.config?.flowchart?.rankSpacing||e.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});const r=t.select("g");M$(r,e.markers,e.type,e.diagramId);qEe();jEe();WEe();JEe();e.nodes.forEach(o=>{n.setNode(o.id,{...o});if(o.parentId){n.setParent(o.id,o.parentId)}});wt.debug("Edges:",e.edges);e.edges.forEach(o=>{if(o.start===o.end){const a=o.start;const s=a+"---"+a+"---1";const l=a+"---"+a+"---2";const u=n.node(a);n.setNode(s,{domId:s,id:s,parentId:u.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10});n.setParent(s,u.parentId);n.setNode(l,{domId:l,id:l,parentId:u.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10});n.setParent(l,u.parentId);const d=structuredClone(o);const f=structuredClone(o);const h=structuredClone(o);const m=structuredClone(o);f.originalEdge=d;f.selfLoop={id:d.id,order:0};h.originalEdge=d;h.selfLoop={id:d.id,order:1};m.originalEdge=d;m.selfLoop={id:d.id,order:2};f.label="";f.arrowTypeEnd="none";f.endLabelLeft="";f.endLabelRight="";f.startLabelLeft="";f.id=a+"-cyclic-special-1";h.startLabelRight="";h.startLabelLeft="";h.endLabelLeft="";h.endLabelRight="";h.arrowTypeStart="none";h.arrowTypeEnd="none";h.id=a+"-cyclic-special-mid";m.label="";m.startLabelRight="";m.startLabelLeft="";m.arrowTypeStart="none";if(u.isGroup){f.fromCluster=a;m.toCluster=a}m.id=a+"-cyclic-special-2";m.arrowTypeStart="none";n.setEdge(a,s,f,a+"-cyclic-special-0");n.setEdge(s,l,h,a+"-cyclic-special-1");n.setEdge(l,a,m,a+"-cyclic-special-2")}else{n.setEdge(o.start,o.end,{...o},o.id)}});wt.warn("Graph at first:",JSON.stringify(Rw(n)));n0n(n);wt.warn("Graph after XAX:",JSON.stringify(Rw(n)));const i=Mn();await Pbn(r,n,e.type,e.diagramId,void 0,i)},"render")});var Obn={};Oo(Obn,{captureNodeSizes:()=>Nbn,shouldCaptureSizes:()=>Lbn});function hZe(){if(typeof globalThis==="undefined"){return void 0}return globalThis}function Lbn(){return Boolean(hZe()?.mermaidCaptureSizes)}function Dbn(){if(typeof location==="undefined"){return"browser-dev"}return`${location.pathname}${location.search}`}function Fbn(e,t){const n=hZe();if(!n){return}const r=t.node();const i=(r&&"ownerSVGElement"in r?r.ownerSVGElement:null)??r;const o=i?.id??"(unknown)";n.mermaidCapturedSizes??=[];const a={svgId:o,sizes:e};n.mermaidCapturedSizes.push(a);n.mermaidLastCapturedSizes=a}function Nbn(e,t){const n=[];for(const r of t.nodes){if(r.isGroup){continue}n.push({id:r.id,width:r.width??0,height:r.height??0})}if(n.length===0){return}Fbn({metadata:{captureVersion:_2i,capturedAt:new Date().toISOString(),capturedFrom:Dbn()},nodes:n},e)}var _2i;var Bbn=Ce(()=>{Yo();_2i=1;B(hZe,"getCaptureGlobal");B(Lbn,"shouldCaptureSizes");B(Dbn,"capturedFromLocation");B(Fbn,"emitCapturedSizes");B(Nbn,"captureNodeSizes")});var S1n={};Oo(S1n,{render:()=>C1n});async function Wbn(e,t){const n=new fc({multigraph:true,compound:true});const r=[...t.edges];const i=Mn();const o=e.insert("g").attr("class","root");const a=o.insert("g").attr("class","clusters");const s=o.insert("g").attr("class","edges edgePath");const l=o.insert("g").attr("class","edgeLabels");const u=o.insert("g").attr("class","nodes");const d=new Map;const f=e.node()!=null;await Promise.all(t.nodes.map(async h=>{if(h.isGroup){n.setNode(h.id,{...h})}else{if(f){const m=await kR(u,h,{config:i,dir:h.dir});const g=m.node()?.getBBox()??{width:0,height:0};d.set(h.id,m);h.width=g.width;h.height=g.height}n.setNode(h.id,{...h})}}));for(const h of r){n.setEdge(h.start,h.end,{...h},h.id);const m=t.edges.some(g=>g.id===h.id);if(!m){t.edges.push(h)}}if(globalThis.mermaidCaptureSizes){const{captureNodeSizes:h}=await Promise.resolve().then(()=>(Bbn(),Obn));h(e,t)}return{graph:n,groups:{clusters:a,edgePaths:s,edgeLabels:l,nodes:u,rootGroups:o},nodeElements:d}}function dCe(e){const t=[];for(let n=0;n=1-oCe||h<=oCe||h>=1-oCe){return null}return{point:{x:e.x+f*i,y:e.y+f*o},tA:f,tB:h}}function bZe(e){return Math.abs(e.b.x-e.a.x)>=Math.abs(e.b.y-e.a.y)}function qbn(e){const t=[];for(let n=0;n=Math.abs(n)){return t>=0?1:0}return n>=0?1:0}function jbn(e,t){if(e.length<2){return e.map(o=>({...o}))}const n=e.map(o=>({...o}));const r=t.arrowTypeStart&&ep[t.arrowTypeStart];if(r){const o=e[0];const a=e[1];const s=Math.atan2(a.y-o.y,a.x-o.x);n[0].x=o.x+r*Math.cos(s);n[0].y=o.y+r*Math.sin(s)}const i=t.arrowTypeEnd&&ep[t.arrowTypeEnd];if(i){const o=e.length;const a=e[o-2];const s=e[o-1];const l=Math.atan2(s.y-a.y,s.x-a.x);n[o-1].x=s.x-i*Math.cos(l);n[o-1].y=s.y-i*Math.sin(l)}return n}function Kbn(e,t,n,r,i){const o=e.point.x;const a=e.point.y;const s={x:o-t*e.r,y:a-n*e.r};const l={x:o+t*e.r,y:a+n*e.r};const u=[`L${D$(s)}`];if(i==="arc"){u.push(`A${Iw(e.r)},${Iw(e.r)} 0 0 ${r} ${D$(l)}`)}else{u.push(`M${D$(l)}`)}return u}function xZe(e,t,n,r){const i=t.x-e.x;const o=t.y-e.y;const a=n.x-t.x;const s=n.y-t.y;const l=Math.hypot(i,o);const u=Math.hypot(a,s);if(l0){const A=xZe(i[u-1],i[u],i[u+1]??i[u],zbn);if(A){x=A.cutLen}}let w=f;let _=null;if(o&&uA.t-P.t);for(const A of C){A.r=Math.min(A.r,A.d-x,w-A.d)}for(let A=0;AP){const L=P/2;C[A].r=Math.min(C[A].r,L);C[A+1].r=Math.min(C[A+1].r,L)}}for(const A of C){if(A.r=2?r:null}catch{return null}}function txn(e,t,n){if(!n.enabled){return}const r=e.node();if(!r){return}const i=new Map;for(const u of t){i.set(u.id,u)}const o=[];const a=new Map;for(const u of t){const d=typeof CSS!=="undefined"&&CSS.escape?CSS.escape(u.id):u.id;const f=r.querySelector(`path[data-id="${d}"]`);if(!f){continue}a.set(u.id,f);const h=exn(f.getAttribute("data-points"));const m=h??u.points;o.push({...u,points:m})}const s=qbn(o);if(s.length===0){return}const l=new Map;for(const u of s){const d=l.get(u.jumpEdgeId)??[];d.push(u);l.set(u.jumpEdgeId,d)}for(const u of o){const d=l.get(u.id);if(!d||d.length===0){continue}const f=i.get(u.id);const h=f?.curve;if(h!==void 0&&!Qbn(h)){continue}const m=a.get(u.id);if(!m){continue}if(h===void 0){const A=m.getAttribute("d")??"";if(!Jbn(A)){continue}}const g=m.getAttribute("style")??"";const x=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(g);const w=x?Number.parseFloat(x[1]):null;const _=x?Number.parseFloat(x[2]):null;const C=Zbn(u,d,n);m.setAttribute("d",C);if(w!==null&&_!==null&&typeof m.getTotalLength==="function"){const A=m.getTotalLength();const P=Math.max(0,A-w-_);const L=`0 ${w} ${P} ${_}`;const I=g.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${L};`).replace(/;\s*;+/g,";");m.setAttribute("style",I)}}}async function nxn(e,t){for(const i of e.nodes){if(i.isGroup){await wL(t.clusters,i)}else{tB(i)}}const n=new Map;for(const i of e.nodes){if(i?.id){n.set(i.id,i)}}for(const i of e.edges){const o=i.start?n.get(i.start)??{}:{};const a=i.end?n.get(i.end)??{}:{};const s=I$(t.edgePaths,{...i},{},e.type,o,a,e.diagramId);if(i.label){await nB(t.rootGroups,i)}if(i.label){rxn(i,s)}}const r=e.config?.swimlane?.lineHops;if(r!==false){const i=r==="gap"?"gap":"arc";const o=e.edges.filter(a=>Array.isArray(a.points)&&a.points.length>=2).map(a=>({id:a.id,points:a.points,curve:a.curve,arrowTypeStart:a.arrowTypeStart,arrowTypeEnd:a.arrowTypeEnd}));txn(t.edgePaths,o,{enabled:true,jumpRadius:6,jumpStyle:i})}}function rxn(e,t){const n=t?.updatedPath??t?.originalPath;const r=Ji();const{subGraphTitleTotalMargin:i}=Sw({flowchart:r.flowchart??{}});if(e.label){const o=P$.get(e.id);let a=e.x;let s=e.y;if(n){const l=Ko.calcLabelPosition(n);wt.debug("Moving label "+e.label+" from (",a,",",s,") to (",l.x,",",l.y,") abc88");if(t){a=l.x;s=l.y}}o.attr("transform",`translate(${a}, ${s+i/2})`)}if(e?.startLabelLeft){const o=qf.get(e.id).startLeft;let a=e?.x;let s=e?.y;if(n){const l=Ko.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",n);a=l.x;s=l.y}o.attr("transform",`translate(${a}, ${s})`)}if(e.startLabelRight){const o=qf.get(e.id).startRight;let a=e.x;let s=e.y;if(n){const l=Ko.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",n);a=l.x;s=l.y}o.attr("transform",`translate(${a}, ${s})`)}if(e.endLabelLeft){const o=qf.get(e.id).endLeft;let a=e.x;let s=e.y;if(n){const l=Ko.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",n);a=l.x;s=l.y}o.attr("transform",`translate(${a}, ${s})`)}if(e.endLabelRight){const o=qf.get(e.id).endRight;let a=e.x;let s=e.y;if(n){const l=Ko.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",n);a=l.x;s=l.y}o.attr("transform",`translate(${a}, ${s})`)}}function vZe(e){return Math.max(e.padding??Ubn,Ubn)}function ixn(e){const{x:t,y:n,width:r,height:i}=e;const o=e.swimlaneContentTop;if(typeof t!=="number"||typeof n!=="number"||typeof r!=="number"||typeof i!=="number"||typeof o!=="number"||!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(i)||!Number.isFinite(o)||r<=0||i<=0){delete e.groupTitleRect;return}const a=n-i/2;const s=Math.min(o,n+i/2);const l=Math.min(w2i,Math.max(0,s-a));const u=a+l;if(u<=a){delete e.groupTitleRect;return}e.groupTitleRect={left:t-r/2,right:t+r/2,top:a,bottom:u}}function oxn(e){const t=e.direction;const n=e.nodes??=[];for(const o of e.nodes??[]){if(o.isGroup&&!o.parentId){o.shape="swimlane";if(t){o.direction=t}}}const r=n.filter(o=>!o.isGroup&&!o.parentId);if(r.length===0){return}let i=n.find(o=>o.id===pZe);if(!i){i={id:pZe,label:"",isGroup:true,shape:"swimlane",padding:20,...t?{direction:t}:{}};n.push(i)}else if(i.isGroup){i.shape="swimlane";if(t){i.direction=t}}for(const o of r){o.parentId=pZe}}function axn(e){const t=new Map;for(const l of e.nodes??[]){t.set(l.id,l)}const n=[];for(const l of e.edges??[]){const u=typeof l.start==="string"?l.start:void 0;const d=typeof l.end==="string"?l.end:void 0;if(!u||!d){continue}if(l.labelNodeId){continue}n.push({id:l.id,src:u,dst:d,ref:l})}const r=e.nodes??[];const i=r.filter(l=>l.isGroup);const o=r.filter(l=>!l.isGroup);const a=[...i].reverse();const s=[...a,...o].map(l=>l.id);return{nodes:s,edges:n,layout:e,nodeById:t}}function sxn(e,t,n,r){const{layout:i}=e;const o=e.nodeById;const a=r?.layerGap??100;const s=r?.nodeGap??40;let l=0;for(const h of t.layers){let m=0;for(const g of h){const x=o.get(g);if(!x){m++;continue}x.layer=l;x.order=m;const w=n.x[g]??m*s;const _=n.y[g]??l*a;x.x=w;x.y=_;m++}l++}const u=i.nodes??[];const d=new Map;const f=[];for(const h of u){if(!h?.isGroup){continue}if(!h.parentId){f.push(h)}const m=u.filter(C=>C.parentId===h.id);let g=Infinity;let x=-Infinity;let w=Infinity;let _=-Infinity;for(const C of m){const A=C.x??n.x[C.id];const P=C.y??n.y[C.id];const L=C.width??0;const I=C.height??0;if(A!=null&&P!=null){g=Math.min(g,A-L/2);x=Math.max(x,A+L/2);w=Math.min(w,P-I/2);_=Math.max(_,P+I/2)}}if(g===Infinity||w===Infinity){h.x=h.x??0;h.y=h.y??0;h.width=h.width??0;h.height=h.height??0}else{const C=h.padding??20;const A=h.parentId?C:2*vZe(h);const P=C;const L=Math.max(0,x-g)+A;const I=Math.max(0,_-w)+P;const N=(g+x)/2;const O=(w+_)/2;h.x=N;h.y=O;h.width=L;h.height=I;d.set(h.id,{minX:g,maxX:x,minY:w,maxY:_})}}if(f.length>0&&d.size>0){let h=Infinity;let m=-Infinity;let g=0;for(const x of f){const w=x.padding??20;if(w>g){g=w}const _=d.get(x.id);if(!_){continue}h=Math.min(h,_.minY);m=Math.max(m,_.maxY)}if(h!==Infinity&&m!==-Infinity){const x=Math.max(0,m-h);const w=36;const _=Math.max(g,w);const C=x+2*_;const A=(h+m)/2;for(const z of f){z.y=A;z.height=C;z.swimlaneContentTop=h}const P=[...f].sort((z,U)=>{const W=z.x??0;const H=U.x??0;return W-H});const L=[];const I=[];const N=[];for(const z of P){const U=d.get(z.id);if(!U){continue}const W=Math.max(0,U.maxX-U.minX)+2*vZe(z);const H=(U.minX+U.maxX)/2;L.push(z.id);I.push(H);N.push(W)}const O=L.length;if(O>0){const z=new Map;if(O===1){z.set(L[0],N[0])}else{const U=[];for(let X=0;X0&&i>0?{cx:t,cy:n,rect:F$(t,n,r,i)}:void 0}function JZe(e){if(e.isGroup){return void 0}const t=ZZe(e);if(!t){return void 0}const n=String(e.id??"");return{id:n,cx:t.cx,cy:t.cy,rect:t.rect}}function L_(e,t,n=Nm){return Math.abs(e.x-t.x)n}function jf(e,t,n=Nm){return Bl(e,t,n)&&Math.abs(e.y-t.y)>n}function Z0(e,t,n,r){return Math.max(0,Math.min(Math.max(e,t),Math.max(n,r))-Math.max(Math.min(e,t),Math.min(n,r)))}function YC(e,t,n=Nm){if(e.horizontal&&t.horizontal&&Xl(e.a,t.a,n)){return Z0(e.a.x,e.b.x,t.a.x,t.b.x)}if(e.vertical&&t.vertical&&Bl(e.a,t.a,n)){return Z0(e.a.y,e.b.y,t.a.y,t.b.y)}return 0}function N$(e,t=Nm){const n=[];for(let r=0;r0?n[n.length-1]:void 0;if(!i||!L_(i,r,t)){n.push({x:r.x,y:r.y})}}return n}function QZe(e,t=Nm){if(!e||e.length!==4){return void 0}const[n,r,i,o]=e;const a=Xf(n,r,t)&&jf(r,i,t)&&Xf(i,o,t);if(a){return{kind:"HVH",p0:n,p1:r,p2:i,p3:o}}const s=jf(n,r,t)&&Xf(r,i,t)&&jf(i,o,t);return s?{kind:"VHV",p0:n,p1:r,p2:i,p3:o}:void 0}function _Ce(e,t,n,r=0){const i=Math.min(e.x,t.x);const o=Math.max(e.x,t.x);const a=Math.min(e.y,t.y);const s=Math.max(e.y,t.y);return o>n.left-r&&in.top-r&&at.left+n&&e.xt.top+n&&e.y=t.right&&e.top<=t.top&&e.bottom>=t.bottom}function fCe(e,t){return e.leftt.left&&e.topt.top}function _Ze(e,t){return{left:e.left-t,right:e.right+t,top:e.top-t,bottom:e.bottom+t}}function F$(e,t,n,r){return{left:e-n/2,right:e+n/2,top:t-r/2,bottom:t+r/2}}function xx(e){return ZZe(e)?.rect}function cB(e,t){switch(t){case"top":return{x:e.cx,y:e.rect.top};case"bottom":return{x:e.cx,y:e.rect.bottom};case"left":return{x:e.rect.left,y:e.cy};case"right":return{x:e.rect.right,y:e.cy}}}function tJe(e,t,n,r,i,o=Nm){const a=t==="left"||t==="right";const s=r==="left"||r==="right";if(a&&s){const d=t==="right"&&r==="left"&&e.xn.x;if(d){if(Xl(e,n,o)){return[e,n]}const f=(e.x+n.x)/2;return[e,{x:f,y:e.y},{x:f,y:n.y},n]}if(t===r){if(Xl(e,n,o)){return void 0}const f=t==="left"?Math.min(e.x,n.x)-i:Math.max(e.x,n.x)+i;return[e,{x:f,y:e.y},{x:f,y:n.y},n]}return void 0}if(!a&&!s){if(t===r){if(Bl(e,n,o)){return void 0}const h=t==="top"?Math.min(e.y,n.y)-i:Math.max(e.y,n.y)+i;return[e,{x:e.x,y:h},{x:n.x,y:h},n]}const d=t==="bottom"&&r==="top"&&e.yn.y;if(!d){return void 0}if(Bl(e,n,o)){return[e,n]}const f=(e.y+n.y)/2;return[e,{x:e.x,y:f},{x:n.x,y:f},n]}if(a&&!s){const d=t==="right"&&n.x>e.x||t==="left"&&n.xn.y;return d&&f?[e,{x:n.x,y:e.y},n]:void 0}const l=t==="bottom"&&n.y>e.y||t==="top"&&n.yn.x;return l&&u?[e,{x:e.x,y:n.y},n]:void 0}function nJe(e,t,n,r){return t==="left"||t==="right"?[e,{x:r,y:e.y},{x:r,y:n.y},n]:[e,{x:e.x,y:r},{x:n.x,y:r},n]}function TCe(e){const t=new Map;const n=[];for(const r of e){if(r.isEdgeLabel){continue}const i=JZe(r);if(!i){continue}t.set(i.id,i);n.push({id:i.id,rect:i.rect})}return{nodeInfoById:t,realNodeRects:n}}function RL(e){const t=[];const n=[];for(const r of e){const i=JZe(r);if(!i){continue}const o={id:i.id,rect:i.rect};if(r.isEdgeLabel){n.push(o)}else{t.push(o)}}return{realNodeRects:t,labelNodeRects:n}}function uxn(e,{includeEdgeLabels:t=true}={}){const n=[];for(const r of e){if(r.isGroup||!t&&r.isEdgeLabel){continue}const i=r.x??0;const o=r.y??0;const a=r.width??0;const s=r.height??0;n.push({nodeId:r.id,...F$(i,o,a,s)})}return n}function rJe(e,t,n=Nm){const r=e.start;const i=e.end;if(!r||!i){return void 0}const o=t.get(r);const a=t.get(i);if(!o||!a){return void 0}return{srcId:r,dstId:i,srcInfo:o,dstInfo:a,collinearX:Math.abs(o.cx-a.cx)g||h_){return false}const C=Math.abs(x-d.a.x)i}if(o&&s&&Xl(e,n,i)){return Z0(e.x,t.x,n.x,r.x)>i}return false}function hCe(e,t,n,r,{epsilon:i=Nm,skipDegenerateOther:o=false}={}){for(const a of n){if(a===r||a.isLayoutOnly){continue}const s=a.points;if(!s||s.length<2){continue}for(let l=0;lh+i&&gx+i&&fr+Nm&&e=2?t[t.length-2]:void 0;const s=a?Bl(a,i):false;const l=s?{x:i.x,y:o.y}:{x:o.x,y:i.y};t.push(l)}t.push(o)}const n=[];for(const r of t){const i=n[n.length-1];if(!i||!L_(i,r)){n.push(r)}}return n}function qC(e){if(e.length<3){return e}let t=[...e];for(let n=0;n<32;n++){const r=hxn(t);t=r.points;if(!r.changed){break}}return t}function oJe(e,t,n){const r=e;if(r.isLayoutOnly||!r.points||r.points.length=0&&i=e.length){return e}const o=i-r;if(o<0||o>=e.length){return e}const a=pxn(e[i],e[o],t);return n?[a,...e.slice(i)]:[...e.slice(0,i+1),a]}function mxn(e,t){for(const n of e){const r=oJe(n,t,2);if(!r){continue}let i=[...r.points];if(r.srcRect){i=wZe(i,r.srcRect,true)}if(r.dstRect){i=wZe(i,r.dstRect,false)}i=qC(pCe(i));i=aJe(i,r.srcRect,r.dstRect);r.edge.points=qC(pCe(i))}}function EZe(e,t,n,r=false){if(Xl(e,t,Za)){if(t.yn.bottom+Za){return t}if(r){if(e.xn.right+Za){return{x:n.right,y:e.y}}}const i=Math.abs(t.x-n.left)<=Math.abs(t.x-n.right);return{x:i?n.left:n.right,y:e.y}}if(Bl(e,t,Za)){if(t.xn.right+Za){return t}if(r){if(e.yn.bottom+Za){return{x:e.x,y:n.bottom}}}const i=Math.abs(t.y-n.top)<=Math.abs(t.y-n.bottom);return{x:e.x,y:i?n.top:n.bottom}}return t}function mCe(e,t,n){const r=e[t];for(let i=t+n;i>=0&&ir.lo));const n=Math.min(...e.map(r=>r.hi));if(t>n){return void 0}return{lo:t,hi:n}}function SZe(e,t){return t==="left"||t==="right"?gCe(e.top,e.bottom):gCe(e.left,e.right)}function yCe(e,t,n){const r=e.y>=n.top-Za&&e.y<=n.bottom+Za;const i=e.x>=n.left-Za&&e.x<=n.right+Za;if(Xl(e,t,Za)&&r){if(Math.abs(e.x-n.left)0?gxn(o):void 0}function AZe(e,t,n,r,i){const o=yxn(e,t,n,r,i);if(!o){return void 0}const a=i?e.y:e.x;const s=Math.min(o.hi,Math.max(o.lo,a));if(Math.abs(s-a)({...s}));for(let s=t;s>=0&&s=n.left-Za&&Math.max(e.x,t.x)<=n.right+Za;const i=Math.min(e.y,t.y)>=n.top-Za&&Math.max(e.y,t.y)<=n.bottom+Za;if(Math.abs(e.y-n.top)r.bottom+Za;case"left":return Xl(t,n,Za)&&n.xr.right+Za}}function IZe(e,t,n){if(e.length<3){return e}if(n){const o=RZe(e[0],e[1],t);if(o&&PZe(o,e[1],e[2],t)){return e.slice(1)}return e}const r=e.length-1;const i=RZe(e[r-1],e[r],t);if(i&&PZe(i,e[r-1],e[r-2],t)){return e.slice(0,r)}return e}function vxn(e,t,n){let r=e;if(t){const o=mCe(r,0,1);if(o){const a=EZe(o,r[0],t);if(a!==r[0]){r=[a,...r.slice(1)]}}r=IZe(r,t,true)}if(n){const o=r.length-1;const a=mCe(r,o,-1);if(a){const s=EZe(a,r[o],n,true);if(s!==r[o]){r=[...r.slice(0,o),s]}}r=IZe(r,n,false)}const i=aJe(r,t,n);if(i!==r||r.length===2){return i}if(t){r=kZe(r,t,true)}if(n){r=kZe(r,n,false)}return r}function MZe(e,t){for(const n of e){const r=oJe(n,t,2);if(!r){continue}const i=hc(r.points,Za);const o=vxn(i,r.srcRect,r.dstRect);if(o.length<3){r.edge.points=o;continue}const a=[o[0],{...o[0]},...o.slice(1,-1),o[o.length-1],{...o[o.length-1]}];r.edge.points=a}}function sJe(e){return new Map(e.map(t=>[t.id,t]))}function _xn(e,t){let n=e.parentId;let r=null;while(n){const i=t.get(n);if(!i?.isGroup){break}r=i.id;n=i.parentId}return r}function LZe(e,t){let n=0;let r=e.parentId;while(r){const i=t.get(r);if(!i?.isGroup){break}n++;r=i.parentId}return n}function lJe(e){let t=Infinity;let n=-Infinity;let r=Infinity;let i=-Infinity;for(const o of e){const a=o.x;const s=o.y;if(typeof a!=="number"||typeof s!=="number"){continue}const l=o.width??0;const u=o.height??0;t=Math.min(t,a-l/2);n=Math.max(n,a+l/2);r=Math.min(r,s-u/2);i=Math.max(i,s+u/2)}if(t===Infinity||r===Infinity){return null}return{minX:t,maxX:n,minY:r,maxY:i}}function Txn(e,t){const n=e.padding??20;e.x=(t.minX+t.maxX)/2;e.y=(t.minY+t.maxY)/2;e.width=Math.max(0,t.maxX-t.minX)+n;e.height=Math.max(0,t.maxY-t.minY)+n}function wxn(e){const t=sJe(e);const n=e.filter(r=>r.isGroup&&r.parentId).sort((r,i)=>LZe(i,t)-LZe(r,t));for(const r of n){const i=e.filter(a=>a.parentId===r.id);const o=lJe(i);if(o){Txn(r,o)}}}function bCe(e,t){const n=e.nodes??[];const r=e.edges??[];const i=n.filter(l=>!l.isGroup);let o=Infinity;let a=-Infinity;for(const l of i){const u=l[t];if(typeof u!=="number"){continue}o=Math.min(o,u);a=Math.max(a,u)}if(!Number.isFinite(o)||!Number.isFinite(a)){return false}const s=B(l=>o+a-l,"mirror");for(const l of n){const u=l[t];if(typeof u==="number"){l[t]=s(u)}const d=l.groupTitleRect;if(d){l.groupTitleRect=t==="x"?{...d,left:s(d.right),right:s(d.left)}:{...d,top:s(d.bottom),bottom:s(d.top)}}}for(const l of r){for(const u of l.points??[]){u[t]=s(u[t])}}return true}function Exn(e){const t=e.nodes??[];if(!t.some(n=>!n.isGroup)){return true}return bCe(e,"y")}function Cxn(e,t="LR"){const n=e.nodes??[];const r=e.edges??[];const i=n.filter($=>!$.isGroup);let o=Infinity;let a=Infinity;for(const $ of i){const K=$.x??0;const X=$.y??0;if(K0?Math.max(1,d/f):1;for(const $ of i){const K=$.x??0;const X=$.y??0;const j=(X-a)*h+s;const te=K-o;$.x=j;$.y=te}for(const $ of r){if(!$.points){continue}for(const K of $.points){const X=K.x;const j=K.y;const te=(j-a)*h+s;const J=X-o;K.x=te;K.y=J}}wxn(n);const m=n.filter($=>$.isGroup&&!$.parentId);if(m.length===0){if(t==="RL"){bCe(e,"x")}return true}const g=sJe(n);const x=new Map;for(const $ of n){if($.isGroup){continue}const K=_xn($,g);if(!K){continue}const X=x.get(K)??[];X.push($);x.set(K,X)}let w=0;for(const $ of m){const K=$.padding??0;if(K>w){w=K}}const _=[];let C=Infinity;let A=-Infinity;for(const $ of m){const K=x.get($.id)??[];const X=lJe(K);if(!X){continue}C=Math.min(C,X.minX);A=Math.max(A,X.maxX);_.push({lane:$,contentTop:X.minY,contentBottom:X.maxY,centerY:(X.minY+X.maxY)/2})}if(C===Infinity||A===-Infinity){return true}const P=Math.max(0,A-C);const L=Math.max(w,10);const I=P+2*L;const N=s+I;const O=(C+A)/2;const z=O-I/2;const U=z-s;const W=U+N/2;const H=Math.max(w,s);_.sort(($,K)=>$.centerY-K.centerY);for(let $=0;$<_.length;$++){const K=_[$];let X;let j;if($===0){X=K.contentTop-H}else{const oe=_[$-1];X=(oe.contentBottom+K.contentTop)/2}if($===_.length-1){j=K.contentBottom+H}else{const oe=_[$+1];j=(K.contentBottom+oe.contentTop)/2}const te=Math.max(0,j-X);const J=(X+j)/2;K.lane.x=W;K.lane.y=J;K.lane.width=N;K.lane.height=te;K.lane.swimlaneContentTop=K.contentTop;K.lane.groupTitleRect={left:U,right:U+s,top:X,bottom:j}}if(t==="RL"){bCe(e,"x")}return true}function Sxn(e,t){const{nodeInfoById:n,realNodeRects:r}=TCe(t);for(const i of e){if(i.isLayoutOnly){continue}const o=i.points;if(!o||o.length<4){continue}const a=QZe(hc(o,Pw),Pw);if(!a){continue}const{p3:s}=a;const l=a.kind==="HVH";const u=rJe(i,n,Pw);if(!u){continue}const{srcId:d,dstId:f,srcInfo:h,dstInfo:m,collinearX:g,collinearY:x}=u;if(g||x){continue}let w;const _=h.rect;for(const C of A2i){let A;let P;let L;if(l){const U=m.cy>h.cy;const W=U?_.bottom:_.top;const H=h.cx+C;if(H<=_.left+Pw||H>=_.right-Pw){continue}A={x:H,y:W};P={x:H,y:s.y};L={x:s.x,y:s.y}}else{const U=m.cx>h.cx;const W=U?_.right:_.left;const H=h.cy+C;if(H<=_.top+Pw||H>=_.bottom-Pw){continue}A={x:W,y:H};P={x:s.x,y:H};L={x:s.x,y:s.y}}const I=L_(A,P,Pw);const N=L_(P,L,Pw);if(I&&N){continue}if(!I&&bh(A,P,r,[d],1)){continue}if(!N&&bh(P,L,r,[f],1)){continue}const O=!I&&hCe(A,P,e,i,{epsilon:Pw,skipDegenerateOther:true});const z=!N&&hCe(P,L,e,i,{epsilon:Pw,skipDegenerateOther:true});if(O||z){continue}if(I){w=[P,L]}else if(N){w=[A,P]}else{w=[A,P,L]}break}if(w){i.points=w}}}function Axn(e,t){const n=10;const r=.001;const i=2;const{realNodeRects:o,labelNodeRects:a}=RL(t.values());for(const s of e){if(s.isLayoutOnly){continue}const l=s.points;if(!l||l.length<4){continue}const u=hc(l,r);if(u.length<4){continue}const d=u.length-1;const f=u[d];const h=u[d-1];const m=u[d-2];const g=f.x-h.x;const x=f.y-h.y;const w=Math.hypot(g,x);if(w>=n||w0;K={x:m.x,y:H};X={x:ce?$.right:$.left,y:H}}if(bh(K,X,o,O?[O]:[],-i)){continue}if(bh(K,X,a,[],-i)){continue}if(z){const ce=t.get(z);const ue=ce?xx(ce):void 0;if(ue&&eJe(K,ue,i)){continue}}const j=B((ce,ue)=>`${ce.x.toFixed(3)},${ce.y.toFixed(3)}|${ue.x.toFixed(3)},${ue.y.toFixed(3)}`,"ownSegmentKey");const te=new Set;for(let ce=0;ce{for(const xe of e){if(xe===s){continue}if(xe.isLayoutOnly){continue}const be=xe.points;if(!be||be.length<2){continue}for(let Ie=0;Ie=0){const ce=u[d-3];const ue=[z,O].filter(xe=>Boolean(xe));if(bh(ce,K,o,ue,-i)){continue}if(J(ce,K)){continue}}const oe=u.slice(0,d-2);const se=[...oe,K,X];s.points=se;const re=s.labelNodeId;if(re){const ce=t.get(re);if(ce){const ue=ce.width??0;const xe=ce.height??0;if(ue>0&&xe>0){let be;let Ie;let he=-1;for(let ve=0;ve=ue+2||Ee&&Le>=xe+2;if(!tt){continue}if(Le>he){he=Le;be=(ge.x+Ve.x)/2;Ie=(ge.y+Ve.y)/2}}if(be!==void 0&&Ie!==void 0){ce.x=be;ce.y=Ie}}}}}}function kxn(e,t){const n=16;const r=7;const i=B((m,g)=>{const x=m.x??0;const w=m.y??0;const _=g.x-x;const C=g.y-w;let A=(m.width??0)/2;let P=(m.height??0)/2;if(Math.abs(C)*A>Math.abs(_)*P){if(C<0){P=-P}return{x:x+(C===0?0:P*_/C),y:w+P}}if(_<0){A=-A}return{x:x+A,y:w+(_===0?0:A*C/_)}},"rectIntersect");const o=B((m,g)=>{const x=hc(m.points??[]);if(x.length<2){return void 0}const w=g?m.start:m.end;const _=w?t.get(w):void 0;const C=_?xx(_):void 0;if(!_||!w||!C){return void 0}const A=g?x[0]:x[x.length-1];const P=g?x[1]:x[x.length-2];const L=i(_,A);let I=A;if(mZe(P,L)){I=P}if(Bl(L,I,Zo)){return{edge:m,edgeId:String(m.id??""),nodeId:w,atStart:g,orientation:"V",coord:L.x,min:Math.min(L.y,I.y),max:Math.max(L.y,I.y),boundary:L,railEnd:I,rect:C}}if(Xl(L,I,Zo)){return{edge:m,edgeId:String(m.id??""),nodeId:w,atStart:g,orientation:"H",coord:L.y,min:Math.min(L.x,I.x),max:Math.max(L.x,I.x),boundary:L,railEnd:I,rect:C}}return void 0},"terminalLaneFor");const a=B((m,g)=>Math.max(0,Math.min(m.max,g.max)-Math.max(m.min,g.min)),"projectedOverlapLength");const s=B((m,g)=>{if(m.nodeId!==g.nodeId||m.orientation!==g.orientation){return false}if(m.orientation==="H"){const w=Math.abs(m.boundary.x-m.rect.left)<1||Math.abs(m.boundary.x-m.rect.right)<1;return w&&Bl(m.boundary,g.boundary,1)}const x=Math.abs(m.boundary.y-m.rect.top)<1||Math.abs(m.boundary.y-m.rect.bottom)<1;return x&&Xl(m.boundary,g.boundary,1)},"sameTerminalFace");const l=B((m,g)=>{if(m.nodeId!==g.nodeId||m.orientation!==g.orientation){return false}const x=a(m,g);return x>=Fm&&Math.abs(m.coord-g.coord)<.5},"exactTerminalLaneConflict");const u=B((m,g)=>{if(m.nodeId!==g.nodeId||m.orientation!==g.orientation||m.orientation!=="H"||m.atStart===g.atStart){return false}const x=a(m,g);if(x2*w){return false}return s(m,g)&&Math.abs(m.coord-g.coord){const x=hc(m.edge.points??[]);if(x.length<2){return void 0}const w=m.orientation==="V"?{x:m.boundary.x+g,y:m.boundary.y}:{x:m.boundary.x,y:m.boundary.y+g};const _=m.orientation==="V"?{x:m.railEnd.x+g,y:m.railEnd.y}:{x:m.railEnd.x,y:m.railEnd.y+g};const C=B(()=>{if(Math.abs(m.boundary.y-m.rect.top)<1||Math.abs(m.boundary.y-m.rect.bottom)<1){return Xl(w,m.boundary,Zo)&&w.x>=m.rect.left+1&&w.x<=m.rect.right-1}if(Math.abs(m.boundary.x-m.rect.left)<1||Math.abs(m.boundary.x-m.rect.right)<1){return Bl(w,m.boundary,Zo)&&w.y>=m.rect.top+1&&w.y<=m.rect.bottom-1}return false},"boundaryStaysOnSameFace");if(!C()){return void 0}if(m.atStart){const I=x.length>1&&L_(x[1],m.railEnd,Zo);const N=x.slice(I?2:1);const O=N[0];if(O&&!mZe(O,_)){return void 0}return[w,_,...N]}const A=x.length>1&&L_(x[x.length-2],m.railEnd,Zo);const P=x.slice(0,A?-2:-1);const L=P[P.length-1];if(L&&!mZe(L,_)){return void 0}return[...P,_,w]},"shiftedCandidate");const f=B(m=>{const g=m.edge;const x=hc(g.points??[]);if(x.length!==2){return false}const w=g.start;const _=g.end;const C=w?t.get(w):void 0;const A=_?t.get(_):void 0;if(!C||!A){return false}const P=C.x??0;const L=C.y??0;const I=A.x??0;const N=A.y??0;const[O,z]=x;return Xl(O,z,Zo)&&Math.abs(L-N)<1&&Math.abs(P-I)>1||Bl(O,z,Zo)&&Math.abs(P-I)<1&&Math.abs(L-N)>1},"laneIsStraightCollinearConnector");const h=[-r,r,-2*r,2*r,-3*r,3*r];for(let m=0;m<8;m++){const g=e.filter(w=>!w.isLayoutOnly).flatMap(w=>[o(w,true),o(w,false)]).filter(w=>Boolean(w));let x=false;for(let w=0;w{const O=f(I);const z=f(N);if(O!==z){return Number(O)-Number(z)}return Number(!N.atStart)-Number(!I.atStart)});for(const I of L){for(const N of h){const O=d(I,N);if(!O){continue}const z=o({...I.edge,points:O},I.atStart);if(!z||g.some(U=>U.edge!==I.edge&&(l(z,U)||P&&u(z,U)))){continue}I.edge.points=O;x=true;break}if(x){break}}}}if(!x){return}}}function Rxn(e,t){const n=2;const r=8;const{realNodeRects:i,labelNodeRects:o}=RL(t.values());const a=B((l,u)=>{const d=l.start;const f=l.end;const h=js(u);if(h.length!==u.length-1){return false}const m=[d,f].filter(g=>Boolean(g));for(const g of h){if(bh(g.a,g.b,i,m,-n)){return false}if(bh(g.a,g.b,o,[],-n)){return false}}for(const g of e){if(g===l||g.isLayoutOnly){continue}const x=g.points;if(!x||x.length<2){continue}for(const w of h){for(const _ of js(hc(x))){if(YC(w,_,.5)>=Fm){return false}if(RR(w.a,w.b,_.a,_.b,Zo)){return false}}}}return true},"candidateIsSafe");const s=B((l,u)=>{if(u+4>=l.length){return void 0}const d=l[u];const f=l[u+1];const h=l[u+2];const m=l[u+3];const g=l[u+4];const x=Xf(d,f)&&jf(f,h)&&Xf(h,m)&&jf(m,g)&&Bl(d,m,Zo)&&Bl(d,g,Zo)&&Bl(f,h,Zo)&&(f.x-d.x)*(m.x-h.x)<0;const w=jf(d,f)&&Xf(f,h)&&jf(h,m)&&Xf(m,g)&&Xl(d,m,Zo)&&Xl(d,g,Zo)&&Xl(f,h,Zo)&&(f.y-d.y)*(m.y-h.y)<0;if(x||w){return hc([...l.slice(0,u+1),g,...l.slice(u+5)])}if(u+5>=l.length){return void 0}const _=l[u+5];const C=jf(d,f)&&Xf(f,h)&&jf(h,m)&&Xf(m,g)&&jf(g,_)&&Bl(d,g,Zo)&&Bl(d,_,Zo)&&Bl(h,m,Zo)&&(h.x-f.x)*(g.x-m.x)<0;const A=Xf(d,f)&&jf(f,h)&&Xf(h,m)&&jf(m,g)&&Xf(g,_)&&Xl(d,g,Zo)&&Xl(d,_,Zo)&&Xl(h,m,Zo)&&(h.y-f.y)*(g.y-m.y)<0;if(!C&&!A){return void 0}return hc([...l.slice(0,u+1),_,...l.slice(u+6)])},"withoutDogleg");for(let l=0;l!g.isLayoutOnly);const l=B((g,x,w)=>hc(g===x?w??[]:g.points??[]),"pointsFor");const u=B((g,x)=>{let w=0;for(let _=0;_{const x=js(g);if(x.length!==3){return void 0}const w=x[1];if(x[0].horizontal===w.horizontal||x[2].horizontal===w.horizontal){return void 0}return{index:w.index,horizontal:w.horizontal,vertical:w.vertical,segment:w}},"middleRail");const f=B((g,x)=>{const w=[g.start,g.end].filter(_=>Boolean(_));return o.filter(_=>{if(w.includes(_.id)){return false}const C=_.rect;if(x.horizontal){const P=Z0(x.a.x,x.b.x,C.left,C.right);return P>=Fm&&x.a.y>=C.top-n&&x.a.y<=C.bottom+n}const A=Z0(x.a.y,x.b.y,C.top,C.bottom);return A>=Fm&&x.a.x>=C.left-n&&x.a.x<=C.right+n})},"blockingRectsFor");const h=B((g,x,w)=>{const _=g.map(A=>({...A}));if(x.horizontal){_[x.index].y=w;_[x.index+1].y=w}else if(x.vertical){_[x.index].x=w;_[x.index+1].x=w}else{return void 0}const C=qC(hc(_));return js(C).length===C.length-1?C:void 0},"candidateByMovingRail");const m=B((g,x,w)=>{const _=[g.start,g.end].filter(A=>Boolean(A));const C=js(x);if(C.length!==x.length-1){return false}for(const A of C){if(bh(A.a,A.b,o,_,-n)){return false}if(bh(A.a,A.b,a,[],-n)){return false}}for(const A of s){if(A===g){continue}for(const P of C){for(const L of js(l(A))){if(YC(P,L,.5)>=Fm){return false}}}}return u(g,x)<=w},"candidateIsSafe");for(let g=0;gI.rect.top))-r,Math.max(...P.map(I=>I.rect.bottom))+r]:[Math.min(...P.map(I=>I.rect.left))-r,Math.max(...P.map(I=>I.rect.right))+r];for(const I of L){const N=h(C,A.segment,I);if(!N||!m(_,N,x)){continue}_.points=N;w=true;break}if(w){break}}if(!w){return}}}function FZe(e,t){const n=4;const r=B(l=>{const u=l.groupTitleRect;if(!u||typeof u.left!=="number"||typeof u.right!=="number"||typeof u.top!=="number"||typeof u.bottom!=="number"||!Number.isFinite(u.left)||!Number.isFinite(u.right)||!Number.isFinite(u.top)||!Number.isFinite(u.bottom)||u.right<=u.left||u.bottom<=u.top){return void 0}return{left:u.left,right:u.right,top:u.top,bottom:u.bottom}},"validTitleRect");const i=B(l=>{if(!l.isGroup||l.parentId){return void 0}const u=l.direction;const d=typeof u==="string"?u.toUpperCase():"";if(d==="LR"||d==="RL"||d==="BT"){return void 0}const f=r(l);const h=l.y;const m=l.height;if(!f||typeof h!=="number"||typeof m!=="number"||!Number.isFinite(h)||!Number.isFinite(m)||m<=0){return void 0}const g=f.right-f.left;const x=f.bottom-f.top;if(x<=0||g{if(!l.horizontal){return false}const d=l.a.y;if(d<=u.top+Zo||d>=u.bottom-Zo){return false}return Z0(l.a.x,l.b.x,u.left,u.right)>=Fm},"horizontalSegmentIntersectsTitle");const a=[...t.values()].map(i).filter(l=>Boolean(l));if(a.length===0){return}let s=0;for(const l of e){if(l.isLayoutOnly){continue}const u=hc(l.points??[]);for(const d of js(u)){for(const f of a){if(!o(d,f.rect)){continue}s=Math.max(s,f.rect.bottom-d.a.y+n)}}}if(s<=Zo){return}for(const l of a){const u=l.node.y;const d=l.node.height;if(typeof u!=="number"||typeof d!=="number"||!Number.isFinite(u)||!Number.isFinite(d)||d<=0){continue}l.node.y=u-s/2;l.node.height=d+s;l.node.groupTitleRect={...l.rect,top:l.rect.top-s,bottom:l.rect.bottom-s}}}function NZe(e,t){const n=4;const r=B(u=>{const d=u.groupTitleRect;if(!d||typeof d.left!=="number"||typeof d.right!=="number"||typeof d.top!=="number"||typeof d.bottom!=="number"||!Number.isFinite(d.left)||!Number.isFinite(d.right)||!Number.isFinite(d.top)||!Number.isFinite(d.bottom)||d.right<=d.left||d.bottom<=d.top){return void 0}return{left:d.left,right:d.right,top:d.top,bottom:d.bottom}},"validTitleRect");const i=B(u=>{if(!u.isGroup||u.parentId){return void 0}const d=u.direction;if(d!=="LR"){return void 0}const f=r(u);const h=u.x;const m=u.width;if(!f||typeof h!=="number"||typeof m!=="number"||!Number.isFinite(h)||!Number.isFinite(m)||m<=0){return void 0}const g=f.right-f.left;const x=f.bottom-f.top;if(g<=0||x{if(!u.vertical){return false}const f=u.a.x;if(f<=d.left+Zo||f>=d.right-Zo){return false}return Z0(u.a.y,u.b.y,d.top,d.bottom)>=Fm},"verticalSegmentIntersectsTitle");const a=B((u,d)=>{if(!u.horizontal){return false}const f=u.a.y;if(f<=d.top+Zo||f>=d.bottom-Zo){return false}return Z0(u.a.x,u.b.x,d.left,d.right)>=Fm},"horizontalSegmentIntersectsTitle");const s=[...t.values()].map(i).filter(u=>Boolean(u));if(s.length===0){return}let l=0;for(const u of e){if(u.isLayoutOnly){continue}const d=hc(u.points??[]);for(const f of js(d)){for(const h of s){if(o(f,h.rect)){l=Math.max(l,h.rect.right-f.a.x+n)}else if(a(f,h.rect)){const m=Math.min(f.a.x,f.b.x);l=Math.max(l,h.rect.right-m+n)}}}}if(l<=Zo){return}for(const u of s){const d=u.node.x;const f=u.node.width;if(typeof d!=="number"||typeof f!=="number"||!Number.isFinite(d)||!Number.isFinite(f)||f<=0){continue}u.node.x=d-l/2;u.node.width=f+l;u.node.groupTitleRect={...u.rect,left:u.rect.left-l,right:u.rect.right-l}}}function Pxn(e,t){const n=2;const r=4;const{realNodeRects:i}=RL(t.values());const o=e.filter(x=>!x.isLayoutOnly);const a=B((x,w=new Map)=>hc(w.get(x)??x.points??[]),"replacementPointsFor");const s=B((x=new Map)=>{let w=0;for(let _=0;_o.reduce((w,_)=>w+ov(a(_,x)),0),"totalBends");const u=B(x=>{const w=a(x);if(w.length<4){return void 0}const _=w[w.length-2];const C=w[w.length-1];if(!Xf(_,C,Zo)&&!jf(_,C,Zo)){return void 0}return{tailStart:_,terminal:C}},"terminalTailFor");const d=B((x,w)=>{const _=a(x);if(_.length<3){return void 0}const C=_[0];const A=_[1];let P;if(Xf(C,A,Zo)){P={x:A.x,y:w.tailStart.y}}else if(jf(C,A,Zo)){P={x:w.tailStart.x,y:A.y}}else{return void 0}const L=qC(hc([C,A,P,w.tailStart,w.terminal]));return js(L).length===L.length-1?L:void 0},"candidateWithDestinationTail");const f=B((x,w)=>{const _=[x.start,x.end].filter(C=>Boolean(C));for(const C of js(w)){if(bh(C.a,C.b,i,_,-n)){return true}}return false},"pathHasNodeHit");const h=B((x,w,_)=>{for(const C of o){if(C===x){continue}for(const A of js(w)){for(const P of js(a(C,_))){if(YC(A,P,.5)>=Fm){return true}}}}return false},"pathHasSharedTrack");const m=B((x,w,_)=>!f(x,w)&&!h(x,w,_),"candidateIsSafe");const g=B(()=>{const x=new Map;for(const w of o){const _=w.end;if(!_||!t.has(_)){continue}const C=a(w);if(C.length<4){continue}const A=x.get(_)??[];A.push(w);x.set(_,A)}return x},"edgesByDestination");for(let x=0;x=w){continue}if(X>A||X===A&&j>=P){continue}C=K;A=X;P=j}}}if(!C){return}for(const[L,I]of C){L.points=I}}}function Ixn(e,t){const n=2;const r=12;const i=4;const o=6;const{realNodeRects:a,labelNodeRects:s}=RL(t.values());const l=e.filter(L=>!L.isLayoutOnly);const u=B((L,I=new Map)=>hc(I.get(L)??L.points??[]),"replacementPointsFor");const d=B((L=new Map)=>{let I=0;for(let N=0;Nl.reduce((I,N)=>I+ov(u(N,L)),0),"totalBends");const h=B(L=>{const I=L.start;const N=L.end;const O=I?t.get(I):void 0;const z=N?t.get(N):void 0;const U=O?xx(O):void 0;const W=z?xx(z):void 0;return U&&W?{src:U,dst:W}:void 0},"endpointRectsFor");const m=B((L,I,N)=>{if(N.index<=0||N.index+1>=I.length-1){return void 0}const O=h(L);if(!O){return void 0}if(N.vertical){const z=N.a.x;const U=Math.min(O.src.left,O.dst.left);const W=Math.max(O.src.right,O.dst.right);const H=zW+Zo?"right":void 0;if(!H){return void 0}return{edge:L,points:I,segmentIndex:N.index,axis:"vertical",side:H,coord:z,min:Math.min(N.a.y,N.b.y),max:Math.max(N.a.y,N.b.y)}}if(N.horizontal){const z=N.a.y;const U=Math.min(O.src.top,O.dst.top);const W=Math.max(O.src.bottom,O.dst.bottom);const H=zW+Zo?"bottom":void 0;if(!H){return void 0}return{edge:L,points:I,segmentIndex:N.index,axis:"horizontal",side:H,coord:z,min:Math.min(N.a.x,N.b.x),max:Math.max(N.a.x,N.b.x)}}return void 0},"externalRailForSegment");const g=B(()=>{const L=[];for(const I of l){const N=u(I);for(const O of js(N)){const z=m(I,N,O);if(z){L.push(z)}}}return L},"collectExternalRails");const x=B((L,I)=>L.edge!==I.edge&&L.axis===I.axis&&L.side===I.side&&Z0(L.min,L.max,I.min,I.max)>=Fm,"railsInteract");const w=B(L=>{const I=[];const N=new Set;for(const O of L){if(N.has(O)){continue}const z=[O];const U=[];N.add(O);while(z.length>0){const W=z.pop();U.push(W);for(const H of L){if(!N.has(H)&&x(W,H)){N.add(H);z.push(H)}}}if(U.length>1){I.push(U)}}return I},"connectedComponents");const _=B(L=>{const I=[];for(const N of L){if(!I.some(O=>Math.abs(O-N.coord){const I=L.map(z=>z.coord);const N=_(L);const O=[];if(L.length<=o){const z=new Array(N.length).fill(false);const U=[];const W=B(()=>{if(U.length===L.length){if(U.some((H,$)=>Math.abs(H-I[$])>=Zo)){O.push([...U])}return}for(const[H,$]of N.entries()){if(z[H]){continue}z[H]=true;U.push($);W();U.pop();z[H]=false}},"visit");W();return O}for(let z=0;z{const N=new Map;for(const[z,U]of L.entries()){const W=I[z];const H=N.get(U.edge)??U.points.map($=>({x:$.x,y:$.y}));if(U.axis==="vertical"){H[U.segmentIndex].x=W;H[U.segmentIndex+1].x=W}else{H[U.segmentIndex].y=W;H[U.segmentIndex+1].y=W}N.set(U.edge,H)}const O=new Map;for(const[z,U]of N){const W=qC(hc(U));if(js(W).length!==W.length-1){return void 0}O.set(z,W)}return O},"replacementsForAssignment");const P=B(L=>{for(const[I,N]of L){const O=[I.start,I.end].filter(z=>Boolean(z));for(const z of js(N)){if(bh(z.a,z.b,a,O,-n)){return false}if(bh(z.a,z.b,s,[],-n)){return false}}}for(let I=0;I=Fm){return false}}}}}return true},"candidateIsSafe");for(let L=0;L=I){continue}const X=f($);const j=W.reduce((te,J,oe)=>te+Math.abs(H[oe]-J.coord),0);if(K>O||K===O&&(X>z||X===z&&j>=U)){continue}N=$;O=K;z=X;U=j}}if(!N){return}for(const[W,H]of N){W.points=H}}}function Mxn(e,t){const n=2;const r=8;const{realNodeRects:i,labelNodeRects:o}=RL(t.values());const a=e.filter(g=>!g.isLayoutOnly);const s=B((g,x,w)=>hc(g===x?w??[]:g.points??[]),"pointsFor");const l=B(g=>js(g).reduce((x,w)=>{const _=w.a.x-w.b.x;const C=w.a.y-w.b.y;return x+Math.hypot(_,C)},0),"pathLength");const u=B((g,x)=>{let w=0;for(let _=0;_{if(g.horizontal){const w=g.a.y;const _=Math.abs(w-x.top)<1||Math.abs(w-x.bottom)<1;return _&&Z0(g.a.x,g.b.x,x.left,x.right)>=Fm}if(g.vertical){const w=g.a.x;const _=Math.abs(w-x.left)<1||Math.abs(w-x.right)<1;return _&&Z0(g.a.y,g.b.y,x.top,x.bottom)>=Fm}return false},"segmentRunsAlongRectBorder");const f=B(g=>{const x=[g.start,g.end].filter(_=>Boolean(_));const w=[];for(const _ of x){const C=t.get(_);const A=C?xx(C):void 0;if(A){w.push(A)}}return w},"endpointRectsFor");const h=B((g,x)=>{if(x+3>=g.length){return[]}const w=g[x];const _=g[x+1];const C=g[x+2];const A=g[x+3];const P=Xf(w,_,Zo)&&jf(_,C,Zo)&&Xf(C,A,Zo);const L=jf(w,_,Zo)&&Xf(_,C,Zo)&&jf(C,A,Zo);if(!P&&!L){return[]}const I=P?Math.sign(_.x-w.x)!==Math.sign(A.x-C.x):Math.sign(_.y-w.y)!==Math.sign(A.y-C.y);if(!I){return[]}const N=Bl(w,A,Zo)||Xl(w,A,Zo)?[]:[{x:w.x,y:A.y},{x:A.x,y:w.y}];const O=N.length===0?[[...g.slice(0,x+1),...g.slice(x+3)]]:N.map(U=>[...g.slice(0,x+1),U,...g.slice(x+3)]);const z=new Set;return O.map(U=>qC(hc(U))).filter(U=>{if(js(U).length!==U.length-1){return false}if(!U.some(H=>L_(H,A,Zo))){return false}const W=U.map(H=>`${H.x.toFixed(3)},${H.y.toFixed(3)}`).join("|");if(z.has(W)){return false}z.add(W);return true})},"shortcutCandidatesAt");const m=B((g,x,w)=>{const _=[g.start,g.end].filter(A=>Boolean(A));const C=f(g);for(const A of js(x)){if(bh(A.a,A.b,i,_,-n)){return false}if(bh(A.a,A.b,o,[],-n)){return false}if(C.some(P=>d(A,P))){return false}}for(const A of a){if(A===g){continue}for(const P of js(x)){for(const L of js(s(A))){if(YC(P,L,.5)>=Fm){return false}}}}return u(g,x)<=w},"candidateIsSafe");for(let g=0;gC||K===C&&(W>A||W===A&&H>=P)){continue}w=L;_=U;C=K;A=W;P=H}}}if(!w||!_){return}w.points=_}}function Lxn(e,t){const n=20;const r=2;const i=4;const o=48;const a=[];for(const Ge of t.values()){if(Ge.isGroup||Ge.isEdgeLabel){continue}const it=Ge.x??0;const bt=Ge.y??0;const He=xx(Ge);if(!He){continue}a.push({id:String(Ge.id??""),cx:it,cy:bt,rect:He})}if(a.length===0){return}const s=new Map(a.map(Ge=>[Ge.id,Ge]));const l=a.map(Ge=>({id:Ge.id,rect:Ge.rect}));const u=["top","bottom","left","right"];const d={top:Math.min(...a.map(Ge=>Ge.rect.top))-n,bottom:Math.max(...a.map(Ge=>Ge.rect.bottom))+n,left:Math.min(...a.map(Ge=>Ge.rect.left))-n,right:Math.max(...a.map(Ge=>Ge.rect.right))+n};const f=e.filter(Ge=>!Ge.isLayoutOnly);const h=new Map(f.map((Ge,it)=>[Ge,it]));const m=B(Ge=>{const it=Ge==="left"||Ge==="top"?-1:1;const bt=[];for(let He=0;He<=r;He++){bt.push(d[Ge]+it*n*He)}return bt},"outwardTracksForSide");const g=B((Ge,it=new Map)=>hc(it.get(Ge)??Ge.points??[]),"replacementPointsFor");const x=B((Ge,it)=>{let bt=0;for(const He of Ge){for(const Je of it){if(RR(He.a,He.b,Je.a,Je.b,Zo)){bt++}}}return bt},"crossingCountBetweenSegments");const w=B((Ge,it)=>x(js(Ge),js(it)),"crossingCountBetweenPaths");const _=B((Ge=new Map)=>{let it=0;const bt=[];const He=new Set;const Je=[];const Te=B(we=>{if(!He.has(we)){He.add(we);Je.push(we)}},"addEdge");for(let we=0;we0){it+=ze;bt.push({first:Ze,second:Qe,count:ze});Te(Ze);Te(Qe)}}}Je.sort((we,Ze)=>(h.get(we)??0)-(h.get(Ze)??0));return{count:it,pairs:bt,edgeSet:He,edges:Je}},"crossingSnapshot");const C=B((Ge,it)=>{const bt=new Set(it.keys());if(bt.size===0){return Ge.count}let He=0;for(const Te of Ge.pairs){if(bt.has(Te.first)||bt.has(Te.second)){He+=Te.count}}let Je=0;for(let Te=0;Te{const it=new Map;for(const Je of Ge.pairs){const Te=it.get(Je.first)??new Set;Te.add(Je.second);it.set(Je.first,Te);const we=it.get(Je.second)??new Set;we.add(Je.first);it.set(Je.second,we)}const bt=[];const He=new Set;for(const Je of Ge.edges){if(He.has(Je)){continue}const Te=[Je];const we=[];He.add(Je);while(Te.length>0){const Ze=Te.pop();we.push(Ze);for(const Be of it.get(Ze)??[]){if(!He.has(Be)){He.add(Be);Te.push(Be)}}}we.sort((Ze,Be)=>(h.get(Ze)??0)-(h.get(Be)??0));if(we.length>1){bt.push(we)}}return bt},"crossingComponents");const P=B(Ge=>[Ge.start,Ge.end].filter(it=>Boolean(it)),"endpointIdsFor");const L=B(Ge=>{const it=[];for(const bt of A(Ge)){const He=new Set(bt);const Je=new Set(bt.flatMap(we=>P(we)));const Te=[...bt];for(const we of f){if(He.has(we)){continue}if(P(we).some(Ze=>Je.has(Ze))){Te.push(we)}}Te.sort((we,Ze)=>(h.get(we)??0)-(h.get(Ze)??0));it.push(Te)}return it},"pairSearchGroups");const I=B((Ge,it,bt)=>C(Ge,new Map([[it,bt]])),"crossingCountWithSingleReplacement");const N=B(Ge=>{const it=new Map;for(const bt of Ge.pairs){it.set(bt.first,(it.get(bt.first)??0)+bt.count);it.set(bt.second,(it.get(bt.second)??0)+bt.count)}return it},"currentCrossingsByEdge");const O=B(Ge=>Ge.slice(1).reduce((it,bt,He)=>{const Je=Ge[He];return it+Math.abs(bt.x-Je.x)+Math.abs(bt.y-Je.y)},0),"pathLength");const z=B((Ge=new Map)=>f.reduce((it,bt)=>it+ov(g(bt,Ge)),0),"totalBends");const U=B((Ge=new Map)=>f.reduce((it,bt)=>it+O(g(bt,Ge)),0),"totalLength");const W=B((Ge,it,bt=new Map)=>{const He=js(it);for(const Je of f){if(Je===Ge){continue}for(const Te of He){for(const we of js(g(Je,bt))){if(YC(Te,we,.5)>=Fm){return true}}}}return false},"pathHasSegmentConflict");const H=B((Ge,it)=>{const bt=[Ge.start,Ge.end].filter(He=>Boolean(He));for(const He of js(it)){if(bh(He.a,He.b,l,bt,-2)){return true}}return false},"pathHitsNode");const $=B((Ge,it)=>{const bt=qC(hc(it));if(js(bt).length===bt.length-1){Ge.push(bt)}},"pushOrthogonalCandidate");const K=B(Ge=>Ge==="left"||Ge==="right","sideIsHorizontal");const X=B((Ge,it,bt)=>{switch(it){case"left":return Math.min(Ge.x,bt.x)-n;case"right":return Math.max(Ge.x,bt.x)+n;case"top":return Math.min(Ge.y,bt.y)-n;case"bottom":return Math.max(Ge.y,bt.y)+n}},"localTrackForSameSide");const j=B((Ge,it,bt,He)=>{const Je=bt==="left"||bt==="top"?-1:1;const Te=[X(it,bt,He),d[bt]];for(const we of Te){for(let Ze=0;Ze<=r;Ze++){$(Ge,nJe(it,bt,He,we+Je*n*Ze))}}},"addSameSideCandidates");const te=B((Ge,it,bt,He,Je)=>{for(const Te of m(bt)){for(const we of m(Je)){$(Ge,[it,{x:Te,y:it.y},{x:Te,y:we},{x:He.x,y:we},He])}}},"addHorizontalToVerticalCandidates");const J=B((Ge,it,bt,He,Je)=>{for(const Te of m(bt)){for(const we of m(Je)){$(Ge,[it,{x:it.x,y:Te},{x:we,y:Te},{x:we,y:He.y},He])}}},"addVerticalToHorizontalCandidates");const oe=B((Ge,it,bt,He,Je)=>{const Te=[...m("top"),...m("bottom")];for(const we of m(bt)){for(const Ze of m(Je)){for(const Be of Te){$(Ge,[it,{x:we,y:it.y},{x:we,y:Be},{x:Ze,y:Be},{x:Ze,y:He.y},He])}}}},"addHorizontalPairCandidates");const se=B((Ge,it,bt,He,Je)=>{const Te=[...m("left"),...m("right")];for(const we of m(bt)){for(const Ze of m(Je)){for(const Be of Te){$(Ge,[it,{x:it.x,y:we},{x:Be,y:we},{x:Be,y:Ze},{x:He.x,y:Ze},He])}}}},"addVerticalPairCandidates");const re=B(Ge=>{const it=new Set;return Ge.map(bt=>hc(bt)).filter(bt=>{const He=bt.map(Je=>`${Je.x.toFixed(3)},${Je.y.toFixed(3)}`).join("|");if(it.has(He)||bt.length<2){return false}it.add(He);return true})},"dedupeCandidatePaths");const ce=B((Ge,it,bt,He)=>{const Je=[];const Te=tJe(Ge,it,bt,He,n,Zo);if(Te){$(Je,Te)}if(it===He){j(Je,Ge,it,bt)}const we=K(it);const Ze=K(He);if(we&&!Ze){te(Je,Ge,it,bt,He)}else if(!we&&Ze){J(Je,Ge,it,bt,He)}else if(we){oe(Je,Ge,it,bt,He)}else{se(Je,Ge,it,bt,He)}return re(Je)},"buildCandidatesForSides");const ue=B((Ge,it,bt,He)=>{const Je=[...m("left"),...m("right")];const Te=[...m("top"),...m("bottom")];for(const we of u){const Ze=cB(He,we);const Be=we==="top"||we==="bottom"?m(we):Te;for(const qe of Je){$(Ge,[it,bt,{x:qe,y:bt.y},{x:qe,y:Ze.y},Ze]);for(const Qe of Be){$(Ge,[it,bt,{x:qe,y:bt.y},{x:qe,y:Qe},{x:Ze.x,y:Qe},Ze])}}}},"addVerticalDepartureOuterTrackCandidates");const xe=B((Ge,it,bt,He)=>{const Je=[...m("left"),...m("right")];const Te=[...m("top"),...m("bottom")];for(const we of u){const Ze=cB(He,we);const Be=we==="left"||we==="right"?m(we):Je;for(const qe of Te){$(Ge,[it,bt,{x:bt.x,y:qe},{x:Ze.x,y:qe},Ze]);for(const Qe of Be){$(Ge,[it,bt,{x:bt.x,y:qe},{x:Qe,y:qe},{x:Qe,y:Ze.y},Ze])}}}},"addHorizontalDepartureOuterTrackCandidates");const be=B(Ge=>{const it=Ge.start;const bt=Ge.end;const He=bt?s.get(bt):void 0;if(!it||!He){return[]}const Je=hc(Ge.points??[]);if(Je.length<4){return[]}const Te=Je[0];const we=Je[1];const Ze=[];if(jf(Te,we,Zo)){ue(Ze,Te,we,He)}else if(Xf(Te,we,Zo)){xe(Ze,Te,we,He)}return Ze},"terminalPreservingOuterTrackCandidates");const Ie=B(Ge=>{const it=Ge.start;const bt=Ge.end;const He=it?s.get(it):void 0;const Je=bt?s.get(bt):void 0;if(!He||!Je){return[]}const Te=[];for(const we of u){const Ze=cB(He,we);for(const Be of u){Te.push(...ce(Ze,we,cB(Je,Be),Be))}}Te.push(...be(Ge));return Te},"candidatePathsFor");const he=B(()=>new Map(f.map(Ge=>[Ge,js(g(Ge))])),"currentSegmentsByEdge");const ve=B((Ge,it,bt)=>{const He=new Set;for(const Je of f){if(Je===Ge){continue}const Te=bt.get(Je)??js(g(Je));if(it.some(we=>Te.some(Ze=>YC(we,Ze,.5)>=Fm))){He.add(Je)}}return He},"sharedTrackConflictsFor");const ge=B((Ge,it,bt,He)=>{const Je=new Set;const Te=Ie(Ge).map(we=>qC(hc(we))).filter(we=>{if(H(Ge,we)){return false}const Ze=we.map(Be=>`${Be.x.toFixed(3)},${Be.y.toFixed(3)}`).join("|");if(Je.has(Ze)||we.length<2){return false}Je.add(Ze);return true}).map(we=>{const Ze=js(we);let Be=0;for(const qe of f){if(qe===Ge){continue}Be+=x(Ze,bt.get(qe)??js(g(qe)))}return{candidate:we,candidateSegments:Ze,crossings:it.count-(He.get(Ge)??0)+Be,bends:ov(we,Zo),totalBends:ov(we),length:O(we)}}).filter(({crossings:we})=>we<=it.count).sort((we,Ze)=>we.crossings-Ze.crossings||we.bends-Ze.bends||we.length-Ze.length);return Te.slice(0,o).map(we=>{return{path:we.candidate,segments:we.candidateSegments,sharedTrackConflicts:ve(Ge,we.candidateSegments,bt),totalBends:we.totalBends,length:we.length}})},"pairCandidatesFor");const Ve=B((Ge,it,bt,He,Je,Te)=>{let we=0;for(const Be of Ge.pairs){if(Be.first===it||Be.second===it||Be.first===He||Be.second===He){we+=Be.count}}let Ze=x(bt.segments,Je.segments);for(const Be of f){if(Be===it||Be===He){continue}const qe=Te.get(Be)??js(g(Be));Ze+=x(bt.segments,qe)+x(Je.segments,qe)}return Ge.count-we+Ze},"pairCrossingCount");const Le=B((Ge,it)=>{for(const bt of Ge.sharedTrackConflicts){if(bt!==it){return false}}return true},"conflictsOnlyWith");const $e=B((Ge,it)=>Ge.segments.some(bt=>it.segments.some(He=>YC(bt,He,.5)>=Fm)),"candidatesShareTrack");const Ee=B((Ge,it,bt,He)=>Le(it,bt.edge)&&Le(He,Ge.edge)&&!$e(it,He),"pairCandidatesAreCompatible");const tt=B((Ge,it,bt,He,Je)=>{const Te=Ve(Ge.current,it.edge,bt,He.edge,Je,Ge.baseSegments);if(Te>=Ge.current.count){return void 0}return{replacements:new Map([[it.edge,bt.path],[He.edge,Je.path]]),crossings:Te,bends:Ge.currentBends-(Ge.baseBendsByEdge.get(it.edge)??0)-(Ge.baseBendsByEdge.get(He.edge)??0)+bt.totalBends+Je.totalBends,length:Ge.currentLength-(Ge.baseLengthByEdge.get(it.edge)??0)-(Ge.baseLengthByEdge.get(He.edge)??0)+bt.length+Je.length}},"scorePairReplacement");const yt=B((Ge,it)=>Ge.crossings{let Je=He;for(const Te of it.candidates){for(const we of bt.candidates){if(!Ee(it,Te,bt,we)){continue}const Ze=tt(Ge,it,Te,bt,we);if(Ze&&yt(Ze,Je)){Je=Ze}}}return Je},"bestScoreForOptionPair");const ct=B(Ge=>{const it=z();const bt=U();const He=he();const Je=N(Ge);const Te=new Map(f.map(ze=>[ze,ov(g(ze))]));const we=new Map(f.map(ze=>[ze,O(g(ze))]));const Ze=new Map;const Be=L(Ge);for(const ze of Be){for(const Me of ze){if(Ze.has(Me)){continue}const ye=ge(Me,Ge,He,Je);if(ye.length>0){Ze.set(Me,{edge:Me,candidates:ye})}}}let qe={replacements:new Map,crossings:Ge.count,bends:it,length:bt};const Qe={current:Ge,currentBends:it,currentLength:bt,baseBendsByEdge:Te,baseLengthByEdge:we,baseSegments:He};for(const ze of Be){const Me=new Set(ze.filter(Ne=>Ge.edgeSet.has(Ne)));const ye=ze.map(Ne=>Ze.get(Ne)).filter(Ne=>Boolean(Ne));for(let Ne=0;Ne0?qe.replacements:void 0},"bestPairedReplacement");for(let Ge=0;GeTe||ye===Te&&Ne>=we){continue}He=Be;Je=Qe;Te=ye;we=Ne}}if(He&&Je){He.points=Je;continue}const Ze=ct(it);if(!Ze){return}for(const[Be,qe]of Ze){Be.points=qe}}}function Dxn(e,t){const{nodeInfoById:n,realNodeRects:r}=TCe(t);const i=["top","bottom","left","right"];const o=20;const a={top:Math.min(...r.map(x=>x.rect.top))-o,bottom:Math.max(...r.map(x=>x.rect.bottom))+o,left:Math.min(...r.map(x=>x.rect.left))-o,right:Math.max(...r.map(x=>x.rect.right))+o};const s=B((x,w,_,C)=>{const A=[];const P=tJe(x,w,_,C,o,kL);if(P){A.push(P)}if(w===C){A.push(nJe(x,w,_,a[w]))}return A},"buildOrthogonalPathCandidates");const l=B((x,w)=>{for(let _=0;_{let C=0;const A=N$(x,kL);const P=w.start;const L=w.end;for(const I of e){if(I===w||I.isLayoutOnly){continue}const N=I.start;const O=I.end;if(!_&&P&&L&&(N===P||N===L||O===P||O===L)){continue}const z=I.points;if(!z||z.length<2){continue}for(const U of A){for(const W of N$(z,kL)){if(iJe(U.a,U.b,W.a,W.b,kL,kL)){C++;continue}if(YC(U,W,kL)>=k2i){C++}}}}return C},"pathConflictCount");const d=4;const f=B((x,w)=>{const _=Math.abs(x.y-w.rect.top);const C=Math.abs(x.y-w.rect.bottom);const A=Math.abs(x.x-w.rect.left);const P=Math.abs(x.x-w.rect.right);let L="top";let I=_;if(C{const C=h.get(x)??[];C.push({side:w,edgeId:_});h.set(x,C)},"addFaceClaim");for(const x of e){if(x.isLayoutOnly){continue}const w=x.points??[];if(w.length<1){continue}const _=x.id??"";const C=x.start;const A=x.end;if(C){const P=n.get(C);if(P){m(C,f(w[0],P),_)}}if(A){const P=n.get(A);if(P){m(A,f(w[w.length-1],P),_)}}}const g=B((x,w,_)=>{return h.get(x)?.some(C=>C.edgeId!==_&&C.side===w)??false},"faceIsClaimed");for(const x of e){if(x.isLayoutOnly){continue}const w=x.points;if(!w||w.length<2){continue}const _=ov(w,kL);if(_0){const J=u(j,x,true);if(J>U||J===U&&te>=W){continue}U=J;W=te;z=j;continue}if(u(j,x)>O){continue}if(teK.edgeId!==I))}const $=h.get(A);if($){h.set(A,$.filter(K=>K.edgeId!==I))}m(C,f(z[0],P),I);m(A,f(z[z.length-1],L),I)}}}function OZe(e,t){const n=t?0:e.length-1;const r=t?1:-1;const i=e[n];const o=e[n+r];if(!i||!o){return void 0}const a=o.x-i.x;const s=o.y-i.y;const l=Math.abs(a)+Math.abs(s);if(lo&&fCe(e,Fxn(o)))}function cCe(e,t){const n=[];for(const g of e){if(g.isLayoutOnly){continue}const x=g.points;if(!x||x.length<2){continue}for(let w=0;w{const w=_Ze(x,o);for(const{nodeId:_,rect:C}of r){if(_===g){continue}if(fCe(w,C)){return true}}return false},"labelOverlapsForeignNode");const u=B((g,x)=>{const w=_Ze(x,o);for(const _ of n){if(_.edgeId===g){continue}if(_Ce(_.p1,_.p2,w)){return true}}return false},"labelOverlapsForeignEdge");const d=B((g,x,w)=>l(g,w)||u(x,w),"labelOverlapsAnything");const f=[];const h=B(g=>{for(const{id:x,rect:w}of i){if(cxn(w,g)){return x}}return void 0},"findContainingLane");const m=B((g,x)=>f.some(w=>w.labelId!==g&&fCe(x,w.rect)),"overlapsPlacedLabel");for(const g of e){if(g.isLayoutOnly){continue}const x=g.labelNodeId;if(!x){continue}const w=t.get(x);if(!w){continue}const _=g.points;if(!_||_.length<2){continue}const C=w.width??0;const A=w.height??0;if(C<=0||A<=0){continue}const P=[];for(let re=0;re<_.length-1;re++){const ce=_[re];const ue=_[re+1];const xe=Math.abs(ce.x-ue.x);const be=Math.abs(ce.y-ue.y);if(xe=bx&&be>=bx){continue}P.push({idx:re,length:xe+be,orientation:xe>=bx?"horizontal":"vertical",midX:(ce.x+ue.x)/2,midY:(ce.y+ue.y)/2})}if(P.length===0){continue}const L=P.length>=3?P.filter(re=>re.idx>0&&re.idx0?L:P;const N=C>=A?"horizontal":"vertical";const O=B(re=>{return[...re].sort((ce,ue)=>{const xe=ce.orientation===N;const be=ue.orientation===N;if(xe!==be){return xe?-1:1}const Ie=ce.length>=(ce.orientation==="horizontal"?C:A)+2;const he=ue.length>=(ue.orientation==="horizontal"?C:A)+2;if(Ie!==he){return Ie?-1:1}return ue.length-ce.length})},"rankSegments");const z=P[0];const U=P[P.length-1];const W=[.5,.25,.75,.05,.95,.15,.85,.1,.9];const H=B((re,ce)=>{const ue=_[re.idx];const xe=_[re.idx+1];return{midX:ue.x+(xe.x-ue.x)*ce,midY:ue.y+(xe.y-ue.y)*ce}},"anchorAtT");const $=B((re,ce,ue)=>Math.min(ue,Math.max(ce,re)),"clamp");const K=B((re,ce)=>re.midX>=ce.left-bx&&re.midX<=ce.right+bx&&re.midY>=ce.top-bx&&re.midY<=ce.bottom+bx,"pointInsideRectInclusive");const X=B(re=>{const ce=F$(re.midX,re.midY,C,A);const ue=h(ce);if(ue){return{laneId:ue,anchor:re,rect:ce}}const xe=i.find(({rect:Le})=>K(re,Le));if(!xe){return void 0}const be=xe.rect.left+C/2+a;const Ie=xe.rect.right-C/2-a;const he=xe.rect.top+A/2+a;const ve=xe.rect.bottom-A/2-a;if(be>Ie||he>ve){return void 0}const ge={midX:$(re.midX,be,Ie),midY:$(re.midY,he,ve)};const Ve=F$(ge.midX,ge.midY,C,A);return K(re,Ve)?{laneId:xe.id,anchor:ge,rect:Ve}:void 0},"placementForAnchor");const j=B((re,ce,ue)=>re.orientation==="horizontal"?Math.abs(ce.midX-ue.x):Math.abs(ce.midY-ue.y),"distanceAlongSegment");const te=B((re,ce)=>{const ue=re.orientation==="horizontal"?C/2:A/2;const xe=ue+s;if(re===z){const be=_[re.idx];if(j(re,ce,be)+bx{const ce=O(re);for(const ue of ce){for(const xe of W){const be=H(ue,xe);if(!te(ue,be)){continue}const Ie=X(be);if(!Ie){continue}if(BZe(Ie.rect,_)){continue}if(m(x,Ie.rect)){continue}if(!d(x,g.id,Ie.rect)){return{laneId:Ie.laneId,anchor:Ie.anchor}}}}return void 0},"tryPool");const oe=B((re,ce,ue=false)=>{const xe=O(re);for(const be of xe){const Ie={midX:be.midX,midY:be.midY};if(ce&&!te(be,Ie)){continue}const he=X(Ie);if(he&&!BZe(he.rect,_)&&!m(x,he.rect)&&!l(x,he.rect)&&(ue||!u(g.id,he.rect))){return{laneId:he.laneId,anchor:he.anchor}}}return void 0},"findLaneContainingFallback");const se=J(I)??(I.lengthue.labelId===x);if(ce>=0){f[ce]={labelId:x,rect:re}}else{f.push({labelId:x,rect:re})}}}}function zZe(e,t){return e{const d=zZe(s,l);let f=0;const h=B(m=>{if(!m){return}const g=i.get(m);if(!g){return}const x=u==="x"?g.w/2:g.h/2;if(x>f){f=x}},"consider");h(a.labelNodeId);for(const m of e){if(m===a){continue}if(m.isLayoutOnly){continue}const g=m.start;const x=m.end;if(!g||!x){continue}if(zZe(g,x)!==d){continue}h(m.labelNodeId)}return f>0?f+P2i:0},"labelClearanceFor");for(const a of e){if(a.isLayoutOnly){continue}const s=a.points;if(!QZe(s,gZe)){continue}const l=rJe(a,n,gZe);if(!l){continue}const{srcId:u,dstId:d,srcInfo:f,dstInfo:h,collinearX:m,collinearY:g}=l;if(m===g){continue}let x;let w;if(m){const L=h.cy>f.cy;x={x:f.cx,y:L?f.rect.bottom:f.rect.top};w={x:h.cx,y:L?h.rect.top:h.rect.bottom}}else{const L=h.cx>f.cx;x={x:L?f.rect.right:f.rect.left,y:f.cy};w={x:L?h.rect.left:h.rect.right,y:h.cy}}if(bh(x,w,r,[u,d],1)){continue}const _=m?"x":"y";const C=o(a,u,d,_);const A=C>Gbn?C:Gbn;const P=[0,A,-A];for(const L of P){const I={...x};const N={...w};if(m){I.x+=L;N.x+=L;if(I.x<=f.rect.left||I.x>=f.rect.right){continue}if(N.x<=h.rect.left||N.x>=h.rect.right){continue}}else{I.y+=L;N.y+=L;if(I.y<=f.rect.top||I.y>=f.rect.bottom){continue}if(N.y<=h.rect.top||N.y>=h.rect.bottom){continue}}if(bh(I,N,r,[u,d],1)){continue}if(hCe(I,N,e,a,{epsilon:gZe})){continue}a.points=[I,N];break}}}function UZe(e,t){const n=.001;const r=8;const i=7;const o=i;const a=20;const s=2;const l=12;const{realNodeRects:u,labelNodeRects:d}=RL(t.values());const f=B((I,N)=>{return N$(N,n).map(O=>({...O,edge:I,interior:O.index>=1&&O.index<=N.length-3}))},"segmentsFor");const h=B(()=>{const I=[];for(const N of e){if(N.isLayoutOnly){continue}const O=N.points;if(!O||O.length<2){continue}I.push(...f(N,hc(O)))}return I},"allSegments");const m=B((I,N)=>{if(I.horizontal&&N.horizontal){return Z0(I.a.x,I.b.x,N.a.x,N.b.x)>=r&&Math.abs(I.a.y-N.a.y)=r&&Math.abs(I.a.x-N.a.x){const O=I.start;const z=I.end;const U=f(I,N);if(U.length!==N.length-1){return false}const W=[O,z].filter($=>Boolean($));const H=I.labelNodeId?[I.labelNodeId]:[];for(const $ of U){if(bh($.a,$.b,u,W,-s)){return false}if(bh($.a,$.b,d,H,-s)){return false}}for(const $ of e){if($===I||$.isLayoutOnly){continue}const K=$.points;if(!K||K.length<2){continue}for(const X of U){for(const j of f($,hc(K))){if(m(X,j)){return false}if(RR(X.a,X.b,j.a,j.b,n)){return false}}}}return true},"candidateIsSafe");const x=B((I,N)=>{const O=hc(I.edge.points??[]);if(O.length<4||I.index>=O.length-1){return void 0}const z=O.map(U=>({...U}));if(I.horizontal){z[I.index].y+=N;z[I.index+1].y+=N}else if(I.vertical){z[I.index].x+=N;z[I.index+1].x+=N}else{return void 0}return f(I.edge,z).length===z.length-1?z:void 0},"shiftedCandidate");const w=B((I,N)=>({x:I.x??(N.left+N.right)/2,y:I.y??(N.top+N.bottom)/2}),"nodeCenter");const _=B(I=>{const N=I.edge;const O=hc(N.points??[]);if(O.length!==4||I.index!==1){return void 0}const z=N.start?t.get(N.start):void 0;const U=N.end?t.get(N.end):void 0;const W=z?xx(z):void 0;const H=U?xx(U):void 0;const $=O.slice(I.index+2);if(!z||!U||!W||!H||$.length===0){return void 0}return{sourceCenter:w(z,W),targetCenter:w(U,H),sourceRect:W,tail:$}},"sourceDetourContextFor");const C=B((I,N,O,z,U,W)=>{const H=z.y>=O.y;const $=H?U.bottom:U.top;const K=$+(H?a:-a);if(H&&I.b.y<=K+n||!H&&I.b.y>=K-n){return void 0}const X=I.a.x+N;return hc([{x:O.x,y:$},{x:O.x,y:K},{x:X,y:K},{x:X,y:I.b.y},...W],n)},"verticalSourceDetour");const A=B((I,N,O,z,U,W)=>{const H=z.x>=O.x;const $=H?U.right:U.left;const K=$+(H?a:-a);if(H&&I.b.x<=K+n||!H&&I.b.x>=K-n){return void 0}const X=I.a.y+N;return hc([{x:$,y:O.y},{x:K,y:O.y},{x:K,y:X},{x:I.b.x,y:X},...W],n)},"horizontalSourceDetour");const P=B((I,N)=>{const O=_(I);if(!O){return void 0}if(I.vertical){return C(I,N,O.sourceCenter,O.targetCenter,O.sourceRect,O.tail)}if(I.horizontal){return A(I,N,O.sourceCenter,O.targetCenter,O.sourceRect,O.tail)}return void 0},"sourceDetourCandidate");const L=[-i,i,-2*i,2*i,-3*i,3*i];for(let I=0;IK.interior);for(const K of $){for(const X of L){const j=x(K,X);if(j&&g(K.edge,j)){K.edge.points=j;O=true;break}const te=P(K,X);if(te&&g(K.edge,te)){K.edge.points=te;O=true;break}}if(O){break}}}}if(!O){return}}}function Oxn(e,t,n,r){const i=t.x-e.x;const o=t.y-e.y;const a=r.x-n.x;const s=r.y-n.y;const l=i*s-o*a;if(Math.abs(l)<1e-10){return false}const u=n.x-e.x;const d=n.y-e.y;const f=(u*s-d*a)/l;const h=(u*o-d*i)/l;const m=.01;return f>m&&f<1-m&&h>m&&h<1-m}function Bxn(e){const t=e.nodes??[];const n=e.edges??[];const r=[];if(!n.length||!t.length){return r}const i=uxn(t);const o=1;const a=[];for(const l of n){if(l.isLayoutOnly){continue}const u=l.points;if(!u||u.length<2){continue}const d=l.start;const f=l.end;const h=l.labelNodeId;const m=l.id??`${d}->${f}`;for(const g of i){if(g.nodeId===d||g.nodeId===f){continue}if(h&&g.nodeId===h){continue}for(let x=0;x0){const l=r.filter(d=>d.type==="edge-node-overlap").length;const u=r.filter(d=>d.type==="edge-edge-crossing").length;wt.warn(`[SWIMLANE_VALIDATE] ${r.length} issue(s) detected: ${l} edge-node overlap(s), ${u} edge crossing(s)`);for(const d of r){wt.warn(`[SWIMLANE_VALIDATE] ${d.type}: ${d.detail}`)}}return r}function zxn(e,t){const n=e.nodes??[];const r=e.edges??[];const i=n.filter(s=>!s.isGroup);if((t==="LR"||t==="RL")&&i.length>0&&!Cxn(e,t)){return}if(t==="BT"&&i.length>0&&!Exn(e)){return}for(const s of r){if(s.isLayoutOnly){continue}const l=s.points;if(!l||l.length<2){continue}s.points=qC(pCe(l))}Dxn(r,n);Nxn(r,n);Sxn(r,n);const o=new Map;for(const s of n){o.set(String(s.id),s)}cCe(r,o);mxn(r,o);Axn(r,o);UZe(r,o);kxn(r,o);Rxn(r,o);DZe(r,o);Pxn(r,o);const a=B(()=>{Lxn(r,o);Ixn(r,o);Mxn(r,o);cCe(r,o);MZe(r,o);DZe(r,o);cCe(r,o);MZe(r,o)},"finalizeRenderedEdges");a();UZe(r,o);a();FZe(r,o);NZe(r,o);FZe(r,o);NZe(r,o)}function PL(e){const t=new Map(e.nodeById);const n=new Set;const r=[];for(const o of e.edges){if(!t.has(o.src)||!t.has(o.dst)){continue}const a=`${o.id}:${o.src}->${o.dst}`;if(n.has(a)){continue}n.add(a);r.push(o)}const i=[...t.keys()];return{nodes:i,edges:r,layout:e.layout,nodeById:t}}function cJe(e,t){return e.edges.filter(n=>n.dst===t)}function Uxn(e){const t=new Map;for(const n of e.nodes){t.set(n,[])}for(const n of e.edges){t.get(n.src).push(n.dst)}return t}function uJe(e){const t=Uxn(e);for(const n of t.values()){n.sort((r,i)=>r.localeCompare(i))}return t}function dJe(e){const t=new Map;for(const n of e.nodes){t.set(n,0)}for(const n of e.edges){t.set(n.dst,(t.get(n.dst)??0)+1)}return t}function fJe(e){return[...e.entries()].filter(([,t])=>t===0).map(([t])=>t).sort((t,n)=>t.localeCompare(n))}function wCe(e,t=()=>true){const n=new Map;const r=new Map;for(const i of e.nodes){n.set(i,[]);r.set(i,[])}for(const i of e.edges){if(!t(i)){continue}r.get(i.src).push(i.dst);n.get(i.dst).push(i.src)}return{preds:n,succs:r}}function hJe(e,t,n,r){let i=0;for(const a of e.nodes){if(r?.skipGroups&&e.nodeById.get(a)?.isGroup){continue}i=Math.max(i,n[a]??0)}const o=Array.from({length:i+1},()=>[]);for(const a of t){if(r?.skipGroups&&e.nodeById.get(a)?.isGroup){continue}o[Math.max(0,n[a]??0)].push(a)}return o}function Kee(e){const t=dJe(e);const n=fJe(t);const r=[];const i=uJe(e);while(n.length){const o=n.shift();r.push(o);for(const a of i.get(o)??[]){t.set(a,(t.get(a)??0)-1);if((t.get(a)??0)===0){let s=0;while(s{if(i-r<=1){return 0}const o=r+i>>1;let a=n(r,o)+n(o,i);let s=r;let l=o;let u=r;while(s=i||sf.dst===h.dst?f.id.localeCompare(h.id):f.dst.localeCompare(h.dst))}const r=Object.create(null);for(const d of t.nodes){r[d]=0}const i=[];const o=B(d=>{r[d]=1;for(const f of n.get(d)??[]){const h=f.dst;if(r[h]===0){o(h)}else if(r[h]===1){i.push(f)}}r[d]=2},"dfs");const a=[...t.nodes].sort((d,f)=>d.localeCompare(f));for(const d of a){if(r[d]===0){o(d)}}const s=new Set(i.map(d=>`${d.id}:${d.src}->${d.dst}`));const l=t.edges.map(d=>s.has(`${d.id}:${d.src}->${d.dst}`)?{id:d.id,src:d.dst,dst:d.src,weight:d.weight,ref:d.ref}:d);const u={nodes:[...t.nodes],edges:l,layout:t.layout,nodeById:new Map(t.nodeById)};return{acyclic:u,reversed:i}}function $xn(e){const t=new Map;const n=B(r=>{if(t.has(r)){return t.get(r)}const i=e.nodeById.get(r);if(!i){t.set(r,null);return null}const o=i.parentId;if(!o){t.set(r,null);return null}const a=n(o);const s=a??o;t.set(r,s);return s},"resolve");for(const r of e.nodes){n(r)}return t}function PR(e){const t=$xn(e);return n=>t.get(n)??null}function ECe(e){const t=[];for(const n of e.layout.nodes??[]){if(n.isGroup&&!n.parentId){t.push(n.id)}}return[...new Set(t)].reverse()}function mJe(e,t){const n=ECe(e);if(!t||t.length===0){return n}const r=new Set(n);const i=new Set;const o=[];for(const a of t){if(!r.has(a)||i.has(a)){continue}i.add(a);o.push(a)}for(const a of n){if(i.has(a)){continue}o.push(a)}return o}function Gxn(e,t){const n=PL(e);const r=t?.laneOf??(()=>null);const i=t?.rankHint;const{preds:o}=wCe(n);for(const L of o.values()){L.sort((I,N)=>I.localeCompare(N))}const a=Kee(n)??[...n.nodes].sort((L,I)=>L.localeCompare(I));const s=new Map;for(const[L,I]of a.entries()){s.set(I,L)}const l=new Map;const u=new Map;for(const L of n.nodes){u.set(L,[])}for(const L of a){const I=(o.get(L)??[]).filter(N=>l.has(N));if(I.length>0){const N=Hxn(L,I,{laneOf:r,rankHint:i,topoIndex:s});l.set(L,N);u.get(N).push(L)}else if(!l.has(L)){l.set(L,null)}}for(const L of n.nodes){if(!l.has(L)){l.set(L,null)}}const d=new Set;for(const L of n.nodes){if((l.get(L)??null)===null){d.add(L)}}const f=[...d].sort((L,I)=>{const N=s.get(L)??0;const O=s.get(I)??0;if(N===O){return L.localeCompare(I)}return N-O});const h=Wxn(n);const m=new Map;for(const[L,I]of h.entries()){m.set(L,[...I].sort((N,O)=>N.localeCompare(O)))}const g=Yxn(m);const x=qxn(m);const w=new Map;for(const L of n.nodes){w.set(L,[])}for(const L of x){for(const I of L.nodes){const N=w.get(I);if(N){N.push(L.id)}else{w.set(I,[L.id])}}}const _=[];const C=[];const A=new Set;const P=B(L=>{if(A.has(L)){return}A.add(L);_.push(L);for(const I of u.get(L)??[]){P(I)}C.push(L)},"walk");for(const L of f){P(L)}for(const L of a){P(L)}return{parent:l,children:u,roots:f,componentOf:g,blocks:x,nodeBlocks:w,adjacency:m,preorder:_,postorder:C,topologicalOrder:a}}function Hxn(e,t,n){const r=n.laneOf(e);const i=[...t].sort((o,a)=>{const s=n.laneOf(o);const l=n.laneOf(a);const u=s!=null&&s===r;const d=l!=null&&l===r;if(u!==d){return u?-1:1}const f=n.rankHint?.[o];const h=n.rankHint?.[a];if(f!=null&&h!=null&&f!==h){return h-f}const m=n.topoIndex.get(o)??0;const g=n.topoIndex.get(a)??0;if(m!==g){return m-g}return o.localeCompare(a)});return i[0]}function Wxn(e){const t=new Map;for(const n of e.nodes){t.set(n,new Set)}for(const n of e.edges){t.get(n.src).add(n.dst);t.get(n.dst).add(n.src)}return t}function Yxn(e){const t=new Map;let n=0;for(const r of e.keys()){if(t.has(r)){continue}const i=[r];while(i.length>0){const o=i.pop();if(t.has(o)){continue}t.set(o,n);for(const a of e.get(o)??[]){if(!t.has(a)){i.push(a)}}}n++}return t}function qxn(e){const t=new Map;const n=new Map;const r=[];const i=[];let o=0;const a=B((s,l)=>{t.set(s,++o);n.set(s,o);for(const u of e.get(s)??[]){if(u===l){continue}if(!t.has(u)){r.push([s,u]);a(u,s);n.set(s,Math.min(n.get(s)??o,n.get(u)??o));if((n.get(u)??0)>=(t.get(s)??0)){i.push(Xxn(s,u,r,i.length))}}else if((t.get(u)??0)<(t.get(s)??0)){r.push([s,u]);n.set(s,Math.min(n.get(s)??o,t.get(u)??o))}}},"visit");for(const s of e.keys()){if(!t.has(s)){a(s,null)}}return i}function Xxn(e,t,n,r){const i=[];const o=new Set;while(n.length>0){const a=n.pop();i.push(a);o.add(a[0]);o.add(a[1]);if(a[0]===e&&a[1]===t||a[0]===t&&a[1]===e){break}}return{id:r,edges:i,nodes:[...o]}}function jxn(e,t,n){const r=[...e.nodes];const i=new Map;for(const[C,A]of r.entries()){i.set(A,C)}const o=r.length;const a=new Array(o).fill(-1);const s=new Array(o).fill(0);const l=[];const u=new Set;for(const C of r){const A=n.parent.get(C)??null;const P=i.get(C);if(P==null){continue}if(A==null){a[P]=-1;s[P]=0;if(!u.has(C)){u.add(C);l.push(C)}}}while(l.length>0){const C=l.shift();const A=i.get(C);if(A==null){continue}const P=n.children.get(C)??[];for(const L of P){if(u.has(L)){continue}const I=i.get(L);if(I==null){continue}a[I]=A;s[I]=s[A]+1;u.add(L);l.push(L)}}for(const C of r){if(u.has(C)){continue}const A=i.get(C);if(A==null){continue}a[A]=-1;s[A]=0;u.add(C)}const d=Math.max(1,Math.ceil(Math.log2(Math.max(1,o)))+1);const f=Array.from({length:d},()=>new Array(o).fill(-1));for(let C=0;C{if(C===-1||A===-1){return-1}if(s[C]>L&1){C=f[L][C];if(C===-1){return-1}}}if(C===A){return C}for(let L=d-1;L>=0;L--){const I=f[L][C];const N=f[L][A];if(I===-1||N===-1){continue}if(I!==N){C=I;A=N}}return f[0][C]},"lcaIndex");const m=Array.from({length:o},()=>new Map);for(const C of e.edges){let A=C.src;let P=C.dst;let L=t[A];let I=t[P];if(L==null||I==null){continue}if(L>I){[A,P]=[P,A];[L,I]=[I,L]}if(L==null||I==null||L===I){continue}const N=i.get(A);const O=i.get(P);if(N==null||O==null){continue}const z=h(N,O);if(z===-1){continue}const U=m[z];for(let W=L;W{if(A.size===0){return}for(const[P,L]of A){C.set(P,(C.get(P)??0)+L)}},"mergeInto");const w=new Set;const _=B(C=>{const A=i.get(C);w.add(C);const P=A==null?void 0:m[A];const L=P?new Map(P):new Map;const I=n.children.get(C)??[];for(const N of I){const O=_(N);const z=t[C];if(z!=null){let U=g.get(C);if(!U){U=new Map;g.set(C,U)}let W=O.get(z)??0;const H=t[N];if(H!=null&&H>z){W+=1}U.set(N,W)}x(L,O)}return L},"dfs");for(const C of n.roots){if(!w.has(C)){_(C)}}for(const C of r){if(!w.has(C)){_(C)}}return g}function Kxn(e,t,n){const r=new Map;const i=B(o=>{let a=n[o]??0;const s=[...t.get(o)??[]];s.sort(gJe(n));for(const l of s){i(l);const u=r.get(l);if(u!=null){a=Math.min(a,u)}}r.set(o,a)},"annotate");for(const o of e){i(o)}return r}function gJe(e){return(t,n)=>{const r=e[t]??0;const i=e[n]??0;return r===i?t.localeCompare(n):r-i}}function Zxn(e,t,n,r){let i=0;for(const l of t){const u=n[l]??0;if(u>i){i=u}}const o=Array.from({length:i+1},()=>[]);const a=new Set;const s=B(l=>{if(a.has(l)){return}a.add(l);const u=n[l]??0;if(!o[u]){o[u]=[]}o[u].push(l);for(const d of r(l)){s(d)}},"emit");for(const l of e){s(l)}for(const l of t){if(!a.has(l)){const u=n[l]??0;if(!o[u]){o[u]=[]}o[u].push(l);a.add(l)}}return o}function Jxn(e){const t=[];for(const n of e){const r=new Set;const i=[];for(const o of n){if(r.has(o)){continue}r.add(o);i.push(o)}t.push(i)}return t}function Qxn(e,t,n,r){return i=>{const o=e.get(i)??[];if(o.length===0){return[]}const a=t[i]??0;const s=[];const l=[];const u=n.get(i);for(const d of o){const f=r.get(d)??a;if(f>a){s.push({child:d,min:f})}else{l.push(d)}}s.sort((d,f)=>{if(d.min===f.min){return d.child.localeCompare(f.child)}return d.min-f.min});l.sort((d,f)=>{const h=u?.get(d)??0;const m=u?.get(f)??0;if(h!==m){return h-m}const g=r.get(d)??a;const x=r.get(f)??a;if(g!==x){return g-x}return d.localeCompare(f)});return[...s.map(d=>d.child),...l]}}function vCe(e,t,n){const r=Gxn(e,{rankHint:t,laneOf:n});const{children:i,roots:o}=r;for(const f of e.nodes){if(!i.has(f)){i.set(f,[])}}const a=jxn(e,t,r);const s=[...o].sort(gJe(t));const l=Kxn(s,i,t);const u=Qxn(i,t,a,l);let d=Zxn(s,e.nodes,t,u);d=Jxn(d);return d}function e1n(e,t,n){const r=new Set(e);const i=new Set(t);const o=O$(t);const a=[];for(const s of n){if(r.has(s.src)&&i.has(s.dst)){a.push(o.get(s.dst))}}return pJe(a)}function VZe(e,t,n){const r=[];for(const o of t){const a=n[o.src];const s=n[o.dst];if(a==null||s==null||a===s){continue}let l=o.src;let u=o.dst;let d=a;let f=s;if(a>s){l=o.dst;u=o.src;d=s;f=a}for(let h=d;h(n[h]??0)-(n[f]??0));for(const f of d){const h=n[f]??0;if(h===0){continue}let m=0;for(const _ of r.get(f)??[]){m=Math.max(m,(n[_]??0)+1)}if(m>=h){continue}const g=h;n[f]=m;const x=vCe(e,n,i);const w=VZe(x,e.edges,n);if(w(t[i]??0)-(t[o]??0)||i.localeCompare(o));for(const i of r){const o=n(i);if(!o){continue}const a=e.edges.filter(x=>x.src===i);if(a.length===0){continue}let s=false;let l=0;for(const x of a){const w=n(x.dst);if(w==null||w===o){s=true}else{l++}}if(l===0||s){continue}let u=0;let d=false;for(const x of e.edges){if(x.dst!==i){continue}const w=n(x.src);if(!w){continue}if(w===o){d=true}else{u++}}if(u>0||!d){continue}const f=t[i]??0;const h=f+l;let m=0;for(const x of e.edges){if(x.dst===i){m=Math.max(m,(t[x.src]??0)+1)}}const g=Math.max(f,m,h);if(g!==f){t[i]=g}}}function r1n(e,t){const n=PL(e);const r=Kee(n)??[...n.nodes].sort();const i=t?.compactSingleInput??false;const o=PR(n);let a=Object.create(null);for(const l of r){const u=cJe(n,l);const d=t?.ignoreCrossLaneEdges?u.filter(f=>{const h=o(f.src);const m=o(l);if(!h||!m){return true}return h===m}):u;if(d.length===0){a[l]=0}else if(i&&d.length===1){const f=d[0].src;const h=o(f);const m=o(l);if(h!==m){a[l]=a[f]??0}else{a[l]=(a[f]??0)+1}}else{let f=-Infinity;for(const h of d){f=Math.max(f,(a[h.src]??0)+1)}a[l]=f===-Infinity?0:f}}if(t?.optimizeRanksByCrossings??false){a=t1n(n,a)}if(t?.ignoreCrossLaneEdges){n1n(n,a)}const s=vCe(n,a,o);return{layers:s,rankOf:a,dummy:new Set}}function i1n(e,t){const n=PL(e);const r=r1n(n,{compactSingleInput:t?.compactSingleInput,ignoreCrossLaneEdges:t?.ignoreCrossLaneEdges,optimizeRanksByCrossings:t?.optimizeRanksByCrossings});const i={...r.rankOf};const o=PR(n);const{preds:a,succs:s}=wCe(n,g=>{if(t?.ignoreCrossLaneEdges){const x=o(g.src);const w=o(g.dst);if(x&&w&&x!==w){return false}}return true});const l=Kee(n)??[...n.nodes];const u=[...l].reverse();const d=B((g,x)=>{let w=0;for(const A of a.get(g)??[]){w=Math.max(w,(i[A]??0)+1)}let _=Number.POSITIVE_INFINITY;const C=s.get(g)??[];if(C.length>0){_=Math.min(...C.map(A=>(i[A]??0)-1))}if(!Number.isFinite(_)){_=Math.max(w,x)}return Math.min(Math.max(x,w),_)},"clampFeasible");const f=xCe.GRAVITY_ITERATIONS;const h=B(g=>{let x=false;for(const w of g){const _=a.get(w)??[];const C=s.get(w)??[];if(_.length===0&&C.length===0){continue}const A=_.length>0?_.reduce((N,O)=>N+(i[O]??0)+1,0)/_.length:i[w]??0;const P=C.length>0?C.reduce((N,O)=>N+(i[O]??0)-1,0)/C.length:i[w]??0;const L=Math.round((A+P)/2);const I=d(w,L);if(I!==i[w]){i[w]=I;x=true}}return x},"relaxOrder");for(let g=0;g0){const w=Math.min(...x.map(_=>(i[_]??0)-1));if((i[g]??0)>w){i[g]=w}}}const m=hJe(n,l,i);return{layers:m,rankOf:i,dummy:new Set}}function o1n(e){const t=dJe(e);const n=uJe(e);let r=fJe(t);const i=[];while(r.length>0){const o=[];for(const a of r){i.push(a);for(const s of n.get(a)??[]){t.set(s,(t.get(s)??0)-1);if((t.get(s)??0)===0){o.push(s)}}}r=o.sort((a,s)=>a.localeCompare(s))}return i.length===e.nodes.length?i:null}function a1n(e,t){const n=PL(e);const r=t?.direction==="LR"?o1n(n)??[...n.nodes].sort():Kee(n)??[...n.nodes].sort();const i=PR(n);const o=B(d=>i(d)??d,"laneOf");const a=Object.create(null);const s=new Map;const l=B((d,f)=>{const h=t?.ignoreCrossLaneEdges??true;if(h){return o(d)===o(f)?1:0}return 1},"edgeWeight");for(const d of r){const f=n.nodeById.get(d);if(f?.isGroup){continue}const h=cJe(n,d);let m=0;if(h.length>0){for(const _ of h){const C=_.src;const A=a[C]??0;m=Math.max(m,A+l(C,d))}}const g=o(d);const x=s.get(g)??0;const w=Math.max(m,x);a[d]=w;s.set(g,w+1)}const u=hJe(n,r,a,{skipGroups:true});return{layers:u,rankOf:a,dummy:new Set}}function s1n(e,t){const n=PL(t);const{rankOf:r}=e;const i=e.layers.map(m=>[...m]);const o=new Set(e.dummy?[...e.dummy]:[]);let a=0;const s=new Map(n.nodeById);const l=B(m=>{const g=`placeholder-${a++}`;const x={id:g,isGroup:false,isDummy:true,width:0,height:0};s.set(g,x);o.add(g);while(i.length<=m){i.push([])}i[m].push(g);r[g]=m;return g},"addDummyAt");const u=[...n.edges].sort((m,g)=>m.id===g.id?m.src===g.src?m.dst.localeCompare(g.dst):m.src.localeCompare(g.src):m.id.localeCompare(g.id));const d=[];for(const m of u){const g=r[m.src]??0;const x=r[m.dst]??0;if(x-g<=1){d.push(m);continue}let w=m.src;for(let C=g+1,A=0;C!n.nodes.includes(m))];const h={nodes:f,edges:d,layout:n.layout,nodeById:s};return{layering:{layers:i,rankOf:r,dummy:o},graphWithDummies:h}}function $Ze(e){const t=e.length;if(t===0){return Number.POSITIVE_INFINITY}const n=[...e].sort((r,i)=>r-i);if(t%2===1){return n[(t-1)/2]}return .5*(n[t/2-1]+n[t/2])}function GZe(e){if(e.length===0){return Number.POSITIVE_INFINITY}const t=e.reduce((n,r)=>n+r,0);return t/e.length}function l1n(e,t,n,r){const i=new Map;for(const o of e){i.set(o,[])}for(const o of n){if(r==="down"){if(t.has(o.src)&&i.has(o.dst)){i.get(o.dst).push(t.get(o.src))}}else if(t.has(o.dst)&&i.has(o.src)){i.get(o.src).push(t.get(o.dst))}}return i}function c1n(e,t,n){const r=n.get(e)??0;const i=n.get(t)??0;return r!==i?r-i:e.localeCompare(t)}function HZe(e,t,n){const r=new Set(e);const i=new Set(t);const o=O$(e);const a=O$(t);const s=[];for(const u of n){if(r.has(u.src)&&i.has(u.dst)){s.push({u:o.get(u.src),v:a.get(u.dst)})}}s.sort((u,d)=>u.u===d.u?u.v-d.v:u.u-d.u);const l=s.map(u=>u.v);return pJe(l)}function uCe(e,t,n){return[...e].sort((r,i)=>{const o=$Ze(t.get(r)??[]);const a=$Ze(t.get(i)??[]);if(o===a){return c1n(r,i,n)}if(!isFinite(o)){return 1}if(!isFinite(a)){return-1}return o-a})}function WZe(e,t,n,r,i,o){const a=O$(e);const s=O$(t);const l=l1n(t,a,n,r);if(!i||!o||o.length===0){return uCe(t,l,s)}const u=new Map;for(const h of t){const m=i(h);const g=u.get(m)??[];g.push(h);u.set(m,g)}const d=[];for(const h of o){const m=u.get(h);if(!m||m.length===0){continue}const g=uCe(m,l,s);d.push(...g)}const f=u.get(null);if(f&&f.length>0){const h=uCe(f,l,s);for(const m of h){const g=GZe(l.get(m)??[]);let x=d.length;if(isFinite(g)){for(const[w,_]of d.entries()){const C=GZe(l.get(_)??[]);if(ga.has(x.src)&&s.has(x.dst));const d=l?n.filter(x=>s.has(x.src)&&l.has(x.dst)):void 0;const f=B(x=>{let w=HZe(e,x,u);if(d&&r){w+=HZe(x,r,d)}return w},"crossingScore");const h=i?new Map:null;if(i&&h){for(const x of t){h.set(x,i(x))}}let m=true;let g=f(o);while(m){m=false;for(let x=0;x+1[...s]);const i=t.edges;const o=PR(t);const a=mJe(t,n?.laneOrder);for(let s=0;s<3;s++){for(let l=1;l=0;l--){r[l]=WZe(r[l+1],r[l],i,"up",o,a);r[l]=YZe(r[l+1],r[l],i,r[l-1],o)}}return{layers:r}}function d1n(e,t,n){const r=n?.layerGap??Hbn.DEFAULT_LAYER_GAP;const i=n?.nodeGap??Hbn.DEFAULT_NODE_GAP;const o=n?.laneGap??i*2;const a=n?.direction??"TB";const s=a==="LR"||a==="RL";const l=e.layers;const u=Object.create(null);const d=Object.create(null);const f=B(U=>t.nodeById.get(U),"getNode");const h=B(U=>f(U)?.width??0,"getWidth");const m=B(U=>f(U)?.height??0,"getHeight");const g=PR(t);const x=mJe(t,n?.laneOrder);const w=l.map(U=>U.reduce((W,H)=>Math.max(W,m(H)),0));const _=[];if(s){for(let U=0;U+1Math.max(J,h(oe)),0);const H=l[U+1].reduce((J,oe)=>Math.max(J,h(oe)),0);const $=w[U];const K=w[U+1];const X=$/2+K/2;const j=(W+H)/2;const te=Math.max(0,j-X-r);_.push(te)}}const C=new Set;for(const U of l){for(const W of U){C.add(g(W))}}const A=C.has(null);const P=x.filter(U=>C.has(U));const L=[...A?[null]:[],...P];const I=Object.create(null);for(const U of P){I[U]=0}if(A){I.null=0}for(const U of l){const W=Object.create(null);const H=[];for(const $ of U){const K=g($);if(K===null){H.push($)}else{(W[K]||=[]).push($)}}for(const[$,K]of Object.entries(W)){const X=K.reduce((j,te)=>j+h(te),0)+i*Math.max(0,K.length-1);I[$]=Math.max(I[$]??0,X)}if(A&&H.length){const $=H.reduce((K,X)=>K+h(X),0)+i*Math.max(0,H.length-1);I.null=Math.max(I.null??0,$)}}const N=new Map;{const U=L.map($=>($===null?I.null:I[$])??0);const W=U.reduce(($,K)=>$+K,0)+o*Math.max(0,L.length-1);let H=-W/2;for(let $=0;$h(re));const oe=J.reduce((re,ce)=>re+ce,0)+i*(j.length-1);let se=te-oe/2;for(const[re,ce]of j.entries()){const ue=J[re];u[ce]=se+ue/2;d[ce]=O+H/2;se+=ue+i}}}const K=_[U]??0;O+=H+r+K}const z=new Map;for(const U of t.edges){const W=U.ref.id;if(!z.has(W)){z.set(W,[])}z.get(W).push(U)}for(const[,U]of z){if(U.length===0){continue}const W=U[0].ref;const H=W.start;const $=W.end;if(H==null||$==null){continue}const K=Math.round(((u[H]??0)+(u[$]??0))/2);const X=new Set;for(const j of U){X.add(j.src);X.add(j.dst)}for(const j of X){if(j===H||j===$){continue}const te=t.nodeById.get(j);if(te?.isDummy){u[j]=K}}}return{x:u,y:d}}function h1n(e){let t=2166136261;for(let n=0;n>>0}function p1n(e){let t=e>>>0;return()=>{t+=1831565813;let n=t;n=Math.imul(n^n>>>15,n|1);n^=n+Math.imul(n^n>>>7,n|61);return((n^n>>>14)>>>0)/4294967296}}function m1n(e,t){const n=[...e];const r=p1n(t);for(let i=n.length-1;i>0;i--){const o=Math.floor(r()*(i+1));[n[i],n[o]]=[n[o],n[i]]}return n}function g1n(e,t){let n=0;for(const[r,i]of e.entries()){n+=Math.abs(r-(t.get(i)??r))}return n}function qZe(e,t){const n=new Map;for(const[i,o]of e.entries()){n.set(o,i)}let r=0;for(const{a:i,b:o,weight:a}of t){const s=n.get(i);const l=n.get(o);if(s==null||l==null){continue}r+=a*Math.abs(s-l)}return r}function y1n(e){const t=ECe(e);if(t.length<2){return[]}const n=new Map(t.map((o,a)=>[o,a]));const r=PR(e);const i=new Map;for(const o of e.layout.edges??[]){if(o.isLayoutOnly){continue}const a=typeof o.start==="string"?o.start:void 0;const s=typeof o.end==="string"?o.end:void 0;if(!a||!s||!e.nodeById.has(a)||!e.nodeById.has(s)){continue}const l=r(a);const u=r(s);if(!l||!u||l===u){continue}const d=n.get(l);const f=n.get(u);if(d==null||f==null){continue}const[h,m]=d<=f?[l,u]:[u,l];const g=`${h}\0${m}`;const x=i.get(g);if(x){x.weight++}else{i.set(g,{a:h,b:m,weight:1})}}return[...i.values()]}function XZe(e,t,n){const r=[...e];let i=qZe(r,t);let o=true;let a=0;const s=Math.max(1,r.length);while(o&&ai.a===o.a?i.b.localeCompare(o.b):i.a.localeCompare(o.a)).map(({a:i,b:o,weight:a})=>`${i}:${o}:${a}`).join("|");return h1n(`${e.join("|")}#${r}#${n}`)}function v1n(e,t={}){const n=ECe(e);if(n.length<2){return n}const r=y1n(e);if(r.length===0){return n}const i=new Map(n.map((s,l)=>[s,l]));let o=XZe(n,r,i);const a=Math.max(0,t.restarts??f1n);for(let s=0;syl&&l*u>=s){return a>0?"bottom":"top"}if(s>yl){return o>0?"right":"left"}return n}function KZe(e,t){return Math.abs(e.to-t.from)Je.isGroup&&!Je.parentId);for(const Je of u){const Te={id:Je.id};const we=B(Ze=>{a.set(Ze.id,Te);n.filter(Be=>Be.parentId===Ze.id).forEach(we)},"assignLane");we(Je)}const d=n.filter(Je=>!Je.isGroup&&!Je.isEdgeLabel).map(Je=>{const Te=Je.width??10;const we=Je.height??10;const Ze=Je.x??0;const Be=Je.y??0;const qe=M2i;return{nodeId:Je.id,minX:Ze-Te/2-qe,maxX:Ze+Te/2+qe,minY:Be-we/2-qe,maxY:Be+we/2+qe,visualXHalfExtent:l?we/2+qe:Te/2+qe}});const f=B((Je,Te,we,Ze)=>{let Be=s.find(qe=>qe.orientation===Je&&Math.abs(qe.coord-Te)<1);if(!Be){Be={id:`pipe-${Je}-${Te.toFixed(0)}`,orientation:Je,coord:Te,spanMin:we,spanMax:Ze,tracks:[]};s.push(Be)}Be.spanMin=Math.min(Be.spanMin,we);Be.spanMax=Math.max(Be.spanMax,Ze);return Be},"getOrAddPipe");const h=B((Je,Te)=>{const we=Je.width??10;const Ze=Je.height??10;const Be=Je.x??0;const qe=Je.y??0;switch(Te){case"top":return{x:Be,y:qe-Ze/2};case"bottom":return{x:Be,y:qe+Ze/2};case"left":return{x:Be-we/2,y:qe};case"right":return{x:Be+we/2,y:qe}}},"portForSide");const m=B((Je,Te,we)=>h(Je,jZe(Je,Te,we?"bottom":"top")),"getOrthogonalPort");const g=[];const x=[];const w=new Set;const _=1e3;const C=B((Je,Te,we)=>{if(g.length===0){return 0}const Ze=Math.abs(Te.y-we.y)Me){continue}if(ye.from-yl<=Qe&&ye.to+yl>=Qe){qe+=_}}}else if(Be){const Qe=Te.x;const ze=Math.min(Te.y,we.y)-yl;const Me=Math.max(Te.y,we.y)+yl;if(Me<=ze){return 0}for(const ye of g){if(ye.edgeIndex===Je||ye.orientation!=="horizontal"){continue}if(ye.pipe.coordMe){continue}if(ye.from-yl<=Qe&&ye.to+yl>=Qe){qe+=_}}}return qe},"crossingPenalty");const A=i.map((Je,Te)=>{if(!Je.start||!Je.end){return{idx:Te,crossLane:0,dx:0,dy:0}}const we=o.get(Je.start);const Ze=o.get(Je.end);const Be=a.get(Je.start);const qe=a.get(Je.end);const Qe=Be&&qe&&Be.id!==qe.id?1:0;const ze=we&&Ze?Math.abs((Ze.x??0)-(we.x??0)):0;const Me=we&&Ze?Math.abs((Ze.y??0)-(we.y??0)):0;return{idx:Te,crossLane:Qe,dx:ze,dy:Me}}).sort((Je,Te)=>{if(Je.crossLane!==Te.crossLane){return Te.crossLane-Je.crossLane}const we=Je.dx+Je.dy;const Ze=Te.dx+Te.dy;if(Math.abs(we-Ze)>1){return we-Ze}return Je.idx-Te.idx}).map(Je=>Je.idx);const P=B((Je,Te,we,Ze)=>{const Be=Math.min(Je.x,Te.x);const qe=Math.max(Je.x,Te.x);const Qe=Math.min(Je.y,Te.y);const ze=Math.max(Je.y,Te.y);const Me=d.find(ye=>{if(we&&ye.nodeId===we){return false}if(Ze&&ye.nodeId===Ze){return false}if(Math.abs(Je.x-Te.x)>yl){return ye.minYJe.y&&ye.maxX>Be&&ye.minXJe.x&&ye.maxY>Qe&&ye.minYjZe(Je,Te,"bottom"),"determineSide");const O=new Map;for(const[Je,Te]of i.entries()){if(!Te.start||!Te.end||Te.start===Te.end){continue}if(Te.points&&Te.points.length>0){continue}const we=o.get(Te.start);const Ze=o.get(Te.end);if(!we||!Ze){continue}const Be=(Ze.x??0)-(we.x??0);const qe=(Ze.y??0)-(we.y??0);O.set(Je,{edgeIdx:Je,srcId:Te.start,dstId:Te.end,srcSide:N(we,{x:Ze.x??0,y:Ze.y??0}),dstSide:N(Ze,{x:we.x??0,y:we.y??0}),absDx:Math.abs(Be),absDy:Math.abs(qe),dxSign:Math.sign(Be),dySign:Math.sign(qe)})}const z=B(Je=>{if(Je.srcSide==="top"||Je.srcSide==="bottom"){return Je.absDx===0?Infinity:Je.absDy/Je.absDx}return Je.absDy===0?Infinity:Je.absDx/Je.absDy},"preferenceStrength");const U=B(Je=>{if(Je.srcSide==="top"||Je.srcSide==="bottom"){return Je.dxSign>=0?"right":"left"}return Je.dySign>=0?"bottom":"top"},"secondarySide");const W=new Map;for(const Je of O.values()){const Te=`${Je.srcId}:${Je.srcSide}`;if(!W.has(Te)){W.set(Te,[])}W.get(Te).push(Je)}const H=new Map;const $=B((Je,Te)=>`${Je}:${Te}`,"loadKey");for(const Je of O.values()){H.set($(Je.srcId,Je.srcSide),(H.get($(Je.srcId,Je.srcSide))??0)+1);H.set($(Je.dstId,Je.dstSide),(H.get($(Je.dstId,Je.dstSide))??0)+1)}for(const Je of W.values()){if(Je.length<2){continue}Je.sort((Te,we)=>{const Ze=z(Te);const Be=z(we);if(Math.abs(Ze-Be)>1e-9){return Be-Ze}return Te.edgeIdx-we.edgeIdx});for(let Te=1;Te=Be){continue}H.set($(we.srcId,we.srcSide),Be-1);H.set($(we.srcId,Ze),qe+1);we.srcSide=Ze}}const K=B(Je=>{const Te=Je?.shape;return Te==="question"||Te==="diamond"},"isDiamondNode");const X=new Map;for(const Je of O.values()){if(!X.has(Je.dstId)){X.set(Je.dstId,new Set)}X.get(Je.dstId).add(Je.dstSide)}for(const Je of O.values()){if(!K(o.get(Je.srcId))){continue}const Te=X.get(Je.srcId);if(!Te?.has(Je.srcSide)){continue}const we=U(Je);if(Te.has(we)||(H.get($(Je.srcId,we))??0)>0){continue}const Ze=H.get($(Je.srcId,Je.srcSide))??0;H.set($(Je.srcId,Je.srcSide),Math.max(0,Ze-1));H.set($(Je.srcId,we),1);Je.srcSide=we}for(const Je of O.values()){const{edgeIdx:Te,srcId:we,dstId:Ze,srcSide:Be,dstSide:qe}=Je;const Qe=o.get(we);const ze=o.get(Ze);const Me=`${we}:${Be}:src`;const ye=Be==="top"||Be==="bottom"?ze.x??0:ze.y??0;if(!L.has(Me)){L.set(Me,[])}L.get(Me).push({edgeIdx:Te,oppositeCoord:ye});const Ne=`${Ze}:${qe}:dst`;const Ae=qe==="top"||qe==="bottom"?Qe.x??0:Qe.y??0;if(!L.has(Ne)){L.set(Ne,[])}L.get(Ne).push({edgeIdx:Te,oppositeCoord:Ae})}const j=new Map;const te=8;for(const[Je,Te]of L){if(Te.length<2){continue}Te.sort((qt,_t)=>qt.oppositeCoord-_t.oppositeCoord);const we=Je.split(":");const Ze=we.slice(0,-2).join(":");const Be=we[we.length-2];const qe=we[we.length-1];const Qe=o.get(Ze);if(!Qe){continue}const ze=Be==="left"||Be==="right";const Me=ze?Qe.height??10:Qe.width??10;const ye=Qe.shape;const Ne=ye==="question"||ye==="diamond";const Ae=Ne?Me*.3:Me;const dt=20;const Oe=Math.min(dt,Math.max(te,Ae/(Te.length+1)));const Wt=Oe*(Te.length-1);const kt=-Wt/2;for(const[qt,_t]of Te.entries()){const sn=kt+qt*Oe;const Jt=`${_t.edgeIdx}:${qe}`;j.set(Jt,sn)}}const J=B(Je=>Boolean(i[Je]?.labelNodeId),"edgeHasLabelNode");const oe=B((Je,Te)=>{if(!Je){return false}return(L.get(`${Je}:${Te}:src`)??[]).some(({edgeIdx:we})=>J(we))||(L.get(`${Je}:${Te}:dst`)??[]).some(({edgeIdx:we})=>J(we))},"faceHasLabelNode");const se=B((Je,Te,we)=>{if(Te==="top"||Te==="bottom"){return{x:Je.x+we,y:Je.y}}else{return{x:Je.x,y:Je.y+we}}},"applyPortOffset");const re=B((Je,Te,we)=>{const Ze=O.get(Je);const Be={x:we.x??0,y:we.y??0};const qe={x:Te.x??0,y:Te.y??0};const Qe=Ze?.srcSide??N(Te,Be);const ze=Ze?.dstSide??N(we,qe);let Me=Ze?h(Te,Ze.srcSide):m(Te,Be,true);let ye=Ze?h(we,Ze.dstSide):m(we,qe,false);const Ne=j.get(`${Je}:src`);const Ae=j.get(`${Je}:dst`);if(Ne!==void 0){Me=se(Me,Qe,Ne)}if(Ae!==void 0){ye=se(ye,ze,Ae)}return{pSrcPort:Me,pDstPort:ye,srcSide:Qe,dstSide:ze}},"portsForEdge");for(const Je of A){const Te=i[Je];x[Je]=[];if(!Te.start||!Te.end){continue}if(Te.points&&Te.points.length>0){continue}if(Te.start===Te.end){continue}const we=o.get(Te.start);const Ze=o.get(Te.end);if(!we||!Ze){continue}const{pSrcPort:Be,pDstPort:qe,srcSide:Qe,dstSide:ze}=re(Je,we,Ze);const Me={...Be};const ye={...qe};const Ne=Qe==="top"||Qe==="bottom";const Ae=ze==="top"||ze==="bottom";if(Ne){const ft=Be.y>(we.y??0);Me.y=ft?Be.y+M_:Be.y-M_}else{const ft=Be.x>(we.x??0);Me.x=ft?Be.x+M_:Be.x-M_}if(Ae){const ft=qe.y>(Ze.y??0);ye.y=ft?qe.y+M_:qe.y-M_}else{const ft=qe.x>(Ze.x??0);ye.x=ft?qe.x+M_:qe.x-M_}const dt=B((ft,zt)=>{for(const Gt of d){if(zt.includes(Gt.nodeId)){continue}if(ft.x>Gt.minX&&ft.xGt.minY&&ft.y{if(Fn){const jr=ft.y>(zt.y??0);const sr=(Gt.x??0)>=ft.x;return{x:sr?gn.maxX+sB:gn.minX-sB,y:jr?gn.maxY+L$:gn.minY-L$,leavesPositiveSide:jr}}const Tr=ft.x>(zt.x??0);const Jr=(Gt.y??0)>=ft.y;return{x:Tr?gn.maxX+sB:gn.minX-sB,y:Jr?gn.maxY+L$:gn.minY-L$,leavesPositiveSide:Tr}},"obstacleDetour");let Wt=[];const kt=[Te.start,Te.end];const qt=dt(Me,kt);if(qt.inside&&qt.obstacle){const ft=qt.obstacle;if(Ne){const zt=Oe(Be,we,Ze,ft,true);Me.x=zt.x;Me.y=zt.y;const Gt=zt.leavesPositiveSide?Math.min(ft.minY-2,Be.y+M_):Math.max(ft.maxY+2,Be.y-M_);Wt=[{x:Be.x,y:Gt},{x:zt.x,y:Gt},{x:zt.x,y:zt.y}]}else{const zt=Oe(Be,we,Ze,ft,false);const Gt=zt.leavesPositiveSide?Math.min(ft.minX-2,Be.x+M_):Math.max(ft.maxX+2,Be.x-M_);Me.x=zt.x;Me.y=zt.y;Wt=[{x:Gt,y:Be.y},{x:Gt,y:zt.y},{x:zt.x,y:zt.y}]}}let _t=[];const sn=dt(ye,kt);if(sn.inside&&sn.obstacle){const ft=sn.obstacle;if(Ae){const zt=Oe(qe,Ze,we,ft,true);ye.x=zt.x;ye.y=zt.y;_t=[{x:zt.x,y:zt.y},{x:qe.x,y:zt.y}]}else{const zt=Oe(qe,Ze,we,ft,false);ye.x=zt.x;ye.y=zt.y;_t=[{x:zt.x,y:zt.y},{x:zt.x,y:qe.y}]}}if(Wt.length===0&&_t.length===0){const ft=sB;const zt=Math.abs(Me.x-ye.x)1||Tr>1;const jr=I.get(Te.start??"")??0;const sr=I.get(Te.end??"")??0;const bn=Fn>1&&oe(Te.start,Qe)||Tr>1&&oe(Te.end,ze);const ir=Fn<=1||jr<=2;const Jn=Tr<=1||sr<=2;const er=Jr&&!bn&&ir&&Jn;if((zt||Gt)&&!gn&&(!Jr||er)){const Pr=P(Be,qe,Te.start,Te.end);if(!Pr){Te.points=[{...Be},{...Me},{...ye},{...qe}];w.add(Je);const Vt=Gt?"horizontal":"vertical";const di=Gt?Be.y:Be.x;const ln=Gt?Math.min(Be.x,qe.x):Math.min(Be.y,qe.y);const yi=Gt?Math.max(Be.x,qe.x):Math.max(Be.y,qe.y);const yo={id:`fast-path-${Vt}-${di.toFixed(0)}-${Je}`,orientation:Vt,coord:di,spanMin:ln,spanMax:yi,tracks:[]};g.push({edgeIndex:Je,segmentIndex:0,orientation:Vt,pipe:yo,trackIndex:0,from:ln,to:yi});continue}}}const Jt=f("vertical",Me.x,Me.y,Me.y);Me.x=Jt.coord;const Sn=f("vertical",ye.x,ye.y,ye.y);ye.x=Sn.coord;let Kt=Math.min(Me.x,ye.x)-50;let mn=Math.max(Me.x,ye.x)+50;let At=Math.min(Me.y,ye.y)-50;let lr=Math.max(Me.y,ye.y)+50;for(const ft of d){const zt=Math.min(Me.x,ye.x);const Gt=Math.max(Me.x,ye.x);const gn=Math.min(Me.y,ye.y);const Fn=Math.max(Me.y,ye.y);const Tr=ft.minXzt&&ft.minYgn;if(Tr){Kt=Math.min(Kt,ft.minX-lCe);mn=Math.max(mn,ft.maxX+lCe);At=Math.min(At,ft.minY-lCe);lr=Math.max(lr,ft.maxY+lCe)}}for(const ft of d){if(ft.maxXmn||ft.maxYlr){continue}const zt=sB;f("horizontal",ft.minY-zt,Kt,mn);f("horizontal",ft.maxY+zt,Kt,mn);const Gt=L$;f("vertical",ft.minX-Gt,At,lr);f("vertical",ft.maxX+Gt,At,lr)}f("horizontal",Me.y,Kt,mn);f("horizontal",ye.y,Kt,mn);const on=s.filter(ft=>ft.orientation==="horizontal"&&ft.coord>=At&&ft.coord<=lr);const cr=s.filter(ft=>ft.orientation==="vertical"&&ft.coord>=Kt&&ft.coord<=mn);const Hr=B((ft,zt)=>`${ft.toFixed(1)},${zt.toFixed(1)}`,"getKey");const Mr=Hr(Me.x,Me.y);const Er=Hr(ye.x,ye.y);const vr=new Map;const Yr=new Map;const nt=new Map;const Rr=new Set;const Xr=[];vr.set(Mr,0);nt.set(Mr,"n");Xr.push({key:Mr,f:Math.hypot(ye.x-Me.x,ye.y-Me.y),pt:Me});Rr.add(Mr);let dr=[];const rn=B((ft,zt)=>{return P(ft,zt,Te.start,Te.end)},"checkSegmentBlocked");const St={x:ye.x,y:Me.y};const Ut=rn(Me,St);const Pt=rn(St,ye);const an=Ut||Pt;const Xt={x:Me.x,y:ye.y};const Cn=rn(Me,Xt);const rr=rn(Xt,ye);const hr=Cn||rr;if(!an){if(Math.abs(Me.y-ye.y)0){Xr.sort((sr,bn)=>sr.f-bn.f);const ft=Xr.shift();Rr.delete(ft.key);if(ft.key===Er){let sr=Er;let bn=ye;dr=[bn];while(Yr.has(sr)){const ir=Yr.get(sr);dr.unshift(ir);bn=ir;sr=Hr(ir.x,ir.y)}break}const zt=ft.pt.x;const Gt=ft.pt.y;const gn=cr.sort((sr,bn)=>sr.coord-bn.coord);const Fn=gn.findIndex(sr=>Math.abs(sr.coord-zt)<1);const Tr=on.sort((sr,bn)=>sr.coord-bn.coord);const Jr=Tr.findIndex(sr=>Math.abs(sr.coord-Gt)<1);const jr=[];if(Fn>0){jr.push({x:gn[Fn-1].coord,y:Gt})}if(Fn>=0&&Fn0){jr.push({x:zt,y:Tr[Jr-1].coord})}if(Jr>=0&&Jr{if(Dr.nodeId===Te.start||Dr.nodeId===Te.end){return false}if(bn!==ir){return Dr.minYGt&&Dr.maxX>bn&&Dr.minXzt&&Dr.maxY>Jn&&Dr.minY10&&ds<-5||Pa<-10&&ds>5){yi=Math.abs(ds)*100}if(yo>10&&Ms<-5||yo<-10&&Ms>5){yi+=Math.abs(Ms)*50}let st=0;const en=nt.get(ft.key)??"n";const yn=Math.abs(Ms)>yl?"h":"v";if(en!=="n"&&en!==yn){st=50}const jn=di+ln+yi+st;const xr=(vr.get(ft.key)??Infinity)+jn;const wr=Math.abs(ye.x-sr.x)+Math.abs(ye.y-sr.y);if(xr<(vr.get(Vt)??Infinity)){Yr.set(Vt,ft.pt);vr.set(Vt,xr);nt.set(Vt,yn);if(!Rr.has(Vt)){Xr.push({key:Vt,f:xr+wr,pt:sr});Rr.add(Vt)}else{const Dr=Xr.findIndex(Pn=>Pn.key===Vt);if(Dr!==-1){Xr[Dr].f=xr+wr}}}}}}if(dr.length===0){dr=[Me,{x:Me.x,y:ye.y},ye]}if(dr.length>4){const ft=dr[0];const zt=dr[dr.length-1];let Gt=Math.min(ft.x,zt.x);let gn=Math.max(ft.x,zt.x);let Fn=Math.min(ft.y,zt.y);let Tr=Math.max(ft.y,zt.y);for(const Jn of dr){Gt=Math.min(Gt,Jn.x);gn=Math.max(gn,Jn.x);Fn=Math.min(Fn,Jn.y);Tr=Math.max(Tr,Jn.y)}const Jr=gn>Math.max(ft.x,zt.x);const jr=Gtln.minXer&&ln.minYPr);if(di.length>0){let ln=Math.max(ft.x,zt.x);for(const yi of di){const yo=(yi.minX+yi.maxX)/2;if(yi.visualXHalfExtent===void 0||isNaN(yi.visualXHalfExtent)){continue}const Pa=yo+yi.visualXHalfExtent+Jn;ln=Math.max(ln,Pa)}if(!isNaN(ln)){gn=ln}}}if(jr){const er=d.filter(Pr=>Pr.minXMath.min(ft.y,zt.y));if(er.length>0){let Pr=Math.min(ft.x,zt.x);for(const Vt of er){const di=(Vt.minX+Vt.maxX)/2;const ln=di-Vt.visualXHalfExtent-Jn;Pr=Math.min(Pr,ln)}Gt=Pr}}}const sr=B(Jn=>{const er=zt.y>ft.y;const Pr=d.filter(ln=>{const yi=Math.min(ft.x,zt.x)ln.minX;const yo=Math.min(ft.y,zt.y)ln.minY;return yi&&yo});let Vt=Pr;if(l&&Pr.length>0){const ln=Pr.filter(yi=>yi.minXJn);if(ln.length>0){Vt=ln}}if(Vt.length===0){return zt.y}const di=sB;if(er){const ln=Math.max(...Vt.map(yo=>yo.maxY));const yi=ln+di;if(yiyo.minY));const yi=ln-di;if(yi>zt.y+yl){return yi}}return zt.y},"findBestReturnY");const bn=B(Jn=>{const er=sr(Jn);const Pr={x:Jn,y:ft.y};const Vt={x:Jn,y:er};const di={x:zt.x,y:er};const ln=rn(ft,Pr);const yi=rn(Pr,Vt);const yo=rn(Vt,di);const Pa=er!==zt.y?rn(di,zt):false;if(!ln&&!yi&&!yo&&!Pa){if(Math.abs(er-zt.y)=3){const ft=Et[Et.length-1];const zt=Et[Et.length-2];const Gt=Et[Et.length-3];const gn=Math.abs(Gt.y-zt.y)Math.abs(ft.x-Gt.x)){Et.splice(-2,1)}}else if(Fn){const Tr=Math.sign(zt.y-Gt.y);const Jr=Math.sign(ft.y-Gt.y);if(Tr!==0&&Tr===Jr&&Math.abs(zt.y-Gt.y)>Math.abs(ft.y-Gt.y)){Et.splice(-2,1)}}}const Tn=[Et[0]];for(let ft=1;ftzt.x;const Tr=gn.x>Gt.x;if(Fn!==Tr){Tn.push(Gt);continue}continue}if(Math.abs(zt.x-Gt.x)zt.y;const Tr=gn.y>Gt.y;if(Fn!==Tr){Tn.push(Gt);continue}continue}Tn.push(Gt)}Tn.push(Et[Et.length-1]);for(let ft=0;ft{return Je.from{const Be=!Ze.segments.some(Qe=>(Qe.edgeIndex!==Te.edgeIndex||Qe.segmentIndex!==Te.segmentIndex)&&ce(Qe,Je));const qe=!we.segments.some(Qe=>(Qe.edgeIndex!==Je.edgeIndex||Qe.segmentIndex!==Je.segmentIndex)&&ce(Qe,Te));if(Be&&qe){Je.trackIndex=Ze.index;Te.trackIndex=we.index;we.segments=[...we.segments.filter(Qe=>Qe.edgeIndex!==Je.edgeIndex||Qe.segmentIndex!==Je.segmentIndex),{edgeIndex:Te.edgeIndex,segmentIndex:Te.segmentIndex,from:Te.from,to:Te.to}];Ze.segments=[...Ze.segments.filter(Qe=>Qe.edgeIndex!==Te.edgeIndex||Qe.segmentIndex!==Te.segmentIndex),{edgeIndex:Je.edgeIndex,segmentIndex:Je.segmentIndex,from:Je.from,to:Je.to}];return true}return false},"trySwapSegmentsAcrossTracks");const xe=B(Je=>{const Te=Je.tracks.length;Je.tracks[Te]={index:Te,coord:Je.coord,segments:[]};return Te},"createNewTrack");const be=B((Je,Te)=>{const we=Je.pipe.tracks[Je.trackIndex];we.segments=we.segments.filter(Be=>Be.edgeIndex!==Je.edgeIndex||Be.segmentIndex!==Je.segmentIndex);Je.trackIndex=Te;const Ze=Je.pipe.tracks[Te];Ze.segments.push({edgeIndex:Je.edgeIndex,segmentIndex:Je.segmentIndex,from:Je.from,to:Je.to})},"moveSegmentToTrack");const Ie=B((Je,Te)=>{const we=x[Je.edgeIndex];for(const Ze of we){const Be=g[Ze];if(Be.pipe===Je.pipe){be(Be,Te)}}},"moveSegmentChainToTrack");const he=B(Je=>{const Te=x[Je.edgeIndex];const we=Te.indexOf(g.indexOf(Je));const Ze=[];if(we>0){Ze.push(g[Te[we-1]])}if(we{if(Je.orientation===Te.orientation){return false}const we=Je.orientation==="horizontal"?Je:Te;const Ze=Je.orientation==="horizontal"?Te:Je;return Ze.pipe.coord>we.from&&Ze.pipe.coordZe.from&&we.pipe.coord{for(const we of Je.tracks){const Ze=we.segments.some(Be=>(Be.edgeIndex!==Te.edgeIndex||Be.segmentIndex!==Te.segmentIndex)&&ce(Be,Te));if(!Ze){return we.index}}return-1},"findAvailableTrack");const Ve=B((Je,Te)=>{if(Je.trackIndex===Te.trackIndex){return ce(Je,Te)}const we=he(Je);const Ze=he(Te);return we.some(Be=>Ze.some(qe=>ve(Be,qe)))},"segmentsConflict");const Le=B((Je,Te,we)=>{if(ue(Je,Te,Je.pipe.tracks[Je.trackIndex],Te.pipe.tracks[Te.trackIndex])){return}const Ze=ge(Je.pipe,Te);we(Te,Ze!==-1?Ze:xe(Je.pipe))},"resolveTrackConflict");const $e=B(Je=>{let Te=0;for(let we=0;we{if(Ee.has(Je)){return Ee.get(Je)}const Te=x[Je];if(Te.length===0){const ze={dest:0,deviation:0,base:0,delta:0};Ee.set(Je,ze);return ze}const we=g[Te[0]];const Ze=we.pipe.coord;let Be=Ze;for(let ze=1;zeMath.abs(Ne-Ze)?ye:Ne;break}}const qe=Math.abs(Be-Ze);const Qe={dest:Be,deviation:qe,base:Ze,delta:Be-Ze};Ee.set(Je,Qe);return Qe},"getDestInfo");const yt=B(()=>{let Je=0;const Te=new Map;for(const[Ze,Be]of i.entries()){if(x[Ze].length===0){continue}if(!Be.start){continue}if(!Te.has(Be.start)){Te.set(Be.start,[])}Te.get(Be.start).push(Ze)}const we=B(Ze=>{const Be=i[Ze];if(!Be.start||!Be.end){return 0}const qe=o.get(Be.start);const Qe=o.get(Be.end);if(!qe||!Qe){return 0}const ze=(Qe.x??0)-(qe.x??0);const Me=(Qe.y??0)-(qe.y??0);return Math.abs(ze)+Math.abs(Me)},"getEdgeDistance");for(const Ze of Te.values()){Ze.sort((qe,Qe)=>{const ze=tt(qe);const Me=tt(Qe);if(Math.abs(ze.deviation-Me.deviation)>1){return ze.deviation-Me.deviation}if(Math.abs(ze.dest-Me.dest)>1){return ze.dest-Me.dest}const ye=we(qe);const Ne=we(Qe);if(Math.abs(ye-Ne)>1){return Ne-ye}const Ae=x[qe].length;const dt=x[Qe].length;if(Ae!==dt){return Ae-dt}if(Ae===1){const Oe=x[qe][0];const Wt=x[Qe][0];if(g[Oe]&&g[Wt]){const kt=g[Oe];const qt=g[Wt];const _t=Math.abs(kt.to-kt.from);const sn=Math.abs(qt.to-qt.from);if(Math.abs(_t-sn)>1){return _t-sn}}}return 0});const Be=Ze.map(qe=>g[x[qe][0]]);Je+=$e(Be)}return Je},"fixSourceHandleCrossings");const mt=B(()=>{let Je=0;const Te=new Map;for(const[we,Ze]of i.entries()){const Be=x[we];if(Be.length===0){continue}if(!Ze.end){continue}if(!Te.has(Ze.end)){Te.set(Ze.end,[])}Te.get(Ze.end).push(we)}for(const we of Te.values()){we.sort((Be,qe)=>{const Qe=B(ye=>{const Ne=x[ye];if(Ne.length<2){return 0}const Ae=g[Ne[Ne.length-2]];return Math.abs(Ae.to-Ae.from)},"getDist");const ze=Qe(Be);const Me=Qe(qe);if(Math.abs(ze-Me)>.1){return ze-Me}return Be-qe});const Ze=we.map(Be=>g[x[Be][x[Be].length-1]]);Je+=$e(Ze)}return Je},"fixTargetHandleCrossings");const ct=B(()=>{let Je=0;for(const Te of s){const we=[];for(const Ze of Te.tracks){for(const Be of Ze.segments){const qe=x[Be.edgeIndex].find(Qe=>g[Qe].segmentIndex===Be.segmentIndex);if(qe!==void 0){we.push(g[qe])}}}we.sort((Ze,Be)=>Ze.edgeIndex-Be.edgeIndex||Ze.segmentIndex-Be.segmentIndex);for(let Ze=0;Ze{Ze.segments.forEach(Be=>{Te.push({edgeIndex:Be.edgeIndex,segmentIndex:Be.segmentIndex,trackIndex:Ze.index,from:Be.from,to:Be.to})})});Te.sort((Ze,Be)=>Ze.from-Be.from);const we=[];if(Te.length>0){let Ze=[Te[0]];let Be=Te[0].to;for(let qe=1;qeBe.add(Oe.trackIndex));const qe=new Map;Ze.forEach(Oe=>{const Wt=tt(Oe.edgeIndex);qe.set(Oe.trackIndex,(qe.get(Oe.trackIndex)??0)+Wt.delta)});const Qe=[...Be].filter(Oe=>(qe.get(Oe)??0)<-1);const ze=[...Be].filter(Oe=>(qe.get(Oe)??0)>1);const Me=[...Be].filter(Oe=>Math.abs(qe.get(Oe)??0)<=1);Qe.sort((Oe,Wt)=>(qe.get(Wt)??0)-(qe.get(Oe)??0));ze.sort((Oe,Wt)=>(qe.get(Oe)??0)-(qe.get(Wt)??0));const ye=B((Oe,Wt)=>{Ze.filter(kt=>kt.trackIndex===Oe).forEach(kt=>{const qt=w.has(kt.edgeIndex)?Je.coord:Wt;bt.set(`${kt.edgeIndex}-${kt.segmentIndex}`,qt)})},"assignCoord");let Ne=0;for(const Oe of Qe){Ne++;ye(Oe,Je.coord-Ne*yZe)}if(Me.length===0&&Be.size>0){const Oe=[...Be].sort((qt,_t)=>Math.abs(qe.get(qt)??0)-Math.abs(qe.get(_t)??0))[0];const Wt=Qe.indexOf(Oe);if(Wt!==-1){Qe.splice(Wt,1)}const kt=ze.indexOf(Oe);if(kt!==-1){ze.splice(kt,1)}Me.push(Oe)}let Ae=0;for(const Oe of Me){if(Ae===0){ye(Oe,Je.coord)}else{const Wt=Ae%2===1?1:-1;const kt=Math.ceil(Ae/2);ye(Oe,Je.coord+Wt*kt*yZe*.5)}Ae++}let dt=0;for(const Oe of ze){dt++;ye(Oe,Je.coord+dt*yZe)}}}for(const[Je,Te]of i.entries()){const we=x[Je]??[];if(we.length===0){continue}const Ze=[];const Be=o.get(Te.start);const qe=o.get(Te.end);const{pSrcPort:Qe,pDstPort:ze}=re(Je,Be,qe);const Me=we.map(Ae=>{const dt=g[Ae];const Oe=bt.get(`${dt.edgeIndex}-${dt.segmentIndex}`)??dt.pipe.coord;return{orient:dt.orientation,coord:Oe,from:dt.from,to:dt.to}});Ze.push(Qe);for(let Ae=0;Aeyl){Ze.push(lB(dt,Wt))}if(_t&&qt.orient===dt.orient){if(Math.abs(dt.coord-qt.coord)>yl){const sn=dt.orient==="vertical"?(Wt+qt.from)/2:KZe(dt,qt);Ze.push(lB(dt,sn),lB(qt,sn))}else if(Ae===0||Ae===Me.length-2){Ze.push(lB(dt,KZe(dt,qt)))}}else if(_t){Ze.push(lB(dt,qt.coord))}else{const sn=Math.abs(dt.from-Wt)yl||Math.abs(ye.y-ze.y)>yl){Ze.push(ze)}const Ne=[];if(Ze.length>0){Ne.push(Ze[0])}for(let Ae=1;Aeyl||Math.abs(dt.y-Oe.y)>yl){Ne.push(dt)}}Te.points=Ne}for(const Je of i){const Te=Je.__originalEdge;if(Te&&Je.points){Te.points=Je.points}}e.edges=(e.edges??[]).filter(Je=>!Je.isLayoutOnly);const He=B((Je,Te)=>{const we=Te.x??0;const Ze=Te.y??0;const Be=Te.width??0;const qe=Te.height??0;if(Be<=0||qe<=0){return Je}const Qe=we-Be/2;const ze=we+Be/2;const Me=Ze-qe/2;const ye=Ze+qe/2;if(Je.xze||Je.yye){return Je}const Ne=Je.x-Qe;const Ae=ze-Je.x;const dt=Je.y-Me;const Oe=ye-Je.y;const Wt=Math.min(Ne,Ae,dt,Oe);if(Wt===Ne){return{x:Qe,y:Je.y}}if(Wt===Ae){return{x:ze,y:Je.y}}if(Wt===dt){return{x:Je.x,y:Me}}return{x:Je.x,y:ye}},"nodeBoundaryClamp");for(const Je of e.edges){const Te=Je.points;if(!Te||Te.length<2){continue}const we=Je.start;const Ze=Je.end;const Be=we?o.get(we):void 0;const qe=Ze?o.get(Ze):void 0;if(Be){Te[0]=He(Te[0],Be)}if(qe){Te[Te.length-1]=He(Te[Te.length-1],qe)}}return e}function w1n(e){return e.direction??"TB"}function E1n(e){const t=axn(e);const n=e.config.flowchart?.nodeSpacing??40;const r=e.config.flowchart?.rankSpacing??100;const i=e.config.swimlane?.ignoreCrossLaneEdges??true;const o=e.config.swimlane?.optimizeRanksByCrossings??true;const a=e.config.swimlane?.automaticLaneOrdering??false;const s=w1n(e);const{ordered:l,coordinates:u}=_1n(t,{nodeGap:n,layerGap:r,ignoreCrossLaneEdges:i,optimizeRanksByCrossings:o,automaticLaneOrdering:a,direction:s});sxn(t,l,u,{nodeGap:n,layerGap:r});for(const d of e.edges??[]){delete d.points}T1n(e,s);for(const d of e.edges??[]){if(!d.curve||d.curve==="basis"){d.curve="rounded"}}zxn(e,s);Bxn(e);return s}async function C1n(e,t){const n=t.select("g");M$(n,e.markers,e.type,e.diagramId);qEe();jEe();WEe();JEe();oxn(e);const r=lxn(e);e.nodes=r.nodes;e.edges=r.edges;const{groups:i}=await Wbn(n,e);E1n(e);await nxn(e,i)}var zbn,iCe,oCe,T2i,pZe,w2i,Ubn,E2i,Nm,Za,C2i,Vbn,Pw,S2i,aCe,A2i,Zo,Fm,js,mZe,kL,k2i,bx,$bn,sCe,gZe,R2i,Gbn,P2i,I2i,xCe,Hbn,f1n,yl,M2i,sB,L$,lCe,M_,yZe;var A1n=Ce(()=>{UKe();yx();kg();Eg();K0();Sg();Np();Jh();nl();Ta();Aa();Yo();iv();B(Wbn,"createGraphWithElements");zbn=5;iCe=1e-5;oCe=1e-6;B(dCe,"buildSegmentList");B(Ybn,"segmentIntersection");B(bZe,"isHorizontalSeg");B(qbn,"findEdgeIntersections");B(Iw,"fmt");B(D$,"pointToString");B(Xbn,"getArcSweepFlag");T2i=.001;B(jbn,"applyMarkerOffsets");B(Kbn,"emitJump");B(xZe,"computeRoundedCorner");B(Zbn,"rewriteEdgePath");B(Jbn,"isStraightPath");B(Qbn,"curveSupportsLineHops");B(exn,"decodeDataPoints");B(txn,"applyLineJumpsToSvg");B(nxn,"adjustLayout");B(rxn,"positionEdgeLabel");pZe="__swimlane_default__";w2i=21;Ubn=20;B(vZe,"topLaneHorizontalPadding");B(ixn,"assignTopLaneTitleRect");B(oxn,"prepareLayoutForSwimlanes");B(axn,"toGraphView");B(sxn,"writeBackToLayoutData");E2i="[EdgeLabelNodes]";B(lxn,"createEdgeLabelNodes");Nm=.001;B(ZZe,"measuredNodeRect");B(JZe,"nodeBoundsInfoFor");B(L_,"samePoint");B(Bl,"sameX");B(Xl,"sameY");B(Xf,"isHorizontalSegment");B(jf,"isVerticalSegment");B(Z0,"overlapLength");B(YC,"sameAxisSegmentOverlapLength");B(N$,"orthogonalSegmentsForPoints");B(ov,"countOrthogonalBends");B(hc,"dedupeConsecutivePoints");B(QZe,"classifyThreeSegmentRoute");B(_Ce,"segmentBoundsOverlapRect");B(eJe,"pointInsideRect");B(cxn,"rectContainsRect");B(fCe,"rectsOverlap");B(_Ze,"inflateRect");B(F$,"rectFromCenterSize");B(xx,"rectOfNodeBounds");B(cB,"portForRectSide");B(tJe,"buildOrthogonalPortPath");B(nJe,"buildSameSideTrackPath");B(TCe,"collectRealNodeBounds");B(RL,"collectNodeRectEntries");B(uxn,"collectLayoutNodeRects");B(rJe,"getNodePairGeometry");B(bh,"segmentHitsAnyRect");B(iJe,"orthogonalSegmentsCross");B(dxn,"sameAxisSegmentsOverlap");B(hCe,"segmentConflictsWithAnyEdge");B(RR,"orthogonalSegmentsStrictlyCross");B(TZe,"strictlyBetween");B(fxn,"isCollinearIntermediate");B(hxn,"simplifyPolylineOnce");B(pCe,"orthogonalizePolyline");B(qC,"simplifyPolyline");Za=.001;C2i=.5;Vbn=4;B(oJe,"endpointContextFor");B(pxn,"segmentEnterPoint");B(wZe,"clipEndpoint");B(mxn,"clipEdgeEndpointsToNodeBoundaries");B(EZe,"snapEndpointToBoundary");B(mCe,"firstDistinctAdjacent");B(gCe,"cornerClearanceRange");B(CZe,"clampToCornerClearance");B(gxn,"intersectRanges");B(SZe,"clearanceRangeForSide");B(yCe,"terminalSideForSegment");B(jee,"isHorizontalSide");B(yxn,"straightClearanceRange");B(AZe,"clearStraightEndpointCornerAxis");B(aJe,"clearStraightEndpointCornerConnections");B(bxn,"cornerClearedEndpoint");B(xxn,"moveCollinearEndpointRun");B(kZe,"clearEndpointCornerConnection");B(RZe,"borderSideForSegment");B(PZe,"leavesOutward");B(IZe,"collapseOwnBorderStub");B(vxn,"snapAndCollapseEndpoints");B(MZe,"prepareEdgeEndpointsForRenderer");B(sJe,"buildNodeMap");B(_xn,"resolveTopLevelGroupId");B(LZe,"groupDepth");B(lJe,"boundsForChildren");B(Txn,"applyGroupBounds");B(wxn,"recomputeNestedGroupBounds");B(bCe,"mirrorAxis");B(Exn,"applyBtDirectionTransform");B(Cxn,"applyLrDirectionTransform");Pw=1e-6;S2i=8;aCe=S2i;A2i=[0,aCe,-aCe,2*aCe,-2*aCe];B(Sxn,"portSwapToLShape");B(Axn,"collapseShortTerminalStub");Zo=.001;Fm=8;js=N$;mZe=B((e,t)=>Bl(e,t,Zo)||Xl(e,t,Zo),"orthogonallyAligned");B(kxn,"separateSharedRenderedTerminalLanes");B(Rxn,"collapseRedundantRectangularDoglegs");B(DZe,"liftObstacleHuggingSameSideRails");B(FZe,"liftTopLaneTitleBandsAboveRails");B(NZe,"shiftLeftLaneTitleBandsLeftOfRails");B(Pxn,"swapDestinationTerminalTailsToReduceCrossings");B(Ixn,"reassignCrossingExternalRailChannels");B(Mxn,"shortcutRedundantOrthogonalJogs");B(Lxn,"resolveRenderedOrthogonalCrossings");kL=.001;k2i=8;B(Dxn,"simplifyDetouredEdges");bx=.001;$bn=10;sCe=7;B(OZe,"markerClearanceRectFor");B(Fxn,"normalizeRect");B(BZe,"labelOverlapsOwnMarker");B(cCe,"anchorLabelsToPolyline");gZe=1e-6;R2i=8;Gbn=R2i/2;P2i=3;B(zZe,"pairKey");B(Nxn,"straightenCollinearSiblingDetours");B(UZe,"nudgeSharedInteriorSubpaths");B(Oxn,"segmentsIntersect");B(Bxn,"validateSwimlanesLayout");B(zxn,"postProcessSwimlaneLayout");B(PL,"normalizeGraph");B(cJe,"incoming");B(Uxn,"buildSuccessorMap");B(uJe,"buildSortedSuccessorMap");B(dJe,"buildInDegreeMap");B(fJe,"sortedZeroInDegreeNodes");B(wCe,"buildPredecessorSuccessorMaps");B(hJe,"buildLayersFromRanks");B(Kee,"topoSortIfAcyclic");B(O$,"buildLayerIndex");B(pJe,"countInversions");B(Vxn,"removeCycles_DFS");B($xn,"buildTopLaneMap");B(PR,"createTopLaneResolver");B(ECe,"buildTopLaneOrder");B(mJe,"resolveTopLaneOrder");I2i={EPSILON:1e-6};xCe={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:true};Hbn={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};B(Gxn,"buildDrivingTree");B(Hxn,"chooseParent");B(Wxn,"buildAdjacency");B(Yxn,"assignComponents");B(qxn,"computeBlocks");B(Xxn,"popBlock");B(jxn,"computeSubtreeCrossCounts");B(Kxn,"annotateMinimumLayers");B(gJe,"compareByRankThenId");B(Zxn,"emitNodesInTreeOrder");B(Jxn,"deduplicateLayers");B(Qxn,"createChildOrderer");B(vCe,"buildMultitreeLayerOrder");B(e1n,"countCrossingsBetweenAdjacent");B(VZe,"totalCrossings");B(t1n,"optimizeRanksByCrossings");B(n1n,"adjustCrossLaneSources");B(r1n,"assignLayers_LongestPath");B(i1n,"assignLayers_Gravity");B(o1n,"topoSortByGenerationIfAcyclic");B(a1n,"assignLayers_LaneAwareCompact");B(s1n,"makeProperLayering");B($Ze,"median");B(GZe,"barycenter");B(l1n,"neighborPositionsFor");B(c1n,"currentOrderTieBreak");B(HZe,"countCrossingsBetweenAdjacent");B(uCe,"sortByHeuristic");B(WZe,"reorderLayer");B(YZe,"transposeImprove");B(u1n,"orderLayers");B(d1n,"assignCoordinates");f1n=8;B(h1n,"hashString");B(p1n,"mulberry32");B(m1n,"deterministicShuffle");B(g1n,"sourceDistance");B(qZe,"laneArrangementCost");B(y1n,"buildWeightedLaneEdges");B(XZe,"greedySwitch");B(b1n,"isBetterCandidate");B(x1n,"seedForRestart");B(v1n,"optimizeTopLaneOrder");B(_1n,"sugiyamaLayout");yl=I2i.EPSILON;M2i=8;sB=15;L$=15;lCe=25;M_=20;yZe=10;B(jZe,"chooseOrthogonalSide");B(KZe,"sharedLineEndpointCoord");B(lB,"pointOnLine");B(T1n,"routeEdgesOrthogonal");B(w1n,"getSwimlaneDirection");B(E1n,"runSwimlaneLayoutCore");B(C1n,"render")});function qQe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n=e.length?{done:true}:{done:false,value:e[r++]}},e:function(l){throw l},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=true,s=false;return{s:function(){n=n.call(e)},n:function(){var l=n.next();return a=l.done,l},e:function(l){s=true,o=l},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function nTn(e,t,n){return(t=rTn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true}):e[t]=n,e}function N2i(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function O2i(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=true,u=false;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=false}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=true);}catch(d){u=true,i=d}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function B2i(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function z2i(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function np(e,t){return L2i(e)||O2i(e,t)||pet(e,t)||B2i()}function jCe(e){return D2i(e)||N2i(e)||pet(e)||z2i()}function U2i(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function rTn(e){var t=U2i(e,"string");return"symbol"==typeof t?t:t+""}function zp(e){"@babel/helpers - typeof";return zp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zp(e)}function pet(e,t){if(e){if("string"==typeof e)return qQe(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qQe(e,t):void 0}}function Tte(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}function wte(){if(P1n)return yJe;P1n=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}yJe=e;return yJe}function cEi(){if(I1n)return bJe;I1n=1;var e=typeof CCe=="object"&&CCe&&CCe.Object===Object&&CCe;bJe=e;return bJe}function uSe(){if(M1n)return xJe;M1n=1;var e=cEi();var t=typeof self=="object"&&self&&self.Object===Object&&self;var n=e||t||Function("return this")();xJe=n;return xJe}function uEi(){if(L1n)return vJe;L1n=1;var e=uSe();var t=function(){return e.Date.now()};vJe=t;return vJe}function dEi(){if(D1n)return _Je;D1n=1;var e=/\s/;function t(n){var r=n.length;while(r--&&e.test(n.charAt(r))){}return r}_Je=t;return _Je}function fEi(){if(F1n)return TJe;F1n=1;var e=dEi();var t=/^\s+/;function n(r){return r?r.slice(0,e(r)+1).replace(t,""):r}TJe=n;return TJe}function yet(){if(N1n)return wJe;N1n=1;var e=uSe();var t=e.Symbol;wJe=t;return wJe}function hEi(){if(O1n)return EJe;O1n=1;var e=yet();var t=Object.prototype;var n=t.hasOwnProperty;var r=t.toString;var i=e?e.toStringTag:void 0;function o(a){var s=n.call(a,i),l=a[i];try{a[i]=void 0;var u=true}catch(f){}var d=r.call(a);if(u){if(s){a[i]=l}else{delete a[i]}}return d}EJe=o;return EJe}function pEi(){if(B1n)return CJe;B1n=1;var e=Object.prototype;var t=e.toString;function n(r){return t.call(r)}CJe=n;return CJe}function fTn(){if(z1n)return SJe;z1n=1;var e=yet(),t=hEi(),n=pEi();var r="[object Null]",i="[object Undefined]";var o=e?e.toStringTag:void 0;function a(s){if(s==null){return s===void 0?i:r}return o&&o in Object(s)?t(s):n(s)}SJe=a;return SJe}function mEi(){if(U1n)return AJe;U1n=1;function e(t){return t!=null&&typeof t=="object"}AJe=e;return AJe}function Ete(){if(V1n)return kJe;V1n=1;var e=fTn(),t=mEi();var n="[object Symbol]";function r(i){return typeof i=="symbol"||t(i)&&e(i)==n}kJe=r;return kJe}function gEi(){if($1n)return RJe;$1n=1;var e=fEi(),t=wte(),n=Ete();var r=0/0;var i=/^[-+]0x[0-9a-f]+$/i;var o=/^0b[01]+$/i;var a=/^0o[0-7]+$/i;var s=parseInt;function l(u){if(typeof u=="number"){return u}if(n(u)){return r}if(t(u)){var d=typeof u.valueOf=="function"?u.valueOf():u;u=t(d)?d+"":d}if(typeof u!="string"){return u===0?u:+u}u=e(u);var f=o.test(u);return f||a.test(u)?s(u.slice(2),f?2:8):i.test(u)?r:+u}RJe=l;return RJe}function yEi(){if(G1n)return PJe;G1n=1;var e=wte(),t=uEi(),n=gEi();var r="Expected a function";var i=Math.max,o=Math.min;function a(s,l,u){var d,f,h,m,g,x,w=0,_=false,C=false,A=true;if(typeof s!="function"){throw new TypeError(r)}l=n(l)||0;if(e(u)){_=!!u.leading;C="maxWait"in u;h=C?i(n(u.maxWait)||0,l):h;A="trailing"in u?!!u.trailing:A}function P($){var K=d,X=f;d=f=void 0;w=$;m=s.apply(X,K);return m}function L($){w=$;g=setTimeout(O,l);return _?P($):m}function I($){var K=$-x,X=$-w,j=l-K;return C?o(j,h-X):j}function N($){var K=$-x,X=$-w;return x===void 0||K>=l||K<0||C&&X>=h}function O(){var $=t();if(N($)){return z($)}g=setTimeout(O,I($))}function z($){g=void 0;if(A&&d){return P($)}d=f=void 0;return m}function U(){if(g!==void 0){clearTimeout(g)}w=0;d=x=f=g=void 0}function W(){return g===void 0?m:z(t())}function H(){var $=t(),K=N($);d=arguments;f=this;x=$;if(K){if(g===void 0){return L(x)}if(C){clearTimeout(g);g=setTimeout(O,l);return P(x)}}if(g===void 0){g=setTimeout(O,l)}return m}H.cancel=U;H.flush=W;return H}PJe=a;return PJe}function TEi(e,t,n,r,i){var o=i*Math.PI/180;var a=Math.cos(o)*(e-n)-Math.sin(o)*(t-r)+n;var s=Math.sin(o)*(e-n)+Math.cos(o)*(t-r)+r;return{x:a,y:s}}function EEi(e,t,n){if(n===0)return e;var r=(t.x1+t.x2)/2;var i=(t.y1+t.y2)/2;var o=t.w/t.h;var a=1/o;var s=TEi(e.x,e.y,r,i,n);var l=wEi(s.x,s.y,r,i,o,a);return{x:l.x,y:l.y}}function FEi(){if(X1n)return BCe.exports;X1n=1;(function(e,t){(function(){var n,r,i,o,a,s,l,u,d,f,h,m,g,x,w;i=Math.floor,f=Math.min;r=function(_,C){if(_C){return 1}return 0};d=function(_,C,A,P,L){var I;if(A==null){A=0}if(L==null){L=r}if(A<0){throw new Error("lo must be non-negative")}if(P==null){P=_.length}while(AU;0<=U?z++:z--){O.push(z)}return O}.apply(this).reverse();N=[];for(P=0,L=I.length;PW;0<=W?++O:--O){H.push(a(_,A))}return H};x=function(_,C,A,P){var L,I,N;if(P==null){P=r}L=_[A];while(A>C){N=A-1>>1;I=_[N];if(P(L,I)<0){_[A]=I;A=N;continue}break}return _[A]=L};w=function(_,C,A){var P,L,I,N,O;if(A==null){A=r}L=_.length;O=C;I=_[C];P=2*C+1;while(P-1}oQe=t;return oQe}function kSi(){if(Fvn)return aQe;Fvn=1;var e=gSe();function t(n,r){var i=this.__data__,o=e(i,n);if(o<0){++this.size;i.push([n,r])}else{i[o][1]=r}return this}aQe=t;return aQe}function RSi(){if(Nvn)return sQe;Nvn=1;var e=ESi(),t=CSi(),n=SSi(),r=ASi(),i=kSi();function o(a){var s=-1,l=a==null?0:a.length;this.clear();while(++s-1&&r%1==0&&r0){var d=i.shift();t(d);o.add(d.id());if(s){r(i,o,d)}}return e}function GTn(e,t,n){if(n.isParent()){var r=n._private.children;for(var i=0;i0&&arguments[0]!==void 0?arguments[0]:UAi;var t=arguments.length>1?arguments[1]:void 0;for(var n=0;n0){H=K}else{W=K}}while(Math.abs($)>a&&++X=o){return C(U,X)}else if(j===0){return X}else{return P(U,W,W+u)}}var I=false;function N(){I=true;if(e!==t||n!==r){A()}}var O=function U(W){if(!I){N()}if(e===t&&n===r){return W}if(W===0){return 0}if(W===1){return 1}return w(L(W),t,r)};O.getControlPoints=function(){return[{x:e,y:t},{x:n,y:r}]};var z="generateBezier("+[e,t,n,r]+")";O.toString=function(){return z};return O}function C_n(e,t,n,r,i){if(r===1){return n}if(t===n){return n}var o=i(t,n,r);if(e==null){return o}if(e.roundValue||e.color){o=Math.round(o)}if(e.min!==void 0){o=Math.max(o,e.min)}if(e.max!==void 0){o=Math.min(o,e.max)}return o}function S_n(e,t){if(e.pfValue!=null||e.value!=null){if(e.pfValue!=null&&(t==null||t.type.units!=="%")){return e.pfValue}else{return e.value}}else{return e}}function U$(e,t,n,r,i){var o=i!=null?i.type:null;if(n<0){n=0}else if(n>1){n=1}var a=S_n(e,i);var s=S_n(t,i);if(so(a)&&so(s)){return C_n(o,a,s,n,r)}else if(Yu(a)&&Yu(s)){var l=[];for(var u=0;u0){if(m==="spring"){g.push(a.duration)}a.easingImpl=GCe[m].apply(null,g)}else{a.easingImpl=GCe[m]}}}var x=a.easingImpl;var w;if(a.duration===0){w=1}else{w=(n-l)/a.duration}if(a.applying){w=a.progress}if(w<0){w=0}else if(w>1){w=1}if(a.delay==null){var _=a.startPosition;var C=a.position;if(C&&i&&!e.locked()){var A={};if(ete(_.x,C.x)){A.x=U$(_.x,C.x,w,x)}if(ete(_.y,C.y)){A.y=U$(_.y,C.y,w,x)}e.position(A)}var P=a.startPan;var L=a.pan;var I=o.pan;var N=L!=null&&r;if(N){if(ete(P.x,L.x)){I.x=U$(P.x,L.x,w,x)}if(ete(P.y,L.y)){I.y=U$(P.y,L.y,w,x)}e.emit("pan")}var O=a.startZoom;var z=a.zoom;var U=z!=null&&r;if(U){if(ete(O,z)){o.zoom=hte(o.minZoom,U$(O,z,w,x),o.maxZoom)}e.emit("zoom")}if(N||U){e.emit("viewport")}var W=a.style;if(W&&W.length>0&&i){for(var H=0;H=0;N--){var O=I[N];O()}I.splice(0,I.length)};for(var C=m.length-1;C>=0;C--){var A=m[C];var P=A._private;if(P.stopped){m.splice(C,1);P.hooked=false;P.playing=false;P.started=false;_(P.frames);continue}if(!P.playing&&!P.applying){continue}if(P.playing&&P.applying){P.applying=false}if(!P.started){eki(d,A,e)}QAi(d,A,e,f);if(P.applying){P.applying=false}_(P.frames);if(P.step!=null){P.step(e)}if(A.completed()){m.splice(C,1);P.hooked=false;P.playing=false;P.started=false;_(P.completes)}x=true}if(!f&&m.length===0&&g.length===0){r.push(d)}return x}var o=false;for(var a=0;a0){t.notify("draw",n)}else{t.notify("draw")}}n.unmerge(r);t.emit("step")}function swn(e){this.options=Ua({},lki,cki,e)}function lwn(e){this.options=Ua({},uki,e)}function cwn(e){this.options=Ua({},dki,e)}function ESe(e){this.options=Ua({},fki,e);this.options.layout=this;var t=this.options.eles.nodes();var n=this.options.eles.edges();var r=n.filter(function(i){var o=i.source().data("id");var a=i.target().data("id");var s=t.some(function(u){return u.data("id")===o});var l=t.some(function(u){return u.data("id")===a});return!s||!l});this.options.eles=this.options.eles.not(r)}function hwn(e){this.options=Ua({},Aki,e)}function Det(e){this.options=Ua({},kki,e)}function pwn(e){this.options=Ua({},Rki,e)}function mwn(e){this.options=Ua({},Pki,e)}function gwn(e){this.options=e;this.notifications=0}function xwn(e,t){if(t.radius===0)e.lineTo(t.cx,t.cy);else e.arc(t.cx,t.cy,t.radius,t.startAngle,t.endAngle,t.counterClockwise)}function Net(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:true;if(r===0||t.radius===0)return{cx:t.x,cy:t.y,radius:0,startX:t.x,startY:t.y,stopX:t.x,stopY:t.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0};Lki(e,t,n,r,i);return{cx:iet,cy:oet,radius:pB,startX:ywn,startY:bwn,stopX:aet,stopY:set,startAngle:KC.ang+Math.PI/2*gB,endAngle:D_.ang-Math.PI/2*gB,counterClockwise:YCe}}function vwn(e){var t=[];if(e==null){return}for(var n=0;n5&&arguments[5]!==void 0?arguments[5]:5;var a=Math.min(o,r/2,i/2);e.beginPath();e.moveTo(t+a,n);e.lineTo(t+r-a,n);e.quadraticCurveTo(t+r,n,t+r,n+a);e.lineTo(t+r,n+i-a);e.quadraticCurveTo(t+r,n+i,t+r-a,n+i);e.lineTo(t+a,n+i);e.quadraticCurveTo(t,n+i,t,n+i-a);e.lineTo(t,n+a);e.quadraticCurveTo(t,n,t+a,n);e.closePath()}function q_n(e,t,n){var r=e.createShader(t);e.shaderSource(r,n);e.compileShader(r);if(!e.getShaderParameter(r,e.COMPILE_STATUS)){throw new Error(e.getShaderInfoLog(r))}return r}function ERi(e,t,n){var r=q_n(e,e.VERTEX_SHADER,t);var i=q_n(e,e.FRAGMENT_SHADER,n);var o=e.createProgram();e.attachShader(o,r);e.attachShader(o,i);e.linkProgram(o);if(!e.getProgramParameter(o,e.LINK_STATUS)){throw new Error("Could not initialize shaders")}return o}function CRi(e,t,n){if(n===void 0){n=t}var r=e.makeOffscreenCanvas(t,n);var i=r.context=r.getContext("2d");r.clear=function(){return i.clearRect(0,0,r.width,r.height)};r.clear();return r}function zet(e){var t=e.pixelRatio;var n=e.cy.zoom();var r=e.cy.pan();return{zoom:n*t,pan:{x:r.x*t,y:r.y*t}}}function SRi(e){var t=e.pixelRatio;var n=e.cy.zoom();return n*t}function ARi(e,t,n,r,i){var o=r*n+t.x;var a=i*n+t.y;a=Math.round(e.canvasHeight-a);return[o,a]}function kRi(e,t){if(t.picking){return true}else{if(e.pstyle("background-fill").value!=="solid")return false;if(e.pstyle("background-image").strValue!=="none")return false;if(e.pstyle("border-width").value===0)return true;if(e.pstyle("border-opacity").value===0)return true;if(e.pstyle("border-style").value!=="solid")return false;return true}}function RRi(e,t){if(e.length!==t.length){return false}for(var n=0;n>0&255)/255;n[1]=(e>>8&255)/255;n[2]=(e>>16&255)/255;n[3]=(e>>24&255)/255;return n}function PRi(e){return e[0]+(e[1]<<8)+(e[2]<<16)+(e[3]<<24)}function IRi(e,t){var n=e.createTexture();n.buffer=function(r){e.bindTexture(e.TEXTURE_2D,n);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR_MIPMAP_NEAREST);e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,true);e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,r);e.generateMipmap(e.TEXTURE_2D);e.bindTexture(e.TEXTURE_2D,null)};n.deleteTexture=function(){e.deleteTexture(n)};return n}function Dwn(e,t){switch(t){case"float":return[1,e.FLOAT,4];case"vec2":return[2,e.FLOAT,4];case"vec3":return[3,e.FLOAT,4];case"vec4":return[4,e.FLOAT,4];case"int":return[1,e.INT,4];case"ivec2":return[2,e.INT,4]}}function Fwn(e,t,n){switch(t){case e.FLOAT:return new Float32Array(n);case e.INT:return new Int32Array(n)}}function MRi(e,t,n,r,i,o){switch(t){case e.FLOAT:return new Float32Array(n.buffer,o*r,i);case e.INT:return new Int32Array(n.buffer,o*r,i)}}function LRi(e,t,n,r){var i=Dwn(e,t),o=np(i,2),a=o[0],s=o[1];var l=Fwn(e,s,r);var u=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,u);e.bufferData(e.ARRAY_BUFFER,l,e.STATIC_DRAW);if(s===e.FLOAT){e.vertexAttribPointer(n,a,s,false,0,0)}else if(s===e.INT){e.vertexAttribIPointer(n,a,s,0,0)}e.enableVertexAttribArray(n);e.bindBuffer(e.ARRAY_BUFFER,null);return u}function jC(e,t,n,r){var i=Dwn(e,n),o=np(i,3),a=o[0],s=o[1],l=o[2];var u=Fwn(e,s,t*a);var d=a*l;var f=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,f);e.bufferData(e.ARRAY_BUFFER,t*d,e.DYNAMIC_DRAW);e.enableVertexAttribArray(r);if(s===e.FLOAT){e.vertexAttribPointer(r,a,s,false,d,0)}else if(s===e.INT){e.vertexAttribIPointer(r,a,s,d,0)}e.vertexAttribDivisor(r,1);e.bindBuffer(e.ARRAY_BUFFER,null);var h=new Array(t);for(var m=0;mRwn){KRi(e);t.call(e,o)}else{ZRi(e);zwn(e,o,cte.SCREEN)}}}}{var n=e.matchCanvasSize;e.matchCanvasSize=function(o){n.call(e,o);e.pickingFrameBuffer.setFramebufferAttachmentSizes(e.canvasWidth,e.canvasHeight);e.pickingFrameBuffer.needsDraw=true}}{e.findNearestElements=function(o,a,s,l){return rPi(e,o,a)}}{var r=e.invalidateCachedZSortedEles;e.invalidateCachedZSortedEles=function(){r.call(e);e.pickingFrameBuffer.needsDraw=true}}{var i=e.notify;e.notify=function(o,a){i.call(e,o,a);if(o==="viewport"||o==="bounds"){e.pickingFrameBuffer.needsDraw=true}else if(o==="background"){e.drawing.invalidate(a,{type:"node-body"})}}}}function KRi(e){var t=e.data.contexts[e.WEBGL];t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT)}function ZRi(e){var t=function n(r){r.save();r.setTransform(1,0,0,1,0,0);r.clearRect(0,0,e.canvasWidth,e.canvasHeight);r.restore()};t(e.data.contexts[e.NODE]);t(e.data.contexts[e.DRAG])}function JRi(e){var t=e.canvasWidth;var n=e.canvasHeight;var r=zet(e),i=r.pan,o=r.zoom;var a=VQe();XCe(a,a,[i.x,i.y]);uet(a,a,[o,o]);var s=VQe();ORi(s,t,n);var l=VQe();NRi(l,s,a);return l}function Bwn(e,t){var n=e.canvasWidth;var r=e.canvasHeight;var i=zet(e),o=i.pan,a=i.zoom;t.setTransform(1,0,0,1,0,0);t.clearRect(0,0,n,r);t.translate(o.x,o.y);t.scale(a,a)}function QRi(e,t){e.drawSelectionRectangle(t,function(n){return Bwn(e,n)})}function ePi(e){var t=e.data.contexts[e.NODE];t.save();Bwn(e,t);t.strokeStyle="rgba(0, 0, 0, 0.3)";t.beginPath();t.moveTo(-1e3,0);t.lineTo(1e3,0);t.stroke();t.beginPath();t.moveTo(0,-1e3);t.lineTo(0,1e3);t.stroke();t.restore()}function tPi(e){var t=function r(i,o,a){var s=i.atlasManager.getAtlasCollection(o);var l=e.data.contexts[e.NODE];var u=s.atlases;for(var d=0;d=0){P.add(N)}}return P}function rPi(e,t,n){var r=nPi(e,t,n);var i=e.getCachedZSortedEles();var o,a;var s=_x(r),l;try{for(s.s();!(l=s.n()).done;){var u=l.value;var d=i[u];if(!o&&d.isNode()){o=d}if(!a&&d.isEdge()){a=d}if(o&&a){break}}}catch(f){s.e(f)}finally{s.f()}return[o,a].filter(Boolean)}function YQe(e,t,n){var r=e.drawing;t+=1;if(n.isNode()){r.drawNode(n,t,"node-underlay");r.drawNode(n,t,"node-body");r.drawTexture(n,t,"label");r.drawNode(n,t,"node-overlay")}else{r.drawEdgeLine(n,t);r.drawEdgeArrow(n,t,"source");r.drawEdgeArrow(n,t,"target");r.drawTexture(n,t,"label");r.drawTexture(n,t,"edge-source-label");r.drawTexture(n,t,"edge-target-label")}}function zwn(e,t,n){var r;if(e.webglDebug){r=performance.now()}var i=e.drawing;var o=0;if(n.screen){if(e.data.canvasNeedsRedraw[e.SELECT_BOX]){QRi(e,t)}}if(e.data.canvasNeedsRedraw[e.NODE]||n.picking){var a=e.data.contexts[e.WEBGL];if(n.screen){a.clearColor(0,0,0,0);a.enable(a.BLEND);a.blendFunc(a.ONE,a.ONE_MINUS_SRC_ALPHA)}else{a.disable(a.BLEND)}a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT);a.viewport(0,0,a.canvas.width,a.canvas.height);var s=JRi(e);var l=e.getCachedZSortedEles();o=l.length;i.startFrame(s,n);if(n.screen){for(var u=0;u{Op=typeof window==="undefined"?null:window;k1n=Op?Op.navigator:null;Op?Op.document:null;V2i=zp("");iTn=zp({});$2i=zp(function(){});G2i=typeof HTMLElement==="undefined"?"undefined":zp(HTMLElement);vte=function e(t){return t&&t.instanceString&&Af(t.instanceString)?t.instanceString():null};ma=function e(t){return t!=null&&zp(t)==V2i};Af=function e(t){return t!=null&&zp(t)===$2i};Yu=function e(t){return!av(t)&&(Array.isArray?Array.isArray(t):t!=null&&t instanceof Array)};mc=function e(t){return t!=null&&zp(t)===iTn&&!Yu(t)&&t.constructor===Object};H2i=function e(t){return t!=null&&zp(t)===iTn};so=function e(t){return t!=null&&zp(t)===zp(1)&&!isNaN(t)};W2i=function e(t){return so(t)&&Math.floor(t)===t};KCe=function e(t){if("undefined"===G2i){return void 0}else{return null!=t&&t instanceof HTMLElement}};av=function e(t){return _te(t)||oTn(t)};_te=function e(t){return vte(t)==="collection"&&t._private.single};oTn=function e(t){return vte(t)==="collection"&&!t._private.single};met=function e(t){return vte(t)==="core"};aTn=function e(t){return vte(t)==="stylesheet"};Y2i=function e(t){return vte(t)==="event"};zL=function e(t){if(t===void 0||t===null){return true}else if(t===""||t.match(/^\s+$/)){return true}return false};q2i=function e(t){if(typeof HTMLElement==="undefined"){return false}else{return t instanceof HTMLElement}};X2i=function e(t){return mc(t)&&so(t.x1)&&so(t.x2)&&so(t.y1)&&so(t.y2)};j2i=function e(t){return H2i(t)&&Af(t.then)};K2i=function e(){return k1n&&k1n.userAgent.match(/msie|trident|edge/i)};Q$=function e(t,n){if(!n){n=function i(){if(arguments.length===1){return arguments[0]}else if(arguments.length===0){return"undefined"}var o=[];for(var a=0;an){return 1}else{return 0}};rEi=function e(t,n){return-1*lTn(t,n)};Ua=Object.assign!=null?Object.assign.bind(Object):function(e){var t=arguments;for(var n=1;n1)w-=1;if(w<1/6)return g+(x-g)*6*w;if(w<1/2)return x;if(w<2/3)return g+(x-g)*(2/3-w)*6;return g}var f=new RegExp("^"+Q2i+"$").exec(t);if(f){r=parseInt(f[1]);if(r<0){r=(360- -1*r%360)%360}else if(r>360){r=r%360}r/=360;i=parseFloat(f[2]);if(i<0||i>100){return}i=i/100;o=parseFloat(f[3]);if(o<0||o>100){return}o=o/100;a=f[4];if(a!==void 0){a=parseFloat(a);if(a<0||a>1){return}}if(i===0){s=l=u=Math.round(o*255)}else{var h=o<.5?o*(1+i):o+i-o*i;var m=2*o-h;s=Math.round(255*d(m,h,r+1/3));l=Math.round(255*d(m,h,r));u=Math.round(255*d(m,h,r-1/3))}n=[s,l,u,a]}return n};aEi=function e(t){var n;var r=new RegExp("^"+Z2i+"$").exec(t);if(r){n=[];var i=[];for(var o=1;o<=3;o++){var a=r[o];if(a[a.length-1]==="%"){i[o]=true}a=parseFloat(a);if(i[o]){a=a/100*255}if(a<0||a>255){return}n.push(Math.floor(a))}var s=i[1]||i[2]||i[3];var l=i[1]&&i[2]&&i[3];if(s&&!l){return}var u=r[4];if(u!==void 0){u=parseFloat(u);if(u<0||u>1){return}n.push(u)}}return n};sEi=function e(t){return lEi[t.toLowerCase()]};cTn=function e(t){return(Yu(t)?t:null)||sEi(t)||iEi(t)||aEi(t)||oEi(t)};lEi={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};uTn=function e(t){var n=t.map;var r=t.keys;var i=r.length;for(var o=0;o1&&arguments[1]!==void 0?arguments[1]:mB;var r=n;var i;for(;;){i=t.next();if(i.done){break}r=r*pTn+i.value|0}return r};ute=function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:mB;return n*pTn+t|0};dte=function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:W$;return(n<<5)+n+t|0};vEi=function e(t,n){return t*2097152+n};IL=function e(t){return t[0]*2097152+t[1]};SCe=function e(t,n){return[ute(t[0],n[0]),dte(t[1],n[1])]};H1n=function e(t,n){var r={value:0,done:false};var i=0;var o=t.length;var a={next:function s(){if(i=0;i--){if(t[i]===n){t.splice(i,1)}}};vet=function e(t){t.splice(0,t.length)};PEi=function e(t,n){for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:true;if(t===void 0||n===void 0||!met(t)){sf("An element must have a core reference and parameters set");return}var i=n.group;if(i==null){if(n.data&&n.data.source!=null&&n.data.target!=null){i="edges"}else{i="nodes"}}if(i!=="nodes"&&i!=="edges"){sf("An element must be of type `nodes` or `edges`; you specified `"+i+"`");return}this.length=1;this[0]=this;var o=this._private={cy:t,single:true,data:n.data||{},position:n.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:false,listeners:[],group:i,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:true,selected:n.selected?true:false,selectable:n.selectable===void 0?true:n.selectable?true:false,locked:n.locked?true:false,grabbed:false,grabbable:n.grabbable===void 0?true:n.grabbable?true:false,pannable:n.pannable===void 0?i==="edges"?true:false:n.pannable?true:false,active:false,classes:new iG,animation:{current:[],queue:[]},rscratch:{},scratch:n.scratch||{},edges:[],children:[],parent:n.parent&&n.parent.isNode()?n.parent:null,traversalCache:{},backgrounding:false,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(o.position.x==null){o.position.x=0}if(o.position.y==null){o.position.y=0}if(n.renderedPosition){var a=n.renderedPosition;var s=t.pan();var l=t.zoom();o.position={x:(a.x-s.x)/l,y:(a.y-s.y)/l}}var u=[];if(Yu(n.classes)){u=n.classes}else if(ma(n.classes)){u=n.classes.split(/\s+/)}for(var d=0,f=u.length;d0){var I=C.pop();var N=w(I);var O=I.id();h[O]=N;if(N===Infinity){continue}var z=I.neighborhood().intersect(g);for(var U=0;U0){J.unshift(te);while(f[se]){var re=f[se];J.unshift(re.edge);J.unshift(re.node);oe=re.node;se=oe.id()}}return s.spawn(J)}}}};UEi={kruskal:function e(t){t=t||function(A){return 1};var n=this.byGroup(),r=n.nodes,i=n.edges;var o=r.length;var a=new Array(o);var s=r;var l=function A(P){for(var L=0;L0){L();N++;if(P===d){var O=[];var z=o;var U=d;var W=_[U];for(;;){O.unshift(z);if(W!=null){O.unshift(W)}z=w[U];if(z==null){break}U=z.id();W=_[U]}return{found:true,distance:f[P],path:this.spawn(O),steps:N}}m[P]=true;var H=A._private.edges;for(var $=0;$W){g[U]=W;C[U]=z;A[U]=L}if(!o){var H=z*d+O;if(!o&&g[H]>W){g[H]=W;C[H]=O;A[H]=L}}}for(var $=0;$1&&arguments[1]!==void 0?arguments[1]:a;var bt=A(Ge);var He=[];var Je=bt;for(;;){if(Je==null){return n.spawn()}var Te=C(Je),we=Te.edge,Ze=Te.pred;He.unshift(Je[0]);if(Je.same(it)&&He.length>0){break}if(we!=null){He.unshift(we)}Je=Ze}return l.spawn(He)};for(var I=0;I=0;d--){var f=u[d];var h=f[1];var m=f[2];if(n[h]===s&&n[m]===l||n[h]===l&&n[m]===s){u.splice(d,1)}}for(var g=0;gi){var o=Math.floor(Math.random()*n.length);n=XEi(o,t,n);r--}return n};jEi={kargerStein:function e(){var t=this;var n=this.byGroup(),r=n.nodes,i=n.edges;i.unmergeBy(function(J){return J.isLoop()});var o=r.length;var a=i.length;var s=Math.ceil(Math.pow(Math.log(o)/Math.LN2,2));var l=Math.floor(o/qEi);if(o<2){sf("At least 2 nodes are required for Karger-Stein algorithm");return void 0}var u=[];for(var d=0;d1&&arguments[1]!==void 0?arguments[1]:0;var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.length;var i=Infinity;for(var o=n;o1&&arguments[1]!==void 0?arguments[1]:0;var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.length;var i=-Infinity;for(var o=n;o1&&arguments[1]!==void 0?arguments[1]:0;var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.length;var i=0;var o=0;for(var a=n;a1&&arguments[1]!==void 0?arguments[1]:0;var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.length;var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:true;var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:true;var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:true;if(i){t=t.slice(n,r)}else{if(r0){t.splice(0,n)}}var s=0;for(var l=t.length-1;l>=0;l--){var u=t[l];if(a){if(!isFinite(u)){t[l]=-Infinity;s++}}else{t.splice(l,1)}}if(o){t.sort(function(h,m){return h-m})}var d=t.length;var f=Math.floor(d/2);if(d%2!==0){return t[f+1+s]}else{return(t[f-1+s]+t[f+s])/2}};tCi=function e(t){return Math.PI*t/180};ACe=function e(t,n){return Math.atan2(n,t)-Math.PI/2};_et=Math.log2||function(e){return Math.log(e)/Math.log(2)};Tet=function e(t){if(t>0){return 1}else if(t<0){return-1}else{return 0}};xB=function e(t,n){return Math.sqrt(hB(t,n))};hB=function e(t,n){var r=n.x-t.x;var i=n.y-t.y;return r*r+i*i};nCi=function e(t){var n=t.length;var r=0;for(var i=0;i=t.x1&&t.y2>=t.y1){return{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,w:t.x2-t.x1,h:t.y2-t.y1}}else if(t.w!=null&&t.h!=null&&t.w>=0&&t.h>=0){return{x1:t.x1,y1:t.y1,x2:t.x1+t.w,y2:t.y1+t.h,w:t.w,h:t.h}}}};iCi=function e(t){return{x1:t.x1,x2:t.x2,w:t.w,y1:t.y1,y2:t.y2,h:t.h}};oCi=function e(t){t.x1=Infinity;t.y1=Infinity;t.x2=-Infinity;t.y2=-Infinity;t.w=0;t.h=0};aCi=function e(t,n){t.x1=Math.min(t.x1,n.x1);t.x2=Math.max(t.x2,n.x2);t.w=t.x2-t.x1;t.y1=Math.min(t.y1,n.y1);t.y2=Math.max(t.y2,n.y2);t.h=t.y2-t.y1};TTn=function e(t,n,r){t.x1=Math.min(t.x1,n);t.x2=Math.max(t.x2,n);t.w=t.x2-t.x1;t.y1=Math.min(t.y1,r);t.y2=Math.max(t.y2,r);t.h=t.y2-t.y1};zCe=function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;t.x1-=n;t.x2+=n;t.y1-=n;t.y2+=n;t.w=t.x2-t.x1;t.h=t.y2-t.y1;return t};UCe=function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0];var r,i,o,a;if(n.length===1){r=i=o=a=n[0]}else if(n.length===2){r=o=n[0];a=i=n[1]}else if(n.length===4){var s=np(n,4);r=s[0];i=s[1];o=s[2];a=s[3]}t.x1-=a;t.x2+=i;t.y1-=r;t.y2+=o;t.w=t.x2-t.x1;t.h=t.y2-t.y1;return t};K1n=function e(t,n){t.x1=n.x1;t.y1=n.y1;t.x2=n.x2;t.y2=n.y2;t.w=t.x2-t.x1;t.h=t.y2-t.y1};wet=function e(t,n){if(t.x1>n.x2){return false}if(n.x1>t.x2){return false}if(t.x2n.y2){return false}if(n.y1>t.y2){return false}return true};FL=function e(t,n,r){return t.x1<=n&&n<=t.x2&&t.y1<=r&&r<=t.y2};Z1n=function e(t,n){return FL(t,n.x,n.y)};wTn=function e(t,n){return FL(t,n.x1,n.y1)&&FL(t,n.x2,n.y2)};sCi=(DJe=Math.hypot)!==null&&DJe!==void 0?DJe:function(e,t){return Math.sqrt(e*e+t*t)};ETn=function e(t,n,r,i,o,a,s){var l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto";var u=l==="auto"?VL(o,a):l;var d=o/2;var f=a/2;u=Math.min(u,d,f);var h=u!==d,m=u!==f;var g;if(h){var x=r-d+u-s;var w=i-f-s;var _=r+d-u+s;var C=w;g=NL(t,n,r,i,x,w,_,C,false);if(g.length>0){return g}}if(m){var A=r+d+s;var P=i-f+u-s;var L=A;var I=i+f-u+s;g=NL(t,n,r,i,A,P,L,I,false);if(g.length>0){return g}}if(h){var N=r-d+u-s;var O=i+f+s;var z=r+d-u+s;var U=O;g=NL(t,n,r,i,N,O,z,U,false);if(g.length>0){return g}}if(m){var W=r-d-s;var H=i-f+u-s;var $=W;var K=i+f-u+s;g=NL(t,n,r,i,W,H,$,K,false);if(g.length>0){return g}}var X;{var j=r-d+u;var te=i-f+u;X=ite(t,n,r,i,j,te,u+s);if(X.length>0&&X[0]<=j&&X[1]<=te){return[X[0],X[1]]}}{var J=r+d-u;var oe=i-f+u;X=ite(t,n,r,i,J,oe,u+s);if(X.length>0&&X[0]>=J&&X[1]<=oe){return[X[0],X[1]]}}{var se=r+d-u;var re=i+f-u;X=ite(t,n,r,i,se,re,u+s);if(X.length>0&&X[0]>=se&&X[1]>=re){return[X[0],X[1]]}}{var ce=r-d+u;var ue=i+f-u;X=ite(t,n,r,i,ce,ue,u+s);if(X.length>0&&X[0]<=ce&&X[1]>=ue){return[X[0],X[1]]}}return[]};uCi=function e(t,n,r,i,o,a,s){var l=s;var u=Math.min(r,o);var d=Math.max(r,o);var f=Math.min(i,a);var h=Math.max(i,a);return u-l<=t&&t<=d+l&&f-l<=n&&n<=h+l};dCi=function e(t,n,r,i,o,a,s,l,u){var d={x1:Math.min(r,s,o)-u,x2:Math.max(r,s,o)+u,y1:Math.min(i,l,a)-u,y2:Math.max(i,l,a)+u};if(td.x2||nd.y2){return false}else{return true}};fCi=function e(t,n,r,i){r-=i;var o=n*n-4*t*r;if(o<0){return[]}var a=Math.sqrt(o);var s=2*t;var l=(-n+a)/s;var u=(-n-a)/s;return[l,u]};hCi=function e(t,n,r,i,o){var a=1e-5;if(t===0){t=a}n/=t;r/=t;i/=t;var s,l,u,d,f,h,m,g;l=(3*r-n*n)/9;u=-(27*i)+n*(9*r-2*(n*n));u/=54;s=l*l*l+u*u;o[1]=0;m=n/3;if(s>0){f=u+Math.sqrt(s);f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3);h=u-Math.sqrt(s);h=h<0?-Math.pow(-h,1/3):Math.pow(h,1/3);o[0]=-m+f+h;m+=(f+h)/2;o[4]=o[2]=-m;m=Math.sqrt(3)*(-h+f)/2;o[3]=m;o[5]=-m;return}o[5]=o[3]=0;if(s===0){g=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);o[0]=-m+2*g;o[4]=o[2]=-(g+m);return}l=-l;d=l*l*l;d=Math.acos(u/Math.sqrt(d));g=2*Math.sqrt(l);o[0]=-m+g*Math.cos(d/3);o[2]=-m+g*Math.cos((d+2*Math.PI)/3);o[4]=-m+g*Math.cos((d+4*Math.PI)/3);return};pCi=function e(t,n,r,i,o,a,s,l){var u=1*r*r-4*r*o+2*r*s+4*o*o-4*o*s+s*s+i*i-4*i*a+2*i*l+4*a*a-4*a*l+l*l;var d=1*9*r*o-3*r*r-3*r*s-6*o*o+3*o*s+9*i*a-3*i*i-3*i*l-6*a*a+3*a*l;var f=1*3*r*r-6*r*o+r*s-r*t+2*o*o+2*o*t-s*t+3*i*i-6*i*a+i*l-i*n+2*a*a+2*a*n-l*n;var h=1*r*o-r*r+r*t-o*t+i*a-i*i+i*n-a*n;var m=[];hCi(u,d,f,h,m);var g=1e-7;var x=[];for(var w=0;w<6;w+=2){if(Math.abs(m[w+1])=0&&m[w]<=1){x.push(m[w])}}x.push(1);x.push(0);var _=-1;var C,A,P;for(var L=0;L=0){if(P<_){_=P}}else{_=P}}return _};mCi=function e(t,n,r,i,o,a){var s=[t-r,n-i];var l=[o-r,a-i];var u=l[0]*l[0]+l[1]*l[1];var d=s[0]*s[0]+s[1]*s[1];var f=s[0]*l[0]+s[1]*l[1];var h=f*f/u;if(f<0){return d}if(h>u){return(t-o)*(t-o)+(n-a)*(n-a)}return d-h};vx=function e(t,n,r){var i,o,a,s;var l;var u=0;for(var d=0;d=t&&t>=a||i<=t&&t<=a){l=(t-i)/(a-i)*(s-o)+o;if(l>n){u++}}else{continue}}if(u%2===0){return false}else{return true}};DR=function e(t,n,r,i,o,a,s,l,u){var d=new Array(r.length);var f;if(l[0]!=null){f=Math.atan(l[1]/l[0]);if(l[0]<0){f=f+Math.PI/2}else{f=-f-Math.PI/2}}else{f=l}var h=Math.cos(-f);var m=Math.sin(-f);for(var g=0;g0){var w=eSe(d,-u);x=QCe(w)}else{x=d}return vx(t,n,x)};gCi=function e(t,n,r,i,o,a,s,l){var u=new Array(r.length*2);for(var d=0;d=0&&w<=1){C.push(w)}if(_>=0&&_<=1){C.push(_)}if(C.length===0){return[]}var A=C[0]*l[0]+t;var P=C[0]*l[1]+n;if(C.length>1){if(C[0]==C[1]){return[A,P]}else{var L=C[1]*l[0]+t;var I=C[1]*l[1]+n;return[A,P,L,I]}}else{return[A,P]}};FJe=function e(t,n,r){if(n<=t&&t<=r||r<=t&&t<=n){return t}else if(t<=n&&n<=r||r<=n&&n<=t){return n}else{return r}};NL=function e(t,n,r,i,o,a,s,l,u){var d=t-o;var f=r-t;var h=s-o;var m=n-a;var g=i-n;var x=l-a;var w=h*m-x*d;var _=f*m-g*d;var C=x*f-h*g;if(C!==0){var A=w/C;var P=_/C;var L=.001;var I=0-L;var N=1+L;if(I<=A&&A<=N&&I<=P&&P<=N){return[t+A*f,n+A*g]}else{if(!u){return[]}else{return[t+A*f,n+A*g]}}}else{if(w===0||_===0){if(FJe(t,r,s)===s){return[s,l]}if(FJe(t,r,o)===o){return[o,a]}if(FJe(o,s,r)===r){return[r,i]}return[]}else{return[]}}};bCi=function e(t,n,r,i,o){var a=[];var s=i/2;var l=o/2;var u=n;var d=r;a.push({x:u+s*t[0],y:d+l*t[1]});for(var f=1;f0){var x=eSe(f,-l);m=QCe(x)}else{m=f}}else{m=r}var w,_,C,A;for(var P=0;P2){var g=[d[0],d[1]];var x=Math.pow(g[0]-t,2)+Math.pow(g[1]-n,2);for(var w=1;wd){d=P}},get:function C(A){return u[A]}};for(var h=0;h0){X=K.edgesTo($)[0]}else{X=$.edgesTo(K)[0]}var j=i(X);$=$.id();if(N[$]>N[W]+j){N[$]=N[W]+j;if(O.nodes.indexOf($)<0){O.push($)}else{O.updateItem($)}I[$]=0;L[$]=[]}if(N[$]==N[W]+j){I[$]=I[$]+I[W];L[$].push(W)}}}else{for(var te=0;te0){var re=P.pop();for(var ce=0;ce0){s.push(r[l])}}if(s.length!==0){o.push(i.collection(s))}}return o};LCi=function e(t,n){for(var r=0;r5&&arguments[5]!==void 0?arguments[5]:NCi;var s=i;var l,u;for(var d=0;d=2){return Zee(t,n,r,0,nvn,OCi)}else{return Zee(t,n,r,0,tvn)}},squaredEuclidean:function e(t,n,r){return Zee(t,n,r,0,nvn)},manhattan:function e(t,n,r){return Zee(t,n,r,0,tvn)},max:function e(t,n,r){return Zee(t,n,r,-Infinity,BCi)}};eG["squared-euclidean"]=eG["squaredEuclidean"];eG["squaredeuclidean"]=eG["squaredEuclidean"];zCi=Ig({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:false,testCentroids:null});Cet=function e(t){return zCi(t)};tSe=function e(t,n,r,i,o){var a=o!=="kMedoids";var s=a?function(f){return r[f]}:function(f){return i[f](r)};var l=function f(h){return i[h](n)};var u=r;var d=n;return hSe(t,i.length,s,l,u,d)};OJe=function e(t,n,r){var i=r.length;var o=new Array(i);var a=new Array(i);var s=new Array(n);var l=null;for(var u=0;ur){return false}}}return true};$Ci=function e(t,n,r){for(var i=0;is){s=n[u][d];l=d}}o[l].push(t[u])}for(var f=0;f=o.threshold||o.mode==="dendrogram"&&t.length===1){return false}var g=n[a];var x=n[i[a]];var w;if(o.mode==="dendrogram"){w={left:g,right:x,key:g.key}}else{w={value:g.value.concat(x.value),key:g.key}}t[g.index]=w;t.splice(x.index,1);n[g.key]=w;for(var _=0;_r[x.key][C.key]){l=r[x.key][C.key]}}else if(o.linkage==="max"){l=r[g.key][C.key];if(r[g.key][C.key]0){i.push(o)}}return i};lvn=function e(t,n,r){var i=[];for(var o=0;os){a=u;s=n[o*t+u]}}if(a>0){i.push(a)}}for(var d=0;du){l=d;u=f}}r[o]=a[l]}i=lvn(t,n,r);return i};cvn=function e(t){var n=this.cy();var r=this.nodes();var i=eSi(t);var o={};for(var a=0;a=W){H=W;W=K;$=X}else if(K>H){H=K}}for(var j=0;j0?1:0;N[z%i.minIterations*s+ce]=ue;re+=ue}if(re>0&&(z>=i.minIterations-1||z==i.maxIterations-1)){var xe=0;for(var be=0;be1||I>1){s=true}f[A]=[];C.outgoers().forEach(function(O){if(O.isEdge())f[A].push(O.id())})}else{h[A]=[void 0,C.target().id()]}})}else{a.forEach(function(C){var A=C.id();if(C.isNode()){var P=C.degree(true);if(P%2){if(!l)l=A;else if(!u)u=A;else s=true}f[A]=[];C.connectedEdges().forEach(function(L){return f[A].push(L.id())})}else{h[A]=[C.source().id(),C.target().id()]}})}var m={found:false,trail:void 0};if(s)return m;else if(u&&l){if(o){if(d&&u!=d){return m}d=u}else{if(d&&u!=d&&l!=d){return m}else if(!d){d=u}}}else{if(!d)d=a[0].id()}var g=function C(A){var P=A;var L=[A];var I,N,O;while(f[P].length){I=f[P].shift();N=h[I][0];O=h[I][1];if(P!=O){f[O]=f[O].filter(function(z){return z!=I});P=O}else if(!o&&P!=N){f[N]=f[N].filter(function(z){return z!=I});P=N}L.unshift(I);L.unshift(P)}return L};var x=[];var w=[];w=g(d);while(w.length!=1){if(f[w[0]].length==0){x.unshift(a.getElementById(w.shift()));x.unshift(a.getElementById(w.shift()))}else{w=g(w.shift()).concat(w)}}x.unshift(a.getElementById(w.shift()));for(var _ in f){if(f[_].length){return m}}m.found=true;m.trail=this.spawn(x,true);return m}};RCe=function e(){var t=this;var n={};var r=0;var i=0;var o=[];var a=[];var s={};var l=function f(h,m){var g=a.length-1;var x=[];var w=t.spawn();while(a[g].x!=h||a[g].y!=m){x.push(a.pop().edge);g--}x.push(a.pop().edge);x.forEach(function(_){var C=_.connectedNodes().intersection(t);w.merge(_);C.forEach(function(A){var P=A.id();var L=A.connectedEdges().intersection(t);w.merge(A);if(!n[P].cutVertex){w.merge(L)}else{w.merge(L.filter(function(I){return I.isLoop()}))}})});o.push(w)};var u=function f(h,m,g){if(h===g)i+=1;n[m]={id:r,low:r++,cutVertex:false};var x=t.getElementById(m).connectedEdges().intersection(t);if(x.size()===0){o.push(t.spawn(t.getElementById(m)))}else{var w,_,C,A;x.forEach(function(P){w=P.source().id();_=P.target().id();C=w===m?_:w;if(C!==g){A=P.id();if(!s[A]){s[A]=true;a.push({x:m,y:C,edge:P})}if(!(C in n)){u(h,C,m);n[m].low=Math.min(n[m].low,n[C].low);if(n[m].id<=n[C].low){n[m].cutVertex=true;l(m,C)}}else{n[m].low=Math.min(n[m].low,n[C].id)}}})}};t.forEach(function(f){if(f.isNode()){var h=f.id();if(!(h in n)){i=0;u(h,h);n[h].cutVertex=i>1}}});var d=Object.keys(n).filter(function(f){return n[f].cutVertex}).map(function(f){return t.getElementById(f)});return{cut:t.spawn(d),components:o}};lSi={hopcroftTarjanBiconnected:RCe,htbc:RCe,htb:RCe,hopcroftTarjanBiconnectedComponents:RCe};PCe=function e(){var t=this;var n={};var r=0;var i=[];var o=[];var a=t.spawn(t);var s=function l(u){o.push(u);n[u]={index:r,low:r++,explored:false};var d=t.getElementById(u).connectedEdges().intersection(t);d.forEach(function(x){var w=x.target().id();if(w!==u){if(!(w in n)){s(w)}if(!n[w].explored){n[u].low=Math.min(n[u].low,n[w].low)}}});if(n[u].index===n[u].low){var f=t.spawn();for(;;){var h=o.pop();f.merge(t.getElementById(h));n[h].low=n[u].index;n[h].explored=true;if(h===u){break}}var m=f.edgesWith(f);var g=f.merge(m);i.push(g);a=a.difference(g)}};t.forEach(function(l){if(l.isNode()){var u=l.id();if(!(u in n)){s(u)}}});return{cut:a,components:i}};cSi={tarjanStronglyConnected:PCe,tsc:PCe,tscc:PCe,tarjanStronglyConnectedComponents:PCe};ITn={};[fte,zEi,UEi,$Ei,HEi,YEi,jEi,TCi,K$,Z$,KQe,FCi,XCi,JCi,oSi,sSi,lSi,cSi].forEach(function(e){Ua(ITn,e)});MTn=0;LTn=1;DTn=2;Dw=function e(t){if(!(this instanceof Dw))return new Dw(t);this.id="Thenable/1.0.7";this.state=MTn;this.fulfillValue=void 0;this.rejectReason=void 0;this.onFulfilled=[];this.onRejected=[];this.proxy={then:this.then.bind(this)};if(typeof t==="function")t.call(this,this.fulfill.bind(this),this.reject.bind(this))};Dw.prototype={fulfill:function e(t){return uvn(this,LTn,"fulfillValue",t)},reject:function e(t){return uvn(this,DTn,"rejectReason",t)},then:function e(t,n){var r=this;var i=new Dw;r.onFulfilled.push(fvn(t,i,"fulfill"));r.onRejected.push(fvn(n,i,"reject"));FTn(r);return i.proxy}};uvn=function e(t,n,r,i){if(t.state===MTn){t.state=n;t[r]=i;FTn(t)}return t};FTn=function e(t){if(t.state===LTn)dvn(t,"onFulfilled",t.fulfillValue);else if(t.state===DTn)dvn(t,"onRejected",t.rejectReason)};dvn=function e(t,n,r){if(t[n].length===0)return;var i=t[n];t[n]=[];var o=function a(){for(var s=0;s0}}},clearQueue:function e(){return function t(){var n=this;var r=n.length!==void 0;var i=r?n:[n];var o=this._private.cy||this;if(!o.styleEnabled()){return this}for(var a=0;a0){this.spawn(i).updateStyle().emit("class")}return n},addClass:function e(t){return this.toggleClass(t,true)},hasClass:function e(t){var n=this[0];return n!=null&&n._private.classes.has(t)},toggleClass:function e(t,n){if(!Yu(t)){t=t.match(/\S+/g)||[]}var r=this;var i=n===void 0;var o=[];for(var a=0,s=r.length;a0){this.spawn(o).updateStyle().emit("class")}return r},removeClass:function e(t){return this.toggleClass(t,false)},flashClass:function e(t,n){var r=this;if(n==null){n=250}else if(n===0){return r}r.addClass(t);setTimeout(function(){r.removeClass(t)},n);return r}};VCe.className=VCe.classNames=VCe.classes;pc={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:Bp,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};pc.variable="(?:[\\w-.]|(?:\\\\"+pc.metaChar+"))+";pc.className="(?:[\\w-]|(?:\\\\"+pc.metaChar+"))+";pc.value=pc.string+"|"+pc.number;pc.id=pc.variable;(function(){var e,t,n;e=pc.comparatorOp.split("|");for(n=0;n=0){continue}if(t==="="){continue}pc.comparatorOp+="|\\!"+t}})();ku=function e(){return{checks:[]}};qo={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20};eet=[{selector:":selected",matches:function e(t){return t.selected()}},{selector:":unselected",matches:function e(t){return!t.selected()}},{selector:":selectable",matches:function e(t){return t.selectable()}},{selector:":unselectable",matches:function e(t){return!t.selectable()}},{selector:":locked",matches:function e(t){return t.locked()}},{selector:":unlocked",matches:function e(t){return!t.locked()}},{selector:":visible",matches:function e(t){return t.visible()}},{selector:":hidden",matches:function e(t){return!t.visible()}},{selector:":transparent",matches:function e(t){return t.transparent()}},{selector:":grabbed",matches:function e(t){return t.grabbed()}},{selector:":free",matches:function e(t){return!t.grabbed()}},{selector:":removed",matches:function e(t){return t.removed()}},{selector:":inside",matches:function e(t){return!t.removed()}},{selector:":grabbable",matches:function e(t){return t.grabbable()}},{selector:":ungrabbable",matches:function e(t){return!t.grabbable()}},{selector:":animated",matches:function e(t){return t.animated()}},{selector:":unanimated",matches:function e(t){return!t.animated()}},{selector:":parent",matches:function e(t){return t.isParent()}},{selector:":childless",matches:function e(t){return t.isChildless()}},{selector:":child",matches:function e(t){return t.isChild()}},{selector:":orphan",matches:function e(t){return t.isOrphan()}},{selector:":nonorphan",matches:function e(t){return t.isChild()}},{selector:":compound",matches:function e(t){if(t.isNode()){return t.isParent()}else{return t.source().isParent()||t.target().isParent()}}},{selector:":loop",matches:function e(t){return t.isLoop()}},{selector:":simple",matches:function e(t){return t.isSimple()}},{selector:":active",matches:function e(t){return t.active()}},{selector:":inactive",matches:function e(t){return!t.active()}},{selector:":backgrounding",matches:function e(t){return t.backgrounding()}},{selector:":nonbackgrounding",matches:function e(t){return!t.backgrounding()}}].sort(function(e,t){return rEi(e.selector,t.selector)});aAi=function(){var e={};var t;for(var n=0;n0&&d.edgeCount>0){nu("The selector `"+t+"` is invalid because it uses both a compound selector and an edge selector");return false}if(d.edgeCount>1){nu("The selector `"+t+"` is invalid because it uses multiple edge selectors");return false}else if(d.edgeCount===1){nu("The selector `"+t+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}}return true};fAi=function e(){if(this.toStringCache!=null){return this.toStringCache}var t=function u(d){if(d==null){return""}else{return d}};var n=function u(d){if(ma(d)){return'"'+d+'"'}else{return t(d)}};var r=function u(d){return" "+d+" "};var i=function u(d,f){var h=d.type,m=d.value;switch(h){case qo.GROUP:{var g=t(m);return g.substring(0,g.length-1)}case qo.DATA_COMPARE:{var x=d.field,w=d.operator;return"["+x+r(t(w))+n(m)+"]"}case qo.DATA_BOOL:{var _=d.operator,C=d.field;return"["+t(_)+C+"]"}case qo.DATA_EXIST:{var A=d.field;return"["+A+"]"}case qo.META_COMPARE:{var P=d.operator,L=d.field;return"[["+L+r(t(P))+n(m)+"]]"}case qo.STATE:{return m}case qo.ID:{return"#"+m}case qo.CLASS:{return"."+m}case qo.PARENT:case qo.CHILD:{return o(d.parent,f)+r(">")+o(d.child,f)}case qo.ANCESTOR:case qo.DESCENDANT:{return o(d.ancestor,f)+" "+o(d.descendant,f)}case qo.COMPOUND_SPLIT:{var I=o(d.left,f);var N=o(d.subject,f);var O=o(d.right,f);return I+(I.length>0?" ":"")+N+O}case qo.TRUE:{return""}}};var o=function u(d,f){return d.checks.reduce(function(h,m,g){return h+(f===d&&g===0?"$":"")+i(m,f)},"")};var a="";for(var s=0;s1&&s=0){n=n.replace("!","");f=true}if(n.indexOf("@")>=0){n=n.replace("@","");d=true}if(o||s||d){l=!o&&!a?"":""+t;u=""+r}if(d){t=l=l.toLowerCase();r=u=u.toLowerCase()}switch(n){case"*=":i=l.indexOf(u)>=0;break;case"$=":i=l.indexOf(u,l.length-u.length)>=0;break;case"^=":i=l.indexOf(u)===0;break;case"=":i=t===r;break;case">":h=true;i=t>r;break;case">=":h=true;i=t>=r;break;case"<":h=true;i=t1&&arguments[1]!==void 0?arguments[1]:true;return Pet(this,e,t,GTn)};tG.forEachUp=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:true;return Pet(this,e,t,HTn)};tG.forEachUpAndDown=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:true;return Pet(this,e,t,vAi)};tG.ancestors=tG.parents;mte=WTn={data:tu.data({field:"data",bindingEvent:"data",allowBinding:true,allowSetting:true,settingEvent:"data",settingTriggersEvent:true,triggerFnName:"trigger",allowGetting:true,immutableKeys:{"id":true,"source":true,"target":true,"parent":true},updateStyle:true}),removeData:tu.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:true,immutableKeys:{"id":true,"source":true,"target":true,"parent":true},updateStyle:true}),scratch:tu.data({field:"scratch",bindingEvent:"scratch",allowBinding:true,allowSetting:true,settingEvent:"scratch",settingTriggersEvent:true,triggerFnName:"trigger",allowGetting:true,updateStyle:true}),removeScratch:tu.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:true,updateStyle:true}),rscratch:tu.data({field:"rscratch",allowBinding:false,allowSetting:true,settingTriggersEvent:false,allowGetting:true}),removeRscratch:tu.removeData({field:"rscratch",triggerEvent:false}),id:function e(){var t=this[0];if(t){return t._private.data.id}}};mte.attr=mte.data;mte.removeAttr=mte.removeData;_Ai=WTn;bSe={};Ua(bSe,{degree:FQe(function(e,t){if(t.source().same(t.target())){return 2}else{return 1}}),indegree:FQe(function(e,t){if(t.target().same(e)){return 1}else{return 0}}),outdegree:FQe(function(e,t){if(t.source().same(e)){return 1}else{return 0}})});Ua(bSe,{minDegree:z$("degree",function(e,t){return et}),minIndegree:z$("indegree",function(e,t){return et}),minOutdegree:z$("outdegree",function(e,t){return et})});Ua(bSe,{totalDegree:function e(t){var n=0;var r=this.nodes();for(var i=0;i0;var h=f;if(f){d=d[0]}var m=h?d.position():{x:0,y:0};if(n!==void 0){u.position(t,n+m[t])}else if(o!==void 0){u.position({x:o.x+m.x,y:o.y+m.y})}}}else{var g=r.position();var x=s?r.parent():null;var w=x&&x.length>0;var _=w;if(w){x=x[0]}var C=_?x.position():{x:0,y:0};o={x:g.x-C.x,y:g.y-C.y};if(t===void 0){return o}else{return o[t]}}}else if(!a){return void 0}return this}};Lw.modelPosition=Lw.point=Lw.position;Lw.modelPositions=Lw.points=Lw.positions;Lw.renderedPoint=Lw.renderedPosition;Lw.relativePoint=Lw.relativePosition;TAi=YTn;nG=function e(t){switch(t){case"left":case"right-inside":return"left";case"right":case"left-inside":return"right";default:return"center"}};rG=function e(t){switch(t){case"top":case"bottom-inside":return"top";case"bottom":case"top-inside":return"bottom";default:return"center"}};wAi=function e(t){switch(t){case"left":return"right";case"right":return"left";case"left-inside":return"left";case"right-inside":return"right";default:return"center"}};J$=qL={};qL.renderedBoundingBox=function(e){var t=this.boundingBox(e);var n=this.cy();var r=n.zoom();var i=n.pan();var o=t.x1*r+i.x;var a=t.x2*r+i.x;var s=t.y1*r+i.y;var l=t.y2*r+i.y;return{x1:o,x2:a,y1:s,y2:l,w:a-o,h:l-s}};qL.dirtyCompoundBoundsCache=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:false;var t=this.cy();if(!t.styleEnabled()||!t.hasCompoundNodes()){return this}this.forEachUp(function(n){if(n.isParent()){var r=n._private;r.compoundBoundsClean=false;r.bbCache=null;if(!e){n.emitAndNotify("bounds")}}});return this};qL.updateCompoundBounds=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:false;var t=this.cy();if(!t.styleEnabled()||!t.hasCompoundNodes()){return this}if(!e&&t.batching()){return this}function n(a){if(!a.isParent()){return}var s=a._private;var l=a.children();var u=a.pstyle("compound-sizing-wrt-labels").value==="include";var d={width:{val:a.pstyle("min-width").pfValue,left:a.pstyle("min-width-bias-left"),right:a.pstyle("min-width-bias-right")},height:{val:a.pstyle("min-height").pfValue,top:a.pstyle("min-height-bias-top"),bottom:a.pstyle("min-height-bias-bottom")}};var f=l.boundingBox({includeLabels:u,includeOverlays:false,useCache:false});var h=s.position;if(f.w===0||f.h===0){f={w:a.pstyle("width").pfValue,h:a.pstyle("height").pfValue};f.x1=h.x-f.w/2;f.x2=h.x+f.w/2;f.y1=h.y-f.h/2;f.y2=h.y+f.h/2}function m(z,U,W){var H=0;var $=0;var K=U+W;if(z>0&&K>0){H=U/K*z;$=W/K*z}return{biasDiff:H,biasComplementDiff:$}}function g(z,U,W,H){if(W.units==="%"){switch(H){case"width":return z>0?W.pfValue*z:0;case"height":return U>0?W.pfValue*U:0;case"average":return z>0&&U>0?W.pfValue*(z+U)/2:0;case"min":return z>0&&U>0?z>U?W.pfValue*U:W.pfValue*z:0;case"max":return z>0&&U>0?z>U?W.pfValue*z:W.pfValue*U:0;default:return 0}}else if(W.units==="px"){return W.pfValue}else{return 0}}var x=d.width.left.value;if(d.width.left.units==="px"&&d.width.val>0){x=x*100/d.width.val}var w=d.width.right.value;if(d.width.right.units==="px"&&d.width.val>0){w=w*100/d.width.val}var _=d.height.top.value;if(d.height.top.units==="px"&&d.height.val>0){_=_*100/d.height.val}var C=d.height.bottom.value;if(d.height.bottom.units==="px"&&d.height.val>0){C=C*100/d.height.val}var A=m(d.width.val-f.w,x,w);var P=A.biasDiff;var L=A.biasComplementDiff;var I=m(d.height.val-f.h,_,C);var N=I.biasDiff;var O=I.biasComplementDiff;s.autoPadding=g(f.w,f.h,a.pstyle("padding"),a.pstyle("padding-relative-to").value);s.autoWidth=Math.max(f.w,d.width.val);h.x=(-P+f.x1+f.x2+L)/2;s.autoHeight=Math.max(f.h,d.height.val);h.y=(-N+f.y1+f.y2+O)/2}for(var r=0;rt.x2?i:t.x2;t.y1=rt.y2?o:t.y2;t.w=t.x2-t.x1;t.h=t.y2-t.y1};LL=function e(t,n){if(n==null){return t}return Mw(t,n.x1,n.y1,n.x2,n.y2)};Jee=function e(t,n,r){return Q0(t,n,r)};ICe=function e(t,n,r){if(n.cy().headless()){return}var i=n._private;var o=i.rstyle;var a=o.arrowWidth/2;var s=n.pstyle(r+"-arrow-shape").value;var l;var u;if(s!=="none"){if(r==="source"){l=o.srcX;u=o.srcY}else if(r==="target"){l=o.tgtX;u=o.tgtY}else{l=o.midX;u=o.midY}var d=i.arrowBounds=i.arrowBounds||{};var f=d[r]=d[r]||{};f.x1=l-a;f.y1=u-a;f.x2=l+a;f.y2=u+a;f.w=f.x2-f.x1;f.h=f.y2-f.y1;zCe(f,1);Mw(t,f.x1,f.y1,f.x2,f.y2)}};NQe=function e(t,n,r){if(n.cy().headless()){return}var i;if(r){i=r+"-"}else{i=""}var o=n._private;var a=o.rstyle;var s=n.pstyle(i+"label").strValue;if(s){var l=n.pstyle("text-halign");var u=n.pstyle("text-valign");var d=Jee(a,"labelWidth",r);var f=Jee(a,"labelHeight",r);var h=Jee(a,"labelX",r);var m=Jee(a,"labelY",r);var g=n.pstyle(i+"text-margin-x").pfValue;var x=n.pstyle(i+"text-margin-y").pfValue;var w=n.isEdge();var _=n.pstyle(i+"text-rotation");var C=n.pstyle("text-outline-width").pfValue;var A=n.pstyle("text-border-width").pfValue;var P=A/2;var L=n.pstyle("text-background-padding").pfValue;var I=2;var N=f;var O=d;var z=O/2;var U=N/2;var W,H,$,K;if(w){W=h-z;H=h+z;$=m-U;K=m+U}else{switch(nG(l.value)){case"left":W=h-O;H=h;break;case"center":W=h-z;H=h+z;break;case"right":W=h;H=h+O;break}switch(rG(u.value)){case"top":$=m-N;K=m;break;case"center":$=m-U;K=m+U;break;case"bottom":$=m;K=m+N;break}}var X=g-Math.max(C,P)-L-I;var j=g+Math.max(C,P)+L+I;var te=x-Math.max(C,P)-L-I;var J=x+Math.max(C,P)+L+I;W+=X;H+=j;$+=te;K+=J;var oe=r||"main";var se=o.labelBounds;var re=se[oe]=se[oe]||{};re.x1=W;re.y1=$;re.x2=H;re.y2=K;re.w=H-W;re.h=K-$;re.leftPad=X;re.rightPad=j;re.topPad=te;re.botPad=J;var ce=w&&_.strValue==="autorotate";var ue=_.pfValue!=null&&_.pfValue!==0;if(ce||ue){var xe=ce?Jee(o.rstyle,"labelAngle",r):_.pfValue;var be=Math.cos(xe);var Ie=Math.sin(xe);var he=(W+H)/2;var ve=($+K)/2;if(!w){switch(nG(l.value)){case"left":he=H;break;case"right":he=W;break}switch(rG(u.value)){case"top":ve=K;break;case"bottom":ve=$;break}}var ge=function mt(ct,Ge){ct=ct-he;Ge=Ge-ve;return{x:ct*be-Ge*Ie+he,y:ct*Ie+Ge*be+ve}};var Ve=ge(W,$);var Le=ge(W,K);var $e=ge(H,$);var Ee=ge(H,K);W=Math.min(Ve.x,Le.x,$e.x,Ee.x);H=Math.max(Ve.x,Le.x,$e.x,Ee.x);$=Math.min(Ve.y,Le.y,$e.y,Ee.y);K=Math.max(Ve.y,Le.y,$e.y,Ee.y)}var tt=oe+"Rot";var yt=se[tt]=se[tt]||{};yt.x1=W;yt.y1=$;yt.x2=H;yt.y2=K;yt.w=H-W;yt.h=K-$;Mw(t,W,$,H,K);Mw(o.labelBounds.all,W,$,H,K)}return t};d_n=function e(t,n){if(n.cy().headless()){return}var r=n.pstyle("outline-opacity").value;var i=n.pstyle("outline-width").value;var o=n.pstyle("outline-offset").value;var a=i+o;XTn(t,n,r,a,"outside",a/2)};XTn=function e(t,n,r,i,o,a){if(r===0||i<=0||o==="inside"){return}var s=n.cy();var l=s.renderer();var u=l.nodeShapes[l.getNodeShape(n)];if(!u){return}var d=n.position(),f=d.x,h=d.y;var m=n.width();var g=n.height();if(u.hasMiterBounds){if(o==="center"){i/=2}var x=u.miterBounds(f,h,m,g,i);LL(t,x)}else if(a!=null&&a>0){UCe(t,[a,a,a,a])}};EAi=function e(t,n){if(n.cy().headless()){return}var r=n.pstyle("border-opacity").value;var i=n.pstyle("border-width").pfValue;var o=n.pstyle("border-position").value;XTn(t,n,r,i,o)};CAi=function e(t,n){var r=t._private.cy;var i=r.styleEnabled();var o=r.headless();var a=eb();var s=t._private;var l=t.isNode();var u=t.isEdge();var d,f,h,m;var g,x;var w=s.rstyle;var _=l&&i?t.pstyle("bounds-expansion").pfValue:[0];var C=function yt(mt){return mt.pstyle("display").value!=="none"};var A=!i||C(t)&&(!u||C(t.source())&&C(t.target()));if(A){var P=0;var L=0;if(i&&n.includeOverlays){P=t.pstyle("overlay-opacity").value;if(P!==0){L=t.pstyle("overlay-padding").value}}var I=0;var N=0;if(i&&n.includeUnderlays){I=t.pstyle("underlay-opacity").value;if(I!==0){N=t.pstyle("underlay-padding").value}}var O=Math.max(L,N);var z=0;var U=0;if(i){z=t.pstyle("width").pfValue;U=z/2}if(l&&n.includeNodes){var W=t.position();g=W.x;x=W.y;var H=t.outerWidth();var $=H/2;var K=t.outerHeight();var X=K/2;d=g-$;f=g+$;h=x-X;m=x+X;Mw(a,d,h,f,m);if(i){d_n(a,t)}if(i&&n.includeOutlines&&!o){d_n(a,t)}if(i){EAi(a,t)}}else if(u&&n.includeEdges){if(i&&!o){var j=t.pstyle("curve-style").strValue;d=Math.min(w.srcX,w.midX,w.tgtX);f=Math.max(w.srcX,w.midX,w.tgtX);h=Math.min(w.srcY,w.midY,w.tgtY);m=Math.max(w.srcY,w.midY,w.tgtY);d-=U;f+=U;h-=U;m+=U;Mw(a,d,h,f,m);if(j==="haystack"){var te=w.haystackPts;if(te&&te.length===2){d=te[0].x;h=te[0].y;f=te[1].x;m=te[1].y;if(d>f){var J=d;d=f;f=J}if(h>m){var oe=h;h=m;m=oe}Mw(a,d-U,h-U,f+U,m+U)}}else if(j==="bezier"||j==="unbundled-bezier"||DL(j,"segments")||DL(j,"taxi")){var se;switch(j){case"bezier":case"unbundled-bezier":se=w.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":se=w.linePts;break}if(se!=null){for(var re=0;ref){var he=d;d=f;f=he}if(h>m){var ve=h;h=m;m=ve}d-=U;f+=U;h-=U;m+=U;Mw(a,d,h,f,m)}}if(i&&n.includeEdges&&u){ICe(a,t,"mid-source");ICe(a,t,"mid-target");ICe(a,t,"source");ICe(a,t,"target")}if(i){var ge=t.pstyle("ghost").value==="yes";if(ge){var Ve=t.pstyle("ghost-offset-x").pfValue;var Le=t.pstyle("ghost-offset-y").pfValue;Mw(a,a.x1+Ve,a.y1+Le,a.x2+Ve,a.y2+Le)}}var $e=s.bodyBounds=s.bodyBounds||{};K1n($e,a);UCe($e,_);zCe($e,1);if(i){d=a.x1;f=a.x2;h=a.y1;m=a.y2;Mw(a,d-O,h-O,f+O,m+O)}var Ee=s.overlayBounds=s.overlayBounds||{};K1n(Ee,a);UCe(Ee,_);zCe(Ee,1);var tt=s.labelBounds=s.labelBounds||{};if(tt.all!=null){oCi(tt.all)}else{tt.all=eb()}if(i&&n.includeLabels){if(n.includeMainLabels){NQe(a,t,null)}if(u){if(n.includeSourceLabels){NQe(a,t,"source")}if(n.includeTargetLabels){NQe(a,t,"target")}}}}a.x1=F_(a.x1);a.y1=F_(a.y1);a.x2=F_(a.x2);a.y2=F_(a.y2);a.w=F_(a.x2-a.x1);a.h=F_(a.y2-a.y1);if(a.w>0&&a.h>0&&A){UCe(a,_);zCe(a,1)}return a};jTn=function e(t){var n=0;var r=function o(a){return(a?1:0)<=0;s--){a(s)}return this};HL.removeAllListeners=function(){return this.removeListener("*")};HL.emit=HL.trigger=function(e,t,n){var r=this.listeners;var i=r.length;this.emitting++;if(!Yu(t)){t=[t]}VAi(this,function(o,a){if(n!=null){r=[{event:a.event,type:a.type,namespace:a.namespace,callback:n}];i=r.length}var s=function u(){var d=r[l];if(d.type===a.type&&(!d.namespace||d.namespace===a.namespace||d.namespace===zAi)&&o.eventMatches(o.context,d,a)){var f=[a];if(t!=null){PEi(f,t)}o.beforeEmit(o.context,d,a);if(d.conf&&d.conf.one){o.listeners=o.listeners.filter(function(g){return g!==d})}var h=o.callbackContext(o.context,d,a);var m=d.callback.apply(h,f);o.afterEmit(o.context,d,a);if(m===false){a.stopPropagation();a.preventDefault()}}};for(var l=0;l1&&!a){var s=this.length-1;var l=this[s];var u=l._private.data.id;this[s]=void 0;this[t]=l;o.set(u,{ele:l,index:t})}this.length--;return this},unmergeOne:function e(t){t=t[0];var n=this._private;var r=t._private.data.id;var i=n.map;var o=i.get(r);if(!o){return this}var a=o.index;this.unmergeAt(a);return this},unmerge:function e(t){var n=this._private.cy;if(!t){return this}if(t&&ma(t)){var r=t;t=n.mutableElements().filter(r)}for(var i=0;i=0;n--){var r=this[n];if(t(r)){this.unmergeAt(n)}}return this},map:function e(t,n){var r=[];var i=this;for(var o=0;or){r=l;i=s}}return{value:r,ele:i}},min:function e(t,n){var r=Infinity;var i;var o=this;for(var a=0;a=0&&o1&&arguments[1]!==void 0?arguments[1]:true;var r=this[0];var i=r.cy();if(!i.styleEnabled()){return}if(r){if(r._private.styleDirty){r._private.styleDirty=false;i.style().apply(r)}var o=r._private.style[t];if(o!=null){return o}else if(n){return i.style().getDefaultProperty(t)}else{return null}}},numericStyle:function e(t){var n=this[0];if(!n.cy().styleEnabled()){return}if(n){var r=n.pstyle(t);return r.pfValue!==void 0?r.pfValue:r.value}},numericStyleUnits:function e(t){var n=this[0];if(!n.cy().styleEnabled()){return}if(n){return n.pstyle(t).units}},renderedStyle:function e(t){var n=this.cy();if(!n.styleEnabled()){return this}var r=this[0];if(r){return n.style().getRenderedStyle(r,t)}},style:function e(t,n){var r=this.cy();if(!r.styleEnabled()){return this}var i=false;var o=r.style();if(mc(t)){var a=t;o.applyBypass(this,a,i);this.emitAndNotify("style")}else if(ma(t)){if(n===void 0){var s=this[0];if(s){return o.getStylePropertyValue(s,t)}else{return}}else{o.applyBypass(this,t,n,i);this.emitAndNotify("style")}}else if(t===void 0){var l=this[0];if(l){return o.getRawStyle(l)}else{return}}return this},removeStyle:function e(t){var n=this.cy();if(!n.styleEnabled()){return this}var r=false;var i=n.style();var o=this;if(t===void 0){for(var a=0;a0){t.push(d[0])}t.push(s[0])}}return this.spawn(t,true).filter(e)},"neighborhood"),closedNeighborhood:function e(t){return this.neighborhood().add(this).filter(t)},openNeighborhood:function e(t){return this.neighborhood(t)}});Wy.neighbourhood=Wy.neighborhood;Wy.closedNeighbourhood=Wy.closedNeighborhood;Wy.openNeighbourhood=Wy.openNeighborhood;Ua(Wy,{source:N_(function e(t){var n=this[0];var r;if(n){r=n._private.source||n.cy().collection()}return r&&t?r.filter(t):r},"source"),target:N_(function e(t){var n=this[0];var r;if(n){r=n._private.target||n.cy().collection()}return r&&t?r.filter(t):r},"target"),sources:T_n({attr:"source"}),targets:T_n({attr:"target"})});Ua(Wy,{edgesWith:N_(w_n(),"edgesWith"),edgesTo:N_(w_n({thisIsSrc:true}),"edgesTo")});Ua(Wy,{connectedEdges:N_(function(e){var t=[];var n=this;for(var r=0;r0);return a},component:function e(){var t=this[0];return t.cy().mutableElements().components(t)[0]}});Wy.componentsOf=Wy.components;Pg=function e(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:false;var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:false;if(t===void 0){sf("A collection must have a reference to the core");return}var o=new MR;var a=false;if(!n){n=[]}else if(n.length>0&&mc(n[0])&&!_te(n[0])){a=true;var s=[];var l=new iG;for(var u=0,d=n.length;u0&&arguments[0]!==void 0?arguments[0]:true;var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:true;var n=this;var r=n.cy();var i=r._private;var o=[];var a=[];var s;for(var l=0,u=n.length;l0){var oe=s.length===n.length?n:new Pg(r,s);for(var se=0;se0&&arguments[0]!==void 0?arguments[0]:true;var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:true;var n=this;var r=[];var i={};var o=n._private.cy;function a(K){var X=K._private.edges;for(var j=0;j0){if(e){W.emitAndNotify("remove")}else if(t){W.emit("remove")}}for(var H=0;Hd&&Math.abs(g.v)>d)){break}}return!h?u:function(x){return l[x*(l.length-1)|0]}}}();ad=function e(t,n,r,i){var o=ZAi(t,n,r,i);return function(a,s,l){return a+(s-a)*o(l)}};GCe={"linear":function e(t,n,r){return t+(n-t)*r},"ease":ad(.25,.1,.25,1),"ease-in":ad(.42,0,1,1),"ease-out":ad(0,0,.58,1),"ease-in-out":ad(.42,0,.58,1),"ease-in-sine":ad(.47,0,.745,.715),"ease-out-sine":ad(.39,.575,.565,1),"ease-in-out-sine":ad(.445,.05,.55,.95),"ease-in-quad":ad(.55,.085,.68,.53),"ease-out-quad":ad(.25,.46,.45,.94),"ease-in-out-quad":ad(.455,.03,.515,.955),"ease-in-cubic":ad(.55,.055,.675,.19),"ease-out-cubic":ad(.215,.61,.355,1),"ease-in-out-cubic":ad(.645,.045,.355,1),"ease-in-quart":ad(.895,.03,.685,.22),"ease-out-quart":ad(.165,.84,.44,1),"ease-in-out-quart":ad(.77,0,.175,1),"ease-in-quint":ad(.755,.05,.855,.06),"ease-out-quint":ad(.23,1,.32,1),"ease-in-out-quint":ad(.86,0,.07,1),"ease-in-expo":ad(.95,.05,.795,.035),"ease-out-expo":ad(.19,1,.22,1),"ease-in-out-expo":ad(1,0,0,1),"ease-in-circ":ad(.6,.04,.98,.335),"ease-out-circ":ad(.075,.82,.165,1),"ease-in-out-circ":ad(.785,.135,.15,.86),"spring":function e(t,n,r){if(r===0){return GCe.linear}var i=JAi(t,n,r);return function(o,a,s){return o+(a-o)*i(s)}},"cubic-bezier":ad};tki={animate:tu.animate(),animation:tu.animation(),animated:tu.animated(),clearQueue:tu.clearQueue(),delay:tu.delay(),delayAnimation:tu.delayAnimation(),stop:tu.stop(),addToAnimationPool:function e(t){var n=this;if(!n.styleEnabled()){return}n._private.aniEles.merge(t)},stopAnimationLoop:function e(){this._private.animationsRunning=false},startAnimationLoop:function e(){var t=this;t._private.animationsRunning=true;if(!t.styleEnabled()){return}function n(){if(!t._private.animationsRunning){return}ZCe(function i(o){A_n(o,t);n()})}var r=t.renderer();if(r&&r.beforeRender){r.beforeRender(function i(o,a){A_n(a,t)},r.beforeRenderPriorities.animations)}else{n()}}};nki={qualifierCompare:function e(t,n){if(t==null||n==null){return t==null&&n==null}else{return t.sameText(n)}},eventMatches:function e(t,n,r){var i=n.qualifier;if(i!=null){return t!==r.target&&_te(r.target)&&i.matches(r.target)}return true},addEventFields:function e(t,n){n.cy=t;n.target=t},callbackContext:function e(t,n,r){return n.qualifier!=null?r.target:t}};DCe=function e(t){if(ma(t)){return new $L(t)}else{return t}};awn={createEmitter:function e(){var t=this._private;if(!t.emitter){t.emitter=new xSe(nki,this)}return this},emitter:function e(){return this._private.emitter},on:function e(t,n,r){this.emitter().on(t,DCe(n),r);return this},removeListener:function e(t,n,r){this.emitter().removeListener(t,DCe(n),r);return this},removeAllListeners:function e(){this.emitter().removeAllListeners();return this},one:function e(t,n,r){this.emitter().one(t,DCe(n),r);return this},once:function e(t,n,r){this.emitter().one(t,DCe(n),r);return this},emit:function e(t,n){this.emitter().emit(t,n);return this},emitAndNotify:function e(t,n){this.emit(t);this.notify(t,n);return this}};tu.eventAliasesOn(awn);net={png:function e(t){var n=this._private.renderer;t=t||{};return n.png(t)},jpg:function e(t){var n=this._private.renderer;t=t||{};t.bg=t.bg||"#fff";return n.jpg(t)}};net.jpeg=net.jpg;HCe={layout:function e(t){var n=this;if(t==null){sf("Layout options must be specified to make a layout");return}if(t.name==null){sf("A `name` must be specified to make a layout");return}var r=t.name;var i=n.extension("layout",r);if(i==null){sf("No such layout `"+r+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var o;if(ma(t.eles)){o=n.$(t.eles)}else{o=t.eles!=null?t.eles:n.$()}var a=new i(Ua({},t,{cy:n,eles:o}));return a}};HCe.createLayout=HCe.makeLayout=HCe.layout;rki={notify:function e(t,n){var r=this._private;if(this.batching()){r.batchNotifications=r.batchNotifications||{};var i=r.batchNotifications[t]=r.batchNotifications[t]||this.collection();if(n!=null){i.merge(n)}return}if(!r.notificationsEnabled){return}var o=this.renderer();if(this.destroyed()||!o){return}o.notify(t,n)},notifications:function e(t){var n=this._private;if(t===void 0){return n.notificationsEnabled}else{n.notificationsEnabled=t?true:false}return this},noNotifications:function e(t){this.notifications(false);t();this.notifications(true)},batching:function e(){return this._private.batchCount>0},startBatch:function e(){var t=this._private;if(t.batchCount==null){t.batchCount=0}if(t.batchCount===0){t.batchStyleEles=this.collection();t.batchNotifications={}}t.batchCount++;return this},endBatch:function e(){var t=this._private;if(t.batchCount===0){return this}t.batchCount--;if(t.batchCount===0){t.batchStyleEles.updateStyle();var n=this.renderer();Object.keys(t.batchNotifications).forEach(function(r){var i=t.batchNotifications[r];if(i.empty()){n.notify(r)}else{n.notify(r,i)}})}return this},batch:function e(t){this.startBatch();t();this.endBatch();return this},batchData:function e(t){var n=this;return this.batch(function(){var r=Object.keys(t);for(var i=0;i0){n.removeChild(n.childNodes[0])}}t._private.renderer=null;t.mutableElements().forEach(function(r){var i=r._private;i.rscratch={};i.rstyle={};i.animation.current=[];i.animation.queue=[]})},onRender:function e(t){return this.on("render",t)},offRender:function e(t){return this.off("render",t)}};ret.invalidateDimensions=ret.resize;WCe={collection:function e(t,n){if(ma(t)){return this.$(t)}else if(av(t)){return t.collection()}else if(Yu(t)){if(!n){n={}}return new Pg(this,t,n.unique,n.removed)}return new Pg(this)},nodes:function e(t){var n=this.$(function(r){return r.isNode()});if(t){return n.filter(t)}return n},edges:function e(t){var n=this.$(function(r){return r.isEdge()});if(t){return n.filter(t)}return n},$:function e(t){var n=this._private.elements;if(t){return n.filter(t)}else{return n.spawnSelf()}},mutableElements:function e(){return this._private.elements}};WCe.elements=WCe.filter=WCe.$;zm={};ste="t";oki="f";zm.apply=function(e){var t=this;var n=t._private;var r=n.cy;var i=r.collection();for(var o=0;o0;if(h||f&&m){var g=void 0;if(h&&m){g=u.properties}else if(h){g=u.properties}else if(m){g=u.mappedProperties}for(var x=0;x1){P=1}if(s.color){var I=r.valueMin[0];var N=r.valueMax[0];var O=r.valueMin[1];var z=r.valueMax[1];var U=r.valueMin[2];var W=r.valueMax[2];var H=r.valueMin[3]==null?1:r.valueMin[3];var $=r.valueMax[3]==null?1:r.valueMax[3];var K=[Math.round(I+(N-I)*P),Math.round(O+(z-O)*P),Math.round(U+(W-U)*P),Math.round(H+($-H)*P)];o={bypass:r.bypass,name:r.name,value:K,strValue:"rgb("+K[0]+", "+K[1]+", "+K[2]+")"}}else if(s.number){var X=r.valueMin+(r.valueMax-r.valueMin)*P;o=this.parse(r.name,X,r.bypass,h)}else{return false}if(!o){x();return false}o.mapping=r;r=o;break}case a.data:{var j=r.field.split(".");var te=f.data;for(var J=0;J0&&o>0){var s={};var l=false;for(var u=0;u0){e.delayAnimation(a).play().promise().then(A)}else{A()}}).then(function(){return e.animation({style:s,duration:o,easing:e.pstyle("transition-timing-function").value,queue:false}).play().promise()}).then(function(){n.removeBypasses(e,i);e.emitAndNotify("style");r.transitioning=false})}else if(r.transitioning){this.removeBypasses(e,i);e.emitAndNotify("style");r.transitioning=false}};zm.checkTrigger=function(e,t,n,r,i,o){var a=this.properties[t];var s=i(a);if(e.removed()){return}if(s!=null&&s(n,r,e)){o(a)}};zm.checkZOrderTrigger=function(e,t,n,r){var i=this;this.checkTrigger(e,t,n,r,function(o){return o.triggersZOrder},function(){i._private.cy.notify("zorder",e)})};zm.checkBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,function(i){return i.triggersBounds},function(i){e.dirtyCompoundBoundsCache();e.dirtyBoundingBoxCache()})};zm.checkConnectedEdgesBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,function(i){return i.triggersBoundsOfConnectedEdges},function(i){e.connectedEdges().forEach(function(o){o.dirtyBoundingBoxCache()})})};zm.checkParallelEdgesBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,function(i){return i.triggersBoundsOfParallelEdges},function(i){e.parallelEdges().forEach(function(o){o.dirtyBoundingBoxCache()})})};zm.checkTriggers=function(e,t,n,r){e.dirtyStyleCache();this.checkZOrderTrigger(e,t,n,r);this.checkBoundsTrigger(e,t,n,r);this.checkConnectedEdgesBoundsTrigger(e,t,n,r);this.checkParallelEdgesBoundsTrigger(e,t,n,r)};kte={};kte.applyBypass=function(e,t,n,r){var i=this;var o=[];var a=true;if(t==="*"||t==="**"){if(n!==void 0){for(var s=0;si.length){r=r.substr(i.length)}else{r=""}}function l(){if(o.length>a.length){o=o.substr(a.length)}else{o=""}}for(;;){var u=r.match(/^\s*$/);if(u){break}var d=r.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!d){nu("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+r);break}i=d[0];var f=d[1];if(f!=="core"){var h=new $L(f);if(h.invalid){nu("Skipping parsing of block: Invalid selector found in string stylesheet: "+f);s();continue}}var m=d[2];var g=false;o=m;var x=[];for(;;){var w=o.match(/^\s*$/);if(w){break}var _=o.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!_){nu("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+m);g=true;break}a=_[0];var C=_[1];var A=_[2];var P=t.properties[C];if(!P){nu("Skipping property: Invalid property name in: "+a);l();continue}var L=n.parse(C,A);if(!L){nu("Skipping property: Invalid property definition in: "+a);l();continue}x.push({name:C,val:A});l()}if(g){s();break}n.selector(f);for(var I=0;I=7&&t[0]==="d"&&(d=new RegExp(s.data.regex).exec(t))){if(n){return false}var h=s.data;return{name:e,value:d,strValue:""+t,mapped:h,field:d[1],bypass:n}}else if(t.length>=10&&t[0]==="m"&&(f=new RegExp(s.mapData.regex).exec(t))){if(n){return false}if(u.multiple){return false}var m=s.mapData;if(!(u.color||u.number)){return false}var g=this.parse(e,f[4]);if(!g||g.mapped){return false}var x=this.parse(e,f[5]);if(!x||x.mapped){return false}if(g.pfValue===x.pfValue||g.strValue===x.strValue){nu("`"+e+": "+t+"` is not a valid mapper because the output range is zero; converting to `"+e+": "+g.strValue+"`");return this.parse(e,g.strValue)}else if(u.color){var w=g.value;var _=x.value;var C=w[0]===_[0]&&w[1]===_[1]&&w[2]===_[2]&&(w[3]===_[3]||(w[3]==null||w[3]===1)&&(_[3]==null||_[3]===1));if(C){return false}}return{name:e,value:f,strValue:""+t,mapped:m,field:f[1],fieldMin:parseFloat(f[2]),fieldMax:parseFloat(f[3]),valueMin:g.value,valueMax:x.value,bypass:n}}if(u.multiple&&r!=="multiple"){var A;if(l){A=t.split(/\s+/)}else if(Yu(t)){A=t}else{A=[t]}if(u.evenMultiple&&A.length%2!==0){return null}var P=[];var L=[];var I=[];var N="";var O=false;for(var z=0;z0?" ":"")+U.strValue}if(u.validate&&!u.validate(P,L)){return null}if(u.singleEnum&&O){if(P.length===1&&ma(P[0])){return{name:e,value:P[0],strValue:P[0],bypass:n}}else{return null}}return{name:e,value:P,pfValue:I,strValue:N,bypass:n,units:L}}var W=function ve(){for(var ge=0;geu.max||u.strictMax&&t===u.max)){return null}var j={name:e,value:t,strValue:""+t+(H?H:""),units:H,bypass:n};if(u.unitless||H!=="px"&&H!=="em"){j.pfValue=t}else{j.pfValue=H==="px"||!H?t:this.getEmSizeInPixels()*t}if(H==="ms"||H==="s"){j.pfValue=H==="ms"?t:1e3*t}if(H==="deg"||H==="rad"){j.pfValue=H==="rad"?t:tCi(t)}if(H==="%"){j.pfValue=t/100}return j}else if(u.propList){var te=[];var J=""+t;if(J==="none");else{var oe=J.split(/\s*,\s*|\s+/);for(var se=0;se0&&s>0&&!isNaN(r.w)&&!isNaN(r.h)&&r.w>0&&r.h>0){l=Math.min((a-2*n)/r.w,(s-2*n)/r.h);l=l>this._private.maxZoom?this._private.maxZoom:l;l=l=r.minZoom){r.maxZoom=n}return this},minZoom:function e(t){if(t===void 0){return this._private.minZoom}else{return this.zoomRange({min:t})}},maxZoom:function e(t){if(t===void 0){return this._private.maxZoom}else{return this.zoomRange({max:t})}},getZoomedViewport:function e(t){var n=this._private;var r=n.pan;var i=n.zoom;var o;var a;var s=false;if(!n.zoomingEnabled){s=true}if(so(t)){a=t}else if(mc(t)){a=t.level;if(t.position!=null){o=fSe(t.position,i,r)}else if(t.renderedPosition!=null){o=t.renderedPosition}if(o!=null&&!n.panningEnabled){s=true}}a=a>n.maxZoom?n.maxZoom:a;a=an.maxZoom||!n.zoomingEnabled){a=true}else{n.zoom=l;o.push("zoom")}}if(i&&(!a||!t.cancelOnFailedZoom)&&n.panningEnabled){var u=t.pan;if(so(u.x)){n.pan.x=u.x;s=false}if(so(u.y)){n.pan.y=u.y;s=false}if(!s){o.push("pan")}}if(o.length>0){o.push("viewport");this.emit(o.join(" "));this.notify("viewport")}return this},center:function e(t){var n=this.getCenterPan(t);if(n){this._private.pan=n;this.emit("pan viewport");this.notify("viewport")}return this},getCenterPan:function e(t,n){if(!this._private.panningEnabled){return}if(ma(t)){var r=t;t=this.mutableElements().filter(r)}else if(!av(t)){t=this.mutableElements()}if(t.length===0){return}var i=t.boundingBox();var o=this.width();var a=this.height();n=n===void 0?this._private.zoom:n;var s={x:(o-n*(i.x1+i.x2))/2,y:(a-n*(i.y1+i.y2))/2};return s},reset:function e(){if(!this._private.panningEnabled||!this._private.zoomingEnabled){return this}this.viewport({pan:{x:0,y:0},zoom:1});return this},invalidateSize:function e(){this._private.sizeCache=null},size:function e(){var t=this._private;var n=t.container;var r=this;return t.sizeCache=t.sizeCache||(n?function(){var i=r.window().getComputedStyle(n);var o=function a(s){return parseFloat(i.getPropertyValue(s))};return{width:n.clientWidth-o("padding-left")-o("padding-right"),height:n.clientHeight-o("padding-top")-o("padding-bottom")}}():{width:1,height:1})},width:function e(){return this.size().width},height:function e(){return this.size().height},extent:function e(){var t=this._private.pan;var n=this._private.zoom;var r=this.renderedExtent();var i={x1:(r.x1-t.x)/n,x2:(r.x2-t.x)/n,y1:(r.y1-t.y)/n,y2:(r.y2-t.y)/n};i.w=i.x2-i.x1;i.h=i.y2-i.y1;return i},renderedExtent:function e(){var t=this.width();var n=this.height();return{x1:0,y1:0,x2:t,y2:n,w:t,h:n}},multiClickDebounceTime:function e(t){if(t)this._private.multiClickDebounceTime=t;else return this._private.multiClickDebounceTime;return this}};_B.centre=_B.center;_B.autolockNodes=_B.autolock;_B.autoungrabifyNodes=_B.autoungrabify;yte={data:tu.data({field:"data",bindingEvent:"data",allowBinding:true,allowSetting:true,settingEvent:"data",settingTriggersEvent:true,triggerFnName:"trigger",allowGetting:true,updateStyle:true}),removeData:tu.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:true,updateStyle:true}),scratch:tu.data({field:"scratch",bindingEvent:"scratch",allowBinding:true,allowSetting:true,settingEvent:"scratch",settingTriggersEvent:true,triggerFnName:"trigger",allowGetting:true,updateStyle:true}),removeScratch:tu.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:true,updateStyle:true})};yte.attr=yte.data;yte.removeAttr=yte.removeData;bte=function e(t){var n=this;t=Ua({},t);var r=t.container;if(r&&!KCe(r)&&KCe(r[0])){r=r[0]}var i=r?r._cyreg:null;i=i||{};if(i&&i.cy){i.cy.destroy();i={}}var o=i.readies=i.readies||[];if(r){r._cyreg=i}i.cy=n;var a=Op!==void 0&&r!==void 0&&!t.headless;var s=t;s.layout=Ua({name:a?"grid":"null"},s.layout);s.renderer=Ua({name:a?"canvas":"null"},s.renderer);var l=function m(g,x,w){if(x!==void 0){return x}else if(w!==void 0){return w}else{return g}};var u=this._private={container:r,ready:false,options:s,elements:new Pg(this),listeners:[],aniEles:new Pg(this),data:s.data||{},scratch:{},layout:null,renderer:null,destroyed:false,notificationsEnabled:true,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(true,s.zoomingEnabled),userZoomingEnabled:l(true,s.userZoomingEnabled),panningEnabled:l(true,s.panningEnabled),userPanningEnabled:l(true,s.userPanningEnabled),boxSelectionEnabled:l(true,s.boxSelectionEnabled),autolock:l(false,s.autolock,s.autolockNodes),autoungrabify:l(false,s.autoungrabify,s.autoungrabifyNodes),autounselectify:l(false,s.autounselectify),styleEnabled:s.styleEnabled===void 0?a:s.styleEnabled,zoom:so(s.zoom)?s.zoom:1,pan:{x:mc(s.pan)&&so(s.pan.x)?s.pan.x:0,y:mc(s.pan)&&so(s.pan.y)?s.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:false,multiClickDebounceTime:l(250,s.multiClickDebounceTime)};this.createEmitter();this.selectionType(s.selectionType);this.zoomRange({min:s.minZoom,max:s.maxZoom});var d=function m(g,x){var w=g.some(j2i);if(w){return oG.all(g).then(x)}else{x(g)}};if(u.styleEnabled){n.setStyle([])}var f=Ua({},s,s.renderer);n.initRenderer(f);var h=function m(g,x,w){n.notifications(false);var _=n.mutableElements();if(_.length>0){_.remove()}if(g!=null){if(mc(g)||Yu(g)){n.add(g)}}n.one("layoutready",function(A){n.notifications(true);n.emit(A);n.one("load",x);n.emitAndNotify("load")}).one("layoutstop",function(){n.one("done",w);n.emit("done")});var C=Ua({},n._private.options.layout);C.eles=n.elements();n.layout(C).run()};d([s.style,s.elements],function(m){var g=m[0];var x=m[1];if(u.styleEnabled){n.style().append(g)}h(x,function(){n.startAnimationLoop();u.ready=true;if(Af(s.ready)){n.on("ready",s.ready)}for(var w=0;w0;var s=!!e.boundingBox;var l=eb(s?e.boundingBox:structuredClone(t.extent()));var u;if(av(e.roots)){u=e.roots}else if(Yu(e.roots)){var d=[];for(var f=0;f0){var K=$();var X=z(K,W);if(X){K.outgoers().filter(function(it){return it.isNode()&&n.has(it)}).forEach(H)}else if(X===null){nu("Detected double maximal shift for node `"+K.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var j=0;if(e.avoidOverlap){for(var te=0;te0&&_[0].length<=3?we/2:0);var Be=2*Math.PI/_[Je].length*Te;if(Je===0&&_[0].length===1){Ze=1}return{x:$e.x+Ze*Math.cos(Be),y:$e.y+Ze*Math.sin(Be)}}else{var qe=_[Je].length;var Qe=Math.max(qe===1?0:s?(l.w-e.padding*2-Ee.w)/((e.grid?yt:qe)-1):(l.w-e.padding*2-Ee.w)/((e.grid?yt:qe)+1),j);var ze={x:$e.x+(Te+1-(qe+1)/2)*Qe,y:$e.y+(Je+1-(be+1)/2)*tt};return ze}};var ct={"downward":0,"leftward":90,"upward":180,"rightward":-90};if(Object.keys(ct).indexOf(e.direction)===-1){sf("Invalid direction '".concat(e.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(ct).join(", ")))}var Ge=function it(bt){return EEi(mt(bt),l,ct[e.direction])};n.nodes().layoutPositions(this,e,Ge);return this};uki={fit:true,padding:30,boundingBox:void 0,avoidOverlap:true,nodeDimensionsIncludeLabels:false,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:true,sort:void 0,animate:false,animationDuration:500,animationEasing:void 0,animateFilter:function e(t,n){return true},ready:void 0,stop:void 0,transform:function e(t,n){return n}};lwn.prototype.run=function(){var e=this.options;var t=e;var n=e.cy;var r=t.eles;var i=t.counterclockwise!==void 0?!t.counterclockwise:t.clockwise;var o=r.nodes().not(":parent");if(t.sort){o=o.sort(t.sort)}var a=eb(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});var s={x:a.x1+a.w/2,y:a.y1+a.h/2};var l=t.sweep===void 0?2*Math.PI-2*Math.PI/o.length:t.sweep;var u=l/Math.max(1,o.length-1);var d;var f=0;for(var h=0;h1&&t.avoidOverlap){f*=1.75;var _=Math.cos(u)-Math.cos(0);var C=Math.sin(u)-Math.sin(0);var A=Math.sqrt(f*f/(_*_+C*C));d=Math.max(A,d)}var P=function L(I,N){var O=t.startAngle+N*u*(i?1:-1);var z=d*Math.cos(O);var U=d*Math.sin(O);var W={x:s.x+z,y:s.y+U};return W};r.nodes().layoutPositions(this,t,P);return this};dki={fit:true,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:true,equidistant:false,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:true,nodeDimensionsIncludeLabels:false,height:void 0,width:void 0,spacingFactor:void 0,concentric:function e(t){return t.degree()},levelWidth:function e(t){return t.maxDegree()/4},animate:false,animationDuration:500,animationEasing:void 0,animateFilter:function e(t,n){return true},ready:void 0,stop:void 0,transform:function e(t,n){return n}};cwn.prototype.run=function(){var e=this.options;var t=e;var n=t.counterclockwise!==void 0?!t.counterclockwise:t.clockwise;var r=e.cy;var i=t.eles;var o=i.nodes().not(":parent");var a=eb(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});var s={x:a.x1+a.w/2,y:a.y1+a.h/2};var l=[];var u=0;for(var d=0;d0){var L=Math.abs(C[0].value-P.value);if(L>=w){C=[];_.push(C)}}C.push(P)}var I=u+t.minNodeSpacing;if(!t.avoidOverlap){var N=_.length>0&&_[0].length>1;var O=Math.min(a.w,a.h)/2-I;var z=O/(_.length+N?1:0);I=Math.min(I,z)}var U=0;for(var W=0;W<_.length;W++){var H=_[W];var $=t.sweep===void 0?2*Math.PI-2*Math.PI/H.length:t.sweep;var K=H.dTheta=$/Math.max(1,H.length-1);if(H.length>1&&t.avoidOverlap){var X=Math.cos(K)-Math.cos(0);var j=Math.sin(K)-Math.sin(0);var te=Math.sqrt(I*I/(X*X+j*j));U=Math.max(te,U)}H.r=U;U+=I}if(t.equidistant){var J=0;var oe=0;for(var se=0;se<_.length;se++){var re=_[se];var ce=re.r-oe;J=Math.max(J,ce)}oe=0;for(var ue=0;ue<_.length;ue++){var xe=_[ue];if(ue===0){oe=xe.r}xe.r=oe;oe+=J}}var be={};for(var Ie=0;Ie<_.length;Ie++){var he=_[Ie];var ve=he.dTheta;var ge=he.r;for(var Ve=0;Ve=e.numIter){return false}bki(r,e);r.temperature=r.temperature*e.coolingFactor;if(r.temperature=e.animationThreshold){o()}ZCe(d)}};d()}else{while(u){u=a(l);l++}P_n(r,e);s()}return this};ESe.prototype.stop=function(){this.stopped=true;if(this.thread){this.thread.stop()}this.emit("layoutstop");return this};ESe.prototype.destroy=function(){if(this.thread){this.thread.stop()}return this};hki=function e(t,n,r){var i=r.eles.edges();var o=r.eles.nodes();var a=eb(r.boundingBox?r.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()});var s={isCompound:t.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:o.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:i.size(),temperature:r.initialTemp,clientWidth:a.w,clientHeight:a.h,boundingBox:a};var l=r.eles.components();var u={};for(var d=0;d0){s.graphSet.push(O);for(var d=0;di.count){return 0}else{return i.graph}};uwn=function e(t,n,r,i){var o=i.graphSet[r];if(-10){var f=i.nodeOverlap*d;var h=Math.sqrt(s*s+l*l);var m=f*s/h;var g=f*l/h}else{var x=iSe(t,s,l);var w=iSe(n,-1*s,-1*l);var _=w.x-x.x;var C=w.y-x.y;var A=_*_+C*C;var h=Math.sqrt(A);var f=(t.nodeRepulsion+n.nodeRepulsion)/A;var m=f*_/h;var g=f*C/h}if(!t.isLocked){t.offsetX-=m;t.offsetY-=g}if(!n.isLocked){n.offsetX+=m;n.offsetY+=g}return};_ki=function e(t,n,r,i){if(r>0){var o=t.maxX-n.minX}else{var o=n.maxX-t.minX}if(i>0){var a=t.maxY-n.minY}else{var a=n.maxY-t.minY}if(o>=0&&a>=0){return Math.sqrt(o*o+a*a)}else{return 0}};iSe=function e(t,n,r){var i=t.positionX;var o=t.positionY;var a=t.height||1;var s=t.width||1;var l=r/n;var u=a/s;var d={};if(0===n&&0r){d.x=i;d.y=o+a/2;return d}if(0n&&-1*u<=l&&l<=u){d.x=i-s/2;d.y=o-s*r/2/n;return d}if(0=u)){d.x=i+a*n/2/r;d.y=o+a/2;return d}if(0>r&&(l<=-1*u||l>=u)){d.x=i-a*n/2/r;d.y=o-a/2;return d}return d};Tki=function e(t,n){for(var r=0;rr){var w=n.gravity*m/x;var _=n.gravity*g/x;h.offsetX+=w;h.offsetY+=_}}}};Eki=function e(t,n){var r=[];var i=0;var o=-1;r.push.apply(r,t.graphSet[0]);o+=t.graphSet[0].length;while(i<=o){var a=r[i++];var s=t.idToIndex[a];var l=t.layoutNodes[s];var u=l.children;if(0r){var o={x:r*t/i,y:r*n/i}}else{var o={x:t,y:n}}return o};fwn=function e(t,n){var r=t.parentId;if(null==r){return}var i=n.layoutNodes[n.idToIndex[r]];var o=false;if(null==i.maxX||t.maxX+i.padRight>i.maxX){i.maxX=t.maxX+i.padRight;o=true}if(null==i.minX||t.minX-i.padLefti.maxY){i.maxY=t.maxY+i.padBottom;o=true}if(null==i.minY||t.minY-i.padTop_){g+=w+n.componentSpacing;m=0;x=0;w=0}}};Aki={fit:true,padding:30,boundingBox:void 0,avoidOverlap:true,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:false,spacingFactor:void 0,condense:false,rows:void 0,cols:void 0,position:function e(t){},sort:void 0,animate:false,animationDuration:500,animationEasing:void 0,animateFilter:function e(t,n){return true},ready:void 0,stop:void 0,transform:function e(t,n){return n}};hwn.prototype.run=function(){var e=this.options;var t=e;var n=e.cy;var r=t.eles;var i=r.nodes().not(":parent");if(t.sort){i=i.sort(t.sort)}var o=eb(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(o.h===0||o.w===0){r.nodes().layoutPositions(this,t,function(ue){return{x:o.x1,y:o.y1}})}else{var a=i.size();var s=Math.sqrt(a*o.h/o.w);var l=Math.round(s);var u=Math.round(o.w/o.h*s);var d=function ue(xe){if(xe==null){return Math.min(l,u)}else{var be=Math.min(l,u);if(be==l){l=xe}else{u=xe}}};var f=function ue(xe){if(xe==null){return Math.max(l,u)}else{var be=Math.max(l,u);if(be==l){l=xe}else{u=xe}}};var h=t.rows;var m=t.cols!=null?t.cols:t.columns;if(h!=null&&m!=null){l=h;u=m}else if(h!=null&&m==null){l=h;u=Math.ceil(a/l)}else if(h==null&&m!=null){u=m;l=Math.ceil(a/u)}else if(u*l>a){var g=d();var x=f();if((g-1)*x>=a){d(g-1)}else if((x-1)*g>=a){f(x-1)}}else{while(u*l=a){f(_+1)}else{d(w+1)}}}var C=o.w/u;var A=o.h/l;if(t.condense){C=0;A=0}if(t.avoidOverlap){for(var P=0;P=u){X=0;K++}};var te={};for(var J=0;J(X=mCi(e,t,j[te],j[te+1],j[te+2],j[te+3]))){w(N,X);return true}}}else if(z.edgeType==="bezier"||z.edgeType==="multibezier"||z.edgeType==="self"||z.edgeType==="compound"){var j=z.allpts;for(var te=0;te+5(X=pCi(e,t,j[te],j[te+1],j[te+2],j[te+3],j[te+4],j[te+5]))){w(N,X);return true}}}var J=J||O.source;var oe=oe||O.target;var se=i.getArrowWidth(U,W);var re=[{name:"source",x:z.arrowStartX,y:z.arrowStartY,angle:z.srcArrowAngle},{name:"target",x:z.arrowEndX,y:z.arrowEndY,angle:z.tgtArrowAngle},{name:"mid-source",x:z.midX,y:z.midY,angle:z.midsrcArrowAngle},{name:"mid-target",x:z.midX,y:z.midY,angle:z.midtgtArrowAngle}];for(var te=0;te0){_(J);_(oe)}}function A(N,O,z){return Q0(N,O,z)}function P(N,O){var z=N._private;var U=h;var W;if(O){W=O+"-"}else{W=""}N.boundingBox();var H=z.labelBounds[O||"main"];var $=N.pstyle(W+"label").value;var K=N.pstyle("text-events").strValue==="yes";if(!K||!$){return}var X=A(z.rscratch,"labelX",O);var j=A(z.rscratch,"labelY",O);var te=A(z.rscratch,"labelAngle",O);var J=N.pstyle(W+"text-margin-x").pfValue;var oe=N.pstyle(W+"text-margin-y").pfValue;var se=H.x1-U-J;var re=H.x2+U-J;var ce=H.y1-U-oe;var ue=H.y2+U-oe;if(te){var xe=Math.cos(te);var be=Math.sin(te);var Ie=function $e(Ee,tt){Ee=Ee-X;tt=tt-j;return{x:Ee*xe-tt*be+X,y:Ee*be+tt*xe+j}};var he=Ie(se,ce);var ve=Ie(se,ue);var ge=Ie(re,ce);var Ve=Ie(re,ue);var Le=[he.x+J,he.y+oe,ge.x+J,ge.y+oe,Ve.x+J,Ve.y+oe,ve.x+J,ve.y+oe];if(vx(e,t,Le)){w(N);return true}}else{if(FL(H,e,t)){w(N);return true}}}for(var L=a.length-1;L>=0;L--){var I=a[L];if(I.isNode()){_(I)||P(I)}else{C(I)||P(I)||P(I,"source")||P(I,"target")}}return s};wB.getAllInBox=function(e,t,n,r){var i=this.getCachedZSortedEles().interactive;var o=this.cy.zoom();var a=2/o;var s=[];var l=Math.min(e,n);var u=Math.max(e,n);var d=Math.min(t,r);var f=Math.max(t,r);e=l;n=u;t=d;r=f;var h=eb({x1:e,y1:t,x2:n,y2:r});var m=[{x:h.x1,y:h.y1},{x:h.x2,y:h.y1},{x:h.x2,y:h.y2},{x:h.x1,y:h.y2}];var g=[[m[0],m[1]],[m[1],m[2]],[m[2],m[3]],[m[3],m[0]]];function x(Ee,tt,yt){return Q0(Ee,tt,yt)}function w(Ee,tt){var yt=Ee._private;var mt=a;var ct="";Ee.boundingBox();var Ge=yt.labelBounds["main"];if(!Ge){return null}var it=x(yt.rscratch,"labelX",tt);var bt=x(yt.rscratch,"labelY",tt);var He=x(yt.rscratch,"labelAngle",tt);var Je=Ee.pstyle(ct+"text-margin-x").pfValue;var Te=Ee.pstyle(ct+"text-margin-y").pfValue;var we=Ge.x1-mt-Je;var Ze=Ge.x2+mt-Je;var Be=Ge.y1-mt-Te;var qe=Ge.y2+mt-Te;if(He){var Qe=Math.cos(He);var ze=Math.sin(He);var Me=function ye(Ne,Ae){Ne=Ne-it;Ae=Ae-bt;return{x:Ne*Qe-Ae*ze+it,y:Ne*ze+Ae*Qe+bt}};return[Me(we,Be),Me(Ze,Be),Me(Ze,qe),Me(we,qe)]}else{return[{x:we,y:Be},{x:Ze,y:Be},{x:Ze,y:qe},{x:we,y:qe}]}}function _(Ee,tt,yt,mt){function ct(Ge,it,bt){return(bt.y-Ge.y)*(it.x-Ge.x)>(it.y-Ge.y)*(bt.x-Ge.x)}return ct(Ee,yt,mt)!==ct(tt,yt,mt)&&ct(Ee,tt,yt)!==ct(Ee,tt,mt)}for(var C=0;C0?-(Math.PI-t.ang):Math.PI+t.ang};Lki=function e(t,n,r,i,o){t!==F_n?N_n(n,t,KC):Mki(D_,KC);N_n(n,r,D_);L_n=KC.nx*D_.ny-KC.ny*D_.nx;D_n=KC.nx*D_.nx-KC.ny*-D_.ny;IR=Math.asin(Math.max(-1,Math.min(1,L_n)));if(Math.abs(IR)<1e-6){iet=n.x;oet=n.y;pB=$$=0;return}gB=1;YCe=false;if(D_n<0){if(IR<0){IR=Math.PI+IR}else{IR=Math.PI-IR;gB=-1;YCe=true}}else{if(IR>0){gB=-1;YCe=true}}if(n.radius!==void 0){$$=n.radius}else{$$=i}uB=IR/2;FCe=Math.min(KC.len/2,D_.len/2);if(o){XC=Math.abs(Math.cos(uB)*$$/Math.sin(uB));if(XC>FCe){XC=FCe;pB=Math.abs(XC*Math.sin(uB)/Math.cos(uB))}else{pB=$$}}else{XC=Math.min(FCe,$$);pB=Math.abs(XC*Math.sin(uB)/Math.cos(uB))}aet=n.x+D_.nx*XC;set=n.y+D_.ny*XC;iet=aet-D_.ny*pB*gB;oet=set+D_.nx*pB*gB;ywn=n.x+KC.nx*XC;bwn=n.y+KC.ny*XC;F_n=n};xte=.01;Dki=Math.sqrt(2*xte);qy={};qy.findMidptPtsEtc=function(e,t){var n=t.posPts,r=t.intersectionPts,i=t.vectorNormInverse;var o;var a=e.pstyle("source-endpoint");var s=e.pstyle("target-endpoint");var l=a.units!=null&&s.units!=null;var u=function P(L,I,N,O){var z=O-I;var U=N-L;var W=Math.sqrt(U*U+z*z);return{x:-z/W,y:U/W}};var d=e.pstyle("edge-distances").value;switch(d){case"node-position":o=n;break;case"intersection":o=r;break;case"endpoints":{if(l){var f=this.manualEndptToPx(e.source()[0],a),h=np(f,2),m=h[0],g=h[1];var x=this.manualEndptToPx(e.target()[0],s),w=np(x,2),_=w[0],C=w[1];var A={x1:m,y1:g,x2:_,y2:C};i=u(m,g,_,C);o=A}else{nu("Edge ".concat(e.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default)."));o=r}break}}return{midptPts:o,vectorNormInverse:i}};qy.findHaystackPoints=function(e){for(var t=0;t0){return Math.max(Ae-dt,0)}else{return Math.min(Ae+dt,0)}};var $=H(U,O);var K=H(W,z);var X=false;if(C===u){_=Math.abs($)>Math.abs(K)?i:r}else if(C===l||C===s){_=r;X=true}else if(C===o||C===a){_=i;X=true}var j=_===r;var te=j?K:$;var J=j?W:U;var oe=Tet(J);var se=false;if(!(X&&(P||I))&&(C===s&&J<0||C===l&&J>0||C===o&&J>0||C===a&&J<0)){oe*=-1;te=oe*Math.abs(te);se=true}var re;if(P){var ce=L<0?1+L:L;re=ce*te}else{var ue=L<0?te:0;re=ue+L*oe}var xe=function Ne(Ae){return Math.abs(Ae)=Math.abs(te)};var be=xe(re);var Ie=xe(Math.abs(te)-Math.abs(re));var he=be||Ie;if(he&&!se){if(j){var ve=Math.abs(J)<=h/2;var ge=Math.abs(U)<=m/2;if(ve){var Ve=(d.x1+d.x2)/2;var Le=d.y1,$e=d.y2;n.segpts=[Ve,Le,Ve,$e]}else if(ge){var Ee=(d.y1+d.y2)/2;var tt=d.x1,yt=d.x2;n.segpts=[tt,Ee,yt,Ee]}else{n.segpts=[d.x1,d.y2]}}else{var mt=Math.abs(J)<=f/2;var ct=Math.abs(W)<=g/2;if(mt){var Ge=(d.y1+d.y2)/2;var it=d.x1,bt=d.x2;n.segpts=[it,Ge,bt,Ge]}else if(ct){var He=(d.x1+d.x2)/2;var Je=d.y1,Te=d.y2;n.segpts=[He,Je,He,Te]}else{n.segpts=[d.x2,d.y1]}}}else{if(j){var we=d.y1+re+(w?h/2*oe:0);var Ze=d.x1,Be=d.x2;n.segpts=[Ze,we,Be,we]}else{var qe=d.x1+re+(w?f/2*oe:0);var Qe=d.y1,ze=d.y2;n.segpts=[qe,Qe,qe,ze]}}if(n.isRound){var Me=e.pstyle("taxi-radius").value;var ye=e.pstyle("radius-type").value[0]==="arc-radius";n.radii=new Array(n.segpts.length/2).fill(Me);n.isArcRadius=new Array(n.segpts.length/2).fill(ye)}};qy.tryToCorrectInvalidPoints=function(e,t){var n=e._private.rscratch;if(n.edgeType==="bezier"){var r=t.srcPos,i=t.tgtPos,o=t.srcW,a=t.srcH,s=t.tgtW,l=t.tgtH,u=t.srcShape,d=t.tgtShape,f=t.srcCornerRadius,h=t.tgtCornerRadius,m=t.srcRs,g=t.tgtRs;var x=!so(n.startX)||!so(n.startY);var w=!so(n.arrowStartX)||!so(n.arrowStartY);var _=!so(n.endX)||!so(n.endY);var C=!so(n.arrowEndX)||!so(n.arrowEndY);var A=3;var P=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth;var L=A*P;var I=xB({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY});var N=IJ.poolIndex()){var oe=te;te=J;J=oe}var se=$.srcPos=te.position();var re=$.tgtPos=J.position();var ce=$.srcW=te.outerWidth();var ue=$.srcH=te.outerHeight();var xe=$.tgtW=J.outerWidth();var be=$.tgtH=J.outerHeight();var Ie=$.srcShape=n.nodeShapes[t.getNodeShape(te)];var he=$.tgtShape=n.nodeShapes[t.getNodeShape(J)];var ve=$.srcCornerRadius=te.pstyle("corner-radius").value==="auto"?"auto":te.pstyle("corner-radius").pfValue;var ge=$.tgtCornerRadius=J.pstyle("corner-radius").value==="auto"?"auto":J.pstyle("corner-radius").pfValue;var Ve=$.tgtRs=J._private.rscratch;var Le=$.srcRs=te._private.rscratch;$.dirCounts={"north":0,"west":0,"south":0,"east":0,"northwest":0,"southwest":0,"northeast":0,"southeast":0};for(var $e=0;$e<$.eles.length;$e++){var Ee=$.eles[$e];var tt=Ee[0]._private.rscratch;var yt=Ee.pstyle("curve-style").value;var mt=yt==="unbundled-bezier"||DL(yt,"segments")||DL(yt,"taxi");var ct=!te.same(Ee.source());if(!$.calculatedIntersection&&te!==J&&($.hasBezier||$.hasUnbundled)){$.calculatedIntersection=true;var Ge=Ie.intersectLine(se.x,se.y,ce,ue,re.x,re.y,0,ve,Le);var it=$.srcIntn=Ge;var bt=he.intersectLine(re.x,re.y,xe,be,se.x,se.y,0,ge,Ve);var He=$.tgtIntn=bt;var Je=$.intersectionPts={x1:Ge[0],x2:bt[0],y1:Ge[1],y2:bt[1]};var Te=$.posPts={x1:se.x,x2:re.x,y1:se.y,y2:re.y};var we=bt[1]-Ge[1];var Ze=bt[0]-Ge[0];var Be=Math.sqrt(Ze*Ze+we*we);if(so(Be)&&Be>=Dki);else{Be=Math.sqrt(Math.max(Ze*Ze,xte)+Math.max(we*we,xte))}var qe=$.vector={x:Ze,y:we};var Qe=$.vectorNorm={x:qe.x/Be,y:qe.y/Be};var ze={x:-Qe.y,y:Qe.x};$.nodesOverlap=!so(Be)||he.checkPoint(Ge[0],Ge[1],0,xe,be,re.x,re.y,ge,Ve)||Ie.checkPoint(bt[0],bt[1],0,ce,ue,se.x,se.y,ve,Le);$.vectorNormInverse=ze;K={nodesOverlap:$.nodesOverlap,dirCounts:$.dirCounts,calculatedIntersection:true,hasBezier:$.hasBezier,hasUnbundled:$.hasUnbundled,eles:$.eles,srcPos:re,srcRs:Ve,tgtPos:se,tgtRs:Le,srcW:xe,srcH:be,tgtW:ce,tgtH:ue,srcIntn:He,tgtIntn:it,srcShape:he,tgtShape:Ie,posPts:{x1:Te.x2,y1:Te.y2,x2:Te.x1,y2:Te.y1},intersectionPts:{x1:Je.x2,y1:Je.y2,x2:Je.x1,y2:Je.y1},vector:{x:-qe.x,y:-qe.y},vectorNorm:{x:-Qe.x,y:-Qe.y},vectorNormInverse:{x:-ze.x,y:-ze.y}}}var Me=ct?K:$;tt.nodesOverlap=Me.nodesOverlap;tt.srcIntn=Me.srcIntn;tt.tgtIntn=Me.tgtIntn;tt.isRound=yt.startsWith("round");if(i&&(te.isParent()||te.isChild()||J.isParent()||J.isChild())&&(te.parents().anySame(J)||J.parents().anySame(te)||te.same(J)&&te.isParent())){t.findCompoundLoopPoints(Ee,Me,$e,mt)}else if(te===J){t.findLoopPoints(Ee,Me,$e,mt)}else if(yt.endsWith("segments")){t.findSegmentsPoints(Ee,Me)}else if(yt.endsWith("taxi")){t.findTaxiPoints(Ee,Me)}else if(yt==="straight"||!mt&&$.eles.length%2===1&&$e===Math.floor($.eles.length/2)){t.findStraightEdgePoints(Ee)}else{t.findBezierPoints(Ee,Me,$e,mt,ct)}t.findEndpoints(Ee);t.tryToCorrectInvalidPoints(Ee,Me);t.checkForInvalidEdgeWarning(Ee);t.storeAllpts(Ee);t.storeEdgeProjections(Ee);t.calculateArrowAngles(Ee);t.recalculateEdgeLabelProjections(Ee);t.calculateLabelAngles(Ee)}};for(var N=0;N0){var Ge=u;var it=hB(Ge,Y$(a));var bt=hB(Ge,Y$(ct));var He=it;if(bt2){var Je=hB(Ge,{x:ct[2],y:ct[3]});if(Je0){var Oe=d;var Wt=hB(Oe,Y$(a));var kt=hB(Oe,Y$(dt));var qt=Wt;if(kt2){var _t=hB(Oe,{x:dt[2],y:dt[3]});if(_t=g||N){w={cp:P,segment:I};break}}if(w){break}}var O=w.cp;var z=w.segment;var U=(g-_)/z.length;var W=z.t1-z.t0;var H=m?z.t0+W*U:z.t1-W*U;H=hte(0,H,1);t=j$(O.p0,O.p1,O.p2,H);h=Nki(O.p0,O.p1,O.p2,H);break}case"straight":case"segments":case"haystack":{var $=0,K,X;var j,te;var J=r.allpts.length;for(var oe=0;oe+3=g){break}}var se=g-X;var re=se/K;re=hte(0,re,1);t=rCi(j,te,re);h=Twn(j,te);break}}a("labelX",f,t.x);a("labelY",f,t.y);a("labelAutoAngle",f,h)};u("source");u("target");this.applyLabelDimensions(e)};eS.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e);if(e.isEdge()){this.applyPrefixedLabelDimensions(e,"source");this.applyPrefixedLabelDimensions(e,"target")}};eS.applyPrefixedLabelDimensions=function(e,t){var n=e._private;var r=this.getLabelText(e,t);var i=bB(r,e._private.labelDimsKey);if(Q0(n.rscratch,"prefixedLabelDimsKey",t)===i){return}ZC(n.rscratch,"prefixedLabelDimsKey",t,i);var o=this.calculateLabelDimensions(e,r);var a=e.pstyle("line-height").pfValue;var s=e.pstyle("font-size").pfValue;var l=e.pstyle("text-wrap").strValue;var u=Q0(n.rscratch,"labelWrapCachedLines",t)||[];var d=l!=="wrap"?1:Math.max(u.length,1);var f=s*a;var h=o.width;var m=o.height+(d-1)*(a-1)*s;ZC(n.rstyle,"labelWidth",t,h);ZC(n.rscratch,"labelWidth",t,h);ZC(n.rstyle,"labelHeight",t,m);ZC(n.rscratch,"labelHeight",t,m);ZC(n.rscratch,"labelLineHeight",t,f);ZC(n.rscratch,"labelActualDescent",t,o.labelActualDescent)};eS.getLabelText=function(e,t){var n=e._private;var r=t?t+"-":"";var i=e.pstyle(r+"label").strValue;var o=e.pstyle("text-transform").value;var a=function ce(ue,xe){if(xe){ZC(n.rscratch,ue,t,xe);return xe}else{return Q0(n.rscratch,ue,t)}};if(!i){return""}if(o=="none");else if(o=="uppercase"){i=i.toUpperCase()}else if(o=="lowercase"){i=i.toLowerCase()}var s=e.pstyle("text-wrap").value;if(s==="wrap"){var l=a("labelKey");if(l!=null&&a("labelWrapKey")===l){return a("labelWrapCachedText")}var u="\u200B";var d=i.split("\n");var f=e.pstyle("text-max-width").pfValue;var h=e.pstyle("text-overflow-wrap").value;var m=h==="anywhere";var g=[];var x=/[\s\u200b]+|$/g;for(var w=0;wf){var L=_.matchAll(x);var I="";var N=0;var O=_x(L),z;try{for(O.s();!(z=O.n()).done;){var U=z.value;var W=U[0];var H=_.substring(N,U.index);N=U.index+W.length;var $=I.length===0?H:I+H+W;var K=this.calculateLabelDimensions(e,$);var X=K.width;if(X<=f){I+=H+W}else{if(I){g.push(I)}I=H+W}}}catch(ce){O.e(ce)}finally{O.f()}if(!I.match(/^[\s\u200b]+$/)){g.push(I)}}else{g.push(_)}}a("labelWrapCachedLines",g);i=a("labelWrapCachedText",g.join("\n"));a("labelWrapKey",l)}else if(s==="ellipsis"){var j=e.pstyle("text-max-width").pfValue;var te="";var J="\u2026";var oe=false;if(this.calculateLabelDimensions(e,i).widthj){break}te+=i[se];if(se===i.length-1){oe=true}}if(!oe){te+=J}return te}return i};eS.getLabelJustification=function(e){var t=e.pstyle("text-justification").strValue;var n=e.pstyle("text-halign").strValue;if(t==="auto"){if(e.isNode()){return wAi(n)}else{return"center"}}else{return t}};eS.calculateLabelDimensions=function(e,t){var n=this;var r=n.cy.window();var i=r.document;var o=0;var a=e.pstyle("font-style").strValue;var s=e.pstyle("font-size").pfValue;var l=e.pstyle("font-family").strValue;var u=e.pstyle("font-weight").strValue;var d=e.pstyle("text-metrics").strValue||"font";var f=this.labelCalcCanvas;var h=this.labelCalcCanvasContext;if(!f){f=this.labelCalcCanvas=i.createElement("canvas");h=this.labelCalcCanvasContext=f.getContext("2d");var m=f.style;m.position="absolute";m.left="-9999px";m.top="-9999px";m.zIndex="-1";m.visibility="hidden";m.pointerEvents="none"}h.font="".concat(a," ").concat(u," ").concat(s,"px ").concat(l);var g=0;var x=0;var w=t.split("\n");var _=w.length;var C=0;var A=0;for(var P=0;P<_;P++){var L=w[P];var I=h.measureText(L);var N=Math.ceil(I.width);var O=s;if(d==="glyph"){if(P===0){A=I.actualBoundingBoxAscent}if(P===_-1){C=I.actualBoundingBoxDescent}}g=Math.max(N,g);x+=O}if(d==="glyph"){x-=s-A-C}g+=o;x+=o;return{width:g,height:x,labelActualAscent:A,labelActualDescent:C}};eS.calculateLabelAngle=function(e,t){var n=e._private;var r=n.rscratch;var i=e.isEdge();var o=t?t+"-":"";var a=e.pstyle(o+"text-rotation");var s=a.strValue;if(s==="none"){return 0}else if(i&&s==="autorotate"){return r.labelAutoAngle}else if(s==="autorotate"){return 0}else{return a.pfValue}};eS.calculateLabelAngles=function(e){var t=this;var n=e.isEdge();var r=e._private;var i=r.rscratch;i.labelAngle=t.calculateLabelAngle(e);if(n){i.sourceLabelAngle=t.calculateLabelAngle(e,"source");i.targetLabelAngle=t.calculateLabelAngle(e,"target")}};wwn={};O_n=28;B_n=false;wwn.getNodeShape=function(e){var t=this;var n=e.pstyle("shape").value;if(n==="cutrectangle"&&(e.width()1&&arguments[1]!==void 0?arguments[1]:true;t.merge(a);if(s){for(var l=0;l=e.desktopTapThreshold2}var vr=o(ye);if(lr){e.hoverData.tapholdCancelled=true}var Yr=function Xt(){var Cn=e.hoverData.dragDelta=e.hoverData.dragDelta||[];if(Cn.length===0){Cn.push(mn[0]);Cn.push(mn[1])}else{Cn[0]+=mn[0];Cn[1]+=mn[1]}};Ae=true;i(Jt,["mousemove","vmousemove","tapdrag"],ye,{x:kt[0],y:kt[1]});var nt=function Xt(Cn){return{originalEvent:ye,type:Cn,position:{x:kt[0],y:kt[1]}}};var Rr=function Xt(){e.data.bgActivePosistion=void 0;if(!e.hoverData.selecting){dt.emit(nt("boxstart"))}sn[4]=1;e.hoverData.selecting=true;e.redrawHint("select",true);e.redraw()};if(e.hoverData.which===3){if(lr){var Xr=nt("cxtdrag");if(Kt){Kt.emit(Xr)}else{dt.emit(Xr)}e.hoverData.cxtDragged=true;if(!e.hoverData.cxtOver||Jt!==e.hoverData.cxtOver){if(e.hoverData.cxtOver){e.hoverData.cxtOver.emit(nt("cxtdragout"))}e.hoverData.cxtOver=Jt;if(Jt){Jt.emit(nt("cxtdragover"))}}}}else if(e.hoverData.dragging){Ae=true;if(dt.panningEnabled()&&dt.userPanningEnabled()){var dr;if(e.hoverData.justStartedPan){var rn=e.hoverData.mdownPos;dr={x:(kt[0]-rn[0])*Oe,y:(kt[1]-rn[1])*Oe};e.hoverData.justStartedPan=false}else{dr={x:mn[0]*Oe,y:mn[1]*Oe}}dt.panBy(dr);dt.emit(nt("dragpan"));e.hoverData.dragged=true}kt=e.projectIntoViewport(ye.clientX,ye.clientY)}else if(sn[4]==1&&(Kt==null||Kt.pannable())){if(lr){if(!e.hoverData.dragging&&dt.boxSelectionEnabled()&&(vr||!dt.panningEnabled()||!dt.userPanningEnabled())){Rr()}else if(!e.hoverData.selecting&&dt.panningEnabled()&&dt.userPanningEnabled()){var St=a(Kt,e.hoverData.downs);if(St){e.hoverData.dragging=true;e.hoverData.justStartedPan=true;sn[4]=0;e.data.bgActivePosistion=Y$(qt);e.redrawHint("select",true);e.redraw()}}if(Kt&&Kt.pannable()&&Kt.active()){Kt.unactivate()}}}else{if(Kt&&Kt.pannable()&&Kt.active()){Kt.unactivate()}if((!Kt||!Kt.grabbed())&&Jt!=Sn){if(Sn){i(Sn,["mouseout","tapdragout"],ye,{x:kt[0],y:kt[1]})}if(Jt){i(Jt,["mouseover","tapdragover"],ye,{x:kt[0],y:kt[1]})}e.hoverData.last=Jt}if(Kt){if(lr){if(dt.boxSelectionEnabled()&&vr){if(Kt&&Kt.grabbed()){x(At);Kt.emit(nt("freeon"));At.emit(nt("free"));if(e.dragData.didDrag){Kt.emit(nt("dragfreeon"));At.emit(nt("dragfree"))}}Rr()}else if(Kt&&Kt.grabbed()&&e.nodeIsDraggable(Kt)){var Ut=!e.dragData.didDrag;if(Ut){e.redrawHint("eles",true)}e.dragData.didDrag=true;if(!e.hoverData.draggingEles){m(At,{inDragLayer:true})}var Pt={x:0,y:0};if(so(mn[0])&&so(mn[1])){Pt.x+=mn[0];Pt.y+=mn[1];if(Ut){var an=e.hoverData.dragDelta;if(an&&so(an[0])&&so(an[1])){Pt.x+=an[0];Pt.y+=an[1]}}}e.hoverData.draggingEles=true;At.silentShift(Pt).emit(nt("position")).emit(nt("drag"));e.redrawHint("drag",true);e.redraw()}}else{Yr()}}Ae=true}sn[2]=kt[0];sn[3]=kt[1];if(Ae){if(ye.stopPropagation)ye.stopPropagation();if(ye.preventDefault)ye.preventDefault();return false}},false);var U,W,H;e.registerBinding(t,"mouseup",function Me(ye){if(e.hoverData.which===1&&ye.which!==1&&e.hoverData.capture){return}var Ne=e.hoverData.capture;if(!Ne){return}e.hoverData.capture=false;var Ae=e.cy;var dt=e.projectIntoViewport(ye.clientX,ye.clientY);var Oe=e.selection;var Wt=e.findNearestElement(dt[0],dt[1],true,false);var kt=e.dragData.possibleDragElements;var qt=e.hoverData.down;var _t=o(ye);if(e.data.bgActivePosistion){e.redrawHint("select",true);e.redraw()}e.hoverData.tapholdCancelled=true;e.data.bgActivePosistion=void 0;if(qt){qt.unactivate()}var sn=function lr(on){return{originalEvent:ye,type:on,position:{x:dt[0],y:dt[1]}}};if(e.hoverData.which===3){var Jt=sn("cxttapend");if(qt){qt.emit(Jt)}else{Ae.emit(Jt)}if(!e.hoverData.cxtDragged){var Sn=sn("cxttap");if(qt){qt.emit(Sn)}else{Ae.emit(Sn)}}e.hoverData.cxtDragged=false;e.hoverData.which=null}else if(e.hoverData.which===1){i(Wt,["mouseup","tapend","vmouseup"],ye,{x:dt[0],y:dt[1]});if(!e.dragData.didDrag&&!e.hoverData.dragged&&!e.hoverData.selecting&&!e.hoverData.isOverThresholdDrag){i(qt,["click","tap","vclick"],ye,{x:dt[0],y:dt[1]});W=false;if(ye.timeStamp-H<=Ae.multiClickDebounceTime()){U&&clearTimeout(U);W=true;H=null;i(qt,["dblclick","dbltap","vdblclick"],ye,{x:dt[0],y:dt[1]})}else{U=setTimeout(function(){if(W)return;i(qt,["oneclick","onetap","voneclick"],ye,{x:dt[0],y:dt[1]})},Ae.multiClickDebounceTime());H=ye.timeStamp}}if(qt==null&&!e.dragData.didDrag&&!e.hoverData.selecting&&!e.hoverData.dragged&&!o(ye)){Ae.$(n).unselect(["tapunselect"]);if(kt.length>0){e.redrawHint("eles",true)}e.dragData.possibleDragElements=kt=Ae.collection()}if(Wt==qt&&!e.dragData.didDrag&&!e.hoverData.selecting){if(Wt!=null&&Wt._private.selectable){if(e.hoverData.dragging);else if(Ae.selectionType()==="additive"||_t){if(Wt.selected()){Wt.unselect(["tapunselect"])}else{Wt.select(["tapselect"])}}else{if(!_t){Ae.$(n).unmerge(Wt).unselect(["tapunselect"]);Wt.select(["tapselect"])}}e.redrawHint("eles",true)}}if(e.hoverData.selecting){var Kt=Ae.collection(e.getAllInBox(Oe[0],Oe[1],Oe[2],Oe[3]));e.redrawHint("select",true);if(Kt.length>0){e.redrawHint("eles",true)}Ae.emit(sn("boxend"));var mn=function lr(on){return on.selectable()&&!on.selected()};if(Ae.selectionType()==="additive"){Kt.emit(sn("box")).stdFilter(mn).select().emit(sn("boxselect"))}else{if(!_t){Ae.$(n).unmerge(Kt).unselect()}Kt.emit(sn("box")).stdFilter(mn).select().emit(sn("boxselect"))}e.redraw()}if(e.hoverData.dragging){e.hoverData.dragging=false;e.redrawHint("select",true);e.redrawHint("eles",true);e.redraw()}if(!Oe[4]){e.redrawHint("drag",true);e.redrawHint("eles",true);var At=qt&&qt.grabbed();x(kt);if(At){qt.emit(sn("freeon"));kt.emit(sn("free"));if(e.dragData.didDrag){qt.emit(sn("dragfreeon"));kt.emit(sn("dragfree"))}}}}Oe[4]=0;e.hoverData.down=null;e.hoverData.cxtStarted=false;e.hoverData.draggingEles=false;e.hoverData.selecting=false;e.hoverData.isOverThresholdDrag=false;e.dragData.didDrag=false;e.hoverData.dragged=false;e.hoverData.dragDelta=[];e.hoverData.mdownPos=null;e.hoverData.mdownGPos=null;e.hoverData.which=null},false);var $=[];var K=4;var X;var j=1e5;var te=function Me(ye,Ne){for(var Ae=0;Ae=K){var dt=$;X=te(dt,5);if(!X){var Oe=Math.abs(dt[0]);X=J(dt)&&Oe>5}if(X){for(var Wt=0;Wt5){Ae=Tet(Ae)*5}Sn=Ae/-250;if(X){Sn/=j;Sn*=3}Sn=Sn*e.wheelSensitivity;var Kt=ye.deltaMode===1;if(Kt){Sn*=33}var mn=kt.zoom()*Math.pow(10,Sn);if(ye.type==="gesturechange"){mn=e.gestureStartZoom*ye.scale}kt.zoom({level:mn,renderedPosition:{x:Jt[0],y:Jt[1]}});kt.emit({type:ye.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:ye,position:{x:sn[0],y:sn[1]}})}};e.registerBinding(e.container,"wheel",oe,true);e.registerBinding(t,"scroll",function Me(ye){e.scrollingPage=true;clearTimeout(e.scrollingPageTimeout);e.scrollingPageTimeout=setTimeout(function(){e.scrollingPage=false},250)},true);e.registerBinding(e.container,"gesturestart",function Me(ye){e.gestureStartZoom=e.cy.zoom();if(!e.hasTouchStarted){ye.preventDefault()}},true);e.registerBinding(e.container,"gesturechange",function(Me){if(!e.hasTouchStarted){oe(Me)}},true);e.registerBinding(e.container,"mouseout",function Me(ye){var Ne=e.projectIntoViewport(ye.clientX,ye.clientY);e.cy.emit({originalEvent:ye,type:"mouseout",position:{x:Ne[0],y:Ne[1]}})},false);e.registerBinding(e.container,"mouseover",function Me(ye){var Ne=e.projectIntoViewport(ye.clientX,ye.clientY);e.cy.emit({originalEvent:ye,type:"mouseover",position:{x:Ne[0],y:Ne[1]}})},false);var se,re,ce,ue;var xe,be;var Ie,he;var ve,ge;var Ve,Le;var $e;var Ee=function Me(ye,Ne,Ae,dt){return Math.sqrt((Ae-ye)*(Ae-ye)+(dt-Ne)*(dt-Ne))};var tt=function Me(ye,Ne,Ae,dt){return(Ae-ye)*(Ae-ye)+(dt-Ne)*(dt-Ne)};var yt;e.registerBinding(e.container,"touchstart",yt=function Me(ye){e.hasTouchStarted=true;if(!O(ye)){return}_();e.touchData.capture=true;e.data.bgActivePosistion=void 0;var Ne=e.cy;var Ae=e.touchData.now;var dt=e.touchData.earlier;if(ye.touches[0]){var Oe=e.projectIntoViewport(ye.touches[0].clientX,ye.touches[0].clientY);Ae[0]=Oe[0];Ae[1]=Oe[1]}if(ye.touches[1]){var Oe=e.projectIntoViewport(ye.touches[1].clientX,ye.touches[1].clientY);Ae[2]=Oe[0];Ae[3]=Oe[1]}if(ye.touches[2]){var Oe=e.projectIntoViewport(ye.touches[2].clientX,ye.touches[2].clientY);Ae[4]=Oe[0];Ae[5]=Oe[1]}var Wt=function Er(vr){return{originalEvent:ye,type:vr,position:{x:Ae[0],y:Ae[1]}}};if(ye.touches[1]){e.touchData.singleTouchMoved=true;x(e.dragData.touchDragEles);var kt=e.findContainerClientCoords();ve=kt[0];ge=kt[1];Ve=kt[2];Le=kt[3];se=ye.touches[0].clientX-ve;re=ye.touches[0].clientY-ge;ce=ye.touches[1].clientX-ve;ue=ye.touches[1].clientY-ge;$e=0<=se&&se<=Ve&&0<=ce&&ce<=Ve&&0<=re&&re<=Le&&0<=ue&&ue<=Le;var qt=Ne.pan();var _t=Ne.zoom();xe=Ee(se,re,ce,ue);be=tt(se,re,ce,ue);Ie=[(se+ce)/2,(re+ue)/2];he=[(Ie[0]-qt.x)/_t,(Ie[1]-qt.y)/_t];var sn=200;var Jt=sn*sn;if(be=1){var cr=e.touchData.startPosition=[null,null,null,null,null,null];for(var Hr=0;Hr=e.touchTapThreshold2}if(Ne&&e.touchData.cxt){ye.preventDefault();var Hr=ye.touches[0].clientX-ve,Mr=ye.touches[0].clientY-ge;var Er=ye.touches[1].clientX-ve,vr=ye.touches[1].clientY-ge;var Yr=tt(Hr,Mr,Er,vr);var nt=Yr/be;var Rr=150;var Xr=Rr*Rr;var dr=1.5;var rn=dr*dr;if(nt>=rn||Yr>=Xr){e.touchData.cxt=false;e.data.bgActivePosistion=void 0;e.redrawHint("select",true);var St=_t("cxttapend");if(e.touchData.start){e.touchData.start.unactivate().emit(St);e.touchData.start=null}else{dt.emit(St)}}}if(Ne&&e.touchData.cxt){var St=_t("cxtdrag");e.data.bgActivePosistion=void 0;e.redrawHint("select",true);if(e.touchData.start){e.touchData.start.emit(St)}else{dt.emit(St)}if(e.touchData.start){e.touchData.start._private.grabbed=false}e.touchData.cxtDragged=true;var Ut=e.findNearestElement(Oe[0],Oe[1],true,true);if(!e.touchData.cxtOver||Ut!==e.touchData.cxtOver){if(e.touchData.cxtOver){e.touchData.cxtOver.emit(_t("cxtdragout"))}e.touchData.cxtOver=Ut;if(Ut){Ut.emit(_t("cxtdragover"))}}}else if(Ne&&ye.touches[2]&&dt.boxSelectionEnabled()){ye.preventDefault();e.data.bgActivePosistion=void 0;this.lastThreeTouch=+new Date;if(!e.touchData.selecting){dt.emit(_t("boxstart"))}e.touchData.selecting=true;e.touchData.didSelect=true;Ae[4]=1;if(!Ae||Ae.length===0||Ae[0]===void 0){Ae[0]=(Oe[0]+Oe[2]+Oe[4])/3;Ae[1]=(Oe[1]+Oe[3]+Oe[5])/3;Ae[2]=(Oe[0]+Oe[2]+Oe[4])/3+1;Ae[3]=(Oe[1]+Oe[3]+Oe[5])/3+1}else{Ae[2]=(Oe[0]+Oe[2]+Oe[4])/3;Ae[3]=(Oe[1]+Oe[3]+Oe[5])/3}e.redrawHint("select",true);e.redraw()}else if(Ne&&ye.touches[1]&&!e.touchData.didSelect&&dt.zoomingEnabled()&&dt.panningEnabled()&&dt.userZoomingEnabled()&&dt.userPanningEnabled()){ye.preventDefault();e.data.bgActivePosistion=void 0;e.redrawHint("select",true);var Pt=e.dragData.touchDragEles;if(Pt){e.redrawHint("drag",true);for(var an=0;an0&&!e.hoverData.draggingEles&&!e.swipePanning&&e.data.bgActivePosistion!=null){e.data.bgActivePosistion=void 0;e.redrawHint("select",true);e.redraw()}},false);var ct;e.registerBinding(t,"touchcancel",ct=function Me(ye){var Ne=e.touchData.start;e.touchData.capture=false;if(Ne){Ne.unactivate()}});var Ge,it,bt,He;e.registerBinding(t,"touchend",Ge=function Me(ye){var Ne=e.touchData.start;var Ae=e.touchData.capture;if(Ae){if(ye.touches.length===0){e.touchData.capture=false}ye.preventDefault()}else{return}var dt=e.selection;e.swipePanning=false;e.hoverData.draggingEles=false;var Oe=e.cy;var Wt=Oe.zoom();var kt=e.touchData.now;var qt=e.touchData.earlier;if(ye.touches[0]){var _t=e.projectIntoViewport(ye.touches[0].clientX,ye.touches[0].clientY);kt[0]=_t[0];kt[1]=_t[1]}if(ye.touches[1]){var _t=e.projectIntoViewport(ye.touches[1].clientX,ye.touches[1].clientY);kt[2]=_t[0];kt[3]=_t[1]}if(ye.touches[2]){var _t=e.projectIntoViewport(ye.touches[2].clientX,ye.touches[2].clientY);kt[4]=_t[0];kt[5]=_t[1]}var sn=function Rr(Xr){return{originalEvent:ye,type:Xr,position:{x:kt[0],y:kt[1]}}};if(Ne){Ne.unactivate()}var Jt;if(e.touchData.cxt){Jt=sn("cxttapend");if(Ne){Ne.emit(Jt)}else{Oe.emit(Jt)}if(!e.touchData.cxtDragged){var Sn=sn("cxttap");if(Ne){Ne.emit(Sn)}else{Oe.emit(Sn)}}if(e.touchData.start){e.touchData.start._private.grabbed=false}e.touchData.cxt=false;e.touchData.start=null;e.redraw();return}if(!ye.touches[2]&&Oe.boxSelectionEnabled()&&e.touchData.selecting){e.touchData.selecting=false;var Kt=Oe.collection(e.getAllInBox(dt[0],dt[1],dt[2],dt[3]));dt[0]=void 0;dt[1]=void 0;dt[2]=void 0;dt[3]=void 0;dt[4]=0;e.redrawHint("select",true);Oe.emit(sn("boxend"));var mn=function Rr(Xr){return Xr.selectable()&&!Xr.selected()};Kt.emit(sn("box")).stdFilter(mn).select().emit(sn("boxselect"));if(Kt.nonempty()){e.redrawHint("eles",true)}e.redraw()}if(Ne!=null){Ne.unactivate()}if(ye.touches[2]){e.data.bgActivePosistion=void 0;e.redrawHint("select",true)}else if(ye.touches[1]);else if(ye.touches[0]);else if(!ye.touches[0]){e.data.bgActivePosistion=void 0;e.redrawHint("select",true);var At=e.dragData.touchDragEles;if(Ne!=null){var lr=Ne._private.grabbed;x(At);e.redrawHint("drag",true);e.redrawHint("eles",true);if(lr){Ne.emit(sn("freeon"));At.emit(sn("free"));if(e.dragData.didDrag){Ne.emit(sn("dragfreeon"));At.emit(sn("dragfree"))}}i(Ne,["touchend","tapend","vmouseup","tapdragout"],ye,{x:kt[0],y:kt[1]});Ne.unactivate();e.touchData.start=null}else{var on=e.findNearestElement(kt[0],kt[1],true,true);i(on,["touchend","tapend","vmouseup","tapdragout"],ye,{x:kt[0],y:kt[1]})}var cr=e.touchData.startPosition[0]-kt[0];var Hr=cr*cr;var Mr=e.touchData.startPosition[1]-kt[1];var Er=Mr*Mr;var vr=Hr+Er;var Yr=vr*Wt*Wt;if(!e.touchData.singleTouchMoved){if(!Ne){Oe.$(":selected").unselect(["tapunselect"])}i(Ne,["tap","vclick"],ye,{x:kt[0],y:kt[1]});it=false;if(ye.timeStamp-He<=Oe.multiClickDebounceTime()){bt&&clearTimeout(bt);it=true;He=null;i(Ne,["dbltap","vdblclick"],ye,{x:kt[0],y:kt[1]})}else{bt=setTimeout(function(){if(it)return;i(Ne,["onetap","voneclick"],ye,{x:kt[0],y:kt[1]})},Oe.multiClickDebounceTime());He=ye.timeStamp}}if(Ne!=null&&!e.dragData.didDrag&&Ne._private.selectable&&Yr0){return ce[0]}}return null};var g=Object.keys(h);for(var x=0;x0){return m}return ETn(o,a,t,n,r,i,s,l)},checkPoint:function e(t,n,r,i,o,a,s,l){l=l==="auto"?VL(i,o):l;var u=2*l;if(DR(t,n,this.points,a,s,i,o-u,[0,-1],r)){return true}if(DR(t,n,this.points,a,s,i-u,o,[0,-1],r)){return true}var d=i/2+2*r;var f=o/2+2*r;var h=[a-d,s-f,a-d,s,a+d,s,a+d,s-f];if(vx(t,n,h)){return true}if(yB(t,n,u,u,a+i/2-l,s+o/2-l,r)){return true}if(yB(t,n,u,u,a-i/2+l,s+o/2-l,r)){return true}return false}}};FR.registerNodeShapes=function(){var e=this.nodeShapes={};var t=this;this.generateEllipse();this.generatePolygon("triangle",J0(3,0));this.generateRoundPolygon("round-triangle",J0(3,0));this.generatePolygon("rectangle",J0(4,0));e["square"]=e["rectangle"];this.generateRoundRectangle();this.generateCutRectangle();this.generateBarrel();this.generateBottomRoundrectangle();{var n=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",n);this.generateRoundPolygon("round-diamond",n)}this.generatePolygon("pentagon",J0(5,0));this.generateRoundPolygon("round-pentagon",J0(5,0));this.generatePolygon("hexagon",J0(6,0));this.generateRoundPolygon("round-hexagon",J0(6,0));this.generatePolygon("heptagon",J0(7,0));this.generateRoundPolygon("round-heptagon",J0(7,0));this.generatePolygon("octagon",J0(8,0));this.generateRoundPolygon("round-octagon",J0(8,0));var r=new Array(20);{var i=XQe(5,0);var o=XQe(5,Math.PI/5);var a=.5*(3-Math.sqrt(5));a*=1.57;for(var s=0;s=t.deqFastCost*P){break}}else{if(u){if(C>=t.deqCost*m||C>=t.deqAvgCost*h){break}}else if(A>=t.deqNoDrawCost*zQe){break}}var L=t.deq(r,w,x);if(L.length>0){for(var I=0;I0){t.onDeqd(r,g);if(!u&&t.shouldRedraw(r,g,w,x)){o()}}};var s=t.priority||xet;i.beforeRender(a,s(r))}}};Uki=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:JCe;WL(this,e);this.idsByKey=new MR;this.keyForId=new MR;this.cachesByLvl=new MR;this.lvls=[];this.getKey=t;this.doesEleInvalidateKey=n}return YL(e,[{key:"getIdsFor",value:function t(n){if(n==null){sf("Can not get id list for null key")}var r=this.idsByKey;var i=this.idsByKey.get(n);if(!i){i=new iG;r.set(n,i)}return i}},{key:"addIdForKey",value:function t(n,r){if(n!=null){this.getIdsFor(n).add(r)}}},{key:"deleteIdForKey",value:function t(n,r){if(n!=null){this.getIdsFor(n)["delete"](r)}}},{key:"getNumberOfIdsForKey",value:function t(n){if(n==null){return 0}else{return this.getIdsFor(n).size}}},{key:"updateKeyMappingFor",value:function t(n){var r=n.id();var i=this.keyForId.get(r);var o=this.getKey(n);this.deleteIdForKey(i,r);this.addIdForKey(o,r);this.keyForId.set(r,o)}},{key:"deleteKeyMappingFor",value:function t(n){var r=n.id();var i=this.keyForId.get(r);this.deleteIdForKey(i,r);this.keyForId["delete"](r)}},{key:"keyHasChangedFor",value:function t(n){var r=n.id();var i=this.keyForId.get(r);var o=this.getKey(n);return i!==o}},{key:"isInvalid",value:function t(n){return this.keyHasChangedFor(n)||this.doesEleInvalidateKey(n)}},{key:"getCachesAt",value:function t(n){var r=this.cachesByLvl,i=this.lvls;var o=r.get(n);if(!o){o=new MR;r.set(n,o);i.push(n)}return o}},{key:"getCache",value:function t(n,r){return this.getCachesAt(r).get(n)}},{key:"get",value:function t(n,r){var i=this.getKey(n);var o=this.getCache(i,r);if(o!=null){this.updateKeyMappingFor(n)}return o}},{key:"getForCachedKey",value:function t(n,r){var i=this.keyForId.get(n.id());var o=this.getCache(i,r);return o}},{key:"hasCache",value:function t(n,r){return this.getCachesAt(r).has(n)}},{key:"has",value:function t(n,r){var i=this.getKey(n);return this.hasCache(i,r)}},{key:"setCache",value:function t(n,r,i){i.key=n;this.getCachesAt(r).set(n,i)}},{key:"set",value:function t(n,r,i){var o=this.getKey(n);this.setCache(o,r,i);this.updateKeyMappingFor(n)}},{key:"deleteCache",value:function t(n,r){this.getCachesAt(r)["delete"](n)}},{key:"delete",value:function t(n,r){var i=this.getKey(n);this.deleteCache(i,r)}},{key:"invalidateKey",value:function t(n){var r=this;this.lvls.forEach(function(i){return r.deleteCache(n,i)})}},{key:"invalidate",value:function t(n){var r=n.id();var i=this.keyForId.get(r);this.deleteKeyMappingFor(n);var o=this.doesEleInvalidateKey(n);if(o){this.invalidateKey(i)}return o||this.getNumberOfIdsForKey(i)===0}}])}();U_n=25;NCe=50;qCe=-4;cet=3;Rwn=7.99;Vki=8;$ki=1024;Gki=1024;Hki=1024;Wki=.2;Yki=.8;qki=10;Xki=.15;jki=.1;Kki=.9;Zki=.9;Jki=100;Qki=1;X$={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"};eRi=Ig({getKey:null,doesEleInvalidateKey:JCe,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:yTn,allowEdgeTxrCaching:true,allowParentTxrCaching:true});ate=function e(t,n){var r=this;r.renderer=t;r.onDequeues=[];var i=eRi(n);Ua(r,i);r.lookup=new Uki(i.getKey,i.doesEleInvalidateKey);r.setupDequeueing()};Up=ate.prototype;Up.reasons=X$;Up.getTextureQueue=function(e){var t=this;t.eleImgCaches=t.eleImgCaches||{};return t.eleImgCaches[e]=t.eleImgCaches[e]||[]};Up.getRetiredTextureQueue=function(e){var t=this;var n=t.eleImgCaches.retired=t.eleImgCaches.retired||{};var r=n[e]=n[e]||[];return r};Up.getElementQueue=function(){var e=this;var t=e.eleCacheQueue=e.eleCacheQueue||new Ste(function(n,r){return r.reqs-n.reqs});return t};Up.getElementKeyToQueue=function(){var e=this;var t=e.eleKeyToCacheQueue=e.eleKeyToCacheQueue||{};return t};Up.getElement=function(e,t,n,r,i){var o=this;var a=this.renderer;var s=a.cy.zoom();var l=this.lookup;if(!t||t.w===0||t.h===0||isNaN(t.w)||isNaN(t.h)||!e.visible()||e.removed()){return null}if(!o.allowEdgeTxrCaching&&e.isEdge()||!o.allowParentTxrCaching&&e.isParent()){return null}if(r==null){r=Math.ceil(_et(s*n))}if(r=Rwn||r>cet){return null}var u=Math.pow(2,r);var d=t.h*u;var f=t.w*u;var h=a.eleTextBiggerThanMin(e,u);if(!this.isVisible(e,h)){return null}var m=l.get(e,r);if(m&&m.invalidated){m.invalidated=false;m.texture.invalidatedWidth-=m.width}if(m){return m}var g;if(d<=U_n){g=U_n}else if(d<=NCe){g=NCe}else{g=Math.ceil(d/NCe)*NCe}if(d>Hki||f>Gki){return null}var x=o.getTextureQueue(g);var w=x[x.length-2];var _=function X(){return o.recycleTexture(g,f)||o.addTexture(g,f)};if(!w){w=x[x.length-1]}if(!w){w=_()}if(w.width-w.usedWidthr;W--){z=o.getElement(e,t,n,W,X$.downscale)}U()}else{o.queueElement(e,I.level-1);return I}}else{var H;if(!A&&!P&&!L){for(var $=r-1;$>=qCe;$--){var K=l.get(e,$);if(K){H=K;break}}}if(C(H)){o.queueElement(e,r);return H}w.context.translate(w.usedWidth,0);w.context.scale(u,u);this.drawElement(w.context,e,t,h,false);w.context.scale(1/u,1/u);w.context.translate(-w.usedWidth,0)}m={x:w.usedWidth,texture:w,level:r,scale:u,width:f,height:d,scaledLabelShown:h};w.usedWidth+=Math.ceil(f+Vki);w.eleCaches.push(m);l.set(e,r,m);o.checkTextureFullness(w);return m};Up.invalidateElements=function(e){for(var t=0;t=Wki*e.width){this.retireTexture(e)}};Up.checkTextureFullness=function(e){var t=this;var n=t.getTextureQueue(e.height);if(e.usedWidth/e.width>Yki&&e.fullnessChecks>=qki){UL(n,e)}else{e.fullnessChecks++}};Up.retireTexture=function(e){var t=this;var n=e.height;var r=t.getTextureQueue(n);var i=this.lookup;UL(r,e);e.retired=true;var o=e.eleCaches;for(var a=0;a=t){a.retired=false;a.usedWidth=0;a.invalidatedWidth=0;a.fullnessChecks=0;vet(a.eleCaches);a.context.setTransform(1,0,0,1,0,0);a.context.clearRect(0,0,a.width,a.height);UL(i,a);r.push(a);return a}}};Up.queueElement=function(e,t){var n=this;var r=n.getElementQueue();var i=n.getElementKeyToQueue();var o=this.getKey(e);var a=i[o];if(a){a.level=Math.max(a.level,t);a.eles.merge(e);a.reqs++;r.updateItem(a)}else{var s={eles:e.spawn().merge(e),level:t,reqs:1,key:o};r.push(s);i[o]=s}};Up.dequeue=function(e){var t=this;var n=t.getElementQueue();var r=t.getElementKeyToQueue();var i=[];var o=t.lookup;for(var a=0;a0){var s=n.pop();var l=s.key;var u=s.eles[0];var d=o.hasCache(u,s.level);r[l]=null;if(d){continue}i.push(s);var f=t.getBoundingBox(u);t.getElement(u,f,e,s.level,X$.dequeue)}else{break}}return i};Up.removeFromQueue=function(e){var t=this;var n=t.getElementQueue();var r=t.getElementKeyToQueue();var i=this.getKey(e);var o=r[i];if(o!=null){if(o.eles.length===1){o.reqs=bet;n.updateItem(o);n.pop();r[i]=null}else{o.eles.unmerge(e)}}};Up.onDequeue=function(e){this.onDequeues.push(e)};Up.offDequeue=function(e){UL(this.onDequeues,e)};Up.setupDequeueing=kwn.setupDequeueing({deqRedrawThreshold:Jki,deqCost:Xki,deqAvgCost:jki,deqNoDrawCost:Kki,deqFastCost:Zki,deq:function e(t,n,r){return t.dequeue(n,r)},onDeqd:function e(t,n){for(var r=0;r=nRi||n>aSe){return null}}r.validateLayersElesOrdering(n,e);var l=r.layersByLevel;var u=Math.pow(2,n);var d=l[n]=l[n]||[];var f;var h=r.levelIsComplete(n,e);var m;var g=function z(){var U=function K(X){r.validateLayersElesOrdering(X,e);if(r.levelIsComplete(X,e)){m=l[X];return true}};var W=function K(X){if(m){return}for(var j=n+X;lte<=j&&j<=aSe;j+=X){if(U(j)){break}}};W(1);W(-1);for(var H=d.length-1;H>=0;H--){var $=d[H];if($.invalid){UL(d,$)}}};if(!h){g()}else{return d}var x=function z(){if(!f){f=eb();for(var U=0;U$_n||$>$_n){return null}var K=H*$;if(K>uRi){return null}var X=r.makeLayer(f,n);if(W!=null){var j=d.indexOf(W)+1;d.splice(j,0,X)}else if(U.insert===void 0||U.insert){d.unshift(X)}return X};if(r.skipping&&!s){return null}var _=null;var C=e.length/tRi;var A=!s;for(var P=0;P=C||!wTn(_.bb,L.boundingBox())){_=w({insert:true,after:_});if(!_){return null}}if(m||A){r.queueLayer(_,L)}else{r.drawEleInLayer(_,L,n,t)}_.eles.push(L);N[n]=_}if(m){return m}if(A){return null}return d};Mg.getEleLevelForLayerLevel=function(e,t){return e};Mg.drawEleInLayer=function(e,t,n,r){var i=this;var o=this.renderer;var a=e.context;var s=t.boundingBox();if(s.w===0||s.h===0||!t.visible()){return}n=i.getEleLevelForLayerLevel(n,r);{o.setImgSmoothing(a,false)}{o.drawCachedElement(a,t,null,null,n,dRi)}{o.setImgSmoothing(a,true)}};Mg.levelIsComplete=function(e,t){var n=this;var r=n.layersByLevel[e];if(!r||r.length===0){return false}var i=0;for(var o=0;o0){return false}if(a.invalid){return false}i+=a.eles.length}if(i!==t.length){return false}return true};Mg.validateLayersElesOrdering=function(e,t){var n=this.layersByLevel[e];if(!n){return}for(var r=0;r0){t=true;break}}return t};Mg.invalidateElements=function(e){var t=this;if(e.length===0){return}t.lastInvalidationTime=LR();if(e.length===0||!t.haveLayers()){return}t.updateElementsInLayers(e,function n(r,i,o){t.invalidateLayer(r)})};Mg.invalidateLayer=function(e){this.lastInvalidationTime=LR();if(e.invalid){return}var t=e.level;var n=e.eles;var r=this.layersByLevel[t];UL(r,e);e.elesQueue=[];e.invalid=true;if(e.replacement){e.replacement.invalid=true}for(var i=0;i3&&arguments[3]!==void 0?arguments[3]:true;var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:true;var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:true;var a=this;var s=t._private.rscratch;if(o&&!t.visible()){return}if(s.badLine||s.allpts==null||isNaN(s.allpts[0])){return}var l;if(n){l=n;e.translate(-l.x1,-l.y1)}var u=o?t.pstyle("opacity").value:1;var d=o?t.pstyle("line-opacity").value:1;var f=t.pstyle("curve-style").value;var h=t.pstyle("line-style").value;var m=t.pstyle("width").pfValue;var g=t.pstyle("line-cap").value;var x=t.pstyle("line-outline-width").value;var w=t.pstyle("line-outline-color").value;var _=u*d;var C=u*d;var A=function K(){var X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_;if(f==="straight-triangle"){a.eleStrokeStyle(e,t,X);a.drawEdgeTrianglePath(t,e,s.allpts)}else{e.lineWidth=m;e.lineCap=g;a.eleStrokeStyle(e,t,X);a.drawEdgePath(t,e,s.allpts,h);e.lineCap="butt"}};var P=function K(){var X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_;e.lineWidth=m+x;e.lineCap=g;if(x>0){a.colorStrokeStyle(e,w[0],w[1],w[2],X)}else{e.lineCap="butt";return}if(f==="straight-triangle"){a.drawEdgeTrianglePath(t,e,s.allpts)}else{a.drawEdgePath(t,e,s.allpts,h);e.lineCap="butt"}};var L=function K(){if(!i){return}a.drawEdgeOverlay(e,t)};var I=function K(){if(!i){return}a.drawEdgeUnderlay(e,t)};var N=function K(){var X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:C;a.drawArrowheads(e,t,X)};var O=function K(){a.drawElementText(e,t,null,r)};e.lineJoin="round";var z=t.pstyle("ghost").value==="yes";if(z){var U=t.pstyle("ghost-offset-x").pfValue;var W=t.pstyle("ghost-offset-y").pfValue;var H=t.pstyle("ghost-opacity").value;var $=_*H;e.translate(U,W);A($);N($);e.translate(-U,-W)}else{P()}I();A();N();L();O();if(n){e.translate(l.x1,l.y1)}};Mwn=function e(t){if(!["overlay","underlay"].includes(t)){throw new Error("Invalid state")}return function(n,r){if(!r.visible()){return}var i=r.pstyle("".concat(t,"-opacity")).value;if(i===0){return}var o=this;var a=o.usePaths();var s=r._private.rscratch;var l=r.pstyle("".concat(t,"-padding")).pfValue;var u=2*l;var d=r.pstyle("".concat(t,"-color")).value;n.lineWidth=u;if(s.edgeType==="self"&&!a){n.lineCap="butt"}else{n.lineCap="round"}o.colorStrokeStyle(n,d[0],d[1],d[2],i);o.drawEdgePath(r,n,s.allpts,"solid")}};NR.drawEdgeOverlay=Mwn("overlay");NR.drawEdgeUnderlay=Mwn("underlay");NR.drawEdgePath=function(e,t,n,r){var i=e._private.rscratch;var o=t;var a;var s=false;var l=this.usePaths();var u=e.pstyle("line-dash-pattern").pfValue;var d=e.pstyle("line-dash-offset").pfValue;if(l){var f=n.join("$");var h=i.pathCacheKey&&i.pathCacheKey===f;if(h){a=t=i.pathCache;s=true}else{a=t=new Path2D;i.pathCacheKey=f;i.pathCache=a}}if(o.setLineDash){switch(r){case"dotted":o.setLineDash([1,1]);break;case"dashed":o.setLineDash(u);o.lineDashOffset=d;break;case"solid":o.setLineDash([]);break}}if(!s&&!i.badLine){if(t.beginPath){t.beginPath()}t.moveTo(n[0],n[1]);switch(i.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var m=2;m+35&&arguments[5]!==void 0?arguments[5]:true;var a=this;if(r==null){if(o&&!a.eleTextBiggerThanMin(t)){return}}else if(r===false){return}if(t.isNode()){var s=t.pstyle("label");if(!s||!s.value){return}var l=a.getLabelJustification(t);var u=t.pstyle("text-metrics").strValue==="glyph";e.textAlign=l;e.textBaseline=u?"alphabetic":"bottom"}else{var d=t.element()._private.rscratch.badLine;var f=t.pstyle("label");var h=t.pstyle("source-label");var m=t.pstyle("target-label");if(d||(!f||!f.value)&&(!h||!h.value)&&(!m||!m.value)){return}e.textAlign="center";e.textBaseline="bottom"}var g=!n;var x;if(n){x=n;e.translate(-x.x1,-x.y1)}if(i==null){a.drawText(e,t,null,g,o);if(t.isEdge()){a.drawText(e,t,"source",g,o);a.drawText(e,t,"target",g,o)}}else{a.drawText(e,t,i,g,o)}if(n){e.translate(x.x1,x.y1)}};EB.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:true;var r=t.pstyle("font-style").strValue;var i=t.pstyle("font-size").pfValue+"px";var o=t.pstyle("font-family").strValue;var a=t.pstyle("font-weight").strValue;var s=n?t.effectiveOpacity()*t.pstyle("text-opacity").value:1;var l=t.pstyle("text-outline-opacity").value*s;var u=t.pstyle("color").value;var d=t.pstyle("text-outline-color").value;e.font=r+" "+a+" "+i+" "+o;e.lineJoin="round";this.colorFillStyle(e,u[0],u[1],u[2],s);this.colorStrokeStyle(e,d[0],d[1],d[2],l)};EB.getTextAngle=function(e,t){var n;var r=e._private;var i=r.rscratch;var o=t?t+"-":"";var a=e.pstyle(o+"text-rotation");if(a.strValue==="autorotate"){var s=Q0(i,"labelAngle",t);n=e.isEdge()?s:0}else if(a.strValue==="none"){n=0}else{n=a.pfValue}return n};EB.drawText=function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:true;var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:true;var o=t._private;var a=o.rscratch;var s=i?t.effectiveOpacity():1;if(i&&(s===0||t.pstyle("text-opacity").value===0)){return}if(n==="main"){n=null}var l=Q0(a,"labelX",n);var u=Q0(a,"labelY",n);var d,f;var h=this.getLabelText(t,n);if(h!=null&&h!==""&&!isNaN(l)&&!isNaN(u)){this.setupTextStyle(e,t,i);var m=n?n+"-":"";var g=Q0(a,"labelWidth",n);var x=Q0(a,"labelHeight",n);var w=Q0(a,"labelActualDescent",n);var _=t.pstyle(m+"text-margin-x").pfValue;var C=t.pstyle(m+"text-margin-y").pfValue;var A=t.isEdge();var P=t.pstyle("text-halign").value;var L=t.pstyle("text-valign").value;if(A){P="center";L="center"}l+=_;u+=C;var I;if(!r){I=0}else{I=this.getTextAngle(t,n)}if(I!==0){d=l;f=u;e.translate(d,f);e.rotate(I);l=0;u=0}var N=nG(P);var O=rG(L);switch(O){case"top":break;case"center":u+=x/2;break;case"bottom":u+=x;break}var z=t.pstyle("text-background-opacity").value;var U=t.pstyle("text-border-opacity").value;var W=t.pstyle("text-border-width").pfValue;var H=t.pstyle("text-background-padding").pfValue;var $=t.pstyle("text-background-shape").strValue;var K=$==="round-rectangle"||$==="roundrectangle";var X=$==="circle";var j=2;if(z>0||W>0&&U>0){var te=e.fillStyle;var J=e.strokeStyle;var oe=e.lineWidth;var se=t.pstyle("text-background-color").value;var re=t.pstyle("text-border-color").value;var ce=t.pstyle("text-border-style").value;var ue=z>0;var xe=W>0&&U>0;var be=l-H;switch(N){case"left":be-=g;break;case"center":be-=g/2;break}var Ie=u-x-H;var he=g+2*H;var ve=x+2*H;if(ue){e.fillStyle="rgba(".concat(se[0],",").concat(se[1],",").concat(se[2],",").concat(z*s,")")}if(xe){e.strokeStyle="rgba(".concat(re[0],",").concat(re[1],",").concat(re[2],",").concat(U*s,")");e.lineWidth=W;if(e.setLineDash){switch(ce){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=W/4;e.setLineDash([]);break;case"solid":default:e.setLineDash([]);break}}}if(K){e.beginPath();Y_n(e,be,Ie,he,ve,j)}else if(X){e.beginPath();TRi(e,be,Ie,he,ve)}else{e.beginPath();e.rect(be,Ie,he,ve)}if(ue)e.fill();if(xe)e.stroke();if(xe&&ce==="double"){var ge=W/2;e.beginPath();if(K){Y_n(e,be+ge,Ie+ge,he-2*ge,ve-2*ge,j)}else{e.rect(be+ge,Ie+ge,he-2*ge,ve-2*ge)}e.stroke()}e.fillStyle=te;e.strokeStyle=J;e.lineWidth=oe;if(e.setLineDash)e.setLineDash([])}var Ve=2*t.pstyle("text-outline-width").pfValue;if(Ve>0){e.lineWidth=Ve}u-=w;if(t.pstyle("text-wrap").value==="wrap"){var Le=Q0(a,"labelWrapCachedLines",n);var $e=Q0(a,"labelLineHeight",n);var Ee=g/2;var tt=this.getLabelJustification(t);if(tt==="auto");else if(N==="left"){if(tt==="left"){l+=-g}else if(tt==="center"){l+=-Ee}}else if(N==="center"){if(tt==="left"){l+=-Ee}else if(tt==="right"){l+=Ee}}else if(N==="right"){if(tt==="center"){l+=Ee}else if(tt==="right"){l+=g}}switch(O){case"top":u-=(Le.length-1)*$e;break;case"center":case"bottom":u-=(Le.length-1)*$e;break}for(var yt=0;yt0){e.strokeText(Le[yt],l,u)}e.fillText(Le[yt],l,u);u+=$e}}else{if(Ve>0){e.strokeText(h,l,u)}e.fillText(h,l,u)}if(I!==0){e.rotate(-I);e.translate(-d,-f)}}};XL={};XL.drawNode=function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:true;var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:true;var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:true;var a=this;var s,l;var u=t._private;var d=u.rscratch;var f=t.position();if(!so(f.x)||!so(f.y)){return}if(o&&!t.visible()){return}var h=o?t.effectiveOpacity():1;var m=a.usePaths();var g;var x=false;var w=t.padding();s=t.width()+2*w;l=t.height()+2*w;var _;if(n){_=n;e.translate(-_.x1,-_.y1)}var C=t.pstyle("background-image");var A=C.value;var P=new Array(A.length);var L=new Array(A.length);var I=0;for(var N=0;N0&&arguments[0]!==void 0?arguments[0]:$;a.eleFillStyle(e,t,ye)};var ge=function Me(){var ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:re;a.colorStrokeStyle(e,K[0],K[1],K[2],ye)};var Ve=function Me(){var ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:be;a.colorStrokeStyle(e,ue[0],ue[1],ue[2],ye)};var Le=function Me(ye,Ne,Ae,dt){var Oe=a.nodePathCache=a.nodePathCache||[];var Wt=gTn(Ae==="polygon"?Ae+","+dt.join(","):Ae,""+Ne,""+ye,""+he);var kt=Oe[Wt];var qt;var _t=false;if(kt!=null){qt=kt;_t=true;d.pathCache=qt}else{qt=new Path2D;Oe[Wt]=d.pathCache=qt}return{path:qt,cacheHit:_t}};var $e=t.pstyle("shape").strValue;var Ee=t.pstyle("shape-polygon-points").pfValue;if(m){e.translate(f.x,f.y);var tt=Le(s,l,$e,Ee);g=tt.path;x=tt.cacheHit}var yt=function Me(){if(!x){var ye=f;if(m){ye={x:0,y:0}}a.nodeShapes[a.getNodeShape(t)].draw(g||e,ye.x,ye.y,s,l,he,d)}if(m){e.fill(g)}else{e.fill()}};var mt=function Me(){var ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h;var Ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:true;var Ae=u.backgrounding;var dt=0;for(var Oe=0;Oe0&&arguments[0]!==void 0?arguments[0]:false;var Ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h;if(a.hasPie(t)){a.drawPie(e,t,Ne);if(ye){if(!m){a.nodeShapes[a.getNodeShape(t)].draw(e,f.x,f.y,s,l,he,d)}}}};var Ge=function Me(){var ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:false;var Ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h;if(a.hasStripe(t)){e.save();if(m){e.clip(d.pathCache)}else{a.nodeShapes[a.getNodeShape(t)].draw(e,f.x,f.y,s,l,he,d);e.clip()}a.drawStripe(e,t,Ne);e.restore();if(ye){if(!m){a.nodeShapes[a.getNodeShape(t)].draw(e,f.x,f.y,s,l,he,d)}}}};var it=function Me(){var ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h;var Ne=(W>0?W:-W)*ye;var Ae=W>0?0:255;if(W!==0){a.colorFillStyle(e,Ae,Ae,Ae,Ne);if(m){e.fill(g)}else{e.fill()}}};var bt=function Me(){if(H>0){e.lineWidth=H;e.lineCap=te;e.lineJoin=j;if(e.setLineDash){switch(X){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash(oe);e.lineDashOffset=se;break;case"solid":case"double":e.setLineDash([]);break}}if(J!=="center"){e.save();e.lineWidth*=2;if(J==="inside"){m?e.clip(g):e.clip()}else{var ye=new Path2D;ye.rect(-s/2-H,-l/2-H,s+2*H,l+2*H);ye.addPath(g);e.clip(ye,"evenodd")}m?e.stroke(g):e.stroke();e.restore()}else{m?e.stroke(g):e.stroke()}if(X==="double"){e.lineWidth=H/3;var Ne=e.globalCompositeOperation;e.globalCompositeOperation="destination-out";if(m){e.stroke(g)}else{e.stroke()}e.globalCompositeOperation=Ne}if(e.setLineDash){e.setLineDash([])}}};var He=function Me(){if(ce>0){e.lineWidth=ce;e.lineCap="butt";if(e.setLineDash){switch(xe){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([]);break}}var ye=f;if(m){ye={x:0,y:0}}var Ne=a.getNodeShape(t);var Ae=H;if(J==="inside")Ae=0;if(J==="outside")Ae*=2;var dt=(s+Ae+(ce+Ie))/s;var Oe=(l+Ae+(ce+Ie))/l;var Wt=s*dt;var kt=l*Oe;var qt=a.nodeShapes[Ne].points;var _t;if(m){var sn=Le(Wt,kt,Ne,qt);_t=sn.path}if(Ne==="ellipse"){a.drawEllipsePath(_t||e,ye.x,ye.y,Wt,kt)}else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(Ne)){var Jt=0;var Sn=0;var Kt=0;if(Ne==="round-diamond"){Jt=(Ae+Ie+ce)*1.4}else if(Ne==="round-heptagon"){Jt=(Ae+Ie+ce)*1.075;Kt=-(Ae/2+Ie+ce)/35}else if(Ne==="round-hexagon"){Jt=(Ae+Ie+ce)*1.12}else if(Ne==="round-pentagon"){Jt=(Ae+Ie+ce)*1.13;Kt=-(Ae/2+Ie+ce)/15}else if(Ne==="round-tag"){Jt=(Ae+Ie+ce)*1.12;Sn=(Ae/2+ce+Ie)*.07}else if(Ne==="round-triangle"){Jt=(Ae+Ie+ce)*(Math.PI/2);Kt=-(Ae+Ie/2+ce)/Math.PI}if(Jt!==0){dt=(s+Jt)/s;Wt=s*dt;if(!["round-hexagon","round-tag"].includes(Ne)){Oe=(l+Jt)/l;kt=l*Oe}}he=he==="auto"?STn(Wt,kt):he;var mn=Wt/2;var At=kt/2;var lr=he+(Ae+ce+Ie)/2;var on=new Array(qt.length/2);var cr=new Array(qt.length/2);for(var Hr=0;Hr0){i=i||r.position();if(o==null||a==null){var m=r.padding();o=r.width()+2*m;a=r.height()+2*m}s.colorFillStyle(n,d[0],d[1],d[2],u);s.nodeShapes[f].draw(n,i.x,i.y,o+l*2,a+l*2,h);n.fill()}}};XL.drawNodeOverlay=Lwn("overlay");XL.drawNodeUnderlay=Lwn("underlay");XL.hasPie=function(e){e=e[0];return e._private.hasPie};XL.hasStripe=function(e){e=e[0];return e._private.hasStripe};XL.drawPie=function(e,t,n,r){t=t[0];r=r||t.position();var i=t.cy().style();var o=t.pstyle("pie-size");var a=t.pstyle("pie-hole");var s=t.pstyle("pie-start-angle").pfValue;var l=r.x;var u=r.y;var d=t.width();var f=t.height();var h=Math.min(d,f)/2;var m;var g=0;var x=this.usePaths();if(x){l=0;u=0}if(o.units==="%"){h=h*o.pfValue}else if(o.pfValue!==void 0){h=o.pfValue/2}if(a.units==="%"){m=h*a.pfValue}else if(a.pfValue!==void 0){m=a.pfValue/2}if(m>=h){return}for(var w=1;w<=i.pieBackgroundN;w++){var _=t.pstyle("pie-"+w+"-background-size").value;var C=t.pstyle("pie-"+w+"-background-color").value;var A=t.pstyle("pie-"+w+"-background-opacity").value*n;var P=_/100;if(P+g>1){P=1-g}var L=1.5*Math.PI+2*Math.PI*g;L+=s;var I=2*Math.PI*P;var N=L+I;if(_===0||g>=1||g+P>1){continue}if(m===0){e.beginPath();e.moveTo(l,u);e.arc(l,u,h,L,N);e.closePath()}else{e.beginPath();e.arc(l,u,h,L,N);e.arc(l,u,m,N,L,true);e.closePath()}this.colorFillStyle(e,C[0],C[1],C[2],A);e.fill();g+=P}};XL.drawStripe=function(e,t,n,r){t=t[0];r=r||t.position();var i=t.cy().style();var o=r.x;var a=r.y;var s=t.width();var l=t.height();var u=0;var d=this.usePaths();e.save();var f=t.pstyle("stripe-direction").value;var h=t.pstyle("stripe-size");switch(f){case"vertical":break;case"righward":e.rotate(-Math.PI/2);break}var m=s;var g=l;if(h.units==="%"){m=m*h.pfValue;g=g*h.pfValue}else if(h.pfValue!==void 0){m=h.pfValue;g=h.pfValue}if(d){o=0;a=0}a-=m/2;o-=g/2;for(var x=1;x<=i.stripeBackgroundN;x++){var w=t.pstyle("stripe-"+x+"-background-size").value;var _=t.pstyle("stripe-"+x+"-background-color").value;var C=t.pstyle("stripe-"+x+"-background-opacity").value*n;var A=w/100;if(A+u>1){A=1-u}if(w===0||u>=1||u+A>1){continue}e.beginPath();e.rect(o,a+g*u,m,g*A);e.closePath();this.colorFillStyle(e,_[0],_[1],_[2],C);e.fill();u+=A}e.restore()};tb={};wRi=100;tb.getPixelRatio=function(){var e=this.data.contexts[0];if(this.forcedPixelRatio!=null){return this.forcedPixelRatio}var t=this.cy.window();var n=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(t.devicePixelRatio||1)/n};tb.paintCache=function(e){var t=this.paintCaches=this.paintCaches||[];var n=true;var r;for(var i=0;it.minMbLowQualFrames){t.motionBlurPxRatio=t.mbPxRBlurry}}if(t.clearingMotionBlur){t.motionBlurPxRatio=1}if(t.textureDrawLastFrame&&!f){d[t.NODE]=true;d[t.SELECT_BOX]=true}var C=n.style();var A=n.zoom();var P=a!==void 0?a:A;var L=n.pan();var I={x:L.x,y:L.y};var N={zoom:A,pan:{x:L.x,y:L.y}};var O=t.prevViewport;var z=O===void 0||N.zoom!==O.zoom||N.pan.x!==O.pan.x||N.pan.y!==O.pan.y;if(!z&&!(x&&!g)){t.motionBlurPxRatio=1}if(s){I=s}P*=l;I.x*=l;I.y*=l;var U=t.getCachedZSortedEles();function W(ge,Ve,Le,$e,Ee){var tt=ge.globalCompositeOperation;ge.globalCompositeOperation="destination-out";t.colorFillStyle(ge,255,255,255,t.motionBlurTransparency);ge.fillRect(Ve,Le,$e,Ee);ge.globalCompositeOperation=tt}function H(ge,Ve){var Le,$e,Ee,tt;if(!t.clearingMotionBlur&&(ge===u.bufferContexts[t.MOTIONBLUR_BUFFER_NODE]||ge===u.bufferContexts[t.MOTIONBLUR_BUFFER_DRAG])){Le={x:L.x*m,y:L.y*m};$e=A*m;Ee=t.canvasWidth*m;tt=t.canvasHeight*m}else{Le=I;$e=P;Ee=t.canvasWidth;tt=t.canvasHeight}ge.setTransform(1,0,0,1,0,0);if(Ve==="motionBlur"){W(ge,0,0,Ee,tt)}else if(!r&&(Ve===void 0||Ve)){ge.clearRect(0,0,Ee,tt)}if(!i){ge.translate(Le.x,Le.y);ge.scale($e,$e)}if(s){ge.translate(s.x,s.y)}if(a){ge.scale(a,a)}}if(!f){t.textureDrawLastFrame=false}if(f){t.textureDrawLastFrame=true;if(!t.textureCache){t.textureCache={};t.textureCache.bb=n.mutableElements().boundingBox();t.textureCache.texture=t.data.bufferCanvases[t.TEXTURE_BUFFER];var $=t.data.bufferContexts[t.TEXTURE_BUFFER];$.setTransform(1,0,0,1,0,0);$.clearRect(0,0,t.canvasWidth*t.textureMult,t.canvasHeight*t.textureMult);t.render({forcedContext:$,drawOnlyNodeLayer:true,forcedPxRatio:l*t.textureMult});var N=t.textureCache.viewport={zoom:n.zoom(),pan:n.pan(),width:t.canvasWidth,height:t.canvasHeight};N.mpan={x:(0-N.pan.x)/N.zoom,y:(0-N.pan.y)/N.zoom}}d[t.DRAG]=false;d[t.NODE]=false;var K=u.contexts[t.NODE];var X=t.textureCache.texture;var N=t.textureCache.viewport;K.setTransform(1,0,0,1,0,0);if(h){W(K,0,0,N.width,N.height)}else{K.clearRect(0,0,N.width,N.height)}var j=C.core("outside-texture-bg-color").value;var te=C.core("outside-texture-bg-opacity").value;t.colorFillStyle(K,j[0],j[1],j[2],te);K.fillRect(0,0,N.width,N.height);var A=n.zoom();H(K,false);K.clearRect(N.mpan.x,N.mpan.y,N.width/N.zoom/l,N.height/N.zoom/l);K.drawImage(X,N.mpan.x,N.mpan.y,N.width/N.zoom/l,N.height/N.zoom/l)}else if(t.textureOnViewport&&!r){t.textureCache=null}var J=n.extent();var oe=t.pinching||t.hoverData.dragging||t.swipePanning||t.data.wheelZooming||t.hoverData.draggingEles||t.cy.animated();var se=t.hideEdgesOnViewport&&oe;var re=[];re[t.NODE]=!d[t.NODE]&&h&&!t.clearedForMotionBlur[t.NODE]||t.clearingMotionBlur;if(re[t.NODE]){t.clearedForMotionBlur[t.NODE]=true}re[t.DRAG]=!d[t.DRAG]&&h&&!t.clearedForMotionBlur[t.DRAG]||t.clearingMotionBlur;if(re[t.DRAG]){t.clearedForMotionBlur[t.DRAG]=true}if(d[t.NODE]||i||o||re[t.NODE]){var ce=h&&!re[t.NODE]&&m!==1;var K=r||(ce?t.data.bufferContexts[t.MOTIONBLUR_BUFFER_NODE]:u.contexts[t.NODE]);var ue=h&&!ce?"motionBlur":void 0;H(K,ue);if(se){t.drawCachedNodes(K,U.nondrag,l,J)}else{t.drawLayeredElements(K,U.nondrag,l,J)}if(t.debug){t.drawDebugPoints(K,U.nondrag)}if(!i&&!h){d[t.NODE]=false}}if(!o&&(d[t.DRAG]||i||re[t.DRAG])){var ce=h&&!re[t.DRAG]&&m!==1;var K=r||(ce?t.data.bufferContexts[t.MOTIONBLUR_BUFFER_DRAG]:u.contexts[t.DRAG]);H(K,h&&!ce?"motionBlur":void 0);if(se){t.drawCachedNodes(K,U.drag,l,J)}else{t.drawCachedElements(K,U.drag,l,J)}if(t.debug){t.drawDebugPoints(K,U.drag)}if(!i&&!h){d[t.DRAG]=false}}this.drawSelectionRectangle(e,H);if(h&&m!==1){var xe=u.contexts[t.NODE];var be=t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_NODE];var Ie=u.contexts[t.DRAG];var he=t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_DRAG];var ve=function ge(Ve,Le,$e){Ve.setTransform(1,0,0,1,0,0);if($e||!_){Ve.clearRect(0,0,t.canvasWidth,t.canvasHeight)}else{W(Ve,0,0,t.canvasWidth,t.canvasHeight)}var Ee=m;Ve.drawImage(Le,0,0,t.canvasWidth*Ee,t.canvasHeight*Ee,0,0,t.canvasWidth,t.canvasHeight)};if(d[t.NODE]||re[t.NODE]){ve(xe,be,re[t.NODE]);d[t.NODE]=false}if(d[t.DRAG]||re[t.DRAG]){ve(Ie,he,re[t.DRAG]);d[t.DRAG]=false}}t.prevViewport=N;if(t.clearingMotionBlur){t.clearingMotionBlur=false;t.motionBlurCleared=true;t.motionBlur=true}if(h){t.motionBlurTimeout=setTimeout(function(){t.motionBlurTimeout=null;t.clearedForMotionBlur[t.NODE]=false;t.clearedForMotionBlur[t.DRAG]=false;t.motionBlur=false;t.clearingMotionBlur=!f;t.mbFrames=0;d[t.NODE]=true;d[t.DRAG]=true;t.redraw()},wRi)}if(!r){n.emit("render")}};tb.drawSelectionRectangle=function(e,t){var n=this;var r=n.cy;var i=n.data;var o=r.style();var a=e.drawOnlyNodeLayer;var s=e.drawAllLayers;var l=i.canvasNeedsRedraw;var u=e.forcedContext;if(n.showFps||!a&&l[n.SELECT_BOX]&&!s){var d=u||i.contexts[n.SELECT_BOX];t(d);if(n.selection[4]==1&&(n.hoverData.selecting||n.touchData.selecting)){var f=n.cy.zoom();var h=o.core("selection-box-border-width").value/f;d.lineWidth=h;d.fillStyle="rgba("+o.core("selection-box-color").value[0]+","+o.core("selection-box-color").value[1]+","+o.core("selection-box-color").value[2]+","+o.core("selection-box-opacity").value+")";d.fillRect(n.selection[0],n.selection[1],n.selection[2]-n.selection[0],n.selection[3]-n.selection[1]);if(h>0){d.strokeStyle="rgba("+o.core("selection-box-border-color").value[0]+","+o.core("selection-box-border-color").value[1]+","+o.core("selection-box-border-color").value[2]+","+o.core("selection-box-opacity").value+")";d.strokeRect(n.selection[0],n.selection[1],n.selection[2]-n.selection[0],n.selection[3]-n.selection[1])}}if(i.bgActivePosistion&&!n.hoverData.selecting){var f=n.cy.zoom();var m=i.bgActivePosistion;d.fillStyle="rgba("+o.core("active-bg-color").value[0]+","+o.core("active-bg-color").value[1]+","+o.core("active-bg-color").value[2]+","+o.core("active-bg-opacity").value+")";d.beginPath();d.arc(m.x,m.y,o.core("active-bg-size").pfValue/f,0,2*Math.PI);d.fill()}var g=n.lastRedrawTime;if(n.showFps&&g){g=Math.round(g);var x=Math.round(1e3/g);var w="1 frame = "+g+" ms = "+x+" fps";d.setTransform(1,0,0,1,0,0);d.fillStyle="rgba(255, 0, 0, 0.75)";d.strokeStyle="rgba(255, 0, 0, 0.75)";d.font="30px Arial";if(!tte){var _=d.measureText(w);tte=_.actualBoundingBoxAscent}d.fillText(w,0,tte);var C=60;d.strokeRect(0,tte+10,250,20);d.fillRect(0,tte+10,250*Math.min(x/C,1),20)}if(!s){l[n.SELECT_BOX]=false}}};X_n=typeof Float32Array!=="undefined"?Float32Array:Array;if(!Math.hypot)Math.hypot=function(){var e=0,t=arguments.length;while(t--){e+=arguments[t]*arguments[t]}return Math.sqrt(e)};BRi=function(){function e(t,n,r,i){WL(this,e);this.debugID=Math.floor(Math.random()*1e4);this.r=t;this.texSize=n;this.texRows=r;this.texHeight=Math.floor(n/r);this.enableWrapping=true;this.locked=false;this.texture=null;this.needsBuffer=true;this.freePointer={x:0,row:0};this.keyToLocation=new Map;this.canvas=i(t,n,n);this.scratch=i(t,n,this.texHeight,"scratch")}return YL(e,[{key:"lock",value:function t(){this.locked=true}},{key:"getKeys",value:function t(){return new Set(this.keyToLocation.keys())}},{key:"getScale",value:function t(n){var r=n.w,i=n.h;var o=this.texHeight,a=this.texSize;var s=o/i;var l=r*s;var u=i*s;if(l>a){s=a/r;l=r*s;u=i*s}return{scale:s,texW:l,texH:u}}},{key:"draw",value:function t(n,r,i){var o=this;if(this.locked)throw new Error("can't draw, atlas is locked");var a=this.texSize,s=this.texRows,l=this.texHeight;var u=this.getScale(r),d=u.scale,f=u.texW,h=u.texH;var m=function C(A,P){if(i&&P){var L=P.context;var I=A.x,N=A.row;var O=I;var z=l*N;L.save();L.translate(O,z);L.scale(d,d);i(L,r);L.restore()}};var g=[null,null];var x=function C(){m(o.freePointer,o.canvas);g[0]={x:o.freePointer.x,y:o.freePointer.row*l,w:f,h};g[1]={x:o.freePointer.x+f,y:o.freePointer.row*l,w:0,h};o.freePointer.x+=f;if(o.freePointer.x==a){o.freePointer.x=0;o.freePointer.row++}};var w=function C(){var A=o.scratch,P=o.canvas;A.clear();m({x:0,row:0},A);var L=a-o.freePointer.x;var I=f-L;var N=l;{var O=o.freePointer.x;var z=o.freePointer.row*l;var U=L;P.context.drawImage(A,0,0,U,N,O,z,U,N);g[0]={x:O,y:z,w:U,h}}{var W=L;var H=(o.freePointer.row+1)*l;var $=I;if(P){P.context.drawImage(A,W,0,$,N,0,H,$,N)}g[1]={x:0,y:H,w:$,h}}o.freePointer.x=I;o.freePointer.row++};var _=function C(){o.freePointer.x=0;o.freePointer.row++};if(this.freePointer.x+f<=a){x()}else if(this.freePointer.row>=s-1){return false}else if(this.freePointer.x===a){_();x()}else if(this.enableWrapping){w()}else{_();x()}this.keyToLocation.set(n,g);this.needsBuffer=true;return g}},{key:"getOffsets",value:function t(n){return this.keyToLocation.get(n)}},{key:"isEmpty",value:function t(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function t(n){if(this.locked)return false;var r=this.texSize,i=this.texRows;var o=this.getScale(n),a=o.texW;if(this.freePointer.x+a>r){return this.freePointer.row1&&arguments[1]!==void 0?arguments[1]:{},o=i.forceRedraw,a=o===void 0?false:o,s=i.filterEle,l=s===void 0?function(){return true}:s,u=i.filterType,d=u===void 0?function(){return true}:u;var f=false;var h=false;var m=_x(n),g;try{for(m.s();!(g=m.n()).done;){var x=g.value;if(l(x)){var w=_x(this.renderTypes.values()),_;try{var C=function A(){var P=_.value;var L=P.type;if(d(L)){var I=r.collections.get(P.collection);var N=P.getKey(x);var O=Array.isArray(N)?N:[N];if(a){O.forEach(function(H){return I.markKeyForGC(H)});h=true}else{var z=P.getID?P.getID(x):x.id();var U=r._key(L,z);var W=r.typeAndIdToKey.get(U);if(W!==void 0&&!RRi(O,W)){f=true;r.typeAndIdToKey["delete"](U);W.forEach(function(H){return I.markKeyForGC(H)})}}}};for(w.s();!(_=w.n()).done;){C()}}catch(A){w.e(A)}finally{w.f()}}}}catch(A){m.e(A)}finally{m.f()}if(h){this.gc();f=false}return f}},{key:"gc",value:function t(){var n=_x(this.collections.values()),r;try{for(n.s();!(r=n.n()).done;){var i=r.value;i.gc()}}catch(o){n.e(o)}finally{n.f()}}},{key:"getOrCreateAtlas",value:function t(n,r,i,o){var a=this.renderTypes.get(r);var s=this.collections.get(a.collection);var l=false;var u=s.draw(o,i,function(h){if(a.drawClipped){h.save();h.beginPath();h.rect(0,0,i.w,i.h);h.clip();a.drawElement(h,n,i,true,true);h.restore()}else{a.drawElement(h,n,i,true,true)}l=true});if(l){var d=a.getID?a.getID(n):n.id();var f=this._key(r,d);if(this.typeAndIdToKey.has(f)){this.typeAndIdToKey.get(f).push(o)}else{this.typeAndIdToKey.set(f,[o])}}return u}},{key:"getAtlasInfo",value:function t(n,r){var i=this;var o=this.renderTypes.get(r);var a=o.getKey(n);var s=Array.isArray(a)?a:[a];return s.map(function(l){var u=o.getBoundingBox(n,l);var d=i.getOrCreateAtlas(n,r,u,l);var f=d.getOffsets(l),h=np(f,2),m=h[0],g=h[1];return{atlas:d,tex:m,tex1:m,tex2:g,bb:u}})}},{key:"getDebugInfo",value:function t(){var n=[];var r=_x(this.collections),i;try{for(r.s();!(i=r.n()).done;){var o=np(i.value,2),a=o[0],s=o[1];var l=s.getCounts(),u=l.keyCount,d=l.atlasCount;n.push({type:a,keyCount:u,atlasCount:d})}}catch(f){r.e(f)}finally{r.f()}return n}}])}();$Ri=function(){function e(t){WL(this,e);this.globalOptions=t;this.atlasSize=t.webglTexSize;this.maxAtlasesPerBatch=t.webglTexPerBatch;this.batchAtlases=[]}return YL(e,[{key:"getMaxAtlasesPerBatch",value:function t(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function t(){return this.atlasSize}},{key:"getIndexArray",value:function t(){return Array.from({length:this.maxAtlasesPerBatch},function(n,r){return r})}},{key:"startBatch",value:function t(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function t(){return this.batchAtlases.length}},{key:"getAtlases",value:function t(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function t(n){if(this.batchAtlases.length===this.maxAtlasesPerBatch){return this.batchAtlases.includes(n)}return true}},{key:"getAtlasIndexForBatch",value:function t(n){var r=this.batchAtlases.indexOf(n);if(r<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch){throw new Error("cannot add more atlases to batch")}this.batchAtlases.push(n);r=this.batchAtlases.length-1}return r}}])}();GRi="\n float circleSD(vec2 p, float r) {\n return distance(vec2(0), p) - r; // signed distance\n }\n";HRi="\n float rectangleSD(vec2 p, vec2 b) {\n vec2 d = abs(p)-b;\n return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0);\n }\n";WRi="\n float roundRectangleSD(vec2 p, vec2 b, vec4 cr) {\n cr.xy = (p.x > 0.0) ? cr.xy : cr.zw;\n cr.x = (p.y > 0.0) ? cr.x : cr.y;\n vec2 q = abs(p) - b + cr.x;\n return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x;\n }\n";YRi="\n float ellipseSD(vec2 p, vec2 ab) {\n p = abs( p ); // symmetry\n\n // find root with Newton solver\n vec2 q = ab*(p-ab);\n float w = (q.x1.0) ? d : -d;\n }\n";cte={SCREEN:{name:"screen",screen:true},PICKING:{name:"picking",picking:true}};sSe={IGNORE:1,USE_BB:2};$Qe=0;Z_n=1;J_n=2;GQe=3;H$=4;OCe=5;nte=6;rte=7;qRi=function(){function e(t,n,r){WL(this,e);this.r=t;this.gl=n;this.maxInstances=r.webglBatchSize;this.atlasSize=r.webglTexSize;this.bgColor=r.bgColor;this.debug=r.webglDebug;this.batchDebugInfo=[];r.enableWrapping=true;r.createTextureCanvas=CRi;this.atlasManager=new VRi(t,r);this.batchManager=new $Ri(r);this.simpleShapeOptions=new Map;this.program=this._createShaderProgram(cte.SCREEN);this.pickingProgram=this._createShaderProgram(cte.PICKING);this.vao=this._createVAO()}return YL(e,[{key:"addAtlasCollection",value:function t(n,r){this.atlasManager.addAtlasCollection(n,r)}},{key:"addTextureAtlasRenderType",value:function t(n,r){this.atlasManager.addRenderType(n,r)}},{key:"addSimpleShapeRenderType",value:function t(n,r){this.simpleShapeOptions.set(n,r)}},{key:"invalidate",value:function t(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.type;var o=this.atlasManager;if(i){return o.invalidate(n,{filterType:function a(s){return s===i},forceRedraw:true})}else{return o.invalidate(n)}}},{key:"gc",value:function t(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function t(n){var r=this.gl;var i="#version 300 es\n precision highp float;\n\n uniform mat3 uPanZoomMatrix;\n uniform int uAtlasSize;\n \n // instanced\n in vec2 aPosition; // a vertex from the unit square\n \n in mat3 aTransform; // used to transform verticies, eg into a bounding box\n in int aVertType; // the type of thing we are rendering\n\n // the z-index that is output when using picking mode\n in vec4 aIndex;\n \n // For textures\n in int aAtlasId; // which shader unit/atlas to use\n in vec4 aTex; // x/y/w/h of texture in atlas\n\n // for edges\n in vec4 aPointAPointB;\n in vec4 aPointCPointD;\n in vec2 aLineWidth; // also used for node border width\n\n // simple shapes\n in vec4 aCornerRadius; // for round-rectangle [top-right, bottom-right, top-left, bottom-left]\n in vec4 aColor; // also used for edges\n in vec4 aBorderColor; // aLineWidth is used for border width\n\n // output values passed to the fragment shader\n out vec2 vTexCoord;\n out vec4 vColor;\n out vec2 vPosition;\n // flat values are not interpolated\n flat out int vAtlasId; \n flat out int vVertType;\n flat out vec2 vTopRight;\n flat out vec2 vBotLeft;\n flat out vec4 vCornerRadius;\n flat out vec4 vBorderColor;\n flat out vec2 vBorderWidth;\n flat out vec4 vIndex;\n \n void main(void) {\n int vid = gl_VertexID;\n vec2 position = aPosition; // TODO make this a vec3, simplifies some code below\n\n if(aVertType == ".concat($Qe,") {\n float texX = aTex.x; // texture coordinates\n float texY = aTex.y;\n float texW = aTex.z;\n float texH = aTex.w;\n\n if(vid == 1 || vid == 2 || vid == 4) {\n texX += texW;\n }\n if(vid == 2 || vid == 4 || vid == 5) {\n texY += texH;\n }\n\n float d = float(uAtlasSize);\n vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1\n\n gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);\n }\n else if(aVertType == ").concat(H$," || aVertType == ").concat(rte," \n || aVertType == ").concat(OCe," || aVertType == ").concat(nte,") { // simple shapes\n\n // the bounding box is needed by the fragment shader\n vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat\n vTopRight = (aTransform * vec3(1, 1, 1)).xy; // flat\n vPosition = (aTransform * vec3(position, 1)).xy; // will be interpolated\n\n // calculations are done in the fragment shader, just pass these along\n vColor = aColor;\n vCornerRadius = aCornerRadius;\n vBorderColor = aBorderColor;\n vBorderWidth = aLineWidth;\n\n gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);\n }\n else if(aVertType == ").concat(Z_n,") {\n vec2 source = aPointAPointB.xy;\n vec2 target = aPointAPointB.zw;\n\n // adjust the geometry so that the line is centered on the edge\n position.y = position.y - 0.5;\n\n // stretch the unit square into a long skinny rectangle\n vec2 xBasis = target - source;\n vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x));\n vec2 point = source + xBasis * position.x + yBasis * aLineWidth[0] * position.y;\n\n gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0);\n vColor = aColor;\n } \n else if(aVertType == ").concat(J_n,") {\n vec2 pointA = aPointAPointB.xy;\n vec2 pointB = aPointAPointB.zw;\n vec2 pointC = aPointCPointD.xy;\n vec2 pointD = aPointCPointD.zw;\n\n // adjust the geometry so that the line is centered on the edge\n position.y = position.y - 0.5;\n\n vec2 p0, p1, p2, pos;\n if(position.x == 0.0) { // The left side of the unit square\n p0 = pointA;\n p1 = pointB;\n p2 = pointC;\n pos = position;\n } else { // The right side of the unit square, use same approach but flip the geometry upside down\n p0 = pointD;\n p1 = pointC;\n p2 = pointB;\n pos = vec2(0.0, -position.y);\n }\n\n vec2 p01 = p1 - p0;\n vec2 p12 = p2 - p1;\n vec2 p21 = p1 - p2;\n\n // Find the normal vector.\n vec2 tangent = normalize(normalize(p12) + normalize(p01));\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n // Find the vector perpendicular to p0 -> p1.\n vec2 p01Norm = normalize(vec2(-p01.y, p01.x));\n\n // Determine the bend direction.\n float sigma = sign(dot(p01 + p21, normal));\n float width = aLineWidth[0];\n\n if(sign(pos.y) == -sigma) {\n // This is an intersecting vertex. Adjust the position so that there's no overlap.\n vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm);\n gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);\n } else {\n // This is a non-intersecting vertex. Treat it like a mitre join.\n vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm);\n gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);\n }\n\n vColor = aColor;\n } \n else if(aVertType == ").concat(GQe," && vid < 3) {\n // massage the first triangle into an edge arrow\n if(vid == 0)\n position = vec2(-0.15, -0.3);\n if(vid == 1)\n position = vec2( 0.0, 0.0);\n if(vid == 2)\n position = vec2( 0.15, -0.3);\n\n gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);\n vColor = aColor;\n }\n else {\n gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space\n }\n\n vAtlasId = aAtlasId;\n vVertType = aVertType;\n vIndex = aIndex;\n }\n ");var o=this.batchManager.getIndexArray();var a="#version 300 es\n precision highp float;\n\n // declare texture unit for each texture atlas in the batch\n ".concat(o.map(function(u){return"uniform sampler2D uTexture".concat(u,";")}).join("\n "),"\n\n uniform vec4 uBGColor;\n uniform float uZoom;\n\n in vec2 vTexCoord;\n in vec4 vColor;\n in vec2 vPosition; // model coordinates\n\n flat in int vAtlasId;\n flat in vec4 vIndex;\n flat in int vVertType;\n flat in vec2 vTopRight;\n flat in vec2 vBotLeft;\n flat in vec4 vCornerRadius;\n flat in vec4 vBorderColor;\n flat in vec2 vBorderWidth;\n\n out vec4 outColor;\n\n ").concat(GRi,"\n ").concat(HRi,"\n ").concat(WRi,"\n ").concat(YRi,"\n\n vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha\n return vec4( \n top.rgb + (bot.rgb * (1.0 - top.a)),\n top.a + (bot.a * (1.0 - top.a)) \n );\n }\n\n vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance\n // scale to the zoom level so that borders don't look blurry when zoomed in\n // note 1.5 is an aribitrary value chosen because it looks good\n return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d))); \n }\n\n void main(void) {\n if(vVertType == ").concat($Qe,") {\n // look up the texel from the texture unit\n ").concat(o.map(function(u){return"if(vAtlasId == ".concat(u,") outColor = texture(uTexture").concat(u,", vTexCoord);")}).join("\n else "),"\n } \n else if(vVertType == ").concat(GQe,") {\n // mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out';\n outColor = blend(vColor, uBGColor);\n outColor.a = 1.0; // make opaque, masks out line under arrow\n }\n else if(vVertType == ").concat(H$," && vBorderWidth == vec2(0.0)) { // simple rectangle with no border\n outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done\n }\n else if(vVertType == ").concat(H$," || vVertType == ").concat(rte," \n || vVertType == ").concat(OCe," || vVertType == ").concat(nte,") { // use SDF\n\n float outerBorder = vBorderWidth[0];\n float innerBorder = vBorderWidth[1];\n float borderPadding = outerBorder * 2.0;\n float w = vTopRight.x - vBotLeft.x - borderPadding;\n float h = vTopRight.y - vBotLeft.y - borderPadding;\n vec2 b = vec2(w/2.0, h/2.0); // half width, half height\n vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center\n\n float d; // signed distance\n if(vVertType == ").concat(H$,") {\n d = rectangleSD(p, b);\n } else if(vVertType == ").concat(rte," && w == h) {\n d = circleSD(p, b.x); // faster than ellipse\n } else if(vVertType == ").concat(rte,") {\n d = ellipseSD(p, b);\n } else {\n d = roundRectangleSD(p, b, vCornerRadius.wzyx);\n }\n\n // use the distance to interpolate a color to smooth the edges of the shape, doesn't need multisampling\n // we must smooth colors inwards, because we can't change pixels outside the shape's bounding box\n if(d > 0.0) {\n if(d > outerBorder) {\n discard;\n } else {\n outColor = distInterp(vBorderColor, vec4(0), d - outerBorder);\n }\n } else {\n if(d > innerBorder) {\n vec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor;\n vec4 innerBorderColor = blend(vBorderColor, vColor);\n outColor = distInterp(innerBorderColor, outerColor, d);\n } \n else {\n vec4 outerColor;\n if(innerBorder == 0.0 && outerBorder == 0.0) {\n outerColor = vec4(0);\n } else if(innerBorder == 0.0) {\n outerColor = vBorderColor;\n } else {\n outerColor = blend(vBorderColor, vColor);\n }\n outColor = distInterp(vColor, outerColor, d - innerBorder);\n }\n }\n }\n else {\n outColor = vColor;\n }\n\n ").concat(n.picking?"if(outColor.a == 0.0) discard;\n else outColor = vIndex;":"","\n }\n ");var s=ERi(r,i,a);s.aPosition=r.getAttribLocation(s,"aPosition");s.aIndex=r.getAttribLocation(s,"aIndex");s.aVertType=r.getAttribLocation(s,"aVertType");s.aTransform=r.getAttribLocation(s,"aTransform");s.aAtlasId=r.getAttribLocation(s,"aAtlasId");s.aTex=r.getAttribLocation(s,"aTex");s.aPointAPointB=r.getAttribLocation(s,"aPointAPointB");s.aPointCPointD=r.getAttribLocation(s,"aPointCPointD");s.aLineWidth=r.getAttribLocation(s,"aLineWidth");s.aColor=r.getAttribLocation(s,"aColor");s.aCornerRadius=r.getAttribLocation(s,"aCornerRadius");s.aBorderColor=r.getAttribLocation(s,"aBorderColor");s.uPanZoomMatrix=r.getUniformLocation(s,"uPanZoomMatrix");s.uAtlasSize=r.getUniformLocation(s,"uAtlasSize");s.uBGColor=r.getUniformLocation(s,"uBGColor");s.uZoom=r.getUniformLocation(s,"uZoom");s.uTextures=[];for(var l=0;l1&&arguments[1]!==void 0?arguments[1]:cte.SCREEN;this.panZoomMatrix=n;this.renderTarget=r;this.batchDebugInfo=[];this.wrappedCount=0;this.simpleCount=0;this.startBatch()}},{key:"startBatch",value:function t(){this.instanceCount=0;this.batchManager.startBatch()}},{key:"endFrame",value:function t(){this.endBatch()}},{key:"_isVisible",value:function t(n,r){if(n.visible()){if(r&&r.isVisible){return r.isVisible(n)}return true}return false}},{key:"drawTexture",value:function t(n,r,i){var o=this.atlasManager,a=this.batchManager;var s=o.getRenderTypeOpts(i);if(!this._isVisible(n,s)){return}if(n.isEdge()&&!this._isValidEdge(n)){return}if(this.renderTarget.picking&&s.getTexPickingMode){var l=s.getTexPickingMode(n);if(l===sSe.IGNORE){return}else if(l==sSe.USE_BB){this.drawPickingRectangle(n,r,i);return}}var u=o.getAtlasInfo(n,i);var d=_x(u),f;try{for(d.s();!(f=d.n()).done;){var h=f.value;var m=h.atlas,g=h.tex1,x=h.tex2;if(!a.canAddToCurrentBatch(m)){this.endBatch()}var w=a.getAtlasIndexForBatch(m);for(var _=0,C=[[g,true],[x,false]];_=this.maxInstances){this.endBatch()}}}}}catch(W){d.e(W)}finally{d.f()}}},{key:"setTransformMatrix",value:function t(n,r,i,o){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:true;var s=0;if(i.shapeProps&&i.shapeProps.padding){s=n.pstyle(i.shapeProps.padding).pfValue}if(o){var l=o.bb,u=o.tex1,d=o.tex2;var f=u.w/(u.w+d.w);if(!a){f=1-f}var h=this._getAdjustedBB(l,s,a,f);this._applyTransformMatrix(r,h,i,n)}else{var m=i.getBoundingBox(n);var g=this._getAdjustedBB(m,s,true,1);this._applyTransformMatrix(r,g,i,n)}}},{key:"_applyTransformMatrix",value:function t(n,r,i,o){var a,s;j_n(n);var l=i.getRotation?i.getRotation(o):0;if(l!==0){var u=i.getRotationPoint(o),d=u.x,f=u.y;XCe(n,n,[d,f]);K_n(n,n,l);var h=i.getRotationOffset(o);a=h.x+(r.xOffset||0);s=h.y+(r.yOffset||0)}else{a=r.x1;s=r.y1}XCe(n,n,[a,s]);uet(n,n,[r.w,r.h])}},{key:"_getAdjustedBB",value:function t(n,r,i,o){var a=n.x1,s=n.y1,l=n.w,u=n.h,d=n.yOffset;if(r){a-=r;s-=r;l+=2*r;u+=2*r}var f=0;var h=l*o;if(i&&o<1){l=h}else if(!i&&o<1){f=l-h;a+=f;l=h}return{x1:a,y1:s,w:l,h:u,xOffset:f,yOffset:d}}},{key:"drawPickingRectangle",value:function t(n,r,i){var o=this.atlasManager.getRenderTypeOpts(i);var a=this.instanceCount;this.vertTypeBuffer.getView(a)[0]=H$;var s=this.indexBuffer.getView(a);G$(r,s);var l=this.colorBuffer.getView(a);dB([0,0,0],1,l);var u=this.transformBuffer.getMatrixView(a);this.setTransformMatrix(n,u,o);this.simpleCount++;this.instanceCount++;if(this.instanceCount>=this.maxInstances){this.endBatch()}}},{key:"drawNode",value:function t(n,r,i){var o=this.simpleShapeOptions.get(i);if(!this._isVisible(n,o)){return}var a=o.shapeProps;var s=this._getVertTypeForShape(n,a.shape);if(s===void 0||o.isSimple&&!o.isSimple(n,this.renderTarget)){this.drawTexture(n,r,i);return}var l=this.instanceCount;this.vertTypeBuffer.getView(l)[0]=s;if(s===OCe||s===nte){var u=o.getBoundingBox(n);var d=this._getCornerRadius(n,a.radius,u);var f=this.cornerRadiusBuffer.getView(l);f[0]=d;f[1]=d;f[2]=d;f[3]=d;if(s===nte){f[0]=0;f[2]=0}}var h=this.indexBuffer.getView(l);G$(r,h);var m=this.renderTarget.picking?1:i==="node-body"?n.effectiveOpacity():1;var g=this.renderTarget.picking?1:n.pstyle(a.opacity).value*m;var x=n.pstyle(a.color).value;var w=this.colorBuffer.getView(l);dB(x,g,w);var _=this.lineWidthBuffer.getView(l);_[0]=0;_[1]=0;if(a.border){var C=n.pstyle("border-width").value;if(C>0){var A=n.pstyle("border-color").value;var P=m*n.pstyle("border-opacity").value;var L=this.borderColorBuffer.getView(l);dB(A,P,L);var I=n.pstyle("border-position").value;if(I==="inside"){_[0]=0;_[1]=-C}else if(I==="outside"){_[0]=C;_[1]=0}else{var N=C/2;_[0]=N;_[1]=-N}}}var O=this.transformBuffer.getMatrixView(l);this.setTransformMatrix(n,O,o);this.simpleCount++;this.instanceCount++;if(this.instanceCount>=this.maxInstances){this.endBatch()}}},{key:"_getVertTypeForShape",value:function t(n,r){var i=n.pstyle(r).value;switch(i){case"rectangle":return H$;case"ellipse":return rte;case"roundrectangle":case"round-rectangle":return OCe;case"bottom-round-rectangle":return nte;default:return void 0}}},{key:"_getCornerRadius",value:function t(n,r,i){var o=i.w,a=i.h;if(n.pstyle(r).value==="auto"){return VL(o,a)}else{var s=n.pstyle(r).pfValue;var l=o/2;var u=a/2;return Math.min(s,u,l)}}},{key:"drawEdgeArrow",value:function t(n,r,i){if(!n.visible()){return}var o=n._private.rscratch;var a,s,l;if(i==="source"){a=o.arrowStartX;s=o.arrowStartY;l=o.srcArrowAngle}else{a=o.arrowEndX;s=o.arrowEndY;l=o.tgtArrowAngle}if(isNaN(a)||a==null||isNaN(s)||s==null||isNaN(l)||l==null){return}var u=n.pstyle(i+"-arrow-shape").value;if(u==="none"){return}var d=n.pstyle(i+"-arrow-color").value;var f=n.pstyle("opacity").value;var h=n.pstyle("line-opacity").value;var m=f*h;var g=n.pstyle("width").pfValue;var x=n.pstyle("arrow-scale").value;var w=this.r.getArrowWidth(g,x);var _=this.instanceCount;var C=this.transformBuffer.getMatrixView(_);j_n(C);XCe(C,C,[a,s]);uet(C,C,[w,w]);K_n(C,C,l);this.vertTypeBuffer.getView(_)[0]=GQe;var A=this.indexBuffer.getView(_);G$(r,A);var P=this.colorBuffer.getView(_);dB(d,m,P);this.instanceCount++;if(this.instanceCount>=this.maxInstances){this.endBatch()}}},{key:"drawEdgeLine",value:function t(n,r){if(!n.visible()){return}var i=this._getEdgePoints(n);if(!i){return}var o=n.pstyle("opacity").value;var a=n.pstyle("line-opacity").value;var s=n.pstyle("width").pfValue;var l=n.pstyle("line-color").value;var u=o*a;if(i.length/2+this.instanceCount>this.maxInstances){this.endBatch()}if(i.length==4){var d=this.instanceCount;this.vertTypeBuffer.getView(d)[0]=Z_n;var f=this.indexBuffer.getView(d);G$(r,f);var h=this.colorBuffer.getView(d);dB(l,u,h);var m=this.lineWidthBuffer.getView(d);m[0]=s;var g=this.pointAPointBBuffer.getView(d);g[0]=i[0];g[1]=i[1];g[2]=i[2];g[3]=i[3];this.instanceCount++;if(this.instanceCount>=this.maxInstances){this.endBatch()}}else{for(var x=0;x=this.maxInstances){this.endBatch()}}}}},{key:"_isValidEdge",value:function t(n){var r=n._private.rscratch;if(r.badLine||r.allpts==null||isNaN(r.allpts[0])){return false}return true}},{key:"_getEdgePoints",value:function t(n){var r=n._private.rscratch;if(!this._isValidEdge(n)){return}var i=r.allpts;if(i.length==4){return i}var o=this._getNumSegments(n);return this._getCurveSegmentPoints(i,o)}},{key:"_getNumSegments",value:function t(n){var r=15;return Math.min(Math.max(r,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function t(n,r){if(n.length==4){return n}var i=Array((r+1)*2);for(var o=0;o<=r;o++){if(o==0){i[0]=n[0];i[1]=n[1]}else if(o==r){i[o*2]=n[n.length-2];i[o*2+1]=n[n.length-1]}else{var a=o/r;this._setCurvePoint(n,a,i,o*2)}}return i}},{key:"_setCurvePoint",value:function t(n,r,i,o){if(n.length<=2){i[o]=n[0];i[o+1]=n[1]}else{var a=Array(n.length-2);for(var s=0;s0}};var s=function d(f){var h=f.pstyle("text-events").strValue==="yes";return h?sSe.USE_BB:sSe.IGNORE};var l=function d(f){var h=f.position(),m=h.x,g=h.y;var x=f.outerWidth();var w=f.outerHeight();return{w:x,h:w,x1:m-x/2,y1:g-w/2}};n.drawing.addAtlasCollection("node",{texRows:e.webglTexRowsNodes});n.drawing.addAtlasCollection("label",{texRows:e.webglTexRows});n.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:t.getStyleKey,getBoundingBox:t.getElementBox,drawElement:t.drawElement});n.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:l,isSimple:kRi,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:true}});n.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:l,isVisible:a("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}});n.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:l,isVisible:a("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}});n.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:s,getKey:HQe(t.getLabelKey,null),getBoundingBox:WQe(t.getLabelBox,null),drawClipped:true,drawElement:t.drawLabel,getRotation:i(null),getRotationPoint:t.getLabelRotationPoint,getRotationOffset:t.getLabelRotationOffset,isVisible:o("label")});n.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:s,getKey:HQe(t.getSourceLabelKey,"source"),getBoundingBox:WQe(t.getSourceLabelBox,"source"),drawClipped:true,drawElement:t.drawSourceLabel,getRotation:i("source"),getRotationPoint:t.getSourceLabelRotationPoint,getRotationOffset:t.getSourceLabelRotationOffset,isVisible:o("source-label")});n.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:s,getKey:HQe(t.getTargetLabelKey,"target"),getBoundingBox:WQe(t.getTargetLabelBox,"target"),drawClipped:true,drawElement:t.drawTargetLabel,getRotation:i("target"),getRotationPoint:t.getTargetLabelRotationPoint,getRotationOffset:t.getTargetLabelRotationOffset,isVisible:o("target-label")});var u=Cte(function(){console.log("garbage collect flag set");n.data.gc=true},1e4);n.onUpdateEleCalcs(function(d,f){var h=false;if(f&&f.length>0){h|=n.drawing.invalidate(f)}if(h){u()}});jRi(n)};HQe=function e(t,n){return function(r){var i=t(r);var o=Own(r,n);if(o.length>1){return o.map(function(a,s){return"".concat(i,"_").concat(s)})}return i}};WQe=function e(t,n){return function(r,i){var o=t(r);if(typeof i==="string"){var a=i.indexOf("_");if(a>0){var s=Number(i.substring(a+1));var l=Own(r,n);var u=o.h/l.length;var d=u*s;var f=o.y1+d;return{x1:o.x1,w:o.w,y1:f,h:u,yOffset:d}}}return o}};jL={};jL.drawPolygonPath=function(e,t,n,r,i,o){var a=r/2;var s=i/2;if(e.beginPath){e.beginPath()}e.moveTo(t+a*o[0],n+s*o[1]);for(var l=1;l0&&a>0){m.clearRect(0,0,o,a);m.globalCompositeOperation="source-over";var g=this.getCachedZSortedEles();if(e.full){m.translate(-r.x1*u,-r.y1*u);m.scale(u,u);this.drawElements(m,g);m.scale(1/u,1/u);m.translate(r.x1*u,r.y1*u)}else{var x=t.pan();var w={x:x.x*u,y:x.y*u};u*=t.zoom();m.translate(w.x,w.y);m.scale(u,u);this.drawElements(m,g);m.scale(1/u,1/u);m.translate(-w.x,-w.y)}if(e.bg){m.globalCompositeOperation="destination-over";m.fillStyle=e.bg;m.rect(0,0,o,a);m.fill()}}return h};Ite.png=function(e){return Vwn(e,this.bufferCanvasImage(e),"image/png")};Ite.jpg=function(e){return Vwn(e,this.bufferCanvasImage(e),"image/jpeg")};$wn={};$wn.nodeShapeImpl=function(e,t,n,r,i,o,a,s){switch(e){case"ellipse":return this.drawEllipsePath(t,n,r,i,o);case"polygon":return this.drawPolygonPath(t,n,r,i,o,a);case"round-polygon":return this.drawRoundPolygonPath(t,n,r,i,o,a,s);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(t,n,r,i,o,s);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(t,n,r,i,o,a,s);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(t,n,r,i,o,s);case"barrel":return this.drawBarrelPath(t,n,r,i,o)}};oPi=Gwn;bl=Gwn.prototype;bl.CANVAS_LAYERS=3;bl.SELECT_BOX=0;bl.DRAG=1;bl.NODE=2;bl.WEBGL=3;bl.CANVAS_TYPES=["2d","2d","2d","webgl2"];bl.BUFFER_COUNT=3;bl.TEXTURE_BUFFER=0;bl.MOTIONBLUR_BUFFER_NODE=1;bl.MOTIONBLUR_BUFFER_DRAG=2;bl.redrawHint=function(e,t){var n=this;switch(e){case"eles":n.data.canvasNeedsRedraw[bl.NODE]=t;break;case"drag":n.data.canvasNeedsRedraw[bl.DRAG]=t;break;case"select":n.data.canvasNeedsRedraw[bl.SELECT_BOX]=t;break;case"gc":n.data.gc=true;break}};aPi=typeof Path2D!=="undefined";bl.path2dEnabled=function(e){if(e===void 0){return this.pathsEnabled}this.pathsEnabled=e?true:false};bl.usePaths=function(){return aPi&&this.pathsEnabled};bl.setImgSmoothing=function(e,t){if(e.imageSmoothingEnabled!=null){e.imageSmoothingEnabled=t}else{e.webkitImageSmoothingEnabled=t;e.mozImageSmoothingEnabled=t;e.msImageSmoothingEnabled=t}};bl.getImgSmoothing=function(e){if(e.imageSmoothingEnabled!=null){return e.imageSmoothingEnabled}else{return e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled}};bl.makeOffscreenCanvas=function(e,t){var n;if((typeof OffscreenCanvas==="undefined"?"undefined":zp(OffscreenCanvas))!=="undefined"){n=new OffscreenCanvas(e,t)}else{var r=this.cy.window();var i=r.document;n=i.createElement("canvas");n.width=e;n.height=t}return n};[Iwn,tS,NR,Bet,EB,XL,tb,Nwn,jL,Ite,$wn].forEach(function(e){Ua(bl,e)});sPi=[{name:"null",impl:gwn},{name:"base",impl:Awn},{name:"canvas",impl:oPi}];lPi=[{type:"layout",extensions:Iki},{type:"renderer",extensions:sPi}];Hwn={};Wwn={};het=function e(){if(arguments.length===2){return qwn.apply(null,arguments)}else if(arguments.length===3){return Ywn.apply(null,arguments)}else if(arguments.length===4){return uPi.apply(null,arguments)}else if(arguments.length===5){return cPi.apply(null,arguments)}else{sf("Invalid extension access syntax")}};bte.prototype.extension=het;lPi.forEach(function(e){e.extensions.forEach(function(t){Ywn(e.type,t.name,t.impl)})});lSe=function e(){if(!(this instanceof lSe)){return new lSe}this.length=0};TB=lSe.prototype;TB.instanceString=function(){return"stylesheet"};TB.selector=function(e){var t=this.length++;this[t]={selector:e,properties:[]};return this};TB.css=function(e,t){var n=this.length-1;if(ma(e)){this[n].properties.push({name:e,value:t})}else if(mc(e)){var r=e;var i=Object.keys(r);for(var o=0;o{(function e(t,n){if(typeof Mte==="object"&&typeof Vet==="object")Vet.exports=n();else if(typeof define==="function"&&define.amd)define([],n);else if(typeof Mte==="object")Mte["layoutBase"]=n();else t["layoutBase"]=n()})(Mte,function(){return function(e){var t={};function n(r){if(t[r]){return t[r].exports}var i=t[r]={i:r,l:false,exports:{}};e[r].call(i.exports,i,i.exports,n);i.l=true;return i.exports}n.m=e;n.c=t;n.i=function(r){return r};n.d=function(r,i,o){if(!n.o(r,i)){Object.defineProperty(r,i,{configurable:false,enumerable:true,get:o})}};n.n=function(r){var i=r&&r.__esModule?function o(){return r["default"]}:function o(){return r};n.d(i,"a",i);return i};n.o=function(r,i){return Object.prototype.hasOwnProperty.call(r,i)};n.p="";return n(n.s=26)}([function(e,t,n){"use strict";function r(){}r.QUALITY=1;r.DEFAULT_CREATE_BENDS_AS_NEEDED=false;r.DEFAULT_INCREMENTAL=false;r.DEFAULT_ANIMATION_ON_LAYOUT=true;r.DEFAULT_ANIMATION_DURING_LAYOUT=false;r.DEFAULT_ANIMATION_PERIOD=50;r.DEFAULT_UNIFORM_LEAF_NODE_SIZES=false;r.DEFAULT_GRAPH_MARGIN=15;r.NODE_DIMENSIONS_INCLUDE_LABELS=false;r.SIMPLE_NODE_SIZE=40;r.SIMPLE_NODE_HALF_SIZE=r.SIMPLE_NODE_SIZE/2;r.EMPTY_COMPOUND_NODE_SIZE=40;r.MIN_EDGE_LENGTH=1;r.WORLD_BOUNDARY=1e6;r.INITIAL_WORLD_BOUNDARY=r.WORLD_BOUNDARY/1e3;r.WORLD_CENTER_X=1200;r.WORLD_CENTER_Y=900;e.exports=r},function(e,t,n){"use strict";var r=n(2);var i=n(8);var o=n(9);function a(l,u,d){r.call(this,d);this.isOverlapingSourceAndTarget=false;this.vGraphObject=d;this.bendpoints=[];this.source=l;this.target=u}a.prototype=Object.create(r.prototype);for(var s in r){a[s]=r[s]}a.prototype.getSource=function(){return this.source};a.prototype.getTarget=function(){return this.target};a.prototype.isInterGraph=function(){return this.isInterGraph};a.prototype.getLength=function(){return this.length};a.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget};a.prototype.getBendpoints=function(){return this.bendpoints};a.prototype.getLca=function(){return this.lca};a.prototype.getSourceInLca=function(){return this.sourceInLca};a.prototype.getTargetInLca=function(){return this.targetInLca};a.prototype.getOtherEnd=function(l){if(this.source===l){return this.target}else if(this.target===l){return this.source}else{throw"Node is not incident with this edge"}};a.prototype.getOtherEndInGraph=function(l,u){var d=this.getOtherEnd(l);var f=u.getGraphManager().getRoot();while(true){if(d.getOwner()==u){return d}if(d.getOwner()==f){break}d=d.getOwner().getParent()}return null};a.prototype.updateLength=function(){var l=new Array(4);this.isOverlapingSourceAndTarget=i.getIntersection(this.target.getRect(),this.source.getRect(),l);if(!this.isOverlapingSourceAndTarget){this.lengthX=l[0]-l[2];this.lengthY=l[1]-l[3];if(Math.abs(this.lengthX)<1){this.lengthX=o.sign(this.lengthX)}if(Math.abs(this.lengthY)<1){this.lengthY=o.sign(this.lengthY)}this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)}};a.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX();this.lengthY=this.target.getCenterY()-this.source.getCenterY();if(Math.abs(this.lengthX)<1){this.lengthX=o.sign(this.lengthX)}if(Math.abs(this.lengthY)<1){this.lengthY=o.sign(this.lengthY)}this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)};e.exports=a},function(e,t,n){"use strict";function r(i){this.vGraphObject=i}e.exports=r},function(e,t,n){"use strict";var r=n(2);var i=n(10);var o=n(13);var a=n(0);var s=n(16);var l=n(4);function u(f,h,m,g){if(m==null&&g==null){g=h}r.call(this,g);if(f.graphManager!=null)f=f.graphManager;this.estimatedSize=i.MIN_VALUE;this.inclusionTreeDepth=i.MAX_VALUE;this.vGraphObject=g;this.edges=[];this.graphManager=f;if(m!=null&&h!=null)this.rect=new o(h.x,h.y,m.width,m.height);else this.rect=new o}u.prototype=Object.create(r.prototype);for(var d in r){u[d]=r[d]}u.prototype.getEdges=function(){return this.edges};u.prototype.getChild=function(){return this.child};u.prototype.getOwner=function(){return this.owner};u.prototype.getWidth=function(){return this.rect.width};u.prototype.setWidth=function(f){this.rect.width=f};u.prototype.getHeight=function(){return this.rect.height};u.prototype.setHeight=function(f){this.rect.height=f};u.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2};u.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2};u.prototype.getCenter=function(){return new l(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)};u.prototype.getLocation=function(){return new l(this.rect.x,this.rect.y)};u.prototype.getRect=function(){return this.rect};u.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)};u.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2};u.prototype.setRect=function(f,h){this.rect.x=f.x;this.rect.y=f.y;this.rect.width=h.width;this.rect.height=h.height};u.prototype.setCenter=function(f,h){this.rect.x=f-this.rect.width/2;this.rect.y=h-this.rect.height/2};u.prototype.setLocation=function(f,h){this.rect.x=f;this.rect.y=h};u.prototype.moveBy=function(f,h){this.rect.x+=f;this.rect.y+=h};u.prototype.getEdgeListToNode=function(f){var h=[];var m;var g=this;g.edges.forEach(function(x){if(x.target==f){if(x.source!=g)throw"Incorrect edge source!";h.push(x)}});return h};u.prototype.getEdgesBetween=function(f){var h=[];var m;var g=this;g.edges.forEach(function(x){if(!(x.source==g||x.target==g))throw"Incorrect edge source and/or target";if(x.target==f||x.source==f){h.push(x)}});return h};u.prototype.getNeighborsList=function(){var f=new Set;var h=this;h.edges.forEach(function(m){if(m.source==h){f.add(m.target)}else{if(m.target!=h){throw"Incorrect incidency!"}f.add(m.source)}});return f};u.prototype.withChildren=function(){var f=new Set;var h;var m;f.add(this);if(this.child!=null){var g=this.child.getNodes();for(var x=0;xh){this.rect.x-=(this.labelWidth-h)/2;this.setWidth(this.labelWidth)}if(this.labelHeight>m){if(this.labelPos=="center"){this.rect.y-=(this.labelHeight-m)/2}else if(this.labelPos=="top"){this.rect.y-=this.labelHeight-m}this.setHeight(this.labelHeight)}}}};u.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE){throw"assert failed"}return this.inclusionTreeDepth};u.prototype.transform=function(f){var h=this.rect.x;if(h>a.WORLD_BOUNDARY){h=a.WORLD_BOUNDARY}else if(h<-a.WORLD_BOUNDARY){h=-a.WORLD_BOUNDARY}var m=this.rect.y;if(m>a.WORLD_BOUNDARY){m=a.WORLD_BOUNDARY}else if(m<-a.WORLD_BOUNDARY){m=-a.WORLD_BOUNDARY}var g=new l(h,m);var x=f.inverseTransformPoint(g);this.setLocation(x.x,x.y)};u.prototype.getLeft=function(){return this.rect.x};u.prototype.getRight=function(){return this.rect.x+this.rect.width};u.prototype.getTop=function(){return this.rect.y};u.prototype.getBottom=function(){return this.rect.y+this.rect.height};u.prototype.getParent=function(){if(this.owner==null){return null}return this.owner.getParent()};e.exports=u},function(e,t,n){"use strict";function r(i,o){if(i==null&&o==null){this.x=0;this.y=0}else{this.x=i;this.y=o}}r.prototype.getX=function(){return this.x};r.prototype.getY=function(){return this.y};r.prototype.setX=function(i){this.x=i};r.prototype.setY=function(i){this.y=i};r.prototype.getDifference=function(i){return new DimensionD(this.x-i.x,this.y-i.y)};r.prototype.getCopy=function(){return new r(this.x,this.y)};r.prototype.translate=function(i){this.x+=i.width;this.y+=i.height;return this};e.exports=r},function(e,t,n){"use strict";var r=n(2);var i=n(10);var o=n(0);var a=n(6);var s=n(3);var l=n(1);var u=n(13);var d=n(12);var f=n(11);function h(g,x,w){r.call(this,w);this.estimatedSize=i.MIN_VALUE;this.margin=o.DEFAULT_GRAPH_MARGIN;this.edges=[];this.nodes=[];this.isConnected=false;this.parent=g;if(x!=null&&x instanceof a){this.graphManager=x}else if(x!=null&&x instanceof Layout){this.graphManager=x.graphManager}}h.prototype=Object.create(r.prototype);for(var m in r){h[m]=r[m]}h.prototype.getNodes=function(){return this.nodes};h.prototype.getEdges=function(){return this.edges};h.prototype.getGraphManager=function(){return this.graphManager};h.prototype.getParent=function(){return this.parent};h.prototype.getLeft=function(){return this.left};h.prototype.getRight=function(){return this.right};h.prototype.getTop=function(){return this.top};h.prototype.getBottom=function(){return this.bottom};h.prototype.isConnected=function(){return this.isConnected};h.prototype.add=function(g,x,w){if(x==null&&w==null){var _=g;if(this.graphManager==null){throw"Graph has no graph mgr!"}if(this.getNodes().indexOf(_)>-1){throw"Node already in graph!"}_.owner=this;this.getNodes().push(_);return _}else{var C=g;if(!(this.getNodes().indexOf(x)>-1&&this.getNodes().indexOf(w)>-1)){throw"Source or target not in graph!"}if(!(x.owner==w.owner&&x.owner==this)){throw"Both owners must be this graph!"}if(x.owner!=w.owner){return null}C.source=x;C.target=w;C.isInterGraph=false;this.getEdges().push(C);x.edges.push(C);if(w!=x){w.edges.push(C)}return C}};h.prototype.remove=function(g){var x=g;if(g instanceof s){if(x==null){throw"Node is null!"}if(!(x.owner!=null&&x.owner==this)){throw"Owner graph is invalid!"}if(this.graphManager==null){throw"Owner graph manager is invalid!"}var w=x.edges.slice();var _;var C=w.length;for(var A=0;A-1&&I>-1)){throw"Source and/or target doesn't know this edge!"}_.source.edges.splice(L,1);if(_.target!=_.source){_.target.edges.splice(I,1)}var P=_.source.owner.getEdges().indexOf(_);if(P==-1){throw"Not in owner's edge list!"}_.source.owner.getEdges().splice(P,1)}};h.prototype.updateLeftTop=function(){var g=i.MAX_VALUE;var x=i.MAX_VALUE;var w;var _;var C;var A=this.getNodes();var P=A.length;for(var L=0;Lw){g=w}if(x>_){x=_}}if(g==i.MAX_VALUE){return null}if(A[0].getParent().paddingLeft!=void 0){C=A[0].getParent().paddingLeft}else{C=this.margin}this.left=x-C;this.top=g-C;return new d(this.left,this.top)};h.prototype.updateBounds=function(g){var x=i.MAX_VALUE;var w=-i.MAX_VALUE;var _=i.MAX_VALUE;var C=-i.MAX_VALUE;var A;var P;var L;var I;var N;var O=this.nodes;var z=O.length;for(var U=0;UA){x=A}if(wL){_=L}if(CA){x=A}if(wL){_=L}if(C=this.nodes.length){var z=0;w.forEach(function(U){if(U.owner==g){z++}});if(z==this.nodes.length){this.isConnected=true}}};e.exports=h},function(e,t,n){"use strict";var r;var i=n(1);function o(a){r=n(5);this.layout=a;this.graphs=[];this.edges=[]}o.prototype.addRoot=function(){var a=this.layout.newGraph();var s=this.layout.newNode(null);var l=this.add(a,s);this.setRootGraph(l);return this.rootGraph};o.prototype.add=function(a,s,l,u,d){if(l==null&&u==null&&d==null){if(a==null){throw"Graph is null!"}if(s==null){throw"Parent node is null!"}if(this.graphs.indexOf(a)>-1){throw"Graph already in this graph mgr!"}this.graphs.push(a);if(a.parent!=null){throw"Already has a parent!"}if(s.child!=null){throw"Already has a child!"}a.parent=s;s.child=a;return a}else{d=l;u=s;l=a;var f=u.getOwner();var h=d.getOwner();if(!(f!=null&&f.getGraphManager()==this)){throw"Source not in this graph mgr!"}if(!(h!=null&&h.getGraphManager()==this)){throw"Target not in this graph mgr!"}if(f==h){l.isInterGraph=false;return f.add(l,u,d)}else{l.isInterGraph=true;l.source=u;l.target=d;if(this.edges.indexOf(l)>-1){throw"Edge already in inter-graph edge list!"}this.edges.push(l);if(!(l.source!=null&&l.target!=null)){throw"Edge source and/or target is null!"}if(!(l.source.edges.indexOf(l)==-1&&l.target.edges.indexOf(l)==-1)){throw"Edge already in source and/or target incidency list!"}l.source.edges.push(l);l.target.edges.push(l);return l}}};o.prototype.remove=function(a){if(a instanceof r){var s=a;if(s.getGraphManager()!=this){throw"Graph not in this graph mgr"}if(!(s==this.rootGraph||s.parent!=null&&s.parent.graphManager==this)){throw"Invalid parent node!"}var l=[];l=l.concat(s.getEdges());var u;var d=l.length;for(var f=0;f=a.getRight()){s[0]+=Math.min(a.getX()-o.getX(),o.getRight()-a.getRight())}else if(a.getX()<=o.getX()&&a.getRight()>=o.getRight()){s[0]+=Math.min(o.getX()-a.getX(),a.getRight()-o.getRight())}if(o.getY()<=a.getY()&&o.getBottom()>=a.getBottom()){s[1]+=Math.min(a.getY()-o.getY(),o.getBottom()-a.getBottom())}else if(a.getY()<=o.getY()&&a.getBottom()>=o.getBottom()){s[1]+=Math.min(o.getY()-a.getY(),a.getBottom()-o.getBottom())}var d=Math.abs((a.getCenterY()-o.getCenterY())/(a.getCenterX()-o.getCenterX()));if(a.getCenterY()===o.getCenterY()&&a.getCenterX()===o.getCenterX()){d=1}var f=d*s[0];var h=s[1]/d;if(s[0]f){s[0]=l;s[1]=m;s[2]=d;s[3]=O;return false}else if(ud){s[0]=h;s[1]=u;s[2]=I;s[3]=f;return false}else if(ld){s[0]=x;s[1]=w;H=true}else{s[0]=g;s[1]=m;H=true}}else if(K===j){if(l>d){s[0]=h;s[1]=m;H=true}else{s[0]=_;s[1]=w;H=true}}if(-X===j){if(d>l){s[2]=N;s[3]=O;$=true}else{s[2]=I;s[3]=L;$=true}}else if(X===j){if(d>l){s[2]=P;s[3]=L;$=true}else{s[2]=z;s[3]=O;$=true}}if(H&&$){return false}if(l>d){if(u>f){te=this.getCardinalDirection(K,j,4);J=this.getCardinalDirection(X,j,2)}else{te=this.getCardinalDirection(-K,j,3);J=this.getCardinalDirection(-X,j,1)}}else{if(u>f){te=this.getCardinalDirection(-K,j,1);J=this.getCardinalDirection(-X,j,3)}else{te=this.getCardinalDirection(K,j,2);J=this.getCardinalDirection(X,j,4)}}if(!H){switch(te){case 1:se=m;oe=l+-A/j;s[0]=oe;s[1]=se;break;case 2:oe=_;se=u+C*j;s[0]=oe;s[1]=se;break;case 3:se=w;oe=l+A/j;s[0]=oe;s[1]=se;break;case 4:oe=x;se=u+-C*j;s[0]=oe;s[1]=se;break}}if(!$){switch(J){case 1:ce=L;re=d+-W/j;s[2]=re;s[3]=ce;break;case 2:re=z;ce=f+U*j;s[2]=re;s[3]=ce;break;case 3:ce=O;re=d+W/j;s[2]=re;s[3]=ce;break;case 4:re=N;ce=f+-U*j;s[2]=re;s[3]=ce;break}}}return false};i.getCardinalDirection=function(o,a,s){if(o>a){return s}else{return 1+s%4}};i.getIntersection=function(o,a,s,l){if(l==null){return this.getIntersection2(o,a,s)}var u=o.x;var d=o.y;var f=a.x;var h=a.y;var m=s.x;var g=s.y;var x=l.x;var w=l.y;var _=void 0,C=void 0;var A=void 0,P=void 0,L=void 0,I=void 0,N=void 0,O=void 0;var z=void 0;A=h-d;L=u-f;N=f*d-u*h;P=w-g;I=m-x;O=x*g-m*w;z=A*I-P*L;if(z===0){return null}_=(L*O-I*N)/z;C=(P*N-A*O)/z;return new r(_,C)};i.angleOfVector=function(o,a,s,l){var u=void 0;if(o!==s){u=Math.atan((l-a)/(s-o));if(s0){return 1}else if(i<0){return-1}else{return 0}};r.floor=function(i){return i<0?Math.ceil(i):Math.floor(i)};r.ceil=function(i){return i<0?Math.floor(i):Math.ceil(i)};e.exports=r},function(e,t,n){"use strict";function r(){}r.MAX_VALUE=2147483647;r.MIN_VALUE=-2147483648;e.exports=r},function(e,t,n){"use strict";var r=function(){function u(d,f){for(var h=0;h0&&g){A.push(L[0]);while(A.length>0&&g){var I=A[0];A.splice(0,1);C.add(I);var N=I.getEdges();for(var _=0;_-1){L.splice(W,1)}}C=new Set;P=new Map}}return m};h.prototype.createDummyNodesForBendpoints=function(m){var g=[];var x=m.source;var w=this.graphManager.calcLowestCommonAncestor(m.source,m.target);for(var _=0;_0){var w=this.edgeToDummyNodes.get(x);for(var _=0;_=0){g.splice(O,1)}var z=P.getNeighborsList();z.forEach(function(H){if(x.indexOf(H)<0){var $=w.get(H);var K=$-1;if(K==1){I.push(H)}w.set(H,K)}})}x=x.concat(I);if(g.length==1||g.length==2){_=true;C=g[0]}}return C};h.prototype.setGraphManager=function(m){this.graphManager=m};e.exports=h},function(e,t,n){"use strict";function r(){}r.seed=1;r.x=0;r.nextDouble=function(){r.x=Math.sin(r.seed++)*1e4;return r.x-Math.floor(r.x)};e.exports=r},function(e,t,n){"use strict";var r=n(4);function i(o,a){this.lworldOrgX=0;this.lworldOrgY=0;this.ldeviceOrgX=0;this.ldeviceOrgY=0;this.lworldExtX=1;this.lworldExtY=1;this.ldeviceExtX=1;this.ldeviceExtY=1}i.prototype.getWorldOrgX=function(){return this.lworldOrgX};i.prototype.setWorldOrgX=function(o){this.lworldOrgX=o};i.prototype.getWorldOrgY=function(){return this.lworldOrgY};i.prototype.setWorldOrgY=function(o){this.lworldOrgY=o};i.prototype.getWorldExtX=function(){return this.lworldExtX};i.prototype.setWorldExtX=function(o){this.lworldExtX=o};i.prototype.getWorldExtY=function(){return this.lworldExtY};i.prototype.setWorldExtY=function(o){this.lworldExtY=o};i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX};i.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o};i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY};i.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o};i.prototype.getDeviceExtX=function(){return this.ldeviceExtX};i.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o};i.prototype.getDeviceExtY=function(){return this.ldeviceExtY};i.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o};i.prototype.transformX=function(o){var a=0;var s=this.lworldExtX;if(s!=0){a=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/s}return a};i.prototype.transformY=function(o){var a=0;var s=this.lworldExtY;if(s!=0){a=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/s}return a};i.prototype.inverseTransformX=function(o){var a=0;var s=this.ldeviceExtX;if(s!=0){a=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/s}return a};i.prototype.inverseTransformY=function(o){var a=0;var s=this.ldeviceExtY;if(s!=0){a=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/s}return a};i.prototype.inverseTransformPoint=function(o){var a=new r(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return a};e.exports=i},function(e,t,n){"use strict";function r(f){if(Array.isArray(f)){for(var h=0,m=Array(f.length);ho.ADAPTATION_LOWER_NODE_LIMIT){this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(f-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))}this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL}else{if(f>o.ADAPTATION_LOWER_NODE_LIMIT){this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(f-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR))}else{this.coolingFactor=1}this.initialCoolingFactor=this.coolingFactor;this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT}this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations);this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length;this.repulsionRange=this.calcRepulsionRange()};u.prototype.calcSpringForces=function(){var f=this.getAllEdges();var h;for(var m=0;m0&&arguments[0]!==void 0?arguments[0]:true;var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:false;var m,g;var x,w;var _=this.getAllNodes();var C;if(this.useFRGridVariant){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&f){this.updateGrid()}C=new Set;for(m=0;m<_.length;m++){x=_[m];this.calculateRepulsionForceOfANode(x,C,f,h);C.add(x)}}else{for(m=0;m<_.length;m++){x=_[m];for(g=m+1;g<_.length;g++){w=_[g];if(x.getOwner()!=w.getOwner()){continue}this.calcRepulsionForce(x,w)}}}};u.prototype.calcGravitationalForces=function(){var f;var h=this.getAllNodesToApplyGravitation();for(var m=0;mA||C>A){f.gravitationForceX=-this.gravityConstant*x;f.gravitationForceY=-this.gravityConstant*w}}else{A=h.getEstimatedSize()*this.compoundGravityRangeFactor;if(_>A||C>A){f.gravitationForceX=-this.gravityConstant*x*this.compoundGravityConstant;f.gravitationForceY=-this.gravityConstant*w*this.compoundGravityConstant}}};u.prototype.isConverged=function(){var f;var h=false;if(this.totalIterations>this.maxIterations/3){h=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2}f=this.totalDisplacement=_.length||A>=_[0].length)){for(var P=0;P<_[C][A].length;P++){w=_[C][A][P];if(f.getOwner()!=w.getOwner()||f==w){continue}if(!h.has(w)&&!x.has(w)){var L=Math.abs(f.getCenterX()-w.getCenterX())-(f.getWidth()/2+w.getWidth()/2);var I=Math.abs(f.getCenterY()-w.getCenterY())-(f.getHeight()/2+w.getHeight()/2);if(L<=this.repulsionRange&&I<=this.repulsionRange){x.add(w)}}}}}}f.surrounding=[].concat(r(x))}for(C=0;Cu}}]);return s}();e.exports=a},function(e,t,n){"use strict";var r=function(){function a(s,l){for(var u=0;u2&&arguments[2]!==void 0?arguments[2]:1;var d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1;var f=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;i(this,a);this.sequence1=s;this.sequence2=l;this.match_score=u;this.mismatch_penalty=d;this.gap_penalty=f;this.iMax=s.length+1;this.jMax=l.length+1;this.grid=new Array(this.iMax);for(var h=0;h=0;s--){var l=this.listeners[s];if(l.event===o&&l.callback===a){this.listeners.splice(s,1)}}};i.emit=function(o,a){for(var s=0;s{(function e(t,n){if(typeof Lte==="object"&&typeof Get==="object")Get.exports=n($et());else if(typeof define==="function"&&define.amd)define(["layout-base"],n);else if(typeof Lte==="object")Lte["coseBase"]=n($et());else t["coseBase"]=n(t["layoutBase"])})(Lte,function(e){return function(t){var n={};function r(i){if(n[i]){return n[i].exports}var o=n[i]={i,l:false,exports:{}};t[i].call(o.exports,o,o.exports,r);o.l=true;return o.exports}r.m=t;r.c=n;r.i=function(i){return i};r.d=function(i,o,a){if(!r.o(i,o)){Object.defineProperty(i,o,{configurable:false,enumerable:true,get:a})}};r.n=function(i){var o=i&&i.__esModule?function a(){return i["default"]}:function a(){return i};r.d(o,"a",o);return o};r.o=function(i,o){return Object.prototype.hasOwnProperty.call(i,o)};r.p="";return r(r.s=7)}([function(t,n){t.exports=e},function(t,n,r){"use strict";var i=r(0).FDLayoutConstants;function o(){}for(var a in i){o[a]=i[a]}o.DEFAULT_USE_MULTI_LEVEL_SCALING=false;o.DEFAULT_RADIAL_SEPARATION=i.DEFAULT_EDGE_LENGTH;o.DEFAULT_COMPONENT_SEPERATION=60;o.TILE=true;o.TILING_PADDING_VERTICAL=10;o.TILING_PADDING_HORIZONTAL=10;o.TREE_REDUCTION_ON_INCREMENTAL=false;t.exports=o},function(t,n,r){"use strict";var i=r(0).FDLayoutEdge;function o(s,l,u){i.call(this,s,l,u)}o.prototype=Object.create(i.prototype);for(var a in i){o[a]=i[a]}t.exports=o},function(t,n,r){"use strict";var i=r(0).LGraph;function o(s,l,u){i.call(this,s,l,u)}o.prototype=Object.create(i.prototype);for(var a in i){o[a]=i[a]}t.exports=o},function(t,n,r){"use strict";var i=r(0).LGraphManager;function o(s){i.call(this,s)}o.prototype=Object.create(i.prototype);for(var a in i){o[a]=i[a]}t.exports=o},function(t,n,r){"use strict";var i=r(0).FDLayoutNode;var o=r(0).IMath;function a(l,u,d,f){i.call(this,l,u,d,f)}a.prototype=Object.create(i.prototype);for(var s in i){a[s]=i[s]}a.prototype.move=function(){var l=this.graphManager.getLayout();this.displacementX=l.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren;this.displacementY=l.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren;if(Math.abs(this.displacementX)>l.coolingFactor*l.maxNodeDisplacement){this.displacementX=l.coolingFactor*l.maxNodeDisplacement*o.sign(this.displacementX)}if(Math.abs(this.displacementY)>l.coolingFactor*l.maxNodeDisplacement){this.displacementY=l.coolingFactor*l.maxNodeDisplacement*o.sign(this.displacementY)}if(this.child==null){this.moveBy(this.displacementX,this.displacementY)}else if(this.child.getNodes().length==0){this.moveBy(this.displacementX,this.displacementY)}else{this.propogateDisplacementToChildren(this.displacementX,this.displacementY)}l.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY);this.springForceX=0;this.springForceY=0;this.repulsionForceX=0;this.repulsionForceY=0;this.gravitationForceX=0;this.gravitationForceY=0;this.displacementX=0;this.displacementY=0};a.prototype.propogateDisplacementToChildren=function(l,u){var d=this.getChild().getNodes();var f;for(var h=0;h0){this.positionNodesRadially(L)}else{this.reduceTrees();this.graphManager.resetAllNodesToApplyGravitation();var I=new Set(this.getAllNodes());var N=this.nodesWithGravity.filter(function(O){return I.has(O)});this.graphManager.setAllNodesToApplyGravitation(N);this.positionNodesRandomly()}}else{if(u.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees();this.graphManager.resetAllNodesToApplyGravitation();var I=new Set(this.getAllNodes());var N=this.nodesWithGravity.filter(function(U){return I.has(U)});this.graphManager.setAllNodesToApplyGravitation(N)}}this.initSpringEmbedder();this.runSpringEmbedder();return true};A.prototype.tick=function(){this.totalIterations++;if(this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.prunedNodesAll.length>0){this.isTreeGrowing=true}else{return true}}if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(this.prunedNodesAll.length>0){this.isTreeGrowing=true}else{return true}}this.coolingCycle++;if(this.layoutQuality==0){this.coolingAdjuster=this.coolingCycle}else if(this.layoutQuality==1){this.coolingAdjuster=this.coolingCycle/3}this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature);this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0){if(this.prunedNodesAll.length>0){this.graphManager.updateBounds();this.updateGrid();this.growTree(this.prunedNodesAll);this.graphManager.resetAllNodesToApplyGravitation();var L=new Set(this.getAllNodes());var I=this.nodesWithGravity.filter(function(z){return L.has(z)});this.graphManager.setAllNodesToApplyGravitation(I);this.graphManager.updateBounds();this.updateGrid();this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL}else{this.isTreeGrowing=false;this.isGrowthFinished=true}}this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged()){return true}if(this.afterGrowthIterations%10==0){this.graphManager.updateBounds();this.updateGrid()}this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100);this.afterGrowthIterations++}var N=!this.isTreeGrowing&&!this.isGrowthFinished;var O=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;this.totalDisplacement=0;this.graphManager.updateBounds();this.calcSpringForces();this.calcRepulsionForces(N,O);this.calcGravitationalForces();this.moveNodes();this.animate();return false};A.prototype.getPositionsData=function(){var L=this.graphManager.getAllNodes();var I={};for(var N=0;N1){var H;for(H=0;HO){O=Math.floor(W.y)}U=Math.floor(W.x+u.DEFAULT_COMPONENT_SEPERATION)}this.transform(new m(f.WORLD_CENTER_X-W.x/2,f.WORLD_CENTER_Y-W.y/2))};A.radialLayout=function(L,I,N){var O=Math.max(this.maxDiagonalInTree(L),u.DEFAULT_RADIAL_SEPARATION);A.branchRadialLayout(I,null,0,359,0,O);var z=_.calculateBounds(L);var U=new C;U.setDeviceOrgX(z.getMinX());U.setDeviceOrgY(z.getMinY());U.setWorldOrgX(N.x);U.setWorldOrgY(N.y);for(var W=0;W1){var ue=ce[0];ce.splice(0,1);var xe=te.indexOf(ue);if(xe>=0){te.splice(xe,1)}se--;J--}if(I!=null){re=(te.indexOf(ce[0])+1)%se}else{re=0}var be=Math.abs(O-N)/J;for(var Ie=re;oe!=J;Ie=++Ie%se){var he=te[Ie].getOtherEnd(L);if(he==I){continue}var ve=(N+oe*be)%360;var ge=(ve+be)%360;A.branchRadialLayout(he,L,ve,ge,z+U,U);oe++}};A.maxDiagonalInTree=function(L){var I=x.MIN_VALUE;for(var N=0;NI){I=z}}return I};A.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength};A.prototype.groupZeroDegreeMembers=function(){var L=this;var I={};this.memberGroups={};this.idToDummyNode={};var N=[];var O=this.graphManager.getAllNodes();for(var z=0;z1){var K="DummyCompound_"+$;L.memberGroups[K]=I[$];var X=I[$][0].getParent();var j=new s(L.graphManager);j.id=K;j.paddingLeft=X.paddingLeft||0;j.paddingRight=X.paddingRight||0;j.paddingBottom=X.paddingBottom||0;j.paddingTop=X.paddingTop||0;L.idToDummyNode[K]=j;var te=L.getGraphManager().add(L.newGraph(),j);var J=X.getChild();J.add(j);for(var oe=0;oe=0;L--){var I=this.compoundOrder[L];var N=I.id;var O=I.paddingLeft;var z=I.paddingTop;this.adjustLocations(this.tiledMemberPack[N],I.rect.x,I.rect.y,O,z)}};A.prototype.repopulateZeroDegreeMembers=function(){var L=this;var I=this.tiledZeroDegreePack;Object.keys(I).forEach(function(N){var O=L.idToDummyNode[N];var z=O.paddingLeft;var U=O.paddingTop;L.adjustLocations(I[N],O.rect.x,O.rect.y,z,U)})};A.prototype.getToBeTiled=function(L){var I=L.id;if(this.toBeTiled[I]!=null){return this.toBeTiled[I]}var N=L.getChild();if(N==null){this.toBeTiled[I]=false;return false}var O=N.getNodes();for(var z=0;z0){this.toBeTiled[I]=false;return false}if(U.getChild()==null){this.toBeTiled[U.id]=false;continue}if(!this.getToBeTiled(U)){this.toBeTiled[I]=false;return false}}this.toBeTiled[I]=true;return true};A.prototype.getNodeDegree=function(L){var I=L.id;var N=L.getEdges();var O=0;for(var z=0;z$)$=X.rect.height}N+=$+L.verticalPadding}};A.prototype.tileCompoundMembers=function(L,I){var N=this;this.tiledMemberPack=[];Object.keys(L).forEach(function(O){var z=I[O];N.tiledMemberPack[O]=N.tileNodes(L[O],z.paddingLeft+z.paddingRight);z.rect.width=N.tiledMemberPack[O].width;z.rect.height=N.tiledMemberPack[O].height})};A.prototype.tileNodes=function(L,I){var N=u.TILING_PADDING_VERTICAL;var O=u.TILING_PADDING_HORIZONTAL;var z={rows:[],rowWidth:[],rowHeight:[],width:0,height:I,verticalPadding:N,horizontalPadding:O};L.sort(function(H,$){if(H.rect.width*H.rect.height>$.rect.width*$.rect.height)return-1;if(H.rect.width*H.rect.height<$.rect.width*$.rect.height)return 1;return 0});for(var U=0;U0){W+=L.horizontalPadding}L.rowWidth[N]=W;if(L.width0)H+=L.verticalPadding;var $=0;if(H>L.rowHeight[N]){$=L.rowHeight[N];L.rowHeight[N]=H;$=L.rowHeight[N]-$}L.height+=$;L.rows[N].push(I)};A.prototype.getShortestRowIndex=function(L){var I=-1;var N=Number.MAX_VALUE;for(var O=0;ON){I=O;N=L.rowWidth[O]}}return I};A.prototype.canAddHorizontal=function(L,I,N){var O=this.getShortestRowIndex(L);if(O<0){return true}var z=L.rowWidth[O];if(z+L.horizontalPadding+I<=L.width)return true;var U=0;if(L.rowHeight[O]0)U=N+L.verticalPadding-L.rowHeight[O]}var W;if(L.width-z>=I+L.horizontalPadding){W=(L.height+U)/(z+I+L.horizontalPadding)}else{W=(L.height+U)/L.width}U=N+L.verticalPadding;var H;if(L.widthU&&I!=N){O.splice(-1,1);L.rows[N].push(z);L.rowWidth[I]=L.rowWidth[I]-U;L.rowWidth[N]=L.rowWidth[N]+U;L.width=L.rowWidth[instance.getLongestRowIndex(L)];var W=Number.MIN_VALUE;for(var H=0;HW)W=O[H].height}if(I>0)W+=L.verticalPadding;var $=L.rowHeight[I]+L.rowHeight[N];L.rowHeight[I]=W;if(L.rowHeight[N]0){for(var J=z;J<=U;J++){te[0]+=this.grid[J][W-1].length+this.grid[J][W].length-1}}if(U0){for(var J=W;J<=H;J++){te[3]+=this.grid[z-1][J].length+this.grid[z][J].length-1}}var oe=x.MAX_VALUE;var se;var re;for(var ce=0;ce{(function e(t,n){if(typeof Dte==="object"&&typeof Wet==="object")Wet.exports=n(Het());else if(typeof define==="function"&&define.amd)define(["cose-base"],n);else if(typeof Dte==="object")Dte["cytoscapeCoseBilkent"]=n(Het());else t["cytoscapeCoseBilkent"]=n(t["coseBase"])})(Dte,function(e){return function(t){var n={};function r(i){if(n[i]){return n[i].exports}var o=n[i]={i,l:false,exports:{}};t[i].call(o.exports,o,o.exports,r);o.l=true;return o.exports}r.m=t;r.c=n;r.i=function(i){return i};r.d=function(i,o,a){if(!r.o(i,o)){Object.defineProperty(i,o,{configurable:false,enumerable:true,get:a})}};r.n=function(i){var o=i&&i.__esModule?function a(){return i["default"]}:function a(){return i};r.d(o,"a",o);return o};r.o=function(i,o){return Object.prototype.hasOwnProperty.call(i,o)};r.p="";return r(r.s=1)}([function(t,n){t.exports=e},function(t,n,r){"use strict";var i=r(0).layoutBase.LayoutConstants;var o=r(0).layoutBase.FDLayoutConstants;var a=r(0).CoSEConstants;var s=r(0).CoSELayout;var l=r(0).CoSENode;var u=r(0).layoutBase.PointD;var d=r(0).layoutBase.DimensionD;var f={ready:function w(){},stop:function w(){},quality:"default",nodeDimensionsIncludeLabels:false,refresh:30,fit:true,padding:10,randomize:true,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:true,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function h(w,_){var C={};for(var A in w){C[A]=w[A]}for(var A in _){C[A]=_[A]}return C};function m(w){this.options=h(f,w);g(this.options)}var g=function w(_){if(_.nodeRepulsion!=null)a.DEFAULT_REPULSION_STRENGTH=o.DEFAULT_REPULSION_STRENGTH=_.nodeRepulsion;if(_.idealEdgeLength!=null)a.DEFAULT_EDGE_LENGTH=o.DEFAULT_EDGE_LENGTH=_.idealEdgeLength;if(_.edgeElasticity!=null)a.DEFAULT_SPRING_STRENGTH=o.DEFAULT_SPRING_STRENGTH=_.edgeElasticity;if(_.nestingFactor!=null)a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=_.nestingFactor;if(_.gravity!=null)a.DEFAULT_GRAVITY_STRENGTH=o.DEFAULT_GRAVITY_STRENGTH=_.gravity;if(_.numIter!=null)a.MAX_ITERATIONS=o.MAX_ITERATIONS=_.numIter;if(_.gravityRange!=null)a.DEFAULT_GRAVITY_RANGE_FACTOR=o.DEFAULT_GRAVITY_RANGE_FACTOR=_.gravityRange;if(_.gravityCompound!=null)a.DEFAULT_COMPOUND_GRAVITY_STRENGTH=o.DEFAULT_COMPOUND_GRAVITY_STRENGTH=_.gravityCompound;if(_.gravityRangeCompound!=null)a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=_.gravityRangeCompound;if(_.initialEnergyOnIncremental!=null)a.DEFAULT_COOLING_FACTOR_INCREMENTAL=o.DEFAULT_COOLING_FACTOR_INCREMENTAL=_.initialEnergyOnIncremental;if(_.quality=="draft")i.QUALITY=0;else if(_.quality=="proof")i.QUALITY=2;else i.QUALITY=1;a.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=i.NODE_DIMENSIONS_INCLUDE_LABELS=_.nodeDimensionsIncludeLabels;a.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=i.DEFAULT_INCREMENTAL=!_.randomize;a.ANIMATE=o.ANIMATE=i.ANIMATE=_.animate;a.TILE=_.tile;a.TILING_PADDING_VERTICAL=typeof _.tilingPaddingVertical==="function"?_.tilingPaddingVertical.call():_.tilingPaddingVertical;a.TILING_PADDING_HORIZONTAL=typeof _.tilingPaddingHorizontal==="function"?_.tilingPaddingHorizontal.call():_.tilingPaddingHorizontal};m.prototype.run=function(){var w;var _;var C=this.options;var A=this.idToLNode={};var P=this.layout=new s;var L=this;L.stopped=false;this.cy=this.options.cy;this.cy.trigger({type:"layoutstart",layout:this});var I=P.newGraphManager();this.gm=I;var N=this.options.eles.nodes();var O=this.options.eles.edges();this.root=I.addRoot();this.processChildrenList(this.root,this.getTopMostNodes(N),P);for(var z=0;z0){var H;H=C.getGraphManager().add(C.newGraph(),N);this.processChildrenList(H,I,C)}}};m.prototype.stop=function(){this.stopped=true;return this};var x=function w(_){_("layout","cose-bilkent",m)};if(typeof cytoscape!=="undefined"){x(cytoscape)}t.exports=x}])})});var r2n={};Oo(r2n,{render:()=>hPi});function Kwn(e,t){e.forEach(n=>{const r={id:n.id,labelText:n.label,height:n.height,width:n.width,padding:n.padding??0};Object.keys(n).forEach(i=>{if(!["id","label","height","width","padding","x","y"].includes(i)){r[i]=n[i]}});t.add({group:"nodes",data:r,position:{x:n.x??0,y:n.y??0}})})}function Zwn(e,t){e.forEach(n=>{const r={id:n.id,source:n.start,target:n.end};Object.keys(n).forEach(i=>{if(!["id","start","end"].includes(i)){r[i]=n[i]}});t.add({group:"edges",data:r})})}function Jwn(e){return new Promise(t=>{const n=zr("body").append("div").attr("id","cy").attr("style","display:none");const r=O_({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});n.remove();Kwn(e.nodes,r);Zwn(e.edges,r);r.nodes().forEach(function(o){o.layoutDimensions=()=>{const a=o.data();return{w:a.width,h:a.height}}});const i={name:"cose-bilkent",quality:"proof",styleEnabled:false,animate:false};r.layout(i).run();r.ready(o=>{wt.info("Cytoscape ready",o);t(r)})})}function Qwn(e){return e.nodes().map(t=>{const n=t.data();const r=t.position();const i={id:n.id,x:r.x,y:r.y};Object.keys(n).forEach(o=>{if(o!=="id"){i[o]=n[o]}});return i})}function e2n(e){return e.edges().map(t=>{const n=t.data();const r=t._private.rscratch;const i={id:n.id,source:n.source,target:n.target,startX:r.startX,startY:r.startY,midX:r.midX,midY:r.midY,endX:r.endX,endY:r.endY};Object.keys(n).forEach(o=>{if(!["id","source","target"].includes(o)){i[o]=n[o]}});return i})}async function t2n(e,t){wt.debug("Starting cose-bilkent layout algorithm");try{n2n(e);const n=await Jwn(e);const r=Qwn(n);const i=e2n(n);wt.debug(`Layout completed: ${r.length} nodes, ${i.length} edges`);return{nodes:r,edges:i}}catch(n){wt.error("Error in cose-bilkent layout algorithm:",n);throw n}}function n2n(e){if(!e){throw new Error("Layout data is required")}if(!e.config){throw new Error("Configuration is required in layout data")}if(!e.rootNode){throw new Error("Root node is required")}if(!e.nodes||!Array.isArray(e.nodes)){throw new Error("No nodes found in layout data")}if(!Array.isArray(e.edges)){throw new Error("Edges array is required in layout data")}return true}var jwn,fPi,hPi;var i2n=Ce(()=>{Aa();Yo();Uet();jwn=Ui(Xwn(),1);ks();O_.use(jwn.default);B(Kwn,"addNodes");B(Zwn,"addEdges");B(Jwn,"createCytoscapeInstance");B(Qwn,"extractPositionedNodes");B(e2n,"extractPositionedEdges");B(t2n,"executeCoseBilkentLayout");B(n2n,"validateLayoutData");fPi=B(async(e,t,{insertCluster:n,insertEdge:r,insertEdgeLabel:i,insertMarkers:o,insertNode:a,log:s,positionEdgeLabel:l},{algorithm:u})=>{const d={};const f={};const h=t.select("g");o(h,e.markers,e.type,e.diagramId);const m=h.insert("g").attr("class","subgraphs");const g=h.insert("g").attr("class","edgePaths");const x=h.insert("g").attr("class","edgeLabels");const w=h.insert("g").attr("class","nodes");s.debug("Inserting nodes into DOM for dimension calculation");await Promise.all(e.nodes.map(async A=>{if(A.isGroup){const P={...A};f[A.id]=P;d[A.id]=P;await n(m,A)}else{const P={...A};d[A.id]=P;const L=await a(w,A,{config:e.config,dir:e.direction||"TB"});const I=L.node().getBBox();P.width=I.width;P.height=I.height;P.domId=L;s.debug(`Node ${A.id} dimensions: ${I.width}x${I.height}`)}}));s.debug("Running cose-bilkent layout algorithm");const _={...e,nodes:e.nodes.map(A=>{const P=d[A.id];return{...A,width:P.width,height:P.height}})};const C=await t2n(_,e.config);s.debug("Positioning nodes based on layout results");C.nodes.forEach(A=>{const P=d[A.id];if(P?.domId){P.domId.attr("transform",`translate(${A.x}, ${A.y})`);P.x=A.x;P.y=A.y;s.debug(`Positioned node ${P.id} at center (${A.x}, ${A.y})`)}});C.edges.forEach(A=>{const P=e.edges.find(L=>L.id===A.id);if(P){P.points=[{x:A.startX,y:A.startY},{x:A.midX,y:A.midY},{x:A.endX,y:A.endY}]}});s.debug("Inserting and positioning edges");await Promise.all(e.edges.map(async A=>{const P=await i(x,A);const L=d[A.start??""];const I=d[A.end??""];if(L&&I){const N=C.edges.find(O=>O.id===A.id);if(N){s.debug("APA01 positionedEdge",N);const O={...A};const z=r(g,O,f,e.type,L,I,e.diagramId);l(O,z)}else{const O={...A,points:[{x:L.x||0,y:L.y||0},{x:I.x||0,y:I.y||0}]};const z=r(g,O,f,e.type,L,I,e.diagramId);l(O,z)}}}));s.debug("Cose-bilkent rendering completed")},"render");hPi=fPi});var pPi,Fte,Yet,mPi,B_,nS;var Tx=Ce(()=>{yx();kg();nl();Ta();Aa();Yo();pPi={common:Ti,getConfig:Ji,insertCluster:wL,insertEdge:I$,insertEdgeLabel:nB,insertMarkers:M$,insertNode:kR,interpolateToCurve:xEe,labelHelper:Ya,log:wt,positionEdgeLabel:KEe};Fte={};Yet=B(e=>{for(const t of e){Fte[t.name]=t}},"registerLayoutLoaders");mPi=B(()=>{Yet([{name:"dagre",loader:B(async()=>await Promise.resolve().then(()=>(Mbn(),Ibn)),"loader")},{name:"swimlane",loader:B(async()=>await Promise.resolve().then(()=>(A1n(),S1n)),"loader")},...true?[{name:"cose-bilkent",loader:B(async()=>await Promise.resolve().then(()=>(i2n(),r2n)),"loader")}]:[]])},"registerDefaultLayoutLoaders");mPi();B_=B(async(e,t,n)=>{if(!(e.layoutAlgorithm in Fte)){throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`)}if(e.diagramId){for(const f of e.nodes){const h=f.domId||f.id;f.domId=`${e.diagramId}-${h}`}}const r=Fte[e.layoutAlgorithm];const i=await r.loader();const{theme:o,themeVariables:a}=e.config;const{useGradient:s,gradientStart:l,gradientStop:u}=a;const d=t.attr("id");t.append("defs").append("filter").attr("id",`${d}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${o?.includes("dark")?"#FFFFFF":"#000000"}`);t.append("defs").append("filter").attr("id",`${d}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${o?.includes("dark")?"#FFFFFF":"#000000"}`);if(s){const f=t.append("linearGradient").attr("id",t.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");f.append("svg:stop").attr("offset","0%").attr("stop-color",l).attr("stop-opacity",1);f.append("svg:stop").attr("offset","100%").attr("stop-color",u).attr("stop-opacity",1)}return i.render(e,t,pPi,{algorithm:r.algorithm},n)},"render");nS=B((e="",{fallback:t="dagre"}={})=>{if(e in Fte){return e}if(t in Fte){wt.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`);return t}throw new Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm")});var uG,ASe,kSe,o2n,a2n,s2n,l2n,Nte,RSe,c2n;var PSe=Ce(()=>{uG="comm";ASe="rule";kSe="decl";o2n="@media";a2n="@import";s2n="@supports";l2n="@namespace";Nte="@keyframes";RSe="@layer";c2n="@scope"});function ISe(e){return e.trim()}function Ote(e,t,n){return e.replace(t,n)}function OR(e,t){return e.charCodeAt(t)|0}function BR(e,t,n){return e.slice(t,n)}function wx(e){return e.length}function MSe(e){return e.length}function dG(e,t){return t.push(e),e}var u2n,CB;var fG=Ce(()=>{u2n=Math.abs;CB=String.fromCharCode});function DSe(e,t,n,r,i,o,a,s){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:LSe,column:hG,length:a,return:"",siblings:s}}function f2n(){return rp}function h2n(){rp=z_>0?OR(mG,--z_):0;if(hG--,rp===10)hG=1,LSe--;return rp}function U_(){rp=z_2||pG(rp)>3?"":" "}function y2n(e,t){while(--t&&U_())if(rp<48||rp>102||rp>57&&rp<65||rp>70&&rp<97)break;return FSe(e,Bte()+(t<6&&zR()==32&&U_()==32))}function qet(e){while(U_())switch(rp){case e:return z_;case 34:case 39:if(e!==34&&e!==39)qet(rp);break;case 40:if(e===41)qet(e);break;case 92:U_();break}return z_}function b2n(e,t){while(U_())if(e+rp===47+10)break;else if(e+rp===42+42&&zR()===47)break;return"/*"+FSe(t,z_-1)+"*"+CB(e===47?e:U_())}function x2n(e){while(!pG(zR()))U_();return FSe(e,z_)}var LSe,hG,d2n,z_,rp,mG;var Xet=Ce(()=>{fG();LSe=1;hG=1;d2n=0;z_=0;rp=0;mG=""});function T2n(e){return m2n(OSe("",null,null,null,[""],e=p2n(e),0,[0],e))}function OSe(e,t,n,r,i,o,a,s,l){var u=0;var d=0;var f=a;var h=0;var m=0;var g=0;var x=1;var w=1;var _=1;var C=0;var A=0;var P="";var L=i;var I=o;var N=r;var O=P;while(w)switch(g=A,A=U_()){case 40:if(g!=108&&OR(O,f-1)==58)C++,O+="(";else O+=NSe(A);break;case 41:C--,O+=")";break;case 34:case 39:case 91:O+=NSe(A);break;case 9:case 10:case 13:case 32:if(C>0){O+=CB(A);break}O+=g2n(g);break;case 92:O+=y2n(Bte()-1,7);continue;case 47:switch(zR()){case 42:case 47:dG(yPi(b2n(U_(),Bte()),t,n,l),l);if((pG(g||1)==5||pG(zR()||1)==5)&&wx(O)&&BR(O,-1,void 0)!==" ")O+=" ";break;default:O+="/"}break;case 123*x:s[u++]=wx(O)*_;case 125*x:case 59:case 0:if(C>0&&A){O+=CB(A);break}switch(A){case 0:case 125:w=0;case 59+d:if(_==-1)O=Ote(O,/\f/g,"");if(m>0&&(wx(O)-f||x===0))dG(m>32?_2n(O+";",r,n,f-1,l):_2n(Ote(O," ","")+";",r,n,f-2,l),l);break;case 59:O+=";";default:dG(N=v2n(O,t,n,u,d,i,s,P,L=[],I=[],f,o),o);if(A===123)if(d===0)OSe(O,t,N,N,L,o,f,s,I);else{switch(h){case 99:if(OR(O,3)===110)break;case 108:if(OR(O,2)===97)break;default:d=0;case 100:case 109:case 115:}if(d)OSe(e,N,N,r&&dG(v2n(e,N,N,0,0,i,s,P,i,L=[],f,I),I),i,I,f,s,r?L:I);else OSe(O,N,N,N,[""],I,0,s,I)}}u=d=m=0,x=_=1,P=O="",f=a;break;case 58:f=1+wx(O),m=g;default:if(x<1){if(A==123)--x;else if(A==125&&x++==0&&h2n()==125)continue}switch(O+=CB(A),A*x){case 38:_=d>0?1:(O+="\f",-1);break;case 44:if(C>0)break;s[u++]=(wx(O)-1)*_,_=1;break;case 64:if(zR()===45)O+=NSe(U_());h=zR(),d=f=wx(P=O+=x2n(Bte())),A++;break;case 45:if(g===45&&wx(O)==2)x=0}}return o}function v2n(e,t,n,r,i,o,a,s,l,u,d,f){var h=i-1;var m=i===0?o:[""];var g=MSe(m);for(var x=0,w=0,_=0;x0?m[C]+" "+A:Ote(A,/&\f/g,m[C])))l[_++]=P;return DSe(e,t,n,i===0?ASe:s,l,u,d,f)}function yPi(e,t,n,r){return DSe(e,t,n,uG,CB(f2n()),BR(e,2,-2),0,r)}function _2n(e,t,n,r,i){return DSe(e,t,n,kSe,BR(e,0,r),BR(e,r+1,-1),r,i)}var w2n=Ce(()=>{PSe();fG();Xet()});var E2n=Ce(()=>{});function BSe(e,t){var n="";for(var r=0;r{PSe();fG()});function A2n(e){var t=MSe(e);return function(n,r,i,o){var a="";for(var s=0;s{fG()});var R2n=Ce(()=>{PSe();fG();w2n();E2n();Xet();S2n();k2n()});var jet,SB,zSe,P2n,USe,VSe,Xy,$Se,gG;var sv=Ce(()=>{Ta();Yo();jet=Ui(p$(),1);ks();SB=B((e,t)=>{const n=e.append("rect");n.attr("x",t.x);n.attr("y",t.y);n.attr("fill",t.fill);n.attr("stroke",t.stroke);n.attr("width",t.width);n.attr("height",t.height);if(t.name){n.attr("name",t.name)}if(t.rx){n.attr("rx",t.rx)}if(t.ry){n.attr("ry",t.ry)}if(t.attrs!==void 0){for(const r in t.attrs){n.attr(r,t.attrs[r])}}if(t.class){n.attr("class",t.class)}return n},"drawRect");zSe=B((e,t)=>{const n={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};const r=SB(e,n);r.lower()},"drawBackgroundRect");P2n=B((e,t)=>{const n=t.text.replace(O5," ");const r=e.append("text");r.attr("x",t.x);r.attr("y",t.y);r.attr("class","legend");r.style("text-anchor",t.anchor);if(t.class){r.attr("class",t.class)}const i=r.append("tspan");i.attr("x",t.x+t.textMargin*2);i.text(n);return r},"drawText");USe=B((e,t,n,r)=>{const i=e.append("image");i.attr("x",t);i.attr("y",n);const o=(0,jet.sanitizeUrl)(r);i.attr("xlink:href",o)},"drawImage");VSe=B((e,t,n,r)=>{const i=e.append("use");i.attr("x",t);i.attr("y",n);const o=(0,jet.sanitizeUrl)(r);i.attr("xlink:href",`#${o}`)},"drawEmbeddedImage");Xy=B(()=>{const e={x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0};return e},"getNoteRect");$Se=B(()=>{const e={x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:true};return e},"getTextObj");gG=B(()=>{let e=zr(".mermaidTooltip");if(e.empty()){e=zr("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")}return e},"createTooltip")});var $2n={};Oo($2n,{diagram:()=>uIi});function $_(e,t,n,r,i){if(!t[e].width){if(n){t[e].text=j5(t[e].text,i,r);t[e].textLines=t[e].text.split(Ti.lineBreakRegex).length;t[e].width=i;t[e].height=Aee(t[e].text,r)}else{let o=t[e].text.split(Ti.lineBreakRegex);t[e].textLines=o.length;let a=0;t[e].height=0;t[e].width=0;for(const s of o){t[e].width=Math.max(Cg(s,r),t[e].width);a=Aee(s,r);t[e].height=t[e].height+a}}}}function ntt(e,t,n,r,i){let o=new z2n(i);o.data.widthLimit=n.data.widthLimit/Math.min(Zet,r.length);for(let[a,s]of r.entries()){let l=0;s.image={width:0,height:0,Y:0};if(s.sprite){s.image.width=48;s.image.height=48;s.image.Y=l;l=s.image.Y+s.image.height}let u=s.wrap&&ra.wrap;let d=GSe(ra);d.fontSize=d.fontSize+2;d.fontWeight="bold";$_("label",s,u,d,o.data.widthLimit);s.label.Y=l+8;l=s.label.Y+s.label.height;if(s.type&&s.type.text!==""){s.type.text="["+s.type.text+"]";let g=GSe(ra);$_("type",s,u,g,o.data.widthLimit);s.type.Y=l+5;l=s.type.Y+s.type.height}if(s.descr&&s.descr.text!==""){let g=GSe(ra);g.fontSize=g.fontSize-2;$_("descr",s,u,g,o.data.widthLimit);s.descr.Y=l+20;l=s.descr.Y+s.descr.height}if(a==0||a%Zet===0){let g=n.data.startx+ra.diagramMarginX;let x=n.data.stopy+ra.diagramMarginY+l;o.setData(g,g,x,x)}else{let g=o.data.stopx!==o.data.startx?o.data.stopx+ra.diagramMarginX:o.data.startx;let x=o.data.starty;o.setData(g,g,x,x)}o.name=s.alias;let f=i.db.getC4ShapeArray(s.alias);let h=i.db.getC4ShapeKeys(s.alias);if(h.length>0){V2n(o,e,f,h)}t=s.alias;let m=i.db.getBoundaries(t);if(m.length>0){ntt(e,t,o,m,i)}if(s.alias!=="global"){U2n(e,s,o)}n.data.stopy=Math.max(o.data.stopy+ra.c4ShapeMargin,n.data.stopy);n.data.stopx=Math.max(o.data.stopx+ra.c4ShapeMargin,n.data.stopx);qSe=Math.max(qSe,n.data.stopx);XSe=Math.max(XSe,n.data.stopy)}}var N2n,HSe,bPi,Nw,KL,nb,Fw,iS,Ute,Qet,ett,WSe,YSe,L2n,xPi,vPi,_Pi,TPi,wPi,EPi,CPi,SPi,APi,kPi,RPi,PPi,IPi,MPi,LPi,DPi,FPi,D2n,NPi,OPi,F2n,BPi,zPi,UPi,VPi,ZL,$Pi,GPi,HPi,WPi,YPi,Ket,ttt,O2n,qPi,XPi,jPi,KPi,ZPi,JPi,QPi,eIi,tIi,nIi,rIi,UR,rS,qSe,XSe,B2n,Zet,ra,z2n,Jet,zte,GSe,iIi,U2n,V2n,V_,I2n,oIi,aIi,sIi,M2n,lIi,cIi,uIi;var G2n=Ce(()=>{sv();nl();Ta();Aa();Yo();ks();N2n=Ui(p$(),1);HSe=function(){var e=B(function(Te,we,Ze,Be){for(Ze=Ze||{},Be=Te.length;Be--;Ze[Te[Be]]=we);return Ze},"o"),t=[1,24],n=[1,25],r=[1,26],i=[1,27],o=[1,28],a=[1,63],s=[1,64],l=[1,65],u=[1,66],d=[1,67],f=[1,68],h=[1,69],m=[1,29],g=[1,30],x=[1,31],w=[1,32],_=[1,33],C=[1,34],A=[1,35],P=[1,36],L=[1,37],I=[1,38],N=[1,39],O=[1,40],z=[1,41],U=[1,42],W=[1,43],H=[1,44],$=[1,45],K=[1,46],X=[1,47],j=[1,48],te=[1,50],J=[1,51],oe=[1,52],se=[1,53],re=[1,54],ce=[1,55],ue=[1,56],xe=[1,57],be=[1,58],Ie=[1,59],he=[1,60],ve=[14,42],ge=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Ve=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Le=[1,82],$e=[1,83],Ee=[1,84],tt=[1,85],yt=[12,14,42],mt=[12,14,33,42],ct=[12,14,33,42,76,77,79,80],Ge=[12,33],it=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74];var bt={trace:B(function Te(){},"trace"),yy:{},symbols_:{"error":2,"start":3,"mermaidDoc":4,"direction":5,"direction_tb":6,"direction_bt":7,"direction_rl":8,"direction_lr":9,"graphConfig":10,"C4_CONTEXT":11,"NEWLINE":12,"statements":13,"EOF":14,"C4_CONTAINER":15,"C4_COMPONENT":16,"C4_DYNAMIC":17,"C4_DEPLOYMENT":18,"otherStatements":19,"diagramStatements":20,"otherStatement":21,"title":22,"accDescription":23,"acc_title":24,"acc_title_value":25,"acc_descr":26,"acc_descr_value":27,"acc_descr_multiline_value":28,"boundaryStatement":29,"boundaryStartStatement":30,"boundaryStopStatement":31,"boundaryStart":32,"LBRACE":33,"ENTERPRISE_BOUNDARY":34,"attributes":35,"SYSTEM_BOUNDARY":36,"BOUNDARY":37,"CONTAINER_BOUNDARY":38,"NODE":39,"NODE_L":40,"NODE_R":41,"RBRACE":42,"diagramStatement":43,"PERSON":44,"PERSON_EXT":45,"SYSTEM":46,"SYSTEM_DB":47,"SYSTEM_QUEUE":48,"SYSTEM_EXT":49,"SYSTEM_EXT_DB":50,"SYSTEM_EXT_QUEUE":51,"CONTAINER":52,"CONTAINER_DB":53,"CONTAINER_QUEUE":54,"CONTAINER_EXT":55,"CONTAINER_EXT_DB":56,"CONTAINER_EXT_QUEUE":57,"COMPONENT":58,"COMPONENT_DB":59,"COMPONENT_QUEUE":60,"COMPONENT_EXT":61,"COMPONENT_EXT_DB":62,"COMPONENT_EXT_QUEUE":63,"REL":64,"BIREL":65,"REL_U":66,"REL_D":67,"REL_L":68,"REL_R":69,"REL_B":70,"REL_INDEX":71,"UPDATE_EL_STYLE":72,"UPDATE_REL_STYLE":73,"UPDATE_LAYOUT_CONFIG":74,"attribute":75,"STR":76,"STR_KEY":77,"STR_VALUE":78,"ATTRIBUTE":79,"ATTRIBUTE_EMPTY":80,"$accept":0,"$end":1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:B(function Te(we,Ze,Be,qe,Qe,ze,Me){var ye=ze.length-1;switch(Qe){case 3:qe.setDirection("TB");break;case 4:qe.setDirection("BT");break;case 5:qe.setDirection("RL");break;case 6:qe.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:qe.setC4Type(ze[ye-3]);break;case 19:qe.setTitle(ze[ye].substring(6));this.$=ze[ye].substring(6);break;case 20:qe.setAccDescription(ze[ye].substring(15));this.$=ze[ye].substring(15);break;case 21:this.$=ze[ye].trim();qe.setTitle(this.$);break;case 22:case 23:this.$=ze[ye].trim();qe.setAccDescription(this.$);break;case 28:ze[ye].splice(2,0,"ENTERPRISE");qe.addPersonOrSystemBoundary(...ze[ye]);this.$=ze[ye];break;case 29:ze[ye].splice(2,0,"SYSTEM");qe.addPersonOrSystemBoundary(...ze[ye]);this.$=ze[ye];break;case 30:qe.addPersonOrSystemBoundary(...ze[ye]);this.$=ze[ye];break;case 31:ze[ye].splice(2,0,"CONTAINER");qe.addContainerBoundary(...ze[ye]);this.$=ze[ye];break;case 32:qe.addDeploymentNode("node",...ze[ye]);this.$=ze[ye];break;case 33:qe.addDeploymentNode("nodeL",...ze[ye]);this.$=ze[ye];break;case 34:qe.addDeploymentNode("nodeR",...ze[ye]);this.$=ze[ye];break;case 35:qe.popBoundaryParseStack();break;case 39:qe.addPersonOrSystem("person",...ze[ye]);this.$=ze[ye];break;case 40:qe.addPersonOrSystem("external_person",...ze[ye]);this.$=ze[ye];break;case 41:qe.addPersonOrSystem("system",...ze[ye]);this.$=ze[ye];break;case 42:qe.addPersonOrSystem("system_db",...ze[ye]);this.$=ze[ye];break;case 43:qe.addPersonOrSystem("system_queue",...ze[ye]);this.$=ze[ye];break;case 44:qe.addPersonOrSystem("external_system",...ze[ye]);this.$=ze[ye];break;case 45:qe.addPersonOrSystem("external_system_db",...ze[ye]);this.$=ze[ye];break;case 46:qe.addPersonOrSystem("external_system_queue",...ze[ye]);this.$=ze[ye];break;case 47:qe.addContainer("container",...ze[ye]);this.$=ze[ye];break;case 48:qe.addContainer("container_db",...ze[ye]);this.$=ze[ye];break;case 49:qe.addContainer("container_queue",...ze[ye]);this.$=ze[ye];break;case 50:qe.addContainer("external_container",...ze[ye]);this.$=ze[ye];break;case 51:qe.addContainer("external_container_db",...ze[ye]);this.$=ze[ye];break;case 52:qe.addContainer("external_container_queue",...ze[ye]);this.$=ze[ye];break;case 53:qe.addComponent("component",...ze[ye]);this.$=ze[ye];break;case 54:qe.addComponent("component_db",...ze[ye]);this.$=ze[ye];break;case 55:qe.addComponent("component_queue",...ze[ye]);this.$=ze[ye];break;case 56:qe.addComponent("external_component",...ze[ye]);this.$=ze[ye];break;case 57:qe.addComponent("external_component_db",...ze[ye]);this.$=ze[ye];break;case 58:qe.addComponent("external_component_queue",...ze[ye]);this.$=ze[ye];break;case 60:qe.addRel("rel",...ze[ye]);this.$=ze[ye];break;case 61:qe.addRel("birel",...ze[ye]);this.$=ze[ye];break;case 62:qe.addRel("rel_u",...ze[ye]);this.$=ze[ye];break;case 63:qe.addRel("rel_d",...ze[ye]);this.$=ze[ye];break;case 64:qe.addRel("rel_l",...ze[ye]);this.$=ze[ye];break;case 65:qe.addRel("rel_r",...ze[ye]);this.$=ze[ye];break;case 66:qe.addRel("rel_b",...ze[ye]);this.$=ze[ye];break;case 67:ze[ye].splice(0,1);qe.addRel("rel",...ze[ye]);this.$=ze[ye];break;case 68:qe.updateElStyle("update_el_style",...ze[ye]);this.$=ze[ye];break;case 69:qe.updateRelStyle("update_rel_style",...ze[ye]);this.$=ze[ye];break;case 70:qe.updateLayoutConfig("update_layout_config",...ze[ye]);this.$=ze[ye];break;case 71:this.$=[ze[ye]];break;case 72:ze[ye].unshift(ze[ye-1]);this.$=ze[ye];break;case 73:case 75:this.$=ze[ye].trim();break;case 74:let Ne={};Ne[ze[ye-1].trim()]=ze[ye].trim();this.$=Ne;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:t,23:n,24:r,26:i,28:o,29:49,30:61,32:62,34:a,36:s,37:l,38:u,39:d,40:f,41:h,43:23,44:m,45:g,46:x,47:w,48:_,49:C,50:A,51:P,52:L,53:I,54:N,55:O,56:z,57:U,58:W,59:H,60:$,61:K,62:X,63:j,64:te,65:J,66:oe,67:se,68:re,69:ce,70:ue,71:xe,72:be,73:Ie,74:he},{13:70,19:20,20:21,21:22,22:t,23:n,24:r,26:i,28:o,29:49,30:61,32:62,34:a,36:s,37:l,38:u,39:d,40:f,41:h,43:23,44:m,45:g,46:x,47:w,48:_,49:C,50:A,51:P,52:L,53:I,54:N,55:O,56:z,57:U,58:W,59:H,60:$,61:K,62:X,63:j,64:te,65:J,66:oe,67:se,68:re,69:ce,70:ue,71:xe,72:be,73:Ie,74:he},{13:71,19:20,20:21,21:22,22:t,23:n,24:r,26:i,28:o,29:49,30:61,32:62,34:a,36:s,37:l,38:u,39:d,40:f,41:h,43:23,44:m,45:g,46:x,47:w,48:_,49:C,50:A,51:P,52:L,53:I,54:N,55:O,56:z,57:U,58:W,59:H,60:$,61:K,62:X,63:j,64:te,65:J,66:oe,67:se,68:re,69:ce,70:ue,71:xe,72:be,73:Ie,74:he},{13:72,19:20,20:21,21:22,22:t,23:n,24:r,26:i,28:o,29:49,30:61,32:62,34:a,36:s,37:l,38:u,39:d,40:f,41:h,43:23,44:m,45:g,46:x,47:w,48:_,49:C,50:A,51:P,52:L,53:I,54:N,55:O,56:z,57:U,58:W,59:H,60:$,61:K,62:X,63:j,64:te,65:J,66:oe,67:se,68:re,69:ce,70:ue,71:xe,72:be,73:Ie,74:he},{13:73,19:20,20:21,21:22,22:t,23:n,24:r,26:i,28:o,29:49,30:61,32:62,34:a,36:s,37:l,38:u,39:d,40:f,41:h,43:23,44:m,45:g,46:x,47:w,48:_,49:C,50:A,51:P,52:L,53:I,54:N,55:O,56:z,57:U,58:W,59:H,60:$,61:K,62:X,63:j,64:te,65:J,66:oe,67:se,68:re,69:ce,70:ue,71:xe,72:be,73:Ie,74:he},{14:[1,74]},e(ve,[2,13],{43:23,29:49,30:61,32:62,20:75,34:a,36:s,37:l,38:u,39:d,40:f,41:h,44:m,45:g,46:x,47:w,48:_,49:C,50:A,51:P,52:L,53:I,54:N,55:O,56:z,57:U,58:W,59:H,60:$,61:K,62:X,63:j,64:te,65:J,66:oe,67:se,68:re,69:ce,70:ue,71:xe,72:be,73:Ie,74:he}),e(ve,[2,14]),e(ge,[2,16],{12:[1,76]}),e(ve,[2,36],{12:[1,77]}),e(Ve,[2,19]),e(Ve,[2,20]),{25:[1,78]},{27:[1,79]},e(Ve,[2,23]),{35:80,75:81,76:Le,77:$e,79:Ee,80:tt},{35:86,75:81,76:Le,77:$e,79:Ee,80:tt},{35:87,75:81,76:Le,77:$e,79:Ee,80:tt},{35:88,75:81,76:Le,77:$e,79:Ee,80:tt},{35:89,75:81,76:Le,77:$e,79:Ee,80:tt},{35:90,75:81,76:Le,77:$e,79:Ee,80:tt},{35:91,75:81,76:Le,77:$e,79:Ee,80:tt},{35:92,75:81,76:Le,77:$e,79:Ee,80:tt},{35:93,75:81,76:Le,77:$e,79:Ee,80:tt},{35:94,75:81,76:Le,77:$e,79:Ee,80:tt},{35:95,75:81,76:Le,77:$e,79:Ee,80:tt},{35:96,75:81,76:Le,77:$e,79:Ee,80:tt},{35:97,75:81,76:Le,77:$e,79:Ee,80:tt},{35:98,75:81,76:Le,77:$e,79:Ee,80:tt},{35:99,75:81,76:Le,77:$e,79:Ee,80:tt},{35:100,75:81,76:Le,77:$e,79:Ee,80:tt},{35:101,75:81,76:Le,77:$e,79:Ee,80:tt},{35:102,75:81,76:Le,77:$e,79:Ee,80:tt},{35:103,75:81,76:Le,77:$e,79:Ee,80:tt},{35:104,75:81,76:Le,77:$e,79:Ee,80:tt},e(yt,[2,59]),{35:105,75:81,76:Le,77:$e,79:Ee,80:tt},{35:106,75:81,76:Le,77:$e,79:Ee,80:tt},{35:107,75:81,76:Le,77:$e,79:Ee,80:tt},{35:108,75:81,76:Le,77:$e,79:Ee,80:tt},{35:109,75:81,76:Le,77:$e,79:Ee,80:tt},{35:110,75:81,76:Le,77:$e,79:Ee,80:tt},{35:111,75:81,76:Le,77:$e,79:Ee,80:tt},{35:112,75:81,76:Le,77:$e,79:Ee,80:tt},{35:113,75:81,76:Le,77:$e,79:Ee,80:tt},{35:114,75:81,76:Le,77:$e,79:Ee,80:tt},{35:115,75:81,76:Le,77:$e,79:Ee,80:tt},{20:116,29:49,30:61,32:62,34:a,36:s,37:l,38:u,39:d,40:f,41:h,43:23,44:m,45:g,46:x,47:w,48:_,49:C,50:A,51:P,52:L,53:I,54:N,55:O,56:z,57:U,58:W,59:H,60:$,61:K,62:X,63:j,64:te,65:J,66:oe,67:se,68:re,69:ce,70:ue,71:xe,72:be,73:Ie,74:he},{12:[1,118],33:[1,117]},{35:119,75:81,76:Le,77:$e,79:Ee,80:tt},{35:120,75:81,76:Le,77:$e,79:Ee,80:tt},{35:121,75:81,76:Le,77:$e,79:Ee,80:tt},{35:122,75:81,76:Le,77:$e,79:Ee,80:tt},{35:123,75:81,76:Le,77:$e,79:Ee,80:tt},{35:124,75:81,76:Le,77:$e,79:Ee,80:tt},{35:125,75:81,76:Le,77:$e,79:Ee,80:tt},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},e(ve,[2,15]),e(ge,[2,17],{21:22,19:130,22:t,23:n,24:r,26:i,28:o}),e(ve,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:n,24:r,26:i,28:o,34:a,36:s,37:l,38:u,39:d,40:f,41:h,44:m,45:g,46:x,47:w,48:_,49:C,50:A,51:P,52:L,53:I,54:N,55:O,56:z,57:U,58:W,59:H,60:$,61:K,62:X,63:j,64:te,65:J,66:oe,67:se,68:re,69:ce,70:ue,71:xe,72:be,73:Ie,74:he}),e(Ve,[2,21]),e(Ve,[2,22]),e(yt,[2,39]),e(mt,[2,71],{75:81,35:132,76:Le,77:$e,79:Ee,80:tt}),e(ct,[2,73]),{78:[1,133]},e(ct,[2,75]),e(ct,[2,76]),e(yt,[2,40]),e(yt,[2,41]),e(yt,[2,42]),e(yt,[2,43]),e(yt,[2,44]),e(yt,[2,45]),e(yt,[2,46]),e(yt,[2,47]),e(yt,[2,48]),e(yt,[2,49]),e(yt,[2,50]),e(yt,[2,51]),e(yt,[2,52]),e(yt,[2,53]),e(yt,[2,54]),e(yt,[2,55]),e(yt,[2,56]),e(yt,[2,57]),e(yt,[2,58]),e(yt,[2,60]),e(yt,[2,61]),e(yt,[2,62]),e(yt,[2,63]),e(yt,[2,64]),e(yt,[2,65]),e(yt,[2,66]),e(yt,[2,67]),e(yt,[2,68]),e(yt,[2,69]),e(yt,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},e(Ge,[2,28]),e(Ge,[2,29]),e(Ge,[2,30]),e(Ge,[2,31]),e(Ge,[2,32]),e(Ge,[2,33]),e(Ge,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},e(ge,[2,18]),e(ve,[2,38]),e(mt,[2,72]),e(ct,[2,74]),e(yt,[2,24]),e(yt,[2,35]),e(it,[2,25]),e(it,[2,26],{12:[1,138]}),e(it,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:B(function Te(we,Ze){if(Ze.recoverable){this.trace(we)}else{var Be=new Error(we);Be.hash=Ze;throw Be}},"parseError"),parse:B(function Te(we){var Ze=this,Be=[0],qe=[],Qe=[null],ze=[],Me=this.table,ye="",Ne=0,Ae=0,dt=0,Oe=2,Wt=1;var kt=ze.slice.call(arguments,1);var qt=Object.create(this.lexer);var _t={yy:{}};for(var sn in this.yy){if(Object.prototype.hasOwnProperty.call(this.yy,sn)){_t.yy[sn]=this.yy[sn]}}qt.setInput(we,_t.yy);_t.yy.lexer=qt;_t.yy.parser=this;if(typeof qt.yylloc=="undefined"){qt.yylloc={}}var Jt=qt.yylloc;ze.push(Jt);var Sn=qt.options&&qt.options.ranges;if(typeof _t.yy.parseError==="function"){this.parseError=_t.yy.parseError}else{this.parseError=Object.getPrototypeOf(this).parseError}function Kt(dr){Be.length=Be.length-2*dr;Qe.length=Qe.length-dr;ze.length=ze.length-dr}B(Kt,"popStack");function mn(){var dr;dr=qe.pop()||qt.lex()||Wt;if(typeof dr!=="number"){if(dr instanceof Array){qe=dr;dr=qe.pop()}dr=Ze.symbols_[dr]||dr}return dr}B(mn,"lex");var At,lr,on,cr,Hr,Mr,Er={},vr,Yr,nt,Rr;while(true){on=Be[Be.length-1];if(this.defaultActions[on]){cr=this.defaultActions[on]}else{if(At===null||typeof At=="undefined"){At=mn()}cr=Me[on]&&Me[on][At]}if(typeof cr==="undefined"||!cr.length||!cr[0]){var Xr="";Rr=[];for(vr in Me[on]){if(this.terminals_[vr]&&vr>Oe){Rr.push("'"+this.terminals_[vr]+"'")}}if(qt.showPosition){Xr="Parse error on line "+(Ne+1)+":\n"+qt.showPosition()+"\nExpecting "+Rr.join(", ")+", got '"+(this.terminals_[At]||At)+"'"}else{Xr="Parse error on line "+(Ne+1)+": Unexpected "+(At==Wt?"end of input":"'"+(this.terminals_[At]||At)+"'")}this.parseError(Xr,{text:qt.match,token:this.terminals_[At]||At,line:qt.yylineno,loc:Jt,expected:Rr})}if(cr[0]instanceof Array&&cr.length>1){throw new Error("Parse Error: multiple actions possible at state: "+on+", token: "+At)}switch(cr[0]){case 1:Be.push(At);Qe.push(qt.yytext);ze.push(qt.yylloc);Be.push(cr[1]);At=null;if(!lr){Ae=qt.yyleng;ye=qt.yytext;Ne=qt.yylineno;Jt=qt.yylloc;if(dt>0){dt--}}else{At=lr;lr=null}break;case 2:Yr=this.productions_[cr[1]][1];Er.$=Qe[Qe.length-Yr];Er._$={first_line:ze[ze.length-(Yr||1)].first_line,last_line:ze[ze.length-1].last_line,first_column:ze[ze.length-(Yr||1)].first_column,last_column:ze[ze.length-1].last_column};if(Sn){Er._$.range=[ze[ze.length-(Yr||1)].range[0],ze[ze.length-1].range[1]]}Mr=this.performAction.apply(Er,[ye,Ae,Ne,_t.yy,cr[1],Qe,ze].concat(kt));if(typeof Mr!=="undefined"){return Mr}if(Yr){Be=Be.slice(0,-1*Yr*2);Qe=Qe.slice(0,-1*Yr);ze=ze.slice(0,-1*Yr)}Be.push(this.productions_[cr[1]][0]);Qe.push(Er.$);ze.push(Er._$);nt=Me[Be[Be.length-2]][Be[Be.length-1]];Be.push(nt);break;case 3:return true}}return true},"parse")};var He=function(){var Te={EOF:1,parseError:B(function we(Ze,Be){if(this.yy.parser){this.yy.parser.parseError(Ze,Be)}else{throw new Error(Ze)}},"parseError"),setInput:B(function(we,Ze){this.yy=Ze||this.yy||{};this._input=we;this._more=this._backtrack=this.done=false;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};if(this.options.ranges){this.yylloc.range=[0,0]}this.offset=0;return this},"setInput"),input:B(function(){var we=this._input[0];this.yytext+=we;this.yyleng++;this.offset++;this.match+=we;this.matched+=we;var Ze=we.match(/(?:\r\n?|\n).*/g);if(Ze){this.yylineno++;this.yylloc.last_line++}else{this.yylloc.last_column++}if(this.options.ranges){this.yylloc.range[1]++}this._input=this._input.slice(1);return we},"input"),unput:B(function(we){var Ze=we.length;var Be=we.split(/(?:\r\n?|\n)/g);this._input=we+this._input;this.yytext=this.yytext.substr(0,this.yytext.length-Ze);this.offset-=Ze;var qe=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1);this.matched=this.matched.substr(0,this.matched.length-1);if(Be.length-1){this.yylineno-=Be.length-1}var Qe=this.yylloc.range;this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Be?(Be.length===qe.length?this.yylloc.first_column:0)+qe[qe.length-Be.length].length-Be[0].length:this.yylloc.first_column-Ze};if(this.options.ranges){this.yylloc.range=[Qe[0],Qe[0]+this.yyleng-Ze]}this.yyleng=this.yytext.length;return this},"unput"),more:B(function(){this._more=true;return this},"more"),reject:B(function(){if(this.options.backtrack_lexer){this._backtrack=true}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}return this},"reject"),less:B(function(we){this.unput(this.match.slice(we))},"less"),pastInput:B(function(){var we=this.matched.substr(0,this.matched.length-this.match.length);return(we.length>20?"...":"")+we.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:B(function(){var we=this.match;if(we.length<20){we+=this._input.substr(0,20-we.length)}return(we.substr(0,20)+(we.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:B(function(){var we=this.pastInput();var Ze=new Array(we.length+1).join("-");return we+this.upcomingInput()+"\n"+Ze+"^"},"showPosition"),test_match:B(function(we,Ze){var Be,qe,Qe;if(this.options.backtrack_lexer){Qe={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done};if(this.options.ranges){Qe.yylloc.range=this.yylloc.range.slice(0)}}qe=we[0].match(/(?:\r\n?|\n).*/g);if(qe){this.yylineno+=qe.length}this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:qe?qe[qe.length-1].length-qe[qe.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+we[0].length};this.yytext+=we[0];this.match+=we[0];this.matches=we;this.yyleng=this.yytext.length;if(this.options.ranges){this.yylloc.range=[this.offset,this.offset+=this.yyleng]}this._more=false;this._backtrack=false;this._input=this._input.slice(we[0].length);this.matched+=we[0];Be=this.performAction.call(this,this.yy,this,Ze,this.conditionStack[this.conditionStack.length-1]);if(this.done&&this._input){this.done=false}if(Be){return Be}else if(this._backtrack){for(var ze in Qe){this[ze]=Qe[ze]}return false}return false},"test_match"),next:B(function(){if(this.done){return this.EOF}if(!this._input){this.done=true}var we,Ze,Be,qe;if(!this._more){this.yytext="";this.match=""}var Qe=this._currentRules();for(var ze=0;zeZe[0].length)){Ze=Be;qe=ze;if(this.options.backtrack_lexer){we=this.test_match(Be,Qe[ze]);if(we!==false){return we}else if(this._backtrack){Ze=false;continue}else{return false}}else if(!this.options.flex){break}}}if(Ze){we=this.test_match(Ze,Qe[qe]);if(we!==false){return we}return false}if(this._input===""){return this.EOF}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}},"next"),lex:B(function we(){var Ze=this.next();if(Ze){return Ze}else{return this.lex()}},"lex"),begin:B(function we(Ze){this.conditionStack.push(Ze)},"begin"),popState:B(function we(){var Ze=this.conditionStack.length-1;if(Ze>0){return this.conditionStack.pop()}else{return this.conditionStack[0]}},"popState"),_currentRules:B(function we(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules}else{return this.conditions["INITIAL"].rules}},"_currentRules"),topState:B(function we(Ze){Ze=this.conditionStack.length-1-Math.abs(Ze||0);if(Ze>=0){return this.conditionStack[Ze]}else{return"INITIAL"}},"topState"),pushState:B(function we(Ze){this.begin(Ze)},"pushState"),stateStackSize:B(function we(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:B(function we(Ze,Be,qe,Qe){var ze=Qe;switch(qe){case 0:return 6;break;case 1:return 7;break;case 2:return 8;break;case 3:return 9;break;case 4:return 22;break;case 5:return 23;break;case 6:this.begin("acc_title");return 24;break;case 7:this.popState();return"acc_title_value";break;case 8:this.begin("acc_descr");return 26;break;case 9:this.popState();return"acc_descr_value";break;case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";break;case 13:break;case 14:c;break;case 15:return 12;break;case 16:break;case 17:return 11;break;case 18:return 15;break;case 19:return 16;break;case 20:return 17;break;case 21:return 18;break;case 22:this.begin("person_ext");return 45;break;case 23:this.begin("person");return 44;break;case 24:this.begin("system_ext_queue");return 51;break;case 25:this.begin("system_ext_db");return 50;break;case 26:this.begin("system_ext");return 49;break;case 27:this.begin("system_queue");return 48;break;case 28:this.begin("system_db");return 47;break;case 29:this.begin("system");return 46;break;case 30:this.begin("boundary");return 37;break;case 31:this.begin("enterprise_boundary");return 34;break;case 32:this.begin("system_boundary");return 36;break;case 33:this.begin("container_ext_queue");return 57;break;case 34:this.begin("container_ext_db");return 56;break;case 35:this.begin("container_ext");return 55;break;case 36:this.begin("container_queue");return 54;break;case 37:this.begin("container_db");return 53;break;case 38:this.begin("container");return 52;break;case 39:this.begin("container_boundary");return 38;break;case 40:this.begin("component_ext_queue");return 63;break;case 41:this.begin("component_ext_db");return 62;break;case 42:this.begin("component_ext");return 61;break;case 43:this.begin("component_queue");return 60;break;case 44:this.begin("component_db");return 59;break;case 45:this.begin("component");return 58;break;case 46:this.begin("node");return 39;break;case 47:this.begin("node");return 39;break;case 48:this.begin("node_l");return 40;break;case 49:this.begin("node_r");return 41;break;case 50:this.begin("rel");return 64;break;case 51:this.begin("birel");return 65;break;case 52:this.begin("rel_u");return 66;break;case 53:this.begin("rel_u");return 66;break;case 54:this.begin("rel_d");return 67;break;case 55:this.begin("rel_d");return 67;break;case 56:this.begin("rel_l");return 68;break;case 57:this.begin("rel_l");return 68;break;case 58:this.begin("rel_r");return 69;break;case 59:this.begin("rel_r");return 69;break;case 60:this.begin("rel_b");return 70;break;case 61:this.begin("rel_index");return 71;break;case 62:this.begin("update_el_style");return 72;break;case 63:this.begin("update_rel_style");return 73;break;case 64:this.begin("update_layout_config");return 74;break;case 65:return"EOF_IN_STRUCT";break;case 66:this.begin("attribute");return"ATTRIBUTE_EMPTY";break;case 67:this.begin("attribute");break;case 68:this.popState();this.popState();break;case 69:return 80;break;case 70:break;case 71:return 80;break;case 72:this.begin("string");break;case 73:this.popState();break;case 74:return"STR";break;case 75:this.begin("string_kv");break;case 76:this.begin("string_kv_key");return"STR_KEY";break;case 77:this.popState();this.begin("string_kv_value");break;case 78:return"STR_VALUE";break;case 79:this.popState();this.popState();break;case 80:return"STR";break;case 81:return"LBRACE";break;case 82:return"RBRACE";break;case 83:return"SPACE";break;case 84:return"EOL";break;case 85:return 14;break}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/],conditions:{"acc_descr_multiline":{"rules":[11,12],"inclusive":false},"acc_descr":{"rules":[9],"inclusive":false},"acc_title":{"rules":[7],"inclusive":false},"string_kv_value":{"rules":[78,79],"inclusive":false},"string_kv_key":{"rules":[77],"inclusive":false},"string_kv":{"rules":[76],"inclusive":false},"string":{"rules":[73,74],"inclusive":false},"attribute":{"rules":[68,69,70,71,72,75,80],"inclusive":false},"update_layout_config":{"rules":[65,66,67,68],"inclusive":false},"update_rel_style":{"rules":[65,66,67,68],"inclusive":false},"update_el_style":{"rules":[65,66,67,68],"inclusive":false},"rel_b":{"rules":[65,66,67,68],"inclusive":false},"rel_r":{"rules":[65,66,67,68],"inclusive":false},"rel_l":{"rules":[65,66,67,68],"inclusive":false},"rel_d":{"rules":[65,66,67,68],"inclusive":false},"rel_u":{"rules":[65,66,67,68],"inclusive":false},"rel_bi":{"rules":[],"inclusive":false},"rel":{"rules":[65,66,67,68],"inclusive":false},"node_r":{"rules":[65,66,67,68],"inclusive":false},"node_l":{"rules":[65,66,67,68],"inclusive":false},"node":{"rules":[65,66,67,68],"inclusive":false},"index":{"rules":[],"inclusive":false},"rel_index":{"rules":[65,66,67,68],"inclusive":false},"component_ext_queue":{"rules":[65,66,67,68],"inclusive":false},"component_ext_db":{"rules":[65,66,67,68],"inclusive":false},"component_ext":{"rules":[65,66,67,68],"inclusive":false},"component_queue":{"rules":[65,66,67,68],"inclusive":false},"component_db":{"rules":[65,66,67,68],"inclusive":false},"component":{"rules":[65,66,67,68],"inclusive":false},"container_boundary":{"rules":[65,66,67,68],"inclusive":false},"container_ext_queue":{"rules":[65,66,67,68],"inclusive":false},"container_ext_db":{"rules":[65,66,67,68],"inclusive":false},"container_ext":{"rules":[65,66,67,68],"inclusive":false},"container_queue":{"rules":[65,66,67,68],"inclusive":false},"container_db":{"rules":[65,66,67,68],"inclusive":false},"container":{"rules":[65,66,67,68],"inclusive":false},"birel":{"rules":[65,66,67,68],"inclusive":false},"system_boundary":{"rules":[65,66,67,68],"inclusive":false},"enterprise_boundary":{"rules":[65,66,67,68],"inclusive":false},"boundary":{"rules":[65,66,67,68],"inclusive":false},"system_ext_queue":{"rules":[65,66,67,68],"inclusive":false},"system_ext_db":{"rules":[65,66,67,68],"inclusive":false},"system_ext":{"rules":[65,66,67,68],"inclusive":false},"system_queue":{"rules":[65,66,67,68],"inclusive":false},"system_db":{"rules":[65,66,67,68],"inclusive":false},"system":{"rules":[65,66,67,68],"inclusive":false},"person_ext":{"rules":[65,66,67,68],"inclusive":false},"person":{"rules":[65,66,67,68],"inclusive":false},"INITIAL":{"rules":[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,81,82,83,84,85],"inclusive":true}}};return Te}();bt.lexer=He;function Je(){this.yy={}}B(Je,"Parser");Je.prototype=bt;bt.Parser=Je;return new Je}();HSe.parser=HSe;bPi=HSe;Nw=[];KL=[""];nb="global";Fw="";iS=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}];Ute=[];Qet="";ett=false;WSe=4;YSe=2;xPi=B(function(){return L2n},"getC4Type");vPi=B(function(e){let t=La(e,Mn());L2n=t},"setC4Type");_Pi=B(function(e,t,n,r,i,o,a,s,l){if(e===void 0||e===null||t===void 0||t===null||n===void 0||n===null||r===void 0||r===null){return}let u={};const d=Ute.find(f=>f.from===t&&f.to===n);if(d){u=d}else{Ute.push(u)}u.type=e;u.from=t;u.to=n;u.label={text:r};if(i===void 0||i===null){u.techn={text:""}}else{if(typeof i==="object"){let[f,h]=Object.entries(i)[0];u[f]={text:h}}else{u.techn={text:i}}}if(o===void 0||o===null){u.descr={text:""}}else{if(typeof o==="object"){let[f,h]=Object.entries(o)[0];u[f]={text:h}}else{u.descr={text:o}}}if(typeof a==="object"){let[f,h]=Object.entries(a)[0];u[f]=h}else{u.sprite=a}if(typeof s==="object"){let[f,h]=Object.entries(s)[0];u[f]=h}else{u.tags=s}if(typeof l==="object"){let[f,h]=Object.entries(l)[0];u[f]=h}else{u.link=l}u.wrap=ZL()},"addRel");TPi=B(function(e,t,n,r,i,o,a){if(t===null||n===null){return}let s={};const l=Nw.find(u=>u.alias===t);if(l&&t===l.alias){s=l}else{s.alias=t;Nw.push(s)}if(n===void 0||n===null){s.label={text:""}}else{s.label={text:n}}if(r===void 0||r===null){s.descr={text:""}}else{if(typeof r==="object"){let[u,d]=Object.entries(r)[0];s[u]={text:d}}else{s.descr={text:r}}}if(typeof i==="object"){let[u,d]=Object.entries(i)[0];s[u]=d}else{s.sprite=i}if(typeof o==="object"){let[u,d]=Object.entries(o)[0];s[u]=d}else{s.tags=o}if(typeof a==="object"){let[u,d]=Object.entries(a)[0];s[u]=d}else{s.link=a}s.typeC4Shape={text:e};s.parentBoundary=nb;s.wrap=ZL()},"addPersonOrSystem");wPi=B(function(e,t,n,r,i,o,a,s){if(t===null||n===null){return}let l={};const u=Nw.find(d=>d.alias===t);if(u&&t===u.alias){l=u}else{l.alias=t;Nw.push(l)}if(n===void 0||n===null){l.label={text:""}}else{l.label={text:n}}if(r===void 0||r===null){l.techn={text:""}}else{if(typeof r==="object"){let[d,f]=Object.entries(r)[0];l[d]={text:f}}else{l.techn={text:r}}}if(i===void 0||i===null){l.descr={text:""}}else{if(typeof i==="object"){let[d,f]=Object.entries(i)[0];l[d]={text:f}}else{l.descr={text:i}}}if(typeof o==="object"){let[d,f]=Object.entries(o)[0];l[d]=f}else{l.sprite=o}if(typeof a==="object"){let[d,f]=Object.entries(a)[0];l[d]=f}else{l.tags=a}if(typeof s==="object"){let[d,f]=Object.entries(s)[0];l[d]=f}else{l.link=s}l.wrap=ZL();l.typeC4Shape={text:e};l.parentBoundary=nb},"addContainer");EPi=B(function(e,t,n,r,i,o,a,s){if(t===null||n===null){return}let l={};const u=Nw.find(d=>d.alias===t);if(u&&t===u.alias){l=u}else{l.alias=t;Nw.push(l)}if(n===void 0||n===null){l.label={text:""}}else{l.label={text:n}}if(r===void 0||r===null){l.techn={text:""}}else{if(typeof r==="object"){let[d,f]=Object.entries(r)[0];l[d]={text:f}}else{l.techn={text:r}}}if(i===void 0||i===null){l.descr={text:""}}else{if(typeof i==="object"){let[d,f]=Object.entries(i)[0];l[d]={text:f}}else{l.descr={text:i}}}if(typeof o==="object"){let[d,f]=Object.entries(o)[0];l[d]=f}else{l.sprite=o}if(typeof a==="object"){let[d,f]=Object.entries(a)[0];l[d]=f}else{l.tags=a}if(typeof s==="object"){let[d,f]=Object.entries(s)[0];l[d]=f}else{l.link=s}l.wrap=ZL();l.typeC4Shape={text:e};l.parentBoundary=nb},"addComponent");CPi=B(function(e,t,n,r,i){if(e===null||t===null){return}let o={};const a=iS.find(s=>s.alias===e);if(a&&e===a.alias){o=a}else{o.alias=e;iS.push(o)}if(t===void 0||t===null){o.label={text:""}}else{o.label={text:t}}if(n===void 0||n===null){o.type={text:"system"}}else{if(typeof n==="object"){let[s,l]=Object.entries(n)[0];o[s]={text:l}}else{o.type={text:n}}}if(typeof r==="object"){let[s,l]=Object.entries(r)[0];o[s]=l}else{o.tags=r}if(typeof i==="object"){let[s,l]=Object.entries(i)[0];o[s]=l}else{o.link=i}o.parentBoundary=nb;o.wrap=ZL();Fw=nb;nb=e;KL.push(Fw)},"addPersonOrSystemBoundary");SPi=B(function(e,t,n,r,i){if(e===null||t===null){return}let o={};const a=iS.find(s=>s.alias===e);if(a&&e===a.alias){o=a}else{o.alias=e;iS.push(o)}if(t===void 0||t===null){o.label={text:""}}else{o.label={text:t}}if(n===void 0||n===null){o.type={text:"container"}}else{if(typeof n==="object"){let[s,l]=Object.entries(n)[0];o[s]={text:l}}else{o.type={text:n}}}if(typeof r==="object"){let[s,l]=Object.entries(r)[0];o[s]=l}else{o.tags=r}if(typeof i==="object"){let[s,l]=Object.entries(i)[0];o[s]=l}else{o.link=i}o.parentBoundary=nb;o.wrap=ZL();Fw=nb;nb=e;KL.push(Fw)},"addContainerBoundary");APi=B(function(e,t,n,r,i,o,a,s){if(t===null||n===null){return}let l={};const u=iS.find(d=>d.alias===t);if(u&&t===u.alias){l=u}else{l.alias=t;iS.push(l)}if(n===void 0||n===null){l.label={text:""}}else{l.label={text:n}}if(r===void 0||r===null){l.type={text:"node"}}else{if(typeof r==="object"){let[d,f]=Object.entries(r)[0];l[d]={text:f}}else{l.type={text:r}}}if(i===void 0||i===null){l.descr={text:""}}else{if(typeof i==="object"){let[d,f]=Object.entries(i)[0];l[d]={text:f}}else{l.descr={text:i}}}if(typeof a==="object"){let[d,f]=Object.entries(a)[0];l[d]=f}else{l.tags=a}if(typeof s==="object"){let[d,f]=Object.entries(s)[0];l[d]=f}else{l.link=s}l.nodeType=e;l.parentBoundary=nb;l.wrap=ZL();Fw=nb;nb=t;KL.push(Fw)},"addDeploymentNode");kPi=B(function(){nb=Fw;KL.pop();Fw=KL.pop();KL.push(Fw)},"popBoundaryParseStack");RPi=B(function(e,t,n,r,i,o,a,s,l,u,d){let f=Nw.find(h=>h.alias===t);if(f===void 0){f=iS.find(h=>h.alias===t);if(f===void 0){return}}if(n!==void 0&&n!==null){if(typeof n==="object"){let[h,m]=Object.entries(n)[0];f[h]=m}else{f.bgColor=n}}if(r!==void 0&&r!==null){if(typeof r==="object"){let[h,m]=Object.entries(r)[0];f[h]=m}else{f.fontColor=r}}if(i!==void 0&&i!==null){if(typeof i==="object"){let[h,m]=Object.entries(i)[0];f[h]=m}else{f.borderColor=i}}if(o!==void 0&&o!==null){if(typeof o==="object"){let[h,m]=Object.entries(o)[0];f[h]=m}else{f.shadowing=o}}if(a!==void 0&&a!==null){if(typeof a==="object"){let[h,m]=Object.entries(a)[0];f[h]=m}else{f.shape=a}}if(s!==void 0&&s!==null){if(typeof s==="object"){let[h,m]=Object.entries(s)[0];f[h]=m}else{f.sprite=s}}if(l!==void 0&&l!==null){if(typeof l==="object"){let[h,m]=Object.entries(l)[0];f[h]=m}else{f.techn=l}}if(u!==void 0&&u!==null){if(typeof u==="object"){let[h,m]=Object.entries(u)[0];f[h]=m}else{f.legendText=u}}if(d!==void 0&&d!==null){if(typeof d==="object"){let[h,m]=Object.entries(d)[0];f[h]=m}else{f.legendSprite=d}}},"updateElStyle");PPi=B(function(e,t,n,r,i,o,a){const s=Ute.find(l=>l.from===t&&l.to===n);if(s===void 0){return}if(r!==void 0&&r!==null){if(typeof r==="object"){let[l,u]=Object.entries(r)[0];s[l]=u}else{s.textColor=r}}if(i!==void 0&&i!==null){if(typeof i==="object"){let[l,u]=Object.entries(i)[0];s[l]=u}else{s.lineColor=i}}if(o!==void 0&&o!==null){if(typeof o==="object"){let[l,u]=Object.entries(o)[0];s[l]=parseInt(u)}else{s.offsetX=parseInt(o)}}if(a!==void 0&&a!==null){if(typeof a==="object"){let[l,u]=Object.entries(a)[0];s[l]=parseInt(u)}else{s.offsetY=parseInt(a)}}},"updateRelStyle");IPi=B(function(e,t,n){let r=WSe;let i=YSe;if(typeof t==="object"){const o=Object.values(t)[0];r=parseInt(o)}else{r=parseInt(t)}if(typeof n==="object"){const o=Object.values(n)[0];i=parseInt(o)}else{i=parseInt(n)}if(r>=1){WSe=r}if(i>=1){YSe=i}},"updateLayoutConfig");MPi=B(function(){return WSe},"getC4ShapeInRow");LPi=B(function(){return YSe},"getC4BoundaryInRow");DPi=B(function(){return nb},"getCurrentBoundaryParse");FPi=B(function(){return Fw},"getParentBoundaryParse");D2n=B(function(e){if(e===void 0||e===null){return Nw}else{return Nw.filter(t=>{return t.parentBoundary===e})}},"getC4ShapeArray");NPi=B(function(e){return Nw.find(t=>t.alias===e)},"getC4Shape");OPi=B(function(e){return Object.keys(D2n(e))},"getC4ShapeKeys");F2n=B(function(e){if(e===void 0||e===null){return iS}else{return iS.filter(t=>t.parentBoundary===e)}},"getBoundaries");BPi=F2n;zPi=B(function(){return Ute},"getRels");UPi=B(function(){return Qet},"getTitle");VPi=B(function(e){ett=e},"setWrap");ZL=B(function(){return ett},"autoWrap");$Pi=B(function(){Nw=[];iS=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}];Fw="";nb="global";KL=[""];Ute=[];KL=[""];Qet="";ett=false;WSe=4;YSe=2},"clear");GPi={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25};HPi={FILLED:0,OPEN:1};WPi={LEFTOF:0,RIGHTOF:1,OVER:2};YPi=B(function(e){let t=La(e,Mn());Qet=t},"setTitle");Ket={addPersonOrSystem:TPi,addPersonOrSystemBoundary:CPi,addContainer:wPi,addContainerBoundary:SPi,addComponent:EPi,addDeploymentNode:APi,popBoundaryParseStack:kPi,addRel:_Pi,updateElStyle:RPi,updateRelStyle:PPi,updateLayoutConfig:IPi,autoWrap:ZL,setWrap:VPi,getC4ShapeArray:D2n,getC4Shape:NPi,getC4ShapeKeys:OPi,getBoundaries:F2n,getBoundarys:BPi,getCurrentBoundaryParse:DPi,getParentBoundaryParse:FPi,getRels:zPi,getTitle:UPi,getC4Type:xPi,getC4ShapeInRow:MPi,getC4BoundaryInRow:LPi,setAccTitle:Ka,getAccTitle:is,getAccDescription:as,setAccDescription:os,getConfig:B(()=>Mn().c4,"getConfig"),clear:$Pi,LINETYPE:GPi,ARROWTYPE:HPi,PLACEMENT:WPi,setTitle:YPi,setC4Type:vPi};ttt=B(function(e,t){return SB(e,t)},"drawRect");O2n=B(function(e,t,n,r,i,o){const a=e.append("image");a.attr("width",t);a.attr("height",n);a.attr("x",r);a.attr("y",i);let s=o.startsWith("data:image/png;base64")?o:(0,N2n.sanitizeUrl)(o);a.attr("xlink:href",s)},"drawImage");qPi=B((e,t,n,r)=>{const i=e.append("g");let o=0;for(let a of t){let s=a.textColor?a.textColor:"#444444";let l=a.lineColor?a.lineColor:"#444444";let u=a.offsetX?parseInt(a.offsetX):0;let d=a.offsetY?parseInt(a.offsetY):0;let f="";if(o===0){let m=i.append("line");m.attr("x1",a.startPoint.x);m.attr("y1",a.startPoint.y);m.attr("x2",a.endPoint.x);m.attr("y2",a.endPoint.y);m.attr("stroke-width","1");m.attr("stroke",l);m.style("fill","none");if(a.type!=="rel_b"){m.attr("marker-end","url("+f+"#"+r+"-arrowhead)")}if(a.type==="birel"||a.type==="rel_b"){m.attr("marker-start","url("+f+"#"+r+"-arrowend)")}o=-1}else{let m=i.append("path");m.attr("fill","none").attr("stroke-width","1").attr("stroke",l).attr("d","Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx",a.startPoint.x).replaceAll("starty",a.startPoint.y).replaceAll("controlx",a.startPoint.x+(a.endPoint.x-a.startPoint.x)/2-(a.endPoint.x-a.startPoint.x)/4).replaceAll("controly",a.startPoint.y+(a.endPoint.y-a.startPoint.y)/2).replaceAll("stopx",a.endPoint.x).replaceAll("stopy",a.endPoint.y));if(a.type!=="rel_b"){m.attr("marker-end","url("+f+"#"+r+"-arrowhead)")}if(a.type==="birel"||a.type==="rel_b"){m.attr("marker-start","url("+f+"#"+r+"-arrowend)")}}let h=n.messageFont();UR(n)(a.label.text,i,Math.min(a.startPoint.x,a.endPoint.x)+Math.abs(a.endPoint.x-a.startPoint.x)/2+u,Math.min(a.startPoint.y,a.endPoint.y)+Math.abs(a.endPoint.y-a.startPoint.y)/2+d,a.label.width,a.label.height,{fill:s},h);if(a.techn&&a.techn.text!==""){h=n.messageFont();UR(n)("["+a.techn.text+"]",i,Math.min(a.startPoint.x,a.endPoint.x)+Math.abs(a.endPoint.x-a.startPoint.x)/2+u,Math.min(a.startPoint.y,a.endPoint.y)+Math.abs(a.endPoint.y-a.startPoint.y)/2+n.messageFontSize+5+d,Math.max(a.label.width,a.techn.width),a.techn.height,{fill:s,"font-style":"italic"},h)}}},"drawRels");XPi=B(function(e,t,n){const r=e.append("g");let i=t.bgColor?t.bgColor:"none";let o=t.borderColor?t.borderColor:"#444444";let a=t.fontColor?t.fontColor:"black";let s={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};if(t.nodeType){s={"stroke-width":1}}let l={x:t.x,y:t.y,fill:i,stroke:o,width:t.width,height:t.height,rx:2.5,ry:2.5,attrs:s};ttt(r,l);let u=n.boundaryFont();u.fontWeight="bold";u.fontSize=u.fontSize+2;u.fontColor=a;UR(n)(t.label.text,r,t.x,t.y+t.label.Y,t.width,t.height,{fill:"#444444"},u);if(t.type&&t.type.text!==""){u=n.boundaryFont();u.fontColor=a;UR(n)(t.type.text,r,t.x,t.y+t.type.Y,t.width,t.height,{fill:"#444444"},u)}if(t.descr&&t.descr.text!==""){u=n.boundaryFont();u.fontSize=u.fontSize-2;u.fontColor=a;UR(n)(t.descr.text,r,t.x,t.y+t.descr.Y,t.width,t.height,{fill:"#444444"},u)}},"drawBoundary");jPi=B(function(e,t,n){let r=t.bgColor?t.bgColor:n[t.typeC4Shape.text+"_bg_color"];let i=t.borderColor?t.borderColor:n[t.typeC4Shape.text+"_border_color"];let o=t.fontColor?t.fontColor:"#FFFFFF";let a="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";switch(t.typeC4Shape.text){case"person":a="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";break;case"external_person":a="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";break}const s=e.append("g");s.attr("class","person-man");const l=Xy();switch(t.typeC4Shape.text){case"person":case"external_person":case"system":case"external_system":case"container":case"external_container":case"component":case"external_component":l.x=t.x;l.y=t.y;l.fill=r;l.width=t.width;l.height=t.height;l.stroke=i;l.rx=2.5;l.ry=2.5;l.attrs={"stroke-width":.5};ttt(s,l);break;case"system_db":case"external_system_db":case"container_db":case"external_container_db":case"component_db":case"external_component_db":s.append("path").attr("fill",r).attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx",t.x).replaceAll("starty",t.y).replaceAll("half",t.width/2).replaceAll("height",t.height));s.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx",t.x).replaceAll("starty",t.y).replaceAll("half",t.width/2));break;case"system_queue":case"external_system_queue":case"container_queue":case"external_container_queue":case"component_queue":case"external_component_queue":s.append("path").attr("fill",r).attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx",t.x).replaceAll("starty",t.y).replaceAll("width",t.width).replaceAll("half",t.height/2));s.append("path").attr("fill","none").attr("stroke-width","0.5").attr("stroke",i).attr("d","Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx",t.x+t.width).replaceAll("starty",t.y).replaceAll("half",t.height/2));break}let u=rIi(n,t.typeC4Shape.text);s.append("text").attr("fill",o).attr("font-family",u.fontFamily).attr("font-size",u.fontSize-2).attr("font-style","italic").attr("lengthAdjust","spacing").attr("textLength",t.typeC4Shape.width).attr("x",t.x+t.width/2-t.typeC4Shape.width/2).attr("y",t.y+t.typeC4Shape.Y).text("<<"+t.typeC4Shape.text+">>");switch(t.typeC4Shape.text){case"person":case"external_person":O2n(s,48,48,t.x+t.width/2-24,t.y+t.image.Y,a);break}let d=n[t.typeC4Shape.text+"Font"]();d.fontWeight="bold";d.fontSize=d.fontSize+2;d.fontColor=o;UR(n)(t.label.text,s,t.x,t.y+t.label.Y,t.width,t.height,{fill:o},d);d=n[t.typeC4Shape.text+"Font"]();d.fontColor=o;if(t.techn&&t.techn?.text!==""){UR(n)(t.techn.text,s,t.x,t.y+t.techn.Y,t.width,t.height,{fill:o,"font-style":"italic"},d)}else if(t.type&&t.type.text!==""){UR(n)(t.type.text,s,t.x,t.y+t.type.Y,t.width,t.height,{fill:o,"font-style":"italic"},d)}if(t.descr&&t.descr.text!==""){d=n.personFont();d.fontColor=o;UR(n)(t.descr.text,s,t.x,t.y+t.descr.Y,t.width,t.height,{fill:o},d)}return t.height},"drawC4Shape");KPi=B(function(e,t){e.append("defs").append("symbol").attr("id",t+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon");ZPi=B(function(e,t){e.append("defs").append("symbol").attr("id",t+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon");JPi=B(function(e,t){e.append("defs").append("symbol").attr("id",t+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon");QPi=B(function(e,t){e.append("defs").append("marker").attr("id",t+"-arrowhead").attr("refX",9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z")},"insertArrowHead");eIi=B(function(e,t){e.append("defs").append("marker").attr("id",t+"-arrowend").attr("refX",1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z")},"insertArrowEnd");tIi=B(function(e,t){e.append("defs").append("marker").attr("id",t+"-filled-head").attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead");nIi=B(function(e,t){const n=e.append("defs");const r=n.append("marker").attr("id",t+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",16).attr("refY",4);r.append("path").attr("fill","black").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 9,2 V 6 L16,4 Z");r.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1px").attr("d","M 0,1 L 6,7 M 6,1 L 0,7")},"insertArrowCrossHead");rIi=B((e,t)=>{return{fontFamily:e[t+"FontFamily"],fontSize:e[t+"FontSize"],fontWeight:e[t+"FontWeight"]}},"getC4ShapeFont");UR=function(){function e(i,o,a,s,l,u,d){const f=o.append("text").attr("x",a+l/2).attr("y",s+u/2+5).style("text-anchor","middle").text(i);r(f,d)}B(e,"byText");function t(i,o,a,s,l,u,d,f){const{fontSize:h,fontFamily:m,fontWeight:g}=f;const x=i.split(Ti.lineBreakRegex);for(let w=0;w=this.data.widthLimit||n>=this.data.widthLimit||this.nextData.cnt>B2n){t=this.nextData.startx+e.margin+ra.nextLinePaddingX;r=this.nextData.stopy+e.margin*2;this.nextData.stopx=n=t+e.width;this.nextData.starty=this.nextData.stopy;this.nextData.stopy=i=r+e.height;this.nextData.cnt=1}e.x=t;e.y=r;this.updateVal(this.data,"startx",t,Math.min);this.updateVal(this.data,"starty",r,Math.min);this.updateVal(this.data,"stopx",n,Math.max);this.updateVal(this.data,"stopy",i,Math.max);this.updateVal(this.nextData,"startx",t,Math.min);this.updateVal(this.nextData,"starty",r,Math.min);this.updateVal(this.nextData,"stopx",n,Math.max);this.updateVal(this.nextData,"stopy",i,Math.max)}init(e){this.name="";this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0};this.nextData={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0};Jet(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e;this.data.stopy+=e}};Jet=B(function(e){rf(ra,e);if(e.fontFamily){ra.personFontFamily=ra.systemFontFamily=ra.messageFontFamily=e.fontFamily}if(e.fontSize){ra.personFontSize=ra.systemFontSize=ra.messageFontSize=e.fontSize}if(e.fontWeight){ra.personFontWeight=ra.systemFontWeight=ra.messageFontWeight=e.fontWeight}},"setConf");zte=B((e,t)=>{return{fontFamily:e[t+"FontFamily"],fontSize:e[t+"FontSize"],fontWeight:e[t+"FontWeight"]}},"c4ShapeFont");GSe=B(e=>{return{fontFamily:e.boundaryFontFamily,fontSize:e.boundaryFontSize,fontWeight:e.boundaryFontWeight}},"boundaryFont");iIi=B(e=>{return{fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}},"messageFont");B($_,"calcC4ShapeTextWH");U2n=B(function(e,t,n){t.x=n.data.startx;t.y=n.data.starty;t.width=n.data.stopx-n.data.startx;t.height=n.data.stopy-n.data.starty;t.label.y=ra.c4ShapeMargin-35;let r=t.wrap&&ra.wrap;let i=GSe(ra);i.fontSize=i.fontSize+2;i.fontWeight="bold";let o=Cg(t.label.text,i);$_("label",t,r,i,o);rS.drawBoundary(e,t,ra)},"drawBoundary");V2n=B(function(e,t,n,r){let i=0;for(const o of r){i=0;const a=n[o];let s=zte(ra,a.typeC4Shape.text);s.fontSize=s.fontSize-2;a.typeC4Shape.width=Cg("\xAB"+a.typeC4Shape.text+"\xBB",s);a.typeC4Shape.height=s.fontSize+2;a.typeC4Shape.Y=ra.c4ShapePadding;i=a.typeC4Shape.Y+a.typeC4Shape.height-4;a.image={width:0,height:0,Y:0};switch(a.typeC4Shape.text){case"person":case"external_person":a.image.width=48;a.image.height=48;a.image.Y=i;i=a.image.Y+a.image.height;break}if(a.sprite){a.image.width=48;a.image.height=48;a.image.Y=i;i=a.image.Y+a.image.height}let l=a.wrap&&ra.wrap;let u=ra.width-ra.c4ShapePadding*2;let d=zte(ra,a.typeC4Shape.text);d.fontSize=d.fontSize+2;d.fontWeight="bold";$_("label",a,l,d,u);a.label.Y=i+8;i=a.label.Y+a.label.height;if(a.type&&a.type.text!==""){a.type.text="["+a.type.text+"]";let m=zte(ra,a.typeC4Shape.text);$_("type",a,l,m,u);a.type.Y=i+5;i=a.type.Y+a.type.height}else if(a.techn&&a.techn.text!==""){a.techn.text="["+a.techn.text+"]";let m=zte(ra,a.techn.text);$_("techn",a,l,m,u);a.techn.Y=i+5;i=a.techn.Y+a.techn.height}let f=i;let h=a.label.width;if(a.descr&&a.descr.text!==""){let m=zte(ra,a.typeC4Shape.text);$_("descr",a,l,m,u);a.descr.Y=i+20;i=a.descr.Y+a.descr.height;h=Math.max(a.label.width,a.descr.width);f=i-a.descr.textLines*5}h=h+ra.c4ShapePadding;a.width=Math.max(a.width||ra.width,h,ra.width);a.height=Math.max(a.height||ra.height,f,ra.height);a.margin=a.margin||ra.c4ShapeMargin;e.insert(a);rS.drawC4Shape(t,a,ra)}e.bumpLastMargin(ra.c4ShapeMargin)},"drawC4ShapeArray");V_=class{static{B(this,"Point")}constructor(e,t){this.x=e;this.y=t}};I2n=B(function(e,t){let n=e.x;let r=e.y;let i=t.x;let o=t.y;let a=n+e.width/2;let s=r+e.height/2;let l=Math.abs(n-i);let u=Math.abs(r-o);let d=u/l;let f=e.height/e.width;let h=null;if(r==o&&ni){h=new V_(n,s)}else if(n==i&&ro){h=new V_(a,r)}if(n>i&&r=d){h=new V_(n,s+d*e.width/2)}else{h=new V_(a-l/u*e.height/2,r+e.height)}}else if(n=d){h=new V_(n+e.width,s+d*e.width/2)}else{h=new V_(a+l/u*e.height/2,r+e.height)}}else if(no){if(f>=d){h=new V_(n+e.width,s-d*e.width/2)}else{h=new V_(a+e.height/2*l/u,r)}}else if(n>i&&r>o){if(f>=d){h=new V_(n,s-e.width/2*d)}else{h=new V_(a-e.height/2*l/u,r)}}return h},"getIntersectPoint");oIi=B(function(e,t){let n={x:0,y:0};n.x=t.x+t.width/2;n.y=t.y+t.height/2;let r=I2n(e,n);n.x=e.x+e.width/2;n.y=e.y+e.height/2;let i=I2n(t,n);return{startPoint:r,endPoint:i}},"getIntersectPoints");aIi=B(function(e,t,n,r,i){let o=0;for(let a of t){o=o+1;let s=a.wrap&&ra.wrap;let l=iIi(ra);let u=r.db.getC4Type();if(u==="C4Dynamic"){a.label.text=o+": "+a.label.text}let d=Cg(a.label.text,l);$_("label",a,s,l,d);if(a.techn&&a.techn.text!==""){d=Cg(a.techn.text,l);$_("techn",a,s,l,d)}if(a.descr&&a.descr.text!==""){d=Cg(a.descr.text,l);$_("descr",a,s,l,d)}let f=n(a.from);let h=n(a.to);let m=oIi(f,h);a.startPoint=m.startPoint;a.endPoint=m.endPoint}rS.drawRels(e,t,ra,i)},"drawRels");B(ntt,"drawInsideBoundary");sIi=B(function(e,t,n,r){ra=Mn().c4;const i=Mn().securityLevel;let o;if(i==="sandbox"){o=zr("#i"+t)}const a=i==="sandbox"?zr(o.nodes()[0].contentDocument.body):zr("body");let s=r.db;r.db.setWrap(ra.wrap);B2n=s.getC4ShapeInRow();Zet=s.getC4BoundaryInRow();wt.debug(`C:${JSON.stringify(ra,null,2)}`);const l=i==="sandbox"?a.select(`[id="${t}"]`):zr(`[id="${t}"]`);rS.insertComputerIcon(l,t);rS.insertDatabaseIcon(l,t);rS.insertClockIcon(l,t);let u=new z2n(r);u.setData(ra.diagramMarginX,ra.diagramMarginX,ra.diagramMarginY,ra.diagramMarginY);u.data.widthLimit=screen.availWidth;qSe=ra.diagramMarginX;XSe=ra.diagramMarginY;const d=r.db.getTitle();let f=r.db.getBoundaries("");ntt(l,"",u,f,r);rS.insertArrowHead(l,t);rS.insertArrowEnd(l,t);rS.insertArrowCrossHead(l,t);rS.insertArrowFilledHead(l,t);aIi(l,r.db.getRels(),r.db.getC4Shape,r,t);u.data.stopx=qSe;u.data.stopy=XSe;const h=u.data;let m=h.stopy-h.starty;let g=m+2*ra.diagramMarginY;let x=h.stopx-h.startx;const w=x+2*ra.diagramMarginX;if(d){l.append("text").text(d).attr("x",(h.stopx-h.startx)/2-4*ra.diagramMarginX).attr("y",h.starty+ra.diagramMarginY)}Vs(l,g,w,ra.useMaxWidth);const _=d?60:0;l.attr("viewBox",h.startx-ra.diagramMarginX+" -"+(ra.diagramMarginY+_)+" "+w+" "+(g+_));wt.debug(`models:`,h)},"draw");M2n={drawPersonOrSystemArray:V2n,drawBoundary:U2n,setConf:Jet,draw:sIi};lIi=B(e=>`.person { + stroke: ${e.personBorder}; + fill: ${e.personBkg}; + } +`,"getStyles");cIi=lIi;uIi={parser:bPi,db:Ket,renderer:M2n,styles:cIi,init:B(({c4:e,wrap:t})=>{M2n.setConf(e);Ket.setWrap(t)},"init")}});var oS;var aS=Ce(()=>{Yo();oS=B(()=>` + /* Font Awesome icon styling - consolidated */ + .label-icon { + display: inline-block; + height: 1em; + overflow: visible; + vertical-align: -0.125em; + } + + .node .label-icon path { + fill: currentColor; + stroke: revert; + stroke-width: revert; + } +`,"getIconStyles")});var G_;var lv=Ce(()=>{Yo();ks();G_=B((e,t)=>{let n;if(t==="sandbox"){n=zr("#i"+e)}const r=t==="sandbox"?zr(n.nodes()[0].contentDocument.body):zr("body");const i=r.select(`[id="${e}"]`);return i},"getDiagramElement")});var Ex,dIi,fIi;var Cx=Ce(()=>{Ta();Aa();Yo();Ex=B((e,t,n,r)=>{e.attr("class",n);const{width:i,height:o,x:a,y:s}=dIi(e,t);Vs(e,o,i,r);const l=fIi(a,s,i,o,t);e.attr("viewBox",l);wt.debug(`viewBox configured: ${l} with padding: ${t}`)},"setupViewPortForSVG");dIi=B((e,t)=>{const n=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:n.width+t*2,height:n.height+t*2,x:n.x,y:n.y}},"calculateDimensionsWithPadding");fIi=B((e,t,n,r,i)=>{return`${e-i} ${t-i} ${n} ${r}`},"createViewBox")});var hIi,pIi,mIi,gIi,yIi,rtt,H2n,W2n,bIi,xIi,vIi,itt,Vte,Y2n;var ott=Ce(()=>{aS();lv();Cx();Y5();Tx();sv();kg();nl();Ta();Aa();Yo();ks();KV();qh();hIi="flowchart-";pIi=class{constructor(){this.vertexCounter=0;this.config=Mn();this.diagramId="";this.vertices=new Map;this.edges=[];this.classes=new Map;this.subGraphs=[];this.subGraphLookup=new Map;this.tooltips=new Map;this.subCount=0;this.firstGraphFlag=true;this.secCount=-1;this.posCrossRef=[];this.funs=[];this.setAccTitle=Ka;this.setAccDescription=os;this.setDiagramTitle=ys;this.getAccTitle=is;this.getAccDescription=as;this.getDiagramTitle=ss;this.funs.push(this.setupToolTips.bind(this));this.addVertex=this.addVertex.bind(this);this.firstGraph=this.firstGraph.bind(this);this.setDirection=this.setDirection.bind(this);this.addSubGraph=this.addSubGraph.bind(this);this.addLink=this.addLink.bind(this);this.setLink=this.setLink.bind(this);this.updateLink=this.updateLink.bind(this);this.addClass=this.addClass.bind(this);this.setClass=this.setClass.bind(this);this.destructLink=this.destructLink.bind(this);this.setClickEvent=this.setClickEvent.bind(this);this.setTooltip=this.setTooltip.bind(this);this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this);this.setClickFun=this.setClickFun.bind(this);this.bindFunctions=this.bindFunctions.bind(this);this.lex={firstGraph:this.firstGraph.bind(this)};this.clear();this.setGen("gen-2")}static{B(this,"FlowDB")}sanitizeText(e){return Ti.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(const t of this.vertices.values()){if(t.id===e){return this.diagramId?`${this.diagramId}-${t.domId}`:t.domId}}return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,t,n,r,i,o,a={},s){if(!e||e.trim().length===0){return}let l;if(s!==void 0){let h;if(!s.includes("\n")){h="{\n"+s+"\n}"}else{h=s+"\n"}l=gL(h,{schema:mL})}const u=this.edges.find(h=>h.id===e);if(u){const h=l;if(h?.animate!==void 0){u.animate=h.animate}if(h?.animation!==void 0){u.animation=h.animation}if(h?.curve!==void 0){u.interpolate=h.curve}return}let d;let f=this.vertices.get(e);if(f===void 0){if(t===void 0&&n===void 0&&r!==void 0&&r!==null){wt.warn(`Style applied to unknown node "${e}". This may indicate a typo. The node will be created automatically.`)}f={id:e,labelType:"text",domId:hIi+e+"-"+this.vertexCounter,styles:[],classes:[]};this.vertices.set(e,f)}this.vertexCounter++;if(t!==void 0){this.config=Mn();d=this.sanitizeText(t.text.trim());f.labelType=t.type;if(d.startsWith('"')&&d.endsWith('"')){d=d.substring(1,d.length-1)}f.text=d}else{if(f.text===void 0){f.text=e}}if(n!==void 0){f.type=n}if(r!==void 0&&r!==null){r.forEach(h=>{f.styles.push(h)})}if(i!==void 0&&i!==null){i.forEach(h=>{f.classes.push(h)})}if(o!==void 0){f.dir=o}if(f.props===void 0){f.props=a}else if(a!==void 0){Object.assign(f.props,a)}if(l!==void 0){if(l.shape){if(l.shape!==l.shape.toLowerCase()||l.shape.includes("_")){throw new Error(`No such shape: ${l.shape}. Shape names should be lowercase.`)}else if(!DKe(l.shape)){throw new Error(`No such shape: ${l.shape}.`)}f.type=l?.shape}if(l?.label){f.text=l?.label;f.labelType=this.sanitizeNodeLabelType(l?.labelType)}if(l?.icon){f.icon=l?.icon;if(!l.label?.trim()&&f.text===e){f.text=""}}if(l?.form){f.form=l?.form}if(l?.pos){f.pos=l?.pos}if(l?.img){f.img=l?.img;if(!l.label?.trim()&&f.text===e){f.text=""}}if(l?.constraint){f.constraint=l.constraint}if(l.w){f.assetWidth=Number(l.w)}if(l.h){f.assetHeight=Number(l.h)}}}addSingleLink(e,t,n,r){const i=e;const o=t;const a={start:i,end:o,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:false,interpolate:this.edges.defaultInterpolate};wt.info("abc78 Got edge...",a);const s=n.text;if(s!==void 0){a.text=this.sanitizeText(s.text.trim());if(a.text.startsWith('"')&&a.text.endsWith('"')){a.text=a.text.substring(1,a.text.length-1)}a.labelType=this.sanitizeNodeLabelType(s.type)}if(n!==void 0){a.type=n.type;a.stroke=n.stroke;a.length=n.length>10?10:n.length}if(r&&!this.edges.some(l=>l.id===r)){a.id=r;a.isUserDefinedId=true}else{const l=this.edges.filter(u=>u.start===a.start&&u.end===a.end);if(l.length===0){a.id=VC(a.start,a.end,{counter:0,prefix:"L"})}else{a.id=VC(a.start,a.end,{counter:l.length+1,prefix:"L"})}}if(this.edges.length<(this.config.maxEdges??500)){wt.info("Pushing edge...");this.edges.push(a)}else{throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}. + +Initialize mermaid with maxEdges set to a higher number to allow more edges. +You cannot set this config via configuration inside the diagram as it is a secure config. +You have to call mermaid.initialize.`)}}isLinkData(e){return e!==null&&typeof e==="object"&&"id"in e&&typeof e.id==="string"}addLink(e,t,n){const r=this.isLinkData(n)?n.id.replace("@",""):void 0;wt.info("addLink",e,t,r);for(const i of e){for(const o of t){const a=i===e[e.length-1];const s=o===t[0];if(a&&s){this.addSingleLink(i,o,n,r)}else{this.addSingleLink(i,o,n,void 0)}}}}updateLinkInterpolate(e,t){e.forEach(n=>{if(n==="default"){this.edges.defaultInterpolate=t}else{this.edges[n].interpolate=t}})}updateLink(e,t){e.forEach(n=>{if(typeof n==="number"&&n>=this.edges.length){throw new Error(`The index ${n} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`)}if(n==="default"){this.edges.defaultStyle=t}else{this.edges[n].style=t;if((this.edges[n]?.style?.length??0)>0&&!this.edges[n]?.style?.some(r=>r?.startsWith("fill"))){this.edges[n]?.style?.push("fill:none")}}})}addClass(e,t){const n=t.join().replace(/\\,/g,"\xA7\xA7\xA7").replace(/,/g,";").replace(/§§§/g,",").split(";");e.split(",").forEach(r=>{let i=this.classes.get(r);if(i===void 0){i={id:r,styles:[],textStyles:[]};this.classes.set(r,i)}if(n!==void 0&&n!==null){n.forEach(o=>{if(/color/.exec(o)){const a=o.replace("fill","bgFill");i.textStyles.push(a)}i.styles.push(o)})}})}setDirection(e){this.direction=e.trim();if(/.*/.exec(this.direction)){this.direction="LR"}if(/.*v/.exec(this.direction)){this.direction="TB"}if(this.direction==="TD"){this.direction="TB"}}setClass(e,t){for(const n of e.split(",")){const r=this.vertices.get(n);if(r){r.classes.push(t)}const i=this.edges.find(a=>a.id===n);if(i){i.classes.push(t)}const o=this.subGraphLookup.get(n);if(o){o.classes.push(t)}}}setTooltip(e,t){if(t===void 0){return}t=this.sanitizeText(t);for(const n of e.split(",")){this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(n):n,t)}}setClickFun(e,t,n){if(Mn().securityLevel!=="loose"){return}if(t===void 0){return}let r=[];if(typeof n==="string"){r=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let o=0;o{const o=this.lookUpDomId(e);const a=document.querySelector(`[id="${o}"]`);if(a!==null){a.addEventListener("click",()=>{Ko.runFunc(t,...r)},false)}})}}setLink(e,t,n){e.split(",").forEach(r=>{const i=this.vertices.get(r);if(i!==void 0){i.link=Ko.formatUrl(t,this.config);i.linkTarget=n}});this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,t,n){e.split(",").forEach(r=>{this.setClickFun(r,t,n)});this.setClass(e,"clickable")}bindFunctions(e){this.funs.forEach(t=>{t(e)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(e){const t=gG();const n=zr(e).select("svg");const r=n.selectAll("g.node");r.on("mouseover",i=>{const o=zr(i.currentTarget);const a=o.attr("title");if(a===null){return}const s=i.currentTarget?.getBoundingClientRect();t.transition().duration(200).style("opacity",".9");t.text(o.attr("title")).style("left",window.scrollX+s.left+(s.right-s.left)/2+"px").style("top",window.scrollY+s.bottom+"px");t.html(ux.sanitize(a));o.classed("hover",true)}).on("mouseout",i=>{t.transition().duration(500).style("opacity",0);const o=zr(i.currentTarget);o.classed("hover",false)})}clear(e="gen-2"){this.vertices=new Map;this.classes=new Map;this.edges=[];this.funs=[this.setupToolTips.bind(this)];this.diagramId="";this.subGraphs=[];this.subGraphLookup=new Map;this.subCount=0;this.tooltips=new Map;this.firstGraphFlag=true;this.version=e;this.config=Mn();Da()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,t,n){let r=e.text.trim();let i=n.text;if(e===n&&/\s/.exec(n.text)){r=void 0}const o=B(m=>{const g={boolean:{},number:{},string:{}};const x=[];let w;const _=m.filter(function(C){const A=typeof C;if(C.stmt&&C.stmt==="dir"){w=C.value;return false}if(C.trim()===""){return false}if(A in g){return g[A].hasOwnProperty(C)?false:g[A][C]=true}else{return x.includes(C)?false:x.push(C)}});return{nodeList:_,dir:w}},"uniq");const a=o(t.flat());const s=a.nodeList;const l=a.dir;const u=l!==void 0;const d=Mn().flowchart??{};const f=l??(d.inheritDir?this.getDirection()??Mn().direction??void 0:void 0);if(this.version==="gen-1"){for(let m=0;m2e3){return{result:false,count:0}}this.posCrossRef[this.secCount]=t;if(this.subGraphs[t].id===e){return{result:true,count:0}}let r=0;let i=1;while(r=0){const a=this.indexNodes2(e,o);if(a.result){return{result:true,count:i+a.count}}else{i=i+a.count}}r=r+1}return{result:false,count:i}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1;if(this.subGraphs.length>0){this.indexNodes2("none",this.subGraphs.length-1)}}getSubGraphs(){return this.subGraphs}firstGraph(){if(this.firstGraphFlag){this.firstGraphFlag=false;return true}return false}destructStartLink(e){let t=e.trim();let n="arrow_open";switch(t[0]){case"<":n="arrow_point";t=t.slice(1);break;case"x":n="arrow_cross";t=t.slice(1);break;case"o":n="arrow_circle";t=t.slice(1);break}let r="normal";if(t.includes("=")){r="thick"}if(t.includes(".")){r="dotted"}return{type:n,stroke:r}}countChar(e,t){const n=t.length;let r=0;for(let i=0;i":r="arrow_point";if(t.startsWith("<")){r="double_"+r;n=n.slice(1)}break;case"o":r="arrow_circle";if(t.startsWith("o")){r="double_"+r;n=n.slice(1)}break}let i="normal";let o=n.length-1;if(n.startsWith("=")){i="thick"}if(n.startsWith("~")){i="invisible"}const a=this.countChar(".",n);if(a){i="dotted";o=a}return{type:r,stroke:i,length:o}}destructLink(e,t){const n=this.destructEndLink(e);let r;if(t){r=this.destructStartLink(t);if(r.stroke!==n.stroke){return{type:"INVALID",stroke:"INVALID"}}if(r.type==="arrow_open"){r.type=n.type}else{if(r.type!==n.type){return{type:"INVALID",stroke:"INVALID"}}r.type="double_"+r.type}if(r.type==="double_arrow"){r.type="double_arrow_point"}r.length=n.length;return r}return n}exists(e,t){for(const n of e){if(n.nodes.includes(t)){return true}}return false}makeUniq(e,t){const n=[];e.nodes.forEach((r,i)=>{if(!this.exists(t,r)){n.push(e.nodes[i])}});return{nodes:n}}getTypeFromVertex(e){if(e.img){return"imageSquare"}if(e.icon){if(e.form==="circle"){return"iconCircle"}if(e.form==="square"){return"iconSquare"}if(e.form==="rounded"){return"iconRounded"}return"icon"}switch(e.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return e.type}}findNode(e,t){return e.find(n=>n.id===t)}destructEdgeType(e){let t="none";let n="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":n=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":t=e.replace("double_","");n=t;break}return{arrowTypeStart:t,arrowTypeEnd:n}}addNodeFromVertex(e,t,n,r,i,o){const a=n.get(e.id);const s=r.get(e.id)??false;const l=this.findNode(t,e.id);if(l){l.cssStyles=e.styles;l.cssCompiledStyles=this.getCompiledStyles(e.classes);l.cssClasses=e.classes.join(" ")}else{const u={id:e.id,label:e.text,labelType:e.labelType,labelStyle:"",parentId:a,padding:i.flowchart?.padding||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...e.classes]),cssClasses:"default "+e.classes.join(" "),dir:e.dir,domId:e.domId,look:o,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),icon:e.icon,pos:e.pos,img:e.img,assetWidth:e.assetWidth,assetHeight:e.assetHeight,constraint:e.constraint};if(s){t.push({...u,isGroup:true,shape:"rect"})}else{t.push({...u,isGroup:false,shape:this.getTypeFromVertex(e)})}}}getCompiledStyles(e){let t=[];for(const n of e){const r=this.classes.get(n);if(r?.styles){t=[...t,...r.styles??[]].map(i=>i.trim())}if(r?.textStyles){t=[...t,...r.textStyles??[]].map(i=>i.trim())}}return t}getData(){const e=Mn();const t=[];const n=[];const r=this.getSubGraphs();const i=new Map;const o=new Map;for(let l=r.length-1;l>=0;l--){const u=r[l];if(u.nodes.length>0){o.set(u.id,true)}for(const d of u.nodes){i.set(d,u.id)}}for(let l=r.length-1;l>=0;l--){const u=r[l];t.push({id:u.id,label:u.title,labelStyle:"",labelType:u.labelType,parentId:i.get(u.id),padding:8,cssCompiledStyles:this.getCompiledStyles(u.classes),cssClasses:u.classes.join(" "),shape:"rect",dir:u.dir==="TD"?"TB":u.dir,explicitDir:u.hasExplicitDir,isGroup:true,look:e.look})}const a=this.getVertices();a.forEach(l=>{this.addNodeFromVertex(l,t,i,o,e,e.look||"classic")});const s=this.getEdges();s.forEach((l,u)=>{const{arrowTypeStart:d,arrowTypeEnd:f}=this.destructEdgeType(l.type);const h=[...s.defaultStyle??[]];if(l.style){h.push(...l.style)}const m={id:VC(l.start,l.end,{counter:u,prefix:"L"},l.id),isUserDefinedId:l.isUserDefinedId,start:l.start,end:l.end,type:l.type??"normal",label:l.text,labelType:l.labelType,labelpos:"c",thickness:l.stroke,minlen:l.length,classes:l?.stroke==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:l?.stroke==="invisible"||l?.type==="arrow_open"?"none":d,arrowTypeEnd:l?.stroke==="invisible"||l?.type==="arrow_open"?"none":f,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(l.classes),labelStyle:h,style:h,pattern:l.stroke,look:e.look,animate:l.animate,animation:l.animation,curve:l.interpolate||this.edges.defaultInterpolate||e.flowchart?.curve};n.push(m)});return{nodes:t,edges:n,other:{},config:e}}defaultConfig(){return a2e.flowchart}};mIi=B(function(e,t){return t.db.getClasses()},"getClasses");gIi=B(async function(e,t,n,r,i){wt.info("REF0:");wt.info("Drawing state diagram (v2)",t);const{securityLevel:o,flowchart:a,layout:s}=Mn();r.db.setDiagramId(t);wt.debug("Before getData: ");const l=r.db.getData();wt.debug("Data: ",l);const u=G_(t,o);const d=r.db.getDirection();l.type=r.type;l.layoutAlgorithm=nS(s);if(l.layoutAlgorithm==="dagre"&&s==="elk"){wt.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback.")}l.direction=d;l.nodeSpacing=a?.nodeSpacing||50;l.rankSpacing=a?.rankSpacing||50;l.markers=["point","circle","cross"];l.diagramId=t;wt.debug("REF1:",l);await B_(l,u,i);const f=l.config.flowchart?.diagramPadding??8;Ko.insertTitle(u,"flowchartTitleText",a?.titleTopMargin||0,r.db.getDiagramTitle());Ex(u,f,"flowchart",a?.useMaxWidth||false)},"draw");yIi={getClasses:mIi,draw:gIi};rtt=function(){var e=B(function(sr,bn,ir,Jn){for(ir=ir||{},Jn=sr.length;Jn--;ir[sr[Jn]]=bn);return ir},"o"),t=[1,4],n=[1,3],r=[1,5],i=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],o=[2,2],a=[1,13],s=[1,14],l=[1,15],u=[1,16],d=[1,23],f=[1,25],h=[1,26],m=[1,27],g=[1,50],x=[1,49],w=[1,29],_=[1,30],C=[1,31],A=[1,32],P=[1,33],L=[1,45],I=[1,47],N=[1,43],O=[1,48],z=[1,44],U=[1,51],W=[1,46],H=[1,52],$=[1,53],K=[1,34],X=[1,35],j=[1,36],te=[1,37],J=[1,38],oe=[1,58],se=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],re=[1,62],ce=[1,61],ue=[1,63],xe=[8,9,11,75,77,78],be=[1,79],Ie=[1,92],he=[1,97],ve=[1,96],ge=[1,93],Ve=[1,89],Le=[1,95],$e=[1,91],Ee=[1,98],tt=[1,94],yt=[1,99],mt=[1,90],ct=[8,9,10,11,40,75,77,78],Ge=[8,9,10,11,40,46,75,77,78],it=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],bt=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],He=[44,60,89,102,105,106,109,111,114,115,116],Je=[1,122],Te=[1,123],we=[1,125],Ze=[1,124],Be=[44,60,62,74,89,102,105,106,109,111,114,115,116],qe=[1,134],Qe=[1,148],ze=[1,149],Me=[1,150],ye=[1,151],Ne=[1,136],Ae=[1,138],dt=[1,142],Oe=[1,143],Wt=[1,144],kt=[1,145],qt=[1,146],_t=[1,147],sn=[1,152],Jt=[1,153],Sn=[1,132],Kt=[1,133],mn=[1,140],At=[1,135],lr=[1,139],on=[1,137],cr=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],Hr=[1,155],Mr=[1,157],Er=[8,9,11],vr=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],Yr=[1,177],nt=[1,173],Rr=[1,174],Xr=[1,178],dr=[1,175],rn=[1,176],St=[77,116,119],Ut=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],Pt=[10,106],an=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],Xt=[1,248],Cn=[1,246],rr=[1,250],hr=[1,244],Et=[1,245],Tn=[1,247],ft=[1,249],zt=[1,251],Gt=[1,269],gn=[8,9,11,106],Fn=[8,9,10,11,60,84,105,106,109,110,111,112];var Tr={trace:B(function sr(){},"trace"),yy:{},symbols_:{"error":2,"start":3,"graphConfig":4,"document":5,"line":6,"statement":7,"SEMI":8,"NEWLINE":9,"SPACE":10,"EOF":11,"GRAPH":12,"NODIR":13,"DIR":14,"FirstStmtSeparator":15,"ending":16,"endToken":17,"spaceList":18,"spaceListNewline":19,"vertexStatement":20,"separator":21,"styleStatement":22,"linkStyleStatement":23,"classDefStatement":24,"classStatement":25,"clickStatement":26,"subgraph":27,"textNoTags":28,"SQS":29,"text":30,"SQE":31,"end":32,"direction":33,"acc_title":34,"acc_title_value":35,"acc_descr":36,"acc_descr_value":37,"acc_descr_multiline_value":38,"shapeData":39,"SHAPE_DATA":40,"link":41,"node":42,"styledVertex":43,"AMP":44,"vertex":45,"STYLE_SEPARATOR":46,"idString":47,"DOUBLECIRCLESTART":48,"DOUBLECIRCLEEND":49,"PS":50,"PE":51,"(-":52,"-)":53,"STADIUMSTART":54,"STADIUMEND":55,"SUBROUTINESTART":56,"SUBROUTINEEND":57,"VERTEX_WITH_PROPS_START":58,"NODE_STRING[field]":59,"COLON":60,"NODE_STRING[value]":61,"PIPE":62,"CYLINDERSTART":63,"CYLINDEREND":64,"DIAMOND_START":65,"DIAMOND_STOP":66,"TAGEND":67,"TRAPSTART":68,"TRAPEND":69,"INVTRAPSTART":70,"INVTRAPEND":71,"linkStatement":72,"arrowText":73,"TESTSTR":74,"START_LINK":75,"edgeText":76,"LINK":77,"LINK_ID":78,"edgeTextToken":79,"STR":80,"MD_STR":81,"textToken":82,"keywords":83,"STYLE":84,"LINKSTYLE":85,"CLASSDEF":86,"CLASS":87,"CLICK":88,"DOWN":89,"UP":90,"textNoTagsToken":91,"stylesOpt":92,"idString[vertex]":93,"idString[class]":94,"CALLBACKNAME":95,"CALLBACKARGS":96,"HREF":97,"LINK_TARGET":98,"STR[link]":99,"STR[tooltip]":100,"alphaNum":101,"DEFAULT":102,"numList":103,"INTERPOLATE":104,"NUM":105,"COMMA":106,"style":107,"styleComponent":108,"NODE_STRING":109,"UNIT":110,"BRKT":111,"PCT":112,"idStringToken":113,"MINUS":114,"MULT":115,"UNICODE_TEXT":116,"TEXT":117,"TAGSTART":118,"EDGE_TEXT":119,"alphaNumToken":120,"direction_tb":121,"direction_bt":122,"direction_rl":123,"direction_lr":124,"direction_td":125,"$accept":0,"$end":1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr",125:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:B(function sr(bn,ir,Jn,er,Pr,Vt,di){var ln=Vt.length-1;switch(Pr){case 2:this.$=[];break;case 3:if(!Array.isArray(Vt[ln])||Vt[ln].length>0){Vt[ln-1].push(Vt[ln])}this.$=Vt[ln-1];break;case 4:case 183:this.$=Vt[ln];break;case 11:er.setDirection("TB");this.$="TB";break;case 12:er.setDirection(Vt[ln-1]);this.$=Vt[ln-1];break;case 27:this.$=Vt[ln-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=er.addSubGraph(Vt[ln-6],Vt[ln-1],Vt[ln-4]);break;case 34:this.$=er.addSubGraph(Vt[ln-3],Vt[ln-1],Vt[ln-3]);break;case 35:this.$=er.addSubGraph(void 0,Vt[ln-1],void 0);break;case 37:this.$=Vt[ln].trim();er.setAccTitle(this.$);break;case 38:case 39:this.$=Vt[ln].trim();er.setAccDescription(this.$);break;case 43:this.$=Vt[ln-1]+Vt[ln];break;case 44:this.$=Vt[ln];break;case 45:er.addVertex(Vt[ln-1][Vt[ln-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Vt[ln]);er.addLink(Vt[ln-3].stmt,Vt[ln-1],Vt[ln-2]);this.$={stmt:Vt[ln-1],nodes:Vt[ln-1].concat(Vt[ln-3].nodes)};break;case 46:er.addLink(Vt[ln-2].stmt,Vt[ln],Vt[ln-1]);this.$={stmt:Vt[ln],nodes:Vt[ln].concat(Vt[ln-2].nodes)};break;case 47:er.addLink(Vt[ln-3].stmt,Vt[ln-1],Vt[ln-2]);this.$={stmt:Vt[ln-1],nodes:Vt[ln-1].concat(Vt[ln-3].nodes)};break;case 48:this.$={stmt:Vt[ln-1],nodes:Vt[ln-1]};break;case 49:er.addVertex(Vt[ln-1][Vt[ln-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Vt[ln]);this.$={stmt:Vt[ln-1],nodes:Vt[ln-1],shapeData:Vt[ln]};break;case 50:this.$={stmt:Vt[ln],nodes:Vt[ln]};break;case 51:this.$=[Vt[ln]];break;case 52:er.addVertex(Vt[ln-5][Vt[ln-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Vt[ln-4]);this.$=Vt[ln-5].concat(Vt[ln]);break;case 53:this.$=Vt[ln-4].concat(Vt[ln]);break;case 54:this.$=Vt[ln];break;case 55:this.$=Vt[ln-2];er.setClass(Vt[ln-2],Vt[ln]);break;case 56:this.$=Vt[ln-3];er.addVertex(Vt[ln-3],Vt[ln-1],"square");break;case 57:this.$=Vt[ln-3];er.addVertex(Vt[ln-3],Vt[ln-1],"doublecircle");break;case 58:this.$=Vt[ln-5];er.addVertex(Vt[ln-5],Vt[ln-2],"circle");break;case 59:this.$=Vt[ln-3];er.addVertex(Vt[ln-3],Vt[ln-1],"ellipse");break;case 60:this.$=Vt[ln-3];er.addVertex(Vt[ln-3],Vt[ln-1],"stadium");break;case 61:this.$=Vt[ln-3];er.addVertex(Vt[ln-3],Vt[ln-1],"subroutine");break;case 62:this.$=Vt[ln-7];er.addVertex(Vt[ln-7],Vt[ln-1],"rect",void 0,void 0,void 0,Object.fromEntries([[Vt[ln-5],Vt[ln-3]]]));break;case 63:this.$=Vt[ln-3];er.addVertex(Vt[ln-3],Vt[ln-1],"cylinder");break;case 64:this.$=Vt[ln-3];er.addVertex(Vt[ln-3],Vt[ln-1],"round");break;case 65:this.$=Vt[ln-3];er.addVertex(Vt[ln-3],Vt[ln-1],"diamond");break;case 66:this.$=Vt[ln-5];er.addVertex(Vt[ln-5],Vt[ln-2],"hexagon");break;case 67:this.$=Vt[ln-3];er.addVertex(Vt[ln-3],Vt[ln-1],"odd");break;case 68:this.$=Vt[ln-3];er.addVertex(Vt[ln-3],Vt[ln-1],"trapezoid");break;case 69:this.$=Vt[ln-3];er.addVertex(Vt[ln-3],Vt[ln-1],"inv_trapezoid");break;case 70:this.$=Vt[ln-3];er.addVertex(Vt[ln-3],Vt[ln-1],"lean_right");break;case 71:this.$=Vt[ln-3];er.addVertex(Vt[ln-3],Vt[ln-1],"lean_left");break;case 72:this.$=Vt[ln];er.addVertex(Vt[ln]);break;case 73:Vt[ln-1].text=Vt[ln];this.$=Vt[ln-1];break;case 74:case 75:Vt[ln-2].text=Vt[ln-1];this.$=Vt[ln-2];break;case 76:this.$=Vt[ln];break;case 77:var yi=er.destructLink(Vt[ln],Vt[ln-2]);this.$={"type":yi.type,"stroke":yi.stroke,"length":yi.length,"text":Vt[ln-1]};break;case 78:var yi=er.destructLink(Vt[ln],Vt[ln-2]);this.$={"type":yi.type,"stroke":yi.stroke,"length":yi.length,"text":Vt[ln-1],"id":Vt[ln-3]};break;case 79:this.$={text:Vt[ln],type:"text"};break;case 80:this.$={text:Vt[ln-1].text+""+Vt[ln],type:Vt[ln-1].type};break;case 81:this.$={text:Vt[ln],type:"string"};break;case 82:this.$={text:Vt[ln],type:"markdown"};break;case 83:var yi=er.destructLink(Vt[ln]);this.$={"type":yi.type,"stroke":yi.stroke,"length":yi.length};break;case 84:var yi=er.destructLink(Vt[ln]);this.$={"type":yi.type,"stroke":yi.stroke,"length":yi.length,"id":Vt[ln-1]};break;case 85:this.$=Vt[ln-1];break;case 86:this.$={text:Vt[ln],type:"text"};break;case 87:this.$={text:Vt[ln-1].text+""+Vt[ln],type:Vt[ln-1].type};break;case 88:this.$={text:Vt[ln],type:"string"};break;case 89:case 104:this.$={text:Vt[ln],type:"markdown"};break;case 101:this.$={text:Vt[ln],type:"text"};break;case 102:this.$={text:Vt[ln-1].text+""+Vt[ln],type:Vt[ln-1].type};break;case 103:this.$={text:Vt[ln],type:"text"};break;case 105:this.$=Vt[ln-4];er.addClass(Vt[ln-2],Vt[ln]);break;case 106:this.$=Vt[ln-4];er.setClass(Vt[ln-2],Vt[ln]);break;case 107:case 115:this.$=Vt[ln-1];er.setClickEvent(Vt[ln-1],Vt[ln]);break;case 108:case 116:this.$=Vt[ln-3];er.setClickEvent(Vt[ln-3],Vt[ln-2]);er.setTooltip(Vt[ln-3],Vt[ln]);break;case 109:this.$=Vt[ln-2];er.setClickEvent(Vt[ln-2],Vt[ln-1],Vt[ln]);break;case 110:this.$=Vt[ln-4];er.setClickEvent(Vt[ln-4],Vt[ln-3],Vt[ln-2]);er.setTooltip(Vt[ln-4],Vt[ln]);break;case 111:this.$=Vt[ln-2];er.setLink(Vt[ln-2],Vt[ln]);break;case 112:this.$=Vt[ln-4];er.setLink(Vt[ln-4],Vt[ln-2]);er.setTooltip(Vt[ln-4],Vt[ln]);break;case 113:this.$=Vt[ln-4];er.setLink(Vt[ln-4],Vt[ln-2],Vt[ln]);break;case 114:this.$=Vt[ln-6];er.setLink(Vt[ln-6],Vt[ln-4],Vt[ln]);er.setTooltip(Vt[ln-6],Vt[ln-2]);break;case 117:this.$=Vt[ln-1];er.setLink(Vt[ln-1],Vt[ln]);break;case 118:this.$=Vt[ln-3];er.setLink(Vt[ln-3],Vt[ln-2]);er.setTooltip(Vt[ln-3],Vt[ln]);break;case 119:this.$=Vt[ln-3];er.setLink(Vt[ln-3],Vt[ln-2],Vt[ln]);break;case 120:this.$=Vt[ln-5];er.setLink(Vt[ln-5],Vt[ln-4],Vt[ln]);er.setTooltip(Vt[ln-5],Vt[ln-2]);break;case 121:this.$=Vt[ln-4];er.addVertex(Vt[ln-2],void 0,void 0,Vt[ln]);break;case 122:this.$=Vt[ln-4];er.updateLink([Vt[ln-2]],Vt[ln]);break;case 123:this.$=Vt[ln-4];er.updateLink(Vt[ln-2],Vt[ln]);break;case 124:this.$=Vt[ln-8];er.updateLinkInterpolate([Vt[ln-6]],Vt[ln-2]);er.updateLink([Vt[ln-6]],Vt[ln]);break;case 125:this.$=Vt[ln-8];er.updateLinkInterpolate(Vt[ln-6],Vt[ln-2]);er.updateLink(Vt[ln-6],Vt[ln]);break;case 126:this.$=Vt[ln-6];er.updateLinkInterpolate([Vt[ln-4]],Vt[ln]);break;case 127:this.$=Vt[ln-6];er.updateLinkInterpolate(Vt[ln-4],Vt[ln]);break;case 128:case 130:this.$=[Vt[ln]];break;case 129:case 131:Vt[ln-2].push(Vt[ln]);this.$=Vt[ln-2];break;case 133:this.$=Vt[ln-1]+Vt[ln];break;case 181:this.$=Vt[ln];break;case 182:this.$=Vt[ln-1]+""+Vt[ln];break;case 184:this.$=Vt[ln-1]+""+Vt[ln];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break;case 189:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,9:t,10:n,12:r},{1:[3]},e(i,o,{5:6}),{4:7,9:t,10:n,12:r},{4:8,9:t,10:n,12:r},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:a,9:s,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:d,33:24,34:f,36:h,38:m,42:28,43:39,44:g,45:40,47:41,60:x,84:w,85:_,86:C,87:A,88:P,89:L,102:I,105:N,106:O,109:z,111:U,113:42,114:W,115:H,116:$,121:K,122:X,123:j,124:te,125:J},e(i,[2,9]),e(i,[2,10]),e(i,[2,11]),{8:[1,55],9:[1,56],10:oe,15:54,18:57},e(se,[2,3]),e(se,[2,4]),e(se,[2,5]),e(se,[2,6]),e(se,[2,7]),e(se,[2,8]),{8:re,9:ce,11:ue,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:re,9:ce,11:ue,21:68},{8:re,9:ce,11:ue,21:69},{8:re,9:ce,11:ue,21:70},{8:re,9:ce,11:ue,21:71},{8:re,9:ce,11:ue,21:72},{8:re,9:ce,10:[1,73],11:ue,21:74},e(se,[2,36]),{35:[1,75]},{37:[1,76]},e(se,[2,39]),e(xe,[2,50],{18:77,39:78,10:oe,40:be}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:Ie,44:he,60:ve,80:[1,87],89:ge,95:[1,84],97:[1,85],101:86,105:Ve,106:Le,109:$e,111:Ee,114:tt,115:yt,116:mt,120:88},e(se,[2,185]),e(se,[2,186]),e(se,[2,187]),e(se,[2,188]),e(se,[2,189]),e(ct,[2,51]),e(ct,[2,54],{46:[1,100]}),e(Ge,[2,72],{113:113,29:[1,101],44:g,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:x,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:L,102:I,105:N,106:O,109:z,111:U,114:W,115:H,116:$}),e(it,[2,181]),e(it,[2,142]),e(it,[2,143]),e(it,[2,144]),e(it,[2,145]),e(it,[2,146]),e(it,[2,147]),e(it,[2,148]),e(it,[2,149]),e(it,[2,150]),e(it,[2,151]),e(it,[2,152]),e(i,[2,12]),e(i,[2,18]),e(i,[2,19]),{9:[1,114]},e(bt,[2,26],{18:115,10:oe}),e(se,[2,27]),{42:116,43:39,44:g,45:40,47:41,60:x,89:L,102:I,105:N,106:O,109:z,111:U,113:42,114:W,115:H,116:$},e(se,[2,40]),e(se,[2,41]),e(se,[2,42]),e(He,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:Je,81:Te,116:we,119:Ze},{75:[1,126],77:[1,127]},e(Be,[2,83]),e(se,[2,28]),e(se,[2,29]),e(se,[2,30]),e(se,[2,31]),e(se,[2,32]),{10:qe,12:Qe,14:ze,27:Me,28:128,32:ye,44:Ne,60:Ae,75:dt,80:[1,130],81:[1,131],83:141,84:Oe,85:Wt,86:kt,87:qt,88:_t,89:sn,90:Jt,91:129,105:Sn,109:Kt,111:mn,114:At,115:lr,116:on},e(cr,o,{5:154}),e(se,[2,37]),e(se,[2,38]),e(xe,[2,48],{44:Hr}),e(xe,[2,49],{18:156,10:oe,40:Mr}),e(ct,[2,44]),{44:g,47:158,60:x,89:L,102:I,105:N,106:O,109:z,111:U,113:42,114:W,115:H,116:$},{102:[1,159],103:160,105:[1,161]},{44:g,47:162,60:x,89:L,102:I,105:N,106:O,109:z,111:U,113:42,114:W,115:H,116:$},{44:g,47:163,60:x,89:L,102:I,105:N,106:O,109:z,111:U,113:42,114:W,115:H,116:$},e(Er,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},e(Er,[2,115],{120:168,10:[1,167],14:Ie,44:he,60:ve,89:ge,105:Ve,106:Le,109:$e,111:Ee,114:tt,115:yt,116:mt}),e(Er,[2,117],{10:[1,169]}),e(vr,[2,183]),e(vr,[2,170]),e(vr,[2,171]),e(vr,[2,172]),e(vr,[2,173]),e(vr,[2,174]),e(vr,[2,175]),e(vr,[2,176]),e(vr,[2,177]),e(vr,[2,178]),e(vr,[2,179]),e(vr,[2,180]),{44:g,47:170,60:x,89:L,102:I,105:N,106:O,109:z,111:U,113:42,114:W,115:H,116:$},{30:171,67:Yr,80:nt,81:Rr,82:172,116:Xr,117:dr,118:rn},{30:179,67:Yr,80:nt,81:Rr,82:172,116:Xr,117:dr,118:rn},{30:181,50:[1,180],67:Yr,80:nt,81:Rr,82:172,116:Xr,117:dr,118:rn},{30:182,67:Yr,80:nt,81:Rr,82:172,116:Xr,117:dr,118:rn},{30:183,67:Yr,80:nt,81:Rr,82:172,116:Xr,117:dr,118:rn},{30:184,67:Yr,80:nt,81:Rr,82:172,116:Xr,117:dr,118:rn},{109:[1,185]},{30:186,67:Yr,80:nt,81:Rr,82:172,116:Xr,117:dr,118:rn},{30:187,65:[1,188],67:Yr,80:nt,81:Rr,82:172,116:Xr,117:dr,118:rn},{30:189,67:Yr,80:nt,81:Rr,82:172,116:Xr,117:dr,118:rn},{30:190,67:Yr,80:nt,81:Rr,82:172,116:Xr,117:dr,118:rn},{30:191,67:Yr,80:nt,81:Rr,82:172,116:Xr,117:dr,118:rn},e(it,[2,182]),e(i,[2,20]),e(bt,[2,25]),e(xe,[2,46],{39:192,18:193,10:oe,40:be}),e(He,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:Yr,80:nt,81:Rr,82:172,116:Xr,117:dr,118:rn},{77:[1,197],79:198,116:we,119:Ze},e(St,[2,79]),e(St,[2,81]),e(St,[2,82]),e(St,[2,168]),e(St,[2,169]),{76:199,79:121,80:Je,81:Te,116:we,119:Ze},e(Be,[2,84]),{8:re,9:ce,10:qe,11:ue,12:Qe,14:ze,21:201,27:Me,29:[1,200],32:ye,44:Ne,60:Ae,75:dt,83:141,84:Oe,85:Wt,86:kt,87:qt,88:_t,89:sn,90:Jt,91:202,105:Sn,109:Kt,111:mn,114:At,115:lr,116:on},e(Ut,[2,101]),e(Ut,[2,103]),e(Ut,[2,104]),e(Ut,[2,157]),e(Ut,[2,158]),e(Ut,[2,159]),e(Ut,[2,160]),e(Ut,[2,161]),e(Ut,[2,162]),e(Ut,[2,163]),e(Ut,[2,164]),e(Ut,[2,165]),e(Ut,[2,166]),e(Ut,[2,167]),e(Ut,[2,90]),e(Ut,[2,91]),e(Ut,[2,92]),e(Ut,[2,93]),e(Ut,[2,94]),e(Ut,[2,95]),e(Ut,[2,96]),e(Ut,[2,97]),e(Ut,[2,98]),e(Ut,[2,99]),e(Ut,[2,100]),{6:11,7:12,8:a,9:s,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:d,32:[1,203],33:24,34:f,36:h,38:m,42:28,43:39,44:g,45:40,47:41,60:x,84:w,85:_,86:C,87:A,88:P,89:L,102:I,105:N,106:O,109:z,111:U,113:42,114:W,115:H,116:$,121:K,122:X,123:j,124:te,125:J},{10:oe,18:204},{44:[1,205]},e(ct,[2,43]),{10:[1,206],44:g,60:x,89:L,102:I,105:N,106:O,109:z,111:U,113:113,114:W,115:H,116:$},{10:[1,207]},{10:[1,208],106:[1,209]},e(Pt,[2,128]),{10:[1,210],44:g,60:x,89:L,102:I,105:N,106:O,109:z,111:U,113:113,114:W,115:H,116:$},{10:[1,211],44:g,60:x,89:L,102:I,105:N,106:O,109:z,111:U,113:113,114:W,115:H,116:$},{80:[1,212]},e(Er,[2,109],{10:[1,213]}),e(Er,[2,111],{10:[1,214]}),{80:[1,215]},e(vr,[2,184]),{80:[1,216],98:[1,217]},e(ct,[2,55],{113:113,44:g,60:x,89:L,102:I,105:N,106:O,109:z,111:U,114:W,115:H,116:$}),{31:[1,218],67:Yr,82:219,116:Xr,117:dr,118:rn},e(an,[2,86]),e(an,[2,88]),e(an,[2,89]),e(an,[2,153]),e(an,[2,154]),e(an,[2,155]),e(an,[2,156]),{49:[1,220],67:Yr,82:219,116:Xr,117:dr,118:rn},{30:221,67:Yr,80:nt,81:Rr,82:172,116:Xr,117:dr,118:rn},{51:[1,222],67:Yr,82:219,116:Xr,117:dr,118:rn},{53:[1,223],67:Yr,82:219,116:Xr,117:dr,118:rn},{55:[1,224],67:Yr,82:219,116:Xr,117:dr,118:rn},{57:[1,225],67:Yr,82:219,116:Xr,117:dr,118:rn},{60:[1,226]},{64:[1,227],67:Yr,82:219,116:Xr,117:dr,118:rn},{66:[1,228],67:Yr,82:219,116:Xr,117:dr,118:rn},{30:229,67:Yr,80:nt,81:Rr,82:172,116:Xr,117:dr,118:rn},{31:[1,230],67:Yr,82:219,116:Xr,117:dr,118:rn},{67:Yr,69:[1,231],71:[1,232],82:219,116:Xr,117:dr,118:rn},{67:Yr,69:[1,234],71:[1,233],82:219,116:Xr,117:dr,118:rn},e(xe,[2,45],{18:156,10:oe,40:Mr}),e(xe,[2,47],{44:Hr}),e(He,[2,75]),e(He,[2,74]),{62:[1,235],67:Yr,82:219,116:Xr,117:dr,118:rn},e(He,[2,77]),e(St,[2,80]),{77:[1,236],79:198,116:we,119:Ze},{30:237,67:Yr,80:nt,81:Rr,82:172,116:Xr,117:dr,118:rn},e(cr,o,{5:238}),e(Ut,[2,102]),e(se,[2,35]),{43:239,44:g,45:40,47:41,60:x,89:L,102:I,105:N,106:O,109:z,111:U,113:42,114:W,115:H,116:$},{10:oe,18:240},{10:Xt,60:Cn,84:rr,92:241,105:hr,107:242,108:243,109:Et,110:Tn,111:ft,112:zt},{10:Xt,60:Cn,84:rr,92:252,104:[1,253],105:hr,107:242,108:243,109:Et,110:Tn,111:ft,112:zt},{10:Xt,60:Cn,84:rr,92:254,104:[1,255],105:hr,107:242,108:243,109:Et,110:Tn,111:ft,112:zt},{105:[1,256]},{10:Xt,60:Cn,84:rr,92:257,105:hr,107:242,108:243,109:Et,110:Tn,111:ft,112:zt},{44:g,47:258,60:x,89:L,102:I,105:N,106:O,109:z,111:U,113:42,114:W,115:H,116:$},e(Er,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},e(Er,[2,116]),e(Er,[2,118],{10:[1,262]}),e(Er,[2,119]),e(Ge,[2,56]),e(an,[2,87]),e(Ge,[2,57]),{51:[1,263],67:Yr,82:219,116:Xr,117:dr,118:rn},e(Ge,[2,64]),e(Ge,[2,59]),e(Ge,[2,60]),e(Ge,[2,61]),{109:[1,264]},e(Ge,[2,63]),e(Ge,[2,65]),{66:[1,265],67:Yr,82:219,116:Xr,117:dr,118:rn},e(Ge,[2,67]),e(Ge,[2,68]),e(Ge,[2,70]),e(Ge,[2,69]),e(Ge,[2,71]),e([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),e(He,[2,78]),{31:[1,266],67:Yr,82:219,116:Xr,117:dr,118:rn},{6:11,7:12,8:a,9:s,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:d,32:[1,267],33:24,34:f,36:h,38:m,42:28,43:39,44:g,45:40,47:41,60:x,84:w,85:_,86:C,87:A,88:P,89:L,102:I,105:N,106:O,109:z,111:U,113:42,114:W,115:H,116:$,121:K,122:X,123:j,124:te,125:J},e(ct,[2,53]),{43:268,44:g,45:40,47:41,60:x,89:L,102:I,105:N,106:O,109:z,111:U,113:42,114:W,115:H,116:$},e(Er,[2,121],{106:Gt}),e(gn,[2,130],{108:270,10:Xt,60:Cn,84:rr,105:hr,109:Et,110:Tn,111:ft,112:zt}),e(Fn,[2,132]),e(Fn,[2,134]),e(Fn,[2,135]),e(Fn,[2,136]),e(Fn,[2,137]),e(Fn,[2,138]),e(Fn,[2,139]),e(Fn,[2,140]),e(Fn,[2,141]),e(Er,[2,122],{106:Gt}),{10:[1,271]},e(Er,[2,123],{106:Gt}),{10:[1,272]},e(Pt,[2,129]),e(Er,[2,105],{106:Gt}),e(Er,[2,106],{113:113,44:g,60:x,89:L,102:I,105:N,106:O,109:z,111:U,114:W,115:H,116:$}),e(Er,[2,110]),e(Er,[2,112],{10:[1,273]}),e(Er,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:re,9:ce,11:ue,21:278},e(se,[2,34]),e(ct,[2,52]),{10:Xt,60:Cn,84:rr,105:hr,107:279,108:243,109:Et,110:Tn,111:ft,112:zt},e(Fn,[2,133]),{14:Ie,44:he,60:ve,89:ge,101:280,105:Ve,106:Le,109:$e,111:Ee,114:tt,115:yt,116:mt,120:88},{14:Ie,44:he,60:ve,89:ge,101:281,105:Ve,106:Le,109:$e,111:Ee,114:tt,115:yt,116:mt,120:88},{98:[1,282]},e(Er,[2,120]),e(Ge,[2,58]),{30:283,67:Yr,80:nt,81:Rr,82:172,116:Xr,117:dr,118:rn},e(Ge,[2,66]),e(cr,o,{5:284}),e(gn,[2,131],{108:270,10:Xt,60:Cn,84:rr,105:hr,109:Et,110:Tn,111:ft,112:zt}),e(Er,[2,126],{120:168,10:[1,285],14:Ie,44:he,60:ve,89:ge,105:Ve,106:Le,109:$e,111:Ee,114:tt,115:yt,116:mt}),e(Er,[2,127],{120:168,10:[1,286],14:Ie,44:he,60:ve,89:ge,105:Ve,106:Le,109:$e,111:Ee,114:tt,115:yt,116:mt}),e(Er,[2,114]),{31:[1,287],67:Yr,82:219,116:Xr,117:dr,118:rn},{6:11,7:12,8:a,9:s,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:d,32:[1,288],33:24,34:f,36:h,38:m,42:28,43:39,44:g,45:40,47:41,60:x,84:w,85:_,86:C,87:A,88:P,89:L,102:I,105:N,106:O,109:z,111:U,113:42,114:W,115:H,116:$,121:K,122:X,123:j,124:te,125:J},{10:Xt,60:Cn,84:rr,92:289,105:hr,107:242,108:243,109:Et,110:Tn,111:ft,112:zt},{10:Xt,60:Cn,84:rr,92:290,105:hr,107:242,108:243,109:Et,110:Tn,111:ft,112:zt},e(Ge,[2,62]),e(se,[2,33]),e(Er,[2,124],{106:Gt}),e(Er,[2,125],{106:Gt})],defaultActions:{},parseError:B(function sr(bn,ir){if(ir.recoverable){this.trace(bn)}else{var Jn=new Error(bn);Jn.hash=ir;throw Jn}},"parseError"),parse:B(function sr(bn){var ir=this,Jn=[0],er=[],Pr=[null],Vt=[],di=this.table,ln="",yi=0,yo=0,Pa=0,Ms=2,ds=1;var st=Vt.slice.call(arguments,1);var en=Object.create(this.lexer);var yn={yy:{}};for(var jn in this.yy){if(Object.prototype.hasOwnProperty.call(this.yy,jn)){yn.yy[jn]=this.yy[jn]}}en.setInput(bn,yn.yy);yn.yy.lexer=en;yn.yy.parser=this;if(typeof en.yylloc=="undefined"){en.yylloc={}}var xr=en.yylloc;Vt.push(xr);var wr=en.options&&en.options.ranges;if(typeof yn.yy.parseError==="function"){this.parseError=yn.yy.parseError}else{this.parseError=Object.getPrototypeOf(this).parseError}function Dr(ut){Jn.length=Jn.length-2*ut;Pr.length=Pr.length-ut;Vt.length=Vt.length-ut}B(Dr,"popStack");function Pn(){var ut;ut=er.pop()||en.lex()||ds;if(typeof ut!=="number"){if(ut instanceof Array){er=ut;ut=er.pop()}ut=ir.symbols_[ut]||ut}return ut}B(Pn,"lex");var Ot,Nn,nr,Ur,bi,$i,Zi={},Fo,Ao,Ho,Ia;while(true){nr=Jn[Jn.length-1];if(this.defaultActions[nr]){Ur=this.defaultActions[nr]}else{if(Ot===null||typeof Ot=="undefined"){Ot=Pn()}Ur=di[nr]&&di[nr][Ot]}if(typeof Ur==="undefined"||!Ur.length||!Ur[0]){var ba="";Ia=[];for(Fo in di[nr]){if(this.terminals_[Fo]&&Fo>Ms){Ia.push("'"+this.terminals_[Fo]+"'")}}if(en.showPosition){ba="Parse error on line "+(yi+1)+":\n"+en.showPosition()+"\nExpecting "+Ia.join(", ")+", got '"+(this.terminals_[Ot]||Ot)+"'"}else{ba="Parse error on line "+(yi+1)+": Unexpected "+(Ot==ds?"end of input":"'"+(this.terminals_[Ot]||Ot)+"'")}this.parseError(ba,{text:en.match,token:this.terminals_[Ot]||Ot,line:en.yylineno,loc:xr,expected:Ia})}if(Ur[0]instanceof Array&&Ur.length>1){throw new Error("Parse Error: multiple actions possible at state: "+nr+", token: "+Ot)}switch(Ur[0]){case 1:Jn.push(Ot);Pr.push(en.yytext);Vt.push(en.yylloc);Jn.push(Ur[1]);Ot=null;if(!Nn){yo=en.yyleng;ln=en.yytext;yi=en.yylineno;xr=en.yylloc;if(Pa>0){Pa--}}else{Ot=Nn;Nn=null}break;case 2:Ao=this.productions_[Ur[1]][1];Zi.$=Pr[Pr.length-Ao];Zi._$={first_line:Vt[Vt.length-(Ao||1)].first_line,last_line:Vt[Vt.length-1].last_line,first_column:Vt[Vt.length-(Ao||1)].first_column,last_column:Vt[Vt.length-1].last_column};if(wr){Zi._$.range=[Vt[Vt.length-(Ao||1)].range[0],Vt[Vt.length-1].range[1]]}$i=this.performAction.apply(Zi,[ln,yo,yi,yn.yy,Ur[1],Pr,Vt].concat(st));if(typeof $i!=="undefined"){return $i}if(Ao){Jn=Jn.slice(0,-1*Ao*2);Pr=Pr.slice(0,-1*Ao);Vt=Vt.slice(0,-1*Ao)}Jn.push(this.productions_[Ur[1]][0]);Pr.push(Zi.$);Vt.push(Zi._$);Ho=di[Jn[Jn.length-2]][Jn[Jn.length-1]];Jn.push(Ho);break;case 3:return true}}return true},"parse")};var Jr=function(){var sr={EOF:1,parseError:B(function bn(ir,Jn){if(this.yy.parser){this.yy.parser.parseError(ir,Jn)}else{throw new Error(ir)}},"parseError"),setInput:B(function(bn,ir){this.yy=ir||this.yy||{};this._input=bn;this._more=this._backtrack=this.done=false;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};if(this.options.ranges){this.yylloc.range=[0,0]}this.offset=0;return this},"setInput"),input:B(function(){var bn=this._input[0];this.yytext+=bn;this.yyleng++;this.offset++;this.match+=bn;this.matched+=bn;var ir=bn.match(/(?:\r\n?|\n).*/g);if(ir){this.yylineno++;this.yylloc.last_line++}else{this.yylloc.last_column++}if(this.options.ranges){this.yylloc.range[1]++}this._input=this._input.slice(1);return bn},"input"),unput:B(function(bn){var ir=bn.length;var Jn=bn.split(/(?:\r\n?|\n)/g);this._input=bn+this._input;this.yytext=this.yytext.substr(0,this.yytext.length-ir);this.offset-=ir;var er=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1);this.matched=this.matched.substr(0,this.matched.length-1);if(Jn.length-1){this.yylineno-=Jn.length-1}var Pr=this.yylloc.range;this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Jn?(Jn.length===er.length?this.yylloc.first_column:0)+er[er.length-Jn.length].length-Jn[0].length:this.yylloc.first_column-ir};if(this.options.ranges){this.yylloc.range=[Pr[0],Pr[0]+this.yyleng-ir]}this.yyleng=this.yytext.length;return this},"unput"),more:B(function(){this._more=true;return this},"more"),reject:B(function(){if(this.options.backtrack_lexer){this._backtrack=true}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}return this},"reject"),less:B(function(bn){this.unput(this.match.slice(bn))},"less"),pastInput:B(function(){var bn=this.matched.substr(0,this.matched.length-this.match.length);return(bn.length>20?"...":"")+bn.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:B(function(){var bn=this.match;if(bn.length<20){bn+=this._input.substr(0,20-bn.length)}return(bn.substr(0,20)+(bn.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:B(function(){var bn=this.pastInput();var ir=new Array(bn.length+1).join("-");return bn+this.upcomingInput()+"\n"+ir+"^"},"showPosition"),test_match:B(function(bn,ir){var Jn,er,Pr;if(this.options.backtrack_lexer){Pr={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done};if(this.options.ranges){Pr.yylloc.range=this.yylloc.range.slice(0)}}er=bn[0].match(/(?:\r\n?|\n).*/g);if(er){this.yylineno+=er.length}this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:er?er[er.length-1].length-er[er.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+bn[0].length};this.yytext+=bn[0];this.match+=bn[0];this.matches=bn;this.yyleng=this.yytext.length;if(this.options.ranges){this.yylloc.range=[this.offset,this.offset+=this.yyleng]}this._more=false;this._backtrack=false;this._input=this._input.slice(bn[0].length);this.matched+=bn[0];Jn=this.performAction.call(this,this.yy,this,ir,this.conditionStack[this.conditionStack.length-1]);if(this.done&&this._input){this.done=false}if(Jn){return Jn}else if(this._backtrack){for(var Vt in Pr){this[Vt]=Pr[Vt]}return false}return false},"test_match"),next:B(function(){if(this.done){return this.EOF}if(!this._input){this.done=true}var bn,ir,Jn,er;if(!this._more){this.yytext="";this.match=""}var Pr=this._currentRules();for(var Vt=0;Vtir[0].length)){ir=Jn;er=Vt;if(this.options.backtrack_lexer){bn=this.test_match(Jn,Pr[Vt]);if(bn!==false){return bn}else if(this._backtrack){ir=false;continue}else{return false}}else if(!this.options.flex){break}}}if(ir){bn=this.test_match(ir,Pr[er]);if(bn!==false){return bn}return false}if(this._input===""){return this.EOF}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}},"next"),lex:B(function bn(){var ir=this.next();if(ir){return ir}else{return this.lex()}},"lex"),begin:B(function bn(ir){this.conditionStack.push(ir)},"begin"),popState:B(function bn(){var ir=this.conditionStack.length-1;if(ir>0){return this.conditionStack.pop()}else{return this.conditionStack[0]}},"popState"),_currentRules:B(function bn(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules}else{return this.conditions["INITIAL"].rules}},"_currentRules"),topState:B(function bn(ir){ir=this.conditionStack.length-1-Math.abs(ir||0);if(ir>=0){return this.conditionStack[ir]}else{return"INITIAL"}},"topState"),pushState:B(function bn(ir){this.begin(ir)},"pushState"),stateStackSize:B(function bn(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:B(function bn(ir,Jn,er,Pr){var Vt=Pr;switch(er){case 0:this.begin("acc_title");return 34;break;case 1:this.popState();return"acc_title_value";break;case 2:this.begin("acc_descr");return 36;break;case 3:this.popState();return"acc_descr_value";break;case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";break;case 7:this.pushState("shapeData");Jn.yytext="";return 40;break;case 8:this.pushState("shapeDataStr");return 40;break;case 9:this.popState();return 40;break;case 10:const di=/\n\s*/g;Jn.yytext=Jn.yytext.replace(di,"
    ");return 40;break;case 11:return 40;break;case 12:this.popState();break;case 13:this.begin("callbackname");break;case 14:this.popState();break;case 15:this.popState();this.begin("callbackargs");break;case 16:return 95;break;case 17:this.popState();break;case 18:return 96;break;case 19:return"MD_STR";break;case 20:this.popState();break;case 21:this.begin("md_string");break;case 22:return"STR";break;case 23:this.popState();break;case 24:this.pushState("string");break;case 25:return 84;break;case 26:return 102;break;case 27:return 85;break;case 28:return 104;break;case 29:return 86;break;case 30:return 87;break;case 31:return 97;break;case 32:this.begin("click");break;case 33:this.popState();break;case 34:return 88;break;case 35:if(ir.lex.firstGraph()){this.begin("dir")}return 12;break;case 36:if(ir.lex.firstGraph()){this.begin("dir")}return 12;break;case 37:if(ir.lex.firstGraph()){this.begin("dir")}return 12;break;case 38:if(ir.lex.firstGraph()){this.begin("dir")}return 12;break;case 39:return 27;break;case 40:return 32;break;case 41:return 98;break;case 42:return 98;break;case 43:return 98;break;case 44:return 98;break;case 45:this.popState();return 13;break;case 46:this.popState();return 14;break;case 47:this.popState();return 14;break;case 48:this.popState();return 14;break;case 49:this.popState();return 14;break;case 50:this.popState();return 14;break;case 51:this.popState();return 14;break;case 52:this.popState();return 14;break;case 53:this.popState();return 14;break;case 54:this.popState();return 14;break;case 55:this.popState();return 14;break;case 56:return 121;break;case 57:return 122;break;case 58:return 123;break;case 59:return 124;break;case 60:return 125;break;case 61:return 78;break;case 62:return 105;break;case 63:return 111;break;case 64:return 46;break;case 65:return 60;break;case 66:return 44;break;case 67:return 8;break;case 68:return 106;break;case 69:return 115;break;case 70:this.popState();return 77;break;case 71:this.pushState("edgeText");return 75;break;case 72:return 119;break;case 73:this.popState();return 77;break;case 74:this.pushState("thickEdgeText");return 75;break;case 75:return 119;break;case 76:this.popState();return 77;break;case 77:this.pushState("dottedEdgeText");return 75;break;case 78:return 119;break;case 79:return 77;break;case 80:this.popState();return 53;break;case 81:return"TEXT";break;case 82:this.pushState("ellipseText");return 52;break;case 83:this.popState();return 55;break;case 84:this.pushState("text");return 54;break;case 85:this.popState();return 57;break;case 86:this.pushState("text");return 56;break;case 87:return 58;break;case 88:this.pushState("text");return 67;break;case 89:this.popState();return 64;break;case 90:this.pushState("text");return 63;break;case 91:this.popState();return 49;break;case 92:this.pushState("text");return 48;break;case 93:this.popState();return 69;break;case 94:this.popState();return 71;break;case 95:return 117;break;case 96:this.pushState("trapText");return 68;break;case 97:this.pushState("trapText");return 70;break;case 98:return 118;break;case 99:return 67;break;case 100:return 90;break;case 101:return"SEP";break;case 102:return 89;break;case 103:return 115;break;case 104:return 111;break;case 105:return 44;break;case 106:return 109;break;case 107:return 114;break;case 108:return 116;break;case 109:this.popState();return 62;break;case 110:this.pushState("text");return 62;break;case 111:this.popState();return 51;break;case 112:this.pushState("text");return 50;break;case 113:this.popState();return 31;break;case 114:this.pushState("text");return 29;break;case 115:this.popState();return 66;break;case 116:this.pushState("text");return 65;break;case 117:return"TEXT";break;case 118:return"QUOTE";break;case 119:return 9;break;case 120:return 10;break;case 121:return 11;break}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:flowchart-elk\b)/,/^(?:swimlane-beta\b)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:.*direction\s+TD[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:[^=]|=(?!))/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:[^\.]|\.(?!))/,/^(?:\s*~~[\~]+\s*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:[^\[\]\(\)\{\}\|\"]+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{"shapeDataEndBracket":{"rules":[21,24,79,82,84,86,90,92,96,97,110,112,114,116],"inclusive":false},"shapeDataStr":{"rules":[9,10,21,24,79,82,84,86,90,92,96,97,110,112,114,116],"inclusive":false},"shapeData":{"rules":[8,11,12,21,24,79,82,84,86,90,92,96,97,110,112,114,116],"inclusive":false},"callbackargs":{"rules":[17,18,21,24,79,82,84,86,90,92,96,97,110,112,114,116],"inclusive":false},"callbackname":{"rules":[14,15,16,21,24,79,82,84,86,90,92,96,97,110,112,114,116],"inclusive":false},"href":{"rules":[21,24,79,82,84,86,90,92,96,97,110,112,114,116],"inclusive":false},"click":{"rules":[21,24,33,34,79,82,84,86,90,92,96,97,110,112,114,116],"inclusive":false},"dottedEdgeText":{"rules":[21,24,76,78,79,82,84,86,90,92,96,97,110,112,114,116],"inclusive":false},"thickEdgeText":{"rules":[21,24,73,75,79,82,84,86,90,92,96,97,110,112,114,116],"inclusive":false},"edgeText":{"rules":[21,24,70,72,79,82,84,86,90,92,96,97,110,112,114,116],"inclusive":false},"trapText":{"rules":[21,24,79,82,84,86,90,92,93,94,95,96,97,110,112,114,116],"inclusive":false},"ellipseText":{"rules":[21,24,79,80,81,82,84,86,90,92,96,97,110,112,114,116],"inclusive":false},"text":{"rules":[21,24,79,82,83,84,85,86,89,90,91,92,96,97,109,110,111,112,113,114,115,116,117],"inclusive":false},"vertex":{"rules":[21,24,79,82,84,86,90,92,96,97,110,112,114,116],"inclusive":false},"dir":{"rules":[21,24,45,46,47,48,49,50,51,52,53,54,55,79,82,84,86,90,92,96,97,110,112,114,116],"inclusive":false},"acc_descr_multiline":{"rules":[5,6,21,24,79,82,84,86,90,92,96,97,110,112,114,116],"inclusive":false},"acc_descr":{"rules":[3,21,24,79,82,84,86,90,92,96,97,110,112,114,116],"inclusive":false},"acc_title":{"rules":[1,21,24,79,82,84,86,90,92,96,97,110,112,114,116],"inclusive":false},"md_string":{"rules":[19,20,21,24,79,82,84,86,90,92,96,97,110,112,114,116],"inclusive":false},"string":{"rules":[21,22,23,24,79,82,84,86,90,92,96,97,110,112,114,116],"inclusive":false},"INITIAL":{"rules":[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,44,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,73,74,76,77,79,82,84,86,87,88,90,92,96,97,98,99,100,101,102,103,104,105,106,107,108,110,112,114,116,118,119,120,121],"inclusive":true}}};return sr}();Tr.lexer=Jr;function jr(){this.yy={}}B(jr,"Parser");jr.prototype=Tr;Tr.Parser=jr;return new jr}();rtt.parser=rtt;H2n=rtt;W2n=Object.assign({},H2n);W2n.parse=e=>{const t=e.replace(/}\s*\n/g,"}\n");return H2n.parse(t)};bIi=W2n;xIi=B((e,t)=>{const n=P5;const r=n(e,"r");const i=n(e,"g");const o=n(e,"b");return mh(r,i,o,t)},"fade");vIi=B(e=>`.label { + font-family: ${e.fontFamily}; + color: ${e.nodeTextColor||e.textColor}; + } + .cluster-label text { + fill: ${e.titleColor}; + } + .cluster-label span { + color: ${e.titleColor}; + } + .cluster-label span p { + background-color: transparent; + } + + .label text,span { + fill: ${e.nodeTextColor||e.textColor}; + color: ${e.nodeTextColor||e.textColor}; + } + + .node rect, + .node circle, + .node ellipse, + .node polygon, + .node path { + fill: ${e.mainBkg}; + stroke: ${e.nodeBorder}; + stroke-width: ${e.strokeWidth??1}px; + } + .rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label { + text-anchor: middle; + } + + .node .katex path { + fill: #000; + stroke: #000; + stroke-width: 1px; + } + + .rough-node .label,.node .label, .image-shape .label, .icon-shape .label { + text-align: center; + } + .node.clickable { + cursor: pointer; + } + + + .root .anchor path { + fill: ${e.lineColor} !important; + stroke-width: 0; + stroke: ${e.lineColor}; + } + + .arrowheadPath { + fill: ${e.arrowheadColor}; + } + + .edgePath .path { + stroke: ${e.lineColor}; + stroke-width: ${e.strokeWidth??2}px; + } + + .flowchart-link { + stroke: ${e.lineColor}; + fill: none; + } + + .edgeLabel { + background-color: ${e.edgeLabelBackground}; + p { + background-color: ${e.edgeLabelBackground}; + } + rect { + opacity: 0.5; + background-color: ${e.edgeLabelBackground}; + fill: ${e.edgeLabelBackground}; + } + text-align: center; + } + + /* For html labels only */ + .labelBkg { + background-color: ${xIi(e.edgeLabelBackground,.5)}; + // background-color: + } + + .cluster rect { + fill: ${e.clusterBkg}; + stroke: ${e.clusterBorder}; + stroke-width: 1px; + } + + .cluster text { + fill: ${e.titleColor}; + } + + .cluster span { + color: ${e.titleColor}; + } + /* .cluster div { + color: ${e.titleColor}; + } */ + + div.mermaidTooltip { + position: absolute; + text-align: center; + max-width: 200px; + padding: 2px; + font-family: ${e.fontFamily}; + font-size: 12px; + background: ${e.tertiaryColor}; + border: 1px solid ${e.border2}; + border-radius: 2px; + pointer-events: none; + z-index: 100; + } + + .flowchartTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${e.textColor}; + } + + rect.text { + fill: none; + stroke-width: 0; + } + + .icon-shape, .image-shape { + background-color: ${e.edgeLabelBackground}; + p { + background-color: ${e.edgeLabelBackground}; + padding: 2px; + } + .label rect { + opacity: 0.5; + background-color: ${e.edgeLabelBackground}; + fill: ${e.edgeLabelBackground}; + } + text-align: center; + } + ${oS()} +`,"getStyles");itt=vIi;Vte=B(({defaultLayout:e,styles:t=itt}={})=>({parser:bIi,get db(){return new pIi},renderer:yIi,styles:t,init:B(n=>{if(!n.flowchart){n.flowchart={}}const r=n2e().layout??e??n.layout;if(r){tee({layout:r})}n.flowchart.arrowMarkerAbsolute=n.arrowMarkerAbsolute;tee({flowchart:{arrowMarkerAbsolute:n.arrowMarkerAbsolute}})},"init")}),"createFlowDiagram");Y2n=Vte()});var jSe={};Oo(jSe,{createFlowDiagram:()=>Vte,diagram:()=>Y2n});var KSe=Ce(()=>{ott();aS();lv();Cx();Y5();Tx();sv();yx();kg();Eg();K0();Sg();Np();Jh();nl();Ta();Aa();Yo()});var q2n={};Oo(q2n,{diagram:()=>wIi});var _Ii,TIi,wIi;var X2n=Ce(()=>{ott();aS();lv();Cx();Y5();Tx();sv();yx();kg();Eg();K0();Sg();Np();Jh();nl();Ta();Aa();Yo();_Ii=B(e=>`${itt(e)} + .swimlane.cluster rect { + stroke: ${e.clusterBorder} !important; + } + [data-look="neo"].cluster rect { + filter: none; + } +`,"getStyles");TIi=_Ii;wIi=Vte({defaultLayout:"swimlane",styles:TIi})});var Z2n={};Oo(Z2n,{diagram:()=>PIi});var att,EIi,CIi,K2n,SIi,j2n,ZSe,AIi,kIi,RIi,PIi;var J2n=Ce(()=>{lv();Cx();Tx();yx();kg();Eg();K0();Sg();Np();Jh();nl();Ta();Aa();Yo();ks();qh();att=function(){var e=B(function(yt,mt,ct,Ge){for(ct=ct||{},Ge=yt.length;Ge--;ct[yt[Ge]]=mt);return ct},"o"),t=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],n=[1,10],r=[1,11],i=[1,12],o=[1,13],a=[1,23],s=[1,24],l=[1,25],u=[1,26],d=[1,27],f=[1,19],h=[1,28],m=[1,29],g=[1,20],x=[1,18],w=[1,21],_=[1,22],C=[1,36],A=[1,37],P=[1,38],L=[1,39],I=[1,40],N=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,66,67,68,69,70],O=[1,45],z=[1,46],U=[1,55],W=[40,48,50,51,52,71,72],H=[1,66],$=[1,64],K=[1,61],X=[1,65],j=[1,67],te=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,66,67,68,69,70],J=[66,67,68,69,70],oe=[1,85],se=[1,84],re=[1,82],ce=[1,83],ue=[6,10,42,47],xe=[6,10,13,41,42,47,48,49],be=[1,93],Ie=[1,92],he=[1,91],ve=[19,58],ge=[1,102],Ve=[1,101],Le=[19,58,61,63];var $e={trace:B(function yt(){},"trace"),yy:{},symbols_:{"error":2,"start":3,"ER_DIAGRAM":4,"document":5,"EOF":6,"line":7,"SPACE":8,"statement":9,"NEWLINE":10,"entityName":11,"relSpec":12,"COLON":13,"role":14,"STYLE_SEPARATOR":15,"idList":16,"BLOCK_START":17,"attributes":18,"BLOCK_STOP":19,"SQS":20,"SQE":21,"title":22,"title_value":23,"acc_title":24,"acc_title_value":25,"acc_descr":26,"acc_descr_value":27,"acc_descr_multiline_value":28,"direction":29,"classDefStatement":30,"classStatement":31,"styleStatement":32,"direction_tb":33,"direction_bt":34,"direction_rl":35,"direction_lr":36,"CLASSDEF":37,"stylesOpt":38,"separator":39,"UNICODE_TEXT":40,"STYLE_TEXT":41,"COMMA":42,"CLASS":43,"STYLE":44,"style":45,"styleComponent":46,"SEMI":47,"NUM":48,"BRKT":49,"ENTITY_NAME":50,"DECIMAL_NUM":51,"ENTITY_ONE":52,"attribute":53,"attributeType":54,"attributeName":55,"attributeKeyTypeList":56,"attributeComment":57,"ATTRIBUTE_WORD":58,"?":59,"attributeKeyType":60,",":61,"ATTRIBUTE_KEY":62,"COMMENT":63,"cardinality":64,"relType":65,"ZERO_OR_ONE":66,"ZERO_OR_MORE":67,"ONE_OR_MORE":68,"ONLY_ONE":69,"MD_PARENT":70,"NON_IDENTIFYING":71,"IDENTIFYING":72,"WORD":73,"$accept":0,"$end":1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",59:"?",61:",",62:"ATTRIBUTE_KEY",63:"COMMENT",66:"ZERO_OR_ONE",67:"ZERO_OR_MORE",68:"ONE_OR_MORE",69:"ONLY_ONE",70:"MD_PARENT",71:"NON_IDENTIFYING",72:"IDENTIFYING",73:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[54,2],[55,1],[56,1],[56,3],[60,1],[57,1],[12,3],[64,1],[64,1],[64,1],[64,1],[64,1],[65,1],[65,1],[14,1],[14,1],[14,1]],performAction:B(function yt(mt,ct,Ge,it,bt,He,Je){var Te=He.length-1;switch(bt){case 1:break;case 2:this.$=[];break;case 3:He[Te-1].push(He[Te]);this.$=He[Te-1];break;case 4:case 5:this.$=He[Te];break;case 6:case 7:this.$=[];break;case 8:it.addEntity(He[Te-4]);it.addEntity(He[Te-2]);it.addRelationship(He[Te-4],He[Te],He[Te-2],He[Te-3]);break;case 9:it.addEntity(He[Te-8]);it.addEntity(He[Te-4]);it.addRelationship(He[Te-8],He[Te],He[Te-4],He[Te-5]);it.setClass([He[Te-8]],He[Te-6]);it.setClass([He[Te-4]],He[Te-2]);break;case 10:it.addEntity(He[Te-6]);it.addEntity(He[Te-2]);it.addRelationship(He[Te-6],He[Te],He[Te-2],He[Te-3]);it.setClass([He[Te-6]],He[Te-4]);break;case 11:it.addEntity(He[Te-6]);it.addEntity(He[Te-4]);it.addRelationship(He[Te-6],He[Te],He[Te-4],He[Te-5]);it.setClass([He[Te-4]],He[Te-2]);break;case 12:it.addEntity(He[Te-3]);it.addAttributes(He[Te-3],He[Te-1]);break;case 13:it.addEntity(He[Te-5]);it.addAttributes(He[Te-5],He[Te-1]);it.setClass([He[Te-5]],He[Te-3]);break;case 14:it.addEntity(He[Te-2]);break;case 15:it.addEntity(He[Te-4]);it.setClass([He[Te-4]],He[Te-2]);break;case 16:it.addEntity(He[Te]);break;case 17:it.addEntity(He[Te-2]);it.setClass([He[Te-2]],He[Te]);break;case 18:it.addEntity(He[Te-6],He[Te-4]);it.addAttributes(He[Te-6],He[Te-1]);break;case 19:it.addEntity(He[Te-8],He[Te-6]);it.addAttributes(He[Te-8],He[Te-1]);it.setClass([He[Te-8]],He[Te-3]);break;case 20:it.addEntity(He[Te-5],He[Te-3]);break;case 21:it.addEntity(He[Te-7],He[Te-5]);it.setClass([He[Te-7]],He[Te-2]);break;case 22:it.addEntity(He[Te-3],He[Te-1]);break;case 23:it.addEntity(He[Te-5],He[Te-3]);it.setClass([He[Te-5]],He[Te]);break;case 24:case 25:this.$=He[Te].trim();it.setAccTitle(this.$);break;case 26:case 27:this.$=He[Te].trim();it.setAccDescription(this.$);break;case 32:it.setDirection("TB");break;case 33:it.setDirection("BT");break;case 34:it.setDirection("RL");break;case 35:it.setDirection("LR");break;case 36:this.$=He[Te-3];it.addClass(He[Te-2],He[Te-1]);break;case 37:case 38:case 59:case 68:this.$=[He[Te]];break;case 39:case 40:this.$=He[Te-2].concat([He[Te]]);break;case 41:this.$=He[Te-2];it.setClass(He[Te-1],He[Te]);break;case 42:;this.$=He[Te-3];it.addCssStyles(He[Te-2],He[Te-1]);break;case 43:this.$=[He[Te]];break;case 44:He[Te-2].push(He[Te]);this.$=He[Te-2];break;case 46:this.$=He[Te-1]+He[Te];break;case 54:case 80:case 81:this.$=He[Te].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 82:this.$=He[Te];break;case 60:He[Te].push(He[Te-1]);this.$=He[Te];break;case 61:this.$={type:He[Te-1],name:He[Te]};break;case 62:this.$={type:He[Te-2],name:He[Te-1],keys:He[Te]};break;case 63:this.$={type:He[Te-2],name:He[Te-1],comment:He[Te]};break;case 64:this.$={type:He[Te-3],name:He[Te-2],keys:He[Te-1],comment:He[Te]};break;case 65:case 67:case 70:this.$=He[Te];break;case 66:this.$=He[Te-1]+He[Te];break;case 69:He[Te-2].push(He[Te]);this.$=He[Te-2];break;case 71:this.$=He[Te].replace(/"/g,"");break;case 72:this.$={cardA:He[Te],relType:He[Te-1],cardB:He[Te-2]};break;case 73:this.$=it.Cardinality.ZERO_OR_ONE;break;case 74:this.$=it.Cardinality.ZERO_OR_MORE;break;case 75:this.$=it.Cardinality.ONE_OR_MORE;break;case 76:this.$=it.Cardinality.ONLY_ONE;break;case 77:this.$=it.Cardinality.MD_PARENT;break;case 78:this.$=it.Identification.NON_IDENTIFYING;break;case 79:this.$=it.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(t,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:n,24:r,26:i,28:o,29:14,30:15,31:16,32:17,33:a,34:s,35:l,36:u,37:d,40:f,43:h,44:m,48:g,50:x,51:w,52:_},e(t,[2,7],{1:[2,1]}),e(t,[2,3]),{9:30,11:9,22:n,24:r,26:i,28:o,29:14,30:15,31:16,32:17,33:a,34:s,35:l,36:u,37:d,40:f,43:h,44:m,48:g,50:x,51:w,52:_},e(t,[2,5]),e(t,[2,6]),e(t,[2,16],{12:31,64:35,15:[1,32],17:[1,33],20:[1,34],66:C,67:A,68:P,69:L,70:I}),{23:[1,41]},{25:[1,42]},{27:[1,43]},e(t,[2,27]),e(t,[2,28]),e(t,[2,29]),e(t,[2,30]),e(t,[2,31]),e(N,[2,54]),e(N,[2,55]),e(N,[2,56]),e(N,[2,57]),e(N,[2,58]),e(t,[2,32]),e(t,[2,33]),e(t,[2,34]),e(t,[2,35]),{16:44,40:O,41:z},{16:47,40:O,41:z},{16:48,40:O,41:z},e(t,[2,4]),{11:49,40:f,48:g,50:x,51:w,52:_},{16:50,40:O,41:z},{18:51,19:[1,52],53:53,54:54,58:U},{11:56,40:f,48:g,50:x,51:w,52:_},{65:57,71:[1,58],72:[1,59]},e(W,[2,73]),e(W,[2,74]),e(W,[2,75]),e(W,[2,76]),e(W,[2,77]),e(t,[2,24]),e(t,[2,25]),e(t,[2,26]),{13:H,38:60,41:$,42:K,45:62,46:63,48:X,49:j},e(te,[2,37]),e(te,[2,38]),{16:68,40:O,41:z,42:K},{13:H,38:69,41:$,42:K,45:62,46:63,48:X,49:j},{13:[1,70],15:[1,71]},e(t,[2,17],{64:35,12:72,17:[1,73],42:K,66:C,67:A,68:P,69:L,70:I}),{19:[1,74]},e(t,[2,14]),{18:75,19:[2,59],53:53,54:54,58:U},{55:76,58:[1,77]},{58:[2,65],59:[1,78]},{21:[1,79]},{64:80,66:C,67:A,68:P,69:L,70:I},e(J,[2,78]),e(J,[2,79]),{6:oe,10:se,39:81,42:re,47:ce},{40:[1,86],41:[1,87]},e(ue,[2,43],{46:88,13:H,41:$,48:X,49:j}),e(xe,[2,45]),e(xe,[2,50]),e(xe,[2,51]),e(xe,[2,52]),e(xe,[2,53]),e(t,[2,41],{42:K}),{6:oe,10:se,39:89,42:re,47:ce},{14:90,40:be,50:Ie,73:he},{16:94,40:O,41:z},{11:95,40:f,48:g,50:x,51:w,52:_},{18:96,19:[1,97],53:53,54:54,58:U},e(t,[2,12]),{19:[2,60]},e(ve,[2,61],{56:98,57:99,60:100,62:ge,63:Ve}),e([19,58,62,63],[2,67]),{58:[2,66]},e(t,[2,22],{15:[1,104],17:[1,103]}),e([40,48,50,51,52],[2,72]),e(t,[2,36]),{13:H,41:$,45:105,46:63,48:X,49:j},e(t,[2,47]),e(t,[2,48]),e(t,[2,49]),e(te,[2,39]),e(te,[2,40]),e(xe,[2,46]),e(t,[2,42]),e(t,[2,8]),e(t,[2,80]),e(t,[2,81]),e(t,[2,82]),{13:[1,106],42:K},{13:[1,108],15:[1,107]},{19:[1,109]},e(t,[2,15]),e(ve,[2,62],{57:110,61:[1,111],63:Ve}),e(ve,[2,63]),e(Le,[2,68]),e(ve,[2,71]),e(Le,[2,70]),{18:112,19:[1,113],53:53,54:54,58:U},{16:114,40:O,41:z},e(ue,[2,44],{46:88,13:H,41:$,48:X,49:j}),{14:115,40:be,50:Ie,73:he},{16:116,40:O,41:z},{14:117,40:be,50:Ie,73:he},e(t,[2,13]),e(ve,[2,64]),{60:118,62:ge},{19:[1,119]},e(t,[2,20]),e(t,[2,23],{17:[1,120],42:K}),e(t,[2,11]),{13:[1,121],42:K},e(t,[2,10]),e(Le,[2,69]),e(t,[2,18]),{18:122,19:[1,123],53:53,54:54,58:U},{14:124,40:be,50:Ie,73:he},{19:[1,125]},e(t,[2,21]),e(t,[2,9]),e(t,[2,19])],defaultActions:{75:[2,60],78:[2,66]},parseError:B(function yt(mt,ct){if(ct.recoverable){this.trace(mt)}else{var Ge=new Error(mt);Ge.hash=ct;throw Ge}},"parseError"),parse:B(function yt(mt){var ct=this,Ge=[0],it=[],bt=[null],He=[],Je=this.table,Te="",we=0,Ze=0,Be=0,qe=2,Qe=1;var ze=He.slice.call(arguments,1);var Me=Object.create(this.lexer);var ye={yy:{}};for(var Ne in this.yy){if(Object.prototype.hasOwnProperty.call(this.yy,Ne)){ye.yy[Ne]=this.yy[Ne]}}Me.setInput(mt,ye.yy);ye.yy.lexer=Me;ye.yy.parser=this;if(typeof Me.yylloc=="undefined"){Me.yylloc={}}var Ae=Me.yylloc;He.push(Ae);var dt=Me.options&&Me.options.ranges;if(typeof ye.yy.parseError==="function"){this.parseError=ye.yy.parseError}else{this.parseError=Object.getPrototypeOf(this).parseError}function Oe(Hr){Ge.length=Ge.length-2*Hr;bt.length=bt.length-Hr;He.length=He.length-Hr}B(Oe,"popStack");function Wt(){var Hr;Hr=it.pop()||Me.lex()||Qe;if(typeof Hr!=="number"){if(Hr instanceof Array){it=Hr;Hr=it.pop()}Hr=ct.symbols_[Hr]||Hr}return Hr}B(Wt,"lex");var kt,qt,_t,sn,Jt,Sn,Kt={},mn,At,lr,on;while(true){_t=Ge[Ge.length-1];if(this.defaultActions[_t]){sn=this.defaultActions[_t]}else{if(kt===null||typeof kt=="undefined"){kt=Wt()}sn=Je[_t]&&Je[_t][kt]}if(typeof sn==="undefined"||!sn.length||!sn[0]){var cr="";on=[];for(mn in Je[_t]){if(this.terminals_[mn]&&mn>qe){on.push("'"+this.terminals_[mn]+"'")}}if(Me.showPosition){cr="Parse error on line "+(we+1)+":\n"+Me.showPosition()+"\nExpecting "+on.join(", ")+", got '"+(this.terminals_[kt]||kt)+"'"}else{cr="Parse error on line "+(we+1)+": Unexpected "+(kt==Qe?"end of input":"'"+(this.terminals_[kt]||kt)+"'")}this.parseError(cr,{text:Me.match,token:this.terminals_[kt]||kt,line:Me.yylineno,loc:Ae,expected:on})}if(sn[0]instanceof Array&&sn.length>1){throw new Error("Parse Error: multiple actions possible at state: "+_t+", token: "+kt)}switch(sn[0]){case 1:Ge.push(kt);bt.push(Me.yytext);He.push(Me.yylloc);Ge.push(sn[1]);kt=null;if(!qt){Ze=Me.yyleng;Te=Me.yytext;we=Me.yylineno;Ae=Me.yylloc;if(Be>0){Be--}}else{kt=qt;qt=null}break;case 2:At=this.productions_[sn[1]][1];Kt.$=bt[bt.length-At];Kt._$={first_line:He[He.length-(At||1)].first_line,last_line:He[He.length-1].last_line,first_column:He[He.length-(At||1)].first_column,last_column:He[He.length-1].last_column};if(dt){Kt._$.range=[He[He.length-(At||1)].range[0],He[He.length-1].range[1]]}Sn=this.performAction.apply(Kt,[Te,Ze,we,ye.yy,sn[1],bt,He].concat(ze));if(typeof Sn!=="undefined"){return Sn}if(At){Ge=Ge.slice(0,-1*At*2);bt=bt.slice(0,-1*At);He=He.slice(0,-1*At)}Ge.push(this.productions_[sn[1]][0]);bt.push(Kt.$);He.push(Kt._$);lr=Je[Ge[Ge.length-2]][Ge[Ge.length-1]];Ge.push(lr);break;case 3:return true}}return true},"parse")};var Ee=function(){var yt={EOF:1,parseError:B(function mt(ct,Ge){if(this.yy.parser){this.yy.parser.parseError(ct,Ge)}else{throw new Error(ct)}},"parseError"),setInput:B(function(mt,ct){this.yy=ct||this.yy||{};this._input=mt;this._more=this._backtrack=this.done=false;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};if(this.options.ranges){this.yylloc.range=[0,0]}this.offset=0;return this},"setInput"),input:B(function(){var mt=this._input[0];this.yytext+=mt;this.yyleng++;this.offset++;this.match+=mt;this.matched+=mt;var ct=mt.match(/(?:\r\n?|\n).*/g);if(ct){this.yylineno++;this.yylloc.last_line++}else{this.yylloc.last_column++}if(this.options.ranges){this.yylloc.range[1]++}this._input=this._input.slice(1);return mt},"input"),unput:B(function(mt){var ct=mt.length;var Ge=mt.split(/(?:\r\n?|\n)/g);this._input=mt+this._input;this.yytext=this.yytext.substr(0,this.yytext.length-ct);this.offset-=ct;var it=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1);this.matched=this.matched.substr(0,this.matched.length-1);if(Ge.length-1){this.yylineno-=Ge.length-1}var bt=this.yylloc.range;this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Ge?(Ge.length===it.length?this.yylloc.first_column:0)+it[it.length-Ge.length].length-Ge[0].length:this.yylloc.first_column-ct};if(this.options.ranges){this.yylloc.range=[bt[0],bt[0]+this.yyleng-ct]}this.yyleng=this.yytext.length;return this},"unput"),more:B(function(){this._more=true;return this},"more"),reject:B(function(){if(this.options.backtrack_lexer){this._backtrack=true}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}return this},"reject"),less:B(function(mt){this.unput(this.match.slice(mt))},"less"),pastInput:B(function(){var mt=this.matched.substr(0,this.matched.length-this.match.length);return(mt.length>20?"...":"")+mt.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:B(function(){var mt=this.match;if(mt.length<20){mt+=this._input.substr(0,20-mt.length)}return(mt.substr(0,20)+(mt.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:B(function(){var mt=this.pastInput();var ct=new Array(mt.length+1).join("-");return mt+this.upcomingInput()+"\n"+ct+"^"},"showPosition"),test_match:B(function(mt,ct){var Ge,it,bt;if(this.options.backtrack_lexer){bt={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done};if(this.options.ranges){bt.yylloc.range=this.yylloc.range.slice(0)}}it=mt[0].match(/(?:\r\n?|\n).*/g);if(it){this.yylineno+=it.length}this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:it?it[it.length-1].length-it[it.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+mt[0].length};this.yytext+=mt[0];this.match+=mt[0];this.matches=mt;this.yyleng=this.yytext.length;if(this.options.ranges){this.yylloc.range=[this.offset,this.offset+=this.yyleng]}this._more=false;this._backtrack=false;this._input=this._input.slice(mt[0].length);this.matched+=mt[0];Ge=this.performAction.call(this,this.yy,this,ct,this.conditionStack[this.conditionStack.length-1]);if(this.done&&this._input){this.done=false}if(Ge){return Ge}else if(this._backtrack){for(var He in bt){this[He]=bt[He]}return false}return false},"test_match"),next:B(function(){if(this.done){return this.EOF}if(!this._input){this.done=true}var mt,ct,Ge,it;if(!this._more){this.yytext="";this.match=""}var bt=this._currentRules();for(var He=0;Hect[0].length)){ct=Ge;it=He;if(this.options.backtrack_lexer){mt=this.test_match(Ge,bt[He]);if(mt!==false){return mt}else if(this._backtrack){ct=false;continue}else{return false}}else if(!this.options.flex){break}}}if(ct){mt=this.test_match(ct,bt[it]);if(mt!==false){return mt}return false}if(this._input===""){return this.EOF}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}},"next"),lex:B(function mt(){var ct=this.next();if(ct){return ct}else{return this.lex()}},"lex"),begin:B(function mt(ct){this.conditionStack.push(ct)},"begin"),popState:B(function mt(){var ct=this.conditionStack.length-1;if(ct>0){return this.conditionStack.pop()}else{return this.conditionStack[0]}},"popState"),_currentRules:B(function mt(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules}else{return this.conditions["INITIAL"].rules}},"_currentRules"),topState:B(function mt(ct){ct=this.conditionStack.length-1-Math.abs(ct||0);if(ct>=0){return this.conditionStack[ct]}else{return"INITIAL"}},"topState"),pushState:B(function mt(ct){this.begin(ct)},"pushState"),stateStackSize:B(function mt(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":true},performAction:B(function mt(ct,Ge,it,bt){var He=bt;switch(it){case 0:this.begin("acc_title");return 24;break;case 1:this.popState();return"acc_title_value";break;case 2:this.begin("acc_descr");return 26;break;case 3:this.popState();return"acc_descr_value";break;case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";break;case 7:return 33;break;case 8:return 34;break;case 9:return 35;break;case 10:return 36;break;case 11:return 10;break;case 12:break;case 13:return 8;break;case 14:return 50;break;case 15:return 73;break;case 16:return 4;break;case 17:this.begin("block");return 17;break;case 18:return 49;break;case 19:return 49;break;case 20:return 42;break;case 21:return 15;break;case 22:return 13;break;case 23:break;case 24:return 62;break;case 25:return 58;break;case 26:return 58;break;case 27:this.begin("block_bq");break;case 28:return 58;break;case 29:this.popState();break;case 30:return 63;break;case 31:break;case 32:this.popState();return 19;break;case 33:return Ge.yytext[0];break;case 34:return 20;break;case 35:return 21;break;case 36:this.begin("style");return 44;break;case 37:this.popState();return 10;break;case 38:break;case 39:return 13;break;case 40:return 42;break;case 41:return 49;break;case 42:this.begin("style");return 37;break;case 43:return 43;break;case 44:return 66;break;case 45:return 68;break;case 46:return 68;break;case 47:return 68;break;case 48:return 66;break;case 49:return 66;break;case 50:return 67;break;case 51:return 67;break;case 52:return 67;break;case 53:return 67;break;case 54:return 67;break;case 55:return 68;break;case 56:return 67;break;case 57:return 68;break;case 58:return 69;break;case 59:return 69;break;case 60:return 51;break;case 61:return 69;break;case 62:return 69;break;case 63:return 69;break;case 64:return 52;break;case 65:return 48;break;case 66:return 69;break;case 67:return 66;break;case 68:return 67;break;case 69:return 68;break;case 70:return 70;break;case 71:return 71;break;case 72:return 72;break;case 73:return 72;break;case 74:return 71;break;case 75:return 71;break;case 76:return 71;break;case 77:return 41;break;case 78:return 47;break;case 79:return 40;break;case 80:return Ge.yytext[0];break;case 81:return 6;break}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\.,\u00C0-\uFFFF\*]*))/i,/^(?:[`])/i,/^(?:[^`]+)/i,/^(?:[`])/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{"style":{"rules":[37,38,39,40,41,77,78],"inclusive":false},"acc_descr_multiline":{"rules":[5,6],"inclusive":false},"acc_descr":{"rules":[3],"inclusive":false},"acc_title":{"rules":[1],"inclusive":false},"block_bq":{"rules":[28,29],"inclusive":false},"block":{"rules":[23,24,25,26,27,30,31,32,33],"inclusive":false},"INITIAL":{"rules":[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,34,35,36,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,79,80,81],"inclusive":true}}};return yt}();$e.lexer=Ee;function tt(){this.yy={}}B(tt,"Parser");tt.prototype=$e;$e.Parser=tt;return new tt}();att.parser=att;EIi=att;CIi=class{constructor(){this.entities=new Map;this.relationships=[];this.classes=new Map;this.direction="TB";this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"};this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"};this.setAccTitle=Ka;this.getAccTitle=is;this.setAccDescription=os;this.getAccDescription=as;this.setDiagramTitle=ys;this.getDiagramTitle=ss;this.getConfig=B(()=>Mn().er,"getConfig");this.clear();this.addEntity=this.addEntity.bind(this);this.addAttributes=this.addAttributes.bind(this);this.addRelationship=this.addRelationship.bind(this);this.setDirection=this.setDirection.bind(this);this.addCssStyles=this.addCssStyles.bind(this);this.addClass=this.addClass.bind(this);this.setClass=this.setClass.bind(this);this.setAccTitle=this.setAccTitle.bind(this);this.setAccDescription=this.setAccDescription.bind(this)}static{B(this,"ErDB")}addEntity(e,t=""){if(!this.entities.has(e)){this.entities.set(e,{id:`entity-${e}-${this.entities.size}`,label:e,attributes:[],alias:t,shape:"erBox",look:Mn().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"});wt.info("Added new entity :",e)}else if(!this.entities.get(e)?.alias&&t){this.entities.get(e).alias=t;wt.info(`Add alias '${t}' to entity '${e}'`)}return this.entities.get(e)}getEntity(e){return this.entities.get(e)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(e,t){const n=this.addEntity(e);let r;for(r=t.length-1;r>=0;r--){if(!t[r].keys){t[r].keys=[]}if(!t[r].comment){t[r].comment=""}n.attributes.push(t[r]);wt.debug("Added attribute ",t[r].name)}}addRelationship(e,t,n,r){const i=this.entities.get(e);const o=this.entities.get(n);if(!i||!o){return}const a={entityA:i.id,roleA:t,entityB:o.id,relSpec:r};this.relationships.push(a);wt.debug("Added new relationship :",a)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(e){this.direction=e}getCompiledStyles(e){let t=[];for(const n of e){const r=this.classes.get(n);if(r?.styles){t=[...t,...r.styles??[]].map(i=>i.trim())}if(r?.textStyles){t=[...t,...r.textStyles??[]].map(i=>i.trim())}}return t}addCssStyles(e,t){for(const n of e){const r=this.entities.get(n);if(!t||!r){return}for(const i of t){r.cssStyles.push(i)}}}addClass(e,t){e.forEach(n=>{let r=this.classes.get(n);if(r===void 0){r={id:n,styles:[],textStyles:[]};this.classes.set(n,r)}if(t){t.forEach(function(i){if(/color/.exec(i)){const o=i.replace("fill","bgFill");r.textStyles.push(o)}r.styles.push(i)})}})}setClass(e,t){for(const n of e){const r=this.entities.get(n);if(r){for(const i of t){r.cssClasses+=" "+i}}}}clear(){this.entities=new Map;this.classes=new Map;this.relationships=[];Da()}getData(){const e=[];const t=[];const n=Mn();let r=0;for(const o of this.entities.keys()){const a=this.entities.get(o);if(a){a.cssCompiledStyles=this.getCompiledStyles(a.cssClasses.split(" "));a.colorIndex=r++;e.push(a)}}let i=0;for(const o of this.relationships){const a={id:VC(o.entityA,o.entityB,{prefix:"id",counter:i++}),type:"normal",curve:"basis",start:o.entityA,end:o.entityB,label:o.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:o.relSpec.cardB.toLowerCase(),arrowTypeEnd:o.relSpec.cardA.toLowerCase(),pattern:o.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:n.look,labelType:"markdown"};t.push(a)}return{nodes:e,edges:t,other:{},config:n,direction:"TB"}}};K2n={};ZM(K2n,{draw:()=>SIi});SIi=B(async function(e,t,n,r){wt.info("REF0:");wt.info("Drawing er diagram (unified)",t);const{securityLevel:i,er:o,layout:a}=Mn();const s=r.db.getData();const l=G_(t,i);s.type=r.type;s.layoutAlgorithm=nS(a);s.config.flowchart.nodeSpacing=o?.nodeSpacing||140;s.config.flowchart.rankSpacing=o?.rankSpacing||80;s.direction=r.db.getDirection();const{config:u}=s;const{look:d}=u;if(d==="neo"){s.markers=["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"]}else{s.markers=["only_one","zero_or_one","one_or_more","zero_or_more"]}s.diagramId=t;await B_(s,l);if(s.layoutAlgorithm==="elk"){l.select(".edges").lower()}const f=l.selectAll('[id*="-background"]');if(Array.from(f).length>0){f.each(function(){const m=zr(this);const g=m.attr("id");const x=g.replace("-background","");const w=l.select(`#${CSS.escape(x)}`);if(!w.empty()){const _=w.attr("transform");m.attr("transform",_)}})}const h=8;Ko.insertTitle(l,"erDiagramTitleText",o?.titleTopMargin??25,r.db.getDiagramTitle());Ex(l,h,"erDiagram",o?.useMaxWidth??true)},"draw");j2n=B((e,t)=>{const n=P5;const r=n(e,"r");const i=n(e,"g");const o=n(e,"b");return mh(r,i,o,t)},"fade");ZSe=new Set(["redux-color","redux-dark-color"]);AIi=B(e=>{const{theme:t,look:n,bkgColorArray:r,borderColorArray:i}=e;if(!ZSe.has(t)){return""}const o=r?.length>0;let a="";for(let s=0;s{const{look:t,theme:n,erEdgeLabelBackground:r,strokeWidth:i}=e;return` + ${AIi(e)} + .entityBox { + fill: ${e.mainBkg}; + stroke: ${e.nodeBorder}; + } + + .relationshipLabelBox { + fill: ${e.tertiaryColor}; + opacity: 0.7; + background-color: ${e.tertiaryColor}; + rect { + opacity: 0.5; + } + } + + .labelBkg { + background-color: ${ZSe.has(n)&&r?r:j2n(e.tertiaryColor,.5)}; + } + + .edgeLabel { + background-color: ${ZSe.has(n)&&r?r:e.edgeLabelBackground}; + } + .edgeLabel .label rect { + fill: ${ZSe.has(n)&&r?r:e.edgeLabelBackground}; + } + .edgeLabel .label text { + fill: ${e.textColor}; + } + + .edgeLabel .label { + fill: ${e.nodeBorder}; + font-size: 14px; + } + + .label { + font-family: ${e.fontFamily}; + color: ${e.nodeTextColor||e.textColor}; + } + + .edge-pattern-dashed { + stroke-dasharray: 8,8; + } + + .node rect, + .node circle, + .node ellipse, + .node polygon + { + fill: ${e.mainBkg}; + stroke: ${e.nodeBorder}; + stroke-width: ${t==="neo"?i:"1px"}; + } + + .relationshipLine { + stroke: ${e.lineColor}; + stroke-width: ${t==="neo"?i:"1px"}; + fill: none; + } + + .marker { + fill: none !important; + stroke: ${e.lineColor} !important; + stroke-width: 1; + } + [data-look=neo].labelBkg { + background-color: ${j2n(e.tertiaryColor,.5)}; + } +`},"getStyles");RIi=kIi;PIi={parser:EIi,get db(){return new CIi},renderer:K2n,styles:RIi}});var yG;var JSe=Ce(()=>{Yo();yG=class{constructor(e){this.init=e;this.records=this.init()}static{B(this,"ImperativeState")}reset(){this.records=this.init()}}});function mu(e,t){if(e.accDescr){t.setAccDescription?.(e.accDescr)}if(e.accTitle){t.setAccTitle?.(e.accTitle)}if(e.title){t.setDiagramTitle?.(e.title)}}var rb=Ce(()=>{Yo();B(mu,"populateCommonDb")});function ip(e){return typeof e==="object"&&e!==null&&typeof e.$type==="string"}function ob(e){return typeof e==="object"&&e!==null&&typeof e.$refText==="string"&&"ref"in e}function gS(e){return typeof e==="object"&&e!==null&&typeof e.$refText==="string"&&"items"in e}function fit(e){return typeof e==="object"&&e!==null&&typeof e.name==="string"&&typeof e.type==="string"&&typeof e.path==="string"}function zB(e){return typeof e==="object"&&e!==null&&typeof e.info==="object"&&typeof e.message==="string"}function qR(e){return typeof e==="object"&&e!==null&&Array.isArray(e.content)}function y6(e){return typeof e==="object"&&e!==null&&typeof e.tokenType==="object"}function Bke(e){return qR(e)&&typeof e.fullText==="string"}function QCn(e){if(typeof e==="string"){return e}if(typeof e==="undefined"){return"undefined"}if(typeof e.toString==="function"){return e.toString()}return Object.prototype.toString.call(e)}function Ane(e){return!!e&&typeof e[Symbol.iterator]==="function"}function gu(...e){if(e.length===1){const t=e[0];if(t instanceof pS){return t}if(Ane(t)){return new pS(()=>t[Symbol.iterator](),n=>n.next())}if(typeof t.length==="number"){return new pS(()=>({index:0}),n=>{if(n.index1){return new pS(()=>({collIndex:0,arrIndex:0}),t=>{do{if(t.iterator){const n=t.iterator.next();if(!n.done){return n}t.iterator=void 0}if(t.array){if(t.arrIndex{if(ip(i)){i.$container=e;i.$containerProperty=n;i.$containerIndex=o;if(t.deep){WG(i,t)}}})}else if(ip(r)){r.$container=e;r.$containerProperty=n;if(t.deep){WG(r,t)}}}}}function b6(e,t){let n=e;while(n){if(t(n)){return n}n=n.$container}return void 0}function eSn(e,t){let n=e;while(n){if(t(n)){return true}n=n.$container}return false}function Vw(e){const t=zG(e);const n=t.$document;if(!n){throw new Error("AST node has no document.")}return n}function zG(e){while(e.$container){e=e.$container}return e}function qAe(e){if(ob(e)){return e.ref?[e.ref]:[]}else if(gS(e)){return e.items.map(t=>t.ref)}return[]}function qne(e,t){if(!e){throw new Error("Node must be an AstNode.")}const n=t?.range;return new pS(()=>({keys:Object.keys(e),keyIndex:0,arrayIndex:0}),r=>{while(r.keyIndexqne(n,t))}function $w(e,t){if(!e){throw new Error("Root node must be an AstNode.")}else if(t?.range&&!XAe(e,t.range)){return new HG(e,()=>[])}return new HG(e,n=>qne(n,t),{includeRoot:true})}function XAe(e,t){if(!t){return true}const n=e.$cstNode?.range;if(!n){return false}return Bit(n,t)}function YG(e){return new pS(()=>({keys:Object.keys(e),keyIndex:0,arrayIndex:0}),t=>{while(t.keyIndex{if(qR(t)){return t.content}else{return[]}},{includeRoot:true})}function xSn(e){return XG(e).filter(y6)}function Nit(e,t){while(e.container){e=e.container;if(e===t){return true}}return false}function Rne(e){return{start:{character:e.startColumn-1,line:e.startLine-1},end:{character:e.endColumn,line:e.endLine-1}}}function jG(e){if(!e){return void 0}const{offset:t,end:n,range:r}=e;return{range:r,offset:t,end:n,length:n-t}}function Oit(e,t){if(e.end.linet.end.line||e.start.line===t.end.line&&e.start.character>=t.end.character){return hS.After}const n=e.start.line>t.start.line||e.start.line===t.start.line&&e.start.character>=t.start.character;const r=e.end.linehS.After}function vSn(e,t,n=zit){if(e){if(t>0){const r=t-e.offset;const i=e.text.charAt(r);if(!n.test(i)){t--}}return Wke(e,t)}return void 0}function Uit(e,t){if(e){const n=Git(e,true);if(n&&cke(n,t)){return n}if(Bke(e)){const r=e.content.findIndex(i=>!i.hidden);for(let i=r-1;i>=0;i--){const o=e.content[i];if(cke(o,t)){return o}}}}return void 0}function cke(e,t){return y6(e)&&t.includes(e.tokenType.name)}function Wke(e,t){if(y6(e)){return e}else if(qR(e)){const n=$it(e,t,false);if(n){return Wke(n,t)}}return void 0}function Vit(e,t){if(y6(e)){return e}else if(qR(e)){const n=$it(e,t,true);if(n){return Vit(n,t)}}return void 0}function $it(e,t,n){let r=0;let i=e.content.length-1;let o=void 0;while(r<=i){const a=Math.floor((r+i)/2);const s=e.content[a];if(s.offset<=t&&s.end>t){return s}if(s.end<=t){o=n?s:void 0;r=a+1}else{i=a-1}}return o}function Git(e,t=true){while(e.container){const n=e.container;let r=n.content.indexOf(e);while(r>0){r--;const i=n.content[r];if(t||!i.hidden){return i}}e=n}return void 0}function _Sn(e,t=true){while(e.container){const n=e.container;let r=n.content.indexOf(e);const i=n.content.length-1;while(rt.test(n))}function nH(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Xit(e,t){const n=jit(e);const r=t.match(n);return!!r&&r[0].length>0}function jit(e){if(typeof e==="string"){e=new RegExp(e)}const t=e,n=e.source;let r=0;function i(){let o="",a;function s(u){o+=n.substr(r,u);r+=u}ee(s,"appendRaw");function l(u){o+="(?:"+n.substr(r,u)+"|$)";r+=u}ee(l,"appendOptional");while(r",r)-r+1);break;default:l(2);break}break;case"[":a=/\[(?:\\.|.)*?\]/g;a.lastIndex=r;a=a.exec(n)||[];l(a[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":s(1);break;case"{":a=/\{\d+,?\d*\}/g;a.lastIndex=r;a=a.exec(n);if(a){s(a[0].length)}else{l(1)}break;case"(":if(n[r+1]==="?"){switch(n[r+2]){case":":o+="(?:";r+=3;o+=i()+"|$)";break;case"=":o+="(?=";r+=3;o+=i()+")";break;case"!":a=r;r+=3;i();o+=n.substr(a,r-a);break;case"<":switch(n[r+3]){case"=":case"!":a=r;r+=4;i();o+=n.substr(a,r-a);break;default:s(n.indexOf(">",r)-r+1);o+=i()+"|$)";break}break}}else{s(1);o+=i()+"|$)"}break;case")":++r;return o;default:l(1);break}}return o}ee(i,"process");return new RegExp(i(),e.flags)}function Kit(e){return e.rules.find(t=>lb(t)&&t.entry)}function Zit(e){return e.rules.filter(t=>X_(t)&&t.hidden)}function jke(e,t){const n=new Set;const r=Kit(e);if(!r){return new Set(e.rules)}const i=[r].concat(Zit(e));for(const a of i){Jit(a,n,t)}const o=new Set;for(const a of e.rules){if(n.has(a.name)||X_(a)&&a.hidden){o.add(a)}}return o}function Jit(e,t,n){t.add(e.name);rP(e).forEach(r=>{if(KR(r)||n&&$ke(r)){const i=r.rule.ref;if(i&&!t.has(i.name)){Jit(i,t,n)}}})}function PSn(e){const t=new Set;rP(e).forEach(n=>{if(v6(n)){if(lb(n.type.ref)){t.add(n.type.ref)}if(Xne(n.type.ref)&&lb(n.type.ref.$container)){t.add(n.type.ref.$container)}}});return t}function Qit(e){if(e.terminal){return e.terminal}else if(e.type.ref){const t=Qke(e.type.ref);return t?.terminal}return void 0}function eot(e){return e.hidden&&!Xke(Zne(e))}function tot(e,t){if(!e||!t){return[]}return Zke(e,t,e.astNode,true)}function Kke(e,t,n){if(!e||!t){return void 0}const r=Zke(e,t,e.astNode,true);if(r.length===0){return void 0}if(n!==void 0){n=Math.max(0,Math.min(n,r.length-1))}else{n=0}return r[n]}function Zke(e,t,n,r){if(!r){const i=b6(e.grammarSource,XR);if(i&&i.feature===t){return[e]}}if(qR(e)&&e.astNode===n){return e.content.flatMap(i=>Zke(i,t,n,false))}return[]}function ISn(e,t){if(!e){return[]}return Jke(e,t,e?.astNode)}function not(e,t,n){if(!e){return void 0}const r=Jke(e,t,e?.astNode);if(r.length===0){return void 0}if(n!==void 0){n=Math.max(0,Math.min(n,r.length-1))}else{n=0}return r[n]}function Jke(e,t,n){if(e.astNode!==n){return[]}if(jR(e.grammarSource)&&e.grammarSource.value===t){return[e]}const r=XG(e).iterator();let i;const o=[];do{i=r.next();if(!i.done){const a=i.value;if(a.astNode===n){if(jR(a.grammarSource)&&a.grammarSource.value===t){o.push(a)}}else{r.prune()}}}while(!i.done);return o}function rot(e){const t=e.astNode;while(t===e.container?.astNode){const n=b6(e.grammarSource,XR);if(n){return n}e=e.container}return void 0}function Qke(e){let t=e;if(Xne(t)){if(uD(t.$container)){t=t.$container.$container}else if(x6(t.$container)){t=t.$container}else{gD(t.$container)}}return iot(e,t,new Map)}function iot(e,t,n){function r(i,o){let a=void 0;const s=b6(i,XR);if(!s){a=iot(o,o,n)}n.set(e,a);return a}ee(r,"go");if(n.has(e)){return n.get(e)}n.set(e,void 0);for(const i of rP(t)){if(XR(i)&&i.feature.toLowerCase()==="name"){n.set(e,i);return i}else if(KR(i)&&lb(i.rule.ref)){return r(i,i.rule.ref)}else if(Vke(i)&&i.typeRef?.ref){return r(i,i.typeRef.ref)}}return void 0}function oot(e){const t=e.$container;if(_6(t)){const n=t.elements;const r=n.indexOf(e);for(let i=r-1;i>=0;i--){const o=n[i];if(uD(o)){return o}else{const a=rP(n[i]).find(uD);if(a){return a}}}}if(zke(t)){return oot(t)}else{return void 0}}function MSn(e,t){return e==="?"||e==="*"||_6(t)&&Boolean(t.guardCondition)}function LSn(e){return e==="*"||e==="+"}function DSn(e){return e==="+="}function jne(e){return aot(e,new Set)}function aot(e,t){if(t.has(e)){return true}else{t.add(e)}for(const n of rP(e)){if(KR(n)){if(!n.rule.ref){return false}if(lb(n.rule.ref)&&!aot(n.rule.ref,t)){return false}if(qG(n.rule.ref)){return false}}else if(XR(n)){return false}else if(uD(n)){return false}}return Boolean(e.definition)}function FSn(e){return fke(e.type,new Set)}function fke(e,t){if(t.has(e)){return true}else{t.add(e)}if(yit(e)){return false}else if(Ait(e)){return false}else if(Mit(e)){return e.types.every(n=>fke(n,t))}else if(Vke(e)){if(e.primitiveType!==void 0){return true}else if(e.stringType!==void 0){return true}else if(e.typeRef!==void 0){const n=e.typeRef.ref;if(Gke(n)){return fke(n.type,t)}else{return false}}else{return false}}else{return false}}function Kne(e){if(X_(e)){return void 0}if(e.inferredType){return e.inferredType.name}else if(e.dataType){return e.dataType}else if(e.returnType){const t=e.returnType.ref;if(t){return t.name}}return void 0}function f6(e){if(x6(e)){return lb(e)&&jne(e)?e.name:Kne(e)??e.name}else if(wit(e)||Gke(e)||Rit(e)){return e.name}else if(uD(e)){const t=sot(e);if(t){return t}}else if(Xne(e)){return e.name}throw new Error("Cannot get name of Unknown Type")}function sot(e){if(e.inferredType){return e.inferredType.name}else if(e.type?.ref){return f6(e.type.ref)}return void 0}function NSn(e){if(X_(e)){return e.type?.name??"string"}else{return lb(e)&&jne(e)?e.name:Kne(e)??e.name}}function lot(e){if(X_(e)){return e.type?.name??"string"}else{return Kne(e)??e.name}}function Zne(e){const t={s:false,i:false,u:false};const n=T6(e.definition,t);const r=Object.entries(t).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(n,r)}function T6(e,t){if(Pit(e)){return OSn(e)}else if(Iit(e)){return BSn(e)}else if(xit(e)){return VSn(e)}else if($ke(e)){const n=e.rule.ref;if(!n){throw new Error("Missing rule reference.")}return yS(T6(n.definition),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized})}else if(Eit(e)){return USn(e)}else if(Lit(e)){return zSn(e)}else if(kit(e)){const n=e.regex.lastIndexOf("/");const r=e.regex.substring(1,n);const i=e.regex.substring(n+1);if(t){t.i=i.includes("i");t.s=i.includes("s");t.u=i.includes("u")}return yS(r,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:false})}else if(Dit(e)){return yS(cot,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized})}else{throw new Error(`Invalid terminal element: ${e?.$type}, ${e?.$cstNode?.text}`)}}function OSn(e){return yS(e.elements.map(t=>T6(t)).join("|"),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:false})}function BSn(e){return yS(e.elements.map(t=>T6(t)).join(""),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:false})}function zSn(e){return yS(`${cot}*?${T6(e.terminal)}`,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized})}function USn(e){return yS(`(?!${T6(e.terminal)})${cot}*?`,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized})}function VSn(e){if(e.right){return yS(`[${SAe(e.left)}-${SAe(e.right)}]`,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:false})}return yS(SAe(e.left),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:false})}function SAe(e){return nH(e.value)}function yS(e,t){if(t.parenthesized||t.lookahead||t.wrap!==false){const n=t.lookahead??(t.parenthesized?"":"?:");e=`(${n}${e})`}if(t.cardinality){return`${e}${t.cardinality}`}return e}function uot(e){const t=[];const n=e.Grammar;for(const r of n.rules){if(X_(r)&&eot(r)&&qit(Zne(r))){t.push(r.name)}}return{multilineCommentRules:t,nameRegexp:zit}}function HSn(e){var t=T3i.call(e,Gte),n=e[Gte];try{e[Gte]=void 0;var r=true}catch(o){}var i=w3i.call(e);if(r){if(t){e[Gte]=n}else{delete e[Gte]}}return i}function WSn(e){return S3i.call(e)}function YSn(e){if(e==null){return e===void 0?R3i:k3i}return nEn&&nEn in Object(e)?E3i(e):A3i(e)}function qSn(e){return e!=null&&typeof e=="object"}function XSn(e){return typeof e=="symbol"||Ww(e)&&yD(e)==P3i}function jSn(e,t){var n=-1,r=e==null?0:e.length,i=Array(r);while(++n0){if(++t>=hMi){return arguments[0]}}else{t=0}return e.apply(void 0,arguments)}}function hAn(e){return function(){return e}}function pAn(e,t){var n=-1,r=e==null?0:e.length;while(++n-1}function wAn(e,t){var n=typeof e;t=t==null?CMi:t;return!!t&&(n=="number"||n!="symbol"&&SMi.test(e))&&(e>-1&&e%1==0&&e-1&&e%1==0&&e<=PMi}function IAn(e){return e!=null&&mot(e.length)&&!iP(e)}function MAn(e,t,n){if(!q_(n)){return false}var r=typeof t;if(r=="number"?vS(n)&&tRe(t,n.length):r=="string"&&t in n){return tre(n[t],e)}return false}function LAn(e){return pot(function(t,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;o=e.length>3&&typeof o=="function"?(i--,o):void 0;if(a&&rRe(n[0],n[1],a)){o=i<3?void 0:o;i=1}t=Object(t);while(++r-1}function ukn(e,t){var n=this.__data__,r=aRe(n,e);if(r<0){++this.size;n.push([e,t])}else{n[r][1]=t}return this}function S6(e){var t=-1,n=e==null?0:e.length;this.clear();while(++t0&&n(s)){if(t>1){vot(s,t-1,n,r,i)}else{xot(i,s)}}else if(!r){i[i.length]=s}}return i}function Skn(e){var t=e==null?0:e.length;return t?_ot(e,1):[]}function kkn(e,t,n){var r=-1,i=e.length;if(t<0){t=-t>i?0:i+t}n=n>i?i:n;if(n<0){n+=i}i=t>n?0:n-t>>>0;t>>>=0;var o=Array(i);while(++rs)){return false}var u=o.get(e);var d=o.get(t);if(u&&d){return u==t&&d==e}var f=-1,h=true,m=n&o4i?new Cot:void 0;o.set(e,t);o.set(t,e);while(++f=J4i){o=Sot;a=false;t=new Cot(t)}e:while(++i-1?i[o?t[a]:a]:void 0}}function uPn(e,t,n){var r=e==null?0:e.length;if(!r){return-1}var i=n==null?0:Qne(n);if(i<0){i=oNi(r+i,0)}return yAn(e,_S(t,3),i)}function dPn(e){return e&&e.length?e[0]:void 0}function fPn(e,t){var n=-1,r=vS(e)?Array(e.length):[];R6(e,function(i,o,a){r[++n]=t(i,o,a)});return r}function hPn(e,t){var n=gc(e)?Jne:lNi;return n(e,_S(t,3))}function pPn(e,t){return _ot(fa(e,t),1)}function mPn(e,t){return e!=null&&pNi.call(e,t)}function gPn(e,t){return e!=null&&DRn(e,t,mNi)}function yPn(e){return typeof e=="string"||!gc(e)&&Ww(e)&&yD(e)==gNi}function bPn(e,t){return Jne(t,function(n){return e[n]})}function xPn(e){return e==null?[]:yNi(e,dv(e))}function vPn(e,t,n,r){e=vS(e)?e:Vp(e);n=n&&!r?Qne(n):0;var i=e.length;if(n<0){n=bNi(i+n,0)}return kx(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&fot(e,t,n)>-1}function _Pn(e,t,n){var r=e==null?0:e.length;if(!r){return-1}var i=n==null?0:Qne(n);if(i<0){i=xNi(r+i,0)}return fot(e,t,i)}function TPn(e){if(e==null){return true}if(vS(e)&&(gc(e)||typeof e=="string"||typeof e.splice=="function"||Pne(e)||got(e)||iRe(e))){return!e.length}var t=KG(e);if(t==vNi||t==_Ni){return!e.size}if(rre(e)){return!XAn(e).length}for(var n in e){if(wNi.call(e,n)){return false}}return true}function wPn(e){return Ww(e)&&yD(e)==ENi}function EPn(e){return e===void 0}function CPn(e){if(typeof e!="function"){throw new TypeError(ANi)}return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function SPn(e,t,n,r){if(!q_(e)){return e}t=dRe(t,e);var i=-1,o=t.length,a=o-1,s=e;while(s!=null&&++i=NNi){var u=t?null:FNi(e);if(u){return Aot(u)}a=false;i=Sot;l=new Cot}else{l=t?[]:s}e:while(++r{return Fne(r,t)})}else if(e instanceof cb&&fb(t,e)){return false}else if(e instanceof TS){if(e instanceof cb){t.push(e)}return Hw(e.definition,r=>{return Fne(r,t)})}else{return false}}function VPn(e){return e instanceof Ix}function zw(e){if(e instanceof cb){return"SUBRULE"}else if(e instanceof Fg){return"OPTION"}else if(e instanceof Ix){return"OR"}else if(e instanceof pv){return"AT_LEAST_ONE"}else if(e instanceof mv){return"AT_LEAST_ONE_SEP"}else if(e instanceof Px){return"MANY_SEP"}else if(e instanceof Zf){return"MANY"}else if(e instanceof Ud){return"CONSUME"}else{throw Error("non exhaustive match")}}function Nnt(e,t,n){const r=[new Fg({definition:[new Ud({terminalType:e.separator})].concat(e.definition)})];const i=r.concat(t,n);return i}function oH(e){if(e instanceof cb){return oH(e.referencedRule)}else if(e instanceof Ud){return HPn(e)}else if(UPn(e)){return $Pn(e)}else if(VPn(e)){return GPn(e)}else{throw Error("non exhaustive match")}}function $Pn(e){let t=[];const n=e.definition;let r=0;let i=n.length>r;let o;let a=true;while(i&&a){o=n[r];a=Fne(o);t=t.concat(oH(o));r=r+1;i=n.length>r}return Pot(t)}function GPn(e){const t=fa(e.definition,n=>{return oH(n)});return Pot(Gw(t))}function HPn(e){return[e.terminalType]}function YPn(e){const t={};cs(e,n=>{const r=new BNi(n).startWalking();fv(t,r)});return t}function qPn(e,t){return e.name+t+WPn}function sre(e){const t=e.toString();if(AAe.hasOwnProperty(t)){return AAe[t]}else{const n=zNi.pattern(t);AAe[t]=n;return n}}function XPn(){AAe={}}function KPn(e,t=false){try{const n=sre(e);const r=yke(n.value,{},n.flags.ignoreCase);return r}catch(n){if(n.message===jPn){if(t){Iot(`${gke} Unable to optimize: < ${e.toString()} > + Complement Sets cannot be automatically optimized. + This will disable the lexer's first char optimizations. + See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`)}}else{let r="";if(t){r="\n This will disable the lexer's first char optimizations.\n See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."}mke(`${gke} + Failed parsing: < ${e.toString()} > + Using the @chevrotain/regexp-to-ast library + Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+r)}}return[]}function yke(e,t,n){switch(e.type){case"Disjunction":for(let i=0;i{if(typeof l==="number"){one(l,t,n)}else{const u=l;if(n===true){for(let d=u.from;d<=u.to;d++){one(d,t,n)}}else{for(let d=u.from;d<=u.to&&d=sne){const d=u.from>=sne?u.from:sne;const f=u.to;const h=QR(d);const m=QR(f);for(let g=h;g<=m;g++){t[g]=g}}}}});break;case"Group":yke(a.value,t,n);break;default:throw Error("Non Exhaustive Match")}const s=a.quantifier!==void 0&&a.quantifier.atLeast===0;if(a.type==="Group"&&bke(a)===false||a.type!=="Group"&&s===false){break}}break;default:throw Error("non exhaustive match!")}return Vp(t)}function one(e,t,n){const r=QR(e);t[r]=r;if(n===true){ZPn(e,t)}}function ZPn(e,t){const n=String.fromCharCode(e);const r=n.toUpperCase();if(r!==n){const i=QR(r.charCodeAt(0));t[i]=i}else{const i=n.toLowerCase();if(i!==n){const o=QR(i.charCodeAt(0));t[o]=o}}}function Ont(e,t){return ZG(e.value,n=>{if(typeof n==="number"){return fb(t,n)}else{const r=n;return ZG(t,i=>r.from<=i&&i<=r.to)!==void 0}})}function bke(e){const t=e.quantifier;if(t&&t.atLeast===0){return true}if(!e.value){return false}return gc(e.value)?Hw(e.value,bke):bke(e.value)}function mRe(e,t){if(t instanceof RegExp){const n=sre(t);const r=new UNi(e);r.visit(n);return r.found}else{return ZG(t,n=>{return fb(e,n.charCodeAt(0))})!==void 0}}function JPn(e,t){t=Rot(t,{debug:false,safeMode:false,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:ee((C,A)=>A(),"tracer")});const n=t.tracer;n("initCharCodeToOptimizedIndexMap",()=>{xIn()});let r;n("Reject Lexer.NA",()=>{r=hRe(e,C=>{return C[p6]===sb.NA})});let i=false;let o;n("Transform Patterns",()=>{i=false;o=fa(r,C=>{const A=C[p6];if(ZR(A)){const P=A.source;if(P.length===1&&P!=="^"&&P!=="$"&&P!=="."&&!A.ignoreCase){return P}else if(P.length===2&&P[0]==="\\"&&!fb(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],P[1])){return P[1]}else{return Bnt(A)}}else if(iP(A)){i=true;return{exec:A}}else if(typeof A==="object"){i=true;return A}else if(typeof A==="string"){if(A.length===1){return A}else{const P=A.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&");const L=new RegExp(P);return Bnt(L)}}else{throw Error("non exhaustive match")}})});let a;let s;let l;let u;let d;n("misc mapping",()=>{a=fa(r,C=>C.tokenTypeIdx);s=fa(r,C=>{const A=C.GROUP;if(A===sb.SKIPPED){return void 0}else if(kx(A)){return A}else if(JR(A)){return false}else{throw Error("non exhaustive match")}});l=fa(r,C=>{const A=C.LONGER_ALT;if(A){const P=gc(A)?fa(A,L=>DEn(r,L)):[DEn(r,A)];return P}});u=fa(r,C=>C.PUSH_MODE);d=fa(r,C=>qa(C,"POP_MODE"))});let f;n("Line Terminator Handling",()=>{const C=Not(t.lineTerminatorCharacters);f=fa(r,A=>false);if(t.positionTracking!=="onlyOffset"){f=fa(r,A=>{if(qa(A,"LINE_BREAKS")){return!!A.LINE_BREAKS}else{return Fot(A,C)===false&&mRe(C,A.PATTERN)}})}});let h;let m;let g;let x;n("Misc Mapping #2",()=>{h=fa(r,Dot);m=fa(o,yIn);g=hv(r,(C,A)=>{const P=A.GROUP;if(kx(P)&&!(P===sb.SKIPPED)){C[P]=[]}return C},{});x=fa(o,(C,A)=>{return{pattern:o[A],longerAlt:l[A],canLineTerminator:f[A],isCustom:h[A],short:m[A],group:s[A],push:u[A],pop:d[A],tokenTypeIdx:a[A],tokenType:r[A]}})});let w=true;let _=[];if(!t.safeMode){n("First Char Optimization",()=>{_=hv(r,(C,A,P)=>{if(typeof A.PATTERN==="string"){const L=A.PATTERN.charCodeAt(0);const I=QR(L);kAe(C,I,x[P])}else if(gc(A.START_CHARS_HINT)){let L;cs(A.START_CHARS_HINT,I=>{const N=typeof I==="string"?I.charCodeAt(0):I;const O=QR(N);if(L!==O){L=O;kAe(C,O,x[P])}})}else if(ZR(A.PATTERN)){if(A.PATTERN.unicode){w=false;if(t.ensureOptimizations){mke(`${gke} Unable to analyze < ${A.PATTERN.toString()} > pattern. + The regexp unicode flag is not currently supported by the regexp-to-ast library. + This will disable the lexer's first char optimizations. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`)}}else{const L=KPn(A.PATTERN,t.ensureOptimizations);if(ud(L)){w=false}cs(L,I=>{kAe(C,I,x[P])})}}else{if(t.ensureOptimizations){mke(`${gke} TokenType: <${A.name}> is using a custom token pattern without providing parameter. + This will disable the lexer's first char optimizations. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`)}w=false}return C},[])})}return{emptyGroups:g,patternIdxToConfig:x,charCodeToPatternIdxToConfig:_,hasCustom:i,canBeOptimized:w}}function QPn(e,t){let n=[];const r=tIn(e);n=n.concat(r.errors);const i=nIn(r.valid);const o=i.valid;n=n.concat(i.errors);n=n.concat(eIn(o));n=n.concat(lIn(o));n=n.concat(cIn(o,t));n=n.concat(uIn(o));return n}function eIn(e){let t=[];const n=j_(e,r=>ZR(r[p6]));t=t.concat(rIn(n));t=t.concat(oIn(n));t=t.concat(aIn(n));t=t.concat(sIn(n));t=t.concat(iIn(n));return t}function tIn(e){const t=j_(e,i=>{return!qa(i,p6)});const n=fa(t,i=>{return{message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:Jf.MISSING_PATTERN,tokenTypes:[i]}});const r=fRe(e,t);return{errors:n,valid:r}}function nIn(e){const t=j_(e,i=>{const o=i[p6];return!ZR(o)&&!iP(o)&&!qa(o,"exec")&&!kx(o)});const n=fa(t,i=>{return{message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Jf.INVALID_PATTERN,tokenTypes:[i]}});const r=fRe(e,t);return{errors:n,valid:r}}function rIn(e){class t extends qke{static{ee(this,"EndAnchorFinder")}constructor(){super(...arguments);this.found=false}visitEndAnchor(o){this.found=true}}const n=j_(e,i=>{const o=i.PATTERN;try{const a=sre(o);const s=new t;s.visit(a);return s.found}catch(a){return VNi.test(o.source)}});const r=fa(n,i=>{return{message:"Unexpected RegExp Anchor Error:\n Token Type: ->"+i.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.",type:Jf.EOI_ANCHOR_FOUND,tokenTypes:[i]}});return r}function iIn(e){const t=j_(e,r=>{const i=r.PATTERN;return i.test("")});const n=fa(t,r=>{return{message:"Token Type: ->"+r.name+"<- static 'PATTERN' must not match an empty string",type:Jf.EMPTY_MATCH_PATTERN,tokenTypes:[r]}});return n}function oIn(e){class t extends qke{static{ee(this,"StartAnchorFinder")}constructor(){super(...arguments);this.found=false}visitStartAnchor(o){this.found=true}}const n=j_(e,i=>{const o=i.PATTERN;try{const a=sre(o);const s=new t;s.visit(a);return s.found}catch(a){return $Ni.test(o.source)}});const r=fa(n,i=>{return{message:"Unexpected RegExp Anchor Error:\n Token Type: ->"+i.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.",type:Jf.SOI_ANCHOR_FOUND,tokenTypes:[i]}});return r}function aIn(e){const t=j_(e,r=>{const i=r[p6];return i instanceof RegExp&&(i.multiline||i.global)});const n=fa(t,r=>{return{message:"Token Type: ->"+r.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Jf.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[r]}});return n}function sIn(e){const t=[];let n=fa(e,o=>{return hv(e,(a,s)=>{if(o.PATTERN.source===s.PATTERN.source&&!fb(t,s)&&s.PATTERN!==sb.NA){t.push(s);a.push(s);return a}return a},[])});n=are(n);const r=j_(n,o=>{return o.length>1});const i=fa(r,o=>{const a=fa(o,l=>{return l.name});const s=Yw(o).PATTERN;return{message:`The same RegExp pattern ->${s}<-has been used in all of the following Token Types: ${a.join(", ")} <-`,type:Jf.DUPLICATE_PATTERNS_FOUND,tokenTypes:o}});return i}function lIn(e){const t=j_(e,r=>{if(!qa(r,"GROUP")){return false}const i=r.GROUP;return i!==sb.SKIPPED&&i!==sb.NA&&!kx(i)});const n=fa(t,r=>{return{message:"Token Type: ->"+r.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Jf.INVALID_GROUP_TYPE_FOUND,tokenTypes:[r]}});return n}function cIn(e,t){const n=j_(e,i=>{return i.PUSH_MODE!==void 0&&!fb(t,i.PUSH_MODE)});const r=fa(n,i=>{const o=`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`;return{message:o,type:Jf.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}});return r}function uIn(e){const t=[];const n=hv(e,(r,i,o)=>{const a=i.PATTERN;if(a===sb.NA){return r}if(kx(a)){r.push({str:a,idx:o,tokenType:i})}else if(ZR(a)&&fIn(a)){r.push({str:a.source,idx:o,tokenType:i})}return r},[]);cs(e,(r,i)=>{cs(n,({str:o,idx:a,tokenType:s})=>{if(i${s.name}<- can never be matched. +Because it appears AFTER the Token Type ->${r.name}<-in the lexer's definition. +See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:l,type:Jf.UNREACHABLE_PATTERN,tokenTypes:[r,s]})}})});return t}function dIn(e,t){if(ZR(t)){if(hIn(t)){return false}const n=t.exec(e);return n!==null&&n.index===0}else if(iP(t)){return t(e,0,[],{})}else if(qa(t,"exec")){return t.exec(e,0,[],{})}else if(typeof t==="string"){return t===e}else{throw Error("non exhaustive match")}}function fIn(e){const t=[".","\\","[","]","|","^","$","(",")","?","*","+","{"];return ZG(t,n=>e.source.indexOf(n)!==-1)===void 0}function hIn(e){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\? property in its definition\n",type:Jf.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE})}if(!qa(e,tAe)){r.push({message:"A MultiMode Lexer cannot be initialized without a <"+tAe+"> property in its definition\n",type:Jf.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY})}if(qa(e,tAe)&&qa(e,ane)&&!qa(e.modes,e.defaultMode)){r.push({message:`A MultiMode Lexer cannot be initialized with a ${ane}: <${e.defaultMode}>which does not exist +`,type:Jf.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST})}if(qa(e,tAe)){cs(e.modes,(i,o)=>{cs(i,(a,s)=>{if(JR(a)){r.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${o}> at index: <${s}> +`,type:Jf.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})}else if(qa(a,"LONGER_ALT")){const l=gc(a.LONGER_ALT)?a.LONGER_ALT:[a.LONGER_ALT];cs(l,u=>{if(!JR(u)&&!fb(i,u)){r.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${u.name}> on token <${a.name}> outside of mode <${o}> +`,type:Jf.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})}})}})})}return r}function mIn(e,t,n){const r=[];let i=false;const o=are(Gw(Vp(e.modes)));const a=hRe(o,l=>l[p6]===sb.NA);const s=Not(n);if(t){cs(a,l=>{const u=Fot(l,s);if(u!==false){const d=bIn(l,u);const f={message:d,type:u.issue,tokenType:l};r.push(f)}else{if(qa(l,"LINE_BREAKS")){if(l.LINE_BREAKS===true){i=true}}else{if(mRe(s,l.PATTERN)){i=true}}}})}if(t&&!i){r.push({message:"Warning: No LINE_BREAKS Found.\n This Lexer has been defined to track line and column information,\n But none of the Token Types can be identified as matching a line terminator.\n See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n for details.",type:Jf.NO_LINE_BREAKS_FLAGS})}return r}function gIn(e){const t={};const n=dv(e);cs(n,r=>{const i=e[r];if(gc(i)){t[r]=[]}else{throw Error("non exhaustive match")}});return t}function Dot(e){const t=e.PATTERN;if(ZR(t)){return false}else if(iP(t)){return true}else if(qa(t,"exec")){return true}else if(kx(t)){return false}else{throw Error("non exhaustive match")}}function yIn(e){if(kx(e)&&e.length===1){return e.charCodeAt(0)}else{return false}}function Fot(e,t){if(qa(e,"LINE_BREAKS")){return false}else{if(ZR(e.PATTERN)){try{mRe(t,e.PATTERN)}catch(n){return{issue:Jf.IDENTIFY_TERMINATOR,errMsg:n.message}}return false}else if(kx(e.PATTERN)){return false}else if(Dot(e)){return{issue:Jf.CUSTOM_LINE_BREAK}}else{throw Error("non exhaustive match")}}}function bIn(e,t){if(t.issue===Jf.IDENTIFY_TERMINATOR){return`Warning: unable to identify line terminator usage in pattern. + The problem is in the <${e.name}> Token Type + Root cause: ${t.errMsg}. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`}else if(t.issue===Jf.CUSTOM_LINE_BREAK){return`Warning: A Custom Token Pattern should specify the option. + The problem is in the <${e.name}> Token Type + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`}else{throw Error("non exhaustive match")}}function Not(e){const t=fa(e,n=>{if(kx(n)){return n.charCodeAt(0)}else{return n}});return t}function kAe(e,t,n){if(e[t]===void 0){e[t]=[n]}else{e[t].push(n)}}function QR(e){return e255?255+~~(e/255):e}}}function aH(e,t){const n=e.tokenTypeIdx;if(n===t.tokenTypeIdx){return true}else{return t.isParent===true&&t.categoryMatchesMap[n]===true}}function Nne(e,t){return e.tokenTypeIdx===t.tokenTypeIdx}function sH(e){const t=_In(e);TIn(t);EIn(t);wIn(t);cs(t,n=>{n.isParent=n.categoryMatches.length>0})}function _In(e){let t=Ng(e);let n=e;let r=true;while(r){n=are(Gw(fa(n,o=>o.CATEGORIES)));const i=fRe(n,t);t=t.concat(i);if(ud(i)){r=false}else{n=i}}return t}function TIn(e){cs(e,t=>{if(!Bot(t)){vIn[NEn]=t;t.tokenTypeIdx=NEn++}if(znt(t)&&!gc(t.CATEGORIES)){t.CATEGORIES=[t.CATEGORIES]}if(!znt(t)){t.CATEGORIES=[]}if(!CIn(t)){t.categoryMatches=[]}if(!SIn(t)){t.categoryMatchesMap={}}})}function wIn(e){cs(e,t=>{t.categoryMatches=[];cs(t.categoryMatchesMap,(n,r)=>{t.categoryMatches.push(vIn[r].tokenTypeIdx)})})}function EIn(e){cs(e,t=>{Oot([],t)})}function Oot(e,t){cs(e,n=>{t.categoryMatchesMap[n.tokenTypeIdx]=true});cs(t.CATEGORIES,n=>{const r=e.concat(t);if(!fb(r,n)){Oot(r,n)}})}function Bot(e){return qa(e,"tokenTypeIdx")}function znt(e){return qa(e,"CATEGORIES")}function CIn(e){return qa(e,"categoryMatches")}function SIn(e){return qa(e,"categoryMatchesMap")}function AIn(e){return qa(e,"tokenTypeIdx")}function u6(e){if(zot(e)){return e.LABEL}else{return e.name}}function zot(e){return kx(e.LABEL)&&e.LABEL!==""}function VG(e){return kIn(e)}function kIn(e){const t=e.pattern;const n={};n.name=e.name;if(!JR(t)){n.PATTERN=t}if(qa(e,HNi)){throw"The parent property is no longer supported.\nSee: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details."}if(qa(e,OEn)){n.CATEGORIES=e[OEn]}sH([n]);if(qa(e,BEn)){n.LABEL=e[BEn]}if(qa(e,zEn)){n.GROUP=e[zEn]}if(qa(e,VEn)){n.POP_MODE=e[VEn]}if(qa(e,UEn)){n.PUSH_MODE=e[UEn]}if(qa(e,$En)){n.LONGER_ALT=e[$En]}if(qa(e,GEn)){n.LINE_BREAKS=e[GEn]}if(qa(e,HEn)){n.START_CHARS_HINT=e[HEn]}return n}function lre(e,t,n,r,i,o,a,s){return{image:t,startOffset:n,endOffset:r,startLine:i,endLine:o,startColumn:a,endColumn:s,tokenTypeIdx:e.tokenTypeIdx,tokenType:e}}function Uot(e,t){return aH(e,t)}function RIn(e,t){const n=new YNi(e,t);n.resolveRefs();return n.errors}function xke(e,t,n=[]){n=Ng(n);let r=[];let i=0;function o(s){return s.concat(Dg(e,i+1))}ee(o,"remainingPathWith");function a(s){const l=xke(o(s),t,n);return r.concat(l)}ee(a,"getAlternativesForProd");while(n.length{if(ud(l.definition)===false){r=a(l.definition)}});return r}else if(s instanceof Ud){n.push(s.terminalType)}else{throw Error("non exhaustive match")}i++}r.push({partialPath:n,suffixDef:Dg(e,i)});return r}function Vot(e,t,n,r){const i="EXIT_NONE_TERMINAL";const o=[i];const a="EXIT_ALTERNATIVE";let s=false;const l=t.length;const u=l-r-1;const d=[];const f=[];f.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});while(!ud(f)){const h=f.pop();if(h===a){if(s&&h6(f).idx<=u){f.pop()}continue}const m=h.def;const g=h.idx;const x=h.ruleStack;const w=h.occurrenceStack;if(ud(m)){continue}const _=m[0];if(_===i){const C={idx:g,def:Dg(m),ruleStack:Dne(x),occurrenceStack:Dne(w)};f.push(C)}else if(_ instanceof Ud){if(g=0;C--){const A=_.definition[C];const P={idx:g,def:A.definition.concat(Dg(m)),ruleStack:x,occurrenceStack:w};f.push(P);f.push(a)}}else if(_ instanceof Rx){f.push({idx:g,def:_.definition.concat(Dg(m)),ruleStack:x,occurrenceStack:w})}else if(_ instanceof rH){f.push(PIn(_,g,x,w))}else{throw Error("non exhaustive match")}}return d}function PIn(e,t,n,r){const i=Ng(n);i.push(e.name);const o=Ng(r);o.push(1);return{idx:t,def:e.definition,ruleStack:i,occurrenceStack:o}}function yRe(e){if(e instanceof Fg||e==="Option"){return kf.OPTION}else if(e instanceof Zf||e==="Repetition"){return kf.REPETITION}else if(e instanceof pv||e==="RepetitionMandatory"){return kf.REPETITION_MANDATORY}else if(e instanceof mv||e==="RepetitionMandatoryWithSeparator"){return kf.REPETITION_MANDATORY_WITH_SEPARATOR}else if(e instanceof Px||e==="RepetitionWithSeparator"){return kf.REPETITION_WITH_SEPARATOR}else if(e instanceof Ix||e==="Alternation"){return kf.ALTERNATION}else{throw Error("non exhaustive match")}}function Vnt(e){const{occurrence:t,rule:n,prodType:r,maxLookahead:i}=e;const o=yRe(r);if(o===kf.ALTERNATION){return cre(t,n,i)}else{return ure(t,n,o,i)}}function IIn(e,t,n,r,i,o){const a=cre(e,t,n);const s=Got(a)?Nne:aH;return o(a,r,s,i)}function MIn(e,t,n,r,i,o){const a=ure(e,t,i,n);const s=Got(a)?Nne:aH;return o(a[0],s,r)}function LIn(e,t,n,r){const i=e.length;const o=Hw(e,a=>{return Hw(a,s=>{return s.length===1})});if(t){return function(a){const s=fa(a,l=>l.GATE);for(let l=0;l{return Gw(l)});const s=hv(a,(l,u,d)=>{cs(u,f=>{if(!qa(l,f.tokenTypeIdx)){l[f.tokenTypeIdx]=d}cs(f.categoryMatches,h=>{if(!qa(l,h)){l[h]=d}})});return l},{});return function(){const l=this.LA(1);return s[l.tokenTypeIdx]}}else{return function(){for(let a=0;a{return o.length===1});const i=e.length;if(r&&!n){const o=Gw(e);if(o.length===1&&ud(o[0].categoryMatches)){const a=o[0];const s=a.tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===s}}else{const a=hv(o,(s,l,u)=>{s[l.tokenTypeIdx]=true;cs(l.categoryMatches,d=>{s[d]=true});return s},[]);return function(){const s=this.LA(1);return a[s.tokenTypeIdx]===true}}}else{return function(){e:for(let o=0;oxke([a],1));const r=$nt(n.length);const i=fa(n,a=>{const s={};cs(a,l=>{const u=PAe(l.partialPath);cs(u,d=>{s[d]=true})});return s});let o=n;for(let a=1;a<=t;a++){const s=o;o=$nt(s.length);for(let l=0;l{const _=PAe(w.partialPath);cs(_,C=>{i[l][C]=true})})}}}}return r}function cre(e,t,n,r){const i=new FIn(e,kf.ALTERNATION,r);t.accept(i);return $ot(i.result,n)}function ure(e,t,n,r){const i=new FIn(e,n);t.accept(i);const o=i.result;const a=new ZNi(t,e,n);const s=a.startWalking();const l=new Rx({definition:o});const u=new Rx({definition:s});return $ot([l,u],r)}function vke(e,t){e:for(let n=0;n{const i=t[r];return n===i||i.categoryMatchesMap[n.tokenTypeIdx]})}function Got(e){return Hw(e,t=>Hw(t,n=>Hw(n,r=>ud(r.categoryMatches))))}function BIn(e){const t=e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName});return fa(t,n=>Object.assign({type:ub.CUSTOM_LOOKAHEAD_VALIDATION},n))}function zIn(e,t,n,r){const i=W_(e,l=>UIn(l,n));const o=KIn(e,t,n);const a=W_(e,l=>YIn(l,n));const s=W_(e,l=>$In(l,e,r,n));return i.concat(o,a,s)}function UIn(e,t){const n=new JNi;e.accept(n);const r=n.allProductions;const i=fNi(r,VIn);const o=qw(i,s=>{return s.length>1});const a=fa(Vp(o),s=>{const l=Yw(s);const u=t.buildDuplicateFoundError(e,s);const d=zw(l);const f={message:u,type:ub.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:d,occurrence:l.idx};const h=Hot(l);if(h){f.parameter=h}return f});return a}function VIn(e){return`${zw(e)}_#_${e.idx}_#_${Hot(e)}`}function Hot(e){if(e instanceof Ud){return e.terminalType.name}else if(e instanceof cb){return e.nonTerminalName}else{return""}}function $In(e,t,n,r){const i=[];const o=hv(t,(a,s)=>{if(s.name===e.name){return a+1}return a},0);if(o>1){const a=r.buildDuplicateRuleNameError({topLevelRule:e,grammarName:n});i.push({message:a,type:ub.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}function GIn(e,t,n){const r=[];let i;if(!fb(t,e)){i=`Invalid rule override, rule: ->${e}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `;r.push({message:i,type:ub.INVALID_RULE_OVERRIDE,ruleName:e})}return r}function Wot(e,t,n,r=[]){const i=[];const o=_ne(t.definition);if(ud(o)){return[]}else{const a=e.name;const s=fb(o,e);if(s){i.push({message:n.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:r}),type:ub.LEFT_RECURSION,ruleName:a})}const l=fRe(o,r.concat([e]));const u=W_(l,d=>{const f=Ng(r);f.push(d);return Wot(e,d,n,f)});return i.concat(u)}}function _ne(e){let t=[];if(ud(e)){return t}const n=Yw(e);if(n instanceof cb){t.push(n.referencedRule)}else if(n instanceof Rx||n instanceof Fg||n instanceof pv||n instanceof mv||n instanceof Px||n instanceof Zf){t=t.concat(_ne(n.definition))}else if(n instanceof Ix){t=Gw(fa(n.definition,o=>_ne(o.definition)))}else if(n instanceof Ud){}else{throw Error("non exhaustive match")}const r=Fne(n);const i=e.length>1;if(r&&i){const o=Dg(e);return t.concat(_ne(o))}else{return t}}function HIn(e,t){const n=new Yot;e.accept(n);const r=n.alternations;const i=W_(r,o=>{const a=Dne(o.definition);return W_(a,(s,l)=>{const u=Vot([s],[],aH,1);if(ud(u)){return[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:o,emptyChoiceIdx:l}),type:ub.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:o.idx,alternative:l+1}]}else{return[]}})});return i}function WIn(e,t,n){const r=new Yot;e.accept(r);let i=r.alternations;i=hRe(i,a=>a.ignoreAmbiguities===true);const o=W_(i,a=>{const s=a.idx;const l=a.maxLookahead||t;const u=cre(s,e,l,a);const d=XIn(u,a,e,n);const f=jIn(u,a,e,n);return d.concat(f)});return o}function YIn(e,t){const n=new Yot;e.accept(n);const r=n.alternations;const i=W_(r,o=>{if(o.definition.length>255){return[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:o}),type:ub.TOO_MANY_ALTS,ruleName:e.name,occurrence:o.idx}]}else{return[]}});return i}function qIn(e,t,n){const r=[];cs(e,i=>{const o=new QNi;i.accept(o);const a=o.allProductions;cs(a,s=>{const l=yRe(s);const u=s.maxLookahead||t;const d=s.idx;const f=ure(d,i,l,u);const h=f[0];if(ud(Gw(h))){const m=n.buildEmptyRepetitionError({topLevelRule:i,repetition:s});r.push({message:m,type:ub.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})});return r}function XIn(e,t,n,r){const i=[];const o=hv(e,(s,l,u)=>{if(t.definition[u].ignoreAmbiguities===true){return s}cs(l,d=>{const f=[u];cs(e,(h,m)=>{if(u!==m&&vke(h,d)&&t.definition[m].ignoreAmbiguities!==true){f.push(m)}});if(f.length>1&&!vke(i,d)){i.push(d);s.push({alts:f,path:d})}});return s},[]);const a=fa(o,s=>{const l=fa(s.alts,d=>d+1);const u=r.buildAlternationAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:l,prefixPath:s.path});return{message:u,type:ub.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:t.idx,alternatives:s.alts}});return a}function jIn(e,t,n,r){const i=hv(e,(a,s,l)=>{const u=fa(s,d=>{return{idx:l,path:d}});return a.concat(u)},[]);const o=are(W_(i,a=>{const s=t.definition[a.idx];if(s.ignoreAmbiguities===true){return[]}const l=a.idx;const u=a.path;const d=j_(i,h=>{return t.definition[h.idx].ignoreAmbiguities!==true&&h.idx{const m=[h.idx+1,l+1];const g=t.idx===0?"":t.idx;const x=r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:m,prefixPath:h.path});return{message:x,type:ub.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:g,alternatives:m}});return f}));return o}function KIn(e,t,n){const r=[];const i=fa(t,o=>o.name);cs(e,o=>{const a=o.name;if(fb(i,a)){const s=n.buildNamespaceConflictError(o);r.push({message:s,type:ub.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:a})}});return r}function ZIn(e){const t=Rot(e,{errMsgProvider:WNi});const n={};cs(e.rules,r=>{n[r.name]=r});return RIn(n,t.errMsgProvider)}function JIn(e){e=Rot(e,{errMsgProvider:s6});return zIn(e.rules,e.tokenTypes,e.errMsgProvider,e.grammarName)}function One(e){return fb(r3n,e.name)}function a3n(e,t,n,r,i,o,a){const s=this.getKeyForAutomaticLookahead(r,i);let l=this.firstAfterRepMap[s];if(l===void 0){const h=this.getCurrRuleFullName();const m=this.getGAstProductions()[h];const g=new o(m,i);l=g.startWalking();this.firstAfterRepMap[s]=l}let u=l.token;let d=l.occurrence;const f=l.isEndOfRule;if(this.RULE_STACK.length===1&&f&&u===void 0){u=fD;d=1}if(u===void 0||d===void 0){return}if(this.shouldInRepetitionRecoveryBeTried(u,d,a)){this.tryInRepetitionRecovery(e,t,n,u)}}function MAe(e,t,n){return n|t|e}function c3n(e){nAe.reset();e.accept(nAe);const t=nAe.dslMethods;nAe.reset();return t}function Ynt(e,t){if(isNaN(e.startOffset)===true){e.startOffset=t.startOffset;e.endOffset=t.endOffset}else if(e.endOffseta.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>: + ${o.join("\n\n").replace(/\n/g,"\n ")}`)}},"validateVisitor")};n.prototype=r;n.prototype.constructor=n;n._RULE_NAMES=t;return n}function p3n(e,t,n){const r=ee(function(){},"derivedConstructor");Xot(r,e+"BaseSemanticsWithDefaults");const i=Object.create(n.prototype);cs(t,o=>{i[o]=f3n});r.prototype=i;r.prototype.constructor=r;return r}function m3n(e,t){const n=g3n(e,t);return n}function g3n(e,t){const n=j_(t,i=>{return iP(e[i])===false});const r=fa(n,i=>{return{msg:`Missing visitor method: <${i}> on ${e.constructor.name} CST Visitor.`,type:Xnt.MISSING_METHOD,methodName:i}});return are(r)}function CG(e,t,n,r=false){Bne(n);const i=h6(this.recordingProdStack);const o=iP(t)?t:t.DEF;const a=new e({definition:[],idx:n});if(r){a.separator=t.SEP}if(qa(t,"MAX_LOOKAHEAD")){a.maxLookahead=t.MAX_LOOKAHEAD}this.recordingProdStack.push(a);o.call(this);i.definition.push(a);this.recordingProdStack.pop();return xRe}function x3n(e,t){Bne(t);const n=h6(this.recordingProdStack);const r=gc(e)===false;const i=r===false?e:e.DEF;const o=new Ix({definition:[],idx:t,ignoreAmbiguities:r&&e.IGNORE_AMBIGUITIES===true});if(qa(e,"MAX_LOOKAHEAD")){o.maxLookahead=e.MAX_LOOKAHEAD}const a=DPn(i,s=>iP(s.GATE));o.hasPredicates=a;n.definition.push(o);cs(i,s=>{const l=new Rx({definition:[]});o.definition.push(l);if(qa(s,"IGNORE_AMBIGUITIES")){l.ignoreAmbiguities=s.IGNORE_AMBIGUITIES}else if(qa(s,"GATE")){l.ignoreAmbiguities=true}this.recordingProdStack.push(l);s.ALT.call(this);this.recordingProdStack.pop()});return xRe}function jnt(e){return e===0?"":`${e}`}function Bne(e){if(e<0||e>XEn){const t=new Error(`Invalid DSL Method idx value: <${e}> + Idx value must be a none negative value smaller than ${XEn+1}`);t.KNOWN_RECORDER_ERROR=true;throw t}}function v3n(e,t){t.forEach(n=>{const r=n.prototype;Object.getOwnPropertyNames(r).forEach(i=>{if(i==="constructor"){return}const o=Object.getOwnPropertyDescriptor(r,i);if(o&&(o.get||o.set)){Object.defineProperty(e.prototype,i,o)}else{e.prototype[i]=n.prototype[i]}})})}function Knt(e=void 0){return function(){return e}}function T3n(e,t){var n=-1,r=e==null?0:e.length,i=Array(r);while(++n-1}function I3n(e,t){var n=this.__data__,r=vRe(n,e);if(r<0){++this.size;n.push([e,t])}else{n[r][1]=t}return this}function P6(e){var t=-1,n=e==null?0:e.length;this.clear();while(++ts)){return false}var u=o.get(e);var d=o.get(t);if(u&&d){return u==t&&d==e}var f=-1,h=true,m=n&M5i?new uMn:void 0;o.set(e,t);o.set(t,e);while(++f-1&&e%1==0&&e-1&&e%1==0&&e<=hBi}function DMn(e){return JG(e)&&Jot(e.length)&&!!zd[lH(e)]}function FMn(e){return function(t){return e(t)}}function OMn(e,t){var n=db(e),r=!n&&ERe(e),i=!n&&!r&&wke(e),o=!n&&!r&&!i&&Qot(e),a=n||r||i||o,s=a?nBi(e.length,String):[],l=s.length;for(var u in e){if((t||HBi.call(e,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||MMn(u,l)))){s.push(u)}}return s}function BMn(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||YBi;return e===n}function UMn(e,t){return function(n){return e(t(n))}}function VMn(e){if(!zMn(e)){return jBi(e)}var t=[];for(var n in Object(e)){if(ZBi.call(e,n)&&n!="constructor"){t.push(n)}}return t}function GMn(e){return e!=null&&Jot(e.length)&&!G3n(e)}function HMn(e){return CRe(e)?WBi(e):$Mn(e)}function WMn(e){return K5i(e,eat,tBi)}function YMn(e,t,n,r,i,o){var a=n&JBi,s=aCn(e),l=s.length,u=aCn(t),d=u.length;if(l!=d&&!a){return false}var f=l;while(f--){var h=s[f];if(!(a?h in t:e6i.call(t,h))){return false}}var m=o.get(e);var g=o.get(t);if(m&&g){return m==t&&g==e}var x=true;o.set(e,t);o.set(t,e);var w=a;while(++flat(e,t,a));const o=F6(e,t,r,n,...i);return o}function zLn(e,t,n){const r=$p(e,t,n,{type:hD});aP(e,r);const i=F6(e,t,r,n,xD(e,t,n));return ULn(e,t,n,i)}function xD(e,t,n){const r=Q6i(YR(n.definition,i=>lat(e,t,i)),i=>i!==void 0);if(r.length===1){return r[0]}else if(r.length===0){return void 0}else{return $Ln(e,r)}}function cat(e,t,n,r,i){const o=r.left;const a=r.right;const s=$p(e,t,n,{type:i8i});aP(e,s);const l=$p(e,t,n,{type:PLn});o.loopback=s;l.loopback=s;e.decisionMap[m6(t,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",n.idx)]=s;xh(a,s);if(i===void 0){xh(s,o);xh(s,l)}else{xh(s,l);xh(s,i.left);xh(i.right,o)}return{left:o,right:l}}function uat(e,t,n,r,i){const o=r.left;const a=r.right;const s=$p(e,t,n,{type:r8i});aP(e,s);const l=$p(e,t,n,{type:PLn});const u=$p(e,t,n,{type:n8i});s.loopback=u;l.loopback=u;xh(s,o);xh(s,l);xh(a,u);if(i!==void 0){xh(u,l);xh(u,i.left);xh(i.right,o)}else{xh(u,s)}e.decisionMap[m6(t,i?"RepetitionWithSeparator":"Repetition",n.idx)]=s;return{left:s,right:l}}function ULn(e,t,n,r){const i=r.left;const o=r.right;xh(i,o);e.decisionMap[m6(t,"Option",n.idx)]=i;return r}function aP(e,t){e.decisionStates.push(t);t.decision=e.decisionStates.length-1;return t.decision}function F6(e,t,n,r,...i){const o=$p(e,t,r,{type:t8i,start:n});n.end=o;for(const s of i){if(s!==void 0){xh(n,s.left);xh(s.right,o)}else{xh(n,o)}}const a={left:n,right:o};e.decisionMap[m6(t,VLn(r),r.idx)]=n;return a}function VLn(e){if(e instanceof Ix){return"Alternation"}else if(e instanceof Fg){return"Option"}else if(e instanceof Zf){return"Repetition"}else if(e instanceof Px){return"RepetitionWithSeparator"}else if(e instanceof pv){return"RepetitionMandatory"}else if(e instanceof mv){return"RepetitionMandatoryWithSeparator"}else{throw new Error("Invalid production type encountered")}}function $Ln(e,t){const n=t.length;for(let o=0;on.stateNumber.toString()).join("_")}`}function YLn(e,t,n){var r=-1,i=e.length;while(++r0&&n(s)){if(t>1){fat(s,t-1,n,r,i)}else{vMn(i,s)}}else if(!r){i[i.length]=s}}return i}function ZLn(e,t){return KLn(YR(e,t),1)}function JLn(e,t,n,r){var i=e.length,o=n+(r?1:-1);while(r?o--:++o-1}function rDn(e,t,n){var r=-1,i=e==null?0:e.length;while(++r=v8i){var u=t?null:x8i(e);if(u){return Zot(u)}a=false;i=hMn;l=new uMn}else{l=t?[]:s}e:while(++r{const i=r.toString();let o=n[i];if(o!==void 0){return o}else{o={atnStartState:e,decision:t,states:{}};n[i]=o;return o}}}function nrt(e,t=true){const n=new Set;for(const r of e){const i=new Set;for(const o of r){if(o===void 0){if(t){break}else{return false}}const a=[o.tokenTypeIdx].concat(o.categoryMatches);for(const s of a){if(n.has(s)){if(!i.has(s)){return false}}else{n.add(s);i.add(s)}}}}return true}function yDn(e){const t=e.decisionStates.length;const n=Array(t);for(let r=0;ru6(i)).join(", ");const n=e.production.idx===0?"":e.production.idx;let r=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(", ")}> in <${TDn(e.production)}${n}> inside <${e.topLevelRule.name}> Rule, +<${t}> may appears as a prefix path in all these alternatives. +`;r=r+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES +For Further details.`;return r}function TDn(e){if(e instanceof cb){return"SUBRULE"}else if(e instanceof Fg){return"OPTION"}else if(e instanceof Ix){return"OR"}else if(e instanceof pv){return"AT_LEAST_ONE"}else if(e instanceof mv){return"AT_LEAST_ONE_SEP"}else if(e instanceof Px){return"MANY_SEP"}else if(e instanceof Zf){return"MANY"}else if(e instanceof Ud){return"CONSUME"}else{throw Error("non exhaustive match")}}function wDn(e,t,n){const r=c8i(t.configs.elements,o=>o.state.transitions);const i=T8i(r.filter(o=>o instanceof aat).map(o=>o.tokenType),o=>o.tokenTypeIdx);return{actualToken:n,possibleTokenTypes:i,tokenPath:e}}function EDn(e,t){return e.edges[t.tokenTypeIdx]}function CDn(e,t,n){const r=new trt;const i=[];for(const a of e.elements){if(n.is(a.alt)===false){continue}if(a.state.type===dre){i.push(a);continue}const s=a.state.transitions.length;for(let l=0;l0&&!PDn(o)){for(const a of i){o.add(a)}}return o}function SDn(e,t){if(e instanceof aat&&Uot(t,e.tokenType)){return e.target}return void 0}function ADn(e,t){let n;for(const r of e.elements){if(t.is(r.alt)===true){if(n===void 0){n=r.alt}else if(n!==r.alt){return void 0}}}return n}function hat(e){return{configs:e,edges:{},isAcceptState:false,prediction:-1}}function rrt(e,t,n,r){r=pat(e,r);t.edges[n.tokenTypeIdx]=r;return r}function pat(e,t){if(t===Eke){return t}const n=t.configs.key;const r=e.states[n];if(r!==void 0){return r}t.configs.finalize();e.states[n]=t;return t}function kDn(e){const t=new trt;const n=e.transitions.length;for(let r=0;r0){const i=[...e.stack];const o=i.pop();const a={state:o,alt:e.alt,stack:i};$ne(a,t)}else{t.add(e)}return}if(!n.epsilonOnlyTransitions){t.add(e)}const r=n.transitions.length;for(let i=0;i1){return true}}return false}function FDn(e){for(const t of Array.from(e.values())){if(Object.keys(t).length===1){return true}}return false}function FAe(e){return e.$type===Ske}function DRe(e,t,n){const r={parser:t,tokens:n,ruleNames:new Map};GDn(r,e);return t}function GDn(e,t){const n=jke(t,false);const r=gu(t.rules).filter(lb).filter(o=>n.has(o));for(const o of r){const a={...e,consume:1,optional:1,subrule:1,many:1,or:1};e.parser.rule(o,pD(a,o.definition))}const i=gu(t.rules).filter(qG).filter(o=>n.has(o));for(const o of i){e.parser.rule(o,HDn(e,o))}}function HDn(e,t){const n=t.call.rule.ref;if(!n){throw new Error("Could not resolve reference to infix operator rule: "+t.call.rule.$refText)}if(X_(n)){throw new Error("Cannot use terminal rule in infix expression")}const r=t.operators.precedences.flatMap(m=>m.operators);const i={$type:"Group",elements:[]};const o={$container:i,$type:"Assignment",feature:"parts",operator:"+=",terminal:t.call};const a={$container:i,$type:"Group",elements:[],cardinality:"*"};i.elements.push(o,a);const s={$type:"Alternatives",elements:r};const l={$container:a,$type:"Assignment",feature:"operators",operator:"+=",terminal:s};const u={...o,$container:a};a.elements.push(l,u);const d=r.map(m=>e.tokens[m.value]);const f=d.map((m,g)=>({ALT:ee(()=>e.parser.consume(g,m,l),"ALT")}));let h;return m=>{h??(h=FRe(e,n));e.parser.subrule(0,h,false,o,m);e.parser.many(0,{DEF:ee(()=>{e.parser.alternatives(0,f);e.parser.subrule(1,h,false,u,m)},"DEF")})}}function pD(e,t,n=false){let r;if(jR(t)){r=ZDn(e,t)}else if(uD(t)){r=WDn(e,t)}else if(XR(t)){r=pD(e,t.terminal)}else if(v6(t)){r=xat(e,t)}else if(KR(t)){r=YDn(e,t)}else if(Uke(t)){r=XDn(e,t)}else if(Hke(t)){r=jDn(e,t)}else if(_6(t)){r=KDn(e,t)}else if(Tit(t)){const i=e.consume++;r=ee(()=>e.parser.consume(i,fD,t),"method")}else{throw new Yke(t.$cstNode,`Unexpected element type: ${t.$type}`)}return vat(e,n?void 0:Gne(t),r,t.cardinality)}function WDn(e,t){const n=f6(t);return()=>e.parser.action(n,t)}function YDn(e,t){const n=t.rule.ref;if(x6(n)){const r=e.subrule++;const i=lb(n)&&n.fragment;const o=t.arguments.length>0?qDn(n,t.arguments):()=>({});let a;return s=>{a??(a=FRe(e,n));e.parser.subrule(r,a,i,t,o(s))}}else if(X_(n)){const r=e.consume++;const i=Ake(e,n.name);return()=>e.parser.consume(r,i,t)}else if(!n){throw new Yke(t.$cstNode,`Undefined rule: ${t.rule.$refText}`)}else{gD(n)}}function qDn(e,t){const n=t.some(r=>r.calledByName);if(n){const r=t.map(i=>({parameterName:i.parameter?.ref?.name,predicate:Uw(i.value)}));return i=>{const o={};for(const{parameterName:a,predicate:s}of r){if(a){o[a]=s(i)}}return o}}else{const r=t.map(i=>Uw(i.value));return i=>{const o={};for(let a=0;at(r)||n(r)}else if(vit(e)){const t=Uw(e.left);const n=Uw(e.right);return r=>t(r)&&n(r)}else if(Cit(e)){const t=Uw(e.value);return n=>!t(n)}else if(Sit(e)){const t=e.parameter.ref.name;return n=>n!==void 0&&n[t]===true}else if(bit(e)){const t=Boolean(e.true);return()=>t}gD(e)}function XDn(e,t){if(t.elements.length===1){return pD(e,t.elements[0])}else{const n=[];for(const i of t.elements){const o={ALT:pD(e,i,true)};const a=Gne(i);if(a){o.GATE=Uw(a)}n.push(o)}const r=e.or++;return i=>e.parser.alternatives(r,n.map(o=>{const a={ALT:ee(()=>o.ALT(i),"ALT")};const s=o.GATE;if(s){a.GATE=()=>s(i)}return a}))}}function jDn(e,t){if(t.elements.length===1){return pD(e,t.elements[0])}const n=[];for(const s of t.elements){const l={ALT:pD(e,s,true)};const u=Gne(s);if(u){l.GATE=Uw(u)}n.push(l)}const r=e.or++;const i=ee((s,l)=>{const u=l.getRuleStack().join("-");return`uGroup_${s}_${u}`},"idFunc");const o=ee(s=>e.parser.alternatives(r,n.map((l,u)=>{const d={ALT:ee(()=>true,"ALT")};const f=e.parser;d.ALT=()=>{l.ALT(s);if(!f.isRecording()){const m=i(r,f);if(!f.unorderedGroups.get(m)){f.unorderedGroups.set(m,[])}const g=f.unorderedGroups.get(m);if(typeof g?.[u]==="undefined"){g[u]=true}}};const h=l.GATE;if(h){d.GATE=()=>h(s)}else{d.GATE=()=>{const m=f.unorderedGroups.get(i(r,f));const g=!m?.[u];return g}}return d})),"alternatives");const a=vat(e,Gne(t),o,"*");return s=>{a(s);if(!e.parser.isRecording()){e.parser.unorderedGroups.delete(i(r,e.parser))}}}function KDn(e,t){const n=t.elements.map(r=>pD(e,r));return r=>n.forEach(i=>i(r))}function Gne(e){if(_6(e)){return e.guardCondition}return void 0}function xat(e,t,n=t.terminal){if(!n){if(!t.type.ref){throw new Error("Could not resolve reference to type: "+t.type.$refText)}const r=Qke(t.type.ref);const i=r?.terminal;if(!i){throw new Error("Could not find name assignment for type: "+f6(t.type.ref))}return xat(e,t,i)}else if(KR(n)&&lb(n.rule.ref)){const r=n.rule.ref;const i=e.subrule++;let o;return a=>{o??(o=FRe(e,r));e.parser.subrule(i,o,false,t,a)}}else if(KR(n)&&X_(n.rule.ref)){const r=e.consume++;const i=Ake(e,n.rule.ref.name);return()=>e.parser.consume(r,i,t)}else if(jR(n)){const r=e.consume++;const i=Ake(e,n.value);return()=>e.parser.consume(r,i,t)}else{throw new Error("Could not build cross reference parser")}}function ZDn(e,t){const n=e.consume++;const r=e.tokens[t.value];if(!r){throw new Error("Could not find token for keyword: "+t.value)}return()=>e.parser.consume(n,r,t)}function vat(e,t,n,r){const i=t&&Uw(t);if(!r){if(i){const o=e.or++;return a=>e.parser.alternatives(o,[{ALT:ee(()=>n(a),"ALT"),GATE:ee(()=>i(a),"GATE")},{ALT:Knt(),GATE:ee(()=>!i(a),"GATE")}])}else{return n}}if(r==="*"){const o=e.many++;return a=>e.parser.many(o,{DEF:ee(()=>n(a),"DEF"),GATE:i?()=>i(a):void 0})}else if(r==="+"){const o=e.many++;if(i){const a=e.or++;return s=>e.parser.alternatives(a,[{ALT:ee(()=>e.parser.atLeastOne(o,{DEF:ee(()=>n(s),"DEF")}),"ALT"),GATE:ee(()=>i(s),"GATE")},{ALT:Knt(),GATE:ee(()=>!i(s),"GATE")}])}else{return a=>e.parser.atLeastOne(o,{DEF:ee(()=>n(a),"DEF")})}}else if(r==="?"){const o=e.optional++;return a=>e.parser.optional(o,{DEF:ee(()=>n(a),"DEF"),GATE:i?()=>i(a):void 0})}else{gD(r)}}function FRe(e,t){const n=JDn(e,t);const r=e.parser.getRule(n);if(!r)throw new Error(`Rule "${n}" not found."`);return r}function JDn(e,t){if(x6(t)){return t.name}else if(e.ruleNames.has(t)){return e.ruleNames.get(t)}else{let n=t;let r=n.$container;let i=t.$type;while(!lb(r)){if(_6(r)||Uke(r)||Hke(r)){const a=r.elements.indexOf(n);i=a.toString()+":"+i}n=r;r=r.$container}const o=r;i=o.name+":"+i;e.ruleNames.set(t,i);return i}}function Ake(e,t){const n=e.tokens[t];if(!n)throw new Error(`Token "${t}" not found."`);return n}function _at(e){const t=e.Grammar;const n=e.parser.Lexer;const r=new VDn(e);DRe(t,r,n.definition);r.finalize();return r}function Tat(e){const t=wat(e);t.finalize();return t}function wat(e){const t=e.Grammar;const n=e.parser.Lexer;const r=new zDn(e);return DRe(t,r,n.definition)}function ORe(){return new Promise(e=>{if(typeof setImmediate==="undefined"){setTimeout(e,0)}else{setImmediate(e)}})}function BRe(){NAe=performance.now();return new cd.CancellationTokenSource}function Cat(e){QDn=e}function N6(e){return e===mS}async function $m(e){if(e===cd.CancellationToken.None){return}const t=performance.now();if(t-NAe>=QDn){NAe=t;await ORe();NAe=performance.now()}if(e.isCancellationRequested){throw mS}}function Rke(e,t){if(e.length<=1){return e}const n=e.length/2|0;const r=e.slice(0,n);const i=e.slice(n);Rke(r,t);Rke(i,t);let o=0;let a=0;let s=0;while(on.line||t.line===n.line&&t.character>n.character){return{start:n,end:t}}return e}function eFn(e){const t=Aat(e.range);if(t!==e.range){return{newText:e.newText,range:t}}return e}function Rat(e){return typeof e.name==="string"}function Mat(e){return typeof e.$comment==="string"}function srt(e){return typeof e==="object"&&!!e&&("$ref"in e||"$error"in e)}function l6(e){return{code:e}}function Lat(e){if(e.range){return e.range}let t;if(typeof e.property==="string"){t=Kke(e.node.$cstNode,e.property,e.index)}else if(typeof e.keyword==="string"){t=not(e.node.$cstNode,e.keyword,e.index)}t??(t=e.node.$cstNode);if(!t){return{start:{line:0,character:0},end:{line:0,character:0}}}return t.range}function wne(e){switch(e){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+e)}}function Dat(e){switch(e){case"error":return l6(H_.LexingError);case"warning":return l6(H_.LexingWarning);case"info":return l6(H_.LexingInfo);case"hint":return l6(H_.LexingHint);default:throw new Error("Invalid diagnostic severity: "+e)}}function $Re(e){return Array.isArray(e)&&(e.length===0||"name"in e[0])}function GRe(e){return e&&"modes"in e&&"defaultMode"in e}function Mke(e){return!$Re(e)&&!GRe(e)}function Oat(e,t,n){let r;let i;if(typeof e==="string"){i=t;r=n}else{i=e.range.start;r=t}if(!i){i=Yc.create(0,0)}const o=zat(e);const a=HRe(r);const s=EFn({lines:o,position:i,options:a});return AFn({index:0,tokens:s,position:i})}function Bat(e,t){const n=HRe(t);const r=zat(e);if(r.length===0){return false}const i=r[0];const o=r[r.length-1];const a=n.start;const s=n.end;return Boolean(a?.exec(i))&&Boolean(s?.exec(o))}function zat(e){let t="";if(typeof e==="string"){t=e}else{t=e.text}const n=t.split(SSn);return n}function EFn(e){const t=[];let n=e.position.line;let r=e.position.character;for(let i=0;i=s.length){if(t.length>0){const d=Yc.create(n,r);t.push({type:"break",content:"",range:jl.create(d,d)})}}else{TCn.lastIndex=l;const d=TCn.exec(s);if(d){const f=d[0];const h=d[1];const m=Yc.create(n,r+l);const g=Yc.create(n,r+l+f.length);t.push({type:"tag",content:h,range:jl.create(m,g)});l+=f.length;l=Lke(s,l)}if(l0&&t[t.length-1].type==="break"){return t.slice(0,-1)}return t}function CFn(e,t,n,r){const i=[];if(e.length===0){const o=Yc.create(n,r);const a=Yc.create(n,r+t.length);i.push({type:"text",content:t,range:jl.create(o,a)})}else{let o=0;for(const s of e){const l=s.index;const u=t.substring(o,l);if(u.length>0){i.push({type:"text",content:t.substring(o,l),range:jl.create(Yc.create(n,o+r),Yc.create(n,l+r))})}let d=u.length+1;const f=s[1];i.push({type:"inline-tag",content:f,range:jl.create(Yc.create(n,o+d+r),Yc.create(n,o+d+f.length+r))});d+=f.length;if(s.length===4){d+=s[2].length;const h=s[3];i.push({type:"text",content:h,range:jl.create(Yc.create(n,o+d+r),Yc.create(n,o+d+h.length+r))})}else{i.push({type:"text",content:"",range:jl.create(Yc.create(n,o+d+r),Yc.create(n,o+d+r))})}o=l+s[0].length}const a=t.substring(o);if(a.length>0){i.push({type:"text",content:a,range:jl.create(Yc.create(n,o+r),Yc.create(n,o+r+a.length))})}}return i}function Lke(e,t){const n=e.substring(t).match(U8i);if(n){return t+n.index}else{return e.length}}function SFn(e){const t=e.match(V8i);if(t&&typeof t.index==="number"){return t.index}return void 0}function AFn(e){const t=Yc.create(e.position.line,e.position.character);if(e.tokens.length===0){return new wCn([],jl.create(t,t))}const n=[];while(e.index0){const a=Lke(t,r);i=t.substring(a);t=t.substring(0,r)}if(e==="linkcode"||e==="link"&&n.link==="code"){i=`\`${i}\``}const o=n.renderLink?.(t,i)??MFn(t,i);return o}return void 0}function MFn(e,t){try{uv.parse(e,true);return`[${t}](${e})`}catch{return e}}function crt(e){if(e.endsWith("\n")){return"\n"}else{return"\n\n"}}function yc(e){return{documentation:{CommentProvider:ee(t=>new FFn(t),"CommentProvider"),DocumentationProvider:ee(t=>new DFn(t),"DocumentationProvider")},parser:{AsyncParser:ee(t=>new NFn(t),"AsyncParser"),GrammarConfig:ee(t=>uot(t),"GrammarConfig"),LangiumParser:ee(t=>Tat(t),"LangiumParser"),CompletionParser:ee(t=>_at(t),"CompletionParser"),ValueConverter:ee(()=>new Eat,"ValueConverter"),TokenBuilder:ee(()=>new NRe,"TokenBuilder"),Lexer:ee(t=>new Nat(t),"Lexer"),ParserErrorMessageProvider:ee(()=>new bat,"ParserErrorMessageProvider"),LexerErrorMessageProvider:ee(()=>new wFn,"LexerErrorMessageProvider")},workspace:{AstNodeLocator:ee(()=>new bFn,"AstNodeLocator"),AstNodeDescriptionProvider:ee(t=>new gFn(t),"AstNodeDescriptionProvider"),ReferenceDescriptionProvider:ee(t=>new yFn(t),"ReferenceDescriptionProvider")},references:{Linker:ee(t=>new iFn(t),"Linker"),NameProvider:ee(()=>new oFn,"NameProvider"),ScopeProvider:ee(t=>new uFn(t),"ScopeProvider"),ScopeComputation:ee(t=>new sFn(t),"ScopeComputation"),References:ee(t=>new aFn(t),"References")},serializer:{Hydrator:ee(t=>new BFn(t),"Hydrator"),JsonSerializer:ee(t=>new dFn(t),"JsonSerializer")},validation:{DocumentValidator:ee(t=>new mFn(t),"DocumentValidator"),ValidationRegistry:ee(t=>new hFn(t),"ValidationRegistry")},shared:ee(()=>e.shared,"shared")}}function bc(e){return{ServiceRegistry:ee(t=>new fFn(t),"ServiceRegistry"),workspace:{LangiumDocuments:ee(t=>new rFn(t),"LangiumDocuments"),LangiumDocumentFactory:ee(t=>new nFn(t),"LangiumDocumentFactory"),DocumentBuilder:ee(t=>new vFn(t),"DocumentBuilder"),IndexManager:ee(t=>new _Fn(t),"IndexManager"),WorkspaceManager:ee(t=>new TFn(t),"WorkspaceManager"),FileSystemProvider:ee(t=>e.fileSystemProvider(t),"FileSystemProvider"),WorkspaceLock:ee(()=>new OFn,"WorkspaceLock"),ConfigurationProvider:ee(t=>new xFn(t),"ConfigurationProvider")},profilers:{}}}function us(e,t,n,r,i,o,a,s,l){const u=[e,t,n,r,i,o,a,s,l].reduce(QG,{});return Hat(u)}function Gat(e){if(e&&e[zFn]){for(const t of Object.values(e)){Gat(t)}}return e}function Hat(e,t){const n=new Proxy({},{deleteProperty:ee(()=>false,"deleteProperty"),set:ee(()=>{throw new Error("Cannot set property on injected service container")},"set"),get:ee((r,i)=>{if(i===zFn){return true}else{return drt(r,i,e,t||n)}},"get"),getOwnPropertyDescriptor:ee((r,i)=>(drt(r,i,e,t||n),Object.getOwnPropertyDescriptor(r,i)),"getOwnPropertyDescriptor"),has:ee((r,i)=>i in e,"has"),ownKeys:ee(()=>[...Object.getOwnPropertyNames(e)],"ownKeys")});return n}function drt(e,t,n,r){if(t in e){if(e[t]instanceof Error){throw new Error("Construction failure. Please make sure that your dependencies are constructable. Cause: "+e[t])}if(e[t]===ECn){throw new Error('Cycle detected. Please make "'+String(t)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies')}return e[t]}else if(t in n){const i=n[t];e[t]=ECn;try{e[t]=typeof i==="function"?i(r):Hat(i,r)}catch(o){e[t]=o instanceof Error?o:void 0;throw o}return e[t]}else{return void 0}}function QG(e,t){if(t){for(const[n,r]of Object.entries(t)){if(r!==void 0&&r!==null){if(typeof r==="object"){const i=e[n];if(typeof i==="object"&&i!==null){e[n]=QG(i,r)}else{e[n]=QG({},r)}}else{e[n]=r}}}}return e}function $Fn(){const e=us(bc(Rc),Y8i);const t=us(yc({shared:e}),W8i);e.ServiceRegistry.register(t);return t}function Gm(e){const t=$Fn();const n=t.serializer.JsonSerializer.deserialize(e);t.shared.workspace.LangiumDocumentFactory.fromModel(n,uv.parse(`memory:/${n.name??"grammar"}.langium`));return n}function HFn(e){return vh.isInstance(e,Bw.$type)}function WFn(e){return vh.isInstance(e,Ene.$type)}function YFn(e){return vh.isInstance(e,ZB.$type)}function qFn(e){return vh.isInstance(e,sD.$type)}function XFn(e){return vh.isInstance(e,Cne.$type)}function jFn(e){return vh.isInstance(e,Dke.$type)}function KFn(e){return e==="rmo"||e==="readmodel"||e==="ui"||e==="cmd"||e==="command"||e==="evt"||e==="event"||e==="pcr"||e==="processor"}function WRe(e){return vh.isInstance(e,GR.$type)}function ZFn(e){return vh.isInstance(e,lD.$type)}function JFn(e){return vh.isInstance(e,OG.$type)}function QFn(e){return vh.isInstance(e,JB.$type)}function e4n(e){return vh.isInstance(e,QB.$type)}function t4n(e){return vh.isInstance(e,e6.$type)}function n4n(e){return vh.isInstance(e,cD.$type)}function r4n(e){return vh.isInstance(e,Sne.$type)}function i4n(e){return vh.isInstance(e,t6.$type)}function o4n(e){return vh.isInstance(e,n6.$type)}function a4n(e){return vh.isInstance(e,r6.$type)}function s4n(e){return vh.isInstance(e,i6.$type)}function l4n(e){return vh.isInstance(e,BG.$type)}function c4n(e){return vh.isInstance(e,o6.$type)}function u4n(e){return vh.isInstance(e,Um.$type)}var IIi,Hne,MIi,sit,LIi,DIi,ee,FIi,Os,mD,YAe,Fke,lit,cit,Nke,Rtt,yAe,Ptt,Zte,Yc,jl,Jte,Itt,bAe,Mtt,Ltt,Dtt,Ftt,xAe,Ntt,Ott,Btt,Qte,RB,lS,PB,Lg,VR,ene,vG,_G,TG,vAe,$te,stt,HCn,ztt,Utt,tne,Vtt,_Ae,wG,$tt,Gtt,Htt,Wtt,Ytt,qtt,Xtt,jtt,nne,Ktt,Ztt,Jtt,Qtt,ent,tnt,nnt,rnt,int,ont,ant,rne,snt,lnt,cnt,unt,dnt,fnt,hnt,pnt,mnt,gnt,ynt,bnt,xnt,TAe,wAe,vnt,_nt,Tnt,wnt,Ent,Cnt,Snt,Ant,WCn,knt,Q2n,$r,Wne,g6,Yne,eH,Oke,qCn,jCn,NIi,OIi,KCn,BIi,zIi,UIi,VIi,Rnt,$Ii,tH,eEn,Rf,uit,GIi,HIi,WIi,YIi,qIi,XIi,jIi,KIi,ZIi,JIi,QIi,e3i,t3i,n3i,r3i,i3i,o3i,a3i,s3i,l3i,c3i,u3i,d3i,f3i,h3i,Og,dit,hit,pS,GG,ib,HG,kne,pit,tSn,p3i,Sx,cne,RG,cv,nD,une,KAe,ZAe,rD,JAe,iD,oD,dne,aD,fne,QAe,HR,eke,UB,tke,dS,hne,nke,PG,IG,MG,VB,rke,ike,LG,oke,Ow,pne,$B,ake,GB,DG,ske,HB,Ax,WB,WR,YB,mne,qB,XB,lke,gne,jB,KB,FG,Fit,Va,hS,zit,Hit,Yke,Yit,uke,dke,tEn,m3i,QSe,g3i,CSn,qke,SSn,ASn,y3i,a6,RSn,cot,b3i,$Sn,x3i,v3i,xS,_3i,Y_,GSn,T3i,w3i,Gte,E3i,C3i,S3i,A3i,k3i,R3i,nEn,yD,Ww,P3i,eRe,Jne,I3i,gc,M3i,rEn,iEn,L3i,D3i,F3i,N3i,O3i,q_,oEn,B3i,z3i,U3i,V3i,$3i,aEn,G3i,H3i,Qne,ere,W3i,Y3i,q3i,X3i,iP,j3i,ltt,sEn,K3i,Z3i,J3i,w6,Q3i,eMi,tMi,nMi,rMi,iMi,oMi,aMi,sMi,E6,lMi,Mnt,lEn,cMi,uMi,dMi,Vm,fMi,hMi,pMi,mMi,gMi,yMi,bMi,hke,xMi,vMi,_Mi,TMi,mAn,yAn,wMi,EMi,fot,TAn,CMi,SMi,tRe,hot,tre,AMi,kMi,nRe,nre,cEn,RMi,pot,PMi,mot,vS,rRe,IMi,MMi,rre,LMi,DMi,uEn,OAn,FMi,NMi,OMi,iRe,BMi,zAn,dEn,zMi,fEn,UMi,VMi,Pne,$Mi,GMi,HMi,WMi,YMi,qMi,XMi,jMi,KMi,ZMi,JMi,QMi,eLi,tLi,nLi,rLi,iLi,oLi,aLi,sLi,lLi,cLi,uLi,dLi,Bd,fLi,ire,$An,yne,hLi,ctt,pLi,dD,hEn,mLi,got,gLi,yLi,HAn,YAn,bLi,xLi,vLi,_Li,XAn,dv,TLi,wLi,ELi,fv,CLi,SLi,ALi,kLi,oRe,RLi,PLi,yot,ILi,Ine,MLi,LLi,DLi,FLi,NLi,OLi,BLi,zLi,ULi,VLi,$Li,pEn,GLi,aRe,HLi,WLi,YLi,qLi,XLi,jLi,sRe,KLi,Mne,ZLi,JLi,lRe,QLi,eDi,tDi,nDi,cRe,rDi,iDi,oDi,aDi,sDi,lDi,cDi,uDi,dDi,dRe,fDi,ore,bot,hDi,xot,mEn,pDi,_ot,Gw,mDi,Akn,Rkn,gDi,yDi,bDi,xDi,vDi,_Di,TDi,bne,wDi,EDi,Bkn,gEn,CDi,yEn,bEn,SDi,Tot,$kn,ADi,kDi,xEn,RDi,wot,PDi,IDi,MDi,Hkn,LDi,qkn,Lnt,Kkn,DDi,Dnt,FDi,Fnt,NDi,UG,vEn,ODi,_En,TEn,wEn,EEn,BDi,zDi,UDi,VDi,$Di,MB,KG,GDi,HDi,WDi,YDi,pke,Eot,qDi,XDi,jDi,CEn,SEn,KDi,ZDi,JDi,QDi,eFi,tFi,nFi,rFi,iFi,oFi,aFi,sFi,lFi,cFi,uFi,dFi,fFi,hFi,pFi,mFi,gFi,yFi,bFi,xFi,vFi,AEn,_Fi,TFi,wFi,EFi,kEn,CFi,SFi,AFi,kFi,RFi,sRn,PFi,IFi,MFi,LFi,lRn,DFi,FFi,NFi,cRn,OFi,BFi,zFi,UFi,VFi,$Fi,GFi,HFi,WFi,YFi,qFi,XFi,jFi,KFi,ZFi,JFi,ld,QFi,e4i,Ng,are,t4i,n4i,r4i,Cot,mRn,Sot,i4i,o4i,bRn,a4i,Aot,s4i,l4i,c4i,u4i,d4i,f4i,h4i,p4i,m4i,g4i,y4i,b4i,x4i,REn,utt,v4i,_4i,T4i,w4i,E4i,C4i,PEn,IEn,eAe,S4i,MEn,A4i,ERn,k4i,R4i,P4i,ARn,I4i,PRn,M4i,L4i,DRn,D4i,F4i,N4i,O4i,B4i,z4i,U4i,_S,V4i,$4i,G4i,H4i,W4i,Y4i,q4i,R6,X4i,j4i,qRn,K4i,Z4i,Rot,LEn,KRn,J4i,Q4i,eNi,fRe,h6,Dg,Dne,tNi,cs,nNi,rNi,Hw,sPn,j_,iNi,oNi,aNi,sNi,ZG,Yw,lNi,fa,W_,cNi,uNi,dNi,fNi,hNi,pNi,mNi,qa,gNi,kx,yNi,Vp,bNi,fb,xNi,DEn,vNi,_Ni,TNi,wNi,ud,ENi,CNi,FEn,SNi,ZR,JR,ANi,kNi,RNi,PNi,qw,INi,hv,hRe,MNi,DPn,LNi,DNi,FNi,NNi,ONi,Pot,TS,cb,rH,Rx,Fg,pv,mv,Zf,Px,Ix,Ud,iH,pRe,WPn,BNi,AAe,zNi,jPn,gke,UNi,p6,ane,tAe,VNi,$Ni,GNi,sne,RAe,NEn,vIn,Unt,Jf,lne,sb,HNi,OEn,BEn,zEn,UEn,VEn,$En,GEn,HEn,fD,NG,WNi,s6,YNi,qNi,XNi,gRe,jNi,WEn,KNi,YEn,kf,ZNi,FIn,JNi,Yot,QNi,QIn,e3n,t3n,n3n,r3n,bRe,i3n,eOi,tOi,nOi,dtt,o3n,rOi,iOi,oOi,bD,aOi,s3n,l3n,Gnt,Hnt,Wnt,IAe,Yza,qot,sOi,lOi,nAe,cOi,Xnt,uOi,dOi,fOi,hOi,pOi,mOi,xRe,qEn,XEn,y3n,b3n,gOi,yOi,bOi,_ke,eP,Tke,ub,jot,xOi,w3n,vOi,S3n,vRe,_Oi,TOi,wOi,EOi,COi,SOi,_Re,AOi,kOi,ROi,POi,IOi,N3n,MOi,LOi,oP,DOi,bS,O3n,FOi,NOi,Hte,OOi,BOi,zOi,UOi,VOi,$Oi,jEn,lH,Kot,GOi,HOi,WOi,YOi,G3n,qOi,ftt,KEn,XOi,jOi,KOi,I6,ZOi,JOi,QOi,e5i,t5i,n5i,r5i,i5i,o5i,cH,a5i,zne,s5i,Une,l5i,c5i,u5i,d5i,f5i,h5i,p5i,m5i,g5i,y5i,b5i,ZEn,x5i,v5i,TRe,_5i,T5i,w5i,E5i,wRe,C5i,S5i,LAe,A5i,k5i,R5i,uMn,P5i,hMn,I5i,M5i,mMn,L5i,JEn,D5i,Zot,F5i,N5i,O5i,B5i,z5i,U5i,V5i,$5i,G5i,H5i,W5i,Y5i,q5i,QEn,htt,X5i,vMn,j5i,db,K5i,wMn,Z5i,J5i,Q5i,eCn,eBi,tBi,nBi,JG,rBi,tCn,kMn,iBi,oBi,aBi,ERe,sBi,PMn,nCn,lBi,rCn,cBi,uBi,wke,dBi,fBi,MMn,hBi,Jot,pBi,mBi,gBi,yBi,bBi,xBi,vBi,_Bi,TBi,wBi,EBi,CBi,SBi,ABi,kBi,RBi,PBi,IBi,MBi,LBi,DBi,FBi,NBi,OBi,zd,BBi,zBi,NMn,Tne,UBi,ptt,VBi,iCn,oCn,$Bi,Qot,GBi,HBi,WBi,YBi,zMn,qBi,XBi,jBi,KBi,ZBi,$Mn,CRe,eat,aCn,JBi,QBi,e6i,t6i,n6i,Znt,r6i,Jnt,i6i,$G,o6i,Qnt,sCn,a6i,lCn,cCn,uCn,dCn,s6i,l6i,c6i,u6i,d6i,LB,ert,f6i,fCn,hCn,rAe,h6i,pCn,p6i,XMn,m6i,g6i,y6i,ZMn,b6i,eLn,x6i,v6i,SRe,_6i,T6i,nat,w6i,E6i,C6i,S6i,A6i,k6i,R6i,P6i,I6i,mCn,gCn,M6i,L6i,sLn,D6i,kRe,uLn,F6i,N6i,O6i,B6i,z6i,U6i,V6i,iat,$6i,G6i,H6i,RRe,W6i,Y6i,q6i,X6i,j6i,K6i,PRe,Z6i,YR,J6i,Q6i,hD,e8i,kLn,RLn,dre,t8i,n8i,r8i,i8i,PLn,oat,aat,ILn,sat,Eke,trt,o8i,a8i,s8i,yCn,l8i,KLn,c8i,u8i,d8i,f8i,h8i,p8i,m8i,g8i,y8i,b8i,x8i,v8i,_8i,T8i,w8i,E8i,C8i,mtt,S8i,A8i,k8i,R8i,P8i,I8i,M8i,bCn,gDn,xCn,L8i,NDn,mat,Cke,LRe,D8i,gat,Ske,vCn,BDn,yat,zDn,UDn,bat,VDn,F8i,$Dn,N8i,NRe,Eat,fS,cd,NAe,QDn,mS,tP,_Cn,kke,tFn,uv,Wte,ab,kat,Sl,nFn,rFn,DB,iFn,oFn,aFn,nP,Pke,sFn,art,O8i,lFn,B8i,zRe,Pat,URe,cFn,Iat,uFn,dFn,fFn,Ike,hFn,pFn,mFn,H_,gFn,yFn,bFn,VRe,xFn,iAe,d6,vFn,_Fn,TFn,wFn,Fat,Nat,TCn,z8i,U8i,V8i,wCn,gtt,lrt,LFn,DFn,FFn,NFn,$8i,G8i,OFn,BFn,urt,zFn,ECn,frt,c6,UFn,H8i,Wat,VFn,Rc,W8i,Y8i,q8i,GFn,hrt,prt,mrt,grt,yrt,brt,xrt,vrt,_rt,Trt,wrt,Ert,Crt,Srt,Art,qza,krt,Rrt,BAe,Prt,Irt,Mrt,FB,zAe,Lrt,Drt,oAe,ytt,aAe,Yte,btt,Bw,sAe,Ene,CCn,lAe,xtt,ZB,cAe,AB,uAe,sD,dAe,SCn,bG,Cne,Dke,Frt,Nrt,Ort,Brt,zrt,Urt,Vrt,SG,QL,$rt,UAe,Grt,Hrt,VAe,Wrt,Yrt,sS,NB,eD,qte,ACn,vtt,fAe,GR,JL,_tt,cS,kCn,hAe,Ttt,lD,Xte,OG,jte,wtt,Kte,pAe,kB,JB,mAe,Ett,QB,e6,qrt,Xrt,jrt,Krt,Zrt,$Ae,AG,GAe,Jrt,HAe,cD,Sne,Ctt,gAe,tD,t6,n6,Qrt,r6,uS,eit,tit,nit,i6,WAe,rit,iit,oit,ait,Stt,xG,Att,OB,BG,o6,ktt,BB,kG,Um,d4n,vh,RCn,X8i,PCn,j8i,ICn,K8i,MCn,Z8i,LCn,J8i,DCn,Q8i,FCn,e7i,NCn,t7i,OCn,n7i,BCn,r7i,zCn,i7i,UCn,o7i,VCn,a7i,$Cn,s7i,GCn,l7i,c7i,u7i,d7i,f7i,h7i,p7i,m7i,g7i,y7i,b7i,x7i,v7i,_7i,T7i,w7i,qc,Yat,qat,Xat,jat,Kat,Zat,Jat,Qat,est,tst,nst,rst,ist,ost,ast,E7i,C7i,S7i,A7i,op,gv,ru,k7i;var Pc=Ce(()=>{IIi=Object.create;Hne=Object.defineProperty;MIi=Object.getOwnPropertyDescriptor;sit=Object.getOwnPropertyNames;LIi=Object.getPrototypeOf;DIi=Object.prototype.hasOwnProperty;ee=(e,t)=>Hne(e,"name",{value:t,configurable:true});FIi=(e,t)=>function n(){return e&&(t=(0,e[sit(e)[0]])(e=0)),t};Os=(e,t)=>function n(){return t||(0,e[sit(e)[0]])((t={exports:{}}).exports,t),t.exports};mD=(e,t)=>{for(var n in t)Hne(e,n,{get:t[n],enumerable:true})};YAe=(e,t,n,r)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let i of sit(t))if(!DIi.call(e,i)&&i!==n)Hne(e,i,{get:()=>t[i],enumerable:!(r=MIi(t,i))||r.enumerable})}return e};Fke=(e,t,n)=>(YAe(e,t,"default"),n&&YAe(n,t,"default"));lit=(e,t,n)=>(n=e!=null?IIi(LIi(e)):{},YAe(t||!e||!e.__esModule?Hne(n,"default",{value:e,enumerable:true}):n,e));cit=e=>YAe(Hne({},"__esModule",{value:true}),e);Nke={};mD(Nke,{AnnotatedTextEdit:()=>VR,ChangeAnnotation:()=>PB,ChangeAnnotationIdentifier:()=>Lg,CodeAction:()=>lnt,CodeActionContext:()=>snt,CodeActionKind:()=>ant,CodeActionTriggerKind:()=>rne,CodeDescription:()=>Btt,CodeLens:()=>cnt,Color:()=>bAe,ColorInformation:()=>Mtt,ColorPresentation:()=>Ltt,Command:()=>RB,CompletionItem:()=>Xtt,CompletionItemKind:()=>$tt,CompletionItemLabelDetails:()=>qtt,CompletionItemTag:()=>Htt,CompletionList:()=>jtt,CreateFile:()=>vG,DeleteFile:()=>TG,Diagnostic:()=>Qte,DiagnosticRelatedInformation:()=>xAe,DiagnosticSeverity:()=>Ntt,DiagnosticTag:()=>Ott,DocumentHighlight:()=>ent,DocumentHighlightKind:()=>Qtt,DocumentLink:()=>dnt,DocumentSymbol:()=>ont,DocumentUri:()=>Rtt,EOL:()=>WCn,FoldingRange:()=>Ftt,FoldingRangeKind:()=>Dtt,FormattingOptions:()=>unt,Hover:()=>Ktt,InlayHint:()=>vnt,InlayHintKind:()=>TAe,InlayHintLabelPart:()=>wAe,InlineCompletionContext:()=>Snt,InlineCompletionItem:()=>Tnt,InlineCompletionList:()=>wnt,InlineCompletionTriggerKind:()=>Ent,InlineValueContext:()=>xnt,InlineValueEvaluatableExpression:()=>bnt,InlineValueText:()=>gnt,InlineValueVariableLookup:()=>ynt,InsertReplaceEdit:()=>Wtt,InsertTextFormat:()=>Gtt,InsertTextMode:()=>Ytt,Location:()=>Jte,LocationLink:()=>Itt,MarkedString:()=>nne,MarkupContent:()=>wG,MarkupKind:()=>_Ae,OptionalVersionedTextDocumentIdentifier:()=>tne,ParameterInformation:()=>Ztt,Position:()=>Yc,Range:()=>jl,RenameFile:()=>_G,SelectedCompletionInfo:()=>Cnt,SelectionRange:()=>fnt,SemanticTokenModifiers:()=>pnt,SemanticTokenTypes:()=>hnt,SemanticTokens:()=>mnt,SignatureInformation:()=>Jtt,StringValue:()=>_nt,SymbolInformation:()=>rnt,SymbolKind:()=>tnt,SymbolTag:()=>nnt,TextDocument:()=>knt,TextDocumentEdit:()=>ene,TextDocumentIdentifier:()=>ztt,TextDocumentItem:()=>Vtt,TextEdit:()=>lS,URI:()=>yAe,VersionedTextDocumentIdentifier:()=>Utt,WorkspaceChange:()=>HCn,WorkspaceEdit:()=>vAe,WorkspaceFolder:()=>Ant,WorkspaceSymbol:()=>int,integer:()=>Ptt,uinteger:()=>Zte});Wne=FIi({"../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"(){"use strict";(function(e){function t(n){return typeof n==="string"}ee(t,"is");e.is=t})(Rtt||(Rtt={}));(function(e){function t(n){return typeof n==="string"}ee(t,"is");e.is=t})(yAe||(yAe={}));(function(e){e.MIN_VALUE=-2147483648;e.MAX_VALUE=2147483647;function t(n){return typeof n==="number"&&e.MIN_VALUE<=n&&n<=e.MAX_VALUE}ee(t,"is");e.is=t})(Ptt||(Ptt={}));(function(e){e.MIN_VALUE=0;e.MAX_VALUE=2147483647;function t(n){return typeof n==="number"&&e.MIN_VALUE<=n&&n<=e.MAX_VALUE}ee(t,"is");e.is=t})(Zte||(Zte={}));(function(e){function t(r,i){if(r===Number.MAX_VALUE){r=Zte.MAX_VALUE}if(i===Number.MAX_VALUE){i=Zte.MAX_VALUE}return{line:r,character:i}}ee(t,"create");e.create=t;function n(r){let i=r;return $r.objectLiteral(i)&&$r.uinteger(i.line)&&$r.uinteger(i.character)}ee(n,"is");e.is=n})(Yc||(Yc={}));(function(e){function t(r,i,o,a){if($r.uinteger(r)&&$r.uinteger(i)&&$r.uinteger(o)&&$r.uinteger(a)){return{start:Yc.create(r,i),end:Yc.create(o,a)}}else if(Yc.is(r)&&Yc.is(i)){return{start:r,end:i}}else{throw new Error(`Range#create called with invalid arguments[${r}, ${i}, ${o}, ${a}]`)}}ee(t,"create");e.create=t;function n(r){let i=r;return $r.objectLiteral(i)&&Yc.is(i.start)&&Yc.is(i.end)}ee(n,"is");e.is=n})(jl||(jl={}));(function(e){function t(r,i){return{uri:r,range:i}}ee(t,"create");e.create=t;function n(r){let i=r;return $r.objectLiteral(i)&&jl.is(i.range)&&($r.string(i.uri)||$r.undefined(i.uri))}ee(n,"is");e.is=n})(Jte||(Jte={}));(function(e){function t(r,i,o,a){return{targetUri:r,targetRange:i,targetSelectionRange:o,originSelectionRange:a}}ee(t,"create");e.create=t;function n(r){let i=r;return $r.objectLiteral(i)&&jl.is(i.targetRange)&&$r.string(i.targetUri)&&jl.is(i.targetSelectionRange)&&(jl.is(i.originSelectionRange)||$r.undefined(i.originSelectionRange))}ee(n,"is");e.is=n})(Itt||(Itt={}));(function(e){function t(r,i,o,a){return{red:r,green:i,blue:o,alpha:a}}ee(t,"create");e.create=t;function n(r){const i=r;return $r.objectLiteral(i)&&$r.numberRange(i.red,0,1)&&$r.numberRange(i.green,0,1)&&$r.numberRange(i.blue,0,1)&&$r.numberRange(i.alpha,0,1)}ee(n,"is");e.is=n})(bAe||(bAe={}));(function(e){function t(r,i){return{range:r,color:i}}ee(t,"create");e.create=t;function n(r){const i=r;return $r.objectLiteral(i)&&jl.is(i.range)&&bAe.is(i.color)}ee(n,"is");e.is=n})(Mtt||(Mtt={}));(function(e){function t(r,i,o){return{label:r,textEdit:i,additionalTextEdits:o}}ee(t,"create");e.create=t;function n(r){const i=r;return $r.objectLiteral(i)&&$r.string(i.label)&&($r.undefined(i.textEdit)||lS.is(i))&&($r.undefined(i.additionalTextEdits)||$r.typedArray(i.additionalTextEdits,lS.is))}ee(n,"is");e.is=n})(Ltt||(Ltt={}));(function(e){e.Comment="comment";e.Imports="imports";e.Region="region"})(Dtt||(Dtt={}));(function(e){function t(r,i,o,a,s,l){const u={startLine:r,endLine:i};if($r.defined(o)){u.startCharacter=o}if($r.defined(a)){u.endCharacter=a}if($r.defined(s)){u.kind=s}if($r.defined(l)){u.collapsedText=l}return u}ee(t,"create");e.create=t;function n(r){const i=r;return $r.objectLiteral(i)&&$r.uinteger(i.startLine)&&$r.uinteger(i.startLine)&&($r.undefined(i.startCharacter)||$r.uinteger(i.startCharacter))&&($r.undefined(i.endCharacter)||$r.uinteger(i.endCharacter))&&($r.undefined(i.kind)||$r.string(i.kind))}ee(n,"is");e.is=n})(Ftt||(Ftt={}));(function(e){function t(r,i){return{location:r,message:i}}ee(t,"create");e.create=t;function n(r){let i=r;return $r.defined(i)&&Jte.is(i.location)&&$r.string(i.message)}ee(n,"is");e.is=n})(xAe||(xAe={}));(function(e){e.Error=1;e.Warning=2;e.Information=3;e.Hint=4})(Ntt||(Ntt={}));(function(e){e.Unnecessary=1;e.Deprecated=2})(Ott||(Ott={}));(function(e){function t(n){const r=n;return $r.objectLiteral(r)&&$r.string(r.href)}ee(t,"is");e.is=t})(Btt||(Btt={}));(function(e){function t(r,i,o,a,s,l){let u={range:r,message:i};if($r.defined(o)){u.severity=o}if($r.defined(a)){u.code=a}if($r.defined(s)){u.source=s}if($r.defined(l)){u.relatedInformation=l}return u}ee(t,"create");e.create=t;function n(r){var i;let o=r;return $r.defined(o)&&jl.is(o.range)&&$r.string(o.message)&&($r.number(o.severity)||$r.undefined(o.severity))&&($r.integer(o.code)||$r.string(o.code)||$r.undefined(o.code))&&($r.undefined(o.codeDescription)||$r.string((i=o.codeDescription)===null||i===void 0?void 0:i.href))&&($r.string(o.source)||$r.undefined(o.source))&&($r.undefined(o.relatedInformation)||$r.typedArray(o.relatedInformation,xAe.is))}ee(n,"is");e.is=n})(Qte||(Qte={}));(function(e){function t(r,i,...o){let a={title:r,command:i};if($r.defined(o)&&o.length>0){a.arguments=o}return a}ee(t,"create");e.create=t;function n(r){let i=r;return $r.defined(i)&&$r.string(i.title)&&$r.string(i.command)}ee(n,"is");e.is=n})(RB||(RB={}));(function(e){function t(o,a){return{range:o,newText:a}}ee(t,"replace");e.replace=t;function n(o,a){return{range:{start:o,end:o},newText:a}}ee(n,"insert");e.insert=n;function r(o){return{range:o,newText:""}}ee(r,"del");e.del=r;function i(o){const a=o;return $r.objectLiteral(a)&&$r.string(a.newText)&&jl.is(a.range)}ee(i,"is");e.is=i})(lS||(lS={}));(function(e){function t(r,i,o){const a={label:r};if(i!==void 0){a.needsConfirmation=i}if(o!==void 0){a.description=o}return a}ee(t,"create");e.create=t;function n(r){const i=r;return $r.objectLiteral(i)&&$r.string(i.label)&&($r.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&($r.string(i.description)||i.description===void 0)}ee(n,"is");e.is=n})(PB||(PB={}));(function(e){function t(n){const r=n;return $r.string(r)}ee(t,"is");e.is=t})(Lg||(Lg={}));(function(e){function t(o,a,s){return{range:o,newText:a,annotationId:s}}ee(t,"replace");e.replace=t;function n(o,a,s){return{range:{start:o,end:o},newText:a,annotationId:s}}ee(n,"insert");e.insert=n;function r(o,a){return{range:o,newText:"",annotationId:a}}ee(r,"del");e.del=r;function i(o){const a=o;return lS.is(a)&&(PB.is(a.annotationId)||Lg.is(a.annotationId))}ee(i,"is");e.is=i})(VR||(VR={}));(function(e){function t(r,i){return{textDocument:r,edits:i}}ee(t,"create");e.create=t;function n(r){let i=r;return $r.defined(i)&&tne.is(i.textDocument)&&Array.isArray(i.edits)}ee(n,"is");e.is=n})(ene||(ene={}));(function(e){function t(r,i,o){let a={kind:"create",uri:r};if(i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)){a.options=i}if(o!==void 0){a.annotationId=o}return a}ee(t,"create");e.create=t;function n(r){let i=r;return i&&i.kind==="create"&&$r.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||$r.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||$r.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Lg.is(i.annotationId))}ee(n,"is");e.is=n})(vG||(vG={}));(function(e){function t(r,i,o,a){let s={kind:"rename",oldUri:r,newUri:i};if(o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)){s.options=o}if(a!==void 0){s.annotationId=a}return s}ee(t,"create");e.create=t;function n(r){let i=r;return i&&i.kind==="rename"&&$r.string(i.oldUri)&&$r.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||$r.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||$r.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Lg.is(i.annotationId))}ee(n,"is");e.is=n})(_G||(_G={}));(function(e){function t(r,i,o){let a={kind:"delete",uri:r};if(i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)){a.options=i}if(o!==void 0){a.annotationId=o}return a}ee(t,"create");e.create=t;function n(r){let i=r;return i&&i.kind==="delete"&&$r.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||$r.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||$r.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||Lg.is(i.annotationId))}ee(n,"is");e.is=n})(TG||(TG={}));(function(e){function t(n){let r=n;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(i=>{if($r.string(i.kind)){return vG.is(i)||_G.is(i)||TG.is(i)}else{return ene.is(i)}}))}ee(t,"is");e.is=t})(vAe||(vAe={}));$te=class{static{ee(this,"TextEditChangeImpl")}constructor(e,t){this.edits=e;this.changeAnnotations=t}insert(e,t,n){let r;let i;if(n===void 0){r=lS.insert(e,t)}else if(Lg.is(n)){i=n;r=VR.insert(e,t,n)}else{this.assertChangeAnnotations(this.changeAnnotations);i=this.changeAnnotations.manage(n);r=VR.insert(e,t,i)}this.edits.push(r);if(i!==void 0){return i}}replace(e,t,n){let r;let i;if(n===void 0){r=lS.replace(e,t)}else if(Lg.is(n)){i=n;r=VR.replace(e,t,n)}else{this.assertChangeAnnotations(this.changeAnnotations);i=this.changeAnnotations.manage(n);r=VR.replace(e,t,i)}this.edits.push(r);if(i!==void 0){return i}}delete(e,t){let n;let r;if(t===void 0){n=lS.del(e)}else if(Lg.is(t)){r=t;n=VR.del(e,t)}else{this.assertChangeAnnotations(this.changeAnnotations);r=this.changeAnnotations.manage(t);n=VR.del(e,r)}this.edits.push(n);if(r!==void 0){return r}}add(e){this.edits.push(e)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(e){if(e===void 0){throw new Error(`Text edit change is not configured to manage change annotations.`)}}};stt=class{static{ee(this,"ChangeAnnotations")}constructor(e){this._annotations=e===void 0?Object.create(null):e;this._counter=0;this._size=0}all(){return this._annotations}get size(){return this._size}manage(e,t){let n;if(Lg.is(e)){n=e}else{n=this.nextId();t=e}if(this._annotations[n]!==void 0){throw new Error(`Id ${n} is already in use.`)}if(t===void 0){throw new Error(`No annotation provided for id ${n}`)}this._annotations[n]=t;this._size++;return n}nextId(){this._counter++;return this._counter.toString()}};HCn=class{static{ee(this,"WorkspaceChange")}constructor(e){this._textEditChanges=Object.create(null);if(e!==void 0){this._workspaceEdit=e;if(e.documentChanges){this._changeAnnotations=new stt(e.changeAnnotations);e.changeAnnotations=this._changeAnnotations.all();e.documentChanges.forEach(t=>{if(ene.is(t)){const n=new $te(t.edits,this._changeAnnotations);this._textEditChanges[t.textDocument.uri]=n}})}else if(e.changes){Object.keys(e.changes).forEach(t=>{const n=new $te(e.changes[t]);this._textEditChanges[t]=n})}}else{this._workspaceEdit={}}}get edit(){this.initDocumentChanges();if(this._changeAnnotations!==void 0){if(this._changeAnnotations.size===0){this._workspaceEdit.changeAnnotations=void 0}else{this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()}}return this._workspaceEdit}getTextEditChange(e){if(tne.is(e)){this.initDocumentChanges();if(this._workspaceEdit.documentChanges===void 0){throw new Error("Workspace edit is not configured for document changes.")}const t={uri:e.uri,version:e.version};let n=this._textEditChanges[t.uri];if(!n){const r=[];const i={textDocument:t,edits:r};this._workspaceEdit.documentChanges.push(i);n=new $te(r,this._changeAnnotations);this._textEditChanges[t.uri]=n}return n}else{this.initChanges();if(this._workspaceEdit.changes===void 0){throw new Error("Workspace edit is not configured for normal text edit changes.")}let t=this._textEditChanges[e];if(!t){let n=[];this._workspaceEdit.changes[e]=n;t=new $te(n);this._textEditChanges[e]=t}return t}}initDocumentChanges(){if(this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0){this._changeAnnotations=new stt;this._workspaceEdit.documentChanges=[];this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()}}initChanges(){if(this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0){this._workspaceEdit.changes=Object.create(null)}}createFile(e,t,n){this.initDocumentChanges();if(this._workspaceEdit.documentChanges===void 0){throw new Error("Workspace edit is not configured for document changes.")}let r;if(PB.is(t)||Lg.is(t)){r=t}else{n=t}let i;let o;if(r===void 0){i=vG.create(e,n)}else{o=Lg.is(r)?r:this._changeAnnotations.manage(r);i=vG.create(e,n,o)}this._workspaceEdit.documentChanges.push(i);if(o!==void 0){return o}}renameFile(e,t,n,r){this.initDocumentChanges();if(this._workspaceEdit.documentChanges===void 0){throw new Error("Workspace edit is not configured for document changes.")}let i;if(PB.is(n)||Lg.is(n)){i=n}else{r=n}let o;let a;if(i===void 0){o=_G.create(e,t,r)}else{a=Lg.is(i)?i:this._changeAnnotations.manage(i);o=_G.create(e,t,r,a)}this._workspaceEdit.documentChanges.push(o);if(a!==void 0){return a}}deleteFile(e,t,n){this.initDocumentChanges();if(this._workspaceEdit.documentChanges===void 0){throw new Error("Workspace edit is not configured for document changes.")}let r;if(PB.is(t)||Lg.is(t)){r=t}else{n=t}let i;let o;if(r===void 0){i=TG.create(e,n)}else{o=Lg.is(r)?r:this._changeAnnotations.manage(r);i=TG.create(e,n,o)}this._workspaceEdit.documentChanges.push(i);if(o!==void 0){return o}}};(function(e){function t(r){return{uri:r}}ee(t,"create");e.create=t;function n(r){let i=r;return $r.defined(i)&&$r.string(i.uri)}ee(n,"is");e.is=n})(ztt||(ztt={}));(function(e){function t(r,i){return{uri:r,version:i}}ee(t,"create");e.create=t;function n(r){let i=r;return $r.defined(i)&&$r.string(i.uri)&&$r.integer(i.version)}ee(n,"is");e.is=n})(Utt||(Utt={}));(function(e){function t(r,i){return{uri:r,version:i}}ee(t,"create");e.create=t;function n(r){let i=r;return $r.defined(i)&&$r.string(i.uri)&&(i.version===null||$r.integer(i.version))}ee(n,"is");e.is=n})(tne||(tne={}));(function(e){function t(r,i,o,a){return{uri:r,languageId:i,version:o,text:a}}ee(t,"create");e.create=t;function n(r){let i=r;return $r.defined(i)&&$r.string(i.uri)&&$r.string(i.languageId)&&$r.integer(i.version)&&$r.string(i.text)}ee(n,"is");e.is=n})(Vtt||(Vtt={}));(function(e){e.PlainText="plaintext";e.Markdown="markdown";function t(n){const r=n;return r===e.PlainText||r===e.Markdown}ee(t,"is");e.is=t})(_Ae||(_Ae={}));(function(e){function t(n){const r=n;return $r.objectLiteral(n)&&_Ae.is(r.kind)&&$r.string(r.value)}ee(t,"is");e.is=t})(wG||(wG={}));(function(e){e.Text=1;e.Method=2;e.Function=3;e.Constructor=4;e.Field=5;e.Variable=6;e.Class=7;e.Interface=8;e.Module=9;e.Property=10;e.Unit=11;e.Value=12;e.Enum=13;e.Keyword=14;e.Snippet=15;e.Color=16;e.File=17;e.Reference=18;e.Folder=19;e.EnumMember=20;e.Constant=21;e.Struct=22;e.Event=23;e.Operator=24;e.TypeParameter=25})($tt||($tt={}));(function(e){e.PlainText=1;e.Snippet=2})(Gtt||(Gtt={}));(function(e){e.Deprecated=1})(Htt||(Htt={}));(function(e){function t(r,i,o){return{newText:r,insert:i,replace:o}}ee(t,"create");e.create=t;function n(r){const i=r;return i&&$r.string(i.newText)&&jl.is(i.insert)&&jl.is(i.replace)}ee(n,"is");e.is=n})(Wtt||(Wtt={}));(function(e){e.asIs=1;e.adjustIndentation=2})(Ytt||(Ytt={}));(function(e){function t(n){const r=n;return r&&($r.string(r.detail)||r.detail===void 0)&&($r.string(r.description)||r.description===void 0)}ee(t,"is");e.is=t})(qtt||(qtt={}));(function(e){function t(n){return{label:n}}ee(t,"create");e.create=t})(Xtt||(Xtt={}));(function(e){function t(n,r){return{items:n?n:[],isIncomplete:!!r}}ee(t,"create");e.create=t})(jtt||(jtt={}));(function(e){function t(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}ee(t,"fromPlainText");e.fromPlainText=t;function n(r){const i=r;return $r.string(i)||$r.objectLiteral(i)&&$r.string(i.language)&&$r.string(i.value)}ee(n,"is");e.is=n})(nne||(nne={}));(function(e){function t(n){let r=n;return!!r&&$r.objectLiteral(r)&&(wG.is(r.contents)||nne.is(r.contents)||$r.typedArray(r.contents,nne.is))&&(n.range===void 0||jl.is(n.range))}ee(t,"is");e.is=t})(Ktt||(Ktt={}));(function(e){function t(n,r){return r?{label:n,documentation:r}:{label:n}}ee(t,"create");e.create=t})(Ztt||(Ztt={}));(function(e){function t(n,r,...i){let o={label:n};if($r.defined(r)){o.documentation=r}if($r.defined(i)){o.parameters=i}else{o.parameters=[]}return o}ee(t,"create");e.create=t})(Jtt||(Jtt={}));(function(e){e.Text=1;e.Read=2;e.Write=3})(Qtt||(Qtt={}));(function(e){function t(n,r){let i={range:n};if($r.number(r)){i.kind=r}return i}ee(t,"create");e.create=t})(ent||(ent={}));(function(e){e.File=1;e.Module=2;e.Namespace=3;e.Package=4;e.Class=5;e.Method=6;e.Property=7;e.Field=8;e.Constructor=9;e.Enum=10;e.Interface=11;e.Function=12;e.Variable=13;e.Constant=14;e.String=15;e.Number=16;e.Boolean=17;e.Array=18;e.Object=19;e.Key=20;e.Null=21;e.EnumMember=22;e.Struct=23;e.Event=24;e.Operator=25;e.TypeParameter=26})(tnt||(tnt={}));(function(e){e.Deprecated=1})(nnt||(nnt={}));(function(e){function t(n,r,i,o,a){let s={name:n,kind:r,location:{uri:o,range:i}};if(a){s.containerName=a}return s}ee(t,"create");e.create=t})(rnt||(rnt={}));(function(e){function t(n,r,i,o){return o!==void 0?{name:n,kind:r,location:{uri:i,range:o}}:{name:n,kind:r,location:{uri:i}}}ee(t,"create");e.create=t})(int||(int={}));(function(e){function t(r,i,o,a,s,l){let u={name:r,detail:i,kind:o,range:a,selectionRange:s};if(l!==void 0){u.children=l}return u}ee(t,"create");e.create=t;function n(r){let i=r;return i&&$r.string(i.name)&&$r.number(i.kind)&&jl.is(i.range)&&jl.is(i.selectionRange)&&(i.detail===void 0||$r.string(i.detail))&&(i.deprecated===void 0||$r.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}ee(n,"is");e.is=n})(ont||(ont={}));(function(e){e.Empty="";e.QuickFix="quickfix";e.Refactor="refactor";e.RefactorExtract="refactor.extract";e.RefactorInline="refactor.inline";e.RefactorRewrite="refactor.rewrite";e.Source="source";e.SourceOrganizeImports="source.organizeImports";e.SourceFixAll="source.fixAll"})(ant||(ant={}));(function(e){e.Invoked=1;e.Automatic=2})(rne||(rne={}));(function(e){function t(r,i,o){let a={diagnostics:r};if(i!==void 0&&i!==null){a.only=i}if(o!==void 0&&o!==null){a.triggerKind=o}return a}ee(t,"create");e.create=t;function n(r){let i=r;return $r.defined(i)&&$r.typedArray(i.diagnostics,Qte.is)&&(i.only===void 0||$r.typedArray(i.only,$r.string))&&(i.triggerKind===void 0||i.triggerKind===rne.Invoked||i.triggerKind===rne.Automatic)}ee(n,"is");e.is=n})(snt||(snt={}));(function(e){function t(r,i,o){let a={title:r};let s=true;if(typeof i==="string"){s=false;a.kind=i}else if(RB.is(i)){a.command=i}else{a.edit=i}if(s&&o!==void 0){a.kind=o}return a}ee(t,"create");e.create=t;function n(r){let i=r;return i&&$r.string(i.title)&&(i.diagnostics===void 0||$r.typedArray(i.diagnostics,Qte.is))&&(i.kind===void 0||$r.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||RB.is(i.command))&&(i.isPreferred===void 0||$r.boolean(i.isPreferred))&&(i.edit===void 0||vAe.is(i.edit))}ee(n,"is");e.is=n})(lnt||(lnt={}));(function(e){function t(r,i){let o={range:r};if($r.defined(i)){o.data=i}return o}ee(t,"create");e.create=t;function n(r){let i=r;return $r.defined(i)&&jl.is(i.range)&&($r.undefined(i.command)||RB.is(i.command))}ee(n,"is");e.is=n})(cnt||(cnt={}));(function(e){function t(r,i){return{tabSize:r,insertSpaces:i}}ee(t,"create");e.create=t;function n(r){let i=r;return $r.defined(i)&&$r.uinteger(i.tabSize)&&$r.boolean(i.insertSpaces)}ee(n,"is");e.is=n})(unt||(unt={}));(function(e){function t(r,i,o){return{range:r,target:i,data:o}}ee(t,"create");e.create=t;function n(r){let i=r;return $r.defined(i)&&jl.is(i.range)&&($r.undefined(i.target)||$r.string(i.target))}ee(n,"is");e.is=n})(dnt||(dnt={}));(function(e){function t(r,i){return{range:r,parent:i}}ee(t,"create");e.create=t;function n(r){let i=r;return $r.objectLiteral(i)&&jl.is(i.range)&&(i.parent===void 0||e.is(i.parent))}ee(n,"is");e.is=n})(fnt||(fnt={}));(function(e){e["namespace"]="namespace";e["type"]="type";e["class"]="class";e["enum"]="enum";e["interface"]="interface";e["struct"]="struct";e["typeParameter"]="typeParameter";e["parameter"]="parameter";e["variable"]="variable";e["property"]="property";e["enumMember"]="enumMember";e["event"]="event";e["function"]="function";e["method"]="method";e["macro"]="macro";e["keyword"]="keyword";e["modifier"]="modifier";e["comment"]="comment";e["string"]="string";e["number"]="number";e["regexp"]="regexp";e["operator"]="operator";e["decorator"]="decorator"})(hnt||(hnt={}));(function(e){e["declaration"]="declaration";e["definition"]="definition";e["readonly"]="readonly";e["static"]="static";e["deprecated"]="deprecated";e["abstract"]="abstract";e["async"]="async";e["modification"]="modification";e["documentation"]="documentation";e["defaultLibrary"]="defaultLibrary"})(pnt||(pnt={}));(function(e){function t(n){const r=n;return $r.objectLiteral(r)&&(r.resultId===void 0||typeof r.resultId==="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]==="number")}ee(t,"is");e.is=t})(mnt||(mnt={}));(function(e){function t(r,i){return{range:r,text:i}}ee(t,"create");e.create=t;function n(r){const i=r;return i!==void 0&&i!==null&&jl.is(i.range)&&$r.string(i.text)}ee(n,"is");e.is=n})(gnt||(gnt={}));(function(e){function t(r,i,o){return{range:r,variableName:i,caseSensitiveLookup:o}}ee(t,"create");e.create=t;function n(r){const i=r;return i!==void 0&&i!==null&&jl.is(i.range)&&$r.boolean(i.caseSensitiveLookup)&&($r.string(i.variableName)||i.variableName===void 0)}ee(n,"is");e.is=n})(ynt||(ynt={}));(function(e){function t(r,i){return{range:r,expression:i}}ee(t,"create");e.create=t;function n(r){const i=r;return i!==void 0&&i!==null&&jl.is(i.range)&&($r.string(i.expression)||i.expression===void 0)}ee(n,"is");e.is=n})(bnt||(bnt={}));(function(e){function t(r,i){return{frameId:r,stoppedLocation:i}}ee(t,"create");e.create=t;function n(r){const i=r;return $r.defined(i)&&jl.is(r.stoppedLocation)}ee(n,"is");e.is=n})(xnt||(xnt={}));(function(e){e.Type=1;e.Parameter=2;function t(n){return n===1||n===2}ee(t,"is");e.is=t})(TAe||(TAe={}));(function(e){function t(r){return{value:r}}ee(t,"create");e.create=t;function n(r){const i=r;return $r.objectLiteral(i)&&(i.tooltip===void 0||$r.string(i.tooltip)||wG.is(i.tooltip))&&(i.location===void 0||Jte.is(i.location))&&(i.command===void 0||RB.is(i.command))}ee(n,"is");e.is=n})(wAe||(wAe={}));(function(e){function t(r,i,o){const a={position:r,label:i};if(o!==void 0){a.kind=o}return a}ee(t,"create");e.create=t;function n(r){const i=r;return $r.objectLiteral(i)&&Yc.is(i.position)&&($r.string(i.label)||$r.typedArray(i.label,wAe.is))&&(i.kind===void 0||TAe.is(i.kind))&&i.textEdits===void 0||$r.typedArray(i.textEdits,lS.is)&&(i.tooltip===void 0||$r.string(i.tooltip)||wG.is(i.tooltip))&&(i.paddingLeft===void 0||$r.boolean(i.paddingLeft))&&(i.paddingRight===void 0||$r.boolean(i.paddingRight))}ee(n,"is");e.is=n})(vnt||(vnt={}));(function(e){function t(n){return{kind:"snippet",value:n}}ee(t,"createSnippet");e.createSnippet=t})(_nt||(_nt={}));(function(e){function t(n,r,i,o){return{insertText:n,filterText:r,range:i,command:o}}ee(t,"create");e.create=t})(Tnt||(Tnt={}));(function(e){function t(n){return{items:n}}ee(t,"create");e.create=t})(wnt||(wnt={}));(function(e){e.Invoked=0;e.Automatic=1})(Ent||(Ent={}));(function(e){function t(n,r){return{range:n,text:r}}ee(t,"create");e.create=t})(Cnt||(Cnt={}));(function(e){function t(n,r){return{triggerKind:n,selectedCompletionInfo:r}}ee(t,"create");e.create=t})(Snt||(Snt={}));(function(e){function t(n){const r=n;return $r.objectLiteral(r)&&yAe.is(r.uri)&&$r.string(r.name)}ee(t,"is");e.is=t})(Ant||(Ant={}));WCn=["\n","\r\n","\r"];(function(e){function t(o,a,s,l){return new Q2n(o,a,s,l)}ee(t,"create");e.create=t;function n(o){let a=o;return $r.defined(a)&&$r.string(a.uri)&&($r.undefined(a.languageId)||$r.string(a.languageId))&&$r.uinteger(a.lineCount)&&$r.func(a.getText)&&$r.func(a.positionAt)&&$r.func(a.offsetAt)?true:false}ee(n,"is");e.is=n;function r(o,a){let s=o.getText();let l=i(a,(d,f)=>{let h=d.range.start.line-f.range.start.line;if(h===0){return d.range.start.character-f.range.start.character}return h});let u=s.length;for(let d=l.length-1;d>=0;d--){let f=l[d];let h=o.offsetAt(f.range.start);let m=o.offsetAt(f.range.end);if(m<=u){s=s.substring(0,h)+f.newText+s.substring(m,s.length)}else{throw new Error("Overlapping edit")}u=h}return s}ee(r,"applyEdits");e.applyEdits=r;function i(o,a){if(o.length<=1){return o}const s=o.length/2|0;const l=o.slice(0,s);const u=o.slice(s);i(l,a);i(u,a);let d=0;let f=0;let h=0;while(d0){e.push(t.length)}this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets();let n=0,r=t.length;if(r===0){return Yc.create(0,e)}while(ne){r=o}else{n=o+1}}let i=n-1;return Yc.create(i,e-t[i])}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length){return this._content.length}else if(e.line<0){return 0}let n=t[e.line];let r=e.line+1n(u))}ee(s,"stringArray");e.stringArray=s}});eH=Os({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/events.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.Emitter=e.Event=void 0;var t=g6();var n;(function(o){const a={dispose(){}};o.None=function(){return a}})(n||(e.Event=n={}));var r=class{static{ee(this,"CallbackList")}add(o,a=null,s){if(!this._callbacks){this._callbacks=[];this._contexts=[]}this._callbacks.push(o);this._contexts.push(a);if(Array.isArray(s)){s.push({dispose:ee(()=>this.remove(o,a),"dispose")})}}remove(o,a=null){if(!this._callbacks){return}let s=false;for(let l=0,u=this._callbacks.length;l{if(!this._callbacks){this._callbacks=new r}if(this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()){this._options.onFirstListenerAdd(this)}this._callbacks.add(a,s);const u={dispose:ee(()=>{if(!this._callbacks){return}this._callbacks.remove(a,s);u.dispose=YCn._noop;if(this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()){this._options.onLastListenerRemove(this)}},"dispose")};if(Array.isArray(l)){l.push(u)}return u}}return this._event}fire(a){if(this._callbacks){this._callbacks.invoke.call(this._callbacks,a)}}dispose(){if(this._callbacks){this._callbacks.dispose();this._callbacks=void 0}}};e.Emitter=i;i._noop=function(){}}});Oke=Os({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/cancellation.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.CancellationTokenSource=e.CancellationToken=void 0;var t=g6();var n=Yne();var r=eH();var i;(function(l){l.None=Object.freeze({isCancellationRequested:false,onCancellationRequested:r.Event.None});l.Cancelled=Object.freeze({isCancellationRequested:true,onCancellationRequested:r.Event.None});function u(d){const f=d;return f&&(f===l.None||f===l.Cancelled||n.boolean(f.isCancellationRequested)&&!!f.onCancellationRequested)}ee(u,"is");l.is=u})(i||(e.CancellationToken=i={}));var o=Object.freeze(function(l,u){const d=(0,t.default)().timer.setTimeout(l.bind(u),0);return{dispose(){d.dispose()}}});var a=class{static{ee(this,"MutableToken")}constructor(){this._isCancelled=false}cancel(){if(!this._isCancelled){this._isCancelled=true;if(this._emitter){this._emitter.fire(void 0);this.dispose()}}}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){if(this._isCancelled){return o}if(!this._emitter){this._emitter=new r.Emitter}return this._emitter.event}dispose(){if(this._emitter){this._emitter.dispose();this._emitter=void 0}}};var s=class{static{ee(this,"CancellationTokenSource")}get token(){if(!this._token){this._token=new a}return this._token}cancel(){if(!this._token){this._token=i.Cancelled}else{this._token.cancel()}}dispose(){if(!this._token){this._token=i.None}else if(this._token instanceof a){this._token.dispose()}}};e.CancellationTokenSource=s}});qCn=Os({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messages.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.Message=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType=e.RequestType0=e.AbstractMessageSignature=e.ParameterStructures=e.ResponseError=e.ErrorCodes=void 0;var t=Yne();var n;(function($){$.ParseError=-32700;$.InvalidRequest=-32600;$.MethodNotFound=-32601;$.InvalidParams=-32602;$.InternalError=-32603;$.jsonrpcReservedErrorRangeStart=-32099;$.serverErrorStart=-32099;$.MessageWriteError=-32099;$.MessageReadError=-32098;$.PendingResponseRejected=-32097;$.ConnectionInactive=-32096;$.ServerNotInitialized=-32002;$.UnknownErrorCode=-32001;$.jsonrpcReservedErrorRangeEnd=-32e3;$.serverErrorEnd=-32e3})(n||(e.ErrorCodes=n={}));var r=class XCn extends Error{static{ee(this,"ResponseError")}constructor(K,X,j){super(X);this.code=t.number(K)?K:n.UnknownErrorCode;this.data=j;Object.setPrototypeOf(this,XCn.prototype)}toJson(){const K={code:this.code,message:this.message};if(this.data!==void 0){K.data=this.data}return K}};e.ResponseError=r;var i=class EAe{static{ee(this,"ParameterStructures")}constructor(K){this.kind=K}static is(K){return K===EAe.auto||K===EAe.byName||K===EAe.byPosition}toString(){return this.kind}};e.ParameterStructures=i;i.auto=new i("auto");i.byPosition=new i("byPosition");i.byName=new i("byName");var o=class{static{ee(this,"AbstractMessageSignature")}constructor($,K){this.method=$;this.numberOfParams=K}get parameterStructures(){return i.auto}};e.AbstractMessageSignature=o;var a=class extends o{static{ee(this,"RequestType0")}constructor($){super($,0)}};e.RequestType0=a;var s=class extends o{static{ee(this,"RequestType")}constructor($,K=i.auto){super($,1);this._parameterStructures=K}get parameterStructures(){return this._parameterStructures}};e.RequestType=s;var l=class extends o{static{ee(this,"RequestType1")}constructor($,K=i.auto){super($,1);this._parameterStructures=K}get parameterStructures(){return this._parameterStructures}};e.RequestType1=l;var u=class extends o{static{ee(this,"RequestType2")}constructor($){super($,2)}};e.RequestType2=u;var d=class extends o{static{ee(this,"RequestType3")}constructor($){super($,3)}};e.RequestType3=d;var f=class extends o{static{ee(this,"RequestType4")}constructor($){super($,4)}};e.RequestType4=f;var h=class extends o{static{ee(this,"RequestType5")}constructor($){super($,5)}};e.RequestType5=h;var m=class extends o{static{ee(this,"RequestType6")}constructor($){super($,6)}};e.RequestType6=m;var g=class extends o{static{ee(this,"RequestType7")}constructor($){super($,7)}};e.RequestType7=g;var x=class extends o{static{ee(this,"RequestType8")}constructor($){super($,8)}};e.RequestType8=x;var w=class extends o{static{ee(this,"RequestType9")}constructor($){super($,9)}};e.RequestType9=w;var _=class extends o{static{ee(this,"NotificationType")}constructor($,K=i.auto){super($,1);this._parameterStructures=K}get parameterStructures(){return this._parameterStructures}};e.NotificationType=_;var C=class extends o{static{ee(this,"NotificationType0")}constructor($){super($,0)}};e.NotificationType0=C;var A=class extends o{static{ee(this,"NotificationType1")}constructor($,K=i.auto){super($,1);this._parameterStructures=K}get parameterStructures(){return this._parameterStructures}};e.NotificationType1=A;var P=class extends o{static{ee(this,"NotificationType2")}constructor($){super($,2)}};e.NotificationType2=P;var L=class extends o{static{ee(this,"NotificationType3")}constructor($){super($,3)}};e.NotificationType3=L;var I=class extends o{static{ee(this,"NotificationType4")}constructor($){super($,4)}};e.NotificationType4=I;var N=class extends o{static{ee(this,"NotificationType5")}constructor($){super($,5)}};e.NotificationType5=N;var O=class extends o{static{ee(this,"NotificationType6")}constructor($){super($,6)}};e.NotificationType6=O;var z=class extends o{static{ee(this,"NotificationType7")}constructor($){super($,7)}};e.NotificationType7=z;var U=class extends o{static{ee(this,"NotificationType8")}constructor($){super($,8)}};e.NotificationType8=U;var W=class extends o{static{ee(this,"NotificationType9")}constructor($){super($,9)}};e.NotificationType9=W;var H;(function($){function K(te){const J=te;return J&&t.string(J.method)&&(t.string(J.id)||t.number(J.id))}ee(K,"isRequest");$.isRequest=K;function X(te){const J=te;return J&&t.string(J.method)&&te.id===void 0}ee(X,"isNotification");$.isNotification=X;function j(te){const J=te;return J&&(J.result!==void 0||!!J.error)&&(t.string(J.id)||t.number(J.id)||J.id===null)}ee(j,"isResponse");$.isResponse=j})(H||(e.Message=H={}))}});jCn=Os({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/linkedMap.js"(e){"use strict";var t;Object.defineProperty(e,"__esModule",{value:true});e.LRUCache=e.LinkedMap=e.Touch=void 0;var n;(function(o){o.None=0;o.First=1;o.AsOld=o.First;o.Last=2;o.AsNew=o.Last})(n||(e.Touch=n={}));var r=class{static{ee(this,"LinkedMap")}constructor(){this[t]="LinkedMap";this._map=new Map;this._head=void 0;this._tail=void 0;this._size=0;this._state=0}clear(){this._map.clear();this._head=void 0;this._tail=void 0;this._size=0;this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(o){return this._map.has(o)}get(o,a=n.None){const s=this._map.get(o);if(!s){return void 0}if(a!==n.None){this.touch(s,a)}return s.value}set(o,a,s=n.None){let l=this._map.get(o);if(l){l.value=a;if(s!==n.None){this.touch(l,s)}}else{l={key:o,value:a,next:void 0,previous:void 0};switch(s){case n.None:this.addItemLast(l);break;case n.First:this.addItemFirst(l);break;case n.Last:this.addItemLast(l);break;default:this.addItemLast(l);break}this._map.set(o,l);this._size++}return this}delete(o){return!!this.remove(o)}remove(o){const a=this._map.get(o);if(!a){return void 0}this._map.delete(o);this.removeItem(a);this._size--;return a.value}shift(){if(!this._head&&!this._tail){return void 0}if(!this._head||!this._tail){throw new Error("Invalid list")}const o=this._head;this._map.delete(o.key);this.removeItem(o);this._size--;return o.value}forEach(o,a){const s=this._state;let l=this._head;while(l){if(a){o.bind(a)(l.value,l.key,this)}else{o(l.value,l.key,this)}if(this._state!==s){throw new Error(`LinkedMap got modified during iteration.`)}l=l.next}}keys(){const o=this._state;let a=this._head;const s={[Symbol.iterator]:()=>{return s},next:ee(()=>{if(this._state!==o){throw new Error(`LinkedMap got modified during iteration.`)}if(a){const l={value:a.key,done:false};a=a.next;return l}else{return{value:void 0,done:true}}},"next")};return s}values(){const o=this._state;let a=this._head;const s={[Symbol.iterator]:()=>{return s},next:ee(()=>{if(this._state!==o){throw new Error(`LinkedMap got modified during iteration.`)}if(a){const l={value:a.value,done:false};a=a.next;return l}else{return{value:void 0,done:true}}},"next")};return s}entries(){const o=this._state;let a=this._head;const s={[Symbol.iterator]:()=>{return s},next:ee(()=>{if(this._state!==o){throw new Error(`LinkedMap got modified during iteration.`)}if(a){const l={value:[a.key,a.value],done:false};a=a.next;return l}else{return{value:void 0,done:true}}},"next")};return s}[(t=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(o){if(o>=this.size){return}if(o===0){this.clear();return}let a=this._head;let s=this.size;while(a&&s>o){this._map.delete(a.key);a=a.next;s--}this._head=a;this._size=s;if(a){a.previous=void 0}this._state++}addItemFirst(o){if(!this._head&&!this._tail){this._tail=o}else if(!this._head){throw new Error("Invalid list")}else{o.next=this._head;this._head.previous=o}this._head=o;this._state++}addItemLast(o){if(!this._head&&!this._tail){this._head=o}else if(!this._tail){throw new Error("Invalid list")}else{o.previous=this._tail;this._tail.next=o}this._tail=o;this._state++}removeItem(o){if(o===this._head&&o===this._tail){this._head=void 0;this._tail=void 0}else if(o===this._head){if(!o.next){throw new Error("Invalid list")}o.next.previous=void 0;this._head=o.next}else if(o===this._tail){if(!o.previous){throw new Error("Invalid list")}o.previous.next=void 0;this._tail=o.previous}else{const a=o.next;const s=o.previous;if(!a||!s){throw new Error("Invalid list")}a.previous=s;s.next=a}o.next=void 0;o.previous=void 0;this._state++}touch(o,a){if(!this._head||!this._tail){throw new Error("Invalid list")}if(a!==n.First&&a!==n.Last){return}if(a===n.First){if(o===this._head){return}const s=o.next;const l=o.previous;if(o===this._tail){l.next=void 0;this._tail=l}else{s.previous=l;l.next=s}o.previous=void 0;o.next=this._head;this._head.previous=o;this._head=o;this._state++}else if(a===n.Last){if(o===this._tail){return}const s=o.next;const l=o.previous;if(o===this._head){s.previous=void 0;this._head=s}else{s.previous=l;l.next=s}o.next=void 0;o.previous=this._tail;this._tail.next=o;this._tail=o;this._state++}}toJSON(){const o=[];this.forEach((a,s)=>{o.push([s,a])});return o}fromJSON(o){this.clear();for(const[a,s]of o){this.set(a,s)}}};e.LinkedMap=r;var i=class extends r{static{ee(this,"LRUCache")}constructor(o,a=1){super();this._limit=o;this._ratio=Math.min(Math.max(0,a),1)}get limit(){return this._limit}set limit(o){this._limit=o;this.checkTrim()}get ratio(){return this._ratio}set ratio(o){this._ratio=Math.min(Math.max(0,o),1);this.checkTrim()}get(o,a=n.AsNew){return super.get(o,a)}peek(o){return super.get(o,n.None)}set(o,a){super.set(o,a,n.Last);this.checkTrim();return this}checkTrim(){if(this.size>this._limit){this.trimOld(Math.round(this._limit*this._ratio))}}};e.LRUCache=i}});NIi=Os({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/disposable.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.Disposable=void 0;var t;(function(n){function r(i){return{dispose:i}}ee(r,"create");n.create=r})(t||(e.Disposable=t={}))}});OIi=Os({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=void 0;var t=Oke();var n;(function(s){s.Continue=0;s.Cancelled=1})(n||(n={}));var r=class{static{ee(this,"SharedArraySenderStrategy")}constructor(){this.buffers=new Map}enableCancellation(s){if(s.id===null){return}const l=new SharedArrayBuffer(4);const u=new Int32Array(l,0,1);u[0]=n.Continue;this.buffers.set(s.id,l);s.$cancellationData=l}async sendCancellation(s,l){const u=this.buffers.get(l);if(u===void 0){return}const d=new Int32Array(u,0,1);Atomics.store(d,0,n.Cancelled)}cleanup(s){this.buffers.delete(s)}dispose(){this.buffers.clear()}};e.SharedArraySenderStrategy=r;var i=class{static{ee(this,"SharedArrayBufferCancellationToken")}constructor(s){this.data=new Int32Array(s,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===n.Cancelled}get onCancellationRequested(){throw new Error(`Cancellation over SharedArrayBuffer doesn't support cancellation events`)}};var o=class{static{ee(this,"SharedArrayBufferCancellationTokenSource")}constructor(s){this.token=new i(s)}cancel(){}dispose(){}};var a=class{static{ee(this,"SharedArrayReceiverStrategy")}constructor(){this.kind="request"}createCancellationTokenSource(s){const l=s.$cancellationData;if(l===void 0){return new t.CancellationTokenSource}return new o(l)}};e.SharedArrayReceiverStrategy=a}});KCn=Os({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/semaphore.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.Semaphore=void 0;var t=g6();var n=class{static{ee(this,"Semaphore")}constructor(r=1){if(r<=0){throw new Error("Capacity must be greater than 0")}this._capacity=r;this._active=0;this._waiting=[]}lock(r){return new Promise((i,o)=>{this._waiting.push({thunk:r,resolve:i,reject:o});this.runNext()})}get active(){return this._active}runNext(){if(this._waiting.length===0||this._active===this._capacity){return}(0,t.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity){return}const r=this._waiting.shift();this._active++;if(this._active>this._capacity){throw new Error(`To many thunks active`)}try{const i=r.thunk();if(i instanceof Promise){i.then(o=>{this._active--;r.resolve(o);this.runNext()},o=>{this._active--;r.reject(o);this.runNext()})}else{this._active--;r.resolve(i);this.runNext()}}catch(i){this._active--;r.reject(i);this.runNext()}}};e.Semaphore=n}});BIi=Os({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageReader.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=void 0;var t=g6();var n=Yne();var r=eH();var i=KCn();var o;(function(u){function d(f){let h=f;return h&&n.func(h.listen)&&n.func(h.dispose)&&n.func(h.onError)&&n.func(h.onClose)&&n.func(h.onPartialMessage)}ee(d,"is");u.is=d})(o||(e.MessageReader=o={}));var a=class{static{ee(this,"AbstractMessageReader")}constructor(){this.errorEmitter=new r.Emitter;this.closeEmitter=new r.Emitter;this.partialMessageEmitter=new r.Emitter}dispose(){this.errorEmitter.dispose();this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(u){this.errorEmitter.fire(this.asError(u))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(u){this.partialMessageEmitter.fire(u)}asError(u){if(u instanceof Error){return u}else{return new Error(`Reader received error. Reason: ${n.string(u.message)?u.message:"unknown"}`)}}};e.AbstractMessageReader=a;var s;(function(u){function d(f){let h;let m;let g;const x=new Map;let w;const _=new Map;if(f===void 0||typeof f==="string"){h=f??"utf-8"}else{h=f.charset??"utf-8";if(f.contentDecoder!==void 0){g=f.contentDecoder;x.set(g.name,g)}if(f.contentDecoders!==void 0){for(const C of f.contentDecoders){x.set(C.name,C)}}if(f.contentTypeDecoder!==void 0){w=f.contentTypeDecoder;_.set(w.name,w)}if(f.contentTypeDecoders!==void 0){for(const C of f.contentTypeDecoders){_.set(C.name,C)}}}if(w===void 0){w=(0,t.default)().applicationJson.decoder;_.set(w.name,w)}return{charset:h,contentDecoder:g,contentDecoders:x,contentTypeDecoder:w,contentTypeDecoders:_}}ee(d,"fromOptions");u.fromOptions=d})(s||(s={}));var l=class extends a{static{ee(this,"ReadableStreamMessageReader")}constructor(u,d){super();this.readable=u;this.options=s.fromOptions(d);this.buffer=(0,t.default)().messageBuffer.create(this.options.charset);this._partialMessageTimeout=1e4;this.nextMessageLength=-1;this.messageToken=0;this.readSemaphore=new i.Semaphore(1)}set partialMessageTimeout(u){this._partialMessageTimeout=u}get partialMessageTimeout(){return this._partialMessageTimeout}listen(u){this.nextMessageLength=-1;this.messageToken=0;this.partialMessageTimer=void 0;this.callback=u;const d=this.readable.onData(f=>{this.onData(f)});this.readable.onError(f=>this.fireError(f));this.readable.onClose(()=>this.fireClose());return d}onData(u){try{this.buffer.append(u);while(true){if(this.nextMessageLength===-1){const f=this.buffer.tryReadHeaders(true);if(!f){return}const h=f.get("content-length");if(!h){this.fireError(new Error(`Header must provide a Content-Length property. +${JSON.stringify(Object.fromEntries(f))}`));return}const m=parseInt(h);if(isNaN(m)){this.fireError(new Error(`Content-Length value must be a number. Got ${h}`));return}this.nextMessageLength=m}const d=this.buffer.tryReadBody(this.nextMessageLength);if(d===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer();this.nextMessageLength=-1;this.readSemaphore.lock(async()=>{const f=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(d):d;const h=await this.options.contentTypeDecoder.decode(f,this.options);this.callback(h)}).catch(f=>{this.fireError(f)})}}catch(d){this.fireError(d)}}clearPartialMessageTimer(){if(this.partialMessageTimer){this.partialMessageTimer.dispose();this.partialMessageTimer=void 0}}setPartialMessageTimer(){this.clearPartialMessageTimer();if(this._partialMessageTimeout<=0){return}this.partialMessageTimer=(0,t.default)().timer.setTimeout((u,d)=>{this.partialMessageTimer=void 0;if(u===this.messageToken){this.firePartialMessage({messageToken:u,waitingTime:d});this.setPartialMessageTimer()}},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout)}};e.ReadableStreamMessageReader=l}});zIi=Os({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageWriter.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=void 0;var t=g6();var n=Yne();var r=KCn();var i=eH();var o="Content-Length: ";var a="\r\n";var s;(function(f){function h(m){let g=m;return g&&n.func(g.dispose)&&n.func(g.onClose)&&n.func(g.onError)&&n.func(g.write)}ee(h,"is");f.is=h})(s||(e.MessageWriter=s={}));var l=class{static{ee(this,"AbstractMessageWriter")}constructor(){this.errorEmitter=new i.Emitter;this.closeEmitter=new i.Emitter}dispose(){this.errorEmitter.dispose();this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(f,h,m){this.errorEmitter.fire([this.asError(f),h,m])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(f){if(f instanceof Error){return f}else{return new Error(`Writer received error. Reason: ${n.string(f.message)?f.message:"unknown"}`)}}};e.AbstractMessageWriter=l;var u;(function(f){function h(m){if(m===void 0||typeof m==="string"){return{charset:m??"utf-8",contentTypeEncoder:(0,t.default)().applicationJson.encoder}}else{return{charset:m.charset??"utf-8",contentEncoder:m.contentEncoder,contentTypeEncoder:m.contentTypeEncoder??(0,t.default)().applicationJson.encoder}}}ee(h,"fromOptions");f.fromOptions=h})(u||(u={}));var d=class extends l{static{ee(this,"WriteableStreamMessageWriter")}constructor(f,h){super();this.writable=f;this.options=u.fromOptions(h);this.errorCount=0;this.writeSemaphore=new r.Semaphore(1);this.writable.onError(m=>this.fireError(m));this.writable.onClose(()=>this.fireClose())}async write(f){return this.writeSemaphore.lock(async()=>{const h=this.options.contentTypeEncoder.encode(f,this.options).then(m=>{if(this.options.contentEncoder!==void 0){return this.options.contentEncoder.encode(m)}else{return m}});return h.then(m=>{const g=[];g.push(o,m.byteLength.toString(),a);g.push(a);return this.doWrite(f,g,m)},m=>{this.fireError(m);throw m})})}async doWrite(f,h,m){try{await this.writable.write(h.join(""),"ascii");return this.writable.write(m)}catch(g){this.handleError(g,f);return Promise.reject(g)}}handleError(f,h){this.errorCount++;this.fireError(f,h,this.errorCount)}end(){this.writable.end()}};e.WriteableStreamMessageWriter=d}});UIi=Os({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.AbstractMessageBuffer=void 0;var t=13;var n=10;var r="\r\n";var i=class{static{ee(this,"AbstractMessageBuffer")}constructor(o="utf-8"){this._encoding=o;this._chunks=[];this._totalLength=0}get encoding(){return this._encoding}append(o){const a=typeof o==="string"?this.fromString(o,this._encoding):o;this._chunks.push(a);this._totalLength+=a.byteLength}tryReadHeaders(o=false){if(this._chunks.length===0){return void 0}let a=0;let s=0;let l=0;let u=0;e:while(sthis._totalLength){throw new Error(`Cannot read so many bytes!`)}if(this._chunks[0].byteLength===o){const u=this._chunks[0];this._chunks.shift();this._totalLength-=o;return this.asNative(u)}if(this._chunks[0].byteLength>o){const u=this._chunks[0];const d=this.asNative(u,o);this._chunks[0]=u.slice(o);this._totalLength-=o;return d}const a=this.allocNative(o);let s=0;let l=0;while(o>0){const u=this._chunks[l];if(u.byteLength>o){const d=u.slice(0,o);a.set(d,s);s+=o;this._chunks[l]=u.slice(o);this._totalLength-=o;o-=o}else{a.set(u,s);s+=u.byteLength;this._chunks.shift();this._totalLength-=u.byteLength;o-=u.byteLength}}return a}};e.AbstractMessageBuffer=i}});VIi=Os({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/connection.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.createMessageConnection=e.ConnectionOptions=e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.RequestCancellationReceiverStrategy=e.IdCancellationReceiverStrategy=e.ConnectionStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=e.NullLogger=e.ProgressType=e.ProgressToken=void 0;var t=g6();var n=Yne();var r=qCn();var i=jCn();var o=eH();var a=Oke();var s;(function($){$.type=new r.NotificationType("$/cancelRequest")})(s||(s={}));var l;(function($){function K(X){return typeof X==="string"||typeof X==="number"}ee(K,"is");$.is=K})(l||(e.ProgressToken=l={}));var u;(function($){$.type=new r.NotificationType("$/progress")})(u||(u={}));var d=class{static{ee(this,"ProgressType")}constructor(){}};e.ProgressType=d;var f;(function($){function K(X){return n.func(X)}ee(K,"is");$.is=K})(f||(f={}));e.NullLogger=Object.freeze({error:ee(()=>{},"error"),warn:ee(()=>{},"warn"),info:ee(()=>{},"info"),log:ee(()=>{},"log")});var h;(function($){$[$["Off"]=0]="Off";$[$["Messages"]=1]="Messages";$[$["Compact"]=2]="Compact";$[$["Verbose"]=3]="Verbose"})(h||(e.Trace=h={}));var m;(function($){$.Off="off";$.Messages="messages";$.Compact="compact";$.Verbose="verbose"})(m||(e.TraceValues=m={}));(function($){function K(j){if(!n.string(j)){return $.Off}j=j.toLowerCase();switch(j){case"off":return $.Off;case"messages":return $.Messages;case"compact":return $.Compact;case"verbose":return $.Verbose;default:return $.Off}}ee(K,"fromString");$.fromString=K;function X(j){switch(j){case $.Off:return"off";case $.Messages:return"messages";case $.Compact:return"compact";case $.Verbose:return"verbose";default:return"off"}}ee(X,"toString");$.toString=X})(h||(e.Trace=h={}));var g;(function($){$["Text"]="text";$["JSON"]="json"})(g||(e.TraceFormat=g={}));(function($){function K(X){if(!n.string(X)){return $.Text}X=X.toLowerCase();if(X==="json"){return $.JSON}else{return $.Text}}ee(K,"fromString");$.fromString=K})(g||(e.TraceFormat=g={}));var x;(function($){$.type=new r.NotificationType("$/setTrace")})(x||(e.SetTraceNotification=x={}));var w;(function($){$.type=new r.NotificationType("$/logTrace")})(w||(e.LogTraceNotification=w={}));var _;(function($){$[$["Closed"]=1]="Closed";$[$["Disposed"]=2]="Disposed";$[$["AlreadyListening"]=3]="AlreadyListening"})(_||(e.ConnectionErrors=_={}));var C=class ZCn extends Error{static{ee(this,"ConnectionError")}constructor(K,X){super(X);this.code=K;Object.setPrototypeOf(this,ZCn.prototype)}};e.ConnectionError=C;var A;(function($){function K(X){const j=X;return j&&n.func(j.cancelUndispatched)}ee(K,"is");$.is=K})(A||(e.ConnectionStrategy=A={}));var P;(function($){function K(X){const j=X;return j&&(j.kind===void 0||j.kind==="id")&&n.func(j.createCancellationTokenSource)&&(j.dispose===void 0||n.func(j.dispose))}ee(K,"is");$.is=K})(P||(e.IdCancellationReceiverStrategy=P={}));var L;(function($){function K(X){const j=X;return j&&j.kind==="request"&&n.func(j.createCancellationTokenSource)&&(j.dispose===void 0||n.func(j.dispose))}ee(K,"is");$.is=K})(L||(e.RequestCancellationReceiverStrategy=L={}));var I;(function($){$.Message=Object.freeze({createCancellationTokenSource(X){return new a.CancellationTokenSource}});function K(X){return P.is(X)||L.is(X)}ee(K,"is");$.is=K})(I||(e.CancellationReceiverStrategy=I={}));var N;(function($){$.Message=Object.freeze({sendCancellation(X,j){return X.sendNotification(s.type,{id:j})},cleanup(X){}});function K(X){const j=X;return j&&n.func(j.sendCancellation)&&n.func(j.cleanup)}ee(K,"is");$.is=K})(N||(e.CancellationSenderStrategy=N={}));var O;(function($){$.Message=Object.freeze({receiver:I.Message,sender:N.Message});function K(X){const j=X;return j&&I.is(j.receiver)&&N.is(j.sender)}ee(K,"is");$.is=K})(O||(e.CancellationStrategy=O={}));var z;(function($){function K(X){const j=X;return j&&n.func(j.handleMessage)}ee(K,"is");$.is=K})(z||(e.MessageStrategy=z={}));var U;(function($){function K(X){const j=X;return j&&(O.is(j.cancellationStrategy)||A.is(j.connectionStrategy)||z.is(j.messageStrategy))}ee(K,"is");$.is=K})(U||(e.ConnectionOptions=U={}));var W;(function($){$[$["New"]=1]="New";$[$["Listening"]=2]="Listening";$[$["Closed"]=3]="Closed";$[$["Disposed"]=4]="Disposed"})(W||(W={}));function H($,K,X,j){const te=X!==void 0?X:e.NullLogger;let J=0;let oe=0;let se=0;const re="2.0";let ce=void 0;const ue=new Map;let xe=void 0;const be=new Map;const Ie=new Map;let he;let ve=new i.LinkedMap;let ge=new Map;let Ve=new Set;let Le=new Map;let $e=h.Off;let Ee=g.Text;let tt;let yt=W.New;const mt=new o.Emitter;const ct=new o.Emitter;const Ge=new o.Emitter;const it=new o.Emitter;const bt=new o.Emitter;const He=j&&j.cancellationStrategy?j.cancellationStrategy:O.Message;function Je(rn){if(rn===null){throw new Error(`Can't send requests with id null since the response can't be correlated.`)}return"req-"+rn.toString()}ee(Je,"createRequestQueueKey");function Te(rn){if(rn===null){return"res-unknown-"+(++se).toString()}else{return"res-"+rn.toString()}}ee(Te,"createResponseQueueKey");function we(){return"not-"+(++oe).toString()}ee(we,"createNotificationQueueKey");function Ze(rn,St){if(r.Message.isRequest(St)){rn.set(Je(St.id),St)}else if(r.Message.isResponse(St)){rn.set(Te(St.id),St)}else{rn.set(we(),St)}}ee(Ze,"addMessageToQueue");function Be(rn){return void 0}ee(Be,"cancelUndispatched");function qe(){return yt===W.Listening}ee(qe,"isListening");function Qe(){return yt===W.Closed}ee(Qe,"isClosed");function ze(){return yt===W.Disposed}ee(ze,"isDisposed");function Me(){if(yt===W.New||yt===W.Listening){yt=W.Closed;ct.fire(void 0)}}ee(Me,"closeHandler");function ye(rn){mt.fire([rn,void 0,void 0])}ee(ye,"readErrorHandler");function Ne(rn){mt.fire(rn)}ee(Ne,"writeErrorHandler");$.onClose(Me);$.onError(ye);K.onClose(Me);K.onError(Ne);function Ae(){if(he||ve.size===0){return}he=(0,t.default)().timer.setImmediate(()=>{he=void 0;Oe()})}ee(Ae,"triggerMessageQueue");function dt(rn){if(r.Message.isRequest(rn)){kt(rn)}else if(r.Message.isNotification(rn)){_t(rn)}else if(r.Message.isResponse(rn)){qt(rn)}else{sn(rn)}}ee(dt,"handleMessage");function Oe(){if(ve.size===0){return}const rn=ve.shift();try{const St=j?.messageStrategy;if(z.is(St)){St.handleMessage(rn,dt)}else{dt(rn)}}finally{Ae()}}ee(Oe,"processMessageQueue");const Wt=ee(rn=>{try{if(r.Message.isNotification(rn)&&rn.method===s.type.method){const St=rn.params.id;const Ut=Je(St);const Pt=ve.get(Ut);if(r.Message.isRequest(Pt)){const Xt=j?.connectionStrategy;const Cn=Xt&&Xt.cancelUndispatched?Xt.cancelUndispatched(Pt,Be):Be(Pt);if(Cn&&(Cn.error!==void 0||Cn.result!==void 0)){ve.delete(Ut);Le.delete(St);Cn.id=Pt.id;mn(Cn,rn.method,Date.now());K.write(Cn).catch(()=>te.error(`Sending response for canceled message failed.`));return}}const an=Le.get(St);if(an!==void 0){an.cancel();lr(rn);return}else{Ve.add(St)}}Ze(ve,rn)}finally{Ae()}},"callback");function kt(rn){if(ze()){return}function St(hr,Et,Tn){const ft={jsonrpc:re,id:rn.id};if(hr instanceof r.ResponseError){ft.error=hr.toJson()}else{ft.result=hr===void 0?null:hr}mn(ft,Et,Tn);K.write(ft).catch(()=>te.error(`Sending response failed.`))}ee(St,"reply");function Ut(hr,Et,Tn){const ft={jsonrpc:re,id:rn.id,error:hr.toJson()};mn(ft,Et,Tn);K.write(ft).catch(()=>te.error(`Sending response failed.`))}ee(Ut,"replyError");function Pt(hr,Et,Tn){if(hr===void 0){hr=null}const ft={jsonrpc:re,id:rn.id,result:hr};mn(ft,Et,Tn);K.write(ft).catch(()=>te.error(`Sending response failed.`))}ee(Pt,"replySuccess");At(rn);const an=ue.get(rn.method);let Xt;let Cn;if(an){Xt=an.type;Cn=an.handler}const rr=Date.now();if(Cn||ce){const hr=rn.id??String(Date.now());const Et=P.is(He.receiver)?He.receiver.createCancellationTokenSource(hr):He.receiver.createCancellationTokenSource(rn);if(rn.id!==null&&Ve.has(rn.id)){Et.cancel()}if(rn.id!==null){Le.set(hr,Et)}try{let Tn;if(Cn){if(rn.params===void 0){if(Xt!==void 0&&Xt.numberOfParams!==0){Ut(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${rn.method} defines ${Xt.numberOfParams} params but received none.`),rn.method,rr);return}Tn=Cn(Et.token)}else if(Array.isArray(rn.params)){if(Xt!==void 0&&Xt.parameterStructures===r.ParameterStructures.byName){Ut(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${rn.method} defines parameters by name but received parameters by position`),rn.method,rr);return}Tn=Cn(...rn.params,Et.token)}else{if(Xt!==void 0&&Xt.parameterStructures===r.ParameterStructures.byPosition){Ut(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${rn.method} defines parameters by position but received parameters by name`),rn.method,rr);return}Tn=Cn(rn.params,Et.token)}}else if(ce){Tn=ce(rn.method,rn.params,Et.token)}const ft=Tn;if(!Tn){Le.delete(hr);Pt(Tn,rn.method,rr)}else if(ft.then){ft.then(zt=>{Le.delete(hr);St(zt,rn.method,rr)},zt=>{Le.delete(hr);if(zt instanceof r.ResponseError){Ut(zt,rn.method,rr)}else if(zt&&n.string(zt.message)){Ut(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${rn.method} failed with message: ${zt.message}`),rn.method,rr)}else{Ut(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${rn.method} failed unexpectedly without providing any details.`),rn.method,rr)}})}else{Le.delete(hr);St(Tn,rn.method,rr)}}catch(Tn){Le.delete(hr);if(Tn instanceof r.ResponseError){St(Tn,rn.method,rr)}else if(Tn&&n.string(Tn.message)){Ut(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${rn.method} failed with message: ${Tn.message}`),rn.method,rr)}else{Ut(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${rn.method} failed unexpectedly without providing any details.`),rn.method,rr)}}}else{Ut(new r.ResponseError(r.ErrorCodes.MethodNotFound,`Unhandled method ${rn.method}`),rn.method,rr)}}ee(kt,"handleRequest");function qt(rn){if(ze()){return}if(rn.id===null){if(rn.error){te.error(`Received response message without id: Error is: +${JSON.stringify(rn.error,void 0,4)}`)}else{te.error(`Received response message without id. No further error information provided.`)}}else{const St=rn.id;const Ut=ge.get(St);on(rn,Ut);if(Ut!==void 0){ge.delete(St);try{if(rn.error){const Pt=rn.error;Ut.reject(new r.ResponseError(Pt.code,Pt.message,Pt.data))}else if(rn.result!==void 0){Ut.resolve(rn.result)}else{throw new Error("Should never happen.")}}catch(Pt){if(Pt.message){te.error(`Response handler '${Ut.method}' failed with message: ${Pt.message}`)}else{te.error(`Response handler '${Ut.method}' failed unexpectedly.`)}}}}}ee(qt,"handleResponse");function _t(rn){if(ze()){return}let St=void 0;let Ut;if(rn.method===s.type.method){const Pt=rn.params.id;Ve.delete(Pt);lr(rn);return}else{const Pt=be.get(rn.method);if(Pt){Ut=Pt.handler;St=Pt.type}}if(Ut||xe){try{lr(rn);if(Ut){if(rn.params===void 0){if(St!==void 0){if(St.numberOfParams!==0&&St.parameterStructures!==r.ParameterStructures.byName){te.error(`Notification ${rn.method} defines ${St.numberOfParams} params but received none.`)}}Ut()}else if(Array.isArray(rn.params)){const Pt=rn.params;if(rn.method===u.type.method&&Pt.length===2&&l.is(Pt[0])){Ut({token:Pt[0],value:Pt[1]})}else{if(St!==void 0){if(St.parameterStructures===r.ParameterStructures.byName){te.error(`Notification ${rn.method} defines parameters by name but received parameters by position`)}if(St.numberOfParams!==rn.params.length){te.error(`Notification ${rn.method} defines ${St.numberOfParams} params but received ${Pt.length} arguments`)}}Ut(...Pt)}}else{if(St!==void 0&&St.parameterStructures===r.ParameterStructures.byPosition){te.error(`Notification ${rn.method} defines parameters by position but received parameters by name`)}Ut(rn.params)}}else if(xe){xe(rn.method,rn.params)}}catch(Pt){if(Pt.message){te.error(`Notification handler '${rn.method}' failed with message: ${Pt.message}`)}else{te.error(`Notification handler '${rn.method}' failed unexpectedly.`)}}}else{Ge.fire(rn)}}ee(_t,"handleNotification");function sn(rn){if(!rn){te.error("Received empty message.");return}te.error(`Received message which is neither a response nor a notification message: +${JSON.stringify(rn,null,4)}`);const St=rn;if(n.string(St.id)||n.number(St.id)){const Ut=St.id;const Pt=ge.get(Ut);if(Pt){Pt.reject(new Error("The received response has neither a result nor an error property."))}}}ee(sn,"handleInvalidMessage");function Jt(rn){if(rn===void 0||rn===null){return void 0}switch($e){case h.Verbose:return JSON.stringify(rn,null,4);case h.Compact:return JSON.stringify(rn);default:return void 0}}ee(Jt,"stringifyTrace");function Sn(rn){if($e===h.Off||!tt){return}if(Ee===g.Text){let St=void 0;if(($e===h.Verbose||$e===h.Compact)&&rn.params){St=`Params: ${Jt(rn.params)} + +`}tt.log(`Sending request '${rn.method} - (${rn.id})'.`,St)}else{cr("send-request",rn)}}ee(Sn,"traceSendingRequest");function Kt(rn){if($e===h.Off||!tt){return}if(Ee===g.Text){let St=void 0;if($e===h.Verbose||$e===h.Compact){if(rn.params){St=`Params: ${Jt(rn.params)} + +`}else{St="No parameters provided.\n\n"}}tt.log(`Sending notification '${rn.method}'.`,St)}else{cr("send-notification",rn)}}ee(Kt,"traceSendingNotification");function mn(rn,St,Ut){if($e===h.Off||!tt){return}if(Ee===g.Text){let Pt=void 0;if($e===h.Verbose||$e===h.Compact){if(rn.error&&rn.error.data){Pt=`Error data: ${Jt(rn.error.data)} + +`}else{if(rn.result){Pt=`Result: ${Jt(rn.result)} + +`}else if(rn.error===void 0){Pt="No result returned.\n\n"}}}tt.log(`Sending response '${St} - (${rn.id})'. Processing request took ${Date.now()-Ut}ms`,Pt)}else{cr("send-response",rn)}}ee(mn,"traceSendingResponse");function At(rn){if($e===h.Off||!tt){return}if(Ee===g.Text){let St=void 0;if(($e===h.Verbose||$e===h.Compact)&&rn.params){St=`Params: ${Jt(rn.params)} + +`}tt.log(`Received request '${rn.method} - (${rn.id})'.`,St)}else{cr("receive-request",rn)}}ee(At,"traceReceivedRequest");function lr(rn){if($e===h.Off||!tt||rn.method===w.type.method){return}if(Ee===g.Text){let St=void 0;if($e===h.Verbose||$e===h.Compact){if(rn.params){St=`Params: ${Jt(rn.params)} + +`}else{St="No parameters provided.\n\n"}}tt.log(`Received notification '${rn.method}'.`,St)}else{cr("receive-notification",rn)}}ee(lr,"traceReceivedNotification");function on(rn,St){if($e===h.Off||!tt){return}if(Ee===g.Text){let Ut=void 0;if($e===h.Verbose||$e===h.Compact){if(rn.error&&rn.error.data){Ut=`Error data: ${Jt(rn.error.data)} + +`}else{if(rn.result){Ut=`Result: ${Jt(rn.result)} + +`}else if(rn.error===void 0){Ut="No result returned.\n\n"}}}if(St){const Pt=rn.error?` Request failed: ${rn.error.message} (${rn.error.code}).`:"";tt.log(`Received response '${St.method} - (${rn.id})' in ${Date.now()-St.timerStart}ms.${Pt}`,Ut)}else{tt.log(`Received response ${rn.id} without active response promise.`,Ut)}}else{cr("receive-response",rn)}}ee(on,"traceReceivedResponse");function cr(rn,St){if(!tt||$e===h.Off){return}const Ut={isLSPMessage:true,type:rn,message:St,timestamp:Date.now()};tt.log(Ut)}ee(cr,"logLSPMessage");function Hr(){if(Qe()){throw new C(_.Closed,"Connection is closed.")}if(ze()){throw new C(_.Disposed,"Connection is disposed.")}}ee(Hr,"throwIfClosedOrDisposed");function Mr(){if(qe()){throw new C(_.AlreadyListening,"Connection is already listening")}}ee(Mr,"throwIfListening");function Er(){if(!qe()){throw new Error("Call listen() first.")}}ee(Er,"throwIfNotListening");function vr(rn){if(rn===void 0){return null}else{return rn}}ee(vr,"undefinedToNull");function Yr(rn){if(rn===null){return void 0}else{return rn}}ee(Yr,"nullToUndefined");function nt(rn){return rn!==void 0&&rn!==null&&!Array.isArray(rn)&&typeof rn==="object"}ee(nt,"isNamedParam");function Rr(rn,St){switch(rn){case r.ParameterStructures.auto:if(nt(St)){return Yr(St)}else{return[vr(St)]}case r.ParameterStructures.byName:if(!nt(St)){throw new Error(`Received parameters by name but param is not an object literal.`)}return Yr(St);case r.ParameterStructures.byPosition:return[vr(St)];default:throw new Error(`Unknown parameter structure ${rn.toString()}`)}}ee(Rr,"computeSingleParam");function Xr(rn,St){let Ut;const Pt=rn.numberOfParams;switch(Pt){case 0:Ut=void 0;break;case 1:Ut=Rr(rn.parameterStructures,St[0]);break;default:Ut=[];for(let an=0;an{Hr();let Ut;let Pt;if(n.string(rn)){Ut=rn;const Xt=St[0];let Cn=0;let rr=r.ParameterStructures.auto;if(r.ParameterStructures.is(Xt)){Cn=1;rr=Xt}let hr=St.length;const Et=hr-Cn;switch(Et){case 0:Pt=void 0;break;case 1:Pt=Rr(rr,St[Cn]);break;default:if(rr===r.ParameterStructures.byName){throw new Error(`Received ${Et} parameters for 'by Name' notification parameter structure.`)}Pt=St.slice(Cn,hr).map(Tn=>vr(Tn));break}}else{const Xt=St;Ut=rn.method;Pt=Xr(rn,Xt)}const an={jsonrpc:re,method:Ut,params:Pt};Kt(an);return K.write(an).catch(Xt=>{te.error(`Sending notification failed.`);throw Xt})},"sendNotification"),onNotification:ee((rn,St)=>{Hr();let Ut;if(n.func(rn)){xe=rn}else if(St){if(n.string(rn)){Ut=rn;be.set(rn,{type:void 0,handler:St})}else{Ut=rn.method;be.set(rn.method,{type:rn,handler:St})}}return{dispose:ee(()=>{if(Ut!==void 0){be.delete(Ut)}else{xe=void 0}},"dispose")}},"onNotification"),onProgress:ee((rn,St,Ut)=>{if(Ie.has(St)){throw new Error(`Progress handler for token ${St} already registered`)}Ie.set(St,Ut);return{dispose:ee(()=>{Ie.delete(St)},"dispose")}},"onProgress"),sendProgress:ee((rn,St,Ut)=>{return dr.sendNotification(u.type,{token:St,value:Ut})},"sendProgress"),onUnhandledProgress:it.event,sendRequest:ee((rn,...St)=>{Hr();Er();let Ut;let Pt;let an=void 0;if(n.string(rn)){Ut=rn;const hr=St[0];const Et=St[St.length-1];let Tn=0;let ft=r.ParameterStructures.auto;if(r.ParameterStructures.is(hr)){Tn=1;ft=hr}let zt=St.length;if(a.CancellationToken.is(Et)){zt=zt-1;an=Et}const Gt=zt-Tn;switch(Gt){case 0:Pt=void 0;break;case 1:Pt=Rr(ft,St[Tn]);break;default:if(ft===r.ParameterStructures.byName){throw new Error(`Received ${Gt} parameters for 'by Name' request parameter structure.`)}Pt=St.slice(Tn,zt).map(gn=>vr(gn));break}}else{const hr=St;Ut=rn.method;Pt=Xr(rn,hr);const Et=rn.numberOfParams;an=a.CancellationToken.is(hr[Et])?hr[Et]:void 0}const Xt=J++;let Cn;if(an){Cn=an.onCancellationRequested(()=>{const hr=He.sender.sendCancellation(dr,Xt);if(hr===void 0){te.log(`Received no promise from cancellation strategy when cancelling id ${Xt}`);return Promise.resolve()}else{return hr.catch(()=>{te.log(`Sending cancellation messages for id ${Xt} failed`)})}})}const rr={jsonrpc:re,id:Xt,method:Ut,params:Pt};Sn(rr);if(typeof He.sender.enableCancellation==="function"){He.sender.enableCancellation(rr)}return new Promise(async(hr,Et)=>{const Tn=ee(Gt=>{hr(Gt);He.sender.cleanup(Xt);Cn?.dispose()},"resolveWithCleanup");const ft=ee(Gt=>{Et(Gt);He.sender.cleanup(Xt);Cn?.dispose()},"rejectWithCleanup");const zt={method:Ut,timerStart:Date.now(),resolve:Tn,reject:ft};try{await K.write(rr);ge.set(Xt,zt)}catch(Gt){te.error(`Sending request failed.`);zt.reject(new r.ResponseError(r.ErrorCodes.MessageWriteError,Gt.message?Gt.message:"Unknown reason"));throw Gt}})},"sendRequest"),onRequest:ee((rn,St)=>{Hr();let Ut=null;if(f.is(rn)){Ut=void 0;ce=rn}else if(n.string(rn)){Ut=null;if(St!==void 0){Ut=rn;ue.set(rn,{handler:St,type:void 0})}}else{if(St!==void 0){Ut=rn.method;ue.set(rn.method,{type:rn,handler:St})}}return{dispose:ee(()=>{if(Ut===null){return}if(Ut!==void 0){ue.delete(Ut)}else{ce=void 0}},"dispose")}},"onRequest"),hasPendingResponse:ee(()=>{return ge.size>0},"hasPendingResponse"),trace:ee(async(rn,St,Ut)=>{let Pt=false;let an=g.Text;if(Ut!==void 0){if(n.boolean(Ut)){Pt=Ut}else{Pt=Ut.sendNotification||false;an=Ut.traceFormat||g.Text}}$e=rn;Ee=an;if($e===h.Off){tt=void 0}else{tt=St}if(Pt&&!Qe()&&!ze()){await dr.sendNotification(x.type,{value:h.toString(rn)})}},"trace"),onError:mt.event,onClose:ct.event,onUnhandledNotification:Ge.event,onDispose:bt.event,end:ee(()=>{K.end()},"end"),dispose:ee(()=>{if(ze()){return}yt=W.Disposed;bt.fire(void 0);const rn=new r.ResponseError(r.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const St of ge.values()){St.reject(rn)}ge=new Map;Le=new Map;Ve=new Set;ve=new i.LinkedMap;if(n.func(K.dispose)){K.dispose()}if(n.func($.dispose)){$.dispose()}},"dispose"),listen:ee(()=>{Hr();Mr();yt=W.Listening;$.listen(Wt)},"listen"),inspect:ee(()=>{(0,t.default)().console.log("inspect")},"inspect")};dr.onNotification(w.type,rn=>{if($e===h.Off||!tt){return}const St=$e===h.Verbose||$e===h.Compact;tt.log(rn.message,St?rn.verbose:void 0)});dr.onNotification(u.type,rn=>{const St=Ie.get(rn.token);if(St){St(rn.value)}else{it.fire(rn)}});return dr}ee(H,"createMessageConnection");e.createMessageConnection=H}});Rnt=Os({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/api.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.ProgressType=e.ProgressToken=e.createMessageConnection=e.NullLogger=e.ConnectionOptions=e.ConnectionStrategy=e.AbstractMessageBuffer=e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=e.CancellationToken=e.CancellationTokenSource=e.Emitter=e.Event=e.Disposable=e.LRUCache=e.Touch=e.LinkedMap=e.ParameterStructures=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.ErrorCodes=e.ResponseError=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType0=e.RequestType=e.Message=e.RAL=void 0;e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=void 0;var t=qCn();Object.defineProperty(e,"Message",{enumerable:true,get:ee(function(){return t.Message},"get")});Object.defineProperty(e,"RequestType",{enumerable:true,get:ee(function(){return t.RequestType},"get")});Object.defineProperty(e,"RequestType0",{enumerable:true,get:ee(function(){return t.RequestType0},"get")});Object.defineProperty(e,"RequestType1",{enumerable:true,get:ee(function(){return t.RequestType1},"get")});Object.defineProperty(e,"RequestType2",{enumerable:true,get:ee(function(){return t.RequestType2},"get")});Object.defineProperty(e,"RequestType3",{enumerable:true,get:ee(function(){return t.RequestType3},"get")});Object.defineProperty(e,"RequestType4",{enumerable:true,get:ee(function(){return t.RequestType4},"get")});Object.defineProperty(e,"RequestType5",{enumerable:true,get:ee(function(){return t.RequestType5},"get")});Object.defineProperty(e,"RequestType6",{enumerable:true,get:ee(function(){return t.RequestType6},"get")});Object.defineProperty(e,"RequestType7",{enumerable:true,get:ee(function(){return t.RequestType7},"get")});Object.defineProperty(e,"RequestType8",{enumerable:true,get:ee(function(){return t.RequestType8},"get")});Object.defineProperty(e,"RequestType9",{enumerable:true,get:ee(function(){return t.RequestType9},"get")});Object.defineProperty(e,"ResponseError",{enumerable:true,get:ee(function(){return t.ResponseError},"get")});Object.defineProperty(e,"ErrorCodes",{enumerable:true,get:ee(function(){return t.ErrorCodes},"get")});Object.defineProperty(e,"NotificationType",{enumerable:true,get:ee(function(){return t.NotificationType},"get")});Object.defineProperty(e,"NotificationType0",{enumerable:true,get:ee(function(){return t.NotificationType0},"get")});Object.defineProperty(e,"NotificationType1",{enumerable:true,get:ee(function(){return t.NotificationType1},"get")});Object.defineProperty(e,"NotificationType2",{enumerable:true,get:ee(function(){return t.NotificationType2},"get")});Object.defineProperty(e,"NotificationType3",{enumerable:true,get:ee(function(){return t.NotificationType3},"get")});Object.defineProperty(e,"NotificationType4",{enumerable:true,get:ee(function(){return t.NotificationType4},"get")});Object.defineProperty(e,"NotificationType5",{enumerable:true,get:ee(function(){return t.NotificationType5},"get")});Object.defineProperty(e,"NotificationType6",{enumerable:true,get:ee(function(){return t.NotificationType6},"get")});Object.defineProperty(e,"NotificationType7",{enumerable:true,get:ee(function(){return t.NotificationType7},"get")});Object.defineProperty(e,"NotificationType8",{enumerable:true,get:ee(function(){return t.NotificationType8},"get")});Object.defineProperty(e,"NotificationType9",{enumerable:true,get:ee(function(){return t.NotificationType9},"get")});Object.defineProperty(e,"ParameterStructures",{enumerable:true,get:ee(function(){return t.ParameterStructures},"get")});var n=jCn();Object.defineProperty(e,"LinkedMap",{enumerable:true,get:ee(function(){return n.LinkedMap},"get")});Object.defineProperty(e,"LRUCache",{enumerable:true,get:ee(function(){return n.LRUCache},"get")});Object.defineProperty(e,"Touch",{enumerable:true,get:ee(function(){return n.Touch},"get")});var r=NIi();Object.defineProperty(e,"Disposable",{enumerable:true,get:ee(function(){return r.Disposable},"get")});var i=eH();Object.defineProperty(e,"Event",{enumerable:true,get:ee(function(){return i.Event},"get")});Object.defineProperty(e,"Emitter",{enumerable:true,get:ee(function(){return i.Emitter},"get")});var o=Oke();Object.defineProperty(e,"CancellationTokenSource",{enumerable:true,get:ee(function(){return o.CancellationTokenSource},"get")});Object.defineProperty(e,"CancellationToken",{enumerable:true,get:ee(function(){return o.CancellationToken},"get")});var a=OIi();Object.defineProperty(e,"SharedArraySenderStrategy",{enumerable:true,get:ee(function(){return a.SharedArraySenderStrategy},"get")});Object.defineProperty(e,"SharedArrayReceiverStrategy",{enumerable:true,get:ee(function(){return a.SharedArrayReceiverStrategy},"get")});var s=BIi();Object.defineProperty(e,"MessageReader",{enumerable:true,get:ee(function(){return s.MessageReader},"get")});Object.defineProperty(e,"AbstractMessageReader",{enumerable:true,get:ee(function(){return s.AbstractMessageReader},"get")});Object.defineProperty(e,"ReadableStreamMessageReader",{enumerable:true,get:ee(function(){return s.ReadableStreamMessageReader},"get")});var l=zIi();Object.defineProperty(e,"MessageWriter",{enumerable:true,get:ee(function(){return l.MessageWriter},"get")});Object.defineProperty(e,"AbstractMessageWriter",{enumerable:true,get:ee(function(){return l.AbstractMessageWriter},"get")});Object.defineProperty(e,"WriteableStreamMessageWriter",{enumerable:true,get:ee(function(){return l.WriteableStreamMessageWriter},"get")});var u=UIi();Object.defineProperty(e,"AbstractMessageBuffer",{enumerable:true,get:ee(function(){return u.AbstractMessageBuffer},"get")});var d=VIi();Object.defineProperty(e,"ConnectionStrategy",{enumerable:true,get:ee(function(){return d.ConnectionStrategy},"get")});Object.defineProperty(e,"ConnectionOptions",{enumerable:true,get:ee(function(){return d.ConnectionOptions},"get")});Object.defineProperty(e,"NullLogger",{enumerable:true,get:ee(function(){return d.NullLogger},"get")});Object.defineProperty(e,"createMessageConnection",{enumerable:true,get:ee(function(){return d.createMessageConnection},"get")});Object.defineProperty(e,"ProgressToken",{enumerable:true,get:ee(function(){return d.ProgressToken},"get")});Object.defineProperty(e,"ProgressType",{enumerable:true,get:ee(function(){return d.ProgressType},"get")});Object.defineProperty(e,"Trace",{enumerable:true,get:ee(function(){return d.Trace},"get")});Object.defineProperty(e,"TraceValues",{enumerable:true,get:ee(function(){return d.TraceValues},"get")});Object.defineProperty(e,"TraceFormat",{enumerable:true,get:ee(function(){return d.TraceFormat},"get")});Object.defineProperty(e,"SetTraceNotification",{enumerable:true,get:ee(function(){return d.SetTraceNotification},"get")});Object.defineProperty(e,"LogTraceNotification",{enumerable:true,get:ee(function(){return d.LogTraceNotification},"get")});Object.defineProperty(e,"ConnectionErrors",{enumerable:true,get:ee(function(){return d.ConnectionErrors},"get")});Object.defineProperty(e,"ConnectionError",{enumerable:true,get:ee(function(){return d.ConnectionError},"get")});Object.defineProperty(e,"CancellationReceiverStrategy",{enumerable:true,get:ee(function(){return d.CancellationReceiverStrategy},"get")});Object.defineProperty(e,"CancellationSenderStrategy",{enumerable:true,get:ee(function(){return d.CancellationSenderStrategy},"get")});Object.defineProperty(e,"CancellationStrategy",{enumerable:true,get:ee(function(){return d.CancellationStrategy},"get")});Object.defineProperty(e,"MessageStrategy",{enumerable:true,get:ee(function(){return d.MessageStrategy},"get")});var f=g6();e.RAL=f.default}});$Ii=Os({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/ril.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:true});var t=Rnt();var n=class JCn extends t.AbstractMessageBuffer{static{ee(this,"MessageBuffer")}constructor(u="utf-8"){super(u);this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return JCn.emptyBuffer}fromString(u,d){return new TextEncoder().encode(u)}toString(u,d){if(d==="ascii"){return this.asciiDecoder.decode(u)}else{return new TextDecoder(d).decode(u)}}asNative(u,d){if(d===void 0){return u}else{return u.slice(0,d)}}allocNative(u){return new Uint8Array(u)}};n.emptyBuffer=new Uint8Array(0);var r=class{static{ee(this,"ReadableStreamWrapper")}constructor(l){this.socket=l;this._onData=new t.Emitter;this._messageListener=u=>{const d=u.data;d.arrayBuffer().then(f=>{this._onData.fire(new Uint8Array(f))},()=>{(0,t.RAL)().console.error(`Converting blob to array buffer failed.`)})};this.socket.addEventListener("message",this._messageListener)}onClose(l){this.socket.addEventListener("close",l);return t.Disposable.create(()=>this.socket.removeEventListener("close",l))}onError(l){this.socket.addEventListener("error",l);return t.Disposable.create(()=>this.socket.removeEventListener("error",l))}onEnd(l){this.socket.addEventListener("end",l);return t.Disposable.create(()=>this.socket.removeEventListener("end",l))}onData(l){return this._onData.event(l)}};var i=class{static{ee(this,"WritableStreamWrapper")}constructor(l){this.socket=l}onClose(l){this.socket.addEventListener("close",l);return t.Disposable.create(()=>this.socket.removeEventListener("close",l))}onError(l){this.socket.addEventListener("error",l);return t.Disposable.create(()=>this.socket.removeEventListener("error",l))}onEnd(l){this.socket.addEventListener("end",l);return t.Disposable.create(()=>this.socket.removeEventListener("end",l))}write(l,u){if(typeof l==="string"){if(u!==void 0&&u!=="utf-8"){throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${u}`)}this.socket.send(l)}else{this.socket.send(l)}return Promise.resolve()}end(){this.socket.close()}};var o=new TextEncoder;var a=Object.freeze({messageBuffer:Object.freeze({create:ee(l=>new n(l),"create")}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:ee((l,u)=>{if(u.charset!=="utf-8"){throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${u.charset}`)}return Promise.resolve(o.encode(JSON.stringify(l,void 0,0)))},"encode")}),decoder:Object.freeze({name:"application/json",decode:ee((l,u)=>{if(!(l instanceof Uint8Array)){throw new Error(`In a Browser environments only Uint8Arrays are supported.`)}return Promise.resolve(JSON.parse(new TextDecoder(u.charset).decode(l)))},"decode")})}),stream:Object.freeze({asReadableStream:ee(l=>new r(l),"asReadableStream"),asWritableStream:ee(l=>new i(l),"asWritableStream")}),console,timer:Object.freeze({setTimeout(l,u,...d){const f=setTimeout(l,u,...d);return{dispose:ee(()=>clearTimeout(f),"dispose")}},setImmediate(l,...u){const d=setTimeout(l,0,...u);return{dispose:ee(()=>clearTimeout(d),"dispose")}},setInterval(l,u,...d){const f=setInterval(l,u,...d);return{dispose:ee(()=>clearInterval(f),"dispose")}}})});function s(){return a}ee(s,"RIL");(function(l){function u(){t.RAL.install(a)}ee(u,"install");l.install=u})(s||(s={}));e.default=s}});tH=Os({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/browser/main.js"(e){"use strict";var t=e&&e.__createBinding||(Object.create?function(l,u,d,f){if(f===void 0)f=d;var h=Object.getOwnPropertyDescriptor(u,d);if(!h||("get"in h?!u.__esModule:h.writable||h.configurable)){h={enumerable:true,get:ee(function(){return u[d]},"get")}}Object.defineProperty(l,f,h)}:function(l,u,d,f){if(f===void 0)f=d;l[f]=u[d]});var n=e&&e.__exportStar||function(l,u){for(var d in l)if(d!=="default"&&!Object.prototype.hasOwnProperty.call(u,d))t(u,l,d)};Object.defineProperty(e,"__esModule",{value:true});e.createMessageConnection=e.BrowserMessageWriter=e.BrowserMessageReader=void 0;var r=$Ii();r.default.install();var i=Rnt();n(Rnt(),e);var o=class extends i.AbstractMessageReader{static{ee(this,"BrowserMessageReader")}constructor(l){super();this._onData=new i.Emitter;this._messageListener=u=>{this._onData.fire(u.data)};l.addEventListener("error",u=>this.fireError(u));l.onmessage=this._messageListener}listen(l){return this._onData.event(l)}};e.BrowserMessageReader=o;var a=class extends i.AbstractMessageWriter{static{ee(this,"BrowserMessageWriter")}constructor(l){super();this.port=l;this.errorCount=0;l.addEventListener("error",u=>this.fireError(u))}write(l){try{this.port.postMessage(l);return Promise.resolve()}catch(u){this.handleError(u,l);return Promise.reject(u)}}handleError(l,u){this.errorCount++;this.fireError(l,u,this.errorCount)}end(){}};e.BrowserMessageWriter=a;function s(l,u,d,f){if(d===void 0){d=i.NullLogger}if(i.ConnectionStrategy.is(f)){f={connectionStrategy:f}}return(0,i.createMessageConnection)(l,u,d,f)}ee(s,"createMessageConnection");e.createMessageConnection=s}});eEn=Os({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/browser.js"(e,t){"use strict";t.exports=tH()}});Rf=Os({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/messages.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.ProtocolNotificationType=e.ProtocolNotificationType0=e.ProtocolRequestType=e.ProtocolRequestType0=e.RegistrationType=e.MessageDirection=void 0;var t=tH();var n;(function(l){l["clientToServer"]="clientToServer";l["serverToClient"]="serverToClient";l["both"]="both"})(n||(e.MessageDirection=n={}));var r=class{static{ee(this,"RegistrationType")}constructor(l){this.method=l}};e.RegistrationType=r;var i=class extends t.RequestType0{static{ee(this,"ProtocolRequestType0")}constructor(l){super(l)}};e.ProtocolRequestType0=i;var o=class extends t.RequestType{static{ee(this,"ProtocolRequestType")}constructor(l){super(l,t.ParameterStructures.byName)}};e.ProtocolRequestType=o;var a=class extends t.NotificationType0{static{ee(this,"ProtocolNotificationType0")}constructor(l){super(l)}};e.ProtocolNotificationType0=a;var s=class extends t.NotificationType{static{ee(this,"ProtocolNotificationType")}constructor(l){super(l,t.ParameterStructures.byName)}};e.ProtocolNotificationType=s}});uit=Os({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/utils/is.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.objectLiteral=e.typedArray=e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0;function t(d){return d===true||d===false}ee(t,"boolean");e.boolean=t;function n(d){return typeof d==="string"||d instanceof String}ee(n,"string");e.string=n;function r(d){return typeof d==="number"||d instanceof Number}ee(r,"number");e.number=r;function i(d){return d instanceof Error}ee(i,"error");e.error=i;function o(d){return typeof d==="function"}ee(o,"func");e.func=o;function a(d){return Array.isArray(d)}ee(a,"array");e.array=a;function s(d){return a(d)&&d.every(f=>n(f))}ee(s,"stringArray");e.stringArray=s;function l(d,f){return Array.isArray(d)&&d.every(f)}ee(l,"typedArray");e.typedArray=l;function u(d){return d!==null&&typeof d==="object"}ee(u,"objectLiteral");e.objectLiteral=u}});GIi=Os({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.ImplementationRequest=void 0;var t=Rf();var n;(function(r){r.method="textDocument/implementation";r.messageDirection=t.MessageDirection.clientToServer;r.type=new t.ProtocolRequestType(r.method)})(n||(e.ImplementationRequest=n={}))}});HIi=Os({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.TypeDefinitionRequest=void 0;var t=Rf();var n;(function(r){r.method="textDocument/typeDefinition";r.messageDirection=t.MessageDirection.clientToServer;r.type=new t.ProtocolRequestType(r.method)})(n||(e.TypeDefinitionRequest=n={}))}});WIi=Os({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=void 0;var t=Rf();var n;(function(i){i.method="workspace/workspaceFolders";i.messageDirection=t.MessageDirection.serverToClient;i.type=new t.ProtocolRequestType0(i.method)})(n||(e.WorkspaceFoldersRequest=n={}));var r;(function(i){i.method="workspace/didChangeWorkspaceFolders";i.messageDirection=t.MessageDirection.clientToServer;i.type=new t.ProtocolNotificationType(i.method)})(r||(e.DidChangeWorkspaceFoldersNotification=r={}))}});YIi=Os({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.ConfigurationRequest=void 0;var t=Rf();var n;(function(r){r.method="workspace/configuration";r.messageDirection=t.MessageDirection.serverToClient;r.type=new t.ProtocolRequestType(r.method)})(n||(e.ConfigurationRequest=n={}))}});qIi=Os({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.ColorPresentationRequest=e.DocumentColorRequest=void 0;var t=Rf();var n;(function(i){i.method="textDocument/documentColor";i.messageDirection=t.MessageDirection.clientToServer;i.type=new t.ProtocolRequestType(i.method)})(n||(e.DocumentColorRequest=n={}));var r;(function(i){i.method="textDocument/colorPresentation";i.messageDirection=t.MessageDirection.clientToServer;i.type=new t.ProtocolRequestType(i.method)})(r||(e.ColorPresentationRequest=r={}))}});XIi=Os({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.FoldingRangeRefreshRequest=e.FoldingRangeRequest=void 0;var t=Rf();var n;(function(i){i.method="textDocument/foldingRange";i.messageDirection=t.MessageDirection.clientToServer;i.type=new t.ProtocolRequestType(i.method)})(n||(e.FoldingRangeRequest=n={}));var r;(function(i){i.method=`workspace/foldingRange/refresh`;i.messageDirection=t.MessageDirection.serverToClient;i.type=new t.ProtocolRequestType0(i.method)})(r||(e.FoldingRangeRefreshRequest=r={}))}});jIi=Os({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.DeclarationRequest=void 0;var t=Rf();var n;(function(r){r.method="textDocument/declaration";r.messageDirection=t.MessageDirection.clientToServer;r.type=new t.ProtocolRequestType(r.method)})(n||(e.DeclarationRequest=n={}))}});KIi=Os({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.SelectionRangeRequest=void 0;var t=Rf();var n;(function(r){r.method="textDocument/selectionRange";r.messageDirection=t.MessageDirection.clientToServer;r.type=new t.ProtocolRequestType(r.method)})(n||(e.SelectionRangeRequest=n={}))}});ZIi=Os({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=void 0;var t=tH();var n=Rf();var r;(function(a){a.type=new t.ProgressType;function s(l){return l===a.type}ee(s,"is");a.is=s})(r||(e.WorkDoneProgress=r={}));var i;(function(a){a.method="window/workDoneProgress/create";a.messageDirection=n.MessageDirection.serverToClient;a.type=new n.ProtocolRequestType(a.method)})(i||(e.WorkDoneProgressCreateRequest=i={}));var o;(function(a){a.method="window/workDoneProgress/cancel";a.messageDirection=n.MessageDirection.clientToServer;a.type=new n.ProtocolNotificationType(a.method)})(o||(e.WorkDoneProgressCancelNotification=o={}))}});JIi=Os({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.CallHierarchyPrepareRequest=void 0;var t=Rf();var n;(function(o){o.method="textDocument/prepareCallHierarchy";o.messageDirection=t.MessageDirection.clientToServer;o.type=new t.ProtocolRequestType(o.method)})(n||(e.CallHierarchyPrepareRequest=n={}));var r;(function(o){o.method="callHierarchy/incomingCalls";o.messageDirection=t.MessageDirection.clientToServer;o.type=new t.ProtocolRequestType(o.method)})(r||(e.CallHierarchyIncomingCallsRequest=r={}));var i;(function(o){o.method="callHierarchy/outgoingCalls";o.messageDirection=t.MessageDirection.clientToServer;o.type=new t.ProtocolRequestType(o.method)})(i||(e.CallHierarchyOutgoingCallsRequest=i={}))}});QIi=Os({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.SemanticTokensRegistrationType=e.TokenFormat=void 0;var t=Rf();var n;(function(l){l.Relative="relative"})(n||(e.TokenFormat=n={}));var r;(function(l){l.method="textDocument/semanticTokens";l.type=new t.RegistrationType(l.method)})(r||(e.SemanticTokensRegistrationType=r={}));var i;(function(l){l.method="textDocument/semanticTokens/full";l.messageDirection=t.MessageDirection.clientToServer;l.type=new t.ProtocolRequestType(l.method);l.registrationMethod=r.method})(i||(e.SemanticTokensRequest=i={}));var o;(function(l){l.method="textDocument/semanticTokens/full/delta";l.messageDirection=t.MessageDirection.clientToServer;l.type=new t.ProtocolRequestType(l.method);l.registrationMethod=r.method})(o||(e.SemanticTokensDeltaRequest=o={}));var a;(function(l){l.method="textDocument/semanticTokens/range";l.messageDirection=t.MessageDirection.clientToServer;l.type=new t.ProtocolRequestType(l.method);l.registrationMethod=r.method})(a||(e.SemanticTokensRangeRequest=a={}));var s;(function(l){l.method=`workspace/semanticTokens/refresh`;l.messageDirection=t.MessageDirection.serverToClient;l.type=new t.ProtocolRequestType0(l.method)})(s||(e.SemanticTokensRefreshRequest=s={}))}});e3i=Os({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.ShowDocumentRequest=void 0;var t=Rf();var n;(function(r){r.method="window/showDocument";r.messageDirection=t.MessageDirection.serverToClient;r.type=new t.ProtocolRequestType(r.method)})(n||(e.ShowDocumentRequest=n={}))}});t3i=Os({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.LinkedEditingRangeRequest=void 0;var t=Rf();var n;(function(r){r.method="textDocument/linkedEditingRange";r.messageDirection=t.MessageDirection.clientToServer;r.type=new t.ProtocolRequestType(r.method)})(n||(e.LinkedEditingRangeRequest=n={}))}});n3i=Os({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.WillDeleteFilesRequest=e.DidDeleteFilesNotification=e.DidRenameFilesNotification=e.WillRenameFilesRequest=e.DidCreateFilesNotification=e.WillCreateFilesRequest=e.FileOperationPatternKind=void 0;var t=Rf();var n;(function(u){u.file="file";u.folder="folder"})(n||(e.FileOperationPatternKind=n={}));var r;(function(u){u.method="workspace/willCreateFiles";u.messageDirection=t.MessageDirection.clientToServer;u.type=new t.ProtocolRequestType(u.method)})(r||(e.WillCreateFilesRequest=r={}));var i;(function(u){u.method="workspace/didCreateFiles";u.messageDirection=t.MessageDirection.clientToServer;u.type=new t.ProtocolNotificationType(u.method)})(i||(e.DidCreateFilesNotification=i={}));var o;(function(u){u.method="workspace/willRenameFiles";u.messageDirection=t.MessageDirection.clientToServer;u.type=new t.ProtocolRequestType(u.method)})(o||(e.WillRenameFilesRequest=o={}));var a;(function(u){u.method="workspace/didRenameFiles";u.messageDirection=t.MessageDirection.clientToServer;u.type=new t.ProtocolNotificationType(u.method)})(a||(e.DidRenameFilesNotification=a={}));var s;(function(u){u.method="workspace/didDeleteFiles";u.messageDirection=t.MessageDirection.clientToServer;u.type=new t.ProtocolNotificationType(u.method)})(s||(e.DidDeleteFilesNotification=s={}));var l;(function(u){u.method="workspace/willDeleteFiles";u.messageDirection=t.MessageDirection.clientToServer;u.type=new t.ProtocolRequestType(u.method)})(l||(e.WillDeleteFilesRequest=l={}))}});r3i=Os({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=void 0;var t=Rf();var n;(function(o){o.document="document";o.project="project";o.group="group";o.scheme="scheme";o.global="global"})(n||(e.UniquenessLevel=n={}));var r;(function(o){o.$import="import";o.$export="export";o.local="local"})(r||(e.MonikerKind=r={}));var i;(function(o){o.method="textDocument/moniker";o.messageDirection=t.MessageDirection.clientToServer;o.type=new t.ProtocolRequestType(o.method)})(i||(e.MonikerRequest=i={}))}});i3i=Os({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.TypeHierarchySubtypesRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchyPrepareRequest=void 0;var t=Rf();var n;(function(o){o.method="textDocument/prepareTypeHierarchy";o.messageDirection=t.MessageDirection.clientToServer;o.type=new t.ProtocolRequestType(o.method)})(n||(e.TypeHierarchyPrepareRequest=n={}));var r;(function(o){o.method="typeHierarchy/supertypes";o.messageDirection=t.MessageDirection.clientToServer;o.type=new t.ProtocolRequestType(o.method)})(r||(e.TypeHierarchySupertypesRequest=r={}));var i;(function(o){o.method="typeHierarchy/subtypes";o.messageDirection=t.MessageDirection.clientToServer;o.type=new t.ProtocolRequestType(o.method)})(i||(e.TypeHierarchySubtypesRequest=i={}))}});o3i=Os({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.InlineValueRefreshRequest=e.InlineValueRequest=void 0;var t=Rf();var n;(function(i){i.method="textDocument/inlineValue";i.messageDirection=t.MessageDirection.clientToServer;i.type=new t.ProtocolRequestType(i.method)})(n||(e.InlineValueRequest=n={}));var r;(function(i){i.method=`workspace/inlineValue/refresh`;i.messageDirection=t.MessageDirection.serverToClient;i.type=new t.ProtocolRequestType0(i.method)})(r||(e.InlineValueRefreshRequest=r={}))}});a3i=Os({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=void 0;var t=Rf();var n;(function(o){o.method="textDocument/inlayHint";o.messageDirection=t.MessageDirection.clientToServer;o.type=new t.ProtocolRequestType(o.method)})(n||(e.InlayHintRequest=n={}));var r;(function(o){o.method="inlayHint/resolve";o.messageDirection=t.MessageDirection.clientToServer;o.type=new t.ProtocolRequestType(o.method)})(r||(e.InlayHintResolveRequest=r={}));var i;(function(o){o.method=`workspace/inlayHint/refresh`;o.messageDirection=t.MessageDirection.serverToClient;o.type=new t.ProtocolRequestType0(o.method)})(i||(e.InlayHintRefreshRequest=i={}))}});s3i=Os({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=void 0;var t=tH();var n=uit();var r=Rf();var i;(function(u){function d(f){const h=f;return h&&n.boolean(h.retriggerRequest)}ee(d,"is");u.is=d})(i||(e.DiagnosticServerCancellationData=i={}));var o;(function(u){u.Full="full";u.Unchanged="unchanged"})(o||(e.DocumentDiagnosticReportKind=o={}));var a;(function(u){u.method="textDocument/diagnostic";u.messageDirection=r.MessageDirection.clientToServer;u.type=new r.ProtocolRequestType(u.method);u.partialResult=new t.ProgressType})(a||(e.DocumentDiagnosticRequest=a={}));var s;(function(u){u.method="workspace/diagnostic";u.messageDirection=r.MessageDirection.clientToServer;u.type=new r.ProtocolRequestType(u.method);u.partialResult=new t.ProgressType})(s||(e.WorkspaceDiagnosticRequest=s={}));var l;(function(u){u.method=`workspace/diagnostic/refresh`;u.messageDirection=r.MessageDirection.serverToClient;u.type=new r.ProtocolRequestType0(u.method)})(l||(e.DiagnosticRefreshRequest=l={}))}});l3i=Os({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.DidCloseNotebookDocumentNotification=e.DidSaveNotebookDocumentNotification=e.DidChangeNotebookDocumentNotification=e.NotebookCellArrayChange=e.DidOpenNotebookDocumentNotification=e.NotebookDocumentSyncRegistrationType=e.NotebookDocument=e.NotebookCell=e.ExecutionSummary=e.NotebookCellKind=void 0;var t=(Wne(),cit(Nke));var n=uit();var r=Rf();var i;(function(g){g.Markup=1;g.Code=2;function x(w){return w===1||w===2}ee(x,"is");g.is=x})(i||(e.NotebookCellKind=i={}));var o;(function(g){function x(C,A){const P={executionOrder:C};if(A===true||A===false){P.success=A}return P}ee(x,"create");g.create=x;function w(C){const A=C;return n.objectLiteral(A)&&t.uinteger.is(A.executionOrder)&&(A.success===void 0||n.boolean(A.success))}ee(w,"is");g.is=w;function _(C,A){if(C===A){return true}if(C===null||C===void 0||A===null||A===void 0){return false}return C.executionOrder===A.executionOrder&&C.success===A.success}ee(_,"equals");g.equals=_})(o||(e.ExecutionSummary=o={}));var a;(function(g){function x(A,P){return{kind:A,document:P}}ee(x,"create");g.create=x;function w(A){const P=A;return n.objectLiteral(P)&&i.is(P.kind)&&t.DocumentUri.is(P.document)&&(P.metadata===void 0||n.objectLiteral(P.metadata))}ee(w,"is");g.is=w;function _(A,P){const L=new Set;if(A.document!==P.document){L.add("document")}if(A.kind!==P.kind){L.add("kind")}if(A.executionSummary!==P.executionSummary){L.add("executionSummary")}if((A.metadata!==void 0||P.metadata!==void 0)&&!C(A.metadata,P.metadata)){L.add("metadata")}if((A.executionSummary!==void 0||P.executionSummary!==void 0)&&!o.equals(A.executionSummary,P.executionSummary)){L.add("executionSummary")}return L}ee(_,"diff");g.diff=_;function C(A,P){if(A===P){return true}if(A===null||A===void 0||P===null||P===void 0){return false}if(typeof A!==typeof P){return false}if(typeof A!=="object"){return false}const L=Array.isArray(A);const I=Array.isArray(P);if(L!==I){return false}if(L&&I){if(A.length!==P.length){return false}for(let N=0;N0}ee(Rr,"hasId");nt.hasId=Rr})(J||(e.StaticRegistrationOptions=J={}));var oe;(function(nt){function Rr(Xr){const dr=Xr;return dr&&(dr.documentSelector===null||H.is(dr.documentSelector))}ee(Rr,"is");nt.is=Rr})(oe||(e.TextDocumentRegistrationOptions=oe={}));var se;(function(nt){function Rr(dr){const rn=dr;return r.objectLiteral(rn)&&(rn.workDoneProgress===void 0||r.boolean(rn.workDoneProgress))}ee(Rr,"is");nt.is=Rr;function Xr(dr){const rn=dr;return rn&&r.boolean(rn.workDoneProgress)}ee(Xr,"hasWorkDoneProgress");nt.hasWorkDoneProgress=Xr})(se||(e.WorkDoneProgressOptions=se={}));var re;(function(nt){nt.method="initialize";nt.messageDirection=t.MessageDirection.clientToServer;nt.type=new t.ProtocolRequestType(nt.method)})(re||(e.InitializeRequest=re={}));var ce;(function(nt){nt.unknownProtocolVersion=1})(ce||(e.InitializeErrorCodes=ce={}));var ue;(function(nt){nt.method="initialized";nt.messageDirection=t.MessageDirection.clientToServer;nt.type=new t.ProtocolNotificationType(nt.method)})(ue||(e.InitializedNotification=ue={}));var xe;(function(nt){nt.method="shutdown";nt.messageDirection=t.MessageDirection.clientToServer;nt.type=new t.ProtocolRequestType0(nt.method)})(xe||(e.ShutdownRequest=xe={}));var be;(function(nt){nt.method="exit";nt.messageDirection=t.MessageDirection.clientToServer;nt.type=new t.ProtocolNotificationType0(nt.method)})(be||(e.ExitNotification=be={}));var Ie;(function(nt){nt.method="workspace/didChangeConfiguration";nt.messageDirection=t.MessageDirection.clientToServer;nt.type=new t.ProtocolNotificationType(nt.method)})(Ie||(e.DidChangeConfigurationNotification=Ie={}));var he;(function(nt){nt.Error=1;nt.Warning=2;nt.Info=3;nt.Log=4;nt.Debug=5})(he||(e.MessageType=he={}));var ve;(function(nt){nt.method="window/showMessage";nt.messageDirection=t.MessageDirection.serverToClient;nt.type=new t.ProtocolNotificationType(nt.method)})(ve||(e.ShowMessageNotification=ve={}));var ge;(function(nt){nt.method="window/showMessageRequest";nt.messageDirection=t.MessageDirection.serverToClient;nt.type=new t.ProtocolRequestType(nt.method)})(ge||(e.ShowMessageRequest=ge={}));var Ve;(function(nt){nt.method="window/logMessage";nt.messageDirection=t.MessageDirection.serverToClient;nt.type=new t.ProtocolNotificationType(nt.method)})(Ve||(e.LogMessageNotification=Ve={}));var Le;(function(nt){nt.method="telemetry/event";nt.messageDirection=t.MessageDirection.serverToClient;nt.type=new t.ProtocolNotificationType(nt.method)})(Le||(e.TelemetryEventNotification=Le={}));var $e;(function(nt){nt.None=0;nt.Full=1;nt.Incremental=2})($e||(e.TextDocumentSyncKind=$e={}));var Ee;(function(nt){nt.method="textDocument/didOpen";nt.messageDirection=t.MessageDirection.clientToServer;nt.type=new t.ProtocolNotificationType(nt.method)})(Ee||(e.DidOpenTextDocumentNotification=Ee={}));var tt;(function(nt){function Rr(dr){let rn=dr;return rn!==void 0&&rn!==null&&typeof rn.text==="string"&&rn.range!==void 0&&(rn.rangeLength===void 0||typeof rn.rangeLength==="number")}ee(Rr,"isIncremental");nt.isIncremental=Rr;function Xr(dr){let rn=dr;return rn!==void 0&&rn!==null&&typeof rn.text==="string"&&rn.range===void 0&&rn.rangeLength===void 0}ee(Xr,"isFull");nt.isFull=Xr})(tt||(e.TextDocumentContentChangeEvent=tt={}));var yt;(function(nt){nt.method="textDocument/didChange";nt.messageDirection=t.MessageDirection.clientToServer;nt.type=new t.ProtocolNotificationType(nt.method)})(yt||(e.DidChangeTextDocumentNotification=yt={}));var mt;(function(nt){nt.method="textDocument/didClose";nt.messageDirection=t.MessageDirection.clientToServer;nt.type=new t.ProtocolNotificationType(nt.method)})(mt||(e.DidCloseTextDocumentNotification=mt={}));var ct;(function(nt){nt.method="textDocument/didSave";nt.messageDirection=t.MessageDirection.clientToServer;nt.type=new t.ProtocolNotificationType(nt.method)})(ct||(e.DidSaveTextDocumentNotification=ct={}));var Ge;(function(nt){nt.Manual=1;nt.AfterDelay=2;nt.FocusOut=3})(Ge||(e.TextDocumentSaveReason=Ge={}));var it;(function(nt){nt.method="textDocument/willSave";nt.messageDirection=t.MessageDirection.clientToServer;nt.type=new t.ProtocolNotificationType(nt.method)})(it||(e.WillSaveTextDocumentNotification=it={}));var bt;(function(nt){nt.method="textDocument/willSaveWaitUntil";nt.messageDirection=t.MessageDirection.clientToServer;nt.type=new t.ProtocolRequestType(nt.method)})(bt||(e.WillSaveTextDocumentWaitUntilRequest=bt={}));var He;(function(nt){nt.method="workspace/didChangeWatchedFiles";nt.messageDirection=t.MessageDirection.clientToServer;nt.type=new t.ProtocolNotificationType(nt.method)})(He||(e.DidChangeWatchedFilesNotification=He={}));var Je;(function(nt){nt.Created=1;nt.Changed=2;nt.Deleted=3})(Je||(e.FileChangeType=Je={}));var Te;(function(nt){function Rr(Xr){const dr=Xr;return r.objectLiteral(dr)&&(n.URI.is(dr.baseUri)||n.WorkspaceFolder.is(dr.baseUri))&&r.string(dr.pattern)}ee(Rr,"is");nt.is=Rr})(Te||(e.RelativePattern=Te={}));var we;(function(nt){nt.Create=1;nt.Change=2;nt.Delete=4})(we||(e.WatchKind=we={}));var Ze;(function(nt){nt.method="textDocument/publishDiagnostics";nt.messageDirection=t.MessageDirection.serverToClient;nt.type=new t.ProtocolNotificationType(nt.method)})(Ze||(e.PublishDiagnosticsNotification=Ze={}));var Be;(function(nt){nt.Invoked=1;nt.TriggerCharacter=2;nt.TriggerForIncompleteCompletions=3})(Be||(e.CompletionTriggerKind=Be={}));var qe;(function(nt){nt.method="textDocument/completion";nt.messageDirection=t.MessageDirection.clientToServer;nt.type=new t.ProtocolRequestType(nt.method)})(qe||(e.CompletionRequest=qe={}));var Qe;(function(nt){nt.method="completionItem/resolve";nt.messageDirection=t.MessageDirection.clientToServer;nt.type=new t.ProtocolRequestType(nt.method)})(Qe||(e.CompletionResolveRequest=Qe={}));var ze;(function(nt){nt.method="textDocument/hover";nt.messageDirection=t.MessageDirection.clientToServer;nt.type=new t.ProtocolRequestType(nt.method)})(ze||(e.HoverRequest=ze={}));var Me;(function(nt){nt.Invoked=1;nt.TriggerCharacter=2;nt.ContentChange=3})(Me||(e.SignatureHelpTriggerKind=Me={}));var ye;(function(nt){nt.method="textDocument/signatureHelp";nt.messageDirection=t.MessageDirection.clientToServer;nt.type=new t.ProtocolRequestType(nt.method)})(ye||(e.SignatureHelpRequest=ye={}));var Ne;(function(nt){nt.method="textDocument/definition";nt.messageDirection=t.MessageDirection.clientToServer;nt.type=new t.ProtocolRequestType(nt.method)})(Ne||(e.DefinitionRequest=Ne={}));var Ae;(function(nt){nt.method="textDocument/references";nt.messageDirection=t.MessageDirection.clientToServer;nt.type=new t.ProtocolRequestType(nt.method)})(Ae||(e.ReferencesRequest=Ae={}));var dt;(function(nt){nt.method="textDocument/documentHighlight";nt.messageDirection=t.MessageDirection.clientToServer;nt.type=new t.ProtocolRequestType(nt.method)})(dt||(e.DocumentHighlightRequest=dt={}));var Oe;(function(nt){nt.method="textDocument/documentSymbol";nt.messageDirection=t.MessageDirection.clientToServer;nt.type=new t.ProtocolRequestType(nt.method)})(Oe||(e.DocumentSymbolRequest=Oe={}));var Wt;(function(nt){nt.method="textDocument/codeAction";nt.messageDirection=t.MessageDirection.clientToServer;nt.type=new t.ProtocolRequestType(nt.method)})(Wt||(e.CodeActionRequest=Wt={}));var kt;(function(nt){nt.method="codeAction/resolve";nt.messageDirection=t.MessageDirection.clientToServer;nt.type=new t.ProtocolRequestType(nt.method)})(kt||(e.CodeActionResolveRequest=kt={}));var qt;(function(nt){nt.method="workspace/symbol";nt.messageDirection=t.MessageDirection.clientToServer;nt.type=new t.ProtocolRequestType(nt.method)})(qt||(e.WorkspaceSymbolRequest=qt={}));var _t;(function(nt){nt.method="workspaceSymbol/resolve";nt.messageDirection=t.MessageDirection.clientToServer;nt.type=new t.ProtocolRequestType(nt.method)})(_t||(e.WorkspaceSymbolResolveRequest=_t={}));var sn;(function(nt){nt.method="textDocument/codeLens";nt.messageDirection=t.MessageDirection.clientToServer;nt.type=new t.ProtocolRequestType(nt.method)})(sn||(e.CodeLensRequest=sn={}));var Jt;(function(nt){nt.method="codeLens/resolve";nt.messageDirection=t.MessageDirection.clientToServer;nt.type=new t.ProtocolRequestType(nt.method)})(Jt||(e.CodeLensResolveRequest=Jt={}));var Sn;(function(nt){nt.method=`workspace/codeLens/refresh`;nt.messageDirection=t.MessageDirection.serverToClient;nt.type=new t.ProtocolRequestType0(nt.method)})(Sn||(e.CodeLensRefreshRequest=Sn={}));var Kt;(function(nt){nt.method="textDocument/documentLink";nt.messageDirection=t.MessageDirection.clientToServer;nt.type=new t.ProtocolRequestType(nt.method)})(Kt||(e.DocumentLinkRequest=Kt={}));var mn;(function(nt){nt.method="documentLink/resolve";nt.messageDirection=t.MessageDirection.clientToServer;nt.type=new t.ProtocolRequestType(nt.method)})(mn||(e.DocumentLinkResolveRequest=mn={}));var At;(function(nt){nt.method="textDocument/formatting";nt.messageDirection=t.MessageDirection.clientToServer;nt.type=new t.ProtocolRequestType(nt.method)})(At||(e.DocumentFormattingRequest=At={}));var lr;(function(nt){nt.method="textDocument/rangeFormatting";nt.messageDirection=t.MessageDirection.clientToServer;nt.type=new t.ProtocolRequestType(nt.method)})(lr||(e.DocumentRangeFormattingRequest=lr={}));var on;(function(nt){nt.method="textDocument/rangesFormatting";nt.messageDirection=t.MessageDirection.clientToServer;nt.type=new t.ProtocolRequestType(nt.method)})(on||(e.DocumentRangesFormattingRequest=on={}));var cr;(function(nt){nt.method="textDocument/onTypeFormatting";nt.messageDirection=t.MessageDirection.clientToServer;nt.type=new t.ProtocolRequestType(nt.method)})(cr||(e.DocumentOnTypeFormattingRequest=cr={}));var Hr;(function(nt){nt.Identifier=1})(Hr||(e.PrepareSupportDefaultBehavior=Hr={}));var Mr;(function(nt){nt.method="textDocument/rename";nt.messageDirection=t.MessageDirection.clientToServer;nt.type=new t.ProtocolRequestType(nt.method)})(Mr||(e.RenameRequest=Mr={}));var Er;(function(nt){nt.method="textDocument/prepareRename";nt.messageDirection=t.MessageDirection.clientToServer;nt.type=new t.ProtocolRequestType(nt.method)})(Er||(e.PrepareRenameRequest=Er={}));var vr;(function(nt){nt.method="workspace/executeCommand";nt.messageDirection=t.MessageDirection.clientToServer;nt.type=new t.ProtocolRequestType(nt.method)})(vr||(e.ExecuteCommandRequest=vr={}));var Yr;(function(nt){nt.method="workspace/applyEdit";nt.messageDirection=t.MessageDirection.serverToClient;nt.type=new t.ProtocolRequestType("workspace/applyEdit")})(Yr||(e.ApplyWorkspaceEditRequest=Yr={}))}});d3i=Os({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/connection.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:true});e.createProtocolConnection=void 0;var t=tH();function n(r,i,o,a){if(t.ConnectionStrategy.is(a)){a={connectionStrategy:a}}return(0,t.createMessageConnection)(r,i,o,a)}ee(n,"createProtocolConnection");e.createProtocolConnection=n}});f3i=Os({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/common/api.js"(e){"use strict";var t=e&&e.__createBinding||(Object.create?function(o,a,s,l){if(l===void 0)l=s;var u=Object.getOwnPropertyDescriptor(a,s);if(!u||("get"in u?!a.__esModule:u.writable||u.configurable)){u={enumerable:true,get:ee(function(){return a[s]},"get")}}Object.defineProperty(o,l,u)}:function(o,a,s,l){if(l===void 0)l=s;o[l]=a[s]});var n=e&&e.__exportStar||function(o,a){for(var s in o)if(s!=="default"&&!Object.prototype.hasOwnProperty.call(a,s))t(a,o,s)};Object.defineProperty(e,"__esModule",{value:true});e.LSPErrorCodes=e.createProtocolConnection=void 0;n(tH(),e);n((Wne(),cit(Nke)),e);n(Rf(),e);n(u3i(),e);var r=d3i();Object.defineProperty(e,"createProtocolConnection",{enumerable:true,get:ee(function(){return r.createProtocolConnection},"get")});var i;(function(o){o.lspReservedErrorRangeStart=-32899;o.RequestFailed=-32803;o.ServerCancelled=-32802;o.ContentModified=-32801;o.RequestCancelled=-32800;o.lspReservedErrorRangeEnd=-32800})(i||(e.LSPErrorCodes=i={}))}});h3i=Os({"../../node_modules/.pnpm/vscode-languageserver-protocol@3.17.5/node_modules/vscode-languageserver-protocol/lib/browser/main.js"(e){"use strict";var t=e&&e.__createBinding||(Object.create?function(o,a,s,l){if(l===void 0)l=s;var u=Object.getOwnPropertyDescriptor(a,s);if(!u||("get"in u?!a.__esModule:u.writable||u.configurable)){u={enumerable:true,get:ee(function(){return a[s]},"get")}}Object.defineProperty(o,l,u)}:function(o,a,s,l){if(l===void 0)l=s;o[l]=a[s]});var n=e&&e.__exportStar||function(o,a){for(var s in o)if(s!=="default"&&!Object.prototype.hasOwnProperty.call(a,s))t(a,o,s)};Object.defineProperty(e,"__esModule",{value:true});e.createProtocolConnection=void 0;var r=eEn();n(eEn(),e);n(f3i(),e);function i(o,a,s,l){return(0,r.createMessageConnection)(o,a,s,l)}ee(i,"createProtocolConnection");e.createProtocolConnection=i}});Og={};mD(Og,{AbstractAstReflection:()=>hit,AbstractCstNode:()=>mat,AbstractLangiumParser:()=>yat,AbstractParserErrorMessageProvider:()=>UDn,AbstractThreadedAsyncParser:()=>$8i,AstUtils:()=>pit,BiMap:()=>Pke,Cancellation:()=>cd,CompositeCstNodeImpl:()=>LRe,ContextCache:()=>URe,CstNodeBuilder:()=>NDn,CstUtils:()=>dit,DEFAULT_TOKENIZE_OPTIONS:()=>Fat,DONE_RESULT:()=>ib,DatatypeSymbol:()=>Ske,DefaultAstNodeDescriptionProvider:()=>gFn,DefaultAstNodeLocator:()=>bFn,DefaultAsyncParser:()=>NFn,DefaultCommentProvider:()=>FFn,DefaultConfigurationProvider:()=>xFn,DefaultDocumentBuilder:()=>vFn,DefaultDocumentValidator:()=>mFn,DefaultHydrator:()=>BFn,DefaultIndexManager:()=>_Fn,DefaultJsonSerializer:()=>dFn,DefaultLangiumDocumentFactory:()=>nFn,DefaultLangiumDocuments:()=>rFn,DefaultLangiumProfiler:()=>q8i,DefaultLexer:()=>Nat,DefaultLexerErrorMessageProvider:()=>wFn,DefaultLinker:()=>iFn,DefaultNameProvider:()=>oFn,DefaultReferenceDescriptionProvider:()=>yFn,DefaultReferences:()=>aFn,DefaultScopeComputation:()=>sFn,DefaultScopeProvider:()=>uFn,DefaultServiceRegistry:()=>fFn,DefaultTokenBuilder:()=>NRe,DefaultValueConverter:()=>Eat,DefaultWorkspaceLock:()=>OFn,DefaultWorkspaceManager:()=>TFn,Deferred:()=>tP,Disposable:()=>d6,DisposableCache:()=>zRe,DocumentCache:()=>cFn,DocumentState:()=>Sl,DocumentValidator:()=>H_,EMPTY_SCOPE:()=>B8i,EMPTY_STREAM:()=>GG,EmptyFileSystem:()=>Rc,EmptyFileSystemProvider:()=>VFn,ErrorWithLocation:()=>Yke,GrammarAST:()=>tSn,GrammarUtils:()=>Hit,IndentationAwareLexer:()=>H8i,IndentationAwareTokenBuilder:()=>UFn,JSDocDocumentationProvider:()=>DFn,LangiumCompletionParser:()=>VDn,LangiumParser:()=>zDn,LangiumParserErrorMessageProvider:()=>bat,LeafCstNodeImpl:()=>Cke,LexingMode:()=>c6,MapScope:()=>O8i,Module:()=>urt,MultiMap:()=>nP,MultiMapScope:()=>lFn,OperationCancelled:()=>mS,ParserWorker:()=>G8i,ProfilingTask:()=>GFn,Reduction:()=>kne,RefResolving:()=>DB,RegExpUtils:()=>Yit,RootCstNodeImpl:()=>gat,SimpleCache:()=>Pat,StreamImpl:()=>pS,StreamScope:()=>art,TextDocument:()=>kke,TreeStreamImpl:()=>HG,URI:()=>uv,UriTrie:()=>kat,UriUtils:()=>ab,VALIDATE_EACH_NODE:()=>pFn,ValidationCategory:()=>Ike,ValidationRegistry:()=>hFn,ValueConverter:()=>fS,WorkspaceCache:()=>Iat,assertCondition:()=>Wit,assertUnreachable:()=>gD,createCompletionParser:()=>_at,createDefaultCoreModule:()=>yc,createDefaultSharedCoreModule:()=>bc,createGrammarConfig:()=>uot,createLangiumParser:()=>Tat,createParser:()=>DRe,delayNextTick:()=>ORe,diagnosticData:()=>l6,eagerLoad:()=>Gat,getDiagnosticRange:()=>Lat,indentationBuilderDefaultOptions:()=>frt,inject:()=>us,interruptAndCheck:()=>$m,isAstNode:()=>ip,isAstNodeDescription:()=>fit,isAstNodeWithComment:()=>Mat,isCompositeCstNode:()=>qR,isIMultiModeLexerDefinition:()=>GRe,isJSDoc:()=>Bat,isLeafCstNode:()=>y6,isLinkingError:()=>zB,isMultiReference:()=>gS,isNamed:()=>Rat,isOperationCancelled:()=>N6,isReference:()=>ob,isRootCstNode:()=>Bke,isTokenTypeArray:()=>$Re,isTokenTypeDictionary:()=>Mke,loadGrammarFromJson:()=>Gm,parseJSDoc:()=>Oat,prepareLangiumParser:()=>wat,setInterruptionPeriod:()=>Cat,startCancelableOperation:()=>BRe,stream:()=>gu,toDiagnosticData:()=>Dat,toDiagnosticSeverity:()=>wne});dit={};mD(dit,{DefaultNameRegexp:()=>zit,RangeComparison:()=>hS,compareRange:()=>Oit,findCommentNode:()=>Uit,findDeclarationNodeAtOffset:()=>vSn,findLeafNodeAtOffset:()=>Wke,findLeafNodeBeforeOffset:()=>Vit,flattenCst:()=>xSn,getDatatypeNode:()=>bSn,getInteriorNodes:()=>wSn,getNextNode:()=>_Sn,getPreviousNode:()=>Git,getStartlineNode:()=>TSn,inRange:()=>Bit,isChildNode:()=>Nit,isCommentNode:()=>cke,streamCst:()=>XG,toDocumentSegment:()=>jG,tokenToRange:()=>Rne});ee(ip,"isAstNode");ee(ob,"isReference");ee(gS,"isMultiReference");ee(fit,"isAstNodeDescription");ee(zB,"isLinkingError");hit=class{static{ee(this,"AbstractAstReflection")}constructor(){this.subtypes={};this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(e){const t=this.types[e.container.$type];if(!t){throw new Error(`Type ${e.container.$type||"undefined"} not found.`)}const n=t.properties[e.property]?.referenceType;if(!n){throw new Error(`Property ${e.property||"undefined"} of type ${e.container.$type} is not a reference.`)}return n}getTypeMetaData(e){const t=this.types[e];if(!t){return{name:e,properties:{},superTypes:[]}}return t}isInstance(e,t){return ip(e)&&this.isSubtype(e.$type,t)}isSubtype(e,t){if(e===t){return true}let n=this.subtypes[e];if(!n){n=this.subtypes[e]={}}const r=n[t];if(r!==void 0){return r}else{const i=this.types[e];const o=i?i.superTypes.some(a=>this.isSubtype(a,t)):false;n[t]=o;return o}}getAllSubTypes(e){const t=this.allSubtypes[e];if(t){return t}else{const n=this.getAllTypes();const r=[];for(const i of n){if(this.isSubtype(i,e)){r.push(i)}}this.allSubtypes[e]=r;return r}}};ee(qR,"isCompositeCstNode");ee(y6,"isLeafCstNode");ee(Bke,"isRootCstNode");pS=class $R{static{ee(this,"StreamImpl")}constructor(t,n){this.startFn=t;this.nextFn=n}iterator(){const t={state:this.startFn(),next:ee(()=>this.nextFn(t.state),"next"),[Symbol.iterator]:()=>t};return t}[Symbol.iterator](){return this.iterator()}isEmpty(){const t=this.iterator();return Boolean(t.next().done)}count(){const t=this.iterator();let n=0;let r=t.next();while(!r.done){n++;r=t.next()}return n}toArray(){const t=[];const n=this.iterator();let r;do{r=n.next();if(r.value!==void 0){t.push(r.value)}}while(!r.done);return t}toSet(){return new Set(this)}toMap(t,n){const r=this.map(i=>[t?t(i):i,n?n(i):i]);return new Map(r)}toString(){return this.join()}concat(t){return new $R(()=>({first:this.startFn(),firstDone:false,iterator:t[Symbol.iterator]()}),n=>{let r;if(!n.firstDone){do{r=this.nextFn(n.first);if(!r.done){return r}}while(!r.done);n.firstDone=true}do{r=n.iterator.next();if(!r.done){return r}}while(!r.done);return ib})}join(t=","){const n=this.iterator();let r="";let i;let o=false;do{i=n.next();if(!i.done){if(o){r+=t}r+=QCn(i.value)}o=true}while(!i.done);return r}indexOf(t,n=0){const r=this.iterator();let i=0;let o=r.next();while(!o.done){if(i>=n&&o.value===t){return i}o=r.next();i++}return-1}every(t){const n=this.iterator();let r=n.next();while(!r.done){if(!t(r.value)){return false}r=n.next()}return true}some(t){const n=this.iterator();let r=n.next();while(!r.done){if(t(r.value)){return true}r=n.next()}return false}forEach(t){const n=this.iterator();let r=0;let i=n.next();while(!i.done){t(i.value,r);i=n.next();r++}}map(t){return new $R(this.startFn,n=>{const{done:r,value:i}=this.nextFn(n);if(r){return ib}else{return{done:false,value:t(i)}}})}filter(t){return new $R(this.startFn,n=>{let r;do{r=this.nextFn(n);if(!r.done&&t(r.value)){return r}}while(!r.done);return ib})}nonNullable(){return this.filter(t=>t!==void 0&&t!==null)}reduce(t,n){const r=this.iterator();let i=n;let o=r.next();while(!o.done){if(i===void 0){i=o.value}else{i=t(i,o.value)}o=r.next()}return i}reduceRight(t,n){return this.recursiveReduce(this.iterator(),t,n)}recursiveReduce(t,n,r){const i=t.next();if(i.done){return r}const o=this.recursiveReduce(t,n,r);if(o===void 0){return i.value}return n(o,i.value)}find(t){const n=this.iterator();let r=n.next();while(!r.done){if(t(r.value)){return r.value}r=n.next()}return void 0}findIndex(t){const n=this.iterator();let r=0;let i=n.next();while(!i.done){if(t(i.value)){return r}i=n.next();r++}return-1}includes(t){const n=this.iterator();let r=n.next();while(!r.done){if(r.value===t){return true}r=n.next()}return false}flatMap(t){return new $R(()=>({this:this.startFn()}),n=>{do{if(n.iterator){const o=n.iterator.next();if(o.done){n.iterator=void 0}else{return o}}const{done:r,value:i}=this.nextFn(n.this);if(!r){const o=t(i);if(Ane(o)){n.iterator=o[Symbol.iterator]()}else{return{done:false,value:o}}}}while(n.iterator);return ib})}flat(t){if(t===void 0){t=1}if(t<=0){return this}const n=t>1?this.flat(t-1):this;return new $R(()=>({this:n.startFn()}),r=>{do{if(r.iterator){const a=r.iterator.next();if(a.done){r.iterator=void 0}else{return a}}const{done:i,value:o}=n.nextFn(r.this);if(!i){if(Ane(o)){r.iterator=o[Symbol.iterator]()}else{return{done:false,value:o}}}}while(r.iterator);return ib})}head(){const t=this.iterator();const n=t.next();if(n.done){return void 0}return n.value}tail(t=1){return new $R(()=>{const n=this.startFn();for(let r=0;r({size:0,state:this.startFn()}),n=>{n.size++;if(n.size>t){return ib}return this.nextFn(n.state)})}distinct(t){return new $R(()=>({set:new Set,internalState:this.startFn()}),n=>{let r;do{r=this.nextFn(n.internalState);if(!r.done){const i=t?t(r.value):r.value;if(!n.set.has(i)){n.set.add(i);return r}}}while(!r.done);return ib})}exclude(t,n){const r=new Set;for(const i of t){const o=n?n(i):i;r.add(o)}return this.filter(i=>{const o=n?n(i):i;return!r.has(o)})}};ee(QCn,"toString");ee(Ane,"isIterable");GG=new pS(()=>void 0,()=>ib);ib=Object.freeze({done:true,value:void 0});ee(gu,"stream");HG=class extends pS{static{ee(this,"TreeStreamImpl")}constructor(e,t,n){super(()=>({iterators:n?.includeRoot?[[e][Symbol.iterator]()]:[t(e)[Symbol.iterator]()],pruned:false}),r=>{if(r.pruned){r.iterators.pop();r.pruned=false}while(r.iterators.length>0){const i=r.iterators[r.iterators.length-1];const o=i.next();if(o.done){r.iterators.pop()}else{r.iterators.push(t(o.value)[Symbol.iterator]());return o}}return ib})}iterator(){const e={state:this.startFn(),next:ee(()=>this.nextFn(e.state),"next"),prune:ee(()=>{e.state.pruned=true},"prune"),[Symbol.iterator]:()=>e};return e}};(function(e){function t(o){return o.reduce((a,s)=>a+s,0)}ee(t,"sum");e.sum=t;function n(o){return o.reduce((a,s)=>a*s,0)}ee(n,"product");e.product=n;function r(o){return o.reduce((a,s)=>Math.min(a,s))}ee(r,"min");e.min=r;function i(o){return o.reduce((a,s)=>Math.max(a,s))}ee(i,"max");e.max=i})(kne||(kne={}));pit={};mD(pit,{assignMandatoryProperties:()=>mit,copyAstNode:()=>jAe,findRootNode:()=>zG,getContainerOfType:()=>b6,getDocument:()=>Vw,getReferenceNodes:()=>qAe,hasContainerOfType:()=>eSn,linkContentToContainer:()=>WG,streamAllContents:()=>rP,streamAst:()=>$w,streamContents:()=>qne,streamReferences:()=>YG});ee(WG,"linkContentToContainer");ee(b6,"getContainerOfType");ee(eSn,"hasContainerOfType");ee(Vw,"getDocument");ee(zG,"findRootNode");ee(qAe,"getReferenceNodes");ee(qne,"streamContents");ee(rP,"streamAllContents");ee($w,"streamAst");ee(XAe,"isAstNodeInRange");ee(YG,"streamReferences");ee(mit,"assignMandatoryProperties");ee(git,"copyDefaultValue");ee(jAe,"copyAstNode");tSn={};mD(tSn,{AbstractElement:()=>Sx,AbstractParserRule:()=>cne,AbstractRule:()=>RG,AbstractType:()=>cv,Action:()=>nD,Alternatives:()=>une,ArrayLiteral:()=>KAe,ArrayType:()=>ZAe,Assignment:()=>rD,BooleanLiteral:()=>JAe,CharacterRange:()=>iD,Condition:()=>oD,Conjunction:()=>dne,CrossReference:()=>aD,Disjunction:()=>fne,EndOfFile:()=>QAe,Grammar:()=>HR,GrammarImport:()=>eke,Group:()=>UB,InferredType:()=>tke,InfixRule:()=>dS,InfixRuleOperatorList:()=>hne,InfixRuleOperators:()=>nke,Interface:()=>PG,Keyword:()=>IG,LangiumGrammarAstReflection:()=>Fit,LangiumGrammarTerminals:()=>p3i,NamedArgument:()=>MG,NegatedToken:()=>VB,Negation:()=>rke,NumberLiteral:()=>ike,Parameter:()=>LG,ParameterReference:()=>oke,ParserRule:()=>Ow,ReferenceType:()=>pne,RegexToken:()=>$B,ReturnType:()=>ake,RuleCall:()=>GB,SimpleType:()=>DG,StringLiteral:()=>ske,TerminalAlternatives:()=>HB,TerminalElement:()=>Ax,TerminalGroup:()=>WB,TerminalRule:()=>WR,TerminalRuleCall:()=>YB,Type:()=>mne,TypeAttribute:()=>qB,TypeDefinition:()=>XB,UnionType:()=>lke,UnorderedGroup:()=>gne,UntilToken:()=>jB,ValueLiteral:()=>KB,Wildcard:()=>FG,isAbstractElement:()=>zke,isAbstractParserRule:()=>x6,isAbstractRule:()=>nSn,isAbstractType:()=>rSn,isAction:()=>uD,isAlternatives:()=>Uke,isArrayLiteral:()=>iSn,isArrayType:()=>yit,isAssignment:()=>XR,isBooleanLiteral:()=>bit,isCharacterRange:()=>xit,isCondition:()=>oSn,isConjunction:()=>vit,isCrossReference:()=>v6,isDisjunction:()=>_it,isEndOfFile:()=>Tit,isGrammar:()=>aSn,isGrammarImport:()=>sSn,isGroup:()=>_6,isInferredType:()=>Xne,isInfixRule:()=>qG,isInfixRuleOperatorList:()=>lSn,isInfixRuleOperators:()=>cSn,isInterface:()=>wit,isKeyword:()=>jR,isNamedArgument:()=>uSn,isNegatedToken:()=>Eit,isNegation:()=>Cit,isNumberLiteral:()=>dSn,isParameter:()=>fSn,isParameterReference:()=>Sit,isParserRule:()=>lb,isReferenceType:()=>Ait,isRegexToken:()=>kit,isReturnType:()=>Rit,isRuleCall:()=>KR,isSimpleType:()=>Vke,isStringLiteral:()=>hSn,isTerminalAlternatives:()=>Pit,isTerminalElement:()=>pSn,isTerminalGroup:()=>Iit,isTerminalRule:()=>X_,isTerminalRuleCall:()=>$ke,isType:()=>Gke,isTypeAttribute:()=>mSn,isTypeDefinition:()=>gSn,isUnionType:()=>Mit,isUnorderedGroup:()=>Hke,isUntilToken:()=>Lit,isValueLiteral:()=>ySn,isWildcard:()=>Dit,reflection:()=>Va});p3i={ID:/\^?[_a-zA-Z][\w_]*/,STRING:/"(\\.|[^"\\])*"|'(\\.|[^'\\])*'/,NUMBER:/NaN|-?((\d*\.\d+|\d+)([Ee][+-]?\d+)?|Infinity)/,RegexLiteral:/\/(?![*+?])(?:[^\r\n\[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*\])+\/[a-z]*/,WS:/\s+/,ML_COMMENT:/\/\*[\s\S]*?\*\//,SL_COMMENT:/\/\/[^\n\r]*/};Sx={$type:"AbstractElement",cardinality:"cardinality"};ee(zke,"isAbstractElement");cne={$type:"AbstractParserRule"};ee(x6,"isAbstractParserRule");RG={$type:"AbstractRule"};ee(nSn,"isAbstractRule");cv={$type:"AbstractType"};ee(rSn,"isAbstractType");nD={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};ee(uD,"isAction");une={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};ee(Uke,"isAlternatives");KAe={$type:"ArrayLiteral",elements:"elements"};ee(iSn,"isArrayLiteral");ZAe={$type:"ArrayType",elementType:"elementType"};ee(yit,"isArrayType");rD={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};ee(XR,"isAssignment");JAe={$type:"BooleanLiteral",true:"true"};ee(bit,"isBooleanLiteral");iD={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};ee(xit,"isCharacterRange");oD={$type:"Condition"};ee(oSn,"isCondition");dne={$type:"Conjunction",left:"left",right:"right"};ee(vit,"isConjunction");aD={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};ee(v6,"isCrossReference");fne={$type:"Disjunction",left:"left",right:"right"};ee(_it,"isDisjunction");QAe={$type:"EndOfFile",cardinality:"cardinality"};ee(Tit,"isEndOfFile");HR={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};ee(aSn,"isGrammar");eke={$type:"GrammarImport",path:"path"};ee(sSn,"isGrammarImport");UB={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};ee(_6,"isGroup");tke={$type:"InferredType",name:"name"};ee(Xne,"isInferredType");dS={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};ee(qG,"isInfixRule");hne={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};ee(lSn,"isInfixRuleOperatorList");nke={$type:"InfixRuleOperators",precedences:"precedences"};ee(cSn,"isInfixRuleOperators");PG={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};ee(wit,"isInterface");IG={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};ee(jR,"isKeyword");MG={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};ee(uSn,"isNamedArgument");VB={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};ee(Eit,"isNegatedToken");rke={$type:"Negation",value:"value"};ee(Cit,"isNegation");ike={$type:"NumberLiteral",value:"value"};ee(dSn,"isNumberLiteral");LG={$type:"Parameter",name:"name"};ee(fSn,"isParameter");oke={$type:"ParameterReference",parameter:"parameter"};ee(Sit,"isParameterReference");Ow={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};ee(lb,"isParserRule");pne={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};ee(Ait,"isReferenceType");$B={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};ee(kit,"isRegexToken");ake={$type:"ReturnType",name:"name"};ee(Rit,"isReturnType");GB={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};ee(KR,"isRuleCall");DG={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};ee(Vke,"isSimpleType");ske={$type:"StringLiteral",value:"value"};ee(hSn,"isStringLiteral");HB={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};ee(Pit,"isTerminalAlternatives");Ax={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};ee(pSn,"isTerminalElement");WB={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};ee(Iit,"isTerminalGroup");WR={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};ee(X_,"isTerminalRule");YB={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};ee($ke,"isTerminalRuleCall");mne={$type:"Type",name:"name",type:"type"};ee(Gke,"isType");qB={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};ee(mSn,"isTypeAttribute");XB={$type:"TypeDefinition"};ee(gSn,"isTypeDefinition");lke={$type:"UnionType",types:"types"};ee(Mit,"isUnionType");gne={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};ee(Hke,"isUnorderedGroup");jB={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};ee(Lit,"isUntilToken");KB={$type:"ValueLiteral"};ee(ySn,"isValueLiteral");FG={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};ee(Dit,"isWildcard");Fit=class extends hit{static{ee(this,"LangiumGrammarAstReflection")}constructor(){super(...arguments);this.types={AbstractElement:{name:Sx.$type,properties:{cardinality:{name:Sx.cardinality}},superTypes:[]},AbstractParserRule:{name:cne.$type,properties:{},superTypes:[RG.$type,cv.$type]},AbstractRule:{name:RG.$type,properties:{},superTypes:[]},AbstractType:{name:cv.$type,properties:{},superTypes:[]},Action:{name:nD.$type,properties:{cardinality:{name:nD.cardinality},feature:{name:nD.feature},inferredType:{name:nD.inferredType},operator:{name:nD.operator},type:{name:nD.type,referenceType:cv.$type}},superTypes:[Sx.$type]},Alternatives:{name:une.$type,properties:{cardinality:{name:une.cardinality},elements:{name:une.elements,defaultValue:[]}},superTypes:[Sx.$type]},ArrayLiteral:{name:KAe.$type,properties:{elements:{name:KAe.elements,defaultValue:[]}},superTypes:[KB.$type]},ArrayType:{name:ZAe.$type,properties:{elementType:{name:ZAe.elementType}},superTypes:[XB.$type]},Assignment:{name:rD.$type,properties:{cardinality:{name:rD.cardinality},feature:{name:rD.feature},operator:{name:rD.operator},predicate:{name:rD.predicate},terminal:{name:rD.terminal}},superTypes:[Sx.$type]},BooleanLiteral:{name:JAe.$type,properties:{true:{name:JAe.true,defaultValue:false}},superTypes:[oD.$type,KB.$type]},CharacterRange:{name:iD.$type,properties:{cardinality:{name:iD.cardinality},left:{name:iD.left},lookahead:{name:iD.lookahead},parenthesized:{name:iD.parenthesized,defaultValue:false},right:{name:iD.right}},superTypes:[Ax.$type]},Condition:{name:oD.$type,properties:{},superTypes:[]},Conjunction:{name:dne.$type,properties:{left:{name:dne.left},right:{name:dne.right}},superTypes:[oD.$type]},CrossReference:{name:aD.$type,properties:{cardinality:{name:aD.cardinality},deprecatedSyntax:{name:aD.deprecatedSyntax,defaultValue:false},isMulti:{name:aD.isMulti,defaultValue:false},terminal:{name:aD.terminal},type:{name:aD.type,referenceType:cv.$type}},superTypes:[Sx.$type]},Disjunction:{name:fne.$type,properties:{left:{name:fne.left},right:{name:fne.right}},superTypes:[oD.$type]},EndOfFile:{name:QAe.$type,properties:{cardinality:{name:QAe.cardinality}},superTypes:[Sx.$type]},Grammar:{name:HR.$type,properties:{imports:{name:HR.imports,defaultValue:[]},interfaces:{name:HR.interfaces,defaultValue:[]},isDeclared:{name:HR.isDeclared,defaultValue:false},name:{name:HR.name},rules:{name:HR.rules,defaultValue:[]},types:{name:HR.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:eke.$type,properties:{path:{name:eke.path}},superTypes:[]},Group:{name:UB.$type,properties:{cardinality:{name:UB.cardinality},elements:{name:UB.elements,defaultValue:[]},guardCondition:{name:UB.guardCondition},predicate:{name:UB.predicate}},superTypes:[Sx.$type]},InferredType:{name:tke.$type,properties:{name:{name:tke.name}},superTypes:[cv.$type]},InfixRule:{name:dS.$type,properties:{call:{name:dS.call},dataType:{name:dS.dataType},inferredType:{name:dS.inferredType},name:{name:dS.name},operators:{name:dS.operators},parameters:{name:dS.parameters,defaultValue:[]},returnType:{name:dS.returnType,referenceType:cv.$type}},superTypes:[cne.$type]},InfixRuleOperatorList:{name:hne.$type,properties:{associativity:{name:hne.associativity},operators:{name:hne.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:nke.$type,properties:{precedences:{name:nke.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:PG.$type,properties:{attributes:{name:PG.attributes,defaultValue:[]},name:{name:PG.name},superTypes:{name:PG.superTypes,defaultValue:[],referenceType:cv.$type}},superTypes:[cv.$type]},Keyword:{name:IG.$type,properties:{cardinality:{name:IG.cardinality},predicate:{name:IG.predicate},value:{name:IG.value}},superTypes:[Sx.$type]},NamedArgument:{name:MG.$type,properties:{calledByName:{name:MG.calledByName,defaultValue:false},parameter:{name:MG.parameter,referenceType:LG.$type},value:{name:MG.value}},superTypes:[]},NegatedToken:{name:VB.$type,properties:{cardinality:{name:VB.cardinality},lookahead:{name:VB.lookahead},parenthesized:{name:VB.parenthesized,defaultValue:false},terminal:{name:VB.terminal}},superTypes:[Ax.$type]},Negation:{name:rke.$type,properties:{value:{name:rke.value}},superTypes:[oD.$type]},NumberLiteral:{name:ike.$type,properties:{value:{name:ike.value}},superTypes:[KB.$type]},Parameter:{name:LG.$type,properties:{name:{name:LG.name}},superTypes:[]},ParameterReference:{name:oke.$type,properties:{parameter:{name:oke.parameter,referenceType:LG.$type}},superTypes:[oD.$type]},ParserRule:{name:Ow.$type,properties:{dataType:{name:Ow.dataType},definition:{name:Ow.definition},entry:{name:Ow.entry,defaultValue:false},fragment:{name:Ow.fragment,defaultValue:false},inferredType:{name:Ow.inferredType},name:{name:Ow.name},parameters:{name:Ow.parameters,defaultValue:[]},returnType:{name:Ow.returnType,referenceType:cv.$type}},superTypes:[cne.$type]},ReferenceType:{name:pne.$type,properties:{isMulti:{name:pne.isMulti,defaultValue:false},referenceType:{name:pne.referenceType}},superTypes:[XB.$type]},RegexToken:{name:$B.$type,properties:{cardinality:{name:$B.cardinality},lookahead:{name:$B.lookahead},parenthesized:{name:$B.parenthesized,defaultValue:false},regex:{name:$B.regex}},superTypes:[Ax.$type]},ReturnType:{name:ake.$type,properties:{name:{name:ake.name}},superTypes:[]},RuleCall:{name:GB.$type,properties:{arguments:{name:GB.arguments,defaultValue:[]},cardinality:{name:GB.cardinality},predicate:{name:GB.predicate},rule:{name:GB.rule,referenceType:RG.$type}},superTypes:[Sx.$type]},SimpleType:{name:DG.$type,properties:{primitiveType:{name:DG.primitiveType},stringType:{name:DG.stringType},typeRef:{name:DG.typeRef,referenceType:cv.$type}},superTypes:[XB.$type]},StringLiteral:{name:ske.$type,properties:{value:{name:ske.value}},superTypes:[KB.$type]},TerminalAlternatives:{name:HB.$type,properties:{cardinality:{name:HB.cardinality},elements:{name:HB.elements,defaultValue:[]},lookahead:{name:HB.lookahead},parenthesized:{name:HB.parenthesized,defaultValue:false}},superTypes:[Ax.$type]},TerminalElement:{name:Ax.$type,properties:{cardinality:{name:Ax.cardinality},lookahead:{name:Ax.lookahead},parenthesized:{name:Ax.parenthesized,defaultValue:false}},superTypes:[Sx.$type]},TerminalGroup:{name:WB.$type,properties:{cardinality:{name:WB.cardinality},elements:{name:WB.elements,defaultValue:[]},lookahead:{name:WB.lookahead},parenthesized:{name:WB.parenthesized,defaultValue:false}},superTypes:[Ax.$type]},TerminalRule:{name:WR.$type,properties:{definition:{name:WR.definition},fragment:{name:WR.fragment,defaultValue:false},hidden:{name:WR.hidden,defaultValue:false},name:{name:WR.name},type:{name:WR.type}},superTypes:[RG.$type]},TerminalRuleCall:{name:YB.$type,properties:{cardinality:{name:YB.cardinality},lookahead:{name:YB.lookahead},parenthesized:{name:YB.parenthesized,defaultValue:false},rule:{name:YB.rule,referenceType:WR.$type}},superTypes:[Ax.$type]},Type:{name:mne.$type,properties:{name:{name:mne.name},type:{name:mne.type}},superTypes:[cv.$type]},TypeAttribute:{name:qB.$type,properties:{defaultValue:{name:qB.defaultValue},isOptional:{name:qB.isOptional,defaultValue:false},name:{name:qB.name},type:{name:qB.type}},superTypes:[]},TypeDefinition:{name:XB.$type,properties:{},superTypes:[]},UnionType:{name:lke.$type,properties:{types:{name:lke.types,defaultValue:[]}},superTypes:[XB.$type]},UnorderedGroup:{name:gne.$type,properties:{cardinality:{name:gne.cardinality},elements:{name:gne.elements,defaultValue:[]}},superTypes:[Sx.$type]},UntilToken:{name:jB.$type,properties:{cardinality:{name:jB.cardinality},lookahead:{name:jB.lookahead},parenthesized:{name:jB.parenthesized,defaultValue:false},terminal:{name:jB.terminal}},superTypes:[Ax.$type]},ValueLiteral:{name:KB.$type,properties:{},superTypes:[]},Wildcard:{name:FG.$type,properties:{cardinality:{name:FG.cardinality},lookahead:{name:FG.lookahead},parenthesized:{name:FG.parenthesized,defaultValue:false}},superTypes:[Ax.$type]}}}};Va=new Fit;ee(bSn,"getDatatypeNode");ee(XG,"streamCst");ee(xSn,"flattenCst");ee(Nit,"isChildNode");ee(Rne,"tokenToRange");ee(jG,"toDocumentSegment");(function(e){e[e["Before"]=0]="Before";e[e["After"]=1]="After";e[e["OverlapFront"]=2]="OverlapFront";e[e["OverlapBack"]=3]="OverlapBack";e[e["Inside"]=4]="Inside";e[e["Outside"]=5]="Outside"})(hS||(hS={}));ee(Oit,"compareRange");ee(Bit,"inRange");zit=/^[\w\p{L}]$/u;ee(vSn,"findDeclarationNodeAtOffset");ee(Uit,"findCommentNode");ee(cke,"isCommentNode");ee(Wke,"findLeafNodeAtOffset");ee(Vit,"findLeafNodeBeforeOffset");ee($it,"binarySearch");ee(Git,"getPreviousNode");ee(_Sn,"getNextNode");ee(TSn,"getStartlineNode");ee(wSn,"getInteriorNodes");ee(ESn,"getCommonParent");ee(Pnt,"getParentChain");Hit={};mD(Hit,{findAssignment:()=>rot,findNameAssignment:()=>Qke,findNodeForKeyword:()=>not,findNodeForProperty:()=>Kke,findNodesForKeyword:()=>ISn,findNodesForKeywordInternal:()=>Jke,findNodesForProperty:()=>tot,getActionAtElement:()=>oot,getActionType:()=>sot,getAllReachableRules:()=>jke,getAllRulesUsedForCrossReferences:()=>PSn,getCrossReferenceTerminal:()=>Qit,getEntryRule:()=>Kit,getExplicitRuleType:()=>Kne,getHiddenRules:()=>Zit,getRuleType:()=>lot,getRuleTypeName:()=>NSn,getTypeName:()=>f6,isArrayCardinality:()=>LSn,isArrayOperator:()=>DSn,isCommentTerminal:()=>eot,isDataType:()=>FSn,isDataTypeRule:()=>jne,isOptionalCardinality:()=>MSn,terminalRegex:()=>Zne});Yke=class extends Error{static{ee(this,"ErrorWithLocation")}constructor(e,t){super(e?`${t} at ${e.range.start.line}:${e.range.start.character}`:t)}};ee(gD,"assertUnreachable");ee(Wit,"assertCondition");Yit={};mD(Yit,{NEWLINE_REGEXP:()=>SSn,escapeRegExp:()=>nH,getTerminalParts:()=>kSn,isMultilineComment:()=>qit,isWhitespace:()=>Xke,partialMatches:()=>Xit,partialRegExp:()=>jit,whitespaceCharacters:()=>RSn});ee(ls,"cc");ee(CAe,"insertToSet");ee(EG,"addFlag");ee(IB,"ASSERT_EXISTS");ee(ine,"ASSERT_NEVER_REACH_HERE");ee(Int,"isCharacter");uke=[];for(let e=ls("0");e<=ls("9");e++){uke.push(e)}dke=[ls("_")].concat(uke);for(let e=ls("a");e<=ls("z");e++){dke.push(e)}for(let e=ls("A");e<=ls("Z");e++){dke.push(e)}tEn=[ls(" "),ls("\f"),ls("\n"),ls("\r"),ls(" "),ls("\v"),ls(" "),ls("\xA0"),ls("\u1680"),ls("\u2000"),ls("\u2001"),ls("\u2002"),ls("\u2003"),ls("\u2004"),ls("\u2005"),ls("\u2006"),ls("\u2007"),ls("\u2008"),ls("\u2009"),ls("\u200A"),ls("\u2028"),ls("\u2029"),ls("\u202F"),ls("\u205F"),ls("\u3000"),ls("\uFEFF")];m3i=/[0-9a-fA-F]/;QSe=/[0-9]/;g3i=/[1-9]/;CSn=class{static{ee(this,"RegExpParser")}constructor(){this.idx=0;this.input="";this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx;this.input=e.input;this.groupIdx=e.groupIdx}pattern(e){this.idx=0;this.input=e;this.groupIdx=0;this.consumeChar("/");const t=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:e.length},global:false,ignoreCase:false,multiLine:false,unicode:false,sticky:false};while(this.isRegExpFlag()){switch(this.popChar()){case"g":EG(n,"global");break;case"i":EG(n,"ignoreCase");break;case"m":EG(n,"multiLine");break;case"u":EG(n,"unicode");break;case"y":EG(n,"sticky");break}}if(this.idx!==this.input.length){throw Error("Redundant input: "+this.input.substring(this.idx))}return{type:"Pattern",flags:n,value:t,loc:this.loc(0)}}disjunction(){const e=[];const t=this.idx;e.push(this.alternative());while(this.peekChar()==="|"){this.consumeChar("|");e.push(this.alternative())}return{type:"Disjunction",value:e,loc:this.loc(t)}}alternative(){const e=[];const t=this.idx;while(this.isTerm()){e.push(this.term())}return{type:"Alternative",value:e,loc:this.loc(t)}}term(){if(this.isAssertion()){return this.assertion()}else{return this.atom()}}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let t;switch(this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":t="Lookbehind";break;case"!":t="NegativeLookbehind"}break}}IB(t);const n=this.disjunction();this.consumeChar(")");return{type:t,value:n,loc:this.loc(e)}}return ine()}quantifier(e=false){let t=void 0;const n=this.idx;switch(this.popChar()){case"*":t={atLeast:0,atMost:Infinity};break;case"+":t={atLeast:1,atMost:Infinity};break;case"?":t={atLeast:0,atMost:1};break;case"{":const r=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:r,atMost:r};break;case",":let i;if(this.isDigit()){i=this.integerIncludingZero();t={atLeast:r,atMost:i}}else{t={atLeast:r,atMost:Infinity}}this.consumeChar("}");break}if(e===true&&t===void 0){return void 0}IB(t);break}if(e===true&&t===void 0){return void 0}if(IB(t)){if(this.peekChar(0)==="?"){this.consumeChar("?");t.greedy=false}else{t.greedy=true}t.type="Quantifier";t.loc=this.loc(n);return t}}atom(){let e;const t=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}if(e===void 0&&this.isPatternCharacter()){e=this.patternCharacter()}if(IB(e)){e.loc=this.loc(t);if(this.isQuantifier()){e.quantifier=this.quantifier()}return e}return ine()}dotAll(){this.consumeChar(".");return{type:"Set",complement:true,value:[ls("\n"),ls("\r"),ls("\u2028"),ls("\u2029")]}}atomEscape(){this.consumeChar("\\");switch(this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){const e=this.positiveInteger();return{type:"GroupBackReference",value:e}}characterClassEscape(){let e;let t=false;switch(this.popChar()){case"d":e=uke;break;case"D":e=uke;t=true;break;case"s":e=tEn;break;case"S":e=tEn;t=true;break;case"w":e=dke;break;case"W":e=dke;t=true;break}if(IB(e)){return{type:"Set",value:e,complement:t}}return ine()}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=ls("\f");break;case"n":e=ls("\n");break;case"r":e=ls("\r");break;case"t":e=ls(" ");break;case"v":e=ls("\v");break}if(IB(e)){return{type:"Character",value:e}}return ine()}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(/[a-zA-Z]/.test(e)===false){throw Error("Invalid ")}const t=e.toUpperCase().charCodeAt(0)-64;return{type:"Character",value:t}}nulCharacterAtom(){this.consumeChar("0");return{type:"Character",value:ls("\0")}}hexEscapeSequenceAtom(){this.consumeChar("x");return this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){this.consumeChar("u");return this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:ls(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case"\n":case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:const e=this.popChar();return{type:"Character",value:ls(e)}}}characterClass(){const e=[];let t=false;this.consumeChar("[");if(this.peekChar(0)==="^"){this.consumeChar("^");t=true}while(this.isClassAtom()){const n=this.classAtom();const r=n.type==="Character";if(Int(n)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();const o=i.type==="Character";if(Int(i)){if(i.value=this.input.length){throw Error("Unexpected end of input")}this.idx++}loc(e){return{begin:e,end:this.idx}}};qke=class{static{ee(this,"BaseRegExpVisitor")}visitChildren(e){for(const t in e){const n=e[t];if(e.hasOwnProperty(t)){if(n.type!==void 0){this.visit(n)}else if(Array.isArray(n)){n.forEach(r=>{this.visit(r)},this)}}}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}};SSn=/\r?\n/gm;ASn=new CSn;y3i=class extends qke{static{ee(this,"TerminalRegExpVisitor")}constructor(){super(...arguments);this.isStarting=true;this.endRegexpStack=[];this.multiline=false}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=false;this.regex=e;this.startRegexp="";this.isStarting=true;this.endRegexpStack=[]}visitGroup(e){if(e.quantifier){this.isStarting=false;this.endRegexpStack=[]}}visitCharacter(e){const t=String.fromCharCode(e.value);if(!this.multiline&&t==="\n"){this.multiline=true}if(e.quantifier){this.isStarting=false;this.endRegexpStack=[]}else{const n=nH(t);this.endRegexpStack.push(n);if(this.isStarting){this.startRegexp+=n}}}visitSet(e){if(!this.multiline){const t=this.regex.substring(e.loc.begin,e.loc.end);const n=new RegExp(t);this.multiline=Boolean("\n".match(n))}if(e.quantifier){this.isStarting=false;this.endRegexpStack=[]}else{const t=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(t);if(this.isStarting){this.startRegexp+=t}}}visitChildren(e){if(e.type==="Group"){const t=e;if(t.quantifier){return}}super.visitChildren(e)}};a6=new y3i;ee(kSn,"getTerminalParts");ee(qit,"isMultilineComment");RSn="\f\n\r \v \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF".split("");ee(Xke,"isWhitespace");ee(nH,"escapeRegExp");ee(Xit,"partialMatches");ee(jit,"partialRegExp");ee(Kit,"getEntryRule");ee(Zit,"getHiddenRules");ee(jke,"getAllReachableRules");ee(Jit,"ruleDfs");ee(PSn,"getAllRulesUsedForCrossReferences");ee(Qit,"getCrossReferenceTerminal");ee(eot,"isCommentTerminal");ee(tot,"findNodesForProperty");ee(Kke,"findNodeForProperty");ee(Zke,"findNodesForPropertyInternal");ee(ISn,"findNodesForKeyword");ee(not,"findNodeForKeyword");ee(Jke,"findNodesForKeywordInternal");ee(rot,"findAssignment");ee(Qke,"findNameAssignment");ee(iot,"findNameAssignmentInternal");ee(oot,"getActionAtElement");ee(MSn,"isOptionalCardinality");ee(LSn,"isArrayCardinality");ee(DSn,"isArrayOperator");ee(jne,"isDataTypeRule");ee(aot,"isDataTypeRuleInternal");ee(FSn,"isDataType");ee(fke,"isDataTypeInternal");ee(Kne,"getExplicitRuleType");ee(f6,"getTypeName");ee(sot,"getActionType");ee(NSn,"getRuleTypeName");ee(lot,"getRuleType");ee(Zne,"terminalRegex");cot=/[\s\S]/.source;ee(T6,"abstractElementToRegex");ee(OSn,"terminalAlternativesToRegex");ee(BSn,"terminalGroupToRegex");ee(zSn,"untilTokenToRegex");ee(USn,"negateTokenToRegex");ee(VSn,"characterRangeToRegex");ee(SAe,"keywordToRegex");ee(yS,"withCardinality");ee(uot,"createGrammarConfig");b3i=typeof global=="object"&&global&&global.Object===Object&&global;$Sn=b3i;x3i=typeof self=="object"&&self&&self.Object===Object&&self;v3i=$Sn||x3i||Function("return this")();xS=v3i;_3i=xS.Symbol;Y_=_3i;GSn=Object.prototype;T3i=GSn.hasOwnProperty;w3i=GSn.toString;Gte=Y_?Y_.toStringTag:void 0;ee(HSn,"getRawTag");E3i=HSn;C3i=Object.prototype;S3i=C3i.toString;ee(WSn,"objectToString");A3i=WSn;k3i="[object Null]";R3i="[object Undefined]";nEn=Y_?Y_.toStringTag:void 0;ee(YSn,"baseGetTag");yD=YSn;ee(qSn,"isObjectLike");Ww=qSn;P3i="[object Symbol]";ee(XSn,"isSymbol");eRe=XSn;ee(jSn,"arrayMap");Jne=jSn;I3i=Array.isArray;gc=I3i;M3i=1/0;rEn=Y_?Y_.prototype:void 0;iEn=rEn?rEn.toString:void 0;ee(dot,"baseToString");L3i=dot;D3i=/\s/;ee(KSn,"trimmedEndIndex");F3i=KSn;N3i=/^\s+/;ee(ZSn,"baseTrim");O3i=ZSn;ee(JSn,"isObject");q_=JSn;oEn=0/0;B3i=/^[-+]0x[0-9a-f]+$/i;z3i=/^0b[01]+$/i;U3i=/^0o[0-7]+$/i;V3i=parseInt;ee(QSn,"toNumber");$3i=QSn;aEn=1/0;G3i=17976931348623157e292;ee(eAn,"toFinite");H3i=eAn;ee(tAn,"toInteger");Qne=tAn;ee(nAn,"identity");ere=nAn;W3i="[object AsyncFunction]";Y3i="[object Function]";q3i="[object GeneratorFunction]";X3i="[object Proxy]";ee(rAn,"isFunction");iP=rAn;j3i=xS["__core-js_shared__"];ltt=j3i;sEn=function(){var e=/[^.]+$/.exec(ltt&<t.keys&<t.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();ee(iAn,"isMasked");K3i=iAn;Z3i=Function.prototype;J3i=Z3i.toString;ee(oAn,"toSource");w6=oAn;Q3i=/[\\^$.*+?()[\]{}|]/g;eMi=/^\[object .+?Constructor\]$/;tMi=Function.prototype;nMi=Object.prototype;rMi=tMi.toString;iMi=nMi.hasOwnProperty;oMi=RegExp("^"+rMi.call(iMi).replace(Q3i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");ee(aAn,"baseIsNative");aMi=aAn;ee(sAn,"getValue");sMi=sAn;ee(lAn,"getNative");E6=lAn;lMi=E6(xS,"WeakMap");Mnt=lMi;lEn=Object.create;cMi=function(){function e(){}ee(e,"object");return function(t){if(!q_(t)){return{}}if(lEn){return lEn(t)}e.prototype=t;var n=new e;e.prototype=void 0;return n}}();uMi=cMi;ee(cAn,"apply");dMi=cAn;ee(uAn,"noop");Vm=uAn;ee(dAn,"copyArray");fMi=dAn;hMi=800;pMi=16;mMi=Date.now;ee(fAn,"shortOut");gMi=fAn;ee(hAn,"constant");yMi=hAn;bMi=function(){try{var e=E6(Object,"defineProperty");e({},"",{});return e}catch(t){}}();hke=bMi;xMi=!hke?ere:function(e,t){return hke(e,"toString",{"configurable":true,"enumerable":false,"value":yMi(t),"writable":true})};vMi=xMi;_Mi=gMi(vMi);TMi=_Mi;ee(pAn,"arrayEach");mAn=pAn;ee(gAn,"baseFindIndex");yAn=gAn;ee(bAn,"baseIsNaN");wMi=bAn;ee(xAn,"strictIndexOf");EMi=xAn;ee(vAn,"baseIndexOf");fot=vAn;ee(_An,"arrayIncludes");TAn=_An;CMi=9007199254740991;SMi=/^(?:0|[1-9]\d*)$/;ee(wAn,"isIndex");tRe=wAn;ee(EAn,"baseAssignValue");hot=EAn;ee(CAn,"eq");tre=CAn;AMi=Object.prototype;kMi=AMi.hasOwnProperty;ee(SAn,"assignValue");nRe=SAn;ee(AAn,"copyObject");nre=AAn;cEn=Math.max;ee(kAn,"overRest");RMi=kAn;ee(RAn,"baseRest");pot=RAn;PMi=9007199254740991;ee(PAn,"isLength");mot=PAn;ee(IAn,"isArrayLike");vS=IAn;ee(MAn,"isIterateeCall");rRe=MAn;ee(LAn,"createAssigner");IMi=LAn;MMi=Object.prototype;ee(DAn,"isPrototype");rre=DAn;ee(FAn,"baseTimes");LMi=FAn;DMi="[object Arguments]";ee(NAn,"baseIsArguments");uEn=NAn;OAn=Object.prototype;FMi=OAn.hasOwnProperty;NMi=OAn.propertyIsEnumerable;OMi=uEn(function(){return arguments}())?uEn:function(e){return Ww(e)&&FMi.call(e,"callee")&&!NMi.call(e,"callee")};iRe=OMi;ee(BAn,"stubFalse");BMi=BAn;zAn=typeof exports=="object"&&exports&&!exports.nodeType&&exports;dEn=zAn&&typeof module=="object"&&module&&!module.nodeType&&module;zMi=dEn&&dEn.exports===zAn;fEn=zMi?xS.Buffer:void 0;UMi=fEn?fEn.isBuffer:void 0;VMi=UMi||BMi;Pne=VMi;$Mi="[object Arguments]";GMi="[object Array]";HMi="[object Boolean]";WMi="[object Date]";YMi="[object Error]";qMi="[object Function]";XMi="[object Map]";jMi="[object Number]";KMi="[object Object]";ZMi="[object RegExp]";JMi="[object Set]";QMi="[object String]";eLi="[object WeakMap]";tLi="[object ArrayBuffer]";nLi="[object DataView]";rLi="[object Float32Array]";iLi="[object Float64Array]";oLi="[object Int8Array]";aLi="[object Int16Array]";sLi="[object Int32Array]";lLi="[object Uint8Array]";cLi="[object Uint8ClampedArray]";uLi="[object Uint16Array]";dLi="[object Uint32Array]";Bd={};Bd[rLi]=Bd[iLi]=Bd[oLi]=Bd[aLi]=Bd[sLi]=Bd[lLi]=Bd[cLi]=Bd[uLi]=Bd[dLi]=true;Bd[$Mi]=Bd[GMi]=Bd[tLi]=Bd[HMi]=Bd[nLi]=Bd[WMi]=Bd[YMi]=Bd[qMi]=Bd[XMi]=Bd[jMi]=Bd[KMi]=Bd[ZMi]=Bd[JMi]=Bd[QMi]=Bd[eLi]=false;ee(UAn,"baseIsTypedArray");fLi=UAn;ee(VAn,"baseUnary");ire=VAn;$An=typeof exports=="object"&&exports&&!exports.nodeType&&exports;yne=$An&&typeof module=="object"&&module&&!module.nodeType&&module;hLi=yne&&yne.exports===$An;ctt=hLi&&$Sn.process;pLi=function(){try{var e=yne&&yne.require&&yne.require("util").types;if(e){return e}return ctt&&ctt.binding&&ctt.binding("util")}catch(t){}}();dD=pLi;hEn=dD&&dD.isTypedArray;mLi=hEn?ire(hEn):fLi;got=mLi;gLi=Object.prototype;yLi=gLi.hasOwnProperty;ee(GAn,"arrayLikeKeys");HAn=GAn;ee(WAn,"overArg");YAn=WAn;bLi=YAn(Object.keys,Object);xLi=bLi;vLi=Object.prototype;_Li=vLi.hasOwnProperty;ee(qAn,"baseKeys");XAn=qAn;ee(jAn,"keys");dv=jAn;TLi=Object.prototype;wLi=TLi.hasOwnProperty;ELi=IMi(function(e,t){if(rre(t)||vS(t)){nre(t,dv(t),e);return}for(var n in t){if(wLi.call(t,n)){nRe(e,n,t[n])}}});fv=ELi;ee(KAn,"nativeKeysIn");CLi=KAn;SLi=Object.prototype;ALi=SLi.hasOwnProperty;ee(ZAn,"baseKeysIn");kLi=ZAn;ee(JAn,"keysIn");oRe=JAn;RLi=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;PLi=/^\w*$/;ee(QAn,"isKey");yot=QAn;ILi=E6(Object,"create");Ine=ILi;ee(ekn,"hashClear");MLi=ekn;ee(tkn,"hashDelete");LLi=tkn;DLi="__lodash_hash_undefined__";FLi=Object.prototype;NLi=FLi.hasOwnProperty;ee(nkn,"hashGet");OLi=nkn;BLi=Object.prototype;zLi=BLi.hasOwnProperty;ee(rkn,"hashHas");ULi=rkn;VLi="__lodash_hash_undefined__";ee(ikn,"hashSet");$Li=ikn;ee(C6,"Hash");C6.prototype.clear=MLi;C6.prototype["delete"]=LLi;C6.prototype.get=OLi;C6.prototype.has=ULi;C6.prototype.set=$Li;pEn=C6;ee(okn,"listCacheClear");GLi=okn;ee(akn,"assocIndexOf");aRe=akn;HLi=Array.prototype;WLi=HLi.splice;ee(skn,"listCacheDelete");YLi=skn;ee(lkn,"listCacheGet");qLi=lkn;ee(ckn,"listCacheHas");XLi=ckn;ee(ukn,"listCacheSet");jLi=ukn;ee(S6,"ListCache");S6.prototype.clear=GLi;S6.prototype["delete"]=YLi;S6.prototype.get=qLi;S6.prototype.has=XLi;S6.prototype.set=jLi;sRe=S6;KLi=E6(xS,"Map");Mne=KLi;ee(dkn,"mapCacheClear");ZLi=dkn;ee(fkn,"isKeyable");JLi=fkn;ee(hkn,"getMapData");lRe=hkn;ee(pkn,"mapCacheDelete");QLi=pkn;ee(mkn,"mapCacheGet");eDi=mkn;ee(gkn,"mapCacheHas");tDi=gkn;ee(ykn,"mapCacheSet");nDi=ykn;ee(A6,"MapCache");A6.prototype.clear=ZLi;A6.prototype["delete"]=QLi;A6.prototype.get=eDi;A6.prototype.has=tDi;A6.prototype.set=nDi;cRe=A6;rDi="Expected a function";ee(uRe,"memoize");uRe.Cache=cRe;iDi=uRe;oDi=500;ee(bkn,"memoizeCapped");aDi=bkn;sDi=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;lDi=/\\(\\)?/g;cDi=aDi(function(e){var t=[];if(e.charCodeAt(0)===46){t.push("")}e.replace(sDi,function(n,r,i,o){t.push(i?o.replace(lDi,"$1"):r||n)});return t});uDi=cDi;ee(xkn,"toString");dDi=xkn;ee(vkn,"castPath");dRe=vkn;fDi=1/0;ee(_kn,"toKey");ore=_kn;ee(Tkn,"baseGet");bot=Tkn;ee(wkn,"get");hDi=wkn;ee(Ekn,"arrayPush");xot=Ekn;mEn=Y_?Y_.isConcatSpreadable:void 0;ee(Ckn,"isFlattenable");pDi=Ckn;ee(vot,"baseFlatten");_ot=vot;ee(Skn,"flatten");Gw=Skn;mDi=YAn(Object.getPrototypeOf,Object);Akn=mDi;ee(kkn,"baseSlice");Rkn=kkn;ee(Pkn,"arrayReduce");gDi=Pkn;ee(Ikn,"stackClear");yDi=Ikn;ee(Mkn,"stackDelete");bDi=Mkn;ee(Lkn,"stackGet");xDi=Lkn;ee(Dkn,"stackHas");vDi=Dkn;_Di=200;ee(Fkn,"stackSet");TDi=Fkn;ee(k6,"Stack");k6.prototype.clear=yDi;k6.prototype["delete"]=bDi;k6.prototype.get=xDi;k6.prototype.has=vDi;k6.prototype.set=TDi;bne=k6;ee(Nkn,"baseAssign");wDi=Nkn;ee(Okn,"baseAssignIn");EDi=Okn;Bkn=typeof exports=="object"&&exports&&!exports.nodeType&&exports;gEn=Bkn&&typeof module=="object"&&module&&!module.nodeType&&module;CDi=gEn&&gEn.exports===Bkn;yEn=CDi?xS.Buffer:void 0;bEn=yEn?yEn.allocUnsafe:void 0;ee(zkn,"cloneBuffer");SDi=zkn;ee(Ukn,"arrayFilter");Tot=Ukn;ee(Vkn,"stubArray");$kn=Vkn;ADi=Object.prototype;kDi=ADi.propertyIsEnumerable;xEn=Object.getOwnPropertySymbols;RDi=!xEn?$kn:function(e){if(e==null){return[]}e=Object(e);return Tot(xEn(e),function(t){return kDi.call(e,t)})};wot=RDi;ee(Gkn,"copySymbols");PDi=Gkn;IDi=Object.getOwnPropertySymbols;MDi=!IDi?$kn:function(e){var t=[];while(e){xot(t,wot(e));e=Akn(e)}return t};Hkn=MDi;ee(Wkn,"copySymbolsIn");LDi=Wkn;ee(Ykn,"baseGetAllKeys");qkn=Ykn;ee(Xkn,"getAllKeys");Lnt=Xkn;ee(jkn,"getAllKeysIn");Kkn=jkn;DDi=E6(xS,"DataView");Dnt=DDi;FDi=E6(xS,"Promise");Fnt=FDi;NDi=E6(xS,"Set");UG=NDi;vEn="[object Map]";ODi="[object Object]";_En="[object Promise]";TEn="[object Set]";wEn="[object WeakMap]";EEn="[object DataView]";BDi=w6(Dnt);zDi=w6(Mne);UDi=w6(Fnt);VDi=w6(UG);$Di=w6(Mnt);MB=yD;if(Dnt&&MB(new Dnt(new ArrayBuffer(1)))!=EEn||Mne&&MB(new Mne)!=vEn||Fnt&&MB(Fnt.resolve())!=_En||UG&&MB(new UG)!=TEn||Mnt&&MB(new Mnt)!=wEn){MB=ee(function(e){var t=yD(e),n=t==ODi?e.constructor:void 0,r=n?w6(n):"";if(r){switch(r){case BDi:return EEn;case zDi:return vEn;case UDi:return _En;case VDi:return TEn;case $Di:return wEn}}return t},"getTag")}KG=MB;GDi=Object.prototype;HDi=GDi.hasOwnProperty;ee(Zkn,"initCloneArray");WDi=Zkn;YDi=xS.Uint8Array;pke=YDi;ee(Jkn,"cloneArrayBuffer");Eot=Jkn;ee(Qkn,"cloneDataView");qDi=Qkn;XDi=/\w*$/;ee(eRn,"cloneRegExp");jDi=eRn;CEn=Y_?Y_.prototype:void 0;SEn=CEn?CEn.valueOf:void 0;ee(tRn,"cloneSymbol");KDi=tRn;ee(nRn,"cloneTypedArray");ZDi=nRn;JDi="[object Boolean]";QDi="[object Date]";eFi="[object Map]";tFi="[object Number]";nFi="[object RegExp]";rFi="[object Set]";iFi="[object String]";oFi="[object Symbol]";aFi="[object ArrayBuffer]";sFi="[object DataView]";lFi="[object Float32Array]";cFi="[object Float64Array]";uFi="[object Int8Array]";dFi="[object Int16Array]";fFi="[object Int32Array]";hFi="[object Uint8Array]";pFi="[object Uint8ClampedArray]";mFi="[object Uint16Array]";gFi="[object Uint32Array]";ee(rRn,"initCloneByTag");yFi=rRn;ee(iRn,"initCloneObject");bFi=iRn;xFi="[object Map]";ee(oRn,"baseIsMap");vFi=oRn;AEn=dD&&dD.isMap;_Fi=AEn?ire(AEn):vFi;TFi=_Fi;wFi="[object Set]";ee(aRn,"baseIsSet");EFi=aRn;kEn=dD&&dD.isSet;CFi=kEn?ire(kEn):EFi;SFi=CFi;AFi=1;kFi=2;RFi=4;sRn="[object Arguments]";PFi="[object Array]";IFi="[object Boolean]";MFi="[object Date]";LFi="[object Error]";lRn="[object Function]";DFi="[object GeneratorFunction]";FFi="[object Map]";NFi="[object Number]";cRn="[object Object]";OFi="[object RegExp]";BFi="[object Set]";zFi="[object String]";UFi="[object Symbol]";VFi="[object WeakMap]";$Fi="[object ArrayBuffer]";GFi="[object DataView]";HFi="[object Float32Array]";WFi="[object Float64Array]";YFi="[object Int8Array]";qFi="[object Int16Array]";XFi="[object Int32Array]";jFi="[object Uint8Array]";KFi="[object Uint8ClampedArray]";ZFi="[object Uint16Array]";JFi="[object Uint32Array]";ld={};ld[sRn]=ld[PFi]=ld[$Fi]=ld[GFi]=ld[IFi]=ld[MFi]=ld[HFi]=ld[WFi]=ld[YFi]=ld[qFi]=ld[XFi]=ld[FFi]=ld[NFi]=ld[cRn]=ld[OFi]=ld[BFi]=ld[zFi]=ld[UFi]=ld[jFi]=ld[KFi]=ld[ZFi]=ld[JFi]=true;ld[LFi]=ld[lRn]=ld[VFi]=false;ee(xne,"baseClone");QFi=xne;e4i=4;ee(uRn,"clone");Ng=uRn;ee(dRn,"compact");are=dRn;t4i="__lodash_hash_undefined__";ee(fRn,"setCacheAdd");n4i=fRn;ee(hRn,"setCacheHas");r4i=hRn;ee(Lne,"SetCache");Lne.prototype.add=Lne.prototype.push=n4i;Lne.prototype.has=r4i;Cot=Lne;ee(pRn,"arraySome");mRn=pRn;ee(gRn,"cacheHas");Sot=gRn;i4i=1;o4i=2;ee(yRn,"equalArrays");bRn=yRn;ee(xRn,"mapToArray");a4i=xRn;ee(vRn,"setToArray");Aot=vRn;s4i=1;l4i=2;c4i="[object Boolean]";u4i="[object Date]";d4i="[object Error]";f4i="[object Map]";h4i="[object Number]";p4i="[object RegExp]";m4i="[object Set]";g4i="[object String]";y4i="[object Symbol]";b4i="[object ArrayBuffer]";x4i="[object DataView]";REn=Y_?Y_.prototype:void 0;utt=REn?REn.valueOf:void 0;ee(_Rn,"equalByTag");v4i=_Rn;_4i=1;T4i=Object.prototype;w4i=T4i.hasOwnProperty;ee(TRn,"equalObjects");E4i=TRn;C4i=1;PEn="[object Arguments]";IEn="[object Array]";eAe="[object Object]";S4i=Object.prototype;MEn=S4i.hasOwnProperty;ee(wRn,"baseIsEqualDeep");A4i=wRn;ee(kot,"baseIsEqual");ERn=kot;k4i=1;R4i=2;ee(CRn,"baseIsMatch");P4i=CRn;ee(SRn,"isStrictComparable");ARn=SRn;ee(kRn,"getMatchData");I4i=kRn;ee(RRn,"matchesStrictComparable");PRn=RRn;ee(IRn,"baseMatches");M4i=IRn;ee(MRn,"baseHasIn");L4i=MRn;ee(LRn,"hasPath");DRn=LRn;ee(FRn,"hasIn");D4i=FRn;F4i=1;N4i=2;ee(NRn,"baseMatchesProperty");O4i=NRn;ee(ORn,"baseProperty");B4i=ORn;ee(BRn,"basePropertyDeep");z4i=BRn;ee(zRn,"property");U4i=zRn;ee(URn,"baseIteratee");_S=URn;ee(VRn,"arrayAggregator");V4i=VRn;ee($Rn,"createBaseFor");$4i=$Rn;G4i=$4i();H4i=G4i;ee(GRn,"baseForOwn");W4i=GRn;ee(HRn,"createBaseEach");Y4i=HRn;q4i=Y4i(W4i);R6=q4i;ee(WRn,"baseAggregator");X4i=WRn;ee(YRn,"createAggregator");j4i=YRn;qRn=Object.prototype;K4i=qRn.hasOwnProperty;Z4i=pot(function(e,t){e=Object(e);var n=-1;var r=t.length;var i=r>2?t[2]:void 0;if(i&&rRe(t[0],t[1],i)){r=1}while(++n{t.accept(e)})}};cb=class extends TS{static{ee(this,"NonTerminal")}constructor(e){super([]);this.idx=1;fv(this,qw(e,t=>t!==void 0))}set definition(e){}get definition(){if(this.referencedRule!==void 0){return this.referencedRule.definition}return[]}accept(e){e.visit(this)}};rH=class extends TS{static{ee(this,"Rule")}constructor(e){super(e.definition);this.orgText="";fv(this,qw(e,t=>t!==void 0))}};Rx=class extends TS{static{ee(this,"Alternative")}constructor(e){super(e.definition);this.ignoreAmbiguities=false;fv(this,qw(e,t=>t!==void 0))}};Fg=class extends TS{static{ee(this,"Option")}constructor(e){super(e.definition);this.idx=1;fv(this,qw(e,t=>t!==void 0))}};pv=class extends TS{static{ee(this,"RepetitionMandatory")}constructor(e){super(e.definition);this.idx=1;fv(this,qw(e,t=>t!==void 0))}};mv=class extends TS{static{ee(this,"RepetitionMandatoryWithSeparator")}constructor(e){super(e.definition);this.idx=1;fv(this,qw(e,t=>t!==void 0))}};Zf=class extends TS{static{ee(this,"Repetition")}constructor(e){super(e.definition);this.idx=1;fv(this,qw(e,t=>t!==void 0))}};Px=class extends TS{static{ee(this,"RepetitionWithSeparator")}constructor(e){super(e.definition);this.idx=1;fv(this,qw(e,t=>t!==void 0))}};Ix=class extends TS{static{ee(this,"Alternation")}get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition);this.idx=1;this.ignoreAmbiguities=false;this.hasPredicates=false;fv(this,qw(e,t=>t!==void 0))}};Ud=class{static{ee(this,"Terminal")}constructor(e){this.idx=1;fv(this,qw(e,t=>t!==void 0))}accept(e){e.visit(this)}};ee(zPn,"serializeGrammar");ee(vne,"serializeProduction");iH=class{static{ee(this,"GAstVisitor")}visit(e){const t=e;switch(t.constructor){case cb:return this.visitNonTerminal(t);case Rx:return this.visitAlternative(t);case Fg:return this.visitOption(t);case pv:return this.visitRepetitionMandatory(t);case mv:return this.visitRepetitionMandatoryWithSeparator(t);case Px:return this.visitRepetitionWithSeparator(t);case Zf:return this.visitRepetition(t);case Ix:return this.visitAlternation(t);case Ud:return this.visitTerminal(t);case rH:return this.visitRule(t);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}};ee(UPn,"isSequenceProd");ee(Fne,"isOptionalProd");ee(VPn,"isBranchingProd");ee(zw,"getProductionDslName");pRe=class{static{ee(this,"RestWalker")}walk(e,t=[]){cs(e.definition,(n,r)=>{const i=Dg(e.definition,r+1);if(n instanceof cb){this.walkProdRef(n,i,t)}else if(n instanceof Ud){this.walkTerminal(n,i,t)}else if(n instanceof Rx){this.walkFlat(n,i,t)}else if(n instanceof Fg){this.walkOption(n,i,t)}else if(n instanceof pv){this.walkAtLeastOne(n,i,t)}else if(n instanceof mv){this.walkAtLeastOneSep(n,i,t)}else if(n instanceof Px){this.walkManySep(n,i,t)}else if(n instanceof Zf){this.walkMany(n,i,t)}else if(n instanceof Ix){this.walkOr(n,i,t)}else{throw Error("non exhaustive match")}})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){const r=t.concat(n);this.walk(e,r)}walkOption(e,t,n){const r=t.concat(n);this.walk(e,r)}walkAtLeastOne(e,t,n){const r=[new Fg({definition:e.definition})].concat(t,n);this.walk(e,r)}walkAtLeastOneSep(e,t,n){const r=Nnt(e,t,n);this.walk(e,r)}walkMany(e,t,n){const r=[new Fg({definition:e.definition})].concat(t,n);this.walk(e,r)}walkManySep(e,t,n){const r=Nnt(e,t,n);this.walk(e,r)}walkOr(e,t,n){const r=t.concat(n);cs(e.definition,i=>{const o=new Rx({definition:[i]});this.walk(o,r)})}};ee(Nnt,"restForRepetitionWithSeparator");ee(oH,"first");ee($Pn,"firstForSequence");ee(GPn,"firstForBranching");ee(HPn,"firstForTerminal");WPn="_~IN~_";BNi=class extends pRe{static{ee(this,"ResyncFollowsWalker")}constructor(e){super();this.topProd=e;this.follows={}}startWalking(){this.walk(this.topProd);return this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){const r=qPn(e.referencedRule,e.idx)+this.topProd.name;const i=t.concat(n);const o=new Rx({definition:i});const a=oH(o);this.follows[r]=a}};ee(YPn,"computeAllProdsFollows");ee(qPn,"buildBetweenProdsFollowPrefix");AAe={};zNi=new CSn;ee(sre,"getRegExpAst");ee(XPn,"clearRegExpParserCache");jPn="Complement Sets are not supported for first char optimization";gke='Unable to use "first char" lexer optimizations:\n';ee(KPn,"getOptimizedStartCodesIndices");ee(yke,"firstCharOptimizedIndices");ee(one,"addOptimizedIdxToResult");ee(ZPn,"handleIgnoreCase");ee(Ont,"findCode");ee(bke,"isWholeOptional");UNi=class extends qke{static{ee(this,"CharCodeFinder")}constructor(e){super();this.targetCharCodes=e;this.found=false}visitChildren(e){if(this.found===true){return}switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return;case"Lookbehind":this.visitLookbehind(e);return;case"NegativeLookbehind":this.visitNegativeLookbehind(e);return}super.visitChildren(e)}visitCharacter(e){if(fb(this.targetCharCodes,e.value)){this.found=true}}visitSet(e){if(e.complement){if(Ont(e,this.targetCharCodes)===void 0){this.found=true}}else{if(Ont(e,this.targetCharCodes)!==void 0){this.found=true}}}};ee(mRe,"canMatchCharCode");p6="PATTERN";ane="defaultMode";tAe="modes";ee(JPn,"analyzeTokenTypes");ee(QPn,"validatePatterns");ee(eIn,"validateRegExpPattern");ee(tIn,"findMissingPatterns");ee(nIn,"findInvalidPatterns");VNi=/[^\\][$]/;ee(rIn,"findEndOfInputAnchor");ee(iIn,"findEmptyMatchRegExps");$Ni=/[^\\[][\^]|^\^/;ee(oIn,"findStartOfInputAnchor");ee(aIn,"findUnsupportedFlags");ee(sIn,"findDuplicatePatterns");ee(lIn,"findInvalidGroupType");ee(cIn,"findModesThatDoNotExist");ee(uIn,"findUnreachablePatterns");ee(dIn,"tryToMatchStrToPattern");ee(fIn,"noMetaChar");ee(hIn,"usesLookAheadOrBehind");ee(Bnt,"addStickyFlag");ee(pIn,"performRuntimeChecks");ee(mIn,"performWarningRuntimeChecks");ee(gIn,"cloneEmptyGroups");ee(Dot,"isCustomPattern");ee(yIn,"isShortPattern");GNi={test:ee(function(e){const t=e.length;for(let n=this.lastIndex;n${e.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(e,t,n,r,i,o){return`unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${n} characters.`}};(function(e){e[e["MISSING_PATTERN"]=0]="MISSING_PATTERN";e[e["INVALID_PATTERN"]=1]="INVALID_PATTERN";e[e["EOI_ANCHOR_FOUND"]=2]="EOI_ANCHOR_FOUND";e[e["UNSUPPORTED_FLAGS_FOUND"]=3]="UNSUPPORTED_FLAGS_FOUND";e[e["DUPLICATE_PATTERNS_FOUND"]=4]="DUPLICATE_PATTERNS_FOUND";e[e["INVALID_GROUP_TYPE_FOUND"]=5]="INVALID_GROUP_TYPE_FOUND";e[e["PUSH_MODE_DOES_NOT_EXIST"]=6]="PUSH_MODE_DOES_NOT_EXIST";e[e["MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE"]=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE";e[e["MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY"]=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY";e[e["MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST"]=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST";e[e["LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED"]=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED";e[e["SOI_ANCHOR_FOUND"]=11]="SOI_ANCHOR_FOUND";e[e["EMPTY_MATCH_PATTERN"]=12]="EMPTY_MATCH_PATTERN";e[e["NO_LINE_BREAKS_FLAGS"]=13]="NO_LINE_BREAKS_FLAGS";e[e["UNREACHABLE_PATTERN"]=14]="UNREACHABLE_PATTERN";e[e["IDENTIFY_TERMINATOR"]=15]="IDENTIFY_TERMINATOR";e[e["CUSTOM_LINE_BREAK"]=16]="CUSTOM_LINE_BREAK";e[e["MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"]=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(Jf||(Jf={}));lne={deferDefinitionErrorsHandling:false,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:false,safeMode:false,errorMessageProvider:Unt,traceInitPerf:false,skipValidations:false,recoveryEnabled:true};Object.freeze(lne);sb=class{static{ee(this,"Lexer")}constructor(e,t=lne){this.lexerDefinition=e;this.lexerDefinitionErrors=[];this.lexerDefinitionWarning=[];this.patternIdxToConfig={};this.charCodeToPatternIdxToConfig={};this.modes=[];this.emptyGroups={};this.trackStartLines=true;this.trackEndLines=true;this.hasCustom=false;this.canModeBeOptimized={};this.TRACE_INIT=(r,i)=>{if(this.traceInitPerf===true){this.traceInitIndent++;const o=new Array(this.traceInitIndent+1).join(" ");if(this.traceInitIndent <${r}>`)}const{time:a,value:s}=Mot(i);const l=a>10?console.warn:console.log;if(this.traceInitIndent time: ${a}ms`)}this.traceInitIndent--;return s}else{return i()}};if(typeof t==="boolean"){throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported")}this.config=fv({},lne,t);const n=this.config.traceInitPerf;if(n===true){this.traceInitMaxIdent=Infinity;this.traceInitPerf=true}else if(typeof n==="number"){this.traceInitMaxIdent=n;this.traceInitPerf=true}this.traceInitIndent=-1;this.TRACE_INIT("Lexer Constructor",()=>{let r;let i=true;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===lne.lineTerminatorsPattern){this.config.lineTerminatorsPattern=GNi}else{if(this.config.lineTerminatorCharacters===lne.lineTerminatorCharacters){throw Error("Error: Missing property on the Lexer config.\n For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS")}}if(t.safeMode&&t.ensureOptimizations){throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.')}this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking);this.trackEndLines=/full/i.test(this.config.positionTracking);if(gc(e)){r={modes:{defaultMode:Ng(e)},defaultMode:ane}}else{i=false;r=Ng(e)}});if(this.config.skipValidations===false){this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(pIn(r,this.trackStartLines,this.config.lineTerminatorCharacters))});this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(mIn(r,this.trackStartLines,this.config.lineTerminatorCharacters))})}r.modes=r.modes?r.modes:{};cs(r.modes,(a,s)=>{r.modes[s]=hRe(a,l=>JR(l))});const o=dv(r.modes);cs(r.modes,(a,s)=>{this.TRACE_INIT(`Mode: <${s}> processing`,()=>{this.modes.push(s);if(this.config.skipValidations===false){this.TRACE_INIT(`validatePatterns`,()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(QPn(a,o))})}if(ud(this.lexerDefinitionErrors)){sH(a);let l;this.TRACE_INIT(`analyzeTokenTypes`,()=>{l=JPn(a,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:this.TRACE_INIT})});this.patternIdxToConfig[s]=l.patternIdxToConfig;this.charCodeToPatternIdxToConfig[s]=l.charCodeToPatternIdxToConfig;this.emptyGroups=fv({},this.emptyGroups,l.emptyGroups);this.hasCustom=l.hasCustom||this.hasCustom;this.canModeBeOptimized[s]=l.canBeOptimized}})});this.defaultMode=r.defaultMode;if(!ud(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const a=fa(this.lexerDefinitionErrors,l=>{return l.message});const s=a.join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+s)}cs(this.lexerDefinitionWarning,a=>{Iot(a.message)});this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(i){this.handleModes=Vm}if(this.trackStartLines===false){this.computeNewColumn=ere}if(this.trackEndLines===false){this.updateTokenEndLineColumnLocation=Vm}if(/full/i.test(this.config.positionTracking)){this.createTokenInstance=this.createFullToken}else if(/onlyStart/i.test(this.config.positionTracking)){this.createTokenInstance=this.createStartOnlyToken}else if(/onlyOffset/i.test(this.config.positionTracking)){this.createTokenInstance=this.createOffsetOnlyToken}else{throw Error(`Invalid config option: "${this.config.positionTracking}"`)}if(this.hasCustom){this.addToken=this.addTokenUsingPush;this.handlePayload=this.handlePayloadWithCustom}else{this.addToken=this.addTokenUsingMemberAccess;this.handlePayload=this.handlePayloadNoCustom}});this.TRACE_INIT("Failed Optimization Warnings",()=>{const a=hv(this.canModeBeOptimized,(s,l,u)=>{if(l===false){s.push(u)}return s},[]);if(t.ensureOptimizations&&!ud(a)){throw Error(`Lexer Modes: < ${a.join(", ")} > cannot be optimized. + Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode. + Or inspect the console log for details on how to resolve these issues.`)}});this.TRACE_INIT("clearRegExpParserCache",()=>{XPn()});this.TRACE_INIT("toFastProperties",()=>{Lot(this)})})}tokenize(e,t=this.defaultMode){if(!ud(this.lexerDefinitionErrors)){const n=fa(this.lexerDefinitionErrors,i=>{return i.message});const r=n.join("-----------------------\n");throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+r)}return this.tokenizeInternal(e,t)}tokenizeInternal(e,t){let n,r,i,o,a,s,l,u,d,f,h,m,g,x,w;const _=e;const C=_.length;let A=0;let P=0;const L=this.hasCustom?0:Math.floor(e.length/10);const I=new Array(L);const N=[];let O=this.trackStartLines?1:void 0;let z=this.trackStartLines?1:void 0;const U=gIn(this.emptyGroups);const W=this.trackStartLines;const H=this.config.lineTerminatorsPattern;let $=0;let K=[];let X=[];const j=[];const te=[];Object.freeze(te);let J=false;const oe=ee(ue=>{if(j.length===1&&ue.tokenType.PUSH_MODE===void 0){const xe=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(ue);N.push({offset:ue.startOffset,line:ue.startLine,column:ue.startColumn,length:ue.image.length,message:xe})}else{j.pop();const xe=h6(j);K=this.patternIdxToConfig[xe];X=this.charCodeToPatternIdxToConfig[xe];$=K.length;const be=this.canModeBeOptimized[xe]&&this.config.safeMode===false;if(X&&be){J=true}else{J=false}}},"pop_mode");function se(ue){j.push(ue);X=this.charCodeToPatternIdxToConfig[ue];K=this.patternIdxToConfig[ue];$=K.length;$=K.length;const xe=this.canModeBeOptimized[ue]&&this.config.safeMode===false;if(X&&xe){J=true}else{J=false}}ee(se,"push_mode");se.call(this,t);let re;const ce=this.config.recoveryEnabled;while(As.length){s=o;d=o.length;l=u;re=ge;break}}}break}}if(d!==-1){f=re.group;if(f!==void 0){s=s!==null?s:e.substring(A,A+d);h=re.tokenTypeIdx;m=this.createTokenInstance(s,A,h,re.tokenType,O,z,d);this.handlePayload(m,l);if(f===false){P=this.addToken(I,P,m)}else{U[f].push(m)}}if(W===true&&re.canLineTerminator===true){let Ie=0;let he;let ve;H.lastIndex=0;do{s=s!==null?s:e.substring(A,A+d);he=H.test(s);if(he===true){ve=H.lastIndex-1;Ie++}}while(he===true);if(Ie!==0){O=O+Ie;z=d-ve;this.updateTokenEndLineColumnLocation(m,f,ve,Ie,O,z,d)}else{z=this.computeNewColumn(z,d)}}else{z=this.computeNewColumn(z,d)}A=A+d;this.handleModes(re,oe,se,m)}else{const Ie=A;const he=O;const ve=z;let ge=ce===false;while(ge===false&&A ${u6(e)} <--`:`token of type --> ${e.name} <--`;const a=`Expecting ${o} but found --> '${t.image}' <--`;return a},buildNotAllInputParsedMessage({firstRedundant:e,ruleName:t}){return"Redundant input, expecting EOF but found: "+e.image},buildNoViableAltMessage({expectedPathsPerAlt:e,actual:t,previous:n,customUserDescription:r,ruleName:i}){const o="Expecting: ";const a=Yw(t).image;const s="\nbut found: '"+a+"'";if(r){return o+r+s}else{const l=hv(e,(h,m)=>h.concat(m),[]);const u=fa(l,h=>`[${fa(h,m=>u6(m)).join(", ")}]`);const d=fa(u,(h,m)=>` ${m+1}. ${h}`);const f=`one of these possible Token sequences: +${d.join("\n")}`;return o+f+s}},buildEarlyExitMessage({expectedIterationPaths:e,actual:t,customUserDescription:n,ruleName:r}){const i="Expecting: ";const o=Yw(t).image;const a="\nbut found: '"+o+"'";if(n){return i+n+a}else{const s=fa(e,u=>`[${fa(u,d=>u6(d)).join(",")}]`);const l=`expecting at least one iteration which starts with one of these possible Token sequences:: + <${s.join(" ,")}>`;return i+l+a}}};Object.freeze(NG);WNi={buildRuleNotFoundError(e,t){const n="Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+"<-\ninside top level rule: ->"+e.name+"<-";return n}};s6={buildDuplicateFoundError(e,t){function n(d){if(d instanceof Ud){return d.terminalType.name}else if(d instanceof cb){return d.nonTerminalName}else{return""}}ee(n,"getExtraProductionArgument");const r=e.name;const i=Yw(t);const o=i.idx;const a=zw(i);const s=n(i);const l=o>0;let u=`->${a}${l?o:""}<- ${s?`with argument: ->${s}<-`:""} + appears more than once (${t.length} times) in the top level rule: ->${r}<-. + For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES + `;u=u.replace(/[ \t]+/g," ");u=u.replace(/\s\s+/g,"\n");return u},buildNamespaceConflictError(e){const t=`Namespace conflict found in grammar. +The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>. +To resolve this make sure each Terminal and Non-Terminal names are unique +This is easy to accomplish by using the convention that Terminal names start with an uppercase letter +and Non-Terminal names start with a lower case letter.`;return t},buildAlternationPrefixAmbiguityError(e){const t=fa(e.prefixPath,i=>u6(i)).join(", ");const n=e.alternation.idx===0?"":e.alternation.idx;const r=`Ambiguous alternatives: <${e.ambiguityIndices.join(" ,")}> due to common lookahead prefix +in inside <${e.topLevelRule.name}> Rule, +<${t}> may appears as a prefix path in all these alternatives. +See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX +For Further details.`;return r},buildAlternationAmbiguityError(e){const t=e.alternation.idx===0?"":e.alternation.idx;const n=e.prefixPath.length===0;let r=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(" ,")}> in inside <${e.topLevelRule.name}> Rule, +`;if(n){r+=`These alternatives are all empty (match no tokens), making them indistinguishable. +Only the last alternative may be empty. +`}else{const i=fa(e.prefixPath,o=>u6(o)).join(", ");r+=`<${i}> may appears as a prefix path in all these alternatives. +`}r+=`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES +For Further details.`;return r},buildEmptyRepetitionError(e){let t=zw(e.repetition);if(e.repetition.idx!==0){t+=e.repetition.idx}const n=`The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens. +This could lead to an infinite loop.`;return n},buildTokenNameError(e){return"deprecated"},buildEmptyAlternationError(e){const t=`Ambiguous empty alternative: <${e.emptyChoiceIdx+1}> in inside <${e.topLevelRule.name}> Rule. +Only the last alternative may be an empty alternative.`;return t},buildTooManyAlternativesError(e){const t=`An Alternation cannot have more than 256 alternatives: + inside <${e.topLevelRule.name}> Rule. + has ${e.alternation.definition.length+1} alternatives.`;return t},buildLeftRecursionError(e){const t=e.topLevelRule.name;const n=fa(e.leftRecursionPath,o=>o.name);const r=`${t} --> ${n.concat([t]).join(" --> ")}`;const i=`Left Recursion found in grammar. +rule: <${t}> can be invoked from itself (directly or indirectly) +without consuming any Tokens. The grammar path that causes this is: + ${r} + To fix this refactor your grammar to remove the left recursion. +see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`;return i},buildInvalidRuleNameError(e){return"deprecated"},buildDuplicateRuleNameError(e){let t;if(e.topLevelRule instanceof rH){t=e.topLevelRule.name}else{t=e.topLevelRule}const n=`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`;return n}};ee(RIn,"resolveGrammar");YNi=class extends iH{static{ee(this,"GastRefResolverVisitor")}constructor(e,t){super();this.nameToTopRule=e;this.errMsgProvider=t;this.errors=[]}resolveRefs(){cs(Vp(this.nameToTopRule),e=>{this.currTopLevel=e;e.accept(this)})}visitNonTerminal(e){const t=this.nameToTopRule[e.nonTerminalName];if(!t){const n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:ub.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}else{e.referencedRule=t}}};qNi=class extends pRe{static{ee(this,"AbstractNextPossibleTokensWalker")}constructor(e,t){super();this.topProd=e;this.path=t;this.possibleTokTypes=[];this.nextProductionName="";this.nextProductionOccurrence=0;this.found=false;this.isAtEndOfPath=false}startWalking(){this.found=false;if(this.path.ruleStack[0]!==this.topProd.name){throw Error("The path does not start with the walker's top Rule!")}this.ruleStack=Ng(this.path.ruleStack).reverse();this.occurrenceStack=Ng(this.path.occurrenceStack).reverse();this.ruleStack.pop();this.occurrenceStack.pop();this.updateExpectedNext();this.walk(this.topProd);return this.possibleTokTypes}walk(e,t=[]){if(!this.found){super.walk(e,t)}}walkProdRef(e,t,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const r=t.concat(n);this.updateExpectedNext();this.walk(e.referencedRule,r)}}updateExpectedNext(){if(ud(this.ruleStack)){this.nextProductionName="";this.nextProductionOccurrence=0;this.isAtEndOfPath=true}else{this.nextProductionName=this.ruleStack.pop();this.nextProductionOccurrence=this.occurrenceStack.pop()}}};XNi=class extends qNi{static{ee(this,"NextAfterTokenWalker")}constructor(e,t){super(e,t);this.path=t;this.nextTerminalName="";this.nextTerminalOccurrence=0;this.nextTerminalName=this.path.lastTok.name;this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,t,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const r=t.concat(n);const i=new Rx({definition:r});this.possibleTokTypes=oH(i);this.found=true}}};gRe=class extends pRe{static{ee(this,"AbstractNextTerminalAfterProductionWalker")}constructor(e,t){super();this.topRule=e;this.occurrence=t;this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){this.walk(this.topRule);return this.result}};jNi=class extends gRe{static{ee(this,"NextTerminalAfterManyWalker")}walkMany(e,t,n){if(e.idx===this.occurrence){const r=Yw(t.concat(n));this.result.isEndOfRule=r===void 0;if(r instanceof Ud){this.result.token=r.terminalType;this.result.occurrence=r.idx}}else{super.walkMany(e,t,n)}}};WEn=class extends gRe{static{ee(this,"NextTerminalAfterManySepWalker")}walkManySep(e,t,n){if(e.idx===this.occurrence){const r=Yw(t.concat(n));this.result.isEndOfRule=r===void 0;if(r instanceof Ud){this.result.token=r.terminalType;this.result.occurrence=r.idx}}else{super.walkManySep(e,t,n)}}};KNi=class extends gRe{static{ee(this,"NextTerminalAfterAtLeastOneWalker")}walkAtLeastOne(e,t,n){if(e.idx===this.occurrence){const r=Yw(t.concat(n));this.result.isEndOfRule=r===void 0;if(r instanceof Ud){this.result.token=r.terminalType;this.result.occurrence=r.idx}}else{super.walkAtLeastOne(e,t,n)}}};YEn=class extends gRe{static{ee(this,"NextTerminalAfterAtLeastOneSepWalker")}walkAtLeastOneSep(e,t,n){if(e.idx===this.occurrence){const r=Yw(t.concat(n));this.result.isEndOfRule=r===void 0;if(r instanceof Ud){this.result.token=r.terminalType;this.result.occurrence=r.idx}}else{super.walkAtLeastOneSep(e,t,n)}}};ee(xke,"possiblePathsFrom");ee(Vot,"nextPossibleTokensAfter");ee(PIn,"expandTopLevelRule");(function(e){e[e["OPTION"]=0]="OPTION";e[e["REPETITION"]=1]="REPETITION";e[e["REPETITION_MANDATORY"]=2]="REPETITION_MANDATORY";e[e["REPETITION_MANDATORY_WITH_SEPARATOR"]=3]="REPETITION_MANDATORY_WITH_SEPARATOR";e[e["REPETITION_WITH_SEPARATOR"]=4]="REPETITION_WITH_SEPARATOR";e[e["ALTERNATION"]=5]="ALTERNATION"})(kf||(kf={}));ee(yRe,"getProdType");ee(Vnt,"getLookaheadPaths");ee(IIn,"buildLookaheadFuncForOr");ee(MIn,"buildLookaheadFuncForOptionalProd");ee(LIn,"buildAlternativesLookAheadFunc");ee(DIn,"buildSingleAlternativeLookaheadFunction");ZNi=class extends pRe{static{ee(this,"RestDefinitionFinderWalker")}constructor(e,t,n){super();this.topProd=e;this.targetOccurrence=t;this.targetProdType=n}startWalking(){this.walk(this.topProd);return this.restDef}checkIsTarget(e,t,n,r){if(e.idx===this.targetOccurrence&&this.targetProdType===t){this.restDef=n.concat(r);return true}return false}walkOption(e,t,n){if(!this.checkIsTarget(e,kf.OPTION,t,n)){super.walkOption(e,t,n)}}walkAtLeastOne(e,t,n){if(!this.checkIsTarget(e,kf.REPETITION_MANDATORY,t,n)){super.walkOption(e,t,n)}}walkAtLeastOneSep(e,t,n){if(!this.checkIsTarget(e,kf.REPETITION_MANDATORY_WITH_SEPARATOR,t,n)){super.walkOption(e,t,n)}}walkMany(e,t,n){if(!this.checkIsTarget(e,kf.REPETITION,t,n)){super.walkOption(e,t,n)}}walkManySep(e,t,n){if(!this.checkIsTarget(e,kf.REPETITION_WITH_SEPARATOR,t,n)){super.walkOption(e,t,n)}}};FIn=class extends iH{static{ee(this,"InsideDefinitionFinderVisitor")}constructor(e,t,n){super();this.targetOccurrence=e;this.targetProdType=t;this.targetRef=n;this.result=[]}checkIsTarget(e,t){if(e.idx===this.targetOccurrence&&this.targetProdType===t&&(this.targetRef===void 0||e===this.targetRef)){this.result=e.definition}}visitOption(e){this.checkIsTarget(e,kf.OPTION)}visitRepetition(e){this.checkIsTarget(e,kf.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,kf.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,kf.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,kf.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,kf.ALTERNATION)}};ee($nt,"initializeArrayOfArrays");ee(PAe,"pathToHashKeys");ee(NIn,"isUniquePrefixHash");ee($ot,"lookAheadSequenceFromAlternatives");ee(cre,"getLookaheadPathsForOr");ee(ure,"getLookaheadPathsForOptionalProd");ee(vke,"containsPath");ee(OIn,"isStrictPrefixOfPath");ee(Got,"areTokenCategoriesNotUsed");ee(BIn,"validateLookahead");ee(zIn,"validateGrammar");ee(UIn,"validateDuplicateProductions");ee(VIn,"identifyProductionForDuplicates");ee(Hot,"getExtraProductionArgument");JNi=class extends iH{static{ee(this,"OccurrenceValidationCollector")}constructor(){super(...arguments);this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}};ee($In,"validateRuleDoesNotAlreadyExist");ee(GIn,"validateRuleIsOverridden");ee(Wot,"validateNoLeftRecursion");ee(_ne,"getFirstNoneTerminal");Yot=class extends iH{static{ee(this,"OrCollector")}constructor(){super(...arguments);this.alternations=[]}visitAlternation(e){this.alternations.push(e)}};ee(HIn,"validateEmptyOrAlternative");ee(WIn,"validateAmbiguousAlternationAlternatives");QNi=class extends iH{static{ee(this,"RepetitionCollector")}constructor(){super(...arguments);this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}};ee(YIn,"validateTooManyAlts");ee(qIn,"validateSomeNonEmptyLookaheadPath");ee(XIn,"checkAlternativesAmbiguities");ee(jIn,"checkPrefixAlternativesAmbiguities");ee(KIn,"checkTerminalAndNoneTerminalsNameSpace");ee(ZIn,"resolveGrammar");ee(JIn,"validateGrammar");QIn="MismatchedTokenException";e3n="NoViableAltException";t3n="EarlyExitException";n3n="NotAllInputParsedException";r3n=[QIn,e3n,t3n,n3n];Object.freeze(r3n);ee(One,"isRecognitionException");bRe=class extends Error{static{ee(this,"RecognitionException")}constructor(e,t){super(e);this.token=t;this.resyncedTokens=[];Object.setPrototypeOf(this,new.target.prototype);if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}}};i3n=class extends bRe{static{ee(this,"MismatchedTokenException")}constructor(e,t,n){super(e,t);this.previousToken=n;this.name=QIn}};eOi=class extends bRe{static{ee(this,"NoViableAltException")}constructor(e,t,n){super(e,t);this.previousToken=n;this.name=e3n}};tOi=class extends bRe{static{ee(this,"NotAllInputParsedException")}constructor(e,t){super(e,t);this.name=n3n}};nOi=class extends bRe{static{ee(this,"EarlyExitException")}constructor(e,t,n){super(e,t);this.previousToken=n;this.name=t3n}};dtt={};o3n="InRuleRecoveryException";rOi=class extends Error{static{ee(this,"InRuleRecoveryException")}constructor(e){super(e);this.name=o3n}};iOi=class{static{ee(this,"Recoverable")}initRecoverable(e){this.firstAfterRepMap={};this.resyncFollows={};this.recoveryEnabled=qa(e,"recoveryEnabled")?e.recoveryEnabled:eP.recoveryEnabled;if(this.recoveryEnabled){this.attemptInRepetitionRecovery=a3n}}getTokenToInsert(e){const t=lre(e,"",NaN,NaN,NaN,NaN,NaN,NaN);t.isInsertedInRecovery=true;return t}canTokenTypeBeInsertedInRecovery(e){return true}canTokenTypeBeDeletedInRecovery(e){return true}tryInRepetitionRecovery(e,t,n,r){const i=this.findReSyncTokenType();const o=this.exportLexerState();const a=[];let s=false;const l=this.LA(1);let u=this.LA(1);const d=ee(()=>{const f=this.LA(0);const h=this.errorMessageProvider.buildMismatchTokenMessage({expected:r,actual:l,previous:f,ruleName:this.getCurrRuleFullName()});const m=new i3n(h,l,this.LA(0));m.resyncedTokens=Dne(a);this.SAVE_ERROR(m)},"generateErrorMessage");while(!s){if(this.tokenMatcher(u,r)){d();return}else if(n.call(this)){d();e.apply(this,t);return}else if(this.tokenMatcher(u,i)){s=true}else{u=this.SKIP_TOKEN();this.addToResyncTokens(u,a)}}this.importLexerState(o)}shouldInRepetitionRecoveryBeTried(e,t,n){if(n===false){return false}if(this.tokenMatcher(this.LA(1),e)){return false}if(this.isBackTracking()){return false}if(this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t))){return false}return true}getFollowsForInRuleRecovery(e,t){const n=this.getCurrentGrammarPath(e,t);const r=this.getNextPossibleTokenTypes(n);return r}tryInRuleRecovery(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t)){const n=this.getTokenToInsert(e);return n}if(this.canRecoverWithSingleTokenDeletion(e)){const n=this.SKIP_TOKEN();this.consumeToken();return n}throw new rOi("sad sad panda")}canPerformInRuleRecovery(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,t){if(!this.canTokenTypeBeInsertedInRecovery(e)){return false}if(ud(t)){return false}const n=this.LA(1);const r=ZG(t,i=>{return this.tokenMatcher(n,i)})!==void 0;return r}canRecoverWithSingleTokenDeletion(e){if(!this.canTokenTypeBeDeletedInRecovery(e)){return false}const t=this.tokenMatcher(this.LA(2),e);return t}isInCurrentRuleReSyncSet(e){const t=this.getCurrFollowKey();const n=this.getFollowSetFromFollowKey(t);return fb(n,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let t=this.LA(1);let n=2;while(true){const r=ZG(e,i=>{const o=Uot(t,i);return o});if(r!==void 0){return r}t=this.LA(n);n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1){return dtt}const e=this.getLastExplicitRuleShortName();const t=this.getLastExplicitRuleOccurrenceIndex();const n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK;const t=this.RULE_OCCURRENCE_STACK;return fa(e,(n,r)=>{if(r===0){return dtt}return{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:t[r],inRule:this.shortRuleNameToFullName(e[r-1])}})}flattenFollowSet(){const e=fa(this.buildFullFollowKeyStack(),t=>{return this.getFollowSetFromFollowKey(t)});return Gw(e)}getFollowSetFromFollowKey(e){if(e===dtt){return[fD]}const t=e.ruleName+e.idxInCallingRule+WPn+e.inRule;return this.resyncFollows[t]}addToResyncTokens(e,t){if(!this.tokenMatcher(e,fD)){t.push(e)}return t}reSyncTo(e){const t=[];let n=this.LA(1);while(this.tokenMatcher(n,e)===false){n=this.SKIP_TOKEN();this.addToResyncTokens(n,t)}return Dne(t)}attemptInRepetitionRecovery(e,t,n,r,i,o,a){}getCurrentGrammarPath(e,t){const n=this.getHumanReadableRuleStack();const r=Ng(this.RULE_OCCURRENCE_STACK);const i={ruleStack:n,occurrenceStack:r,lastTok:e,lastTokOccurrence:t};return i}getHumanReadableRuleStack(){return fa(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}};ee(a3n,"attemptInRepetitionRecovery");oOi=4;bD=8;aOi=8;s3n=1<Wot(t,t,s6))}validateEmptyOrAlternatives(e){return W_(e,t=>HIn(t,s6))}validateAmbiguousAlternationAlternatives(e,t){return W_(e,n=>WIn(n,t,s6))}validateSomeNonEmptyLookaheadPath(e,t){return qIn(e,t,s6)}buildLookaheadForAlternation(e){return IIn(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,LIn)}buildLookaheadForOptional(e){return MIn(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,yRe(e.prodType),DIn)}};sOi=class{static{ee(this,"LooksAhead")}initLooksAhead(e){this.dynamicTokensEnabled=qa(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:eP.dynamicTokensEnabled;this.maxLookahead=qa(e,"maxLookahead")?e.maxLookahead:eP.maxLookahead;this.lookaheadStrategy=qa(e,"lookaheadStrategy")?e.lookaheadStrategy:new qot({maxLookahead:this.maxLookahead});this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){cs(e,t=>{this.TRACE_INIT(`${t.name} Rule Lookahead`,()=>{const{alternation:n,repetition:r,option:i,repetitionMandatory:o,repetitionMandatoryWithSeparator:a,repetitionWithSeparator:s}=c3n(t);cs(n,l=>{const u=l.idx===0?"":l.idx;this.TRACE_INIT(`${zw(l)}${u}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:l.idx,rule:t,maxLookahead:l.maxLookahead||this.maxLookahead,hasPredicates:l.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled});const f=MAe(this.fullRuleNameToShort[t.name],s3n,l.idx);this.setLaFuncCache(f,d)})});cs(r,l=>{this.computeLookaheadFunc(t,l.idx,Gnt,"Repetition",l.maxLookahead,zw(l))});cs(i,l=>{this.computeLookaheadFunc(t,l.idx,l3n,"Option",l.maxLookahead,zw(l))});cs(o,l=>{this.computeLookaheadFunc(t,l.idx,Hnt,"RepetitionMandatory",l.maxLookahead,zw(l))});cs(a,l=>{this.computeLookaheadFunc(t,l.idx,IAe,"RepetitionMandatoryWithSeparator",l.maxLookahead,zw(l))});cs(s,l=>{this.computeLookaheadFunc(t,l.idx,Wnt,"RepetitionWithSeparator",l.maxLookahead,zw(l))})})})}computeLookaheadFunc(e,t,n,r,i,o){this.TRACE_INIT(`${o}${t===0?"":t}`,()=>{const a=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:i||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:r});const s=MAe(this.fullRuleNameToShort[e.name],n,t);this.setLaFuncCache(s,a)})}getKeyForAutomaticLookahead(e,t){const n=this.getLastExplicitRuleShortName();return MAe(n,e,t)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,t){this.lookAheadFuncsCache.set(e,t)}};lOi=class extends iH{static{ee(this,"DslMethodsCollectorVisitor")}constructor(){super(...arguments);this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}};nAe=new lOi;ee(c3n,"collectMethods");ee(Ynt,"setNodeLocationOnlyOffset");ee(qnt,"setNodeLocationFull");ee(u3n,"addTerminalToCst");ee(d3n,"addNoneTerminalToCst");cOi="name";ee(Xot,"defineNameProp");ee(f3n,"defaultVisit");ee(h3n,"createBaseSemanticVisitorConstructor");ee(p3n,"createBaseVisitorConstructorWithDefaults");(function(e){e[e["REDUNDANT_METHOD"]=0]="REDUNDANT_METHOD";e[e["MISSING_METHOD"]=1]="MISSING_METHOD"})(Xnt||(Xnt={}));ee(m3n,"validateVisitor");ee(g3n,"validateMissingCstMethods");uOi=class{static{ee(this,"TreeBuilder")}initTreeBuilder(e){this.CST_STACK=[];this.outputCst=e.outputCst;this.nodeLocationTracking=qa(e,"nodeLocationTracking")?e.nodeLocationTracking:eP.nodeLocationTracking;if(!this.outputCst){this.cstInvocationStateUpdate=Vm;this.cstFinallyStateUpdate=Vm;this.cstPostTerminal=Vm;this.cstPostNonTerminal=Vm;this.cstPostRule=Vm}else{if(/full/i.test(this.nodeLocationTracking)){if(this.recoveryEnabled){this.setNodeLocationFromToken=qnt;this.setNodeLocationFromNode=qnt;this.cstPostRule=Vm;this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery}else{this.setNodeLocationFromToken=Vm;this.setNodeLocationFromNode=Vm;this.cstPostRule=this.cstPostRuleFull;this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular}}else if(/onlyOffset/i.test(this.nodeLocationTracking)){if(this.recoveryEnabled){this.setNodeLocationFromToken=Ynt;this.setNodeLocationFromNode=Ynt;this.cstPostRule=Vm;this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery}else{this.setNodeLocationFromToken=Vm;this.setNodeLocationFromNode=Vm;this.cstPostRule=this.cstPostRuleOnlyOffset;this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular}}else if(/none/i.test(this.nodeLocationTracking)){this.setNodeLocationFromToken=Vm;this.setNodeLocationFromNode=Vm;this.cstPostRule=Vm;this.setInitialNodeLocation=Vm}else{throw Error(`Invalid config option: "${e.nodeLocationTracking}"`)}}}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t);this.CST_STACK.push(t)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const t=this.LA(0);const n=e.location;if(n.startOffset<=t.startOffset===true){n.endOffset=t.endOffset;n.endLine=t.endLine;n.endColumn=t.endColumn}else{n.startOffset=NaN;n.startLine=NaN;n.startColumn=NaN}}cstPostRuleOnlyOffset(e){const t=this.LA(0);const n=e.location;if(n.startOffset<=t.startOffset===true){n.endOffset=t.endOffset}else{n.startOffset=NaN}}cstPostTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];u3n(n,t,e);this.setNodeLocationFromToken(n.location,t)}cstPostNonTerminal(e,t){const n=this.CST_STACK[this.CST_STACK.length-1];d3n(n,t,e);this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(JR(this.baseCstVisitorConstructor)){const e=h3n(this.className,dv(this.gastProductionsCache));this.baseCstVisitorConstructor=e;return e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(JR(this.baseCstVisitorWithDefaultsConstructor)){const e=p3n(this.className,dv(this.gastProductionsCache),this.getBaseCstVisitorConstructor());this.baseCstVisitorWithDefaultsConstructor=e;return e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){const e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}};dOi=class{static{ee(this,"LexerAdapter")}initLexerAdapter(){this.tokVector=[];this.tokVectorLength=0;this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==true){throw Error(`Missing invocation at the end of the Parser's constructor.`)}this.reset();this.tokVector=e;this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){if(this.currIdx<=this.tokVector.length-2){this.consumeToken();return this.LA(1)}else{return _ke}}LA(e){const t=this.currIdx+e;if(t<0||this.tokVectorLength<=t){return _ke}else{return this.tokVector[t]}}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}};fOi=class{static{ee(this,"RecognizerApi")}ACTION(e){return e.call(this)}consume(e,t,n){return this.consumeInternal(t,e,n)}subrule(e,t,n){return this.subruleInternal(t,e,n)}option(e,t){return this.optionInternal(t,e)}or(e,t){return this.orInternal(t,e)}many(e,t){return this.manyInternal(e,t)}atLeastOne(e,t){return this.atLeastOneInternal(e,t)}CONSUME(e,t){return this.consumeInternal(e,0,t)}CONSUME1(e,t){return this.consumeInternal(e,1,t)}CONSUME2(e,t){return this.consumeInternal(e,2,t)}CONSUME3(e,t){return this.consumeInternal(e,3,t)}CONSUME4(e,t){return this.consumeInternal(e,4,t)}CONSUME5(e,t){return this.consumeInternal(e,5,t)}CONSUME6(e,t){return this.consumeInternal(e,6,t)}CONSUME7(e,t){return this.consumeInternal(e,7,t)}CONSUME8(e,t){return this.consumeInternal(e,8,t)}CONSUME9(e,t){return this.consumeInternal(e,9,t)}SUBRULE(e,t){return this.subruleInternal(e,0,t)}SUBRULE1(e,t){return this.subruleInternal(e,1,t)}SUBRULE2(e,t){return this.subruleInternal(e,2,t)}SUBRULE3(e,t){return this.subruleInternal(e,3,t)}SUBRULE4(e,t){return this.subruleInternal(e,4,t)}SUBRULE5(e,t){return this.subruleInternal(e,5,t)}SUBRULE6(e,t){return this.subruleInternal(e,6,t)}SUBRULE7(e,t){return this.subruleInternal(e,7,t)}SUBRULE8(e,t){return this.subruleInternal(e,8,t)}SUBRULE9(e,t){return this.subruleInternal(e,9,t)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,t,n=Tke){if(fb(this.definedRulesNames,e)){const i=s6.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className});const o={message:i,type:ub.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(o)}this.definedRulesNames.push(e);const r=this.defineRule(e,t,n);this[e]=r;return r}OVERRIDE_RULE(e,t,n=Tke){const r=GIn(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(r);const i=this.defineRule(e,t,n);this[e]=i;return i}BACKTRACK(e,t){return function(){this.isBackTrackingStack.push(1);const n=this.saveRecogState();try{e.apply(this,t);return true}catch(r){if(One(r)){return false}else{throw r}}finally{this.reloadRecogState(n);this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return zPn(Vp(this.gastProductionsCache))}};hOi=class{static{ee(this,"RecognizerEngine")}initRecognizerEngine(e,t){this.className=this.constructor.name;this.shortRuleNameToFull={};this.fullRuleNameToShort={};this.ruleShortNameIdx=256;this.tokenMatcher=Nne;this.subruleIdx=0;this.definedRulesNames=[];this.tokensMap={};this.isBackTrackingStack=[];this.RULE_STACK=[];this.RULE_OCCURRENCE_STACK=[];this.gastProductionsCache={};if(qa(t,"serializedGrammar")){throw Error("The Parser's configuration can no longer contain a property.\n See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n For Further details.")}if(gc(e)){if(ud(e)){throw Error("A Token Vocabulary cannot be empty.\n Note that the first argument for the parser constructor\n is no longer a Token vector (since v4.0).")}if(typeof e[0].startOffset==="number"){throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0\n For Further details.")}}if(gc(e)){this.tokensMap=hv(e,(i,o)=>{i[o.name]=o;return i},{})}else if(qa(e,"modes")&&Hw(Gw(Vp(e.modes)),AIn)){const i=Gw(Vp(e.modes));const o=Pot(i);this.tokensMap=hv(o,(a,s)=>{a[s.name]=s;return a},{})}else if(q_(e)){this.tokensMap=Ng(e)}else{throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition")}this.tokensMap["EOF"]=fD;const n=qa(e,"modes")?Gw(Vp(e.modes)):Vp(e);const r=Hw(n,i=>ud(i.categoryMatches));this.tokenMatcher=r?Nne:aH;sH(Vp(this.tokensMap))}defineRule(e,t,n){if(this.selfAnalysisDone){throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called' +Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`)}const r=qa(n,"resyncEnabled")?n.resyncEnabled:Tke.resyncEnabled;const i=qa(n,"recoveryValueFunc")?n.recoveryValueFunc:Tke.recoveryValueFunc;const o=this.ruleShortNameIdx<{return o.call(this)&&a.call(this)},"lookAheadFunc")}}else{i=e}if(r.call(this)===true){return i.call(this)}return void 0}atLeastOneInternal(e,t){const n=this.getKeyForAutomaticLookahead(Hnt,e);return this.atLeastOneInternalLogic(e,t,n)}atLeastOneInternalLogic(e,t,n){let r=this.getLaFuncFromCache(n);let i;if(typeof t!=="function"){i=t.DEF;const o=t.GATE;if(o!==void 0){const a=r;r=ee(()=>{return o.call(this)&&a.call(this)},"lookAheadFunc")}}else{i=t}if(r.call(this)===true){let o=this.doSingleRepetition(i);while(r.call(this)===true&&o===true){o=this.doSingleRepetition(i)}}else{throw this.raiseEarlyExitException(e,kf.REPETITION_MANDATORY,t.ERR_MSG)}this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],r,Hnt,e,KNi)}atLeastOneSepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead(IAe,e);this.atLeastOneSepFirstInternalLogic(e,t,n)}atLeastOneSepFirstInternalLogic(e,t,n){const r=t.DEF;const i=t.SEP;const o=this.getLaFuncFromCache(n);if(o.call(this)===true){r.call(this);const a=ee(()=>{return this.tokenMatcher(this.LA(1),i)},"separatorLookAheadFunc");while(this.tokenMatcher(this.LA(1),i)===true){this.CONSUME(i);r.call(this)}this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,a,r,YEn],a,IAe,e,YEn)}else{throw this.raiseEarlyExitException(e,kf.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG)}}manyInternal(e,t){const n=this.getKeyForAutomaticLookahead(Gnt,e);return this.manyInternalLogic(e,t,n)}manyInternalLogic(e,t,n){let r=this.getLaFuncFromCache(n);let i;if(typeof t!=="function"){i=t.DEF;const a=t.GATE;if(a!==void 0){const s=r;r=ee(()=>{return a.call(this)&&s.call(this)},"lookaheadFunction")}}else{i=t}let o=true;while(r.call(this)===true&&o===true){o=this.doSingleRepetition(i)}this.attemptInRepetitionRecovery(this.manyInternal,[e,t],r,Gnt,e,jNi,o)}manySepFirstInternal(e,t){const n=this.getKeyForAutomaticLookahead(Wnt,e);this.manySepFirstInternalLogic(e,t,n)}manySepFirstInternalLogic(e,t,n){const r=t.DEF;const i=t.SEP;const o=this.getLaFuncFromCache(n);if(o.call(this)===true){r.call(this);const a=ee(()=>{return this.tokenMatcher(this.LA(1),i)},"separatorLookAheadFunc");while(this.tokenMatcher(this.LA(1),i)===true){this.CONSUME(i);r.call(this)}this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,a,r,WEn],a,Wnt,e,WEn)}}repetitionSepSecondInternal(e,t,n,r,i){while(n()){this.CONSUME(t);r.call(this)}this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,n,r,i],n,IAe,e,i)}doSingleRepetition(e){const t=this.getLexerPosition();e.call(this);const n=this.getLexerPosition();return n>t}orInternal(e,t){const n=this.getKeyForAutomaticLookahead(s3n,t);const r=gc(e)?e:e.DEF;const i=this.getLaFuncFromCache(n);const o=i.call(this,r);if(o!==void 0){const a=r[o];return a.ALT.call(this)}this.raiseNoAltException(t,e.ERR_MSG)}ruleFinallyStateUpdate(){this.RULE_STACK.pop();this.RULE_OCCURRENCE_STACK.pop();this.cstFinallyStateUpdate();if(this.RULE_STACK.length===0&&this.isAtEndOfInput()===false){const e=this.LA(1);const t=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new tOi(t,e))}}subruleInternal(e,t,n){let r;try{const i=n!==void 0?n.ARGS:void 0;this.subruleIdx=t;r=e.apply(this,i);this.cstPostNonTerminal(r,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName);return r}catch(i){throw this.subruleInternalError(i,n,e.ruleName)}}subruleInternalError(e,t,n){if(One(e)&&e.partialCstResult!==void 0){this.cstPostNonTerminal(e.partialCstResult,t!==void 0&&t.LABEL!==void 0?t.LABEL:n);delete e.partialCstResult}throw e}consumeInternal(e,t,n){let r;try{const i=this.LA(1);if(this.tokenMatcher(i,e)===true){this.consumeToken();r=i}else{this.consumeInternalError(e,i,n)}}catch(i){r=this.consumeInternalRecovery(e,t,i)}this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,r);return r}consumeInternalError(e,t,n){let r;const i=this.LA(0);if(n!==void 0&&n.ERR_MSG){r=n.ERR_MSG}else{r=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:i,ruleName:this.getCurrRuleFullName()})}throw this.SAVE_ERROR(new i3n(r,t,i))}consumeInternalRecovery(e,t,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){const r=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,r)}catch(i){if(i.name===o3n){throw n}else{throw i}}}else{throw n}}saveRecogState(){const e=this.errors;const t=Ng(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors;this.importLexerState(e.lexerState);this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,t,n){this.RULE_OCCURRENCE_STACK.push(n);this.RULE_STACK.push(e);this.cstInvocationStateUpdate(t)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),fD)}reset(){this.resetLexerState();this.subruleIdx=0;this.isBackTrackingStack=[];this.errors=[];this.RULE_STACK=[];this.CST_STACK=[];this.RULE_OCCURRENCE_STACK=[]}};pOi=class{static{ee(this,"ErrorHandler")}initErrorHandler(e){this._errors=[];this.errorMessageProvider=qa(e,"errorMessageProvider")?e.errorMessageProvider:eP.errorMessageProvider}SAVE_ERROR(e){if(One(e)){e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:Ng(this.RULE_OCCURRENCE_STACK)};this._errors.push(e);return e}else{throw Error("Trying to save an Error which is not a RecognitionException")}}get errors(){return Ng(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,t,n){const r=this.getCurrRuleFullName();const i=this.getGAstProductions()[r];const o=ure(e,i,t,this.maxLookahead);const a=o[0];const s=[];for(let u=1;u<=this.maxLookahead;u++){s.push(this.LA(u))}const l=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:a,actual:s,previous:this.LA(0),customUserDescription:n,ruleName:r});throw this.SAVE_ERROR(new nOi(l,this.LA(1),this.LA(0)))}raiseNoAltException(e,t){const n=this.getCurrRuleFullName();const r=this.getGAstProductions()[n];const i=cre(e,r,this.maxLookahead);const o=[];for(let l=1;l<=this.maxLookahead;l++){o.push(this.LA(l))}const a=this.LA(0);const s=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:i,actual:o,previous:a,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new eOi(s,this.LA(1),a))}};mOi=class{static{ee(this,"ContentAssist")}initContentAssist(){}computeContentAssist(e,t){const n=this.gastProductionsCache[e];if(JR(n)){throw Error(`Rule ->${e}<- does not exist in this grammar.`)}return Vot([n],t,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const t=Yw(e.ruleStack);const n=this.getGAstProductions();const r=n[t];const i=new XNi(r,e).startWalking();return i}};xRe={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(xRe);qEn=true;XEn=Math.pow(2,bD)-1;y3n=VG({name:"RECORDING_PHASE_TOKEN",pattern:sb.NA});sH([y3n]);b3n=lre(y3n,"This IToken indicates the Parser is in Recording Phase\n See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",-1,-1,-1,-1,-1,-1);Object.freeze(b3n);gOi={name:"This CSTNode indicates the Parser is in Recording Phase\n See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",children:{}};yOi=class{static{ee(this,"GastRecorder")}initGastRecorder(e){this.recordingProdStack=[];this.RECORDING_PHASE=false}enableRecording(){this.RECORDING_PHASE=true;this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const t=e>0?e:"";this[`CONSUME${t}`]=function(n,r){return this.consumeInternalRecord(n,e,r)};this[`SUBRULE${t}`]=function(n,r){return this.subruleInternalRecord(n,e,r)};this[`OPTION${t}`]=function(n){return this.optionInternalRecord(n,e)};this[`OR${t}`]=function(n){return this.orInternalRecord(n,e)};this[`MANY${t}`]=function(n){this.manyInternalRecord(e,n)};this[`MANY_SEP${t}`]=function(n){this.manySepFirstInternalRecord(e,n)};this[`AT_LEAST_ONE${t}`]=function(n){this.atLeastOneInternalRecord(e,n)};this[`AT_LEAST_ONE_SEP${t}`]=function(n){this.atLeastOneSepFirstInternalRecord(e,n)}}this[`consume`]=function(e,t,n){return this.consumeInternalRecord(t,e,n)};this[`subrule`]=function(e,t,n){return this.subruleInternalRecord(t,e,n)};this[`option`]=function(e,t){return this.optionInternalRecord(t,e)};this[`or`]=function(e,t){return this.orInternalRecord(t,e)};this[`many`]=function(e,t){this.manyInternalRecord(e,t)};this[`atLeastOne`]=function(e,t){this.atLeastOneInternalRecord(e,t)};this.ACTION=this.ACTION_RECORD;this.BACKTRACK=this.BACKTRACK_RECORD;this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=false;this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let t=0;t<10;t++){const n=t>0?t:"";delete e[`CONSUME${n}`];delete e[`SUBRULE${n}`];delete e[`OPTION${n}`];delete e[`OR${n}`];delete e[`MANY${n}`];delete e[`MANY_SEP${n}`];delete e[`AT_LEAST_ONE${n}`];delete e[`AT_LEAST_ONE_SEP${n}`]}delete e[`consume`];delete e[`subrule`];delete e[`option`];delete e[`or`];delete e[`many`];delete e[`atLeastOne`];delete e.ACTION;delete e.BACKTRACK;delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,t){return()=>true}LA_RECORD(e){return _ke}topLevelRuleRecord(e,t){try{const n=new rH({definition:[],name:e});n.name=e;this.recordingProdStack.push(n);t.call(this);this.recordingProdStack.pop();return n}catch(n){if(n.KNOWN_RECORDER_ERROR!==true){try{n.message=n.message+'\n This error was thrown during the "grammar recording phase" For more info see:\n https://chevrotain.io/docs/guide/internals.html#grammar-recording'}catch(r){throw n}}throw n}}optionInternalRecord(e,t){return CG.call(this,Fg,e,t)}atLeastOneInternalRecord(e,t){CG.call(this,pv,t,e)}atLeastOneSepFirstInternalRecord(e,t){CG.call(this,mv,t,e,qEn)}manyInternalRecord(e,t){CG.call(this,Zf,t,e)}manySepFirstInternalRecord(e,t){CG.call(this,Px,t,e,qEn)}orInternalRecord(e,t){return x3n.call(this,e,t)}subruleInternalRecord(e,t,n){Bne(t);if(!e||qa(e,"ruleName")===false){const a=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}> + inside top level rule: <${this.recordingProdStack[0].name}>`);a.KNOWN_RECORDER_ERROR=true;throw a}const r=h6(this.recordingProdStack);const i=e.ruleName;const o=new cb({idx:t,nonTerminalName:i,label:n===null||n===void 0?void 0:n.LABEL,referencedRule:void 0});r.definition.push(o);return this.outputCst?gOi:xRe}consumeInternalRecord(e,t,n){Bne(t);if(!Bot(e)){const o=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}> + inside top level rule: <${this.recordingProdStack[0].name}>`);o.KNOWN_RECORDER_ERROR=true;throw o}const r=h6(this.recordingProdStack);const i=new Ud({idx:t,terminalType:e,label:n===null||n===void 0?void 0:n.LABEL});r.definition.push(i);return b3n}};ee(CG,"recordProd");ee(x3n,"recordOrProd");ee(jnt,"getIdxSuffix");ee(Bne,"assertMethodIdxIsValid");bOi=class{static{ee(this,"PerformanceTracer")}initPerformanceTracer(e){if(qa(e,"traceInitPerf")){const t=e.traceInitPerf;const n=typeof t==="number";this.traceInitMaxIdent=n?t:Infinity;this.traceInitPerf=n?t>0:t}else{this.traceInitMaxIdent=0;this.traceInitPerf=eP.traceInitPerf}this.traceInitIndent=-1}TRACE_INIT(e,t){if(this.traceInitPerf===true){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join(" ");if(this.traceInitIndent <${e}>`)}const{time:r,value:i}=Mot(t);const o=r>10?console.warn:console.log;if(this.traceInitIndent time: ${r}ms`)}this.traceInitIndent--;return i}else{return t()}}};ee(v3n,"applyMixins");_ke=lre(fD,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(_ke);eP=Object.freeze({recoveryEnabled:false,maxLookahead:3,dynamicTokensEnabled:false,outputCst:true,errorMessageProvider:NG,nodeLocationTracking:"none",traceInitPerf:false,skipValidations:false});Tke=Object.freeze({recoveryValueFunc:ee(()=>void 0,"recoveryValueFunc"),resyncEnabled:true});(function(e){e[e["INVALID_RULE_NAME"]=0]="INVALID_RULE_NAME";e[e["DUPLICATE_RULE_NAME"]=1]="DUPLICATE_RULE_NAME";e[e["INVALID_RULE_OVERRIDE"]=2]="INVALID_RULE_OVERRIDE";e[e["DUPLICATE_PRODUCTIONS"]=3]="DUPLICATE_PRODUCTIONS";e[e["UNRESOLVED_SUBRULE_REF"]=4]="UNRESOLVED_SUBRULE_REF";e[e["LEFT_RECURSION"]=5]="LEFT_RECURSION";e[e["NONE_LAST_EMPTY_ALT"]=6]="NONE_LAST_EMPTY_ALT";e[e["AMBIGUOUS_ALTS"]=7]="AMBIGUOUS_ALTS";e[e["CONFLICT_TOKENS_RULES_NAMESPACE"]=8]="CONFLICT_TOKENS_RULES_NAMESPACE";e[e["INVALID_TOKEN_NAME"]=9]="INVALID_TOKEN_NAME";e[e["NO_NON_EMPTY_LOOKAHEAD"]=10]="NO_NON_EMPTY_LOOKAHEAD";e[e["AMBIGUOUS_PREFIX_ALTS"]=11]="AMBIGUOUS_PREFIX_ALTS";e[e["TOO_MANY_ALTS"]=12]="TOO_MANY_ALTS";e[e["CUSTOM_LOOKAHEAD_VALIDATION"]=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(ub||(ub={}));ee(Knt,"EMPTY_ALT");jot=class _3n{static{ee(this,"Parser")}static performSelfAnalysis(t){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let t;this.selfAnalysisDone=true;const n=this.className;this.TRACE_INIT("toFastProps",()=>{Lot(this)});this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording();cs(this.definedRulesNames,i=>{const o=this[i];const a=o["originalGrammarAction"];let s;this.TRACE_INIT(`${i} Rule`,()=>{s=this.topLevelRuleRecord(i,a)});this.gastProductionsCache[i]=s})}finally{this.disableRecording()}});let r=[];this.TRACE_INIT("Grammar Resolving",()=>{r=ZIn({rules:Vp(this.gastProductionsCache)});this.definitionErrors=this.definitionErrors.concat(r)});this.TRACE_INIT("Grammar Validations",()=>{if(ud(r)&&this.skipValidations===false){const i=JIn({rules:Vp(this.gastProductionsCache),tokenTypes:Vp(this.tokensMap),errMsgProvider:s6,grammarName:n});const o=BIn({lookaheadStrategy:this.lookaheadStrategy,rules:Vp(this.gastProductionsCache),tokenTypes:Vp(this.tokensMap),grammarName:n});this.definitionErrors=this.definitionErrors.concat(i,o)}});if(ud(this.definitionErrors)){if(this.recoveryEnabled){this.TRACE_INIT("computeAllProdsFollows",()=>{const i=YPn(Vp(this.gastProductionsCache));this.resyncFollows=i})}this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,o;(o=(i=this.lookaheadStrategy).initialize)===null||o===void 0?void 0:o.call(i,{rules:Vp(this.gastProductionsCache)});this.preComputeLookaheadFunctions(Vp(this.gastProductionsCache))})}if(!_3n.DEFER_DEFINITION_ERRORS_HANDLING&&!ud(this.definitionErrors)){t=fa(this.definitionErrors,i=>i.message);throw new Error(`Parser Definition Errors detected: + ${t.join("\n-------------------------------\n")}`)}})}constructor(t,n){this.definitionErrors=[];this.selfAnalysisDone=false;const r=this;r.initErrorHandler(n);r.initLexerAdapter();r.initLooksAhead(n);r.initRecognizerEngine(t,n);r.initRecoverable(n);r.initTreeBuilder(n);r.initContentAssist();r.initGastRecorder(n);r.initPerformanceTracer(n);if(qa(n,"ignoredIssues")){throw new Error("The IParserConfig property has been deprecated.\n Please use the flag on the relevant DSL method instead.\n See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\n For further details.")}this.skipValidations=qa(n,"skipValidations")?n.skipValidations:eP.skipValidations}};jot.DEFER_DEFINITION_ERRORS_HANDLING=false;v3n(jot,[iOi,sOi,uOi,dOi,hOi,fOi,pOi,mOi,yOi,bOi]);xOi=class extends jot{static{ee(this,"EmbeddedActionsParser")}constructor(e,t=eP){const n=Ng(t);n.outputCst=false;super(e,n)}};ee(T3n,"arrayMap");w3n=T3n;ee(E3n,"listCacheClear");vOi=E3n;ee(C3n,"eq");S3n=C3n;ee(A3n,"assocIndexOf");vRe=A3n;_Oi=Array.prototype;TOi=_Oi.splice;ee(k3n,"listCacheDelete");wOi=k3n;ee(R3n,"listCacheGet");EOi=R3n;ee(P3n,"listCacheHas");COi=P3n;ee(I3n,"listCacheSet");SOi=I3n;ee(P6,"ListCache");P6.prototype.clear=vOi;P6.prototype["delete"]=wOi;P6.prototype.get=EOi;P6.prototype.has=COi;P6.prototype.set=SOi;_Re=P6;ee(M3n,"stackClear");AOi=M3n;ee(L3n,"stackDelete");kOi=L3n;ee(D3n,"stackGet");ROi=D3n;ee(F3n,"stackHas");POi=F3n;IOi=typeof global=="object"&&global&&global.Object===Object&&global;N3n=IOi;MOi=typeof self=="object"&&self&&self.Object===Object&&self;LOi=N3n||MOi||Function("return this")();oP=LOi;DOi=oP.Symbol;bS=DOi;O3n=Object.prototype;FOi=O3n.hasOwnProperty;NOi=O3n.toString;Hte=bS?bS.toStringTag:void 0;ee(B3n,"getRawTag");OOi=B3n;BOi=Object.prototype;zOi=BOi.toString;ee(z3n,"objectToString");UOi=z3n;VOi="[object Null]";$Oi="[object Undefined]";jEn=bS?bS.toStringTag:void 0;ee(U3n,"baseGetTag");lH=U3n;ee(V3n,"isObject");Kot=V3n;GOi="[object AsyncFunction]";HOi="[object Function]";WOi="[object GeneratorFunction]";YOi="[object Proxy]";ee($3n,"isFunction");G3n=$3n;qOi=oP["__core-js_shared__"];ftt=qOi;KEn=function(){var e=/[^.]+$/.exec(ftt&&ftt.keys&&ftt.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();ee(H3n,"isMasked");XOi=H3n;jOi=Function.prototype;KOi=jOi.toString;ee(W3n,"toSource");I6=W3n;ZOi=/[\\^$.*+?()[\]{}|]/g;JOi=/^\[object .+?Constructor\]$/;QOi=Function.prototype;e5i=Object.prototype;t5i=QOi.toString;n5i=e5i.hasOwnProperty;r5i=RegExp("^"+t5i.call(n5i).replace(ZOi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");ee(Y3n,"baseIsNative");i5i=Y3n;ee(q3n,"getValue");o5i=q3n;ee(X3n,"getNative");cH=X3n;a5i=cH(oP,"Map");zne=a5i;s5i=cH(Object,"create");Une=s5i;ee(j3n,"hashClear");l5i=j3n;ee(K3n,"hashDelete");c5i=K3n;u5i="__lodash_hash_undefined__";d5i=Object.prototype;f5i=d5i.hasOwnProperty;ee(Z3n,"hashGet");h5i=Z3n;p5i=Object.prototype;m5i=p5i.hasOwnProperty;ee(J3n,"hashHas");g5i=J3n;y5i="__lodash_hash_undefined__";ee(Q3n,"hashSet");b5i=Q3n;ee(M6,"Hash");M6.prototype.clear=l5i;M6.prototype["delete"]=c5i;M6.prototype.get=h5i;M6.prototype.has=g5i;M6.prototype.set=b5i;ZEn=M6;ee(eMn,"mapCacheClear");x5i=eMn;ee(tMn,"isKeyable");v5i=tMn;ee(nMn,"getMapData");TRe=nMn;ee(rMn,"mapCacheDelete");_5i=rMn;ee(iMn,"mapCacheGet");T5i=iMn;ee(oMn,"mapCacheHas");w5i=oMn;ee(aMn,"mapCacheSet");E5i=aMn;ee(L6,"MapCache");L6.prototype.clear=x5i;L6.prototype["delete"]=_5i;L6.prototype.get=T5i;L6.prototype.has=w5i;L6.prototype.set=E5i;wRe=L6;C5i=200;ee(sMn,"stackSet");S5i=sMn;ee(D6,"Stack");D6.prototype.clear=AOi;D6.prototype["delete"]=kOi;D6.prototype.get=ROi;D6.prototype.has=POi;D6.prototype.set=S5i;LAe=D6;A5i="__lodash_hash_undefined__";ee(lMn,"setCacheAdd");k5i=lMn;ee(cMn,"setCacheHas");R5i=cMn;ee(Vne,"SetCache");Vne.prototype.add=Vne.prototype.push=k5i;Vne.prototype.has=R5i;uMn=Vne;ee(dMn,"arraySome");P5i=dMn;ee(fMn,"cacheHas");hMn=fMn;I5i=1;M5i=2;ee(pMn,"equalArrays");mMn=pMn;L5i=oP.Uint8Array;JEn=L5i;ee(gMn,"mapToArray");D5i=gMn;ee(yMn,"setToArray");Zot=yMn;F5i=1;N5i=2;O5i="[object Boolean]";B5i="[object Date]";z5i="[object Error]";U5i="[object Map]";V5i="[object Number]";$5i="[object RegExp]";G5i="[object Set]";H5i="[object String]";W5i="[object Symbol]";Y5i="[object ArrayBuffer]";q5i="[object DataView]";QEn=bS?bS.prototype:void 0;htt=QEn?QEn.valueOf:void 0;ee(bMn,"equalByTag");X5i=bMn;ee(xMn,"arrayPush");vMn=xMn;j5i=Array.isArray;db=j5i;ee(_Mn,"baseGetAllKeys");K5i=_Mn;ee(TMn,"arrayFilter");wMn=TMn;ee(EMn,"stubArray");Z5i=EMn;J5i=Object.prototype;Q5i=J5i.propertyIsEnumerable;eCn=Object.getOwnPropertySymbols;eBi=!eCn?Z5i:function(e){if(e==null){return[]}e=Object(e);return wMn(eCn(e),function(t){return Q5i.call(e,t)})};tBi=eBi;ee(CMn,"baseTimes");nBi=CMn;ee(SMn,"isObjectLike");JG=SMn;rBi="[object Arguments]";ee(AMn,"baseIsArguments");tCn=AMn;kMn=Object.prototype;iBi=kMn.hasOwnProperty;oBi=kMn.propertyIsEnumerable;aBi=tCn(function(){return arguments}())?tCn:function(e){return JG(e)&&iBi.call(e,"callee")&&!oBi.call(e,"callee")};ERe=aBi;ee(RMn,"stubFalse");sBi=RMn;PMn=typeof exports=="object"&&exports&&!exports.nodeType&&exports;nCn=PMn&&typeof module=="object"&&module&&!module.nodeType&&module;lBi=nCn&&nCn.exports===PMn;rCn=lBi?oP.Buffer:void 0;cBi=rCn?rCn.isBuffer:void 0;uBi=cBi||sBi;wke=uBi;dBi=9007199254740991;fBi=/^(?:0|[1-9]\d*)$/;ee(IMn,"isIndex");MMn=IMn;hBi=9007199254740991;ee(LMn,"isLength");Jot=LMn;pBi="[object Arguments]";mBi="[object Array]";gBi="[object Boolean]";yBi="[object Date]";bBi="[object Error]";xBi="[object Function]";vBi="[object Map]";_Bi="[object Number]";TBi="[object Object]";wBi="[object RegExp]";EBi="[object Set]";CBi="[object String]";SBi="[object WeakMap]";ABi="[object ArrayBuffer]";kBi="[object DataView]";RBi="[object Float32Array]";PBi="[object Float64Array]";IBi="[object Int8Array]";MBi="[object Int16Array]";LBi="[object Int32Array]";DBi="[object Uint8Array]";FBi="[object Uint8ClampedArray]";NBi="[object Uint16Array]";OBi="[object Uint32Array]";zd={};zd[RBi]=zd[PBi]=zd[IBi]=zd[MBi]=zd[LBi]=zd[DBi]=zd[FBi]=zd[NBi]=zd[OBi]=true;zd[pBi]=zd[mBi]=zd[ABi]=zd[gBi]=zd[kBi]=zd[yBi]=zd[bBi]=zd[xBi]=zd[vBi]=zd[_Bi]=zd[TBi]=zd[wBi]=zd[EBi]=zd[CBi]=zd[SBi]=false;ee(DMn,"baseIsTypedArray");BBi=DMn;ee(FMn,"baseUnary");zBi=FMn;NMn=typeof exports=="object"&&exports&&!exports.nodeType&&exports;Tne=NMn&&typeof module=="object"&&module&&!module.nodeType&&module;UBi=Tne&&Tne.exports===NMn;ptt=UBi&&N3n.process;VBi=function(){try{var e=Tne&&Tne.require&&Tne.require("util").types;if(e){return e}return ptt&&ptt.binding&&ptt.binding("util")}catch(t){}}();iCn=VBi;oCn=iCn&&iCn.isTypedArray;$Bi=oCn?zBi(oCn):BBi;Qot=$Bi;GBi=Object.prototype;HBi=GBi.hasOwnProperty;ee(OMn,"arrayLikeKeys");WBi=OMn;YBi=Object.prototype;ee(BMn,"isPrototype");zMn=BMn;ee(UMn,"overArg");qBi=UMn;XBi=qBi(Object.keys,Object);jBi=XBi;KBi=Object.prototype;ZBi=KBi.hasOwnProperty;ee(VMn,"baseKeys");$Mn=VMn;ee(GMn,"isArrayLike");CRe=GMn;ee(HMn,"keys");eat=HMn;ee(WMn,"getAllKeys");aCn=WMn;JBi=1;QBi=Object.prototype;e6i=QBi.hasOwnProperty;ee(YMn,"equalObjects");t6i=YMn;n6i=cH(oP,"DataView");Znt=n6i;r6i=cH(oP,"Promise");Jnt=r6i;i6i=cH(oP,"Set");$G=i6i;o6i=cH(oP,"WeakMap");Qnt=o6i;sCn="[object Map]";a6i="[object Object]";lCn="[object Promise]";cCn="[object Set]";uCn="[object WeakMap]";dCn="[object DataView]";s6i=I6(Znt);l6i=I6(zne);c6i=I6(Jnt);u6i=I6($G);d6i=I6(Qnt);LB=lH;if(Znt&&LB(new Znt(new ArrayBuffer(1)))!=dCn||zne&&LB(new zne)!=sCn||Jnt&&LB(Jnt.resolve())!=lCn||$G&&LB(new $G)!=cCn||Qnt&&LB(new Qnt)!=uCn){LB=ee(function(e){var t=lH(e),n=t==a6i?e.constructor:void 0,r=n?I6(n):"";if(r){switch(r){case s6i:return dCn;case l6i:return sCn;case c6i:return lCn;case u6i:return cCn;case d6i:return uCn}}return t},"getTag")}ert=LB;f6i=1;fCn="[object Arguments]";hCn="[object Array]";rAe="[object Object]";h6i=Object.prototype;pCn=h6i.hasOwnProperty;ee(qMn,"baseIsEqualDeep");p6i=qMn;ee(tat,"baseIsEqual");XMn=tat;m6i=1;g6i=2;ee(jMn,"baseIsMatch");y6i=jMn;ee(KMn,"isStrictComparable");ZMn=KMn;ee(JMn,"getMatchData");b6i=JMn;ee(QMn,"matchesStrictComparable");eLn=QMn;ee(tLn,"baseMatches");x6i=tLn;v6i="[object Symbol]";ee(nLn,"isSymbol");SRe=nLn;_6i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;T6i=/^\w*$/;ee(rLn,"isKey");nat=rLn;w6i="Expected a function";ee(ARe,"memoize");ARe.Cache=wRe;E6i=ARe;C6i=500;ee(iLn,"memoizeCapped");S6i=iLn;A6i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;k6i=/\\(\\)?/g;R6i=S6i(function(e){var t=[];if(e.charCodeAt(0)===46){t.push("")}e.replace(A6i,function(n,r,i,o){t.push(i?o.replace(k6i,"$1"):r||n)});return t});P6i=R6i;I6i=1/0;mCn=bS?bS.prototype:void 0;gCn=mCn?mCn.toString:void 0;ee(rat,"baseToString");M6i=rat;ee(oLn,"toString");L6i=oLn;ee(aLn,"castPath");sLn=aLn;D6i=1/0;ee(lLn,"toKey");kRe=lLn;ee(cLn,"baseGet");uLn=cLn;ee(dLn,"get");F6i=dLn;ee(fLn,"baseHasIn");N6i=fLn;ee(hLn,"hasPath");O6i=hLn;ee(pLn,"hasIn");B6i=pLn;z6i=1;U6i=2;ee(mLn,"baseMatchesProperty");V6i=mLn;ee(gLn,"identity");iat=gLn;ee(yLn,"baseProperty");$6i=yLn;ee(bLn,"basePropertyDeep");G6i=bLn;ee(xLn,"property");H6i=xLn;ee(vLn,"baseIteratee");RRe=vLn;ee(_Ln,"createBaseFor");W6i=_Ln;Y6i=W6i();q6i=Y6i;ee(TLn,"baseForOwn");X6i=TLn;ee(wLn,"createBaseEach");j6i=wLn;K6i=j6i(X6i);PRe=K6i;ee(ELn,"baseMap");Z6i=ELn;ee(CLn,"map");YR=CLn;ee(SLn,"baseFilter");J6i=SLn;ee(ALn,"filter");Q6i=ALn;ee(m6,"buildATNKey");hD=1;e8i=2;kLn=4;RLn=5;dre=7;t8i=8;n8i=9;r8i=10;i8i=11;PLn=12;oat=class{static{ee(this,"AbstractTransition")}constructor(e){this.target=e}isEpsilon(){return false}};aat=class extends oat{static{ee(this,"AtomTransition")}constructor(e,t){super(e);this.tokenType=t}};ILn=class extends oat{static{ee(this,"EpsilonTransition")}constructor(e){super(e)}isEpsilon(){return true}};sat=class extends oat{static{ee(this,"RuleTransition")}constructor(e,t,n){super(e);this.rule=t;this.followState=n}isEpsilon(){return true}};ee(MLn,"createATN");ee(LLn,"createRuleStartAndStopATNStates");ee(lat,"atom");ee(DLn,"repetition");ee(FLn,"repetitionSep");ee(NLn,"repetitionMandatory");ee(OLn,"repetitionMandatorySep");ee(BLn,"alternation");ee(zLn,"option");ee(xD,"block");ee(cat,"plus");ee(uat,"star");ee(ULn,"optional");ee(aP,"defineDecisionState");ee(F6,"makeAlts");ee(VLn,"getProdType");ee($Ln,"makeBlock");ee(IRe,"tokenRef");ee(GLn,"ruleRef");ee(HLn,"buildRuleHandle");ee(xh,"epsilon");ee($p,"newState");ee(MRe,"addTransition");ee(WLn,"removeState");Eke={};trt=class{static{ee(this,"ATNConfigSet")}constructor(){this.map={};this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){const t=dat(e);if(!(t in this.map)){this.map[t]=this.configs.length;this.configs.push(e)}}get elements(){return this.configs}get alts(){return YR(this.configs,e=>e.alt)}get key(){let e="";for(const t in this.map){e+=t+":"}return e}};ee(dat,"getATNConfigKey");ee(YLn,"baseExtremum");o8i=YLn;ee(qLn,"baseLt");a8i=qLn;ee(XLn,"min");s8i=XLn;yCn=bS?bS.isConcatSpreadable:void 0;ee(jLn,"isFlattenable");l8i=jLn;ee(fat,"baseFlatten");KLn=fat;ee(ZLn,"flatMap");c8i=ZLn;ee(JLn,"baseFindIndex");u8i=JLn;ee(QLn,"baseIsNaN");d8i=QLn;ee(eDn,"strictIndexOf");f8i=eDn;ee(tDn,"baseIndexOf");h8i=tDn;ee(nDn,"arrayIncludes");p8i=nDn;ee(rDn,"arrayIncludesWith");m8i=rDn;ee(iDn,"noop");g8i=iDn;y8i=1/0;b8i=!($G&&1/Zot(new $G([,-0]))[1]==y8i)?g8i:function(e){return new $G(e)};x8i=b8i;v8i=200;ee(oDn,"baseUniq");_8i=oDn;ee(aDn,"uniqBy");T8i=aDn;ee(sDn,"flatten");w8i=sDn;ee(lDn,"arrayEach");E8i=lDn;ee(cDn,"castFunction");C8i=cDn;ee(uDn,"forEach");mtt=uDn;S8i="[object Map]";A8i="[object Set]";k8i=Object.prototype;R8i=k8i.hasOwnProperty;ee(dDn,"isEmpty");P8i=dDn;ee(fDn,"arrayReduce");I8i=fDn;ee(hDn,"baseReduce");M8i=hDn;ee(pDn,"reduce");bCn=pDn;ee(mDn,"createDFACache");gDn=class{static{ee(this,"PredicateSet")}constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,t){this.predicates[e]=t}toString(){let e="";const t=this.predicates.length;for(let n=0;nconsole.log(n)}initialize(e){this.atn=MLn(e.rules);this.dfas=yDn(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:t,rule:n,hasPredicates:r,dynamicTokensEnabled:i}=e;const o=this.dfas;const a=this.logging;const s=m6(n,"Alternation",t);const l=this.atn.decisionMap[s];const u=l.decision;const d=YR(Vnt({maxLookahead:1,occurrence:t,prodType:"Alternation",rule:n}),f=>YR(f,h=>h[0]));if(nrt(d,false)&&!i){const f=bCn(d,(h,m,g)=>{mtt(m,x=>{if(x){h[x.tokenTypeIdx]=g;mtt(x.categoryMatches,w=>{h[w]=g})}});return h},{});if(r){return function(h){var m;const g=this.LA(1);const x=f[g.tokenTypeIdx];if(h!==void 0&&x!==void 0){const w=(m=h[x])===null||m===void 0?void 0:m.GATE;if(w!==void 0&&w.call(this)===false){return void 0}}return x}}else{return function(){const h=this.LA(1);return f[h.tokenTypeIdx]}}}else if(r){return function(f){const h=new gDn;const m=f===void 0?0:f.length;for(let x=0;x{return YR(f,h=>h[0])});if(nrt(d)&&d[0][0]&&!i){const f=d[0];const h=w8i(f);if(h.length===1&&P8i(h[0].categoryMatches)){const m=h[0];const g=m.tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===g}}else{const m=bCn(h,(g,x)=>{if(x!==void 0){g[x.tokenTypeIdx]=true;mtt(x.categoryMatches,w=>{g[w]=true})}return g},{});return function(){const g=this.LA(1);return m[g.tokenTypeIdx]===true}}}return function(){const f=DAe.call(this,o,u,xCn,a);return typeof f==="object"?false:f===0}}};ee(nrt,"isLL1Sequence");ee(yDn,"initATNSimulator");ee(DAe,"adaptivePredict");ee(bDn,"performLookahead");ee(xDn,"computeLookaheadTarget");ee(vDn,"reportLookaheadAmbiguity");ee(_Dn,"buildAmbiguityError");ee(TDn,"getProductionDslName");ee(wDn,"buildAdaptivePredictError");ee(EDn,"getExistingTargetState");ee(CDn,"computeReachSet");ee(SDn,"getReachableTarget");ee(ADn,"getUniqueAlt");ee(hat,"newDFAState");ee(rrt,"addDFAEdge");ee(pat,"addDFAState");ee(kDn,"computeStartState");ee($ne,"closure");ee(RDn,"getEpsilonTarget");ee(PDn,"hasConfigInRuleStopState");ee(IDn,"allConfigsInRuleStopStates");ee(MDn,"hasConflictTerminatingPrediction");ee(LDn,"getConflictingAltSets");ee(DDn,"hasConflictingAltSet");ee(FDn,"hasStateAssociatedWithOneAlt");Wne();NDn=class{static{ee(this,"CstNodeBuilder")}constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){this.rootNode=new gat(e);this.rootNode.root=this.rootNode;this.nodeStack=[this.rootNode];return this.rootNode}buildCompositeNode(e){const t=new LRe;t.grammarSource=e;t.root=this.rootNode;this.current.content.push(t);this.nodeStack.push(t);return t}buildLeafNode(e,t){const n=new Cke(e.startOffset,e.image.length,Rne(e),e.tokenType,!t);n.grammarSource=t;n.root=this.rootNode;this.current.content.push(n);return n}removeNode(e){const t=e.container;if(t){const n=t.content.indexOf(e);if(n>=0){t.content.splice(n,1)}}}addHiddenNodes(e){const t=[];for(const i of e){const o=new Cke(i.startOffset,i.image.length,Rne(i),i.tokenType,true);o.root=this.rootNode;t.push(o)}let n=this.current;let r=false;if(n.content.length>0){n.content.push(...t);return}while(n.container){const i=n.container.content.indexOf(n);if(i>0){n.container.content.splice(i,0,...t);r=true;break}n=n.container}if(!r){this.rootNode.content.unshift(...t)}}construct(e){const t=this.current;if(typeof e.$type==="string"&&!e.$infix){this.current.astNode=e}e.$cstNode=t;const n=this.nodeStack.pop();if(n?.content.length===0){this.removeNode(n)}}};mat=class{static{ee(this,"AbstractCstNode")}get hidden(){return false}get astNode(){const e=typeof this._astNode?.$type==="string"?this._astNode:this.container?.astNode;if(!e){throw new Error("This node has no associated AST element")}return e}set astNode(e){this._astNode=e}get text(){return this.root.fullText.substring(this.offset,this.end)}};Cke=class extends mat{static{ee(this,"LeafCstNodeImpl")}get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,t,n,r,i=false){super();this._hidden=i;this._offset=e;this._tokenType=r;this._length=t;this._range=n}};LRe=class extends mat{static{ee(this,"CompositeCstNodeImpl")}constructor(){super(...arguments);this.content=new D8i(this)}get offset(){return this.firstNonHiddenNode?.offset??0}get length(){return this.end-this.offset}get end(){return this.lastNonHiddenNode?.end??0}get range(){const e=this.firstNonHiddenNode;const t=this.lastNonHiddenNode;if(e&&t){if(this._rangeCache===void 0){const{range:n}=e;const{range:r}=t;this._rangeCache={start:n.start,end:r.end.line=0;e--){const t=this.content[e];if(!t.hidden){return t}}return this.content[this.content.length-1]}};D8i=class ODn extends Array{static{ee(this,"CstNodeContainer")}constructor(t){super();this.parent=t;Object.setPrototypeOf(this,ODn.prototype)}push(...t){this.addParents(t);return super.push(...t)}unshift(...t){this.addParents(t);return super.unshift(...t)}splice(t,n,...r){this.addParents(r);return super.splice(t,n,...r)}addParents(t){for(const n of t){n.container=this.parent}}};gat=class extends LRe{static{ee(this,"RootCstNodeImpl")}get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super();this._text="";this._text=e??""}};Ske=Symbol("Datatype");ee(FAe,"isDataTypeNode");vCn="\u200B";BDn=ee(e=>e.endsWith(vCn)?e:e+vCn,"withRuleSuffix");yat=class{static{ee(this,"AbstractLangiumParser")}constructor(e){this._unorderedGroups=new Map;this.allRules=new Map;this.lexer=e.parser.Lexer;const t=this.lexer.definition;const n=e.LanguageMetaData.mode==="production";if(e.shared.profilers.LangiumProfiler?.isActive("parsing")){this.wrapper=new N8i(t,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId))}else{this.wrapper=new $Dn(t,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider})}}alternatives(e,t){this.wrapper.wrapOr(e,t)}optional(e,t){this.wrapper.wrapOption(e,t)}many(e,t){this.wrapper.wrapMany(e,t)}atLeastOne(e,t){this.wrapper.wrapAtLeastOne(e,t)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}};zDn=class extends yat{static{ee(this,"LangiumParser")}get current(){return this.stack[this.stack.length-1]}constructor(e){super(e);this.nodeBuilder=new NDn;this.stack=[];this.assignmentMap=new Map;this.operatorPrecedence=new Map;this.linker=e.references.Linker;this.converter=e.parser.ValueConverter;this.astReflection=e.shared.AstReflection}rule(e,t){const n=this.computeRuleType(e);let r=void 0;if(qG(e)){r=e.name;this.registerPrecedenceMap(e)}const i=this.wrapper.DEFINE_RULE(BDn(e.name),this.startImplementation(n,r,t).bind(this));this.allRules.set(e.name,i);if(lb(e)&&e.entry){this.mainRule=i}return i}registerPrecedenceMap(e){const t=e.name;const n=new Map;for(let r=0;r0){t=this.construct()}if(t===void 0){throw new Error("No result from parser")}else if(this.stack.length>0){throw new Error("Parser stack is not empty after parsing")}return t}startImplementation(e,t,n){return r=>{const i=!this.isRecording()&&e!==void 0;if(i){const o={$type:e};this.stack.push(o);if(e===Ske){o.value=""}else if(t!==void 0){o.$infixName=t}}n(r);return i?this.construct():void 0}}extractHiddenTokens(e){const t=this.lexerResult.hidden;if(!t.length){return[]}const n=e.startOffset;for(let r=0;rn){return t.splice(0,r)}}return t.splice(0,t.length)}consume(e,t,n){const r=this.wrapper.wrapConsume(e,t);if(!this.isRecording()&&this.isValidToken(r)){const i=this.extractHiddenTokens(r);this.nodeBuilder.addHiddenNodes(i);const o=this.nodeBuilder.buildLeafNode(r,n);const{assignment:a,crossRef:s}=this.getAssignment(n);const l=this.current;if(a){const u=jR(n)?r.image:this.converter.convert(r.image,o);this.assign(a.operator,a.feature,u,o,s)}else if(FAe(l)){let u=r.image;if(!jR(n)){u=this.converter.convert(u,o).toString()}l.value+=u}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset==="number"&&!isNaN(e.endOffset)}subrule(e,t,n,r,i){let o;if(!this.isRecording()&&!n){o=this.nodeBuilder.buildCompositeNode(r)}let a;try{a=this.wrapper.wrapSubrule(e,t,i)}finally{if(!this.isRecording()){if(a===void 0&&!n){a=this.construct()}if(a!==void 0&&o&&o.length>0){this.performSubruleAssignment(a,r,o)}}}}performSubruleAssignment(e,t,n){const{assignment:r,crossRef:i}=this.getAssignment(t);if(r){this.assign(r.operator,r.feature,e,n,i)}else if(!r){const o=this.current;if(FAe(o)){o.value+=e.toString()}else if(typeof e==="object"&&e){const a=this.assignWithoutOverride(e,o);const s=a;this.stack.pop();this.stack.push(s)}}}action(e,t){if(!this.isRecording()){let n=this.current;if(t.feature&&t.operator){n=this.construct();this.nodeBuilder.removeNode(n.$cstNode);const r=this.nodeBuilder.buildCompositeNode(t);r.content.push(n.$cstNode);const i={$type:e};this.stack.push(i);this.assign(t.operator,t.feature,n,n.$cstNode)}else{n.$type=e}}}construct(){if(this.isRecording()){return void 0}const e=this.stack.pop();this.nodeBuilder.construct(e);if("$infixName"in e){return this.constructInfix(e,this.operatorPrecedence.get(e.$infixName))}else if(FAe(e)){return this.converter.convert(e.value,e.$cstNode)}else{mit(this.astReflection,e)}return e}constructInfix(e,t){const n=e.parts;if(!Array.isArray(n)||n.length===0){return void 0}const r=e.operators;if(!Array.isArray(r)||n.length<2){return n[0]}let i=0;let o=-1;for(let g=0;go){o=w.precedence;i=g}else if(w.precedence===o){if(!w.rightAssoc){i=g}}}const a=r.slice(0,i);const s=r.slice(i+1);const l=n.slice(0,i+1);const u=n.slice(i+1);const d={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:l,operators:a};const f={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:u,operators:s};const h=this.constructInfix(d,t);const m=this.constructInfix(f,t);return{$type:e.$type,$cstNode:e.$cstNode,left:h,operator:r[i],right:m}}getAssignment(e){if(!this.assignmentMap.has(e)){const t=b6(e,XR);this.assignmentMap.set(e,{assignment:t,crossRef:t&&v6(t.terminal)?t.terminal.isMulti?"multi":"single":void 0})}return this.assignmentMap.get(e)}assign(e,t,n,r,i){const o=this.current;let a;if(i==="single"&&typeof n==="string"){a=this.linker.buildReference(o,t,r,n)}else if(i==="multi"&&typeof n==="string"){a=this.linker.buildMultiReference(o,t,r,n)}else{a=n}switch(e){case"=":{o[t]=a;break}case"?=":{o[t]=true;break}case"+=":{if(!Array.isArray(o[t])){o[t]=[]}o[t].push(a)}}}assignWithoutOverride(e,t){for(const[r,i]of Object.entries(t)){const o=e[r];if(o===void 0){e[r]=i}else if(Array.isArray(o)&&Array.isArray(i)){i.push(...o);e[r]=i}}const n=e.$cstNode;if(n){n.astNode=void 0;e.$cstNode=void 0}return e}get definitionErrors(){return this.wrapper.definitionErrors}};UDn=class{static{ee(this,"AbstractParserErrorMessageProvider")}buildMismatchTokenMessage(e){return NG.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return NG.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return NG.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return NG.buildEarlyExitMessage(e)}};bat=class extends UDn{static{ee(this,"LangiumParserErrorMessageProvider")}buildMismatchTokenMessage({expected:e,actual:t}){const n=e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`;return`Expecting ${n} but found \`${t.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}};VDn=class extends yat{static{ee(this,"LangiumCompletionParser")}constructor(){super(...arguments);this.tokens=[];this.elementStack=[];this.lastElementStack=[];this.nextTokenIndex=0;this.stackSize=0}action(){}construct(){return void 0}parse(e){this.resetState();const t=this.lexer.tokenize(e,{mode:"partial"});this.tokens=t.tokens;this.wrapper.input=[...this.tokens];this.mainRule.call(this.wrapper,{});this.unorderedGroups.clear();return{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,t){const n=this.wrapper.DEFINE_RULE(BDn(e.name),this.startImplementation(t).bind(this));this.allRules.set(e.name,n);if(e.entry){this.mainRule=n}return n}resetState(){this.elementStack=[];this.lastElementStack=[];this.nextTokenIndex=0;this.stackSize=0}startImplementation(e){return t=>{const n=this.keepStackSize();try{e(t)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;this.stackSize=e;return e}resetStackSize(e){this.removeUnexpectedElements();this.stackSize=e}consume(e,t,n){this.wrapper.wrapConsume(e,t);if(!this.isRecording()){this.lastElementStack=[...this.elementStack,n];this.nextTokenIndex=this.currIdx+1}}subrule(e,t,n,r,i){this.before(r);this.wrapper.wrapSubrule(e,t,i);this.after(r)}before(e){if(!this.isRecording()){this.elementStack.push(e)}}after(e){if(!this.isRecording()){const t=this.elementStack.lastIndexOf(e);if(t>=0){this.elementStack.splice(t)}}}get currIdx(){return this.wrapper.currIdx}};F8i={recoveryEnabled:true,nodeLocationTracking:"full",skipValidations:true,errorMessageProvider:new bat};$Dn=class extends xOi{static{ee(this,"ChevrotainWrapper")}constructor(e,t){const n=t&&"maxLookahead"in t;super(e,{...F8i,lookaheadStrategy:n?new qot({maxLookahead:t.maxLookahead}):new L8i({logging:t.skipValidations?()=>{}:void 0}),...t})}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,t,n){return this.RULE(e,t,n)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,t){return this.consume(e,t,void 0)}wrapSubrule(e,t,n){return this.subrule(e,t,{ARGS:[n]})}wrapOr(e,t){this.or(e,t)}wrapOption(e,t){this.option(e,t)}wrapMany(e,t){this.many(e,t)}wrapAtLeastOne(e,t){this.atLeastOne(e,t)}rule(e){return e.call(this,{})}};N8i=class extends $Dn{static{ee(this,"ProfilerWrapper")}constructor(e,t,n){super(e,t);this.task=n}rule(e){this.task.start();this.task.startSubTask(this.ruleName(e));try{return super.rule(e)}finally{this.task.stopSubTask(this.ruleName(e));this.task.stop()}}ruleName(e){return e.ruleName}subrule(e,t,n){this.task.startSubTask(this.ruleName(t));try{return super.subrule(e,t,n)}finally{this.task.stopSubTask(this.ruleName(t))}}};ee(DRe,"createParser");ee(GDn,"buildRules");ee(HDn,"buildInfixRule");ee(pD,"buildElement");ee(WDn,"buildAction");ee(YDn,"buildRuleCall");ee(qDn,"buildRuleCallPredicate");ee(Uw,"buildPredicate");ee(XDn,"buildAlternatives");ee(jDn,"buildUnorderedGroup");ee(KDn,"buildGroup");ee(Gne,"getGuardCondition");ee(xat,"buildCrossReference");ee(ZDn,"buildKeyword");ee(vat,"wrap");ee(FRe,"getRule");ee(JDn,"getRuleName");ee(Ake,"getToken");ee(_at,"createCompletionParser");ee(Tat,"createLangiumParser");ee(wat,"prepareLangiumParser");NRe=class{static{ee(this,"DefaultTokenBuilder")}constructor(){this.diagnostics=[]}buildTokens(e,t){const n=gu(jke(e,false));const r=this.buildTerminalTokens(n);const i=this.buildKeywordTokens(n,r,t);i.push(...r);return i}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];this.diagnostics=[];return e}buildTerminalTokens(e){return e.filter(X_).filter(t=>!t.fragment).map(t=>this.buildTerminalToken(t)).toArray()}buildTerminalToken(e){const t=Zne(e);const n=this.requiresCustomPattern(t)?this.regexPatternFunction(t):t;const r={name:e.name,PATTERN:n};if(typeof n==="function"){r.LINE_BREAKS=true}if(e.hidden){r.GROUP=Xke(t)?sb.SKIPPED:"hidden"}return r}requiresCustomPattern(e){if(e.flags.includes("u")||e.flags.includes("s")){return true}else{return false}}regexPatternFunction(e){const t=new RegExp(e,e.flags+"y");return(n,r)=>{t.lastIndex=r;const i=t.exec(n);return i}}buildKeywordTokens(e,t,n){return e.filter(x6).flatMap(r=>rP(r).filter(jR)).distinct(r=>r.value).toArray().sort((r,i)=>i.value.length-r.value.length).map(r=>this.buildKeywordToken(r,t,Boolean(n?.caseInsensitive)))}buildKeywordToken(e,t,n){const r=this.buildKeywordPattern(e,n);const i={name:e.value,PATTERN:r,LONGER_ALT:this.findLongerAlt(e,t)};if(typeof r==="function"){i.LINE_BREAKS=true}return i}buildKeywordPattern(e,t){return t?new RegExp(nH(e.value),"i"):e.value}findLongerAlt(e,t){return t.reduce((n,r)=>{const i=r?.PATTERN;if(i?.source&&Xit("^"+i.source+"$",e.value)){n.push(r)}return n},[])}};Eat=class{static{ee(this,"DefaultValueConverter")}convert(e,t){let n=t.grammarSource;if(v6(n)){n=Qit(n)}if(KR(n)){const r=n.rule.ref;if(!r){throw new Error("This cst node was not parsed by a rule.")}return this.runConverter(r,e,t)}return e}runConverter(e,t,n){switch(e.name.toUpperCase()){case"INT":return fS.convertInt(t);case"STRING":return fS.convertString(t);case"ID":return fS.convertID(t)}switch(lot(e)?.toLowerCase()){case"number":return fS.convertNumber(t);case"boolean":return fS.convertBoolean(t);case"bigint":return fS.convertBigint(t);case"date":return fS.convertDate(t);default:return t}}};(function(e){function t(u){let d="";for(let f=1;f{this.resolve=n=>{e(n);return this};this.reject=n=>{t(n);return this}})}};_Cn=class irt{static{ee(this,"FullTextDocument")}constructor(t,n,r,i){this._uri=t;this._languageId=n;this._version=r;this._content=i;this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(t){if(t){const n=this.offsetAt(t.start);const r=this.offsetAt(t.end);return this._content.substring(n,r)}return this._content}update(t,n){for(const r of t){if(irt.isIncremental(r)){const i=Aat(r.range);const o=this.offsetAt(i.start);const a=this.offsetAt(i.end);this._content=this._content.substring(0,o)+r.text+this._content.substring(a,this._content.length);const s=Math.max(i.start.line,0);const l=Math.max(i.end.line,0);let u=this._lineOffsets;const d=ort(r.text,false,o);if(l-s===d.length){for(let h=0,m=d.length;ht){i=a}else{r=a+1}}const o=r-1;t=this.ensureBeforeEOL(t,n[o]);return{line:o,character:t-n[o]}}offsetAt(t){const n=this.getLineOffsets();if(t.line>=n.length){return this._content.length}else if(t.line<0){return 0}const r=n[t.line];if(t.character<=0){return r}const i=t.line+1n&&Sat(this._content.charCodeAt(t-1))){t--}return t}get lineCount(){return this.getLineOffsets().length}static isIncremental(t){const n=t;return n!==void 0&&n!==null&&typeof n.text==="string"&&n.range!==void 0&&(n.rangeLength===void 0||typeof n.rangeLength==="number")}static isFull(t){const n=t;return n!==void 0&&n!==null&&typeof n.text==="string"&&n.range===void 0&&n.rangeLength===void 0}};(function(e){function t(i,o,a,s){return new _Cn(i,o,a,s)}ee(t,"create");e.create=t;function n(i,o,a){if(i instanceof _Cn){i.update(o,a);return i}else{throw new Error("TextDocument.update: document must be created by TextDocument.create")}}ee(n,"update");e.update=n;function r(i,o){const a=i.getText();const s=Rke(o.map(eFn),(d,f)=>{const h=d.range.start.line-f.range.start.line;if(h===0){return d.range.start.character-f.range.start.character}return h});let l=0;const u=[];for(const d of s){const f=i.offsetAt(d.range.start);if(fl){u.push(a.substring(l,f))}if(d.newText.length){u.push(d.newText)}l=i.offsetAt(d.range.end)}u.push(a.substr(l));return u.join("")}ee(r,"applyEdits");e.applyEdits=r})(kke||(kke={}));ee(Rke,"mergeSort");ee(ort,"computeLineOffsets");ee(Sat,"isEOL");ee(Aat,"getWellformedRange");ee(eFn,"getWellformedEdit");(()=>{"use strict";var e={975:W=>{function H(X){if("string"!=typeof X)throw new TypeError("Path must be a string. Received "+JSON.stringify(X))}ee(H,"e");function $(X,j){for(var te,J="",oe=0,se=-1,re=0,ce=0;ce<=X.length;++ce){if(ce2){var ue=J.lastIndexOf("/");if(ue!==J.length-1){-1===ue?(J="",oe=0):oe=(J=J.slice(0,ue)).length-1-J.lastIndexOf("/"),se=ce,re=0;continue}}else if(2===J.length||1===J.length){J="",oe=0,se=ce,re=0;continue}}j&&(J.length>0?J+="/..":J="..",oe=2)}else J.length>0?J+="/"+X.slice(se+1,ce):J=X.slice(se+1,ce),oe=ce-se-1;se=ce,re=0}else 46===te&&-1!==re?++re:re=-1}return J}ee($,"r");var K={resolve:ee(function(){for(var X,j="",te=false,J=arguments.length-1;J>=-1&&!te;J--){var oe;J>=0?oe=arguments[J]:(void 0===X&&(X=process.cwd()),oe=X),H(oe),0!==oe.length&&(j=oe+"/"+j,te=47===oe.charCodeAt(0))}return j=$(j,!te),te?j.length>0?"/"+j:"/":j.length>0?j:"."},"resolve"),normalize:ee(function(X){if(H(X),0===X.length)return".";var j=47===X.charCodeAt(0),te=47===X.charCodeAt(X.length-1);return 0!==(X=$(X,!j)).length||j||(X="."),X.length>0&&te&&(X+="/"),j?"/"+X:X},"normalize"),isAbsolute:ee(function(X){return H(X),X.length>0&&47===X.charCodeAt(0)},"isAbsolute"),join:ee(function(){if(0===arguments.length)return".";for(var X,j=0;j0&&(void 0===X?X=te:X+="/"+te)}return void 0===X?".":K.normalize(X)},"join"),relative:ee(function(X,j){if(H(X),H(j),X===j)return"";if((X=K.resolve(X))===(j=K.resolve(j)))return"";for(var te=1;tece){if(47===j.charCodeAt(se+xe))return j.slice(se+xe+1);if(0===xe)return j.slice(se+xe)}else oe>ce&&(47===X.charCodeAt(te+xe)?ue=xe:0===xe&&(ue=0));break}var be=X.charCodeAt(te+xe);if(be!==j.charCodeAt(se+xe))break;47===be&&(ue=xe)}var Ie="";for(xe=te+ue+1;xe<=J;++xe)xe!==J&&47!==X.charCodeAt(xe)||(0===Ie.length?Ie+="..":Ie+="/..");return Ie.length>0?Ie+j.slice(se+ue):(se+=ue,47===j.charCodeAt(se)&&++se,j.slice(se))},"relative"),_makeLong:ee(function(X){return X},"_makeLong"),dirname:ee(function(X){if(H(X),0===X.length)return".";for(var j=X.charCodeAt(0),te=47===j,J=-1,oe=true,se=X.length-1;se>=1;--se)if(47===(j=X.charCodeAt(se))){if(!oe){J=se;break}}else oe=false;return-1===J?te?"/":".":te&&1===J?"//":X.slice(0,J)},"dirname"),basename:ee(function(X,j){if(void 0!==j&&"string"!=typeof j)throw new TypeError('"ext" argument must be a string');H(X);var te,J=0,oe=-1,se=true;if(void 0!==j&&j.length>0&&j.length<=X.length){if(j.length===X.length&&j===X)return"";var re=j.length-1,ce=-1;for(te=X.length-1;te>=0;--te){var ue=X.charCodeAt(te);if(47===ue){if(!se){J=te+1;break}}else-1===ce&&(se=false,ce=te+1),re>=0&&(ue===j.charCodeAt(re)?-1==--re&&(oe=te):(re=-1,oe=ce))}return J===oe?oe=ce:-1===oe&&(oe=X.length),X.slice(J,oe)}for(te=X.length-1;te>=0;--te)if(47===X.charCodeAt(te)){if(!se){J=te+1;break}}else-1===oe&&(se=false,oe=te+1);return-1===oe?"":X.slice(J,oe)},"basename"),extname:ee(function(X){H(X);for(var j=-1,te=0,J=-1,oe=true,se=0,re=X.length-1;re>=0;--re){var ce=X.charCodeAt(re);if(47!==ce)-1===J&&(oe=false,J=re+1),46===ce?-1===j?j=re:1!==se&&(se=1):-1!==j&&(se=-1);else if(!oe){te=re+1;break}}return-1===j||-1===J||0===se||1===se&&j===J-1&&j===te+1?"":X.slice(j,J)},"extname"),format:ee(function(X){if(null===X||"object"!=typeof X)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof X);return function(j,te){var J=te.dir||te.root,oe=te.base||(te.name||"")+(te.ext||"");return J?J===te.root?J+oe:J+"/"+oe:oe}(0,X)},"format"),parse:ee(function(X){H(X);var j={root:"",dir:"",base:"",ext:"",name:""};if(0===X.length)return j;var te,J=X.charCodeAt(0),oe=47===J;oe?(j.root="/",te=1):te=0;for(var se=-1,re=0,ce=-1,ue=true,xe=X.length-1,be=0;xe>=te;--xe)if(47!==(J=X.charCodeAt(xe)))-1===ce&&(ue=false,ce=xe+1),46===J?-1===se?se=xe:1!==be&&(be=1):-1!==se&&(be=-1);else if(!ue){re=xe+1;break}return-1===se||-1===ce||0===be||1===be&&se===ce-1&&se===re+1?-1!==ce&&(j.base=j.name=0===re&&oe?X.slice(1,ce):X.slice(re,ce)):(0===re&&oe?(j.name=X.slice(1,se),j.base=X.slice(1,ce)):(j.name=X.slice(re,se),j.base=X.slice(re,ce)),j.ext=X.slice(se,ce)),re>0?j.dir=X.slice(0,re-1):oe&&(j.dir="/"),j},"parse"),sep:"/",delimiter:":",win32:null,posix:null};K.posix=K,W.exports=K}},t={};function n(W){var H=t[W];if(void 0!==H)return H.exports;var $=t[W]={exports:{}};return e[W]($,$.exports,n),$.exports}ee(n,"r");n.d=(W,H)=>{for(var $ in H)n.o(H,$)&&!n.o(W,$)&&Object.defineProperty(W,$,{enumerable:true,get:H[$]})},n.o=(W,H)=>Object.prototype.hasOwnProperty.call(W,H),n.r=W=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(W,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(W,"__esModule",{value:true})};var r={};let i;if(n.r(r),n.d(r,{URI:ee(()=>h,"URI"),Utils:ee(()=>U,"Utils")}),"object"==typeof process)i="win32"===process.platform;else if("object"==typeof navigator){let W=navigator.userAgent;i=W.indexOf("Windows")>=0}const o=/^\w[\w\d+.-]*$/,a=/^\//,s=/^\/\//;function l(W,H){if(!W.scheme&&H)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${W.authority}", path: "${W.path}", query: "${W.query}", fragment: "${W.fragment}"}`);if(W.scheme&&!o.test(W.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(W.path){if(W.authority){if(!a.test(W.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(s.test(W.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}ee(l,"a");const u="",d="/",f=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class h{static{ee(this,"l")}static isUri(H){return H instanceof h||!!H&&"string"==typeof H.authority&&"string"==typeof H.fragment&&"string"==typeof H.path&&"string"==typeof H.query&&"string"==typeof H.scheme&&"string"==typeof H.fsPath&&"function"==typeof H.with&&"function"==typeof H.toString}scheme;authority;path;query;fragment;constructor(H,$,K,X,j,te=false){"object"==typeof H?(this.scheme=H.scheme||u,this.authority=H.authority||u,this.path=H.path||u,this.query=H.query||u,this.fragment=H.fragment||u):(this.scheme=function(J,oe){return J||oe?J:"file"}(H,te),this.authority=$||u,this.path=function(J,oe){switch(J){case"https":case"http":case"file":oe?oe[0]!==d&&(oe=d+oe):oe=d}return oe}(this.scheme,K||u),this.query=X||u,this.fragment=j||u,l(this,te))}get fsPath(){return C(this,false)}with(H){if(!H)return this;let{scheme:$,authority:K,path:X,query:j,fragment:te}=H;return void 0===$?$=this.scheme:null===$&&($=u),void 0===K?K=this.authority:null===K&&(K=u),void 0===X?X=this.path:null===X&&(X=u),void 0===j?j=this.query:null===j&&(j=u),void 0===te?te=this.fragment:null===te&&(te=u),$===this.scheme&&K===this.authority&&X===this.path&&j===this.query&&te===this.fragment?this:new g($,K,X,j,te)}static parse(H,$=false){const K=f.exec(H);return K?new g(K[2]||u,I(K[4]||u),I(K[5]||u),I(K[7]||u),I(K[9]||u),$):new g(u,u,u,u,u)}static file(H){let $=u;if(i&&(H=H.replace(/\\/g,d)),H[0]===d&&H[1]===d){const K=H.indexOf(d,2);-1===K?($=H.substring(2),H=d):($=H.substring(2,K),H=H.substring(K)||d)}return new g("file",$,H,u,u)}static from(H){const $=new g(H.scheme,H.authority,H.path,H.query,H.fragment);return l($,true),$}toString(H=false){return A(this,H)}toJSON(){return this}static revive(H){if(H){if(H instanceof h)return H;{const $=new g(H);return $._formatted=H.external,$._fsPath=H._sep===m?H.fsPath:null,$}}return H}}const m=i?1:void 0;class g extends h{static{ee(this,"d")}_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=C(this,false)),this._fsPath}toString(H=false){return H?A(this,true):(this._formatted||(this._formatted=A(this,false)),this._formatted)}toJSON(){const H={$mid:1};return this._fsPath&&(H.fsPath=this._fsPath,H._sep=m),this._formatted&&(H.external=this._formatted),this.path&&(H.path=this.path),this.scheme&&(H.scheme=this.scheme),this.authority&&(H.authority=this.authority),this.query&&(H.query=this.query),this.fragment&&(H.fragment=this.fragment),H}}const x={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function w(W,H,$){let K,X=-1;for(let j=0;j=97&&te<=122||te>=65&&te<=90||te>=48&&te<=57||45===te||46===te||95===te||126===te||H&&47===te||$&&91===te||$&&93===te||$&&58===te)-1!==X&&(K+=encodeURIComponent(W.substring(X,j)),X=-1),void 0!==K&&(K+=W.charAt(j));else{void 0===K&&(K=W.substr(0,j));const J=x[te];void 0!==J?(-1!==X&&(K+=encodeURIComponent(W.substring(X,j)),X=-1),K+=J):-1===X&&(X=j)}}return-1!==X&&(K+=encodeURIComponent(W.substring(X))),void 0!==K?K:W}ee(w,"m");function _(W){let H;for(let $=0;$1&&"file"===W.scheme?`//${W.authority}${W.path}`:47===W.path.charCodeAt(0)&&(W.path.charCodeAt(1)>=65&&W.path.charCodeAt(1)<=90||W.path.charCodeAt(1)>=97&&W.path.charCodeAt(1)<=122)&&58===W.path.charCodeAt(2)?H?W.path.substr(1):W.path[1].toLowerCase()+W.path.substr(2):W.path,i&&($=$.replace(/\//g,"\\")),$}ee(C,"v");function A(W,H){const $=H?_:w;let K="",{scheme:X,authority:j,path:te,query:J,fragment:oe}=W;if(X&&(K+=X,K+=":"),(j||"file"===X)&&(K+=d,K+=d),j){let se=j.indexOf("@");if(-1!==se){const re=j.substr(0,se);j=j.substr(se+1),se=re.lastIndexOf(":"),-1===se?K+=$(re,false,false):(K+=$(re.substr(0,se),false,false),K+=":",K+=$(re.substr(se+1),false,true)),K+="@"}j=j.toLowerCase(),se=j.lastIndexOf(":"),-1===se?K+=$(j,false,true):(K+=$(j.substr(0,se),false,true),K+=j.substr(se))}if(te){if(te.length>=3&&47===te.charCodeAt(0)&&58===te.charCodeAt(2)){const se=te.charCodeAt(1);se>=65&&se<=90&&(te=`/${String.fromCharCode(se+32)}:${te.substr(3)}`)}else if(te.length>=2&&58===te.charCodeAt(1)){const se=te.charCodeAt(0);se>=65&&se<=90&&(te=`${String.fromCharCode(se+32)}:${te.substr(2)}`)}K+=$(te,true,false)}return J&&(K+="?",K+=$(J,false,false)),oe&&(K+="#",K+=H?oe:w(oe,false,false)),K}ee(A,"b");function P(W){try{return decodeURIComponent(W)}catch{return W.length>3?W.substr(0,3)+P(W.substr(3)):W}}ee(P,"C");const L=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function I(W){return W.match(L)?W.replace(L,H=>P(H)):W}ee(I,"w");var N=n(975);const O=N.posix||N,z="/";var U;!function(W){W.joinPath=function(H,...$){return H.with({path:O.join(H.path,...$)})},W.resolvePath=function(H,...$){let K=H.path,X=false;K[0]!==z&&(K=z+K,X=true);let j=O.resolve(K,...$);return X&&j[0]===z&&!H.authority&&(j=j.substring(1)),H.with({path:j})},W.dirname=function(H){if(0===H.path.length||H.path===z)return H;let $=O.dirname(H.path);return 1===$.length&&46===$.charCodeAt(0)&&($=""),H.with({path:$})},W.basename=function(H){return O.basename(H.path)},W.extname=function(H){return O.extname(H.path)}}(U||(U={})),tFn=r})();({URI:uv,Utils:Wte}=tFn);(function(e){e.basename=Wte.basename;e.dirname=Wte.dirname;e.extname=Wte.extname;e.joinPath=Wte.joinPath;e.resolvePath=Wte.resolvePath;const t=typeof process==="object"&&process?.platform==="win32";function n(a,s){return a?.toString()===s?.toString()}ee(n,"equals");e.equals=n;function r(a,s){const l=typeof a==="string"?uv.parse(a).path:a.path;const u=typeof s==="string"?uv.parse(s).path:s.path;const d=l.split("/").filter(x=>x.length>0);const f=u.split("/").filter(x=>x.length>0);if(t){const x=/^[A-Z]:$/;if(d[0]&&x.test(d[0])){d[0]=d[0].toLowerCase()}if(f[0]&&x.test(f[0])){f[0]=f[0].toLowerCase()}if(d[0]!==f[0]){return u.substring(1)}}let h=0;for(;h({name:r.name,uri:ab.joinPath(uv.parse(t),r.name).toString(),element:r.element}))}all(){return this.collectValues(this.root)}findAll(e){const t=this.getNode(ab.normalize(e),false);if(!t){return[]}return this.collectValues(t)}getNode(e,t){const n=e.split("/");if(e.charAt(e.length-1)==="/"){n.pop()}let r=this.root;for(const i of n){let o=r.children.get(i);if(!o){if(t){o={name:i,children:new Map,parent:r};r.children.set(i,o)}else{return void 0}}r=o}return r}collectValues(e){const t=[];if(e.element){t.push(e.element)}for(const n of e.children.values()){t.push(...this.collectValues(n))}return t}};(function(e){e[e["Changed"]=0]="Changed";e[e["Parsed"]=1]="Parsed";e[e["IndexedContent"]=2]="IndexedContent";e[e["ComputedScopes"]=3]="ComputedScopes";e[e["Linked"]=4]="Linked";e[e["IndexedReferences"]=5]="IndexedReferences";e[e["Validated"]=6]="Validated"})(Sl||(Sl={}));nFn=class{static{ee(this,"DefaultLangiumDocumentFactory")}constructor(e){this.serviceRegistry=e.ServiceRegistry;this.textDocuments=e.workspace.TextDocuments;this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,t=cd.CancellationToken.None){const n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,t)}fromTextDocument(e,t,n){t=t??uv.parse(e.uri);if(cd.CancellationToken.is(n)){return this.createAsync(t,e,n)}else{return this.create(t,e,n)}}fromString(e,t,n){if(cd.CancellationToken.is(n)){return this.createAsync(t,e,n)}else{return this.create(t,e,n)}}fromModel(e,t){return this.create(t,{$model:e})}create(e,t,n){if(typeof t==="string"){const r=this.parse(e,t,n);return this.createLangiumDocument(r,e,void 0,t)}else if("$model"in t){const r={value:t.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(r,e)}else{const r=this.parse(e,t.getText(),n);return this.createLangiumDocument(r,e,t)}}async createAsync(e,t,n){if(typeof t==="string"){const r=await this.parseAsync(e,t,n);return this.createLangiumDocument(r,e,void 0,t)}else{const r=await this.parseAsync(e,t.getText(),n);return this.createLangiumDocument(r,e,t)}}createLangiumDocument(e,t,n,r){let i;if(n){i={parseResult:e,uri:t,state:Sl.Parsed,references:[],textDocument:n}}else{const o=this.createTextDocumentGetter(t,r);i={parseResult:e,uri:t,state:Sl.Parsed,references:[],get textDocument(){return o()}}}e.value.$document=i;return i}async update(e,t){const n=e.parseResult.value.$cstNode?.root.fullText;const r=this.textDocuments?.get(e.uri.toString());const i=r?r.getText():await this.fileSystemProvider.readFile(e.uri);if(r){Object.defineProperty(e,"textDocument",{value:r})}else{const o=this.createTextDocumentGetter(e.uri,i);Object.defineProperty(e,"textDocument",{get:o})}if(n!==i){e.parseResult=await this.parseAsync(e.uri,i,t);e.parseResult.value.$document=e}e.state=Sl.Parsed;return e}parse(e,t,n){const r=this.serviceRegistry.getServices(e);return r.parser.LangiumParser.parse(t,n)}parseAsync(e,t,n){const r=this.serviceRegistry.getServices(e);return r.parser.AsyncParser.parse(t,n)}createTextDocumentGetter(e,t){const n=this.serviceRegistry;let r=void 0;return()=>{return r??(r=kke.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,t??""))}}};rFn=class{static{ee(this,"DefaultLangiumDocuments")}constructor(e){this.documentTrie=new kat;this.services=e;this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory;this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return gu(this.documentTrie.all())}addDocument(e){const t=e.uri.toString();if(this.documentTrie.has(t)){throw new Error(`A document with the URI '${t}' is already present.`)}this.documentTrie.insert(t,e)}getDocument(e){const t=e.toString();return this.documentTrie.find(t)}getDocuments(e){const t=e.toString();return this.documentTrie.findAll(t)}async getOrCreateDocument(e,t){let n=this.getDocument(e);if(n){return n}n=await this.langiumDocumentFactory.fromUri(e,t);this.addDocument(n);return n}createDocument(e,t,n){if(n){return this.langiumDocumentFactory.fromString(t,e,n).then(r=>{this.addDocument(r);return r})}else{const r=this.langiumDocumentFactory.fromString(t,e);this.addDocument(r);return r}}hasDocument(e){return this.documentTrie.has(e.toString())}invalidateDocument(e){const t=e.toString();const n=this.documentTrie.find(t);if(n){this.documentBuilder().resetToState(n,Sl.Changed)}return n}deleteDocument(e){const t=e.toString();const n=this.documentTrie.find(t);if(n){n.state=Sl.Changed;this.documentTrie.delete(t)}return n}deleteDocuments(e){const t=e.toString();const n=this.documentTrie.findAll(t);for(const r of n){r.state=Sl.Changed}this.documentTrie.delete(t);return n}};DB=Symbol("RefResolving");iFn=class{static{ee(this,"DefaultLinker")}constructor(e){this.reflection=e.shared.AstReflection;this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments;this.scopeProvider=e.references.ScopeProvider;this.astNodeLocator=e.workspace.AstNodeLocator;this.profiler=e.shared.profilers.LangiumProfiler;this.languageId=e.LanguageMetaData.languageId}async link(e,t=cd.CancellationToken.None){if(this.profiler?.isActive("linking")){const n=this.profiler.createTask("linking",this.languageId);n.start();try{for(const r of $w(e.parseResult.value)){await $m(t);YG(r).forEach(i=>{const o=`${r.$type}:${i.property}`;n.startSubTask(o);try{this.doLink(i,e)}finally{n.stopSubTask(o)}})}}finally{n.stop()}}else{for(const n of $w(e.parseResult.value)){await $m(t);YG(n).forEach(r=>this.doLink(r,e))}}}doLink(e,t){const n=e.reference;if("_ref"in n&&n._ref===void 0){n._ref=DB;try{const r=this.getCandidate(e);if(zB(r)){n._ref=r}else{n._nodeDescription=r;const i=this.loadAstNode(r);n._ref=i??this.createLinkingError(e,r)}}catch(r){console.error(`An error occurred while resolving reference to '${n.$refText}':`,r);const i=r.message??String(r);n._ref={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${i}`}}t.references.push(n)}else if("_items"in n&&n._items===void 0){n._items=DB;try{const r=this.getCandidates(e);const i=[];if(zB(r)){n._linkingError=r}else{for(const o of r){const a=this.loadAstNode(o);if(a){i.push({ref:a,$nodeDescription:o})}}}n._items=i}catch(r){n._linkingError={info:e,message:`An error occurred while resolving reference to '${n.$refText}': ${r}`};n._items=[]}t.references.push(n)}}unlink(e){for(const t of e.references){if("_ref"in t){t._ref=void 0;delete t._nodeDescription}else if("_items"in t){t._items=void 0;delete t._linkingError}}e.references=[]}getCandidate(e){const t=this.scopeProvider.getScope(e);const n=t.getElement(e.reference.$refText);return n??this.createLinkingError(e)}getCandidates(e){const t=this.scopeProvider.getScope(e);const n=t.getElements(e.reference.$refText).distinct(r=>`${r.documentUri}#${r.path}`).toArray();return n.length>0?n:this.createLinkingError(e)}buildReference(e,t,n,r){const i=this;const o={$refNode:n,$refText:r,_ref:void 0,get ref(){if(ip(this._ref)){return this._ref}else if(fit(this._nodeDescription)){const a=i.loadAstNode(this._nodeDescription);this._ref=a??i.createLinkingError({reference:o,container:e,property:t},this._nodeDescription)}else if(this._ref===void 0){this._ref=DB;const a=zG(e).$document;const s=i.getLinkedNode({reference:o,container:e,property:t});if(s.error&&a&&a.state0){return void 0}else{return this._linkingError=i.createLinkingError({reference:o,container:e,property:t})}}};return o}throwCyclicReferenceError(e,t,n){throw new Error(`Cyclic reference resolution detected: ${this.astNodeLocator.getAstNodePath(e)}/${t} (symbol '${n}')`)}getLinkedNode(e){try{const t=this.getCandidate(e);if(zB(t)){return{error:t}}const n=this.loadAstNode(t);if(n){return{node:n,descr:t}}else{return{descr:t,error:this.createLinkingError(e,t)}}}catch(t){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,t);const n=t.message??String(t);return{error:{info:e,message:`An error occurred while resolving reference to '${e.reference.$refText}': ${n}`}}}}loadAstNode(e){if(e.node){return e.node}const t=this.langiumDocuments().getDocument(e.documentUri);if(!t){return void 0}return this.astNodeLocator.getAstNode(t.parseResult.value,e.path)}createLinkingError(e,t){const n=zG(e.container).$document;if(n&&n.statev6(t)&&t.isMulti)}findDeclarations(e){if(e){const t=rot(e);const n=e.astNode;if(t&&n){const r=n[t.feature];if(ob(r)||gS(r)){return qAe(r)}else if(Array.isArray(r)){for(const i of r){if((ob(i)||gS(i))&&i.$refNode&&i.$refNode.offset<=e.offset&&i.$refNode.end>=e.end){return qAe(i)}}}}if(n){const r=this.nameProvider.getNameNode(n);if(r&&(r===e||Nit(e,r))){return this.getSelfNodes(n)}}}return[]}getSelfNodes(e){if(!this.hasMultiReference){return[e]}else{const t=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));const n=this.getNodeFromReferenceDescription(t.head());if(n){for(const r of YG(n)){if(gS(r.reference)&&r.reference.items.some(i=>i.ref===e)){return r.reference.items.map(i=>i.ref)}}}return[e]}}getNodeFromReferenceDescription(e){if(!e){return void 0}const t=this.documents.getDocument(e.sourceUri);if(t){return this.nodeLocator.getAstNode(t.parseResult.value,e.sourcePath)}return void 0}findDeclarationNodes(e){const t=this.findDeclarations(e);const n=[];for(const r of t){const i=this.nameProvider.getNameNode(r)??r.$cstNode;if(i){n.push(i)}}return n}findReferences(e,t){const n=[];if(t.includeDeclaration){n.push(...this.getSelfReferences(e))}let r=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));if(t.documentUri){r=r.filter(i=>ab.equals(i.sourceUri,t.documentUri))}n.push(...r);return gu(n)}getSelfReferences(e){const t=this.getSelfNodes(e);const n=[];for(const r of t){const i=this.nameProvider.getNameNode(r);if(i){const o=Vw(r);const a=this.nodeLocator.getAstNodePath(r);n.push({sourceUri:o.uri,sourcePath:a,targetUri:o.uri,targetPath:a,segment:jG(i),local:true})}}return n}};nP=class{static{ee(this,"MultiMap")}constructor(e){this.map=new Map;if(e){for(const[t,n]of e){this.add(t,n)}}}get size(){return kne.sum(gu(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,t){if(t===void 0){return this.map.delete(e)}else{const n=this.map.get(e);if(n){const r=n.indexOf(t);if(r>=0){if(n.length===1){this.map.delete(e)}else{n.splice(r,1)}return true}}return false}}get(e){return this.map.get(e)??[]}getStream(e){const t=this.map.get(e);return t?gu(t):GG}has(e,t){if(t===void 0){return this.map.has(e)}else{const n=this.map.get(e);if(n){return n.indexOf(t)>=0}return false}}add(e,t){if(this.map.has(e)){this.map.get(e).push(t)}else{this.map.set(e,[t])}return this}addAll(e,t){if(this.map.has(e)){this.map.get(e).push(...t)}else{this.map.set(e,Array.from(t))}return this}forEach(e){this.map.forEach((t,n)=>t.forEach(r=>e(r,n,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return gu(this.map.entries()).flatMap(([e,t])=>t.map(n=>[e,n]))}keys(){return gu(this.map.keys())}values(){return gu(this.map.values()).flat()}entriesGroupedByKey(){return gu(this.map.entries())}};Pke=class{static{ee(this,"BiMap")}get size(){return this.map.size}constructor(e){this.map=new Map;this.inverse=new Map;if(e){for(const[t,n]of e){this.set(t,n)}}}clear(){this.map.clear();this.inverse.clear()}set(e,t){this.map.set(e,t);this.inverse.set(t,e);return this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const t=this.map.get(e);if(t!==void 0){this.map.delete(e);this.inverse.delete(t);return true}return false}};sFn=class{static{ee(this,"DefaultScopeComputation")}constructor(e){this.nameProvider=e.references.NameProvider;this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,t=cd.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,t)}async collectExportedSymbolsForNode(e,t,n=qne,r=cd.CancellationToken.None){const i=[];this.addExportedSymbol(e,i,t);for(const o of n(e)){await $m(r);this.addExportedSymbol(o,i,t)}return i}addExportedSymbol(e,t,n){const r=this.nameProvider.getName(e);if(r){t.push(this.descriptions.createDescription(e,r,n))}}async collectLocalSymbols(e,t=cd.CancellationToken.None){const n=e.parseResult.value;const r=new nP;for(const i of rP(n)){await $m(t);this.addLocalSymbol(i,e,r)}return r}addLocalSymbol(e,t,n){const r=e.$container;if(r){const i=this.nameProvider.getName(e);if(i){n.add(r,this.descriptions.createDescription(e,i,t))}}}};art=class{static{ee(this,"StreamScope")}constructor(e,t,n){this.elements=e;this.outerScope=t;this.caseInsensitive=n?.caseInsensitive??false;this.concatOuterScope=n?.concatOuterScope??true}getAllElements(){if(this.outerScope){return this.elements.concat(this.outerScope.getAllElements())}else{return this.elements}}getElement(e){const t=this.caseInsensitive?e.toLowerCase():e;const n=this.caseInsensitive?this.elements.find(r=>r.name.toLowerCase()===t):this.elements.find(r=>r.name===e);if(n){return n}if(this.outerScope){return this.outerScope.getElement(e)}return void 0}getElements(e){const t=this.caseInsensitive?e.toLowerCase():e;const n=this.caseInsensitive?this.elements.filter(r=>r.name.toLowerCase()===t):this.elements.filter(r=>r.name===e);if((this.concatOuterScope||n.isEmpty())&&this.outerScope){return n.concat(this.outerScope.getElements(e))}else{return n}}};O8i=class{static{ee(this,"MapScope")}constructor(e,t,n){this.elements=new Map;this.caseInsensitive=n?.caseInsensitive??false;this.concatOuterScope=n?.concatOuterScope??true;for(const r of e){const i=this.caseInsensitive?r.name.toLowerCase():r.name;this.elements.set(i,r)}this.outerScope=t}getElement(e){const t=this.caseInsensitive?e.toLowerCase():e;const n=this.elements.get(t);if(n){return n}if(this.outerScope){return this.outerScope.getElement(e)}return void 0}getElements(e){const t=this.caseInsensitive?e.toLowerCase():e;const n=this.elements.get(t);const r=n?[n]:[];if((this.concatOuterScope||r.length>0)&&this.outerScope){return gu(r).concat(this.outerScope.getElements(e))}else{return gu(r)}}getAllElements(){let e=gu(this.elements.values());if(this.outerScope){e=e.concat(this.outerScope.getAllElements())}return e}};lFn=class{static{ee(this,"MultiMapScope")}constructor(e,t,n){this.elements=new nP;this.caseInsensitive=n?.caseInsensitive??false;this.concatOuterScope=n?.concatOuterScope??true;for(const r of e){const i=this.caseInsensitive?r.name.toLowerCase():r.name;this.elements.add(i,r)}this.outerScope=t}getElement(e){const t=this.caseInsensitive?e.toLowerCase():e;const n=this.elements.get(t)[0];if(n){return n}if(this.outerScope){return this.outerScope.getElement(e)}return void 0}getElements(e){const t=this.caseInsensitive?e.toLowerCase():e;const n=this.elements.get(t);if((this.concatOuterScope||n.length===0)&&this.outerScope){return gu(n).concat(this.outerScope.getElements(e))}else{return gu(n)}}getAllElements(){let e=gu(this.elements.values());if(this.outerScope){e=e.concat(this.outerScope.getAllElements())}return e}};B8i={getElement(){return void 0},getElements(){return GG},getAllElements(){return GG}};zRe=class{static{ee(this,"DisposableCache")}constructor(){this.toDispose=[];this.isDisposed=false}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed();this.clear();this.isDisposed=true;this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed){throw new Error("This cache has already been disposed")}}};Pat=class extends zRe{static{ee(this,"SimpleCache")}constructor(){super(...arguments);this.cache=new Map}has(e){this.throwIfDisposed();return this.cache.has(e)}set(e,t){this.throwIfDisposed();this.cache.set(e,t)}get(e,t){this.throwIfDisposed();if(this.cache.has(e)){return this.cache.get(e)}else if(t){const n=t();this.cache.set(e,n);return n}else{return void 0}}delete(e){this.throwIfDisposed();return this.cache.delete(e)}clear(){this.throwIfDisposed();this.cache.clear()}};URe=class extends zRe{static{ee(this,"ContextCache")}constructor(e){super();this.cache=new Map;this.converter=e??(t=>t)}has(e,t){this.throwIfDisposed();return this.cacheForContext(e).has(t)}set(e,t,n){this.throwIfDisposed();this.cacheForContext(e).set(t,n)}get(e,t,n){this.throwIfDisposed();const r=this.cacheForContext(e);if(r.has(t)){return r.get(t)}else if(n){const i=n();r.set(t,i);return i}else{return void 0}}delete(e,t){this.throwIfDisposed();return this.cacheForContext(e).delete(t)}clear(e){this.throwIfDisposed();if(e){const t=this.converter(e);this.cache.delete(t)}else{this.cache.clear()}}cacheForContext(e){const t=this.converter(e);let n=this.cache.get(t);if(!n){n=new Map;this.cache.set(t,n)}return n}};cFn=class extends URe{static{ee(this,"DocumentCache")}constructor(e,t){super(n=>n.toString());if(t){this.toDispose.push(e.workspace.DocumentBuilder.onDocumentPhase(t,n=>{this.clear(n.uri.toString())}));this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,r)=>{for(const i of r){this.clear(i)}}))}else{this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,r)=>{const i=n.concat(r);for(const o of i){this.clear(o)}}))}}};Iat=class extends Pat{static{ee(this,"WorkspaceCache")}constructor(e,t){super();if(t){this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(t,()=>{this.clear()}));this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,r)=>{if(r.length>0){this.clear()}}))}else{this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}}};uFn=class{static{ee(this,"DefaultScopeProvider")}constructor(e){this.reflection=e.shared.AstReflection;this.nameProvider=e.references.NameProvider;this.descriptions=e.workspace.AstNodeDescriptionProvider;this.indexManager=e.shared.workspace.IndexManager;this.globalScopeCache=new Iat(e.shared)}getScope(e){const t=[];const n=this.reflection.getReferenceType(e);const r=Vw(e.container).localSymbols;if(r){let o=e.container;do{if(r.has(o)){t.push(r.getStream(o).filter(a=>this.reflection.isSubtype(a.type,n)))}o=o.$container}while(o)}let i=this.getGlobalScope(n,e);for(let o=t.length-1;o>=0;o--){i=this.createScope(t[o],i)}return i}createScope(e,t,n){return new art(gu(e),t,n)}createScopeForNodes(e,t,n){const r=gu(e).map(i=>{const o=this.nameProvider.getName(i);if(o){return this.descriptions.createDescription(i,o)}return void 0}).nonNullable();return new art(r,t,n)}getGlobalScope(e,t){return this.globalScopeCache.get(e,()=>new lFn(this.indexManager.allElements(e)))}};ee(Mat,"isAstNodeWithComment");ee(srt,"isIntermediateReference");dFn=class{static{ee(this,"DefaultJsonSerializer")}constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]);this.langiumDocuments=e.shared.workspace.LangiumDocuments;this.astNodeLocator=e.workspace.AstNodeLocator;this.nameProvider=e.references.NameProvider;this.commentProvider=e.documentation.CommentProvider}serialize(e,t){const n=t??{};const r=t?.replacer;const i=ee((a,s)=>this.replacer(a,s,n),"defaultReplacer");const o=r?(a,s)=>r(a,s,i):i;try{this.currentDocument=Vw(e);return JSON.stringify(e,o,t?.space)}finally{this.currentDocument=void 0}}deserialize(e,t){const n=t??{};const r=JSON.parse(e);this.linkNode(r,r,n);return r}replacer(e,t,{refText:n,sourceText:r,textRegions:i,comments:o,uriConverter:a}){if(this.ignoreProperties.has(e)){return void 0}else if(ob(t)){const s=t.ref;const l=n?t.$refText:void 0;if(s){const u=Vw(s);let d="";if(this.currentDocument&&this.currentDocument!==u){if(a){d=a(u.uri,s)}else{d=u.uri.toString()}}const f=this.astNodeLocator.getAstNodePath(s);return{$ref:`${d}#${f}`,$refText:l}}else{return{$error:t.error?.message??"Could not resolve reference",$refText:l}}}else if(gS(t)){const s=n?t.$refText:void 0;const l=[];for(const u of t.items){const d=u.ref;const f=Vw(u.ref);let h="";if(this.currentDocument&&this.currentDocument!==f){if(a){h=a(f.uri,d)}else{h=f.uri.toString()}}const m=this.astNodeLocator.getAstNodePath(d);l.push(`${h}#${m}`)}return{$refs:l,$refText:s}}else if(ip(t)){let s=void 0;if(i){s=this.addAstNodeRegionWithAssignmentsTo({...t});if((!e||t.$document)&&s?.$textRegion){s.$textRegion.documentURI=this.currentDocument?.uri.toString()}}if(r&&!e){s??(s={...t});s.$sourceText=t.$cstNode?.text}if(o){s??(s={...t});const l=this.commentProvider.getComment(t);if(l){s.$comment=l.replace(/\r/g,"")}}return s??t}else{return t}}addAstNodeRegionWithAssignmentsTo(e){const t=ee(n=>({offset:n.offset,end:n.end,length:n.length,range:n.range}),"createDocumentSegment");if(e.$cstNode){const n=e.$textRegion=t(e.$cstNode);const r=n.assignments={};Object.keys(e).filter(i=>!i.startsWith("$")).forEach(i=>{const o=tot(e.$cstNode,i).map(t);if(o.length!==0){r[i]=o}});return e}return void 0}linkNode(e,t,n,r,i,o){for(const[s,l]of Object.entries(e)){if(Array.isArray(l)){for(let u=0;u{await this.handleException(()=>e.call(t,n,r,i),"An error occurred during validation",r,n)}}async handleException(e,t,n,r){try{await e()}catch(i){if(N6(i)){throw i}console.error(`${t}:`,i);if(i instanceof Error&&i.stack){console.error(i.stack)}const o=i instanceof Error?i.message:String(i);n("error",`${t}: ${o}`,{node:r})}}addEntry(e,t){if(e==="AstNode"){this.entries.add("AstNode",t);return}for(const n of this.reflection.getAllSubTypes(e)){this.entries.add(n,t)}}getChecks(e,t){let n=gu(this.entries.get(e)).concat(this.entries.get("AstNode"));if(t){n=n.filter(r=>t.includes(r.category))}return n.map(r=>r.check)}registerBeforeDocument(e,t=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",t))}registerAfterDocument(e,t=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",t))}wrapPreparationException(e,t,n){return async(r,i,o,a)=>{await this.handleException(()=>e.call(n,r,i,o,a),t,i,r)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(e){return this.knownCategories}};pFn=Object.freeze({validateNode:true,validateChildren:true});mFn=class{static{ee(this,"DefaultDocumentValidator")}constructor(e){this.validationRegistry=e.validation.ValidationRegistry;this.metadata=e.LanguageMetaData;this.profiler=e.shared.profilers.LangiumProfiler;this.languageId=e.LanguageMetaData.languageId}async validateDocument(e,t={},n=cd.CancellationToken.None){const r=e.parseResult;const i=[];await $m(n);if(!t.categories||t.categories.includes("built-in")){this.processLexingErrors(r,i,t);if(t.stopAfterLexingErrors&&i.some(o=>o.data?.code===H_.LexingError)){return i}this.processParsingErrors(r,i,t);if(t.stopAfterParsingErrors&&i.some(o=>o.data?.code===H_.ParsingError)){return i}this.processLinkingErrors(e,i,t);if(t.stopAfterLinkingErrors&&i.some(o=>o.data?.code===H_.LinkingError)){return i}}try{i.push(...await this.validateAst(r.value,t,n))}catch(o){if(N6(o)){throw o}console.error("An error occurred during validation:",o)}await $m(n);return i}processLexingErrors(e,t,n){const r=[...e.lexerErrors,...e.lexerReport?.diagnostics??[]];for(const i of r){const o=i.severity??"error";const a={severity:wne(o),range:{start:{line:i.line-1,character:i.column-1},end:{line:i.line-1,character:i.column+i.length-1}},message:i.message,data:Dat(o),source:this.getSource()};t.push(a)}}processParsingErrors(e,t,n){for(const r of e.parserErrors){let i=void 0;if(isNaN(r.token.startOffset)){if("previousToken"in r){const o=r.previousToken;if(!isNaN(o.startOffset)){const a={line:o.endLine-1,character:o.endColumn};i={start:a,end:a}}else{const a={line:0,character:0};i={start:a,end:a}}}}else{i=Rne(r.token)}if(i){const o={severity:wne("error"),range:i,message:r.message,data:l6(H_.ParsingError),source:this.getSource()};t.push(o)}}}processLinkingErrors(e,t,n){for(const r of e.references){const i=r.error;if(i){const o={node:i.info.container,range:r.$refNode?.range,property:i.info.property,index:i.info.index,data:{code:H_.LinkingError,containerType:i.info.container.$type,property:i.info.property,refText:i.info.reference.$refText}};t.push(this.toDiagnostic("error",i.message,o))}}}async validateAst(e,t,n=cd.CancellationToken.None){const r=[];const i=ee((o,a,s)=>{r.push(this.toDiagnostic(o,a,s))},"acceptor");await this.validateAstBefore(e,t,i,n);await this.validateAstNodes(e,t,i,n);await this.validateAstAfter(e,t,i,n);return r}async validateAstBefore(e,t,n,r=cd.CancellationToken.None){const i=this.validationRegistry.checksBefore;for(const o of i){await $m(r);await o(e,n,t.categories??[],r)}}async validateAstNodes(e,t,n,r=cd.CancellationToken.None){if(this.profiler?.isActive("validating")){const i=this.profiler.createTask("validating",this.languageId);i.start();try{const o=$w(e).iterator();for(const a of o){i.startSubTask(a.$type);const s=this.validateSingleNodeOptions(a,t);if(s.validateNode){try{const l=this.validationRegistry.getChecks(a.$type,t.categories);for(const u of l){await u(a,n,r)}}finally{i.stopSubTask(a.$type)}}if(!s.validateChildren){o.prune()}}}finally{i.stop()}}else{const i=$w(e).iterator();for(const o of i){await $m(r);const a=this.validateSingleNodeOptions(o,t);if(a.validateNode){const s=this.validationRegistry.getChecks(o.$type,t.categories);for(const l of s){await l(o,n,r)}}if(!a.validateChildren){i.prune()}}}}validateSingleNodeOptions(e,t){return pFn}async validateAstAfter(e,t,n,r=cd.CancellationToken.None){const i=this.validationRegistry.checksAfter;for(const o of i){await $m(r);await o(e,n,t.categories??[],r)}}toDiagnostic(e,t,n){return{message:t,range:Lat(n),severity:wne(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}};ee(Lat,"getDiagnosticRange");ee(wne,"toDiagnosticSeverity");ee(Dat,"toDiagnosticData");(function(e){e.LexingError="lexing-error";e.LexingWarning="lexing-warning";e.LexingInfo="lexing-info";e.LexingHint="lexing-hint";e.ParsingError="parsing-error";e.LinkingError="linking-error"})(H_||(H_={}));gFn=class{static{ee(this,"DefaultAstNodeDescriptionProvider")}constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator;this.nameProvider=e.references.NameProvider}createDescription(e,t,n){const r=n??Vw(e);t??(t=this.nameProvider.getName(e));const i=this.astNodeLocator.getAstNodePath(e);if(!t){throw new Error(`Node at path ${i} has no name.`)}let o;const a=ee(()=>o??(o=jG(this.nameProvider.getNameNode(e)??e.$cstNode)),"nameSegmentGetter");return{node:e,name:t,get nameSegment(){return a()},selectionSegment:jG(e.$cstNode),type:e.$type,documentUri:r.uri,path:i}}};yFn=class{static{ee(this,"DefaultReferenceDescriptionProvider")}constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,t=cd.CancellationToken.None){const n=[];const r=e.parseResult.value;for(const i of $w(r)){await $m(t);YG(i).forEach(o=>{if(!o.reference.error){n.push(...this.createInfoDescriptions(o))}})}return n}createInfoDescriptions(e){const t=e.reference;if(t.error||!t.$refNode){return[]}let n=[];if(ob(t)&&t.$nodeDescription){n=[t.$nodeDescription]}else if(gS(t)){n=t.items.map(s=>s.$nodeDescription).filter(s=>s!==void 0)}const r=Vw(e.container).uri;const i=this.nodeLocator.getAstNodePath(e.container);const o=[];const a=jG(t.$refNode);for(const s of n){o.push({sourceUri:r,sourcePath:i,targetUri:s.documentUri,targetPath:s.path,segment:a,local:ab.equals(s.documentUri,r)})}return o}};bFn=class{static{ee(this,"DefaultAstNodeLocator")}constructor(){this.segmentSeparator="/";this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const t=this.getAstNodePath(e.$container);const n=this.getPathSegment(e);const r=t+this.segmentSeparator+n;return r}return""}getPathSegment({$containerProperty:e,$containerIndex:t}){if(!e){throw new Error("Missing '$containerProperty' in AST node.")}if(t!==void 0){return e+this.indexSeparator+t}return e}getAstNode(e,t){const n=t.split(this.segmentSeparator);return n.reduce((r,i)=>{if(!r||i.length===0){return r}const o=i.indexOf(this.indexSeparator);if(o>0){const a=i.substring(0,o);const s=parseInt(i.substring(o+1));const l=r[a];return l?.[s]}return r[i]},e)}};VRe={};Fke(VRe,lit(eH(),1));xFn=class{static{ee(this,"DefaultConfigurationProvider")}constructor(e){this._ready=new tP;this.onConfigurationSectionUpdateEmitter=new VRe.Emitter;this.settings={};this.workspaceConfig=false;this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){this.workspaceConfig=e.capabilities.workspace?.configuration??false}async initialized(e){if(this.workspaceConfig){if(e.register){const t=this.serviceRegistry.all;e.register({section:t.map(n=>this.toSectionName(n.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const t=this.serviceRegistry.all.map(r=>({section:this.toSectionName(r.LanguageMetaData.languageId)}));const n=await e.fetchConfiguration(t);t.forEach((r,i)=>{this.updateSectionConfiguration(r.section,n[i])})}}this._ready.resolve()}updateConfiguration(e){if(typeof e.settings!=="object"||e.settings===null){return}Object.entries(e.settings).forEach(([t,n])=>{this.updateSectionConfiguration(t,n);this.onConfigurationSectionUpdateEmitter.fire({section:t,configuration:n})})}updateSectionConfiguration(e,t){this.settings[e]=t}async getConfiguration(e,t){await this.ready;const n=this.toSectionName(e);if(this.settings[n]){return this.settings[n][t]}}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}};iAe=lit(h3i(),1);(function(e){function t(n){return{dispose:ee(async()=>await n(),"dispose")}}ee(t,"create");e.create=t})(d6||(d6={}));vFn=class{static{ee(this,"DefaultDocumentBuilder")}constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}};this.updateListeners=[];this.buildPhaseListeners=new nP;this.documentPhaseListeners=new nP;this.buildState=new Map;this.documentBuildWaiters=new Map;this.currentState=Sl.Changed;this.langiumDocuments=e.workspace.LangiumDocuments;this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory;this.textDocuments=e.workspace.TextDocuments;this.indexManager=e.workspace.IndexManager;this.fileSystemProvider=e.workspace.FileSystemProvider;this.workspaceManager=()=>e.workspace.WorkspaceManager;this.serviceRegistry=e.ServiceRegistry}async build(e,t={},n=cd.CancellationToken.None){for(const r of e){const i=r.uri.toString();if(r.state===Sl.Validated){if(typeof t.validation==="boolean"&&t.validation){this.resetToState(r,Sl.IndexedReferences)}else if(typeof t.validation==="object"){const o=this.findMissingValidationCategories(r,t);if(o.length>0){this.buildState.set(i,{completed:false,options:{validation:{categories:o}},result:this.buildState.get(i)?.result});r.state=Sl.IndexedReferences}}}else{this.buildState.delete(i)}}this.currentState=Sl.Changed;await this.emitUpdate(e.map(r=>r.uri),[]);await this.buildDocuments(e,t,n)}async update(e,t,n=cd.CancellationToken.None){this.currentState=Sl.Changed;const r=[];for(const s of t){const l=this.langiumDocuments.deleteDocuments(s);for(const u of l){r.push(u.uri);this.cleanUpDeleted(u)}}const i=(await Promise.all(e.map(s=>this.findChangedUris(s)))).flat();for(const s of i){let l=this.langiumDocuments.getDocument(s);if(l===void 0){l=this.langiumDocumentFactory.fromModel({$type:"INVALID"},s);l.state=Sl.Changed;this.langiumDocuments.addDocument(l)}this.resetToState(l,Sl.Changed)}const o=gu(i).concat(r).map(s=>s.toString()).toSet();this.langiumDocuments.all.filter(s=>!o.has(s.uri.toString())&&this.shouldRelink(s,o)).forEach(s=>this.resetToState(s,Sl.ComputedScopes));await this.emitUpdate(i,r);await $m(n);const a=this.sortDocuments(this.langiumDocuments.all.filter(s=>s.state=1}findMissingValidationCategories(e,t){const n=this.buildState.get(e.uri.toString());const r=this.serviceRegistry.getServices(e.uri).validation.ValidationRegistry.getAllValidationCategories(e);const i=n?.result?.validationChecks?new Set(n?.result?.validationChecks):n?.completed?r:new Set;const o=t===void 0||t.validation===true?r:typeof t.validation==="object"?t.validation.categories??r:[];return gu(o).filter(a=>!i.has(a)).toArray()}async findChangedUris(e){const t=this.langiumDocuments.getDocument(e)??this.textDocuments?.get(e);if(t){return[e]}try{const n=await this.fileSystemProvider.stat(e);if(n.isDirectory){const r=await this.workspaceManager().searchFolder(e);return r}else if(this.workspaceManager().shouldIncludeEntry(n)){return[e]}}catch{}return[]}async emitUpdate(e,t){await Promise.all(this.updateListeners.map(n=>n(e,t)))}sortDocuments(e){let t=0;let n=e.length-1;while(t=0&&!this.hasTextDocument(e[n])){n--}if(tn.error!==void 0)){return true}return this.indexManager.isAffected(e,t)}onUpdate(e){this.updateListeners.push(e);return d6.create(()=>{const t=this.updateListeners.indexOf(e);if(t>=0){this.updateListeners.splice(t,1)}})}resetToState(e,t){switch(t){case Sl.Changed:{}case Sl.Parsed:this.indexManager.removeContent(e.uri);case Sl.IndexedContent:e.localSymbols=void 0;case Sl.ComputedScopes:{const n=this.serviceRegistry.getServices(e.uri).references.Linker;n.unlink(e)}case Sl.Linked:this.indexManager.removeReferences(e.uri);case Sl.IndexedReferences:e.diagnostics=void 0;this.buildState.delete(e.uri.toString());case Sl.Validated:}if(e.state>t){e.state=t}}cleanUpDeleted(e){this.buildState.delete(e.uri.toString());this.indexManager.remove(e.uri);e.state=Sl.Changed}async buildDocuments(e,t,n){this.prepareBuild(e,t);await this.runCancelable(e,Sl.Parsed,n,o=>this.langiumDocumentFactory.update(o,n));await this.runCancelable(e,Sl.IndexedContent,n,o=>this.indexManager.updateContent(o,n));await this.runCancelable(e,Sl.ComputedScopes,n,async o=>{const a=this.serviceRegistry.getServices(o.uri).references.ScopeComputation;o.localSymbols=await a.collectLocalSymbols(o,n)});const r=e.filter(o=>this.shouldLink(o));await this.runCancelable(r,Sl.Linked,n,o=>{const a=this.serviceRegistry.getServices(o.uri).references.Linker;return a.link(o,n)});await this.runCancelable(r,Sl.IndexedReferences,n,o=>this.indexManager.updateReferences(o,n));const i=e.filter(o=>{if(this.shouldValidate(o)){return true}else{this.markAsCompleted(o);return false}});await this.runCancelable(i,Sl.Validated,n,async o=>{await this.validate(o,n);this.markAsCompleted(o)})}markAsCompleted(e){const t=this.buildState.get(e.uri.toString());if(t){t.completed=true}}prepareBuild(e,t){for(const n of e){const r=n.uri.toString();const i=this.buildState.get(r);if(!i||i.completed){this.buildState.set(r,{completed:false,options:t,result:i?.result})}else{}}}async runCancelable(e,t,n,r){for(const o of e){if(o.stateo.state===t);await this.notifyBuildPhase(i,t,n);this.currentState=t}onBuildPhase(e,t){this.buildPhaseListeners.add(e,t);return d6.create(()=>{this.buildPhaseListeners.delete(e,t)})}onDocumentPhase(e,t){this.documentPhaseListeners.add(e,t);return d6.create(()=>{this.documentPhaseListeners.delete(e,t)})}waitUntil(e,t,n){let r=void 0;if(t&&"path"in t){r=t}else{n=t}n??(n=cd.CancellationToken.None);if(r){return this.awaitDocumentState(e,r,n)}else{return this.awaitBuilderState(e,n)}}awaitDocumentState(e,t,n){const r=this.langiumDocuments.getDocument(t);if(!r){return Promise.reject(new iAe.ResponseError(iAe.LSPErrorCodes.ServerCancelled,`No document found for URI: ${t.toString()}`))}else if(r.state>=e){return Promise.resolve(t)}else if(n.isCancellationRequested){return Promise.reject(mS)}else if(this.currentState>=e&&e>r.state){return Promise.reject(new iAe.ResponseError(iAe.LSPErrorCodes.RequestFailed,`Document state of ${t.toString()} is ${Sl[r.state]}, requiring ${Sl[e]}, but workspace state is already ${Sl[this.currentState]}. Returning undefined.`))}return new Promise((i,o)=>{const a=this.onDocumentPhase(e,l=>{if(ab.equals(l.uri,t)){a.dispose();s.dispose();i(l.uri)}});const s=n.onCancellationRequested(()=>{a.dispose();s.dispose();o(mS)})})}awaitBuilderState(e,t){if(this.currentState>=e){return Promise.resolve()}else if(t.isCancellationRequested){return Promise.reject(mS)}return new Promise((n,r)=>{const i=this.onBuildPhase(e,()=>{i.dispose();o.dispose();n()});const o=t.onCancellationRequested(()=>{i.dispose();o.dispose();r(mS)})})}async notifyDocumentPhase(e,t,n){const r=this.documentPhaseListeners.get(t);const i=r.slice();for(const o of i){try{await $m(n);await o(e,n)}catch(a){if(!N6(a)){throw a}}}}async notifyBuildPhase(e,t,n){if(e.length===0){return}const r=this.buildPhaseListeners.get(t);const i=r.slice();for(const o of i){await $m(n);await o(e,n)}}shouldLink(e){return this.getBuildOptions(e).eagerLinking??true}shouldValidate(e){return Boolean(this.getBuildOptions(e).validation)}async validate(e,t){const n=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator;const r=this.getBuildOptions(e);const i=typeof r.validation==="object"?{...r.validation}:{};i.categories=this.findMissingValidationCategories(e,r);const o=await n.validateDocument(e,i,t);if(e.diagnostics){e.diagnostics.push(...o)}else{e.diagnostics=o}const a=this.buildState.get(e.uri.toString());if(a){a.result??(a.result={});if(a.result.validationChecks){a.result.validationChecks=gu(a.result.validationChecks).concat(i.categories).distinct().toArray()}else{a.result.validationChecks=[...i.categories]}}}getBuildOptions(e){return this.buildState.get(e.uri.toString())?.options??{}}};_Fn=class{static{ee(this,"DefaultIndexManager")}constructor(e){this.symbolIndex=new Map;this.symbolByTypeIndex=new URe;this.referenceIndex=new Map;this.documents=e.workspace.LangiumDocuments;this.serviceRegistry=e.ServiceRegistry;this.astReflection=e.AstReflection}findAllReferences(e,t){const n=Vw(e).uri;const r=[];this.referenceIndex.forEach(i=>{i.forEach(o=>{if(ab.equals(o.targetUri,n)&&o.targetPath===t){r.push(o)}})});return gu(r)}allElements(e,t){let n=gu(this.symbolIndex.keys());if(t){n=n.filter(r=>!t||t.has(r))}return n.map(r=>this.getFileDescriptions(r,e)).flat()}getFileDescriptions(e,t){if(!t){return this.symbolIndex.get(e)??[]}const n=this.symbolByTypeIndex.get(e,t,()=>{const r=this.symbolIndex.get(e)??[];return r.filter(i=>this.astReflection.isSubtype(i.type,t))});return n}remove(e){this.removeContent(e);this.removeReferences(e)}removeContent(e){const t=e.toString();this.symbolIndex.delete(t);this.symbolByTypeIndex.clear(t)}removeReferences(e){const t=e.toString();this.referenceIndex.delete(t)}async updateContent(e,t=cd.CancellationToken.None){const n=this.serviceRegistry.getServices(e.uri);const r=await n.references.ScopeComputation.collectExportedSymbols(e,t);const i=e.uri.toString();this.symbolIndex.set(i,r);this.symbolByTypeIndex.clear(i)}async updateReferences(e,t=cd.CancellationToken.None){const n=this.serviceRegistry.getServices(e.uri);const r=await n.workspace.ReferenceDescriptionProvider.createDescriptions(e,t);this.referenceIndex.set(e.uri.toString(),r)}isAffected(e,t){const n=this.referenceIndex.get(e.uri.toString());if(!n){return false}return n.some(r=>!r.local&&t.has(r.targetUri.toString()))}};TFn=class{static{ee(this,"DefaultWorkspaceManager")}constructor(e){this.initialBuildOptions={};this._ready=new tP;this.serviceRegistry=e.ServiceRegistry;this.langiumDocuments=e.workspace.LangiumDocuments;this.documentBuilder=e.workspace.DocumentBuilder;this.fileSystemProvider=e.workspace.FileSystemProvider;this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(e){this.folders=e.workspaceFolders??void 0}initialized(e){return this.mutex.write(t=>this.initializeWorkspace(this.folders??[],t))}async initializeWorkspace(e,t=cd.CancellationToken.None){const n=await this.performStartup(e);await $m(t);await this.documentBuilder.build(n,this.initialBuildOptions,t)}async performStartup(e){const t=[];const n=ee(o=>{t.push(o);if(!this.langiumDocuments.hasDocument(o.uri)){this.langiumDocuments.addDocument(o)}},"collector");await this.loadAdditionalDocuments(e,n);const r=[];await Promise.all(e.map(o=>this.getRootFolder(o)).map(async o=>this.traverseFolder(o,r)));const i=gu(r).distinct(o=>o.toString()).filter(o=>!this.langiumDocuments.hasDocument(o));await this.loadWorkspaceDocuments(i,n);this._ready.resolve();return t}async loadWorkspaceDocuments(e,t){await Promise.all(e.map(async n=>{const r=await this.langiumDocuments.getOrCreateDocument(n);t(r)}))}loadAdditionalDocuments(e,t){return Promise.resolve()}getRootFolder(e){return uv.parse(e.uri)}async traverseFolder(e,t){try{const n=await this.fileSystemProvider.readDirectory(e);await Promise.all(n.map(async r=>{if(this.shouldIncludeEntry(r)){if(r.isDirectory){await this.traverseFolder(r.uri,t)}else if(r.isFile){t.push(r.uri)}}}))}catch(n){console.error("Failure to read directory content of "+e.toString(true),n)}}async searchFolder(e){const t=[];await this.traverseFolder(e,t);return t}shouldIncludeEntry(e){const t=ab.basename(e.uri);if(t.startsWith(".")){return false}if(e.isDirectory){return t!=="node_modules"&&t!=="out"}else if(e.isFile){return this.serviceRegistry.hasServices(e.uri)}return false}};wFn=class{static{ee(this,"DefaultLexerErrorMessageProvider")}buildUnexpectedCharactersMessage(e,t,n,r,i){return Unt.buildUnexpectedCharactersMessage(e,t,n,r,i)}buildUnableToPopLexerModeMessage(e){return Unt.buildUnableToPopLexerModeMessage(e)}};Fat={mode:"full"};Nat=class{static{ee(this,"DefaultLexer")}constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider;this.tokenBuilder=e.parser.TokenBuilder;const t=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(t);const n=Mke(t)?Object.values(t):t;const r=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new sb(n,{positionTracking:"full",skipValidations:r,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,t=Fat){const n=this.chevrotainLexer.tokenize(e);return{tokens:n.tokens,errors:n.errors,hidden:n.groups.hidden??[],report:this.tokenBuilder.flushLexingReport?.(e)}}toTokenTypeDictionary(e){if(Mke(e))return e;const t=GRe(e)?Object.values(e.modes).flat():e;const n={};t.forEach(r=>n[r.name]=r);return n}};ee($Re,"isTokenTypeArray");ee(GRe,"isIMultiModeLexerDefinition");ee(Mke,"isTokenTypeDictionary");Wne();ee(Oat,"parseJSDoc");ee(Bat,"isJSDoc");ee(zat,"getLines");TCn=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy;z8i=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;ee(EFn,"tokenize");ee(CFn,"buildInlineTokens");U8i=/\S/;V8i=/\s*$/;ee(Lke,"skipWhitespace");ee(SFn,"lastCharacter");ee(AFn,"parseJSDocComment");ee(kFn,"parseJSDocElement");ee(RFn,"appendEmptyLine");ee(Uat,"parseJSDocText");ee(PFn,"parseJSDocInline");ee(Vat,"parseJSDocTag");ee($at,"parseJSDocLine");ee(HRe,"normalizeOptions");ee(OAe,"normalizeOption");wCn=class{static{ee(this,"JSDocCommentImpl")}constructor(e,t){this.elements=e;this.range=t}getTag(e){return this.getAllTags().find(t=>t.name===e)}getTags(e){return this.getAllTags().filter(t=>t.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const t of this.elements){if(e.length===0){e=t.toString()}else{const n=t.toString();e+=crt(e)+n}}return e.trim()}toMarkdown(e){let t="";for(const n of this.elements){if(t.length===0){t=n.toMarkdown(e)}else{const r=n.toMarkdown(e);t+=crt(t)+r}}return t.trim()}};gtt=class{static{ee(this,"JSDocTagImpl")}constructor(e,t,n,r){this.name=e;this.content=t;this.inline=n;this.range=r}toString(){let e=`@${this.name}`;const t=this.content.toString();if(this.content.inlines.length===1){e=`${e} ${t}`}else if(this.content.inlines.length>1){e=`${e} +${t}`}if(this.inline){return`{${e}}`}else{return e}}toMarkdown(e){return e?.renderTag?.(this)??this.toMarkdownDefault(e)}toMarkdownDefault(e){const t=this.content.toMarkdown(e);if(this.inline){const i=IFn(this.name,t,e??{});if(typeof i==="string"){return i}}let n="";if(e?.tag==="italic"||e?.tag===void 0){n="*"}else if(e?.tag==="bold"){n="**"}else if(e?.tag==="bold-italic"){n="***"}let r=`${n}@${this.name}${n}`;if(this.content.inlines.length===1){r=`${r} \u2014 ${t}`}else if(this.content.inlines.length>1){r=`${r} +${t}`}if(this.inline){return`{${r}}`}else{return r}}};ee(IFn,"renderInlineTag");ee(MFn,"renderLinkDefault");lrt=class{static{ee(this,"JSDocTextImpl")}constructor(e,t){this.inlines=e;this.range=t}toString(){let e="";for(let t=0;tn.range.start.line){e+="\n"}}return e}toMarkdown(e){let t="";for(let n=0;nr.range.start.line){t+="\n"}}return t}};LFn=class{static{ee(this,"JSDocLineImpl")}constructor(e,t){this.text=e;this.range=t}toString(){return this.text}toMarkdown(){return this.text}};ee(crt,"fillNewlines");DFn=class{static{ee(this,"JSDocDocumentationProvider")}constructor(e){this.indexManager=e.shared.workspace.IndexManager;this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const t=this.commentProvider.getComment(e);if(t&&Bat(t)){const n=Oat(t);return n.toMarkdown({renderLink:ee((r,i)=>{return this.documentationLinkRenderer(e,r,i)},"renderLink"),renderTag:ee(r=>{return this.documentationTagRenderer(e,r)},"renderTag")})}return void 0}documentationLinkRenderer(e,t,n){const r=this.findNameInLocalSymbols(e,t)??this.findNameInGlobalScope(e,t);if(r&&r.nameSegment){const i=r.nameSegment.range.start.line+1;const o=r.nameSegment.range.start.character+1;const a=r.documentUri.with({fragment:`L${i},${o}`});return`[${n}](${a.toString()})`}else{return void 0}}documentationTagRenderer(e,t){return void 0}findNameInLocalSymbols(e,t){const n=Vw(e);const r=n.localSymbols;if(!r){return void 0}let i=e;do{const o=r.getStream(i);const a=o.find(s=>s.name===t);if(a){return a}i=i.$container}while(i);return void 0}findNameInGlobalScope(e,t){const n=this.indexManager.allElements().find(r=>r.name===t);return n}};FFn=class{static{ee(this,"DefaultCommentProvider")}constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){if(Mat(e)){return e.$comment}return Uit(e.$cstNode,this.grammarConfig().multilineCommentRules)?.text}};NFn=class{static{ee(this,"DefaultAsyncParser")}constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,t){return Promise.resolve(this.syncParser.parse(e))}};$8i=class{static{ee(this,"AbstractThreadedAsyncParser")}constructor(e){this.threadCount=8;this.terminationDelay=200;this.workerPool=[];this.queue=[];this.hydrator=e.serializer.Hydrator}initializeWorkers(){while(this.workerPool.length{if(this.queue.length>0){const t=this.queue.shift();if(t){e.lock();t.resolve(e)}}});this.workerPool.push(e)}}async parse(e,t){const n=await this.acquireParserWorker(t);const r=new tP;let i;const o=t.onCancellationRequested(()=>{i=setTimeout(()=>{this.terminateWorker(n)},this.terminationDelay)});n.parse(e).then(a=>{const s=this.hydrator.hydrate(a);r.resolve(s)}).catch(a=>{r.reject(a)}).finally(()=>{o.dispose();clearTimeout(i)});return r.promise}terminateWorker(e){e.terminate();const t=this.workerPool.indexOf(e);if(t>=0){this.workerPool.splice(t,1)}}async acquireParserWorker(e){this.initializeWorkers();for(const n of this.workerPool){if(n.ready){n.lock();return n}}const t=new tP;e.onCancellationRequested(()=>{const n=this.queue.indexOf(t);if(n>=0){this.queue.splice(n,1)}t.reject(mS)});this.queue.push(t);return t.promise}};G8i=class{static{ee(this,"ParserWorker")}get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,t,n,r){this.onReadyEmitter=new VRe.Emitter;this.deferred=new tP;this._ready=true;this._parsing=false;this.sendMessage=e;this._terminate=r;t(i=>{const o=i;this.deferred.resolve(o);this.unlock()});n(i=>{this.deferred.reject(i);this.unlock()})}terminate(){this.deferred.reject(mS);this._terminate()}lock(){this._ready=false}unlock(){this._parsing=false;this._ready=true;this.onReadyEmitter.fire()}parse(e){if(this._parsing){throw new Error("Parser worker is busy")}this._parsing=true;this.deferred=new tP;this.sendMessage(e);return this.deferred.promise}};OFn=class{static{ee(this,"DefaultWorkspaceLock")}constructor(){this.previousTokenSource=new cd.CancellationTokenSource;this.writeQueue=[];this.readQueue=[];this.done=true}write(e){this.cancelWrite();const t=BRe();this.previousTokenSource=t;return this.enqueue(this.writeQueue,e,t.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,t,n=cd.CancellationToken.None){const r=new tP;const i={action:t,deferred:r,cancellationToken:n};e.push(i);this.performNextOperation();return r.promise}async performNextOperation(){if(!this.done){return}const e=[];if(this.writeQueue.length>0){e.push(this.writeQueue.shift())}else if(this.readQueue.length>0){e.push(...this.readQueue.splice(0,this.readQueue.length))}else{return}this.done=false;await Promise.all(e.map(async({action:t,deferred:n,cancellationToken:r})=>{try{const i=await Promise.resolve().then(()=>t(r));n.resolve(i)}catch(i){if(N6(i)){n.resolve(void 0)}else{n.reject(i)}}}));this.done=true;this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}};BFn=class{static{ee(this,"DefaultHydrator")}constructor(e){this.grammarElementIdMap=new Pke;this.tokenTypeIdMap=new Pke;this.grammar=e.Grammar;this.lexer=e.parser.Lexer;this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(t=>({...t,message:t.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const t=new Map;const n=new Map;for(const r of $w(e)){t.set(r,{})}if(e.$cstNode){for(const r of XG(e.$cstNode)){n.set(r,{})}}return{astNodes:t,cstNodes:n}}dehydrateAstNode(e,t){const n=t.astNodes.get(e);n.$type=e.$type;n.$containerIndex=e.$containerIndex;n.$containerProperty=e.$containerProperty;if(e.$cstNode!==void 0){n.$cstNode=this.dehydrateCstNode(e.$cstNode,t)}for(const[r,i]of Object.entries(e)){if(r.startsWith("$")){continue}if(Array.isArray(i)){const o=[];n[r]=o;for(const a of i){if(ip(a)){o.push(this.dehydrateAstNode(a,t))}else if(ob(a)){o.push(this.dehydrateReference(a,t))}else{o.push(a)}}}else if(ip(i)){n[r]=this.dehydrateAstNode(i,t)}else if(ob(i)){n[r]=this.dehydrateReference(i,t)}else if(i!==void 0){n[r]=i}}return n}dehydrateReference(e,t){const n={};n.$refText=e.$refText;if(e.$refNode){n.$refNode=t.cstNodes.get(e.$refNode)}return n}dehydrateCstNode(e,t){const n=t.cstNodes.get(e);if(Bke(e)){n.fullText=e.fullText}else{n.grammarSource=this.getGrammarElementId(e.grammarSource)}n.hidden=e.hidden;n.astNode=t.astNodes.get(e.astNode);if(qR(e)){n.content=e.content.map(r=>this.dehydrateCstNode(r,t))}else if(y6(e)){n.tokenType=e.tokenType.name;n.offset=e.offset;n.length=e.length;n.startLine=e.range.start.line;n.startColumn=e.range.start.character;n.endLine=e.range.end.line;n.endColumn=e.range.end.character}return n}hydrate(e){const t=e.value;const n=this.createHydrationContext(t);if("$cstNode"in t){this.hydrateCstNode(t.$cstNode,n)}return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(t,n)}}createHydrationContext(e){const t=new Map;const n=new Map;for(const i of $w(e)){t.set(i,{})}let r;if(e.$cstNode){for(const i of XG(e.$cstNode)){let o;if("fullText"in i){o=new gat(i.fullText);r=o}else if("content"in i){o=new LRe}else if("tokenType"in i){o=this.hydrateCstLeafNode(i)}if(o){n.set(i,o);o.root=r}}}return{astNodes:t,cstNodes:n}}hydrateAstNode(e,t){const n=t.astNodes.get(e);n.$type=e.$type;n.$containerIndex=e.$containerIndex;n.$containerProperty=e.$containerProperty;if(e.$cstNode){n.$cstNode=t.cstNodes.get(e.$cstNode)}for(const[r,i]of Object.entries(e)){if(r.startsWith("$")){continue}if(Array.isArray(i)){const o=[];n[r]=o;for(const a of i){if(ip(a)){o.push(this.setParent(this.hydrateAstNode(a,t),n))}else if(ob(a)){o.push(this.hydrateReference(a,n,r,t))}else{o.push(a)}}}else if(ip(i)){n[r]=this.setParent(this.hydrateAstNode(i,t),n)}else if(ob(i)){n[r]=this.hydrateReference(i,n,r,t)}else if(i!==void 0){n[r]=i}}return n}setParent(e,t){e.$container=t;return e}hydrateReference(e,t,n,r){return this.linker.buildReference(t,n,r.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,t,n=0){const r=t.cstNodes.get(e);if(typeof e.grammarSource==="number"){r.grammarSource=this.getGrammarElement(e.grammarSource)}r.astNode=t.astNodes.get(e.astNode);if(qR(r)){for(const i of e.content){const o=this.hydrateCstNode(i,t,n++);r.content.push(o)}}return r}hydrateCstLeafNode(e){const t=this.getTokenType(e.tokenType);const n=e.offset;const r=e.length;const i=e.startLine;const o=e.startColumn;const a=e.endLine;const s=e.endColumn;const l=e.hidden;const u=new Cke(n,r,{start:{line:i,character:o},end:{line:a,character:s}},t,l);return u}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(!e){return void 0}if(this.grammarElementIdMap.size===0){this.createGrammarElementIdMap()}return this.grammarElementIdMap.get(e)}getGrammarElement(e){if(this.grammarElementIdMap.size===0){this.createGrammarElementIdMap()}const t=this.grammarElementIdMap.getKey(e);return t}createGrammarElementIdMap(){let e=0;for(const t of $w(this.grammar)){if(zke(t)){this.grammarElementIdMap.set(t,e++)}}}};ee(yc,"createDefaultCoreModule");ee(bc,"createDefaultSharedCoreModule");(function(e){e.merge=(t,n)=>QG(QG({},t),n)})(urt||(urt={}));ee(us,"inject");zFn=Symbol("isProxy");ee(Gat,"eagerLoad");ee(Hat,"_inject");ECn=Symbol();ee(drt,"_resolve");ee(QG,"_merge");frt={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]};(function(e){e["REGULAR"]="indentation-sensitive";e["IGNORE_INDENTATION"]="ignore-indentation"})(c6||(c6={}));UFn=class extends NRe{static{ee(this,"IndentationAwareTokenBuilder")}constructor(e=frt){super();this.indentationStack=[0];this.whitespaceRegExp=/[ \t]+/y;this.options={...frt,...e};this.indentTokenType=VG({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:false});this.dedentTokenType=VG({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:false})}buildTokens(e,t){const n=super.buildTokens(e,t);if(!$Re(n)){throw new Error("Invalid tokens built by default builder")}const{indentTokenName:r,dedentTokenName:i,whitespaceTokenName:o,ignoreIndentationDelimiters:a}=this.options;let s;let l;let u;const d=[];for(const f of n){for(const[h,m]of a){if(f.name===h){f.PUSH_MODE=c6.IGNORE_INDENTATION}else if(f.name===m){f.POP_MODE=true}}if(f.name===i){s=f}else if(f.name===r){l=f}else if(f.name===o){u=f}else{d.push(f)}}if(!s||!l||!u){throw new Error("Some indentation/whitespace tokens not found!")}if(a.length>0){const f={modes:{[c6.REGULAR]:[s,l,...d,u],[c6.IGNORE_INDENTATION]:[...d,u]},defaultMode:c6.REGULAR};return f}else{return[s,l,u,...d]}}flushLexingReport(e){const t=super.flushLexingReport(e);return{...t,remainingDedents:this.flushRemainingDedents(e)}}isStartOfLine(e,t){return t===0||"\r\n".includes(e[t-1])}matchWhitespace(e,t,n,r){this.whitespaceRegExp.lastIndex=t;const i=this.whitespaceRegExp.exec(e);return{currIndentLevel:i?.[0].length??0,prevIndentLevel:this.indentationStack.at(-1),match:i}}createIndentationTokenInstance(e,t,n,r){const i=this.getLineNumber(t,r);return lre(e,n,r,r+n.length,i,i,1,n.length)}getLineNumber(e,t){return e.substring(0,t).split(/\r\n|\r|\n/).length}indentMatcher(e,t,n,r){if(!this.isStartOfLine(e,t)){return null}const{currIndentLevel:i,prevIndentLevel:o,match:a}=this.matchWhitespace(e,t,n,r);if(i<=o){return null}this.indentationStack.push(i);return a}dedentMatcher(e,t,n,r){if(!this.isStartOfLine(e,t)){return null}const{currIndentLevel:i,prevIndentLevel:o,match:a}=this.matchWhitespace(e,t,n,r);if(i>=o){return null}const s=this.indentationStack.lastIndexOf(i);if(s===-1){this.diagnostics.push({severity:"error",message:`Invalid dedent level ${i} at offset: ${t}. Current indentation stack: ${this.indentationStack}`,offset:t,length:a?.[0]?.length??0,line:this.getLineNumber(e,t),column:1});return null}const l=this.indentationStack.length-s-1;const u=e.substring(0,t).match(/[\r\n]+$/)?.[0].length??1;for(let d=0;d1){t.push(this.createIndentationTokenInstance(this.dedentTokenType,e,"",e.length));this.indentationStack.pop()}this.indentationStack=[0];return t}};H8i=class extends Nat{static{ee(this,"IndentationAwareLexer")}constructor(e){super(e);if(e.parser.TokenBuilder instanceof UFn){this.indentationTokenBuilder=e.parser.TokenBuilder}else{throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}}tokenize(e,t=Fat){const n=super.tokenize(e);const r=n.report;if(t?.mode==="full"){n.tokens.push(...r.remainingDedents)}r.remainingDedents=[];const{indentTokenType:i,dedentTokenType:o}=this.indentationTokenBuilder;const a=i.tokenTypeIdx;const s=o.tokenTypeIdx;const l=[];const u=n.tokens.length-1;for(let d=0;d=0){l.push(n.tokens[u])}n.tokens=l;return n}};Wat={};mD(Wat,{AstUtils:()=>pit,BiMap:()=>Pke,Cancellation:()=>cd,ContextCache:()=>URe,CstUtils:()=>dit,DONE_RESULT:()=>ib,Deferred:()=>tP,Disposable:()=>d6,DisposableCache:()=>zRe,DocumentCache:()=>cFn,EMPTY_STREAM:()=>GG,ErrorWithLocation:()=>Yke,GrammarUtils:()=>Hit,MultiMap:()=>nP,OperationCancelled:()=>mS,Reduction:()=>kne,RegExpUtils:()=>Yit,SimpleCache:()=>Pat,StreamImpl:()=>pS,TreeStreamImpl:()=>HG,URI:()=>uv,UriTrie:()=>kat,UriUtils:()=>ab,WorkspaceCache:()=>Iat,assertCondition:()=>Wit,assertUnreachable:()=>gD,delayNextTick:()=>ORe,interruptAndCheck:()=>$m,isOperationCancelled:()=>N6,loadGrammarFromJson:()=>Gm,setInterruptionPeriod:()=>Cat,startCancelableOperation:()=>BRe,stream:()=>gu});Fke(Wat,VRe);VFn=class{static{ee(this,"EmptyFileSystemProvider")}stat(e){throw new Error("No file system is available.")}statSync(e){throw new Error("No file system is available.")}async exists(){return false}existsSync(){return false}readBinary(){throw new Error("No file system is available.")}readBinarySync(){throw new Error("No file system is available.")}readFile(){throw new Error("No file system is available.")}readFileSync(){throw new Error("No file system is available.")}async readDirectory(){return[]}readDirectorySync(){return[]}};Rc={fileSystemProvider:ee(()=>new VFn,"fileSystemProvider")};W8i={Grammar:ee(()=>void 0,"Grammar"),LanguageMetaData:ee(()=>({caseInsensitive:false,fileExtensions:[".langium"],languageId:"langium"}),"LanguageMetaData")};Y8i={AstReflection:ee(()=>new Fit,"AstReflection")};ee($Fn,"createMinimalGrammarServices");ee(Gm,"loadGrammarFromJson");Fke(Og,Wat);q8i=class{static{ee(this,"DefaultLangiumProfiler")}constructor(e){this.activeCategories=new Set;this.allCategories=new Set(["validating","parsing","linking"]);this.activeCategories=e??new Set(this.allCategories);this.records=new nP}isActive(e){return this.activeCategories.has(e)}start(...e){if(!e){this.activeCategories=new Set(this.allCategories)}else{e.forEach(t=>this.activeCategories.add(t))}}stop(...e){if(!e){this.activeCategories.clear()}else{e.forEach(t=>this.activeCategories.delete(t))}}createTask(e,t){if(!this.isActive(e)){throw new Error(`Category "${e}" is not active.`)}console.log(`Creating profiling task for '${e}.${t}'.`);return new GFn(n=>this.records.add(e,this.dumpRecord(e,n)),t)}dumpRecord(e,t){console.info(`Task ${e}.${t.identifier} executed in ${t.duration.toFixed(2)}ms and ended at ${t.date.toISOString()}`);const n=[];for(const o of t.entries.keys()){const a=t.entries.get(o);const s=a.reduce((l,u)=>l+u);n.push({name:`${t.identifier}.${o}`,count:a.length,duration:s})}const r=t.duration-n.map(o=>o.duration).reduce((o,a)=>o+a,0);n.push({name:t.identifier,count:1,duration:r});n.sort((o,a)=>a.duration-o.duration);function i(o){return Math.round(100*o)/100}ee(i,"Round");console.table(n.map(o=>{return{Element:o.name,Count:o.count,"Self %":i(100*o.duration/t.duration),"Time (ms)":i(o.duration)}}));return t}getRecords(...e){if(e.length===0){return this.records.values()}else{return this.records.entries().filter(t=>e.some(n=>n===t[0])).flatMap(t=>t[1])}}};GFn=class{static{ee(this,"ProfilingTask")}constructor(e,t){this.stack=[];this.entries=new nP;this.addRecord=e;this.identifier=t}start(){if(this.startTime!==void 0){throw new Error(`Task "${this.identifier}" is already started.`)}this.startTime=performance.now()}stop(){if(this.startTime===void 0){throw new Error(`Task "${this.identifier}" was not started.`)}if(this.stack.length!==0){throw new Error(`Task "${this.identifier}" cannot be stopped before sub-task(s): ${this.stack.map(t=>t.id).join(", ")}.`)}const e={identifier:this.identifier,date:new Date,duration:performance.now()-this.startTime,entries:this.entries};this.addRecord(e);this.startTime=void 0;this.entries.clear()}startSubTask(e){this.stack.push({id:e,start:performance.now(),content:0})}stopSubTask(e){const t=this.stack.pop();if(!t){throw new Error(`Task "${this.identifier}.${e}" was not started.`)}if(t.id!==e){throw new Error(`Sub-Task "${t.id}" is not already stopped.`)}const n=performance.now()-t.start;if(this.stack.at(-1)!==void 0){this.stack[this.stack.length-1].content+=n}const r=n-t.content;this.entries.add(e,r)}};(e=>{e.Terminals={ARROW_DIRECTION:/L|R|T|B/,ARROW_GROUP:/\{group\}/,ARROW_INTO:/<|>/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ARCH_ICON:/\([\w-:]+\)/,ARCH_TITLE:/\[(?:"([^"\\]|\\.)*"|'([^'\\]|\\.)*'|[\w ]+)\]/}})(hrt||(hrt={}));(e=>{e.Terminals={DOMAIN_NAME:/complex|complicated|clear|chaotic|confusion/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(prt||(prt={}));(e=>{e.Terminals={EM_ID:/[_a-zA-Z][\w_]*/,EM_FID:/\d{1,3}/,EM_DATA_INLINE:/\{(.*)\}|"(.*)"|'(.*)'/,EM_DATA_BLOCK:/\{[\t ]*\r?\n(?:[\S\s]*?\r?\n)?\}(?:\r?\n|(?!\S))/,EM_ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EM_ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,EM_TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,EM_WS:/\s+/,EM_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EM_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EM_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EM_ML_COMMENT:/\/\*[\s\S]*?\*\//,EM_SL_COMMENT:/\/\/[^\n\r]*/}})(mrt||(mrt={}));(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,REFERENCE:/\w([-\./\w]*[-\w])?/}})(grt||(grt={}));(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(yrt||(yrt={}));(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(brt||(brt={}));(e=>{e.Terminals={NUMBER_PIE:/(?:-?[0-9]+\.[0-9]+(?!\.))|(?:-?(0|[1-9][0-9]*)(?!\.))/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(xrt||(xrt={}));(e=>{e.Terminals={GRATICULE:/circle|polygon/,BOOLEAN:/true|false/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NUMBER:/(?:[0-9]+\.[0-9]+(?!\.))|(?:0|[1-9][0-9]*(?!\.))/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(vrt||(vrt={}));(e=>{e.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ABNF_RULENAME:/[A-Za-z][A-Za-z0-9-]*/,ABNF_STRING:/"[^"]*"/,ABNF_NUMVAL:/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\.[0-9A-Fa-f]+)*/,ABNF_REPEAT:/[0-9]*\*[0-9]*/,ABNF_EXACT_REPEAT:/[0-9]+/,ABNF_WHITESPACE:/[\t \r\n]+/,ABNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,ABNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,ABNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ABNF_COMMENT:/;[^\n\r]*/}})(_rt||(_rt={}));(e=>{e.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,EBNF_ID:/[A-Z_a-z][\w-]*/,EBNF_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,EBNF_SPECIAL_SEQUENCE:/\?(?=[^?;]*[^?\s;][^?;]*\?)[^?;]*\?/,EBNF_WHITESPACE:/[\t \r\n]+/,EBNF_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,EBNF_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,EBNF_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,EBNF_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//,EBNF_ISO_COMMENT:/\(\*[\s\S]*?\*\)/}})(Trt||(Trt={}));(e=>{e.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,RR_ID:/[A-Z_a-z][\w-]*/,RR_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,RR_WHITESPACE:/[\t \r\n]+/,RR_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,RR_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,RR_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,RR_BLOCK_COMMENT:/\/\*[\s\S]*?\*\//}})(wrt||(wrt={}));(e=>{e.Terminals={TITLE:/title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,ACC_TITLE:/accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,ACC_DESCR:/accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,PEG_ID:/[A-Z_a-z][\w-]*/,PEG_STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,PEG_WHITESPACE:/[\t \r\n]+/,PEG_YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,PEG_DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,PEG_SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,PEG_LINE_COMMENT:/#[^\n\r]*/}})(Ert||(Ert={}));(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,TREEMAP_KEYWORD:/treemap-beta|treemap/,CLASS_DEF:/classDef\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\s+([^;\r\n]*))?(?:;)?/,STYLE_SEPARATOR:/:::/,SEPARATOR:/:/,COMMA:/,/,INDENTATION:/[ \t]{1,}/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,ID2:/[a-zA-Z_][a-zA-Z0-9_]*/,NUMBER2:/[0-9_\.\,]+/,STRING2:/"[^"]*"|'[^']*'/}})(Crt||(Crt={}));(e=>{e.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,CLASS_ANNOTATION:/[ \t]+:::[ \t]*[A-Za-z_][\w-]*/,ICON_ANNOTATION:/[ \t]+icon\([\w-]*(?::[\w-]+)?\)/,DESC_ANNOTATION:/[ \t]+##[^\n\r]*/,INDENTATION:/[ \t]{1,}/,QUOTED_NAME:/"[^"]*"|'[^']*'/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,BARE_NAME:/(?!:::|icon\(|##)[^ \t\n\r"'](?:(?![ \t]+:::[ \t]*[A-Za-z_]|[ \t]+icon\(|[ \t]+##)[^\n\r])*/}})(Srt||(Srt={}));(e=>{e.Terminals={WARDLEY_NUMBER:/[0-9]+\.[0-9]+/,ARROW:/->/,LINK_PORT:/\+<>|\+>|\+|-\.->|>|\+'[^']*'<>|\+'[^']*'<|\+'[^']*'>/,LINK_LABEL:/;[^\n\r]+/,STRATEGY:/build|buy|outsource|market/,KW_WARDLEY:/wardley-beta/,KW_SIZE:/size/,KW_EVOLUTION:/evolution/,KW_ANCHOR:/anchor/,KW_COMPONENT:/component/,KW_LABEL:/label/,KW_INERTIA:/inertia/,KW_EVOLVE:/evolve/,KW_PIPELINE:/pipeline/,KW_NOTE:/note/,KW_ANNOTATIONS:/annotations/,KW_ANNOTATION:/annotation/,KW_ACCELERATOR:/accelerator/,KW_DEACCELERATOR:/deaccelerator/,NAME_WITH_SPACES:/(?!title\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/,WS:/[ \t]+/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(Art||(Art={}));qza={...hrt.Terminals,...prt.Terminals,...mrt.Terminals,...grt.Terminals,...yrt.Terminals,...brt.Terminals,...xrt.Terminals,...vrt.Terminals,..._rt.Terminals,...Trt.Terminals,...wrt.Terminals,...Ert.Terminals,...Srt.Terminals,...Crt.Terminals,...Art.Terminals};krt={$type:"AbnfAlternation",alternatives:"alternatives"};Rrt={$type:"AbnfConcatenation",elements:"elements"};BAe={$type:"AbnfElement",primary:"primary",repeat:"repeat"};Prt={$type:"AbnfGroup",element:"element"};Irt={$type:"AbnfNumVal",value:"value"};Mrt={$type:"AbnfOptionalGroup",element:"element"};FB={$type:"AbnfPrimary"};zAe={$type:"AbnfRule",definition:"definition",name:"name"};Lrt={$type:"AbnfRuleName",name:"name"};Drt={$type:"AbnfStringLiteral",value:"value"};oAe={$type:"Accelerator",name:"name",x:"x",y:"y"};ytt={$type:"Alignment",direction:"direction",members:"members"};aAe={$type:"Anchor",evolution:"evolution",name:"name",visibility:"visibility"};Yte={$type:"Annotation",number:"number",text:"text",x:"x",y:"y"};btt={$type:"Annotations",x:"x",y:"y"};Bw={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",alignments:"alignments",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};ee(HFn,"isArchitecture");sAe={$type:"Axis",label:"label",name:"name"};Ene={$type:"Branch",name:"name",order:"order"};ee(WFn,"isBranch");CCn={$type:"Checkout",branch:"branch"};lAe={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"};xtt={$type:"ClassDefStatement",className:"className",styleText:"styleText"};ZB={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};ee(YFn,"isCommit");cAe={$type:"Common",accDescr:"accDescr",accTitle:"accTitle",title:"title"};AB={$type:"Component",decorator:"decorator",evolution:"evolution",inertia:"inertia",label:"label",name:"name",visibility:"visibility"};uAe={$type:"Curve",entries:"entries",label:"label",name:"name"};sD={$type:"Cynefin",accDescr:"accDescr",accTitle:"accTitle",domains:"domains",title:"title",transitions:"transitions"};ee(qFn,"isCynefin");dAe={$type:"Deaccelerator",name:"name",x:"x",y:"y"};SCn={$type:"Decorator",strategy:"strategy"};bG={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"};Cne={$type:"DomainBlock",domain:"domain",items:"items"};ee(XFn,"isDomainBlock");Dke={$type:"DomainItem",label:"label"};ee(jFn,"isDomainItem");Frt={$type:"EbnfChoice",alternatives:"alternatives"};Nrt={$type:"EbnfExceptionPostfix",except:"except"};Ort={$type:"EbnfGroup",element:"element"};Brt={$type:"EbnfNonTerminal",name:"name"};zrt={$type:"EbnfOneOrMorePostfix",operator:"operator"};Urt={$type:"EbnfOptional",element:"element"};Vrt={$type:"EbnfOptionalPostfix",operator:"operator"};SG={$type:"EbnfPostfix"};QL={$type:"EbnfPrimary"};$rt={$type:"EbnfRepetition",element:"element"};UAe={$type:"EbnfRule",definition:"definition",name:"name"};Grt={$type:"EbnfSequence",elements:"elements"};Hrt={$type:"EbnfSpecial",text:"text"};VAe={$type:"EbnfTerm",base:"base",postfixes:"postfixes"};Wrt={$type:"EbnfTerminal",value:"value"};Yrt={$type:"EbnfZeroOrMorePostfix",operator:"operator"};sS={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"};NB={$type:"EmDataEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",name:"name"};eD={$type:"EmFrame"};qte={$type:"EmGwt",givenStatements:"givenStatements",sourceFrame:"sourceFrame",thenStatements:"thenStatements",whenStatements:"whenStatements"};ACn={$type:"EmGwtStatement",entityIdentifier:"entityIdentifier"};vtt={$type:"EmModelEntity",name:"name"};ee(KFn,"isEmModelEntityType");fAe={$type:"EmNoteEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",sourceFrame:"sourceFrame"};GR={$type:"EmResetFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"};ee(WRe,"isEmResetFrame");JL={$type:"EmTimeFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"};_tt={$type:"Entry",axis:"axis",value:"value"};cS={$type:"EventModel",accDescr:"accDescr",accTitle:"accTitle",dataEntities:"dataEntities",frames:"frames",gwtEntities:"gwtEntities",modelEntities:"modelEntities",noteEntities:"noteEntities",title:"title"};kCn={$type:"Evolution",stages:"stages"};hAe={$type:"EvolutionStage",boundary:"boundary",name:"name",secondName:"secondName"};Ttt={$type:"Evolve",component:"component",target:"target"};lD={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};ee(ZFn,"isGitGraph");Xte={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"};OG={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};ee(JFn,"isInfo");jte={$type:"Item",classSelector:"classSelector",name:"name"};wtt={$type:"Junction",id:"id",in:"in"};Kte={$type:"Label",negX:"negX",negY:"negY",offsetX:"offsetX",offsetY:"offsetY"};pAe={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"};kB={$type:"Link",arrow:"arrow",from:"from",fromPort:"fromPort",linkLabel:"linkLabel",to:"to",toPort:"toPort"};JB={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};ee(QFn,"isMerge");mAe={$type:"Note",evolution:"evolution",text:"text",visibility:"visibility"};Ett={$type:"Option",name:"name",value:"value"};QB={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};ee(e4n,"isPacket");e6={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};ee(t4n,"isPacketBlock");qrt={$type:"PegAny",dot:"dot"};Xrt={$type:"PegGroup",element:"element"};jrt={$type:"PegIdentifier",name:"name"};Krt={$type:"PegLiteral",value:"value"};Zrt={$type:"PegOrderedChoice",alternatives:"alternatives"};$Ae={$type:"PegPrefix",operator:"operator",suffix:"suffix"};AG={$type:"PegPrimary"};GAe={$type:"PegRule",definition:"definition",name:"name"};Jrt={$type:"PegSequence",elements:"elements"};HAe={$type:"PegSuffix",operator:"operator",primary:"primary"};cD={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};ee(n4n,"isPie");Sne={$type:"PieSection",label:"label",value:"value"};ee(r4n,"isPieSection");Ctt={$type:"Pipeline",components:"components",parent:"parent"};gAe={$type:"PipelineComponent",evolution:"evolution",label:"label",name:"name"};tD={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"};t6={$type:"Railroad",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};ee(i4n,"isRailroad");n6={$type:"RailroadAbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};ee(o4n,"isRailroadAbnf");Qrt={$type:"RailroadChoiceExpr",alternatives:"alternatives"};r6={$type:"RailroadEbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};ee(a4n,"isRailroadEbnf");uS={$type:"RailroadExpression"};eit={$type:"RailroadNonTerminalExpr",name:"name"};tit={$type:"RailroadOneOrMoreExpr",element:"element"};nit={$type:"RailroadOptionalExpr",element:"element"};i6={$type:"RailroadPeg",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};ee(s4n,"isRailroadPeg");WAe={$type:"RailroadRule",definition:"definition",name:"name"};rit={$type:"RailroadSequenceExpr",elements:"elements"};iit={$type:"RailroadSpecialExpr",text:"text"};oit={$type:"RailroadTerminalExpr",value:"value"};ait={$type:"RailroadZeroOrMoreExpr",element:"element"};Stt={$type:"Section",classSelector:"classSelector",name:"name"};xG={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"};Att={$type:"Size",height:"height",width:"width"};OB={$type:"Statement"};BG={$type:"Transition",from:"from",label:"label",to:"to"};ee(l4n,"isTransition");o6={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};ee(c4n,"isTreemap");ktt={$type:"TreemapRow",indent:"indent",item:"item"};BB={$type:"TreeNode",classAnnotation:"classAnnotation",descAnnotation:"descAnnotation",iconAnnotation:"iconAnnotation",indent:"indent",name:"name"};kG={$type:"TreeView",accDescr:"accDescr",accTitle:"accTitle",nodes:"nodes",title:"title"};Um={$type:"Wardley",accDescr:"accDescr",accelerators:"accelerators",accTitle:"accTitle",anchors:"anchors",annotation:"annotation",annotations:"annotations",components:"components",deaccelerators:"deaccelerators",evolution:"evolution",evolves:"evolves",links:"links",notes:"notes",pipelines:"pipelines",size:"size",title:"title"};ee(u4n,"isWardley");d4n=class extends hit{constructor(){super(...arguments);this.types={AbnfAlternation:{name:krt.$type,properties:{alternatives:{name:krt.alternatives,defaultValue:[]}},superTypes:[]},AbnfConcatenation:{name:Rrt.$type,properties:{elements:{name:Rrt.elements,defaultValue:[]}},superTypes:[]},AbnfElement:{name:BAe.$type,properties:{primary:{name:BAe.primary},repeat:{name:BAe.repeat}},superTypes:[]},AbnfGroup:{name:Prt.$type,properties:{element:{name:Prt.element}},superTypes:[FB.$type]},AbnfNumVal:{name:Irt.$type,properties:{value:{name:Irt.value}},superTypes:[FB.$type]},AbnfOptionalGroup:{name:Mrt.$type,properties:{element:{name:Mrt.element}},superTypes:[FB.$type]},AbnfPrimary:{name:FB.$type,properties:{},superTypes:[]},AbnfRule:{name:zAe.$type,properties:{definition:{name:zAe.definition},name:{name:zAe.name}},superTypes:[]},AbnfRuleName:{name:Lrt.$type,properties:{name:{name:Lrt.name}},superTypes:[FB.$type]},AbnfStringLiteral:{name:Drt.$type,properties:{value:{name:Drt.value}},superTypes:[FB.$type]},Accelerator:{name:oAe.$type,properties:{name:{name:oAe.name},x:{name:oAe.x},y:{name:oAe.y}},superTypes:[]},Alignment:{name:ytt.$type,properties:{direction:{name:ytt.direction},members:{name:ytt.members,defaultValue:[]}},superTypes:[]},Anchor:{name:aAe.$type,properties:{evolution:{name:aAe.evolution},name:{name:aAe.name},visibility:{name:aAe.visibility}},superTypes:[]},Annotation:{name:Yte.$type,properties:{number:{name:Yte.number},text:{name:Yte.text},x:{name:Yte.x},y:{name:Yte.y}},superTypes:[]},Annotations:{name:btt.$type,properties:{x:{name:btt.x},y:{name:btt.y}},superTypes:[]},Architecture:{name:Bw.$type,properties:{accDescr:{name:Bw.accDescr},accTitle:{name:Bw.accTitle},alignments:{name:Bw.alignments,defaultValue:[]},edges:{name:Bw.edges,defaultValue:[]},groups:{name:Bw.groups,defaultValue:[]},junctions:{name:Bw.junctions,defaultValue:[]},services:{name:Bw.services,defaultValue:[]},title:{name:Bw.title}},superTypes:[]},Axis:{name:sAe.$type,properties:{label:{name:sAe.label},name:{name:sAe.name}},superTypes:[]},Branch:{name:Ene.$type,properties:{name:{name:Ene.name},order:{name:Ene.order}},superTypes:[OB.$type]},Checkout:{name:CCn.$type,properties:{branch:{name:CCn.branch}},superTypes:[OB.$type]},CherryPicking:{name:lAe.$type,properties:{id:{name:lAe.id},parent:{name:lAe.parent},tags:{name:lAe.tags,defaultValue:[]}},superTypes:[OB.$type]},ClassDefStatement:{name:xtt.$type,properties:{className:{name:xtt.className},styleText:{name:xtt.styleText}},superTypes:[]},Commit:{name:ZB.$type,properties:{id:{name:ZB.id},message:{name:ZB.message},tags:{name:ZB.tags,defaultValue:[]},type:{name:ZB.type}},superTypes:[OB.$type]},Common:{name:cAe.$type,properties:{accDescr:{name:cAe.accDescr},accTitle:{name:cAe.accTitle},title:{name:cAe.title}},superTypes:[]},Component:{name:AB.$type,properties:{decorator:{name:AB.decorator},evolution:{name:AB.evolution},inertia:{name:AB.inertia,defaultValue:false},label:{name:AB.label},name:{name:AB.name},visibility:{name:AB.visibility}},superTypes:[]},Curve:{name:uAe.$type,properties:{entries:{name:uAe.entries,defaultValue:[]},label:{name:uAe.label},name:{name:uAe.name}},superTypes:[]},Cynefin:{name:sD.$type,properties:{accDescr:{name:sD.accDescr},accTitle:{name:sD.accTitle},domains:{name:sD.domains,defaultValue:[]},title:{name:sD.title},transitions:{name:sD.transitions,defaultValue:[]}},superTypes:[]},Deaccelerator:{name:dAe.$type,properties:{name:{name:dAe.name},x:{name:dAe.x},y:{name:dAe.y}},superTypes:[]},Decorator:{name:SCn.$type,properties:{strategy:{name:SCn.strategy}},superTypes:[]},Direction:{name:bG.$type,properties:{accDescr:{name:bG.accDescr},accTitle:{name:bG.accTitle},dir:{name:bG.dir},statements:{name:bG.statements,defaultValue:[]},title:{name:bG.title}},superTypes:[lD.$type]},DomainBlock:{name:Cne.$type,properties:{domain:{name:Cne.domain},items:{name:Cne.items,defaultValue:[]}},superTypes:[]},DomainItem:{name:Dke.$type,properties:{label:{name:Dke.label}},superTypes:[]},EbnfChoice:{name:Frt.$type,properties:{alternatives:{name:Frt.alternatives,defaultValue:[]}},superTypes:[]},EbnfExceptionPostfix:{name:Nrt.$type,properties:{except:{name:Nrt.except}},superTypes:[SG.$type]},EbnfGroup:{name:Ort.$type,properties:{element:{name:Ort.element}},superTypes:[QL.$type]},EbnfNonTerminal:{name:Brt.$type,properties:{name:{name:Brt.name}},superTypes:[QL.$type]},EbnfOneOrMorePostfix:{name:zrt.$type,properties:{operator:{name:zrt.operator}},superTypes:[SG.$type]},EbnfOptional:{name:Urt.$type,properties:{element:{name:Urt.element}},superTypes:[QL.$type]},EbnfOptionalPostfix:{name:Vrt.$type,properties:{operator:{name:Vrt.operator}},superTypes:[SG.$type]},EbnfPostfix:{name:SG.$type,properties:{},superTypes:[]},EbnfPrimary:{name:QL.$type,properties:{},superTypes:[]},EbnfRepetition:{name:$rt.$type,properties:{element:{name:$rt.element}},superTypes:[QL.$type]},EbnfRule:{name:UAe.$type,properties:{definition:{name:UAe.definition},name:{name:UAe.name}},superTypes:[]},EbnfSequence:{name:Grt.$type,properties:{elements:{name:Grt.elements,defaultValue:[]}},superTypes:[]},EbnfSpecial:{name:Hrt.$type,properties:{text:{name:Hrt.text}},superTypes:[QL.$type]},EbnfTerm:{name:VAe.$type,properties:{base:{name:VAe.base},postfixes:{name:VAe.postfixes,defaultValue:[]}},superTypes:[]},EbnfTerminal:{name:Wrt.$type,properties:{value:{name:Wrt.value}},superTypes:[QL.$type]},EbnfZeroOrMorePostfix:{name:Yrt.$type,properties:{operator:{name:Yrt.operator}},superTypes:[SG.$type]},Edge:{name:sS.$type,properties:{lhsDir:{name:sS.lhsDir},lhsGroup:{name:sS.lhsGroup,defaultValue:false},lhsId:{name:sS.lhsId},lhsInto:{name:sS.lhsInto,defaultValue:false},rhsDir:{name:sS.rhsDir},rhsGroup:{name:sS.rhsGroup,defaultValue:false},rhsId:{name:sS.rhsId},rhsInto:{name:sS.rhsInto,defaultValue:false},title:{name:sS.title}},superTypes:[]},EmDataEntity:{name:NB.$type,properties:{dataBlockValue:{name:NB.dataBlockValue},dataType:{name:NB.dataType},name:{name:NB.name}},superTypes:[]},EmFrame:{name:eD.$type,properties:{},superTypes:[]},EmGwt:{name:qte.$type,properties:{givenStatements:{name:qte.givenStatements,defaultValue:[]},sourceFrame:{name:qte.sourceFrame,referenceType:eD.$type},thenStatements:{name:qte.thenStatements,defaultValue:[]},whenStatements:{name:qte.whenStatements,defaultValue:[]}},superTypes:[]},EmGwtStatement:{name:ACn.$type,properties:{entityIdentifier:{name:ACn.entityIdentifier,referenceType:vtt.$type}},superTypes:[]},EmModelEntity:{name:vtt.$type,properties:{name:{name:vtt.name}},superTypes:[]},EmNoteEntity:{name:fAe.$type,properties:{dataBlockValue:{name:fAe.dataBlockValue},dataType:{name:fAe.dataType},sourceFrame:{name:fAe.sourceFrame,referenceType:eD.$type}},superTypes:[]},EmResetFrame:{name:GR.$type,properties:{dataInlineValue:{name:GR.dataInlineValue},dataReference:{name:GR.dataReference,referenceType:NB.$type},dataType:{name:GR.dataType},entityIdentifier:{name:GR.entityIdentifier},modelEntityType:{name:GR.modelEntityType},name:{name:GR.name},sourceFrames:{name:GR.sourceFrames,defaultValue:[],referenceType:eD.$type}},superTypes:[eD.$type]},EmTimeFrame:{name:JL.$type,properties:{dataInlineValue:{name:JL.dataInlineValue},dataReference:{name:JL.dataReference,referenceType:NB.$type},dataType:{name:JL.dataType},entityIdentifier:{name:JL.entityIdentifier},modelEntityType:{name:JL.modelEntityType},name:{name:JL.name},sourceFrames:{name:JL.sourceFrames,defaultValue:[],referenceType:eD.$type}},superTypes:[eD.$type]},Entry:{name:_tt.$type,properties:{axis:{name:_tt.axis,referenceType:sAe.$type},value:{name:_tt.value}},superTypes:[]},EventModel:{name:cS.$type,properties:{accDescr:{name:cS.accDescr},accTitle:{name:cS.accTitle},dataEntities:{name:cS.dataEntities,defaultValue:[]},frames:{name:cS.frames,defaultValue:[]},gwtEntities:{name:cS.gwtEntities,defaultValue:[]},modelEntities:{name:cS.modelEntities,defaultValue:[]},noteEntities:{name:cS.noteEntities,defaultValue:[]},title:{name:cS.title}},superTypes:[]},Evolution:{name:kCn.$type,properties:{stages:{name:kCn.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:hAe.$type,properties:{boundary:{name:hAe.boundary},name:{name:hAe.name},secondName:{name:hAe.secondName}},superTypes:[]},Evolve:{name:Ttt.$type,properties:{component:{name:Ttt.component},target:{name:Ttt.target}},superTypes:[]},GitGraph:{name:lD.$type,properties:{accDescr:{name:lD.accDescr},accTitle:{name:lD.accTitle},statements:{name:lD.statements,defaultValue:[]},title:{name:lD.title}},superTypes:[]},Group:{name:Xte.$type,properties:{icon:{name:Xte.icon},id:{name:Xte.id},in:{name:Xte.in},title:{name:Xte.title}},superTypes:[]},Info:{name:OG.$type,properties:{accDescr:{name:OG.accDescr},accTitle:{name:OG.accTitle},title:{name:OG.title}},superTypes:[]},Item:{name:jte.$type,properties:{classSelector:{name:jte.classSelector},name:{name:jte.name}},superTypes:[]},Junction:{name:wtt.$type,properties:{id:{name:wtt.id},in:{name:wtt.in}},superTypes:[]},Label:{name:Kte.$type,properties:{negX:{name:Kte.negX,defaultValue:false},negY:{name:Kte.negY,defaultValue:false},offsetX:{name:Kte.offsetX},offsetY:{name:Kte.offsetY}},superTypes:[]},Leaf:{name:pAe.$type,properties:{classSelector:{name:pAe.classSelector},name:{name:pAe.name},value:{name:pAe.value}},superTypes:[jte.$type]},Link:{name:kB.$type,properties:{arrow:{name:kB.arrow},from:{name:kB.from},fromPort:{name:kB.fromPort},linkLabel:{name:kB.linkLabel},to:{name:kB.to},toPort:{name:kB.toPort}},superTypes:[]},Merge:{name:JB.$type,properties:{branch:{name:JB.branch},id:{name:JB.id},tags:{name:JB.tags,defaultValue:[]},type:{name:JB.type}},superTypes:[OB.$type]},Note:{name:mAe.$type,properties:{evolution:{name:mAe.evolution},text:{name:mAe.text},visibility:{name:mAe.visibility}},superTypes:[]},Option:{name:Ett.$type,properties:{name:{name:Ett.name},value:{name:Ett.value,defaultValue:false}},superTypes:[]},Packet:{name:QB.$type,properties:{accDescr:{name:QB.accDescr},accTitle:{name:QB.accTitle},blocks:{name:QB.blocks,defaultValue:[]},title:{name:QB.title}},superTypes:[]},PacketBlock:{name:e6.$type,properties:{bits:{name:e6.bits},end:{name:e6.end},label:{name:e6.label},start:{name:e6.start}},superTypes:[]},PegAny:{name:qrt.$type,properties:{dot:{name:qrt.dot}},superTypes:[AG.$type]},PegGroup:{name:Xrt.$type,properties:{element:{name:Xrt.element}},superTypes:[AG.$type]},PegIdentifier:{name:jrt.$type,properties:{name:{name:jrt.name}},superTypes:[AG.$type]},PegLiteral:{name:Krt.$type,properties:{value:{name:Krt.value}},superTypes:[AG.$type]},PegOrderedChoice:{name:Zrt.$type,properties:{alternatives:{name:Zrt.alternatives,defaultValue:[]}},superTypes:[]},PegPrefix:{name:$Ae.$type,properties:{operator:{name:$Ae.operator},suffix:{name:$Ae.suffix}},superTypes:[]},PegPrimary:{name:AG.$type,properties:{},superTypes:[]},PegRule:{name:GAe.$type,properties:{definition:{name:GAe.definition},name:{name:GAe.name}},superTypes:[]},PegSequence:{name:Jrt.$type,properties:{elements:{name:Jrt.elements,defaultValue:[]}},superTypes:[]},PegSuffix:{name:HAe.$type,properties:{operator:{name:HAe.operator},primary:{name:HAe.primary}},superTypes:[]},Pie:{name:cD.$type,properties:{accDescr:{name:cD.accDescr},accTitle:{name:cD.accTitle},sections:{name:cD.sections,defaultValue:[]},showData:{name:cD.showData,defaultValue:false},title:{name:cD.title}},superTypes:[]},PieSection:{name:Sne.$type,properties:{label:{name:Sne.label},value:{name:Sne.value}},superTypes:[]},Pipeline:{name:Ctt.$type,properties:{components:{name:Ctt.components,defaultValue:[]},parent:{name:Ctt.parent}},superTypes:[]},PipelineComponent:{name:gAe.$type,properties:{evolution:{name:gAe.evolution},label:{name:gAe.label},name:{name:gAe.name}},superTypes:[]},Radar:{name:tD.$type,properties:{accDescr:{name:tD.accDescr},accTitle:{name:tD.accTitle},axes:{name:tD.axes,defaultValue:[]},curves:{name:tD.curves,defaultValue:[]},options:{name:tD.options,defaultValue:[]},title:{name:tD.title}},superTypes:[]},Railroad:{name:t6.$type,properties:{accDescr:{name:t6.accDescr},accTitle:{name:t6.accTitle},rules:{name:t6.rules,defaultValue:[]},title:{name:t6.title}},superTypes:[]},RailroadAbnf:{name:n6.$type,properties:{accDescr:{name:n6.accDescr},accTitle:{name:n6.accTitle},rules:{name:n6.rules,defaultValue:[]},title:{name:n6.title}},superTypes:[]},RailroadChoiceExpr:{name:Qrt.$type,properties:{alternatives:{name:Qrt.alternatives,defaultValue:[]}},superTypes:[uS.$type]},RailroadEbnf:{name:r6.$type,properties:{accDescr:{name:r6.accDescr},accTitle:{name:r6.accTitle},rules:{name:r6.rules,defaultValue:[]},title:{name:r6.title}},superTypes:[]},RailroadExpression:{name:uS.$type,properties:{},superTypes:[]},RailroadNonTerminalExpr:{name:eit.$type,properties:{name:{name:eit.name}},superTypes:[uS.$type]},RailroadOneOrMoreExpr:{name:tit.$type,properties:{element:{name:tit.element}},superTypes:[uS.$type]},RailroadOptionalExpr:{name:nit.$type,properties:{element:{name:nit.element}},superTypes:[uS.$type]},RailroadPeg:{name:i6.$type,properties:{accDescr:{name:i6.accDescr},accTitle:{name:i6.accTitle},rules:{name:i6.rules,defaultValue:[]},title:{name:i6.title}},superTypes:[]},RailroadRule:{name:WAe.$type,properties:{definition:{name:WAe.definition},name:{name:WAe.name}},superTypes:[]},RailroadSequenceExpr:{name:rit.$type,properties:{elements:{name:rit.elements,defaultValue:[]}},superTypes:[uS.$type]},RailroadSpecialExpr:{name:iit.$type,properties:{text:{name:iit.text}},superTypes:[uS.$type]},RailroadTerminalExpr:{name:oit.$type,properties:{value:{name:oit.value}},superTypes:[uS.$type]},RailroadZeroOrMoreExpr:{name:ait.$type,properties:{element:{name:ait.element}},superTypes:[uS.$type]},Section:{name:Stt.$type,properties:{classSelector:{name:Stt.classSelector},name:{name:Stt.name}},superTypes:[jte.$type]},Service:{name:xG.$type,properties:{icon:{name:xG.icon},iconText:{name:xG.iconText},id:{name:xG.id},in:{name:xG.in},title:{name:xG.title}},superTypes:[]},Size:{name:Att.$type,properties:{height:{name:Att.height},width:{name:Att.width}},superTypes:[]},Statement:{name:OB.$type,properties:{},superTypes:[]},Transition:{name:BG.$type,properties:{from:{name:BG.from},label:{name:BG.label},to:{name:BG.to}},superTypes:[]},TreeNode:{name:BB.$type,properties:{classAnnotation:{name:BB.classAnnotation},descAnnotation:{name:BB.descAnnotation},iconAnnotation:{name:BB.iconAnnotation},indent:{name:BB.indent},name:{name:BB.name}},superTypes:[]},TreeView:{name:kG.$type,properties:{accDescr:{name:kG.accDescr},accTitle:{name:kG.accTitle},nodes:{name:kG.nodes,defaultValue:[]},title:{name:kG.title}},superTypes:[]},Treemap:{name:o6.$type,properties:{accDescr:{name:o6.accDescr},accTitle:{name:o6.accTitle},title:{name:o6.title},TreemapRows:{name:o6.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:ktt.$type,properties:{indent:{name:ktt.indent},item:{name:ktt.item}},superTypes:[]},Wardley:{name:Um.$type,properties:{accDescr:{name:Um.accDescr},accelerators:{name:Um.accelerators,defaultValue:[]},accTitle:{name:Um.accTitle},anchors:{name:Um.anchors,defaultValue:[]},annotation:{name:Um.annotation,defaultValue:[]},annotations:{name:Um.annotations,defaultValue:[]},components:{name:Um.components,defaultValue:[]},deaccelerators:{name:Um.deaccelerators,defaultValue:[]},evolution:{name:Um.evolution},evolves:{name:Um.evolves,defaultValue:[]},links:{name:Um.links,defaultValue:[]},notes:{name:Um.notes,defaultValue:[]},pipelines:{name:Um.pipelines,defaultValue:[]},size:{name:Um.size},title:{name:Um.title}},superTypes:[]}}}static{ee(this,"MermaidAstReflection")}};vh=new d4n;X8i=ee(()=>RCn??(RCn=Gm(`{"$type":"Grammar","isDeclared":true,"name":"ArchitectureGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"alignments","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"LeftPort","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"RightPort","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Arrow","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Alignment","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"align"},{"$type":"Assignment","feature":"direction","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"row"},{"$type":"Keyword","value":"column"}]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@19"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@20"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[(?:\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'|[\\\\w ]+)\\\\]/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"ArchitectureGrammarGrammar");j8i=ee(()=>PCn??(PCn=Gm(`{"$type":"Grammar","isDeclared":true,"name":"CynefinGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Cynefin","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"cynefin-beta"},{"$type":"Keyword","value":"cynefin-beta:"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"domains","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"transitions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainBlock","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"domain","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"DomainItem","definition":{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Transition","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":"-->"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"DOMAIN_NAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complex"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"complicated"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"clear"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"chaotic"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"confusion"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"CynefinGrammarGrammar");K8i=ee(()=>ICn??(ICn=Gm('{"$type":"Grammar","isDeclared":true,"name":"EventModeling","interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"rules":[{"$type":"ParserRule","entry":true,"name":"EventModel","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"eventmodeling"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"frames","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"dataEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"noteEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"gwtEntities","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntityType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rmo"},{"$type":"Keyword","value":"readmodel"},{"$type":"Keyword","value":"ui"},{"$type":"Keyword","value":"cmd"},{"$type":"Keyword","value":"command"},{"$type":"Keyword","value":"evt"},{"$type":"Keyword","value":"event"},{"$type":"Keyword","value":"pcr"},{"$type":"Keyword","value":"processor"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"json"},{"$type":"Keyword","value":"jsobj"},{"$type":"Keyword","value":"figma"},{"$type":"Keyword","value":"salt"},{"$type":"Keyword","value":"uri"},{"$type":"Keyword","value":"md"},{"$type":"Keyword","value":"html"},{"$type":"Keyword","value":"text"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataInline","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataInlineValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"EmDataBlock","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"`"},{"$type":"Assignment","feature":"dataType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"`"}],"cardinality":"?"},{"$type":"Assignment","feature":"dataBlockValue","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"QualifiedName","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"."},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmTimeFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"tf"},{"$type":"Keyword","value":"timeframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmResetFrame","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rf"},{"$type":"Keyword","value":"resetframe"}]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"modelEntityType","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"->>"},{"$type":"Assignment","feature":"sourceFrames","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"dataReference","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@10"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"]]"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmFrame","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmModelEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"entity"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmDataEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"data"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmNoteEntity","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"note"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwt","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"gwt"},{"$type":"Assignment","feature":"sourceFrame","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@8"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"given"},{"$type":"Assignment","feature":"givenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"},{"$type":"Group","elements":[{"$type":"Keyword","value":"when"},{"$type":"Assignment","feature":"whenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}],"cardinality":"?"},{"$type":"Keyword","value":"then"},{"$type":"Assignment","feature":"thenStatements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"+"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EmGwtStatement","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},{"$type":"Assignment","feature":"entityIdentifier","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@9"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_EID","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EM_FI","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"EM_ID","definition":{"$type":"RegexToken","regex":"/[_a-zA-Z][\\\\w_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_FID","definition":{"$type":"RegexToken","regex":"/\\\\d{1,3}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_INLINE","definition":{"$type":"RegexToken","regex":"/\\\\{(.*)\\\\}|\\"(.*)\\"|\'(.*)\'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_DATA_BLOCK","definition":{"$type":"RegexToken","regex":"/\\\\{[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?\\\\}(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EM_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EM_WS","definition":{"$type":"RegexToken","regex":"/\\\\s+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EM_SL_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\/[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"imports":[],"types":[]}')),"EventModelingGrammar");Z8i=ee(()=>MCn??(MCn=Gm(`{"$type":"Grammar","isDeclared":true,"name":"GitGraphGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"GitGraph","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Direction","definition":{"$type":"Assignment","feature":"dir","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"LR"},{"$type":"Keyword","value":"TB"},{"$type":"Keyword","value":"BT"}]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@14"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"REFERENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"GitGraphGrammarGrammar");J8i=ee(()=>LCn??(LCn=Gm(`{"$type":"Grammar","isDeclared":true,"name":"InfoGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"?"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@7"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"InfoGrammarGrammar");Q8i=ee(()=>DCn??(DCn=Gm(`{"$type":"Grammar","isDeclared":true,"name":"PacketGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"packet"},{"$type":"Keyword","value":"packet-beta"}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}],"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"+"},{"$type":"Assignment","feature":"bits","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]}]},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@9"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PacketGrammarGrammar");e7i=ee(()=>FCn??(FCn=Gm(`{"$type":"Grammar","isDeclared":true,"name":"PieGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"FLOAT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?(0|[1-9][0-9]*)(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@2"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@3"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PieGrammarGrammar");t7i=ee(()=>NCn??(NCn=Gm(`{"$type":"Grammar","isDeclared":true,"name":"RadarGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":"radar-beta:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Option","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"showLegend"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"ticks"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"max"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"min"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"graticule"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@16"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@2"}},"isMulti":false}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"types":[]}`)),"RadarGrammarGrammar");n7i=ee(()=>OCn??(OCn=Gm('{"$type":"Grammar","isDeclared":true,"name":"RailroadAbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_RULENAME","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Za-z][A-Za-z0-9-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_NUMVAL","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/%[xXdDbB][0-9A-Fa-f]+(?:-[0-9A-Fa-f]+|\\\\.[0-9A-Fa-f]+)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]*\\\\*[0-9]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ABNF_EXACT_REPEAT","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ABNF_COMMENT","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadAbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-abnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfAlternation","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfConcatenation","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfElement","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"repeat","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfStringLiteral","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfNumVal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfRuleName","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AbnfOptionalGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadAbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfAlternation","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfConcatenation","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfElement","attributes":[{"$type":"TypeAttribute","name":"repeat","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"AbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"AbnfStringLiteral","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfNumVal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfRuleName","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"AbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"AbnfOptionalGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]}],"imports":[],"types":[]}')),"RailroadAbnfGrammarGrammar");r7i=ee(()=>BCn??(BCn=Gm(`{"$type":"Grammar","isDeclared":true,"name":"RailroadEbnfGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"EBNF_SPECIAL_SEQUENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\?(?=[^?;]*[^?\\\\s;][^?;]*\\\\?)[^?;]*\\\\?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"EBNF_ISO_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\(\\\\*[\\\\s\\\\S]*?\\\\*\\\\)/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadEbnf","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-ebnf-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"="},{"$type":"Keyword","value":"::="}]},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"|"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":",","cardinality":"?"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerm","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"base","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"postfixes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPrimary","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfTerminal","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfNonTerminal","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfSpecial","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfGroup","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptional","returnType":{"$ref":"#/interfaces@11"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfRepetition","returnType":{"$ref":"#/interfaces@12"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfPostfix","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOptionalPostfix","returnType":{"$ref":"#/interfaces@13"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfZeroOrMorePostfix","returnType":{"$ref":"#/interfaces@14"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfOneOrMorePostfix","returnType":{"$ref":"#/interfaces@15"},"definition":{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EbnfExceptionPostfix","returnType":{"$ref":"#/interfaces@16"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"except","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadEbnf","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfTerm","attributes":[{"$type":"TypeAttribute","name":"base","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false},{"$type":"TypeAttribute","name":"postfixes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"EbnfPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfPostfix","attributes":[],"superTypes":[]},{"$type":"Interface","name":"EbnfTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfNonTerminal","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfSpecial","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfGroup","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptional","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfRepetition","superTypes":[{"$ref":"#/interfaces@5"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"EbnfOptionalPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfZeroOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfOneOrMorePostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"operator","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"EbnfExceptionPostfix","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"except","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadEbnfGrammarGrammar");i7i=ee(()=>zCn??(zCn=Gm(`{"$type":"Grammar","isDeclared":true,"name":"RailroadGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"RR_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"RR_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"RR_BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"Railroad","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"="},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadExpression","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSequenceExpr","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"sequence"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadChoiceExpr","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"choice"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOptionalExpr","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"optional"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadOneOrMoreExpr","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"oneOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadZeroOrMoreExpr","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"zeroOrMore"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadTerminalExpr","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"terminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadNonTerminalExpr","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"nonterminal"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RailroadSpecialExpr","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"special"},{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"Railroad","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"RailroadExpression","attributes":[],"superTypes":[]},{"$type":"Interface","name":"RailroadSequenceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadChoiceExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOptionalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadOneOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadZeroOrMoreExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"RailroadTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadNonTerminalExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"RailroadSpecialExpr","superTypes":[{"$ref":"#/interfaces@2"}],"attributes":[{"$type":"TypeAttribute","name":"text","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadGrammarGrammar");o7i=ee(()=>UCn??(UCn=Gm(`{"$type":"Grammar","isDeclared":true,"name":"RailroadPegGrammar","rules":[{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[A-Z_a-z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PEG_STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t \\\\r\\\\n]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"PEG_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/#[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"ParserRule","entry":true,"name":"RailroadPeg","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"railroad-peg-beta"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegRule","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Keyword","value":"<-"},{"$type":"Assignment","feature":"definition","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":";"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegOrderedChoice","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"alternatives","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSequence","returnType":{"$ref":"#/interfaces@3"},"definition":{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrefix","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"&"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"!"}}],"cardinality":"?"},{"$type":"Assignment","feature":"suffix","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegSuffix","returnType":{"$ref":"#/interfaces@5"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"primary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"?"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"*"}},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"+"}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegPrimary","returnType":{"$ref":"#/interfaces@6"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegLiteral","returnType":{"$ref":"#/interfaces@7"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegIdentifier","returnType":{"$ref":"#/interfaces@8"},"definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegGroup","returnType":{"$ref":"#/interfaces@9"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PegAny","returnType":{"$ref":"#/interfaces@10"},"definition":{"$type":"Assignment","feature":"dot","operator":"=","terminal":{"$type":"Keyword","value":"."}},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"RailroadPeg","attributes":[{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"rules","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@1"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegRule","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"definition","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegOrderedChoice","attributes":[{"$type":"TypeAttribute","name":"alternatives","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@3"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSequence","attributes":[{"$type":"TypeAttribute","name":"elements","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@4"}}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegPrefix","attributes":[{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"suffix","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@5"}},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"PegSuffix","attributes":[{"$type":"TypeAttribute","name":"primary","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@6"}},"isOptional":false},{"$type":"TypeAttribute","name":"operator","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"PegPrimary","attributes":[],"superTypes":[]},{"$type":"Interface","name":"PegLiteral","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegIdentifier","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]},{"$type":"Interface","name":"PegGroup","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"element","type":{"$type":"SimpleType","typeRef":{"$ref":"#/interfaces@2"}},"isOptional":false}]},{"$type":"Interface","name":"PegAny","superTypes":[{"$ref":"#/interfaces@6"}],"attributes":[{"$type":"TypeAttribute","name":"dot","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}]}],"imports":[],"types":[]}`)),"RailroadPegGrammarGrammar");a7i=ee(()=>VCn??(VCn=Gm(`{"$type":"Grammar","isDeclared":true,"name":"TreemapGrammar","rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"Treemap","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"TreemapRows","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"TREEMAP_KEYWORD","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap-beta"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"CLASS_DEF","definition":{"$type":"RegexToken","regex":"/classDef\\\\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\\\\s+([^;\\\\r\\\\n]*))?(?:;)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STYLE_SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":::"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"COMMA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":","},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"TreemapRow","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"item","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ClassDef","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Item","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Section","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Leaf","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ID2","definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER2","definition":{"$type":"RegexToken","regex":"/[0-9_\\\\.\\\\,]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"MyNumber","dataType":"number","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"STRING2","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[{"$type":"Interface","name":"Item","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"classSelector","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"Section","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[]},{"$type":"Interface","name":"Leaf","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}]},{"$type":"Interface","name":"ClassDefStatement","attributes":[{"$type":"TypeAttribute","name":"className","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"styleText","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"Treemap","attributes":[{"$type":"TypeAttribute","name":"TreemapRows","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@15"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * Treemap grammar for Langium\\n * Converted from mindmap grammar\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treemap keyword, allowing for empty lines and comments before the\\n * treemap declaration.\\n */"}`)),"TreemapGrammarGrammar");s7i=ee(()=>$Cn??($Cn=Gm(`{"$type":"Grammar","isDeclared":true,"name":"TreeViewGrammar","rules":[{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"TreeView","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"treeView-beta"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"nodes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"CLASS_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+:::[ \\\\t]*[A-Za-z_][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ICON_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+icon\\\\([\\\\w-]*(?::[\\\\w-]+)?\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"DESC_ANNOTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+##[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"QUOTED_NAME","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"BARE_NAME","definition":{"$type":"RegexToken","regex":"/(?!:::|icon\\\\(|##)[^ \\\\t\\\\n\\\\r\\"'](?:(?![ \\\\t]+:::[ \\\\t]*[A-Za-z_]|[ \\\\t]+icon\\\\(|[ \\\\t]+##)[^\\\\n\\\\r])*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TreeNode","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"classAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"iconAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"descAnnotation","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]}],"interfaces":[{"$type":"Interface","name":"TreeView","attributes":[{"$type":"TypeAttribute","name":"nodes","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@14"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * TreeView grammar for Langium\\n *\\n * Supports both quoted labels (\\"my file\\") and bare labels (index.js).\\n * Annotations (:::class, icon(), ## description) are parsed directly into\\n * AST fields by the grammar. Value conversion for stripping quotes, extracting\\n * class names, icon names, and description text happens in valueConverter.ts.\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treeView keyword, allowing for empty lines and comments before the\\n * treeView declaration.\\n */"}`)),"TreeViewGrammarGrammar");l7i=ee(()=>GCn??(GCn=Gm(`{"$type":"Grammar","isDeclared":true,"name":"WardleyGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Wardley","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"size","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"anchors","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"links","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"evolves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"pipelines","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"notes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"annotations","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Assignment","feature":"annotation","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"accelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Assignment","feature":"deaccelerators","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Size","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"width","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"height","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolution","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"Assignment","feature":"stages","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EvolutionStage","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"@"},{"$type":"Assignment","feature":"boundary","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}],"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"/"},{"$type":"Assignment","feature":"secondName","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Anchor","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Component","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"decorator","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"inertia","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}},{"$type":"Keyword","value":")"}]}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Label","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"negX","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetX","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"negY","operator":"?=","terminal":{"$type":"Keyword","value":"-"},"cardinality":"?"},{"$type":"Assignment","feature":"offsetY","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Decorator","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"Assignment","feature":"strategy","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Link","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"fromPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"arrow","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"cardinality":"?"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"toPort","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"linkLabel","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Evolve","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]},{"$type":"Assignment","feature":"component","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Pipeline","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"components","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"+"},{"$type":"Keyword","value":"}"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PipelineComponent","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Note","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"visibility","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"evolution","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotations","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Annotation","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]},{"$type":"Assignment","feature":"number","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CoordinateValue","dataType":"number","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Accelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Deaccelerator","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}]}},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"x","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"y","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Keyword","value":"]"},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"WARDLEY_NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"->"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_PORT","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<>"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+>"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"+<"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_ARROW","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-->"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"-.->"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":">"},"parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'<>/","parenthesized":false}],"parenthesized":false},{"$type":"RegexToken","regex":"/\\\\+'[^']*'/","parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"LINK_LABEL","definition":{"$type":"RegexToken","regex":"/;[^\\\\n\\\\r]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRATEGY","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"build"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"buy"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"outsource"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"market"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_WARDLEY","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"wardley-beta"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_SIZE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"size"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLUTION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolution"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANCHOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"anchor"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_COMPONENT","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"component"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_LABEL","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"label"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_INERTIA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"inertia"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_EVOLVE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"evolve"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_PIPELINE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"pipeline"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_NOTE","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"note"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATIONS","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotations"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ANNOTATION","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"annotation"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_ACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"accelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"KW_DEACCELERATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"deaccelerator"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NAME_WITH_SPACES","definition":{"$type":"RegexToken","regex":"/(?!title\\\\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \\\\t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@47"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@48"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"WardleyGrammarGrammar");c7i={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:false,mode:"production"};u7i={languageId:"cynefin",fileExtensions:[".mmd",".mermaid"],caseInsensitive:false,mode:"production"};d7i={languageId:"eventmodeling",fileExtensions:[".mmd",".mermaid"],caseInsensitive:false,mode:"production"};f7i={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:false,mode:"production"};h7i={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:false,mode:"production"};p7i={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:false,mode:"production"};m7i={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:false,mode:"production"};g7i={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:false,mode:"production"};y7i={languageId:"railroadAbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:false,mode:"production"};b7i={languageId:"railroadEbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:false,mode:"production"};x7i={languageId:"railroad",fileExtensions:[".mmd",".mermaid"],caseInsensitive:false,mode:"production"};v7i={languageId:"railroadPeg",fileExtensions:[".mmd",".mermaid"],caseInsensitive:false,mode:"production"};_7i={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:false,mode:"production"};T7i={languageId:"treeView",fileExtensions:[".mmd",".mermaid"],caseInsensitive:false,mode:"production"};w7i={languageId:"wardley",fileExtensions:[".mmd",".mermaid"],caseInsensitive:false,mode:"production"};qc={AstReflection:ee(()=>new d4n,"AstReflection")};Yat={Grammar:ee(()=>X8i(),"Grammar"),LanguageMetaData:ee(()=>c7i,"LanguageMetaData"),parser:{}};qat={Grammar:ee(()=>j8i(),"Grammar"),LanguageMetaData:ee(()=>u7i,"LanguageMetaData"),parser:{}};Xat={Grammar:ee(()=>K8i(),"Grammar"),LanguageMetaData:ee(()=>d7i,"LanguageMetaData"),parser:{}};jat={Grammar:ee(()=>Z8i(),"Grammar"),LanguageMetaData:ee(()=>f7i,"LanguageMetaData"),parser:{}};Kat={Grammar:ee(()=>J8i(),"Grammar"),LanguageMetaData:ee(()=>h7i,"LanguageMetaData"),parser:{}};Zat={Grammar:ee(()=>Q8i(),"Grammar"),LanguageMetaData:ee(()=>p7i,"LanguageMetaData"),parser:{}};Jat={Grammar:ee(()=>e7i(),"Grammar"),LanguageMetaData:ee(()=>m7i,"LanguageMetaData"),parser:{}};Qat={Grammar:ee(()=>t7i(),"Grammar"),LanguageMetaData:ee(()=>g7i,"LanguageMetaData"),parser:{}};est={Grammar:ee(()=>n7i(),"Grammar"),LanguageMetaData:ee(()=>y7i,"LanguageMetaData"),parser:{}};tst={Grammar:ee(()=>r7i(),"Grammar"),LanguageMetaData:ee(()=>b7i,"LanguageMetaData"),parser:{}};nst={Grammar:ee(()=>i7i(),"Grammar"),LanguageMetaData:ee(()=>x7i,"LanguageMetaData"),parser:{}};rst={Grammar:ee(()=>o7i(),"Grammar"),LanguageMetaData:ee(()=>v7i,"LanguageMetaData"),parser:{}};ist={Grammar:ee(()=>a7i(),"Grammar"),LanguageMetaData:ee(()=>_7i,"LanguageMetaData"),parser:{}};ost={Grammar:ee(()=>s7i(),"Grammar"),LanguageMetaData:ee(()=>T7i,"LanguageMetaData"),parser:{}};ast={Grammar:ee(()=>l7i(),"Grammar"),LanguageMetaData:ee(()=>w7i,"LanguageMetaData"),parser:{}};E7i=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/;C7i=/accTitle[\t ]*:([^\n\r]*)/;S7i=/title([\t ][^\n\r]*|)/;A7i={ACC_DESCR:E7i,ACC_TITLE:C7i,TITLE:S7i};op=class extends Eat{static{ee(this,"AbstractMermaidValueConverter")}runConverter(e,t,n){let r=this.runCommonConverter(e,t,n);if(r===void 0){r=this.runCustomConverter(e,t,n)}if(r===void 0){return super.runConverter(e,t,n)}return r}runCommonConverter(e,t,n){const r=A7i[e.name];if(r===void 0){return void 0}const i=r.exec(t);if(i===null){return void 0}if(i[1]!==void 0){return i[1].trim().replace(/[\t ]{2,}/gm," ")}if(i[2]!==void 0){return i[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,"\n")}return void 0}};gv=class extends op{static{ee(this,"CommonValueConverter")}runCustomConverter(e,t,n){return void 0}};ru=class extends NRe{static{ee(this,"AbstractMermaidTokenBuilder")}constructor(e){super();this.keywords=new Set(e)}buildKeywordTokens(e,t,n){const r=super.buildKeywordTokens(e,t,n);r.forEach(i=>{if(this.keywords.has(i.name)&&i.PATTERN!==void 0){i.PATTERN=new RegExp(i.PATTERN.toString()+"(?:(?=%%)|(?!\\S))")}});return r}};k7i=class extends ru{static{ee(this,"CommonTokenBuilder")}};});function qRe(e=Rc){const t=us(bc(e),qc);const n=us(yc({shared:t}),Qat,YRe);t.ServiceRegistry.register(n);return{shared:t,Radar:n}}var R7i,YRe;var sst=Ce(()=>{Pc();R7i=class extends ru{static{ee(this,"RadarTokenBuilder")}constructor(){super(["radar-beta"])}};YRe={parser:{TokenBuilder:ee(()=>new R7i,"TokenBuilder"),ValueConverter:ee(()=>new gv,"ValueConverter")}};ee(qRe,"createRadarServices")});function uH(e=Rc){const t=us(bc(e),qc);const n=us(yc({shared:t}),nst,XRe);t.ServiceRegistry.register(n);return{shared:t,Railroad:n}}var P7i,f4n,I7i,XRe;var lst=Ce(()=>{Pc();P7i=class extends ru{static{ee(this,"RailroadTokenBuilder")}constructor(){super(["railroad-beta"])}};f4n=ee(e=>{const t=e.slice(1,-1);let n="";for(let r=0;rnew P7i,"TokenBuilder"),ValueConverter:ee(()=>new I7i,"ValueConverter")}};ee(uH,"createRailroadServices")});function dH(e=Rc){const t=us(bc(e),qc);const n=us(yc({shared:t}),tst,jRe);t.ServiceRegistry.register(n);return{shared:t,RailroadEbnf:n}}var M7i,h4n,L7i,jRe;var cst=Ce(()=>{Pc();M7i=class extends ru{static{ee(this,"RailroadEbnfTokenBuilder")}constructor(){super(["railroad-ebnf-beta"])}};h4n=ee(e=>{const t=e.slice(1,-1);let n="";for(let r=0;rnew M7i,"TokenBuilder"),ValueConverter:ee(()=>new L7i,"ValueConverter")}};ee(dH,"createRailroadEbnfServices")});function fH(e=Rc){const t=us(bc(e),qc);const n=us(yc({shared:t}),est,KRe);t.ServiceRegistry.register(n);return{shared:t,RailroadAbnf:n}}var D7i,F7i,KRe;var ust=Ce(()=>{Pc();D7i=class extends ru{static{ee(this,"RailroadAbnfTokenBuilder")}constructor(){super(["railroad-abnf-beta"])}};F7i=class extends op{static{ee(this,"RailroadAbnfValueConverter")}runConverter(e,t,n){const r=super.runConverter(e,t,n);if(e.name==="TITLE"&&typeof r==="string"){const i=r.trim();if(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'")){return i.slice(1,-1)}}return r}runCustomConverter(e,t,n){if(e.name==="ABNF_STRING"){return t.slice(1,-1)}return void 0}};KRe={parser:{TokenBuilder:ee(()=>new D7i,"TokenBuilder"),ValueConverter:ee(()=>new F7i,"ValueConverter")}};ee(fH,"createRailroadAbnfServices")});function hH(e=Rc){const t=us(bc(e),qc);const n=us(yc({shared:t}),rst,ZRe);t.ServiceRegistry.register(n);return{shared:t,RailroadPeg:n}}var N7i,p4n,O7i,ZRe;var dst=Ce(()=>{Pc();N7i=class extends ru{static{ee(this,"RailroadPegTokenBuilder")}constructor(){super(["railroad-peg-beta"])}};p4n=ee(e=>{const t=e.slice(1,-1);let n="";for(let r=0;rnew N7i,"TokenBuilder"),ValueConverter:ee(()=>new O7i,"ValueConverter")}};ee(hH,"createRailroadPegServices")});function m4n(e){const t=e.validation.TreemapValidator;const n=e.validation.ValidationRegistry;if(n){const r={Treemap:t.checkSingleRoot.bind(t)};n.register(r,t)}}function QRe(e=Rc){const t=us(bc(e),qc);const n=us(yc({shared:t}),ist,JRe);t.ServiceRegistry.register(n);m4n(n);return{shared:t,Treemap:n}}var B7i,z7i,U7i,V7i,JRe;var fst=Ce(()=>{Pc();B7i=class extends ru{static{ee(this,"TreemapTokenBuilder")}constructor(){super(["treemap"])}};z7i=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/;U7i=class extends op{static{ee(this,"TreemapValueConverter")}runCustomConverter(e,t,n){if(e.name==="NUMBER2"){return parseFloat(t.replace(/,/g,""))}else if(e.name==="SEPARATOR"){return t.substring(1,t.length-1)}else if(e.name==="STRING2"){return t.substring(1,t.length-1)}else if(e.name==="INDENTATION"){return t.length}else if(e.name==="ClassDef"){if(typeof t!=="string"){return t}const r=z7i.exec(t);if(r){return{$type:"ClassDefStatement",className:r[1],styleText:r[2]||void 0}}}return void 0}};ee(m4n,"registerValidationChecks");V7i=class{static{ee(this,"TreemapValidator")}checkSingleRoot(e,t){let n;for(const r of e.TreemapRows){if(!r.item){continue}if(n===void 0&&r.indent===void 0){n=0}else if(r.indent===void 0){t("error","Multiple root nodes are not allowed in a treemap.",{node:r,property:"item"})}else if(n!==void 0&&n>=parseInt(r.indent,10)){t("error","Multiple root nodes are not allowed in a treemap.",{node:r,property:"item"})}}}};JRe={parser:{TokenBuilder:ee(()=>new B7i,"TokenBuilder"),ValueConverter:ee(()=>new U7i,"ValueConverter")},validation:{TreemapValidator:ee(()=>new V7i,"TreemapValidator")}};ee(QRe,"createTreemapServices")});function tPe(e=Rc){const t=us(bc(e),qc);const n=us(yc({shared:t}),ast,ePe);t.ServiceRegistry.register(n);return{shared:t,Wardley:n}}var $7i,ePe;var hst=Ce(()=>{Pc();$7i=class extends op{static{ee(this,"WardleyValueConverter")}runCustomConverter(e,t,n){switch(e.name.toUpperCase()){case"LINK_LABEL":return t.substring(1).trim();default:return void 0}}};ePe={parser:{ValueConverter:ee(()=>new $7i,"ValueConverter")}};ee(tPe,"createWardleyServices")});function rPe(e=Rc){const t=us(bc(e),qc);const n=us(yc({shared:t}),qat,nPe);t.ServiceRegistry.register(n);return{shared:t,Cynefin:n}}var G7i,nPe;var pst=Ce(()=>{Pc();G7i=class extends ru{static{ee(this,"CynefinTokenBuilder")}constructor(){super(["cynefin-beta"])}};nPe={parser:{TokenBuilder:ee(()=>new G7i,"TokenBuilder"),ValueConverter:ee(()=>new gv,"ValueConverter")}};ee(rPe,"createCynefinServices")});function oPe(e=Rc){const t=us(bc(e),qc);const n=us(yc({shared:t}),jat,iPe);t.ServiceRegistry.register(n);return{shared:t,GitGraph:n}}var H7i,iPe;var mst=Ce(()=>{Pc();H7i=class extends ru{static{ee(this,"GitGraphTokenBuilder")}constructor(){super(["gitGraph"])}};iPe={parser:{TokenBuilder:ee(()=>new H7i,"TokenBuilder"),ValueConverter:ee(()=>new gv,"ValueConverter")}};ee(oPe,"createGitGraphServices")});function sPe(e=Rc){const t=us(bc(e),qc);const n=us(yc({shared:t}),Kat,aPe);t.ServiceRegistry.register(n);return{shared:t,Info:n}}var W7i,aPe;var gst=Ce(()=>{Pc();W7i=class extends ru{static{ee(this,"InfoTokenBuilder")}constructor(){super(["info","showInfo"])}};aPe={parser:{TokenBuilder:ee(()=>new W7i,"TokenBuilder"),ValueConverter:ee(()=>new gv,"ValueConverter")}};ee(sPe,"createInfoServices")});function cPe(e=Rc){const t=us(bc(e),qc);const n=us(yc({shared:t}),Zat,lPe);t.ServiceRegistry.register(n);return{shared:t,Packet:n}}var Y7i,lPe;var yst=Ce(()=>{Pc();Y7i=class extends ru{static{ee(this,"PacketTokenBuilder")}constructor(){super(["packet"])}};lPe={parser:{TokenBuilder:ee(()=>new Y7i,"TokenBuilder"),ValueConverter:ee(()=>new gv,"ValueConverter")}};ee(cPe,"createPacketServices")});function dPe(e=Rc){const t=us(bc(e),qc);const n=us(yc({shared:t}),Jat,uPe);t.ServiceRegistry.register(n);return{shared:t,Pie:n}}var q7i,X7i,uPe;var bst=Ce(()=>{Pc();q7i=class extends ru{static{ee(this,"PieTokenBuilder")}constructor(){super(["pie","showData"])}};X7i=class extends op{static{ee(this,"PieValueConverter")}runCustomConverter(e,t,n){if(e.name!=="PIE_SECTION_LABEL"){return void 0}return t.replace(/"/g,"").trim()}};uPe={parser:{TokenBuilder:ee(()=>new q7i,"TokenBuilder"),ValueConverter:ee(()=>new X7i,"ValueConverter")}};ee(dPe,"createPieServices")});function hPe(e=Rc){const t=us(bc(e),qc);const n=us(yc({shared:t}),ost,fPe);t.ServiceRegistry.register(n);return{shared:t,TreeView:n}}var j7i,K7i,fPe;var xst=Ce(()=>{Pc();j7i=class extends op{static{ee(this,"TreeViewValueConverter")}runCustomConverter(e,t,n){if(e.name==="INDENTATION"){return t?.length||0}if(e.name==="QUOTED_NAME"){return t.substring(1,t.length-1)}if(e.name==="BARE_NAME"){return t.replace(/[\t ]+$/,"")}if(e.name==="CLASS_ANNOTATION"){const r=t.trim();return r.substring(3).trim()}if(e.name==="ICON_ANNOTATION"){const r=t.trim();return r.substring(5,r.length-1)}if(e.name==="DESC_ANNOTATION"){const r=t.trim();return r.substring(2).trim()}return void 0}};K7i=class extends ru{static{ee(this,"TreeViewTokenBuilder")}constructor(){super(["treeView-beta"])}};fPe={parser:{TokenBuilder:ee(()=>new K7i,"TokenBuilder"),ValueConverter:ee(()=>new j7i,"ValueConverter")}};ee(hPe,"createTreeViewServices")});function mPe(e=Rc){const t=us(bc(e),qc);const n=us(yc({shared:t}),Yat,pPe);t.ServiceRegistry.register(n);return{shared:t,Architecture:n}}var Z7i,J7i,pPe;var vst=Ce(()=>{Pc();Z7i=class extends ru{static{ee(this,"ArchitectureTokenBuilder")}constructor(){super(["architecture"])}};J7i=class extends op{static{ee(this,"ArchitectureValueConverter")}runCustomConverter(e,t,n){if(e.name==="ARCH_ICON"){return t.replace(/[()]/g,"").trim()}else if(e.name==="ARCH_TEXT_ICON"){return t.replace(/["()]/g,"")}else if(e.name==="ARCH_TITLE"){let r=t.replace(/^\[|]$/g,"").trim();if(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'")){r=r.slice(1,-1);r=r.replace(/\\"/g,'"').replace(/\\'/g,"'")}return r.trim()}return void 0}};pPe={parser:{TokenBuilder:ee(()=>new Z7i,"TokenBuilder"),ValueConverter:ee(()=>new J7i,"ValueConverter")}};ee(mPe,"createArchitectureServices")});function v4n(e){const t=e.validation.EventModelingValidator;const n=e.validation.ValidationRegistry;if(n){const r={EmTimeFrame:t.checkSourceFrameTypes.bind(t),EmResetFrame:t.checkSourceFrameTypes.bind(t)};n.register(r,t)}}function yPe(e=Rc){const t=us(bc(e),qc);const n=us(yc({shared:t}),Xat,gPe);t.ServiceRegistry.register(n);v4n(n);return{shared:t,EventModel:n}}var Q7i,g4n,y4n,_st,b4n,x4n,ezi,gPe;var Tst=Ce(()=>{Pc();Q7i=class extends ru{static{ee(this,"EventModelingTokenBuilder")}constructor(){super(["eventmodeling"])}};g4n=new Set(["cmd","command"]);y4n=new Set(["evt","event"]);_st=new Set(["rmo","readmodel"]);b4n=new Set(["pcr","processor"]);x4n=new Set(["ui"]);ee(v4n,"registerValidationChecks");ezi=class{static{ee(this,"EventModelingValidator")}checkSourceFrameTypes(e,t){if(e.sourceFrames.length===0){return}if(g4n.has(e.modelEntityType)){this.validateSources(e,new Set([...x4n,...b4n]),"command","ui or processor",t)}else if(y4n.has(e.modelEntityType)){this.validateSources(e,g4n,"event","command",t)}else if(_st.has(e.modelEntityType)){this.validateSources(e,y4n,"read model","event",t)}else if(b4n.has(e.modelEntityType)){this.validateSources(e,_st,"processor","read model",t)}else if(x4n.has(e.modelEntityType)){this.validateSources(e,_st,"ui","read model",t)}}validateSources(e,t,n,r,i){for(const o of e.sourceFrames){const a=o.ref;if(a!==void 0&&!t.has(a.modelEntityType)){i("error",`A ${n} can only receive input from a ${r}, not from '${a.modelEntityType}'.`,{node:e,property:"sourceFrames"})}}}};gPe={parser:{TokenBuilder:ee(()=>new Q7i,"TokenBuilder"),ValueConverter:ee(()=>new gv,"ValueConverter")},validation:{EventModelingValidator:ee(()=>new ezi,"EventModelingValidator")}};ee(yPe,"createEventModelingServices")});var _4n={};Oo(_4n,{InfoModule:()=>aPe,createInfoServices:()=>sPe});var T4n=Ce(()=>{gst();Pc()});var w4n={};Oo(w4n,{PacketModule:()=>lPe,createPacketServices:()=>cPe});var E4n=Ce(()=>{yst();Pc()});var C4n={};Oo(C4n,{PieModule:()=>uPe,createPieServices:()=>dPe});var S4n=Ce(()=>{bst();Pc()});var A4n={};Oo(A4n,{TreeViewModule:()=>fPe,createTreeViewServices:()=>hPe});var k4n=Ce(()=>{xst();Pc()});var R4n={};Oo(R4n,{ArchitectureModule:()=>pPe,createArchitectureServices:()=>mPe});var P4n=Ce(()=>{vst();Pc()});var I4n={};Oo(I4n,{GitGraphModule:()=>iPe,createGitGraphServices:()=>oPe});var M4n=Ce(()=>{mst();Pc()});var L4n={};Oo(L4n,{EventModelingModule:()=>gPe,createEventModelingServices:()=>yPe});var D4n=Ce(()=>{Tst();Pc()});var F4n={};Oo(F4n,{RadarModule:()=>YRe,createRadarServices:()=>qRe});var N4n=Ce(()=>{sst();Pc()});var O4n={};Oo(O4n,{RailroadModule:()=>XRe,createRailroadServices:()=>uH});var B4n=Ce(()=>{lst();Pc()});var z4n={};Oo(z4n,{RailroadEbnfModule:()=>jRe,createRailroadEbnfServices:()=>dH});var U4n=Ce(()=>{cst();Pc()});var V4n={};Oo(V4n,{RailroadAbnfModule:()=>KRe,createRailroadAbnfServices:()=>fH});var $4n=Ce(()=>{ust();Pc()});var G4n={};Oo(G4n,{RailroadPegModule:()=>ZRe,createRailroadPegServices:()=>hH});var H4n=Ce(()=>{dst();Pc()});var W4n={};Oo(W4n,{TreemapModule:()=>JRe,createTreemapServices:()=>QRe});var Y4n=Ce(()=>{fst();Pc()});var q4n={};Oo(q4n,{WardleyModule:()=>ePe,createWardleyServices:()=>tPe});var X4n=Ce(()=>{hst();Pc()});var j4n={};Oo(j4n,{CynefinModule:()=>nPe,createCynefinServices:()=>rPe});var K4n=Ce(()=>{pst();Pc()});async function Pf(e,t){const n=tzi[e];if(!n){throw new Error(`Unknown diagram type: ${e}`)}if(!Bg[e]){await n()}const r=Bg[e];const i=r.parse(t);if(i.lexerErrors.length>0||i.parserErrors.length>0){throw new sP(i)}return i.value}var Bg,tzi,sP;var zg=Ce(()=>{sst();lst();cst();ust();dst();fst();hst();pst();mst();gst();yst();bst();xst();vst();Tst();Pc();Bg={};tzi={info:ee(async()=>{const{createInfoServices:e}=await Promise.resolve().then(()=>(T4n(),_4n));const t=e().Info.parser.LangiumParser;Bg.info=t},"info"),packet:ee(async()=>{const{createPacketServices:e}=await Promise.resolve().then(()=>(E4n(),w4n));const t=e().Packet.parser.LangiumParser;Bg.packet=t},"packet"),pie:ee(async()=>{const{createPieServices:e}=await Promise.resolve().then(()=>(S4n(),C4n));const t=e().Pie.parser.LangiumParser;Bg.pie=t},"pie"),treeView:ee(async()=>{const{createTreeViewServices:e}=await Promise.resolve().then(()=>(k4n(),A4n));const t=e().TreeView.parser.LangiumParser;Bg.treeView=t},"treeView"),architecture:ee(async()=>{const{createArchitectureServices:e}=await Promise.resolve().then(()=>(P4n(),R4n));const t=e().Architecture.parser.LangiumParser;Bg.architecture=t},"architecture"),gitGraph:ee(async()=>{const{createGitGraphServices:e}=await Promise.resolve().then(()=>(M4n(),I4n));const t=e().GitGraph.parser.LangiumParser;Bg.gitGraph=t},"gitGraph"),eventmodeling:ee(async()=>{const{createEventModelingServices:e}=await Promise.resolve().then(()=>(D4n(),L4n));const t=e().EventModel.parser.LangiumParser;Bg.eventmodeling=t},"eventmodeling"),radar:ee(async()=>{const{createRadarServices:e}=await Promise.resolve().then(()=>(N4n(),F4n));const t=e().Radar.parser.LangiumParser;Bg.radar=t},"radar"),railroad:ee(async()=>{const{createRailroadServices:e}=await Promise.resolve().then(()=>(B4n(),O4n));const t=e().Railroad.parser.LangiumParser;Bg.railroad=t},"railroad"),railroadEbnf:ee(async()=>{const{createRailroadEbnfServices:e}=await Promise.resolve().then(()=>(U4n(),z4n));const t=e().RailroadEbnf.parser.LangiumParser;Bg.railroadEbnf=t},"railroadEbnf"),railroadAbnf:ee(async()=>{const{createRailroadAbnfServices:e}=await Promise.resolve().then(()=>($4n(),V4n));const t=e().RailroadAbnf.parser.LangiumParser;Bg.railroadAbnf=t},"railroadAbnf"),railroadPeg:ee(async()=>{const{createRailroadPegServices:e}=await Promise.resolve().then(()=>(H4n(),G4n));const t=e().RailroadPeg.parser.LangiumParser;Bg.railroadPeg=t},"railroadPeg"),treemap:ee(async()=>{const{createTreemapServices:e}=await Promise.resolve().then(()=>(Y4n(),W4n));const t=e().Treemap.parser.LangiumParser;Bg.treemap=t},"treemap"),wardley:ee(async()=>{const{createWardleyServices:e}=await Promise.resolve().then(()=>(X4n(),q4n));const t=e().Wardley.parser.LangiumParser;Bg.wardley=t},"wardley"),cynefin:ee(async()=>{const{createCynefinServices:e}=await Promise.resolve().then(()=>(K4n(),j4n));const t=e().Cynefin.parser.LangiumParser;Bg.cynefin=t},"cynefin")};ee(Pf,"parse");sP=class extends Error{constructor(e){const t=e.lexerErrors.map(r=>{const i=r.line!==void 0&&!isNaN(r.line)?r.line:"?";const o=r.column!==void 0&&!isNaN(r.column)?r.column:"?";return`Lexer error on line ${i}, column ${o}: ${r.message}`}).join("\n");const n=e.parserErrors.map(r=>{const i=r.token.startLine!==void 0&&!isNaN(r.token.startLine)?r.token.startLine:"?";const o=r.token.startColumn!==void 0&&!isNaN(r.token.startColumn)?r.token.startColumn:"?";return`Parse error on line ${i}, column ${o}: ${r.message}`}).join("\n");super(`Parsing failed: ${t} ${n}`);this.result=e}static{ee(this,"MermaidParseError")}}});var aNn={};Oo(aNn,{diagram:()=>n9i});function vPe(){return Vje({length:7})}function J4n(e,t){const n=Object.create(null);return e.reduce((r,i)=>{const o=t(i);if(!n[o]){n[o]=true;r.push(i)}return r},[])}function wst(e,t,n){const r=e.indexOf(t);if(r===-1){e.push(n)}else{e.splice(r,1,n)}}function Cst(e){const t=e.reduce((i,o)=>{if(i.seq>o.seq){return i}return o},e[0]);let n="";e.forEach(function(i){if(i===t){n+=" *"}else{n+=" |"}});const r=[n,t.id,t.seq];for(const i in lo.records.branches){if(lo.records.branches.get(i)===t.id){r.push(i)}}wt.debug(r.join(" "));if(t.parents&&t.parents.length==2&&t.parents[0]&&t.parents[1]){const i=lo.records.commits.get(t.parents[0]);wst(e,t,i);if(t.parents[1]){e.push(lo.records.commits.get(t.parents[1]))}}else if(t.parents.length==0){return}else{if(t.parents[0]){const i=lo.records.commits.get(t.parents[0]);wst(e,t,i)}}e=J4n(e,i=>i.id);Cst(e)}var Ru,nzi,z6,lo,rzi,izi,ozi,azi,szi,lzi,czi,Q4n,uzi,dzi,fzi,hzi,pzi,eNn,mzi,gzi,yzi,tNn,bzi,xzi,vzi,_zi,Tzi,wzi,Ezi,Czi,vD,_D,wS,lP,O6,_Pe,Est,Sst,Szi,B6,Mx,Lx,bPe,fre,xPe,cP,Ll,Azi,nNn,rNn,kzi,Rzi,Pzi,Izi,Mzi,Lzi,Dzi,Fzi,Nzi,Ozi,Bzi,zzi,Z4n,Uzi,hre,Vzi,$zi,Gzi,Hzi,Wzi,Yzi,iNn,oNn,qzi,Xzi,jzi,Kzi,Zzi,Jzi,Qzi,e9i,t9i,n9i;var sNn=Ce(()=>{JSe();rb();nl();Ta();Aa();Yo();zg();ks();Ru={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4};nzi=ka.gitGraph;z6=B(()=>{const e=Cl({...nzi,...Ji().gitGraph});return e},"getConfig");lo=new yG(()=>{const e=z6();const t=e.mainBranchName;const n=e.mainBranchOrder;return{mainBranchName:t,commits:new Map,head:null,branchConfig:new Map([[t,{name:t,order:n}]]),branches:new Map([[t,null]]),currBranch:t,direction:"LR",seq:0,options:{}}});B(vPe,"getID");B(J4n,"uniqBy");rzi=B(function(e){lo.records.direction=e},"setDirection");izi=B(function(e){wt.debug("options str",e);e=e?.trim();e=e||"{}";try{lo.records.options=JSON.parse(e)}catch(t){wt.error("error while parsing gitGraph options",t.message)}},"setOptions");ozi=B(function(){return lo.records.options},"getOptions");azi=B(function(e){let t=e.msg;let n=e.id;const r=e.type;let i=e.tags;wt.info("commit",t,n,r,i);wt.debug("Entering commit:",t,n,r,i);const o=z6();n=Ti.sanitizeText(n,o);t=Ti.sanitizeText(t,o);i=i?.map(s=>Ti.sanitizeText(s,o));const a={id:n?n:lo.records.seq+"-"+vPe(),message:t,seq:lo.records.seq++,type:r??Ru.NORMAL,tags:i??[],parents:lo.records.head==null?[]:[lo.records.head.id],branch:lo.records.currBranch};lo.records.head=a;wt.info("main branch",o.mainBranchName);if(lo.records.commits.has(a.id)){wt.warn(`Commit ID ${a.id} already exists`)}lo.records.commits.set(a.id,a);lo.records.branches.set(lo.records.currBranch,a.id);wt.debug("in pushCommit "+a.id)},"commit");szi=B(function(e){let t=e.name;const n=e.order;t=Ti.sanitizeText(t,z6());if(lo.records.branches.has(t)){throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${t}")`)}lo.records.branches.set(t,lo.records.head!=null?lo.records.head.id:null);lo.records.branchConfig.set(t,{name:t,order:n});Q4n(t);wt.debug("in createBranch")},"branch");lzi=B(e=>{let t=e.branch;let n=e.id;const r=e.type;const i=e.tags;const o=z6();t=Ti.sanitizeText(t,o);if(n){n=Ti.sanitizeText(n,o)}const a=lo.records.branches.get(lo.records.currBranch);const s=lo.records.branches.get(t);const l=a?lo.records.commits.get(a):void 0;const u=s?lo.records.commits.get(s):void 0;if(l&&u&&l.branch===t){throw new Error(`Cannot merge branch '${t}' into itself.`)}if(lo.records.currBranch===t){const h=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');h.hash={text:`merge ${t}`,token:`merge ${t}`,expected:["branch abc"]};throw h}if(l===void 0||!l){const h=new Error(`Incorrect usage of "merge". Current branch (${lo.records.currBranch})has no commits`);h.hash={text:`merge ${t}`,token:`merge ${t}`,expected:["commit"]};throw h}if(!lo.records.branches.has(t)){const h=new Error('Incorrect usage of "merge". Branch to be merged ('+t+") does not exist");h.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`branch ${t}`]};throw h}if(u===void 0||!u){const h=new Error('Incorrect usage of "merge". Branch to be merged ('+t+") has no commits");h.hash={text:`merge ${t}`,token:`merge ${t}`,expected:['"commit"']};throw h}if(l===u){const h=new Error('Incorrect usage of "merge". Both branches have same head');h.hash={text:`merge ${t}`,token:`merge ${t}`,expected:["branch abc"]};throw h}if(n&&lo.records.commits.has(n)){const h=new Error('Incorrect usage of "merge". Commit with id:'+n+" already exists, use different custom id");h.hash={text:`merge ${t} ${n} ${r} ${i?.join(" ")}`,token:`merge ${t} ${n} ${r} ${i?.join(" ")}`,expected:[`merge ${t} ${n}_UNIQUE ${r} ${i?.join(" ")}`]};throw h}const d=s?s:"";const f={id:n||`${lo.records.seq}-${vPe()}`,message:`merged branch ${t} into ${lo.records.currBranch}`,seq:lo.records.seq++,parents:lo.records.head==null?[]:[lo.records.head.id,d],branch:lo.records.currBranch,type:Ru.MERGE,customType:r,customId:n?true:false,tags:i??[]};lo.records.head=f;lo.records.commits.set(f.id,f);lo.records.branches.set(lo.records.currBranch,f.id);wt.debug(lo.records.branches);wt.debug("in mergeBranch")},"merge");czi=B(function(e){let t=e.id;let n=e.targetId;let r=e.tags;let i=e.parent;wt.debug("Entering cherryPick:",t,n,r);const o=z6();t=Ti.sanitizeText(t,o);n=Ti.sanitizeText(n,o);r=r?.map(l=>Ti.sanitizeText(l,o));i=Ti.sanitizeText(i,o);if(!t||!lo.records.commits.has(t)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');l.hash={text:`cherryPick ${t} ${n}`,token:`cherryPick ${t} ${n}`,expected:["cherry-pick abc"]};throw l}const a=lo.records.commits.get(t);if(a===void 0||!a){throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided')}if(i&&!(Array.isArray(a.parents)&&a.parents.includes(i))){const l=new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");throw l}const s=a.branch;if(a.type===Ru.MERGE&&!i){const l=new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");throw l}if(!n||!lo.records.commits.has(n)){if(s===lo.records.currBranch){const f=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');f.hash={text:`cherryPick ${t} ${n}`,token:`cherryPick ${t} ${n}`,expected:["cherry-pick abc"]};throw f}const l=lo.records.branches.get(lo.records.currBranch);if(l===void 0||!l){const f=new Error(`Incorrect usage of "cherry-pick". Current branch (${lo.records.currBranch})has no commits`);f.hash={text:`cherryPick ${t} ${n}`,token:`cherryPick ${t} ${n}`,expected:["cherry-pick abc"]};throw f}const u=lo.records.commits.get(l);if(u===void 0||!u){const f=new Error(`Incorrect usage of "cherry-pick". Current branch (${lo.records.currBranch})has no commits`);f.hash={text:`cherryPick ${t} ${n}`,token:`cherryPick ${t} ${n}`,expected:["cherry-pick abc"]};throw f}const d={id:lo.records.seq+"-"+vPe(),message:`cherry-picked ${a?.message} into ${lo.records.currBranch}`,seq:lo.records.seq++,parents:lo.records.head==null?[]:[lo.records.head.id,a.id],branch:lo.records.currBranch,type:Ru.CHERRY_PICK,tags:r?r.filter(Boolean):[`cherry-pick:${a.id}${a.type===Ru.MERGE?`|parent:${i}`:""}`]};lo.records.head=d;lo.records.commits.set(d.id,d);lo.records.branches.set(lo.records.currBranch,d.id);wt.debug(lo.records.branches);wt.debug("in cherryPick")}},"cherryPick");Q4n=B(function(e){e=Ti.sanitizeText(e,z6());if(!lo.records.branches.has(e)){const t=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);t.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]};throw t}else{lo.records.currBranch=e;const t=lo.records.branches.get(lo.records.currBranch);if(t===void 0||!t){lo.records.head=null}else{lo.records.head=lo.records.commits.get(t)??null}}},"checkout");B(wst,"upsert");B(Cst,"prettyPrintCommitHistory");uzi=B(function(){wt.debug(lo.records.commits);const e=eNn()[0];Cst([e])},"prettyPrint");dzi=B(function(){lo.reset();Da()},"clear");fzi=B(function(){const e=[...lo.records.branchConfig.values()].map((t,n)=>{if(t.order!==null&&t.order!==void 0){return t}return{...t,order:parseFloat(`0.${n}`)}}).sort((t,n)=>(t.order??0)-(n.order??0)).map(({name:t})=>({name:t}));return e},"getBranchesAsObjArray");hzi=B(function(){return lo.records.branches},"getBranches");pzi=B(function(){return lo.records.commits},"getCommits");eNn=B(function(){const e=[...lo.records.commits.values()];e.forEach(function(t){wt.debug(t.id)});e.sort((t,n)=>t.seq-n.seq);return e},"getCommitsArray");mzi=B(function(){return lo.records.currBranch},"getCurrentBranch");gzi=B(function(){return lo.records.direction},"getDirection");yzi=B(function(){return lo.records.head},"getHead");tNn={commitType:Ru,getConfig:z6,setDirection:rzi,setOptions:izi,getOptions:ozi,commit:azi,branch:szi,merge:lzi,cherryPick:czi,checkout:Q4n,prettyPrint:uzi,clear:dzi,getBranchesAsObjArray:fzi,getBranches:hzi,getCommits:pzi,getCommitsArray:eNn,getCurrentBranch:mzi,getDirection:gzi,getHead:yzi,setAccTitle:Ka,getAccTitle:is,getAccDescription:as,setAccDescription:os,setDiagramTitle:ys,getDiagramTitle:ss};bzi=B((e,t)=>{mu(e,t);if(e.dir){t.setDirection(e.dir)}for(const n of e.statements){xzi(n,t)}},"populate");xzi=B((e,t)=>{const n={Commit:B(i=>t.commit(vzi(i)),"Commit"),Branch:B(i=>t.branch(_zi(i)),"Branch"),Merge:B(i=>t.merge(Tzi(i)),"Merge"),Checkout:B(i=>t.checkout(wzi(i)),"Checkout"),CherryPicking:B(i=>t.cherryPick(Ezi(i)),"CherryPicking")};const r=n[e.$type];if(r){r(e)}else{wt.error(`Unknown statement type: ${e.$type}`)}},"parseStatement");vzi=B(e=>{const t={id:e.id,msg:e.message??"",type:e.type!==void 0?Ru[e.type]:Ru.NORMAL,tags:e.tags??void 0};return t},"parseCommit");_zi=B(e=>{const t={name:e.name,order:e.order??0};return t},"parseBranch");Tzi=B(e=>{const t={branch:e.branch,id:e.id??"",type:e.type!==void 0?Ru[e.type]:void 0,tags:e.tags??void 0};return t},"parseMerge");wzi=B(e=>{const t=e.branch;return t},"parseCheckout");Ezi=B(e=>{const t={id:e.id,targetId:"",tags:e.tags?.length===0?void 0:e.tags,parent:e.parent};return t},"parseCherryPicking");Czi={parse:B(async e=>{const t=await Pf("gitGraph",e);wt.debug(t);bzi(t,tNn)},"parse")};if(void 0){const{it:e,expect:t,describe:n}=void 0;const r={commitType:Ru,setDirection:vi.fn(),commit:vi.fn(),branch:vi.fn(),merge:vi.fn(),cherryPick:vi.fn(),checkout:vi.fn()};n("GitGraph Parser",()=>{e("should parse a commit statement",()=>{const i={$type:"Commit",id:"1",message:"test",tags:["tag1","tag2"],type:"NORMAL"};xzi(i,r);t(r.commit).toHaveBeenCalledWith({id:"1",msg:"test",tags:["tag1","tag2"],type:0})});e("should parse a branch statement",()=>{const i={$type:"Branch",name:"newBranch",order:1};xzi(i,r);t(r.branch).toHaveBeenCalledWith({name:"newBranch",order:1})});e("should parse a checkout statement",()=>{const i={$type:"Checkout",branch:"newBranch"};xzi(i,r);t(r.checkout).toHaveBeenCalledWith("newBranch")});e("should parse a merge statement",()=>{const i={$type:"Merge",branch:"newBranch",id:"1",tags:["tag1","tag2"],type:"NORMAL"};xzi(i,r);t(r.merge).toHaveBeenCalledWith({branch:"newBranch",id:"1",tags:["tag1","tag2"],type:0})});e("should parse a cherry picking statement",()=>{const i={$type:"CherryPicking",id:"1",tags:["tag1","tag2"],parent:"2"};xzi(i,r);t(r.cherryPick).toHaveBeenCalledWith({id:"1",targetId:"",parent:"2",tags:["tag1","tag2"]})});e("should parse a langium generated gitGraph ast",()=>{const i={$type:"GitGraph",statements:[],accDescr:"",accTitle:"",title:""};const o={$type:"GitGraph",statements:[{$container:i,$type:"Commit",id:"1",message:"test",tags:["tag1","tag2"],type:"NORMAL"},{$container:i,$type:"Branch",name:"newBranch",order:1},{$container:i,$type:"Merge",branch:"newBranch",id:"1",tags:["tag1","tag2"],type:"NORMAL"},{$container:i,$type:"Checkout",branch:"newBranch"},{$container:i,$type:"CherryPicking",id:"1",tags:["tag1","tag2"],parent:"2"}],accDescr:"",accTitle:"",title:""};bzi(o,r);t(r.commit).toHaveBeenCalledWith({id:"1",msg:"test",tags:["tag1","tag2"],type:0});t(r.branch).toHaveBeenCalledWith({name:"newBranch",order:1});t(r.merge).toHaveBeenCalledWith({branch:"newBranch",id:"1",tags:["tag1","tag2"],type:0});t(r.checkout).toHaveBeenCalledWith("newBranch")})})}vD=10;_D=40;wS=4;lP=2;O6=8;_Pe=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);Est=12;Sst=new Set(["redux-color","redux-dark-color"]);Szi=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]);B6=B((e,t,n=false)=>{if(n&&e>0){return(e-1)%(t-1)+1}return e%t},"calcColorIndex");Mx=new Map;Lx=new Map;bPe=30;fre=new Map;xPe=[];cP=0;Ll="LR";Azi=B(()=>{Mx.clear();Lx.clear();fre.clear();cP=0;xPe=[];Ll="LR"},"clear");nNn=B(e=>{const t=document.createElementNS("http://www.w3.org/2000/svg","text");const n=typeof e==="string"?e.split(/\\n|\n|/gi):e;n.forEach(r=>{const i=document.createElementNS("http://www.w3.org/2000/svg","tspan");i.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve");i.setAttribute("dy","1em");i.setAttribute("x","0");i.setAttribute("class","row");i.textContent=r.trim();t.appendChild(i)});return t},"drawText");rNn=B(e=>{let t;let n;let r;if(Ll==="BT"){n=B((i,o)=>i<=o,"comparisonFunc");r=Infinity}else{n=B((i,o)=>i>=o,"comparisonFunc");r=0}e.forEach(i=>{const o=Ll==="TB"||Ll=="BT"?Lx.get(i)?.y:Lx.get(i)?.x;if(o!==void 0&&n(o,r)){t=i;r=o}});return t},"findClosestParent");kzi=B(e=>{let t="";let n=Infinity;e.forEach(r=>{const i=Lx.get(r).y;if(i<=n){t=r;n=i}});return t||void 0},"findClosestParentBT");Rzi=B((e,t,n)=>{let r=n;let i=n;const o=[];e.forEach(a=>{const s=t.get(a);if(!s){throw new Error(`Commit not found for key ${a}`)}if(s.parents.length){r=Izi(s);i=Math.max(r,i)}else{o.push(s)}Mzi(s,r)});r=i;o.forEach(a=>{Lzi(a,r,n)});e.forEach(a=>{const s=t.get(a);if(s?.parents.length){const l=kzi(s.parents);r=Lx.get(l).y-_D;if(r<=i){i=r}const u=Mx.get(s.branch).pos;const d=r-vD;Lx.set(s.id,{x:u,y:d})}})},"setParallelBTPos");Pzi=B(e=>{const t=rNn(e.parents.filter(r=>r!==null));if(!t){throw new Error(`Closest parent not found for commit ${e.id}`)}const n=Lx.get(t)?.y;if(n===void 0){throw new Error(`Closest parent position not found for commit ${e.id}`)}return n},"findClosestParentPos");Izi=B(e=>{const t=Pzi(e);return t+_D},"calculateCommitPosition");Mzi=B((e,t)=>{const n=Mx.get(e.branch);if(!n){throw new Error(`Branch not found for commit ${e.id}`)}const r=n.pos;const i=t+vD;Lx.set(e.id,{x:r,y:i});return{x:r,y:i}},"setCommitPosition");Lzi=B((e,t,n)=>{const r=Mx.get(e.branch);if(!r){throw new Error(`Branch not found for commit ${e.id}`)}const i=t+n;const o=r.pos;Lx.set(e.id,{x:o,y:i})},"setRootPosition");Dzi=B((e,t,n,r,i,o)=>{const{theme:a}=Mn();const s=_Pe.has(a??"");const l=Sst.has(a??"");const u=Szi.has(a??"");if(o===Ru.HIGHLIGHT){e.append("rect").attr("x",n.x-10+(s?3:0)).attr("y",n.y-10+(s?3:0)).attr("width",s?14:20).attr("height",s?14:20).attr("class",`commit ${t.id} commit-highlight${B6(i,O6,l)} ${r}-outer`);e.append("rect").attr("x",n.x-6+(s?2:0)).attr("y",n.y-6+(s?2:0)).attr("width",s?8:12).attr("height",s?8:12).attr("class",`commit ${t.id} commit${B6(i,O6,l)} ${r}-inner`)}else if(o===Ru.CHERRY_PICK){e.append("circle").attr("cx",n.x).attr("cy",n.y).attr("r",s?7:10).attr("class",`commit ${t.id} ${r}`);e.append("circle").attr("cx",n.x-3).attr("cy",n.y+2).attr("r",s?2.5:2.75).attr("fill",u?"#000000":"#fff").attr("class",`commit ${t.id} ${r}`);e.append("circle").attr("cx",n.x+3).attr("cy",n.y+2).attr("r",s?2.5:2.75).attr("fill",u?"#000000":"#fff").attr("class",`commit ${t.id} ${r}`);e.append("line").attr("x1",n.x+3).attr("y1",n.y+1).attr("x2",n.x).attr("y2",n.y-5).attr("stroke",u?"#000000":"#fff").attr("class",`commit ${t.id} ${r}`);e.append("line").attr("x1",n.x-3).attr("y1",n.y+1).attr("x2",n.x).attr("y2",n.y-5).attr("stroke",u?"#000000":"#fff").attr("class",`commit ${t.id} ${r}`)}else{const d=e.append("circle");d.attr("cx",n.x);d.attr("cy",n.y);d.attr("r",s?7:10);d.attr("class",`commit ${t.id} commit${B6(i,O6,l)}`);if(o===Ru.MERGE){const f=e.append("circle");f.attr("cx",n.x);f.attr("cy",n.y);f.attr("r",s?5:6);f.attr("class",`commit ${r} ${t.id} commit${B6(i,O6,l)}`)}if(o===Ru.REVERSE){const f=e.append("path");const h=s?4:5;f.attr("d",`M ${n.x-h},${n.y-h}L${n.x+h},${n.y+h}M${n.x-h},${n.y+h}L${n.x+h},${n.y-h}`).attr("class",`commit ${r} ${t.id} commit${B6(i,O6,l)}`)}}},"drawCommitBullet");Fzi=B((e,t,n,r,i)=>{if(t.type!==Ru.CHERRY_PICK&&(t.customId&&t.type===Ru.MERGE||t.type!==Ru.MERGE)&&i.showCommitLabel){const o=e.append("g");const a=o.insert("rect").attr("class","commit-label-bkg");const s=o.append("text").attr("x",r).attr("y",n.y+25).attr("class","commit-label").text(t.id);const l=s.node()?.getBBox();if(l){a.attr("x",n.posWithOffset-l.width/2-lP).attr("y",n.y+13.5).attr("width",l.width+2*lP).attr("height",l.height+2*lP);if(Ll==="TB"||Ll==="BT"){a.attr("x",n.x-(l.width+4*wS+5)).attr("y",n.y-12);s.attr("x",n.x-(l.width+4*wS)).attr("y",n.y+l.height-12)}else{s.attr("x",n.posWithOffset-l.width/2)}if(i.rotateCommitLabel){if(Ll==="TB"||Ll==="BT"){s.attr("transform","rotate(-45, "+n.x+", "+n.y+")");a.attr("transform","rotate(-45, "+n.x+", "+n.y+")")}else{const u=-7.5-(l.width+10)/25*9.5;const d=10+l.width/25*8.5;o.attr("transform","translate("+u+", "+d+") rotate(-45, "+r+", "+n.y+")")}}}}},"drawCommitLabel");Nzi=B((e,t,n,r)=>{if(t.tags.length>0){let i=0;let o=0;let a=0;const s=[];for(const l of t.tags.reverse()){const u=e.insert("polygon");const d=e.append("circle");const f=e.append("text").attr("y",n.y-16-i).attr("class","tag-label").text(l);const h=f.node()?.getBBox();if(!h){throw new Error("Tag bbox not found")}o=Math.max(o,h.width);a=Math.max(a,h.height);f.attr("x",n.posWithOffset-h.width/2);s.push({tag:f,hole:d,rect:u,yOffset:i});i+=20}for(const{tag:l,hole:u,rect:d,yOffset:f}of s){const h=a/2;const m=n.y-19.2-f;d.attr("class","tag-label-bkg").attr("points",` + ${r-o/2-wS/2},${m+lP} + ${r-o/2-wS/2},${m-lP} + ${n.posWithOffset-o/2-wS},${m-h-lP} + ${n.posWithOffset+o/2+wS},${m-h-lP} + ${n.posWithOffset+o/2+wS},${m+h+lP} + ${n.posWithOffset-o/2-wS},${m+h+lP}`);u.attr("cy",m).attr("cx",r-o/2+wS/2).attr("r",1.5).attr("class","tag-hole");if(Ll==="TB"||Ll==="BT"){const g=r+f;d.attr("class","tag-label-bkg").attr("points",` + ${n.x},${g+2} + ${n.x},${g-2} + ${n.x+vD},${g-h-2} + ${n.x+vD+o+4},${g-h-2} + ${n.x+vD+o+4},${g+h+2} + ${n.x+vD},${g+h+2}`).attr("transform","translate(12,12) rotate(45, "+n.x+","+r+")");u.attr("cx",n.x+wS/2).attr("cy",g).attr("transform","translate(12,12) rotate(45, "+n.x+","+r+")");l.attr("x",n.x+5).attr("y",g+3).attr("transform","translate(14,14) rotate(45, "+n.x+","+r+")")}}}},"drawCommitTags");Ozi=B(e=>{const t=e.customType??e.type;switch(t){case Ru.NORMAL:return"commit-normal";case Ru.REVERSE:return"commit-reverse";case Ru.HIGHLIGHT:return"commit-highlight";case Ru.MERGE:return"commit-merge";case Ru.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType");Bzi=B((e,t,n,r)=>{const i={x:0,y:0};if(e.parents.length>0){const o=rNn(e.parents);if(o){const a=r.get(o)??i;if(t==="TB"){return a.y+_D}else if(t==="BT"){const s=r.get(e.id)??i;return s.y-_D}else{return a.x+_D}}}else{if(t==="TB"){return bPe}else if(t==="BT"){const o=r.get(e.id)??i;return o.y-_D}else{return 0}}return 0},"calculatePosition");zzi=B((e,t,n)=>{const r=Ll==="BT"&&n?t:t+vD;const i=Mx.get(e.branch)?.pos;const o=Ll==="TB"||Ll==="BT"?Mx.get(e.branch)?.pos:r;if(o===void 0||i===void 0){throw new Error(`Position were undefined for commit ${e.id}`)}const a=_Pe.has(Mn().theme??"");const s=Ll==="TB"||Ll==="BT"?r:i+(a?Est/2+1:-2);return{x:o,y:s,posWithOffset:r}},"getCommitPosition");Z4n=B((e,t,n,r)=>{const i=e.append("g").attr("class","commit-bullets");const o=e.append("g").attr("class","commit-labels");let a=Ll==="TB"||Ll==="BT"?bPe:0;const s=[...t.keys()];const l=r.parallelCommits??false;const u=B((f,h)=>{const m=t.get(f)?.seq;const g=t.get(h)?.seq;return m!==void 0&&g!==void 0?m-g:0},"sortKeys");let d=s.sort(u);if(Ll==="BT"){if(l){Rzi(d,t,a)}d=d.reverse()}d.forEach(f=>{const h=t.get(f);if(!h){throw new Error(`Commit not found for key ${f}`)}if(l){a=Bzi(h,Ll,a,Lx)}const m=zzi(h,a,l);if(n){const g=Ozi(h);const x=h.customType??h.type;const w=Mx.get(h.branch)?.index??0;Dzi(i,h,m,g,w,x);Fzi(o,h,m,a,r);Nzi(o,h,m,a)}if(Ll==="TB"||Ll==="BT"){Lx.set(h.id,{x:m.x,y:m.posWithOffset})}else{Lx.set(h.id,{x:m.posWithOffset,y:m.y})}a=Ll==="BT"&&l?a+_D:a+_D+vD;if(a>cP){cP=a}})},"drawCommits");Uzi=B((e,t,n,r,i)=>{const o=Ll==="TB"||Ll==="BT"?n.xu.branch===a,"isOnBranchToGetCurve");const l=B(u=>u.seq>e.seq&&u.seq{return l(u)&&s(u)})},"shouldRerouteArrow");hre=B((e,t,n=0)=>{const r=e+Math.abs(e-t)/2;if(n>5){return r}const i=xPe.every(a=>Math.abs(a-r)>=10);if(i){xPe.push(r);return r}const o=Math.abs(e-t);return hre(e,t-o/5,n+1)},"findLane");Vzi=B((e,t,n,r)=>{const{theme:i}=Mn();const o=Sst.has(i??"");const a=Lx.get(t.id);const s=Lx.get(n.id);if(a===void 0||s===void 0){throw new Error(`Commit positions not found for commits ${t.id} and ${n.id}`)}const l=Uzi(t,n,a,s,r);let u="";let d="";let f=0;let h=0;let m=Mx.get(n.branch)?.index;if(n.type===Ru.MERGE&&t.id!==n.parents[0]){m=Mx.get(t.branch)?.index}let g;if(l){u="A 10 10, 0, 0, 0,";d="A 10 10, 0, 0, 1,";f=10;h=10;const x=a.ys.x){u="A 20 20, 0, 0, 0,";d="A 20 20, 0, 0, 1,";f=20;h=20;if(n.type===Ru.MERGE&&t.id!==n.parents[0]){g=`M ${a.x} ${a.y} L ${a.x} ${s.y-f} ${d} ${a.x-h} ${s.y} L ${s.x} ${s.y}`}else{g=`M ${a.x} ${a.y} L ${s.x+f} ${a.y} ${u} ${s.x} ${a.y+h} L ${s.x} ${s.y}`}}if(a.x===s.x){g=`M ${a.x} ${a.y} L ${s.x} ${s.y}`}}else if(Ll==="BT"){if(a.xs.x){u="A 20 20, 0, 0, 0,";d="A 20 20, 0, 0, 1,";f=20;h=20;if(n.type===Ru.MERGE&&t.id!==n.parents[0]){g=`M ${a.x} ${a.y} L ${a.x} ${s.y+f} ${u} ${a.x-h} ${s.y} L ${s.x} ${s.y}`}else{g=`M ${a.x} ${a.y} L ${s.x+f} ${a.y} ${d} ${s.x} ${a.y-h} L ${s.x} ${s.y}`}}if(a.x===s.x){g=`M ${a.x} ${a.y} L ${s.x} ${s.y}`}}else{if(a.ys.y){if(n.type===Ru.MERGE&&t.id!==n.parents[0]){g=`M ${a.x} ${a.y} L ${s.x-f} ${a.y} ${u} ${s.x} ${a.y-h} L ${s.x} ${s.y}`}else{g=`M ${a.x} ${a.y} L ${a.x} ${s.y+f} ${d} ${a.x+h} ${s.y} L ${s.x} ${s.y}`}}if(a.y===s.y){g=`M ${a.x} ${a.y} L ${s.x} ${s.y}`}}}if(g===void 0){throw new Error("Line definition not found")}e.append("path").attr("d",g).attr("class","arrow arrow"+B6(m,O6,o))},"drawArrow");$zi=B((e,t)=>{const n=e.append("g").attr("class","commit-arrows");[...t.keys()].forEach(r=>{const i=t.get(r);if(i.parents&&i.parents.length>0){i.parents.forEach(o=>{Vzi(n,t.get(o),i,t)})}})},"drawArrows");Gzi=B((e,t,n,r)=>{const{look:i,theme:o,themeVariables:a}=Mn();const{dropShadow:s,THEME_COLOR_LIMIT:l}=a;const u=_Pe.has(o??"");const d=Sst.has(o??"");const f=e.append("g");t.forEach((h,m)=>{const g=B6(m,u?l:O6,d);const x=Mx.get(h.name)?.pos;if(x===void 0){throw new Error(`Position not found for branch ${h.name}`)}const w=Ll==="TB"||Ll==="BT"?x:u?x+Est/2+1:x-2;const _=f.append("line");_.attr("x1",0);_.attr("y1",w);_.attr("x2",cP);_.attr("y2",w);_.attr("class","branch branch"+g);if(Ll==="TB"){_.attr("y1",bPe);_.attr("x1",x);_.attr("y2",cP);_.attr("x2",x)}else if(Ll==="BT"){_.attr("y1",cP);_.attr("x1",x);_.attr("y2",bPe);_.attr("x2",x)}xPe.push(w);const C=h.name;const A=nNn(C);const P=f.insert("rect");const L=f.insert("g").attr("class","branchLabel");const I=L.insert("g").attr("class","label branch-label"+g);I.node().appendChild(A);const N=A.getBBox();const O=u?0:4;const z=u?16:0;const U=u?Est:0;if(i==="neo"){P.attr("data-look",`neo`)}P.attr("class","branchLabelBkg label"+g).attr("style",i==="neo"?`filter:${u?`url(#${r}-drop-shadow)`:s}`:"").attr("rx",O).attr("ry",O).attr("x",-N.width-4-(n.rotateCommitLabel===true?30:0)).attr("y",-N.height/2+10).attr("width",N.width+18+z).attr("height",N.height+4+U);I.attr("transform","translate("+(-N.width-14-(n.rotateCommitLabel===true?30:0)+z/2)+", "+(w-N.height/2-2)+")");if(Ll==="TB"){P.attr("x",x-N.width/2-10).attr("y",0);I.attr("transform","translate("+(x-N.width/2-5)+", 0)");if(u){P.attr("transform",`translate(${-z/2-3}, ${-U-10})`);I.attr("transform","translate("+(x-N.width/2-5)+", "+(-U*2+7)+")")}}else if(Ll==="BT"){P.attr("x",x-N.width/2-10).attr("y",cP);I.attr("transform","translate("+(x-N.width/2-5)+", "+cP+")");if(u){P.attr("transform",`translate(${-z/2-3}, ${U+10})`);I.attr("transform","translate("+(x-N.width/2-5)+", "+(cP+U*2+4)+")")}}else{P.attr("transform","translate(-19, "+(w-12-U/2)+")")}})},"drawBranches");Hzi=B(function(e,t,n,r,i){Mx.set(e,{pos:t,index:n});t+=50+(i?40:0)+(Ll==="TB"||Ll==="BT"?r.width/2:0);return t},"setBranchPosition");Wzi=B(function(e,t,n,r){Azi();wt.debug("in gitgraph renderer",e+"\n","id:",t,n);const i=r.db;if(!i.getConfig){wt.error("getConfig method is not available on db");return}const o=i.getConfig();const a=o.rotateCommitLabel??false;fre=i.getCommits();const s=i.getBranchesAsObjArray();Ll=i.getDirection();const l=zr(`[id="${t}"]`);const{look:u,theme:d,themeVariables:f}=Mn();const{useGradient:h,gradientStart:m,gradientStop:g,filterColor:x}=f;if(h){const _=l.append("defs").append("linearGradient").attr("id",t+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");_.append("stop").attr("offset","0%").attr("stop-color",m).attr("stop-opacity",1);_.append("stop").attr("offset","100%").attr("stop-color",g).attr("stop-opacity",1)}if(u==="neo"&&_Pe.has(d??"")){l.append("defs").append("filter").attr("id",t+"-drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",x)}let w=0;s.forEach((_,C)=>{const A=nNn(_.name);const P=l.append("g");const L=P.insert("g").attr("class","branchLabel");const I=L.insert("g").attr("class","label branch-label");I.node()?.appendChild(A);const N=A.getBBox();w=Hzi(_.name,w,C,N,a);I.remove();L.remove();P.remove()});Z4n(l,fre,false,o);if(o.showBranches){Gzi(l,s,o,t)}$zi(l,fre);Z4n(l,fre,true,o);Ko.insertTitle(l,"gitTitleText",o.titleTopMargin??0,i.getDiagramTitle());nee(void 0,l,o.diagramPadding,o.useMaxWidth)},"draw");Yzi={draw:Wzi};if(void 0){const{it:e,expect:t,describe:n}=void 0;n("drawText",()=>{e("should drawText",()=>{const r=nNn("main");t(r).toBeDefined();t(r.children[0].innerHTML).toBe("main")})});n("branchPosition",()=>{const r={x:0,y:0,width:10,height:10,top:0,right:0,bottom:0,left:0,toJSON:B(()=>"","toJSON")};e("should setBranchPositions LR with two branches",()=>{Ll="LR";const i=Hzi("main",0,0,r,true);t(i).toBe(90);t(Mx.get("main")).toEqual({pos:0,index:0});const o=Hzi("develop",i,1,r,true);t(o).toBe(180);t(Mx.get("develop")).toEqual({pos:i,index:1})});e("should setBranchPositions TB with two branches",()=>{Ll="TB";r.width=34.9921875;const i=Hzi("main",0,0,r,true);t(i).toBe(107.49609375);t(Mx.get("main")).toEqual({pos:0,index:0});r.width=56.421875;const o=Hzi("develop",i,1,r,true);t(o).toBe(225.70703125);t(Mx.get("develop")).toEqual({pos:i,index:1})})});n("commitPosition",()=>{const r=new Map([["commitZero",{id:"ZERO",message:"",seq:0,type:Ru.NORMAL,tags:[],parents:[],branch:"main"}],["commitA",{id:"A",message:"",seq:1,type:Ru.NORMAL,tags:[],parents:["ZERO"],branch:"feature"}],["commitB",{id:"B",message:"",seq:2,type:Ru.NORMAL,tags:[],parents:["A"],branch:"feature"}],["commitM",{id:"M",message:"merged branch feature into main",seq:3,type:Ru.MERGE,tags:[],parents:["ZERO","B"],branch:"main",customId:true}],["commitC",{id:"C",message:"",seq:4,type:Ru.NORMAL,tags:[],parents:["ZERO"],branch:"release"}],["commit5_8928ea0",{id:"5-8928ea0",message:"cherry-picked [object Object] into release",seq:5,type:Ru.CHERRY_PICK,tags:[],parents:["C","M"],branch:"release"}],["commitD",{id:"D",message:"",seq:6,type:Ru.NORMAL,tags:[],parents:["5-8928ea0"],branch:"release"}],["commit7_ed848ba",{id:"7-ed848ba",message:"cherry-picked [object Object] into release",seq:7,type:Ru.CHERRY_PICK,tags:[],parents:["D","M"],branch:"release"}]]);let i=0;Mx.set("main",{pos:0,index:0});Mx.set("feature",{pos:107.49609375,index:1});Mx.set("release",{pos:224.03515625,index:2});n("TB",()=>{i=30;Ll="TB";const o=new Map([["commitZero",{x:0,y:40,posWithOffset:40}],["commitA",{x:107.49609375,y:90,posWithOffset:90}],["commitB",{x:107.49609375,y:140,posWithOffset:140}],["commitM",{x:0,y:190,posWithOffset:190}],["commitC",{x:224.03515625,y:240,posWithOffset:240}],["commit5_8928ea0",{x:224.03515625,y:290,posWithOffset:290}],["commitD",{x:224.03515625,y:340,posWithOffset:340}],["commit7_ed848ba",{x:224.03515625,y:390,posWithOffset:390}]]);r.forEach((a,s)=>{e(`should give the correct position for commit ${s}`,()=>{const l=zzi(a,i,false);t(l).toEqual(o.get(s));i+=50})})});n("LR",()=>{let o=30;Ll="LR";const a=new Map([["commitZero",{x:0,y:40,posWithOffset:40}],["commitA",{x:107.49609375,y:90,posWithOffset:90}],["commitB",{x:107.49609375,y:140,posWithOffset:140}],["commitM",{x:0,y:190,posWithOffset:190}],["commitC",{x:224.03515625,y:240,posWithOffset:240}],["commit5_8928ea0",{x:224.03515625,y:290,posWithOffset:290}],["commitD",{x:224.03515625,y:340,posWithOffset:340}],["commit7_ed848ba",{x:224.03515625,y:390,posWithOffset:390}]]);r.forEach((s,l)=>{e(`should give the correct position for commit ${l}`,()=>{const u=zzi(s,o,false);t(u).toEqual(a.get(l));o+=50})})});n("getCommitClassType",()=>{const o=new Map([["commitZero","commit-normal"],["commitA","commit-normal"],["commitB","commit-normal"],["commitM","commit-merge"],["commitC","commit-normal"],["commit5_8928ea0","commit-cherry-pick"],["commitD","commit-normal"],["commit7_ed848ba","commit-cherry-pick"]]);r.forEach((a,s)=>{e(`should give the correct class type for commit ${s}`,()=>{const l=Ozi(a);t(l).toBe(o.get(s))})})})});n("building BT parallel commit diagram",()=>{const r=new Map([["1-abcdefg",{id:"1-abcdefg",message:"",seq:0,type:0,tags:[],parents:[],branch:"main"}],["2-abcdefg",{id:"2-abcdefg",message:"",seq:1,type:0,tags:[],parents:["1-abcdefg"],branch:"main"}],["3-abcdefg",{id:"3-abcdefg",message:"",seq:2,type:0,tags:[],parents:["2-abcdefg"],branch:"develop"}],["4-abcdefg",{id:"4-abcdefg",message:"",seq:3,type:0,tags:[],parents:["3-abcdefg"],branch:"develop"}],["5-abcdefg",{id:"5-abcdefg",message:"",seq:4,type:0,tags:[],parents:["2-abcdefg"],branch:"feature"}],["6-abcdefg",{id:"6-abcdefg",message:"",seq:5,type:0,tags:[],parents:["5-abcdefg"],branch:"feature"}],["7-abcdefg",{id:"7-abcdefg",message:"",seq:6,type:0,tags:[],parents:["2-abcdefg"],branch:"main"}],["8-abcdefg",{id:"8-abcdefg",message:"",seq:7,type:0,tags:[],parents:["7-abcdefg"],branch:"main"}]]);const i=new Map([["1-abcdefg",{x:0,y:40}],["2-abcdefg",{x:0,y:90}],["3-abcdefg",{x:107.49609375,y:140}],["4-abcdefg",{x:107.49609375,y:190}],["5-abcdefg",{x:225.70703125,y:140}],["6-abcdefg",{x:225.70703125,y:190}],["7-abcdefg",{x:0,y:140}],["8-abcdefg",{x:0,y:190}]]);const o=new Map([["1-abcdefg",{x:0,y:210}],["2-abcdefg",{x:0,y:160}],["3-abcdefg",{x:107.49609375,y:110}],["4-abcdefg",{x:107.49609375,y:60}],["5-abcdefg",{x:225.70703125,y:110}],["6-abcdefg",{x:225.70703125,y:60}],["7-abcdefg",{x:0,y:110}],["8-abcdefg",{x:0,y:60}]]);const a=new Map([["1-abcdefg",30],["2-abcdefg",80],["3-abcdefg",130],["4-abcdefg",180],["5-abcdefg",130],["6-abcdefg",180],["7-abcdefg",130],["8-abcdefg",180]]);const s=[...i.keys()];e("should get the correct commit position and current position",()=>{Ll="BT";let l=30;Lx.clear();Mx.clear();Mx.set("main",{pos:0,index:0});Mx.set("develop",{pos:107.49609375,index:1});Mx.set("feature",{pos:225.70703125,index:2});r.forEach((u,d)=>{if(u.parents.length>0){l=Izi(u)}const f=Mzi(u,l);t(f).toEqual(i.get(d));t(l).toEqual(a.get(d))})});e("should get the correct commit position after parallel commits",()=>{Lx.clear();Mx.clear();Ll="BT";const l=30;Lx.clear();Mx.clear();Mx.set("main",{pos:0,index:0});Mx.set("develop",{pos:107.49609375,index:1});Mx.set("feature",{pos:225.70703125,index:2});Rzi(s,r,l);s.forEach(u=>{const d=Lx.get(u);t(d).toEqual(o.get(u))})})});e("add",()=>{Lx.set("parent1",{x:1,y:1});Lx.set("parent2",{x:2,y:2});Lx.set("parent3",{x:3,y:3});Ll="LR";const r=["parent1","parent2","parent3"];const i=rNn(r);t(i).toBe("parent3");Lx.clear()})}iNn=8;oNn=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);qzi=new Set(["redux-color","redux-dark-color"]);Xzi=new Set(["neo","neo-dark"]);jzi=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]);Kzi=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]);Zzi=B(e=>{const{svgId:t}=e;let n="";if(e.useGradient&&t){for(let r=0;r{const t=Ji();const{theme:n,themeVariables:r}=t;const{borderColorArray:i}=r;const o=oNn.has(n);if(Xzi.has(n)){let a="";for(let s=0;s{return`${Array.from({length:e.THEME_COLOR_LIMIT},(t,n)=>n).map(t=>{const n=t%iNn;return` + .branch-label${t} { fill: ${e["gitBranchLabel"+n]}; } + .commit${t} { stroke: ${e["git"+n]}; fill: ${e["git"+n]}; } + .commit-highlight${t} { stroke: ${e["gitInv"+n]}; fill: ${e["gitInv"+n]}; } + .label${t} { fill: ${e["git"+n]}; } + .arrow${t} { stroke: ${e["git"+n]}; } + `}).join("\n")}`},"normalTheme");e9i=B(e=>{const t=Ji();const{theme:n}=t;const r=Kzi.has(n);return` + .commit-id, + .commit-msg, + .branch-label { + fill: lightgrey; + color: lightgrey; + font-family: 'trebuchet ms', verdana, arial, sans-serif; + font-family: var(--mermaid-font-family); + } + + ${r?Jzi(e):Qzi(e)} + + .branch { + stroke-width: ${e.strokeWidth}; + stroke: ${e.commitLineColor??e.lineColor}; + stroke-dasharray: ${r?"4 2":"2"}; + } + .commit-label { font-size: ${e.commitLabelFontSize}; fill: ${r?e.nodeBorder:e.commitLabelColor}; ${r?`font-weight:${e.noteFontWeight};`:""}} + .commit-label-bkg { font-size: ${e.commitLabelFontSize}; fill: ${r?"transparent":e.commitLabelBackground}; opacity: ${r?"":.5}; } + .tag-label { font-size: ${e.tagLabelFontSize}; fill: ${e.tagLabelColor};} + .tag-label-bkg { fill: ${r?e.mainBkg:e.tagLabelBackground}; stroke: ${r?e.nodeBorder:e.tagLabelBorder}; ${r?`filter:${e.dropShadow}`:""} } + .tag-hole { fill: ${e.textColor}; } + + .commit-merge { + stroke: ${r?e.mainBkg:e.primaryColor}; + fill: ${r?e.mainBkg:e.primaryColor}; + } + .commit-reverse { + stroke: ${r?e.mainBkg:e.primaryColor}; + fill: ${r?e.mainBkg:e.primaryColor}; + stroke-width: ${r?e.strokeWidth:3}; + } + .commit-highlight-outer { + } + .commit-highlight-inner { + stroke: ${r?e.mainBkg:e.primaryColor}; + fill: ${r?e.mainBkg:e.primaryColor}; + } + + .arrow { + /* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */ + stroke-width: ${oNn.has(n)?e.strokeWidth:8}; + stroke-linecap: round; + fill: none + } + .gitTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${e.textColor}; + } +`},"getStyles");t9i=e9i;n9i={parser:Czi,db:tNn,renderer:Yzi,styles:t9i}});var lNn=_r((Ast,kst)=>{!function(e,t){"object"==typeof Ast&&"undefined"!=typeof kst?kst.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_plugin_isoWeek=t()}(Ast,function(){"use strict";var e="day";return function(t,n,r){var i=function(s){return s.add(4-s.isoWeekday(),e)},o=n.prototype;o.isoWeekYear=function(){return i(this).year()},o.isoWeek=function(s){if(!this.$utils().u(s))return this.add(7*(s-this.isoWeek()),e);var l,u,d,f,h=i(this),m=(l=this.isoWeekYear(),u=this.$u,d=(u?r.utc:r)().year(l).startOf("year"),f=4-d.isoWeekday(),d.isoWeekday()>4&&(f+=7),d.add(f,e));return h.diff(m,"week")+1},o.isoWeekday=function(s){return this.$utils().u(s)?this.day()||7:this.day(this.day()%7?s:s-7)};var a=o.startOf;o.startOf=function(s,l){var u=this.$utils(),d=!!u.u(l)||l;return"isoweek"===u.p(s)?d?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):a.bind(this)(s,l)}}})});var cNn=_r((Rst,Pst)=>{!function(e,t){"object"==typeof Rst&&"undefined"!=typeof Pst?Pst.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_plugin_customParseFormat=t()}(Rst,function(){"use strict";var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d/,r=/\d\d/,i=/\d\d?/,o=/\d*[^-_:/,()\s\d]+/,a={},s=function(g){return(g=+g)+(g>68?1900:2e3)};var l=function(g){return function(x){this[g]=+x}},u=[/[+-]\d\d:?(\d\d)?|Z/,function(g){(this.zone||(this.zone={})).offset=function(x){if(!x)return 0;if("Z"===x)return 0;var w=x.match(/([+-]|\d\d)/g),_=60*w[1]+(+w[2]||0);return 0===_?0:"+"===w[0]?-_:_}(g)}],d=function(g){var x=a[g];return x&&(x.indexOf?x:x.s.concat(x.f))},f=function(g,x){var w,_=a.meridiem;if(_){for(var C=1;C<=24;C+=1)if(g.indexOf(_(C,0,x))>-1){w=C>12;break}}else w=g===(x?"pm":"PM");return w},h={A:[o,function(g){this.afternoon=f(g,false)}],a:[o,function(g){this.afternoon=f(g,true)}],Q:[n,function(g){this.month=3*(g-1)+1}],S:[n,function(g){this.milliseconds=100*+g}],SS:[r,function(g){this.milliseconds=10*+g}],SSS:[/\d{3}/,function(g){this.milliseconds=+g}],s:[i,l("seconds")],ss:[i,l("seconds")],m:[i,l("minutes")],mm:[i,l("minutes")],H:[i,l("hours")],h:[i,l("hours")],HH:[i,l("hours")],hh:[i,l("hours")],D:[i,l("day")],DD:[r,l("day")],Do:[o,function(g){var x=a.ordinal,w=g.match(/\d+/);if(this.day=w[0],x)for(var _=1;_<=31;_+=1)x(_).replace(/\[|\]/g,"")===g&&(this.day=_)}],w:[i,l("week")],ww:[r,l("week")],M:[i,l("month")],MM:[r,l("month")],MMM:[o,function(g){var x=d("months"),w=(d("monthsShort")||x.map(function(_){return _.slice(0,3)})).indexOf(g)+1;if(w<1)throw new Error;this.month=w%12||w}],MMMM:[o,function(g){var x=d("months").indexOf(g)+1;if(x<1)throw new Error;this.month=x%12||x}],Y:[/[+-]?\d+/,l("year")],YY:[r,function(g){this.year=s(g)}],YYYY:[/\d{4}/,l("year")],Z:u,ZZ:u};function m(g){var x,w;x=g,w=a&&a.formats;for(var _=(g=x.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(O,z,U){var W=U&&U.toUpperCase();return z||w[U]||e[U]||w[W].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(H,$,K){return $||K.slice(1)})})).match(t),C=_.length,A=0;A-1)return new Date(("X"===j?1e3:1)*X);var oe=m(j)(X),se=oe.year,re=oe.month,ce=oe.day,ue=oe.hours,xe=oe.minutes,be=oe.seconds,Ie=oe.milliseconds,he=oe.zone,ve=oe.week,ge=new Date,Ve=ce||(se||re?1:ge.getDate()),Le=se||ge.getFullYear(),$e=0;se&&!re||($e=re>0?re-1:ge.getMonth());var Ee,tt=ue||0,yt=xe||0,mt=be||0,ct=Ie||0;return he?new Date(Date.UTC(Le,$e,Ve,tt,yt,mt,ct+60*he.offset*1e3)):te?new Date(Date.UTC(Le,$e,Ve,tt,yt,mt,ct)):(Ee=new Date(Le,$e,Ve,tt,yt,mt,ct),ve&&(Ee=J(Ee).week(ve).toDate()),Ee)}catch(Ge){return new Date("")}}(P,N,L,w),this.init(),W&&true!==W&&(this.$L=this.locale(W).$L),U&&P!=this.format(N)&&(this.$d=new Date("")),a={}}else if(N instanceof Array)for(var H=N.length,$=1;$<=H;$+=1){I[1]=N[$-1];var K=w.apply(this,I);if(K.isValid()){this.$d=K.$d,this.$L=K.$L,this.init();break}$===H&&(this.$d=new Date(""))}else C.call(this,A)}}})});var uNn=_r((Ist,Mst)=>{!function(e,t){"object"==typeof Ist&&"undefined"!=typeof Mst?Mst.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_plugin_advancedFormat=t()}(Ist,function(){"use strict";return function(e,t){var n=t.prototype,r=n.format;n.format=function(i){var o=this,a=this.$locale();if(!this.isValid())return r.bind(this)(i);var s=this.$utils(),l=(i||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(u){switch(u){case"Q":return Math.ceil((o.$M+1)/3);case"Do":return a.ordinal(o.$D);case"gggg":return o.weekYear();case"GGGG":return o.isoWeekYear();case"wo":return a.ordinal(o.week(),"W");case"w":case"ww":return s.s(o.week(),"w"===u?1:2,"0");case"W":case"WW":return s.s(o.isoWeek(),"W"===u?1:2,"0");case"k":case"kk":return s.s(String(0===o.$H?24:o.$H),"k"===u?1:2,"0");case"X":return Math.floor(o.$d.getTime()/1e3);case"x":return o.$d.getTime();case"z":return"["+o.offsetName()+"]";case"zzz":return"["+o.offsetName("long")+"]";default:return u}});return r.bind(this)(l)}}})});var dNn=_r((Lst,Dst)=>{!function(e,t){"object"==typeof Lst&&"undefined"!=typeof Dst?Dst.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_plugin_duration=t()}(Lst,function(){"use strict";var e,t,n=1e3,r=6e4,i=36e5,o=864e5,a=31536e6,s=2628e6,l=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,u=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,d={years:a,months:s,days:o,hours:i,minutes:r,seconds:n,milliseconds:1,weeks:6048e5},f=function(P){return P instanceof C},h=function(P,L,I){return new C(P,I,L.$l)},m=function(P){return t.p(P)+"s"},g=function(P){return P<0},x=function(P){return g(P)?Math.ceil(P):Math.floor(P)},w=function(P){return Math.abs(P)},_=function(P,L){return P?g(P)?{negative:true,format:""+w(P)+L}:{negative:false,format:""+P+L}:{negative:false,format:""}},C=function(){function P(I,N,O){var z=this;if(this.$d={},this.$l=O,void 0===I&&(this.$ms=0,this.parseFromMilliseconds()),N)return h(I*d[m(N)],this);if("number"==typeof I)return this.$ms=I,this.parseFromMilliseconds(),this;if("object"==typeof I)return Object.keys(I).forEach(function(H){z.$d[m(H)]=I[H]}),this.calMilliseconds(),this;if("string"==typeof I){var U=I.match(l);if(U){var W=U.slice(2).map(function(H){return null!=H?Number(H):0});return this.$d.years=W[0],this.$d.months=W[1],this.$d.weeks=W[2],this.$d.days=W[3],this.$d.hours=W[4],this.$d.minutes=W[5],this.$d.seconds=W[6],this.calMilliseconds(),this}}return this}var L=P.prototype;return L.calMilliseconds=function(){var I=this;this.$ms=Object.keys(this.$d).reduce(function(N,O){return N+(I.$d[O]||0)*d[O]},0)},L.parseFromMilliseconds=function(){var I=this.$ms;this.$d.years=x(I/a),I%=a,this.$d.months=x(I/s),I%=s,this.$d.days=x(I/o),I%=o,this.$d.hours=x(I/i),I%=i,this.$d.minutes=x(I/r),I%=r,this.$d.seconds=x(I/n),I%=n,this.$d.milliseconds=I},L.toISOString=function(){var I=_(this.$d.years,"Y"),N=_(this.$d.months,"M"),O=+this.$d.days||0;this.$d.weeks&&(O+=7*this.$d.weeks);var z=_(O,"D"),U=_(this.$d.hours,"H"),W=_(this.$d.minutes,"M"),H=this.$d.seconds||0;this.$d.milliseconds&&(H+=this.$d.milliseconds/1e3,H=Math.round(1e3*H)/1e3);var $=_(H,"S"),K=I.negative||N.negative||z.negative||U.negative||W.negative||$.negative,X=U.format||W.format||$.format?"T":"",j=(K?"-":"")+"P"+I.format+N.format+z.format+X+U.format+W.format+$.format;return"P"===j||"-P"===j?"P0D":j},L.toJSON=function(){return this.toISOString()},L.format=function(I){var N=I||"YYYY-MM-DDTHH:mm:ss",O={Y:this.$d.years,YY:t.s(this.$d.years,2,"0"),YYYY:t.s(this.$d.years,4,"0"),M:this.$d.months,MM:t.s(this.$d.months,2,"0"),D:this.$d.days,DD:t.s(this.$d.days,2,"0"),H:this.$d.hours,HH:t.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:t.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:t.s(this.$d.seconds,2,"0"),SSS:t.s(this.$d.milliseconds,3,"0")};return N.replace(u,function(z,U){return U||String(O[z])})},L.as=function(I){return this.$ms/d[m(I)]},L.get=function(I){var N=this.$ms,O=m(I);return"milliseconds"===O?N%=1e3:N="weeks"===O?x(N/d[O]):this.$d[O],N||0},L.add=function(I,N,O){var z;return z=N?I*d[m(N)]:f(I)?I.$ms:h(I,this).$ms,h(this.$ms+z*(O?-1:1),this)},L.subtract=function(I,N){return this.add(I,N,true)},L.locale=function(I){var N=this.clone();return N.$l=I,N},L.clone=function(){return h(this.$ms,this)},L.humanize=function(I){return e().add(this.$ms,"ms").locale(this.$l).fromNow(!I)},L.valueOf=function(){return this.asMilliseconds()},L.milliseconds=function(){return this.get("milliseconds")},L.asMilliseconds=function(){return this.as("milliseconds")},L.seconds=function(){return this.get("seconds")},L.asSeconds=function(){return this.as("seconds")},L.minutes=function(){return this.get("minutes")},L.asMinutes=function(){return this.as("minutes")},L.hours=function(){return this.get("hours")},L.asHours=function(){return this.as("hours")},L.days=function(){return this.get("days")},L.asDays=function(){return this.as("days")},L.weeks=function(){return this.get("weeks")},L.asWeeks=function(){return this.as("weeks")},L.months=function(){return this.get("months")},L.asMonths=function(){return this.as("months")},L.years=function(){return this.get("years")},L.asYears=function(){return this.as("years")},P}(),A=function(P,L,I){return P.add(L.years()*I,"y").add(L.months()*I,"M").add(L.days()*I,"d").add(L.hours()*I,"h").add(L.minutes()*I,"m").add(L.seconds()*I,"s").add(L.milliseconds()*I,"ms")};return function(P,L,I){e=I,t=I().$utils(),I.duration=function(z,U){var W=I.locale();return h(z,{$l:W},U)},I.isDuration=f;var N=L.prototype.add,O=L.prototype.subtract;L.prototype.add=function(z,U){return f(z)?A(this,z,1):N.bind(this)(z,U)},L.prototype.subtract=function(z,U){return f(z)?A(this,z,-1):O.bind(this)(z,U)}}})});var RNn={};Oo(RNn,{diagram:()=>q9i});function jst(e,t,n){let r=true;while(r){r=false;n.forEach(function(i){const o="^\\s*"+i+"\\s*$";const a=new RegExp(o);if(e[0].match(a)){t[i]=true;e.shift(1);r=true}})}}var mNn,yv,gNn,yNn,bNn,mH,kNn,Nst,r9i,fNn,ES,Ust,Vst,$st,yH,bH,Gst,Hst,EPe,xH,Wst,xNn,Yst,pH,pre,qst,Xst,CPe,Ost,i9i,o9i,a9i,s9i,l9i,c9i,u9i,d9i,f9i,h9i,p9i,m9i,g9i,y9i,b9i,x9i,vNn,v9i,_9i,T9i,w9i,E9i,C9i,S9i,A9i,_Nn,k9i,R9i,P9i,TNn,I9i,Bst,wNn,ENn,TPe,gH,M9i,L9i,zst,wPe,Gp,CNn,D9i,U6,F9i,hNn,N9i,SNn,O9i,ANn,B9i,z9i,U9i,V9i,pNn,$9i,uP,Fst,G9i,H9i,W9i,Y9i,q9i;var PNn=Ce(()=>{nl();Ta();Aa();Yo();mNn=Ui(p$(),1);yv=Ui(uwe(),1);gNn=Ui(lNn(),1);yNn=Ui(cNn(),1);bNn=Ui(uNn(),1);mH=Ui(uwe(),1);kNn=Ui(dNn(),1);ks();Nst=function(){var e=B(function($,K,X,j){for(X=X||{},j=$.length;j--;X[$[j]]=K);return X},"o"),t=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],r=[1,27],i=[1,28],o=[1,29],a=[1,30],s=[1,31],l=[1,32],u=[1,33],d=[1,34],f=[1,9],h=[1,10],m=[1,11],g=[1,12],x=[1,13],w=[1,14],_=[1,15],C=[1,16],A=[1,19],P=[1,20],L=[1,21],I=[1,22],N=[1,23],O=[1,25],z=[1,35];var U={trace:B(function $(){},"trace"),yy:{},symbols_:{"error":2,"start":3,"gantt":4,"document":5,"EOF":6,"line":7,"SPACE":8,"statement":9,"NL":10,"weekday":11,"weekday_monday":12,"weekday_tuesday":13,"weekday_wednesday":14,"weekday_thursday":15,"weekday_friday":16,"weekday_saturday":17,"weekday_sunday":18,"weekend":19,"weekend_friday":20,"weekend_saturday":21,"dateFormat":22,"inclusiveEndDates":23,"topAxis":24,"axisFormat":25,"tickInterval":26,"excludes":27,"includes":28,"todayMarker":29,"title":30,"acc_title":31,"acc_title_value":32,"acc_descr":33,"acc_descr_value":34,"acc_descr_multiline_value":35,"section":36,"clickStatement":37,"taskTxt":38,"taskData":39,"click":40,"callbackname":41,"callbackargs":42,"href":43,"clickStatementDebug":44,"$accept":0,"$end":1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:B(function $(K,X,j,te,J,oe,se){var re=oe.length-1;switch(J){case 1:return oe[re-1];break;case 2:this.$=[];break;case 3:oe[re-1].push(oe[re]);this.$=oe[re-1];break;case 4:case 5:this.$=oe[re];break;case 6:case 7:this.$=[];break;case 8:te.setWeekday("monday");break;case 9:te.setWeekday("tuesday");break;case 10:te.setWeekday("wednesday");break;case 11:te.setWeekday("thursday");break;case 12:te.setWeekday("friday");break;case 13:te.setWeekday("saturday");break;case 14:te.setWeekday("sunday");break;case 15:te.setWeekend("friday");break;case 16:te.setWeekend("saturday");break;case 17:te.setDateFormat(oe[re].substr(11));this.$=oe[re].substr(11);break;case 18:te.enableInclusiveEndDates();this.$=oe[re].substr(18);break;case 19:te.TopAxis();this.$=oe[re].substr(8);break;case 20:te.setAxisFormat(oe[re].substr(11));this.$=oe[re].substr(11);break;case 21:te.setTickInterval(oe[re].substr(13));this.$=oe[re].substr(13);break;case 22:te.setExcludes(oe[re].substr(9));this.$=oe[re].substr(9);break;case 23:te.setIncludes(oe[re].substr(9));this.$=oe[re].substr(9);break;case 24:te.setTodayMarker(oe[re].substr(12));this.$=oe[re].substr(12);break;case 27:te.setDiagramTitle(oe[re].substr(6));this.$=oe[re].substr(6);break;case 28:this.$=oe[re].trim();te.setAccTitle(this.$);break;case 29:case 30:this.$=oe[re].trim();te.setAccDescription(this.$);break;case 31:te.addSection(oe[re].substr(8));this.$=oe[re].substr(8);break;case 33:te.addTask(oe[re-1],oe[re]);this.$="task";break;case 34:this.$=oe[re-1];te.setClickEvent(oe[re-1],oe[re],null);break;case 35:this.$=oe[re-2];te.setClickEvent(oe[re-2],oe[re-1],oe[re]);break;case 36:this.$=oe[re-2];te.setClickEvent(oe[re-2],oe[re-1],null);te.setLink(oe[re-2],oe[re]);break;case 37:this.$=oe[re-3];te.setClickEvent(oe[re-3],oe[re-2],oe[re-1]);te.setLink(oe[re-3],oe[re]);break;case 38:this.$=oe[re-2];te.setClickEvent(oe[re-2],oe[re],null);te.setLink(oe[re-2],oe[re-1]);break;case 39:this.$=oe[re-3];te.setClickEvent(oe[re-3],oe[re-1],oe[re]);te.setLink(oe[re-3],oe[re-2]);break;case 40:this.$=oe[re-1];te.setLink(oe[re-1],oe[re]);break;case 41:case 47:this.$=oe[re-1]+" "+oe[re];break;case 42:case 43:case 45:this.$=oe[re-2]+" "+oe[re-1]+" "+oe[re];break;case 44:case 46:this.$=oe[re-3]+" "+oe[re-2]+" "+oe[re-1]+" "+oe[re];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(t,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:r,14:i,15:o,16:a,17:s,18:l,19:18,20:u,21:d,22:f,23:h,24:m,25:g,26:x,27:w,28:_,29:C,30:A,31:P,33:L,35:I,36:N,37:24,38:O,40:z},e(t,[2,7],{1:[2,1]}),e(t,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:o,16:a,17:s,18:l,19:18,20:u,21:d,22:f,23:h,24:m,25:g,26:x,27:w,28:_,29:C,30:A,31:P,33:L,35:I,36:N,37:24,38:O,40:z},e(t,[2,5]),e(t,[2,6]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,20]),e(t,[2,21]),e(t,[2,22]),e(t,[2,23]),e(t,[2,24]),e(t,[2,25]),e(t,[2,26]),e(t,[2,27]),{32:[1,37]},{34:[1,38]},e(t,[2,30]),e(t,[2,31]),e(t,[2,32]),{39:[1,39]},e(t,[2,8]),e(t,[2,9]),e(t,[2,10]),e(t,[2,11]),e(t,[2,12]),e(t,[2,13]),e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),{41:[1,40],43:[1,41]},e(t,[2,4]),e(t,[2,28]),e(t,[2,29]),e(t,[2,33]),e(t,[2,34],{42:[1,42],43:[1,43]}),e(t,[2,40],{41:[1,44]}),e(t,[2,35],{43:[1,45]}),e(t,[2,36]),e(t,[2,38],{42:[1,46]}),e(t,[2,37]),e(t,[2,39])],defaultActions:{},parseError:B(function $(K,X){if(X.recoverable){this.trace(K)}else{var j=new Error(K);j.hash=X;throw j}},"parseError"),parse:B(function $(K){var X=this,j=[0],te=[],J=[null],oe=[],se=this.table,re="",ce=0,ue=0,xe=0,be=2,Ie=1;var he=oe.slice.call(arguments,1);var ve=Object.create(this.lexer);var ge={yy:{}};for(var Ve in this.yy){if(Object.prototype.hasOwnProperty.call(this.yy,Ve)){ge.yy[Ve]=this.yy[Ve]}}ve.setInput(K,ge.yy);ge.yy.lexer=ve;ge.yy.parser=this;if(typeof ve.yylloc=="undefined"){ve.yylloc={}}var Le=ve.yylloc;oe.push(Le);var $e=ve.options&&ve.options.ranges;if(typeof ge.yy.parseError==="function"){this.parseError=ge.yy.parseError}else{this.parseError=Object.getPrototypeOf(this).parseError}function Ee(qe){j.length=j.length-2*qe;J.length=J.length-qe;oe.length=oe.length-qe}B(Ee,"popStack");function tt(){var qe;qe=te.pop()||ve.lex()||Ie;if(typeof qe!=="number"){if(qe instanceof Array){te=qe;qe=te.pop()}qe=X.symbols_[qe]||qe}return qe}B(tt,"lex");var yt,mt,ct,Ge,it,bt,He={},Je,Te,we,Ze;while(true){ct=j[j.length-1];if(this.defaultActions[ct]){Ge=this.defaultActions[ct]}else{if(yt===null||typeof yt=="undefined"){yt=tt()}Ge=se[ct]&&se[ct][yt]}if(typeof Ge==="undefined"||!Ge.length||!Ge[0]){var Be="";Ze=[];for(Je in se[ct]){if(this.terminals_[Je]&&Je>be){Ze.push("'"+this.terminals_[Je]+"'")}}if(ve.showPosition){Be="Parse error on line "+(ce+1)+":\n"+ve.showPosition()+"\nExpecting "+Ze.join(", ")+", got '"+(this.terminals_[yt]||yt)+"'"}else{Be="Parse error on line "+(ce+1)+": Unexpected "+(yt==Ie?"end of input":"'"+(this.terminals_[yt]||yt)+"'")}this.parseError(Be,{text:ve.match,token:this.terminals_[yt]||yt,line:ve.yylineno,loc:Le,expected:Ze})}if(Ge[0]instanceof Array&&Ge.length>1){throw new Error("Parse Error: multiple actions possible at state: "+ct+", token: "+yt)}switch(Ge[0]){case 1:j.push(yt);J.push(ve.yytext);oe.push(ve.yylloc);j.push(Ge[1]);yt=null;if(!mt){ue=ve.yyleng;re=ve.yytext;ce=ve.yylineno;Le=ve.yylloc;if(xe>0){xe--}}else{yt=mt;mt=null}break;case 2:Te=this.productions_[Ge[1]][1];He.$=J[J.length-Te];He._$={first_line:oe[oe.length-(Te||1)].first_line,last_line:oe[oe.length-1].last_line,first_column:oe[oe.length-(Te||1)].first_column,last_column:oe[oe.length-1].last_column};if($e){He._$.range=[oe[oe.length-(Te||1)].range[0],oe[oe.length-1].range[1]]}bt=this.performAction.apply(He,[re,ue,ce,ge.yy,Ge[1],J,oe].concat(he));if(typeof bt!=="undefined"){return bt}if(Te){j=j.slice(0,-1*Te*2);J=J.slice(0,-1*Te);oe=oe.slice(0,-1*Te)}j.push(this.productions_[Ge[1]][0]);J.push(He.$);oe.push(He._$);we=se[j[j.length-2]][j[j.length-1]];j.push(we);break;case 3:return true}}return true},"parse")};var W=function(){var $={EOF:1,parseError:B(function K(X,j){if(this.yy.parser){this.yy.parser.parseError(X,j)}else{throw new Error(X)}},"parseError"),setInput:B(function(K,X){this.yy=X||this.yy||{};this._input=K;this._more=this._backtrack=this.done=false;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};if(this.options.ranges){this.yylloc.range=[0,0]}this.offset=0;return this},"setInput"),input:B(function(){var K=this._input[0];this.yytext+=K;this.yyleng++;this.offset++;this.match+=K;this.matched+=K;var X=K.match(/(?:\r\n?|\n).*/g);if(X){this.yylineno++;this.yylloc.last_line++}else{this.yylloc.last_column++}if(this.options.ranges){this.yylloc.range[1]++}this._input=this._input.slice(1);return K},"input"),unput:B(function(K){var X=K.length;var j=K.split(/(?:\r\n?|\n)/g);this._input=K+this._input;this.yytext=this.yytext.substr(0,this.yytext.length-X);this.offset-=X;var te=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1);this.matched=this.matched.substr(0,this.matched.length-1);if(j.length-1){this.yylineno-=j.length-1}var J=this.yylloc.range;this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:j?(j.length===te.length?this.yylloc.first_column:0)+te[te.length-j.length].length-j[0].length:this.yylloc.first_column-X};if(this.options.ranges){this.yylloc.range=[J[0],J[0]+this.yyleng-X]}this.yyleng=this.yytext.length;return this},"unput"),more:B(function(){this._more=true;return this},"more"),reject:B(function(){if(this.options.backtrack_lexer){this._backtrack=true}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}return this},"reject"),less:B(function(K){this.unput(this.match.slice(K))},"less"),pastInput:B(function(){var K=this.matched.substr(0,this.matched.length-this.match.length);return(K.length>20?"...":"")+K.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:B(function(){var K=this.match;if(K.length<20){K+=this._input.substr(0,20-K.length)}return(K.substr(0,20)+(K.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:B(function(){var K=this.pastInput();var X=new Array(K.length+1).join("-");return K+this.upcomingInput()+"\n"+X+"^"},"showPosition"),test_match:B(function(K,X){var j,te,J;if(this.options.backtrack_lexer){J={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done};if(this.options.ranges){J.yylloc.range=this.yylloc.range.slice(0)}}te=K[0].match(/(?:\r\n?|\n).*/g);if(te){this.yylineno+=te.length}this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:te?te[te.length-1].length-te[te.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+K[0].length};this.yytext+=K[0];this.match+=K[0];this.matches=K;this.yyleng=this.yytext.length;if(this.options.ranges){this.yylloc.range=[this.offset,this.offset+=this.yyleng]}this._more=false;this._backtrack=false;this._input=this._input.slice(K[0].length);this.matched+=K[0];j=this.performAction.call(this,this.yy,this,X,this.conditionStack[this.conditionStack.length-1]);if(this.done&&this._input){this.done=false}if(j){return j}else if(this._backtrack){for(var oe in J){this[oe]=J[oe]}return false}return false},"test_match"),next:B(function(){if(this.done){return this.EOF}if(!this._input){this.done=true}var K,X,j,te;if(!this._more){this.yytext="";this.match=""}var J=this._currentRules();for(var oe=0;oeX[0].length)){X=j;te=oe;if(this.options.backtrack_lexer){K=this.test_match(j,J[oe]);if(K!==false){return K}else if(this._backtrack){X=false;continue}else{return false}}else if(!this.options.flex){break}}}if(X){K=this.test_match(X,J[te]);if(K!==false){return K}return false}if(this._input===""){return this.EOF}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}},"next"),lex:B(function K(){var X=this.next();if(X){return X}else{return this.lex()}},"lex"),begin:B(function K(X){this.conditionStack.push(X)},"begin"),popState:B(function K(){var X=this.conditionStack.length-1;if(X>0){return this.conditionStack.pop()}else{return this.conditionStack[0]}},"popState"),_currentRules:B(function K(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules}else{return this.conditions["INITIAL"].rules}},"_currentRules"),topState:B(function K(X){X=this.conditionStack.length-1-Math.abs(X||0);if(X>=0){return this.conditionStack[X]}else{return"INITIAL"}},"topState"),pushState:B(function K(X){this.begin(X)},"pushState"),stateStackSize:B(function K(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":true},performAction:B(function K(X,j,te,J){var oe=J;switch(te){case 0:this.begin("open_directive");return"open_directive";break;case 1:this.begin("acc_title");return 31;break;case 2:this.popState();return"acc_title_value";break;case 3:this.begin("acc_descr");return 33;break;case 4:this.popState();return"acc_descr_value";break;case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";break;case 8:break;case 9:break;case 10:break;case 11:return 10;break;case 12:break;case 13:break;case 14:this.begin("href");break;case 15:this.popState();break;case 16:return 43;break;case 17:this.begin("callbackname");break;case 18:this.popState();break;case 19:this.popState();this.begin("callbackargs");break;case 20:return 41;break;case 21:this.popState();break;case 22:return 42;break;case 23:this.begin("click");break;case 24:this.popState();break;case 25:return 40;break;case 26:return 4;break;case 27:return 22;break;case 28:return 23;break;case 29:return 24;break;case 30:return 25;break;case 31:return 26;break;case 32:return 28;break;case 33:return 27;break;case 34:return 29;break;case 35:return 12;break;case 36:return 13;break;case 37:return 14;break;case 38:return 15;break;case 39:return 16;break;case 40:return 17;break;case 41:return 18;break;case 42:return 20;break;case 43:return 21;break;case 44:return"date";break;case 45:return 30;break;case 46:return"accDescription";break;case 47:return 36;break;case 48:return 38;break;case 49:return 39;break;case 50:return":";break;case 51:return 6;break;case 52:return"INVALID";break}},"anonymous"),rules:[/^(?:%%\{)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:tickInterval\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:weekday\s+monday\b)/i,/^(?:weekday\s+tuesday\b)/i,/^(?:weekday\s+wednesday\b)/i,/^(?:weekday\s+thursday\b)/i,/^(?:weekday\s+friday\b)/i,/^(?:weekday\s+saturday\b)/i,/^(?:weekday\s+sunday\b)/i,/^(?:weekend\s+friday\b)/i,/^(?:weekend\s+saturday\b)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^\n]+)/i,/^(?:[^:\n]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{"acc_descr_multiline":{"rules":[6,7],"inclusive":false},"acc_descr":{"rules":[4],"inclusive":false},"acc_title":{"rules":[2],"inclusive":false},"callbackargs":{"rules":[21,22],"inclusive":false},"callbackname":{"rules":[18,19,20],"inclusive":false},"href":{"rules":[15,16],"inclusive":false},"click":{"rules":[24,25],"inclusive":false},"INITIAL":{"rules":[0,1,3,5,8,9,10,11,12,13,14,17,23,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],"inclusive":true}}};return $}();U.lexer=W;function H(){this.yy={}}B(H,"Parser");H.prototype=U;U.Parser=H;return new H}();Nst.parser=Nst;r9i=Nst;yv.default.extend(gNn.default);yv.default.extend(yNn.default);yv.default.extend(bNn.default);fNn={friday:5,saturday:6};ES="";Ust="";Vst=void 0;$st="";yH=[];bH=[];Gst=new Map;Hst=[];EPe=[];xH="";Wst="";xNn=["active","done","crit","milestone","vert"];Yst=[];pH="";pre=false;qst=false;Xst="sunday";CPe="saturday";Ost=0;i9i=B(function(){Hst=[];EPe=[];xH="";Yst=[];TPe=0;zst=void 0;wPe=void 0;Gp=[];ES="";Ust="";Wst="";Vst=void 0;$st="";yH=[];bH=[];pre=false;qst=false;Ost=0;Gst=new Map;pH="";Da();Xst="sunday";CPe="saturday"},"clear");o9i=B(function(e){pH=e},"setDiagramId");a9i=B(function(e){Ust=e},"setAxisFormat");s9i=B(function(){return Ust},"getAxisFormat");l9i=B(function(e){Vst=e},"setTickInterval");c9i=B(function(){return Vst},"getTickInterval");u9i=B(function(e){$st=e},"setTodayMarker");d9i=B(function(){return $st},"getTodayMarker");f9i=B(function(e){ES=e},"setDateFormat");h9i=B(function(){pre=true},"enableInclusiveEndDates");p9i=B(function(){return pre},"endDatesAreInclusive");m9i=B(function(){qst=true},"enableTopAxis");g9i=B(function(){return qst},"topAxisEnabled");y9i=B(function(e){Wst=e},"setDisplayMode");b9i=B(function(){return Wst},"getDisplayMode");x9i=B(function(){return ES},"getDateFormat");vNn=B((e,t)=>{const n=t.toLowerCase().split(/[\s,]+/).filter(r=>r!=="");return[...new Set([...e,...n])]},"mergeTokens");v9i=B(function(e){yH=vNn(yH,e)},"setIncludes");_9i=B(function(){return yH},"getIncludes");T9i=B(function(e){bH=vNn(bH,e)},"setExcludes");w9i=B(function(){return bH},"getExcludes");E9i=B(function(){return Gst},"getLinks");C9i=B(function(e){xH=e;Hst.push(e)},"addSection");S9i=B(function(){return Hst},"getSections");A9i=B(function(){let e=hNn();const t=10;let n=0;while(!e&&ns){throw new Error("Failed to find a valid date that was not excluded by `excludes` after 10,000 iterations.")}}e=e.add(1,"d")}return[t,a]},"fixTaskDates");Bst=B(function(e,t,n){n=n.trim();const r=B(s=>{const l=s.trim();return l==="x"||l==="X"},"isTimestampFormat");if(r(t)&&/^\d+$/.test(n)){return new Date(Number(n))}const i=/^after\s+(?[\d\w- ]+)/;const o=i.exec(n);if(o!==null){let s=null;for(const u of o.groups.ids.split(" ")){let d=U6(u);if(d!==void 0&&(!s||d.endTime>s.endTime)){s=d}}if(s){return s.endTime}const l=new Date;l.setHours(0,0,0,0);return l}let a=(0,yv.default)(n,t.trim(),true);if(a.isValid()){return a.toDate()}else{wt.debug("Invalid date:"+n);wt.debug("With date format:"+t.trim());const s=new Date(n);if(s===void 0||isNaN(s.getTime())||s.getFullYear()<-1e4||s.getFullYear()>1e4){throw new Error("Invalid date:"+n)}return s}},"getStartDate");wNn=B(function(e){const t=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(e.trim());if(t!==null){return[Number.parseFloat(t[1]),t[2]]}return[NaN,"ms"]},"parseDuration");ENn=B(function(e,t,n,r=false){n=n.trim();const i=/^until\s+(?[\d\w- ]+)/;const o=i.exec(n);if(o!==null){let d=null;for(const h of o.groups.ids.split(" ")){let m=U6(h);if(m!==void 0&&(!d||m.startTime{window.open(n,"_self")});Gst.set(r,n)}});SNn(e,"clickable")},"setLink");SNn=B(function(e,t){e.split(",").forEach(function(n){let r=U6(n);if(r!==void 0){r.classes.push(t)}})},"setClass");O9i=B(function(e,t,n){if(Mn().securityLevel!=="loose"){return}if(t===void 0){return}let r=[];if(typeof n==="string"){r=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let o=0;o{Ko.runFunc(t,...r)})}},"setClickFun");ANn=B(function(e,t){Yst.push(function(){const n=pH?`${pH}-${e}`:e;const r=document.querySelector(`[id="${n}"]`);if(r!==null){r.addEventListener("click",function(){t()})}},function(){const n=pH?`${pH}-${e}`:e;const r=document.querySelector(`[id="${n}-text"]`);if(r!==null){r.addEventListener("click",function(){t()})}})},"pushFun");B9i=B(function(e,t,n){e.split(",").forEach(function(r){O9i(r,t,n)});SNn(e,"clickable")},"setClickEvent");z9i=B(function(e){Yst.forEach(function(t){t(e)})},"bindFunctions");U9i={getConfig:B(()=>Mn().gantt,"getConfig"),clear:i9i,setDateFormat:f9i,getDateFormat:x9i,enableInclusiveEndDates:h9i,endDatesAreInclusive:p9i,enableTopAxis:m9i,topAxisEnabled:g9i,setAxisFormat:a9i,getAxisFormat:s9i,setTickInterval:l9i,getTickInterval:c9i,setTodayMarker:u9i,getTodayMarker:d9i,setAccTitle:Ka,getAccTitle:is,setDiagramTitle:ys,getDiagramTitle:ss,setDiagramId:o9i,setDisplayMode:y9i,getDisplayMode:b9i,setAccDescription:os,getAccDescription:as,addSection:C9i,getSections:S9i,getTasks:A9i,addTask:D9i,findTaskById:U6,addTaskOrg:F9i,setIncludes:v9i,getIncludes:_9i,setExcludes:T9i,getExcludes:w9i,setClickEvent:B9i,setLink:N9i,getLinks:E9i,bindFunctions:z9i,parseDuration:wNn,isInvalidDate:_Nn,setWeekday:k9i,getWeekday:R9i,setWeekend:P9i};B(jst,"getTaskTags");mH.default.extend(kNn.default);V9i=B(function(){wt.debug("Something is calling, setConf, remove the call")},"setConf");pNn={monday:D3,tuesday:m0e,wednesday:g0e,thursday:zE,friday:y0e,saturday:b0e,sunday:WT};$9i=B((e,t)=>{let n=[...e].map(()=>-Infinity);let r=[...e].sort((o,a)=>o.startTime-a.startTime||o.order-a.order);let i=0;for(const o of r){for(let a=0;a=n[a]){n[a]=o.endTime;o.order=a+t;if(a>i){i=a}break}}}return i},"getMaxIntersections");Fst=1e4;G9i=B(function(e,t,n,r){const i=Mn().gantt;r.db.setDiagramId(t);const o=Mn().securityLevel;let a;if(o==="sandbox"){a=zr("#i"+t)}const s=o==="sandbox"?zr(a.nodes()[0].contentDocument.body):zr("body");const l=o==="sandbox"?a.nodes()[0].contentDocument:document;const u=l.getElementById(t);uP=u.parentElement.offsetWidth;if(uP===void 0){uP=1200}if(i.useWidth!==void 0){uP=i.useWidth}const d=r.db.getTasks();const f=d.filter(U=>!U.vert);let h=[];for(const U of f){h.push(U.type)}h=z(h);const m={};let g=2*i.topPadding;if(r.db.getDisplayMode()==="compact"||i.displayMode==="compact"){const U={};for(const H of f){if(U[H.section]===void 0){U[H.section]=[H]}else{U[H.section].push(H)}}let W=0;for(const H of Object.keys(U)){const $=$9i(U[H],W)+1;W+=$;g+=$*(i.barHeight+i.barGap);m[H]=$}}else{g+=f.length*(i.barHeight+i.barGap);for(const U of h){m[U]=f.filter(W=>W.type===U).length}}u.setAttribute("viewBox","0 0 "+uP+" "+g);const x=s.select(`[id="${t}"]`);const w=_0e().domain([s0e(d,function(U){return U.startTime}),pk(d,function(U){return U.endTime})]).rangeRound([0,uP-i.leftPadding-i.rightPadding]);function _(U,W){const H=U.startTime;const $=W.startTime;let K=0;if(H>$){K=1}else if(H<$){K=-1}return K}B(_,"taskCompare");d.sort(_);C(d,uP,g);Vs(x,g,uP,i.useMaxWidth);x.append("text").text(r.db.getDiagramTitle()).attr("x",uP/2).attr("y",i.titleTopMargin).attr("class","titleText");function C(U,W,H){const $=i.barHeight;const K=$+i.barGap;const X=i.topPadding;const j=i.leftPadding;const te=wc().domain([0,h.length]).range(["#00B9FA","#F95002"]).interpolate(f9e);P(K,X,j,W,H,U,r.db.getExcludes(),r.db.getIncludes());I(j,X,W,H);A(U,K,X,j,$,te,W,H);N(K,X,j,$,te);O(j,X,W,H)}B(C,"makeGantt");function A(U,W,H,$,K,X,j){U.sort((ue,xe)=>ue.vert===xe.vert?0:ue.vert?1:-1);const te=U.filter(ue=>!ue.vert);const J=[...new Set(te.map(ue=>ue.order))];const oe=J.map(ue=>te.find(xe=>xe.order===ue));x.append("g").selectAll("rect").data(oe).enter().append("rect").attr("x",0).attr("y",function(ue,xe){xe=ue.order;return xe*W+H-2}).attr("width",function(){return j-i.rightPadding/2}).attr("height",W).attr("class",function(ue){for(const[xe,be]of h.entries()){if(ue.type===be){return"section section"+xe%i.numberSectionStyles}}return"section section0"}).enter();const se=x.append("g").selectAll("rect").data(U).enter();const re=r.db.getLinks();se.append("rect").attr("id",function(ue){return t+"-"+ue.id}).attr("rx",3).attr("ry",3).attr("x",function(ue){if(ue.milestone){return w(ue.startTime)+$+.5*(w(ue.endTime)-w(ue.startTime))-.5*K}return w(ue.startTime)+$}).attr("y",function(ue,xe){xe=ue.order;if(ue.vert){return i.gridLineStartPadding}return xe*W+H}).attr("width",function(ue){if(ue.milestone){return K}if(ue.vert){return .08*K}return w(ue.renderEndTime||ue.endTime)-w(ue.startTime)}).attr("height",function(ue){if(ue.vert){return te.length*(i.barHeight+i.barGap)+i.barHeight*2}return K}).attr("transform-origin",function(ue,xe){xe=ue.order;return(w(ue.startTime)+$+.5*(w(ue.endTime)-w(ue.startTime))).toString()+"px "+(xe*W+H+.5*K).toString()+"px"}).attr("class",function(ue){const xe="task";let be="";if(ue.classes.length>0){be=ue.classes.join(" ")}let Ie=0;for(const[ve,ge]of h.entries()){if(ue.type===ge){Ie=ve%i.numberSectionStyles}}let he="";if(ue.active){if(ue.crit){he+=" activeCrit"}else{he=" active"}}else if(ue.done){if(ue.crit){he=" doneCrit"}else{he=" done"}}else{if(ue.crit){he+=" crit"}}if(he.length===0){he=" task"}if(ue.milestone){he=" milestone "+he}if(ue.vert){he=" vert "+he}he+=Ie;he+=" "+be;return xe+he});se.append("text").attr("id",function(ue){return t+"-"+ue.id+"-text"}).text(function(ue){return ue.task}).attr("font-size",i.fontSize).attr("x",function(ue){let xe=w(ue.startTime);let be=w(ue.renderEndTime||ue.endTime);if(ue.milestone){xe+=.5*(w(ue.endTime)-w(ue.startTime))-.5*K;be=xe+K}if(ue.vert){return w(ue.startTime)+$}const Ie=this.getBBox().width;if(Ie>be-xe){if(be+Ie+1.5*i.leftPadding>j){return xe+$-5}else{return be+$+5}}else{return(be-xe)/2+xe+$}}).attr("y",function(ue,xe){if(ue.vert){return i.gridLineStartPadding+te.length*(i.barHeight+i.barGap)+60}xe=ue.order;return xe*W+i.barHeight/2+(i.fontSize/2-2)+H}).attr("text-height",K).attr("class",function(ue){const xe=w(ue.startTime);let be=w(ue.endTime);if(ue.milestone){be=xe+K}const Ie=this.getBBox().width;let he="";if(ue.classes.length>0){he=ue.classes.join(" ")}let ve=0;for(const[Ve,Le]of h.entries()){if(ue.type===Le){ve=Ve%i.numberSectionStyles}}let ge="";if(ue.active){if(ue.crit){ge="activeCritText"+ve}else{ge="activeText"+ve}}if(ue.done){if(ue.crit){ge=ge+" doneCritText"+ve}else{ge=ge+" doneText"+ve}}else{if(ue.crit){ge=ge+" critText"+ve}}if(ue.milestone){ge+=" milestoneText"}if(ue.vert){ge+=" vertText"}if(Ie>be-xe){if(be+Ie+1.5*i.leftPadding>j){return he+" taskTextOutsideLeft taskTextOutside"+ve+" "+ge}else{return he+" taskTextOutsideRight taskTextOutside"+ve+" "+ge+" width-"+Ie}}else{return he+" taskText taskText"+ve+" "+ge+" width-"+Ie}});const ce=Mn().securityLevel;if(ce==="sandbox"){let ue;ue=zr("#i"+t);const xe=ue.nodes()[0].contentDocument;se.filter(function(be){return re.has(be.id)}).each(function(be){var Ie=xe.querySelector("#"+CSS.escape(t+"-"+be.id));var he=xe.querySelector("#"+CSS.escape(t+"-"+be.id+"-text"));const ve=Ie.parentNode;var ge=xe.createElement("a");ge.setAttribute("xlink:href",re.get(be.id));ge.setAttribute("target","_top");ve.appendChild(ge);ge.appendChild(Ie);ge.appendChild(he)})}}B(A,"drawRects");function P(U,W,H,$,K,X,j,te){if(j.length===0&&te.length===0){return}let J;let oe;for(const{startTime:be,endTime:Ie}of X){if(J===void 0||beoe){oe=Ie}}if(!J||!oe){return}if((0,mH.default)(oe).diff((0,mH.default)(J),"year")>5){wt.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");return}const se=r.db.getDateFormat();const re=[];let ce=null;let ue=(0,mH.default)(J);while(ue.valueOf()<=oe){if(r.db.isInvalidDate(ue,se,j,te)){if(!ce){ce={start:ue,end:ue}}else{ce.end=ue}}else{if(ce){re.push(ce);ce=null}}ue=ue.add(1,"d")}const xe=x.append("g").selectAll("rect").data(re).enter();xe.append("rect").attr("id",be=>t+"-exclude-"+be.start.format("YYYY-MM-DD")).attr("x",be=>w(be.start.startOf("day"))+H).attr("y",i.gridLineStartPadding).attr("width",be=>w(be.end.endOf("day"))-w(be.start.startOf("day"))).attr("height",K-W-i.gridLineStartPadding).attr("transform-origin",function(be,Ie){return(w(be.start)+H+.5*(w(be.end)-w(be.start))).toString()+"px "+(Ie*U+.5*K).toString()+"px"}).attr("class","exclude-range")}B(P,"drawExcludeDays");function L(U,W,H,$){if(H<=0||U>W){return Infinity}const K=W-U;const X=mH.default.duration({[$??"day"]:H}).asMilliseconds();if(X<=0){return Infinity}return Math.ceil(K/X)}B(L,"getEstimatedTickCount");function I(U,W,H,$){const K=r.db.getDateFormat();const X=r.db.getAxisFormat();let j;if(X){j=X}else if(K==="D"){j="%d"}else{j=i.axisFormat??"%Y-%m-%d"}let te=FXe(w).tickSize(-$+W+i.gridLineStartPadding).tickFormat(ZN(j));const J=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/;const oe=J.exec(r.db.getTickInterval()||i.tickInterval);if(oe!==null){const se=parseInt(oe[1],10);if(isNaN(se)||se<=0){wt.warn(`Invalid tick interval value: "${oe[1]}". Skipping custom tick interval.`)}else{const re=oe[2];const ce=r.db.getWeekday()||i.weekday;const ue=w.domain();const xe=ue[0];const be=ue[1];const Ie=L(xe,be,se,re);if(Ie>Fst){wt.warn(`The tick interval "${se}${re}" would generate ${Ie} ticks, which exceeds the maximum allowed (${Fst}). This may indicate an invalid date or time range. Skipping custom tick interval.`)}else{switch(re){case"millisecond":te.ticks(BE.every(se));break;case"second":te.ticks(A1.every(se));break;case"minute":te.ticks(yk.every(se));break;case"hour":te.ticks(bk.every(se));break;case"day":te.ticks(e_.every(se));break;case"week":te.ticks(pNn[ce].every(se));break;case"month":te.ticks(xk.every(se));break}}}}x.append("g").attr("class","grid").attr("transform","translate("+U+", "+($-50)+")").call(te).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em");if(r.db.topAxisEnabled()||i.topAxis){let se=DXe(w).tickSize(-$+W+i.gridLineStartPadding).tickFormat(ZN(j));if(oe!==null){const re=parseInt(oe[1],10);if(isNaN(re)||re<=0){wt.warn(`Invalid tick interval value: "${oe[1]}". Skipping custom tick interval.`)}else{const ce=oe[2];const ue=r.db.getWeekday()||i.weekday;const xe=w.domain();const be=xe[0];const Ie=xe[1];const he=L(be,Ie,re,ce);if(he<=Fst){switch(ce){case"millisecond":se.ticks(BE.every(re));break;case"second":se.ticks(A1.every(re));break;case"minute":se.ticks(yk.every(re));break;case"hour":se.ticks(bk.every(re));break;case"day":se.ticks(e_.every(re));break;case"week":se.ticks(pNn[ue].every(re));break;case"month":se.ticks(xk.every(re));break}}}}x.append("g").attr("class","grid").attr("transform","translate("+U+", "+W+")").call(se).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}B(I,"makeGrid");function N(U,W){let H=0;const $=Object.keys(m).map(K=>[K,m[K]]);x.append("g").selectAll("text").data($).enter().append(function(K){const X=K[0].split(Ti.lineBreakRegex);const j=-(X.length-1)/2;const te=l.createElementNS("http://www.w3.org/2000/svg","text");te.setAttribute("dy",j+"em");for(const[J,oe]of X.entries()){const se=l.createElementNS("http://www.w3.org/2000/svg","tspan");se.setAttribute("alignment-baseline","central");se.setAttribute("x","10");if(J>0){se.setAttribute("dy","1em")}se.textContent=oe;te.appendChild(se)}return te}).attr("x",10).attr("y",function(K,X){if(X>0){for(let j=0;j` + .mermaid-main-font { + font-family: ${e.fontFamily}; + } + + .exclude-range { + fill: ${e.excludeBkgColor}; + } + + .section { + stroke: none; + opacity: 0.2; + } + + .section0 { + fill: ${e.sectionBkgColor}; + } + + .section2 { + fill: ${e.sectionBkgColor2}; + } + + .section1, + .section3 { + fill: ${e.altSectionBkgColor}; + opacity: 0.2; + } + + .sectionTitle0 { + fill: ${e.titleColor}; + } + + .sectionTitle1 { + fill: ${e.titleColor}; + } + + .sectionTitle2 { + fill: ${e.titleColor}; + } + + .sectionTitle3 { + fill: ${e.titleColor}; + } + + .sectionTitle { + text-anchor: start; + font-family: ${e.fontFamily}; + } + + + /* Grid and axis */ + + .grid .tick { + stroke: ${e.gridColor}; + opacity: 0.8; + shape-rendering: crispEdges; + } + + .grid .tick text { + font-family: ${e.fontFamily}; + fill: ${e.textColor}; + } + + .grid path { + stroke-width: 0; + } + + + /* Today line */ + + .today { + fill: none; + stroke: ${e.todayLineColor}; + stroke-width: 2px; + } + + + /* Task styling */ + + /* Default task */ + + .task { + stroke-width: 2; + } + + .taskText { + text-anchor: middle; + font-family: ${e.fontFamily}; + } + + .taskTextOutsideRight { + fill: ${e.taskTextDarkColor}; + text-anchor: start; + font-family: ${e.fontFamily}; + } + + .taskTextOutsideLeft { + fill: ${e.taskTextDarkColor}; + text-anchor: end; + } + + + /* Special case clickable */ + + .task.clickable { + cursor: pointer; + } + + .taskText.clickable { + cursor: pointer; + fill: ${e.taskTextClickableColor} !important; + font-weight: bold; + } + + .taskTextOutsideLeft.clickable { + cursor: pointer; + fill: ${e.taskTextClickableColor} !important; + font-weight: bold; + } + + .taskTextOutsideRight.clickable { + cursor: pointer; + fill: ${e.taskTextClickableColor} !important; + font-weight: bold; + } + + + /* Specific task settings for the sections*/ + + .taskText0, + .taskText1, + .taskText2, + .taskText3 { + fill: ${e.taskTextColor}; + } + + .task0, + .task1, + .task2, + .task3 { + fill: ${e.taskBkgColor}; + stroke: ${e.taskBorderColor}; + } + + .taskTextOutside0, + .taskTextOutside2 + { + fill: ${e.taskTextOutsideColor}; + } + + .taskTextOutside1, + .taskTextOutside3 { + fill: ${e.taskTextOutsideColor}; + } + + + /* Active task */ + + .active0, + .active1, + .active2, + .active3 { + fill: ${e.activeTaskBkgColor}; + stroke: ${e.activeTaskBorderColor}; + } + + .activeText0, + .activeText1, + .activeText2, + .activeText3 { + fill: ${e.taskTextDarkColor} !important; + } + + + /* Completed task */ + + .done0, + .done1, + .done2, + .done3 { + stroke: ${e.doneTaskBorderColor}; + fill: ${e.doneTaskBkgColor}; + stroke-width: 2; + } + + .doneText0, + .doneText1, + .doneText2, + .doneText3 { + fill: ${e.taskTextDarkColor} !important; + } + + /* Done task text displayed outside the bar sits against the diagram background, + not against the done-task bar, so it must use the outside/contrast color. */ + .doneText0.taskTextOutsideLeft, + .doneText0.taskTextOutsideRight, + .doneText1.taskTextOutsideLeft, + .doneText1.taskTextOutsideRight, + .doneText2.taskTextOutsideLeft, + .doneText2.taskTextOutsideRight, + .doneText3.taskTextOutsideLeft, + .doneText3.taskTextOutsideRight { + fill: ${e.taskTextOutsideColor} !important; + } + + + /* Tasks on the critical line */ + + .crit0, + .crit1, + .crit2, + .crit3 { + stroke: ${e.critBorderColor}; + fill: ${e.critBkgColor}; + stroke-width: 2; + } + + .activeCrit0, + .activeCrit1, + .activeCrit2, + .activeCrit3 { + stroke: ${e.critBorderColor}; + fill: ${e.activeTaskBkgColor}; + stroke-width: 2; + } + + .doneCrit0, + .doneCrit1, + .doneCrit2, + .doneCrit3 { + stroke: ${e.critBorderColor}; + fill: ${e.doneTaskBkgColor}; + stroke-width: 2; + cursor: pointer; + shape-rendering: crispEdges; + } + + .milestone { + transform: rotate(45deg) scale(0.8,0.8); + } + + .milestoneText { + font-style: italic; + } + .doneCritText0, + .doneCritText1, + .doneCritText2, + .doneCritText3 { + fill: ${e.taskTextDarkColor} !important; + } + + /* Done-crit task text outside the bar \u2014 same reasoning as doneText above. */ + .doneCritText0.taskTextOutsideLeft, + .doneCritText0.taskTextOutsideRight, + .doneCritText1.taskTextOutsideLeft, + .doneCritText1.taskTextOutsideRight, + .doneCritText2.taskTextOutsideLeft, + .doneCritText2.taskTextOutsideRight, + .doneCritText3.taskTextOutsideLeft, + .doneCritText3.taskTextOutsideRight { + fill: ${e.taskTextOutsideColor} !important; + } + + .vert { + stroke: ${e.vertLineColor}; + } + + .vertText { + font-size: 15px; + text-anchor: middle; + fill: ${e.vertLineColor} !important; + } + + .activeCritText0, + .activeCritText1, + .activeCritText2, + .activeCritText3 { + fill: ${e.taskTextDarkColor} !important; + } + + .titleText { + text-anchor: middle; + font-size: 18px; + fill: ${e.titleColor||e.textColor}; + font-family: ${e.fontFamily}; + } +`,"getStyles");Y9i=W9i;q9i={parser:r9i,db:U9i,renderer:H9i,styles:Y9i}});var INn={};Oo(INn,{diagram:()=>eUi});var X9i,j9i,K9i,Z9i,J9i,Q9i,eUi;var MNn=Ce(()=>{gh();Ta();Aa();Yo();zg();X9i={parse:B(async e=>{const t=await Pf("info",e);wt.debug(t)},"parse")};j9i={version:"11.16.1"+(true?"":"-tiny")};K9i=B(()=>j9i.version,"getVersion");Z9i={getVersion:K9i};J9i=B((e,t,n)=>{wt.debug("rendering info diagram\n"+e);const r=Sc(t);Vs(r,100,400,true);const i=r.append("g");i.append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${n}`)},"draw");Q9i={draw:J9i};eUi={parser:X9i,db:Z9i,renderer:Q9i}});var FNn={};Oo(FNn,{diagram:()=>mUi});var LNn,Kst,SPe,Zst,tUi,nUi,rUi,iUi,oUi,aUi,sUi,DNn,lUi,cUi,uUi,dUi,fUi,hUi,pUi,mUi;var NNn=Ce(()=>{rb();gh();nl();Ta();Aa();Yo();zg();ks();LNn=ka.pie;Kst={sections:new Map,showData:false,config:LNn};SPe=Kst.sections;Zst=Kst.showData;tUi=structuredClone(LNn);nUi=B(()=>structuredClone(tUi),"getConfig");rUi=B(()=>{SPe=new Map;Zst=Kst.showData;Da()},"clear");iUi=B(({label:e,value:t})=>{if(t<0){throw new Error(`"${e}" has invalid value: ${t}. Negative values are not allowed in pie charts. All slice values must be >= 0.`)}if(!SPe.has(e)){SPe.set(e,t);wt.debug(`added new section: ${e}, with value: ${t}`)}},"addSection");oUi=B(()=>SPe,"getSections");aUi=B(e=>{Zst=e},"setShowData");sUi=B(()=>Zst,"getShowData");DNn={getConfig:nUi,clear:rUi,setDiagramTitle:ys,getDiagramTitle:ss,setAccTitle:Ka,getAccTitle:is,setAccDescription:os,getAccDescription:as,addSection:iUi,getSections:oUi,setShowData:aUi,getShowData:sUi};lUi=B((e,t)=>{mu(e,t);t.setShowData(e.showData);e.sections.map(t.addSection)},"populateDb");cUi={parse:B(async e=>{const t=await Pf("pie",e);wt.debug(t);lUi(t,DNn)},"parse")};uUi=B(e=>` + .pieCircle{ + stroke: ${e.pieStrokeColor}; + stroke-width : ${e.pieStrokeWidth}; + opacity : ${e.pieOpacity}; + } + .pieCircle.highlighted{ + scale: 1.05; + opacity: 1; + } + .pieCircle.highlightedOnHover:hover{ + transition-duration: 250ms; + scale: 1.05; + opacity: 1; + } + .pieOuterCircle{ + stroke: ${e.pieOuterStrokeColor}; + stroke-width: ${e.pieOuterStrokeWidth}; + fill: none; + } + .pieTitleText { + text-anchor: middle; + font-size: ${e.pieTitleTextSize}; + fill: ${e.pieTitleTextColor}; + font-family: ${e.fontFamily}; + } + .slice { + font-family: ${e.fontFamily}; + fill: ${e.pieSectionTextColor}; + font-size:${e.pieSectionTextSize}; + // fill: white; + } + .legend text { + fill: ${e.pieLegendTextColor}; + font-family: ${e.fontFamily}; + font-size: ${e.pieLegendTextSize}; + } +`,"getStyles");dUi=uUi;fUi=B(e=>{const t=[...e.values()].reduce((i,o)=>i+o,0);const n=[...e.entries()].map(([i,o])=>({label:i,value:o})).filter(i=>i.value/t*100>=1);const r=oO().value(i=>i.value).sort(null);return r(n)},"createPieArcs");hUi=B((e,t,n,r)=>{wt.debug("rendering pie chart\n"+e);const i=r.db;const o=Mn();const a=Cl(i.getConfig(),o.pie);const s=40;const l=18;const u=4;const d=450;const f=d;const h=Sc(t);const m=h.append("g");m.attr("transform","translate("+f/2+","+d/2+")");const{themeVariables:g}=o;let[x]=mx(g.pieOuterStrokeWidth);x??=2;const w=a.legendPosition;const _=a.textPosition;const C=a.donutHole>0&&a.donutHole<=.9?a.donutHole:0;const A=Math.min(f,d)/2-s;const P=Hb().innerRadius(C*A).outerRadius(A);const L=Hb().innerRadius(A*_).outerRadius(A*_);const I=m.append("g");I.append("circle").attr("cx",0).attr("cy",0).attr("r",A+x/2).attr("class","pieOuterCircle");const N=i.getSections();const O=fUi(N);const z=[g.pie1,g.pie2,g.pie3,g.pie4,g.pie5,g.pie6,g.pie7,g.pie8,g.pie9,g.pie10,g.pie11,g.pie12];let U=0;N.forEach(he=>{U+=he});const W=O.filter(he=>(he.data.value/U*100).toFixed(0)!=="0");const H=mg(z).domain([...N.keys()]);I.selectAll("mySlices").data(W).enter().append("path").attr("d",P).attr("fill",he=>{return H(he.data.label)}).attr("class",he=>{let ve="pieCircle";if(a.highlightSlice==="hover"){ve+=" highlightedOnHover"}else if(a.highlightSlice===he.data.label){ve+=" highlighted"}return ve});I.selectAll("mySlices").data(W).enter().append("text").text(he=>{return(he.data.value/U*100).toFixed(0)+"%"}).attr("transform",he=>{return"translate("+L.centroid(he)+")"}).style("text-anchor","middle").attr("class","slice");const $=m.append("text").text(i.getDiagramTitle()).attr("x",0).attr("y",-(d-50)/2).attr("class","pieTitleText");const K=[...N.entries()].map(([he,ve])=>({label:he,value:ve}));const X=m.selectAll(".legend").data(K).enter().append("g").attr("class","legend");X.append("rect").attr("width",l).attr("height",l).style("fill",he=>H(he.label)).style("stroke",he=>H(he.label));X.append("text").attr("x",l+u).attr("y",l-u).text(he=>{if(i.getShowData()){return`${he.label} [${he.value}]`}return he.label});const j=Math.max(...X.selectAll("text").nodes().map(he=>he?.getBoundingClientRect().width??0));let te=d;let J=f+s;const oe=l+u;const se=K.length*oe;switch(w){case"center":X.attr("transform",(he,ve)=>{const ge=oe*K.length/2;const Ve=-j/2-(l+u);const Le=ve*oe-ge;return"translate("+Ve+","+Le+")"});break;case"top":te+=se;X.attr("transform",(he,ve)=>{const ge=A;const Ve=-j/2-(l+u);const Le=ve*oe-ge;return`translate(${Ve}, ${Le})`});I.attr("transform",()=>{return`translate(0, ${se+oe})`});break;case"bottom":te+=se;X.attr("transform",(he,ve)=>{const ge=-A-oe;const Ve=-j/2-(l+u);const Le=ve*oe-ge;return"translate("+Ve+","+Le+")"});break;case"left":J+=l+u+j;X.attr("transform",(he,ve)=>{const ge=oe*K.length/2;const Ve=-A-(l+u);const Le=ve*oe-ge;return"translate("+Ve+","+Le+")"});I.attr("transform",()=>{return`translate(${j+l+u}, 0)`});break;case"right":default:J+=l+u+j;X.attr("transform",(he,ve)=>{const ge=oe*K.length/2;const Ve=12*l;const Le=ve*oe-ge;return"translate("+Ve+","+Le+")"});break}const re=$.node()?.getBoundingClientRect().width??0;const ce=f/2-re/2;const ue=f/2+re/2;const xe=Math.min(0,ce);const be=Math.max(J,ue);const Ie=be-xe;h.attr("viewBox",`${xe} 0 ${Ie} ${te}`);Vs(h,te,Ie,a.useMaxWidth)},"draw");pUi={draw:hUi};mUi={parser:cUi,db:DNn,renderer:pUi,styles:dUi}});var JNn={};Oo(JNn,{diagram:()=>TUi});function Qst(e){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(e)}function ONn(e){return!/^\d+$/.test(e)}function BNn(e){return!/^\d+px$/.test(e)}function CS(e){return La(e.trim(),Mn())}function zNn(e){Ug.setData({quadrant1Text:CS(e.text)})}function UNn(e){Ug.setData({quadrant2Text:CS(e.text)})}function VNn(e){Ug.setData({quadrant3Text:CS(e.text)})}function $Nn(e){Ug.setData({quadrant4Text:CS(e.text)})}function GNn(e){Ug.setData({xAxisLeftText:CS(e.text)})}function HNn(e){Ug.setData({xAxisRightText:CS(e.text)})}function WNn(e){Ug.setData({yAxisTopText:CS(e.text)})}function YNn(e){Ug.setData({yAxisBottomText:CS(e.text)})}function kPe(e){const t={};for(const n of e){const[r,i]=n.trim().split(/\s*:\s*/);if(r==="radius"){if(ONn(i)){throw new APe(r,i,"number")}t.radius=parseInt(i)}else if(r==="color"){if(Qst(i)){throw new APe(r,i,"hex code")}t.color=i}else if(r==="stroke-color"){if(Qst(i)){throw new APe(r,i,"hex code")}t.strokeColor=i}else if(r==="stroke-width"){if(BNn(i)){throw new APe(r,i,"number of pixels (eg. 10px)")}t.strokeWidth=i}else{throw new Error(`style named ${r} is not supported.`)}}return t}function qNn(e,t,n,r,i){const o=kPe(i);Ug.addPoints([{x:n,y:r,text:CS(e.text),className:t,...o}])}function XNn(e,t){Ug.addClass(e,kPe(t))}function jNn(e){Ug.setConfig({chartWidth:e})}function KNn(e){Ug.setConfig({chartHeight:e})}function ZNn(){const e=Mn();const{themeVariables:t,quadrantChart:n}=e;if(n){Ug.setConfig(n)}Ug.setThemeConfig({quadrant1Fill:t.quadrant1Fill,quadrant2Fill:t.quadrant2Fill,quadrant3Fill:t.quadrant3Fill,quadrant4Fill:t.quadrant4Fill,quadrant1TextFill:t.quadrant1TextFill,quadrant2TextFill:t.quadrant2TextFill,quadrant3TextFill:t.quadrant3TextFill,quadrant4TextFill:t.quadrant4TextFill,quadrantPointFill:t.quadrantPointFill,quadrantPointTextFill:t.quadrantPointTextFill,quadrantXAxisTextFill:t.quadrantXAxisTextFill,quadrantYAxisTextFill:t.quadrantYAxisTextFill,quadrantExternalBorderStrokeFill:t.quadrantExternalBorderStrokeFill,quadrantInternalBorderStrokeFill:t.quadrantInternalBorderStrokeFill,quadrantTitleFill:t.quadrantTitleFill});Ug.setData({titleText:ss()});return Ug.build()}var Jst,gUi,hb,yUi,APe,Ug,bUi,xUi,vUi,_Ui,TUi;var QNn=Ce(()=>{Ta();Aa();Yo();ks();ks();Jst=function(){var e=B(function(Ae,dt,Oe,Wt){for(Oe=Oe||{},Wt=Ae.length;Wt--;Oe[Ae[Wt]]=dt);return Oe},"o"),t=[1,3],n=[1,4],r=[1,5],i=[1,6],o=[1,7],a=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],s=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],l=[55,56,57],u=[2,36],d=[1,37],f=[1,36],h=[1,38],m=[1,35],g=[1,43],x=[1,41],w=[1,45],_=[1,14],C=[1,23],A=[1,18],P=[1,19],L=[1,20],I=[1,21],N=[1,22],O=[1,24],z=[1,25],U=[1,26],W=[1,27],H=[1,28],$=[1,29],K=[1,32],X=[1,33],j=[1,34],te=[1,39],J=[1,40],oe=[1,42],se=[1,44],re=[1,63],ce=[1,62],ue=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],xe=[1,66],be=[1,67],Ie=[1,68],he=[1,69],ve=[1,70],ge=[1,71],Ve=[1,72],Le=[1,73],$e=[1,74],Ee=[1,75],tt=[1,76],yt=[1,77],mt=[4,5,6,7,8,9,10,11,12,13,14,15,18],ct=[1,91],Ge=[1,92],it=[1,93],bt=[1,100],He=[1,94],Je=[1,97],Te=[1,95],we=[1,96],Ze=[1,98],Be=[1,99],qe=[1,103],Qe=[10,55,56,57],ze=[4,5,6,8,10,11,13,17,18,19,20,55,56,57];var Me={trace:B(function Ae(){},"trace"),yy:{},symbols_:{"error":2,"idStringToken":3,"ALPHA":4,"NUM":5,"NODE_STRING":6,"DOWN":7,"MINUS":8,"DEFAULT":9,"COMMA":10,"COLON":11,"AMP":12,"BRKT":13,"MULT":14,"UNICODE_TEXT":15,"styleComponent":16,"UNIT":17,"SPACE":18,"STYLE":19,"PCT":20,"idString":21,"style":22,"stylesOpt":23,"classDefStatement":24,"CLASSDEF":25,"start":26,"eol":27,"QUADRANT":28,"document":29,"line":30,"statement":31,"axisDetails":32,"quadrantDetails":33,"points":34,"title":35,"title_value":36,"acc_title":37,"acc_title_value":38,"acc_descr":39,"acc_descr_value":40,"acc_descr_multiline_value":41,"section":42,"text":43,"point_start":44,"point_x":45,"point_y":46,"class_name":47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,"QUADRANT_1":51,"QUADRANT_2":52,"QUADRANT_3":53,"QUADRANT_4":54,"NEWLINE":55,"SEMI":56,"EOF":57,"alphaNumToken":58,"textNoTagsToken":59,"STR":60,"MD_STR":61,"alphaNum":62,"PUNCTUATION":63,"PLUS":64,"EQUALS":65,"DOT":66,"UNDERSCORE":67,"$accept":0,"$end":1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:B(function Ae(dt,Oe,Wt,kt,qt,_t,sn){var Jt=_t.length-1;switch(qt){case 23:this.$=_t[Jt];break;case 24:this.$=_t[Jt-1]+""+_t[Jt];break;case 26:this.$=_t[Jt-1]+_t[Jt];break;case 27:this.$=[_t[Jt].trim()];break;case 28:_t[Jt-2].push(_t[Jt].trim());this.$=_t[Jt-2];break;case 29:this.$=_t[Jt-4];kt.addClass(_t[Jt-2],_t[Jt]);break;case 37:this.$=[];break;case 42:this.$=_t[Jt].trim();kt.setDiagramTitle(this.$);break;case 43:this.$=_t[Jt].trim();kt.setAccTitle(this.$);break;case 44:case 45:this.$=_t[Jt].trim();kt.setAccDescription(this.$);break;case 46:kt.addSection(_t[Jt].substr(8));this.$=_t[Jt].substr(8);break;case 47:kt.addPoint(_t[Jt-3],"",_t[Jt-1],_t[Jt],[]);break;case 48:kt.addPoint(_t[Jt-4],_t[Jt-3],_t[Jt-1],_t[Jt],[]);break;case 49:kt.addPoint(_t[Jt-4],"",_t[Jt-2],_t[Jt-1],_t[Jt]);break;case 50:kt.addPoint(_t[Jt-5],_t[Jt-4],_t[Jt-2],_t[Jt-1],_t[Jt]);break;case 51:kt.setXAxisLeftText(_t[Jt-2]);kt.setXAxisRightText(_t[Jt]);break;case 52:_t[Jt-1].text+=" \u27F6 ";kt.setXAxisLeftText(_t[Jt-1]);break;case 53:kt.setXAxisLeftText(_t[Jt]);break;case 54:kt.setYAxisBottomText(_t[Jt-2]);kt.setYAxisTopText(_t[Jt]);break;case 55:_t[Jt-1].text+=" \u27F6 ";kt.setYAxisBottomText(_t[Jt-1]);break;case 56:kt.setYAxisBottomText(_t[Jt]);break;case 57:kt.setQuadrant1Text(_t[Jt]);break;case 58:kt.setQuadrant2Text(_t[Jt]);break;case 59:kt.setQuadrant3Text(_t[Jt]);break;case 60:kt.setQuadrant4Text(_t[Jt]);break;case 64:this.$={text:_t[Jt],type:"text"};break;case 65:this.$={text:_t[Jt-1].text+""+_t[Jt],type:_t[Jt-1].type};break;case 66:this.$={text:_t[Jt],type:"text"};break;case 67:this.$={text:_t[Jt],type:"markdown"};break;case 68:this.$=_t[Jt];break;case 69:this.$=_t[Jt-1]+""+_t[Jt];break}},"anonymous"),table:[{18:t,26:1,27:2,28:n,55:r,56:i,57:o},{1:[3]},{18:t,26:8,27:2,28:n,55:r,56:i,57:o},{18:t,26:9,27:2,28:n,55:r,56:i,57:o},e(a,[2,33],{29:10}),e(s,[2,61]),e(s,[2,62]),e(s,[2,63]),{1:[2,30]},{1:[2,31]},e(l,u,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:d,5:f,10:h,12:m,13:g,14:x,15:w,18:_,25:C,35:A,37:P,39:L,41:I,42:N,48:O,50:z,51:U,52:W,53:H,54:$,60:K,61:X,63:j,64:te,65:J,66:oe,67:se}),e(a,[2,34]),{27:46,55:r,56:i,57:o},e(l,[2,37]),e(l,u,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:d,5:f,10:h,12:m,13:g,14:x,15:w,18:_,25:C,35:A,37:P,39:L,41:I,42:N,48:O,50:z,51:U,52:W,53:H,54:$,60:K,61:X,63:j,64:te,65:J,66:oe,67:se}),e(l,[2,39]),e(l,[2,40]),e(l,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},e(l,[2,45]),e(l,[2,46]),{18:[1,51]},{4:d,5:f,10:h,12:m,13:g,14:x,15:w,43:52,58:31,60:K,61:X,63:j,64:te,65:J,66:oe,67:se},{4:d,5:f,10:h,12:m,13:g,14:x,15:w,43:53,58:31,60:K,61:X,63:j,64:te,65:J,66:oe,67:se},{4:d,5:f,10:h,12:m,13:g,14:x,15:w,43:54,58:31,60:K,61:X,63:j,64:te,65:J,66:oe,67:se},{4:d,5:f,10:h,12:m,13:g,14:x,15:w,43:55,58:31,60:K,61:X,63:j,64:te,65:J,66:oe,67:se},{4:d,5:f,10:h,12:m,13:g,14:x,15:w,43:56,58:31,60:K,61:X,63:j,64:te,65:J,66:oe,67:se},{4:d,5:f,10:h,12:m,13:g,14:x,15:w,43:57,58:31,60:K,61:X,63:j,64:te,65:J,66:oe,67:se},{4:d,5:f,8:re,10:h,12:m,13:g,14:x,15:w,18:ce,44:[1,58],47:[1,59],58:61,59:60,63:j,64:te,65:J,66:oe,67:se},e(ue,[2,64]),e(ue,[2,66]),e(ue,[2,67]),e(ue,[2,70]),e(ue,[2,71]),e(ue,[2,72]),e(ue,[2,73]),e(ue,[2,74]),e(ue,[2,75]),e(ue,[2,76]),e(ue,[2,77]),e(ue,[2,78]),e(ue,[2,79]),e(ue,[2,80]),e(ue,[2,81]),e(a,[2,35]),e(l,[2,38]),e(l,[2,42]),e(l,[2,43]),e(l,[2,44]),{3:65,4:xe,5:be,6:Ie,7:he,8:ve,9:ge,10:Ve,11:Le,12:$e,13:Ee,14:tt,15:yt,21:64},e(l,[2,53],{59:60,58:61,4:d,5:f,8:re,10:h,12:m,13:g,14:x,15:w,18:ce,49:[1,78],63:j,64:te,65:J,66:oe,67:se}),e(l,[2,56],{59:60,58:61,4:d,5:f,8:re,10:h,12:m,13:g,14:x,15:w,18:ce,49:[1,79],63:j,64:te,65:J,66:oe,67:se}),e(l,[2,57],{59:60,58:61,4:d,5:f,8:re,10:h,12:m,13:g,14:x,15:w,18:ce,63:j,64:te,65:J,66:oe,67:se}),e(l,[2,58],{59:60,58:61,4:d,5:f,8:re,10:h,12:m,13:g,14:x,15:w,18:ce,63:j,64:te,65:J,66:oe,67:se}),e(l,[2,59],{59:60,58:61,4:d,5:f,8:re,10:h,12:m,13:g,14:x,15:w,18:ce,63:j,64:te,65:J,66:oe,67:se}),e(l,[2,60],{59:60,58:61,4:d,5:f,8:re,10:h,12:m,13:g,14:x,15:w,18:ce,63:j,64:te,65:J,66:oe,67:se}),{45:[1,80]},{44:[1,81]},e(ue,[2,65]),e(ue,[2,82]),e(ue,[2,83]),e(ue,[2,84]),{3:83,4:xe,5:be,6:Ie,7:he,8:ve,9:ge,10:Ve,11:Le,12:$e,13:Ee,14:tt,15:yt,18:[1,82]},e(mt,[2,23]),e(mt,[2,1]),e(mt,[2,2]),e(mt,[2,3]),e(mt,[2,4]),e(mt,[2,5]),e(mt,[2,6]),e(mt,[2,7]),e(mt,[2,8]),e(mt,[2,9]),e(mt,[2,10]),e(mt,[2,11]),e(mt,[2,12]),e(l,[2,52],{58:31,43:84,4:d,5:f,10:h,12:m,13:g,14:x,15:w,60:K,61:X,63:j,64:te,65:J,66:oe,67:se}),e(l,[2,55],{58:31,43:85,4:d,5:f,10:h,12:m,13:g,14:x,15:w,60:K,61:X,63:j,64:te,65:J,66:oe,67:se}),{46:[1,86]},{45:[1,87]},{4:ct,5:Ge,6:it,8:bt,11:He,13:Je,16:90,17:Te,18:we,19:Ze,20:Be,22:89,23:88},e(mt,[2,24]),e(l,[2,51],{59:60,58:61,4:d,5:f,8:re,10:h,12:m,13:g,14:x,15:w,18:ce,63:j,64:te,65:J,66:oe,67:se}),e(l,[2,54],{59:60,58:61,4:d,5:f,8:re,10:h,12:m,13:g,14:x,15:w,18:ce,63:j,64:te,65:J,66:oe,67:se}),e(l,[2,47],{22:89,16:90,23:101,4:ct,5:Ge,6:it,8:bt,11:He,13:Je,17:Te,18:we,19:Ze,20:Be}),{46:[1,102]},e(l,[2,29],{10:qe}),e(Qe,[2,27],{16:104,4:ct,5:Ge,6:it,8:bt,11:He,13:Je,17:Te,18:we,19:Ze,20:Be}),e(ze,[2,25]),e(ze,[2,13]),e(ze,[2,14]),e(ze,[2,15]),e(ze,[2,16]),e(ze,[2,17]),e(ze,[2,18]),e(ze,[2,19]),e(ze,[2,20]),e(ze,[2,21]),e(ze,[2,22]),e(l,[2,49],{10:qe}),e(l,[2,48],{22:89,16:90,23:105,4:ct,5:Ge,6:it,8:bt,11:He,13:Je,17:Te,18:we,19:Ze,20:Be}),{4:ct,5:Ge,6:it,8:bt,11:He,13:Je,16:90,17:Te,18:we,19:Ze,20:Be,22:106},e(ze,[2,26]),e(l,[2,50],{10:qe}),e(Qe,[2,28],{16:104,4:ct,5:Ge,6:it,8:bt,11:He,13:Je,17:Te,18:we,19:Ze,20:Be})],defaultActions:{8:[2,30],9:[2,31]},parseError:B(function Ae(dt,Oe){if(Oe.recoverable){this.trace(dt)}else{var Wt=new Error(dt);Wt.hash=Oe;throw Wt}},"parseError"),parse:B(function Ae(dt){var Oe=this,Wt=[0],kt=[],qt=[null],_t=[],sn=this.table,Jt="",Sn=0,Kt=0,mn=0,At=2,lr=1;var on=_t.slice.call(arguments,1);var cr=Object.create(this.lexer);var Hr={yy:{}};for(var Mr in this.yy){if(Object.prototype.hasOwnProperty.call(this.yy,Mr)){Hr.yy[Mr]=this.yy[Mr]}}cr.setInput(dt,Hr.yy);Hr.yy.lexer=cr;Hr.yy.parser=this;if(typeof cr.yylloc=="undefined"){cr.yylloc={}}var Er=cr.yylloc;_t.push(Er);var vr=cr.options&&cr.options.ranges;if(typeof Hr.yy.parseError==="function"){this.parseError=Hr.yy.parseError}else{this.parseError=Object.getPrototypeOf(this).parseError}function Yr(Et){Wt.length=Wt.length-2*Et;qt.length=qt.length-Et;_t.length=_t.length-Et}B(Yr,"popStack");function nt(){var Et;Et=kt.pop()||cr.lex()||lr;if(typeof Et!=="number"){if(Et instanceof Array){kt=Et;Et=kt.pop()}Et=Oe.symbols_[Et]||Et}return Et}B(nt,"lex");var Rr,Xr,dr,rn,St,Ut,Pt={},an,Xt,Cn,rr;while(true){dr=Wt[Wt.length-1];if(this.defaultActions[dr]){rn=this.defaultActions[dr]}else{if(Rr===null||typeof Rr=="undefined"){Rr=nt()}rn=sn[dr]&&sn[dr][Rr]}if(typeof rn==="undefined"||!rn.length||!rn[0]){var hr="";rr=[];for(an in sn[dr]){if(this.terminals_[an]&&an>At){rr.push("'"+this.terminals_[an]+"'")}}if(cr.showPosition){hr="Parse error on line "+(Sn+1)+":\n"+cr.showPosition()+"\nExpecting "+rr.join(", ")+", got '"+(this.terminals_[Rr]||Rr)+"'"}else{hr="Parse error on line "+(Sn+1)+": Unexpected "+(Rr==lr?"end of input":"'"+(this.terminals_[Rr]||Rr)+"'")}this.parseError(hr,{text:cr.match,token:this.terminals_[Rr]||Rr,line:cr.yylineno,loc:Er,expected:rr})}if(rn[0]instanceof Array&&rn.length>1){throw new Error("Parse Error: multiple actions possible at state: "+dr+", token: "+Rr)}switch(rn[0]){case 1:Wt.push(Rr);qt.push(cr.yytext);_t.push(cr.yylloc);Wt.push(rn[1]);Rr=null;if(!Xr){Kt=cr.yyleng;Jt=cr.yytext;Sn=cr.yylineno;Er=cr.yylloc;if(mn>0){mn--}}else{Rr=Xr;Xr=null}break;case 2:Xt=this.productions_[rn[1]][1];Pt.$=qt[qt.length-Xt];Pt._$={first_line:_t[_t.length-(Xt||1)].first_line,last_line:_t[_t.length-1].last_line,first_column:_t[_t.length-(Xt||1)].first_column,last_column:_t[_t.length-1].last_column};if(vr){Pt._$.range=[_t[_t.length-(Xt||1)].range[0],_t[_t.length-1].range[1]]}Ut=this.performAction.apply(Pt,[Jt,Kt,Sn,Hr.yy,rn[1],qt,_t].concat(on));if(typeof Ut!=="undefined"){return Ut}if(Xt){Wt=Wt.slice(0,-1*Xt*2);qt=qt.slice(0,-1*Xt);_t=_t.slice(0,-1*Xt)}Wt.push(this.productions_[rn[1]][0]);qt.push(Pt.$);_t.push(Pt._$);Cn=sn[Wt[Wt.length-2]][Wt[Wt.length-1]];Wt.push(Cn);break;case 3:return true}}return true},"parse")};var ye=function(){var Ae={EOF:1,parseError:B(function dt(Oe,Wt){if(this.yy.parser){this.yy.parser.parseError(Oe,Wt)}else{throw new Error(Oe)}},"parseError"),setInput:B(function(dt,Oe){this.yy=Oe||this.yy||{};this._input=dt;this._more=this._backtrack=this.done=false;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};if(this.options.ranges){this.yylloc.range=[0,0]}this.offset=0;return this},"setInput"),input:B(function(){var dt=this._input[0];this.yytext+=dt;this.yyleng++;this.offset++;this.match+=dt;this.matched+=dt;var Oe=dt.match(/(?:\r\n?|\n).*/g);if(Oe){this.yylineno++;this.yylloc.last_line++}else{this.yylloc.last_column++}if(this.options.ranges){this.yylloc.range[1]++}this._input=this._input.slice(1);return dt},"input"),unput:B(function(dt){var Oe=dt.length;var Wt=dt.split(/(?:\r\n?|\n)/g);this._input=dt+this._input;this.yytext=this.yytext.substr(0,this.yytext.length-Oe);this.offset-=Oe;var kt=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1);this.matched=this.matched.substr(0,this.matched.length-1);if(Wt.length-1){this.yylineno-=Wt.length-1}var qt=this.yylloc.range;this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Wt?(Wt.length===kt.length?this.yylloc.first_column:0)+kt[kt.length-Wt.length].length-Wt[0].length:this.yylloc.first_column-Oe};if(this.options.ranges){this.yylloc.range=[qt[0],qt[0]+this.yyleng-Oe]}this.yyleng=this.yytext.length;return this},"unput"),more:B(function(){this._more=true;return this},"more"),reject:B(function(){if(this.options.backtrack_lexer){this._backtrack=true}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}return this},"reject"),less:B(function(dt){this.unput(this.match.slice(dt))},"less"),pastInput:B(function(){var dt=this.matched.substr(0,this.matched.length-this.match.length);return(dt.length>20?"...":"")+dt.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:B(function(){var dt=this.match;if(dt.length<20){dt+=this._input.substr(0,20-dt.length)}return(dt.substr(0,20)+(dt.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:B(function(){var dt=this.pastInput();var Oe=new Array(dt.length+1).join("-");return dt+this.upcomingInput()+"\n"+Oe+"^"},"showPosition"),test_match:B(function(dt,Oe){var Wt,kt,qt;if(this.options.backtrack_lexer){qt={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done};if(this.options.ranges){qt.yylloc.range=this.yylloc.range.slice(0)}}kt=dt[0].match(/(?:\r\n?|\n).*/g);if(kt){this.yylineno+=kt.length}this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:kt?kt[kt.length-1].length-kt[kt.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+dt[0].length};this.yytext+=dt[0];this.match+=dt[0];this.matches=dt;this.yyleng=this.yytext.length;if(this.options.ranges){this.yylloc.range=[this.offset,this.offset+=this.yyleng]}this._more=false;this._backtrack=false;this._input=this._input.slice(dt[0].length);this.matched+=dt[0];Wt=this.performAction.call(this,this.yy,this,Oe,this.conditionStack[this.conditionStack.length-1]);if(this.done&&this._input){this.done=false}if(Wt){return Wt}else if(this._backtrack){for(var _t in qt){this[_t]=qt[_t]}return false}return false},"test_match"),next:B(function(){if(this.done){return this.EOF}if(!this._input){this.done=true}var dt,Oe,Wt,kt;if(!this._more){this.yytext="";this.match=""}var qt=this._currentRules();for(var _t=0;_tOe[0].length)){Oe=Wt;kt=_t;if(this.options.backtrack_lexer){dt=this.test_match(Wt,qt[_t]);if(dt!==false){return dt}else if(this._backtrack){Oe=false;continue}else{return false}}else if(!this.options.flex){break}}}if(Oe){dt=this.test_match(Oe,qt[kt]);if(dt!==false){return dt}return false}if(this._input===""){return this.EOF}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}},"next"),lex:B(function dt(){var Oe=this.next();if(Oe){return Oe}else{return this.lex()}},"lex"),begin:B(function dt(Oe){this.conditionStack.push(Oe)},"begin"),popState:B(function dt(){var Oe=this.conditionStack.length-1;if(Oe>0){return this.conditionStack.pop()}else{return this.conditionStack[0]}},"popState"),_currentRules:B(function dt(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules}else{return this.conditions["INITIAL"].rules}},"_currentRules"),topState:B(function dt(Oe){Oe=this.conditionStack.length-1-Math.abs(Oe||0);if(Oe>=0){return this.conditionStack[Oe]}else{return"INITIAL"}},"topState"),pushState:B(function dt(Oe){this.begin(Oe)},"pushState"),stateStackSize:B(function dt(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":true},performAction:B(function dt(Oe,Wt,kt,qt){var _t=qt;switch(kt){case 0:break;case 1:break;case 2:return 55;break;case 3:break;case 4:this.begin("title");return 35;break;case 5:this.popState();return"title_value";break;case 6:this.begin("acc_title");return 37;break;case 7:this.popState();return"acc_title_value";break;case 8:this.begin("acc_descr");return 39;break;case 9:this.popState();return"acc_descr_value";break;case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";break;case 13:return 48;break;case 14:return 50;break;case 15:return 49;break;case 16:return 51;break;case 17:return 52;break;case 18:return 53;break;case 19:return 54;break;case 20:return 25;break;case 21:this.begin("md_string");break;case 22:return"MD_STR";break;case 23:this.popState();break;case 24:this.begin("string");break;case 25:this.popState();break;case 26:return"STR";break;case 27:this.begin("class_name");break;case 28:this.popState();return 47;break;case 29:this.begin("point_start");return 44;break;case 30:this.begin("point_x");return 45;break;case 31:this.popState();break;case 32:this.popState();this.begin("point_y");break;case 33:this.popState();return 46;break;case 34:return 28;break;case 35:return 4;break;case 36:return 15;break;case 37:return 11;break;case 38:return 64;break;case 39:return 10;break;case 40:return 65;break;case 41:return 65;break;case 42:return 14;break;case 43:return 13;break;case 44:return 67;break;case 45:return 66;break;case 46:return 12;break;case 47:return 8;break;case 48:return 5;break;case 49:return 18;break;case 50:return 56;break;case 51:return 63;break;case 52:return 57;break}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?: *x-axis *)/i,/^(?: *y-axis *)/i,/^(?: *--+> *)/i,/^(?: *quadrant-1 *)/i,/^(?: *quadrant-2 *)/i,/^(?: *quadrant-3 *)/i,/^(?: *quadrant-4 *)/i,/^(?:classDef\b)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?::::)/i,/^(?:^\w+)/i,/^(?:\s*:\s*\[\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?:\s*\] *)/i,/^(?:\s*,\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?: *quadrantChart *)/i,/^(?:[A-Za-z]+)/i,/^(?:[^\x00-\x7F]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s)/i,/^(?:;)/i,/^(?:[!"#$%&'*+,-.`?\\_/])/i,/^(?:$)/i],conditions:{"class_name":{"rules":[28],"inclusive":false},"point_y":{"rules":[33],"inclusive":false},"point_x":{"rules":[32],"inclusive":false},"point_start":{"rules":[30,31],"inclusive":false},"acc_descr_multiline":{"rules":[11,12],"inclusive":false},"acc_descr":{"rules":[9],"inclusive":false},"acc_title":{"rules":[7],"inclusive":false},"title":{"rules":[5],"inclusive":false},"md_string":{"rules":[22,23],"inclusive":false},"string":{"rules":[25,26],"inclusive":false},"INITIAL":{"rules":[0,1,2,3,4,6,8,10,13,14,15,16,17,18,19,20,21,24,27,29,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],"inclusive":true}}};return Ae}();Me.lexer=ye;function Ne(){this.yy={}}B(Ne,"Parser");Ne.prototype=Me;Me.Parser=Ne;return new Ne}();Jst.parser=Jst;gUi=Jst;hb=Vy();yUi=class{constructor(){this.classes=new Map;this.config=this.getDefaultConfig();this.themeConfig=this.getDefaultThemeConfig();this.data=this.getDefaultData()}static{B(this,"QuadrantBuilder")}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){return{showXAxis:true,showYAxis:true,showTitle:true,chartHeight:ka.quadrantChart?.chartWidth||500,chartWidth:ka.quadrantChart?.chartHeight||500,titlePadding:ka.quadrantChart?.titlePadding||10,titleFontSize:ka.quadrantChart?.titleFontSize||20,quadrantPadding:ka.quadrantChart?.quadrantPadding||5,xAxisLabelPadding:ka.quadrantChart?.xAxisLabelPadding||5,yAxisLabelPadding:ka.quadrantChart?.yAxisLabelPadding||5,xAxisLabelFontSize:ka.quadrantChart?.xAxisLabelFontSize||16,yAxisLabelFontSize:ka.quadrantChart?.yAxisLabelFontSize||16,quadrantLabelFontSize:ka.quadrantChart?.quadrantLabelFontSize||16,quadrantTextTopPadding:ka.quadrantChart?.quadrantTextTopPadding||5,pointTextPadding:ka.quadrantChart?.pointTextPadding||5,pointLabelFontSize:ka.quadrantChart?.pointLabelFontSize||12,pointRadius:ka.quadrantChart?.pointRadius||5,xAxisPosition:ka.quadrantChart?.xAxisPosition||"top",yAxisPosition:ka.quadrantChart?.yAxisPosition||"left",quadrantInternalBorderStrokeWidth:ka.quadrantChart?.quadrantInternalBorderStrokeWidth||1,quadrantExternalBorderStrokeWidth:ka.quadrantChart?.quadrantExternalBorderStrokeWidth||2}}getDefaultThemeConfig(){return{quadrant1Fill:hb.quadrant1Fill,quadrant2Fill:hb.quadrant2Fill,quadrant3Fill:hb.quadrant3Fill,quadrant4Fill:hb.quadrant4Fill,quadrant1TextFill:hb.quadrant1TextFill,quadrant2TextFill:hb.quadrant2TextFill,quadrant3TextFill:hb.quadrant3TextFill,quadrant4TextFill:hb.quadrant4TextFill,quadrantPointFill:hb.quadrantPointFill,quadrantPointTextFill:hb.quadrantPointTextFill,quadrantXAxisTextFill:hb.quadrantXAxisTextFill,quadrantYAxisTextFill:hb.quadrantYAxisTextFill,quadrantTitleFill:hb.quadrantTitleFill,quadrantInternalBorderStrokeFill:hb.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:hb.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig();this.themeConfig=this.getDefaultThemeConfig();this.data=this.getDefaultData();this.classes=new Map;wt.info("clear called")}setData(e){this.data={...this.data,...e}}addPoints(e){this.data.points=[...e,...this.data.points]}addClass(e,t){this.classes.set(e,t)}setConfig(e){wt.trace("setConfig called with: ",e);this.config={...this.config,...e}}setThemeConfig(e){wt.trace("setThemeConfig called with: ",e);this.themeConfig={...this.themeConfig,...e}}calculateSpace(e,t,n,r){const i=this.config.xAxisLabelPadding*2+this.config.xAxisLabelFontSize;const o={top:e==="top"&&t?i:0,bottom:e==="bottom"&&t?i:0};const a=this.config.yAxisLabelPadding*2+this.config.yAxisLabelFontSize;const s={left:this.config.yAxisPosition==="left"&&n?a:0,right:this.config.yAxisPosition==="right"&&n?a:0};const l=this.config.titleFontSize+this.config.titlePadding*2;const u={top:r?l:0};const d=this.config.quadrantPadding+s.left;const f=this.config.quadrantPadding+o.top+u.top;const h=this.config.chartWidth-this.config.quadrantPadding*2-s.left-s.right;const m=this.config.chartHeight-this.config.quadrantPadding*2-o.top-o.bottom-u.top;const g=h/2;const x=m/2;const w={quadrantLeft:d,quadrantTop:f,quadrantWidth:h,quadrantHalfWidth:g,quadrantHeight:m,quadrantHalfHeight:x};return{xAxisSpace:o,yAxisSpace:s,titleSpace:u,quadrantSpace:w}}getAxisLabels(e,t,n,r){const{quadrantSpace:i,titleSpace:o}=r;const{quadrantHalfHeight:a,quadrantHeight:s,quadrantLeft:l,quadrantHalfWidth:u,quadrantTop:d,quadrantWidth:f}=i;const h=Boolean(this.data.xAxisRightText);const m=Boolean(this.data.yAxisTopText);const g=[];if(this.data.xAxisLeftText&&t){g.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:l+(h?u/2:0),y:e==="top"?this.config.xAxisLabelPadding+o.top:this.config.xAxisLabelPadding+d+s+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:h?"center":"left",horizontalPos:"top",rotation:0})}if(this.data.xAxisRightText&&t){g.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:l+u+(h?u/2:0),y:e==="top"?this.config.xAxisLabelPadding+o.top:this.config.xAxisLabelPadding+d+s+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:h?"center":"left",horizontalPos:"top",rotation:0})}if(this.data.yAxisBottomText&&n){g.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+l+f+this.config.quadrantPadding,y:d+s-(m?a/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:m?"center":"left",horizontalPos:"top",rotation:-90})}if(this.data.yAxisTopText&&n){g.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+l+f+this.config.quadrantPadding,y:d+a-(m?a/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:m?"center":"left",horizontalPos:"top",rotation:-90})}return g}getQuadrants(e){const{quadrantSpace:t}=e;const{quadrantHalfHeight:n,quadrantLeft:r,quadrantHalfWidth:i,quadrantTop:o}=t;const a=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:r+i,y:o,width:i,height:n,fill:this.themeConfig.quadrant1Fill},{text:{text:this.data.quadrant2Text,fill:this.themeConfig.quadrant2TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:r,y:o,width:i,height:n,fill:this.themeConfig.quadrant2Fill},{text:{text:this.data.quadrant3Text,fill:this.themeConfig.quadrant3TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:r,y:o+n,width:i,height:n,fill:this.themeConfig.quadrant3Fill},{text:{text:this.data.quadrant4Text,fill:this.themeConfig.quadrant4TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:r+i,y:o+n,width:i,height:n,fill:this.themeConfig.quadrant4Fill}];for(const s of a){s.text.x=s.x+s.width/2;if(this.data.points.length===0){s.text.y=s.y+s.height/2;s.text.horizontalPos="middle"}else{s.text.y=s.y+this.config.quadrantTextTopPadding;s.text.horizontalPos="top"}}return a}getQuadrantPoints(e){const{quadrantSpace:t}=e;const{quadrantHeight:n,quadrantLeft:r,quadrantTop:i,quadrantWidth:o}=t;const a=wc().domain([0,1]).range([r,o+r]);const s=wc().domain([0,1]).range([n+i,i]);const l=this.data.points.map(u=>{const d=this.classes.get(u.className);if(d){u={...d,...u}}const f={x:a(u.x),y:s(u.y),fill:u.color??this.themeConfig.quadrantPointFill,radius:u.radius??this.config.pointRadius,text:{text:u.text,fill:this.themeConfig.quadrantPointTextFill,x:a(u.x),y:s(u.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:u.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:u.strokeWidth??"0px"};return f});return l}getBorders(e){const t=this.config.quadrantExternalBorderStrokeWidth/2;const{quadrantSpace:n}=e;const{quadrantHalfHeight:r,quadrantHeight:i,quadrantLeft:o,quadrantHalfWidth:a,quadrantTop:s,quadrantWidth:l}=n;const u=[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:o-t,y1:s,x2:o+l+t,y2:s},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:o+l,y1:s+t,x2:o+l,y2:s+i-t},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:o-t,y1:s+i,x2:o+l+t,y2:s+i},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:o,y1:s+t,x2:o,y2:s+i-t},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:o+a,y1:s+t,x2:o+a,y2:s+i-t},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:o+t,y1:s+r,x2:o+l-t,y2:s+r}];return u}getTitle(e){if(e){return{text:this.data.titleText,fill:this.themeConfig.quadrantTitleFill,fontSize:this.config.titleFontSize,horizontalPos:"top",verticalPos:"center",rotation:0,y:this.config.titlePadding,x:this.config.chartWidth/2}}return}build(){const e=this.config.showXAxis&&!!(this.data.xAxisLeftText||this.data.xAxisRightText);const t=this.config.showYAxis&&!!(this.data.yAxisTopText||this.data.yAxisBottomText);const n=this.config.showTitle&&!!this.data.titleText;const r=this.data.points.length>0?"bottom":this.config.xAxisPosition;const i=this.calculateSpace(r,e,t,n);return{points:this.getQuadrantPoints(i),quadrants:this.getQuadrants(i),axisLabels:this.getAxisLabels(r,e,t,i),borderLines:this.getBorders(i),title:this.getTitle(n)}}};APe=class extends Error{static{B(this,"InvalidStyleError")}constructor(e,t,n){super(`value for ${e} ${t} is invalid, please use a valid ${n}`);this.name="InvalidStyleError"}};B(Qst,"validateHexCode");B(ONn,"validateNumber");B(BNn,"validateSizeInPixels");B(CS,"textSanitizer");Ug=new yUi;B(zNn,"setQuadrant1Text");B(UNn,"setQuadrant2Text");B(VNn,"setQuadrant3Text");B($Nn,"setQuadrant4Text");B(GNn,"setXAxisLeftText");B(HNn,"setXAxisRightText");B(WNn,"setYAxisTopText");B(YNn,"setYAxisBottomText");B(kPe,"parseStyles");B(qNn,"addPoint");B(XNn,"addClass");B(jNn,"setWidth");B(KNn,"setHeight");B(ZNn,"getQuadrantData");bUi=B(function(){Ug.clear();Da()},"clear");xUi={setWidth:jNn,setHeight:KNn,setQuadrant1Text:zNn,setQuadrant2Text:UNn,setQuadrant3Text:VNn,setQuadrant4Text:$Nn,setXAxisLeftText:GNn,setXAxisRightText:HNn,setYAxisTopText:WNn,setYAxisBottomText:YNn,parseStyles:kPe,addPoint:qNn,addClass:XNn,getQuadrantData:ZNn,clear:bUi,setAccTitle:Ka,getAccTitle:is,setDiagramTitle:ys,getDiagramTitle:ss,getAccDescription:as,setAccDescription:os};vUi=B((e,t,n,r)=>{function i(O){return O==="top"?"hanging":"middle"}B(i,"getDominantBaseLine");function o(O){return O==="left"?"start":"middle"}B(o,"getTextAnchor");function a(O){return`translate(${O.x}, ${O.y}) rotate(${O.rotation||0})`}B(a,"getTransformation");const s=Mn();wt.debug("Rendering quadrant chart\n"+e);const l=s.securityLevel;let u;if(l==="sandbox"){u=zr("#i"+t)}const d=l==="sandbox"?zr(u.nodes()[0].contentDocument.body):zr("body");const f=d.select(`[id="${t}"]`);const h=f.append("g").attr("class","main");const m=s.quadrantChart?.chartWidth??500;const g=s.quadrantChart?.chartHeight??500;Vs(f,g,m,s.quadrantChart?.useMaxWidth??true);f.attr("viewBox","0 0 "+m+" "+g);r.db.setHeight(g);r.db.setWidth(m);const x=r.db.getQuadrantData();const w=h.append("g").attr("class","quadrants");const _=h.append("g").attr("class","border");const C=h.append("g").attr("class","data-points");const A=h.append("g").attr("class","labels");const P=h.append("g").attr("class","title");if(x.title){P.append("text").attr("x",0).attr("y",0).attr("fill",x.title.fill).attr("font-size",x.title.fontSize).attr("dominant-baseline",i(x.title.horizontalPos)).attr("text-anchor",o(x.title.verticalPos)).attr("transform",a(x.title)).text(x.title.text)}if(x.borderLines){_.selectAll("line").data(x.borderLines).enter().append("line").attr("x1",O=>O.x1).attr("y1",O=>O.y1).attr("x2",O=>O.x2).attr("y2",O=>O.y2).style("stroke",O=>O.strokeFill).style("stroke-width",O=>O.strokeWidth)}const L=w.selectAll("g.quadrant").data(x.quadrants).enter().append("g").attr("class","quadrant");L.append("rect").attr("x",O=>O.x).attr("y",O=>O.y).attr("width",O=>O.width).attr("height",O=>O.height).attr("fill",O=>O.fill);L.append("text").attr("x",0).attr("y",0).attr("fill",O=>O.text.fill).attr("font-size",O=>O.text.fontSize).attr("dominant-baseline",O=>i(O.text.horizontalPos)).attr("text-anchor",O=>o(O.text.verticalPos)).attr("transform",O=>a(O.text)).text(O=>O.text.text);const I=A.selectAll("g.label").data(x.axisLabels).enter().append("g").attr("class","label");I.append("text").attr("x",0).attr("y",0).text(O=>O.text).attr("fill",O=>O.fill).attr("font-size",O=>O.fontSize).attr("dominant-baseline",O=>i(O.horizontalPos)).attr("text-anchor",O=>o(O.verticalPos)).attr("transform",O=>a(O));const N=C.selectAll("g.data-point").data(x.points).enter().append("g").attr("class","data-point");N.append("circle").attr("cx",O=>O.x).attr("cy",O=>O.y).attr("r",O=>O.radius).attr("fill",O=>O.fill).attr("stroke",O=>O.strokeColor).attr("stroke-width",O=>O.strokeWidth);N.append("text").attr("x",0).attr("y",0).text(O=>O.text.text).attr("fill",O=>O.text.fill).attr("font-size",O=>O.text.fontSize).attr("dominant-baseline",O=>i(O.text.horizontalPos)).attr("text-anchor",O=>o(O.text.verticalPos)).attr("transform",O=>a(O.text))},"draw");_Ui={draw:vUi};TUi={parser:gUi,db:xUi,renderer:_Ui,styles:B(()=>"","styles")}});var vOn={};Oo(vOn,{diagram:()=>NUi});function tlt(e){return e.type==="bar"}function RPe(e){return e.type==="band"}function vH(e){return e.type==="linear"}function nlt(e,t,n,r){const i=new nOn(r);if(RPe(e)){return new EUi(t,n,e.categories,e.title,i)}return new CUi(t,n,[e.min,e.max],e.title,i)}function iOn(e,t,n,r){const i=new nOn(r);return new SUi(i,e,t,n)}function oOn(e,t,n){return new RUi(e,t,n)}function olt(){const e=Vy();const t=Ji();return Cl(e.xyChart,t.themeVariables.xyChart)}function alt(){const e=Ji();return Cl(ka.xyChart,e.xyChart)}function slt(){return{yAxis:{type:"linear",title:"",min:Infinity,max:-Infinity},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}function bre(e){const t=Ji();return La(e.trim(),t)}function sOn(e){aOn=e}function lOn(e){if(e==="horizontal"){gre.chartOrientation="horizontal"}else{gre.chartOrientation="vertical"}}function cOn(e){xc.xAxis.title=bre(e.text)}function llt(e,t){xc.xAxis={type:"linear",title:xc.xAxis.title,min:e,max:t};PPe=true}function uOn(e){xc.xAxis={type:"band",title:xc.xAxis.title,categories:e.map(t=>bre(t.text))};PPe=true}function dOn(e){xc.yAxis.title=bre(e.text)}function fOn(e,t){xc.yAxis={type:"linear",title:xc.yAxis.title,min:e,max:t};ilt=true}function hOn(e){const t=Math.min(...e);const n=Math.max(...e);const r=vH(xc.yAxis)?xc.yAxis.min:Infinity;const i=vH(xc.yAxis)?xc.yAxis.max:-Infinity;xc.yAxis={type:"linear",title:xc.yAxis.title,min:Math.min(r,t),max:Math.max(i,n)}}function clt(e){let t=[];if(e.length===0){return t}if(!PPe){const n=vH(xc.xAxis)?xc.xAxis.min:Infinity;const r=vH(xc.xAxis)?xc.xAxis.max:-Infinity;llt(Math.min(n,1),Math.max(r,e.length))}if(RPe(xc.xAxis)&&e.length>xc.xAxis.categories.length){e=e.slice(0,xc.xAxis.categories.length)}if(!ilt){hOn(e)}if(RPe(xc.xAxis)){t=xc.xAxis.categories.map((n,r)=>[n,e[r]])}if(vH(xc.xAxis)){const n=xc.xAxis.min;const r=xc.xAxis.max;if(e.length===1){t=[[`${n}`,e[0]]]}else{const i=(r-n)/(e.length-1);t=e.map((o,a)=>[`${n+a*i}`,o])}}return t}function ult(e){return rlt[e===0?0:e%rlt.length]}function pOn(e,t){const n=t.map(a=>a.value);const r=t.map(a=>a.label?bre(a.label):"");const i=clt(n);const o=r.some(a=>a!=="");xc.plots.push({type:"line",strokeFill:ult(mre),strokeWidth:2,data:i,...o?{pointLabels:r}:{}});mre++}function mOn(e,t){const n=t.map(i=>i.value);const r=clt(n);xc.plots.push({type:"bar",fill:ult(mre),data:r});mre++}function gOn(){if(xc.plots.length===0){throw Error("No Plot to render, please provide a plot with some data")}xc.title=ss();return IUi.build(gre,xc,yre,aOn)}function yOn(){return yre}function bOn(){return gre}function xOn(){return xc}var elt,wUi,nOn,eOn,tOn,rOn,EUi,CUi,SUi,AUi,kUi,RUi,PUi,IUi,mre,aOn,gre,yre,xc,rlt,PPe,ilt,MUi,LUi,DUi,FUi,NUi;var _On=Ce(()=>{gh();Np();Jh();nl();Ta();Aa();Yo();ks();ks();ks();elt=function(){var e=B(function(j,te,J,oe){for(J=J||{},oe=j.length;oe--;J[j[oe]]=te);return J},"o"),t=[1,10,12,14,16,18,19,21,23],n=[2,6],r=[1,3],i=[1,5],o=[1,6],a=[1,7],s=[1,5,10,12,14,16,18,19,21,23,36,37,38],l=[1,25],u=[1,26],d=[1,28],f=[1,29],h=[1,30],m=[1,31],g=[1,32],x=[1,33],w=[1,34],_=[1,35],C=[1,36],A=[1,37],P=[1,43],L=[1,42],I=[1,47],N=[1,50],O=[1,10,12,14,16,18,19,21,23,36,37,38],z=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],U=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],W=[1,65],H=[26,28];var $={trace:B(function j(){},"trace"),yy:{},symbols_:{"error":2,"start":3,"eol":4,"XYCHART":5,"chartConfig":6,"document":7,"CHART_ORIENTATION":8,"statement":9,"title":10,"text":11,"X_AXIS":12,"parseXAxis":13,"Y_AXIS":14,"parseYAxis":15,"LINE":16,"plotData":17,"BAR":18,"acc_title":19,"acc_title_value":20,"acc_descr":21,"acc_descr_value":22,"acc_descr_multiline_value":23,"SQUARE_BRACES_START":24,"dataPoints":25,"SQUARE_BRACES_END":26,"dataPoint":27,"COMMA":28,"NUMBER_WITH_DECIMAL":29,"STR":30,"xAxisData":31,"bandData":32,"ARROW_DELIMITER":33,"commaSeparatedTexts":34,"yAxisData":35,"NEWLINE":36,"SEMI":37,"EOF":38,"alphaNum":39,"MD_STR":40,"alphaNumToken":41,"AMP":42,"NUM":43,"ALPHA":44,"PLUS":45,"EQUALS":46,"MULT":47,"DOT":48,"BRKT":49,"MINUS":50,"UNDERSCORE":51,"$accept":0,"$end":1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",28:"COMMA",29:"NUMBER_WITH_DECIMAL",30:"STR",33:"ARROW_DELIMITER",36:"NEWLINE",37:"SEMI",38:"EOF",40:"MD_STR",42:"AMP",43:"NUM",44:"ALPHA",45:"PLUS",46:"EQUALS",47:"MULT",48:"DOT",49:"BRKT",50:"MINUS",51:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:B(function j(te,J,oe,se,re,ce,ue){var xe=ce.length-1;switch(re){case 5:se.setOrientation(ce[xe]);break;case 9:se.setDiagramTitle(ce[xe].text.trim());break;case 12:se.setLineData({text:"",type:"text"},ce[xe]);break;case 13:se.setLineData(ce[xe-1],ce[xe]);break;case 14:se.setBarData({text:"",type:"text"},ce[xe]);break;case 15:se.setBarData(ce[xe-1],ce[xe]);break;case 16:this.$=ce[xe].trim();se.setAccTitle(this.$);break;case 17:case 18:this.$=ce[xe].trim();se.setAccDescription(this.$);break;case 19:this.$=ce[xe-1];break;case 20:case 30:this.$=[ce[xe-2],...ce[xe]];break;case 21:case 31:this.$=[ce[xe]];break;case 22:this.$={value:Number(ce[xe-1]),label:ce[xe]};break;case 23:this.$={value:Number(ce[xe]),label:""};break;case 24:se.setXAxisTitle(ce[xe]);break;case 25:se.setXAxisTitle(ce[xe-1]);break;case 26:se.setXAxisTitle({type:"text",text:""});break;case 27:se.setXAxisBand(ce[xe]);break;case 28:se.setXAxisRangeData(Number(ce[xe-2]),Number(ce[xe]));break;case 29:this.$=ce[xe-1];break;case 32:se.setYAxisTitle(ce[xe]);break;case 33:se.setYAxisTitle(ce[xe-1]);break;case 34:se.setYAxisTitle({type:"text",text:""});break;case 35:se.setYAxisRangeData(Number(ce[xe-2]),Number(ce[xe]));break;case 39:this.$={text:ce[xe],type:"text"};break;case 40:this.$={text:ce[xe],type:"text"};break;case 41:this.$={text:ce[xe],type:"markdown"};break;case 42:this.$=ce[xe];break;case 43:this.$=ce[xe-1]+""+ce[xe];break}},"anonymous"),table:[e(t,n,{3:1,4:2,7:4,5:r,36:i,37:o,38:a}),{1:[3]},e(t,n,{4:2,7:4,3:8,5:r,36:i,37:o,38:a}),e(t,n,{4:2,7:4,6:9,3:10,5:r,8:[1,11],36:i,37:o,38:a}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(s,[2,36]),e(s,[2,37]),e(s,[2,38]),{1:[2,1]},e(t,n,{4:2,7:4,3:21,5:r,36:i,37:o,38:a}),{1:[2,3]},e(s,[2,5]),e(t,[2,7],{4:22,36:i,37:o,38:a}),{11:23,30:l,39:24,40:u,41:27,42:d,43:f,44:h,45:m,46:g,47:x,48:w,49:_,50:C,51:A},{11:39,13:38,24:P,29:L,30:l,31:40,32:41,39:24,40:u,41:27,42:d,43:f,44:h,45:m,46:g,47:x,48:w,49:_,50:C,51:A},{11:45,15:44,29:I,30:l,35:46,39:24,40:u,41:27,42:d,43:f,44:h,45:m,46:g,47:x,48:w,49:_,50:C,51:A},{11:49,17:48,24:N,30:l,39:24,40:u,41:27,42:d,43:f,44:h,45:m,46:g,47:x,48:w,49:_,50:C,51:A},{11:52,17:51,24:N,30:l,39:24,40:u,41:27,42:d,43:f,44:h,45:m,46:g,47:x,48:w,49:_,50:C,51:A},{20:[1,53]},{22:[1,54]},e(O,[2,18]),{1:[2,2]},e(O,[2,8]),e(O,[2,9]),e(z,[2,39],{41:55,42:d,43:f,44:h,45:m,46:g,47:x,48:w,49:_,50:C,51:A}),e(z,[2,40]),e(z,[2,41]),e(U,[2,42]),e(U,[2,44]),e(U,[2,45]),e(U,[2,46]),e(U,[2,47]),e(U,[2,48]),e(U,[2,49]),e(U,[2,50]),e(U,[2,51]),e(U,[2,52]),e(U,[2,53]),e(O,[2,10]),e(O,[2,24],{32:41,31:56,24:P,29:L}),e(O,[2,26]),e(O,[2,27]),{33:[1,57]},{11:59,30:l,34:58,39:24,40:u,41:27,42:d,43:f,44:h,45:m,46:g,47:x,48:w,49:_,50:C,51:A},e(O,[2,11]),e(O,[2,32],{35:60,29:I}),e(O,[2,34]),{33:[1,61]},e(O,[2,12]),{17:62,24:N},{25:63,27:64,29:W},e(O,[2,14]),{17:66,24:N},e(O,[2,16]),e(O,[2,17]),e(U,[2,43]),e(O,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},e(O,[2,33]),{29:[1,70]},e(O,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},e(H,[2,23],{30:[1,73]}),e(O,[2,15]),e(O,[2,28]),e(O,[2,29]),{11:59,30:l,34:74,39:24,40:u,41:27,42:d,43:f,44:h,45:m,46:g,47:x,48:w,49:_,50:C,51:A},e(O,[2,35]),e(O,[2,19]),{25:75,27:64,29:W},e(H,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:B(function j(te,J){if(J.recoverable){this.trace(te)}else{var oe=new Error(te);oe.hash=J;throw oe}},"parseError"),parse:B(function j(te){var J=this,oe=[0],se=[],re=[null],ce=[],ue=this.table,xe="",be=0,Ie=0,he=0,ve=2,ge=1;var Ve=ce.slice.call(arguments,1);var Le=Object.create(this.lexer);var $e={yy:{}};for(var Ee in this.yy){if(Object.prototype.hasOwnProperty.call(this.yy,Ee)){$e.yy[Ee]=this.yy[Ee]}}Le.setInput(te,$e.yy);$e.yy.lexer=Le;$e.yy.parser=this;if(typeof Le.yylloc=="undefined"){Le.yylloc={}}var tt=Le.yylloc;ce.push(tt);var yt=Le.options&&Le.options.ranges;if(typeof $e.yy.parseError==="function"){this.parseError=$e.yy.parseError}else{this.parseError=Object.getPrototypeOf(this).parseError}function mt(Me){oe.length=oe.length-2*Me;re.length=re.length-Me;ce.length=ce.length-Me}B(mt,"popStack");function ct(){var Me;Me=se.pop()||Le.lex()||ge;if(typeof Me!=="number"){if(Me instanceof Array){se=Me;Me=se.pop()}Me=J.symbols_[Me]||Me}return Me}B(ct,"lex");var Ge,it,bt,He,Je,Te,we={},Ze,Be,qe,Qe;while(true){bt=oe[oe.length-1];if(this.defaultActions[bt]){He=this.defaultActions[bt]}else{if(Ge===null||typeof Ge=="undefined"){Ge=ct()}He=ue[bt]&&ue[bt][Ge]}if(typeof He==="undefined"||!He.length||!He[0]){var ze="";Qe=[];for(Ze in ue[bt]){if(this.terminals_[Ze]&&Ze>ve){Qe.push("'"+this.terminals_[Ze]+"'")}}if(Le.showPosition){ze="Parse error on line "+(be+1)+":\n"+Le.showPosition()+"\nExpecting "+Qe.join(", ")+", got '"+(this.terminals_[Ge]||Ge)+"'"}else{ze="Parse error on line "+(be+1)+": Unexpected "+(Ge==ge?"end of input":"'"+(this.terminals_[Ge]||Ge)+"'")}this.parseError(ze,{text:Le.match,token:this.terminals_[Ge]||Ge,line:Le.yylineno,loc:tt,expected:Qe})}if(He[0]instanceof Array&&He.length>1){throw new Error("Parse Error: multiple actions possible at state: "+bt+", token: "+Ge)}switch(He[0]){case 1:oe.push(Ge);re.push(Le.yytext);ce.push(Le.yylloc);oe.push(He[1]);Ge=null;if(!it){Ie=Le.yyleng;xe=Le.yytext;be=Le.yylineno;tt=Le.yylloc;if(he>0){he--}}else{Ge=it;it=null}break;case 2:Be=this.productions_[He[1]][1];we.$=re[re.length-Be];we._$={first_line:ce[ce.length-(Be||1)].first_line,last_line:ce[ce.length-1].last_line,first_column:ce[ce.length-(Be||1)].first_column,last_column:ce[ce.length-1].last_column};if(yt){we._$.range=[ce[ce.length-(Be||1)].range[0],ce[ce.length-1].range[1]]}Te=this.performAction.apply(we,[xe,Ie,be,$e.yy,He[1],re,ce].concat(Ve));if(typeof Te!=="undefined"){return Te}if(Be){oe=oe.slice(0,-1*Be*2);re=re.slice(0,-1*Be);ce=ce.slice(0,-1*Be)}oe.push(this.productions_[He[1]][0]);re.push(we.$);ce.push(we._$);qe=ue[oe[oe.length-2]][oe[oe.length-1]];oe.push(qe);break;case 3:return true}}return true},"parse")};var K=function(){var j={EOF:1,parseError:B(function te(J,oe){if(this.yy.parser){this.yy.parser.parseError(J,oe)}else{throw new Error(J)}},"parseError"),setInput:B(function(te,J){this.yy=J||this.yy||{};this._input=te;this._more=this._backtrack=this.done=false;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};if(this.options.ranges){this.yylloc.range=[0,0]}this.offset=0;return this},"setInput"),input:B(function(){var te=this._input[0];this.yytext+=te;this.yyleng++;this.offset++;this.match+=te;this.matched+=te;var J=te.match(/(?:\r\n?|\n).*/g);if(J){this.yylineno++;this.yylloc.last_line++}else{this.yylloc.last_column++}if(this.options.ranges){this.yylloc.range[1]++}this._input=this._input.slice(1);return te},"input"),unput:B(function(te){var J=te.length;var oe=te.split(/(?:\r\n?|\n)/g);this._input=te+this._input;this.yytext=this.yytext.substr(0,this.yytext.length-J);this.offset-=J;var se=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1);this.matched=this.matched.substr(0,this.matched.length-1);if(oe.length-1){this.yylineno-=oe.length-1}var re=this.yylloc.range;this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:oe?(oe.length===se.length?this.yylloc.first_column:0)+se[se.length-oe.length].length-oe[0].length:this.yylloc.first_column-J};if(this.options.ranges){this.yylloc.range=[re[0],re[0]+this.yyleng-J]}this.yyleng=this.yytext.length;return this},"unput"),more:B(function(){this._more=true;return this},"more"),reject:B(function(){if(this.options.backtrack_lexer){this._backtrack=true}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}return this},"reject"),less:B(function(te){this.unput(this.match.slice(te))},"less"),pastInput:B(function(){var te=this.matched.substr(0,this.matched.length-this.match.length);return(te.length>20?"...":"")+te.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:B(function(){var te=this.match;if(te.length<20){te+=this._input.substr(0,20-te.length)}return(te.substr(0,20)+(te.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:B(function(){var te=this.pastInput();var J=new Array(te.length+1).join("-");return te+this.upcomingInput()+"\n"+J+"^"},"showPosition"),test_match:B(function(te,J){var oe,se,re;if(this.options.backtrack_lexer){re={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done};if(this.options.ranges){re.yylloc.range=this.yylloc.range.slice(0)}}se=te[0].match(/(?:\r\n?|\n).*/g);if(se){this.yylineno+=se.length}this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:se?se[se.length-1].length-se[se.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+te[0].length};this.yytext+=te[0];this.match+=te[0];this.matches=te;this.yyleng=this.yytext.length;if(this.options.ranges){this.yylloc.range=[this.offset,this.offset+=this.yyleng]}this._more=false;this._backtrack=false;this._input=this._input.slice(te[0].length);this.matched+=te[0];oe=this.performAction.call(this,this.yy,this,J,this.conditionStack[this.conditionStack.length-1]);if(this.done&&this._input){this.done=false}if(oe){return oe}else if(this._backtrack){for(var ce in re){this[ce]=re[ce]}return false}return false},"test_match"),next:B(function(){if(this.done){return this.EOF}if(!this._input){this.done=true}var te,J,oe,se;if(!this._more){this.yytext="";this.match=""}var re=this._currentRules();for(var ce=0;ceJ[0].length)){J=oe;se=ce;if(this.options.backtrack_lexer){te=this.test_match(oe,re[ce]);if(te!==false){return te}else if(this._backtrack){J=false;continue}else{return false}}else if(!this.options.flex){break}}}if(J){te=this.test_match(J,re[se]);if(te!==false){return te}return false}if(this._input===""){return this.EOF}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}},"next"),lex:B(function te(){var J=this.next();if(J){return J}else{return this.lex()}},"lex"),begin:B(function te(J){this.conditionStack.push(J)},"begin"),popState:B(function te(){var J=this.conditionStack.length-1;if(J>0){return this.conditionStack.pop()}else{return this.conditionStack[0]}},"popState"),_currentRules:B(function te(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules}else{return this.conditions["INITIAL"].rules}},"_currentRules"),topState:B(function te(J){J=this.conditionStack.length-1-Math.abs(J||0);if(J>=0){return this.conditionStack[J]}else{return"INITIAL"}},"topState"),pushState:B(function te(J){this.begin(J)},"pushState"),stateStackSize:B(function te(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":true},performAction:B(function te(J,oe,se,re){var ce=re;switch(se){case 0:break;case 1:break;case 2:this.popState();return 36;break;case 3:this.popState();return 36;break;case 4:return 36;break;case 5:break;case 6:return 10;break;case 7:this.pushState("acc_title");return 19;break;case 8:this.popState();return"acc_title_value";break;case 9:this.pushState("acc_descr");return 21;break;case 10:this.popState();return"acc_descr_value";break;case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";break;case 14:return 5;break;case 15:return 5;break;case 16:return 8;break;case 17:this.pushState("axis_data");return"X_AXIS";break;case 18:this.pushState("axis_data");return"Y_AXIS";break;case 19:this.pushState("axis_band_data");return 24;break;case 20:return 33;break;case 21:this.pushState("data");return 16;break;case 22:this.pushState("data");return 18;break;case 23:this.pushState("data_inner");return 24;break;case 24:return 29;break;case 25:this.popState();return 26;break;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";break;case 30:return 24;break;case 31:return 26;break;case 32:return 44;break;case 33:return"COLON";break;case 34:return 45;break;case 35:return 28;break;case 36:return 46;break;case 37:return 47;break;case 38:return 49;break;case 39:return 51;break;case 40:return 48;break;case 41:return 42;break;case 42:return 50;break;case 43:return 43;break;case 44:break;case 45:return 37;break;case 46:return 38;break}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{"data_inner":{"rules":[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],"inclusive":true},"data":{"rules":[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],"inclusive":true},"axis_band_data":{"rules":[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],"inclusive":true},"axis_data":{"rules":[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],"inclusive":true},"acc_descr_multiline":{"rules":[12,13],"inclusive":false},"acc_descr":{"rules":[10],"inclusive":false},"acc_title":{"rules":[8],"inclusive":false},"title":{"rules":[],"inclusive":false},"md_string":{"rules":[],"inclusive":false},"string":{"rules":[28,29],"inclusive":false},"INITIAL":{"rules":[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],"inclusive":true}}};return j}();$.lexer=K;function X(){this.yy={}}B(X,"Parser");X.prototype=$;$.Parser=X;return new X}();elt.parser=elt;wUi=elt;B(tlt,"isBarPlot");B(RPe,"isBandAxisData");B(vH,"isLinearAxisData");nOn=class{constructor(e){this.parentGroup=e}static{B(this,"TextDimensionCalculatorWithFont")}getMaxDimension(e,t){if(!this.parentGroup){return{width:e.reduce((i,o)=>Math.max(o.length,i),0)*t,height:t}}const n={width:0,height:0};const r=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",t);for(const i of e){const o=pKe(r,1,i);const a=o?o.width:i.length*t;const s=o?o.height:t;n.width=Math.max(n.width,a);n.height=Math.max(n.height,s)}r.remove();return n}};eOn=.7;tOn=.2;rOn=class{constructor(e,t,n,r){this.axisConfig=e;this.title=t;this.textDimensionCalculator=n;this.axisThemeConfig=r;this.boundingRect={x:0,y:0,width:0,height:0};this.axisPosition="left";this.showTitle=false;this.showLabel=false;this.showTick=false;this.showAxisLine=false;this.outerPadding=0;this.titleTextHeight=0;this.labelTextHeight=0;this.normalizedLabelRotationInRad=0;this.range=[0,10];this.boundingRect={x:0,y:0,width:0,height:0};this.axisPosition="left";this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}static{B(this,"BaseAxis")}setRange(e){this.range=e;if(this.axisPosition==="left"||this.axisPosition==="right"){this.boundingRect.height=e[1]-e[0]}else{this.boundingRect.width=e[1]-e[0]}this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(e){this.axisPosition=e;this.setRange(this.range)}getTickDistance(){const e=this.getRange();return Math.abs(e[0]-e[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(e=>e.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){if(eOn*this.getTickDistance()>this.outerPadding*2){this.outerPadding=Math.floor(eOn*this.getTickDistance()/2)}this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let t=e.height;if(this.axisConfig.showAxisLine&&t>this.axisConfig.axisLineWidth){t-=this.axisConfig.axisLineWidth;this.showAxisLine=true}if(this.axisConfig.showLabel){const n=this.getLabelDimension();const r=tOn*e.width;this.outerPadding=Math.min(n.width/2,r);let i=n.height;if(this.axisPosition==="bottom"&&this.normalizedLabelRotationInRad!==0){i=Math.max(i,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*n.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*n.height))}i+=this.axisConfig.labelPadding*2;this.labelTextHeight=n.height;if(i<=t){t-=i;this.showLabel=true}}if(this.axisConfig.showTick&&t>=this.axisConfig.tickLength){this.showTick=true;t-=this.axisConfig.tickLength}if(this.axisConfig.showTitle&&this.title){const n=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize);const r=n.height+this.axisConfig.titlePadding*2;this.titleTextHeight=n.height;if(r<=t){t-=r;this.showTitle=true}}this.boundingRect.width=e.width;this.boundingRect.height=e.height-t}calculateSpaceIfDrawnVertical(e){let t=e.width;if(this.axisConfig.showAxisLine&&t>this.axisConfig.axisLineWidth){t-=this.axisConfig.axisLineWidth;this.showAxisLine=true}if(this.axisConfig.showLabel){const n=this.getLabelDimension();const r=tOn*e.height;this.outerPadding=Math.min(n.height/2,r);const i=n.width+this.axisConfig.labelPadding*2;if(i<=t){t-=i;this.showLabel=true}}if(this.axisConfig.showTick&&t>=this.axisConfig.tickLength){this.showTick=true;t-=this.axisConfig.tickLength}if(this.axisConfig.showTitle&&this.title){const n=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize);const r=n.height+this.axisConfig.titlePadding*2;this.titleTextHeight=n.height;if(r<=t){t-=r;this.showTitle=true}}this.boundingRect.width=e.width-t;this.boundingRect.height=e.height}calculateSpace(e){if(this.axisPosition==="left"||this.axisPosition==="right"){this.calculateSpaceIfDrawnVertical(e)}else{this.calculateSpaceIfDrawnHorizontally(e)}this.recalculateScale();return{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x;this.boundingRect.y=e.y}calculateOffsetByRotation(e){const t=this.normalizedLabelRotationInRad;if(t===0){return 0}return Math.sin(t)*this.getLabelDimension()[e]/2}getDrawableElementsForLeftAxis(){const e=[];if(this.showAxisLine){const t=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${t},${this.boundingRect.y} L ${t},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel){e.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(t=>({text:t.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(t),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))})}if(this.showTick){const t=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${t},${this.getScaleValue(n)} L ${t-this.axisConfig.tickLength},${this.getScaleValue(n)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(this.showTitle){e.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]})}return e}getDrawableElementsForBottomAxis(){const e=[];if(this.showAxisLine){const t=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${t} L ${this.boundingRect.x+this.boundingRect.width},${t}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel){e.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(t=>({text:t.toString(),x:this.getScaleValue(t)+this.calculateOffsetByRotation("height"),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation("width")),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:this.normalizedLabelRotationInRad*180/Math.PI,verticalPos:"top",horizontalPos:"center"}))})}if(this.showTick){const t=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${this.getScaleValue(n)},${t} L ${this.getScaleValue(n)},${t+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(this.showTitle){e.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]})}return e}getDrawableElementsForTopAxis(){const e=[];if(this.showAxisLine){const t=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${t} L ${this.boundingRect.x+this.boundingRect.width},${t}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel){e.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(t=>({text:t.toString(),x:this.getScaleValue(t),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))})}if(this.showTick){const t=this.boundingRect.y;e.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(n=>({path:`M ${this.getScaleValue(n)},${t+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(n)},${t+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(this.showTitle){e.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]})}return e}getDrawableElements(){if(this.axisPosition==="left"){return this.getDrawableElementsForLeftAxis()}if(this.axisPosition==="right"){throw Error("Drawing of right axis is not implemented")}if(this.axisPosition==="bottom"){return this.getDrawableElementsForBottomAxis()}if(this.axisPosition==="top"){return this.getDrawableElementsForTopAxis()}return[]}};EUi=class extends rOn{static{B(this,"BandAxis")}constructor(e,t,n,r,i){super(e,r,i,t);this.categories=n;this.scale=Gb().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=Gb().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5);wt.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}};CUi=class extends rOn{static{B(this,"LinearAxis")}constructor(e,t,n,r,i){super(e,r,i,t);this.domain=n;this.scale=wc().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const e=[...this.domain];if(this.axisPosition==="left"){e.reverse()}this.scale=wc().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}};B(nlt,"getAxis");SUi=class{constructor(e,t,n,r){this.textDimensionCalculator=e;this.chartConfig=t;this.chartData=n;this.chartThemeConfig=r;this.boundingRect={x:0,y:0,width:0,height:0};this.showChartTitle=false}static{B(this,"ChartTitle")}setBoundingBoxXY(e){this.boundingRect.x=e.x;this.boundingRect.y=e.y}calculateSpace(e){const t=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize);const n=Math.max(t.width,e.width);const r=t.height+2*this.chartConfig.titlePadding;if(t.width<=n&&t.height<=r&&this.chartConfig.showTitle&&this.chartData.title){this.boundingRect.width=n;this.boundingRect.height=r;this.showChartTitle=true}return{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const e=[];if(this.showChartTitle){e.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]})}return e}};B(iOn,"getChartTitleComponent");AUi=class{constructor(e,t,n,r,i){this.plotData=e;this.xAxis=t;this.yAxis=n;this.orientation=r;this.plotIndex=i}static{B(this,"LinePlot")}getDrawableElement(){const e=this.plotData.data.map(r=>[this.xAxis.getScaleValue(r[0]),this.yAxis.getScaleValue(r[1])]);let t;if(this.orientation==="horizontal"){t=Wb().y(r=>r[0]).x(r=>r[1])(e)}else{t=Wb().x(r=>r[0]).y(r=>r[1])(e)}if(!t){return[]}const n=[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:t,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){const r=10;const i=12;const o=[];for(const[a,[s,l]]of e.entries()){const u=this.plotData.pointLabels[a];if(!u){continue}if(this.orientation==="horizontal"){o.push({x:l+r,y:s,text:u,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:i,rotation:0})}else{o.push({x:s,y:l-r,text:u,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:i,rotation:0})}}if(o.length>0){n.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:o})}}return n}};kUi=class{constructor(e,t,n,r,i,o){this.barData=e;this.boundingRect=t;this.xAxis=n;this.yAxis=r;this.orientation=i;this.plotIndex=o}static{B(this,"BarPlot")}getDrawableElement(){const e=this.barData.data.map(i=>[this.xAxis.getScaleValue(i[0]),this.yAxis.getScaleValue(i[1])]);const t=.05;const n=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-t);const r=n/2;if(this.orientation==="horizontal"){return[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map(i=>({x:this.boundingRect.x,y:i[0]-r,height:n,width:i[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}return[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map(i=>({x:i[0]-r,y:i[1],width:n,height:this.boundingRect.y+this.boundingRect.height-i[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}};RUi=class{constructor(e,t,n){this.chartConfig=e;this.chartData=t;this.chartThemeConfig=n;this.boundingRect={x:0,y:0,width:0,height:0}}static{B(this,"BasePlot")}setAxes(e,t){this.xAxis=e;this.yAxis=t}setBoundingBoxXY(e){this.boundingRect.x=e.x;this.boundingRect.y=e.y}calculateSpace(e){this.boundingRect.width=e.width;this.boundingRect.height=e.height;return{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis)){throw Error("Axes must be passed to render Plots")}const e=[];for(const[t,n]of this.chartData.plots.entries()){switch(n.type){case"line":{const r=new AUi(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,t);e.push(...r.getDrawableElement())}break;case"bar":{const r=new kUi(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,t);e.push(...r.getDrawableElement())}break}}return e}};B(oOn,"getPlotComponent");PUi=class{constructor(e,t,n,r){this.chartConfig=e;this.chartData=t;this.componentStore={title:iOn(e,t,n,r),plot:oOn(e,t,n),xAxis:nlt(t.xAxis,e.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},r),yAxis:nlt(t.yAxis,e.yAxis,{titleColor:n.yAxisTitleColor,labelColor:n.yAxisLabelColor,tickColor:n.yAxisTickColor,axisLineColor:n.yAxisLineColor},r)}}static{B(this,"Orchestrator")}calculateVerticalSpace(){let e=this.chartConfig.width;let t=this.chartConfig.height;let n=0;let r=0;let i=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100);let o=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100);let a=this.componentStore.plot.calculateSpace({width:i,height:o});e-=a.width;t-=a.height;a=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:t});r=a.height;t-=a.height;this.componentStore.xAxis.setAxisPosition("bottom");a=this.componentStore.xAxis.calculateSpace({width:e,height:t});t-=a.height;this.componentStore.yAxis.setAxisPosition("left");a=this.componentStore.yAxis.calculateSpace({width:e,height:t});n=a.width;e-=a.width;if(e>0){i+=e;e=0}if(t>0){o+=t;t=0}this.componentStore.plot.calculateSpace({width:i,height:o});this.componentStore.plot.setBoundingBoxXY({x:n,y:r});this.componentStore.xAxis.setRange([n,n+i]);this.componentStore.xAxis.setBoundingBoxXY({x:n,y:r+o});this.componentStore.yAxis.setRange([r,r+o]);this.componentStore.yAxis.setBoundingBoxXY({x:0,y:r});if(this.chartData.plots.some(s=>tlt(s))){this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}}calculateHorizontalSpace(){let e=this.chartConfig.width;let t=this.chartConfig.height;let n=0;let r=0;let i=0;let o=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100);let a=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100);let s=this.componentStore.plot.calculateSpace({width:o,height:a});e-=s.width;t-=s.height;s=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:t});n=s.height;t-=s.height;this.componentStore.xAxis.setAxisPosition("left");s=this.componentStore.xAxis.calculateSpace({width:e,height:t});e-=s.width;r=s.width;this.componentStore.yAxis.setAxisPosition("top");s=this.componentStore.yAxis.calculateSpace({width:e,height:t});t-=s.height;i=n+s.height;if(e>0){o+=e;e=0}if(t>0){a+=t;t=0}this.componentStore.plot.calculateSpace({width:o,height:a});this.componentStore.plot.setBoundingBoxXY({x:r,y:i});this.componentStore.yAxis.setRange([r,r+o]);this.componentStore.yAxis.setBoundingBoxXY({x:r,y:n});this.componentStore.xAxis.setRange([i,i+a]);this.componentStore.xAxis.setBoundingBoxXY({x:0,y:i});if(this.chartData.plots.some(l=>tlt(l))){this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}}calculateSpace(){if(this.chartConfig.chartOrientation==="horizontal"){this.calculateHorizontalSpace()}else{this.calculateVerticalSpace()}}getDrawableElement(){this.calculateSpace();const e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const t of Object.values(this.componentStore)){e.push(...t.getDrawableElements())}return e}};IUi=class{static{B(this,"XYChartBuilder")}static build(e,t,n,r){const i=new PUi(e,t,n,r);return i.getDrawableElement()}};mre=0;gre=alt();yre=olt();xc=slt();rlt=yre.plotColorPalette.split(",").map(e=>e.trim());PPe=false;ilt=false;B(olt,"getChartDefaultThemeConfig");B(alt,"getChartDefaultConfig");B(slt,"getChartDefaultData");B(bre,"textSanitizer");B(sOn,"setTmpSVGG");B(lOn,"setOrientation");B(cOn,"setXAxisTitle");B(llt,"setXAxisRangeData");B(uOn,"setXAxisBand");B(dOn,"setYAxisTitle");B(fOn,"setYAxisRangeData");B(hOn,"setYAxisRangeFromPlotData");B(clt,"transformDataWithoutCategory");B(ult,"getPlotColorFromPalette");B(pOn,"setLineData");B(mOn,"setBarData");B(gOn,"getDrawableElem");B(yOn,"getChartThemeConfig");B(bOn,"getChartConfig");B(xOn,"getXYChartData");MUi=B(function(){Da();mre=0;gre=alt();xc=slt();yre=olt();rlt=yre.plotColorPalette.split(",").map(e=>e.trim());PPe=false;ilt=false},"clear");LUi={getDrawableElem:gOn,clear:MUi,setAccTitle:Ka,getAccTitle:is,setDiagramTitle:ys,getDiagramTitle:ss,getAccDescription:as,setAccDescription:os,setOrientation:lOn,setXAxisTitle:cOn,setXAxisRangeData:llt,setXAxisBand:uOn,setYAxisTitle:dOn,setYAxisRangeData:fOn,setLineData:pOn,setBarData:mOn,setTmpSVGG:sOn,getChartThemeConfig:yOn,getChartConfig:bOn,getXYChartData:xOn};DUi=B((e,t,n,r)=>{const i=r.db;const o=i.getChartThemeConfig();const a=i.getChartConfig();const s=i.getXYChartData().plots[0].data.map(A=>A[1]);function l(A){return A==="top"?"text-before-edge":"middle"}B(l,"getDominantBaseLine");function u(A){return A==="left"?"start":A==="right"?"end":"middle"}B(u,"getTextAnchor");function d(A){return`translate(${A.x}, ${A.y}) rotate(${A.rotation||0})`}B(d,"getTextTransformation");wt.debug("Rendering xychart chart\n"+e);const f=Sc(t);const h=f.append("g").attr("class","main");const m=h.append("rect").attr("width",a.width).attr("height",a.height).attr("class","background");Vs(f,a.height,a.width,true);f.attr("viewBox",`0 0 ${a.width} ${a.height}`);m.attr("fill",o.backgroundColor);i.setTmpSVGG(f.append("g").attr("class","mermaid-tmp-group"));const g=i.getDrawableElem();const x={};function w(A){let P=h;let L="";for(const[I]of A.entries()){let N=h;if(I>0&&x[L]){N=x[L]}L+=A[I];P=x[L];if(!P){P=x[L]=N.append("g").attr("class",A[I])}}return P}B(w,"getGroup");for(const A of g){if(A.data.length===0){continue}const P=w(A.groupTexts);switch(A.type){case"rect":P.selectAll("rect").data(A.data).enter().append("rect").attr("x",L=>L.x).attr("y",L=>L.y).attr("width",L=>L.width).attr("height",L=>L.height).attr("fill",L=>L.fill).attr("stroke",L=>L.strokeFill).attr("stroke-width",L=>L.strokeWidth);if(a.showDataLabel){const L=a.showDataLabelOutsideBar;if(a.chartOrientation==="horizontal"){let I=function($,K){const{data:X,label:j}=$;const te=K*j.length*N;return te<=X.width-O};var _=I;B(I,"fitsHorizontally");const N=.7;const O=10;const z=A.data.map(($,K)=>({data:$,label:s[K].toString()})).filter($=>$.data.width>0&&$.data.height>0);const U=z.map($=>{const{data:K}=$;let X=K.height*.7;while(!I($,X)&&X>0){X-=1}return X});const W=Math.floor(Math.min(...U));const H=B($=>{if(L){return $.data.x+$.data.width+O}else{return $.data.x+$.data.width-O}},"determineLabelXPosition");P.selectAll("text").data(z).enter().append("text").attr("x",H).attr("y",$=>$.data.y+$.data.height/2).attr("text-anchor",L?"start":"end").attr("dominant-baseline","middle").attr("fill",o.dataLabelColor).attr("font-size",`${W}px`).text($=>$.label)}else{let I=function(H,$,K){const{data:X,label:j}=H;const te=.7;const J=$*j.length*te;const oe=X.x+X.width/2;const se=oe-J/2;const re=oe+J/2;const ce=se>=X.x&&re<=X.x+X.width;const ue=X.y+K+$<=X.y+X.height;return ce&&ue};var C=I;B(I,"fitsInBar");const N=10;const O=A.data.map((H,$)=>({data:H,label:s[$].toString()})).filter(H=>H.data.width>0&&H.data.height>0);const z=O.map(H=>{const{data:$,label:K}=H;let X=$.width/(K.length*.7);while(!I(H,X,N)&&X>0){X-=1}return X});const U=Math.floor(Math.min(...z));const W=B(H=>{if(L){return H.data.y-N}else{return H.data.y+N}},"determineLabelYPosition");P.selectAll("text").data(O).enter().append("text").attr("x",H=>H.data.x+H.data.width/2).attr("y",W).attr("text-anchor","middle").attr("dominant-baseline",L?"auto":"hanging").attr("fill",o.dataLabelColor).attr("font-size",`${U}px`).text(H=>H.label)}}break;case"text":P.selectAll("text").data(A.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",L=>L.fill).attr("font-size",L=>L.fontSize).attr("dominant-baseline",L=>l(L.verticalPos)).attr("text-anchor",L=>u(L.horizontalPos)).attr("transform",L=>d(L)).text(L=>L.text);break;case"path":P.selectAll("path").data(A.data).enter().append("path").attr("d",L=>L.path).attr("fill",L=>L.fill?L.fill:"none").attr("stroke",L=>L.strokeFill).attr("stroke-width",L=>L.strokeWidth);break}}},"draw");FUi={draw:DUi};NUi={parser:wUi,db:LUi,renderer:FUi}});var wOn={};Oo(wOn,{diagram:()=>GUi});var dlt,OUi,BUi,zUi,UUi,VUi,TOn,$Ui,GUi;var EOn=Ce(()=>{lv();Cx();Tx();yx();kg();Eg();K0();Sg();Np();Jh();nl();Ta();Aa();Yo();dlt=function(){var e=B(function(ze,Me,ye,Ne){for(ye=ye||{},Ne=ze.length;Ne--;ye[ze[Ne]]=Me);return ye},"o"),t=[1,3],n=[1,4],r=[1,5],i=[1,6],o=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],a=[1,22],s=[2,7],l=[1,26],u=[1,27],d=[1,28],f=[1,29],h=[1,33],m=[1,34],g=[1,35],x=[1,36],w=[1,37],_=[1,38],C=[1,24],A=[1,31],P=[1,32],L=[1,30],I=[1,39],N=[1,40],O=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],z=[1,61],U=[89,90],W=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],H=[27,29],$=[1,70],K=[1,71],X=[1,72],j=[1,73],te=[1,74],J=[1,75],oe=[1,76],se=[1,83],re=[1,80],ce=[1,84],ue=[1,85],xe=[1,86],be=[1,87],Ie=[1,88],he=[1,89],ve=[1,90],ge=[1,91],Ve=[1,92],Le=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],$e=[63,64],Ee=[1,101],tt=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],yt=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],mt=[1,110],ct=[1,106],Ge=[1,107],it=[1,108],bt=[1,109],He=[1,111],Je=[1,116],Te=[1,117],we=[1,114],Ze=[1,115];var Be={trace:B(function ze(){},"trace"),yy:{},symbols_:{"error":2,"start":3,"directive":4,"NEWLINE":5,"RD":6,"diagram":7,"EOF":8,"acc_title":9,"acc_title_value":10,"acc_descr":11,"acc_descr_value":12,"acc_descr_multiline_value":13,"requirementDef":14,"elementDef":15,"relationshipDef":16,"direction":17,"styleStatement":18,"classDefStatement":19,"classStatement":20,"direction_tb":21,"direction_bt":22,"direction_rl":23,"direction_lr":24,"requirementType":25,"requirementName":26,"STRUCT_START":27,"requirementBody":28,"STYLE_SEPARATOR":29,"idList":30,"ID":31,"COLONSEP":32,"id":33,"TEXT":34,"text":35,"RISK":36,"riskLevel":37,"VERIFYMTHD":38,"verifyType":39,"STRUCT_STOP":40,"REQUIREMENT":41,"FUNCTIONAL_REQUIREMENT":42,"INTERFACE_REQUIREMENT":43,"PERFORMANCE_REQUIREMENT":44,"PHYSICAL_REQUIREMENT":45,"DESIGN_CONSTRAINT":46,"LOW_RISK":47,"MED_RISK":48,"HIGH_RISK":49,"VERIFY_ANALYSIS":50,"VERIFY_DEMONSTRATION":51,"VERIFY_INSPECTION":52,"VERIFY_TEST":53,"ELEMENT":54,"elementName":55,"elementBody":56,"TYPE":57,"type":58,"DOCREF":59,"ref":60,"END_ARROW_L":61,"relationship":62,"LINE":63,"END_ARROW_R":64,"CONTAINS":65,"COPIES":66,"DERIVES":67,"SATISFIES":68,"VERIFIES":69,"REFINES":70,"TRACES":71,"CLASSDEF":72,"stylesOpt":73,"CLASS":74,"ALPHA":75,"COMMA":76,"STYLE":77,"style":78,"styleComponent":79,"NUM":80,"COLON":81,"UNIT":82,"SPACE":83,"BRKT":84,"PCT":85,"MINUS":86,"LABEL":87,"SEMICOLON":88,"unqString":89,"qString":90,"$accept":0,"$end":1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:B(function ze(Me,ye,Ne,Ae,dt,Oe,Wt){var kt=Oe.length-1;switch(dt){case 4:this.$=Oe[kt].trim();Ae.setAccTitle(this.$);break;case 5:case 6:this.$=Oe[kt].trim();Ae.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:Ae.setDirection("TB");break;case 18:Ae.setDirection("BT");break;case 19:Ae.setDirection("RL");break;case 20:Ae.setDirection("LR");break;case 21:Ae.addRequirement(Oe[kt-3],Oe[kt-4]);break;case 22:Ae.addRequirement(Oe[kt-5],Oe[kt-6]);Ae.setClass([Oe[kt-5]],Oe[kt-3]);break;case 23:Ae.setNewReqId(Oe[kt-2]);break;case 24:Ae.setNewReqText(Oe[kt-2]);break;case 25:Ae.setNewReqRisk(Oe[kt-2]);break;case 26:Ae.setNewReqVerifyMethod(Oe[kt-2]);break;case 29:this.$=Ae.RequirementType.REQUIREMENT;break;case 30:this.$=Ae.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=Ae.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=Ae.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=Ae.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=Ae.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=Ae.RiskLevel.LOW_RISK;break;case 36:this.$=Ae.RiskLevel.MED_RISK;break;case 37:this.$=Ae.RiskLevel.HIGH_RISK;break;case 38:this.$=Ae.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=Ae.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=Ae.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=Ae.VerifyType.VERIFY_TEST;break;case 42:Ae.addElement(Oe[kt-3]);break;case 43:Ae.addElement(Oe[kt-5]);Ae.setClass([Oe[kt-5]],Oe[kt-3]);break;case 44:Ae.setNewElementType(Oe[kt-2]);break;case 45:Ae.setNewElementDocRef(Oe[kt-2]);break;case 48:Ae.addRelationship(Oe[kt-2],Oe[kt],Oe[kt-4]);break;case 49:Ae.addRelationship(Oe[kt-2],Oe[kt-4],Oe[kt]);break;case 50:this.$=Ae.Relationships.CONTAINS;break;case 51:this.$=Ae.Relationships.COPIES;break;case 52:this.$=Ae.Relationships.DERIVES;break;case 53:this.$=Ae.Relationships.SATISFIES;break;case 54:this.$=Ae.Relationships.VERIFIES;break;case 55:this.$=Ae.Relationships.REFINES;break;case 56:this.$=Ae.Relationships.TRACES;break;case 57:this.$=Oe[kt-2];Ae.defineClass(Oe[kt-1],Oe[kt]);break;case 58:Ae.setClass(Oe[kt-1],Oe[kt]);break;case 59:Ae.setClass([Oe[kt-2]],Oe[kt]);break;case 60:case 62:this.$=[Oe[kt]];break;case 61:case 63:this.$=Oe[kt-2].concat([Oe[kt]]);break;case 64:this.$=Oe[kt-2];Ae.setCssStyle(Oe[kt-1],Oe[kt]);break;case 65:this.$=[Oe[kt]];break;case 66:Oe[kt-2].push(Oe[kt]);this.$=Oe[kt-2];break;case 68:this.$=Oe[kt-1]+Oe[kt];break}},"anonymous"),table:[{3:1,4:2,6:t,9:n,11:r,13:i},{1:[3]},{3:8,4:2,5:[1,7],6:t,9:n,11:r,13:i},{5:[1,9]},{10:[1,10]},{12:[1,11]},e(o,[2,6]),{3:12,4:2,6:t,9:n,11:r,13:i},{1:[2,2]},{4:17,5:a,7:13,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:h,42:m,43:g,44:x,45:w,46:_,54:C,72:A,74:P,77:L,89:I,90:N},e(o,[2,4]),e(o,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:a,7:42,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:h,42:m,43:g,44:x,45:w,46:_,54:C,72:A,74:P,77:L,89:I,90:N},{4:17,5:a,7:43,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:h,42:m,43:g,44:x,45:w,46:_,54:C,72:A,74:P,77:L,89:I,90:N},{4:17,5:a,7:44,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:h,42:m,43:g,44:x,45:w,46:_,54:C,72:A,74:P,77:L,89:I,90:N},{4:17,5:a,7:45,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:h,42:m,43:g,44:x,45:w,46:_,54:C,72:A,74:P,77:L,89:I,90:N},{4:17,5:a,7:46,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:h,42:m,43:g,44:x,45:w,46:_,54:C,72:A,74:P,77:L,89:I,90:N},{4:17,5:a,7:47,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:h,42:m,43:g,44:x,45:w,46:_,54:C,72:A,74:P,77:L,89:I,90:N},{4:17,5:a,7:48,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:h,42:m,43:g,44:x,45:w,46:_,54:C,72:A,74:P,77:L,89:I,90:N},{4:17,5:a,7:49,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:h,42:m,43:g,44:x,45:w,46:_,54:C,72:A,74:P,77:L,89:I,90:N},{4:17,5:a,7:50,8:s,9:n,11:r,13:i,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:h,42:m,43:g,44:x,45:w,46:_,54:C,72:A,74:P,77:L,89:I,90:N},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},e(O,[2,17]),e(O,[2,18]),e(O,[2,19]),e(O,[2,20]),{30:60,33:62,75:z,89:I,90:N},{30:63,33:62,75:z,89:I,90:N},{30:64,33:62,75:z,89:I,90:N},e(U,[2,29]),e(U,[2,30]),e(U,[2,31]),e(U,[2,32]),e(U,[2,33]),e(U,[2,34]),e(W,[2,81]),e(W,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},e(H,[2,79]),e(H,[2,80]),{27:[1,67],29:[1,68]},e(H,[2,85]),e(H,[2,86]),{62:69,65:$,66:K,67:X,68:j,69:te,70:J,71:oe},{62:77,65:$,66:K,67:X,68:j,69:te,70:J,71:oe},{30:78,33:62,75:z,89:I,90:N},{73:79,75:se,76:re,78:81,79:82,80:ce,81:ue,82:xe,83:be,84:Ie,85:he,86:ve,87:ge,88:Ve},e(Le,[2,60]),e(Le,[2,62]),{73:93,75:se,76:re,78:81,79:82,80:ce,81:ue,82:xe,83:be,84:Ie,85:he,86:ve,87:ge,88:Ve},{30:94,33:62,75:z,76:re,89:I,90:N},{5:[1,95]},{30:96,33:62,75:z,89:I,90:N},{5:[1,97]},{30:98,33:62,75:z,89:I,90:N},{63:[1,99]},e($e,[2,50]),e($e,[2,51]),e($e,[2,52]),e($e,[2,53]),e($e,[2,54]),e($e,[2,55]),e($e,[2,56]),{64:[1,100]},e(O,[2,59],{76:re}),e(O,[2,64],{76:Ee}),{33:103,75:[1,102],89:I,90:N},e(tt,[2,65],{79:104,75:se,80:ce,81:ue,82:xe,83:be,84:Ie,85:he,86:ve,87:ge,88:Ve}),e(yt,[2,67]),e(yt,[2,69]),e(yt,[2,70]),e(yt,[2,71]),e(yt,[2,72]),e(yt,[2,73]),e(yt,[2,74]),e(yt,[2,75]),e(yt,[2,76]),e(yt,[2,77]),e(yt,[2,78]),e(O,[2,57],{76:Ee}),e(O,[2,58],{76:re}),{5:mt,28:105,31:ct,34:Ge,36:it,38:bt,40:He},{27:[1,112],76:re},{5:Je,40:Te,56:113,57:we,59:Ze},{27:[1,118],76:re},{33:119,89:I,90:N},{33:120,89:I,90:N},{75:se,78:121,79:82,80:ce,81:ue,82:xe,83:be,84:Ie,85:he,86:ve,87:ge,88:Ve},e(Le,[2,61]),e(Le,[2,63]),e(yt,[2,68]),e(O,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:mt,28:126,31:ct,34:Ge,36:it,38:bt,40:He},e(O,[2,28]),{5:[1,127]},e(O,[2,42]),{32:[1,128]},{32:[1,129]},{5:Je,40:Te,56:130,57:we,59:Ze},e(O,[2,47]),{5:[1,131]},e(O,[2,48]),e(O,[2,49]),e(tt,[2,66],{79:104,75:se,80:ce,81:ue,82:xe,83:be,84:Ie,85:he,86:ve,87:ge,88:Ve}),{33:132,89:I,90:N},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},e(O,[2,27]),{5:mt,28:145,31:ct,34:Ge,36:it,38:bt,40:He},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},e(O,[2,46]),{5:Je,40:Te,56:152,57:we,59:Ze},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},e(O,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},e(O,[2,43]),{5:mt,28:159,31:ct,34:Ge,36:it,38:bt,40:He},{5:mt,28:160,31:ct,34:Ge,36:it,38:bt,40:He},{5:mt,28:161,31:ct,34:Ge,36:it,38:bt,40:He},{5:mt,28:162,31:ct,34:Ge,36:it,38:bt,40:He},{5:Je,40:Te,56:163,57:we,59:Ze},{5:Je,40:Te,56:164,57:we,59:Ze},e(O,[2,23]),e(O,[2,24]),e(O,[2,25]),e(O,[2,26]),e(O,[2,44]),e(O,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:B(function ze(Me,ye){if(ye.recoverable){this.trace(Me)}else{var Ne=new Error(Me);Ne.hash=ye;throw Ne}},"parseError"),parse:B(function ze(Me){var ye=this,Ne=[0],Ae=[],dt=[null],Oe=[],Wt=this.table,kt="",qt=0,_t=0,sn=0,Jt=2,Sn=1;var Kt=Oe.slice.call(arguments,1);var mn=Object.create(this.lexer);var At={yy:{}};for(var lr in this.yy){if(Object.prototype.hasOwnProperty.call(this.yy,lr)){At.yy[lr]=this.yy[lr]}}mn.setInput(Me,At.yy);At.yy.lexer=mn;At.yy.parser=this;if(typeof mn.yylloc=="undefined"){mn.yylloc={}}var on=mn.yylloc;Oe.push(on);var cr=mn.options&&mn.options.ranges;if(typeof At.yy.parseError==="function"){this.parseError=At.yy.parseError}else{this.parseError=Object.getPrototypeOf(this).parseError}function Hr(Xt){Ne.length=Ne.length-2*Xt;dt.length=dt.length-Xt;Oe.length=Oe.length-Xt}B(Hr,"popStack");function Mr(){var Xt;Xt=Ae.pop()||mn.lex()||Sn;if(typeof Xt!=="number"){if(Xt instanceof Array){Ae=Xt;Xt=Ae.pop()}Xt=ye.symbols_[Xt]||Xt}return Xt}B(Mr,"lex");var Er,vr,Yr,nt,Rr,Xr,dr={},rn,St,Ut,Pt;while(true){Yr=Ne[Ne.length-1];if(this.defaultActions[Yr]){nt=this.defaultActions[Yr]}else{if(Er===null||typeof Er=="undefined"){Er=Mr()}nt=Wt[Yr]&&Wt[Yr][Er]}if(typeof nt==="undefined"||!nt.length||!nt[0]){var an="";Pt=[];for(rn in Wt[Yr]){if(this.terminals_[rn]&&rn>Jt){Pt.push("'"+this.terminals_[rn]+"'")}}if(mn.showPosition){an="Parse error on line "+(qt+1)+":\n"+mn.showPosition()+"\nExpecting "+Pt.join(", ")+", got '"+(this.terminals_[Er]||Er)+"'"}else{an="Parse error on line "+(qt+1)+": Unexpected "+(Er==Sn?"end of input":"'"+(this.terminals_[Er]||Er)+"'")}this.parseError(an,{text:mn.match,token:this.terminals_[Er]||Er,line:mn.yylineno,loc:on,expected:Pt})}if(nt[0]instanceof Array&&nt.length>1){throw new Error("Parse Error: multiple actions possible at state: "+Yr+", token: "+Er)}switch(nt[0]){case 1:Ne.push(Er);dt.push(mn.yytext);Oe.push(mn.yylloc);Ne.push(nt[1]);Er=null;if(!vr){_t=mn.yyleng;kt=mn.yytext;qt=mn.yylineno;on=mn.yylloc;if(sn>0){sn--}}else{Er=vr;vr=null}break;case 2:St=this.productions_[nt[1]][1];dr.$=dt[dt.length-St];dr._$={first_line:Oe[Oe.length-(St||1)].first_line,last_line:Oe[Oe.length-1].last_line,first_column:Oe[Oe.length-(St||1)].first_column,last_column:Oe[Oe.length-1].last_column};if(cr){dr._$.range=[Oe[Oe.length-(St||1)].range[0],Oe[Oe.length-1].range[1]]}Xr=this.performAction.apply(dr,[kt,_t,qt,At.yy,nt[1],dt,Oe].concat(Kt));if(typeof Xr!=="undefined"){return Xr}if(St){Ne=Ne.slice(0,-1*St*2);dt=dt.slice(0,-1*St);Oe=Oe.slice(0,-1*St)}Ne.push(this.productions_[nt[1]][0]);dt.push(dr.$);Oe.push(dr._$);Ut=Wt[Ne[Ne.length-2]][Ne[Ne.length-1]];Ne.push(Ut);break;case 3:return true}}return true},"parse")};var qe=function(){var ze={EOF:1,parseError:B(function Me(ye,Ne){if(this.yy.parser){this.yy.parser.parseError(ye,Ne)}else{throw new Error(ye)}},"parseError"),setInput:B(function(Me,ye){this.yy=ye||this.yy||{};this._input=Me;this._more=this._backtrack=this.done=false;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};if(this.options.ranges){this.yylloc.range=[0,0]}this.offset=0;return this},"setInput"),input:B(function(){var Me=this._input[0];this.yytext+=Me;this.yyleng++;this.offset++;this.match+=Me;this.matched+=Me;var ye=Me.match(/(?:\r\n?|\n).*/g);if(ye){this.yylineno++;this.yylloc.last_line++}else{this.yylloc.last_column++}if(this.options.ranges){this.yylloc.range[1]++}this._input=this._input.slice(1);return Me},"input"),unput:B(function(Me){var ye=Me.length;var Ne=Me.split(/(?:\r\n?|\n)/g);this._input=Me+this._input;this.yytext=this.yytext.substr(0,this.yytext.length-ye);this.offset-=ye;var Ae=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1);this.matched=this.matched.substr(0,this.matched.length-1);if(Ne.length-1){this.yylineno-=Ne.length-1}var dt=this.yylloc.range;this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Ne?(Ne.length===Ae.length?this.yylloc.first_column:0)+Ae[Ae.length-Ne.length].length-Ne[0].length:this.yylloc.first_column-ye};if(this.options.ranges){this.yylloc.range=[dt[0],dt[0]+this.yyleng-ye]}this.yyleng=this.yytext.length;return this},"unput"),more:B(function(){this._more=true;return this},"more"),reject:B(function(){if(this.options.backtrack_lexer){this._backtrack=true}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}return this},"reject"),less:B(function(Me){this.unput(this.match.slice(Me))},"less"),pastInput:B(function(){var Me=this.matched.substr(0,this.matched.length-this.match.length);return(Me.length>20?"...":"")+Me.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:B(function(){var Me=this.match;if(Me.length<20){Me+=this._input.substr(0,20-Me.length)}return(Me.substr(0,20)+(Me.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:B(function(){var Me=this.pastInput();var ye=new Array(Me.length+1).join("-");return Me+this.upcomingInput()+"\n"+ye+"^"},"showPosition"),test_match:B(function(Me,ye){var Ne,Ae,dt;if(this.options.backtrack_lexer){dt={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done};if(this.options.ranges){dt.yylloc.range=this.yylloc.range.slice(0)}}Ae=Me[0].match(/(?:\r\n?|\n).*/g);if(Ae){this.yylineno+=Ae.length}this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Ae?Ae[Ae.length-1].length-Ae[Ae.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Me[0].length};this.yytext+=Me[0];this.match+=Me[0];this.matches=Me;this.yyleng=this.yytext.length;if(this.options.ranges){this.yylloc.range=[this.offset,this.offset+=this.yyleng]}this._more=false;this._backtrack=false;this._input=this._input.slice(Me[0].length);this.matched+=Me[0];Ne=this.performAction.call(this,this.yy,this,ye,this.conditionStack[this.conditionStack.length-1]);if(this.done&&this._input){this.done=false}if(Ne){return Ne}else if(this._backtrack){for(var Oe in dt){this[Oe]=dt[Oe]}return false}return false},"test_match"),next:B(function(){if(this.done){return this.EOF}if(!this._input){this.done=true}var Me,ye,Ne,Ae;if(!this._more){this.yytext="";this.match=""}var dt=this._currentRules();for(var Oe=0;Oeye[0].length)){ye=Ne;Ae=Oe;if(this.options.backtrack_lexer){Me=this.test_match(Ne,dt[Oe]);if(Me!==false){return Me}else if(this._backtrack){ye=false;continue}else{return false}}else if(!this.options.flex){break}}}if(ye){Me=this.test_match(ye,dt[Ae]);if(Me!==false){return Me}return false}if(this._input===""){return this.EOF}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}},"next"),lex:B(function Me(){var ye=this.next();if(ye){return ye}else{return this.lex()}},"lex"),begin:B(function Me(ye){this.conditionStack.push(ye)},"begin"),popState:B(function Me(){var ye=this.conditionStack.length-1;if(ye>0){return this.conditionStack.pop()}else{return this.conditionStack[0]}},"popState"),_currentRules:B(function Me(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules}else{return this.conditions["INITIAL"].rules}},"_currentRules"),topState:B(function Me(ye){ye=this.conditionStack.length-1-Math.abs(ye||0);if(ye>=0){return this.conditionStack[ye]}else{return"INITIAL"}},"topState"),pushState:B(function Me(ye){this.begin(ye)},"pushState"),stateStackSize:B(function Me(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":true},performAction:B(function Me(ye,Ne,Ae,dt){var Oe=dt;switch(Ae){case 0:return"title";break;case 1:this.begin("acc_title");return 9;break;case 2:this.popState();return"acc_title_value";break;case 3:this.begin("acc_descr");return 11;break;case 4:this.popState();return"acc_descr_value";break;case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";break;case 8:return 21;break;case 9:return 22;break;case 10:return 23;break;case 11:return 24;break;case 12:return 5;break;case 13:break;case 14:break;case 15:break;case 16:return 8;break;case 17:return 6;break;case 18:return 27;break;case 19:return 40;break;case 20:return 29;break;case 21:return 32;break;case 22:return 31;break;case 23:return 34;break;case 24:return 36;break;case 25:return 38;break;case 26:return 41;break;case 27:return 42;break;case 28:return 43;break;case 29:return 44;break;case 30:return 45;break;case 31:return 46;break;case 32:return 47;break;case 33:return 48;break;case 34:return 49;break;case 35:return 50;break;case 36:return 51;break;case 37:return 52;break;case 38:return 53;break;case 39:return 54;break;case 40:return 65;break;case 41:return 66;break;case 42:return 67;break;case 43:return 68;break;case 44:return 69;break;case 45:return 70;break;case 46:return 71;break;case 47:return 57;break;case 48:return 59;break;case 49:this.begin("style");return 77;break;case 50:return 75;break;case 51:return 81;break;case 52:return 88;break;case 53:return"PERCENT";break;case 54:return 86;break;case 55:return 84;break;case 56:break;case 57:this.begin("string");break;case 58:this.popState();break;case 59:this.begin("style");return 72;break;case 60:this.begin("style");return 74;break;case 61:return 61;break;case 62:return 64;break;case 63:return 63;break;case 64:this.begin("string");break;case 65:this.popState();break;case 66:return"qString";break;case 67:Ne.yytext=Ne.yytext.trim();return 89;break;case 68:return 75;break;case 69:return 80;break;case 70:return 76;break}},"anonymous"),rules:[/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::{3})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:style\b)/i,/^(?:\w+)/i,/^(?::)/i,/^(?:;)/i,/^(?:%)/i,/^(?:-)/i,/^(?:#)/i,/^(?: )/i,/^(?:["])/i,/^(?:\n)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^:,\r\n\{\<\>\-\=]*)/i,/^(?:\w+)/i,/^(?:[0-9]+)/i,/^(?:,)/i],conditions:{"acc_descr_multiline":{"rules":[6,7,68,69,70],"inclusive":false},"acc_descr":{"rules":[4,68,69,70],"inclusive":false},"acc_title":{"rules":[2,68,69,70],"inclusive":false},"style":{"rules":[50,51,52,53,54,55,56,57,58,68,69,70],"inclusive":false},"unqString":{"rules":[68,69,70],"inclusive":false},"token":{"rules":[68,69,70],"inclusive":false},"string":{"rules":[65,66,68,69,70],"inclusive":false},"INITIAL":{"rules":[0,1,3,5,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,59,60,61,62,63,64,67,68,69,70],"inclusive":true}}};return ze}();Be.lexer=qe;function Qe(){this.yy={}}B(Qe,"Parser");Qe.prototype=Be;Be.Parser=Qe;return new Qe}();dlt.parser=dlt;OUi=dlt;BUi=class{constructor(){this.relations=[];this.latestRequirement=this.getInitialRequirement();this.requirements=new Map;this.latestElement=this.getInitialElement();this.elements=new Map;this.classes=new Map;this.direction="TB";this.RequirementType={REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"};this.RiskLevel={LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"};this.VerifyType={VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"};this.Relationships={CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"};this.setAccTitle=Ka;this.getAccTitle=is;this.setAccDescription=os;this.getAccDescription=as;this.setDiagramTitle=ys;this.getDiagramTitle=ss;this.getConfig=B(()=>Mn().requirement,"getConfig");this.clear();this.setDirection=this.setDirection.bind(this);this.addRequirement=this.addRequirement.bind(this);this.setNewReqId=this.setNewReqId.bind(this);this.setNewReqRisk=this.setNewReqRisk.bind(this);this.setNewReqText=this.setNewReqText.bind(this);this.setNewReqVerifyMethod=this.setNewReqVerifyMethod.bind(this);this.addElement=this.addElement.bind(this);this.setNewElementType=this.setNewElementType.bind(this);this.setNewElementDocRef=this.setNewElementDocRef.bind(this);this.addRelationship=this.addRelationship.bind(this);this.setCssStyle=this.setCssStyle.bind(this);this.setClass=this.setClass.bind(this);this.defineClass=this.defineClass.bind(this);this.setAccTitle=this.setAccTitle.bind(this);this.setAccDescription=this.setAccDescription.bind(this)}static{B(this,"RequirementDB")}getDirection(){return this.direction}setDirection(e){this.direction=e}resetLatestRequirement(){this.latestRequirement=this.getInitialRequirement()}resetLatestElement(){this.latestElement=this.getInitialElement()}getInitialRequirement(){return{requirementId:"",text:"",risk:"",verifyMethod:"",name:"",type:"",cssStyles:[],classes:["default"]}}getInitialElement(){return{name:"",type:"",docRef:"",cssStyles:[],classes:["default"]}}addRequirement(e,t){if(!this.requirements.has(e)){this.requirements.set(e,{name:e,type:t,requirementId:this.latestRequirement.requirementId,text:this.latestRequirement.text,risk:this.latestRequirement.risk,verifyMethod:this.latestRequirement.verifyMethod,cssStyles:[],classes:["default"]})}this.resetLatestRequirement();return this.requirements.get(e)}getRequirements(){return this.requirements}setNewReqId(e){if(this.latestRequirement!==void 0){this.latestRequirement.requirementId=e}}setNewReqText(e){if(this.latestRequirement!==void 0){this.latestRequirement.text=e}}setNewReqRisk(e){if(this.latestRequirement!==void 0){this.latestRequirement.risk=e}}setNewReqVerifyMethod(e){if(this.latestRequirement!==void 0){this.latestRequirement.verifyMethod=e}}addElement(e){if(!this.elements.has(e)){this.elements.set(e,{name:e,type:this.latestElement.type,docRef:this.latestElement.docRef,cssStyles:[],classes:["default"]});wt.info("Added new element: ",e)}this.resetLatestElement();return this.elements.get(e)}getElements(){return this.elements}setNewElementType(e){if(this.latestElement!==void 0){this.latestElement.type=e}}setNewElementDocRef(e){if(this.latestElement!==void 0){this.latestElement.docRef=e}}addRelationship(e,t,n){this.relations.push({type:e,src:t,dst:n})}getRelationships(){return this.relations}clear(){this.relations=[];this.resetLatestRequirement();this.requirements=new Map;this.resetLatestElement();this.elements=new Map;this.classes=new Map;Da()}setCssStyle(e,t){for(const n of e){const r=this.requirements.get(n)??this.elements.get(n);if(!t||!r){return}for(const i of t){if(i.includes(",")){r.cssStyles.push(...i.split(","))}else{r.cssStyles.push(i)}}}}setClass(e,t){for(const n of e){const r=this.requirements.get(n)??this.elements.get(n);if(r){for(const i of t){r.classes.push(i);const o=this.classes.get(i)?.styles;if(o){r.cssStyles.push(...o)}}}}}defineClass(e,t){for(const n of e){let r=this.classes.get(n);if(r===void 0){r={id:n,styles:[],textStyles:[]};this.classes.set(n,r)}if(t){t.forEach(function(i){if(/color/.exec(i)){const o=i.replace("fill","bgFill");r.textStyles.push(o)}r.styles.push(i)})}this.requirements.forEach(i=>{if(i.classes.includes(n)){i.cssStyles.push(...t.flatMap(o=>o.split(",")))}});this.elements.forEach(i=>{if(i.classes.includes(n)){i.cssStyles.push(...t.flatMap(o=>o.split(",")))}})}}getClasses(){return this.classes}getData(){const e=Mn();const t=[];const n=[];for(const r of this.requirements.values()){const i=r;i.id=r.name;i.cssStyles=r.cssStyles;i.cssClasses=r.classes.join(" ");i.shape="requirementBox";i.look=e.look;i.colorIndex=t.length;t.push(i)}for(const r of this.elements.values()){const i=r;i.shape="requirementBox";i.look=e.look;i.id=r.name;i.cssStyles=r.cssStyles;i.cssClasses=r.classes.join(" ");i.colorIndex=t.length;t.push(i)}for(const r of this.relations){let i=0;const o=r.type===this.Relationships.CONTAINS;const a={id:`${r.src}-${r.dst}-${i}`,start:this.requirements.get(r.src)?.name??this.elements.get(r.src)?.name,end:this.requirements.get(r.dst)?.name??this.elements.get(r.dst)?.name,label:`<<${r.type}>>`,classes:"relationshipLine",style:["fill:none",o?"":"stroke-dasharray: 10,7"],labelpos:"c",thickness:"normal",type:"normal",pattern:o?"normal":"dashed",arrowTypeStart:o?"requirement_contains":"",arrowTypeEnd:o?"":"requirement_arrow",look:e.look,labelType:"markdown"};n.push(a);i++}return{nodes:t,edges:n,other:{},config:e,direction:this.getDirection()}}};zUi=B(e=>{const t=Ji();const{themeVariables:n,look:r}=t;const{bkgColorArray:i,borderColorArray:o}=n;if(!o?.length){return""}let a="";for(let s=0;s{const t=Ji();const{look:n,themeVariables:r}=t;const{requirementEdgeLabelBackground:i}=r;return` + ${zUi(e)} + marker { + fill: ${e.relationColor}; + stroke: ${e.relationColor}; + } + + marker.cross { + stroke: ${e.lineColor}; + } + + svg { + font-family: ${e.fontFamily}; + font-size: ${e.fontSize}; + } + + .reqBox { + fill: ${e.requirementBackground}; + fill-opacity: 1.0; + stroke: ${e.requirementBorderColor}; + stroke-width: ${e.requirementBorderSize}; + } + + .reqTitle, .reqLabel{ + fill: ${e.requirementTextColor}; + } + .reqLabelBox { + fill: ${e.relationLabelBackground}; + fill-opacity: 1.0; + } + + .req-title-line { + stroke: ${e.requirementBorderColor}; + stroke-width: ${e.requirementBorderSize}; + } + .relationshipLine { + stroke: ${e.relationColor}; + stroke-width: ${n==="neo"?e.strokeWidth:"1px"}; + } + .relationshipLabel { + fill: ${e.relationLabelColor}; + } + .edgeLabel { + background-color: ${e.edgeLabelBackground}; + } + .edgeLabel .label rect { + fill: ${e.edgeLabelBackground}; + } + .edgeLabel .label text { + fill: ${e.relationLabelColor}; + } + .divider { + stroke: ${e.nodeBorder}; + stroke-width: 1; + } + .label { + font-family: ${e.fontFamily}; + color: ${e.nodeTextColor||e.textColor}; + } + .label text,span { + fill: ${e.nodeTextColor||e.textColor}; + color: ${e.nodeTextColor||e.textColor}; + } + .labelBkg { + background-color: ${i??e.edgeLabelBackground}; + } + +`},"getStyles");VUi=UUi;TOn={};ZM(TOn,{draw:()=>$Ui});$Ui=B(async function(e,t,n,r){wt.info("REF0:");wt.info("Drawing requirement diagram (unified)",t);const{securityLevel:i,state:o,layout:a,look:s}=Mn();const l=r.db.getData();const u=G_(t,i);l.type=r.type;l.layoutAlgorithm=nS(a);l.nodeSpacing=o?.nodeSpacing??50;l.rankSpacing=o?.rankSpacing??50;l.markers=s==="neo"?["requirement_contains_neo","requirement_arrow_neo"]:["requirement_contains","requirement_arrow"];l.diagramId=t;await B_(l,u);const d=8;Ko.insertTitle(u,"requirementDiagramTitleText",o?.titleTopMargin??25,r.db.getDiagramTitle());Ex(u,d,"requirementDiagram",o?.useMaxWidth??true)},"draw");GUi={parser:OUi,get db(){return new BUi},renderer:TOn,styles:VUi}});var BOn={};Oo(BOn,{diagram:()=>BVi});async function IOn(e,t){Ai.bumpVerticalPos(10);const{startx:n,stopx:r,message:i}=t;const o=Ti.splitBreaks(i).length;const a=of(i);const s=a?await a$(i,Mn()):Ko.calculateTextDimensions(i,G6(yr));if(!a){const f=s.height/o;t.height+=f;Ai.bumpVerticalPos(f)}let l;let u=s.height-10;const d=s.width;if(n===r){l=Ai.getVerticalPos()+u;if(!yr.rightAngles){u+=yr.boxMargin;l=Ai.getVerticalPos()+u}u+=30;const f=Ti.getMax(d/2,yr.width/2);Ai.insert(n-f,Ai.getVerticalPos()-10+u,r+f,Ai.getVerticalPos()+30+u)}else{u+=yr.boxMargin;l=Ai.getVerticalPos()+u;Ai.insert(n,l-10,r,l)}Ai.bumpVerticalPos(u);t.height+=u;t.stopy=t.starty+t.height;Ai.insert(t.fromBounds,t.starty,t.toBounds,t.stopy);return l}function Xw(e,t,n,r,i){Ai.bumpVerticalPos(n);let o=r;if(t.id&&t.message&&e[t.id]){const a=e[t.id].width;const s=G6(yr);t.message=Ko.wrapLabel(`[${t.message}]`,a-2*yr.wrapPadding,s);t.width=a;t.wrap=true;const l=Ko.calculateTextDimensions(t.message,s);const u=Ti.getMax(l.height,yr.labelBoxHeight);o=r+u;wt.debug(`${u} - ${t.message}`)}i(t);Ai.bumpVerticalPos(o)}function DOn(e,t,n,r,i,o,a){function s(d,f){if(d.x{const a=G6(yr);let s=o.actorKeys.reduce((f,h)=>{return f+=e.get(h).width+(e.get(h).margin||0)},0);const l=yr.boxMargin*8;s+=l;s-=2*yr.boxTextMargin;if(o.wrap){o.name=Ko.wrapLabel(o.name,s-2*yr.wrapPadding,a)}const u=Ko.calculateTextDimensions(o.name,a);i=Ti.getMax(u.height,i);const d=Ti.getMax(s,u.width+2*yr.wrapPadding);o.margin=yr.boxTextMargin;if(so.textMaxHeight=i);return Ti.getMax(r,yr.height)}var glt,hlt,HUi,WUi,YUi,qUi,IPe,XUi,jUi,KUi,V6,TD,wD,LPe,$6,dP,xre,ZUi,DPe,MPe,TH,AOn,zl,kOn,JUi,QUi,eVi,tVi,nVi,rVi,iVi,oVi,aVi,sVi,lVi,cVi,uVi,ROn,dVi,fVi,hVi,pVi,mVi,gVi,yVi,bVi,POn,xVi,fP,vVi,_Vi,TVi,wVi,EVi,dd,yr,Ai,CVi,COn,G6,_H,plt,SVi,AVi,mlt,MOn,LOn,FPe,SOn,kVi,RVi,PVi,IVi,MVi,flt,LVi,OOn,DVi,FVi,NVi,OVi,BVi;var zOn=Ce(()=>{JSe();Y5();sv();nl();Ta();Aa();Yo();ks();glt=Ui(p$(),1);hlt=function(){var e=B(function(_t,sn,Jt,Sn){for(Jt=Jt||{},Sn=_t.length;Sn--;Jt[_t[Sn]]=sn);return Jt},"o"),t=[1,2],n=[1,3],r=[1,4],i=[2,4],o=[1,9],a=[1,11],s=[1,12],l=[1,14],u=[1,15],d=[1,17],f=[1,18],h=[1,19],m=[1,25],g=[1,26],x=[1,27],w=[1,28],_=[1,29],C=[1,30],A=[1,31],P=[1,32],L=[1,33],I=[1,34],N=[1,35],O=[1,36],z=[1,37],U=[1,38],W=[1,39],H=[1,40],$=[1,42],K=[1,43],X=[1,44],j=[1,45],te=[1,46],J=[1,47],oe=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],se=[1,74],re=[1,80],ce=[1,81],ue=[1,82],xe=[1,83],be=[1,84],Ie=[1,85],he=[1,86],ve=[1,87],ge=[1,88],Ve=[1,89],Le=[1,90],$e=[1,91],Ee=[1,92],tt=[1,93],yt=[1,94],mt=[1,95],ct=[1,96],Ge=[1,97],it=[1,98],bt=[1,99],He=[1,100],Je=[1,101],Te=[1,102],we=[1,103],Ze=[1,104],Be=[1,105],qe=[2,78],Qe=[4,5,17,51,53,54],ze=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],Me=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],ye=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],Ne=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],Ae=[5,52],dt=[70,71,72,73],Oe=[1,151];var Wt={trace:B(function _t(){},"trace"),yy:{},symbols_:{"error":2,"start":3,"SPACE":4,"NEWLINE":5,"SD":6,"document":7,"line":8,"statement":9,"INVALID":10,"box_section":11,"box_line":12,"participant_statement":13,"create":14,"box":15,"restOfLine":16,"end":17,"signal":18,"autonumber":19,"NUM":20,"off":21,"activate":22,"actor":23,"deactivate":24,"note_statement":25,"links_statement":26,"link_statement":27,"properties_statement":28,"details_statement":29,"title":30,"legacy_title":31,"acc_title":32,"acc_title_value":33,"acc_descr":34,"acc_descr_value":35,"acc_descr_multiline_value":36,"loop":37,"rect":38,"opt":39,"alt":40,"else_sections":41,"par":42,"par_sections":43,"par_over":44,"critical":45,"option_sections":46,"break":47,"option":48,"and":49,"else":50,"participant":51,"AS":52,"participant_actor":53,"destroy":54,"actor_with_config":55,"note":56,"placement":57,"text2":58,"over":59,"actor_pair":60,"links":61,"link":62,"properties":63,"details":64,"spaceList":65,",":66,"left_of":67,"right_of":68,"signaltype":69,"+":70,"-":71,"()":72,"ACTOR":73,"config_object":74,"CONFIG_START":75,"CONFIG_CONTENT":76,"CONFIG_END":77,"SOLID_OPEN_ARROW":78,"DOTTED_OPEN_ARROW":79,"SOLID_ARROW":80,"SOLID_ARROW_TOP":81,"SOLID_ARROW_BOTTOM":82,"STICK_ARROW_TOP":83,"STICK_ARROW_BOTTOM":84,"SOLID_ARROW_TOP_DOTTED":85,"SOLID_ARROW_BOTTOM_DOTTED":86,"STICK_ARROW_TOP_DOTTED":87,"STICK_ARROW_BOTTOM_DOTTED":88,"SOLID_ARROW_TOP_REVERSE":89,"SOLID_ARROW_BOTTOM_REVERSE":90,"STICK_ARROW_TOP_REVERSE":91,"STICK_ARROW_BOTTOM_REVERSE":92,"SOLID_ARROW_TOP_REVERSE_DOTTED":93,"SOLID_ARROW_BOTTOM_REVERSE_DOTTED":94,"STICK_ARROW_TOP_REVERSE_DOTTED":95,"STICK_ARROW_BOTTOM_REVERSE_DOTTED":96,"BIDIRECTIONAL_SOLID_ARROW":97,"DOTTED_ARROW":98,"BIDIRECTIONAL_DOTTED_ARROW":99,"SOLID_CROSS":100,"DOTTED_CROSS":101,"SOLID_POINT":102,"DOTTED_POINT":103,"TXT":104,"$accept":0,"$end":1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",10:"INVALID",14:"create",15:"box",16:"restOfLine",17:"end",19:"autonumber",20:"NUM",21:"off",22:"activate",24:"deactivate",30:"title",31:"legacy_title",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"loop",38:"rect",39:"opt",40:"alt",42:"par",44:"par_over",45:"critical",47:"break",48:"option",49:"and",50:"else",51:"participant",52:"AS",53:"participant_actor",54:"destroy",56:"note",59:"over",61:"links",62:"link",63:"properties",64:"details",66:",",67:"left_of",68:"right_of",70:"+",71:"-",72:"()",73:"ACTOR",75:"CONFIG_START",76:"CONFIG_CONTENT",77:"CONFIG_END",78:"SOLID_OPEN_ARROW",79:"DOTTED_OPEN_ARROW",80:"SOLID_ARROW",81:"SOLID_ARROW_TOP",82:"SOLID_ARROW_BOTTOM",83:"STICK_ARROW_TOP",84:"STICK_ARROW_BOTTOM",85:"SOLID_ARROW_TOP_DOTTED",86:"SOLID_ARROW_BOTTOM_DOTTED",87:"STICK_ARROW_TOP_DOTTED",88:"STICK_ARROW_BOTTOM_DOTTED",89:"SOLID_ARROW_TOP_REVERSE",90:"SOLID_ARROW_BOTTOM_REVERSE",91:"STICK_ARROW_TOP_REVERSE",92:"STICK_ARROW_BOTTOM_REVERSE",93:"SOLID_ARROW_TOP_REVERSE_DOTTED",94:"SOLID_ARROW_BOTTOM_REVERSE_DOTTED",95:"STICK_ARROW_TOP_REVERSE_DOTTED",96:"STICK_ARROW_BOTTOM_REVERSE_DOTTED",97:"BIDIRECTIONAL_SOLID_ARROW",98:"DOTTED_ARROW",99:"BIDIRECTIONAL_DOTTED_ARROW",100:"SOLID_CROSS",101:"DOTTED_CROSS",102:"SOLID_POINT",103:"DOTTED_POINT",104:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:B(function _t(sn,Jt,Sn,Kt,mn,At,lr){var on=At.length-1;switch(mn){case 3:Kt.apply(At[on]);return At[on];break;case 4:case 10:this.$=[];break;case 5:case 11:At[on-1].push(At[on]);this.$=At[on-1];break;case 6:case 7:case 12:case 13:this.$=At[on];break;case 8:case 9:case 14:this.$=[];break;case 16:At[on].type="createParticipant";this.$=At[on];break;case 17:At[on-1].unshift({type:"boxStart",boxData:Kt.parseBoxData(At[on-2])});At[on-1].push({type:"boxEnd",boxText:At[on-2]});this.$=At[on-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(At[on-2]),sequenceIndexStep:Number(At[on-1]),sequenceVisible:true,signalType:Kt.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(At[on-1]),sequenceIndexStep:1,sequenceVisible:true,signalType:Kt.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:false,signalType:Kt.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:true,signalType:Kt.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:Kt.LINETYPE.ACTIVE_START,actor:At[on-1].actor};break;case 24:this.$={type:"activeEnd",signalType:Kt.LINETYPE.ACTIVE_END,actor:At[on-1].actor};break;case 30:Kt.setDiagramTitle(At[on].substring(6));this.$=At[on].substring(6);break;case 31:Kt.setDiagramTitle(At[on].substring(7));this.$=At[on].substring(7);break;case 32:this.$=At[on].trim();Kt.setAccTitle(this.$);break;case 33:case 34:this.$=At[on].trim();Kt.setAccDescription(this.$);break;case 35:At[on-1].unshift({type:"loopStart",loopText:Kt.parseMessage(At[on-2]),signalType:Kt.LINETYPE.LOOP_START});At[on-1].push({type:"loopEnd",loopText:At[on-2],signalType:Kt.LINETYPE.LOOP_END});this.$=At[on-1];break;case 36:At[on-1].unshift({type:"rectStart",color:Kt.parseMessage(At[on-2]),signalType:Kt.LINETYPE.RECT_START});At[on-1].push({type:"rectEnd",color:Kt.parseMessage(At[on-2]),signalType:Kt.LINETYPE.RECT_END});this.$=At[on-1];break;case 37:At[on-1].unshift({type:"optStart",optText:Kt.parseMessage(At[on-2]),signalType:Kt.LINETYPE.OPT_START});At[on-1].push({type:"optEnd",optText:Kt.parseMessage(At[on-2]),signalType:Kt.LINETYPE.OPT_END});this.$=At[on-1];break;case 38:At[on-1].unshift({type:"altStart",altText:Kt.parseMessage(At[on-2]),signalType:Kt.LINETYPE.ALT_START});At[on-1].push({type:"altEnd",signalType:Kt.LINETYPE.ALT_END});this.$=At[on-1];break;case 39:At[on-1].unshift({type:"parStart",parText:Kt.parseMessage(At[on-2]),signalType:Kt.LINETYPE.PAR_START});At[on-1].push({type:"parEnd",signalType:Kt.LINETYPE.PAR_END});this.$=At[on-1];break;case 40:At[on-1].unshift({type:"parStart",parText:Kt.parseMessage(At[on-2]),signalType:Kt.LINETYPE.PAR_OVER_START});At[on-1].push({type:"parEnd",signalType:Kt.LINETYPE.PAR_END});this.$=At[on-1];break;case 41:At[on-1].unshift({type:"criticalStart",criticalText:Kt.parseMessage(At[on-2]),signalType:Kt.LINETYPE.CRITICAL_START});At[on-1].push({type:"criticalEnd",signalType:Kt.LINETYPE.CRITICAL_END});this.$=At[on-1];break;case 42:At[on-1].unshift({type:"breakStart",breakText:Kt.parseMessage(At[on-2]),signalType:Kt.LINETYPE.BREAK_START});At[on-1].push({type:"breakEnd",optText:Kt.parseMessage(At[on-2]),signalType:Kt.LINETYPE.BREAK_END});this.$=At[on-1];break;case 44:this.$=At[on-3].concat([{type:"option",optionText:Kt.parseMessage(At[on-1]),signalType:Kt.LINETYPE.CRITICAL_OPTION},At[on]]);break;case 46:this.$=At[on-3].concat([{type:"and",parText:Kt.parseMessage(At[on-1]),signalType:Kt.LINETYPE.PAR_AND},At[on]]);break;case 48:this.$=At[on-3].concat([{type:"else",altText:Kt.parseMessage(At[on-1]),signalType:Kt.LINETYPE.ALT_ELSE},At[on]]);break;case 49:At[on-3].draw="participant";At[on-3].type="addParticipant";At[on-3].description=Kt.parseMessage(At[on-1]);this.$=At[on-3];break;case 50:At[on-1].draw="participant";At[on-1].type="addParticipant";this.$=At[on-1];break;case 51:At[on-3].draw="actor";At[on-3].type="addParticipant";At[on-3].description=Kt.parseMessage(At[on-1]);this.$=At[on-3];break;case 52:case 57:At[on-1].draw="actor";At[on-1].type="addParticipant";this.$=At[on-1];break;case 53:At[on-1].type="destroyParticipant";this.$=At[on-1];break;case 54:At[on-3].draw="participant";At[on-3].type="addParticipant";At[on-3].description=Kt.parseMessage(At[on-1]);this.$=At[on-3];break;case 55:At[on-1].draw="participant";At[on-1].type="addParticipant";this.$=At[on-1];break;case 56:At[on-3].draw="actor";At[on-3].type="addParticipant";At[on-3].description=Kt.parseMessage(At[on-1]);this.$=At[on-3];break;case 58:this.$=[At[on-1],{type:"addNote",placement:At[on-2],actor:At[on-1].actor,text:At[on]}];break;case 59:At[on-2]=[].concat(At[on-1],At[on-1]).slice(0,2);At[on-2][0]=At[on-2][0].actor;At[on-2][1]=At[on-2][1].actor;this.$=[At[on-1],{type:"addNote",placement:Kt.PLACEMENT.OVER,actor:At[on-2].slice(0,2),text:At[on]}];break;case 60:this.$=[At[on-1],{type:"addLinks",actor:At[on-1].actor,text:At[on]}];break;case 61:this.$=[At[on-1],{type:"addALink",actor:At[on-1].actor,text:At[on]}];break;case 62:this.$=[At[on-1],{type:"addProperties",actor:At[on-1].actor,text:At[on]}];break;case 63:this.$=[At[on-1],{type:"addDetails",actor:At[on-1].actor,text:At[on]}];break;case 66:this.$=[At[on-2],At[on]];break;case 67:this.$=At[on];break;case 68:this.$=Kt.PLACEMENT.LEFTOF;break;case 69:this.$=Kt.PLACEMENT.RIGHTOF;break;case 70:this.$=[At[on-4],At[on-1],{type:"addMessage",from:At[on-4].actor,to:At[on-1].actor,signalType:At[on-3],msg:At[on],activate:true},{type:"activeStart",signalType:Kt.LINETYPE.ACTIVE_START,actor:At[on-1].actor}];break;case 71:this.$=[At[on-4],At[on-1],{type:"addMessage",from:At[on-4].actor,to:At[on-1].actor,signalType:At[on-3],msg:At[on]},{type:"activeEnd",signalType:Kt.LINETYPE.ACTIVE_END,actor:At[on-4].actor}];break;case 72:this.$=[At[on-4],At[on-1],{type:"addMessage",from:At[on-4].actor,to:At[on-1].actor,signalType:At[on-3],msg:At[on],activate:true,centralConnection:Kt.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:Kt.LINETYPE.CENTRAL_CONNECTION,actor:At[on-1].actor}];break;case 73:this.$=[At[on-4],At[on-1],{type:"addMessage",from:At[on-4].actor,to:At[on-1].actor,signalType:At[on-2],msg:At[on],activate:false,centralConnection:Kt.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:Kt.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:At[on-4].actor}];break;case 74:this.$=[At[on-5],At[on-1],{type:"addMessage",from:At[on-5].actor,to:At[on-1].actor,signalType:At[on-3],msg:At[on],activate:true,centralConnection:Kt.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:Kt.LINETYPE.CENTRAL_CONNECTION,actor:At[on-1].actor},{type:"centralConnectionReverse",signalType:Kt.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:At[on-5].actor}];break;case 75:this.$=[At[on-3],At[on-1],{type:"addMessage",from:At[on-3].actor,to:At[on-1].actor,signalType:At[on-2],msg:At[on]}];break;case 76:this.$={type:"addParticipant",actor:At[on-1],config:At[on]};break;case 77:this.$=At[on-1].trim();break;case 78:this.$={type:"addParticipant",actor:At[on]};break;case 79:this.$=Kt.LINETYPE.SOLID_OPEN;break;case 80:this.$=Kt.LINETYPE.DOTTED_OPEN;break;case 81:this.$=Kt.LINETYPE.SOLID;break;case 82:this.$=Kt.LINETYPE.SOLID_TOP;break;case 83:this.$=Kt.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=Kt.LINETYPE.STICK_TOP;break;case 85:this.$=Kt.LINETYPE.STICK_BOTTOM;break;case 86:this.$=Kt.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=Kt.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=Kt.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=Kt.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=Kt.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=Kt.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=Kt.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=Kt.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=Kt.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=Kt.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=Kt.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=Kt.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=Kt.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=Kt.LINETYPE.DOTTED;break;case 100:this.$=Kt.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=Kt.LINETYPE.SOLID_CROSS;break;case 102:this.$=Kt.LINETYPE.DOTTED_CROSS;break;case 103:this.$=Kt.LINETYPE.SOLID_POINT;break;case 104:this.$=Kt.LINETYPE.DOTTED_POINT;break;case 105:this.$=Kt.parseMessage(At[on].trim().substring(1));break}},"anonymous"),table:[{3:1,4:t,5:n,6:r},{1:[3]},{3:5,4:t,5:n,6:r},{3:6,4:t,5:n,6:r},e([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:a,8:8,9:10,10:s,13:13,14:l,15:u,18:16,19:d,22:f,23:41,24:h,25:20,26:21,27:22,28:23,29:24,30:m,31:g,32:x,34:w,36:_,37:C,38:A,39:P,40:L,42:I,44:N,45:O,47:z,51:U,53:W,54:H,56:$,61:K,62:X,63:j,64:te,73:J},e(oe,[2,5]),{9:48,13:13,14:l,15:u,18:16,19:d,22:f,23:41,24:h,25:20,26:21,27:22,28:23,29:24,30:m,31:g,32:x,34:w,36:_,37:C,38:A,39:P,40:L,42:I,44:N,45:O,47:z,51:U,53:W,54:H,56:$,61:K,62:X,63:j,64:te,73:J},e(oe,[2,7]),e(oe,[2,8]),e(oe,[2,9]),e(oe,[2,15]),{13:49,51:U,53:W,54:H},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:J},{23:56,73:J},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},e(oe,[2,30]),e(oe,[2,31]),{33:[1,62]},{35:[1,63]},e(oe,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:se},{23:75,55:76,73:se},{23:77,73:J},{69:78,72:[1,79],78:re,79:ce,80:ue,81:xe,82:be,83:Ie,84:he,85:ve,86:ge,87:Ve,88:Le,89:$e,90:Ee,91:tt,92:yt,93:mt,94:ct,95:Ge,96:it,97:bt,98:He,99:Je,100:Te,101:we,102:Ze,103:Be},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:J},{23:111,73:J},{23:112,73:J},{23:113,73:J},e([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],qe),e(oe,[2,6]),e(oe,[2,16]),e(Qe,[2,10],{11:114}),e(oe,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},e(oe,[2,22]),{5:[1,118]},{5:[1,119]},e(oe,[2,25]),e(oe,[2,26]),e(oe,[2,27]),e(oe,[2,28]),e(oe,[2,29]),e(oe,[2,32]),e(oe,[2,33]),e(ze,i,{7:120}),e(ze,i,{7:121}),e(ze,i,{7:122}),e(Me,i,{41:123,7:124}),e(ye,i,{43:125,7:126}),e(ye,i,{7:126,43:127}),e(Ne,i,{46:128,7:129}),e(ze,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},e(Ae,qe,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:J},{69:146,78:re,79:ce,80:ue,81:xe,82:be,83:Ie,84:he,85:ve,86:ge,87:Ve,88:Le,89:$e,90:Ee,91:tt,92:yt,93:mt,94:ct,95:Ge,96:it,97:bt,98:He,99:Je,100:Te,101:we,102:Ze,103:Be},e(dt,[2,79]),e(dt,[2,80]),e(dt,[2,81]),e(dt,[2,82]),e(dt,[2,83]),e(dt,[2,84]),e(dt,[2,85]),e(dt,[2,86]),e(dt,[2,87]),e(dt,[2,88]),e(dt,[2,89]),e(dt,[2,90]),e(dt,[2,91]),e(dt,[2,92]),e(dt,[2,93]),e(dt,[2,94]),e(dt,[2,95]),e(dt,[2,96]),e(dt,[2,97]),e(dt,[2,98]),e(dt,[2,99]),e(dt,[2,100]),e(dt,[2,101]),e(dt,[2,102]),e(dt,[2,103]),e(dt,[2,104]),{23:147,73:J},{23:149,60:148,73:J},{73:[2,68]},{73:[2,69]},{58:150,104:Oe},{58:152,104:Oe},{58:153,104:Oe},{58:154,104:Oe},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:U,53:W,54:H},{5:[1,160]},e(oe,[2,20]),e(oe,[2,21]),e(oe,[2,23]),e(oe,[2,24]),{4:o,5:a,8:8,9:10,10:s,13:13,14:l,15:u,17:[1,161],18:16,19:d,22:f,23:41,24:h,25:20,26:21,27:22,28:23,29:24,30:m,31:g,32:x,34:w,36:_,37:C,38:A,39:P,40:L,42:I,44:N,45:O,47:z,51:U,53:W,54:H,56:$,61:K,62:X,63:j,64:te,73:J},{4:o,5:a,8:8,9:10,10:s,13:13,14:l,15:u,17:[1,162],18:16,19:d,22:f,23:41,24:h,25:20,26:21,27:22,28:23,29:24,30:m,31:g,32:x,34:w,36:_,37:C,38:A,39:P,40:L,42:I,44:N,45:O,47:z,51:U,53:W,54:H,56:$,61:K,62:X,63:j,64:te,73:J},{4:o,5:a,8:8,9:10,10:s,13:13,14:l,15:u,17:[1,163],18:16,19:d,22:f,23:41,24:h,25:20,26:21,27:22,28:23,29:24,30:m,31:g,32:x,34:w,36:_,37:C,38:A,39:P,40:L,42:I,44:N,45:O,47:z,51:U,53:W,54:H,56:$,61:K,62:X,63:j,64:te,73:J},{17:[1,164]},{4:o,5:a,8:8,9:10,10:s,13:13,14:l,15:u,17:[2,47],18:16,19:d,22:f,23:41,24:h,25:20,26:21,27:22,28:23,29:24,30:m,31:g,32:x,34:w,36:_,37:C,38:A,39:P,40:L,42:I,44:N,45:O,47:z,50:[1,165],51:U,53:W,54:H,56:$,61:K,62:X,63:j,64:te,73:J},{17:[1,166]},{4:o,5:a,8:8,9:10,10:s,13:13,14:l,15:u,17:[2,45],18:16,19:d,22:f,23:41,24:h,25:20,26:21,27:22,28:23,29:24,30:m,31:g,32:x,34:w,36:_,37:C,38:A,39:P,40:L,42:I,44:N,45:O,47:z,49:[1,167],51:U,53:W,54:H,56:$,61:K,62:X,63:j,64:te,73:J},{17:[1,168]},{17:[1,169]},{4:o,5:a,8:8,9:10,10:s,13:13,14:l,15:u,17:[2,43],18:16,19:d,22:f,23:41,24:h,25:20,26:21,27:22,28:23,29:24,30:m,31:g,32:x,34:w,36:_,37:C,38:A,39:P,40:L,42:I,44:N,45:O,47:z,48:[1,170],51:U,53:W,54:H,56:$,61:K,62:X,63:j,64:te,73:J},{4:o,5:a,8:8,9:10,10:s,13:13,14:l,15:u,17:[1,171],18:16,19:d,22:f,23:41,24:h,25:20,26:21,27:22,28:23,29:24,30:m,31:g,32:x,34:w,36:_,37:C,38:A,39:P,40:L,42:I,44:N,45:O,47:z,51:U,53:W,54:H,56:$,61:K,62:X,63:j,64:te,73:J},{16:[1,172]},e(oe,[2,50]),{16:[1,173]},e(oe,[2,55]),e(Ae,[2,76]),{76:[1,174]},{16:[1,175]},e(oe,[2,52]),{16:[1,176]},e(oe,[2,57]),e(oe,[2,53]),{23:177,73:J},{23:178,73:J},{23:179,73:J},{58:180,104:Oe},{23:181,72:[1,182],73:J},{58:183,104:Oe},{58:184,104:Oe},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},e(oe,[2,17]),e(Qe,[2,11]),{13:186,51:U,53:W,54:H},e(Qe,[2,13]),e(Qe,[2,14]),e(oe,[2,19]),e(oe,[2,35]),e(oe,[2,36]),e(oe,[2,37]),e(oe,[2,38]),{16:[1,187]},e(oe,[2,39]),{16:[1,188]},e(oe,[2,40]),e(oe,[2,41]),{16:[1,189]},e(oe,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:Oe},{58:196,104:Oe},{58:197,104:Oe},{5:[2,75]},{58:198,104:Oe},{23:199,73:J},{5:[2,58]},{5:[2,59]},{23:200,73:J},e(Qe,[2,12]),e(Me,i,{7:124,41:201}),e(ye,i,{7:126,43:202}),e(Ne,i,{7:129,46:203}),e(oe,[2,49]),e(oe,[2,54]),e(Ae,[2,77]),e(oe,[2,51]),e(oe,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:Oe},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:B(function _t(sn,Jt){if(Jt.recoverable){this.trace(sn)}else{var Sn=new Error(sn);Sn.hash=Jt;throw Sn}},"parseError"),parse:B(function _t(sn){var Jt=this,Sn=[0],Kt=[],mn=[null],At=[],lr=this.table,on="",cr=0,Hr=0,Mr=0,Er=2,vr=1;var Yr=At.slice.call(arguments,1);var nt=Object.create(this.lexer);var Rr={yy:{}};for(var Xr in this.yy){if(Object.prototype.hasOwnProperty.call(this.yy,Xr)){Rr.yy[Xr]=this.yy[Xr]}}nt.setInput(sn,Rr.yy);Rr.yy.lexer=nt;Rr.yy.parser=this;if(typeof nt.yylloc=="undefined"){nt.yylloc={}}var dr=nt.yylloc;At.push(dr);var rn=nt.options&&nt.options.ranges;if(typeof Rr.yy.parseError==="function"){this.parseError=Rr.yy.parseError}else{this.parseError=Object.getPrototypeOf(this).parseError}function St(Fn){Sn.length=Sn.length-2*Fn;mn.length=mn.length-Fn;At.length=At.length-Fn}B(St,"popStack");function Ut(){var Fn;Fn=Kt.pop()||nt.lex()||vr;if(typeof Fn!=="number"){if(Fn instanceof Array){Kt=Fn;Fn=Kt.pop()}Fn=Jt.symbols_[Fn]||Fn}return Fn}B(Ut,"lex");var Pt,an,Xt,Cn,rr,hr,Et={},Tn,ft,zt,Gt;while(true){Xt=Sn[Sn.length-1];if(this.defaultActions[Xt]){Cn=this.defaultActions[Xt]}else{if(Pt===null||typeof Pt=="undefined"){Pt=Ut()}Cn=lr[Xt]&&lr[Xt][Pt]}if(typeof Cn==="undefined"||!Cn.length||!Cn[0]){var gn="";Gt=[];for(Tn in lr[Xt]){if(this.terminals_[Tn]&&Tn>Er){Gt.push("'"+this.terminals_[Tn]+"'")}}if(nt.showPosition){gn="Parse error on line "+(cr+1)+":\n"+nt.showPosition()+"\nExpecting "+Gt.join(", ")+", got '"+(this.terminals_[Pt]||Pt)+"'"}else{gn="Parse error on line "+(cr+1)+": Unexpected "+(Pt==vr?"end of input":"'"+(this.terminals_[Pt]||Pt)+"'")}this.parseError(gn,{text:nt.match,token:this.terminals_[Pt]||Pt,line:nt.yylineno,loc:dr,expected:Gt})}if(Cn[0]instanceof Array&&Cn.length>1){throw new Error("Parse Error: multiple actions possible at state: "+Xt+", token: "+Pt)}switch(Cn[0]){case 1:Sn.push(Pt);mn.push(nt.yytext);At.push(nt.yylloc);Sn.push(Cn[1]);Pt=null;if(!an){Hr=nt.yyleng;on=nt.yytext;cr=nt.yylineno;dr=nt.yylloc;if(Mr>0){Mr--}}else{Pt=an;an=null}break;case 2:ft=this.productions_[Cn[1]][1];Et.$=mn[mn.length-ft];Et._$={first_line:At[At.length-(ft||1)].first_line,last_line:At[At.length-1].last_line,first_column:At[At.length-(ft||1)].first_column,last_column:At[At.length-1].last_column};if(rn){Et._$.range=[At[At.length-(ft||1)].range[0],At[At.length-1].range[1]]}hr=this.performAction.apply(Et,[on,Hr,cr,Rr.yy,Cn[1],mn,At].concat(Yr));if(typeof hr!=="undefined"){return hr}if(ft){Sn=Sn.slice(0,-1*ft*2);mn=mn.slice(0,-1*ft);At=At.slice(0,-1*ft)}Sn.push(this.productions_[Cn[1]][0]);mn.push(Et.$);At.push(Et._$);zt=lr[Sn[Sn.length-2]][Sn[Sn.length-1]];Sn.push(zt);break;case 3:return true}}return true},"parse")};var kt=function(){var _t={EOF:1,parseError:B(function sn(Jt,Sn){if(this.yy.parser){this.yy.parser.parseError(Jt,Sn)}else{throw new Error(Jt)}},"parseError"),setInput:B(function(sn,Jt){this.yy=Jt||this.yy||{};this._input=sn;this._more=this._backtrack=this.done=false;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};if(this.options.ranges){this.yylloc.range=[0,0]}this.offset=0;return this},"setInput"),input:B(function(){var sn=this._input[0];this.yytext+=sn;this.yyleng++;this.offset++;this.match+=sn;this.matched+=sn;var Jt=sn.match(/(?:\r\n?|\n).*/g);if(Jt){this.yylineno++;this.yylloc.last_line++}else{this.yylloc.last_column++}if(this.options.ranges){this.yylloc.range[1]++}this._input=this._input.slice(1);return sn},"input"),unput:B(function(sn){var Jt=sn.length;var Sn=sn.split(/(?:\r\n?|\n)/g);this._input=sn+this._input;this.yytext=this.yytext.substr(0,this.yytext.length-Jt);this.offset-=Jt;var Kt=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1);this.matched=this.matched.substr(0,this.matched.length-1);if(Sn.length-1){this.yylineno-=Sn.length-1}var mn=this.yylloc.range;this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Sn?(Sn.length===Kt.length?this.yylloc.first_column:0)+Kt[Kt.length-Sn.length].length-Sn[0].length:this.yylloc.first_column-Jt};if(this.options.ranges){this.yylloc.range=[mn[0],mn[0]+this.yyleng-Jt]}this.yyleng=this.yytext.length;return this},"unput"),more:B(function(){this._more=true;return this},"more"),reject:B(function(){if(this.options.backtrack_lexer){this._backtrack=true}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}return this},"reject"),less:B(function(sn){this.unput(this.match.slice(sn))},"less"),pastInput:B(function(){var sn=this.matched.substr(0,this.matched.length-this.match.length);return(sn.length>20?"...":"")+sn.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:B(function(){var sn=this.match;if(sn.length<20){sn+=this._input.substr(0,20-sn.length)}return(sn.substr(0,20)+(sn.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:B(function(){var sn=this.pastInput();var Jt=new Array(sn.length+1).join("-");return sn+this.upcomingInput()+"\n"+Jt+"^"},"showPosition"),test_match:B(function(sn,Jt){var Sn,Kt,mn;if(this.options.backtrack_lexer){mn={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done};if(this.options.ranges){mn.yylloc.range=this.yylloc.range.slice(0)}}Kt=sn[0].match(/(?:\r\n?|\n).*/g);if(Kt){this.yylineno+=Kt.length}this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Kt?Kt[Kt.length-1].length-Kt[Kt.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+sn[0].length};this.yytext+=sn[0];this.match+=sn[0];this.matches=sn;this.yyleng=this.yytext.length;if(this.options.ranges){this.yylloc.range=[this.offset,this.offset+=this.yyleng]}this._more=false;this._backtrack=false;this._input=this._input.slice(sn[0].length);this.matched+=sn[0];Sn=this.performAction.call(this,this.yy,this,Jt,this.conditionStack[this.conditionStack.length-1]);if(this.done&&this._input){this.done=false}if(Sn){return Sn}else if(this._backtrack){for(var At in mn){this[At]=mn[At]}return false}return false},"test_match"),next:B(function(){if(this.done){return this.EOF}if(!this._input){this.done=true}var sn,Jt,Sn,Kt;if(!this._more){this.yytext="";this.match=""}var mn=this._currentRules();for(var At=0;AtJt[0].length)){Jt=Sn;Kt=At;if(this.options.backtrack_lexer){sn=this.test_match(Sn,mn[At]);if(sn!==false){return sn}else if(this._backtrack){Jt=false;continue}else{return false}}else if(!this.options.flex){break}}}if(Jt){sn=this.test_match(Jt,mn[Kt]);if(sn!==false){return sn}return false}if(this._input===""){return this.EOF}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}},"next"),lex:B(function sn(){var Jt=this.next();if(Jt){return Jt}else{return this.lex()}},"lex"),begin:B(function sn(Jt){this.conditionStack.push(Jt)},"begin"),popState:B(function sn(){var Jt=this.conditionStack.length-1;if(Jt>0){return this.conditionStack.pop()}else{return this.conditionStack[0]}},"popState"),_currentRules:B(function sn(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules}else{return this.conditions["INITIAL"].rules}},"_currentRules"),topState:B(function sn(Jt){Jt=this.conditionStack.length-1-Math.abs(Jt||0);if(Jt>=0){return this.conditionStack[Jt]}else{return"INITIAL"}},"topState"),pushState:B(function sn(Jt){this.begin(Jt)},"pushState"),stateStackSize:B(function sn(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":true},performAction:B(function sn(Jt,Sn,Kt,mn){var At=mn;switch(Kt){case 0:return 5;break;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 20;break;case 7:this.begin("CONFIG");return 75;break;case 8:return 76;break;case 9:this.popState();this.begin("ALIAS");return 77;break;case 10:this.popState();this.popState();return 77;break;case 11:Sn.yytext=Sn.yytext.trim();return 73;break;case 12:Sn.yytext=Sn.yytext.trim();this.begin("ALIAS");return 73;break;case 13:Sn.yytext=Sn.yytext.trim();this.popState();return 73;break;case 14:this.popState();return 10;break;case 15:Sn.yytext=Sn.yytext.trim();this.popState();return 10;break;case 16:this.begin("LINE");return 15;break;case 17:this.begin("ID");return 51;break;case 18:this.begin("ID");return 53;break;case 19:return 14;break;case 20:this.begin("ID");return 54;break;case 21:this.popState();this.popState();this.begin("LINE");return 52;break;case 22:this.popState();this.popState();return 5;break;case 23:this.begin("LINE");return 37;break;case 24:this.begin("LINE");return 38;break;case 25:this.begin("LINE");return 39;break;case 26:this.begin("LINE");return 40;break;case 27:this.begin("LINE");return 50;break;case 28:this.begin("LINE");return 42;break;case 29:this.begin("LINE");return 44;break;case 30:this.begin("LINE");return 49;break;case 31:this.begin("LINE");return 45;break;case 32:this.begin("LINE");return 48;break;case 33:this.begin("LINE");return 47;break;case 34:this.popState();return 16;break;case 35:return 17;break;case 36:return 67;break;case 37:return 68;break;case 38:return 61;break;case 39:return 62;break;case 40:return 63;break;case 41:return 64;break;case 42:return 59;break;case 43:return 56;break;case 44:this.begin("ID");return 22;break;case 45:this.begin("ID");return 24;break;case 46:return 30;break;case 47:return 31;break;case 48:this.begin("acc_title");return 32;break;case 49:this.popState();return"acc_title_value";break;case 50:this.begin("acc_descr");return 34;break;case 51:this.popState();return"acc_descr_value";break;case 52:this.begin("acc_descr_multiline");break;case 53:this.popState();break;case 54:return"acc_descr_multiline_value";break;case 55:return 6;break;case 56:return 19;break;case 57:return 21;break;case 58:return 66;break;case 59:return 5;break;case 60:Sn.yytext=Sn.yytext.trim();return 73;break;case 61:return 80;break;case 62:return 97;break;case 63:return 98;break;case 64:return 99;break;case 65:return 78;break;case 66:return 79;break;case 67:return 100;break;case 68:return 101;break;case 69:return 102;break;case 70:return 103;break;case 71:return 85;break;case 72:return 86;break;case 73:return 87;break;case 74:return 88;break;case 75:return 93;break;case 76:return 94;break;case 77:return 95;break;case 78:return 96;break;case 79:return 81;break;case 80:return 82;break;case 81:return 83;break;case 82:return 84;break;case 83:return 89;break;case 84:return 90;break;case 85:return 91;break;case 86:return 92;break;case 87:return 104;break;case 88:return 104;break;case 89:return 70;break;case 90:return 71;break;case 91:return 72;break;case 92:return 5;break;case 93:return 10;break}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:([0-9]+(\.[0-9]{1,2})?|\.[0-9]{1,2})(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\}(?=\s+as\s))/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^<>:\n,;@\s]+(?=\s+as\s))/i,/^(?:[^<>:\n,;@]+(?=\s*[\n;#]|$))/i,/^(?:[^<>:\n,;@]*<[^\n]*)/i,/^(?:[^\n]+)/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\/\\\+\()\+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)|-\|\\|-\\|-\/|-\/\/|-\|\/|\/\|-|\\\|-|\/\/-|\\\\-|\/\|-|--\|\\|--|\(\)))[\-]*[^\+<\->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?:--\|\\)/i,/^(?:--\|\/)/i,/^(?:--\\\\)/i,/^(?:--\/\/)/i,/^(?:\/\|--)/i,/^(?:\\\|--)/i,/^(?:\/\/--)/i,/^(?:\\\\--)/i,/^(?:-\|\\)/i,/^(?:-\|\/)/i,/^(?:-\\\\)/i,/^(?:-\/\/)/i,/^(?:\/\|-)/i,/^(?:\\\|-)/i,/^(?:\/\/-)/i,/^(?:\\\\-)/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:\(\))/i,/^(?:$)/i,/^(?:.)/i],conditions:{"acc_descr_multiline":{"rules":[53,54],"inclusive":false},"acc_descr":{"rules":[51],"inclusive":false},"acc_title":{"rules":[49],"inclusive":false},"ID":{"rules":[2,3,7,11,12,13,14,15],"inclusive":false},"ALIAS":{"rules":[2,3,21,22],"inclusive":false},"LINE":{"rules":[2,3,34],"inclusive":false},"CONFIG":{"rules":[8,9,10],"inclusive":false},"CONFIG_DATA":{"rules":[],"inclusive":false},"INITIAL":{"rules":[0,1,3,4,5,6,16,17,18,19,20,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,50,52,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93],"inclusive":true}}};return _t}();Wt.lexer=kt;function qt(){this.yy={}}B(qt,"Parser");qt.prototype=Wt;Wt.Parser=qt;return new qt}();hlt.parser=hlt;HUi=hlt;WUi={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34,SOLID_TOP:41,SOLID_BOTTOM:42,STICK_TOP:43,STICK_BOTTOM:44,SOLID_ARROW_TOP_REVERSE:45,SOLID_ARROW_BOTTOM_REVERSE:46,STICK_ARROW_TOP_REVERSE:47,STICK_ARROW_BOTTOM_REVERSE:48,SOLID_TOP_DOTTED:51,SOLID_BOTTOM_DOTTED:52,STICK_TOP_DOTTED:53,STICK_BOTTOM_DOTTED:54,SOLID_ARROW_TOP_REVERSE_DOTTED:55,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:56,STICK_ARROW_TOP_REVERSE_DOTTED:57,STICK_ARROW_BOTTOM_REVERSE_DOTTED:58,CENTRAL_CONNECTION:59,CENTRAL_CONNECTION_REVERSE:60,CENTRAL_CONNECTION_DUAL:61};YUi={FILLED:0,OPEN:1};qUi={LEFTOF:0,RIGHTOF:1,OVER:2};IPe={ACTOR:"actor",BOUNDARY:"boundary",COLLECTIONS:"collections",CONTROL:"control",DATABASE:"database",ENTITY:"entity",PARTICIPANT:"participant",QUEUE:"queue"};XUi=class{constructor(){this.state=new yG(()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:false,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0}));this.setAccTitle=Ka;this.setAccDescription=os;this.setDiagramTitle=ys;this.getAccTitle=is;this.getAccDescription=as;this.getDiagramTitle=ss;this.apply=this.apply.bind(this);this.parseBoxData=this.parseBoxData.bind(this);this.parseMessage=this.parseMessage.bind(this);this.clear();this.setWrap(Mn().wrap);this.LINETYPE=WUi;this.ARROWTYPE=YUi;this.PLACEMENT=qUi}static{B(this,"SequenceDB")}addBox(e){this.state.records.boxes.push({name:e.text,wrap:e.wrap??this.autoWrap(),fill:e.color,actorKeys:[]});this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(e,t,n,r,i){let o=this.state.records.currentBox;let a;if(i!==void 0){let l;if(!i.includes("\n")){l="{\n"+i+"\n}"}else{l=i+"\n"}a=gL(l,{schema:mL})}r=a?.type??r;if(a?.alias&&(!n||n.text===t)){n={text:a.alias,wrap:n?.wrap,type:r}}const s=this.state.records.actors.get(e);if(s){if(this.state.records.currentBox&&s.box&&this.state.records.currentBox!==s.box){throw new Error(`A same participant should only be defined in one Box: ${s.name} can't be in '${s.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`)}o=s.box?s.box:this.state.records.currentBox;s.box=o;if(s&&t===s.name&&n==null){return}}if(n?.text==null){n={text:t,type:r}}if(r==null||n.text==null){n={text:t,type:r}}this.state.records.actors.set(e,{box:o,name:t,description:n.text,wrap:n.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:r??"participant"});if(this.state.records.prevActor){const l=this.state.records.actors.get(this.state.records.prevActor);if(l){l.nextActor=e}}if(this.state.records.currentBox){this.state.records.currentBox.actorKeys.push(e)}this.state.records.prevActor=e}activationCount(e){let t;let n=0;if(!e){return 0}for(t=0;t>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]};throw s}}this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:e,to:t,message:n?.text??"",wrap:n?.wrap??this.autoWrap(),type:r,activate:i,centralConnection:o??0});return true}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(e=>e.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(e){return this.state.records.actors.get(e)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=true}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=false}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(e){this.state.records.wrapEnabled=e}extractWrap(e){if(e===void 0){return{}}e=e.trim();const t=/^:?wrap:/.exec(e)!==null?true:/^:?nowrap:/.exec(e)!==null?false:void 0;const n=(t===void 0?e:e.replace(/^:?(?:no)?wrap:/,"")).trim();return{cleanedText:n,wrap:t}}autoWrap(){if(this.state.records.wrapEnabled!==void 0){return this.state.records.wrapEnabled}return Mn().sequence?.wrap??false}clear(){this.state.reset();Da()}parseMessage(e){const t=e.trim();const{wrap:n,cleanedText:r}=this.extractWrap(t);const i={text:r,wrap:n};wt.debug(`parseMessage: ${JSON.stringify(i)}`);return i}parseBoxData(e){const t=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(e);let n=t?.[1]?t[1].trim():"transparent";let r=t?.[2]?t[2].trim():void 0;if(window?.CSS){if(!window.CSS.supports("color",n)){n="transparent";r=e.trim()}}else{const a=new Option().style;a.color=n;if(a.color!==n){n="transparent";r=e.trim()}}const{wrap:i,cleanedText:o}=this.extractWrap(r);return{text:o?La(o,Mn()):void 0,color:n,wrap:i}}addNote(e,t,n){const r={actor:e,placement:t,message:n.text,wrap:n.wrap??this.autoWrap()};const i=[].concat(e,e);this.state.records.notes.push(r);this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:i[0],to:i[1],message:n.text,wrap:n.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:t})}addLinks(e,t){const n=this.getActor(e);try{let r=La(t.text,Mn());r=r.replace(/=/g,"=");r=r.replace(/&/g,"&");const i=JSON.parse(r);this.insertLinks(n,i)}catch(r){wt.error("error while parsing actor link text",r)}}addALink(e,t){const n=this.getActor(e);try{const r={};let i=La(t.text,Mn());const o=i.indexOf("@");i=i.replace(/=/g,"=");i=i.replace(/&/g,"&");const a=i.slice(0,o-1).trim();const s=i.slice(o+1).trim();r[a]=s;this.insertLinks(n,r)}catch(r){wt.error("error while parsing actor link text",r)}}insertLinks(e,t){if(e.links==null){e.links=t}else{for(const n in t){e.links[n]=t[n]}}}addProperties(e,t){const n=this.getActor(e);try{const r=La(t.text,Mn());const i=JSON.parse(r);this.insertProperties(n,i)}catch(r){wt.error("error while parsing actor properties text",r)}}insertProperties(e,t){if(e.properties==null){e.properties=t}else{for(const n in t){e.properties[n]=t[n]}}}boxEnd(){this.state.records.currentBox=void 0}addDetails(e,t){const n=this.getActor(e);const r=document.getElementById(t.text);try{const i=r.innerHTML;const o=JSON.parse(i);if(o.properties){this.insertProperties(n,o.properties)}if(o.links){this.insertLinks(n,o.links)}}catch(i){wt.error("error while parsing actor details text",i)}}getActorProperty(e,t){if(e?.properties!==void 0){return e.properties[t]}return void 0}apply(e){if(Array.isArray(e)){e.forEach(t=>{this.apply(t)})}else{switch(e.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:e.sequenceIndex,step:e.sequenceIndexStep,visible:e.sequenceVisible},wrap:false,type:e.signalType});break;case"addParticipant":this.addActor(e.actor,e.actor,e.description,e.draw,e.config);break;case"createParticipant":if(this.state.records.actors.has(e.actor)){throw new Error("It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior")}this.state.records.lastCreated=e.actor;this.addActor(e.actor,e.actor,e.description,e.draw,e.config);this.state.records.createdActors.set(e.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=e.actor;this.state.records.destroyedActors.set(e.actor,this.state.records.messages.length);break;case"activeStart":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnection":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnectionReverse":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"activeEnd":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"addNote":this.addNote(e.actor,e.placement,e.text);break;case"addLinks":this.addLinks(e.actor,e.text);break;case"addALink":this.addALink(e.actor,e.text);break;case"addProperties":this.addProperties(e.actor,e.text);break;case"addDetails":this.addDetails(e.actor,e.text);break;case"addMessage":if(this.state.records.lastCreated){if(e.to!==this.state.records.lastCreated){throw new Error("The created participant "+this.state.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.")}else{this.state.records.lastCreated=void 0}}else if(this.state.records.lastDestroyed){if(e.to!==this.state.records.lastDestroyed&&e.from!==this.state.records.lastDestroyed){throw new Error("The destroyed participant "+this.state.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.")}else{this.state.records.lastDestroyed=void 0}}this.addSignal(e.from,e.to,e.msg,e.signalType,e.activate,e.centralConnection);break;case"boxStart":this.addBox(e.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,e.loopText,e.signalType);break;case"loopEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"rectStart":this.addSignal(void 0,void 0,e.color,e.signalType);break;case"rectEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"optStart":this.addSignal(void 0,void 0,e.optText,e.signalType);break;case"optEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"altStart":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"else":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"altEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"setAccTitle":Ka(e.text);break;case"parStart":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"and":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"parEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,e.criticalText,e.signalType);break;case"option":this.addSignal(void 0,void 0,e.optionText,e.signalType);break;case"criticalEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"breakStart":this.addSignal(void 0,void 0,e.breakText,e.signalType);break;case"breakEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break}}}getConfig(){return Mn().sequence}};jUi=B(e=>{const t=e.dropShadow??"none";const{look:n}=Mn();return`.actor { + stroke: ${e.actorBorder}; + fill: ${e.actorBkg}; + stroke-width: ${e.strokeWidth??1}; + } + + rect.actor.outer-path[data-look="neo"] { + filter: ${t}; + } + + rect.note[data-look="neo"] { + stroke:${e.noteBorderColor}; + fill:${e.noteBkgColor}; + filter: ${t}; + } + + text.actor > tspan { + fill: ${e.actorTextColor}; + stroke: none; + } + + .actor-line { + stroke: ${e.actorLineColor}; + } + + .innerArc { + stroke-width: 1.5; + stroke-dasharray: none; + } + + .messageLine0 { + stroke-width: 1.5; + stroke-dasharray: none; + stroke: ${e.signalColor}; + } + + .messageLine1 { + stroke-width: 1.5; + stroke-dasharray: 2, 2; + stroke: ${e.signalColor}; + } + + [id$="-arrowhead"] path { + fill: ${e.signalColor}; + stroke: ${e.signalColor}; + } + + .sequenceNumber { + fill: ${e.sequenceNumberColor}; + } + + [id$="-sequencenumber"] { + fill: ${e.signalColor}; + } + + [id$="-crosshead"] path { + fill: ${e.signalColor}; + stroke: ${e.signalColor}; + } + + .messageText { + fill: ${e.signalTextColor}; + stroke: none; + } + + .labelBox { + stroke: ${e.labelBoxBorderColor}; + fill: ${e.labelBoxBkgColor}; + filter: ${n==="neo"?t:"none"}; + } + + .labelText, .labelText > tspan { + fill: ${e.labelTextColor}; + stroke: none; + } + + .loopText, .loopText > tspan { + fill: ${e.loopTextColor}; + stroke: none; + } + + .sectionTitle, .sectionTitle > tspan { + fill: ${e.loopTextColor}; + stroke: none; + } + + .loopLine { + stroke-width: 2px; + stroke-dasharray: 2, 2; + stroke: ${e.labelBoxBorderColor}; + fill: ${e.labelBoxBorderColor}; + } + + .note { + //stroke: #decc93; + stroke: ${e.noteBorderColor}; + fill: ${e.noteBkgColor}; + } + + .noteText, .noteText > tspan { + fill: ${e.noteTextColor}; + stroke: none; + ${e.noteFontWeight?`font-weight: ${e.noteFontWeight};`:""} + } + + .activation0 { + fill: ${e.activationBkgColor}; + stroke: ${e.activationBorderColor}; + } + + .activation1 { + fill: ${e.activationBkgColor}; + stroke: ${e.activationBorderColor}; + } + + .activation2 { + fill: ${e.activationBkgColor}; + stroke: ${e.activationBorderColor}; + } + + .actorPopupMenu { + position: absolute; + } + + .actorPopupMenuPanel { + position: absolute; + fill: ${e.actorBkg}; + box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); + filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4)); +} + .actor-man circle, line { + fill: ${e.actorBkg}; + stroke-width: 2px; + } + + g rect.rect { + filter: ${t}; + stroke: ${e.nodeBorder}; + } +`},"getStyles");KUi=jUi;V6=18*2;TD="actor-top";wD="actor-bottom";LPe="actor-box";$6="actor-man";dP=new Set(["redux-color","redux-dark-color"]);xre=B(function(e,t){const n=SB(e,t);if(Ji().look==="neo"){n.attr("data-look","neo")}return n},"drawRect");ZUi=B(function(e,t,n,r,i){if(t.links===void 0||t.links===null||Object.keys(t.links).length===0){return{height:0,width:0}}const o=t.links;const a=t.actorCnt;const s=t.rectData;var l="none";if(i){l="block !important"}const u=e.append("g");u.attr("id","actor"+a+"_popup");u.attr("class","actorPopupMenu");u.attr("display",l);var d="";if(s.class!==void 0){d=" "+s.class}let f=s.width>n?s.width:n;const h=u.append("rect");h.attr("class","actorPopupMenuPanel"+d);h.attr("x",s.x);h.attr("y",s.height);h.attr("fill",s.fill);h.attr("stroke",s.stroke);h.attr("width",f);h.attr("height",s.height);h.attr("rx",s.rx);h.attr("ry",s.ry);if(o!=null){var m=20;for(let w in o){var g=u.append("a");var x=(0,glt.sanitizeUrl)(o[w]);g.attr("xlink:href",x);g.attr("target","_blank");vVi(r)(w,g,s.x+10,s.height+m,f,20,{class:"actor"},r);m+=30}}h.attr("height",m);return{height:s.height+m,width:f}},"drawPopup");DPe=B(function(e){return"var pu = document.getElementById('"+e+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle");MPe=B(async function(e,t,n=null){let r=e.append("foreignObject");const i=await s$(t.text,Ji());const o=r.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(i);const a=o.node().getBoundingClientRect();r.attr("height",Math.round(a.height)).attr("width",Math.round(a.width));if(t.class==="noteText"){const s=e.node().firstChild;s.setAttribute("height",a.height+2*t.textMargin);const l=s.getBBox();r.attr("x",Math.round(l.x+l.width/2-a.width/2)).attr("y",Math.round(l.y+l.height/2-a.height/2))}else if(n){let{startx:s,stopx:l,starty:u}=n;if(s>l){const d=s;s=l;l=d}r.attr("x",Math.round(s+Math.abs(s-l)/2-a.width/2));if(t.class==="loopText"){r.attr("y",Math.round(u))}else{r.attr("y",Math.round(u-a.height))}}return[r]},"drawKatex");TH=B(function(e,t){let n=0;let r=0;const i=t.text.split(Ti.lineBreakRegex);const[o,a]=mx(t.fontSize);let s=[];let l=0;let u=B(()=>t.y,"yfunc");if(t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0){switch(t.valign){case"top":case"start":u=B(()=>Math.round(t.y+t.textMargin),"yfunc");break;case"middle":case"center":u=B(()=>Math.round(t.y+(n+r+t.textMargin)/2),"yfunc");break;case"bottom":case"end":u=B(()=>Math.round(t.y+(n+r+2*t.textMargin)-t.textMargin),"yfunc");break}}if(t.anchor!==void 0&&t.textMargin!==void 0&&t.width!==void 0){switch(t.anchor){case"left":case"start":t.x=Math.round(t.x+t.textMargin);t.anchor="start";t.dominantBaseline="middle";t.alignmentBaseline="middle";break;case"middle":case"center":t.x=Math.round(t.x+t.width/2);t.anchor="middle";t.dominantBaseline="middle";t.alignmentBaseline="middle";break;case"right":case"end":t.x=Math.round(t.x+t.width-t.textMargin);t.anchor="end";t.dominantBaseline="middle";t.alignmentBaseline="middle";break}}for(let[d,f]of i.entries()){if(t.textMargin!==void 0&&t.textMargin===0&&o!==void 0){l=d*o}const h=e.append("text");h.attr("x",t.x);h.attr("y",u());if(t.anchor!==void 0){h.attr("text-anchor",t.anchor).attr("dominant-baseline",t.dominantBaseline).attr("alignment-baseline",t.alignmentBaseline)}if(t.fontFamily!==void 0){h.style("font-family",t.fontFamily)}if(a!==void 0){h.style("font-size",a)}if(t.fontWeight!==void 0){h.style("font-weight",t.fontWeight)}if(t.fill!==void 0){h.attr("fill",t.fill)}if(t.class!==void 0){h.attr("class",t.class)}if(t.dy!==void 0){h.attr("dy",t.dy)}else if(l!==0){h.attr("dy",l)}const m=f||Oje;if(t.tspan){const g=h.append("tspan");g.attr("x",t.x);if(t.fill!==void 0){g.attr("fill",t.fill)}g.text(m)}else{h.text(m)}if(t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0){r+=(h._groups||h)[0][0].getBBox().height;n=r}s.push(h)}return s},"drawText");AOn=B(function(e,t){function n(i,o,a,s,l){return i+","+o+" "+(i+a)+","+o+" "+(i+a)+","+(o+s-l)+" "+(i+a-l*1.2)+","+(o+s)+" "+i+","+(o+s)}B(n,"genPoints");const r=e.append("polygon");r.attr("points",n(t.x,t.y,t.width,t.height,7));r.attr("class","labelBox");t.y=t.y+t.height/2;TH(e,t);return r},"drawLabel");zl=-1;kOn=B((e,t,n,r)=>{if(!e.select){return}n.forEach(i=>{const o=t.get(i);const a=e.select("#actor"+o.actorCnt);if(!r.mirrorActors&&o.stopy){a.attr("y2",o.stopy+o.height/2)}else if(r.mirrorActors){a.attr("y2",o.stopy)}})},"fixLifeLineHeights");JUi=B(function(e,t,n,r,i){const o=r?t.stopy:t.starty;const a=t.x+t.width/2;const s=o+t.height;const{look:l,theme:u,themeVariables:d}=n;const{bkgColorArray:f,borderColorArray:h}=d;const m=e.append("g").lower();var g=m;if(!r){zl++;if(Object.keys(t.links||{}).length&&!n.forceMenus){g.attr("onclick",DPe(`actor${zl}_popup`)).attr("cursor","pointer")}g.append("line").attr("id","actor"+zl).attr("x1",a).attr("y1",s).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name);g=m.append("g");t.actorCnt=zl;if(t.links!=null){g.attr("id","root-"+zl)}if(l==="neo"){g.attr("data-look","neo")}}const x=Xy();var w="actor";if(t.properties?.class){w=t.properties.class}else{x.fill="#eaeaea"}if(r){w+=` ${wD}`}else{w+=` ${TD}`}x.x=t.x;x.y=o;x.width=t.width;x.height=t.height;x.class=w;x.rx=3;x.ry=3;x.name=t.name;if(l==="neo"){x.rx=6;x.ry=6}const _=xre(g,x);const C=i.get(t.name)??0;if(dP.has(u)){_.style("stroke",h[C%h.length]);_.style("fill",f[C%h.length])}if(l==="neo"){_.attr("filter","url(#drop-shadow)")}t.rectData=x;if(t.properties?.icon){const P=t.properties.icon.trim();if(P.charAt(0)==="@"){VSe(g,x.x+x.width-20,x.y+10,P.substr(1))}else{USe(g,x.x+x.width-20,x.y+10,P)}}if(!r){g.attr("data-et","participant");g.attr("data-type","participant");g.attr("data-id",t.name)}fP(n,of(t.description))(t.description,g,x.x,x.y,x.width,x.height,{class:`actor ${LPe}`},n);let A=t.height;if(_.node){const P=_.node().getBBox();t.height=P.height;A=P.height}return A},"drawActorTypeParticipant");QUi=B(function(e,t,n,r,i){const o=r?t.stopy:t.starty;const a=t.x+t.width/2;const s=o+t.height;const{look:l,theme:u,themeVariables:d}=n;const{bkgColorArray:f,borderColorArray:h}=d;const m=e.append("g").lower();var g=m;if(!r){zl++;if(Object.keys(t.links||{}).length&&!n.forceMenus){g.attr("onclick",DPe(`actor${zl}_popup`)).attr("cursor","pointer")}g.append("line").attr("id","actor"+zl).attr("x1",a).attr("y1",s).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name);g=m.append("g");t.actorCnt=zl;if(t.links!=null){g.attr("id","root-"+zl)}if(l==="neo"){g.attr("data-look","neo")}}const x=Xy();var w="actor";if(t.properties?.class){w=t.properties.class}else{x.fill="#eaeaea"}if(r){w+=` ${wD}`}else{w+=` ${TD}`}x.x=t.x;x.y=o;x.width=t.width;x.height=t.height;x.class=w;x.name=t.name;const _=6;const C={...x,x:x.x+(r?-_:-_),y:x.y+(r?+_:+_),class:"actor"};const A=xre(g,x);const P=xre(g,C);t.rectData=x;if(l==="neo"){g.attr("filter","url(#drop-shadow)")}const L=i.get(t.name)??0;if(dP.has(u)){A.style("stroke",h[L%h.length]);A.style("fill",f[L%h.length]);P.style("stroke",h[L%h.length]);P.style("fill",f[L%h.length])}if(t.properties?.icon){const N=t.properties.icon.trim();if(N.charAt(0)==="@"){VSe(g,x.x+x.width-20,x.y+10,N.substr(1))}else{USe(g,x.x+x.width-20,x.y+10,N)}}fP(n,of(t.description))(t.description,g,x.x-_,x.y+_,x.width,x.height,{class:`actor ${LPe}`},n);let I=t.height;if(A.node){const N=A.node().getBBox();t.height=N.height;I=N.height}if(!r){g.attr("data-et","participant");g.attr("data-type","collections");g.attr("data-id",t.name)}return I},"drawActorTypeCollections");eVi=B(function(e,t,n,r,i){const o=r?t.stopy:t.starty;const a=t.x+t.width/2;const s=o+t.height;const{look:l,theme:u,themeVariables:d}=n;const{bkgColorArray:f,borderColorArray:h}=d;const m=e.append("g").lower();let g=m;if(!r){zl++;if(Object.keys(t.links||{}).length&&!n.forceMenus){g.attr("onclick",DPe(`actor${zl}_popup`)).attr("cursor","pointer")}g.append("line").attr("id","actor"+zl).attr("x1",a).attr("y1",s).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name);g=m.append("g");t.actorCnt=zl;if(t.links!=null){g.attr("id","root-"+zl)}if(l==="neo"){g.attr("data-look","neo")}}const x=Xy();let w="actor";if(t.properties?.class){w=t.properties.class}else{x.fill="#eaeaea"}if(r){w+=` ${wD}`}else{w+=` ${TD}`}g.attr("class",w);x.x=t.x;x.y=o;x.width=t.width;x.height=t.height;x.name=t.name;const _=x.height/2;const C=_/(2.5+x.height/50);const A=g.append("g");const P=g.append("g");const L=`M ${x.x},${x.y+_} + a ${C},${_} 0 0 0 0,${x.height} + h ${x.width-2*C} + a ${C},${_} 0 0 0 0,-${x.height} + Z + `;A.append("path").attr("d",L);P.append("path").attr("d",`M ${x.x},${x.y+_} + a ${C},${_} 0 0 0 0,${x.height}`);A.attr("transform",`translate(${C}, ${-(x.height/2)})`);P.attr("transform",`translate(${x.width-C}, ${-x.height/2})`);t.rectData=x;if(l==="neo"){A.attr("filter","url(#drop-shadow)")}const I=i.get(t.name)??0;if(dP.has(u)){A.style("stroke",h[I%h.length]);A.style("fill",f[I%h.length]);P.style("stroke",h[I%h.length]);P.style("fill",f[I%h.length])}if(t.properties?.icon){const z=t.properties.icon.trim();const U=x.x+x.width-20;const W=x.y+10;if(z.charAt(0)==="@"){VSe(g,U,W,z.substr(1))}else{USe(g,U,W,z)}}fP(n,of(t.description))(t.description,g,x.x,x.y,x.width,x.height,{class:`actor ${LPe}`},n);let N=t.height;const O=A.select("path:last-child");if(O.node()){const z=O.node().getBBox();t.height=z.height;N=z.height}if(!r){g.attr("data-et","participant");g.attr("data-type","queue");g.attr("data-id",t.name)}return N},"drawActorTypeQueue");tVi=B(function(e,t,n,r,i,o){const a=r?t.stopy:t.starty;const s=t.x+t.width/2;const l=a+75;const{look:u,theme:d,themeVariables:f}=n;const{bkgColorArray:h,borderColorArray:m,actorBorder:g,actorBkg:x}=f;const w=e.append("g").lower();if(!r){zl++;w.append("line").attr("id","actor"+zl).attr("x1",s).attr("y1",l).attr("x2",s).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name);t.actorCnt=zl}const _=e.append("g");let C=$6;if(r){C+=` ${wD}`}else{C+=` ${TD}`}_.attr("class",C);_.attr("name",t.name);const A=Xy();A.x=t.x;A.y=a;A.fill="#eaeaea";A.width=t.width;A.height=t.height;A.class="actor";const P=t.x+t.width/2;const L=a+32;const I=22;_.append("defs").append("marker").attr("id",i+"-filled-head-control").attr("refX",11).attr("refY",5.8).attr("markerWidth",20).attr("markerHeight",28).attr("orient","172.5").attr("stroke-width",1.2).append("path").attr("d","M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z");_.append("circle").attr("cx",P).attr("cy",L).attr("r",I).attr("filter",`${u==="neo"?"url(#drop-shadow)":""}`);_.append("line").attr("marker-end","url(#"+i+"-filled-head-control)").attr("transform",`translate(${P}, ${L-I})`);const N=o.get(t.name)??0;if(dP.has(d)){_.style("stroke",m[N%m.length]);_.style("fill",h[N%m.length])}else{_.style("stroke",g);_.style("fill",x)}const O=_.node().getBBox();t.height=O.height+2*(n?.sequence?.labelBoxHeight??0);fP(n,of(t.description))(t.description,_,A.x,A.y+I+(!r?12:5),A.width,A.height,{class:`actor ${$6}`},n);if(!r){_.attr("data-et","participant");_.attr("data-type","control");_.attr("data-id",t.name)}return t.height},"drawActorTypeControl");nVi=B(function(e,t,n,r,i){const o=r?t.stopy:t.starty;const a=t.x+t.width/2;const s=o+75;const{look:l,theme:u,themeVariables:d}=n;const{bkgColorArray:f,borderColorArray:h}=d;const m=e.append("g").lower();const g=e.append("g");let x="actor";if(r){x+=` ${wD}`}else{x+=` ${TD}`}g.attr("class",x);g.attr("name",t.name);const w=Xy();w.x=t.x;w.y=o;w.fill="#eaeaea";w.width=t.width;w.height=t.height;w.class="actor";const _=t.x+t.width/2;const C=o+(!r?25:10);const A=22;g.append("circle").attr("cx",_).attr("cy",C).attr("r",A).attr("width",t.width).attr("height",t.height);g.append("line").attr("x1",_-A).attr("x2",_+A).attr("y1",C+A).attr("y2",C+A).attr("stroke-width",2);if(l==="neo"){g.attr("filter","url(#drop-shadow)")}const P=i.get(t.name)??0;if(dP.has(u)){g.style("stroke",h[P%h.length]);g.style("fill",f[P%h.length])}const L=g.node().getBBox();t.height=L.height+(n?.sequence?.labelBoxHeight??0);if(!r){zl++;m.append("line").attr("id","actor"+zl).attr("x1",a).attr("y1",s).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name);t.actorCnt=zl}fP(n,of(t.description))(t.description,g,w.x,w.y+(!r?30:15),w.width,w.height,{class:`actor ${$6}`},n);if(!r){g.attr("transform",`translate(${0}, ${A/2-5})`);g.attr("data-et","participant");g.attr("data-type","entity");g.attr("data-id",t.name)}else{g.attr("transform",`translate(${0}, ${A})`)}return t.height},"drawActorTypeEntity");rVi=B(function(e,t,n,r,i){const o=r?t.stopy:t.starty;const a=t.x+t.width/2;const s=o+t.height+2*n.boxTextMargin;const{theme:l,themeVariables:u,look:d}=n;const{bkgColorArray:f,borderColorArray:h,actorBorder:m}=u;const g=e.append("g").lower();let x=g;if(!r){zl++;if(Object.keys(t.links||{}).length&&!n.forceMenus){x.attr("onclick",DPe(`actor${zl}_popup`)).attr("cursor","pointer")}x.append("line").attr("id","actor"+zl).attr("x1",a).attr("y1",s).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name);x=g.append("g");t.actorCnt=zl;if(t.links!=null){x.attr("id","root-"+zl)}if(d==="neo"){x.attr("data-look","neo")}}const w=Xy();let _="actor";if(t.properties?.class){_=t.properties.class}else{w.fill="#eaeaea"}if(r){_+=` ${wD}`}else{_+=` ${TD}`}w.x=t.x;w.y=o;w.width=t.width;w.height=t.height;w.class=_;w.name=t.name;w.x=t.x;w.y=o;const C=w.width/3;const A=w.width/3;const P=C/2;const L=P/(2.5+C/50);const I=x.append("g");I.attr("class",_);const N=` + M ${w.x},${w.y+L} + a ${P},${L} 0 0 0 ${C},0 + a ${P},${L} 0 0 0 -${C},0 + l 0,${A-2*L} + a ${P},${L} 0 0 0 ${C},0 + l 0,-${A-2*L} +`;I.append("path").attr("d",N);if(d==="neo"){I.attr("filter","url(#drop-shadow)")}const O=i.get(t.name)??0;if(dP.has(l)){I.style("stroke",h[O%h.length]);I.style("fill",f[O%h.length])}else{I.style("stroke",m)}I.attr("transform",`translate(${C}, ${L})`);t.rectData=w;fP(n,of(t.description))(t.description,x,w.x,w.y+35,w.width,w.height,{class:`actor ${LPe}`},n);const z=I.select("path:last-child");if(z.node()){const U=z.node().getBBox();t.height=U.height+(n.sequence.labelBoxHeight??0)}if(!r){x.attr("data-et","participant");x.attr("data-type","database");x.attr("data-id",t.name)}return t.height},"drawActorTypeDatabase");iVi=B(function(e,t,n,r,i){const o=r?t.stopy:t.starty;const a=t.x+t.width/2;const s=o+80;const l=22;const u=e.append("g").lower();const{look:d,theme:f,themeVariables:h}=n;const{bkgColorArray:m,borderColorArray:g,actorBorder:x}=h;if(!r){zl++;u.append("line").attr("id","actor"+zl).attr("x1",a).attr("y1",s).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name);t.actorCnt=zl}const w=e.append("g");let _=$6;if(r){_+=` ${wD}`}else{_+=` ${TD}`}w.attr("class",_);w.attr("name",t.name);const C=Xy();C.x=t.x;C.y=o;C.fill="#eaeaea";C.width=t.width;C.height=t.height;C.class="actor";w.append("line").attr("id","actor-man-torso"+zl).attr("x1",t.x+t.width/2-l*2.5).attr("y1",o+12).attr("x2",t.x+t.width/2-15).attr("y2",o+12);w.append("line").attr("id","actor-man-arms"+zl).attr("x1",t.x+t.width/2-l*2.5).attr("y1",o+2).attr("x2",t.x+t.width/2-l*2.5).attr("y2",o+22);w.append("circle").attr("cx",t.x+t.width/2).attr("cy",o+12).attr("r",l);if(d==="neo"){w.attr("filter","url(#drop-shadow)")}const A=i.get(t.name)??0;if(dP.has(f)){w.style("stroke",g[A%g.length]);w.style("fill",m[A%g.length])}else{w.style("stroke",x)}const P=w.node().getBBox();t.height=P.height+(n.sequence.labelBoxHeight??0);fP(n,of(t.description))(t.description,w,C.x,C.y+15,C.width,C.height,{class:`actor ${$6}`},n);w.attr("transform",`translate(0,${l/2+10})`);if(!r){w.attr("data-et","participant");w.attr("data-type","boundary");w.attr("data-id",t.name)}return t.height},"drawActorTypeBoundary");oVi=B(function(e,t,n,r,i){const o=r?t.stopy:t.starty;const a=t.x+t.width/2;const s=o+80;const{look:l,theme:u,themeVariables:d}=n;const{bkgColorArray:f,borderColorArray:h,actorBorder:m}=d;const g=e.append("g").lower();if(!r){zl++;g.append("line").attr("id","actor"+zl).attr("x1",a).attr("y1",s).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name);t.actorCnt=zl}const x=e.append("g");let w=$6;if(r){w+=` ${wD}`}else{w+=` ${TD}`}x.attr("class",w);x.attr("name",t.name);if(!r){x.attr("data-et","participant").attr("data-type","actor").attr("data-id",t.name)}const _=l==="neo"?.5:1;const C=l==="neo"?o+(1-_)*30:o;x.append("line").attr("id","actor-man-torso"+zl).attr("x1",a).attr("y1",C+25*_).attr("x2",a).attr("y2",C+45*_);x.append("line").attr("id","actor-man-arms"+zl).attr("x1",a-V6/2*_).attr("y1",C+33*_).attr("x2",a+V6/2*_).attr("y2",C+33*_);x.append("line").attr("x1",a-V6/2*_).attr("y1",C+60*_).attr("x2",a).attr("y2",C+45*_);x.append("line").attr("x1",a).attr("y1",C+45*_).attr("x2",a+(V6/2-2)*_).attr("y2",C+60*_);const A=x.append("circle");A.attr("cx",t.x+t.width/2);A.attr("cy",C+10*_);A.attr("r",15*_);A.attr("width",t.width*_);A.attr("height",t.height*_);const P=x.node().getBBox();t.height=P.height;const L=Xy();L.x=t.x;L.y=C;L.fill="#eaeaea";L.width=t.width;L.height=t.height/_;L.class="actor";L.rx=3;L.ry=3;const I=i.get(t.name)??0;if(dP.has(u)){x.style("stroke",h[I%h.length]);x.style("fill",f[I%h.length])}else{x.style("stroke",m)}fP(n,of(t.description))(t.description,x,L.x,C+35*_-(l==="neo"?10:0),L.width,L.height,{class:`actor ${$6}`},n);return t.height},"drawActorTypeActor");aVi=B(async function(e,t,n,r,i,o,a){const s=a??new Map([...o.db.getActors().values()].map((l,u)=>[l.name,u]));switch(t.type){case"actor":return await oVi(e,t,n,r,s);case"participant":return await JUi(e,t,n,r,s);case"boundary":return await iVi(e,t,n,r,s);case"control":return await tVi(e,t,n,r,i,s);case"entity":return await nVi(e,t,n,r,s);case"database":return await rVi(e,t,n,r,s);case"collections":return await QUi(e,t,n,r,s);case"queue":return await eVi(e,t,n,r,s)}},"drawActor");sVi=B(function(e,t,n){const r=e.append("g");const i=r;ROn(i,t);if(t.name){fP(n)(t.name,i,t.x,t.y+n.boxTextMargin+(t.textMaxHeight||0)/2,t.width,0,{class:"text"},n)}i.lower()},"drawBox");lVi=B(function(e){return e.append("g")},"anchorElement");cVi=B(function(e,t,n,r,i,o,a){const{theme:s,themeVariables:l}=r;const{bkgColorArray:u,borderColorArray:d,mainBkg:f}=l;const h=Xy();const m=t.anchored;const g=t.actor;h.x=t.startx;h.y=t.starty;h.class="activation"+i%3;h.width=t.stopx-t.startx;h.height=n-t.starty;const x=xre(m,h);const w=a??new Map([...o.db.getActors().values()].map((C,A)=>[C.name,A]));const _=w.get(g)??0;if(dP.has(s)){x.style("stroke",d[_%d.length]);x.style("fill",u[_%d.length]??f)}},"drawActivation");uVi=B(async function(e,t,n,r,i){const{boxMargin:o,boxTextMargin:a,labelBoxHeight:s,labelBoxWidth:l,messageFontFamily:u,messageFontSize:d,messageFontWeight:f}=r;const h=e.append("g").attr("data-et","control-structure").attr("data-id","i"+i.id);const m=B(function(w,_,C,A){return h.append("line").attr("x1",w).attr("y1",_).attr("x2",C).attr("y2",A).attr("class","loopLine")},"drawLoopLine");m(t.startx,t.starty,t.stopx,t.starty);m(t.stopx,t.starty,t.stopx,t.stopy);m(t.startx,t.stopy,t.stopx,t.stopy);m(t.startx,t.starty,t.startx,t.stopy);if(t.sections!==void 0){t.sections.forEach(function(w){m(t.startx,w.y,t.stopx,w.y).style("stroke-dasharray","3, 3")})}let g=$Se();g.text=n;g.x=t.startx;g.y=t.starty;g.fontFamily=u;g.fontSize=d;g.fontWeight=f;g.anchor="middle";g.valign="middle";g.tspan=false;g.width=Math.max(l??0,50);g.height=s+(r.look==="neo"?15:0)||20;g.textMargin=a;g.class="labelText";AOn(h,g);g=POn();g.text=t.title;g.x=t.startx+l/2+(t.stopx-t.startx)/2;g.y=t.starty+o+a;g.anchor="middle";g.valign="middle";g.textMargin=a;g.class="loopText";g.fontFamily=u;g.fontSize=d;g.fontWeight=f;g.wrap=true;let x=of(g.text)?await MPe(h,g,t):TH(h,g);if(t.sectionTitles!==void 0){for(const[w,_]of Object.entries(t.sectionTitles)){if(_.message){g.text=_.message;g.x=t.startx+(t.stopx-t.startx)/2;g.y=t.sections[w].y+o+a;g.class="sectionTitle";g.anchor="middle";g.valign="middle";g.tspan=false;g.fontFamily=u;g.fontSize=d;g.fontWeight=f;g.wrap=t.wrap;if(of(g.text)){t.starty=t.sections[w].y;await MPe(h,g,t)}else{TH(h,g)}let C=Math.round(x.map(A=>(A._groups||A)[0][0].getBBox().height).reduce((A,P)=>A+P));t.sections[w].height+=C-(o+a)}}}t.height=Math.round(t.stopy-t.starty);return h},"drawLoop");ROn=B(function(e,t){zSe(e,t)},"drawBackgroundRect");dVi=B(function(e,t){e.append("defs").append("symbol").attr("id",t+"-database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon");fVi=B(function(e,t){e.append("defs").append("symbol").attr("id",t+"-computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon");hVi=B(function(e,t){e.append("defs").append("symbol").attr("id",t+"-clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon");pVi=B(function(e,t){e.append("defs").append("marker").attr("id",t+"-arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")},"insertArrowHead");mVi=B(function(e,t){e.append("defs").append("marker").attr("id",t+"-filled-head").attr("refX",15.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead");gVi=B(function(e,t){e.append("defs").append("marker").attr("id",t+"-sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertSequenceNumber");yVi=B(function(e,t){const n=e.append("defs");const r=n.append("marker").attr("id",t+"-crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5);r.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},"insertArrowCrossHead");bVi=B(function(e,t){const{theme:n}=t;e.append("defs").append("filter").attr("id","drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${n==="redux"||n==="redux-color"?"#000000":"#FFFFFF"}`)},"insertDropShadow");POn=B(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:true,valign:void 0}},"getTextObj");xVi=B(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect");fP=function(){function e(o,a,s,l,u,d,f){const h=a.append("text").attr("x",s+u/2).attr("y",l+d/2+5).style("text-anchor","middle").text(o);i(h,f)}B(e,"byText");function t(o,a,s,l,u,d,f,h){const{actorFontSize:m,actorFontFamily:g,actorFontWeight:x}=h;const[w,_]=mx(m);const C=o.split(Ti.lineBreakRegex);for(let A=0;Ae.height||0))+(this.loops.length===0?0:this.loops.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.messages.length===0?0:this.messages.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.notes.length===0?0:this.notes.map(e=>e.height||0).reduce((e,t)=>e+t))},"getHeight"),clear:B(function(){this.actors=[];this.boxes=[];this.loops=[];this.messages=[];this.notes=[]},"clear"),addBox:B(function(e){this.boxes.push(e)},"addBox"),addActor:B(function(e){this.actors.push(e)},"addActor"),addLoop:B(function(e){this.loops.push(e)},"addLoop"),addMessage:B(function(e){this.messages.push(e)},"addMessage"),addNote:B(function(e){this.notes.push(e)},"addNote"),lastActor:B(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:B(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:B(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:B(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:B(function(){this.sequenceItems=[];this.activations=[];this.models.clear();this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0};this.verticalPos=0;LOn(Mn())},"init"),updateVal:B(function(e,t,n,r){if(e[t]===void 0){e[t]=n}else{e[t]=r(n,e[t])}},"updateVal"),updateBounds:B(function(e,t,n,r){const i=this;let o=0;function a(s){return B(function l(u){o++;const d=i.sequenceItems.length-o+1;i.updateVal(u,"starty",t-d*yr.boxMargin,Math.min);i.updateVal(u,"stopy",r+d*yr.boxMargin,Math.max);i.updateVal(Ai.data,"startx",e-d*yr.boxMargin,Math.min);i.updateVal(Ai.data,"stopx",n+d*yr.boxMargin,Math.max);if(!(s==="activation")){i.updateVal(u,"startx",e-d*yr.boxMargin,Math.min);i.updateVal(u,"stopx",n+d*yr.boxMargin,Math.max);i.updateVal(Ai.data,"starty",t-d*yr.boxMargin,Math.min);i.updateVal(Ai.data,"stopy",r+d*yr.boxMargin,Math.max)}},"updateItemBounds")}B(a,"updateFn");this.sequenceItems.forEach(a());this.activations.forEach(a("activation"))},"updateBounds"),insert:B(function(e,t,n,r){const i=Ti.getMin(e,n);const o=Ti.getMax(e,n);const a=Ti.getMin(t,r);const s=Ti.getMax(t,r);this.updateVal(Ai.data,"startx",i,Math.min);this.updateVal(Ai.data,"starty",a,Math.min);this.updateVal(Ai.data,"stopx",o,Math.max);this.updateVal(Ai.data,"stopy",s,Math.max);this.updateBounds(i,a,o,s)},"insert"),newActivation:B(function(e,t,n){const r=n.get(e.from);const i=FPe(e.from).length||0;const o=r.x+r.width/2+(i-1)*yr.activationWidth/2;this.activations.push({startx:o,starty:this.verticalPos+2,stopx:o+yr.activationWidth,stopy:void 0,actor:e.from,anchored:dd.anchorElement(t)})},"newActivation"),endActivation:B(function(e){const t=this.activations.map(function(n){return n.actor}).lastIndexOf(e.from);return this.activations.splice(t,1)[0]},"endActivation"),createLoop:B(function(e={message:void 0,wrap:false,width:void 0},t){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:e.message,wrap:e.wrap,width:e.width,height:0,fill:t}},"createLoop"),newLoop:B(function(e={message:void 0,wrap:false,width:void 0},t){this.sequenceItems.push(this.createLoop(e,t))},"newLoop"),endLoop:B(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:B(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:false},"isLoopOverlap"),addSectionToLoop:B(function(e){const t=this.sequenceItems.pop();t.sections=t.sections||[];t.sectionTitles=t.sectionTitles||[];t.sections.push({y:Ai.getVerticalPos(),height:0});t.sectionTitles.push(e);this.sequenceItems.push(t)},"addSectionToLoop"),saveVerticalPos:B(function(){if(this.isLoopOverlap()){this.savedVerticalPos=this.verticalPos}},"saveVerticalPos"),resetVerticalPos:B(function(){if(this.isLoopOverlap()){this.verticalPos=this.savedVerticalPos}},"resetVerticalPos"),bumpVerticalPos:B(function(e){this.verticalPos=this.verticalPos+e;this.data.stopy=Ti.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:B(function(){return this.verticalPos},"getVerticalPos"),getBounds:B(function(){return{bounds:this.data,models:this.models}},"getBounds")};CVi=B(async function(e,t,n){Ai.bumpVerticalPos(yr.boxMargin);t.height=yr.boxMargin;t.starty=Ai.getVerticalPos();const r=Xy();r.x=t.startx;r.y=t.starty;r.width=t.width||yr.width;r.class="note";const i=e.append("g");i.attr("data-et","note");i.attr("data-id","i"+n);const o=dd.drawRect(i,r);const a=$Se();a.x=t.startx;a.y=t.starty;a.width=r.width;a.dy="1em";a.text=t.message;a.class="noteText";a.fontFamily=yr.noteFontFamily;a.fontSize=yr.noteFontSize;a.fontWeight=yr.noteFontWeight;a.anchor=yr.noteAlign;a.textMargin=yr.noteMargin;a.valign="center";const s=of(a.text)?await MPe(i,a):TH(i,a);const l=Math.round(s.map(u=>(u._groups||u)[0][0].getBBox().height).reduce((u,d)=>u+d));o.attr("height",l+2*yr.noteMargin);t.height+=l+2*yr.noteMargin;Ai.bumpVerticalPos(l+2*yr.noteMargin);t.stopy=t.starty+l+2*yr.noteMargin;t.stopx=t.startx+r.width;Ai.insert(t.startx,t.starty,t.stopx,t.stopy);Ai.models.addNote(t)},"drawNote");COn=B(function(e,t,n,r,i,o,a){const s=r.db.getActors();const l=s.get(t.from);const u=s.get(t.to);const d=n.sequenceVisible;let f=l.x+l.width/2;let h=u.x+u.width/2;const m=f<=h;const g=OOn(t,r);const x=e.append("g");const w=16.5;const _=B((I,N)=>{const O=I?w:-w;return N?-O:O},"getCircleOffset");const C=B(I=>{x.append("circle").attr("cx",I).attr("cy",a).attr("r",5).attr("width",10).attr("height",10)},"drawCircle");const{CENTRAL_CONNECTION:A,CENTRAL_CONNECTION_REVERSE:P,CENTRAL_CONNECTION_DUAL:L}=r.db.LINETYPE;if(d){switch(t.centralConnection){case A:if(g){h+=_(m,true)}break;case P:if(!g){f+=_(m,false)}break;case L:if(g){h+=_(m,true)}else{f+=_(m,false)}break}}switch(t.centralConnection){case A:C(h);break;case P:C(f);break;case L:C(f);C(h);break}},"drawCentralConnection");G6=B(e=>{return{fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}},"messageFont");_H=B(e=>{return{fontFamily:e.noteFontFamily,fontSize:e.noteFontSize,fontWeight:e.noteFontWeight}},"noteFont");plt=B(e=>{return{fontFamily:e.actorFontFamily,fontSize:e.actorFontSize,fontWeight:e.actorFontWeight}},"actorFont");B(IOn,"boundMessage");SVi=B(async function(e,t,n,r,i,o){const{startx:a,stopx:s,starty:l,message:u,type:d,sequenceIndex:f,sequenceVisible:h}=t;const m=Ko.calculateTextDimensions(u,G6(yr));const g=$Se();g.x=Math.min(a,s);g.y=l+10;g.width=Math.abs(s-a);g.class="messageText";g.dy="1em";g.text=u;g.fontFamily=yr.messageFontFamily;g.fontSize=yr.messageFontSize;g.fontWeight=yr.messageFontWeight;g.anchor=yr.messageAlign;g.valign="center";g.textMargin=yr.wrapPadding;g.tspan=false;if(of(g.text)){await MPe(e,g,{startx:a,stopx:s,starty:n})}else{TH(e,g)}const x=m.width;let w;if(a===s){const C=h||yr.showSequenceNumbers;const A=OOn(i,r);const P=DVi(i,r);const L=a+(C&&(A||P)?10:0);if(yr.rightAngles){w=e.append("path").attr("d",`M ${L},${n} H ${a+Ti.getMax(yr.width/2,x/2)} V ${n+25} H ${a}`)}else{w=e.append("path").attr("d","M "+L+","+n+" C "+(L+60)+","+(n-10)+" "+(a+60)+","+(n+30)+" "+a+","+(n+20))}if(flt(i,r)){COn(e,i,t,r,a,s,n)}}else{w=e.append("line");w.attr("x1",a);w.attr("y1",n);w.attr("x2",s);w.attr("y2",n);if(flt(i,r)){COn(e,i,t,r,a,s,n)}}if(d===r.db.LINETYPE.DOTTED||d===r.db.LINETYPE.DOTTED_CROSS||d===r.db.LINETYPE.DOTTED_POINT||d===r.db.LINETYPE.DOTTED_OPEN||d===r.db.LINETYPE.BIDIRECTIONAL_DOTTED||d===r.db.LINETYPE.SOLID_TOP_DOTTED||d===r.db.LINETYPE.SOLID_BOTTOM_DOTTED||d===r.db.LINETYPE.STICK_TOP_DOTTED||d===r.db.LINETYPE.STICK_BOTTOM_DOTTED||d===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||d===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||d===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||d===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED){w.style("stroke-dasharray","3, 3");w.attr("class","messageLine1")}else{w.attr("class","messageLine0")}w.attr("data-et","message");w.attr("data-id","i"+t.id);w.attr("data-from",t.from);w.attr("data-to",t.to);let _="";if(yr.arrowMarkerAbsolute){_=B5(true)}w.attr("stroke-width",2);w.attr("stroke","none");w.style("fill","none");if(d===r.db.LINETYPE.SOLID_TOP||d===r.db.LINETYPE.SOLID_TOP_DOTTED){w.attr("marker-end","url("+_+"#"+o+"-solidTopArrowHead)")}if(d===r.db.LINETYPE.SOLID_BOTTOM||d===r.db.LINETYPE.SOLID_BOTTOM_DOTTED){w.attr("marker-end","url("+_+"#"+o+"-solidBottomArrowHead)")}if(d===r.db.LINETYPE.STICK_TOP||d===r.db.LINETYPE.STICK_TOP_DOTTED){w.attr("marker-end","url("+_+"#"+o+"-stickTopArrowHead)")}if(d===r.db.LINETYPE.STICK_BOTTOM||d===r.db.LINETYPE.STICK_BOTTOM_DOTTED){w.attr("marker-end","url("+_+"#"+o+"-stickBottomArrowHead)")}if(d===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||d===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED){w.attr("marker-start","url("+_+"#"+o+"-solidBottomArrowHead)")}if(d===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||d===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED){w.attr("marker-start","url("+_+"#"+o+"-solidTopArrowHead)")}if(d===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE||d===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED){w.attr("marker-start","url("+_+"#"+o+"-stickBottomArrowHead)")}if(d===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||d===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED){w.attr("marker-start","url("+_+"#"+o+"-stickTopArrowHead)")}if(d===r.db.LINETYPE.SOLID||d===r.db.LINETYPE.DOTTED){w.attr("marker-end","url("+_+"#"+o+"-arrowhead)")}if(d===r.db.LINETYPE.BIDIRECTIONAL_SOLID||d===r.db.LINETYPE.BIDIRECTIONAL_DOTTED){w.attr("marker-start","url("+_+"#"+o+"-arrowhead)");w.attr("marker-end","url("+_+"#"+o+"-arrowhead)")}if(d===r.db.LINETYPE.SOLID_POINT||d===r.db.LINETYPE.DOTTED_POINT){w.attr("marker-end","url("+_+"#"+o+"-filled-head)")}if(d===r.db.LINETYPE.SOLID_CROSS||d===r.db.LINETYPE.DOTTED_CROSS){w.attr("marker-end","url("+_+"#"+o+"-crosshead)")}if(h||yr.showSequenceNumbers){const C=d===r.db.LINETYPE.BIDIRECTIONAL_SOLID||d===r.db.LINETYPE.BIDIRECTIONAL_DOTTED;const A=d===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||d===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||d===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||d===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||d===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE||d===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||d===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||d===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;const P=6;const L=flt(i,r);let I=a;let N=s;if(C){if(aa){N=s-2*P}else{N=s-P;I+=i?.centralConnection===r.db.LINETYPE.CENTRAL_CONNECTION_DUAL||i?.centralConnection===r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0}N+=L?15:0;w.attr("x2",N);w.attr("x1",I)}else{w.attr("x1",a+P)}let O=0;const z=a===s;const U=a<=s;if(z){O=t.fromBounds+1}else if(A){O=U?t.toBounds-1:t.fromBounds+1}else{O=U?t.fromBounds+1:t.toBounds-1}let W="12px";const H=f.toString().length;if(H>5){W="7px"}else if(H>3){W="9px"}e.append("line").attr("x1",O).attr("y1",n).attr("x2",O).attr("y2",n).attr("stroke-width",0).attr("marker-start","url("+_+"#"+o+"-sequencenumber)");e.append("text").attr("x",O).attr("y",n+4).attr("font-family","sans-serif").attr("font-size",W).attr("text-anchor","middle").attr("class","sequenceNumber").text(f)}},"drawMessage");AVi=B(function(e,t,n,r,i,o,a){let s=0;let l=0;let u=void 0;let d=0;for(const f of r){const h=t.get(f);const m=h.box;if(u&&u!=m){if(!a){Ai.models.addBox(u)}l+=yr.boxMargin+u.margin}if(m&&m!=u){if(!a){m.x=s+l;m.y=i}l+=m.margin}h.width=Ti.getMax(h.width||yr.width,yr.width);h.height=Ti.getMax(h.height||yr.height,yr.height);h.margin=h.margin||yr.actorMargin;d=Ti.getMax(d,h.height);if(n.get(h.name)){l+=h.width/2}h.x=s+l;h.starty=Ai.getVerticalPos();Ai.insert(h.x,i,h.x+h.width,h.height);s+=h.width+l;if(h.box){h.box.width=s+m.margin-h.box.x}l=h.margin;u=h.box;Ai.models.addActor(h)}if(u&&!a){Ai.models.addBox(u)}Ai.bumpVerticalPos(d)},"addActorRenderingData");mlt=B(async function(e,t,n,r,i,o,a){if(!r){for(const s of n){const l=t.get(s);await dd.drawActor(e,l,yr,false,i,o,a)}}else{let s=0;Ai.bumpVerticalPos(yr.boxMargin*2);for(const l of n){const u=t.get(l);if(!u.stopy){u.stopy=Ai.getVerticalPos()}const d=await dd.drawActor(e,u,yr,true,i,o,a);s=Ti.getMax(s,d)}Ai.bumpVerticalPos(s+yr.boxMargin)}},"drawActors");MOn=B(function(e,t,n,r){let i=0;let o=0;for(const a of n){const s=t.get(a);const l=RVi(s);const u=dd.drawPopup(e,s,l,yr,yr.forceMenus,r);if(u.height>i){i=u.height}if(u.width+s.x>o){o=u.width+s.x}}return{maxHeight:i,maxWidth:o}},"drawActorsPopup");LOn=B(function(e){rf(yr,e);if(e.fontFamily){yr.actorFontFamily=yr.noteFontFamily=yr.messageFontFamily=e.fontFamily}if(e.fontSize){yr.actorFontSize=yr.noteFontSize=yr.messageFontSize=e.fontSize}if(e.fontWeight){yr.actorFontWeight=yr.noteFontWeight=yr.messageFontWeight=e.fontWeight}},"setConf");FPe=B(function(e){return Ai.activations.filter(function(t){return t.actor===e})},"actorActivations");SOn=B(function(e,t){const n=t.get(e);const r=FPe(e);const i=r.reduce(function(a,s){return Ti.getMin(a,s.startx)},n.x+n.width/2-1);const o=r.reduce(function(a,s){return Ti.getMax(a,s.stopx)},n.x+n.width/2+1);return[i,o]},"activationBounds");B(Xw,"adjustLoopHeightForWrap");B(DOn,"adjustCreatedDestroyedData");kVi=B(async function(e,t,n,r){const{securityLevel:i,sequence:o,look:a,themeVariables:s}=Mn();yr=o;let l;if(i==="sandbox"){l=zr("#i"+t)}const u=i==="sandbox"?zr(l.nodes()[0].contentDocument.body):zr("body");const d=i==="sandbox"?l.nodes()[0].contentDocument:document;Ai.init();wt.debug(r.db);const f=i==="sandbox"?u.select(`[id="${t}"]`):zr(`[id="${t}"]`);const h=r.db.getActors();const m=r.db.getCreatedActors();const g=r.db.getDestroyedActors();const x=r.db.getBoxes();let w=r.db.getActorKeys();const _=r.db.getMessages();const C=r.db.getDiagramTitle();const A=r.db.hasAtLeastOneBox();const P=r.db.hasAtLeastOneBoxWithTitle();const L=await FOn(h,_,r);yr.height=await NOn(h,L,x);dd.insertComputerIcon(f,t);dd.insertDatabaseIcon(f,t);dd.insertClockIcon(f,t);if(A){Ai.bumpVerticalPos(yr.boxMargin);if(P){Ai.bumpVerticalPos(x[0].textMaxHeight)}}if(yr.hideUnusedParticipants===true){const ce=new Set;_.forEach(ue=>{ce.add(ue.from);ce.add(ue.to)});w=w.filter(ue=>ce.has(ue))}const I=new Map(w.map((ce,ue)=>[h.get(ce)?.name??ce,ue]));AVi(f,h,m,w,0,_,false);const N=await NVi(_,h,L,r);dd.insertArrowHead(f,t);dd.insertArrowCrossHead(f,t);dd.insertArrowFilledHead(f,t);dd.insertSequenceNumber(f,t);dd.insertSolidTopArrowHead(f,t);dd.insertSolidBottomArrowHead(f,t);dd.insertStickTopArrowHead(f,t);dd.insertStickBottomArrowHead(f,t);if(a==="neo"){dd.insertDropShadow(f,yr)}function O(ce,ue){const xe=Ai.endActivation(ce);if(xe.starty+18>ue){xe.starty=ue-6;ue+=12}dd.drawActivation(f,xe,ue,yr,FPe(ce.from).length,r,I);Ai.insert(xe.startx,ue-10,xe.stopx,ue)}B(O,"activeEnd");let z=1;let U=1;const W=[];const H=[];let $=0;for(const ce of _){let ue,xe,be;switch(ce.type){case r.db.LINETYPE.NOTE:Ai.resetVerticalPos();xe=ce.noteModel;await CVi(f,xe,ce.id);break;case r.db.LINETYPE.ACTIVE_START:Ai.newActivation(ce,f,h);break;case r.db.LINETYPE.CENTRAL_CONNECTION:Ai.newActivation(ce,f,h);break;case r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:Ai.newActivation(ce,f,h);break;case r.db.LINETYPE.ACTIVE_END:O(ce,Ai.getVerticalPos());break;case r.db.LINETYPE.LOOP_START:Xw(N,ce,yr.boxMargin,yr.boxMargin+yr.boxTextMargin,Ie=>Ai.newLoop(Ie));break;case r.db.LINETYPE.LOOP_END:ue=Ai.endLoop();await dd.drawLoop(f,ue,"loop",yr,ce);Ai.bumpVerticalPos(ue.stopy-Ai.getVerticalPos());Ai.models.addLoop(ue);break;case r.db.LINETYPE.RECT_START:Xw(N,ce,yr.boxMargin,yr.boxMargin,Ie=>{let he=Ie.message;if(!he){he=s?.rectBkgColor||s?.actorBkg||"rgba(128, 128, 128, 0.5)"}Ai.newLoop(void 0,he)});break;case r.db.LINETYPE.RECT_END:ue=Ai.endLoop();H.push(ue);Ai.models.addLoop(ue);Ai.bumpVerticalPos(ue.stopy-Ai.getVerticalPos());break;case r.db.LINETYPE.OPT_START:Xw(N,ce,yr.boxMargin,yr.boxMargin+yr.boxTextMargin,Ie=>Ai.newLoop(Ie));break;case r.db.LINETYPE.OPT_END:ue=Ai.endLoop();await dd.drawLoop(f,ue,"opt",yr,ce);Ai.bumpVerticalPos(ue.stopy-Ai.getVerticalPos());Ai.models.addLoop(ue);break;case r.db.LINETYPE.ALT_START:Xw(N,ce,yr.boxMargin,yr.boxMargin+yr.boxTextMargin,Ie=>Ai.newLoop(Ie));break;case r.db.LINETYPE.ALT_ELSE:Xw(N,ce,yr.boxMargin+yr.boxTextMargin,yr.boxMargin,Ie=>Ai.addSectionToLoop(Ie));break;case r.db.LINETYPE.ALT_END:ue=Ai.endLoop();await dd.drawLoop(f,ue,"alt",yr,ce);Ai.bumpVerticalPos(ue.stopy-Ai.getVerticalPos());Ai.models.addLoop(ue);break;case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:Xw(N,ce,yr.boxMargin,yr.boxMargin+yr.boxTextMargin,Ie=>Ai.newLoop(Ie));Ai.saveVerticalPos();break;case r.db.LINETYPE.PAR_AND:Xw(N,ce,yr.boxMargin+yr.boxTextMargin,yr.boxMargin,Ie=>Ai.addSectionToLoop(Ie));break;case r.db.LINETYPE.PAR_END:ue=Ai.endLoop();await dd.drawLoop(f,ue,"par",yr,ce);Ai.bumpVerticalPos(ue.stopy-Ai.getVerticalPos());Ai.models.addLoop(ue);break;case r.db.LINETYPE.AUTONUMBER:z=ce.message.start||z;U=ce.message.step||U;if(ce.message.visible){r.db.enableSequenceNumbers()}else{r.db.disableSequenceNumbers()}break;case r.db.LINETYPE.CRITICAL_START:Xw(N,ce,yr.boxMargin,yr.boxMargin+yr.boxTextMargin,Ie=>Ai.newLoop(Ie));break;case r.db.LINETYPE.CRITICAL_OPTION:Xw(N,ce,yr.boxMargin+yr.boxTextMargin,yr.boxMargin,Ie=>Ai.addSectionToLoop(Ie));break;case r.db.LINETYPE.CRITICAL_END:ue=Ai.endLoop();await dd.drawLoop(f,ue,"critical",yr,ce);Ai.bumpVerticalPos(ue.stopy-Ai.getVerticalPos());Ai.models.addLoop(ue);break;case r.db.LINETYPE.BREAK_START:Xw(N,ce,yr.boxMargin,yr.boxMargin+yr.boxTextMargin,Ie=>Ai.newLoop(Ie));break;case r.db.LINETYPE.BREAK_END:ue=Ai.endLoop();await dd.drawLoop(f,ue,"break",yr,ce);Ai.bumpVerticalPos(ue.stopy-Ai.getVerticalPos());Ai.models.addLoop(ue);break;default:try{be=ce.msgModel;be.starty=Ai.getVerticalPos();be.sequenceIndex=z;be.sequenceVisible=r.db.showSequenceNumbers();be.id=ce.id;be.from=ce.from;be.to=ce.to;const Ie=await IOn(f,be);DOn(ce,be,Ie,$,h,m,g);W.push({messageModel:be,lineStartY:Ie,msg:ce});Ai.models.addMessage(be)}catch(Ie){wt.error("error while drawing message",Ie)}}if([r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.SOLID,r.db.LINETYPE.SOLID_TOP,r.db.LINETYPE.SOLID_BOTTOM,r.db.LINETYPE.STICK_TOP,r.db.LINETYPE.STICK_BOTTOM,r.db.LINETYPE.SOLID_TOP_DOTTED,r.db.LINETYPE.SOLID_BOTTOM_DOTTED,r.db.LINETYPE.STICK_TOP_DOTTED,r.db.LINETYPE.STICK_BOTTOM_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.DOTTED,r.db.LINETYPE.SOLID_CROSS,r.db.LINETYPE.DOTTED_CROSS,r.db.LINETYPE.SOLID_POINT,r.db.LINETYPE.DOTTED_POINT,r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(ce.type)){z=Math.round((z+U)*100)/100}$++}wt.debug("createdActors",m);wt.debug("destroyedActors",g);await mlt(f,h,w,false,t,r,I);for(const ce of W){await SVi(f,ce.messageModel,ce.lineStartY,r,ce.msg,t)}if(yr.mirrorActors){await mlt(f,h,w,true,t,r,I)}H.forEach(ce=>dd.drawBackgroundRect(f,ce));kOn(f,h,w,yr);for(const ce of Ai.models.boxes){ce.height=Ai.getVerticalPos()-ce.y;Ai.insert(ce.x,ce.y,ce.x+ce.width,ce.height);const ue=yr.boxMargin*2;ce.startx=ce.x-ue;ce.starty=ce.y-ue*.25;ce.stopx=ce.startx+ce.width+2*ue;ce.stopy=ce.starty+ce.height+ue*.75;ce.stroke="rgb(0,0,0, 0.5)";dd.drawBox(f,ce,yr)}if(A){Ai.bumpVerticalPos(yr.boxMargin)}const K=MOn(f,h,w,d);const{bounds:X}=Ai.getBounds();if(X.startx===void 0){X.startx=0}if(X.starty===void 0){X.starty=0}if(X.stopx===void 0){X.stopx=0}if(X.stopy===void 0){X.stopy=0}let j=X.stopy-X.starty;if(j2;const h=B(w=>{return l?-w:w},"adjustValue");if(e.from===e.to){d=u}else{if(e.activate&&!f){d+=h(yr.activationWidth/2-1)}if(![n.db.LINETYPE.SOLID_OPEN,n.db.LINETYPE.DOTTED_OPEN,n.db.LINETYPE.STICK_TOP,n.db.LINETYPE.STICK_BOTTOM,n.db.LINETYPE.STICK_TOP_DOTTED,n.db.LINETYPE.STICK_BOTTOM_DOTTED,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,n.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(e.type)){d+=h(3)}if([n.db.LINETYPE.BIDIRECTIONAL_SOLID,n.db.LINETYPE.BIDIRECTIONAL_DOTTED,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,n.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,n.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(e.type)){u-=h(3)}}const m=[i,o,a,s];const g=Math.abs(u-d);if(e.wrap&&e.message){e.message=Ko.wrapLabel(e.message,Ti.getMax(g+2*yr.wrapPadding,yr.width),G6(yr))}const x=Ko.calculateTextDimensions(e.message,G6(yr));return{width:Ti.getMax(e.wrap?0:x.width+2*yr.wrapPadding,g+2*yr.wrapPadding,yr.width),height:0,startx:u,stopx:d,starty:0,stopy:0,message:e.message,type:e.type,wrap:e.wrap,fromBounds:Math.min.apply(null,m),toBounds:Math.max.apply(null,m)}},"buildMessageModel");NVi=B(async function(e,t,n,r){const i={};const o=[];let a,s,l;for(const u of e){switch(u.type){case r.db.LINETYPE.LOOP_START:case r.db.LINETYPE.ALT_START:case r.db.LINETYPE.OPT_START:case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:case r.db.LINETYPE.CRITICAL_START:case r.db.LINETYPE.BREAK_START:o.push({id:u.id,msg:u.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case r.db.LINETYPE.ALT_ELSE:case r.db.LINETYPE.PAR_AND:case r.db.LINETYPE.CRITICAL_OPTION:if(u.message){a=o.pop();i[a.id]=a;i[u.id]=a;o.push(a)}break;case r.db.LINETYPE.LOOP_END:case r.db.LINETYPE.ALT_END:case r.db.LINETYPE.OPT_END:case r.db.LINETYPE.PAR_END:case r.db.LINETYPE.CRITICAL_END:case r.db.LINETYPE.BREAK_END:a=o.pop();i[a.id]=a;break;case r.db.LINETYPE.ACTIVE_START:{const f=t.get(u.from?u.from:u.to.actor);const h=FPe(u.from?u.from:u.to.actor).length;const m=f.x+f.width/2+(h-1)*yr.activationWidth/2;const g={startx:m,stopx:m+yr.activationWidth,actor:u.from,enabled:true};Ai.activations.push(g)}break;case r.db.LINETYPE.ACTIVE_END:{const f=Ai.activations.map(h=>h.actor).lastIndexOf(u.from);Ai.activations.splice(f,1).splice(0,1)}break}const d=u.placement!==void 0;if(d){s=await PVi(u,t,r);u.noteModel=s;o.forEach(f=>{a=f;a.from=Ti.getMin(a.from,s.startx);a.to=Ti.getMax(a.to,s.startx+s.width);a.width=Ti.getMax(a.width,Math.abs(a.from-a.to))-yr.labelBoxWidth})}else{l=FVi(u,t,r);u.msgModel=l;if(l.startx&&l.stopx&&o.length>0){o.forEach(f=>{a=f;if(l.startx===l.stopx){const h=t.get(u.from);const m=t.get(u.to);a.from=Ti.getMin(h.x-l.width/2,h.x-h.width/2,a.from);a.to=Ti.getMax(m.x+l.width/2,m.x+h.width/2,a.to);a.width=Ti.getMax(a.width,Math.abs(a.to-a.from))-yr.labelBoxWidth}else{a.from=Ti.getMin(l.startx,a.from);a.to=Ti.getMax(l.stopx,a.to);a.width=Ti.getMax(a.width,l.width)-yr.labelBoxWidth}})}}}Ai.activations=[];wt.debug("Loop type widths:",i);return i},"calculateLoopBounds");OVi={bounds:Ai,drawActors:mlt,drawActorsPopup:MOn,setConf:LOn,draw:kVi};BVi={parser:HUi,get db(){return new XUi},renderer:OVi,styles:KUi,init:B(e=>{if(!e.sequence){e.sequence={}}if(e.wrap){e.sequence.wrap=e.wrap;tee({sequence:{wrap:e.wrap}})}},"init")}});var ylt,OPe,UOn,VOn,NPe,$On,H6,BPe,zVi,zPe,UVi,VVi,$Vi,UPe;var xlt=Ce(()=>{aS();lv();Cx();Tx();sv();nl();Ta();Aa();Yo();ks();KV();ylt=function(){var e=B(function(qe,Qe,ze,Me){for(ze=ze||{},Me=qe.length;Me--;ze[qe[Me]]=Qe);return ze},"o"),t=[1,18],n=[1,19],r=[1,20],i=[1,41],o=[1,26],a=[1,42],s=[1,24],l=[1,25],u=[1,32],d=[1,33],f=[1,34],h=[1,45],m=[1,35],g=[1,36],x=[1,37],w=[1,38],_=[1,27],C=[1,28],A=[1,29],P=[1,30],L=[1,31],I=[1,44],N=[1,46],O=[1,43],z=[1,47],U=[1,9],W=[1,8,9],H=[1,58],$=[1,59],K=[1,60],X=[1,61],j=[1,62],te=[1,63],J=[1,64],oe=[1,8,9,41],se=[1,77],re=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],ce=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],ue=[13,60,86,100,102,103],xe=[13,60,73,74,86,100,102,103],be=[13,60,68,69,70,71,72,86,100,102,103],Ie=[1,103],he=[1,121],ve=[1,117],ge=[1,113],Ve=[1,119],Le=[1,114],$e=[1,115],Ee=[1,116],tt=[1,118],yt=[1,120],mt=[22,50,60,61,82,86,87,88,89,90],ct=[1,128],Ge=[12,39],it=[1,8,9,39,41,44,46],bt=[1,8,9,22],He=[1,153],Je=[1,8,9,61],Te=[1,8,9,22,50,60,61,82,86,87,88,89,90];var we={trace:B(function qe(){},"trace"),yy:{},symbols_:{"error":2,"start":3,"mermaidDoc":4,"statements":5,"graphConfig":6,"CLASS_DIAGRAM":7,"NEWLINE":8,"EOF":9,"statement":10,"classLabel":11,"SQS":12,"STR":13,"SQE":14,"namespaceName":15,"alphaNumToken":16,"classLiteralName":17,"DOT":18,"className":19,"GENERICTYPE":20,"relationStatement":21,"LABEL":22,"namespaceStatement":23,"classStatement":24,"memberStatement":25,"annotationStatement":26,"clickStatement":27,"styleStatement":28,"cssClassStatement":29,"noteStatement":30,"classDefStatement":31,"direction":32,"acc_title":33,"acc_title_value":34,"acc_descr":35,"acc_descr_value":36,"acc_descr_multiline_value":37,"namespaceIdentifier":38,"STRUCT_START":39,"classStatements":40,"STRUCT_STOP":41,"NAMESPACE":42,"classIdentifier":43,"STYLE_SEPARATOR":44,"members":45,"ANNOTATION_START":46,"ANNOTATION_END":47,"CLASS":48,"emptyBody":49,"SPACE":50,"MEMBER":51,"SEPARATOR":52,"relation":53,"NOTE_FOR":54,"noteText":55,"NOTE":56,"CLASSDEF":57,"classList":58,"stylesOpt":59,"ALPHA":60,"COMMA":61,"direction_tb":62,"direction_bt":63,"direction_rl":64,"direction_lr":65,"relationType":66,"lineType":67,"AGGREGATION":68,"EXTENSION":69,"COMPOSITION":70,"DEPENDENCY":71,"LOLLIPOP":72,"LINE":73,"DOTTED_LINE":74,"CALLBACK":75,"LINK":76,"LINK_TARGET":77,"CLICK":78,"CALLBACK_NAME":79,"CALLBACK_ARGS":80,"HREF":81,"STYLE":82,"CSSCLASS":83,"style":84,"styleComponent":85,"NUM":86,"COLON":87,"UNIT":88,"BRKT":89,"PCT":90,"commentToken":91,"textToken":92,"graphCodeTokens":93,"textNoTagsToken":94,"TAGSTART":95,"TAGEND":96,"==":97,"--":98,"DEFAULT":99,"MINUS":100,"keywords":101,"UNICODE_TEXT":102,"BQUOTE_STR":103,"$accept":0,"$end":1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:B(function qe(Qe,ze,Me,ye,Ne,Ae,dt){var Oe=Ae.length-1;switch(Ne){case 8:this.$=Ae[Oe-1];break;case 9:case 10:case 13:case 15:this.$=Ae[Oe];break;case 11:case 14:this.$=Ae[Oe-2]+"."+Ae[Oe];break;case 12:case 16:this.$=Ae[Oe-1]+Ae[Oe];break;case 17:case 18:this.$=Ae[Oe-1]+"~"+Ae[Oe]+"~";break;case 19:ye.addRelation(Ae[Oe]);break;case 20:Ae[Oe-1].title=ye.cleanupLabel(Ae[Oe]);ye.addRelation(Ae[Oe-1]);break;case 31:this.$=Ae[Oe].trim();ye.setAccTitle(this.$);break;case 32:case 33:this.$=Ae[Oe].trim();ye.setAccDescription(this.$);break;case 34:ye.addClassesToNamespace(Ae[Oe-3],Ae[Oe-1][0],Ae[Oe-1][1]);ye.popNamespace();break;case 35:ye.addClassesToNamespace(Ae[Oe-4],Ae[Oe-1][0],Ae[Oe-1][1]);ye.popNamespace();break;case 36:this.$=ye.addNamespace(Ae[Oe]);break;case 37:this.$=ye.addNamespace(Ae[Oe-1],Ae[Oe]);break;case 38:this.$=[[Ae[Oe]],[]];break;case 39:this.$=[[Ae[Oe-1]],[]];break;case 40:Ae[Oe][0].unshift(Ae[Oe-2]);this.$=Ae[Oe];break;case 41:this.$=[[],[Ae[Oe]]];break;case 42:this.$=[[],[Ae[Oe-1]]];break;case 43:Ae[Oe][1].unshift(Ae[Oe-2]);this.$=Ae[Oe];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=Ae[Oe];break;case 48:ye.setCssClass(Ae[Oe-2],Ae[Oe]);break;case 49:ye.addMembers(Ae[Oe-3],Ae[Oe-1]);break;case 51:ye.setCssClass(Ae[Oe-5],Ae[Oe-3]);ye.addMembers(Ae[Oe-5],Ae[Oe-1]);break;case 52:ye.addAnnotation(Ae[Oe-3],Ae[Oe-1]);break;case 53:ye.addAnnotation(Ae[Oe-6],Ae[Oe-4]);ye.addMembers(Ae[Oe-6],Ae[Oe-1]);break;case 54:ye.addAnnotation(Ae[Oe-5],Ae[Oe-3]);break;case 55:this.$=Ae[Oe];ye.addClass(Ae[Oe]);break;case 56:this.$=Ae[Oe-1];ye.addClass(Ae[Oe-1]);ye.setClassLabel(Ae[Oe-1],Ae[Oe]);break;case 60:ye.addAnnotation(Ae[Oe],Ae[Oe-2]);break;case 61:case 74:this.$=[Ae[Oe]];break;case 62:Ae[Oe].push(Ae[Oe-1]);this.$=Ae[Oe];break;case 63:break;case 64:ye.addMember(Ae[Oe-1],ye.cleanupLabel(Ae[Oe]));break;case 65:break;case 66:break;case 67:this.$={"id1":Ae[Oe-2],"id2":Ae[Oe],relation:Ae[Oe-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:Ae[Oe-3],id2:Ae[Oe],relation:Ae[Oe-1],relationTitle1:Ae[Oe-2],relationTitle2:"none"};break;case 69:this.$={id1:Ae[Oe-3],id2:Ae[Oe],relation:Ae[Oe-2],relationTitle1:"none",relationTitle2:Ae[Oe-1]};break;case 70:this.$={id1:Ae[Oe-4],id2:Ae[Oe],relation:Ae[Oe-2],relationTitle1:Ae[Oe-3],relationTitle2:Ae[Oe-1]};break;case 71:this.$=ye.addNote(Ae[Oe],Ae[Oe-1]);break;case 72:this.$=ye.addNote(Ae[Oe]);break;case 73:this.$=Ae[Oe-2];ye.defineClass(Ae[Oe-1],Ae[Oe]);break;case 75:this.$=Ae[Oe-2].concat([Ae[Oe]]);break;case 76:ye.setDirection("TB");break;case 77:ye.setDirection("BT");break;case 78:ye.setDirection("RL");break;case 79:ye.setDirection("LR");break;case 80:this.$={type1:Ae[Oe-2],type2:Ae[Oe],lineType:Ae[Oe-1]};break;case 81:this.$={type1:"none",type2:Ae[Oe],lineType:Ae[Oe-1]};break;case 82:this.$={type1:Ae[Oe-1],type2:"none",lineType:Ae[Oe]};break;case 83:this.$={type1:"none",type2:"none",lineType:Ae[Oe]};break;case 84:this.$=ye.relationType.AGGREGATION;break;case 85:this.$=ye.relationType.EXTENSION;break;case 86:this.$=ye.relationType.COMPOSITION;break;case 87:this.$=ye.relationType.DEPENDENCY;break;case 88:this.$=ye.relationType.LOLLIPOP;break;case 89:this.$=ye.lineType.LINE;break;case 90:this.$=ye.lineType.DOTTED_LINE;break;case 91:case 97:this.$=Ae[Oe-2];ye.setClickEvent(Ae[Oe-1],Ae[Oe]);break;case 92:case 98:this.$=Ae[Oe-3];ye.setClickEvent(Ae[Oe-2],Ae[Oe-1]);ye.setTooltip(Ae[Oe-2],Ae[Oe]);break;case 93:this.$=Ae[Oe-2];ye.setLink(Ae[Oe-1],Ae[Oe]);break;case 94:this.$=Ae[Oe-3];ye.setLink(Ae[Oe-2],Ae[Oe-1],Ae[Oe]);break;case 95:this.$=Ae[Oe-3];ye.setLink(Ae[Oe-2],Ae[Oe-1]);ye.setTooltip(Ae[Oe-2],Ae[Oe]);break;case 96:this.$=Ae[Oe-4];ye.setLink(Ae[Oe-3],Ae[Oe-2],Ae[Oe]);ye.setTooltip(Ae[Oe-3],Ae[Oe-1]);break;case 99:this.$=Ae[Oe-3];ye.setClickEvent(Ae[Oe-2],Ae[Oe-1],Ae[Oe]);break;case 100:this.$=Ae[Oe-4];ye.setClickEvent(Ae[Oe-3],Ae[Oe-2],Ae[Oe-1]);ye.setTooltip(Ae[Oe-3],Ae[Oe]);break;case 101:this.$=Ae[Oe-3];ye.setLink(Ae[Oe-2],Ae[Oe]);break;case 102:this.$=Ae[Oe-4];ye.setLink(Ae[Oe-3],Ae[Oe-1],Ae[Oe]);break;case 103:this.$=Ae[Oe-4];ye.setLink(Ae[Oe-3],Ae[Oe-1]);ye.setTooltip(Ae[Oe-3],Ae[Oe]);break;case 104:this.$=Ae[Oe-5];ye.setLink(Ae[Oe-4],Ae[Oe-2],Ae[Oe]);ye.setTooltip(Ae[Oe-4],Ae[Oe-1]);break;case 105:this.$=Ae[Oe-2];ye.setCssStyle(Ae[Oe-1],Ae[Oe]);break;case 106:ye.setCssClass(Ae[Oe-1],Ae[Oe]);break;case 107:this.$=[Ae[Oe]];break;case 108:Ae[Oe-2].push(Ae[Oe]);this.$=Ae[Oe-2];break;case 110:this.$=Ae[Oe-1]+Ae[Oe];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:t,35:n,37:r,38:22,42:i,43:23,46:o,48:a,51:s,52:l,54:u,56:d,57:f,60:h,62:m,63:g,64:x,65:w,75:_,76:C,78:A,82:P,83:L,86:I,100:N,102:O,103:z},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},e(U,[2,5],{8:[1,48]}),{8:[1,49]},e(W,[2,19],{22:[1,50]}),e(W,[2,21]),e(W,[2,22]),e(W,[2,23]),e(W,[2,24]),e(W,[2,25]),e(W,[2,26]),e(W,[2,27]),e(W,[2,28]),e(W,[2,29]),e(W,[2,30]),{34:[1,51]},{36:[1,52]},e(W,[2,33]),e(W,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:H,69:$,70:K,71:X,72:j,73:te,74:J}),{39:[1,65]},e(oe,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),e(W,[2,65]),e(W,[2,66]),{16:69,60:h,86:I,100:N,102:O},{16:39,17:40,19:70,60:h,86:I,100:N,102:O,103:z},{16:39,17:40,19:71,60:h,86:I,100:N,102:O,103:z},{16:39,17:40,19:72,60:h,86:I,100:N,102:O,103:z},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:h,86:I,100:N,102:O,103:z},{13:se,55:76},{58:78,60:[1,79]},e(W,[2,76]),e(W,[2,77]),e(W,[2,78]),e(W,[2,79]),e(re,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:h,86:I,100:N,102:O,103:z}),e(re,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:h,86:I,100:N,102:O,103:z},{16:39,17:40,19:87,60:h,86:I,100:N,102:O,103:z},e(ce,[2,133]),e(ce,[2,134]),e(ce,[2,135]),e(ce,[2,136]),e([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),e(U,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:t,35:n,37:r,42:i,46:o,48:a,51:s,52:l,54:u,56:d,57:f,60:h,62:m,63:g,64:x,65:w,75:_,76:C,78:A,82:P,83:L,86:I,100:N,102:O,103:z}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:t,35:n,37:r,38:22,42:i,43:23,46:o,48:a,51:s,52:l,54:u,56:d,57:f,60:h,62:m,63:g,64:x,65:w,75:_,76:C,78:A,82:P,83:L,86:I,100:N,102:O,103:z},e(W,[2,20]),e(W,[2,31]),e(W,[2,32]),{13:[1,91],16:39,17:40,19:90,60:h,86:I,100:N,102:O,103:z},{53:92,66:56,67:57,68:H,69:$,70:K,71:X,72:j,73:te,74:J},e(W,[2,64]),{67:93,73:te,74:J},e(ue,[2,83],{66:94,68:H,69:$,70:K,71:X,72:j}),e(xe,[2,84]),e(xe,[2,85]),e(xe,[2,86]),e(xe,[2,87]),e(xe,[2,88]),e(be,[2,89]),e(be,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:i,43:23,48:a,54:u,56:d},{16:100,60:h,86:I,100:N,102:O},{41:[1,102],45:101,51:Ie},{16:104,60:h,86:I,100:N,102:O},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:he,50:ve,59:110,60:ge,82:Ve,84:111,85:112,86:Le,87:$e,88:Ee,89:tt,90:yt},{60:[1,122]},{13:se,55:123},e(oe,[2,72]),e(oe,[2,138]),{22:he,50:ve,59:124,60:ge,61:[1,125],82:Ve,84:111,85:112,86:Le,87:$e,88:Ee,89:tt,90:yt},e(mt,[2,74]),{16:39,17:40,19:126,60:h,86:I,100:N,102:O,103:z},e(re,[2,16]),e(re,[2,17]),e(re,[2,18]),{11:127,12:ct,39:[2,36]},e(Ge,[2,9],{16:85,17:86,15:130,18:[1,129],60:h,86:I,100:N,102:O,103:z}),e(Ge,[2,10]),e(it,[2,55],{11:131,12:ct}),e(U,[2,7]),{9:[1,132]},e(bt,[2,67]),{16:39,17:40,19:133,60:h,86:I,100:N,102:O,103:z},{13:[1,135],16:39,17:40,19:134,60:h,86:I,100:N,102:O,103:z},e(ue,[2,82],{66:136,68:H,69:$,70:K,71:X,72:j}),e(ue,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:i,43:23,48:a,54:u,56:d},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},e(oe,[2,48],{39:[1,142]}),{41:[1,143]},e(oe,[2,50]),{41:[2,61],45:144,51:Ie},{47:[1,145]},{16:39,17:40,19:146,60:h,86:I,100:N,102:O,103:z},e(W,[2,91],{13:[1,147]}),e(W,[2,93],{13:[1,149],77:[1,148]}),e(W,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},e(W,[2,105],{61:He}),e(Je,[2,107],{85:154,22:he,50:ve,60:ge,82:Ve,86:Le,87:$e,88:Ee,89:tt,90:yt}),e(Te,[2,109]),e(Te,[2,111]),e(Te,[2,112]),e(Te,[2,113]),e(Te,[2,114]),e(Te,[2,115]),e(Te,[2,116]),e(Te,[2,117]),e(Te,[2,118]),e(Te,[2,119]),e(W,[2,106]),e(oe,[2,71]),e(W,[2,73],{61:He}),{60:[1,155]},e(re,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:h,86:I,100:N,102:O,103:z},e(Ge,[2,12]),e(it,[2,56]),{1:[2,4]},e(bt,[2,69]),e(bt,[2,68]),{16:39,17:40,19:158,60:h,86:I,100:N,102:O,103:z},e(ue,[2,80]),e(oe,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:i,43:23,48:a,54:u,56:d},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:i,43:23,48:a,54:u,56:d},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:i,43:23,48:a,54:u,56:d},{45:163,51:Ie},e(oe,[2,49]),{41:[2,62]},e(oe,[2,52],{39:[1,164]}),e(W,[2,60]),e(W,[2,92]),e(W,[2,94]),e(W,[2,95],{77:[1,165]}),e(W,[2,98]),e(W,[2,99],{13:[1,166]}),e(W,[2,101],{13:[1,168],77:[1,167]}),{22:he,50:ve,60:ge,82:Ve,84:169,85:112,86:Le,87:$e,88:Ee,89:tt,90:yt},e(Te,[2,110]),e(mt,[2,75]),{14:[1,170]},e(Ge,[2,11]),e(bt,[2,70]),e(oe,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:Ie},e(W,[2,96]),e(W,[2,100]),e(W,[2,102]),e(W,[2,103],{77:[1,174]}),e(Je,[2,108],{85:154,22:he,50:ve,60:ge,82:Ve,86:Le,87:$e,88:Ee,89:tt,90:yt}),e(it,[2,8]),e(oe,[2,51]),{41:[1,175]},e(oe,[2,54]),e(W,[2,104]),e(oe,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:B(function qe(Qe,ze){if(ze.recoverable){this.trace(Qe)}else{var Me=new Error(Qe);Me.hash=ze;throw Me}},"parseError"),parse:B(function qe(Qe){var ze=this,Me=[0],ye=[],Ne=[null],Ae=[],dt=this.table,Oe="",Wt=0,kt=0,qt=0,_t=2,sn=1;var Jt=Ae.slice.call(arguments,1);var Sn=Object.create(this.lexer);var Kt={yy:{}};for(var mn in this.yy){if(Object.prototype.hasOwnProperty.call(this.yy,mn)){Kt.yy[mn]=this.yy[mn]}}Sn.setInput(Qe,Kt.yy);Kt.yy.lexer=Sn;Kt.yy.parser=this;if(typeof Sn.yylloc=="undefined"){Sn.yylloc={}}var At=Sn.yylloc;Ae.push(At);var lr=Sn.options&&Sn.options.ranges;if(typeof Kt.yy.parseError==="function"){this.parseError=Kt.yy.parseError}else{this.parseError=Object.getPrototypeOf(this).parseError}function on(Pt){Me.length=Me.length-2*Pt;Ne.length=Ne.length-Pt;Ae.length=Ae.length-Pt}B(on,"popStack");function cr(){var Pt;Pt=ye.pop()||Sn.lex()||sn;if(typeof Pt!=="number"){if(Pt instanceof Array){ye=Pt;Pt=ye.pop()}Pt=ze.symbols_[Pt]||Pt}return Pt}B(cr,"lex");var Hr,Mr,Er,vr,Yr,nt,Rr={},Xr,dr,rn,St;while(true){Er=Me[Me.length-1];if(this.defaultActions[Er]){vr=this.defaultActions[Er]}else{if(Hr===null||typeof Hr=="undefined"){Hr=cr()}vr=dt[Er]&&dt[Er][Hr]}if(typeof vr==="undefined"||!vr.length||!vr[0]){var Ut="";St=[];for(Xr in dt[Er]){if(this.terminals_[Xr]&&Xr>_t){St.push("'"+this.terminals_[Xr]+"'")}}if(Sn.showPosition){Ut="Parse error on line "+(Wt+1)+":\n"+Sn.showPosition()+"\nExpecting "+St.join(", ")+", got '"+(this.terminals_[Hr]||Hr)+"'"}else{Ut="Parse error on line "+(Wt+1)+": Unexpected "+(Hr==sn?"end of input":"'"+(this.terminals_[Hr]||Hr)+"'")}this.parseError(Ut,{text:Sn.match,token:this.terminals_[Hr]||Hr,line:Sn.yylineno,loc:At,expected:St})}if(vr[0]instanceof Array&&vr.length>1){throw new Error("Parse Error: multiple actions possible at state: "+Er+", token: "+Hr)}switch(vr[0]){case 1:Me.push(Hr);Ne.push(Sn.yytext);Ae.push(Sn.yylloc);Me.push(vr[1]);Hr=null;if(!Mr){kt=Sn.yyleng;Oe=Sn.yytext;Wt=Sn.yylineno;At=Sn.yylloc;if(qt>0){qt--}}else{Hr=Mr;Mr=null}break;case 2:dr=this.productions_[vr[1]][1];Rr.$=Ne[Ne.length-dr];Rr._$={first_line:Ae[Ae.length-(dr||1)].first_line,last_line:Ae[Ae.length-1].last_line,first_column:Ae[Ae.length-(dr||1)].first_column,last_column:Ae[Ae.length-1].last_column};if(lr){Rr._$.range=[Ae[Ae.length-(dr||1)].range[0],Ae[Ae.length-1].range[1]]}nt=this.performAction.apply(Rr,[Oe,kt,Wt,Kt.yy,vr[1],Ne,Ae].concat(Jt));if(typeof nt!=="undefined"){return nt}if(dr){Me=Me.slice(0,-1*dr*2);Ne=Ne.slice(0,-1*dr);Ae=Ae.slice(0,-1*dr)}Me.push(this.productions_[vr[1]][0]);Ne.push(Rr.$);Ae.push(Rr._$);rn=dt[Me[Me.length-2]][Me[Me.length-1]];Me.push(rn);break;case 3:return true}}return true},"parse")};var Ze=function(){var qe={EOF:1,parseError:B(function Qe(ze,Me){if(this.yy.parser){this.yy.parser.parseError(ze,Me)}else{throw new Error(ze)}},"parseError"),setInput:B(function(Qe,ze){this.yy=ze||this.yy||{};this._input=Qe;this._more=this._backtrack=this.done=false;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};if(this.options.ranges){this.yylloc.range=[0,0]}this.offset=0;return this},"setInput"),input:B(function(){var Qe=this._input[0];this.yytext+=Qe;this.yyleng++;this.offset++;this.match+=Qe;this.matched+=Qe;var ze=Qe.match(/(?:\r\n?|\n).*/g);if(ze){this.yylineno++;this.yylloc.last_line++}else{this.yylloc.last_column++}if(this.options.ranges){this.yylloc.range[1]++}this._input=this._input.slice(1);return Qe},"input"),unput:B(function(Qe){var ze=Qe.length;var Me=Qe.split(/(?:\r\n?|\n)/g);this._input=Qe+this._input;this.yytext=this.yytext.substr(0,this.yytext.length-ze);this.offset-=ze;var ye=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1);this.matched=this.matched.substr(0,this.matched.length-1);if(Me.length-1){this.yylineno-=Me.length-1}var Ne=this.yylloc.range;this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Me?(Me.length===ye.length?this.yylloc.first_column:0)+ye[ye.length-Me.length].length-Me[0].length:this.yylloc.first_column-ze};if(this.options.ranges){this.yylloc.range=[Ne[0],Ne[0]+this.yyleng-ze]}this.yyleng=this.yytext.length;return this},"unput"),more:B(function(){this._more=true;return this},"more"),reject:B(function(){if(this.options.backtrack_lexer){this._backtrack=true}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}return this},"reject"),less:B(function(Qe){this.unput(this.match.slice(Qe))},"less"),pastInput:B(function(){var Qe=this.matched.substr(0,this.matched.length-this.match.length);return(Qe.length>20?"...":"")+Qe.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:B(function(){var Qe=this.match;if(Qe.length<20){Qe+=this._input.substr(0,20-Qe.length)}return(Qe.substr(0,20)+(Qe.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:B(function(){var Qe=this.pastInput();var ze=new Array(Qe.length+1).join("-");return Qe+this.upcomingInput()+"\n"+ze+"^"},"showPosition"),test_match:B(function(Qe,ze){var Me,ye,Ne;if(this.options.backtrack_lexer){Ne={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done};if(this.options.ranges){Ne.yylloc.range=this.yylloc.range.slice(0)}}ye=Qe[0].match(/(?:\r\n?|\n).*/g);if(ye){this.yylineno+=ye.length}this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:ye?ye[ye.length-1].length-ye[ye.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Qe[0].length};this.yytext+=Qe[0];this.match+=Qe[0];this.matches=Qe;this.yyleng=this.yytext.length;if(this.options.ranges){this.yylloc.range=[this.offset,this.offset+=this.yyleng]}this._more=false;this._backtrack=false;this._input=this._input.slice(Qe[0].length);this.matched+=Qe[0];Me=this.performAction.call(this,this.yy,this,ze,this.conditionStack[this.conditionStack.length-1]);if(this.done&&this._input){this.done=false}if(Me){return Me}else if(this._backtrack){for(var Ae in Ne){this[Ae]=Ne[Ae]}return false}return false},"test_match"),next:B(function(){if(this.done){return this.EOF}if(!this._input){this.done=true}var Qe,ze,Me,ye;if(!this._more){this.yytext="";this.match=""}var Ne=this._currentRules();for(var Ae=0;Aeze[0].length)){ze=Me;ye=Ae;if(this.options.backtrack_lexer){Qe=this.test_match(Me,Ne[Ae]);if(Qe!==false){return Qe}else if(this._backtrack){ze=false;continue}else{return false}}else if(!this.options.flex){break}}}if(ze){Qe=this.test_match(ze,Ne[ye]);if(Qe!==false){return Qe}return false}if(this._input===""){return this.EOF}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}},"next"),lex:B(function Qe(){var ze=this.next();if(ze){return ze}else{return this.lex()}},"lex"),begin:B(function Qe(ze){this.conditionStack.push(ze)},"begin"),popState:B(function Qe(){var ze=this.conditionStack.length-1;if(ze>0){return this.conditionStack.pop()}else{return this.conditionStack[0]}},"popState"),_currentRules:B(function Qe(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules}else{return this.conditions["INITIAL"].rules}},"_currentRules"),topState:B(function Qe(ze){ze=this.conditionStack.length-1-Math.abs(ze||0);if(ze>=0){return this.conditionStack[ze]}else{return"INITIAL"}},"topState"),pushState:B(function Qe(ze){this.begin(ze)},"pushState"),stateStackSize:B(function Qe(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:B(function Qe(ze,Me,ye,Ne){var Ae=Ne;switch(ye){case 0:return 62;break;case 1:return 63;break;case 2:return 64;break;case 3:return 65;break;case 4:break;case 5:break;case 6:this.begin("acc_title");return 33;break;case 7:this.popState();return"acc_title_value";break;case 8:this.begin("acc_descr");return 35;break;case 9:this.popState();return"acc_descr_value";break;case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";break;case 13:return 8;break;case 14:break;case 15:return 7;break;case 16:return 7;break;case 17:return"EDGE_STATE";break;case 18:this.begin("callback_name");break;case 19:this.popState();break;case 20:this.popState();this.begin("callback_args");break;case 21:return 79;break;case 22:this.popState();break;case 23:return 80;break;case 24:this.popState();break;case 25:return"STR";break;case 26:this.begin("string");break;case 27:return 82;break;case 28:return 57;break;case 29:this.begin("namespace");return 42;break;case 30:this.popState();return 8;break;case 31:break;case 32:this.begin("namespace-body");return 39;break;case 33:this.popState();this.less(0);break;case 34:this.popState();return 41;break;case 35:return"EOF_IN_STRUCT";break;case 36:return 8;break;case 37:break;case 38:return"EDGE_STATE";break;case 39:this.begin("class");return 48;break;case 40:this.popState();return 8;break;case 41:break;case 42:this.popState();this.popState();return 41;break;case 43:this.begin("class-body");return 39;break;case 44:this.popState();return 41;break;case 45:return"EOF_IN_STRUCT";break;case 46:return"EDGE_STATE";break;case 47:return"OPEN_IN_STRUCT";break;case 48:break;case 49:return"MEMBER";break;case 50:return 83;break;case 51:return 75;break;case 52:return 76;break;case 53:return 78;break;case 54:return 54;break;case 55:return 56;break;case 56:return 46;break;case 57:return 47;break;case 58:return 81;break;case 59:this.popState();break;case 60:return"GENERICTYPE";break;case 61:this.begin("generic");break;case 62:this.popState();break;case 63:return"BQUOTE_STR";break;case 64:this.begin("bqstring");break;case 65:return 77;break;case 66:return 77;break;case 67:return 77;break;case 68:return 77;break;case 69:return 69;break;case 70:return 69;break;case 71:return 71;break;case 72:return 71;break;case 73:return 70;break;case 74:return 68;break;case 75:return 72;break;case 76:return 73;break;case 77:return 74;break;case 78:return 22;break;case 79:return 44;break;case 80:return 100;break;case 81:return 18;break;case 82:return"PLUS";break;case 83:return 87;break;case 84:return 61;break;case 85:return 89;break;case 86:return 89;break;case 87:return 90;break;case 88:return"EQUALS";break;case 89:return"EQUALS";break;case 90:return 60;break;case 91:return 12;break;case 92:return 14;break;case 93:return"PUNCTUATION";break;case 94:return 86;break;case 95:return 102;break;case 96:return 50;break;case 97:return 50;break;case 98:return 9;break}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:\[\*\])/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:["])/,/^(?:[^"]*)/,/^(?:["])/,/^(?:style\b)/,/^(?:classDef\b)/,/^(?:namespace\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[{])/,/^(?:[}])/,/^(?:[}])/,/^(?:$)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:\[\*\])/,/^(?:class\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[}])/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\[\*\])/,/^(?:[{])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:href\b)/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:~)/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:[`])/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:\s*\(\))/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?::)/,/^(?:,)/,/^(?:#)/,/^(?:#)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:\[)/,/^(?:\])/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:\s)/,/^(?:$)/],conditions:{"namespace-body":{"rules":[26,29,34,35,36,37,38,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],"inclusive":false},"namespace":{"rules":[26,29,30,31,32,33,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],"inclusive":false},"class-body":{"rules":[26,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],"inclusive":false},"class":{"rules":[26,40,41,42,43,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],"inclusive":false},"acc_descr_multiline":{"rules":[11,12,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],"inclusive":false},"acc_descr":{"rules":[9,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],"inclusive":false},"acc_title":{"rules":[7,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],"inclusive":false},"callback_args":{"rules":[22,23,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],"inclusive":false},"callback_name":{"rules":[19,20,21,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],"inclusive":false},"href":{"rules":[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],"inclusive":false},"struct":{"rules":[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],"inclusive":false},"generic":{"rules":[26,50,51,52,53,54,55,56,57,58,59,60,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],"inclusive":false},"bqstring":{"rules":[26,50,51,52,53,54,55,56,57,58,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],"inclusive":false},"string":{"rules":[24,25,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],"inclusive":false},"INITIAL":{"rules":[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98],"inclusive":true}}};return qe}();we.lexer=Ze;function Be(){this.yy={}}B(Be,"Parser");Be.prototype=we;we.Parser=Be;return new Be}();ylt.parser=ylt;OPe=ylt;UOn=["#","+","~","-",""];VOn=class{static{B(this,"ClassMember")}constructor(e,t){this.memberType=t;this.visibility="";this.classifier="";this.text="";const n=La(e,Mn());this.parseMember(n)}getDisplayDetails(){let e=this.visibility+BC(this.id);if(this.memberType==="method"){e+=`(${BC(this.parameters.trim())})`;if(this.returnType){e+=" : "+BC(this.returnType)}}e=e.trim();const t=this.parseClassifier();return{displayText:e,cssStyle:t}}parseMember(e){let t="";if(this.memberType==="method"){const r=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/;const i=r.exec(e);if(i){const o=i[1]?i[1].trim():"";if(UOn.includes(o)){this.visibility=o}this.id=i[2];this.parameters=i[3]?i[3].trim():"";t=i[4]?i[4].trim():"";this.returnType=i[5]?i[5].trim():"";if(t===""){const a=this.returnType.substring(this.returnType.length-1);if(/[$*]/.exec(a)){t=a;this.returnType=this.returnType.substring(0,this.returnType.length-1)}}}}else{const r=e.length;const i=e.substring(0,1);const o=e.substring(r-1);if(UOn.includes(i)){this.visibility=i}if(/[$*]/.exec(o)){t=o}this.id=e.substring(this.visibility===""?0:1,t===""?r:r-1)}this.classifier=t;this.id=this.id.startsWith(" ")?" "+this.id.trim():this.id.trim();const n=`${this.visibility?"\\"+this.visibility:""}${BC(this.id)}${this.memberType==="method"?`(${BC(this.parameters)})${this.returnType?" : "+BC(this.returnType):""}`:""}`;this.text=n.replaceAll("<","<").replaceAll(">",">");if(this.text.startsWith("\\<")){this.text=this.text.replace("\\<","~")}}parseClassifier(){switch(this.classifier){case"*":return"font-style:italic;";case"$":return"text-decoration:underline;";default:return""}}};NPe="classId-";$On=0;H6=B(e=>Ti.sanitizeText(e,Mn()),"sanitizeText");BPe=class blt{constructor(){this.relations=[];this.classes=new Map;this.styleClasses=new Map;this.notes=new Map;this.interfaces=[];this.namespaces=new Map;this.namespaceCounter=0;this.namespaceStack=[];this.diagramId="";this.functions=[];this.lineType={LINE:0,DOTTED_LINE:1};this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4};this.setupToolTips=B(t=>{const n=gG();const r=zr(t).select("svg");const i=r.selectAll("g").filter(function(){return zr(this).attr("title")!==null});i.on("mouseover",o=>{const a=zr(o.currentTarget);const s=a.attr("title");if(!s){return}const l=o.currentTarget.getBoundingClientRect();n.transition().duration(200).style("opacity",".9");n.html(ux.sanitize(s)).style("left",`${window.scrollX+l.left+l.width/2}px`).style("top",`${window.scrollY+l.bottom+4}px`);a.classed("hover",true)}).on("mouseout",o=>{n.transition().duration(500).style("opacity",0);zr(o.currentTarget).classed("hover",false)})},"setupToolTips");this.direction="TB";this.setAccTitle=Ka;this.getAccTitle=is;this.setAccDescription=os;this.getAccDescription=as;this.setDiagramTitle=ys;this.getDiagramTitle=ss;this.getConfig=B(()=>Mn().class,"getConfig");this.functions.push(this.setupToolTips.bind(this));this.clear();this.addRelation=this.addRelation.bind(this);this.addClassesToNamespace=this.addClassesToNamespace.bind(this);this.addNamespace=this.addNamespace.bind(this);this.popNamespace=this.popNamespace.bind(this);this.setCssClass=this.setCssClass.bind(this);this.addMembers=this.addMembers.bind(this);this.addClass=this.addClass.bind(this);this.setClassLabel=this.setClassLabel.bind(this);this.addAnnotation=this.addAnnotation.bind(this);this.addMember=this.addMember.bind(this);this.cleanupLabel=this.cleanupLabel.bind(this);this.addNote=this.addNote.bind(this);this.defineClass=this.defineClass.bind(this);this.setDirection=this.setDirection.bind(this);this.setLink=this.setLink.bind(this);this.bindFunctions=this.bindFunctions.bind(this);this.clear=this.clear.bind(this);this.setTooltip=this.setTooltip.bind(this);this.setClickEvent=this.setClickEvent.bind(this);this.setCssStyle=this.setCssStyle.bind(this)}static{B(this,"ClassDB")}splitClassNameAndType(t){const n=Ti.sanitizeText(t,Mn());let r="";let i=n;if(n.indexOf("~")>0){const o=n.split("~");i=H6(o[0]);r=H6(o[1])}return{className:i,type:r}}setClassLabel(t,n){const r=Ti.sanitizeText(t,Mn());if(n){n=H6(n)}const{className:i}=this.splitClassNameAndType(r);this.classes.get(i).label=n;this.classes.get(i).text=`${n}${this.classes.get(i).type?`<${this.classes.get(i).type}>`:""}`}addClass(t){const n=Ti.sanitizeText(t,Mn());const{className:r,type:i}=this.splitClassNameAndType(n);if(this.classes.has(r)){return}const o=Ti.sanitizeText(r,Mn());this.classes.set(o,{id:o,type:i,label:o,text:`${o}${i?`<${i}>`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:NPe+o+"-"+$On});$On++}addInterface(t,n){const r={id:`interface${this.interfaces.length}`,label:t,classId:n};this.interfaces.push(r)}setDiagramId(t){this.diagramId=t}lookUpDomId(t){const n=Ti.sanitizeText(t,Mn());if(this.classes.has(n)){const r=this.classes.get(n).domId;return this.diagramId?`${this.diagramId}-${r}`:r}throw new Error("Class not found: "+n)}clear(){this.relations=[];this.classes=new Map;this.notes=new Map;this.interfaces=[];this.functions=[];this.functions.push(this.setupToolTips.bind(this));this.namespaces=new Map;this.namespaceCounter=0;this.namespaceStack=[];this.diagramId="";this.direction="TB";Da()}getClass(t){return this.classes.get(t)}getClasses(){return this.classes}getRelations(){return this.relations}getNote(t){const n=typeof t==="number"?`note${t}`:t;return this.notes.get(n)}getNotes(){return this.notes}addRelation(t){wt.debug("Adding relation: "+JSON.stringify(t));const n=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];if(t.relation.type1===this.relationType.LOLLIPOP&&!n.includes(t.relation.type2)){this.addClass(t.id2);this.addInterface(t.id1,t.id2);t.id1=`interface${this.interfaces.length-1}`}else if(t.relation.type2===this.relationType.LOLLIPOP&&!n.includes(t.relation.type1)){this.addClass(t.id1);this.addInterface(t.id2,t.id1);t.id2=`interface${this.interfaces.length-1}`}else{this.addClass(t.id1);this.addClass(t.id2)}t.id1=this.splitClassNameAndType(t.id1).className;t.id2=this.splitClassNameAndType(t.id2).className;t.relationTitle1=Ti.sanitizeText(t.relationTitle1.trim(),Mn());t.relationTitle2=Ti.sanitizeText(t.relationTitle2.trim(),Mn());this.relations.push(t)}addAnnotation(t,n){const r=this.splitClassNameAndType(t).className;this.classes.get(r).annotations.push(n)}addMember(t,n){this.addClass(t);const r=this.splitClassNameAndType(t).className;const i=this.classes.get(r);if(typeof n==="string"){const o=n.trim();if(o.startsWith("<<")&&o.endsWith(">>")){i.annotations.push(H6(o.substring(2,o.length-2)))}else if(o.indexOf(")")>0){i.methods.push(new VOn(o,"method"))}else if(o){i.members.push(new VOn(o,"attribute"))}}}addMembers(t,n){if(Array.isArray(n)){n.reverse();n.forEach(r=>this.addMember(t,r))}}addNote(t,n){const r=this.notes.size;const i={id:`note${r}`,class:n,text:t,index:r};this.notes.set(i.id,i);return i.id}cleanupLabel(t){if(t.startsWith(":")){t=t.substring(1)}return H6(t.trim())}setCssClass(t,n){t.split(",").forEach(r=>{let i=r;if(/\d/.exec(r[0])){i=NPe+i}i=this.splitClassNameAndType(i).className;const o=this.classes.get(i);if(o){o.cssClasses+=" "+n}})}defineClass(t,n){for(const r of t){let i=this.styleClasses.get(r);if(i===void 0){i={id:r,styles:[],textStyles:[]};this.styleClasses.set(r,i)}if(n){n.forEach(o=>{if(/color/.exec(o)){const a=o.replace("fill","bgFill");i.textStyles.push(a)}i.styles.push(o)})}this.classes.forEach(o=>{if(o.cssClasses.includes(r)){o.styles.push(...n.flatMap(a=>a.split(",")))}})}}setTooltip(t,n){t.split(",").forEach(r=>{if(n!==void 0){const i=this.splitClassNameAndType(r).className;const o=this.classes.get(i);if(o){o.tooltip=H6(n)}}})}getTooltip(t,n){if(n&&this.namespaces.has(n)){return this.namespaces.get(n).classes.get(t).tooltip}return this.classes.get(t).tooltip}setLink(t,n,r){const i=Mn();t.split(",").forEach(o=>{let a=o;if(/\d/.exec(o[0])){a=NPe+a}a=this.splitClassNameAndType(a).className;const s=this.classes.get(a);if(s){s.link=Ko.formatUrl(n,i);if(i.securityLevel==="sandbox"){s.linkTarget="_top"}else if(typeof r==="string"){s.linkTarget=H6(r)}else{s.linkTarget="_blank"}}});this.setCssClass(t,"clickable")}setClickEvent(t,n,r){t.split(",").forEach(i=>{this.setClickFunc(i,n,r);const o=this.splitClassNameAndType(i).className;const a=this.classes.get(o);if(a){a.haveCallback=true}});this.setCssClass(t,"clickable")}setClickFunc(t,n,r){const i=Ti.sanitizeText(t,Mn());const o=Mn();if(o.securityLevel!=="loose"){return}if(n===void 0){return}const a=this.splitClassNameAndType(i).className;if(this.classes.has(a)){let s=[];if(typeof r==="string"){s=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let l=0;l{const l=this.lookUpDomId(a);const u=document.querySelector(`[id="${l}"]`);if(u!==null){u.addEventListener("click",()=>{Ko.runFunc(n,...s)},false)}})}}bindFunctions(t){this.functions.forEach(n=>{n(t)})}escapeHtml(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}getDirection(){return this.direction}setDirection(t){this.direction=t}static resolveQualifiedId(t,n){const r=n.at(-1);return r?`${r}.${t}`:t}static getAncestorIds(t){const n=t.split(".");const r=new Array(n.length);r[0]=n[0];for(let i=1;i0?o[a-1]:void 0;const u=a===o.length-1;const d=u&&n?n:i[a];if(!this.namespaces.has(s)){this.namespaces.set(s,this.createNamespaceNode(s,d,l,u))}else if(u){this.namespaces.get(s).explicit=true}if(l){this.linkParentChild(l,s)}}return r}popNamespace(){this.namespaceStack.pop()}getNamespace(t){return this.namespaces.get(t)}getNamespaces(){return this.namespaces}addClassesToNamespace(t,n,r){if(!this.namespaces.has(t)){return}for(const i of n){const{className:o}=this.splitClassNameAndType(i);const a=this.getClass(o);a.parent=t;this.namespaces.get(t).classes.set(o,a)}for(const i of r){const o=this.getNote(i);o.parent=t;this.namespaces.get(t).notes.set(i,o)}}setCssStyle(t,n){const r=this.classes.get(t);if(!n||!r){return}for(const i of n){if(i.includes(",")){r.styles.push(...i.split(","))}else{r.styles.push(i)}}}getArrowMarker(t){let n;switch(t){case 0:n="aggregation";break;case 1:n="extension";break;case 2:n="composition";break;case 3:n="dependency";break;case 4:n="lollipop";break;default:n="none"}return n}resolveExplicitAncestor(t){let n=t;while(n){const r=this.namespaces.get(n);if(!r){return void 0}if(r.explicit){return n}n=r.parent}return void 0}getData(){const t=[];const n=[];const r=Mn();const i=r.class?.hierarchicalNamespaces??true;for(const a of this.namespaces.values()){if(!i&&!a.explicit){continue}const s={id:a.id,label:i?a.label:a.id,isGroup:true,padding:r.class.padding??16,shape:"rect",cssStyles:[],look:r.look,parentId:i?a.parent:void 0};t.push(s)}for(const a of this.classes.values()){const s=i?a.parent:this.resolveExplicitAncestor(a.parent);const l={...a,type:void 0,isGroup:false,parentId:s,look:r.look};t.push(l)}for(const a of this.notes.values()){const s=i?a.parent:this.resolveExplicitAncestor(a.parent);const l={id:a.id,label:a.text,isGroup:false,shape:"note",padding:r.class.padding??6,cssStyles:["text-align: left","white-space: nowrap",`fill: ${r.themeVariables.noteBkgColor}`,`stroke: ${r.themeVariables.noteBorderColor}`],look:r.look,parentId:s,labelType:"markdown"};t.push(l);const u=this.classes.get(a.class)?.id;if(u){const d={id:`edgeNote${a.index}`,start:a.id,end:u,type:"normal",thickness:"normal",classes:"relation",arrowTypeStart:"none",arrowTypeEnd:"none",arrowheadStyle:"",labelStyle:[""],style:["fill: none"],pattern:"dotted",look:r.look};n.push(d)}}for(const a of this.interfaces){const s={id:a.id,label:a.label,isGroup:false,shape:"rect",cssStyles:["opacity: 0;"],look:r.look};t.push(s)}let o=0;for(const a of this.relations){o++;const s={id:VC(a.id1,a.id2,{prefix:"id",counter:o}),start:a.id1,end:a.id2,type:"normal",label:a.title,labelpos:"c",thickness:"normal",classes:"relation",arrowTypeStart:this.getArrowMarker(a.relation.type1),arrowTypeEnd:this.getArrowMarker(a.relation.type2),startLabelRight:a.relationTitle1==="none"?"":a.relationTitle1,endLabelLeft:a.relationTitle2==="none"?"":a.relationTitle2,arrowheadStyle:"",labelStyle:["display: inline-block"],style:a.style||"",pattern:a.relation.lineType==1?"dashed":"solid",look:r.look,labelType:"markdown"};n.push(s)}return{nodes:t,edges:n,other:{},config:r,direction:this.getDirection()}}};zVi=B(e=>`g.classGroup text { + fill: ${e.nodeBorder||e.classText}; + stroke: none; + font-family: ${e.fontFamily}; + font-size: 10px; + + .title { + font-weight: bolder; + } + +} + + .cluster-label text { + fill: ${e.titleColor}; + } + .cluster-label span { + color: ${e.titleColor}; + } + .cluster-label span p { + background-color: transparent; + } + + .cluster rect { + fill: ${e.clusterBkg}; + stroke: ${e.clusterBorder}; + stroke-width: 1px; + } + + .cluster text { + fill: ${e.titleColor}; + } + + .cluster span { + color: ${e.titleColor}; + } + +.nodeLabel, .edgeLabel { + color: ${e.classText}; +} + +.noteLabel .nodeLabel, .noteLabel .edgeLabel { + color: ${e.noteTextColor}; +} +.edgeLabel .label rect { + fill: ${e.mainBkg}; +} +.label text { + fill: ${e.classText}; +} + +.labelBkg { + background: ${e.mainBkg}; +} +.edgeLabel .label span { + background: ${e.mainBkg}; +} + +.classTitle { + font-weight: bolder; +} +.node rect, + .node circle, + .node ellipse, + .node polygon, + .node path { + fill: ${e.mainBkg}; + stroke: ${e.nodeBorder}; + stroke-width: ${e.strokeWidth}; + } + + +.divider { + stroke: ${e.nodeBorder}; + stroke-width: 1; +} + +g.clickable { + cursor: pointer; +} + +g.classGroup rect { + fill: ${e.mainBkg}; + stroke: ${e.nodeBorder}; +} + +g.classGroup line { + stroke: ${e.nodeBorder}; + stroke-width: 1; +} + +.classLabel .box { + stroke: none; + stroke-width: 0; + fill: ${e.mainBkg}; + opacity: 0.5; +} + +.classLabel .label { + fill: ${e.nodeBorder}; + font-size: 10px; +} + +.relation { + stroke: ${e.lineColor}; + stroke-width: ${e.strokeWidth}; + fill: none; +} + +.dashed-line{ + stroke-dasharray: 3; +} + +.dotted-line{ + stroke-dasharray: 1 2; +} + +[id$="-compositionStart"], .composition { + fill: ${e.lineColor} !important; + stroke: ${e.lineColor} !important; + stroke-width: 1; +} + +[id$="-compositionEnd"], .composition { + fill: ${e.lineColor} !important; + stroke: ${e.lineColor} !important; + stroke-width: 1; +} + +[id$="-dependencyStart"], .dependency { + fill: ${e.lineColor} !important; + stroke: ${e.lineColor} !important; + stroke-width: 1; +} + +[id$="-dependencyEnd"], .dependency { + fill: ${e.lineColor} !important; + stroke: ${e.lineColor} !important; + stroke-width: 1; +} + +[id$="-extensionStart"], .extension { + fill: transparent !important; + stroke: ${e.lineColor} !important; + stroke-width: 1; +} + +[id$="-extensionEnd"], .extension { + fill: transparent !important; + stroke: ${e.lineColor} !important; + stroke-width: 1; +} + +[id$="-aggregationStart"], .aggregation { + fill: transparent !important; + stroke: ${e.lineColor} !important; + stroke-width: 1; +} + +[id$="-aggregationEnd"], .aggregation { + fill: transparent !important; + stroke: ${e.lineColor} !important; + stroke-width: 1; +} + +[id$="-lollipopStart"], .lollipop { + fill: ${e.mainBkg} !important; + stroke: ${e.lineColor} !important; + stroke-width: 1; +} + +[id$="-lollipopEnd"], .lollipop { + fill: ${e.mainBkg} !important; + stroke: ${e.lineColor} !important; + stroke-width: 1; +} + +.edgeTerminals { + font-size: 11px; + line-height: initial; +} + +.classTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${e.textColor}; +} + +.edgeLabel[data-look="neo"] { + background-color: ${e.edgeLabelBackground}; + p { + background-color: ${e.edgeLabelBackground}; + } + rect { + opacity: 0.5; + background-color: ${e.edgeLabelBackground}; + fill: ${e.edgeLabelBackground}; + } + text-align: center; +} + ${oS()} +`,"getStyles");zPe=zVi;UVi=B((e,t="TB")=>{if(!e.doc){return t}let n=t;for(const r of e.doc){if(r.stmt==="dir"){n=r.value}}return n},"getDir");VVi=B(function(e,t){return t.db.getClasses()},"getClasses");$Vi=B(async function(e,t,n,r){wt.info("REF0:");wt.info("Drawing class diagram (v3)",t);const{securityLevel:i,state:o,layout:a}=Mn();r.db.setDiagramId(t);const s=r.db.getData();const l=G_(t,i);s.type=r.type;s.layoutAlgorithm=nS(a);s.nodeSpacing=o?.nodeSpacing||50;s.rankSpacing=o?.rankSpacing||50;s.markers=["aggregation","extension","composition","dependency","lollipop"];s.diagramId=t;await B_(s,l);const u=8;Ko.insertTitle(l,"classDiagramTitleText",o?.titleTopMargin??25,r.db.getDiagramTitle());Ex(l,u,"classDiagram",o?.useMaxWidth??true)},"draw");UPe={getClasses:VVi,draw:$Vi,getDir:UVi}});var GOn={};Oo(GOn,{diagram:()=>GVi});var GVi;var HOn=Ce(()=>{xlt();aS();lv();Cx();Tx();sv();yx();kg();Eg();K0();Sg();Np();Jh();nl();Ta();Aa();Yo();GVi={parser:OPe,get db(){return new BPe},renderer:UPe,styles:zPe,init:B(e=>{if(!e.class){e.class={}}e.class.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")}});var WOn={};Oo(WOn,{diagram:()=>HVi});var HVi;var YOn=Ce(()=>{xlt();aS();lv();Cx();Tx();sv();yx();kg();Eg();K0();Sg();Np();Jh();nl();Ta();Aa();Yo();HVi={parser:OPe,get db(){return new BPe},renderer:UPe,styles:zPe,init:B(e=>{if(!e.class){e.class={}}e.class.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")}});function GPe(e="",t=0,n="",r=Elt){const i=n!==null&&n.length>0?`${r}${n}`:"";return`${c$i}-${e}${i}-${t}`}function vre(e,t,n){if(!t.id||t.id===""||t.id===""){return}if(t.cssClasses){if(!Array.isArray(t.cssCompiledStyles)){t.cssCompiledStyles=[]}t.cssClasses.split(" ").forEach(i=>{const o=n.get(i);if(o){t.cssCompiledStyles=[...t.cssCompiledStyles??[],...o.styles]}})}const r=e.find(i=>i.id===t.id);if(r){Object.assign(r,t)}else{e.push(t)}}function f5n(e){return e?.classes?.join(" ")??""}function h5n(e){return e?.styles??[]}var Tlt,HPe,WVi,e5n,qOn,EH,wH,wlt,YVi,qVi,XVi,Tre,t5n,n5n,r5n,i5n,o5n,a5n,vlt,_lt,jVi,KVi,XOn,jOn,ZVi,JVi,wre,QVi,e$i,s5n,t$i,n$i,r$i,i$i,o$i,a$i,s$i,l$i,l5n,c5n,c$i,Elt,u$i,KOn,u5n,d$i,f$i,d5n,$Pe,ED,h$i,ZOn,_re,p$i,pb,JOn,QOn,VPe,hP,m$i,WPe;var Clt=Ce(()=>{lv();Cx();Tx();sv();nl();Ta();Aa();Yo();ks();KV();Tlt=function(){var e=B(function(oe,se,re,ce){for(re=re||{},ce=oe.length;ce--;re[oe[ce]]=se);return re},"o"),t=[1,2],n=[1,3],r=[1,4],i=[2,4],o=[1,9],a=[1,11],s=[1,16],l=[1,17],u=[1,18],d=[1,19],f=[1,33],h=[1,20],m=[1,21],g=[1,22],x=[1,23],w=[1,24],_=[1,26],C=[1,27],A=[1,28],P=[1,29],L=[1,30],I=[1,31],N=[1,32],O=[1,35],z=[1,36],U=[1,37],W=[1,38],H=[1,34],$=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],K=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],X=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57];var j={trace:B(function oe(){},"trace"),yy:{},symbols_:{"error":2,"start":3,"SPACE":4,"NL":5,"SD":6,"document":7,"line":8,"statement":9,"classDefStatement":10,"styleStatement":11,"cssClassStatement":12,"idStatement":13,"DESCR":14,"-->":15,"HIDE_EMPTY":16,"scale":17,"WIDTH":18,"COMPOSIT_STATE":19,"STRUCT_START":20,"STRUCT_STOP":21,"STATE_DESCR":22,"AS":23,"ID":24,"FORK":25,"JOIN":26,"CHOICE":27,"CONCURRENT":28,"note":29,"notePosition":30,"NOTE_TEXT":31,"direction":32,"acc_title":33,"acc_title_value":34,"acc_descr":35,"acc_descr_value":36,"acc_descr_multiline_value":37,"CLICK":38,"STRING":39,"HREF":40,"classDef":41,"CLASSDEF_ID":42,"CLASSDEF_STYLEOPTS":43,"DEFAULT":44,"style":45,"STYLE_IDS":46,"STYLEDEF_STYLEOPTS":47,"class":48,"CLASSENTITY_IDS":49,"STYLECLASS":50,"direction_tb":51,"direction_bt":52,"direction_rl":53,"direction_lr":54,"eol":55,";":56,"EDGE_STATE":57,"STYLE_SEPARATOR":58,"left_of":59,"right_of":60,"$accept":0,"$end":1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:B(function oe(se,re,ce,ue,xe,be,Ie){var he=be.length-1;switch(xe){case 3:ue.setRootDoc(be[he]);return be[he];break;case 4:this.$=[];break;case 5:if(be[he]!="nl"){be[he-1].push(be[he]);this.$=be[he-1]}break;case 6:case 7:this.$=be[he];break;case 8:this.$="nl";break;case 12:this.$=be[he];break;case 13:const Le=be[he-1];Le.description=ue.trimColon(be[he]);this.$=Le;break;case 14:this.$={stmt:"relation",state1:be[he-2],state2:be[he]};break;case 15:const $e=ue.trimColon(be[he]);this.$={stmt:"relation",state1:be[he-3],state2:be[he-1],description:$e};break;case 19:this.$={stmt:"state",id:be[he-3],type:"default",description:"",doc:be[he-1]};break;case 20:var ve=be[he];var ge=be[he-2].trim();if(be[he].match(":")){var Ve=be[he].split(":");ve=Ve[0];ge=[ge,Ve[1]]}this.$={stmt:"state",id:ve,type:"default",description:ge};break;case 21:this.$={stmt:"state",id:be[he-3],type:"default",description:be[he-5],doc:be[he-1]};break;case 22:this.$={stmt:"state",id:be[he],type:"fork"};break;case 23:this.$={stmt:"state",id:be[he],type:"join"};break;case 24:this.$={stmt:"state",id:be[he],type:"choice"};break;case 25:this.$={stmt:"state",id:ue.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:be[he-1].trim(),note:{position:be[he-2].trim(),text:be[he].trim()}};break;case 29:this.$=be[he].trim();ue.setAccTitle(this.$);break;case 30:case 31:this.$=be[he].trim();ue.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:be[he-3],url:be[he-2],tooltip:be[he-1]};break;case 33:this.$={stmt:"click",id:be[he-3],url:be[he-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:be[he-1].trim(),classes:be[he].trim()};break;case 36:this.$={stmt:"style",id:be[he-1].trim(),styleClass:be[he].trim()};break;case 37:this.$={stmt:"applyClass",id:be[he-1].trim(),styleClass:be[he].trim()};break;case 38:ue.setDirection("TB");this.$={stmt:"dir",value:"TB"};break;case 39:ue.setDirection("BT");this.$={stmt:"dir",value:"BT"};break;case 40:ue.setDirection("RL");this.$={stmt:"dir",value:"RL"};break;case 41:ue.setDirection("LR");this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:be[he].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:be[he-2].trim(),classes:[be[he].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:be[he-2].trim(),classes:[be[he].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:t,5:n,6:r},{1:[3]},{3:5,4:t,5:n,6:r},{3:6,4:t,5:n,6:r},e([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:a,8:8,9:10,10:12,11:13,12:14,13:15,16:s,17:l,19:u,22:d,24:f,25:h,26:m,27:g,28:x,29:w,32:25,33:_,35:C,37:A,38:P,41:L,45:I,48:N,51:O,52:z,53:U,54:W,57:H},e($,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:s,17:l,19:u,22:d,24:f,25:h,26:m,27:g,28:x,29:w,32:25,33:_,35:C,37:A,38:P,41:L,45:I,48:N,51:O,52:z,53:U,54:W,57:H},e($,[2,7]),e($,[2,8]),e($,[2,9]),e($,[2,10]),e($,[2,11]),e($,[2,12],{14:[1,40],15:[1,41]}),e($,[2,16]),{18:[1,42]},e($,[2,18],{20:[1,43]}),{23:[1,44]},e($,[2,22]),e($,[2,23]),e($,[2,24]),e($,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},e($,[2,28]),{34:[1,49]},{36:[1,50]},e($,[2,31]),{13:51,24:f,57:H},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},e(K,[2,44],{58:[1,56]}),e(K,[2,45],{58:[1,57]}),e($,[2,38]),e($,[2,39]),e($,[2,40]),e($,[2,41]),e($,[2,6]),e($,[2,13]),{13:58,24:f,57:H},e($,[2,17]),e(X,i,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},e($,[2,29]),e($,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},e($,[2,14],{14:[1,71]}),{4:o,5:a,8:8,9:10,10:12,11:13,12:14,13:15,16:s,17:l,19:u,21:[1,72],22:d,24:f,25:h,26:m,27:g,28:x,29:w,32:25,33:_,35:C,37:A,38:P,41:L,45:I,48:N,51:O,52:z,53:U,54:W,57:H},e($,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},e($,[2,34]),e($,[2,35]),e($,[2,36]),e($,[2,37]),e(K,[2,46]),e(K,[2,47]),e($,[2,15]),e($,[2,19]),e(X,i,{7:78}),e($,[2,26]),e($,[2,27]),{5:[1,79]},{5:[1,80]},{4:o,5:a,8:8,9:10,10:12,11:13,12:14,13:15,16:s,17:l,19:u,21:[1,81],22:d,24:f,25:h,26:m,27:g,28:x,29:w,32:25,33:_,35:C,37:A,38:P,41:L,45:I,48:N,51:O,52:z,53:U,54:W,57:H},e($,[2,32]),e($,[2,33]),e($,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:B(function oe(se,re){if(re.recoverable){this.trace(se)}else{var ce=new Error(se);ce.hash=re;throw ce}},"parseError"),parse:B(function oe(se){var re=this,ce=[0],ue=[],xe=[null],be=[],Ie=this.table,he="",ve=0,ge=0,Ve=0,Le=2,$e=1;var Ee=be.slice.call(arguments,1);var tt=Object.create(this.lexer);var yt={yy:{}};for(var mt in this.yy){if(Object.prototype.hasOwnProperty.call(this.yy,mt)){yt.yy[mt]=this.yy[mt]}}tt.setInput(se,yt.yy);yt.yy.lexer=tt;yt.yy.parser=this;if(typeof tt.yylloc=="undefined"){tt.yylloc={}}var ct=tt.yylloc;be.push(ct);var Ge=tt.options&&tt.options.ranges;if(typeof yt.yy.parseError==="function"){this.parseError=yt.yy.parseError}else{this.parseError=Object.getPrototypeOf(this).parseError}function it(Ae){ce.length=ce.length-2*Ae;xe.length=xe.length-Ae;be.length=be.length-Ae}B(it,"popStack");function bt(){var Ae;Ae=ue.pop()||tt.lex()||$e;if(typeof Ae!=="number"){if(Ae instanceof Array){ue=Ae;Ae=ue.pop()}Ae=re.symbols_[Ae]||Ae}return Ae}B(bt,"lex");var He,Je,Te,we,Ze,Be,qe={},Qe,ze,Me,ye;while(true){Te=ce[ce.length-1];if(this.defaultActions[Te]){we=this.defaultActions[Te]}else{if(He===null||typeof He=="undefined"){He=bt()}we=Ie[Te]&&Ie[Te][He]}if(typeof we==="undefined"||!we.length||!we[0]){var Ne="";ye=[];for(Qe in Ie[Te]){if(this.terminals_[Qe]&&Qe>Le){ye.push("'"+this.terminals_[Qe]+"'")}}if(tt.showPosition){Ne="Parse error on line "+(ve+1)+":\n"+tt.showPosition()+"\nExpecting "+ye.join(", ")+", got '"+(this.terminals_[He]||He)+"'"}else{Ne="Parse error on line "+(ve+1)+": Unexpected "+(He==$e?"end of input":"'"+(this.terminals_[He]||He)+"'")}this.parseError(Ne,{text:tt.match,token:this.terminals_[He]||He,line:tt.yylineno,loc:ct,expected:ye})}if(we[0]instanceof Array&&we.length>1){throw new Error("Parse Error: multiple actions possible at state: "+Te+", token: "+He)}switch(we[0]){case 1:ce.push(He);xe.push(tt.yytext);be.push(tt.yylloc);ce.push(we[1]);He=null;if(!Je){ge=tt.yyleng;he=tt.yytext;ve=tt.yylineno;ct=tt.yylloc;if(Ve>0){Ve--}}else{He=Je;Je=null}break;case 2:ze=this.productions_[we[1]][1];qe.$=xe[xe.length-ze];qe._$={first_line:be[be.length-(ze||1)].first_line,last_line:be[be.length-1].last_line,first_column:be[be.length-(ze||1)].first_column,last_column:be[be.length-1].last_column};if(Ge){qe._$.range=[be[be.length-(ze||1)].range[0],be[be.length-1].range[1]]}Be=this.performAction.apply(qe,[he,ge,ve,yt.yy,we[1],xe,be].concat(Ee));if(typeof Be!=="undefined"){return Be}if(ze){ce=ce.slice(0,-1*ze*2);xe=xe.slice(0,-1*ze);be=be.slice(0,-1*ze)}ce.push(this.productions_[we[1]][0]);xe.push(qe.$);be.push(qe._$);Me=Ie[ce[ce.length-2]][ce[ce.length-1]];ce.push(Me);break;case 3:return true}}return true},"parse")};var te=function(){var oe={EOF:1,parseError:B(function se(re,ce){if(this.yy.parser){this.yy.parser.parseError(re,ce)}else{throw new Error(re)}},"parseError"),setInput:B(function(se,re){this.yy=re||this.yy||{};this._input=se;this._more=this._backtrack=this.done=false;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};if(this.options.ranges){this.yylloc.range=[0,0]}this.offset=0;return this},"setInput"),input:B(function(){var se=this._input[0];this.yytext+=se;this.yyleng++;this.offset++;this.match+=se;this.matched+=se;var re=se.match(/(?:\r\n?|\n).*/g);if(re){this.yylineno++;this.yylloc.last_line++}else{this.yylloc.last_column++}if(this.options.ranges){this.yylloc.range[1]++}this._input=this._input.slice(1);return se},"input"),unput:B(function(se){var re=se.length;var ce=se.split(/(?:\r\n?|\n)/g);this._input=se+this._input;this.yytext=this.yytext.substr(0,this.yytext.length-re);this.offset-=re;var ue=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1);this.matched=this.matched.substr(0,this.matched.length-1);if(ce.length-1){this.yylineno-=ce.length-1}var xe=this.yylloc.range;this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:ce?(ce.length===ue.length?this.yylloc.first_column:0)+ue[ue.length-ce.length].length-ce[0].length:this.yylloc.first_column-re};if(this.options.ranges){this.yylloc.range=[xe[0],xe[0]+this.yyleng-re]}this.yyleng=this.yytext.length;return this},"unput"),more:B(function(){this._more=true;return this},"more"),reject:B(function(){if(this.options.backtrack_lexer){this._backtrack=true}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}return this},"reject"),less:B(function(se){this.unput(this.match.slice(se))},"less"),pastInput:B(function(){var se=this.matched.substr(0,this.matched.length-this.match.length);return(se.length>20?"...":"")+se.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:B(function(){var se=this.match;if(se.length<20){se+=this._input.substr(0,20-se.length)}return(se.substr(0,20)+(se.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:B(function(){var se=this.pastInput();var re=new Array(se.length+1).join("-");return se+this.upcomingInput()+"\n"+re+"^"},"showPosition"),test_match:B(function(se,re){var ce,ue,xe;if(this.options.backtrack_lexer){xe={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done};if(this.options.ranges){xe.yylloc.range=this.yylloc.range.slice(0)}}ue=se[0].match(/(?:\r\n?|\n).*/g);if(ue){this.yylineno+=ue.length}this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:ue?ue[ue.length-1].length-ue[ue.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+se[0].length};this.yytext+=se[0];this.match+=se[0];this.matches=se;this.yyleng=this.yytext.length;if(this.options.ranges){this.yylloc.range=[this.offset,this.offset+=this.yyleng]}this._more=false;this._backtrack=false;this._input=this._input.slice(se[0].length);this.matched+=se[0];ce=this.performAction.call(this,this.yy,this,re,this.conditionStack[this.conditionStack.length-1]);if(this.done&&this._input){this.done=false}if(ce){return ce}else if(this._backtrack){for(var be in xe){this[be]=xe[be]}return false}return false},"test_match"),next:B(function(){if(this.done){return this.EOF}if(!this._input){this.done=true}var se,re,ce,ue;if(!this._more){this.yytext="";this.match=""}var xe=this._currentRules();for(var be=0;bere[0].length)){re=ce;ue=be;if(this.options.backtrack_lexer){se=this.test_match(ce,xe[be]);if(se!==false){return se}else if(this._backtrack){re=false;continue}else{return false}}else if(!this.options.flex){break}}}if(re){se=this.test_match(re,xe[ue]);if(se!==false){return se}return false}if(this._input===""){return this.EOF}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}},"next"),lex:B(function se(){var re=this.next();if(re){return re}else{return this.lex()}},"lex"),begin:B(function se(re){this.conditionStack.push(re)},"begin"),popState:B(function se(){var re=this.conditionStack.length-1;if(re>0){return this.conditionStack.pop()}else{return this.conditionStack[0]}},"popState"),_currentRules:B(function se(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules}else{return this.conditions["INITIAL"].rules}},"_currentRules"),topState:B(function se(re){re=this.conditionStack.length-1-Math.abs(re||0);if(re>=0){return this.conditionStack[re]}else{return"INITIAL"}},"topState"),pushState:B(function se(re){this.begin(re)},"pushState"),stateStackSize:B(function se(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":true},performAction:B(function se(re,ce,ue,xe){function be(){const he=ce.yytext.indexOf("%%");if(he===0){return false}if(he>0){const ve=ce.yytext.slice(0,he);const ge=ce.yytext.slice(he);if(ge){re.lexer.unput(ge)}ce.yytext=ve}return true}B(be,"processId");var Ie=xe;switch(ue){case 0:return 38;break;case 1:return 40;break;case 2:return 39;break;case 3:return 44;break;case 4:return 51;break;case 5:return 52;break;case 6:return 53;break;case 7:return 54;break;case 8:return 5;break;case 9:break;case 10:break;case 11:break;case 12:break;case 13:this.pushState("SCALE");return 17;break;case 14:return 18;break;case 15:this.popState();break;case 16:this.begin("acc_title");return 33;break;case 17:this.popState();return"acc_title_value";break;case 18:this.begin("acc_descr");return 35;break;case 19:this.popState();return"acc_descr_value";break;case 20:this.begin("acc_descr_multiline");break;case 21:this.popState();break;case 22:return"acc_descr_multiline_value";break;case 23:this.pushState("CLASSDEF");return 41;break;case 24:this.popState();this.pushState("CLASSDEFID");return"DEFAULT_CLASSDEF_ID";break;case 25:this.popState();this.pushState("CLASSDEFID");return 42;break;case 26:this.popState();return 43;break;case 27:this.pushState("CLASS");return 48;break;case 28:this.popState();this.pushState("CLASS_STYLE");return 49;break;case 29:this.popState();return 50;break;case 30:this.pushState("STYLE");return 45;break;case 31:this.popState();this.pushState("STYLEDEF_STYLES");return 46;break;case 32:this.popState();return 47;break;case 33:this.pushState("SCALE");return 17;break;case 34:return 18;break;case 35:this.popState();break;case 36:this.pushState("STATE");break;case 37:this.popState();ce.yytext=ce.yytext.slice(0,-8).trim();return 25;break;case 38:this.popState();ce.yytext=ce.yytext.slice(0,-8).trim();return 26;break;case 39:this.popState();ce.yytext=ce.yytext.slice(0,-10).trim();return 27;break;case 40:this.popState();ce.yytext=ce.yytext.slice(0,-8).trim();return 25;break;case 41:this.popState();ce.yytext=ce.yytext.slice(0,-8).trim();return 26;break;case 42:this.popState();ce.yytext=ce.yytext.slice(0,-10).trim();return 27;break;case 43:return 51;break;case 44:return 52;break;case 45:return 53;break;case 46:return 54;break;case 47:this.pushState("STATE_STRING");break;case 48:this.pushState("STATE_ID");return"AS";break;case 49:if(!be())return;this.popState();return"ID";break;case 50:this.popState();break;case 51:return"STATE_DESCR";break;case 52:throw new Error('Error: State name must be a single word. Found: "'+ce.yytext.trim()+'"');break;case 53:return 19;break;case 54:this.popState();break;case 55:this.popState();this.pushState("struct");return 20;break;case 56:this.popState();return 21;break;case 57:break;case 58:this.begin("NOTE");return 29;break;case 59:this.popState();this.pushState("NOTE_ID");return 59;break;case 60:this.popState();this.pushState("NOTE_ID");return 60;break;case 61:this.popState();this.pushState("FLOATING_NOTE");break;case 62:this.popState();this.pushState("FLOATING_NOTE_ID");return"AS";break;case 63:break;case 64:return"NOTE_TEXT";break;case 65:if(!be())return;this.popState();return"ID";break;case 66:if(!be())return;this.popState();this.pushState("NOTE_TEXT");return 24;break;case 67:this.popState();ce.yytext=ce.yytext.substr(2).trim();return 31;break;case 68:this.popState();ce.yytext=ce.yytext.slice(0,-8).trim();return 31;break;case 69:return 6;break;case 70:return 6;break;case 71:return 16;break;case 72:return 57;break;case 73:if(!be())return;return 24;break;case 74:ce.yytext=ce.yytext.trim();return 14;break;case 75:return 15;break;case 76:return 28;break;case 77:return 58;break;case 78:return 5;break;case 79:return"INVALID";break}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{"LINE":{"rules":[10,11,12],"inclusive":false},"struct":{"rules":[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],"inclusive":false},"FLOATING_NOTE_ID":{"rules":[65],"inclusive":false},"FLOATING_NOTE":{"rules":[62,63,64],"inclusive":false},"NOTE_TEXT":{"rules":[67,68],"inclusive":false},"NOTE_ID":{"rules":[66],"inclusive":false},"NOTE":{"rules":[59,60,61],"inclusive":false},"STYLEDEF_STYLEOPTS":{"rules":[],"inclusive":false},"STYLEDEF_STYLES":{"rules":[32],"inclusive":false},"STYLE_IDS":{"rules":[],"inclusive":false},"STYLE":{"rules":[31],"inclusive":false},"CLASS_STYLE":{"rules":[29],"inclusive":false},"CLASS":{"rules":[28],"inclusive":false},"CLASSDEFID":{"rules":[26],"inclusive":false},"CLASSDEF":{"rules":[24,25],"inclusive":false},"acc_descr_multiline":{"rules":[21,22],"inclusive":false},"acc_descr":{"rules":[19],"inclusive":false},"acc_title":{"rules":[17],"inclusive":false},"SCALE":{"rules":[14,15,34,35],"inclusive":false},"ALIAS":{"rules":[],"inclusive":false},"STATE_ID":{"rules":[49],"inclusive":false},"STATE_STRING":{"rules":[50,51],"inclusive":false},"FORK_STATE":{"rules":[],"inclusive":false},"STATE":{"rules":[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],"inclusive":false},"ID":{"rules":[10,11,12],"inclusive":false},"INITIAL":{"rules":[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],"inclusive":true}}};return oe}();j.lexer=te;function J(){this.yy={}}B(J,"Parser");J.prototype=j;j.Parser=J;return new J}();Tlt.parser=Tlt;HPe=Tlt;WVi="TB";e5n="TB";qOn="dir";EH="state";wH="root";wlt="relation";YVi="classDef";qVi="style";XVi="applyClass";Tre="default";t5n="divider";n5n="fill:none";r5n="fill: #333";i5n="c";o5n="markdown";a5n="normal";vlt="rect";_lt="rectWithTitle";jVi="stateStart";KVi="stateEnd";XOn="divider";jOn="roundedWithTitle";ZVi="note";JVi="noteGroup";wre="statediagram";QVi="state";e$i=`${wre}-${QVi}`;s5n="transition";t$i="note";n$i="note-edge";r$i=`${s5n} ${n$i}`;i$i=`${wre}-${t$i}`;o$i="cluster";a$i=`${wre}-${o$i}`;s$i="cluster-alt";l$i=`${wre}-${s$i}`;l5n="parent";c5n="note";c$i="state";Elt="----";u$i=`${Elt}${c5n}`;KOn=`${Elt}${l5n}`;u5n=B((e,t=e5n)=>{if(!e.doc){return t}let n=t;for(const r of e.doc){if(r.stmt==="dir"){n=r.value}}return n},"getDir");d$i=B(function(e,t){return t.db.getClasses()},"getClasses");f$i=B(async function(e,t,n,r){wt.info("REF0:");wt.info("Drawing state diagram (v2)",t);const{securityLevel:i,state:o,layout:a}=Mn();r.db.extract(r.db.getRootDocV2());const s=r.db.getData();const l=G_(t,i);s.type=r.type;s.layoutAlgorithm=a;s.nodeSpacing=o?.nodeSpacing||50;s.rankSpacing=o?.rankSpacing||50;const u=Mn();if(u.look==="neo"){s.markers=["barbNeo"]}else{s.markers=["barb"]}s.diagramId=t;await B_(s,l);const d=8;try{const f=typeof r.db.getLinks==="function"?r.db.getLinks():new Map;f.forEach((h,m)=>{const g=typeof m==="string"?m:typeof m?.id==="string"?m.id:"";const x=s.nodes.find(L=>L.id===g);if(!g){wt.warn("\u26A0\uFE0F Invalid or missing stateId from key:",JSON.stringify(m));return}const w=l.node()?.querySelectorAll("g.node, g.rough-node");let _;w?.forEach(L=>{const I=L.textContent?.trim();if(L.id===x?.domId||I===g){_=L}});if(!_){wt.warn("\u26A0\uFE0F Could not find node matching text:",g);return}const C=_.parentNode;if(!C){wt.warn("\u26A0\uFE0F Node has no parent, cannot wrap:",g);return}const A=document.createElementNS("http://www.w3.org/2000/svg","a");const P=h.url.replace(/^"+|"+$/g,"");A.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",P);A.setAttribute("target","_blank");if(h.tooltip){const L=h.tooltip.replace(/^"+|"+$/g,"");A.setAttribute("title",L);_.setAttribute("title",L)}C.replaceChild(A,_);A.appendChild(_);wt.info("\u{1F517} Wrapped node in
    tag for:",g,h.url)})}catch(f){wt.error("\u274C Error injecting clickable links:",f)}Ko.insertTitle(l,"statediagramTitleText",o?.titleTopMargin??25,r.db.getDiagramTitle());Ex(l,d,wre,o?.useMaxWidth??true)},"draw");d5n={getClasses:d$i,draw:f$i,getDir:u5n};$Pe=new Map;ED=0;B(GPe,"stateDomId");h$i=B((e,t,n,r,i,o,a,s)=>{wt.trace("items",t);t.forEach(l=>{switch(l.stmt){case EH:_re(e,l,n,r,i,o,a,s);break;case Tre:_re(e,l,n,r,i,o,a,s);break;case wlt:{_re(e,l.state1,n,r,i,o,a,s);_re(e,l.state2,n,r,i,o,a,s);const u=a==="neo";const d={id:"edge"+ED,start:l.state1.id,end:l.state2.id,arrowhead:"normal",arrowTypeEnd:u?"arrow_barb_neo":"arrow_barb",style:n5n,labelStyle:"",label:Ti.sanitizeText(l.description??"",Mn()),arrowheadStyle:r5n,labelpos:i5n,labelType:o5n,thickness:a5n,classes:s5n,look:a};i.push(d);ED++}break}})},"setupDoc");ZOn=B((e,t=e5n)=>{let n=t;if(e.doc){for(const r of e.doc){if(r.stmt==="dir"){n=r.value}}}return n},"getDir");B(vre,"insertOrUpdateNode");B(f5n,"getClassesFromDbInfo");B(h5n,"getStylesFromDbInfo");_re=B((e,t,n,r,i,o,a,s)=>{const l=t.id;const u=n.get(l);const d=f5n(u);const f=h5n(u);const h=Mn();wt.info("dataFetcher parsedItem",t,u,f);if(l!=="root"){let m=vlt;if(t.start===true){m=jVi}else if(t.start===false){m=KVi}if(t.type!==Tre){m=t.type}if(!$Pe.get(l)){$Pe.set(l,{id:l,shape:m,description:Ti.sanitizeText(l,h),cssClasses:`${d} ${e$i}`,cssStyles:f})}const g=$Pe.get(l);if(t.description){if(Array.isArray(g.description)){g.shape=_lt;g.description.push(t.description)}else{if(g.description?.length&&g.description.length>0){g.shape=_lt;if(g.description===l){g.description=[t.description]}else{g.description=[g.description,t.description]}}else{g.shape=vlt;g.description=t.description}}g.description=Ti.sanitizeTextOrArray(g.description,h)}if(g.description?.length===1&&g.shape===_lt){if(g.type==="group"){g.shape=jOn}else{g.shape=vlt}}if(!g.type&&t.doc){wt.info("Setting cluster for XCX",l,ZOn(t));g.type="group";g.isGroup=true;g.dir=ZOn(t);g.explicitDir=t.doc.some(w=>w.stmt==="dir");g.shape=t.type===t5n?XOn:jOn;g.cssClasses=`${g.cssClasses} ${a$i} ${o?l$i:""}`}const x={labelStyle:"",shape:g.shape,label:g.description,cssClasses:g.cssClasses,cssCompiledStyles:[],cssStyles:g.cssStyles,id:l,dir:g.dir,domId:GPe(l,ED),type:g.type,isGroup:g.type==="group",padding:8,rx:10,ry:10,look:a,labelType:"markdown"};if(x.shape===XOn){x.label=""}if(e&&e.id!=="root"){wt.trace("Setting node ",l," to be child of its parent ",e.id);x.parentId=e.id}x.centerLabel=true;if(t.note){const w={labelStyle:"",shape:ZVi,label:t.note.text,labelType:"markdown",cssClasses:i$i,cssStyles:[],cssCompiledStyles:[],id:l+u$i+"-"+ED,domId:GPe(l,ED,c5n),type:g.type,isGroup:g.type==="group",padding:h.flowchart?.padding,look:a,position:t.note.position};const _=l+KOn;const C={labelStyle:"",shape:JVi,label:t.note.text,cssClasses:g.cssClasses,cssStyles:[],id:l+KOn,domId:GPe(l,ED,l5n),type:"group",isGroup:true,padding:16,look:a,position:t.note.position};ED++;C.id=_;w.parentId=_;vre(r,C,s);vre(r,w,s);vre(r,x,s);let A=l;let P=w.id;if(t.note.position==="left of"){A=w.id;P=l}i.push({id:A+"-"+P,start:A,end:P,arrowhead:"none",arrowTypeEnd:"",style:n5n,labelStyle:"",classes:r$i,arrowheadStyle:r5n,labelpos:i5n,labelType:o5n,thickness:a5n,look:a})}else{vre(r,x,s)}}if(t.doc){wt.trace("Adding nodes children ");h$i(t,t.doc,n,r,i,!o,a,s)}},"dataFetcher");p$i=B(()=>{$Pe.clear();ED=0},"reset");pb={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","};JOn=B(()=>new Map,"newClassesList");QOn=B(()=>({relations:[],states:new Map,documents:{}}),"newDoc");VPe=B(e=>JSON.parse(JSON.stringify(e)),"clone");hP=class{constructor(e){this.version=e;this.nodes=[];this.edges=[];this.rootDoc=[];this.classes=JOn();this.documents={root:QOn()};this.currentDocument=this.documents.root;this.startEndCount=0;this.dividerCnt=0;this.links=new Map;this.funs=[];this.getAccTitle=is;this.setAccTitle=Ka;this.getAccDescription=as;this.setAccDescription=os;this.setDiagramTitle=ys;this.getDiagramTitle=ss;this.clear();this.setRootDoc=this.setRootDoc.bind(this);this.getDividerId=this.getDividerId.bind(this);this.setDirection=this.setDirection.bind(this);this.trimColon=this.trimColon.bind(this);this.bindFunctions=this.bindFunctions.bind(this)}static{B(this,"StateDB")}static{this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3}}extract(e){this.clear(true);for(const r of Array.isArray(e)?e:e.doc){switch(r.stmt){case EH:this.addState(r.id.trim(),r.type,r.doc,r.description,r.note);break;case wlt:this.addRelation(r.state1,r.state2,r.description);break;case YVi:this.addStyleClass(r.id.trim(),r.classes);break;case qVi:this.handleStyleDef(r);break;case XVi:this.setCssClass(r.id.trim(),r.styleClass);break;case"click":this.addLink(r.id,r.url,r.tooltip);break}}const t=this.getStates();const n=Mn();p$i();_re(void 0,this.getRootDocV2(),t,this.nodes,this.edges,true,n.look,this.classes);for(const r of this.nodes){if(!Array.isArray(r.label)){continue}r.description=r.label.slice(1);if(r.isGroup&&r.description.length>0){throw new Error(`Group nodes can only have label. Remove the additional description for node [${r.id}]`)}r.label=r.label[0]}}handleStyleDef(e){const t=e.id.trim().split(",");const n=e.styleClass.split(",");for(const r of t){let i=this.getState(r);if(!i){const o=r.trim();this.addState(o);i=this.getState(o)}if(i){i.styles=n.map(o=>o.replace(/;/g,"")?.trim())}}}setRootDoc(e){wt.info("Setting root doc",e);this.rootDoc=e;if(this.version===1){this.extract(e)}else{this.extract(this.getRootDocV2())}}docTranslator(e,t,n){if(t.stmt===wlt){this.docTranslator(e,t.state1,true);this.docTranslator(e,t.state2,false);return}if(t.stmt===EH){if(t.id===pb.START_NODE){t.id=e.id+(n?"_start":"_end");t.start=n}else{t.id=t.id.trim()}}if(t.stmt!==wH&&t.stmt!==EH||!t.doc){return}const r=[];let i=[];for(const o of t.doc){if(o.type===t5n){const a=VPe(o);a.doc=VPe(i);r.push(a);i=[]}else{i.push(o)}}if(r.length>0&&i.length>0){const o={stmt:EH,id:Uje(),type:"divider",doc:VPe(i)};r.push(VPe(o));t.doc=r}t.doc.forEach(o=>this.docTranslator(t,o,true))}getRootDocV2(){this.docTranslator({id:wH,stmt:wH},{id:wH,stmt:wH,doc:this.rootDoc},true);return{id:wH,doc:this.rootDoc}}addState(e,t=Tre,n=void 0,r=void 0,i=void 0,o=void 0,a=void 0,s=void 0){const l=e?.trim();if(!this.currentDocument.states.has(l)){wt.info("Adding state ",l,r);this.currentDocument.states.set(l,{stmt:EH,id:l,descriptions:[],type:t,doc:n,note:i,classes:[],styles:[],textStyles:[]})}else{const u=this.currentDocument.states.get(l);if(!u){throw new Error(`State not found: ${l}`)}if(!u.doc){u.doc=n}if(!u.type){u.type=t}}if(r){wt.info("Setting state description",l,r);const u=Array.isArray(r)?r:[r];u.forEach(d=>this.addDescription(l,d.trim()))}if(i){const u=this.currentDocument.states.get(l);if(!u){throw new Error(`State not found: ${l}`)}u.note=i;u.note.text=Ti.sanitizeText(u.note.text,Mn())}if(o){wt.info("Setting state classes",l,o);const u=Array.isArray(o)?o:[o];u.forEach(d=>this.setCssClass(l,d.trim()))}if(a){wt.info("Setting state styles",l,a);const u=Array.isArray(a)?a:[a];u.forEach(d=>this.setStyle(l,d.trim()))}if(s){wt.info("Setting state styles",l,a);const u=Array.isArray(s)?s:[s];u.forEach(d=>this.setTextStyle(l,d.trim()))}}clear(e){this.nodes=[];this.edges=[];this.funs=[this.setupToolTips.bind(this)];this.documents={root:QOn()};this.currentDocument=this.documents.root;this.startEndCount=0;this.classes=JOn();if(!e){this.links=new Map;Da()}}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){wt.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,t,n){this.links.set(e,{url:t,tooltip:n});wt.warn("Adding link",e,t,n)}getLinks(){return this.links}startIdIfNeeded(e=""){if(e===pb.START_NODE){this.startEndCount++;return`${pb.START_TYPE}${this.startEndCount}`}return e}startTypeIfNeeded(e="",t=Tre){return e===pb.START_NODE?pb.START_TYPE:t}endIdIfNeeded(e=""){if(e===pb.END_NODE){this.startEndCount++;return`${pb.END_TYPE}${this.startEndCount}`}return e}endTypeIfNeeded(e="",t=Tre){return e===pb.END_NODE?pb.END_TYPE:t}addRelationObjs(e,t,n=""){const r=this.startIdIfNeeded(e.id.trim());const i=this.startTypeIfNeeded(e.id.trim(),e.type);const o=this.startIdIfNeeded(t.id.trim());const a=this.startTypeIfNeeded(t.id.trim(),t.type);this.addState(r,i,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles);this.addState(o,a,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles);this.currentDocument.relations.push({id1:r,id2:o,relationTitle:Ti.sanitizeText(n,Mn())})}addRelation(e,t,n){if(typeof e==="object"&&typeof t==="object"){this.addRelationObjs(e,t,n)}else if(typeof e==="string"&&typeof t==="string"){const r=this.startIdIfNeeded(e.trim());const i=this.startTypeIfNeeded(e);const o=this.endIdIfNeeded(t.trim());const a=this.endTypeIfNeeded(t);this.addState(r,i);this.addState(o,a);this.currentDocument.relations.push({id1:r,id2:o,relationTitle:n?Ti.sanitizeText(n,Mn()):void 0})}}addDescription(e,t){const n=this.currentDocument.states.get(e);const r=t.startsWith(":")?t.replace(":","").trim():t;n?.descriptions?.push(Ti.sanitizeText(r,Mn()))}cleanupLabel(e){return e.startsWith(":")?e.slice(2).trim():e.trim()}getDividerId(){this.dividerCnt++;return`divider-id-${this.dividerCnt}`}addStyleClass(e,t=""){if(!this.classes.has(e)){this.classes.set(e,{id:e,styles:[],textStyles:[]})}const n=this.classes.get(e);if(t&&n){t.split(pb.STYLECLASS_SEP).forEach(r=>{const i=r.replace(/([^;]*);/,"$1").trim();if(RegExp(pb.COLOR_KEYWORD).exec(r)){const o=i.replace(pb.FILL_KEYWORD,pb.BG_FILL);const a=o.replace(pb.COLOR_KEYWORD,pb.FILL_KEYWORD);n.textStyles.push(a)}n.styles.push(i)})}}getClasses(){return this.classes}setupToolTips(e){const t=gG();const n=zr(e).select("svg");const r=n.selectAll("g.node, g.rough-node");r.on("mouseover",i=>{const o=zr(i.currentTarget);const a=o.attr("title");if(a===null){return}const s=i.currentTarget?.getBoundingClientRect();t.transition().duration(200).style("opacity",".9");t.style("left",window.scrollX+s.left+(s.right-s.left)/2+"px").style("top",window.scrollY+s.bottom+"px");t.html(ux.sanitize(a));o.classed("hover",true)}).on("mouseout",i=>{t.transition().duration(500).style("opacity",0);const o=zr(i.currentTarget);o.classed("hover",false)})}setCssClass(e,t){e.split(",").forEach(n=>{let r=this.getState(n);if(!r){const i=n.trim();this.addState(i);r=this.getState(i)}r?.classes?.push(t)})}setStyle(e,t){this.getState(e)?.styles?.push(t)}setTextStyle(e,t){this.getState(e)?.textStyles?.push(t)}bindFunctions(e){this.funs.forEach(t=>{t(e)})}getDirectionStatement(){return this.rootDoc.find(e=>e.stmt===qOn)}getDirection(){return this.getDirectionStatement()?.value??WVi}setDirection(e){const t=this.getDirectionStatement();if(t){t.value=e}else{this.rootDoc.unshift({stmt:qOn,value:e})}}trimColon(e){return e.startsWith(":")?e.slice(1).trim():e.trim()}getData(){const e=Mn();return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:u5n(this.getRootDocV2())}}getConfig(){return Mn().state}};m$i=B(e=>` +defs [id$="-barbEnd"] { + fill: ${e.transitionColor}; + stroke: ${e.transitionColor}; + } +g.stateGroup text { + fill: ${e.nodeBorder}; + stroke: none; + font-size: 10px; +} +g.stateGroup text { + fill: ${e.textColor}; + stroke: none; + font-size: 10px; + +} +g.stateGroup .state-title { + font-weight: bolder; + fill: ${e.stateLabelColor}; +} + +g.stateGroup rect { + fill: ${e.mainBkg}; + stroke: ${e.nodeBorder}; +} + +g.stateGroup line { + stroke: ${e.lineColor}; + stroke-width: ${e.strokeWidth||1}; +} + +.transition { + stroke: ${e.transitionColor}; + stroke-width: ${e.strokeWidth||1}; + fill: none; +} + +.stateGroup .composit { + fill: ${e.background}; + border-bottom: 1px +} + +.stateGroup .alt-composit { + fill: #e0e0e0; + border-bottom: 1px +} + +.state-note { + stroke: ${e.noteBorderColor}; + fill: ${e.noteBkgColor}; + + text { + fill: ${e.noteTextColor}; + stroke: none; + font-size: 10px; + } +} + +.stateLabel .box { + stroke: none; + stroke-width: 0; + fill: ${e.mainBkg}; + opacity: 0.5; +} + +.edgeLabel .label rect { + fill: ${e.labelBackgroundColor}; + opacity: 0.5; +} +.edgeLabel { + background-color: ${e.edgeLabelBackground}; + p { + background-color: ${e.edgeLabelBackground}; + } + rect { + opacity: 0.5; + background-color: ${e.edgeLabelBackground}; + fill: ${e.edgeLabelBackground}; + } + text-align: center; +} +.edgeLabel .label text { + fill: ${e.transitionLabelColor||e.tertiaryTextColor}; +} +.label div .edgeLabel { + color: ${e.transitionLabelColor||e.tertiaryTextColor}; +} + +.stateLabel text { + fill: ${e.stateLabelColor}; + font-size: 10px; + font-weight: bold; +} + +.node circle.state-start { + fill: ${e.specialStateColor}; + stroke: ${e.specialStateColor}; +} + +.node .fork-join { + fill: ${e.specialStateColor}; + stroke: ${e.specialStateColor}; +} + +.node circle.state-end { + fill: ${e.innerEndBackground}; + stroke: ${e.background}; + stroke-width: 1.5 +} +.end-state-inner { + fill: ${e.compositeBackground||e.background}; + // stroke: ${e.background}; + stroke-width: 1.5 +} + +.node rect { + fill: ${e.stateBkg||e.mainBkg}; + stroke: ${e.stateBorder||e.nodeBorder}; + stroke-width: ${e.strokeWidth||1}px; +} +.node polygon { + fill: ${e.mainBkg}; + stroke: ${e.stateBorder||e.nodeBorder};; + stroke-width: ${e.strokeWidth||1}px; +} +[id$="-barbEnd"] { + fill: ${e.lineColor}; +} + +.statediagram-cluster rect { + fill: ${e.compositeTitleBackground}; + stroke: ${e.stateBorder||e.nodeBorder}; + stroke-width: ${e.strokeWidth||1}px; +} + +.cluster-label, .nodeLabel { + color: ${e.stateLabelColor}; + // line-height: 1; +} + +.statediagram-cluster rect.outer { + rx: 5px; + ry: 5px; +} +.statediagram-state .divider { + stroke: ${e.stateBorder||e.nodeBorder}; +} + +.statediagram-state .title-state { + rx: 5px; + ry: 5px; +} +.statediagram-cluster.statediagram-cluster .inner { + fill: ${e.compositeBackground||e.background}; +} +.statediagram-cluster.statediagram-cluster-alt .inner { + fill: ${e.altBackground?e.altBackground:"#efefef"}; +} + +.statediagram-cluster .inner { + rx:0; + ry:0; +} + +.statediagram-state rect.basic { + rx: 5px; + ry: 5px; +} +.statediagram-state rect.divider { + stroke-dasharray: 10,10; + fill: ${e.altBackground?e.altBackground:"#efefef"}; +} + +.note-edge { + stroke-dasharray: 5; +} + +.statediagram-note rect { + fill: ${e.noteBkgColor}; + stroke: ${e.noteBorderColor}; + stroke-width: 1px; + rx: 0; + ry: 0; +} +.statediagram-note rect { + fill: ${e.noteBkgColor}; + stroke: ${e.noteBorderColor}; + stroke-width: 1px; + rx: 0; + ry: 0; +} + +.statediagram-note text { + fill: ${e.noteTextColor}; +} + +.statediagram-note .nodeLabel { + color: ${e.noteTextColor}; +} +.statediagram .edgeLabel { + color: red; // ${e.noteTextColor}; +} + +[id$="-dependencyStart"], [id$="-dependencyEnd"] { + fill: ${e.lineColor}; + stroke: ${e.lineColor}; + stroke-width: ${e.strokeWidth||1}; +} + +.statediagramTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${e.textColor}; +} + +[data-look="neo"].statediagram-cluster rect { + fill: ${e.mainBkg}; + stroke: ${e.useGradient?"url("+e.svgId+"-gradient)":e.stateBorder||e.nodeBorder}; + stroke-width: ${e.strokeWidth??1}; +} +[data-look="neo"].statediagram-cluster rect.outer { + rx: ${e.radius}px; + ry: ${e.radius}px; + filter: ${e.dropShadow?e.dropShadow.replace("url(#drop-shadow)",`url(${e.svgId}-drop-shadow)`):"none"} +} +`,"getStyles");WPe=m$i});var y5n={};Oo(y5n,{diagram:()=>I$i});var g$i,y$i,b$i,x$i,v$i,_$i,T$i,w$i,E$i,p5n,m5n,C$i,bv,Slt,S$i,A$i,k$i,R$i,g5n,P$i,I$i;var b5n=Ce(()=>{Clt();lv();Cx();Tx();sv();yx();kg();Eg();K0();Sg();Np();Jh();nl();Ta();Aa();Yo();ks();fZe();iv();ks();g$i=B(e=>e.append("circle").attr("class","start-state").attr("r",Mn().state.sizeUnit).attr("cx",Mn().state.padding+Mn().state.sizeUnit).attr("cy",Mn().state.padding+Mn().state.sizeUnit),"drawStartState");y$i=B(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",Mn().state.textHeight).attr("class","divider").attr("x2",Mn().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider");b$i=B((e,t)=>{const n=e.append("text").attr("x",2*Mn().state.padding).attr("y",Mn().state.textHeight+2*Mn().state.padding).attr("font-size",Mn().state.fontSize).attr("class","state-title").text(t.id);const r=n.node().getBBox();e.insert("rect",":first-child").attr("x",Mn().state.padding).attr("y",Mn().state.padding).attr("width",r.width+2*Mn().state.padding).attr("height",r.height+2*Mn().state.padding).attr("rx",Mn().state.radius);return n},"drawSimpleState");x$i=B((e,t)=>{const n=B(function(h,m,g){const x=h.append("tspan").attr("x",2*Mn().state.padding).text(m);if(!g){x.attr("dy",Mn().state.textHeight)}},"addTspan");const r=e.append("text").attr("x",2*Mn().state.padding).attr("y",Mn().state.textHeight+1.3*Mn().state.padding).attr("font-size",Mn().state.fontSize).attr("class","state-title").text(t.descriptions[0]);const i=r.node().getBBox();const o=i.height;const a=e.append("text").attr("x",Mn().state.padding).attr("y",o+Mn().state.padding*.4+Mn().state.dividerMargin+Mn().state.textHeight).attr("class","state-description");let s=true;let l=true;t.descriptions.forEach(function(h){if(!s){n(a,h,l);l=false}s=false});const u=e.append("line").attr("x1",Mn().state.padding).attr("y1",Mn().state.padding+o+Mn().state.dividerMargin/2).attr("y2",Mn().state.padding+o+Mn().state.dividerMargin/2).attr("class","descr-divider");const d=a.node().getBBox();const f=Math.max(d.width,i.width);u.attr("x2",f+3*Mn().state.padding);e.insert("rect",":first-child").attr("x",Mn().state.padding).attr("y",Mn().state.padding).attr("width",f+2*Mn().state.padding).attr("height",d.height+o+2*Mn().state.padding).attr("rx",Mn().state.radius);return e},"drawDescrState");v$i=B((e,t,n)=>{const r=Mn().state.padding;const i=2*Mn().state.padding;const o=e.node().getBBox();const a=o.width;const s=o.x;const l=e.append("text").attr("x",0).attr("y",Mn().state.titleShift).attr("font-size",Mn().state.fontSize).attr("class","state-title").text(t.id);const u=l.node().getBBox();const d=u.width+i;let f=Math.max(d,a);if(f===a){f=f+i}let h;const m=e.node().getBBox();if(t.doc){}h=s-r;if(d>a){h=(a-f)/2+r}if(Math.abs(s-m.x)a){h=s-(d-a)/2}const g=1-Mn().state.textHeight;e.insert("rect",":first-child").attr("x",h).attr("y",g).attr("class",n?"alt-composit":"composit").attr("width",f).attr("height",m.height+Mn().state.textHeight+Mn().state.titleShift+1).attr("rx","0");l.attr("x",h+r);if(d<=a){l.attr("x",s+(f-i)/2-d/2+r)}e.insert("rect",":first-child").attr("x",h).attr("y",Mn().state.titleShift-Mn().state.textHeight-Mn().state.padding).attr("width",f).attr("height",Mn().state.textHeight*3).attr("rx",Mn().state.radius);e.insert("rect",":first-child").attr("x",h).attr("y",Mn().state.titleShift-Mn().state.textHeight-Mn().state.padding).attr("width",f).attr("height",m.height+3+2*Mn().state.textHeight).attr("rx",Mn().state.radius);return e},"addTitleAndBox");_$i=B(e=>{e.append("circle").attr("class","end-state-outer").attr("r",Mn().state.sizeUnit+Mn().state.miniPadding).attr("cx",Mn().state.padding+Mn().state.sizeUnit+Mn().state.miniPadding).attr("cy",Mn().state.padding+Mn().state.sizeUnit+Mn().state.miniPadding);return e.append("circle").attr("class","end-state-inner").attr("r",Mn().state.sizeUnit).attr("cx",Mn().state.padding+Mn().state.sizeUnit+2).attr("cy",Mn().state.padding+Mn().state.sizeUnit+2)},"drawEndState");T$i=B((e,t)=>{let n=Mn().state.forkWidth;let r=Mn().state.forkHeight;if(t.parentId){let i=n;n=r;r=i}return e.append("rect").style("stroke","black").style("fill","black").attr("width",n).attr("height",r).attr("x",Mn().state.padding).attr("y",Mn().state.padding)},"drawForkJoinState");w$i=B((e,t,n,r)=>{let i=0;const o=r.append("text");o.style("text-anchor","start");o.attr("class","noteText");let a=e.replace(/\r\n/g,"
    ");a=a.replace(/\n/g,"
    ");const s=a.split(Ti.lineBreakRegex);let l=1.25*Mn().state.noteMargin;for(const u of s){const d=u.trim();if(d.length>0){const f=o.append("tspan");f.text(d);if(l===0){const h=f.node().getBBox();l+=h.height}i+=l;f.attr("x",t+Mn().state.noteMargin);f.attr("y",n+i+1.25*Mn().state.noteMargin)}}return{textWidth:o.node().getBBox().width,textHeight:i}},"_drawLongText");E$i=B((e,t)=>{t.attr("class","state-note");const n=t.append("rect").attr("x",0).attr("y",Mn().state.padding);const r=t.append("g");const{textWidth:i,textHeight:o}=w$i(e,0,0,r);n.attr("height",o+2*Mn().state.noteMargin);n.attr("width",i+Mn().state.noteMargin*2);return n},"drawNote");p5n=B(function(e,t){const n=t.id;const r={id:n,label:t.id,width:0,height:0};const i=e.append("g").attr("id",n).attr("class","stateGroup");if(t.type==="start"){g$i(i)}if(t.type==="end"){_$i(i)}if(t.type==="fork"||t.type==="join"){T$i(i,t)}if(t.type==="note"){E$i(t.note.text,i)}if(t.type==="divider"){y$i(i)}if(t.type==="default"&&t.descriptions.length===0){b$i(i,t)}if(t.type==="default"&&t.descriptions.length>0){x$i(i,t)}const o=i.node().getBBox();r.width=o.width+2*Mn().state.padding;r.height=o.height+2*Mn().state.padding;return r},"drawState");m5n=0;C$i=B(function(e,t,n){const r=B(function(l){switch(l){case hP.relationType.AGGREGATION:return"aggregation";case hP.relationType.EXTENSION:return"extension";case hP.relationType.COMPOSITION:return"composition";case hP.relationType.DEPENDENCY:return"dependency"}},"getRelationType");t.points=t.points.filter(l=>!Number.isNaN(l.y));const i=t.points;const o=Wb().x(function(l){return l.x}).y(function(l){return l.y}).curve(UE);const a=e.append("path").attr("d",o(i)).attr("id","edge"+m5n).attr("class","transition");let s="";if(Mn().state.arrowMarkerAbsolute){s=B5(true)}a.attr("marker-end","url("+s+"#"+r(hP.relationType.DEPENDENCY)+"End)");if(n.title!==void 0){const l=e.append("g").attr("class","stateLabel");const{x:u,y:d}=Ko.calcLabelPosition(t.points);const f=Ti.getRows(n.title);let h=0;const m=[];let g=0;let x=0;for(let C=0;C<=f.length;C++){const A=l.append("text").attr("text-anchor","middle").text(f[C]).attr("x",u).attr("y",d+h);const P=A.node().getBBox();g=Math.max(g,P.width);x=Math.min(x,P.x);wt.info(P.x,u,d+h);if(h===0){const L=A.node().getBBox();h=L.height;wt.info("Title height",h,d)}m.push(A)}let w=h*f.length;if(f.length>1){const C=(f.length-1)*h*.5;m.forEach((A,P)=>A.attr("y",d+P*h-C));w=h*f.length}const _=l.node().getBBox();l.insert("rect",":first-child").attr("class","box").attr("x",u-g/2-Mn().state.padding/2).attr("y",d-w/2-Mn().state.padding/2-3.5).attr("width",g+Mn().state.padding).attr("height",w+Mn().state.padding);wt.info(_)}m5n++},"drawEdge");Slt={};S$i=B(function(){},"setConf");A$i=B(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers");k$i=B(function(e,t,n,r){bv=Mn().state;const i=Mn().securityLevel;let o;if(i==="sandbox"){o=zr("#i"+t)}const a=i==="sandbox"?zr(o.nodes()[0].contentDocument.body):zr("body");const s=i==="sandbox"?o.nodes()[0].contentDocument:document;wt.debug("Rendering diagram "+e);const l=a.select(`[id='${t}']`);A$i(l);const u=r.db.getRootDoc();const d=l.append("g").attr("id",t+"-root");g5n(u,d,void 0,false,a,s,r);const f=bv.padding;const h=l.node().getBBox();const m=h.width+f*2;const g=h.height+f*2;const x=m*1.75;Vs(l,g,x,bv.useMaxWidth);l.attr("viewBox",`${h.x-bv.padding} ${h.y-bv.padding} `+m+" "+g)},"draw");R$i=B(e=>{return e?e.length*bv.fontSizeFactor:1},"getLabelWidth");g5n=B((e,t,n,r,i,o,a)=>{const s=new fc({compound:true,multigraph:true});let l;let u=true;for(l=0;l{const L=P.parentElement;let I=0;let N=0;if(L){if(L.parentElement){I=L.parentElement.getBBox().width}N=parseInt(L.getAttribute("data-x-shift"),10);if(Number.isNaN(N)){N=0}}P.setAttribute("x1",0-N+8);P.setAttribute("x2",I-N-8)})}else{wt.debug("No Node "+C+": "+JSON.stringify(s.node(C)))}});let w=x.getBBox();s.edges().forEach(function(C){if(C!==void 0&&s.edge(C)!==void 0){wt.debug("Edge "+C.v+" -> "+C.w+": "+JSON.stringify(s.edge(C)));C$i(t,s.edge(C),s.edge(C).relation)}});w=x.getBBox();const _={id:n?n:"root",label:n?n:"root",width:0,height:0};_.width=w.width+2*bv.padding;_.height=w.height+2*bv.padding;wt.debug("Doc rendered",_,s);return _},"renderDoc");P$i={setConf:S$i,draw:k$i};I$i={parser:HPe,get db(){return new hP(1)},renderer:P$i,styles:WPe,init:B(e=>{if(!e.state){e.state={}}e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")}});var x5n={};Oo(x5n,{diagram:()=>M$i});var M$i;var v5n=Ce(()=>{Clt();lv();Cx();Tx();sv();yx();kg();Eg();K0();Sg();Np();Jh();nl();Ta();Aa();Yo();M$i={parser:HPe,get db(){return new hP(2)},renderer:d5n,styles:WPe,init:B(e=>{if(!e.state){e.state={}}e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")}});var R5n={};Oo(R5n,{diagram:()=>Q$i});function k5n(e){const t=Mn().journey;const n=t.maxLabelWidth;YPe=0;let r=60;Object.keys(pP).forEach(i=>{const o=pP[i].color;const a={cx:20,cy:r,r:7,fill:o,stroke:"#000",pos:pP[i].position};Sre.drawCircle(e,a);let s=e.append("text").attr("visibility","hidden").text(i);const l=s.node().getBoundingClientRect().width;s.remove();let u=[];if(l<=n){u=[i]}else{const d=i.split(" ");let f="";s=e.append("text").attr("visibility","hidden");d.forEach(h=>{const m=f?`${f} ${h}`:h;s.text(m);const g=s.node().getBoundingClientRect().width;if(g>n){if(f){u.push(f)}f=h;s.text(h);if(s.node().getBoundingClientRect().width>n){let x="";for(const w of h){x+=w;s.text(x+"-");if(s.node().getBoundingClientRect().width>n){u.push(x.slice(0,-1)+"-");x=w}}f=x}}else{f=m}});if(f){u.push(f)}s.remove()}u.forEach((d,f)=>{const h={x:40,y:r+7+f*20,fill:"#666",text:d,textMargin:t.boxTextMargin??5};const m=Sre.drawText(e,h);const g=m.node().getBoundingClientRect().width;if(g>YPe&&g>t.leftMargin-g){YPe=g}});r+=Math.max(20,u.length*20)})}var klt,L$i,CH,Plt,Ere,Cre,D$i,F$i,N$i,O$i,B$i,z$i,U$i,_5n,V$i,T5n,$$i,G$i,Ilt,H$i,C5n,S5n,W$i,Y$i,Rlt,q$i,X$i,A5n,j$i,Sre,K$i,pP,YPe,jw,CD,Z$i,K_,Alt,w5n,J$i,E5n,Q$i;var P5n=Ce(()=>{aS();sv();Ta();Aa();Yo();ks();ks();klt=function(){var e=B(function(f,h,m,g){for(m=m||{},g=f.length;g--;m[f[g]]=h);return m},"o"),t=[6,8,10,11,12,14,16,17,18],n=[1,9],r=[1,10],i=[1,11],o=[1,12],a=[1,13],s=[1,14];var l={trace:B(function f(){},"trace"),yy:{},symbols_:{"error":2,"start":3,"journey":4,"document":5,"EOF":6,"line":7,"SPACE":8,"statement":9,"NEWLINE":10,"title":11,"acc_title":12,"acc_title_value":13,"acc_descr":14,"acc_descr_value":15,"acc_descr_multiline_value":16,"section":17,"taskName":18,"taskData":19,"$accept":0,"$end":1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:B(function f(h,m,g,x,w,_,C){var A=_.length-1;switch(w){case 1:return _[A-1];break;case 2:this.$=[];break;case 3:_[A-1].push(_[A]);this.$=_[A-1];break;case 4:case 5:this.$=_[A];break;case 6:case 7:this.$=[];break;case 8:x.setDiagramTitle(_[A].substr(6));this.$=_[A].substr(6);break;case 9:this.$=_[A].trim();x.setAccTitle(this.$);break;case 10:case 11:this.$=_[A].trim();x.setAccDescription(this.$);break;case 12:x.addSection(_[A].substr(8));this.$=_[A].substr(8);break;case 13:x.addTask(_[A-1],_[A]);this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(t,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:n,12:r,14:i,16:o,17:a,18:s},e(t,[2,7],{1:[2,1]}),e(t,[2,3]),{9:15,11:n,12:r,14:i,16:o,17:a,18:s},e(t,[2,5]),e(t,[2,6]),e(t,[2,8]),{13:[1,16]},{15:[1,17]},e(t,[2,11]),e(t,[2,12]),{19:[1,18]},e(t,[2,4]),e(t,[2,9]),e(t,[2,10]),e(t,[2,13])],defaultActions:{},parseError:B(function f(h,m){if(m.recoverable){this.trace(h)}else{var g=new Error(h);g.hash=m;throw g}},"parseError"),parse:B(function f(h){var m=this,g=[0],x=[],w=[null],_=[],C=this.table,A="",P=0,L=0,I=0,N=2,O=1;var z=_.slice.call(arguments,1);var U=Object.create(this.lexer);var W={yy:{}};for(var H in this.yy){if(Object.prototype.hasOwnProperty.call(this.yy,H)){W.yy[H]=this.yy[H]}}U.setInput(h,W.yy);W.yy.lexer=U;W.yy.parser=this;if(typeof U.yylloc=="undefined"){U.yylloc={}}var $=U.yylloc;_.push($);var K=U.options&&U.options.ranges;if(typeof W.yy.parseError==="function"){this.parseError=W.yy.parseError}else{this.parseError=Object.getPrototypeOf(this).parseError}function X(ge){g.length=g.length-2*ge;w.length=w.length-ge;_.length=_.length-ge}B(X,"popStack");function j(){var ge;ge=x.pop()||U.lex()||O;if(typeof ge!=="number"){if(ge instanceof Array){x=ge;ge=x.pop()}ge=m.symbols_[ge]||ge}return ge}B(j,"lex");var te,J,oe,se,re,ce,ue={},xe,be,Ie,he;while(true){oe=g[g.length-1];if(this.defaultActions[oe]){se=this.defaultActions[oe]}else{if(te===null||typeof te=="undefined"){te=j()}se=C[oe]&&C[oe][te]}if(typeof se==="undefined"||!se.length||!se[0]){var ve="";he=[];for(xe in C[oe]){if(this.terminals_[xe]&&xe>N){he.push("'"+this.terminals_[xe]+"'")}}if(U.showPosition){ve="Parse error on line "+(P+1)+":\n"+U.showPosition()+"\nExpecting "+he.join(", ")+", got '"+(this.terminals_[te]||te)+"'"}else{ve="Parse error on line "+(P+1)+": Unexpected "+(te==O?"end of input":"'"+(this.terminals_[te]||te)+"'")}this.parseError(ve,{text:U.match,token:this.terminals_[te]||te,line:U.yylineno,loc:$,expected:he})}if(se[0]instanceof Array&&se.length>1){throw new Error("Parse Error: multiple actions possible at state: "+oe+", token: "+te)}switch(se[0]){case 1:g.push(te);w.push(U.yytext);_.push(U.yylloc);g.push(se[1]);te=null;if(!J){L=U.yyleng;A=U.yytext;P=U.yylineno;$=U.yylloc;if(I>0){I--}}else{te=J;J=null}break;case 2:be=this.productions_[se[1]][1];ue.$=w[w.length-be];ue._$={first_line:_[_.length-(be||1)].first_line,last_line:_[_.length-1].last_line,first_column:_[_.length-(be||1)].first_column,last_column:_[_.length-1].last_column};if(K){ue._$.range=[_[_.length-(be||1)].range[0],_[_.length-1].range[1]]}ce=this.performAction.apply(ue,[A,L,P,W.yy,se[1],w,_].concat(z));if(typeof ce!=="undefined"){return ce}if(be){g=g.slice(0,-1*be*2);w=w.slice(0,-1*be);_=_.slice(0,-1*be)}g.push(this.productions_[se[1]][0]);w.push(ue.$);_.push(ue._$);Ie=C[g[g.length-2]][g[g.length-1]];g.push(Ie);break;case 3:return true}}return true},"parse")};var u=function(){var f={EOF:1,parseError:B(function h(m,g){if(this.yy.parser){this.yy.parser.parseError(m,g)}else{throw new Error(m)}},"parseError"),setInput:B(function(h,m){this.yy=m||this.yy||{};this._input=h;this._more=this._backtrack=this.done=false;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};if(this.options.ranges){this.yylloc.range=[0,0]}this.offset=0;return this},"setInput"),input:B(function(){var h=this._input[0];this.yytext+=h;this.yyleng++;this.offset++;this.match+=h;this.matched+=h;var m=h.match(/(?:\r\n?|\n).*/g);if(m){this.yylineno++;this.yylloc.last_line++}else{this.yylloc.last_column++}if(this.options.ranges){this.yylloc.range[1]++}this._input=this._input.slice(1);return h},"input"),unput:B(function(h){var m=h.length;var g=h.split(/(?:\r\n?|\n)/g);this._input=h+this._input;this.yytext=this.yytext.substr(0,this.yytext.length-m);this.offset-=m;var x=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1);this.matched=this.matched.substr(0,this.matched.length-1);if(g.length-1){this.yylineno-=g.length-1}var w=this.yylloc.range;this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===x.length?this.yylloc.first_column:0)+x[x.length-g.length].length-g[0].length:this.yylloc.first_column-m};if(this.options.ranges){this.yylloc.range=[w[0],w[0]+this.yyleng-m]}this.yyleng=this.yytext.length;return this},"unput"),more:B(function(){this._more=true;return this},"more"),reject:B(function(){if(this.options.backtrack_lexer){this._backtrack=true}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}return this},"reject"),less:B(function(h){this.unput(this.match.slice(h))},"less"),pastInput:B(function(){var h=this.matched.substr(0,this.matched.length-this.match.length);return(h.length>20?"...":"")+h.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:B(function(){var h=this.match;if(h.length<20){h+=this._input.substr(0,20-h.length)}return(h.substr(0,20)+(h.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:B(function(){var h=this.pastInput();var m=new Array(h.length+1).join("-");return h+this.upcomingInput()+"\n"+m+"^"},"showPosition"),test_match:B(function(h,m){var g,x,w;if(this.options.backtrack_lexer){w={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done};if(this.options.ranges){w.yylloc.range=this.yylloc.range.slice(0)}}x=h[0].match(/(?:\r\n?|\n).*/g);if(x){this.yylineno+=x.length}this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:x?x[x.length-1].length-x[x.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+h[0].length};this.yytext+=h[0];this.match+=h[0];this.matches=h;this.yyleng=this.yytext.length;if(this.options.ranges){this.yylloc.range=[this.offset,this.offset+=this.yyleng]}this._more=false;this._backtrack=false;this._input=this._input.slice(h[0].length);this.matched+=h[0];g=this.performAction.call(this,this.yy,this,m,this.conditionStack[this.conditionStack.length-1]);if(this.done&&this._input){this.done=false}if(g){return g}else if(this._backtrack){for(var _ in w){this[_]=w[_]}return false}return false},"test_match"),next:B(function(){if(this.done){return this.EOF}if(!this._input){this.done=true}var h,m,g,x;if(!this._more){this.yytext="";this.match=""}var w=this._currentRules();for(var _=0;_m[0].length)){m=g;x=_;if(this.options.backtrack_lexer){h=this.test_match(g,w[_]);if(h!==false){return h}else if(this._backtrack){m=false;continue}else{return false}}else if(!this.options.flex){break}}}if(m){h=this.test_match(m,w[x]);if(h!==false){return h}return false}if(this._input===""){return this.EOF}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}},"next"),lex:B(function h(){var m=this.next();if(m){return m}else{return this.lex()}},"lex"),begin:B(function h(m){this.conditionStack.push(m)},"begin"),popState:B(function h(){var m=this.conditionStack.length-1;if(m>0){return this.conditionStack.pop()}else{return this.conditionStack[0]}},"popState"),_currentRules:B(function h(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules}else{return this.conditions["INITIAL"].rules}},"_currentRules"),topState:B(function h(m){m=this.conditionStack.length-1-Math.abs(m||0);if(m>=0){return this.conditionStack[m]}else{return"INITIAL"}},"topState"),pushState:B(function h(m){this.begin(m)},"pushState"),stateStackSize:B(function h(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":true},performAction:B(function h(m,g,x,w){var _=w;switch(x){case 0:break;case 1:break;case 2:return 10;break;case 3:break;case 4:break;case 5:return 4;break;case 6:return 11;break;case 7:this.begin("acc_title");return 12;break;case 8:this.popState();return"acc_title_value";break;case 9:this.begin("acc_descr");return 14;break;case 10:this.popState();return"acc_descr_value";break;case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";break;case 14:return 17;break;case 15:return 18;break;case 16:return 19;break;case 17:return":";break;case 18:return 6;break;case 19:return"INVALID";break}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{"acc_descr_multiline":{"rules":[12,13],"inclusive":false},"acc_descr":{"rules":[10],"inclusive":false},"acc_title":{"rules":[8],"inclusive":false},"INITIAL":{"rules":[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],"inclusive":true}}};return f}();l.lexer=u;function d(){this.yy={}}B(d,"Parser");d.prototype=l;l.Parser=d;return new d}();klt.parser=klt;L$i=klt;CH="";Plt=[];Ere=[];Cre=[];D$i=B(function(){Plt.length=0;Ere.length=0;CH="";Cre.length=0;Da()},"clear");F$i=B(function(e){CH=e;Plt.push(e)},"addSection");N$i=B(function(){return Plt},"getSections");O$i=B(function(){let e=_5n();const t=100;let n=0;while(!e&&n{if(n.people){e.push(...n.people)}});const t=new Set(e);return[...t].sort()},"updateActors");z$i=B(function(e,t){const n=t.substr(1).split(":");let r=0;let i=[];if(n.length===1){r=Number(n[0]);i=[]}else{r=Number(n[0]);i=n[1].split(",")}const o=i.map(s=>s.trim());const a={section:CH,type:CH,people:o,task:e,score:r};Cre.push(a)},"addTask");U$i=B(function(e){const t={section:CH,type:CH,description:e,task:e,classes:[]};Ere.push(t)},"addTaskOrg");_5n=B(function(){const e=B(function(n){return Cre[n].processed},"compileTask");let t=true;for(const[n,r]of Cre.entries()){e(n);t=t&&r.processed}return t},"compileTasks");V$i=B(function(){return B$i()},"getActors");T5n={getConfig:B(()=>Mn().journey,"getConfig"),clear:D$i,setDiagramTitle:ys,getDiagramTitle:ss,setAccTitle:Ka,getAccTitle:is,setAccDescription:os,getAccDescription:as,addSection:F$i,getSections:N$i,getTasks:O$i,addTask:z$i,addTaskOrg:U$i,getActors:V$i};$$i=B(e=>`.label { + font-family: ${e.fontFamily}; + color: ${e.textColor}; + } + .mouth { + stroke: #666; + } + + line { + stroke: ${e.textColor} + } + + .legend { + fill: ${e.textColor}; + font-family: ${e.fontFamily}; + } + + .label text { + fill: #333; + } + .label { + color: ${e.textColor} + } + + .face { + ${e.faceColor?`fill: ${e.faceColor}`:"fill: #FFF8DC"}; + stroke: #999; + } + + .node rect, + .node circle, + .node ellipse, + .node polygon, + .node path { + fill: ${e.mainBkg}; + stroke: ${e.nodeBorder}; + stroke-width: 1px; + } + + .node .label { + text-align: center; + } + .node.clickable { + cursor: pointer; + } + + .arrowheadPath { + fill: ${e.arrowheadColor}; + } + + .edgePath .path { + stroke: ${e.lineColor}; + stroke-width: 1.5px; + } + + .flowchart-link { + stroke: ${e.lineColor}; + fill: none; + } + + .edgeLabel { + background-color: ${e.edgeLabelBackground}; + rect { + opacity: 0.5; + } + text-align: center; + } + + .cluster rect { + } + + .cluster text { + fill: ${e.titleColor}; + } + + div.mermaidTooltip { + position: absolute; + text-align: center; + max-width: 200px; + padding: 2px; + font-family: ${e.fontFamily}; + font-size: 12px; + background: ${e.tertiaryColor}; + border: 1px solid ${e.border2}; + border-radius: 2px; + pointer-events: none; + z-index: 100; + } + + .task-type-0, .section-type-0 { + ${e.fillType0?`fill: ${e.fillType0}`:""}; + } + .task-type-1, .section-type-1 { + ${e.fillType0?`fill: ${e.fillType1}`:""}; + } + .task-type-2, .section-type-2 { + ${e.fillType0?`fill: ${e.fillType2}`:""}; + } + .task-type-3, .section-type-3 { + ${e.fillType0?`fill: ${e.fillType3}`:""}; + } + .task-type-4, .section-type-4 { + ${e.fillType0?`fill: ${e.fillType4}`:""}; + } + .task-type-5, .section-type-5 { + ${e.fillType0?`fill: ${e.fillType5}`:""}; + } + .task-type-6, .section-type-6 { + ${e.fillType0?`fill: ${e.fillType6}`:""}; + } + .task-type-7, .section-type-7 { + ${e.fillType0?`fill: ${e.fillType7}`:""}; + } + + .actor-0 { + ${e.actor0?`fill: ${e.actor0}`:""}; + } + .actor-1 { + ${e.actor1?`fill: ${e.actor1}`:""}; + } + .actor-2 { + ${e.actor2?`fill: ${e.actor2}`:""}; + } + .actor-3 { + ${e.actor3?`fill: ${e.actor3}`:""}; + } + .actor-4 { + ${e.actor4?`fill: ${e.actor4}`:""}; + } + .actor-5 { + ${e.actor5?`fill: ${e.actor5}`:""}; + } + ${oS()} +`,"getStyles");G$i=$$i;Ilt=B(function(e,t){return SB(e,t)},"drawRect");H$i=B(function(e,t){const n=15;const r=e.append("circle").attr("cx",t.cx).attr("cy",t.cy).attr("class","face").attr("r",n).attr("stroke-width",2).attr("overflow","visible");const i=e.append("g");i.append("circle").attr("cx",t.cx-n/3).attr("cy",t.cy-n/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");i.append("circle").attr("cx",t.cx+n/3).attr("cy",t.cy-n/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function o(l){const u=Hb().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(n/2).outerRadius(n/2.2);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+t.cx+","+(t.cy+2)+")")}B(o,"smile");function a(l){const u=Hb().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(n/2).outerRadius(n/2.2);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+t.cx+","+(t.cy+7)+")")}B(a,"sad");function s(l){l.append("line").attr("class","mouth").attr("stroke",2).attr("x1",t.cx-5).attr("y1",t.cy+7).attr("x2",t.cx+5).attr("y2",t.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}B(s,"ambivalent");if(t.score>3){o(i)}else if(t.score<3){a(i)}else{s(i)}return r},"drawFace");C5n=B(function(e,t){const n=e.append("circle");n.attr("cx",t.cx);n.attr("cy",t.cy);n.attr("class","actor-"+t.pos);n.attr("fill",t.fill);n.attr("stroke",t.stroke);n.attr("r",t.r);if(n.class!==void 0){n.attr("class",n.class)}if(t.title!==void 0){n.append("title").text(t.title)}return n},"drawCircle");S5n=B(function(e,t){return P2n(e,t)},"drawText");W$i=B(function(e,t){function n(i,o,a,s,l){return i+","+o+" "+(i+a)+","+o+" "+(i+a)+","+(o+s-l)+" "+(i+a-l*1.2)+","+(o+s)+" "+i+","+(o+s)}B(n,"genPoints");const r=e.append("polygon");r.attr("points",n(t.x,t.y,50,20,7));r.attr("class","labelBox");t.y=t.y+t.labelMargin;t.x=t.x+.5*t.labelMargin;S5n(e,t)},"drawLabel");Y$i=B(function(e,t,n){const r=e.append("g");const i=Xy();i.x=t.x;i.y=t.y;i.fill=t.fill;i.width=n.width*t.taskCount+n.diagramMarginX*(t.taskCount-1);i.height=n.height;i.class="journey-section section-type-"+t.num;i.rx=3;i.ry=3;Ilt(r,i);A5n(n)(t.text,r,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+t.num},n,t.colour)},"drawSection");Rlt=-1;q$i=B(function(e,t,n,r){const i=t.x+n.width/2;const o=e.append("g");Rlt++;const a=300+5*30;o.append("line").attr("id",r+"-task"+Rlt).attr("x1",i).attr("y1",t.y).attr("x2",i).attr("y2",a).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666");H$i(o,{cx:i,cy:300+(5-t.score)*30,score:t.score});const s=Xy();s.x=t.x;s.y=t.y;s.fill=t.fill;s.width=n.width;s.height=n.height;s.class="task task-type-"+t.num;s.rx=3;s.ry=3;Ilt(o,s);let l=t.x+14;t.people.forEach(u=>{const d=t.actors[u].color;const f={cx:l,cy:t.y,r:7,fill:d,stroke:"#000",title:u,pos:t.actors[u].position};C5n(o,f);l+=10});A5n(n)(t.task,o,s.x,s.y,s.width,s.height,{class:"task"},n,t.colour)},"drawTask");X$i=B(function(e,t){zSe(e,t)},"drawBackgroundRect");A5n=function(){function e(i,o,a,s,l,u,d,f){const h=o.append("text").attr("x",a+l/2).attr("y",s+u/2+5).style("font-color",f).style("text-anchor","middle").text(i);r(h,d)}B(e,"byText");function t(i,o,a,s,l,u,d,f,h){const{taskFontSize:m,taskFontFamily:g}=f;const x=i.split(//gi);for(let w=0;w{pP[P]={color:jw.actorColours[x%jw.actorColours.length],position:x};x++});k5n(f);CD=jw.leftMargin+YPe;K_.insert(0,0,CD,Object.keys(pP).length*50);J$i(f,h,0,t);const w=K_.getBounds();if(m){f.append("text").text(m).attr("x",CD).attr("font-size",a).attr("font-weight","bold").attr("y",25).attr("fill",o).attr("font-family",s)}const _=w.stopy-w.starty+2*jw.diagramMarginY;const C=CD+w.stopx+2*jw.diagramMarginX;Vs(f,_,C,jw.useMaxWidth);f.append("line").attr("x1",CD).attr("y1",jw.height*4).attr("x2",C-CD-4).attr("y2",jw.height*4).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#"+t+"-arrowhead)");const A=m?70:0;f.attr("viewBox",`${w.startx} -25 ${C} ${_+A}`);f.attr("preserveAspectRatio","xMinYMin meet");f.attr("height",_+A+25)},"draw");K_={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:B(function(){this.sequenceItems=[];this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0};this.verticalPos=0},"init"),updateVal:B(function(e,t,n,r){if(e[t]===void 0){e[t]=n}else{e[t]=r(n,e[t])}},"updateVal"),updateBounds:B(function(e,t,n,r){const i=Mn().journey;const o=this;let a=0;function s(l){return B(function u(d){a++;const f=o.sequenceItems.length-a+1;o.updateVal(d,"starty",t-f*i.boxMargin,Math.min);o.updateVal(d,"stopy",r+f*i.boxMargin,Math.max);o.updateVal(K_.data,"startx",e-f*i.boxMargin,Math.min);o.updateVal(K_.data,"stopx",n+f*i.boxMargin,Math.max);if(!(l==="activation")){o.updateVal(d,"startx",e-f*i.boxMargin,Math.min);o.updateVal(d,"stopx",n+f*i.boxMargin,Math.max);o.updateVal(K_.data,"starty",t-f*i.boxMargin,Math.min);o.updateVal(K_.data,"stopy",r+f*i.boxMargin,Math.max)}},"updateItemBounds")}B(s,"updateFn");this.sequenceItems.forEach(s())},"updateBounds"),insert:B(function(e,t,n,r){const i=Math.min(e,n);const o=Math.max(e,n);const a=Math.min(t,r);const s=Math.max(t,r);this.updateVal(K_.data,"startx",i,Math.min);this.updateVal(K_.data,"starty",a,Math.min);this.updateVal(K_.data,"stopx",o,Math.max);this.updateVal(K_.data,"stopy",s,Math.max);this.updateBounds(i,a,o,s)},"insert"),bumpVerticalPos:B(function(e){this.verticalPos=this.verticalPos+e;this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:B(function(){return this.verticalPos},"getVerticalPos"),getBounds:B(function(){return this.data},"getBounds")};Alt=jw.sectionFills;w5n=jw.sectionColours;J$i=B(function(e,t,n,r){const i=Mn().journey;let o="";const a=i.height*2+i.diagramMarginY;const s=n+a;let l=0;let u="#CCC";let d="black";let f=0;for(const[h,m]of t.entries()){if(o!==m.section){u=Alt[l%Alt.length];f=l%Alt.length;d=w5n[l%w5n.length];let x=0;const w=m.section;for(let C=h;C{if(pP[w]){x[w]=pP[w]}return x},{});m.x=h*i.taskMargin+h*i.width+CD;m.y=s;m.width=i.diagramMarginX;m.height=i.diagramMarginY;m.colour=d;m.fill=u;m.num=f;m.actors=g;Sre.drawTask(e,m,i,r);K_.insert(m.x,m.y,m.x+m.width+i.taskMargin,300+5*30)}},"drawTasks");E5n={setConf:K$i,draw:Z$i};Q$i={parser:L$i,db:T5n,renderer:E5n,styles:G$i,init:B(e=>{E5n.setConf(e.journey);T5n.clear()},"init")}});var eBn={};Oo(eBn,{diagram:()=>AGi});function Olt(e,t){e.each(function(){var n=zr(this),r=n.text().split(/(\s+|
    )/).reverse(),i,o=[],a=1.1,s=n.attr("y"),l=parseFloat(n.attr("dy")),u=n.text(null).append("tspan").attr("x",0).attr("y",s).attr("dy",l+"em");for(let d=0;dt||i==="
    "){o.pop();u.text(o.join(" ").trim());if(i==="
    "){o=[""]}else{o=[i]}u=n.append("tspan").attr("x",0).attr("y",s).attr("dy",a+"em").text(i)}}})}var Mlt,eGi,N5n,SH,O5n,Dlt,Flt,qPe,AH,B5n,z5n,U5n,V5n,$5n,G5n,H5n,W5n,Y5n,q5n,I5n,tGi,X5n,XPe,nGi,rGi,j5n,iGi,oGi,Llt,aGi,sGi,lGi,Nlt,K5n,cGi,uGi,dGi,fGi,Dx,hGi,M5n,pGi,mGi,jPe,mP,gGi,Blt,yGi,Z5n,bGi,L5n,J5n,D5n,Q5n,xGi,F5n,vGi,_Gi,TGi,wGi,EGi,CGi,SGi,AGi;var tBn=Ce(()=>{gh();nl();Ta();Aa();Yo();ks();ks();qh();Mlt=function(){var e=B(function(h,m,g,x){for(g=g||{},x=h.length;x--;g[h[x]]=m);return g},"o"),t=[6,11,13,14,15,17,19,20,23,24],n=[1,12],r=[1,13],i=[1,14],o=[1,15],a=[1,16],s=[1,19],l=[1,20];var u={trace:B(function h(){},"trace"),yy:{},symbols_:{"error":2,"start":3,"timeline_header":4,"document":5,"EOF":6,"timeline":7,"timeline_lr":8,"timeline_td":9,"line":10,"SPACE":11,"statement":12,"NEWLINE":13,"title":14,"acc_title":15,"acc_title_value":16,"acc_descr":17,"acc_descr_value":18,"acc_descr_multiline_value":19,"section":20,"period_statement":21,"event_statement":22,"period":23,"event":24,"$accept":0,"$end":1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:B(function h(m,g,x,w,_,C,A){var P=C.length-1;switch(_){case 1:return C[P-1];break;case 3:w.setDirection("LR");break;case 4:w.setDirection("TD");break;case 5:this.$=[];break;case 6:C[P-1].push(C[P]);this.$=C[P-1];break;case 7:case 8:this.$=C[P];break;case 9:case 10:this.$=[];break;case 11:w.getCommonDb().setDiagramTitle(C[P].substr(6));this.$=C[P].substr(6);break;case 12:this.$=C[P].trim();w.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=C[P].trim();w.getCommonDb().setAccDescription(this.$);break;case 15:w.addSection(C[P].substr(8));this.$=C[P].substr(8);break;case 18:w.addTask(C[P],0,"");this.$=C[P];break;case 19:w.addEvent(C[P].substr(2));this.$=C[P];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(t,[2,5],{5:6}),e(t,[2,2]),e(t,[2,3]),e(t,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:n,15:r,17:i,19:o,20:a,21:17,22:18,23:s,24:l},e(t,[2,10],{1:[2,1]}),e(t,[2,6]),{12:21,14:n,15:r,17:i,19:o,20:a,21:17,22:18,23:s,24:l},e(t,[2,8]),e(t,[2,9]),e(t,[2,11]),{16:[1,22]},{18:[1,23]},e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,7]),e(t,[2,12]),e(t,[2,13])],defaultActions:{},parseError:B(function h(m,g){if(g.recoverable){this.trace(m)}else{var x=new Error(m);x.hash=g;throw x}},"parseError"),parse:B(function h(m){var g=this,x=[0],w=[],_=[null],C=[],A=this.table,P="",L=0,I=0,N=0,O=2,z=1;var U=C.slice.call(arguments,1);var W=Object.create(this.lexer);var H={yy:{}};for(var $ in this.yy){if(Object.prototype.hasOwnProperty.call(this.yy,$)){H.yy[$]=this.yy[$]}}W.setInput(m,H.yy);H.yy.lexer=W;H.yy.parser=this;if(typeof W.yylloc=="undefined"){W.yylloc={}}var K=W.yylloc;C.push(K);var X=W.options&&W.options.ranges;if(typeof H.yy.parseError==="function"){this.parseError=H.yy.parseError}else{this.parseError=Object.getPrototypeOf(this).parseError}function j(Ve){x.length=x.length-2*Ve;_.length=_.length-Ve;C.length=C.length-Ve}B(j,"popStack");function te(){var Ve;Ve=w.pop()||W.lex()||z;if(typeof Ve!=="number"){if(Ve instanceof Array){w=Ve;Ve=w.pop()}Ve=g.symbols_[Ve]||Ve}return Ve}B(te,"lex");var J,oe,se,re,ce,ue,xe={},be,Ie,he,ve;while(true){se=x[x.length-1];if(this.defaultActions[se]){re=this.defaultActions[se]}else{if(J===null||typeof J=="undefined"){J=te()}re=A[se]&&A[se][J]}if(typeof re==="undefined"||!re.length||!re[0]){var ge="";ve=[];for(be in A[se]){if(this.terminals_[be]&&be>O){ve.push("'"+this.terminals_[be]+"'")}}if(W.showPosition){ge="Parse error on line "+(L+1)+":\n"+W.showPosition()+"\nExpecting "+ve.join(", ")+", got '"+(this.terminals_[J]||J)+"'"}else{ge="Parse error on line "+(L+1)+": Unexpected "+(J==z?"end of input":"'"+(this.terminals_[J]||J)+"'")}this.parseError(ge,{text:W.match,token:this.terminals_[J]||J,line:W.yylineno,loc:K,expected:ve})}if(re[0]instanceof Array&&re.length>1){throw new Error("Parse Error: multiple actions possible at state: "+se+", token: "+J)}switch(re[0]){case 1:x.push(J);_.push(W.yytext);C.push(W.yylloc);x.push(re[1]);J=null;if(!oe){I=W.yyleng;P=W.yytext;L=W.yylineno;K=W.yylloc;if(N>0){N--}}else{J=oe;oe=null}break;case 2:Ie=this.productions_[re[1]][1];xe.$=_[_.length-Ie];xe._$={first_line:C[C.length-(Ie||1)].first_line,last_line:C[C.length-1].last_line,first_column:C[C.length-(Ie||1)].first_column,last_column:C[C.length-1].last_column};if(X){xe._$.range=[C[C.length-(Ie||1)].range[0],C[C.length-1].range[1]]}ue=this.performAction.apply(xe,[P,I,L,H.yy,re[1],_,C].concat(U));if(typeof ue!=="undefined"){return ue}if(Ie){x=x.slice(0,-1*Ie*2);_=_.slice(0,-1*Ie);C=C.slice(0,-1*Ie)}x.push(this.productions_[re[1]][0]);_.push(xe.$);C.push(xe._$);he=A[x[x.length-2]][x[x.length-1]];x.push(he);break;case 3:return true}}return true},"parse")};var d=function(){var h={EOF:1,parseError:B(function m(g,x){if(this.yy.parser){this.yy.parser.parseError(g,x)}else{throw new Error(g)}},"parseError"),setInput:B(function(m,g){this.yy=g||this.yy||{};this._input=m;this._more=this._backtrack=this.done=false;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};if(this.options.ranges){this.yylloc.range=[0,0]}this.offset=0;return this},"setInput"),input:B(function(){var m=this._input[0];this.yytext+=m;this.yyleng++;this.offset++;this.match+=m;this.matched+=m;var g=m.match(/(?:\r\n?|\n).*/g);if(g){this.yylineno++;this.yylloc.last_line++}else{this.yylloc.last_column++}if(this.options.ranges){this.yylloc.range[1]++}this._input=this._input.slice(1);return m},"input"),unput:B(function(m){var g=m.length;var x=m.split(/(?:\r\n?|\n)/g);this._input=m+this._input;this.yytext=this.yytext.substr(0,this.yytext.length-g);this.offset-=g;var w=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1);this.matched=this.matched.substr(0,this.matched.length-1);if(x.length-1){this.yylineno-=x.length-1}var _=this.yylloc.range;this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:x?(x.length===w.length?this.yylloc.first_column:0)+w[w.length-x.length].length-x[0].length:this.yylloc.first_column-g};if(this.options.ranges){this.yylloc.range=[_[0],_[0]+this.yyleng-g]}this.yyleng=this.yytext.length;return this},"unput"),more:B(function(){this._more=true;return this},"more"),reject:B(function(){if(this.options.backtrack_lexer){this._backtrack=true}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}return this},"reject"),less:B(function(m){this.unput(this.match.slice(m))},"less"),pastInput:B(function(){var m=this.matched.substr(0,this.matched.length-this.match.length);return(m.length>20?"...":"")+m.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:B(function(){var m=this.match;if(m.length<20){m+=this._input.substr(0,20-m.length)}return(m.substr(0,20)+(m.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:B(function(){var m=this.pastInput();var g=new Array(m.length+1).join("-");return m+this.upcomingInput()+"\n"+g+"^"},"showPosition"),test_match:B(function(m,g){var x,w,_;if(this.options.backtrack_lexer){_={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done};if(this.options.ranges){_.yylloc.range=this.yylloc.range.slice(0)}}w=m[0].match(/(?:\r\n?|\n).*/g);if(w){this.yylineno+=w.length}this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:w?w[w.length-1].length-w[w.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+m[0].length};this.yytext+=m[0];this.match+=m[0];this.matches=m;this.yyleng=this.yytext.length;if(this.options.ranges){this.yylloc.range=[this.offset,this.offset+=this.yyleng]}this._more=false;this._backtrack=false;this._input=this._input.slice(m[0].length);this.matched+=m[0];x=this.performAction.call(this,this.yy,this,g,this.conditionStack[this.conditionStack.length-1]);if(this.done&&this._input){this.done=false}if(x){return x}else if(this._backtrack){for(var C in _){this[C]=_[C]}return false}return false},"test_match"),next:B(function(){if(this.done){return this.EOF}if(!this._input){this.done=true}var m,g,x,w;if(!this._more){this.yytext="";this.match=""}var _=this._currentRules();for(var C=0;C<_.length;C++){x=this._input.match(this.rules[_[C]]);if(x&&(!g||x[0].length>g[0].length)){g=x;w=C;if(this.options.backtrack_lexer){m=this.test_match(x,_[C]);if(m!==false){return m}else if(this._backtrack){g=false;continue}else{return false}}else if(!this.options.flex){break}}}if(g){m=this.test_match(g,_[w]);if(m!==false){return m}return false}if(this._input===""){return this.EOF}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}},"next"),lex:B(function m(){var g=this.next();if(g){return g}else{return this.lex()}},"lex"),begin:B(function m(g){this.conditionStack.push(g)},"begin"),popState:B(function m(){var g=this.conditionStack.length-1;if(g>0){return this.conditionStack.pop()}else{return this.conditionStack[0]}},"popState"),_currentRules:B(function m(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules}else{return this.conditions["INITIAL"].rules}},"_currentRules"),topState:B(function m(g){g=this.conditionStack.length-1-Math.abs(g||0);if(g>=0){return this.conditionStack[g]}else{return"INITIAL"}},"topState"),pushState:B(function m(g){this.begin(g)},"pushState"),stateStackSize:B(function m(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":true},performAction:B(function m(g,x,w,_){var C=_;switch(w){case 0:break;case 1:break;case 2:return 13;break;case 3:break;case 4:break;case 5:return 8;break;case 6:return 9;break;case 7:return 7;break;case 8:return 14;break;case 9:this.begin("acc_title");return 15;break;case 10:this.popState();return"acc_title_value";break;case 11:this.begin("acc_descr");return 17;break;case 12:this.popState();return"acc_descr_value";break;case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";break;case 16:return 20;break;case 17:return 24;break;case 18:return 23;break;case 19:return 6;break;case 20:return"INVALID";break}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{"acc_descr_multiline":{"rules":[14,15],"inclusive":false},"acc_descr":{"rules":[12],"inclusive":false},"acc_title":{"rules":[10],"inclusive":false},"INITIAL":{"rules":[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],"inclusive":true}}};return h}();u.lexer=d;function f(){this.yy={}}B(f,"Parser");f.prototype=u;u.Parser=f;return new f}();Mlt.parser=Mlt;eGi=Mlt;N5n={};ZM(N5n,{addEvent:()=>Y5n,addSection:()=>$5n,addTask:()=>W5n,addTaskOrg:()=>q5n,clear:()=>z5n,default:()=>tGi,getCommonDb:()=>B5n,getDirection:()=>V5n,getSections:()=>G5n,getTasks:()=>H5n,setDirection:()=>U5n});SH="";O5n=0;Dlt="LR";Flt=[];qPe=[];AH=[];B5n=B(()=>o2e,"getCommonDb");z5n=B(function(){Flt.length=0;qPe.length=0;SH="";AH.length=0;Dlt="LR";Da()},"clear");U5n=B(function(e){Dlt=e},"setDirection");V5n=B(function(){return Dlt},"getDirection");$5n=B(function(e){SH=e;Flt.push(e)},"addSection");G5n=B(function(){return Flt},"getSections");H5n=B(function(){let e=I5n();const t=100;let n=0;while(!e&&nn.id===O5n-1);t.events.push(e)},"addEvent");q5n=B(function(e){const t={section:SH,type:SH,description:e,task:e,classes:[]};qPe.push(t)},"addTaskOrg");I5n=B(function(){const e=B(function(n){return AH[n].processed},"compileTask");let t=true;for(const[n,r]of AH.entries()){e(n);t=t&&r.processed}return t},"compileTasks");tGi={clear:z5n,getCommonDb:B5n,getDirection:V5n,setDirection:U5n,addSection:$5n,getSections:G5n,getTasks:H5n,addTask:W5n,addTaskOrg:q5n,addEvent:Y5n};X5n=0;XPe=B(function(e,t){const n=e.append("rect");n.attr("x",t.x);n.attr("y",t.y);n.attr("fill",t.fill);n.attr("stroke",t.stroke);n.attr("width",t.width);n.attr("height",t.height);n.attr("rx",t.rx);n.attr("ry",t.ry);if(t.class!==void 0){n.attr("class",t.class)}return n},"drawRect");nGi=B(function(e,t){const n=15;const r=e.append("circle").attr("cx",t.cx).attr("cy",t.cy).attr("class","face").attr("r",n).attr("stroke-width",2).attr("overflow","visible");const i=e.append("g");i.append("circle").attr("cx",t.cx-n/3).attr("cy",t.cy-n/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");i.append("circle").attr("cx",t.cx+n/3).attr("cy",t.cy-n/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function o(l){const u=Hb().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(n/2).outerRadius(n/2.2);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+t.cx+","+(t.cy+2)+")")}B(o,"smile");function a(l){const u=Hb().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(n/2).outerRadius(n/2.2);l.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+t.cx+","+(t.cy+7)+")")}B(a,"sad");function s(l){l.append("line").attr("class","mouth").attr("stroke",2).attr("x1",t.cx-5).attr("y1",t.cy+7).attr("x2",t.cx+5).attr("y2",t.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}B(s,"ambivalent");if(t.score>3){o(i)}else if(t.score<3){a(i)}else{s(i)}return r},"drawFace");rGi=B(function(e,t){const n=e.append("circle");n.attr("cx",t.cx);n.attr("cy",t.cy);n.attr("class","actor-"+t.pos);n.attr("fill",t.fill);n.attr("stroke",t.stroke);n.attr("r",t.r);if(n.class!==void 0){n.attr("class",n.class)}if(t.title!==void 0){n.append("title").text(t.title)}return n},"drawCircle");j5n=B(function(e,t){const n=t.text.replace(//gi," ");const r=e.append("text");r.attr("x",t.x);r.attr("y",t.y);r.attr("class","legend");r.style("text-anchor",t.anchor);if(t.class!==void 0){r.attr("class",t.class)}const i=r.append("tspan");i.attr("x",t.x+t.textMargin*2);i.text(n);return r},"drawText");iGi=B(function(e,t){function n(i,o,a,s,l){return i+","+o+" "+(i+a)+","+o+" "+(i+a)+","+(o+s-l)+" "+(i+a-l*1.2)+","+(o+s)+" "+i+","+(o+s)}B(n,"genPoints");const r=e.append("polygon");r.attr("points",n(t.x,t.y,50,20,7));r.attr("class","labelBox");t.y=t.y+t.labelMargin;t.x=t.x+.5*t.labelMargin;j5n(e,t)},"drawLabel");oGi=B(function(e,t,n){const r=e.append("g");const i=Nlt();i.x=t.x;i.y=t.y;i.fill=t.fill;i.width=n.width;i.height=n.height;i.class="journey-section section-type-"+t.num;i.rx=3;i.ry=3;XPe(r,i);K5n(n)(t.text,r,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+t.num},n,t.colour)},"drawSection");Llt=-1;aGi=B(function(e,t,n,r){const i=t.x+n.width/2;const o=e.append("g");Llt++;const a=300+5*30;o.append("line").attr("id",r+"-task"+Llt).attr("x1",i).attr("y1",t.y).attr("x2",i).attr("y2",a).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666");nGi(o,{cx:i,cy:300+(5-t.score)*30,score:t.score});const s=Nlt();s.x=t.x;s.y=t.y;s.fill=t.fill;s.width=n.width;s.height=n.height;s.class="task task-type-"+t.num;s.rx=3;s.ry=3;XPe(o,s);K5n(n)(t.task,o,s.x,s.y,s.width,s.height,{class:"task"},n,t.colour)},"drawTask");sGi=B(function(e,t){const n=XPe(e,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,class:"rect"});n.lower()},"drawBackgroundRect");lGi=B(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj");Nlt=B(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect");K5n=function(){function e(i,o,a,s,l,u,d,f){const h=o.append("text").attr("x",a+l/2).attr("y",s+u/2+5).style("font-color",f).style("text-anchor","middle").text(i);r(h,d)}B(e,"byText");function t(i,o,a,s,l,u,d,f,h){const{taskFontSize:m,taskFontFamily:g}=f;const x=i.split(//gi);for(let w=0;w0?`M0 ${t.height-s} v${-t.height+2*s} q0,-${a},${a},-${a} h${t.width-2*s} q${a},0,${a},${a} v${t.height-s} H0 Z`:`M0 ${t.height-s} v${-(t.height-s)} h${t.width} v${t.height} H0 Z`;e.append("path").attr("id",r+"-node-"+X5n++).attr("class","node-bkg node-"+t.type).attr("d",l);if(!o?.includes("redux")){e.append("line").attr("class","node-line-"+n).attr("x1",0).attr("y1",t.height).attr("x2",t.width).attr("y2",t.height)}},"defaultBkg");Dx={drawRect:XPe,drawCircle:rGi,drawSection:oGi,drawText:j5n,drawLabel:iGi,drawTask:aGi,drawBackgroundRect:sGi,getTextObj:lGi,getNoteRect:Nlt,initGraphics:cGi,drawNode:uGi,getVirtualNodeHeight:dGi};hGi=B(function(e,t,n,r){const i=Mn();const{look:o,theme:a,themeVariables:s}=i;const{useGradient:l,gradientStart:u,gradientStop:d}=s;const f=i.timeline?.leftMargin??50;wt.debug("timeline",r.db);const h=i.securityLevel;let m;if(h==="sandbox"){m=zr("#i"+t)}const g=h==="sandbox"?zr(m.nodes()[0].contentDocument.body):zr("body");const x=g.select("#"+t);x.append("g");const w=r.db.getTasks();const _=r.db.getCommonDb().getDiagramTitle();wt.debug("task",w);Dx.initGraphics(x,t);const C=r.db.getSections();wt.debug("sections",C);let A=0;let P=0;let L=0;let I=0;let N=50+f;let O=50;I=50;let z=0;let U=true;C.forEach(function(X){const j={number:z,descr:X,section:z,width:150,padding:20,maxHeight:A};const te=Dx.getVirtualNodeHeight(x,j,i);wt.debug("sectionHeight before draw",te);A=Math.max(A,te+20)});let W=0;let H=0;wt.debug("tasks.length",w.length);for(const[X,j]of w.entries()){const te={number:X,descr:j,section:j.section,width:150,padding:20,maxHeight:P};const J=Dx.getVirtualNodeHeight(x,te,i);wt.debug("taskHeight before draw",J);P=Math.max(P,J+20);W=Math.max(W,j.events.length);let oe=0;for(const se of j.events){const re={descr:se,section:j.section,number:j.section,width:150,padding:20,maxHeight:50};oe+=Dx.getVirtualNodeHeight(x,re,i)}if(j.events.length>0){oe+=(j.events.length-1)*10}H=Math.max(H,oe)}wt.debug("maxSectionHeight before draw",A);wt.debug("maxTaskHeight before draw",P);if(C&&C.length>0){C.forEach(X=>{const j=w.filter(se=>se.section===X);const te={number:z,descr:X,section:z,width:200*Math.max(j.length,1)-50,padding:20,maxHeight:A};wt.debug("sectionNode",te);const J=x.append("g");const oe=Dx.drawNode(J,te,z,i,t);wt.debug("sectionNode output",oe);J.attr("transform",`translate(${N}, ${I})`);O+=A+50;if(j.length>0){M5n(x,j,z,N,O,P,i,W,H,A,false,t)}N+=200*Math.max(j.length,1);O=I;z++})}else{U=false;M5n(x,w,z,N,O,P,i,W,H,A,true,t)}const $=x.node().getBBox();wt.debug("bounds",$);if(_){x.append("text").text(_).attr("x",o==="neo"?$.x*2+f:$.width/2-f).attr("font-size","4ex").attr("font-weight","bold").attr("y",20)}L=U?A+P+150:P+100;const K=x.append("g").attr("class","lineWrapper");K.append("line").attr("x1",f).attr("y1",L).attr("x2",$.width+3*f).attr("y2",L).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${t}-arrowhead)`);if(o==="neo"&&l&&a!=="neutral"){const X=x.select("defs");const j=X.empty()?x.append("defs"):X;const te=j.append("linearGradient").attr("id",x.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");te.append("stop").attr("offset","0%").attr("stop-color",u).attr("stop-opacity",1);te.append("stop").attr("offset","100%").attr("stop-color",d).attr("stop-opacity",1)}zC(void 0,x,i.timeline?.padding??50,i.timeline?.useMaxWidth??false)},"draw");M5n=B(function(e,t,n,r,i,o,a,s,l,u,d,f){for(const h of t){const m={descr:h.task,section:n,number:n,width:150,padding:20,maxHeight:o};wt.debug("taskNode",m);const g=e.append("g").attr("class","taskWrapper");const x=Dx.drawNode(g,m,n,a,f);const w=x.height;wt.debug("taskHeight after draw",w);g.attr("transform",`translate(${r}, ${i})`);o=Math.max(o,w);if(h.events){const _=e.append("g").attr("class","lineWrapper");let C=o;i+=100;C=C+pGi(e,h.events,n,r,i,a,f);i-=100;_.append("line").attr("x1",r+190/2).attr("y1",i+o).attr("x2",r+190/2).attr("y2",i+o+100+l+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${f}-arrowhead)`).attr("stroke-dasharray","5,5")}r=r+200;if(d&&!a.timeline?.disableMulticolor){n++}}i=i-10},"drawTasks");pGi=B(function(e,t,n,r,i,o,a){let s=0;const l=i;i=i+100;for(const u of t){const d={descr:u,section:n,number:n,width:150,padding:20,maxHeight:50};wt.debug("eventNode",d);const f=e.append("g").attr("class","eventWrapper");const h=Dx.drawNode(f,d,n,o,a,true);const m=h.height;s=s+m;f.attr("transform",`translate(${r}, ${i})`);i=i+10+m}i=l;return s},"drawEvents");mGi={setConf:B(()=>{},"setConf"),draw:hGi};jPe=200;mP=5;gGi=jPe+mP*2;Blt=jPe+100;yGi=Blt+mP*2;Z5n=10;bGi=0;L5n=20;J5n=20;D5n=30;Q5n=50;xGi=B(function(e,t,n,r){const i=Mn();const o=i.timeline?.leftMargin??50;wt.debug("timeline",r.db);const a=Sc(t);a.append("g");const s=r.db.getTasks();const l=r.db.getCommonDb().getDiagramTitle();wt.debug("task",s);Dx.initGraphics(a);const u=r.db.getSections();wt.debug("sections",u);let d=0;let f=0;const h=50+o;let m=50;const g=m;const x=h;const w=gGi+J5n;const _=yGi+Q5n;const C=x+w;let A=0;const P=u&&u.length>0;const L=P?C:h+w;const I=Math.max(50,w+_-mP*2);u.forEach(function(X){const j={number:A,descr:X,section:A,width:I,padding:mP,maxHeight:d};const te=Dx.getVirtualNodeHeight(a,j,i);wt.debug("sectionHeight before draw",te);d=Math.max(d,te)});let N=0;wt.debug("tasks.length",s.length);for(const[X,j]of s.entries()){const te={number:X,descr:j,section:j.section,width:jPe,padding:mP,maxHeight:f};const J=Dx.getVirtualNodeHeight(a,te,i);wt.debug("taskHeight before draw",J);f=Math.max(f,J);let oe=0;for(const se of j.events){const re={descr:se,section:j.section,number:j.section,width:Blt,padding:mP,maxHeight:50};oe+=Dx.getVirtualNodeHeight(a,re,i)}if(j.events.length>0){oe+=(j.events.length-1)*Z5n}N=Math.max(N,oe)+bGi}wt.debug("maxSectionHeight before draw",d);wt.debug("maxTaskHeight before draw",f);const O=Math.max(f,N);const z=O+D5n;if(P){u.forEach(X=>{const j=s.filter(xe=>xe.section===X);const te={number:A,descr:X,section:A,width:I,padding:mP,maxHeight:d};wt.debug("sectionNode",te);const J=a.append("g");const oe=Dx.drawNode(J,te,A,i);wt.debug("sectionNode output",oe);const se=L-w;J.attr("transform",`translate(${se}, ${m})`);const re=m+oe.height+L5n;if(j.length>0){F5n(a,j,A,L,re,f,i,z,false)}const ce=j.length;const ue=oe.height+L5n+z*Math.max(ce,1)-(ce>0?D5n*2:0);m+=ue;A++})}else{F5n(a,s,A,L,m,f,i,z,true)}let U=a.node()?.getBBox();if(!U){throw new Error("bbox not found")}wt.debug("bounds",U);if(l){a.append("text").text(l).attr("x",U.width/2-o).attr("font-size","4ex").attr("font-weight","bold").attr("y",20);U=a.node()?.getBBox();if(!U){throw new Error("bbox not found")}wt.debug("bounds after title",U)}const[W]=mx(i.fontSize);const H=(W??16)*2;const $=(W??16)*.5+20;const K=a.append("g").attr("class","lineWrapper");K.append("line").attr("x1",L).attr("y1",g-H).attr("x2",L).attr("y2",U.y+U.height+$).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)");K.lower();zC(void 0,a,i.timeline?.padding??50,i.timeline?.useMaxWidth??false)},"draw");F5n=B(function(e,t,n,r,i,o,a,s,l){for(const u of t){const d={descr:u.task,section:n,number:n,width:jPe,padding:mP,maxHeight:o};wt.debug("taskNode",d);const f=e.append("g").attr("class","taskWrapper");const h=Dx.drawNode(f,d,n,a);const m=h.height;wt.debug("taskHeight after draw",m);const g=r-J5n-h.width;f.attr("transform",`translate(${g}, ${i})`);o=Math.max(o,m);if(u.events&&u.events.length>0){const x=i;const w=r+Q5n;vGi(e,u.events,n,r,w,x,a)}i=i+s;if(l&&!a.timeline?.disableMulticolor){n++}}},"drawTasks");vGi=B(function(e,t,n,r,i,o,a){let s=o;for(const l of t){const u={descr:l,section:n,number:n,width:Blt,padding:mP,maxHeight:0};wt.debug("eventNode",u);const d=e.append("g").attr("class","eventWrapper");const f=Dx.drawNode(d,u,n,a);const h=f.height;d.attr("transform",`translate(${i}, ${s})`);const m=e.append("g").attr("class","lineWrapper");const g=s+h/2;m.append("line").attr("x1",r).attr("y1",g).attr("x2",i).attr("y2",g).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5");s=s+h+Z5n}return s-o},"drawEvents");_Gi={setConf:B(()=>{},"setConf"),draw:xGi};TGi=B(e=>{const{theme:t}=Ji();const n=t?.includes("dark");const r=t?.includes("color");const i=e.svgId?.replace(/^#/,"")??"";const o=i?`url(#${i}-drop-shadow)`:e.dropShadow??"none";let a="";for(let s=0;s{let t="";for(let n=0;n{const{theme:t}=Ji();const n=t?.includes("redux");const r=t==="neutral";const i=e.svgId?.replace(/^#/,"")??"";let o="";if(e.useGradient&&i&&e.THEME_COLOR_LIMIT&&!r){for(let a=0;a{},"setConf"),draw:B((e,t,n,r)=>{const i=r?.db?.getDirection?.()??"LR";if(i==="TD"){return _Gi.draw(e,t,n,r)}return mGi.draw(e,t,n,r)},"draw")};AGi={db:N5n,renderer:SGi,parser:eGi,styles:CGi}});var nBn={};Oo(nBn,{diagram:()=>OGi});var zlt,kGi,RGi,gP,PGi,IGi,MGi,LGi,DGi,FGi,NGi,OGi;var rBn=Ce(()=>{lv();Cx();Tx();yx();kg();Eg();K0();Sg();Np();Jh();nl();Ta();Aa();Yo();IU();qh();zlt=function(){var e=B(function(P,L,I,N){for(I=I||{},N=P.length;N--;I[P[N]]=L);return I},"o"),t=[1,4],n=[1,13],r=[1,12],i=[1,15],o=[1,16],a=[1,20],s=[1,19],l=[6,7,8],u=[1,26],d=[1,24],f=[1,25],h=[6,7,11],m=[1,6,13,15,16,19,22],g=[1,33],x=[1,34],w=[1,6,7,11,13,15,16,19,22];var _={trace:B(function P(){},"trace"),yy:{},symbols_:{"error":2,"start":3,"mindMap":4,"spaceLines":5,"SPACELINE":6,"NL":7,"MINDMAP":8,"document":9,"stop":10,"EOF":11,"statement":12,"SPACELIST":13,"node":14,"ICON":15,"CLASS":16,"nodeWithId":17,"nodeWithoutId":18,"NODE_DSTART":19,"NODE_DESCR":20,"NODE_DEND":21,"NODE_ID":22,"$accept":0,"$end":1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:B(function P(L,I,N,O,z,U,W){var H=U.length-1;switch(z){case 6:case 7:return O;break;case 8:O.getLogger().trace("Stop NL ");break;case 9:O.getLogger().trace("Stop EOF ");break;case 11:O.getLogger().trace("Stop NL2 ");break;case 12:O.getLogger().trace("Stop EOF2 ");break;case 15:O.getLogger().info("Node: ",U[H].id);O.addNode(U[H-1].length,U[H].id,U[H].descr,U[H].type);break;case 16:O.getLogger().trace("Icon: ",U[H]);O.decorateNode({icon:U[H]});break;case 17:case 21:O.decorateNode({class:U[H]});break;case 18:O.getLogger().trace("SPACELIST");break;case 19:O.getLogger().trace("Node: ",U[H].id);O.addNode(0,U[H].id,U[H].descr,U[H].type);break;case 20:O.decorateNode({icon:U[H]});break;case 25:O.getLogger().trace("node found ..",U[H-2]);this.$={id:U[H-1],descr:U[H-1],type:O.getType(U[H-2],U[H])};break;case 26:this.$={id:U[H],descr:U[H],type:O.nodeType.DEFAULT};break;case 27:O.getLogger().trace("node found ..",U[H-3]);this.$={id:U[H-3],descr:U[H-1],type:O.getType(U[H-2],U[H])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:t},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:t},{6:n,7:[1,10],9:9,12:11,13:r,14:14,15:i,16:o,17:17,18:18,19:a,22:s},e(l,[2,3]),{1:[2,2]},e(l,[2,4]),e(l,[2,5]),{1:[2,6],6:n,12:21,13:r,14:14,15:i,16:o,17:17,18:18,19:a,22:s},{6:n,9:22,12:11,13:r,14:14,15:i,16:o,17:17,18:18,19:a,22:s},{6:u,7:d,10:23,11:f},e(h,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:a,22:s}),e(h,[2,18]),e(h,[2,19]),e(h,[2,20]),e(h,[2,21]),e(h,[2,23]),e(h,[2,24]),e(h,[2,26],{19:[1,30]}),{20:[1,31]},{6:u,7:d,10:32,11:f},{1:[2,7],6:n,12:21,13:r,14:14,15:i,16:o,17:17,18:18,19:a,22:s},e(m,[2,14],{7:g,11:x}),e(w,[2,8]),e(w,[2,9]),e(w,[2,10]),e(h,[2,15]),e(h,[2,16]),e(h,[2,17]),{20:[1,35]},{21:[1,36]},e(m,[2,13],{7:g,11:x}),e(w,[2,11]),e(w,[2,12]),{21:[1,37]},e(h,[2,25]),e(h,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:B(function P(L,I){if(I.recoverable){this.trace(L)}else{var N=new Error(L);N.hash=I;throw N}},"parseError"),parse:B(function P(L){var I=this,N=[0],O=[],z=[null],U=[],W=this.table,H="",$=0,K=0,X=0,j=2,te=1;var J=U.slice.call(arguments,1);var oe=Object.create(this.lexer);var se={yy:{}};for(var re in this.yy){if(Object.prototype.hasOwnProperty.call(this.yy,re)){se.yy[re]=this.yy[re]}}oe.setInput(L,se.yy);se.yy.lexer=oe;se.yy.parser=this;if(typeof oe.yylloc=="undefined"){oe.yylloc={}}var ce=oe.yylloc;U.push(ce);var ue=oe.options&&oe.options.ranges;if(typeof se.yy.parseError==="function"){this.parseError=se.yy.parseError}else{this.parseError=Object.getPrototypeOf(this).parseError}function xe(Ge){N.length=N.length-2*Ge;z.length=z.length-Ge;U.length=U.length-Ge}B(xe,"popStack");function be(){var Ge;Ge=O.pop()||oe.lex()||te;if(typeof Ge!=="number"){if(Ge instanceof Array){O=Ge;Ge=O.pop()}Ge=I.symbols_[Ge]||Ge}return Ge}B(be,"lex");var Ie,he,ve,ge,Ve,Le,$e={},Ee,tt,yt,mt;while(true){ve=N[N.length-1];if(this.defaultActions[ve]){ge=this.defaultActions[ve]}else{if(Ie===null||typeof Ie=="undefined"){Ie=be()}ge=W[ve]&&W[ve][Ie]}if(typeof ge==="undefined"||!ge.length||!ge[0]){var ct="";mt=[];for(Ee in W[ve]){if(this.terminals_[Ee]&&Ee>j){mt.push("'"+this.terminals_[Ee]+"'")}}if(oe.showPosition){ct="Parse error on line "+($+1)+":\n"+oe.showPosition()+"\nExpecting "+mt.join(", ")+", got '"+(this.terminals_[Ie]||Ie)+"'"}else{ct="Parse error on line "+($+1)+": Unexpected "+(Ie==te?"end of input":"'"+(this.terminals_[Ie]||Ie)+"'")}this.parseError(ct,{text:oe.match,token:this.terminals_[Ie]||Ie,line:oe.yylineno,loc:ce,expected:mt})}if(ge[0]instanceof Array&&ge.length>1){throw new Error("Parse Error: multiple actions possible at state: "+ve+", token: "+Ie)}switch(ge[0]){case 1:N.push(Ie);z.push(oe.yytext);U.push(oe.yylloc);N.push(ge[1]);Ie=null;if(!he){K=oe.yyleng;H=oe.yytext;$=oe.yylineno;ce=oe.yylloc;if(X>0){X--}}else{Ie=he;he=null}break;case 2:tt=this.productions_[ge[1]][1];$e.$=z[z.length-tt];$e._$={first_line:U[U.length-(tt||1)].first_line,last_line:U[U.length-1].last_line,first_column:U[U.length-(tt||1)].first_column,last_column:U[U.length-1].last_column};if(ue){$e._$.range=[U[U.length-(tt||1)].range[0],U[U.length-1].range[1]]}Le=this.performAction.apply($e,[H,K,$,se.yy,ge[1],z,U].concat(J));if(typeof Le!=="undefined"){return Le}if(tt){N=N.slice(0,-1*tt*2);z=z.slice(0,-1*tt);U=U.slice(0,-1*tt)}N.push(this.productions_[ge[1]][0]);z.push($e.$);U.push($e._$);yt=W[N[N.length-2]][N[N.length-1]];N.push(yt);break;case 3:return true}}return true},"parse")};var C=function(){var P={EOF:1,parseError:B(function L(I,N){if(this.yy.parser){this.yy.parser.parseError(I,N)}else{throw new Error(I)}},"parseError"),setInput:B(function(L,I){this.yy=I||this.yy||{};this._input=L;this._more=this._backtrack=this.done=false;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};if(this.options.ranges){this.yylloc.range=[0,0]}this.offset=0;return this},"setInput"),input:B(function(){var L=this._input[0];this.yytext+=L;this.yyleng++;this.offset++;this.match+=L;this.matched+=L;var I=L.match(/(?:\r\n?|\n).*/g);if(I){this.yylineno++;this.yylloc.last_line++}else{this.yylloc.last_column++}if(this.options.ranges){this.yylloc.range[1]++}this._input=this._input.slice(1);return L},"input"),unput:B(function(L){var I=L.length;var N=L.split(/(?:\r\n?|\n)/g);this._input=L+this._input;this.yytext=this.yytext.substr(0,this.yytext.length-I);this.offset-=I;var O=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1);this.matched=this.matched.substr(0,this.matched.length-1);if(N.length-1){this.yylineno-=N.length-1}var z=this.yylloc.range;this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:N?(N.length===O.length?this.yylloc.first_column:0)+O[O.length-N.length].length-N[0].length:this.yylloc.first_column-I};if(this.options.ranges){this.yylloc.range=[z[0],z[0]+this.yyleng-I]}this.yyleng=this.yytext.length;return this},"unput"),more:B(function(){this._more=true;return this},"more"),reject:B(function(){if(this.options.backtrack_lexer){this._backtrack=true}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}return this},"reject"),less:B(function(L){this.unput(this.match.slice(L))},"less"),pastInput:B(function(){var L=this.matched.substr(0,this.matched.length-this.match.length);return(L.length>20?"...":"")+L.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:B(function(){var L=this.match;if(L.length<20){L+=this._input.substr(0,20-L.length)}return(L.substr(0,20)+(L.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:B(function(){var L=this.pastInput();var I=new Array(L.length+1).join("-");return L+this.upcomingInput()+"\n"+I+"^"},"showPosition"),test_match:B(function(L,I){var N,O,z;if(this.options.backtrack_lexer){z={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done};if(this.options.ranges){z.yylloc.range=this.yylloc.range.slice(0)}}O=L[0].match(/(?:\r\n?|\n).*/g);if(O){this.yylineno+=O.length}this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:O?O[O.length-1].length-O[O.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+L[0].length};this.yytext+=L[0];this.match+=L[0];this.matches=L;this.yyleng=this.yytext.length;if(this.options.ranges){this.yylloc.range=[this.offset,this.offset+=this.yyleng]}this._more=false;this._backtrack=false;this._input=this._input.slice(L[0].length);this.matched+=L[0];N=this.performAction.call(this,this.yy,this,I,this.conditionStack[this.conditionStack.length-1]);if(this.done&&this._input){this.done=false}if(N){return N}else if(this._backtrack){for(var U in z){this[U]=z[U]}return false}return false},"test_match"),next:B(function(){if(this.done){return this.EOF}if(!this._input){this.done=true}var L,I,N,O;if(!this._more){this.yytext="";this.match=""}var z=this._currentRules();for(var U=0;UI[0].length)){I=N;O=U;if(this.options.backtrack_lexer){L=this.test_match(N,z[U]);if(L!==false){return L}else if(this._backtrack){I=false;continue}else{return false}}else if(!this.options.flex){break}}}if(I){L=this.test_match(I,z[O]);if(L!==false){return L}return false}if(this._input===""){return this.EOF}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}},"next"),lex:B(function L(){var I=this.next();if(I){return I}else{return this.lex()}},"lex"),begin:B(function L(I){this.conditionStack.push(I)},"begin"),popState:B(function L(){var I=this.conditionStack.length-1;if(I>0){return this.conditionStack.pop()}else{return this.conditionStack[0]}},"popState"),_currentRules:B(function L(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules}else{return this.conditions["INITIAL"].rules}},"_currentRules"),topState:B(function L(I){I=this.conditionStack.length-1-Math.abs(I||0);if(I>=0){return this.conditionStack[I]}else{return"INITIAL"}},"topState"),pushState:B(function L(I){this.begin(I)},"pushState"),stateStackSize:B(function L(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":true},performAction:B(function L(I,N,O,z){var U=z;switch(O){case 0:I.getLogger().trace("Found comment",N.yytext);return 6;break;case 1:return 8;break;case 2:this.begin("CLASS");break;case 3:this.popState();return 16;break;case 4:this.popState();break;case 5:I.getLogger().trace("Begin icon");this.begin("ICON");break;case 6:I.getLogger().trace("SPACELINE");return 6;break;case 7:return 7;break;case 8:return 15;break;case 9:I.getLogger().trace("end icon");this.popState();break;case 10:I.getLogger().trace("Exploding node");this.begin("NODE");return 19;break;case 11:I.getLogger().trace("Cloud");this.begin("NODE");return 19;break;case 12:I.getLogger().trace("Explosion Bang");this.begin("NODE");return 19;break;case 13:I.getLogger().trace("Cloud Bang");this.begin("NODE");return 19;break;case 14:this.begin("NODE");return 19;break;case 15:this.begin("NODE");return 19;break;case 16:this.begin("NODE");return 19;break;case 17:this.begin("NODE");return 19;break;case 18:return 13;break;case 19:return 22;break;case 20:return 11;break;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";break;case 23:this.popState();break;case 24:I.getLogger().trace("Starting NSTR");this.begin("NSTR");break;case 25:I.getLogger().trace("description:",N.yytext);return"NODE_DESCR";break;case 26:this.popState();break;case 27:this.popState();I.getLogger().trace("node end ))");return"NODE_DEND";break;case 28:this.popState();I.getLogger().trace("node end )");return"NODE_DEND";break;case 29:this.popState();I.getLogger().trace("node end ...",N.yytext);return"NODE_DEND";break;case 30:this.popState();I.getLogger().trace("node end ((");return"NODE_DEND";break;case 31:this.popState();I.getLogger().trace("node end (-");return"NODE_DEND";break;case 32:this.popState();I.getLogger().trace("node end (-");return"NODE_DEND";break;case 33:this.popState();I.getLogger().trace("node end ((");return"NODE_DEND";break;case 34:this.popState();I.getLogger().trace("node end ((");return"NODE_DEND";break;case 35:I.getLogger().trace("Long description:",N.yytext);return 20;break;case 36:I.getLogger().trace("Long description:",N.yytext);return 20;break}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{"CLASS":{"rules":[3,4],"inclusive":false},"ICON":{"rules":[8,9],"inclusive":false},"NSTR2":{"rules":[22,23],"inclusive":false},"NSTR":{"rules":[25,26],"inclusive":false},"NODE":{"rules":[21,24,27,28,29,30,31,32,33,34,35,36],"inclusive":false},"INITIAL":{"rules":[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],"inclusive":true}}};return P}();_.lexer=C;function A(){this.yy={}}B(A,"Parser");A.prototype=_;_.Parser=A;return new A}();zlt.parser=zlt;kGi=zlt;RGi=12;gP={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6};PGi=class{constructor(){this.nodes=[];this.count=0;this.elements={};this.getLogger=this.getLogger.bind(this);this.nodeType=gP;this.clear();this.getType=this.getType.bind(this);this.getElementById=this.getElementById.bind(this);this.getParent=this.getParent.bind(this);this.getMindmap=this.getMindmap.bind(this);this.addNode=this.addNode.bind(this);this.decorateNode=this.decorateNode.bind(this)}static{B(this,"MindmapDB")}clear(){this.nodes=[];this.count=0;this.elements={};this.baseLevel=void 0}getParent(e){for(let t=this.nodes.length-1;t>=0;t--){if(this.nodes[t].level0?this.nodes[0]:null}addNode(e,t,n,r){wt.info("addNode",e,t,n,r);let i=false;if(this.nodes.length===0){this.baseLevel=e;e=0;i=true}else if(this.baseLevel!==void 0){e=e-this.baseLevel;i=false}const o=Mn();let a=o.mindmap?.padding??ka.mindmap.padding;switch(r){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:a*=2;break}const s={id:this.count++,nodeId:La(t,o),level:e,descr:La(n,o),type:r,children:[],width:o.mindmap?.maxNodeWidth??ka.mindmap.maxNodeWidth,padding:a,isRoot:i};const l=this.getParent(e);if(l){l.children.push(s);this.nodes.push(s)}else{if(i){this.nodes.push(s)}else{throw new Error(`There can be only one root. No parent could be found for ("${s.descr}")`)}}}getType(e,t){wt.debug("In get type",e,t);switch(e){case"[":return this.nodeType.RECT;case"(":return t===")"?this.nodeType.ROUNDED_RECT:this.nodeType.CLOUD;case"((":return this.nodeType.CIRCLE;case")":return this.nodeType.CLOUD;case"))":return this.nodeType.BANG;case"{{":return this.nodeType.HEXAGON;default:return this.nodeType.DEFAULT}}setElementForId(e,t){this.elements[e]=t}getElementById(e){return this.elements[e]}decorateNode(e){if(!e){return}const t=Mn();const n=this.nodes[this.nodes.length-1];if(e.icon){n.icon=La(e.icon,t)}if(e.class){n.class=La(e.class,t)}}type2Str(e){switch(e){case this.nodeType.DEFAULT:return"no-border";case this.nodeType.RECT:return"rect";case this.nodeType.ROUNDED_RECT:return"rounded-rect";case this.nodeType.CIRCLE:return"circle";case this.nodeType.CLOUD:return"cloud";case this.nodeType.BANG:return"bang";case this.nodeType.HEXAGON:return"hexgon";default:return"no-border"}}assignSections(e,t){if(e.level===0){e.section=void 0}else{e.section=t}if(e.children){for(const[n,r]of e.children.entries()){const i=e.level===0?n%(RGi-1):t;this.assignSections(r,i)}}}flattenNodes(e,t){const n=Mn();const r=["mindmap-node"];if(e.isRoot===true){r.push("section-root","section--1")}else if(e.section!==void 0){r.push(`section-${e.section}`)}if(e.class){r.push(e.class)}const i=r.join(" ");const o=B(s=>{const l=n.theme?.toLowerCase()??"";const u=l.includes("redux");switch(s){case gP.CIRCLE:return"mindmapCircle";case gP.RECT:return"rect";case gP.ROUNDED_RECT:return"rounded";case gP.CLOUD:return"cloud";case gP.BANG:return"bang";case gP.HEXAGON:return"hexagon";case gP.DEFAULT:return u?"rounded":"defaultMindmapNode";case gP.NO_BORDER:default:return"rect"}},"getShapeFromType");const a={id:e.id.toString(),domId:"node_"+e.id.toString(),label:e.descr,labelType:"markdown",isGroup:false,shape:o(e.type),width:e.width,height:e.height??0,padding:e.padding,cssClasses:i,cssStyles:[],look:n.look,icon:e.icon,x:e.x,y:e.y,level:e.level,nodeId:e.nodeId,type:e.type,section:e.section};t.push(a);if(e.children){for(const s of e.children){this.flattenNodes(s,t)}}}generateEdges(e,t){if(!e.children){return}const n=Mn();for(const r of e.children){let i="edge";if(r.section!==void 0){i+=` section-edge-${r.section}`}const o=e.level+1;i+=` edge-depth-${o}`;const a={id:`edge_${e.id}_${r.id}`,start:e.id.toString(),end:r.id.toString(),type:"normal",curve:"basis",thickness:"normal",look:n.look,classes:i,depth:e.level,section:r.section};t.push(a);this.generateEdges(r,t)}}getData(){const e=this.getMindmap();const t=Mn();const n=n2e();const r=n.layout!==void 0;const i=t;if(!r){i.layout="cose-bilkent"}if(!e){return{nodes:[],edges:[],config:i}}wt.debug("getData: mindmapRoot",e,t);this.assignSections(e);const o=[];const a=[];this.flattenNodes(e,o);this.generateEdges(e,a);wt.debug(`getData: processed ${o.length} nodes and ${a.length} edges`);const s=new Map;for(const l of o){s.set(l.id,{shape:l.shape,width:l.width,height:l.height,padding:l.padding})}return{nodes:o,edges:a,config:i,rootNode:e,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(s),type:"mindmap",diagramId:"mindmap-"+cw()}}getLogger(){return wt}};IGi=B(async(e,t,n,r)=>{wt.debug("Rendering mindmap diagram\n"+e);const i=r.db;const o=i.getData();const a=G_(t,o.config.securityLevel);o.type=r.type;o.layoutAlgorithm=nS(o.config.layout,{fallback:"cose-bilkent"});o.diagramId=t;const s=i.getMindmap();if(!s){return}o.nodes.forEach(h=>{if(h.shape==="rounded"){h.radius=15;h.taper=15;h.stroke="none";h.width=0;h.padding=15}else if(h.shape==="circle"){h.padding=10}else if(h.shape==="rect"){h.width=0;h.padding=10}else if(h.shape==="hexagon"){h.width=0;h.height=0}});await B_(o,a);const{themeVariables:l}=Ji();const{useGradient:u,gradientStart:d,gradientStop:f}=l;if(u&&d&&f){const h=a.attr("id");const m=a.append("defs").append("linearGradient").attr("id",`${h}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");m.append("stop").attr("offset","0%").attr("stop-color",d).attr("stop-opacity",1);m.append("stop").attr("offset","100%").attr("stop-color",f).attr("stop-opacity",1)}Ex(a,o.config.mindmap?.padding??ka.mindmap.padding,"mindmapDiagram",o.config.mindmap?.useMaxWidth??ka.mindmap.useMaxWidth)},"draw");MGi={draw:IGi};LGi=B(e=>{const{theme:t,look:n}=e;let r="";for(let i=0;i{let r="";for(let i=0;i{const{theme:t}=e;const n=e.svgId;const r=e.dropShadow?e.dropShadow.replace("url(#drop-shadow)",`url(${n}-drop-shadow)`):"none";return` + .edge { + stroke-width: 3; + } + ${LGi(e)} + .section-root rect, .section-root path, .section-root circle, .section-root polygon { + fill: ${e.git0}; + } + .section-root text { + fill: ${e.gitBranchLabel0}; + } + .section-root span { + color: ${t?.includes("redux")?e.nodeBorder:e.gitBranchLabel0}; + } + .icon-container { + height:100%; + display: flex; + justify-content: center; + align-items: center; + } + .edge { + fill: none; + } + .mindmap-node-label { + dy: 1em; + alignment-baseline: middle; + text-anchor: middle; + dominant-baseline: middle; + text-align: center; + } + [data-look="neo"].mindmap-node { + filter: ${r}; + } + [data-look="neo"].mindmap-node.section-root rect, [data-look="neo"].mindmap-node.section-root path, [data-look="neo"].mindmap-node.section-root circle, [data-look="neo"].mindmap-node.section-root polygon { + fill: ${t?.includes("redux")?e.mainBkg:e.git0}; + } + [data-look="neo"].mindmap-node.section-root .text-inner-tspan { + fill: ${t?.includes("redux")?e.nodeBorder:e["cScaleLabel"+(t==="neutral"?1:0)]}; + } + ${e.useGradient&&n&&e.mainBkg?DGi(e.THEME_COLOR_LIMIT,n,e.mainBkg):""} +`},"getStyles");NGi=FGi;OGi={get db(){return new PGi},renderer:MGi,parser:kGi,styles:NGi}});var oBn={};Oo(oBn,{diagram:()=>nHi});var Ult,BGi,Z_,$lt,Vlt,Glt,zGi,UGi,iBn,VGi,$Gi,Hp,GGi,HGi,WGi,YGi,qGi,XGi,jGi,KGi,ZGi,JGi,QGi,eHi,tHi,nHi;var aBn=Ce(()=>{gh();aS();Y5();kg();Eg();Sg();Np();Jh();nl();Ta();Aa();Yo();qh();Ult=function(){var e=B(function(N,O,z,U){for(z=z||{},U=N.length;U--;z[N[U]]=O);return z},"o"),t=[1,4],n=[1,13],r=[1,12],i=[1,15],o=[1,16],a=[1,20],s=[1,19],l=[6,7,8],u=[1,26],d=[1,24],f=[1,25],h=[6,7,11],m=[1,31],g=[6,7,11,24],x=[1,6,13,16,17,20,23],w=[1,35],_=[1,36],C=[1,6,7,11,13,16,17,20,23],A=[1,38];var P={trace:B(function N(){},"trace"),yy:{},symbols_:{"error":2,"start":3,"mindMap":4,"spaceLines":5,"SPACELINE":6,"NL":7,"KANBAN":8,"document":9,"stop":10,"EOF":11,"statement":12,"SPACELIST":13,"node":14,"shapeData":15,"ICON":16,"CLASS":17,"nodeWithId":18,"nodeWithoutId":19,"NODE_DSTART":20,"NODE_DESCR":21,"NODE_DEND":22,"NODE_ID":23,"SHAPE_DATA":24,"$accept":0,"$end":1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:B(function N(O,z,U,W,H,$,K){var X=$.length-1;switch(H){case 6:case 7:return W;break;case 8:W.getLogger().trace("Stop NL ");break;case 9:W.getLogger().trace("Stop EOF ");break;case 11:W.getLogger().trace("Stop NL2 ");break;case 12:W.getLogger().trace("Stop EOF2 ");break;case 15:W.getLogger().info("Node: ",$[X-1].id);W.addNode($[X-2].length,$[X-1].id,$[X-1].descr,$[X-1].type,$[X]);break;case 16:W.getLogger().info("Node: ",$[X].id);W.addNode($[X-1].length,$[X].id,$[X].descr,$[X].type);break;case 17:W.getLogger().trace("Icon: ",$[X]);W.decorateNode({icon:$[X]});break;case 18:case 23:W.decorateNode({class:$[X]});break;case 19:W.getLogger().trace("SPACELIST");break;case 20:W.getLogger().trace("Node: ",$[X-1].id);W.addNode(0,$[X-1].id,$[X-1].descr,$[X-1].type,$[X]);break;case 21:W.getLogger().trace("Node: ",$[X].id);W.addNode(0,$[X].id,$[X].descr,$[X].type);break;case 22:W.decorateNode({icon:$[X]});break;case 27:W.getLogger().trace("node found ..",$[X-2]);this.$={id:$[X-1],descr:$[X-1],type:W.getType($[X-2],$[X])};break;case 28:this.$={id:$[X],descr:$[X],type:0};break;case 29:W.getLogger().trace("node found ..",$[X-3]);this.$={id:$[X-3],descr:$[X-1],type:W.getType($[X-2],$[X])};break;case 30:this.$=$[X-1]+$[X];break;case 31:this.$=$[X];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:t},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:t},{6:n,7:[1,10],9:9,12:11,13:r,14:14,16:i,17:o,18:17,19:18,20:a,23:s},e(l,[2,3]),{1:[2,2]},e(l,[2,4]),e(l,[2,5]),{1:[2,6],6:n,12:21,13:r,14:14,16:i,17:o,18:17,19:18,20:a,23:s},{6:n,9:22,12:11,13:r,14:14,16:i,17:o,18:17,19:18,20:a,23:s},{6:u,7:d,10:23,11:f},e(h,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:a,23:s}),e(h,[2,19]),e(h,[2,21],{15:30,24:m}),e(h,[2,22]),e(h,[2,23]),e(g,[2,25]),e(g,[2,26]),e(g,[2,28],{20:[1,32]}),{21:[1,33]},{6:u,7:d,10:34,11:f},{1:[2,7],6:n,12:21,13:r,14:14,16:i,17:o,18:17,19:18,20:a,23:s},e(x,[2,14],{7:w,11:_}),e(C,[2,8]),e(C,[2,9]),e(C,[2,10]),e(h,[2,16],{15:37,24:m}),e(h,[2,17]),e(h,[2,18]),e(h,[2,20],{24:A}),e(g,[2,31]),{21:[1,39]},{22:[1,40]},e(x,[2,13],{7:w,11:_}),e(C,[2,11]),e(C,[2,12]),e(h,[2,15],{24:A}),e(g,[2,30]),{22:[1,41]},e(g,[2,27]),e(g,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:B(function N(O,z){if(z.recoverable){this.trace(O)}else{var U=new Error(O);U.hash=z;throw U}},"parseError"),parse:B(function N(O){var z=this,U=[0],W=[],H=[null],$=[],K=this.table,X="",j=0,te=0,J=0,oe=2,se=1;var re=$.slice.call(arguments,1);var ce=Object.create(this.lexer);var ue={yy:{}};for(var xe in this.yy){if(Object.prototype.hasOwnProperty.call(this.yy,xe)){ue.yy[xe]=this.yy[xe]}}ce.setInput(O,ue.yy);ue.yy.lexer=ce;ue.yy.parser=this;if(typeof ce.yylloc=="undefined"){ce.yylloc={}}var be=ce.yylloc;$.push(be);var Ie=ce.options&&ce.options.ranges;if(typeof ue.yy.parseError==="function"){this.parseError=ue.yy.parseError}else{this.parseError=Object.getPrototypeOf(this).parseError}function he(He){U.length=U.length-2*He;H.length=H.length-He;$.length=$.length-He}B(he,"popStack");function ve(){var He;He=W.pop()||ce.lex()||se;if(typeof He!=="number"){if(He instanceof Array){W=He;He=W.pop()}He=z.symbols_[He]||He}return He}B(ve,"lex");var ge,Ve,Le,$e,Ee,tt,yt={},mt,ct,Ge,it;while(true){Le=U[U.length-1];if(this.defaultActions[Le]){$e=this.defaultActions[Le]}else{if(ge===null||typeof ge=="undefined"){ge=ve()}$e=K[Le]&&K[Le][ge]}if(typeof $e==="undefined"||!$e.length||!$e[0]){var bt="";it=[];for(mt in K[Le]){if(this.terminals_[mt]&&mt>oe){it.push("'"+this.terminals_[mt]+"'")}}if(ce.showPosition){bt="Parse error on line "+(j+1)+":\n"+ce.showPosition()+"\nExpecting "+it.join(", ")+", got '"+(this.terminals_[ge]||ge)+"'"}else{bt="Parse error on line "+(j+1)+": Unexpected "+(ge==se?"end of input":"'"+(this.terminals_[ge]||ge)+"'")}this.parseError(bt,{text:ce.match,token:this.terminals_[ge]||ge,line:ce.yylineno,loc:be,expected:it})}if($e[0]instanceof Array&&$e.length>1){throw new Error("Parse Error: multiple actions possible at state: "+Le+", token: "+ge)}switch($e[0]){case 1:U.push(ge);H.push(ce.yytext);$.push(ce.yylloc);U.push($e[1]);ge=null;if(!Ve){te=ce.yyleng;X=ce.yytext;j=ce.yylineno;be=ce.yylloc;if(J>0){J--}}else{ge=Ve;Ve=null}break;case 2:ct=this.productions_[$e[1]][1];yt.$=H[H.length-ct];yt._$={first_line:$[$.length-(ct||1)].first_line,last_line:$[$.length-1].last_line,first_column:$[$.length-(ct||1)].first_column,last_column:$[$.length-1].last_column};if(Ie){yt._$.range=[$[$.length-(ct||1)].range[0],$[$.length-1].range[1]]}tt=this.performAction.apply(yt,[X,te,j,ue.yy,$e[1],H,$].concat(re));if(typeof tt!=="undefined"){return tt}if(ct){U=U.slice(0,-1*ct*2);H=H.slice(0,-1*ct);$=$.slice(0,-1*ct)}U.push(this.productions_[$e[1]][0]);H.push(yt.$);$.push(yt._$);Ge=K[U[U.length-2]][U[U.length-1]];U.push(Ge);break;case 3:return true}}return true},"parse")};var L=function(){var N={EOF:1,parseError:B(function O(z,U){if(this.yy.parser){this.yy.parser.parseError(z,U)}else{throw new Error(z)}},"parseError"),setInput:B(function(O,z){this.yy=z||this.yy||{};this._input=O;this._more=this._backtrack=this.done=false;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};if(this.options.ranges){this.yylloc.range=[0,0]}this.offset=0;return this},"setInput"),input:B(function(){var O=this._input[0];this.yytext+=O;this.yyleng++;this.offset++;this.match+=O;this.matched+=O;var z=O.match(/(?:\r\n?|\n).*/g);if(z){this.yylineno++;this.yylloc.last_line++}else{this.yylloc.last_column++}if(this.options.ranges){this.yylloc.range[1]++}this._input=this._input.slice(1);return O},"input"),unput:B(function(O){var z=O.length;var U=O.split(/(?:\r\n?|\n)/g);this._input=O+this._input;this.yytext=this.yytext.substr(0,this.yytext.length-z);this.offset-=z;var W=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1);this.matched=this.matched.substr(0,this.matched.length-1);if(U.length-1){this.yylineno-=U.length-1}var H=this.yylloc.range;this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:U?(U.length===W.length?this.yylloc.first_column:0)+W[W.length-U.length].length-U[0].length:this.yylloc.first_column-z};if(this.options.ranges){this.yylloc.range=[H[0],H[0]+this.yyleng-z]}this.yyleng=this.yytext.length;return this},"unput"),more:B(function(){this._more=true;return this},"more"),reject:B(function(){if(this.options.backtrack_lexer){this._backtrack=true}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}return this},"reject"),less:B(function(O){this.unput(this.match.slice(O))},"less"),pastInput:B(function(){var O=this.matched.substr(0,this.matched.length-this.match.length);return(O.length>20?"...":"")+O.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:B(function(){var O=this.match;if(O.length<20){O+=this._input.substr(0,20-O.length)}return(O.substr(0,20)+(O.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:B(function(){var O=this.pastInput();var z=new Array(O.length+1).join("-");return O+this.upcomingInput()+"\n"+z+"^"},"showPosition"),test_match:B(function(O,z){var U,W,H;if(this.options.backtrack_lexer){H={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done};if(this.options.ranges){H.yylloc.range=this.yylloc.range.slice(0)}}W=O[0].match(/(?:\r\n?|\n).*/g);if(W){this.yylineno+=W.length}this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:W?W[W.length-1].length-W[W.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+O[0].length};this.yytext+=O[0];this.match+=O[0];this.matches=O;this.yyleng=this.yytext.length;if(this.options.ranges){this.yylloc.range=[this.offset,this.offset+=this.yyleng]}this._more=false;this._backtrack=false;this._input=this._input.slice(O[0].length);this.matched+=O[0];U=this.performAction.call(this,this.yy,this,z,this.conditionStack[this.conditionStack.length-1]);if(this.done&&this._input){this.done=false}if(U){return U}else if(this._backtrack){for(var $ in H){this[$]=H[$]}return false}return false},"test_match"),next:B(function(){if(this.done){return this.EOF}if(!this._input){this.done=true}var O,z,U,W;if(!this._more){this.yytext="";this.match=""}var H=this._currentRules();for(var $=0;$z[0].length)){z=U;W=$;if(this.options.backtrack_lexer){O=this.test_match(U,H[$]);if(O!==false){return O}else if(this._backtrack){z=false;continue}else{return false}}else if(!this.options.flex){break}}}if(z){O=this.test_match(z,H[W]);if(O!==false){return O}return false}if(this._input===""){return this.EOF}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}},"next"),lex:B(function O(){var z=this.next();if(z){return z}else{return this.lex()}},"lex"),begin:B(function O(z){this.conditionStack.push(z)},"begin"),popState:B(function O(){var z=this.conditionStack.length-1;if(z>0){return this.conditionStack.pop()}else{return this.conditionStack[0]}},"popState"),_currentRules:B(function O(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules}else{return this.conditions["INITIAL"].rules}},"_currentRules"),topState:B(function O(z){z=this.conditionStack.length-1-Math.abs(z||0);if(z>=0){return this.conditionStack[z]}else{return"INITIAL"}},"topState"),pushState:B(function O(z){this.begin(z)},"pushState"),stateStackSize:B(function O(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":true},performAction:B(function O(z,U,W,H){var $=H;switch(W){case 0:this.pushState("shapeData");U.yytext="";return 24;break;case 1:this.pushState("shapeDataStr");return 24;break;case 2:this.popState();return 24;break;case 3:const K=/\n\s*/g;U.yytext=U.yytext.replace(K,"
    ");return 24;break;case 4:return 24;break;case 5:this.popState();break;case 6:z.getLogger().trace("Found comment",U.yytext);return 6;break;case 7:return 8;break;case 8:this.begin("CLASS");break;case 9:this.popState();return 17;break;case 10:this.popState();break;case 11:z.getLogger().trace("Begin icon");this.begin("ICON");break;case 12:z.getLogger().trace("SPACELINE");return 6;break;case 13:return 7;break;case 14:return 16;break;case 15:z.getLogger().trace("end icon");this.popState();break;case 16:z.getLogger().trace("Exploding node");this.begin("NODE");return 20;break;case 17:z.getLogger().trace("Cloud");this.begin("NODE");return 20;break;case 18:z.getLogger().trace("Explosion Bang");this.begin("NODE");return 20;break;case 19:z.getLogger().trace("Cloud Bang");this.begin("NODE");return 20;break;case 20:this.begin("NODE");return 20;break;case 21:this.begin("NODE");return 20;break;case 22:this.begin("NODE");return 20;break;case 23:this.begin("NODE");return 20;break;case 24:return 13;break;case 25:return 23;break;case 26:return 11;break;case 27:this.begin("NSTR2");break;case 28:return"NODE_DESCR";break;case 29:this.popState();break;case 30:z.getLogger().trace("Starting NSTR");this.begin("NSTR");break;case 31:z.getLogger().trace("description:",U.yytext);return"NODE_DESCR";break;case 32:this.popState();break;case 33:this.popState();z.getLogger().trace("node end ))");return"NODE_DEND";break;case 34:this.popState();z.getLogger().trace("node end )");return"NODE_DEND";break;case 35:this.popState();z.getLogger().trace("node end ...",U.yytext);return"NODE_DEND";break;case 36:this.popState();z.getLogger().trace("node end ((");return"NODE_DEND";break;case 37:this.popState();z.getLogger().trace("node end (-");return"NODE_DEND";break;case 38:this.popState();z.getLogger().trace("node end (-");return"NODE_DEND";break;case 39:this.popState();z.getLogger().trace("node end ((");return"NODE_DEND";break;case 40:this.popState();z.getLogger().trace("node end ((");return"NODE_DEND";break;case 41:z.getLogger().trace("Long description:",U.yytext);return 21;break;case 42:z.getLogger().trace("Long description:",U.yytext);return 21;break}},"anonymous"),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}@]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{"shapeDataEndBracket":{"rules":[],"inclusive":false},"shapeDataStr":{"rules":[2,3],"inclusive":false},"shapeData":{"rules":[1,4,5],"inclusive":false},"CLASS":{"rules":[9,10],"inclusive":false},"ICON":{"rules":[14,15],"inclusive":false},"NSTR2":{"rules":[28,29],"inclusive":false},"NSTR":{"rules":[31,32],"inclusive":false},"NODE":{"rules":[27,30,33,34,35,36,37,38,39,40,41,42],"inclusive":false},"INITIAL":{"rules":[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],"inclusive":true}}};return N}();P.lexer=L;function I(){this.yy={}}B(I,"Parser");I.prototype=P;P.Parser=I;return new I}();Ult.parser=Ult;BGi=Ult;Z_=[];$lt=[];Vlt=0;Glt={};zGi=B(()=>{Z_=[];$lt=[];Vlt=0;Glt={}},"clear");UGi=B(e=>{if(Z_.length===0){return null}const t=Z_[0].level;let n=null;for(let r=Z_.length-1;r>=0;r--){if(Z_[r].level===t&&!n){n=Z_[r]}if(Z_[r].levels.parentId===i.id);for(const s of a){const l={id:s.id,parentId:i.id,label:La(s.label??"",r),labelType:"markdown",isGroup:false,ticket:s?.ticket,priority:s?.priority,assigned:s?.assigned,icon:s?.icon,shape:"kanbanItem",level:s.level,rx:5,ry:5,cssStyles:["text-align: left"]};t.push(l)}}return{nodes:t,edges:e,other:{},config:Mn()}},"getData");$Gi=B((e,t,n,r,i)=>{const o=Mn();let a=o.mindmap?.padding??ka.mindmap.padding;switch(r){case Hp.ROUNDED_RECT:case Hp.RECT:case Hp.HEXAGON:a*=2}const s={id:La(t,o)||"kbn"+Vlt++,level:e,label:La(n,o),width:o.mindmap?.maxNodeWidth??ka.mindmap.maxNodeWidth,padding:a,isGroup:false};if(i!==void 0){let u;if(!i.includes("\n")){u="{\n"+i+"\n}"}else{u=i+"\n"}const d=gL(u,{schema:mL});if(d.shape&&(d.shape!==d.shape.toLowerCase()||d.shape.includes("_"))){throw new Error(`No such shape: ${d.shape}. Shape names should be lowercase.`)}if(d?.shape&&d.shape==="kanbanItem"){s.shape=d?.shape}if(d?.label){s.label=d?.label}if(d?.icon){s.icon=d?.icon.toString()}if(d?.assigned){s.assigned=d?.assigned.toString()}if(d?.ticket){s.ticket=d?.ticket.toString()}if(d?.priority){s.priority=d?.priority}}const l=UGi(e);if(l){s.parentId=l.id||"kbn"+Vlt++}else{$lt.push(s)}Z_.push(s)},"addNode");Hp={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6};GGi=B((e,t)=>{wt.debug("In get type",e,t);switch(e){case"[":return Hp.RECT;case"(":return t===")"?Hp.ROUNDED_RECT:Hp.CLOUD;case"((":return Hp.CIRCLE;case")":return Hp.CLOUD;case"))":return Hp.BANG;case"{{":return Hp.HEXAGON;default:return Hp.DEFAULT}},"getType");HGi=B((e,t)=>{Glt[e]=t},"setElementForId");WGi=B(e=>{if(!e){return}const t=Mn();const n=Z_[Z_.length-1];if(e.icon){n.icon=La(e.icon,t)}if(e.class){n.cssClasses=La(e.class,t)}},"decorateNode");YGi=B(e=>{switch(e){case Hp.DEFAULT:return"no-border";case Hp.RECT:return"rect";case Hp.ROUNDED_RECT:return"rounded-rect";case Hp.CIRCLE:return"circle";case Hp.CLOUD:return"cloud";case Hp.BANG:return"bang";case Hp.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str");qGi=B(()=>wt,"getLogger");XGi=B(e=>Glt[e],"getElementById");jGi={clear:zGi,addNode:$Gi,getSections:iBn,getData:VGi,nodeType:Hp,getType:GGi,setElementForId:HGi,decorateNode:WGi,type2Str:YGi,getLogger:qGi,getElementById:XGi};KGi=jGi;ZGi=B(async(e,t,n,r)=>{wt.debug("Rendering kanban diagram\n"+e);const i=r.db;const o=i.getData();const a=Mn();a.htmlLabels=false;const s=Sc(t);for(const w of o.nodes){w.domId=`${t}-${w.id}`}const l=s.append("g");l.attr("class","sections");const u=s.append("g");u.attr("class","items");const d=o.nodes.filter(w=>w.isGroup);let f=0;const h=10;const m=[];let g=25;for(const w of d){const _=a?.kanban?.sectionWidth||200;f=f+1;w.x=_*f+(f-1)*h/2;w.width=_;w.y=0;w.height=_*3;w.rx=5;w.ry=5;w.cssClasses=w.cssClasses+" section-"+f;const C=await wL(l,w);g=Math.max(g,C?.labelBBox?.height);m.push(C)}let x=0;for(const w of d){const _=m[x];x=x+1;const C=a?.kanban?.sectionWidth||200;const A=-C*3/2+g;let P=A;const L=o.nodes.filter(O=>O.parentId===w.id);for(const O of L){if(O.isGroup){throw new Error("Groups within groups are not allowed in Kanban diagrams")}O.x=w.x;O.width=C-1.5*h;const z=await kR(u,O,{config:a});const U=z.node().getBBox();O.y=P+U.height/2;await tB(O);P=O.y+U.height/2+h/2}const I=_.cluster.select("rect");const N=Math.max(P-A+3*h,50)+(g-25);I.attr("height",N)}zC(void 0,s,a.mindmap?.padding??ka.kanban.padding,a.mindmap?.useMaxWidth??ka.kanban.useMaxWidth)},"draw");JGi={draw:ZGi};QGi=B(e=>{let t="";for(let r=0;re.darkMode?Or(r,i):Nr(r,i),"adjuster");for(let r=0;r` + .edge { + stroke-width: 3; + } + ${QGi(e)} + .section-root rect, .section-root path, .section-root circle, .section-root polygon { + fill: ${e.git0}; + } + .section-root text { + fill: ${e.gitBranchLabel0}; + } + .icon-container { + height:100%; + display: flex; + justify-content: center; + align-items: center; + } + .edge { + fill: none; + } + .cluster-label, .label { + color: ${e.textColor}; + fill: ${e.textColor}; + } + .kanban-label { + dy: 1em; + alignment-baseline: middle; + text-anchor: middle; + dominant-baseline: middle; + text-align: center; + } + ${oS()} +`,"getStyles");tHi=eHi;nHi={db:KGi,renderer:JGi,parser:BGi,styles:tHi}});var lBn=_r((KPe,sBn)=>{(function(e,t){typeof KPe==="object"&&typeof sBn!=="undefined"?t(KPe):typeof define==="function"&&define.amd?define(["exports"],t):(e=typeof globalThis!=="undefined"?globalThis:e||self,t(e.d3=e.d3||{}))})(KPe,function(e){"use strict";function t(St,Ut){return StUt?1:St>=Ut?0:NaN}function n(St){let Ut=St;let Pt=St;if(St.length===1){Ut=(rr,hr)=>St(rr)-hr;Pt=r(St)}function an(rr,hr,Et,Tn){if(Et==null)Et=0;if(Tn==null)Tn=rr.length;while(Et>>1;if(Pt(rr[ft],hr)<0)Et=ft+1;else Tn=ft}return Et}function Xt(rr,hr,Et,Tn){if(Et==null)Et=0;if(Tn==null)Tn=rr.length;while(Et>>1;if(Pt(rr[ft],hr)>0)Tn=ft;else Et=ft+1}return Et}function Cn(rr,hr,Et,Tn){if(Et==null)Et=0;if(Tn==null)Tn=rr.length;const ft=an(rr,hr,Et,Tn-1);return ft>Et&&Ut(rr[ft-1],hr)>-Ut(rr[ft],hr)?ft-1:ft}return{left:an,center:Cn,right:Xt}}function r(St){return(Ut,Pt)=>t(St(Ut),Pt)}function i(St){return St===null?NaN:+St}function*o(St,Ut){if(Ut===void 0){for(let Pt of St){if(Pt!=null&&(Pt=+Pt)>=Pt){yield Pt}}}else{let Pt=-1;for(let an of St){if((an=Ut(an,++Pt,St))!=null&&(an=+an)>=an){yield an}}}}const a=n(t);const s=a.right;const l=a.left;const u=n(i).center;function d(St,Ut){let Pt=0;if(Ut===void 0){for(let an of St){if(an!=null&&(an=+an)>=an){++Pt}}}else{let an=-1;for(let Xt of St){if((Xt=Ut(Xt,++an,St))!=null&&(Xt=+Xt)>=Xt){++Pt}}}return Pt}function f(St){return St.length|0}function h(St){return!(St>0)}function m(St){return typeof St!=="object"||"length"in St?St:Array.from(St)}function g(St){return Ut=>St(...Ut)}function x(...St){const Ut=typeof St[St.length-1]==="function"&&g(St.pop());St=St.map(m);const Pt=St.map(f);const an=St.length-1;const Xt=new Array(an+1).fill(0);const Cn=[];if(an<0||Pt.some(h))return Cn;while(true){Cn.push(Xt.map((hr,Et)=>St[Et][hr]));let rr=an;while(++Xt[rr]===Pt[rr]){if(rr===0)return Ut?Cn.map(Ut):Cn;Xt[rr--]=0}}}function w(St,Ut){var Pt=0,an=0;return Float64Array.from(St,Ut===void 0?Xt=>Pt+=+Xt||0:Xt=>Pt+=+Ut(Xt,an++,St)||0)}function _(St,Ut){return UtSt?1:Ut>=St?0:NaN}function C(St,Ut){let Pt=0;let an;let Xt=0;let Cn=0;if(Ut===void 0){for(let rr of St){if(rr!=null&&(rr=+rr)>=rr){an=rr-Xt;Xt+=an/++Pt;Cn+=an*(rr-Xt)}}}else{let rr=-1;for(let hr of St){if((hr=Ut(hr,++rr,St))!=null&&(hr=+hr)>=hr){an=hr-Xt;Xt+=an/++Pt;Cn+=an*(hr-Xt)}}}if(Pt>1)return Cn/(Pt-1)}function A(St,Ut){const Pt=C(St,Ut);return Pt?Math.sqrt(Pt):Pt}function P(St,Ut){let Pt;let an;if(Ut===void 0){for(const Xt of St){if(Xt!=null){if(Pt===void 0){if(Xt>=Xt)Pt=an=Xt}else{if(Pt>Xt)Pt=Xt;if(an=Cn)Pt=an=Cn}else{if(Pt>Cn)Pt=Cn;if(an0){rr=Ut[--Pt];while(Pt>0){an=rr;Xt=Ut[--Pt];rr=an+Xt;Cn=Xt-(rr-an);if(Cn)break}if(Pt>0&&(Cn<0&&Ut[Pt-1]<0||Cn>0&&Ut[Pt-1]>0)){Xt=Cn*2;an=rr+Xt;if(Xt==an-rr)rr=an}}return rr}}function I(St,Ut){const Pt=new L;if(Ut===void 0){for(let an of St){if(an=+an){Pt.add(an)}}}else{let an=-1;for(let Xt of St){if(Xt=+Ut(Xt,++an,St)){Pt.add(Xt)}}}return+Pt}function N(St,Ut){const Pt=new L;let an=-1;return Float64Array.from(St,Ut===void 0?Xt=>Pt.add(+Xt||0):Xt=>Pt.add(+Ut(Xt,++an,St)||0))}class O extends Map{constructor(Ut,Pt=$){super();Object.defineProperties(this,{_intern:{value:new Map},_key:{value:Pt}});if(Ut!=null)for(const[an,Xt]of Ut)this.set(an,Xt)}get(Ut){return super.get(U(this,Ut))}has(Ut){return super.has(U(this,Ut))}set(Ut,Pt){return super.set(W(this,Ut),Pt)}delete(Ut){return super.delete(H(this,Ut))}}class z extends Set{constructor(Ut,Pt=$){super();Object.defineProperties(this,{_intern:{value:new Map},_key:{value:Pt}});if(Ut!=null)for(const an of Ut)this.add(an)}has(Ut){return super.has(U(this,Ut))}add(Ut){return super.add(W(this,Ut))}delete(Ut){return super.delete(H(this,Ut))}}function U({_intern:St,_key:Ut},Pt){const an=Ut(Pt);return St.has(an)?St.get(an):Pt}function W({_intern:St,_key:Ut},Pt){const an=Ut(Pt);if(St.has(an))return St.get(an);St.set(an,Pt);return Pt}function H({_intern:St,_key:Ut},Pt){const an=Ut(Pt);if(St.has(an)){Pt=St.get(Pt);St.delete(an)}return Pt}function $(St){return St!==null&&typeof St==="object"?St.valueOf():St}function K(St){return St}function X(St,...Ut){return ce(St,K,K,Ut)}function j(St,...Ut){return ce(St,Array.from,K,Ut)}function te(St,Ut,...Pt){return ce(St,K,Ut,Pt)}function J(St,Ut,...Pt){return ce(St,Array.from,Ut,Pt)}function oe(St,...Ut){return ce(St,K,re,Ut)}function se(St,...Ut){return ce(St,Array.from,re,Ut)}function re(St){if(St.length!==1)throw new Error("duplicate key");return St[0]}function ce(St,Ut,Pt,an){return function Xt(Cn,rr){if(rr>=an.length)return Pt(Cn);const hr=new O;const Et=an[rr++];let Tn=-1;for(const ft of Cn){const zt=Et(ft,++Tn,Cn);const Gt=hr.get(zt);if(Gt)Gt.push(ft);else hr.set(zt,[ft])}for(const[ft,zt]of hr){hr.set(ft,Xt(zt,rr))}return Ut(hr)}(St,0)}function ue(St,Ut){return Array.from(Ut,Pt=>St[Pt])}function xe(St,...Ut){if(typeof St[Symbol.iterator]!=="function")throw new TypeError("values is not iterable");St=Array.from(St);let[Pt=t]=Ut;if(Pt.length===1||Ut.length>1){const an=Uint32Array.from(St,(Xt,Cn)=>Cn);if(Ut.length>1){Ut=Ut.map(Xt=>St.map(Xt));an.sort((Xt,Cn)=>{for(const rr of Ut){const hr=t(rr[Xt],rr[Cn]);if(hr)return hr}})}else{Pt=St.map(Pt);an.sort((Xt,Cn)=>t(Pt[Xt],Pt[Cn]))}return ue(St,an)}return St.sort(Pt)}function be(St,Ut,Pt){return(Ut.length===1?xe(te(St,Ut,Pt),([an,Xt],[Cn,rr])=>t(Xt,rr)||t(an,Cn)):xe(X(St,Pt),([an,Xt],[Cn,rr])=>Ut(Xt,rr)||t(an,Cn))).map(([an])=>an)}var Ie=Array.prototype;var he=Ie.slice;function ve(St){return function(){return St}}var ge=Math.sqrt(50),Ve=Math.sqrt(10),Le=Math.sqrt(2);function $e(St,Ut,Pt){var an,Xt=-1,Cn,rr,hr;Ut=+Ut,St=+St,Pt=+Pt;if(St===Ut&&Pt>0)return[St];if(an=Ut0){let Et=Math.round(St/hr),Tn=Math.round(Ut/hr);if(Et*hrUt)--Tn;rr=new Array(Cn=Tn-Et+1);while(++XtUt)--Tn;rr=new Array(Cn=Tn-Et+1);while(++Xt=0?(Cn>=ge?10:Cn>=Ve?5:Cn>=Le?2:1)*Math.pow(10,Xt):-Math.pow(10,-Xt)/(Cn>=ge?10:Cn>=Ve?5:Cn>=Le?2:1)}function tt(St,Ut,Pt){var an=Math.abs(Ut-St)/Math.max(0,Pt),Xt=Math.pow(10,Math.floor(Math.log(an)/Math.LN10)),Cn=an/Xt;if(Cn>=ge)Xt*=10;else if(Cn>=Ve)Xt*=5;else if(Cn>=Le)Xt*=2;return Ut0){St=Math.floor(St/Xt)*Xt;Ut=Math.ceil(Ut/Xt)*Xt}else if(Xt<0){St=Math.ceil(St*Xt)/Xt;Ut=Math.floor(Ut*Xt)/Xt}an=Xt}}function mt(St){return Math.ceil(Math.log(d(St))/Math.LN2)+1}function ct(){var St=K,Ut=P,Pt=mt;function an(Xt){if(!Array.isArray(Xt))Xt=Array.from(Xt);var Cn,rr=Xt.length,hr,Et=new Array(rr);for(Cn=0;Cn=zt){if(Jr>=zt&&Ut===P){const sr=Ee(ft,zt,jr);if(isFinite(sr)){if(sr>0){zt=(Math.floor(zt/sr)+1)*sr}else if(sr<0){zt=(Math.ceil(zt*-sr)+1)/-sr}}}else{Gt.pop()}}}var gn=Gt.length;while(Gt[0]<=ft)Gt.shift(),--gn;while(Gt[gn-1]>zt)Gt.pop(),--gn;var Fn=new Array(gn+1),Tr;for(Cn=0;Cn<=gn;++Cn){Tr=Fn[Cn]=[];Tr.x0=Cn>0?Gt[Cn-1]:ft;Tr.x1=Cn=an)){Pt=an}}}else{let an=-1;for(let Xt of St){if((Xt=Ut(Xt,++an,St))!=null&&(Pt=Xt)){Pt=Xt}}}return Pt}function it(St,Ut){let Pt;if(Ut===void 0){for(const an of St){if(an!=null&&(Pt>an||Pt===void 0&&an>=an)){Pt=an}}}else{let an=-1;for(let Xt of St){if((Xt=Ut(Xt,++an,St))!=null&&(Pt>Xt||Pt===void 0&&Xt>=Xt)){Pt=Xt}}}return Pt}function bt(St,Ut,Pt=0,an=St.length-1,Xt=t){while(an>Pt){if(an-Pt>600){const Et=an-Pt+1;const Tn=Ut-Pt+1;const ft=Math.log(Et);const zt=.5*Math.exp(2*ft/3);const Gt=.5*Math.sqrt(ft*zt*(Et-zt)/Et)*(Tn-Et/2<0?-1:1);const gn=Math.max(Pt,Math.floor(Ut-Tn*zt/Et+Gt));const Fn=Math.min(an,Math.floor(Ut+(Et-Tn)*zt/Et+Gt));bt(St,Ut,gn,Fn,Xt)}const Cn=St[Ut];let rr=Pt;let hr=an;He(St,Pt,Ut);if(Xt(St[an],Cn)>0)He(St,Pt,an);while(rr0)--hr}if(Xt(St[Pt],Cn)===0)He(St,Pt,hr);else++hr,He(St,hr,an);if(hr<=Ut)Pt=hr+1;if(Ut<=hr)an=hr-1}return St}function He(St,Ut,Pt){const an=St[Ut];St[Ut]=St[Pt];St[Pt]=an}function Je(St,Ut,Pt){St=Float64Array.from(o(St,Pt));if(!(an=St.length))return;if((Ut=+Ut)<=0||an<2)return it(St);if(Ut>=1)return Ge(St);var an,Xt=(an-1)*Ut,Cn=Math.floor(Xt),rr=Ge(bt(St,Cn).subarray(0,Cn+1)),hr=it(St.subarray(Cn+1));return rr+(hr-rr)*(Xt-Cn)}function Te(St,Ut,Pt=i){if(!(an=St.length))return;if((Ut=+Ut)<=0||an<2)return+Pt(St[0],0,St);if(Ut>=1)return+Pt(St[an-1],an-1,St);var an,Xt=(an-1)*Ut,Cn=Math.floor(Xt),rr=+Pt(St[Cn],Cn,St),hr=+Pt(St[Cn+1],Cn+1,St);return rr+(hr-rr)*(Xt-Cn)}function we(St,Ut,Pt){return Math.ceil((Pt-Ut)/(2*(Je(St,.75)-Je(St,.25))*Math.pow(d(St),-1/3)))}function Ze(St,Ut,Pt){return Math.ceil((Pt-Ut)/(3.5*A(St)*Math.pow(d(St),-1/3)))}function Be(St,Ut){let Pt;let an=-1;let Xt=-1;if(Ut===void 0){for(const Cn of St){++Xt;if(Cn!=null&&(Pt=Cn)){Pt=Cn,an=Xt}}}else{for(let Cn of St){if((Cn=Ut(Cn,++Xt,St))!=null&&(Pt=Cn)){Pt=Cn,an=Xt}}}return an}function qe(St,Ut){let Pt=0;let an=0;if(Ut===void 0){for(let Xt of St){if(Xt!=null&&(Xt=+Xt)>=Xt){++Pt,an+=Xt}}}else{let Xt=-1;for(let Cn of St){if((Cn=Ut(Cn,++Xt,St))!=null&&(Cn=+Cn)>=Cn){++Pt,an+=Cn}}}if(Pt)return an/Pt}function Qe(St,Ut){return Je(St,.5,Ut)}function*ze(St){for(const Ut of St){yield*Ut}}function Me(St){return Array.from(ze(St))}function ye(St,Ut){let Pt;let an=-1;let Xt=-1;if(Ut===void 0){for(const Cn of St){++Xt;if(Cn!=null&&(Pt>Cn||Pt===void 0&&Cn>=Cn)){Pt=Cn,an=Xt}}}else{for(let Cn of St){if((Cn=Ut(Cn,++Xt,St))!=null&&(Pt>Cn||Pt===void 0&&Cn>=Cn)){Pt=Cn,an=Xt}}}return an}function Ne(St,Ut=Ae){const Pt=[];let an;let Xt=false;for(const Cn of St){if(Xt)Pt.push(Ut(an,Cn));an=Cn;Xt=true}return Pt}function Ae(St,Ut){return[St,Ut]}function dt(St,Ut,Pt){St=+St,Ut=+Ut,Pt=(Xt=arguments.length)<2?(Ut=St,St=0,1):Xt<3?1:+Pt;var an=-1,Xt=Math.max(0,Math.ceil((Ut-St)/Pt))|0,Cn=new Array(Xt);while(++an0:t(rr,rr)===0){Pt=Cn;Xt=rr;an=true}}}else{for(const Xt of St){if(an?Ut(Xt,Pt)>0:Ut(Xt,Xt)===0){Pt=Xt;an=true}}}return Pt}function qt(St,Ut=t){if(Ut.length===1)return Be(St,Ut);let Pt;let an=-1;let Xt=-1;for(const Cn of St){++Xt;if(an<0?Ut(Cn,Cn)===0:Ut(Cn,Pt)>0){Pt=Cn;an=Xt}}return an}function _t(St,Ut){const Pt=Wt(St,Ut);return Pt<0?void 0:Pt}var sn=Jt(Math.random);function Jt(St){return function Ut(Pt,an=0,Xt=Pt.length){let Cn=Xt-(an=+an);while(Cn){const rr=St()*Cn--|0,hr=Pt[Cn+an];Pt[Cn+an]=Pt[rr+an];Pt[rr+an]=hr}return Pt}}function Sn(St,Ut){let Pt=0;if(Ut===void 0){for(let an of St){if(an=+an){Pt+=an}}}else{let an=-1;for(let Xt of St){if(Xt=+Ut(Xt,++an,St)){Pt+=Xt}}}return Pt}function Kt(St){if(!(Cn=St.length))return[];for(var Ut=-1,Pt=it(St,mn),an=new Array(Pt);++UtUt(Pt,an,St))}function Mr(St,Ut,Pt){if(typeof Ut!=="function")throw new TypeError("reducer is not a function");const an=St[Symbol.iterator]();let Xt,Cn,rr=-1;if(arguments.length<3){({done:Xt,value:Pt}=an.next());if(Xt)return;++rr}while({done:Xt,value:Cn}=an.next(),!Xt){Pt=Ut(Pt,Cn,++rr,St)}return Pt}function Er(St){if(typeof St[Symbol.iterator]!=="function")throw new TypeError("values is not iterable");return Array.from(St).reverse()}function vr(St,...Ut){St=new Set(St);for(const Pt of Ut){for(const an of Pt){St.delete(an)}}return St}function Yr(St,Ut){const Pt=Ut[Symbol.iterator](),an=new Set;for(const Xt of St){if(an.has(Xt))return false;let Cn,rr;while({value:Cn,done:rr}=Pt.next()){if(rr)break;if(Object.is(Xt,Cn))return false;an.add(Cn)}}return true}function nt(St){return St instanceof Set?St:new Set(St)}function Rr(St,...Ut){St=new Set(St);Ut=Ut.map(nt);e:for(const Pt of St){for(const an of Ut){if(!an.has(Pt)){St.delete(Pt);continue e}}}return St}function Xr(St,Ut){const Pt=St[Symbol.iterator](),an=new Set;for(const Xt of Ut){if(an.has(Xt))continue;let Cn,rr;while({value:Cn,done:rr}=Pt.next()){if(rr)return false;an.add(Cn);if(Object.is(Xt,Cn))break}}return true}function dr(St,Ut){return Xr(Ut,St)}function rn(...St){const Ut=new Set;for(const Pt of St){for(const an of Pt){Ut.add(an)}}return Ut}e.Adder=L;e.InternMap=O;e.InternSet=z;e.ascending=t;e.bin=ct;e.bisect=s;e.bisectCenter=u;e.bisectLeft=l;e.bisectRight=s;e.bisector=n;e.count=d;e.cross=x;e.cumsum=w;e.descending=_;e.deviation=A;e.difference=vr;e.disjoint=Yr;e.every=lr;e.extent=P;e.fcumsum=N;e.filter=cr;e.fsum=I;e.greatest=kt;e.greatestIndex=qt;e.group=X;e.groupSort=be;e.groups=j;e.histogram=ct;e.index=oe;e.indexes=se;e.intersection=Rr;e.least=Oe;e.leastIndex=Wt;e.map=Hr;e.max=Ge;e.maxIndex=Be;e.mean=qe;e.median=Qe;e.merge=Me;e.min=it;e.minIndex=ye;e.nice=yt;e.pairs=Ne;e.permute=ue;e.quantile=Je;e.quantileSorted=Te;e.quickselect=bt;e.range=dt;e.reduce=Mr;e.reverse=Er;e.rollup=te;e.rollups=J;e.scan=_t;e.shuffle=sn;e.shuffler=Jt;e.some=on;e.sort=xe;e.subset=dr;e.sum=Sn;e.superset=Xr;e.thresholdFreedmanDiaconis=we;e.thresholdScott=Ze;e.thresholdSturges=mt;e.tickIncrement=Ee;e.tickStep=tt;e.ticks=$e;e.transpose=Kt;e.union=rn;e.variance=C;e.zip=At;Object.defineProperty(e,"__esModule",{value:true})})});var uBn=_r((ZPe,cBn)=>{(function(e,t){typeof ZPe==="object"&&typeof cBn!=="undefined"?t(ZPe):typeof define==="function"&&define.amd?define(["exports"],t):(e=e||self,t(e.d3=e.d3||{}))})(ZPe,function(e){"use strict";var t=Math.PI,n=2*t,r=1e-6,i=n-r;function o(){this._x0=this._y0=this._x1=this._y1=null;this._=""}function a(){return new o}o.prototype=a.prototype={constructor:o,moveTo:function(s,l){this._+="M"+(this._x0=this._x1=+s)+","+(this._y0=this._y1=+l)},closePath:function(){if(this._x1!==null){this._x1=this._x0,this._y1=this._y0;this._+="Z"}},lineTo:function(s,l){this._+="L"+(this._x1=+s)+","+(this._y1=+l)},quadraticCurveTo:function(s,l,u,d){this._+="Q"+ +s+","+ +l+","+(this._x1=+u)+","+(this._y1=+d)},bezierCurveTo:function(s,l,u,d,f,h){this._+="C"+ +s+","+ +l+","+ +u+","+ +d+","+(this._x1=+f)+","+(this._y1=+h)},arcTo:function(s,l,u,d,f){s=+s,l=+l,u=+u,d=+d,f=+f;var h=this._x1,m=this._y1,g=u-s,x=d-l,w=h-s,_=m-l,C=w*w+_*_;if(f<0)throw new Error("negative radius: "+f);if(this._x1===null){this._+="M"+(this._x1=s)+","+(this._y1=l)}else if(!(C>r));else if(!(Math.abs(_*g-x*w)>r)||!f){this._+="L"+(this._x1=s)+","+(this._y1=l)}else{var A=u-h,P=d-m,L=g*g+x*x,I=A*A+P*P,N=Math.sqrt(L),O=Math.sqrt(C),z=f*Math.tan((t-Math.acos((L+C-I)/(2*N*O)))/2),U=z/O,W=z/N;if(Math.abs(U-1)>r){this._+="L"+(s+U*w)+","+(l+U*_)}this._+="A"+f+","+f+",0,0,"+ +(_*A>w*P)+","+(this._x1=s+W*g)+","+(this._y1=l+W*x)}},arc:function(s,l,u,d,f,h){s=+s,l=+l,u=+u,h=!!h;var m=u*Math.cos(d),g=u*Math.sin(d),x=s+m,w=l+g,_=1^h,C=h?d-f:f-d;if(u<0)throw new Error("negative radius: "+u);if(this._x1===null){this._+="M"+x+","+w}else if(Math.abs(this._x1-x)>r||Math.abs(this._y1-w)>r){this._+="L"+x+","+w}if(!u)return;if(C<0)C=C%n+n;if(C>i){this._+="A"+u+","+u+",0,1,"+_+","+(s-m)+","+(l-g)+"A"+u+","+u+",0,1,"+_+","+(this._x1=x)+","+(this._y1=w)}else if(C>r){this._+="A"+u+","+u+",0,"+ +(C>=t)+","+_+","+(this._x1=s+u*Math.cos(f))+","+(this._y1=l+u*Math.sin(f))}},rect:function(s,l,u,d){this._+="M"+(this._x0=this._x1=+s)+","+(this._y0=this._y1=+l)+"h"+ +u+"v"+ +d+"h"+-u+"Z"},toString:function(){return this._}};e.path=a;Object.defineProperty(e,"__esModule",{value:true})})});var fBn=_r((JPe,dBn)=>{(function(e,t){typeof JPe==="object"&&typeof dBn!=="undefined"?t(JPe,uBn()):typeof define==="function"&&define.amd?define(["exports","d3-path"],t):(e=e||self,t(e.d3=e.d3||{},e.d3))})(JPe,function(e,t){"use strict";function n(st){return function en(){return st}}var r=Math.abs;var i=Math.atan2;var o=Math.cos;var a=Math.max;var s=Math.min;var l=Math.sin;var u=Math.sqrt;var d=1e-12;var f=Math.PI;var h=f/2;var m=2*f;function g(st){return st>1?0:st<-1?f:Math.acos(st)}function x(st){return st>=1?h:st<=-1?-h:Math.asin(st)}function w(st){return st.innerRadius}function _(st){return st.outerRadius}function C(st){return st.startAngle}function A(st){return st.endAngle}function P(st){return st&&st.padAngle}function L(st,en,yn,jn,xr,wr,Dr,Pn){var Ot=yn-st,Nn=jn-en,nr=Dr-xr,Ur=Pn-wr,bi=Ur*Ot-nr*Nn;if(bi*bifn*fn+vn*vn)Rt=Mt,Ct=Ft;return{cx:Rt,cy:Ct,x01:-nr,y01:-Ur,x11:Rt*(xr/ke-1),y11:Ct*(xr/ke-1)}}function N(){var st=w,en=_,yn=n(0),jn=null,xr=C,wr=A,Dr=P,Pn=null;function Ot(){var Nn,nr,Ur=+st.apply(this,arguments),bi=+en.apply(this,arguments),$i=xr.apply(this,arguments)-h,Zi=wr.apply(this,arguments)-h,Fo=r(Zi-$i),Ao=Zi>$i;if(!Pn)Pn=Nn=t.path();if(bid))Pn.moveTo(0,0);else if(Fo>m-d){Pn.moveTo(bi*o($i),bi*l($i));Pn.arc(0,0,bi,$i,Zi,!Ao);if(Ur>d){Pn.moveTo(Ur*o(Zi),Ur*l(Zi));Pn.arc(0,0,Ur,Zi,$i,Ao)}}else{var Ho=$i,Ia=Zi,ba=$i,ut=Zi,ke=Fo,je=Fo,gt=Dr.apply(this,arguments)/2,Rt=gt>d&&(jn?+jn.apply(this,arguments):u(Ur*Ur+bi*bi)),Ct=s(r(bi-Ur)/2,+yn.apply(this,arguments)),Mt=Ct,Ft=Ct,Dt,Qt;if(Rt>d){var fn=x(Rt/Ur*l(gt)),vn=x(Rt/bi*l(gt));if((ke-=fn*2)>d)fn*=Ao?1:-1,ba+=fn,ut-=fn;else ke=0,ba=ut=($i+Zi)/2;if((je-=vn*2)>d)vn*=Ao?1:-1,Ho+=vn,Ia-=vn;else je=0,Ho=Ia=($i+Zi)/2}var On=bi*o(Ho),tr=bi*l(Ho),ar=Ur*o(ut),oi=Ur*l(ut);if(Ct>d){var ei=bi*o(Ia),Ar=bi*l(Ia),pi=Ur*o(ba),Qr=Ur*l(ba),wi;if(Fod))Pn.moveTo(On,tr);else if(Ft>d){Dt=I(pi,Qr,On,tr,bi,Ft,Ao);Qt=I(ei,Ar,ar,oi,bi,Ft,Ao);Pn.moveTo(Dt.cx+Dt.x01,Dt.cy+Dt.y01);if(Ftd)||!(ke>d))Pn.lineTo(ar,oi);else if(Mt>d){Dt=I(ar,oi,ei,Ar,Ur,-Mt,Ao);Qt=I(On,tr,pi,Qr,Ur,-Mt,Ao);Pn.lineTo(Dt.cx+Dt.x01,Dt.cy+Dt.y01);if(Mt=bi;--$i){Pn.point(Ia[$i],ba[$i])}Pn.lineEnd();Pn.areaEnd()}}if(Ao){Ia[Ur]=+st(Fo,Ur,nr),ba[Ur]=+yn(Fo,Ur,nr);Pn.point(en?+en(Fo,Ur,nr):Ia[Ur],jn?+jn(Fo,Ur,nr):ba[Ur])}}if(Ho)return Pn=null,Ho+""||null}function Nn(){return H().defined(xr).curve(Dr).context(wr)}Ot.x=function(nr){return arguments.length?(st=typeof nr==="function"?nr:n(+nr),en=null,Ot):st};Ot.x0=function(nr){return arguments.length?(st=typeof nr==="function"?nr:n(+nr),Ot):st};Ot.x1=function(nr){return arguments.length?(en=nr==null?null:typeof nr==="function"?nr:n(+nr),Ot):en};Ot.y=function(nr){return arguments.length?(yn=typeof nr==="function"?nr:n(+nr),jn=null,Ot):yn};Ot.y0=function(nr){return arguments.length?(yn=typeof nr==="function"?nr:n(+nr),Ot):yn};Ot.y1=function(nr){return arguments.length?(jn=nr==null?null:typeof nr==="function"?nr:n(+nr),Ot):jn};Ot.lineX0=Ot.lineY0=function(){return Nn().x(st).y(yn)};Ot.lineY1=function(){return Nn().x(st).y(jn)};Ot.lineX1=function(){return Nn().x(en).y(yn)};Ot.defined=function(nr){return arguments.length?(xr=typeof nr==="function"?nr:n(!!nr),Ot):xr};Ot.curve=function(nr){return arguments.length?(Dr=nr,wr!=null&&(Pn=Dr(wr)),Ot):Dr};Ot.context=function(nr){return arguments.length?(nr==null?wr=Pn=null:Pn=Dr(wr=nr),Ot):wr};return Ot}function K(st,en){return enst?1:en>=st?0:NaN}function X(st){return st}function j(){var st=X,en=K,yn=null,jn=n(0),xr=n(m),wr=n(0);function Dr(Pn){var Ot,Nn=Pn.length,nr,Ur,bi=0,$i=new Array(Nn),Zi=new Array(Nn),Fo=+jn.apply(this,arguments),Ao=Math.min(m,Math.max(-m,xr.apply(this,arguments)-Fo)),Ho,Ia=Math.min(Math.abs(Ao)/Nn,wr.apply(this,arguments)),ba=Ia*(Ao<0?-1:1),ut;for(Ot=0;Ot0){bi+=ut}}if(en!=null)$i.sort(function(ke,je){return en(Zi[ke],Zi[je])});else if(yn!=null)$i.sort(function(ke,je){return yn(Pn[ke],Pn[je])});for(Ot=0,Ur=bi?(Ao-Nn*ba)/bi:0;Ot0?ut*Ur:0)+ba,Zi[nr]={data:Pn[nr],index:Ot,value:ut,startAngle:Fo,endAngle:Ho,padAngle:Ia}}return Zi}Dr.value=function(Pn){return arguments.length?(st=typeof Pn==="function"?Pn:n(+Pn),Dr):st};Dr.sortValues=function(Pn){return arguments.length?(en=Pn,yn=null,Dr):en};Dr.sort=function(Pn){return arguments.length?(yn=Pn,en=null,Dr):yn};Dr.startAngle=function(Pn){return arguments.length?(jn=typeof Pn==="function"?Pn:n(+Pn),Dr):jn};Dr.endAngle=function(Pn){return arguments.length?(xr=typeof Pn==="function"?Pn:n(+Pn),Dr):xr};Dr.padAngle=function(Pn){return arguments.length?(wr=typeof Pn==="function"?Pn:n(+Pn),Dr):wr};return Dr}var te=oe(z);function J(st){this._curve=st}J.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(st,en){this._curve.point(en*Math.sin(st),en*-Math.cos(st))}};function oe(st){function en(yn){return new J(st(yn))}en._curve=st;return en}function se(st){var en=st.curve;st.angle=st.x,delete st.x;st.radius=st.y,delete st.y;st.curve=function(yn){return arguments.length?en(oe(yn)):en()._curve};return st}function re(){return se(H().curve(te))}function ce(){var st=$().curve(te),en=st.curve,yn=st.lineX0,jn=st.lineX1,xr=st.lineY0,wr=st.lineY1;st.angle=st.x,delete st.x;st.startAngle=st.x0,delete st.x0;st.endAngle=st.x1,delete st.x1;st.radius=st.y,delete st.y;st.innerRadius=st.y0,delete st.y0;st.outerRadius=st.y1,delete st.y1;st.lineStartAngle=function(){return se(yn())},delete st.lineX0;st.lineEndAngle=function(){return se(jn())},delete st.lineX1;st.lineInnerRadius=function(){return se(xr())},delete st.lineY0;st.lineOuterRadius=function(){return se(wr())},delete st.lineY1;st.curve=function(Dr){return arguments.length?en(oe(Dr)):en()._curve};return st}function ue(st,en){return[(en=+en)*Math.cos(st-=Math.PI/2),en*Math.sin(st)]}var xe=Array.prototype.slice;function be(st){return st.source}function Ie(st){return st.target}function he(st){var en=be,yn=Ie,jn=U,xr=W,wr=null;function Dr(){var Pn,Ot=xe.call(arguments),Nn=en.apply(this,Ot),nr=yn.apply(this,Ot);if(!wr)wr=Pn=t.path();st(wr,+jn.apply(this,(Ot[0]=Nn,Ot)),+xr.apply(this,Ot),+jn.apply(this,(Ot[0]=nr,Ot)),+xr.apply(this,Ot));if(Pn)return wr=null,Pn+""||null}Dr.source=function(Pn){return arguments.length?(en=Pn,Dr):en};Dr.target=function(Pn){return arguments.length?(yn=Pn,Dr):yn};Dr.x=function(Pn){return arguments.length?(jn=typeof Pn==="function"?Pn:n(+Pn),Dr):jn};Dr.y=function(Pn){return arguments.length?(xr=typeof Pn==="function"?Pn:n(+Pn),Dr):xr};Dr.context=function(Pn){return arguments.length?(wr=Pn==null?null:Pn,Dr):wr};return Dr}function ve(st,en,yn,jn,xr){st.moveTo(en,yn);st.bezierCurveTo(en=(en+jn)/2,yn,en,xr,jn,xr)}function ge(st,en,yn,jn,xr){st.moveTo(en,yn);st.bezierCurveTo(en,yn=(yn+xr)/2,jn,yn,jn,xr)}function Ve(st,en,yn,jn,xr){var wr=ue(en,yn),Dr=ue(en,yn=(yn+xr)/2),Pn=ue(jn,yn),Ot=ue(jn,xr);st.moveTo(wr[0],wr[1]);st.bezierCurveTo(Dr[0],Dr[1],Pn[0],Pn[1],Ot[0],Ot[1])}function Le(){return he(ve)}function $e(){return he(ge)}function Ee(){var st=he(Ve);st.angle=st.x,delete st.x;st.radius=st.y,delete st.y;return st}var tt={draw:function(st,en){var yn=Math.sqrt(en/f);st.moveTo(yn,0);st.arc(0,0,yn,0,m)}};var yt={draw:function(st,en){var yn=Math.sqrt(en/5)/2;st.moveTo(-3*yn,-yn);st.lineTo(-yn,-yn);st.lineTo(-yn,-3*yn);st.lineTo(yn,-3*yn);st.lineTo(yn,-yn);st.lineTo(3*yn,-yn);st.lineTo(3*yn,yn);st.lineTo(yn,yn);st.lineTo(yn,3*yn);st.lineTo(-yn,3*yn);st.lineTo(-yn,yn);st.lineTo(-3*yn,yn);st.closePath()}};var mt=Math.sqrt(1/3),ct=mt*2;var Ge={draw:function(st,en){var yn=Math.sqrt(en/ct),jn=yn*mt;st.moveTo(0,-yn);st.lineTo(jn,0);st.lineTo(0,yn);st.lineTo(-jn,0);st.closePath()}};var it=.8908130915292852,bt=Math.sin(f/10)/Math.sin(7*f/10),He=Math.sin(m/10)*bt,Je=-Math.cos(m/10)*bt;var Te={draw:function(st,en){var yn=Math.sqrt(en*it),jn=He*yn,xr=Je*yn;st.moveTo(0,-yn);st.lineTo(jn,xr);for(var wr=1;wr<5;++wr){var Dr=m*wr/5,Pn=Math.cos(Dr),Ot=Math.sin(Dr);st.lineTo(Ot*yn,-Pn*yn);st.lineTo(Pn*jn-Ot*xr,Ot*jn+Pn*xr)}st.closePath()}};var we={draw:function(st,en){var yn=Math.sqrt(en),jn=-yn/2;st.rect(jn,jn,yn,yn)}};var Ze=Math.sqrt(3);var Be={draw:function(st,en){var yn=-Math.sqrt(en/(Ze*3));st.moveTo(0,yn*2);st.lineTo(-Ze*yn,-yn);st.lineTo(Ze*yn,-yn);st.closePath()}};var qe=-.5,Qe=Math.sqrt(3)/2,ze=1/Math.sqrt(12),Me=(ze/2+1)*3;var ye={draw:function(st,en){var yn=Math.sqrt(en/Me),jn=yn/2,xr=yn*ze,wr=jn,Dr=yn*ze+yn,Pn=-wr,Ot=Dr;st.moveTo(jn,xr);st.lineTo(wr,Dr);st.lineTo(Pn,Ot);st.lineTo(qe*jn-Qe*xr,Qe*jn+qe*xr);st.lineTo(qe*wr-Qe*Dr,Qe*wr+qe*Dr);st.lineTo(qe*Pn-Qe*Ot,Qe*Pn+qe*Ot);st.lineTo(qe*jn+Qe*xr,qe*xr-Qe*jn);st.lineTo(qe*wr+Qe*Dr,qe*Dr-Qe*wr);st.lineTo(qe*Pn+Qe*Ot,qe*Ot-Qe*Pn);st.closePath()}};var Ne=[tt,yt,Ge,we,Te,Be,ye];function Ae(){var st=n(tt),en=n(64),yn=null;function jn(){var xr;if(!yn)yn=xr=t.path();st.apply(this,arguments).draw(yn,+en.apply(this,arguments));if(xr)return yn=null,xr+""||null}jn.type=function(xr){return arguments.length?(st=typeof xr==="function"?xr:n(xr),jn):st};jn.size=function(xr){return arguments.length?(en=typeof xr==="function"?xr:n(+xr),jn):en};jn.context=function(xr){return arguments.length?(yn=xr==null?null:xr,jn):yn};return jn}function dt(){}function Oe(st,en,yn){st._context.bezierCurveTo((2*st._x0+st._x1)/3,(2*st._y0+st._y1)/3,(st._x0+2*st._x1)/3,(st._y0+2*st._y1)/3,(st._x0+4*st._x1+en)/6,(st._y0+4*st._y1+yn)/6)}function Wt(st){this._context=st}Wt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN;this._point=0},lineEnd:function(){switch(this._point){case 3:Oe(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}if(this._line||this._line!==0&&this._point===1)this._context.closePath();this._line=1-this._line},point:function(st,en){st=+st,en=+en;switch(this._point){case 0:this._point=1;this._line?this._context.lineTo(st,en):this._context.moveTo(st,en);break;case 1:this._point=2;break;case 2:this._point=3;this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Oe(this,st,en);break}this._x0=this._x1,this._x1=st;this._y0=this._y1,this._y1=en}};function kt(st){return new Wt(st)}function qt(st){this._context=st}qt.prototype={areaStart:dt,areaEnd:dt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN;this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2);this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3);this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3);this._context.closePath();break}case 3:{this.point(this._x2,this._y2);this.point(this._x3,this._y3);this.point(this._x4,this._y4);break}}},point:function(st,en){st=+st,en=+en;switch(this._point){case 0:this._point=1;this._x2=st,this._y2=en;break;case 1:this._point=2;this._x3=st,this._y3=en;break;case 2:this._point=3;this._x4=st,this._y4=en;this._context.moveTo((this._x0+4*this._x1+st)/6,(this._y0+4*this._y1+en)/6);break;default:Oe(this,st,en);break}this._x0=this._x1,this._x1=st;this._y0=this._y1,this._y1=en}};function _t(st){return new qt(st)}function sn(st){this._context=st}sn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN;this._point=0},lineEnd:function(){if(this._line||this._line!==0&&this._point===3)this._context.closePath();this._line=1-this._line},point:function(st,en){st=+st,en=+en;switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var yn=(this._x0+4*this._x1+st)/6,jn=(this._y0+4*this._y1+en)/6;this._line?this._context.lineTo(yn,jn):this._context.moveTo(yn,jn);break;case 3:this._point=4;default:Oe(this,st,en);break}this._x0=this._x1,this._x1=st;this._y0=this._y1,this._y1=en}};function Jt(st){return new sn(st)}function Sn(st,en){this._basis=new Wt(st);this._beta=en}Sn.prototype={lineStart:function(){this._x=[];this._y=[];this._basis.lineStart()},lineEnd:function(){var st=this._x,en=this._y,yn=st.length-1;if(yn>0){var jn=st[0],xr=en[0],wr=st[yn]-jn,Dr=en[yn]-xr,Pn=-1,Ot;while(++Pn<=yn){Ot=Pn/yn;this._basis.point(this._beta*st[Pn]+(1-this._beta)*(jn+Ot*wr),this._beta*en[Pn]+(1-this._beta)*(xr+Ot*Dr))}}this._x=this._y=null;this._basis.lineEnd()},point:function(st,en){this._x.push(+st);this._y.push(+en)}};var Kt=function st(en){function yn(jn){return en===1?new Wt(jn):new Sn(jn,en)}yn.beta=function(jn){return st(+jn)};return yn}(.85);function mn(st,en,yn){st._context.bezierCurveTo(st._x1+st._k*(st._x2-st._x0),st._y1+st._k*(st._y2-st._y0),st._x2+st._k*(st._x1-en),st._y2+st._k*(st._y1-yn),st._x2,st._y2)}function At(st,en){this._context=st;this._k=(1-en)/6}At.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN;this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:mn(this,this._x1,this._y1);break}if(this._line||this._line!==0&&this._point===1)this._context.closePath();this._line=1-this._line},point:function(st,en){st=+st,en=+en;switch(this._point){case 0:this._point=1;this._line?this._context.lineTo(st,en):this._context.moveTo(st,en);break;case 1:this._point=2;this._x1=st,this._y1=en;break;case 2:this._point=3;default:mn(this,st,en);break}this._x0=this._x1,this._x1=this._x2,this._x2=st;this._y0=this._y1,this._y1=this._y2,this._y2=en}};var lr=function st(en){function yn(jn){return new At(jn,en)}yn.tension=function(jn){return st(+jn)};return yn}(0);function on(st,en){this._context=st;this._k=(1-en)/6}on.prototype={areaStart:dt,areaEnd:dt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN;this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3);this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3);this._context.closePath();break}case 3:{this.point(this._x3,this._y3);this.point(this._x4,this._y4);this.point(this._x5,this._y5);break}}},point:function(st,en){st=+st,en=+en;switch(this._point){case 0:this._point=1;this._x3=st,this._y3=en;break;case 1:this._point=2;this._context.moveTo(this._x4=st,this._y4=en);break;case 2:this._point=3;this._x5=st,this._y5=en;break;default:mn(this,st,en);break}this._x0=this._x1,this._x1=this._x2,this._x2=st;this._y0=this._y1,this._y1=this._y2,this._y2=en}};var cr=function st(en){function yn(jn){return new on(jn,en)}yn.tension=function(jn){return st(+jn)};return yn}(0);function Hr(st,en){this._context=st;this._k=(1-en)/6}Hr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN;this._point=0},lineEnd:function(){if(this._line||this._line!==0&&this._point===3)this._context.closePath();this._line=1-this._line},point:function(st,en){st=+st,en=+en;switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:mn(this,st,en);break}this._x0=this._x1,this._x1=this._x2,this._x2=st;this._y0=this._y1,this._y1=this._y2,this._y2=en}};var Mr=function st(en){function yn(jn){return new Hr(jn,en)}yn.tension=function(jn){return st(+jn)};return yn}(0);function Er(st,en,yn){var jn=st._x1,xr=st._y1,wr=st._x2,Dr=st._y2;if(st._l01_a>d){var Pn=2*st._l01_2a+3*st._l01_a*st._l12_a+st._l12_2a,Ot=3*st._l01_a*(st._l01_a+st._l12_a);jn=(jn*Pn-st._x0*st._l12_2a+st._x2*st._l01_2a)/Ot;xr=(xr*Pn-st._y0*st._l12_2a+st._y2*st._l01_2a)/Ot}if(st._l23_a>d){var Nn=2*st._l23_2a+3*st._l23_a*st._l12_a+st._l12_2a,nr=3*st._l23_a*(st._l23_a+st._l12_a);wr=(wr*Nn+st._x1*st._l23_2a-en*st._l12_2a)/nr;Dr=(Dr*Nn+st._y1*st._l23_2a-yn*st._l12_2a)/nr}st._context.bezierCurveTo(jn,xr,wr,Dr,st._x2,st._y2)}function vr(st,en){this._context=st;this._alpha=en}vr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN;this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}if(this._line||this._line!==0&&this._point===1)this._context.closePath();this._line=1-this._line},point:function(st,en){st=+st,en=+en;if(this._point){var yn=this._x2-st,jn=this._y2-en;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(yn*yn+jn*jn,this._alpha))}switch(this._point){case 0:this._point=1;this._line?this._context.lineTo(st,en):this._context.moveTo(st,en);break;case 1:this._point=2;break;case 2:this._point=3;default:Er(this,st,en);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a;this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a;this._x0=this._x1,this._x1=this._x2,this._x2=st;this._y0=this._y1,this._y1=this._y2,this._y2=en}};var Yr=function st(en){function yn(jn){return en?new vr(jn,en):new At(jn,0)}yn.alpha=function(jn){return st(+jn)};return yn}(.5);function nt(st,en){this._context=st;this._alpha=en}nt.prototype={areaStart:dt,areaEnd:dt,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN;this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3);this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3);this._context.closePath();break}case 3:{this.point(this._x3,this._y3);this.point(this._x4,this._y4);this.point(this._x5,this._y5);break}}},point:function(st,en){st=+st,en=+en;if(this._point){var yn=this._x2-st,jn=this._y2-en;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(yn*yn+jn*jn,this._alpha))}switch(this._point){case 0:this._point=1;this._x3=st,this._y3=en;break;case 1:this._point=2;this._context.moveTo(this._x4=st,this._y4=en);break;case 2:this._point=3;this._x5=st,this._y5=en;break;default:Er(this,st,en);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a;this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a;this._x0=this._x1,this._x1=this._x2,this._x2=st;this._y0=this._y1,this._y1=this._y2,this._y2=en}};var Rr=function st(en){function yn(jn){return en?new nt(jn,en):new on(jn,0)}yn.alpha=function(jn){return st(+jn)};return yn}(.5);function Xr(st,en){this._context=st;this._alpha=en}Xr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN;this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){if(this._line||this._line!==0&&this._point===3)this._context.closePath();this._line=1-this._line},point:function(st,en){st=+st,en=+en;if(this._point){var yn=this._x2-st,jn=this._y2-en;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(yn*yn+jn*jn,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Er(this,st,en);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a;this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a;this._x0=this._x1,this._x1=this._x2,this._x2=st;this._y0=this._y1,this._y1=this._y2,this._y2=en}};var dr=function st(en){function yn(jn){return en?new Xr(jn,en):new Hr(jn,0)}yn.alpha=function(jn){return st(+jn)};return yn}(.5);function rn(st){this._context=st}rn.prototype={areaStart:dt,areaEnd:dt,lineStart:function(){this._point=0},lineEnd:function(){if(this._point)this._context.closePath()},point:function(st,en){st=+st,en=+en;if(this._point)this._context.lineTo(st,en);else this._point=1,this._context.moveTo(st,en)}};function St(st){return new rn(st)}function Ut(st){return st<0?-1:1}function Pt(st,en,yn){var jn=st._x1-st._x0,xr=en-st._x1,wr=(st._y1-st._y0)/(jn||xr<0&&-0),Dr=(yn-st._y1)/(xr||jn<0&&-0),Pn=(wr*xr+Dr*jn)/(jn+xr);return(Ut(wr)+Ut(Dr))*Math.min(Math.abs(wr),Math.abs(Dr),.5*Math.abs(Pn))||0}function an(st,en){var yn=st._x1-st._x0;return yn?(3*(st._y1-st._y0)/yn-en)/2:en}function Xt(st,en,yn){var jn=st._x0,xr=st._y0,wr=st._x1,Dr=st._y1,Pn=(wr-jn)/3;st._context.bezierCurveTo(jn+Pn,xr+Pn*en,wr-Pn,Dr-Pn*yn,wr,Dr)}function Cn(st){this._context=st}Cn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN;this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Xt(this,this._t0,an(this,this._t0));break}if(this._line||this._line!==0&&this._point===1)this._context.closePath();this._line=1-this._line},point:function(st,en){var yn=NaN;st=+st,en=+en;if(st===this._x1&&en===this._y1)return;switch(this._point){case 0:this._point=1;this._line?this._context.lineTo(st,en):this._context.moveTo(st,en);break;case 1:this._point=2;break;case 2:this._point=3;Xt(this,an(this,yn=Pt(this,st,en)),yn);break;default:Xt(this,this._t0,yn=Pt(this,st,en));break}this._x0=this._x1,this._x1=st;this._y0=this._y1,this._y1=en;this._t0=yn}};function rr(st){this._context=new hr(st)}(rr.prototype=Object.create(Cn.prototype)).point=function(st,en){Cn.prototype.point.call(this,en,st)};function hr(st){this._context=st}hr.prototype={moveTo:function(st,en){this._context.moveTo(en,st)},closePath:function(){this._context.closePath()},lineTo:function(st,en){this._context.lineTo(en,st)},bezierCurveTo:function(st,en,yn,jn,xr,wr){this._context.bezierCurveTo(en,st,jn,yn,wr,xr)}};function Et(st){return new Cn(st)}function Tn(st){return new rr(st)}function ft(st){this._context=st}ft.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[];this._y=[]},lineEnd:function(){var st=this._x,en=this._y,yn=st.length;if(yn){this._line?this._context.lineTo(st[0],en[0]):this._context.moveTo(st[0],en[0]);if(yn===2){this._context.lineTo(st[1],en[1])}else{var jn=zt(st),xr=zt(en);for(var wr=0,Dr=1;Dr=0;--en)xr[en]=(Dr[en]-xr[en+1])/wr[en];wr[yn-1]=(st[yn]+xr[yn-1])/2;for(en=0;en=0)this._t=1-this._t,this._line=1-this._line},point:function(st,en){st=+st,en=+en;switch(this._point){case 0:this._point=1;this._line?this._context.lineTo(st,en):this._context.moveTo(st,en);break;case 1:this._point=2;default:{if(this._t<=0){this._context.lineTo(this._x,en);this._context.lineTo(st,en)}else{var yn=this._x*(1-this._t)+st*this._t;this._context.lineTo(yn,this._y);this._context.lineTo(yn,en)}break}}this._x=st,this._y=en}};function Fn(st){return new gn(st,.5)}function Tr(st){return new gn(st,0)}function Jr(st){return new gn(st,1)}function jr(st,en){if(!((Dr=st.length)>1))return;for(var yn=1,jn,xr,wr=st[en[0]],Dr,Pn=wr.length;yn=0)yn[en]=en;return yn}function bn(st,en){return st[en]}function ir(){var st=n([]),en=sr,yn=jr,jn=bn;function xr(wr){var Dr=st.apply(this,arguments),Pn,Ot=wr.length,Nn=Dr.length,nr=new Array(Nn),Ur;for(Pn=0;Pn0))return;for(var yn,jn,xr=0,wr=st[0].length,Dr;xr0))return;for(var yn,jn=0,xr,wr,Dr,Pn,Ot,Nn=st[en[0]].length;jn0){xr[0]=Dr,xr[1]=Dr+=wr}else if(wr<0){xr[1]=Pn,xr[0]=Pn+=wr}else{xr[0]=0,xr[1]=wr}}}}function Pr(st,en){if(!((xr=st.length)>0))return;for(var yn=0,jn=st[en[0]],xr,wr=jn.length;yn0)||!((wr=(xr=st[en[0]]).length)>0))return;for(var yn=0,jn=1,xr,wr,Dr;jnwr)wr=xr,yn=en;return yn}function yi(st){var en=st.map(yo);return sr(st).sort(function(yn,jn){return en[yn]-en[jn]})}function yo(st){var en=0,yn=-1,jn=st.length,xr;while(++yn{(function(e,t){typeof QPe==="object"&&typeof hBn!=="undefined"?t(QPe,lBn(),fBn()):typeof define==="function"&&define.amd?define(["exports","d3-array","d3-shape"],t):(e=e||self,t(e.d3=e.d3||{},e.d3,e.d3))})(QPe,function(e,t,n){"use strict";function r(I){return I.target.depth}function i(I){return I.depth}function o(I,N){return N-1-I.height}function a(I,N){return I.sourceLinks.length?I.depth:N-1}function s(I){return I.targetLinks.length?I.depth:I.sourceLinks.length?t.min(I.sourceLinks,r)-1:0}function l(I){return function(){return I}}function u(I,N){return f(I.source,N.source)||I.index-N.index}function d(I,N){return f(I.target,N.target)||I.index-N.index}function f(I,N){return I.y0-N.y0}function h(I){return I.value}function m(I){return I.index}function g(I){return I.nodes}function x(I){return I.links}function w(I,N){const O=I.get(N);if(!O)throw new Error("missing: "+N);return O}function _({nodes:I}){for(const N of I){let O=N.y0;let z=O;for(const U of N.sourceLinks){U.y0=O+U.width/2;O+=U.width}for(const U of N.targetLinks){U.y1=z+U.width/2;z+=U.width}}}function C(){let I=0,N=0,O=1,z=1;let U=24;let W=8,H;let $=m;let K=a;let X;let j;let te=g;let J=x;let oe=6;function se(){const ct={nodes:te.apply(null,arguments),links:J.apply(null,arguments)};re(ct);ce(ct);ue(ct);xe(ct);he(ct);_(ct);return ct}se.update=function(ct){_(ct);return ct};se.nodeId=function(ct){return arguments.length?($=typeof ct==="function"?ct:l(ct),se):$};se.nodeAlign=function(ct){return arguments.length?(K=typeof ct==="function"?ct:l(ct),se):K};se.nodeSort=function(ct){return arguments.length?(X=ct,se):X};se.nodeWidth=function(ct){return arguments.length?(U=+ct,se):U};se.nodePadding=function(ct){return arguments.length?(W=H=+ct,se):W};se.nodes=function(ct){return arguments.length?(te=typeof ct==="function"?ct:l(ct),se):te};se.links=function(ct){return arguments.length?(J=typeof ct==="function"?ct:l(ct),se):J};se.linkSort=function(ct){return arguments.length?(j=ct,se):j};se.size=function(ct){return arguments.length?(I=N=0,O=+ct[0],z=+ct[1],se):[O-I,z-N]};se.extent=function(ct){return arguments.length?(I=+ct[0][0],O=+ct[1][0],N=+ct[0][1],z=+ct[1][1],se):[[I,N],[O,z]]};se.iterations=function(ct){return arguments.length?(oe=+ct,se):oe};function re({nodes:ct,links:Ge}){for(const[bt,He]of ct.entries()){He.index=bt;He.sourceLinks=[];He.targetLinks=[]}const it=new Map(ct.map((bt,He)=>[$(bt,He,ct),bt]));for(const[bt,He]of Ge.entries()){He.index=bt;let{source:Je,target:Te}=He;if(typeof Je!=="object")Je=He.source=w(it,Je);if(typeof Te!=="object")Te=He.target=w(it,Te);Je.sourceLinks.push(He);Te.targetLinks.push(He)}if(j!=null){for(const{sourceLinks:bt,targetLinks:He}of ct){bt.sort(j);He.sort(j)}}}function ce({nodes:ct}){for(const Ge of ct){Ge.value=Ge.fixedValue===void 0?Math.max(t.sum(Ge.sourceLinks,h),t.sum(Ge.targetLinks,h)):Ge.fixedValue}}function ue({nodes:ct}){const Ge=ct.length;let it=new Set(ct);let bt=new Set;let He=0;while(it.size){for(const Je of it){Je.depth=He;for(const{target:Te}of Je.sourceLinks){bt.add(Te)}}if(++He>Ge)throw new Error("circular link");it=bt;bt=new Set}}function xe({nodes:ct}){const Ge=ct.length;let it=new Set(ct);let bt=new Set;let He=0;while(it.size){for(const Je of it){Je.height=He;for(const{source:Te}of Je.targetLinks){bt.add(Te)}}if(++He>Ge)throw new Error("circular link");it=bt;bt=new Set}}function be({nodes:ct}){const Ge=t.max(ct,He=>He.depth)+1;const it=(O-I-U)/(Ge-1);const bt=new Array(Ge);for(const He of ct){const Je=Math.max(0,Math.min(Ge-1,Math.floor(K.call(null,He,Ge))));He.layer=Je;He.x0=I+Je*it;He.x1=He.x0+U;if(bt[Je])bt[Je].push(He);else bt[Je]=[He]}if(X)for(const He of bt){He.sort(X)}return bt}function Ie(ct){const Ge=t.min(ct,it=>(z-N-(it.length-1)*H)/t.sum(it,h));for(const it of ct){let bt=N;for(const He of it){He.y0=bt;He.y1=bt+He.value*Ge;bt=He.y1+H;for(const Je of He.sourceLinks){Je.width=Je.value*Ge}}bt=(z-bt+H)/(it.length+1);for(let He=0;Heit.length)-1));Ie(Ge);for(let it=0;it0))continue;let Be=(we/Ze-Te.y0)*Ge;Te.y0+=Be;Te.y1+=Be;Ee(Te)}if(X===void 0)Je.sort(f);Ve(Je,it)}}function ge(ct,Ge,it){for(let bt=ct.length,He=bt-2;He>=0;--He){const Je=ct[He];for(const Te of Je){let we=0;let Ze=0;for(const{target:qe,value:Qe}of Te.sourceLinks){let ze=Qe*(qe.layer-Te.layer);we+=mt(Te,qe)*ze;Ze+=ze}if(!(Ze>0))continue;let Be=(we/Ze-Te.y0)*Ge;Te.y0+=Be;Te.y1+=Be;Ee(Te)}if(X===void 0)Je.sort(f);Ve(Je,it)}}function Ve(ct,Ge){const it=ct.length>>1;const bt=ct[it];$e(ct,bt.y0-H,it-1,Ge);Le(ct,bt.y1+H,it+1,Ge);$e(ct,z,ct.length-1,Ge);Le(ct,N,0,Ge)}function Le(ct,Ge,it,bt){for(;it1e-6)He.y0+=Je,He.y1+=Je;Ge=He.y1+H}}function $e(ct,Ge,it,bt){for(;it>=0;--it){const He=ct[it];const Je=(He.y1-Ge)*bt;if(Je>1e-6)He.y0-=Je,He.y1-=Je;Ge=He.y0-H}}function Ee({sourceLinks:ct,targetLinks:Ge}){if(j===void 0){for(const{source:{sourceLinks:it}}of Ge){it.sort(d)}for(const{target:{targetLinks:it}}of ct){it.sort(u)}}}function tt(ct){if(j===void 0){for(const{sourceLinks:Ge,targetLinks:it}of ct){Ge.sort(d);it.sort(u)}}}function yt(ct,Ge){let it=ct.y0-(ct.sourceLinks.length-1)*H/2;for(const{target:bt,width:He}of ct.sourceLinks){if(bt===Ge)break;it+=He+H}for(const{source:bt,width:He}of Ge.targetLinks){if(bt===ct)break;it-=He}return it}function mt(ct,Ge){let it=Ge.y0-(Ge.targetLinks.length-1)*H/2;for(const{source:bt,width:He}of Ge.targetLinks){if(bt===ct)break;it+=He+H}for(const{target:bt,width:He}of ct.sourceLinks){if(bt===Ge)break;it-=He}return it}return se}function A(I){return[I.source.x1,I.y0]}function P(I){return[I.target.x0,I.y1]}function L(){return n.linkHorizontal().source(A).target(P)}e.sankey=C;e.sankeyCenter=s;e.sankeyJustify=a;e.sankeyLeft=i;e.sankeyLinkHorizontal=L;e.sankeyRight=o;Object.defineProperty(e,"__esModule",{value:true})})});var gBn={};Oo(gBn,{diagram:()=>vHi});var J_,Hlt,eIe,nIe,rIe,tIe,rHi,iHi,oHi,aHi,sHi,lHi,cHi,uHi,dHi,mBn,fHi,hHi,pHi,mHi,gHi,yHi,bHi,xHi,vHi;var yBn=Ce(()=>{Ta();Aa();Yo();ks();J_=Ui(pBn(),1);Hlt=function(){var e=B(function(s,l,u,d){for(u=u||{},d=s.length;d--;u[s[d]]=l);return u},"o"),t=[1,9],n=[1,10],r=[1,5,10,12];var i={trace:B(function s(){},"trace"),yy:{},symbols_:{"error":2,"start":3,"SANKEY":4,"NEWLINE":5,"csv":6,"opt_eof":7,"record":8,"csv_tail":9,"EOF":10,"field[source]":11,"COMMA":12,"field[target]":13,"field[value]":14,"field":15,"escaped":16,"non_escaped":17,"DQUOTE":18,"ESCAPED_TEXT":19,"NON_ESCAPED_TEXT":20,"$accept":0,"$end":1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:B(function s(l,u,d,f,h,m,g){var x=m.length-1;switch(h){case 7:const w=f.findOrCreateNode(m[x-4].trim().replaceAll('""','"'));const _=f.findOrCreateNode(m[x-2].trim().replaceAll('""','"'));const C=parseFloat(m[x].trim());f.addLink(w,_,C);break;case 8:case 9:case 11:this.$=m[x];break;case 10:this.$=m[x-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:t,20:n},{1:[2,6],7:11,10:[1,12]},e(n,[2,4],{9:13,5:[1,14]}),{12:[1,15]},e(r,[2,8]),e(r,[2,9]),{19:[1,16]},e(r,[2,11]),{1:[2,1]},{1:[2,5]},e(n,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:t,20:n},{15:18,16:7,17:8,18:t,20:n},{18:[1,19]},e(n,[2,3]),{12:[1,20]},e(r,[2,10]),{15:21,16:7,17:8,18:t,20:n},e([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:B(function s(l,u){if(u.recoverable){this.trace(l)}else{var d=new Error(l);d.hash=u;throw d}},"parseError"),parse:B(function s(l){var u=this,d=[0],f=[],h=[null],m=[],g=this.table,x="",w=0,_=0,C=0,A=2,P=1;var L=m.slice.call(arguments,1);var I=Object.create(this.lexer);var N={yy:{}};for(var O in this.yy){if(Object.prototype.hasOwnProperty.call(this.yy,O)){N.yy[O]=this.yy[O]}}I.setInput(l,N.yy);N.yy.lexer=I;N.yy.parser=this;if(typeof I.yylloc=="undefined"){I.yylloc={}}var z=I.yylloc;m.push(z);var U=I.options&&I.options.ranges;if(typeof N.yy.parseError==="function"){this.parseError=N.yy.parseError}else{this.parseError=Object.getPrototypeOf(this).parseError}function W(be){d.length=d.length-2*be;h.length=h.length-be;m.length=m.length-be}B(W,"popStack");function H(){var be;be=f.pop()||I.lex()||P;if(typeof be!=="number"){if(be instanceof Array){f=be;be=f.pop()}be=u.symbols_[be]||be}return be}B(H,"lex");var $,K,X,j,te,J,oe={},se,re,ce,ue;while(true){X=d[d.length-1];if(this.defaultActions[X]){j=this.defaultActions[X]}else{if($===null||typeof $=="undefined"){$=H()}j=g[X]&&g[X][$]}if(typeof j==="undefined"||!j.length||!j[0]){var xe="";ue=[];for(se in g[X]){if(this.terminals_[se]&&se>A){ue.push("'"+this.terminals_[se]+"'")}}if(I.showPosition){xe="Parse error on line "+(w+1)+":\n"+I.showPosition()+"\nExpecting "+ue.join(", ")+", got '"+(this.terminals_[$]||$)+"'"}else{xe="Parse error on line "+(w+1)+": Unexpected "+($==P?"end of input":"'"+(this.terminals_[$]||$)+"'")}this.parseError(xe,{text:I.match,token:this.terminals_[$]||$,line:I.yylineno,loc:z,expected:ue})}if(j[0]instanceof Array&&j.length>1){throw new Error("Parse Error: multiple actions possible at state: "+X+", token: "+$)}switch(j[0]){case 1:d.push($);h.push(I.yytext);m.push(I.yylloc);d.push(j[1]);$=null;if(!K){_=I.yyleng;x=I.yytext;w=I.yylineno;z=I.yylloc;if(C>0){C--}}else{$=K;K=null}break;case 2:re=this.productions_[j[1]][1];oe.$=h[h.length-re];oe._$={first_line:m[m.length-(re||1)].first_line,last_line:m[m.length-1].last_line,first_column:m[m.length-(re||1)].first_column,last_column:m[m.length-1].last_column};if(U){oe._$.range=[m[m.length-(re||1)].range[0],m[m.length-1].range[1]]}J=this.performAction.apply(oe,[x,_,w,N.yy,j[1],h,m].concat(L));if(typeof J!=="undefined"){return J}if(re){d=d.slice(0,-1*re*2);h=h.slice(0,-1*re);m=m.slice(0,-1*re)}d.push(this.productions_[j[1]][0]);h.push(oe.$);m.push(oe._$);ce=g[d[d.length-2]][d[d.length-1]];d.push(ce);break;case 3:return true}}return true},"parse")};var o=function(){var s={EOF:1,parseError:B(function l(u,d){if(this.yy.parser){this.yy.parser.parseError(u,d)}else{throw new Error(u)}},"parseError"),setInput:B(function(l,u){this.yy=u||this.yy||{};this._input=l;this._more=this._backtrack=this.done=false;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};if(this.options.ranges){this.yylloc.range=[0,0]}this.offset=0;return this},"setInput"),input:B(function(){var l=this._input[0];this.yytext+=l;this.yyleng++;this.offset++;this.match+=l;this.matched+=l;var u=l.match(/(?:\r\n?|\n).*/g);if(u){this.yylineno++;this.yylloc.last_line++}else{this.yylloc.last_column++}if(this.options.ranges){this.yylloc.range[1]++}this._input=this._input.slice(1);return l},"input"),unput:B(function(l){var u=l.length;var d=l.split(/(?:\r\n?|\n)/g);this._input=l+this._input;this.yytext=this.yytext.substr(0,this.yytext.length-u);this.offset-=u;var f=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1);this.matched=this.matched.substr(0,this.matched.length-1);if(d.length-1){this.yylineno-=d.length-1}var h=this.yylloc.range;this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:d?(d.length===f.length?this.yylloc.first_column:0)+f[f.length-d.length].length-d[0].length:this.yylloc.first_column-u};if(this.options.ranges){this.yylloc.range=[h[0],h[0]+this.yyleng-u]}this.yyleng=this.yytext.length;return this},"unput"),more:B(function(){this._more=true;return this},"more"),reject:B(function(){if(this.options.backtrack_lexer){this._backtrack=true}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}return this},"reject"),less:B(function(l){this.unput(this.match.slice(l))},"less"),pastInput:B(function(){var l=this.matched.substr(0,this.matched.length-this.match.length);return(l.length>20?"...":"")+l.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:B(function(){var l=this.match;if(l.length<20){l+=this._input.substr(0,20-l.length)}return(l.substr(0,20)+(l.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:B(function(){var l=this.pastInput();var u=new Array(l.length+1).join("-");return l+this.upcomingInput()+"\n"+u+"^"},"showPosition"),test_match:B(function(l,u){var d,f,h;if(this.options.backtrack_lexer){h={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done};if(this.options.ranges){h.yylloc.range=this.yylloc.range.slice(0)}}f=l[0].match(/(?:\r\n?|\n).*/g);if(f){this.yylineno+=f.length}this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:f?f[f.length-1].length-f[f.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+l[0].length};this.yytext+=l[0];this.match+=l[0];this.matches=l;this.yyleng=this.yytext.length;if(this.options.ranges){this.yylloc.range=[this.offset,this.offset+=this.yyleng]}this._more=false;this._backtrack=false;this._input=this._input.slice(l[0].length);this.matched+=l[0];d=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]);if(this.done&&this._input){this.done=false}if(d){return d}else if(this._backtrack){for(var m in h){this[m]=h[m]}return false}return false},"test_match"),next:B(function(){if(this.done){return this.EOF}if(!this._input){this.done=true}var l,u,d,f;if(!this._more){this.yytext="";this.match=""}var h=this._currentRules();for(var m=0;mu[0].length)){u=d;f=m;if(this.options.backtrack_lexer){l=this.test_match(d,h[m]);if(l!==false){return l}else if(this._backtrack){u=false;continue}else{return false}}else if(!this.options.flex){break}}}if(u){l=this.test_match(u,h[f]);if(l!==false){return l}return false}if(this._input===""){return this.EOF}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}},"next"),lex:B(function l(){var u=this.next();if(u){return u}else{return this.lex()}},"lex"),begin:B(function l(u){this.conditionStack.push(u)},"begin"),popState:B(function l(){var u=this.conditionStack.length-1;if(u>0){return this.conditionStack.pop()}else{return this.conditionStack[0]}},"popState"),_currentRules:B(function l(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules}else{return this.conditions["INITIAL"].rules}},"_currentRules"),topState:B(function l(u){u=this.conditionStack.length-1-Math.abs(u||0);if(u>=0){return this.conditionStack[u]}else{return"INITIAL"}},"topState"),pushState:B(function l(u){this.begin(u)},"pushState"),stateStackSize:B(function l(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":true},performAction:B(function l(u,d,f,h){var m=h;switch(f){case 0:this.pushState("csv");return 4;break;case 1:this.pushState("csv");return 4;break;case 2:return 10;break;case 3:return 5;break;case 4:return 12;break;case 5:this.pushState("escaped_text");return 18;break;case 6:return 20;break;case 7:this.popState("escaped_text");return 18;break;case 8:return 19;break}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{"csv":{"rules":[2,3,4,5,6,7,8],"inclusive":false},"escaped_text":{"rules":[7,8],"inclusive":false},"INITIAL":{"rules":[0,1,2,3,4,5,6,7,8],"inclusive":true}}};return s}();i.lexer=o;function a(){this.yy={}}B(a,"Parser");a.prototype=i;i.Parser=a;return new a}();Hlt.parser=Hlt;eIe=Hlt;nIe=[];rIe=[];tIe=new Map;rHi=B(()=>{nIe=[];rIe=[];tIe=new Map;Da()},"clear");iHi=class{constructor(e,t,n=0){this.source=e;this.target=t;this.value=n}static{B(this,"SankeyLink")}};oHi=B((e,t,n)=>{nIe.push(new iHi(e,t,n))},"addLink");aHi=class{constructor(e){this.ID=e}static{B(this,"SankeyNode")}};sHi=B(e=>{e=Ti.sanitizeText(e,Mn());let t=tIe.get(e);if(t===void 0){t=new aHi(e);tIe.set(e,t);rIe.push(t)}return t},"findOrCreateNode");lHi=B(()=>rIe,"getNodes");cHi=B(()=>nIe,"getLinks");uHi=B(()=>({nodes:rIe.map(e=>({id:e.ID})),links:nIe.map(e=>({source:e.source.ID,target:e.target.ID,value:e.value}))}),"getGraph");dHi={nodesMap:tIe,getConfig:B(()=>Mn().sankey,"getConfig"),getNodes:lHi,getLinks:cHi,getGraph:uHi,addLink:oHi,findOrCreateNode:sHi,getAccTitle:is,setAccTitle:Ka,getAccDescription:as,setAccDescription:os,getDiagramTitle:ss,setDiagramTitle:ys,clear:rHi};mBn=class Wlt{static{B(this,"Uid")}static{this.count=0}static next(t){return new Wlt(t+ ++Wlt.count)}constructor(t){this.id=t;this.href=`#${t}`}toString(){return"url("+this.href+")"}};fHi={left:J_.sankeyLeft,right:J_.sankeyRight,center:J_.sankeyCenter,justify:J_.sankeyJustify};hHi=B(e=>{let t=0;let n=0;for(const r of e){const i=r.value??0;if(i>t){t=i;n=r.layer??0}}return n},"findCentralNodeLayer");pHi=B(function(e,t,n,r){const{securityLevel:i,sankey:o}=Mn();const a=a2e.sankey;let s;if(i==="sandbox"){s=zr("#i"+t)}const l=i==="sandbox"?zr(s.nodes()[0].contentDocument.body):zr("body");const u=i==="sandbox"?l.select(`[id="${t}"]`):zr(`[id="${t}"]`);const d=o?.width??a.width;const f=o?.height??a.width;const h=o?.useMaxWidth??a.useMaxWidth;const m=o?.nodeAlignment??a.nodeAlignment;const g=o?.prefix??a.prefix;const x=o?.suffix??a.suffix;const w=o?.showValues??a.showValues;const _=o?.nodeWidth??a.nodeWidth??10;const C=o?.nodePadding??a.nodePadding??12;const A=o?.labelStyle??a.labelStyle??"legacy";const P=o?.nodeColors??{};const L=r.db.getGraph();const I=fHi[m];const N=(0,J_.sankey)().nodeId(J=>J.id).nodeWidth(_).nodePadding(C+(w?15:0)).nodeAlign(I).extent([[0,0],[d,f]]);N(L);const O=hHi(L.nodes);const z=mg(Wj);const U=B(J=>{return P[J]??z(J)},"getNodeColor");u.append("g").attr("class","nodes").selectAll(".node").data(L.nodes).join("g").attr("class","node").attr("id",J=>(J.uid=mBn.next("node-")).id).attr("transform",function(J){return"translate("+J.x0+","+J.y0+")"}).attr("x",J=>J.x0).attr("y",J=>J.y0).append("rect").attr("height",J=>{return J.y1-J.y0}).attr("width",J=>J.x1-J.x0).attr("fill",J=>U(J.id));const W=B(({id:J,value:oe})=>{if(!w){return J}return`${J} +${g}${Math.round(oe*100)/100}${x}`},"getText");const H=B(J=>{if(A==="outlined"){const oe=J.layer??0;if(oe$.selectAll(J?`.${J}`:"text").data(L.nodes).join("text").attr("class",J??null).attr("x",oe=>H(oe).x).attr("y",oe=>(oe.y1+oe.y0)/2).attr("dy",`${w?"0":"0.35"}em`).attr("text-anchor",oe=>H(oe).anchor).text(W),"appendLabel");if(A==="outlined"){K("sankey-label-bg");K("sankey-label-fg")}else{K()}const X=u.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(L.links).join("g").attr("class","link").style("mix-blend-mode","multiply");const j=o?.linkColor??"gradient";if(j==="gradient"){const J=X.append("linearGradient").attr("id",oe=>(oe.uid=mBn.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",oe=>oe.source.x1).attr("x2",oe=>oe.target.x0);J.append("stop").attr("offset","0%").attr("stop-color",oe=>U(oe.source.id));J.append("stop").attr("offset","100%").attr("stop-color",oe=>U(oe.target.id))}let te;switch(j){case"gradient":te=B(J=>J.uid,"coloring");break;case"source":te=B(J=>U(J.source.id),"coloring");break;case"target":te=B(J=>U(J.target.id),"coloring");break;default:te=j}X.append("path").attr("d",(0,J_.sankeyLinkHorizontal)()).attr("stroke",te).attr("stroke-width",J=>Math.max(1,J.width));zC(void 0,u,0,h)},"draw");mHi={draw:pHi};gHi=B(e=>{const t=e.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,"\n").trim();return t},"prepareTextForParsing");yHi=B(e=>`.label { + font-family: ${e.fontFamily}; + } + + .node-labels { + font-family: ${e.fontFamily}; + } + + /* Outlined label style - background stroke for better readability */ + .sankey-label-bg { + stroke: ${e.mainBkg||e.background||"#fff"}; + stroke-width: 4px; + stroke-linejoin: round; + paint-order: stroke; + } + + /* Foreground label text */ + .sankey-label-fg { + fill: ${e.textColor}; + } + + /* Node styling */ + .node rect { + shape-rendering: crispEdges; + } + + /* Link styling */ + .link { + fill: none; + stroke-opacity: 0.5; + mix-blend-mode: multiply; + } +`,"getStyles");bHi=yHi;xHi=eIe.parse.bind(eIe);eIe.parse=e=>xHi(gHi(e));vHi={styles:bHi,parser:eIe,db:dHi,renderer:mHi}});var vBn={};Oo(vBn,{diagram:()=>PHi});var _Hi,bBn,THi,wHi,EHi,xBn,CHi,SHi,AHi,kHi,RHi,PHi;var _Bn=Ce(()=>{rb();gh();nl();Ta();Aa();Yo();zg();_Hi=ka.packet;bBn=class{constructor(){this.packet=[];this.setAccTitle=Ka;this.getAccTitle=is;this.setDiagramTitle=ys;this.getDiagramTitle=ss;this.getAccDescription=as;this.setAccDescription=os}static{B(this,"PacketDB")}getConfig(){const e=Cl({..._Hi,...Ji().packet});if(e.showBits){e.paddingY+=10}return e}getPacket(){return this.packet}pushWord(e){if(e.length>0){this.packet.push(e)}}clear(){Da();this.packet=[]}};THi=1e4;wHi=B((e,t)=>{mu(e,t);let n=-1;let r=[];let i=1;const{bitsPerRow:o}=t.getConfig();for(let{start:a,end:s,bits:l,label:u}of e.blocks){if(a!==void 0&&s!==void 0&&s{if(e.start===void 0){throw new Error("start should have been set during first phase")}if(e.end===void 0){throw new Error("end should have been set during first phase")}if(e.start>e.end){throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`)}if(e.end+1<=t*n){return[e,void 0]}const r=t*n-1;const i=t*n;return[{start:e.start,end:r,label:e.label,bits:r-e.start},{start:i,end:e.end,label:e.label,bits:e.end-i}]},"getNextFittingBlock");xBn={parser:{yy:void 0},parse:B(async e=>{const t=await Pf("packet",e);const n=xBn.parser?.yy;if(!(n instanceof bBn)){throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.")}wt.debug(t);wHi(t,n)},"parse")};CHi=B((e,t,n,r)=>{const i=r.db;const o=i.getConfig();const{rowHeight:a,paddingY:s,bitWidth:l,bitsPerRow:u}=o;const d=i.getPacket();const f=i.getDiagramTitle();const h=a+s;const m=h*(d.length+1)-(f?0:a);const g=l*u+2;const x=Sc(t);x.attr("viewBox",`0 0 ${g} ${m}`);Vs(x,m,g,o.useMaxWidth);for(const[w,_]of d.entries()){SHi(x,_,w,o)}x.append("text").text(f).attr("x",g/2).attr("y",m-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw");SHi=B((e,t,n,{rowHeight:r,paddingX:i,paddingY:o,bitWidth:a,bitsPerRow:s,showBits:l})=>{const u=e.append("g");const d=n*(r+o)+o;for(const f of t){const h=f.start%s*a+1;const m=(f.end-f.start+1)*a-i;u.append("rect").attr("x",h).attr("y",d).attr("width",m).attr("height",r).attr("class","packetBlock");u.append("text").attr("x",h+m/2).attr("y",d+r/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(f.label);if(!l){continue}const g=f.end===f.start;const x=d-2;u.append("text").attr("x",h+(g?m/2:0)).attr("y",x).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",g?"middle":"start").text(f.start);if(!g){u.append("text").attr("x",h+m).attr("y",x).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(f.end)}}},"drawWord");AHi={draw:CHi};kHi={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"};RHi=B(({packet:e}={})=>{const t=Cl(kHi,e);return` + .packetByte { + font-size: ${t.byteFontSize}; + } + .packetByte.start { + fill: ${t.startByteColor}; + } + .packetByte.end { + fill: ${t.endByteColor}; + } + .packetLabel { + fill: ${t.labelColor}; + font-size: ${t.labelFontSize}; + } + .packetTitle { + fill: ${t.titleColor}; + font-size: ${t.titleFontSize}; + } + .packetBlock { + stroke: ${t.blockStrokeColor}; + stroke-width: ${t.blockStrokeWidth}; + fill: ${t.blockFillColor}; + } + `},"styles");PHi={parser:xBn,get db(){return new bBn},renderer:AHi,styles:RHi}});var kBn={};Oo(kBn,{diagram:()=>KHi});function EBn(e,t,n,r,i,o,a){const s=t.length;const l=Math.min(a.width,a.height)/2;n.forEach((u,d)=>{if(u.entries.length!==s){return}const f=u.entries.map((h,m)=>{const g=2*Math.PI*m/s-Math.PI/2;const x=CBn(h,r,i,l);const w=x*Math.cos(g);const _=x*Math.sin(g);return{x:w,y:_}});if(o==="circle"){e.append("path").attr("d",SBn(f,a.curveTension)).attr("class",`radarCurve-${d}`)}else if(o==="polygon"){e.append("polygon").attr("points",f.map(h=>`${h.x},${h.y}`).join(" ")).attr("class",`radarCurve-${d}`)}})}function CBn(e,t,n,r){const i=Math.min(Math.max(e,t),n);return r*(i-t)/(n-t)}function SBn(e,t){const n=e.length;let r=`M${e[0].x},${e[0].y}`;for(let i=0;i{const u=e.append("g").attr("transform",`translate(${i}, ${o+l*a})`);u.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${l}`);u.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(s.label)})}var kH,iIe,TBn,SS,IHi,MHi,wBn,LHi,DHi,FHi,NHi,OHi,BHi,zHi,Are,UHi,VHi,$Hi,GHi,HHi,WHi,YHi,qHi,XHi,jHi,KHi;var RBn=Ce(()=>{rb();gh();nl();Ta();Aa();Yo();zg();kH={showLegend:true,ticks:5,max:null,min:0,graticule:"circle"};iIe=32;TBn={axes:[],curves:[],options:kH};SS=structuredClone(TBn);IHi=ka.radar;MHi=B(()=>{const e=Cl({...IHi,...Ji().radar});return e},"getConfig");wBn=B(()=>SS.axes,"getAxes");LHi=B(()=>SS.curves,"getCurves");DHi=B(()=>SS.options,"getOptions");FHi=B(e=>{SS.axes=e.map(t=>{return{name:t.name,label:t.label??t.name}})},"setAxes");NHi=B(e=>{SS.curves=e.map(t=>{return{name:t.name,label:t.label??t.name,entries:OHi(t.entries)}})},"setCurves");OHi=B(e=>{if(e[0].axis==void 0){return e.map(n=>n.value)}const t=wBn();if(t.length===0){throw new Error("Axes must be populated before curves for reference entries")}return t.map(n=>{const r=e.find(i=>i.axis?.$refText===n.name);if(r===void 0){throw new Error("Missing entry for axis "+n.label)}return r.value})},"computeCurveEntries");BHi=B(e=>{const t=e.reduce((n,r)=>{n[r.name]=r;return n},{});SS.options={showLegend:t.showLegend?.value??kH.showLegend,ticks:t.ticks?.value??kH.ticks,max:t.max?.value??kH.max,min:t.min?.value??kH.min,graticule:t.graticule?.value??kH.graticule};if(SS.options.ticks>iIe){wt.warn(`Radar diagram ticks (${SS.options.ticks}) exceeds maximum allowed (${iIe}). Using ${iIe} instead.`);SS.options.ticks=iIe}},"setOptions");zHi=B(()=>{Da();SS=structuredClone(TBn)},"clear");Are={getAxes:wBn,getCurves:LHi,getOptions:DHi,setAxes:FHi,setCurves:NHi,setOptions:BHi,getConfig:MHi,clear:zHi,setAccTitle:Ka,getAccTitle:is,setDiagramTitle:ys,getDiagramTitle:ss,getAccDescription:as,setAccDescription:os};UHi=B(e=>{mu(e,Are);const{axes:t,curves:n,options:r}=e;Are.setAxes(t);Are.setCurves(n);Are.setOptions(r)},"populate");VHi={parse:B(async e=>{const t=await Pf("radar",e);wt.debug(t);UHi(t)},"parse")};$Hi=B((e,t,n,r)=>{const i=r.db;const o=i.getAxes();const a=i.getCurves();const s=i.getOptions();const l=i.getConfig();const u=i.getDiagramTitle();const d=Sc(t);const f=GHi(d,l);const h=s.max??Math.max(...a.map(x=>Math.max(...x.entries)));const m=s.min;const g=Math.min(l.width,l.height)/2;HHi(f,o,g,s.ticks,s.graticule);WHi(f,o,g,l);EBn(f,o,a,m,h,s.graticule,l);ABn(f,a,s.showLegend,l);f.append("text").attr("class","radarTitle").text(u).attr("x",0).attr("y",-l.height/2-l.marginTop)},"draw");GHi=B((e,t)=>{const n=t.width+t.marginLeft+t.marginRight;const r=t.height+t.marginTop+t.marginBottom;const i={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};Vs(e,r,n,t.useMaxWidth??true);e.attr("viewBox",`0 0 ${n} ${r}`).attr("overflow","visible");return e.append("g").attr("transform",`translate(${i.x}, ${i.y})`)},"drawFrame");HHi=B((e,t,n,r,i)=>{if(i==="circle"){for(let o=0;o{const f=2*d*Math.PI/o-Math.PI/2;const h=s*Math.cos(f);const m=s*Math.sin(f);return`${h},${m}`}).join(" ");e.append("polygon").attr("points",l).attr("class","radarGraticule")}}},"drawGraticule");WHi=B((e,t,n,r)=>{const i=t.length;for(let o=0;o.01?"start":l<-.01?"end":"middle";const f=u>.01?"hanging":u<-.01?"auto":"central";const h=4;e.append("text").text(a).attr("x",n*r.axisLabelFactor*l+h*l).attr("y",n*r.axisLabelFactor*u+h*u).attr("text-anchor",d).attr("dominant-baseline",f).attr("class","radarAxisLabel")}},"drawAxes");B(EBn,"drawCurves");B(CBn,"relativeRadius");B(SBn,"closedRoundCurve");B(ABn,"drawLegend");YHi={draw:$Hi};qHi=B((e,t)=>{let n="";for(let r=0;r{const t=Vy();const n=Ji();const r=Cl(t,n.themeVariables);const i=Cl(r.radar,e);return{themeVariables:r,radarOptions:i}},"buildRadarStyleOptions");jHi=B(({radar:e}={})=>{const{themeVariables:t,radarOptions:n}=XHi(e);return` + .radarTitle { + font-size: ${t.fontSize}; + color: ${t.titleColor}; + dominant-baseline: hanging; + text-anchor: middle; + } + .radarAxisLine { + stroke: ${n.axisColor}; + stroke-width: ${n.axisStrokeWidth}; + } + .radarAxisLabel { + font-size: ${n.axisLabelFontSize}px; + color: ${n.axisColor}; + } + .radarGraticule { + fill: ${n.graticuleColor}; + fill-opacity: ${n.graticuleOpacity}; + stroke: ${n.graticuleColor}; + stroke-width: ${n.graticuleStrokeWidth}; + } + .radarLegendText { + text-anchor: start; + font-size: ${n.legendFontSize}px; + dominant-baseline: hanging; + } + ${qHi(t,n)} + `},"styles");KHi={parser:VHi,db:Are,renderer:YHi,styles:jHi}});var a6n={};Oo(a6n,{diagram:()=>TYi});function VBn(e){wt.debug("typeStr2Type",e);switch(e){case"[]":return"square";case"()":wt.debug("we have a round");return"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}function $Bn(e){wt.debug("typeStr2Type",e);switch(e){case"==":return"thick";default:return"normal"}}function GBn(e){const t=e.trim().slice(-1);switch(t){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}function HBn(e){const t=e.trim().charAt(0);switch(t){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}function WBn(e){return e.includes("==")?"thick":"normal"}function YBn(e){if(e.includes(".-")){return"dotted"}return"solid"}function jlt(e,t){if(e===0||!Number.isInteger(e)){throw new Error("Columns must be an integer !== 0.")}if(t<0||!Number.isInteger(t)){throw new Error("Position must be a non-negative integer."+t)}if(e<0){return{px:t,py:0}}if(e===1){return{px:0,py:t}}const n=t%e;const r=Math.floor(t/e);return{px:n,py:r}}function sIe(e,t,n=0,r=0,i=8){wt.debug("setBlockSizes abc95 (start)",e.id,e?.size?.x,"block width =",e?.size,"siblingWidth",n);if(!e?.size?.width){e.size={width:n,height:r,x:0,y:0}}let o=0;let a=0;if(e.children?.length>0){for(const g of e.children){sIe(g,t,0,0,i)}const s=MWi(e);o=s.width;a=s.height;wt.debug("setBlockSizes abc95 maxWidth of",e.id,":s children is ",o,a);for(const g of e.children){if(g.size){wt.debug(`abc95 Setting size of children of ${e.id} id=${g.id} ${o} ${a} ${JSON.stringify(g.size)}`);g.size.width=o*(g.widthInColumns??1)+i*((g.widthInColumns??1)-1);g.size.height=a;g.size.x=0;g.size.y=0;wt.debug(`abc95 updating size of ${e.id} children child:${g.id} maxWidth:${o} maxHeight:${a}`)}}for(const g of e.children){sIe(g,t,o,a,i)}const l=e.columns??-1;let u=0;for(const g of e.children){u+=g.widthInColumns??1}let d=e.children.length;if(l>0&&l0?Math.min(e.children.length,l):e.children.length;if(g>0){const x=(h-g*i-i)/g;wt.debug("abc95 (growing to fit) width",e.id,h,e.size?.width,x);for(const w of e.children){if(w.size){w.size.width=x}}}}e.size={width:h,height:m,x:0,y:0}}wt.debug("setBlockSizes abc94 (done)",e.id,e?.size?.x,e?.size?.width,e?.size?.y,e?.size?.height)}function tct(e,t,n=8){wt.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);const r=e.columns??-1;wt.debug("layoutBlocks columns abc95",e.id,"=>",r,e);if(e.children&&e.children.length>0){const i=e?.children[0]?.size?.width??0;const o=e.children.length*i+(e.children.length-1)*n;wt.debug("widthOfChildren 88",o,"posX");const a=new Map;{let f=0;for(const h of e.children){if(!h.size){continue}const{py:m}=jlt(r,f);const g=a.get(m)??0;if(h.size.height>g){a.set(m,h.size.height)}let x=h?.widthInColumns??1;if(r>0){x=Math.min(x,r-f%r)}f+=x}}const s=new Map;{let f=0;const h=[...a.keys()].sort((m,g)=>m-g);for(const m of h){s.set(m,f);f+=(a.get(m)??0)+n}}let l=0;wt.debug("abc91 block?.size?.x",e.id,e?.size?.x);let u=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-n;let d=0;for(const f of e.children){const h=e;if(!f.size){continue}const{width:m,height:g}=f.size;const{px:x,py:w}=jlt(r,l);if(w!=d){d=w;u=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-n;wt.debug("New row in layout for block",e.id," and child ",f.id,d)}wt.debug(`abc89 layout blocks (child) id: ${f.id} Pos: ${l} (px, py) ${x},${w} (${h?.size?.x},${h?.size?.y}) parent: ${h.id} width: ${m}${n}`);if(h.size){const C=m/2;f.size.x=u+n+C;wt.debug(`abc91 layout blocks (calc) px, pyid:${f.id} startingPos=X${u} new startingPosX${f.size.x} ${C} padding=${n} width=${m} halfWidth=${C} => x:${f.size.x} y:${f.size.y} ${f.widthInColumns} (width * (child?.w || 1)) / 2 ${m*(f?.widthInColumns??1)/2}`);u=f.size.x+C;const A=s.get(w)??0;const P=a.get(w)??g;f.size.y=h.size.y-h.size.height/2+A+P/2+n;wt.debug(`abc88 layout blocks (calc) px, pyid:${f.id}startingPosX${u}${n}${C}=>x:${f.size.x}y:${f.size.y}${f.widthInColumns}(width * (child?.w || 1)) / 2${m*(f?.widthInColumns??1)/2}`)}if(f.children){tct(f,t,n)}let _=f?.widthInColumns??1;if(r>0){_=Math.min(_,r-l%r)}l+=_;wt.debug("abc88 columnsPos",f,l)}}wt.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`)}function nct(e,{minX:t,minY:n,maxX:r,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&e.id!=="root"){const{x:o,y:a,width:s,height:l}=e.size;if(o-s/2r){r=o+s/2}if(a+l/2>i){i=a+l/2}}if(e.children){for(const o of e.children){({minX:t,minY:n,maxX:r,maxY:i}=nct(o,{minX:t,minY:n,maxX:r,maxY:i}))}}return{minX:t,minY:n,maxX:r,maxY:i}}function qBn(e){const t=e.getBlock("root");if(!t){return}const n=Mn()?.block?.padding??8;sIe(t,e,0,0,n);tct(t,e,n);wt.debug("getBlocks",JSON.stringify(t,null,2));const{minX:r,minY:i,maxX:o,maxY:a}=nct(t);const s=a-i;const l=o-r;return{x:r,y:i,width:l,height:s}}function kre(e,t){if(oc(Mn())&&e){e.style.width=t.length*9+"px";e.style.height="12px"}}function XBn(e,t){return e.intersect(t)}function jBn(e,t,n,r){var i=e.x;var o=e.y;var a=i-r.x;var s=o-r.y;var l=Math.sqrt(t*t*s*s+n*n*a*a);var u=Math.abs(t*n*a/l);if(r.x0}function QBn(e,t,n){var r=e.x;var i=e.y;var o=[];var a=Number.POSITIVE_INFINITY;var s=Number.POSITIVE_INFINITY;if(typeof t.forEach==="function"){t.forEach(function(g){a=Math.min(a,g.x);s=Math.min(s,g.y)})}else{a=Math.min(a,t.x);s=Math.min(s,t.y)}var l=r-e.width/2-a;var u=i-e.height/2-s;for(var d=0;d1){o.sort(function(g,x){var w=g.x-n.x;var _=g.y-n.y;var C=Math.sqrt(w*w+_*_);var A=x.x-n.x;var P=x.y-n.y;var L=Math.sqrt(A*A+P*P);return C{i.push(s,0)},"addBorder");const a=B(s=>{i.push(0,s)},"skipBorder");if(t.includes("t")){wt.debug("add top border");o(n)}else{a(n)}if(t.includes("r")){wt.debug("add right border");o(r)}else{a(r)}if(t.includes("b")){wt.debug("add bottom border");o(n)}else{a(n)}if(t.includes("l")){wt.debug("add left border");o(r)}else{a(r)}e.attr("stroke-dasharray",i.join(" "))}function rct(e,t,n=false){const r=e;let i="default";if((r?.classes?.length||0)>0){i=(r?.classes??[]).join(" ")}i=i+" flowchart-label";let o=0;let a="";let s;switch(r.type){case"round":o=5;a="rect";break;case"composite":o=0;a="composite";s=0;break;case"square":a="rect";break;case"diamond":a="question";break;case"hexagon":a="hexagon";break;case"block_arrow":a="block_arrow";break;case"odd":a="rect_left_inv_arrow";break;case"lean_right":a="lean_right";break;case"lean_left":a="lean_left";break;case"trapezoid":a="trapezoid";break;case"inv_trapezoid":a="inv_trapezoid";break;case"rect_left_inv_arrow":a="rect_left_inv_arrow";break;case"circle":a="circle";break;case"ellipse":a="ellipse";break;case"stadium":a="stadium";break;case"subroutine":a="subroutine";break;case"cylinder":a="cylinder";break;case"group":a="rect";break;case"doublecircle":a="doublecircle";break;default:a="rect"}const l=vEe(r?.styles??[]);const u=r.label;const d=r.size??{width:0,height:0,x:0,y:0};const f=t.getDiagramId();const h={labelStyle:l.labelStyle,shape:a,labelText:u,rx:o,ry:o,class:i,style:l.style,id:r.id,domId:f?`${f}-${r.id}`:r.id,directions:r.directions,width:d.width,height:d.height,x:d.x,y:d.y,positioned:n,intersect:void 0,type:r.type,padding:s??Ji()?.block?.padding??0,widthInColumns:r.widthInColumns??1};return h}async function t6n(e,t,n){const r=rct(t,n,false);if(r.type==="group"){return}const i=Ji();const o=await e6n(e,r,{config:i});const a=o.node().getBBox();const s=n.getBlock(r.id);s.size={width:a.width,height:a.height,x:0,y:0,node:o};n.setBlock(s);o.remove()}async function n6n(e,t,n){const r=rct(t,n,true);const i=n.getBlock(r.id);if(i.type!=="space"){const o=Ji();await e6n(e,r,{config:o});t.intersect=r?.intersect;bYi(r)}}async function cIe(e,t,n,r){for(const i of t){await r(e,i,n);if(i.children){await cIe(e,i.children,n,r)}}}async function r6n(e,t,n){await cIe(e,t,n,t6n)}async function i6n(e,t,n){await cIe(e,t,n,n6n)}async function o6n(e,t,n,r,i){const o=new fc({multigraph:true,compound:true});o.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const a of n){if(a.size){o.setNode(a.id,{width:a.size.width,height:a.size.height,intersect:a.intersect})}}for(const a of t){if(a.start&&a.end){const s=r.getBlock(a.start);const l=r.getBlock(a.end);if(s?.size&&l?.size){const u=s.size;const d=l.size;const f=[{x:u.x,y:u.y},{x:u.x+(d.x-u.x)/2,y:u.y+(d.y-u.y)/2},{x:d.x,y:d.y}];const h=i?`${i}-${a.id}`:a.id;const m=a.thickness==="thick"?"edge-thickness-thick":"edge-thickness-normal";const g=a.pattern==="dotted"?"edge-pattern-dotted":"edge-pattern-solid";const x=`${m} ${g} flowchart-link LS-a1 LE-b1`;UWi(e,{v:a.start,w:a.end,name:h},{...a,id:h,arrowTypeEnd:a.arrowTypeEnd,arrowTypeStart:a.arrowTypeStart,points:f,classes:x},void 0,"block",o,i);if(a.label){await NWi(e,{...a,label:a.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:a.arrowTypeEnd,arrowTypeStart:a.arrowTypeStart,points:f,classes:x});OWi({...a,x:f[1].x,y:f[1].y},{originalPath:f})}}}}}var qlt,ZHi,Zw,Jlt,Xlt,PBn,IBn,JHi,zBn,aIe,Qlt,QHi,eWi,tWi,nWi,UBn,ect,Rre,rWi,MBn,iWi,oWi,aWi,sWi,lWi,cWi,uWi,dWi,fWi,hWi,pWi,mWi,gWi,yWi,Ylt,bWi,xWi,vWi,_Wi,TWi,wWi,EWi,CWi,SWi,AWi,kWi,RWi,PWi,IWi,MWi,LWi,Kw,DWi,FWi,LBn,Klt,jy,NWi,OWi,BWi,zWi,DBn,UWi,VWi,$Wi,GWi,KBn,HWi,WWi,YWi,qWi,XWi,lf,Hm,Qf,jWi,KWi,FBn,xv,NBn,ZWi,JWi,QWi,eYi,tYi,nYi,rYi,iYi,oYi,aYi,sYi,lYi,cYi,uYi,dYi,fYi,hYi,pYi,mYi,OBn,gYi,yYi,BBn,oIe,e6n,bYi,xYi,vYi,_Yi,TYi;var s6n=Ce(()=>{aS();K0();Sg();Np();Jh();nl();Ta();Aa();Yo();yEe();qh();ks();iv();ks();ks();ks();qlt=function(){var e=B(function(A,P,L,I){for(L=L||{},I=A.length;I--;L[A[I]]=P);return L},"o"),t=[1,15],n=[1,7],r=[1,13],i=[1,14],o=[1,19],a=[1,16],s=[1,17],l=[1,18],u=[8,30],d=[8,10,21,28,29,30,31,39,43,46],f=[1,23],h=[1,24],m=[8,10,15,16,21,28,29,30,31,39,43,46],g=[8,10,15,16,21,27,28,29,30,31,39,43,46],x=[1,49];var w={trace:B(function A(){},"trace"),yy:{},symbols_:{"error":2,"spaceLines":3,"SPACELINE":4,"NL":5,"separator":6,"SPACE":7,"EOF":8,"start":9,"BLOCK_DIAGRAM_KEY":10,"document":11,"stop":12,"statement":13,"link":14,"LINK":15,"START_LINK":16,"LINK_LABEL":17,"STR":18,"nodeStatement":19,"columnsStatement":20,"SPACE_BLOCK":21,"blockStatement":22,"classDefStatement":23,"cssClassStatement":24,"styleStatement":25,"node":26,"SIZE":27,"COLUMNS":28,"id-block":29,"end":30,"NODE_ID":31,"nodeShapeNLabel":32,"dirList":33,"DIR":34,"NODE_DSTART":35,"NODE_DEND":36,"BLOCK_ARROW_START":37,"BLOCK_ARROW_END":38,"classDef":39,"CLASSDEF_ID":40,"CLASSDEF_STYLEOPTS":41,"DEFAULT":42,"class":43,"CLASSENTITY_IDS":44,"STYLECLASS":45,"style":46,"STYLE_ENTITY_IDS":47,"STYLE_DEFINITION_DATA":48,"$accept":0,"$end":1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:B(function A(P,L,I,N,O,z,U){var W=z.length-1;switch(O){case 4:N.getLogger().debug("Rule: separator (NL) ");break;case 5:N.getLogger().debug("Rule: separator (Space) ");break;case 6:N.getLogger().debug("Rule: separator (EOF) ");break;case 7:N.getLogger().debug("Rule: hierarchy: ",z[W-1]);N.setHierarchy(z[W-1]);break;case 8:N.getLogger().debug("Stop NL ");break;case 9:N.getLogger().debug("Stop EOF ");break;case 10:N.getLogger().debug("Stop NL2 ");break;case 11:N.getLogger().debug("Stop EOF2 ");break;case 12:N.getLogger().debug("Rule: statement: ",z[W]);typeof z[W].length==="number"?this.$=z[W]:this.$=[z[W]];break;case 13:N.getLogger().debug("Rule: statement #2: ",z[W-1]);this.$=[z[W-1]].concat(z[W]);break;case 14:N.getLogger().debug("Rule: link: ",z[W],P);this.$={edgeTypeStr:z[W],label:""};break;case 15:N.getLogger().debug("Rule: LABEL link: ",z[W-3],z[W-1],z[W]);this.$={edgeTypeStr:z[W],label:z[W-1]};break;case 18:const H=parseInt(z[W]);const $=N.generateId();this.$={id:$,type:"space",label:"",width:H,children:[]};break;case 23:N.getLogger().debug("Rule: (nodeStatement link node) ",z[W-2],z[W-1],z[W]," typestr: ",z[W-1].edgeTypeStr);const K=N.edgeStrToEdgeData(z[W-1].edgeTypeStr);const X=N.edgeStrToEdgeStartData(z[W-1].edgeTypeStr);const j=N.edgeStrToThickness(z[W-1].edgeTypeStr);const te=N.edgeStrToPattern(z[W-1].edgeTypeStr);this.$=[{id:z[W-2].id,label:z[W-2].label,type:z[W-2].type,directions:z[W-2].directions},{id:z[W-2].id+"-"+z[W].id,start:z[W-2].id,end:z[W].id,label:z[W-1].label,type:"edge",thickness:j,pattern:te,directions:z[W].directions,arrowTypeEnd:K,arrowTypeStart:X},{id:z[W].id,label:z[W].label,type:N.typeStr2Type(z[W].typeStr),directions:z[W].directions}];break;case 24:N.getLogger().debug("Rule: nodeStatement (abc88 node size) ",z[W-1],z[W]);this.$={id:z[W-1].id,label:z[W-1].label,type:N.typeStr2Type(z[W-1].typeStr),directions:z[W-1].directions,widthInColumns:parseInt(z[W],10)};break;case 25:N.getLogger().debug("Rule: nodeStatement (node) ",z[W]);this.$={id:z[W].id,label:z[W].label,type:N.typeStr2Type(z[W].typeStr),directions:z[W].directions,widthInColumns:1};break;case 26:N.getLogger().debug("APA123",this?this:"na");N.getLogger().debug("COLUMNS: ",z[W]);this.$={type:"column-setting",columns:z[W]==="auto"?-1:parseInt(z[W])};break;case 27:N.getLogger().debug("Rule: id-block statement : ",z[W-2],z[W-1]);const J=N.generateId();this.$={...z[W-2],type:"composite",children:z[W-1]};break;case 28:N.getLogger().debug("Rule: blockStatement : ",z[W-2],z[W-1],z[W]);const oe=N.generateId();this.$={id:oe,type:"composite",label:"",children:z[W-1]};break;case 29:N.getLogger().debug("Rule: node (NODE_ID separator): ",z[W]);this.$={id:z[W]};break;case 30:N.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",z[W-1],z[W]);this.$={id:z[W-1],label:z[W].label,typeStr:z[W].typeStr,directions:z[W].directions};break;case 31:N.getLogger().debug("Rule: dirList: ",z[W]);this.$=[z[W]];break;case 32:N.getLogger().debug("Rule: dirList: ",z[W-1],z[W]);this.$=[z[W-1]].concat(z[W]);break;case 33:N.getLogger().debug("Rule: nodeShapeNLabel: ",z[W-2],z[W-1],z[W]);this.$={typeStr:z[W-2]+z[W],label:z[W-1]};break;case 34:N.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",z[W-3],z[W-2]," #3:",z[W-1],z[W]);this.$={typeStr:z[W-3]+z[W],label:z[W-2],directions:z[W-1]};break;case 35:case 36:this.$={type:"classDef",id:z[W-1].trim(),css:z[W].trim()};break;case 37:this.$={type:"applyClass",id:z[W-1].trim(),styleClass:z[W].trim()};break;case 38:this.$={type:"applyStyles",id:z[W-1].trim(),stylesStr:z[W].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:n,22:8,23:9,24:10,25:11,26:12,28:r,29:i,31:o,39:a,43:s,46:l},{8:[1,20]},e(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:n,28:r,29:i,31:o,39:a,43:s,46:l}),e(d,[2,16],{14:22,15:f,16:h}),e(d,[2,17]),e(d,[2,18]),e(d,[2,19]),e(d,[2,20]),e(d,[2,21]),e(d,[2,22]),e(m,[2,25],{27:[1,25]}),e(d,[2,26]),{19:26,26:12,31:o},{10:t,11:27,13:4,19:5,20:6,21:n,22:8,23:9,24:10,25:11,26:12,28:r,29:i,31:o,39:a,43:s,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(g,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(u,[2,13]),{26:35,31:o},{31:[2,14]},{17:[1,36]},e(m,[2,24]),{10:t,11:37,13:4,14:22,15:f,16:h,19:5,20:6,21:n,22:8,23:9,24:10,25:11,26:12,28:r,29:i,31:o,39:a,43:s,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(g,[2,30]),{18:[1,43]},{18:[1,44]},e(m,[2,23]),{18:[1,45]},{30:[1,46]},e(d,[2,28]),e(d,[2,35]),e(d,[2,36]),e(d,[2,37]),e(d,[2,38]),{36:[1,47]},{33:48,34:x},{15:[1,50]},e(d,[2,27]),e(g,[2,33]),{38:[1,51]},{33:52,34:x,38:[2,31]},{31:[2,15]},e(g,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:B(function A(P,L){if(L.recoverable){this.trace(P)}else{var I=new Error(P);I.hash=L;throw I}},"parseError"),parse:B(function A(P){var L=this,I=[0],N=[],O=[null],z=[],U=this.table,W="",H=0,$=0,K=0,X=2,j=1;var te=z.slice.call(arguments,1);var J=Object.create(this.lexer);var oe={yy:{}};for(var se in this.yy){if(Object.prototype.hasOwnProperty.call(this.yy,se)){oe.yy[se]=this.yy[se]}}J.setInput(P,oe.yy);oe.yy.lexer=J;oe.yy.parser=this;if(typeof J.yylloc=="undefined"){J.yylloc={}}var re=J.yylloc;z.push(re);var ce=J.options&&J.options.ranges;if(typeof oe.yy.parseError==="function"){this.parseError=oe.yy.parseError}else{this.parseError=Object.getPrototypeOf(this).parseError}function ue(ct){I.length=I.length-2*ct;O.length=O.length-ct;z.length=z.length-ct}B(ue,"popStack");function xe(){var ct;ct=N.pop()||J.lex()||j;if(typeof ct!=="number"){if(ct instanceof Array){N=ct;ct=N.pop()}ct=L.symbols_[ct]||ct}return ct}B(xe,"lex");var be,Ie,he,ve,ge,Ve,Le={},$e,Ee,tt,yt;while(true){he=I[I.length-1];if(this.defaultActions[he]){ve=this.defaultActions[he]}else{if(be===null||typeof be=="undefined"){be=xe()}ve=U[he]&&U[he][be]}if(typeof ve==="undefined"||!ve.length||!ve[0]){var mt="";yt=[];for($e in U[he]){if(this.terminals_[$e]&&$e>X){yt.push("'"+this.terminals_[$e]+"'")}}if(J.showPosition){mt="Parse error on line "+(H+1)+":\n"+J.showPosition()+"\nExpecting "+yt.join(", ")+", got '"+(this.terminals_[be]||be)+"'"}else{mt="Parse error on line "+(H+1)+": Unexpected "+(be==j?"end of input":"'"+(this.terminals_[be]||be)+"'")}this.parseError(mt,{text:J.match,token:this.terminals_[be]||be,line:J.yylineno,loc:re,expected:yt})}if(ve[0]instanceof Array&&ve.length>1){throw new Error("Parse Error: multiple actions possible at state: "+he+", token: "+be)}switch(ve[0]){case 1:I.push(be);O.push(J.yytext);z.push(J.yylloc);I.push(ve[1]);be=null;if(!Ie){$=J.yyleng;W=J.yytext;H=J.yylineno;re=J.yylloc;if(K>0){K--}}else{be=Ie;Ie=null}break;case 2:Ee=this.productions_[ve[1]][1];Le.$=O[O.length-Ee];Le._$={first_line:z[z.length-(Ee||1)].first_line,last_line:z[z.length-1].last_line,first_column:z[z.length-(Ee||1)].first_column,last_column:z[z.length-1].last_column};if(ce){Le._$.range=[z[z.length-(Ee||1)].range[0],z[z.length-1].range[1]]}Ve=this.performAction.apply(Le,[W,$,H,oe.yy,ve[1],O,z].concat(te));if(typeof Ve!=="undefined"){return Ve}if(Ee){I=I.slice(0,-1*Ee*2);O=O.slice(0,-1*Ee);z=z.slice(0,-1*Ee)}I.push(this.productions_[ve[1]][0]);O.push(Le.$);z.push(Le._$);tt=U[I[I.length-2]][I[I.length-1]];I.push(tt);break;case 3:return true}}return true},"parse")};var _=function(){var A={EOF:1,parseError:B(function P(L,I){if(this.yy.parser){this.yy.parser.parseError(L,I)}else{throw new Error(L)}},"parseError"),setInput:B(function(P,L){this.yy=L||this.yy||{};this._input=P;this._more=this._backtrack=this.done=false;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};if(this.options.ranges){this.yylloc.range=[0,0]}this.offset=0;return this},"setInput"),input:B(function(){var P=this._input[0];this.yytext+=P;this.yyleng++;this.offset++;this.match+=P;this.matched+=P;var L=P.match(/(?:\r\n?|\n).*/g);if(L){this.yylineno++;this.yylloc.last_line++}else{this.yylloc.last_column++}if(this.options.ranges){this.yylloc.range[1]++}this._input=this._input.slice(1);return P},"input"),unput:B(function(P){var L=P.length;var I=P.split(/(?:\r\n?|\n)/g);this._input=P+this._input;this.yytext=this.yytext.substr(0,this.yytext.length-L);this.offset-=L;var N=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1);this.matched=this.matched.substr(0,this.matched.length-1);if(I.length-1){this.yylineno-=I.length-1}var O=this.yylloc.range;this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:I?(I.length===N.length?this.yylloc.first_column:0)+N[N.length-I.length].length-I[0].length:this.yylloc.first_column-L};if(this.options.ranges){this.yylloc.range=[O[0],O[0]+this.yyleng-L]}this.yyleng=this.yytext.length;return this},"unput"),more:B(function(){this._more=true;return this},"more"),reject:B(function(){if(this.options.backtrack_lexer){this._backtrack=true}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}return this},"reject"),less:B(function(P){this.unput(this.match.slice(P))},"less"),pastInput:B(function(){var P=this.matched.substr(0,this.matched.length-this.match.length);return(P.length>20?"...":"")+P.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:B(function(){var P=this.match;if(P.length<20){P+=this._input.substr(0,20-P.length)}return(P.substr(0,20)+(P.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:B(function(){var P=this.pastInput();var L=new Array(P.length+1).join("-");return P+this.upcomingInput()+"\n"+L+"^"},"showPosition"),test_match:B(function(P,L){var I,N,O;if(this.options.backtrack_lexer){O={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done};if(this.options.ranges){O.yylloc.range=this.yylloc.range.slice(0)}}N=P[0].match(/(?:\r\n?|\n).*/g);if(N){this.yylineno+=N.length}this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:N?N[N.length-1].length-N[N.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+P[0].length};this.yytext+=P[0];this.match+=P[0];this.matches=P;this.yyleng=this.yytext.length;if(this.options.ranges){this.yylloc.range=[this.offset,this.offset+=this.yyleng]}this._more=false;this._backtrack=false;this._input=this._input.slice(P[0].length);this.matched+=P[0];I=this.performAction.call(this,this.yy,this,L,this.conditionStack[this.conditionStack.length-1]);if(this.done&&this._input){this.done=false}if(I){return I}else if(this._backtrack){for(var z in O){this[z]=O[z]}return false}return false},"test_match"),next:B(function(){if(this.done){return this.EOF}if(!this._input){this.done=true}var P,L,I,N;if(!this._more){this.yytext="";this.match=""}var O=this._currentRules();for(var z=0;zL[0].length)){L=I;N=z;if(this.options.backtrack_lexer){P=this.test_match(I,O[z]);if(P!==false){return P}else if(this._backtrack){L=false;continue}else{return false}}else if(!this.options.flex){break}}}if(L){P=this.test_match(L,O[N]);if(P!==false){return P}return false}if(this._input===""){return this.EOF}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}},"next"),lex:B(function P(){var L=this.next();if(L){return L}else{return this.lex()}},"lex"),begin:B(function P(L){this.conditionStack.push(L)},"begin"),popState:B(function P(){var L=this.conditionStack.length-1;if(L>0){return this.conditionStack.pop()}else{return this.conditionStack[0]}},"popState"),_currentRules:B(function P(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules}else{return this.conditions["INITIAL"].rules}},"_currentRules"),topState:B(function P(L){L=this.conditionStack.length-1-Math.abs(L||0);if(L>=0){return this.conditionStack[L]}else{return"INITIAL"}},"topState"),pushState:B(function P(L){this.begin(L)},"pushState"),stateStackSize:B(function P(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:B(function P(L,I,N,O){var z=O;switch(N){case 0:L.getLogger().debug("Found block-beta");return 10;break;case 1:L.getLogger().debug("Found id-block");return 29;break;case 2:L.getLogger().debug("Found block");return 10;break;case 3:L.getLogger().debug(".",I.yytext);break;case 4:L.getLogger().debug("_",I.yytext);break;case 5:return 5;break;case 6:I.yytext=-1;return 28;break;case 7:I.yytext=I.yytext.replace(/columns\s+/,"");L.getLogger().debug("COLUMNS (LEX)",I.yytext);return 28;break;case 8:this.pushState("md_string");break;case 9:return"MD_STR";break;case 10:this.popState();break;case 11:this.pushState("string");break;case 12:L.getLogger().debug("LEX: POPPING STR:",I.yytext);this.popState();break;case 13:L.getLogger().debug("LEX: STR end:",I.yytext);return"STR";break;case 14:I.yytext=I.yytext.replace(/space\:/,"");L.getLogger().debug("SPACE NUM (LEX)",I.yytext);return 21;break;case 15:I.yytext="1";L.getLogger().debug("COLUMNS (LEX)",I.yytext);return 21;break;case 16:return 42;break;case 17:return"LINKSTYLE";break;case 18:return"INTERPOLATE";break;case 19:this.pushState("CLASSDEF");return 39;break;case 20:this.popState();this.pushState("CLASSDEFID");return"DEFAULT_CLASSDEF_ID";break;case 21:this.popState();this.pushState("CLASSDEFID");return 40;break;case 22:this.popState();return 41;break;case 23:this.pushState("CLASS");return 43;break;case 24:this.popState();this.pushState("CLASS_STYLE");return 44;break;case 25:this.popState();return 45;break;case 26:this.pushState("STYLE_STMNT");return 46;break;case 27:this.popState();this.pushState("STYLE_DEFINITION");return 47;break;case 28:this.popState();return 48;break;case 29:this.pushState("acc_title");return"acc_title";break;case 30:this.popState();return"acc_title_value";break;case 31:this.pushState("acc_descr");return"acc_descr";break;case 32:this.popState();return"acc_descr_value";break;case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";break;case 36:return 30;break;case 37:this.popState();L.getLogger().debug("Lex: ((");return"NODE_DEND";break;case 38:this.popState();L.getLogger().debug("Lex: ((");return"NODE_DEND";break;case 39:this.popState();L.getLogger().debug("Lex: ))");return"NODE_DEND";break;case 40:this.popState();L.getLogger().debug("Lex: ((");return"NODE_DEND";break;case 41:this.popState();L.getLogger().debug("Lex: ((");return"NODE_DEND";break;case 42:this.popState();L.getLogger().debug("Lex: (-");return"NODE_DEND";break;case 43:this.popState();L.getLogger().debug("Lex: -)");return"NODE_DEND";break;case 44:this.popState();L.getLogger().debug("Lex: ((");return"NODE_DEND";break;case 45:this.popState();L.getLogger().debug("Lex: ]]");return"NODE_DEND";break;case 46:this.popState();L.getLogger().debug("Lex: (");return"NODE_DEND";break;case 47:this.popState();L.getLogger().debug("Lex: ])");return"NODE_DEND";break;case 48:this.popState();L.getLogger().debug("Lex: /]");return"NODE_DEND";break;case 49:this.popState();L.getLogger().debug("Lex: /]");return"NODE_DEND";break;case 50:this.popState();L.getLogger().debug("Lex: )]");return"NODE_DEND";break;case 51:this.popState();L.getLogger().debug("Lex: )");return"NODE_DEND";break;case 52:this.popState();L.getLogger().debug("Lex: ]>");return"NODE_DEND";break;case 53:this.popState();L.getLogger().debug("Lex: ]");return"NODE_DEND";break;case 54:L.getLogger().debug("Lexa: -)");this.pushState("NODE");return 35;break;case 55:L.getLogger().debug("Lexa: (-");this.pushState("NODE");return 35;break;case 56:L.getLogger().debug("Lexa: ))");this.pushState("NODE");return 35;break;case 57:L.getLogger().debug("Lexa: )");this.pushState("NODE");return 35;break;case 58:L.getLogger().debug("Lex: (((");this.pushState("NODE");return 35;break;case 59:L.getLogger().debug("Lexa: )");this.pushState("NODE");return 35;break;case 60:L.getLogger().debug("Lexa: )");this.pushState("NODE");return 35;break;case 61:L.getLogger().debug("Lexa: )");this.pushState("NODE");return 35;break;case 62:L.getLogger().debug("Lexc: >");this.pushState("NODE");return 35;break;case 63:L.getLogger().debug("Lexa: ([");this.pushState("NODE");return 35;break;case 64:L.getLogger().debug("Lexa: )");this.pushState("NODE");return 35;break;case 65:this.pushState("NODE");return 35;break;case 66:this.pushState("NODE");return 35;break;case 67:this.pushState("NODE");return 35;break;case 68:this.pushState("NODE");return 35;break;case 69:this.pushState("NODE");return 35;break;case 70:this.pushState("NODE");return 35;break;case 71:this.pushState("NODE");return 35;break;case 72:L.getLogger().debug("Lexa: [");this.pushState("NODE");return 35;break;case 73:this.pushState("BLOCK_ARROW");L.getLogger().debug("LEX ARR START");return 37;break;case 74:L.getLogger().debug("Lex: NODE_ID",I.yytext);return 31;break;case 75:L.getLogger().debug("Lex: EOF",I.yytext);return 8;break;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";break;case 79:this.popState();break;case 80:L.getLogger().debug("Lex: Starting string");this.pushState("string");break;case 81:L.getLogger().debug("LEX ARR: Starting string");this.pushState("string");break;case 82:L.getLogger().debug("LEX: NODE_DESCR:",I.yytext);return"NODE_DESCR";break;case 83:L.getLogger().debug("LEX POPPING");this.popState();break;case 84:L.getLogger().debug("Lex: =>BAE");this.pushState("ARROW_DIR");break;case 85:I.yytext=I.yytext.replace(/^,\s*/,"");L.getLogger().debug("Lex (right): dir:",I.yytext);return"DIR";break;case 86:I.yytext=I.yytext.replace(/^,\s*/,"");L.getLogger().debug("Lex (left):",I.yytext);return"DIR";break;case 87:I.yytext=I.yytext.replace(/^,\s*/,"");L.getLogger().debug("Lex (x):",I.yytext);return"DIR";break;case 88:I.yytext=I.yytext.replace(/^,\s*/,"");L.getLogger().debug("Lex (y):",I.yytext);return"DIR";break;case 89:I.yytext=I.yytext.replace(/^,\s*/,"");L.getLogger().debug("Lex (up):",I.yytext);return"DIR";break;case 90:I.yytext=I.yytext.replace(/^,\s*/,"");L.getLogger().debug("Lex (down):",I.yytext);return"DIR";break;case 91:I.yytext="]>";L.getLogger().debug("Lex (ARROW_DIR end):",I.yytext);this.popState();this.popState();return"BLOCK_ARROW_END";break;case 92:L.getLogger().debug("Lex: LINK","#"+I.yytext+"#");return 15;break;case 93:L.getLogger().debug("Lex: LINK",I.yytext);return 15;break;case 94:L.getLogger().debug("Lex: LINK",I.yytext);return 15;break;case 95:L.getLogger().debug("Lex: LINK",I.yytext);return 15;break;case 96:L.getLogger().debug("Lex: START_LINK",I.yytext);this.pushState("LLABEL");return 16;break;case 97:L.getLogger().debug("Lex: START_LINK",I.yytext);this.pushState("LLABEL");return 16;break;case 98:L.getLogger().debug("Lex: START_LINK",I.yytext);this.pushState("LLABEL");return 16;break;case 99:this.pushState("md_string");break;case 100:L.getLogger().debug("Lex: Starting string");this.pushState("string");return"LINK_LABEL";break;case 101:this.popState();L.getLogger().debug("Lex: LINK","#"+I.yytext+"#");return 15;break;case 102:this.popState();L.getLogger().debug("Lex: LINK",I.yytext);return 15;break;case 103:this.popState();L.getLogger().debug("Lex: LINK",I.yytext);return 15;break;case 104:L.getLogger().debug("Lex: COLON",I.yytext);I.yytext=I.yytext.slice(1);return 27;break}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{"STYLE_DEFINITION":{"rules":[28],"inclusive":false},"STYLE_STMNT":{"rules":[27],"inclusive":false},"CLASSDEFID":{"rules":[22],"inclusive":false},"CLASSDEF":{"rules":[20,21],"inclusive":false},"CLASS_STYLE":{"rules":[25],"inclusive":false},"CLASS":{"rules":[24],"inclusive":false},"LLABEL":{"rules":[99,100,101,102,103],"inclusive":false},"ARROW_DIR":{"rules":[85,86,87,88,89,90,91],"inclusive":false},"BLOCK_ARROW":{"rules":[76,81,84],"inclusive":false},"NODE":{"rules":[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],"inclusive":false},"md_string":{"rules":[9,10,78,79],"inclusive":false},"space":{"rules":[],"inclusive":false},"string":{"rules":[12,13,82,83],"inclusive":false},"acc_descr_multiline":{"rules":[34,35],"inclusive":false},"acc_descr":{"rules":[32],"inclusive":false},"acc_title":{"rules":[30],"inclusive":false},"INITIAL":{"rules":[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],"inclusive":true}}};return A}();w.lexer=_;function C(){this.yy={}}B(C,"Parser");C.prototype=w;w.Parser=C;return new C}();qlt.parser=qlt;ZHi=qlt;Zw=new Map;Jlt=[];Xlt=new Map;PBn="color";IBn="fill";JHi="bgFill";zBn=",";aIe=new Map;Qlt="";QHi=B(e=>Ti.sanitizeText(e,Mn()),"sanitizeText");eWi=B(function(e,t=""){let n=aIe.get(e);if(!n){n={id:e,styles:[],textStyles:[]};aIe.set(e,n)}if(t!==void 0&&t!==null){t.split(zBn).forEach(r=>{const i=r.replace(/([^;]*);/,"$1").trim();if(RegExp(PBn).exec(r)){const o=i.replace(IBn,JHi);const a=o.replace(PBn,IBn);n.textStyles.push(a)}n.styles.push(i)})}},"addStyleClass");tWi=B(function(e,t=""){const n=Zw.get(e);if(t!==void 0&&t!==null){n.styles=t.split(zBn)}},"addStyle2Node");nWi=B(function(e,t){e.split(",").forEach(function(n){let r=Zw.get(n);if(r===void 0){const i=n.trim();r={id:i,type:"na",children:[]};Zw.set(i,r)}if(!r.classes){r.classes=[]}r.classes.push(t)})},"setCssClass");UBn=B((e,t)=>{const n=e.flat();const r=[];const i=n.find(a=>a?.type==="column-setting");const o=i?.columns??-1;for(const a of n){if(typeof o==="number"&&o>0&&a.type!=="column-setting"&&typeof a.widthInColumns==="number"&&a.widthInColumns>o){wt.warn(`Block ${a.id} width ${a.widthInColumns} exceeds configured column width ${o}`)}if(a.label){a.label=QHi(a.label)}if(a.type==="classDef"){eWi(a.id,a.css);continue}if(a.type==="applyClass"){nWi(a.id,a?.styleClass??"");continue}if(a.type==="applyStyles"){if(a?.stylesStr){tWi(a.id,a?.stylesStr)}continue}if(a.type==="column-setting"){t.columns=a.columns??-1}else if(a.type==="edge"){const s=(Xlt.get(a.id)??0)+1;Xlt.set(a.id,s);a.id=s+"-"+a.id;Jlt.push(a)}else{if(!a.label){if(a.type==="composite"){a.label=""}else{a.label=a.id}}const s=Zw.get(a.id);if(s===void 0){Zw.set(a.id,a)}else{if(a.type!=="na"){s.type=a.type}if(a.label!==a.id){s.label=a.label}}if(a.children){UBn(a.children,a)}if(a.type==="space"){const l=a.width??1;for(let u=0;u{wt.debug("Clear called");Da();Rre={id:"root",type:"composite",children:[],columns:-1};Zw=new Map([["root",Rre]]);ect=[];aIe=new Map;Jlt=[];Xlt=new Map;Qlt=""},"clear");B(VBn,"typeStr2Type");B($Bn,"edgeTypeStr2Type");B(GBn,"edgeStrToEdgeData");B(HBn,"edgeStrToEdgeStartData");B(WBn,"edgeStrToThickness");B(YBn,"edgeStrToPattern");MBn=0;iWi=B(()=>{MBn++;return"id-"+Math.random().toString(36).substr(2,12)+"-"+MBn},"generateId");oWi=B(e=>{Rre.children=e;UBn(e,Rre);ect=Rre.children},"setHierarchy");aWi=B(e=>{const t=Zw.get(e);if(!t){return-1}if(t.columns){return t.columns}if(!t.children){return-1}return t.children.length},"getColumns");sWi=B(()=>{return[...Zw.values()]},"getBlocksFlat");lWi=B(()=>{return ect||[]},"getBlocks");cWi=B(()=>{return Jlt},"getEdges");uWi=B(e=>{return Zw.get(e)},"getBlock");dWi=B(e=>{Zw.set(e.id,e)},"setBlock");fWi=B(e=>{Qlt=e},"setDiagramId");hWi=B(()=>Qlt,"getDiagramId");pWi=B(()=>wt,"getLogger");mWi=B(function(){return aIe},"getClasses");gWi={getConfig:B(()=>Ji().block,"getConfig"),typeStr2Type:VBn,edgeTypeStr2Type:$Bn,edgeStrToEdgeData:GBn,edgeStrToEdgeStartData:HBn,edgeStrToThickness:WBn,edgeStrToPattern:YBn,getLogger:pWi,getBlocksFlat:sWi,getBlocks:lWi,getEdges:cWi,setHierarchy:oWi,getBlock:uWi,setBlock:dWi,getColumns:aWi,getClasses:mWi,clear:rWi,generateId:iWi,setDiagramId:fWi,getDiagramId:hWi};yWi=gWi;Ylt=B((e,t)=>{const n=P5;const r=n(e,"r");const i=n(e,"g");const o=n(e,"b");return mh(r,i,o,t)},"fade");bWi=B(e=>`.label { + font-family: ${e.fontFamily}; + color: ${e.nodeTextColor||e.textColor}; + } + .cluster-label text { + fill: ${e.titleColor}; + } + .cluster-label span,p { + color: ${e.titleColor}; + } + + + + .label text,span,p { + fill: ${e.nodeTextColor||e.textColor}; + color: ${e.nodeTextColor||e.textColor}; + } + + .node rect, + .node circle, + .node ellipse, + .node polygon, + .node path { + fill: ${e.mainBkg}; + stroke: ${e.nodeBorder}; + stroke-width: 1px; + } + .flowchart-label text { + text-anchor: middle; + } + // .flowchart-label .text-outer-tspan { + // text-anchor: middle; + // } + // .flowchart-label .text-inner-tspan { + // text-anchor: start; + // } + + .node .label { + text-align: center; + } + .node.clickable { + cursor: pointer; + } + + .arrowheadPath { + fill: ${e.arrowheadColor}; + } + + .edgePath .path { + stroke: ${e.lineColor}; + stroke-width: 2.0px; + } + + .flowchart-link { + stroke: ${e.lineColor}; + fill: none; + } + + .edgeLabel { + background-color: ${e.edgeLabelBackground}; + /* + * This is for backward compatibility with existing code that didn't + * add a \`

    \` around edge labels. + * + * TODO: We should probably remove this in a future release. + */ + p { + margin: 0; + padding: 0; + display: inline; + } + rect { + opacity: 0.5; + background-color: ${e.edgeLabelBackground}; + fill: ${e.edgeLabelBackground}; + } + text-align: center; + } + + /* For html labels only */ + .labelBkg { + background-color: ${e.edgeLabelBackground}; + } + + .node .cluster { + // fill: ${Ylt(e.mainBkg,.5)}; + fill: ${Ylt(e.clusterBkg,.5)}; + stroke: ${Ylt(e.clusterBorder,.2)}; + box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px; + stroke-width: 1px; + } + + .cluster text { + fill: ${e.titleColor}; + } + + .cluster span,p { + color: ${e.titleColor}; + } + /* .cluster div { + color: ${e.titleColor}; + } */ + + div.mermaidTooltip { + position: absolute; + text-align: center; + max-width: 200px; + padding: 2px; + font-family: ${e.fontFamily}; + font-size: 12px; + background: ${e.tertiaryColor}; + border: 1px solid ${e.border2}; + border-radius: 2px; + pointer-events: none; + z-index: 100; + } + + .flowchartTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${e.textColor}; + } + ${oS()} +`,"getStyles");xWi=bWi;vWi=B((e,t,n,r)=>{t.forEach(i=>{PWi[i](e,n,r)})},"insertMarkers");_Wi=B((e,t,n)=>{wt.trace("Making markers for ",n);e.append("defs").append("marker").attr("id",n+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z");e.append("defs").append("marker").attr("id",n+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension");TWi=B((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z");e.append("defs").append("marker").attr("id",n+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition");wWi=B((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z");e.append("defs").append("marker").attr("id",n+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation");EWi=B((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z");e.append("defs").append("marker").attr("id",n+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency");CWi=B((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6);e.append("defs").append("marker").attr("id",n+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop");SWi=B((e,t,n)=>{e.append("marker").attr("id",n+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0");e.append("marker").attr("id",n+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point");AWi=B((e,t,n)=>{e.append("marker").attr("id",n+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0");e.append("marker").attr("id",n+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle");kWi=B((e,t,n)=>{e.append("marker").attr("id",n+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0");e.append("marker").attr("id",n+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross");RWi=B((e,t,n)=>{e.append("defs").append("marker").attr("id",n+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb");PWi={extension:_Wi,composition:TWi,aggregation:wWi,dependency:EWi,lollipop:CWi,point:SWi,circle:AWi,cross:kWi,barb:RWi};IWi=vWi;B(jlt,"calculateBlockPosition");MWi=B(e=>{let t=0;let n=0;for(const r of e.children){const{width:i,height:o,x:a,y:s}=r.size??{width:0,height:0,x:0,y:0};wt.debug("getMaxChildSize abc95 child:",r.id,"width:",i,"height:",o,"x:",a,"y:",s,r.type);if(r.type==="space"){continue}const l=i/(r.widthInColumns??1);if(l>t){t=l}if(o>n){n=o}}return{width:t,height:n}},"getMaxChildSize");B(sIe,"setBlockSizes");B(tct,"layoutBlocks");B(nct,"findBounds");B(qBn,"layout");LWi=B(async(e,t,n,r=false,i=false)=>{let o=t||"";if(typeof o==="object"){o=o[0]}const a=Mn();const s=oc(a);return await Qh(e,o,{style:n,isTitle:r,useHtmlLabels:s,markdown:false,isNode:i,width:Number.POSITIVE_INFINITY},a)},"createLabel");Kw=LWi;DWi=B((e,t,n,r,i)=>{if(t.arrowTypeStart){LBn(e,"start",t.arrowTypeStart,n,r,i)}if(t.arrowTypeEnd){LBn(e,"end",t.arrowTypeEnd,n,r,i)}},"addEdgeMarkers");FWi={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"};LBn=B((e,t,n,r,i,o)=>{const a=FWi[n];if(!a){wt.warn(`Unknown arrow type: ${n}`);return}const s=t==="start"?"Start":"End";e.attr(`marker-${t}`,`url(${r}#${i}_${o}-${a}${s})`)},"addEdgeMarker");Klt={};jy={};NWi=B(async(e,t)=>{const n=Mn();const r=oc(n);const i=e.insert("g").attr("class","edgeLabel");const o=i.insert("g").attr("class","label");const a=t.labelType==="markdown";const s=await Qh(e,t.label,{style:t.labelStyle,useHtmlLabels:r,addSvgBackground:a,isNode:false,markdown:a,width:a?void 0:Number.POSITIVE_INFINITY},n);o.node().appendChild(s);let l=s.getBBox();let u=l;if(r){const f=s.children[0];const h=zr(s);l=f.getBoundingClientRect();u=l;h.attr("width",l.width);h.attr("height",l.height)}else{const f=zr(s).select("text").node();if(f&&typeof f.getBBox==="function"){u=f.getBBox()}}o.attr("transform",I_(u,r));Klt[t.id]=i;t.width=l.width;t.height=l.height;let d;if(t.startLabelLeft){const f=e.insert("g").attr("class","edgeTerminals");const h=f.insert("g").attr("class","inner");const m=await Kw(h,t.startLabelLeft,t.labelStyle);d=m;let g=m.getBBox();if(r){const x=m.children[0];const w=zr(m);g=x.getBoundingClientRect();w.attr("width",g.width);w.attr("height",g.height)}h.attr("transform",I_(g,r));if(!jy[t.id]){jy[t.id]={}}jy[t.id].startLeft=f;kre(d,t.startLabelLeft)}if(t.startLabelRight){const f=e.insert("g").attr("class","edgeTerminals");const h=f.insert("g").attr("class","inner");const m=await Kw(h,t.startLabelRight,t.labelStyle);d=m;let g=m.getBBox();if(r){const x=m.children[0];const w=zr(m);g=x.getBoundingClientRect();w.attr("width",g.width);w.attr("height",g.height)}h.attr("transform",I_(g,r));if(!jy[t.id]){jy[t.id]={}}jy[t.id].startRight=f;kre(d,t.startLabelRight)}if(t.endLabelLeft){const f=e.insert("g").attr("class","edgeTerminals");const h=f.insert("g").attr("class","inner");const m=await Kw(f,t.endLabelLeft,t.labelStyle);d=m;let g=m.getBBox();if(r){const x=m.children[0];const w=zr(m);g=x.getBoundingClientRect();w.attr("width",g.width);w.attr("height",g.height)}h.attr("transform",I_(g,r));if(!jy[t.id]){jy[t.id]={}}jy[t.id].endLeft=f;kre(d,t.endLabelLeft)}if(t.endLabelRight){const f=e.insert("g").attr("class","edgeTerminals");const h=f.insert("g").attr("class","inner");const m=await Kw(f,t.endLabelRight,t.labelStyle);d=m;let g=m.getBBox();if(r){const x=m.children[0];const w=zr(m);g=x.getBoundingClientRect();w.attr("width",g.width);w.attr("height",g.height)}h.attr("transform",I_(g,r));if(!jy[t.id]){jy[t.id]={}}jy[t.id].endRight=f;kre(d,t.endLabelRight)}return s},"insertEdgeLabel");B(kre,"setTerminalWidth");OWi=B((e,t)=>{wt.debug("Moving label abc88 ",e.id,e.label,Klt[e.id],t);let n=t.updatedPath?t.updatedPath:t.originalPath;const r=Mn();const{subGraphTitleTotalMargin:i}=Sw(r);if(e.label){const o=Klt[e.id];let a=e.x;let s=e.y;if(n){const l=Ko.calcLabelPosition(n);wt.debug("Moving label "+e.label+" from (",a,",",s,") to (",l.x,",",l.y,") abc88");if(t.updatedPath){a=l.x;s=l.y}}o.attr("transform",`translate(${a}, ${s+i/2})`)}if(e.startLabelLeft){const o=jy[e.id].startLeft;let a=e.x;let s=e.y;if(n){const l=Ko.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",n);a=l.x;s=l.y}o.attr("transform",`translate(${a}, ${s})`)}if(e.startLabelRight){const o=jy[e.id].startRight;let a=e.x;let s=e.y;if(n){const l=Ko.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",n);a=l.x;s=l.y}o.attr("transform",`translate(${a}, ${s})`)}if(e.endLabelLeft){const o=jy[e.id].endLeft;let a=e.x;let s=e.y;if(n){const l=Ko.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",n);a=l.x;s=l.y}o.attr("transform",`translate(${a}, ${s})`)}if(e.endLabelRight){const o=jy[e.id].endRight;let a=e.x;let s=e.y;if(n){const l=Ko.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",n);a=l.x;s=l.y}o.attr("transform",`translate(${a}, ${s})`)}},"positionEdgeLabel");BWi=B((e,t)=>{const n=e.x;const r=e.y;const i=Math.abs(t.x-n);const o=Math.abs(t.y-r);const a=e.width/2;const s=e.height/2;if(i>=a||o>=s){return true}return false},"outsideNode");zWi=B((e,t,n)=>{wt.debug(`intersection calc abc89: + outsidePoint: ${JSON.stringify(t)} + insidePoint : ${JSON.stringify(n)} + node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const r=e.x;const i=e.y;const o=Math.abs(r-n.x);const a=e.width/2;let s=n.xMath.abs(r-t.x)*l){let f=n.y{wt.debug("abc88 cutPathAtIntersect",e,t);let n=[];let r=e[0];let i=false;e.forEach(o=>{if(!BWi(t,o)&&!i){const a=zWi(t,r,o);let s=false;n.forEach(l=>{s=s||l.x===a.x&&l.y===a.y});if(!n.some(l=>l.x===a.x&&l.y===a.y)){n.push(a)}i=true}else{r=o;if(!i){n.push(o)}}});return n},"cutPathAtIntersect");UWi=B(function(e,t,n,r,i,o,a){let s=n.points;wt.debug("abc88 InsertEdge: edge=",n,"e=",t);let l=false;const u=o.node(t.v);var d=o.node(t.w);if(d?.intersect&&u?.intersect){s=s.slice(1,n.points.length-1);s.unshift(u.intersect(s[0]));s.push(d.intersect(s[s.length-1]))}if(n.toCluster){wt.debug("to cluster abc88",r[n.toCluster]);s=DBn(n.points,r[n.toCluster].node);l=true}if(n.fromCluster){wt.debug("from cluster abc88",r[n.fromCluster]);s=DBn(s.reverse(),r[n.fromCluster].node).reverse();l=true}const f=s.filter(P=>!Number.isNaN(P.y));let h=UE;if(n.curve&&(i==="graph"||i==="flowchart")){h=n.curve}const{x:m,y:g}=XEe(n);const x=Wb().x(m).y(g).curve(h);let w;switch(n.thickness){case"normal":w="edge-thickness-normal";break;case"thick":w="edge-thickness-thick";break;case"invisible":w="edge-thickness-thick";break;default:w=""}switch(n.pattern){case"solid":w+=" edge-pattern-solid";break;case"dotted":w+=" edge-pattern-dotted";break;case"dashed":w+=" edge-pattern-dashed";break}const _=e.append("path").attr("d",x(f)).attr("id",n.id).attr("class"," "+w+(n.classes?" "+n.classes:"")).attr("style",n.style);let C="";if(Mn().flowchart.arrowMarkerAbsolute||Mn().state.arrowMarkerAbsolute){C=B5(true)}DWi(_,n,C,a,i);let A={};if(l){A.updatedPath=s}A.originalPath=n.points;return A},"insertEdge");VWi=B(e=>{const t=new Set;for(const n of e){switch(n){case"x":t.add("right");t.add("left");break;case"y":t.add("up");t.add("down");break;default:t.add(n);break}}return t},"expandAndDeduplicateDirections");$Wi=B((e,t,n,r)=>{const i=VWi(e);const o=2;const a=t.height+2*n.padding;const s=a/o;const l=r??t.width+2*s+n.padding;const u=n.padding/2;if(i.has("right")&&i.has("left")&&i.has("up")&&i.has("down")){return[{x:0,y:0},{x:s,y:0},{x:l/2,y:2*u},{x:l-s,y:0},{x:l,y:0},{x:l,y:-a/3},{x:l+2*u,y:-a/2},{x:l,y:-2*a/3},{x:l,y:-a},{x:l-s,y:-a},{x:l/2,y:-a-2*u},{x:s,y:-a},{x:0,y:-a},{x:0,y:-2*a/3},{x:-2*u,y:-a/2},{x:0,y:-a/3}]}if(i.has("right")&&i.has("left")&&i.has("up")){return[{x:s,y:0},{x:l-s,y:0},{x:l,y:-a/2},{x:l-s,y:-a},{x:s,y:-a},{x:0,y:-a/2}]}if(i.has("right")&&i.has("left")&&i.has("down")){return[{x:0,y:0},{x:s,y:-a},{x:l-s,y:-a},{x:l,y:0}]}if(i.has("right")&&i.has("up")&&i.has("down")){return[{x:0,y:0},{x:l,y:-s},{x:l,y:-a+s},{x:0,y:-a}]}if(i.has("left")&&i.has("up")&&i.has("down")){return[{x:l,y:0},{x:0,y:-s},{x:0,y:-a+s},{x:l,y:-a}]}if(i.has("right")&&i.has("left")){return[{x:s,y:0},{x:s,y:-u},{x:l-s,y:-u},{x:l-s,y:0},{x:l,y:-a/2},{x:l-s,y:-a},{x:l-s,y:-a+u},{x:s,y:-a+u},{x:s,y:-a},{x:0,y:-a/2}]}if(i.has("up")&&i.has("down")){return[{x:l/2,y:0},{x:0,y:-u},{x:s,y:-u},{x:s,y:-a+u},{x:0,y:-a+u},{x:l/2,y:-a},{x:l,y:-a+u},{x:l-s,y:-a+u},{x:l-s,y:-u},{x:l,y:-u}]}if(i.has("right")&&i.has("up")){return[{x:0,y:0},{x:l,y:-s},{x:0,y:-a}]}if(i.has("right")&&i.has("down")){return[{x:0,y:0},{x:l,y:0},{x:0,y:-a}]}if(i.has("left")&&i.has("up")){return[{x:l,y:0},{x:0,y:-s},{x:l,y:-a}]}if(i.has("left")&&i.has("down")){return[{x:l,y:0},{x:0,y:0},{x:l,y:-a}]}if(i.has("right")){return[{x:s,y:-u},{x:s,y:-u},{x:l-s,y:-u},{x:l-s,y:0},{x:l,y:-a/2},{x:l-s,y:-a},{x:l-s,y:-a+u},{x:s,y:-a+u},{x:s,y:-a+u}]}if(i.has("left")){return[{x:s,y:0},{x:s,y:-u},{x:l-s,y:-u},{x:l-s,y:-a+u},{x:s,y:-a+u},{x:s,y:-a},{x:0,y:-a/2}]}if(i.has("up")){return[{x:s,y:-u},{x:s,y:-a+u},{x:0,y:-a+u},{x:l/2,y:-a},{x:l,y:-a+u},{x:l-s,y:-a+u},{x:l-s,y:-u}]}if(i.has("down")){return[{x:l/2,y:0},{x:0,y:-u},{x:s,y:-u},{x:s,y:-a+u},{x:l-s,y:-a+u},{x:l-s,y:-u},{x:l,y:-u}]}return[{x:0,y:0}]},"getArrowPoints");B(XBn,"intersectNode");GWi=XBn;B(jBn,"intersectEllipse");KBn=jBn;B(ZBn,"intersectCircle");HWi=ZBn;B(JBn,"intersectLine");B(Zlt,"sameSign");WWi=JBn;YWi=QBn;B(QBn,"intersectPolygon");qWi=B((e,t)=>{var n=e.x;var r=e.y;var i=t.x-n;var o=t.y-r;var a=e.width/2;var s=e.height/2;var l,u;if(Math.abs(o)*a>Math.abs(i)*s){if(o<0){s=-s}l=o===0?0:s*i/o;u=s}else{if(i<0){a=-a}l=a;u=i===0?0:a*o/i}return{x:n+l,y:r+u}},"intersectRect");XWi=qWi;lf={node:GWi,circle:HWi,ellipse:KBn,polygon:YWi,rect:XWi};Hm=B(async(e,t,n,r)=>{const i=Mn();let o;const a=t.useHtmlLabels||oc(i);if(!n){o="node default"}else{o=n}const s=e.insert("g").attr("class",o).attr("id",t.domId||t.id);const l=s.insert("g").attr("class","label").attr("style",t.labelStyle);let u;if(t.labelText===void 0){u=""}else{u=typeof t.labelText==="string"?t.labelText:t.labelText[0]}let d;if(t.labelType==="markdown"){d=Qh(l,La(tv(u),i),{useHtmlLabels:a,width:t.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i)}else{d=await Kw(l,La(tv(u),i),t.labelStyle,false,r)}let f=d.getBBox();const h=t.padding/2;if(oc(i)){const m=d.children[0];const g=zr(d);await Ree(m,u);f=m.getBoundingClientRect();g.attr("width",f.width);g.attr("height",f.height)}if(a){l.attr("transform","translate("+-f.width/2+", "+-f.height/2+")")}else{l.attr("transform","translate(0, "+-f.height/2+")")}if(t.centerLabel){l.attr("transform","translate("+-f.width/2+", "+-f.height/2+")")}l.insert("rect",":first-child");return{shapeSvg:s,bbox:f,halfPadding:h,label:l}},"labelHelper");Qf=B((e,t)=>{const n=t.node().getBBox();e.width=n.width;e.height=n.height},"updateNodeBounds");B(Jw,"insertPolygonShape");jWi=B(async(e,t)=>{const n=t.useHtmlLabels||oc(Mn());if(!n){t.centerLabel=true}const{shapeSvg:r,bbox:i,halfPadding:o}=await Hm(e,t,"node "+t.classes,true);wt.info("Classes = ",t.classes);const a=r.insert("rect",":first-child");a.attr("rx",t.rx).attr("ry",t.ry).attr("x",-i.width/2-o).attr("y",-i.height/2-o).attr("width",i.width+t.padding).attr("height",i.height+t.padding);Qf(t,a);t.intersect=function(s){return lf.rect(t,s)};return r},"note");KWi=jWi;FBn=B(e=>{if(e){return" "+e}return""},"formatClass");xv=B((e,t)=>{return`${t?t:"node default"}${FBn(e.classes)} ${FBn(e.class)}`},"getClassesFromNode");NBn=B(async(e,t)=>{const{shapeSvg:n,bbox:r}=await Hm(e,t,xv(t,void 0),true);const i=r.width+t.padding;const o=r.height+t.padding;const a=i+o;const s=[{x:a/2,y:0},{x:a,y:-a/2},{x:a/2,y:-a},{x:0,y:-a/2}];wt.info("Question main (Circle)");const l=Jw(n,a,a,s);l.attr("style",t.style);Qf(t,l);t.intersect=function(u){wt.warn("Intersect called");return lf.polygon(t,s,u)};return n},"question");ZWi=B((e,t)=>{const n=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);const r=28;const i=[{x:0,y:r/2},{x:r/2,y:0},{x:0,y:-r/2},{x:-r/2,y:0}];const o=n.insert("polygon",":first-child").attr("points",i.map(function(a){return a.x+","+a.y}).join(" "));o.attr("class","state-start").attr("r",7).attr("width",28).attr("height",28);t.width=28;t.height=28;t.intersect=function(a){return lf.circle(t,14,a)};return n},"choice");JWi=B(async(e,t)=>{const{shapeSvg:n,bbox:r}=await Hm(e,t,xv(t,void 0),true);const i=4;const o=t.positioned?t.height:r.height+t.padding;const a=o/i;const s=t.positioned?t.width:r.width+2*a+t.padding;const l=[{x:a,y:0},{x:s-a,y:0},{x:s,y:-o/2},{x:s-a,y:-o},{x:a,y:-o},{x:0,y:-o/2}];const u=Jw(n,s,o,l);u.attr("style",t.style);Qf(t,u);t.intersect=function(d){return lf.polygon(t,l,d)};return n},"hexagon");QWi=B(async(e,t)=>{const{shapeSvg:n,bbox:r}=await Hm(e,t,void 0,true);const i=2;const o=r.height+2*t.padding;const a=o/i;const s=r.width+2*a+t.padding;const l=t.positioned&&(t.widthInColumns??1)>1&&t.width>s;const u=l?t.width:s;const d=$Wi(t.directions,r,t,u);const f=Jw(n,u,o,d);f.attr("style",t.style);Qf(t,f);t.intersect=function(h){return lf.polygon(t,d,h)};return n},"block_arrow");eYi=B(async(e,t)=>{const{shapeSvg:n,bbox:r}=await Hm(e,t,xv(t,void 0),true);const i=r.width+t.padding;const o=r.height+t.padding;const a=[{x:-o/2,y:0},{x:i,y:0},{x:i,y:-o},{x:-o/2,y:-o},{x:0,y:-o/2}];const s=Jw(n,i,o,a);s.attr("style",t.style);t.width=i+o;t.height=o;t.intersect=function(l){return lf.polygon(t,a,l)};return n},"rect_left_inv_arrow");tYi=B(async(e,t)=>{const{shapeSvg:n,bbox:r}=await Hm(e,t,xv(t),true);const i=r.width+t.padding;const o=r.height+t.padding;const a=[{x:-2*o/6,y:0},{x:i-o/6,y:0},{x:i+2*o/6,y:-o},{x:o/6,y:-o}];const s=Jw(n,i,o,a);s.attr("style",t.style);Qf(t,s);t.intersect=function(l){return lf.polygon(t,a,l)};return n},"lean_right");nYi=B(async(e,t)=>{const{shapeSvg:n,bbox:r}=await Hm(e,t,xv(t,void 0),true);const i=r.width+t.padding;const o=r.height+t.padding;const a=[{x:2*o/6,y:0},{x:i+o/6,y:0},{x:i-2*o/6,y:-o},{x:-o/6,y:-o}];const s=Jw(n,i,o,a);s.attr("style",t.style);Qf(t,s);t.intersect=function(l){return lf.polygon(t,a,l)};return n},"lean_left");rYi=B(async(e,t)=>{const{shapeSvg:n,bbox:r}=await Hm(e,t,xv(t,void 0),true);const i=r.width+t.padding;const o=r.height+t.padding;const a=[{x:-2*o/6,y:0},{x:i+2*o/6,y:0},{x:i-o/6,y:-o},{x:o/6,y:-o}];const s=Jw(n,i,o,a);s.attr("style",t.style);Qf(t,s);t.intersect=function(l){return lf.polygon(t,a,l)};return n},"trapezoid");iYi=B(async(e,t)=>{const{shapeSvg:n,bbox:r}=await Hm(e,t,xv(t,void 0),true);const i=r.width+t.padding;const o=r.height+t.padding;const a=[{x:o/6,y:0},{x:i-o/6,y:0},{x:i+2*o/6,y:-o},{x:-2*o/6,y:-o}];const s=Jw(n,i,o,a);s.attr("style",t.style);Qf(t,s);t.intersect=function(l){return lf.polygon(t,a,l)};return n},"inv_trapezoid");oYi=B(async(e,t)=>{const{shapeSvg:n,bbox:r}=await Hm(e,t,xv(t,void 0),true);const i=r.width+t.padding;const o=r.height+t.padding;const a=[{x:0,y:0},{x:i+o/2,y:0},{x:i,y:-o/2},{x:i+o/2,y:-o},{x:0,y:-o}];const s=Jw(n,i,o,a);s.attr("style",t.style);Qf(t,s);t.intersect=function(l){return lf.polygon(t,a,l)};return n},"rect_right_inv_arrow");aYi=B(async(e,t)=>{const{shapeSvg:n,bbox:r}=await Hm(e,t,xv(t,void 0),true);const i=r.width+t.padding;const o=i/2;const a=o/(2.5+i/50);const s=r.height+a+t.padding;const l="M 0,"+a+" a "+o+","+a+" 0,0,0 "+i+" 0 a "+o+","+a+" 0,0,0 "+-i+" 0 l 0,"+s+" a "+o+","+a+" 0,0,0 "+i+" 0 l 0,"+-s;const u=n.attr("label-offset-y",a).insert("path",":first-child").attr("style",t.style).attr("d",l).attr("transform","translate("+-i/2+","+-(s/2+a)+")");Qf(t,u);t.intersect=function(d){const f=lf.rect(t,d);const h=f.x-t.x;if(o!=0&&(Math.abs(h)t.height/2-a)){let m=a*a*(1-h*h/(o*o));if(m!=0){m=Math.sqrt(m)}m=a-m;if(d.y-t.y>0){m=-m}f.y+=m}return f};return n},"cylinder");sYi=B(async(e,t)=>{const{shapeSvg:n,bbox:r,halfPadding:i}=await Hm(e,t,"node "+t.classes+" "+t.class,true);const o=n.insert("rect",":first-child");const a=t.positioned?t.width:r.width+t.padding;const s=t.positioned?t.height:r.height+t.padding;const l=t.positioned?-a/2:-r.width/2-i;const u=t.positioned?-s/2:-r.height/2-i;o.attr("class","basic label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",l).attr("y",u).attr("width",a).attr("height",s);if(t.props){const d=new Set(Object.keys(t.props));if(t.props.borders){lIe(o,t.props.borders,a,s);d.delete("borders")}d.forEach(f=>{wt.warn(`Unknown node property ${f}`)})}Qf(t,o);t.intersect=function(d){return lf.rect(t,d)};return n},"rect");lYi=B(async(e,t)=>{const{shapeSvg:n,bbox:r,halfPadding:i}=await Hm(e,t,"node "+t.classes,true);const o=n.insert("rect",":first-child");const a=t.positioned?t.width:r.width+t.padding;const s=t.positioned?t.height:r.height+t.padding;const l=t.positioned?-a/2:-r.width/2-i;const u=t.positioned?-s/2:-r.height/2-i;o.attr("class","basic cluster composite label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",l).attr("y",u).attr("width",a).attr("height",s);if(t.props){const d=new Set(Object.keys(t.props));if(t.props.borders){lIe(o,t.props.borders,a,s);d.delete("borders")}d.forEach(f=>{wt.warn(`Unknown node property ${f}`)})}Qf(t,o);t.intersect=function(d){return lf.rect(t,d)};return n},"composite");cYi=B(async(e,t)=>{const{shapeSvg:n}=await Hm(e,t,"label",true);wt.trace("Classes = ",t.class);const r=n.insert("rect",":first-child");const i=0;const o=0;r.attr("width",i).attr("height",o);n.attr("class","label edgeLabel");if(t.props){const a=new Set(Object.keys(t.props));if(t.props.borders){lIe(r,t.props.borders,i,o);a.delete("borders")}a.forEach(s=>{wt.warn(`Unknown node property ${s}`)})}Qf(t,r);t.intersect=function(a){return lf.rect(t,a)};return n},"labelRect");B(lIe,"applyNodePropertyBorders");uYi=B(async(e,t)=>{let n;if(!t.classes){n="node default"}else{n="node "+t.classes}const r=e.insert("g").attr("class",n).attr("id",t.domId||t.id);const i=r.insert("rect",":first-child");const o=r.insert("line");const a=r.insert("g").attr("class","label");const s=t.labelText.flat?t.labelText.flat():t.labelText;let l="";if(typeof s==="object"){l=s[0]}else{l=s}wt.info("Label text abc79",l,s,typeof s==="object");const u=await Kw(a,l,t.labelStyle,true,true);let d={width:0,height:0};if(oc(Mn())){const x=u.children[0];const w=zr(u);d=x.getBoundingClientRect();w.attr("width",d.width);w.attr("height",d.height)}wt.info("Text 2",s);const f=s.slice(1,s.length);let h=u.getBBox();const m=await Kw(a,f.join?f.join("
    "):f,t.labelStyle,true,true);if(oc(Mn())){const x=m.children[0];const w=zr(m);d=x.getBoundingClientRect();w.attr("width",d.width);w.attr("height",d.height)}const g=t.padding/2;zr(m).attr("transform","translate( "+(d.width>h.width?0:(h.width-d.width)/2)+", "+(h.height+g+5)+")");zr(u).attr("transform","translate( "+(d.width{const{shapeSvg:n,bbox:r}=await Hm(e,t,xv(t,void 0),true);const i=r.height+t.padding;const o=r.width+i/4+t.padding;const a=n.insert("rect",":first-child").attr("style",t.style).attr("rx",i/2).attr("ry",i/2).attr("x",-o/2).attr("y",-i/2).attr("width",o).attr("height",i);Qf(t,a);t.intersect=function(s){return lf.rect(t,s)};return n},"stadium");fYi=B(async(e,t)=>{const{shapeSvg:n,bbox:r,halfPadding:i}=await Hm(e,t,xv(t,void 0),true);const o=n.insert("circle",":first-child");o.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",r.width/2+i).attr("width",r.width+t.padding).attr("height",r.height+t.padding);wt.info("Circle main");Qf(t,o);t.intersect=function(a){wt.info("Circle intersect",t,r.width/2+i,a);return lf.circle(t,r.width/2+i,a)};return n},"circle");hYi=B(async(e,t)=>{const{shapeSvg:n,bbox:r,halfPadding:i}=await Hm(e,t,xv(t,void 0),true);const o=5;const a=n.insert("g",":first-child");const s=a.insert("circle");const l=a.insert("circle");a.attr("class",t.class);s.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",r.width/2+i+o).attr("width",r.width+t.padding+o*2).attr("height",r.height+t.padding+o*2);l.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",r.width/2+i).attr("width",r.width+t.padding).attr("height",r.height+t.padding);wt.info("DoubleCircle main");Qf(t,s);t.intersect=function(u){wt.info("DoubleCircle intersect",t,r.width/2+i+o,u);return lf.circle(t,r.width/2+i+o,u)};return n},"doublecircle");pYi=B(async(e,t)=>{const{shapeSvg:n,bbox:r}=await Hm(e,t,xv(t,void 0),true);const i=r.width+t.padding;const o=r.height+t.padding;const a=[{x:0,y:0},{x:i,y:0},{x:i,y:-o},{x:0,y:-o},{x:0,y:0},{x:-8,y:0},{x:i+8,y:0},{x:i+8,y:-o},{x:-8,y:-o},{x:-8,y:0}];const s=Jw(n,i,o,a);s.attr("style",t.style);Qf(t,s);t.intersect=function(l){return lf.polygon(t,a,l)};return n},"subroutine");mYi=B((e,t)=>{const n=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);const r=n.insert("circle",":first-child");r.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14);Qf(t,r);t.intersect=function(i){return lf.circle(t,7,i)};return n},"start");OBn=B((e,t,n)=>{const r=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let i=70;let o=10;if(n==="LR"){i=10;o=70}const a=r.append("rect").attr("x",-1*i/2).attr("y",-1*o/2).attr("width",i).attr("height",o).attr("class","fork-join");Qf(t,a);t.height=t.height+t.padding/2;t.width=t.width+t.padding/2;t.intersect=function(s){return lf.rect(t,s)};return r},"forkJoin");gYi=B((e,t)=>{const n=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);const r=n.insert("circle",":first-child");const i=n.insert("circle",":first-child");i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14);r.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10);Qf(t,i);t.intersect=function(o){return lf.circle(t,7,o)};return n},"end");yYi=B(async(e,t)=>{const n=t.padding/2;const r=4;const i=8;let o;if(!t.classes){o="node default"}else{o="node "+t.classes}const a=e.insert("g").attr("class",o).attr("id",t.domId||t.id);const s=a.insert("rect",":first-child");const l=a.insert("line");const u=a.insert("line");let d=0;let f=r;const h=a.insert("g").attr("class","label");let m=0;const g=t.classData.annotations?.[0];const x=t.classData.annotations[0]?"\xAB"+t.classData.annotations[0]+"\xBB":"";const w=await Kw(h,x,t.labelStyle,true,true);let _=w.getBBox();if(oc(Mn())){const O=w.children[0];const z=zr(w);_=O.getBoundingClientRect();z.attr("width",_.width);z.attr("height",_.height)}if(t.classData.annotations[0]){f+=_.height+r;d+=_.width}let C=t.classData.label;if(t.classData.type!==void 0&&t.classData.type!==""){if(oc(Mn())){C+="<"+t.classData.type+">"}else{C+="<"+t.classData.type+">"}}const A=await Kw(h,C,t.labelStyle,true,true);zr(A).attr("class","classTitle");let P=A.getBBox();if(oc(Mn())){const O=A.children[0];const z=zr(A);P=O.getBoundingClientRect();z.attr("width",P.width);z.attr("height",P.height)}f+=P.height+r;if(P.width>d){d=P.width}const L=[];t.classData.members.forEach(async O=>{const z=O.getDisplayDetails();let U=z.displayText;if(oc(Mn())){U=U.replace(//g,">")}const W=await Kw(h,U,z.cssStyle?z.cssStyle:t.labelStyle,true,true);let H=W.getBBox();if(oc(Mn())){const $=W.children[0];const K=zr(W);H=$.getBoundingClientRect();K.attr("width",H.width);K.attr("height",H.height)}if(H.width>d){d=H.width}f+=H.height+r;L.push(W)});f+=i;const I=[];t.classData.methods.forEach(async O=>{const z=O.getDisplayDetails();let U=z.displayText;if(oc(Mn())){U=U.replace(//g,">")}const W=await Kw(h,U,z.cssStyle?z.cssStyle:t.labelStyle,true,true);let H=W.getBBox();if(oc(Mn())){const $=W.children[0];const K=zr(W);H=$.getBoundingClientRect();K.attr("width",H.width);K.attr("height",H.height)}if(H.width>d){d=H.width}f+=H.height+r;I.push(W)});f+=i;if(g){let O=(d-_.width)/2;zr(w).attr("transform","translate( "+(-1*d/2+O)+", "+-1*f/2+")");m=_.height+r}let N=(d-P.width)/2;zr(A).attr("transform","translate( "+(-1*d/2+N)+", "+(-1*f/2+m)+")");m+=P.height+r;l.attr("class","divider").attr("x1",-d/2-n).attr("x2",d/2+n).attr("y1",-f/2-n+i+m).attr("y2",-f/2-n+i+m);m+=i;L.forEach(O=>{zr(O).attr("transform","translate( "+-d/2+", "+(-1*f/2+m+i/2)+")");const z=O?.getBBox();m+=(z?.height??0)+r});m+=i;u.attr("class","divider").attr("x1",-d/2-n).attr("x2",d/2+n).attr("y1",-f/2-n+i+m).attr("y2",-f/2-n+i+m);m+=i;I.forEach(O=>{zr(O).attr("transform","translate( "+-d/2+", "+(-1*f/2+m)+")");const z=O?.getBBox();m+=(z?.height??0)+r});s.attr("style",t.style).attr("class","outer title-state").attr("x",-d/2-n).attr("y",-(f/2)-n).attr("width",d+t.padding).attr("height",f+t.padding);Qf(t,s);t.intersect=function(O){return lf.rect(t,O)};return a},"class_box");BBn={rhombus:NBn,composite:lYi,question:NBn,rect:sYi,labelRect:cYi,rectWithTitle:uYi,choice:ZWi,circle:fYi,doublecircle:hYi,stadium:dYi,hexagon:JWi,block_arrow:QWi,rect_left_inv_arrow:eYi,lean_right:tYi,lean_left:nYi,trapezoid:rYi,inv_trapezoid:iYi,rect_right_inv_arrow:oYi,cylinder:aYi,start:mYi,end:gYi,note:KWi,subroutine:pYi,fork:OBn,join:OBn,class_box:yYi};oIe={};e6n=B(async(e,t,n)=>{let r;let i;if(t.link){let o;if(Mn().securityLevel==="sandbox"){o="_top"}else if(t.linkTarget){o=t.linkTarget||"_blank"}r=e.insert("svg:a").attr("xlink:href",t.link).attr("target",o);i=await BBn[t.shape](r,t,n)}else{i=await BBn[t.shape](e,t,n);r=i}if(t.tooltip){i.attr("title",t.tooltip)}if(t.class){i.attr("class","node default "+t.class)}oIe[t.id]=r;if(t.haveCallback){oIe[t.id].attr("class",oIe[t.id].attr("class")+" clickable")}return r},"insertNode");bYi=B(e=>{const t=oIe[e.id];wt.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const n=8;const r=e.diff||0;if(e.clusterNode){t.attr("transform","translate("+(e.x+r-e.width/2)+", "+(e.y-e.height/2-n)+")")}else{t.attr("transform","translate("+e.x+", "+e.y+")")}return r},"positionNode");B(rct,"getNodeFromBlock");B(t6n,"calculateBlockSize");B(n6n,"insertBlockPositioned");B(cIe,"performOperations");B(r6n,"calculateBlockSizes");B(i6n,"insertBlocks");B(o6n,"insertEdges");xYi=B(function(e,t){return t.db.getClasses()},"getClasses");vYi=B(async function(e,t,n,r){const{securityLevel:i,block:o}=Ji();const a=r.db;a.setDiagramId(t);let s;if(i==="sandbox"){s=zr("#i"+t)}const l=i==="sandbox"?zr(s.nodes()[0].contentDocument.body):zr("body");const u=i==="sandbox"?l.select(`[id="${t}"]`):zr(`[id="${t}"]`);const d=["point","circle","cross"];IWi(u,d,r.type,t);const f=a.getBlocks();const h=a.getBlocksFlat();const m=a.getEdges();const g=u.insert("g").attr("class","block");await r6n(g,f,a);const x=qBn(a);await i6n(g,f,a);await o6n(g,m,h,a,t);if(x){const w=x;const _=Math.max(1,Math.round(.125*(w.width/w.height)));const C=w.height+_+10;const A=w.width+10;const{useMaxWidth:P}=o;Vs(u,C,A,!!P);wt.debug("Here Bounds",x,w);u.attr("viewBox",`${w.x-5} ${w.y-5} ${w.width+10} ${w.height+10}`)}},"draw");_Yi={draw:vYi,getClasses:xYi};TYi={parser:ZHi,db:yWi,renderer:_Yi,styles:xWi}});var v6n={};Oo(v6n,{diagram:()=>WYi});function p6n(e){return e.some(t=>f6n.test(t))}function m6n(e){for(const t of e){const n=h6n.exec(t);if(n?.index&&n.index>0){return n.index}}return 4}function g6n(e,t){return e.replace(/\bline\s+(\d+)\b/gi,(n,r)=>{const i=parseInt(r,10);const o=t.get(i);return o?`line ${o}`:n})}function y6n(e){const t=e.split("\n");const n=new Map;let r=-1;for(const[l,u]of t.entries()){if(u.trim()==="treeView-beta"){r=l;break}}if(r===-1){return{text:e,lineMap:n}}const i=[];for(let l=r+1;l0){const i=e.substring(r).toLowerCase();const o=t?.extensionIcons;return o?.[i]??o?.[i.slice(1)]}return void 0}function oct(e,t){if(e.includes(":")){return e}if(e in Pre.icons||!t){return`${Pre.prefix}:${e}`}return`${t}:${e}`}function sct(e,t){if(e.icon==="none"){return void 0}if(e.icon){return oct(e.icon,t.defaultIconPack)}if(!t.showIcons){return void 0}if(e.nodeType==="file"){const n=b6n(e.name,t);if(n==="none"){return void 0}if(n){return oct(n,t.defaultIconPack)}}return`${Pre.prefix}:${e.nodeType==="directory"?"folder":"file"}`}var f6n,h6n,wYi,l6n,c6n,u6n,EYi,AS,CYi,SYi,AYi,kYi,RYi,PYi,IYi,ict,MYi,LYi,Pre,act,DYi,FYi,x6n,NYi,OYi,d6n,BYi,zYi,UYi,VYi,$Yi,GYi,HYi,WYi;var _6n=Ce(()=>{JSe();rb();gh();Jh();nl();Ta();Aa();Yo();zg();f6n=/[─━│┃└┗├┣]/;h6n=/[└┗├┣]/;wYi=/[─━]/;l6n=/^[\s│┃]+$/;c6n=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/;u6n=/^\s*%%/;EYi=" ";B(p6n,"isBoxDrawingFormat");B(m6n,"inferSegmentWidth");B(g6n,"remapErrorLines");B(y6n,"preprocessBoxDrawing");AS=new yG(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]}));CYi=B(()=>{AS.reset();Da()},"clear");SYi=B(()=>{return AS.records.stack[0]},"getRoot");AYi=B(()=>AS.records.cnt,"getCount");kYi=ka.treeView;RYi=B(()=>{return Cl(kYi,Ji().treeView)},"getConfig");PYi=B((e,t,n,r,i,o)=>{while(e<=AS.records.stack[AS.records.stack.length-1].level){AS.records.stack.pop()}const a={id:AS.records.cnt++,level:e,name:t,nodeType:n,icon:i,cssClass:r,description:o,children:[]};AS.records.stack[AS.records.stack.length-1].children.push(a);AS.records.stack.push(a)},"addNode");IYi={clear:CYi,addNode:PYi,getRoot:SYi,getCount:AYi,getConfig:RYi,getAccTitle:is,getAccDescription:as,getDiagramTitle:ss,setAccDescription:os,setAccTitle:Ka,setDiagramTitle:ys};ict=IYi;MYi=B(e=>{mu(e,ict);for(const t of e.nodes){const n=typeof t.indent==="number"?t.indent:0;let r=t.name;const i=r.endsWith("/");if(i){r=r.slice(0,-1)}const o=i?"directory":"file";const a=t.classAnnotation||void 0;const s=t.iconAnnotation;const l=s!==void 0?s||"none":void 0;const u=t.descAnnotation||void 0;const d=u?La(u,Ji()):void 0;ict.addNode(n,r,o,a,l,d)}},"populate");LYi={parse:B(async e=>{const{text:t,lineMap:n}=y6n(e);try{const r=await Pf("treeView",t);wt.debug(r);MYi(r)}catch(r){if(n.size>0&&r instanceof Error){r.message=g6n(r.message,n)}throw r}},"parse")};Pre={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:''},file:{body:''}}};B(b6n,"detectIcon");B(oct,"qualifyIcon");B(sct,"getNodeIcon");w$([{name:Pre.prefix,icons:Pre}]);act=14;DYi=4;FYi=16;x6n=B((e,t)=>`tv-icon-${e}-${t.replace(/[^\w-]/g,"-")}`,"iconSymbolId");NYi=B(async(e,t,n,r)=>{const i=new Set;const o=B(l=>{const u=sct(l,n);if(u){i.add(u)}l.children.forEach(o)},"collect");o(t);if(i.size===0){return}const a=await Promise.all([...i].map(async l=>({icon:l,svg:await nv(l,{height:act,width:act})})));const s=e.append("defs");for(const{icon:l,svg:u}of a){s.append("g").attr("id",x6n(r,l)).html(u)}},"injectIconDefs");OYi=B((e,t,n,r,i,o)=>{const a=r.append("g");let s="treeView-node-label";if(n.nodeType==="directory"){s+=" treeView-node-dir"}if(n.cssClass){s+=` ${n.cssClass}`}const l=act+DYi;const u=sct(n,i);const d=u!==void 0;if(u){a.append("use").attr("xlink:href",`#${x6n(o,u)}`).attr("x",e+i.paddingX).attr("y",t+i.paddingY).attr("class","treeView-node-icon")}const f=a.append("text").text(n.name).attr("dominant-baseline","middle").attr("class",s);const{height:h,width:m}=f.node().getBBox();const g=h+i.paddingY*2;const x=e+i.paddingX+(d?l:0);f.attr("x",x);f.attr("y",t+g/2);const w=x+m;const _=m+i.paddingX*2+(d?l:0);n.BBox={x:e,y:t,width:_,height:g};if(n.cssClass?.split(/\s+/).includes("highlight")){a.insert("rect",":first-child").attr("x",e).attr("y",t+1).attr("width",0).attr("height",g-2).attr("rx",3).attr("class","treeView-highlight-bg")}return{node:n,nodeGroup:a,labelRightEdge:w,centerY:t+g/2}},"positionLabel");d6n=B((e,t,n,r,i,o)=>{return e.append("line").attr("x1",t).attr("y1",n).attr("x2",r).attr("y2",i).attr("stroke-width",o).attr("class","treeView-node-line")},"positionLine");BYi=B((e,t,n,r)=>{let i=0;let o=0;const a=[];const s=B((d,f,h,m)=>{const g=m*(h.rowIndent+h.paddingX);const x=OYi(g,i,f,d,h,r);a.push(x);const{height:w,width:_}=f.BBox;d6n(d,g-h.rowIndent,i+w/2,g,i+w/2,h.lineThickness);o=Math.max(o,g+_);i+=w},"drawNode");const l=B((d,f=0)=>{s(e,d,n,f);d.children.forEach(x=>{l(x,f+1)});const{x:h,y:m,height:g}=d.BBox;if(d.children.length){const{y:x,height:w}=d.children[d.children.length-1].BBox;d6n(e,h+n.paddingX,m+g,h+n.paddingX,x+w/2+n.lineThickness/2,n.lineThickness)}},"processNode");l(t);const u=a.filter(d=>d.node.description);if(u.length>0){const d=Math.max(...a.map(h=>h.labelRightEdge));const f=d+FYi;for(const h of u){const m=h.nodeGroup.append("text").text(h.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",f).attr("y",h.centerY);const g=m.node().getBBox();o=Math.max(o,f+g.width+n.paddingX)}}for(const d of a){if(d.node.cssClass?.split(/\s+/).includes("highlight")){const f=d.nodeGroup.select(".treeView-highlight-bg");if(!f.empty()){const h=o-d.node.BBox.x+8;f.attr("width",h);o=Math.max(o,d.node.BBox.x+h+2)}}}return{totalHeight:i,totalWidth:o}},"drawTree");zYi=B(async(e,t,n,r)=>{wt.debug("Rendering treeView diagram\n"+e);const i=r.db;const o=i.getRoot();const a=i.getConfig();const s=Sc(t);await NYi(s,o,a,t);const l=s.append("g");l.attr("class","tree-view");const{totalHeight:u,totalWidth:d}=BYi(l,o,a,t);s.attr("viewBox",`-${a.lineThickness/2} 0 ${d} ${u}`);Vs(s,u,d,a.useMaxWidth)},"draw");UYi={draw:zYi};VYi=UYi;$Yi={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"};GYi=B(({treeView:e})=>{const{labelFontSize:t,labelColor:n,lineColor:r,iconColor:i,descriptionColor:o,highlightBg:a,highlightStroke:s}=Cl($Yi,e);return` + .treeView-node-label { + font-size: ${t}; + fill: ${n}; + white-space: pre; + } + .treeView-node-dir { + font-weight: bold; + } + .treeView-node-line { + stroke: ${r}; + } + .treeView-node-icon { + color: ${i}; + } + .treeView-node-description { + font-size: ${t}; + fill: ${o}; + font-style: italic; + white-space: pre; + } + .treeView-highlight-bg { + fill: ${a}; + stroke: ${s}; + stroke-width: 1; + } + `},"styles");HYi=GYi;WYi={db:ict,renderer:VYi,parser:LYi,styles:HYi}});var cct=_r((Ire,lct)=>{(function e(t,n){if(typeof Ire==="object"&&typeof lct==="object")lct.exports=n();else if(typeof define==="function"&&define.amd)define([],n);else if(typeof Ire==="object")Ire["layoutBase"]=n();else t["layoutBase"]=n()})(Ire,function(){return function(e){var t={};function n(r){if(t[r]){return t[r].exports}var i=t[r]={i:r,l:false,exports:{}};e[r].call(i.exports,i,i.exports,n);i.l=true;return i.exports}n.m=e;n.c=t;n.i=function(r){return r};n.d=function(r,i,o){if(!n.o(r,i)){Object.defineProperty(r,i,{configurable:false,enumerable:true,get:o})}};n.n=function(r){var i=r&&r.__esModule?function o(){return r["default"]}:function o(){return r};n.d(i,"a",i);return i};n.o=function(r,i){return Object.prototype.hasOwnProperty.call(r,i)};n.p="";return n(n.s=28)}([function(e,t,n){"use strict";function r(){}r.QUALITY=1;r.DEFAULT_CREATE_BENDS_AS_NEEDED=false;r.DEFAULT_INCREMENTAL=false;r.DEFAULT_ANIMATION_ON_LAYOUT=true;r.DEFAULT_ANIMATION_DURING_LAYOUT=false;r.DEFAULT_ANIMATION_PERIOD=50;r.DEFAULT_UNIFORM_LEAF_NODE_SIZES=false;r.DEFAULT_GRAPH_MARGIN=15;r.NODE_DIMENSIONS_INCLUDE_LABELS=false;r.SIMPLE_NODE_SIZE=40;r.SIMPLE_NODE_HALF_SIZE=r.SIMPLE_NODE_SIZE/2;r.EMPTY_COMPOUND_NODE_SIZE=40;r.MIN_EDGE_LENGTH=1;r.WORLD_BOUNDARY=1e6;r.INITIAL_WORLD_BOUNDARY=r.WORLD_BOUNDARY/1e3;r.WORLD_CENTER_X=1200;r.WORLD_CENTER_Y=900;e.exports=r},function(e,t,n){"use strict";var r=n(2);var i=n(8);var o=n(9);function a(l,u,d){r.call(this,d);this.isOverlapingSourceAndTarget=false;this.vGraphObject=d;this.bendpoints=[];this.source=l;this.target=u}a.prototype=Object.create(r.prototype);for(var s in r){a[s]=r[s]}a.prototype.getSource=function(){return this.source};a.prototype.getTarget=function(){return this.target};a.prototype.isInterGraph=function(){return this.isInterGraph};a.prototype.getLength=function(){return this.length};a.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget};a.prototype.getBendpoints=function(){return this.bendpoints};a.prototype.getLca=function(){return this.lca};a.prototype.getSourceInLca=function(){return this.sourceInLca};a.prototype.getTargetInLca=function(){return this.targetInLca};a.prototype.getOtherEnd=function(l){if(this.source===l){return this.target}else if(this.target===l){return this.source}else{throw"Node is not incident with this edge"}};a.prototype.getOtherEndInGraph=function(l,u){var d=this.getOtherEnd(l);var f=u.getGraphManager().getRoot();while(true){if(d.getOwner()==u){return d}if(d.getOwner()==f){break}d=d.getOwner().getParent()}return null};a.prototype.updateLength=function(){var l=new Array(4);this.isOverlapingSourceAndTarget=i.getIntersection(this.target.getRect(),this.source.getRect(),l);if(!this.isOverlapingSourceAndTarget){this.lengthX=l[0]-l[2];this.lengthY=l[1]-l[3];if(Math.abs(this.lengthX)<1){this.lengthX=o.sign(this.lengthX)}if(Math.abs(this.lengthY)<1){this.lengthY=o.sign(this.lengthY)}this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)}};a.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX();this.lengthY=this.target.getCenterY()-this.source.getCenterY();if(Math.abs(this.lengthX)<1){this.lengthX=o.sign(this.lengthX)}if(Math.abs(this.lengthY)<1){this.lengthY=o.sign(this.lengthY)}this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)};e.exports=a},function(e,t,n){"use strict";function r(i){this.vGraphObject=i}e.exports=r},function(e,t,n){"use strict";var r=n(2);var i=n(10);var o=n(13);var a=n(0);var s=n(16);var l=n(5);function u(f,h,m,g){if(m==null&&g==null){g=h}r.call(this,g);if(f.graphManager!=null)f=f.graphManager;this.estimatedSize=i.MIN_VALUE;this.inclusionTreeDepth=i.MAX_VALUE;this.vGraphObject=g;this.edges=[];this.graphManager=f;if(m!=null&&h!=null)this.rect=new o(h.x,h.y,m.width,m.height);else this.rect=new o}u.prototype=Object.create(r.prototype);for(var d in r){u[d]=r[d]}u.prototype.getEdges=function(){return this.edges};u.prototype.getChild=function(){return this.child};u.prototype.getOwner=function(){return this.owner};u.prototype.getWidth=function(){return this.rect.width};u.prototype.setWidth=function(f){this.rect.width=f};u.prototype.getHeight=function(){return this.rect.height};u.prototype.setHeight=function(f){this.rect.height=f};u.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2};u.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2};u.prototype.getCenter=function(){return new l(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)};u.prototype.getLocation=function(){return new l(this.rect.x,this.rect.y)};u.prototype.getRect=function(){return this.rect};u.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)};u.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2};u.prototype.setRect=function(f,h){this.rect.x=f.x;this.rect.y=f.y;this.rect.width=h.width;this.rect.height=h.height};u.prototype.setCenter=function(f,h){this.rect.x=f-this.rect.width/2;this.rect.y=h-this.rect.height/2};u.prototype.setLocation=function(f,h){this.rect.x=f;this.rect.y=h};u.prototype.moveBy=function(f,h){this.rect.x+=f;this.rect.y+=h};u.prototype.getEdgeListToNode=function(f){var h=[];var m;var g=this;g.edges.forEach(function(x){if(x.target==f){if(x.source!=g)throw"Incorrect edge source!";h.push(x)}});return h};u.prototype.getEdgesBetween=function(f){var h=[];var m;var g=this;g.edges.forEach(function(x){if(!(x.source==g||x.target==g))throw"Incorrect edge source and/or target";if(x.target==f||x.source==f){h.push(x)}});return h};u.prototype.getNeighborsList=function(){var f=new Set;var h=this;h.edges.forEach(function(m){if(m.source==h){f.add(m.target)}else{if(m.target!=h){throw"Incorrect incidency!"}f.add(m.source)}});return f};u.prototype.withChildren=function(){var f=new Set;var h;var m;f.add(this);if(this.child!=null){var g=this.child.getNodes();for(var x=0;xh){this.rect.x-=(this.labelWidth-h)/2;this.setWidth(this.labelWidth)}else if(this.labelPosHorizontal=="right"){this.setWidth(h+this.labelWidth)}}if(this.labelHeight){if(this.labelPosVertical=="top"){this.rect.y-=this.labelHeight;this.setHeight(m+this.labelHeight)}else if(this.labelPosVertical=="center"&&this.labelHeight>m){this.rect.y-=(this.labelHeight-m)/2;this.setHeight(this.labelHeight)}else if(this.labelPosVertical=="bottom"){this.setHeight(m+this.labelHeight)}}}}};u.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE){throw"assert failed"}return this.inclusionTreeDepth};u.prototype.transform=function(f){var h=this.rect.x;if(h>a.WORLD_BOUNDARY){h=a.WORLD_BOUNDARY}else if(h<-a.WORLD_BOUNDARY){h=-a.WORLD_BOUNDARY}var m=this.rect.y;if(m>a.WORLD_BOUNDARY){m=a.WORLD_BOUNDARY}else if(m<-a.WORLD_BOUNDARY){m=-a.WORLD_BOUNDARY}var g=new l(h,m);var x=f.inverseTransformPoint(g);this.setLocation(x.x,x.y)};u.prototype.getLeft=function(){return this.rect.x};u.prototype.getRight=function(){return this.rect.x+this.rect.width};u.prototype.getTop=function(){return this.rect.y};u.prototype.getBottom=function(){return this.rect.y+this.rect.height};u.prototype.getParent=function(){if(this.owner==null){return null}return this.owner.getParent()};e.exports=u},function(e,t,n){"use strict";var r=n(0);function i(){}for(var o in r){i[o]=r[o]}i.MAX_ITERATIONS=2500;i.DEFAULT_EDGE_LENGTH=50;i.DEFAULT_SPRING_STRENGTH=.45;i.DEFAULT_REPULSION_STRENGTH=4500;i.DEFAULT_GRAVITY_STRENGTH=.4;i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1;i.DEFAULT_GRAVITY_RANGE_FACTOR=3.8;i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5;i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=true;i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=true;i.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3;i.COOLING_ADAPTATION_FACTOR=.33;i.ADAPTATION_LOWER_NODE_LIMIT=1e3;i.ADAPTATION_UPPER_NODE_LIMIT=5e3;i.MAX_NODE_DISPLACEMENT_INCREMENTAL=100;i.MAX_NODE_DISPLACEMENT=i.MAX_NODE_DISPLACEMENT_INCREMENTAL*3;i.MIN_REPULSION_DIST=i.DEFAULT_EDGE_LENGTH/10;i.CONVERGENCE_CHECK_PERIOD=100;i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1;i.MIN_EDGE_LENGTH=1;i.GRID_CALCULATION_CHECK_PERIOD=10;e.exports=i},function(e,t,n){"use strict";function r(i,o){if(i==null&&o==null){this.x=0;this.y=0}else{this.x=i;this.y=o}}r.prototype.getX=function(){return this.x};r.prototype.getY=function(){return this.y};r.prototype.setX=function(i){this.x=i};r.prototype.setY=function(i){this.y=i};r.prototype.getDifference=function(i){return new DimensionD(this.x-i.x,this.y-i.y)};r.prototype.getCopy=function(){return new r(this.x,this.y)};r.prototype.translate=function(i){this.x+=i.width;this.y+=i.height;return this};e.exports=r},function(e,t,n){"use strict";var r=n(2);var i=n(10);var o=n(0);var a=n(7);var s=n(3);var l=n(1);var u=n(13);var d=n(12);var f=n(11);function h(g,x,w){r.call(this,w);this.estimatedSize=i.MIN_VALUE;this.margin=o.DEFAULT_GRAPH_MARGIN;this.edges=[];this.nodes=[];this.isConnected=false;this.parent=g;if(x!=null&&x instanceof a){this.graphManager=x}else if(x!=null&&x instanceof Layout){this.graphManager=x.graphManager}}h.prototype=Object.create(r.prototype);for(var m in r){h[m]=r[m]}h.prototype.getNodes=function(){return this.nodes};h.prototype.getEdges=function(){return this.edges};h.prototype.getGraphManager=function(){return this.graphManager};h.prototype.getParent=function(){return this.parent};h.prototype.getLeft=function(){return this.left};h.prototype.getRight=function(){return this.right};h.prototype.getTop=function(){return this.top};h.prototype.getBottom=function(){return this.bottom};h.prototype.isConnected=function(){return this.isConnected};h.prototype.add=function(g,x,w){if(x==null&&w==null){var _=g;if(this.graphManager==null){throw"Graph has no graph mgr!"}if(this.getNodes().indexOf(_)>-1){throw"Node already in graph!"}_.owner=this;this.getNodes().push(_);return _}else{var C=g;if(!(this.getNodes().indexOf(x)>-1&&this.getNodes().indexOf(w)>-1)){throw"Source or target not in graph!"}if(!(x.owner==w.owner&&x.owner==this)){throw"Both owners must be this graph!"}if(x.owner!=w.owner){return null}C.source=x;C.target=w;C.isInterGraph=false;this.getEdges().push(C);x.edges.push(C);if(w!=x){w.edges.push(C)}return C}};h.prototype.remove=function(g){var x=g;if(g instanceof s){if(x==null){throw"Node is null!"}if(!(x.owner!=null&&x.owner==this)){throw"Owner graph is invalid!"}if(this.graphManager==null){throw"Owner graph manager is invalid!"}var w=x.edges.slice();var _;var C=w.length;for(var A=0;A-1&&I>-1)){throw"Source and/or target doesn't know this edge!"}_.source.edges.splice(L,1);if(_.target!=_.source){_.target.edges.splice(I,1)}var P=_.source.owner.getEdges().indexOf(_);if(P==-1){throw"Not in owner's edge list!"}_.source.owner.getEdges().splice(P,1)}};h.prototype.updateLeftTop=function(){var g=i.MAX_VALUE;var x=i.MAX_VALUE;var w;var _;var C;var A=this.getNodes();var P=A.length;for(var L=0;Lw){g=w}if(x>_){x=_}}if(g==i.MAX_VALUE){return null}if(A[0].getParent().paddingLeft!=void 0){C=A[0].getParent().paddingLeft}else{C=this.margin}this.left=x-C;this.top=g-C;return new d(this.left,this.top)};h.prototype.updateBounds=function(g){var x=i.MAX_VALUE;var w=-i.MAX_VALUE;var _=i.MAX_VALUE;var C=-i.MAX_VALUE;var A;var P;var L;var I;var N;var O=this.nodes;var z=O.length;for(var U=0;UA){x=A}if(wL){_=L}if(CA){x=A}if(wL){_=L}if(C=this.nodes.length){var z=0;w.forEach(function(U){if(U.owner==g){z++}});if(z==this.nodes.length){this.isConnected=true}}};e.exports=h},function(e,t,n){"use strict";var r;var i=n(1);function o(a){r=n(6);this.layout=a;this.graphs=[];this.edges=[]}o.prototype.addRoot=function(){var a=this.layout.newGraph();var s=this.layout.newNode(null);var l=this.add(a,s);this.setRootGraph(l);return this.rootGraph};o.prototype.add=function(a,s,l,u,d){if(l==null&&u==null&&d==null){if(a==null){throw"Graph is null!"}if(s==null){throw"Parent node is null!"}if(this.graphs.indexOf(a)>-1){throw"Graph already in this graph mgr!"}this.graphs.push(a);if(a.parent!=null){throw"Already has a parent!"}if(s.child!=null){throw"Already has a child!"}a.parent=s;s.child=a;return a}else{d=l;u=s;l=a;var f=u.getOwner();var h=d.getOwner();if(!(f!=null&&f.getGraphManager()==this)){throw"Source not in this graph mgr!"}if(!(h!=null&&h.getGraphManager()==this)){throw"Target not in this graph mgr!"}if(f==h){l.isInterGraph=false;return f.add(l,u,d)}else{l.isInterGraph=true;l.source=u;l.target=d;if(this.edges.indexOf(l)>-1){throw"Edge already in inter-graph edge list!"}this.edges.push(l);if(!(l.source!=null&&l.target!=null)){throw"Edge source and/or target is null!"}if(!(l.source.edges.indexOf(l)==-1&&l.target.edges.indexOf(l)==-1)){throw"Edge already in source and/or target incidency list!"}l.source.edges.push(l);l.target.edges.push(l);return l}}};o.prototype.remove=function(a){if(a instanceof r){var s=a;if(s.getGraphManager()!=this){throw"Graph not in this graph mgr"}if(!(s==this.rootGraph||s.parent!=null&&s.parent.graphManager==this)){throw"Invalid parent node!"}var l=[];l=l.concat(s.getEdges());var u;var d=l.length;for(var f=0;f=a.getRight()){s[0]+=Math.min(a.getX()-o.getX(),o.getRight()-a.getRight())}else if(a.getX()<=o.getX()&&a.getRight()>=o.getRight()){s[0]+=Math.min(o.getX()-a.getX(),a.getRight()-o.getRight())}if(o.getY()<=a.getY()&&o.getBottom()>=a.getBottom()){s[1]+=Math.min(a.getY()-o.getY(),o.getBottom()-a.getBottom())}else if(a.getY()<=o.getY()&&a.getBottom()>=o.getBottom()){s[1]+=Math.min(o.getY()-a.getY(),a.getBottom()-o.getBottom())}var d=Math.abs((a.getCenterY()-o.getCenterY())/(a.getCenterX()-o.getCenterX()));if(a.getCenterY()===o.getCenterY()&&a.getCenterX()===o.getCenterX()){d=1}var f=d*s[0];var h=s[1]/d;if(s[0]f){s[0]=l;s[1]=m;s[2]=d;s[3]=O;return false}else if(ud){s[0]=h;s[1]=u;s[2]=I;s[3]=f;return false}else if(ld){s[0]=x;s[1]=w;H=true}else{s[0]=g;s[1]=m;H=true}}else if(K===j){if(l>d){s[0]=h;s[1]=m;H=true}else{s[0]=_;s[1]=w;H=true}}if(-X===j){if(d>l){s[2]=N;s[3]=O;$=true}else{s[2]=I;s[3]=L;$=true}}else if(X===j){if(d>l){s[2]=P;s[3]=L;$=true}else{s[2]=z;s[3]=O;$=true}}if(H&&$){return false}if(l>d){if(u>f){te=this.getCardinalDirection(K,j,4);J=this.getCardinalDirection(X,j,2)}else{te=this.getCardinalDirection(-K,j,3);J=this.getCardinalDirection(-X,j,1)}}else{if(u>f){te=this.getCardinalDirection(-K,j,1);J=this.getCardinalDirection(-X,j,3)}else{te=this.getCardinalDirection(K,j,2);J=this.getCardinalDirection(X,j,4)}}if(!H){switch(te){case 1:se=m;oe=l+-A/j;s[0]=oe;s[1]=se;break;case 2:oe=_;se=u+C*j;s[0]=oe;s[1]=se;break;case 3:se=w;oe=l+A/j;s[0]=oe;s[1]=se;break;case 4:oe=x;se=u+-C*j;s[0]=oe;s[1]=se;break}}if(!$){switch(J){case 1:ce=L;re=d+-W/j;s[2]=re;s[3]=ce;break;case 2:re=z;ce=f+U*j;s[2]=re;s[3]=ce;break;case 3:ce=O;re=d+W/j;s[2]=re;s[3]=ce;break;case 4:re=N;ce=f+-U*j;s[2]=re;s[3]=ce;break}}}return false};i.getCardinalDirection=function(o,a,s){if(o>a){return s}else{return 1+s%4}};i.getIntersection=function(o,a,s,l){if(l==null){return this.getIntersection2(o,a,s)}var u=o.x;var d=o.y;var f=a.x;var h=a.y;var m=s.x;var g=s.y;var x=l.x;var w=l.y;var _=void 0,C=void 0;var A=void 0,P=void 0,L=void 0,I=void 0,N=void 0,O=void 0;var z=void 0;A=h-d;L=u-f;N=f*d-u*h;P=w-g;I=m-x;O=x*g-m*w;z=A*I-P*L;if(z===0){return null}_=(L*O-I*N)/z;C=(P*N-A*O)/z;return new r(_,C)};i.angleOfVector=function(o,a,s,l){var u=void 0;if(o!==s){u=Math.atan((l-a)/(s-o));if(s=0){var w=(-m+Math.sqrt(m*m-4*h*g))/(2*h);var _=(-m-Math.sqrt(m*m-4*h*g))/(2*h);var C=null;if(w>=0&&w<=1){return[w]}if(_>=0&&_<=1){return[_]}return C}else return null};i.HALF_PI=.5*Math.PI;i.ONE_AND_HALF_PI=1.5*Math.PI;i.TWO_PI=2*Math.PI;i.THREE_PI=3*Math.PI;e.exports=i},function(e,t,n){"use strict";function r(){}r.sign=function(i){if(i>0){return 1}else if(i<0){return-1}else{return 0}};r.floor=function(i){return i<0?Math.ceil(i):Math.floor(i)};r.ceil=function(i){return i<0?Math.floor(i):Math.ceil(i)};e.exports=r},function(e,t,n){"use strict";function r(){}r.MAX_VALUE=2147483647;r.MIN_VALUE=-2147483648;e.exports=r},function(e,t,n){"use strict";var r=function(){function u(d,f){for(var h=0;h0&&g){A.push(L[0]);while(A.length>0&&g){var I=A[0];A.splice(0,1);C.add(I);var N=I.getEdges();for(var _=0;_-1){L.splice(W,1)}}C=new Set;P=new Map}}return m};h.prototype.createDummyNodesForBendpoints=function(m){var g=[];var x=m.source;var w=this.graphManager.calcLowestCommonAncestor(m.source,m.target);for(var _=0;_0){var w=this.edgeToDummyNodes.get(x);for(var _=0;_=0){g.splice(O,1)}var z=P.getNeighborsList();z.forEach(function(H){if(x.indexOf(H)<0){var $=w.get(H);var K=$-1;if(K==1){I.push(H)}w.set(H,K)}})}x=x.concat(I);if(g.length==1||g.length==2){_=true;C=g[0]}}return C};h.prototype.setGraphManager=function(m){this.graphManager=m};e.exports=h},function(e,t,n){"use strict";function r(){}r.seed=1;r.x=0;r.nextDouble=function(){r.x=Math.sin(r.seed++)*1e4;return r.x-Math.floor(r.x)};e.exports=r},function(e,t,n){"use strict";var r=n(5);function i(o,a){this.lworldOrgX=0;this.lworldOrgY=0;this.ldeviceOrgX=0;this.ldeviceOrgY=0;this.lworldExtX=1;this.lworldExtY=1;this.ldeviceExtX=1;this.ldeviceExtY=1}i.prototype.getWorldOrgX=function(){return this.lworldOrgX};i.prototype.setWorldOrgX=function(o){this.lworldOrgX=o};i.prototype.getWorldOrgY=function(){return this.lworldOrgY};i.prototype.setWorldOrgY=function(o){this.lworldOrgY=o};i.prototype.getWorldExtX=function(){return this.lworldExtX};i.prototype.setWorldExtX=function(o){this.lworldExtX=o};i.prototype.getWorldExtY=function(){return this.lworldExtY};i.prototype.setWorldExtY=function(o){this.lworldExtY=o};i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX};i.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o};i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY};i.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o};i.prototype.getDeviceExtX=function(){return this.ldeviceExtX};i.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o};i.prototype.getDeviceExtY=function(){return this.ldeviceExtY};i.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o};i.prototype.transformX=function(o){var a=0;var s=this.lworldExtX;if(s!=0){a=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/s}return a};i.prototype.transformY=function(o){var a=0;var s=this.lworldExtY;if(s!=0){a=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/s}return a};i.prototype.inverseTransformX=function(o){var a=0;var s=this.ldeviceExtX;if(s!=0){a=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/s}return a};i.prototype.inverseTransformY=function(o){var a=0;var s=this.ldeviceExtY;if(s!=0){a=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/s}return a};i.prototype.inverseTransformPoint=function(o){var a=new r(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return a};e.exports=i},function(e,t,n){"use strict";function r(f){if(Array.isArray(f)){for(var h=0,m=Array(f.length);ho.ADAPTATION_LOWER_NODE_LIMIT){this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(f-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))}this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL}else{if(f>o.ADAPTATION_LOWER_NODE_LIMIT){this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(f-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR))}else{this.coolingFactor=1}this.initialCoolingFactor=this.coolingFactor;this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT}this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations);this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100;this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length;this.repulsionRange=this.calcRepulsionRange()};u.prototype.calcSpringForces=function(){var f=this.getAllEdges();var h;for(var m=0;m0&&arguments[0]!==void 0?arguments[0]:true;var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:false;var m,g;var x,w;var _=this.getAllNodes();var C;if(this.useFRGridVariant){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&f){this.updateGrid()}C=new Set;for(m=0;m<_.length;m++){x=_[m];this.calculateRepulsionForceOfANode(x,C,f,h);C.add(x)}}else{for(m=0;m<_.length;m++){x=_[m];for(g=m+1;g<_.length;g++){w=_[g];if(x.getOwner()!=w.getOwner()){continue}this.calcRepulsionForce(x,w)}}}};u.prototype.calcGravitationalForces=function(){var f;var h=this.getAllNodesToApplyGravitation();for(var m=0;mA||C>A){f.gravitationForceX=-this.gravityConstant*x;f.gravitationForceY=-this.gravityConstant*w}}else{A=h.getEstimatedSize()*this.compoundGravityRangeFactor;if(_>A||C>A){f.gravitationForceX=-this.gravityConstant*x*this.compoundGravityConstant;f.gravitationForceY=-this.gravityConstant*w*this.compoundGravityConstant}}};u.prototype.isConverged=function(){var f;var h=false;if(this.totalIterations>this.maxIterations/3){h=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2}f=this.totalDisplacement=_.length||A>=_[0].length)){for(var P=0;P<_[C][A].length;P++){w=_[C][A][P];if(f.getOwner()!=w.getOwner()||f==w){continue}if(!h.has(w)&&!x.has(w)){var L=Math.abs(f.getCenterX()-w.getCenterX())-(f.getWidth()/2+w.getWidth()/2);var I=Math.abs(f.getCenterY()-w.getCenterY())-(f.getHeight()/2+w.getHeight()/2);if(L<=this.repulsionRange&&I<=this.repulsionRange){x.add(w)}}}}}}f.surrounding=[].concat(r(x))}for(C=0;Cu}}]);return s}();e.exports=a},function(e,t,n){"use strict";function r(){};r.svd=function(i){this.U=null;this.V=null;this.s=null;this.m=0;this.n=0;this.m=i.length;this.n=i[0].length;var o=Math.min(this.m,this.n);this.s=function(vr){var Yr=[];while(vr-- >0){Yr.push(0)}return Yr}(Math.min(this.m+1,this.n));this.U=function(vr){var Yr=function nt(Rr){if(Rr.length==0){return 0}else{var Xr=[];for(var dr=0;dr0){Yr.push(0)}return Yr}(this.n);var s=function(vr){var Yr=[];while(vr-- >0){Yr.push(0)}return Yr}(this.m);var l=true;var u=true;var d=Math.min(this.m-1,this.n);var f=Math.max(0,Math.min(this.n-2,this.m));for(var h=0;h=0;j--){if(this.s[j]!==0){for(var te=j+1;te=0;xe--){if(function(vr,Yr){return vr&&Yr}(xe0){var tt=void 0;var yt=void 0;for(tt=$-2;tt>=-1;tt--){if(tt===-1){break}if(Math.abs(a[tt])<=Ee+$e*(Math.abs(this.s[tt])+Math.abs(this.s[tt+1]))){a[tt]=0;break}};if(tt===$-2){yt=4}else{var mt=void 0;for(mt=$-1;mt>=tt;mt--){if(mt===tt){break}var ct=(mt!==$?Math.abs(a[mt]):0)+(mt!==tt+1?Math.abs(a[mt-1]):0);if(Math.abs(this.s[mt])<=Ee+$e*ct){this.s[mt]=0;break}};if(mt===tt){yt=3}else if(mt===$-1){yt=1}else{yt=2;tt=mt}}tt++;switch(yt){case 1:{var Ge=a[$-2];a[$-2]=0;for(var it=$-2;it>=tt;it--){var bt=r.hypot(this.s[it],Ge);var He=this.s[it]/bt;var Je=Ge/bt;this.s[it]=bt;if(it!==tt){Ge=-Je*a[it-1];a[it-1]=He*a[it-1]}if(u){for(var Te=0;Te=this.s[tt+1]){break}var cr=this.s[tt];this.s[tt]=this.s[tt+1];this.s[tt+1]=cr;if(u&&ttMath.abs(o)){a=o/i;a=Math.abs(i)*Math.sqrt(1+a*a)}else if(o!=0){a=i/o;a=Math.abs(o)*Math.sqrt(1+a*a)}else{a=0}return a};e.exports=r},function(e,t,n){"use strict";var r=function(){function a(s,l){for(var u=0;u2&&arguments[2]!==void 0?arguments[2]:1;var d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1;var f=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;i(this,a);this.sequence1=s;this.sequence2=l;this.match_score=u;this.mismatch_penalty=d;this.gap_penalty=f;this.iMax=s.length+1;this.jMax=l.length+1;this.grid=new Array(this.iMax);for(var h=0;h=0;s--){var l=this.listeners[s];if(l.event===o&&l.callback===a){this.listeners.splice(s,1)}}};i.emit=function(o,a){for(var s=0;s{(function e(t,n){if(typeof Mre==="object"&&typeof uct==="object")uct.exports=n(cct());else if(typeof define==="function"&&define.amd)define(["layout-base"],n);else if(typeof Mre==="object")Mre["coseBase"]=n(cct());else t["coseBase"]=n(t["layoutBase"])})(Mre,function(e){return(()=>{"use strict";var t={45:(o,a,s)=>{var l={};l.layoutBase=s(551);l.CoSEConstants=s(806);l.CoSEEdge=s(767);l.CoSEGraph=s(880);l.CoSEGraphManager=s(578);l.CoSELayout=s(765);l.CoSENode=s(991);l.ConstraintHandler=s(902);o.exports=l},806:(o,a,s)=>{var l=s(551).FDLayoutConstants;function u(){}for(var d in l){u[d]=l[d]}u.DEFAULT_USE_MULTI_LEVEL_SCALING=false;u.DEFAULT_RADIAL_SEPARATION=l.DEFAULT_EDGE_LENGTH;u.DEFAULT_COMPONENT_SEPERATION=60;u.TILE=true;u.TILING_PADDING_VERTICAL=10;u.TILING_PADDING_HORIZONTAL=10;u.TRANSFORM_ON_CONSTRAINT_HANDLING=true;u.ENFORCE_CONSTRAINTS=true;u.APPLY_LAYOUT=true;u.RELAX_MOVEMENT_ON_CONSTRAINTS=true;u.TREE_REDUCTION_ON_INCREMENTAL=true;u.PURE_INCREMENTAL=u.DEFAULT_INCREMENTAL;o.exports=u},767:(o,a,s)=>{var l=s(551).FDLayoutEdge;function u(f,h,m){l.call(this,f,h,m)}u.prototype=Object.create(l.prototype);for(var d in l){u[d]=l[d]}o.exports=u},880:(o,a,s)=>{var l=s(551).LGraph;function u(f,h,m){l.call(this,f,h,m)}u.prototype=Object.create(l.prototype);for(var d in l){u[d]=l[d]}o.exports=u},578:(o,a,s)=>{var l=s(551).LGraphManager;function u(f){l.call(this,f)}u.prototype=Object.create(l.prototype);for(var d in l){u[d]=l[d]}o.exports=u},765:(o,a,s)=>{var l=s(551).FDLayout;var u=s(578);var d=s(880);var f=s(991);var h=s(767);var m=s(806);var g=s(902);var x=s(551).FDLayoutConstants;var w=s(551).LayoutConstants;var _=s(551).Point;var C=s(551).PointD;var A=s(551).DimensionD;var P=s(551).Layout;var L=s(551).Integer;var I=s(551).IGeometry;var N=s(551).LGraph;var O=s(551).Transform;var z=s(551).LinkedList;function U(){l.call(this);this.toBeTiled={};this.constraints={}}U.prototype=Object.create(l.prototype);for(var W in l){U[W]=l[W]}U.prototype.newGraphManager=function(){var H=new u(this);this.graphManager=H;return H};U.prototype.newGraph=function(H){return new d(null,this.graphManager,H)};U.prototype.newNode=function(H){return new f(this.graphManager,H)};U.prototype.newEdge=function(H){return new h(null,null,H)};U.prototype.initParameters=function(){l.prototype.initParameters.call(this,arguments);if(!this.isSubLayout){if(m.DEFAULT_EDGE_LENGTH<10){this.idealEdgeLength=10}else{this.idealEdgeLength=m.DEFAULT_EDGE_LENGTH}this.useSmartIdealEdgeLengthCalculation=m.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION;this.gravityConstant=x.DEFAULT_GRAVITY_STRENGTH;this.compoundGravityConstant=x.DEFAULT_COMPOUND_GRAVITY_STRENGTH;this.gravityRangeFactor=x.DEFAULT_GRAVITY_RANGE_FACTOR;this.compoundGravityRangeFactor=x.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR;this.prunedNodesAll=[];this.growTreeIterations=0;this.afterGrowthIterations=0;this.isTreeGrowing=false;this.isGrowthFinished=false}};U.prototype.initSpringEmbedder=function(){l.prototype.initSpringEmbedder.call(this);this.coolingCycle=0;this.maxCoolingCycle=this.maxIterations/x.CONVERGENCE_CHECK_PERIOD;this.finalTemperature=.04;this.coolingAdjuster=1};U.prototype.layout=function(){var H=w.DEFAULT_CREATE_BENDS_AS_NEEDED;if(H){this.createBendpoints();this.graphManager.resetAllEdges()}this.level=0;return this.classicLayout()};U.prototype.classicLayout=function(){this.nodesWithGravity=this.calculateNodesToApplyGravitationTo();this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity);this.calcNoOfChildrenForAllNodes();this.graphManager.calcLowestCommonAncestors();this.graphManager.calcInclusionTreeDepths();this.graphManager.getRoot().calcEstimatedSize();this.calcIdealEdgeLengths();if(!this.incremental){var H=this.getFlatForest();if(H.length>0){this.positionNodesRadially(H)}else{this.reduceTrees();this.graphManager.resetAllNodesToApplyGravitation();var $=new Set(this.getAllNodes());var K=this.nodesWithGravity.filter(function(X){return $.has(X)});this.graphManager.setAllNodesToApplyGravitation(K);this.positionNodesRandomly()}}else{if(m.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees();this.graphManager.resetAllNodesToApplyGravitation();var $=new Set(this.getAllNodes());var K=this.nodesWithGravity.filter(function(te){return $.has(te)});this.graphManager.setAllNodesToApplyGravitation(K)}}if(Object.keys(this.constraints).length>0){g.handleConstraints(this);this.initConstraintVariables()}this.initSpringEmbedder();if(m.APPLY_LAYOUT){this.runSpringEmbedder()}return true};U.prototype.tick=function(){this.totalIterations++;if(this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.prunedNodesAll.length>0){this.isTreeGrowing=true}else{return true}}if(this.totalIterations%x.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(this.prunedNodesAll.length>0){this.isTreeGrowing=true}else{return true}}this.coolingCycle++;if(this.layoutQuality==0){this.coolingAdjuster=this.coolingCycle}else if(this.layoutQuality==1){this.coolingAdjuster=this.coolingCycle/3}this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature);this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0){if(this.prunedNodesAll.length>0){this.graphManager.updateBounds();this.updateGrid();this.growTree(this.prunedNodesAll);this.graphManager.resetAllNodesToApplyGravitation();var H=new Set(this.getAllNodes());var $=this.nodesWithGravity.filter(function(j){return H.has(j)});this.graphManager.setAllNodesToApplyGravitation($);this.graphManager.updateBounds();this.updateGrid();if(m.PURE_INCREMENTAL)this.coolingFactor=x.DEFAULT_COOLING_FACTOR_INCREMENTAL/2;else this.coolingFactor=x.DEFAULT_COOLING_FACTOR_INCREMENTAL}else{this.isTreeGrowing=false;this.isGrowthFinished=true}}this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged()){return true}if(this.afterGrowthIterations%10==0){this.graphManager.updateBounds();this.updateGrid()}if(m.PURE_INCREMENTAL)this.coolingFactor=x.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100);else this.coolingFactor=x.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100);this.afterGrowthIterations++}var K=!this.isTreeGrowing&&!this.isGrowthFinished;var X=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;this.totalDisplacement=0;this.graphManager.updateBounds();this.calcSpringForces();this.calcRepulsionForces(K,X);this.calcGravitationalForces();this.moveNodes();this.animate();return false};U.prototype.getPositionsData=function(){var H=this.graphManager.getAllNodes();var $={};for(var K=0;K0){this.updateDisplacements()}for(var K=0;K0){X.fixedNodeWeight=te}}}}if(this.constraints.relativePlacementConstraint){var J=new Map;var oe=new Map;this.dummyToNodeForVerticalAlignment=new Map;this.dummyToNodeForHorizontalAlignment=new Map;this.fixedNodesOnHorizontal=new Set;this.fixedNodesOnVertical=new Set;this.fixedNodeSet.forEach(function(he){H.fixedNodesOnHorizontal.add(he);H.fixedNodesOnVertical.add(he)});if(this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var se=this.constraints.alignmentConstraint.vertical;for(var K=0;K=2*he.length/3;Ve--){ve=Math.floor(Math.random()*(Ve+1));ge=he[Ve];he[Ve]=he[ve];he[ve]=ge}return he};this.nodesInRelativeHorizontal=[];this.nodesInRelativeVertical=[];this.nodeToRelativeConstraintMapHorizontal=new Map;this.nodeToRelativeConstraintMapVertical=new Map;this.nodeToTempPositionMapHorizontal=new Map;this.nodeToTempPositionMapVertical=new Map;this.constraints.relativePlacementConstraint.forEach(function(he){if(he.left){var ve=J.has(he.left)?J.get(he.left):he.left;var ge=J.has(he.right)?J.get(he.right):he.right;if(!H.nodesInRelativeHorizontal.includes(ve)){H.nodesInRelativeHorizontal.push(ve);H.nodeToRelativeConstraintMapHorizontal.set(ve,[]);if(H.dummyToNodeForVerticalAlignment.has(ve)){H.nodeToTempPositionMapHorizontal.set(ve,H.idToNodeMap.get(H.dummyToNodeForVerticalAlignment.get(ve)[0]).getCenterX())}else{H.nodeToTempPositionMapHorizontal.set(ve,H.idToNodeMap.get(ve).getCenterX())}}if(!H.nodesInRelativeHorizontal.includes(ge)){H.nodesInRelativeHorizontal.push(ge);H.nodeToRelativeConstraintMapHorizontal.set(ge,[]);if(H.dummyToNodeForVerticalAlignment.has(ge)){H.nodeToTempPositionMapHorizontal.set(ge,H.idToNodeMap.get(H.dummyToNodeForVerticalAlignment.get(ge)[0]).getCenterX())}else{H.nodeToTempPositionMapHorizontal.set(ge,H.idToNodeMap.get(ge).getCenterX())}}H.nodeToRelativeConstraintMapHorizontal.get(ve).push({right:ge,gap:he.gap});H.nodeToRelativeConstraintMapHorizontal.get(ge).push({left:ve,gap:he.gap})}else{var Ve=oe.has(he.top)?oe.get(he.top):he.top;var Le=oe.has(he.bottom)?oe.get(he.bottom):he.bottom;if(!H.nodesInRelativeVertical.includes(Ve)){H.nodesInRelativeVertical.push(Ve);H.nodeToRelativeConstraintMapVertical.set(Ve,[]);if(H.dummyToNodeForHorizontalAlignment.has(Ve)){H.nodeToTempPositionMapVertical.set(Ve,H.idToNodeMap.get(H.dummyToNodeForHorizontalAlignment.get(Ve)[0]).getCenterY())}else{H.nodeToTempPositionMapVertical.set(Ve,H.idToNodeMap.get(Ve).getCenterY())}}if(!H.nodesInRelativeVertical.includes(Le)){H.nodesInRelativeVertical.push(Le);H.nodeToRelativeConstraintMapVertical.set(Le,[]);if(H.dummyToNodeForHorizontalAlignment.has(Le)){H.nodeToTempPositionMapVertical.set(Le,H.idToNodeMap.get(H.dummyToNodeForHorizontalAlignment.get(Le)[0]).getCenterY())}else{H.nodeToTempPositionMapVertical.set(Le,H.idToNodeMap.get(Le).getCenterY())}}H.nodeToRelativeConstraintMapVertical.get(Ve).push({bottom:Le,gap:he.gap});H.nodeToRelativeConstraintMapVertical.get(Le).push({top:Ve,gap:he.gap})}})}else{var ce=new Map;var ue=new Map;this.constraints.relativePlacementConstraint.forEach(function(he){if(he.left){var ve=J.has(he.left)?J.get(he.left):he.left;var ge=J.has(he.right)?J.get(he.right):he.right;if(ce.has(ve)){ce.get(ve).push(ge)}else{ce.set(ve,[ge])}if(ce.has(ge)){ce.get(ge).push(ve)}else{ce.set(ge,[ve])}}else{var Ve=oe.has(he.top)?oe.get(he.top):he.top;var Le=oe.has(he.bottom)?oe.get(he.bottom):he.bottom;if(ue.has(Ve)){ue.get(Ve).push(Le)}else{ue.set(Ve,[Le])}if(ue.has(Le)){ue.get(Le).push(Ve)}else{ue.set(Le,[Ve])}}});var xe=function he(ve,ge){var Ve=[];var Le=[];var $e=new z;var Ee=new Set;var tt=0;ve.forEach(function(yt,mt){if(!Ee.has(mt)){Ve[tt]=[];Le[tt]=false;var ct=mt;$e.push(ct);Ee.add(ct);Ve[tt].push(ct);while($e.length!=0){ct=$e.shift();if(ge.has(ct)){Le[tt]=true}var Ge=ve.get(ct);Ge.forEach(function(it){if(!Ee.has(it)){$e.push(it);Ee.add(it);Ve[tt].push(it)}})}tt++}});return{components:Ve,isFixed:Le}};var be=xe(ce,H.fixedNodesOnHorizontal);this.componentsOnHorizontal=be.components;this.fixedComponentsOnHorizontal=be.isFixed;var Ie=xe(ue,H.fixedNodesOnVertical);this.componentsOnVertical=Ie.components;this.fixedComponentsOnVertical=Ie.isFixed}}};U.prototype.updateDisplacements=function(){var H=this;if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(Ie){var he=H.idToNodeMap.get(Ie.nodeId);he.displacementX=0;he.displacementY=0})}if(this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var $=this.constraints.alignmentConstraint.vertical;for(var K=0;K<$.length;K++){var X=0;for(var j=0;j<$[K].length;j++){if(this.fixedNodeSet.has($[K][j])){X=0;break}X+=this.idToNodeMap.get($[K][j]).displacementX}var te=X/$[K].length;for(var j=0;j<$[K].length;j++){this.idToNodeMap.get($[K][j]).displacementX=te}}}if(this.constraints.alignmentConstraint.horizontal){var J=this.constraints.alignmentConstraint.horizontal;for(var K=0;K1){var oe;for(oe=0;oeX){X=Math.floor(J.y)}te=Math.floor(J.x+m.DEFAULT_COMPONENT_SEPERATION)}this.transform(new C(w.WORLD_CENTER_X-J.x/2,w.WORLD_CENTER_Y-J.y/2))};U.radialLayout=function(H,$,K){var X=Math.max(this.maxDiagonalInTree(H),m.DEFAULT_RADIAL_SEPARATION);U.branchRadialLayout($,null,0,359,0,X);var j=N.calculateBounds(H);var te=new O;te.setDeviceOrgX(j.getMinX());te.setDeviceOrgY(j.getMinY());te.setWorldOrgX(K.x);te.setWorldOrgY(K.y);for(var J=0;J1){var Ve=ge[0];ge.splice(0,1);var Le=xe.indexOf(Ve);if(Le>=0){xe.splice(Le,1)}he--;be--}if($!=null){ve=(xe.indexOf(ge[0])+1)%he}else{ve=0}var $e=Math.abs(X-K)/be;for(var Ee=ve;Ie!=be;Ee=++Ee%he){var tt=xe[Ee].getOtherEnd(H);if(tt==$){continue}var yt=(K+Ie*$e)%360;var mt=(yt+$e)%360;U.branchRadialLayout(tt,H,yt,mt,j+te,te);Ie++}};U.maxDiagonalInTree=function(H){var $=L.MIN_VALUE;for(var K=0;K$){$=j}}return $};U.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength};U.prototype.groupZeroDegreeMembers=function(){var H=this;var $={};this.memberGroups={};this.idToDummyNode={};var K=[];var X=this.graphManager.getAllNodes();for(var j=0;j1){var re="DummyCompound_"+se;H.memberGroups[re]=$[se];var ce=$[se][0].getParent();var ue=new f(H.graphManager);ue.id=re;ue.paddingLeft=ce.paddingLeft||0;ue.paddingRight=ce.paddingRight||0;ue.paddingBottom=ce.paddingBottom||0;ue.paddingTop=ce.paddingTop||0;H.idToDummyNode[re]=ue;var xe=H.getGraphManager().add(H.newGraph(),ue);var be=ce.getChild();be.add(ue);for(var Ie=0;Ie<$[se].length;Ie++){var he=$[se][Ie];be.remove(he);xe.add(he)}}})};U.prototype.clearCompounds=function(){var H={};var $={};this.performDFSOnCompounds();for(var K=0;Kj){X.rect.x-=(X.labelWidth-j)/2;X.setWidth(X.labelWidth);X.labelMarginLeft=(X.labelWidth-j)/2}else if(X.labelPosHorizontal=="right"){X.setWidth(j+X.labelWidth)}}if(X.labelHeight){if(X.labelPosVertical=="top"){X.rect.y-=X.labelHeight;X.setHeight(te+X.labelHeight);X.labelMarginTop=X.labelHeight}else if(X.labelPosVertical=="center"&&X.labelHeight>te){X.rect.y-=(X.labelHeight-te)/2;X.setHeight(X.labelHeight);X.labelMarginTop=(X.labelHeight-te)/2}else if(X.labelPosVertical=="bottom"){X.setHeight(te+X.labelHeight)}}}})};U.prototype.repopulateCompounds=function(){for(var H=this.compoundOrder.length-1;H>=0;H--){var $=this.compoundOrder[H];var K=$.id;var X=$.paddingLeft;var j=$.paddingTop;var te=$.labelMarginLeft;var J=$.labelMarginTop;this.adjustLocations(this.tiledMemberPack[K],$.rect.x,$.rect.y,X,j,te,J)}};U.prototype.repopulateZeroDegreeMembers=function(){var H=this;var $=this.tiledZeroDegreePack;Object.keys($).forEach(function(K){var X=H.idToDummyNode[K];var j=X.paddingLeft;var te=X.paddingTop;var J=X.labelMarginLeft;var oe=X.labelMarginTop;H.adjustLocations($[K],X.rect.x,X.rect.y,j,te,J,oe)})};U.prototype.getToBeTiled=function(H){var $=H.id;if(this.toBeTiled[$]!=null){return this.toBeTiled[$]}var K=H.getChild();if(K==null){this.toBeTiled[$]=false;return false}var X=K.getNodes();for(var j=0;j0){this.toBeTiled[$]=false;return false}if(te.getChild()==null){this.toBeTiled[te.id]=false;continue}if(!this.getToBeTiled(te)){this.toBeTiled[$]=false;return false}}this.toBeTiled[$]=true;return true};U.prototype.getNodeDegree=function(H){var $=H.id;var K=H.getEdges();var X=0;for(var j=0;jce)ce=xe.rect.height}K+=ce+H.verticalPadding}};U.prototype.tileCompoundMembers=function(H,$){var K=this;this.tiledMemberPack=[];Object.keys(H).forEach(function(X){var j=$[X];K.tiledMemberPack[X]=K.tileNodes(H[X],j.paddingLeft+j.paddingRight);j.rect.width=K.tiledMemberPack[X].width;j.rect.height=K.tiledMemberPack[X].height;j.setCenter(K.tiledMemberPack[X].centerX,K.tiledMemberPack[X].centerY);j.labelMarginLeft=0;j.labelMarginTop=0;if(m.NODE_DIMENSIONS_INCLUDE_LABELS){var te=j.rect.width;var J=j.rect.height;if(j.labelWidth){if(j.labelPosHorizontal=="left"){j.rect.x-=j.labelWidth;j.setWidth(te+j.labelWidth);j.labelMarginLeft=j.labelWidth}else if(j.labelPosHorizontal=="center"&&j.labelWidth>te){j.rect.x-=(j.labelWidth-te)/2;j.setWidth(j.labelWidth);j.labelMarginLeft=(j.labelWidth-te)/2}else if(j.labelPosHorizontal=="right"){j.setWidth(te+j.labelWidth)}}if(j.labelHeight){if(j.labelPosVertical=="top"){j.rect.y-=j.labelHeight;j.setHeight(J+j.labelHeight);j.labelMarginTop=j.labelHeight}else if(j.labelPosVertical=="center"&&j.labelHeight>J){j.rect.y-=(j.labelHeight-J)/2;j.setHeight(j.labelHeight);j.labelMarginTop=(j.labelHeight-J)/2}else if(j.labelPosVertical=="bottom"){j.setHeight(J+j.labelHeight)}}}})};U.prototype.tileNodes=function(H,$){var K=this.tileNodesByFavoringDim(H,$,true);var X=this.tileNodesByFavoringDim(H,$,false);var j=this.getOrgRatio(K);var te=this.getOrgRatio(X);var J;if(teoe){oe=Ie.getWidth()}});var se=te/j;var re=J/j;var ce=Math.pow(K-X,2)+4*(se+X)*(re+K)*j;var ue=(X-K+Math.sqrt(ce))/(2*(se+X));var xe;if($){xe=Math.ceil(ue);if(xe==ue){xe++}}else{xe=Math.floor(ue)}var be=xe*(se+X)-X;if(oe>be){be=oe}be+=X*2;return be};U.prototype.tileNodesByFavoringDim=function(H,$,K){var X=m.TILING_PADDING_VERTICAL;var j=m.TILING_PADDING_HORIZONTAL;var te=m.TILING_COMPARE_BY;var J={rows:[],rowWidth:[],rowHeight:[],width:0,height:$,verticalPadding:X,horizontalPadding:j,centerX:0,centerY:0};if(te){J.idealRowWidth=this.calcIdealRowWidth(H,K)}var oe=function Ie(he){return he.rect.width*he.rect.height};var se=function Ie(he,ve){return oe(ve)-oe(he)};H.sort(function(Ie,he){var ve=se;if(J.idealRowWidth){ve=te;return ve(Ie.id,he.id)}return ve(Ie,he)});var re=0;var ce=0;for(var ue=0;ue0){J+=H.horizontalPadding}H.rowWidth[K]=J;if(H.width0)oe+=H.verticalPadding;var se=0;if(oe>H.rowHeight[K]){se=H.rowHeight[K];H.rowHeight[K]=oe;se=H.rowHeight[K]-se}H.height+=se;H.rows[K].push($)};U.prototype.getShortestRowIndex=function(H){var $=-1;var K=Number.MAX_VALUE;for(var X=0;XK){$=X;K=H.rowWidth[X]}}return $};U.prototype.canAddHorizontal=function(H,$,K){if(H.idealRowWidth){var X=H.rows.length-1;var j=H.rowWidth[X];return j+$+H.horizontalPadding<=H.idealRowWidth}var te=this.getShortestRowIndex(H);if(te<0){return true}var J=H.rowWidth[te];if(J+H.horizontalPadding+$<=H.width)return true;var oe=0;if(H.rowHeight[te]0)oe=K+H.verticalPadding-H.rowHeight[te]}var se;if(H.width-J>=$+H.horizontalPadding){se=(H.height+oe)/(J+$+H.horizontalPadding)}else{se=(H.height+oe)/H.width}oe=K+H.verticalPadding;var re;if(H.width<$){re=(H.height+oe)/$}else{re=(H.height+oe)/H.width}if(re<1)re=1/re;if(se<1)se=1/se;return sete&&$!=K){X.splice(-1,1);H.rows[K].push(j);H.rowWidth[$]=H.rowWidth[$]-te;H.rowWidth[K]=H.rowWidth[K]+te;H.width=H.rowWidth[instance.getLongestRowIndex(H)];var J=Number.MIN_VALUE;for(var oe=0;oeJ)J=X[oe].height}if($>0)J+=H.verticalPadding;var se=H.rowHeight[$]+H.rowHeight[K];H.rowHeight[$]=J;if(H.rowHeight[K]0){for(var be=j;be<=te;be++){xe[0]+=this.grid[be][J-1].length+this.grid[be][J].length-1}}if(te0){for(var be=J;be<=oe;be++){xe[3]+=this.grid[j-1][be].length+this.grid[j][be].length-1}}var Ie=L.MAX_VALUE;var he;var ve;for(var ge=0;ge{var l=s(551).FDLayoutNode;var u=s(551).IMath;function d(h,m,g,x){l.call(this,h,m,g,x)}d.prototype=Object.create(l.prototype);for(var f in l){d[f]=l[f]}d.prototype.calculateDisplacement=function(){var h=this.graphManager.getLayout();if(this.getChild()!=null&&this.fixedNodeWeight){this.displacementX+=h.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight;this.displacementY+=h.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight}else{this.displacementX+=h.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren;this.displacementY+=h.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren}if(Math.abs(this.displacementX)>h.coolingFactor*h.maxNodeDisplacement){this.displacementX=h.coolingFactor*h.maxNodeDisplacement*u.sign(this.displacementX)}if(Math.abs(this.displacementY)>h.coolingFactor*h.maxNodeDisplacement){this.displacementY=h.coolingFactor*h.maxNodeDisplacement*u.sign(this.displacementY)}if(this.child&&this.child.getNodes().length>0){this.propogateDisplacementToChildren(this.displacementX,this.displacementY)}};d.prototype.propogateDisplacementToChildren=function(h,m){var g=this.getChild().getNodes();var x;for(var w=0;w{function l(g){if(Array.isArray(g)){for(var x=0,w=Array(g.length);x0){var lr=0;At.forEach(function(cr){if(Ne=="horizontal"){qt.set(cr,_.has(cr)?C[_.get(cr)]:dt.get(cr));lr+=qt.get(cr)}else{qt.set(cr,_.has(cr)?A[_.get(cr)]:dt.get(cr));lr+=qt.get(cr)}});lr=lr/At.length;mn.forEach(function(cr){if(!Ae.has(cr)){qt.set(cr,lr)}})}else{var on=0;mn.forEach(function(cr){if(Ne=="horizontal"){on+=_.has(cr)?C[_.get(cr)]:dt.get(cr)}else{on+=_.has(cr)?A[_.get(cr)]:dt.get(cr)}});on=on/mn.length;mn.forEach(function(cr){qt.set(cr,on)})}})}var Jt=function mn(){var At=sn.shift();var lr=ye.get(At);lr.forEach(function(on){if(qt.get(on.id)cr){cr=Xr}if(drHr){Hr=dr}}}catch(rr){Er=true;vr=rr}finally{try{if(!Mr&&Yr.return){Yr.return()}}finally{if(Er){throw vr}}}var rn=(lr+cr)/2-(on+Hr)/2;var St=true;var Ut=false;var Pt=void 0;try{for(var an=mn[Symbol.iterator](),Xt;!(St=(Xt=an.next()).done);St=true){var Cn=Xt.value;qt.set(Cn,qt.get(Cn)+rn)}}catch(rr){Ut=true;Pt=rr}finally{try{if(!St&&an.return){an.return()}}finally{if(Ut){throw Pt}}}})}return qt};var W=function Me(ye){var Ne=0,Ae=0;var dt=0,Oe=0;ye.forEach(function(_t){if(_t.left){C[_.get(_t.left)]-C[_.get(_t.right)]>=0?Ne++:Ae++}else{A[_.get(_t.top)]-A[_.get(_t.bottom)]>=0?dt++:Oe++}});if(Ne>Ae&&dt>Oe){for(var Wt=0;Wt<_.size;Wt++){C[Wt]=-1*C[Wt];A[Wt]=-1*A[Wt]}}else if(Ne>Ae){for(var kt=0;kt<_.size;kt++){C[kt]=-1*C[kt]}}else if(dt>Oe){for(var qt=0;qt<_.size;qt++){A[qt]=-1*A[qt]}}};var H=function Me(ye){var Ne=[];var Ae=new d;var dt=new Set;var Oe=0;ye.forEach(function(Wt,kt){if(!dt.has(kt)){Ne[Oe]=[];var qt=kt;Ae.push(qt);dt.add(qt);Ne[Oe].push(qt);while(Ae.length!=0){qt=Ae.shift();var _t=ye.get(qt);_t.forEach(function(sn){if(!dt.has(sn.id)){Ae.push(sn.id);dt.add(sn.id);Ne[Oe].push(sn.id)}})}Oe++}});return Ne};var $=function Me(ye){var Ne=new Map;ye.forEach(function(Ae,dt){Ne.set(dt,[])});ye.forEach(function(Ae,dt){Ae.forEach(function(Oe){Ne.get(dt).push(Oe);Ne.get(Oe.id).push({id:dt,gap:Oe.gap,direction:Oe.direction})})});return Ne};var K=function Me(ye){var Ne=new Map;ye.forEach(function(Ae,dt){Ne.set(dt,[])});ye.forEach(function(Ae,dt){Ae.forEach(function(Oe){Ne.get(Oe.id).push({id:dt,gap:Oe.gap,direction:Oe.direction})})});return Ne};var X=[];var j=[];var te=false;var J=false;var oe=new Set;var se=new Map;var re=new Map;var ce=[];if(x.fixedNodeConstraint){x.fixedNodeConstraint.forEach(function(Me){oe.add(Me.nodeId)})}if(x.relativePlacementConstraint){x.relativePlacementConstraint.forEach(function(Me){if(Me.left){if(se.has(Me.left)){se.get(Me.left).push({id:Me.right,gap:Me.gap,direction:"horizontal"})}else{se.set(Me.left,[{id:Me.right,gap:Me.gap,direction:"horizontal"}])}if(!se.has(Me.right)){se.set(Me.right,[])}}else{if(se.has(Me.top)){se.get(Me.top).push({id:Me.bottom,gap:Me.gap,direction:"vertical"})}else{se.set(Me.top,[{id:Me.bottom,gap:Me.gap,direction:"vertical"}])}if(!se.has(Me.bottom)){se.set(Me.bottom,[])}}});re=$(se);ce=H(re)}if(u.TRANSFORM_ON_CONSTRAINT_HANDLING){if(x.fixedNodeConstraint&&x.fixedNodeConstraint.length>1){x.fixedNodeConstraint.forEach(function(Me,ye){X[ye]=[Me.position.x,Me.position.y];j[ye]=[C[_.get(Me.nodeId)],A[_.get(Me.nodeId)]]});te=true}else if(x.alignmentConstraint){(function(){var Me=0;if(x.alignmentConstraint.vertical){var ye=x.alignmentConstraint.vertical;var Ne=function kt(qt){var _t=new Set;ye[qt].forEach(function(Sn){_t.add(Sn)});var sn=new Set([].concat(l(_t)).filter(function(Sn){return oe.has(Sn)}));var Jt=void 0;if(sn.size>0)Jt=C[_.get(sn.values().next().value)];else Jt=z(_t).x;ye[qt].forEach(function(Sn){X[Me]=[Jt,A[_.get(Sn)]];j[Me]=[C[_.get(Sn)],A[_.get(Sn)]];Me++})};for(var Ae=0;Ae0)Jt=C[_.get(sn.values().next().value)];else Jt=z(_t).y;dt[qt].forEach(function(Sn){X[Me]=[C[_.get(Sn)],Jt];j[Me]=[C[_.get(Sn)],A[_.get(Sn)]];Me++})};for(var Wt=0;Wtue){ue=ce[be].length;xe=be}}if(ue0){var He={x:0,y:0};x.fixedNodeConstraint.forEach(function(Me,ye){var Ne={x:C[_.get(Me.nodeId)],y:A[_.get(Me.nodeId)]};var Ae=Me.position;var dt=O(Ae,Ne);He.x+=dt.x;He.y+=dt.y});He.x/=x.fixedNodeConstraint.length;He.y/=x.fixedNodeConstraint.length;C.forEach(function(Me,ye){C[ye]+=He.x});A.forEach(function(Me,ye){A[ye]+=He.y});x.fixedNodeConstraint.forEach(function(Me){C[_.get(Me.nodeId)]=Me.position.x;A[_.get(Me.nodeId)]=Me.position.y})}if(x.alignmentConstraint){if(x.alignmentConstraint.vertical){var Je=x.alignmentConstraint.vertical;var Te=function Me(ye){var Ne=new Set;Je[ye].forEach(function(Oe){Ne.add(Oe)});var Ae=new Set([].concat(l(Ne)).filter(function(Oe){return oe.has(Oe)}));var dt=void 0;if(Ae.size>0)dt=C[_.get(Ae.values().next().value)];else dt=z(Ne).x;Ne.forEach(function(Oe){if(!oe.has(Oe))C[_.get(Oe)]=dt})};for(var we=0;we0)dt=A[_.get(Ae.values().next().value)];else dt=z(Ne).y;Ne.forEach(function(Oe){if(!oe.has(Oe))A[_.get(Oe)]=dt})};for(var qe=0;qe{o.exports=e}};var n={};function r(o){var a=n[o];if(a!==void 0){return a.exports}var s=n[o]={exports:{}};t[o](s,s.exports,r);return s.exports}var i=r(45);return i})()})});var T6n=_r((Lre,fct)=>{(function e(t,n){if(typeof Lre==="object"&&typeof fct==="object")fct.exports=n(dct());else if(typeof define==="function"&&define.amd)define(["cose-base"],n);else if(typeof Lre==="object")Lre["cytoscapeFcose"]=n(dct());else t["cytoscapeFcose"]=n(t["coseBase"])})(Lre,function(e){return(()=>{"use strict";var t={658:o=>{o.exports=Object.assign!=null?Object.assign.bind(Object):function(a){for(var s=arguments.length,l=Array(s>1?s-1:0),u=1;u{var l=function(){function f(h,m){var g=[];var x=true;var w=false;var _=void 0;try{for(var C=h[Symbol.iterator](),A;!(x=(A=C.next()).done);x=true){g.push(A.value);if(m&&g.length===m)break}}catch(P){w=true;_=P}finally{try{if(!x&&C["return"])C["return"]()}finally{if(w)throw _}}return g}return function(h,m){if(Array.isArray(h)){return h}else if(Symbol.iterator in Object(h)){return f(h,m)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();var u=s(140).layoutBase.LinkedList;var d={};d.getTopMostNodes=function(f){var h={};for(var m=0;m0){te.merge(re)}});for(var J=0;J1){A=_[0];P=A.connectedEdges().length;_.forEach(function(j){if(j.connectedEdges().length0){g.set("dummy"+(g.size+1),N)}}return O};d.relocateComponent=function(f,h,m){if(!m.fixedNodeConstraint){var g=Number.POSITIVE_INFINITY;var x=Number.NEGATIVE_INFINITY;var w=Number.POSITIVE_INFINITY;var _=Number.NEGATIVE_INFINITY;if(m.quality=="draft"){var C=true;var A=false;var P=void 0;try{for(var L=h.nodeIndexes[Symbol.iterator](),I;!(C=(I=L.next()).done);C=true){var N=I.value;var O=l(N,2);var z=O[0];var U=O[1];var W=m.cy.getElementById(z);if(W){var H=W.boundingBox();var $=h.xCoords[U]-H.w/2;var K=h.xCoords[U]+H.w/2;var X=h.yCoords[U]-H.h/2;var j=h.yCoords[U]+H.h/2;if($x)x=K;if(X_)_=j}}}catch(re){A=true;P=re}finally{try{if(!C&&L.return){L.return()}}finally{if(A){throw P}}}var te=f.x-(x+g)/2;var J=f.y-(_+w)/2;h.xCoords=h.xCoords.map(function(re){return re+te});h.yCoords=h.yCoords.map(function(re){return re+J})}else{Object.keys(h).forEach(function(re){var ce=h[re];var ue=ce.getRect().x;var xe=ce.getRect().x+ce.getRect().width;var be=ce.getRect().y;var Ie=ce.getRect().y+ce.getRect().height;if(uex)x=xe;if(be_)_=Ie});var oe=f.x-(x+g)/2;var se=f.y-(_+w)/2;Object.keys(h).forEach(function(re){var ce=h[re];ce.setCenter(ce.getCenterX()+oe,ce.getCenterY()+se)})}}};d.calcBoundingBox=function(f,h,m,g){var x=Number.MAX_SAFE_INTEGER;var w=Number.MIN_SAFE_INTEGER;var _=Number.MAX_SAFE_INTEGER;var C=Number.MIN_SAFE_INTEGER;var A=void 0;var P=void 0;var L=void 0;var I=void 0;var N=f.descendants().not(":parent");var O=N.length;for(var z=0;zA){x=A}if(wL){_=L}if(C{var l=s(548);var u=s(140).CoSELayout;var d=s(140).CoSENode;var f=s(140).layoutBase.PointD;var h=s(140).layoutBase.DimensionD;var m=s(140).layoutBase.LayoutConstants;var g=s(140).layoutBase.FDLayoutConstants;var x=s(140).CoSEConstants;var w=function _(C,A){var P=C.cy;var L=C.eles;var I=L.nodes();var N=L.edges();var O=void 0;var z=void 0;var U=void 0;var W={};if(C.randomize){O=A["nodeIndexes"];z=A["xCoords"];U=A["yCoords"]}var H=function se(re){return typeof re==="function"};var $=function se(re,ce){if(H(re)){return re(ce)}else{return re}};var K=l.calcParentsWithoutChildren(P,L);var X=function se(re,ce,ue,xe){var be=ce.length;for(var Ie=0;Ie0){var $e=void 0;$e=ue.getGraphManager().add(ue.newGraph(),ge);se($e,ve,ue,xe)}}};var j=function se(re,ce,ue){var xe=0;var be=0;for(var Ie=0;Ie0)x.DEFAULT_EDGE_LENGTH=g.DEFAULT_EDGE_LENGTH=xe/be;else if(!H(C.idealEdgeLength))x.DEFAULT_EDGE_LENGTH=g.DEFAULT_EDGE_LENGTH=C.idealEdgeLength;else x.DEFAULT_EDGE_LENGTH=g.DEFAULT_EDGE_LENGTH=50;x.MIN_REPULSION_DIST=g.MIN_REPULSION_DIST=g.DEFAULT_EDGE_LENGTH/10;x.DEFAULT_RADIAL_SEPARATION=g.DEFAULT_EDGE_LENGTH}};var te=function se(re,ce){if(ce.fixedNodeConstraint){re.constraints["fixedNodeConstraint"]=ce.fixedNodeConstraint}if(ce.alignmentConstraint){re.constraints["alignmentConstraint"]=ce.alignmentConstraint}if(ce.relativePlacementConstraint){re.constraints["relativePlacementConstraint"]=ce.relativePlacementConstraint}};if(C.nestingFactor!=null)x.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=g.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=C.nestingFactor;if(C.gravity!=null)x.DEFAULT_GRAVITY_STRENGTH=g.DEFAULT_GRAVITY_STRENGTH=C.gravity;if(C.numIter!=null)x.MAX_ITERATIONS=g.MAX_ITERATIONS=C.numIter;if(C.gravityRange!=null)x.DEFAULT_GRAVITY_RANGE_FACTOR=g.DEFAULT_GRAVITY_RANGE_FACTOR=C.gravityRange;if(C.gravityCompound!=null)x.DEFAULT_COMPOUND_GRAVITY_STRENGTH=g.DEFAULT_COMPOUND_GRAVITY_STRENGTH=C.gravityCompound;if(C.gravityRangeCompound!=null)x.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=g.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=C.gravityRangeCompound;if(C.initialEnergyOnIncremental!=null)x.DEFAULT_COOLING_FACTOR_INCREMENTAL=g.DEFAULT_COOLING_FACTOR_INCREMENTAL=C.initialEnergyOnIncremental;if(C.tilingCompareBy!=null)x.TILING_COMPARE_BY=C.tilingCompareBy;if(C.quality=="proof")m.QUALITY=2;else m.QUALITY=0;x.NODE_DIMENSIONS_INCLUDE_LABELS=g.NODE_DIMENSIONS_INCLUDE_LABELS=m.NODE_DIMENSIONS_INCLUDE_LABELS=C.nodeDimensionsIncludeLabels;x.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=!C.randomize;x.ANIMATE=g.ANIMATE=m.ANIMATE=C.animate;x.TILE=C.tile;x.TILING_PADDING_VERTICAL=typeof C.tilingPaddingVertical==="function"?C.tilingPaddingVertical.call():C.tilingPaddingVertical;x.TILING_PADDING_HORIZONTAL=typeof C.tilingPaddingHorizontal==="function"?C.tilingPaddingHorizontal.call():C.tilingPaddingHorizontal;x.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=m.DEFAULT_INCREMENTAL=true;x.PURE_INCREMENTAL=!C.randomize;m.DEFAULT_UNIFORM_LEAF_NODE_SIZES=C.uniformNodeDimensions;if(C.step=="transformed"){x.TRANSFORM_ON_CONSTRAINT_HANDLING=true;x.ENFORCE_CONSTRAINTS=false;x.APPLY_LAYOUT=false}if(C.step=="enforced"){x.TRANSFORM_ON_CONSTRAINT_HANDLING=false;x.ENFORCE_CONSTRAINTS=true;x.APPLY_LAYOUT=false}if(C.step=="cose"){x.TRANSFORM_ON_CONSTRAINT_HANDLING=false;x.ENFORCE_CONSTRAINTS=false;x.APPLY_LAYOUT=true}if(C.step=="all"){if(C.randomize)x.TRANSFORM_ON_CONSTRAINT_HANDLING=true;else x.TRANSFORM_ON_CONSTRAINT_HANDLING=false;x.ENFORCE_CONSTRAINTS=true;x.APPLY_LAYOUT=true}if(C.fixedNodeConstraint||C.alignmentConstraint||C.relativePlacementConstraint){x.TREE_REDUCTION_ON_INCREMENTAL=false}else{x.TREE_REDUCTION_ON_INCREMENTAL=true}var J=new u;var oe=J.newGraphManager();X(oe.addRoot(),l.getTopMostNodes(I),J,C);j(J,oe,N);te(J,C);J.runLayout();return W};o.exports={coseLayout:w}},212:(o,a,s)=>{var l=function(){function C(A,P){for(var L=0;L0){if(!j){var te=L.eles.boundingBox();$.push({x:te.x1+te.w/2,y:te.y1+te.h/2});if(L.randomize){var J=m(L);O.push(J)}if(L.quality=="default"||L.quality=="proof"){W.push(x(L,O[0]));f.relocateComponent($[0],W[0],L)}else{f.relocateComponent($[0],O[0],L)}}else{var oe=f.getTopMostNodes(L.eles.nodes());H=f.connectComponents(I,L.eles,oe);H.forEach(function(ct){var Ge=ct.boundingBox();$.push({x:Ge.x1+Ge.w/2,y:Ge.y1+Ge.h/2})});if(L.randomize){H.forEach(function(ct){L.eles=ct;O.push(m(L))})}if(L.quality=="default"||L.quality=="proof"){var se=I.collection();if(L.tile){var re=new Map;var ce=[];var ue=[];var xe=0;var be={nodeIndexes:re,xCoords:ce,yCoords:ue};var Ie=[];H.forEach(function(ct,Ge){if(ct.edges().length==0){ct.nodes().forEach(function(it,bt){se.merge(ct.nodes()[bt]);if(!it.isParent()){be.nodeIndexes.set(ct.nodes()[bt].id(),xe++);be.xCoords.push(ct.nodes()[0].position().x);be.yCoords.push(ct.nodes()[0].position().y)}});Ie.push(Ge)}});if(se.length>1){var he=se.boundingBox();$.push({x:he.x1+he.w/2,y:he.y1+he.h/2});H.push(se);O.push(be);for(var ve=Ie.length-1;ve>=0;ve--){H.splice(Ie[ve],1);O.splice(Ie[ve],1);$.splice(Ie[ve],1)};}}H.forEach(function(ct,Ge){L.eles=ct;W.push(x(L,O[Ge]));f.relocateComponent($[Ge],W[Ge],L)})}else{H.forEach(function(ct,Ge){f.relocateComponent($[Ge],O[Ge],L)})}var ge=new Set;if(H.length>1){var Ve=[];var Le=N.filter(function(ct){return ct.css("display")=="none"});H.forEach(function(ct,Ge){var it=void 0;if(L.quality=="draft"){it=O[Ge].nodeIndexes}if(ct.nodes().not(Le).length>0){var bt={};bt.edges=[];bt.nodes=[];var He=void 0;ct.nodes().not(Le).forEach(function(Je){if(L.quality=="draft"){if(!Je.isParent()){He=it.get(Je.id());bt.nodes.push({x:O[Ge].xCoords[He]-Je.boundingbox().w/2,y:O[Ge].yCoords[He]-Je.boundingbox().h/2,width:Je.boundingbox().w,height:Je.boundingbox().h})}else{var Te=f.calcBoundingBox(Je,O[Ge].xCoords,O[Ge].yCoords,it);bt.nodes.push({x:Te.topLeftX,y:Te.topLeftY,width:Te.width,height:Te.height})}}else{if(W[Ge][Je.id()]){bt.nodes.push({x:W[Ge][Je.id()].getLeft(),y:W[Ge][Je.id()].getTop(),width:W[Ge][Je.id()].getWidth(),height:W[Ge][Je.id()].getHeight()})}}});ct.edges().forEach(function(Je){var Te=Je.source();var we=Je.target();if(Te.css("display")!="none"&&we.css("display")!="none"){if(L.quality=="draft"){var Ze=it.get(Te.id());var Be=it.get(we.id());var qe=[];var Qe=[];if(Te.isParent()){var ze=f.calcBoundingBox(Te,O[Ge].xCoords,O[Ge].yCoords,it);qe.push(ze.topLeftX+ze.width/2);qe.push(ze.topLeftY+ze.height/2)}else{qe.push(O[Ge].xCoords[Ze]);qe.push(O[Ge].yCoords[Ze])}if(we.isParent()){var Me=f.calcBoundingBox(we,O[Ge].xCoords,O[Ge].yCoords,it);Qe.push(Me.topLeftX+Me.width/2);Qe.push(Me.topLeftY+Me.height/2)}else{Qe.push(O[Ge].xCoords[Be]);Qe.push(O[Ge].yCoords[Be])}bt.edges.push({startX:qe[0],startY:qe[1],endX:Qe[0],endY:Qe[1]})}else{if(W[Ge][Te.id()]&&W[Ge][we.id()]){bt.edges.push({startX:W[Ge][Te.id()].getCenterX(),startY:W[Ge][Te.id()].getCenterY(),endX:W[Ge][we.id()].getCenterX(),endY:W[Ge][we.id()].getCenterY()})}}}});if(bt.nodes.length>0){Ve.push(bt);ge.add(Ge)}}});var $e=X.packComponents(Ve,L.randomize).shifts;if(L.quality=="draft"){O.forEach(function(ct,Ge){var it=ct.xCoords.map(function(He){return He+$e[Ge].dx});var bt=ct.yCoords.map(function(He){return He+$e[Ge].dy});ct.xCoords=it;ct.yCoords=bt})}else{var Ee=0;ge.forEach(function(ct){Object.keys(W[ct]).forEach(function(Ge){var it=W[ct][Ge];it.setCenter(it.getCenterX()+$e[Ee].dx,it.getCenterY()+$e[Ee].dy)});Ee++})}}}}var tt=function ct(Ge,it){if(L.quality=="default"||L.quality=="proof"){if(typeof Ge==="number"){Ge=it}var bt=void 0;var He=void 0;var Je=Ge.data("id");W.forEach(function(we){if(Je in we){bt={x:we[Je].getRect().getCenterX(),y:we[Je].getRect().getCenterY()};He=we[Je]}});if(L.nodeDimensionsIncludeLabels){if(He.labelWidth){if(He.labelPosHorizontal=="left"){bt.x+=He.labelWidth/2}else if(He.labelPosHorizontal=="right"){bt.x-=He.labelWidth/2}}if(He.labelHeight){if(He.labelPosVertical=="top"){bt.y+=He.labelHeight/2}else if(He.labelPosVertical=="bottom"){bt.y-=He.labelHeight/2}}}if(bt==void 0)bt={x:Ge.position("x"),y:Ge.position("y")};return{x:bt.x,y:bt.y}}else{var Te=void 0;O.forEach(function(we){var Ze=we.nodeIndexes.get(Ge.id());if(Ze!=void 0){Te={x:we.xCoords[Ze],y:we.yCoords[Ze]}}});if(Te==void 0)Te={x:Ge.position("x"),y:Ge.position("y")};return{x:Te.x,y:Te.y}}};if(L.quality=="default"||L.quality=="proof"||L.randomize){var yt=f.calcParentsWithoutChildren(I,N);var mt=N.filter(function(ct){return ct.css("display")=="none"});L.eles=N.not(mt);N.nodes().not(":parent").not(mt).layoutPositions(P,L,tt);if(yt.length>0){yt.forEach(function(ct){ct.position(tt(ct))})}}else{console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}}]);return C}();o.exports=_},657:(o,a,s)=>{var l=s(548);var u=s(140).layoutBase.Matrix;var d=s(140).layoutBase.SVD;var f=function h(m){var g=m.cy;var x=m.eles;var w=x.nodes();var _=x.nodes(":parent");var C=new Map;var A=new Map;var P=new Map;var L=[];var I=[];var N=[];var O=[];var z=[];var U=[];var W=[];var H=[];var $=void 0;var K=void 0;var X=1e8;var j=1e-9;var te=m.piTol;var J=m.samplingType;var oe=m.nodeSeparation;var se=void 0;var re=function ye(){var Ne=0;var Ae=0;var dt=false;while(Ae=Wt){qt=Oe[Wt++];var mn=L[qt];for(var At=0;AtJt){Jt=z[on];Sn=on}}}return Sn};var ue=function ye(Ne){var Ae=void 0;if(!Ne){re();for(var dt=0;dt=1){break}Jt=sn}for(var mn=0;mn=1){break}Jt=sn}for(var lr=0;lr0){if(Ae.isParent())L[Ne].push(P.get(Ae.id()));else L[Ne].push(Ae.id())}})});var yt=function ye(Ne){var Ae=A.get(Ne);var dt=void 0;C.get(Ne).forEach(function(Oe){if(g.getElementById(Oe).isParent())dt=P.get(Oe);else dt=Oe;L[Ae].push(dt);L[A.get(dt)].push(Ne)})};var mt=true;var ct=false;var Ge=void 0;try{for(var it=C.keys()[Symbol.iterator](),bt;!(mt=(bt=it.next()).done);mt=true){var He=bt.value;yt(He)}}catch(ye){ct=true;Ge=ye}finally{try{if(!mt&&it.return){it.return()}}finally{if(ct){throw Ge}}}K=A.size;var Je=void 0;if(K>2){se=K{var l=s(212);var u=function d(f){if(!f){return}f("layout","fcose",l)};if(typeof cytoscape!=="undefined"){u(cytoscape)}o.exports=u},140:o=>{o.exports=e}};var n={};function r(o){var a=n[o];if(a!==void 0){return a.exports}var s=n[o]={exports:{}};t[o](s,s.exports,r);return s.exports}var i=r(579);return i})()})});var z6n={};Oo(z6n,{diagram:()=>uqi});function pct(e,t){if(e===0){return t()}const n=Math.random;let r=e>>>0;Math.random=function(){r=r+1831565813>>>0;let i=r;i=Math.imul(i^i>>>15,i|1);i^=i+Math.imul(i^i>>>7,i|61);return((i^i>>>14)>>>0)/4294967296};try{return t()}finally{Math.random=n}}function I6n(e,t,n){e.forEach(r=>{t.add({group:"nodes",data:{type:"service",id:r.id,icon:r.icon,label:r.title,parent:r.in,width:n.getConfigField("iconSize"),height:n.getConfigField("iconSize")},classes:"node-service"})})}function M6n(e,t,n){e.forEach(r=>{t.add({group:"nodes",data:{type:"junction",id:r.id,parent:r.in,width:n.getConfigField("iconSize"),height:n.getConfigField("iconSize")},classes:"node-junction"})})}function L6n(e,t){t.nodes().map(n=>{const r=PH(n);if(r.type==="group"){return}r.x=n.position().x;r.y=n.position().y;const i=e.getElementById(r.id);i.attr("transform","translate("+(r.x||0)+","+(r.y||0)+")")})}function D6n(e,t){e.forEach(n=>{t.add({group:"nodes",data:{type:"group",id:n.id,icon:n.icon,label:n.title,parent:n.in},classes:"node-group"})})}function F6n(e,t){e.forEach(n=>{const{lhsId:r,rhsId:i,lhsInto:o,lhsGroup:a,rhsInto:s,lhsDir:l,rhsDir:u,rhsGroup:d,title:f}=n;const h=mct(n.lhsDir,n.rhsDir)?"segments":"straight";const m={id:`${r}-${i}`,label:f,source:r,sourceDir:l,sourceArrow:o,sourceGroup:a,sourceEndpoint:l==="L"?"0 50%":l==="R"?"100% 50%":l==="T"?"50% 0":"50% 100%",target:i,targetDir:u,targetArrow:s,targetGroup:d,targetEndpoint:u==="L"?"0 50%":u==="R"?"100% 50%":u==="T"?"50% 0":"50% 100%"};t.add({group:"edges",data:m,classes:h})})}function N6n(e,t,n,r=[]){const i=B((h,m)=>{const g=new Map;for(const[x,w]of h.entries()){const _=`${x}`;let C=0;const A=[...w.entries()];if(A.length===1){g.set(_,A[0][1]);continue}for(let P=0;P{const m=new Map;const g=new Map;h.forEach(([x,w],_)=>{const C=e.getNode(_)?.in??"default";const A=m.get(w)??new Map;if(!m.has(w)){m.set(w,A)}const P=g.get(x)??new Map;if(!g.has(x)){g.set(x,P)}for(const L of[A,P]){const I=L.get(C)??[];if(!L.has(C)){L.set(C,I)}I.push(_)}});return{horiz:[...i(m,"horizontal").values()].filter(x=>x.length>1),vert:[...i(g,"vertical").values()].filter(x=>x.length>1)}});const[a,s]=o.reduce(([h,m],{horiz:g,vert:x})=>{return[[...h,...g],[...m,...x]]},[[],[]]);const l=new Set;r.forEach(h=>h.members.forEach(m=>l.add(m)));const u=B(h=>h.filter(m=>!m.some(g=>l.has(g))),"dropOverlapping");const d=u(a);const f=u(s);r.forEach(h=>{if(h.members.length<2){return}if(h.direction==="row"){d.push([...h.members])}else{f.push([...h.members])}});return{horizontal:d,vertical:f}}function O6n(e,t,n=[]){const r=[];const i=t.getConfigField("iconSize");const o=t.getConfigField("idealEdgeLengthMultiplier");const a=o*i;const s=new Set;n.forEach(d=>{for(let f=0;f`${d[0]},${d[1]}`,"posToStr");const u=B(d=>d.split(",").map(f=>parseInt(f)),"strToPos");e.forEach(d=>{const f=new Map([...d.entries()].map(([x,w])=>[l(w),x]));const h=[l([0,0])];const m={};const g={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};while(h.length>0){const x=h.shift();if(x){m[x]=1;const w=f.get(x);if(w){const _=u(x);Object.entries(g).forEach(([C,A])=>{const P=l([_[0]+A[0],_[1]+A[1]]);const L=f.get(P);if(L&&!m[P]){h.push(P);if(s.has(`${w}|${L}`)){return}r.push({[w6n[C]]:L,[w6n[YYi(C)]]:w,gap:o*i})}})}}}});return r}function B6n(e,t,n,r,i,{spatialMaps:o,groupAlignments:a}){return new Promise(s=>{const l=zr("body").append("div").attr("id","cy").attr("style","display:none");const u=O_({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${i.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${i.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});l.remove();D6n(n,u);I6n(e,u,i);M6n(t,u,i);F6n(r,u);const d=i.getLayoutHints();const f=N6n(i,o,a,d);const h=O6n(o,i,d);const m=i.getConfigField("iconSize");const g=i.getConfigField("idealEdgeLengthMultiplier")*m;const x=.5*m;const w=i.getConfigField("edgeElasticity");const _=i.getConfigField("seed");const C=u.layout({name:"fcose",quality:"proof",randomize:i.getConfigField("randomize"),nodeSeparation:i.getConfigField("nodeSeparation"),numIter:i.getConfigField("numIter"),styleEnabled:false,animate:false,nodeDimensionsIncludeLabels:false,idealEdgeLength(A){const[P,L]=A.connectedNodes();const{parent:I}=PH(P);const{parent:N}=PH(L);return I===N?g:x},edgeElasticity(A){const[P,L]=A.connectedNodes();const{parent:I}=PH(P);const{parent:N}=PH(L);return I===N?w:.001},alignmentConstraint:f,relativePlacementConstraint:h});C.one("layoutstop",()=>{function A(P,L,I,N){let O,z;const{x:U,y:W}=P;const{x:H,y:$}=L;z=(N-W+(U-I)*(W-$)/(U-H))/Math.sqrt(1+Math.pow((W-$)/(U-H),2));O=Math.sqrt(Math.pow(N-W,2)+Math.pow(I-U,2)-Math.pow(z,2));const K=Math.sqrt(Math.pow(H-U,2)+Math.pow($-W,2));O=O/K;let X=(H-U)*(N-W)-($-W)*(I-U);switch(true){case X>=0:X=1;break;case X<0:X=-1;break}let j=(H-U)*(I-U)+($-W)*(N-W);switch(true){case j>=0:j=1;break;case j<0:j=-1;break}z=Math.abs(z)*X;O=O*j;return{distances:z,weights:O}}B(A,"getSegmentWeights");u.startBatch();for(const P of Object.values(u.edges())){if(P.data?.()){const{x:L,y:I}=P.source().position();const{x:N,y:O}=P.target().position();if(L!==N&&I!==O){const z=P.sourceEndpoint();const U=P.targetEndpoint();const{sourceDir:W}=A6n(P);const[H,$]=SD(W)?[z.x,U.y]:[U.x,z.y];const{weights:K,distances:X}=A(z,U,H,$);P.style("segment-distances",X);P.style("segment-weights",K)}}}u.endBatch();pct(_,()=>C.run())});try{pct(_,()=>C.run())}catch(A){if(A instanceof RangeError&&A.message.includes("Invalid array length")){throw new Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis.")}throw A}u.ready(A=>{wt.info("Ready",A);s(u)})})}var P6n,w6n,E6n,uIe,YYi,C6n,mb,SD,mct,qYi,XYi,hct,jYi,KYi,ZYi,JYi,QYi,S6n,A6n,PH,eqi,k6n,tqi,R6n,nqi,rqi,RH,Dre,iqi,oqi,aqi,sqi,lqi,cqi,uqi;var U6n=Ce(()=>{rb();gh();Np();Jh();nl();Ta();Aa();Yo();zg();Uet();P6n=Ui(T6n(),1);ks();w6n={L:"left",R:"right",T:"top",B:"bottom"};E6n={L:B(e=>`${e},${e/2} 0,${e} 0,0`,"L"),R:B(e=>`0,${e/2} ${e},0 ${e},${e}`,"R"),T:B(e=>`0,0 ${e},0 ${e/2},${e}`,"T"),B:B(e=>`${e/2},0 ${e},${e} 0,${e}`,"B")};uIe={L:B((e,t)=>e-t+2,"L"),R:B((e,t)=>e-2,"R"),T:B((e,t)=>e-t+2,"T"),B:B((e,t)=>e-2,"B")};YYi=B(function(e){if(mb(e)){return e==="L"?"R":"L"}else{return e==="T"?"B":"T"}},"getOppositeArchitectureDirection");C6n=B(function(e){const t=e;return t==="L"||t==="R"||t==="T"||t==="B"},"isArchitectureDirection");mb=B(function(e){const t=e;return t==="L"||t==="R"},"isArchitectureDirectionX");SD=B(function(e){const t=e;return t==="T"||t==="B"},"isArchitectureDirectionY");mct=B(function(e,t){const n=mb(e)&&SD(t);const r=SD(e)&&mb(t);return n||r},"isArchitectureDirectionXY");qYi=B(function(e){const t=e[0];const n=e[1];const r=mb(t)&&SD(n);const i=SD(t)&&mb(n);return r||i},"isArchitecturePairXY");XYi=B(function(e){return e!=="LL"&&e!=="RR"&&e!=="TT"&&e!=="BB"},"isValidArchitectureDirectionPair");hct=B(function(e,t){const n=`${e}${t}`;return XYi(n)?n:void 0},"getArchitectureDirectionPair");jYi=B(function([e,t],n){const r=n[0];const i=n[1];if(mb(r)){if(SD(i)){return[e+(r==="L"?-1:1),t+(i==="T"?1:-1)]}else{return[e+(r==="L"?-1:1),t]}}else{if(mb(i)){return[e+(i==="L"?1:-1),t+(r==="T"?1:-1)]}else{return[e,t+(r==="T"?1:-1)]}}},"shiftPositionByArchitectureDirectionPair");KYi=B(function(e){if(e==="LT"||e==="TL"){return[1,1]}else if(e==="BL"||e==="LB"){return[1,-1]}else if(e==="BR"||e==="RB"){return[-1,-1]}else{return[-1,1]}},"getArchitectureDirectionXYFactors");ZYi=B(function(e,t){if(mct(e,t)){return"bend"}else if(mb(e)){return"horizontal"}return"vertical"},"getArchitectureDirectionAlignment");JYi=B(function(e){const t=e;return t.type==="service"},"isArchitectureService");QYi=B(function(e){const t=e;return t.type==="junction"},"isArchitectureJunction");S6n=B((e,t)=>{const[n,r]=[e,t].sort();return`${JSON.stringify(n)}-${JSON.stringify(r)}`},"architectureGroupAlignmentKey");A6n=B(e=>{return e.data()},"edgeData");PH=B(e=>{return e.data()},"nodeData");eqi=ka.architecture;k6n=class{constructor(){this.nodes=new Map;this.groups=new Map;this.edges=[];this.layoutHints=[];this.registeredIds=new Map;this.elements=new Map;this.diagramId="";this.setAccTitle=Ka;this.getAccTitle=is;this.setDiagramTitle=ys;this.getDiagramTitle=ss;this.getAccDescription=as;this.setAccDescription=os;this.clear()}static{B(this,"ArchitectureDB")}setDiagramId(e){this.diagramId=e}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map;this.groups=new Map;this.edges=[];this.layoutHints=[];this.registeredIds=new Map;this.dataStructures=void 0;this.elements=new Map;this.diagramId="";Da()}addService({id:e,icon:t,in:n,title:r,iconText:i}){if(this.registeredIds.has(e)){throw new Error(`The service id [${e}] is already in use by another ${this.registeredIds.get(e)}`)}if(n!==void 0){if(e===n){throw new Error(`The service [${e}] cannot be placed within itself`)}if(!this.registeredIds.has(n)){throw new Error(`The service [${e}]'s parent does not exist. Please make sure the parent is created before this service`)}if(this.registeredIds.get(n)==="node"){throw new Error(`The service [${e}]'s parent is not a group`)}}this.registeredIds.set(e,"node");this.nodes.set(e,{id:e,type:"service",icon:t,iconText:i,title:r,edges:[],in:n})}getServices(){return[...this.nodes.values()].filter(JYi)}addJunction({id:e,in:t}){if(this.registeredIds.has(e)){throw new Error(`The junction id [${e}] is already in use by another ${this.registeredIds.get(e)}`)}if(t!==void 0){if(e===t){throw new Error(`The junction [${e}] cannot be placed within itself`)}if(!this.registeredIds.has(t)){throw new Error(`The junction [${e}]'s parent does not exist. Please make sure the parent is created before this junction`)}if(this.registeredIds.get(t)==="node"){throw new Error(`The junction [${e}]'s parent is not a group`)}}this.registeredIds.set(e,"node");this.nodes.set(e,{id:e,type:"junction",edges:[],in:t})}getJunctions(){return[...this.nodes.values()].filter(QYi)}getNodes(){return[...this.nodes.values()]}getNode(e){return this.nodes.get(e)??null}addGroup({id:e,icon:t,in:n,title:r}){if(this.registeredIds.has(e)){throw new Error(`The group id [${e}] is already in use by another ${this.registeredIds.get(e)}`)}if(n!==void 0){if(e===n){throw new Error(`The group [${e}] cannot be placed within itself`)}if(!this.registeredIds.has(n)){throw new Error(`The group [${e}]'s parent does not exist. Please make sure the parent is created before this group`)}if(this.registeredIds.get(n)==="node"){throw new Error(`The group [${e}]'s parent is not a group`)}}this.registeredIds.set(e,"group");this.groups.set(e,{id:e,icon:t,title:r,in:n})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:e,rhsId:t,lhsDir:n,rhsDir:r,lhsInto:i,rhsInto:o,lhsGroup:a,rhsGroup:s,title:l}){if(!C6n(n)){throw new Error(`Invalid direction given for left hand side of edge ${e}--${t}. Expected (L,R,T,B) got ${String(n)}`)}if(!C6n(r)){throw new Error(`Invalid direction given for right hand side of edge ${e}--${t}. Expected (L,R,T,B) got ${String(r)}`)}if(!this.nodes.has(e)&&!this.groups.has(e)){throw new Error(`The left-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`)}if(!this.nodes.has(t)&&!this.groups.has(t)){throw new Error(`The right-hand id [${t}] does not yet exist. Please create the service/group before declaring an edge to it.`)}const u=this.nodes.get(e).in;const d=this.nodes.get(t).in;if(a&&u&&d&&u==d){throw new Error(`The left-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`)}if(s&&u&&d&&u==d){throw new Error(`The right-hand id [${t}] is modified to traverse the group boundary, but the edge does not pass through two groups.`)}const f={lhsId:e,lhsDir:n,lhsInto:i,lhsGroup:a,rhsId:t,rhsDir:r,rhsInto:o,rhsGroup:s,title:l};this.edges.push(f);const h=this.nodes.get(e);const m=this.nodes.get(t);if(h&&m){h.edges.push(this.edges[this.edges.length-1]);m.edges.push(this.edges[this.edges.length-1])}}getEdges(){return this.edges}addLayoutHint(e){if(e.members.length<2){throw new Error(`An align directive requires at least two members; got ${e.members.length}`)}const t=new Set;e.members.forEach(n=>{if(this.registeredIds.get(n)!=="node"){throw new Error(`align ${e.direction} references [${n}], which is not a service or junction`)}if(t.has(n)){throw new Error(`align ${e.direction} lists [${n}] more than once`)}t.add(n)});this.layoutHints.push(e)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){const e=new Map;const t=new Map;for(const[a,s]of this.nodes.entries()){const l=new Map;for(const u of s.edges){const d=this.getNode(u.lhsId)?.in;const f=this.getNode(u.rhsId)?.in;if(d&&f&&d!==f){const h=ZYi(u.lhsDir,u.rhsDir);if(h!=="bend"){e.set(S6n(d,f),h)}}if(u.lhsId===a){const h=hct(u.lhsDir,u.rhsDir);if(h){l.set(h,u.rhsId)}}else{const h=hct(u.rhsDir,u.lhsDir);if(h){l.set(h,u.lhsId)}}}t.set(a,l)}const n=new Set;const r=new Set(t.keys());const i=B(a=>{const s=new Map([[a,[0,0]]]);const l=[a];while(l.length>0){const u=l.shift();if(u){n.add(u);r.delete(u);const d=t.get(u);if(!d){throw new Error(`BFS error: adjacency list for id ${u} not found. Please report this as a bug.`)}const f=s.get(u);if(!f){throw new Error(`BFS error: position for id ${u} not found in spatial map. Please report this as a bug.`)}const[h,m]=f;d.forEach((g,x)=>{if(!n.has(g)){s.set(g,jYi([h,m],x));l.push(g)}})}}return s},"BFS");const o=[];while(r.size>0){const a=r.values().next().value;o.push(i(a))}this.dataStructures={adjList:t,spatialMaps:o,groupAlignments:e}}return this.dataStructures}setElementForId(e,t){this.elements.set(e,t)}getElementById(e){return this.elements.get(e)}getConfig(){return Cl({...eqi,...Ji().architecture})}getConfigField(e){return this.getConfig()[e]}};tqi=B((e,t)=>{mu(e,t);e.groups.map(n=>t.addGroup(n));e.services.map(n=>t.addService({...n,type:"service"}));e.junctions.map(n=>t.addJunction({...n,type:"junction"}));e.edges.map(n=>t.addEdge(n));e.alignments?.map(n=>t.addLayoutHint({direction:n.direction,members:[...n.members]}))},"populateDb");R6n={parser:{yy:void 0},parse:B(async e=>{const t=await Pf("architecture",e);wt.debug(t);const n=R6n.parser?.yy;if(!(n instanceof k6n)){throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.")}tqi(t,n)},"parse")};nqi=B(e=>` + .edge { + stroke-width: ${e.archEdgeWidth}; + stroke: ${e.archEdgeColor}; + fill: none; + } + + .arrow { + fill: ${e.archEdgeArrowColor}; + } + + .node-bkg { + fill: none; + stroke: ${e.archGroupBorderColor}; + stroke-width: ${e.archGroupBorderWidth}; + stroke-dasharray: 8; + } + .node-icon-text { + display: flex; + align-items: center; + } + + .node-icon-text > div { + color: #fff; + margin: 1px; + height: fit-content; + text-align: center; + overflow: hidden; + display: -webkit-box; + -webkit-box-orient: vertical; + } +`,"getStyles");rqi=nqi;B(pct,"withSeededRandom");RH=B(e=>{return`${e}`},"wrapIcon");Dre={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:RH('')},server:{body:RH('')},disk:{body:RH('')},internet:{body:RH('')},cloud:{body:RH('')},unknown:Zje,blank:{body:RH("")}}};iqi=B(async function(e,t,n,r){const i=n.getConfigField("padding");const o=n.getConfigField("iconSize");const a=o/2;const s=o/6;const l=s/2;await Promise.all(t.edges().map(async u=>{const{source:d,sourceDir:f,sourceArrow:h,sourceGroup:m,target:g,targetDir:x,targetArrow:w,targetGroup:_,label:C}=A6n(u);let{x:A,y:P}=u[0].sourceEndpoint();const{x:L,y:I}=u[0].midpoint();let{x:N,y:O}=u[0].targetEndpoint();const z=i+4;if(m){if(mb(f)){A+=f==="L"?-z:z}else{P+=f==="T"?-z:z+18}}if(_){if(mb(x)){N+=x==="L"?-z:z}else{O+=x==="T"?-z:z+18}}if(!m&&n.getNode(d)?.type==="junction"){if(mb(f)){A+=f==="L"?a:-a}else{P+=f==="T"?a:-a}}if(!_&&n.getNode(g)?.type==="junction"){if(mb(x)){N+=x==="L"?a:-a}else{O+=x==="T"?a:-a}}if(u[0]._private.rscratch){const U=e.insert("g");U.insert("path").attr("d",`M ${A},${P} L ${L},${I} L${N},${O} `).attr("class","edge").attr("id",`${r}-${VC(d,g,{prefix:"L"})}`);if(h){const W=mb(f)?uIe[f](A,s):A-l;const H=SD(f)?uIe[f](P,s):P-l;U.insert("polygon").attr("points",E6n[f](s)).attr("transform",`translate(${W},${H})`).attr("class","arrow")}if(w){const W=mb(x)?uIe[x](N,s):N-l;const H=SD(x)?uIe[x](O,s):O-l;U.insert("polygon").attr("points",E6n[x](s)).attr("transform",`translate(${W},${H})`).attr("class","arrow")}if(C){const W=!mct(f,x)?mb(f)?"X":"Y":"XY";let H=0;if(W==="X"){H=Math.abs(A-N)}else if(W==="Y"){H=Math.abs(P-O)/1.5}else{H=Math.abs(A-N)/2}const $=U.append("g");await Qh($,C,{useHtmlLabels:false,width:H,classes:"architecture-service-label"},Mn());$.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle");if(W==="X"){$.attr("transform","translate("+L+", "+I+")")}else if(W==="Y"){$.attr("transform","translate("+L+", "+I+") rotate(-90)")}else if(W==="XY"){const K=hct(f,x);if(K&&qYi(K)){const X=$.node().getBoundingClientRect();const[j,te]=KYi(K);$.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*j*te*45})`);const J=$.node().getBoundingClientRect();$.attr("transform",` + translate(${L}, ${I-X.height/2}) + translate(${j*J.width/2}, ${te*J.height/2}) + rotate(${-1*j*te*45}, 0, ${X.height/2}) + `)}}}}}))},"drawEdges");oqi=B(async function(e,t,n,r){const i=n.getConfigField("padding");const o=i*.75;const a=n.getConfigField("fontSize");const s=n.getConfigField("iconSize");const l=s/2;await Promise.all(t.nodes().map(async u=>{const d=PH(u);if(d.type==="group"){const{h:f,w:h,x1:m,y1:g}=u.boundingBox();const x=e.append("rect");x.attr("id",`${r}-group-${d.id}`).attr("x",m+l).attr("y",g+l).attr("width",h).attr("height",f).attr("class","node-bkg");const w=e.append("g");let _=m;let C=g;if(d.icon){const A=w.append("g");A.html(`${await nv(d.icon,{height:o,width:o,fallbackPrefix:Dre.prefix})}`);A.attr("transform","translate("+(_+l+1)+", "+(C+l+1)+")");_+=o;C+=a/2-1-2}if(d.label){const A=w.append("g");await Qh(A,d.label,{useHtmlLabels:false,width:h,classes:"architecture-service-label"},Mn());A.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start");A.attr("transform","translate("+(_+l+4)+", "+(C+l+2)+")")}n.setElementForId(d.id,x)}}))},"drawGroups");aqi=B(async function(e,t,n,r){const i=Mn();for(const o of n){const a=t.append("g");const s=e.getConfigField("iconSize");if(o.title){const f=a.append("g");await Qh(f,o.title,{useHtmlLabels:false,width:s*1.5,classes:"architecture-service-label"},i);f.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle");f.attr("transform","translate("+s/2+", "+s+")")}const l=a.append("g");if(o.icon){l.html(`${await nv(o.icon,{height:s,width:s,fallbackPrefix:Dre.prefix})}`)}else if(o.iconText){l.html(`${await nv("blank",{height:s,width:s,fallbackPrefix:Dre.prefix})}`);const f=l.append("g");const h=f.append("foreignObject").attr("width",s).attr("height",s);const m=h.append("div").attr("class","node-icon-text").attr("style",`height: ${s}px;`).append("div").html(La(o.iconText,i));const g=parseInt(window.getComputedStyle(m.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;m.attr("style",`-webkit-line-clamp: ${Math.floor((s-2)/g)};`)}else{l.append("path").attr("class","node-bkg").attr("id",`${r}-node-${o.id}`).attr("d",`M0,${s} V5 Q0,0 5,0 H${s-5} Q${s},0 ${s},5 V${s} Z`)}a.attr("id",`${r}-service-${o.id}`).attr("class","architecture-service");const{width:u,height:d}=a.node().getBBox();o.width=u;o.height=d;e.setElementForId(o.id,a)}return 0},"drawServices");sqi=B(function(e,t,n,r){n.forEach(i=>{const o=t.append("g");const a=e.getConfigField("iconSize");const s=o.append("g");s.append("rect").attr("id",`${r}-node-${i.id}`).attr("fill-opacity","0").attr("width",a).attr("height",a);o.attr("class","architecture-junction");const{width:l,height:u}=o._groups[0][0].getBBox();o.width=l;o.height=u;e.setElementForId(i.id,o)})},"drawJunctions");w$([{name:Dre.prefix,icons:Dre}]);O_.use(P6n.default);B(I6n,"addServices");B(M6n,"addJunctions");B(L6n,"positionNodes");B(D6n,"addGroups");B(F6n,"addEdges");B(N6n,"getAlignments");B(O6n,"getRelativeConstraints");B(B6n,"layoutArchitecture");lqi=B(async(e,t,n,r)=>{const i=r.db;i.setDiagramId(t);const o=i.getServices();const a=i.getJunctions();const s=i.getGroups();const l=i.getEdges();const u=i.getDataStructures();const d=Sc(t);const f=d.append("g");f.attr("class","architecture-edges");const h=d.append("g");h.attr("class","architecture-services");const m=d.append("g");m.attr("class","architecture-groups");await aqi(i,h,o,t);sqi(i,h,a,t);const g=await B6n(o,a,s,l,i,u);await iqi(f,g,i,t);await oqi(m,g,i,t);L6n(i,g);zC(void 0,d,i.getConfigField("padding"),i.getConfigField("useMaxWidth"))},"draw");cqi={draw:lqi};uqi={parser:R6n,get db(){return new k6n},renderer:cqi,styles:rqi}});var p8n={};Oo(p8n,{diagram:()=>Sqi});function H6n(){xct={}}function W6n(){let e=gqi;const{ast:t}=xct;const n=vct();if(!t){throw new Error("No data for EventModel")}t.frames.forEach((r,i)=>{const o=J6n(r,t.dataEntities,n);e=fIe(e,{$kind:V6n,index:i,frame:r,textProps:o});let a=void 0;if(i8n(r)){wt.debug(`source frame`,r.sourceFrames);a=t.frames.filter(s=>{return r.sourceFrames.some(l=>l.$refText===s.name)});a.forEach(s=>{e=fIe(e,{$kind:gct,index:i,frame:r,sourceFrame:s})})}else{e=fIe(e,{$kind:gct,index:i,frame:r})}});e={...e,sortedSwimlanesArray:_ct(e.swimlanes)};return e}function Y6n(e){xct.ast=e}function vct(){return Ic}function q6n(e){const t=e.split(".");if(t.length===2){return t[0]}return void 0}function X6n(e){const t=e.split(".");if(t.length===2){return t[1]}return e}function j6n(e,t){if(!t||t.length===0){return void 0}return Object.values(e).find(n=>n.namespace===t)}function dIe(e,t,n){return Math.max(t,...Object.keys(e).filter(r=>{const i=Number.parseInt(r);return i>t&&iNumber.parseInt(r)))+1}function K6n(e,t){const n=q6n(e.entityIdentifier);const r=j6n(t,n);switch(e.modelEntityType){case"ui":case"pcr":case"processor":if(r){return{index:r.index,label:r.namespace||Ic.labelUiAutomation}}else if(n){return{index:dIe(t,0,100),label:Ic.labelUiAutomationPrefix+n}}return{index:0,label:Ic.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":if(r){return{index:r.index,label:r.namespace||Ic.labelCommandReadModel}}else if(n){return{index:dIe(t,100,200),label:Ic.labelCommandReadModelPrefix+n}}return{index:100,label:Ic.labelCommandReadModel};case"evt":case"event":default:if(r){return{index:r.index,label:r.namespace||Ic.labelEvents}}else if(n){return{index:dIe(t,200,300),label:Ic.labelEventsPrefix+n}}return{index:200,label:Ic.labelEvents}}}function Z6n(e){const{themeVariables:t}=Ji();switch(e.modelEntityType){case"ui":return{fill:t.emUiFill??"white",stroke:t.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:t.emProcessorFill??"#edb3f6",stroke:t.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:t.emReadModelFill??"#d3f1a2",stroke:t.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:t.emCommandFill??"#bcd6fe",stroke:t.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:t.emEventFill??"#ffb778",stroke:t.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}function J6n(e,t,n){const r=Ji();const i=La(X6n(e.entityIdentifier)??"",r);let o;const a={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
    "};const s=j5(i,n.textMaxWidth,a);let l=`${s}`;if(e.dataInlineValue){o=e.dataInlineValue;o=o.substring(o.indexOf("{")+1);o=o.substring(0,o.lastIndexOf("}")-1);o=La(o,r);o=j5(o,n.textMaxWidth,a);o=o.replaceAll(" "," ")}if(e.dataReference){const g=t.find(x=>x.name===e.dataReference?.$refText);if(g){o=g.dataBlockValue;o=o.substring(o.indexOf("{\n")+2);o=o.substring(0,o.lastIndexOf("}")-1);o=La(o,r);o=j5(o,n.textMaxWidth,a);o=o.replaceAll(" "," ");o+=`
    `}}const u=o!==void 0;if(u){l+=`

    ${o}`}const d={fontSize:a.fontSize,fontWeight:a.fontWeight,fontFamily:a.fontFamily};const f=kee(l,d);const h=u?f.width/3:f.width;const m={content:l,width:h,height:f.height};wt.debug(`[${e.name}] ${e.entityIdentifier} text`,m);return m}function Q6n(e,t){const n=t;const r=Z6n(n.frame);const i={width:n.textProps.width+2*Ic.boxTextPadding,height:n.textProps.height+2*Ic.boxTextPadding};const o={$kind:$6n,frame:n.frame,index:n.index,visual:r,dimension:i,textProps:n.textProps};return[o]}function e8n(e,t,n){if(t===void 0){return Ic.contentStartX}if(t.index===e.index&&e.r){return e.r+Ic.boxPadding}if(n===void 0){return Ic.contentStartX}return n.r-Ic.boxOverlap+Ic.boxPadding}function t8n(e,t){const n=[...e.map(r=>r.r),t];return Math.max(...n)}function _ct(e){return Object.values(e).sort((t,n)=>t.index-n.index)}function n8n(e,t){const n=t;const r=K6n(n.frame,e.swimlanes);let i;if(r.index in e.swimlanes){i=e.swimlanes[r.index]}else{i={index:r.index,label:r.label,r:0,y:r.index*Ic.swimlaneMinHeight+Ic.swimlaneGap,height:Ic.swimlaneMinHeight,maxHeight:Ic.swimlaneMinHeight}}const o=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0;const a=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0;const s={width:Math.max(Ic.boxMinWidth,Math.min(Ic.boxMaxWidth,n.dimension.width))+2*Ic.boxPadding,height:Math.max(Ic.boxMinHeight,Math.min(Ic.boxMaxHeight,n.dimension.height))+2*Ic.boxPadding};const l=e8n(i,a,o);const u=l+s.width+Ic.boxPadding;const d=t8n(Object.values(e.swimlanes),u);i.r=l+s.width;i.maxHeight=Math.max(i.maxHeight,s.height);i.height=Math.max(Ic.swimlaneMinHeight,i.maxHeight)+2*Ic.swimlanePadding;const f={x:l,y:Ic.swimlanePadding+i.y,r:u,dimension:s,leftSibling:false,swimlane:i,visual:n.visual,text:n.textProps.content,frame:n.frame,index:n.index};const h={...e,boxes:[...e.boxes,f],swimlanes:{...e.swimlanes,[`${i.index}`]:i},previousSwimlaneNumber:r.index,previousFrame:n.frame,maxR:d};const m=_ct(h.swimlanes);if(m.length>0){m[0].y=0}for(let g=1;g0}function yct(e,t){if(t===void 0||t===null){return void 0}return e.find(n=>n.frame.name===t.name)}function o8n(e,t,n){if(n<0){return void 0}for(let r=n;r>=0;r--){const i=e[r];if(i.swimlane.index!==t){return i}}return void 0}function a8n(e,t){const n=t;if(WRe(n.frame)||r8n(n.index,n.frame)){return[]}const r=yct(e.boxes,n.frame);if(r===void 0){throw new Error(`Target box not found for frame ${n.frame.name}`)}let i;if(n.sourceFrame){i=yct(e.boxes,n.sourceFrame)}else{i=o8n(e.boxes,r.swimlane.index,n.index-1)}if(i===void 0){return[]}const o={$kind:G6n,frame:n.frame,index:n.index,sourceBox:i,targetBox:r};return[o]}function s8n(e,t){const n=t;const r={visual:{fill:"none",stroke:"#000"},source:{x:n.sourceBox.x,y:n.sourceBox.y},target:{x:n.targetBox.x,y:n.targetBox.y},sourceBox:n.sourceBox,targetBox:n.targetBox};const i={...e,relations:[...e.relations,r]};return i}function l8n(e,t){const n=yqi[t.$kind];if(n===void 0||n===null){return[]}const r=n(e,t);wt.debug(`decided events`,r);return r}function c8n(e,t){const n=t.reduce((r,i)=>{const o=bqi[i.$kind];if(o===void 0||o===null){return r}return o(r,i)},e);wt.debug(`evolve events`,{state:e,newState:n,events:t});return n}function fIe(e,t){const n=l8n(e,t);const r=c8n(e,n);return r}function u8n(e,t){return n=>{const r=n.swimlane.y+t.swimlanePadding;const i=e.append("g").attr("class","em-box");i.append("rect").attr("x",n.x).attr("y",r).attr("rx","3").attr("width",n.dimension.width).attr("height",n.dimension.height).attr("stroke",n.visual.stroke).attr("fill",n.visual.fill);const o=i.append("foreignObject").attr("x",n.x+t.boxPadding).attr("y",r+10).attr("width",n.dimension.width-2*t.boxPadding).attr("height",n.dimension.height-2*t.boxPadding);const a=o.append("xhtml:div").style("display","table").style("height","100%").style("width","100%");a.append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(n.text)}}function d8n(e,t){return e>t}function f8n(e,t,n,r){return i=>{const o=i.sourceBox.swimlane.y+t.swimlanePadding;const a=i.targetBox.swimlane.y+t.swimlanePadding;const s=d8n(o,a);const l=i.sourceBox.x+i.sourceBox.dimension.width*2/3;const u=i.targetBox.x+i.targetBox.dimension.width/3;let d;let f;wt.debug(`rendering relation up=${s} for `,{sourceBox:i.sourceBox,targetBox:i.targetBox});if(s){d=o;f=a+i.targetBox.dimension.height}else{d=o+i.sourceBox.dimension.height;f=a}const h=r.emRelationStroke??i.visual.stroke;e.append("path").attr("class","em-relation").attr("fill",i.visual.fill).attr("stroke",h).attr("stroke-width","1").attr("marker-end",`url(#${n})`).attr("d",`M${l} ${d} L${u} ${f}`)}}function h8n(e,t,n,r){return i=>{const o=e.append("g").attr("class","em-swimlane");const a=r.emSwimlaneBackgroundOdd??"rgb(250,250,250)";const s=r.emSwimlaneBackgroundStroke??"rgb(240,240,240)";o.append("rect").attr("x",0).attr("y",i.y).attr("rx","3").attr("width",t+n.swimlanePadding).attr("height",i.height).attr("fill",a).attr("stroke",s);o.append("text").attr("font-weight",n.swimlaneTextFontWeight).attr("x",30).attr("y",i.y+30).text(i.label)}}var V6n,$6n,gct,G6n,dqi,fqi,hqi,pqi,mqi,xct,Ic,gqi,yqi,bqi,bct,xqi,vqi,_qi,Tqi,wqi,Eqi,Cqi,Sqi;var m8n=Ce(()=>{rb();nl();Ta();Aa();Yo();zg();zg();ks();V6n="position frame";$6n="frame positioned";gct="position relation";G6n="relation positioned";dqi=B(function(e){wt.debug("options str",e)},"setOptions");fqi=B(function(){return{}},"getOptions");hqi=B(function(){H6n();Da()},"clear");B(H6n,"reset");pqi=ka.eventmodeling;mqi=B(()=>{const e=Cl({...pqi,...Ji().eventmodeling});return e},"getConfig");xct={};B(W6n,"getState");B(Y6n,"setAst");Ic={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:450-2*10,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};B(vct,"getDiagramProps");gqi={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};B(q6n,"extractNamespace");B(X6n,"extractName");B(j6n,"findSwimlaneByNamespace");B(dIe,"findNextAvailableIndex");B(K6n,"calculateSwimlaneProps");B(Z6n,"calculateEntityVisualProps");B(J6n,"calculateTextProps");B(Q6n,"decidePositionFrame");B(e8n,"calculateX");B(t8n,"calculateMaxRight");B(_ct,"sortedSwimlanesArray");B(n8n,"evolveFramePositioned");B(r8n,"isFirstFrame");B(i8n,"hasSourceFrame");B(yct,"findBoxByFrame");B(o8n,"findBoxByLineIndex");B(a8n,"decidePositionRelation");B(s8n,"evolveRelationPositioned");yqi={[V6n]:Q6n,[gct]:a8n};bqi={[$6n]:n8n,[G6n]:s8n};B(l8n,"decide");B(c8n,"evolve");B(fIe,"dispatch");bct={getConfig:mqi,setOptions:dqi,getOptions:fqi,clear:hqi,setAccTitle:Ka,getAccTitle:is,getAccDescription:as,setAccDescription:os,setDiagramTitle:ys,getDiagramTitle:ss,setAst:Y6n,getDiagramProps:vct,getState:W6n};xqi={parse:B(async e=>{const t=await Pf("eventmodeling",e);wt.debug(t);bct.setAst(t);mu(t,bct)},"parse")};if(void 0){const{it:e,expect:t,describe:n}=void 0;n("EventModeling Parser",()=>{e("should parse simple model",()=>{const r=xqi.parse(`eventmodeling + tf 01 evt Start + + `);t(r!==void 0)})})}vqi=Mn();_qi=vqi?.eventmodeling;B(u8n,"renderD3Box");B(d8n,"dirUpwards");B(f8n,"renderD3Relation");B(h8n,"renderD3Swimlane");Tqi=B(function(e,t,n,r){wt.debug("in eventmodeling renderer",e+"\n","id:",t,n);if(!_qi){throw new Error("EventModeling config not found")}const i=r.db;const{themeVariables:o,eventmodeling:a}=Mn();const s=zr(`[id="${t}"]`);const l=i.getDiagramProps();const u=i.getState();const d=`em-arrowhead-${t}`;const f=o.emArrowhead??"#000000";u.sortedSwimlanesArray.forEach(h8n(s,u.maxR,l,o));u.boxes.forEach(u8n(s,l));u.relations.forEach(f8n(s,l,d,o));const h=s.append("defs").append("marker").attr("id",d).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto");h.append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",f);nee(void 0,s,a?.padding??30,a?.useMaxWidth)},"draw");wqi={draw:Tqi};Eqi=B(e=>``,"getStyles");Cqi=Eqi;Sqi={parser:xqi,db:bct,renderer:wqi,styles:Cqi}});var E8n={};Oo(E8n,{diagram:()=>$qi});var _8n,wct,Aqi,kqi,Rqi,IH,Pqi,Iqi,Mqi,T8n,g8n,y8n,b8n,Lqi,x8n,Dqi,Fqi,Nqi,Tct,Oqi,Bqi,w8n,hIe,v8n,MH,zqi,Uqi,Vqi,$qi;var C8n=Ce(()=>{gh();nl();Ta();Aa();Yo();_8n=Ui(jo(),1);wct=function(){var e=B(function(_,C,A,P){for(A=A||{},P=_.length;P--;A[_[P]]=C);return A},"o"),t=[1,4],n=[1,14],r=[1,12],i=[1,13],o=[6,7,8],a=[1,20],s=[1,18],l=[1,19],u=[6,7,11],d=[1,6,13,14],f=[1,23],h=[1,24],m=[1,6,7,11,13,14];var g={trace:B(function _(){},"trace"),yy:{},symbols_:{"error":2,"start":3,"ishikawa":4,"spaceLines":5,"SPACELINE":6,"NL":7,"ISHIKAWA":8,"document":9,"stop":10,"EOF":11,"statement":12,"SPACELIST":13,"TEXT":14,"$accept":0,"$end":1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:B(function _(C,A,P,L,I,N,O){var z=N.length-1;switch(I){case 6:case 7:return L;break;case 15:L.addNode(N[z-1].length,N[z].trim());break;case 16:L.addNode(0,N[z].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:t},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:t},{6:n,7:[1,10],9:9,12:11,13:r,14:i},e(o,[2,3]),{1:[2,2]},e(o,[2,4]),e(o,[2,5]),{1:[2,6],6:n,12:15,13:r,14:i},{6:n,9:16,12:11,13:r,14:i},{6:a,7:s,10:17,11:l},e(u,[2,18],{14:[1,21]}),e(u,[2,16]),e(u,[2,17]),{6:a,7:s,10:22,11:l},{1:[2,7],6:n,12:15,13:r,14:i},e(d,[2,14],{7:f,11:h}),e(m,[2,8]),e(m,[2,9]),e(m,[2,10]),e(u,[2,15]),e(d,[2,13],{7:f,11:h}),e(m,[2,11]),e(m,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:B(function _(C,A){if(A.recoverable){this.trace(C)}else{var P=new Error(C);P.hash=A;throw P}},"parseError"),parse:B(function _(C){var A=this,P=[0],L=[],I=[null],N=[],O=this.table,z="",U=0,W=0,H=0,$=2,K=1;var X=N.slice.call(arguments,1);var j=Object.create(this.lexer);var te={yy:{}};for(var J in this.yy){if(Object.prototype.hasOwnProperty.call(this.yy,J)){te.yy[J]=this.yy[J]}}j.setInput(C,te.yy);te.yy.lexer=j;te.yy.parser=this;if(typeof j.yylloc=="undefined"){j.yylloc={}}var oe=j.yylloc;N.push(oe);var se=j.options&&j.options.ranges;if(typeof te.yy.parseError==="function"){this.parseError=te.yy.parseError}else{this.parseError=Object.getPrototypeOf(this).parseError}function re(yt){P.length=P.length-2*yt;I.length=I.length-yt;N.length=N.length-yt}B(re,"popStack");function ce(){var yt;yt=L.pop()||j.lex()||K;if(typeof yt!=="number"){if(yt instanceof Array){L=yt;yt=L.pop()}yt=A.symbols_[yt]||yt}return yt}B(ce,"lex");var ue,xe,be,Ie,he,ve,ge={},Ve,Le,$e,Ee;while(true){be=P[P.length-1];if(this.defaultActions[be]){Ie=this.defaultActions[be]}else{if(ue===null||typeof ue=="undefined"){ue=ce()}Ie=O[be]&&O[be][ue]}if(typeof Ie==="undefined"||!Ie.length||!Ie[0]){var tt="";Ee=[];for(Ve in O[be]){if(this.terminals_[Ve]&&Ve>$){Ee.push("'"+this.terminals_[Ve]+"'")}}if(j.showPosition){tt="Parse error on line "+(U+1)+":\n"+j.showPosition()+"\nExpecting "+Ee.join(", ")+", got '"+(this.terminals_[ue]||ue)+"'"}else{tt="Parse error on line "+(U+1)+": Unexpected "+(ue==K?"end of input":"'"+(this.terminals_[ue]||ue)+"'")}this.parseError(tt,{text:j.match,token:this.terminals_[ue]||ue,line:j.yylineno,loc:oe,expected:Ee})}if(Ie[0]instanceof Array&&Ie.length>1){throw new Error("Parse Error: multiple actions possible at state: "+be+", token: "+ue)}switch(Ie[0]){case 1:P.push(ue);I.push(j.yytext);N.push(j.yylloc);P.push(Ie[1]);ue=null;if(!xe){W=j.yyleng;z=j.yytext;U=j.yylineno;oe=j.yylloc;if(H>0){H--}}else{ue=xe;xe=null}break;case 2:Le=this.productions_[Ie[1]][1];ge.$=I[I.length-Le];ge._$={first_line:N[N.length-(Le||1)].first_line,last_line:N[N.length-1].last_line,first_column:N[N.length-(Le||1)].first_column,last_column:N[N.length-1].last_column};if(se){ge._$.range=[N[N.length-(Le||1)].range[0],N[N.length-1].range[1]]}ve=this.performAction.apply(ge,[z,W,U,te.yy,Ie[1],I,N].concat(X));if(typeof ve!=="undefined"){return ve}if(Le){P=P.slice(0,-1*Le*2);I=I.slice(0,-1*Le);N=N.slice(0,-1*Le)}P.push(this.productions_[Ie[1]][0]);I.push(ge.$);N.push(ge._$);$e=O[P[P.length-2]][P[P.length-1]];P.push($e);break;case 3:return true}}return true},"parse")};var x=function(){var _={EOF:1,parseError:B(function C(A,P){if(this.yy.parser){this.yy.parser.parseError(A,P)}else{throw new Error(A)}},"parseError"),setInput:B(function(C,A){this.yy=A||this.yy||{};this._input=C;this._more=this._backtrack=this.done=false;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};if(this.options.ranges){this.yylloc.range=[0,0]}this.offset=0;return this},"setInput"),input:B(function(){var C=this._input[0];this.yytext+=C;this.yyleng++;this.offset++;this.match+=C;this.matched+=C;var A=C.match(/(?:\r\n?|\n).*/g);if(A){this.yylineno++;this.yylloc.last_line++}else{this.yylloc.last_column++}if(this.options.ranges){this.yylloc.range[1]++}this._input=this._input.slice(1);return C},"input"),unput:B(function(C){var A=C.length;var P=C.split(/(?:\r\n?|\n)/g);this._input=C+this._input;this.yytext=this.yytext.substr(0,this.yytext.length-A);this.offset-=A;var L=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1);this.matched=this.matched.substr(0,this.matched.length-1);if(P.length-1){this.yylineno-=P.length-1}var I=this.yylloc.range;this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:P?(P.length===L.length?this.yylloc.first_column:0)+L[L.length-P.length].length-P[0].length:this.yylloc.first_column-A};if(this.options.ranges){this.yylloc.range=[I[0],I[0]+this.yyleng-A]}this.yyleng=this.yytext.length;return this},"unput"),more:B(function(){this._more=true;return this},"more"),reject:B(function(){if(this.options.backtrack_lexer){this._backtrack=true}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}return this},"reject"),less:B(function(C){this.unput(this.match.slice(C))},"less"),pastInput:B(function(){var C=this.matched.substr(0,this.matched.length-this.match.length);return(C.length>20?"...":"")+C.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:B(function(){var C=this.match;if(C.length<20){C+=this._input.substr(0,20-C.length)}return(C.substr(0,20)+(C.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:B(function(){var C=this.pastInput();var A=new Array(C.length+1).join("-");return C+this.upcomingInput()+"\n"+A+"^"},"showPosition"),test_match:B(function(C,A){var P,L,I;if(this.options.backtrack_lexer){I={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done};if(this.options.ranges){I.yylloc.range=this.yylloc.range.slice(0)}}L=C[0].match(/(?:\r\n?|\n).*/g);if(L){this.yylineno+=L.length}this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:L?L[L.length-1].length-L[L.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+C[0].length};this.yytext+=C[0];this.match+=C[0];this.matches=C;this.yyleng=this.yytext.length;if(this.options.ranges){this.yylloc.range=[this.offset,this.offset+=this.yyleng]}this._more=false;this._backtrack=false;this._input=this._input.slice(C[0].length);this.matched+=C[0];P=this.performAction.call(this,this.yy,this,A,this.conditionStack[this.conditionStack.length-1]);if(this.done&&this._input){this.done=false}if(P){return P}else if(this._backtrack){for(var N in I){this[N]=I[N]}return false}return false},"test_match"),next:B(function(){if(this.done){return this.EOF}if(!this._input){this.done=true}var C,A,P,L;if(!this._more){this.yytext="";this.match=""}var I=this._currentRules();for(var N=0;NA[0].length)){A=P;L=N;if(this.options.backtrack_lexer){C=this.test_match(P,I[N]);if(C!==false){return C}else if(this._backtrack){A=false;continue}else{return false}}else if(!this.options.flex){break}}}if(A){C=this.test_match(A,I[L]);if(C!==false){return C}return false}if(this._input===""){return this.EOF}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}},"next"),lex:B(function C(){var A=this.next();if(A){return A}else{return this.lex()}},"lex"),begin:B(function C(A){this.conditionStack.push(A)},"begin"),popState:B(function C(){var A=this.conditionStack.length-1;if(A>0){return this.conditionStack.pop()}else{return this.conditionStack[0]}},"popState"),_currentRules:B(function C(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules}else{return this.conditions["INITIAL"].rules}},"_currentRules"),topState:B(function C(A){A=this.conditionStack.length-1-Math.abs(A||0);if(A>=0){return this.conditionStack[A]}else{return"INITIAL"}},"topState"),pushState:B(function C(A){this.begin(A)},"pushState"),stateStackSize:B(function C(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":true},performAction:B(function C(A,P,L,I){var N=I;switch(L){case 0:return 6;break;case 1:return 8;break;case 2:return 8;break;case 3:return 6;break;case 4:return 7;break;case 5:return 13;break;case 6:return 14;break;case 7:return 11;break}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{"INITIAL":{"rules":[0,1,2,3,4,5,6,7],"inclusive":true}}};return _}();g.lexer=x;function w(){this.yy={}}B(w,"Parser");w.prototype=g;g.Parser=w;return new w}();wct.parser=wct;Aqi=wct;kqi=class{constructor(){this.stack=[];this.clear=this.clear.bind(this);this.addNode=this.addNode.bind(this);this.getRoot=this.getRoot.bind(this)}static{B(this,"IshikawaDB")}clear(){this.root=void 0;this.stack=[];this.baseLevel=void 0;Da()}getRoot(){return this.root}addNode(e,t){const n=Ti.sanitizeText(t,Mn());if(!this.root){this.root={text:n,children:[]};this.stack=[{level:0,node:this.root}];ys(n);return}this.baseLevel??=e;let r=e-this.baseLevel+1;if(r<=0){r=1}while(this.stack.length>1&&this.stack[this.stack.length-1].level>=r){this.stack.pop()}const i=this.stack[this.stack.length-1].node;const o={text:n,children:[]};i.children.push(o);this.stack.push({level:r,node:o})}getAccTitle(){return is()}setAccTitle(e){Ka(e)}getAccDescription(){return as()}setAccDescription(e){os(e)}getDiagramTitle(){return ss()}setDiagramTitle(e){ys(e)}};Rqi=14;IH=250;Pqi=30;Iqi=60;Mqi=5;T8n=82*Math.PI/180;g8n=Math.cos(T8n);y8n=Math.sin(T8n);b8n=B((e,t,n)=>{const r=e.node().getBBox();const i=r.width+t*2;const o=r.height+t*2;Vs(e,o,i,n);e.attr("viewBox",`${r.x-t} ${r.y-t} ${i} ${o}`)},"applyPaddedViewBox");Lqi=B((e,t,n,r)=>{const i=r.db;const o=i.getRoot();if(!o){return}const a=Mn();const{look:s,handDrawnSeed:l,themeVariables:u}=a;const d=mx(a.fontSize)[0]??Rqi;const f=s==="handDrawn";const h=o.children??[];const m=a.ishikawa?.diagramPadding??20;const g=a.ishikawa?.useMaxWidth??false;const x=Sc(t);const w=x.append("g").attr("class","ishikawa");const _=f?_8n.default.svg(x.node()):void 0;const C=_?{roughSvg:_,seed:l??0,lineColor:u?.lineColor??"#333",fillColor:u?.mainBkg??"#fff"}:void 0;const A=`ishikawa-arrow-${t}`;if(!f){w.append("defs").append("marker").attr("id",A).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow")}let P=0;let L=IH;const I=f?void 0:MH(w,P,L,P,L,"ishikawa-spine");Dqi(w,P,L,o.text,d,C);if(!h.length){if(f){MH(w,P,L,P,L,"ishikawa-spine",C)}b8n(x,m,g);return}P-=20;const N=h.filter((j,te)=>te%2===0);const O=h.filter((j,te)=>te%2===1);const z=x8n(N);const U=x8n(O);const W=z.total+U.total;let H=IH;let $=IH;if(W>0){const j=IH*2;const te=IH*.3;H=Math.max(te,j*(z.total/W));$=Math.max(te,j*(U.total/W))}const K=d*2;H=Math.max(H,z.max*K);$=Math.max($,U.max*K);L=Math.max(H,IH);if(I){I.attr("y1",L).attr("y2",L)}w.select(".ishikawa-head-group").attr("transform",`translate(0,${L})`);const X=Math.ceil(h.length/2);for(let j=0;jMath.min(J,oe.getBBox().x),Infinity)}if(f){MH(w,P,L,0,L,"ishikawa-spine",C)}else{I.attr("x1",P);const j=`url(#${A})`;w.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",j)}b8n(x,m,g)},"draw");x8n=B(e=>{const t=B(n=>n.children.reduce((r,i)=>r+1+t(i),0),"countDescendants");return e.reduce((n,r)=>{const i=t(r);n.total+=i;n.max=Math.max(n.max,i);return n},{total:0,max:0})},"sideStats");Dqi=B((e,t,n,r,i,o)=>{const a=Math.max(6,Math.floor(110/(i*.6)));const s=e.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${t},${n})`);const l=hIe(s,w8n(r,a),0,0,"ishikawa-head-label","start",i);const u=l.node().getBBox();const d=Math.max(60,u.width+6);const f=Math.max(40,u.height*2+40);const h=`M 0 ${-f/2} L 0 ${f/2} Q ${d*2.4} 0 0 ${-f/2} Z`;if(o){const m=o.roughSvg.path(h,{roughness:1.5,seed:o.seed,fill:o.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:o.lineColor,strokeWidth:2});s.insert(()=>m,":first-child").attr("class","ishikawa-head")}else{s.insert("path",":first-child").attr("class","ishikawa-head").attr("d",h)}l.attr("transform",`translate(${(d-u.width)/2-u.x+3},${-u.y-u.height/2})`)},"drawHead");Fqi=B((e,t)=>{const n=[];const r=[];const i=B((o,a,s)=>{const l=t===-1?[...o].reverse():o;for(const u of l){const d=n.length;const f=u.children??[];n.push({depth:s,text:w8n(u.text,15),parentIndex:a,childCount:f.length});if(s%2===0){r.push(d);if(f.length){i(f,d,s+1)}}else{if(f.length){i(f,d,s+1)}r.push(d)}}},"walk");i(e,-1,2);return{entries:n,yOrder:r}},"flattenTree");Nqi=B((e,t,n,r,i,o,a)=>{const s=e.append("g").attr("class","ishikawa-label-group");const l=hIe(s,t,n,r+11*i,"ishikawa-label cause","middle",o);const u=l.node().getBBox();if(a){const d=a.roughSvg.rectangle(u.x-20,u.y-2,u.width+40,u.height+4,{roughness:1.5,seed:a.seed,fill:a.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:a.lineColor,strokeWidth:2});s.insert(()=>d,":first-child").attr("class","ishikawa-label-box")}else{s.insert("rect",":first-child").attr("class","ishikawa-label-box").attr("x",u.x-20).attr("y",u.y-2).attr("width",u.width+40).attr("height",u.height+4)}},"drawCauseLabel");Tct=B((e,t,n,r,i,o)=>{const a=Math.sqrt(r*r+i*i);if(a===0){return}const s=r/a;const l=i/a;const u=6;const d=-l*u;const f=s*u;const h=t;const m=n;const g=`M ${h} ${m} L ${h-s*u*2+d} ${m-l*u*2+f} L ${h-s*u*2-d} ${m-l*u*2-f} Z`;const x=o.roughSvg.path(g,{roughness:1,seed:o.seed,fill:o.lineColor,fillStyle:"solid",stroke:o.lineColor,strokeWidth:1});e.append(()=>x)},"drawArrowMarker");Oqi=B((e,t,n,r,i,o,a,s)=>{const l=t.children??[];const u=o*(l.length?1:.2);const d=-g8n*u;const f=y8n*u*i;const h=n+d;const m=r+f;MH(e,n,r,h,m,"ishikawa-branch",s);if(s){Tct(e,n,r,n-h,r-m,s)}Nqi(e,t.text,h,m,i,a,s);if(!l.length){return}const{entries:g,yOrder:x}=Fqi(l,i);const w=g.length;const _=new Array(w);for(const[I,N]of x.entries()){_[N]=r+f*((I+1)/(w+1))}const C=new Map;C.set(-1,{x0:n,y0:r,x1:h,y1:m,childCount:l.length,childrenDrawn:0});const A=-g8n;const P=y8n*i;const L=i<0?"ishikawa-label up":"ishikawa-label down";for(const[I,N]of g.entries()){const O=_[I];const z=C.get(N.parentIndex);const U=e.append("g").attr("class","ishikawa-sub-group");let W=0;let H=0;let $=0;if(N.depth%2===0){const K=z.y1-z.y0;W=v8n(z.x0,z.x1,K?(O-z.y0)/K:.5);H=O;$=W-(N.childCount>0?Iqi+N.childCount*Mqi:Pqi);MH(U,W,O,$,O,"ishikawa-sub-branch",s);if(s){Tct(U,W,O,1,0,s)}hIe(U,N.text,$,O,"ishikawa-label align","end",a)}else{const K=z.childrenDrawn++;W=v8n(z.x0,z.x1,(z.childCount-K)/(z.childCount+1));H=z.y0;$=W+A*((O-H)/P);MH(U,W,H,$,O,"ishikawa-sub-branch",s);if(s){Tct(U,W,H,W-$,H-O,s)}hIe(U,N.text,$,O,L,"end",a)}if(N.childCount>0){C.set(I,{x0:W,y0:H,x1:$,y1:O,childCount:N.childCount,childrenDrawn:0})}}},"drawBranch");Bqi=B(e=>e.split(/|\n/),"splitLines");w8n=B((e,t)=>{if(e.length<=t){return e}const n=[];for(const r of e.split(/\s+/)){const i=n.length-1;if(i>=0&&n[i].length+1+r.length<=t){n[i]+=" "+r}else{n.push(r)}}return n.join("\n")},"wrapText");hIe=B((e,t,n,r,i,o,a)=>{const s=Bqi(t);const l=a*1.05;const u=e.append("text").attr("class",i).attr("text-anchor",o).attr("x",n).attr("y",r-(s.length-1)*l/2);for(const[d,f]of s.entries()){u.append("tspan").attr("x",n).attr("dy",d===0?0:l).text(f)}return u},"drawMultilineText");v8n=B((e,t,n)=>e+(t-e)*n,"lerp");MH=B((e,t,n,r,i,o,a)=>{if(a){const s=a.roughSvg.line(t,n,r,i,{roughness:1.5,seed:a.seed,stroke:a.lineColor,strokeWidth:2});e.append(()=>s).attr("class",o);return void 0}return e.append("line").attr("class",o).attr("x1",t).attr("y1",n).attr("x2",r).attr("y2",i)},"drawLine");zqi={draw:Lqi};Uqi=B(e=>` +.ishikawa .ishikawa-spine, +.ishikawa .ishikawa-branch, +.ishikawa .ishikawa-sub-branch { + stroke: ${e.lineColor}; + stroke-width: 2; + fill: none; +} + +.ishikawa .ishikawa-sub-branch { + stroke-width: 1; +} + +.ishikawa .ishikawa-arrow { + fill: ${e.lineColor}; +} + +.ishikawa .ishikawa-head { + fill: ${e.mainBkg}; + stroke: ${e.lineColor}; + stroke-width: 2; +} + +.ishikawa .ishikawa-label-box { + fill: ${e.mainBkg}; + stroke: ${e.lineColor}; + stroke-width: 2; +} + +.ishikawa text { + font-family: ${e.fontFamily}; + font-size: ${e.fontSize}; + fill: ${e.textColor}; +} + +.ishikawa .ishikawa-head-label { + font-weight: 600; + text-anchor: middle; + dominant-baseline: middle; + font-size: 14px; +} + +.ishikawa .ishikawa-label { + text-anchor: end; +} + +.ishikawa .ishikawa-label.cause { + text-anchor: middle; + dominant-baseline: middle; +} + +.ishikawa .ishikawa-label.align { + text-anchor: end; + dominant-baseline: middle; +} + +.ishikawa .ishikawa-label.up { + dominant-baseline: baseline; +} + +.ishikawa .ishikawa-label.down { + dominant-baseline: hanging; +} +`,"getStyles");Vqi=Uqi;$qi={parser:Aqi,get db(){return new kqi},renderer:zqi,styles:Vqi}});function pIe(e,t){const n=Hqi(e);const r=n.filter(s=>Gqi(s,e));let i=0;let o=0;const a=[];if(r.length>1){const s=P8n(r);for(let u=0;ud.angle-u.angle);let l=r[r.length-1];for(let u=0;ug.radius*2){A=g.radius*2}if(h==null||h.width>A){h={circle:g,width:A,p1:d,p2:l,large:A>g.radius,sweep:true}}}}if(h!=null){a.push(h);i+=Sct(h.circle.radius,h.width);l=d}}}else{let s=e[0];for(let u=1;uMath.abs(s.radius-e[u].radius)){l=true;break}}if(l){i=o=0}else{i=s.radius*s.radius*Math.PI;a.push({circle:s,p1:{x:s.x,y:s.y+s.radius},p2:{x:s.x-k8n,y:s.y+s.radius},width:s.radius*2,large:true,sweep:true})}}o/=2;if(t){t.area=i+o;t.arcArea=i;t.polygonArea=o;t.arcs=a;t.innerPoints=r;t.intersectionPoints=n}return i+o}function Gqi(e,t){return t.every(n=>Fx(e,n)=e+t){return 0}if(n<=Math.abs(e-t)){return Math.PI*Math.min(e,t)*Math.min(e,t)}const r=e-(n*n-t*t+e*e)/(2*n);const i=t-(n*n-e*e+t*t)/(2*n);return Sct(e,r)+Sct(t,i)}function R8n(e,t){const n=Fx(e,t);const r=e.radius;const i=t.radius;if(n>=r+i||n<=Math.abs(r-i)){return[]}const o=(r*r-i*i+n*n)/(2*n);const a=Math.sqrt(r*r-o*o);const s=e.x+o*(t.x-e.x)/n;const l=e.y+o*(t.y-e.y)/n;const u=-(t.y-e.y)*(a/n);const d=-(t.x-e.x)*(a/n);return[{x:s+u,y:l-d},{x:s-u,y:l+d}]}function P8n(e){const t={x:0,y:0};for(const n of e){t.x+=n.x;t.y+=n.y}t.x/=e.length;t.y/=e.length;return t}function Wqi(e,t,n,r){r=r||{};const i=r.maxIterations||100;const o=r.tolerance||1e-10;const a=e(t);const s=e(n);let l=n-t;if(a*s>0){throw"Initial bisect points must have opposite signs"}if(a===0)return t;if(s===0)return n;for(let u=0;u=0){t=d}if(Math.abs(l)Act(t))}function LH(e,t){let n=0;for(let r=0;rL.fx-I.fx;const _=t.slice();const C=t.slice();const A=t.slice();const P=t.slice();for(let L=0;L{const z=O.slice();z.fx=O.fx;z.id=O.id;return z});N.sort((O,z)=>O.id-z.id);n.history.push({x:g[0].slice(),fx:g[0].fx,simplex:N})}h=0;for(let N=0;N=g[m-1].fx){let N=false;if(C.fx>I.fx){yP(A,1+d,_,-d,I);A.fx=e(A);if(A.fx=1)break;for(let O=1;Os+o*i*l||u>=w){x=i}else{if(Math.abs(f)<=-a*l){return i}if(f*(x-g)>=0){x=g}g=i;w=u}}return 0}for(let g=0;g<10;++g){yP(r.x,1,n.x,i,t);u=r.fx=e(r.x,r.fxprime);f=LH(r.fxprime,t);if(u>s+o*i*l||g&&u>=d){return m(h,i,d)}if(Math.abs(f)<=-a*l){return i}if(f>=0){return m(i,h,u)}d=u;h=i;i*=2}return i}function qqi(e,t,n){let r={x:t.slice(),fx:0,fxprime:t.slice()};let i={x:t.slice(),fx:0,fxprime:t.slice()};const o=t.slice();let a;let s;let l=1;let u;n=n||{};u=n.maxIterations||t.length*20;r.fx=e(r.x,r.fxprime);a=r.fxprime.slice();Rct(a,r.fxprime,-1);for(let d=0;d{const f={};for(let h=0;hMct(e,t,r)-n,0,e+t)}function Xqi(e,t={}){const n=t.distinct;const r=e.map(s=>Object.assign({},s));function i(s){return s.join(";")}if(n){const s=new Map;for(const l of r){for(let u=0;us===l?0:so.sets.length===2).forEach(o=>{const a=n[o.sets[0]];const s=n[o.sets[1]];const l=Math.sqrt(t[a].size/Math.PI);const u=Math.sqrt(t[s].size/Math.PI);const d=Pct(l,u,o.size);r[a][s]=r[s][a]=d;let f=0;if(o.size+1e-10>=Math.min(t[a].size,t[s].size)){f=1}else if(o.size<=1e-10){f=-1}i[a][s]=i[s][a]=f});return{distances:r,constraints:i}}function Kqi(e,t,n,r){for(let o=0;o0&&g<=f||h<0&&g>=f){continue}i+=2*x*x;t[2*o]+=4*x*(a-u);t[2*o+1]+=4*x*(s-d);t[2*l]+=4*x*(u-a);t[2*l+1]+=4*x*(d-s)}}return i}function Zqi(e,t={}){let n=Qqi(e,t);const r=t.lossFunction||DH;if(e.length>=8){const i=Jqi(e,t);const o=r(i,e);const a=r(n,e);if(o+1e-8h.map(m=>m/s));const l=(h,m)=>Kqi(h,m,o,a);let u=null;for(let h=0;hf.sets.length===2);for(const f of e){let h=f.weight!=null?f.weight:1;const m=f.sets[0];const g=f.sets[1];if(f.size+L8n>=Math.min(r[m].size,r[g].size)){h=0}i[m].push({set:g,size:f.size,weight:h});i[g].push({set:m,size:f.size,weight:h})}const o=[];Object.keys(i).forEach(f=>{let h=0;for(let m=0;me[a]))}const o=r.weight!=null?r.weight:1;n+=o*(i-r.size)*(i-r.size)}return n}function D8n(e,t){let n=0;for(const r of t){if(r.sets.length===1){continue}let i;if(r.sets.length===2){const s=e[r.sets[0]];const l=e[r.sets[1]];i=Mct(s.radius,l.radius,Fx(s,l))}else{i=pIe(r.sets.map(s=>e[s]))}const o=r.weight!=null?r.weight:1;const a=Math.log((i+1)/(r.size+1));n+=o*a*a}return n}function eXi(e,t,n){if(n==null){e.sort((i,o)=>o.radius-i.radius)}else{e.sort(n)}if(e.length>0){const i=e[0].x;const o=e[0].y;for(const a of e){a.x-=i;a.y-=o}}if(e.length===2){const i=Fx(e[0],e[1]);if(i1){const i=Math.atan2(e[1].x,e[1].y)-t;const o=Math.cos(i);const a=Math.sin(i);for(const s of e){const l=s.x;const u=s.y;s.x=o*l-a*u;s.y=a*l+o*u}}if(e.length>2){let i=Math.atan2(e[2].x,e[2].y)-t;while(i<0){i+=2*Math.PI}while(i>2*Math.PI){i-=2*Math.PI}if(i>Math.PI){const o=e[1].y/(1e-10+e[1].x);for(const a of e){var r=(a.x+o*a.y)/(1+o*o);a.x=2*r-a.x;a.y=2*r*o-a.y}}}}function tXi(e){e.forEach(i=>{i.parent=i});function t(i){if(i.parent!==i){i.parent=t(i.parent)}return i.parent}function n(i,o){const a=t(i);const s=t(o);a.parent=s}for(let i=0;i{delete i.parent});return Array.from(r.values())}function Ict(e){const t=n=>{const r=e.reduce((o,a)=>Math.max(o,a[n]+a.radius),Number.NEGATIVE_INFINITY);const i=e.reduce((o,a)=>Math.min(o,a[n]-a.radius),Number.POSITIVE_INFINITY);return{max:r,min:i}};return{xRange:t("x"),yRange:t("y")}}function F8n(e,t,n){if(t==null){t=Math.PI/2}let r=B8n(e).map(u=>Object.assign({},u));const i=tXi(r);for(const u of i){eXi(u,t,n);const d=Ict(u);u.size=(d.xRange.max-d.xRange.min)*(d.yRange.max-d.yRange.min);u.bounds=d}i.sort((u,d)=>d.size-u.size);r=i[0];let o=r.bounds;const a=(o.xRange.max-o.xRange.min)/50;function s(u,d,f){if(!u){return}const h=u.bounds;let m;let g;if(d){m=o.xRange.max-h.xRange.min+a}else{m=o.xRange.max-h.xRange.max;const x=(h.xRange.max-h.xRange.min)/2-(o.xRange.max-o.xRange.min)/2;if(x<0){m+=x}}if(f){g=o.yRange.max-h.yRange.min+a}else{g=o.yRange.max-h.yRange.max;const x=(h.yRange.max-h.yRange.min)/2-(o.yRange.max-o.yRange.min)/2;if(x<0){g+=x}}for(const x of u){x.x+=m;x.y+=g;r.push(x)}}let l=1;while(l({radius:d*m.radius,x:r+f+(m.x-a.min)*d,y:r+h+(m.y-s.min)*d,setid:m.setid})))}function O8n(e){const t={};for(const n of e){t[n.setid]=n}return t}function B8n(e){const t=Object.keys(e);return t.map(n=>Object.assign(e[n],{setid:n}))}function z8n(e={}){let t=false,n=600,r=350,i=15,o=1e3,a=Math.PI/2,s=true,l=null,u=true,d=true,f=null,h=null,m=false,g=null,x=e&&e.symmetricalTextCentre?e.symmetricalTextCentre:false,w={},_=e&&e.colourScheme?e.colourScheme:e&&e.colorScheme?e.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],C=0,A=function(N){if(N in w){return w[N]}var O=w[N]=_[C];C+=1;if(C>=_.length){C=0}return O},P=M8n,L=DH;function I(N){let O=N.datum();const z=new Set;O.forEach(he=>{if(he.size==0&&he.sets.length==1){z.add(he.sets[0])}});O=O.filter(he=>!he.sets.some(ve=>z.has(ve)));let U={};let W={};if(O.length>0){let he=P(O,{lossFunction:L,distinct:m});if(s){he=F8n(he,a,h)}U=N8n(he,n,r,i,l);W=V8n(U,O,x)}const H={};O.forEach(he=>{if(he.label){H[he.sets]=he.label}});function $(he){if(he.sets in H){return H[he.sets]}if(he.sets.length==1){return""+he.sets[0]}}N.selectAll("svg").data([U]).enter().append("svg");const K=N.select("svg");if(t){K.attr("viewBox",`0 0 ${n} ${r}`)}else{K.attr("width",n).attr("height",r)}const X={};let j=false;K.selectAll(".venn-area path").each(function(he){const ve=this.getAttribute("d");if(he.sets.length==1&&ve&&!m){j=true;X[he.sets[0]]=iXi(ve)}});function te(he){return ve=>{const ge=he.sets.map(Ve=>{let Le=X[Ve];let $e=U[Ve];if(!Le){Le={x:n/2,y:r/2,radius:1}}if(!$e){$e={x:n/2,y:r/2,radius:1}}return{x:Le.x*(1-ve)+$e.x*ve,y:Le.y*(1-ve)+$e.y*ve,radius:Le.radius*(1-ve)+$e.radius*ve}});return A8n(ge,g)}}const J=K.selectAll(".venn-area").data(O,he=>he.sets);const oe=J.enter().append("g").attr("class",he=>`venn-area venn-${he.sets.length==1?"circle":"intersection"}${he.colour||he.color?" venn-coloured":""}`).attr("data-venn-sets",he=>he.sets.join("_"));const se=oe.append("path");const re=oe.append("text").attr("class","label").text(he=>$(he)).attr("text-anchor","middle").attr("dy",".35em").attr("x",n/2).attr("y",r/2);if(d){se.style("fill-opacity","0").filter(he=>he.sets.length==1).style("fill",he=>he.colour?he.colour:he.color?he.color:A(he.sets)).style("fill-opacity",".25");re.style("fill",he=>{if(he.colour||he.color){return"#FFF"}if(e.textFill){return e.textFill}return he.sets.length==1?A(he.sets):"#444"})}function ce(he){if(typeof he.transition==="function"){return he.transition("venn").duration(o)}return he}let ue=N;if(j&&typeof ue.transition==="function"){ue=ce(N);ue.selectAll("path").attrTween("d",te)}else{ue.selectAll("path").attr("d",he=>A8n(he.sets.map(ve=>U[ve])),g)}const xe=ue.selectAll("text").filter(he=>he.sets in W).text(he=>$(he)).attr("x",he=>Math.floor(W[he.sets].x)).attr("y",he=>Math.floor(W[he.sets].y));if(u){if(j){if("on"in xe){xe.on("end",Ect(U,$))}else{xe.each("end",Ect(U,$))}}else{xe.each(Ect(U,$))}}const be=ce(J.exit()).remove();if(typeof J.transition==="function"){be.selectAll("path").attrTween("d",te)}const Ie=be.selectAll("text").attr("x",n/2).attr("y",r/2);if(f!==null){re.style("font-size","0px");xe.style("font-size",f);Ie.style("font-size","0px")}return{circles:U,textCentres:W,nodes:J,enter:oe,update:ue,exit:be}}I.wrap=function(N){if(!arguments.length)return u;u=N;return I};I.useViewBox=function(){t=true;return I};I.width=function(N){if(!arguments.length)return n;n=N;return I};I.height=function(N){if(!arguments.length)return r;r=N;return I};I.padding=function(N){if(!arguments.length)return i;i=N;return I};I.distinct=function(N){if(!arguments.length)return m;m=N;return I};I.colours=function(N){if(!arguments.length)return A;A=N;return I};I.colors=function(N){if(!arguments.length)return A;A=N;return I};I.fontSize=function(N){if(!arguments.length)return f;f=N;return I};I.round=function(N){if(!arguments.length)return g;g=N;return I};I.duration=function(N){if(!arguments.length)return o;o=N;return I};I.layoutFunction=function(N){if(!arguments.length)return P;P=N;return I};I.normalize=function(N){if(!arguments.length)return s;s=N;return I};I.scaleToFit=function(N){if(!arguments.length)return l;l=N;return I};I.styled=function(N){if(!arguments.length)return d;d=N;return I};I.orientation=function(N){if(!arguments.length)return a;a=N;return I};I.orientationOrder=function(N){if(!arguments.length)return h;h=N;return I};I.lossFunction=function(N){if(!arguments.length)return L;L=N==="default"?DH:N==="logRatio"?D8n:N;return I};return I}function Ect(e,t){return function(n){const r=this;const i=e[n.sets[0]].radius||50;const o=t(n)||"";const a=o.split(/\s+/).reverse();const s=3;const l=(o.length+a.length)/s;let u=a.pop();let d=[u];let f=0;const h=1.1;r.textContent=null;const m=[];function g(A){const P=r.ownerDocument.createElementNS(r.namespaceURI,"tspan");P.textContent=A;m.push(P);r.append(P);return P}let x=g(u);while(true){u=a.pop();if(!u){break}d.push(u);const A=d.join(" ");x.textContent=A;if(A.length>l&&x.getComputedTextLength()>i){d.pop();x.textContent=d.join(" ");d=[u];x=g(u);f++}}const w=.35-f*h/2;const _=r.getAttribute("x");const C=r.getAttribute("y");m.forEach((A,P)=>{A.setAttribute("x",_);A.setAttribute("y",C);A.setAttribute("dy",`${w+P*h}em`)})}}function Cct(e,t,n){let r=t[0].radius-Fx(t[0],e);for(let i=1;i=o){i=r[d];o=f}}const a=I8n(d=>-1*Cct({x:d[0],y:d[1]},e,t),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x;const s={x:n?0:a[0],y:a[1]};let l=true;for(const d of e){if(Fx(s,d)>d.radius){l=false;break}}for(const d of t){if(Fx(s,d)d.p1))}function nXi(e){const t={};const n=Object.keys(e);for(const r of n){t[r]=[]}for(let r=0;r0){console.log("WARNING: area "+a+" not represented on screen")}}return r}function rXi(e,t,n){const r=[];r.push("\nM",e,t);r.push("\nm",-n,0);r.push("\na",n,n,0,1,0,n*2,0);r.push("\na",n,n,0,1,0,-n*2,0);return r.join(" ")}function iXi(e){const t=e.split(" ");return{x:Number.parseFloat(t[1]),y:Number.parseFloat(t[2]),radius:-Number.parseFloat(t[4])}}function $8n(e){if(e.length===0){return[]}const t={};pIe(e,t);return t.arcs}function G8n(e,t){if(e.length===0){return"M 0 0"}const n=Math.pow(10,t||0);const r=t!=null?o=>Math.round(o*n)/n:o=>o;if(e.length==1){const o=e[0].circle;return rXi(r(o.x),r(o.y),r(o.radius))}const i=["\nM",r(e[0].p2.x),r(e[0].p2.y)];for(const o of e){const a=r(o.circle.radius);i.push("\nA",a,a,0,o.large?1:0,o.sweep?1:0,r(o.p1.x),r(o.p1.y))}return i.join(" ")}function A8n(e,t){return G8n($8n(e),t)}function H8n(e,t={}){const{lossFunction:n,layoutFunction:r=M8n,normalize:i=true,orientation:o=Math.PI/2,orientationOrder:a,width:s=600,height:l=350,padding:u=15,scaleToFit:d=false,symmetricalTextCentre:f=false,distinct:h,round:m=2}=t;let g=r(e,{lossFunction:n==="default"||!n?DH:n==="logRatio"?D8n:n,distinct:h});if(i){g=F8n(g,o,a)}const x=N8n(g,s,l,u,d);const w=V8n(x,e,f);const _=new Map(Object.keys(x).map(P=>[P,{set:P,x:x[P].x,y:x[P].y,radius:x[P].radius}]));const C=e.map(P=>{const L=P.sets.map(O=>_.get(O));const I=$8n(L);const N=G8n(I,m);return{circles:L,arcs:I,path:N,area:P,has:new Set(P.sets)}});function A(P){let L="";for(const I of C){if(I.has.size>P.length&&P.every(N=>I.has.has(N))){L+=" "+I.path}}return L}return C.map(({circles:P,arcs:L,path:I,area:N})=>{return{data:N,text:w[N.sets],circles:P,arcs:L,path:I,distinctPath:I+A(N.sets)}})}var k8n,L8n;var W8n=Ce(()=>{k8n=1e-10;L8n=1e-10});var Z8n={};Oo(Z8n,{diagram:()=>CXi});function Y8n(){return Cl(bXi,Ji().venn)}function X8n(e){const t=new Map;for(const n of e){const r=n.targets.join("|");const i=t.get(r);if(i){Object.assign(i,n.styles)}else{t.set(r,{...n.styles})}}return t}function AD(e){return e.join("|")}function j8n(e,t,n,r,i,o){const a=e?.useDebugLayout??false;const s=n.select("svg");const l=s.append("g").attr("class","venn-text-nodes");const u=new Map;for(const d of r){const f=AD(d.sets);const h=u.get(f);if(h){h.push(d)}else{u.set(f,[d])}}for(const[d,f]of u.entries()){const h=t.get(d);if(!h?.text){continue}const m=h.text.x;const g=h.text.y;const x=Math.min(...h.circles.map(K=>K.radius));const w=Math.min(...h.circles.map(K=>K.radius-Math.hypot(m-K.x,g-K.y)));let _=Number.isFinite(w)?Math.max(0,w):0;if(_===0&&Number.isFinite(x)){_=x*.6}const C=l.append("g").attr("class","venn-text-area").attr("font-size",`${40*i}px`);if(a){C.append("circle").attr("class","venn-text-debug-circle").attr("cx",m).attr("cy",g).attr("r",_).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`)}const A=Math.max(80*i,_*2*.95);const P=Math.max(60*i,_*2*.95);const L=h.data.label&&h.data.label.length>0;const I=L?Math.min(32*i,_*.25):0;const N=I+(f.length<=2?30*i:0);const O=m-A/2;const z=g-P/2+N;const U=Math.max(1,Math.ceil(Math.sqrt(f.length)));const W=Math.max(1,Math.ceil(f.length/U));const H=A/U;const $=P/W;for(const[K,X]of f.entries()){const j=K%U;const te=Math.floor(K/U);const J=O+H*(j+.5);const oe=z+$*(te+.5);if(a){C.append("rect").attr("class","venn-text-debug-cell").attr("x",O+H*j).attr("y",z+$*te).attr("width",H).attr("height",$).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`)}const se=H*.9;const re=$*.9;const ce=C.append("foreignObject").attr("class","venn-text-node-fo").attr("width",se).attr("height",re).attr("x",J-se/2).attr("y",oe-re/2).attr("overflow","visible");const ue=o.get(X.id)?.color;const xe=ce.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text(X.label??X.id);if(ue){xe.style("color",ue)}}}}function K8n(e){const t=new Set(e.map(i=>[...i.sets].sort().join("|")));const n=new Map(e.filter(i=>i.sets.length===1&&i.size!==void 0).map(i=>[i.sets[0],i.size]));const r=[];for(const i of e){if(i.sets.length<3){continue}const o=[...i.sets].sort();for(let a=0;a0?[...e,...r]:e}var q8n,Lct,aXi,Dct,Fct,Nct,Oct,Bct,zct,sXi,lXi,Fre,cXi,uXi,dXi,fXi,mIe,hXi,pXi,mXi,gXi,yXi,bXi,xXi,vXi,_Xi,TXi,wXi,EXi,CXi;var J8n=Ce(()=>{gh();nl();Ta();Aa();Yo();ks();qh();W8n();q8n=Ui(jo(),1);Lct=function(){var e=B(function(C,A,P,L){for(P=P||{},L=C.length;L--;P[C[L]]=A);return P},"o"),t=[5,8],n=[7,8,11,12,17,19,22,24],r=[1,17],i=[1,18],o=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],a=[1,31],s=[1,39],l=[7,8,11,12,17,19,22,24,27],u=[1,57],d=[1,56],f=[1,58],h=[1,59],m=[1,60],g=[7,8,11,12,16,17,19,20,22,24,27,31,32,33];var x={trace:B(function C(){},"trace"),yy:{},symbols_:{"error":2,"start":3,"optNewlines":4,"VENN":5,"document":6,"EOF":7,"NEWLINE":8,"line":9,"statement":10,"TITLE":11,"SET":12,"identifier":13,"BRACKET_LABEL":14,"COLON":15,"NUMERIC":16,"UNION":17,"identifierList":18,"TEXT":19,"IDENTIFIER":20,"STRING":21,"INDENT_TEXT":22,"indentedTextTail":23,"STYLE":24,"stylesOpt":25,"styleField":26,"COMMA":27,"styleValue":28,"valueTokens":29,"valueToken":30,"HEXCOLOR":31,"RGBCOLOR":32,"RGBACOLOR":33,"$accept":0,"$end":1},terminals_:{2:"error",5:"VENN",7:"EOF",8:"NEWLINE",11:"TITLE",12:"SET",14:"BRACKET_LABEL",15:"COLON",16:"NUMERIC",17:"UNION",19:"TEXT",20:"IDENTIFIER",21:"STRING",22:"INDENT_TEXT",24:"STYLE",27:"COMMA",31:"HEXCOLOR",32:"RGBCOLOR",33:"RGBACOLOR"},productions_:[0,[3,4],[4,0],[4,2],[6,0],[6,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,5],[10,2],[10,3],[10,4],[10,5],[10,3],[10,3],[10,3],[10,4],[10,4],[10,2],[10,3],[23,1],[23,1],[23,1],[23,2],[23,2],[25,1],[25,3],[26,3],[28,1],[28,1],[29,1],[29,2],[30,1],[30,1],[30,1],[30,1],[30,1],[18,1],[18,3],[13,1],[13,1]],performAction:B(function C(A,P,L,I,N,O,z){var U=O.length-1;switch(N){case 1:return O[U-1];break;case 2:case 3:case 4:this.$=[];break;case 5:O[U-1].push(O[U]);this.$=O[U-1];break;case 6:this.$=[];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:this.$=O[U];break;case 8:I.setDiagramTitle(O[U].substr(6));this.$=O[U].substr(6);break;case 9:I.addSubsetData([O[U]],void 0,void 0);if(I.setIndentMode){I.setIndentMode(true)}break;case 10:I.addSubsetData([O[U-1]],O[U],void 0);if(I.setIndentMode){I.setIndentMode(true)}break;case 11:I.addSubsetData([O[U-2]],void 0,parseFloat(O[U]));if(I.setIndentMode){I.setIndentMode(true)}break;case 12:I.addSubsetData([O[U-3]],O[U-2],parseFloat(O[U]));if(I.setIndentMode){I.setIndentMode(true)}break;case 13:if(O[U].length<2){throw new Error("union requires multiple identifiers")}if(I.validateUnionIdentifiers){I.validateUnionIdentifiers(O[U])}I.addSubsetData(O[U],void 0,void 0);if(I.setIndentMode){I.setIndentMode(true)}break;case 14:if(O[U-1].length<2){throw new Error("union requires multiple identifiers")}if(I.validateUnionIdentifiers){I.validateUnionIdentifiers(O[U-1])}I.addSubsetData(O[U-1],O[U],void 0);if(I.setIndentMode){I.setIndentMode(true)}break;case 15:if(O[U-2].length<2){throw new Error("union requires multiple identifiers")}if(I.validateUnionIdentifiers){I.validateUnionIdentifiers(O[U-2])}I.addSubsetData(O[U-2],void 0,parseFloat(O[U]));if(I.setIndentMode){I.setIndentMode(true)}break;case 16:if(O[U-3].length<2){throw new Error("union requires multiple identifiers")}if(I.validateUnionIdentifiers){I.validateUnionIdentifiers(O[U-3])}I.addSubsetData(O[U-3],O[U-2],parseFloat(O[U]));if(I.setIndentMode){I.setIndentMode(true)}break;case 17:case 18:case 19:I.addTextData(O[U-1],O[U],void 0);break;case 20:case 21:I.addTextData(O[U-2],O[U-1],O[U]);break;case 23:I.addStyleData(O[U-1],O[U]);break;case 24:case 25:case 26:var W=I.getCurrentSets();if(!W)throw new Error("text requires set");I.addTextData(W,O[U],void 0);break;case 27:case 28:var W=I.getCurrentSets();if(!W)throw new Error("text requires set");I.addTextData(W,O[U-1],O[U]);break;case 29:case 41:this.$=[O[U]];break;case 30:case 42:this.$=[...O[U-2],O[U]];break;case 31:this.$=[O[U-2],O[U]];break;case 33:this.$=O[U].join(" ");break;case 34:this.$=[O[U]];break;case 35:O[U-1].push(O[U]);this.$=O[U-1];break;case 43:case 44:this.$=O[U];break}},"anonymous"),table:[e(t,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},e(n,[2,4],{6:5}),e(t,[2,3]),{7:[1,6],8:[1,8],9:7,10:9,11:[1,10],12:[1,11],17:[1,12],19:[1,13],22:[1,14],24:[1,15]},{1:[2,1]},e(n,[2,5]),e(n,[2,6]),e(n,[2,7]),e(n,[2,8]),{13:16,20:r,21:i},{13:20,18:19,20:r,21:i},{13:20,18:21,20:r,21:i},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:r,21:i},e(n,[2,9],{14:[1,27],15:[1,28]}),e(o,[2,43]),e(o,[2,44]),e(n,[2,13],{14:[1,29],15:[1,30],27:a}),e(o,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:a},e(n,[2,22]),e(n,[2,24],{14:[1,35]}),e(n,[2,25],{14:[1,36]}),e(n,[2,26]),{20:s,25:37,26:38,27:a},e(n,[2,10],{15:[1,40]}),{16:[1,41]},e(n,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:r,21:i},e(n,[2,17],{14:[1,45]}),e(n,[2,18],{14:[1,46]}),e(n,[2,19]),e(n,[2,27]),e(n,[2,28]),e(n,[2,23],{27:[1,47]}),e(l,[2,29]),{15:[1,48]},{16:[1,49]},e(n,[2,11]),{16:[1,50]},e(n,[2,15]),e(o,[2,42]),e(n,[2,20]),e(n,[2,21]),{20:s,26:51},{16:u,20:d,21:[1,53],28:52,29:54,30:55,31:f,32:h,33:m},e(n,[2,12]),e(n,[2,16]),e(l,[2,30]),e(l,[2,31]),e(l,[2,32]),e(l,[2,33],{30:61,16:u,20:d,31:f,32:h,33:m}),e(g,[2,34]),e(g,[2,36]),e(g,[2,37]),e(g,[2,38]),e(g,[2,39]),e(g,[2,40]),e(g,[2,35])],defaultActions:{6:[2,1]},parseError:B(function C(A,P){if(P.recoverable){this.trace(A)}else{var L=new Error(A);L.hash=P;throw L}},"parseError"),parse:B(function C(A){var P=this,L=[0],I=[],N=[null],O=[],z=this.table,U="",W=0,H=0,$=0,K=2,X=1;var j=O.slice.call(arguments,1);var te=Object.create(this.lexer);var J={yy:{}};for(var oe in this.yy){if(Object.prototype.hasOwnProperty.call(this.yy,oe)){J.yy[oe]=this.yy[oe]}}te.setInput(A,J.yy);J.yy.lexer=te;J.yy.parser=this;if(typeof te.yylloc=="undefined"){te.yylloc={}}var se=te.yylloc;O.push(se);var re=te.options&&te.options.ranges;if(typeof J.yy.parseError==="function"){this.parseError=J.yy.parseError}else{this.parseError=Object.getPrototypeOf(this).parseError}function ce(mt){L.length=L.length-2*mt;N.length=N.length-mt;O.length=O.length-mt}B(ce,"popStack");function ue(){var mt;mt=I.pop()||te.lex()||X;if(typeof mt!=="number"){if(mt instanceof Array){I=mt;mt=I.pop()}mt=P.symbols_[mt]||mt}return mt}B(ue,"lex");var xe,be,Ie,he,ve,ge,Ve={},Le,$e,Ee,tt;while(true){Ie=L[L.length-1];if(this.defaultActions[Ie]){he=this.defaultActions[Ie]}else{if(xe===null||typeof xe=="undefined"){xe=ue()}he=z[Ie]&&z[Ie][xe]}if(typeof he==="undefined"||!he.length||!he[0]){var yt="";tt=[];for(Le in z[Ie]){if(this.terminals_[Le]&&Le>K){tt.push("'"+this.terminals_[Le]+"'")}}if(te.showPosition){yt="Parse error on line "+(W+1)+":\n"+te.showPosition()+"\nExpecting "+tt.join(", ")+", got '"+(this.terminals_[xe]||xe)+"'"}else{yt="Parse error on line "+(W+1)+": Unexpected "+(xe==X?"end of input":"'"+(this.terminals_[xe]||xe)+"'")}this.parseError(yt,{text:te.match,token:this.terminals_[xe]||xe,line:te.yylineno,loc:se,expected:tt})}if(he[0]instanceof Array&&he.length>1){throw new Error("Parse Error: multiple actions possible at state: "+Ie+", token: "+xe)}switch(he[0]){case 1:L.push(xe);N.push(te.yytext);O.push(te.yylloc);L.push(he[1]);xe=null;if(!be){H=te.yyleng;U=te.yytext;W=te.yylineno;se=te.yylloc;if($>0){$--}}else{xe=be;be=null}break;case 2:$e=this.productions_[he[1]][1];Ve.$=N[N.length-$e];Ve._$={first_line:O[O.length-($e||1)].first_line,last_line:O[O.length-1].last_line,first_column:O[O.length-($e||1)].first_column,last_column:O[O.length-1].last_column};if(re){Ve._$.range=[O[O.length-($e||1)].range[0],O[O.length-1].range[1]]}ge=this.performAction.apply(Ve,[U,H,W,J.yy,he[1],N,O].concat(j));if(typeof ge!=="undefined"){return ge}if($e){L=L.slice(0,-1*$e*2);N=N.slice(0,-1*$e);O=O.slice(0,-1*$e)}L.push(this.productions_[he[1]][0]);N.push(Ve.$);O.push(Ve._$);Ee=z[L[L.length-2]][L[L.length-1]];L.push(Ee);break;case 3:return true}}return true},"parse")};var w=function(){var C={EOF:1,parseError:B(function A(P,L){if(this.yy.parser){this.yy.parser.parseError(P,L)}else{throw new Error(P)}},"parseError"),setInput:B(function(A,P){this.yy=P||this.yy||{};this._input=A;this._more=this._backtrack=this.done=false;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};if(this.options.ranges){this.yylloc.range=[0,0]}this.offset=0;return this},"setInput"),input:B(function(){var A=this._input[0];this.yytext+=A;this.yyleng++;this.offset++;this.match+=A;this.matched+=A;var P=A.match(/(?:\r\n?|\n).*/g);if(P){this.yylineno++;this.yylloc.last_line++}else{this.yylloc.last_column++}if(this.options.ranges){this.yylloc.range[1]++}this._input=this._input.slice(1);return A},"input"),unput:B(function(A){var P=A.length;var L=A.split(/(?:\r\n?|\n)/g);this._input=A+this._input;this.yytext=this.yytext.substr(0,this.yytext.length-P);this.offset-=P;var I=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1);this.matched=this.matched.substr(0,this.matched.length-1);if(L.length-1){this.yylineno-=L.length-1}var N=this.yylloc.range;this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:L?(L.length===I.length?this.yylloc.first_column:0)+I[I.length-L.length].length-L[0].length:this.yylloc.first_column-P};if(this.options.ranges){this.yylloc.range=[N[0],N[0]+this.yyleng-P]}this.yyleng=this.yytext.length;return this},"unput"),more:B(function(){this._more=true;return this},"more"),reject:B(function(){if(this.options.backtrack_lexer){this._backtrack=true}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}return this},"reject"),less:B(function(A){this.unput(this.match.slice(A))},"less"),pastInput:B(function(){var A=this.matched.substr(0,this.matched.length-this.match.length);return(A.length>20?"...":"")+A.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:B(function(){var A=this.match;if(A.length<20){A+=this._input.substr(0,20-A.length)}return(A.substr(0,20)+(A.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:B(function(){var A=this.pastInput();var P=new Array(A.length+1).join("-");return A+this.upcomingInput()+"\n"+P+"^"},"showPosition"),test_match:B(function(A,P){var L,I,N;if(this.options.backtrack_lexer){N={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done};if(this.options.ranges){N.yylloc.range=this.yylloc.range.slice(0)}}I=A[0].match(/(?:\r\n?|\n).*/g);if(I){this.yylineno+=I.length}this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:I?I[I.length-1].length-I[I.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+A[0].length};this.yytext+=A[0];this.match+=A[0];this.matches=A;this.yyleng=this.yytext.length;if(this.options.ranges){this.yylloc.range=[this.offset,this.offset+=this.yyleng]}this._more=false;this._backtrack=false;this._input=this._input.slice(A[0].length);this.matched+=A[0];L=this.performAction.call(this,this.yy,this,P,this.conditionStack[this.conditionStack.length-1]);if(this.done&&this._input){this.done=false}if(L){return L}else if(this._backtrack){for(var O in N){this[O]=N[O]}return false}return false},"test_match"),next:B(function(){if(this.done){return this.EOF}if(!this._input){this.done=true}var A,P,L,I;if(!this._more){this.yytext="";this.match=""}var N=this._currentRules();for(var O=0;OP[0].length)){P=L;I=O;if(this.options.backtrack_lexer){A=this.test_match(L,N[O]);if(A!==false){return A}else if(this._backtrack){P=false;continue}else{return false}}else if(!this.options.flex){break}}}if(P){A=this.test_match(P,N[I]);if(A!==false){return A}return false}if(this._input===""){return this.EOF}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}},"next"),lex:B(function A(){var P=this.next();if(P){return P}else{return this.lex()}},"lex"),begin:B(function A(P){this.conditionStack.push(P)},"begin"),popState:B(function A(){var P=this.conditionStack.length-1;if(P>0){return this.conditionStack.pop()}else{return this.conditionStack[0]}},"popState"),_currentRules:B(function A(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules}else{return this.conditions["INITIAL"].rules}},"_currentRules"),topState:B(function A(P){P=this.conditionStack.length-1-Math.abs(P||0);if(P>=0){return this.conditionStack[P]}else{return"INITIAL"}},"topState"),pushState:B(function A(P){this.begin(P)},"pushState"),stateStackSize:B(function A(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":true},performAction:B(function A(P,L,I,N){var O=N;switch(I){case 0:break;case 1:break;case 2:break;case 3:if(P.getIndentMode&&P.getIndentMode()){P.consumeIndentText=true;this.begin("INITIAL");return 22}break;case 4:break;case 5:if(P.setIndentMode){P.setIndentMode(false)}this.begin("INITIAL");this.unput(L.yytext);break;case 6:this.begin("bol");return 8;break;case 7:break;case 8:break;case 9:return 7;break;case 10:return 11;break;case 11:return 5;break;case 12:return 12;break;case 13:return 17;break;case 14:if(P.consumeIndentText){P.consumeIndentText=false}else{return 19}break;case 15:return 24;break;case 16:L.yytext=L.yytext.slice(2,-2);return 14;break;case 17:L.yytext=L.yytext.slice(1,-1).trim();return 14;break;case 18:return 16;break;case 19:return 31;break;case 20:return 33;break;case 21:return 32;break;case 22:return 20;break;case 23:return 21;break;case 24:return 27;break;case 25:return 15;break}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[ \t]+(?=[\n\r]))/i,/^(?:[ \t]+(?=text\b))/i,/^(?:[ \t]+)/i,/^(?:[^ \t\n\r])/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[ \t]+)/i,/^(?:$)/i,/^(?:title\s[^#\n;]+)/i,/^(?:venn-beta\b)/i,/^(?:set\b)/i,/^(?:union\b)/i,/^(?:text\b)/i,/^(?:style\b)/i,/^(?:\["[^\"]*"\])/i,/^(?:\[[^\]\"]+\])/i,/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,/^(?:#[0-9a-fA-F]{3,8})/i,/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:"[^\"]*")/i,/^(?:,)/i,/^(?::)/i],conditions:{"bol":{"rules":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],"inclusive":true},"INITIAL":{"rules":[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],"inclusive":true}}};return C}();x.lexer=w;function _(){this.yy={}}B(_,"Parser");_.prototype=x;x.Parser=_;return new _}();Lct.parser=Lct;aXi=Lct;Dct=[];Fct=[];Nct=[];Oct=new Set;zct=false;sXi=B((e,t,n)=>{const r=mIe(e).sort();const i=n??10/Math.pow(e.length,2);Bct=r;if(r.length===1){Oct.add(r[0])}Dct.push({sets:r,size:i,label:t?Fre(t):void 0})},"addSubsetData");lXi=B(()=>{return Dct},"getSubsetData");Fre=B(e=>{const t=e.trim();if(t.length>=2&&t.startsWith('"')&&t.endsWith('"')){return t.slice(1,-1)}return t},"normalizeText");cXi=B(e=>{return e?Fre(e):e},"normalizeStyleValue");uXi=B((e,t,n)=>{const r=Fre(t);Fct.push({sets:mIe(e).sort(),id:r,label:n?Fre(n):void 0})},"addTextData");dXi=B((e,t)=>{const n=mIe(e).sort();const r={};for(const[i,o]of t){r[i]=cXi(o)??o}Nct.push({targets:n,styles:r})},"addStyleData");fXi=B(()=>{return Nct},"getStyleData");mIe=B(e=>{return e.map(t=>Fre(t))},"normalizeIdentifierList");hXi=B(e=>{const t=mIe(e);const n=t.filter(r=>!Oct.has(r));if(n.length>0){throw new Error(`unknown set identifier: ${n.join(", ")}`)}},"validateUnionIdentifiers");pXi=B(()=>{return Fct},"getTextData");mXi=B(()=>Bct,"getCurrentSets");gXi=B(()=>zct,"getIndentMode");yXi=B(e=>{zct=e},"setIndentMode");bXi=ka.venn;B(Y8n,"getConfig");xXi=B(()=>{Da();Dct.length=0;Fct.length=0;Nct.length=0;Oct.clear();Bct=void 0;zct=false},"customClear");vXi={getConfig:Y8n,clear:xXi,setAccTitle:Ka,getAccTitle:is,setDiagramTitle:ys,getDiagramTitle:ss,getAccDescription:as,setAccDescription:os,addSubsetData:sXi,getSubsetData:lXi,addTextData:uXi,addStyleData:dXi,validateUnionIdentifiers:hXi,getTextData:pXi,getStyleData:fXi,getCurrentSets:mXi,getIndentMode:gXi,setIndentMode:yXi};_Xi=B(e=>` + .venn-title { + font-size: 32px; + fill: ${e.vennTitleTextColor}; + font-family: ${e.fontFamily}; + } + + .venn-circle text { + font-size: 48px; + font-family: ${e.fontFamily}; + } + + .venn-intersection text { + font-size: 48px; + fill: ${e.vennSetTextColor}; + font-family: ${e.fontFamily}; + } + + .venn-text-node { + font-family: ${e.fontFamily}; + color: ${e.vennSetTextColor}; + } +`,"getStyles");TXi=_Xi;B(X8n,"buildStyleByKey");wXi=B((e,t,n,r)=>{const i=r.db;const o=i.getConfig?.();const{themeVariables:a,look:s,handDrawnSeed:l}=Ji();const u=s==="handDrawn";const d=[a.venn1,a.venn2,a.venn3,a.venn4,a.venn5,a.venn6,a.venn7,a.venn8].filter(Boolean);const f=i.getDiagramTitle?.();const h=i.getSubsetData();const m=i.getTextData();const g=X8n(i.getStyleData());const x=K8n(h);const w=o?.width??800;const _=o?.height??450;const C=1600;const A=w/C;const P=f?48*A:0;const L=a.primaryTextColor??a.textColor;const I=Sc(t);I.attr("viewBox",`0 0 ${w} ${_}`);if(f){I.append("text").text(f).attr("class","venn-title").attr("font-size",`${32*A}px`).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*A).style("fill",a.vennTitleTextColor||a.titleColor)}const N=zr(document.createElement("div"));const O=z8n().width(w).height(_-P);N.datum(x).call(O);const z=u?q8n.default.svg(N.select("svg").node()):void 0;const U=H8n(x,{width:w,height:_-P,padding:o?.padding??15});const W=new Map;for(const X of U){const j=AD([...X.data.sets].sort());W.set(j,X)}if(m.length>0){j8n(o,W,N,m,A,g)}const H=$c(a.background||"#f4f4f4");N.selectAll(".venn-circle").each(function(X,j){const te=zr(this);const J=X;const oe=AD([...J.sets].sort());const se=g.get(oe);const re=se?.fill||d[j%d.length]||a.primaryColor;te.classed(`venn-set-${j%8}`,true);const ce=se?.["fill-opacity"]??.1;const ue=se?.stroke||re;const xe=se?.["stroke-width"]||`${5*A}`;if(u&&z){const Ie=W.get(oe);if(Ie&&Ie.circles.length>0){const he=Ie.circles[0];const ve=z.circle(he.x,he.y,he.radius*2,{roughness:.7,seed:l,fill:gwe(re,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+j*60,stroke:ue,strokeWidth:parseFloat(String(xe))});te.select("path").remove();te.node()?.insertBefore(ve,te.select("text").node())}}else{te.select("path").style("fill",re).style("fill-opacity",ce).style("stroke",ue).style("stroke-width",xe).style("stroke-opacity",.95)}const be=se?.color||(H?Nr(re,30):Or(re,30));te.select("text").style("font-size",`${48*A}px`).style("fill",be)});if(u&&z){N.selectAll(".venn-intersection").each(function(X){const j=zr(this);const te=X;const J=AD([...te.sets].sort());const oe=g.get(J);const se=oe?.fill;if(se){const re=j.select("path");const ce=re.attr("d");if(ce){const ue=z.path(ce,{roughness:.7,seed:l,fill:gwe(se,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"});const xe=re.node();xe?.parentNode?.insertBefore(ue,xe);re.remove()}}else{j.select("path").style("fill-opacity",0)}j.select("text").style("font-size",`${48*A}px`).style("fill",oe?.color??a.vennSetTextColor??L)})}else{N.selectAll(".venn-intersection text").style("font-size",`${48*A}px`).style("fill",X=>{const j=X;const te=AD([...j.sets].sort());return g.get(te)?.color??a.vennSetTextColor??L});N.selectAll(".venn-intersection path").style("fill-opacity",X=>{const j=X;const te=AD([...j.sets].sort());return g.get(te)?.fill?1:0}).style("fill",X=>{const j=X;const te=AD([...j.sets].sort());return g.get(te)?.fill??"transparent"})}const $=I.append("g").attr("transform",`translate(0, ${P})`);const K=N.select("svg").node();if(K&&"childNodes"in K){for(const X of[...K.childNodes]){$.node()?.appendChild(X)}}Vs(I,_,w,o?.useMaxWidth??true)},"draw");B(AD,"stableSetsKey");B(j8n,"renderTextNodes");B(K8n,"ensurePairwiseSubsets");EXi={draw:wXi};CXi={parser:aXi,db:vXi,renderer:EXi,styles:TXi}});var n7n={};Oo(n7n,{diagram:()=>FXi});function e7n(e){if(!e.length){return[]}const t=[];const n=[];e.forEach(r=>{const i={name:r.name,children:r.type==="Leaf"?void 0:[]};i.classSelector=r?.classSelector;if(r?.cssCompiledStyles){i.cssCompiledStyles=r.cssCompiledStyles}if(r.type==="Leaf"&&r.value!==void 0){i.value=r.value}while(n.length>0&&n[n.length-1].level>=r.level){n.pop()}if(n.length===0){t.push(i)}else{const o=n[n.length-1].node;if(o.children){o.children.push(i)}else{o.children=[i]}}if(r.type!=="Leaf"){n.push({node:i,level:r.level})}});return t}var Q8n,SXi,AXi,t7n,kXi,FH,Nre,RXi,PXi,IXi,MXi,LXi,DXi,FXi;var r7n=Ce(()=>{rb();gh();Cx();Eg();nl();Ta();Aa();Yo();zg();ks();Q8n=class{constructor(){this.nodes=[];this.levels=new Map;this.outerNodes=[];this.classes=new Map;this.setAccTitle=Ka;this.getAccTitle=is;this.setDiagramTitle=ys;this.getDiagramTitle=ss;this.getAccDescription=as;this.setAccDescription=os}static{B(this,"TreeMapDB")}getNodes(){return this.nodes}getConfig(){const e=ka;const t=Ji();return Cl({...e.treemap,...t.treemap??{}})}addNode(e,t){this.nodes.push(e);this.levels.set(e,t);if(t===0){this.outerNodes.push(e);this.root??=e}}getRoot(){return{name:"",children:this.outerNodes}}addClass(e,t){const n=this.classes.get(e)??{id:e,styles:[],textStyles:[]};const r=t.replace(/\\,/g,"\xA7\xA7\xA7").replace(/,/g,";").replace(/§§§/g,",").split(";");if(r){r.forEach(i=>{if(Tee(i)){if(n?.textStyles){n.textStyles.push(i)}else{n.textStyles=[i]}}if(n?.styles){n.styles.push(i)}else{n.styles=[i]}})}this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){Da();this.nodes=[];this.levels=new Map;this.outerNodes=[];this.classes=new Map;this.root=void 0}};B(e7n,"buildHierarchy");SXi=B((e,t)=>{mu(e,t);const n=[];for(const o of e.TreemapRows??[]){if(o.$type==="ClassDefStatement"){t.addClass(o.className??"",o.styleText??"")}}for(const o of e.TreemapRows??[]){const a=o.item;if(!a){continue}const s=o.indent?parseInt(o.indent):0;const l=AXi(a);const u=a.classSelector?t.getStylesForClass(a.classSelector):[];const d=u.length>0?u:void 0;const f={level:s,name:l,type:a.$type,value:a.value,classSelector:a.classSelector,cssCompiledStyles:d};n.push(f)}const r=e7n(n);const i=B((o,a)=>{for(const s of o){t.addNode(s,a);if(s.children&&s.children.length>0){i(s.children,a+1)}}},"addNodesRecursively");i(r,0)},"populate");AXi=B(e=>{return e.name?String(e.name):""},"getItemName");t7n={parser:{yy:void 0},parse:B(async e=>{try{const t=Pf;const n=await t("treemap",e);wt.debug("Treemap AST:",n);const r=t7n.parser?.yy;if(!(r instanceof Q8n)){throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.")}SXi(n,r)}catch(t){wt.error("Error parsing treemap:",t);throw t}},"parse")};kXi=10;FH=10;Nre=25;RXi=B((e,t,n,r)=>{const i=r.db;const o=i.getConfig();const a=o.padding??kXi;const s=i.getDiagramTitle();const l=i.getRoot();const{themeVariables:u}=Ji();if(!l){return}const d=s?30:0;const f=Sc(t);const h=o.nodeWidth?o.nodeWidth*FH:960;const m=o.nodeHeight?o.nodeHeight*FH:500;const g=h;const x=m+d;f.attr("viewBox",`0 0 ${g} ${x}`);Vs(f,x,g,o.useMaxWidth);let w;try{const ce=o.valueFormat||",";if(ce==="$0,0"){w=B(ue=>"$"+Oh(",")(ue),"valueFormat")}else if(ce.startsWith("$")&&ce.includes(",")){const ue=/\.\d+/.exec(ce);const xe=ue?ue[0]:"";w=B(be=>"$"+Oh(","+xe)(be),"valueFormat")}else if(ce.startsWith("$")){const ue=ce.substring(1);w=B(xe=>"$"+Oh(ue||"")(xe),"valueFormat")}else{w=Oh(ce)}}catch(ce){wt.error("Error creating format function:",ce);w=Oh(",")}const _=mg().range(["transparent",u.cScale0,u.cScale1,u.cScale2,u.cScale3,u.cScale4,u.cScale5,u.cScale6,u.cScale7,u.cScale8,u.cScale9,u.cScale10,u.cScale11]);const C=mg().range(["transparent",u.cScalePeer0,u.cScalePeer1,u.cScalePeer2,u.cScalePeer3,u.cScalePeer4,u.cScalePeer5,u.cScalePeer6,u.cScalePeer7,u.cScalePeer8,u.cScalePeer9,u.cScalePeer10,u.cScalePeer11]);const A=mg().range([u.cScaleLabel0,u.cScaleLabel1,u.cScaleLabel2,u.cScaleLabel3,u.cScaleLabel4,u.cScaleLabel5,u.cScaleLabel6,u.cScaleLabel7,u.cScaleLabel8,u.cScaleLabel9,u.cScaleLabel10,u.cScaleLabel11]);if(s){f.append("text").attr("x",g/2).attr("y",d/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(s)}const P=f.append("g").attr("transform",`translate(0, ${d})`).attr("class","treemapContainer");const L=HE(l).sum(ce=>ce.value??0).sort((ce,ue)=>(ue.value??0)-(ce.value??0));const I=LK().size([h,m]).paddingTop(ce=>ce.children&&ce.children.length>0?Nre+FH:0).paddingInner(a).paddingLeft(ce=>ce.children&&ce.children.length>0?FH:0).paddingRight(ce=>ce.children&&ce.children.length>0?FH:0).paddingBottom(ce=>ce.children&&ce.children.length>0?FH:0).round(true);const N=I(L);const O=N.descendants().filter(ce=>ce.children&&ce.children.length>0);const z=P.selectAll(".treemapSection").data(O).enter().append("g").attr("class","treemapSection").attr("transform",ce=>`translate(${ce.x0},${ce.y0})`);z.append("rect").attr("width",ce=>ce.x1-ce.x0).attr("height",Nre).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",ce=>{if(ce.depth===0){return"display: none;"}return""});z.append("clipPath").attr("id",(ce,ue)=>`clip-section-${t}-${ue}`).append("rect").attr("width",ce=>Math.max(0,ce.x1-ce.x0-12)).attr("height",Nre);z.append("rect").attr("width",ce=>ce.x1-ce.x0).attr("height",ce=>ce.y1-ce.y0).attr("class",(ce,ue)=>{return`treemapSection section${ue}`}).attr("fill",ce=>_(ce.data.name)).attr("fill-opacity",.6).attr("stroke",ce=>C(ce.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",ce=>{if(ce.depth===0){return"display: none;"}const ue=Ro({cssCompiledStyles:ce.data.cssCompiledStyles});return ue.nodeStyles+";"+ue.borderStyles.join(";")});z.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",Nre/2).attr("dominant-baseline","middle").text(ce=>ce.depth===0?"":ce.data.name).attr("font-weight","bold").attr("clip-path",(ce,ue)=>`url(#clip-section-${t}-${ue})`).attr("style",ce=>{if(ce.depth===0){return"display: none;"}const ue="dominant-baseline: middle; font-size: 12px; fill:"+A(ce.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;";const xe=Ro({cssCompiledStyles:ce.data.cssCompiledStyles});return ue+xe.labelStyles.replace("color:","fill:")}).each(function(ce){if(ce.depth===0){return}const ue=zr(this);const xe=ce.data.name;ue.text(xe);const be=ce.x1-ce.x0;const Ie=6;let he;if(o.showValues!==false&&ce.value){const $e=be-10;const Ee=30;const tt=10;const yt=$e-Ee-tt;he=yt-Ie}else{const $e=6;he=be-Ie-$e}const ve=15;const ge=Math.max(ve,he);const Ve=ue.node();const Le=Ve.getComputedTextLength();if(Le>ge){const $e="...";let Ee=xe;while(Ee.length>0){Ee=xe.substring(0,Ee.length-1);if(Ee.length===0){ue.text($e);if(Ve.getComputedTextLength()>ge){ue.text("")}break}ue.text(Ee+$e);if(Ve.getComputedTextLength()<=ge){break}}}});if(o.showValues!==false){z.append("text").attr("class","treemapSectionValue").attr("x",ce=>ce.x1-ce.x0-10).attr("y",Nre/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(ce=>ce.value?w(ce.value):"").attr("font-style","italic").attr("style",ce=>{if(ce.depth===0){return"display: none;"}const ue="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+A(ce.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;";const xe=Ro({cssCompiledStyles:ce.data.cssCompiledStyles});return ue+xe.labelStyles.replace("color:","fill:")})}const U=N.leaves();const W=U.length>20;const H=W?16:38;const $=W?14:28;const K=W?4:8;const X=W?4:6;const j=W?2:4;const te=W?8:10;const J=W?1:2;const oe=P.selectAll(".treemapLeafGroup").data(U).enter().append("g").attr("class",(ce,ue)=>{return`treemapNode treemapLeafGroup leaf${ue}${ce.data.classSelector?` ${ce.data.classSelector}`:""}x`}).attr("transform",ce=>`translate(${ce.x0},${ce.y0})`);oe.append("rect").attr("width",ce=>ce.x1-ce.x0).attr("height",ce=>ce.y1-ce.y0).attr("class","treemapLeaf").attr("fill",ce=>{return ce.parent?_(ce.parent.data.name):_(ce.data.name)}).attr("style",ce=>{const ue=Ro({cssCompiledStyles:ce.data.cssCompiledStyles});return ue.nodeStyles}).attr("fill-opacity",.3).attr("stroke",ce=>{return ce.parent?_(ce.parent.data.name):_(ce.data.name)}).attr("stroke-width",3);oe.append("clipPath").attr("id",(ce,ue)=>`clip-${t}-${ue}`).append("rect").attr("width",ce=>Math.max(0,ce.x1-ce.x0-4)).attr("height",ce=>Math.max(0,ce.y1-ce.y0-4));const se=oe.append("text").attr("class","treemapLabel").attr("x",ce=>(ce.x1-ce.x0)/2).attr("y",ce=>(ce.y1-ce.y0)/2).attr("style",ce=>{const ue=`text-anchor: middle; dominant-baseline: middle; font-size: ${H}px;fill:`+A(ce.data.name)+";";const xe=Ro({cssCompiledStyles:ce.data.cssCompiledStyles});return ue+xe.labelStyles.replace("color:","fill:")}).attr("clip-path",(ce,ue)=>`url(#clip-${t}-${ue})`).text(ce=>ce.data.name);se.each(function(ce){const ue=zr(this);const xe=ce.x1-ce.x0;const be=ce.y1-ce.y0;const Ie=ue.node();const he=xe-2*j;const ve=be-2*j;if(hehe&&ge>K){ge--;ue.style("font-size",`${ge}px`)}let Le=Math.max(X,Math.min($,Math.round(ge*Ve)));let $e=ge+J+Le;while($e>ve&&ge>K){ge--;Le=Math.max(X,Math.min($,Math.round(ge*Ve)));if(Leve){}}ue.style("font-size",`${ge}px`);if(W){if(gehe||ge(ue.x1-ue.x0)/2).attr("y",function(ue){return(ue.y1-ue.y0)/2}).attr("style",ue=>{const xe=`text-anchor: middle; dominant-baseline: hanging; font-size: ${$}px;fill:`+A(ue.data.name)+";";const be=Ro({cssCompiledStyles:ue.data.cssCompiledStyles});return xe+be.labelStyles.replace("color:","fill:")}).attr("clip-path",(ue,xe)=>`url(#clip-${t}-${xe})`).text(ue=>ue.value?w(ue.value):"");ce.each(function(ue){const xe=zr(this);const be=this.parentNode;if(!be){xe.style("display","none");return}const Ie=zr(be).select(".treemapLabel");if(Ie.empty()||Ie.style("display")==="none"){xe.style("display","none");return}const he=parseFloat(Ie.style("font-size"));const ve=.6;const ge=Math.max(X,Math.min($,Math.round(he*ve)));xe.style("font-size",`${ge}px`);const Ve=(ue.y1-ue.y0)/2;const Le=Ve+he/2+J;xe.attr("y",Le);const $e=ue.x1-ue.x0;const Ee=ue.y1-ue.y0;const tt=4;const yt=Ee-tt;const mt=$e-2*j;if(xe.node().getComputedTextLength()>mt||Le+ge>yt||ge{const t=Vy();const n=Ji();const r=Cl(t,n.themeVariables);const i=Cl(MXi,e);const o=i.titleColor??r.titleColor;const a=i.labelColor??r.textColor;const s=i.valueColor??r.textColor;return` + .treemapNode.section { + stroke: ${i.sectionStrokeColor}; + stroke-width: ${i.sectionStrokeWidth}; + fill: ${i.sectionFillColor}; + } + .treemapNode.leaf { + stroke: ${i.leafStrokeColor}; + stroke-width: ${i.leafStrokeWidth}; + fill: ${i.leafFillColor}; + } + .treemapLabel { + fill: ${a}; + font-size: ${i.labelFontSize}; + } + .treemapValue { + fill: ${s}; + font-size: ${i.valueFontSize}; + } + .treemapTitle { + fill: ${o}; + font-size: ${i.titleFontSize}; + } + `},"getStyles");DXi=LXi;FXi={parser:t7n,get db(){return new Q8n},renderer:IXi,styles:DXi}});var w7n={};Oo(w7n,{diagram:()=>YXi});function a7n(){return Mn()["wardley-beta"]}function s7n(e,t,n,r,i,o,a,s,l){Ky.addNode({id:e,label:t,x:n,y:r,className:i,labelOffsetX:o,labelOffsetY:a,inertia:s,sourceStrategy:l})}function l7n(e,t,n=false,r,i){Ky.addLink({source:e,target:t,dashed:n,label:r,flow:i})}function c7n(e,t,n){Ky.addTrend({nodeId:e,targetX:t,targetY:n})}function u7n(e,t,n){Ky.addAnnotation({number:e,coordinates:t,text:n})}function d7n(e,t,n){Ky.addNote({text:e,x:t,y:n})}function f7n(e,t,n){Ky.addAccelerator({name:e,x:t,y:n})}function h7n(e,t,n){Ky.addDeaccelerator({name:e,x:t,y:n})}function p7n(e,t){Ky.setAnnotationsBox(e,t)}function m7n(e,t){Ky.setSize(e,t)}function g7n(e){Ky.startPipeline(e)}function y7n(e,t){Ky.addPipelineComponent(e,t)}function b7n(e){Ky.setAxes(e)}function x7n(e){return Ky.getNode(e)}function v7n(e){return Ky.resolveNodeId(e)}function _7n(){return Ky.build()}function T7n(){Ky.clear();Da()}var gIe,W6,i7n,NXi,OXi,o7n,BXi,Ky,zXi,UXi,VXi,$Xi,GXi,HXi,WXi,YXi;var E7n=Ce(()=>{rb();gh();nl();Ta();Aa();Yo();zg();gIe=B((e,t)=>{const n=e<=1?e*100:e;if(n<0||n>100){throw new Error(`${t} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${e}`)}return n},"toPercent");W6=B((e,t,n)=>{return{x:gIe(t,`${n} evolution`),y:gIe(e,`${n} visibility`)}},"toCoordinates");i7n=B(e=>{if(!e){return void 0}if(e==="+<>"){return"bidirectional"}if(e==="+<"){return"backward"}if(e==="+>"){return"forward"}return void 0},"getFlowFromPort");NXi=B(e=>{if(!e?.startsWith("+")){return{}}const t=/^\+'([^']*)'/.exec(e);const n=t?.[1];if(e.includes("<>")){return{flow:"bidirectional",label:n}}if(e.includes("<")){return{flow:"backward",label:n}}if(e.includes(">")){return{flow:"forward",label:n}}return{label:n}},"extractFlowFromArrow");OXi=B((e,t)=>{mu(e,t);if(e.size){t.setSize(e.size.width,e.size.height)}if(e.evolution){const n=e.evolution.stages.map(i=>{if(i.secondName){return`${i.name.trim()} / ${i.secondName.trim()}`}return i.name.trim()});const r=e.evolution.stages.filter(i=>i.boundary!==void 0).map(i=>i.boundary);t.updateAxes({stages:n,stageBoundaries:r})}e.anchors.forEach(n=>{const r=W6(n.visibility,n.evolution,`Anchor "${n.name}"`);t.addNode(n.name,n.name,r.x,r.y,"anchor")});e.components.forEach(n=>{const r=W6(n.visibility,n.evolution,`Component "${n.name}"`);const i=n.label?(n.label.negX?-1:1)*n.label.offsetX:void 0;const o=n.label?(n.label.negY?-1:1)*n.label.offsetY:void 0;const a=n.decorator?.strategy;t.addNode(n.name,n.name,r.x,r.y,"component",i,o,n.inertia,a)});e.notes.forEach(n=>{const r=W6(n.visibility,n.evolution,`Note "${n.text}"`);t.addNote(n.text,r.x,r.y)});e.pipelines.forEach(n=>{const r=t.getNode(n.parent);if(!r||typeof r.y!=="number"){throw new Error(`Pipeline "${n.parent}" must reference an existing component with coordinates.`)}const i=r.y;t.startPipeline(n.parent);n.components.forEach(o=>{const a=`${n.parent}_${o.name}`;const s=o.label?(o.label.negX?-1:1)*o.label.offsetX:void 0;const l=o.label?(o.label.negY?-1:1)*o.label.offsetY:void 0;const u=gIe(o.evolution,`Pipeline component "${o.name}" evolution`);t.addNode(a,o.name,u,i,"pipeline-component",s,l);t.addPipelineComponent(n.parent,a)})});e.links.forEach(n=>{const r=!!n.arrow&&(n.arrow.includes("-.->")||n.arrow.includes(".-."));let i=i7n(n.fromPort)??i7n(n.toPort);const{flow:o,label:a}=NXi(n.arrow);if(!i&&o){i=o}const s=n.linkLabel;const l=a??s;t.addLink(t.resolveNodeId(n.from),t.resolveNodeId(n.to),r,l,i)});e.evolves.forEach(n=>{const r=t.getNode(n.component);if(r?.y!==void 0){const i=gIe(n.target,`Evolve target for "${n.component}"`);t.addTrend(n.component,i,r.y)}});if(e.annotations.length>0){const n=e.annotations[0];const r=W6(n.x,n.y,"Annotations box");t.setAnnotationsBox(r.x,r.y)}e.annotation.forEach(n=>{const r=W6(n.x,n.y,`Annotation ${n.number}`);t.addAnnotation(n.number,[{x:r.x,y:r.y}],n.text)});e.accelerators.forEach(n=>{const r=W6(n.x,n.y,`Accelerator "${n.name}"`);t.addAccelerator(n.name,r.x,r.y)});e.deaccelerators.forEach(n=>{const r=W6(n.x,n.y,`Deaccelerator "${n.name}"`);t.addDeaccelerator(n.name,r.x,r.y)})},"populateDb");o7n={parser:{yy:void 0},parse:B(async e=>{const t=await Pf("wardley",e);wt.debug(t);const n=o7n.parser?.yy;if(!n||typeof n.addNode!=="function"){throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.")}OXi(t,n)},"parse")};BXi=class{constructor(){this.nodes=new Map;this.links=[];this.trends=new Map;this.pipelines=new Map;this.annotations=[];this.notes=[];this.accelerators=[];this.deaccelerators=[];this.axes={}}static{B(this,"WardleyBuilder")}addNode(e){const t=this.nodes.get(e.id)??{id:e.id,label:e.label};const n={...t,...e,className:e.className??t.className,labelOffsetX:e.labelOffsetX??t.labelOffsetX,labelOffsetY:e.labelOffsetY??t.labelOffsetY};this.nodes.set(e.id,n)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});const t=this.nodes.get(e);if(t){t.isPipelineParent=true}}addPipelineComponent(e,t){const n=this.pipelines.get(e);if(n){n.componentIds.push(t)}const r=this.nodes.get(t);if(r){r.inPipeline=true}}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,t){this.annotationsBox={x:e,y:t}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,t){this.size={width:e,height:t}}getNode(e){return this.nodes.get(e)}resolveNodeId(e){if(this.nodes.has(e)){return e}for(const[t,n]of this.nodes){if(n.label===e){return t}}return e}build(){const e=[];for(const t of this.nodes.values()){if(typeof t.x!=="number"||typeof t.y!=="number"){throw new Error(`Node "${t.label}" is missing coordinates`)}e.push(t)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear();this.links=[];this.trends.clear();this.pipelines.clear();this.annotations=[];this.notes=[];this.accelerators=[];this.deaccelerators=[];this.annotationsBox=void 0;this.axes={};this.size=void 0}};Ky=new BXi;B(a7n,"getConfig");B(s7n,"addNode");B(l7n,"addLink");B(c7n,"addTrend");B(u7n,"addAnnotation");B(d7n,"addNote");B(f7n,"addAccelerator");B(h7n,"addDeaccelerator");B(p7n,"setAnnotationsBox");B(m7n,"setSize");B(g7n,"startPipeline");B(y7n,"addPipelineComponent");B(b7n,"updateAxes");B(x7n,"getNode");B(v7n,"resolveNodeId");B(_7n,"getWardleyData");B(T7n,"clear");zXi={getConfig:a7n,addNode:s7n,addLink:l7n,addTrend:c7n,addAnnotation:u7n,addNote:d7n,addAccelerator:f7n,addDeaccelerator:h7n,setAnnotationsBox:p7n,setSize:m7n,startPipeline:g7n,addPipelineComponent:y7n,updateAxes:b7n,getNode:x7n,resolveNodeId:v7n,getWardleyData:_7n,clear:T7n,setAccTitle:Ka,getAccTitle:is,setDiagramTitle:ys,getDiagramTitle:ss,getAccDescription:as,setAccDescription:os};UXi=["Genesis","Custom Built","Product","Commodity"];VXi=B(()=>{const{themeVariables:e}=Mn();return{backgroundColor:e.wardley?.backgroundColor??e.background??"#fff",axisColor:e.wardley?.axisColor??"#000",axisTextColor:e.wardley?.axisTextColor??e.primaryTextColor??"#222",gridColor:e.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:e.wardley?.componentFill??"#fff",componentStroke:e.wardley?.componentStroke??"#000",componentLabelColor:e.wardley?.componentLabelColor??e.primaryTextColor??"#222",linkStroke:e.wardley?.linkStroke??"#000",evolutionStroke:e.wardley?.evolutionStroke??"#dc3545",annotationStroke:e.wardley?.annotationStroke??"#000",annotationTextColor:e.wardley?.annotationTextColor??e.primaryTextColor??"#222",annotationFill:e.wardley?.annotationFill??e.background??"#fff"}},"getTheme");$Xi=B(()=>{const e=Mn()["wardley-beta"];return{width:e?.width??900,height:e?.height??600,padding:e?.padding??48,nodeRadius:e?.nodeRadius??6,nodeLabelOffset:e?.nodeLabelOffset??8,axisFontSize:e?.axisFontSize??12,labelFontSize:e?.labelFontSize??10,showGrid:e?.showGrid??false,useMaxWidth:e?.useMaxWidth??true}},"getConfigValues");GXi=B((e,t,n,r)=>{wt.debug("Rendering Wardley map\n"+e);const i=$Xi();const o=VXi();const a=i.nodeRadius*1.6;const s=r.db;const l=s.getWardleyData();const u=s.getDiagramTitle();const d=l.size?.width??i.width;const f=l.size?.height??i.height;const h=Sc(t);h.selectAll("*").remove();Vs(h,f,d,i.useMaxWidth);h.attr("viewBox",`0 0 ${d} ${f}`);const m=h.append("g").attr("class","wardley-map");const g=h.append("defs");g.append("marker").attr("id",`arrow-${t}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",o.evolutionStroke).attr("stroke","none");g.append("marker").attr("id",`link-arrow-end-${t}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",o.linkStroke).attr("stroke","none");g.append("marker").attr("id",`link-arrow-start-${t}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",o.linkStroke).attr("stroke","none");m.append("rect").attr("class","wardley-background").attr("width",d).attr("height",f).attr("fill",o.backgroundColor);const x=d-i.padding*2;const w=f-i.padding*2;if(u){m.append("text").attr("class","wardley-title").attr("x",d/2).attr("y",i.padding/2).attr("fill",o.axisTextColor).attr("font-size",i.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(u)}const _=B(J=>i.padding+J/100*x,"projectX");const C=B(J=>f-i.padding-J/100*w,"projectY");const A=m.append("g").attr("class","wardley-axes");A.append("line").attr("x1",i.padding).attr("x2",d-i.padding).attr("y1",f-i.padding).attr("y2",f-i.padding).attr("stroke",o.axisColor).attr("stroke-width",1);A.append("line").attr("x1",i.padding).attr("x2",i.padding).attr("y1",i.padding).attr("y2",f-i.padding).attr("stroke",o.axisColor).attr("stroke-width",1);const P=l.axes.xLabel??"Evolution";const L=l.axes.yLabel??"Visibility";A.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",i.padding+x/2).attr("y",f-i.padding/4).attr("fill",o.axisTextColor).attr("font-size",i.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(P);A.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",i.padding/3).attr("y",i.padding+w/2).attr("fill",o.axisTextColor).attr("font-size",i.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${i.padding/3} ${i.padding+w/2})`).text(L);const I=l.axes.stages&&l.axes.stages.length>0?l.axes.stages:UXi;if(I.length>0){const J=m.append("g").attr("class","wardley-stages");const oe=l.axes.stageBoundaries;const se=[];if(oe&&oe.length===I.length){let re=0;oe.forEach(ce=>{se.push({start:re,end:ce});re=ce})}else{const re=1/I.length;I.forEach((ce,ue)=>{se.push({start:ue*re,end:(ue+1)*re})})}I.forEach((re,ce)=>{const ue=se[ce];const xe=i.padding+ue.start*x;const be=i.padding+ue.end*x;const Ie=(xe+be)/2;if(ce>0){J.append("line").attr("x1",xe).attr("x2",xe).attr("y1",i.padding).attr("y2",f-i.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8)}J.append("text").attr("class","wardley-stage-label").attr("x",Ie).attr("y",f-i.padding/1.5).attr("fill",o.axisTextColor).attr("font-size",i.axisFontSize-2).attr("text-anchor","middle").text(re)})}if(i.showGrid){const J=m.append("g").attr("class","wardley-grid");for(let oe=1;oe<4;oe++){const se=oe/4;const re=i.padding+x*se;J.append("line").attr("x1",re).attr("x2",re).attr("y1",i.padding).attr("y2",f-i.padding).attr("stroke",o.gridColor).attr("stroke-dasharray","2 6");J.append("line").attr("x1",i.padding).attr("x2",d-i.padding).attr("y1",f-i.padding-w*se).attr("y2",f-i.padding-w*se).attr("stroke",o.gridColor).attr("stroke-dasharray","2 6")}}const N=new Map;l.nodes.forEach(J=>{N.set(J.id,{x:_(J.x),y:C(J.y),node:J})});if(l.pipelines.length>0){const J=m.append("g").attr("class","wardley-pipelines");const oe=m.append("g").attr("class","wardley-pipeline-links");l.pipelines.forEach(se=>{if(se.componentIds.length===0){return}const re=se.componentIds.map(be=>({id:be,pos:N.get(be),node:l.nodes.find(Ie=>Ie.id===be)})).filter(be=>be.pos&&be.node).sort((be,Ie)=>be.node.x-Ie.node.x);for(let be=0;be{const Ie=N.get(be);if(Ie){ce=Math.min(ce,Ie.x);ue=Math.max(ue,Ie.x);xe=Ie.y}});if(ce!==Infinity&&ue!==-Infinity){const be=15;const Ie=i.nodeRadius*4;const he=xe-Ie/2;const ve=N.get(se.nodeId);if(ve){const ge=(ce+ue)/2;ve.x=ge;ve.y=he-a/6}J.append("rect").attr("class","wardley-pipeline-box").attr("x",ce-be).attr("y",he).attr("width",ue-ce+be*2).attr("height",Ie).attr("fill","none").attr("stroke",o.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const O=m.append("g").attr("class","wardley-links");const z=new Map;l.pipelines.forEach(J=>{z.set(J.nodeId,new Set(J.componentIds))});const U=l.links.filter(J=>{if(!N.has(J.source)||!N.has(J.target)){return false}const oe=z.get(J.target);if(oe?.has(J.source)){return false}return true});O.selectAll("line").data(U).enter().append("line").attr("class",J=>`wardley-link${J.dashed?" wardley-link--dashed":""}`).attr("x1",J=>{const oe=N.get(J.source);const se=N.get(J.target);const re=l.nodes.find(Ie=>Ie.id===J.source);const ce=re.isPipelineParent?a/Math.sqrt(2):i.nodeRadius;const ue=se.x-oe.x;const xe=se.y-oe.y;const be=Math.sqrt(ue*ue+xe*xe);return oe.x+ue/be*ce}).attr("y1",J=>{const oe=N.get(J.source);const se=N.get(J.target);const re=l.nodes.find(Ie=>Ie.id===J.source);const ce=re.isPipelineParent?a/Math.sqrt(2):i.nodeRadius;const ue=se.x-oe.x;const xe=se.y-oe.y;const be=Math.sqrt(ue*ue+xe*xe);return oe.y+xe/be*ce}).attr("x2",J=>{const oe=N.get(J.source);const se=N.get(J.target);const re=l.nodes.find(Ie=>Ie.id===J.target);const ce=re.isPipelineParent?a/Math.sqrt(2):i.nodeRadius;const ue=oe.x-se.x;const xe=oe.y-se.y;const be=Math.sqrt(ue*ue+xe*xe);return se.x+ue/be*ce}).attr("y2",J=>{const oe=N.get(J.source);const se=N.get(J.target);const re=l.nodes.find(Ie=>Ie.id===J.target);const ce=re.isPipelineParent?a/Math.sqrt(2):i.nodeRadius;const ue=oe.x-se.x;const xe=oe.y-se.y;const be=Math.sqrt(ue*ue+xe*xe);return se.y+xe/be*ce}).attr("stroke",o.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",J=>J.dashed?"6 6":null).attr("marker-end",J=>{if(J.flow==="forward"||J.flow==="bidirectional"){return`url(#link-arrow-end-${t})`}return null}).attr("marker-start",J=>{if(J.flow==="backward"||J.flow==="bidirectional"){return`url(#link-arrow-start-${t})`}return null});O.selectAll("text").data(U.filter(J=>J.label)).enter().append("text").attr("class","wardley-link-label").attr("x",J=>{const oe=N.get(J.source);const se=N.get(J.target);const re=(oe.x+se.x)/2;const ce=se.y-oe.y;const ue=se.x-oe.x;const xe=Math.sqrt(ue*ue+ce*ce);const be=8;const Ie=ce/xe;return re+Ie*be}).attr("y",J=>{const oe=N.get(J.source);const se=N.get(J.target);const re=(oe.y+se.y)/2;const ce=se.x-oe.x;const ue=se.y-oe.y;const xe=Math.sqrt(ce*ce+ue*ue);const be=8;const Ie=-ce/xe;return re+Ie*be}).attr("fill",o.axisTextColor).attr("font-size",i.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",J=>{const oe=N.get(J.source);const se=N.get(J.target);const re=(oe.x+se.x)/2;const ce=(oe.y+se.y)/2;const ue=se.x-oe.x;const xe=se.y-oe.y;const be=Math.sqrt(ue*ue+xe*xe);const Ie=8;const he=xe/be;const ve=-ue/be;const ge=re+he*Ie;const Ve=ce+ve*Ie;let Le=Math.atan2(xe,ue)*180/Math.PI;if(Le>90||Le<-90){Le+=180}return`rotate(${Le} ${ge} ${Ve})`}).text(J=>J.label);const W=m.append("g").attr("class","wardley-trends");const H=l.trends.map(J=>{const oe=N.get(J.nodeId);if(!oe){return null}const se=_(J.targetX);const re=C(J.targetY);const ce=se-oe.x;const ue=re-oe.y;const xe=Math.sqrt(ce*ce+ue*ue);const be=i.nodeRadius+2;const Ie=xe>be?se-ce/xe*be:se;const he=xe>be?re-ue/xe*be:re;return{origin:oe,targetX:se,targetY:re,adjustedX2:Ie,adjustedY2:he}}).filter(J=>J!==null);W.selectAll("line").data(H).enter().append("line").attr("class","wardley-trend").attr("x1",J=>J.origin.x).attr("y1",J=>J.origin.y).attr("x2",J=>J.adjustedX2).attr("y2",J=>J.adjustedY2).attr("stroke",o.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${t})`);const $=m.append("g").attr("class","wardley-nodes");const K=$.selectAll("g").data(l.nodes).enter().append("g").attr("class",J=>["wardley-node",J.className?`wardley-node--${J.className}`:""].filter(Boolean).join(" "));K.filter(J=>J.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",J=>N.get(J.id).x).attr("cy",J=>N.get(J.id).y).attr("r",i.nodeRadius*2).attr("fill","#666").attr("stroke",o.componentStroke).attr("stroke-width",1);K.filter(J=>J.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",J=>N.get(J.id).x).attr("cy",J=>N.get(J.id).y).attr("r",i.nodeRadius*2).attr("fill","#ccc").attr("stroke",o.componentStroke).attr("stroke-width",1);K.filter(J=>J.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",J=>N.get(J.id).x).attr("cy",J=>N.get(J.id).y).attr("r",i.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const X=K.filter(J=>J.sourceStrategy==="market");X.append("circle").attr("class","wardley-market-overlay").attr("cx",J=>N.get(J.id).x).attr("cy",J=>N.get(J.id).y).attr("r",i.nodeRadius*2).attr("fill","white").attr("stroke",o.componentStroke).attr("stroke-width",1);K.filter(J=>!J.isPipelineParent&&J.sourceStrategy!=="market"&&J.className!=="anchor").append("circle").attr("cx",J=>N.get(J.id).x).attr("cy",J=>N.get(J.id).y).attr("r",i.nodeRadius).attr("fill",o.componentFill).attr("stroke",o.componentStroke).attr("stroke-width",1);const j=i.nodeRadius*.7;const te=i.nodeRadius*1.2;X.append("line").attr("class","wardley-market-line").attr("x1",J=>N.get(J.id).x).attr("y1",J=>N.get(J.id).y-te).attr("x2",J=>N.get(J.id).x-te*Math.cos(Math.PI/6)).attr("y2",J=>N.get(J.id).y+te*Math.sin(Math.PI/6)).attr("stroke",o.componentStroke).attr("stroke-width",1);X.append("line").attr("class","wardley-market-line").attr("x1",J=>N.get(J.id).x-te*Math.cos(Math.PI/6)).attr("y1",J=>N.get(J.id).y+te*Math.sin(Math.PI/6)).attr("x2",J=>N.get(J.id).x+te*Math.cos(Math.PI/6)).attr("y2",J=>N.get(J.id).y+te*Math.sin(Math.PI/6)).attr("stroke",o.componentStroke).attr("stroke-width",1);X.append("line").attr("class","wardley-market-line").attr("x1",J=>N.get(J.id).x+te*Math.cos(Math.PI/6)).attr("y1",J=>N.get(J.id).y+te*Math.sin(Math.PI/6)).attr("x2",J=>N.get(J.id).x).attr("y2",J=>N.get(J.id).y-te).attr("stroke",o.componentStroke).attr("stroke-width",1);X.append("circle").attr("class","wardley-market-dot").attr("cx",J=>N.get(J.id).x).attr("cy",J=>N.get(J.id).y-te).attr("r",j).attr("fill","white").attr("stroke",o.componentStroke).attr("stroke-width",2);X.append("circle").attr("class","wardley-market-dot").attr("cx",J=>N.get(J.id).x-te*Math.cos(Math.PI/6)).attr("cy",J=>N.get(J.id).y+te*Math.sin(Math.PI/6)).attr("r",j).attr("fill","white").attr("stroke",o.componentStroke).attr("stroke-width",2);X.append("circle").attr("class","wardley-market-dot").attr("cx",J=>N.get(J.id).x+te*Math.cos(Math.PI/6)).attr("cy",J=>N.get(J.id).y+te*Math.sin(Math.PI/6)).attr("r",j).attr("fill","white").attr("stroke",o.componentStroke).attr("stroke-width",2);K.filter(J=>J.isPipelineParent===true).append("rect").attr("x",J=>N.get(J.id).x-a/2).attr("y",J=>N.get(J.id).y-a/2).attr("width",a).attr("height",a).attr("fill",o.componentFill).attr("stroke",o.componentStroke).attr("stroke-width",1);K.filter(J=>J.inertia===true).append("line").attr("class","wardley-inertia").attr("x1",J=>{const oe=N.get(J.id);let se=J.isPipelineParent?a/2+15:i.nodeRadius+15;if(J.sourceStrategy){se+=i.nodeRadius+10}return oe.x+se}).attr("y1",J=>{const oe=N.get(J.id);const se=J.isPipelineParent?a:i.nodeRadius*2;return oe.y-se/2}).attr("x2",J=>{const oe=N.get(J.id);let se=J.isPipelineParent?a/2+15:i.nodeRadius+15;if(J.sourceStrategy){se+=i.nodeRadius+10}return oe.x+se}).attr("y2",J=>{const oe=N.get(J.id);const se=J.isPipelineParent?a:i.nodeRadius*2;return oe.y+se/2}).attr("stroke",o.componentStroke).attr("stroke-width",6);K.append("text").attr("x",J=>{const oe=N.get(J.id);if(J.className==="anchor"){return J.labelOffsetX!==void 0?oe.x+J.labelOffsetX:oe.x}let se=i.nodeLabelOffset;if(J.sourceStrategy&&J.labelOffsetX===void 0){se+=10}const re=J.labelOffsetX??se;return oe.x+re}).attr("y",J=>{const oe=N.get(J.id);if(J.className==="anchor"){return J.labelOffsetY!==void 0?oe.y+J.labelOffsetY:oe.y-3}let se=-i.nodeLabelOffset;if(J.sourceStrategy&&J.labelOffsetY===void 0){se-=10}const re=J.labelOffsetY??se;return oe.y+re}).attr("class","wardley-node-label").attr("fill",J=>{if(J.className==="evolved"){return o.evolutionStroke}if(J.className==="anchor"){return"#000"}return o.componentLabelColor}).attr("font-size",i.labelFontSize).attr("font-weight",J=>J.className==="anchor"?"bold":"normal").attr("text-anchor",J=>J.className==="anchor"?"middle":"start").attr("dominant-baseline",J=>J.className==="anchor"?"middle":"auto").text(J=>J.label);if(l.annotations.length>0){const J=m.append("g").attr("class","wardley-annotations");l.annotations.forEach(oe=>{const se=oe.coordinates.map(re=>({x:_(re.x),y:C(re.y)}));if(se.length>1){for(let re=0;re{const ce=J.append("g").attr("class","wardley-annotation");ce.append("circle").attr("cx",re.x).attr("cy",re.y).attr("r",10).attr("fill","white").attr("stroke",o.axisColor).attr("stroke-width",1.5);ce.append("text").attr("x",re.x).attr("y",re.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",o.axisTextColor).attr("font-weight","bold").text(oe.number)})});if(l.annotationsBox){let oe=_(l.annotationsBox.x);let se=C(l.annotationsBox.y);const re=10;const ce=16;const ue=11;const xe=J.append("g").attr("class","wardley-annotations-box");const be=[...l.annotations].filter(he=>he.text).sort((he,ve)=>he.number-ve.number);const Ie=[];be.forEach((he,ve)=>{const ge=xe.append("text").attr("x",oe+re).attr("y",se+re+(ve+1)*ce).attr("font-size",ue).attr("fill",o.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${he.number}. ${he.text}`);Ie.push(ge)});if(Ie.length>0){let he=0;let ve=0;Ie.forEach(yt=>{const mt=yt.node();const ct=mt.getComputedTextLength();he=Math.max(he,ct);const Ge=mt.getBBox();ve=Math.max(ve,Ge.height)});const ge=he+re*2+105;const Ve=be.length*ce+re*2+ve/2;const Le=i.padding;const $e=d-i.padding-ge;const Ee=i.padding;const tt=f-i.padding-Ve;oe=Math.max(Le,Math.min(oe,$e));se=Math.max(Ee,Math.min(se,tt));Ie.forEach((yt,mt)=>{yt.attr("x",oe+re).attr("y",se+re+(mt+1)*ce)});xe.insert("rect","text").attr("x",oe).attr("y",se).attr("width",ge).attr("height",Ve).attr("fill","white").attr("stroke",o.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(l.notes.length>0){const J=m.append("g").attr("class","wardley-notes");l.notes.forEach(oe=>{const se=_(oe.x);const re=C(oe.y);J.append("text").attr("x",se).attr("y",re).attr("text-anchor","start").attr("font-size",11).attr("fill",o.axisTextColor).attr("font-weight","bold").text(oe.text)})}if(l.accelerators.length>0){const J=m.append("g").attr("class","wardley-accelerators");l.accelerators.forEach(oe=>{const se=_(oe.x);const re=C(oe.y);const ce=60;const ue=30;const xe=20;const be=` + M ${se} ${re-ue/2} + L ${se+ce-xe} ${re-ue/2} + L ${se+ce-xe} ${re-ue/2-8} + L ${se+ce} ${re} + L ${se+ce-xe} ${re+ue/2+8} + L ${se+ce-xe} ${re+ue/2} + L ${se} ${re+ue/2} + Z + `;J.append("path").attr("d",be).attr("fill","white").attr("stroke",o.componentStroke).attr("stroke-width",1);J.append("text").attr("x",se+ce/2).attr("y",re+ue/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",o.axisTextColor).attr("font-weight","bold").text(oe.name)})}if(l.deaccelerators.length>0){const J=m.append("g").attr("class","wardley-deaccelerators");l.deaccelerators.forEach(oe=>{const se=_(oe.x);const re=C(oe.y);const ce=60;const ue=30;const xe=20;const be=` + M ${se+ce} ${re-ue/2} + L ${se+xe} ${re-ue/2} + L ${se+xe} ${re-ue/2-8} + L ${se} ${re} + L ${se+xe} ${re+ue/2+8} + L ${se+xe} ${re+ue/2} + L ${se+ce} ${re+ue/2} + Z + `;J.append("path").attr("d",be).attr("fill","white").attr("stroke",o.componentStroke).attr("stroke-width",1);J.append("text").attr("x",se+ce/2).attr("y",re+ue/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",o.axisTextColor).attr("font-weight","bold").text(oe.name)})}},"draw");HXi={draw:GXi};WXi=B(({wardley:e}={})=>{const t=Vy();const n=Ji();const r=Cl(t,n.themeVariables);const i=Cl(r.wardley,e);return` + .wardley-background { + fill: ${i.backgroundColor}; + } + .wardley-axes line, .wardley-axes path { + stroke: ${i.axisColor}; + } + .wardley-axis-label { + fill: ${i.axisTextColor}; + } + .wardley-stage-label { + fill: ${i.axisTextColor}; + } + .wardley-grid line { + stroke: ${i.gridColor}; + } + .wardley-node circle { + fill: ${i.componentFill}; + stroke: ${i.componentStroke}; + } + .wardley-node-label { + fill: ${i.componentLabelColor}; + } + .wardley-link { + stroke: ${i.linkStroke}; + } + .wardley-link--dashed { + stroke-dasharray: 4 4; + } + .wardley-link-label { + fill: ${i.axisTextColor}; + } + .wardley-trend line { + stroke: ${i.evolutionStroke}; + } + .wardley-annotation-line { + stroke: ${i.annotationStroke}; + } + .wardley-annotation circle { + fill: ${i.annotationFill}; + stroke: ${i.annotationStroke}; + } + .wardley-annotation text { + fill: ${i.annotationTextColor}; + } + .wardley-annotations-box rect { + fill: ${i.annotationFill}; + stroke: ${i.annotationStroke}; + } + .wardley-annotations-box text { + fill: ${i.annotationTextColor}; + } + .wardley-pipeline-box { + stroke: ${i.componentStroke}; + } + .wardley-notes text { + fill: ${i.axisTextColor}; + } + `},"styles");YXi={parser:o7n,db:zXi,renderer:HXi,styles:WXi}});var L7n={};Oo(L7n,{diagram:()=>lji});function Ore(e){let t=e+1831565813|0;t=Math.imul(t^t>>>15,t|1);t^=t+Math.imul(t^t>>>7,t|61);return((t^t>>>14)>>>0)/4294967296}function A7n(e){let t=0;for(let n=0;n{rb();gh();nl();Ta();Aa();Yo();zg();S7n=B(()=>({domains:new Map,transitions:[]}),"createDefaultData");Bre=S7n();qXi=B(()=>Bre.domains,"getDomains");XXi=B(()=>Bre.transitions,"getTransitions");jXi=B(e=>{if(!e){return}for(const t of e){const n=t.domain;const r=(t.items??[]).map(i=>({label:i.label}));Bre.domains.set(n,{name:n,items:r})}},"setDomains");KXi=B(e=>{if(!e){return}Bre.transitions=e.filter(t=>{if(t.from===t.to){wt.warn(`Cynefin: self-loop transition on domain "${t.from}" is not meaningful and will be skipped.`);return false}return true}).map(t=>({from:t.from,to:t.to,label:t.label||void 0}))},"setTransitions");ZXi=B(()=>{return Cl({...ka.cynefin,...Ji().cynefin})},"getConfig");JXi=B(()=>{Da();Bre=S7n()},"clear");yIe={getDomains:qXi,getTransitions:XXi,setDomains:jXi,setTransitions:KXi,getConfig:ZXi,clear:JXi,setAccTitle:Ka,getAccTitle:is,setDiagramTitle:ys,getDiagramTitle:ss,getAccDescription:as,setAccDescription:os};QXi=B(e=>{mu(e,yIe);yIe.setDomains(e.domains);yIe.setTransitions(e.transitions)},"populate");eji={parse:B(async e=>{const t=await Pf("cynefin",e);wt.debug(t);QXi(t)},"parse")};B(Ore,"seededRandom");B(A7n,"hashString");B(k7n,"resolveSeed");B(R7n,"generateFoldPath");B(P7n,"generateHorizontalBoundary");B(I7n,"generateCliffPath");B(M7n,"generateConfusionPath");C7n={complex:{model:"Probe \u2192 Sense \u2192 Respond",practice:"Emergent Practices"},complicated:{model:"Sense \u2192 Analyse \u2192 Respond",practice:"Good Practices"},clear:{model:"Sense \u2192 Categorise \u2192 Respond",practice:"Best Practices"},chaotic:{model:"Act \u2192 Sense \u2192 Respond",practice:"Novel Practices"},confusion:{model:"",practice:"Disorder"}};tji=B((e,t)=>{const n=e/2;const r=t/2;return{complex:{cx:n/2,cy:r/2,x:0,y:0,w:n,h:r},complicated:{cx:n+n/2,cy:r/2,x:n,y:0,w:n,h:r},chaotic:{cx:n/2,cy:r+r/2,x:0,y:r,w:n,h:r},clear:{cx:n+n/2,cy:r+r/2,x:n,y:r,w:n,h:r},confusion:{cx:n,cy:r,x:n*.7,y:r*.7,w:n*.6,h:r*.6}}},"getDomainLayouts");nji=B(()=>{const e=Vy();const t=Ji();const n=Cl(e,t.themeVariables);return n.cynefin},"getCynefinDomainColors");Uct=3;rji=B((e,t,n,r)=>{const i=r.db;const o=i.getDomains();const a=i.getTransitions();const s=i.getDiagramTitle();const l=i.getAccTitle();const u=i.getAccDescription();const d=i.getConfig();const f=nji();wt.debug("Rendering Cynefin diagram");const h=d.width;const m=d.height;const g=d.padding;const x=d.showDomainDescriptions;const w=d.boundaryAmplitude;const _=h+g*2;const C=m+g*2;const A={complex:f.complexBg,complicated:f.complicatedBg,clear:f.clearBg,chaotic:f.chaoticBg,confusion:f.confusionBg};const P=Sc(t);Vs(P,C,_,d.useMaxWidth??true);P.attr("viewBox",`0 0 ${_} ${C}`);if(l){P.append("title").text(l)}if(u){P.append("desc").text(u)}const L=P.append("g").attr("transform",`translate(${g}, ${g})`);const I=tji(h,m);const N=k7n(d.seed,t);const O=L.append("g").attr("class","cynefin-backgrounds");const z=["complex","complicated","chaotic","clear"];for(const J of z){const oe=I[J];O.append("rect").attr("class","cynefinDomain").attr("x",oe.x).attr("y",oe.y).attr("width",oe.w).attr("height",oe.h).attr("fill",A[J]).attr("fill-opacity",.4).attr("stroke","none")}const U=L.append("g").attr("class","cynefin-boundaries");U.append("path").attr("class","cynefinBoundary").attr("d",R7n(h,m,N,w)).attr("fill","none");U.append("path").attr("class","cynefinBoundary").attr("d",P7n(h,m,N+100,w)).attr("fill","none");U.append("path").attr("class","cynefinCliff").attr("d",I7n(h,m)).attr("fill","none");const W=h*.15;const H=m*.15;L.append("path").attr("class","cynefinConfusion").attr("d",M7n(h/2,m/2,W,H)).attr("fill",A.confusion).attr("fill-opacity",.5);const $=L.append("g").attr("class","cynefin-labels");for(const J of z){const oe=I[J];$.append("text").attr("class","cynefinDomainLabel").attr("x",oe.cx).attr("y",x?oe.cy-30:oe.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(J.charAt(0).toUpperCase()+J.slice(1))}$.append("text").attr("class","cynefinDomainLabel").attr("x",h/2).attr("y",x?m/2-10:m/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion");if(x){const J=L.append("g").attr("class","cynefin-subtitles");for(const oe of z){const se=I[oe];const re=C7n[oe];J.append("text").attr("class","cynefinSubtitle").attr("x",se.cx).attr("y",se.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(re.model);J.append("text").attr("class","cynefinSubtitle").attr("x",se.cx).attr("y",se.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(re.practice)}J.append("text").attr("class","cynefinSubtitle").attr("x",h/2).attr("y",m/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(C7n.confusion.practice)}const K=L.append("g").attr("class","cynefin-items");const X=26;const j=10;const te=["complex","complicated","chaotic","clear","confusion"];for(const J of te){const oe=o.get(J);if(!oe||oe.items.length===0){continue}const se=I[J];const re=J==="confusion";let ce=oe.items;let ue=0;if(re&&oe.items.length>Uct){ue=oe.items.length-Uct;ce=oe.items.slice(0,Uct)}let xe;if(re){const be=x?22:14;xe=se.cy+be}else{xe=se.cy+(x?25:15)}[...ce].forEach((be,Ie)=>{const he=xe+Ie*(X+4);const ve=K.append("g");const ge=ve.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",X/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(be.label);let Ve=be.label.length*7;const Le=ge.node();if(Le&&typeof Le.getBBox==="function"){const tt=Le.getBBox();if(tt.width>0){Ve=tt.width}}const $e=Ve+j*2;const Ee=se.cx-$e/2;ve.attr("transform",`translate(${Ee}, ${he})`);ve.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",$e).attr("height",X).attr("rx",4).attr("ry",4).attr("fill",A[J]).attr("fill-opacity",.95);ge.attr("x",$e/2).attr("y",X/2)});if(ue>0){const be=xe+ce.length*(X+4);const Ie=`+${ue} more`;const he=K.append("g");const ve=he.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",X/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(Ie);let ge=Ie.length*7;const Ve=ve.node();if(Ve&&typeof Ve.getBBox==="function"){const Ee=Ve.getBBox();if(Ee.width>0){ge=Ee.width}}const Le=ge+j*2;const $e=se.cx-Le/2;he.attr("transform",`translate(${$e}, ${be})`);he.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",Le).attr("height",X).attr("rx",4).attr("ry",4).attr("fill",A[J]).attr("fill-opacity",.6);ve.attr("x",Le/2).attr("y",X/2)}}if(a.length>0){const J=P.select("defs").empty()?P.append("defs"):P.select("defs");const oe=`cynefin-arrow-${t}`;J.append("marker").attr("id",oe).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const se=L.append("g").attr("class","cynefin-arrows");a.forEach(re=>{const ce=I[re.from];const ue=I[re.to];if(!ce||!ue){return}if(re.from===re.to){wt.warn(`Cynefin renderer: skipping self-loop on domain "${re.from}"`);return}const xe=ce.cx;const be=ce.cy;const Ie=ue.cx;const he=ue.cy;const ve=(xe+Ie)/2;const ge=(be+he)/2;const Ve=Ie-xe;const Le=he-be;const $e=Math.sqrt(Ve*Ve+Le*Le);const Ee=$e*.15;const tt=-Le/$e;const yt=Ve/$e;const mt=ve+tt*Ee;const ct=ge+yt*Ee;se.append("path").attr("class","cynefinArrowLine").attr("d",`M${xe},${be} Q${mt},${ct} ${Ie},${he}`).attr("fill","none").attr("marker-end",`url(#${oe})`);if(re.label){se.append("text").attr("class","cynefinArrowLabel").attr("x",mt).attr("y",ct-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(re.label)}})}if(s){L.append("text").attr("class","cynefinTitle").attr("x",h/2).attr("y",-g/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(s)}},"draw");iji={draw:rji};oji=B(()=>{const e=Vy();const t=Ji();const n=Cl(e,t.themeVariables);return n.cynefin},"getCynefinTheme");aji=B(()=>{const e=oji();return` + .cynefinDomain { + stroke: none; + } + .cynefinDomainLabel { + font-size: ${e.domainFontSize}px; + font-weight: bold; + fill: ${e.labelColor}; + } + .cynefinSubtitle { + font-size: ${e.itemFontSize-1}px; + fill: ${e.textColor}; + font-style: italic; + } + .cynefinItem { + fill-opacity: 0.95; + stroke: ${e.boundaryColor}; + stroke-width: 1; + } + .cynefinItemText { + font-size: ${e.itemFontSize}px; + fill: ${e.textColor}; + } + .cynefinItemOverflow { + fill-opacity: 0.6; + stroke: ${e.boundaryColor}; + stroke-width: 1; + stroke-dasharray: 3 2; + } + .cynefinBoundary { + stroke: ${e.boundaryColor}; + stroke-width: ${e.boundaryWidth}; + stroke-dasharray: 6 3; + } + .cynefinCliff { + stroke: ${e.cliffColor}; + stroke-width: ${e.cliffWidth}; + } + .cynefinConfusion { + stroke: ${e.boundaryColor}; + stroke-width: 1.5; + stroke-dasharray: 4 2; + } + .cynefinArrowLine { + stroke: ${e.arrowColor}; + stroke-width: ${e.arrowWidth}; + fill: none; + } + .cynefinArrowHead { + fill: ${e.arrowColor}; + stroke: none; + } + .cynefinArrowLabel { + font-size: ${e.itemFontSize-1}px; + fill: ${e.textColor}; + } + .cynefinTitle { + font-size: ${e.domainFontSize+2}px; + font-weight: bold; + fill: ${e.labelColor}; + } + `},"styles");sji=aji;lji={parser:eji,db:yIe,renderer:iji,styles:sji}});var Vct,$ct,Gct,Hct,bIe,kD,NH,cji,N7n,O7n,uji,dji,fji,hji,pji,mji,gji,yji,bji,yu,Vg,xji,vji,_ji,B7n,Tji,wji,Pu,z7n,Y6,Eji,Cji,Wct,RD,Q_,Sji,F7n,Aji,PD;var zre=Ce(()=>{gh();Ta();Aa();Yo();Vct="";$ct="";Gct="";Hct=[];bIe=new Map;kD=B(e=>{return La(e,Mn())},"sanitizeText");NH=B(e=>{switch(e.type){case"terminal":return{...e,value:kD(e.value)};case"nonterminal":return{...e,name:kD(e.name)};case"sequence":return{...e,elements:e.elements.map(NH)};case"choice":return{...e,alternatives:e.alternatives.map(NH)};case"optional":return{...e,element:NH(e.element)};case"repetition":return{...e,element:NH(e.element),separator:e.separator?NH(e.separator):void 0};case"special":return{...e,text:kD(e.text)}}},"sanitizeAstNode");cji=B(()=>{Vct="";$ct="";Gct="";Hct.length=0;bIe.clear();Da();wt.debug("[Railroad] Database cleared")},"clear");N7n=B(e=>{Vct=kD(e);wt.debug("[Railroad] Title set:",e)},"setTitle");O7n=B(()=>{return Vct},"getTitle");uji=B(e=>{const t={...e,name:kD(e.name),definition:NH(e.definition),comment:e.comment?kD(e.comment):void 0};wt.debug("[Railroad] Adding rule:",t.name);if(bIe.has(t.name)){wt.warn(`[Railroad] Rule '${t.name}' is already defined. Overwriting.`)}Hct.push(t);bIe.set(t.name,t)},"addRule");dji=B(()=>{return Hct},"getRules");fji=B(e=>{return bIe.get(e)},"getRule");hji=B(e=>{$ct=kD(e).replace(/^\s+/g,"");wt.debug("[Railroad] Accessibility title set:",e)},"setAccTitle");pji=B(()=>{return $ct},"getAccTitle");mji=B(e=>{Gct=kD(e).replace(/\n\s+/g,"\n");wt.debug("[Railroad] Accessibility description set:",e)},"setAccDescription");gji=B(()=>{return Gct},"getAccDescription");yji=N7n;bji=O7n;yu={clear:cji,setTitle:N7n,getTitle:O7n,addRule:uji,getRules:dji,getRule:fji,setAccTitle:hji,getAccTitle:pji,setAccDescription:mji,getAccDescription:gji,setDiagramTitle:yji,getDiagramTitle:bji};Vg={compactMode:false,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:true,markerRadius:5};xji=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i;vji=/^[\w "',.-]+$/;_ji=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]);B7n=B(e=>{if(!e){return false}return Object.keys(e).every(t=>t==="railroad"||_ji.has(t))},"isRailroadStyleOptions");Tji=B(e=>{if(!e){return{}}if("railroad"in e&&e.railroad){return e.railroad}return B7n(e)?e:{}},"extractRailroadOverrides");wji=B(e=>{if(!e||B7n(e)){return{}}const{railroad:t,svgId:n,theme:r,look:i,...o}=e;return o},"extractThemeOverrides");Pu=B((e,t)=>{if(typeof e!=="string"){return t}const n=e.trim();return xji.test(n)?n:t},"sanitizeColorValue");z7n=B((e,t)=>{if(typeof e!=="string"){return t}const n=e.trim();return vji.test(n)?n:t},"sanitizeFontFamilyValue");Y6=B((e,t)=>{const n=typeof e==="number"?e:typeof e==="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(n)&&n>=0?n:t},"sanitizeNumberValue");Eji=B(e=>{const t=typeof e==="number"?e:typeof e==="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(t)&&t>0?t:void 0},"parseThemeFontSize");Cji=B(e=>{const t=z7n(e.fontFamily,Vg.fontFamily);const n=Eji(e.fontSize)??Vg.fontSize;return{...Vg,fontFamily:t,fontSize:n,terminalFill:Pu(e.secondBkg??e.secondaryColor,Vg.terminalFill),terminalStroke:Pu(e.secondaryBorderColor??e.lineColor,Vg.terminalStroke),terminalTextColor:Pu(e.secondaryTextColor??e.textColor,Vg.terminalTextColor),nonTerminalFill:Pu(e.mainBkg??e.background,Vg.nonTerminalFill),nonTerminalStroke:Pu(e.primaryBorderColor??e.lineColor,Vg.nonTerminalStroke),nonTerminalTextColor:Pu(e.primaryTextColor??e.textColor,Vg.nonTerminalTextColor),lineColor:Pu(e.lineColor,Vg.lineColor),markerFill:Pu(e.lineColor,Vg.markerFill),commentFill:Pu(e.labelBackground??e.tertiaryColor,Vg.commentFill),commentStroke:Pu(e.tertiaryBorderColor??e.lineColor,Vg.commentStroke),commentTextColor:Pu(e.tertiaryTextColor??e.textColor,Vg.commentTextColor),specialFill:Pu(e.tertiaryColor??e.secondaryColor,Vg.specialFill),specialStroke:Pu(e.tertiaryBorderColor??e.secondaryBorderColor,Vg.specialStroke),ruleNameColor:Pu(e.titleColor??e.textColor,Vg.ruleNameColor)}},"buildThemeDefaults");Wct=B(e=>{const t=Ji();const n={...Vy(),...t.themeVariables??{},...wji(e)};const r=Cji(n);const i={...t.railroad??{},...Tji(e)};return{compactMode:i.compactMode??r.compactMode,padding:Y6(i.padding,r.padding),verticalSeparation:Y6(i.verticalSeparation,r.verticalSeparation),horizontalSeparation:Y6(i.horizontalSeparation,r.horizontalSeparation),arcRadius:Y6(i.arcRadius,r.arcRadius),fontSize:Y6(i.fontSize,r.fontSize),fontFamily:z7n(i.fontFamily,r.fontFamily),terminalFill:Pu(i.terminalFill,r.terminalFill),terminalStroke:Pu(i.terminalStroke,r.terminalStroke),terminalTextColor:Pu(i.terminalTextColor,r.terminalTextColor),nonTerminalFill:Pu(i.nonTerminalFill,r.nonTerminalFill),nonTerminalStroke:Pu(i.nonTerminalStroke,r.nonTerminalStroke),nonTerminalTextColor:Pu(i.nonTerminalTextColor,r.nonTerminalTextColor),lineColor:Pu(i.lineColor,r.lineColor),strokeWidth:Y6(i.strokeWidth,r.strokeWidth),markerFill:Pu(i.markerFill,r.markerFill),commentFill:Pu(i.commentFill,r.commentFill),commentStroke:Pu(i.commentStroke,r.commentStroke),commentTextColor:Pu(i.commentTextColor,r.commentTextColor),specialFill:Pu(i.specialFill,r.specialFill),specialStroke:Pu(i.specialStroke,r.specialStroke),ruleNameColor:Pu(i.ruleNameColor,r.ruleNameColor),showMarkers:i.showMarkers??r.showMarkers,markerRadius:Y6(i.markerRadius,r.markerRadius)}},"buildRailroadStyleOptions");RD=B(e=>{const{fontFamily:t,fontSize:n,terminalFill:r,terminalStroke:i,terminalTextColor:o,nonTerminalFill:a,nonTerminalStroke:s,nonTerminalTextColor:l,lineColor:u,strokeWidth:d,markerFill:f,commentFill:h,commentStroke:m,commentTextColor:g,specialFill:x,specialStroke:w,ruleNameColor:_}=Wct(e);return` + .railroad-diagram { + font-family: ${t}; + font-size: ${n}px; + } + + .railroad-terminal rect { + fill: ${r}; + stroke: ${i}; + stroke-width: ${d}px; + } + + .railroad-terminal text { + fill: ${o}; + font-family: ${t}; + font-size: ${n}px; + text-anchor: middle; + dominant-baseline: middle; + } + + .railroad-nonterminal rect { + fill: ${a}; + stroke: ${s}; + stroke-width: ${d}px; + } + + .railroad-nonterminal text { + fill: ${l}; + font-family: ${t}; + font-size: ${n}px; + text-anchor: middle; + dominant-baseline: middle; + } + + .railroad-line { + stroke: ${u}; + stroke-width: ${d}px; + fill: none; + } + + .railroad-start circle, + .railroad-end circle { + fill: ${f}; + } + + .railroad-comment ellipse { + fill: ${h}; + stroke: ${m}; + stroke-width: ${d}px; + } + + .railroad-comment text { + fill: ${g}; + font-style: italic; + font-family: ${t}; + font-size: ${n}px; + text-anchor: middle; + dominant-baseline: middle; + } + + .railroad-special rect { + fill: ${x}; + stroke: ${w}; + stroke-width: ${d}px; + stroke-dasharray: 5,3; + } + + .railroad-special text { + fill: ${l}; + font-family: ${t}; + font-size: ${n}px; + text-anchor: middle; + dominant-baseline: middle; + } + + .railroad-rule-name { + font-weight: bold; + fill: ${_}; + font-family: ${t}; + font-size: ${n}px; + } + + .railroad-group { + /* Grouping container, no specific styles */ + } +`},"getStyles");Q_=class{constructor(){this.d=""}static{B(this,"PathBuilder")}moveTo(e,t){this.d+=`M ${e} ${t} `;return this}lineTo(e,t){this.d+=`L ${e} ${t} `;return this}horizontalTo(e){this.d+=`H ${e} `;return this}verticalTo(e){this.d+=`V ${e} `;return this}arcTo(e,t,n,r,i,o,a){this.d+=`A ${e} ${t} ${n} ${r?1:0} ${i?1:0} ${o} ${a} `;return this}build(){return this.d.trim()}};Sji=class{constructor(e,t=Wct()){this.textCache=new Map;this.svg=e;this.config=t}static{B(this,"RailroadRenderer")}measureText(e){if(this.textCache.has(e)){return this.textCache.get(e)}const t=this.svg.append("text").attr("font-family",this.config.fontFamily).attr("font-size",this.config.fontSize).text(e);const n=t.node().getBBox();const r={width:n.width,height:n.height};t.remove();this.textCache.set(e,r);return r}renderTerminal(e,t){const n=this.measureText(t);const r=n.width+this.config.padding*2;const i=n.height+this.config.padding*2;const o=e.append("g").attr("class","railroad-terminal");o.append("rect").attr("x",0).attr("y",0).attr("width",r).attr("height",i).attr("rx",10).attr("ry",10);o.append("text").attr("x",r/2).attr("y",i/2).text(t);return{element:o.node(),dimensions:{width:r,height:i,up:i/2,down:i/2}}}renderNonTerminal(e,t){const n=this.measureText(t);const r=n.width+this.config.padding*2;const i=n.height+this.config.padding*2;const o=e.append("g").attr("class","railroad-nonterminal");o.append("rect").attr("x",0).attr("y",0).attr("width",r).attr("height",i);o.append("text").attr("x",r/2).attr("y",i/2).text(t);return{element:o.node(),dimensions:{width:r,height:i,up:i/2,down:i/2}}}renderSequence(e,t){const n=t.map(l=>this.renderExpression(e,l));let r=0;let i=0;let o=0;for(const l of n){r+=l.dimensions.width;i=Math.max(i,l.dimensions.up);o=Math.max(o,l.dimensions.down)}r+=(n.length-1)*this.config.horizontalSeparation;const a=e.append("g").attr("class","railroad-sequence");let s=0;for(let l=0;lthis.renderExpression(e,f));let r=0;let i=0;for(const f of n){r=Math.max(r,f.dimensions.width);i+=f.dimensions.height}i+=(n.length-1)*this.config.verticalSeparation;const o=this.config.arcRadius;const a=o*4;const s=r+a;const l=e.append("g").attr("class","railroad-choice");let u=0;const d=i/2;for(const f of n){const h=u;const m=h+f.dimensions.up;const g=o*2+(r-f.dimensions.width)/2;const x=l.node().appendChild(f.element);x.setAttribute("transform",`translate(${g}, ${h})`);const w=new Q_;const _=m>d;if(m===d){w.moveTo(0,d).lineTo(g,m)}else{w.moveTo(0,d).arcTo(o,o,0,false,_,o,d+(_?o:-o)).lineTo(o,m-(_?o:-o)).arcTo(o,o,0,false,!_,o*2,m).lineTo(g,m)}l.append("path").attr("class","railroad-line").attr("d",w.build());const C=new Q_;const A=g+f.dimensions.width;const P=s-o*2;if(m===d){C.moveTo(A,m).lineTo(s,d)}else{C.moveTo(A,m).lineTo(P,m).arcTo(o,o,0,false,!_,s-o,m+(_?-o:o)).lineTo(s-o,d+(_?o:-o)).arcTo(o,o,0,false,_,s,d)}l.append("path").attr("class","railroad-line").attr("d",C.build());u+=f.dimensions.height+this.config.verticalSeparation}return{element:l.node(),dimensions:{width:s,height:i,up:d,down:i-d}}}renderOptional(e,t){const n=this.renderExpression(e,t);const r=this.config.arcRadius;const i=r*2;const o=n.dimensions.width+r*4;const a=n.dimensions.height+i;const s=e.append("g").attr("class","railroad-optional");const l=r*2;const u=i;const d=s.node().appendChild(n.element);d.setAttribute("transform",`translate(${l}, ${u})`);const f=u+n.dimensions.up;const h=new Q_().moveTo(0,f).lineTo(r*2,f);s.append("path").attr("class","railroad-line").attr("d",h.build());const m=new Q_().moveTo(l+n.dimensions.width,f).lineTo(o,f);s.append("path").attr("class","railroad-line").attr("d",m.build());const g=new Q_().moveTo(0,f).arcTo(r,r,0,false,false,r,f-r).lineTo(r,r).arcTo(r,r,0,false,true,r*2,0).lineTo(o-r*2,0).arcTo(r,r,0,false,true,o-r,r).lineTo(o-r,f-r).arcTo(r,r,0,false,false,o,f);s.append("path").attr("class","railroad-line").attr("d",g.build());return{element:s.node(),dimensions:{width:o,height:a,up:f,down:a-f}}}renderRepetition(e,t,n){const r=this.renderExpression(e,t);const i=this.config.arcRadius;const o=i*2;const a=r.dimensions.width+i*4;const s=n===0;const l=r.dimensions.height+o+(s?o:0);const u=e.append("g").attr("class","railroad-repetition");const d=i*2;const f=s?o:0;const h=u.node().appendChild(r.element);h.setAttribute("transform",`translate(${d}, ${f})`);const m=f+r.dimensions.up;u.append("path").attr("class","railroad-line").attr("d",new Q_().moveTo(0,m).lineTo(i*2,m).build());u.append("path").attr("class","railroad-line").attr("d",new Q_().moveTo(d+r.dimensions.width,m).lineTo(a,m).build());const g=f+r.dimensions.height+i;const x=new Q_().moveTo(d+r.dimensions.width,m).arcTo(i,i,0,false,true,d+r.dimensions.width+i,m+i).lineTo(d+r.dimensions.width+i,g).arcTo(i,i,0,false,true,d+r.dimensions.width,g+i).lineTo(i*2,g+i).arcTo(i,i,0,false,true,i,g).lineTo(i,m+i).arcTo(i,i,0,false,true,i*2,m);u.append("path").attr("class","railroad-line").attr("d",x.build());if(s){const w=new Q_().moveTo(0,m).arcTo(i,i,0,false,false,i,m-i).lineTo(i,i).arcTo(i,i,0,false,true,i*2,0).lineTo(a-i*2,0).arcTo(i,i,0,false,true,a-i,i).lineTo(a-i,m-i).arcTo(i,i,0,false,false,a,m);u.append("path").attr("class","railroad-line").attr("d",w.build())}return{element:u.node(),dimensions:{width:a,height:l,up:m,down:l-m}}}renderSpecial(e,t){const n=this.measureText("? "+t+" ?");const r=n.width+this.config.padding*2;const i=n.height+this.config.padding*2;const o=e.append("g").attr("class","railroad-special");o.append("rect").attr("x",0).attr("y",0).attr("width",r).attr("height",i);o.append("text").attr("x",r/2).attr("y",i/2).text("? "+t+" ?");return{element:o.node(),dimensions:{width:r,height:i,up:i/2,down:i/2}}}renderExpression(e,t){switch(t.type){case"terminal":return this.renderTerminal(e,t.value);case"nonterminal":return this.renderNonTerminal(e,t.name);case"sequence":return this.renderSequence(e,t.elements);case"choice":return this.renderChoice(e,t.alternatives);case"optional":return this.renderOptional(e,t.element);case"repetition":return this.renderRepetition(e,t.element,t.min);case"special":return this.renderSpecial(e,t.text);default:throw new Error(`Unknown node type: ${t.type}`)}}renderRule(e,t){const n=this.svg.append("g").attr("class","railroad-rule").attr("transform",`translate(0, ${t})`);const r=e.name+" =";const i=this.measureText(r).width+20;const o=i+20;const a=n.append("g");const s=this.renderExpression(a,e.definition);const l=Math.max(20,s.dimensions.up);const u=l-s.dimensions.up;a.attr("transform",`translate(${o}, ${u})`);const d=n.append("g").attr("class","railroad-rule-name-group");d.append("text").attr("class","railroad-rule-name").attr("x",0).attr("y",l).text(r);const f=n.append("g").attr("class","railroad-start");f.append("circle").attr("cx",i).attr("cy",l).attr("r",this.config.markerRadius);const h=n.append("g").attr("class","railroad-end");h.append("circle").attr("cx",o+s.dimensions.width+10).attr("cy",l).attr("r",this.config.markerRadius);n.append("path").attr("class","railroad-line").attr("d",new Q_().moveTo(i+this.config.markerRadius,l).lineTo(o,l).build());n.append("path").attr("class","railroad-line").attr("d",new Q_().moveTo(o+s.dimensions.width,l).lineTo(o+s.dimensions.width+10-this.config.markerRadius,l).build());return{height:Math.max(40,u+s.dimensions.height+this.config.padding*2),width:o+s.dimensions.width+10+this.config.markerRadius}}renderDiagram(e){let t=this.config.padding;let n=0;for(const r of e){const i=this.renderRule(r,t);t+=i.height+this.config.verticalSeparation;n=Math.max(n,i.width)}return{width:n+this.config.padding*2,height:t+this.config.padding}}};F7n=B((e,t,n)=>{Vs(e,t.height,t.width,n);e.attr("viewBox",`0 0 ${t.width} ${t.height}`)},"configureRailroadSvgSize");Aji=B((e,t,n)=>{wt.debug("[Railroad] Rendering diagram\n"+e);try{const r=Sc(t);r.attr("class","railroad-diagram");const i=Ji().railroad;const o=i?.useMaxWidth??true;const a=yu.getRules();wt.debug(`[Railroad] Rendering ${a.length} rules`);if(a.length===0){wt.warn("[Railroad] No rules to render");F7n(r,{height:100,width:200},o);return}const s=new Sji(r,Wct());const l=s.renderDiagram(a);F7n(r,l,o);wt.debug("[Railroad] Render complete")}catch(r){wt.error("[Railroad] Render error:",r);throw r}},"draw");PD={draw:Aji}});var V7n={};Oo(V7n,{default:()=>Mji,diagram:()=>U7n});var kji,OH,Rji,Pji,Iji,U7n,Mji;var $7n=Ce(()=>{zre();rb();gh();Ta();Aa();Yo();zg();kji=uH().Railroad.parser.LangiumParser;OH=B(e=>{switch(e.$type){case"RailroadTerminalExpr":return{type:"terminal",value:e.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:e.name};case"RailroadSpecialExpr":return{type:"special",text:e.text};case"RailroadSequenceExpr":{const t=e.elements.map(OH);return t.length===1?t[0]:{type:"sequence",elements:t}}case"RailroadChoiceExpr":{const t=e.alternatives.map(OH);return t.length===1?t[0]:{type:"choice",alternatives:t}}case"RailroadOptionalExpr":return{type:"optional",element:OH(e.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:OH(e.element),min:1,max:Infinity};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:OH(e.element),min:0,max:Infinity};default:throw new Error(`Unsupported railroad expression: ${e.$type}`)}},"transformExpression");Rji=B(e=>{return{name:e.name,definition:OH(e.definition)}},"transformRule");Pji=B(e=>{mu(e,yu);if(e.title){yu.setTitle(e.title)}e.rules.map(t=>yu.addRule(Rji(t)))},"populateDb");Iji={parse:B(e=>{yu.clear();wt.debug("[Railroad Parser] Starting Langium parse");const t=kji.parse(e);if(t.lexerErrors.length>0||t.parserErrors.length>0){throw new sP(t)}const n=t.value;wt.debug("[Railroad Parser] Parsed rules:",n.rules.length);Pji(n);wt.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:yu}};U7n={parser:Iji,db:yu,renderer:PD,styles:RD};Mji=U7n});var H7n={};Oo(H7n,{diagram:()=>Uji});var Lji,xIe,Dji,G7n,Fji,Nji,Oji,Bji,zji,Uji;var W7n=Ce(()=>{zre();rb();gh();Ta();Aa();Yo();zg();Lji=dH().RailroadEbnf.parser.LangiumParser;xIe=B(e=>{const t=e.alternatives.map(Dji);if(t.length===1){return t[0]}return{type:"choice",alternatives:t}},"transformChoice");Dji=B(e=>{const t=e.elements.map(Nji);if(t.length===1){return t[0]}return{type:"sequence",elements:t}},"transformSequence");G7n=B(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return xIe(e.element);case"EbnfOptional":return{type:"optional",element:xIe(e.element)};case"EbnfRepetition":return{type:"repetition",element:xIe(e.element),min:0,max:Infinity};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary");Fji=B((e,t)=>{switch(t.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:Infinity};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:Infinity};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},G7n(t.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${t.$type}`)}},"transformPostfix");Nji=B(e=>{return e.postfixes.reduce((t,n)=>{return Fji(t,n)},G7n(e.base))},"transformTerm");Oji=B(e=>{return{name:e.name,definition:xIe(e.definition)}},"transformRule");Bji=B(e=>{mu(e,yu);if(e.title){yu.setTitle(e.title)}e.rules.map(t=>yu.addRule(Oji(t)))},"populateDb");zji={parse:B(e=>{yu.clear();wt.debug("[EBNF Parser] Starting Langium parse");const t=Lji.parse(e);if(t.lexerErrors.length>0||t.parserErrors.length>0){throw new sP(t)}const n=t.value;wt.debug("[EBNF Parser] Parsed rules:",n.rules.length);Bji(n);wt.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:yu}};Uji={parser:zji,db:yu,renderer:PD,styles:RD}});var Y7n={};Oo(Y7n,{diagram:()=>jji});var Vji,Yct,$ji,Gji,Hji,Wji,Yji,qji,Xji,jji;var q7n=Ce(()=>{zre();rb();gh();Ta();Aa();Yo();zg();Vji=fH().RailroadAbnf.parser.LangiumParser;Yct=B(e=>{const t=e.alternatives.map($ji);if(t.length===1){return t[0]}return{type:"choice",alternatives:t}},"transformAlternation");$ji=B(e=>{const t=e.elements.map(Hji);if(t.length===1){return t[0]}return{type:"sequence",elements:t}},"transformConcatenation");Gji=B(e=>{if(e.includes("*")){const[n,r]=e.split("*");const i=n?parseInt(n,10):0;const o=r?parseInt(r,10):Infinity;return{min:i,max:o}}const t=parseInt(e,10);return{min:t,max:t}},"parseRepeat");Hji=B(e=>{const t=Wji(e.primary);if(!e.repeat){return t}const{min:n,max:r}=Gji(e.repeat);if(n===0&&r===1){return{type:"optional",element:t}}return{type:"repetition",element:t,min:n,max:r}},"transformElement");Wji=B(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return Yct(e.element);case"AbnfOptionalGroup":return{type:"optional",element:Yct(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary");Yji=B(e=>{return{name:e.name,definition:Yct(e.definition)}},"transformRule");qji=B(e=>{mu(e,yu);if(e.title){yu.setTitle(e.title)}e.rules.map(t=>yu.addRule(Yji(t)))},"populateDb");Xji={parse:B(e=>{yu.clear();wt.debug("[ABNF Parser] Starting Langium parse");const t=Vji.parse(e);if(t.lexerErrors.length>0||t.parserErrors.length>0){throw new sP(t)}const n=t.value;wt.debug("[ABNF Parser] Parsed rules:",n.rules.length);qji(n);wt.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:yu}};jji={parser:Xji,db:yu,renderer:PD,styles:RD}});var K7n={};Oo(K7n,{diagram:()=>iKi});var Kji,j7n,Zji,Jji,X7n,Qji,eKi,tKi,nKi,rKi,iKi;var Z7n=Ce(()=>{zre();rb();gh();Ta();Aa();Yo();zg();Kji=hH().RailroadPeg.parser.LangiumParser;j7n=B(e=>{const t=e.alternatives.map(Zji);if(t.length===1){return t[0]}return{type:"choice",alternatives:t}},"transformOrderedChoice");Zji=B(e=>{const t=e.elements.map(Jji);if(t.length===1){return t[0]}return{type:"sequence",elements:t}},"transformSequence");Jji=B(e=>{const t=Qji(e.suffix);if(!e.operator){return t}const n=e.operator==="&"?`&${X7n(t)}`:`!${X7n(t)}`;return{type:"special",text:n}},"transformPrefix");X7n=B(e=>{switch(e.type){case"terminal":return`"${e.value}"`;case"nonterminal":return e.name;case"special":return e.text;default:return"(...)"}},"nodeToLabel");Qji=B(e=>{const t=eKi(e.primary);if(!e.operator){return t}switch(e.operator){case"?":return{type:"optional",element:t};case"*":return{type:"repetition",element:t,min:0,max:Infinity};case"+":return{type:"repetition",element:t,min:1,max:Infinity};default:throw new Error(`Unsupported PEG suffix operator: ${e.operator}`)}},"transformSuffix");eKi=B(e=>{switch(e.$type){case"PegLiteral":return{type:"terminal",value:e.value};case"PegIdentifier":return{type:"nonterminal",name:e.name};case"PegGroup":return j7n(e.element);case"PegAny":return{type:"special",text:e.dot};default:throw new Error(`Unsupported PEG primary node: ${e.$type}`)}},"transformPrimary");tKi=B(e=>{return{name:e.name,definition:j7n(e.definition)}},"transformRule");nKi=B(e=>{mu(e,yu);if(e.title){yu.setTitle(e.title)}e.rules.map(t=>yu.addRule(tKi(t)))},"populateDb");rKi={parse:B(e=>{yu.clear();wt.debug("[PEG Parser] Starting Langium parse");const t=Kji.parse(e);if(t.lexerErrors.length>0||t.parserErrors.length>0){throw new sP(t)}const n=t.value;wt.debug("[PEG Parser] Parsed rules:",n.rules.length);nKi(n);wt.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:yu}};iKi={parser:rKi,db:yu,renderer:PD,styles:RD}});var t9n={};Oo(t9n,{default:()=>EQi});function Vzn(e,t){e.attr("role",GJi);if(t!==""){e.attr("aria-roledescription",t)}}function $zn(e,t,n,r){if(e.insert===void 0){return}if(n){const i=`chart-desc-${r}`;e.attr("aria-describedby",i);e.insert("desc",":first-child").attr("id",i).text(n)}if(t){const i=`chart-title-${r}`;e.attr("aria-labelledby",i);e.insert("title",":first-child").attr("id",i).text(t)}}function Hzn(e){const t=e.match(SXe);if(!t){return{text:e,metadata:{}}}const n=t[1];const r=n?t[2].split("\n").map(a=>a.startsWith(n)?a.slice(n.length):a).join("\n"):t[2];let i=gL(r,{schema:mL})??{};i=typeof i==="object"&&!Array.isArray(i)?i:{};const o={};if(i.displayMode){o.displayMode=i.displayMode.toString()}if(i.title){o.title=i.title.toString()}if(i.config){o.config=i.config}return{text:e.slice(t[0].length),metadata:o}}function Kct(e){const t=YJi(e);const n=qJi(t);const r=XJi(n.text);const i=Cl(n.config,r.directive);e=WJi(r.text);return{code:e,title:n.title,config:i}}function Wzn(e){const t=new TextEncoder().encode(e);const n=Array.from(t,r=>String.fromCodePoint(r)).join("");return btoa(n)}function Zct(e){const t=Kct(e);QQ();aln(t.config??{});return t}async function Yzn(e,t){_Ie();try{const{code:n,config:r}=Zct(e);const i=await Xzn(n);return{diagramType:i.type,config:r}}catch(n){if(t?.suppressErrors){return false}throw n}}function jct(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}function qzn(e={}){const t=rf({},e);if(t?.fontFamily&&!t.themeVariables?.fontFamily){if(!t.themeVariables){t.themeVariables={}}t.themeVariables.fontFamily=t.fontFamily}rln(t);if(t?.theme&&t.theme in FC){t.themeVariables=FC[t.theme].getThemeVariables(t.themeVariables)}else if(t){t.themeVariables=FC.default.getThemeVariables(t.themeVariables)}const n=typeof t==="object"?nln(t):EXe();MQ(n.logLevel);_Ie()}function jzn(e,t,n,r){Vzn(t,e);$zn(t,n,r,t.attr("id"))}var nzn,oKi,aKi,sKi,lKi,rzn,cKi,uKi,dKi,fKi,izn,hKi,pKi,mKi,gKi,ozn,yKi,bKi,xKi,vKi,azn,_Ki,TKi,wKi,EKi,szn,CKi,SKi,AKi,kKi,lzn,RKi,PKi,IKi,MKi,czn,LKi,DKi,FKi,uzn,NKi,OKi,BKi,dzn,zKi,UKi,VKi,$Ki,fzn,GKi,HKi,WKi,YKi,hzn,qKi,XKi,jKi,KKi,pzn,ZKi,JKi,QKi,eZi,mzn,tZi,nZi,rZi,iZi,gzn,oZi,aZi,sZi,lZi,yzn,cZi,uZi,dZi,fZi,bzn,hZi,pZi,mZi,gZi,xzn,yZi,bZi,xZi,vZi,_Zi,vzn,TZi,wZi,EZi,_zn,CZi,SZi,AZi,kZi,Tzn,RZi,PZi,IZi,MZi,wzn,LZi,DZi,FZi,NZi,Ezn,OZi,BZi,zZi,UZi,Czn,VZi,$Zi,GZi,HZi,Szn,WZi,YZi,qZi,Azn,XZi,jZi,KZi,kzn,ZZi,JZi,QZi,eJi,Rzn,tJi,nJi,rJi,iJi,Pzn,oJi,aJi,sJi,lJi,Izn,cJi,uJi,dJi,fJi,Mzn,hJi,pJi,mJi,Lzn,gJi,yJi,bJi,xJi,Dzn,vJi,_Ji,TJi,Fzn,wJi,EJi,CJi,SJi,Nzn,AJi,kJi,RJi,Ozn,PJi,IJi,MJi,Bzn,LJi,DJi,FJi,zzn,NJi,OJi,BJi,Uzn,zJi,UJi,VJi,J7n,_Ie,$Ji,GJi,Xct,Q7n,HJi,WJi,YJi,qJi,XJi,jJi,KJi,ZJi,JJi,QJi,eQi,tQi,nQi,rQi,iQi,oQi,aQi,sQi,lQi,cQi,ezn,uQi,dQi,fQi,hQi,pQi,tzn,mQi,gQi,Xzn,q6,yQi,Kzn,bQi,Zzn,xQi,vQi,Jzn,_Qi,vIe,qct,Qzn,TQi,e9n,wQi,bP,EQi;var n9n=Ce(()=>{gh();Y5();Tx();yx();kg();Eg();K0();Sg();Np();Jh();nl();Ta();Aa();Yo();uKe();ks();R2n();KV();yEe();nzn="c4";oKi=B(e=>{return/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e)},"detector");aKi=B(async()=>{const{diagram:e}=await Promise.resolve().then(()=>(G2n(),$2n));return{id:nzn,diagram:e}},"loader");sKi={id:nzn,detector:oKi,loader:aKi};lKi=sKi;rzn="flowchart";cKi=B((e,t)=>{if(t?.flowchart?.defaultRenderer==="dagre-wrapper"||t?.flowchart?.defaultRenderer==="elk"){return false}return/^\s*graph/.test(e)},"detector");uKi=B(async()=>{const{diagram:e}=await Promise.resolve().then(()=>(KSe(),jSe));return{id:rzn,diagram:e}},"loader");dKi={id:rzn,detector:cKi,loader:uKi};fKi=dKi;izn="flowchart-v2";hKi=B((e,t)=>{if(t?.flowchart?.defaultRenderer==="dagre-d3"){return false}if(t?.flowchart?.defaultRenderer==="elk"){t.layout="elk"}if(/^\s*graph/.test(e)&&t?.flowchart?.defaultRenderer==="dagre-wrapper"){return true}return/^\s*flowchart/.test(e)},"detector");pKi=B(async()=>{const{diagram:e}=await Promise.resolve().then(()=>(KSe(),jSe));return{id:izn,diagram:e}},"loader");mKi={id:izn,detector:hKi,loader:pKi};gKi=mKi;ozn="swimlane";yKi=B(e=>{return/^\s*swimlane-beta\b/.test(e)},"detector");bKi=B(async()=>{const{diagram:e}=await Promise.resolve().then(()=>(X2n(),q2n));return{id:ozn,diagram:e}},"loader");xKi={id:ozn,detector:yKi,loader:bKi};vKi=xKi;azn="er";_Ki=B(e=>{return/^\s*erDiagram/.test(e)},"detector");TKi=B(async()=>{const{diagram:e}=await Promise.resolve().then(()=>(J2n(),Z2n));return{id:azn,diagram:e}},"loader");wKi={id:azn,detector:_Ki,loader:TKi};EKi=wKi;szn="gitGraph";CKi=B(e=>{return/^\s*gitGraph/.test(e)},"detector");SKi=B(async()=>{const{diagram:e}=await Promise.resolve().then(()=>(sNn(),aNn));return{id:szn,diagram:e}},"loader");AKi={id:szn,detector:CKi,loader:SKi};kKi=AKi;lzn="gantt";RKi=B(e=>{return/^\s*gantt/.test(e)},"detector");PKi=B(async()=>{const{diagram:e}=await Promise.resolve().then(()=>(PNn(),RNn));return{id:lzn,diagram:e}},"loader");IKi={id:lzn,detector:RKi,loader:PKi};MKi=IKi;czn="info";LKi=B(e=>{return/^\s*info/.test(e)},"detector");DKi=B(async()=>{const{diagram:e}=await Promise.resolve().then(()=>(MNn(),INn));return{id:czn,diagram:e}},"loader");FKi={id:czn,detector:LKi,loader:DKi};uzn="pie";NKi=B(e=>{return/^\s*pie/.test(e)},"detector");OKi=B(async()=>{const{diagram:e}=await Promise.resolve().then(()=>(NNn(),FNn));return{id:uzn,diagram:e}},"loader");BKi={id:uzn,detector:NKi,loader:OKi};dzn="quadrantChart";zKi=B(e=>{return/^\s*quadrantChart/.test(e)},"detector");UKi=B(async()=>{const{diagram:e}=await Promise.resolve().then(()=>(QNn(),JNn));return{id:dzn,diagram:e}},"loader");VKi={id:dzn,detector:zKi,loader:UKi};$Ki=VKi;fzn="xychart";GKi=B(e=>{return/^\s*xychart(-beta)?/.test(e)},"detector");HKi=B(async()=>{const{diagram:e}=await Promise.resolve().then(()=>(_On(),vOn));return{id:fzn,diagram:e}},"loader");WKi={id:fzn,detector:GKi,loader:HKi};YKi=WKi;hzn="requirement";qKi=B(e=>{return/^\s*requirement(Diagram)?/.test(e)},"detector");XKi=B(async()=>{const{diagram:e}=await Promise.resolve().then(()=>(EOn(),wOn));return{id:hzn,diagram:e}},"loader");jKi={id:hzn,detector:qKi,loader:XKi};KKi=jKi;pzn="sequence";ZKi=B(e=>{return/^\s*sequenceDiagram/.test(e)},"detector");JKi=B(async()=>{const{diagram:e}=await Promise.resolve().then(()=>(zOn(),BOn));return{id:pzn,diagram:e}},"loader");QKi={id:pzn,detector:ZKi,loader:JKi};eZi=QKi;mzn="class";tZi=B((e,t)=>{if(t?.class?.defaultRenderer==="dagre-wrapper"){return false}return/^\s*classDiagram/.test(e)},"detector");nZi=B(async()=>{const{diagram:e}=await Promise.resolve().then(()=>(HOn(),GOn));return{id:mzn,diagram:e}},"loader");rZi={id:mzn,detector:tZi,loader:nZi};iZi=rZi;gzn="classDiagram";oZi=B((e,t)=>{if(/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer==="dagre-wrapper"){return true}return/^\s*classDiagram-v2/.test(e)},"detector");aZi=B(async()=>{const{diagram:e}=await Promise.resolve().then(()=>(YOn(),WOn));return{id:gzn,diagram:e}},"loader");sZi={id:gzn,detector:oZi,loader:aZi};lZi=sZi;yzn="state";cZi=B((e,t)=>{if(t?.state?.defaultRenderer==="dagre-wrapper"){return false}return/^\s*stateDiagram/.test(e)},"detector");uZi=B(async()=>{const{diagram:e}=await Promise.resolve().then(()=>(b5n(),y5n));return{id:yzn,diagram:e}},"loader");dZi={id:yzn,detector:cZi,loader:uZi};fZi=dZi;bzn="stateDiagram";hZi=B((e,t)=>{if(/^\s*stateDiagram-v2/.test(e)){return true}if(/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer==="dagre-wrapper"){return true}return false},"detector");pZi=B(async()=>{const{diagram:e}=await Promise.resolve().then(()=>(v5n(),x5n));return{id:bzn,diagram:e}},"loader");mZi={id:bzn,detector:hZi,loader:pZi};gZi=mZi;xzn="journey";yZi=B(e=>{return/^\s*journey/.test(e)},"detector");bZi=B(async()=>{const{diagram:e}=await Promise.resolve().then(()=>(P5n(),R5n));return{id:xzn,diagram:e}},"loader");xZi={id:xzn,detector:yZi,loader:bZi};vZi=xZi;_Zi=B((e,t,n)=>{wt.debug("rendering svg for syntax error\n");const r=Sc(t);const i=r.append("g");r.attr("viewBox","0 0 2412 512");Vs(r,100,512,true);i.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z");i.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z");i.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z");i.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z");i.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z");i.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z");i.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text");i.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${n}`)},"draw");vzn={draw:_Zi};TZi=vzn;wZi={db:{},renderer:vzn,parser:{parse:B(()=>{return},"parse")}};EZi=wZi;_zn="flowchart-elk";CZi=B((e,t={})=>{if(/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer==="elk"){t.layout="elk";return true}return false},"detector");SZi=B(async()=>{const{diagram:e}=await Promise.resolve().then(()=>(KSe(),jSe));return{id:_zn,diagram:e}},"loader");AZi={id:_zn,detector:CZi,loader:SZi};kZi=AZi;Tzn="timeline";RZi=B(e=>{return/^\s*timeline/.test(e)},"detector");PZi=B(async()=>{const{diagram:e}=await Promise.resolve().then(()=>(tBn(),eBn));return{id:Tzn,diagram:e}},"loader");IZi={id:Tzn,detector:RZi,loader:PZi};MZi=IZi;wzn="mindmap";LZi=B(e=>{return/^\s*mindmap/.test(e)},"detector");DZi=B(async()=>{const{diagram:e}=await Promise.resolve().then(()=>(rBn(),nBn));return{id:wzn,diagram:e}},"loader");FZi={id:wzn,detector:LZi,loader:DZi};NZi=FZi;Ezn="kanban";OZi=B(e=>{return/^\s*kanban/.test(e)},"detector");BZi=B(async()=>{const{diagram:e}=await Promise.resolve().then(()=>(aBn(),oBn));return{id:Ezn,diagram:e}},"loader");zZi={id:Ezn,detector:OZi,loader:BZi};UZi=zZi;Czn="sankey";VZi=B(e=>{return/^\s*sankey(-beta)?/.test(e)},"detector");$Zi=B(async()=>{const{diagram:e}=await Promise.resolve().then(()=>(yBn(),gBn));return{id:Czn,diagram:e}},"loader");GZi={id:Czn,detector:VZi,loader:$Zi};HZi=GZi;Szn="packet";WZi=B(e=>{return/^\s*packet(-beta)?/.test(e)},"detector");YZi=B(async()=>{const{diagram:e}=await Promise.resolve().then(()=>(_Bn(),vBn));return{id:Szn,diagram:e}},"loader");qZi={id:Szn,detector:WZi,loader:YZi};Azn="radar";XZi=B(e=>{return/^\s*radar-beta/.test(e)},"detector");jZi=B(async()=>{const{diagram:e}=await Promise.resolve().then(()=>(RBn(),kBn));return{id:Azn,diagram:e}},"loader");KZi={id:Azn,detector:XZi,loader:jZi};kzn="block";ZZi=B(e=>{return/^\s*block(-beta)?/.test(e)},"detector");JZi=B(async()=>{const{diagram:e}=await Promise.resolve().then(()=>(s6n(),a6n));return{id:kzn,diagram:e}},"loader");QZi={id:kzn,detector:ZZi,loader:JZi};eJi=QZi;Rzn="treeView";tJi=B(e=>{return/^\s*treeView-beta/.test(e)},"detector");nJi=B(async()=>{const{diagram:e}=await Promise.resolve().then(()=>(_6n(),v6n));return{id:Rzn,diagram:e}},"loader");rJi={id:Rzn,detector:tJi,loader:nJi};iJi=rJi;Pzn="architecture";oJi=B(e=>{return/^\s*architecture/.test(e)},"detector");aJi=B(async()=>{const{diagram:e}=await Promise.resolve().then(()=>(U6n(),z6n));return{id:Pzn,diagram:e}},"loader");sJi={id:Pzn,detector:oJi,loader:aJi};lJi=sJi;Izn="eventmodeling";cJi=B(e=>{return/^\s*eventmodeling/.test(e)},"detector");uJi=B(async()=>{const{diagram:e}=await Promise.resolve().then(()=>(m8n(),p8n));return{id:Izn,diagram:e}},"loader");dJi={id:Izn,detector:cJi,loader:uJi};fJi=dJi;Mzn="ishikawa";hJi=B(e=>{return/^\s*ishikawa(-beta)?\b/i.test(e)},"detector");pJi=B(async()=>{const{diagram:e}=await Promise.resolve().then(()=>(C8n(),E8n));return{id:Mzn,diagram:e}},"loader");mJi={id:Mzn,detector:hJi,loader:pJi};Lzn="venn";gJi=B(e=>{return/^\s*venn-beta/.test(e)},"detector");yJi=B(async()=>{const{diagram:e}=await Promise.resolve().then(()=>(J8n(),Z8n));return{id:Lzn,diagram:e}},"loader");bJi={id:Lzn,detector:gJi,loader:yJi};xJi=bJi;Dzn="treemap";vJi=B(e=>{return/^\s*treemap/.test(e)},"detector");_Ji=B(async()=>{const{diagram:e}=await Promise.resolve().then(()=>(r7n(),n7n));return{id:Dzn,diagram:e}},"loader");TJi={id:Dzn,detector:vJi,loader:_Ji};Fzn="wardley";wJi=B(e=>{return/^\s*wardley-beta/i.test(e)},"detector");EJi=B(async()=>{const{diagram:e}=await Promise.resolve().then(()=>(E7n(),w7n));return{id:Fzn,diagram:e}},"loader");CJi={id:Fzn,detector:wJi,loader:EJi};SJi=CJi;Nzn="cynefin";AJi=B(e=>{return/^\s*cynefin-beta(?:[\s:]|$)/.test(e)},"detector");kJi=B(async()=>{const{diagram:e}=await Promise.resolve().then(()=>(D7n(),L7n));return{id:Nzn,diagram:e}},"loader");RJi={id:Nzn,detector:AJi,loader:kJi};Ozn="railroad";PJi=B(e=>{return/^\s*railroad-beta/i.test(e)},"detector");IJi=B(async()=>{const{diagram:e}=await Promise.resolve().then(()=>($7n(),V7n));return{id:Ozn,diagram:e}},"loader");MJi={id:Ozn,detector:PJi,loader:IJi};Bzn="railroadEbnf";LJi=B(e=>{return/^\s*railroad-ebnf-beta/i.test(e)},"detector");DJi=B(async()=>{const{diagram:e}=await Promise.resolve().then(()=>(W7n(),H7n));return{id:Bzn,diagram:e}},"loader");FJi={id:Bzn,detector:LJi,loader:DJi};zzn="railroadAbnf";NJi=B(e=>{return/^\s*railroad-abnf-beta/i.test(e)},"detector");OJi=B(async()=>{const{diagram:e}=await Promise.resolve().then(()=>(q7n(),Y7n));return{id:zzn,diagram:e}},"loader");BJi={id:zzn,detector:NJi,loader:OJi};Uzn="railroadPeg";zJi=B(e=>{return/^\s*railroad-peg-beta/i.test(e)},"detector");UJi=B(async()=>{const{diagram:e}=await Promise.resolve().then(()=>(Z7n(),K7n));return{id:Uzn,diagram:e}},"loader");VJi={id:Uzn,detector:zJi,loader:UJi};J7n=false;_Ie=B(()=>{if(J7n){return}J7n=true;ree("error",EZi,e=>{return e.toLowerCase().trim()==="error"});ree("---",{db:{clear:B(()=>{},"clear")},styles:{},renderer:{draw:B(()=>{},"draw")},parser:{parse:B(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:B(()=>null,"init")},e=>{return e.toLowerCase().trimStart().startsWith("---")});if(true){r2e(kZi,NZi,lJi)}r2e(lKi,UZi,lZi,iZi,EKi,MKi,FKi,BKi,KKi,eZi,vKi,gKi,fKi,MZi,kKi,gZi,fZi,vZi,$Ki,HZi,qZi,YKi,eJi,fJi,iJi,KZi,mJi,TJi,MJi,FJi,BJi,VJi,xJi,SJi,RJi)},"addDiagrams");$Ji=B(async()=>{wt.debug(`Loading registered diagrams`);const e=await Promise.allSettled(Object.entries(cL).map(async([n,{detector:r,loader:i}])=>{if(!i){return}try{l2e(n)}catch{try{const{diagram:o,id:a}=await i();ree(a,o,r)}catch(o){wt.error(`Failed to load external diagram with key ${n}. Removing from detectors.`);delete cL[n];throw o}}}));const t=e.filter(n=>n.status==="rejected");if(t.length>0){wt.error(`Failed to load ${t.length} external diagrams`);for(const n of t){wt.error(n)}throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams");GJi="graphics-document document";B(Vzn,"setA11yDiagramInfo");B($zn,"addSVGa11yTitleDescription");Xct=class Gzn{constructor(t,n,r,i,o){this.type=t;this.text=n;this.db=r;this.parser=i;this.renderer=o}static{B(this,"Diagram")}static async fromText(t,n={}){const r=Ji();const i=eee(t,r);t=Vhn(t)+"\n";try{l2e(i)}catch{const u=cln(i);if(!u){throw new AXe(`Diagram ${i} not found.`)}const{id:d,diagram:f}=await u();ree(d,f)}const{db:o,parser:a,renderer:s,init:l}=l2e(i);if(a.parser){a.parser.yy=o}o.clear?.();l?.(r);if(n.title){o.setDiagramTitle?.(n.title)}await a.parse(t);return new Gzn(i,t,o,a,s)}async render(t,n){await this.renderer.draw(this.text,t,n,this)}getParser(){return this.parser}getType(){return this.type}};Q7n=[];HJi=B(()=>{Q7n.forEach(e=>{e()});Q7n=[]},"attachFunctions");WJi=B(e=>{return e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart()},"cleanupComments");B(Hzn,"extractFrontMatter");YJi=B(e=>{return e.replace(/\r\n?/g,"\n").replace(/<(\w+)([^>]*)>/g,(t,n,r)=>"<"+n+r.replace(/="([^"]*)"/g,"='$1'")+">")},"cleanupText");qJi=B(e=>{const{text:t,metadata:n}=Hzn(e);const{displayMode:r,title:i,config:o={}}=n;if(r){if(!o.gantt){o.gantt={}}o.gantt.displayMode=r}return{title:i,config:o,text:t}},"processFrontmatter");XJi=B(e=>{const t=Ko.detectInit(e)??{};const n=Ko.detectDirective(e,"wrap");if(Array.isArray(n)){t.wrap=n.some(({type:r})=>r==="wrap")}else if(n?.type==="wrap"){t.wrap=true}return{text:Fhn(e),directive:t}},"processDirectives");B(Kct,"preprocessDiagram");B(Wzn,"toBase64");jJi=5e4;KJi="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa";ZJi="sandbox";JJi="loose";QJi="http://www.w3.org/2000/svg";eQi="http://www.w3.org/1999/xlink";tQi="http://www.w3.org/1999/xhtml";nQi="100%";rQi="100%";iQi="border:0;margin:0;";oQi="margin:0";aQi="allow-top-navigation-by-user-activation allow-popups";sQi='The "iframe" tag is not supported by your browser.';lQi=["foreignobject"];cQi=["dominant-baseline"];B(Zct,"processAndSetConfigs");B(Yzn,"parse");ezn=B((e,t,n=[])=>{const r=wXe(`{ ${n.join(" !important; ")} !important; }`);return`.${e} ${t} ${r}`},"cssImportantStyles");uQi=B((e,t=new Map)=>{const n=new CSSStyleSheet;if(e.fontFamily!==void 0){n.insertRule(`:root { --mermaid-font-family: ${e.fontFamily}}`,n.cssRules.length)}if(e.altFontFamily!==void 0){n.insertRule(`:root { --mermaid-alt-font-family: ${e.altFontFamily}}`,n.cssRules.length)}if(t instanceof Map){const i=oc(e);const o=["> *","span"];const a=["rect","polygon","ellipse","circle","path"];const s=i?o:a;t.forEach(l=>{if(!gEe(l.styles)){s.forEach(u=>{n.insertRule(ezn(l.id,u,l.styles),n.cssRules.length)})}if(!gEe(l.textStyles)){n.insertRule(ezn(l.id,"tspan",(l?.textStyles||[]).map(u=>u.replace("color","fill"))),n.cssRules.length)}})}let r="";if(e.themeCSS!==void 0){if(typeof n.replaceSync==="function"){const i=new CSSStyleSheet;i.replaceSync(e.themeCSS);r=i2e(i)+"\n"}else{r+=`${e.themeCSS} +`}}return r+i2e(n)},"createCssStyles");dQi=B((e,t)=>{return BSe(T2n(`${e}{${t}}`),A2n([B(function n(r,i,o,a){if(r.type==="rule"&&Array.isArray(r.props)){if(r.parent&&r.parent.type===Nte){return}r.props=r.props.map(s=>{if(s===e&&Array.isArray(r.children)&&r.children.every(u=>{if(u.type!=="decl"){return false}const d=new Set(["font-family","font-size","fill"]);return d.has(u.props)})){return s}const l=(s.startsWith(`${e} `)||s.startsWith(`${e}>`))&&!s.startsWith(`${e} ||`);if(!l){return`${e} ${s}`}return s})}else if(r.type.startsWith("@")){const s=[o2n,s2n,RSe,c2n,"@container","@starting-style"];const l=[...s,Nte];if(!l.includes(r.type)){wt.warn(`Removing unsupported at-rule ${r.type} from CSS`);r.type=uG}}},"addNamespace"),C2n]))},"compileCSS");fQi=B((e,t,n,r)=>{const i=uQi(e,n);const o=hln(t,i,{...e.themeVariables,theme:e.theme,look:e.look},r);return dQi(r,o)},"createUserStyles");hQi=B((e="",t,n)=>{let r=e;if(!n&&!t){r=r.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')}r=tv(r);r=r.replace(/
    /g,"
    ");return r},"cleanUpSvgCode");pQi=B((e="",t)=>{const n=t?.viewBox?.baseVal?.height?t.viewBox.baseVal.height+"px":rQi;const r=Wzn(`${e}`);return``},"putIntoIFrame");tzn=B((e,t,n,r,i)=>{const o=e.append("div");o.attr("id",n);if(r){o.attr("style",r)}const a=o.append("svg").attr("id",t).attr("width","100%").attr("xmlns",QJi);if(i){a.attr("xmlns:xlink",i)}a.append("g");return e},"appendDivSvgG");B(jct,"sandboxedIframe");mQi=B((e,t,n,r)=>{e.getElementById(t)?.remove();e.getElementById(n)?.remove();e.getElementById(r)?.remove()},"removeExistingElements");gQi=B(async function(e,t,n){_Ie();const r=Zct(t);t=r.code;const i=Ji();wt.debug(i);if(t.length>(i?.maxTextSize??jJi)){t=KJi}const o=`#${e}`;const a="i"+e;const s="#"+a;const l="d"+e;const u="#"+l;const d=B(()=>{const H=h?s:u;const $=zr(H).node();if($&&"remove"in $){$.remove()}},"removeTempElements");let f=zr(document.body);const h=i.securityLevel===ZJi;const m=i.securityLevel===JJi;const g=i.fontFamily;if(n!==void 0){if(n){n.innerHTML=""}if(h){const H=jct(zr(n),a);f=zr(H.nodes()[0].contentDocument.body);f.node().style.margin="0"}else{f=zr(n)}tzn(f,e,l,`font-family: ${g}`,eQi)}else{mQi(document,e,l,a);if(h){const H=jct(zr(document.body),a);f=zr(H.nodes()[0].contentDocument.body);f.node().style.margin="0"}else{f=zr("body")}tzn(f,e,l)}let x;let w;try{x=await Xct.fromText(t,{title:r.title})}catch(H){if(i.suppressErrorRendering){d();throw H}x=await Xct.fromText("error");w=H}const _=f.select(u).node();const C=x.type;const A=_.firstChild;const P=A.firstChild;const L=x.renderer.getClasses?.(t,x);const I=fQi(i,C,L,o);const N=document.createElement("style");N.innerHTML=I;A.insertBefore(N,P);try{await x.renderer.draw(t,e,"11.16.1",x)}catch(H){if(i.suppressErrorRendering){d()}else{TZi.draw(t,e,"11.16.1")}throw H}const O=f.select(`${u} svg`);const z=x.db.getAccTitle?.();const U=x.db.getAccDescription?.();jzn(C,O,z,U);f.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",tQi);let W=f.select(u).node().innerHTML;wt.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute);W=hQi(W,h,R_(i.arrowMarkerAbsolute));if(h){const H=f.select(u+" svg").node();W=pQi(W,H)}else if(!m){W=ux.sanitize(W,{ADD_TAGS:lQi,ADD_ATTR:cQi,HTML_INTEGRATION_POINTS:{foreignobject:true}})}HJi();if(w){throw w}d();return{diagramType:C,svg:W,bindFunctions:x.db.bindFunctions}},"render");B(qzn,"initialize");Xzn=B((e,t={})=>{const{code:n}=Kct(e);return Xct.fromText(n,t)},"getDiagramFromText");B(jzn,"addA11yInfo");q6=Object.freeze({render:gQi,parse:Yzn,getDiagramFromText:Xzn,initialize:qzn,getConfig:Ji,setConfig:CXe,getSiteConfig:EXe,updateSiteConfig:iln,reset:B(()=>{QQ()},"reset"),globalReset:B(()=>{QQ(N5)},"globalReset"),defaultConfig:N5});MQ(Ji().logLevel);QQ(Ji());yQi=B((e,t,n)=>{wt.warn(e);if(_Ee(e)){if(n){n(e.str,e.hash)}t.push({...e,message:e.str,error:e})}else{if(n){n(e)}if(e instanceof Error){t.push({str:e.message,message:e.message,hash:e.name,error:e})}}},"handleError");Kzn=B(async function(e={querySelector:".mermaid"}){try{await bQi(e)}catch(t){if(_Ee(t)){wt.error(t.str)}if(bP.parseError){bP.parseError(t)}if(!e.suppressErrors){wt.error("Use the suppressErrors option to suppress these errors");throw t}}},"run");bQi=B(async function({postRenderCallback:e,querySelector:t,nodes:n}={querySelector:".mermaid"}){const r=q6.getConfig();wt.debug(`${!e?"No ":""}Callback function found`);let i;if(n){i=n}else if(t){i=document.querySelectorAll(t)}else{throw new Error("Nodes and querySelector are both undefined")}wt.debug(`Found ${i.length} diagrams`);if(r?.startOnLoad!==void 0){wt.debug("Start On Load: "+r?.startOnLoad);q6.updateSiteConfig({startOnLoad:r?.startOnLoad})}const o=new Ko.InitIDGenerator(r.deterministicIds,r.deterministicIDSeed);let a;const s=[];for(const l of Array.from(i)){wt.info("Rendering diagram: "+l.id);if(l.getAttribute("data-processed")){continue}l.setAttribute("data-processed","true");const u=`mermaid-${o.next()}`;a=l.innerHTML;a=PEe(Ko.entityDecode(a)).trim().replace(//gi,"
    ");const d=Ko.detectInit(a);if(d){wt.debug("Detected early reinit: ",d)}try{const{svg:f,bindFunctions:h}=await e9n(u,a,l);l.innerHTML=f;if(e){await e(u)}if(h){h(l)}}catch(f){yQi(f,s,bP.parseError)}}if(s.length>0){throw s[0]}},"runThrowsErrors");Zzn=B(function(e){q6.initialize(e)},"initialize");xQi=B(async function(e,t,n){wt.warn("mermaid.init is deprecated. Please use run instead.");if(e){Zzn(e)}const r={postRenderCallback:n,querySelector:".mermaid"};if(typeof t==="string"){r.querySelector=t}else if(t){if(t instanceof HTMLElement){r.nodes=[t]}else{r.nodes=t}}await Kzn(r)},"init");vQi=B(async(e,{lazyLoad:t=true}={})=>{_Ie();r2e(...e);if(t===false){await $Ji()}},"registerExternalDiagrams");Jzn=B(function(){if(bP.startOnLoad){const{startOnLoad:e}=q6.getConfig();if(e){bP.run().catch(t=>wt.error("Mermaid failed to initialize",t))}}},"contentLoaded");if(typeof document!=="undefined"){window.addEventListener("load",Jzn,false)}_Qi=B(function(e){bP.parseError=e},"setParseErrorHandler");vIe=[];qct=false;Qzn=B(async()=>{if(qct){return}qct=true;while(vIe.length>0){const e=vIe.shift();if(e){try{await e()}catch(t){wt.error("Error executing queue",t)}}}qct=false},"executeQueue");TQi=B(async(e,t)=>{return new Promise((n,r)=>{const i=B(()=>new Promise((o,a)=>{q6.parse(e,t).then(s=>{o(s);n(s)},s=>{wt.error("Error parsing",s);bP.parseError?.(s);a(s);r(s)})}),"performCall");vIe.push(i);Qzn().catch(r)})},"parse");e9n=B((e,t,n)=>{return new Promise((r,i)=>{const o=B(()=>new Promise((a,s)=>{q6.render(e,t,n).then(l=>{a(l);r(l)},l=>{wt.error("Error parsing",l);bP.parseError?.(l);s(l);i(l)})}),"performCall");vIe.push(o);Qzn().catch(i)})},"render");wQi=B(()=>{return Object.keys(cL).map(e=>({id:e}))},"getRegisteredDiagramsMetadata");bP={startOnLoad:true,mermaidAPI:q6,parse:TQi,render:e9n,init:xQi,run:Kzn,registerExternalDiagrams:vQi,registerLayoutLoaders:Yet,initialize:Zzn,parseError:void 0,contentLoaded:Jzn,setParseErrorHandler:_Qi,detectType:eee,registerIconPacks:w$,getRegisteredDiagramsMetadata:wQi};EQi=bP;});var VHn=_r((Gmt,UHn)=>{(function(e,t){if(typeof Gmt==="object"){UHn.exports=t()}else if(typeof define==="function"&&define.amd){define(t)}else{e.jStat=t()}})(Gmt,function(){var e=function(t,n){var r=Array.prototype.concat;var i=Array.prototype.slice;var o=Object.prototype.toString;function a(w,_){var C=w>_?w:_;return t.pow(10,17-~~(t.log(C>0?C:-C)*t.LOG10E))}var s=Array.isArray||function w(_){return o.call(_)==="[object Array]"};function l(w){return o.call(w)==="[object Function]"}function u(w){return typeof w==="number"?w-w===0:false}function d(w){return r.apply([],w)}function f(){return new f._init(arguments)}f.fn=f.prototype;f._init=function w(_){if(s(_[0])){if(s(_[0][0])){if(l(_[1]))_[0]=f.map(_[0],_[1]);for(var C=0;C<_[0].length;C++)this[C]=_[0][C];this.length=_[0].length}else{this[0]=l(_[1])?f.map(_[0],_[1]):_[0];this.length=1}}else if(u(_[0])){this[0]=f.seq.apply(null,_);this.length=1}else if(_[0]instanceof f){return f(_[0].toArray())}else{this[0]=[];this.length=1}return this};f._init.prototype=f.prototype;f._init.constructor=f;f.utils={calcRdx:a,isArray:s,isFunction:l,isNumber:u,toVector:d};f._random_fn=t.random;f.setRandom=function w(_){if(typeof _!=="function")throw new TypeError("fn is not a function");f._random_fn=_};f.extend=function w(_){var C,A;if(arguments.length===1){for(A in _)f[A]=_[A];return this}for(C=1;C=0;C--,P++)A[P]=[_[P][C]];return A};f.transpose=function w(_){var C=[];var A,P,L,I,N;if(!s(_[0]))_=[_];P=_.length;L=_[0].length;for(N=0;N0)N[P][0]=_[P][0];for(O=1;OC&&A>0){return[]}if(A>0){for(L=_;LC;L+=A){P.push(L)}}return P};f.slice=function(){function w(C,A,P,L){var I;var N=[];var O=C.length;if(A===n&&P===n&&L===n){return f.copy(C)}A=A||0;P=P||C.length;A=A>=0?A:O+A;P=P>=0?P:O+P;L=L||1;if(A===P||L===0){return[]}if(AP&&L>0){return[]}if(L>0){for(I=A;IP;I+=L){N.push(C[I])}}return N}function _(C,A){var P,L;A=A||{};if(u(A.row)){if(u(A.col))return C[A.row][A.col];var I=f.rowa(C,A.row);P=A.col||{};return w(I,P.start,P.end,P.step)}if(u(A.col)){var N=f.cola(C,A.col);L=A.row||{};return w(N,L.start,L.end,L.step)}L=A.row||{};P=A.col||{};var O=w(C,L.start,L.end,L.step);return O.map(function(z){return w(z,P.start,P.end,P.step)})}return _}();f.sliceAssign=function w(_,C,A){var P,L;if(u(C.row)){if(u(C.col))return _[C.row][C.col]=A;C.col=C.col||{};C.col.start=C.col.start||0;C.col.end=C.col.end||_[0].length;C.col.step=C.col.step||1;P=f.arange(C.col.start,t.min(_.length,C.col.end),C.col.step);var I=C.row;P.forEach(function(O,z){_[I][O]=A[z]});return _}if(u(C.col)){C.row=C.row||{};C.row.start=C.row.start||0;C.row.end=C.row.end||_.length;C.row.step=C.row.step||1;L=f.arange(C.row.start,t.min(_[0].length,C.row.end),C.row.step);var N=C.col;L.forEach(function(O,z){_[O][N]=A[z]});return _}if(A[0].length===n){A=[A]}C.row.start=C.row.start||0;C.row.end=C.row.end||_.length;C.row.step=C.row.step||1;C.col.start=C.col.start||0;C.col.end=C.col.end||_[0].length;C.col.step=C.col.step||1;L=f.arange(C.row.start,t.min(_.length,C.row.end),C.row.step);P=f.arange(C.col.start,t.min(_[0].length,C.col.end),C.col.step);L.forEach(function(O,z){P.forEach(function(U,W){_[O][U]=A[z][W]})});return _};f.diagonal=function w(_){var C=f.zeros(_.length,_.length);_.forEach(function(A,P){C[P][P]=A});return C};f.copy=function w(_){return _.map(function(C){if(u(C))return C;return C.map(function(A){return A})})};var x=f.prototype;x.length=0;x.push=Array.prototype.push;x.sort=Array.prototype.sort;x.splice=Array.prototype.splice;x.slice=Array.prototype.slice;x.toArray=function w(){return this.length>1?i.call(this):i.call(this)[0]};x.map=function w(_,C){return f(f.map(this,_,C))};x.cumreduce=function w(_,C){return f(f.cumreduce(this,_,C))};x.alter=function w(_){f.alter(this,_);return this};(function(w){for(var _=0;_=0)u+=l[d];return u};t.sumsqrd=function s(l){var u=0;var d=l.length;while(--d>=0)u+=l[d]*l[d];return u};t.sumsqerr=function s(l){var u=t.mean(l);var d=0;var f=l.length;var h;while(--f>=0){h=l[f]-u;d+=h*h}return d};t.sumrow=function s(l){var u=0;var d=l.length;while(--d>=0)u+=l[d];return u};t.product=function s(l){var u=1;var d=l.length;while(--d>=0)u*=l[d];return u};t.min=function s(l){var u=l[0];var d=0;while(++du)u=l[d];return u};t.unique=function s(l){var u={},d=[];for(var f=0;fh){g=[d[x]];h=f;m=0}else if(f===h){g.push(d[x]);m++}f=1}}return m===0?g[0]:g};t.range=function s(l){return t.max(l)-t.min(l)};t.variance=function s(l,u){return t.sumsqerr(l)/(l.length-(u?1:0))};t.pooledvariance=function s(l){var u=l.reduce(function(f,h){return f+t.sumsqerr(h)},0);var d=l.reduce(function(f,h){return f+h.length},0);return u/(d-l.length)};t.deviation=function(s){var l=t.mean(s);var u=s.length;var d=new Array(u);for(var f=0;f=0;f--){d.push(n.abs(l[f]-u))}return t.mean(d)};t.meddev=function s(l){var u=t.median(l);var d=[];for(var f=l.length-1;f>=0;f--){d.push(n.abs(l[f]-u))}return t.median(d)};t.coeffvar=function s(l){return t.stdev(l)/t.mean(l)};t.quartiles=function s(l){var u=l.length;var d=l.slice().sort(i);return[d[n.round(u/4)-1],d[n.round(u/2)-1],d[n.round(u*3/4)-1]]};t.quantiles=function s(l,u,d,f){var h=l.slice().sort(i);var m=[u.length];var g=l.length;var x,w,_,C,A,P;if(typeof d==="undefined")d=3/8;if(typeof f==="undefined")f=3/8;for(x=0;x1){g=d===true?this:this.transpose();for(;m1){if(u!=="sumrow")g=d===true?this:this.transpose();for(;m1){h=h.transpose();for(;f=0;d--){u*=a;u+=h[d]}l=u/o+.5*n.log(s)+(o-.5)*n.log(o)-o;if(i<=7){for(d=1;d<=f;d++){l-=n.log(o-1);o-=1}}return l};t.gammafn=function r(i){var o=[-1.716185138865495,24.76565080557592,-379.80425647094563,629.3311553128184,866.9662027904133,-31451.272968848367,-36144.413418691176,66456.14382024054];var a=[-30.8402300119739,315.35062697960416,-1015.1563674902192,-3107.771671572311,22538.11842098015,4755.846277527881,-134659.9598649693,-115132.2596755535];var s=false;var l=0;var u=0;var d=0;var f=i;var h,m,g,x;if(i>171.6243769536076){return Infinity}if(f<=0){x=f%1+36e-17;if(x){s=(!(f&1)?1:-1)*n.PI/n.sin(n.PI*x);f=1-f}else{return Infinity}}g=f;if(f<1){m=f++}else{m=(f-=l=(f|0)-1)-1}for(h=0;h<8;++h){d=(d+o[h])*m;u=u*m+a[h]}x=d/u+1;if(gf){for(h=0;h=1?i:1/i)*8.5+i*.4+17);var w;if(o<0||i<=0){return NaN}else if(o170||o>170?n.exp(t.combinationln(i,o)):t.factorial(i)/t.factorial(o)/t.factorial(i-o)};t.combinationln=function r(i,o){return t.factorialln(i)-t.factorialln(o)-t.factorialln(i-o)};t.permutation=function r(i,o){return t.factorial(i)/t.factorial(i-o)};t.betafn=function r(i,o){if(i<=0||o<=0)return void 0;return i+o>170?n.exp(t.betaln(i,o)):t.gammafn(i)*t.gammafn(o)/t.gammafn(i+o)};t.betaln=function r(i,o){return t.gammaln(i)+t.gammaln(o)-t.gammaln(i+o)};t.betacf=function r(i,o,a){var s=1e-30;var l=1;var u=o+a;var d=o+1;var f=o-1;var h=1;var m=1-u*i/d;var g,x,w,_;if(n.abs(m)=1)return n.max(100,o+100*n.sqrt(o));if(i<=0)return 0;if(o>1){x=n.log(s);w=n.exp(s*(x-1)-u);g=i<.5?i:1-i;h=n.sqrt(-2*n.log(g));d=(2.30753+h*.27061)/(1+h*(.99229+h*.04481))-h;if(i<.5)d=-d;d=n.max(.001,o*n.pow(1-1/(9*o)-d/(3*n.sqrt(o)),3))}else{h=1-o*(.253+o*.12);if(i1)h=w*n.exp(-(d-s)+s*(n.log(d)-x));else h=n.exp(-d+s*n.log(d)-u);m=f/h;d-=h=m/(1-.5*n.min(1,m*((o-1)/d-1)));if(d<=0)d=.5*(d+h);if(n.abs(h)0;a--){h=l;l=f*l-u+o[a];u=h}m=d*n.exp(-i*i+.5*(o[0]+f*l)-u);return s?m-1:1-m};t.erfc=function r(i){return 1-t.erf(i)};t.erfcinv=function r(i){var o=0;var a,s,l,u;if(i>=2)return-100;if(i<=0)return 100;u=i<1?i:2-i;l=n.sqrt(-2*n.log(u/2));a=-.70711*((2.30753+l*.27061)/(1+l*(.99229+l*.04481))-l);for(;o<2;o++){s=t.erfc(a)-u;a+=s/(1.1283791670955126*n.exp(-a*a)-a*s)}return i<1?a:-a};t.ibetainv=function r(i,o,a){var s=1e-8;var l=o-1;var u=a-1;var d=0;var f,h,m,g,x,w,_,C,A,P,L;if(i<=0)return 0;if(i>=1)return 1;if(o>=1&&a>=1){m=i<.5?i:1-i;g=n.sqrt(-2*n.log(m));_=(2.30753+g*.27061)/(1+g*(.99229+g*.04481))-g;if(i<.5)_=-_;C=(_*_-3)/6;A=2/(1/(2*o-1)+1/(2*a-1));P=_*n.sqrt(C+A)/A-(1/(2*a-1)-1/(2*o-1))*(C+5/6-2/(3*A));_=o/(o+a*n.exp(2*P))}else{f=n.log(o/(o+a));h=n.log(a/(o+a));g=n.exp(o*f)/o;x=n.exp(a*h)/a;P=g+x;if(i=1)_=.5*(_+g+1);if(n.abs(g)0)break}return _};t.ibeta=function r(i,o,a){var s=i===0||i===1?0:n.exp(t.gammaln(o+a)-t.gammaln(o)-t.gammaln(a)+o*n.log(i)+a*n.log(1-i));if(i<0||i>1)return false;if(i<(o+1)/(o+a+2))return s*t.betacf(i,o,a)/o;return 1-s*t.betacf(1-i,a,o)/a};t.randn=function r(i,o){var a,s,l,u,d;if(!o)o=i;if(i)return t.create(i,o,function(){return t.randn()});do{a=t._random_fn();s=1.7156*(t._random_fn()-.5);l=a-.449871;u=n.abs(s)+.386595;d=l*l+u*(.196*u-.25472*l)}while(d>.27597&&(d>.27846||s*s>-4*n.log(a)*a*a));return s/a};t.randg=function r(i,o,a){var s=i;var l,u,d,f,h,m;if(!a)a=o;if(!i)i=1;if(o){m=t.zeros(o,a);m.alter(function(){return t.randg(i)});return m}if(i<1)i+=1;l=i-1/3;u=1/n.sqrt(9*l);do{do{h=t.randn();f=1+u*h}while(f<=0);f=f*f*f;d=t._random_fn()}while(d>1-.331*n.pow(h,4)&&n.log(d)>.5*h*h+l*(1-f+n.log(f)));if(i==s)return l*f;do{d=t._random_fn()}while(d===0);return n.pow(d,1/s)*l*f};(function(r){for(var i=0;i1||l<0)return 0;if(u==1&&d==1)return 1;if(u<512&&d<512){return n.pow(l,u-1)*n.pow(1-l,d-1)/t.betafn(u,d)}else{return n.exp((u-1)*n.log(l)+(d-1)*n.log(1-l)-t.betaln(u,d))}},cdf:function s(l,u,d){return l>1||l<0?(l>1)*1:t.ibeta(l,u,d)},inv:function s(l,u,d){return t.ibetainv(l,u,d)},mean:function s(l,u){return l/(l+u)},median:function s(l,u){return t.ibetainv(.5,l,u)},mode:function s(l,u){return(l-1)/(l+u-2)},sample:function s(l,u){var d=t.randg(l);return d/(d+t.randg(u))},variance:function s(l,u){return l*u/(n.pow(l+u,2)*(l+u+1))}});t.extend(t.centralF,{pdf:function s(l,u,d){var f,h,m;if(l<0)return 0;if(u<=2){if(l===0&&u<2){return Infinity}if(l===0&&u===2){return 1}return 1/t.betafn(u/2,d/2)*n.pow(u/d,u/2)*n.pow(l,u/2-1)*n.pow(1+u/d*l,-(u+d)/2)}f=u*l/(d+l*u);h=d/(d+l*u);m=u*h/2;return m*t.binomial.pdf((u-2)/2,(u+d-2)/2,f)},cdf:function s(l,u,d){if(l<0)return 0;return t.ibeta(u*l/(u*l+d),u/2,d/2)},inv:function s(l,u,d){return d/(u*(1/t.ibetainv(l,u/2,d/2)-1))},mean:function s(l,u){return u>2?u/(u-2):void 0},mode:function s(l,u){return l>2?u*(l-2)/(l*(u+2)):void 0},sample:function s(l,u){var d=t.randg(l/2)*2;var f=t.randg(u/2)*2;return d/l/(f/u)},variance:function s(l,u){if(u<=4)return void 0;return 2*u*u*(l+u-2)/(l*(u-2)*(u-2)*(u-4))}});t.extend(t.cauchy,{pdf:function s(l,u,d){if(d<0){return 0}return d/(n.pow(l-u,2)+n.pow(d,2))/n.PI},cdf:function s(l,u,d){return n.atan((l-u)/d)/n.PI+.5},inv:function(s,l,u){return l+u*n.tan(n.PI*(s-.5))},median:function s(l){return l},mode:function s(l){return l},sample:function s(l,u){return t.randn()*n.sqrt(1/(2*t.randg(.5)))*u+l}});t.extend(t.chisquare,{pdf:function s(l,u){if(l<0)return 0;return l===0&&u===2?.5:n.exp((u/2-1)*n.log(l)-l/2-u/2*n.log(2)-t.gammaln(u/2))},cdf:function s(l,u){if(l<0)return 0;return t.lowRegGamma(u/2,l/2)},inv:function(s,l){return 2*t.gammapinv(s,.5*l)},mean:function(s){return s},median:function s(l){return l*n.pow(1-2/(9*l),3)},mode:function s(l){return l-2>0?l-2:0},sample:function s(l){return t.randg(l/2)*2},variance:function s(l){return 2*l}});t.extend(t.exponential,{pdf:function s(l,u){return l<0?0:u*n.exp(-u*l)},cdf:function s(l,u){return l<0?0:1-n.exp(-u*l)},inv:function(s,l){return-n.log(1-s)/l},mean:function(s){return 1/s},median:function(s){return 1/s*n.log(2)},mode:function s(){return 0},sample:function s(l){return-1/l*n.log(t._random_fn())},variance:function(s){return n.pow(s,-2)}});t.extend(t.gamma,{pdf:function s(l,u,d){if(l<0)return 0;return l===0&&u===1?1/d:n.exp((u-1)*n.log(l)-l/d-t.gammaln(u)-u*n.log(d))},cdf:function s(l,u,d){if(l<0)return 0;return t.lowRegGamma(u,l/d)},inv:function(s,l,u){return t.gammapinv(s,l)*u},mean:function(s,l){return s*l},mode:function s(l,u){if(l>1)return(l-1)*u;return void 0},sample:function s(l,u){return t.randg(l)*u},variance:function s(l,u){return l*u*u}});t.extend(t.invgamma,{pdf:function s(l,u,d){if(l<=0)return 0;return n.exp(-(u+1)*n.log(l)-d/l-t.gammaln(u)+u*n.log(d))},cdf:function s(l,u,d){if(l<=0)return 0;return 1-t.lowRegGamma(u,d/l)},inv:function(s,l,u){return u/t.gammapinv(1-s,l)},mean:function(s,l){return s>1?l/(s-1):void 0},mode:function s(l,u){return u/(l+1)},sample:function s(l,u){return u/t.randg(l)},variance:function s(l,u){if(l<=2)return void 0;return u*u/((l-1)*(l-1)*(l-2))}});t.extend(t.kumaraswamy,{pdf:function s(l,u,d){if(l===0&&u===1)return d;else if(l===1&&d===1)return u;return n.exp(n.log(u)+n.log(d)+(u-1)*n.log(l)+(d-1)*n.log(1-n.pow(l,u)))},cdf:function s(l,u,d){if(l<0)return 0;else if(l>1)return 1;return 1-n.pow(1-n.pow(l,u),d)},inv:function s(l,u,d){return n.pow(1-n.pow(1-l,1/d),1/u)},mean:function(s,l){return l*t.gammafn(1+1/s)*t.gammafn(l)/t.gammafn(1+1/s+l)},median:function s(l,u){return n.pow(1-n.pow(2,-1/u),1/l)},mode:function s(l,u){if(!(l>=1&&u>=1&&(l!==1&&u!==1)))return void 0;return n.pow((l-1)/(l*u-1),1/l)},variance:function s(){throw new Error("variance not yet implemented")}});t.extend(t.lognormal,{pdf:function s(l,u,d){if(l<=0)return 0;return n.exp(-n.log(l)-.5*n.log(2*n.PI)-n.log(d)-n.pow(n.log(l)-u,2)/(2*d*d))},cdf:function s(l,u,d){if(l<0)return 0;return .5+.5*t.erf((n.log(l)-u)/n.sqrt(2*d*d))},inv:function(s,l,u){return n.exp(-1.4142135623730951*u*t.erfcinv(2*s)+l)},mean:function s(l,u){return n.exp(l+u*u/2)},median:function s(l){return n.exp(l)},mode:function s(l,u){return n.exp(l-u*u)},sample:function s(l,u){return n.exp(t.randn()*u+l)},variance:function s(l,u){return(n.exp(u*u)-1)*n.exp(2*l+u*u)}});t.extend(t.noncentralt,{pdf:function s(l,u,d){var f=1e-14;if(n.abs(d)f||x>f){w=x;if(C>0){A*=d*d/(2*C);P*=d*d/(2*(C+1/2))}x=A*t.beta.cdf(_,C+.5,u/2)+P*t.beta.cdf(_,C+1,u/2);g+=.5*x;C++}return m?1-g:g}});t.extend(t.normal,{pdf:function s(l,u,d){return n.exp(-.5*n.log(2*n.PI)-n.log(d)-n.pow(l-u,2)/(2*d*d))},cdf:function s(l,u,d){return .5*(1+t.erf((l-u)/n.sqrt(2*d*d)))},inv:function(s,l,u){return-1.4142135623730951*u*t.erfcinv(2*s)+l},mean:function(s){return s},median:function s(l){return l},mode:function(s){return s},sample:function s(l,u){return t.randn()*u+l},variance:function(s,l){return l*l}});t.extend(t.pareto,{pdf:function s(l,u,d){if(l1e100?1e100:u;return 1/(n.sqrt(u)*t.betafn(.5,u/2))*n.pow(1+l*l/u,-((u+1)/2))},cdf:function s(l,u){var d=u/2;return t.ibeta((l+n.sqrt(l*l+u))/(2*n.sqrt(l*l+u)),d,d)},inv:function(s,l){var u=t.ibetainv(2*n.min(s,1-s),.5*l,.5);u=n.sqrt(l*(1-u)/u);return s>.5?u:-u},mean:function s(l){return l>1?0:void 0},median:function s(){return 0},mode:function s(){return 0},sample:function s(l){return t.randn()*n.sqrt(l/(2*t.randg(l/2)))},variance:function s(l){return l>2?l/(l-2):l>1?Infinity:void 0}});t.extend(t.weibull,{pdf:function s(l,u,d){if(l<0||u<0||d<0)return 0;return d/u*n.pow(l/u,d-1)*n.exp(-n.pow(l/u,d))},cdf:function s(l,u,d){return l<0?0:1-n.exp(-n.pow(l/u,d))},inv:function(s,l,u){return l*n.pow(-n.log(1-s),1/u)},mean:function(s,l){return s*t.gammafn(1+1/l)},median:function s(l,u){return l*n.pow(n.log(2),1/u)},mode:function s(l,u){if(u<=1)return 0;return l*n.pow((u-1)/u,1/u)},sample:function s(l,u){return l*n.pow(-n.log(t._random_fn()),1/u)},variance:function s(l,u){return l*l*t.gammafn(1+2/u)-n.pow(t.weibull.mean(l,u),2)}});t.extend(t.uniform,{pdf:function s(l,u,d){return ld?0:1/(d-u)},cdf:function s(l,u,d){if(ld){w=m;_=-(l+x)*(l+u+x)*s/(l+2*x)/(l+2*x+1);f=m+_*f;h=g+_*h;x=x+1;_=x*(u-x)*s/(l+2*x-1)/(l+2*x);m=f+_*m;g=h+_*g;f=f/g;h=h/g;m=m/g;g=1}return m/l}t.extend(t.binomial,{pdf:function s(l,u,d){return d===0||d===1?u*d===l?1:0:t.combination(u,l)*n.pow(d,l)*n.pow(1-d,u-l)},cdf:function s(l,u,d){var f;var h=1e-10;if(l<0)return 0;if(l>=u)return 1;if(d<0||d>1||u<=0)return NaN;l=n.floor(l);var m=d;var g=l+1;var x=u-l;var w=g+x;var _=n.exp(t.gammaln(w)-t.gammaln(x)-t.gammaln(g)+g*n.log(m)+x*n.log(1-m));if(m<(g+1)/(w+2))f=_*r(m,g,x,h);else f=1-_*r(1-m,x,g,h);return n.round((1-f)*(1/h))/(1/h)}});t.extend(t.negbin,{pdf:function s(l,u,d){if(l!==l>>>0)return false;if(l<0)return 0;return t.combination(l+u-1,u-1)*n.pow(1-d,l)*n.pow(d,u)},cdf:function s(l,u,d){var f=0,h=0;if(l<0)return 0;for(;h<=l;h++){f+=t.negbin.pdf(h,u,d)}return f}});t.extend(t.hypgeom,{pdf:function s(l,u,d,f){if(l!==l|0){return false}else if(l<0||lf||l>d){return 0}else if(d*2>u){if(f*2>u){return t.hypgeom.pdf(u-d-f+l,u,u-d,u-f)}else{return t.hypgeom.pdf(f-l,u,u-d,f)}}else if(f*2>u){return t.hypgeom.pdf(d-l,u,d,u-f)}else if(d1&&m=f||l>=d){return 1}else if(d*2>u){if(f*2>u){return t.hypgeom.cdf(u-d-f+l,u,u-d,u-f)}else{return 1-t.hypgeom.cdf(f-l-1,u,u-d,f)}}else if(f*2>u){return 1-t.hypgeom.cdf(d-l-1,u,d,u-f)}else if(d1&&gf);return d-1},sampleLarge:function s(l){var u=l;var d;var f,h,m,g,x,w,_,C,A;m=n.sqrt(u);g=n.log(u);w=.931+2.53*m;x=-.059+.02483*w;_=1.1239+1.1328/(w-3.4);C=.9277-3.6224/(w-2);while(1){f=n.random()-.5;h=n.random();A=.5-n.abs(f);d=n.floor((2*x/A+w)*f+u+.43);if(A>=.07&&h<=C){return d}if(d<0||A<.013&&h>A){continue}if(n.log(h)+n.log(_)-n.log(x/(A*A)+w)<=-u+d*g-t.loggam(d+1)){return d}}},sample:function s(l){if(l<10)return this.sampleSmall(l);else return this.sampleLarge(l)}});t.extend(t.triangular,{pdf:function s(l,u,d,f){if(d<=u||fd){return NaN}else{if(ld){return 0}else if(ld)return NaN;if(l<=u)return 0;else if(l>=d)return 1;if(l<=f)return n.pow(l-u,2)/((d-u)*(f-u));else return 1-n.pow(d-l,2)/((d-u)*(d-f))},inv:function s(l,u,d,f){if(d<=u||fd){return NaN}else{if(l<=(f-u)/(d-u)){return u+(d-u)*n.sqrt(l*((f-u)/(d-u)))}else{return u+(d-u)*(1-n.sqrt((1-l)*(1-(f-u)/(d-u))))}}},mean:function s(l,u,d){return(l+u+d)/3},median:function s(l,u,d){if(d<=(l+u)/2){return u-n.sqrt((u-l)*(u-d))/n.sqrt(2)}else if(d>(l+u)/2){return l+n.sqrt((u-l)*(d-l))/n.sqrt(2)}},mode:function s(l,u,d){return d},sample:function s(l,u,d){var f=t._random_fn();if(f<(d-l)/(u-l))return l+n.sqrt(f*(u-l)*(d-l));return u-n.sqrt((1-f)*(u-l)*(u-d))},variance:function s(l,u,d){return(l*l+u*u+d*d-l*u-l*d-u*d)/18}});t.extend(t.arcsine,{pdf:function s(l,u,d){if(d<=u)return NaN;return l<=u||l>=d?0:2/n.PI*n.pow(n.pow(d-u,2)-n.pow(2*l-u-d,2),-.5)},cdf:function s(l,u,d){if(l=x)return 1;var I=2*t.normal.cdf(L,0,1,1,0)-1;if(I>=n.exp(m/u))I=n.pow(I,u);else I=0;var N;if(s>w)N=_;else N=C;var O=L;var z=(x-L)/N;var U=O+z;var W=0;var H=u-1;for(var $=1;$<=N;$++){var K=0;var X=.5*(U+O);var j=.5*(U-O);for(var te=1;te<=d;te++){var J,oe;if(fg)break;var ue=2*t.normal.cdf(re,0,1,1,0);var xe=2*t.normal.cdf(re,s,1,1,0);var be=ue*.5-xe*.5;if(be>=n.exp(h/H)){be=P[J-1]*n.exp(-(.5*ce))*n.pow(be,H);K+=be}}K*=2*j*u/n.sqrt(2*n.PI);W+=K;O=U;U+=z}I+=W;if(I<=n.exp(h/l))return 0;I=n.pow(I,l);if(I>=1)return 1;return I}function a(s,l,u){var d=.322232421088;var f=.099348462606;var h=-1;var m=.588581570495;var g=-.342242088547;var x=.531103462366;var w=-.204231210125;var _=.10353775285;var C=-453642210148e-16;var A=.0038560700634;var P=.8832;var L=.2368;var I=1.214;var N=1.208;var O=1.4142;var z=120;var U=.5-.5*s;var W=n.sqrt(n.log(1/(U*U)));var H=W+((((W*C+w)*W+g)*W+h)*W+d)/((((W*A+_)*W+x)*W+m)*W+f);if(uP)return o(l,f,h);var W=d*.5;var H=W*n.log(d)-d*n.log(2)-t.gammaln(W);var $=W-1;var K=d*.25;var X;if(d<=_)X=L;else if(d<=C)X=I;else if(d<=A)X=N;else X=O;H+=n.log(X);var j=0;for(var te=1;te<=50;te++){var J=0;var oe=(2*te-1)*X;for(var se=1;se<=m;se++){var re,ce;if(g=x){if(g=1&&J<=w)break;j+=J}if(J>w){throw new Error("tukey.cdf failed to converge")}if(j>1)j=1;return j},inv:function(s,l,u){var d=1;var f=l;var h=1e-4;var m=50;if(u<2||d<1||f<2)return NaN;if(s<0||s>1)return NaN;if(s===0)return 0;if(s===1)return Infinity;var g=a(s,f,u);var x=t.tukey.cdf(g,l,u)-s;var w;if(x>0)w=n.max(0,g-1);else w=g+1;var _=t.tukey.cdf(w,l,u)-s;var C;for(var A=1;Au){d[f-1][h-1]=s[f][h]}}}var m=u%2?-1:1;l+=a(d)*s[0][u]*m}return l},gauss_elimination:function a(s,l){var u=0,d=0,f=s.length,h=s[0].length,m=1,g=0,x=[],w,_,C,A;s=t.aug(s,l);w=s[0].length;for(u=0;u=0;u--){g=0;for(d=u+1;d<=f-1;d++){g=g+x[d]*s[u][d]}x[u]=(s[u][w-1]-g)/s[u][u]}return x},gauss_jordan:function a(s,l){var u=t.aug(s,l);var d=u.length;var f=u[0].length;var h=0;var m,g,x;for(g=0;gn.abs(u[w][g]))w=x}var _=u[g];u[g]=u[w];u[w]=_;for(x=g+1;x=0;g--){h=u[g][g];for(x=0;xg-1;m--){u[x][m]-=u[g][m]*u[x][g]/h}}u[g][g]/=h;for(m=d;mh){g[f][h]=s[f][h];x[f][h]=w[f][h]=0}else if(fd){_=P;P=t.add(t.multiply(A,_),C);f++}return P},gauss_seidel:function a(s,l,u,d){var f=0;var h=s.length;var m=[];var g=[];var x=[];var w,_,C,A,P;for(;fw){m[f][w]=s[f][w];g[f][w]=x[f][w]=0}else if(fd){_=P;P=t.add(t.multiply(A,_),C);f=f+1}return P},SOR:function a(s,l,u,d,f){var h=0;var m=s.length;var g=[];var x=[];var w=[];var _,C,A,P,L;for(;h_){g[h][_]=s[h][_];x[h][_]=w[h][_]=0}else if(h<_){x[h][_]=s[h][_];g[h][_]=w[h][_]=0}else{w[h][_]=s[h][_];g[h][_]=x[h][_]=0}}}P=t.multiply(t.inv(t.add(w,t.multiply(g,f))),t.subtract(t.multiply(w,1-f),t.multiply(x,f)));A=t.multiply(t.multiply(t.inv(t.add(w,t.multiply(g,f))),l),f);C=u;L=t.add(t.multiply(P,u),A);h=2;while(n.abs(t.norm(t.subtract(L,C)))>d){C=L;L=t.add(t.multiply(P,C),A);h++}return L},householder:function a(s){var l=s.length;var u=s[0].length;var d=0;var f=[];var h=[];var m,g,x,w,_;for(;d0?-1:1;m=_*n.sqrt(m);g=n.sqrt((m*m-s[d+1][d]*m)/2);f=t.zeros(l,1);f[d+1][0]=(s[d+1][d]-m)/(2*g);for(x=d+2;x0?n.PI/4:-n.PI/4;else C=n.atan(2*s[x][w]/(s[x][x]-s[w][w]))/2;A=t.identity(u,u);A[x][x]=n.cos(C);A[x][w]=-n.sin(C);A[w][x]=n.sin(C);A[w][w]=n.cos(C);d=t.multiply(d,A);h=t.multiply(t.multiply(t.inv(A),s),A);s=h;l=0;for(m=1;m.001){l=1}}}}for(m=0;m=h){w=f(s,u+d);_=f(s,u);g[m]=(l[w]-2*l[_]+l[2*_-w])/(d*d);d/=2;m++}A=g.length;C=1;while(A!=1){for(P=0;Pu)break}h-=1;return l[h]+(u-s[h])*C[h]+t.sq(u-s[h])*w[h]+(u-s[h])*t.sq(u-s[h])*A[h]},gauss_quadrature:function a(){throw new Error("gauss_quadrature not yet implemented")},PCA:function a(s){var l=s.length;var u=s[0].length;var d=0;var f,h;var m=[];var g=[];var x=[];var w=[];var _=[];var C=[];var A=[];var P=[];var L=[];var I=[];for(d=0;d2){u=t.zscore(l[0],l[1],l[2]);return l[3]===1?t.normal.cdf(-n.abs(u),0,1):t.normal.cdf(-n.abs(u),0,1)*2}else{u=l[0];return l[1]===1?t.normal.cdf(-n.abs(u),0,1):t.normal.cdf(-n.abs(u),0,1)*2}}}});t.extend(t.fn,{zscore:function s(l,u){return(l-this.mean())/this.stdev(u)},ztest:function s(l,u,d){var f=n.abs(this.zscore(l,d));return u===1?t.normal.cdf(-f,0,1):t.normal.cdf(-f,0,1)*2}});t.extend({tscore:function s(){var l=r.call(arguments);return l.length===4?(l[0]-l[1])/(l[2]/n.sqrt(l[3])):(l[0]-t.mean(l[1]))/(t.stdev(l[1],true)/n.sqrt(l[1].length))},ttest:function s(){var l=r.call(arguments);var u;if(l.length===5){u=n.abs(t.tscore(l[0],l[1],l[2],l[3]));return l[4]===1?t.studentt.cdf(-u,l[3]-1):t.studentt.cdf(-u,l[3]-1)*2}if(i(l[1])){u=n.abs(l[0]);return l[2]==1?t.studentt.cdf(-u,l[1]-1):t.studentt.cdf(-u,l[1]-1)*2}u=n.abs(t.tscore(l[0],l[1]));return l[2]==1?t.studentt.cdf(-u,l[1].length-1):t.studentt.cdf(-u,l[1].length-1)*2}});t.extend(t.fn,{tscore:function s(l){return(l-this.mean())/(this.stdev(true)/n.sqrt(this.cols()))},ttest:function s(l,u){return u===1?1-t.studentt.cdf(n.abs(this.tscore(l)),this.cols()-1):t.studentt.cdf(-n.abs(this.tscore(l)),this.cols()-1)*2}});t.extend({anovafscore:function s(){var l=r.call(arguments),u,d,f,h,m,g,x,w;if(l.length===1){m=new Array(l[0].length);for(x=0;x1||u>1||s<=0||u<=0){throw new Error("Proportions should be greater than 0 and less than 1")}var f=(s*l+u*d)/(l+d);var h=n.sqrt(f*(1-f)*(1/l+1/d));return(s-u)/h}t.extend(t.fn,{oneSidedDifferenceOfProportions:function s(l,u,d,f){var h=a(l,u,d,f);return t.ztest(h,1)},twoSidedDifferenceOfProportions:function s(l,u,d,f){var h=a(l,u,d,f);return t.ztest(h,2)}})})(e,Math);e.models=function(){function t(a){var s=a[0].length;var l=e.arange(s).map(function(u){var d=e.arange(s).filter(function(f){return f!==u});return n(e.col(a,u).map(function(f){return f[0]}),e.col(a,d))});return l}function n(a,s){var l=a.length;var u=s[0].length-1;var d=l-u-1;var f=e.lstsq(s,a);var h=e.multiply(s,f.map(function(A){return[A]})).map(function(A){return A[0]});var m=e.subtract(a,h);var g=e.mean(a);var x=e.sum(h.map(function(A){return Math.pow(A-g,2)}));var w=e.sum(a.map(function(A,P){return Math.pow(A-h[P],2)}));var _=x+w;var C=x/_;return{exog:s,endog:a,nobs:l,df_model:u,df_resid:d,coef:f,predict:h,resid:m,ybar:g,SST:_,SSE:x,SSR:w,R2:C}}function r(a){var s=t(a.exog);var l=Math.sqrt(a.SSR/a.df_resid);var u=s.map(function(g){var x=g.SST;var w=g.R2;return l/Math.sqrt(x*(1-w))});var d=a.coef.map(function(g,x){return(g-0)/u[x]});var f=d.map(function(g){var x=e.studentt.cdf(g,a.df_resid);return(x>.5?1-x:x)*2});var h=e.studentt.inv(.975,a.df_resid);var m=a.coef.map(function(g,x){var w=h*u[x];return[g-w,g+w]});return{se:u,t:d,p:f,sigmaHat:l,interval95:m}}function i(a){var s=a.R2/a.df_model/((1-a.R2)/a.df_resid);var l=function(d,f,h){return e.beta.cdf(d/(h/f+d),f/2,h/2)};var u=1-l(s,a.df_model,a.df_resid);return{F_statistic:s,pvalue:u}}function o(a,s){var l=n(a,s);var u=r(l);var d=i(l);var f=1-(1-l.R2)*((l.nobs-1)/l.df_resid);l.t=u;l.f=d;l.adjust_R2=f;return l}return{ols:o}}();e.extend({buildxmatrix:function t(){var n=new Array(arguments.length);for(var r=0;r1){s=[];for(i=0;i{var $Hn;(function(e){if(typeof DO_NOT_EXPORT_BESSEL==="undefined"){if("object"===typeof Hmt){e(Hmt)}else if("function"===typeof define&&define.amd){define(function(){var t={};e(t);return t})}else{e($Hn={})}}else{e($Hn={})}})(function(e){e.version="1.0.2";var t=Math;function n(u,d){for(var f=0,h=0;fI){N=r(L,I,g(L),A(L),-1)}else{var O=2*t.floor((I+t.floor(t.sqrt(40*I)))/2);var z=false;var U=0,W=0;var H=1,$=0;var K=2/L;for(var X=O;X>0;X--){$=X*K*H-U;U=H;H=$;if(t.abs(H)>1e10){H*=1e-10;U*=1e-10;N*=1e-10;W*=1e-10}if(z)W+=H;z=!z;if(X==I)N=U}W=2*W-H;N/=W}return N}}();var a=function(){var u=.636619772;var d=[-2957821389,7062834065,-5123598036e-1,1087988129e-2,-86327.92757,228.4622733].reverse();var f=[40076544269,7452499648e-1,7189466438e-3,47447.2647,226.1030244,1].reverse();var h=[1,-.001098628627,2734510407e-14,-2073370639e-15,2093887211e-16].reverse();var m=[-.01562499995,.0001430488765,-6911147651e-15,7621095161e-16,-934945152e-16].reverse();function g(P){var L=0,I=0,N=0,O=P*P,z=P-.785398164;if(P<8){I=n(d,O);N=n(f,O);L=I/N+u*o(P,0)*t.log(P)}else{O=64/O;I=n(h,O);N=n(m,O);L=t.sqrt(u/P)*(t.sin(z)*I+t.cos(z)*N*8/P)}return L}var x=[-4900604943e3,127527439e4,-51534381390,7349264551e-1,-4237922726e-3,8511.937935].reverse();var w=[249958057e5,424441966400,3733650367,2245904002e-2,102042.605,354.9632885,1].reverse();var _=[1,.00183105,-3516396496e-14,2457520174e-15,-240337019e-15].reverse();var C=[.04687499995,-.0002002690873,8449199096e-15,-88228987e-14,105787412e-15].reverse();function A(P){var L=0,I=0,N=0,O=P*P,z=P-2.356194491;if(P<8){I=P*n(x,O);N=n(w,O);L=I/N+u*(o(P,1)*t.log(P)-1/P)}else{O=64/O;I=n(_,O);N=n(C,O);L=t.sqrt(u/P)*(t.sin(z)*I+t.cos(z)*N*8/P)}return L}return i(g,A,"BESSELY",1,-1)}();var s=function(){var u=[1,3.5156229,3.0899424,1.2067492,.2659732,.0360768,.0045813].reverse();var d=[.39894228,.01328592,.00225319,-.00157565,.00916281,-.02057706,.02635537,-.01647633,.00392377].reverse();function f(x){if(x<=3.75)return n(u,x*x/(3.75*3.75));return t.exp(t.abs(x))/t.sqrt(t.abs(x))*n(d,3.75/t.abs(x))}var h=[.5,.87890594,.51498869,.15084934,.02658733,.00301532,32411e-8].reverse();var m=[.39894228,-.03988024,-.00362018,.00163801,-.01031555,.02282967,-.02895312,.01787654,-.00420059].reverse();function g(x){if(x<3.75)return x*n(h,x*x/(3.75*3.75));return(x<0?-1:1)*t.exp(t.abs(x))/t.sqrt(t.abs(x))*n(m,3.75/t.abs(x))}return function x(w,_){_=Math.round(_);if(_===0)return f(w);if(_===1)return g(w);if(_<0)return NaN;if(t.abs(w)===0)return 0;if(w==Infinity)return Infinity;var C=0,A,P=2/t.abs(w),L=0,I=1,N=0;var O=2*t.round((_+t.round(t.sqrt(40*_)))/2);for(A=O;A>0;A--){N=A*P*I+L;L=I;I=N;if(t.abs(I)>1e10){I*=1e-10;L*=1e-10;C*=1e-10}if(A==_)C=L}C*=x(w,0)/I;return w<0&&_%2?-C:C}}();var l=function(){var u=[-.57721566,.4227842,.23069756,.0348859,.00262698,1075e-7,74e-7].reverse();var d=[1.25331414,-.07832358,.02189568,-.01062446,.00587872,-.0025154,53208e-8].reverse();function f(x){if(x<=2)return-t.log(x/2)*s(x,0)+n(u,x*x/4);return t.exp(-x)/t.sqrt(x)*n(d,2/x)}var h=[1,.15443144,-.67278579,-.18156897,-.01919402,-.00110404,-4686e-8].reverse();var m=[1.25331414,.23498619,-.0365562,.01504268,-.00780353,.00325614,-68245e-8].reverse();function g(x){if(x<=2)return t.log(x/2)*s(x,1)+1/x*n(h,x*x/4);return t.exp(-x)/t.sqrt(x)*n(m,2/x)}return i(f,g,"BESSELK",2,1)}();e.besselj=o;e.bessely=a;e.besseli=s;e.besselk=l})});function E0t(e){if(e){throw e}}var ccr=Ce(()=>{});var bcr=_r((Xps,ycr)=>{"use strict";var JDe=Object.prototype.hasOwnProperty;var gcr=Object.prototype.toString;var ucr=Object.defineProperty;var dcr=Object.getOwnPropertyDescriptor;var fcr=function e(t){if(typeof Array.isArray==="function"){return Array.isArray(t)}return gcr.call(t)==="[object Array]"};var hcr=function e(t){if(!t||gcr.call(t)!=="[object Object]"){return false}var n=JDe.call(t,"constructor");var r=t.constructor&&t.constructor.prototype&&JDe.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r){return false}var i;for(i in t){}return typeof i==="undefined"||JDe.call(t,i)};var pcr=function e(t,n){if(ucr&&n.name==="__proto__"){ucr(t,n.name,{enumerable:true,configurable:true,value:n.newValue,writable:true})}else{t[n.name]=n.newValue}};var mcr=function e(t,n){if(n==="__proto__"){if(!JDe.call(t,n)){return void 0}else if(dcr){return dcr(t,n).value}}return t[n]};ycr.exports=function e(){var t,n,r,i,o,a;var s=arguments[0];var l=1;var u=arguments.length;var d=false;if(typeof s==="boolean"){d=s;s=arguments[1]||{};l=2}if(s==null||typeof s!=="object"&&typeof s!=="function"){s={}}for(;l{});function doe(e){if(typeof e!=="object"||e===null){return false}const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}var xcr=Ce(()=>{});function C0t(){const e=[];const t={run:n,use:r};return t;function n(...i){let o=-1;const a=i.pop();if(typeof a!=="function"){throw new TypeError("Expected function as last argument, not "+a)}s(null,...i);function s(l,...u){const d=e[++o];let f=-1;if(l){a(l);return}while(++fa.length;let l;if(s){a.push(i)}try{l=e.apply(this,a)}catch(u){const d=u;if(s&&n){throw d}return i(d)}if(!s){if(l&&l.then&&typeof l.then==="function"){l.then(o,i)}else if(l instanceof Error){i(l)}else{o(l)}}}function i(a,...s){if(!n){n=true;t(a,...s)}}function o(a){i(null,a)}}var _cr=Ce(()=>{});var Tcr=Ce(()=>{_cr()});function lF(e){if(!e||typeof e!=="object"){return""}if("position"in e||"type"in e){return wcr(e.position)}if("start"in e||"end"in e){return wcr(e)}if("line"in e||"column"in e){return S0t(e)}return""}function S0t(e){return Ecr(e&&e.line)+":"+Ecr(e&&e.column)}function wcr(e){return S0t(e&&e.start)+"-"+S0t(e&&e.end)}function Ecr(e){return e&&typeof e==="number"?e:1}var Ccr=Ce(()=>{});var A0t=Ce(()=>{Ccr()});var Xm;var Scr=Ce(()=>{A0t();Xm=class extends Error{constructor(t,n,r){super();if(typeof n==="string"){r=n;n=void 0}let i="";let o={};let a=false;if(n){if("line"in n&&"column"in n){o={place:n}}else if("start"in n&&"end"in n){o={place:n}}else if("type"in n){o={ancestors:[n],place:n.position}}else{o={...n}}}if(typeof t==="string"){i=t}else if(!o.cause&&t){a=true;i=t.message;o.cause=t}if(!o.ruleId&&!o.source&&typeof r==="string"){const l=r.indexOf(":");if(l===-1){o.ruleId=r}else{o.source=r.slice(0,l);o.ruleId=r.slice(l+1)}}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];if(l){o.place=l.position}}const s=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0;this.cause=o.cause||void 0;this.column=s?s.column:void 0;this.fatal=void 0;this.file="";this.message=i;this.line=s?s.line:void 0;this.name=lF(o.place)||"1:1";this.place=o.place||void 0;this.reason=this.message;this.ruleId=o.ruleId||void 0;this.source=o.source||void 0;this.stack=a&&o.cause&&typeof o.cause.stack==="string"?o.cause.stack:"";this.actual=void 0;this.expected=void 0;this.note=void 0;this.url=void 0}};Xm.prototype.file="";Xm.prototype.name="";Xm.prototype.reason="";Xm.prototype.message="";Xm.prototype.stack="";Xm.prototype.column=void 0;Xm.prototype.line=void 0;Xm.prototype.ancestors=void 0;Xm.prototype.cause=void 0;Xm.prototype.fatal=void 0;Xm.prototype.place=void 0;Xm.prototype.ruleId=void 0;Xm.prototype.source=void 0});var Acr=Ce(()=>{Scr()});import{default as f2}from"node:path";var kcr=Ce(()=>{});import{default as Rcr}from"node:process";var Pcr=Ce(()=>{});function QDe(e){return Boolean(e!==null&&typeof e==="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}var Icr=Ce(()=>{});import{fileURLToPath as Mcr}from"node:url";var Lcr=Ce(()=>{Icr()});function R0t(e,t){if(e&&e.includes(f2.sep)){throw new Error("`"+t+"` cannot be a path: did not expect `"+f2.sep+"`")}}function P0t(e,t){if(!e){throw new Error("`"+t+"` cannot be empty")}}function Dcr(e,t){if(!e){throw new Error("Setting `"+t+"` requires `path` to be set too")}}function bpo(e){return Boolean(e&&typeof e==="object"&&"byteLength"in e&&"byteOffset"in e)}var k0t,foe;var Fcr=Ce(()=>{Acr();kcr();Pcr();Lcr();k0t=["history","path","basename","stem","extname","dirname"];foe=class{constructor(t){let n;if(!t){n={}}else if(QDe(t)){n={path:t}}else if(typeof t==="string"||bpo(t)){n={value:t}}else{n=t}this.cwd="cwd"in n?"":Rcr.cwd();this.data={};this.history=[];this.messages=[];this.value;this.map;this.result;this.stored;let r=-1;while(++r{Fcr()});var Ocr;var Bcr=Ce(()=>{Ocr=function(e){const t=this;const n=t.constructor;const r=n.prototype;const i=r[e];const o=function(){return i.apply(o,arguments)};Object.setPrototypeOf(o,r);return o}});function I0t(e,t){if(typeof t!=="function"){throw new TypeError("Cannot `"+e+"` without `parser`")}}function M0t(e,t){if(typeof t!=="function"){throw new TypeError("Cannot `"+e+"` without `compiler`")}}function L0t(e,t){if(t){throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}}function zcr(e){if(!doe(e)||typeof e.type!=="string"){throw new TypeError("Expected node, got `"+e+"`")}}function Ucr(e,t,n){if(!n){throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}}function eFe(e){return vpo(e)?e:new foe(e)}function vpo(e){return Boolean(e&&typeof e==="object"&&"message"in e&&"messages"in e)}function _po(e){return typeof e==="string"||Tpo(e)}function Tpo(e){return Boolean(e&&typeof e==="object"&&"byteLength"in e&&"byteOffset"in e)}var tFe,xpo,D0t,F0t;var Vcr=Ce(()=>{ccr();tFe=Ui(bcr(),1);JW();xcr();Tcr();Ncr();Bcr();xpo={}.hasOwnProperty;D0t=class e extends Ocr{constructor(){super("copy");this.Compiler=void 0;this.Parser=void 0;this.attachers=[];this.compiler=void 0;this.freezeIndex=-1;this.frozen=void 0;this.namespace={};this.parser=void 0;this.transformers=C0t()}copy(){const t=new e;let n=-1;while(++n0){let[m,...g]=d;const x=r[h][1];if(doe(x)&&doe(m)){m=(0,tFe.default)(true,x,m)}r[h]=[u,m,...g]}}}};F0t=new D0t().freeze()});var $cr=Ce(()=>{Vcr()});function BP(e,t){const n=t||wpo;const r=typeof n.includeImageAlt==="boolean"?n.includeImageAlt:true;const i=typeof n.includeHtml==="boolean"?n.includeHtml:true;return Hcr(e,r,i)}function Hcr(e,t,n){if(Epo(e)){if("value"in e){return e.type==="html"&&!n?"":e.value}if(t&&"alt"in e&&e.alt){return e.alt}if("children"in e){return Gcr(e.children,t,n)}}if(Array.isArray(e)){return Gcr(e,t,n)}return""}function Gcr(e,t,n){const r=[];let i=-1;while(++i{wpo={}});var hoe=Ce(()=>{Wcr()});var N0t;var Ycr=Ce(()=>{N0t={AElig:"\xC6",AMP:"&",Aacute:"\xC1",Abreve:"\u0102",Acirc:"\xC2",Acy:"\u0410",Afr:"\u{1D504}",Agrave:"\xC0",Alpha:"\u0391",Amacr:"\u0100",And:"\u2A53",Aogon:"\u0104",Aopf:"\u{1D538}",ApplyFunction:"\u2061",Aring:"\xC5",Ascr:"\u{1D49C}",Assign:"\u2254",Atilde:"\xC3",Auml:"\xC4",Backslash:"\u2216",Barv:"\u2AE7",Barwed:"\u2306",Bcy:"\u0411",Because:"\u2235",Bernoullis:"\u212C",Beta:"\u0392",Bfr:"\u{1D505}",Bopf:"\u{1D539}",Breve:"\u02D8",Bscr:"\u212C",Bumpeq:"\u224E",CHcy:"\u0427",COPY:"\xA9",Cacute:"\u0106",Cap:"\u22D2",CapitalDifferentialD:"\u2145",Cayleys:"\u212D",Ccaron:"\u010C",Ccedil:"\xC7",Ccirc:"\u0108",Cconint:"\u2230",Cdot:"\u010A",Cedilla:"\xB8",CenterDot:"\xB7",Cfr:"\u212D",Chi:"\u03A7",CircleDot:"\u2299",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",Colon:"\u2237",Colone:"\u2A74",Congruent:"\u2261",Conint:"\u222F",ContourIntegral:"\u222E",Copf:"\u2102",Coproduct:"\u2210",CounterClockwiseContourIntegral:"\u2233",Cross:"\u2A2F",Cscr:"\u{1D49E}",Cup:"\u22D3",CupCap:"\u224D",DD:"\u2145",DDotrahd:"\u2911",DJcy:"\u0402",DScy:"\u0405",DZcy:"\u040F",Dagger:"\u2021",Darr:"\u21A1",Dashv:"\u2AE4",Dcaron:"\u010E",Dcy:"\u0414",Del:"\u2207",Delta:"\u0394",Dfr:"\u{1D507}",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",Diamond:"\u22C4",DifferentialD:"\u2146",Dopf:"\u{1D53B}",Dot:"\xA8",DotDot:"\u20DC",DotEqual:"\u2250",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",Downarrow:"\u21D3",Dscr:"\u{1D49F}",Dstrok:"\u0110",ENG:"\u014A",ETH:"\xD0",Eacute:"\xC9",Ecaron:"\u011A",Ecirc:"\xCA",Ecy:"\u042D",Edot:"\u0116",Efr:"\u{1D508}",Egrave:"\xC8",Element:"\u2208",Emacr:"\u0112",EmptySmallSquare:"\u25FB",EmptyVerySmallSquare:"\u25AB",Eogon:"\u0118",Eopf:"\u{1D53C}",Epsilon:"\u0395",Equal:"\u2A75",EqualTilde:"\u2242",Equilibrium:"\u21CC",Escr:"\u2130",Esim:"\u2A73",Eta:"\u0397",Euml:"\xCB",Exists:"\u2203",ExponentialE:"\u2147",Fcy:"\u0424",Ffr:"\u{1D509}",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",Fopf:"\u{1D53D}",ForAll:"\u2200",Fouriertrf:"\u2131",Fscr:"\u2131",GJcy:"\u0403",GT:">",Gamma:"\u0393",Gammad:"\u03DC",Gbreve:"\u011E",Gcedil:"\u0122",Gcirc:"\u011C",Gcy:"\u0413",Gdot:"\u0120",Gfr:"\u{1D50A}",Gg:"\u22D9",Gopf:"\u{1D53E}",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",Gt:"\u226B",HARDcy:"\u042A",Hacek:"\u02C7",Hat:"^",Hcirc:"\u0124",Hfr:"\u210C",HilbertSpace:"\u210B",Hopf:"\u210D",HorizontalLine:"\u2500",Hscr:"\u210B",Hstrok:"\u0126",HumpDownHump:"\u224E",HumpEqual:"\u224F",IEcy:"\u0415",IJlig:"\u0132",IOcy:"\u0401",Iacute:"\xCD",Icirc:"\xCE",Icy:"\u0418",Idot:"\u0130",Ifr:"\u2111",Igrave:"\xCC",Im:"\u2111",Imacr:"\u012A",ImaginaryI:"\u2148",Implies:"\u21D2",Int:"\u222C",Integral:"\u222B",Intersection:"\u22C2",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",Iogon:"\u012E",Iopf:"\u{1D540}",Iota:"\u0399",Iscr:"\u2110",Itilde:"\u0128",Iukcy:"\u0406",Iuml:"\xCF",Jcirc:"\u0134",Jcy:"\u0419",Jfr:"\u{1D50D}",Jopf:"\u{1D541}",Jscr:"\u{1D4A5}",Jsercy:"\u0408",Jukcy:"\u0404",KHcy:"\u0425",KJcy:"\u040C",Kappa:"\u039A",Kcedil:"\u0136",Kcy:"\u041A",Kfr:"\u{1D50E}",Kopf:"\u{1D542}",Kscr:"\u{1D4A6}",LJcy:"\u0409",LT:"<",Lacute:"\u0139",Lambda:"\u039B",Lang:"\u27EA",Laplacetrf:"\u2112",Larr:"\u219E",Lcaron:"\u013D",Lcedil:"\u013B",Lcy:"\u041B",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",LeftRightArrow:"\u2194",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",Leftarrow:"\u21D0",Leftrightarrow:"\u21D4",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",LessLess:"\u2AA1",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",Lfr:"\u{1D50F}",Ll:"\u22D8",Lleftarrow:"\u21DA",Lmidot:"\u013F",LongLeftArrow:"\u27F5",LongLeftRightArrow:"\u27F7",LongRightArrow:"\u27F6",Longleftarrow:"\u27F8",Longleftrightarrow:"\u27FA",Longrightarrow:"\u27F9",Lopf:"\u{1D543}",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",Lscr:"\u2112",Lsh:"\u21B0",Lstrok:"\u0141",Lt:"\u226A",Map:"\u2905",Mcy:"\u041C",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",MinusPlus:"\u2213",Mopf:"\u{1D544}",Mscr:"\u2133",Mu:"\u039C",NJcy:"\u040A",Nacute:"\u0143",Ncaron:"\u0147",Ncedil:"\u0145",Ncy:"\u041D",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:"\n",Nfr:"\u{1D511}",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",Not:"\u2AEC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",Nscr:"\u{1D4A9}",Ntilde:"\xD1",Nu:"\u039D",OElig:"\u0152",Oacute:"\xD3",Ocirc:"\xD4",Ocy:"\u041E",Odblac:"\u0150",Ofr:"\u{1D512}",Ograve:"\xD2",Omacr:"\u014C",Omega:"\u03A9",Omicron:"\u039F",Oopf:"\u{1D546}",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",Or:"\u2A54",Oscr:"\u{1D4AA}",Oslash:"\xD8",Otilde:"\xD5",Otimes:"\u2A37",Ouml:"\xD6",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",PartialD:"\u2202",Pcy:"\u041F",Pfr:"\u{1D513}",Phi:"\u03A6",Pi:"\u03A0",PlusMinus:"\xB1",Poincareplane:"\u210C",Popf:"\u2119",Pr:"\u2ABB",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",Prime:"\u2033",Product:"\u220F",Proportion:"\u2237",Proportional:"\u221D",Pscr:"\u{1D4AB}",Psi:"\u03A8",QUOT:'"',Qfr:"\u{1D514}",Qopf:"\u211A",Qscr:"\u{1D4AC}",RBarr:"\u2910",REG:"\xAE",Racute:"\u0154",Rang:"\u27EB",Rarr:"\u21A0",Rarrtl:"\u2916",Rcaron:"\u0158",Rcedil:"\u0156",Rcy:"\u0420",Re:"\u211C",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",Rfr:"\u211C",Rho:"\u03A1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",Rightarrow:"\u21D2",Ropf:"\u211D",RoundImplies:"\u2970",Rrightarrow:"\u21DB",Rscr:"\u211B",Rsh:"\u21B1",RuleDelayed:"\u29F4",SHCHcy:"\u0429",SHcy:"\u0428",SOFTcy:"\u042C",Sacute:"\u015A",Sc:"\u2ABC",Scaron:"\u0160",Scedil:"\u015E",Scirc:"\u015C",Scy:"\u0421",Sfr:"\u{1D516}",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",Sigma:"\u03A3",SmallCircle:"\u2218",Sopf:"\u{1D54A}",Sqrt:"\u221A",Square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",Sscr:"\u{1D4AE}",Star:"\u22C6",Sub:"\u22D0",Subset:"\u22D0",SubsetEqual:"\u2286",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",SuchThat:"\u220B",Sum:"\u2211",Sup:"\u22D1",Superset:"\u2283",SupersetEqual:"\u2287",Supset:"\u22D1",THORN:"\xDE",TRADE:"\u2122",TSHcy:"\u040B",TScy:"\u0426",Tab:" ",Tau:"\u03A4",Tcaron:"\u0164",Tcedil:"\u0162",Tcy:"\u0422",Tfr:"\u{1D517}",Therefore:"\u2234",Theta:"\u0398",ThickSpace:"\u205F\u200A",ThinSpace:"\u2009",Tilde:"\u223C",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",Topf:"\u{1D54B}",TripleDot:"\u20DB",Tscr:"\u{1D4AF}",Tstrok:"\u0166",Uacute:"\xDA",Uarr:"\u219F",Uarrocir:"\u2949",Ubrcy:"\u040E",Ubreve:"\u016C",Ucirc:"\xDB",Ucy:"\u0423",Udblac:"\u0170",Ufr:"\u{1D518}",Ugrave:"\xD9",Umacr:"\u016A",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",Uopf:"\u{1D54C}",UpArrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",UpEquilibrium:"\u296E",UpTee:"\u22A5",UpTeeArrow:"\u21A5",Uparrow:"\u21D1",Updownarrow:"\u21D5",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",Upsilon:"\u03A5",Uring:"\u016E",Uscr:"\u{1D4B0}",Utilde:"\u0168",Uuml:"\xDC",VDash:"\u22AB",Vbar:"\u2AEB",Vcy:"\u0412",Vdash:"\u22A9",Vdashl:"\u2AE6",Vee:"\u22C1",Verbar:"\u2016",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",Vopf:"\u{1D54D}",Vscr:"\u{1D4B1}",Vvdash:"\u22AA",Wcirc:"\u0174",Wedge:"\u22C0",Wfr:"\u{1D51A}",Wopf:"\u{1D54E}",Wscr:"\u{1D4B2}",Xfr:"\u{1D51B}",Xi:"\u039E",Xopf:"\u{1D54F}",Xscr:"\u{1D4B3}",YAcy:"\u042F",YIcy:"\u0407",YUcy:"\u042E",Yacute:"\xDD",Ycirc:"\u0176",Ycy:"\u042B",Yfr:"\u{1D51C}",Yopf:"\u{1D550}",Yscr:"\u{1D4B4}",Yuml:"\u0178",ZHcy:"\u0416",Zacute:"\u0179",Zcaron:"\u017D",Zcy:"\u0417",Zdot:"\u017B",ZeroWidthSpace:"\u200B",Zeta:"\u0396",Zfr:"\u2128",Zopf:"\u2124",Zscr:"\u{1D4B5}",aacute:"\xE1",abreve:"\u0103",ac:"\u223E",acE:"\u223E\u0333",acd:"\u223F",acirc:"\xE2",acute:"\xB4",acy:"\u0430",aelig:"\xE6",af:"\u2061",afr:"\u{1D51E}",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",alpha:"\u03B1",amacr:"\u0101",amalg:"\u2A3F",amp:"&",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",aogon:"\u0105",aopf:"\u{1D552}",ap:"\u2248",apE:"\u2A70",apacir:"\u2A6F",ape:"\u224A",apid:"\u224B",apos:"'",approx:"\u2248",approxeq:"\u224A",aring:"\xE5",ascr:"\u{1D4B6}",ast:"*",asymp:"\u2248",asympeq:"\u224D",atilde:"\xE3",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",bNot:"\u2AED",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",barvee:"\u22BD",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",beta:"\u03B2",beth:"\u2136",between:"\u226C",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bnot:"\u2310",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxDL:"\u2557",boxDR:"\u2554",boxDl:"\u2556",boxDr:"\u2553",boxH:"\u2550",boxHD:"\u2566",boxHU:"\u2569",boxHd:"\u2564",boxHu:"\u2567",boxUL:"\u255D",boxUR:"\u255A",boxUl:"\u255C",boxUr:"\u2559",boxV:"\u2551",boxVH:"\u256C",boxVL:"\u2563",boxVR:"\u2560",boxVh:"\u256B",boxVl:"\u2562",boxVr:"\u255F",boxbox:"\u29C9",boxdL:"\u2555",boxdR:"\u2552",boxdl:"\u2510",boxdr:"\u250C",boxh:"\u2500",boxhD:"\u2565",boxhU:"\u2568",boxhd:"\u252C",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxuL:"\u255B",boxuR:"\u2558",boxul:"\u2518",boxur:"\u2514",boxv:"\u2502",boxvH:"\u256A",boxvL:"\u2561",boxvR:"\u255E",boxvh:"\u253C",boxvl:"\u2524",boxvr:"\u251C",bprime:"\u2035",breve:"\u02D8",brvbar:"\xA6",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",bumpeq:"\u224F",cacute:"\u0107",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",ccaps:"\u2A4D",ccaron:"\u010D",ccedil:"\xE7",ccirc:"\u0109",ccups:"\u2A4C",ccupssm:"\u2A50",cdot:"\u010B",cedil:"\xB8",cemptyv:"\u29B2",cent:"\xA2",centerdot:"\xB7",cfr:"\u{1D520}",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",chi:"\u03C7",cir:"\u25CB",cirE:"\u29C3",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledR:"\xAE",circledS:"\u24C8",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",clubs:"\u2663",clubsuit:"\u2663",colon:":",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",conint:"\u222E",copf:"\u{1D554}",coprod:"\u2210",copy:"\xA9",copysr:"\u2117",crarr:"\u21B5",cross:"\u2717",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",cup:"\u222A",cupbrcap:"\u2A48",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",dArr:"\u21D3",dHar:"\u2965",dagger:"\u2020",daleth:"\u2138",darr:"\u2193",dash:"\u2010",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",dcaron:"\u010F",dcy:"\u0434",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",ddotseq:"\u2A77",deg:"\xB0",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",dfr:"\u{1D521}",dharl:"\u21C3",dharr:"\u21C2",diam:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",dopf:"\u{1D555}",dot:"\u02D9",doteq:"\u2250",doteqdot:"\u2251",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",downarrow:"\u2193",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",dscr:"\u{1D4B9}",dscy:"\u0455",dsol:"\u29F6",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",dzcy:"\u045F",dzigrarr:"\u27FF",eDDot:"\u2A77",eDot:"\u2251",eacute:"\xE9",easter:"\u2A6E",ecaron:"\u011B",ecir:"\u2256",ecirc:"\xEA",ecolon:"\u2255",ecy:"\u044D",edot:"\u0117",ee:"\u2147",efDot:"\u2252",efr:"\u{1D522}",eg:"\u2A9A",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",emptyv:"\u2205",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",eng:"\u014B",ensp:"\u2002",eogon:"\u0119",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",equals:"=",equest:"\u225F",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erDot:"\u2253",erarr:"\u2971",escr:"\u212F",esdot:"\u2250",esim:"\u2242",eta:"\u03B7",eth:"\xF0",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",expectation:"\u2130",exponentiale:"\u2147",fallingdotseq:"\u2252",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",ffr:"\u{1D523}",filig:"\uFB01",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",fopf:"\u{1D557}",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",fscr:"\u{1D4BB}",gE:"\u2267",gEl:"\u2A8C",gacute:"\u01F5",gamma:"\u03B3",gammad:"\u03DD",gap:"\u2A86",gbreve:"\u011F",gcirc:"\u011D",gcy:"\u0433",gdot:"\u0121",ge:"\u2265",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",gfr:"\u{1D524}",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",gjcy:"\u0453",gl:"\u2277",glE:"\u2A92",gla:"\u2AA5",glj:"\u2AA4",gnE:"\u2269",gnap:"\u2A8A",gnapprox:"\u2A8A",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",gopf:"\u{1D558}",grave:"`",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",hArr:"\u21D4",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",hardcy:"\u044A",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",hbar:"\u210F",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",hfr:"\u{1D525}",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",hopf:"\u{1D559}",horbar:"\u2015",hscr:"\u{1D4BD}",hslash:"\u210F",hstrok:"\u0127",hybull:"\u2043",hyphen:"\u2010",iacute:"\xED",ic:"\u2063",icirc:"\xEE",icy:"\u0438",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",ifr:"\u{1D526}",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",ijlig:"\u0133",imacr:"\u012B",image:"\u2111",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",int:"\u222B",intcal:"\u22BA",integers:"\u2124",intercal:"\u22BA",intlarhk:"\u2A17",intprod:"\u2A3C",iocy:"\u0451",iogon:"\u012F",iopf:"\u{1D55A}",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",iscr:"\u{1D4BE}",isin:"\u2208",isinE:"\u22F9",isindot:"\u22F5",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",itilde:"\u0129",iukcy:"\u0456",iuml:"\xEF",jcirc:"\u0135",jcy:"\u0439",jfr:"\u{1D527}",jmath:"\u0237",jopf:"\u{1D55B}",jscr:"\u{1D4BF}",jsercy:"\u0458",jukcy:"\u0454",kappa:"\u03BA",kappav:"\u03F0",kcedil:"\u0137",kcy:"\u043A",kfr:"\u{1D528}",kgreen:"\u0138",khcy:"\u0445",kjcy:"\u045C",kopf:"\u{1D55C}",kscr:"\u{1D4C0}",lAarr:"\u21DA",lArr:"\u21D0",lAtail:"\u291B",lBarr:"\u290E",lE:"\u2266",lEg:"\u2A8B",lHar:"\u2962",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",lambda:"\u03BB",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",laquo:"\xAB",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",lcaron:"\u013E",lcedil:"\u013C",lceil:"\u2308",lcub:"{",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",le:"\u2264",leftarrow:"\u2190",leftarrowtail:"\u21A2",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",leftthreetimes:"\u22CB",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",lessgtr:"\u2276",lesssim:"\u2272",lfisht:"\u297C",lfloor:"\u230A",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",ljcy:"\u0459",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",llhard:"\u296B",lltri:"\u25FA",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnE:"\u2268",lnap:"\u2A89",lnapprox:"\u2A89",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",longleftarrow:"\u27F5",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",lscr:"\u{1D4C1}",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",lstrok:"\u0142",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltrPar:"\u2996",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",mDDot:"\u223A",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",mcy:"\u043C",mdash:"\u2014",measuredangle:"\u2221",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",mopf:"\u{1D55E}",mp:"\u2213",mscr:"\u{1D4C2}",mstpos:"\u223E",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nGg:"\u22D9\u0338",nGt:"\u226B\u20D2",nGtv:"\u226B\u0338",nLeftarrow:"\u21CD",nLeftrightarrow:"\u21CE",nLl:"\u22D8\u0338",nLt:"\u226A\u20D2",nLtv:"\u226A\u0338",nRightarrow:"\u21CF",nVDash:"\u22AF",nVdash:"\u22AE",nabla:"\u2207",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",ncaron:"\u0148",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",neArr:"\u21D7",nearhk:"\u2924",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",nexist:"\u2204",nexists:"\u2204",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",ngsim:"\u2275",ngt:"\u226F",ngtr:"\u226F",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",njcy:"\u045A",nlArr:"\u21CD",nlE:"\u2266\u0338",nlarr:"\u219A",nldr:"\u2025",nle:"\u2270",nleftarrow:"\u219A",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nlsim:"\u2274",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nmid:"\u2224",nopf:"\u{1D55F}",not:"\xAC",notin:"\u2209",notinE:"\u22F9\u0338",notindot:"\u22F5\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvDash:"\u22AD",nvHarr:"\u2904",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwArr:"\u21D6",nwarhk:"\u2923",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",oS:"\u24C8",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",ocirc:"\xF4",ocy:"\u043E",odash:"\u229D",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",oelig:"\u0153",ofcir:"\u29BF",ofr:"\u{1D52C}",ogon:"\u02DB",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",omacr:"\u014D",omega:"\u03C9",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",oopf:"\u{1D560}",opar:"\u29B7",operp:"\u29B9",oplus:"\u2295",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oscr:"\u2134",oslash:"\xF8",osol:"\u2298",otilde:"\xF5",otimes:"\u2297",otimesas:"\u2A36",ouml:"\xF6",ovbar:"\u233D",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",pfr:"\u{1D52D}",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",pointint:"\u2A15",popf:"\u{1D561}",pound:"\xA3",pr:"\u227A",prE:"\u2AB3",prap:"\u2AB7",prcue:"\u227C",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",prime:"\u2032",primes:"\u2119",prnE:"\u2AB5",prnap:"\u2AB9",prnsim:"\u22E8",prod:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",pscr:"\u{1D4C5}",psi:"\u03C8",puncsp:"\u2008",qfr:"\u{1D52E}",qint:"\u2A0C",qopf:"\u{1D562}",qprime:"\u2057",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",quot:'"',rAarr:"\u21DB",rArr:"\u21D2",rAtail:"\u291C",rBarr:"\u290F",rHar:"\u2964",race:"\u223D\u0331",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",rarrtl:"\u21A3",rarrw:"\u219D",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",rcaron:"\u0159",rcedil:"\u0157",rceil:"\u2309",rcub:"}",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",reg:"\xAE",rfisht:"\u297D",rfloor:"\u230B",rfr:"\u{1D52F}",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",rho:"\u03C1",rhov:"\u03F1",rightarrow:"\u2192",rightarrowtail:"\u21A3",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",rightthreetimes:"\u22CC",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",rsaquo:"\u203A",rscr:"\u{1D4C7}",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",ruluhar:"\u2968",rx:"\u211E",sacute:"\u015B",sbquo:"\u201A",sc:"\u227B",scE:"\u2AB4",scap:"\u2AB8",scaron:"\u0161",sccue:"\u227D",sce:"\u2AB0",scedil:"\u015F",scirc:"\u015D",scnE:"\u2AB6",scnap:"\u2ABA",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",seArr:"\u21D8",searhk:"\u2925",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",shchcy:"\u0449",shcy:"\u0448",shortmid:"\u2223",shortparallel:"\u2225",shy:"\xAD",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",square:"\u25A1",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",sub:"\u2282",subE:"\u2AC5",subdot:"\u2ABD",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",sum:"\u2211",sung:"\u266A",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",sup:"\u2283",supE:"\u2AC6",supdot:"\u2ABE",supdsub:"\u2AD8",supe:"\u2287",supedot:"\u2AC4",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swArr:"\u21D9",swarhk:"\u2926",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",target:"\u2316",tau:"\u03C4",tbrk:"\u23B4",tcaron:"\u0165",tcedil:"\u0163",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",tfr:"\u{1D531}",there4:"\u2234",therefore:"\u2234",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",thinsp:"\u2009",thkap:"\u2248",thksim:"\u223C",thorn:"\xFE",tilde:"\u02DC",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",tscr:"\u{1D4C9}",tscy:"\u0446",tshcy:"\u045B",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",uArr:"\u21D1",uHar:"\u2963",uacute:"\xFA",uarr:"\u2191",ubrcy:"\u045E",ubreve:"\u016D",ucirc:"\xFB",ucy:"\u0443",udarr:"\u21C5",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",ufr:"\u{1D532}",ugrave:"\xF9",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",umacr:"\u016B",uml:"\xA8",uogon:"\u0173",uopf:"\u{1D566}",uparrow:"\u2191",updownarrow:"\u2195",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",upsi:"\u03C5",upsih:"\u03D2",upsilon:"\u03C5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",uring:"\u016F",urtri:"\u25F9",uscr:"\u{1D4CA}",utdot:"\u22F0",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",uuml:"\xFC",uwangle:"\u29A7",vArr:"\u21D5",vBar:"\u2AE8",vBarv:"\u2AE9",vDash:"\u22A8",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",vcy:"\u0432",vdash:"\u22A2",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",verbar:"|",vert:"|",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",vzigzag:"\u299A",wcirc:"\u0175",wedbar:"\u2A5F",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",wfr:"\u{1D534}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",yacute:"\xFD",yacy:"\u044F",ycirc:"\u0177",ycy:"\u044B",yen:"\xA5",yfr:"\u{1D536}",yicy:"\u0457",yopf:"\u{1D56A}",yscr:"\u{1D4CE}",yucy:"\u044E",yuml:"\xFF",zacute:"\u017A",zcaron:"\u017E",zcy:"\u0437",zdot:"\u017C",zeetrf:"\u2128",zeta:"\u03B6",zfr:"\u{1D537}",zhcy:"\u0436",zigrarr:"\u21DD",zopf:"\u{1D56B}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"}});function QW(e){return Cpo.call(N0t,e)?N0t[e]:false}var Cpo;var nFe=Ce(()=>{Ycr();Cpo={}.hasOwnProperty});function Th(e,t,n,r){const i=e.length;let o=0;let a;if(t<0){t=-t>i?0:i+t}else{t=t>i?i:t}n=n>0?n:0;if(r.length<1e4){a=Array.from(r);a.unshift(t,n);e.splice(...a)}else{if(n)e.splice(t,n);while(o0){Th(e,e.length,0,t);return e}return t}var zP=Ce(()=>{});function rFe(e){const t={};let n=-1;while(++n{zP();qcr={}.hasOwnProperty});function iFe(e,t){const n=Number.parseInt(e,t);if(n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111){return"\uFFFD"}return String.fromCodePoint(n)}var B0t=Ce(()=>{});function i0(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var eY=Ce(()=>{});function I8(e){return e!==null&&(e<32||e===127)}function So(e){return e!==null&&e<-2}function Al(e){return e!==null&&(e<0||e===32)}function Fa(e){return e===-2||e===-1||e===32}function cF(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}var Kp,Zp,Xcr,poe,jcr,Kcr,M8,zS;var vc=Ce(()=>{Kp=cF(/[A-Za-z]/);Zp=cF(/[\dA-Za-z]/);Xcr=cF(/[#-'*+\--9=?A-Z^-~]/);poe=cF(/\d/);jcr=cF(/[\dA-Fa-f]/);Kcr=cF(/[!-/:-@[-`{-~]/);M8=cF(/\p{P}|\p{S}/u);zS=cF(/\s/)});function Ra(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(l){if(Fa(l)){e.enter(n);return s(l)}return t(l)}function s(l){if(Fa(l)&&o++{vc()});function kpo(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(s){if(s===null){e.consume(s);return}e.enter("lineEnding");e.consume(s);e.exit("lineEnding");return Ra(e,t,"linePrefix")}function i(s){e.enter("paragraph");return o(s)}function o(s){const l=e.enter("chunkText",{contentType:"text",previous:n});if(n){n.next=l}n=l;return a(s)}function a(s){if(s===null){e.exit("chunkText");e.exit("paragraph");e.consume(s);return}if(So(s)){e.consume(s);e.exit("chunkText");return o}e.consume(s);return a}}var Zcr;var Jcr=Ce(()=>{wh();vc();Zcr={tokenize:kpo}});function Rpo(e){const t=this;const n=[];let r=0;let i;let o;let a;return s;function s(A){if(ra)){return}}const N=t.events.length;let O=N;let z;let U;while(O--){if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){if(z){U=t.events[O][1].end;break}z=true}}_(r);I=N;while(IA){const L=n[P];t.containerState=L[1];L[0].exit.call(t,e)}n.length=A}function C(){i.write([null]);o=void 0;i=void 0;t.containerState._closeFlow=void 0}}function Ppo(e,t,n){return Ra(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}var eur,Qcr;var tur=Ce(()=>{wh();vc();zP();eur={tokenize:Rpo};Qcr={tokenize:Ppo}});function UP(e){if(e===null||Al(e)||zS(e)){return 1}if(M8(e)){return 2}}var oFe=Ce(()=>{vc()});function uF(e,t,n){const r=[];let i=-1;while(++i{});function Ipo(e,t){let n=-1;let r;let i;let o;let a;let s;let l;let u;let d;while(++n1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end};const h={...e[n][1].start};nur(f,-l);nur(h,l);a={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}};s={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h};o={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}};i={type:l>1?"strong":"emphasis",start:{...a.start},end:{...s.end}};e[r][1].end={...a.start};e[n][1].start={...s.end};u=[];if(e[r][1].end.offset-e[r][1].start.offset){u=wb(u,[["enter",e[r][1],t],["exit",e[r][1],t]])}u=wb(u,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",o,t]]);u=wb(u,uF(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t));u=wb(u,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",i,t]]);if(e[n][1].end.offset-e[n][1].start.offset){d=2;u=wb(u,[["enter",e[n][1],t],["exit",e[n][1],t]])}else{d=0}Th(e,r-1,n-r+3,u);n=r+u.length-d-2;break}}}}n=-1;while(++n{zP();oFe();moe();goe={name:"attention",resolveAll:Ipo,tokenize:Mpo}});function Lpo(e,t,n){let r=0;return i;function i(m){e.enter("autolink");e.enter("autolinkMarker");e.consume(m);e.exit("autolinkMarker");e.enter("autolinkProtocol");return o}function o(m){if(Kp(m)){e.consume(m);return a}if(m===64){return n(m)}return u(m)}function a(m){if(m===43||m===45||m===46||Zp(m)){r=1;return s(m)}return u(m)}function s(m){if(m===58){e.consume(m);r=0;return l}if((m===43||m===45||m===46||Zp(m))&&r++<32){e.consume(m);return s}r=0;return u(m)}function l(m){if(m===62){e.exit("autolinkProtocol");e.enter("autolinkMarker");e.consume(m);e.exit("autolinkMarker");e.exit("autolink");return t}if(m===null||m===32||m===60||I8(m)){return n(m)}e.consume(m);return l}function u(m){if(m===64){e.consume(m);return d}if(Xcr(m)){e.consume(m);return u}return n(m)}function d(m){return Zp(m)?f(m):n(m)}function f(m){if(m===46){e.consume(m);r=0;return d}if(m===62){e.exit("autolinkProtocol").type="autolinkEmail";e.enter("autolinkMarker");e.consume(m);e.exit("autolinkMarker");e.exit("autolink");return t}return h(m)}function h(m){if((m===45||Zp(m))&&r++<63){const g=m===45?h:f;e.consume(m);return g}return n(m)}}var z0t;var iur=Ce(()=>{vc();z0t={name:"autolink",tokenize:Lpo}});function Dpo(e,t,n){return r;function r(o){return Fa(o)?Ra(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||So(o)?t(o):n(o)}}var US;var aFe=Ce(()=>{wh();vc();US={partial:true,tokenize:Dpo}});function Fpo(e,t,n){const r=this;return i;function i(a){if(a===62){const s=r.containerState;if(!s.open){e.enter("blockQuote",{_container:true});s.open=true}e.enter("blockQuotePrefix");e.enter("blockQuoteMarker");e.consume(a);e.exit("blockQuoteMarker");return o}return n(a)}function o(a){if(Fa(a)){e.enter("blockQuotePrefixWhitespace");e.consume(a);e.exit("blockQuotePrefixWhitespace");e.exit("blockQuotePrefix");return t}e.exit("blockQuotePrefix");return t(a)}}function Npo(e,t,n){const r=this;return i;function i(a){if(Fa(a)){return Ra(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}return o(a)}function o(a){return e.attempt(sFe,t,n)(a)}}function Opo(e){e.exit("blockQuote")}var sFe;var our=Ce(()=>{wh();vc();sFe={continuation:{tokenize:Npo},exit:Opo,name:"blockQuote",tokenize:Fpo}});function Bpo(e,t,n){return r;function r(o){e.enter("characterEscape");e.enter("escapeMarker");e.consume(o);e.exit("escapeMarker");return i}function i(o){if(Kcr(o)){e.enter("characterEscapeValue");e.consume(o);e.exit("characterEscapeValue");e.exit("characterEscape");return t}return n(o)}}var lFe;var aur=Ce(()=>{vc();lFe={name:"characterEscape",tokenize:Bpo}});function zpo(e,t,n){const r=this;let i=0;let o;let a;return s;function s(f){e.enter("characterReference");e.enter("characterReferenceMarker");e.consume(f);e.exit("characterReferenceMarker");return l}function l(f){if(f===35){e.enter("characterReferenceMarkerNumeric");e.consume(f);e.exit("characterReferenceMarkerNumeric");return u}e.enter("characterReferenceValue");o=31;a=Zp;return d(f)}function u(f){if(f===88||f===120){e.enter("characterReferenceMarkerHexadecimal");e.consume(f);e.exit("characterReferenceMarkerHexadecimal");e.enter("characterReferenceValue");o=6;a=jcr;return d}e.enter("characterReferenceValue");o=7;a=poe;return d(f)}function d(f){if(f===59&&i){const h=e.exit("characterReferenceValue");if(a===Zp&&!QW(r.sliceSerialize(h))){return n(f)}e.enter("characterReferenceMarker");e.consume(f);e.exit("characterReferenceMarker");e.exit("characterReference");return t}if(a(f)&&i++{nFe();vc();cFe={name:"characterReference",tokenize:zpo}});function Upo(e,t,n){const r=this;const i={partial:true,tokenize:L};let o=0;let a=0;let s;return l;function l(I){return u(I)}function u(I){const N=r.events[r.events.length-1];o=N&&N[1].type==="linePrefix"?N[2].sliceSerialize(N[1],true).length:0;s=I;e.enter("codeFenced");e.enter("codeFencedFence");e.enter("codeFencedFenceSequence");return d(I)}function d(I){if(I===s){a++;e.consume(I);return d}if(a<3){return n(I)}e.exit("codeFencedFenceSequence");return Fa(I)?Ra(e,f,"whitespace")(I):f(I)}function f(I){if(I===null||So(I)){e.exit("codeFencedFence");return r.interrupt?t(I):e.check(lur,x,P)(I)}e.enter("codeFencedFenceInfo");e.enter("chunkString",{contentType:"string"});return h(I)}function h(I){if(I===null||So(I)){e.exit("chunkString");e.exit("codeFencedFenceInfo");return f(I)}if(Fa(I)){e.exit("chunkString");e.exit("codeFencedFenceInfo");return Ra(e,m,"whitespace")(I)}if(I===96&&I===s){return n(I)}e.consume(I);return h}function m(I){if(I===null||So(I)){return f(I)}e.enter("codeFencedFenceMeta");e.enter("chunkString",{contentType:"string"});return g(I)}function g(I){if(I===null||So(I)){e.exit("chunkString");e.exit("codeFencedFenceMeta");return f(I)}if(I===96&&I===s){return n(I)}e.consume(I);return g}function x(I){return e.attempt(i,P,w)(I)}function w(I){e.enter("lineEnding");e.consume(I);e.exit("lineEnding");return _}function _(I){return o>0&&Fa(I)?Ra(e,C,"linePrefix",o+1)(I):C(I)}function C(I){if(I===null||So(I)){return e.check(lur,x,P)(I)}e.enter("codeFlowValue");return A(I)}function A(I){if(I===null||So(I)){e.exit("codeFlowValue");return C(I)}e.consume(I);return A}function P(I){e.exit("codeFenced");return t(I)}function L(I,N,O){let z=0;return U;function U(X){I.enter("lineEnding");I.consume(X);I.exit("lineEnding");return W}function W(X){I.enter("codeFencedFence");return Fa(X)?Ra(I,H,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(X):H(X)}function H(X){if(X===s){I.enter("codeFencedFenceSequence");return $(X)}return O(X)}function $(X){if(X===s){z++;I.consume(X);return $}if(z>=a){I.exit("codeFencedFenceSequence");return Fa(X)?Ra(I,K,"whitespace")(X):K(X)}return O(X)}function K(X){if(X===null||So(X)){I.exit("codeFencedFence");return N(X)}return O(X)}}}function Vpo(e,t,n){const r=this;return i;function i(a){if(a===null){return n(a)}e.enter("lineEnding");e.consume(a);e.exit("lineEnding");return o}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}var lur,uFe;var cur=Ce(()=>{wh();vc();lur={partial:true,tokenize:Vpo};uFe={concrete:true,name:"codeFenced",tokenize:Upo}});function Gpo(e,t,n){const r=this;return i;function i(u){e.enter("codeIndented");return Ra(e,o,"linePrefix",4+1)(u)}function o(u){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],true).length>=4?a(u):n(u)}function a(u){if(u===null){return l(u)}if(So(u)){return e.attempt($po,a,l)(u)}e.enter("codeFlowValue");return s(u)}function s(u){if(u===null||So(u)){e.exit("codeFlowValue");return a(u)}e.consume(u);return s}function l(u){e.exit("codeIndented");return t(u)}}function Hpo(e,t,n){const r=this;return i;function i(a){if(r.parser.lazy[r.now().line]){return n(a)}if(So(a)){e.enter("lineEnding");e.consume(a);e.exit("lineEnding");return i}return Ra(e,o,"linePrefix",4+1)(a)}function o(a){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],true).length>=4?t(a):So(a)?i(a):n(a)}}var yoe,$po;var uur=Ce(()=>{wh();vc();yoe={name:"codeIndented",tokenize:Gpo};$po={partial:true,tokenize:Hpo}});function Wpo(e){let t=e.length-4;let n=3;let r;let i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){r=n;while(++r{vc();U0t={name:"codeText",previous:Ypo,resolve:Wpo,tokenize:qpo}});function boe(e,t){let n=0;if(t.length<1e4){e.push(...t)}else{while(n{dFe=class{constructor(t){this.left=t?[...t]:[];this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length){throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`")}if(tthis.left.length){return this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse()}return this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);if(r)boe(this.left,r);return o.reverse()}pop(){this.setCursor(Number.POSITIVE_INFINITY);return this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY);this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY);boe(this.left,t)}unshift(t){this.setCursor(0);this.right.push(t)}unshiftMany(t){this.setCursor(0);boe(this.right,t.reverse())}setCursor(t){if(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0)return;if(t{zP();fur()});function Kpo(e){fFe(e);return e}function Zpo(e,t){let n;return r;function r(s){e.enter("content");n=e.enter("chunkContent",{contentType:"content"});return i(s)}function i(s){if(s===null){return o(s)}if(So(s)){return e.check(jpo,a,o)(s)}e.consume(s);return i}function o(s){e.exit("chunkContent");e.exit("content");return t(s)}function a(s){e.consume(s);e.exit("chunkContent");n.next=e.enter("chunkContent",{contentType:"content",previous:n});n=n.next;return i}}function Jpo(e,t,n){const r=this;return i;function i(a){e.exit("chunkContent");e.enter("lineEnding");e.consume(a);e.exit("lineEnding");return Ra(e,o,"linePrefix")}function o(a){if(a===null||So(a)){return n(a)}const s=r.events[r.events.length-1];if(!r.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],true).length>=4){return t(a)}return e.interrupt(r.parser.constructs.flow,n,t)(a)}}var $0t,jpo;var hur=Ce(()=>{wh();vc();V0t();$0t={resolve:Kpo,tokenize:Zpo};jpo={partial:true,tokenize:Jpo}});function hFe(e,t,n,r,i,o,a,s,l){const u=l||Number.POSITIVE_INFINITY;let d=0;return f;function f(_){if(_===60){e.enter(r);e.enter(i);e.enter(o);e.consume(_);e.exit(o);return h}if(_===null||_===32||_===41||I8(_)){return n(_)}e.enter(r);e.enter(a);e.enter(s);e.enter("chunkString",{contentType:"string"});return x(_)}function h(_){if(_===62){e.enter(o);e.consume(_);e.exit(o);e.exit(i);e.exit(r);return t}e.enter(s);e.enter("chunkString",{contentType:"string"});return m(_)}function m(_){if(_===62){e.exit("chunkString");e.exit(s);return h(_)}if(_===null||_===60||So(_)){return n(_)}e.consume(_);return _===92?g:m}function g(_){if(_===60||_===62||_===92){e.consume(_);return m}return m(_)}function x(_){if(!d&&(_===null||_===41||Al(_))){e.exit("chunkString");e.exit(s);e.exit(a);e.exit(r);return t(_)}if(d{vc()});function pFe(e,t,n,r,i,o){const a=this;let s=0;let l;return u;function u(m){e.enter(r);e.enter(i);e.consume(m);e.exit(i);e.enter(o);return d}function d(m){if(s>999||m===null||m===91||m===93&&!l||m===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs){return n(m)}if(m===93){e.exit(o);e.enter(i);e.consume(m);e.exit(i);e.exit(r);return t}if(So(m)){e.enter("lineEnding");e.consume(m);e.exit("lineEnding");return d}e.enter("chunkString",{contentType:"string"});return f(m)}function f(m){if(m===null||m===91||m===93||So(m)||s++>999){e.exit("chunkString");return d(m)}e.consume(m);if(!l)l=!Fa(m);return m===92?h:f}function h(m){if(m===91||m===92||m===93){e.consume(m);s++;return f}return f(m)}}var H0t=Ce(()=>{vc()});function mFe(e,t,n,r,i,o){let a;return s;function s(h){if(h===34||h===39||h===40){e.enter(r);e.enter(i);e.consume(h);e.exit(i);a=h===40?41:h;return l}return n(h)}function l(h){if(h===a){e.enter(i);e.consume(h);e.exit(i);e.exit(r);return t}e.enter(o);return u(h)}function u(h){if(h===a){e.exit(o);return l(a)}if(h===null){return n(h)}if(So(h)){e.enter("lineEnding");e.consume(h);e.exit("lineEnding");return Ra(e,u,"linePrefix")}e.enter("chunkString",{contentType:"string"});return d(h)}function d(h){if(h===a||h===null||So(h)){e.exit("chunkString");return u(h)}e.consume(h);return h===92?f:d}function f(h){if(h===a||h===92){e.consume(h);return d}return d(h)}}var W0t=Ce(()=>{wh();vc()});function L8(e,t){let n;return r;function r(i){if(So(i)){e.enter("lineEnding");e.consume(i);e.exit("lineEnding");n=true;return r}if(Fa(i)){return Ra(e,r,n?"linePrefix":"lineSuffix")(i)}return t(i)}}var Y0t=Ce(()=>{wh();vc()});function emo(e,t,n){const r=this;let i;return o;function o(m){e.enter("definition");return a(m)}function a(m){return pFe.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function s(m){i=i0(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1));if(m===58){e.enter("definitionMarker");e.consume(m);e.exit("definitionMarker");return l}return n(m)}function l(m){return Al(m)?L8(e,u)(m):u(m)}function u(m){return hFe(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function d(m){return e.attempt(Qpo,f,f)(m)}function f(m){return Fa(m)?Ra(e,h,"whitespace")(m):h(m)}function h(m){if(m===null||So(m)){e.exit("definition");r.parser.defined.push(i);return t(m)}return n(m)}}function tmo(e,t,n){return r;function r(s){return Al(s)?L8(e,i)(s):n(s)}function i(s){return mFe(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return Fa(s)?Ra(e,a,"whitespace")(s):a(s)}function a(s){return s===null||So(s)?t(s):n(s)}}var q0t,Qpo;var pur=Ce(()=>{G0t();H0t();wh();W0t();Y0t();vc();eY();q0t={name:"definition",tokenize:emo};Qpo={partial:true,tokenize:tmo}});function nmo(e,t,n){return r;function r(o){e.enter("hardBreakEscape");e.consume(o);return i}function i(o){if(So(o)){e.exit("hardBreakEscape");return t(o)}return n(o)}}var X0t;var mur=Ce(()=>{vc();X0t={name:"hardBreakEscape",tokenize:nmo}});function rmo(e,t){let n=e.length-2;let r=3;let i;let o;if(e[r][1].type==="whitespace"){r+=2}if(n-2>r&&e[n][1].type==="whitespace"){n-=2}if(e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")){n-=r+1===n?2:4}if(n>r){i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end};o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"};Th(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])}return e}function imo(e,t,n){let r=0;return i;function i(d){e.enter("atxHeading");return o(d)}function o(d){e.enter("atxHeadingSequence");return a(d)}function a(d){if(d===35&&r++<6){e.consume(d);return a}if(d===null||Al(d)){e.exit("atxHeadingSequence");return s(d)}return n(d)}function s(d){if(d===35){e.enter("atxHeadingSequence");return l(d)}if(d===null||So(d)){e.exit("atxHeading");return t(d)}if(Fa(d)){return Ra(e,s,"whitespace")(d)}e.enter("atxHeadingText");return u(d)}function l(d){if(d===35){e.consume(d);return l}e.exit("atxHeadingSequence");return s(d)}function u(d){if(d===null||d===35||Al(d)){e.exit("atxHeadingText");return s(d)}e.consume(d);return u}}var j0t;var gur=Ce(()=>{wh();vc();zP();j0t={name:"headingAtx",resolve:rmo,tokenize:imo}});var yur,K0t;var bur=Ce(()=>{yur=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"];K0t=["pre","script","style","textarea"]});function smo(e){let t=e.length;while(t--){if(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"){break}}if(t>1&&e[t-2][1].type==="linePrefix"){e[t][1].start=e[t-2][1].start;e[t+1][1].start=e[t-2][1].start;e.splice(t-2,2)}return e}function lmo(e,t,n){const r=this;let i;let o;let a;let s;let l;return u;function u(ue){return d(ue)}function d(ue){e.enter("htmlFlow");e.enter("htmlFlowData");e.consume(ue);return f}function f(ue){if(ue===33){e.consume(ue);return h}if(ue===47){e.consume(ue);o=true;return x}if(ue===63){e.consume(ue);i=3;return r.interrupt?t:se}if(Kp(ue)){e.consume(ue);a=String.fromCharCode(ue);return w}return n(ue)}function h(ue){if(ue===45){e.consume(ue);i=2;return m}if(ue===91){e.consume(ue);i=5;s=0;return g}if(Kp(ue)){e.consume(ue);i=4;return r.interrupt?t:se}return n(ue)}function m(ue){if(ue===45){e.consume(ue);return r.interrupt?t:se}return n(ue)}function g(ue){const xe="CDATA[";if(ue===xe.charCodeAt(s++)){e.consume(ue);if(s===xe.length){return r.interrupt?t:H}return g}return n(ue)}function x(ue){if(Kp(ue)){e.consume(ue);a=String.fromCharCode(ue);return w}return n(ue)}function w(ue){if(ue===null||ue===47||ue===62||Al(ue)){const xe=ue===47;const be=a.toLowerCase();if(!xe&&!o&&K0t.includes(be)){i=1;return r.interrupt?t(ue):H(ue)}if(yur.includes(a.toLowerCase())){i=6;if(xe){e.consume(ue);return _}return r.interrupt?t(ue):H(ue)}i=7;return r.interrupt&&!r.parser.lazy[r.now().line]?n(ue):o?C(ue):A(ue)}if(ue===45||Zp(ue)){e.consume(ue);a+=String.fromCharCode(ue);return w}return n(ue)}function _(ue){if(ue===62){e.consume(ue);return r.interrupt?t:H}return n(ue)}function C(ue){if(Fa(ue)){e.consume(ue);return C}return U(ue)}function A(ue){if(ue===47){e.consume(ue);return U}if(ue===58||ue===95||Kp(ue)){e.consume(ue);return P}if(Fa(ue)){e.consume(ue);return A}return U(ue)}function P(ue){if(ue===45||ue===46||ue===58||ue===95||Zp(ue)){e.consume(ue);return P}return L(ue)}function L(ue){if(ue===61){e.consume(ue);return I}if(Fa(ue)){e.consume(ue);return L}return A(ue)}function I(ue){if(ue===null||ue===60||ue===61||ue===62||ue===96){return n(ue)}if(ue===34||ue===39){e.consume(ue);l=ue;return N}if(Fa(ue)){e.consume(ue);return I}return O(ue)}function N(ue){if(ue===l){e.consume(ue);l=null;return z}if(ue===null||So(ue)){return n(ue)}e.consume(ue);return N}function O(ue){if(ue===null||ue===34||ue===39||ue===47||ue===60||ue===61||ue===62||ue===96||Al(ue)){return L(ue)}e.consume(ue);return O}function z(ue){if(ue===47||ue===62||Fa(ue)){return A(ue)}return n(ue)}function U(ue){if(ue===62){e.consume(ue);return W}return n(ue)}function W(ue){if(ue===null||So(ue)){return H(ue)}if(Fa(ue)){e.consume(ue);return W}return n(ue)}function H(ue){if(ue===45&&i===2){e.consume(ue);return j}if(ue===60&&i===1){e.consume(ue);return te}if(ue===62&&i===4){e.consume(ue);return re}if(ue===63&&i===3){e.consume(ue);return se}if(ue===93&&i===5){e.consume(ue);return oe}if(So(ue)&&(i===6||i===7)){e.exit("htmlFlowData");return e.check(omo,ce,$)(ue)}if(ue===null||So(ue)){e.exit("htmlFlowData");return $(ue)}e.consume(ue);return H}function $(ue){return e.check(amo,K,ce)(ue)}function K(ue){e.enter("lineEnding");e.consume(ue);e.exit("lineEnding");return X}function X(ue){if(ue===null||So(ue)){return $(ue)}e.enter("htmlFlowData");return H(ue)}function j(ue){if(ue===45){e.consume(ue);return se}return H(ue)}function te(ue){if(ue===47){e.consume(ue);a="";return J}return H(ue)}function J(ue){if(ue===62){const xe=a.toLowerCase();if(K0t.includes(xe)){e.consume(ue);return re}return H(ue)}if(Kp(ue)&&a.length<8){e.consume(ue);a+=String.fromCharCode(ue);return J}return H(ue)}function oe(ue){if(ue===93){e.consume(ue);return se}return H(ue)}function se(ue){if(ue===62){e.consume(ue);return re}if(ue===45&&i===2){e.consume(ue);return se}return H(ue)}function re(ue){if(ue===null||So(ue)){e.exit("htmlFlowData");return ce(ue)}e.consume(ue);return re}function ce(ue){e.exit("htmlFlow");return t(ue)}}function cmo(e,t,n){const r=this;return i;function i(a){if(So(a)){e.enter("lineEnding");e.consume(a);e.exit("lineEnding");return o}return n(a)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function umo(e,t,n){return r;function r(i){e.enter("lineEnding");e.consume(i);e.exit("lineEnding");return e.attempt(US,t,n)}}var Z0t,omo,amo;var xur=Ce(()=>{vc();bur();aFe();Z0t={concrete:true,name:"htmlFlow",resolveTo:smo,tokenize:lmo};omo={partial:true,tokenize:umo};amo={partial:true,tokenize:cmo}});function dmo(e,t,n){const r=this;let i;let o;let a;return s;function s(se){e.enter("htmlText");e.enter("htmlTextData");e.consume(se);return l}function l(se){if(se===33){e.consume(se);return u}if(se===47){e.consume(se);return L}if(se===63){e.consume(se);return A}if(Kp(se)){e.consume(se);return O}return n(se)}function u(se){if(se===45){e.consume(se);return d}if(se===91){e.consume(se);o=0;return g}if(Kp(se)){e.consume(se);return C}return n(se)}function d(se){if(se===45){e.consume(se);return m}return n(se)}function f(se){if(se===null){return n(se)}if(se===45){e.consume(se);return h}if(So(se)){a=f;return te(se)}e.consume(se);return f}function h(se){if(se===45){e.consume(se);return m}return f(se)}function m(se){return se===62?j(se):se===45?h(se):f(se)}function g(se){const re="CDATA[";if(se===re.charCodeAt(o++)){e.consume(se);return o===re.length?x:g}return n(se)}function x(se){if(se===null){return n(se)}if(se===93){e.consume(se);return w}if(So(se)){a=x;return te(se)}e.consume(se);return x}function w(se){if(se===93){e.consume(se);return _}return x(se)}function _(se){if(se===62){return j(se)}if(se===93){e.consume(se);return _}return x(se)}function C(se){if(se===null||se===62){return j(se)}if(So(se)){a=C;return te(se)}e.consume(se);return C}function A(se){if(se===null){return n(se)}if(se===63){e.consume(se);return P}if(So(se)){a=A;return te(se)}e.consume(se);return A}function P(se){return se===62?j(se):A(se)}function L(se){if(Kp(se)){e.consume(se);return I}return n(se)}function I(se){if(se===45||Zp(se)){e.consume(se);return I}return N(se)}function N(se){if(So(se)){a=N;return te(se)}if(Fa(se)){e.consume(se);return N}return j(se)}function O(se){if(se===45||Zp(se)){e.consume(se);return O}if(se===47||se===62||Al(se)){return z(se)}return n(se)}function z(se){if(se===47){e.consume(se);return j}if(se===58||se===95||Kp(se)){e.consume(se);return U}if(So(se)){a=z;return te(se)}if(Fa(se)){e.consume(se);return z}return j(se)}function U(se){if(se===45||se===46||se===58||se===95||Zp(se)){e.consume(se);return U}return W(se)}function W(se){if(se===61){e.consume(se);return H}if(So(se)){a=W;return te(se)}if(Fa(se)){e.consume(se);return W}return z(se)}function H(se){if(se===null||se===60||se===61||se===62||se===96){return n(se)}if(se===34||se===39){e.consume(se);i=se;return $}if(So(se)){a=H;return te(se)}if(Fa(se)){e.consume(se);return H}e.consume(se);return K}function $(se){if(se===i){e.consume(se);i=void 0;return X}if(se===null){return n(se)}if(So(se)){a=$;return te(se)}e.consume(se);return $}function K(se){if(se===null||se===34||se===39||se===60||se===61||se===96){return n(se)}if(se===47||se===62||Al(se)){return z(se)}e.consume(se);return K}function X(se){if(se===47||se===62||Al(se)){return z(se)}return n(se)}function j(se){if(se===62){e.consume(se);e.exit("htmlTextData");e.exit("htmlText");return t}return n(se)}function te(se){e.exit("htmlTextData");e.enter("lineEnding");e.consume(se);e.exit("lineEnding");return J}function J(se){return Fa(se)?Ra(e,oe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(se):oe(se)}function oe(se){e.enter("htmlTextData");return a(se)}}var J0t;var vur=Ce(()=>{wh();vc();J0t={name:"htmlText",tokenize:dmo}});function mmo(e){let t=-1;const n=[];while(++t{G0t();H0t();W0t();Y0t();vc();zP();eY();moe();D8={name:"labelEnd",resolveAll:mmo,resolveTo:gmo,tokenize:ymo};fmo={tokenize:bmo};hmo={tokenize:xmo};pmo={tokenize:vmo}});function _mo(e,t,n){const r=this;return i;function i(s){e.enter("labelImage");e.enter("labelImageMarker");e.consume(s);e.exit("labelImageMarker");return o}function o(s){if(s===91){e.enter("labelMarker");e.consume(s);e.exit("labelMarker");e.exit("labelImage");return a}return n(s)}function a(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}var Q0t;var _ur=Ce(()=>{gFe();Q0t={name:"labelStartImage",resolveAll:D8.resolveAll,tokenize:_mo}});function Tmo(e,t,n){const r=this;return i;function i(a){e.enter("labelLink");e.enter("labelMarker");e.consume(a);e.exit("labelMarker");e.exit("labelLink");return o}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}var ebt;var Tur=Ce(()=>{gFe();ebt={name:"labelStartLink",resolveAll:D8.resolveAll,tokenize:Tmo}});function wmo(e,t){return n;function n(r){e.enter("lineEnding");e.consume(r);e.exit("lineEnding");return Ra(e,t,"linePrefix")}}var xoe;var wur=Ce(()=>{wh();xoe={name:"lineEnding",tokenize:wmo}});function Emo(e,t,n){let r=0;let i;return o;function o(u){e.enter("thematicBreak");return a(u)}function a(u){i=u;return s(u)}function s(u){if(u===i){e.enter("thematicBreakSequence");return l(u)}if(r>=3&&(u===null||So(u))){e.exit("thematicBreak");return t(u)}return n(u)}function l(u){if(u===i){e.consume(u);r++;return l}e.exit("thematicBreakSequence");return Fa(u)?Ra(e,s,"whitespace")(u):s(u)}}var F8;var tbt=Ce(()=>{wh();vc();F8={name:"thematicBreak",tokenize:Emo}});function Amo(e,t,n){const r=this;const i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],true).length:0;let a=0;return s;function s(m){const g=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:poe(m)){if(!r.containerState.type){r.containerState.type=g;e.enter(g,{_container:true})}if(g==="listUnordered"){e.enter("listItemPrefix");return m===42||m===45?e.check(F8,n,u)(m):u(m)}if(!r.interrupt||m===49){e.enter("listItemPrefix");e.enter("listItemValue");return l(m)}}return n(m)}function l(m){if(poe(m)&&++a<10){e.consume(m);return l}if((!r.interrupt||a<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)){e.exit("listItemValue");return u(m)}return n(m)}function u(m){e.enter("listItemMarker");e.consume(m);e.exit("listItemMarker");r.containerState.marker=r.containerState.marker||m;return e.check(US,r.interrupt?n:d,e.attempt(Cmo,h,f))}function d(m){r.containerState.initialBlankLine=true;o++;return h(m)}function f(m){if(Fa(m)){e.enter("listItemPrefixWhitespace");e.consume(m);e.exit("listItemPrefixWhitespace");return h}return n(m)}function h(m){r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),true).length;return t(m)}}function kmo(e,t,n){const r=this;r.containerState._closeFlow=void 0;return e.check(US,i,o);function i(s){r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine;return Ra(e,t,"listItemIndent",r.containerState.size+1)(s)}function o(s){if(r.containerState.furtherBlankLines||!Fa(s)){r.containerState.furtherBlankLines=void 0;r.containerState.initialBlankLine=void 0;return a(s)}r.containerState.furtherBlankLines=void 0;r.containerState.initialBlankLine=void 0;return e.attempt(Smo,t,a)(s)}function a(s){r.containerState._closeFlow=true;r.interrupt=void 0;return Ra(e,e.attempt(o0,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function Rmo(e,t,n){const r=this;return Ra(e,i,"listItemIndent",r.containerState.size+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],true).length===r.containerState.size?t(o):n(o)}}function Pmo(e){e.exit(this.containerState.type)}function Imo(e,t,n){const r=this;return Ra(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4+1);function i(o){const a=r.events[r.events.length-1];return!Fa(o)&&a&&a[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}var o0,Cmo,Smo;var Eur=Ce(()=>{wh();vc();aFe();tbt();o0={continuation:{tokenize:kmo},exit:Pmo,name:"list",tokenize:Amo};Cmo={partial:true,tokenize:Imo};Smo={partial:true,tokenize:Rmo}});function Mmo(e,t){let n=e.length;let r;let i;let o;while(n--){if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}if(e[n][1].type==="paragraph"){i=n}}else{if(e[n][1].type==="content"){e.splice(n,1)}if(!o&&e[n][1].type==="definition"){o=n}}}const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};e[i][1].type="setextHeadingText";if(o){e.splice(i,0,["enter",a,t]);e.splice(o+1,0,["exit",e[r][1],t]);e[r][1].end={...e[o][1].end}}else{e[r][1]=a}e.push(["exit",a,t]);return e}function Lmo(e,t,n){const r=this;let i;return o;function o(u){let d=r.events.length;let f;while(d--){if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){f=r.events[d][1].type==="paragraph";break}}if(!r.parser.lazy[r.now().line]&&(r.interrupt||f)){e.enter("setextHeadingLine");i=u;return a(u)}return n(u)}function a(u){e.enter("setextHeadingLineSequence");return s(u)}function s(u){if(u===i){e.consume(u);return s}e.exit("setextHeadingLineSequence");return Fa(u)?Ra(e,l,"lineSuffix")(u):l(u)}function l(u){if(u===null||So(u)){e.exit("setextHeadingLine");return t(u)}return n(u)}}var yFe;var Cur=Ce(()=>{wh();vc();yFe={name:"setextUnderline",resolveTo:Mmo,tokenize:Lmo}});var bFe=Ce(()=>{rur();iur();aFe();our();aur();sur();cur();uur();dur();hur();pur();mur();gur();xur();vur();gFe();_ur();Tur();wur();Eur();Cur();tbt()});function Dmo(e){const t=this;const n=e.attempt(US,r,e.attempt(this.parser.constructs.flowInitial,i,Ra(e,e.attempt(this.parser.constructs.flow,i,e.attempt($0t,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}e.enter("lineEndingBlank");e.consume(o);e.exit("lineEndingBlank");t.currentConstruct=void 0;return n}function i(o){if(o===null){e.consume(o);return}e.enter("lineEnding");e.consume(o);e.exit("lineEnding");t.currentConstruct=void 0;return n}}var Sur;var Aur=Ce(()=>{bFe();wh();Sur={tokenize:Dmo}});function Iur(e){return{resolveAll:Mur(e==="text"?Fmo:void 0),tokenize:t};function t(n){const r=this;const i=this.parser.constructs[e];const o=n.attempt(i,a,s);return a;function a(d){return u(d)?o(d):s(d)}function s(d){if(d===null){n.consume(d);return}n.enter("data");n.consume(d);return l}function l(d){if(u(d)){n.exit("data");return o(d)}n.consume(d);return l}function u(d){if(d===null){return true}const f=i[d];let h=-1;if(f){while(++h{kur={resolveAll:Mur()};Rur=Iur("string");Pur=Iur("text")});var rbt={};Oo(rbt,{attentionMarkers:()=>Gmo,contentInitial:()=>Omo,disable:()=>Hmo,document:()=>Nmo,flow:()=>zmo,flowInitial:()=>Bmo,insideSpan:()=>$mo,string:()=>Umo,text:()=>Vmo});var Nmo,Omo,Bmo,zmo,Umo,Vmo,$mo,Gmo,Hmo;var Lur=Ce(()=>{bFe();nbt();Nmo={[42]:o0,[43]:o0,[45]:o0,[48]:o0,[49]:o0,[50]:o0,[51]:o0,[52]:o0,[53]:o0,[54]:o0,[55]:o0,[56]:o0,[57]:o0,[62]:sFe};Omo={[91]:q0t};Bmo={[-2]:yoe,[-1]:yoe,[32]:yoe};zmo={[35]:j0t,[42]:F8,[45]:[yFe,F8],[60]:Z0t,[61]:yFe,[95]:F8,[96]:uFe,[126]:uFe};Umo={[38]:cFe,[92]:lFe};Vmo={[-5]:xoe,[-4]:xoe,[-3]:xoe,[33]:Q0t,[38]:cFe,[42]:goe,[60]:[z0t,J0t],[91]:ebt,[92]:[X0t,lFe],[93]:D8,[95]:goe,[96]:U0t};$mo={null:[goe,kur]};Gmo={null:[42,95]};Hmo={null:[]}});function Dur(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={};const o=[];let a=[];let s=[];let l=true;const u={attempt:z(N),check:z(O),consume:P,enter:L,exit:I,interrupt:z(O,{interrupt:true})};const d={code:null,containerState:{},defineSkip:_,events:[],now:w,parser:e,previous:null,sliceSerialize:g,sliceStream:x,write:m};let f=t.tokenize.call(d,u);let h;if(t.resolveAll){o.push(t)}return d;function m($){a=wb(a,$);C();if(a[a.length-1]!==null){return[]}U(t,0);d.events=uF(o,d.events,d);return d.events}function g($,K){return Ymo(x($),K)}function x($){return Wmo(a,$)}function w(){const{_bufferIndex:$,_index:K,line:X,column:j,offset:te}=r;return{_bufferIndex:$,_index:K,line:X,column:j,offset:te}}function _($){i[$.line]=$.column;H()}function C(){let $;while(r._index-1){const s=a[0];if(typeof s==="string"){a[0]=s.slice(r)}else{a.shift()}}if(o>0){a.push(e[i].slice(0,o))}}return a}function Ymo(e,t){let n=-1;const r=[];let i;while(++n{vc();zP();moe()});function ibt(e){const t=e||{};const n=rFe([rbt,...t.extensions||[]]);const r={constructs:n,content:i(Zcr),defined:[],document:i(eur),flow:i(Sur),lazy:{},string:i(Rur),text:i(Pur)};return r;function i(o){return a;function a(s){return Dur(r,o,s)}}}var Nur=Ce(()=>{O0t();Jcr();tur();Aur();nbt();Lur();Fur()});function obt(e){while(!fFe(e)){}return e}var Our=Ce(()=>{V0t()});function abt(){let e=1;let t="";let n=true;let r;return i;function i(o,a,s){const l=[];let u;let d;let f;let h;let m;o=t+(typeof o==="string"?o.toString():new TextDecoder(a||void 0).decode(o));f=0;t="";if(n){if(o.charCodeAt(0)===65279){f++}n=void 0}while(f{Bur=/[\0\t\n\r]/g});var Uur=Ce(()=>{Nur();Our();zur()});function Vur(e){return e.replace(qmo,Xmo)}function Xmo(e,t,n){if(t){return t}const r=n.charCodeAt(0);if(r===35){const i=n.charCodeAt(1);const o=i===120||i===88;return iFe(n.slice(o?2:1),o?16:10)}return QW(n)||e}var qmo;var $ur=Ce(()=>{nFe();B0t();qmo=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi});function sbt(e,t,n){if(t&&typeof t==="object"){n=t;t=void 0}return jmo(n)(obt(ibt(n).document().write(abt()(e,t,true))))}function jmo(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(it),autolinkProtocol:z,autolinkEmail:z,atxHeading:o(yt),blockQuote:o(Ve),characterEscape:z,characterReference:z,codeFenced:o(Le),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:o(Le,a),codeText:o($e,a),codeTextData:z,data:z,codeFlowValue:z,definition:o(Ee),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:o(tt),hardBreakEscape:o(mt),hardBreakTrailing:o(mt),htmlFlow:o(ct,a),htmlFlowData:z,htmlText:o(ct,a),htmlTextData:z,image:o(Ge),label:a,link:o(it),listItem:o(He),listItemValue:h,listOrdered:o(bt,f),listUnordered:o(bt),paragraph:o(Je),reference:ue,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:o(yt),strong:o(Te),thematicBreak:o(Ze)},exit:{atxHeading:l(),atxHeadingSequence:L,autolink:l(),autolinkEmail:ge,autolinkProtocol:ve,blockQuote:l(),characterEscapeValue:U,characterReferenceMarkerHexadecimal:be,characterReferenceMarkerNumeric:be,characterReferenceValue:Ie,characterReference:he,codeFenced:l(w),codeFencedFence:x,codeFencedFenceInfo:m,codeFencedFenceMeta:g,codeFlowValue:U,codeIndented:l(_),codeText:l(X),codeTextData:U,data:U,definition:l(),definitionDestinationString:P,definitionLabelString:C,definitionTitleString:A,emphasis:l(),hardBreakEscape:l(H),hardBreakTrailing:l(H),htmlFlow:l($),htmlFlowData:U,htmlText:l(K),htmlTextData:U,image:l(te),label:oe,labelText:J,lineEnding:W,link:l(j),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:xe,resourceDestinationString:se,resourceTitleString:re,resource:ce,setextHeading:l(O),setextHeadingLineSequence:N,setextHeadingText:I,strong:l(),thematicBreak:l()}};Wur(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(Be){let qe={type:"root",children:[]};const Qe={stack:[qe],tokenStack:[],config:t,enter:s,exit:u,buffer:a,resume:d,data:n};const ze=[];let Me=-1;while(++Me0){const ye=Qe.tokenStack[Qe.tokenStack.length-1];const Ne=ye[1]||Gur;Ne.call(Qe,void 0,ye[0])}qe.position={start:dF(Be.length>0?Be[0][1].start:{line:1,column:1,offset:0}),end:dF(Be.length>0?Be[Be.length-2][1].end:{line:1,column:1,offset:0})};Me=-1;while(++Me{hoe();Uur();B0t();$ur();eY();nFe();A0t();Hur={}.hasOwnProperty});var qur=Ce(()=>{Yur()});function xFe(e){const t=this;t.parser=n;function n(r){return sbt(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}var Xur=Ce(()=>{qur()});var jur=Ce(()=>{Xur()});function lbt(e,t){const n=String(e);if(typeof t!=="string"){throw new TypeError("Expected character")}let r=0;let i=n.indexOf(t);while(i!==-1){r++;i=n.indexOf(t,i+t.length)}return r}var Kur=Ce(()=>{});function cbt(e){if(typeof e!=="string"){throw new TypeError("Expected a string")}return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var Zur=Ce(()=>{});function Zmo(e){const t=[];let n=-1;while(++n{fF=function(e){if(e===null||e===void 0){return ego}if(typeof e==="function"){return vFe(e)}if(typeof e==="object"){return Array.isArray(e)?Zmo(e):Jmo(e)}if(typeof e==="string"){return Qmo(e)}throw new Error("Expected function, string, or object as test")}});var _Fe=Ce(()=>{Jur()});function Qur(e){return"\x1B[33m"+e+"\x1B[39m"}var edr=Ce(()=>{});function voe(e,t,n,r){let i;if(typeof t==="function"&&typeof n!=="function"){r=n;n=t}else{i=t}const o=fF(i);const a=r?-1:1;s(e,void 0,[])();function s(l,u,d){const f=l&&typeof l==="object"?l:{};if(typeof f.type==="string"){const m=typeof f.tagName==="string"?f.tagName:typeof f.name==="string"?f.name:void 0;Object.defineProperty(h,"name",{value:"node ("+Qur(l.type+(m?"<"+m+">":""))+")"})}return h;function h(){let m=tdr;let g;let x;let w;if(!t||o(l,u,d[d.length-1]||void 0)){m=ngo(n(l,d));if(m[0]===N8){return m}}if("children"in l&&l.children){const _=l;if(_.children&&m[0]!==wFe){x=(r?_.children.length:-1)+a;w=d.concat(_);while(x>-1&&x<_.children.length){const C=_.children[x];g=s(C,x,w)();if(g[0]===N8){return g}x=typeof g[1]==="number"?g[1]:x+a}}}return m}}}function ngo(e){if(Array.isArray(e)){return e}if(typeof e==="number"){return[TFe,e]}return e===null||e===void 0?tdr:[e]}var tdr,TFe,N8,wFe;var ndr=Ce(()=>{_Fe();edr();tdr=[];TFe=true;N8=false;wFe="skip"});var EFe=Ce(()=>{ndr()});function ubt(e,t,n){const r=n||{};const i=fF(r.ignore||[]);const o=rgo(t);let a=-1;while(++a0?{type:"text",value:I}:void 0}if(I===false){h.lastIndex=P+1}else{if(g!==P){C.push({type:"text",value:u.value.slice(g,P)})}if(Array.isArray(I)){C.push(...I)}else if(I){C.push(I)}g=P+A[0].length;_=true}if(!h.global){break}A=h.exec(u.value)}if(_){if(g{Zur();EFe();_Fe()});var idr=Ce(()=>{rdr()});function pbt(){return{transforms:[dgo],enter:{literalAutolink:ago,literalAutolinkEmail:hbt,literalAutolinkHttp:hbt,literalAutolinkWww:hbt},exit:{literalAutolink:ugo,literalAutolinkEmail:cgo,literalAutolinkHttp:sgo,literalAutolinkWww:lgo}}}function mbt(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:dbt,notInConstruct:fbt},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:dbt,notInConstruct:fbt},{character:":",before:"[ps]",after:"\\/",inConstruct:dbt,notInConstruct:fbt}]}}function ago(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function hbt(e){this.config.enter.autolinkProtocol.call(this,e)}function sgo(e){this.config.exit.autolinkProtocol.call(this,e)}function lgo(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];Kg(t.type==="link");t.url="http://"+this.sliceSerialize(e)}function cgo(e){this.config.exit.autolinkEmail.call(this,e)}function ugo(e){this.exit(e)}function dgo(e){ubt(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,fgo],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,hgo]],{ignore:["link","linkReference"]})}function fgo(e,t,n,r,i){let o="";if(!odr(i)){return false}if(/^w/i.test(t)){n=t+n;t="";o="http://"}if(!pgo(n)){return false}const a=mgo(n+r);if(!a[0])return false;const s={type:"link",title:null,url:o+t+a[0],children:[{type:"text",value:t+a[0]}]};if(a[1]){return[s,{type:"text",value:a[1]}]}return s}function hgo(e,t,n,r){if(!odr(r,true)||/[-\d_]$/.test(n)){return false}return{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function pgo(e){const t=e.split(".");if(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2]))){return false}return true}function mgo(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t){return[e,void 0]}e=e.slice(0,t.index);let n=t[0];let r=n.indexOf(")");const i=lbt(e,"(");let o=lbt(e,")");while(r!==-1&&i>o){e+=n.slice(0,r+1);n=n.slice(r+1);r=n.indexOf(")");o++}return[e,n]}function odr(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||zS(n)||M8(n))&&(!t||n!==47)}var dbt,fbt;var adr=Ce(()=>{Kur();JW();vc();idr();dbt="phrasing";fbt=["autolink","link","image","label"]});var sdr=Ce(()=>{adr()});function ggo(){this.buffer()}function ygo(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function bgo(){this.buffer()}function xgo(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function vgo(e){const t=this.resume();const n=this.stack[this.stack.length-1];Kg(n.type==="footnoteReference");n.identifier=i0(this.sliceSerialize(e)).toLowerCase();n.label=t}function _go(e){this.exit(e)}function Tgo(e){const t=this.resume();const n=this.stack[this.stack.length-1];Kg(n.type==="footnoteDefinition");n.identifier=i0(this.sliceSerialize(e)).toLowerCase();n.label=t}function wgo(e){this.exit(e)}function Ego(){return"["}function ldr(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const a=n.enter("footnoteReference");const s=n.enter("reference");o+=i.move(n.safe(n.associationId(e),{after:"]",before:o}));s();a();o+=i.move("]");return o}function gbt(){return{enter:{gfmFootnoteCallString:ggo,gfmFootnoteCall:ygo,gfmFootnoteDefinitionLabelString:bgo,gfmFootnoteDefinition:xgo},exit:{gfmFootnoteCallString:vgo,gfmFootnoteCall:_go,gfmFootnoteDefinitionLabelString:Tgo,gfmFootnoteDefinition:wgo}}}function ybt(e){let t=false;if(e&&e.firstLineBlank){t=true}return{handlers:{footnoteDefinition:n,footnoteReference:ldr},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,a){const s=o.createTracker(a);let l=s.move("[^");const u=o.enter("footnoteDefinition");const d=o.enter("label");l+=s.move(o.safe(o.associationId(r),{before:l,after:"]"}));d();l+=s.move("]:");if(r.children&&r.children.length>0){s.shift(4);l+=s.move((t?"\n":" ")+o.indentLines(o.containerFlow(r,s.current()),t?cdr:Cgo))}u();return l}}function Cgo(e,t,n){return t===0?e:cdr(e,t,n)}function cdr(e,t,n){return(n?"":" ")+e}var udr=Ce(()=>{JW();eY();ldr.peek=Ego});var ddr=Ce(()=>{udr()});function bbt(){return{canContainEols:["delete"],enter:{strikethrough:Ago},exit:{strikethrough:kgo}}}function xbt(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Sgo}],handlers:{delete:fdr}}}function Ago(e){this.enter({type:"delete",children:[]},e)}function kgo(e){this.exit(e)}function fdr(e,t,n,r){const i=n.createTracker(r);const o=n.enter("strikethrough");let a=i.move("~~");a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"});a+=i.move("~~");o();return a}function Rgo(){return"~"}var Sgo;var hdr=Ce(()=>{Sgo=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];fdr.peek=Rgo});var pdr=Ce(()=>{hdr()});function Pgo(e){return e.length}function gdr(e,t){const n=t||{};const r=(n.align||[]).concat();const i=n.stringLength||Pgo;const o=[];const a=[];const s=[];const l=[];let u=0;let d=-1;while(++du){u=e[d].length}while(++_l[_]){l[_]=A}}x.push(C)}a[d]=x;s[d]=w}let f=-1;if(typeof r==="object"&&"length"in r){while(++fl[f]){l[f]=C}m[f]=C}h[f]=A}a.splice(1,0,h);s.splice(1,0,m);d=-1;const g=[];while(++d{});function bdr(e,t,n,r){const i=n.enter("blockquote");const o=n.createTracker(r);o.move("> ");o.shift(2);const a=n.indentLines(n.containerFlow(e,o.current()),Mgo);i();return a}function Mgo(e,t,n){return">"+(n?"":" ")+e}var xdr=Ce(()=>{});function _dr(e,t){return vdr(e,t.inConstruct,true)&&!vdr(e,t.notInConstruct,false)}function vdr(e,t,n){if(typeof t==="string"){t=[t]}if(!t||t.length===0){return n}let r=-1;while(++r{});function vbt(e,t,n,r){let i=-1;while(++i{Tdr()});function Edr(e,t){const n=String(e);let r=n.indexOf(t);let i=r;let o=0;let a=0;if(typeof t!=="string"){throw new TypeError("Expected substring")}while(r!==-1){if(r===i){if(++o>a){a=o}}else{o=1}i=r+t.length;r=n.indexOf(t,i)}return a}var Cdr=Ce(()=>{});function Sdr(e,t){return Boolean(t.options.fences===false&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}var Adr=Ce(()=>{});function kdr(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~"){throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`")}return t}var Rdr=Ce(()=>{});function Pdr(e,t,n,r){const i=kdr(n);const o=e.value||"";const a=i==="`"?"GraveAccent":"Tilde";if(Sdr(e,n)){const f=n.enter("codeIndented");const h=n.indentLines(o,Lgo);f();return h}const s=n.createTracker(r);const l=i.repeat(Math.max(Edr(o,i)+1,3));const u=n.enter("codeFenced");let d=s.move(l);if(e.lang){const f=n.enter(`codeFencedLang${a}`);d+=s.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...s.current()}));f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${a}`);d+=s.move(" ");d+=s.move(n.safe(e.meta,{before:d,after:"\n",encode:["`"],...s.current()}));f()}d+=s.move("\n");if(o){d+=s.move(o+"\n")}d+=s.move(l);u();return d}function Lgo(e,t,n){return(n?"":" ")+e}var Idr=Ce(()=>{Cdr();Adr();Rdr()});function tY(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'"){throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`")}return t}var CFe=Ce(()=>{});function Mdr(e,t,n,r){const i=tY(n);const o=i==='"'?"Quote":"Apostrophe";const a=n.enter("definition");let s=n.enter("label");const l=n.createTracker(r);let u=l.move("[");u+=l.move(n.safe(n.associationId(e),{before:u,after:"]",...l.current()}));u+=l.move("]: ");s();if(!e.url||/[\0- \u007F]/.test(e.url)){s=n.enter("destinationLiteral");u+=l.move("<");u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()}));u+=l.move(">")}else{s=n.enter("destinationRaw");u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":"\n",...l.current()}))}s();if(e.title){s=n.enter(`title${o}`);u+=l.move(" "+i);u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()}));u+=l.move(i);s()}a();return u}var Ldr=Ce(()=>{CFe()});function Ddr(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_"){throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`")}return t}var Fdr=Ce(()=>{});function hF(e){return"&#x"+e.toString(16).toUpperCase()+";"}var SFe=Ce(()=>{});function nY(e,t,n){const r=UP(e);const i=UP(t);if(r===void 0){return i===void 0?n==="_"?{inside:true,outside:true}:{inside:false,outside:false}:i===1?{inside:true,outside:true}:{inside:false,outside:true}}if(r===1){return i===void 0?{inside:false,outside:false}:i===1?{inside:true,outside:true}:{inside:false,outside:false}}return i===void 0?{inside:false,outside:false}:i===1?{inside:true,outside:false}:{inside:false,outside:false}}var _bt=Ce(()=>{oFe()});function Tbt(e,t,n,r){const i=Ddr(n);const o=n.enter("emphasis");const a=n.createTracker(r);const s=a.move(i);let l=a.move(n.containerPhrasing(e,{after:i,before:s,...a.current()}));const u=l.charCodeAt(0);const d=nY(r.before.charCodeAt(r.before.length-1),u,i);if(d.inside){l=hF(u)+l.slice(1)}const f=l.charCodeAt(l.length-1);const h=nY(r.after.charCodeAt(0),f,i);if(h.inside){l=l.slice(0,-1)+hF(f)}const m=a.move(i);o();n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside};return s+l+m}function Dgo(e,t,n){return n.options.emphasis||"*"}var Ndr=Ce(()=>{Fdr();SFe();_bt();Tbt.peek=Dgo});function wbt(e,t,n,r){let i;let o;let a;if(typeof t==="function"&&typeof n!=="function"){o=void 0;a=t;i=n}else{o=t;a=n;i=r}voe(e,o,s,i);function s(l,u){const d=u[u.length-1];const f=d?d.children.indexOf(l):void 0;return a(l,f,d)}}var Odr=Ce(()=>{EFe();EFe()});var Bdr=Ce(()=>{Odr()});function zdr(e,t){let n=false;wbt(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break"){n=true;return N8}});return Boolean((!e.depth||e.depth<3)&&BP(e)&&(t.options.setext||n))}var Udr=Ce(()=>{Bdr();hoe()});function Vdr(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1);const o=n.createTracker(r);if(zdr(e,n)){const d=n.enter("headingSetext");const f=n.enter("phrasing");const h=n.containerPhrasing(e,{...o.current(),before:"\n",after:"\n"});f();d();return h+"\n"+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf("\n"))+1))}const a="#".repeat(i);const s=n.enter("headingAtx");const l=n.enter("phrasing");o.move(a+" ");let u=n.containerPhrasing(e,{before:"# ",after:"\n",...o.current()});if(/^[\t ]/.test(u)){u=hF(u.charCodeAt(0))+u.slice(1)}u=u?a+" "+u:a;if(n.options.closeAtx){u+=" "+a}l();s();return u}var $dr=Ce(()=>{SFe();Udr()});function Ebt(e){return e.value||""}function Fgo(){return"<"}var Gdr=Ce(()=>{Ebt.peek=Fgo});function Cbt(e,t,n,r){const i=tY(n);const o=i==='"'?"Quote":"Apostrophe";const a=n.enter("image");let s=n.enter("label");const l=n.createTracker(r);let u=l.move("![");u+=l.move(n.safe(e.alt,{before:u,after:"]",...l.current()}));u+=l.move("](");s();if(!e.url&&e.title||/[\0- \u007F]/.test(e.url)){s=n.enter("destinationLiteral");u+=l.move("<");u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()}));u+=l.move(">")}else{s=n.enter("destinationRaw");u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))}s();if(e.title){s=n.enter(`title${o}`);u+=l.move(" "+i);u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()}));u+=l.move(i);s()}u+=l.move(")");a();return u}function Ngo(){return"!"}var Hdr=Ce(()=>{CFe();Cbt.peek=Ngo});function Sbt(e,t,n,r){const i=e.referenceType;const o=n.enter("imageReference");let a=n.enter("label");const s=n.createTracker(r);let l=s.move("![");const u=n.safe(e.alt,{before:l,after:"]",...s.current()});l+=s.move(u+"][");a();const d=n.stack;n.stack=[];a=n.enter("reference");const f=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});a();n.stack=d;o();if(i==="full"||!u||u!==f){l+=s.move(f+"]")}else if(i==="shortcut"){l=l.slice(0,-1)}else{l+=s.move("]")}return l}function Ogo(){return"!"}var Wdr=Ce(()=>{Sbt.peek=Ogo});function Abt(e,t,n){let r=e.value||"";let i="`";let o=-1;while(new RegExp("(^|[^`])"+i+"([^`]|$)").test(r)){i+="`"}if(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))){r=" "+r+" "}while(++o{Abt.peek=Bgo});function kbt(e,t){const n=BP(e);return Boolean(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}var qdr=Ce(()=>{hoe()});function Rbt(e,t,n,r){const i=tY(n);const o=i==='"'?"Quote":"Apostrophe";const a=n.createTracker(r);let s;let l;if(kbt(e,n)){const d=n.stack;n.stack=[];s=n.enter("autolink");let f=a.move("<");f+=a.move(n.containerPhrasing(e,{before:f,after:">",...a.current()}));f+=a.move(">");s();n.stack=d;return f}s=n.enter("link");l=n.enter("label");let u=a.move("[");u+=a.move(n.containerPhrasing(e,{before:u,after:"](",...a.current()}));u+=a.move("](");l();if(!e.url&&e.title||/[\0- \u007F]/.test(e.url)){l=n.enter("destinationLiteral");u+=a.move("<");u+=a.move(n.safe(e.url,{before:u,after:">",...a.current()}));u+=a.move(">")}else{l=n.enter("destinationRaw");u+=a.move(n.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))}l();if(e.title){l=n.enter(`title${o}`);u+=a.move(" "+i);u+=a.move(n.safe(e.title,{before:u,after:i,...a.current()}));u+=a.move(i);l()}u+=a.move(")");s();return u}function zgo(e,t,n){return kbt(e,n)?"<":"["}var Xdr=Ce(()=>{CFe();qdr();Rbt.peek=zgo});function Pbt(e,t,n,r){const i=e.referenceType;const o=n.enter("linkReference");let a=n.enter("label");const s=n.createTracker(r);let l=s.move("[");const u=n.containerPhrasing(e,{before:l,after:"]",...s.current()});l+=s.move(u+"][");a();const d=n.stack;n.stack=[];a=n.enter("reference");const f=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});a();n.stack=d;o();if(i==="full"||!u||u!==f){l+=s.move(f+"]")}else if(i==="shortcut"){l=l.slice(0,-1)}else{l+=s.move("]")}return l}function Ugo(){return"["}var jdr=Ce(()=>{Pbt.peek=Ugo});function rY(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-"){throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`")}return t}var AFe=Ce(()=>{});function Kdr(e){const t=rY(e);const n=e.options.bulletOther;if(!n){return t==="*"?"-":"*"}if(n!=="*"&&n!=="+"&&n!=="-"){throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`")}if(n===t){throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different")}return n}var Zdr=Ce(()=>{AFe()});function Jdr(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")"){throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`")}return t}var Qdr=Ce(()=>{});function kFe(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_"){throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`")}return t}var Ibt=Ce(()=>{});function efr(e,t,n,r){const i=n.enter("list");const o=n.bulletCurrent;let a=e.ordered?Jdr(n):rY(n);const s=e.ordered?a==="."?")":".":Kdr(n);let l=t&&n.bulletLastUsed?a===n.bulletLastUsed:false;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0){l=true}if(kFe(n)===a&&d){let f=-1;while(++f{AFe();Zdr();Qdr();Ibt()});function nfr(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed"){throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`")}return t}var rfr=Ce(()=>{});function ifr(e,t,n,r){const i=nfr(n);let o=n.bulletCurrent||rY(n);if(t&&t.type==="list"&&t.ordered){o=(typeof t.start==="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===false?0:t.children.indexOf(e))+o}let a=o.length+1;if(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread)){a=Math.ceil(a/4)*4}const s=n.createTracker(r);s.move(o+" ".repeat(a-o.length));s.shift(a);const l=n.enter("listItem");const u=n.indentLines(n.containerFlow(e,s.current()),d);l();return u;function d(f,h,m){if(h){return(m?"":" ".repeat(a))+f}return(m?o:o+" ".repeat(a-o.length))+f}}var ofr=Ce(()=>{AFe();rfr()});function afr(e,t,n,r){const i=n.enter("paragraph");const o=n.enter("phrasing");const a=n.containerPhrasing(e,r);o();i();return a}var sfr=Ce(()=>{});var Mbt;var lfr=Ce(()=>{_Fe();Mbt=fF(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"])});var cfr=Ce(()=>{lfr()});function ufr(e,t,n,r){const i=e.children.some(function(a){return Mbt(a)});const o=i?n.containerPhrasing:n.containerFlow;return o.call(n,e,r)}var dfr=Ce(()=>{cfr()});function ffr(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_"){throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`")}return t}var hfr=Ce(()=>{});function Lbt(e,t,n,r){const i=ffr(n);const o=n.enter("strong");const a=n.createTracker(r);const s=a.move(i+i);let l=a.move(n.containerPhrasing(e,{after:i,before:s,...a.current()}));const u=l.charCodeAt(0);const d=nY(r.before.charCodeAt(r.before.length-1),u,i);if(d.inside){l=hF(u)+l.slice(1)}const f=l.charCodeAt(l.length-1);const h=nY(r.after.charCodeAt(0),f,i);if(h.inside){l=l.slice(0,-1)+hF(f)}const m=a.move(i+i);o();n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside};return s+l+m}function Vgo(e,t,n){return n.options.strong||"*"}var pfr=Ce(()=>{hfr();SFe();_bt();Lbt.peek=Vgo});function mfr(e,t,n,r){return n.safe(e.value,r)}var gfr=Ce(()=>{});function yfr(e){const t=e.options.ruleRepetition||3;if(t<3){throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more")}return t}var bfr=Ce(()=>{});function xfr(e,t,n){const r=(kFe(n)+(n.options.ruleSpaces?" ":"")).repeat(yfr(n));return n.options.ruleSpaces?r.slice(0,-1):r}var vfr=Ce(()=>{bfr();Ibt()});var _oe;var _fr=Ce(()=>{xdr();wdr();Idr();Ldr();Ndr();$dr();Gdr();Hdr();Wdr();Ydr();Xdr();jdr();tfr();ofr();sfr();dfr();pfr();gfr();vfr();_oe={blockquote:bdr,break:vbt,code:Pdr,definition:Mdr,emphasis:Tbt,hardBreak:vbt,heading:Vdr,html:Ebt,image:Cbt,imageReference:Sbt,inlineCode:Abt,link:Rbt,linkReference:Pbt,list:efr,listItem:ifr,paragraph:afr,root:ufr,strong:Lbt,text:mfr,thematicBreak:xfr}});var Dbt=Ce(()=>{_fr()});function Nbt(){return{enter:{table:$go,tableData:Tfr,tableHeader:Tfr,tableRow:Hgo},exit:{codeText:Wgo,table:Ggo,tableData:Fbt,tableHeader:Fbt,tableRow:Fbt}}}function $go(e){const t=e._align;Kg(t,"expected `_align` on table");this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e);this.data.inTable=true}function Ggo(e){this.exit(e);this.data.inTable=void 0}function Hgo(e){this.enter({type:"tableRow",children:[]},e)}function Fbt(e){this.exit(e)}function Tfr(e){this.enter({type:"tableCell",children:[]},e)}function Wgo(e){let t=this.resume();if(this.data.inTable){t=t.replace(/\\([\\|])/g,Ygo)}const n=this.stack[this.stack.length-1];Kg(n.type==="inlineCode");n.value=t;this.exit(e)}function Ygo(e,t){return t==="|"?t:e}function Obt(e){const t=e||{};const n=t.tableCellPadding;const r=t.tablePipeAlign;const i=t.stringLength;const o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:true,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:true,character:":",after:"-"},{atBreak:true,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:a,tableCell:l,tableRow:s}};function a(m,g,x,w){return u(d(m,x,w),m.align)}function s(m,g,x,w){const _=f(m,x,w);const C=u([_]);return C.slice(0,C.indexOf("\n"))}function l(m,g,x,w){const _=x.enter("tableCell");const C=x.enter("phrasing");const A=x.containerPhrasing(m,{...w,before:o,after:o});C();_();return A}function u(m,g){return gdr(m,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function d(m,g,x){const w=m.children;let _=-1;const C=[];const A=g.enter("table");while(++_{JW();ydr();Dbt()});var Efr=Ce(()=>{wfr()});function Bbt(){return{exit:{taskListCheckValueChecked:Cfr,taskListCheckValueUnchecked:Cfr,paragraph:qgo}}}function zbt(){return{unsafe:[{atBreak:true,character:"-",after:"[:|-]"}],handlers:{listItem:Xgo}}}function Cfr(e){const t=this.stack[this.stack.length-2];Kg(t.type==="listItem");t.checked=e.type==="taskListCheckValueChecked"}function qgo(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked==="boolean"){const n=this.stack[this.stack.length-1];Kg(n.type==="paragraph");const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1;let a;while(++o{JW();Dbt()});var Afr=Ce(()=>{Sfr()});function Ubt(){return[pbt(),gbt(),bbt(),Nbt(),Bbt()]}function Vbt(e){return{extensions:[mbt(),ybt(e),xbt(),Obt(e),zbt()]}}var kfr=Ce(()=>{sdr();ddr();pdr();Efr();Afr()});var Rfr=Ce(()=>{kfr()});function Gbt(){return{text:VS}}function Zgo(e,t,n){const r=this;let i;let o;return a;function a(f){if(!$bt(f)||!Ofr.call(r,r.previous)||Hbt(r.events)){return n(f)}e.enter("literalAutolink");e.enter("literalAutolinkEmail");return s(f)}function s(f){if($bt(f)){e.consume(f);return s}if(f===64){e.consume(f);return l}return n(f)}function l(f){if(f===46){return e.check(Kgo,d,u)(f)}if(f===45||f===95||Zp(f)){o=true;e.consume(f);return l}return d(f)}function u(f){e.consume(f);i=true;return l}function d(f){if(o&&i&&Kp(r.previous)){e.exit("literalAutolinkEmail");e.exit("literalAutolink");return t(f)}return n(f)}}function Jgo(e,t,n){const r=this;return i;function i(a){if(a!==87&&a!==119||!Ffr.call(r,r.previous)||Hbt(r.events)){return n(a)}e.enter("literalAutolink");e.enter("literalAutolinkWww");return e.check(jgo,e.attempt(Pfr,e.attempt(Ifr,o),n),n)(a)}function o(a){e.exit("literalAutolinkWww");e.exit("literalAutolink");return t(a)}}function Qgo(e,t,n){const r=this;let i="";let o=false;return a;function a(f){if((f===72||f===104)&&Nfr.call(r,r.previous)&&!Hbt(r.events)){e.enter("literalAutolink");e.enter("literalAutolinkHttp");i+=String.fromCodePoint(f);e.consume(f);return s}return n(f)}function s(f){if(Kp(f)&&i.length<5){i+=String.fromCodePoint(f);e.consume(f);return s}if(f===58){const h=i.toLowerCase();if(h==="http"||h==="https"){e.consume(f);return l}}return n(f)}function l(f){if(f===47){e.consume(f);if(o){return u}o=true;return l}return n(f)}function u(f){return f===null||I8(f)||Al(f)||zS(f)||M8(f)?n(f):e.attempt(Pfr,e.attempt(Ifr,d),n)(f)}function d(f){e.exit("literalAutolinkHttp");e.exit("literalAutolink");return t(f)}}function eyo(e,t,n){let r=0;return i;function i(a){if((a===87||a===119)&&r<3){r++;e.consume(a);return i}if(a===46&&r===3){e.consume(a);return o}return n(a)}function o(a){return a===null?n(a):t(a)}}function tyo(e,t,n){let r;let i;let o;return a;function a(u){if(u===46||u===95){return e.check(Mfr,l,s)(u)}if(u===null||Al(u)||zS(u)||u!==45&&M8(u)){return l(u)}o=true;e.consume(u);return a}function s(u){if(u===95){r=true}else{i=r;r=void 0}e.consume(u);return a}function l(u){if(i||r||!o){return n(u)}return t(u)}}function nyo(e,t){let n=0;let r=0;return i;function i(a){if(a===40){n++;e.consume(a);return i}if(a===41&&r0&&!n){e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=true}return n}var jgo,Pfr,Ifr,Mfr,Kgo,Lfr,Dfr,VP,VS,O8;var Bfr=Ce(()=>{vc();jgo={tokenize:eyo,partial:true};Pfr={tokenize:tyo,partial:true};Ifr={tokenize:nyo,partial:true};Mfr={tokenize:ryo,partial:true};Kgo={tokenize:iyo,partial:true};Lfr={name:"wwwAutolink",tokenize:Jgo,previous:Ffr};Dfr={name:"protocolAutolink",tokenize:Qgo,previous:Nfr};VP={name:"emailAutolink",tokenize:Zgo,previous:Ofr};VS={};O8=48;while(O8<123){VS[O8]=VP;O8++;if(O8===58)O8=65;else if(O8===91)O8=97}VS[43]=VP;VS[45]=VP;VS[46]=VP;VS[95]=VP;VS[72]=[VP,Dfr];VS[104]=[VP,Dfr];VS[87]=[VP,Lfr];VS[119]=[VP,Lfr]});var zfr=Ce(()=>{Bfr()});function Wbt(){return{document:{[91]:{name:"gfmFootnoteDefinition",tokenize:cyo,continuation:{tokenize:uyo},exit:dyo}},text:{[91]:{name:"gfmFootnoteCall",tokenize:lyo},[93]:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:ayo,resolveTo:syo}}}}function ayo(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;while(i--){const l=r.events[i][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link"){break}}return s;function s(l){if(!a||!a._balanced){return n(l)}const u=i0(r.sliceSerialize({start:a.end,end:r.now()}));if(u.codePointAt(0)!==94||!o.includes(u.slice(1))){return n(l)}e.enter("gfmFootnoteCallLabelMarker");e.consume(l);e.exit("gfmFootnoteCallLabelMarker");return t(l)}}function syo(e,t){let n=e.length;let r;while(n--){if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){r=e[n][1];break}}e[n+1][1].type="data";e[n+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)};const o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++;o.end.offset++;o.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)};const s={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)};const l=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",a,t],["enter",s,t],["exit",s,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",i,t]];e.splice(n,e.length-n+1,...l);return e}function lyo(e,t,n){const r=this;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0;let a;return s;function s(f){e.enter("gfmFootnoteCall");e.enter("gfmFootnoteCallLabelMarker");e.consume(f);e.exit("gfmFootnoteCallLabelMarker");return l}function l(f){if(f!==94)return n(f);e.enter("gfmFootnoteCallMarker");e.consume(f);e.exit("gfmFootnoteCallMarker");e.enter("gfmFootnoteCallString");e.enter("chunkString").contentType="string";return u}function u(f){if(o>999||f===93&&!a||f===null||f===91||Al(f)){return n(f)}if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");if(!i.includes(i0(r.sliceSerialize(h)))){return n(f)}e.enter("gfmFootnoteCallLabelMarker");e.consume(f);e.exit("gfmFootnoteCallLabelMarker");e.exit("gfmFootnoteCall");return t}if(!Al(f)){a=true}o++;e.consume(f);return f===92?d:u}function d(f){if(f===91||f===92||f===93){e.consume(f);o++;return u}return u(f)}}function cyo(e,t,n){const r=this;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;let a=0;let s;return l;function l(g){e.enter("gfmFootnoteDefinition")._container=true;e.enter("gfmFootnoteDefinitionLabel");e.enter("gfmFootnoteDefinitionLabelMarker");e.consume(g);e.exit("gfmFootnoteDefinitionLabelMarker");return u}function u(g){if(g===94){e.enter("gfmFootnoteDefinitionMarker");e.consume(g);e.exit("gfmFootnoteDefinitionMarker");e.enter("gfmFootnoteDefinitionLabelString");e.enter("chunkString").contentType="string";return d}return n(g)}function d(g){if(a>999||g===93&&!s||g===null||g===91||Al(g)){return n(g)}if(g===93){e.exit("chunkString");const x=e.exit("gfmFootnoteDefinitionLabelString");o=i0(r.sliceSerialize(x));e.enter("gfmFootnoteDefinitionLabelMarker");e.consume(g);e.exit("gfmFootnoteDefinitionLabelMarker");e.exit("gfmFootnoteDefinitionLabel");return h}if(!Al(g)){s=true}a++;e.consume(g);return g===92?f:d}function f(g){if(g===91||g===92||g===93){e.consume(g);a++;return d}return d(g)}function h(g){if(g===58){e.enter("definitionMarker");e.consume(g);e.exit("definitionMarker");if(!i.includes(o)){i.push(o)}return Ra(e,m,"gfmFootnoteDefinitionWhitespace")}return n(g)}function m(g){return t(g)}}function uyo(e,t,n){return e.check(US,t,e.attempt(oyo,t,n))}function dyo(e){e.exit("gfmFootnoteDefinition")}function fyo(e,t,n){const r=this;return Ra(e,i,"gfmFootnoteDefinitionIndent",4+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],true).length===4?t(o):n(o)}}var oyo;var Ufr=Ce(()=>{bFe();wh();vc();eY();oyo={tokenize:fyo,partial:true}});var Vfr=Ce(()=>{Ufr()});function Ybt(e){const t=e||{};let n=t.singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};if(n===null||n===void 0){n=true}return{text:{[126]:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,s){let l=-1;while(++l1)return l(g);a.consume(g);f++;return m}if(f<2&&!n)return l(g);const w=a.exit("strikethroughSequenceTemporary");const _=UP(g);w._open=!_||_===2&&Boolean(x);w._close=!x||x===2&&Boolean(_);return s(g)}}}var $fr=Ce(()=>{zP();oFe();moe()});var Gfr=Ce(()=>{$fr()});function hyo(e,t,n,r){let i=0;if(n===0&&r.length===0){return}while(i{RFe=class{constructor(){this.map=[]}add(t,n,r){hyo(this,t,n,r)}consume(t){this.map.sort(function(o,a){return o[0]-a[0]});if(this.map.length===0){return}let n=this.map.length;const r=[];while(n>0){n-=1;r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]);t.length=this.map[n][0]}r.push(t.slice());t.length=0;let i=r.pop();while(i){for(const o of i){t.push(o)}i=r.pop()}this.map.length=0}}});function Wfr(e,t){let n=false;const r=[];while(t{});function qbt(){return{flow:{null:{name:"table",tokenize:pyo,resolveAll:myo}}}}function pyo(e,t,n){const r=this;let i=0;let o=0;let a;return s;function s(U){let W=r.events.length-1;while(W>-1){const K=r.events[W][1].type;if(K==="lineEnding"||K==="linePrefix")W--;else break}const H=W>-1?r.events[W][1].type:null;const $=H==="tableHead"||H==="tableRow"?I:l;if($===I&&r.parser.lazy[r.now().line]){return n(U)}return $(U)}function l(U){e.enter("tableHead");e.enter("tableRow");return u(U)}function u(U){if(U===124){return d(U)}a=true;o+=1;return d(U)}function d(U){if(U===null){return n(U)}if(So(U)){if(o>1){o=0;r.interrupt=true;e.exit("tableRow");e.enter("lineEnding");e.consume(U);e.exit("lineEnding");return m}return n(U)}if(Fa(U)){return Ra(e,d,"whitespace")(U)}o+=1;if(a){a=false;i+=1}if(U===124){e.enter("tableCellDivider");e.consume(U);e.exit("tableCellDivider");a=true;return d}e.enter("data");return f(U)}function f(U){if(U===null||U===124||Al(U)){e.exit("data");return d(U)}e.consume(U);return U===92?h:f}function h(U){if(U===92||U===124){e.consume(U);return f}return f(U)}function m(U){r.interrupt=false;if(r.parser.lazy[r.now().line]){return n(U)}e.enter("tableDelimiterRow");a=false;if(Fa(U)){return Ra(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U)}return g(U)}function g(U){if(U===45||U===58){return w(U)}if(U===124){a=true;e.enter("tableCellDivider");e.consume(U);e.exit("tableCellDivider");return x}return L(U)}function x(U){if(Fa(U)){return Ra(e,w,"whitespace")(U)}return w(U)}function w(U){if(U===58){o+=1;a=true;e.enter("tableDelimiterMarker");e.consume(U);e.exit("tableDelimiterMarker");return _}if(U===45){o+=1;return _(U)}if(U===null||So(U)){return P(U)}return L(U)}function _(U){if(U===45){e.enter("tableDelimiterFiller");return C(U)}return L(U)}function C(U){if(U===45){e.consume(U);return C}if(U===58){a=true;e.exit("tableDelimiterFiller");e.enter("tableDelimiterMarker");e.consume(U);e.exit("tableDelimiterMarker");return A}e.exit("tableDelimiterFiller");return A(U)}function A(U){if(Fa(U)){return Ra(e,P,"whitespace")(U)}return P(U)}function P(U){if(U===124){return g(U)}if(U===null||So(U)){if(!a||i!==o){return L(U)}e.exit("tableDelimiterRow");e.exit("tableHead");return t(U)}return L(U)}function L(U){return n(U)}function I(U){e.enter("tableRow");return N(U)}function N(U){if(U===124){e.enter("tableCellDivider");e.consume(U);e.exit("tableCellDivider");return N}if(U===null||So(U)){e.exit("tableRow");return t(U)}if(Fa(U)){return Ra(e,N,"whitespace")(U)}e.enter("data");return O(U)}function O(U){if(U===null||U===124||Al(U)){e.exit("data");return N(U)}e.consume(U);return U===92?z:O}function z(U){if(U===92||U===124){e.consume(U);return O}return O(U)}}function myo(e,t){let n=-1;let r=true;let i=0;let o=[0,0,0,0];let a=[0,0,0,0];let s=false;let l=0;let u;let d;let f;const h=new RFe;while(++nn[2]+1){const g=n[2]+1;const x=n[3]-n[2]-1;e.add(g,x,[])}}e.add(n[3]+1,0,[["exit",f,t]])}if(i!==void 0){o.end=Object.assign({},iY(t.events,i));e.add(i,0,[["exit",o,t]]);o=void 0}return o}function qfr(e,t,n,r,i){const o=[];const a=iY(t.events,n);if(i){i.end=Object.assign({},a);o.push(["exit",i,t])}r.end=Object.assign({},a);o.push(["exit",r,t]);e.add(n+1,0,o)}function iY(e,t){const n=e[t];const r=n[0]==="enter"?"start":"end";return n[1][r]}var Xfr=Ce(()=>{wh();vc();Hfr();Yfr()});var jfr=Ce(()=>{Xfr()});function Xbt(){return{text:{[91]:gyo}}}function yyo(e,t,n){const r=this;return i;function i(l){if(r.previous!==null||!r._gfmTasklistFirstContentOfListItem){return n(l)}e.enter("taskListCheck");e.enter("taskListCheckMarker");e.consume(l);e.exit("taskListCheckMarker");return o}function o(l){if(Al(l)){e.enter("taskListCheckValueUnchecked");e.consume(l);e.exit("taskListCheckValueUnchecked");return a}if(l===88||l===120){e.enter("taskListCheckValueChecked");e.consume(l);e.exit("taskListCheckValueChecked");return a}return n(l)}function a(l){if(l===93){e.enter("taskListCheckMarker");e.consume(l);e.exit("taskListCheckMarker");e.exit("taskListCheck");return s}return n(l)}function s(l){if(So(l)){return t(l)}if(Fa(l)){return e.check({tokenize:byo},t,n)(l)}return n(l)}}function byo(e,t,n){return Ra(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}var gyo;var Kfr=Ce(()=>{wh();vc();gyo={name:"tasklistCheck",tokenize:yyo}});var Zfr=Ce(()=>{Kfr()});function Jfr(e){return rFe([Gbt(),Wbt(),Ybt(e),qbt(),Xbt()])}var Qfr=Ce(()=>{O0t();zfr();Vfr();Gfr();jfr();Zfr()});function IFe(e){const t=this;const n=e||xyo;const r=t.data();const i=r.micromarkExtensions||(r.micromarkExtensions=[]);const o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]);const a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(Jfr(n));o.push(Ubt());a.push(Vbt(n))}var xyo;var ehr=Ce(()=>{Rfr();Qfr();xyo={}});var thr=Ce(()=>{ehr()});var ihr={};Oo(ihr,{buildTableValuesFromMarkdown:()=>Pyo,sanitizeSheetName:()=>Syo});function Syo(e){const t=(e??nhr).trim();const n=t.replace(_yo,"").trim()||nhr;return n.slice(0,vyo)}function Ayo(e){return e.replace(Tyo,rhr)}function kyo(e){return e.replace(/\u00a0/g," ").replaceAll(rhr,"\n").replace(Eyo,"").replace(wyo,"").replace(/\r/g,"").replace(/[ \t]+\n/g,"\n").replace(/\n[ \t]+/g,"\n").trim()}function Ryo(e){const t=Cyo.parse(Ayo(e));const n=t.children.find(i=>i.type==="table");if(!n){throw new Error("Unable to build workbook: no markdown table rows found.")}const r=[];for(const i of n.children){const o=i.children.map(a=>kyo(BP(a)));if(o.every(a=>a.length===0)){continue}r.push(o)}return r}function Pyo(e){return Ryo(e)}var nhr,vyo,_yo,Tyo,rhr,wyo,Eyo,Cyo;var ohr=Ce(()=>{$cr();jur();thr();hoe();nhr="Markdown table";vyo=31;_yo=/\\|\/|\?|\*|\[|\]|:/g;Tyo=//gi;rhr="BPS_TABLE_BR_PLACEHOLDER";wyo=/:{1,3}contentReference\[[^\]]+\](?:\{[^}]*\})?/g;Eyo=/\u200b/g;Cyo=F0t().use(xFe).use(IFe)});var lhr={};Oo(lhr,{planCsvImport:()=>Lyo,sanitizeSheetName:()=>shr});function shr(e){const t=(e??ahr).trim();const n=t.replace(Myo,"").trim()||ahr;return n.slice(0,Iyo)}function Lyo(e,t){const n=Dyo(t?.separator);const r=Pl(t?.anchor??"A1");const i=r.sheetName?.trim();const o=t?.sheetName?.trim();if(i&&o&&i!==o){throw new Error(`CSV import specifies conflicting sheet names: "${o}" (options.sheetName) vs "${i}" (anchor).`)}const a=shr(i??o);const s=fi(r.ref);if(!s){throw new Error(`CSV import anchor must be an A1 cell reference; received "${t?.anchor??"A1"}".`)}const{bounds:l}=s;if(l.startRow!==l.endRow||l.startCol!==l.endCol){throw new Error(`CSV import anchor must be a single cell reference; received "${t?.anchor??"A1"}".`)}const u=Fyo(e,n);const d=u.length;const f=d>0?u[0]?.length??0:0;if(d===0||f===0){return{sheetName:a,values:[]}}const h={startRow:l.startRow,startCol:l.startCol,endRow:l.startRow+d-1,endCol:l.startCol+f-1};return{sheetName:a,values:u,rangeRef:Io(h),rect:{r1:h.startRow,c1:h.startCol,r2:h.endRow,c2:h.endCol}}}function Dyo(e){const t=e??",";if(t.length!==1){throw new Error(`CSV import separator must be a single character; received "${t}".`)}return t}function Fyo(e,t){const n=e.trim();if(!n){return[]}const r=Nyo(e,t);if(r.length===0){return[]}const i=r.reduce((o,a)=>Math.max(o,a.length),0);if(i===0){return[]}return r.map(o=>{if(o.length===i)return o;const a=o.slice();while(a.length{r.push(i);i=""};const s=()=>{n.push(r);r=[]};for(let l=0;l0){const l=n[n.length-1]??[];const u=l.length>0&&l.every(d=>d==="");if(!u)break;n.pop()}return n}var ahr,Iyo,Myo;var chr=Ce(()=>{bs();ahr="CSV import";Iyo=31;Myo=/\\|\/|\?|\*|\[|\]|:/g});var ac=_r(Zg=>{"use strict";var jxt=Symbol.for("yaml.alias");var nmr=Symbol.for("yaml.document");var h4e=Symbol.for("yaml.map");var rmr=Symbol.for("yaml.pair");var Kxt=Symbol.for("yaml.scalar");var p4e=Symbol.for("yaml.seq");var GP=Symbol.for("yaml.node.type");var V1o=e=>!!e&&typeof e==="object"&&e[GP]===jxt;var $1o=e=>!!e&&typeof e==="object"&&e[GP]===nmr;var G1o=e=>!!e&&typeof e==="object"&&e[GP]===h4e;var H1o=e=>!!e&&typeof e==="object"&&e[GP]===rmr;var imr=e=>!!e&&typeof e==="object"&&e[GP]===Kxt;var W1o=e=>!!e&&typeof e==="object"&&e[GP]===p4e;function omr(e){if(e&&typeof e==="object")switch(e[GP]){case h4e:case p4e:return true}return false}function Y1o(e){if(e&&typeof e==="object")switch(e[GP]){case jxt:case h4e:case Kxt:case p4e:return true}return false}var q1o=e=>(imr(e)||omr(e))&&!!e.anchor;Zg.ALIAS=jxt;Zg.DOC=nmr;Zg.MAP=h4e;Zg.NODE_TYPE=GP;Zg.PAIR=rmr;Zg.SCALAR=Kxt;Zg.SEQ=p4e;Zg.hasAnchor=q1o;Zg.isAlias=V1o;Zg.isCollection=omr;Zg.isDocument=$1o;Zg.isMap=G1o;Zg.isNode=Y1o;Zg.isPair=H1o;Zg.isScalar=imr;Zg.isSeq=W1o});var qoe=_r(Zxt=>{"use strict";var Jp=ac();var qx=Symbol("break visit");var amr=Symbol("skip children");var YS=Symbol("remove node");function m4e(e,t){const n=smr(t);if(Jp.isDocument(e)){const r=lY(null,e.contents,n,Object.freeze([e]));if(r===YS)e.contents=null}else lY(null,e,n,Object.freeze([]))}m4e.BREAK=qx;m4e.SKIP=amr;m4e.REMOVE=YS;function lY(e,t,n,r){const i=lmr(e,t,n,r);if(Jp.isNode(i)||Jp.isPair(i)){cmr(e,r,i);return lY(e,i,n,r)}if(typeof i!=="symbol"){if(Jp.isCollection(t)){r=Object.freeze(r.concat(t));for(let o=0;o{"use strict";var umr=ac();var X1o=qoe();var j1o={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"};var K1o=e=>e.replace(/[!,[\]{}]/g,t=>j1o[t]);var Xoe=class e{constructor(t,n){this.docStart=null;this.docEnd=false;this.yaml=Object.assign({},e.defaultYaml,t);this.tags=Object.assign({},e.defaultTags,n)}clone(){const t=new e(this.yaml,this.tags);t.docStart=this.docStart;return t}atDocument(){const t=new e(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=true;break;case"1.2":this.atNextDocument=false;this.yaml={explicit:e.defaultYaml.explicit,version:"1.2"};this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){if(this.atNextDocument){this.yaml={explicit:e.defaultYaml.explicit,version:"1.1"};this.tags=Object.assign({},e.defaultTags);this.atNextDocument=false}const r=t.trim().split(/[ \t]+/);const i=r.shift();switch(i){case"%TAG":{if(r.length!==2){n(0,"%TAG directive should contain exactly two parts");if(r.length<2)return false}const[o,a]=r;this.tags[o]=a;return true}case"%YAML":{this.yaml.explicit=true;if(r.length!==1){n(0,"%YAML directive should contain exactly one part");return false}const[o]=r;if(o==="1.1"||o==="1.2"){this.yaml.version=o;return true}else{const a=/^\d+\.\d+$/.test(o);n(6,`Unsupported YAML version ${o}`,a);return false}}default:n(0,`Unknown directive ${i}`,true);return false}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!"){n(`Not a valid tag: ${t}`);return null}if(t[1]==="<"){const a=t.slice(2,-1);if(a==="!"||a==="!!"){n(`Verbatim tags aren't resolved, so ${t} is invalid.`);return null}if(t[t.length-1]!==">")n("Verbatim tags must end with a >");return a}const[,r,i]=t.match(/^(.*!)([^!]*)$/s);if(!i)n(`The ${t} tag has no suffix`);const o=this.tags[r];if(o){try{return o+decodeURIComponent(i)}catch(a){n(String(a));return null}}if(r==="!")return t;n(`Could not resolve tag: ${t}`);return null}tagString(t){for(const[n,r]of Object.entries(this.tags)){if(t.startsWith(r))return n+K1o(t.substring(r.length))}return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[];const r=Object.entries(this.tags);let i;if(t&&r.length>0&&umr.isNode(t.contents)){const o={};X1o.visit(t.contents,(a,s)=>{if(umr.isNode(s)&&s.tag)o[s.tag]=true});i=Object.keys(o)}else i=[];for(const[o,a]of r){if(o==="!!"&&a==="tag:yaml.org,2002:")continue;if(!t||i.some(s=>s.startsWith(a)))n.push(`%TAG ${o} ${a}`)}return n.join("\n")}};Xoe.defaultYaml={explicit:false,version:"1.2"};Xoe.defaultTags={"!!":"tag:yaml.org,2002:"};dmr.Directives=Xoe});var y4e=_r(joe=>{"use strict";var fmr=ac();var Z1o=qoe();function J1o(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const t=JSON.stringify(e);const n=`Anchor must not contain whitespace or control characters: ${t}`;throw new Error(n)}return true}function hmr(e){const t=new Set;Z1o.visit(e,{Value(n,r){if(r.anchor)t.add(r.anchor)}});return t}function pmr(e,t){for(let n=1;true;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function Q1o(e,t){const n=[];const r=new Map;let i=null;return{onAnchor:o=>{n.push(o);i??(i=hmr(e));const a=pmr(t,i);i.add(a);return a},setAnchors:()=>{for(const o of n){const a=r.get(o);if(typeof a==="object"&&a.anchor&&(fmr.isScalar(a.node)||fmr.isCollection(a.node))){a.node.anchor=a.anchor}else{const s=new Error("Failed to resolve repeated object (this should not happen)");s.source=o;throw s}}},sourceObjects:r}}joe.anchorIsValid=J1o;joe.anchorNames=hmr;joe.createNodeAnchors=Q1o;joe.findNewAnchor=pmr});var Qxt=_r(mmr=>{"use strict";function Koe(e,t,n,r){if(r&&typeof r==="object"){if(Array.isArray(r)){for(let i=0,o=r.length;i{"use strict";var evo=ac();function gmr(e,t,n){if(Array.isArray(e))return e.map((r,i)=>gmr(r,String(i),n));if(e&&typeof e.toJSON==="function"){if(!n||!evo.hasAnchor(e))return e.toJSON(t,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r);n.onCreate=o=>{r.res=o;delete n.onCreate};const i=e.toJSON(t,n);if(n.onCreate)n.onCreate(i);return i}if(typeof e==="bigint"&&!n?.keep)return Number(e);return e}ymr.toJS=gmr});var b4e=_r(xmr=>{"use strict";var tvo=Qxt();var bmr=ac();var nvo=_F();var e1t=class{constructor(t){Object.defineProperty(this,bmr.NODE_TYPE,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)t.range=this.range.slice();return t}toJS(t,{mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:o}={}){if(!bmr.isDocument(t))throw new TypeError("A document argument is required");const a={anchors:new Map,doc:t,keep:true,mapAsMap:n===true,mapKeyWarned:false,maxAliasCount:typeof r==="number"?r:100};const s=nvo.toJS(this,"",a);if(typeof i==="function")for(const{count:l,res:u}of a.anchors.values())i(u,l);return typeof o==="function"?tvo.applyReviver(o,{"":s},"",s):s}};xmr.NodeBase=e1t});var Zoe=_r(vmr=>{"use strict";var rvo=y4e();var ivo=qoe();var uY=ac();var ovo=b4e();var avo=_F();var t1t=class extends ovo.NodeBase{constructor(t){super(uY.ALIAS);this.source=t;Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let r;if(n?.aliasResolveCache){r=n.aliasResolveCache}else{r=[];ivo.visit(t,{Node:(o,a)=>{if(uY.isAlias(a)||uY.hasAnchor(a))r.push(a)}});if(n)n.aliasResolveCache=r}let i=void 0;for(const o of r){if(o===this)break;if(o.anchor===this.source)i=o}return i}toJSON(t,n){if(!n)return{source:this.source};const{anchors:r,doc:i,maxAliasCount:o}=n;const a=this.resolve(i,n);if(!a){const l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let s=r.get(a);if(!s){avo.toJS(a,null,n);s=r.get(a)}if(s?.res===void 0){const l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(o>=0){s.count+=1;if(s.aliasCount===0)s.aliasCount=x4e(i,a,r);if(s.count*s.aliasCount>o){const l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}}return s.res}toString(t,n,r){const i=`*${this.source}`;if(t){rvo.anchorIsValid(this.source);if(t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(t.implicitKey)return`${i} `}return i}};function x4e(e,t,n){if(uY.isAlias(t)){const r=t.resolve(e);const i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(uY.isCollection(t)){let r=0;for(const i of t.items){const o=x4e(e,i,n);if(o>r)r=o}return r}else if(uY.isPair(t)){const r=x4e(e,t.key,n);const i=x4e(e,t.value,n);return Math.max(r,i)}return 1}vmr.Alias=t1t});var sp=_r(n1t=>{"use strict";var svo=ac();var lvo=b4e();var cvo=_F();var uvo=e=>!e||typeof e!=="function"&&typeof e!=="object";var TF=class extends lvo.NodeBase{constructor(t){super(svo.SCALAR);this.value=t}toJSON(t,n){return n?.keep?this.value:cvo.toJS(this.value,t,n)}toString(){return String(this.value)}};TF.BLOCK_FOLDED="BLOCK_FOLDED";TF.BLOCK_LITERAL="BLOCK_LITERAL";TF.PLAIN="PLAIN";TF.QUOTE_DOUBLE="QUOTE_DOUBLE";TF.QUOTE_SINGLE="QUOTE_SINGLE";n1t.Scalar=TF;n1t.isScalarValue=uvo});var Joe=_r(Tmr=>{"use strict";var dvo=Zoe();var q8=ac();var _mr=sp();var fvo="tag:yaml.org,2002:";function hvo(e,t,n){if(t){const r=n.filter(o=>o.tag===t);const i=r.find(o=>!o.format)??r[0];if(!i)throw new Error(`Tag ${t} not found`);return i}return n.find(r=>r.identify?.(e)&&!r.format)}function pvo(e,t,n){if(q8.isDocument(e))e=e.contents;if(q8.isNode(e))return e;if(q8.isPair(e)){const f=n.schema[q8.MAP].createNode?.(n.schema,null,n);f.items.push(e);return f}if(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt!=="undefined"&&e instanceof BigInt){e=e.valueOf()}const{aliasDuplicateObjects:r,onAnchor:i,onTagObj:o,schema:a,sourceObjects:s}=n;let l=void 0;if(r&&e&&typeof e==="object"){l=s.get(e);if(l){l.anchor??(l.anchor=i(e));return new dvo.Alias(l.anchor)}else{l={anchor:null,node:null};s.set(e,l)}}if(t?.startsWith("!!"))t=fvo+t.slice(2);let u=hvo(e,t,a.tags);if(!u){if(e&&typeof e.toJSON==="function"){e=e.toJSON()}if(!e||typeof e!=="object"){const f=new _mr.Scalar(e);if(l)l.node=f;return f}u=e instanceof Map?a[q8.MAP]:Symbol.iterator in Object(e)?a[q8.SEQ]:a[q8.MAP]}if(o){o(u);delete n.onTagObj}const d=u?.createNode?u.createNode(n.schema,e,n):typeof u?.nodeClass?.from==="function"?u.nodeClass.from(n.schema,e,n):new _mr.Scalar(e);if(t)d.tag=t;else if(!u.default)d.tag=u.tag;if(l)l.node=d;return d}Tmr.createNode=pvo});var _4e=_r(v4e=>{"use strict";var mvo=Joe();var qS=ac();var gvo=b4e();function r1t(e,t,n){let r=n;for(let i=t.length-1;i>=0;--i){const o=t[i];if(typeof o==="number"&&Number.isInteger(o)&&o>=0){const a=[];a[o]=r;r=a}else{r=new Map([[o,r]])}}return mvo.createNode(r,void 0,{aliasDuplicateObjects:false,keepUndefined:false,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}var wmr=e=>e==null||typeof e==="object"&&!!e[Symbol.iterator]().next().done;var i1t=class extends gvo.NodeBase{constructor(t,n){super(t);Object.defineProperty(this,"schema",{value:n,configurable:true,enumerable:false,writable:true})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(t)n.schema=t;n.items=n.items.map(r=>qS.isNode(r)||qS.isPair(r)?r.clone(t):r);if(this.range)n.range=this.range.slice();return n}addIn(t,n){if(wmr(t))this.add(n);else{const[r,...i]=t;const o=this.get(r,true);if(qS.isCollection(o))o.addIn(i,n);else if(o===void 0&&this.schema)this.set(r,r1t(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(t){const[n,...r]=t;if(r.length===0)return this.delete(n);const i=this.get(n,true);if(qS.isCollection(i))return i.deleteIn(r);else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){const[r,...i]=t;const o=this.get(r,true);if(i.length===0)return!n&&qS.isScalar(o)?o.value:o;else return qS.isCollection(o)?o.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!qS.isPair(n))return false;const r=n.value;return r==null||t&&qS.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(t){const[n,...r]=t;if(r.length===0)return this.has(n);const i=this.get(n,true);return qS.isCollection(i)?i.hasIn(r):false}setIn(t,n){const[r,...i]=t;if(i.length===0){this.set(r,n)}else{const o=this.get(r,true);if(qS.isCollection(o))o.setIn(i,n);else if(o===void 0&&this.schema)this.set(r,r1t(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}};v4e.Collection=i1t;v4e.collectionFromPath=r1t;v4e.isEmptyPath=wmr});var Qoe=_r(T4e=>{"use strict";var yvo=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function o1t(e,t){if(/^\n+$/.test(e))return e.substring(1);return t?e.replace(/^(?! *$)/gm,t):e}var bvo=(e,t,n)=>e.endsWith("\n")?o1t(n,t):n.includes("\n")?"\n"+o1t(n,t):(e.endsWith(" ")?"":" ")+n;T4e.indentComment=o1t;T4e.lineComment=bvo;T4e.stringifyComment=yvo});var Cmr=_r(eae=>{"use strict";var xvo="flow";var a1t="block";var w4e="quoted";function vvo(e,t,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:o=20,onFold:a,onOverflow:s}={}){if(!i||i<0)return e;if(ii-Math.max(2,o))u.push(0);else f=i-r}let h=void 0;let m=void 0;let g=false;let x=-1;let w=-1;let _=-1;if(n===a1t){x=Emr(e,x,t.length);if(x!==-1)f=x+l}for(let A;A=e[x+=1];){if(n===w4e&&A==="\\"){w=x;switch(e[x+1]){case"x":x+=3;break;case"u":x+=5;break;case"U":x+=9;break;default:x+=1}_=x}if(A==="\n"){if(n===a1t)x=Emr(e,x,t.length);f=x+t.length+l;h=void 0}else{if(A===" "&&m&&m!==" "&&m!=="\n"&&m!==" "){const P=e[x+1];if(P&&P!==" "&&P!=="\n"&&P!==" ")h=x}if(x>=f){if(h){u.push(h);f=h+l;h=void 0}else if(n===w4e){while(m===" "||m===" "){m=A;A=e[x+=1];g=true}const P=x>_+1?x-2:w-1;if(d[P])return e;u.push(P);d[P]=true;f=P+l;h=void 0}else{g=true}}}m=A}if(g&&s)s();if(u.length===0)return e;if(a)a();let C=e.slice(0,u[0]);for(let A=0;A{"use strict";var m2=sp();var wF=Cmr();var C4e=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth});var S4e=e=>/^(%|---|\.\.\.)/m.test(e);function _vo(e,t,n){if(!t||t<0)return false;const r=t-n;const i=e.length;if(i<=r)return false;for(let o=0,a=0;or)return true;a=o+1;if(i-a<=r)return false}}return true}function tae(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t;const i=t.options.doubleQuotedMinMultiLineLength;const o=t.indent||(S4e(e)?" ":"");let a="";let s=0;for(let l=0,u=n[l];u;u=n[++l]){if(u===" "&&n[l+1]==="\\"&&n[l+2]==="n"){a+=n.slice(s,l)+"\\ ";l+=1;s=l;u="\\"}if(u==="\\")switch(n[l+1]){case"u":{a+=n.slice(s,l);const d=n.substr(l+2,4);switch(d){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:if(d.substr(0,2)==="00")a+="\\x"+d.substr(2);else a+=n.substr(l,6)}l+=5;s=l+1}break;case"n":if(r||n[l+2]==='"'||n.length\n";let f;let h;for(h=n.length;h>0;--h){const L=n[h-1];if(L!=="\n"&&L!==" "&&L!==" ")break}let m=n.substring(h);const g=m.indexOf("\n");if(g===-1){f="-"}else if(n===m||g!==m.length-1){f="+";if(o)o()}else{f=""}if(m){n=n.slice(0,-m.length);if(m[m.length-1]==="\n")m=m.slice(0,-1);m=m.replace(l1t,`$&${u}`)}let x=false;let w;let _=-1;for(w=0;w{I=true}}const O=wF.foldFlowLines(`${C}${L}${m}`,u,wF.FOLD_BLOCK,N);if(!I)return`>${P} +${u}${O}`}n=n.replace(/\n+/g,`$&${u}`);return`|${P} +${u}${C}${n}${m}`}function Tvo(e,t,n,r){const{type:i,value:o}=e;const{actualString:a,implicitKey:s,indent:l,indentStep:u,inFlow:d}=t;if(s&&o.includes("\n")||d&&/[[\]{},]/.test(o)){return dY(o,t)}if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o)){return s||d||!o.includes("\n")?dY(o,t):E4e(e,t,n,r)}if(!s&&!d&&i!==m2.Scalar.PLAIN&&o.includes("\n")){return E4e(e,t,n,r)}if(S4e(o)){if(l===""){t.forceBlockIndent=true;return E4e(e,t,n,r)}else if(s&&l===u){return dY(o,t)}}const f=o.replace(/\n+/g,`$& +${l}`);if(a){const h=x=>x.default&&x.tag!=="tag:yaml.org,2002:str"&&x.test?.test(f);const{compat:m,tags:g}=t.doc.schema;if(g.some(h)||m?.some(h))return dY(o,t)}return s?f:wF.foldFlowLines(f,l,wF.FOLD_FLOW,C4e(t,false))}function wvo(e,t,n,r){const{implicitKey:i,inFlow:o}=t;const a=typeof e.value==="string"?e:Object.assign({},e,{value:String(e.value)});let{type:s}=e;if(s!==m2.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value))s=m2.Scalar.QUOTE_DOUBLE}const l=d=>{switch(d){case m2.Scalar.BLOCK_FOLDED:case m2.Scalar.BLOCK_LITERAL:return i||o?dY(a.value,t):E4e(a,t,n,r);case m2.Scalar.QUOTE_DOUBLE:return tae(a.value,t);case m2.Scalar.QUOTE_SINGLE:return s1t(a.value,t);case m2.Scalar.PLAIN:return Tvo(a,t,n,r);default:return null}};let u=l(s);if(u===null){const{defaultKeyType:d,defaultStringType:f}=t.options;const h=i&&d||f;u=l(h);if(u===null)throw new Error(`Unsupported default string type ${h}`)}return u}Smr.stringifyString=wvo});var rae=_r(c1t=>{"use strict";var Evo=y4e();var EF=ac();var Cvo=Qoe();var Svo=nae();function Avo(e,t){const n=Object.assign({blockQuote:true,commentString:Cvo.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:false,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:true,indentSeq:true,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:false,singleQuote:null,trailingComma:false,trueStr:"true",verifyAliasOrder:true},e.schema.toStringOptions,t);let r;switch(n.collectionStyle){case"block":r=false;break;case"flow":r=true;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent==="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function kvo(e,t){if(t.tag){const i=e.filter(o=>o.tag===t.tag);if(i.length>0)return i.find(o=>o.format===t.format)??i[0]}let n=void 0;let r;if(EF.isScalar(t)){r=t.value;let i=e.filter(o=>o.identify?.(r));if(i.length>1){const o=i.filter(a=>a.test);if(o.length>0)i=o}n=i.find(o=>o.format===t.format)??i.find(o=>!o.format)}else{r=t;n=e.find(i=>i.nodeClass&&r instanceof i.nodeClass)}if(!n){const i=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${i} value`)}return n}function Rvo(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const i=[];const o=(EF.isScalar(e)||EF.isCollection(e))&&e.anchor;if(o&&Evo.anchorIsValid(o)){n.add(o);i.push(`&${o}`)}const a=e.tag??(t.default?null:t.tag);if(a)i.push(r.directives.tagString(a));return i.join(" ")}function Pvo(e,t,n,r){if(EF.isPair(e))return e.toString(t,n,r);if(EF.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e)){throw new TypeError(`Cannot stringify circular structure without alias nodes`)}else{if(t.resolvedAliases)t.resolvedAliases.add(e);else t.resolvedAliases=new Set([e]);e=e.resolve(t.doc)}}let i=void 0;const o=EF.isNode(e)?e:t.doc.createNode(e,{onTagObj:l=>i=l});i??(i=kvo(t.doc.schema.tags,o));const a=Rvo(o,i,t);if(a.length>0)t.indentAtStart=(t.indentAtStart??0)+a.length+1;const s=typeof i.stringify==="function"?i.stringify(o,t,n,r):EF.isScalar(o)?Svo.stringifyString(o,t,n,r):o.toString(t,n,r);if(!a)return s;return EF.isScalar(o)||s[0]==="{"||s[0]==="["?`${a} ${s}`:`${a} +${t.indent}${s}`}c1t.createStringifyContext=Avo;c1t.stringify=Pvo});var Pmr=_r(Rmr=>{"use strict";var HP=ac();var Amr=sp();var kmr=rae();var iae=Qoe();function Ivo({key:e,value:t},n,r,i){const{allNullValues:o,doc:a,indent:s,indentStep:l,options:{commentString:u,indentSeq:d,simpleKeys:f}}=n;let h=HP.isNode(e)&&e.comment||null;if(f){if(h){throw new Error("With simple keys, key nodes cannot have comments")}if(HP.isCollection(e)||!HP.isNode(e)&&typeof e==="object"){const N="With simple keys, collection cannot be used as a key value";throw new Error(N)}}let m=!f&&(!e||h&&t==null&&!n.inFlow||HP.isCollection(e)||(HP.isScalar(e)?e.type===Amr.Scalar.BLOCK_FOLDED||e.type===Amr.Scalar.BLOCK_LITERAL:typeof e==="object"));n=Object.assign({},n,{allNullValues:false,implicitKey:!m&&(f||!o),indent:s+l});let g=false;let x=false;let w=kmr.stringify(e,n,()=>g=true,()=>x=true);if(!m&&!n.inFlow&&w.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=true}if(n.inFlow){if(o||t==null){if(g&&r)r();return w===""?"?":m?`? ${w}`:w}}else if(o&&!f||t==null&&m){w=`? ${w}`;if(h&&!g){w+=iae.lineComment(w,n.indent,u(h))}else if(x&&i)i();return w}if(g)h=null;if(m){if(h)w+=iae.lineComment(w,n.indent,u(h));w=`? ${w} +${s}:`}else{w=`${w}:`;if(h)w+=iae.lineComment(w,n.indent,u(h))}let _,C,A;if(HP.isNode(t)){_=!!t.spaceBefore;C=t.commentBefore;A=t.comment}else{_=false;C=null;A=null;if(t&&typeof t==="object")t=a.createNode(t)}n.implicitKey=false;if(!m&&!h&&HP.isScalar(t))n.indentAtStart=w.length+1;x=false;if(!d&&l.length>=2&&!n.inFlow&&!m&&HP.isSeq(t)&&!t.flow&&!t.tag&&!t.anchor){n.indent=n.indent.substring(2)}let P=false;const L=kmr.stringify(t,n,()=>P=true,()=>x=true);let I=" ";if(h||_||C){I=_?"\n":"";if(C){const N=u(C);I+=` +${iae.indentComment(N,n.indent)}`}if(L===""&&!n.inFlow){if(I==="\n"&&A)I="\n\n"}else{I+=` +${n.indent}`}}else if(!m&&HP.isCollection(t)){const N=L[0];const O=L.indexOf("\n");const z=O!==-1;const U=n.inFlow??t.flow??t.items.length===0;if(z||!U){let W=false;if(z&&(N==="&"||N==="!")){let H=L.indexOf(" ");if(N==="&"&&H!==-1&&H{"use strict";var Imr=mce("process");function Mvo(e,...t){if(e==="debug")console.log(...t)}function Lvo(e,t){if(e==="debug"||e==="warn"){if(typeof Imr.emitWarning==="function")Imr.emitWarning(t);else console.warn(t)}}u1t.debug=Mvo;u1t.warn=Lvo});var I4e=_r(P4e=>{"use strict";var R4e=ac();var Mmr=sp();var A4e="<<";var k4e={identify:e=>e===A4e||typeof e==="symbol"&&e.description===A4e,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Mmr.Scalar(Symbol(A4e)),{addToJSMap:Lmr}),stringify:()=>A4e};var Dvo=(e,t)=>(k4e.identify(t)||R4e.isScalar(t)&&(!t.type||t.type===Mmr.Scalar.PLAIN)&&k4e.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===k4e.tag&&n.default);function Lmr(e,t,n){const r=Dmr(e,n);if(R4e.isSeq(r))for(const i of r.items)f1t(e,t,i);else if(Array.isArray(r))for(const i of r)f1t(e,t,i);else f1t(e,t,r)}function f1t(e,t,n){const r=Dmr(e,n);if(!R4e.isMap(r))throw new Error("Merge sources must be maps or map aliases");const i=r.toJSON(null,e,Map);for(const[o,a]of i){if(t instanceof Map){if(!t.has(o))t.set(o,a)}else if(t instanceof Set){t.add(o)}else if(!Object.prototype.hasOwnProperty.call(t,o)){Object.defineProperty(t,o,{value:a,writable:true,enumerable:true,configurable:true})}}return t}function Dmr(e,t){return e&&R4e.isAlias(t)?t.resolve(e.doc,e):t}P4e.addMergeToJSMap=Lmr;P4e.isMergeKey=Dvo;P4e.merge=k4e});var p1t=_r(Omr=>{"use strict";var Fvo=d1t();var Fmr=I4e();var Nvo=rae();var Nmr=ac();var h1t=_F();function Ovo(e,t,{key:n,value:r}){if(Nmr.isNode(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(Fmr.isMergeKey(e,n))Fmr.addMergeToJSMap(e,t,r);else{const i=h1t.toJS(n,"",e);if(t instanceof Map){t.set(i,h1t.toJS(r,i,e))}else if(t instanceof Set){t.add(i)}else{const o=Bvo(n,i,e);const a=h1t.toJS(r,o,e);if(o in t)Object.defineProperty(t,o,{value:a,writable:true,enumerable:true,configurable:true});else t[o]=a}}return t}function Bvo(e,t,n){if(t===null)return"";if(typeof t!=="object")return String(t);if(Nmr.isNode(e)&&n?.doc){const r=Nvo.createStringifyContext(n.doc,{});r.anchors=new Set;for(const o of n.anchors.keys())r.anchors.add(o.anchor);r.inFlow=true;r.inStringifyKey=true;const i=e.toString(r);if(!n.mapKeyWarned){let o=JSON.stringify(i);if(o.length>40)o=o.substring(0,36)+'..."';Fvo.warn(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`);n.mapKeyWarned=true}return i}return JSON.stringify(t)}Omr.addPairToJSMap=Ovo});var CF=_r(m1t=>{"use strict";var Bmr=Joe();var zvo=Pmr();var Uvo=p1t();var M4e=ac();function Vvo(e,t,n){const r=Bmr.createNode(e,void 0,n);const i=Bmr.createNode(t,void 0,n);return new L4e(r,i)}var L4e=class e{constructor(t,n=null){Object.defineProperty(this,M4e.NODE_TYPE,{value:M4e.PAIR});this.key=t;this.value=n}clone(t){let{key:n,value:r}=this;if(M4e.isNode(n))n=n.clone(t);if(M4e.isNode(r))r=r.clone(t);return new e(n,r)}toJSON(t,n){const r=n?.mapAsMap?new Map:{};return Uvo.addPairToJSMap(n,r,this)}toString(t,n,r){return t?.doc?zvo.stringifyPair(this,t,n,r):JSON.stringify(this)}};m1t.Pair=L4e;m1t.createPair=Vvo});var g1t=_r(Umr=>{"use strict";var X8=ac();var zmr=rae();var D4e=Qoe();function $vo(e,t,n){const r=t.inFlow??e.flow;const i=r?Hvo:Gvo;return i(e,t,n)}function Gvo({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:o,onChompKeep:a,onComment:s}){const{indent:l,options:{commentString:u}}=n;const d=Object.assign({},n,{indent:o,type:null});let f=false;const h=[];for(let g=0;gw=null,()=>f=true);if(w)_+=D4e.lineComment(_,o,u(w));if(f&&w)f=false;h.push(r+_)}let m;if(h.length===0){m=i.start+i.end}else{m=h[0];for(let g=1;gw=null);u||(u=f.length>d||_.includes("\n"));if(g0){u||(u=f.reduce((C,A)=>C+A.length+2,2)+(_.length+2)>t.options.lineWidth)}if(u){_+=","}}if(w)_+=D4e.lineComment(_,r,s(w));f.push(_);d=f.length}const{start:h,end:m}=n;if(f.length===0){return h+m}else{if(!u){const g=f.reduce((x,w)=>x+w.length+2,2);u=t.options.lineWidth>0&&g>t.options.lineWidth}if(u){let g=h;for(const x of f)g+=x?` +${o}${i}${x}`:"\n";return`${g} +${i}${m}`}else{return`${h}${a}${f.join(" ")}${a}${m}`}}}function F4e({indent:e,options:{commentString:t}},n,r,i){if(r&&i)r=r.replace(/^\n+/,"");if(r){const o=D4e.indentComment(t(r),e);n.push(o.trimStart())}}Umr.stringifyCollection=$vo});var AF=_r(b1t=>{"use strict";var Wvo=g1t();var Yvo=p1t();var qvo=_4e();var SF=ac();var N4e=CF();var Xvo=sp();function oae(e,t){const n=SF.isScalar(t)?t.value:t;for(const r of e){if(SF.isPair(r)){if(r.key===t||r.key===n)return r;if(SF.isScalar(r.key)&&r.key.value===n)return r}}return void 0}var y1t=class extends qvo.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(SF.MAP,t);this.items=[]}static from(t,n,r){const{keepUndefined:i,replacer:o}=r;const a=new this(t);const s=(l,u)=>{if(typeof o==="function")u=o.call(n,l,u);else if(Array.isArray(o)&&!o.includes(l))return;if(u!==void 0||i)a.items.push(N4e.createPair(l,u,r))};if(n instanceof Map){for(const[l,u]of n)s(l,u)}else if(n&&typeof n==="object"){for(const l of Object.keys(n))s(l,n[l])}if(typeof t.sortMapEntries==="function"){a.items.sort(t.sortMapEntries)}return a}add(t,n){let r;if(SF.isPair(t))r=t;else if(!t||typeof t!=="object"||!("key"in t)){r=new N4e.Pair(t,t?.value)}else r=new N4e.Pair(t.key,t.value);const i=oae(this.items,r.key);const o=this.schema?.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);if(SF.isScalar(i.value)&&Xvo.isScalarValue(r.value))i.value.value=r.value;else i.value=r.value}else if(o){const a=this.items.findIndex(s=>o(r,s)<0);if(a===-1)this.items.push(r);else this.items.splice(a,0,r)}else{this.items.push(r)}}delete(t){const n=oae(this.items,t);if(!n)return false;const r=this.items.splice(this.items.indexOf(n),1);return r.length>0}get(t,n){const r=oae(this.items,t);const i=r?.value;return(!n&&SF.isScalar(i)?i.value:i)??void 0}has(t){return!!oae(this.items,t)}set(t,n){this.add(new N4e.Pair(t,n),true)}toJSON(t,n,r){const i=r?new r:n?.mapAsMap?new Map:{};if(n?.onCreate)n.onCreate(i);for(const o of this.items)Yvo.addPairToJSMap(n,i,o);return i}toString(t,n,r){if(!t)return JSON.stringify(this);for(const i of this.items){if(!SF.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`)}if(!t.allNullValues&&this.hasAllNullValues(false))t=Object.assign({},t,{allNullValues:true});return Wvo.stringifyCollection(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}};b1t.YAMLMap=y1t;b1t.findPair=oae});var fY=_r($mr=>{"use strict";var jvo=ac();var Vmr=AF();var Kvo={collection:"map",default:true,nodeClass:Vmr.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(e,t){if(!jvo.isMap(e))t("Expected a mapping for this tag");return e},createNode:(e,t,n)=>Vmr.YAMLMap.from(e,t,n)};$mr.map=Kvo});var kF=_r(Gmr=>{"use strict";var Zvo=Joe();var Jvo=g1t();var Qvo=_4e();var B4e=ac();var e_o=sp();var t_o=_F();var x1t=class extends Qvo.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(B4e.SEQ,t);this.items=[]}add(t){this.items.push(t)}delete(t){const n=O4e(t);if(typeof n!=="number")return false;const r=this.items.splice(n,1);return r.length>0}get(t,n){const r=O4e(t);if(typeof r!=="number")return void 0;const i=this.items[r];return!n&&B4e.isScalar(i)?i.value:i}has(t){const n=O4e(t);return typeof n==="number"&&n=0?t:null}Gmr.YAMLSeq=x1t});var hY=_r(Wmr=>{"use strict";var n_o=ac();var Hmr=kF();var r_o={collection:"seq",default:true,nodeClass:Hmr.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(e,t){if(!n_o.isSeq(e))t("Expected a sequence for this tag");return e},createNode:(e,t,n)=>Hmr.YAMLSeq.from(e,t,n)};Wmr.seq=r_o});var aae=_r(Ymr=>{"use strict";var i_o=nae();var o_o={identify:e=>typeof e==="string",default:true,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,r){t=Object.assign({actualString:true},t);return i_o.stringifyString(e,t,n,r)}};Ymr.string=o_o});var z4e=_r(jmr=>{"use strict";var qmr=sp();var Xmr={identify:e=>e==null,createNode:()=>new qmr.Scalar(null),default:true,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new qmr.Scalar(null),stringify:({source:e},t)=>typeof e==="string"&&Xmr.test.test(e)?e:t.options.nullStr};jmr.nullTag=Xmr});var v1t=_r(Zmr=>{"use strict";var a_o=sp();var Kmr={identify:e=>typeof e==="boolean",default:true,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new a_o.Scalar(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&Kmr.test.test(e)){const r=e[0]==="t"||e[0]==="T";if(t===r)return e}return t?n.options.trueStr:n.options.falseStr}};Zmr.boolTag=Kmr});var pY=_r(Jmr=>{"use strict";function s_o({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==="bigint")return String(r);const i=typeof r==="number"?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let o=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(o)&&!o.includes("e")){let a=o.indexOf(".");if(a<0){a=o.length;o+="."}let s=t-(o.length-a-1);while(s-- >0)o+="0"}return o}Jmr.stringifyNumber=s_o});var T1t=_r(U4e=>{"use strict";var l_o=sp();var _1t=pY();var c_o={identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:_1t.stringifyNumber};var u_o={identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():_1t.stringifyNumber(e)}};var d_o={identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new l_o.Scalar(parseFloat(e));const n=e.indexOf(".");if(n!==-1&&e[e.length-1]==="0")t.minFractionDigits=e.length-n-1;return t},stringify:_1t.stringifyNumber};U4e.float=d_o;U4e.floatExp=u_o;U4e.floatNaN=c_o});var E1t=_r($4e=>{"use strict";var Qmr=pY();var V4e=e=>typeof e==="bigint"||Number.isInteger(e);var w1t=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function egr(e,t,n){const{value:r}=e;if(V4e(r)&&r>=0)return n+r.toString(t);return Qmr.stringifyNumber(e)}var f_o={identify:e=>V4e(e)&&e>=0,default:true,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>w1t(e,2,8,n),stringify:e=>egr(e,8,"0o")};var h_o={identify:V4e,default:true,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>w1t(e,0,10,n),stringify:Qmr.stringifyNumber};var p_o={identify:e=>V4e(e)&&e>=0,default:true,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>w1t(e,2,16,n),stringify:e=>egr(e,16,"0x")};$4e.int=h_o;$4e.intHex=p_o;$4e.intOct=f_o});var ngr=_r(tgr=>{"use strict";var m_o=fY();var g_o=z4e();var y_o=hY();var b_o=aae();var x_o=v1t();var C1t=T1t();var S1t=E1t();var v_o=[m_o.map,y_o.seq,b_o.string,g_o.nullTag,x_o.boolTag,S1t.intOct,S1t.int,S1t.intHex,C1t.floatNaN,C1t.floatExp,C1t.float];tgr.schema=v_o});var ogr=_r(igr=>{"use strict";var __o=sp();var T_o=fY();var w_o=hY();function rgr(e){return typeof e==="bigint"||Number.isInteger(e)}var G4e=({value:e})=>JSON.stringify(e);var E_o=[{identify:e=>typeof e==="string",default:true,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:G4e},{identify:e=>e==null,createNode:()=>new __o.Scalar(null),default:true,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:G4e},{identify:e=>typeof e==="boolean",default:true,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:G4e},{identify:rgr,default:true,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>rgr(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:G4e}];var C_o={default:true,tag:"",test:/^/,resolve(e,t){t(`Unresolved plain scalar ${JSON.stringify(e)}`);return e}};var S_o=[T_o.map,w_o.seq].concat(E_o,C_o);igr.schema=S_o});var k1t=_r(agr=>{"use strict";var sae=mce("buffer");var A1t=sp();var A_o=nae();var k_o={identify:e=>e instanceof Uint8Array,default:false,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof sae.Buffer==="function"){return sae.Buffer.from(e,"base64")}else if(typeof atob==="function"){const n=atob(e.replace(/[\n\r]/g,""));const r=new Uint8Array(n.length);for(let i=0;i{"use strict";var H4e=ac();var R1t=CF();var R_o=sp();var P_o=kF();function sgr(e,t){if(H4e.isSeq(e)){for(let n=0;n1)t("Each pair must have its own sequence indicator");const i=r.items[0]||new R1t.Pair(new R_o.Scalar(null));if(r.commentBefore)i.key.commentBefore=i.key.commentBefore?`${r.commentBefore} +${i.key.commentBefore}`:r.commentBefore;if(r.comment){const o=i.value??i.key;o.comment=o.comment?`${r.comment} +${o.comment}`:r.comment}r=i}e.items[n]=H4e.isPair(r)?r:new R1t.Pair(r)}}else t("Expected a sequence for this tag");return e}function lgr(e,t,n){const{replacer:r}=n;const i=new P_o.YAMLSeq(e);i.tag="tag:yaml.org,2002:pairs";let o=0;if(t&&Symbol.iterator in Object(t))for(let a of t){if(typeof r==="function")a=r.call(t,String(o++),a);let s,l;if(Array.isArray(a)){if(a.length===2){s=a[0];l=a[1]}else throw new TypeError(`Expected [key, value] tuple: ${a}`)}else if(a&&a instanceof Object){const u=Object.keys(a);if(u.length===1){s=u[0];l=a[s]}else{throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}}else{s=a}i.items.push(R1t.createPair(s,l,n))}return i}var I_o={collection:"seq",default:false,tag:"tag:yaml.org,2002:pairs",resolve:sgr,createNode:lgr};W4e.createPairs=lgr;W4e.pairs=I_o;W4e.resolvePairs=sgr});var M1t=_r(I1t=>{"use strict";var cgr=ac();var P1t=_F();var lae=AF();var M_o=kF();var ugr=Y4e();var j8=class e extends M_o.YAMLSeq{constructor(){super();this.add=lae.YAMLMap.prototype.add.bind(this);this.delete=lae.YAMLMap.prototype.delete.bind(this);this.get=lae.YAMLMap.prototype.get.bind(this);this.has=lae.YAMLMap.prototype.has.bind(this);this.set=lae.YAMLMap.prototype.set.bind(this);this.tag=e.tag}toJSON(t,n){if(!n)return super.toJSON(t);const r=new Map;if(n?.onCreate)n.onCreate(r);for(const i of this.items){let o,a;if(cgr.isPair(i)){o=P1t.toJS(i.key,"",n);a=P1t.toJS(i.value,o,n)}else{o=P1t.toJS(i,"",n)}if(r.has(o))throw new Error("Ordered maps must not include duplicate keys");r.set(o,a)}return r}static from(t,n,r){const i=ugr.createPairs(t,n,r);const o=new this;o.items=i.items;return o}};j8.tag="tag:yaml.org,2002:omap";var L_o={collection:"seq",identify:e=>e instanceof Map,nodeClass:j8,default:false,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=ugr.resolvePairs(e,t);const r=[];for(const{key:i}of n.items){if(cgr.isScalar(i)){if(r.includes(i.value)){t(`Ordered maps must not include duplicate keys: ${i.value}`)}else{r.push(i.value)}}}return Object.assign(new j8,n)},createNode:(e,t,n)=>j8.from(e,t,n)};I1t.YAMLOMap=j8;I1t.omap=L_o});var mgr=_r(L1t=>{"use strict";var dgr=sp();function fgr({value:e,source:t},n){const r=e?hgr:pgr;if(t&&r.test.test(t))return t;return e?n.options.trueStr:n.options.falseStr}var hgr={identify:e=>e===true,default:true,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new dgr.Scalar(true),stringify:fgr};var pgr={identify:e=>e===false,default:true,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new dgr.Scalar(false),stringify:fgr};L1t.falseTag=pgr;L1t.trueTag=hgr});var ggr=_r(q4e=>{"use strict";var D_o=sp();var D1t=pY();var F_o={identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:D1t.stringifyNumber};var N_o={identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():D1t.stringifyNumber(e)}};var O_o={identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new D_o.Scalar(parseFloat(e.replace(/_/g,"")));const n=e.indexOf(".");if(n!==-1){const r=e.substring(n+1).replace(/_/g,"");if(r[r.length-1]==="0")t.minFractionDigits=r.length}return t},stringify:D1t.stringifyNumber};q4e.float=O_o;q4e.floatExp=N_o;q4e.floatNaN=F_o});var bgr=_r(uae=>{"use strict";var ygr=pY();var cae=e=>typeof e==="bigint"||Number.isInteger(e);function X4e(e,t,n,{intAsBigInt:r}){const i=e[0];if(i==="-"||i==="+")t+=1;e=e.substring(t).replace(/_/g,"");if(r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const a=BigInt(e);return i==="-"?BigInt(-1)*a:a}const o=parseInt(e,n);return i==="-"?-1*o:o}function F1t(e,t,n){const{value:r}=e;if(cae(r)){const i=r.toString(t);return r<0?"-"+n+i.substr(1):n+i}return ygr.stringifyNumber(e)}var B_o={identify:cae,default:true,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>X4e(e,2,2,n),stringify:e=>F1t(e,2,"0b")};var z_o={identify:cae,default:true,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>X4e(e,1,8,n),stringify:e=>F1t(e,8,"0")};var U_o={identify:cae,default:true,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>X4e(e,0,10,n),stringify:ygr.stringifyNumber};var V_o={identify:cae,default:true,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>X4e(e,2,16,n),stringify:e=>F1t(e,16,"0x")};uae.int=U_o;uae.intBin=B_o;uae.intHex=V_o;uae.intOct=z_o});var O1t=_r(N1t=>{"use strict";var Z4e=ac();var j4e=CF();var K4e=AF();var K8=class e extends K4e.YAMLMap{constructor(t){super(t);this.tag=e.tag}add(t){let n;if(Z4e.isPair(t))n=t;else if(t&&typeof t==="object"&&"key"in t&&"value"in t&&t.value===null)n=new j4e.Pair(t.key,null);else n=new j4e.Pair(t,null);const r=K4e.findPair(this.items,n.key);if(!r)this.items.push(n)}get(t,n){const r=K4e.findPair(this.items,t);return!n&&Z4e.isPair(r)?Z4e.isScalar(r.key)?r.key.value:r.key:r}set(t,n){if(typeof n!=="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const r=K4e.findPair(this.items,t);if(r&&!n){this.items.splice(this.items.indexOf(r),1)}else if(!r&&n){this.items.push(new j4e.Pair(t))}}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(true))return super.toString(Object.assign({},t,{allNullValues:true}),n,r);else throw new Error("Set items must all have null values")}static from(t,n,r){const{replacer:i}=r;const o=new this(t);if(n&&Symbol.iterator in Object(n))for(let a of n){if(typeof i==="function")a=i.call(n,a,a);o.items.push(j4e.createPair(a,null,r))}return o}};K8.tag="tag:yaml.org,2002:set";var $_o={collection:"map",identify:e=>e instanceof Set,nodeClass:K8,default:false,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>K8.from(e,t,n),resolve(e,t){if(Z4e.isMap(e)){if(e.hasAllNullValues(true))return Object.assign(new K8,e);else t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};N1t.YAMLSet=K8;N1t.set=$_o});var z1t=_r(J4e=>{"use strict";var G_o=pY();function B1t(e,t){const n=e[0];const r=n==="-"||n==="+"?e.substring(1):e;const i=a=>t?BigInt(a):Number(a);const o=r.replace(/_/g,"").split(":").reduce((a,s)=>a*i(60)+i(s),i(0));return n==="-"?i(-1)*o:o}function xgr(e){let{value:t}=e;let n=a=>a;if(typeof t==="bigint")n=a=>BigInt(a);else if(isNaN(t)||!isFinite(t))return G_o.stringifyNumber(e);let r="";if(t<0){r="-";t*=n(-1)}const i=n(60);const o=[t%i];if(t<60){o.unshift(0)}else{t=(t-o[0])/i;o.unshift(t%i);if(t>=60){t=(t-o[0])/i;o.unshift(t)}}return r+o.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var H_o={identify:e=>typeof e==="bigint"||Number.isInteger(e),default:true,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>B1t(e,n),stringify:xgr};var W_o={identify:e=>typeof e==="number",default:true,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>B1t(e,false),stringify:xgr};var vgr={identify:e=>e instanceof Date,default:true,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(vgr.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,i,o,a,s]=t.map(Number);const l=t[7]?Number((t[7]+"00").substr(1,3)):0;let u=Date.UTC(n,r-1,i,o||0,a||0,s||0,l);const d=t[8];if(d&&d!=="Z"){let f=B1t(d,false);if(Math.abs(f)<30)f*=60;u-=6e4*f}return new Date(u)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};J4e.floatTime=W_o;J4e.intTime=H_o;J4e.timestamp=vgr});var wgr=_r(Tgr=>{"use strict";var Y_o=fY();var q_o=z4e();var X_o=hY();var j_o=aae();var K_o=k1t();var _gr=mgr();var U1t=ggr();var Q4e=bgr();var Z_o=I4e();var J_o=M1t();var Q_o=Y4e();var eTo=O1t();var V1t=z1t();var tTo=[Y_o.map,X_o.seq,j_o.string,q_o.nullTag,_gr.trueTag,_gr.falseTag,Q4e.intBin,Q4e.intOct,Q4e.int,Q4e.intHex,U1t.floatNaN,U1t.floatExp,U1t.float,K_o.binary,Z_o.merge,J_o.omap,Q_o.pairs,eTo.set,V1t.intTime,V1t.floatTime,V1t.timestamp];Tgr.schema=tTo});var Lgr=_r(H1t=>{"use strict";var Agr=fY();var nTo=z4e();var kgr=hY();var rTo=aae();var iTo=v1t();var $1t=T1t();var G1t=E1t();var oTo=ngr();var aTo=ogr();var Rgr=k1t();var dae=I4e();var Pgr=M1t();var Igr=Y4e();var Egr=wgr();var Mgr=O1t();var eNe=z1t();var Cgr=new Map([["core",oTo.schema],["failsafe",[Agr.map,kgr.seq,rTo.string]],["json",aTo.schema],["yaml11",Egr.schema],["yaml-1.1",Egr.schema]]);var Sgr={binary:Rgr.binary,bool:iTo.boolTag,float:$1t.float,floatExp:$1t.floatExp,floatNaN:$1t.floatNaN,floatTime:eNe.floatTime,int:G1t.int,intHex:G1t.intHex,intOct:G1t.intOct,intTime:eNe.intTime,map:Agr.map,merge:dae.merge,null:nTo.nullTag,omap:Pgr.omap,pairs:Igr.pairs,seq:kgr.seq,set:Mgr.set,timestamp:eNe.timestamp};var sTo={"tag:yaml.org,2002:binary":Rgr.binary,"tag:yaml.org,2002:merge":dae.merge,"tag:yaml.org,2002:omap":Pgr.omap,"tag:yaml.org,2002:pairs":Igr.pairs,"tag:yaml.org,2002:set":Mgr.set,"tag:yaml.org,2002:timestamp":eNe.timestamp};function lTo(e,t,n){const r=Cgr.get(t);if(r&&!e){return n&&!r.includes(dae.merge)?r.concat(dae.merge):r.slice()}let i=r;if(!i){if(Array.isArray(e))i=[];else{const o=Array.from(Cgr.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${o} or define customTags array`)}}if(Array.isArray(e)){for(const o of e)i=i.concat(o)}else if(typeof e==="function"){i=e(i.slice())}if(n)i=i.concat(dae.merge);return i.reduce((o,a)=>{const s=typeof a==="string"?Sgr[a]:a;if(!s){const l=JSON.stringify(a);const u=Object.keys(Sgr).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${u}`)}if(!o.includes(s))o.push(s);return o},[])}H1t.coreKnownTags=sTo;H1t.getTags=lTo});var q1t=_r(Dgr=>{"use strict";var W1t=ac();var cTo=fY();var uTo=hY();var dTo=aae();var tNe=Lgr();var fTo=(e,t)=>e.keyt.key?1:0;var Y1t=class e{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:i,schema:o,sortMapEntries:a,toStringDefaults:s}){this.compat=Array.isArray(t)?tNe.getTags(t,"compat"):t?tNe.getTags(null,t):null;this.name=typeof o==="string"&&o||"core";this.knownTags=i?tNe.coreKnownTags:{};this.tags=tNe.getTags(n,this.name,r);this.toStringOptions=s??null;Object.defineProperty(this,W1t.MAP,{value:cTo.map});Object.defineProperty(this,W1t.SCALAR,{value:dTo.string});Object.defineProperty(this,W1t.SEQ,{value:uTo.seq});this.sortMapEntries=typeof a==="function"?a:a===true?fTo:null}clone(){const t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));t.tags=this.tags.slice();return t}};Dgr.Schema=Y1t});var Ngr=_r(Fgr=>{"use strict";var hTo=ac();var X1t=rae();var fae=Qoe();function pTo(e,t){const n=[];let r=t.directives===true;if(t.directives!==false&&e.directives){const l=e.directives.toString(e);if(l){n.push(l);r=true}else if(e.directives.docStart)r=true}if(r)n.push("---");const i=X1t.createStringifyContext(e,t);const{commentString:o}=i.options;if(e.commentBefore){if(n.length!==1)n.unshift("");const l=o(e.commentBefore);n.unshift(fae.indentComment(l,""))}let a=false;let s=null;if(e.contents){if(hTo.isNode(e.contents)){if(e.contents.spaceBefore&&r)n.push("");if(e.contents.commentBefore){const d=o(e.contents.commentBefore);n.push(fae.indentComment(d,""))}i.forceBlockIndent=!!e.comment;s=e.contents.comment}const l=s?void 0:()=>a=true;let u=X1t.stringify(e.contents,i,()=>s=null,l);if(s)u+=fae.lineComment(u,"",o(s));if((u[0]==="|"||u[0]===">")&&n[n.length-1]==="---"){n[n.length-1]=`--- ${u}`}else n.push(u)}else{n.push(X1t.stringify(e.contents,i))}if(e.directives?.docEnd){if(e.comment){const l=o(e.comment);if(l.includes("\n")){n.push("...");n.push(fae.indentComment(l,""))}else{n.push(`... ${l}`)}}else{n.push("...")}}else{let l=e.comment;if(l&&a)l=l.replace(/^\n+/,"");if(l){if((!a||s)&&n[n.length-1]!=="")n.push("");n.push(fae.indentComment(o(l),""))}}return n.join("\n")+"\n"}Fgr.stringifyDocument=pTo});var hae=_r(Ogr=>{"use strict";var mTo=Zoe();var mY=_4e();var sT=ac();var gTo=CF();var yTo=_F();var bTo=q1t();var xTo=Ngr();var j1t=y4e();var vTo=Qxt();var _To=Joe();var K1t=Jxt();var Z1t=class e{constructor(t,n,r){this.commentBefore=null;this.comment=null;this.errors=[];this.warnings=[];Object.defineProperty(this,sT.NODE_TYPE,{value:sT.DOC});let i=null;if(typeof n==="function"||Array.isArray(n)){i=n}else if(r===void 0&&n){r=n;n=void 0}const o=Object.assign({intAsBigInt:false,keepSourceTokens:false,logLevel:"warn",prettyErrors:true,strict:true,stringKeys:false,uniqueKeys:true,version:"1.2"},r);this.options=o;let{version:a}=o;if(r?._directives){this.directives=r._directives.atDocument();if(this.directives.yaml.explicit)a=this.directives.yaml.version}else this.directives=new K1t.Directives({version:a});this.setSchema(a,r);this.contents=t===void 0?null:this.createNode(t,i,r)}clone(){const t=Object.create(e.prototype,{[sT.NODE_TYPE]:{value:sT.DOC}});t.commentBefore=this.commentBefore;t.comment=this.comment;t.errors=this.errors.slice();t.warnings=this.warnings.slice();t.options=Object.assign({},this.options);if(this.directives)t.directives=this.directives.clone();t.schema=this.schema.clone();t.contents=sT.isNode(this.contents)?this.contents.clone(t.schema):this.contents;if(this.range)t.range=this.range.slice();return t}add(t){if(gY(this.contents))this.contents.add(t)}addIn(t,n){if(gY(this.contents))this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=j1t.anchorNames(this);t.anchor=!n||r.has(n)?j1t.findNewAnchor(n||"a",r):n}return new mTo.Alias(t.anchor)}createNode(t,n,r){let i=void 0;if(typeof n==="function"){t=n.call({"":t},"",t);i=n}else if(Array.isArray(n)){const w=C=>typeof C==="number"||C instanceof String||C instanceof Number;const _=n.filter(w).map(String);if(_.length>0)n=n.concat(_);i=n}else if(r===void 0&&n){r=n;n=void 0}const{aliasDuplicateObjects:o,anchorPrefix:a,flow:s,keepUndefined:l,onTagObj:u,tag:d}=r??{};const{onAnchor:f,setAnchors:h,sourceObjects:m}=j1t.createNodeAnchors(this,a||"a");const g={aliasDuplicateObjects:o??true,keepUndefined:l??false,onAnchor:f,onTagObj:u,replacer:i,schema:this.schema,sourceObjects:m};const x=_To.createNode(t,d,g);if(s&&sT.isCollection(x))x.flow=true;h();return x}createPair(t,n,r={}){const i=this.createNode(t,null,r);const o=this.createNode(n,null,r);return new gTo.Pair(i,o)}delete(t){return gY(this.contents)?this.contents.delete(t):false}deleteIn(t){if(mY.isEmptyPath(t)){if(this.contents==null)return false;this.contents=null;return true}return gY(this.contents)?this.contents.deleteIn(t):false}get(t,n){return sT.isCollection(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){if(mY.isEmptyPath(t))return!n&&sT.isScalar(this.contents)?this.contents.value:this.contents;return sT.isCollection(this.contents)?this.contents.getIn(t,n):void 0}has(t){return sT.isCollection(this.contents)?this.contents.has(t):false}hasIn(t){if(mY.isEmptyPath(t))return this.contents!==void 0;return sT.isCollection(this.contents)?this.contents.hasIn(t):false}set(t,n){if(this.contents==null){this.contents=mY.collectionFromPath(this.schema,[t],n)}else if(gY(this.contents)){this.contents.set(t,n)}}setIn(t,n){if(mY.isEmptyPath(t)){this.contents=n}else if(this.contents==null){this.contents=mY.collectionFromPath(this.schema,Array.from(t),n)}else if(gY(this.contents)){this.contents.setIn(t,n)}}setSchema(t,n={}){if(typeof t==="number")t=String(t);let r;switch(t){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new K1t.Directives({version:"1.1"});r={resolveKnownTags:false,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=t;else this.directives=new K1t.Directives({version:t});r={resolveKnownTags:true,schema:"core"};break;case null:if(this.directives)delete this.directives;r=null;break;default:{const i=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new bTo.Schema(Object.assign(r,n));else throw new Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:t,jsonArg:n,mapAsMap:r,maxAliasCount:i,onAnchor:o,reviver:a}={}){const s={anchors:new Map,doc:this,keep:!t,mapAsMap:r===true,mapKeyWarned:false,maxAliasCount:typeof i==="number"?i:100};const l=yTo.toJS(this.contents,n??"",s);if(typeof o==="function")for(const{count:u,res:d}of s.anchors.values())o(d,u);return typeof a==="function"?vTo.applyReviver(a,{"":l},"",l):l}toJSON(t,n){return this.toJS({json:true,jsonArg:t,mapAsMap:false,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return xTo.stringifyDocument(this,t)}};function gY(e){if(sT.isCollection(e))return true;throw new Error("Expected a YAML collection as document contents")}Ogr.Document=Z1t});var gae=_r(mae=>{"use strict";var pae=class extends Error{constructor(t,n,r,i){super();this.name=t;this.code=r;this.message=i;this.pos=n}};var J1t=class extends pae{constructor(t,n,r){super("YAMLParseError",t,n,r)}};var Q1t=class extends pae{constructor(t,n,r){super("YAMLWarning",t,n,r)}};var TTo=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(s=>t.linePos(s));const{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let o=i-1;let a=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(o>=60&&a.length>80){const s=Math.min(o-39,a.length-79);a="\u2026"+a.substring(s);o-=s-1}if(a.length>80)a=a.substring(0,79)+"\u2026";if(r>1&&/^ *$/.test(a.substring(0,o))){let s=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);if(s.length>80)s=s.substring(0,79)+"\u2026\n";a=s+a}if(/[^ ]/.test(a)){let s=1;const l=n.linePos[1];if(l?.line===r&&l.col>i){s=Math.max(1,Math.min(l.col-i,80-o))}const u=" ".repeat(o)+"^".repeat(s);n.message+=`: + +${a} +${u} +`}};mae.YAMLError=pae;mae.YAMLParseError=J1t;mae.YAMLWarning=Q1t;mae.prettifyError=TTo});var yae=_r(Bgr=>{"use strict";function wTo(e,{flow:t,indicator:n,next:r,offset:i,onError:o,parentIndent:a,startOnNewline:s}){let l=false;let u=s;let d=s;let f="";let h="";let m=false;let g=false;let x=null;let w=null;let _=null;let C=null;let A=null;let P=null;let L=null;for(const O of e){if(g){if(O.type!=="space"&&O.type!=="newline"&&O.type!=="comma")o(O.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");g=false}if(x){if(u&&O.type!=="comment"&&O.type!=="newline"){o(x,"TAB_AS_INDENT","Tabs are not allowed as indentation")}x=null}switch(O.type){case"space":if(!t&&(n!=="doc-start"||r?.type!=="flow-collection")&&O.source.includes(" ")){x=O}d=true;break;case"comment":{if(!d)o(O,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const z=O.source.substring(1)||" ";if(!f)f=z;else f+=h+z;h="";u=false;break}case"newline":if(u){if(f)f+=O.source;else if(!P||n!=="seq-item-ind")l=true}else h+=O.source;u=true;m=true;if(w||_)C=O;d=true;break;case"anchor":if(w)o(O,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(O.source.endsWith(":"))o(O.offset+O.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",true);w=O;L??(L=O.offset);u=false;d=false;g=true;break;case"tag":{if(_)o(O,"MULTIPLE_TAGS","A node can have at most one tag");_=O;L??(L=O.offset);u=false;d=false;g=true;break}case n:if(w||_)o(O,"BAD_PROP_ORDER",`Anchors and tags must be after the ${O.source} indicator`);if(P)o(O,"UNEXPECTED_TOKEN",`Unexpected ${O.source} in ${t??"collection"}`);P=O;u=n==="seq-item-ind"||n==="explicit-key-ind";d=false;break;case"comma":if(t){if(A)o(O,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`);A=O;u=false;d=false;break}default:o(O,"UNEXPECTED_TOKEN",`Unexpected ${O.type} token`);u=false;d=false}}const I=e[e.length-1];const N=I?I.offset+I.source.length:i;if(g&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")){o(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space")}if(x&&(u&&x.indent<=a||r?.type==="block-map"||r?.type==="block-seq"))o(x,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:A,found:P,spaceBefore:l,comment:f,hasNewline:m,anchor:w,tag:_,newlineAfterProp:C,end:N,start:L??N}}Bgr.resolveProps=wTo});var nNe=_r(zgr=>{"use strict";function evt(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes("\n"))return true;if(e.end){for(const t of e.end)if(t.type==="newline")return true}return false;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return true;if(t.sep){for(const n of t.sep)if(n.type==="newline")return true}if(evt(t.key)||evt(t.value))return true}return false;default:return true}}zgr.containsNewline=evt});var tvt=_r(Ugr=>{"use strict";var ETo=nNe();function CTo(e,t,n){if(t?.type==="flow-collection"){const r=t.end[0];if(r.indent===e&&(r.source==="]"||r.source==="}")&&ETo.containsNewline(t)){const i="Flow end indicator should be more indented than parent";n(r,"BAD_INDENT",i,true)}}}Ugr.flowIndentCheck=CTo});var nvt=_r($gr=>{"use strict";var Vgr=ac();function STo(e,t,n){const{uniqueKeys:r}=e.options;if(r===false)return false;const i=typeof r==="function"?r:(o,a)=>o===a||Vgr.isScalar(o)&&Vgr.isScalar(a)&&o.value===a.value;return t.some(o=>i(o.key,n))}$gr.mapIncludes=STo});var Xgr=_r(qgr=>{"use strict";var Ggr=CF();var ATo=AF();var Hgr=yae();var kTo=nNe();var Wgr=tvt();var RTo=nvt();var Ygr="All mapping items must start at the same column";function PTo({composeNode:e,composeEmptyNode:t},n,r,i,o){const a=o?.nodeClass??ATo.YAMLMap;const s=new a(n.schema);if(n.atRoot)n.atRoot=false;let l=r.offset;let u=null;for(const d of r.items){const{start:f,key:h,sep:m,value:g}=d;const x=Hgr.resolveProps(f,{indicator:"explicit-key-ind",next:h??m?.[0],offset:l,onError:i,parentIndent:r.indent,startOnNewline:true});const w=!x.found;if(w){if(h){if(h.type==="block-seq")i(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in h&&h.indent!==r.indent)i(l,"BAD_INDENT",Ygr)}if(!x.anchor&&!x.tag&&!m){u=x.end;if(x.comment){if(s.comment)s.comment+="\n"+x.comment;else s.comment=x.comment}continue}if(x.newlineAfterProp||kTo.containsNewline(h)){i(h??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}}else if(x.found?.indent!==r.indent){i(l,"BAD_INDENT",Ygr)}n.atKey=true;const _=x.end;const C=h?e(n,h,x,i):t(n,_,f,null,x,i);if(n.schema.compat)Wgr.flowIndentCheck(r.indent,h,i);n.atKey=false;if(RTo.mapIncludes(n,s.items,C))i(_,"DUPLICATE_KEY","Map keys must be unique");const A=Hgr.resolveProps(m??[],{indicator:"map-value-ind",next:g,offset:C.range[2],onError:i,parentIndent:r.indent,startOnNewline:!h||h.type==="block-scalar"});l=A.end;if(A.found){if(w){if(g?.type==="block-map"&&!A.hasNewline)i(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(n.options.strict&&x.start{"use strict";var ITo=kF();var MTo=yae();var LTo=tvt();function DTo({composeNode:e,composeEmptyNode:t},n,r,i,o){const a=o?.nodeClass??ITo.YAMLSeq;const s=new a(n.schema);if(n.atRoot)n.atRoot=false;if(n.atKey)n.atKey=false;let l=r.offset;let u=null;for(const{start:d,value:f}of r.items){const h=MTo.resolveProps(d,{indicator:"seq-item-ind",next:f,offset:l,onError:i,parentIndent:r.indent,startOnNewline:true});if(!h.found){if(h.anchor||h.tag||f){if(f?.type==="block-seq")i(h.end,"BAD_INDENT","All sequence items must start at the same column");else i(l,"MISSING_CHAR","Sequence item without - indicator")}else{u=h.end;if(h.comment)s.comment=h.comment;continue}}const m=f?e(n,f,h,i):t(n,h.end,d,null,h,i);if(n.schema.compat)LTo.flowIndentCheck(r.indent,f,i);l=m.range[2];s.items.push(m)}s.range=[r.offset,l,u??l];return s}jgr.resolveBlockSeq=DTo});var yY=_r(Zgr=>{"use strict";function FTo(e,t,n,r){let i="";if(e){let o=false;let a="";for(const s of e){const{source:l,type:u}=s;switch(u){case"space":o=true;break;case"comment":{if(n&&!o)r(s,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const d=l.substring(1)||" ";if(!i)i=d;else i+=a+d;a="";break}case"newline":if(i)a+=l;o=true;break;default:r(s,"UNEXPECTED_TOKEN",`Unexpected ${u} at node end`)}t+=l.length}}return{comment:i,offset:t}}Zgr.resolveEnd=FTo});var tyr=_r(eyr=>{"use strict";var NTo=ac();var OTo=CF();var Jgr=AF();var BTo=kF();var zTo=yY();var Qgr=yae();var UTo=nNe();var VTo=nvt();var rvt="Block collections are not allowed within flow collections";var ivt=e=>e&&(e.type==="block-map"||e.type==="block-seq");function $To({composeNode:e,composeEmptyNode:t},n,r,i,o){const a=r.start.source==="{";const s=a?"flow map":"flow sequence";const l=o?.nodeClass??(a?Jgr.YAMLMap:BTo.YAMLSeq);const u=new l(n.schema);u.flow=true;const d=n.atRoot;if(d)n.atRoot=false;if(n.atKey)n.atKey=false;let f=r.offset+r.start.source.length;for(let w=0;w0){const w=zTo.resolveEnd(g,x,n.options.strict,i);if(w.comment){if(u.comment)u.comment+="\n"+w.comment;else u.comment=w.comment}u.range=[r.offset,x,w.offset]}else{u.range=[r.offset,x,x]}return u}eyr.resolveFlowCollection=$To});var ryr=_r(nyr=>{"use strict";var GTo=ac();var HTo=sp();var WTo=AF();var YTo=kF();var qTo=Xgr();var XTo=Kgr();var jTo=tyr();function ovt(e,t,n,r,i,o){const a=n.type==="block-map"?qTo.resolveBlockMap(e,t,n,r,o):n.type==="block-seq"?XTo.resolveBlockSeq(e,t,n,r,o):jTo.resolveFlowCollection(e,t,n,r,o);const s=a.constructor;if(i==="!"||i===s.tagName){a.tag=s.tagName;return a}if(i)a.tag=i;return a}function KTo(e,t,n,r,i){const o=r.tag;const a=!o?null:t.directives.tagName(o.source,h=>i(o,"TAG_RESOLVE_FAILED",h));if(n.type==="block-seq"){const{anchor:h,newlineAfterProp:m}=r;const g=h&&o?h.offset>o.offset?h:o:h??o;if(g&&(!m||m.offseth.tag===a&&h.collection===s);if(!l){const h=t.schema.knownTags[a];if(h?.collection===s){t.schema.tags.push(Object.assign({},h,{default:false}));l=h}else{if(h){i(o,"BAD_COLLECTION_TYPE",`${h.tag} used for ${s} collection, but expects ${h.collection??"scalar"}`,true)}else{i(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,true)}return ovt(e,t,n,i,a)}}const u=ovt(e,t,n,i,a,l);const d=l.resolve?.(u,h=>i(o,"TAG_RESOLVE_FAILED",h),t.options)??u;const f=GTo.isNode(d)?d:new HTo.Scalar(d);f.range=u.range;f.tag=a;if(l?.format)f.format=l.format;return f}nyr.composeCollection=KTo});var svt=_r(iyr=>{"use strict";var avt=sp();function ZTo(e,t,n){const r=t.offset;const i=JTo(t,e.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};const o=i.mode===">"?avt.Scalar.BLOCK_FOLDED:avt.Scalar.BLOCK_LITERAL;const a=t.source?QTo(t.source):[];let s=a.length;for(let x=a.length-1;x>=0;--x){const w=a[x][1];if(w===""||w==="\r")s=x;else break}if(s===0){const x=i.chomp==="+"&&a.length>0?"\n".repeat(Math.max(1,a.length-1)):"";let w=r+i.length;if(t.source)w+=t.source.length;return{value:x,type:o,comment:i.comment,range:[r,w,w]}}let l=t.indent+i.indent;let u=t.offset+i.length;let d=0;for(let x=0;xl)l=w.length}else{if(w.length=s;--x){if(a[x][0].length>l)s=x+1}let f="";let h="";let m=false;for(let x=0;xl||_[0]===" "){if(h===" ")h="\n";else if(!m&&h==="\n")h="\n\n";f+=h+w.slice(l)+_;h="\n";m=true}else if(_===""){if(h==="\n")f+="\n";else h="\n"}else{f+=h+_;h=" ";m=false}}switch(i.chomp){case"-":break;case"+":for(let x=s;x{"use strict";var lvt=sp();var ewo=yY();function two(e,t,n){const{offset:r,type:i,source:o,end:a}=e;let s;let l;const u=(h,m,g)=>n(r+h,m,g);switch(i){case"scalar":s=lvt.Scalar.PLAIN;l=nwo(o,u);break;case"single-quoted-scalar":s=lvt.Scalar.QUOTE_SINGLE;l=rwo(o,u);break;case"double-quoted-scalar":s=lvt.Scalar.QUOTE_DOUBLE;l=iwo(o,u);break;default:n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`);return{value:"",type:null,comment:"",range:[r,r+o.length,r+o.length]}}const d=r+o.length;const f=ewo.resolveEnd(a,d,t,n);return{value:l,type:s,comment:f.comment,range:[r,d,f.offset]}}function nwo(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}if(n)t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`);return oyr(e)}function rwo(e,t){if(e[e.length-1]!=="'"||e.length===1)t(e.length,"MISSING_CHAR","Missing closing 'quote");return oyr(e.slice(1,-1)).replace(/''/g,"'")}function oyr(e){let t,n;try{t=new RegExp("(.*?)(?o?e.slice(o,r+1):i}else{n+=i}}if(e[e.length-1]!=='"'||e.length===1)t(e.length,"MISSING_CHAR",'Missing closing "quote');return n}function owo(e,t){let n="";let r=e[t+1];while(r===" "||r===" "||r==="\n"||r==="\r"){if(r==="\r"&&e[t+2]!=="\n")break;if(r==="\n")n+="\n";t+=1;r=e[t+1]}if(!n)n=" ";return{fold:n,offset:t}}var awo={"0":"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:"\n",r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function swo(e,t,n,r){const i=e.substr(t,n);const o=i.length===n&&/^[0-9a-fA-F]+$/.test(i);const a=o?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{const s=e.substr(t-2,n+2);r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${s}`);return s}}ayr.resolveFlowScalar=two});var cyr=_r(lyr=>{"use strict";var Z8=ac();var syr=sp();var lwo=svt();var cwo=cvt();function uwo(e,t,n,r){const{value:i,type:o,comment:a,range:s}=t.type==="block-scalar"?lwo.resolveBlockScalar(e,t,r):cwo.resolveFlowScalar(t,e.options.strict,r);const l=n?e.directives.tagName(n.source,f=>r(n,"TAG_RESOLVE_FAILED",f)):null;let u;if(e.options.stringKeys&&e.atKey){u=e.schema[Z8.SCALAR]}else if(l)u=dwo(e.schema,i,l,n,r);else if(t.type==="scalar")u=fwo(e,i,t,r);else u=e.schema[Z8.SCALAR];let d;try{const f=u.resolve(i,h=>r(n??t,"TAG_RESOLVE_FAILED",h),e.options);d=Z8.isScalar(f)?f:new syr.Scalar(f)}catch(f){const h=f instanceof Error?f.message:String(f);r(n??t,"TAG_RESOLVE_FAILED",h);d=new syr.Scalar(i)}d.range=s;d.source=i;if(o)d.type=o;if(l)d.tag=l;if(u.format)d.format=u.format;if(a)d.comment=a;return d}function dwo(e,t,n,r,i){if(n==="!")return e[Z8.SCALAR];const o=[];for(const s of e.tags){if(!s.collection&&s.tag===n){if(s.default&&s.test)o.push(s);else return s}}for(const s of o)if(s.test?.test(t))return s;const a=e.knownTags[n];if(a&&!a.collection){e.tags.push(Object.assign({},a,{default:false,test:void 0}));return a}i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str");return e[Z8.SCALAR]}function fwo({atKey:e,directives:t,schema:n},r,i,o){const a=n.tags.find(s=>(s.default===true||e&&s.default==="key")&&s.test?.test(r))||n[Z8.SCALAR];if(n.compat){const s=n.compat.find(l=>l.default&&l.test?.test(r))??n[Z8.SCALAR];if(a.tag!==s.tag){const l=t.tagString(a.tag);const u=t.tagString(s.tag);const d=`Value may be parsed as either ${l} or ${u}`;o(i,"TAG_RESOLVE_FAILED",d,true)}}return a}lyr.composeScalar=uwo});var dyr=_r(uyr=>{"use strict";function hwo(e,t,n){if(t){n??(n=t.length);for(let r=n-1;r>=0;--r){let i=t[r];switch(i.type){case"space":case"comment":case"newline":e-=i.source.length;continue}i=t[++r];while(i?.type==="space"){e+=i.source.length;i=t[++r]}break}}return e}uyr.emptyScalarPosition=hwo});var pyr=_r(dvt=>{"use strict";var pwo=Zoe();var mwo=ac();var gwo=ryr();var fyr=cyr();var ywo=yY();var bwo=dyr();var xwo={composeNode:hyr,composeEmptyNode:uvt};function hyr(e,t,n,r){const i=e.atKey;const{spaceBefore:o,comment:a,anchor:s,tag:l}=n;let u;let d=true;switch(t.type){case"alias":u=vwo(e,t,r);if(s||l)r(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":u=fyr.composeScalar(e,t,l,r);if(s)u.anchor=s.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":try{u=gwo.composeCollection(xwo,e,t,n,r);if(s)u.anchor=s.source.substring(1)}catch(f){const h=f instanceof Error?f.message:String(f);r(t,"RESOURCE_EXHAUSTION",h)}break;default:{const f=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",f);d=false}}u??(u=uvt(e,t.offset,void 0,null,n,r));if(s&&u.anchor==="")r(s,"BAD_ALIAS","Anchor cannot be an empty string");if(i&&e.options.stringKeys&&(!mwo.isScalar(u)||typeof u.value!=="string"||u.tag&&u.tag!=="tag:yaml.org,2002:str")){const f="With stringKeys, all keys must be strings";r(l??t,"NON_STRING_KEY",f)}if(o)u.spaceBefore=true;if(a){if(t.type==="scalar"&&t.source==="")u.comment=a;else u.commentBefore=a}if(e.options.keepSourceTokens&&d)u.srcToken=t;return u}function uvt(e,t,n,r,{spaceBefore:i,comment:o,anchor:a,tag:s,end:l},u){const d={type:"scalar",offset:bwo.emptyScalarPosition(t,n,r),indent:-1,source:""};const f=fyr.composeScalar(e,d,s,u);if(a){f.anchor=a.source.substring(1);if(f.anchor==="")u(a,"BAD_ALIAS","Anchor cannot be an empty string")}if(i)f.spaceBefore=true;if(o){f.comment=o;f.range[2]=l}return f}function vwo({options:e},{offset:t,source:n,end:r},i){const o=new pwo.Alias(n.substring(1));if(o.source==="")i(t,"BAD_ALIAS","Alias cannot be an empty string");if(o.source.endsWith(":"))i(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",true);const a=t+n.length;const s=ywo.resolveEnd(r,a,e.strict,i);o.range=[t,a,s.offset];if(s.comment)o.comment=s.comment;return o}dvt.composeEmptyNode=uvt;dvt.composeNode=hyr});var yyr=_r(gyr=>{"use strict";var _wo=hae();var myr=pyr();var Two=yY();var wwo=yae();function Ewo(e,t,{offset:n,start:r,value:i,end:o},a){const s=Object.assign({_directives:t},e);const l=new _wo.Document(void 0,s);const u={atKey:false,atRoot:true,directives:l.directives,options:l.options,schema:l.schema};const d=wwo.resolveProps(r,{indicator:"doc-start",next:i??o?.[0],offset:n,onError:a,parentIndent:0,startOnNewline:true});if(d.found){l.directives.docStart=true;if(i&&(i.type==="block-map"||i.type==="block-seq")&&!d.hasNewline)a(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}l.contents=i?myr.composeNode(u,i,d,a):myr.composeEmptyNode(u,d.end,r,null,d,a);const f=l.contents.range[2];const h=Two.resolveEnd(o,f,false,a);if(h.comment)l.comment=h.comment;l.range=[n,f,h.offset];return l}gyr.composeDoc=Ewo});var hvt=_r(vyr=>{"use strict";var Cwo=mce("process");var Swo=Jxt();var Awo=hae();var bae=gae();var byr=ac();var kwo=yyr();var Rwo=yY();function xae(e){if(typeof e==="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n==="string"?n.length:1)]}function xyr(e){let t="";let n=false;let r=false;for(let i=0;i{const a=xae(n);if(o)this.warnings.push(new bae.YAMLWarning(a,r,i));else this.errors.push(new bae.YAMLParseError(a,r,i))};this.directives=new Swo.Directives({version:t.version||"1.2"});this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:i}=xyr(this.prelude);if(r){const o=t.contents;if(n){t.comment=t.comment?`${t.comment} +${r}`:r}else if(i||t.directives.docStart||!o){t.commentBefore=r}else if(byr.isCollection(o)&&!o.flow&&o.items.length>0){let a=o.items[0];if(byr.isPair(a))a=a.key;const s=a.commentBefore;a.commentBefore=s?`${r} +${s}`:r}else{const a=o.commentBefore;o.commentBefore=a?`${r} +${a}`:r}}if(n){for(let o=0;o{const o=xae(t);o[0]+=n;this.onError(o,"BAD_DIRECTIVE",r,i)});this.prelude.push(t.source);this.atDirectives=true;break;case"document":{const n=kwo.composeDoc(this.options,this.directives,t,this.onError);if(this.atDirectives&&!n.directives.docStart)this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line");this.decorate(n,false);if(this.doc)yield this.doc;this.doc=n;this.atDirectives=false;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message;const r=new bae.YAMLParseError(xae(t),"UNEXPECTED_TOKEN",n);if(this.atDirectives||!this.doc)this.errors.push(r);else this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){const r="Unexpected doc-end without preceding document";this.errors.push(new bae.YAMLParseError(xae(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=true;const n=Rwo.resolveEnd(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);this.decorate(this.doc,true);if(n.comment){const r=this.doc.comment;this.doc.comment=r?`${r} +${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new bae.YAMLParseError(xae(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=false,n=-1){if(this.doc){this.decorate(this.doc,true);yield this.doc;this.doc=null}else if(t){const r=Object.assign({_directives:this.directives},this.options);const i=new Awo.Document(void 0,r);if(this.atDirectives)this.onError(n,"MISSING_CHAR","Missing directives-end indicator line");i.range=[0,n,n];this.decorate(i,false);yield i}}};vyr.Composer=fvt});var wyr=_r(rNe=>{"use strict";var Pwo=svt();var Iwo=cvt();var Mwo=gae();var _yr=nae();function Lwo(e,t=true,n){if(e){const r=(i,o,a)=>{const s=typeof i==="number"?i:Array.isArray(i)?i[0]:i.offset;if(n)n(s,o,a);else throw new Mwo.YAMLParseError([s,s+1],o,a)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Iwo.resolveFlowScalar(e,t,r);case"block-scalar":return Pwo.resolveBlockScalar({options:{strict:t}},e,r)}}return null}function Dwo(e,t){const{implicitKey:n=false,indent:r,inFlow:i=false,offset:o=-1,type:a="PLAIN"}=t;const s=_yr.stringifyString({type:a,value:e},{implicitKey:n,indent:r>0?" ".repeat(r):"",inFlow:i,options:{blockQuote:true,lineWidth:-1}});const l=t.end??[{type:"newline",offset:-1,indent:r,source:"\n"}];switch(s[0]){case"|":case">":{const u=s.indexOf("\n");const d=s.substring(0,u);const f=s.substring(u+1)+"\n";const h=[{type:"block-scalar-header",offset:o,indent:r,source:d}];if(!Tyr(h,l))h.push({type:"newline",offset:-1,indent:r,source:"\n"});return{type:"block-scalar",offset:o,indent:r,props:h,source:f}}case'"':return{type:"double-quoted-scalar",offset:o,indent:r,source:s,end:l};case"'":return{type:"single-quoted-scalar",offset:o,indent:r,source:s,end:l};default:return{type:"scalar",offset:o,indent:r,source:s,end:l}}}function Fwo(e,t,n={}){let{afterKey:r=false,implicitKey:i=false,inFlow:o=false,type:a}=n;let s="indent"in e?e.indent:null;if(r&&typeof s==="number")s+=2;if(!a)switch(e.type){case"single-quoted-scalar":a="QUOTE_SINGLE";break;case"double-quoted-scalar":a="QUOTE_DOUBLE";break;case"block-scalar":{const u=e.props[0];if(u.type!=="block-scalar-header")throw new Error("Invalid block scalar header");a=u.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:a="PLAIN"}const l=_yr.stringifyString({type:a,value:t},{implicitKey:i||s===null,indent:s!==null&&s>0?" ".repeat(s):"",inFlow:o,options:{blockQuote:true,lineWidth:-1}});switch(l[0]){case"|":case">":Nwo(e,l);break;case'"':pvt(e,l,"double-quoted-scalar");break;case"'":pvt(e,l,"single-quoted-scalar");break;default:pvt(e,l,"scalar")}}function Nwo(e,t){const n=t.indexOf("\n");const r=t.substring(0,n);const i=t.substring(n+1)+"\n";if(e.type==="block-scalar"){const o=e.props[0];if(o.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o.source=r;e.source=i}else{const{offset:o}=e;const a="indent"in e?e.indent:-1;const s=[{type:"block-scalar-header",offset:o,indent:a,source:r}];if(!Tyr(s,"end"in e?e.end:void 0))s.push({type:"newline",offset:-1,indent:a,source:"\n"});for(const l of Object.keys(e))if(l!=="type"&&l!=="offset")delete e[l];Object.assign(e,{type:"block-scalar",indent:a,props:s,source:i})}}function Tyr(e,t){if(t)for(const n of t)switch(n.type){case"space":case"comment":e.push(n);break;case"newline":e.push(n);return true}return false}function pvt(e,t,n){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=n;e.source=t;break;case"block-scalar":{const r=e.props.slice(1);let i=t.length;if(e.props[0].type==="block-scalar-header")i-=e.props[0].source.length;for(const o of r)o.offset+=i;delete e.props;Object.assign(e,{type:n,source:t,end:r});break}case"block-map":case"block-seq":{const r=e.offset+t.length;const i={type:"newline",offset:r,indent:e.indent,source:"\n"};delete e.items;Object.assign(e,{type:n,source:t,end:[i]});break}default:{const r="indent"in e?e.indent:-1;const i="end"in e&&Array.isArray(e.end)?e.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(const o of Object.keys(e))if(o!=="type"&&o!=="offset")delete e[o];Object.assign(e,{type:n,indent:r,source:t,end:i})}}}rNe.createScalarToken=Dwo;rNe.resolveAsScalar=Lwo;rNe.setScalarValue=Fwo});var Cyr=_r(Eyr=>{"use strict";var Owo=e=>"type"in e?oNe(e):iNe(e);function oNe(e){switch(e.type){case"block-scalar":{let t="";for(const n of e.props)t+=oNe(n);return t+e.source}case"block-map":case"block-seq":{let t="";for(const n of e.items)t+=iNe(n);return t}case"flow-collection":{let t=e.start.source;for(const n of e.items)t+=iNe(n);for(const n of e.end)t+=n.source;return t}case"document":{let t=iNe(e);if(e.end)for(const n of e.end)t+=n.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(const n of e.end)t+=n.source;return t}}}function iNe({start:e,key:t,sep:n,value:r}){let i="";for(const o of e)i+=o.source;if(t)i+=oNe(t);if(n)for(const o of n)i+=o.source;if(r)i+=oNe(r);return i}Eyr.stringify=Owo});var Ryr=_r(kyr=>{"use strict";var mvt=Symbol("break visit");var Bwo=Symbol("skip children");var Syr=Symbol("remove item");function J8(e,t){if("type"in e&&e.type==="document")e={start:e.start,value:e.value};Ayr(Object.freeze([]),e,t)}J8.BREAK=mvt;J8.SKIP=Bwo;J8.REMOVE=Syr;J8.itemAtPath=(e,t)=>{let n=e;for(const[r,i]of t){const o=n?.[r];if(o&&"items"in o){n=o.items[i]}else return void 0}return n};J8.parentCollection=(e,t)=>{const n=J8.itemAtPath(e,t.slice(0,-1));const r=t[t.length-1][0];const i=n?.[r];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function Ayr(e,t,n){let r=n(t,e);if(typeof r==="symbol")return r;for(const i of["key","value"]){const o=t[i];if(o&&"items"in o){for(let a=0;a{"use strict";var gvt=wyr();var zwo=Cyr();var Uwo=Ryr();var yvt="\uFEFF";var bvt="";var xvt="";var vvt="";var Vwo=e=>!!e&&"items"in e;var $wo=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function Gwo(e){switch(e){case yvt:return"";case bvt:return"";case xvt:return"";case vvt:return"";default:return JSON.stringify(e)}}function Hwo(e){switch(e){case yvt:return"byte-order-mark";case bvt:return"doc-mode";case xvt:return"flow-error-end";case vvt:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case"\n":case"\r\n":return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}Xx.createScalarToken=gvt.createScalarToken;Xx.resolveAsScalar=gvt.resolveAsScalar;Xx.setScalarValue=gvt.setScalarValue;Xx.stringify=zwo.stringify;Xx.visit=Uwo.visit;Xx.BOM=yvt;Xx.DOCUMENT=bvt;Xx.FLOW_END=xvt;Xx.SCALAR=vvt;Xx.isCollection=Vwo;Xx.isScalar=$wo;Xx.prettyToken=Gwo;Xx.tokenType=Hwo});var wvt=_r(Iyr=>{"use strict";var vae=aNe();function g2(e){switch(e){case void 0:case" ":case"\n":case"\r":case" ":return true;default:return false}}var Pyr=new Set("0123456789ABCDEFabcdef");var Wwo=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()");var sNe=new Set(",[]{}");var Ywo=new Set(" ,[]{}\n\r ");var _vt=e=>!e||Ywo.has(e);var Tvt=class{constructor(){this.atEnd=false;this.blockScalarIndent=-1;this.blockScalarKeep=false;this.buffer="";this.flowKey=false;this.flowLevel=0;this.indentNext=0;this.indentValue=0;this.lineEndPos=null;this.next=null;this.pos=0}*lex(t,n=false){if(t){if(typeof t!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t;this.lineEndPos=null}this.atEnd=!n;let r=this.next??"stream";while(r&&(n||this.hasChars(1)))r=yield*this.parseNext(r)}atLineEnd(){let t=this.pos;let n=this.buffer[t];while(n===" "||n===" ")n=this.buffer[++t];if(!n||n==="#"||n==="\n")return true;if(n==="\r")return this.buffer[t+1]==="\n";return false}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let r=0;while(n===" ")n=this.buffer[++r+t];if(n==="\r"){const i=this.buffer[r+t+1];if(i==="\n"||!i&&!this.atEnd)return t+r+1}return n==="\n"||r>=this.indentNext||!n&&!this.atEnd?t+r:-1}if(n==="-"||n==="."){const r=this.buffer.substr(t,3);if((r==="---"||r==="...")&&g2(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;if(typeof t!=="number"||t!==-1&&tthis.indentValue&&!g2(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){const[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&g2(n)){const r=(yield*this.pushCount(1))+(yield*this.pushSpaces(true));this.indentNext=this.indentValue+1;this.indentValue+=r;return"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(true);const t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:yield*this.pushNewline();return yield*this.parseLineStart();case"{":case"[":yield*this.pushCount(1);this.flowKey=false;this.flowLevel=1;return"flow";case"}":case"]":yield*this.pushCount(1);return"doc";case"*":yield*this.pushUntil(_vt);return"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":n+=yield*this.parseBlockScalarHeader();n+=yield*this.pushSpaces(true);yield*this.pushCount(t.length-n);yield*this.pushNewline();return yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n;let r=-1;do{t=yield*this.pushNewline();if(t>0){n=yield*this.pushSpaces(false);this.indentValue=r=n}else{n=0}n+=yield*this.pushSpaces(true)}while(t+n>0);const i=this.getLine();if(i===null)return this.setNext("flow");if(r!==-1&&r"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>g2(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1;let n=0;let r;e:for(let o=this.pos;r=this.buffer[o];++o){switch(r){case" ":n+=1;break;case"\n":t=o;n=0;break;case"\r":{const a=this.buffer[o+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a==="\n")break}default:break e}}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=n;else{this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext)}do{const o=this.continueScalar(t+1);if(o===-1)break;t=this.buffer.indexOf("\n",o)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let i=t+1;r=this.buffer[i];while(r===" ")r=this.buffer[++i];if(r===" "){while(r===" "||r===" "||r==="\r"||r==="\n")r=this.buffer[++i];t=i-1}else if(!this.blockScalarKeep){do{let o=t-1;let a=this.buffer[o];if(a==="\r")a=this.buffer[--o];const s=o;while(a===" ")a=this.buffer[--o];if(a==="\n"&&o>=this.pos&&o+1+n>s)t=o;else break}while(true)}yield vae.SCALAR;yield*this.pushToIndex(t+1,true);return yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1;let r=this.pos-1;let i;while(i=this.buffer[++r]){if(i===":"){const o=this.buffer[r+1];if(g2(o)||t&&sNe.has(o))break;n=r}else if(g2(i)){let o=this.buffer[r+1];if(i==="\r"){if(o==="\n"){r+=1;i="\n";o=this.buffer[r+1]}else n=r}if(o==="#"||t&&sNe.has(o))break;if(i==="\n"){const a=this.continueScalar(r+1);if(a===-1)break;r=Math.max(r,a-2)}}else{if(t&&sNe.has(i))break;n=r}}if(!i&&!this.atEnd)return this.setNext("plain-scalar");yield vae.SCALAR;yield*this.pushToIndex(n+1,true);return t?"flow":"doc"}*pushCount(t){if(t>0){yield this.buffer.substr(this.pos,t);this.pos+=t;return t}return 0}*pushToIndex(t,n){const r=this.buffer.slice(this.pos,t);if(r){yield r;this.pos+=r.length;return r.length}else if(n)yield"";return 0}*pushIndicators(){let t=0;e:while(true){switch(this.charAt(0)){case"!":t+=yield*this.pushTag();t+=yield*this.pushSpaces(true);continue e;case"&":t+=yield*this.pushUntil(_vt);t+=yield*this.pushSpaces(true);continue e;case"-":case"?":case":":{const n=this.flowLevel>0;const r=this.charAt(1);if(g2(r)||n&&sNe.has(r)){if(!n)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=false;t+=yield*this.pushCount(1);t+=yield*this.pushSpaces(true);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2;let n=this.buffer[t];while(!g2(n)&&n!==">")n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,false)}else{let t=this.pos+1;let n=this.buffer[t];while(n){if(Wwo.has(n))n=this.buffer[++t];else if(n==="%"&&Pyr.has(this.buffer[t+1])&&Pyr.has(this.buffer[t+2])){n=this.buffer[t+=3]}else break}return yield*this.pushToIndex(t,false)}}*pushNewline(){const t=this.buffer[this.pos];if(t==="\n")return yield*this.pushCount(1);else if(t==="\r"&&this.charAt(1)==="\n")return yield*this.pushCount(2);else return 0}*pushSpaces(t){let n=this.pos-1;let r;do{r=this.buffer[++n]}while(r===" "||t&&r===" ");const i=n-this.pos;if(i>0){yield this.buffer.substr(this.pos,i);this.pos=n}return i}*pushUntil(t){let n=this.pos;let r=this.buffer[n];while(!t(r))r=this.buffer[++n];return yield*this.pushToIndex(n,false)}};Iyr.Lexer=Tvt});var Cvt=_r(Myr=>{"use strict";var Evt=class{constructor(){this.lineStarts=[];this.addNewLine=t=>this.lineStarts.push(t);this.linePos=t=>{let n=0;let r=this.lineStarts.length;while(n>1;if(this.lineStarts[o]{"use strict";var qwo=mce("process");var Lyr=aNe();var Xwo=wvt();function RF(e,t){for(let n=0;n=0){switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}}while(e[++t]?.type==="space"){}return e.splice(t,e.length)}function cNe(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n0)yield*this.pop()}get sourceToken(){const t={type:this.type,offset:this.offset,indent:this.indent,source:this.source};return t}*step(){const t=this.peek(1);if(this.type==="doc-end"&&t?.type!=="doc-end"){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const n=t??this.stack.pop();if(!n){const r="Tried to pop an empty stack";yield{type:"error",offset:this.offset,source:"",message:r}}else if(this.stack.length===0){yield n}else{const r=this.peek(1);if(n.type==="block-scalar"){n.indent="indent"in r?r.indent:0}else if(n.type==="flow-collection"&&r.type==="document"){n.indent=0}if(n.type==="flow-collection")Fyr(n);switch(r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{const i=r.items[r.items.length-1];if(i.value){r.items.push({start:[],key:n,sep:[]});this.onKeyLine=true;return}else if(i.sep){i.value=n}else{Object.assign(i,{key:n,sep:[]});this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{const i=r.items[r.items.length-1];if(i.value)r.items.push({start:[],value:n});else i.value=n;break}case"flow-collection":{const i=r.items[r.items.length-1];if(!i||i.value)r.items.push({start:[],key:n,sep:[]});else if(i.sep)i.value=n;else Object.assign(i,{key:n,sep:[]});return}default:yield*this.pop();yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const i=n.items[n.items.length-1];if(i&&!i.sep&&!i.value&&i.start.length>0&&Dyr(i.start)===-1&&(n.indent===0||i.start.every(o=>o.type!=="comment"||o.indent=t.indent){const r=!this.onKeyLine&&this.indent===t.indent;const i=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let o=[];if(i&&n.sep&&!n.value){const a=[];for(let s=0;st.indent)a.length=0;break;default:a.length=0}}if(a.length>=2)o=n.sep.splice(a[1])}switch(this.type){case"anchor":case"tag":if(i||n.value){o.push(this.sourceToken);t.items.push({start:o});this.onKeyLine=true}else if(n.sep){n.sep.push(this.sourceToken)}else{n.start.push(this.sourceToken)}return;case"explicit-key-ind":if(!n.sep&&!n.explicitKey){n.start.push(this.sourceToken);n.explicitKey=true}else if(i||n.value){o.push(this.sourceToken);t.items.push({start:o,explicitKey:true})}else{this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:true}]})}this.onKeyLine=true;return;case"map-value-ind":if(n.explicitKey){if(!n.sep){if(RF(n.start,"newline")){Object.assign(n,{key:null,sep:[this.sourceToken]})}else{const a=bY(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]})}}else if(n.value){t.items.push({start:[],key:null,sep:[this.sourceToken]})}else if(RF(n.sep,"map-value-ind")){this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else if(Nyr(n.key)&&!RF(n.sep,"newline")){const a=bY(n.start);const s=n.key;const l=n.sep;l.push(this.sourceToken);delete n.key;delete n.sep;this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:s,sep:l}]})}else if(o.length>0){n.sep=n.sep.concat(o,this.sourceToken)}else{n.sep.push(this.sourceToken)}}else{if(!n.sep){Object.assign(n,{key:null,sep:[this.sourceToken]})}else if(n.value||i){t.items.push({start:o,key:null,sep:[this.sourceToken]})}else if(RF(n.sep,"map-value-ind")){this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]})}else{n.sep.push(this.sourceToken)}}this.onKeyLine=true;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const a=this.flowScalar(this.type);if(i||n.value){t.items.push({start:o,key:a,sep:[]});this.onKeyLine=true}else if(n.sep){this.stack.push(a)}else{Object.assign(n,{key:a,sep:[]});this.onKeyLine=true}return}default:{const a=this.startBlockValue(t);if(a){if(a.type==="block-seq"){if(!n.explicitKey&&n.sep&&!RF(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(r){t.items.push({start:o})}this.stack.push(a);return}}}}yield*this.pop();yield*this.step()}*blockSequence(t){const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const r="end"in n.value?n.value.end:void 0;const i=Array.isArray(r)?r[r.length-1]:void 0;if(i?.type==="comment")r?.push(this.sourceToken);else t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const r=t.items[t.items.length-2];const i=r?.value?.end;if(Array.isArray(i)){cNe(i,n.start);i.push(this.sourceToken);t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;if(n.value||RF(n.start,"seq-item-ind"))t.items.push({start:[this.sourceToken]});else n.start.push(this.sourceToken);return}if(this.indent>t.indent){const r=this.startBlockValue(t);if(r){this.stack.push(r);return}}yield*this.pop();yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let r;do{yield*this.pop();r=this.peek(1)}while(r?.type==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!n||n.sep)t.items.push({start:[this.sourceToken]});else n.start.push(this.sourceToken);return;case"map-value-ind":if(!n||n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!n||n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const i=this.flowScalar(this.type);if(!n||n.value)t.items.push({start:[],key:i,sep:[]});else if(n.sep)this.stack.push(i);else Object.assign(n,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const r=this.startBlockValue(t);if(r)this.stack.push(r);else{yield*this.pop();yield*this.step()}}else{const r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===t.indent||this.type==="newline"&&!r.items[r.items.length-1].sep)){yield*this.pop();yield*this.step()}else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){const i=lNe(r);const o=bY(i);Fyr(t);const a=t.end.splice(1,t.end.length);a.push(this.sourceToken);const s={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:o,key:t,sep:a}]};this.onKeyLine=true;this.stack[this.stack.length-1]=s}else{yield*this.lineEnd(t)}}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf("\n")+1;while(n!==0){this.onNewLine(this.offset+n);n=this.source.indexOf("\n",n)+1}}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=true;const n=lNe(t);const r=bY(n);r.push(this.sourceToken);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:true}]}}case"map-value-ind":{this.onKeyLine=true;const n=lNe(t);const r=bY(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){if(this.type!=="comment")return false;if(this.indent<=n)return false;return t.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(t){if(this.type!=="doc-mode"){if(t.end)t.end.push(this.sourceToken);else t.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop();yield*this.step();break;case"newline":this.onKeyLine=false;case"space":case"comment":default:if(t.end)t.end.push(this.sourceToken);else t.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}};Oyr.Parser=Svt});var $yr=_r(Tae=>{"use strict";var Byr=hvt();var jwo=hae();var _ae=gae();var Kwo=d1t();var Zwo=ac();var Jwo=Cvt();var zyr=Avt();function Uyr(e){const t=e.prettyErrors!==false;const n=e.lineCounter||t&&new Jwo.LineCounter||null;return{lineCounter:n,prettyErrors:t}}function Qwo(e,t={}){const{lineCounter:n,prettyErrors:r}=Uyr(t);const i=new zyr.Parser(n?.addNewLine);const o=new Byr.Composer(t);const a=Array.from(o.compose(i.parse(e)));if(r&&n)for(const s of a){s.errors.forEach(_ae.prettifyError(e,n));s.warnings.forEach(_ae.prettifyError(e,n))}if(a.length>0)return a;return Object.assign([],{empty:true},o.streamInfo())}function Vyr(e,t={}){const{lineCounter:n,prettyErrors:r}=Uyr(t);const i=new zyr.Parser(n?.addNewLine);const o=new Byr.Composer(t);let a=null;for(const s of o.compose(i.parse(e),true,e.length)){if(!a)a=s;else if(a.options.logLevel!=="silent"){a.errors.push(new _ae.YAMLParseError(s.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}if(r&&n){a.errors.forEach(_ae.prettifyError(e,n));a.warnings.forEach(_ae.prettifyError(e,n))}return a}function e2o(e,t,n){let r=void 0;if(typeof t==="function"){r=t}else if(n===void 0&&t&&typeof t==="object"){n=t}const i=Vyr(e,n);if(!i)return null;i.warnings.forEach(o=>Kwo.warn(i.options.logLevel,o));if(i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];else i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function t2o(e,t,n){let r=null;if(typeof t==="function"||Array.isArray(t)){r=t}else if(n===void 0&&t){n=t}if(typeof n==="string")n=n.length;if(typeof n==="number"){const i=Math.round(n);n=i<1?void 0:i>8?{indent:8}:{indent:i}}if(e===void 0){const{keepUndefined:i}=n??t??{};if(!i)return void 0}if(Zwo.isDocument(e)&&!r)return e.toString(n);return new jwo.Document(e,r,n).toString(n)}Tae.parse=e2o;Tae.parseAllDocuments=Qwo;Tae.parseDocument=Vyr;Tae.stringify=t2o});var Hyr=_r(iu=>{"use strict";var n2o=hvt();var r2o=hae();var i2o=q1t();var kvt=gae();var o2o=Zoe();var PF=ac();var a2o=CF();var s2o=sp();var l2o=AF();var c2o=kF();var u2o=aNe();var d2o=wvt();var f2o=Cvt();var h2o=Avt();var uNe=$yr();var Gyr=qoe();iu.Composer=n2o.Composer;iu.Document=r2o.Document;iu.Schema=i2o.Schema;iu.YAMLError=kvt.YAMLError;iu.YAMLParseError=kvt.YAMLParseError;iu.YAMLWarning=kvt.YAMLWarning;iu.Alias=o2o.Alias;iu.isAlias=PF.isAlias;iu.isCollection=PF.isCollection;iu.isDocument=PF.isDocument;iu.isMap=PF.isMap;iu.isNode=PF.isNode;iu.isPair=PF.isPair;iu.isScalar=PF.isScalar;iu.isSeq=PF.isSeq;iu.Pair=a2o.Pair;iu.Scalar=s2o.Scalar;iu.YAMLMap=l2o.YAMLMap;iu.YAMLSeq=c2o.YAMLSeq;iu.CST=u2o;iu.Lexer=d2o.Lexer;iu.LineCounter=f2o.LineCounter;iu.Parser=h2o.Parser;iu.parse=uNe.parse;iu.parseAllDocuments=uNe.parseAllDocuments;iu.parseDocument=uNe.parseDocument;iu.stringify=uNe.stringify;iu.visit=Gyr.visit;iu.visitAsync=Gyr.visitAsync});var Ibr=_r((jvt,Kvt)=>{(function(e,t){typeof jvt==="object"&&typeof Kvt!=="undefined"?Kvt.exports=t():typeof define==="function"&&define.amd?define(t):(e=typeof globalThis!=="undefined"?globalThis:e||self,e.mapboxgl=t())})(jvt,function(){"use strict";let e,t,n;if(typeof self!=="undefined")self.__mapboxImport=o=>import(o);function r(o,a){if(!e){e=a}else if(!t){t=a}else{const s={};e(void 0,s);n=a(s);const l="self.onerror = function() { console.error('An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/guides/install/#transpiling'); }; var sharedChunk = {}; self.__mapboxImport = (u) => import(u); ("+e+")(undefined, sharedChunk); ("+t+")(undefined, sharedChunk); self.onerror = null;";if(typeof window!=="undefined"&&window&&window.URL&&window.URL.createObjectURL){n.workerUrl=window.URL.createObjectURL(new Blob([l],{type:"text/javascript"}))}}}r(["require","exports"],function(o,a){var s="3.28.1",l=1e-6,u="undefined"!=typeof Float32Array?Float32Array:Array;function d(b,p){var y=p[0],T=p[1],S=p[2],R=p[3],M=y*R-S*T;return M?(b[0]=R*(M=1/M),b[1]=-T*M,b[2]=-S*M,b[3]=y*M,b):null}function f(){var b=new u(9);return u!=Float32Array&&(b[1]=0,b[2]=0,b[3]=0,b[5]=0,b[6]=0,b[7]=0),b[0]=1,b[4]=1,b[8]=1,b}function h(b,p,y){var T=p[0],S=p[1],R=p[2],M=p[3],F=p[4],G=p[5],q=p[6],Q=p[7],ie=p[8],ae=y[0],de=y[1],pe=y[2],_e=y[3],Se=y[4],Fe=y[5],Ye=y[6],Xe=y[7],We=y[8];return b[0]=ae*T+de*M+pe*q,b[1]=ae*S+de*F+pe*Q,b[2]=ae*R+de*G+pe*ie,b[3]=_e*T+Se*M+Fe*q,b[4]=_e*S+Se*F+Fe*Q,b[5]=_e*R+Se*G+Fe*ie,b[6]=Ye*T+Xe*M+We*q,b[7]=Ye*S+Xe*F+We*Q,b[8]=Ye*R+Xe*G+We*ie,b}function m(b,p){var y=Math.sin(p),T=Math.cos(p);return b[0]=T,b[1]=y,b[2]=0,b[3]=-y,b[4]=T,b[5]=0,b[6]=0,b[7]=0,b[8]=1,b}function g(){var b=new u(16);return u!=Float32Array&&(b[1]=0,b[2]=0,b[3]=0,b[4]=0,b[6]=0,b[7]=0,b[8]=0,b[9]=0,b[11]=0,b[12]=0,b[13]=0,b[14]=0),b[0]=1,b[5]=1,b[10]=1,b[15]=1,b}function x(b){var p=new u(16);return p[0]=b[0],p[1]=b[1],p[2]=b[2],p[3]=b[3],p[4]=b[4],p[5]=b[5],p[6]=b[6],p[7]=b[7],p[8]=b[8],p[9]=b[9],p[10]=b[10],p[11]=b[11],p[12]=b[12],p[13]=b[13],p[14]=b[14],p[15]=b[15],p}function w(b,p){return b[0]=p[0],b[1]=p[1],b[2]=p[2],b[3]=p[3],b[4]=p[4],b[5]=p[5],b[6]=p[6],b[7]=p[7],b[8]=p[8],b[9]=p[9],b[10]=p[10],b[11]=p[11],b[12]=p[12],b[13]=p[13],b[14]=p[14],b[15]=p[15],b}function _(b){return b[0]=1,b[1]=0,b[2]=0,b[3]=0,b[4]=0,b[5]=1,b[6]=0,b[7]=0,b[8]=0,b[9]=0,b[10]=1,b[11]=0,b[12]=0,b[13]=0,b[14]=0,b[15]=1,b}function C(b,p){if(b===p){var y=p[1],T=p[2],S=p[3],R=p[6],M=p[7],F=p[11];b[1]=p[4],b[2]=p[8],b[3]=p[12],b[4]=y,b[6]=p[9],b[7]=p[13],b[8]=T,b[9]=R,b[11]=p[14],b[12]=S,b[13]=M,b[14]=F}else b[0]=p[0],b[1]=p[4],b[2]=p[8],b[3]=p[12],b[4]=p[1],b[5]=p[5],b[6]=p[9],b[7]=p[13],b[8]=p[2],b[9]=p[6],b[10]=p[10],b[11]=p[14],b[12]=p[3],b[13]=p[7],b[14]=p[11],b[15]=p[15];return b}function A(b,p){var y=p[0],T=p[1],S=p[2],R=p[3],M=p[4],F=p[5],G=p[6],q=p[7],Q=p[8],ie=p[9],ae=p[10],de=p[11],pe=p[12],_e=p[13],Se=p[14],Fe=p[15],Ye=y*F-T*M,Xe=y*G-S*M,We=y*q-R*M,rt=T*G-S*F,lt=T*q-R*F,Bt=S*q-R*G,ht=Q*_e-ie*pe,Tt=Q*Se-ae*pe,Lt=Q*Fe-de*pe,Nt=ie*Se-ae*_e,un=ie*Fe-de*_e,_n=ae*Fe-de*Se,Dn=Ye*_n-Xe*un+We*Nt+rt*Lt-lt*Tt+Bt*ht;return Dn?(b[0]=(F*_n-G*un+q*Nt)*(Dn=1/Dn),b[1]=(S*un-T*_n-R*Nt)*Dn,b[2]=(_e*Bt-Se*lt+Fe*rt)*Dn,b[3]=(ae*lt-ie*Bt-de*rt)*Dn,b[4]=(G*Lt-M*_n-q*Tt)*Dn,b[5]=(y*_n-S*Lt+R*Tt)*Dn,b[6]=(Se*We-pe*Bt-Fe*Xe)*Dn,b[7]=(Q*Bt-ae*We+de*Xe)*Dn,b[8]=(M*un-F*Lt+q*ht)*Dn,b[9]=(T*Lt-y*un-R*ht)*Dn,b[10]=(pe*lt-_e*We+Fe*Ye)*Dn,b[11]=(ie*We-Q*lt-de*Ye)*Dn,b[12]=(F*Tt-M*Nt-G*ht)*Dn,b[13]=(y*Nt-T*Tt+S*ht)*Dn,b[14]=(_e*Xe-pe*rt-Se*Ye)*Dn,b[15]=(Q*rt-ie*Xe+ae*Ye)*Dn,b):null}function P(b,p,y){var T=p[0],S=p[1],R=p[2],M=p[3],F=p[4],G=p[5],q=p[6],Q=p[7],ie=p[8],ae=p[9],de=p[10],pe=p[11],_e=p[12],Se=p[13],Fe=p[14],Ye=p[15],Xe=y[0],We=y[1],rt=y[2],lt=y[3];return b[0]=Xe*T+We*F+rt*ie+lt*_e,b[1]=Xe*S+We*G+rt*ae+lt*Se,b[2]=Xe*R+We*q+rt*de+lt*Fe,b[3]=Xe*M+We*Q+rt*pe+lt*Ye,b[4]=(Xe=y[4])*T+(We=y[5])*F+(rt=y[6])*ie+(lt=y[7])*_e,b[5]=Xe*S+We*G+rt*ae+lt*Se,b[6]=Xe*R+We*q+rt*de+lt*Fe,b[7]=Xe*M+We*Q+rt*pe+lt*Ye,b[8]=(Xe=y[8])*T+(We=y[9])*F+(rt=y[10])*ie+(lt=y[11])*_e,b[9]=Xe*S+We*G+rt*ae+lt*Se,b[10]=Xe*R+We*q+rt*de+lt*Fe,b[11]=Xe*M+We*Q+rt*pe+lt*Ye,b[12]=(Xe=y[12])*T+(We=y[13])*F+(rt=y[14])*ie+(lt=y[15])*_e,b[13]=Xe*S+We*G+rt*ae+lt*Se,b[14]=Xe*R+We*q+rt*de+lt*Fe,b[15]=Xe*M+We*Q+rt*pe+lt*Ye,b}function L(b,p,y){var T,S,R,M,F,G,q,Q,ie,ae,de,pe,_e=y[0],Se=y[1],Fe=y[2];return p===b?(b[12]=p[0]*_e+p[4]*Se+p[8]*Fe+p[12],b[13]=p[1]*_e+p[5]*Se+p[9]*Fe+p[13],b[14]=p[2]*_e+p[6]*Se+p[10]*Fe+p[14],b[15]=p[3]*_e+p[7]*Se+p[11]*Fe+p[15]):(S=p[1],R=p[2],M=p[3],F=p[4],G=p[5],q=p[6],Q=p[7],ie=p[8],ae=p[9],de=p[10],pe=p[11],b[0]=T=p[0],b[1]=S,b[2]=R,b[3]=M,b[4]=F,b[5]=G,b[6]=q,b[7]=Q,b[8]=ie,b[9]=ae,b[10]=de,b[11]=pe,b[12]=T*_e+F*Se+ie*Fe+p[12],b[13]=S*_e+G*Se+ae*Fe+p[13],b[14]=R*_e+q*Se+de*Fe+p[14],b[15]=M*_e+Q*Se+pe*Fe+p[15]),b}function I(b,p,y){var T=y[0],S=y[1],R=y[2];return b[0]=p[0]*T,b[1]=p[1]*T,b[2]=p[2]*T,b[3]=p[3]*T,b[4]=p[4]*S,b[5]=p[5]*S,b[6]=p[6]*S,b[7]=p[7]*S,b[8]=p[8]*R,b[9]=p[9]*R,b[10]=p[10]*R,b[11]=p[11]*R,b[12]=p[12],b[13]=p[13],b[14]=p[14],b[15]=p[15],b}function N(b,p,y){var T=Math.sin(y),S=Math.cos(y),R=p[4],M=p[5],F=p[6],G=p[7],q=p[8],Q=p[9],ie=p[10],ae=p[11];return p!==b&&(b[0]=p[0],b[1]=p[1],b[2]=p[2],b[3]=p[3],b[12]=p[12],b[13]=p[13],b[14]=p[14],b[15]=p[15]),b[4]=R*S+q*T,b[5]=M*S+Q*T,b[6]=F*S+ie*T,b[7]=G*S+ae*T,b[8]=q*S-R*T,b[9]=Q*S-M*T,b[10]=ie*S-F*T,b[11]=ae*S-G*T,b}function O(b,p,y){var T=Math.sin(y),S=Math.cos(y),R=p[0],M=p[1],F=p[2],G=p[3],q=p[8],Q=p[9],ie=p[10],ae=p[11];return p!==b&&(b[4]=p[4],b[5]=p[5],b[6]=p[6],b[7]=p[7],b[12]=p[12],b[13]=p[13],b[14]=p[14],b[15]=p[15]),b[0]=R*S-q*T,b[1]=M*S-Q*T,b[2]=F*S-ie*T,b[3]=G*S-ae*T,b[8]=R*T+q*S,b[9]=M*T+Q*S,b[10]=F*T+ie*S,b[11]=G*T+ae*S,b}function z(b,p,y){var T=Math.sin(y),S=Math.cos(y),R=p[0],M=p[1],F=p[2],G=p[3],q=p[4],Q=p[5],ie=p[6],ae=p[7];return p!==b&&(b[8]=p[8],b[9]=p[9],b[10]=p[10],b[11]=p[11],b[12]=p[12],b[13]=p[13],b[14]=p[14],b[15]=p[15]),b[0]=R*S+q*T,b[1]=M*S+Q*T,b[2]=F*S+ie*T,b[3]=G*S+ae*T,b[4]=q*S-R*T,b[5]=Q*S-M*T,b[6]=ie*S-F*T,b[7]=ae*S-G*T,b}function U(b,p){return b[0]=1,b[1]=0,b[2]=0,b[3]=0,b[4]=0,b[5]=1,b[6]=0,b[7]=0,b[8]=0,b[9]=0,b[10]=1,b[11]=0,b[12]=p[0],b[13]=p[1],b[14]=p[2],b[15]=1,b}function W(b,p){return b[0]=p[0],b[1]=0,b[2]=0,b[3]=0,b[4]=0,b[5]=p[1],b[6]=0,b[7]=0,b[8]=0,b[9]=0,b[10]=p[2],b[11]=0,b[12]=0,b[13]=0,b[14]=0,b[15]=1,b}function H(b,p,y){var T,S,R,M=y[0],F=y[1],G=y[2],q=Math.sqrt(M*M+F*F+G*G);return q0?(Se=2*Math.sqrt(_e+1),b[3]=.25*Se,b[0]=(ie-de)/Se,b[1]=(ae-G)/Se,b[2]=(F-q)/Se):M>Q&&M>pe?(Se=2*Math.sqrt(1+M-Q-pe),b[3]=(ie-de)/Se,b[0]=.25*Se,b[1]=(F+q)/Se,b[2]=(ae+G)/Se):Q>pe?(Se=2*Math.sqrt(1+Q-M-pe),b[3]=(ae-G)/Se,b[0]=(F+q)/Se,b[1]=.25*Se,b[2]=(ie+de)/Se):(Se=2*Math.sqrt(1+pe-M-Q),b[3]=(F-q)/Se,b[0]=(ae+G)/Se,b[1]=(ie+de)/Se,b[2]=.25*Se),b}function X(b,p){var y=p[0],T=p[1],S=p[2],R=p[3],M=y+y,F=T+T,G=S+S,q=y*M,Q=T*M,ie=T*F,ae=S*M,de=S*F,pe=S*G,_e=R*M,Se=R*F,Fe=R*G;return b[0]=1-ie-pe,b[1]=Q+Fe,b[2]=ae-Se,b[3]=0,b[4]=Q-Fe,b[5]=1-q-pe,b[6]=de+_e,b[7]=0,b[8]=ae+Se,b[9]=de-_e,b[10]=1-q-ie,b[11]=0,b[12]=0,b[13]=0,b[14]=0,b[15]=1,b}var j=function(b,p,y,T,S){var R=1/Math.tan(p/2);if(b[0]=R/y,b[1]=0,b[2]=0,b[3]=0,b[4]=0,b[5]=R,b[6]=0,b[7]=0,b[8]=0,b[9]=0,b[11]=-1,b[12]=0,b[13]=0,b[15]=0,null!=S&&S!==1/0){var M=1/(T-S);b[10]=(S+T)*M,b[14]=2*S*T*M}else b[10]=-1,b[14]=-2*T;return b},te=function(b,p,y,T,S,R,M){var F=1/(p-y),G=1/(T-S),q=1/(R-M);return b[0]=-2*F,b[1]=0,b[2]=0,b[3]=0,b[4]=0,b[5]=-2*G,b[6]=0,b[7]=0,b[8]=0,b[9]=0,b[10]=2*q,b[11]=0,b[12]=(p+y)*F,b[13]=(S+T)*G,b[14]=(M+R)*q,b[15]=1,b},J=P;function oe(){var b=new u(3);return u!=Float32Array&&(b[0]=0,b[1]=0,b[2]=0),b}function se(b){var p=new u(3);return p[0]=b[0],p[1]=b[1],p[2]=b[2],p}function re(b){var p=b[0],y=b[1],T=b[2];return Math.sqrt(p*p+y*y+T*T)}function ce(b,p,y){var T=new u(3);return T[0]=b,T[1]=p,T[2]=y,T}function ue(b,p,y,T){return b[0]=p,b[1]=y,b[2]=T,b}function xe(b,p,y){return b[0]=p[0]+y[0],b[1]=p[1]+y[1],b[2]=p[2]+y[2],b}function be(b,p,y){return b[0]=p[0]-y[0],b[1]=p[1]-y[1],b[2]=p[2]-y[2],b}function Ie(b,p,y){return b[0]=p[0]*y[0],b[1]=p[1]*y[1],b[2]=p[2]*y[2],b}function he(b,p,y){return b[0]=Math.min(p[0],y[0]),b[1]=Math.min(p[1],y[1]),b[2]=Math.min(p[2],y[2]),b}function ve(b,p,y){return b[0]=Math.max(p[0],y[0]),b[1]=Math.max(p[1],y[1]),b[2]=Math.max(p[2],y[2]),b}function ge(b,p,y){return b[0]=p[0]*y,b[1]=p[1]*y,b[2]=p[2]*y,b}function Ve(b,p,y,T){return b[0]=p[0]+y[0]*T,b[1]=p[1]+y[1]*T,b[2]=p[2]+y[2]*T,b}function Le(b,p){var y=p[0]-b[0],T=p[1]-b[1],S=p[2]-b[2];return Math.sqrt(y*y+T*T+S*S)}function $e(b,p){var y=p[0]-b[0],T=p[1]-b[1],S=p[2]-b[2];return y*y+T*T+S*S}function Ee(b){var p=b[0],y=b[1],T=b[2];return p*p+y*y+T*T}function tt(b,p){return b[0]=-p[0],b[1]=-p[1],b[2]=-p[2],b}function yt(b,p){var y=p[0],T=p[1],S=p[2],R=y*y+T*T+S*S;return R>0&&(R=1/Math.sqrt(R)),b[0]=p[0]*R,b[1]=p[1]*R,b[2]=p[2]*R,b}function mt(b,p){return b[0]*p[0]+b[1]*p[1]+b[2]*p[2]}function ct(b,p,y){var T=p[0],S=p[1],R=p[2],M=y[0],F=y[1],G=y[2];return b[0]=S*G-R*F,b[1]=R*M-T*G,b[2]=T*F-S*M,b}function Ge(b,p,y,T){var S=p[0],R=p[1],M=p[2];return b[0]=S+T*(y[0]-S),b[1]=R+T*(y[1]-R),b[2]=M+T*(y[2]-M),b}function it(b,p,y){var T=p[0],S=p[1],R=p[2],M=y[3]*T+y[7]*S+y[11]*R+y[15];return b[0]=(y[0]*T+y[4]*S+y[8]*R+y[12])/(M=M||1),b[1]=(y[1]*T+y[5]*S+y[9]*R+y[13])/M,b[2]=(y[2]*T+y[6]*S+y[10]*R+y[14])/M,b}function bt(b,p,y){var T=p[0],S=p[1],R=p[2];return b[0]=T*y[0]+S*y[3]+R*y[6],b[1]=T*y[1]+S*y[4]+R*y[7],b[2]=T*y[2]+S*y[5]+R*y[8],b}function He(b,p,y){var T=y[0],S=y[1],R=y[2],M=y[3],F=p[0],G=p[1],q=p[2],Q=S*q-R*G,ie=R*F-T*q,ae=T*G-S*F;return b[0]=F+M*(Q+=Q)+S*(ae+=ae)-R*(ie+=ie),b[1]=G+M*ie+R*Q-T*ae,b[2]=q+M*ae+T*ie-S*Q,b}function Je(b){return b[0]=0,b[1]=0,b[2]=0,b}function Te(b,p){return b[0]===p[0]&&b[1]===p[1]&&b[2]===p[2]}var we=be,Ze=Ie,Be=re;function qe(){var b=new u(4);return u!=Float32Array&&(b[0]=0,b[1]=0,b[2]=0,b[3]=0),b}function Qe(b,p,y,T){var S=new u(4);return S[0]=b,S[1]=p,S[2]=y,S[3]=T,S}function ze(b,p,y){return b[0]=p[0]*y,b[1]=p[1]*y,b[2]=p[2]*y,b[3]=p[3]*y,b}function Me(b,p){var y=p[0],T=p[1],S=p[2],R=p[3],M=y*y+T*T+S*S+R*R;return M>0&&(M=1/Math.sqrt(M)),b[0]=y*M,b[1]=T*M,b[2]=S*M,b[3]=R*M,b}function ye(b,p,y){var T=p[0],S=p[1],R=p[2],M=p[3];return b[0]=y[0]*T+y[4]*S+y[8]*R+y[12]*M,b[1]=y[1]*T+y[5]*S+y[9]*R+y[13]*M,b[2]=y[2]*T+y[6]*S+y[10]*R+y[14]*M,b[3]=y[3]*T+y[7]*S+y[11]*R+y[15]*M,b}function Ne(){var b=new u(4);return u!=Float32Array&&(b[0]=0,b[1]=0,b[2]=0),b[3]=1,b}function Ae(b){return b[0]=0,b[1]=0,b[2]=0,b[3]=1,b}function dt(b,p){var y=2*Math.acos(p[3]),T=Math.sin(y/2);return T>l?(b[0]=p[0]/T,b[1]=p[1]/T,b[2]=p[2]/T):(b[0]=1,b[1]=0,b[2]=0),y}function Oe(b,p,y){y*=.5;var T=p[0],S=p[1],R=p[2],M=p[3],F=Math.sin(y),G=Math.cos(y);return b[0]=T*G+M*F,b[1]=S*G+R*F,b[2]=R*G-S*F,b[3]=M*G-T*F,b}function Wt(b,p,y){y*=.5;var T=p[0],S=p[1],R=p[2],M=p[3],F=Math.sin(y),G=Math.cos(y);return b[0]=T*G-R*F,b[1]=S*G+M*F,b[2]=R*G+T*F,b[3]=M*G-S*F,b}function kt(b,p,y){y*=.5;var T=p[0],S=p[1],R=p[2],M=p[3],F=Math.sin(y),G=Math.cos(y);return b[0]=T*G+S*F,b[1]=S*G-T*F,b[2]=R*G+M*F,b[3]=M*G-R*F,b}oe(),qe();var qt,_t,sn,Jt=Me,Sn=(qt=oe(),_t=ce(1,0,0),sn=ce(0,1,0),function(b,p,y){var T=mt(p,y);return T<-.999999?(ct(qt,_t,p),Be(qt)<1e-6&&ct(qt,sn,p),yt(qt,qt),function(S,R,M){M*=.5;var F=Math.sin(M);S[0]=F*R[0],S[1]=F*R[1],S[2]=F*R[2],S[3]=Math.cos(M)}(b,qt,Math.PI),b):T>.999999?(b[0]=0,b[1]=0,b[2]=0,b[3]=1,b):(ct(qt,p,y),b[0]=qt[0],b[1]=qt[1],b[2]=qt[2],b[3]=1+T,Jt(b,b))});function Kt(){var b=new u(2);return u!=Float32Array&&(b[0]=0,b[1]=0),b}function mn(b,p){var y=new u(2);return y[0]=b,y[1]=p,y}function At(b,p,y){return b[0]=p,b[1]=y,b}function lr(b,p,y){return b[0]=p[0]+y[0],b[1]=p[1]+y[1],b}function on(b,p,y){return b[0]=p[0]-y[0],b[1]=p[1]-y[1],b}function cr(b,p,y){return b[0]=p[0]*y,b[1]=p[1]*y,b}function Hr(b){var p=b[0],y=b[1];return Math.sqrt(p*p+y*y)}function Mr(b,p){var y=p[0],T=p[1],S=y*y+T*T;return S>0&&(S=1/Math.sqrt(S)),b[0]=p[0]*S,b[1]=p[1]*S,b}function Er(b,p){return b[0]*p[0]+b[1]*p[1]}Ne(),Ne(),f();var vr=on;function Yr(b,p,y,T){const S=3*b,R=3*(y-b)-S,M=1-S-R,F=3*p,G=3*(T-p)-F,q=1-F-G;return function(Q,ie=1e-6){if(Q<=0)return 0;if(Q>=1)return 1;let ae=Q;for(let _e=0;_e<8;_e++){const Se=((M*ae+R)*ae+S)*ae-Q;if(Math.abs(Se)Se?de=ae:pe=ae,ae=.5*(de+pe)}return((q*ae+G)*ae+F)*ae}}function nt(b,p){this.x=b,this.y=p}function Rr(b,p){if(Array.isArray(b)){if(!Array.isArray(p)||b.length!==p.length)return false;for(let y=0;yy;){if(T-y>600){const G=T-y+1,q=p-y+1,Q=Math.log(G),ie=.5*Math.exp(2*Q/3),ae=.5*Math.sqrt(Q*ie*(G-ie)/G)*(q-G/2<0?-1:1);Xr(b,p,Math.max(y,Math.floor(p-q*ie/G+ae)),Math.min(T,Math.floor(p+(G-q)*ie/G+ae)),S)}const R=b[p];let M=y,F=T;for(dr(b,y,p),S(b[T],R)>0&&dr(b,y,T);M0;)F--}0===S(b[y],R)?dr(b,y,F):(F++,dr(b,F,T)),F<=p&&(y=F+1),p<=F&&(T=F-1)}}function dr(b,p,y){const T=b[p];b[p]=b[y],b[y]=T}function rn(b,p){return bp?1:0}function St(b){let p=0;for(let y,T,S=0,R=b.length,M=R-1;S1)for(let M=0;M=p[2]||b[1]<=p[1]||b[3]>=p[3])}function Cn(b,p,y){const T=b[0]-p[0],S=b[1]-p[1],R=b[0]-y[0],M=b[1]-y[1];return T*M-R*S===0&&T*R<=0&&S*M<=0}function rr(b,p,y){return p[1]>b[1]!=y[1]>b[1]&&b[0]<(y[0]-p[0])*(b[1]-p[1])/(y[1]-p[1])+p[0]}function hr(b,p,y=false){let T=false;for(let S=0,R=p.length;S0&&F<0||M<0&&F>0}function Tn(b,p,y,T){return 0!==(S=[T[0]-y[0],T[1]-y[1]])[0]*(R=[p[0]-b[0],p[1]-b[1]])[1]-S[1]*R[0]&&!(!Et(b,p,y,T)||!Et(y,T,b,p));var S,R}function ft(b){const p=new nt(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),y=new nt(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(const T of b[0])p.x>T.x&&(p.x=T.x),p.y>T.y&&(p.y=T.y),y.x=1)return 1;const p=b*b,y=p*b;return 4*(b<.5?y:3*(b-p)+y-.75)}const sr=Yr(.25,.1,.25,1);function bn(b,p,y){return Math.min(y,Math.max(p,b))}function ir(b,p,y){return(y=bn((y-b)/(p-b),0,1))*y*(3-2*y)}function Jn(b,p,y){const T=y-p,S=((b-p)%T+T)%T+p;return S===p?y:S}function er(b,p,y){if(!b.length)return y(null,[]);let T=b.length;const S=new Array(b.length);let R=null;b.forEach((M,F)=>{p(M,(G,q)=>{G&&(R=G),S[F]=q,0===--T&&y(R,S)})})}function Pr(b,p){const y={};for(let T=0;T>p/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,b)}()}function ln(b){return b<=1?1:Math.pow(2,Math.ceil(Math.log2(b)))}function yi(b){return!!b&&gn.test(b)}function yo(b,p){b.forEach(y=>{p[y]&&(p[y]=p[y].bind(p))})}function Pa(b,p,y){const T={};for(const S in b)T[S]=p.call(this,b[S],S,b);return T}function Ms(b,p,y){const T={};for(const S in b)p.call(this,b[S],S,b)&&(T[S]=b[S]);return T}function ds(b){return Array.isArray(b)?b.map(ds):"object"==typeof b&&b?Pa(b,ds):b}function st(b,p){for(let y=0;y(p.y-b.y)*(y.x-b.x)}function xr([b,p,y]){const T=Fn(p+90),S=Fn(y);return{x:b*Math.cos(T)*Math.sin(S),y:b*Math.sin(T)*Math.sin(S),z:b*Math.cos(S),azimuthal:p,polar:y}}function wr(b,p,y){const T=Math.sqrt(b*b+p*p+y*y),S=T>0?Math.acos(y/T)*Gt:0;let R=0!==b||0!==p?Math.atan2(-p,-b)*Gt+90:0;return R<0&&(R+=360),[T,R,S]}function Dr(b){return("undefined"!=typeof self||void 0!==b)&&"undefined"!=typeof WorkerGlobalScope&&(void 0!==b?b:self)instanceof WorkerGlobalScope}function Pn(b){const p={};if(b.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(y,T,S,R)=>{const M=S||R;return p[T]=!M||M.toLowerCase(),""}),p["max-age"]){const y=parseInt(p["max-age"],10);isNaN(y)?delete p["max-age"]:p["max-age"]=y}return p}function Ot(b){return b?{cacheControl:b.get("cache-control"),expires:b.get("expires")}:{cacheControl:void 0,expires:void 0}}function Nn(b){try{const p=self[b];return p.setItem("_mapbox_test_",1),p.removeItem("_mapbox_test_"),true}catch(p){return false}}function nr(b,p){return[b[4*p],b[4*p+1],b[4*p+2],b[4*p+3]]}function Ur(b,p,y){b[4*p+0]=y[0],b[4*p+1]=y[1],b[4*p+2]=y[2],b[4*p+3]=y[3]}function bi(b){return[Math.pow(b[0],1/2.2),Math.pow(b[1],1/2.2),Math.pow(b[2],1/2.2)]}function $i(b){return b>0?1/(1.001-b):1+b}function Zi(b){return b>0?1-1/(1.001-b):-b}function Fo(b,p,y){return(b-p.min)*(y.max-y.min)/(p.max-p.min)+y.min}function Ao(b){return b*b*b*b*b}function Ho(b){return b>>>=0,b=Math.imul(2747636419^b,2654435769)>>>0,b=Math.imul(b^b>>>16,2654435769)>>>0,(b=Math.imul(b^b>>>16,2654435769)>>>0)/4294967296}let Ia,ba,ut,ke,je,gt;function Rt(){return Ia??=self.OffscreenCanvas&&!!new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof self.createImageBitmap,Ia}const Ct={requestIdleCallback:b=>{if("undefined"!=typeof requestIdleCallback)return requestIdleCallback(b);setTimeout(()=>b({didTimeout:false,timeRemaining:()=>50}),0)},now:()=>void 0!==ke?ke:performance.now(),setNow(b){ke=b},restoreNow(){ke=void 0},frame(b){const p=requestAnimationFrame(b);return{cancel:()=>cancelAnimationFrame(p)}},getImageData(b,p=0){const{width:y,height:T}=b;je||(je=document.createElement("canvas"));const S=je.getContext("2d",{willReadFrequently:true});if(!S)throw new Error("failed to create canvas 2d context");return(y>je.width||T>je.height)&&(je.width=y,je.height=T),S.clearRect(-p,-p,y+2*p,T+2*p),S.drawImage(b,0,0,y,T),S.getImageData(-p,-p,y+2*p,T+2*p)},resolveURL:b=>(ba||(ba=document.createElement("a")),ba.href=b,ba.href),get devicePixelRatio(){return window.devicePixelRatio},get prefersReducedMotion(){return!!window.matchMedia&&(ut??=window.matchMedia("(prefers-reduced-motion: reduce)"),ut.matches)},hasCanvasFingerprintNoise(){if(void 0!==gt)return gt;if(!Rt())return gt=false,false;const b=new OffscreenCanvas(85,1),p=b.getContext("2d",{willReadFrequently:true});let y=0;for(let S=0;S0?`?${R}`:""}`}const tr="mapbox-tiles";let ar=500,oi=50;const ei=["language","worldview","jobid"];let Ar;function pi(){try{return caches}catch(b){}}function Qr(){const b=pi();b&&null==Ar&&(Ar=b.open(tr))}let wi=1/0;function Li(b){return Ft.API_URL_REGEX.test(b)}function ao(b){return 0===b.indexOf("mapbox:")}function Mo(b){return Ft.API_CDN_URL_REGEX.test(b)}function fo(b){return Ft.API_SPRITE_REGEX.test(b)}function fs(b){return Ft.API_STYLE_REGEX.test(b)&&!fo(b)}const Ga={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Iconset:"Iconset",Image:"Image",Model:"Model"};Object.freeze(Ga);class ea extends Error{constructor(p,y,T){super(),this.url=T,this.statusText=p,this.status=y}get message(){return 401===this.status&&Li(this.url)?`${this.statusText}: you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/guides/#access-tokens-and-token-scopes`:this.statusText}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}function ha(b){return"object"==typeof b&&null!==b&&"status"in b&&404===b.status}const bo=Dr()?()=>self.worker.referrer:()=>("blob:"===location.protocol?parent:self).location.href,aa=/^\w+:/,Ts=/[\r\n]+/;async function Xo(b,p){let y;return y="arrayBuffer"===b.type?await p.arrayBuffer():"json"===b.type?await p.json():await p.text(),{data:y,headers:p.headers}}async function Qa(b,p){return p&&p.throwIfAborted(),(y=b.url).startsWith("file:")||bo().startsWith("file:")&&!aa.test(y)?async function(T,S){return new Promise((R,M)=>{const F=new XMLHttpRequest,G=()=>{S.removeEventListener("abort",G),F.abort(),M(S.reason)};S&&S.addEventListener("abort",G),F.open(T.method||"GET",T.url,true),"arrayBuffer"===T.type&&(F.responseType="arraybuffer");for(const q in T.headers)F.setRequestHeader(q,T.headers[q]);"json"===T.type&&(F.responseType="text",F.setRequestHeader("Accept","application/json")),F.withCredentials="include"===T.credentials,F.onerror=()=>{S&&S.removeEventListener("abort",G),M(new Error(F.statusText))},F.onload=()=>{if(S&&S.removeEventListener("abort",G),(F.status>=200&&F.status<300||0===F.status)&&null!==F.response){let q=F.response;if("json"===T.type)try{q=JSON.parse(F.response)}catch(ie){return void M(ie)}const Q=new Headers;F.getAllResponseHeaders().trim().split(Ts).forEach(ie=>{const ae=ie.split(": "),de=ae.shift(),pe=ae.join(": ");de&&Q.set(de,pe)}),R({data:q,headers:Q})}else M(new ea(F.statusText,F.status,T.url))},F.send(T.body)})}(b,p):async function(T,S){const R=new Request(T.url,{method:T.method||"GET",body:T.body,credentials:T.credentials,headers:T.headers,referrer:bo(),referrerPolicy:T.referrerPolicy,signal:S}),M=(F=R.url).indexOf("sku=")>0&&Li(F);var F;if("json"===T.type&&R.headers.set("Accept","application/json"),M){let ae=null;try{ae=await async function(de){if(Qr(),null==Ar)return null;const pe=await Ar;let _e=On(de.url,{persistentParams:ei});const Se=de.headers.get("Range");Se&&(_e=vn(_e,{range:Se}));const Fe=await pe.match(_e);if(!Fe)return null;const Ye=function(Xe){if(!Xe)return false;const We=new Date(Xe.headers.get("expires")||0),rt=Pn(Xe.headers.get("cache-control")||"");return Number(We)>Date.now()&&!rt["no-cache"]}(Fe);return pe.delete(_e).catch(Xe=>yn(Xe.message)),Ye&&pe.put(_e,Fe.clone()).catch(Xe=>yn(Xe.message)),{response:Fe,fresh:Ye}}(R)}catch(de){"SecurityError"!==de.message&&yn(de.toString())}if(ae&&ae.fresh)return S&&S.throwIfAborted(),Xo(T,ae.response)}const G=Date.now();let q;try{q=await fetch(R)}catch(ae){if("AbortError"===ae.name)throw ae;throw new Error(`${ae.message} ${T.url}`,{cause:ae})}if(S&&S.throwIfAborted(),!q.ok)throw new ea(q.statusText,q.status,T.url);const Q=M?q.clone():null,ie=await Xo(T,q);return Q&&async function(ae,de,pe){if(Qr(),null==Ar)return;const _e=Pn(de.headers.get("cache-control")||"");if(_e["no-store"])return;const Se={status:de.status,statusText:de.statusText,headers:new Headers(de.headers)};_e["max-age"]&&Se.headers.set("Expires",new Date(pe+1e3*_e["max-age"]).toUTCString());const Fe=Se.headers.get("expires");if(!Fe)return;if(new Date(Fe).getTime()-pe<42e4)return;let Ye=On(ae.url,{persistentParams:ei});if(206===de.status){const rt=ae.headers.get("Range");if(!rt)return;Se.status=200,Ye=vn(Ye,{range:rt})}const Xe=new Response(200!==(We=de.status)&&404!==We&&[101,103,204,205,304].includes(We)?null:de.body,Se);var We;if(Qr(),null!=Ar)try{const rt=await Ar;await rt.put(Ye,Xe)}catch(rt){yn(rt.message)}}(R,Q,G),ie}(b,p);var y}async function xu(b,p){return Qa(Object.assign(b,{type:"json"}),p)}async function es(b,p){return Qa(Object.assign(b,{type:"arrayBuffer"}),p)}function sc(b){const p=document.createElement("a");return p.href=b,p.protocol===location.protocol&&p.host===location.host}let Ul,Zs;Ul=[],Zs=0;const kl="01",al={create:"create",load:"load",fullLoad:"fullLoad"},Lc={mark(b){performance.mark(b)},measure(b,p,y){performance.measure(b,p,y)}};function uf(b){const p=b.name.split("?")[0];return Mo(p)&&p.includes("mapbox-gl.js")?"javascript":Mo(p)&&p.includes("mapbox-gl.css")?"css":function(y){return Ft.API_FONTS_REGEX.test(y)}(p)?"fontRange":fo(p)?"sprite":fs(p)?"style":function(y){return Ft.API_TILEJSON_REGEX.test(y)}(p)?"tilejson":"other"}const Ht=/(\.(png|jpg)\d*)(?=$)/,Nu=/^.+\/v4\//,ey=/\.[\w]+$/,sl=/^(\/v4\/|\/(raster|rasterarrays)\/v1\/)/,zs=/^access_token=(.*)$/,Df="NO_ACCESS_TOKEN",pd=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function sa(b){const p=b.match(pd);if(!p)throw new Error("Unable to parse URL object");return{protocol:p[1],authority:p[2],path:p[3]||"/",params:p[4]?p[4].split("&"):[]}}function Zl(b){const p=b.params.length?`?${b.params.join("&")}`:"";return`${b.protocol}://${b.authority}${b.path}${p}`}const Gd="mapbox.eventData";function Qp(b){if(!b)return null;const p=b.split(".");if(!p||3!==p.length)return null;try{return JSON.parse(decodeURIComponent(atob(p[1]).split("").map(y=>"%"+("00"+y.charCodeAt(0).toString(16)).slice(-2)).join("")))}catch(y){return null}}function rh(b){return!(!Ft.EVENTS_URL||!b&&!Ft.ACCESS_TOKEN)}let Hd;const ty=/^[\w.+-]+(\/[\w.+-]+)?$/;let ny="other";class ll{constructor(p){this.type=p,this.anonId=null,this.anonIdTimestamp=null,this.eventData={},this.queue=[],this.pendingRequest=false}getStorageKey(p){const y=Qp(Ft.ACCESS_TOKEN);let T="";return T=y&&y.u?btoa(encodeURIComponent(y.u).replace(/%([0-9A-F]{2})/g,(S,R)=>String.fromCharCode(Number("0x"+R)))):Ft.ACCESS_TOKEN||"",p?`${Gd}.${p}:${T}`:`${Gd}:${T}`}fetchEventData(){const p=Nn("localStorage"),y=this.getStorageKey(),T=this.getStorageKey("uuid"),S=this.getStorageKey("uuidTimestamp");if(p)try{const R=localStorage.getItem(y);R&&(this.eventData=JSON.parse(R));const M=localStorage.getItem(T);M&&(this.anonId=M);const F=localStorage.getItem(S);F&&(this.anonIdTimestamp=Number(F));const G=Date.now()-864e5;(!this.anonIdTimestamp||this.anonIdTimestamp=1&&localStorage.setItem(y,JSON.stringify(this.eventData)),M&&localStorage.setItem(S,M.toString())}catch(F){yn("Unable to write to LocalStorage")}}processRequests(){}postEvent(p,y,T,S){if(!Ft.EVENTS_URL)return;const R=sa(Ft.EVENTS_URL);R.params.push(`access_token=${S||Ft.ACCESS_TOKEN||""}`);const M={event:this.type,created:new Date(p).toISOString()},F=y?Object.assign(M,y):M,G={url:Zl(R),headers:{"Content-Type":"text/plain"},body:JSON.stringify([F])};this.pendingRequest=true,async function(q){return Qa(Object.assign(q,{method:"POST"}),void 0)}(G).then(()=>{this.pendingRequest=false,T(null),this.saveEventData(),this.processRequests()}).catch(q=>{this.pendingRequest=false,T(q),this.saveEventData(),this.processRequests()})}queueRequest(p,y){this.queue.push({...p,customAccessToken:y}),this.processRequests()}}class jc extends ll{constructor(p){super("metrics"),p&&(this.data=p)}postMetricsEvent(p){if(!rh(p))return;this.anonId||this.fetchEventData(),yi(this.anonId)||this.refreshUUID();const y={...this.data,sessionId:this.anonId};this.queueRequest({timestamp:Date.now(),payload:y},p)}processRequests(){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:p,payload:y,customAccessToken:T}=this.queue.shift();this.postEvent(p,y,()=>{},T)}}const Wd=new class extends ll{constructor(b){super("appUserTurnstile"),this._customAccessToken=b}postTurnstileEvent(b,p){rh(p)&&Array.isArray(b)&&b.some(y=>ao(y)||Li(y))&&this.queueRequest({timestamp:Date.now()},p)}processRequests(){if(this.pendingRequest||0===this.queue.length)return;this.anonId&&this.anonIdTimestamp&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const b=Qp(Ft.ACCESS_TOKEN),p=b?b.u:Ft.ACCESS_TOKEN;let y=p!==this.eventData.tokenU;yi(this.anonId)||(this.refreshUUID(),y=true);const{timestamp:T,customAccessToken:S}=this.queue.shift();if(this.eventData.lastSuccess){const M=new Date(this.eventData.lastSuccess),F=new Date(T),G=(T-this.eventData.lastSuccess)/864e5;y=y||G>=1||G<-1||M.getDate()!==F.getDate()}else y=true;if(!y)return void this.processRequests();const R={version:"2.2",sdkIdentifier:"mapbox-gl-js",sdkVersion:s,skuId:kl,"enabled.telemetry":false,userId:this.anonId,bundleFormat:"umd",bundleDistribution:ny};Hd&&(R.sdkInfo=Hd),this.postEvent(T,R,M=>{M||(this.eventData.lastSuccess=T,this.eventData.tokenU=p)},S)}},em=Wd.postTurnstileEvent.bind(Wd),dp=new class extends ll{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(b,p,y,T){this.skuToken=p,this.errorCb=T,Ft.EVENTS_URL&&(y||Ft.ACCESS_TOKEN?this.queueRequest({id:b,timestamp:Date.now()},y):this.errorCb(new Error(Df)))}processRequests(){if(this.pendingRequest||0===this.queue.length)return;const{id:b,timestamp:p,customAccessToken:y}=this.queue.shift();if(b&&this.success[b])return;this.anonId&&this.anonIdTimestamp||this.fetchEventData(),yi(this.anonId)||this.refreshUUID();const T={version:"2.2",sdkIdentifier:"mapbox-gl-js",sdkVersion:s,skuId:kl,skuToken:this.skuToken,userId:this.anonId,bundleFormat:"umd",bundleDistribution:ny};Hd&&(T.sdkInfo=Hd),this.postEvent(p,T,S=>{S?this.errorCb(S):b&&(this.success[b]=true)},y)}remove(){this.errorCb=null}},ih=dp.postMapLoadEvent.bind(dp),df=new class extends ll{constructor(){super("style.load"),this.eventIdPerMapInstanceMap=new Map,this.mapInstanceIdMap=new WeakMap}getMapInstanceId(b){let p=this.mapInstanceIdMap.get(b);return p||(p=di(),this.mapInstanceIdMap.set(b,p)),p}getEventId(b){const p=this.eventIdPerMapInstanceMap.get(b)||0;return this.eventIdPerMapInstanceMap.set(b,p+1),p}postStyleLoadEvent(b,p){const{map:y,style:T,importedStyles:S}=p;if(!rh(b))return;const R=this.getMapInstanceId(y),M={mapInstanceId:R,eventId:this.getEventId(R),style:T};S.length&&(M.importedStyles=S),this.queueRequest({timestamp:Date.now(),payload:M},b)}processRequests(){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:b,payload:p,customAccessToken:y}=this.queue.shift();this.postEvent(b,p,()=>{},y)}},ry=df.postStyleLoadEvent.bind(df),Eb=new jc({attributes:[{name:"maps/js/layer-animations/style-with-appearances"}]}),Zm=Eb.postMetricsEvent.bind(Eb),Dc=new jc({attributes:[{name:"maps/js/layer-animations/runtime-appearances"}]}),fp=Dc.postMetricsEvent.bind(Dc),Dl=new class extends ll{constructor(){super("gljs.performance")}postPerformanceEvent(b,p){rh(b)&&this.queueRequest({timestamp:Date.now(),performanceData:p},b)}processRequests(){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:b,performanceData:p,customAccessToken:y}=this.queue.shift(),T=function(S){const R=performance.getEntriesByType("resource"),M=performance.getEntriesByType("mark"),F=function(de){const pe={};if(de){for(const _e in de)if("other"!==_e)for(const Se of de[_e]){const Fe=`${_e}ResolveRangeMin`,Ye=`${_e}ResolveRangeMax`,Xe=`${_e}RequestCount`,We=`${_e}RequestCachedCount`;pe[Fe]=Math.min(pe[Fe]||1/0,Se.startTime),pe[Ye]=Math.max(pe[Ye]||-1/0,Se.responseEnd);const rt=lt=>{void 0===pe[lt]&&(pe[lt]=0),++pe[lt]};void 0!==Se.transferSize&&0===Se.transferSize&&rt(We),rt(Xe)}}return pe}(function(de,pe){const _e={};if(de)for(const Se of de){const Fe=pe(Se);void 0===_e[Fe]&&(_e[Fe]=[]),_e[Fe].push(Se)}return _e}(R,uf)),G=window.devicePixelRatio,q=navigator.connection||navigator.mozConnection||navigator.webkitConnection,Q=q?q.effectiveType:void 0,ie={counters:[],metadata:[],attributes:[]},ae=(de,pe,_e)=>{null!=_e&&de.push({name:pe,value:_e.toString()})};for(const de in F)ae(ie.counters,de,F[de]);if(S.interactionRange[0]!==1/0&&S.interactionRange[1]!==-1/0&&(ae(ie.counters,"interactionRangeMin",S.interactionRange[0]),ae(ie.counters,"interactionRangeMax",S.interactionRange[1])),M)for(const de of Object.values(al)){const pe=M.find(_e=>_e.name===de);pe&&ae(ie.counters,de,pe.startTime)}return ae(ie.counters,"visibilityHidden",S.visibilityHidden),ae(ie.attributes,"style",function(de){if(de)for(const pe of de){const _e=pe.name.split("?")[0];if(fs(_e)){const Se=_e.split("/").slice(-2);if(2===Se.length)return`mapbox://styles/${Se[0]}/${Se[1]}`}}}(R)),ae(ie.attributes,"terrainEnabled",S.terrainEnabled?"true":"false"),ae(ie.attributes,"fogEnabled",S.fogEnabled?"true":"false"),ae(ie.attributes,"projection",S.projection),ae(ie.attributes,"zoom",S.zoom),ae(ie.metadata,"devicePixelRatio",G),ae(ie.metadata,"connectionEffectiveType",Q),ae(ie.metadata,"navigatorUserAgent",navigator.userAgent),ae(ie.metadata,"screenWidth",window.screen.width),ae(ie.metadata,"screenHeight",window.screen.height),ae(ie.metadata,"windowWidth",window.innerWidth),ae(ie.metadata,"windowHeight",window.innerHeight),ae(ie.metadata,"mapWidth",S.width/G),ae(ie.metadata,"mapHeight",S.height/G),ae(ie.metadata,"webglRenderer",S.renderer),ae(ie.metadata,"webglVendor",S.vendor),ae(ie.metadata,"sdkVersion",s),ae(ie.metadata,"sdkIdentifier","mapbox-gl-js"),ie}(p);for(const S of T.metadata);for(const S of T.counters);for(const S of T.attributes);this.postEvent(b,T,()=>{},y)}},md=Dl.postPerformanceEvent.bind(Dl),iy=new class extends ll{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(b,p,y,T){if(!Ft.API_URL||!Ft.SESSION_PATH)return;const S=sa(Ft.API_URL+Ft.SESSION_PATH);S.params.push(`sku=${p||""}`),S.params.push(`access_token=${T||Ft.ACCESS_TOKEN||""}`);const R={url:Zl(S),headers:{"Content-Type":"text/plain"}};this.pendingRequest=true,async function(M){return Qa(Object.assign(M,{method:"GET"}),void 0)}(R).then(()=>{this.pendingRequest=false,y(null),this.saveEventData(),this.processRequests()}).catch(M=>{this.pendingRequest=false,y(M),this.saveEventData(),this.processRequests()})}getSessionAPI(b,p,y,T){this.skuToken=p,this.errorCb=T,Ft.EVENTS_URL&&Ft.SESSION_PATH&&Ft.API_URL&&(y||Ft.ACCESS_TOKEN?this.queueRequest({id:b,timestamp:Date.now()},y):this.errorCb(new Error(Df)))}processRequests(){if(this.pendingRequest||0===this.queue.length)return;const{id:b,timestamp:p,customAccessToken:y}=this.queue.shift();b&&this.success[b]||this.getSession(p,this.skuToken,T=>{T?this.errorCb(T):b&&(this.success[b]=true)},y)}remove(){this.errorCb=null}},Pv=iy.getSessionAPI.bind(iy),Ch=new Set;function QS(b,p=0){const y=3432918353,T=461845907,S=b.length,R=S-(3&S);let M,F=0|p,G=0;for(;G>>17,M=Math.imul(M,T),F^=M,F=F<<13|F>>>19,F=Math.imul(F,5)+3864292196|0;M=0;const q=3&S;return q>0&&(q>=3&&(M^=(255&b.charCodeAt(G+2))<<16),q>=2&&(M^=(255&b.charCodeAt(G+1))<<8),M^=255&b.charCodeAt(G),M=Math.imul(M,y),M=M<<15|M>>>17,M=Math.imul(M,T),F^=M),F^=S,F^=F>>>16,F=Math.imul(F,2246822507),F^=F>>>13,F=Math.imul(F,3266489909),F^=F>>>16,F>>>0}class l0{constructor(p,...y){Object.assign(this,y[0]||{}),this.type=p}}class hp extends l0{constructor(p,y={}){super("error",{error:p,...y})}}function c0(b,p,y){y[b]&&y[b].includes(p)||(y[b]=y[b]||[],y[b].push(p))}function Cb(b,p,y){if(y&&y[b]){const T=y[b].indexOf(p);-1!==T&&y[b].splice(T,1)}}class tm{on(p,y){return this._listeners=this._listeners||{},c0(p,y,this._listeners),this}off(p,y){return Cb(p,y,this._listeners),Cb(p,y,this._oneTimeListeners),this}once(p,y){return y?(this._oneTimeListeners=this._oneTimeListeners||{},c0(p,y,this._oneTimeListeners),this):new Promise(T=>{this.once(p,T)})}fire(p,y){const T="string"==typeof p?new l0(p,y):p,S=T.type;if(this.listens(S)){T.target=this;const R=this._listeners&&this._listeners[S]?this._listeners[S].slice():[];for(const G of R)G.call(this,T);const M=this._oneTimeListeners&&this._oneTimeListeners[S]?this._oneTimeListeners[S].slice():[];for(const G of M)Cb(S,G,this._oneTimeListeners),G.call(this,T);const F=this._eventedParent;if(F){const G="function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData;Object.assign(T,G),F.fire(T)}}else T instanceof hp&&console.error(T.error);return this}listens(p){return!!(this._listeners&&this._listeners[p]&&this._listeners[p].length>0||this._oneTimeListeners&&this._oneTimeListeners[p]&&this._oneTimeListeners[p].length>0||this._eventedParent&&this._eventedParent.listens(p))}setEventedParent(p,y){return this._eventedParent=p,this._eventedParentData=y,this}}class gd{constructor(p){"string"==typeof p?this.name=p:(this.name=p.name,this.iconsetId=p.iconsetId)}static from(p){return new gd(p)}static toString(p){return p.iconsetId?`${p.name}${p.iconsetId}`:p.name}static parse(p){const[y,T]=p.split("");return new gd({name:y,iconsetId:T})}static isEqual(p,y){return p.name===y.name&&p.iconsetId===y.iconsetId}toString(){return gd.toString(this)}serialize(){return{name:this.name,iconsetId:this.iconsetId}}}var Sb,Zx={},Iv=function(){if(Sb)return Zx;Sb=1;var b={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function p(R){return(R=Math.round(R))<0?0:R>255?255:R}function y(R){return p("%"===R[R.length-1]?parseFloat(R)/100*255:parseInt(R))}function T(R){return(M="%"===R[R.length-1]?parseFloat(R)/100:parseFloat(R))<0?0:M>1?1:M;var M}function S(R,M,F){return F<0?F+=1:F>1&&(F-=1),6*F<1?R+(M-R)*F*6:2*F<1?M:3*F<2?R+(M-R)*(2/3-F)*6:R}try{Zx.parseCSSColor=function(R){var M,F=R.replace(/ /g,"").toLowerCase();if(F in b)return b[F].slice();if("#"===F[0])return 4===F.length?(M=parseInt(F.substr(1),16))>=0&&M<=4095?[(3840&M)>>4|(3840&M)>>8,240&M|(240&M)>>4,15&M|(15&M)<<4,1]:null:7===F.length&&(M=parseInt(F.substr(1),16))>=0&&M<=16777215?[(16711680&M)>>16,(65280&M)>>8,255&M,1]:null;var G=F.indexOf("("),q=F.indexOf(")");if(-1!==G&&q+1===F.length){var Q=F.substr(0,G),ie=F.substr(G+1,q-(G+1)).split(","),ae=1;switch(Q){case"rgba":if(4!==ie.length)return null;ae=T(ie.pop());case"rgb":return 3!==ie.length?null:[y(ie[0]),y(ie[1]),y(ie[2]),ae];case"hsla":if(4!==ie.length)return null;ae=T(ie.pop());case"hsl":if(3!==ie.length)return null;var de=(parseFloat(ie[0])%360+360)%360/360,pe=T(ie[1]),_e=T(ie[2]),Se=_e<=.5?_e*(pe+1):_e+pe-_e*pe,Fe=2*_e-Se;return[p(255*S(Fe,Se,de+1/3)),p(255*S(Fe,Se,de)),p(255*S(Fe,Se,de-1/3)),ae];default:return null}}return null}}catch(R){}return Zx}();function Si(b,p,y){return b*(1-y)+p*y}const fT=new Map;class Wo{constructor(p,y,T,S=1){this.r=p,this.g=y,this.b=T,this.a=S}static parse(p){if(!p)return;if(p instanceof Wo)return p;if("string"!=typeof p)return;const y=fT.get(p);if(y)return y;const T=Iv.parseCSSColor(p);if(!T)return;const S=new Wo(T[0]/255,T[1]/255,T[2]/255,T[3]);return fT.set(p,S),S}toString(){const{r:p,g:y,b:T,a:S}=this;return`rgba(${Math.round(255*p)},${Math.round(255*y)},${Math.round(255*T)},${S})`}toNonPremultipliedRenderColor(p){const{r:y,g:T,b:S,a:R}=this;return new o7(p,y,T,S,R)}toPremultipliedRenderColor(p){const{r:y,g:T,b:S,a:R}=this;return new a7(p,y*R,T*R,S*R,R)}clone(){return new Wo(this.r,this.g,this.b,this.a)}}class Mv{constructor(p,y,T,S,R,M=false){if(this.premultiplied=false,this.premultiplied=M,p){const F=p.image.height,G=F*F;this.premultiplied?(y=0===R?0:y/R*(F-1),T=0===R?0:T/R*(F-1),S=0===R?0:S/R*(F-1)):(y*=F-1,T*=F-1,S*=F-1),y=Math.max(0,Math.min(F-1,y)),T=Math.max(0,Math.min(F-1,T)),S=Math.max(0,Math.min(F-1,S));const q=Math.floor(y),Q=Math.floor(T),ie=Math.floor(S),ae=Math.ceil(y),de=Math.ceil(T),pe=Math.ceil(S),_e=y-q,Se=T-Q,Fe=S-ie,Ye=p.image.data,Xe=4*(q+Q*G+ie*F),We=4*(q+Q*G+pe*F),rt=4*(q+de*G+ie*F),lt=4*(q+de*G+pe*F),Bt=4*(ae+Q*G+ie*F),ht=4*(ae+Q*G+pe*F),Tt=4*(ae+de*G+ie*F),Lt=4*(ae+de*G+pe*F);this.r=Si(Si(Si(Ye[Xe],Ye[We],Fe),Si(Ye[rt],Ye[lt],Fe),Se),Si(Si(Ye[Bt],Ye[ht],Fe),Si(Ye[Tt],Ye[Lt],Fe),Se),_e)/255*(this.premultiplied?R:1),this.g=Si(Si(Si(Ye[Xe+1],Ye[We+1],Fe),Si(Ye[rt+1],Ye[lt+1],Fe),Se),Si(Si(Ye[Bt+1],Ye[ht+1],Fe),Si(Ye[Tt+1],Ye[Lt+1],Fe),Se),_e)/255*(this.premultiplied?R:1),this.b=Si(Si(Si(Ye[Xe+2],Ye[We+2],Fe),Si(Ye[rt+2],Ye[lt+2],Fe),Se),Si(Si(Ye[Bt+2],Ye[ht+2],Fe),Si(Ye[Tt+2],Ye[Lt+2],Fe),Se),_e)/255*(this.premultiplied?R:1),this.a=R}else this.r=y,this.g=T,this.b=S,this.a=R}toArray(){const{r:p,g:y,b:T,a:S}=this;return[255*p,255*y,255*T,S]}toHslaArray(){let{r:p,g:y,b:T,a:S}=this;if(this.premultiplied){if(0===S)return[0,0,0,0];const pe=1/S;p*=pe,y*=pe,T*=pe}const R=Math.min(Math.max(p,0),1),M=Math.min(Math.max(y,0),1),F=Math.min(Math.max(T,0),1),G=Math.min(R,M,F),q=Math.max(R,M,F),Q=q-G,ie=.5*(G+q);if(0===Q)return[0,0,100*ie,S];const ae=ie>.5?Q/(2-q-G):Q/(q+G);let de;switch(q){case R:de=60*((M-F)/Q+(MSi(T,p[S],y))}Wo.black=new Wo(0,0,0,1),Wo.white=new Wo(1,1,1,1),Wo.transparent=new Wo(0,0,0,0),Wo.red=new Wo(1,0,0,1),Wo.blue=new Wo(0,0,1,1);var v2=Object.freeze({__proto__:null,array:pp,color:function(b,p,y){return new Wo(Si(b.r,p.r,y),Si(b.g,p.g,y),Si(b.b,p.b,y),Si(b.a,p.a,y))},number:Si});class Sh extends Error{constructor(p,y){super(y),this.message=y,this.key=p}}class eA{constructor(p,y=[]){this.parent=p,this.bindings=Object.create(null);for(const[T,S]of y)this.bindings[T]=S}concat(p){return new eA(this,p)}get(p){if(this.bindings[p])return this.bindings[p];if(this.parent)return this.parent.get(p);throw new Error(`${p} not found in scope.`)}has(p){return!!this.bindings[p]||!!this.parent&&this.parent.has(p)}}const _2={kind:"null"},xi={kind:"number"},ts={kind:"string"},wa={kind:"boolean"},oh={kind:"color"},u0={kind:"object"},Na={kind:"value"},oy={kind:"collator"},Jx={kind:"formatted"},T2={kind:"resolvedImage"};function Vl(b,p){return{kind:"array",itemType:b,N:p}}function Fl(b){if("array"===b.kind){const p=Fl(b.itemType);return"number"==typeof b.N?`array<${p}, ${b.N}>`:"value"===b.itemType.kind?"array":`array<${p}>`}return b.kind}const d0=[_2,xi,ts,wa,oh,Jx,u0,Vl(Na),T2];function nm(b,p){if("error"===p.kind)return null;if("array"===b.kind){if("array"===p.kind&&(0===p.N&&"value"===p.itemType.kind||!nm(b.itemType,p.itemType))&&("number"!=typeof b.N||b.N===p.N))return null}else{if(b.kind===p.kind)return null;if("value"===b.kind){for(const y of d0)if(!nm(y,p))return null}}return`Expected ${Fl(b)} but found ${Fl(p)} instead.`}function YP(b,p){return p.some(y=>"null"===y?null===b:"array"===y?Array.isArray(b):"object"===y?b&&!Array.isArray(b)&&"object"==typeof b:y===typeof b)}function tA(b,p){return"array"===b.kind&&"array"===p.kind?b.N===p.N&&tA(b.itemType,p.itemType):b.kind===p.kind}class qP{constructor(p,y,T){this.sensitivity=p?y?"variant":"case":y?"accent":"base",this.locale=T,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(p,y){return this.collator.compare(p,y)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class w2{constructor(p,y,T,S,R){this.text=p.normalize?p.normalize():p,this.image=y,this.scale=T,this.fontStack=S,this.textColor=R}}class yd{constructor(p){this.sections=p}static fromString(p){return new yd([new w2(p,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(p=>0!==p.text.length||!!p.image&&p.image.hasPrimary())}static factory(p){return p instanceof yd?p:yd.fromString(p)}toString(){return 0===this.sections.length?"":this.sections.map(p=>p.text).join("")}serialize(){const p=["format"];for(const y of this.sections){if(y.image){const S=y.image.getPrimary().id.toString();p.push(["image",S]);continue}p.push(y.text);const T={};y.fontStack&&(T["text-font"]=["literal",y.fontStack.split(",")]),y.scale&&(T["font-scale"]=y.scale),y.textColor&&(T["text-color"]=["rgba"].concat(y.textColor.toNonPremultipliedRenderColor(null).toArray())),p.push(T)}return p}}class ay{constructor(p,y={}){this.id=gd.from(p),this.params=y.params,this.sx=y.sx||1,this.sy=y.sy||1}toString(){return JSON.stringify(this)}static parse(p){let y,T,S,R;try{({id:y,params:T,sx:S,sy:R}=JSON.parse(p)||{})}catch(M){return null}return y?new ay(y,{params:T,sx:S,sy:R}):null}scaleSelf(p,y=p){return this.sx*=p,this.sy*=y,this}}class Ah{constructor(p,y,T,S,R=false){this.primaryId=gd.from(p),this.primaryOptions=y,T&&(this.secondaryId=gd.from(T)),this.secondaryOptions=S,this.available=R}toString(){return this.primaryId&&this.secondaryId?`[${this.primaryId.name},${this.secondaryId.name}]`:this.primaryId.name}hasPrimary(){return!!this.primaryId}getPrimary(){return new ay(this.primaryId,this.primaryOptions)}hasSecondary(){return!!this.secondaryId}getSecondary(){return this.secondaryId?new ay(this.secondaryId,this.secondaryOptions):null}static from(p){return"string"!=typeof p?p:Ah.build({name:p})}static build(p,y,T,S){return!p||"object"==typeof p&&!("name"in p)?null:new Ah(p,T,y,S)}}function UF(b,p,y,T){return"number"==typeof b&&b>=0&&b<=255&&"number"==typeof p&&p>=0&&p<=255&&"number"==typeof y&&y>=0&&y<=255?void 0===T||"number"==typeof T&&T>=0&&T<=1?null:`Invalid rgba value [${[b,p,y,T].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof T?[b,p,y,T]:[b,p,y]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function E2(b){if(null===b)return true;if("string"==typeof b)return true;if("boolean"==typeof b)return true;if("number"==typeof b)return true;if(b instanceof Wo)return true;if(b instanceof qP)return true;if(b instanceof yd)return true;if(b instanceof Ah)return true;if(Array.isArray(b)){for(const p of b)if(!E2(p))return false;return true}if("object"==typeof b){for(const p in b)if(!E2(b[p]))return false;return true}return false}function Yd(b){if(null===b)return _2;if("string"==typeof b)return ts;if("boolean"==typeof b)return wa;if("number"==typeof b)return xi;if(b instanceof Wo)return oh;if(b instanceof qP)return oy;if(b instanceof yd)return Jx;if(b instanceof Ah)return T2;if(Array.isArray(b)){const p=b.length;let y;for(const T of b){const S=Yd(T);if(y){if(y===S)continue;y=Na;break}y=S}return Vl(y||Na,p)}return u0}function f0(b){return null===b?"":"string"==typeof b||"number"==typeof b||"boolean"==typeof b?String(b):b instanceof yd||b instanceof Ah||b instanceof Wo?b.toString():JSON.stringify(b)}class Qx{constructor(p,y){this.type=p,this.value=y}static parse(p,y){if(2!==p.length)return y.error(`'literal' expression requires exactly one argument, but found ${p.length-1} instead.`);if(!E2(p[1]))return y.error("invalid value");const T=p[1];let S=Yd(T);const R=y.expectedType;return"array"!==S.kind||0!==S.N||!R||"array"!==R.kind||"number"==typeof R.N&&0!==R.N||(S=R),new Qx(S,T)}evaluate(){return this.value}eachChild(){}outputDefined(){return true}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof Wo?["rgba"].concat(this.value.toNonPremultipliedRenderColor(null).toArray()):this.value instanceof yd?this.value.serialize():this.value}}class Zu{constructor(p){this.name="ExpressionEvaluationError",this.message=p}toJSON(){return this.message}}const XP={string:ts,number:xi,boolean:wa,object:u0};class To{constructor(p,y){this.type=p,this.args=y}static parse(p,y){if(p.length<2)return y.error("Expected at least one argument.");let T,S=1;const R=p[0];if("array"===R){let F,G;if(p.length>2){const q=p[1];if("string"!=typeof q||!(q in XP)||"object"===q)return y.error('The item type argument of "array" must be one of string, number, boolean',1);F=XP[q],S++}else F=Na;if(p.length>3){if(null!==p[2]&&("number"!=typeof p[2]||p[2]<0||p[2]!==Math.floor(p[2])))return y.error('The length argument to "array" must be a positive integer literal',2);G=p[2],S++}T=Vl(F,G)}else T=XP[R];const M=[];for(;Sp.outputDefined())}serialize(){const p=this.type,y=[p.kind];if("array"===p.kind){const T=p.itemType;if("string"===T.kind||"number"===T.kind||"boolean"===T.kind){y.push(T.kind);const S=p.N;("number"==typeof S||this.args.length>1)&&y.push(S)}}return y.concat(this.args.map(T=>T.serialize()))}}class Jm{constructor(p){this.type=Jx,this.sections=p}static parse(p,y){if(p.length<2)return y.error("Expected at least one argument.");const T=p[1];if(!Array.isArray(T)&&"object"==typeof T)return y.error("First argument must be an image or text section.");const S=[];let R=false;for(let M=1;M<=p.length-1;++M){const F=p[M];if(R&&"object"==typeof F&&!Array.isArray(F)){R=false;let G=null;if(F["font-scale"]&&(G=y.parseObjectValue(F["font-scale"],M,"font-scale",xi),!G))return null;let q=null;if(F["text-font"]&&(q=y.parseObjectValue(F["text-font"],M,"text-font",Vl(ts)),!q))return null;let Q=null;if(F["text-color"]&&(Q=y.parseObjectValue(F["text-color"],M,"text-color",oh),!Q))return null;const ie=S.at(-1);ie.scale=G,ie.font=q,ie.textColor=Q}else{const G=y.parse(p[M],M,Na);if(!G)return null;const q=G.type.kind;if("string"!==q&&"value"!==q&&"null"!==q&&"resolvedImage"!==q)return y.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");R=true,S.push({content:G,scale:null,font:null,textColor:null})}}return new Jm(S)}evaluate(p){return new yd(this.sections.map(y=>{const T=y.content.evaluate(p);return tA(Yd(T),T2)?new w2("",T,null,null,null):new w2(f0(T),null,y.scale?y.scale.evaluate(p):null,y.font?y.font.evaluate(p).join(","):null,y.textColor?y.textColor.evaluate(p):null)}))}eachChild(p){for(const y of this.sections)p(y.content),y.scale&&p(y.scale),y.font&&p(y.font),y.textColor&&p(y.textColor)}outputDefined(){return false}serialize(){const p=["format"];for(const y of this.sections){p.push(y.content.serialize());const T={};y.scale&&(T["font-scale"]=y.scale.serialize()),y.font&&(T["text-font"]=y.font.serialize()),y.textColor&&(T["text-color"]=y.textColor.serialize()),p.push(T)}return p}}class C2{constructor(p,y,T,S){this._imageWarnHistory={},this.type=T2,this.namePrimary=p,this.nameSecondary=y,T&&(this.paramsPrimary=T.params,this.iconsetIdPrimary=T.iconset?T.iconset.id:void 0),S&&(this.paramsSecondary=S.params,this.iconsetIdSecondary=S.iconset?S.iconset.id:void 0)}static parse(p,y){if(p.length<2)return y.error("Expected two or more arguments.");let T=1;const S=[];function R(){if(Tgd.isEqual(M,R)),S.available){const M=S.getSecondary()?S.getSecondary().id:null;M&&(S.available=p.availableImages.some(F=>gd.isEqual(F,M)))}}return S}eachChild(p){if(p(this.namePrimary),this.paramsPrimary)for(const y in this.paramsPrimary)this.paramsPrimary[y]&&p(this.paramsPrimary[y]);if(this.nameSecondary&&(p(this.nameSecondary),this.paramsSecondary))for(const y in this.paramsSecondary)this.paramsSecondary[y]&&p(this.paramsSecondary[y])}outputDefined(){return false}serializeOptions(p,y){const T={};if(y&&(T.iconset={id:y}),p){T.params={};for(const S in p)p[S]&&(T.params[S]=p[S].serialize())}return Object.keys(T).length>0?T:void 0}serialize(){const p=["image",this.namePrimary.serialize()];if(this.paramsPrimary||this.iconsetIdPrimary){const y=this.serializeOptions(this.paramsPrimary,this.iconsetIdPrimary);y&&p.push(y)}if(this.nameSecondary&&(p.push(this.nameSecondary.serialize()),this.paramsSecondary||this.iconsetIdSecondary)){const y=this.serializeOptions(this.paramsSecondary,this.iconsetIdSecondary);y&&p.push(y)}return p}}function nA(b){return jP(b)?"string":A2(b)?"number":VF(b)?"boolean":Array.isArray(b)?"array":null===b?"null":S2(b)?"object":typeof b}function S2(b){return null!=b&&!Array.isArray(b)&&"function"!=typeof b&&!(b instanceof String||b instanceof Number||b instanceof Boolean)&&"object"==typeof b}function jP(b){return"string"==typeof b||b instanceof String}function A2(b){return"number"==typeof b||b instanceof Number}function VF(b){return"boolean"==typeof b||b instanceof Boolean}const s7={"to-boolean":wa,"to-color":oh,"to-number":xi,"to-string":ts};class Lv{constructor(p,y){this.type=p,this.args=y}static parse(p,y){if(p.length<2)return y.error("Expected at least one argument.");const T=p[0],S=[];let R=_2;if("to-array"===T){if(!Array.isArray(p[1]))return null;const M=p[1].length;if(y.expectedType){if("array"!==y.expectedType.kind)return y.error(`Expected ${y.expectedType.kind} but found array.`);R=Vl(y.expectedType.itemType,M)}else{if(!(M>0&&E2(p[1][0])))return null;R=Vl(Yd(p[1][0]),M)}for(let F=0;F4?`Invalid rbga value ${JSON.stringify(y)}: expected an array containing either three or four numeric values.`:UF(y[0],y[1],y[2],y[3]),!T))return new Wo(y[0]/255,y[1]/255,y[2]/255,y[3])}throw new Zu(T||`Could not parse color from value '${"string"==typeof y?y:String(JSON.stringify(y))}'`)}if("number"===this.type.kind){let y=null;for(const T of this.args){if(y=T.evaluate(p),null===y)return 0;const S=Number(y);if(!isNaN(S))return S}throw new Zu(`Could not convert ${JSON.stringify(y)} to number.`)}return"formatted"===this.type.kind?yd.fromString(f0(this.args[0].evaluate(p))):"resolvedImage"===this.type.kind?Ah.build(f0(this.args[0].evaluate(p))):"array"===this.type.kind?this.args.map(y=>y.evaluate(p)):f0(this.args[0].evaluate(p))}eachChild(p){this.args.forEach(p)}outputDefined(){return this.args.every(p=>p.outputDefined())}serialize(){if("formatted"===this.type.kind)return new Jm([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new C2(this.args[0]).serialize();const p="array"===this.type.kind?[]:[`to-${this.type.kind}`];return this.eachChild(y=>{p.push(y.serialize())}),p}}const l7=["Unknown","Point","LineString","Polygon"];class sy{constructor(p,y,T){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null,this.scope=p,this.options=y,this.iconImageUseTheme=T}id(){return this.feature&&void 0!==this.feature.id?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?l7[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}measureLight(p){return this.globals.brightness||0}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const p=this.featureDistanceData.center,y=this.featureDistanceData.scale,{x:T,y:S}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(T*y-p[0])+this.featureDistanceData.bearing[1]*(S*y-p[1])}return 0}parseColor(p){return Wo.parse(p)}getConfig(p){return this.options?this.options.get(p):null}}class mp{constructor(p,y,T,S,R){this.name=p,this.type=y,this._evaluate=T,this.args=S,this._overloadIndex=R}evaluate(p){if(!this._evaluate){const y=mp.definitions[this.name];this._evaluate=Array.isArray(y)?y[2]:y.overloads[this._overloadIndex][1]}return this._evaluate(p,this.args)}eachChild(p){this.args.forEach(p)}outputDefined(){return false}serialize(){return[this.name].concat(this.args.map(p=>p.serialize()))}static parse(p,y){const T=p[0],S=mp.definitions[T];if(!S)return y.error(`Unknown expression "${T}". If you wanted a literal array, use ["literal", [...]].`,0);const R=Array.isArray(S)?S[0]:S.type,M=Array.isArray(S)?[[S[1],S[2]]]:S.overloads,F=[];let G=null,q=-1;for(const[Q,ie]of M){if(Array.isArray(Q)&&Q.length!==p.length-1)continue;F.push(Q),q++,null===G?G=y._forkForSignature():G.errors.length=0;const ae=[];let de=false;for(let pe=1;peae)).map(c7).join(" | "),ie=[];for(let ae=1;aey[2]){const S=.5*T;let R=b[0]-y[0]>S?-T:y[0]-b[0]>S?T:0;0===R&&(R=b[0]-y[2]>S?-T:y[2]-b[0]>S?T:0),b[0]+=R}an(p,b)}function KP(b,p,y,T){const S=Math.pow(2,T.z)*hT,R=[T.x*hT,T.y*hT],M=[];if(!b)return M;for(const F of b)for(const G of F){const q=[G.x+R[0],G.y+R[1]];Xae(q,p,y,S),M.push(q)}return M}function LY(b,p,y,T){const S=Math.pow(2,T.z)*hT,R=[T.x*hT,T.y*hT],M=[];if(!b)return M;for(const G of b){const q=[];for(const Q of G){const ie=[Q.x+R[0],Q.y+R[1]];an(p,ie),q.push(ie)}M.push(q)}if(p[2]-p[0]<=S/2){(F=p)[0]=F[1]=1/0,F[2]=F[3]=-1/0;for(const G of M)for(const q of G)Xae(q,p,y,S)}var F;return M}class rA{constructor(p,y){this.type=wa,this.geojson=p,this.geometries=y}static parse(p,y){if(2!==p.length)return y.error(`'within' expression requires exactly one argument, but found ${p.length-1} instead.`);if(E2(p[1])){const T=p[1];if("FeatureCollection"===T.type)for(let S=0;STS?1:0){if(this.data=p,this.length=this.data.length,this.compare=y,this.length>0)for(let T=(this.length>>1)-1;T>=0;T--)this._down(T)}push(p){this.data.push(p),this._up(this.length++)}pop(){if(0===this.length)return;const p=this.data[0],y=this.data.pop();return--this.length>0&&(this.data[0]=y,this._down(0)),p}peek(){return this.data[0]}_up(p){const{data:y,compare:T}=this,S=y[p];for(;p>0;){const R=p-1>>1,M=y[R];if(T(S,M)>=0)break;y[p]=M,p=R}y[p]=S}_down(p){const{data:y,compare:T}=this,S=this.length>>1,R=y[p];for(;p=0)break;y[p]=y[M],p=M}y[p]=R}}var qr=8192;const ZP=1/298.257223563,GF=ZP*(2-ZP),jae=Math.PI/180;function DY(b){const p=6378.137*jae*1e3,y=Math.cos(b*jae),T=1/(1-GF*(1-y*y)),S=Math.sqrt(T);return[p*S*y,p*S*T*(1-GF)]}function iA(b){for(;b<-180;)b+=360;for(;b>180;)b-=360;return b}function JP(b,p,y,T){const S=iA(b[0]-p[0])*y,R=(b[1]-p[1])*T;return Math.sqrt(S*S+R*R)}function oA(b,p,y,T,S){let R=p[0],M=p[1],F=iA(y[0]-R)*T,G=(y[1]-M)*S;if(0!==F||0!==G){const q=(iA(b[0]-R)*T*F+(b[1]-M)*S*G)/(F*F+G*G);q>1?(R=y[0],M=y[1]):q>0&&(R+=F/T*q,M+=G/S*q)}return F=iA(b[0]-R)*T,G=(b[1]-M)*S,Math.sqrt(F*F+G*G)}function HF(b,p){return p.dist-b.dist}function WF(b){const p=[1/0,1/0,-1/0,-1/0];if(p.length!==b.length)return false;for(let y=0;y=b[0]&&b[1]b[1])return[null,null];const y=u7(b);if(p){if(2===y)return[b,null];const T=Math.floor(y/2);return[[b[0],b[0]+T],[b[0]+T,b[1]]]}{if(1===y)return[b,null];const T=Math.floor(y/2)-1;return[[b[0],b[0]+T],[b[0]+T+1,b[1]]]}}function aA(b,p){const y=[1/0,1/0,-1/0,-1/0];if(!Ab(p,b.length))return y;for(let T=p[0];T<=p[1];++T)an(y,b[T]);return y}function d7(b){const p=[1/0,1/0,-1/0,-1/0];for(let y=0;yp[2]&&(S=b[0]-p[2]),b[1]>p[3]&&(R=b[1]-p[3]),b[3]1?(de=R[ae+1][0],pe=R[ae+1][1]):Fe>0&&(de+=_e/F*Fe,pe+=Se/G*Fe)),_e=iA(M[0]-de)*F,Se=(M[1]-pe)*G;const Ye=_e*_e+Se*Se;Ye=S)return S;if(Xt(R,M)){if(Jae(b,p))return 0}else if(Jae(p,b))return 0;let F=S;for(const G of b)for(let q=0,Q=G.length,ie=Q-1;q=M)continue;const ie=Q.range1;if(u7(ie)<=G){if(!Ab(ie,b.length))return NaN;if(p){const ae=vOe(b,ie,y,T,S);if(0===(M=Math.min(M,ae)))return M}else for(let ae=ie[0];ae<=ie[1];++ae){const de=Zae(b[ae],y,T,S);if(0===(M=Math.min(M,de)))return M}}else{const ae=FY(ie,p);if(null!==ae[0]){const de=QP(aA(b,ae[0]),q,T,S);de=F)continue;const ae=ie.range1,de=ie.range2;if(u7(ae)<=q&&u7(de)<=Q){if(!Ab(ae,b.length)||!Ab(de,y.length))return NaN;if(p&&T?F=Math.min(F,xOe(b,ae,y,de,S,R)):p||T?p&&!T?F=Math.min(F,NY(y,de,b,ae,S,R)):!p&&T&&(F=Math.min(F,NY(b,ae,y,de,S,R))):F=Math.min(F,Dv(b,ae,y,de,S,R)),0===F)return F}else{const pe=FY(ae,p),_e=FY(de,T);eI(G,F,S,R,b,y,pe[0],_e[0]),eI(G,F,S,R,b,y,pe[0],_e[1]),eI(G,F,S,R,b,y,pe[1],_e[0]),eI(G,F,S,R,b,y,pe[1],_e[1])}}return F}function OY(b,p,y,T,S,R=1/0){let M=R;const F=aA(b,[0,b.length-1]);for(const G of y)if(!(M!==1/0&&QP(F,aA(G,[0,G.length-1]),T,S)>=M)&&(M=Math.min(M,ese(b,p,G,true,T,S,M)),0===M))return M;return M}function h7(b,p,y,T,S,R=1/0){let M=R;const F=aA(b,[0,b.length-1]);for(const G of y){if(M!==1/0&&QP(F,d7(G),T,S)>=M)continue;const q=_Oe(b,p,G,T,S,M);if(isNaN(q))return q;if(0===(M=Math.min(M,q)))return M}return M}function BY(b){return"Point"===b||"MultiPoint"===b||"LineString"===b||"MultiLineString"===b||"Polygon"===b||"MultiPolygon"===b}class sA{constructor(p,y){this.type=xi,this.geojson=p,this.geometries=y}static parse(p,y){if(2!==p.length)return y.error(`'distance' expression requires either one argument, but found ' ${p.length-1} instead.`);if(E2(p[1])){const T=p[1];if("FeatureCollection"===T.type){for(let S=0;S{p&&!lA(y)&&(p=false)}),p}function P2(b){if(b instanceof mp&&"feature-state"===b.name)return false;let p=true;return b.eachChild(y=>{p&&!P2(y)&&(p=false)}),p}function zY(b,p){if(b instanceof mp&&p.has(b.name))return false;let y=true;return b.eachChild(T=>{y&&!zY(T,p)&&(y=false)}),y}function Fv(b,p){return zY(b,new Set(p))}function tse(b,p,y){return[b,p,y].filter(Boolean).join("")}function UY(b,p){switch(b){case"string":return f0(p);case"number":return+p;case"boolean":return!!p;case"color":return Wo.parse(p);case"formatted":return yd.fromString(f0(p));case"resolvedImage":return Ah.build(f0(p))}return p}function VY(b,p,y,T){return void 0!==T&&(b=T*Math.round(b/T)),void 0!==p&&by&&(b=y),b}class tI{constructor(p,y,T,S=false){this.type=p,this.key=y,this.scope=T,this.featureConstant=S}static parse(p,y){let T=y.expectedType;if(T??=Na,p.length<2||p.length>3)return y.error("Invalid number of arguments for 'config' expression.");const S=y.parse(p[1],1);if(!(S instanceof Qx))return y.error("Key name of 'config' expression must be a string literal.");let R,M=true;const F=f0(S.value);if(p.length>=3){const G=y.parse(p[2],2);if(!(G instanceof Qx))return y.error("Scope of 'config' expression must be a string literal.");R=f0(G.value)}if(y.options){const G=tse(F,R,y._scope),q=y.options.get(G);q&&(M=lA(q.value||q.default))}return new tI(T,F,R,M)}evaluate(p){const y=tse(this.key,this.scope,p.scope),T=p.getConfig(y);if(!T)return null;const{type:S,value:R,values:M,minValue:F,maxValue:G,stepValue:q}=T,Q=T.default.evaluate(p);let ie=Q;if(R){const ae=p.scope;p.scope=(ae||"").split("").slice(1).join(""),ie=R.evaluate(p),p.scope=ae}return S&&(ie=UY(S,ie)),void 0===ie||void 0===F&&void 0===G&&void 0===q||("number"==typeof ie?ie=VY(ie,F,G,q):Array.isArray(ie)&&(ie=ie.map(ae=>"number"==typeof ae?VY(ae,F,G,q):ae))),void 0!==R&&void 0!==ie&&M&&!M.includes(ie)&&(ie=Q,S&&(ie=UY(S,ie))),(S&&S!==this.type||void 0!==ie&&!tA(Yd(ie),this.type))&&(ie=UY(this.type.kind,ie)),ie}eachChild(){}outputDefined(){return false}serialize(){const p=["config",this.key];return this.scope&&p.concat(this.scope),p}}class Nv{constructor(p,y){this.type=y.type,this.name=p,this.boundExpression=y}static parse(p,y){if(2!==p.length||"string"!=typeof p[1])return y.error("'var' expression requires exactly one string literal argument.");const T=p[1];return y.scope.has(T)?new Nv(T,y.scope.get(T)):y.error(`Unknown variable "${T}". Make sure "${T}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(p){return this.boundExpression.evaluate(p)}eachChild(){}outputDefined(){return false}serialize(){return["var",this.name]}}class cA{constructor(p,y=[],T,S=new eA,R=[],M,F,G){this.registry=p,this.path=y,this.scope=S,this.errors=R,this.expectedType=T,this._scope=M,this.options=F,this.iconImageUseTheme=G}get key(){let p="";for(let y=0;y`[${S}]`).join("")}`;this.errors.push(new Sh(T,p))}checkSubtype(p,y,T){const S=nm(p,y);return S&&this.error(S,..."number"==typeof T?[T]:[]),S}}const TOe=new Set(["zoom","heatmap-density","worldview","line-progress","raster-value","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center","measure-light","raster-particle-speed","is-active-floor"]);function nse(b,p,y){return"assert"===y?new To(p,[b]):"coerce"===y?new Lv(p,[b]):b}function YF(b){if(b instanceof Nv)return YF(b.boundExpression);if(b instanceof mp&&"error"===b.name)return false;if(b instanceof k2)return false;if(b instanceof rA)return false;if(b instanceof sA)return false;if(b instanceof tI)return false;const p=b instanceof Lv||b instanceof To;let y=true;return b.eachChild(T=>{y=p?y&&YF(T):y&&T instanceof Qx}),!!y&&lA(b)&&zY(b,TOe)}function qF(b,p){const y=b.length-1;let T,S,R=0,M=y,F=0;for(;R<=M;)if(F=Math.floor((R+M)/2),T=b[F],S=b[F+1],T<=p){if(F===y||pp))throw new Zu("Input is not a number.");M=F-1}return 0}class uA{constructor(p,y,T){this.type=p,this.input=y,this.labels=[],this.outputs=[];for(const[S,R]of T)this.labels.push(S),this.outputs.push(R)}static parse(p,y){if(p.length-1<4)return y.error(`Expected at least 4 arguments, but found only ${p.length-1}.`);if((p.length-1)%2!=0)return y.error("Expected an even number of arguments.");const T=y.parse(p[1],1,xi);if(!T)return null;const S=[];let R=null;y.expectedType&&"value"!==y.expectedType.kind&&(R=y.expectedType);for(let M=1;M=F)return y.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',q);const ie=y.parse(G,Q,R);if(!ie)return null;R=R||ie.type,S.push([F,ie])}return new uA(R,T,S)}evaluate(p){const y=this.labels,T=this.outputs;if(1===y.length)return T[0].evaluate(p);const S=this.input.evaluate(p);if(S<=y[0])return T[0].evaluate(p);const R=y.length;return S>=y[R-1]?T[R-1].evaluate(p):T[qF(y,S)].evaluate(p)}eachChild(p){p(this.input);for(const y of this.outputs)p(y)}outputDefined(){return this.outputs.every(p=>p.outputDefined())}serialize(){const p=["step",this.input.serialize()];for(let y=0;y0&&p.push(this.labels[y]),p.push(this.outputs[y].serialize());return p}}const I2=.95047,rse=1.08883,ise=4/29,nI=6/29,$Y=3*nI*nI,wOe=nI*nI*nI,Jl=Math.PI/180,EOe=180/Math.PI;function GY(b){return b>wOe?Math.pow(b,1/3):b/$Y+ise}function HY(b){return b>nI?b*b*b:$Y*(b-ise)}function WY(b){return 255*(b<=.0031308?12.92*b:1.055*Math.pow(b,1/2.4)-.055)}function YY(b){return(b/=255)<=.04045?b/12.92:Math.pow((b+.055)/1.055,2.4)}function ose(b){const p=YY(b.r),y=YY(b.g),T=YY(b.b),S=GY((.4124564*p+.3575761*y+.1804375*T)/I2),R=GY((.2126729*p+.7151522*y+.072175*T)/1);return{l:116*R-16,a:500*(S-R),b:200*(R-GY((.0193339*p+.119192*y+.9503041*T)/rse)),alpha:b.a}}function ase(b){let p=(b.l+16)/116,y=isNaN(b.a)?p:p+b.a/500,T=isNaN(b.b)?p:p-b.b/200;return p=1*HY(p),y=I2*HY(y),T=rse*HY(T),new Wo(WY(3.2404542*y-1.5371385*p-.4985314*T),WY(-.969266*y+1.8760108*p+.041556*T),WY(.0556434*y-.2040259*p+1.0572252*T),b.alpha)}function COe(b,p,y){const T=p-b;return b+y*(T>180||T<-180?T-360*Math.round(T/360):T)}const XF={forward:ose,reverse:ase,interpolate:function(b,p,y){return{l:Si(b.l,p.l,y),a:Si(b.a,p.a,y),b:Si(b.b,p.b,y),alpha:Si(b.alpha,p.alpha,y)}}},jF={forward:function(b){const{l:p,a:y,b:T}=ose(b),S=Math.atan2(T,y)*EOe;return{h:S<0?S+360:S,c:Math.sqrt(y*y+T*T),l:p,alpha:b.a}},reverse:function(b){const p=b.h*Jl,y=b.c;return ase({l:b.l,a:Math.cos(p)*y,b:Math.sin(p)*y,alpha:b.alpha})},interpolate:function(b,p,y){return{h:COe(b.h,p.h,y),c:Si(b.c,p.c,y),l:Si(b.l,p.l,y),alpha:Si(b.alpha,p.alpha,y)}}};var sse=Object.freeze({__proto__:null,hcl:jF,lab:XF});class h0{constructor(p,y,T,S,R){this.type=p,this.operator=y,this.interpolation=T,this.input=S,this.labels=[],this.outputs=[];for(const[M,F]of R)this.labels.push(M),this.outputs.push(F)}static interpolationFactor(p,y,T,S){let R=0;if("exponential"===p.name)R=qY(y,p.base,T,S);else if("linear"===p.name)R=qY(y,1,T,S);else if("cubic-bezier"===p.name){const M=p.controlPoints;R=Yr(M[0],M[1],M[2],M[3])(qY(y,1,T,S))}return R}static parse(p,y){let[T,S,R,...M]=p;if(!Array.isArray(S)||0===S.length)return y.error("Expected an interpolation type expression.",1);if("linear"===S[0])S={name:"linear"};else if("exponential"===S[0]){const q=S[1];if("number"!=typeof q)return y.error("Exponential interpolation requires a numeric base.",1,1);S={name:"exponential",base:q}}else{if("cubic-bezier"!==S[0])return y.error(`Unknown interpolation type ${String(S[0])}`,1,0);{const q=S.slice(1);if(4!==q.length||q.some(Q=>"number"!=typeof Q||Q<0||Q>1))return y.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);S={name:"cubic-bezier",controlPoints:q}}}if(p.length-1<4)return y.error(`Expected at least 4 arguments, but found only ${p.length-1}.`);if(p.length-1>3&&(p.length-1)%2!=0)return y.error("Expected an even number of arguments.");if(R=y.parse(R,2,xi),!R)return null;const F=[];let G=null;"interpolate-hcl"===T||"interpolate-lab"===T?G=oh:y.expectedType&&"value"!==y.expectedType.kind&&(G=y.expectedType);for(let q=0;q=Q)return y.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',ae);const pe=y.parse(ie,de,G);if(!pe)return null;G=G||pe.type,F.push([Q,pe])}return"number"===G.kind||"color"===G.kind||"array"===G.kind&&"number"===G.itemType.kind&&"number"==typeof G.N?new h0(G,T,S,R,F):y.error(`Type ${Fl(G)} is not interpolatable.`)}evaluate(p){const y=this.labels,T=this.outputs;if(1===y.length)return T[0].evaluate(p);const S=this.input.evaluate(p);if(S<=y[0])return T[0].evaluate(p);const R=y.length;if(S>=y[R-1])return T[R-1].evaluate(p);const M=qF(y,S),F=h0.interpolationFactor(this.interpolation,S,y[M],y[M+1]),G=T[M].evaluate(p),q=T[M+1].evaluate(p);return"interpolate"===this.operator?v2[this.type.kind.toLowerCase()](G,q,F):"interpolate-hcl"===this.operator?jF.reverse(jF.interpolate(jF.forward(G),jF.forward(q),F)):XF.reverse(XF.interpolate(XF.forward(G),XF.forward(q),F))}eachChild(p){p(this.input);for(const y of this.outputs)p(y)}outputDefined(){return this.outputs.every(p=>p.outputDefined())}serialize(){let p;p="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier",...this.interpolation.controlPoints];const y=[this.operator,p,this.input.serialize()];for(let T=0;Tnm(S,F.type));return new p7(M?Na:T,R)}evaluate(p){let y,T=null,S=0;for(const R of this.args){if(S++,T=R.evaluate(p),T&&T instanceof Ah&&!T.available&&(y||(y=T),T=null,S===this.args.length))return y;if(null!==T)break}return T}eachChild(p){this.args.forEach(p)}outputDefined(){return this.args.every(p=>p.outputDefined())}serialize(){const p=["coalesce"];return this.eachChild(y=>{p.push(y.serialize())}),p}}const SOe=/[^a-zA-Z0-9_]/;class m7{constructor(p,y){this.type=y.type,this.bindings=[].concat(p),this.result=y}evaluate(p){return this.result.evaluate(p)}eachChild(p){for(const y of this.bindings)p(y[1]);p(this.result)}static parse(p,y){if(p.length<4)return y.error(`Expected at least 3 arguments, but found ${p.length-1} instead.`);const T=[];for(let R=1;R=T.length)throw new Zu("Array index out of bounds: index exceeds array size");if(y!==Math.floor(y))throw new Zu("Array index must be an integer. Use at-interpolated for fractional indices");return T[y]}eachChild(p){p(this.index),p(this.input)}outputDefined(){return false}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class jY{constructor(p,y,T){this.type=p,this.index=y,this.input=T}static parse(p,y){if(3!==p.length)return y.error(`Expected 2 arguments, but found ${p.length-1} instead.`);const T=y.parse(p[1],1,xi),S=y.parse(p[2],2,Vl(y.expectedType||Na));return T&&S?new jY(S.type.itemType,T,S):null}evaluate(p){const y=this.index.evaluate(p),T=this.input.evaluate(p);if(y<0)throw new Zu(`Array index out of bounds: ${y} < 0.`);if(y>T.length-1)throw new Zu(`Array index out of bounds: ${y} > ${T.length-1}.`);if(y===Math.floor(y))return T[y];const S=Math.floor(y),R=Math.ceil(y),M=T[S],F=T[R];if("number"!=typeof M||"number"!=typeof F)throw new Zu(`Cannot interpolate between non-number values at index ${y}.`);return Si(M,F,y-S)}eachChild(p){p(this.index),p(this.input)}outputDefined(){return false}serialize(){return["at-interpolated",this.index.serialize(),this.input.serialize()]}}class KY{constructor(p,y,T,S,R,M){this.inputType=p,this.type=y,this.input=T,this.cases=S,this.outputs=R,this.otherwise=M}static parse(p,y){if(p.length<5)return y.error(`Expected at least 4 arguments, but found only ${p.length-1}.`);if(p.length%2!=1)return y.error("Expected an even number of arguments.");let T,S;y.expectedType&&"value"!==y.expectedType.kind&&(S=y.expectedType);const R={},M=[];for(let q=2;qNumber.MAX_SAFE_INTEGER)return y.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`,q);if("number"==typeof de&&Math.floor(de)!==de)return y.error("Numeric branch labels must be integer values.",q);if(T){if(y.checkSubtype(T,Yd(de),q))return null}else T=Yd(de);if(void 0!==R[String(de)])return y.error("Branch labels must be unique.",q);R[String(de)]=M.length}const ae=y.parse(ie,q,S);if(!ae)return null;S=S||ae.type,M.push(ae)}const F=y.parse(p[1],1,Na);if(!F)return null;const G=y.parse(p.at(-1),p.length-1,S);return G?"value"!==F.type.kind&&y.checkSubtype(T,F.type,1)?null:new KY(T,S,F,R,M,G):null}evaluate(p){const y=this.input.evaluate(p);return(tA(Yd(y),this.inputType)&&this.outputs[this.cases[y]]||this.otherwise).evaluate(p)}eachChild(p){p(this.input),this.outputs.forEach(p),p(this.otherwise)}outputDefined(){return this.outputs.every(p=>p.outputDefined())&&this.otherwise.outputDefined()}serialize(){const p=["match",this.input.serialize()],y=Object.keys(this.cases).sort(),T=[],S={};for(const M of y){const F=S[this.cases[M]];void 0===F?(S[this.cases[M]]=T.length,T.push([this.cases[M],[M]])):T[F][1].push(M)}const R=M=>"number"===this.inputType.kind?Number(M):M;for(const[M,F]of T)p.push(1===F.length?R(F[0]):F.map(R)),p.push(this.outputs[M].serialize());return p.push(this.otherwise.serialize()),p}}class ZY{constructor(p,y,T){this.type=p,this.branches=y,this.otherwise=T}static parse(p,y){if(p.length<4)return y.error(`Expected at least 3 arguments, but found only ${p.length-1}.`),null;if(p.length%2!=0)return y.error("Expected an odd number of arguments."),null;let T;y.expectedType&&"value"!==y.expectedType.kind&&(T=y.expectedType);const S=[];for(let M=1;My.outputDefined())&&this.otherwise.outputDefined()}serialize(){const p=["case"];return this.eachChild(y=>{p.push(y.serialize())}),p}}class g7{constructor(p,y,T,S){this.type=p,this.input=y,this.beginIndex=T,this.endIndex=S}static parse(p,y){if(p.length<=2||p.length>=5)return y.error(`Expected 3 or 4 arguments, but found ${p.length-1} instead.`),null;const T=y.parse(p[1],1,Na),S=y.parse(p[2],2,xi);if(!T||!S)return null;if(R=T.type,![Vl(Na),ts,Na].some(M=>M.kind===R.kind))return y.error(`Expected first argument to be of type array or string, but found ${Fl(T.type)} instead`),null;var R;if(4===p.length){const M=y.parse(p[3],3,xi);return M?new g7(T.type,T,S,M):null}return new g7(T.type,T,S)}evaluate(p){const y=this.input.evaluate(p),T=this.beginIndex.evaluate(p);if(!YP(y,["string","array"]))throw new Zu(`Expected first argument to be of type array or string, but found ${Fl(Yd(y))} instead.`);if(this.endIndex){const S=this.endIndex.evaluate(p);return y.slice(T,S)}return y.slice(T)}eachChild(p){p(this.input),p(this.beginIndex),this.endIndex&&p(this.endIndex)}outputDefined(){return false}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const p=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),p]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}function lse(b,p){return"=="===b||"!="===b?"boolean"===p.kind||"string"===p.kind||"number"===p.kind||"null"===p.kind||"value"===p.kind:"string"===p.kind||"number"===p.kind||"value"===p.kind}function cse(b,p,y,T){return 0===T.compare(p,y)}function rI(b,p,y){const T="=="!==b&&"!="!==b;return class Pbr{constructor(R,M,F){this.type=wa,this.lhs=R,this.rhs=M,this.collator=F,this.hasUntypedArgument="value"===R.type.kind||"value"===M.type.kind}static parse(R,M){if(3!==R.length&&4!==R.length)return M.error("Expected two or three arguments.");const F=R[0];let G=M.parse(R[1],1,Na);if(!G)return null;if(!lse(F,G.type))return M.error(`"${F}" comparisons are not supported for type '${Fl(G.type)}'.`,1);let q=M.parse(R[2],2,Na);if(!q)return null;if(!lse(F,q.type))return M.error(`"${F}" comparisons are not supported for type '${Fl(q.type)}'.`,2);if(G.type.kind!==q.type.kind&&"value"!==G.type.kind&&"value"!==q.type.kind)return M.error(`Cannot compare types '${Fl(G.type)}' and '${Fl(q.type)}'.`);T&&("value"===G.type.kind&&"value"!==q.type.kind?G=new To(q.type,[G]):"value"!==G.type.kind&&"value"===q.type.kind&&(q=new To(G.type,[q])));let Q=null;if(4===R.length){if("string"!==G.type.kind&&"string"!==q.type.kind&&"value"!==G.type.kind&&"value"!==q.type.kind)return M.error("Cannot use collator to compare non-string types.");if(Q=M.parse(R[3],3,oy),!Q)return null}return new Pbr(G,q,Q)}evaluate(R){const M=this.lhs.evaluate(R),F=this.rhs.evaluate(R);if(T&&this.hasUntypedArgument){const G=Yd(M),q=Yd(F);if(G.kind!==q.kind||"string"!==G.kind&&"number"!==G.kind)throw new Zu(`Expected arguments for "${b}" to be (string, string) or (number, number), but found (${G.kind}, ${q.kind}) instead.`)}if(this.collator&&!T&&this.hasUntypedArgument){const G=Yd(M),q=Yd(F);if("string"!==G.kind||"string"!==q.kind)return p(R,M,F)}return this.collator?y(R,M,F,this.collator.evaluate(R)):p(R,M,F)}eachChild(R){R(this.lhs),R(this.rhs),this.collator&&R(this.collator)}outputDefined(){return true}serialize(){const R=[b];return this.eachChild(M=>{R.push(M.serialize())}),R}}}const AOe=rI("==",function(b,p,y){return p===y},cse),kOe=rI("!=",function(b,p,y){return p!==y},function(b,p,y,T){return!cse(0,p,y,T)}),ROe=rI("<",function(b,p,y){return p",function(b,p,y){return p>y},function(b,p,y,T){return T.compare(p,y)>0}),IOe=rI("<=",function(b,p,y){return p<=y},function(b,p,y,T){return T.compare(p,y)<=0}),MOe=rI(">=",function(b,p,y){return p>=y},function(b,p,y,T){return T.compare(p,y)>=0});class JY{constructor(p,y,T,S,R,M){this.type=ts,this.number=p,this.locale=y,this.currency=T,this.unit=S,this.minFractionDigits=R,this.maxFractionDigits=M}static parse(p,y){if(3!==p.length)return y.error("Expected two arguments.");const T=y.parse(p[1],1,xi);if(!T)return null;const S=p[2];if("object"!=typeof S||Array.isArray(S))return y.error("NumberFormat options argument must be an object.");let R=null;if(S.locale&&(R=y.parseObjectValue(S.locale,2,"locale",ts),!R))return null;let M=null;if(S.currency&&(M=y.parseObjectValue(S.currency,2,"currency",ts),!M))return null;let F=null;if(S.unit&&(F=y.parseObjectValue(S.unit,2,"unit",ts),!F))return null;let G=null;if(void 0!==S["min-fraction-digits"]&&(G=y.parseObjectValue(S["min-fraction-digits"],2,"min-fraction-digits",xi),!G))return null;let q=null;return void 0===S["max-fraction-digits"]||(q=y.parseObjectValue(S["max-fraction-digits"],2,"max-fraction-digits",xi),q)?new JY(T,R,M,F,G,q):null}evaluate(p){return new Intl.NumberFormat(this.locale?this.locale.evaluate(p):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(p):void 0,unit:this.unit?this.unit.evaluate(p):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(p):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(p):void 0}).format(this.number.evaluate(p))}eachChild(p){p(this.number),this.locale&&p(this.locale),this.currency&&p(this.currency),this.unit&&p(this.unit),this.minFractionDigits&&p(this.minFractionDigits),this.maxFractionDigits&&p(this.maxFractionDigits)}outputDefined(){return false}serialize(){const p={};return this.locale&&(p.locale=this.locale.serialize()),this.currency&&(p.currency=this.currency.serialize()),this.unit&&(p.unit=this.unit.serialize()),this.minFractionDigits&&(p["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(p["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),p]}}class KF{constructor(p){this.type=xi,this.input=p}static parse(p,y){if(2!==p.length)return y.error(`Expected 1 argument, but found ${p.length-1} instead.`),null;const T=y.parse(p[1],1);return T?"array"!==T.type.kind&&"string"!==T.type.kind&&"value"!==T.type.kind?(y.error(`Expected argument of type string or array, but found ${Fl(T.type)} instead.`),null):new KF(T):null}evaluate(p){const y=this.input.evaluate(p);if("string"==typeof y)return y.length;if(Array.isArray(y))return y.length;throw new Zu(`Expected value to be of type string or array, but found ${Fl(Yd(y))} instead.`)}eachChild(p){p(this.input)}outputDefined(){return false}serialize(){const p=["length"];return this.eachChild(y=>{p.push(y.serialize())}),p}}function iI(b){return function(){b=1831565813+(b|=0)|0;let p=Math.imul(b^b>>>15,1|b);return p=p+Math.imul(p^p>>>7,61|p)^p,((p^p>>>14)>>>0)/4294967296}}const dA={"==":AOe,"!=":kOe,">":POe,"<":ROe,">=":MOe,"<=":IOe,array:To,at:XY,"at-interpolated":jY,boolean:To,case:ZY,coalesce:p7,collator:k2,format:Jm,image:C2,interpolate:h0,"interpolate-hcl":h0,"interpolate-lab":h0,length:KF,let:m7,literal:Qx,match:KY,number:To,"number-format":JY,object:To,slice:g7,step:uA,string:To,"to-boolean":Lv,"to-color":Lv,"to-number":Lv,"to-string":Lv,var:Nv,within:rA,distance:sA,config:tI};function use(b,[p,y,T,S]){p=p.evaluate(b),y=y.evaluate(b),T=T.evaluate(b);const R=S?S.evaluate(b):1,M=UF(p,y,T,R);if(M)throw new Zu(M);return new Wo(p/255,y/255,T/255,R)}function dse(b,[p,y,T,S]){p=p.evaluate(b),y=y.evaluate(b),T=T.evaluate(b);const R=S?S.evaluate(b):1,M=function(q,Q,ie,ae){return"number"==typeof q&&q>=0&&q<=360?"number"==typeof Q&&Q>=0&&Q<=100&&"number"==typeof ie&&ie>=0&&ie<=100?void 0===ae||"number"==typeof ae&&ae>=0&&ae<=1?null:`Invalid hsla value [${[q,Q,ie,ae].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid hsla value [${("number"==typeof ae?[q,Q,ie,ae]:[q,Q,ie]).join(", ")}]: 's', and 'l' must be between 0 and 100.`:`Invalid hsla value [${("number"==typeof ae?[q,Q,ie,ae]:[q,Q,ie]).join(", ")}]: 'h' must be between 0 and 360.`}(p,y,T,R);if(M)throw new Zu(M);const F=`hsla(${p}, ${y}%, ${T}%, ${R})`,G=Wo.parse(F);if(!G)throw new Zu(`Failed to parse HSLA color: ${F}`);return G}function fse(b,p){return b in p}function y7(b,p){const y=p[b];return void 0===y?null:y}function pT(b){return{type:b}}function M2(b,p){if(!YP(b,["boolean","string","number","null"]))throw new Zu(`Expected first argument to be of type boolean, string, number or null, but found ${Fl(Yd(b))} instead.`);if(!YP(p,["string","array"]))throw new Zu(`Expected second argument to be of type array or string, but found ${Fl(Yd(p))} instead.`)}function ZF(b){if(b instanceof tI)return new Set([b.key]);let p=new Set;return b.eachChild(y=>{p=new Set([...p,...ZF(y)])}),p}function b7(b){if(b instanceof mp&&"is-active-floor"===b.name)return true;let p=false;return b.eachChild(y=>{!p&&b7(y)&&(p=true)}),p}function x7(b){return{result:"success",value:b}}function L2(b){return{result:"error",value:b}}function QY(b,p){return!!b&&!!b.parameters&&b.parameters.includes(p)}function JF(b){return"data-driven"===b["property-type"]}function eq(b){return QY(b.expression,"measure-light")}function hse(b){return QY(b.expression,"zoom")}function tq(b){return!!b.expression&&b.expression.interpolated}function nq(b){return"object"==typeof b&&null!==b&&!Array.isArray(b)}function pse(b){return b}function rq(b,p){const y="color"===p.type,T=b.stops&&"object"==typeof b.stops[0][0],S=T||!(T||void 0!==b.property),R=b.type||(tq(p)?"exponential":"interval");if(y&&((b={...b}).stops&&(b.stops=b.stops.map(q=>[q[0],Wo.parse(q[1])])),b.default=Wo.parse(b.default?b.default:p.default)),b.colorSpace&&"rgb"!==b.colorSpace&&!sse[b.colorSpace])throw new Error(`Unknown color space: ${b.colorSpace}`);let M,F,G;if("exponential"===R)M=mse;else if("interval"===R)M=DOe;else if("categorical"===R){M=LOe,F=Object.create(null);for(const q of b.stops)F[q[0]]=q[1];G=typeof b.stops[0][0]}else{if("identity"!==R)throw new Error(`Unknown function type "${R}"`);M=FOe}if(T){const q={},Q=[];for(let de=0;dede[0]),evaluate:({zoom:de},pe)=>mse({stops:ie,base:b.base},p,de).evaluate(de,pe)}}if(S){const q="exponential"===R?{name:"exponential",base:void 0!==b.base?b.base:1}:null;return{kind:"camera",interpolationType:q,interpolationFactor:h0.interpolationFactor.bind(void 0,q),zoomStops:b.stops.map(Q=>Q[0]),evaluate:({zoom:Q})=>M(b,p,Q,F,G)}}return{kind:"source",evaluate(q,Q){const ie=Q&&Q.properties?Q.properties[b.property]:void 0;return void 0===ie?oI(b.default,p.default):M(b,p,ie,F,G)}}}function oI(b,p,y){return void 0!==b?b:void 0!==p?p:void 0!==y?y:void 0}function LOe(b,p,y,T,S){return oI(typeof y===S?T[y]:void 0,b.default,p.default)}function DOe(b,p,y){if(!A2(y))return oI(b.default,p.default);const T=b.stops.length;if(1===T)return b.stops[0][1];if(y<=b.stops[0][0])return b.stops[0][1];if(y>=b.stops[T-1][0])return b.stops[T-1][1];const S=qF(b.stops.map(R=>R[0]),y);return b.stops[S][1]}function mse(b,p,y){const T=void 0!==b.base?b.base:1;if(!A2(y))return oI(b.default,p.default);const S=b.stops.length;if(1===S)return b.stops[0][1];if(y<=b.stops[0][0])return b.stops[0][1];if(y>=b.stops[S-1][0])return b.stops[S-1][1];const R=qF(b.stops.map(Q=>Q[0]),y),M=function(Q,ie,ae,de){const pe=de-ae,_e=Q-ae;return 0===pe?0:1===ie?_e/pe:(Math.pow(ie,_e)-1)/(Math.pow(ie,pe)-1)}(y,T,b.stops[R][0],b.stops[R+1][0]),F=b.stops[R][1],G=b.stops[R+1][1];let q=v2[p.type]||pse;if(b.colorSpace&&"rgb"!==b.colorSpace){const Q=sse[b.colorSpace];q=(ie,ae)=>Q.reverse(Q.interpolate(Q.forward(ie),Q.forward(ae),M))}return"function"==typeof F.evaluate?{evaluate(...Q){const ie=F.evaluate.apply(void 0,Q),ae=G.evaluate.apply(void 0,Q);if(void 0!==ie&&void 0!==ae)return q(ie,ae,M)}}:q(F,G,M)}function FOe(b,p,y){return"color"===p.type?y=Wo.parse(y):"formatted"===p.type?y=yd.fromString(y.toString()):"resolvedImage"===p.type?y=Ah.build(y.toString()):nA(y)===p.type||"enum"===p.type&&p.values[y]||(y=void 0),oI(y,b.default,p.default)}mp.register(dA,{error:[{kind:"error"},[ts],(b,[p])=>{throw new Zu(p.evaluate(b))}],typeof:[ts,[Na],(b,[p])=>Fl(Yd(p.evaluate(b)))],"to-rgba":[Vl(xi,4),[oh],(b,[p])=>p.evaluate(b).toNonPremultipliedRenderColor(null).toArray()],"to-hsla":[Vl(xi,4),[oh],(b,[p])=>p.evaluate(b).toNonPremultipliedRenderColor(null).toHslaArray()],rgb:[oh,[xi,xi,xi],use],rgba:[oh,[xi,xi,xi,xi],use],hsl:[oh,[xi,xi,xi],dse],hsla:[oh,[xi,xi,xi,xi],dse],has:{type:wa,overloads:[[[ts],(b,[p])=>fse(p.evaluate(b),b.properties())],[[ts,u0],(b,[p,y])=>fse(p.evaluate(b),y.evaluate(b))]]},get:{type:Na,overloads:[[[ts],(b,[p])=>y7(p.evaluate(b),b.properties())],[[ts,u0],(b,[p,y])=>y7(p.evaluate(b),y.evaluate(b))]]},"feature-state":[Na,[ts],(b,[p])=>y7(p.evaluate(b),b.featureState||{})],properties:[u0,[],b=>b.properties()],"geometry-type":[ts,[],b=>b.geometryType()],worldview:[ts,[],b=>b.globals.worldview||""],"is-active-floor":[wa,pT(ts),(b,p)=>{if(!(b.globals&&b.globals.activeFloors&&b.globals.activeFloors.size>0))return false;if(0===p.length)return true;const y=b.globals.activeFloors;return p.some(T=>{const S=T.evaluate(b);return y.has(S)})}],id:[Na,[],b=>b.id()],zoom:[xi,[],b=>b.globals.zoom],pitch:[xi,[],b=>b.globals.pitch||0],"distance-from-center":[xi,[],b=>b.distanceFromCenter()],"measure-light":[xi,[ts],(b,[p])=>b.measureLight(p.evaluate(b))],"heatmap-density":[xi,[],b=>b.globals.heatmapDensity||0],"line-progress":[xi,[],b=>b.globals.lineProgress||0],"raster-value":[xi,[],b=>b.globals.rasterValue||0],"raster-particle-speed":[xi,[],b=>b.globals.rasterParticleSpeed||0],"sky-radial-progress":[xi,[],b=>b.globals.skyRadialProgress||0],accumulated:[Na,[],b=>void 0===b.globals.accumulated?null:b.globals.accumulated],"+":[xi,pT(xi),(b,p)=>{let y=0;for(const T of p)y+=T.evaluate(b);return y}],"*":[xi,pT(xi),(b,p)=>{let y=1;for(const T of p)y*=T.evaluate(b);return y}],"-":{type:xi,overloads:[[[xi,xi],(b,[p,y])=>p.evaluate(b)-y.evaluate(b)],[[xi],(b,[p])=>-p.evaluate(b)]]},"/":[xi,[xi,xi],(b,[p,y])=>p.evaluate(b)/y.evaluate(b)],"%":[xi,[xi,xi],(b,[p,y])=>p.evaluate(b)%y.evaluate(b)],ln2:[xi,[],()=>Math.LN2],pi:[xi,[],()=>Math.PI],e:[xi,[],()=>Math.E],"^":[xi,[xi,xi],(b,[p,y])=>Math.pow(p.evaluate(b),y.evaluate(b))],sqrt:[xi,[xi],(b,[p])=>Math.sqrt(p.evaluate(b))],log10:[xi,[xi],(b,[p])=>Math.log(p.evaluate(b))/Math.LN10],ln:[xi,[xi],(b,[p])=>Math.log(p.evaluate(b))],log2:[xi,[xi],(b,[p])=>Math.log2(p.evaluate(b))],sin:[xi,[xi],(b,[p])=>Math.sin(p.evaluate(b))],cos:[xi,[xi],(b,[p])=>Math.cos(p.evaluate(b))],tan:[xi,[xi],(b,[p])=>Math.tan(p.evaluate(b))],asin:[xi,[xi],(b,[p])=>Math.asin(p.evaluate(b))],acos:[xi,[xi],(b,[p])=>Math.acos(p.evaluate(b))],atan:[xi,[xi],(b,[p])=>Math.atan(p.evaluate(b))],min:[xi,pT(xi),(b,p)=>Math.min(...p.map(y=>y.evaluate(b)))],max:[xi,pT(xi),(b,p)=>Math.max(...p.map(y=>y.evaluate(b)))],abs:[xi,[xi],(b,[p])=>Math.abs(p.evaluate(b))],round:[xi,[xi],(b,[p])=>{const y=p.evaluate(b);return y<0?-Math.round(-y):Math.round(y)}],floor:[xi,[xi],(b,[p])=>Math.floor(p.evaluate(b))],ceil:[xi,[xi],(b,[p])=>Math.ceil(p.evaluate(b))],"filter-==":[wa,[ts,Na],(b,[p,y])=>b.properties()[p.value]===y.value],"filter-id-==":[wa,[Na],(b,[p])=>b.id()===p.value],"filter-type-==":[wa,[ts],(b,[p])=>b.geometryType()===p.value],"filter-<":[wa,[ts,Na],(b,[p,y])=>{const T=b.properties()[p.value],S=y.value;return typeof T==typeof S&&T{const y=b.id(),T=p.value;return typeof y==typeof T&&y":[wa,[ts,Na],(b,[p,y])=>{const T=b.properties()[p.value],S=y.value;return typeof T==typeof S&&T>S}],"filter-id->":[wa,[Na],(b,[p])=>{const y=b.id(),T=p.value;return typeof y==typeof T&&y>T}],"filter-<=":[wa,[ts,Na],(b,[p,y])=>{const T=b.properties()[p.value],S=y.value;return typeof T==typeof S&&T<=S}],"filter-id-<=":[wa,[Na],(b,[p])=>{const y=b.id(),T=p.value;return typeof y==typeof T&&y<=T}],"filter->=":[wa,[ts,Na],(b,[p,y])=>{const T=b.properties()[p.value],S=y.value;return typeof T==typeof S&&T>=S}],"filter-id->=":[wa,[Na],(b,[p])=>{const y=b.id(),T=p.value;return typeof y==typeof T&&y>=T}],"filter-has":[wa,[Na],(b,[p])=>p.value in b.properties()],"filter-has-id":[wa,[],b=>null!==b.id()&&void 0!==b.id()],"filter-type-in":[wa,[Vl(ts)],(b,[p])=>p.value.includes(b.geometryType())],"filter-id-in":[wa,[Vl(Na)],(b,[p])=>p.value.includes(b.id())],"filter-in-small":[wa,[ts,Vl(Na)],(b,[p,y])=>y.value.includes(b.properties()[p.value])],"filter-in-large":[wa,[ts,Vl(Na)],(b,[p,y])=>function(T,S,R,M){for(;R<=M;){const F=R+M>>1;if(S[F]===T)return true;S[F]>T?M=F-1:R=F+1}return false}(b.properties()[p.value],y.value,0,y.value.length-1)],all:{type:wa,overloads:[[[wa,wa],(b,[p,y])=>p.evaluate(b)&&y.evaluate(b)],[pT(wa),(b,p)=>{for(const y of p)if(!y.evaluate(b))return false;return true}]]},any:{type:wa,overloads:[[[wa,wa],(b,[p,y])=>p.evaluate(b)||y.evaluate(b)],[pT(wa),(b,p)=>{for(const y of p)if(y.evaluate(b))return true;return false}]]},"!":[wa,[wa],(b,[p])=>!p.evaluate(b)],"is-supported-script":[wa,[ts],(b,[p])=>{const y=b.globals&&b.globals.isSupportedScript;return!y||y(p.evaluate(b))}],upcase:[ts,[ts],(b,[p])=>p.evaluate(b).toUpperCase()],downcase:[ts,[ts],(b,[p])=>p.evaluate(b).toLowerCase()],concat:[ts,pT(Na),(b,p)=>p.map(y=>f0(y.evaluate(b))).join("")],split:[Vl(ts),[ts,ts],(b,[p,y])=>p.evaluate(b).split(y.evaluate(b))],in:[wa,[Na,Na],(b,[p,y])=>{const T=p.evaluate(b),S=y.evaluate(b);return null!=S&&(M2(T,S),S.includes(T))}],"index-of":{type:xi,overloads:[[[Na,Na],(b,[p,y])=>{const T=p.evaluate(b),S=y.evaluate(b);return M2(T,S),S.indexOf(T)}],[[Na,Na,xi],(b,[p,y,T])=>{const S=p.evaluate(b),R=y.evaluate(b),M=T.evaluate(b);return M2(S,R),R.indexOf(S,M)}]]},"resolved-locale":[ts,[oy],(b,[p])=>p.evaluate(b).resolvedLocale()],random:[xi,[xi,xi,Na],(b,p)=>{const[y,T,S]=p.map(M=>M.evaluate(b));if(y>T)return y;if(y===T)return y;let R;if("string"==typeof S)R=function(M){let F=0;if(0===M.length)return F;for(let G=0;GJSON.stringify(ie)).join(", ")}, but found ${JSON.stringify(Q)} instead.`);return Q}catch(Q){const ie=Q;return this._warningHistory[ie.message]||(this._warningHistory[ie.message]=true,"undefined"!=typeof console&&console.warn(`Failed to evaluate expression "${JSON.stringify(this.expression.serialize())}". ${ie.message}`)),this._defaultValue}}}function v7(b){return Array.isArray(b)&&b.length>0&&"string"==typeof b[0]&&Object.hasOwn(dA,b[0])}function fA(b,p,y,T,S){const R=new cA(dA,[],p?function(F){const G={color:oh,string:ts,number:xi,enum:ts,boolean:wa,formatted:Jx,resolvedImage:T2};return"array"===F.type?Vl(G[F.value]||Na,F.length):G[F.type]}(p):void 0,void 0,void 0,y,T,S),M=R.parse(b,void 0,void 0,void 0,p&&"string"===p.type?{typeAnnotation:"coerce"}:void 0);return M?x7(new iq(M,p,y,T,S)):L2(R.errors)}class _7{constructor(p,y,T,S){this.kind=p,this._styleExpression=y,this.isLightConstant=T,this.isLineProgressConstant=S,this.isStateDependent="constant"!==p&&!P2(y.expression),this.configDependencies=ZF(y.expression),this.isIndoorDependent=b7(y.expression)}evaluateWithoutErrorHandling(p,y,T,S,R,M){return this._styleExpression.evaluateWithoutErrorHandling(p,y,T,S,R,M)}evaluate(p,y,T,S,R,M,F){return this._styleExpression.evaluate(p,y,T,S,R,M,void 0,void 0,F)}}class hA{constructor(p,y,T,S,R,M){this.kind=p,this.zoomStops=T,this._styleExpression=y,this.isStateDependent="camera"!==p&&!P2(y.expression),this.isIndoorDependent=b7(y.expression),this.isLightConstant=R,this.isLineProgressConstant=M,this.configDependencies=ZF(y.expression),this.interpolationType=S}evaluateWithoutErrorHandling(p,y,T,S,R,M){return this._styleExpression.evaluateWithoutErrorHandling(p,y,T,S,R,M)}evaluate(p,y,T,S,R,M){return this._styleExpression.evaluate(p,y,T,S,R,M)}interpolationFactor(p,y,T){return this.interpolationType?h0.interpolationFactor(this.interpolationType,p,y,T):0}}function oq(b,p,y,T,S){if("error"===(b=fA(b,p,y,T,S)).result)return b;const R=b.value.expression,M=lA(R);if(!M&&!JF(p))return L2([new Sh("","data expressions not supported")]);const F=Fv(R,["zoom","pitch","distance-from-center"]);if(!F&&!hse(p))return L2([new Sh("","zoom expressions not supported")]);const G=Fv(R,["measure-light"]);if(!G&&!eq(p))return L2([new Sh("","measure-light expression not supported")]);const q=Fv(R,["line-progress"]);if(!q&&!function(ae){return QY(ae.expression,"line-progress")}(p))return L2([new Sh("","line-progress expression not supported")]);const Q=p.expression&&p.expression.relaxZoomRestriction,ie=e4(R);return ie||F||Q?ie instanceof Sh?L2([ie]):ie instanceof h0&&!tq(p)?L2([new Sh("",'"interpolate" expressions cannot be used with this property')]):x7(ie?new hA(M&&q?"camera":"composite",b.value,ie.labels,ie instanceof h0?ie.interpolation:void 0,G,q):new _7(M&&q?"constant":"source",b.value,G,q)):L2([new Sh("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression, or in the properties of atmosphere.')])}class QF{constructor(p,y){this._parameters=p,this._specification=y,Object.assign(this,rq(this._parameters,this._specification))}static deserialize(p){return new QF(p._parameters,p._specification)}static serialize(p){return{_parameters:p._parameters,_specification:p._specification}}}function e4(b){let p=null;if(b instanceof m7)p=e4(b.result);else if(b instanceof p7){for(const y of b.args)if(p=e4(y),p)break}else(b instanceof uA||b instanceof h0)&&b.input instanceof mp&&"zoom"===b.input.name&&(p=b);return p instanceof Sh||b.eachChild(y=>{const T=e4(y);T instanceof Sh?p=T:p&&T&&p!==T&&(p=new Sh("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),p}class t4{constructor(p,y,T){if(this.boxSeen=new Uint32Array(0),this.circleSeen=new Uint32Array(0),this.generation=0,p instanceof ArrayBuffer){const S=new Int32Array(p);this.width=S[0],this.height=S[1],this.xCellCount=S[2],this.yCellCount=S[3],this.boxUid=S[4],this.circleUid=S[5];const R=this.xCellCount*this.yCellCount,M=[];for(let Q=0;Qthis.width||S<0||y>this.height)return M;const F=this._nextGen(),{boxCells:G,circleCells:q,boxKeys:Q,circleKeys:ie,bboxes:ae,circles:de,boxSeen:pe,circleSeen:_e,xCellCount:Se}=this,Fe=this._xCell(p),Ye=this._yCell(y),Xe=this._xCell(T),We=this._yCell(S);for(let rt=Fe;rt<=Xe;rt++)for(let lt=Ye;lt<=We;lt++){const Bt=Se*lt+rt,ht=G[Bt];if(ht)for(let Lt=0;Lt=_n&&S>=Dn&&(!R||R(Q[Nt]))&&M.push({key:Q[Nt],x1:_n,y1:Dn,x2:Ln,y2:zn})}const Tt=q[Bt];if(Tt)for(let Lt=0;Ltthis.width||S<0||y>this.height)return M;const F=this._nextGen(),{boxCells:G,boxKeys:q,bboxes:Q,boxSeen:ie,xCellCount:ae,xScale:de,yScale:pe}=this,_e=this._xCell(p),Se=this._yCell(y),Fe=this._xCell(T),Ye=this._yCell(S);for(let Xe=_e;Xe<=Fe;Xe++)for(let We=Se;We<=Ye;We++){if(R&&!R(Xe/de,We/pe,(Xe+1)/de,(We+1)/pe))continue;const rt=G[ae*We+Xe];if(rt)for(let lt=0;lt=Tt&&S>=Lt)&&M.push(q[Bt])}}return M}hitTest(p,y,T,S,R){if(T<0||p>this.width||S<0||y>this.height)return false;const M=this._nextGen(),{boxCells:F,circleCells:G,boxKeys:q,circleKeys:Q,bboxes:ie,circles:ae,boxSeen:de,circleSeen:pe,xCellCount:_e}=this,Se=this._xCell(p),Fe=this._yCell(y),Ye=this._xCell(T),Xe=this._yCell(S);for(let We=Se;We<=Ye;We++)for(let rt=Fe;rt<=Xe;rt++){const lt=_e*rt+We,Bt=F[lt];if(Bt)for(let Tt=0;Tt=ie[Nt]&&S>=ie[Nt+1]&&(!R||R(q[Lt])))return true}const ht=G[lt];if(ht)for(let Tt=0;Ttthis.width||G<0||M>this.height)return false;const q=this._nextGen(),{boxCells:Q,circleCells:ie,boxKeys:ae,circleKeys:de,bboxes:pe,circles:_e,boxSeen:Se,circleSeen:Fe,xCellCount:Ye}=this,Xe=this._xCell(R),We=this._yCell(M),rt=this._xCell(F),lt=this._yCell(G);for(let Bt=Xe;Bt<=rt;Bt++)for(let ht=We;ht<=lt;ht++){const Tt=Ye*ht+Bt,Lt=Q[Tt];if(Lt)for(let un=0;un>>0,0===this.generation&&(this.boxSeen.fill(0),this.circleSeen.fill(0),this.generation=1),this.generation}_circlesCollide(p,y,T,S,R,M){const F=S-p,G=R-y,q=T+M;return q*q>F*F+G*G}_circleAndRectCollide(p,y,T,S,R,M,F){const G=(M-S)/2,q=Math.abs(p-(S+G));if(q>G+T)return false;const Q=(F-R)/2,ie=Math.abs(y-(R+Q));if(ie>Q+T)return false;if(q<=G||ie<=Q)return true;const ae=q-G,de=ie-Q;return ae*ae+de*de<=T*T}}const e1={};function li(b,p,y={}){Object.defineProperty(b,"_classRegistryKey",{value:p,writable:false}),e1[p]={klass:b,omit:y.omit||[]}}li(Object,"Object"),li(t4,"Grid"),delete nt.prototype.constructor,li(Wo,"Color"),li(yd,"Formatted"),li(w2,"FormattedSection"),li(Ah,"ResolvedImage"),li(QF,"StylePropertyFunction"),li(iq,"StyleExpression",{omit:["_evaluator"]}),li(gd,"ImageId"),li(ay,"ImageVariant"),li(hA,"ZoomDependentExpression"),li(_7,"ZoomConstantExpression"),li(mp,"CompoundExpression",{omit:["_evaluate"]});for(const b in dA)e1[dA[b]._classRegistryKey]||li(dA[b],`Expression${b}`);function gse(b){return b&&(b instanceof ArrayBuffer||b.constructor&&"ArrayBuffer"===b.constructor.name)}const pA={Error,TypeError,RangeError,SyntaxError,ReferenceError,URIError,EvalError},yse=new Set(["message","stack","cause","errors","name","class"]);function tg(b,p){if(null===b)return null;const y=typeof b;if("object"!==y)return"bigint"===y?{$name:"BigInt",value:b.toString()}:b;if(Array.isArray(b)){const M=b.length,F=[];F.length=M;for(let G=0;GQ!==M).map(Q=>tg(Q,p)));const q=M;for(const Q in q)Object.hasOwn(q,Q)&&(yse.has(Q)||(G[Q]=tg(q[Q],p)));return G}const T=b.constructor||Object,S=T._classRegistryKey;if(!S)throw new Error(`Can't serialize object of unregistered class "${T.name}".`);const R=T.serialize?T.serialize(b,p):{};if(!T.serialize){const M=e1[S].omit,F=b;for(const G in F)Object.hasOwn(F,G)&&(M.includes(G)||(R[G]=tg(F[G],p)))}if(R.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==S&&(R.$name=S),R}function kb(b){if(null===b||"object"!=typeof b)return b;if(Array.isArray(b)){for(let S=0;Sb>=1536&&b<=1791,xse=b=>b>=1872&&b<=1919,T7=b=>b>=2208&&b<=2303,w7=b=>b>=11904&&b<=12031,E7=b=>b>=12032&&b<=12255,aq=b=>b>=12272&&b<=12287,C7=b=>b>=12288&&b<=12351,aI=b=>b>=12352&&b<=12447,mA=b=>b>=12448&&b<=12543,S7=b=>b>=12544&&b<=12591,sq=b=>b>=12704&&b<=12735,lq=b=>b>=12736&&b<=12783,cq=b=>b>=12784&&b<=12799,A7=b=>b>=12800&&b<=13055,uq=b=>b>=13056&&b<=13311,n4=b=>b>=13312&&b<=19903,dq=b=>b>=19968&&b<=40959,vse=b=>b>=40960&&b<=42127,_se=b=>b>=42128&&b<=42191,Tse=b=>b>=44032&&b<=55215,wse=b=>b>=63744&&b<=64255,Ov=b=>b>=64336&&b<=65023,fq=b=>b>=65040&&b<=65055,D2=b=>b>=65072&&b<=65103,Ese=b=>b>=65104&&b<=65135,hq=b=>b>=65136&&b<=65279,pq=b=>b>=65280&&b<=65519;function Cse(b){for(const p of b)if(mq(p.charCodeAt(0)))return true;return false}function NOe(b){return!(bse(b)||xse(b)||T7(b)||Ov(b)||hq(b))}function mq(b){return!(746!==b&&747!==b&&(b<4352||!(sq(b)||S7(b)||D2(b)&&!(b>=65097&&b<=65103)||wse(b)||uq(b)||w7(b)||lq(b)||!(!C7(b)||b>=12296&&b<=12305||b>=12308&&b<=12319||12336===b)||n4(b)||dq(b)||A7(b)||(p=>p>=12592&&p<=12687)(b)||(p=>p>=43360&&p<=43391)(b)||(p=>p>=55216&&p<=55295)(b)||(p=>p>=4352&&p<=4607)(b)||Tse(b)||aI(b)||aq(b)||(p=>p>=12688&&p<=12703)(b)||E7(b)||cq(b)||mA(b)&&12540!==b||!(!pq(b)||65288===b||65289===b||65293===b||b>=65306&&b<=65310||65339===b||65341===b||65343===b||b>=65371&&b<=65503||65507===b||b>=65512&&b<=65519)||!(!Ese(b)||b>=65112&&b<=65118||b>=65123&&b<=65126)||(p=>p>=5120&&p<=5759)(b)||(p=>p>=6320&&p<=6399)(b)||fq(b)||(p=>p>=19904&&p<=19967)(b)||vse(b)||_se(b))))}function Sse(b){return!(mq(b)||function(p){return!!((y=>y>=128&&y<=255)(p)&&(167===p||169===p||174===p||177===p||188===p||189===p||190===p||215===p||247===p)||(y=>y>=8192&&y<=8303)(p)&&(8214===p||8224===p||8225===p||8240===p||8241===p||8251===p||8252===p||8258===p||8263===p||8264===p||8265===p||8273===p)||(y=>y>=8448&&y<=8527)(p)||(y=>y>=8528&&y<=8591)(p)||(y=>y>=8960&&y<=9215)(p)&&(p>=8960&&p<=8967||p>=8972&&p<=8991||p>=8996&&p<=9e3||9003===p||p>=9085&&p<=9114||p>=9150&&p<=9165||9167===p||p>=9169&&p<=9179||p>=9186&&p<=9215)||(y=>y>=9216&&y<=9279)(p)&&9251!==p||(y=>y>=9280&&y<=9311)(p)||(y=>y>=9312&&y<=9471)(p)||(y=>y>=9632&&y<=9727)(p)||(y=>y>=9728&&y<=9983)(p)&&!(p>=9754&&p<=9759)||(y=>y>=11008&&y<=11263)(p)&&(p>=11026&&p<=11055||p>=11088&&p<=11097||p>=11192&&p<=11243)||C7(p)||mA(p)||(y=>y>=57344&&y<=63743)(p)||D2(p)||Ese(p)||pq(p)||8734===p||8756===p||8757===p||p>=9984&&p<=10087||p>=10102&&p<=10131||65532===p||65533===p)}(b))}function sI(b){return b>=1424&&b<=2303||Ov(b)||hq(b)}function k7(b,p){return!(!p&&sI(b)||b>=2304&&b<=3583||b>=3840&&b<=4255||(y=>y>=6016&&y<=6143)(b))}function Ase(b){for(const p of b)if(sI(p.charCodeAt(0)))return true;return false}const cy={unavailable:"unavailable",deferred:"deferred",loading:"loading",parsing:"parsing",parsed:"parsed",loaded:"loaded",error:"error"};let R7=null,rm=cy.unavailable,F2=null;const gq=function(b){b&&(rm=cy.error),R7&&R7(b)};function lI(){yq.fire(new l0("pluginStateChange",{pluginStatus:rm,pluginURL:F2}))}const yq=new tm,bq=function(){return rm},kse=function(){if(rm!==cy.deferred||!F2)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");rm=cy.loading,lI(),F2&&es({url:F2}).then(()=>{rm=cy.loaded,lI()}).catch(b=>{gq(b)})},N2={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>rm===cy.loaded||null!=N2.applyArabicShaping,isLoading:()=>rm===cy.loading,setState(b){rm=b.pluginStatus,F2=b.pluginURL},isParsing:()=>rm===cy.parsing,isParsed:()=>rm===cy.parsed,getPluginURL:()=>F2};class Rl{constructor(p,y){this.zoom=p,y?(this.now=y.now,this.fadeDuration=y.fadeDuration,this.transition=y.transition,this.pitch=y.pitch,this.brightness=y.brightness,this.worldview=y.worldview,this.activeFloors=y.activeFloors):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0,this.brightness=0)}isSupportedScript(p){return function(y,T){for(const S of y)if(!k7(S.charCodeAt(0),T))return false;return true}(p,N2.isLoaded())}}class gA{constructor(p,y,T,S,R){this.property=p,this.value=y,this.expression=function(M,F,G,q,Q){if(nq(M))return new QF(M,F);if(v7(M)||Array.isArray(M)&&M.length>0){const ie=oq(M,F,G,q,Q);if("error"===ie.result)throw new Error(ie.value.map(ae=>`${ae.key}: ${ae.message}`).join(", "));return ie.value}{let ie=M;return"string"==typeof M&&"color"===F.type&&(ie=Wo.parse(M)),{kind:"constant",configDependencies:new Set,isIndoorDependent:false,evaluate:()=>ie}}}(void 0===y?p.specification.default:y,p.specification,T,S,R)}isIndoorDependent(){return this.expression.isIndoorDependent}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(p,y,T,S){return this.property.possiblyEvaluate(this,p,y,T,S)}}class cI{constructor(p,y,T,S){this.property=p,this.value=new gA(p,void 0,y,T,S)}transitioned(p,y){return new r4(this.property,this.value,y,{...p.transition,...this.transition},p.now)}untransitioned(){return new r4(this.property,this.value,null,{},0)}}class uy{constructor(p,y,T,S){this._properties=p,this._values=Object.create(p.defaultTransitionablePropertyValues),this._scope=y,this._options=T,this._iconImageUseTheme=S,this._isIndoorDependent=false,this.configDependencies=new Set}getValue(p){return ds(this._values[p].value.value)}setValue(p,y){Object.hasOwn(this._values,p)||(this._values[p]=new cI(this._values[p].property,this._scope,this._options,this._iconImageUseTheme)),this._values[p].value=new gA(this._values[p].property,null===y?void 0:ds(y),this._scope,this._options,this._iconImageUseTheme),this._values[p].value.expression.configDependencies&&(this.configDependencies=new Set([...this.configDependencies,...this._values[p].value.expression.configDependencies]),this._isIndoorDependent=this._isIndoorDependent||this._values[p].value.isIndoorDependent())}setTransitionOrValue(p,y){y&&(this._options=y);const T=this._properties.properties;if(p)for(const S in p){const R=p[S];if(S.endsWith("-transition")){const M=S.slice(0,-11);T[M]&&this.setTransition(M,R)}else Object.hasOwn(T,S)&&this.setValue(S,R)}}getTransition(p){return ds(this._values[p].transition)}setTransition(p,y){Object.hasOwn(this._values,p)||(this._values[p]=new cI(this._values[p].property)),this._values[p].transition=ds(y)||void 0}serialize(){const p={};for(const y of Object.keys(this._values)){const T=this.getValue(y);void 0!==T&&(p[y]=T);const S=this.getTransition(y);void 0!==S&&(p[`${y}-transition`]=S)}return p}transitioned(p,y){const T=new Rse(this._properties);for(const S of Object.keys(this._values))T._values[S]=this._values[S].transitioned(p,y._values[S]);return T}untransitioned(){const p=new Rse(this._properties);for(const y of Object.keys(this._values))p._values[y]=this._values[y].untransitioned();return p}isIndoorDependent(){return this._isIndoorDependent}}class r4{constructor(p,y,T,S,R){const M=S.delay||0,F=S.duration||0;R=R||0,this.property=p,this.value=y,this.begin=R+M,this.end=this.begin+F,p.specification.transition&&(S.delay||S.duration)&&(this.prior=T)}possiblyEvaluate(p,y,T){const S=p.now||0,R=this.value.possiblyEvaluate(p,y,T),M=this.prior;if(M){if(S>this.end)return this.prior=null,R;if(this.value.isDataDriven())return this.prior=null,R;if(S":1,">=":1,"<":1,"<=":1,"in":1,"!in":1,"all":1,"any":1,"none":1,"has":1,"!has":1}},"geometry_type":{"type":"enum","values":{"Point":1,"LineString":1,"Polygon":1}},"function_stop":{"type":"array","minimum":0,"maximum":24,"length":2,"value":["number","color"]},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"color":{"type":"color","default":"#ffffff","expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1,"use-theme":1},"high-color":{"type":"color","default":"#245cdf","expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1,"use-theme":1},"space-color":{"type":"color","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1,"use-theme":1},"horizon-blend":{"type":"number","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"star-intensity":{"type":"number","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"vertical-range":{"type":"array","default":[0,0],"minimum":0,"length":2,"value":"number","expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1}},"snow":{"density":{"type":"number","default":["interpolate",["linear"],["zoom"],11,0,13,0.85],"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"color":{"type":"color","default":"#ffffff","expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1,"use-theme":1},"opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"vignette":{"type":"number","default":["interpolate",["linear"],["zoom"],11,0,13,0.3],"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"vignette-color":{"type":"color","default":"#ffffff","expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1,"use-theme":1},"center-thinning":{"type":"number","default":0.4,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"direction":{"type":"array","default":[0,50],"minimum":0,"maximum":360,"length":2,"value":"number","expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"flake-size":{"type":"number","default":0.71,"minimum":0,"maximum":5,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1}},"rain":{"density":{"type":"number","default":["interpolate",["linear"],["zoom"],11,0,13,0.5],"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"color":{"type":"color","default":["interpolate",["linear"],["measure-light","brightness"],0,"#03113d",0.3,"#a8adbc"],"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1,"use-theme":1},"opacity":{"type":"number","default":["interpolate",["linear"],["measure-light","brightness"],0,0.88,1,0.7],"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"vignette":{"type":"number","default":["interpolate",["linear"],["zoom"],11,0,13,1],"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"vignette-color":{"type":"color","default":["interpolate",["linear"],["measure-light","brightness"],0,"#001736",0.3,"#464646"],"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1,"use-theme":1},"center-thinning":{"type":"number","default":0.57,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"direction":{"type":"array","default":[0,80],"minimum":0,"maximum":360,"length":2,"value":"number","expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"droplet-size":{"type":"array","default":[2.6,18.2],"minimum":0,"maximum":50,"length":2,"value":"number","expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1},"distortion-strength":{"type":"number","default":0.7,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"],"relaxZoomRestriction":1},"transition":1}},"camera":{"camera-projection":{"type":"enum","default":"perspective","values":{"perspective":1,"orthographic":1}}},"colorTheme":{"data":{"type":"string","expression":1}},"indoor_source":{"sourceId":{"type":"string"},"sourceLayers":{"type":"array","value":"string"}},"indoor":{"*":{"type":"indoor_source"}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"color":{"type":"color","default":"#ffffff","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1,"use-theme":1},"intensity":{"type":"number","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1}},"projection":{"name":{"type":"enum","default":"mercator","values":{"albers":1,"equalEarth":1,"equirectangular":1,"lambertConformalConic":1,"mercator":1,"naturalEarth":1,"winkelTripel":1,"globe":1}},"center":{"type":"array","minimum":[-180,-90],"maximum":[180,90],"length":2,"value":"number"},"parallels":{"type":"array","minimum":[-90,-90],"maximum":[90,90],"length":2,"value":"number"}},"terrain":{"source":{"type":"string"},"exaggeration":{"type":"number","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_building","paint_symbol","paint_raster","paint_raster-particle","paint_hillshade","paint_background","paint_sky","paint_model"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]}},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven"},"fill-outline-color":{"type":"color","expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven"},"fill-translate":{"type":"array","default":[0,0],"length":2,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"fill-translate-anchor":{"type":"enum","default":"map","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"fill-pattern":{"type":"resolvedImage","expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"fill-pattern-cross-fade":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"]}},"fill-emissive-strength":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1},"fill-z-offset":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","zoom"]},"transition":1,"property-type":"data-driven"},"fill-bridge-guard-rail-color":{"type":"color","default":"rgba(241, 236, 225, 255)","expression":{"interpolated":1,"parameters":["feature","measure-light","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven"},"fill-tunnel-structure-color":{"type":"color","default":"rgba(241, 236, 225, 255)","expression":{"interpolated":1,"parameters":["feature","measure-light","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"fill-extrusion-color":{"type":"color","default":"#000000","expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","default":[0,0],"length":2,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"fill-extrusion-translate-anchor":{"type":"enum","default":"map","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"fill-extrusion-pattern":{"type":"resolvedImage","expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"fill-extrusion-pattern-cross-fade":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"]}},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","zoom"]},"transition":1,"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","zoom"]},"transition":1,"property-type":"data-driven"},"fill-extrusion-height-alignment":{"type":"enum","default":"flat","values":{"terrain":1,"flat":1}},"fill-extrusion-base-alignment":{"type":"enum","default":"terrain","values":{"terrain":1,"flat":1}},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]}},"fill-extrusion-ambient-occlusion-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"fill-extrusion-ambient-occlusion-radius":{"type":"number","default":3,"minimum":0,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"fill-extrusion-ambient-occlusion-wall-radius":{"type":"number","default":3,"minimum":0,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"fill-extrusion-ambient-occlusion-ground-radius":{"type":"number","default":3,"minimum":0,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"fill-extrusion-ambient-occlusion-ground-attenuation":{"type":"number","default":0.69,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"fill-extrusion-flood-light-color":{"type":"color","default":"#ffffff","expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1,"use-theme":1},"fill-extrusion-flood-light-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1},"fill-extrusion-flood-light-wall-radius":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state"]},"transition":1,"property-type":"data-driven"},"fill-extrusion-flood-light-ground-radius":{"type":"number","default":0,"expression":{"interpolated":1,"parameters":["feature","feature-state"]},"transition":1,"property-type":"data-driven"},"fill-extrusion-flood-light-ground-attenuation":{"type":"number","default":0.69,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"fill-extrusion-vertical-scale":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"fill-extrusion-rounded-roof":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]}},"fill-extrusion-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":1},"fill-extrusion-front-cutoff":{"type":"array","default":[0,0,1],"minimum":[0,0,0],"maximum":[1,1,1],"length":3,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]}},"fill-extrusion-emissive-strength":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"fill-extrusion-line-width":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"fill-extrusion-cast-shadows":{"type":"boolean","default":true}},"paint_building":{"building-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"building-ambient-occlusion-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"parameters":[]},"transition":1},"building-ambient-occlusion-ground-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"building-ambient-occlusion-ground-radius":{"type":"number","default":3,"minimum":0,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"building-ambient-occlusion-ground-attenuation":{"type":"number","default":0.69,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"building-vertical-scale":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"building-cast-shadows":{"type":"boolean","default":true},"building-color":{"type":"color","default":"rgba(193, 154, 127, 1)","expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light"]},"use-theme":1,"property-type":"data-driven"},"building-emissive-strength":{"type":"number","default":0,"minimum":0,"maximum":5,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light"]},"property-type":"data-driven"},"building-facade-emissive-chance":{"type":"number","default":0.35,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"]}},"building-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":1},"building-front-cutoff":{"type":"array","default":[0,0,1],"minimum":[0,0,0],"maximum":[1,1,1],"length":3,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]}},"building-flood-light-color":{"type":"color","default":"#ffffff","expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1,"use-theme":1},"building-flood-light-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1},"building-flood-light-ground-attenuation":{"type":"number","default":0.69,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1}},"paint_line":{"line-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven"},"line-translate":{"type":"array","default":[0,0],"length":2,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"line-translate-anchor":{"type":"enum","default":"map","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"line-width":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","line-progress","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"line-blur":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"line-dasharray":{"type":"array","minimum":0,"value":"number","expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","expression":{"parameters":["feature","zoom"]},"property-type":"data-driven"},"line-pattern-cross-fade":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"]}},"line-gradient":{"type":"color","expression":{"interpolated":1,"parameters":["line-progress"]},"use-theme":1},"line-trim-offset":{"type":"array","default":[0,0],"minimum":[0,0],"maximum":[1,1],"length":2,"value":"number"},"line-trim-fade-range":{"type":"array","default":[0,0],"minimum":[0,0],"maximum":[1,1],"length":2,"value":"number","expression":{"interpolated":1,"parameters":["measure-light","zoom"]}},"line-trim-color":{"type":"color","default":"transparent","expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1,"use-theme":1},"line-emissive-strength":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["line-progress","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"line-border-width":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","zoom"]},"transition":1,"property-type":"data-driven"},"line-border-color":{"type":"color","default":"rgba(0, 0, 0, 0)","expression":{"interpolated":1,"parameters":["feature","feature-state","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven"},"line-border-gradient":{"type":"color","expression":{"interpolated":1,"parameters":["line-progress"]},"use-theme":1},"line-occlusion-opacity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"line-blend-mode":{"type":"enum","default":"default","values":{"default":1,"multiply":1,"additive":1},"expression":{"parameters":["zoom"]}},"line-blend-additive-clamp":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["zoom"]}}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"circle-translate":{"type":"array","default":[0,0],"length":2,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"circle-translate-anchor":{"type":"enum","default":"map","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"circle-pitch-scale":{"type":"enum","default":"map","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"circle-pitch-alignment":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"circle-emissive-strength":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"expression":{"interpolated":1,"parameters":["heatmap-density"]},"use-theme":1},"heatmap-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1}},"paint_symbol":{"icon-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven","appearance":1},"icon-occlusion-opacity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven","appearance":1},"icon-emissive-strength":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":1,"parameters":["feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven","appearance":1},"text-emissive-strength":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":1,"parameters":["feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven","appearance":1},"icon-color":{"type":"color","default":"#000000","expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven","appearance":1},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven","appearance":1},"icon-halo-width":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven","appearance":1},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven","appearance":1},"icon-translate":{"type":"array","default":[0,0],"length":2,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1,"appearance":1},"icon-translate-anchor":{"type":"enum","default":"map","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"icon-image-cross-fade":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["measure-light","zoom"]}},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven","appearance":1},"text-occlusion-opacity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven","appearance":1},"text-color":{"type":"color","default":"#000000","expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven","appearance":1,"overridable":1},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven","appearance":1},"text-halo-width":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven","appearance":1},"text-halo-blur":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"property-type":"data-driven","appearance":1},"text-translate":{"type":"array","default":[0,0],"length":2,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1,"appearance":1},"text-translate-anchor":{"type":"enum","default":"map","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"icon-color-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":1},"icon-color-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":1},"icon-color-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":1},"icon-color-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":1},"symbol-z-offset":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["feature","zoom"]},"transition":1,"property-type":"data-driven","appearance":1}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"raster-color":{"type":"color","expression":{"interpolated":1,"parameters":["raster-value"]},"use-theme":1},"raster-color-mix":{"type":"array","default":[0.2126,0.7152,0.0722,0],"length":4,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"raster-color-range":{"type":"array","length":2,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"raster-hue-rotate":{"type":"number","default":0,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"raster-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"raster-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"raster-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"raster-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"raster-resampling":{"type":"enum","default":"linear","values":{"linear":1,"nearest":1},"expression":{"parameters":["zoom"]}},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"expression":{"interpolated":1,"parameters":["zoom"]}},"raster-emissive-strength":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1},"raster-array-band":{"type":"string"},"raster-elevation":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"raster-elevation-reference":{"type":"enum","default":"sea","values":{"sea":1,"ground":1},"expression":1}},"paint_raster-particle":{"raster-particle-array-band":{"type":"string"},"raster-particle-count":{"type":"number","default":512,"minimum":1},"raster-particle-color":{"type":"color","expression":{"interpolated":1,"parameters":["raster-particle-speed"]},"use-theme":1},"raster-particle-max-speed":{"type":"number","default":1,"minimum":1},"raster-particle-speed-factor":{"type":"number","default":0.2,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"raster-particle-fade-opacity-factor":{"type":"number","default":0.98,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"raster-particle-reset-rate-factor":{"type":"number","default":0.8,"minimum":0,"maximum":1},"raster-particle-elevation":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"expression":{"interpolated":1,"parameters":["zoom"]}},"hillshade-illumination-anchor":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"expression":{"parameters":["zoom"]}},"hillshade-exaggeration":{"type":"number","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"hillshade-shadow-color":{"type":"color","default":"#000000","expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1,"use-theme":1},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1,"use-theme":1},"hillshade-accent-color":{"type":"color","default":"#000000","expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1,"use-theme":1},"hillshade-emissive-strength":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1}},"paint_background":{"background-pitch-alignment":{"type":"enum","default":"map","values":{"map":1,"viewport":1},"expression":{"parameters":[]}},"background-color":{"type":"color","default":"#000000","expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1,"use-theme":1},"background-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom"]}},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"background-emissive-strength":{"type":"number","default":0,"minimum":0,"expression":{"interpolated":1,"parameters":["measure-light","zoom"]},"transition":1}},"paint_sky":{"sky-type":{"type":"enum","default":"atmosphere","values":{"gradient":1,"atmosphere":1},"expression":{"parameters":["zoom"]}},"sky-atmosphere-sun":{"type":"array","minimum":[0,0],"maximum":[360,180],"length":2,"value":"number","expression":{"parameters":["zoom"]}},"sky-atmosphere-sun-intensity":{"type":"number","default":10,"minimum":0,"maximum":100},"sky-gradient-center":{"type":"array","default":[0,0],"minimum":[0,0],"maximum":[360,180],"length":2,"value":"number","expression":{"parameters":["zoom"]}},"sky-gradient-radius":{"type":"number","default":90,"minimum":0,"maximum":180,"expression":{"parameters":["zoom"]}},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"expression":{"interpolated":1,"parameters":["sky-radial-progress"]},"use-theme":1},"sky-atmosphere-halo-color":{"type":"color","default":"white","use-theme":1},"sky-atmosphere-color":{"type":"color","default":"white","use-theme":1},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1}},"paint_model":{"model-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["feature","feature-state","zoom"]},"transition":1,"property-type":"data-driven"},"model-rotation":{"type":"array","default":[0,0,0],"length":3,"value":"number","expression":{"interpolated":1,"parameters":["feature","feature-state","zoom"]},"transition":1,"property-type":"data-driven"},"model-scale":{"type":"array","default":[1,1,1],"length":3,"value":"number","expression":{"interpolated":1,"parameters":["feature","feature-state","zoom"]},"transition":1,"property-type":"data-driven"},"model-translation":{"type":"array","default":[0,0,0],"length":3,"value":"number","expression":{"interpolated":1,"parameters":["feature","feature-state","zoom"]},"transition":1,"property-type":"data-driven"},"model-color":{"type":"color","default":"#ffffff","expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":1,"use-theme":1,"property-type":"data-driven"},"model-color-mix-intensity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light"]},"transition":1,"property-type":"data-driven"},"model-type":{"type":"enum","default":"common-3d","values":{"common-3d":1,"location-indicator":1}},"model-cast-shadows":{"type":"boolean","default":true},"model-receive-shadows":{"type":"boolean","default":true},"model-ambient-occlusion-intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["zoom"]},"transition":1},"model-emissive-strength":{"type":"number","default":0,"minimum":0,"maximum":5,"expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light"]},"transition":1,"property-type":"data-driven"},"model-roughness":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":1,"parameters":["feature","feature-state"]},"transition":1,"property-type":"data-driven"},"model-height-based-emissive-strength-multiplier":{"type":"array","default":[1,1,1,1,0],"length":5,"value":"number","expression":{"interpolated":1,"parameters":["feature","feature-state","measure-light"]},"transition":1,"property-type":"data-driven"},"model-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":1},"model-front-cutoff":{"type":"array","default":[0,0,1],"minimum":[0,0,0],"maximum":[1,1,1],"length":3,"value":"number","expression":{"interpolated":1,"parameters":["zoom"]}},"model-elevation-reference":{"type":"enum","default":"ground","values":{"sea":1,"ground":1,"hd-road-markup":1},"expression":1},"model-line-cutout-mode":{"type":"enum","default":"enabled","values":{"enabled":1,"disabled":1,"enabled-above-cutout":1},"expression":1}},"promoteId":{"*":{"type":"*"}}}');function Pse(b){return b instanceof Number||b instanceof String||b instanceof Boolean?b.valueOf():b}function P7(b){if(Array.isArray(b))return b.map(P7);if(b instanceof Object&&!(b instanceof Number||b instanceof String||b instanceof Boolean)){const p={},y=b;for(const T in y)p[T]=P7(y[T]);return p}return Pse(b)}function I7(b){if(true===b||false===b)return true;if(!Array.isArray(b)||0===b.length)return false;switch(b[0]){case"has":return b.length>=2&&"$id"!==b[1]&&"$type"!==b[1];case"in":return b.length>=3&&("string"!=typeof b[1]||Array.isArray(b[2]));case"!in":case"!has":case"none":return false;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==b.length||Array.isArray(b[1])||Array.isArray(b[2]);case"any":case"all":for(const p of b.slice(1))if(!I7(p)&&"boolean"!=typeof p)return false;return true;default:return true}}function i4(b,p="",y=null,T="fill"){if(null==b)return{filter:()=>true,needGeometry:false,needFeature:false};I7(b)||(b=a4(b));const S=b;let R=true;try{R=function(Q){if(!yA(Q))return Q;let ie=P7(Q);return vq(ie),ie=Ise(ie),ie}(S)}catch(Q){console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate. +This is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md +and paste the contents of this message in the report. +Thank you! +Filter Expression: +${JSON.stringify(S,null,2)} + `)}let M=null,F=null;if("background"!==T&&"sky"!==T&&"slot"!==T){F=An[`filter_${T}`];const Q=fA(R,F,p,y);if("error"===Q.result)throw new Error(Q.value.map(ie=>`${ie.key}: ${ie.message}`).join(", "));M=(ie,ae,de)=>Q.value.evaluate(ie,ae,{},de)}let G=null,q=null;if(R!==S){const Q=fA(S,F,p,y);if("error"===Q.result)throw new Error(Q.value.map(ie=>`${ie.key}: ${ie.message}`).join(", "));G=(ie,ae,de,pe,_e)=>Q.value.evaluate(ie,ae,{},de,void 0,void 0,pe,_e),q=!lA(Q.value.expression)}return{filter:M,dynamicFilter:G||void 0,needGeometry:o4(R),needFeature:!!q}}function Ise(b){if(!Array.isArray(b))return b;const p=function(y){if(OOe.has(y[0])){for(let T=1;TIse(y))}function vq(b){let p=false;const y=[];if("case"===b[0]){for(let T=1;T",">=","<","<=","to-boolean"]);function _q(b,p){return bp?1:0}function o4(b){if(!Array.isArray(b))return false;if("within"===b[0]||"distance"===b[0])return true;for(let p=1;p"===p||"<="===p||">="===p?Tq(b[1],b[2],p):"any"===p?(y=b.slice(1),["any"].concat(y.map(a4))):"all"===p?["all"].concat(b.slice(1).map(a4)):"none"===p?["all"].concat(b.slice(1).map(a4).map(uI)):"in"===p?wq(b[1],b.slice(2)):"!in"===p?uI(wq(b[1],b.slice(2))):"has"===p?Mse(b[1]):"!has"!==p||uI(Mse(b[1]));var y}function Tq(b,p,y){switch(b){case"$type":return[`filter-type-${y}`,p];case"$id":return[`filter-id-${y}`,p];default:return[`filter-${y}`,b,p]}}function wq(b,p){if(0===p.length)return false;switch(b){case"$type":return["filter-type-in",["literal",p]];case"$id":return["filter-id-in",["literal",p]];default:return p.length>200&&!p.some(y=>typeof y!=typeof p[0])?["filter-in-large",b,["literal",p.sort(_q)]]:["filter-in-small",b,["literal",p]]}}function Mse(b){switch(b){case"$type":return true;case"$id":return["filter-has-id"];default:return["filter-has",b]}}function uI(b){return["!",b]}const s4="";function M7(b,p){return p?`${b}${s4}${p}`:b}function Lse(b){const p=b.indexOf(s4);return p>=0?b.slice(p+1):""}let Dse;const Eq=()=>Dse||(Dse=new Ql({"icon-size":new Br(An.layout_symbol["icon-size"]),"icon-image":new Br(An.layout_symbol["icon-image"]),"icon-rotate":new Br(An.layout_symbol["icon-rotate"]),"icon-offset":new Br(An.layout_symbol["icon-offset"]),"text-size":new Br(An.layout_symbol["text-size"]),"text-rotate":new Br(An.layout_symbol["text-rotate"]),"text-offset":new Br(An.layout_symbol["text-offset"])}));let Fse;const Nse=()=>Fse||(Fse=new Ql({"icon-opacity":new Br(An.paint_symbol["icon-opacity"]),"icon-occlusion-opacity":new Br(An.paint_symbol["icon-occlusion-opacity"]),"icon-emissive-strength":new Br(An.paint_symbol["icon-emissive-strength"]),"text-emissive-strength":new Br(An.paint_symbol["text-emissive-strength"]),"icon-color":new Br(An.paint_symbol["icon-color"]),"icon-halo-color":new Br(An.paint_symbol["icon-halo-color"]),"icon-halo-width":new Br(An.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Br(An.paint_symbol["icon-halo-blur"]),"icon-translate":new Br(An.paint_symbol["icon-translate"]),"text-opacity":new Br(An.paint_symbol["text-opacity"]),"text-occlusion-opacity":new Br(An.paint_symbol["text-occlusion-opacity"]),"text-color":new Br(An.paint_symbol["text-color"],{runtimeType:oh,getOverride:b=>b.textColor,hasOverride:b=>!!b.textColor}),"text-halo-color":new Br(An.paint_symbol["text-halo-color"]),"text-halo-width":new Br(An.paint_symbol["text-halo-width"]),"text-halo-blur":new Br(An.paint_symbol["text-halo-blur"]),"text-translate":new Br(An.paint_symbol["text-translate"]),"symbol-z-offset":new Br(An.paint_symbol["symbol-z-offset"]),"icon-color-use-theme":new Br({type:"string",default:"default","property-type":"data-driven"}),"icon-halo-color-use-theme":new Br({type:"string",default:"default","property-type":"data-driven"}),"text-color-use-theme":new Br({type:"string",default:"default","property-type":"data-driven"}),"text-halo-color-use-theme":new Br({type:"string",default:"default","property-type":"data-driven"})}));class BOe{constructor(p,y,T,S,R,M){this._conditionSpec=p,this._propertiesSpec=T;const F=fA(p,An.appearance.condition);if("success"===F.result&&(this.condition=F.value),this.name=y,T){this.layoutProperties=new O2(Eq()),this.unevaluatedLayout=new xq(Eq(),S,R,M),this.paintProperties=new O2(Nse()),this.unevaluatedPaint=new xq(Nse(),S,R,"");for(const G in T)G in this.unevaluatedLayout._values?this.unevaluatedLayout.setValue(G,T[G]):G in this.unevaluatedPaint._values&&this.unevaluatedPaint.setValue(G,T[G])}}isActive(p){return!(this.condition||!p.isHidden||"hidden"!==this.name)||this.condition.evaluate(p.globals,p.feature,p.featureState,p.canonical)}getCondition(){return this.condition}getName(){return this.name}getLayoutProperty(p){return this.layoutProperties.get(p)}getPaintProperty(p){return this.paintProperties.get(p)}getUnevaluatedLayoutProperties(){return this.unevaluatedLayout}getUnevaluatedLayoutProperty(p){return this.unevaluatedLayout._values[p]}getUnevaluatedPaintProperty(p){return this.unevaluatedPaint._values[p]}recalculate(p,y,T){this.unevaluatedLayout&&(this.layoutProperties=this.unevaluatedLayout.possiblyEvaluate(p,void 0,y,T)),this.unevaluatedPaint&&(this.paintProperties=this.unevaluatedPaint.possiblyEvaluate(p,void 0,y,""))}serialize(){const p={};p.condition=this.condition.expression.serialize(),this.name&&(p.name=this.name);const y={...this.unevaluatedLayout?this.unevaluatedLayout.serialize():{},...this.unevaluatedPaint?this.unevaluatedPaint.serialize():{}};return Object.keys(y).length>0&&(p.properties=y),p}hasIconLayoutProperties(){const p=this.hasLayoutProperty("icon-image"),y=this.hasLayoutProperty("icon-size"),T=this.hasLayoutProperty("icon-offset"),S=this.hasLayoutProperty("icon-rotate");return p||y||T||S}hasTextLayoutProperties(){const p=this.hasLayoutProperty("text-size"),y=this.hasLayoutProperty("text-offset"),T=this.hasLayoutProperty("text-rotate");return p||y||T}hasIconPaintProperties(){return!!this.unevaluatedPaint&&Object.keys(this.unevaluatedPaint._values).filter(p=>!p.endsWith("-use-theme")).some(p=>(p.startsWith("icon-")||"symbol-z-offset"===p)&&this.hasPaintProperty(p))}hasTextPaintProperties(){return!!this.unevaluatedPaint&&Object.keys(this.unevaluatedPaint._values).filter(p=>!p.endsWith("-use-theme")).some(p=>(p.startsWith("text-")||"symbol-z-offset"===p)&&this.hasPaintProperty(p))}hasLayoutProperty(p){return this.unevaluatedLayout&&void 0!==this.unevaluatedLayout._values[p].value}hasPaintProperty(p){return this.unevaluatedPaint&&void 0!==this.unevaluatedPaint._values[p].value}}const Ose="-transition",zOe=new Set(["fill","line","background","hillshade","raster"]);class im extends tm{constructor(p,y,T,S,R,M){if(super(),this.id=p.id,this.fqid=M7(this.id,T),this.type=p.type,this.scope=T,this.lut=S,this.options=R,this.iconImageUseTheme=M,this.appearances=new Array,this.appearancesVersion=0,this._featureFilter={filter:()=>true,needGeometry:false,needFeature:false},this._filterCompiled=false,"custom"!==p.type&&(this.metadata=p.metadata,this.minzoom=p.minzoom,this.maxzoom=p.maxzoom,p.type&&"background"!==p.type&&"sky"!==p.type&&"slot"!==p.type&&(this.source=p.source,this.sourceLayer=p["source-layer"],this.filter=p.filter),p.slot&&(this.slot=p.slot),p.appearances&&this.setAppearances(p.appearances),y.layout&&(this._unevaluatedLayout=new xq(y.layout,this.scope,R,this.iconImageUseTheme)),y.paint)){this._transitionablePaint=new uy(y.paint,this.scope,R);for(const F in p.paint)this.setPaintProperty(F,p.paint[F]);for(const F in p.layout)this.setLayoutProperty(F,p.layout[F]);this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new O2(y.paint)}}onAdd(p){}onRemove(p){}isDraped(p){return!this.is3D(true)&&zOe.has(this.type)}getLayoutProperty(p){return"visibility"===p?this.visibility:this._unevaluatedLayout.getValue(p)}setLayoutProperty(p,y){if("custom"===this.type&&"visibility"===p)return void(this.visibility=y);const T=this._unevaluatedLayout;T._properties.properties[p]&&(T.setValue(p,y),"visibility"===p&&this.possiblyEvaluateVisibility())}setAppearances(p){this.appearances=[],p.forEach(y=>{this.appearances.push(new BOe(y.condition,y.name,y.properties,this.scope,this.options,this.iconImageUseTheme))}),this.appearancesVersion++}possiblyEvaluateVisibility(){this._unevaluatedLayout._values.visibility&&(this.visibility=this._unevaluatedLayout._values.visibility.possiblyEvaluate({zoom:0}))}getPaintProperty(p){return p.endsWith(Ose)?this._transitionablePaint.getTransition(p.slice(0,-11)):this._transitionablePaint.getValue(p)}isPaintProperty(p){return!!this._transitionablePaint._properties.properties[p]}setPaintProperty(p,y){const T=this._transitionablePaint,S=T._properties.properties;if(p.endsWith(Ose)){const ie=p.slice(0,-11);return S[ie]&&T.setTransition(ie,y||void 0),false}if(!S[p])return false;const R=T._values[p],M=R.value.isDataDriven(),F=R.value;T.setValue(p,y),this._handleSpecialPaintPropertyUpdate(p);const G=T._values[p].value,q=G.isDataDriven(),Q=p.endsWith("pattern")||"line-dasharray"===p;return q||M||Q||this._handleOverridablePaintPropertyUpdate(p,F,G)}_handleSpecialPaintPropertyUpdate(p){}getProgramIds(){return null}getDefaultProgramParams(p,y,T){return null}_handleOverridablePaintPropertyUpdate(p,y,T){return false}isHidden(p){return!!(this.minzoom&&p=this.maxzoom)||"none"===this.visibility}updateTransitions(p){this._transitioningPaint=this._transitionablePaint.transitioned(p,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(p,y){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(p,void 0,y,this.iconImageUseTheme)),this.paint=this._transitioningPaint.possiblyEvaluate(p,void 0,y)}serialize(){const p={id:this.id,type:this.type,slot:this.slot,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return 0!==this.appearances.length&&(p.appearances=this.appearances.map(y=>y.serialize())),Ms(p,(y,T)=>!(void 0===y||"layout"===T&&!Object.keys(y).length||"paint"===T&&!Object.keys(y).length))}is3D(p){return false}hasElevation(){return false}mayUse(p){return false}prepare(){return Promise.resolve()}isSky(){return false}isTileClipped(){return false}hasOffscreenPass(){return false}hasShadowPass(){return false}canCastShadows(){return false}hasLightBeamPass(){return false}cutoffRange(){return 0}tileCoverLift(){return 0}resize(){}_clear(){}isStateDependent(){for(const p in this.paint._values){const y=this.paint.get(p);if(y instanceof mT&&JF(y.property.specification)&&("source"===y.value.kind||"composite"===y.value.kind)&&y.value.isStateDependent)return true}for(const p of this.appearances)if(!P2(p.condition.expression))return true;return false}compileFilter(p){this._filterCompiled||(this._featureFilter=i4(this.filter,this.scope,p),this._filterCompiled=true)}invalidateCompiledFilter(){this._filterCompiled=false}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}dynamicFilterNeedsGeometry(){return this._featureFilter.needGeometry}getLayerRenderingStats(){return this._stats}resetLayerRenderingStats(p){this._stats&&("shadow"===p.renderPass?this._stats.numRenderedVerticesInShadowPass=0:this._stats.numRenderedVerticesInTransparentPass=0)}getAppearances(){return this.appearances}queryRenderedFeatures(p,y,T){return{}}queryRadius(p){}queryIntersectsFeature(p,y,T,S,R,M,F,G,q,Q){}}function L7(b,p,y){if(!b._unevaluatedLayout)return false;const T=b._unevaluatedLayout.getValue(p);return void 0!==T&&("string"!=typeof T||y(T))}function dI(b,p,y=2){const T=p&&p.length,S=T?p[0]*y:b.length;let R=Bse(b,0,S,y,true);const M=[];if(!R||R.next===R.prev)return M;let F,G,q;if(T&&(R=function(Q,ie,ae,de){const pe=[];for(let _e=0,Se=ie.length;_e80*y){F=b[0],G=b[1];let Q=F,ie=G;for(let ae=y;aeQ&&(Q=de),pe>ie&&(ie=pe)}q=Math.max(Q-F,ie-G),q=0!==q?32767/q:0}return l4(R,M,y,F,G,q,0),M}function Bse(b,p,y,T,S){let R;if(S===function(M,F,G,q){let Q=0;for(let ie=F,ae=G-q;ie0)for(let M=p;M=p;M-=T)R=B7(M/T|0,b[M],b[M+1],R);return R&&fI(R,R.next)&&(d4(R),R=R.next),R}function Bv(b,p){if(!b)return b;p||(p=b);let y,T=b;do{if(y=false,T.steiner||!fI(T,T.next)&&0!==bd(T.prev,T,T.next))T=T.next;else{if(d4(T),T=p=T.prev,T===T.next)break;y=true}}while(y||T!==p);return p}function l4(b,p,y,T,S,R,M){if(!b)return;!M&&R&&function(G,q,Q,ie){let ae=G;do{0===ae.z&&(ae.z=F7(ae.x,ae.y,q,Q,ie)),ae.prevZ=ae.prev,ae.nextZ=ae.next,ae=ae.next}while(ae!==G);ae.prevZ.nextZ=null,ae.prevZ=null,function(de){let pe,_e=1;do{let Se,Fe=de;de=null;let Ye=null;for(pe=0;Fe;){pe++;let Xe=Fe,We=0;for(let lt=0;lt<_e&&(We++,Xe=Xe.nextZ,Xe);lt++);let rt=_e;for(;We>0||rt>0&&Xe;)0!==We&&(0===rt||!Xe||Fe.z<=Xe.z)?(Se=Fe,Fe=Fe.nextZ,We--):(Se=Xe,Xe=Xe.nextZ,rt--),Ye?Ye.nextZ=Se:de=Se,Se.prevZ=Ye,Ye=Se;Fe=Xe}Ye.nextZ=null,_e*=2}while(pe>1)}(ae)}(b,T,S,R);let F=b;for(;b.prev!==b.next;){const G=b.prev,q=b.next;if(R?D7(b,T,S,R):UOe(b))p.push(G.i,b.i,q.i),d4(b),b=q.next,F=q.next;else if((b=q)===F){M?1===M?l4(b=VOe(Bv(b),p),p,y,T,S,R,2):2===M&&zse(b,p,y,T,S,R):l4(Bv(b),p,y,T,S,R,1);break}}}function UOe(b){const p=b.prev,y=b,T=b.next;if(bd(p,y,T)>=0)return false;const S=p.x,R=y.x,M=T.x,F=p.y,G=y.y,q=T.y,Q=Math.min(S,R,M),ie=Math.min(F,G,q),ae=Math.max(S,R,M),de=Math.max(F,G,q);let pe=T.next;for(;pe!==p;){if(pe.x>=Q&&pe.x<=ae&&pe.y>=ie&&pe.y<=de&&c4(S,F,R,G,M,q,pe.x,pe.y)&&bd(pe.prev,pe,pe.next)>=0)return false;pe=pe.next}return true}function D7(b,p,y,T){const S=b.prev,R=b,M=b.next;if(bd(S,R,M)>=0)return false;const F=S.x,G=R.x,q=M.x,Q=S.y,ie=R.y,ae=M.y,de=Math.min(F,G,q),pe=Math.min(Q,ie,ae),_e=Math.max(F,G,q),Se=Math.max(Q,ie,ae),Fe=F7(de,pe,p,y,T),Ye=F7(_e,Se,p,y,T);let Xe=b.prevZ,We=b.nextZ;for(;Xe&&Xe.z>=Fe&&We&&We.z<=Ye;){if(Xe.x>=de&&Xe.x<=_e&&Xe.y>=pe&&Xe.y<=Se&&Xe!==S&&Xe!==M&&c4(F,Q,G,ie,q,ae,Xe.x,Xe.y)&&bd(Xe.prev,Xe,Xe.next)>=0)return false;if(Xe=Xe.prevZ,We.x>=de&&We.x<=_e&&We.y>=pe&&We.y<=Se&&We!==S&&We!==M&&c4(F,Q,G,ie,q,ae,We.x,We.y)&&bd(We.prev,We,We.next)>=0)return false;We=We.nextZ}for(;Xe&&Xe.z>=Fe;){if(Xe.x>=de&&Xe.x<=_e&&Xe.y>=pe&&Xe.y<=Se&&Xe!==S&&Xe!==M&&c4(F,Q,G,ie,q,ae,Xe.x,Xe.y)&&bd(Xe.prev,Xe,Xe.next)>=0)return false;Xe=Xe.prevZ}for(;We&&We.z<=Ye;){if(We.x>=de&&We.x<=_e&&We.y>=pe&&We.y<=Se&&We!==S&&We!==M&&c4(F,Q,G,ie,q,ae,We.x,We.y)&&bd(We.prev,We,We.next)>=0)return false;We=We.nextZ}return true}function VOe(b,p){let y=b;do{const T=y.prev,S=y.next.next;!fI(T,S)&&Hse(T,y,y.next,S)&&u4(T,S)&&u4(S,T)&&(p.push(T.i,y.i,S.i),d4(y),d4(y.next),y=b=S),y=y.next}while(y!==b);return Bv(y)}function zse(b,p,y,T,S,R){let M=b;do{let F=M.next.next;for(;F!==M.prev;){if(M.i!==F.i&&Gse(M,F)){let G=Cq(M,F);return M=Bv(M,M.next),G=Bv(G,G.next),l4(M,p,y,T,S,R,0),void l4(G,p,y,T,S,R,0)}F=F.next}M=M.next}while(M!==b)}function $Oe(b,p){let y=b.x-p.x;return 0===y&&(y=b.y-p.y,0===y)&&(y=(b.next.y-b.y)/(b.next.x-b.x)-(p.next.y-p.y)/(p.next.x-p.x)),y}function GOe(b,p){const y=function(S,R){let M=R;const F=S.x,G=S.y;let q,Q=-1/0;if(fI(S,M))return M;do{if(fI(S,M.next))return M.next;if(G<=M.y&&G>=M.next.y&&M.next.y!==M.y){const _e=M.x+(G-M.y)*(M.next.x-M.x)/(M.next.y-M.y);if(_e<=F&&_e>Q&&(Q=_e,q=M.x=M.x&&M.x>=ae&&F!==M.x&&$se(Gq.x||M.x===q.x&&Use(q,M)))&&(q=M,pe=_e)}M=M.next}while(M!==ie);return q}(b,p);if(!y)return p;const T=Cq(y,b);return Bv(T,T.next),Bv(y,y.next)}function Use(b,p){return bd(b.prev,b,p.prev)<0&&bd(p.next,b,b.next)<0}function F7(b,p,y,T,S){return(b=1431655765&((b=858993459&((b=252645135&((b=16711935&((b=(b-y)*S|0)|b<<8))|b<<4))|b<<2))|b<<1))|(p=1431655765&((p=858993459&((p=252645135&((p=16711935&((p=(p-T)*S|0)|p<<8))|p<<4))|p<<2))|p<<1))<<1}function Vse(b){let p=b,y=b;do{(p.x=(b-M)*(R-F)&&(b-M)*(T-F)>=(y-M)*(p-F)&&(y-M)*(R-F)>=(S-M)*(T-F)}function c4(b,p,y,T,S,R,M,F){return!(b===M&&p===F)&&$se(b,p,y,T,S,R,M,F)}function Gse(b,p){return b.next.i!==p.i&&b.prev.i!==p.i&&!function(y,T){let S=y;do{if(S.i!==y.i&&S.next.i!==y.i&&S.i!==T.i&&S.next.i!==T.i&&Hse(S,S.next,y,T))return true;S=S.next}while(S!==y);return false}(b,p)&&(u4(b,p)&&u4(p,b)&&function(y,T){let S=y,R=false;const M=(y.x+T.x)/2,F=(y.y+T.y)/2;do{S.y>F!=S.next.y>F&&S.next.y!==S.y&&M<(S.next.x-S.x)*(F-S.y)/(S.next.y-S.y)+S.x&&(R=!R),S=S.next}while(S!==y);return R}(b,p)&&(bd(b.prev,b,p.prev)||bd(b,p.prev,p))||fI(b,p)&&bd(b.prev,b,b.next)>0&&bd(p.prev,p,p.next)>0)}function bd(b,p,y){return(p.y-b.y)*(y.x-p.x)-(p.x-b.x)*(y.y-p.y)}function fI(b,p){return b.x===p.x&&b.y===p.y}function Hse(b,p,y,T){const S=O7(bd(b,p,y)),R=O7(bd(b,p,T)),M=O7(bd(y,T,b)),F=O7(bd(y,T,p));return S!==R&&M!==F||!(0!==S||!N7(b,y,p))||!(0!==R||!N7(b,T,p))||!(0!==M||!N7(y,b,T))||!(0!==F||!N7(y,p,T))}function N7(b,p,y){return p.x<=Math.max(b.x,y.x)&&p.x>=Math.min(b.x,y.x)&&p.y<=Math.max(b.y,y.y)&&p.y>=Math.min(b.y,y.y)}function O7(b){return b>0?1:b<0?-1:0}function u4(b,p){return bd(b.prev,b,b.next)<0?bd(b,p,b.next)>=0&&bd(b,b.prev,p)>=0:bd(b,p,b.prev)<0||bd(b,b.next,p)<0}function Cq(b,p){const y=Rb(b.i,b.x,b.y),T=Rb(p.i,p.x,p.y),S=b.next,R=p.prev;return b.next=p,p.prev=b,y.next=S,S.prev=y,T.next=y,y.prev=T,R.next=T,T.prev=R,T}function B7(b,p,y,T){const S=Rb(b,p,y);return T?(S.next=T.next,S.prev=T,T.next.prev=S,T.next=S):(S.prev=S,S.next=S),S}function d4(b){b.next.prev=b.prev,b.prev.next=b.next,b.prevZ&&(b.prevZ.nextZ=b.nextZ),b.nextZ&&(b.nextZ.prevZ=b.prevZ)}function Rb(b,p,y){return{i:b,x:p,y,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:false}}function z7(b,p,y=1){if(!b)return null;const T="string"==typeof b?Ah.from(b).getPrimary():b.getPrimary(),S="string"==typeof b?null:b.getSecondary();for(const R of[T,S]){if(!R)continue;const M=R.id.toString();p.has(M)||p.set(M,[]),R.scaleSelf(y),p.get(M).push(R)}return{primary:T.toString(),secondary:S?S.toString():null}}function Sq(b,p,y,T){const S=T.patternDependencies;let R=false;for(const M of p){const F=M.paint.get(`${b}-pattern`);F.isConstant()||(R=true),z7(F.constantOr(null),S,y)&&(R=true)}return R}function hI(b,p,y,T,S,R){const M=R.patternDependencies;for(const F of p){const G=F.paint.get(`${b}-pattern`).value;if("constant"!==G.kind){const q=z7(G.evaluate({zoom:T},y,{},void 0,R.availableImages),M,S);if(!q)continue;const{primary:Q,secondary:ie}=q;Q&&(y.patterns[F.id]=[Q,ie].filter(Boolean))}}return y}const om=qr/Math.PI/2,Pb=64,Aq=[Pb,32,16],Ib=-om,Mb=om;function pI(b,p,y,T=om){return y=Fn(y),[b*Math.sin(y)*T,-p*T,b*Math.cos(y)*T]}function bA(b,p,y){return pI(Math.cos(Fn(b)),Math.sin(Fn(b)),p,y)}const xA=63710088e-1,f4=2*Math.PI*xA;class Ea{constructor(p,y){if(isNaN(p)||isNaN(y))throw new Error(`Invalid LngLat object: (${p}, ${y})`);if(this.lng=+p,this.lat=+y,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Ea(Jn(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(p){const y=Math.PI/180,T=this.lat*y,S=p.lat*y,R=Math.sin(T)*Math.sin(S)+Math.cos(T)*Math.cos(S)*Math.cos((p.lng-this.lng)*y);return xA*Math.acos(Math.min(R,1))}toBounds(p=0){const y=360*p/40075017,T=y/Math.cos(Math.PI/180*this.lat);return new k({lng:this.lng-T,lat:this.lat-y},{lng:this.lng+T,lat:this.lat+y})}toEcef(p){return bA(this.lat,this.lng,om+p*om/xA)}static convert(p){if(p instanceof Ea)return p;if(Array.isArray(p)&&(2===p.length||3===p.length))return new Ea(Number(p[0]),Number(p[1]));if(!Array.isArray(p)&&"object"==typeof p&&null!==p)return new Ea(Number("lng"in p?p.lng:p.lon),Number(p.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}class k{constructor(p,y){p&&(y?this.setSouthWest(p).setNorthEast(y):Array.isArray(p)&&4===p.length?this.setSouthWest([p[0],p[1]]).setNorthEast([p[2],p[3]]):this.setSouthWest(p[0]).setNorthEast(p[1]))}setNorthEast(p){return this._ne=p instanceof Ea?new Ea(p.lng,p.lat):Ea.convert(p),this}setSouthWest(p){return this._sw=p instanceof Ea?new Ea(p.lng,p.lat):Ea.convert(p),this}extend(p){const y=this._sw,T=this._ne;let S,R;if(p instanceof Ea)S=p,R=p;else{if(!(p instanceof k))return Array.isArray(p)?4===p.length||p.every(Array.isArray)?this.extend(k.convert(p)):this.extend(Ea.convert(p)):"object"==typeof p&&null!==p&&Object.hasOwn(p,"lat")&&(Object.hasOwn(p,"lon")||Object.hasOwn(p,"lng"))?this.extend(Ea.convert(p)):this;if(S=p._sw,R=p._ne,!S||!R)return this}return y||T?(y.lng=Math.min(S.lng,y.lng),y.lat=Math.min(S.lat,y.lat),T.lng=Math.max(R.lng,T.lng),T.lat=Math.max(R.lat,T.lat)):(this._sw=new Ea(S.lng,S.lat),this._ne=new Ea(R.lng,R.lat)),this}getCenter(){return new Ea((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new Ea(this.getWest(),this.getNorth())}getSouthEast(){return new Ea(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(p){const{lng:y,lat:T}=Ea.convert(p);let S=this._sw.lng<=y&&y<=this._ne.lng;return this._sw.lng>this._ne.lng&&(S=this._sw.lng>=y&&y>=this._ne.lng),this._sw.lat<=T&&T<=this._ne.lat&&S}static convert(p){if(p)return p instanceof k?p:new k(p)}}function v(b){return f4*Math.cos(b*Math.PI/180)}function E(b,p){return b/v(p)}function D(b,p){return b*v(Ju(p))}const V=85.051129;function Y(b){return Math.cos(Fn(bn(b,-85.051129,V)))}function Z(b,p){const y=bn(p,0,25.5),T=Math.pow(2,y);return Y(b)*f4/(512*T)}function ne(b){return 1/Math.cos(b*Math.PI/180)}function le(b,p=0){const y=Math.exp(Math.PI*(1-(b.y+p/qr)/(1<=G?(me(b,p,y,q,Q,R,ie,F,G),me(b,q,Q,T,S,ie,M,F,G)):b.push(M)}function Pe(b,p,y){let T=b[0],S=T.x,R=T.y;p(T);const M=[T];for(let F=1;Fb.x+1||Tb.y+1)&&yn("Geometry exceeds allowed extent, reduce your vector tile buffer size"),b}function vt(b,p,y){const T=b.loadGeometry(),S=b.extent,R=qr/S;if(p&&y&&y.projection.isReprojectedInTileSpace){const M=1<{const de=eg((p.x+ae.x/S)/M),pe=Ju((p.y+ae.y/S)/M),_e=Q.project(de,pe);ae.x=(_e.x*F-G)*S,ae.y=(_e.y*F-q)*S};for(let ae=0;ae=S||pe.y<0||pe.y>=S||(ie(pe),de.push(pe));T[ae]=de}}for(const M of T)for(const F of M)xt(F,R);return T}function It(b,p){return{type:b.type,id:b.id,properties:b.properties,geometry:p?vt(b):[]}}const jt={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Zt{constructor(p,y){this._structArray=p,this._pos1=y*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}const kn=new ArrayBuffer(0);class cn{constructor(){this._reallocCount=0,this.capacity=0,this.length=0}static serialize(p,y){return p._trim(),y&&p.arrayBuffer&&y.add(p.arrayBuffer),{length:p.length,arrayBuffer:p.arrayBuffer}}static deserialize(p){const y=Object.create(this.prototype);return y.arrayBuffer=p.arrayBuffer,y.length=p.length,p.arrayBuffer?y.capacity=p.arrayBuffer.byteLength/y.bytesPerElement:(y.capacity=0,y.arrayBuffer=kn),y._refreshViews(),y}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(p){this.reserve(p),this.length=p}resizeExact(p){this.reserveExact(p),this.length=p}reserve(p){p>this.capacity&&this._allocate(Math.max(p,Math.floor(5*this.capacity),128))}reserveExact(p){(p>this.capacity||!this.arrayBuffer)&&this._allocate(p)}_allocate(p){this._reallocCount++,this.capacity=p,this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const y=this.uint8;this._refreshViews(),y&&this.uint8.set(y)}reserveForAdditional(p){this.reserve(this.length+p)}_refreshViews(){throw new Error("StructArray#_refreshViews() must be implemented by each concrete StructArray layout")}emplace(...p){throw new Error("StructArray#emplace() must be implemented by each concrete StructArray layout")}emplaceBack(...p){throw new Error("StructArray#emplaceBack() must be implemented by each concrete StructArray layout")}destroy(){this.int8=this.uint8=this.int16=this.uint16=this.int32=this.uint32=this.float32=null,this.arrayBuffer=null}}function hn(b,p=1){let y=0,T=0;return{members:b.map(S=>{const R=jt[S.type].BYTES_PER_ELEMENT,M=y=xn(y,Math.max(p,R)),F=S.components||1;return T=Math.max(T,R),y+=R*F,{name:S.name,type:S.type,components:F,offset:M}}),size:xn(y,Math.max(T,p)),alignment:p}}function xn(b,p){return Math.ceil(b/p)*p}class wn extends cn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(p,y){const T=this.length;return this.resize(T+1),this.emplace(T,p,y)}emplace(p,y,T){const S=2*p;return this.int16[S+0]=y,this.int16[S+1]=T,p}}wn.prototype.bytesPerElement=4,li(wn,"StructArrayLayout2i4");class Bn extends cn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(p,y,T){const S=this.length;return this.resize(S+1),this.emplace(S,p,y,T)}emplace(p,y,T,S){const R=3*p;return this.int16[R+0]=y,this.int16[R+1]=T,this.int16[R+2]=S,p}}Bn.prototype.bytesPerElement=6,li(Bn,"StructArrayLayout3i6");class Kn extends cn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(p,y,T,S){const R=this.length;return this.resize(R+1),this.emplace(R,p,y,T,S)}emplace(p,y,T,S,R){const M=4*p;return this.int16[M+0]=y,this.int16[M+1]=T,this.uint16[M+2]=S,this.uint16[M+3]=R,p}}Kn.prototype.bytesPerElement=8,li(Kn,"StructArrayLayout2i2ui8");class Wn extends cn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(p){const y=this.length;return this.resize(y+1),this.emplace(y,p)}emplace(p,y){return this.float32[1*p+0]=y,p}}Wn.prototype.bytesPerElement=4,li(Wn,"StructArrayLayout1f4");class Yn extends cn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(p,y,T){const S=this.length;return this.resize(S+1),this.emplace(S,p,y,T)}emplace(p,y,T,S){const R=4*p,M=2*p;return this.int16[R+0]=y,this.int16[R+1]=T,this.float32[M+1]=S,p}}Yn.prototype.bytesPerElement=8,li(Yn,"StructArrayLayout2i1f8");class Vn extends cn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(p,y,T){const S=this.length;return this.resize(S+1),this.emplace(S,p,y,T)}emplace(p,y,T,S){const R=4*p;return this.int16[R+0]=y,this.int16[R+1]=T,this.int16[R+2]=S,p}}Vn.prototype.bytesPerElement=8,li(Vn,"StructArrayLayout3i8");class Zr extends cn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(p,y,T,S){const R=this.length;return this.resize(R+1),this.emplace(R,p,y,T,S)}emplace(p,y,T,S,R){const M=4*p;return this.int16[M+0]=y,this.int16[M+1]=T,this.int16[M+2]=S,this.int16[M+3]=R,p}}Zr.prototype.bytesPerElement=8,li(Zr,"StructArrayLayout4i8");class Qn extends cn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(p,y,T,S,R){const M=this.length;return this.resize(M+1),this.emplace(M,p,y,T,S,R)}emplace(p,y,T,S,R,M){const F=5*p;return this.int16[F+0]=y,this.int16[F+1]=T,this.int16[F+2]=S,this.int16[F+3]=R,this.int16[F+4]=M,p}}Qn.prototype.bytesPerElement=10,li(Qn,"StructArrayLayout5i10");class kr extends cn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(p,y,T,S,R,M,F){const G=this.length;return this.resize(G+1),this.emplace(G,p,y,T,S,R,M,F)}emplace(p,y,T,S,R,M,F,G){const q=6*p,Q=12*p,ie=3*p;return this.int16[q+0]=y,this.int16[q+1]=T,this.uint8[Q+4]=S,this.uint8[Q+5]=R,this.uint8[Q+6]=M,this.uint8[Q+7]=F,this.float32[ie+2]=G,p}}kr.prototype.bytesPerElement=12,li(kr,"StructArrayLayout2i4ub1f12");class Vr extends cn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(p,y,T){const S=this.length;return this.resize(S+1),this.emplace(S,p,y,T)}emplace(p,y,T,S){const R=3*p;return this.float32[R+0]=y,this.float32[R+1]=T,this.float32[R+2]=S,p}}Vr.prototype.bytesPerElement=12,li(Vr,"StructArrayLayout3f12");class mi extends cn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(p,y,T,S,R){const M=this.length;return this.resize(M+1),this.emplace(M,p,y,T,S,R)}emplace(p,y,T,S,R,M){const F=6*p,G=3*p;return this.uint16[F+0]=y,this.uint16[F+1]=T,this.uint16[F+2]=S,this.uint16[F+3]=R,this.float32[G+2]=M,p}}mi.prototype.bytesPerElement=12,li(mi,"StructArrayLayout4ui1f12");class si extends cn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(p,y,T,S){const R=this.length;return this.resize(R+1),this.emplace(R,p,y,T,S)}emplace(p,y,T,S,R){const M=4*p;return this.uint16[M+0]=y,this.uint16[M+1]=T,this.uint16[M+2]=S,this.uint16[M+3]=R,p}}si.prototype.bytesPerElement=8,li(si,"StructArrayLayout4ui8");class Kr extends cn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(p,y,T,S,R,M){const F=this.length;return this.resize(F+1),this.emplace(F,p,y,T,S,R,M)}emplace(p,y,T,S,R,M,F){const G=6*p;return this.int16[G+0]=y,this.int16[G+1]=T,this.int16[G+2]=S,this.int16[G+3]=R,this.int16[G+4]=M,this.int16[G+5]=F,p}}Kr.prototype.bytesPerElement=12,li(Kr,"StructArrayLayout6i12");class qi extends cn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(p,y,T,S,R,M,F,G,q,Q,ie,ae){const de=this.length;return this.resize(de+1),this.emplace(de,p,y,T,S,R,M,F,G,q,Q,ie,ae)}emplace(p,y,T,S,R,M,F,G,q,Q,ie,ae,de){const pe=12*p;return this.int16[pe+0]=y,this.int16[pe+1]=T,this.int16[pe+2]=S,this.int16[pe+3]=R,this.uint16[pe+4]=M,this.uint16[pe+5]=F,this.uint16[pe+6]=G,this.uint16[pe+7]=q,this.int16[pe+8]=Q,this.int16[pe+9]=ie,this.int16[pe+10]=ae,this.int16[pe+11]=de,p}}qi.prototype.bytesPerElement=24,li(qi,"StructArrayLayout4i4ui4i24");class Wr extends cn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(p,y,T,S,R,M){const F=this.length;return this.resize(F+1),this.emplace(F,p,y,T,S,R,M)}emplace(p,y,T,S,R,M,F){const G=10*p,q=5*p;return this.int16[G+0]=y,this.int16[G+1]=T,this.int16[G+2]=S,this.float32[q+2]=R,this.float32[q+3]=M,this.float32[q+4]=F,p}}Wr.prototype.bytesPerElement=20,li(Wr,"StructArrayLayout3i3f20");class Lr extends cn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(p,y,T,S){const R=this.length;return this.resize(R+1),this.emplace(R,p,y,T,S)}emplace(p,y,T,S,R){const M=4*p;return this.float32[M+0]=y,this.float32[M+1]=T,this.float32[M+2]=S,this.float32[M+3]=R,p}}Lr.prototype.bytesPerElement=16,li(Lr,"StructArrayLayout4f16");class ii extends cn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(p){const y=this.length;return this.resize(y+1),this.emplace(y,p)}emplace(p,y){return this.uint32[1*p+0]=y,p}}ii.prototype.bytesPerElement=4,li(ii,"StructArrayLayout1ul4");class Di extends cn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(p,y){const T=this.length;return this.resize(T+1),this.emplace(T,p,y)}emplace(p,y,T){const S=2*p;return this.uint16[S+0]=y,this.uint16[S+1]=T,p}}Di.prototype.bytesPerElement=4,li(Di,"StructArrayLayout2ui4");class ci extends cn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(p,y,T,S,R,M,F,G,q,Q,ie,ae,de){const pe=this.length;return this.resize(pe+1),this.emplace(pe,p,y,T,S,R,M,F,G,q,Q,ie,ae,de)}emplace(p,y,T,S,R,M,F,G,q,Q,ie,ae,de,pe){const _e=20*p,Se=10*p;return this.int16[_e+0]=y,this.int16[_e+1]=T,this.int16[_e+2]=S,this.int16[_e+3]=R,this.int16[_e+4]=M,this.float32[Se+3]=F,this.float32[Se+4]=G,this.float32[Se+5]=q,this.float32[Se+6]=Q,this.int16[_e+14]=ie,this.uint32[Se+8]=ae,this.uint16[_e+18]=de,this.uint16[_e+19]=pe,p}}ci.prototype.bytesPerElement=40,li(ci,"StructArrayLayout5i4f1i1ul2ui40");class Ri extends cn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(p,y,T,S,R,M,F){const G=this.length;return this.resize(G+1),this.emplace(G,p,y,T,S,R,M,F)}emplace(p,y,T,S,R,M,F,G){const q=8*p;return this.int16[q+0]=y,this.int16[q+1]=T,this.int16[q+2]=S,this.int16[q+4]=R,this.int16[q+5]=M,this.int16[q+6]=F,this.int16[q+7]=G,p}}Ri.prototype.bytesPerElement=16,li(Ri,"StructArrayLayout3i2i2i16");class ji extends cn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(p,y,T,S,R){const M=this.length;return this.resize(M+1),this.emplace(M,p,y,T,S,R)}emplace(p,y,T,S,R,M){const F=4*p,G=8*p;return this.float32[F+0]=y,this.float32[F+1]=T,this.float32[F+2]=S,this.int16[G+6]=R,this.int16[G+7]=M,p}}ji.prototype.bytesPerElement=16,li(ji,"StructArrayLayout2f1f2i16");class Go extends cn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(p,y,T,S,R,M){const F=this.length;return this.resize(F+1),this.emplace(F,p,y,T,S,R,M)}emplace(p,y,T,S,R,M,F){const G=20*p,q=5*p;return this.uint8[G+0]=y,this.uint8[G+1]=T,this.float32[q+1]=S,this.float32[q+2]=R,this.float32[q+3]=M,this.float32[q+4]=F,p}}Go.prototype.bytesPerElement=20,li(Go,"StructArrayLayout2ub4f20");class po extends cn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(p,y,T){const S=this.length;return this.resize(S+1),this.emplace(S,p,y,T)}emplace(p,y,T,S){const R=3*p;return this.uint16[R+0]=y,this.uint16[R+1]=T,this.uint16[R+2]=S,p}}po.prototype.bytesPerElement=6,li(po,"StructArrayLayout3ui6");class Oa extends cn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(p,y,T,S,R,M,F,G,q,Q,ie,ae,de,pe,_e,Se,Fe,Ye,Xe,We,rt){const lt=this.length;return this.resize(lt+1),this.emplace(lt,p,y,T,S,R,M,F,G,q,Q,ie,ae,de,pe,_e,Se,Fe,Ye,Xe,We,rt)}emplace(p,y,T,S,R,M,F,G,q,Q,ie,ae,de,pe,_e,Se,Fe,Ye,Xe,We,rt,lt){const Bt=30*p,ht=15*p,Tt=60*p;return this.int16[Bt+0]=y,this.int16[Bt+1]=T,this.int16[Bt+2]=S,this.float32[ht+2]=R,this.float32[ht+3]=M,this.uint16[Bt+8]=F,this.uint16[Bt+9]=G,this.uint32[ht+5]=q,this.uint32[ht+6]=Q,this.uint32[ht+7]=ie,this.uint16[Bt+16]=ae,this.uint16[Bt+17]=de,this.uint16[Bt+18]=pe,this.float32[ht+10]=_e,this.float32[ht+11]=Se,this.uint8[Tt+48]=Fe,this.uint8[Tt+49]=Ye,this.uint8[Tt+50]=Xe,this.uint32[ht+13]=We,this.int16[Bt+28]=rt,this.uint8[Tt+58]=lt,p}}Oa.prototype.bytesPerElement=60,li(Oa,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class Js extends cn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(p,y,T,S,R,M,F,G,q,Q,ie,ae,de,pe,_e,Se,Fe,Ye,Xe,We,rt,lt,Bt,ht,Tt,Lt,Nt,un,_n,Dn,Ln,zn,or){const nn=this.length;return this.resize(nn+1),this.emplace(nn,p,y,T,S,R,M,F,G,q,Q,ie,ae,de,pe,_e,Se,Fe,Ye,Xe,We,rt,lt,Bt,ht,Tt,Lt,Nt,un,_n,Dn,Ln,zn,or)}emplace(p,y,T,S,R,M,F,G,q,Q,ie,ae,de,pe,_e,Se,Fe,Ye,Xe,We,rt,lt,Bt,ht,Tt,Lt,Nt,un,_n,Dn,Ln,zn,or,nn){const En=20*p,In=40*p,Gn=80*p;return this.float32[En+0]=y,this.float32[En+1]=T,this.int16[In+4]=S,this.int16[In+5]=R,this.int16[In+6]=M,this.int16[In+7]=F,this.int16[In+8]=G,this.int16[In+9]=q,this.int16[In+10]=Q,this.int16[In+11]=ie,this.int16[In+12]=ae,this.uint16[In+13]=de,this.uint16[In+14]=pe,this.uint16[In+15]=_e,this.uint16[In+16]=Se,this.uint16[In+17]=Fe,this.uint16[In+18]=Ye,this.uint16[In+19]=Xe,this.uint16[In+20]=We,this.uint16[In+21]=rt,this.uint16[In+22]=lt,this.uint16[In+23]=Bt,this.uint16[In+24]=ht,this.uint16[In+25]=Tt,this.uint16[In+26]=Lt,this.uint16[In+27]=Nt,this.uint32[En+14]=un,this.float32[En+15]=_n,this.float32[En+16]=Dn,this.float32[En+17]=Ln,this.float32[En+18]=zn,this.uint8[Gn+76]=or,this.uint16[In+39]=nn,p}}Js.prototype.bytesPerElement=80,li(Js,"StructArrayLayout2f9i15ui1ul4f1ub1ui80");class ws extends cn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(p,y,T,S,R,M){const F=this.length;return this.resize(F+1),this.emplace(F,p,y,T,S,R,M)}emplace(p,y,T,S,R,M,F){const G=6*p;return this.float32[G+0]=y,this.float32[G+1]=T,this.float32[G+2]=S,this.float32[G+3]=R,this.float32[G+4]=M,this.float32[G+5]=F,p}}ws.prototype.bytesPerElement=24,li(ws,"StructArrayLayout6f24");class ta extends cn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(p,y,T,S,R){const M=this.length;return this.resize(M+1),this.emplace(M,p,y,T,S,R)}emplace(p,y,T,S,R,M){const F=5*p;return this.float32[F+0]=y,this.float32[F+1]=T,this.float32[F+2]=S,this.float32[F+3]=R,this.float32[F+4]=M,p}}ta.prototype.bytesPerElement=20,li(ta,"StructArrayLayout5f20");class xo extends cn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(p,y,T,S,R,M,F){const G=this.length;return this.resize(G+1),this.emplace(G,p,y,T,S,R,M,F)}emplace(p,y,T,S,R,M,F,G){const q=7*p;return this.float32[q+0]=y,this.float32[q+1]=T,this.float32[q+2]=S,this.float32[q+3]=R,this.float32[q+4]=M,this.float32[q+5]=F,this.float32[q+6]=G,p}}xo.prototype.bytesPerElement=28,li(xo,"StructArrayLayout7f28");class Qs extends cn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(p,y,T,S,R,M,F,G,q,Q,ie){const ae=this.length;return this.resize(ae+1),this.emplace(ae,p,y,T,S,R,M,F,G,q,Q,ie)}emplace(p,y,T,S,R,M,F,G,q,Q,ie,ae){const de=11*p;return this.float32[de+0]=y,this.float32[de+1]=T,this.float32[de+2]=S,this.float32[de+3]=R,this.float32[de+4]=M,this.float32[de+5]=F,this.float32[de+6]=G,this.float32[de+7]=q,this.float32[de+8]=Q,this.float32[de+9]=ie,this.float32[de+10]=ae,p}}Qs.prototype.bytesPerElement=44,li(Qs,"StructArrayLayout11f44");class lc extends cn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(p,y,T,S,R,M,F,G,q){const Q=this.length;return this.resize(Q+1),this.emplace(Q,p,y,T,S,R,M,F,G,q)}emplace(p,y,T,S,R,M,F,G,q,Q){const ie=9*p;return this.float32[ie+0]=y,this.float32[ie+1]=T,this.float32[ie+2]=S,this.float32[ie+3]=R,this.float32[ie+4]=M,this.float32[ie+5]=F,this.float32[ie+6]=G,this.float32[ie+7]=q,this.float32[ie+8]=Q,p}}lc.prototype.bytesPerElement=36,li(lc,"StructArrayLayout9f36");class $l extends cn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(p,y){const T=this.length;return this.resize(T+1),this.emplace(T,p,y)}emplace(p,y,T){const S=2*p;return this.float32[S+0]=y,this.float32[S+1]=T,p}}$l.prototype.bytesPerElement=8,li($l,"StructArrayLayout2f8");class la extends cn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(p,y,T,S){const R=this.length;return this.resize(R+1),this.emplace(R,p,y,T,S)}emplace(p,y,T,S,R){const M=6*p;return this.uint32[3*p+0]=y,this.uint16[M+2]=T,this.uint16[M+3]=S,this.uint16[M+4]=R,p}}la.prototype.bytesPerElement=12,li(la,"StructArrayLayout1ul3ui12");class cl extends cn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(p){const y=this.length;return this.resize(y+1),this.emplace(y,p)}emplace(p,y){return this.uint16[1*p+0]=y,p}}cl.prototype.bytesPerElement=2,li(cl,"StructArrayLayout1ui2");class Fs extends cn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(p,y,T,S,R,M,F,G,q,Q,ie,ae,de,pe,_e,Se){const Fe=this.length;return this.resize(Fe+1),this.emplace(Fe,p,y,T,S,R,M,F,G,q,Q,ie,ae,de,pe,_e,Se)}emplace(p,y,T,S,R,M,F,G,q,Q,ie,ae,de,pe,_e,Se,Fe){const Ye=16*p;return this.float32[Ye+0]=y,this.float32[Ye+1]=T,this.float32[Ye+2]=S,this.float32[Ye+3]=R,this.float32[Ye+4]=M,this.float32[Ye+5]=F,this.float32[Ye+6]=G,this.float32[Ye+7]=q,this.float32[Ye+8]=Q,this.float32[Ye+9]=ie,this.float32[Ye+10]=ae,this.float32[Ye+11]=de,this.float32[Ye+12]=pe,this.float32[Ye+13]=_e,this.float32[Ye+14]=Se,this.float32[Ye+15]=Fe,p}}Fs.prototype.bytesPerElement=64,li(Fs,"StructArrayLayout16f64");class hs extends cn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(p,y,T,S,R,M,F){const G=this.length;return this.resize(G+1),this.emplace(G,p,y,T,S,R,M,F)}emplace(p,y,T,S,R,M,F,G){const q=10*p,Q=5*p;return this.uint16[q+0]=y,this.uint16[q+1]=T,this.uint16[q+2]=S,this.uint16[q+3]=R,this.float32[Q+2]=M,this.float32[Q+3]=F,this.float32[Q+4]=G,p}}hs.prototype.bytesPerElement=20,li(hs,"StructArrayLayout4ui3f20");class au extends cn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(p){const y=this.length;return this.resize(y+1),this.emplace(y,p)}emplace(p,y){return this.int16[1*p+0]=y,p}}au.prototype.bytesPerElement=2,li(au,"StructArrayLayout1i2");class su extends cn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer)}emplaceBack(p){const y=this.length;return this.resize(y+1),this.emplace(y,p)}emplace(p,y){return this.uint8[1*p+0]=y,p}}su.prototype.bytesPerElement=1,li(su,"StructArrayLayout1ub1");class ul extends Zt{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.int16[this._pos2+3]}get tileAnchorY(){return this._structArray.int16[this._pos2+4]}get x1(){return this._structArray.float32[this._pos4+3]}get y1(){return this._structArray.float32[this._pos4+4]}get x2(){return this._structArray.float32[this._pos4+5]}get y2(){return this._structArray.float32[this._pos4+6]}get padding(){return this._structArray.int16[this._pos2+14]}get featureIndex(){return this._structArray.uint32[this._pos4+8]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+18]}get bucketIndex(){return this._structArray.uint16[this._pos2+19]}}ul.prototype.size=40;class Es extends ci{get(p){return new ul(this,p)}}li(Es,"CollisionBoxArray");class Fc extends Zt{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+8]}get numGlyphs(){return this._structArray.uint16[this._pos2+9]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+5]}get lineStartIndex(){return this._structArray.uint32[this._pos4+6]}get lineLength(){return this._structArray.uint32[this._pos4+7]}get segment(){return this._structArray.uint16[this._pos2+16]}get lowerSize(){return this._structArray.uint16[this._pos2+17]}get upperSize(){return this._structArray.uint16[this._pos2+18]}get lineOffsetX(){return this._structArray.float32[this._pos4+10]}get lineOffsetY(){return this._structArray.float32[this._pos4+11]}get writingMode(){return this._structArray.uint8[this._pos1+48]}get placedOrientation(){return this._structArray.uint8[this._pos1+49]}set placedOrientation(p){this._structArray.uint8[this._pos1+49]=p}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(p){this._structArray.uint8[this._pos1+50]=p}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(p){this._structArray.uint32[this._pos4+13]=p}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(p){this._structArray.uint8[this._pos1+58]=p}}Fc.prototype.size=60;class ff extends Oa{get(p){return new Fc(this,p)}}li(ff,"PlacedSymbolArray");class Lb extends Zt{get tileAnchorX(){return this._structArray.float32[this._pos4+0]}get tileAnchorY(){return this._structArray.float32[this._pos4+1]}get projectedAnchorX(){return this._structArray.int16[this._pos2+4]}get projectedAnchorY(){return this._structArray.int16[this._pos2+5]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+6]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+7]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+8]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+9]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+10]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+11]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+12]}get key(){return this._structArray.uint16[this._pos2+13]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+14]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+15]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+16]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+17]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+18]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+19]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+20]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+21]}get featureIndex(){return this._structArray.uint16[this._pos2+22]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+23]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+24]}get numIconVertices(){return this._structArray.uint16[this._pos2+25]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+26]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+27]}get crossTileID(){return this._structArray.uint32[this._pos4+14]}set crossTileID(p){this._structArray.uint32[this._pos4+14]=p}get textOffset0(){return this._structArray.float32[this._pos4+15]}get textOffset1(){return this._structArray.float32[this._pos4+16]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+17]}get zOffset(){return this._structArray.float32[this._pos4+18]}set zOffset(p){this._structArray.float32[this._pos4+18]=p}get hasIconTextFit(){return this._structArray.uint8[this._pos1+76]}get elevationFeatureIndex(){return this._structArray.uint16[this._pos2+39]}}Lb.prototype.size=80;class gp extends Js{get(p){return new Lb(this,p)}}li(gp,"SymbolInstanceArray");class t1 extends Wn{getoffsetX(p){return this.float32[1*p+0]}}li(t1,"GlyphOffsetArray");class $s extends wn{getx(p){return this.int16[2*p+0]}gety(p){return this.int16[2*p+1]}}li($s,"SymbolLineVertexArray");class dl extends Zt{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}get layoutVertexArrayOffset(){return this._structArray.uint16[this._pos2+4]}}dl.prototype.size=12;class Ha extends la{get(p){return new dl(this,p)}}li(Ha,"FeatureIndexArray");class Kc extends Di{geta_centroid_pos0(p){return this.uint16[2*p+0]}geta_centroid_pos1(p){return this.uint16[2*p+1]}}li(Kc,"FillExtrusionCentroidArray");class hf extends Zt{get a_join_normal_inside0(){return this._structArray.int16[this._pos2+0]}get a_join_normal_inside1(){return this._structArray.int16[this._pos2+1]}get a_join_normal_inside2(){return this._structArray.int16[this._pos2+2]}}hf.prototype.size=6;class Lo extends Bn{get(p){return new hf(this,p)}}li(Lo,"FillExtrusionWallArray");const Nc=hn([{name:"a_pos",components:2,type:"Int16"}],4),kh=hn([{name:"a_road_z_offset",components:1,type:"Float32"}],4),ng=hn([{name:"a_pos",components:2,type:"Int16"},{name:"a_height",components:1,type:"Float32"}],4),n1=hn([{name:"a_pos_normal_3",components:3,type:"Int16"}],4);class Ls{constructor(p=[]){this.segments=p}_prepareSegment(p,y,T,S,R){let M=this.segments.at(-1);return p>Ls.MAX_VERTEX_ARRAY_LENGTH&&yn(`Max vertices per segment is ${Ls.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${p}`),(!M||M.vertexLength+p>Ls.MAX_VERTEX_ARRAY_LENGTH||M.sortKey!==S||void 0!==R&&M&&void 0!==M.batchIndex&&M.batchIndex!==R)&&(M={vertexOffset:y,primitiveOffset:T,vertexLength:0,primitiveLength:0},void 0!==S&&(M.sortKey=S),void 0!==R&&(M.batchIndex=R),this.segments.push(M)),M}prepareSegment(p,y,T,S,R){return this._prepareSegment(p,y.length,T.length,S,R)}get(){return this.segments}destroy(){for(const p of this.segments)for(const y in p.vaos)p.vaos[y].destroy()}static simpleSegment(p,y,T,S){return new Ls([{vertexOffset:p,primitiveOffset:y,vertexLength:T,primitiveLength:S,vaos:{},sortKey:0}])}}function am(b,p){return 256*(b=bn(Math.floor(b),0,255))+bn(Math.floor(p),0,255)}Ls.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,li(Ls,"SegmentVector");const p0=hn([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),vA=hn([{name:"a_pattern_b",components:4,type:"Uint16"}]),r1=hn([{name:"a_dash",components:4,type:"Uint16"}]);class i1{constructor(){this.ids=[],this.uniqueIds=[],this.positions=[],this.indexed=false}add(p,y,T,S){this.ids.push(U7(p)),this.positions.push(y,T,S)}eachPosition(p,y){const T=U7(p);let S=0,R=this.ids.length-1;for(;S>1;this.ids[M]>=T?R=M:S=M+1}for(;this.ids[S]===T;)y(this.positions[3*S],this.positions[3*S+1],this.positions[3*S+2]),S++}static serialize(p,y){const T=new Float64Array(p.ids),S=new Uint32Array(p.positions);return mI(T,S,0,T.length-1),y&&(y.add(T.buffer),y.add(S.buffer)),{ids:T,positions:S}}static deserialize(p){const y=new i1;let T;y.ids=p.ids,y.positions=p.positions;for(const S of y.ids)S!==T&&y.uniqueIds.push(S),T=S;return y.indexed=true,y}}function U7(b){const p=+b;return Number.isSafeInteger(p)?p:QS(String(b))}function mI(b,p,y,T){for(;y>1];let R=y-1,M=T+1;for(;;){do{R++}while(b[R]S);if(R>=M)break;gI(b,R,M),gI(p,3*R,3*M),gI(p,3*R+1,3*M+1),gI(p,3*R+2,3*M+2)}M-y`u_${R}`),this.type=T,this.context=S}setUniform(p,y,T,S,R){const M=S.constantOr(this.value);y.set(p,R,M instanceof Wo?M.toPremultipliedRenderColor(this.lutExpression&&"constant"===this.lutExpression.kind&&"none"===this.lutExpression.value?null:this.context.lut):M)}getBinding(p,y){return"color"===this.type?new Rq(p):new Eo(p)}}class Pq{constructor(p,y){this.uniformNames=y.map(T=>`u_${T}`),this.pattern=null,this.patternTransition=null,this.pixelRatio=1}setConstantPatternPositions(p,y){this.pixelRatio=p.pixelRatio||1,this.pattern=p.tl.concat(p.br),this.patternTransition=y?y.tl.concat(y.br):this.pattern}setUniform(p,y,T,S,R){let M=null;"u_pattern"!==R&&"u_dash"!==R||(M=this.pattern),"u_pattern_b"===R&&(M=this.patternTransition),"u_pixel_ratio"===R&&(M=this.pixelRatio),M&&y.set(p,R,M)}getBinding(p,y){return"u_pattern"===y||"u_pattern_b"===y||"u_dash"===y?new kq(p):new Eo(p)}}class _A{constructor(p,y,T,S){this.expression=p,this.type=T,this.maxValue=0,this.paintVertexAttributes=y.map(R=>({name:`a_${R}`,type:"Float32",components:"color"===T?2:1,offset:0})),this.paintVertexArray=new S}populatePaintArray(p,y,T,S,R,M,F,G){const q=this.paintVertexArray.length,Q="composite"===this.expression.kind||"source"===this.expression.kind?this.expression.evaluate(new Rl(0,{brightness:M,worldview:G}),y,{},R,S,F):"constant"===this.expression.kind&&this.expression.value,ie=Wse(this.lutExpression,y,{},S,R,M,F,G);this.paintVertexArray.resize(p),this._setPaintValue(q,p,Q,ie?null:this.context.lut)}updatePaintArray(p,y,T,S,R,M,F,G){const q="composite"===this.expression.kind||"source"===this.expression.kind?this.expression.evaluate({zoom:0,brightness:F,worldview:G},T,S,void 0,R):"constant"===this.expression.kind&&this.expression.value,Q=Wse(this.lutExpression,T,S,R,void 0,F,void 0,G);this._setPaintValue(p,y,q,Q?null:this.context.lut)}_setPaintValue(p,y,T,S){if("color"===this.type){const R=WOe(T.toPremultipliedRenderColor(S));for(let M=p;M`u_${F}_t`),this.type=T,this.useIntegerZoom=S,this.context=R,this.maxValue=0,this.paintVertexAttributes=y.map(F=>({name:`a_${F}`,type:"Float32",components:"color"===T?4:2,offset:0})),this.paintVertexArray=new M}populatePaintArray(p,y,T,S,R,M,F,G){const q=this.expression.evaluate(new Rl(this.context.zoom,{brightness:M,worldview:G}),y,{},R,S,F),Q=this.expression.evaluate(new Rl(this.context.zoom+1,{brightness:M,worldview:G}),y,{},R,S,F),ie=Wse(this.lutExpression,y,{},S,R,M,F,G),ae=this.paintVertexArray.length;this.paintVertexArray.resize(p),this._setPaintValue(ae,p,q,Q,ie?null:this.context.lut)}updatePaintArray(p,y,T,S,R,M,F,G){const q=this.expression.evaluate({zoom:this.context.zoom,brightness:F,worldview:G},T,S,void 0,R),Q=this.expression.evaluate({zoom:this.context.zoom+1,brightness:F,worldview:G},T,S,void 0,R),ie=Wse(this.lutExpression,T,S,R,void 0,F,void 0,G);this._setPaintValue(p,y,q,Q,ie?null:this.context.lut)}_setPaintValue(p,y,T,S,R){if("color"===this.type){const M=WOe(T.toPremultipliedRenderColor(R)),F=WOe(S.toPremultipliedRenderColor(R));for(let G=p;Gtrue){this.binders={},this._buffers=[],this.context=y;const S=[],R=p;for(const M in p.paint._values){const F=R.paint.get(M);if(M.endsWith("-use-theme"))continue;if(!T(M))continue;if(!(F instanceof mT&&JF(F.property.specification)))continue;const G=o_r(M,p.type),q=F.value,Q=F.property.specification.type,ie=!!F.property.useIntegerZoom,ae="line-dasharray"===M||M.endsWith("pattern"),de=R.paint.get(`${M}-use-theme`),pe="line-dasharray"===M&&"constant"!==R.layout.get("line-cap").value.kind||de&&"constant"!==de.value.kind;if("constant"!==q.kind||pe)if("source"===q.kind||pe||ae){const _e=I_t(M,Q,"source");this.binders[M]=ae?new z2(q,G,Q,_e,p.id):new _A(q,G,Q,_e),S.push(`/a_${M}`)}else{const _e=I_t(M,Q,"composite");this.binders[M]=new B2(q,G,Q,ie,y,_e),S.push(`/z_${M}`)}else this.binders[M]=ae?new Pq(q.value,G):new Yse(q.value,G,Q,y),S.push(`/u_${M}`);de&&(this.binders[M].lutExpression=de.value)}this.cacheKey=S.sort().join("")}updateExpressions(p){const y=p;for(const T in this.binders){const S=this.binders[T];if(S instanceof _A||S instanceof B2||S instanceof z2){const R=y.paint.get(T);S.expression=R.value}}}getMaxValue(p){const y=this.binders[p];return y instanceof _A||y instanceof B2?y.maxValue:0}populatePaintArrays(p,y,T,S,R,M,F,G){for(const q in this.binders){const Q=this.binders[q];Q.context=this.context,(Q instanceof _A||Q instanceof B2||Q instanceof z2)&&Q.populatePaintArray(p,y,T,S,R,M,F,G)}}setConstantPatternPositions(p,y){for(const T in this.binders){const S=this.binders[T];S instanceof Pq&&S.setConstantPatternPositions(p,y)}}getPatternTransitionVertexBuffer(p){const y=this.binders[p];return y instanceof z2?y.paintTransitionVertexBuffer:null}updatePaintArrays(p,y,T,S,R,M,F,G,q,Q){let ie=false;const ae=Object.keys(p),de=0!==ae.length&&!G,pe=de?ae:y.uniqueIds;this.context.lut=R.lut;for(const _e in this.binders){const Se=this.binders[_e];if(Se.context=this.context,(Se instanceof _A||Se instanceof B2||Se instanceof z2)&&Se.expression&&Se.expression.kind&&"constant"!==Se.expression.kind&&(true===Se.expression.isStateDependent||false===Se.expression.isLightConstant)){const Fe=R.paint.get(_e);Se.expression=Fe.value;for(const Ye of pe){const Xe=p[Ye.toString()];y.eachPosition(Ye,(We,rt,lt)=>{const Bt=S.feature(We);Se.updatePaintArray(rt,lt,Bt,Xe,M,F,q,Q)})}if(!de)for(const Ye of T.uniqueIds){const Xe=p[Ye.toString()];T.eachPosition(Ye,(We,rt,lt)=>{const Bt=S.feature(We);Se.updatePaintArray(rt,lt,Bt,Xe,M,F,q,Q)})}ie=true}}return ie}defines(){const p=[];for(const y in this.binders){const T=this.binders[y];(T instanceof Yse||T instanceof Pq)&&p.push(...T.uniformNames.map(S=>`#define HAS_UNIFORM_${S}`))}return p}getPaintVertexBuffers(){return this._buffers}getUniforms(p){const y=[];for(const T in this.binders){const S=this.binders[T];if(S instanceof Yse||S instanceof Pq||S instanceof B2)for(const R of S.uniformNames)y.push({name:R,property:T,binding:S.getBinding(p,R)})}return y}setUniforms(p,y,T,S,R){for(const{name:M,property:F,binding:G}of T)this.binders[F].setUniform(p,G,R,S.get(F),M)}updatePaintBuffers(){this._buffers=[];for(const p in this.binders){const y=this.binders[p];(y instanceof _A||y instanceof B2||y instanceof z2)&&y.paintVertexBuffer&&this._buffers.push(y.paintVertexBuffer),y instanceof z2&&y.paintTransitionVertexBuffer&&this._buffers.push(y.paintTransitionVertexBuffer)}}upload(p){for(const y in this.binders){const T=this.binders[y];(T instanceof _A||T instanceof B2||T instanceof z2)&&T.upload(p)}this.updatePaintBuffers()}destroy(){for(const p in this.binders){const y=this.binders[p];(y instanceof _A||y instanceof B2||y instanceof z2)&&y.destroy()}}}class yT{constructor(p,y,T=()=>true){this.programConfigurations={};for(const S of p)this.programConfigurations[S.id]=new h4(S,y,T);this.needsUpload=false,this._featureMap=new i1,this._featureMapWithoutIds=new i1,this._bufferOffset=0,this._idlessCounter=0}populatePaintArrays(p,y,T,S,R,M,F,G,q){for(const Q in this.programConfigurations)this.programConfigurations[Q].populatePaintArrays(p,y,S,R,M,F,G,q);void 0!==y.id?this._featureMap.add(y.id,T,this._bufferOffset,p):(this._featureMapWithoutIds.add(this._idlessCounter,T,this._bufferOffset,p),this._idlessCounter+=1),this._bufferOffset=p,this.needsUpload=true}updatePaintArrays(p,y,T,S,R,M,F,G){for(const q of T)this.needsUpload=this.programConfigurations[q.id].updatePaintArrays(p,this._featureMap,this._featureMapWithoutIds,y,q,S,R,M,F||0,G)||this.needsUpload}get(p){return this.programConfigurations[p]}upload(p){if(this.needsUpload){for(const y in this.programConfigurations)this.programConfigurations[y].upload(p);this.needsUpload=false}}destroy(){for(const p in this.programConfigurations)this.programConfigurations[p].destroy()}updateExpressions(p){const y=new Set;for(const T of p){const S=this.programConfigurations[T.id];S&&(S.updateExpressions(T),y.add(T.id))}for(const T in this.programConfigurations)y.has(T)||delete this.programConfigurations[T]}}const i_r={"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-occlusion-opacity":["occlusion_opacity"],"icon-occlusion-opacity":["occlusion_opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-emissive-strength":["emissive_strength"],"icon-emissive-strength":["emissive_strength"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"symbol-z-offset":["z_offset"],"line-gap-width":["gapwidth"],"line-pattern":["pattern","pixel_ratio","pattern_b"],"fill-pattern":["pattern","pixel_ratio","pattern_b"],"fill-extrusion-pattern":["pattern","pixel_ratio","pattern_b"],"line-dasharray":["dash"],"fill-bridge-guard-rail-color":["structure_color"],"fill-tunnel-structure-color":["structure_color"]};function o_r(b,p){return i_r[b]||[b.replace(`${p}-`,"").replace(/-/g,"_")]}const a_r={"line-pattern":{source:mi,composite:mi},"fill-pattern":{source:mi,composite:mi},"fill-extrusion-pattern":{source:mi,composite:mi},"line-dasharray":{source:si,composite:si}},s_r={color:{source:$l,composite:Lr},number:{source:Wn,composite:$l}};function I_t(b,p,y){const T=a_r[b];return T&&T[y]||s_r[p][y]}li(Yse,"ConstantBinder"),li(Pq,"PatternConstantBinder"),li(_A,"SourceExpressionBinder",{omit:["expression"]}),li(z2,"PatternCompositeBinder",{omit:["expression"]}),li(B2,"CompositeExpressionBinder",{omit:["expression"]}),li(h4,"ProgramConfiguration",{omit:["_buffers"]}),li(yT,"ProgramConfigurationSet");class YOe{constructor(p,y,T){this.layoutVertexArray=new wn,this.indexArray=new po,this.lineIndexArray=new Di,this.triangleSegments=new Ls,this.lineSegments=new Ls,this.programConfigurations=new yT(p,{zoom:y,lut:T}),this.uploaded=false}update(p,y,T,S,R,M,F,G){this.programConfigurations.updatePaintArrays(p,y,R,T,S,M,F,G)}isEmpty(){return 0===this.layoutVertexArray.length}needsUpload(){return this.programConfigurations.needsUpload}upload(p){this.uploaded||(this.layoutVertexBuffer=p.createVertexBuffer(this.layoutVertexArray,Nc.members),this.indexBuffer=p.createIndexBuffer(this.indexArray),this.lineIndexBuffer=p.createIndexBuffer(this.lineIndexArray)),this.programConfigurations.upload(p),this.uploaded=true}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.lineIndexBuffer.destroy(),this.programConfigurations.destroy(),this.triangleSegments.destroy(),this.lineSegments.destroy())}populatePaintArrays(p,y,T,S,R,M,F){this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,p,y,T,S,R,M,void 0,F)}}li(YOe,"FillBufferData");class qOe{constructor(p){this.zoom=p.zoom,this.pixelRatio=p.pixelRatio,this.overscaling=p.overscaling,this.layers=p.layers,this.layerIds=this.layers.map(y=>y.fqid),this.index=p.index,this.hasPattern=false,this.patternFeatures=[],this.lut=p.lut,this.bufferData=new YOe(p.layers,p.zoom,p.lut),this.stateDependentLayerIds=this.layers.filter(y=>y.isStateDependent()).map(y=>y.id),this.projection=p.projection,this.sourceLayerIndex=p.sourceLayerIndex,this.sourceLayerName=p.sourceLayerName||"",this.worldview=p.worldview,this.hasAppearances=null}updateFootprints(p,y){}updateAppearances(p,y,T,S){return{hasLayoutChanges:false,hasUboChanges:false}}populate(p,y,T,S){this.hasPattern=Sq("fill",this.layers,this.pixelRatio,y);const R=this.layers[0].layout.get("fill-sort-key"),M=[];for(const{feature:F,id:G,index:q,sourceLayerIndex:Q}of p){const ie=this.layers[0]._featureFilter.needGeometry,ae=It(F,ie);if(!this.layers[0]._featureFilter.filter(new Rl(this.zoom,{worldview:this.worldview,activeFloors:y.activeFloors}),ae,T))continue;const de=R?R.evaluate(ae,{},T,y.availableImages):void 0,pe={id:G,properties:F.properties,type:F.type,sourceLayerIndex:Q,index:q,geometry:ie?ae.geometry:vt(F,T,S),patterns:{},sortKey:de};M.push(pe)}R&&M.sort((F,G)=>F.sortKey-G.sortKey);for(const F of M){const{geometry:G,index:q,sourceLayerIndex:Q}=F;if(this.hasPattern){const ie=hI("fill",this.layers,F,this.zoom,this.pixelRatio,y);this.patternFeatures.push(ie)}else this.addFeature(F,G,q,T,{},y.availableImages,y.brightness,y.elevationFeatures);y.featureIndex.insert(p[q].feature,G,q,Q,this.index)}!this.hasPattern&&this.hdExt&&this.hdExt.buildFrcSegments(this)}update(p,y,T,S,R,M,F){this.bufferData.update(p,y,T,S,R,M,F,this.worldview),this.hdExt&&this.hdExt.update(p,y,T,S,R,M,F,this.worldview)}updateExpressions(p){this.bufferData.programConfigurations.updateExpressions(p),this.hdExt&&this.hdExt.updateExpressions(p)}addFeatures(p,y,T,S,R,M){for(const F of this.patternFeatures)this.addFeature(F,F.geometry,F.index,y,T,S,M,p.elevationFeatures);this.hdExt&&this.hdExt.buildFrcSegments(this)}isEmpty(){return this.bufferData.isEmpty()&&(!this.hdExt||this.hdExt.isEmpty())}uploadPending(){return!this.uploaded||this.bufferData.needsUpload()||null!=this.hdExt&&this.hdExt.needsUpload()}upload(p){this.bufferData.upload(p),this.hdExt&&this.hdExt.upload(p)}destroy(){this.bufferData.destroy(),this.hdExt&&this.hdExt.destroy()}addFeature(p,y,T,S,R,M=[],F,G){const q=this.hdExt?this.hdExt.trackFeatureFrc(p.properties):null,Q=this.bufferData.indexArray.length,ie=Pt(y,500);null!=this.hdExt&&this.hdExt.handleFeature(p,ie,T,S,G,this)||this.addGeometry(ie,this.bufferData),this.bufferData.populatePaintArrays(p,T,R,M,S,F,this.worldview),this.hdExt&&this.hdExt.populatePaintArrays(p,T,R,M,S,F,this.worldview),this.hdExt&&this.hdExt.recordFeatureRange(this,Q,this.bufferData.indexArray.length,q)}addGeometry(p,y,T,S){let R=Number.POSITIVE_INFINITY,M=Number.NEGATIVE_INFINITY,F=null;T&&(F=T.elevationSampler.constantElevation(T.elevation,T.bias),null!=F&&(R=F,M=F));const G=T?y:null,q=(Q,ie,ae)=>{if(null!=T)if(ie.push(Q),null!=F)G.elevatedLayoutVertexArray.emplaceBack(F),ae.push(F);else{const de=T.elevationSampler.pointElevation(Q,T.elevation,T.bias);G.elevatedLayoutVertexArray.emplaceBack(de),ae.push(de),R=Math.min(R,de),M=Math.max(M,de)}};for(const Q of p){let ie=0;for(const rt of Q)ie+=rt.length;const ae=y.triangleSegments.prepareSegment(ie,y.layoutVertexArray,y.indexArray),de=ae.vertexLength,pe=[],_e=[],Se=[],Fe=[],Ye=[],Xe=y.layoutVertexArray.length;for(const rt of Q){if(0===rt.length)continue;rt!==Q[0]&&_e.push(pe.length/2);const lt=y.lineSegments.prepareSegment(rt.length,y.layoutVertexArray,y.lineIndexArray),Bt=lt.vertexLength;T&&Ye.push(y.layoutVertexArray.length-Xe),q(rt[0],Se,Fe),y.layoutVertexArray.emplaceBack(rt[0].x,rt[0].y),y.lineIndexArray.emplaceBack(Bt+rt.length-1,Bt),pe.push(rt[0].x),pe.push(rt[0].y);for(let ht=1;ht0&&T&&S){const rt=T.elevation.isTunnel(),lt=T.elevation.safeArea,Bt=S.addVertices(Se,Fe);S.addTriangles(We,Bt,rt);const ht=Ye.length;if(ht>0){for(let Tt=0;Tt>3,0===M)continue}if(M--,1===R)F+=p.readSVarint(),G+=p.readSVarint(),S&&T.push(S),S=[new nt(F,G)];else if(2===R)F+=p.readSVarint(),G+=p.readSVarint(),S&&S.push(new nt(F,G));else{if(7!==R)throw new Error(`unknown command ${R}`);S&&S.push(S[0].clone())}}return S&&T.push(S),T}bbox(){if(this._geometry<0)throw new Error("feature has no geometry");const p=this._pbf;p.pos=this._geometry;const y=p.readVarint()+p.pos;let T=1,S=0,R=0,M=0,F=1/0,G=-1/0,q=1/0,Q=-1/0;for(;p.pos>3,0===S)continue}if(S--,1===T||2===T)R+=p.readSVarint(),M+=p.readSVarint(),RG&&(G=R),MQ&&(Q=M);else if(7!==T)throw new Error(`unknown command ${T}`)}return[F,q,G,Q]}toGeoJSON(p,y,T){const S=this.extent*Math.pow(2,T),R=this.extent*p,M=this.extent*y,F=this.loadGeometry();function G(ae){return[360*(ae.x+R)/S-180,360/Math.PI*Math.atan(Math.exp((1-2*(ae.y+M)/S)*Math.PI))-90]}function q(ae){return ae.map(G)}let Q;if(1===this.type){const ae=[];for(const pe of F)ae.push(pe[0]);const de=q(ae);Q=1===ae.length?{type:"Point",coordinates:de[0]}:{type:"MultiPoint",coordinates:de}}else if(2===this.type){const ae=F.map(q);Q=1===ae.length?{type:"LineString",coordinates:ae[0]}:{type:"MultiLineString",coordinates:ae}}else{if(3!==this.type)throw new Error("unknown feature type");{const ae=function(pe){const _e=pe.length;if(_e<=1)return[pe];const Se=[];let Fe,Ye;for(let Xe=0;Xe<_e;Xe++){const We=y_r(pe[Xe]);0!==We&&(void 0===Ye&&(Ye=We<0),Ye===We<0?(Fe&&Se.push(Fe),Fe=[pe[Xe]]):Fe&&Fe.push(pe[Xe]))}return Fe&&Se.push(Fe),Se}(F),de=[];for(const pe of ae)de.push(pe.map(q));Q=1===de.length?{type:"Polygon",coordinates:de[0]}:{type:"MultiPolygon",coordinates:de}}}const ie={type:"Feature",geometry:Q,properties:this.properties};return null!=this.id&&(ie.id=this.id),ie}}function y_r(b){let p=0;for(let y,T,S=0,R=b.length,M=R-1;S=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[p];const y=this._pbf.readVarint()+this._pbf.pos;return new yI(this._pbf,y,this.extent,this._keys,this._values)}}function x_r(b){let p=null;const y=b.readVarint()+b.pos;for(;b.pos1){if(ZOe(b,p))return true;for(let T=0;T1?y:y.sub(p)._mult(S)._add(p))}function L_t(b,p){let y,T,S,R=false;for(let M=0;Mp.y!=S.y>p.y&&p.x<(S.x-T.x)*(p.y-T.y)/(S.y-T.y)+T.x&&(R=!R)}return R}function bI(b,p){let y=false;for(let T=0,S=b.length-1;Tp.y!=M.y>p.y&&p.x<(M.x-R.x)*(p.y-R.y)/(M.y-R.y)+R.x&&(y=!y)}return y}function e5e(b,p,y,T,S){for(const M of b)if(p<=M.x&&y<=M.y&&T>=M.x&&S>=M.y)return true;const R=[new nt(p,y),new nt(p,S),new nt(T,S),new nt(T,y)];if(b.length>2){for(const M of R)if(bI(b,M))return true}for(let M=0;MS.x&&p.x>S.x||b.yS.y&&p.y>S.y)return false;const R=jn(b,p,y[0]);return R!==jn(b,p,y[1])||R!==jn(b,p,y[2])||R!==jn(b,p,y[3])}function $7(b,p,y,T,S,R){let M=p.y-b.y,F=b.x-p.x;if(R=R||0){const G=M*M+F*F;if(0===G)return true;const q=Math.sqrt(G);M/=q,F/=q}return!((y.x-b.x)*M+(y.y-b.y)*F-R<0||(T.x-b.x)*M+(T.y-b.y)*F-R<0||(S.x-b.x)*M+(S.y-b.y)*F-R<0)}function t5e(b,p,y,T,S,R,M){return!($7(b,p,T,S,R,M)||$7(p,y,T,S,R,M)||$7(y,b,T,S,R,M)||$7(T,S,b,p,y,M)||$7(S,R,b,p,y,M)||$7(R,T,b,p,y,M))}class p4 extends nt{constructor(p,y,T){super(p,y),this.z=T}}class D_t extends p4{constructor(p,y,T,S){super(p,y,T),this.w=S}}function F_t(b,p,y,T){const S="x"===y?"y":"x",R=(T-b[y])/(p[y]-b[y]);b[S]=Math.round(b[S]+(p[S]-b[S])*R),b[y]=T,Object.hasOwn(b,"z")&&(b.z=Si(b.z,p.z,R)),Object.hasOwn(b,"w")&&(b.w=Si(b.w,p.w,R))}function N_t(b,p,y,T){const S=y,R=T;for(const M of["x","y"]){let F=b,G=p;F[M]>=G[M]&&(F=p,G=b),F[M]S&&F_t(F,G,M,S),F[M]R&&F_t(G,F,M,R)}}function n5e(b,p,y,T,S,R){const M=[];for(let F=0;F=T&&pe.x>=T||(de.x>=T?de=new nt(T,de.y+(T-de.x)/(pe.x-de.x)*(pe.y-de.y))._round():pe.x>=T&&(pe=new nt(T,de.y+(T-de.x)/(pe.x-de.x)*(pe.y-de.y))._round()),de.y>=S&&pe.y>=S||(de.y>=S?de=new nt(de.x+(S-de.y)/(pe.y-de.y)*(pe.x-de.x),S)._round():pe.y>=S&&(pe=new nt(de.x+(S-de.y)/(pe.y-de.y)*(pe.x-de.x),S)._round()),q&&de.equals(q.at(-1))||(q=[de],M.push(q),R&&R.push({progress:{min:Se+O_t(Fe,Ye,de)*_e,max:1},parentIndex:F,prevPoint:Fe,nextPoint:Ye})),q.push(pe),R&&(R.at(-1).progress.max=Se+O_t(Fe,Ye,pe)*_e,R.at(-1).nextPoint=Ye)))))}if(R&&ie>0)for(let ae=Q;aeq.t-Q.t);let M=0,F=0,G=[];for(T.push(G);M!==b.length;){if(F===R.length){for(;M!==b.length;)0!==G.length&&G.at(-1).equals(b[M])||G.push(b[M]),M++;break}R[F].t<=M?(0!==G.length&&G.at(-1).equals(R[F].point)||G.push(R[F].point),Math.trunc(R[F].t),F++):(0!==G.length&&G.at(-1).equals(b[M])||G.push(b[M]),M++)}}function O_t(b,p,y){return b.x!==p.x?(y.x-b.x)/(p.x-b.x):b.y!==p.y?(y.y-b.y)/(p.y-b.y):0}function B_t(b,{width:p,height:y},T,S){if(S){if(S instanceof Uint8ClampedArray)S=new Uint8Array(S.buffer);else if(S.length!==p*y*T)throw new RangeError("mismatched image size")}else S=new Uint8Array(p*y*T);return b.width=p,b.height=y,b.data=S,b}function z_t(b,p,y){const{width:T,height:S}=p;T===b.width&&S===b.height||(r5e(b,p,{x:0,y:0},{x:0,y:0},{width:Math.min(b.width,T),height:Math.min(b.height,S)},y,null),b.width=T,b.height=S,b.data=p.data)}function r5e(b,p,y,T,S,R,M,F){if(0===S.width||0===S.height)return p;if(S.width>b.width||S.height>b.height||y.x>b.width-S.width||y.y>b.height-S.height)throw new RangeError("out of range source coordinates for image copy");if(S.width>p.width||S.height>p.height||T.x>p.width-S.width||T.y>p.height-S.height)throw new RangeError("out of range destination coordinates for image copy");const G=b.data,q=p.data,Q=4===R&&F;for(let ie=0;ie1&&(G=p[++F]);const Q=Math.abs(q-G.left),ie=Math.abs(q-G.right),ae=Math.min(Q,ie);let de;const pe=R/T*(S+1);if(G.isDash){const _e=S-Math.abs(pe);de=Math.sqrt(ae*ae+_e*_e)}else de=S-Math.sqrt(ae*ae+pe*pe);this.image.data[M+q]=Math.max(0,Math.min(255,de+128))}}}addRegularDash(p,y){for(let G=p.length-1;G>=0;--G){const q=p[G],Q=p[G+1];q.zeroLength?p.splice(G,1):Q&&Q.isDash===q.isDash&&(Q.left=q.left,p.splice(G,1))}const T=p[0],S=p.at(-1);T.isDash===S.isDash&&(T.left=S.left-this.width,S.right=T.right+this.width);const R=this.width*this.nextRow;let M=0,F=p[M];for(let G=0;G1&&(F=p[++M]);const q=Math.abs(G-F.left),Q=Math.abs(G-F.right),ie=Math.min(q,Q);this.image.data[R+G]=Math.max(0,Math.min(255,(F.isDash?ie:-ie)+y+128))}}addDash(p,y){const T=this.getKey(p,y);if(this.positions[T])return this.positions[T];const S="round"===y,R=S?7:0,M=2*R+1;if(this.nextRow+M>this.height)return yn("LineAtlas out of space"),null;0===p.length&&p.push(1);let F=0;for(let ie=0;iey.fqid),this.index=p.index,this.projection=p.projection,this.hasPattern=false,this.hasCrossSlope=false,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.borderGradients={},this.layers.forEach(y=>{this.gradients[y.id]={},this.borderGradients[y.id]={}}),this.layoutVertexArray=new kr,this.layoutVertexArray2=new Vr,this.patternVertexArray=new Vr,this.indexArray=new po,this.programConfigurations=new yT(p.layers,{zoom:p.zoom,lut:p.lut}),this.segments=new Ls,this.sourceLayerName=p.sourceLayerName||"",this.maxLineLength=0,this.zOffsetVertexArray=new Lr,this.elevationIdColVertexArray=new Vr,this.elevationGroundScaleVertexArray=new Wn,this.stateDependentLayerIds=this.layers.filter(y=>y.isStateDependent()).map(y=>y.id),this.tessellationStep=p.tessellationStep?p.tessellationStep:128,this.worldview=p.worldview,this.hasAppearances=null}updateFootprints(p,y){}updateAppearances(p,y,T,S){return{hasLayoutChanges:false,hasUboChanges:false}}populate(p,y,T,S){this.showElevationIdDebug=y.showElevationIdDebug,this.terrainEnabled=y.terrainEnabled,this.hasPattern=Sq("line",this.layers,this.pixelRatio,y);const R=this.layers[0].layout.get("line-sort-key");this.tileToMeter=le(T);const M=this.layers[0].layout.get("line-elevation-reference");if("hd-road-markup"===M)this.elevationType="road";else{const ae=this.layers[0].layout.get("line-z-offset"),de=ae.isConstant()&&!ae.constantOr(0);this.elevationType="sea"!==M&&"ground"!==M&&de?"none":"offset","offset"===this.elevationType&&"none"===M&&yn(`line-elevation-reference: ground is used for the layer ${this.layerIds[0]} because non-zero line-z-offset value was found.`),this.isSeaLevelReference="sea"===M}const F=this.layers[0].layout.get("line-cross-slope");this.hasCrossSlope="offset"===this.elevationType&&void 0!==F;const G=[];for(const{feature:ae,id:de,index:pe,sourceLayerIndex:_e}of p){const Se=this.layers[0]._featureFilter.needGeometry,Fe=It(ae,Se);if(!this.layers[0]._featureFilter.filter(new Rl(this.zoom,{worldview:this.worldview,activeFloors:y.activeFloors}),Fe,T))continue;const Ye=R?R.evaluate(Fe,{},T):void 0,Xe={id:de,properties:ae.properties,type:ae.type,sourceLayerIndex:_e,index:pe,geometry:Se?Fe.geometry:vt(ae,T,S),patterns:{},sortKey:Ye};G.push(Xe)}R&&G.sort((ae,de)=>ae.sortKey-de.sortKey);const{lineAtlas:q,featureIndex:Q}=y,ie=this.addConstantDashes(q);for(const ae of G){const{geometry:de,index:pe,sourceLayerIndex:_e}=ae;if(ie&&this.addFeatureDashes(ae,q),this.hasPattern){const Se=hI("line",this.layers,ae,this.zoom,this.pixelRatio,y);this.patternFeatures.push(Se)}else this.addFeature(ae,de,pe,T,q.positions,y.availableImages,y.brightness,y.elevationFeatures,y.elevationParams,y.crossSourceElevationEnabled);Q.insert(p[pe].feature,de,pe,_e,this.index)}!this.hasPattern&&this.hdExt&&this.hdExt.buildFrcSegments(this),this.hdExt&&this.hdExt.endPopulate()}addConstantDashes(p){let y=false;for(const T of this.layers){const S=T.paint.get("line-dasharray").value,R=T.layout.get("line-cap").value;if("constant"!==S.kind||"constant"!==R.kind)y=true;else{const M=R.value,F=S.value;if(!F)continue;p.addDash(F,M)}}return y}addFeatureDashes(p,y){const T=this.zoom;for(const S of this.layers){const R=S.paint.get("line-dasharray").value,M=S.layout.get("line-cap").value;if("constant"===R.kind&&"constant"===M.kind)continue;let F,G;if("constant"===R.kind){if(F=R.value,!F)continue}else F=R.evaluate({zoom:T},p);G="constant"===M.kind?M.value:M.evaluate({zoom:T},p),y.addDash(F,G),p.patterns[S.id]=[y.getKey(F,G)]}}update(p,y,T,S,R,M,F,G,q){this.programConfigurations.updatePaintArrays(p,y,R,T,S,M,F,q)}updateExpressions(p){this.programConfigurations.updateExpressions(p)}addFeatures(p,y,T,S,R,M){for(const F of this.patternFeatures)this.addFeature(F,F.geometry,F.index,y,T,S,M,p.elevationFeatures,p.elevationParams,p.crossSourceElevationEnabled);this.hdExt&&(this.hdExt.buildFrcSegments(this),this.hdExt.endPopulate())}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(p){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=p.createVertexBuffer(this.layoutVertexArray2,p_r)),0!==this.patternVertexArray.length&&(this.patternVertexBuffer=p.createVertexBuffer(this.patternVertexArray,g_r)),!this.zOffsetVertexBuffer&&this.zOffsetVertexArray.length>0&&(this.zOffsetVertexBuffer=p.createVertexBuffer(this.zOffsetVertexArray,c_r.members,true)),!this.elevationIdColVertexBuffer&&this.elevationIdColVertexArray.length>0&&(this.elevationIdColVertexBuffer=p.createVertexBuffer(this.elevationIdColVertexArray,u_r.members,true)),!this.elevationGroundScaleVertexBuffer&&this.elevationGroundScaleVertexArray.length>0&&(this.elevationGroundScaleVertexBuffer=p.createVertexBuffer(this.elevationGroundScaleVertexArray,d_r.members,true)),this.layoutVertexBuffer=p.createVertexBuffer(this.layoutVertexArray,f_r),this.indexBuffer=p.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(p),this.uploaded=true}destroy(){this.layoutVertexBuffer&&(this.zOffsetVertexBuffer&&this.zOffsetVertexBuffer.destroy(),this.elevationIdColVertexBuffer&&this.elevationIdColVertexBuffer.destroy(),this.elevationGroundScaleVertexBuffer&&this.elevationGroundScaleVertexBuffer.destroy(),this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(p,y){let T,S;if(y&&y>0?(T=`mapbox_clip_start_${y}`,S=`mapbox_clip_end_${y}`):(T="mapbox_clip_start",S="mapbox_clip_end"),p.properties&&Object.hasOwn(p.properties,T)&&Object.hasOwn(p.properties,S))return{start:+p.properties[T],end:+p.properties[S]}}addFeature(p,y,T,S,R,M,F,G,q,Q){const ie=this.layers[0].layout,ae=this.hdExt?this.hdExt.trackFeatureFrc(p.properties):null,de=this.indexArray.length,pe=ie.get("line-join").evaluate(p,{}),_e=ie.get("line-cap").evaluate(p,{}),Se=ie.get("line-miter-limit"),Fe=ie.get("line-round-limit");this.lineClips=this.lineFeatureClips(p),this.lineFeature=p;const Ye=!(!p.properties||!Object.hasOwn(p.properties,"mapbox_line_metrics"))&&p.properties.mapbox_line_metrics;this.zOffsetValue=ie.get("line-z-offset").value;const Xe=this.layers[0].paint,We=Xe.get("line-width").value;"constant"!==We.kind&&false===We.isLineProgressConstant&&(this.variableWidthValue=We);const rt=Xe.get("line-emissive-strength").value;if("constant"!==rt.kind&&false===rt.isLineProgressConstant&&(this.variableEmissiveStrengthValue=rt),this.isSeaLevelReference){const lt=ie.get("line-elevation-ground-scale").value;"constant"===lt.kind&&0===lt.value||(this.elevationGroundScaleValue=lt)}if(null==this.hdExt||!this.hdExt.handleFeature(p,y,S,G,q,!!Q,pe,_e,Se,Fe,this))for(let lt=0;lt0?lt:null);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,p,T,R,M,S,F,void 0,this.worldview),this.hdExt&&this.hdExt.recordFeatureRange(this,de,this.indexArray.length,ae)}fillNonElevatedRoadSegment(p){for(let y=Math.max(p,this.zOffsetVertexArray.length);y0,ae=G&&G.progress.max<1;if(this.lineClips){let Tt={min:this.lineClips.start,max:this.lineClips.end},Lt=1;if(G){const _n=this.lineClips.end-this.lineClips.start;Tt=function(Dn,Ln,zn){return{min:Fo(Dn.min,Ln,zn),max:Fo(Dn.max,Ln,zn)}}(G.progress,{min:0,max:1},Tt),_n>0&&(Lt=(Tt.max-Tt.min)/_n)}const Nt=+y.properties.mapbox_clip_feature_len,un=+y.properties.mapbox_clip_seg_len;if(Number.isNaN(Nt)||Number.isNaN(un)){for(let Dn=0;Dn=2&&p[pe-1].equals(p[pe-2]);)pe--;let _e=0;for(;_e0,En=this.overscaling<=16?122880/(512*this.overscaling):0;if(Lt&&"round"===Nt){if(LnM&&(Nt="bevel"),"bevel"===Nt&&(Ln>2&&(Nt="flipbevel"),Ln2*En){const qn=Fe.sub(Fe.sub(Ye)._mult(En/In)._round());this.updateDistance(Ye,qn),this.addCurrentVertex(qn,We,0,0,Se,ht),Ye=qn}this.updateDistance(Ye,Fe),_n._mult(Ln),this.addCurrentVertex(Fe,_n,0,0,Se,ht);const Gn=Fe.dist(Xe);if(Gn>2*En){const qn=Fe.add(Xe.sub(Fe)._mult(En/Gn)._round());this.updateDistance(Fe,qn),this.addCurrentVertex(qn,rt,0,0,Se,ht),Fe=qn}}else _n._mult(Ln),this.addCurrentVertex(Fe,_n,0,0,Se,ht);else if("flipbevel"===Nt){if(Ln>100)_n=rt.mult(-1);else{const In=Ln*We.add(rt).mag()/We.sub(rt).mag();_n._perp()._mult(In*(nn?-1:1))}this.addCurrentVertex(Fe,_n,0,0,Se,ht),this.addCurrentVertex(Fe,_n.mult(-1),0,0,Se,ht)}else if("bevel"===Nt||"fakeround"===Nt){const In=Fe.dist(Ye);let Gn=1;if("offset"===this.elevationType&&"bevel"===Nt&&"round"!==this.currentLineJoinType&&!this.patternJoinNone&&null!=ht&&Ye&&Xe){const ni=4*En;In1){this.lineSoFar=p.w;const _e=(y.x-p.x)/ie,Se=(y.y-p.y)/ie,Fe=(y.z-p.z)/ie,Ye=(y.w-p.w)/ie,Xe=y.x-p.x,We=y.y-p.y,rt=Math.sqrt(Xe*Xe+We*We);if(0===rt)return;const lt=-We/rt,Bt=Xe/rt,ht=lt,Tt=Bt,Lt=-lt,Nt=-Bt;for(let un=1;un=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,Q),G.primitiveLength++),M?this.e2=Q:this.e1=Q,null!=q&&(this.zOffsetVertexArray.emplaceBack(q.zOffset,q.variableWidth,q.variableWidth,q.variableEmissiveStrength),this.showElevationIdDebug&&this.elevationIdColVertexArray.emplaceBack(0,0,0)),this.elevationGroundScaleValue){const ie=q?q.elevationGroundScale:this.evaluateElevationGroundScale();this.elevationGroundScaleVertexArray.emplaceBack(ie)}}updateScaledDistance(){this.lineClips?(this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=this.totalFeatureLength*this.lineClips.start+this.distance):this.lineSoFar=this.distance}updateDistance(p,y){this.prevDistance=this.distance,this.distance+=p.dist(y),this.updateScaledDistance()}}function o5e(b,p,y){return b.xy||b.yy}li(i5e,"LineBucket",{omit:["layers","patternFeatures","currentVertex","currentVertexIsOutside"]});const k_r=hn([{name:"a_pos",components:2,type:"Int16"}],4),R_r=hn([{name:"a_circle_z_offset",components:1,type:"Float32"}],4),P_r=hn([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]);class qse{constructor(p){this.zoom=p.zoom,this.overscaling=p.overscaling,this.layers=p.layers,this.layerIds=this.layers.map(y=>y.fqid),this.index=p.index,this.hasPattern=false,this.projection=p.projection,this.layoutVertexArray=new wn,this.indexArray=new po,this.segments=new Ls,this.programConfigurations=new yT(p.layers,{zoom:p.zoom,lut:p.lut}),this.stateDependentLayerIds=this.layers.filter(y=>y.isStateDependent()).map(y=>y.id),this.worldview=p.worldview,this.hasAppearances=null}updateFootprints(p,y){}updateAppearances(p,y,T,S){return{hasLayoutChanges:false,hasUboChanges:false}}populate(p,y,T,S){const R=this.layers[0],M=[];let F=null;"circle"===R.type&&(F=R.layout.get("circle-sort-key"));for(const{feature:q,id:Q,index:ie,sourceLayerIndex:ae}of p){const de=this.layers[0]._featureFilter.needGeometry,pe=It(q,de);if(!this.layers[0]._featureFilter.filter(new Rl(this.zoom,{worldview:this.worldview,activeFloors:y.activeFloors}),pe,T))continue;const _e=F?F.evaluate(pe,{},T):void 0,Se={id:Q,properties:q.properties,type:q.type,sourceLayerIndex:ae,index:ie,geometry:de?pe.geometry:vt(q,T,S),patterns:{},sortKey:_e};M.push(Se)}F&&M.sort((q,Q)=>q.sortKey-Q.sortKey);let G=null;"globe"===S.projection.name&&(this.globeExtVertexArray=new Kr,G=S.projection);for(const q of M){const{geometry:Q,index:ie,sourceLayerIndex:ae}=q,de=p[ie].feature;this.addFeature(q,Q,ie,y.availableImages,T,G,y.brightness,y.elevationFeatures),y.featureIndex.insert(de,Q,ie,ae,this.index)}this.hdExt&&this.hdExt.finalize()}update(p,y,T,S,R,M,F){this.programConfigurations.updatePaintArrays(p,y,R,T,S,M,F,this.worldview)}updateExpressions(p){this.programConfigurations.updateExpressions(p)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(p){this.uploaded||(this.layoutVertexBuffer=p.createVertexBuffer(this.layoutVertexArray,k_r.members),this.indexBuffer=p.createIndexBuffer(this.indexArray),this.globeExtVertexArray&&(this.globeExtVertexBuffer=p.createVertexBuffer(this.globeExtVertexArray,P_r.members)),this.hdExt&&this.hdExt.upload(p)),this.programConfigurations.upload(p),this.uploaded=true}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy(),this.hdExt&&this.hdExt.destroy())}addFeature(p,y,T,S,R,M,F,G){this.hdExt&&this.hdExt.beginFeature(p,G,R);for(const q of y)for(const Q of q){const ie=Q.x,ae=Q.y;if(ie<0||ie>=qr||ae<0||ae>=qr)continue;if(M){const _e=M.projectTilePoint(ie,ae,R),Se=M.upVector(R,ie,ae);this.addGlobeExtVertex(_e,Se),this.addGlobeExtVertex(_e,Se),this.addGlobeExtVertex(_e,Se),this.addGlobeExtVertex(_e,Se)}const de=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,p.sortKey),pe=de.vertexLength;this.addCircleVertex(ie,ae,-1,-1),this.addCircleVertex(ie,ae,1,-1),this.addCircleVertex(ie,ae,1,1),this.addCircleVertex(ie,ae,-1,1),this.hdExt&&this.hdExt.writeVertexQuad(ie,ae),this.indexArray.emplaceBack(pe,pe+1,pe+2),this.indexArray.emplaceBack(pe,pe+2,pe+3),de.vertexLength+=4,de.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,p,T,{},S,R,F,void 0,this.worldview)}addCircleVertex(p,y,T,S){this.layoutVertexArray.emplaceBack(2*p+(T+1)/2,2*y+(S+1)/2)}addGlobeExtVertex(p,y){const T=16384;this.globeExtVertexArray.emplaceBack(p.x,p.y,p.z,y[0]*T,y[1]*T,y[2]*T)}}li(qse,"CircleBucket",{omit:["layers"]});const I_r=hn([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),M_r=hn([{name:"a_globe_anchor",components:3,type:"Int16"},{name:"a_globe_normal",components:3,type:"Float32"}],4),L_r=hn([{name:"a_projected_pos",components:4,type:"Float32"}],4);hn([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const D_r=hn([{name:"a_auto_z_offset",components:1,type:"Float32"}],4),F_r=hn([{name:"a_feature_index",components:1,type:"Float32"}],4),N_r=hn([{name:"a_x_axis",components:3,type:"Float32"},{name:"a_y_axis",components:3,type:"Float32"}]),O_r=hn([{name:"a_texb",components:2,type:"Uint16"}]),B_r=hn([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_elevation_from_sea",components:2,type:"Float32"}]),z_r=hn([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"},{name:"a_auto_z_offset",components:1,type:"Float32"}]);hn([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"tileAnchorX"},{type:"Int16",name:"tileAnchorY"},{type:"Float32",name:"x1"},{type:"Float32",name:"y1"},{type:"Float32",name:"x2"},{type:"Float32",name:"y2"},{type:"Int16",name:"padding"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const G_t=hn([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),U_r=hn([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);hn([{name:"triangle",components:3,type:"Uint16"}]),hn([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"},{type:"Uint8",name:"flipState"}]),hn([{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Float32",name:"zOffset"},{type:"Uint8",name:"hasIconTextFit"},{type:"Uint16",name:"elevationFeatureIndex"}]),hn([{type:"Float32",name:"offsetX"}]),hn([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);const H_t=new Float32Array(1),V_r=new Uint32Array(H_t.buffer);function Xse(b){return H_t[0]=b,V_r[0]}const G7=class vY{static getBlockIndices(p){let y=vY._blockIndicesTemplate;if(!y){y=vY._blockIndicesTemplate=new Uint32Array(p);for(let T=0;Tp.maxUniformBlockSize)throw new Error(`UBO size ${this.totalBytes} exceeds device limit ${p.maxUniformBlockSize}`);if(this.headerBuffer=y.createBuffer(),!this.headerBuffer)throw new Error("Failed to create header UBO buffer");if(y.bindBuffer(y.UNIFORM_BUFFER,this.headerBuffer),y.bufferData(y.UNIFORM_BUFFER,vY.HEADER_BYTES,y.DYNAMIC_DRAW),this.propertiesBuffer=y.createBuffer(),!this.propertiesBuffer)throw new Error("Failed to create properties UBO buffer");if(y.bindBuffer(y.UNIFORM_BUFFER,this.propertiesBuffer),y.bufferData(y.UNIFORM_BUFFER,this.totalBytes,y.DYNAMIC_DRAW),this.blockIndicesBuffer=y.createBuffer(),!this.blockIndicesBuffer)throw new Error("Failed to create block-indices UBO buffer");y.bindBuffer(y.UNIFORM_BUFFER,this.blockIndicesBuffer),y.bufferData(y.UNIFORM_BUFFER,this.totalBytes,y.DYNAMIC_DRAW),y.bindBuffer(y.UNIFORM_BUFFER,null)}markHeaderDirty(){this._headerDirty=true}writeDataDrivenBlock(p,y){const T=this.headerData,S=4*T[2];if(0===S)return;const R=y*S;if(R+S>this.propertiesData.length)throw new Error(`UBO write out of bounds: feature index ${y} exceeds propertiesData capacity`);const M=T[0];for(let G=0;G<9;G++)M&1<this._propsDirtyMax&&(this._propsDirtyMax=F)}rightSizeForTransfer(){const p=-1===this._propsDirtyMax?0:this._propsDirtyMax;p>>y&1?8:4);const R=vY.EVAL_FLAT_OFFSETS[y];this.propertiesData.set(T.subarray(R,R+S),p)}upload(p){this.context||(this.context=p);const y=p.gl;this.headerBuffer&&this.propertiesBuffer&&this.blockIndicesBuffer||this._initBuffers(p);let T=false;if(this._headerDirty&&(y.bindBuffer(y.UNIFORM_BUFFER,this.headerBuffer),y.bufferSubData(y.UNIFORM_BUFFER,0,this.headerData),this._headerDirty=false,T=true),-1!==this._propsDirtyMin){const S=this._propsDirtyMin,R=this._propsDirtyMax;y.bindBuffer(y.UNIFORM_BUFFER,this.propertiesBuffer),y.bufferSubData(y.UNIFORM_BUFFER,4*S,this.propertiesData,S,R-S),this._propsDirtyMin=-1,this._propsDirtyMax=-1,T=true}this._blockIndicesDirty&&(y.bindBuffer(y.UNIFORM_BUFFER,this.blockIndicesBuffer),y.bufferSubData(y.UNIFORM_BUFFER,0,vY.getBlockIndices(this.propsDwords)),this._blockIndicesDirty=false,T=true),T&&y.bindBuffer(y.UNIFORM_BUFFER,null)}bind(p,y){const T=p.gl,S=(M,F,G)=>{if(!F)return;const q=T.getUniformBlockIndex(y,M);q!==T.INVALID_INDEX&&(T.uniformBlockBinding(y,q,G),T.bindBufferBase(T.UNIFORM_BUFFER,G,F))},R=3*this.batchIndex;S("SymbolPaintPropertiesHeaderUniform",this.headerBuffer,R),S("SymbolPaintPropertiesUniform",this.propertiesBuffer,R+1),S("SymbolPaintPropertiesIndexUniform",this.blockIndicesBuffer,R+2)}destroy(){if(this.context){const p=this.context.gl;this.headerBuffer&&(p.deleteBuffer(this.headerBuffer),this.headerBuffer=null),this.propertiesBuffer&&(p.deleteBuffer(this.propertiesBuffer),this.propertiesBuffer=null),this.blockIndicesBuffer&&(p.deleteBuffer(this.blockIndicesBuffer),this.blockIndicesBuffer=null)}}};G7.HEADER_DWORDS=16,G7.HEADER_BYTES=64,G7.EVAL_FLAT_OFFSETS=[0,8,16,20,24,28,32,36,40],G7.EVAL_FLAT_TOTAL=48,G7._blockIndicesTemplate=null;let Iq=G7;function W_t(b,p,y,T,S,R,M,F){return!!b&&("constant"===b.kind?"none"===b.value:"none"===b.evaluate({zoom:0,brightness:R,worldview:F},p,y,S,T,M))}function Y_t(b){if(!(b instanceof mT))return false;const p=b.value;return("source"===p.kind||"composite"===p.kind)&&p.isStateDependent}li(Iq,"SymbolPropertiesUBO",{omit:["headerBuffer","propertiesBuffer","blockIndicesBuffer"]});const Mq=["icon","text"].map(b=>[`${b}-color`,`${b}-halo-color`,`${b}-opacity`,`${b}-halo-width`,`${b}-halo-blur`,`${b}-emissive-strength`,`${b}-occlusion-opacity`,"symbol-z-offset",`${b}-translate`]),lu=new Float32Array(Iq.EVAL_FLAT_TOTAL),$_r=[0,0],q_t=new WeakMap;class a5e{constructor(p,y,T,S,R="",M,F){this.layer=p,this.zoom=y,this.lut=T,this.isText=S,this.worldview=R,this.maxUniformBufferBindings=M||24,this.uboSizeDwords=F||4096,this.allFeatureVtIndices=[],this.allFeatureIds=[],this.allFormattedSections=[],this.featureVertexRangesFromId=null,this.featureVertexRangesFromVtIndex=null,this.ubos=[],this.featureCount=0,this.cachedConstantUniforms=null,this.cachedConstantRenderZoom=null,this.cachedConstantBrightness=void 0,this.cachedConstantPaint=null,this.activeAppearanceByVtIndex=null,this.zoomDependency=new Uint8Array(9),this.sharedZoomRanges=new Float32Array(18),this._zoomRangeScratch=new Float32Array(2),this._floorZoom=Math.floor(this.zoom),this.header=new Uint32Array(Iq.HEADER_DWORDS),this.updateHeader(),this.isAllConstant=0===this.header[0];const G=4*this.header[2];this.maxFeaturesPerBatch=0===G?Number.MAX_SAFE_INTEGER:Math.floor(this.uboSizeDwords/G)}updateHeader(){const p=this.layer.paint;let y=0,T=0,S=0,R=0,M=true;const F=this._floorZoom,G=Mq[+this.isText];for(let q=0;q<9;q++){const Q=G[q],ie=q<2,ae=p.get(Q),de=!(!ae||"function"!=typeof ae.isConstant||ae.isConstant()),pe=this._appearancesHavePaintProperties(Q);if(!de&&!pe){const rt=this._layerUnevaluated(Q);rt&&rt.expression&&"camera"===rt.expression.kind&&(S|=1<{if(!q)return;this._computeZoomRange(q,y,this._zoomRangeScratch,0);const Q=this._zoomRangeScratch[0],ie=this._zoomRangeScratch[1];T?Q===M&&ie===F||(S=true):(T=true,M=Q,F=ie,R=q)};G(this._zoomExprOf(this._layerUnevaluated(p)));for(const q of this.layer.getAppearances()||[])q.hasPaintProperty(p)&&G(this._zoomExprOf(q.getUnevaluatedPaintProperty(p)));return{hasZoom:T,differs:S,representative:R}}evaluateAllProperties(p,y,T,S,R,M,F){const G={brightness:R,worldview:this.worldview},q={feature:p,featureState:y,canonical:T,availableImages:S,params:new Rl(this.zoom,G),paramsNext:new Rl(this.zoom+1,G),formattedSection:M,activeAppearance:F},Q=Mq[+this.isText];for(let ie=0;ie<9;ie++){const ae=Q[ie],de=ie<2,pe=8===ie,_e=this.zoomDependency[ie],Se=0!==_e,Fe=2===_e,Ye=Iq.EVAL_FLAT_OFFSETS[ie],Xe=Ye+(de||pe?4:2);de?this._evaluateColorValue(ae,ie,Se,Fe,Xe,q,Ye):pe?this._evaluateTranslateValue(ae,ie,Se,Fe,Xe,q,Ye):this._evaluateFloatValue(ae,ie,Se,Fe,Xe,q,Ye)}return lu}_resolveProp(p,y,T=false,S){const R=this.layer.paint,M=R.get(p),F=p,G=!(!y||!y.hasPaintProperty(F)),q=G?S&&M&&M.property.overrides&&M.property.overrides.hasOverride(S)?M:y.paintProperties.get(F):R.get(p);if(T||!q||"function"!=typeof q.isConstant||!q.isConstant())return q;const Q=G?y.getUnevaluatedPaintProperty(F):this._layerUnevaluated(p);return this._unbakeCamera(q,Q)}_unbakeCamera(p,y){const T=y&&y.expression;if(!T||"camera"!==T.kind)return p;let S=q_t.get(y);return S||(S=new mT(p.property,T,p.parameters,p.iconImageUseTheme),q_t.set(y,S)),S}_layerUnevaluated(p){const y=this.layer._transitionablePaint._values[p];return y&&y.value}_zoomExprOf(p){const y=p&&p.expression;return!y||"composite"!==y.kind&&"camera"!==y.kind?null:y}_evalAt(p,y,T){return p.property.evaluate(p.value,y,T.feature,T.featureState,T.canonical,T.availableImages,p.iconImageUseTheme,T.formattedSection)}_evaluateColorValue(p,y,T,S,R,M,F){const G=this._resolveProp(p,M.activeAppearance,false,M.formattedSection);if(this._writePropertyZoomRange(y,T,S,G,R),!G)return lu[F]=0,lu[F+1]=0,lu[F+2]=0,void(lu[F+3]=1);const q=this._resolveProp(`${p}-use-theme`,M.activeAppearance,true),Q=W_t(q&&"string"!=typeof q?q.value:void 0,M.feature,M.featureState,M.availableImages,M.canonical,M.params.brightness,M.formattedSection,this.worldview)?null:this.lut,ie=(G.isConstant()?G.constantOr(Wo.transparent):this._evalAt(G,M.params,M)||Wo.transparent).toNonPremultipliedRenderColor(Q);if(lu[F]=am(255*ie.r,255*ie.g),lu[F+1]=am(255*ie.b,255*ie.a),T){const ae=(this._evalAt(G,M.paramsNext,M)||Wo.transparent).toNonPremultipliedRenderColor(Q);lu[F+2]=am(255*ae.r,255*ae.g),lu[F+3]=am(255*ae.b,255*ae.a)}else lu[F+2]=lu[F],lu[F+3]=lu[F+1]}_computeZoomRange(p,y,T,S){let R=0,M=1;const F=!p||"composite"!==p.kind&&"camera"!==p.kind?null:p.zoomStops;if(F&&F.length>0)if(null==p.interpolationType){R=M=1;for(const G of F)if(G>y&&Gy&&F[0]y.hasPaintProperty(p))}hasStateDependentPaint(p){const y=p.paint,T=Mq[+this.isText];for(const S of T)if(Y_t(y.get(S)))return true;for(const S of p.getAppearances()||[])for(const R of T){const M=R;if(S.hasPaintProperty(M)&&Y_t(S.paintProperties.get(M)))return true}return false}hasPerFeatureTranslate(){return!!(256&this.header[0])}getCurrentBatchIndex(){return 0===this.maxFeaturesPerBatch?0:Math.floor(this.featureCount/this.maxFeaturesPerBatch)}_writeFeatureBlock(p,y){const T=this.isAllConstant?0:p;let S=Math.floor(T/this.maxFeaturesPerBatch),R=T%this.maxFeaturesPerBatch;this._batchExceedsDeviceLimit(S)&&(S=0,R=0);const M=this.ubos[S];return!!M&&(M.writeDataDrivenBlock(y,R),true)}_batchExceedsDeviceLimit(p){return 3*p+2>=this.maxUniformBufferBindings}_reevaluateAt(p,y,T,S,R,M){if(!y)return;const F=this.allFeatureVtIndices[p],G=y.feature(F);if(!G)return;const q=this.allFeatureIds[p],Q=null!=q&&R[q]||{},ie={type:G.type,id:q,properties:G.properties||{},geometry:[]},ae=this.activeAppearanceByVtIndex?this.activeAppearanceByVtIndex.get(F):void 0,de=this.evaluateAllProperties(ie,Q,T,S,M,(this.allFormattedSections?this.allFormattedSections[p]:void 0)||void 0,ae);this._writeFeatureBlock(p,de)}_ensureRangeMaps(){if(!this.featureVertexRangesFromId){this.featureVertexRangesFromId=new Map,this.featureVertexRangesFromVtIndex=new Map;for(let p=0;p{const ae=F[ie],de=S.get(ae);if(!de)return[0,0,0,1];const pe=S.get(`${ae}-use-theme`),_e=W_t(pe&&"string"!=typeof pe?pe.value:void 0,M,{},[],void 0,y,void 0,this.worldview)?null:this.lut;return(this.cameraMask&1<{const de=S.get(F[ie]);return de?this.cameraMask&1<{T.text=function(S,R,M){const F=R.layout.get("text-transform").evaluate(M,{});return"uppercase"===F?S=S.toLocaleUpperCase():"lowercase"===F&&(S=S.toLocaleLowerCase()),N2.applyArabicShaping&&(S=N2.applyArabicShaping(S)),S}(T.text,p,y)}),b}const wA={horizontal:1,vertical:2,horizontalOnly:3};function X_t(b){let p=.5,y=.5;switch(b){case"right":case"top-right":case"bottom-right":p=1;break;case"left":case"top-left":case"bottom-left":p=0}switch(b){case"bottom":case"bottom-right":case"bottom-left":y=1;break;case"top":case"top-right":case"top-left":y=0}return{horizontalAlign:p,verticalAlign:y}}function j_t(b,p,y,T){const{horizontalAlign:S,verticalAlign:R}=X_t(T),M=y[0]-b.displaySize[0]*S,F=y[1]-b.displaySize[1]*R;return{imagePrimary:b,imageSecondary:p,top:F,bottom:F+b.displaySize[1],left:M,right:M+b.displaySize[0]}}function K_t(b,p,y,T,S,R){const M=b.imagePrimary;let F;if(M.content){const Se=M.content,Fe=M.pixelRatio||1;F=[Se[0]/Fe,Se[1]/Fe,M.displaySize[0]-Se[2]/Fe,M.displaySize[1]-Se[3]/Fe]}const G=p.left*R,q=p.right*R;let Q,ie,ae,de;"width"===y||"both"===y?(de=S[0]+G-T[3],ie=S[0]+q+T[1]):(de=S[0]+(G+q-M.displaySize[0])/2,ie=de+M.displaySize[0]);const pe=p.top*R,_e=p.bottom*R;return"height"===y||"both"===y?(Q=S[1]+pe-T[0],ae=S[1]+_e+T[2]):(Q=S[1]+(pe+_e-M.displaySize[1])/2,ae=Q+M.displaySize[1]),{imagePrimary:M,imageSecondary:void 0,top:Q,right:ie,bottom:ae,left:de,collisionPadding:F}}const Lq={"!":"\uFE15","#":"\uFF03",$:"\uFF04","%":"\uFF05","&":"\uFF06","(":"\uFE35",")":"\uFE36","*":"\uFF0A","+":"\uFF0B",",":"\uFE10","-":"\uFE32",".":"\u30FB","/":"\uFF0F",":":"\uFE13",";":"\uFE14","<":"\uFE3F","=":"\uFF1D",">":"\uFE40","?":"\uFE16","@":"\uFF20","[":"\uFE47","\\":"\uFF3C","]":"\uFE48","^":"\uFF3E",_:"\uFE33","`":"\uFF40","{":"\uFE37","|":"\u2015","}":"\uFE38","~":"\uFF5E","\xA2":"\uFFE0","\xA3":"\uFFE1","\xA5":"\uFFE5","\xA6":"\uFFE4","\xAC":"\uFFE2","\xAF":"\uFFE3","\u2013":"\uFE32","\u2014":"\uFE31","\u2018":"\uFE43","\u2019":"\uFE44","\u201C":"\uFE41","\u201D":"\uFE42","\u2026":"\uFE19","\u2027":"\u30FB","\u20A9":"\uFFE6","\u3001":"\uFE11","\u3002":"\uFE12","\u3008":"\uFE3F","\u3009":"\uFE40","\u300A":"\uFE3D","\u300B":"\uFE3E","\u300C":"\uFE41","\u300D":"\uFE42","\u300E":"\uFE43","\u300F":"\uFE44","\u3010":"\uFE3B","\u3011":"\uFE3C","\u3014":"\uFE39","\u3015":"\uFE3A","\u3016":"\uFE17","\u3017":"\uFE18","\uFF01":"\uFE15","\uFF08":"\uFE35","\uFF09":"\uFE36","\uFF0C":"\uFE10","\uFF0D":"\uFE32","\uFF0E":"\u30FB","\uFF1A":"\uFE13","\uFF1B":"\uFE14","\uFF1C":"\uFE3F","\uFF1E":"\uFE40","\uFF1F":"\uFE16","\uFF3B":"\uFE47","\uFF3D":"\uFE48","\uFF3F":"\uFE33","\uFF5B":"\uFE37","\uFF5C":"\u2015","\uFF5D":"\uFE38","\uFF5F":"\uFE35","\uFF60":"\uFE36","\uFF61":"\uFE12","\uFF62":"\uFE41","\uFF63":"\uFE42"};function H_r(b){return"\uFE36"===b||"\uFE48"===b||"\uFE38"===b||"\uFE44"===b||"\uFE42"===b||"\uFE3E"===b||"\uFE3C"===b||"\uFE3A"===b||"\uFE18"===b||"\uFE40"===b||"\uFE10"===b||"\uFE13"===b||"\uFE14"===b||"\uFF40"===b||"\uFFE3"===b||"\uFE11"===b||"\uFE12"===b}function W_r(b){return"\uFE35"===b||"\uFE47"===b||"\uFE37"===b||"\uFE43"===b||"\uFE41"===b||"\uFE3D"===b||"\uFE3B"===b||"\uFE39"===b||"\uFE17"===b||"\uFE3F"===b}const vI=128;function W7(b,p,y,T){const{expression:S}=p;if("constant"===S.kind)return{kind:"constant",layoutSize:S.evaluate(new Rl(b+1,{worldview:y}),void 0,void 0,void 0,T)};if("source"===S.kind)return{kind:"source"};{const{zoomStops:R,interpolationType:M}=S;let F=0;for(;FG*F)}}function J_t(b,p,y,T,S,R,M){const F=Y7(b,p,y,T,"text-offset",S,([G,q])=>[G*H7,q*H7]);return{appearanceTextOffset:F,appearanceTextRotate:Y7(b,p,y,T,"text-rotate",R),appearanceTextSize:Y7(b,p,y,T,"text-size",M)}}function Q_t(b,p,y,T,S,R,M,F,G,q){if(!b)return;const Q=function(ie,ae,de,pe,_e,Se,Fe){if("camera"===ie.kind)return ie.maxSize;if("composite"===ie.kind){const Ye=ae.possiblyEvaluate(new Rl(ie.maxZoom,{worldview:Se}),de,Fe).evaluate(_e,{},de,Fe),Xe=ae.possiblyEvaluate(new Rl(ie.minZoom,{worldview:Se}),de,Fe).evaluate(_e,{},de,Fe);return Math.max(Ye,Xe)}return ae.possiblyEvaluate(new Rl(pe,{worldview:Se}),de,Fe).evaluate(_e,{},de,Fe)}(p,y,T,S,R,G,q);return b.scaleSelf(Q*F*M)}function s5e(b,p,y,T,S,R,M,F,G,q){return{iconPrimary:Q_t(b.getPrimary(),p,y,T,S,R,M,F,G,q),iconSecondary:Q_t(b.getSecondary(),p,y,T,S,R,M,F,G,q)}}function eTt(b,p){return b*p/24}function tTt(b,p,y,T,S,R){let M=null;return"source"===p.kind?(M=[vI*y*T],M[0]>g4&&yn(`${b}: Value for "text-size" or "icon-size" is >= 255. Reduce your "text-size" or "icon-size".`)):"composite"===p.kind&&(M=[vI*S*T,vI*R*T],(M[0]>g4||M[1]>g4)&&yn(`${b}: Value for "text-size" or "icon-size" is >= 255. Reduce your "text-size" or "icon-size".`)),M}const X_r=hn([{type:"Float32",name:"a_globe_pos",components:3},{type:"Float32",name:"a_uv",components:2}]),{members:Kse}=X_r,j_r=hn([{name:"a_pos_3",components:3,type:"Int16"}]);var l5e=hn([{name:"a_pos",type:"Int16",components:2}]);class K_r{constructor(p,y){this.pos=p,this.dir=y}intersectsPlane(p,y,T){const S=Er(y,this.dir);if(Math.abs(S)<1e-6)return false;const R=((p[0]-this.pos[0])*y[0]+(p[1]-this.pos[1])*y[1])/S;return T[0]=this.pos[0]+this.dir[0]*R,T[1]=this.pos[1]+this.dir[1]*R,true}}class Zse{constructor(p,y){this.pos=p,this.dir=y}intersectsPlane(p,y,T){const S=mt(y,this.dir);if(Math.abs(S)<1e-6)return false;const R=((p[0]-this.pos[0])*y[0]+(p[1]-this.pos[1])*y[1]+(p[2]-this.pos[2])*y[2])/S;return T[0]=this.pos[0]+this.dir[0]*R,T[1]=this.pos[1]+this.dir[1]*R,T[2]=this.pos[2]+this.dir[2]*R,true}closestPointOnSphere(p,y,T){if(function(de,pe){var _e=de[0],Se=de[1],Fe=de[2],Ye=pe[0],Xe=pe[1],We=pe[2];return Math.abs(_e-Ye)<=l*Math.max(1,Math.abs(_e),Math.abs(Ye))&&Math.abs(Se-Xe)<=l*Math.max(1,Math.abs(Se),Math.abs(Xe))&&Math.abs(Fe-We)<=l*Math.max(1,Math.abs(Fe),Math.abs(We))}(this.pos,p)||0===y)return T[0]=T[1]=T[2]=0,false;const[S,R,M]=this.dir,F=this.pos[0]-p[0],G=this.pos[1]-p[1],q=this.pos[2]-p[2],Q=S*S+R*R+M*M,ie=2*(F*S+G*R+q*M),ae=ie*ie-4*Q*(F*F+G*G+q*q-y*y);if(ae<0){const de=Math.max(-ie/2,0),pe=F+S*de,_e=G+R*de,Se=q+M*de,Fe=Math.hypot(pe,_e,Se);return T[0]=pe*y/Fe,T[1]=_e*y/Fe,T[2]=Se*y/Fe,false}{const de=(-ie-Math.sqrt(ae))/(2*Q);if(de<0){const pe=Math.hypot(F,G,q);return T[0]=F*y/pe,T[1]=G*y/pe,T[2]=q*y/pe,false}return T[0]=F+S*de,T[1]=G+R*de,T[2]=q+M*de,true}}}class c5e{constructor(p,y,T,S,R){this.TL=p,this.TR=y,this.BR=T,this.BL=S,this.horizon=R}static fromInvProjectionMatrix(p,y,T){const S=[-1,1,1],R=[1,1,1],M=[1,-1,1],F=[-1,-1,1],G=it(S,S,p),q=it(R,R,p),Q=it(M,M,p),ie=it(F,F,p);return new c5e(G,q,Q,ie,y/T)}}function u5e(b,p,y,T){const S=p[0],R=p[1],M=p[2],F=y[0],G=y[1],q=y[2];let Q=1/0,ie=-1/0;for(let ae=0;aeie&&(ie=pe)}return T[0]=Q,T[1]=ie,T}function nTt(b,p){let y=true;for(let T=0;T=0);if(0===R)return 0;R!==p.length&&(y=false)}return y?2:1}const Z_r=[0,0];function rTt(b,p){for(const y of b.projections){const T=u5e(p,b.points[0],y.axis,Z_r);if(y.projection[1]T[1])return 0}return 1}function iTt(b,p){const y=p[0],T=p[1],S=p[2],R=p[3];for(let M=0;M=0)return true}return false}class EA{constructor(p,y){this.points=p||new Array(8).fill([0,0,0]),this.planes=y||new Array(6).fill([0,0,0,0]),this.bounds=xl.fromPoints(this.points),this.projections=[],this.frustumEdges=[we([],this.points[2],this.points[3]),we([],this.points[0],this.points[3]),we([],this.points[4],this.points[0]),we([],this.points[5],this.points[1]),we([],this.points[6],this.points[2]),we([],this.points[7],this.points[3])];for(const T of this.frustumEdges){const S=[0,-T[2],T[1]],R=[T[2],0,-T[0]];this.projections.push({axis:S,projection:u5e(this.points,this.points[0],S,[0,0])}),this.projections.push({axis:R,projection:u5e(this.points,this.points[0],R,[0,0])})}}static fromInvProjectionMatrix(p,y,T,S){const R=Math.pow(2,T),M=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(q=>{const Q=ye([],q,p),ie=1/Q[3]/y*R;return(ae=Q)[0]=(de=Q)[0]*(pe=[ie,ie,S?1/Q[3]:ie,ie])[0],ae[1]=de[1]*pe[1],ae[2]=de[2]*pe[2],ae[3]=de[3]*pe[3],ae;var ae,de,pe}),F=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(q=>{const Q=yt([],ct([],we([],M[q[0]],M[q[1]]),we([],M[q[2]],M[q[1]]))),ie=-mt(Q,M[q[1]]);return Q.concat(ie)}),G=[];for(let q=0;qpe&&(pe=Xe)}let _e=1/0,Se=-1/0;for(let Fe=0;FeSe&&(Se=Xe)}if(de>Se||_e>pe)return 0}return 1}containsPoint(p){for(const y of this.planes){const T=y[3];if(mt([y[0],y[1],y[2]],p)+T<0)return false}return true}}class xl{static fromPoints(p){const y=[1/0,1/0,1/0],T=[-1/0,-1/0,-1/0];for(const S of p)he(y,y,S),ve(T,T,S);return new xl(y,T)}static fromTileIdAndHeight(p,y,T){const S=1<p.max[y]||p.min[y]>this.max[y])return false;return true}intersectsAabbXY(p){return!(this.min[0]>p.max[0]||p.min[0]>this.max[0]||this.min[1]>p.max[1]||p.min[1]>this.max[1])}encapsulate(p){for(let y=0;y<3;y++)this.min[y]=Math.min(this.min[y],p.min[y]),this.max[y]=Math.max(this.max[y],p.max[y])}encapsulatePoint(p){for(let y=0;y<3;y++)this.min[y]=Math.min(this.min[y],p[y]),this.max[y]=Math.max(this.max[y],p[y])}closestPoint(p){return[Math.max(Math.min(this.max[0],p[0]),this.min[0]),Math.max(Math.min(this.max[1],p[1]),this.min[1]),Math.max(Math.min(this.max[2],p[2]),this.min[2])]}}function Jse(b){return b*om/xA}li(xl,"Aabb");const J_r=[new xl([Ib,Ib,Ib],[Mb,Mb,Mb]),new xl([Ib,Ib,Ib],[0,0,Mb]),new xl([0,Ib,Ib],[Mb,0,Mb]),new xl([Ib,0,Ib],[0,Mb,Mb]),new xl([0,0,Ib],[Mb,Mb,Mb])];function oTt(b,p,y,T=true){const S=ge([],b._camera.position,b.worldSize),R=[p,y,1,1];ye(R,R,b.pixelMatrixInverse),ze(R,R,1/R[3]);const M=yt([],we([],R,S)),F=b.globeMatrix,G=[F[12],F[13],F[14]],q=we([],G,S),Q=re(q),ie=yt([],q),ae=b.worldSize/(2*Math.PI),de=mt(ie,M),pe=Math.asin(ae/Q);if(pe1?null:function(T,S,R,M){const F=Math.sin(R);return T*(Math.sin((1-M)*R)/F)+S*(Math.sin(M*R)/F)}(b.a[p],b.b[p],b.angle,bn(y,0,1))+b.center[p]}function U2(b){if(b.z<=1)return J_r[b.z+2*b.y+b.x];const p=h5e(Qse(b));return xl.fromPoints(p)}function CA(b,p,y){return ge(b,b,1-y),Ve(b,b,p,y)}function aTt(b,p,y){for(const T of b)it(T,T,p),ge(T,T,y)}function f5e(b,p,y,T){const S=p/b.worldSize,R=b.globeMatrix;if(y.z<=1){const Tt=U2(y).getCorners();return aTt(Tt,R,S),xl.fromPoints(Tt)}const M=Qse(y,T),F=h5e(M,om+Jse(b._tileCoverLift));aTt(F,R,S);const G=Number.MAX_VALUE,q=[-G,-G,-G],Q=[G,G,G];if(M.contains(b.center)){for(const Nt of F)he(Q,Q,Nt),ve(q,q,Nt);q[2]=0;const Tt=b.point,Lt=[Tt.x*S,Tt.y*S,0];return he(Q,Q,Lt),ve(q,q,Lt),new xl(Q,q)}if(b._tileCoverLift>0){for(const Tt of F)he(Q,Q,Tt),ve(q,q,Tt);return new xl(Q,q)}const ie=[R[12]*S,R[13]*S,R[14]*S],ae=M.getCenter(),de=bn(b.center.lat,-85.051129,V),pe=bn(ae.lat,-85.051129,V),_e=ly(b.center.lng),Se=Qm(de);let Fe=_e-ly(ae.lng);const Ye=Se-Qm(pe);Fe>.5?Fe-=1:Fe<-.5&&(Fe+=1);let Xe=0;Math.abs(Fe)>Math.abs(Ye)?Xe=Fe>=0?1:3:(Xe=Ye>=0?0:2,Ve(ie,ie,[R[4]*S,R[5]*S,R[6]*S],-Math.sin(Fn(Ye>=0?M.getSouth():M.getNorth()))*om));const We=F[Xe],rt=F[(Xe+1)%4],lt=new Q_r(We,rt,ie),Bt=[d5e(lt,0)||We[0],d5e(lt,1)||We[1],d5e(lt,2)||We[2]],ht=SA(b.zoom);if(ht>0){const Tt=function({x:Nt,y:un,z:_n},Dn,Ln,zn,or){const nn=1/(1<<_n);let En=Nt*nn,In=En+nn,Gn=un*nn,qn=Gn+nn,Zn=0;const Hn=(En+In)/2-zn;return Hn>.5?Zn=-1:Hn<-.5&&(Zn=1),En=((En+Zn)*Dn-(zn*=Dn))*Ln+zn,In=((In+Zn)*Dn-zn)*Ln+zn,Gn=(Gn*Dn-(or*=Dn))*Ln+or,qn=(qn*Dn-or)*Ln+or,[[En,qn,0],[In,qn,0],[In,Gn,0],[En,Gn,0]]}(y,p,b._pixelsPerMercatorPixel,_e,Se);for(let Nt=0;NtMath.PI/2*1.01}const uTt=Fn(85),eTr=Math.cos(uTt),tTr=Math.sin(uTt);function dTt(b,p){const y=b.fovAboveCenter,T=b.elevation?b.elevation.getMinElevationBelowMSL()*p:0,S=Math.min(T,b.isOrthographic?-10*p:0),R=(b._camera.position[2]*b.worldSize-S)/Math.cos(b._pitch),M=Math.sin(y)*R/Math.sin(Math.max(Math.PI/2-b._pitch-y,.01));let F=Math.sin(b._pitch)*M+R;const G=R*(1/b._horizonShift);if(!b.elevation||0===b.elevation.exaggeration()){let q=Math.max(b.zoom-17,0);b.isOrthographic&&(q/=10),F*=1+q}return Math.min(1.01*F,G)}class _I{constructor(p,y,T){this.z=p,this.x=y,this.y=T,this.key=TI(0,p,p,y,T)}equals(p){return this.z===p.z&&this.x===p.x&&this.y===p.y}isChildOf(p){const y=this.z-p.z;return 0===p.z||p.z>y&&p.y===this.y>>y}url(p,y){const T=function(R,M,F){const G=2**F,q=2*Math.PI*6378137,Q=q*(R/G-.5),ie=q*(.5-(M+1)/G);return`${Q},${ie},${Q+q/G},${ie+q/G}`}(this.x,this.y,this.z),S=function(R,M,F){let G,q="";for(let Q=R;Q>0;Q--)G=1<this.canonical.z?new pf(p,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new pf(p,this.wrap,p,this.canonical.x>>y,this.canonical.y>>y)}calculateScaledKey(p,y=true){if(this.overscaledZ===p&&y)return this.key;if(p>this.canonical.z)return TI(this.wrap*+y,p,this.canonical.z,this.canonical.x,this.canonical.y);{const T=this.canonical.z-p;return TI(this.wrap*+y,p,p,this.canonical.x>>T,this.canonical.y>>T)}}isChildOf(p){if(p.wrap!==this.wrap)return false;const y=this.canonical.z-p.canonical.z;return 0===p.overscaledZ||p.overscaledZ>y&&p.canonical.y===this.canonical.y>>y}children(p){if(this.overscaledZ>=p)return[new pf(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const y=this.canonical.z+1,T=2*this.canonical.x,S=2*this.canonical.y;return[new pf(y,this.wrap,y,T,S),new pf(y,this.wrap,y,T+1,S),new pf(y,this.wrap,y,T,S+1),new pf(y,this.wrap,y,T+1,S+1)]}isLessThan(p){return this.wrapp.wrap)&&(this.overscaledZp.overscaledZ)&&(this.canonical.xp.canonical.x)&&this.canonical.y{let p=b.canonical.x-1,y=b.wrap;return p<0&&(p=(1<{let p=b.canonical.x+1,y=b.wrap;return p===1<new pf(b.overscaledZ,b.wrap,b.canonical.z,b.canonical.x,(0===b.canonical.y?1<new pf(b.overscaledZ,b.wrap,b.canonical.z,b.canonical.x,b.canonical.y===(1<Xe&&(We(lt,Dn,ht,Tt,un,_n),We(Dn,Bt,un,_n,Lt,Nt))}We(ie,ae,T,R,S,R),We(ae,de,S,R,S,M),We(de,pe,S,M,T,M),We(pe,ie,T,M,T,R),_e-=Xe,Se-=Xe,Fe+=Xe,Ye+=Xe;const rt=1/Math.max(Fe-_e,Ye-Se);return{scale:rt,x:_e*rt,y:Se*rt,x2:Fe*rt,y2:Ye*rt,projection:p}}function hTt(b,p,y,T,S,R,M,F,G){if("globe"===G.name)return f5e(b,p,new _I(y,T,S),false);const q=y5e({z:y,x:T,y:S},G);return new xl([(R+q.x/q.scale)*p,p*(q.y/q.scale),M],[(R+q.x2/q.scale)*p,p*(q.y2/q.scale),F])}li(_I,"CanonicalTileID"),li(pf,"OverscaledTileID",{omit:["projMatrix","expandedProjMatrix"]});const nTr=_(new Float32Array(16));class wI{constructor(p){this.spec=p,this.name=p.name,this.wrap=false,this.requiresDraping=false,this.supportsWorldCopies=false,this.supportsTerrain=false,this.supportsFog=false,this.supportsFreeCamera=false,this.zAxisUnit="meters",this.isReprojectedInTileSpace=true,this.unsupportedLayers=["custom"],this.center=[0,0],this.range=[3.5,7]}project(p,y){return{x:0,y:0,z:0}}unproject(p,y){return new Ea(0,0)}projectTilePoint(p,y,T){return{x:p,y,z:0}}locationPoint(p,y,T,S=true){return p._coordinatePoint(p.locationCoordinate(y,T),S)}pixelsPerMeter(p,y){return E(1,p)*y}pixelSpaceConversion(p,y,T){return 1}farthestPixelDistance(p){return dTt(p,p.pixelsPerMeter)}pointCoordinate(p,y,T,S){const R=p.horizonLineFromTop(false),M=new nt(y,Math.max(R,T));return p.rayIntersectionCoordinate(p.pointRayIntersection(M,S))}pointCoordinate3D(p,y,T){const S=new nt(y,T);if(p.elevation)return p.elevation.pointCoordinate(S);{const R=this.pointCoordinate(p,S.x,S.y,0);return[R.x,R.y,R.z]}}isPointAboveHorizon(p,y){if(p.elevation&&p.elevation.visibleDemTiles.length)return!this.pointCoordinate3D(p,y.x,y.y);const T=p.horizonLineFromTop();return y.y0?y<-q7+T&&(y=-q7+T):y>q7-T&&(y=q7-T);const M=R/Math.pow(ole(y),S);let F=M*Math.sin(S*p),G=R-M*Math.cos(S*p);return F=.5*(F/Math.PI+.5),G=.5*(G/Math.PI+.5),{x:F,y:this.southernCenter?G:1-G,z:0}}unproject(p,y){p=(2*p-.5)*Math.PI,this.southernCenter&&(y=1-y),y=(2*(1-y)-.5)*Math.PI;const{n:T,f:S}=this,R=S-y,M=Math.sign(R),F=Math.sign(T)*Math.sqrt(p*p+R*R);let G=Math.atan2(p,Math.abs(R))*M;R*T<0&&(G-=Math.PI*Math.sign(p)*M);const q=bn(Tr(G/T)+this.center[0],-180,180),Q=bn(Tr(2*Math.atan(Math.pow(S/F,1/T))-q7),-85.051129,V);return new Ea(q,this.southernCenter?-Q:Q)}}class pTt extends wI{constructor(p){super(p),this.wrap=true,this.supportsWorldCopies=true,this.supportsTerrain=true,this.supportsFog=true,this.supportsFreeCamera=true,this.isReprojectedInTileSpace=false,this.unsupportedLayers=[],this.range=null}project(p,y){return{x:ly(p),y:Qm(y),z:0}}unproject(p,y){const T=eg(p),S=Ju(y);return new Ea(T,S)}}const mTt=Fn(V);class sTr extends wI{project(p,y){const T=(y=Fn(y))*y,S=T*T;return{x:.5*((p=Fn(p))*(.8707-.131979*T+S*(S*(.003971*T-.001529*S)-.013791))/Math.PI+.5),y:1-.5*(y*(1.007226+T*(.015085+S*(.028874*T-.044475-.005916*S)))/Math.PI+1),z:0}}unproject(p,y){p=(2*p-.5)*Math.PI;let T=y=(2*(1-y)-1)*Math.PI,S=25,R=0,M=T*T;do{M=T*T;const q=M*M;R=(T*(1.007226+M*(.015085+q*(.028874*M-.044475-.005916*q)))-y)/(1.007226+M*(.045255+q*(.259866*M-.311325-.005916*11*q))),T=bn(T-R,-mTt,mTt)}while(Math.abs(R)>1e-6&&--S>0);M=T*T;const F=bn(Tr(p/(.8707+M*(M*(M*M*M*(.003971-.001529*M)-.013791)-.131979))),-180,180),G=Tr(T);return new Ea(F,G)}}const gTt=Fn(V);class lTr extends wI{project(p,y){y=Fn(y),p=Fn(p);const T=Math.cos(y),S=2/Math.PI,R=Math.acos(T*Math.cos(p/2)),M=Math.sin(R)/R,F=.5*(p*S+2*T*Math.sin(p/2)/M)||0,G=.5*(y+Math.sin(y)/M)||0;return{x:.5*(F/Math.PI+.5),y:1-.5*(G/Math.PI+1),z:0}}unproject(p,y){let T=p=(2*p-.5)*Math.PI,S=y=(2*(1-y)-1)*Math.PI,R=25;const M=1e-6;let F=0,G=0;do{const q=Math.cos(S),Q=Math.sin(S),ie=2*Q*q,ae=Q*Q,de=q*q,pe=Math.cos(T/2),_e=Math.sin(T/2),Se=2*pe*_e,Fe=_e*_e,Ye=1-de*pe*pe,Xe=Ye?1/Ye:0,We=Ye?Math.acos(q*pe)*Math.sqrt(1/Ye):0,rt=.5*(2*We*q*_e+2*T/Math.PI)-p,lt=.5*(We*Q+S)-y,Bt=.5*Xe*(de*Fe+We*q*pe*ae)+1/Math.PI,ht=Xe*(Se*ie/4-We*Q*_e),Tt=.125*Xe*(ie*_e-We*Q*de*Se),Lt=.5*Xe*(ae*pe+We*Fe*q)+.5,Nt=ht*Tt-Lt*Bt;F=(lt*ht-rt*Lt)/Nt,G=(rt*Tt-lt*Bt)/Nt,T=bn(T-F,-Math.PI,Math.PI),S=bn(S-G,-gTt,gTt)}while((Math.abs(F)>M||Math.abs(G)>M)&&--R>0);return new Ea(Tr(T),Tr(S))}}class yTt extends wI{constructor(p){super(p),this.center=p.center||[0,0],this.parallels=p.parallels||[0,0],this.cosPhi=Math.max(.01,Math.cos(Fn(this.parallels[0]))),this.scale=1/(2*Math.max(Math.PI*this.cosPhi,1/this.cosPhi)),this.wrap=true,this.supportsWorldCopies=true}project(p,y){const{scale:T,cosPhi:S}=this;return{x:Fn(p)*S*T+.5,y:-Math.sin(Fn(y))/S*T+.5,z:0}}unproject(p,y){const{scale:T,cosPhi:S}=this,R=-(y-.5)/T,M=bn(Tr((p-.5)/T)/S,-180,180),F=Math.asin(bn(R*S,-1,1)),G=bn(Tr(F),-85.051129,V);return new Ea(M,G)}}class cTr extends pTt{constructor(p){super(p),this.requiresDraping=true,this.supportsWorldCopies=false,this.supportsFog=true,this.zAxisUnit="pixels",this.unsupportedLayers=["debug"],this.range=[3,5]}projectTilePoint(p,y,T){const S=Dq(p,y,T);return it(S,S,nle(U2(T))),{x:S[0],y:S[1],z:S[2]}}locationPoint(p,y,T){const S=bA(y.lat,y.lng),R=yt([],S),M=T?p._centerAltitude+T:p.elevation?p.elevation.getAtPointOrZero(p.locationCoordinate(y),p._centerAltitude):p._centerAltitude;Ve(S,S,R,E(1,0)*qr*M);const F=_(new Float64Array(16));return P(F,p.pixelMatrix,p.globeMatrix),it(S,S,F),new nt(S[0],S[1])}pixelsPerMeter(p,y){return E(1,0)*y}pixelSpaceConversion(p,y,T){const S=E(1,p)*y,R=Si(E(1,45)*y,S,T);return this.pixelsPerMeter(p,y)/R}createTileMatrix(p,y,T){const S=p5e(U2(T.canonical));return P(new Float64Array(16),p.globeMatrix,S)}createInversionMatrix(p,y){const{center:T}=p,S=nle(U2(y));return O(S,S,Fn(T.lng)),N(S,S,Fn(T.lat)),I(S,S,[p._pixelsPerMercatorPixel,p._pixelsPerMercatorPixel,1]),Float32Array.from(S)}pointCoordinate(p,y,T,S){return oTt(p,y,T,true)||new fe(0,0)}pointCoordinate3D(p,y,T){const S=this.pointCoordinate(p,y,T,0);return[S.x,S.y,S.z]}isPointAboveHorizon(p,y){return!oTt(p,y.x,y.y,false)}farthestPixelDistance(p){const y=function(S,R){const M=S.cameraToCenterDistance,F=S._centerAltitude*R,G=S._camera,q=S._camera.forward(),Q=xe([],ge([],q,-M),[0,0,F]),ie=S.worldSize/(2*Math.PI),ae=[0,0,-ie],de=S.width/S.height,pe=Math.tan(S.fovAboveCenter),_e=ge([],G.up(),pe),Se=ge([],G.right(),pe*de),Fe=yt([],xe([],xe([],q,_e),Se)),Ye=[];let Xe;if(new Zse(Q,Fe).closestPointOnSphere(ae,ie,Ye)){const We=xe([],Ye,ae),rt=we([],We,Q);Xe=Math.cos(S.fovAboveCenter)*re(rt)}else{const We=we([],Q,ae),rt=we([],ae,Q);yt(rt,rt);const lt=re(We)-ie;Xe=Math.sqrt(lt*(lt+2*ie));const Bt=Math.acos(Xe/(ie+lt))-Math.acos(mt(q,rt));Xe*=Math.cos(Bt)}return 1.01*Xe}(p,this.pixelsPerMeter(p.center.lat,p.worldSize)),T=SA(p.zoom);if(T>0){const S=dTt(p,E(1,p.center.lat)*p.worldSize),R=p.worldSize/(2*Math.PI),M=Math.max(p.width,p.height)/p.worldSize*Math.PI;return Si(y,S+R*(1-Math.cos(M)),Math.pow(T,10))}return y}upVector(p,y,T){return Dq(y,T,p,1)}upVectorScale(p){return{metersToTile:Jse(ele(U2(p)))}}}function ale(b){const p=b.parallels,y=!!p&&Math.abs(p[0]+p[1])<.01;switch(b.name){case"mercator":return new pTt(b);case"equirectangular":return new oTr(b);case"naturalEarth":return new sTr(b);case"equalEarth":return new iTr(b);case"winkelTripel":return new lTr(b);case"albers":return y?new yTt(b):new rTr(b);case"lambertConformalConic":return y?new yTt(b):new aTr(b);case"globe":return new cTr(b)}throw new Error(`Invalid projection name: ${b.name}`)}const zq=Number.MAX_SAFE_INTEGER,uTr=zq-1;function bTt(b,p,y,T){return b.orderp.max.x||b.max.xp.max.y||b.max.ynew nt((G.x+R.x*qr)*F-M.x*qr,(G.y+R.y*qr)*F-M.y*qr))}return x5e(y,S,b.indices,0,b.indices.length,0,0)}function TTt(b,p,y,T){const S=Math.pow(2,T.z-y.z);return new nt((b+y.x*qr)*S-T.x*qr,(p+y.y*qr)*S-T.y*qr)}function v5e(b,p){const y=[];p.grid.queryPoint(b,y);const T=p.indices,S=p.vertices;for(let R=0;R>4,ie<128)return X7(M,Q,F);if(ie=q[G.pos++],Q|=(127&ie)<<3,ie<128)return X7(M,Q,F);if(ie=q[G.pos++],Q|=(127&ie)<<10,ie<128)return X7(M,Q,F);if(ie=q[G.pos++],Q|=(127&ie)<<17,ie<128)return X7(M,Q,F);if(ie=q[G.pos++],Q|=(127&ie)<<24,ie<128)return X7(M,Q,F);if(ie=q[G.pos++],Q|=(1&ie)<<31,ie<128)return X7(M,Q,F);throw new Error("Expected varint not more than 10 bytes")}(R,p,this))))}readSVarint(){const p=this.readVarint();return p%2==1?(p+1)/-2:p/2}readBoolean(){return Boolean(this.readVarint())}readString(){const p=this.readVarint()+this.pos,y=this.pos;return this.pos=p,p-y>=12&&ETt?ETt.decode(this.buf.subarray(y,p)):function(T,S,R){let M="",F=S;for(;F239?4:G>223?3:G>191?2:1;if(F+de>R)break;1===de?G<128&&(ae=G):2===de?(q=T[F+1],128==(192&q)&&(ae=(31&G)<<6|63&q,ae<=127&&(ae=null))):3===de?(q=T[F+1],Q=T[F+2],128==(192&q)&&128==(192&Q)&&(ae=(15&G)<<12|(63&q)<<6|63&Q,(ae<=2047||ae>=55296&&ae<=57343)&&(ae=null))):4===de&&(q=T[F+1],Q=T[F+2],ie=T[F+3],128==(192&q)&&128==(192&Q)&&128==(192&ie)&&(ae=(15&G)<<18|(63&q)<<12|(63&Q)<<6|63&ie,(ae<=65535||ae>=1114112)&&(ae=null))),null===ae?(ae=65533,de=1):ae>65535&&(ae-=65536,M+=String.fromCharCode(ae>>>10&1023|55296),ae=56320|1023&ae),M+=String.fromCharCode(ae),F+=de}return M}(this.buf,y,p)}readBytes(){const p=this.readVarint()+this.pos,y=this.buf.subarray(this.pos,p);return this.pos=p,y}readPackedVarint(p=[],y){const T=this.readPackedEnd();for(;this.pos=p)return 0;const y=this.readVarint();return this.type=7&y,this._valueStart=this.pos,y>>>3}skip(p){const y=7&p;if(0===y)for(;this.buf[this.pos++]>127;);else if(2===y)this.pos=this.readVarint()+this.pos;else if(5===y)this.pos+=4;else{if(1!==y)throw new Error(`Unimplemented type: ${y}`);this.pos+=8}}}function X7(b,p,y){return y?4294967296*p+(b>>>0):4294967296*(p>>>0)+(b>>>0)}function CTt(b,p,y){const T=p<=16383?1:p<=2097151?2:p<=268435455?3:Math.floor(Math.log(p)/(7*Math.LN2));y.realloc(T),y.buf.copyWithin(b+T,b,y.pos)}function fTr(b,p){const y=b.length;let T=p.buf,S=p.pos,R=p.length;for(let M=0;MR)p.pos=S,p.writeVarint(F),T=p.buf,S=p.pos,R=p.length;else{for(;F>127;)T[S++]=F%128|128,F=Math.floor(F/128);T[S++]=F}}p.pos=S}function hTr(b,p){for(let y=0;yF.h-M.h);const T=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(p/.95)),y),h:1/0}];let S=0,R=0;for(const M of b)for(let F=T.length-1;F>=0;F--){const G=T[F];if(!(M.w>G.w||M.h>G.h)){if(M.x=G.x,M.y=G.y,R=Math.max(R,M.y+M.h),S=Math.max(S,M.x+M.w),M.w===G.w&&M.h===G.h){const q=T.pop();q&&Fp.id?1:b.versionp.version?1:b.sxp.sx?1:b.syp.sy?1:0}function dle(b){let p=0;for(let y=0;y0,ATt(p,T,this.iconDescriptors,M),ATt(y,T,this.patternDescriptors,M),this.iconDescriptors.sort(ule),this.patternDescriptors.sort(ule);let F=0;F=o1(F,dle(R)),F=o1(F,1);const G=S?S.data:"";G&&(F=o1(F,dle(G))),F=o1(F,1);for(const q of this.iconDescriptors)F=o1(F,dle(q.id)),F=o1(F,q.version),F=o1(F,q.sx),F=o1(F,q.sy);F=o1(F,1);for(const q of this.patternDescriptors)F=o1(F,dle(q.id)),F=o1(F,q.version),F=o1(F,q.sx),F=o1(F,q.sy);this.hash=F}subsetOf(p){return this.scope===p.scope&&this.isSubsetArray(this.iconDescriptors,p.iconDescriptors,ule)&&this.isSubsetArray(this.patternDescriptors,p.patternDescriptors,ule)}isSubsetArray(p,y,T){let S=0,R=0;if(p.length>y.length)return false;for(;S0&&Q>0){const ae=this.useMipmap?Math.floor(Math.log2(Math.max(q,Q)))+1:1;M.texStorage2D(M.TEXTURE_2D,ae,this.format,q,Q),this.size=[q,Q]}this.size&&(ie?M.texSubImage2D(M.TEXTURE_2D,0,F,G,w5e(this.format),E5e(this.format),p):"data"in p&&p.data&&M.texSubImage2D(M.TEXTURE_2D,0,F,G,T,S,w5e(this.format),E5e(this.format),p.data)),this.useMipmap&&M.generateMipmap(M.TEXTURE_2D)}bind(p,y,T=false){const{context:S}=this,{gl:R}=S;R.bindTexture(R.TEXTURE_2D,this.texture),p!==this.minFilter&&(R.texParameteri(R.TEXTURE_2D,R.TEXTURE_MAG_FILTER,p),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_MIN_FILTER,this.useMipmap&&!T?p===R.NEAREST?R.NEAREST_MIPMAP_NEAREST:R.LINEAR_MIPMAP_LINEAR:p),this.minFilter=p),y!==this.wrapS&&(R.texParameteri(R.TEXTURE_2D,R.TEXTURE_WRAP_S,y),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_WRAP_T,y),this.wrapS=y)}bindExtraParam(p,y,T,S,R){const{context:M}=this,{gl:F}=M;F.bindTexture(F.TEXTURE_2D,this.texture),y!==this.magFilter&&(F.texParameteri(F.TEXTURE_2D,F.TEXTURE_MAG_FILTER,y),this.magFilter=y),p!==this.minFilter&&(F.texParameteri(F.TEXTURE_2D,F.TEXTURE_MIN_FILTER,this.useMipmap?p===F.NEAREST?F.NEAREST_MIPMAP_NEAREST:F.LINEAR_MIPMAP_LINEAR:p),this.minFilter=p),T!==this.wrapS&&(F.texParameteri(F.TEXTURE_2D,F.TEXTURE_WRAP_S,T),this.wrapS=T),S!==this.wrapT&&(F.texParameteri(F.TEXTURE_2D,F.TEXTURE_WRAP_T,S),this.wrapT=S),R!==this.compareMode&&(R?(F.texParameteri(F.TEXTURE_2D,F.TEXTURE_COMPARE_MODE,F.COMPARE_REF_TO_TEXTURE),F.texParameteri(F.TEXTURE_2D,F.TEXTURE_COMPARE_FUNC,R)):F.texParameteri(F.TEXTURE_2D,F.TEXTURE_COMPARE_MODE,F.NONE),this.compareMode=R)}destroy(){const{gl:p}=this.context;p.deleteTexture(this.texture),this.texture=null}}class kTt{constructor(p,y,T,S){this.context=p,this.format=S,this.size=T,this.texture=p.gl.createTexture();const[R,M,F]=this.size,{gl:G}=p;G.bindTexture(G.TEXTURE_3D,this.texture),p.pixelStoreUnpackFlipY.set(false),p.pixelStoreUnpack.set(1),p.pixelStoreUnpackPremultiplyAlpha.set(false),"data"in y&&y.data&&G.texImage3D(G.TEXTURE_3D,0,this.format,R,M,F,0,w5e(this.format),E5e(this.format),y.data)}bind(p,y){const{context:T}=this,{gl:S}=T;S.bindTexture(S.TEXTURE_3D,this.texture),p!==this.minFilter&&(S.texParameteri(S.TEXTURE_3D,S.TEXTURE_MAG_FILTER,p),S.texParameteri(S.TEXTURE_3D,S.TEXTURE_MIN_FILTER,p),this.minFilter=p),y!==this.wrapS&&(S.texParameteri(S.TEXTURE_3D,S.TEXTURE_WRAP_S,y),S.texParameteri(S.TEXTURE_3D,S.TEXTURE_WRAP_T,y),this.wrapS=y)}destroy(){const{gl:p}=this.context;p.deleteTexture(this.texture),this.texture=null}}class Uq{static getImagePositionScale(p,y,T){if(y&&p){const{sx:S,sy:R}=p;return{x:S,y:R}}return{x:T,y:T}}constructor(p,y,T,S){this.paddedRect=p;const{pixelRatio:R,version:M,stretchX:F,stretchY:G,content:q,sdf:Q,usvg:ie}=y;this.pixelRatio=R,this.stretchX=F,this.stretchY=G,this.content=q,this.version=M,this.padding=T,this.sdf=Q,this.usvg=ie,this.scale=Uq.getImagePositionScale(S,ie,R)}get tl(){return[this.paddedRect.x+this.padding,this.paddedRect.y+this.padding]}get br(){return[this.paddedRect.x+this.paddedRect.w-this.padding,this.paddedRect.y+this.paddedRect.h-this.padding]}get displaySize(){return[(this.paddedRect.w-2*this.padding)/this.scale.x,(this.paddedRect.h-2*this.padding)/this.scale.y]}}function RTt(b,p,y){const T=ay.parse(b),S=function(R,M,F=[1,1]){return{x:0,y:0,w:(R.data?R.data.width:R.width*F[0])+2*M,h:(R.data?R.data.height:R.height*F[1])+2*M}}(p,y,[T.sx,T.sy]);return{bin:S,imagePosition:new Uq(S,p,y,T),imageVariant:T}}function C5e(b,p){const y=[];for(const[S,R]of b.entries()){const M=ay.parse(S);M&&(y.push({key:S,value:R,variant:M}),p&&p.set(S,M))}y.sort((S,R)=>{const M=S.variant.id.toString().localeCompare(R.variant.id.toString());return 0!==M?M:S.variant.sx!==R.variant.sx?S.variant.sx-R.variant.sx:S.variant.sy!==R.variant.sy?S.variant.sy-R.variant.sy:S.key.localeCompare(R.key)});const T=new Map;for(const S of y)T.set(S.key,S.value);return T}class PTt{constructor(p){this.sourceAtlasHash=p}}class ITt{constructor(p,y,T,S,R=""){const M=new Map,F=new Map;this.haveRenderCallbacks=[];const G=[],q=void 0!==S,Q=q?new Map:void 0,ie=q?C5e(p,Q):p,ae=q?C5e(y,Q):y;this.addImages(ie,M,1,G),this.addImages(ae,F,2,G);const{w:de,h:pe}=STt(G),_e=new yp({width:de||1,height:pe||1});for(const[Se,Fe]of ie.entries()){const Ye=M.get(Se).paddedRect;yp.copy(Fe.data,_e,{x:0,y:0},{x:Ye.x+1,y:Ye.y+1},Fe.data,null,Fe.sdf)}for(const[Se,Fe]of ae.entries()){const Ye=F.get(Se),Xe=Ye.paddedRect;let We=Ye.padding;const rt=Xe.x+We,lt=Xe.y+We,Bt=Fe.data.width,ht=Fe.data.height;We=We>1?We-1:We,yp.copy(Fe.data,_e,{x:0,y:0},{x:rt,y:lt},Fe.data,T),yp.copy(Fe.data,_e,{x:0,y:ht-We},{x:rt,y:lt-We},{width:Bt,height:We},T),yp.copy(Fe.data,_e,{x:0,y:0},{x:rt,y:lt+ht},{width:Bt,height:We},T),yp.copy(Fe.data,_e,{x:Bt-We,y:0},{x:rt-We,y:lt},{width:We,height:ht},T),yp.copy(Fe.data,_e,{x:0,y:0},{x:rt+Bt,y:lt},{width:We,height:ht},T),yp.copy(Fe.data,_e,{x:Bt-We,y:ht-We},{x:rt-We,y:lt-We},{width:We,height:We},T),yp.copy(Fe.data,_e,{x:0,y:ht-We},{x:rt+Bt,y:lt-We},{width:We,height:We},T),yp.copy(Fe.data,_e,{x:0,y:0},{x:rt+Bt,y:lt+ht},{width:We,height:We},T),yp.copy(Fe.data,_e,{x:Bt-We,y:0},{x:rt-We,y:lt+ht},{width:We,height:We},T)}this.lut=T,this.image=_e,this.iconPositions=M,this.patternPositions=F,q&&(this.contentDescriptor=new T5e(ie,ae,S,T,R,Q))}addImages(p,y,T,S){for(const[R,M]of p.entries()){const{bin:F,imagePosition:G,imageVariant:q}=RTt(R,M,T);y.set(R,G),S.push(F),M.hasRenderCallback&&this.haveRenderCallbacks.push(q.id)}}patchUpdatedImages(p,y,T,S){this.haveRenderCallbacks=this.haveRenderCallbacks.filter(R=>p.hasImage(R,T)),p.dispatchRenderCallbacks(this.haveRenderCallbacks,T);for(const R of p.getUpdatedImages(T)){for(const M of this.iconPositions.keys()){const F=ay.parse(M);if(gd.isEqual(F.id,R)){const G=p.getImage(R,T);this.patchUpdatedImage(this.iconPositions.get(M),G,y,null)}}for(const M of this.patternPositions.keys()){const F=ay.parse(M);if(gd.isEqual(F.id,R)){const G=p.getImage(R,T);this.patchUpdatedImage(this.patternPositions.get(M),G,y,S||this.lut)}}}}patchUpdatedImage(p,y,T,S=null){if(!p||!y)return;if(p.version===y.version)return;p.version=y.version;const[R,M]=p.tl,F=p.sdf;if(this.lut||F){const G={width:y.data.width,height:y.data.height},q=new yp(G);yp.copy(y.data,q,{x:0,y:0},{x:0,y:0},G,S,F),T.update(q,{position:{x:R,y:M},recreateWhenResize:false})}else T.update(y.data,{position:{x:R,y:M},recreateWhenResize:false})}}li(Uq,"ImagePosition"),li(ITt,"ImageAtlas",{omit:["lut"]}),li(PTt,"ImageAtlasReference");class Vq{constructor(p){this.pendingRequests=new Map,this.cachedRanges=new Map,this.fontstackCompositing=p&&p.fontstackCompositing||"client"}loadGlyphRange(p,y,T,S,R){if("server"===this.fontstackCompositing)return void Vq.loadGlyphRange(p,y,T,S,R);const M=p.split(",").map(F=>F.trim()).filter(F=>F.length>0);0!==M.length?1!==M.length?this._loadMultipleFonts(M,y,T,S,R):this._loadFont(M[0],y,T,S,R):R(new Error("Empty fontstack"))}_loadMultipleFonts(p,y,T,S,R){const M=p.map(()=>null),F={completed:0,firstError:null,callbackCalled:false},G=(q,Q,ie)=>{if(!F.callbackCalled&&(Q&&!F.firstError&&(F.firstError=Q),ie&&(M[q]=ie),F.completed++,F.completed===p.length)){F.callbackCalled=true;const ae=M.filter(pe=>null!==pe);if(0===ae.length)return void R(F.firstError||new Error("All fonts failed to load"));const de=this._composeGlyphs(ae);R(null,de)}};for(let q=0;q{G(q,Q,ie)})}_loadFont(p,y,T,S,R){const M=`${p}:${y}`;if(this.cachedRanges.has(M)){const G=this.cachedRanges.get(M);return void Ct.frame(()=>R(null,G))}const F=this.pendingRequests.get(M);F?F.push(R):(this.pendingRequests.set(M,[R]),Vq.loadGlyphRange(p,y,T,S,(G,q)=>{G||this.cachedRanges.set(M,q||null);const Q=this.pendingRequests.get(M);if(this.pendingRequests.delete(M),Q)for(const ie of Q)ie(G,q)}))}_composeGlyphs(p){const y={};let T,S;for(const R of p)if(void 0===T&&void 0!==R.ascender&&(T=R.ascender),void 0===S&&void 0!==R.descender&&(S=R.descender),R.glyphs)for(const M in R.glyphs)void 0===y[M]&&(y[M]=R.glyphs[M]);return{glyphs:y,ascender:T,descender:S}}}Vq.loadGlyphRange=async function(b,p,y,T,S){const R=256*p,M=R+255;let F;try{const G=await T.transformRequest(T.normalizeGlyphsURL(y).replace("{fontstack}",b).replace("{range}",`${R}-${M}`),Ga.Glyphs),{data:q}=await es(G),Q={},ie=function(ae){return function(de){const pe={glyphs:[]};let _e;for(;_e=de.nextField();)1===_e&&_Tr(de,de.readVarint()+de.pos,pe);return pe}(new cle(ae))}(q);for(const ae of ie.glyphs)Q[ae.id]=ae;F={glyphs:Q,ascender:ie.ascender,descender:ie.descender}}catch(G){return S(G)}S(null,F)};const $q=1e20,S5e=new Float64Array(256);for(let b=0;b<256;b++){const p=.5-Math.pow(b/255,1/2.2);S5e[b]=p*Math.abs(p)}function MTt(b,p,y,T,S,R,M,F,G){for(let q=p;q-1);G++,R[G]=F,M[G]=q,M[G+1]=$q}for(let F=0,G=0;F{if(M){S.ascender=M.ascender,S.descender=M.descender;for(const F in M.glyphs)this._doesCharSupportLocalGlyph(+F)||(S.glyphs[+F]=M.glyphs[+F]);S.ranges[y]=true}for(const F of S.requests[y]||[])F(R,M);delete S.requests[y]}))}getGlyphs(p,y){const T=[],S=this.url||Ft.GLYPHS_URL;for(const R in p)for(const M of p[R])T.push({stack:R,id:M});er(T,({stack:R,id:M},F)=>{let G=this.entries[R];G||(G=this.entries[R]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let q=G.glyphs[M];if(void 0!==q)return void F(null,{stack:R,id:M,glyph:q});if(q=this._tinySDF(G,R,M),q)return G.glyphs[M]=q,void F(null,{stack:R,id:M,glyph:q});const Q=Math.floor(M/256);if(256*Q>65535)return yn("glyphs > 65535 not supported"),void F(null,{stack:R,id:M,glyph:q});if(G.ranges[Q])return void F(null,{stack:R,id:M,glyph:q});let ie=G.requests[Q];ie||(ie=G.requests[Q]=[],this.glyphLoader.loadGlyphRange(R,Q,S,this.requestManager,(ae,de)=>{if(de){G.ascender=de.ascender,G.descender=de.descender;for(const pe in de.glyphs)this._doesCharSupportLocalGlyph(+pe)||(G.glyphs[+pe]=de.glyphs[+pe]);G.ranges[Q]=true}for(const pe of ie)pe(ae,de);delete G.requests[Q]})),ie.push((ae,de)=>{ae?F(ae):de&&F(null,{stack:R,id:M,glyph:de.glyphs[M]||null})})},(R,M)=>{if(R)y(R);else if(M){const F={};for(const{stack:G,id:q,glyph:Q}of M)void 0===F[G]&&(F[G]={}),void 0===F[G].glyphs&&(F[G].glyphs={}),F[G].glyphs[q]=Q&&{id:Q.id,bitmap:Q.bitmap.clone(),metrics:Q.metrics},F[G].ascender=this.entries[G].ascender,F[G].descender=this.entries[G].descender;y(null,F)}})}_doesCharSupportLocalGlyph(p){return this.localGlyphMode!==A5e.none&&(this.localGlyphMode===A5e.all?!!this.localFontFamily:!!this.localFontFamily&&(dq(p)||Tse(p)||aI(p)||mA(p)||C7(p)||n4(p)||(y=p)>=131072&&y<=173791||(T=>T>=66736&&T<=66815)(p)));var y}_tinySDF(p,y,T){const S=this.localFontFamily;if(!S||!this._doesCharSupportLocalGlyph(T))return;let R=p.tinySDF;if(!R){let Se="400";wTr.test(y)?Se="900":ETr.test(y)?Se="500":CTr.test(y)&&(Se="200"),R=p.tinySDF=new hle.TinySDF({fontFamily:S,fontWeight:Se,fontSize:48,buffer:6,radius:16}),R.fontWeight=Se}const M=R.fontWeight;if(this.localGlyphs[M][T])return this.localGlyphs[M][T];const F=String.fromCodePoint(T),{data:G,width:q,height:Q,glyphWidth:ie,glyphHeight:ae,glyphLeft:de,glyphTop:pe,glyphAdvance:_e}=R.draw(F);return this.localGlyphs[M][T]={id:T,bitmap:new xI({width:q,height:Q},G),metrics:{width:ie/2,height:ae/2,left:de/2,top:pe/2-27,advance:_e/2,localGlyph:true}}}}function DTt(b,p){return b+p[1]-p[0]}function FTt(b,p,y,T,S=1){const R=[],M=b.imagePrimary,F=M.pixelRatio,G=M.paddedRect.w-2,q=M.paddedRect.h-2,Q=(b.right-b.left)*S,ie=(b.bottom-b.top)*S,ae=M.stretchX||[[0,G]],de=M.stretchY||[[0,q]],pe=ae.reduce(DTt,0),_e=de.reduce(DTt,0),Se=G-pe,Fe=q-_e;let Ye=0,Xe=pe,We=0,rt=_e,lt=0,Bt=Se,ht=0,Tt=Fe;if(M.content&&T){const Nt=M.content;Ye=ple(ae,0,Nt[0]),We=ple(de,0,Nt[1]),Xe=ple(ae,Nt[0],Nt[2]),rt=ple(de,Nt[1],Nt[3]),lt=Nt[0]-Ye,ht=Nt[1]-We,Bt=Nt[2]-Nt[0]-Xe,Tt=Nt[3]-Nt[1]-rt}const Lt=(Nt,un,_n,Dn)=>{const Ln=mle(Nt.stretch-Ye,Xe,Q,b.left*S),zn=gle(Nt.fixed-lt,Bt,Nt.stretch,pe),or=mle(un.stretch-We,rt,ie,b.top*S),nn=gle(un.fixed-ht,Tt,un.stretch,_e),En=mle(_n.stretch-Ye,Xe,Q,b.left*S),In=gle(_n.fixed-lt,Bt,_n.stretch,pe),Gn=mle(Dn.stretch-We,rt,ie,b.top*S),qn=gle(Dn.fixed-ht,Tt,Dn.stretch,_e),Zn=new nt(Ln,or),Hn=new nt(En,or),ur=new nt(En,Gn),pr=new nt(Ln,Gn),ni=new nt(zn/F,nn/F),Cr=new nt(In/F,qn/F),Fr=p*Math.PI/180;if(Fr){const io=Math.sin(Fr),xa=Math.cos(Fr),va=[xa,-io,io,xa];Zn._matMult(va),Hn._matMult(va),pr._matMult(va),ur._matMult(va)}const Fi=Nt.stretch+Nt.fixed,Bi=_n.stretch+_n.fixed,no=un.stretch+un.fixed,Ii=Dn.stretch+Dn.fixed,mo=b.imageSecondary;return{tl:Zn,tr:Hn,bl:pr,br:ur,texPrimary:{x:M.paddedRect.x+1+Fi,y:M.paddedRect.y+1+no,w:Bi-Fi,h:Ii-no},texSecondary:mo?{x:mo.paddedRect.x+1+Fi,y:mo.paddedRect.y+1+no,w:Bi-Fi,h:Ii-no}:void 0,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:ni,pixelOffsetBR:Cr,minFontScaleX:Bt/F/Q,minFontScaleY:Tt/F/ie,isSDF:y}};if(M.stretchX||M.stretchY){const Nt=NTt(ae,Se,pe),un=NTt(de,Fe,_e);for(let _n=0;_n0?[Ye,-Xe]:We<0?[-Ye,Xe]:0===Ye?[Xe,Ye]:[Xe,-Ye]}(y);let de=Math.abs(p.top-p.bottom);for(const Fe of p.positionedLines)de-=Fe.lineOffset;const pe=p.positionedLines.length,_e=de/pe;let Se=p.top-y[1];for(let Fe=0;Fefunction(R){if(!R.condition)return{featureDependent:false,stateDependent:false,zoomDependent:false,pitchDependent:false,brightnessDependent:false,worldviewDependent:false};const M=R.condition.expression;return{featureDependent:!lA(M),stateDependent:!P2(M),zoomDependent:!Fv(M,["zoom"]),pitchDependent:!Fv(M,["pitch"]),brightnessDependent:!Fv(M,["brightness","measure-light"]),worldviewDependent:!Fv(M,["worldview"])}}(S));this.anyFeatureDependent=T.some(S=>S.featureDependent),this.anyStateDependent=T.some(S=>S.stateDependent)}update(p,y){const T=this.lastParams,S=!T||T.zoom!==p.zoom||T.pitch!==(p.pitch||0)||T.brightness!==(p.brightness||0)||T.worldview!==p.worldview;this.lastParams={zoom:p.zoom,pitch:p.pitch||0,brightness:p.brightness||0,worldview:p.worldview};const R=y&&this.anyStateDependent;if(!S&&!R&&-2!==this.lastAllFeaturesIndex)return{kind:"no-changes"};if(!this.anyFeatureDependent&&!R){const M=this.evaluateAllFeatures(p);return M===this.lastAllFeaturesIndex?{kind:"no-changes"}:(this.lastAllFeaturesIndex=M,{kind:"all-features",appearanceIndex:M})}return{kind:"per-feature"}}evaluateAllFeatures(p){for(let y=0;yM-F),R=new Map;for(const M of S){const F=T.get(M);R.set(M,new Ls(F))}return y&&(this.cachedBatchIndices=S,this.cachedBatchSegments=R),{batchIndices:S,batchSegments:R}}snapshotSymbolVertexData(p,y){const T=p*j7;return this.layoutVertexArray.uint16.slice(T,T+y*j7)}restoreSymbolVertexData(p,y){this.layoutVertexArray.uint16.set(y,p*j7)}snapshotIconTransitioningVertexData(p,y){const T=2*p;return this.iconTransitioningVertexArray.uint16.slice(T,T+2*y)}restoreIconTransitioningVertexData(p,y){this.iconTransitioningVertexArray.uint16.set(y,2*p)}updateSymbolVertexData(p,y,T,S,R,M,F,G,q,Q,ie,ae,de){const pe=this.layoutVertexArray.uint16,_e=p*j7;pe[_e]=y,pe[_e+1]=T,pe[_e+2]=S,pe[_e+3]=R,pe[_e+4]=M,pe[_e+5]=F,pe[_e+6]=G,pe[_e+7]=q,pe[_e+8]=Q,pe[_e+9]=ie,pe[_e+10]=ae,pe[_e+11]=de}upload(p,y,T,S,R,M){this.isEmpty()||(T&&(this.cachedBatchIndices=null,this.cachedBatchSegments=null,this.layoutVertexBuffer=p.createVertexBuffer(this.layoutVertexArray,I_r.members,!!M),this.indexBuffer=p.createIndexBuffer(this.indexArray,y),this.dynamicLayoutVertexBuffer=p.createVertexBuffer(this.dynamicLayoutVertexArray,L_r.members,true),this.opacityVertexBuffer=p.createVertexBuffer(this.opacityVertexArray,RTr,true),this.iconTransitioningVertexArray.length>0&&(this.iconTransitioningVertexBuffer=p.createVertexBuffer(this.iconTransitioningVertexArray,O_r.members,true)),this.globeExtVertexArray.length>0&&(this.globeExtVertexBuffer=p.createVertexBuffer(this.globeExtVertexArray,M_r.members,true)),!this.zOffsetVertexBuffer&&(this.zOffsetVertexArray.length>0||R)&&(this.zOffsetVertexBuffer=p.createVertexBuffer(this.zOffsetVertexArray,D_r.members,true)),!this.orientationVertexBuffer&&this.orientationVertexArray&&this.orientationVertexArray.length>0&&(this.orientationVertexBuffer=p.createVertexBuffer(this.orientationVertexArray,N_r.members,true)),this.opacityVertexBuffer.itemSize=1,this.featureIdArray.length>0&&(this.featureIdBuffer=p.createVertexBuffer(this.featureIdArray,F_r.members,false))),(T||S)&&(this.programConfigurations.upload(p),this.uboBinder&&this.uboBinder.upload(p)))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy(),this.iconTransitioningVertexBuffer&&this.iconTransitioningVertexBuffer.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy(),this.zOffsetVertexBuffer&&this.zOffsetVertexBuffer.destroy(),this.orientationVertexBuffer&&this.orientationVertexBuffer.destroy(),this.featureIdBuffer&&this.featureIdBuffer.destroy(),this.uboBinder&&this.uboBinder.destroy())}}li(k5e,"SymbolBuffers",{omit:["cachedBatchIndices","cachedBatchSegments"]});class R5e{constructor(p,y,T){this.layoutVertexArray=new p,this.layoutAttributes=y,this.indexArray=new T,this.segments=new Ls,this.collisionVertexArray=new Go,this.collisionVertexArrayExt=new Lr}upload(p){this.layoutVertexBuffer=p.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=p.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=p.createVertexBuffer(this.collisionVertexArray,B_r.members,true),this.collisionVertexBufferExt=p.createVertexBuffer(this.collisionVertexArrayExt,z_r.members,true)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.destroy())}}li(R5e,"CollisionBuffers");class ble{constructor(p){this.collisionBoxArray=p.collisionBoxArray,this.zoom=p.zoom,this.overscaling=p.overscaling,this.layers=p.layers,this.layerIds=this.layers.map(M=>M.fqid),this.index=p.index,this.pixelRatio=p.pixelRatio,this.sourceLayerIndex=p.sourceLayerIndex,this.hasPattern=false,this.hasRTLText=false,this.fullyClipped=false,this.hasAnyIconTextFit=false,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=_([]),this.placementViewportMatrix=_([]);const y=this.layers[0]._unevaluatedLayout._values;this.worldview=p.worldview,this.localizable=p.localizable,this.maxUniformBufferBindings=p.maxUniformBufferBindings,this.maxUniformBlockSizeDwords=p.maxUniformBlockSizeDwords,this.textSizeData=W7(this.zoom,y["text-size"],this.worldview,p.availableImages),this.iconSizeData=W7(this.zoom,y["icon-size"],this.worldview,p.availableImages);const T=this.layers[0].layout,S=T.get("symbol-sort-key"),R=T.get("symbol-z-order");this.lut=p.lut,this.canOverlap=T.get("text-allow-overlap")||T.get("icon-allow-overlap")||T.get("text-ignore-placement")||T.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==R&&void 0!==S.constantOr(1),this.sortFeaturesByY=("viewport-y"===R||"auto"===R&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=T.get("text-writing-mode").map(M=>wA[M]),this.stateDependentLayerIds=this.layers.filter(M=>M.isStateDependent()).map(M=>M.id),this.sourceID=p.sourceID,this.projection=p.projection,this.hasAnyZOffset=false,this.zOffsetSortDirty=false,this.zOffsetBuffersNeedUpload=false,this.elevationType="none",this.activeReplacements=[],this.replacementUpdateTime=0,this.hasAnySecondaryIcon=false,this.hasAppearances=null,this.featureAppearances=null,this.featureAppearanceData=new Map}hasAnyAppearanceLayoutProperty(p){const y=this.layers[0].getAppearances();if(!y||0===y.length)return false;const T=Array.isArray(p)?p:[p];return y.some(S=>T.some(R=>S.hasLayoutProperty(R)))}getAppearanceFeatureData(p){return this.featureAppearanceData.get(p)}createArrays(){this.text=new k5e(new yT(this.layers,{zoom:this.zoom,lut:this.lut},p=>p.startsWith("text")||p.startsWith("symbol"))),this.icon=new k5e(new yT(this.layers,{zoom:this.zoom,lut:this.lut},p=>p.startsWith("icon")||p.startsWith("symbol"))),this.text.uboBinder=new a5e(this.layers[0],this.zoom,this.lut,true,"",this.maxUniformBufferBindings,this.maxUniformBlockSizeDwords),this.icon.uboBinder=new a5e(this.layers[0],this.zoom,this.lut,false,"",this.maxUniformBufferBindings,this.maxUniformBlockSizeDwords),this.glyphOffsetArray=new t1,this.lineVertexArray=new $s,this.symbolInstances=new gp}calculateGlyphDependencies(p,y,T,S,R){for(const M of p){const F=M.codePointAt(0);if(void 0===F)break;if(y[F]=true,S&&R&&F<=65535){const G=Lq[M];G&&(y[G.charCodeAt(0)]=true)}}}calculateEffectiveAppearanceIconSize(p,y,T,S,R,M,F){if(!p.hasLayoutProperty("icon-size"))return F*M;let G=1;const q=p.getUnevaluatedLayoutProperty("icon-size"),Q=W7(this.zoom,q,this.worldview,R),ie=m4(Q,y);if("constant"!==Q.kind&&"camera"!==Q.kind||(G=ie.uSize),"composite"===Q.kind){const{minZoom:ae,maxZoom:de}=Q,pe=q.possiblyEvaluate(new Rl(ae,{worldview:this.worldview}),S),_e=q.possiblyEvaluate(new Rl(de,{worldview:this.worldview}),S),Se=pe.evaluate(T,{},S,R);G=Se+(_e.evaluate(T,{},S,R)-Se)*ie.uSizeT}return"source"===Q.kind&&(G=q.possiblyEvaluate(new Rl(this.zoom,{worldview:this.worldview}),S).evaluate(T,{},S,R)),G*M}updateFootprints(p,y){}updateReplacement(p,y){if(y.updateTime===this.replacementUpdateTime)return false;this.replacementUpdateTime=y.updateTime;const T=y.getReplacementRegionsForTile(p.toUnwrapped(),true);return!lle(this.activeReplacements,T)&&(this.activeReplacements=T,true)}getResolvedImageFromTokens(p){return"string"==typeof p?Ah.build(p):p}populate(p,y,T,S){const R=this.layers[0],M=R.layout,F="globe"===this.projection.name,G=M.get("text-font"),q=M.get("text-field"),Q=M.get("icon-image"),[ie,ae]=M.get("icon-size-scale-range"),de=bn(y.scaleFactor||1,ie,ae),[pe,_e]=M.get("text-size-scale-range"),Se=bn(y.scaleFactor||1,pe,_e),Fe=("constant"!==q.value.kind||q.value.value instanceof yd&&!q.value.value.isEmpty()||q.value.value.toString().length>0)&&("constant"!==G.value.kind||G.value.value.length>0),Ye="constant"!==Q.value.kind||!!Q.value.value||Object.keys(Q.parameters).length>0,Xe=this.hasAnyAppearanceLayoutProperty("icon-image"),We=M.get("symbol-sort-key");if(this.features=[],this.featureAppearanceData=new Map,!Fe&&!Ye&&!Xe)return;const rt=y.iconDependencies,lt=y.glyphDependencies,Bt=y.availableImages,ht=new Rl(this.zoom,{worldview:this.worldview,activeFloors:y.activeFloors}),Tt=Lt=>{const Nt=Lt.id.toString();rt.has(Nt)?rt.get(Nt).push(Lt):rt.set(Nt,[Lt])};for(const Lt of p){const{feature:Nt,id:un,index:_n,sourceLayerIndex:Dn}=Lt,Ln=R._featureFilter.needGeometry,zn=It(Nt,Ln);if(!R._featureFilter.filter(ht,zn,T))continue;if(Ln||(zn.geometry=vt(Nt,T,S)),F&&1!==Nt.type&&T.z<=5){const Hn=zn.geometry,ur=.98078528056,pr=(ni,Cr)=>mt(Dq(ni.x,ni.y,T,1),Dq(Cr.x,Cr.y,T,1)){if(!Hn.getLayoutProperty("icon-image"))return;const{iconPrimary:ur,iconSecondary:pr}=this.getCombinedIconVariants(Hn,En,zn,T,Bt,qn,de);ur&&(Tt(ur),pr&&(this.hasAnySecondaryIcon=true,Tt(pr)))}),or){const Hn=G.evaluate(zn,{},T).join(","),ur="map"===M.get("text-rotation-alignment")&&"point"!==M.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.includes(wA.vertical);for(const pr of or.sections)if(pr.image){const ni=pr.image.getPrimary().scaleSelf(this.pixelRatio*Se),Cr=ni.id.toString(),Fr=rt.get(Cr)||[];Fr.push(ni),rt.set(Cr,Fr)}else{const ni=Cse(or.toString()),Cr=pr.fontStack||Hn,Fr=lt[Cr]=lt[Cr]||{};this.calculateGlyphDependencies(pr.text,Fr,ur,this.allowVerticalPlacement,ni)}}}"line"===M.get("symbol-placement")&&(this.features=function(Lt){const Nt={},un={},_n=[];let Dn=0;function Ln(En){_n.push(Lt[En]),Dn++}function zn(En,In,Gn){const qn=un[En];return delete un[En],un[In]=qn,_n[qn].geometry[0].pop(),_n[qn].geometry[0]=_n[qn].geometry[0].concat(Gn[0]),qn}function or(En,In,Gn){const qn=Nt[In];return delete Nt[In],Nt[En]=qn,_n[qn].geometry[0].shift(),_n[qn].geometry[0]=Gn[0].concat(_n[qn].geometry[0]),qn}function nn(En,In,Gn){const qn=Gn?In[0].at(-1):In[0][0];return`${En}:${qn.x}:${qn.y}`}for(let En=0;En1){Ln(En);continue}const Zn=nn(qn,Gn,false),Hn=nn(qn,Gn,true);if(Zn in un&&Hn in Nt&&un[Zn]!==Nt[Hn]){const ur=or(Zn,Hn,Gn),pr=zn(Zn,Hn,_n[ur].geometry);delete Nt[Zn],delete un[Hn],un[nn(qn,_n[pr].geometry,true)]=pr,_n[ur].geometry=null}else Zn in un?zn(Zn,Hn,Gn):Hn in Nt?or(Zn,Hn,Gn):(Ln(En),Nt[Zn]=Dn-1,un[Hn]=Dn-1)}return _n.filter(En=>En.geometry)}(this.features)),"hd-road-markup"===M.get("symbol-elevation-reference")?(this.elevationType="road",this.hdExt&&(this.hdExt.configureCrossSource(T,y.elevationParams,y.crossSourceElevationEnabled,y.terrainEnabled),y.elevationFeatures&&y.elevationFeatures.length>0&&this.hdExt.addElevationFeatures(y.elevationFeatures,T))):M.get("symbol-z-elevate")&&(this.elevationType="offset"),"none"!==this.elevationType&&(this.zOffsetBuffersNeedUpload=true),this.sortFeaturesByKey&&this.features.sort((Lt,Nt)=>Lt.sortKey-Nt.sortKey)}getCombinedIconVariants(p,y,T,S,R,M,F){let G;if(p.hasLayoutProperty("icon-image")){const q=y.getAppearanceValueAndResolveTokens(p,"icon-image",T,S,R);G=this.getResolvedImageFromTokens(q)}else{const q=y.getValueAndResolveTokens("icon-image",T,S,R);G=this.getResolvedImageFromTokens(q)}if(G){const q=p.hasLayoutProperty("icon-size")?p.getUnevaluatedLayoutProperty("icon-size"):y._unevaluatedLayout._values["icon-size"],Q=W7(this.zoom,q,this.worldview,R),{iconPrimary:ie,iconSecondary:ae}=s5e(G,Q,q,S,this.zoom,M,this.pixelRatio,F,this.worldview,R);return{iconPrimary:ie,iconSecondary:ae}}return{iconPrimary:void 0,iconSecondary:void 0}}getCombinedIconPrimary(p,y,T,S,R,M,F){return this.getCombinedIconVariants(p,y,T,S,R,M,F).iconPrimary}updateSymbolInstanceIconVertices(p,y,T,S,R,M){const{canonical:F,availableImages:G,globalProperties:q,layer:Q,iconScaleFactor:ie,featureState:ae,layoutIconOffset:de,layoutIconSize:pe,layoutIconRotate:_e}=M;if(p.placedIconSymbolIndex<0)return{vertexOffsetDelta:0,hasChanges:false};if(y.activeAppearanceIndex===T)return{vertexOffsetDelta:p.numIconVertices,hasChanges:false};const Se=T>=0?Q.appearances[T]:null;if(Se){const Fe={sortKey:void 0,text:void 0,icon:null,index:p.featureIndex,sourceLayerIndex:p.featureIndex,geometry:[],properties:y.properties,type:"Point",id:y.id},{iconPrimary:Ye,iconSecondary:Xe}=this.getCombinedIconVariants(Se,Q,S,F,G,Fe,ie);if(!Ye)return{vertexOffsetDelta:0,hasChanges:false};const We=Ye.toString(),rt=this.iconAtlasPositions&&this.iconAtlasPositions.get(We);if(rt){const{appearanceIconOffset:lt,appearanceIconRotate:Bt}=Z_t(Se,Q,S,F,de,_e,pe,ie),ht=Q.layout.get("icon-anchor").evaluate(S,ae,F);let Tt=j_t(rt,Xe?this.iconAtlasPositions&&this.iconAtlasPositions.get(Xe.toString()):void 0,lt,ht);const Lt=rt.sdf,Nt=Q.layout.get("icon-text-fit").constantOr("none");"none"!==Nt&&y.textShaping&&y.iconTextFitPadding&&y.fontScale&&(Tt=K_t(Tt,y.textShaping,Nt,y.iconTextFitPadding,lt,y.fontScale));const un=this.calculateEffectiveAppearanceIconSize(Se,q.zoom,S,F,G,ie,pe),_n=0,Dn=1+(Math.min(g4,Math.round(un*vI))<<1),Ln=FTt(Tt,Bt,Lt,"none"!==Nt,ie),zn=this.icon.iconTransitioningVertexArray.length>0;y.isUsingAppearanceIconVertexData||(y.isUsingAppearanceIconVertexData=true,y.layoutBasedIconVertexData=this.icon.snapshotSymbolVertexData(R,p.numIconVertices),zn&&(y.layoutBasedIconTransitioningVertexData=this.icon.snapshotIconTransitioningVertexData(R,p.numIconVertices)));const or=Math.floor(p.numIconVertices/4),nn=Math.min(Ln.length,or);let En=R;const In=zn?this.icon.iconTransitioningVertexArray.uint16:null;for(let qn=0;qn0||p.numVerticalGlyphVertices>0;if(!We)return{vertexOffsetDelta:We?p.numHorizontalGlyphVertices+p.numVerticalGlyphVertices:0,hasChanges:false};if(y.activeAppearanceIndex===T)return{vertexOffsetDelta:p.numHorizontalGlyphVertices+p.numVerticalGlyphVertices,hasChanges:false};const rt=T>=0?G.appearances[T]:null;if(rt&&y.textShaping){const{appearanceTextOffset:lt,appearanceTextRotate:Bt,appearanceTextSize:ht}=J_t(rt,G,S,F,ae,pe,de);y.fontScale=eTt(ht,y.textScaleFactor);const Tt=rt.getUnevaluatedLayoutProperty("text-size");let Lt=this.textSizeData,Nt=Fe,un=Ye;rt.hasLayoutProperty("text-size")&&(Lt=W7(this.zoom,Tt,this.worldview,Xe),Nt="composite"===this.textSizeData.kind?this.textSizeData.minZoom:0,un="composite"===this.textSizeData.kind?this.textSizeData.maxZoom:0);const _n=y.textShaping.bottom-ae[1],Dn=y.textShaping.left-ae[0],Ln=y.textShaping.right-ae[0];y.textShaping.top=lt[1]+(y.textShaping.top-ae[1]),y.textShaping.bottom=lt[1]+_n,y.textShaping.left=lt[0]+Dn,y.textShaping.right=lt[0]+Ln;const zn=BTt(0,y.textShaping,lt,G,false,S,Q,this.allowVerticalPlacement,Bt),or=ht&&"composite"===Lt.kind?Tt.possiblyEvaluate(new Rl(Nt,{}),F).evaluate(S,ie,F):_e,nn=ht&&"composite"===Lt.kind?Tt.possiblyEvaluate(new Rl(un,{}),F).evaluate(S,ie,F):Se,En=tTt(rt.name,Lt,ht,q,or,nn),In=Array.isArray(En)?En[1]:ht,Gn=0,qn=1+(Math.min(g4,Math.round(In*vI))<<1);y.isUsingAppearanceTextVertexData||(y.isUsingAppearanceTextVertexData=true,y.layoutBasedTextVertexData=this.text.snapshotSymbolVertexData(R,p.numHorizontalGlyphVertices+p.numVerticalGlyphVertices));for(let Zn=0;Zn0){const q=R[0],Q=[this.text.uboBinder,this.icon.uboBinder].filter(ie=>ie&&ie.hasStateDependentPaint(q));if(Q.length>0){const ie=new Set(Object.keys(p).map(ae=>{const de=Number(ae);return!isNaN(de)&&Number.isSafeInteger(de)&&String(de)===ae?de:ae}));for(const ae of Q)ae.updateFeatures(ie,q,y,G,T,p,F)}}}}updateZOffset(){const p=(R,M,F)=>{T+=M,T>R.length&&R.resize(T);for(let G=-M;G<0;G++)R.emplace(G+T,F)},y=(R,M,F)=>{S+=M,S>R.length&&R.resize(S);for(let G=-M;G<0;G++)R.emplace(G+S,F)};if(!this.zOffsetBuffersNeedUpload)return;this.zOffsetBuffersNeedUpload=false;let T=0,S=0;for(let R=0;R0;if((F>0||G>0)&&(p(this.text.zOffsetVertexArray,F,Q),p(this.text.zOffsetVertexArray,G,Q)),ie){const{placedIconSymbolIndex:ae,verticalPlacedIconSymbolIndex:de}=M;ae>=0&&y(this.icon.zOffsetVertexArray,q,Q),de>=0&&y(this.icon.zOffsetVertexArray,M.numVerticalIconVertices,Q)}}this.text.zOffsetVertexBuffer&&this.text.zOffsetVertexBuffer.updateData(this.text.zOffsetVertexArray),this.icon.zOffsetVertexBuffer&&this.icon.zOffsetVertexBuffer.updateData(this.icon.zOffsetVertexArray)}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(p,y,T,S,R){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(p),this.iconCollisionBox.upload(p)),this.text.upload(p,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload,this.zOffsetBuffersNeedUpload,this.hasAppearances),null===this.hasAppearances&&(this.hasAppearances=this.layers.some(M=>M.appearances&&M.appearances.length>0)),this.icon.upload(p,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload,this.zOffsetBuffersNeedUpload,this.hasAppearances),this.uploaded=true}updateAppearances(p,y,T,S,R,M=false){const F={hasLayoutChanges:false,hasUboChanges:false};if(!p||!T||!this.featureAppearanceData)return F;const G=y||{},q=this.icon.layoutVertexArray&&this.icon.layoutVertexArray.length>0&&this.icon.layoutVertexArray.arrayBuffer,Q=this.text.layoutVertexArray&&this.text.layoutVertexArray.length>0&&this.text.layoutVertexArray.arrayBuffer;if(!q&&!Q)return F;const ie=this.layers[0],ae=ie.layout;this.featureAppearances&&this.featureAppearances.appearancesVersion===ie.appearancesVersion||(this.featureAppearances=new ATr(ie.appearances,ie.appearancesVersion));const de=this.featureAppearances.update(S,M);if("no-changes"===de.kind)return F;let pe=1,_e=0,Se=false,Fe=false;if(q){const[Bt,ht]=ae.get("icon-size-scale-range");pe=bn(1,Bt,ht)}let Ye=1,Xe=0,We=false;if(Q){const[Bt,ht]=ae.get("text-size-scale-range");Ye=bn(1,Bt,ht)}const rt=new Map;if(R&&T)for(const Bt of T){const ht=R.getImage(Bt,ie.scope);if(ht){const Tt=new ay(Bt.toString());rt.set(Tt.toString(),ht)}}const lt=[this.text.uboBinder,this.icon.uboBinder];for(let Bt=0;Btzn.isActive({globals:S,feature:un,canonical:p,featureState:Nt})):-1;_n=Ln>=0?Ln:-1}const Dn=Tt.activeAppearanceIndex!==_n;if(Q){const Ln=ae.get("text-size"),zn="composite"===this.textSizeData.kind?this.textSizeData.minZoom:0,or="composite"===this.textSizeData.kind?this.textSizeData.maxZoom:0,nn={canonical:p,layer:ie,featureState:Nt,availableImages:T,textScaleFactor:Ye,imageMap:rt,layoutTextOffset:ae.get("text-offset").evaluate(un,Nt,p).map(In=>In*H7),layoutTextSize:Ln.evaluate(un,Nt,p),layoutTextRotate:ae.get("text-rotate").evaluate(un,Nt,p),layoutMinZoomSize:Ln.evaluate(un,{zoom:zn},p),layoutMaxZoomSize:Ln.evaluate(un,{zoom:or},p),layoutTextSizeMinZoom:zn,layoutTextSizeMaxZoom:or},En=this.updateSymbolInstanceTextVertices(ht,Tt,_n,un,Xe,nn);Xe+=En.vertexOffsetDelta,We=We||En.hasChanges}if(q){const Ln={canonical:p,layer:ie,featureState:Nt,availableImages:T,globalProperties:S,iconScaleFactor:pe,layoutIconOffset:ae.get("icon-offset").evaluate(un,Nt,p),layoutIconSize:ae.get("icon-size").evaluate(un,Nt,p,T),layoutIconRotate:ae.get("icon-rotate").evaluate(un,Nt,p)},zn=this.updateSymbolInstanceIconVertices(ht,Tt,_n,un,_e,Ln);_e+=zn.vertexOffsetDelta,Se=Se||zn.hasChanges}if(Dn){const Ln=ht.featureIndex,zn=S?S.brightness:null,or=Nt||{},nn=_n>=0?ie.appearances[_n]:null;for(const En of lt)En&&(En.layer=ie,Fe=En.updateFeaturePaintForAppearance(Ln,un,or,p,T,zn,nn)||Fe)}Tt.activeAppearanceIndex=_n}return Se&&this.icon.layoutVertexBuffer&&null!==this.icon.layoutVertexArray.arrayBuffer&&this.icon.layoutVertexArray.length===this.icon.layoutVertexBuffer.length&&this.icon.layoutVertexBuffer.updateData(this.icon.layoutVertexArray),Se&&this.icon.iconTransitioningVertexBuffer&&this.icon.iconTransitioningVertexArray.length>0&&this.icon.iconTransitioningVertexArray.length===this.icon.iconTransitioningVertexBuffer.length&&this.icon.iconTransitioningVertexBuffer.updateData(this.icon.iconTransitioningVertexArray),We&&this.text.layoutVertexBuffer&&null!==this.text.layoutVertexArray.arrayBuffer&&this.text.layoutVertexArray.length===this.text.layoutVertexBuffer.length&&this.text.layoutVertexBuffer.updateData(this.text.layoutVertexArray),{hasLayoutChanges:Se||We,hasUboChanges:Fe}}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}getProjection(){return this.projectionInstance||(this.projectionInstance=ale(this.projection)),this.projectionInstance}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(p,y){const T=this.lineVertexArray.length;if(void 0!==p.segment)for(const{x:S,y:R}of y)this.lineVertexArray.emplaceBack(S,R);return{lineStartIndex:T,lineLength:this.lineVertexArray.length-T}}addSymbols(p,y,T,S,R,M,F,G,q,Q,ie,ae,de,pe,_e,Se,Fe,Ye){const Xe=p.indexArray,We=p.layoutVertexArray,rt=p.globeExtVertexArray,lt=Ye,Bt=p.uboBinder?p.uboBinder.getCurrentBatchIndex():void 0,ht=p.segments.prepareSegment(4*lt,We,Xe,this.canOverlap?M.sortKey:void 0,Bt),Tt=this.glyphOffsetArray.length,Lt=ht.vertexLength,Nt=this.allowVerticalPlacement&&F===wA.vertical?Math.PI/2:0,un=M.text&&M.text.sections;let _n=We.length,Dn=-1;for(let or=0;or=0)){const or=4*Ln;for(let nn=0;nn=0?y.rightJustifiedTextSymbolIndex:y.centerJustifiedTextSymbolIndex>=0?y.centerJustifiedTextSymbolIndex:y.leftJustifiedTextSymbolIndex>=0?y.leftJustifiedTextSymbolIndex:y.verticalPlacedTextSymbolIndex>=0?y.verticalPlacedTextSymbolIndex:S),M=jse(this.textSizeData,p,R)/H7;return this.tilePixelRatio*M}getSymbolInstanceIconSize(p,y,T){const S=this.icon.placedSymbolArray.get(T),R=jse(this.iconSizeData,p,S);return this.tilePixelRatio*R}_commitDebugCollisionVertexUpdate(p,y,T,S){p.emplaceBack(y,-T,-T,S),p.emplaceBack(y,T,-T,S),p.emplaceBack(y,T,T,S),p.emplaceBack(y,-T,T,S)}_updateTextDebugCollisionBoxes(p,y,T,S,R,M,F){for(let G=S;G0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}hasIconTextFit(){return this.hasAnyIconTextFit}addIndicesForPlacedSymbol(p,y){const T=p.placedSymbolArray.get(y),S=T.vertexStartIndex+4*T.numGlyphs;for(let R=T.vertexStartIndex;RS[F]-S[G]||R[G]-R[F]),M}getSortedIndexesByZOffset(){if(!this.zOffsetSortDirty)return this.symbolInstanceIndexesSortedZOffset;if(!this.symbolInstanceIndexesSortedZOffset){this.symbolInstanceIndexesSortedZOffset=[];for(let p=0;pthis.symbolInstances.get(y).zOffset-this.symbolInstances.get(p).zOffset)}addToSortKeyRanges(p,y){const T=this.sortKeyRanges.at(-1);T&&T.sortKey===y?T.symbolInstanceEnd=p+1:this.sortKeyRanges.push({sortKey:y,symbolInstanceStart:p,symbolInstanceEnd:p+1})}sortFeatures(p){if(this.sortFeaturesByY&&this.sortedAngle!==p)if(this.text.segments.get().length>1||this.icon.segments.get().length>1)this.sortFeaturesByY=false;else{this.symbolInstanceIndexes=this.getSortedSymbolIndexes(p),this.sortedAngle=p,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const y of this.symbolInstanceIndexes){const T=this.symbolInstances.get(y);this.featureSortOrder.push(T.featureIndex);const{rightJustifiedTextSymbolIndex:S,centerJustifiedTextSymbolIndex:R,leftJustifiedTextSymbolIndex:M,verticalPlacedTextSymbolIndex:F,placedIconSymbolIndex:G,verticalPlacedIconSymbolIndex:q}=T;S>=0&&this.addIndicesForPlacedSymbol(this.text,S),R>=0&&R!==S&&this.addIndicesForPlacedSymbol(this.text,R),M>=0&&M!==R&&M!==S&&this.addIndicesForPlacedSymbol(this.text,M),F>=0&&this.addIndicesForPlacedSymbol(this.text,F),G>=0&&this.addIndicesForPlacedSymbol(this.icon,G),q>=0&&this.addIndicesForPlacedSymbol(this.icon,q)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}li(ble,"SymbolBucket",{omit:["layers","collisionBoxArray","compareText","features"]}),ble.addDynamicAttributes=y4;class zTt extends YOe{constructor(p,y,T){super(p,y,T),this.elevatedLayoutVertexArray=new Wn}upload(p){const y=this.uploaded;super.upload(p),!y&&this.elevatedLayoutVertexArray.length>0&&(this.elevatedLayoutVertexBuffer=p.createVertexBuffer(this.elevatedLayoutVertexArray,kh.members))}destroy(){this.elevatedLayoutVertexBuffer&&this.elevatedLayoutVertexBuffer.destroy(),super.destroy()}}li(zTt,"ElevatedFillBufferData");class AA{constructor(){this.portals=[]}static isOnBorder(p,y){return p<=0&&y<=0||p>=qr&&y>=qr}static evaluate(p){if(0===p.length)return new AA;let y=[];for(const G of p)y.push(...G.portals);if(0===y.length)return new AA;for(const G of y){const q=G.va,Q=G.vb;(AA.isOnBorder(q.x,Q.x)||AA.isOnBorder(q.y,Q.y))&&(G.type="border")}const T=y.filter(G=>"unevaluated"!==G.type),S=y.filter(G=>"unevaluated"===G.type);if(0===S.length)return new AA;S.sort((G,q)=>G.hash===q.hash?G.isTunnel===q.isTunnel?0:G.isTunnel?-1:1:G.hashG.hash"fill-tunnel-structure-color"!==R),this.tunnelProgramConfigurations=new yT(y,{zoom:T,lut:S},R=>"fill-bridge-guard-rail-color"!==R)}addVertices(p,y){const T=this.unevalVertices.length;for(let S=0;S=R.min.x&&ie.x<=R.max.x&&ie.y>=R.min.y&&ie.y<=R.max.y||ae.x>=R.min.x&&ae.x<=R.max.x&&ae.y>=R.min.y&&ae.y<=R.max.y||V7(ie,ae,F)))continue;if(this.isOnBorder(ie.x,ae.x)||this.isOnBorder(ie.y,ae.y))continue;const de=m0.computeEdgeHash(this.unevalVertices[q],this.unevalVertices[Q]);let pe,_e=this.vertexHashLookup.get(m0.computePosHash(ie));null!=_e?pe=_e.next:(_e=this.vertexHashLookup.get(m0.computePosHash(ae)),pe=null!=_e?_e.prev:de),this.unevalEdges.push({polygonIdx:p,a:q,b:Q,hash:de,portalHash:pe,isTunnel:S,type:"unevaluated",featureInfo:M})}}addPortalCandidates(p,y,T,S,R){if(0!==y.length){this.vertexHashLookup.clear();for(const M of y){if(0===M.length)continue;const F=M[0];let G=m0.computeEdgeHash(F[F.length-2],F.at(-1));for(let q=0;q({vertexOffset:0,primitiveOffset:this.indexArray.length}),T=ae=>{ae.primitiveLength=this.indexArray.length-ae.primitiveOffset},S=new ITr(this.vertexPositions,this.vertexNormals,this.indexArray);this.prepareEdges(p.portals,this.unevalEdges);const R=y(),M=y(),F=y(),G=(ae,de)=>{ae.sort((_e,Se)=>_e.type===de&&Se.type!==de?-1:_e.type!==de&&Se.type===de?1:0);const pe=ae.findIndex(_e=>_e.type!==de);return pe>=0?pe:ae.length};let q=0;this.unevalEdges.length>0&&(q=G(this.unevalEdges,"none"),this.constructBridgeStructures(S,this.unevalVertices,this.unevalHeights,this.unevalEdges,{min:0,max:q},this.tileToMeters)),T(F);const Q=y(),ie=y();if(this.unevalEdges.length>0){const ae=this.unevalEdges.splice(q),de=G(ae,"tunnel")+q;this.unevalEdges.push(...ae),this.constructTunnelStructures(S,this.unevalVertices,this.unevalHeights,this.unevalEdges,{min:0,max:q},{min:q,max:de})}T(Q),S.addTriangles(this.unevalTriangles,this.unevalVertices,this.unevalHeights),T(ie),S.addTriangles(this.unevalTunnelTriangles,this.unevalVertices,this.unevalHeights),T(M),S.addTriangles(this.unevalTunnelTriangles,this.unevalVertices,this.unevalHeights,4),T(R),this.maskSegments=Ls.simpleSegment(0,ie.primitiveOffset,0,ie.primitiveLength),this.depthSegments=Ls.simpleSegment(0,M.primitiveOffset,0,M.primitiveLength),this.renderableBridgeSegments=Ls.simpleSegment(0,F.primitiveOffset,0,F.primitiveLength),this.renderableTunnelSegments=Ls.simpleSegment(0,Q.primitiveOffset,0,Q.primitiveLength),this.shadowCasterSegments=Ls.simpleSegment(0,R.primitiveOffset,0,R.primitiveLength)}update(p,y,T,S,R,M,F,G){this.bridgeProgramConfigurations.updatePaintArrays(p,y,R,T,S,M,F,G),this.tunnelProgramConfigurations.updatePaintArrays(p,y,R,T,S,M,F,G)}upload(p){this.vertexBuffer||0===this.vertexPositions.length||0===this.vertexNormals.length||0===this.indexArray.length||(this.vertexBuffer=p.createVertexBuffer(this.vertexPositions,ng.members),this.vertexBufferNormal=p.createVertexBuffer(this.vertexNormals,n1.members),this.indexBuffer=p.createIndexBuffer(this.indexArray),this.bridgeProgramConfigurations.upload(p),this.tunnelProgramConfigurations.upload(p))}destroy(){this.vertexBuffer&&(this.vertexBuffer.destroy(),this.vertexBufferNormal.destroy(),this.indexBuffer.destroy()),this.maskSegments&&(this.maskSegments.destroy(),this.depthSegments.destroy(),this.renderableBridgeSegments.destroy(),this.renderableTunnelSegments.destroy(),this.shadowCasterSegments.destroy()),this.bridgeProgramConfigurations.destroy(),this.tunnelProgramConfigurations.destroy()}populatePaintArrays(p,y,T,S,R){const M=(F,G)=>{for(let q=0;que(Ln,y[zn].x,y[zn].y,T[zn]*G),ie=oe(),ae=oe(),de=oe(),pe=oe(),_e=oe(),Se=(Ln,zn)=>{const or=F.get(m0.computePosHash(y[zn])),nn=or.from,En=or.to;if(!nn||!En)return;Q(ie,nn),Q(ae,zn),Q(de,En),Je(pe),Te(ie,ae)||(we(_e,ae,ie),yt(pe,_e)),Te(de,ae)||(we(_e,de,ae),xe(pe,pe,yt(_e,_e)));const In=Be(pe);return In>0?ge(Ln,pe,1/In):void 0};let Fe=Number.POSITIVE_INFINITY;this.sortSubarray(S,R.min,R.max,(Ln,zn)=>Ln.featureInfo.featureIndex-zn.featureInfo.featureIndex);const Ye=oe(),Xe=oe(),We=oe(),rt=oe(),lt=oe(),Bt=oe(),ht=oe(),Tt=oe(),Lt=oe(),Nt=[oe(),oe(),oe(),oe()],un=[oe(),oe(),oe(),oe()],_n=[{coord:new nt(0,0),height:0},{coord:new nt(0,0),height:0}],Dn=(Ln,zn)=>Ln>zn;for(let Ln=R.min;LnFe.featureInfo.featureIndex-Ye.featureInfo.featureIndex;this.sortSubarray(S,R.min,R.max,G),this.sortSubarray(S,M.min,M.max,G);const q=Fe=>yt(Fe,Fe),Q=[{coord:new nt(0,0),height:0},{coord:new nt(0,0),height:0}],ie=(Fe,Ye)=>FeF.hash===G.hash?G.polygonIdx-F.polygonIdx:G.hash>F.hash?1:-1);let T=0,S=0,R=0,M=y[T].polygonIdx;do{S++,(S===y.length||y[T].hash!==y[S].hash)&&((1===S-T||y[S-1].polygonIdx!==M)&&(Rq.portalHashQ.hash?F++:Q.hash>q.portalHash?G++:(q.type=Q.type,F++)}}}isOnBorder(p,y){return p<=0&&y<=0||p>=qr&&y>=qr}addFeatureSection(p,y,T,S){return p!==y&&(y=p,T.push({featureIndex:p,vertexStart:S.getVertexCount()}),S.clearVertexLookup()),y}sortSubarray(p,y,T,S){const R=p.slice(y,T);R.sort(S),p.splice(y,R.length,...R)}static computeEdgeHash(p,y){return(p.y===y.y&&p.x>y.x||p.y>y.y)&&([p,y]=[y,p]),BigInt(m0.computePosHash(p))<<32n|BigInt(m0.computePosHash(y))}static computePosHash(p){return((65535&p.x)<<16|65535&p.y)>>>0}}class MTr{constructor(){this._valid=false}reset(p){return this.feature=p,this._valid=true,this._geometry=p.loadGeometry(),0!==this._geometry.length&&0!==this._geometry[0].length||(this._valid=false),this}geometry(p,y){return this._valid&&p(y(this._geometry)),this}require(p,y,T){return this.get(p,true,y,T)}optional(p,y,T){return this.get(p,false,y,T)}success(){return this._valid}get(p,y,T,S){const R=Object.hasOwn(this.feature.properties,p)?+this.feature.properties[p]:void 0;return this._valid&&void 0!==R&&!Number.isNaN(R)?T(S?S(R):R):y&&(this._valid=false),this}}class UTt{constructor(p,y){this.featureFunc=p,this.vertexFunc=y}parseFeature(p,y,T){return this.featureFunc(p,y,T)}parseVertex(p,y,T){return this.vertexFunc(p,y,T)}}const LTr=new UTt((b,p,y)=>b.reset(p).require(TA,T=>{y.id=T}).optional("fixed_height_relative",T=>{y.constantHeight=T},kA.decodeRelativeHeight).geometry(T=>{y.bounds=T},ft).success(),(b,p,y)=>b.reset(p).require(TA,T=>{y.id=T}).require("elevation_idx",T=>{y.idx=T}).require("extent",T=>{y.extent=T}).require("height_relative",T=>{y.height=T},kA.decodeRelativeHeight).geometry(T=>{y.position=T},kA.getPoint).success()),DTr=new UTt((b,p,y)=>b.reset(p).require(TA,T=>{y.id=T}).optional("fixed_height",T=>{y.constantHeight=T},kA.decodeMetricHeight).geometry(T=>{y.bounds=T},ft).success(),(b,p,y)=>b.reset(p).require(TA,T=>{y.id=T}).require("elevation_idx",T=>{y.idx=T}).require("extent",T=>{y.extent=T}).require("height",T=>{y.height=T},kA.decodeMetricHeight).geometry(T=>{y.position=T},kA.getPoint).success());class kA{static getPoint(p){return mn(p[0][0].x,p[0][0].y)}static decodeRelativeHeight(p){return 1e-4*p*5}static decodeMetricHeight(p){return 1e-4*p}static getVersionSchema(p){return p?"1.0.1"===p?DTr:void 0:LTr}static parse(p){const y=[],T=[],S=p.length,R=new MTr;for(let M=0;M{return F.a0?ge(G,G,1/q):ue(G,0,0,1)}getSafeArea(){return this.safeArea}isTunnel(){return this.heightRange.max<=-5}getClosestEdge(p){if(0===this.edges.length)return;let y=0,T=Number.POSITIVE_INFINITY,S=0;const[R,M,F,G,q,Q,ie]=FTr;At(ie,p.x,p.y);const ae=new K_r(ie,null);for(let de=0;de0?Er(G,F)/We:0,lt=bn(rt,0,1),Bt=Math.abs((rt-lt)*this.edgeProps[de].len);on(q,ie,Se),At(Q,_e[1],-_e[0]);const ht=Bt+Math.abs(Er(q,Q));ht=0;--M){const F=this.edges[M].a,G=this.edges[M].b,{position:q,height:Q,extent:ie}=this.vertices[F],{position:ae,height:de,extent:pe}=this.vertices[G],_e=this.vertexProps[F].dir,Se=this.vertexProps[G].dir;if(ue(y,q[0]/p,q[1]/p,Q),ue(T,ae[0]/p,ae[1]/p,de),ue(S,_e[1],-_e[0],0),ge(S,S,ie),ue(R,Se[1],-Se[0],0),ge(R,R,pe),this.distSqLines(ce(y[0]+.5*S[0],y[1]+.5*S[1],y[2]+.5*S[2]),ce(T[0]-.5*R[0],T[1]-.5*R[1],T[2]-.5*R[2]),ce(y[0]-.5*S[0],y[1]-.5*S[1],y[2]-.5*S[2]),ce(T[0]+.5*R[0],T[1]+.5*R[1],T[2]+.5*R[2]))<=.0025000000000000005)continue;const Fe=this.vertices.length,Ye=lr(Kt(),q,ae);this.vertices.push({position:cr(Ye,Ye,.5),height:.5*(Q+de),extent:.5*(ie+pe),index:.5*((void 0!==this.vertices[F].index?this.vertices[F].index:F)+(void 0!==this.vertices[G].index?this.vertices[G].index:G))});const Xe=lr(Kt(),_e,Se);this.vertexProps.push({dir:Mr(Xe,Xe)}),this.edges.splice(M,1),this.edgeProps.splice(M,1),this.edges.push({a:F,b:Fe}),this.edges.push({a:Fe,b:G});const We=on(Kt(),this.vertices[Fe].position,q),rt=Hr(We),lt={vec:We,dir:cr(Kt(),We,1/rt),len:rt};this.edgeProps.push(lt),this.edgeProps.push(lt)}}distSqLines(p,y,T,S){const R=be(oe(),y,p),M=be(oe(),S,T),F=be(oe(),p,T),G=mt(R,R),q=mt(R,M),Q=mt(R,F),ie=mt(M,M),ae=mt(M,F),de=G*ie-q*q;if(0===de)return $e(Ge(R,T,S,mt(F,M)/mt(M,M)),p);const pe=(G*ae-q*Q)/de;return $e(Ge(R,p,y,(q*ae-Q*ie)/de),Ge(M,T,S,pe))}static serialize(p,y){const T={id:p.id,heightRange:{min:p.heightRange.min,max:p.heightRange.max},safeArea:(S=p.safeArea,{min:{x:S.min.x,y:S.min.y},max:{x:S.max.x,y:S.max.y}})};var S;return null!=p.constantHeight?(T.constantHeight=p.constantHeight,T):0===p.vertices.length?(T.vertices=[],T.vertexProps=[],T.edges=[],T.edgeProps=[],T):(T.vertices=p.vertices.map(R=>({position:xle(R.position),height:R.height,extent:R.extent,index:R.index})),T.vertexProps=p.vertexProps.map(R=>({dir:xle(R.dir)})),T.edges=p.edges.map(R=>({a:R.a,b:R.b})),T.edgeProps=p.edgeProps.map(R=>({vec:xle(R.vec),dir:xle(R.dir),len:R.len})),T)}static deserialize(p){const y=function(S){return{min:new nt(S.min.x,S.min.y),max:new nt(S.max.x,S.max.y)}}(p.safeArea);if(null!=p.constantHeight)return new RA(p.id,y,p.constantHeight);if(!p.vertices||0===p.vertices.length){const S=Object.create(RA.prototype);return S.id=p.id,S.constantHeight=void 0,S.heightRange={min:p.heightRange.min,max:p.heightRange.max},S.safeArea=y,S.vertices=[],S.vertexProps=[],S.edges=[],S.edgeProps=[],S}const T=Object.create(RA.prototype);return T.id=p.id,T.constantHeight=void 0,T.heightRange={min:p.heightRange.min,max:p.heightRange.max},T.safeArea=y,T.vertices=p.vertices.map(S=>({position:vle(S.position),height:S.height,extent:S.extent,index:S.index})),T.vertexProps=(p.vertexProps||[]).map(S=>({dir:vle(S.dir)})),T.edges=(p.edges||[]).map(S=>({a:S.a,b:S.b})),T.edgeProps=(p.edgeProps||[]).map(S=>({vec:vle(S.vec),dir:vle(S.dir),len:S.len})),T}}class K7{constructor(p,y){this.zScale=1,this.xOffset=0,this.yOffset=0,p.equals(y)||(this.zScale=Math.pow(2,y.z-p.z),this.xOffset=(p.x*this.zScale-y.x)*qr,this.yOffset=(p.y*this.zScale-y.y)*qr)}pointTransform(p){return mn(p[0]*this.zScale+this.xOffset,p[1]*this.zScale+this.yOffset)}pointTransformInPlace(p){p[0]=p[0]*this.zScale+this.xOffset,p[1]=p[1]*this.zScale+this.yOffset}constantElevation(p,y){if(null!=p.constantHeight)return this.computeBiasedHeight(p.constantHeight,y)}pointElevation(p,y,T){const S=this.constantElevation(y,T);return null!=S?S:(p.x=p.x*this.zScale+this.xOffset,p.y=p.y*this.zScale+this.yOffset,this.computeBiasedHeight(y.pointElevation(p),T))}computeBiasedHeight(p,y){return y<=0?p:p+y*ir(0,y,p>=0?p:Math.abs(.5*p))}}function NTr(b){if(0===b)return[0,0,0];const p=iI(b);return[p(),p(),p()]}function $Tt(b,p){let y=0,T=b.length-1;for(;y<=T;){const S=y+T>>1;b[S].feature.idF.id===S);if(M&&T)return{tileId:T,feature:M}}if(!y||0===y.length)return;const R=$Tt(y,S);if(!(R<0)){if(T){for(let M=R;Mp?1:b0))return y;y=y.left}}return null}contains(p){for(var y=this._root,T=this._compare;y;){var S=T(p,y.key);if(0===S)return true;y=S<0?y.left:y.right}return false}remove(p){var y=this.find(p);if(!y)return false;if(this.splay(y),y.left)if(y.right){var T=this.minNode(y.right);T.parent!==y&&(this.replace(T,T.right),T.right=y.right,T.right.parent=T),this.replace(y,T),T.left=y.left,T.left.parent=T}else this.replace(y,y.left);else this.replace(y,y.right);return this._size--,true}removeNode(p){if(!p)return false;if(this.splay(p),p.left)if(p.right){var y=this.minNode(p.right);y.parent!==p&&(this.replace(y,y.right),y.right=p.right,y.right.parent=y),this.replace(p,y),y.left=p.left,y.left.parent=y}else this.replace(p,p.left);else this.replace(p,p.right);return this._size--,true}erase(p){var y=this.find(p);if(y){this.splay(y);var T=y.left,S=y.right,R=null;T&&(T.parent=null,R=this.maxNode(T),this.splay(R),this._root=R),S&&(T?R.right=S:this._root=S,S.parent=R),this._size--}}pop(){var p=this._root,y=null;if(p){for(;p.left;)p=p.left;y={key:p.key,data:p.data},this.remove(p.key)}return y}next(p){var y=p;if(y)if(y.right)for(y=y.right;y&&y.left;)y=y.left;else for(y=p.parent;y&&y.right===p;)p=y,y=y.parent;return y}prev(p){var y=p;if(y)if(y.left)for(y=y.left;y&&y.right;)y=y.right;else for(y=p.parent;y&&y.left===p;)p=y,y=y.parent;return y}forEach(p){for(var y=this._root,T=[],S=false,R=0;!S;)y?(T.push(y),y=y.left):T.length>0?(p(y=T.pop(),R++),y=y.right):S=true;return this}range(p,y,T,S){const R=[],M=this._compare;let F,G=this._root;for(;0!==R.length||G;)if(G)R.push(G),G=G.left;else{if(G=R.pop(),F=M(G.key,y),F>0)break;if(M(G.key,p)>=0&&T.call(S,G))return this;G=G.right}return this}keys(){for(var p=this._root,y=[],T=[],S=false;!S;)p?(y.push(p),p=p.left):y.length>0?(p=y.pop(),T.push(p.key),p=p.right):S=true;return T}values(){for(var p=this._root,y=[],T=[],S=false;!S;)p?(y.push(p),p=p.left):y.length>0?(p=y.pop(),T.push(p.data),p=p.right):S=true;return T}at(p){for(var y=this._root,T=[],S=false,R=0;!S;)if(y)T.push(y),y=y.left;else if(T.length>0){if(y=T.pop(),R===p)return y;R++,y=y.right}else S=true;return null}load(p=[],y=[],T=false){if(0!==this._size)throw new Error("bulk-load: tree is not empty");const S=p.length;return T&&M5e(p,y,0,S-1,this._compare),this._root=I5e(null,p,y,0,S),this._size=S,this}min(){var p=this.minNode(this._root);return p?p.key:null}max(){var p=this.maxNode(this._root);return p?p.key:null}isEmpty(){return null===this._root}get size(){return this._size}static createTree(p,y,T,S,R){return new P5e(T,R).load(p,y,S)}}function I5e(b,p,y,T,S){const R=S-T;if(R>0){const M=T+Math.floor(R/2),F={key:p[M],data:y[M],parent:b};return F.left=I5e(F,p,y,T,M),F.right=I5e(F,p,y,M+1,S),F}return null}function M5e(b,p,y,T,S){if(y>=T)return;const R=b[y+T>>1];let M=y-1,F=T+1;for(;;){do{M++}while(S(b[M],R)<0);do{F--}while(S(b[F],R)>0);if(M>=F)break;let G=b[M];b[M]=b[F],b[F]=G,G=p[M],p[M]=p[F],p[F]=G}M5e(b,p,y,F,S),M5e(b,p,F+1,T,S)}const GTt=11102230246251565e-32,dy=134217729,BTr=(3+8*GTt)*GTt;function L5e(b,p,y,T,S){let R,M,F,G,q=p[0],Q=T[0],ie=0,ae=0;Q>q==Q>-q?(R=q,q=p[++ie]):(R=Q,Q=T[++ae]);let de=0;if(ieq==Q>-q?(M=q+R,F=R-(M-q),q=p[++ie]):(M=Q+R,F=R-(M-Q),Q=T[++ae]),R=M,0!==F&&(S[de++]=F);ieq==Q>-q?(M=R+q,G=M-R,F=R-(M-G)+(q-G),q=p[++ie]):(M=R+Q,G=M-R,F=R-(M-G)+(Q-G),Q=T[++ae]),R=M,0!==F&&(S[de++]=F);for(;ie0:(T[0]-p[0])*(y[1]-p[1])-(y[0]-p[0])*(T[1]-p[1])>0}isAbove(p){return!this.isBelow(p)}isVertical(){return this.point[0]===this.otherEvent.point[0]}get inResult(){return 0!==this.resultTransition}clone(){const p=new J7(this.point,this.left,this.otherEvent,this.isSubject,this.type);return p.contourId=this.contourId,p.resultTransition=this.resultTransition,p.prevInResult=this.prevInResult,p.isExteriorRing=this.isExteriorRing,p.inOut=this.inOut,p.otherInOut=this.otherInOut,p}}function V2(b,p){return b[0]===p[0]&&b[1]===p[1]}function D5e(b,p,y){const T=function(S,R,M,F,G,q){const Q=(R-q)*(M-G),ie=(S-G)*(F-q),ae=Q-ie;if(0===Q||0===ie||Q>0!=ie>0)return ae;const de=Math.abs(Q+ie);return Math.abs(ae)>=33306690738754716e-32*de?ae:-function(pe,_e,Se,Fe,Ye,Xe,We){let rt,lt,Bt,ht,Tt,Lt,Nt,un,_n,Dn,Ln,zn,or,nn,En,In,Gn,qn;const Zn=pe-Ye,Hn=Se-Ye,ur=_e-Xe,pr=Fe-Xe;nn=Zn*pr,Lt=dy*Zn,Nt=Lt-(Lt-Zn),un=Zn-Nt,Lt=dy*pr,_n=Lt-(Lt-pr),Dn=pr-_n,En=un*Dn-(nn-Nt*_n-un*_n-Nt*Dn),In=ur*Hn,Lt=dy*ur,Nt=Lt-(Lt-ur),un=ur-Nt,Lt=dy*Hn,_n=Lt-(Lt-Hn),Dn=Hn-_n,Gn=un*Dn-(In-Nt*_n-un*_n-Nt*Dn),Ln=En-Gn,Tt=En-Ln,Z7[0]=En-(Ln+Tt)+(Tt-Gn),zn=nn+Ln,Tt=zn-nn,or=nn-(zn-Tt)+(Ln-Tt),Ln=or-In,Tt=or-Ln,Z7[1]=or-(Ln+Tt)+(Tt-In),qn=zn+Ln,Tt=qn-zn,Z7[2]=zn-(qn-Tt)+(Ln-Tt),Z7[3]=qn;let ni=function(no,Ii){let mo=Ii[0];for(let io=1;io<4;io++)mo+=Ii[io];return mo}(0,Z7),Cr=22204460492503146e-32*We;if(ni>=Cr||-ni>=Cr)return ni;if(Tt=pe-Zn,rt=pe-(Zn+Tt)+(Tt-Ye),Tt=Se-Hn,Bt=Se-(Hn+Tt)+(Tt-Ye),Tt=_e-ur,lt=_e-(ur+Tt)+(Tt-Xe),Tt=Fe-pr,ht=Fe-(pr+Tt)+(Tt-Xe),0===rt&&0===lt&&0===Bt&&0===ht)return ni;if(Cr=11093356479670487e-47*We+BTr*Math.abs(ni),ni+=Zn*ht+pr*rt-(ur*Bt+Hn*lt),ni>=Cr||-ni>=Cr)return ni;nn=rt*pr,Lt=dy*rt,Nt=Lt-(Lt-rt),un=rt-Nt,Lt=dy*pr,_n=Lt-(Lt-pr),Dn=pr-_n,En=un*Dn-(nn-Nt*_n-un*_n-Nt*Dn),In=lt*Hn,Lt=dy*lt,Nt=Lt-(Lt-lt),un=lt-Nt,Lt=dy*Hn,_n=Lt-(Lt-Hn),Dn=Hn-_n,Gn=un*Dn-(In-Nt*_n-un*_n-Nt*Dn),Ln=En-Gn,Tt=En-Ln,g0[0]=En-(Ln+Tt)+(Tt-Gn),zn=nn+Ln,Tt=zn-nn,or=nn-(zn-Tt)+(Ln-Tt),Ln=or-In,Tt=or-Ln,g0[1]=or-(Ln+Tt)+(Tt-In),qn=zn+Ln,Tt=qn-zn,g0[2]=zn-(qn-Tt)+(Ln-Tt),g0[3]=qn;const Fr=L5e(4,Z7,4,g0,HTt);nn=Zn*ht,Lt=dy*Zn,Nt=Lt-(Lt-Zn),un=Zn-Nt,Lt=dy*ht,_n=Lt-(Lt-ht),Dn=ht-_n,En=un*Dn-(nn-Nt*_n-un*_n-Nt*Dn),In=ur*Bt,Lt=dy*ur,Nt=Lt-(Lt-ur),un=ur-Nt,Lt=dy*Bt,_n=Lt-(Lt-Bt),Dn=Bt-_n,Gn=un*Dn-(In-Nt*_n-un*_n-Nt*Dn),Ln=En-Gn,Tt=En-Ln,g0[0]=En-(Ln+Tt)+(Tt-Gn),zn=nn+Ln,Tt=zn-nn,or=nn-(zn-Tt)+(Ln-Tt),Ln=or-In,Tt=or-Ln,g0[1]=or-(Ln+Tt)+(Tt-In),qn=zn+Ln,Tt=qn-zn,g0[2]=zn-(qn-Tt)+(Ln-Tt),g0[3]=qn;const Fi=L5e(Fr,HTt,4,g0,WTt);nn=rt*ht,Lt=dy*rt,Nt=Lt-(Lt-rt),un=rt-Nt,Lt=dy*ht,_n=Lt-(Lt-ht),Dn=ht-_n,En=un*Dn-(nn-Nt*_n-un*_n-Nt*Dn),In=lt*Bt,Lt=dy*lt,Nt=Lt-(Lt-lt),un=lt-Nt,Lt=dy*Bt,_n=Lt-(Lt-Bt),Dn=Bt-_n,Gn=un*Dn-(In-Nt*_n-un*_n-Nt*Dn),Ln=En-Gn,Tt=En-Ln,g0[0]=En-(Ln+Tt)+(Tt-Gn),zn=nn+Ln,Tt=zn-nn,or=nn-(zn-Tt)+(Ln-Tt),Ln=or-In,Tt=or-Ln,g0[1]=or-(Ln+Tt)+(Tt-In),qn=zn+Ln,Tt=qn-zn,g0[2]=zn-(qn-Tt)+(Ln-Tt),g0[3]=qn;const Bi=L5e(Fi,WTt,4,g0,YTt);return YTt[Bi-1]}(S,R,M,F,G,q,de)}(b[0],b[1],p[0],p[1],y[0],y[1]);return T>0?-1:T<0?1:0}function EI(b,p){const y=b.point,T=p.point;return y[0]>T[0]?1:y[0]T[1]?1:-1:function(S,R,M){return S.left!==R.left?S.left?1:-1:0!==D5e(M,S.otherEvent.point,R.otherEvent.point)?S.isBelow(R.otherEvent.point)?-1:1:!S.isSubject&&R.isSubject?1:-1}(b,p,y)}function CI(b,p,y){const T=new J7(p,false,b,b.isSubject),S=new J7(p,true,b.otherEvent,b.isSubject);return V2(b.point,b.otherEvent.point)&&console.warn("what is that, a collapsed segment?",b),T.contourId=S.contourId=b.contourId,EI(S,b.otherEvent)>0&&(b.otherEvent.left=true,S.left=false),b.otherEvent.otherEvent=S,b.otherEvent=T,y.push(S),y.push(T),y}function _le(b,p){return b[0]*p[1]-b[1]*p[0]}function F5e(b,p){return b[0]*p[0]+b[1]*p[1]}function N5e(b,p,y){const T=function(G,q,Q,ie){const ae=[q[0]-G[0],q[1]-G[1]],de=[ie[0]-Q[0],ie[1]-Q[1]];function pe(Bt,ht,Tt){return[Bt[0]+ht*Tt[0],Bt[1]+ht*Tt[1]]}const _e=[Q[0]-G[0],Q[1]-G[1]];let Se=_le(ae,de),Fe=Se*Se;const Ye=F5e(ae,ae);if(Fe>0){const Bt=_le(_e,de)/Se;if(Bt<0||Bt>1)return null;const ht=_le(_e,ae)/Se;return ht<0||ht>1?null:0===Bt||1===Bt?[pe(G,Bt,ae)]:0===ht||1===ht?[pe(Q,ht,de)]:[pe(G,Bt,ae)]}if(Se=_le(_e,ae),Fe=Se*Se,Fe>0)return null;const Xe=F5e(ae,_e)/Ye,We=Xe+F5e(ae,de)/Ye,rt=Math.min(Xe,We),lt=Math.max(Xe,We);return rt<=1&<>=0?1===rt?[pe(G,rt>0?rt:0,ae)]:0===lt?[pe(G,lt<1?lt:1,ae)]:[pe(G,rt>0?rt:0,ae),pe(G,lt<1?lt:1,ae)]:null}(b.point,b.otherEvent.point,p.point,p.otherEvent.point),S=T?T.length:0;if(0===S||1===S&&(V2(b.point,p.point)||V2(b.otherEvent.point,p.otherEvent.point))||2===S&&b.isSubject===p.isSubject)return 0;if(1===S)return!V2(b.point,T[0])&&!V2(b.otherEvent.point,T[0])&&CI(b,T[0],y),!V2(p.point,T[0])&&!V2(p.otherEvent.point,T[0])&&CI(p,T[0],y),1;const R=[];let M=false,F=false;return V2(b.point,p.point)?M=true:1===EI(b,p)?R.push(p,b):R.push(b,p),V2(b.otherEvent.point,p.otherEvent.point)?F=true:1===EI(b.otherEvent,p.otherEvent)?R.push(p.otherEvent,b.otherEvent):R.push(b.otherEvent,p.otherEvent),M&&F||M?(p.type=1,b.type=p.inOut===b.inOut?2:3,M&&!F&&CI(R[1].otherEvent,R[0].point,y),2):F?(CI(R[0],R[1].point,y),3):R[0]!==R[3].otherEvent?(CI(R[0],R[1].point,y),CI(R[1],R[2].point,y),3):(CI(R[0],R[1].point,y),CI(R[3].otherEvent,R[2].point,y),3)}function zTr(b,p){if(b===p)return 0;if(0!==D5e(b.point,b.otherEvent.point,p.point)||0!==D5e(b.point,b.otherEvent.point,p.otherEvent.point))return V2(b.point,p.point)?b.isBelow(p.otherEvent.point)?-1:1:b.point[0]===p.point[0]?b.point[1](p.contourId??0)?1:-1}return 1===EI(b,p)?1:-1}class UTr{constructor(){this.points=[],this.holeIds=[],this.holeOf=null,this.depth=null}isExterior(){return null==this.holeOf}}function VTr(b,p,y,T){let S,R=b+1,M=p[b].point;const F=p.length;for(RT;)R--;return R}function $Tr(b,p,y){const T=new UTr;if(null!=b.prevInResult){const S=b.prevInResult,R=S.outputContourId;if(S.resultTransition>0){const M=p[R];if(null!=M.holeOf){const F=M.holeOf;p[F].holeIds.push(y),T.holeOf=F,T.depth=p[R].depth}else p[R].holeIds.push(y),T.holeOf=R,T.depth=p[R].depth+1}else T.holeOf=null,T.depth=p[R].depth}else T.holeOf=null,T.depth=0;return T}const XTt=Math.max,jTt=Math.min;let Tle=0;function KTt(b,p,y,T,S,R){let M,F,G,q,Q,ie;for(M=0,F=b.length-1;M0?ie.left=true:Q.left=true;const ae=G[0],de=G[1];S[0]=jTt(S[0],ae),S[1]=jTt(S[1],de),S[2]=XTt(S[2],ae),S[3]=XTt(S[3],de),T.push(Q),T.push(ie)}}const wle=[];function ZTt(b,p,y){let T=b,S=p;"number"==typeof b[0][0][0]&&(T=[b]),"number"==typeof p[0][0][0]&&(S=[p]);let R=function(ae,de,pe){let _e=null;return ae.length*de.length===0&&(0===pe?_e=wle:2===pe?_e=ae:(1===pe||3===pe)&&(_e=0===ae.length?de:ae)),_e}(T,S,y);if(R)return R===wle?null:R;const M=[1/0,1/0,-1/0,-1/0],F=[1/0,1/0,-1/0,-1/0],G=function(ae,de,pe,_e,Se){const Fe=new $F(void 0,EI);let Ye,Xe,We,rt,lt,Bt;for(We=0,rt=ae.length;We_e[2]||_e[0]>pe[2]||pe[1]>_e[3]||_e[1]>pe[3])&&(0===Se?Fe=wle:2===Se?Fe=ae:(1===Se||3===Se)&&(Fe=ae.concat(de))),Fe}(T,S,M,F,y),R)return R===wle?null:R;const q=function(ae,de,pe,_e,Se,Fe){const Ye=new P5e(zTr),Xe=[],We=Math.min(_e[2],Se[2]);let rt,lt,Bt;for(;0!==ae.length;){let ht=ae.pop();if(Xe.push(ht),0===Fe&&ht.point[0]>We||2===Fe&&ht.point[0]>_e[2])break;if(ht.left){lt=rt=Ye.insert(ht),Bt=Ye.minNode(),rt=rt!==Bt?Ye.prev(rt):null,lt=Ye.next(lt);const Tt=rt?rt.key:null;let Lt;if(Xq(ht,Tt,Fe),lt&&2===N5e(ht,lt.key,ae)&&(Xq(ht,Tt,Fe),Xq(lt.key,ht,Fe)),rt&&2===N5e(rt.key,ht,ae)){let Nt=rt;Nt=Nt!==Bt?Ye.prev(Nt):null,Lt=Nt?Nt.key:null,Xq(Tt,Lt,Fe),Xq(ht,Tt,Fe)}}else ht=ht.otherEvent,lt=rt=Ye.find(ht),rt&<&&(rt=rt!==Bt?Ye.prev(rt):null,lt=Ye.next(lt),Ye.remove(ht),lt&&rt&&N5e(rt.key,lt.key,ae))}return Xe}(G,0,0,M,F,y),Q=function(ae){let de,pe;const _e=function(Ye){let Xe,We,rt,lt,Bt;const ht=[];for(We=0,rt=Ye.length;We{Se[Bt]=true,Bt<_e.length&&_e[Bt]&&(_e[Bt].outputContourId=Ye)};let rt=de,lt=de;for(Xe.points.push(_e[de].point);We(rt),rt=_e[rt].otherPos,We(rt),Xe.points.push(_e[rt].point),rt=VTr(rt,_e,Se,lt),!(rt==lt||rt>=_e.length)&&_e[rt];);Fe.push(Xe)}return Fe}(q),ie=[];for(let ae=0;ae0&&(S=ZTt(S,R,2)),QTt(S,1/T,.001)}function O5e(b,p=1){return[b.map(y=>y.map(T=>[T.x*p,T.y*p]))]}function JTt(b,p){const y=Math.floor(b)+.5;return Math.abs(b-y)<=p?Math.round(y):Math.round(b)}class WTr{constructor(p){this.xs=[],this.ys=[],this.ixs=[],this.iys=[],this.buckets=new Map,this.tolerance=p}canonicalize(p,y){const T=this.tolerance,S=Math.floor(p/T),R=Math.floor(y/T);for(let G=-1;G<=1;G++){const q=this.buckets.get(S+G);if(q)for(let Q=-1;Q<=1;Q++){const ie=q.get(R+Q);if(ie){for(const ae of ie)if(Math.abs(this.xs[ae]-p)<=T&&Math.abs(this.ys[ae]-y)<=T){const de=this.ixs[ae],pe=this.iys[ae];return this.xs[ae]===p&&this.ys[ae]===y||this.store(p,y,de,pe,S,R),[de,pe]}}}}const M=JTt(p,T),F=JTt(y,T);return this.store(p,y,M,F,S,R),[M,F]}store(p,y,T,S,R,M){const F=this.xs.length;this.xs.push(p),this.ys.push(y),this.ixs.push(T),this.iys.push(S);let G=this.buckets.get(R);G||(G=new Map,this.buckets.set(R,G));let q=G.get(M);q||(q=[],G.set(M,q)),q.push(F)}}function QTt(b,p=1,y){const T=null!=y?new WTr(y):null;return b.map(S=>S.map((R,M)=>{const F=R.map(G=>{const q=G[0]*p,Q=G[1]*p;if(T){const[ie,ae]=T.canonicalize(q,Q);return new nt(ie,ae)}return new nt(Math.round(q),Math.round(Q))});return M>0&&F.reverse(),F}))}class B5e{constructor(){this.frcCoverage=new Set,this.featureTriSegments=[],this.frcPerLevel=new Map,this.frcNonRoadSegments=new Ls}empty(){return 0===this.frcCoverage.size}}function ewt(b,p,y){if(0===b.frcCoverage.size||0===b.featureTriSegments.length)return;const T=y.get(),S=p.uint16,R=[];b.featureTriSegments.sort((ie,ae)=>ie.segIdx!==ae.segIdx?ie.segIdx-ae.segIdx:null===ie.frc&&null===ae.frc?0:null===ie.frc?-1:null===ae.frc?1:ae.frc-ie.frc);const M=new Map;let F=0,G=b.featureTriSegments[0].frc,q={vertexOffset:T[F].vertexOffset,primitiveOffset:0,vertexLength:T[F].vertexLength,primitiveLength:0,vaos:{},sortKey:void 0};const Q=()=>{q.primitiveLength>0&&(M.has(G)||M.set(G,[]),M.get(G).push({...q}))};for(const ie of b.featureTriSegments){ie.segIdx!==F&&(Q(),F=ie.segIdx,G=ie.frc,q={vertexOffset:T[F].vertexOffset,primitiveOffset:R.length/3,vertexLength:T[F].vertexLength,primitiveLength:0,vaos:{},sortKey:void 0}),ie.frc!==G&&(Q(),G=ie.frc,q={...q,primitiveOffset:R.length/3,primitiveLength:0});for(let ae=ie.start;ae0?R.length-1:0,frc:S})}buildFrcSegments(p){this.frcData&&!this.frcData.empty()&&ewt(this.frcData,p.bufferData.indexArray,p.bufferData.triangleSegments)}handleFeature(p,y,T,S,R,M){const F=new Array;if(!this.elevationMode)return false;const G=Yq(p,R,void 0,S);if(!G)return false;{const Q=this.clipPolygonsToTile(y,1);Q.length>0&&F.push({polygons:Q,elevationFeature:G.feature,elevationTileID:G.tileId})}const q={guardRailEnabled:M.layers[0].layout.get("fill-construct-bridge-guard-rail").evaluate(p,{},S),featureIndex:T};for(const Q of F)if(Q.elevationFeature){if("hd-road-base"===this.elevationMode){this.elevatedStructures||(this.elevatedStructures=new m0(Q.elevationTileID,M.layers,M.zoom,M.lut));const ae=Q.elevationFeature.isTunnel();let de=0;Object.hasOwn(p.properties,$_t)&&(de=+p.properties[$_t]),this.elevatedStructures.addPortalCandidates(Q.elevationFeature.id,Q.polygons,ae,Q.elevationFeature,de)}null==Q.elevationFeature.constantHeight&&(Q.polygons=this.prepareElevatedPolygons(Q.polygons,Q.elevationFeature,Q.elevationTileID));const ie=new K7(S,Q.elevationTileID);this.addElevatedGeometry(M,Q.polygons,ie,Q.elevationFeature,"hd-road-base"===this.elevationMode?0:.05,T,q)}return true}populatePaintArrays(p,y,T,S,R,M,F){this.elevationBufferData&&this.elevationBufferData.populatePaintArrays(p,y,T,S,R,M,F)}update(p,y,T,S,R,M,F,G){this.elevationBufferData&&this.elevationBufferData.update(p,y,T,S,R,M,F,G),this.elevatedStructures&&this.elevatedStructures.update(p,y,T,S,R,M,F,G)}updateExpressions(p){this.elevationBufferData&&this.elevationBufferData.programConfigurations.updateExpressions(p),this.elevatedStructures&&(this.elevatedStructures.bridgeProgramConfigurations.updateExpressions(p),this.elevatedStructures.tunnelProgramConfigurations.updateExpressions(p))}upload(p){this.elevationBufferData&&this.elevationBufferData.upload(p),this.elevatedStructures&&this.elevatedStructures.upload(p)}destroy(){this.elevationBufferData&&this.elevationBufferData.destroy(),this.elevatedStructures&&this.elevatedStructures.destroy()}getUnevaluatedPortalGraph(){return this.elevatedStructures?this.elevatedStructures.unevaluatedPortals:void 0}setEvaluatedPortalGraph(p,y,T,S,R,M){this.elevatedStructures&&(this.elevatedStructures.construct(p),this.elevatedStructures.populatePaintArrays(y,T,S,R,M))}addElevatedGeometry(p,y,T,S,R,M,F){const G={elevation:S,elevationSampler:T,bias:R,index:M,featureInfo:F},[q,Q]=p.addGeometry(y,this.elevationBufferData,G,this.elevatedStructures);null==this.elevationBufferData.heightRange?this.elevationBufferData.heightRange={min:q,max:Q}:(this.elevationBufferData.heightRange.min=Math.min(this.elevationBufferData.heightRange.min,q),this.elevationBufferData.heightRange.max=Math.max(this.elevationBufferData.heightRange.max,Q))}prepareElevatedPolygons(p,y,T){const S=1/le(T),R=[];for(const M of p){const F=HTr(M,new VTt(y,S),.1);R.push(...F)}return R}clipPolygonsToTile(p,y){const T=-y,S=-y,R=qr+y,M=qr+y;let F=0;const G=[],q=[];for(;F=T&&de.max.x<=R&&de.min.y>=S&&de.max.y<=M?G:q).push(ae)}if(G.length===p.length)return p;const Q=[new nt(T,S),new nt(R,S),new nt(R,M),new nt(T,M),new nt(T,S)],ie=G;for(const ae of q)ie.push(...GTr(ae,Q));return ie}}function qTr(b,p){return b.nextPoint.sub(p.at(-2)).unit()}function XTr(b,p){return p[1].sub(b.prevPoint).unit()}li(twt,"FillHDExtension"),li(m0,"ElevatedStructures");class nwt{constructor(p,y){this.elevationEnabled=p,this.hasDeferredElevationFeatures=false,y&&(this.frcData=new B5e)}isEmpty(){const p=!this.elevationEnabled||void 0===this.heightRange,y=!this.frcData||this.frcData.empty();return p&&y}trackFeatureFrc(p){if(!this.frcData)return null;const y=Ele(p||{});return null!==y&&this.frcData.frcCoverage.add(y),y}recordFeatureRange(p,y,T,S){if(!this.frcData||T<=y)return;const R=p.segments.get();this.frcData.featureTriSegments.push({start:3*y,end:3*T,segIdx:R.length>0?R.length-1:0,frc:S})}buildFrcSegments(p){this.frcData&&!this.frcData.empty()&&ewt(this.frcData,p.indexArray,p.segments)}handleFeature(p,y,T,S,R,M,F,G,q,Q,ie){if(!this.elevationEnabled)return false;if(!ie.terrainEnabled){const Se=Yq(p,S,R?R.registry:void 0,T),Fe=null!=p.properties&&Object.hasOwn(p.properties,TA)&&!Number.isNaN(+p.properties[TA]);if(!Se&&Fe&&M&&(!R||!R.allProvidersReady))return this.hasDeferredElevationFeatures=true,true;if(Se){let Ye=Se.feature,Xe=Se.tileId;if(!Se.tileId.equals(T)){const lt=this.mergedFeatureCache?this.mergedFeatureCache.get(Ye.id):void 0;if(lt)Ye=lt,Xe=T;else{const Bt=function(ht,Tt,Lt){if(!ht.properties||!Tt||0===Tt.length)return[];const Nt=+ht.properties[TA];if(Number.isNaN(Nt))return[];const un=$Tt(Tt,Nt);if(un<0)return[];const _n=[];for(let Dn=un;Dn1&&(Ye=function(ht,Tt){const Lt=Tt.slice().sort((nn,En)=>En.tileId.z-nn.tileId.z),Nt=new nt(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),un=new nt(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),_n=[];for(const nn of Lt){const En=new K7(nn.tileId,ht);for(const Gn of nn.feature.vertices)_n.push({position:En.pointTransform(Gn.position),height:Gn.height,extent:Gn.extent,index:Gn.index});const In=nn.feature.safeArea;b4[0]=In.min.x,b4[1]=In.min.y,x4[0]=In.max.x,x4[1]=In.max.y,En.pointTransformInPlace(b4),En.pointTransformInPlace(x4),Nt.x=Math.min(Nt.x,b4[0],x4[0]),Nt.y=Math.min(Nt.y,b4[1],x4[1]),un.x=Math.max(un.x,b4[0],x4[0]),un.y=Math.max(un.y,b4[1],x4[1])}const Dn={min:Nt,max:un};if(null!=Lt[0].feature.constantHeight)return new RA(Lt[0].feature.id,Dn,Lt[0].feature.constantHeight);_n.sort((nn,En)=>nn.index-En.index);const Ln=[];for(const nn of _n)0!==Ln.length&&Ln.at(-1).index===nn.index||Ln.push(nn);const zn=[];for(let nn=1;nn>1,ie.layoutVertexArray.int16[6*Lt+1]>>1),un=ht.pointElevation(Nt,Ye,.05);this.updateHeightRange(un),Lt0?Ye.parentIndex:null)}return ie.fillNonElevatedRoadSegment(de),true}prepareElevatedLines(p,y,T,S){if(null!=y.constantHeight)return p;const R=[],M=1/le(S),F=T.equals(S)?null:new K7(T,S);for(const G of p)E_r(G,new VTt(y,M,F),0,R);return R}updateHeightRange(p){this.heightRange?(this.heightRange.min=Math.min(this.heightRange.min,p),this.heightRange.max=Math.max(this.heightRange.max,p)):this.heightRange={min:p,max:p}}endPopulate(){this.mergedFeatureCache=void 0}}li(nwt,"LineHDExtension");class rwt{constructor(){this.elevatedLayoutVertexArray=new Wn,this.hasElevation=false}beginFeature(p,y,T){const S=Yq(p,y,void 0,T);this.currentFeatureElevation=S?S.feature:void 0}writeVertexQuad(p,y){const T=this.currentFeatureElevation?this.currentFeatureElevation.pointElevation(new nt(p,y)):0;this.hasElevation=this.hasElevation||0!==T;for(let S=0;S<4;S++)this.elevatedLayoutVertexArray.emplaceBack(T)}finalize(){this.hasElevation||(this.elevatedLayoutVertexArray=void 0)}upload(p){this.elevatedLayoutVertexArray&&!this.elevatedLayoutVertexBuffer&&(this.elevatedLayoutVertexBuffer=p.createVertexBuffer(this.elevatedLayoutVertexArray,R_r.members))}destroy(){this.elevatedLayoutVertexBuffer&&this.elevatedLayoutVertexBuffer.destroy()}}li(rwt,"CircleHDExtension");const Cle=(b,p,y,T)=>{for(let S=0;S=this.elevationFeatures.length)return false;const T=this.elevationFeatureTileIds[p];return null!=T&&!T.equals(y)}getRoadFeatureHeightAtAnchor(p,y,T){if(65535===p||p>=this.elevationFeatures.length)return null;const S=this.elevationFeatures[p],R=this.elevationFeatureTileIds[p];return R.equals(T)?S.pointElevation(y):this.getElevationFeatureSampler(T,R).pointElevation(new nt(y.x,y.y),S,0)}sampleRoadFeatureHeight(p,y,T){const S=this.getRoadFeatureHeightAtAnchor(p,y,T);return null===S?void 0:S}clearWorkerState(){this.consumerCanonical=void 0,this.elevationParams=null,this.crossSourceElevationEnabled=false,this.terrainEnabled=false,this.elevationFeatureIdToIndex.clear()}updateRoadElevation(p,y){if(this.elevationStateComplete)return;this.elevationStateComplete=true,p.hasAnyZOffset=false;let T=false;const S=le(y),R=1/S;let M=false,F=false;for(let G=0;G0||de>0,Fe=pe>0,Ye=q.elevationFeatureIndex,Xe=Ye=0&&Cle(p.icon.orientationVertexArray,pe,Q,ie),rt>=0&&Cle(p.icon.orientationVertexArray,_e,Q,ie)}}M||(p.text.orientationVertexArray=void 0),F||(p.icon.orientationVertexArray=void 0),T&&(p.zOffsetBuffersNeedUpload=true,p.zOffsetSortDirty=true)}getRoadFeatureHeightForPlacedSymbol(p,y,T,S,R){const M=p.symbolInstances.get(y.symbolInstanceIndices[T]);return this.getRoadFeatureHeightAtAnchor(M.elevationFeatureIndex,S,R)}getElevationFeatureForPlacedSymbol(p,y,T){const S=p.symbolInstances.get(y.symbolInstanceIndices[T]).elevationFeatureIndex;if(S{const pe=this.getRoadFeatureHeightForPlacedSymbol(p,y,T,de,S.canonical);return function(_e,Se,Fe,Ye,Xe,We){const rt=Ye.upVector(Se,Fe.x,Fe.y);return ge(rt,rt,_e*Ye.upVectorScale(Se,Xe,We).metersToTile),[rt[0],rt[1],rt[2]]}(null!==pe?pe:0,S.canonical,de,F,G,q)},elevation:M,elevationFeature:null}:{getElevation:R,elevation:M,elevationFeature:ie}}}li(iwt,"SymbolHDExtension",{omit:["consumerCanonical","elevationParams","crossSourceElevationEnabled","terrainEnabled","hasDeferredElevationFeatures","elevationFeatureIdToIndex"]});let bT=null,Sle=null,U5e=null,Ale=null;const owt=5120,awt=5121,swt=5122,lwt=5123,cwt=5125,uwt=5126,kle={[owt]:Int8Array,[awt]:Uint8Array,[swt]:Int16Array,[lwt]:Uint16Array,[cwt]:Uint32Array,[uwt]:Float32Array},jTr={[owt]:"DT_INT8",[awt]:"DT_UINT8",[swt]:"DT_INT16",[lwt]:"DT_UINT16",[cwt]:"DT_UINT32",[uwt]:"DT_FLOAT32"},jq={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16};function dwt(b,p,y){const T=y.json.bufferViews.length,S=y.buffers.length;p.bufferView=T,y.json.bufferViews[T]={buffer:S,byteLength:b.byteLength},y.buffers[S]=b}const V5e="KHR_draco_mesh_compression";function KTr(b,p){const y=b.extensions&&b.extensions[V5e];if(!y)return;const T=new bT.Decoder,S=mwt(p,y.bufferView),R=new bT.Mesh;if(!T.DecodeArrayToMesh(S,S.byteLength,R))throw new Error("Failed to decode Draco mesh");const M=p.json.accessors[b.indices],F=kle[M.componentType],G=M.count*F.BYTES_PER_ELEMENT,q=bT._malloc(G);F===Uint16Array?T.GetTrianglesUInt16Array(R,G,q):T.GetTrianglesUInt32Array(R,G,q),dwt(bT.memory.buffer.slice(q,q+G),M,p),bT._free(q);for(const Q of Object.keys(y.attributes)){const ie=T.GetAttributeByUniqueId(R,y.attributes[Q]),ae=p.json.accessors[b.attributes[Q]],de=jTr[ae.componentType],pe=ae.count*jq[ae.type]*kle[ae.componentType].BYTES_PER_ELEMENT,_e=bT._malloc(pe);T.GetAttributeDataArrayForAllPoints(R,ie,bT[de],pe,_e),dwt(bT.memory.buffer.slice(_e,_e+pe),ae,p),bT._free(_e)}T.destroy(),R.destroy(),delete b.extensions[V5e]}const Rle="EXT_meshopt_compression";function ZTr(b,p){if(!b.extensions||!b.extensions[Rle])return;const y=b.extensions[Rle],T=new Uint8Array(p.buffers[y.buffer],y.byteOffset||0,y.byteLength||0),S=new Uint8Array(y.count*y.byteStride);U5e.decodeGltfBuffer(S,y.count,y.byteStride,T,y.mode,y.filter),b.buffer=p.buffers.length,b.byteOffset=0,p.buffers[b.buffer]=S.buffer,delete b.extensions[Rle]}const fwt=1179937895,hwt=new TextDecoder("utf8");function pwt(b,p){return new URL(b,p).href}async function JTr(b,p,y,T,S){const R=await fetch(pwt(b.uri,T),{signal:S}),M=await R.arrayBuffer();p.buffers[y]=M}function mwt(b,p){const y=b.json.bufferViews[p];return new Uint8Array(b.buffers[y.buffer],y.byteOffset||0,y.byteLength)}async function QTr(b,p,y,T,S){if(b.uri){const R=pwt(b.uri,T),M=await fetch(R,{signal:S}),F=await M.blob(),G=await createImageBitmap(F);p.images[y]=G}else if(void 0!==b.bufferView){const R=mwt(p,b.bufferView),M=new Blob([R],{type:b.mimeType}),F=await createImageBitmap(M);p.images[y]=F}}async function gwt(b,p=0,y,T){const S={json:null,images:[],buffers:[]};if(new Uint32Array(b,p,1)[0]===fwt){const de=new Uint32Array(b,p);let pe=2;const _e=(de[pe++]>>2)-3,Se=de[pe++]>>2;if(pe++,S.json=JSON.parse(hwt.decode(de.subarray(pe,pe+Se))),pe+=Se,pe<_e){const Fe=de[pe++];pe++;const Ye=p+(pe<<2);S.buffers[0]=b.slice(Ye,Ye+Fe)}}else S.json=JSON.parse(hwt.decode(new Uint8Array(b,p)));const{buffers:R,images:M,meshes:F,extensionsUsed:G,bufferViews:q}=S.json;if(R){const de=[];for(let pe=0;pe>>0,Math.ceil(1.2*Xe)),rt=Math.ceil((We-Xe)/65536);try{return _e.grow(rt),Se(),true}catch(lt){return false}},b:Fe}}).then(Ye=>{const{Rb:Xe,Qb:We,P:rt,T:lt,X:Bt,Ja:ht,La:Tt,Qa:Lt,Va:Nt,Wa:un,eb:_n,jb:Dn,f:Ln,e:zn,yb:or,zb:nn,Ab:En,Bb:In,Db:Gn,Gb:qn}=Ye.instance.exports;_e=zn;const Zn=(()=>{let Hn=0,ur=0,pr=0,ni=0;return Cr=>{pr&&(Xe(ni),Xe(Hn),ur+=pr,pr=Hn=0),Hn||(ur+=128,Hn=We(ur));const Fr=Cr.length+7&-8;let Fi=Hn;Fr>=ur&&(pr=Fr,Fi=ni=We(Fr));for(let Bi=0;Bi{bT=de,Sle=null})),Sle}()),ae&&Q.push(function(){var de;if(!U5e)return null!=Ale||(Ale=(de=fetch(Qt()),WebAssembly.instantiateStreaming(de,{}).then(pe=>{const{sbrk:_e,memory:Se,meshopt_decodeVertexBuffer:Fe,meshopt_decodeIndexBuffer:Ye,meshopt_decodeIndexSequence:Xe,meshopt_decodeFilterOct:We,meshopt_decodeFilterQuat:rt,meshopt_decodeFilterExp:lt}=pe.instance.exports,Bt={ATTRIBUTES:Fe,TRIANGLES:Ye,INDICES:Xe},ht={OCTAHEDRAL:We,QUATERNION:rt,EXPONENTIAL:lt};return pe.instance.exports.__wasm_call_ctors(),{decodeGltfBuffer(Tt,Lt,Nt,un,_n,Dn){const Ln=Lt+3&-4,zn=_e(Ln*Nt),or=_e(un.length),nn=new Uint8Array(Se.buffer);nn.set(un,or);const En=Bt[_n](zn,Lt,Nt,or,un.length);if(0===En&&ht[Dn]&&ht[Dn](zn,Ln,Nt),Tt.set(nn.subarray(zn,zn+Lt*Nt)),_e(zn-_e(0)),0!==En)throw new Error(`Malformed buffer data: ${En}`)}}})).then(pe=>{U5e=pe,Ale=null})),Ale}()),M)for(let de=0;deie.cellIdx-ae.cellIdx||ie.triIdx-ae.triIdx);let Q=0;for(;Qthis.max.x||this.min.x>p.x||p.y>this.max.y||this.min.y>p.y)return;const T=$2(p.x-this.min.x,this.xScale,this.cellsX),S=$2(p.y-this.min.y,this.yScale,this.cellsY),R=this.cells[S*this.cellsX+T];if(R){this._lazyInitLookup();for(let M=0;Mthis.max.x||this.min.x>y.x)return;if(p.y>this.max.y||this.min.y>y.y)return;this._lazyInitLookup();const S=$2(p.x-this.min.x,this.xScale,this.cellsX),R=$2(y.x-this.min.x,this.xScale,this.cellsX),M=$2(p.y-this.min.y,this.yScale,this.cellsY),F=$2(y.y-this.min.y,this.yScale,this.cellsY);for(let G=M;G<=F;G++)for(let q=S;q<=R;q++){const Q=this.cells[G*this.cellsX+q];if(Q)for(let ie=0;ie0){const R=function(M,F){const G=F.worldSize,q=E(1,0)*G*Z(F.center.lat,F.zoom)/m5e(G),Q=E(1,F.center.lat)*G,ie=_([]);O(ie,ie,Fn(F.center.lng)),N(ie,ie,Fn(F.center.lat)),L(ie,ie,[0,0,om]),I(ie,ie,[q,q,q*Q]);const ae=F.point;return L(ie,ie,[-ae.x,-ae.y,0]),P(ie,ie,M),P(ie,F.globeMatrix,ie)}(b,p);return function(M,F,G){const q=(pe,_e,Se)=>{const Fe=re(pe),Ye=re(_e),Xe=CA(pe,_e,Se);return ge(Xe,Xe,1/re(Xe)*Si(Fe,Ye,Se))},Q=q([M[0],M[1],M[2]],[F[0],F[1],F[2]],G),ie=q([M[4],M[5],M[6]],[F[4],F[5],F[6]],G),ae=q([M[8],M[9],M[10]],[F[8],F[9],F[10]],G),de=CA([M[12],M[13],M[14]],[F[12],F[13],F[14]],G);return[Q[0],Q[1],Q[2],0,ie[0],ie[1],ie[2],0,ae[0],ae[1],ae[2],0,de[0],de[1],de[2],1]}(S,R,T)}return S}function G5e(b,p,y,T){const S=xl.projectAabbCorners(T,y);let R=Number.MAX_VALUE;for(let F=0;F0||0===Se&&pe[0]*_e[0]+pe[1]*_e[1]>=0&&pe[0]*pe[0]+pe[1]*pe[1]>_e[0]*_e[0]+_e[1]*_e[1])&&(Q=de)}ie=Q}while(ie!==q);return G.length>0&&G.push(G[0]),G}(S);if(jOe(b,M))return R}const v4=64,lwr=[1,1,1];function Lle(b,p,y,T,S,R,M,F,G,q=false){const Q=y.zoom,ie=y.project(T),ae=Z(T.lat,Q),de=1/ae;_(b),L(b,b,[ie.x+M[0]*de,ie.y+M[1]*de,M[2]]);let pe=1,_e=1;const Se=y.worldSize;if(q){if("mercator"===y.projection.name){let We=0;y.elevation&&(We=y.elevation.getAtPointOrZero(new fe(ie.x/Se,ie.y/Se),0));const rt=ye([],[ie.x,ie.y,We,1],y.projMatrix)[3]/y.cameraToCenterDistance;pe=rt,_e=rt*Z(y.center.lat,Q)}else if("globe"===y.projection.name){const We=Mle(b,y),rt=[0,0,0,1];ye(rt,rt,P([],y.projMatrix,We));const lt=rt[3]/y.cameraToCenterDistance,Bt=SA(Q),ht=y.projection.pixelsPerMeter(T.lat,Se)*Z(T.lat,Q),Tt=y.projection.pixelsPerMeter(y.center.lat,Se)*Z(y.center.lat,Q);pe=lt/Si(ht,Y(y.center.lat),Bt),_e=lt*ae/ht,pe*=Tt,_e*=Tt}}else pe=de;I(b,b,[pe,pe,_e]);const Fe=[...b],Ye=p.orientation,Xe=[];if(_wt(Xe,[Ye[0]+(S?S[0]:0),Ye[1]+(S?S[1]:0),Ye[2]+(S?S[2]:0)],R),P(b,Fe,Xe),F&&y.elevation){let We=0;const rt=[];if(G&&y.elevation){We=function(Bt,ht,Tt,Lt,Nt){const un=ht.elevation;if(!un)return 0;const _n=xl.projectAabbCorners(Tt,Lt),Dn=E(1,Nt.lat)*ht.worldSize,Ln=function(pr,ni){const Cr=[0,0,1],Fr=[{corners:[0,1,3,2],dotProductWithUp:0},{corners:[1,5,2,6],dotProductWithUp:0},{corners:[0,4,1,5],dotProductWithUp:0},{corners:[2,6,3,7],dotProductWithUp:0},{corners:[4,7,5,6],dotProductWithUp:0},{corners:[0,3,4,7],dotProductWithUp:0}];for(const Fi of Fr){const Bi=pr[Fi.corners[0]],no=pr[Fi.corners[1]],Ii=pr[Fi.corners[2]],mo=[no[0]-Bi[0],no[1]-Bi[1],ni*(no[2]-Bi[2])],io=ct(mo,mo,[Ii[0]-Bi[0],Ii[1]-Bi[1],ni*(Ii[2]-Bi[2])]);yt(io,io),Fi.dotProductWithUp=mt(io,Cr)}return Fr.sort((Fi,Bi)=>Fi.dotProductWithUp-Bi.dotProductWithUp),Fr[0].corners}(_n,Dn),zn=_n[Ln[0]],or=_n[Ln[1]],nn=_n[Ln[2]],En=_n[Ln[3]],In=un.getAtPointOrZero(new fe(zn[0]/ht.worldSize,zn[1]/ht.worldSize),0),Gn=un.getAtPointOrZero(new fe(or[0]/ht.worldSize,or[1]/ht.worldSize),0),qn=un.getAtPointOrZero(new fe(nn[0]/ht.worldSize,nn[1]/ht.worldSize),0),Zn=un.getAtPointOrZero(new fe(En[0]/ht.worldSize,En[1]/ht.worldSize),0),Hn=(In+Zn)/2,ur=(Gn+qn)/2;return Hn>ur?Gn=p.gl.NEAREST_MIPMAP_NEAREST}),b.uploaded=true,b.image=null)}function wwt(b,p,y){b.indexBuffer=p.createIndexBuffer(b.indexArray,false,true),b.vertexBuffer=p.createVertexBuffer(b.vertexArray,ewr.members,false,true),b.normalArray&&(b.normalBuffer=p.createVertexBuffer(b.normalArray,iwr.members,false,true)),b.texcoordArray&&(b.texcoordBuffer=p.createVertexBuffer(b.texcoordArray,rwr.members,false,true)),b.colorArray&&(b.colorBuffer=p.createVertexBuffer(b.colorArray,(12===b.colorArray.bytesPerElement?twr:nwr).members,false,true)),b.featureArray&&(b.pbrBuffer=p.createVertexBuffer(b.featureArray,awr.members,true)),b.segments=Ls.simpleSegment(0,0,b.vertexArray.length,b.indexArray.length);const T=b.material;T.pbrMetallicRoughness.baseColorTexture&&Zq(T.pbrMetallicRoughness.baseColorTexture,p),T.pbrMetallicRoughness.metallicRoughnessTexture&&Zq(T.pbrMetallicRoughness.metallicRoughnessTexture,p),T.normalTexture&&Zq(T.normalTexture,p),T.occlusionTexture&&Zq(T.occlusionTexture,p,y),T.emissionTexture&&Zq(T.emissionTexture,p)}function H5e(b,p,y){if(b.meshes)for(const T of b.meshes)wwt(T,p,y);if(b.lodMeshes)for(const T of b.lodMeshes)wwt(T,p,y);if(b.children)for(const T of b.children)H5e(T,p,y)}function Ewt(b){b.indexArray.destroy(),b.vertexArray.destroy(),b.colorArray&&b.colorArray.destroy(),b.normalArray&&b.normalArray.destroy(),b.texcoordArray&&b.texcoordArray.destroy(),b.featureArray&&b.featureArray.destroy()}function Dle(b){if(b.meshes)for(const p of b.meshes)Ewt(p);if(b.lodMeshes)for(const p of b.lodMeshes)Ewt(p);if(b.children)for(const p of b.children)Dle(p)}function Cwt(b){var p;b.vertexBuffer&&(b.vertexBuffer.destroy(),b.indexBuffer.destroy(),b.normalBuffer&&b.normalBuffer.destroy(),b.texcoordBuffer&&b.texcoordBuffer.destroy(),b.colorBuffer&&b.colorBuffer.destroy(),b.pbrBuffer&&b.pbrBuffer.destroy(),b.segments.destroy(),b.material&&((p=b.material).pbrMetallicRoughness.baseColorTexture&&p.pbrMetallicRoughness.baseColorTexture.gfxTexture&&p.pbrMetallicRoughness.baseColorTexture.gfxTexture.destroy(),p.pbrMetallicRoughness.metallicRoughnessTexture&&p.pbrMetallicRoughness.metallicRoughnessTexture.gfxTexture&&p.pbrMetallicRoughness.metallicRoughnessTexture.gfxTexture.destroy(),p.normalTexture&&p.normalTexture.gfxTexture&&p.normalTexture.gfxTexture.destroy(),p.emissionTexture&&p.emissionTexture.gfxTexture&&p.emissionTexture.gfxTexture.destroy(),p.occlusionTexture&&p.occlusionTexture.gfxTexture&&p.occlusionTexture.gfxTexture.destroy()))}function W5e(b){if(b.meshes)for(const p of b.meshes)Cwt(p);if(b.lodMeshes)for(const p of b.lodMeshes)Cwt(p);if(b.footprintDebugMesh&&(b.footprintDebugMesh.vertexBuffer.destroy(),b.footprintDebugMesh.indexBuffer.destroy(),b.footprintDebugMesh.segments.destroy()),b.children)for(const p of b.children)W5e(p)}function Y5e(b,p,y,T){return b[0]<=T[0]&&p[0]>=y[0]&&b[1]<=T[1]&&p[1]>=y[1]&&b[2]<=T[2]&&p[2]>=y[2]}function cwr(b,p,y,T,S,R,M,F,G,q,Q){const ie=.5*(q[0]+Q[0]),ae=.5*(q[1]+Q[1]),de=.5*(q[2]+Q[2]),pe=.5*(Q[0]-q[0]),_e=.5*(Q[1]-q[1]),Se=.5*(Q[2]-q[2]),Fe=b-ie,Ye=p-ae,Xe=y-de,We=T-ie,rt=S-ae,lt=R-de,Bt=M-ie,ht=F-ae,Tt=G-de,Lt=We-Fe,Nt=rt-Ye,un=lt-Xe,_n=Bt-We,Dn=ht-rt,Ln=Tt-lt,zn=Fe-Bt,or=Ye-ht,nn=Xe-Tt;let En,In,Gn,qn,Zn,Hn;if(En=Xe*Nt-Ye*un,In=lt*Nt-rt*un,Gn=Tt*Nt-ht*un,qn=Math.min(En,In,Gn),Zn=Math.max(En,In,Gn),Hn=Math.abs(un)*_e+Math.abs(Nt)*Se,qn>Hn||Zn<-Hn)return false;if(En=Xe*Dn-Ye*Ln,In=lt*Dn-rt*Ln,Gn=Tt*Dn-ht*Ln,qn=Math.min(En,In,Gn),Zn=Math.max(En,In,Gn),Hn=Math.abs(Ln)*_e+Math.abs(Dn)*Se,qn>Hn||Zn<-Hn)return false;if(En=Xe*or-Ye*nn,In=lt*or-rt*nn,Gn=Tt*or-ht*nn,qn=Math.min(En,In,Gn),Zn=Math.max(En,In,Gn),Hn=Math.abs(nn)*_e+Math.abs(or)*Se,qn>Hn||Zn<-Hn)return false;if(En=Fe*un-Xe*Lt,In=We*un-lt*Lt,Gn=Bt*un-Tt*Lt,qn=Math.min(En,In,Gn),Zn=Math.max(En,In,Gn),Hn=Math.abs(un)*pe+Math.abs(Lt)*Se,qn>Hn||Zn<-Hn)return false;if(En=Fe*Ln-Xe*_n,In=We*Ln-lt*_n,Gn=Bt*Ln-Tt*_n,qn=Math.min(En,In,Gn),Zn=Math.max(En,In,Gn),Hn=Math.abs(Ln)*pe+Math.abs(_n)*Se,qn>Hn||Zn<-Hn)return false;if(En=Fe*nn-Xe*zn,In=We*nn-lt*zn,Gn=Bt*nn-Tt*zn,qn=Math.min(En,In,Gn),Zn=Math.max(En,In,Gn),Hn=Math.abs(nn)*pe+Math.abs(zn)*Se,qn>Hn||Zn<-Hn)return false;if(En=Ye*Lt-Fe*Nt,In=rt*Lt-We*Nt,Gn=ht*Lt-Bt*Nt,qn=Math.min(En,In,Gn),Zn=Math.max(En,In,Gn),Hn=Math.abs(Nt)*pe+Math.abs(Lt)*_e,qn>Hn||Zn<-Hn)return false;if(En=Ye*_n-Fe*Dn,In=rt*_n-We*Dn,Gn=ht*_n-Bt*Dn,qn=Math.min(En,In,Gn),Zn=Math.max(En,In,Gn),Hn=Math.abs(Dn)*pe+Math.abs(_n)*_e,qn>Hn||Zn<-Hn)return false;if(En=Ye*zn-Fe*or,In=rt*zn-We*or,Gn=ht*zn-Bt*or,qn=Math.min(En,In,Gn),Zn=Math.max(En,In,Gn),Hn=Math.abs(or)*pe+Math.abs(zn)*_e,qn>Hn||Zn<-Hn)return false;if(qn=Math.min(Fe,We,Bt),Zn=Math.max(Fe,We,Bt),qn>pe||Zn<-pe)return false;if(qn=Math.min(Ye,rt,ht),Zn=Math.max(Ye,rt,ht),qn>_e||Zn<-_e)return false;if(qn=Math.min(Xe,lt,Tt),Zn=Math.max(Xe,lt,Tt),qn>Se||Zn<-Se)return false;const ur=Nt*Ln-un*Dn,pr=un*_n-Lt*Ln,ni=Lt*Dn-Nt*_n,Cr=-(ur*Fe+pr*Ye+ni*Xe);return Hn=pe*Math.abs(ur)+_e*Math.abs(pr)+Se*Math.abs(ni),!(Math.abs(Cr)>Hn)}const uwr=[];class Swt{serializeFromGltf(p,y,T,S){if(p.length<7)return;let R=0;if(109!==p[R++]||98!==p[R++]||120!==p[R++]||98!==p[R++]||118!==p[R++]||104!==p[R++])return;if(43!==p[R++])return;const M=new DataView(p.buffer,p.byteOffset),F=M.getUint16(R,true);if(R+=2,0===F)return;this._nodes=[];let G=0;for(let Q=0;Q0;){const R=T.pop(),M=this._nodes[R];if(M.aabbMax[2]<=S)continue;if(65535===M.backChild){for(let de=0;de=0?S:null}}function _4(b,p){const y=b.json.bufferViews[p.bufferView],T=kle[p.componentType];return new T(b.buffers[y.buffer],(p.byteOffset||0)+(y.byteOffset||0),p.count*(y.byteStride&&y.byteStride!==jq[p.type]*T.BYTES_PER_ELEMENT?y.byteStride/T.BYTES_PER_ELEMENT:jq[p.type]))}function q5e(b,p,y,T){const S=kle[p.componentType],R=function(ie){switch(ie){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:return 1}}(S),M=b.json.bufferViews[p.bufferView],F=M.byteStride?M.byteStride/S.BYTES_PER_ELEMENT:jq[p.type],G=y.float32,q=G.length/y.capacity,Q=p.count*F;for(let ie=0,ae=0;ie0){R.texcoordArray=new $l;const Fe=p.json.accessors[S.TEXCOORD_0];R.texcoordArray.resizeExact(Fe.count);const Ye=_4(p,Fe);q5e(p,Fe,R.texcoordArray,Ye)}if(void 0!==S._FEATURE_ID_RGBA4444){const Fe=p.json.accessors[S._FEATURE_ID_RGBA4444];p.json.extensionsUsed&&p.json.extensionsUsed.includes("EXT_meshopt_compression")&&(R.featureData=_4(p,Fe))}void 0!==S._FEATURE_RGBA4444&&(R.featureData=new Uint32Array(_4(p,p.json.accessors[S._FEATURE_RGBA4444]).buffer));const Se=b.material;return R.material=function(Fe,Ye){const{emissiveFactor:Xe=[0,0,0],alphaMode:We="OPAQUE",alphaCutoff:rt=.5,normalTexture:lt,occlusionTexture:Bt,emissiveTexture:ht,doubleSided:Tt,name:Lt}=Fe,{baseColorFactor:Nt=[1,1,1,1],metallicFactor:un=1,roughnessFactor:_n=1,baseColorTexture:Dn,metallicRoughnessTexture:Ln}=Fe.pbrMetallicRoughness||{},zn=Bt?Ye[Bt.index]:void 0;if(Bt&&Bt.extensions&&Bt.extensions.KHR_texture_transform&&zn){const or=Bt.extensions.KHR_texture_transform;zn.offsetScale=[or.offset[0],or.offset[1],or.scale[0],or.scale[1]]}return{name:Lt,pbrMetallicRoughness:{baseColorFactor:new Wo(...Nt),metallicFactor:un,roughnessFactor:_n,baseColorTexture:Dn?Ye[Dn.index]:void 0,metallicRoughnessTexture:Ln?Ye[Ln.index]:void 0},doubleSided:Tt,emissiveFactor:new Wo(...Xe),alphaMode:We,alphaCutoff:rt,normalTexture:lt?Ye[lt.index]:void 0,occlusionTexture:zn,emissionTexture:ht?Ye[ht.index]:void 0,defined:void 0===Fe.defined}}(void 0!==Se?p.json.materials[Se]:{defined:false},y),R}function X5e(b,p,y){const{matrix:T,rotation:S,translation:R,scale:M,mesh:F,extras:G,children:q,name:Q}=b,ie={};if(ie.name=Q,ie.localMatrix=T||function(ae,de,pe,_e){var Se=de[0],Fe=de[1],Ye=de[2],Xe=de[3],We=Se+Se,rt=Fe+Fe,lt=Ye+Ye,Bt=Se*We,ht=Se*rt,Tt=Se*lt,Lt=Fe*rt,Nt=Fe*lt,un=Ye*lt,_n=Xe*We,Dn=Xe*rt,Ln=Xe*lt,zn=_e[0],or=_e[1],nn=_e[2];return ae[0]=(1-(Lt+un))*zn,ae[1]=(ht+Ln)*zn,ae[2]=(Tt-Dn)*zn,ae[3]=0,ae[4]=(ht-Ln)*or,ae[5]=(1-(Bt+un))*or,ae[6]=(Nt+_n)*or,ae[7]=0,ae[8]=(Tt+Dn)*nn,ae[9]=(Nt-_n)*nn,ae[10]=(1-(Bt+Lt))*nn,ae[11]=0,ae[12]=pe[0],ae[13]=pe[1],ae[14]=pe[2],ae[15]=1,ae}([],S||[0,0,0,1],R||[0,0,0],M||[1,1,1]),ie.globalMatrix=x(ie.localMatrix),void 0!==F){ie.meshes=y[F];const ae=ie.anchor=[0,0];for(const de of ie.meshes){const{min:pe,max:_e}=de.aabb;ae[0]+=pe[0]+_e[0],ae[1]+=pe[1]+_e[1]}ae[0]=Math.floor(ae[0]/ie.meshes.length/2),ae[1]=Math.floor(ae[1]/ie.meshes.length/2)}if(G&&(G.id&&(ie.id=G.id),G.lights&&(ie.lights=function(ae){if(!ae.length)return[];const de=function(Ye){const Xe=atob(Ye),We=new Uint8Array(Xe.length);for(let rt=0;rt=Xe.length||Se>=Xe.length||Fe>=Xe.length||Ye>=Xe.length)return null;const We=Xe[_e],rt=Xe[Se],lt=Xe[Fe],Bt=Xe[Ye];if(void 0===We.bufferView||void 0===rt.bufferView||void 0===lt.bufferView||void 0===Bt.bufferView)return null;const ht=ae.json.bufferViews;if(We.bufferView>=ht.length||rt.bufferView>=ht.length||lt.bufferView>=ht.length||Bt.bufferView>=ht.length)return null;const Tt=ht[We.bufferView],Lt=ht[rt.bufferView],Nt=ht[lt.bufferView],un=ht[Bt.bufferView];if(Tt.buffer>=ae.buffers.length||Lt.buffer>=ae.buffers.length||Nt.buffer>=ae.buffers.length||un.buffer>=ae.buffers.length)return null;const _n=(Zn,Hn,ur)=>Zn>=0&&Zn<=ur&&Hn<=ur-Zn,Dn=We.byteOffset||0,Ln=rt.byteOffset||0,zn=lt.byteOffset||0,or=Bt.byteOffset||0;if(!(_n(Dn,0,Tt.byteLength)&&_n(Ln,3*rt.count*4,Lt.byteLength)&&_n(zn,3*lt.count*4,Nt.byteLength)&&_n(or,4*Bt.count,un.byteLength)))return null;const nn=new Uint8Array(ae.buffers[Tt.buffer],(Tt.byteOffset||0)+Dn,Tt.byteLength-Dn),En=new Float32Array(ae.buffers[Lt.buffer],(Lt.byteOffset||0)+Ln,3*rt.count),In=new Float32Array(ae.buffers[Nt.buffer],(Nt.byteOffset||0)+zn,3*lt.count),Gn=new Uint32Array(ae.buffers[un.buffer],(un.byteOffset||0)+or,Bt.count),qn=new Swt;if(qn.serializeFromGltf(nn,En,In,Gn),void 0!==pe&&ae.json.meshes&&ae.json.meshes[pe]){const Zn=ae.json.meshes[pe].primitives[0];if(Zn&&void 0!==Zn.attributes.POSITION&&Zn.attributes.POSITION1&&T.at(-1).equals(T[0])&&T.pop();let S=0;for(let M=0;M0&&T.reverse();const R=dI(T.flatMap(M=>[M.x,M.y]),[]);return 0===R.length?null:{vertices:T,indices:R}}function pwr(b,p){const y=[],T=[];let S=0;const R=[];for(const M of b){S=y.length;const F=M.vertexArray.float32,G=M.indexArray.uint16;for(let q=0;q0&&([T[M+1],T[M+2]]=[T[M+2],T[M+1]])}return{vertices:y,indices:T}}function Awt(b,p){for(let y=0;y0){const _e=Array.from(pe.values()).sort((Se,Fe)=>Se-Fe);for(let Se=_e.length-1;Se>=0;Se--)Q.splice(_e[Se],1)}}(G,F,b.json.nodes);const q=T?Awt(T,"LOD"):-1;if(q>=0){const Q=T[q].nodes,ie=new Map;for(const ae of Q){const de=X5e(R[ae],b,y);de.id&&ie.set(de.id,de)}for(const ae of G)if(ae.id){const de=ie.get(ae.id);de&&de.meshes&&(ae.lodMeshes=de.meshes,de.meshBVH&&(ae.meshBVH=de.meshBVH))}}return G}function mwr(b){b.heightmap=new Float32Array(4096),b.heightmap.fill(-1);const p=b.vertexArray.float32,y=b.aabb.min[0]-1,T=b.aabb.min[1]-1,S=v4/(b.aabb.max[0]-y+2),R=v4/(b.aabb.max[1]-T+2);for(let M=0;Mb.heightmap[q*v4+G]&&(b.heightmap[q*v4+G]=F)}}function kwt(b,p,y,T,S){y.reserve(y.length+4*b.length),T.reserve(T.length+10*b.length),S.reserve(S.length+10*b.length);let R=T.length;for(const M of b){const F=Math.min(10,Math.max(4,1.3*M.height))*p,G=[-M.normal[1],M.normal[0],0],q=Math.min(.29,.1*M.width/M.depth),Q=M.width-2*M.depth*p*(q+.01),ie=Ve([],M.pos,G,Q/2),ae=Ve([],M.pos,G,-Q/2),de=[ie[0],ie[1],ie[2]+M.height],pe=[ae[0],ae[1],ae[2]+M.height],_e=Ve([],M.normal,G,q);ge(_e,_e,F);const Se=Ve([],M.normal,G,-q);ge(Se,Se,F),xe(_e,ie,_e),xe(Se,ae,Se),ie[2]+=.1,ae[2]+=.1,T.emplaceBack(_e[0],_e[1],_e[2]),T.emplaceBack(Se[0],Se[1],Se[2]),T.emplaceBack(ie[0],ie[1],ie[2]),T.emplaceBack(ae[0],ae[1],ae[2]),T.emplaceBack(de[0],de[1],de[2]),T.emplaceBack(pe[0],pe[1],pe[2]),T.emplaceBack(ie[0],ie[1],ie[2]),T.emplaceBack(ae[0],ae[1],ae[2]),T.emplaceBack(_e[0],_e[1],_e[2]),T.emplaceBack(Se[0],Se[1],Se[2]);const Fe=Q/F/2;S.emplaceBack(-Fe-q,-1,Fe,.8),S.emplaceBack(Fe+q,-1,Fe,.8),S.emplaceBack(-Fe,0,Fe,1.3),S.emplaceBack(Fe,0,Fe,1.3),S.emplaceBack(Fe+q,-.8,Fe,.7),S.emplaceBack(Fe+q,-.8,Fe,.7),S.emplaceBack(0,0,Fe,1.3),S.emplaceBack(0,0,Fe,1.3),S.emplaceBack(Fe+q,-1.2,Fe,.8),S.emplaceBack(Fe+q,-1.2,Fe,.8),y.emplaceBack(6+R,4+R,8+R),y.emplaceBack(7+R,9+R,5+R),y.emplaceBack(0+R,1+R,2+R),y.emplaceBack(1+R,3+R,2+R),R+=10}}function gwr(b,p){const y={};y.indexArray=new po,y.vertexArray=new Vr,y.colorArray=new Lr,y.indexArray.reserveExact(4*b.length),y.vertexArray.reserveExact(10*b.length),y.colorArray.reserveExact(10*b.length),kwt(b,p,y.indexArray,y.vertexArray,y.colorArray);const T={defined:true};T.emissiveFactor=Wo.black;const S={};return S.baseColorFactor=Wo.white,T.pbrMetallicRoughness=S,y.material=T,y.aabb=new xl([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),y}li(Swt,"ModelBVH");const Rwt=hn([{name:"a_pos_3f",components:3,type:"Float32"}]),ywr=hn([{name:"a_normal_3",components:3,type:"Int16"}]),bwr=hn([{name:"a_centroid_3",components:3,type:"Int16"}]),Pwt=hn([{name:"a_part_color_emissive",components:2,type:"Uint16"}]),xwr=hn([{name:"a_faux_facade_color_emissive",components:2,type:"Uint16"}]),vwr=hn([{name:"a_faux_facade_data",components:4,type:"Uint16"}]),_wr=hn([{name:"a_faux_facade_vertical_range",components:2,type:"Uint16"}]),Twr=hn([{name:"a_bloom_attenuation",components:4,type:"Float32"}]),wwr=hn([{name:"a_flood_light_wall_radius_1i16",components:1,type:"Int16"}]),Ewr=hn([{name:"a_pos_normal_ed",components:4,type:"Int16"}]),Cwr=hn([{name:"a_pos_end",components:4,type:"Int16"},{name:"a_angular_offset_factor",components:1,type:"Int16"}]),Swr=hn([{name:"a_flood_light_ground_radius",components:1,type:"Float32"}]),Awr=hn([{name:"a_centroid_pos",components:2,type:"Uint16"}]),kwr=hn([{name:"a_join_normal_inside",components:3,type:"Int16"}]),Rwr=hn([{name:"a_hidden_by_landmark",components:1,type:"Uint8"}]),Pwr=hn([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]),{members:Iwr}=Ewr;function Fle(b,p,y,T){const S=[],R=0===T?(M,F,G,q,Q,ie)=>{M.push(new nt(ie,G+(ie-F)/(q-F)*(Q-G)))}:(M,F,G,q,Q,ie)=>{M.push(new nt(F+(ie-G)/(Q-G)*(q-F),ie))};for(const M of b){const F=[];for(const G of M){if(G.length<=2)continue;const q=[];for(let ae=0;aep&&R(q,de,pe,_e,Se,p):Fe>y?Ye=p&&R(q,de,pe,_e,Se,p),Ye>y&&Fe<=y&&R(q,de,pe,_e,Se,y)}let Q=G.at(-1);const ie=0===T?Q.x:Q.y;ie>=p&&ie<=y&&q.push(Q),q.length&&(Q=q.at(-1),q[0].x===Q.x&&q[0].y===Q.y||q.push(q[0]),F.push(q))}F.length&&S.push(F)}return S}const Nle={None:0,Model:1,Symbol:2,FillExtrusion:4},K5e=[new nt(0,0),new nt(qr,0),new nt(qr,qr),new nt(0,qr)];function Iwt(b,p){const y=[];let T=[];if(!p||b.length<2)return[b];if(2===b.length)return V7(b[0],b[1],K5e)?[b]:[];for(let S=0;S0&&(T.length>1&&y.push(T),T=[])}return T.length>1&&y.push(T),y}const Z5e=yI.types,Mwr=["fill-extrusion-base","fill-extrusion-height","fill-extrusion-color","fill-extrusion-pattern","fill-extrusion-flood-light-wall-radius","fill-extrusion-line-width","fill-extrusion-emissive-strength"],Lwr=["fill-extrusion-flood-light-ground-radius"],Dwr=Math.pow(2,13),Fwr=Math.pow(2,15)-1,Ole=new nt(0,1),PA=2147483648,Ble=1073741824;function Jq(b,p,y,T,S,R,M,F){b.emplaceBack((p<<1)+M,(y<<1)+R,(Math.floor(T*Dwr)<<1)+S,Math.round(F))}function Qq(b,p,y){b.emplaceBack(p.x*qr,p.y*qr,y?1:0)}function zle(b,p,y,T,S,R){b.emplaceBack(p.x,p.y,(y.x<<1)+T,(y.y<<1)+S,R)}function eX(b,p,y){const T=16384;b.emplaceBack(p.x,p.y,p.z,y[0]*T,y[1]*T,y[2]*T)}class Mwt{constructor(){this.vertexOffset=0,this.vertexCount=0,this.indexOffset=0,this.indexCount=0}}class Ule{constructor(){this.data=[]}get length(){return this.data.length}push(p){this.data.push(p)}get(p){return this.data[p]}static serialize(p,y){const T=p.data.length,S=new Uint32Array(4*T),R=[];R.length=T;for(let M=0;Mp.max.x&&(p.max.x=y.x,S=true),y.yp.max.y&&(p.max.y=y.y,S=true),((0===y.x||y.x===qr)&&y.x===T.x)!=((0===y.y||y.y===qr)&&y.y===T.y)&&this.processBorderOverlap(y,T),S&&this.checkBorderIntersection(y,T)}checkBorderIntersection(p,y){y.x<0!=p.x<0&&this.addBorderIntersection(0,Si(y.y,p.y,(0-y.x)/(p.x-y.x))),y.x>qr!=p.x>qr&&this.addBorderIntersection(1,Si(y.y,p.y,(qr-y.x)/(p.x-y.x))),y.y<0!=p.y<0&&this.addBorderIntersection(2,Si(y.x,p.x,(0-y.y)/(p.y-y.y))),y.y>qr!=p.y>qr&&this.addBorderIntersection(3,Si(y.x,p.x,(qr-y.y)/(p.y-y.y)))}addBorderIntersection(p,y){this.borders||(this.borders=[[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE]]);const T=this.borders[p];yT[1]&&(T[1]=y)}processBorderOverlap(p,y){if(p.x===y.x){if(p.y===y.y)return;const T=0===p.x?0:1;this.addBorderIntersection(T,y.y),this.addBorderIntersection(T,p.y)}else{const T=0===p.y?2:3;this.addBorderIntersection(T,y.x),this.addBorderIntersection(T,p.x)}}centroid(){return 0===this.accCount?new nt(0,0):new nt(Math.floor(Math.max(0,this.acc.x)/this.accCount),Math.floor(Math.max(0,this.acc.y)/this.accCount))}intersectsCount(){return this.borders?this.borders.reduce((p,y)=>p+ +(y[0]!==Number.MAX_VALUE),0):0}}function Lwt(b,p){const y=b.add(p)._unit(),T=bn(b.x*y.x+b.y*y.y,-1,1);var S,R,M;return M=Math.acos(T),Math.min(4,Math.max(-4,Math.tan(M)))/4*Fwr*((S=b).x*(R=p).y-S.y*R.x<0?-1:1)}const Nwr=[b=>b.x<0,b=>b.x>qr,b=>b.y<0,b=>b.y>qr];function Owr(b,p,y,T){const S=[4];if(0===T)return S;y._mult(T);const R=b.sub(y),M=p.sub(y),F=[b,p,R,M];for(let G=0;G<4;G++)for(const q of F)if(Nwr[G](q)){S.push(G);break}return S}class Q5e{constructor(p){this.groundRadiusArray=null,this.groundRadiusBuffer=null,this.vertexArray=new Qn,this.indexArray=new po,this.programConfigurations=new yT(p.layers,{zoom:p.zoom,lut:p.lut},y=>Lwr.includes(y)),this._segments=new Ls,this.hiddenByLandmarkVertexArray=new su,this._segmentToGroundQuads={},this._segmentToGroundQuads[0]=[],this._segmentToRegionTriCounts={},this._segmentToRegionTriCounts[0]=[0,0,0,0,0],this.regionSegments={},this.regionSegments[4]=new Ls}getDefaultSegment(){return this.regionSegments[4]}hasData(){return 0!==this.vertexArray.length}addData(p,y,T,S=false){const R=p.length;if(R>2){let M=Math.max(0,this._segments.get().length-1);const F=this._segments._prepareSegment(4*R,this.vertexArray.length,2*this._segmentToGroundQuads[M].length);let G;M!==this._segments.get().length-1&&(M++,this._segmentToGroundQuads[M]=[],this._segmentToRegionTriCounts[M]=[0,0,0,0,0]);{const q=p[0],Q=p[1];G=Lwt(q.sub(p[R-1])._perp()._unit(),Q.sub(q)._perp()._unit())}for(let q=0;qS.region-R.region);for(let T=0;TG+q,0);let F=0;for(let G=0;G<=4;G++){const q=M[G];if(0!==q){let Q=this.regionSegments[G];Q||(Q=this.regionSegments[G]=new Ls);const ie={vertexOffset:R.vertexOffset,primitiveOffset:R.primitiveOffset+F,vertexLength:R.vertexLength,primitiveLength:q};Q.get().push(ie)}F+=q}for(let G=0;G0?this.hiddenByLandmarkVertexBuffer=p.createVertexBuffer(this.hiddenByLandmarkVertexArray,Rwr.members,true):this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexBuffer.updateData(this.hiddenByLandmarkVertexArray),this._needsHiddenByLandmarkUpdate=false)}destroy(){if(this.vertexBuffer){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexBuffer.destroy(),this.groundRadiusBuffer&&this.groundRadiusBuffer.destroy(),this._segments&&this._segments.destroy(),this.programConfigurations.destroy();for(let p=0;p<=4;p++){const y=this.regionSegments[p];y&&y.destroy()}}}}class Gle{constructor(p){this.zoom=p.zoom,this.canonical=p.canonical,this.overscaling=p.overscaling,this.layers=p.layers,this.pixelRatio=p.pixelRatio,this.layerIds=this.layers.map(y=>y.fqid),this.index=p.index,this.hasPattern=false,this.edgeRadius=0,this.projection=p.projection,this.activeReplacements=[],this.replacementUpdateTime=0,this.centroidData=new $le,this.footprintIndices=new po,this.footprintVertices=new wn,this.footprintSegments=new Ule,this.layoutVertexArray=new Zr,this.centroidVertexArray=new Kc,this.wallVertexArray=new Lo,this.indexArray=new po,this.programConfigurations=new yT(p.layers,{zoom:p.zoom,lut:p.lut},y=>Mwr.includes(y)),this.segments=new Ls,this.stateDependentLayerIds=this.layers.filter(y=>y.isStateDependent()).map(y=>y.id),this.groundEffect=new Q5e(p),this.maxHeight=0,this.partLookup={},this.triangleSubSegments=[],this.polygonSegments=[],this.buildingGroups=new Map,this.worldview=p.worldview,this.hasAppearances=null}updateFootprints(p,y){}updateAppearances(p,y,T,S){return{hasLayoutChanges:false,hasUboChanges:false}}populate(p,y,T,S){this.features=[],this.hasPattern=Sq("fill-extrusion",this.layers,this.pixelRatio,y),this.featuresOnBorder=[],this.borderFeatureIndices=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.selfDEMTileTimestamp=Number.MAX_VALUE,this.borderDEMTileTimestamp=[Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE],this.tileToMeter=le(T),this.edgeRadius=this.layers[0].layout.get("fill-extrusion-edge-radius")/this.tileToMeter,this.wallMode=0!==this.layers[0].paint.get("fill-extrusion-line-width").constantOr(1);for(const{feature:R,id:M,index:F,sourceLayerIndex:G}of p){const q=this.layers[0]._featureFilter.needGeometry,Q=It(R,q);if(!this.layers[0]._featureFilter.filter(new Rl(this.zoom,{worldview:this.worldview,activeFloors:y.activeFloors}),Q,T))continue;const ie={id:M,sourceLayerIndex:G,index:F,geometry:q?Q.geometry:vt(R,T,S),properties:R.properties,type:R.type,patterns:{}},ae=this.layoutVertexArray.length,de="Polygon"===Z5e[ie.type];if(this.hasPattern)this.features.push({featureId:R.id,feature:hI("fill-extrusion",this.layers,ie,this.zoom,this.pixelRatio,y)});else if(this.wallMode)for(const pe of ie.geometry)for(const _e of Iwt(pe,de))this.addFeature(R.id,ie,[_e],F,T,{},y.availableImages,S,y.brightness);else this.addFeature(R.id,ie,ie.geometry,F,T,{},y.availableImages,S,y.brightness);y.featureIndex.insert(R,ie.geometry,F,G,this.index,ae)}this._finalizeBuildingGroups(),this.sortBorders(),"mercator"===this.projection.name&&this.splitToSubtiles(),this.groundEffect.prepareBorderSegments(),this.polygonSegments.length=0}addFeatures(p,y,T,S,R,M){for(const{featureId:F,feature:G}of this.features){const q="Polygon"===Z5e[G.type],{geometry:Q}=G;if(this.wallMode)for(const ie of Q)for(const ae of Iwt(ie,q))this.addFeature(F,G,[ae],G.index,y,T,S,R,M);else this.addFeature(F,G,Q,G.index,y,T,S,R,M)}this._finalizeBuildingGroups(),this.sortBorders(),"mercator"===this.projection.name&&this.splitToSubtiles()}update(p,y,T,S,R,M,F){this.programConfigurations.updatePaintArrays(p,y,R,T,S,M,F,this.worldview),this.groundEffect.update(p,y,R,T,S,M,F,this.worldview)}updateExpressions(p){this.programConfigurations.updateExpressions(p),this.groundEffect.programConfigurations.updateExpressions(p)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload||this.groundEffect.programConfigurations.needsUpload}upload(p){this.uploaded||(this.layoutVertexBuffer=p.createVertexBuffer(this.layoutVertexArray,Iwr),this.indexBuffer=p.createIndexBuffer(this.indexArray),this.wallVertexBuffer=p.createVertexBuffer(this.wallVertexArray,kwr.members),this.layoutVertexExtArray&&(this.layoutVertexExtBuffer=p.createVertexBuffer(this.layoutVertexExtArray,Pwr.members,true)),this.groundEffect.upload(p)),this.groundEffect.uploadPaintProperties(p),this.programConfigurations.upload(p),this.uploaded=true}uploadCentroid(p){this.groundEffect.uploadHiddenByLandmark(p),this.needsCentroidUpdate&&(!this.centroidVertexBuffer&&this.centroidVertexArray.length>0?this.centroidVertexBuffer=p.createVertexBuffer(this.centroidVertexArray,Awr.members,true):this.centroidVertexBuffer&&this.centroidVertexBuffer.updateData(this.centroidVertexArray),this.needsCentroidUpdate=false)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.centroidVertexBuffer&&this.centroidVertexBuffer.destroy(),this.layoutVertexExtBuffer&&this.layoutVertexExtBuffer.destroy(),this.groundEffect.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(p,y,T,S,R,M,F,G,q){const Q=this.layers[0].paint.get("fill-extrusion-flood-light-ground-radius").evaluate(y,{})/this.tileToMeter,ie=[new nt(0,0),new nt(qr,qr)],ae=G.projection,de="globe"===ae.name,pe=this.wallMode||"Polygon"===Z5e[y.type],_e=new J5e;_e.centroidDataIndex=this.centroidData.length;const Se=new Vle;Se.buildingId=p,y.properties&&Object.hasOwn(y.properties,"building_id")&&(Se.buildingId=Number(y.properties.building_id)),_e.buildingId=Se.buildingId;const Fe=this.layers[0].paint.get("fill-extrusion-base").evaluate(y,{},R)<=0,Ye=this.layers[0].paint.get("fill-extrusion-height").evaluate(y,{},R);let Xe;if(Se.height=Ye,Se.vertexArrayOffset=this.layoutVertexArray.length,Se.groundVertexArrayOffset=this.groundEffect.vertexArray.length,de&&!this.layoutVertexExtArray&&(this.layoutVertexExtArray=new Kr),this.wallMode){if(de)return void yn("Non zero fill-extrusion-line-width is not yet supported on globe.");if(1!==T.length)return;Xe=function(Lt){const Nt=Lt[0].x===Lt.at(-1).x&&Lt[0].y===Lt.at(-1).y,un=function(ur){let pr=0;const ni=ur.length;for(let Cr=0;Cr=0}(Lt);un||(Lt=Lt.reverse());const _n={geometry:[],joinNormals:[],indices:[]},Dn=[],Ln=[],zn=[];let or=Lt.length;for(;or>=2&&Lt[or-1].equals(Lt[or-2]);)or--;if(or<(Nt?3:2))return _n;let nn,En,In,Gn,qn,Zn=0;for(;Zn0;let Fi="miter";const Bi=2;"miter"===Fi&&Cr>Bi&&(Fi="bevel"),"bevel"===Fi&&(Cr>100&&(Fi="flipbevel"),Cr{const va=new nt(Ii.x,Ii.y),ja=new nt(Ii.x,Ii.y);va.x+=mo.x*xa,va.y+=mo.y*xa,ja.x-=mo.x*Math.max(io,1),ja.y-=mo.y*Math.max(io,1),zn.push(mo),Dn.push(va),Ln.push(ja)};if("miter"===Fi)pr._mult(Cr),no(nn,pr,0,0);else if("flipbevel"===Fi)pr=qn.mult(-1),no(nn,pr,0,0),no(nn,pr.mult(-1),0,0);else{const Ii=-Math.sqrt(Cr*Cr-1),mo=Fr?Ii:0,io=Fr?0:Ii;En&&no(nn,Gn,mo,io),In&&no(nn,qn,mo,io)}}_n.geometry=[...Dn,...Ln.reverse(),Dn[0]],_n.joinNormals=[...zn,...zn.reverse(),zn.at(-1)];const Hn=_n.geometry.length-1;for(let ur=0;urLt<(Nt.length-1)/2||Lt===Nt.length-1,rt=this.wallMode?[T]:Pt(T,500);for(let Lt=rt.length-1;Lt>=0;Lt--){const Nt=rt[Lt];(0===Nt.length||Uwr(Nt[0]))&&rt.splice(Lt,1)}let lt;if(de)lt=Uwt(rt,ie,R);else{lt=[];for(const Lt of rt)lt.push({polygon:Lt,bounds:ie})}const Bt=pe?this.edgeRadius:0,ht=Bt>0&&this.zoom<17,Tt=(Lt,Nt)=>{if(0===Lt.length)return false;const un=Lt.at(-1);return Nt.x===un.x&&Nt.y===un.y};for(const{polygon:Lt,bounds:Nt}of lt){let un=0,_n=0;for(const or of Lt)pe&&!or[0].equals(or.at(-1))&&or.push(or[0]),_n+=pe?or.length-1:or.length;const Dn=this.segments.prepareSegment((pe?5:4)*_n,this.layoutVertexArray,this.indexArray);Se.footprintSegIdx<0&&(Se.footprintSegIdx=this.footprintSegments.length),Se.polygonSegIdx<0&&(Se.polygonSegIdx=this.polygonSegments.length);const Ln={triangleArrayOffset:this.indexArray.length,triangleCount:0,triangleSegIdx:this.segments.segments.length-1},zn=new Mwt;if(zn.vertexOffset=this.footprintVertices.length,zn.indexOffset=3*this.footprintIndices.length,zn.ringIndices=[],pe){const or=[],nn=[];un=Dn.vertexLength;for(let In=0;In4&&Owt(nn[nn.length-2],nn[0],nn[1]),In=Bt?zwr(nn[nn.length-2],nn[0],nn[1],Bt):0;const Gn=[];let qn,Zn,Hn;Zn=nn[1].sub(nn[0])._perp()._unit();let ur=true;for(let pr=1,ni=0;pr0?1:0,mo=Cr.dist(Fr);if(ni+mo>32768&&(ni=0),Bt){Hn=Hle(Fr,Fi,Zn);let ja=Fwt(Cr,Fr,Fi,eBe(Zn,Hn),Bt);isNaN(ja)&&(ja=0);const Ss=Bwr(Cr,Fr,new nt(0,0));Cr=Cr.add(Ss.mult(In))._round(),Fr=Fr.add(Ss.mult(-ja))._round(),In=ja,Zn=Hn,Fe&&this.zoom>=17&&(Tt(Gn,Cr)||Gn.push(Cr),Tt(Gn,Fr)||Gn.push(Fr))}const io=Dn.vertexLength,xa=nn.length>4&&Owt(Cr,Fr,Fi);let va=Bwt(ni,En,ur);if(Jq(this.layoutVertexArray,Cr.x,Cr.y,no,Ii,0,0,va),Jq(this.layoutVertexArray,Cr.x,Cr.y,no,Ii,0,1,va),this.wallMode){const ja=We(pr-1,nn),Ss=Xe.joinNormals[pr-1];Qq(this.wallVertexArray,Ss,ja),Qq(this.wallVertexArray,Ss,ja)}if(ni+=mo,va=Bwt(ni,xa,!ur),En=xa,Jq(this.layoutVertexArray,Fr.x,Fr.y,no,Ii,0,0,va),Jq(this.layoutVertexArray,Fr.x,Fr.y,no,Ii,0,1,va),this.wallMode){const ja=We(pr,nn),Ss=Xe.joinNormals[pr];Qq(this.wallVertexArray,Ss,ja),Qq(this.wallVertexArray,Ss,ja)}if(Dn.vertexLength+=4,this.indexArray.emplaceBack(io+0,io+1,io+2),this.indexArray.emplaceBack(io+1,io+3,io+2),Dn.primitiveLength+=2,Bt){const ja=un+(1===pr?nn.length-2:pr-2),Ss=1===pr?un:ja+1;if(this.indexArray.emplaceBack(io+1,ja,io+3),this.indexArray.emplaceBack(ja,Ss,io+3),Dn.primitiveLength+=2,void 0===qn&&(qn=io),!tBe(Fi,nn[pr],Nt)){const _d=pr===nn.length-1?qn:Dn.vertexLength;this.indexArray.emplaceBack(io+2,io+3,_d),this.indexArray.emplaceBack(io+3,_d+1,_d),this.indexArray.emplaceBack(io+3,Ss,_d+1),Dn.primitiveLength+=3}ur=!ur}if(de){const ja=this.layoutVertexExtArray,Ss=ae.projectTilePoint(Cr.x,Cr.y,R),_d=ae.projectTilePoint(Fr.x,Fr.y,R),y0=ae.upVector(R,Cr.x,Cr.y),Tu=ae.upVector(R,Fr.x,Fr.y);eX(ja,Ss,y0),eX(ja,Ss,y0),eX(ja,_d,Tu),eX(ja,_d,Tu)}}pe&&(un+=nn.length-1),Fe&&Bt&&this.zoom>=17&&(0!==Gn.length&&Tt(Gn,Gn[0])&&Gn.pop(),this.groundEffect.addData(Gn,Nt,Q,Bt>0))}this.footprintSegments.push(zn),Ln.triangleCount=this.indexArray.length-Ln.triangleArrayOffset,this.polygonSegments.push(Ln),++Se.footprintSegLen,++Se.polygonSegLen}if(Se.vertexCount=this.layoutVertexArray.length-Se.vertexArrayOffset,Se.groundVertexCount=this.groundEffect.vertexArray.length-Se.groundVertexArrayOffset,0!==Se.vertexCount){if(Se.centroidXY=_e.borders?Ole:this.encodeCentroid(_e,Se),y.properties&&Object.hasOwn(y.properties,"building_id")){const Lt=Se.buildingId;let Nt=this.buildingGroups.get(Lt);Nt||(Nt={accX:0,accY:0,accCount:0,mergedMin:new nt(Number.MAX_VALUE,Number.MAX_VALUE),mergedMax:new nt(-Number.MAX_VALUE,-Number.MAX_VALUE),partIndices:[]},this.buildingGroups.set(Lt,Nt)),Nt.accX+=_e.acc.x,Nt.accY+=_e.acc.y,Nt.accCount+=_e.accCount,Nt.mergedMin.x=Math.min(Nt.mergedMin.x,Se.min.x),Nt.mergedMin.y=Math.min(Nt.mergedMin.y,Se.min.y),Nt.mergedMax.x=Math.max(Nt.mergedMax.x,Se.max.x),Nt.mergedMax.y=Math.max(Nt.mergedMax.y,Se.max.y),Nt.partIndices.push(this.centroidData.length)}if(this.centroidData.push(Se),_e.borders){this.featuresOnBorder.push(_e);const Lt=this.featuresOnBorder.length-1;for(let Nt=0;Nt<_e.borders.length;Nt++)_e.borders[Nt][0]!==Number.MAX_VALUE&&this.borderFeatureIndices[Nt].push(Lt)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,y,S,M,F,R,q,void 0,this.worldview),this.groundEffect.addPaintPropertiesData(y,S,M,F,R,q,this.worldview),this.maxHeight=Math.max(this.maxHeight,Ye)}}_finalizeBuildingGroups(){for(const[,p]of this.buildingGroups){if(0===p.partIndices.length)continue;const y=new J5e;y.acc=new nt(p.accX,p.accY),y.accCount=p.accCount;const T=new Vle;T.min=p.mergedMin,T.max=p.mergedMax;const S=this.encodeCentroid(y,T),R=y.centroid();for(const M of p.partIndices){const F=this.centroidData.get(M);F.centroidXY.x===Ole.x&&F.centroidXY.y===Ole.y||(F.centroidXY=S),F.min=p.mergedMin,F.max=p.mergedMax,F.groupCentroidPos=R}}this.buildingGroups.clear()}sortBorders(){for(let p=0;pthis.featuresOnBorder[y].borders[p][0]-this.featuresOnBorder[T].borders[p][0])}splitToSubtiles(){const p=[];for(let F=0;Fqr),Q=2*q+(+(G.min.x+G.max.x>qr)^q);for(let ie=0;ieF.triangleSegmentIdx===G.triangleSegmentIdx?F.subtile-G.subtile:F.triangleSegmentIdx-G.triangleSegmentIdx);let T=0,S=0,R=0;for(const F of p){if(F.triangleSegmentIdx!==T)break;R++}const M=p.length;for(;S!==p.length;){T=p[S].triangleSegmentIdx;let F=0,G=S,q=S;for(let Q=G;Q0&&this.triangleSubSegments.push({segment:de,min:ie,max:ae}),G=q;for(let pe=G;pe[Si(_e[0],Se[0],Fe[0]),Si(_e[1],Se[1],Fe[1])],de=[],pe=[];for(const _e of this.triangleSubSegments){de[0]=_e.min.x/qr,de[1]=_e.min.y/qr,pe[0]=_e.max.x/qr,pe[1]=_e.max.y/qr;const Se=ae(Q,ie,de),Fe=ae(Q,ie,pe);if(0===new xl([Se[0],Se[1],R],[Fe[0],Fe[1],M]).intersectsPrecise(T)){q&&(S.segments.push(q),q=void 0);continue}const Ye=_e.segment;q&&q.vertexOffset!==Ye.vertexOffset&&(S.segments.push(q),q=void 0),q?(q.vertexLength+=Ye.vertexLength,q.primitiveLength+=Ye.primitiveLength):q={vertexOffset:Ye.vertexOffset,primitiveLength:Ye.primitiveLength,vertexLength:Ye.vertexLength,primitiveOffset:Ye.primitiveOffset,sortKey:void 0,vaos:{}}}return q&&S.segments.push(q),S}encodeCentroid(p,y){const T=p.centroid(),S=y.span(),R=Math.min(7,Math.round(S.x*this.tileToMeter/10)),M=Math.min(6,Math.round(S.y*this.tileToMeter/10));return new nt(bn(T.x,1,8191)<<3|R,bn(T.y,1,8191)<<3|M)}encodeBorderCentroid(p){if(!p.borders)return new nt(0,0);const y=p.borders,T=Number.MAX_VALUE;if(y[0][0]!==T||y[1][0]!==T){const S=y[0][0]!==T?0:1;return new nt(6|(y[0][0]!==T?0:65528),(y[S][0]+y[S][1])/2<<3|6)}{const S=y[2][0]!==T?2:3;return new nt((y[S][0]+y[S][1])/2<<3|6,6|(y[2][0]!==T?0:65528))}}showCentroid(p){const y=this.centroidData.get(p.centroidDataIndex);if(y.flags&=PA,0!==y.groupCentroidPos.x||0!==y.groupCentroidPos.y){const T=y.span(),S=Math.min(7,Math.round(T.x*this.tileToMeter/10)),R=Math.min(6,Math.round(T.y*this.tileToMeter/10));y.centroidXY=new nt(bn(y.groupCentroidPos.x,1,8191)<<3|S,bn(y.groupCentroidPos.y,1,8191)<<3|R)}else y.centroidXY=new nt(0,0);this.writeCentroidToBuffer(y)}writeCentroidToBuffer(p){this.groundEffect.updateHiddenByLandmark(p);const y=p.vertexArrayOffset,T=p.vertexCount+p.vertexArrayOffset,S=-1073741824&p.flags?Ole:p.centroidXY,R=this.centroidVertexArray.geta_centroid_pos0(y);if(this.centroidVertexArray.geta_centroid_pos1(y)!==S.y||R!==S.x){for(let M=y;MG.max.x||G.min.x>M.max.x||M.min.y>G.max.y||G.min.y>M.max.y||M.footprint.buildingIds.has(G.buildingId)&&(G.flags|=M.clipMask!==Nle.None?-1073741824:PA);else for(const G of this.centroidData)if(!(G.flags&PA||G.flags&Ble||M.min.x>G.max.x||G.min.x>M.max.x||M.min.y>G.max.y||G.min.y>M.max.y))for(let q=0;qy!=de>y&&p<(this.footprintVertices.int16[2*(Q+M.vertexOffset)+0]-ie)*(y-ae)/(de-ae)+ie&&(S=!S)}F=G}}return S}getHeightAtTileCoord(p,y){let T=Number.NEGATIVE_INFINITY,S=true;const R=4*(p+qr)*qr+(y+qr);if(Object.hasOwn(this.partLookup,R)){const G=this.partLookup[R];return G?{height:G.height,hidden:!!(G.flags&PA)}:void 0}const M=this.centroidData.buffer,F=this.centroidData.length;for(let G=0;GM[q+4]||M[q+2]>p||y>M[q+5]||M[q+3]>y)continue;const Q=M[q+13];if(Q<=T)continue;const ie=this.centroidData.get(G);this.footprintContainsPoint(p,y,ie)&&(T=Q,this.partLookup[R]=ie,S=!!(ie.flags&PA))}if(T!==Number.NEGATIVE_INFINITY)return{height:T,hidden:S};this.partLookup[R]=void 0}}function Bwr(b,p,y){return b.equals(p)?y:p.sub(b)._unit()}function Hle(b,p,y){return b.equals(p)?y:p.sub(b)._perp()._unit()}function Dwt(b,p){const y=b.add(p),T=y.mag();return 0===T?b:y.div(T)}function eBe(b,p){const y=Dwt(b,p);return b.x*y.x+b.y*y.y}function zwr(b,p,y,T){let S,R;return b.equals(p)?(R=Hle(p,y,new nt(0,0)),S=R):(S=p.sub(b)._perp()._unit(),R=Hle(p,y,S)),Fwt(b,p,y,eBe(S,R),T)}function Fwt(b,p,y,T,S){const R=Math.sqrt(1-T*T);return Math.min(b.dist(p)/3,p.dist(y)/3,S*R/T)}function tBe(b,p,y){return b.xy[1].x&&p.x>y[1].x||b.yy[1].y&&p.y>y[1].y}function Nwt(b,p){return b.xp[1].x||b.yp[1].y}function Uwr(b){return b.every(p=>p.x<=0)||b.every(p=>p.x>=qr)||b.every(p=>p.y<=0)||b.every(p=>p.y>=qr)}function Owt(b,p,y){if(b.x<0||b.x>=qr||p.x<0||p.x>=qr||y.x<0||y.x>=qr)return false;const T=y.sub(p),S=T.perp(),R=b.sub(p);return(T.x*R.x+T.y*R.y)/Math.sqrt((T.x*T.x+T.y*T.y)*(R.x*R.x+R.y*R.y))>-.866&&S.x*R.x+S.y*R.y<0}function Bwt(b,p,y){const T=p?2|b:-3&b;return y?1|T:-2&T}function zwt(){const b=Math.PI/32,p=Math.tan(b),y=xA;return y*Math.sqrt(1+2*p*p)-y}function Uwt(b,p,y){const T=1<{for(const ht of lt)pe.push({polygon:ht,bounds:Bt})},Se=Math.ceil(Math.log2(Q)),Fe=Math.ceil(Math.log2(ie)),Ye=Se-Fe,Xe=[];for(let lt=0;lt0?0:1);for(let lt=0;ltBt+1?rt.push({polygons:Dn,bounds:zn,depth:Bt+1}):_e(Dn,zn)}if(Ln.length){const zn=[new nt(0===ht?_n:Tt.x,1===ht?_n:Tt.y),Lt];Xe.length>Bt+1?rt.push({polygons:Ln,bounds:zn,depth:Bt+1}):_e(Ln,zn)}}return pe}(b,p,Math.ceil((R-S)/11.25),Math.ceil((M-F)/11.25),1,(G,q,Q)=>{if(0===G)return .5*(q+Q);{const ie=Ju((y.y+q/qr)/T);return(Qm(.5*(Ju((y.y+Q/qr)/T)+ie))*T-y.y)*qr}})}function Vwr(b,p,y,T,S,R){const M=Math.pow(2,T.z-S.z);for(let F=0;FnBe?-1:(new Int32Array(this.module.heap32.buffer,y,p.length).set(p),y)}createFloatArray(p){const y=this.memoryStackNextFree;return this.memoryStackNextFree+=p.length*Float32Array.BYTES_PER_ELEMENT,this.memoryStackNextFree-this.memoryStack>nBe?-1:(new Float32Array(this.module.heapF32.buffer,y,p.length).set(p),y)}readStringBuffer(p){let y="";for(;0!==this.module.heapU8[p];)y+=String.fromCharCode(this.module.heapU8[p]),++p;return y}setStyle(p){const y=p.normalScale;this.module.setStyle(y[0],y[1],y[2],p.tileToMeters)}setAOOptions(p,y){this.module.setAOOptions(p?1:0,y)}setMetricOptions(p,y){this.module.setMetricOptions(p?1:0,y)}setStructuralOptions(p){this.module.setStructuralOptions(p?1:0)}setFacadeOptions(p,y){this.module.setFacadeOptions(p,y?1:0)}setFauxFacadeOptions(p,y,T){this.module.setFauxFacadeOptions(p?1:0,y?1:0,T)}setFacadeClassifierOptions(p){this.module.setFacadeClassifierOptions(p)}generateMesh(p,y){this.memoryStackNextFree=this.memoryStack;for(const F of p){const G=this.createIntArray(F.ringIndices),q=this.createFloatArray(F.coordinates);if(-1===G||-1===q)return`building_gen: Out of stack memory: ${this.memoryStackNextFree-this.memoryStack}/4096`;this.module.addFeature(F.id,F.sourceId,F.minHeight,F.height,F.roofType,q,G,F.ringIndices.length-1)}for(const F of y){let G;G=F.entrances?JSON.parse(F.entrances):[];const q=this.createFloatArray(G),Q=this.createFloatArray(F.coordinates);if(-1===q||-1===Q)return`building_gen: Out of stack memory: ${this.memoryStackNextFree-this.memoryStack}/4096`;this.module.addFacade(F.sourceId,F.crossPerc,F.distanceToRoad,q,G.length,Q,F.coordinates.length)}if(!this.module.generateMesh()){const F=this.module.getLastError();return this.readStringBuffer(F)}const T=this.module.getMeshCount(),S=new Array(T);for(let F=0;Fy||S.y<-p||S.y>y)return false;return true}function Hwr(b){switch(b){case"flat":return 3;case"hipped":return 1;case"gabled":return 2;case"parapet":return 0;case"mansard":return 4;case"skillion":return 5;case"pyramidal":return 6;default:throw new Error(`Unknown roof shape: ${b}`)}}let $wt,Gwt,Q7=null,Hwt=null,a1=null;class rBe{constructor(){this.layoutVertexArray=new Vr,this.layoutAttenuationArray=new Lr,this.layoutColorArray=new Di,this.indexArray=new po,this.indexArrayForConflation=new po,this.segmentsBucket=new Ls}}class iBe{constructor(p){this.layoutFacadePaintArray=null,this.layoutFacadeDataArray=null,this.layoutFacadeVerticalRangeArray=null,this.segmentsBucket=new Ls,this.entranceBloom=new rBe;const y=66560;this.layoutVertexArray=new Vr,this.layoutVertexArray.reserve(y),this.layoutNormalArray=new Bn,this.layoutNormalArray.reserve(y),this.layoutCentroidArray=new Bn,this.layoutCentroidArray.reserve(y),this.layoutColorArray=new Di,this.layoutColorArray.reserve(y),this.layoutFloodLightDataArray=new au,this.layoutFloodLightDataArray.reserve(y),this.layoutAOArray=new su,this.layoutAOArray.reserve(y),this.indexArray=new po,this.indexArray.reserve(66560),this.indexArrayForConflation=new po,this.segmentsBucket=new Ls,this.entranceBloom=new rBe,p&&(this.layoutFacadePaintArray=new Di,this.layoutFacadeDataArray=new si,this.layoutFacadeVerticalRangeArray=new Di)}reserve(p,y,T){this.layoutVertexArray.reserveForAdditional(p),this.layoutCentroidArray.reserveForAdditional(p),this.layoutFloodLightDataArray.reserveForAdditional(p),this.layoutNormalArray.reserveForAdditional(p),this.layoutAOArray.reserveForAdditional(p),this.layoutColorArray.reserveForAdditional(p),this.indexArray.reserveForAdditional(y),T&&(this.layoutFacadePaintArray.reserveForAdditional(p),this.layoutFacadeDataArray.reserveForAdditional(p),this.layoutFacadeVerticalRangeArray.reserveForAdditional(p))}}class Wwt{constructor(p){this.requiresHDRuntime=true,this.colorBufferUploaded=false,this.maxHeight=0,this.replacementUpdateTime=0,this.activeReplacements=[],this.footprints=[],this.footprintsVertices=new $l,this.footprintsIndices=new cl,this.footprintsMin=new nt(1/0,1/0),this.footprintsMax=new nt(-1/0,-1/0),this.featuresOnBorder=[],this.buildingWithoutFacade=new iBe(false),this.buildingWithFacade=new iBe(true),this.indexArrayForConflationUploaded=false,this.featureFootprintLookup=new Map,this.buildingIds=new Set,this.footprintLookup={},this.zoom=p.zoom,this.canonical=p.canonical,this.layers=p.layers,this.layerIds=this.layers.map(y=>y.fqid),this.index=p.index,this.hasPattern=false,this.worldview=p.worldview,this.lut=p.lut,this.programConfigurations=new yT(p.layers,{zoom:p.zoom,lut:p.lut}),this.stateDependentLayerIds=this.layers.filter(y=>y.isStateDependent()).map(y=>y.id),this.projection=p.projection,this.groundEffect=new Q5e(p),this.groundEffect.groundRadiusArray=new Wn,this.hasAppearances=null}updateFootprints(p,y){const T=new Ple([],[],1),S={vertices:[],indices:new Uint32Array(0),grid:T,min:this.footprintsMin,max:this.footprintsMax,buildingIds:this.buildingIds};y.push({footprint:S,id:p})}updateAppearances(p,y,T,S){return{hasLayoutChanges:false,hasUboChanges:false}}populate(p,y,T,S){if(!a1)return;const R=le(T);this.tileToMeter=R,this.brightness=y.brightness,a1.setStyle({normalScale:[1,-1,R],tileToMeters:R}),a1.setAOOptions(false,.3),a1.setMetricOptions(false,16),a1.setStructuralOptions(true),a1.setFacadeClassifierOptions(3);const M=new Map,F=new Map;let G=0;for(const{feature:Se}of p){if("LineString"!==Vwt[Se.type]){M.set(Se.id,Se.properties.source_id);continue}const Fe=this.layers[0]._featureFilter.needGeometry;if(Fe&&!this.layers[0]._featureFilter.filter(new Rl(this.zoom),Se,T))continue;const Ye=It(Se,Fe);if(!Fe&&!this.layers[0]._featureFilter.filter(new Rl(this.zoom),Ye,T))continue;const Xe=Fe?Ye.geometry:vt(Se,T,S),We=[];for(const ht of Xe)for(const Tt of ht)We.push(Tt.x),We.push(Tt.y);const rt={coordinates:We,crossPerc:Se.properties.cross_perc,distanceToRoad:Se.properties.distance_to_road,entrances:Se.properties.entrances,sourceId:0},lt=Se.properties.source_id;let Bt=F.get(lt);Bt||(Bt=[],F.set(lt,Bt)),Bt.push(rt),++G}this.maxHeight=0;const q=new Array,Q=new Set,ie=Se=>{null!=Se&&Q.add(Se)},ae=(Se,Fe)=>{null!=Se&&q.push({buildingId:Se,footprintIndex:Fe})},de=64*(p.length-G),pe=de/2;this.buildingWithFacade.reserve(de,pe,true),this.buildingWithoutFacade.reserve(2*de,2*pe,false),this.footprintsIndices.reserve(16*(p.length-G)),this.footprintsVertices.reserve(8*(p.length-G));for(const{feature:Se,id:Fe,index:Ye,sourceLayerIndex:Xe}of p){if("LineString"===Vwt[Se.type])continue;const We=this.layers[0]._featureFilter.needGeometry;if(We&&!this.layers[0]._featureFilter.filter(new Rl(this.zoom),Se,T))continue;let rt=null;if(Se.properties&&Object.hasOwn(Se.properties,"building_id")&&(rt=Number(Se.properties.building_id),Q.has(rt)))continue;const lt=It(Se,We);if(!We&&!this.layers[0]._featureFilter.filter(new Rl(this.zoom),lt,T))continue;const Bt=We?lt.geometry:vt(Se,T,S),ht=Pt(Bt,500);let Tt=false;for(const No of ht)if(1!==No.length){Tt=true;break}if(Tt){ie(rt);continue}if(!Gwr(Bt,163)){ie(rt);continue}const Lt=this.layers[0],Nt=Hwr(Lt.layout.get("building-roof-shape").evaluate(Se,{},T)),un=Lt.layout.get("building-base").evaluate(Se,{},T),_n=Lt.layout.get("building-height").evaluate(Se,{},T),Dn=Lt.layout.get("building-flood-light-ground-radius").evaluate(Se,{},T),Ln=Lt.paint.get("building-ambient-occlusion-intensity"),zn=Dn/this.tileToMeter;Se.properties["building-part"]="roof";const or=Lt.paint.get("building-color").evaluate(Se,{},this.canonical).toPremultipliedRenderColor(this.lut),nn=Lt.paint.get("building-emissive-strength").evaluate(Se,{},this.canonical);Se.properties["building-part"]="wall";const En=Lt.paint.get("building-color").evaluate(Se,{},this.canonical).toPremultipliedRenderColor(this.lut),In=Lt.paint.get("building-emissive-strength").evaluate(Se,{},this.canonical);Se.properties["building-part"]="window";const Gn=Lt.paint.get("building-color").evaluate(Se,{},this.canonical).toPremultipliedRenderColor(this.lut),qn=Lt.paint.get("building-emissive-strength").evaluate(Se,{},this.canonical);Se.properties["building-part"]="door";const Zn=Lt.paint.get("building-color").evaluate(Se,{},this.canonical).toPremultipliedRenderColor(this.lut),Hn=Lt.paint.get("building-emissive-strength").evaluate(Se,{},this.canonical);let ur=Lt.layout.get("building-flood-light-wall-radius").evaluate(Se,{},T);ur=bn(ur,0,2048);const pr=ur/2048*Wle,ni=M.get(Fe),Cr=F.get(ni)||[],Fr=0!==Cr.length&&Lt.layout.get("building-facade").evaluate(Se,{},T);a1.setFacadeOptions(4,true),a1.setFauxFacadeOptions(Fr,false,1);let Fi=0,Bi=0,no=0,Ii=0,mo=0,io=0,xa=0,va=0,ja=0,Ss=0,_d=0;if(Fr){let No=Math.round(Lt.layout.get("building-facade-floors").evaluate(Se,{},T));if(0===un){No=Math.max(1,No-(Cr.length>0?1:0));let Wl=4;if(_n>100){const wu=[10,13,15];Wl=wu[Se.id?Se.id%wu.length:0]}else _n<=10&&(Wl=3);a1.setFacadeOptions(Wl,true),mo=(_n<15?1.3:1.61803)*Wl/R}else mo=un/R;io=_n/R,mo=Math.min(mo,io),no=Lt.layout.get("building-facade-unit-width").evaluate(Se,{},T)/R,Ii=(io-mo)/No,a1.setFauxFacadeOptions(true,true,no);const mf=Lt.layout.get("building-facade-window").evaluate(Se,{},T);Fi=mf[0],Bi=mf[1],xa=Math.floor(65535*Math.min(1,mo/qr)),va=Math.floor(65535*Math.min(1,io/qr)),ja=Math.floor(255*Fi)<<8|Math.floor(255*Bi),Ss=Math.floor(65535*Math.min(1,no/qr)),_d=Math.floor(65535*Math.min(1,Ii/qr))}const y0=Array(ht.length),Tu={x:1/0,y:1/0},Ma={x:-1/0,y:-1/0},Gl={x:0,y:0};let Ou=0;for(let No=0;No0){const Wl=[],wu=Array(mf.length+1);wu[0]=0;for(let c1=0;c1qr||Tu.y<0||Ma.y>qr)&&this.featuresOnBorder.push({featureId:Se.id,footprintIndex:this.footprints.length});{const No=dI(W2,null,2);this.footprintsIndices.resize(this.footprintsIndices.length+No.length),this.footprintsIndices.uint16.set(No,gy),this.buildingIds.add(rt??Se.id),this.footprintsMin.x=Math.min(this.footprintsMin.x,Fb.x),this.footprintsMin.y=Math.min(this.footprintsMin.y,Fb.y),this.footprintsMax.x=Math.max(this.footprintsMax.x,cm.x),this.footprintsMax.y=Math.max(this.footprintsMax.y,cm.y);const mf={footprintVertexOffset:sh,footprintVertexLength:this.footprintsVertices.length-sh,footprintIndexOffset:gy,footprintIndexLength:this.footprintsIndices.length-gy,min:Fb,max:cm,hiddenFlags:0,indicesOffset:Mh,indicesLength:my,bloomIndicesOffset:fy,bloomIndicesLength:hy,groundEffectVertexOffset:MA,groundEffectVertexLength:_T,hasFauxFacade:Fr,height:py,promoteId:Fe,feature:lt,parts:sm,buildingBloom:lm},Wl=this.footprints.length;void 0!==Se.id&&this.featureFootprintLookup.set(Se.id,Wl),ae(rt,Wl),this.footprints.push(mf)}this.programConfigurations.populatePaintArrays(Po.layoutVertexArray.length,Se,Ye,{},y.availableImages,T,y.brightness),this.groundEffect.addPaintPropertiesData(Se,Ye,{},y.availableImages,T,y.brightness),y.featureIndex.insert(Se,Bt,Ye,Xe,this.index,Ih)}q.forEach(({buildingId:Se,footprintIndex:Fe})=>{Q.has(Se)&&(this.footprints[Fe].hiddenFlags|=4)});const _e=new Set;this.buildingIds.forEach((Se,Fe,Ye)=>{Q.has(Se)||_e.add(Se)}),this.buildingIds=_e,this.groundEffect.prepareBorderSegments()}update(p,y,T,S,R,M,F){this.programConfigurations.updatePaintArrays(p,y,R,T,S,M,F),this.groundEffect.update(p,y,R,T,S,M,F),this.evaluate(this.layers[0],p),this.colorBufferUploaded=false}updateExpressions(p){this.programConfigurations.updateExpressions(p),this.groundEffect.programConfigurations.updateExpressions(p)}isEmpty(){return 0===this.buildingWithoutFacade.layoutVertexArray.length&&0===this.buildingWithFacade.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload||this.groundEffect.programConfigurations.needsUpload}upload(p){const y=T=>{T.layoutVertexBuffer=p.createVertexBuffer(T.layoutVertexArray,Rwt.members),T.layoutNormalBuffer=p.createVertexBuffer(T.layoutNormalArray,ywr.members),T.layoutCentroidBuffer=p.createVertexBuffer(T.layoutCentroidArray,bwr.members),T.layoutFloodLightDataBuffer=p.createVertexBuffer(T.layoutFloodLightDataArray,wwr.members),T.layoutFacadeDataArray&&T.layoutFacadeDataArray.length&&(T.layoutFacadeDataBuffer=p.createVertexBuffer(T.layoutFacadeDataArray,vwr.members)),T.layoutFacadeVerticalRangeArray&&T.layoutFacadeVerticalRangeArray.length&&(T.layoutFacadeVerticalRangeBuffer=p.createVertexBuffer(T.layoutFacadeVerticalRangeArray,_wr.members)),T.entranceBloom.layoutVertexArray.length&&(T.entranceBloom.layoutVertexBuffer=p.createVertexBuffer(T.entranceBloom.layoutVertexArray,Rwt.members),T.entranceBloom.layoutAttenuationBuffer=p.createVertexBuffer(T.entranceBloom.layoutAttenuationArray,Twr.members)),this.uploadUpdatedColorBuffer(p),this.uploadUpdatedIndexBuffer(p)};this.uploaded||(y(this.buildingWithoutFacade),y(this.buildingWithFacade),this.groundEffect.upload(p)),this.groundEffect.uploadPaintProperties(p),this.programConfigurations.upload(p),this.uploaded=true}destroy(){const p=y=>{y.layoutVertexBuffer&&(y.layoutVertexBuffer.destroy(),y.layoutNormalBuffer.destroy(),y.layoutColorBuffer.destroy(),y.segmentsBucket.destroy(),y.indexBuffer&&y.indexBuffer.destroy(),y.entranceBloom.layoutVertexBuffer&&(y.entranceBloom.layoutVertexBuffer.destroy(),y.entranceBloom.layoutColorBuffer.destroy(),y.entranceBloom.layoutAttenuationBuffer.destroy(),y.entranceBloom.indexBuffer.destroy(),y.entranceBloom.segmentsBucket.destroy()))};p(this.buildingWithoutFacade),p(this.buildingWithFacade),this.groundEffect.destroy(),this.programConfigurations.destroy()}updateFootprintHiddenFlags(p,y,T=true){let S=false;const R=T?y:0,M=0|(T?-1:~y);0===this.groundEffect.hiddenByLandmarkVertexArray.length&&this.groundEffect.hiddenByLandmarkVertexArray.resize(this.groundEffect.vertexArray.length);for(const F of p){const G=this.footprints[F],q=G.hiddenFlags&M|R;G.hiddenFlags!==q&&(G.hiddenFlags=q,S=true,this.groundEffect.updateHiddenByLandmarkRange(G.groundEffectVertexOffset,G.groundEffectVertexLength,0!==G.hiddenFlags))}return S&&(this.indexArrayForConflationUploaded=false),S}uploadUpdatedIndexBuffer(p){if(this.groundEffect.uploadHiddenByLandmark(p),this.indexArrayForConflationUploaded)return;const y=S=>{0!==S.indexArray.length&&(S.indexArrayForConflation.resize(S.indexArray.length),S.indexArrayForConflation.uint16.set(S.indexArray.uint16),S.entranceBloom.indexArrayForConflation.resize(S.entranceBloom.indexArray.length),S.entranceBloom.indexArrayForConflation.uint16.set(S.entranceBloom.indexArray.uint16))};y(this.buildingWithoutFacade),y(this.buildingWithFacade);for(const S of this.footprints){const R=S.hasFauxFacade?this.buildingWithFacade:this.buildingWithoutFacade,M=S.indicesOffset+S.indicesLength;if(0!==S.hiddenFlags){for(let G=S.indicesOffset;G{0!==S.indexArray.length&&(S.indexBuffer?S.indexBuffer.updateData(S.indexArrayForConflation):S.indexBuffer=p.createIndexBuffer(S.indexArrayForConflation,true),S.entranceBloom.indexBuffer?S.entranceBloom.indexBuffer.updateData(S.entranceBloom.indexArrayForConflation):S.entranceBloom.indexBuffer=p.createIndexBuffer(S.entranceBloom.indexArrayForConflation,true))};T(this.buildingWithoutFacade),T(this.buildingWithFacade),this.indexArrayForConflationUploaded=true}uploadUpdatedColorBuffer(p){const y=T=>{T.layoutColorBuffer?T.layoutColorBuffer.updateData(T.layoutColorArray):T.layoutColorBuffer=p.createVertexBuffer(T.layoutColorArray,Pwt.members,true),T.layoutFacadePaintArray&&(T.layoutFacadePaintBuffer?T.layoutFacadePaintBuffer.updateData(T.layoutFacadePaintArray):T.layoutFacadePaintBuffer=p.createVertexBuffer(T.layoutFacadePaintArray,xwr.members,true)),T.entranceBloom.layoutColorBuffer?T.entranceBloom.layoutColorBuffer.updateData(T.entranceBloom.layoutColorArray):T.entranceBloom.layoutColorBuffer=p.createVertexBuffer(T.entranceBloom.layoutColorArray,Pwt.members,true)};y(this.buildingWithoutFacade),y(this.buildingWithFacade),this.colorBufferUploaded=true}evaluate(p,y){const T=p.paint.get("building-ambient-occlusion-intensity");for(const S of this.footprints){if(4&S.hiddenFlags)continue;const R=y[S.promoteId],M=S.feature;M.properties["building-part"]="roof";const F=p.paint.get("building-color").evaluate(M,R,this.canonical).toPremultipliedRenderColor(this.lut),G=p.paint.get("building-emissive-strength").evaluate(M,R,this.canonical);M.properties["building-part"]="wall";const q=p.paint.get("building-color").evaluate(M,R,this.canonical).toPremultipliedRenderColor(this.lut),Q=p.paint.get("building-emissive-strength").evaluate(M,R,this.canonical);M.properties["building-part"]="window";const ie=p.paint.get("building-color").evaluate(M,R,this.canonical).toPremultipliedRenderColor(this.lut),ae=p.paint.get("building-emissive-strength").evaluate(M,R,this.canonical);M.properties["building-part"]="door";const de=p.paint.get("building-color").evaluate(M,R,this.canonical).toPremultipliedRenderColor(this.lut),pe=p.paint.get("building-emissive-strength").evaluate(M,R,this.canonical),_e=S.hasFauxFacade?this.buildingWithFacade:this.buildingWithoutFacade;for(const Fe of S.parts){let Ye,Xe=F;1===Fe.part?(Xe=F,Ye=G):0===Fe.part?(Xe=q,Ye=Q):2===Fe.part?(Xe=ie,Ye=ae):3===Fe.part&&(Xe=de,Ye=pe),Ye=bn(Ye,0,1);for(let We=0;WeM.max.x||G.max.xM.max.y||G.max.yF.max.x||F.min.x>p||y>F.max.y||F.min.y>y||F.height<=T||Wwr(M,this.footprintsVertices.float32.subarray(2*F.footprintVertexOffset,2*(F.footprintVertexOffset+F.footprintVertexLength)),this.footprintsIndices.uint16.subarray(F.footprintIndexOffset,F.footprintIndexOffset+F.footprintIndexLength))&&(T=F.height,this.footprintLookup[R]=F,S=0!==F.hiddenFlags);if(T!==Number.NEGATIVE_INFINITY)return{height:T,hidden:S};this.footprintLookup[R]=void 0}}function Wwr(b,p,y){for(let T=0;T0&&this.rings[0].length>0}}async function Yle(){}function ez(b,p,y){const T=p.paint.get(b).value;return"constant"===T.kind?T.value:y.programConfigurations.get(p.id).getMaxValue(b)}function qle(b){return Math.sqrt(b[0]*b[0]+b[1]*b[1])}function qwt(b,p,y,T,S){if(!p[0]&&!p[1])return b;const R=nt.convert(p)._mult(S);"viewport"===y&&R._rotate(-T);const M=[];for(let F=0;F{const p=[];return"map"===b.paint.get("circle-pitch-alignment")&&p.push("PITCH_WITH_MAP"),"map"===b.paint.get("circle-pitch-scale")&&p.push("SCALE_WITH_MAP"),p};function Kwt(b,p,y,T,S,R,M,F,G){if(R&&b.queryGeometry.isAboveHorizon)return false;R&&(G*=b.pixelToTileUnitsFactor);const q=b.tileID.canonical,Q=y.projection.upVectorScale(q,y.center.lat,y.worldSize).metersToTile;for(const ie of p)for(const ae of ie){const de=ae.add(F),pe=S&&y.elevation?y.elevation.exaggeration()*S.getElevationAt(de.x,de.y,true):0,_e=y.projection.projectTilePoint(de.x,de.y,q);if(pe>0){const Xe=y.projection.upVector(q,de.x,de.y);_e.x+=Xe[0]*Q*pe,_e.y+=Xe[1]*Q*pe,_e.z+=Xe[2]*Q*pe}const Se=R?de:Xwr(_e.x,_e.y,_e.z,T),Fe=R?b.tilespaceRays.map(Xe=>Kwr(Xe,pe)):b.queryGeometry.screenGeometry,Ye=ye([],[_e.x,_e.y,_e.z,1],T);if(!M&&R?G*=Ye[3]/y.cameraToCenterDistance:M&&!R&&(G*=y.cameraToCenterDistance/Ye[3]),R){const Xe=Ju((ae.y/qr+q.y)/(1<{p[b.evaluationKey]=q;const Q=b.expression.evaluate(p),ie=Q?Q.toNonPremultipliedRenderColor(R):null;ie&&(S.data[F+G+0]=Math.floor(255*ie.r),S.data[F+G+1]=Math.floor(255*ie.g),S.data[F+G+2]=Math.floor(255*ie.b),S.data[F+G+3]=Math.floor(255*ie.a))};if(b.clips)for(let F=0,G=0;Fy.fqid),this.index=p.index,this.hasPattern=false,this.stateDependentLayerIds=this.layers.filter(y=>y.isStateDependent()).map(y=>y.id),this.footprints=[],this.worldview=p.worldview,this.hasAppearances=null}updateFootprints(p,y){for(const T of this.footprints)y.push({footprint:T,id:p})}updateAppearances(p,y,T,S){return{hasLayoutChanges:false,hasUboChanges:false}}populate(p,y,T,S){const R=[];for(const{feature:M,id:F,index:G,sourceLayerIndex:q}of p){const Q=this.layers[0]._featureFilter.needGeometry,ie=It(M,Q);if(!this.layers[0]._featureFilter.filter(new Rl(this.zoom,{worldview:this.worldview,activeFloors:y.activeFloors}),ie,T))continue;const ae={id:F,properties:M.properties,type:M.type,sourceLayerIndex:q,index:G,geometry:Q?ie.geometry:vt(M,T,S),patterns:{}};R.push(ae)}for(const M of R){const{geometry:F,index:G,sourceLayerIndex:q}=M;this.addFeature(M,F,G,T,{},y.availableImages,y.brightness),y.featureIndex.insert(p[G].feature,F,G,q,this.index)}}isEmpty(){return 0===this.footprints.length}uploadPending(){return false}upload(p){}update(p,y,T,S,R,M,F){}destroy(){}addFeature(p,y,T,S,R,M=[],F){for(const G of Pt(y,2)){const q=[],Q=[],ie=[],ae=new nt(1/0,1/0),de=new nt(-1/0,-1/0);for(const Se of G)if(0!==Se.length){Se!==G[0]&&ie.push(Q.length/2);for(let Fe=0;Fe{_n[0]=Dn,_n[1]=Ln,_n[2]=zn,_n[3]=1},un=zwt();de>0&&(de+=un),pe+=un;for(const _n of ae){const Dn=[],Ln=[];for(const zn of _n){const or=zn.x+_e.x,nn=zn.y+_e.y,En=ie.projection.projectTilePoint(or,nn,rt),In=ie.projection.upVector(rt,zn.x,zn.y);let Gn=de,qn=pe;if(Fe){const Zn=y2t(or,nn,de,pe,Fe,Ye,Xe,We);Gn+=Zn.base,qn+=Zn.top}0!==de?Nt(Tt,En.x+In[0]*ht*Gn,En.y+In[1]*ht*Gn,En.z+In[2]*ht*Gn):Nt(Tt,En.x,En.y,En.z),Nt(Lt,En.x+In[0]*ht*qn,En.y+In[1]*ht*qn,En.z+In[2]*ht*qn),it(Tt,Tt,Se),it(Lt,Lt,Se),Dn.push(new p4(Tt[0],Tt[1],Tt[2])),Ln.push(new p4(Lt[0],Lt[1],Lt[2]))}lt.push(Dn),Bt.push(Ln)}return[lt,Bt]}(b,p,y,T,S,R,M,F,G,q,Q):M?function(ie,ae,de,pe,_e,Se,Fe,Ye,Xe){const We=[],rt=[],lt=[0,0,0,1];for(const Bt of ie){const ht=[],Tt=[];for(const Lt of Bt){const Nt=Lt.x+pe.x,un=Lt.y+pe.y,_n=y2t(Nt,un,ae,de,Se,Fe,Ye,Xe);lt[0]=Nt,lt[1]=un,lt[2]=_n.base,lt[3]=1,ye(lt,lt,_e),lt[3]=Math.max(lt[3],1e-5);const Dn=new p4(lt[0]/lt[3],lt[1]/lt[3],lt[2]/lt[3]);lt[0]=Nt,lt[1]=un,lt[2]=_n.top,lt[3]=1,ye(lt,lt,_e),lt[3]=Math.max(lt[3],1e-5);const Ln=new p4(lt[0]/lt[3],lt[1]/lt[3],lt[2]/lt[3]);ht.push(Dn),Tt.push(Ln)}We.push(ht),rt.push(Tt)}return[We,rt]}(p,y,T,S,R,M,F,G,q):function(ie,ae,de,pe,_e){const Se=[],Fe=[],Ye=_e[8]*ae,Xe=_e[9]*ae,We=_e[10]*ae,rt=_e[11]*ae,lt=_e[8]*de,Bt=_e[9]*de,ht=_e[10]*de,Tt=_e[11]*de;for(const Lt of ie){const Nt=[],un=[];for(const _n of Lt){const Dn=_n.x+pe.x,Ln=_n.y+pe.y,zn=_e[0]*Dn+_e[4]*Ln+_e[12],or=_e[1]*Dn+_e[5]*Ln+_e[13],nn=_e[2]*Dn+_e[6]*Ln+_e[14],En=_e[3]*Dn+_e[7]*Ln+_e[15],In=zn+Ye,Gn=or+Xe,qn=nn+We,Zn=Math.max(En+rt,1e-5),Hn=zn+lt,ur=or+Bt,pr=nn+ht,ni=Math.max(En+Tt,1e-5);Nt.push(new p4(In/Zn,Gn/Zn,qn/Zn)),un.push(new p4(Hn/ni,ur/ni,pr/ni))}Se.push(Nt),Fe.push(un)}return[Se,Fe]}(p,y,T,S,R)}function y2t(b,p,y,T,S,R,M,F){const G=M*S.getElevationAt(b,p,true,true),q=0!==R[0],Q=q?0===R[1]?M*(R[0]/7-450):M*function(ie,ae,de){const pe=Math.floor(ae[0]/8),_e=Math.floor(ae[1]/8),Se=10*(ae[0]-8*pe),Fe=10*(ae[1]-8*_e),Ye=ie.getElevationAt(pe,_e,true,true),Xe=ie.getMeterToDEM(de),We=Math.floor(.5*(Se*Xe-1)),rt=Math.floor(.5*(Fe*Xe-1)),lt=ie.tileCoordToPixel(pe,_e),Bt=2*We+1,ht=2*rt+1,Tt=function(Ln,zn,or,nn,En){return[Ln.getElevationAtPixel(zn,or,true),Ln.getElevationAtPixel(zn+En,or,true),Ln.getElevationAtPixel(zn,or+En,true),Ln.getElevationAtPixel(zn+nn,or+En,true)]}(ie,lt.x-We,lt.y-rt,Bt,ht),Lt=Math.abs(Tt[0]-Tt[1]),Nt=Math.abs(Tt[2]-Tt[3]),un=Math.abs(Tt[0]-Tt[2])+Math.abs(Tt[1]-Tt[3]),_n=Math.min(.25,.5*Xe*(Lt+Nt)/Bt),Dn=Math.min(.25,.5*Xe*un/ht);return Ye+Math.max(_n*Se,Dn*Fe)}(S,R,F):G;return{base:G+(0===y?-1:y),top:q?Math.max(Q+T,G+y+2):G+T}}function rX(b,p,y){return p*(qr/(b.tileSize*Math.pow(2,y-b.tileID.overscaledZ)))}function b2t(b,p){return 1/rX(b,1,p.tileZoom)}function x2t(b,p,y,T){return b.translatePosMatrix(T||p.tileID.projMatrix,p,y.paint.get("line-translate"),y.paint.get("line-translate-anchor"))}li(h2t,"ClipBucket",{omit:["layers"]});const v2t=b=>{const p=[];_2t(b)&&p.push("RENDER_LINE_DASH"),b.paint.get("line-gradient")&&p.push("RENDER_LINE_GRADIENT"),"multiply"===b.paint.get("line-blend-mode")&&p.push("LINE_BLEND_MULTIPLY"),"additive"===b.paint.get("line-blend-mode")&&p.push("LINE_BLEND_ADDITIVE");const y=b.paint.get("line-trim-offset");0===y[0]&&0===y[1]||p.push("RENDER_LINE_TRIM_OFFSET");const T=0!==b.paint.get("line-border-width").constantOr(1);T&&p.push("RENDER_LINE_BORDER"),T&&b.paint.get("line-border-gradient")&&p.push("RENDER_LINE_BORDER_GRADIENT");const S="none"===b.layout.get("line-join").constantOr("miter"),R=!!b.paint.get("line-pattern").constantOr(1);return S&&R&&p.push("LINE_JOIN_NONE"),p};function _2t(b){const p=b.paint.get("line-dasharray").value;return"constant"!==p.kind||p.value}let oBe;const T2t=()=>oBe||(oBe={layout:d2t||(d2t=new Ql({"line-cap":new Br(An.layout_line["line-cap"]),"line-join":new Br(An.layout_line["line-join"]),"line-miter-limit":new Ir(An.layout_line["line-miter-limit"]),"line-round-limit":new Ir(An.layout_line["line-round-limit"]),"line-sort-key":new Br(An.layout_line["line-sort-key"]),"line-z-offset":new Br(An.layout_line["line-z-offset"]),"line-elevation-reference":new Ir(An.layout_line["line-elevation-reference"]),"line-cross-slope":new Ir(An.layout_line["line-cross-slope"]),visibility:new Ir(An.layout_line.visibility),"line-width-unit":new Ir(An.layout_line["line-width-unit"]),"line-elevation-ground-scale":new Br(An.layout_line["line-elevation-ground-scale"])})),paint:f2t||(f2t=new Ql({"line-opacity":new Br(An.paint_line["line-opacity"]),"line-color":new Br(An.paint_line["line-color"]),"line-translate":new Ir(An.paint_line["line-translate"]),"line-translate-anchor":new Ir(An.paint_line["line-translate-anchor"]),"line-width":new Br(An.paint_line["line-width"]),"line-gap-width":new Br(An.paint_line["line-gap-width"]),"line-offset":new Br(An.paint_line["line-offset"]),"line-blur":new Br(An.paint_line["line-blur"]),"line-dasharray":new Br(An.paint_line["line-dasharray"]),"line-pattern":new Br(An.paint_line["line-pattern"]),"line-pattern-cross-fade":new Ir(An.paint_line["line-pattern-cross-fade"]),"line-gradient":new gT(An.paint_line["line-gradient"]),"line-trim-offset":new Ir(An.paint_line["line-trim-offset"]),"line-trim-fade-range":new Ir(An.paint_line["line-trim-fade-range"]),"line-trim-color":new Ir(An.paint_line["line-trim-color"]),"line-emissive-strength":new Br(An.paint_line["line-emissive-strength"]),"line-border-width":new Br(An.paint_line["line-border-width"]),"line-border-color":new Br(An.paint_line["line-border-color"]),"line-border-gradient":new gT(An.paint_line["line-border-gradient"]),"line-occlusion-opacity":new Ir(An.paint_line["line-occlusion-opacity"]),"line-blend-mode":new Ir(An.paint_line["line-blend-mode"]),"line-blend-additive-clamp":new Ir(An.paint_line["line-blend-additive-clamp"]),"line-color-use-theme":new Br({type:"string",default:"default","property-type":"data-driven"}),"line-gradient-use-theme":new Br({type:"string",default:"default","property-type":"data-driven"}),"line-trim-color-use-theme":new Br({type:"string",default:"default","property-type":"data-driven"}),"line-border-color-use-theme":new Br({type:"string",default:"default","property-type":"data-driven"}),"line-border-gradient-use-theme":new Br({type:"string",default:"default","property-type":"data-driven"})}))},oBe);class Zwr extends Br{possiblyEvaluate(p,y){return y=new Rl(Math.floor(y.zoom),{now:y.now,fadeDuration:y.fadeDuration,transition:y.transition,worldview:y.worldview}),super.possiblyEvaluate(p,y)}evaluate(p,y,T,S){return y={...y,zoom:Math.floor(y.zoom)},super.evaluate(p,y,T,S)}}let iX,w2t,E2t,aBe;function C2t(b,p){return p>0?p+2*b:b}function S2t(b,p){return p.replace(/{([^{}]+)}/g,(y,T)=>T in b?String(b[T]):"")}class A2t{constructor(p){this.type=p.property.overrides?p.property.overrides.runtimeType:_2,this.defaultValue=p}evaluate(p){if(p.formattedSection){const y=this.defaultValue.property.overrides;if(y&&y.hasOverride(p.formattedSection))return y.getOverride(p.formattedSection)}return p.feature&&p.featureState?this.defaultValue.evaluate(p.feature,p.featureState):this.defaultValue.property.specification.default}eachChild(p){this.defaultValue.isConstant()||p(this.defaultValue.value._styleExpression.expression)}outputDefined(){return false}serialize(){return null}}li(A2t,"FormatSectionOverride",{omit:["defaultValue"]});const sBe=()=>aBe||(aBe={layout:w2t||(w2t=new Ql({"symbol-placement":new Ir(An.layout_symbol["symbol-placement"]),"symbol-spacing":new Ir(An.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Ir(An.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Br(An.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Ir(An.layout_symbol["symbol-z-order"]),"symbol-z-elevate":new Ir(An.layout_symbol["symbol-z-elevate"]),"symbol-elevation-reference":new Ir(An.layout_symbol["symbol-elevation-reference"]),"icon-allow-overlap":new Ir(An.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Ir(An.layout_symbol["icon-ignore-placement"]),"icon-optional":new Ir(An.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Ir(An.layout_symbol["icon-rotation-alignment"]),"icon-size":new Br(An.layout_symbol["icon-size"]),"icon-size-scale-range":new Ir(An.layout_symbol["icon-size-scale-range"]),"icon-text-fit":new Br(An.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Br(An.layout_symbol["icon-text-fit-padding"]),"icon-image":new Br(An.layout_symbol["icon-image"]),"icon-image-use-theme":new Ir({type:"string",default:"default","property-type":"data-constant"}),"icon-rotate":new Br(An.layout_symbol["icon-rotate"]),"icon-padding":new Ir(An.layout_symbol["icon-padding"]),"icon-keep-upright":new Ir(An.layout_symbol["icon-keep-upright"]),"icon-offset":new Br(An.layout_symbol["icon-offset"]),"icon-anchor":new Br(An.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Ir(An.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Ir(An.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Ir(An.layout_symbol["text-rotation-alignment"]),"text-field":new Br(An.layout_symbol["text-field"]),"text-font":new Br(An.layout_symbol["text-font"]),"text-size":new Br(An.layout_symbol["text-size"]),"text-size-scale-range":new Ir(An.layout_symbol["text-size-scale-range"]),"text-max-width":new Br(An.layout_symbol["text-max-width"]),"text-line-height":new Br(An.layout_symbol["text-line-height"]),"text-letter-spacing":new Br(An.layout_symbol["text-letter-spacing"]),"text-justify":new Br(An.layout_symbol["text-justify"]),"text-radial-offset":new Br(An.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ir(An.layout_symbol["text-variable-anchor"]),"text-anchor":new Br(An.layout_symbol["text-anchor"]),"text-max-angle":new Ir(An.layout_symbol["text-max-angle"]),"text-writing-mode":new Ir(An.layout_symbol["text-writing-mode"]),"text-rotate":new Br(An.layout_symbol["text-rotate"]),"text-padding":new Ir(An.layout_symbol["text-padding"]),"text-keep-upright":new Ir(An.layout_symbol["text-keep-upright"]),"text-transform":new Br(An.layout_symbol["text-transform"]),"text-offset":new Br(An.layout_symbol["text-offset"]),"text-allow-overlap":new Ir(An.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Ir(An.layout_symbol["text-ignore-placement"]),"text-optional":new Ir(An.layout_symbol["text-optional"]),visibility:new Ir(An.layout_symbol.visibility)})),paint:E2t||(E2t=new Ql({"icon-opacity":new Br(An.paint_symbol["icon-opacity"]),"icon-occlusion-opacity":new Br(An.paint_symbol["icon-occlusion-opacity"]),"icon-emissive-strength":new Br(An.paint_symbol["icon-emissive-strength"]),"text-emissive-strength":new Br(An.paint_symbol["text-emissive-strength"]),"icon-color":new Br(An.paint_symbol["icon-color"]),"icon-halo-color":new Br(An.paint_symbol["icon-halo-color"]),"icon-halo-width":new Br(An.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Br(An.paint_symbol["icon-halo-blur"]),"icon-translate":new Ir(An.paint_symbol["icon-translate"]),"icon-translate-anchor":new Ir(An.paint_symbol["icon-translate-anchor"]),"icon-image-cross-fade":new Ir(An.paint_symbol["icon-image-cross-fade"]),"text-opacity":new Br(An.paint_symbol["text-opacity"]),"text-occlusion-opacity":new Br(An.paint_symbol["text-occlusion-opacity"]),"text-color":new Br(An.paint_symbol["text-color"],{runtimeType:oh,getOverride:b=>b.textColor,hasOverride:b=>!!b.textColor}),"text-halo-color":new Br(An.paint_symbol["text-halo-color"]),"text-halo-width":new Br(An.paint_symbol["text-halo-width"]),"text-halo-blur":new Br(An.paint_symbol["text-halo-blur"]),"text-translate":new Ir(An.paint_symbol["text-translate"]),"text-translate-anchor":new Ir(An.paint_symbol["text-translate-anchor"]),"icon-color-saturation":new Ir(An.paint_symbol["icon-color-saturation"]),"icon-color-contrast":new Ir(An.paint_symbol["icon-color-contrast"]),"icon-color-brightness-min":new Ir(An.paint_symbol["icon-color-brightness-min"]),"icon-color-brightness-max":new Ir(An.paint_symbol["icon-color-brightness-max"]),"symbol-z-offset":new Br(An.paint_symbol["symbol-z-offset"]),"icon-color-use-theme":new Br({type:"string",default:"default","property-type":"data-driven"}),"icon-halo-color-use-theme":new Br({type:"string",default:"default","property-type":"data-driven"}),"text-color-use-theme":new Br({type:"string",default:"default","property-type":"data-driven"}),"text-halo-color-use-theme":new Br({type:"string",default:"default","property-type":"data-driven"})}))},aBe);class Xle extends im{constructor(p,y,T,S){super(p,sBe(),y,T,S,p.layout?p.layout["icon-image-use-theme"]:null),this._colorAdjustmentMatrix=_([]),this.hasOcclusionOpacityProperties=void 0!==p.paint&&("icon-occlusion-opacity"in p.paint||"text-occlusion-opacity"in p.paint)}_handleSpecialPaintPropertyUpdate(p){"icon-occlusion-opacity"!==p&&"text-occlusion-opacity"!==p||(this.hasOcclusionOpacityProperties=true)}recalculate(p,y){super.recalculate(p,y),this.appearances&&this.appearances.forEach(S=>{S.recalculate(p,y,this.iconImageUseTheme)}),0!==this.appearances.length&&delete this.layout._values["text-variable-anchor"],"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"));const T=this.layout.get("text-writing-mode");if(T){const S=[];for(const R of T)S.includes(R)||S.push(R);this.layout._values["text-writing-mode"]=S}else this.layout._values["text-writing-mode"]="point"===this.layout.get("symbol-placement")?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}getColorAdjustmentMatrix(p,y,T,S){return this._saturation===p&&this._contrast===y&&this._brightnessMin===T&&this._brightnessMax===S||(this._colorAdjustmentMatrix=function(R,M,F,G){R=Zi(R),M=$i(M);const q=g(),Q=R/3,ie=1-2*Q,ae=[ie,Q,Q,0,Q,ie,Q,0,Q,Q,ie,0,0,0,0,1],de=.5-.5*M,pe=G-F;return P(q,[pe,0,0,0,0,pe,0,0,0,0,pe,0,F,F,F,1],[M,0,0,0,0,M,0,0,0,0,M,0,de,de,de,1]),P(q,q,ae),q}(p,y,T,S),this._saturation=p,this._contrast=y,this._brightnessMin=T,this._brightnessMax=S),this._colorAdjustmentMatrix}getValueAndResolveTokens(p,y,T,S){const R=this.layout.get(p).evaluate(y,{},T,S),M=this._unevaluatedLayout._values[p];return M.isDataDriven()||v7(M.value)||!R?R:S2t(y.properties,R)}getAppearanceValueAndResolveTokens(p,y,T,S,R){const M=p.getLayoutProperty(y);if(!M)return;const F=M.evaluate(T,{},S,R),G=p.getUnevaluatedLayoutProperties()._values[y];return G.isDataDriven()||v7(G.value)||!F||"string"!=typeof F?F:S2t(T.properties,F)}createBucket(p){return new ble(p)}queryRadius(){return 0}queryIntersectsFeature(){return false}_setPaintOverrides(){for(const p of sBe().paint.overridableProperties){if(!Xle.hasPaintOverride(this.layout,p))continue;const y=this.paint.get(p),T=new A2t(y),S=new iq(T,y.property.specification,this.scope,this.options,this.layout.get("icon-image-use-theme"));let R=null;R="constant"===y.value.kind||"source"===y.value.kind?new _7("source",S):new hA("composite",S,y.value.zoomStops,y.value.interpolationType),this.paint._values[p]=new mT(y.property,R,y.parameters)}}_handleOverridablePaintPropertyUpdate(p,y,T){return!(!this.layout||y.isDataDriven()||T.isDataDriven())&&Xle.hasPaintOverride(this.layout,p)}static hasPaintOverride(p,y){const T=p.get("text-field"),S=sBe().paint.properties[y];let R=false;const M=F=>{for(const G of F)if(S.overrides&&S.overrides.hasOverride(G))return void(R=true)};if("constant"===T.value.kind&&T.value.value instanceof yd)M(T.value.value.sections);else if("source"===T.value.kind){const F=q=>{R||(q instanceof Qx&&Yd(q.value)===Jx?M(q.value.sections):q instanceof Jm?M(q.sections):q.eachChild(F))},G=T.value;G._styleExpression&&F(G._styleExpression.expression)}return R}getProgramIds(){return["symbol"]}getDefaultProgramParams(p,y,T){return{config:new h4(this,{zoom:y,lut:T}),overrideFog:false}}hasElevation(){return this.layout&&"hd-road-markup"===this.layout.get("symbol-elevation-reference")}mayUse(p){return"HD"===p&&L7(this,"symbol-elevation-reference",y=>"hd-road-markup"===y)}prepare(){return this.mayUse("HD")?Yle():Promise.resolve()}}let k2t,R2t,P2t,I2t;const lBe=1024,Jwr=(Math.pow(lBe,2)-1)/268170240;class M2t extends im{constructor(p,y,T,S){super(p,{layout:P2t||(P2t=new Ql({visibility:new Ir(An.layout_raster.visibility)})),paint:I2t||(I2t=new Ql({"raster-opacity":new Ir(An.paint_raster["raster-opacity"]),"raster-color":new gT(An.paint_raster["raster-color"]),"raster-color-mix":new Ir(An.paint_raster["raster-color-mix"]),"raster-color-range":new Ir(An.paint_raster["raster-color-range"]),"raster-hue-rotate":new Ir(An.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Ir(An.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Ir(An.paint_raster["raster-brightness-max"]),"raster-saturation":new Ir(An.paint_raster["raster-saturation"]),"raster-contrast":new Ir(An.paint_raster["raster-contrast"]),"raster-resampling":new Ir(An.paint_raster["raster-resampling"]),"raster-fade-duration":new Ir(An.paint_raster["raster-fade-duration"]),"raster-emissive-strength":new Ir(An.paint_raster["raster-emissive-strength"]),"raster-array-band":new Ir(An.paint_raster["raster-array-band"]),"raster-elevation":new Ir(An.paint_raster["raster-elevation"]),"raster-elevation-reference":new Ir(An.paint_raster["raster-elevation-reference"]),"raster-color-use-theme":new Br({type:"string",default:"default","property-type":"data-driven"})}))},y,T,S),this.updateColorRamp(),this._curRampRange=[NaN,NaN]}getProgramIds(){return["raster"]}hasColorMap(){return!!this._transitionablePaint._values["raster-color"].value.value}tileCoverLift(){return this.paint.get("raster-elevation")}isDraped(p){const y=p?p._source:null;return(!y||"image"!==y.type&&"video"!==y.type&&"canvas"!==y.type||!y.onNorthPole&&!y.onSouthPole)&&0===this.paint.get("raster-elevation")}_handleSpecialPaintPropertyUpdate(p){"raster-color"!==p&&"raster-color-range"!==p||(this._curRampRange=[NaN,NaN],this.updateColorRamp())}_clear(){this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null)}updateColorRamp(p){if(!this.hasColorMap())return;if(!this._curRampRange)return;const y=this._transitionablePaint._values["raster-color"].value.expression,[T,S]=p||this._transitionablePaint._values["raster-color-range"].value.expression.evaluate({zoom:0})||[NaN,NaN];isNaN(T)&&isNaN(S)||T===this._curRampRange[0]&&S===this._curRampRange[1]||(this.colorRamp=tX({expression:y,evaluationKey:"rasterValue",image:this.colorRamp,clips:[{start:T,end:S}],resolution:lBe}),this.colorRampTexture=null,this._curRampRange=[T,S])}is3D(p){return this.paint.get("raster-elevation")>0}}let L2t,D2t,F2t,N2t,O2t,B2t,z2t;class U2t extends im{constructor(p,y,T,S){super(p,{layout:L2t||(L2t=new Ql({visibility:new Ir(An["layout_raster-particle"].visibility)})),paint:D2t||(D2t=new Ql({"raster-particle-array-band":new Ir(An["paint_raster-particle"]["raster-particle-array-band"]),"raster-particle-count":new Ir(An["paint_raster-particle"]["raster-particle-count"]),"raster-particle-color":new gT(An["paint_raster-particle"]["raster-particle-color"]),"raster-particle-max-speed":new Ir(An["paint_raster-particle"]["raster-particle-max-speed"]),"raster-particle-speed-factor":new Ir(An["paint_raster-particle"]["raster-particle-speed-factor"]),"raster-particle-fade-opacity-factor":new Ir(An["paint_raster-particle"]["raster-particle-fade-opacity-factor"]),"raster-particle-reset-rate-factor":new Ir(An["paint_raster-particle"]["raster-particle-reset-rate-factor"]),"raster-particle-elevation":new Ir(An["paint_raster-particle"]["raster-particle-elevation"]),"raster-particle-color-use-theme":new Br({type:"string",default:"default","property-type":"data-driven"})}))},y,T,S),this._updateColorRamp(),this.lastInvalidatedAt=Ct.now()}mayUse(p){return"HD"===p}_clear(){this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null),this.tileFramebuffer&&(this.tileFramebuffer.destroy(),this.tileFramebuffer=null),this.particleFramebuffer&&(this.particleFramebuffer.destroy(),this.particleFramebuffer=null)}onRemove(p){this.colorRampTexture&&this.colorRampTexture.destroy(),this.tileFramebuffer&&this.tileFramebuffer.destroy(),this.particleFramebuffer&&this.particleFramebuffer.destroy()}hasColorMap(){return!!this._transitionablePaint._values["raster-particle-color"].value.value}getProgramIds(){return["rasterParticle"]}hasOffscreenPass(){return"none"!==this.visibility}isDraped(p){return false}_handleSpecialPaintPropertyUpdate(p){"raster-particle-color"!==p&&"raster-particle-max-speed"!==p||(this._updateColorRamp(),this._invalidateAnimationState()),"raster-particle-count"===p&&this._invalidateAnimationState()}_updateColorRamp(){if(!this.hasColorMap())return;const p=this._transitionablePaint._values["raster-particle-color"].value.expression,y=this._transitionablePaint._values["raster-particle-max-speed"].value.expression.evaluate({zoom:0});this.colorRamp=tX({expression:p,evaluationKey:"rasterParticleSpeed",image:this.colorRamp,clips:[{start:0,end:y}],resolution:256}),this.colorRampTexture=null}_invalidateAnimationState(){this.lastInvalidatedAt=Ct.now()}tileCoverLift(){return this.paint.get("raster-particle-elevation")}}class Qwr extends im{constructor(p,y){super(p,{},y,null),this.implementation=p,p.slot&&(this.slot=p.slot)}is3D(p){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}isDraped(p){return void 0!==this.implementation.renderToTile}shouldRedrape(){return!!this.implementation.shouldRerenderTiles&&this.implementation.shouldRerenderTiles()}recalculate(){}updateTransitions(){}hasTransition(){return false}serialize(){}onAdd(p){this.implementation.onAdd&&this.implementation.onAdd(p,p.painter.context.gl)}onRemove(p){this.implementation.onRemove&&this.implementation.onRemove(p,p.painter.context.gl)}}function cBe(b,p,y){const T=[0,0,1],S=Ae([]);return Wt(S,S,y?-Fn(b)+Math.PI:Fn(b)),Oe(S,S,-Fn(p)),He(T,T,S),yt(T,T)}class V2t{constructor(p,y){this.feature=p,this.instancedDataOffset=y,this.instancedDataCount=0,this.rotation=[0,0,0],this.scale=[1,1,1],this.translation=[0,0,0]}}class $2t{constructor(){this.maxScale=1,this.maxXYTranslationDistance=0,this.instancedDataArray=new Fs,this.instancesEvaluatedElevation=[],this.features=[],this.idToFeaturesIndex={}}colorForInstance(p){const y=16*p,T=this.instancedDataArray.float32;let S=Math.floor(T[y+2]);const R=1.05*(T[y+2]-S);return S/=100,[T[y]%1*1.05,T[y+1]%1*1.05,R,S]}tileCoordinatesForInstance(p){const y=16*p,T=this.instancedDataArray.float32;let S=T[y+0];return S=S>qr?S-qr:S,new nt(Math.trunc(S),Math.trunc(T[y+1]))}translationForInstance(p){const y=16*p,T=this.instancedDataArray.float32;return[T[y+4],T[y+5],T[y+6]]}rotationScaleForInstance(p){const y=16*p,T=this.instancedDataArray.float32;return[T[y+7],T[y+8],T[y+9],T[y+10],T[y+11],T[y+12],T[y+13],T[y+14],T[y+15]]}transformForInstance(p){const y=16*p,T=this.instancedDataArray.float32;return[T[y+7],T[y+8],T[y+9],T[y+4],T[y+10],T[y+11],T[y+12],T[y+5],T[y+13],T[y+14],T[y+15],T[y+6],0,0,0,1]}}class uBe{constructor(p){this.requiresStandardRuntime=true,this.zoom=p.zoom,this.canonical=p.canonical,this.overscaledZ=this.canonical.z+Math.log2(p.overscaling),this.layers=p.layers,this.layerIds=this.layers.map(y=>y.fqid),this.projection=p.projection,this.index=p.index,this.worldview=p.worldview,this.hasZoomDependentProperties=this.layers[0].isZoomDependent(),this.stateDependentLayerIds=this.layers.filter(y=>y.isStateDependent()).map(y=>y.id),this.hasPattern=false,this.instancesPerModel={},this.validForExaggeration=0,this.maxVerticalOffset=0,this.maxScale=0,this.maxHeight=0,this.lookupDim=this.zoom>this.canonical.z+1?0:this.zoom>this.canonical.z?256:this.zoom>15?75:100,this.instanceCount=0,this.terrainElevationMin=0,this.terrainElevationMax=0,this.validForDEMTile={id:null,timestamp:0},this.modelUris=[],this.modelsRequested=false,this.activeReplacements=[],this.replacementUpdateTime=0,this.styleDefinedModelURLs=p.styleDefinedModelURLs,this.hasAppearances=null}updateFootprints(p,y){}updateAppearances(p,y,T,S){return{hasLayoutChanges:false,hasUboChanges:false}}populate(p,y,T,S){this.tileToMeter=le(T);const R=this.layers[0]._featureFilter.needGeometry;this.lookup=new Uint8Array(this.lookupDim*this.lookupDim);const M="hd-road-markup"===this.layers[0].paint.get("model-elevation-reference")?y.elevationFeatures:void 0;for(const{feature:F,id:G,index:q,sourceLayerIndex:Q}of p){const ie=G??(F.properties&&Object.hasOwn(F.properties,"id")?F.properties.id:void 0),ae=It(F,R);if(!this.layers[0]._featureFilter.filter(new Rl(this.zoom,{worldview:this.worldview,activeFloors:y.activeFloors}),ae,T))continue;const de={id:ie,sourceLayerIndex:Q,index:q,geometry:R?ae.geometry:vt(F,T,S),properties:F.properties,type:F.type,patterns:{}},pe=this.addFeature(de,de.geometry,ae,M,T);pe&&y.featureIndex.insert(F,de.geometry,q,Q,this.index,this.instancesPerModel[pe].instancedDataArray.length,256)}this.lookup=null}evaluateQueryRenderedFeaturePadding(){const p=this.layers[0].modelManager,y=this.layers[0].scope;let T=0;for(const S of this.modelUris){const R=p.getModel(S,y);if(!R)continue;const M=this.instancesPerModel[S];if(M){const F=.5*Le(R.aabb.max,R.aabb.min)*M.maxScale+M.maxXYTranslationDistance,G=Math.min(qr,Math.max(F/this.tileToMeter,256));T=Math.max(G,T)}}return T}update(p,y,T,S){for(const R in this.instancesPerModel){const M=this.instancesPerModel[R];for(const F in p)Object.hasOwn(M.idToFeaturesIndex,F)&&(this.evaluate(M.features[M.idToFeaturesIndex[F]],p[F],M,true),this.uploaded=false)}this.maxHeight=0}updateZoomBasedPaintProperties(){if(!this.hasZoomDependentProperties)return false;let p=false;for(const y in this.instancesPerModel){const T=this.instancesPerModel[y];for(const S of T.features){const R=this.layers[0],M=S.feature,F=this.canonical,G=R.paint.get("model-rotation").evaluate(M,{},F),q=R.paint.get("model-scale").evaluate(M,{},F),Q=R.paint.get("model-translation").evaluate(M,{},F);Te(S.rotation,G)&&Te(S.scale,q)&&Te(S.translation,Q)||(this.evaluate(S,S.featureStates,T,true),p=true)}}return p}updateReplacement(p,y,T,S){if(y.updateTime===this.replacementUpdateTime)return false;this.replacementUpdateTime=y.updateTime;const R=y.getReplacementRegionsForTile(p.toUnwrapped(),true);if(lle(this.activeReplacements,R))return false;this.activeReplacements=R;let M=false;for(const F in this.instancesPerModel){const G=this.instancesPerModel[F],q=G.instancedDataArray;for(const Q of G.features){const ie=Q.instancedDataOffset,ae=Q.instancedDataCount;for(let de=0;deqr;_e=Se?_e-qr:_e;const Fe=Math.floor(_e),Ye=Math.floor(q.float32[pe+1]);let Xe=false;for(const We of this.activeReplacements)if(!bTt(We,T,Nle.Model,S)&&!(We.min.x>Fe||Fe>We.max.x||We.min.y>Ye||Ye>We.max.y)&&(Xe=v5e(TTt(Fe,Ye,p.canonical,We.footprintTileId.canonical),We.footprint),Xe))break;q.float32[pe]=Xe?_e+qr:_e,M=M||Xe!==Se}}}return M}isEmpty(){for(const p in this.instancesPerModel)if(0!==this.instancesPerModel[p].instancedDataArray.length)return false;return true}uploadPending(){return!this.uploaded}upload(p){if(!this.uploaded)for(const y in this.instancesPerModel){const T=this.instancesPerModel[y];T.instancedDataArray.length<0||0===T.instancedDataArray.length||(T.instancedDataBuffer?T.instancedDataBuffer.updateData(T.instancedDataArray):T.instancedDataBuffer=p.createVertexBuffer(T.instancedDataArray,owr.members,true,void 0,this.instanceCount))}this.uploaded=true}destroy(p){for(const T in this.instancesPerModel){const S=this.instancesPerModel[T];0!==S.instancedDataArray.length&&S.instancedDataBuffer&&S.instancedDataBuffer.destroy()}const y=this.layers[0].modelManager;if(p&&y&&this.modelUris&&this.modelsRequested)for(const T of this.modelUris)y.removeModel(T,"",true)}addFeature(p,y,T,S,R){const M=this.layers[0],F=M.layout.get("model-id"),G=M.layout.get("model-allow-density-reduction"),q=F.evaluate(T,{},this.canonical);if(!q)return yn(`modelId is not evaluated for layer ${M.id} and it is not going to get rendered.`),q;!q.includes("://")&&!this.styleDefinedModelURLs[q]||this.modelUris.includes(q)||this.modelUris.push(q),this.instancesPerModel[q]||(this.instancesPerModel[q]=new $2t);const Q=this.instancesPerModel[q],ie=Q.instancedDataArray,ae=new V2t(T,ie.length);let de;if(S){const pe=Yq(p,S,void 0,R);de=pe?pe.feature:void 0}for(const pe of y)for(const _e of pe){if(_e.x<0||_e.x>=qr||_e.y<0||_e.y>=qr)continue;if(0!==this.lookupDim&&G){const Fe=(this.lookupDim-1)/qr,Ye=this.lookupDim*(_e.y*Fe|0)+_e.x*Fe|0;if(this.lookup){if(0!==this.lookup[Ye])continue;this.lookup[Ye]=1}}this.instanceCount++;const Se=ie.length;if(ie.resize(Se+1),S){Q.instancesRoadElevation||(Q.instancesRoadElevation=[]);const Fe=de?de.pointElevation(new nt(_e.x,_e.y)):0;Q.instancesRoadElevation.push(Fe)}Q.instancesEvaluatedElevation.push(0),ie.float32[16*Se]=_e.x,ie.float32[16*Se+1]=_e.y}return ae.instancedDataCount=Q.instancedDataArray.length-ae.instancedDataOffset,ae.instancedDataCount>0&&(p.id&&(Q.idToFeaturesIndex[p.id]=Q.features.length),Q.features.push(ae),this.evaluate(ae,{},Q,false)),q}getModelUris(){return this.modelUris}evaluate(p,y,T,S){const R=this.layers[0],M=p.feature,F=this.canonical,G=p.rotation=R.paint.get("model-rotation").evaluate(M,y,F),q=p.scale=R.paint.get("model-scale").evaluate(M,y,F),Q=p.translation=R.paint.get("model-translation").evaluate(M,y,F),{r:ie,g:ae,b:de}=R.paint.get("model-color").evaluate(M,y,F),pe=R.paint.get("model-color-mix-intensity").evaluate(M,y,F),_e=[];this.maxVerticalOffset0?Math.sqrt(Se):0;T.maxScale=Math.max(Math.max(T.maxScale,q[0]),Math.max(q[1],q[2])),T.maxXYTranslationDistance=Math.max(T.maxXYTranslationDistance,Fe),this.maxScale=Math.max(Math.max(this.maxScale,q[0]),Math.max(q[1],q[2])),_wt(_e,G,q);const Ye=Math.round(100*pe)+de/1.05;for(let Xe=0;Xe10?this.tileToMeter:le(F,ht)),lt[rt+4]=Q[0],lt[rt+5]=Q[1],lt[rt+6]=Q[2]+(T.instancesRoadElevation?T.instancesRoadElevation[We]:0)+Bt,lt[rt+7]=_e[0],lt[rt+8]=_e[1],lt[rt+9]=_e[2],lt[rt+10]=_e[4],lt[rt+11]=_e[5],lt[rt+12]=_e[6],lt[rt+13]=_e[8],lt[rt+14]=_e[9],lt[rt+15]=_e[10],T.instancesEvaluatedElevation[We]=Q[2]}}}li(uBe,"ModelBucket",{omit:["layers"]}),li($2t,"PerModelAttributes"),li(V2t,"ModelFeature");class tz{constructor(p,y,T){this._demTile=p,this._dem=this._demTile.dem,this._scale=y,this._offset=T}static create(p,y,T){const S=T||p.findDEMTileFor(y);if(!S||!S.dem)return;const R=S.dem,M=S.tileID,F=1<q.fqid),this.stateDependentLayerIds=this.layers.filter(q=>q.isStateDependent()).map(q=>q.id),this.modelTraits|=1,this.uploaded=false,this.hasPattern=false,S&&(this.modelTraits|=4),R&&(this.modelTraits|=8),this.zoom=-1,this.terrainExaggeration=1,this.projection={name:"mercator"},this.replacementUpdateTime=0,this.elevationReadFromZ=255,this.brightness=M,this.worldview=G,this.dirty=true,this.needsUpload=false,this.filter=null,this.nodesInfo=[];for(const q of y)this.nodesInfo.push(new W2t(q)),H2t(q,F.featureIndexArray.length,F.grid),F.featureIndexArray.emplaceBack(this.nodesInfo.length-1,0,F.bucketLayerIDs.length-1,0);this.states={},this.hasAppearances=null}updateFootprints(p,y){for(const T of this.getNodesInfo()){const S=T.node;S.footprint&&y.push({footprint:S.footprint,id:p})}}updateAppearances(p,y,T,S){return{hasLayoutChanges:false,hasUboChanges:false}}update(p){const y=0!==Object.keys(p).length;if(y&&!this.stateDependentLayers.length)return;const T=y?this.stateDependentLayers:this.layers;if(!Rr(p,this.states))for(const S of T)this.evaluate(S,p);this.states=structuredClone(p)}populate(){console.log("populate 3D model bucket")}uploadPending(){return!this.uploaded||this.needsUpload}upload(p){if(!this.needsUpload)return;const y=this.getNodesInfo();for(const T of y){const S=T.node;this.uploaded?this.updatePbrBuffer(S):H5e(S,p,true)}for(const T of y)Dle(T.node);this.uploaded=true,this.needsUpload=false}updatePbrBuffer(p){let y=false;if(!p.meshes)return y;for(const T of p.meshes)T.pbrBuffer&&(T.pbrBuffer.updateData(T.featureArray),y=true);if(p.lodMeshes)for(const T of p.lodMeshes)T.pbrBuffer&&(T.pbrBuffer.updateData(T.featureArray),y=true);return y}needsReEvaluation(p,y,T){const S=p.transform.projectionOptions,R=p.style.getBrightness(),M=this.brightness!==R;if(!this.uploaded||this.dirty||S.name!==this.projection.name||oX(T.paint.get("model-color").value,M)||oX(T.paint.get("model-color-mix-intensity").value,M)||oX(T.paint.get("model-roughness").value,M)||oX(T.paint.get("model-emissive-strength").value,M)||oX(T.paint.get("model-height-based-emissive-strength-multiplier").value,M)){this.projection=S,this.brightness=R;const F=this.getNodesInfo();for(const G of F)G.state=null;return true}return false}evaluateTransform(p,y){if(p.transform.zoom===this.zoom)return;this.zoom=p.transform.zoom;const T=this.getNodesInfo(),S=this.id.canonical;for(const R of T){const M=R.feature;R.evaluatedTranslation=y.paint.get("model-translation").evaluate(M,{},S),R.evaluatedScale=y.paint.get("model-scale").evaluate(M,{},S)}}evaluate(p,y){const T=this.getNodesInfo();for(const S of T){if(!S.node.meshes)continue;const R=S.feature,M=y&&y[R.id];if(Rr(M,S.state))continue;S.state=structuredClone(M);const F=S.node.meshes&&S.node.meshes[0].featureData,G=S.evaluatedColor[2],q=S.evaluatedRMEA[2],Q=this.id.canonical;if(S.hasTranslucentParts=false,F){for(let ie=0;ie=lt)continue;const or=dBe[zn],nn=Math.abs(or);nn>Nt&&(Lt=or,Nt=nn,un=Ln,_n=Dn)}if(Nt>.1){const Dn=1-(lt+.5*Math.abs(un*_n))/pe;let Ln=y._dem.get(ht,Bt)+Lt*Dn;const zn=y._dem.get(ht+un,Bt+_n),or=y._dem.get(ht-un,Bt-_n,true);(Ln-zn)*(Ln-or)>0&&(Ln=(zn+or)/2),dBe[Tt]=y._dem.set(ht,Bt,Ln),T4[Tt]=lt}}}}}F&&(y._demTile.needsDEMTextureUpload=true,y._dem._timestamp=Ct.now())}setFilter(p){this.filter=p?i4(p):null}getNodesInfo(){return this.filter?this.nodesInfo.filter(p=>this.filter.filter(new Rl(this.id.overscaledZ,{worldview:this.worldview}),p.feature,this.id.canonical)):this.nodesInfo}destroy(){const p=this.getNodesInfo();for(const y of p)Dle(y.node),W5e(y.node)}isEmpty(){return!this.nodesInfo.length}updateReplacement(p,y){if(y.updateTime===this.replacementUpdateTime)return;this.replacementUpdateTime=y.updateTime;const T=y.getReplacementRegionsForTile(p.toUnwrapped());for(const S of this.getNodesInfo()){const R=S.node.footprint;S.hiddenByReplacement=!!R&&!T.some(M=>M.footprint===R)}}getHeightAtTileCoord(p,y){const T=[0,0,0],S=_([]);for(const R of this.getNodesInfo()){const M=R.node.meshes[0],F=M.transformedAabb;if(pF.max[0]||y>F.max[1])continue;if(true===R.node.hidden)return{height:1/0,maxHeight:R.feature.properties.height,hidden:false,verticalScale:R.evaluatedScale[2]};if(A(S,R.node.globalMatrix),T[0]=p,T[1]=y,T[2]=0,it(T,T,S),R.node.meshBVH){const ie=T[0],ae=T[1];jle[0]=ie-1,jle[1]=ae-1,jle[2]=-1e3,Kle[0]=ie+1,Kle[1]=ae+1,Kle[2]=1e3;const de=R.node.meshBVH.findHighestPoint(jle,Kle);if(null!==de)return{height:de,maxHeight:R.feature.properties.height,hidden:R.hiddenByReplacement,verticalScale:R.evaluatedScale[2]};continue}const G=(T[0]-M.aabb.min[0])/(M.aabb.max[0]-M.aabb.min[0])*v4|0,q=Math.min(63,(T[1]-M.aabb.min[1])/(M.aabb.max[1]-M.aabb.min[1])*v4|0)*v4+Math.min(63,G),Q=M.heightmap[q];if(Q<0&&R.node.footprint){const ie=[];if(R.node.footprint.grid.query(new nt(p,y),new nt(p,y),ie),ie.length>0)return{height:void 0,maxHeight:R.feature.properties.height,hidden:R.hiddenByReplacement,verticalScale:R.evaluatedScale[2]};continue}if(R.hiddenByReplacement)return;return{height:Q,maxHeight:R.feature.properties.height,hidden:false,verticalScale:R.evaluatedScale[2]}}}}function oX(b,p){return b instanceof _7&&!b.isLightConstant&&p}function e2r(b){const p=bn(b,0,2);return Math.min(Math.round(.5*p*255),255)}const q2t=new Float64Array(10*Zle.length);function X2t(b,p,y,T,S,R){if(!b.featureData)return;const M=b.featureArray=new hs;M.reserveExact(b.featureData.length),function(Q,ie,ae){const de=ae-ie;for(let pe=0;pe>y&65535,ae=Q>>T&15,de=ae<8?ae:0,pe=10*de;let _e=(61440&ie|(61440&ie)>>4)>>8,Se=(3840&ie|(3840&ie)>>4)>>4,Fe=240&ie|(240&ie)>>4;const Ye=(15&ie|(15&ie)<<4)/255,Xe=F[pe+3];Xe>0&&(_e=Si(_e,F[pe],Xe),Se=Si(Se,F[pe+1],Xe),Fe=Si(Fe,F[pe+2],Xe)),R&&(_e*=Ye,Se*=Ye,Fe*=Ye);const We=_e<<8|Se,rt=Fe<<8|F[pe+4],lt=F[pe+5],Bt=F[pe+6],ht=F[pe+7],Tt=F[pe+8],Lt=F[pe+9];if(M.emplaceBack(We,rt,lt,Bt,ht,Tt,Lt),q&&2===de){q=false;const Nt=10*G.lights.length,un=new hs;un.reserveExact(Nt);for(let _n=0;_n{let Xe=K2t,We=0,rt=K2t;if(!Ye){const Tt=S.style.light,Lt=Tt.properties.get("position");if(Xe=[-Lt.x,-Lt.y,Lt.z],"viewport"===Tt.properties.get("anchor")){const un=f();m(un,-S.transform.angle),bt(Xe,Xe,un)}const Nt=Tt.properties.get("color").toNonPremultipliedRenderColor(null);We=Tt.properties.get("intensity"),rt=[Nt.r,Nt.g,Nt.b]}const lt="MASK"===Q.alphaMode,Bt=ae.paint.get("model-ambient-occlusion-intensity"),ht=ae.paint.get("model-color").constantOr(Wo.white).toNonPremultipliedRenderColor(null);return ht.a=ae.paint.get("model-color-mix-intensity").constantOr(0),Se&&(ht.r=Se[0],ht.g=Se[1],ht.b=Se[2],ht.a=Se[3]),_e&&(ht.r=_e.color.r,ht.g=_e.color.g,ht.b=_e.color.b,ht.a=_e.colorMix,ie=_e.emissionStrength,R*=_e.opacity),{u_matrix:b,u_lighting_matrix:p,u_normal_matrix:y,u_node_matrix:T||fBe,u_lightpos:Xe,u_lightintensity:We,u_lightcolor:rt,u_camera_pos:de,u_opacity:R,u_baseTextureIsAlpha:0,u_alphaMask:+lt,u_alphaCutoff:Q.alphaCutoff,u_baseColorFactor:M.toNonPremultipliedRenderColor(null).toArray01(),u_emissiveFactor:F.toNonPremultipliedRenderColor(null).toArray01(),u_metallicFactor:G,u_roughnessFactor:q,u_baseColorTexture:rg.BaseColor,u_metallicRoughnessTexture:rg.MetallicRoughness,u_normalTexture:rg.Normal,u_occlusionTexture:rg.Occlusion,u_emissionTexture:rg.Emission,u_lutTexture:rg.LUT,u_color_mix:ht.toArray01(),u_aoIntensity:Bt,u_emissive_strength:ie,u_occlusionTextureTransform:pe||[0,0,0,0],u_dithered_discard_threshold:Fe}},Z2t=(b,p=fBe,y=fBe)=>({u_matrix:b,u_instance:p,u_node_matrix:y}),pBe=7680;class s1{constructor(p,y,T,S,R,M){this.test=p,this.ref=y,this.mask=T,this.fail=S,this.depthFail=R,this.pass=M}}s1.disabled=new s1({func:519,mask:0},0,0,pBe,pBe,pBe);const Jle=770,nz=771;class cc{constructor(p,y,T,S){this.blendFunction=p,this.blendColor=y.toNonPremultipliedRenderColor(null),this.mask=T,this.blendEquation=S}}cc.Replace=[1,0,1,0],cc.disabled=new cc(cc.Replace,Wo.transparent,[false,false,false,false]),cc.unblended=new cc(cc.Replace,Wo.transparent,[true,true,true,true]),cc.alphaBlended=new cc([1,nz,1,nz],Wo.transparent,[true,true,true,true]),cc.alphaBlendedNonPremultiplied=new cc([Jle,nz,Jle,nz],Wo.transparent,[true,true,true,true]),cc.multiply=new cc([774,0,774,0],Wo.transparent,[true,true,true,true]),cc.multiplyAccumulateAlpha=new cc([774,0,1,nz],Wo.transparent,[true,true,true,true]),cc.additive=new cc([1,1,1,1],Wo.transparent,[true,true,true,true]),cc.additiveAlphaWeighted=new cc([Jle,1,773,1],Wo.transparent,[true,true,true,true]),cc.additiveAlphaWeightedUnboundedAlpha=new cc([Jle,1,1,1],Wo.transparent,[true,true,true,true]);class Rh{constructor(p,y,T){this.func=p,this.mask=y,this.range=T}}Rh.ReadOnly=false,Rh.ReadWrite=true,Rh.disabled=new Rh(519,Rh.ReadOnly,[0,1]);const mBe=1029,gBe=2305;class Ph{constructor(p,y,T){this.enable=p,this.mode=y,this.frontFace=T}}Ph.disabled=new Ph(false,mBe,gBe),Ph.backCCW=new Ph(true,mBe,gBe),Ph.backCW=new Ph(true,mBe,2304),Ph.frontCW=new Ph(true,1028,2304),Ph.frontCCW=new Ph(true,1028,gBe);class yBe{constructor(p=0,y=0,T=0,S=0){if(isNaN(p)||p<0||isNaN(y)||y<0||isNaN(T)||T<0||isNaN(S)||S<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=p,this.bottom=y,this.left=T,this.right=S}interpolate(p,y,T){return null!=y.top&&null!=p.top&&(this.top=Si(p.top,y.top,T)),null!=y.bottom&&null!=p.bottom&&(this.bottom=Si(p.bottom,y.bottom,T)),null!=y.left&&null!=p.left&&(this.left=Si(p.left,y.left,T)),null!=y.right&&null!=p.right&&(this.right=Si(p.right,y.right,T)),this}getCenter(p,y){return new nt(bn((this.left+p-this.right)/2,0,p),bn((this.top+y-this.bottom)/2,0,y))}equals(p){return this.top===p.top&&this.bottom===p.bottom&&this.left===p.left&&this.right===p.right}clone(){return new yBe(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function J2t(b,p){const y=nr(b,3);X(b,p),Ur(b,3,y)}function bBe(b,p){const y=Ae([]);return kt(y,y,-p),Oe(y,y,-b),y}function Q2t(b,p){const y=[b[0],b[1],0],T=[p[0],p[1],0];if(re(y)>=1e-15){const M=yt([],y);ge(T,M,mt(T,M)),p[0]=T[0],p[1]=T[1]}const S=ct([],p,b);if(Be(S)<1e-15)return null;const R=Math.atan2(-S[1],S[0]);return bBe(Math.atan2(Math.sqrt(b[0]*b[0]+b[1]*b[1]),-b[2]),R)}class eEt{constructor(p,y){this.position=p,this.orientation=y}get position(){return this._position}set position(p){if(p){const y=p instanceof fe?p:new fe(p[0],p[1],p[2]);this._renderWorldCopies&&(y.x=Jn(y.x,0,1)),this._position=y}else this._position=null}lookAtPoint(p,y,T){if(this.orientation=null,!this.position)return;const S=this.position,R=T||(this._elevation?this._elevation.getAtPointOrZero(fe.fromLngLat(p)):0),M=fe.fromLngLat(p,R),F=[M.x-S.x,M.y-S.y,M.z-S.z];y||(y=[0,0,1]),y[2]=Math.abs(y[2]),this.orientation=Q2t(F,y)}setPitchBearing(p,y){this.orientation=bBe(Fn(p),Fn(-y))}}class Qle{constructor(p,y){this._transform=_([]),this.orientation=y,this.position=p}get mercatorPosition(){const p=this.position;return new fe(p[0],p[1],p[2])}get position(){const p=nr(this._transform,3);return[p[0],p[1],p[2]]}set position(p){var y;p&&Ur(this._transform,3,[(y=p)[0],y[1],y[2],1])}get orientation(){return this._orientation}set orientation(p){this._orientation=p||Ae([]),p&&J2t(this._transform,this._orientation)}getPitchBearing(){const p=this.forward(),y=this.right();return{bearing:Math.atan2(-y[1],y[0]),pitch:Math.atan2(Math.sqrt(p[0]*p[0]+p[1]*p[1]),-p[2])}}setPitchBearing(p,y){this._orientation=bBe(p,y),J2t(this._transform,this._orientation)}forward(){const p=nr(this._transform,2);return[-p[0],-p[1],-p[2]]}up(){const p=nr(this._transform,1);return[-p[0],-p[1],-p[2]]}right(){const p=nr(this._transform,0);return[p[0],p[1],p[2]]}getCameraToWorld(p,y){const T=new Float64Array(16);return A(T,this.getWorldToCamera(p,y)),T}getCameraToWorldMercator(){return this._transform}getWorldToCameraPosition(p,y,T){const S=this.position;ge(S,S,-p);const R=new Float64Array(16);return W(R,[T,T,T]),L(R,R,S),R[10]*=y,R}getWorldToCamera(p,y){const T=new Float64Array(16),S=new Float64Array(4),R=this.position;var M,F;return(M=S)[0]=-(F=this._orientation)[0],M[1]=-F[1],M[2]=-F[2],M[3]=F[3],ge(R,R,-p),X(T,S),L(T,T,R),T[1]*=-1,T[5]*=-1,T[9]*=-1,T[13]*=-1,T[8]*=y,T[9]*=y,T[10]*=y,T[11]*=y,T}getCameraToClipPerspective(p,y,T,S){const R=new Float64Array(16);return j(R,p,y,T,S),R}getCameraToClipOrthographic(p,y,T,S,R,M){const F=new Float64Array(16);return te(F,p,y,T,S,R,M),F}getDistanceToElevation(p,y=false){const T=0===p?0:E(p,y?Ju(this.position[1]):this.position[1]),S=this.forward();return(T-this.position[2])/S[2]}clone(){return new Qle([...this.position],[...this.orientation])}}const r2r=Math.tan(85*Math.PI/180);function xBe(b,p,y,T,S,R,M){const F=g();if(y)if("globe"===R.name){const G=function(q,Q){const{x:ie,y:ae}=q.point,de=lTt(ie,ae,q.worldSize/q._pixelsPerMercatorPixel,0,0);return P(de,de,p5e(U2(Q)))}(S,p);P(F,F,G)}else{const G=d([],M);F[0]=G[0],F[1]=G[1],F[4]=G[2],F[5]=G[3],T||z(F,F,S.angle)}else P(F,S.labelPlaneMatrix,b);return F}function AI(b,p,y,T){const S=[b,p,y,1];y?ye(S,S,T):lEt(S,S,T);const R=S[3];return S[0]/=R,S[1]/=R,S[2]/=R,S}function tEt(b,p){return Math.min(.5+b/p*.5,1.5)}function i2r(b,p){const y=b[0]/b[3],T=b[1]/b[3];return y>=-p[0]&&y<=p[0]&&T>=-p[1]&&T<=p[1]}function nEt(b,p,y,T,S,R,M,F,G,q,Q,ie,ae,de,pe,_e,Se,Fe){const{lineStartIndex:Ye,glyphStartIndex:Xe,segment:We}=F,rt=Xe+F.numGlyphs,lt=Ye+F.lineLength,Bt=p.getoffsetX(Xe),ht=p.getoffsetX(rt-1),Tt=ece(b*Bt,y,T,S,R,M,We,Ye,lt,G,q,Q,ie,ae,true,de,pe,_e,Se,Fe);if(!Tt)return null;const Lt=ece(b*ht,y,T,S,R,M,We,Ye,lt,G,q,Q,ie,ae,true,de,pe,_e,Se,Fe);return Lt?{first:Tt,last:Lt}:null}function rEt(b,p,y,T){return b===wA.horizontal&&Math.abs(T)>Math.abs(y)?{useVertical:true}:b===wA.vertical?T>0?{needsFlipping:true}:null:0!==p&&function(S,R){return 0===S||Math.abs(R/S)>r2r}(y,T)?1===p?{needsFlipping:true}:null:y<0?{needsFlipping:true}:null}function iEt(b,p,y,T,S,R,M,F,G,q,Q,ie,ae,de,pe,_e,Se,Fe,Ye,Xe,We){const rt=p/24,lt=b.lineOffsetX*rt,Bt=b.lineOffsetY*rt,{lineStartIndex:ht,glyphStartIndex:Tt,numGlyphs:Lt,segment:Nt,writingMode:un,flipState:_n}=b,Dn=ht+b.lineLength,Ln=zn=>{if(Q){const[In,Gn,qn]=zn.up,Zn=q.length;yle(Q,Zn+0,In,Gn,qn),yle(Q,Zn+1,In,Gn,qn),yle(Q,Zn+2,In,Gn,qn),yle(Q,Zn+3,In,Gn,qn)}const[or,nn,En]=zn.point;y4(q,or,nn,En,zn.angle)};if(Lt>1){const zn=nEt(rt,F,lt,Bt,y,ie,ae,b,G,R,de,_e,false,Se,Fe,Ye,Xe,We);if(!zn)return{notEnoughRoom:true};if(T&&!y){let[or,nn,En]=zn.first.point,[In,Gn,qn]=zn.last.point;[or,nn]=AI(or,nn,En,M),[In,Gn]=AI(In,Gn,qn,M);const Zn=rEt(un,_n,(In-or)*pe,Gn-nn);if(b.flipState=Zn&&Zn.needsFlipping?1:2,Zn)return Zn}Ln(zn.first);for(let or=Tt+1;or0?In:sEt(ae,En,or,1,S,void 0,Se,Fe.canonical),qn=rEt(un,_n,(Gn[0]-or[0])*pe,Gn[1]-or[1]);if(b.flipState=qn&&qn.needsFlipping?1:2,qn)return qn}const zn=ece(rt*F.getoffsetX(Tt),lt,Bt,y,ie,ae,Nt,ht,Dn,G,R,de,_e,false,false,Se,Fe,Ye,Xe,We);if(!zn)return{notEnoughRoom:true};Ln(zn)}return{}}function oEt(b,p,y){const T=1<0?1:-1,lt=0;T&&(rt*=-1,lt=Math.PI),rt<0&&(lt+=Math.PI);let Bt=F+M+(rt>0?0:1)|0,ht=S,Tt=S,Lt=0,Nt=0;const un=Math.abs(We),_n=[],Dn=[];let Ln=R,zn=Ln,or=Je([]);const nn=()=>sEt(zn,Ln,Tt,un-Lt+1,Q,ae,_e,Se.canonical,Xe);for(;Lt+Nt<=un;){if(Bt+=rt,Bt=G)return null;if(Tt=ht,zn=Ln,_n.push(Tt),de&&Dn.push(zn),Ln=new nt(q.getx(Bt),q.gety(Bt)),ht=ie[Bt],!ht){const Cr=aEt(Ln,Se.canonical,Q,_e,ae,Xe);ht=Cr[3]>0?ie[Bt]=Cr:nn()}Lt+=Nt;const pr=we([],ht,Tt),ni=Le(Tt,ht);if(y&&ni>0&&Nt>0&&mt(or,pr)/(Nt*ni)0&&this.elevation.exaggeration()>0&&this._centerAltitudeValidForExaggeration;if(!this._elevation||p===Number.NEGATIVE_INFINITY&&(!y||!this._centerAltitude))return this._centerAltitude=0,this._seaLevelZoom=null,void(this._centerAltitudeValidForExaggeration=void 0);const T=this._elevation;y||this._centerAltitude&&this._centerAltitudeValidForExaggeration&&T.exaggeration()&&this._centerAltitudeValidForExaggeration!==T.exaggeration()?(this._centerAltitude=this._centerAltitude/this._centerAltitudeValidForExaggeration*T.exaggeration(),this._centerAltitudeValidForExaggeration=T.exaggeration()):(this._centerAltitude=p||0,this._centerAltitudeValidForExaggeration=T.exaggeration()),this._updateSeaLevelZoom()}_updateSeaLevelZoom(){if(void 0===this._centerAltitudeValidForExaggeration)return;const p=Math.max(0,(this.pixelsPerMeter*this._centerAltitude+this.cameraToCenterDistance)/this.worldSize);this._seaLevelZoom=this._zoomFromMercatorZ(p)}sampleAverageElevation(){if(!this._elevation)return 0;const p=this._elevation,y=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],T=this.horizonLineFromTop();let S=0,R=0;for(let M=0;M{const Se=TI(ae,ie,de,pe,_e);G.has(Se)||(R.push(new pf(ie,ae,de,pe,_e)),G.add(Se))};for(let ie=0;ieae.canonical.z)continue;const de=ae.canonical,pe=ae.overscaledZ,_e=ae.wrap,Se=1<0,Xe=de.y+10,rt=ae.wrap-(Ye?0:1),lt=ae.wrap+(Fe?0:1),Bt=Ye?de.x-1:Se-1,ht=Fe?de.x+1:0;if(M)T[0]<0?(q(pe,lt,de.z,ht,de.y),T[1]<0&&Xe&&(q(pe,_e,de.z,de.x,de.y+1),q(pe,lt,de.z,ht,de.y+1)),T[1]>0&&We&&(q(pe,_e,de.z,de.x,de.y-1),q(pe,lt,de.z,ht,de.y-1))):T[0]>0?(q(pe,rt,de.z,Bt,de.y),T[1]<0&&Xe&&(q(pe,_e,de.z,de.x,de.y+1),q(pe,rt,de.z,Bt,de.y+1)),T[1]>0&&We&&(q(pe,_e,de.z,de.x,de.y-1),q(pe,rt,de.z,Bt,de.y-1))):T[1]<0&&Xe?q(pe,_e,de.z,de.x,de.y+1):We&&q(pe,_e,de.z,de.x,de.y-1);else{const Tt=ae.visibleQuadrants;1&Tt&&(q(pe,rt,de.z,Bt,de.y),We&&(q(pe,_e,de.z,de.x,de.y-1),q(pe,rt,de.z,Bt,de.y-1))),2&Tt&&(q(pe,lt,de.z,ht,de.y),We&&(q(pe,_e,de.z,de.x,de.y-1),q(pe,lt,de.z,ht,de.y-1))),4&Tt&&(q(pe,rt,de.z,Bt,de.y),Xe&&(q(pe,_e,de.z,de.x,de.y+1),q(pe,rt,de.z,Bt,de.y+1))),8&Tt&&(q(pe,lt,de.z,ht,de.y),Xe&&(q(pe,_e,de.z,de.x,de.y+1),q(pe,lt,de.z,ht,de.y+1)))}}const Q=[];for(const ie of R)R.some(ae=>ie.isChildOf(ae))||Q.push(ie);if(R=Q.filter(ie=>!p.some(ae=>!!(ie.overscaledZ{const Fe=Se.canonical.x+.5-de[0],Ye=Se.canonical.y+.5-de[1];return Fe*Fe+Ye*Ye<_e})}return R}extendTileCoverToNearPlane(p,y,T){const S=[],R=new Set;for(const Ye of p)R.add(Ye.key);const M=(Ye,Xe,We,rt,lt)=>{const Bt=TI(Xe,Ye,We,rt,lt);R.has(Bt)||(S.push(new pf(Ye,Xe,We,rt,lt)),R.add(Bt))},F=p.reduce((Ye,Xe)=>Math.max(Ye,Xe.overscaledZ),T),G=1<{const We=Math.floor(Ye[0]),rt=Math.floor(Ye[1]),lt=(Ye[0]-We)*qr,Bt=(Ye[1]-rt)*qr,ht=Math.floor(Xe[0]),Tt=Math.floor(Xe[1]),Lt=(Xe[0]-ht)*qr,Nt=(Xe[1]-Tt)*qr;for(let un=-1;un<=1;un++){const _n=We+un;if(!(_n<0||_n>=G)){Q.x=lt-un*qr,ie.x=Lt-(_n-ht)*qr;for(let Dn=-1;Dn<=1;Dn++){const Ln=rt+Dn;Q.y=Bt-Dn*qr,ie.y=Nt-(Ln-Tt)*qr,V7(Q,ie,q)&&M(F,0,T,_n,Ln)}}}},de=y.points,pe=de[3],_e=de[2],Se=this._projectToGround(pe,de[7]),Fe=this._projectToGround(_e,de[6]);return ae(pe,Se),ae(_e,Fe),S}_projectToGround(p,y){return Ge(oe(),p,y,p[2]/(p[2]-y[2]))}_projectToZ(p,y,T){const S=p[2]-y[2];return Math.abs(S)<1e-6?se(p):Ge(oe(),p,y,(p[2]-T)/S)}extendTileCoverForTunnels(p,y,T,S){if(T<18)return[];const R=y.points,M=R[0],F=R[1],G=R[4],q=R[5];if(G[2]>=0&&q[2]>=0||M[2]<=0||F[2]<=0)return[];const Q=G[2]<0?this._projectToZ(M,G,0):G,ie=q[2]<0?this._projectToZ(F,q,0):q,ae=-S,de=G[2]3&&(_e.length=3),_e}_findExtensionTilesInQuad(p,y,T,S){const R=[],M=new Set;for(const ht of p)M.add(ht.key);const F=p.reduce((ht,Tt)=>Math.max(ht,Tt.overscaledZ),y),G=1<{const Lt=ht.canonical.x+.5-lt,Nt=ht.canonical.y+.5-Bt,un=Tt.canonical.x+.5-lt,_n=Tt.canonical.y+.5-Bt;return Lt*Lt+Nt*Nt-(un*un+_n*_n)||ht.canonical.x-Tt.canonical.x||ht.canonical.y-Tt.canonical.y}),R}coveringTiles(p){let y=this.coveringZoomLevel(p);const T=y,S=this.elevation&&this.elevation.exaggeration(),R=S&&!p.isTerrainDEM,M="mercator"===this.projection.name;if(void 0!==p.minzoom&&yp.maxzoom&&(y=p.maxzoom);const F=this.locationCoordinate(this.center),G=this.center.lat,q=1<{const En=1/4e4,In=new fe(nn.x+En,nn.y,nn.z),Gn=new fe(nn.x,nn.y+En,nn.z),qn=nn.toLngLat(),Zn=In.toLngLat(),Hn=Gn.toLngLat(),ur=this.locationCoordinate(qn),pr=this.locationCoordinate(Zn),ni=this.locationCoordinate(Hn),Cr=Math.hypot(pr.x-ur.x,pr.y-ur.y),Fr=Math.hypot(ni.x-ur.x,ni.y-ur.y);return Math.sqrt(Cr*Fr)*Bt/En},Tt=nn=>{const En=rt,In=lt;return{aabb:hTt(this,q,0,0,0,nn,In,En,this.projection),zoom:0,x:0,y:0,minZ:In,maxZ:En,wrap:nn,fullyVisible:false}},Lt=[];let Nt=[];const un=y,_n=p.reparseOverscaled?T:y,Dn=(Se-this._centerAltitude)*_e,Ln=nn=>{if(!this._elevation||!nn.tileID||!M)return;const En=this._elevation.getMinMaxForTile(nn.tileID),In=nn.aabb;En?(In.min[2]=En.min,In.max[2]=En.max,In.center[2]=(In.min[2]+In.max[2])/2):(nn.shouldSplit=or(nn),nn.shouldSplit||(In.min[2]=In.max[2]=In.center[2]=this._centerAltitude))},zn=(nn,En)=>{if(.707*En{if(nn.zoom=.9)return true}else if(R&&(Gn=nn.aabb.distanceZ(Fe)*_e),this.projection.isReprojectedInTileSpace&&T<=5){const Fr=Math.pow(2,nn.zoom),Fi=ht(new fe((nn.x+.5)/Fr,(nn.y+.5)/Fr));qn=Fi>.85?1:Fi}if(!M&&!ie){const Fr=Math.sqrt(En*En+In*In+Gn*Gn);let Fi=(1<0;){const nn=Lt.pop(),En=nn.x,In=nn.y;let Gn=nn.fullyVisible;const qn=()=>"globe"===this.projection.name&&(0===nn.y||nn.y===(1<Zn)continue;let Hn=0;if(!Gn){let Cr=Ye?nn.aabb.intersectsPrecise(de):nn.aabb.intersectsPreciseFlat(de);if(0===Cr&&qn()){const Fr=new _I(nn.zoom,En,In);Cr=f5e(this,q,Fr,true).intersectsPrecise(de)}if(0===Cr)continue;if(p.calculateQuadrantVisibility)if(de.containsPoint(nn.aabb.center))Hn=15;else for(let Fr=0;Fr<4;Fr++)0!==nn.aabb.quadrant(Fr).intersects(de)&&(Hn|=1<>1),pr={aabb:M?nn.aabb.quadrant(Zn):hTt(this,q,nn.zoom+1,Hn,ur,nn.wrap,nn.minZ,nn.maxZ,this.projection),zoom:nn.zoom+1,x:Hn,y:ur,wrap:nn.wrap,fullyVisible:Gn,tileID:void 0,shouldSplit:void 0,minZ:nn.minZ,maxZ:nn.maxZ};R&&!ie&&(pr.tileID=new pf(nn.zoom+1===un?_n:nn.zoom+1,nn.wrap,nn.zoom+1,Hn,ur),Ln(pr)),Lt.push(pr)}}if(this.fogCullDistSq){const nn=this.fogCullDistSq,En=this.horizonLineFromTop();Nt=Nt.filter(In=>{const Gn=[0,0,0,1],qn=[qr,qr,0,1],Zn=this.calculateFogTileMatrix(In.tileID.toUnwrapped());ye(Gn,Gn,Zn),ye(qn,qn,Zn);const Hn=(Cr=Gn,Fr=qn,(ni=[])[0]=Math.min(Cr[0],Fr[0]),ni[1]=Math.min(Cr[1],Fr[1]),ni[2]=Math.min(Cr[2],Fr[2]),ni[3]=Math.min(Cr[3],Fr[3]),ni),ur=function(no,Ii,mo){return no[0]=Math.max(Ii[0],mo[0]),no[1]=Math.max(Ii[1],mo[1]),no[2]=Math.max(Ii[2],mo[2]),no[3]=Math.max(Ii[3],mo[3]),no}([],Gn,qn),pr=function(no,Ii){let mo=0;for(let io=0;io<2;++io){const xa=0;no[io]>xa&&(mo+=(no[io]-xa)*(no[io]-xa)),Ii[io]nn&&0!==En){const no=this.calculateProjMatrix(In.tileID.toUnwrapped());let Ii;p.isTerrainDEM||(Ii=Bi.getMinMaxForTile(In.tileID)),Ii||(Ii={min:lt,max:rt});const mo=function(xa){const va=Math.round((xa+45+360)%360/90)%4;return Jr[va]}(this.rotation),io=[mo[0]*qr,mo[1]*qr,Ii.max];it(io,io,no),Fi=(1-io[1])*this.height*.5nn.distanceSq-En.distanceSq).map(nn=>nn.tileID)}resize(p,y){this.width=p,this.height=y,this.pixelsToGLUnits=[2/p,-2/y],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(p){return Math.pow(2,p)}scaleZoom(p){return Math.log2(p)}project(p){const y=bn(p.lat,-85.051129,V),T=this.projection.project(p.lng,y);return new nt(T.x*this.worldSize,T.y*this.worldSize)}unproject(p){return this.projection.unproject(p.x/this.worldSize,p.y/this.worldSize)}get point(){return this.project(this.center)}get pointMerc(){return this.point._div(this.worldSize)}get pixelsPerMeterRatio(){return this.pixelsPerMeter/E(1,this.center.lat)/this.worldSize}setLocationAtPoint(p,y){let T,S;const R=this.centerPoint;if("globe"===this.projection.name){const F=this.worldSize;T=(y.x-R.x)/F,S=(y.y-R.y)/F}else{const F=this.pointCoordinate(y),G=this.pointCoordinate(R);T=F.x-G.x,S=F.y-G.y}const M=this.locationCoordinate(p);this.setLocation(new fe(M.x-T,M.y-S))}setLocation(p){this.center=this.coordinateLocation(p),this.projection.wrap&&(this.center=this.center.wrap())}locationPoint(p,y){return this.projection.locationPoint(this,p,y)}locationPoint3D(p,y){return this.projection.locationPoint(this,p,y,true)}pointLocation(p){return this.coordinateLocation(this.pointCoordinate(p))}pointLocation3D(p,y){return this.coordinateLocation(this.pointCoordinate3D(p,y))}locationCoordinate(p,y){const T=y?E(y,p.lat):void 0,S=this.projection.project(p.lng,p.lat);return new fe(S.x,S.y,T)}coordinateLocation(p){return this.projection.unproject(p.x,p.y)}pointRayIntersection(p,y){const T=y??this._centerAltitude,S=[p.x,p.y,0,1],R=[p.x,p.y,1,1];ye(S,S,this.pixelMatrixInverse),ye(R,R,this.pixelMatrixInverse);const M=R[3];ze(S,S,1/S[3]),ze(R,R,1/M);const F=S[2],G=R[2];return{p0:S,p1:R,t:F===G?0:(T-F)/(G-F)}}screenPointToMercatorRay(p){const y=[p.x,p.y,0,1],T=[p.x,p.y,1,1];return ye(y,y,this.pixelMatrixInverse),ye(T,T,this.pixelMatrixInverse),ze(y,y,1/y[3]),ze(T,T,1/T[3]),y[2]=E(y[2],this._center.lat)*this.worldSize,T[2]=E(T[2],this._center.lat)*this.worldSize,ze(y,y,1/this.worldSize),ze(T,T,1/this.worldSize),new Zse([y[0],y[1],y[2]],yt([],we([],T,y)))}rayIntersectionCoordinate(p){const{p0:y,p1:T,t:S}=p,R=E(y[2],this._center.lat),M=E(T[2],this._center.lat);return new fe(Si(y[0],T[0],S)/this.worldSize,Si(y[1],T[1],S)/this.worldSize,Si(R,M,S))}pointCoordinate(p,y=this._centerAltitude){return this.projection.pointCoordinate(this,p.x,p.y,y)}pointCoordinate3D(p,y){if(!this.elevation)return this.pointCoordinate(p,y);let T=this.projection.pointCoordinate3D(this,p.x,p.y);if(T)return new fe(T[0],T[1],T[2]);let S=0,R=this.horizonLineFromTop();if(p.y>R)return this.pointCoordinate(p,y);const M=.02*R,F=p.clone();for(let G=0;G<10&&R-S>M;G++){F.y=Si(S,R,.66);const q=this.projection.pointCoordinate3D(this,F.x,F.y);q?(R=F.y,T=q):S=F.y}return T?new fe(T[0],T[1],T[2]):this.pointCoordinate(p)}isPointAboveHorizon(p){return this.projection.isPointAboveHorizon(this,p)}isPointOnSurface(p){if(p.y<0||p.y>this.height||p.x<0||p.x>this.width)return false;if(this.elevation||this.zoom>=6)return!this.isPointAboveHorizon(p);const y=this.pointCoordinate(p);return y.y>=0&&y.y<=1}_coordinatePoint(p,y){const T=y&&this.elevation?this.elevation.getAtPointOrZero(p,this._centerAltitude):this._centerAltitude,S=[p.x*this.worldSize,p.y*this.worldSize,T+p.toAltitude(),1];return ye(S,S,this.pixelMatrix),S[3]>0?new nt(S[0]/S[3],S[1]/S[3]):new nt(Number.MAX_VALUE,Number.MAX_VALUE)}_getBoundsNonRectangular(){const{top:p,left:y}=this._edgeInsets,T=this.height-this._edgeInsets.bottom,S=this.width-this._edgeInsets.right,R=this.pointLocation3D(new nt(y,p)),M=this.pointLocation3D(new nt(S,p)),F=this.pointLocation3D(new nt(S,T)),G=this.pointLocation3D(new nt(y,T));let q=Math.min(R.lng,M.lng,F.lng,G.lng),Q=Math.max(R.lng,M.lng,F.lng,G.lng),ie=Math.min(R.lat,M.lat,F.lat,G.lat),ae=Math.max(R.lat,M.lat,F.lat,G.lat);const de=Math.pow(2,-this.zoom)/16*270,pe="globe"===this.projection.name?1:4,_e=(Se,Fe,Ye,Xe,We)=>{const rt=(Se+Ye)/2,lt=(Fe+Xe)/2,Bt=new nt(rt,lt),{lng:ht,lat:Tt}=this.pointLocation3D(Bt),Lt=Math.max(0,q-ht,ie-Tt,ht-Q,Tt-ae);q=Math.min(q,ht),Q=Math.max(Q,ht),ie=Math.min(ie,Tt),ae=Math.max(ae,Tt),(Wede)&&(_e(Se,Fe,rt,lt,We+1),_e(rt,lt,Ye,Xe,We+1))};if(_e(y,p,S,p,1),_e(S,p,S,T,1),_e(S,T,y,T,1),_e(y,T,y,p,1),"globe"===this.projection.name){const[Se,Fe]=function(Ye){const Xe=_(new Float64Array(16));P(Xe,Ye.pixelMatrix,Ye.globeMatrix);const We=[0,Ib,0],rt=[0,Mb,0];return it(We,We,Xe),it(rt,rt,Xe),[We[0]>0&&We[0]<=Ye.width&&We[1]>0&&We[1]<=Ye.height&&!g5e(Ye,new Ea(Ye.center.lat,90)),rt[0]>0&&rt[0]<=Ye.width&&rt[1]>0&&rt[1]<=Ye.height&&!g5e(Ye,new Ea(Ye.center.lat,-90))]}(this);Se?(ae=90,Q=180,q=-180):Fe&&(ie=-90,Q=180,q=-180)}return new k(new Ea(q,ie),new Ea(Q,ae))}_getBoundsRectangular(p,y){const{top:T,left:S}=this._edgeInsets,R=this.height-this._edgeInsets.bottom,M=this.width-this._edgeInsets.right,F=new nt(S,T),G=new nt(M,T),q=new nt(M,R),Q=new nt(S,R);let ie=this.pointCoordinate(F,p),ae=this.pointCoordinate(G,p);const de=this.pointCoordinate(q,y),pe=this.pointCoordinate(Q,y),_e=(Se,Fe)=>(Fe.y-Se.y)/(Fe.x-Se.x);return ie.y>1&&ae.y>=0?ie=new fe((1-pe.y)/_e(pe,ie)+pe.x,1):ie.y<0&&ae.y<=1&&(ie=new fe(-pe.y/_e(pe,ie)+pe.x,0)),ae.y>1&&ie.y>=0?ae=new fe((1-de.y)/_e(de,ae)+de.x,1):ae.y<0&&ie.y<=1&&(ae=new fe(-de.y/_e(de,ae)+de.x,0)),new k().extend(this.coordinateLocation(ie)).extend(this.coordinateLocation(ae)).extend(this.coordinateLocation(pe)).extend(this.coordinateLocation(de))}_getBoundsRectangularTerrain(){const p=this.elevation;if(!p.visibleDemTiles.length||p.isUsingMockSource())return this._getBoundsRectangular(0,0);const y=p.visibleDemTiles.reduce((T,S)=>{if(S.dem){const R=S.dem.tree;T.min=Math.min(T.min,R.minimums[0]),T.max=Math.max(T.max,R.maximums[0])}return T},{min:Number.MAX_VALUE,max:0});return this._getBoundsRectangular(y.min*p.exaggeration(),y.max*p.exaggeration())}getBounds(){return"mercator"===this.projection.name||"equirectangular"===this.projection.name?this._terrainEnabled()?this._getBoundsRectangularTerrain():this._getBoundsRectangular(0,0):this._getBoundsNonRectangular()}horizonLineFromTop(p=true){const y=this.height/2/Math.tan(this._fov/2)/Math.tan(Math.max(this._pitch,.1))-this.centerOffset.y,T=this.height/2-y*(1-this._horizonShift);return p?Math.max(0,T):T}getMaxBounds(){return this.maxBounds}setMaxBounds(p){this.maxBounds=p,this.minLat=-85.051129,this.maxLat=V,this.minLng=-180,this.maxLng=180,p&&(this.minLat=p.getSouth(),this.maxLat=p.getNorth(),this.minLng=p.getWest(),this.maxLng=p.getEast(),this.maxLngie&&(F=ie-q),ie-Qde&&(M=de-G),de-ae{for(let _n=0;_n<16;_n++)Tt[_n]=Si(Lt[_n],Nt[_n],un)})(F,F,G,Ao(this.pitch>=rz?1:this.pitch/rz))}else F=G;const q=J([],G,M),Q=J([],F,M);if(this.projection.isReprojectedInTileSpace){const rt=this.locationCoordinate(this.center);_(this._mat4Scratch);const lt=this._mat4Scratch;L(lt,lt,[rt.x*this.worldSize,rt.y*this.worldSize,0]),P(lt,lt,bwt(this)),L(lt,lt,[-rt.x*this.worldSize,-rt.y*this.worldSize,0]),P(Q,Q,lt),P(q,q,lt),this.inverseAdjustmentMatrix=function(Bt){const ht=bwt(Bt,true);return d([],[ht[0],ht[1],ht[4],ht[5]])}(this)}else this.inverseAdjustmentMatrix=[1,0,0,1];if(I(this.mercatorMatrix,Q,[this.worldSize,this.worldSize,this.worldSize/R,1]),this.projMatrix=Q,A(this.invProjMatrix,this.projMatrix),y){const rt=this._camera.getCameraToClipPerspective(this._fov,this.width/this.height,this._nearZ,1/0);rt[8]=2*-p.x/this.width,rt[9]=2*p.y/this.height,J(this._expandedFarZProjMatrixBuf,rt,M),this.expandedFarZProjMatrix=this._expandedFarZProjMatrixBuf}else this.expandedFarZProjMatrix=this.projMatrix;A(this._mat4Scratch,F),this.frustumCorners=c5e.fromInvProjectionMatrix(this._mat4Scratch,this.horizonLineFromTop(),this.height),this.cameraFrustum=EA.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,0,!y),W(this.skyboxMatrix,[1,-1,1]),N(this.skyboxMatrix,this.skyboxMatrix,this._pitch),z(this.skyboxMatrix,this.skyboxMatrix,this.angle),j(this.starsProjMatrix,this._fov,this.width/this.height,this._nearZ,this._farZ);const ie=(Math.PI/2-this._pitch)*(this.height/this._fov)*this._horizonShift;w(this._mat4Scratch,this.starsProjMatrix),this._mat4Scratch[8]=2*-p.x/this.width,this._mat4Scratch[9]=2*(p.y+ie)/this.height,P(this.skyboxMatrix,this._mat4Scratch,this.skyboxMatrix);const ae=this.point,de=ae.x,pe=ae.y,_e=this.width%2/2,Se=this.height%2/2,Fe=Math.cos(this.angle),Ye=Math.sin(this.angle),Xe=de-Math.round(de)+Fe*_e+Ye*Se,We=pe-Math.round(pe)+Fe*Se+Ye*_e;if(w(this.alignedProjMatrix,Q),L(this.alignedProjMatrix,this.alignedProjMatrix,[Xe>.5?Xe-1:Xe,We>.5?We-1:We,0]),W(this.labelPlaneMatrix,[this.width/2,-this.height/2,1]),L(this.labelPlaneMatrix,this.labelPlaneMatrix,[1,-1,0]),W(this.glCoordMatrix,[1,-1,1]),L(this.glCoordMatrix,this.glCoordMatrix,[-1,-1,0]),I(this.glCoordMatrix,this.glCoordMatrix,[2/this.width,2/this.height,1]),P(this.pixelMatrix,this.labelPlaneMatrix,q),this._calcFogMatrices(),this._distanceTileDataCache={},!A(this.pixelMatrixInverse,this.pixelMatrix))throw new Error("failed to invert matrix");if("globe"===this.projection.name||this.mercatorFromTransition){this.globeMatrix=function(lt){const{x:Bt,y:ht}=lt.point,{lng:Tt,lat:Lt}=lt._center;return lTt(Bt,ht,lt.worldSize,Tt,Lt)}(this);const rt=[this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]];this.globeCenterInViewSpace=it(rt,rt,M),this.globeRadius=this.worldSize/2/Math.PI-1}else this.globeMatrix=this.pixelMatrixInverse;this._projMatrixCache={},this._alignedProjMatrixCache={},this._pixelsToTileUnitsCache={},this._expandedProjMatrixCache={}}_calcFogMatrices(){this._fogTileMatrixCache={};const p=this.cameraWorldSizeForFog,y=this.cameraPixelsPerMeter,T=this._camera.position,S=1/this.height/this._pixelsPerMercatorPixel,R=[p,p,y];ge(R,R,S),ge(T,T,-1),Ie(T,T,R),U(this.mercatorFogMatrix,T),I(this.mercatorFogMatrix,this.mercatorFogMatrix,R),this.worldToFogMatrix=this._camera.getWorldToCameraPosition(p,y,S)}_computeCameraPosition(p){const y=(p=p||this.pixelsPerMeter)/this.pixelsPerMeter,T=this._camera.forward(),S=this.point,R=this._mercatorZfromZoom(this._seaLevelZoom?this._seaLevelZoom:this._zoom)*y-p/this.worldSize*this._centerAltitude;return[S.x/this.worldSize-T[0]*R,S.y/this.worldSize-T[1]*R,p/this.worldSize*this._centerAltitude-T[2]*R]}_updateCameraState(){this.height&&(this._camera.setPitchBearing(this._pitch,this.angle),this._camera.position=this._computeCameraPosition())}_translateCameraConstrained(p){const y=this._maxCameraBoundsDistance()*Math.cos(this._pitch),T=this._camera.position[2],S=p[2];let R=1;this.projection.wrap&&(this.center=this.center.wrap()),S>0&&(R=Math.min((y-T)/S,1)),this._camera.position=Ve([],this._camera.position,p,R),this._updateStateFromCamera()}_updateStateFromCamera(){const p=this._camera.position,y=this._camera.forward(),{pitch:T,bearing:S}=this._camera.getPitchBearing(),R=E(this._centerAltitude,this.center.lat)*this._pixelsPerMercatorPixel,M=this._mercatorZfromZoom(this._maxZoom)*Math.cos(Fn(this._maxPitch)),F=Math.max((p[2]-R)/Math.cos(T),M),G=this._zoomFromMercatorZ(F);Ve(p,p,y,F),this._pitch=bn(T,Fn(this.minPitch),Fn(this.maxPitch)),this.angle=Jn(S,-Math.PI,Math.PI),this._setZoom(bn(G,this._minZoom,this._maxZoom)),this._updateSeaLevelZoom(),this._center=this.coordinateLocation(new fe(p[0],p[1],p[2])),this._unmodified=false,this._constrain(),this._calcMatrices()}_worldSizeFromZoom(p){return Math.pow(2,p)*this.tileSize}_mercatorZfromZoom(p){return this.cameraToCenterDistance/this._worldSizeFromZoom(p)}_minimumHeightOverTerrain(){const p=Math.min(this._seaLevelZoom??this._zoom,this._maxZoom)+4;return this._mercatorZfromZoom(p)}_zoomFromMercatorZ(p){return this.scaleZoom(this.cameraToCenterDistance/(Math.max(0,p)*this.tileSize))}zoomFromMercatorZAdjusted(p){let y=0,T=6,S=0,R=1/0;for(;T-y>1e-6&&T>y;){const M=y+.5*(T-y),F=this.tileSize*Math.pow(2,M),G=this.getCameraToCenterDistance(this.projection,M,F),q=this.scaleZoom(G/(Math.max(0,p)*this.tileSize)),Q=Math.abs(M-q);Qq||ae.y>1)return true}return false}isHorizonVisible(){return this.pitch+Tr(this.fovAboveCenter)>88||this.anyCornerOffEdge(new nt(0,0),new nt(this.width,this.height))}zoomDeltaToMovement(p,y){const T=re(we([],this._camera.position,p)),S=this._zoomFromMercatorZ(T)+y;return T-this._mercatorZfromZoom(S)}getCameraPoint(){if("globe"===this.projection.name){const p=function([y,T,S],R){const M=[y,T,S,1];ye(M,M,R);const F=M[3]=Math.max(M[3],1e-6);return M[0]/=F,M[1]/=F,M[2]/=F,M}([this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]],this.pixelMatrix);return new nt(p[0],p[1])}{const p=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new nt(0,p))}}getCameraToCenterDistance(p,y=this.zoom,T=this.worldSize){const S=Kq(p,y,this.width,this.height,1024),R=p.pixelSpaceConversion(this.center.lat,T,S);let M=.5/Math.tan(.5*this._fov)*this.height*R;return this.isOrthographic&&(M=Si(1,M,Ao(this.pitch>=rz?1:this.pitch/rz))),M}getWorldToCameraMatrix(){const p=this._camera.getWorldToCamera(this.worldSize,"meters"===this.projection.zAxisUnit?this.pixelsPerMeter:1);return"globe"===this.projection.name&&P(p,p,this.globeMatrix),p}getFrustum(p){return EA.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,p,"meters"===this.projection.zAxisUnit)}}const iz=(b,p)=>{if(p<=0||b.terrain)return{shouldRenderCutoff:false,uniformValues:{u_cutoff_params:[0,0,0,1]}};const y=b.transform,T=y.pitch,S=y.isLODDisabled(false)?60:30;if(T0,uniformValues:{u_cutoff_params:[y._nearZ,y._farZ,(Q-y._nearZ)/R,(Q-ie-y._nearZ)/R]}}},sX=.05;function tce(b,p,y){const T=ir(45,65,y),[S,R]=b.range;let M=1-Math.min(1,Math.exp((p-S)/(R-S)*-6));return M*=M*M,M=Math.min(1,1.00747*M),M*T*b.alpha}function cEt(b,p,y,T,S){return tce(b,re(it([],[p,y,T],S.mercatorFogMatrix)),S.pitch)}function _Be(b,p,y,T){const S=1<({u_matrix:b,u_color:p,u_overlay:0,u_overlay_scale:y}),G2=new Float64Array(16),kI=new Float64Array(16),dEt=new Float64Array(16),TBe=new Float64Array(16),wBe=new Float64Array(16),nce=new Float64Array(16),o2r=new Float64Array(16),rce=[0,0,0],a2r=new Float32Array(16),ice=[0,0,0],s2r=[0,0,0],EBe=[];function fEt(b,p,y){const T=y.cameraWorldSizeForFog/y.worldSize;return I(b,y.worldToFogMatrix,[T,T,1]),P(b,b,p),b}function lX(b,p,y,T){return L(b,p,y),Te(T,lwr)||I(b,b,T),b}function CBe(b,p,y,T,S){const R=y.material,M=T.context,{baseColorTexture:F,metallicRoughnessTexture:G}=R.pbrMetallicRoughness,{normalTexture:q,occlusionTexture:Q,emissionTexture:ie}=R;function ae(pe,_e,Se){if(pe&&(b.push(_e),M.activeTexture.set(M.gl.TEXTURE0+Se),pe.gfxTexture)){const{minFilter:Fe,magFilter:Ye,wrapS:Xe,wrapT:We}=pe.sampler;pe.gfxTexture.bindExtraParam(Fe,Ye,Xe,We)}}ae(F,"HAS_TEXTURE_u_baseColorTexture",rg.BaseColor),ae(G,"HAS_TEXTURE_u_metallicRoughnessTexture",rg.MetallicRoughness),ae(q,"HAS_TEXTURE_u_normalTexture",rg.Normal),ae(Q,"HAS_TEXTURE_u_occlusionTexture",rg.Occlusion),ae(ie,"HAS_TEXTURE_u_emissionTexture",rg.Emission),S&&(S.texture||(S.texture=new kTt(T.context,S.image,[S.image.height,S.image.height,S.image.height],M.gl.RGBA8)),M.activeTexture.set(M.gl.TEXTURE0+rg.LUT),S.texture&&S.texture.bind(M.gl.LINEAR,M.gl.CLAMP_TO_EDGE),b.push("APPLY_LUT_ON_GPU")),y.texcoordBuffer&&(b.push("HAS_ATTRIBUTE_a_uv_2f"),p.push(y.texcoordBuffer)),y.colorBuffer&&(b.push(12===y.colorBuffer.itemSize?"HAS_ATTRIBUTE_a_color_3f":"HAS_ATTRIBUTE_a_color_4f"),p.push(y.colorBuffer)),y.normalBuffer&&(b.push("HAS_ATTRIBUTE_a_normal_3f"),p.push(y.normalBuffer)),y.pbrBuffer&&(b.push("HAS_ATTRIBUTE_a_pbr"),b.push("HAS_ATTRIBUTE_a_heightBasedEmissiveStrength"),p.push(y.pbrBuffer)),"OPAQUE"!==R.alphaMode&&"MASK"!==R.alphaMode||b.push("UNPREMULT_TEXTURE_IN_SHADER"),R.defined||b.push("DIFFUSE_SHADED");const de=T.shadowRenderer;de&&(b.push("RENDER_SHADOWS"),de.useNormalOffset&&b.push("NORMAL_OFFSET"))}function SBe(b,p,y,T,S,R){const M=b.modelOpacity,F=p.context,G=new Rh(p.context.gl.LEQUAL,b.isLightMesh?Rh.ReadOnly:Rh.ReadWrite,p.depthRangeFor3D),q=p.transform,Q=b.mesh,ie=Q.material,ae=ie.pbrMetallicRoughness,de=p.style.fog;"pixels"===p.transform.projection.zAxisUnit?G2.set(b.nodeModelMatrix):P(G2,T.zScaleMatrix,b.nodeModelMatrix),P(G2,T.negCameraPosMatrix,G2),A(kI,G2),C(kI,kI);const pe="none"===y.paint.get("model-color-use-theme").constantOr("default"),_e=y.paint.get("model-emissive-strength").constantOr(0),Se={defines:[]},Fe=[],Ye=p.shadowRenderer;Ye&&(Ye.useNormalOffset=false),CBe(Se.defines,Fe,Q,p,pe?null:y.lut);let Xe=null;if(de&&(Xe=fEt(dEt,b.nodeModelMatrix,p.transform),"globe"!==q.projection.name)){const Bt=Q.aabb.min,ht=Q.aabb.max,[Tt,Lt]=de.getOpacityForBounds(Xe,Bt[0],Bt[1],ht[0],ht[1]);Se.overrideFog=Tt>=sX||Lt>=sX}const We=iz(p,y.paint.get("model-cutoff-fade-range"));We.shouldRenderCutoff&&Se.defines.push("RENDER_CUTOFF");const rt=p.getOrCreateProgram("model",Se),lt=hBe(b.worldViewProjection,G2,kI,null,p,M,ae.baseColorFactor,ie.emissiveFactor,ae.metallicFactor,ae.roughnessFactor,ie,_e,y,void 0,void 0,b.materialOverride,b.modelColor,1,rt.fixedDefines.includes("LIGHTING_3D_MODE"));p.uploadCommonUniforms(F,rt,null,Xe,We,b.lightOverrides),"shadow"!==p.renderPass&&Ye&&Ye.setupShadowsFromMatrix(b.nodeModelMatrix,rt),rt.draw(p,F.gl.TRIANGLES,G,S,R,Q.material.doubleSided?Ph.disabled:Ph.backCCW,lt,y.id,Q.vertexBuffer,Q.indexBuffer,Q.segments,y.paint,p.transform.zoom,void 0,Fe)}function hEt(b,p){return b.style._importedAsBasemap?"basemap":p.scope}function ABe(b,p,y,T,S,R,M,F,G,q,Q){const ie=b.transform,ae=!!p.isGeometryBloom&&p.isGeometryBloom;if(void 0!==p.minZoom&&b.transform.zoomp.maxZoom)return;if(ae&&"shadow"===b.renderPass)return;const de="globe"===ie.projection.name?Mle(y,ie):[...y];P(de,de,p.globalMatrix);const pe=P([],T,de);if(p.meshes)for(const _e of p.meshes){const Se=F.get(_e.material.name);if(Se&&Se.opacity<=0)continue;if("BLEND"!==_e.material.alphaMode){M.push({mesh:_e,depth:0,modelIndex:S,worldViewProjection:pe,nodeModelMatrix:de,isLightMesh:ae,materialOverride:Se,modelOpacity:G,modelColor:q,lightOverrides:Q,node:p,modelMatrix:y});continue}const Fe=it([],_e.centroid,pe);!ie.isOrthographic&&Fe[2]<=0||R.push({mesh:_e,depth:Fe[2],modelIndex:S,worldViewProjection:pe,nodeModelMatrix:de,isLightMesh:ae,materialOverride:Se,modelOpacity:G,modelColor:q,lightOverrides:Q,node:p,modelMatrix:y})}if(p.children)for(const _e of p.children)ABe(b,_e,y,T,S,R,M,F,G,q,Q)}function cX(b,p,y,T,S){const R=y.shadowRenderer;if(!R)return;const M=R.getShadowPassDepthMode(),F=S||R.calculateShadowPassMatrixFromMatrix(p),G=Z2t(F);y.getOrCreateProgram("modelDepth").draw(y,y.context.gl.TRIANGLES,M,s1.disabled,cc.disabled,Ph.disabled,G,T.id,b.vertexBuffer,b.indexBuffer,b.segments,T.paint,y.transform.zoom,void 0,void 0)}function pEt(b,p,y,T){const S=function(Q,ie){if(ie.footprintDebugMesh)return ie.footprintDebugMesh;if(!ie.footprint)return null;const ae=Q.context,de=ie.footprint.vertices,pe=ie.footprint.indices,_e=new wn;_e.reserve(de.length);for(const Lt of de)_e.emplaceBack(Lt.x,Lt.y);const Se=new po;Se.reserve(pe.length);for(let Lt=0;Lt0){const ae=R.terrain,de=ae.findDEMTileFor(F);de&&de.dem?G=tz.create(ae,F,de):ie=0}if(0===ie&&(M.terrainElevationMin=0,M.terrainElevationMax=0),ie===M.validForExaggeration&&(0===ie||G&&G._demTile&&G._demTile.tileID===M.validForDEMTile.id&&G._dem._timestamp===M.validForDEMTile.timestamp))return false;for(const ae in M.instancesPerModel){const de=M.instancesPerModel[ae];for(let pe=0;peq&&(q=de.max)}const Q=bn(T.x,R,M)-T.x,ie=bn(T.y,F,G)-T.y,ae=E(q,p.center.lat)-T.z;return p._zoomFromMercatorZ(Math.sqrt(Q*Q+ie*ie+ae*ae))}function gEt(b,p,y,T,S,R,M){const F=b.context,G="shadow"===b.renderPass,q=b.shadowRenderer,Q=G&&q?q.getShadowPassDepthMode():new Rh(F.gl.LEQUAL,Rh.ReadWrite,b.depthRangeFor3D),ie=b.isTileAffectedByFog(R),ae="globe"===b.transform.projection.name;if(y.meshes)for(const de of y.meshes){const pe=ae?[]:["MODEL_POSITION_ON_GPU"],_e=[];let Se,Fe,Ye;const Xe=!ae&&T.instancedDataArray.length>20;Xe&&pe.push("INSTANCED_ARRAYS");const We=iz(b,p.paint.get("model-cutoff-fade-range"));if(We.shouldRenderCutoff&&pe.push("RENDER_CUTOFF"),G&&q)Se=b.getOrCreateProgram("modelDepth",{defines:pe}),Fe=Z2t(M.shadowTileMatrix,M.shadowTileMatrix,y.globalMatrix),Ye=cc.disabled;else{CBe(pe,_e,de,b,"none"===p.paint.get("model-color-use-theme").constantOr("default")?null:p.lut),Se=b.getOrCreateProgram("model",{defines:pe,overrideFog:ie});const lt=de.material,Bt=lt.pbrMetallicRoughness,ht=p.paint.get("model-opacity").constantOr(1),Tt=p.paint.get("model-emissive-strength").constantOr(0);Fe=hBe(R.expandedProjMatrix,y.globalMatrix,a2r,null,b,ht,Bt.baseColorFactor,lt.emissiveFactor,Bt.metallicFactor,Bt.roughnessFactor,lt,Tt,p,S,void 0,void 0,void 0,1,Se.fixedDefines.includes("LIGHTING_3D_MODE")),q&&(M.shadowUniformsInitialized?Se.setShadowUniformValues(F,q.getShadowUniformValues()):(q.setupShadows(R.toUnwrapped(),Se,"model-tile"),M.shadowUniformsInitialized=true)),Ye=We.shouldRenderCutoff||ht<1||"OPAQUE"!==lt.alphaMode?cc.alphaBlended:cc.unblended}b.uploadCommonUniforms(F,Se,R.toUnwrapped(),null,We);const rt=de.material.doubleSided?Ph.disabled:Ph.backCCW;if(Xe)_e.push(T.instancedDataBuffer),Se.draw(b,F.gl.TRIANGLES,Q,s1.disabled,Ye,rt,Fe,p.id,de.vertexBuffer,de.indexBuffer,de.segments,p.paint,b.transform.zoom,void 0,_e,T.instancedDataArray.length);else{const lt=G?"u_instance":"u_normal_matrix";for(let Bt=0;Bt0)if(b.targetLod<0)b.targetLod=p>T?1:0;else{const M=S>0?y/1e3/S:1;b.targetLod=bn(p>T?b.targetLod+M:b.targetLod-M,0,1)}else b.targetLod=0}function h2r(b,p,y,T){if(!y.modelManager)return true;const S=y.modelManager;if(!y.shadowRenderer)return true;const R=y.shadowRenderer,M=p.aabb;let F=true,G=b.maxHeight;if(0===G){let Q=0;for(const ie in b.instancesPerModel){const ae=S.getModel(ie,T);ae?Q=Math.max(Q,Math.max(Math.max(ae.aabb.max[0],ae.aabb.max[1]),ae.aabb.max[2])):F=false}G=b.maxScale*Q*1.41+b.maxVerticalOffset,F&&(b.maxHeight=G)}M.max[2]=G,M.min[2]+=b.terrainElevationMin,M.max[2]+=b.terrainElevationMax,it(M.min,M.min,p.tileMatrix),it(M.max,M.max,p.tileMatrix);const q=M.intersects(R.getCurrentCascadeFrustum());return 0===y.currentShadowCascade&&(b.isInsideFirstShadowMapFrustum=2===q),0===q}function p2r(b,p){const y=b.uniformValues.u_cutoff_params[0],T=b.uniformValues.u_cutoff_params[1],S=b.uniformValues.u_cutoff_params[2],R=b.uniformValues.u_cutoff_params[3];return T===y||R===S?1:bn(((p-y)/(T-y)-S)/(R-S),0,1)}function m2r(b,p,y,T){if(p.pitch<20)return 1;const S=p.getWorldToCameraMatrix();P(S,S,b);const R=Qe(y.min[0],y.min[1],y.min[2],1);let M=ye(qe(),R,S),F=M,G=M;R[1]=y.max[1],M=ye(qe(),R,S),F=M[1]G[1]?M:G,R[0]=y.max[0],M=ye(qe(),R,S),F=M[1]G[1]?M:G,R[1]=y.min[1],M=ye(qe(),R,S),F=M[1]G[1]?M:G;const q=bn(T[0],0,1),Q=100*p.pixelsPerMeter*bn(T[1],0,1),ie=bn(T[2],0,1),ae=(_e=qe(),We=(Se=F)[1],rt=Se[2],lt=Se[3],_e[0]=(Xe=Se[0])+(Ye=q)*((Fe=G)[0]-Xe),_e[1]=We+Ye*(Fe[1]-We),_e[2]=rt+Ye*(Fe[2]-rt),_e[3]=lt+Ye*(Fe[3]-lt),_e),de=Math.tan(.5*p.fovX),pe=-ae[2]*de;var _e,Se,Fe,Ye,Xe,We,rt,lt;if(0===Q)return ae[1]<-Math.abs(pe)?ie:1;const Bt=bn(Si(1,ie,(-Math.abs(pe)-ae[1])/Q),ie,1);return Si(1,Bt,bn((p.pitch-20)/20,0,1))}var kBe="\n#define EPSILON 0.0000001\n#define PI 3.141592653589793\n#ifdef RENDER_CUTOFF\nfloat cutoff_opacity(vec4 cutoff_params,float depth) {float near=cutoff_params.x;float far=cutoff_params.y;float cutoffStart=cutoff_params.z;float cutoffEnd=cutoff_params.w;float linearDepth=(depth-near)/(far-near);return clamp((linearDepth-cutoffStart)/(cutoffEnd-cutoffStart),0.0,1.0);}\n#endif",yEt="\n#if defined(VIEWPORT_ORIGIN_TOP_LEFT) || defined(FLIP_Y)\n#define FLIP_VIEWPORT_UV_Y(uv) (uv).y=1.0-(uv).y\n#else\n#define FLIP_VIEWPORT_UV_Y(uv)\n#endif\n#ifdef DUAL_SOURCE_BLENDING\nlayout(location=0,index=0) out vec4 glFragColor;layout(location=0,index=1) out vec4 glFragColorSrc1;\n#elif defined(FLOAT_RENDER_TARGET)\nlayout(location=0) out highp vec4 glFragColor;\n#else\nlayout(location=0) out vec4 glFragColor;\n#endif\n#ifdef USE_MRT1\nlayout(location=1) out vec4 out_Target1;\n#endif\nhighp float unpack_depth(highp vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}highp vec4 pack_depth(highp float ndc_z) {\n#ifdef CLIP_ZERO_TO_ONE\nhighp float depth=ndc_z;\n#else\nhighp float depth=ndc_z*0.5+0.5;\n#endif\nconst highp vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const highp vec4 bit_mask =vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);highp vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;}const float DITHER_THRESHOLDS[16]=float[16](\n1.0/17.0, 9.0/17.0, 3.0/17.0,11.0/17.0,13.0/17.0, 5.0/17.0,15.0/17.0, 7.0/17.0,4.0/17.0,12.0/17.0, 2.0/17.0,10.0/17.0,16.0/17.0, 8.0/17.0,14.0/17.0, 6.0/17.0\n);int viewport_dither_index(vec2 fragCoordXY) {return (int(fragCoordXY.x) % 4)*4+(int(fragCoordXY.y) % 4);}\n#ifdef DEBUG_WIREFRAME\n#define HANDLE_WIREFRAME_DEBUG \\\nglFragColor=vec4(0.7,0.0,0.0,0.7); \\\ngl_FragDepth=gl_FragCoord.z-0.0001;\n#else\n#define HANDLE_WIREFRAME_DEBUG\n#endif\n#ifdef RENDER_CUTOFF\nuniform highp vec4 u_cutoff_params;in float v_cutoff_opacity;\n#endif\nvec4 textureLodCustom(sampler2D image,highp vec2 pos,highp vec2 lod_coord) {highp vec2 size=vec2(textureSize(image,0));highp vec2 dx=dFdx(lod_coord.xy*size);highp vec2 dy=dFdy(lod_coord.xy*size);highp float delta_max_sqr=max(dot(dx,dx),dot(dy,dy));highp float lod=0.5*log2(delta_max_sqr);return textureLod(image,pos,lod);}vec4 premultiplyColor(vec3 nonPremultipliedColor,float a) {return vec4(nonPremultipliedColor*a,a);}vec3 unpremultiplyColor(vec4 premultipliedColor) {if (premultipliedColor.a > 0.0) {return premultipliedColor.rgb/premultipliedColor.a;}return premultipliedColor.rgb;}vec3 applyLUT(highp sampler3D lut,vec3 col) {vec3 size=vec3(textureSize(lut,0));vec3 uvw=(col.rbg*float(size-1.0)+0.5)/size;return texture(lut,uvw).rgb;}vec4 applyLUT(highp sampler3D lut,vec4 premultipliedColor) {return premultiplyColor(applyLUT(lut,unpremultiplyColor(premultipliedColor)),premultipliedColor.a);}",bEt="\n#define EXTENT 8192.0\n#define RAD_TO_DEG 180.0/PI\n#define DEG_TO_RAD PI/180.0\n#define GLOBE_RADIUS EXTENT/PI/2.0\nfloat wrap(float n,float min,float max) {float d=max-min;float w=mod(mod(n-min,d)+d,d)+min;return (w==min) ? max : w;}\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 mercator_tile_position(mat4 matrix,vec2 tile_anchor,vec3 tile_id,vec2 mercator_center) {\n#ifndef PROJECTED_POS_ON_VIEWPORT\nfloat tiles=tile_id.z;vec2 mercator=(tile_anchor/EXTENT+tile_id.xy)/tiles;mercator-=mercator_center;mercator.x=wrap(mercator.x,-0.5,0.5);vec4 mercator_tile=vec4(mercator.xy*EXTENT,EXTENT/(2.0*PI),1.0);mercator_tile=matrix*mercator_tile;return mercator_tile.xyz;\n#else\nreturn vec3(0.0);\n#endif\n}vec3 mix_globe_mercator(vec3 globe,vec3 mercator,float t) {return mix(globe,mercator,t);}mat3 globe_mercator_surface_vectors(vec3 pos_normal,vec3 up_dir,float zoom_transition) {vec3 normal=zoom_transition==0.0 ? pos_normal : normalize(mix(pos_normal,up_dir,zoom_transition));vec3 xAxis=normalize(vec3(normal.z,0.0,-normal.x));vec3 yAxis=normalize(cross(normal,xAxis));return mat3(xAxis,yAxis,normal);}\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec4 decode_color(const vec2 encodedColor) {return vec4(\nunpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const vec2 units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (units_to_pixels*pos+offset)/pattern_size;}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {return get_pattern_pos(pixel_coord_upper,pixel_coord_lower,pattern_size,vec2(tile_units_to_pixels),pos);}float mercatorXfromLng(float lng) {return (180.0+lng)/360.0;}float mercatorYfromLat(float lat) {return (180.0-(RAD_TO_DEG*log(tan(PI/4.0+lat/2.0*DEG_TO_RAD))))/360.0;}vec3 latLngToECEF(vec2 latLng) {latLng=DEG_TO_RAD*latLng;float cosLat=cos(latLng[0]);float sinLat=sin(latLng[0]);float cosLng=cos(latLng[1]);float sinLng=sin(latLng[1]);float sx=cosLat*sinLng*GLOBE_RADIUS;float sy=-sinLat*GLOBE_RADIUS;float sz=cosLat*cosLng*GLOBE_RADIUS;return vec3(sx,sy,sz);}\n#ifdef RENDER_CUTOFF\nuniform vec4 u_cutoff_params;out float v_cutoff_opacity;\n#endif\nconst vec4 AWAY=vec4(-1000.0,-1000.0,-1000.0,1);const float skirtOffset=24575.0;vec3 decomposeToPosAndSkirt(ivec2 posWithComposedSkirt)\n{float skirt=float(float(posWithComposedSkirt.x) >=skirtOffset);vec2 pos=vec2(posWithComposedSkirt)-vec2(skirt*skirtOffset,0.0);return vec3(pos,skirt);}\n#ifndef HAS_SHADER_STORAGE_BLOCK_material_buffer\n#define GET_ATTRIBUTE_float(attrib,matInfo,attrib_id) attrib\n#define GET_ATTRIBUTE_vec4(attrib,matInfo,attrib_id) attrib\n#define GET_ATTRIBUTE_vec2(attrib,matInfo,attrib_id) attrib\n#define DECLARE_MATERIAL_TABLE_INFO\n#endif",xEt="in highp vec3 a_pos_3f;uniform lowp mat4 u_matrix;out highp vec3 v_uv;void main() {const mat3 half_neg_pi_around_x=mat3(1.0,0.0, 0.0,0.0,0.0,-1.0,0.0,1.0, 0.0);v_uv=half_neg_pi_around_x*a_pos_3f;vec4 pos=u_matrix*vec4(a_pos_3f,1.0);gl_Position=pos.xyww;}",vEt="\n#define ELEVATION_SCALE 7.0\n#define ELEVATION_OFFSET 450.0\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_tl_up;uniform vec3 u_tile_tr_up;uniform vec3 u_tile_br_up;uniform vec3 u_tile_bl_up;uniform float u_tile_up_scale;\n#endif\nvec3 elevationVector(vec2 pos) {\n#ifdef PROJECTION_GLOBE_VIEW\nvec2 uv=pos/EXTENT;vec3 up=normalize(mix(\nmix(u_tile_tl_up,u_tile_tr_up,uv.xxx),mix(u_tile_bl_up,u_tile_br_up,uv.xxx),uv.yyy));return up*u_tile_up_scale;\n#else\nreturn vec3(0,0,1);\n#endif\n}\n#ifdef TERRAIN\nuniform highp sampler2D u_dem;uniform highp sampler2D u_dem_prev;uniform vec2 u_dem_tl;uniform vec2 u_dem_tl_prev;uniform float u_dem_scale;uniform float u_dem_scale_prev;uniform float u_dem_size;uniform float u_dem_lerp;uniform float u_exaggeration;uniform float u_meter_to_dem;uniform mat4 u_label_plane_matrix_inv;vec4 tileUvToDemSample(vec2 uv,float dem_size,float dem_scale,vec2 dem_tl) {vec2 pos=dem_size*(uv*dem_scale+dem_tl)+1.0;vec2 f=fract(pos);return vec4((pos-f+0.5)/(dem_size+2.0),f);}float currentElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale+u_dem_tl)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture(u_dem,pos).r;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale,u_dem_tl);vec2 pos=r.xy;vec2 f=r.zw;float tl=texture(u_dem,pos).r;float tr=texture(u_dem,pos+vec2(dd,0)).r;float bl=texture(u_dem,pos+vec2(0,dd)).r;float br=texture(u_dem,pos+vec2(dd,dd)).r;return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}float prevElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale_prev+u_dem_tl_prev)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture(u_dem_prev,pos).r;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale_prev,u_dem_tl_prev);vec2 pos=r.xy;vec2 f=r.zw;float tl=texture(u_dem_prev,pos).r;float tr=texture(u_dem_prev,pos+vec2(dd,0)).r;float bl=texture(u_dem_prev,pos+vec2(0,dd)).r;float br=texture(u_dem_prev,pos+vec2(dd,dd)).r;return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}vec4 fourSample(vec2 pos,vec2 off) {float tl=texture(u_dem,pos).r;float tr=texture(u_dem,pos+vec2(off.x,0.0)).r;float bl=texture(u_dem,pos+vec2(0.0,off.y)).r;float br=texture(u_dem,pos+off).r;return vec4(tl,tr,bl,br);}float flatElevation(vec2 pack) {vec2 apos=floor(pack/8.0);vec2 span=10.0*(pack-apos*8.0);vec2 uvTex=(apos-vec2(1.0,1.0))/8190.0;float size=u_dem_size+2.0;float dd=1.0/size;vec2 pos=u_dem_size*(uvTex*u_dem_scale+u_dem_tl)+1.0;vec2 f=fract(pos);pos=(pos-f+0.5)*dd;vec4 h=fourSample(pos,vec2(dd));float z=mix(mix(h.x,h.y,f.x),mix(h.z,h.w,f.x),f.y);vec2 w=floor(0.5*(span*u_meter_to_dem-1.0));vec2 d=dd*w;h=fourSample(pos-d,2.0*d+vec2(dd));vec4 diff=abs(h.xzxy-h.ywzw);vec2 slope=min(vec2(0.25),u_meter_to_dem*0.5*(diff.xz+diff.yw)/(2.0*w+vec2(1.0)));vec2 fix=slope*span;float base=z+max(fix.x,fix.y);return u_exaggeration*base;}float elevationFromUint16(float word) {return u_exaggeration*(word/ELEVATION_SCALE-ELEVATION_OFFSET);}\n#endif\nfloat elevation(vec2 apos) {\n#ifdef TERRAIN\n#ifdef ZERO_EXAGGERATION\nreturn 0.0;\n#endif\n#ifdef TERRAIN_VERTEX_MORPHING\nfloat nextElevation=currentElevation(apos);float prevElevation=prevElevation(apos);return mix(prevElevation,nextElevation,u_dem_lerp);\n#else\nreturn currentElevation(apos);\n#endif\n#else\nreturn 0.0;\n#endif\n}\n#ifdef DEPTH_OCCLUSION\nuniform highp sampler2D u_depth;uniform highp vec2 u_depth_size_inv;uniform highp vec2 u_depth_range_unpack;uniform highp float u_occluder_half_size;uniform highp float u_occlusion_depth_offset;\n#ifdef DEPTH_D24\nfloat unpack_depth(float depth) {return depth*u_depth_range_unpack.x+u_depth_range_unpack.y;}vec4 unpack_depth4(vec4 depth) {return depth*u_depth_range_unpack.x+vec4(u_depth_range_unpack.y);}\n#else\nhighp float unpack_depth_rgba(vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}\n#endif\nbool isOccluded(vec4 frag) {vec3 coord=frag.xyz/frag.w;\n#ifdef CLIP_ZERO_TO_ONE\ncoord.z=-1.0+2.0*coord.z; \n#endif\n#ifdef DEPTH_D24\nfloat depth=unpack_depth(texture(u_depth,(coord.xy+1.0)*0.5).r);\n#else\nfloat depth=unpack_depth_rgba(texture(u_depth,(coord.xy+1.0)*0.5));\n#endif\nreturn coord.z+u_occlusion_depth_offset > depth;}highp vec4 getCornerDepths(vec2 coord) {highp vec3 df=vec3(u_occluder_half_size*u_depth_size_inv,0.0);highp vec2 uv=0.5*coord.xy+0.5;\n#ifdef DEPTH_D24\nhighp vec4 depth=vec4(\ntexture(u_depth,uv-df.xz).r,texture(u_depth,uv+df.xz).r,texture(u_depth,uv-df.zy).r,texture(u_depth,uv+df.zy).r\n);depth=unpack_depth4(depth);\n#else\nhighp vec4 depth=vec4(\nunpack_depth_rgba(texture(u_depth,uv-df.xz)),unpack_depth_rgba(texture(u_depth,uv+df.xz)),unpack_depth_rgba(texture(u_depth,uv-df.zy)),unpack_depth_rgba(texture(u_depth,uv+df.zy))\n);\n#endif\nreturn depth;}highp float occlusionFadeMultiSample(vec4 frag) {highp vec3 coord=frag.xyz/frag.w;highp vec2 uv=0.5*coord.xy+0.5;\n#ifdef CLIP_ZERO_TO_ONE\ncoord.z=-1.0+2.0*coord.z; \n#endif\nint NX=3;int NY=4;highp vec2 df=u_occluder_half_size*u_depth_size_inv;highp vec2 oneStep=2.0*u_occluder_half_size*u_depth_size_inv/vec2(NX-1,NY-1);highp float res=0.0;for (int y=0; y < NY;++y) {for (int x=0; x < NX;++x) {\n#ifdef DEPTH_D24\nhighp float depth=unpack_depth(texture(u_depth,uv-df+vec2(float(x)*oneStep.x,float(y)*oneStep.y)).r);\n#else\nhighp float depth=unpack_depth_rgba(texture(u_depth,uv-df+vec2(float(x)*oneStep.x,float(y)*oneStep.y)));\n#endif\nres+=1.0-clamp(300.0*(coord.z+u_occlusion_depth_offset-depth),0.0,1.0);}}res=clamp(2.0*res/float(NX*NY)-0.5,0.0,1.0);return res;}highp float occlusionFade(vec4 frag) {highp vec3 coord=frag.xyz/frag.w;\n#ifdef CLIP_ZERO_TO_ONE\ncoord.z=-1.0+2.0*coord.z; \n#endif\nhighp vec4 depth=getCornerDepths(coord.xy);return dot(vec4(0.25),vec4(1.0)-clamp(300.0*(vec4(coord.z+u_occlusion_depth_offset)-depth),0.0,1.0));}\n#else\nbool isOccluded(vec4 frag) { return false; }highp float occlusionFade(vec4 frag) { return 1.0; }highp float occlusionFadeMultiSample(vec4 frag) { return 1.0; }\n#endif",_Et="#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump mat4 u_fog_matrix;out vec3 v_fog_pos;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}vec3 fog_position(vec3 pos) {return (u_fog_matrix*vec4(pos,1.0)).xyz;}vec3 fog_position(vec2 pos) {return fog_position(vec3(pos,0.0));}float fog(vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));return opacity*fog_horizon_blending(pos/depth);}\n#endif",TEt="#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump vec2 u_fog_vertical_limit;uniform mediump float u_fog_temporal_offset;in vec3 v_fog_pos;uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform highp vec2 u_viewport;uniform float u_globe_transition;uniform int u_is_globe;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}float globe_glow_progress() {highp vec2 uv=gl_FragCoord.xy/u_viewport;FLIP_VIEWPORT_UV_Y(uv);highp vec3 ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float sdf=length(closest_point-u_globe_pos)/u_globe_radius;return sdf+PI*0.5;}float fog_opacity(vec3 pos) {float depth=length(pos);return fog_opacity(fog_range(depth));}vec3 fog_apply(vec3 color,vec3 pos,float opacity_limit) {float depth=length(pos);float opacity;if (u_is_globe==1) {float glow_progress=globe_glow_progress();float t=mix(glow_progress,depth,u_globe_transition);opacity=fog_opacity(fog_range(t));} else {opacity=fog_opacity(fog_range(depth));opacity*=fog_horizon_blending(pos/depth);}return mix(color,u_fog_color.rgb,min(opacity,opacity_limit));}vec3 fog_apply(vec3 color,vec3 pos) {return fog_apply(color,pos,1.0);}vec4 fog_apply_from_vert(vec4 color,float fog_opac) {float alpha=EPSILON+color.a;color.rgb=mix(color.rgb/alpha,u_fog_color.rgb,fog_opac)*alpha;return color;}vec3 fog_apply_sky_gradient(vec3 camera_ray,vec3 sky_color) {float horizon_blend=fog_horizon_blending(normalize(camera_ray));return mix(sky_color,u_fog_color.rgb,horizon_blend);}vec4 fog_apply_premultiplied(vec4 color,vec3 pos) {float alpha=EPSILON+color.a;color.rgb=fog_apply(color.rgb/alpha,pos)*alpha;return color;}vec4 fog_apply_premultiplied(vec4 color,vec3 pos,float heightMeters) {float verticalProgress=(u_fog_vertical_limit.x > 0.0 || u_fog_vertical_limit.y > 0.0) ? smoothstep(u_fog_vertical_limit.x,u_fog_vertical_limit.y,heightMeters) : 0.0;float opacityLimit=1.0-smoothstep(0.9,1.0,fog_opacity(pos));return mix(fog_apply_premultiplied(color,pos),color,min(verticalProgress,opacityLimit));}vec3 fog_dither(vec3 color) {return color;}vec4 fog_dither(vec4 color) {return vec4(fog_dither(color.rgb),color.a);}\n#endif",RBe="\n#ifdef LIGHTING_3D_MODE\nuniform mediump vec3 u_lighting_ambient_color;uniform mediump vec3 u_lighting_directional_dir;uniform mediump vec3 u_lighting_directional_color;uniform mediump vec3 u_ground_radiance;float calculate_ambient_directional_factor(vec3 normal) {float NdotL=dot(normal,u_lighting_directional_dir);const float factor_reduction_max=0.3;float dir_luminance=dot(u_lighting_directional_color,vec3(0.2126,0.7152,0.0722));float directional_factor_min=1.0-factor_reduction_max*min(dir_luminance,1.0);float ambient_directional_factor=mix(directional_factor_min,1.0,min((NdotL+1.0),1.0));const float vertical_factor_min=0.92;float vertical_factor=mix(vertical_factor_min,1.0,normal.z*0.5+0.5);return vertical_factor*ambient_directional_factor;}vec3 linearProduct(vec3 srgbIn,vec3 k) {return srgbIn*pow(k,vec3(1./2.2));}vec3 apply_lighting(vec3 color,vec3 normal,float dir_factor) {float ambient_directional_factor=calculate_ambient_directional_factor(normal);vec3 ambient_contrib=ambient_directional_factor*u_lighting_ambient_color;vec3 directional_contrib=u_lighting_directional_color*dir_factor;return linearProduct(color,ambient_contrib+directional_contrib);}vec4 apply_lighting(vec4 color,vec3 normal,float dir_factor) {return vec4(apply_lighting(color.rgb,normal,dir_factor),color.a);}vec3 apply_lighting(vec3 color,vec3 normal) {float dir_factor=max(dot(normal,u_lighting_directional_dir),0.0);return apply_lighting(color.rgb,normal,dir_factor);}vec4 apply_lighting(vec4 color,vec3 normal) {float dir_factor=max(dot(normal,u_lighting_directional_dir),0.0);return vec4(apply_lighting(color.rgb,normal,dir_factor),color.a);}vec3 apply_lighting_ground(vec3 color) {return color*u_ground_radiance;}vec4 apply_lighting_ground(vec4 color) {return vec4(apply_lighting_ground(color.rgb),color.a);}float calculate_NdotL(vec3 normal) {const float ext=0.70710678118;return (clamp(dot(normal,u_lighting_directional_dir),-ext,1.0)+ext)/(1.0+ext);}vec4 apply_lighting_with_emission_ground(vec4 color,float emissive_strength) {return mix(apply_lighting_ground(color),color,emissive_strength);}vec3 compute_flood_lighting(vec3 flood_light_color,float fully_occluded_factor,float occlusion,vec3 ground_shadow_factor) {vec3 fully_occluded_color=flood_light_color*mix(ground_shadow_factor,vec3(1.0),fully_occluded_factor);float occlusion_ramp=smoothstep(0.0,0.2,1.0-occlusion);return mix(fully_occluded_color,flood_light_color,occlusion_ramp);}vec3 compute_emissive_draped(vec3 unlit_color,float fully_occluded_factor,float occlusion,vec3 ground_shadow_factor) {vec3 fully_occluded_color=unlit_color*mix(ground_shadow_factor,vec3(1.0),fully_occluded_factor);return mix(fully_occluded_color,unlit_color,1.0-occlusion);}\n#endif",wEt="#ifdef RASTER_ARRAY\nuniform highp sampler2D u_image0;uniform sampler2D u_image1;const vec4 NODATA=vec4(1);ivec4 _raTexLinearCoord(highp vec2 texCoord,highp vec2 texResolution,out highp vec2 fxy) {texCoord=texCoord*texResolution-0.5;fxy=fract(texCoord);texCoord-=fxy;return ivec4(texCoord.xxyy+vec2(1.5,0.5).xyxy);}vec2 _raTexLinearMix(highp vec2 fxy,highp vec4 colorMix,highp float colorOffset,highp vec4 t00,highp vec4 t10,highp vec4 t01,highp vec4 t11) {vec2 c00=t00==NODATA ? vec2(0) : vec2(colorOffset+dot(t00,colorMix),1);vec2 c10=t10==NODATA ? vec2(0) : vec2(colorOffset+dot(t10,colorMix),1);vec2 c01=t01==NODATA ? vec2(0) : vec2(colorOffset+dot(t01,colorMix),1);vec2 c11=t11==NODATA ? vec2(0) : vec2(colorOffset+dot(t11,colorMix),1);return mix(mix(c01,c11,fxy.x),mix(c00,c10,fxy.x),fxy.y);}vec2 raTexture2D_image0_linear(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec2 fxy;ivec4 c=_raTexLinearCoord(texCoord,texResolution,fxy);return _raTexLinearMix(fxy,colorMix,colorOffset,texelFetch(u_image0,c.yz,0),texelFetch(u_image0,c.xz,0),texelFetch(u_image0,c.yw,0),texelFetch(u_image0,c.xw,0)\n);}vec2 raTexture2D_image1_linear(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec2 fxy;ivec4 c=_raTexLinearCoord(texCoord,texResolution,fxy);return _raTexLinearMix(fxy,colorMix,colorOffset,texelFetch(u_image1,c.yz,0),texelFetch(u_image1,c.xz,0),texelFetch(u_image1,c.yw,0),texelFetch(u_image1,c.xw,0)\n);}vec2 raTexture2D_image0_nearest(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec4 t=texelFetch(u_image0,ivec2(texCoord*texResolution),0);return t==NODATA ? vec2(0) : vec2(colorOffset+dot(t,colorMix),1);}vec2 raTexture2D_image1_nearest(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec4 t=texelFetch(u_image1,ivec2(texCoord*texResolution),0);return t==NODATA ? vec2(0) : vec2(colorOffset+dot(t,colorMix),1);}\n#endif",EEt="#ifdef RENDER_SHADOWS\nuniform mediump vec3 u_shadow_direction;uniform highp vec3 u_shadow_normal_offset;vec3 shadow_normal_offset(vec3 normal) {float tileInMeters=u_shadow_normal_offset[0];vec3 n=vec3(-normal.xy,tileInMeters*normal.z);float dotScale=min(1.0-dot(normal,u_shadow_direction),1.0)*0.5+0.5;return n*dotScale;}vec3 shadow_normal_offset_model(vec3 normal) {vec3 transformed_normal=vec3(-normal.xy,normal.z);float NDotL=dot(normalize(transformed_normal),u_shadow_direction);float dotScale=min(1.0-NDotL,1.0)*0.5+0.5;return normal*dotScale;}float shadow_normal_offset_multiplier0() {return u_shadow_normal_offset[1];}float shadow_normal_offset_multiplier1() {return u_shadow_normal_offset[2];}\n#endif",CEt="#ifdef RENDER_SHADOWS\nprecision highp sampler2DShadow;uniform sampler2DShadow u_shadowmap_0;uniform sampler2DShadow u_shadowmap_1;uniform float u_shadow_intensity;uniform float u_shadow_map_resolution;uniform float u_shadow_texel_size;uniform highp vec3 u_shadow_normal_offset;uniform vec2 u_fade_range;uniform mediump vec3 u_shadow_direction;uniform highp vec3 u_shadow_bias;highp vec2 shadow_map_ndc_to_uv(highp vec2 ndc_xy) {\n#ifdef SHADOW_MAP_FLIP_Y\nreturn ndc_xy*vec2(0.5,-0.5)+0.5;\n#else\nreturn ndc_xy*0.5+0.5;\n#endif\n}highp vec3 shadow_map_ndc_to_sample_space(highp vec3 ndc) {\n#ifdef CLIP_ZERO_TO_ONE\nreturn vec3(shadow_map_ndc_to_uv(ndc.xy),ndc.z);\n#else\nreturn vec3(shadow_map_ndc_to_uv(ndc.xy),ndc.z*0.5+0.5);\n#endif\n}float shadow_sample(sampler2DShadow shadowmap,highp vec3 pos,highp float bias) {\n#ifdef CLIP_ZERO_TO_ONE\nhighp vec3 coord=vec3(shadow_map_ndc_to_uv(pos.xy),pos.z-bias);\n#else\nhighp vec3 coord=vec3(shadow_map_ndc_to_uv(pos.xy),pos.z*0.5+0.5-bias);\n#endif\nreturn texture(shadowmap,coord);}float shadow_occlusion(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth,highp float bias) {light_view_pos0.xyz/=light_view_pos0.w;\n#ifdef SHADOWS_SINGLE_CASCADE\nvec2 abs_bounds=abs(light_view_pos0.xy);if (abs_bounds.x >=1.0 || abs_bounds.y >=1.0) {return 0.0;}return shadow_sample(u_shadowmap_0,light_view_pos0.xyz,bias);\n#else\nlight_view_pos1.xyz/=light_view_pos1.w;vec4 abs_bounds=abs(vec4(light_view_pos0.xy,light_view_pos1.xy));if (abs_bounds.x < 1.0 && abs_bounds.y < 1.0) {return shadow_sample(u_shadowmap_0,light_view_pos0.xyz,bias);}if (abs_bounds.z >=1.0 || abs_bounds.w >=1.0) {return 0.0;}float occlusion1=shadow_sample(u_shadowmap_1,light_view_pos1.xyz,bias);return clamp(mix(occlusion1,0.0,smoothstep(u_fade_range.x,u_fade_range.y,view_depth)),0.0,1.0);\n#endif\n}highp float calculate_shadow_bias(float NDotL) {\n#ifdef NORMAL_OFFSET\nreturn 0.5*u_shadow_bias.x;\n#else\nreturn 0.5*(u_shadow_bias.x+clamp(u_shadow_bias.y*tan(acos(NDotL)),0.0,u_shadow_bias.z));\n#endif\n}float shadowed_light_factor_normal(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float NDotL=dot(N,u_shadow_direction);float bias=calculate_shadow_bias(NDotL);float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}float shadowed_light_factor_normal_opacity(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth,float shadow_opacity) {float NDotL=dot(N,u_shadow_direction);float bias=calculate_shadow_bias(NDotL);float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias)*shadow_opacity;return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}float shadowed_light_factor_normal_unbiased(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float NDotL=dot(N,u_shadow_direction);float bias=0.0;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}highp vec2 compute_receiver_plane_depth_bias(highp vec3 pos_dx,highp vec3 pos_dy)\n{highp vec2 biasUV=vec2(\npos_dy.y*pos_dx.z-pos_dx.y*pos_dy.z,pos_dx.x*pos_dy.z-pos_dy.x*pos_dx.z);biasUV*=1.0/((pos_dx.x*pos_dy.y)-(pos_dx.y*pos_dy.x));return biasUV;}float shadowed_light_factor_plane_bias(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {highp vec3 light_view_pos0_xyz=shadow_map_ndc_to_sample_space(light_view_pos0.xyz/light_view_pos0.w);highp vec3 light_view_pos0_ddx=dFdx(light_view_pos0_xyz);highp vec3 light_view_pos0_ddy=dFdy(light_view_pos0_xyz);highp vec2 plane_depth_bias=compute_receiver_plane_depth_bias(light_view_pos0_ddx,light_view_pos0_ddy);highp float bias=dot(vec2(u_shadow_texel_size,u_shadow_texel_size),plane_depth_bias)+0.0001;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return 1.0-(u_shadow_intensity*occlusion);}float shadowed_light_factor(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float bias=0.0;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return 1.0-(u_shadow_intensity*occlusion);}float shadow_occlusion(float ndotl,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float bias=calculate_shadow_bias(ndotl);return shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);}\n#endif";const SEt=/^#include\s+"([^"]+)"\s*\r?\n/gm,AEt=/#pragma mapbox: ([\w\-]+) ([\w]+) ([\w]+) ([\w]+)/g,g2r=/\b[A-Za-z_][A-Za-z0-9_]*\b/g,y2r=new Set(["ifdef","ifndef","elif","if","defined"]),oce=new Set;oz(kBe,oce),oz(bEt,oce),oz(yEt,oce);const kEt={"_prelude_fog.vertex.glsl":_Et,"_prelude_terrain.vertex.glsl":vEt,"_prelude_shadow.vertex.glsl":EEt,"_prelude_material_table.vertex.glsl":"#ifdef HAS_SHADER_STORAGE_BLOCK_material_buffer\n#define MATERIAL_TABLE_DEBUG 0\nuniform int u_material_offset;uniform int u_vertex_offset;layout(std140,binding=0)readonly buffer material_buffer{uvec4 material_data[];};struct MaterialInfo{uint dataOffset;\n#if MATERIAL_TABLE_DEBUG\nvec4 colorDebug;\n#endif\n};uint read_buf_no_offset(uint iDword) {return material_data[iDword/4u][iDword % 4u];}uint read_buf(uint iDword) {iDword+=uint(u_material_offset/4);return read_buf_no_offset(iDword);}float read_buf_float(uint iDword){return uintBitsToFloat(read_buf(iDword));}uint read_buf_uint8(uint iDword,uint iUint8){uint dwordOffset=iDword+(iUint8/4u);uint byteOffset=iUint8 & 3u;uint bitOffset=8u*byteOffset;uint mask=0xffu << bitOffset;uint dwordVal=read_buf(dwordOffset);return (dwordVal & mask) >> bitOffset;}uint read_buf_uint16(uint iDword,uint iUint16){uint dwordOffset=iDword+(iUint16 >> 1u);uint bitOffset=(iUint16 & 1u)*16u;uint mask=0xffffu << bitOffset;uint dwordVal=read_buf(dwordOffset);return (dwordVal & mask) >> bitOffset;}uint nrDwordsForVertexIdEntries(uint nrMaterialLookupEntries) {return nrMaterialLookupEntries;}uint nrDwordsForMaterialIdEntries(uint nrMaterialLookupEntries) {return (nrMaterialLookupEntries*2u+3u)/4u;}uint findRangeBinarySearch(uint vertexId,uint numRanges,uint dwordOffset) {uint left=0u;uint right=numRanges-1u;for (uint i=0u; i < 16u; i++) { \nif (left > right) {break;}uint mid=(left+right)/2u;uint start=read_buf(dwordOffset+mid);uint nextStart=(mid+1u < numRanges) ? read_buf(dwordOffset+mid+1u) : 0xffffffffu;if (vertexId >=start && vertexId < nextStart) {return mid;} else if (vertexId < start) {if (mid==0u) {break;}right=mid-1u;} else {left=mid+1u;}}return 0u; \n}uint readVertexId(uint dwordOffset,uint iMaterialLookupEntry) {return read_buf(dwordOffset+iMaterialLookupEntry);}uint findRange(uint vertexId,uint numRanges,uint dwordOffset) {uint iRange;if(numRanges <=64u){uint vertexBegin;for(iRange=0u; iRange < numRanges;++iRange) {vertexBegin=readVertexId(dwordOffset,iRange);if(vertexBegin > vertexId) {break;}}iRange=iRange==0u? 0u : iRange-1u;} else { \niRange=findRangeBinarySearch(vertexId,numRanges,dwordOffset);}return iRange;}MaterialInfo read_material_info(uint vertex_id) {MaterialInfo info;\n#if MATERIAL_TABLE_DEBUG\nconst vec4 red=vec4(1.0,0.0,0.0,1.0);const vec4 orange=vec4(1.0,0.5,0.0,1.0);const vec4 yellow=vec4(1.0,1.0,0.0,1.0);const vec4 green=vec4(0.0,1.0,0.0,1.0);const vec4 indigo=vec4(0.294,0.0,0.510,1.0);const vec4 blue=vec4(0.0,0.0,1.0,1.0);const vec4 purple=vec4(0.5,0.0,0.5,1.0);const vec4 pink=vec4(1.0,0.0,1.0,1.0);info.colorDebug=green;\n#endif\nuint offset=0u;\n#if MATERIAL_TABLE_DEBUG\nbool keepFinding=true;uint magic=read_buf(offset);if(magic !=0xCAFEBABEu) {info.colorDebug=red;keepFinding=false;return info;}\n#endif\noffset++;\n#if MATERIAL_TABLE_DEBUG\nuint nrMaterials=read_buf(offset);uint nrVertices=read_buf(offset+1u);if(keepFinding && vertex_id >=nrVertices) {info.colorDebug=red;keepFinding=false;}\n#endif\noffset+=2u;uint nrMaterialLookupEntries=read_buf(offset++);uint perMaterialEntrySizeDwords=read_buf(offset++);\n#if MATERIAL_TABLE_DEBUG\nif(keepFinding && perMaterialEntrySizeDwords !=1u) {info.colorDebug=red;keepFinding=false;}\n#endif\nuint iMaterialLookup=findRange(vertex_id,nrMaterialLookupEntries,offset);\n#if MATERIAL_TABLE_DEBUG\nif(keepFinding)\n{uint vertexBeginCheck=readVertexId(offset,iMaterialLookup);if(vertexBeginCheck > vertex_id) {info.colorDebug=red;keepFinding=false;}if(iMaterialLookup < nrMaterialLookupEntries-1u) {uint vertexEndCheck=readVertexId(offset,iMaterialLookup+1u);if(vertexEndCheck <=vertex_id) {info.colorDebug=red;keepFinding=false;}}}\n#endif\noffset+=nrDwordsForVertexIdEntries(nrMaterialLookupEntries);uint materialId=iMaterialLookup;\n#if MATERIAL_TABLE_DEBUG\nif(keepFinding) {if(materialId >=nrMaterialLookupEntries) {info.colorDebug=red;}}\n#endif\ninfo.dataOffset=offset+materialId*perMaterialEntrySizeDwords;return info;}uint get_data_location(const MaterialInfo matInfo,uint attribOffsetBytes)\n{uint attribFieldOffsetDwords=attribOffsetBytes/4u;return matInfo.dataOffset+attribFieldOffsetDwords;}vec4 read_material_vec4(const MaterialInfo matInfo,uint attribOffsetBytes){uint loc=get_data_location(matInfo,attribOffsetBytes);return vec4(read_buf_float(loc),read_buf_float(loc+1u),read_buf_float(loc+2u),read_buf_float(loc+3u));}vec2 read_material_vec2(const MaterialInfo matInfo,uint attribOffsetBytes){uint loc=get_data_location(matInfo,attribOffsetBytes);return vec2(read_buf_float(loc),read_buf_float(loc+1u));}float read_material_float(const MaterialInfo matInfo,uint attribOffsetBytes){uint loc=get_data_location(matInfo,attribOffsetBytes);return read_buf_float(loc);}\n#define GET_ATTRIBUTE_float(attrib,matInfo,attrib_offset) read_material_float(matInfo,attrib_offset)\n#define GET_ATTRIBUTE_vec4(attrib,matInfo,attrib_offset) read_material_vec4(matInfo,attrib_offset)\n#define GET_ATTRIBUTE_vec2(attrib,matInfo,attrib_offset) read_material_vec2(matInfo,attrib_offset)\n#define DECLARE_MATERIAL_TABLE_INFO MaterialInfo materialInfo=read_material_info(uint(gl_VertexID));\n#define DECLARE_MATERIAL_TABLE_INFO_DEBUG(dbgColor) MaterialInfo materialInfo=read_material_info(uint(gl_VertexID)); dbgColor=materialInfo.colorDebug;\n#endif","_prelude_fog.fragment.glsl":TEt,"_prelude_shadow.fragment.glsl":CEt,"_prelude_lighting.glsl":RBe,"_prelude_raster_array.glsl":wEt,"_prelude_indicator_cutout.fragment.glsl":"\n#ifdef INDICATOR_CUTOUT\nuniform vec3 u_indicator_cutout_centers;uniform vec4 u_indicator_cutout_params;\n#endif\nvec4 applyCutout(vec4 color,float height) {\n#ifdef INDICATOR_CUTOUT\nfloat verticalFadeRange=u_indicator_cutout_centers.z*0.25;float holeMinOpacity=mix(1.0,u_indicator_cutout_params.x,smoothstep(u_indicator_cutout_centers.z,u_indicator_cutout_centers.z+verticalFadeRange,height));float holeRadius=max(u_indicator_cutout_params.y,0.0);float holeAspectRatio=u_indicator_cutout_params.z;float fadeStart=u_indicator_cutout_params.w;float distA=distance(vec2(gl_FragCoord.x,gl_FragCoord.y*holeAspectRatio),vec2(u_indicator_cutout_centers[0],u_indicator_cutout_centers[1]*holeAspectRatio));return color*min(smoothstep(fadeStart,holeRadius,distA)+holeMinOpacity,1.0);\n#else\nreturn color;\n#endif\n}float cutoutGroundRoofOpacity(vec4 groundRoof) {\n#ifdef INDICATOR_CUTOUT\nfloat fadeStartX=u_indicator_cutout_params.w;float holeRadius=u_indicator_cutout_params.y;float holeMinOpacity=mix(u_indicator_cutout_params.x,1.0,smoothstep(u_indicator_cutout_params.z,u_indicator_cutout_centers.z,groundRoof.y));float distX=abs(u_indicator_cutout_centers.x-groundRoof.x);float roofOpacity=mix(holeMinOpacity,1.0,smoothstep(fadeStartX,holeRadius,u_indicator_cutout_centers.y-groundRoof.w));float groundOpacity=min(smoothstep(fadeStartX,holeRadius,distX)+holeMinOpacity,1.0);return max(roofOpacity,groundOpacity);\n#else\nreturn 1.0;\n#endif\n}","_prelude_feature_cutout.fragment.glsl":"// feature cutout (gl-native only)\n","_prelude_feature_cutout.vertex.glsl":"// feature cutout (gl-native only)\n"},ace={},REt="precision highp float;",PEt="precision mediump float;",IEt="\n#if defined(GL_EXT_blend_func_extended) && defined(DUAL_SOURCE_BLENDING)\n#extension GL_EXT_blend_func_extended : require\n#endif",MEt={preludeTerrain:Cs("",vEt),preludeFog:Cs(TEt,_Et),preludeShadow:Cs(CEt,EEt),preludeRasterArray:Cs(wEt,""),preludeLighting:Cs(RBe,RBe),preludePrecisionQualifiers:Cs(PEt,REt),prelude:Cs(yEt,bEt),preludeExtensions:Cs(IEt,"")},b2r=[IEt,PEt,kBe,MEt.prelude.fragmentSource].join("\n"),x2r=[REt,kBe,MEt.prelude.vertexSource].join("\n");var v2r={background:Cs('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_feature_cutout.fragment.glsl"\nuniform vec4 u_color;uniform float u_opacity;uniform mediump float u_emissive_strength;\n#ifdef LIGHTING_3D_MODE\nin vec4 v_color;\n#endif\nvoid main() {vec4 out_color;\n#ifdef FEATURE_CUTOUT\nvec2 uv=fragcoord_to_viewport_uv(gl_FragCoord.xy,u_inv_viewport_size.xy);float factorTex=min(texture(u_cutout_factor_image,uv).r,1.0);float cutoutFactor=(1.0-u_feature_cutout_params.x)*factorTex;out_color=u_color*(1.0-cutoutFactor);\n#else\n#ifdef LIGHTING_3D_MODE\nout_color=v_color;\n#else\nout_color=u_color;\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\n#endif\nglFragColor=out_color*u_opacity;\n#ifdef USE_MRT1\nout_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_lighting.glsl"\nin ivec2 a_pos;uniform mat4 u_matrix;uniform mediump float u_emissive_strength;\n#ifdef LIGHTING_3D_MODE\nuniform mediump vec4 u_color;out vec4 v_color;\n#endif\nvoid main() {gl_Position=u_matrix*vec4(a_pos,0,1);\n#ifndef FEATURE_CUTOUT\n#ifdef LIGHTING_3D_MODE\nv_color=apply_lighting_with_emission_ground(u_color,u_emissive_strength);\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(vec2(a_pos));\n#endif\n#endif\n}'),backgroundPattern:Cs('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec2 u_pattern_tl;uniform vec2 u_pattern_br;uniform vec2 u_texsize;uniform float u_opacity;uniform float u_emissive_strength;uniform sampler2D u_image;in highp vec2 v_pos;void main() {highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(u_pattern_tl/u_texsize,u_pattern_br/u_texsize,imagecoord);vec4 out_color=textureLodCustom(u_image,pos,v_pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*u_opacity;\n#ifdef USE_MRT1\nout_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform vec2 u_pattern_size;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec2 u_pattern_units_to_pixels;in ivec2 a_pos;out highp vec2 v_pos;void main() {vec2 pos=vec2(a_pos);gl_Position=u_matrix*vec4(pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_pattern_size,u_pattern_units_to_pixels,pos);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}'),circle:Cs('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nin vec3 v_data;in float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nuniform float u_emissive_strength;void main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float blur_positive=blur < 0.0 ? 0.0 : 1.0;lowp float antialiasblur=v_data.z;float extrude_length=length(extrude)+antialiasblur*(1.0-blur_positive);float antialiased_blur=-max(abs(blur),antialiasblur);float antialiase_blur_opacity=smoothstep(0.0,antialiasblur,extrude_length-1.0);float opacity_t=blur_positive==1.0 ? \nsmoothstep(0.0,-antialiased_blur,1.0-extrude_length) : \nsmoothstep(antialiased_blur,0.0,extrude_length-1.0)-antialiase_blur_opacity;float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(\nantialiased_blur,0.0,extrude_length-radius/(radius+stroke_width)\n);vec4 out_color=mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_apply_premultiplied(out_color,v_fog_pos);\n#endif\nglFragColor=out_color*(v_visibility*opacity_t);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#define NUM_VISIBILITY_RINGS 2\n#define INV_SQRT2 0.70710678\n#define ELEVATION_BIAS 0.0001\n#define NUM_SAMPLES_PER_RING 16\nuniform mat4 u_matrix;uniform mat2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;in ivec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin ivec4 a_pos_3;in ivec4 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\n#ifdef ELEVATED_ROADS\nin float a_circle_z_offset;\n#endif\nout vec3 v_data;out float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvec2 calc_offset(vec2 extrusion,float radius,float stroke_width, float view_scale) {return extrusion*(radius+stroke_width)*u_extrude_scale*view_scale;}float cantilevered_elevation(vec2 pos,float radius,float stroke_width,float view_scale) {vec2 c1=pos+calc_offset(vec2(-1.0,-1.0),radius,stroke_width,view_scale);vec2 c2=pos+calc_offset(vec2(1.0,-1.0),radius,stroke_width,view_scale);vec2 c3=pos+calc_offset(vec2(1.0,1.0),radius,stroke_width,view_scale);vec2 c4=pos+calc_offset(vec2(-1.0,1.0),radius,stroke_width,view_scale);float h1=elevation(c1)+ELEVATION_BIAS;float h2=elevation(c2)+ELEVATION_BIAS;float h3=elevation(c3)+ELEVATION_BIAS;float h4=elevation(c4)+ELEVATION_BIAS;return max(h4,max(h3,max(h1,h2)));}float circle_elevation(vec2 pos) {\n#if defined(TERRAIN)\nreturn elevation(pos)+ELEVATION_BIAS;\n#else\nreturn 0.0;\n#endif\n}vec4 project_vertex(vec2 extrusion,vec4 world_center,vec4 projected_center,float radius,float stroke_width, float view_scale,mat3 surface_vectors) {vec2 sample_offset=calc_offset(extrusion,radius,stroke_width,view_scale);\n#ifdef PITCH_WITH_MAP\n#ifdef PROJECTION_GLOBE_VIEW\nreturn u_matrix*( world_center+vec4(sample_offset.x*surface_vectors[0]+sample_offset.y*surface_vectors[1],0) );\n#else\nreturn u_matrix*( world_center+vec4(sample_offset,0,0) );\n#endif\n#else\nreturn projected_center+vec4(sample_offset,0,0);\n#endif\n}float get_sample_step() {\n#ifdef PITCH_WITH_MAP\nreturn 2.0*PI/float(NUM_SAMPLES_PER_RING);\n#else\nreturn PI/float(NUM_SAMPLES_PER_RING);\n#endif\n}void main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 pos2=vec2(a_pos);vec2 extrude=vec2(mod(pos2,2.0)*2.0-1.0);vec2 circle_center=floor(pos2*0.5);float height=circle_elevation(circle_center);vec4 world_center;mat3 surface_vectors;\n#ifdef PROJECTION_GLOBE_VIEW\nsurface_vectors=globe_mercator_surface_vectors(vec3(a_pos_normal_3)/16384.0,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(circle_center)*height;vec3 globe_pos=vec3(a_pos_3)+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*height;vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,circle_center,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;vec3 pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);world_center=vec4(pos,1);\n#else \nsurface_vectors=mat3(1.0);world_center=vec4(circle_center,height,1);\n#endif\n#ifdef ELEVATED_ROADS\nworld_center.z+=a_circle_z_offset+ELEVATION_BIAS;\n#endif\nvec4 projected_center=u_matrix*world_center;float view_scale=0.0;\n#ifdef PITCH_WITH_MAP\n#ifdef SCALE_WITH_MAP\nview_scale=1.0;\n#else\nview_scale=projected_center.w/u_camera_to_center_distance;\n#endif\n#else\n#ifdef SCALE_WITH_MAP\nview_scale=u_camera_to_center_distance;\n#else\nview_scale=projected_center.w;\n#endif\n#endif\ngl_Position=project_vertex(extrude,world_center,projected_center,radius,stroke_width,view_scale,surface_vectors);float visibility=0.0;\n#ifdef TERRAIN\nfloat step=get_sample_step();vec4 occlusion_world_center;vec4 occlusion_projected_center;\n#ifdef PITCH_WITH_MAP\nfloat cantilevered_height=cantilevered_elevation(circle_center,radius,stroke_width,view_scale);occlusion_world_center=vec4(circle_center,cantilevered_height,1);occlusion_projected_center=u_matrix*occlusion_world_center;\n#else\nocclusion_world_center=world_center;occlusion_projected_center=projected_center;\n#endif\nfor(int ring=0; ring < NUM_VISIBILITY_RINGS; ring++) {float scale=(float(ring)+1.0)/float(NUM_VISIBILITY_RINGS);for(int i=0; i < NUM_SAMPLES_PER_RING; i++) {vec2 extrusion=vec2(cos(step*float(i)),-sin(step*float(i)))*scale;vec4 frag_pos=project_vertex(extrusion,occlusion_world_center,occlusion_projected_center,radius,stroke_width,view_scale,surface_vectors);visibility+=float(!isOccluded(frag_pos));}}visibility/=float(NUM_VISIBILITY_RINGS)*float(NUM_SAMPLES_PER_RING);\n#else\nvisibility=1.0;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nvisibility=1.0;\n#endif\nv_visibility=visibility;lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);\n#ifdef FOG\nv_fog_pos=fog_position(world_center.xyz);\n#endif\n}'),clippingMask:Cs("void main() {glFragColor=vec4(1.0);}","in ivec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:Cs('#include "_prelude_fog.fragment.glsl"\nuniform highp float u_intensity;in vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);glFragColor=vec4(val,1.0,1.0,1.0);\n#ifdef FOG\nif (u_is_globe==0) {glFragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_intensity;in ivec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin ivec4 a_pos_3;in ivec4 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\nout vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(vec2(a_pos),2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec2 tilePos=floor(vec2(a_pos)*0.5);vec3 pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 pos_normal_3=vec3(a_pos_normal_3)/16384.0;mat3 surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(tilePos)*elevation(tilePos);vec3 globe_pos=vec3(a_pos_3)+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*elevation(tilePos);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,tilePos,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#else\npos=vec3(tilePos+extrude,elevation(tilePos));\n#endif\ngl_Position=u_matrix*vec4(pos,1);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}'),heatmapTexture:Cs("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;in vec2 v_pos;void main() {float t=texture(u_image,v_pos).r;vec4 color=texture(u_color_ramp,vec2(t,0.5));glFragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(0.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}","in ivec2 a_pos;out vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=vec2(a_pos)*0.5+0.5;}"),collisionBox:Cs("in float v_placed;in float v_notUsed;void main() {vec4 red =vec4(1.0,0.0,0.0,1.0);vec4 blue=vec4(0.0,0.0,1.0,0.5);glFragColor =mix(red,blue,step(0.5,v_placed))*0.5;glFragColor*=mix(1.0,0.1,step(0.5,v_notUsed));}",'#include "_prelude_terrain.vertex.glsl"\nin ivec4 a_pos;in ivec2 a_anchor_pos;in ivec2 a_extrude;in uvec2 a_placed;in vec2 a_shift;in vec2 a_elevation_from_sea;in float a_size_scale;in vec2 a_padding;in float a_auto_z_offset;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform float u_zoom_transition;\n#endif\nout float v_placed;out float v_notUsed;void main() {vec2 anchor_pos=vec2(a_anchor_pos);float feature_elevation=a_elevation_from_sea.x+a_auto_z_offset;float terrain_elevation=(a_elevation_from_sea.y==1.0 ? 0.0 : elevation(anchor_pos));vec3 proj_pos=vec3(a_pos)+elevationVector(anchor_pos)*(feature_elevation+terrain_elevation);\n#ifdef PROJECTION_GLOBE_VIEW\n#ifndef PROJECTED_POS_ON_VIEWPORT\nvec3 globe_pos=proj_pos;vec3 mercator_pos=mercator_tile_position(u_inv_rot_matrix,anchor_pos,u_tile_id,u_merc_center);proj_pos=mix_globe_mercator(globe_pos,mercator_pos,u_zoom_transition);\n#endif\n#endif\nvec4 projectedPoint=u_matrix*vec4(proj_pos,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,1.5);gl_Position=projectedPoint;gl_Position.xy+=(vec2(a_extrude)*a_size_scale+a_shift+a_padding)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=float(a_placed.x);v_notUsed=float(a_placed.y);}'),collisionCircle:Cs("in float v_radius;in vec2 v_extrude;in float v_perspective_ratio;in float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);glFragColor=color*alpha*opacity_t;}","in vec2 a_pos_2f;in float a_radius;in ivec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;out float v_radius;out vec2 v_extrude;out float v_perspective_ratio;out float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos_2f;float radius=a_radius;int vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(\nmix(-1.0,1.0,float(vertexIdx >=2)),mix(-1.0,1.0,float(vertexIdx >=1 && vertexIdx <=2)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=float(a_flags.x);gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:Cs("uniform highp vec4 u_color;uniform sampler2D u_overlay;in vec2 v_uv;void main() {vec4 overlay_color=texture(u_overlay,v_uv);glFragColor=mix(u_color,overlay_color,overlay_color.a);}",'#include "_prelude_terrain.vertex.glsl"\nin ivec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin ivec4 a_pos_3;\n#endif\nout vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {vec2 pos=vec2(a_pos);float h=elevation(pos);v_uv=pos/8192.0;\n#ifdef PROJECTION_GLOBE_VIEW\ngl_Position=u_matrix*vec4(vec3(a_pos_3)+elevationVector(pos)*h,1);\n#else\ngl_Position=u_matrix*vec4(pos*u_overlay_scale,h,1);\n#endif\n}'),fill:Cs('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_indicator_cutout.fragment.glsl"\n#include "_prelude_feature_cutout.fragment.glsl"\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nuniform float u_emissive_strength;uniform lowp float u_opacity_multiplier;\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\n#ifdef ELEVATED_ROADS\nin highp float v_road_z_offset;\n#endif\n#ifdef INDICATOR_CUTOUT\nin highp float v_z_offset;\n#endif\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\nvec2 cutout_factors=vec2(0.0);\n#ifdef FEATURE_CUTOUT\ncutout_factors=get_cutout_factors(gl_FragCoord);\n#endif\nvec4 out_color=color;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);light=mix(light,1.0,cutout_factors.y);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nout_color*=(opacity*u_opacity_multiplier);\n#ifdef INDICATOR_CUTOUT\nif (v_z_offset >=0.0) {out_color=applyCutout(out_color,v_z_offset);}\n#endif\n#ifdef FEATURE_CUTOUT\nfloat z=0.0;\n#ifdef ELEVATED_ROADS\nz=v_road_z_offset;\n#endif\nout_color=apply_feature_cutout(out_color,gl_FragCoord,cutout_factors.x,z);\n#endif\nglFragColor=out_color;\n#ifdef USE_MRT1\nout_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nin ivec2 a_pos;\n#ifdef ELEVATED_ROADS\nin float a_road_z_offset;out highp float v_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\n#ifdef INDICATOR_CUTOUT\nout highp float v_z_offset;\n#endif\nuniform mat4 u_matrix;uniform lowp float u_opacity_multiplier;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp float z_offset\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp float z_offset\n#ifdef ELEVATED_ROADS\nz_offset+=a_road_z_offset;v_road_z_offset=z_offset;\n#endif\nfloat hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden);\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset);\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(vec2(a_pos));\n#endif\n#ifdef INDICATOR_CUTOUT\nv_z_offset=z_offset;\n#endif\n}'),fillOutline:Cs('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_feature_cutout.fragment.glsl"\nin highp vec2 v_pos;uniform float u_emissive_strength;uniform lowp float u_opacity_multiplier;\n#ifdef ELEVATED_ROADS\nin highp float v_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=outline_color;vec2 cutout_factors=vec2(0.0);\n#ifdef FEATURE_CUTOUT\ncutout_factors=get_cutout_factors(gl_FragCoord);\n#endif\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);light=mix(light,1.0,cutout_factors.y);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\n#ifdef FEATURE_CUTOUT\nfloat z=0.0;\n#ifdef ELEVATED_ROADS\nz=v_road_z_offset;\n#endif\nout_color=apply_feature_cutout(out_color,gl_FragCoord,cutout_factors.x,z);\n#endif\nglFragColor=out_color*(alpha*opacity*u_opacity_multiplier);\n#ifdef USE_MRT1\nout_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nin ivec2 a_pos;\n#ifdef ELEVATED_ROADS\nin float a_road_z_offset;out highp float v_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\nuniform mat4 u_matrix;uniform vec2 u_world;uniform lowp float u_opacity_multiplier;out highp vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp float z_offset\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp float z_offset\n#ifdef ELEVATED_ROADS\nz_offset+=a_road_z_offset;v_road_z_offset=z_offset;\n#endif\nfloat hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden);\n#ifdef FLIP_Y\nv_pos=(vec2(gl_Position.x,-gl_Position.y)/gl_Position.w+1.0)/2.0*u_world;\n#else\nv_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#endif\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset);\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(vec2(a_pos));\n#endif\n}'),fillOutlinePattern:Cs('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_feature_cutout.fragment.glsl"\nuniform vec2 u_texsize;uniform sampler2D u_image;\n#ifdef FILL_PATTERN_TRANSITION\nuniform float u_pattern_transition;\n#endif\nuniform float u_emissive_strength;uniform lowp float u_opacity_multiplier;\n#ifdef APPLY_LUT_ON_GPU\nuniform highp sampler3D u_lutTexture;\n#endif\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\n#ifdef ELEVATED_ROADS\nin highp float v_road_z_offset;\n#endif\nin highp vec2 v_pos;in highp vec2 v_pos_world;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp uvec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: define mediump uvec4 pattern_b\n#endif\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump uvec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump uvec4 pattern_b\n#endif\nvec2 pattern_tl=vec2(pattern.xy);vec2 pattern_br=vec2(pattern.zw);highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);highp vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);float dist=length(v_pos_world-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef APPLY_LUT_ON_GPU\nout_color=applyLUT(u_lutTexture,out_color);\n#endif\n#ifdef FILL_PATTERN_TRANSITION\nvec2 pattern_b_tl=vec2(pattern_b.xy);vec2 pattern_b_br=vec2(pattern_b.zw);highp vec2 pos_b=mix(pattern_b_tl/u_texsize,pattern_b_br/u_texsize,imagecoord);vec4 color_b=textureLodCustom(u_image,pos_b,lod_pos);out_color=out_color*(1.0-u_pattern_transition)+color_b*u_pattern_transition;\n#endif\nvec2 cutout_factors=vec2(0.0);\n#ifdef FEATURE_CUTOUT\ncutout_factors=get_cutout_factors(gl_FragCoord);\n#endif\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);light=mix(light,1.0,cutout_factors.y);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#ifdef FEATURE_CUTOUT\nfloat z=0.0;\n#ifdef ELEVATED_ROADS\nz=v_road_z_offset;\n#endif\nout_color=apply_feature_cutout(out_color,gl_FragCoord,cutout_factors.x,z);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*(alpha*opacity*u_opacity_multiplier);\n#ifdef USE_MRT1\nout_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nuniform mat4 u_matrix;uniform vec2 u_world;uniform lowp float u_opacity_multiplier;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;in ivec2 a_pos;\n#ifdef ELEVATED_ROADS\nin float a_road_z_offset;out highp float v_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\nout highp vec2 v_pos;out highp vec2 v_pos_world;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp uvec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: define mediump uvec4 pattern_b\n#endif\n#pragma mapbox: define lowp float pixel_ratio\n#pragma mapbox: define highp float z_offset\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump uvec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump uvec4 pattern_b\n#endif\n#pragma mapbox: initialize lowp float pixel_ratio\n#pragma mapbox: initialize highp float z_offset\nvec2 pattern_tl=vec2(pattern.xy);vec2 pattern_br=vec2(pattern.zw);\n#ifdef ELEVATED_ROADS\nz_offset+=a_road_z_offset;v_road_z_offset=z_offset;\n#endif\nfloat hidden=float(opacity==0.0);vec2 pos=vec2(a_pos);gl_Position=mix(u_matrix*vec4(pos,z_offset,1),AWAY,hidden);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,pos);\n#ifdef FLIP_Y\nv_pos_world=(vec2(gl_Position.x,-gl_Position.y)/gl_Position.w+1.0)/2.0*u_world;\n#else\nv_pos_world=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#endif\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=vec3(pos,z_offset);vec3 shd_pos1=vec3(pos,z_offset);\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}'),fillPattern:Cs('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_feature_cutout.fragment.glsl"\nuniform vec2 u_texsize;uniform sampler2D u_image;\n#ifdef FILL_PATTERN_TRANSITION\nuniform float u_pattern_transition;\n#endif\nin highp vec2 v_pos;uniform float u_emissive_strength;uniform lowp float u_opacity_multiplier;\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\n#ifdef ELEVATED_ROADS\nin highp float v_road_z_offset;\n#endif\n#ifdef APPLY_LUT_ON_GPU\nuniform highp sampler3D u_lutTexture;\n#endif\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp uvec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: define mediump uvec4 pattern_b\n#endif\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump uvec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump uvec4 pattern_b\n#endif\nvec2 pattern_tl=vec2(pattern.xy);vec2 pattern_br=vec2(pattern.zw);highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);highp vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);vec4 out_color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef APPLY_LUT_ON_GPU\nout_color=applyLUT(u_lutTexture,out_color);\n#endif\n#ifdef FILL_PATTERN_TRANSITION\nvec2 pattern_b_tl=vec2(pattern_b.xy);vec2 pattern_b_br=vec2(pattern_b.zw);highp vec2 pos_b=mix(pattern_b_tl/u_texsize,pattern_b_br/u_texsize,imagecoord);vec4 color_b=textureLodCustom(u_image,pos_b,lod_pos);out_color=out_color*(1.0-u_pattern_transition)+color_b*u_pattern_transition;\n#endif\nvec2 cutout_factors=vec2(0.0);\n#ifdef FEATURE_CUTOUT\ncutout_factors=get_cutout_factors(gl_FragCoord);\n#endif\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);light=mix(light,1.0,cutout_factors.y);\n#ifdef ELEVATED_ROADS\nout_color.rgb*=mix(v_road_z_offset !=0.0 ? u_ground_shadow_factor : vec3(1.0),vec3(1.0),light);\n#else\nout_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#endif\n#ifdef FEATURE_CUTOUT\nfloat z=0.0;\n#ifdef ELEVATED_ROADS\nz=v_road_z_offset;\n#endif\nout_color=apply_feature_cutout(out_color,gl_FragCoord,cutout_factors.x,z);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*(opacity*u_opacity_multiplier);\n#ifdef USE_MRT1\nout_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nuniform mat4 u_matrix;uniform lowp float u_opacity_multiplier;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;in ivec2 a_pos;\n#ifdef ELEVATED_ROADS\nin float a_road_z_offset;out highp float v_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\nout highp vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp uvec4 pattern\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: define mediump uvec4 pattern_b\n#endif\n#pragma mapbox: define lowp float pixel_ratio\n#pragma mapbox: define highp float z_offset\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump uvec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\n#pragma mapbox: initialize highp float z_offset\n#ifdef FILL_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump uvec4 pattern_b\n#endif\nvec2 pattern_tl=vec2(pattern.xy);vec2 pattern_br=vec2(pattern.zw);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;\n#ifdef ELEVATED_ROADS\nz_offset+=a_road_z_offset;v_road_z_offset=z_offset;\n#endif\nfloat hidden=float(opacity==0.0);vec2 pos=vec2(a_pos);gl_Position=mix(u_matrix*vec4(pos,z_offset,1),AWAY,hidden);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,pos);\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=vec3(pos,z_offset);vec3 shd_pos1=vec3(pos,z_offset);\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}'),lineBlendComposite:Cs("uniform highp sampler2D u_image;uniform float u_opacity;uniform int u_blend_mode;uniform highp float u_max_density;in vec2 v_pos;\n#define ADDITIVE 1\nvoid main() {vec4 color=texture(u_image,v_pos);if (u_blend_mode==ADDITIVE) {if (color.a <=0.0) {discard;}highp float density=color.a;vec3 avgColor=color.rgb/max(density,0.001);highp float n=density/max(u_max_density,0.001);highp float t=sqrt(n/(n+1.0));glFragColor=vec4(avgColor*t,t);} else {vec3 multiplyFactor=color.rgb*u_opacity+(1.0-u_opacity);glFragColor=vec4(multiplyFactor,1.0);}\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(0.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}","in ivec2 a_pos;out vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=vec2(a_pos)*0.5+0.5;}"),lineBlendReduce:Cs("uniform highp sampler2D u_image;uniform vec2 u_texel_size;uniform bool u_first_pass;in vec2 v_pos;void main() {vec2 o=u_texel_size*0.5;vec4 s0=texture(u_image,v_pos+vec2(-o.x,-o.y));vec4 s1=texture(u_image,v_pos+vec2( o.x,-o.y));vec4 s2=texture(u_image,v_pos+vec2(-o.x, o.y));vec4 s3=texture(u_image,v_pos+vec2( o.x, o.y));float r0; float g0;float r1; float g1;float r2; float g2;float r3; float g3;if (u_first_pass) {float a0=s0.a;float a1=s1.a;float a2=s2.a;float a3=s3.a;r0=a0; g0=a0 > 0.0 ? 1.0 : 0.0;r1=a1; g1=a1 > 0.0 ? 1.0 : 0.0;r2=a2; g2=a2 > 0.0 ? 1.0 : 0.0;r3=a3; g3=a3 > 0.0 ? 1.0 : 0.0;} else {r0=s0.r; g0=s0.g;r1=s1.r; g1=s1.g;r2=s2.r; g2=s2.g;r3=s3.r; g3=s3.g;}glFragColor=vec4((r0+r1+r2+r3)*0.25,(g0+g1+g2+g3)*0.25,0.0,0.0);}","in ivec2 a_pos;out vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=vec2(a_pos)*0.5+0.5;}"),fillExtrusion:Cs('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_indicator_cutout.fragment.glsl"\n#include "_prelude_feature_cutout.fragment.glsl"\nin vec4 v_color;in vec4 v_flat;\n#ifdef RENDER_SHADOWS\nin highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;\n#endif\nuniform lowp float u_opacity;\n#ifdef RENDER_FRONT_CUTOFF\nin float v_front_cutoff_opacity;\n#endif\n#ifdef INDICATOR_CUTOUT\n#ifdef FEATURE_CUTOUT\nin vec4 v_ground_roof;\n#endif\n#endif\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;in vec2 v_ao;\n#endif\n#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE)\nin vec4 v_roof_color;\n#endif\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nin highp vec3 v_normal;\n#endif\nuniform vec3 u_flood_light_color;uniform highp float u_vertical_scale;uniform float u_flood_light_intensity;uniform vec3 u_ground_shadow_factor;\n#if defined(LIGHTING_3D_MODE) && defined(FLOOD_LIGHT)\nin float v_flood_radius;in float v_has_floodlight;\n#endif\nin float v_height;\n#pragma mapbox: define highp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize highp float emissive_strength\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nvec3 normal=normalize(v_normal);\n#endif\nfloat z;vec4 color=v_color;\n#ifdef ZERO_ROOF_RADIUS\nz=float(normal.z > 0.00001);\n#ifdef LIGHTING_3D_MODE\nnormal=mix(normal,vec3(0.0,0.0,1.0),z);\n#else\ncolor=mix(v_color,v_roof_color,z);\n#endif\n#endif\nfloat h=max(0.0,v_height);float ao_shade=1.0;\n#ifdef FAUX_AO\nfloat intensity=u_ao[0];float h_floors=h/(u_ao[1]*u_vertical_scale);float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);ao_shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;\n#ifdef ZERO_ROOF_RADIUS\nconcave*=(1.0-z);\n#endif\nfloat x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);ao_shade*=mix(1.0,x_shade*x_shade*x_shade,concave);\n#ifdef LIGHTING_3D_MODE\n#ifdef FLOOD_LIGHT\ncolor.rgb*=mix(ao_shade,1.0,v_has_floodlight);\n#else\ncolor.rgb*=ao_shade;\n#endif\n#else\ncolor.rgb*=ao_shade;\n#endif\n#endif\n#ifdef LIGHTING_3D_MODE\nfloat flood_radiance=0.0;\n#ifdef FLOOD_LIGHT\nflood_radiance=(1.0-min(h/v_flood_radius,1.0))*u_flood_light_intensity*v_has_floodlight;\n#endif\n#ifdef RENDER_SHADOWS\n#ifdef FLOOD_LIGHT\nfloat ndotl_unclamped=dot(normal,u_shadow_direction);float ndotl=max(0.0,ndotl_unclamped);float occlusion=ndotl_unclamped < 0.0 ? 1.0 : shadow_occlusion(ndotl,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);vec3 litColor=apply_lighting(color.rgb,normal,(1.0-u_shadow_intensity*occlusion)*ndotl);vec3 floodLitColor=compute_flood_lighting(u_flood_light_color*u_opacity,1.0-u_shadow_intensity,occlusion,u_ground_shadow_factor);color.rgb=mix(litColor,floodLitColor,flood_radiance);\n#else\nfloat shadowed_lighting_factor;\n#ifdef RENDER_CUTOFF\nshadowed_lighting_factor=shadowed_light_factor_normal_opacity(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w,v_cutoff_opacity);if (v_cutoff_opacity==0.0) {discard;}\n#else\nshadowed_lighting_factor=shadowed_light_factor_normal(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);\n#endif\ncolor.rgb=apply_lighting(color.rgb,normal,shadowed_lighting_factor);\n#endif\n#else\ncolor.rgb=apply_lighting(color.rgb,normal);\n#ifdef FLOOD_LIGHT\ncolor.rgb=mix(color.rgb,u_flood_light_color*u_opacity,flood_radiance);\n#endif\n#endif\ncolor.rgb=mix(color.rgb,v_flat.rgb,emissive_strength);color*=u_opacity;\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos,h));\n#endif\n#ifdef INDICATOR_CUTOUT\n#ifdef FEATURE_CUTOUT\n{float ditherOpacity=cutoutGroundRoofOpacity(v_ground_roof);if (ditherOpacity < 1.0) {int index=viewport_dither_index(gl_FragCoord.xy);if (ditherOpacity < DITHER_THRESHOLDS[index]) {discard;}}}\n#else\ncolor=applyCutout(color,h);\n#endif\n#endif\n#ifdef RENDER_FRONT_CUTOFF\nif (v_front_cutoff_opacity < 1.0) {int index=viewport_dither_index(gl_FragCoord.xy);if (v_front_cutoff_opacity < DITHER_THRESHOLDS[index]) {discard;}}\n#endif\n#ifdef FEATURE_CUTOUT\ncolor=apply_feature_cutout(color,gl_FragCoord,get_cutout_factors(gl_FragCoord).x,0.0);\n#endif\nglFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_material_table.vertex.glsl"\nuniform mat4 u_matrix;\n#ifndef LIGHTING_3D_MODE\nuniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;\n#endif\nuniform float u_vertical_gradient;uniform lowp float u_opacity;uniform float u_edge_radius;uniform float u_width_scale;in ivec4 a_pos_normal_ed;\n#if defined(HAS_CENTROID) || defined(TERRAIN)\nin uvec2 a_centroid_pos;\n#endif\n#ifdef RENDER_WALL_MODE\nin ivec4 a_join_normal_inside;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nin ivec4 a_pos_3;in ivec4 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;\n#endif\n#ifdef TERRAIN\nuniform int u_height_type;uniform int u_base_type;\n#endif\nuniform highp float u_vertical_scale;\n#ifdef RENDER_FRONT_CUTOFF\nuniform vec3 u_front_cutoff_params;out float v_front_cutoff_opacity;\n#endif\nout vec4 v_color;out vec4 v_flat;\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;\n#endif\n#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE)\nout vec4 v_roof_color;\n#endif\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nout highp vec3 v_normal;\n#endif\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;out vec2 v_ao;\n#endif\n#if defined(LIGHTING_3D_MODE) && defined(FLOOD_LIGHT)\nout float v_flood_radius;out float v_has_floodlight;\n#endif\nout float v_height;\n#ifdef INDICATOR_CUTOUT\n#ifdef FEATURE_CUTOUT\nout vec4 v_ground_roof;\n#endif\n#endif\nvec3 linearTosRGB(vec3 color) {return pow(color,vec3(1./2.2));}vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define highp float flood_light_wall_radius\n#pragma mapbox: define highp float line_width\n#pragma mapbox: define highp float emissive_strength\nvoid main() {DECLARE_MATERIAL_TABLE_INFO\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize highp float flood_light_wall_radius\n#pragma mapbox: initialize highp float line_width\n#pragma mapbox: initialize highp float emissive_strength\nbase*=u_vertical_scale;height*=u_vertical_scale;vec4 top_up_ny_start=vec4(a_pos_normal_ed & 1);vec4 pos_nx=vec4(a_pos_normal_ed >> 1);float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny_start.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny_start.z-1.0)*(1.0-abs(x_normal)),0.0));\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nv_normal=normal;\n#endif\nbase=max(0.0,base);float attr_height=height;height=max(0.0,top_up_ny_start.y==0.0 && top_up_ny_start.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny_start.x;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=vec2(a_centroid_pos);\n#endif\nfloat ele=0.0;float h=0.0;float c_ele=0.0;vec3 pos;\n#ifdef TERRAIN\nbool is_flat_height=centroid_pos.x !=0.0 && u_height_type==1;bool is_flat_base=centroid_pos.x !=0.0 && u_base_type==1;ele=elevation(pos_nx.xy);bool is_elevation_encoded=centroid_pos.y==0.0 || (centroid_pos.y > 0.0 && (int(centroid_pos.y) & 7)==7);c_ele=is_flat_height || is_flat_base ? (is_elevation_encoded ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos)) : ele;float h_height=is_flat_height ? max(c_ele+height,ele+base+2.0) : ele+height;float h_base=is_flat_base ? max(c_ele+base,ele+base) : ele+(base==0.0 ?-5.0 : base);h=t > 0.0 ? max(h_base,h_height) : h_base;\n#else\nh=t > 0.0 ? height : base;\n#endif\npos=vec3(pos_nx.xy,h);\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(vec3(a_pos_normal_3)/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=vec3(a_pos_3)+globe_normal*(u_tile_up_scale*h);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,pos.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*pos.z;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\nfloat cutoff=1.0;vec3 scaled_pos=pos;\n#if defined(RENDER_CUTOFF) || defined(RENDER_FRONT_CUTOFF)\nvec2 centroid_decoded=pos.xy;bool isBorderCentroid=false;if (centroid_pos.x > 0.0 && centroid_pos.y > 0.0) {int iy=int(centroid_pos.y);int spanYbits=iy & 7;if (spanYbits==7) {isBorderCentroid=true;int borderID=(iy >> 3) & 3;float coordAlongBorder=float(iy >> 5)*4.0;if (borderID==0) centroid_decoded=vec2(0.0,coordAlongBorder);else if (borderID==1) centroid_decoded=vec2(EXTENT,coordAlongBorder);else if (borderID==2) centroid_decoded=vec2(coordAlongBorder,0.0);else centroid_decoded=vec2(coordAlongBorder,EXTENT);} else {centroid_decoded=floor(centroid_pos/8.0);}}\n#endif\n#if defined(RENDER_CUTOFF) || defined(RENDER_FRONT_CUTOFF)\nvec4 ground=u_matrix*vec4(centroid_decoded,ele,1.0);\n#endif\n#ifdef RENDER_CUTOFF\n#ifdef CLIP_ZERO_TO_ONE\ncutoff=cutoff_opacity(u_cutoff_params,ground.z*2.0-ground.w);\n#else\ncutoff=cutoff_opacity(u_cutoff_params,ground.z);\n#endif\nif (centroid_pos.y !=0.0 && centroid_pos.x !=0.0) {vec3 centroid_random=vec3(centroid_pos.xy,centroid_pos.x+centroid_pos.y+1.0);vec3 ground_pos=centroid_random/8.0;vec3 g=floor(ground_pos);vec3 mod_=centroid_random-g*8.0;float seed=min(1.0,0.1*(min(3.5,max(mod_.x+mod_.y,0.2*attr_height))*0.35+mod_.z));if (cutoff < 0.8-seed) {cutoff=0.0;}}float cutoff_scale=cutoff;v_cutoff_opacity=cutoff;scaled_pos.z=mix(c_ele,h,cutoff_scale);\n#endif\nfloat hidden=float((centroid_pos.x==0.0 && centroid_pos.y==1.0) || (cutoff==0.0 && centroid_pos.x !=0.0) || (color.a==0.0));\n#ifdef RENDER_FRONT_CUTOFF\nv_front_cutoff_opacity=1.0;if (centroid_pos.x > 0.0 && centroid_pos.y > 0.0) {hidden=max(hidden,float(ground.w <=0.0));float ndc_y=ground.y/max(ground.w,0.001);float threshold=u_front_cutoff_params.x*2.0-1.0;float range_ndc=u_front_cutoff_params.y*2.0;if (!isBorderCentroid) {hidden=max(hidden,float(ndc_y < threshold-range_ndc));}float t=clamp((ndc_y-(threshold-range_ndc))/max(range_ndc,0.001),0.0,1.0);v_front_cutoff_opacity=mix(u_front_cutoff_params.z,1.0,t);}\n#endif\n#ifdef RENDER_WALL_MODE\nvec3 join_normal_inside=vec3(a_join_normal_inside);vec2 wall_offset=u_width_scale*line_width*(join_normal_inside.xy/EXTENT);scaled_pos.xy+=(1.0-join_normal_inside.z)*wall_offset*0.5;scaled_pos.xy-=join_normal_inside.z*wall_offset*0.5;\n#endif\ngl_Position=mix(u_matrix*vec4(scaled_pos,1),AWAY,hidden);h=h-ele;v_height=h;\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=pos;vec3 shd_pos1=pos;\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(normal);shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);\n#endif\nfloat NdotL=0.0;float colorvalue=0.0;\n#ifndef LIGHTING_3D_MODE\ncolorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),NdotL);if (normal.y !=0.0) {float r=0.84;r=mix(0.7,0.98,1.0-u_lightintensity);NdotL*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}\n#endif\n#ifdef FAUX_AO\nfloat concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;\n#ifdef TERRAIN\ntop_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);\n#endif\nv_ao=vec2(mix(concave,-concave,start),y_ground);NdotL*=(1.0+0.05*(1.0-top_up_ny_start.y)*u_ao[0]);\n#ifdef PROJECTION_GLOBE_VIEW\ntop_height+=u_height_lift;\n#endif\ngl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;\n#endif\n#ifdef LIGHTING_3D_MODE\n#ifdef FLOOD_LIGHT\nfloat is_wall=1.0-float(t > 0.0 && top_up_ny_start.y > 0.0);v_has_floodlight=float(flood_light_wall_radius > 0.0 && is_wall > 0.0);v_flood_radius=flood_light_wall_radius*u_vertical_scale;\n#endif\nv_color=vec4(color.rgb,1.0);float ndotl=calculate_NdotL(normal);v_flat.rgb=sRGBToLinear(color.rgb);v_flat.rgb=v_flat.rgb*(ndotl+(1.0-min(ndotl*57.29,1.0))*emissive_strength);v_flat=vec4(linearTosRGB(v_flat.rgb),1.0);\n#else\nv_color=vec4(0.0,0.0,0.0,1.0);v_color.rgb+=clamp(color.rgb*NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_color*=u_opacity;\n#endif\n#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE)\nfloat roofNdotL=clamp(u_lightpos.z,0.0,1.0);roofNdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),roofNdotL);v_roof_color=vec4(0.0,0.0,0.0,1.0);v_roof_color.rgb+=clamp(color.rgb*roofNdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_roof_color*=u_opacity;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n#ifdef INDICATOR_CUTOUT\n#ifdef FEATURE_CUTOUT\nvec4 pos_ground=u_matrix*vec4(pos.xy,ele,1.0);vec4 pos_roof=u_matrix*vec4(pos.xy,ele+height,1.0);v_ground_roof=vec4(pos_ground.xy/pos_ground.w,pos_roof.xy/pos_roof.w);\n#endif\n#endif\n}'),fillExtrusionPattern:Cs('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_indicator_cutout.fragment.glsl"\nuniform vec2 u_texsize;uniform sampler2D u_image;\n#ifdef FILL_EXTRUSION_PATTERN_TRANSITION\nuniform float u_pattern_transition;\n#endif\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;in vec3 v_ao;\n#endif\n#ifdef LIGHTING_3D_MODE\nin vec3 v_normal;\n#endif\n#ifdef APPLY_LUT_ON_GPU\nuniform highp sampler3D u_lutTexture;\n#endif\nin highp vec2 v_pos;in vec4 v_lighting;uniform lowp float u_opacity;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define mediump uvec4 pattern\n#ifdef FILL_EXTRUSION_PATTERN_TRANSITION\n#pragma mapbox: define mediump uvec4 pattern_b\n#endif\n#pragma mapbox: define highp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize mediump uvec4 pattern\n#ifdef FILL_EXTRUSION_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump uvec4 pattern_b\n#endif\n#pragma mapbox: initialize highp float pixel_ratio\nvec2 pattern_tl=vec2(pattern.xy);vec2 pattern_br=vec2(pattern.zw);highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);highp vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);vec4 out_color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef APPLY_LUT_ON_GPU\nout_color=applyLUT(u_lutTexture,out_color);\n#endif\n#ifdef FILL_EXTRUSION_PATTERN_TRANSITION\nvec2 pattern_b_tl=vec2(pattern_b.xy);vec2 pattern_b_br=vec2(pattern_b.zw);highp vec2 pos_b=mix(pattern_b_tl/u_texsize,pattern_b_br/u_texsize,imagecoord);vec4 color_b=textureLodCustom(u_image,pos_b,lod_pos);out_color=out_color*(1.0-u_pattern_transition)+color_b*u_pattern_transition;\n#endif\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color,normalize(v_normal))*u_opacity;\n#else\nout_color=out_color*v_lighting;\n#endif\n#ifdef FAUX_AO\nfloat intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);out_color.rgb=out_color.rgb*shade;\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\n#ifdef INDICATOR_CUTOUT\nout_color=applyCutout(out_color,height);\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_material_table.vertex.glsl"\nuniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform float u_tile_units_to_pixels;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform float u_width_scale;\n#ifndef LIGHTING_3D_MODE\nuniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;\n#endif\nin ivec4 a_pos_normal_ed;\n#if defined(HAS_CENTROID) || defined(TERRAIN)\nin uvec2 a_centroid_pos;\n#endif\n#ifdef RENDER_WALL_MODE\nin ivec4 a_join_normal_inside;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nin ivec4 a_pos_3;in ivec4 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;\n#endif\n#ifdef TERRAIN\nuniform int u_height_type;uniform int u_base_type;\n#endif\nout highp vec2 v_pos;out vec4 v_lighting;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;out vec3 v_ao;\n#endif\n#ifdef LIGHTING_3D_MODE\nout vec3 v_normal;\n#endif\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump uvec4 pattern\n#ifdef FILL_EXTRUSION_PATTERN_TRANSITION\n#pragma mapbox: define mediump uvec4 pattern_b\n#endif\n#pragma mapbox: define highp float pixel_ratio\n#pragma mapbox: define highp float line_width\nvoid main() {DECLARE_MATERIAL_TABLE_INFO\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump uvec4 pattern\n#ifdef FILL_EXTRUSION_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump uvec4 pattern_b\n#endif\n#pragma mapbox: initialize highp float pixel_ratio\n#pragma mapbox: initialize highp float line_width\nvec2 pattern_tl=vec2(pattern.xy);vec2 pattern_br=vec2(pattern.zw);vec4 top_up_ny_start=vec4(a_pos_normal_ed & 1);vec4 pos_nx=vec4(a_pos_normal_ed >> 1);float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny_start.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny_start.z-1.0)*(1.0-abs(x_normal)),0.0));float edgedistance=float(a_pos_normal_ed.w);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;base=max(0.0,base);height=max(0.0,height);float t=top_up_ny_start.x;float z=t > 0.0 ? height : base;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=vec2(a_centroid_pos);\n#endif\nfloat ele=0.0;float h=z;vec3 p;float c_ele;\n#ifdef TERRAIN\nbool is_flat_height=centroid_pos.x !=0.0 && u_height_type==1;bool is_flat_base=centroid_pos.x !=0.0 && u_base_type==1;ele=elevation(pos_nx.xy);bool is_elevation_encoded=centroid_pos.y==0.0 || (centroid_pos.y > 0.0 && int(centroid_pos.y)-(int(centroid_pos.y)/8)*8==7);c_ele=is_flat_height || is_flat_base ? (is_elevation_encoded ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos)) : ele;float h_height=is_flat_height ? max(c_ele+height,ele+base+2.0) : ele+height;float h_base=is_flat_base ? max(c_ele+base,ele+base) : ele+(base==0.0 ?-5.0 : base);h=t > 0.0 ? max(h_base,h_height) : h_base;p=vec3(pos_nx.xy,h);\n#else\np=vec3(pos_nx.xy,z);\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(vec3(a_pos_normal_3)/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=vec3(a_pos_3)+globe_normal*(u_tile_up_scale*(p.z+lift));vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,p.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*p.z;p=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\n#ifdef RENDER_WALL_MODE\nvec3 join_normal_inside=vec3(a_join_normal_inside);vec2 wall_offset=u_width_scale*line_width*(join_normal_inside.xy/EXTENT);p.xy+=(1.0-join_normal_inside.z)*wall_offset*0.5;p.xy-=join_normal_inside.z*wall_offset*0.5;\n#endif\nfloat hidden=float((centroid_pos.x==0.0 && centroid_pos.y==1.0) || (color.a==0.0));gl_Position=mix(u_matrix*vec4(p,1),AWAY,hidden);vec2 pos=normal.z==1.0\n? pos_nx.xy\n: vec2(edgedistance,z*u_height_factor);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float NdotL=0.0;\n#ifdef LIGHTING_3D_MODE\nNdotL=calculate_NdotL(normal);\n#else\nNdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),NdotL);\n#endif\nif (normal.y !=0.0) {float r=0.84;\n#ifndef LIGHTING_3D_MODE\nr=mix(0.7,0.98,1.0-u_lightintensity);\n#endif\nNdotL*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}\n#ifdef FAUX_AO\nfloat concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;\n#ifdef TERRAIN\ntop_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);\n#endif\nv_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny_start.y)*u_ao[0]);\n#ifdef PROJECTION_GLOBE_VIEW\ntop_height+=u_height_lift;\n#endif\ngl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;\n#endif\n#ifdef LIGHTING_3D_MODE\nv_normal=normal;\n#else\nv_lighting.rgb+=clamp(NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(p);\n#endif\n}'),hillshadePrepare:Cs("precision highp float;uniform highp sampler2D u_image;in vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;float getElevation(vec2 coord) {return texture(u_image,coord).r/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y));float b=getElevation(v_pos+vec2(0,-epsilon.y));float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y));float d=getElevation(v_pos+vec2(-epsilon.x,0));float e=getElevation(v_pos+vec2(epsilon.x,0));float f=getElevation(v_pos+vec2(-epsilon.x,epsilon.y));float g=getElevation(v_pos+vec2(0,epsilon.y));float h=getElevation(v_pos+vec2(epsilon.x,epsilon.y));float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2(\n(c+e+e+h)-(a+d+d+f),(f+g+g+h)-(a+b+b+c)\n)/pow(2.0,exaggeration+(19.2562-u_zoom));glFragColor=clamp(vec4(\nderiv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);}","uniform mat4 u_matrix;uniform vec2 u_dimension;in ivec2 a_pos;in uvec2 a_texture_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(vec2(a_texture_pos)/8192.0)*scale+epsilon;}"),hillshade:Cs('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;uniform float u_emissive_strength;void main() {vec4 pixel=texture(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);glFragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef LIGHTING_3D_MODE\nglFragColor=apply_lighting_with_emission_ground(glFragColor,u_emissive_strength);\n#endif\n#ifdef FOG\nglFragColor=fog_dither(fog_apply_premultiplied(glFragColor,v_fog_pos));\n#endif\n#ifdef USE_MRT1\nout_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;in ivec2 a_pos;in uvec2 a_texture_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=vec2(a_texture_pos)/8192.0;\n#ifdef VIEWPORT_ORIGIN_TOP_LEFT\nv_pos.y=1.0-v_pos.y;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(vec2(a_pos));\n#endif\n}'),line:Cs('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_indicator_cutout.fragment.glsl"\n#include "_prelude_feature_cutout.fragment.glsl"\nuniform lowp float u_device_pixel_ratio;uniform highp float u_width_scale;uniform float u_alpha_discard_threshold;uniform lowp float u_opacity_multiplier;uniform bool u_clip_to_tile_borders;in vec4 v_width2_dilute;in vec2 v_normal;in float v_gamma_scale;in vec2 v_tile_pos;\n#ifdef ELEVATED_ROADS\nin highp float v_road_z_offset;\n#endif\n#ifdef VARIABLE_LINE_WIDTH\nin float stub_side;\n#endif\n#ifdef RENDER_LINE_DASH\nuniform sampler2D u_dash_image;uniform highp float u_floor_width_scale;in vec2 v_tex;\n#endif\n#ifdef DEBUG_ELEVATION_ID\nin vec3 v_elevation_id_col;\n#endif\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_BORDER_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)\nin highp vec3 v_uv;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform sampler2D u_gradient_image;\n#endif\n#ifdef RENDER_LINE_BORDER_GRADIENT\nuniform sampler2D u_border_gradient_image;\n#endif\n#ifdef RENDER_LINE_TRIM_OFFSET\nuniform highp vec2 u_trim_offset;uniform highp vec2 u_trim_fade_range;uniform highp vec2 u_trim_gradient_mix_range;uniform lowp vec4 u_trim_color;\n#endif\n#ifdef INDICATOR_CUTOUT\nin highp float v_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform bool u_emissive_in_shadows;uniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\nfloat luminance(vec3 c) {return (c.r+c.r+c.b+c.g+c.g+c.g)*0.1667;}\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define mediump uvec4 dash\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float side_z_offset\n#pragma mapbox: define lowp float border_width\n#pragma mapbox: define lowp vec4 border_color\n#pragma mapbox: define lowp float emissive_strength\nfloat linearstep(float edge0,float edge1,float x) {return clamp((x-edge0)/(edge1-edge0),0.0,1.0);}void main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump uvec4 dash\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float side_z_offset\n#pragma mapbox: initialize lowp float border_width\n#pragma mapbox: initialize lowp vec4 border_color\n#pragma mapbox: initialize lowp float emissive_strength\nfloat dist=length(v_normal)*v_width2_dilute.x;float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;\n#ifdef RENDER_LINE_BORDER\n#ifndef VARIABLE_LINE_WIDTH\nANTIALIASING*=8.0;\n#endif\n#endif\n#ifdef VARIABLE_LINE_WIDTH\nblur=mix(blur,0.0,stub_side);\n#endif\nfloat diluted_opacity=opacity*v_width2_dilute.z;float blur2=(u_width_scale*blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2_dilute.y-blur2),v_width2_dilute.x-dist)/blur2,0.0,1.0);float pxStep;float delta;\n#ifdef RENDER_LINE_BORDER\n#ifndef VARIABLE_LINE_WIDTH\npxStep=fwidth(dist);float out_edge=v_width2_dilute.x-dist;float in_edge=dist-(v_width2_dilute.y-2.0*ANTIALIASING);delta=v_width2_dilute.y > 0.0 ? min(in_edge,out_edge) : out_edge;float edge=ANTIALIASING;alpha=delta > 0.0 ? smoothstep(edge-pxStep,u_width_scale*blur+edge+pxStep,delta) : 0.0;\n#endif\n#endif\n#ifdef RENDER_LINE_DASH\nfloat sdfdist=texture(u_dash_image,v_tex).r;float sdfgamma=ANTIALIASING/(float(dash.z)+float(dash.w)/65535.0);float scaled_floorwidth=(floorwidth*u_floor_width_scale);alpha*=linearstep(0.5-sdfgamma/scaled_floorwidth,0.5+sdfgamma/scaled_floorwidth,sdfdist);\n#endif\nhighp vec4 out_color;\n#ifdef RENDER_LINE_GRADIENT\nout_color=texture(u_gradient_image,v_uv.xy);\n#else\nout_color=color;\n#endif\nfloat trim_alpha=1.0;\n#ifdef RENDER_LINE_TRIM_OFFSET\nhighp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=v_uv[2];if (trim_end > trim_start) {highp float start_transition=max(0.0,min(1.0,(line_progress-trim_start)/max(u_trim_fade_range[0],1.0e-9)));highp float end_transition=max(0.0,min(1.0,(trim_end-line_progress)/max(u_trim_fade_range[1],1.0e-9)));highp float transition_factor=min(start_transition,end_transition);highp float gradient_trim_color_mix_factor=0.0;\n#ifdef RENDER_LINE_GRADIENT\ngradient_trim_color_mix_factor=smoothstep(u_trim_gradient_mix_range.x,u_trim_gradient_mix_range.y,line_progress);\n#endif\nhighp vec4 trim_color=mix(u_trim_color,out_color,gradient_trim_color_mix_factor);out_color=mix(u_trim_gradient_mix_range.x < 1.0 ? color : out_color,trim_color,transition_factor);trim_alpha=1.0-transition_factor;}\n#endif\nif (u_alpha_discard_threshold !=0.0) {if (alpha < u_alpha_discard_threshold) {discard;}}\n#ifdef RENDER_LINE_BORDER\n#ifndef VARIABLE_LINE_WIDTH\nfloat edge2=border_width*u_width_scale+ANTIALIASING;float alpha2=smoothstep(edge2-pxStep,edge2+pxStep,delta);if (alpha2 < 1.) {\n#ifdef RENDER_LINE_BORDER_GRADIENT\nvec4 border_gradient_color=texture(u_border_gradient_image,v_uv.xy);out_color=mix(border_gradient_color*trim_alpha,out_color,alpha2);\n#else\nif (border_color.a==0.0) {\n#ifndef RENDER_LINE_GRADIENT\nfloat Y=(out_color.a > 0.01) ? luminance(out_color.rgb/out_color.a) : 1.;float adjustment=(Y > 0.) ? 0.5/Y : 0.45;if (out_color.a > 0.25 && Y < 0.25) {vec3 borderColor=(Y > 0.) ? out_color.rgb : vec3(1,1,1)*out_color.a;out_color.rgb=out_color.rgb+borderColor*(adjustment*(1.0-alpha2));} else {out_color.rgb*=(0.6+0.4*alpha2);}\n#else\nout_color.rgb*=(0.6+0.4*alpha2);\n#endif\n} else {out_color=mix(border_color*trim_alpha,out_color,alpha2);}\n#endif\nout_color*=v_width2_dilute.w;}\n#endif\n#endif\nvec2 cutout_factors=vec2(0.0);\n#ifdef FEATURE_CUTOUT\ncutout_factors=get_cutout_factors(gl_FragCoord);\n#endif\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);light=mix(light,1.0,cutout_factors.y);light=u_emissive_in_shadows ? mix(light,1.0,emissive_strength) : light;\n#ifdef ELEVATED_ROADS\nout_color.rgb*=mix(v_road_z_offset !=0.0 ? u_ground_shadow_factor : vec3(1.0),vec3(1.0),light);\n#else\nout_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nout_color*=(alpha*diluted_opacity*u_opacity_multiplier);\n#ifdef INDICATOR_CUTOUT\nout_color=applyCutout(out_color,v_z_offset);\n#endif\n#ifdef FEATURE_CUTOUT\nfloat z=0.0;\n#ifdef ELEVATED_ROADS\nz=v_road_z_offset;\n#endif\nout_color=apply_feature_cutout(out_color,gl_FragCoord,cutout_factors.x,z);\n#endif\n#ifdef LINE_BLEND_ADDITIVE\n{float cov=alpha*diluted_opacity;glFragColor=vec4(cov > 0.0 ? out_color.rgb/cov : vec3(0.0),cov);}\n#else\n#ifdef LINE_BLEND_MULTIPLY\nglFragColor=vec4(out_color.rgb+(1.0-out_color.a),1.0);\n#else\nglFragColor=out_color;\n#endif\n#endif\n#ifdef DUAL_SOURCE_BLENDING\nglFragColorSrc1=vec4(vec3(0.0),emissive_strength);\n#else\n#ifdef USE_MRT1\nout_Target1=vec4(emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);\n#endif\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n#ifdef DEBUG_ELEVATION_ID\nglFragColor=vec4(v_elevation_id_col,1.0);\n#endif\nif (u_clip_to_tile_borders) {if (v_tile_pos.x > 1.0 || v_tile_pos.y > 1.0 || v_tile_pos.x < 0.0 || v_tile_pos.y < 0.0) {discard;}}HANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#define EXTRUDE_SCALE 0.015873016\nin ivec2 a_pos_normal;in uvec4 a_data;\n#if defined(ELEVATED) || defined(ELEVATED_ROADS) || defined(VARIABLE_LINE_WIDTH) || defined(VARIABLE_LINE_EMISSIVE_STRENGTH)\nin vec4 a_z_offset_width;\n#endif\n#ifdef DEBUG_ELEVATION_ID\nin vec3 a_elevation_id_col;\n#endif\n#ifdef DEBUG_ELEVATION_ID\nout vec3 v_elevation_id_col;\n#endif\n#ifdef ELEVATION_GROUND_SCALE\nin float a_elevation_ground_scale;\n#endif\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_BORDER_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET) || defined(RENDER_LINE_CURVE)\nin highp vec3 a_packed;\n#endif\n#ifdef RENDER_LINE_DASH\nin float a_linesofar;\n#endif\nuniform mat4 u_matrix;uniform mat2 u_pixels_to_tile_units;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;uniform float u_width_scale;uniform float u_z_offset;uniform highp float u_road_view_depth_bias;uniform highp vec4 u_road_clip_to_view;\n#ifdef RENDER_LINE_CURVE\nuniform mat3 u_curve_points_x;uniform mat3 u_curve_points_y;uniform mat3 u_curve_points_z;uniform float u_curve_point_count;\n#endif\n#ifdef ELEVATED\nuniform lowp float u_zbias_factor;uniform lowp float u_tile_to_meter;float sample_elevation(vec2 apos) {\n#ifdef ELEVATION_REFERENCE_SEA\nreturn 0.0;\n#else\nreturn elevation(apos);\n#endif\n}\n#endif\nout vec2 v_normal;out vec4 v_width2_dilute;out float v_gamma_scale;out vec2 v_tile_pos;\n#ifdef ELEVATED_ROADS\nout highp float v_road_z_offset;\n#endif\n#ifdef VARIABLE_LINE_WIDTH\nout float stub_side;\n#endif\n#ifdef RENDER_LINE_DASH\nuniform highp float u_floor_width_scale;uniform vec2 u_texsize;uniform float u_tile_units_to_pixels;out vec2 v_tex;\n#endif\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_BORDER_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)\nout highp vec3 v_uv;\n#endif\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_BORDER_GRADIENT)\nuniform float u_image_height;\n#endif\n#ifdef INDICATOR_CUTOUT\nout highp float v_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define mediump uvec4 dash\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define mediump float side_z_offset\n#pragma mapbox: define lowp float border_width\n#pragma mapbox: define lowp vec4 border_color\n#pragma mapbox: define lowp float emissive_strength\n#ifdef RENDER_LINE_CURVE\nvec3 getCurvePoint(int index) {int row=index/3;int col=index-row*3;float x=u_curve_points_x[row][col];float y=u_curve_points_y[row][col];float z=u_curve_points_z[row][col];return vec3(x,y,z);}vec3 catmullRom(vec3 p0,vec3 p1,vec3 p2,vec3 p3,float t) {float t2=t*t;float t3=t2*t;return 0.5*(\n2.0*p1+(-p0+p2)*t+(2.0*p0-5.0*p1+4.0*p2-p3)*t2+(-p0+3.0*p1-3.0*p2+p3)*t3\n);}vec2 catmullRomTangent(vec2 p0,vec2 p1,vec2 p2,vec2 p3,float t) {float t2=t*t;return 0.5*(\n(-p0+p2)+(2.0*p0-5.0*p1+4.0*p2-p3)*2.0*t+(-p0+3.0*p1-3.0*p2+p3)*3.0*t2\n);}struct CurveResult {vec3 point;vec2 tangent;};CurveResult calculateCurve(float line_progress) {float curve_progress=line_progress*(u_curve_point_count-1.0);float curve_progress_local=fract(curve_progress);float curve_segment=floor(curve_progress);int seg=int(curve_segment);vec3 p1=getCurvePoint(seg);vec3 p2=getCurvePoint(seg+1);float is_first_seg=step(curve_segment,0.5);vec3 p0_extrapolated=p1-(p2-p1);vec3 p0_fetched=getCurvePoint(max(seg-1,0));vec3 p0=mix(p0_fetched,p0_extrapolated,is_first_seg);int last_seg=int(u_curve_point_count)-2;float is_last_seg=step(float(last_seg)-0.5,curve_segment);vec3 p3_extrapolated=p2+(p2-p1);vec3 p3_fetched=getCurvePoint(min(seg+2,int(u_curve_point_count)-1));vec3 p3=mix(p3_fetched,p3_extrapolated,is_last_seg);vec3 point=catmullRom(p0,p1,p2,p3,curve_progress_local);vec2 tangent=catmullRomTangent(p0.xy,p1.xy,p2.xy,p3.xy,curve_progress_local)*(u_curve_point_count-1.0);CurveResult result;result.point=point;result.tangent=tangent;return result;}\n#endif\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump uvec4 dash\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize mediump float side_z_offset\n#pragma mapbox: initialize lowp float border_width\n#pragma mapbox: initialize lowp vec4 border_color\n#pragma mapbox: initialize lowp float emissive_strength\n#ifdef VARIABLE_LINE_EMISSIVE_STRENGTH\nemissive_strength=a_z_offset_width.w;\n#endif\nfloat a_z_offset=u_z_offset;\n#if defined(ELEVATED) || defined(ELEVATED_ROADS)\na_z_offset+=a_z_offset_width.x;\n#endif\n#ifdef DEBUG_ELEVATION_ID\nv_elevation_id_col=a_elevation_id_col;\n#endif\nhighp float line_progress=0.0;\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_BORDER_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET) || defined(RENDER_LINE_CURVE)\nline_progress=a_packed[2];\n#endif\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;\n#ifdef RENDER_LINE_BORDER\n#ifndef VARIABLE_LINE_WIDTH\nANTIALIASING*=8.0;\n#endif\n#endif\nvec2 a_extrude=vec2(a_data.xy)-128.0;float a_direction=float(a_data.z & 3u)-1.0;vec2 pos_normal=vec2(a_pos_normal);vec2 pos=floor(pos_normal*0.5);mediump vec2 normal=pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;offset=-1.0*offset*u_width_scale;bool left=normal.y==1.0;\n#ifdef RENDER_LINE_CURVE\nCurveResult curve=calculateCurve(line_progress);pos=curve.point.xy*8192.0;a_extrude=length(a_extrude)*normalize(curve.tangent);a_extrude=left ? vec2(-a_extrude.y,a_extrude.x) : vec2(a_extrude.y,-a_extrude.x);a_z_offset+=curve.point.z;\n#endif\ngapwidth=gapwidth/2.0;float halfwidth;float dilute_scale=1.0;float dilute_border_scale=1.0;float symmetric_outset=0.0;\n#ifdef VARIABLE_LINE_WIDTH\nfloat left_width=a_z_offset_width.y;float right_width=a_z_offset_width.z;halfwidth=u_width_scale*(left ? left_width : right_width);if (side_z_offset !=0.0) {float left_f=step(1.0,normal.y);float is_negative=step(side_z_offset,0.0);float apply=mix(1.0-left_f,left_f,is_negative);a_extrude*=apply;a_z_offset+=abs(side_z_offset)*apply;v_normal*=apply;}offset=border_width > 0.0 ? (left_width+right_width)*u_width_scale : offset;halfwidth=border_width > 0.0 ? border_width*u_width_scale*0.5 : halfwidth;bool zero_right_width=border_width==0.0 && right_width==0.0;symmetric_outset=zero_right_width ? u_width_scale*left_width : halfwidth;stub_side=zero_right_width ?-normal.y : 0.0;v_normal=!left && zero_right_width ? vec2(0.0) : v_normal;ANTIALIASING=!left && zero_right_width ? 0.0 : ANTIALIASING;\n#else\nhalfwidth=(u_width_scale*width)/2.0;\n#endif\nfloat inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth > 0.0 ? ANTIALIASING : 0.0);mediump vec2 dist=outset*a_extrude*EXTRUDE_SCALE;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*EXTRUDE_SCALE*normal.y*mat2(t,-u,u,t);float hidden=float(opacity==0.0);vec2 extrude=dist*u_pixels_to_tile_units;vec4 projected_extrude=u_matrix*vec4(extrude,0.0,0.0);vec2 projected_extrude_xy=projected_extrude.xy;\n#ifdef ELEVATED_ROADS\nv_road_z_offset=a_z_offset;v_tile_pos=pos+offset2*u_pixels_to_tile_units;gl_Position=u_matrix*vec4(v_tile_pos,a_z_offset,1.0);\n#else\n#ifdef ELEVATED\nvec2 offsetTile=offset2*u_pixels_to_tile_units;vec2 offset_pos=pos+offsetTile;float ele=0.0;float scaled_z_offset=a_z_offset;\n#ifdef ELEVATION_GROUND_SCALE\nscaled_z_offset=a_z_offset*mix(1.0,u_exaggeration,a_elevation_ground_scale);\n#endif\n#ifdef CROSS_SLOPE_VERTICAL\nfloat top=pos_normal.y-2.0*floor(pos_normal.y*0.5);float line_height=2.0*u_tile_to_meter*outset*top*u_pixels_to_tile_units[1][1]+scaled_z_offset;ele=sample_elevation(offset_pos)+line_height;projected_extrude=vec4(0);\n#else\n#ifdef CROSS_SLOPE_HORIZONTAL\nfloat ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,max(ele1,ele2));ele=ele_max+scaled_z_offset;\n#else\nfloat ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,0.5*(ele1+ele2));ele=ele_max-ele0+ele1+scaled_z_offset;\n#endif\n#endif\nv_tile_pos=offset_pos;gl_Position=u_matrix*vec4(v_tile_pos,ele,1.0)+projected_extrude;float z=clamp(gl_Position.z/gl_Position.w,0.5,1.0);float zbias=max(0.00005,(pow(z,0.8)-z)*u_zbias_factor*u_exaggeration);gl_Position.z-=(gl_Position.w*zbias);gl_Position=mix(gl_Position,AWAY,hidden);\n#else\nv_tile_pos=pos+offset2*u_pixels_to_tile_units;gl_Position=u_matrix*vec4(v_tile_pos,0.0,1.0);\n#endif\n#endif\n#ifndef ELEVATED\n#ifndef VARIABLE_LINE_WIDTH\n#ifndef RENDER_TO_TEXTURE\nfloat base_w=gl_Position.w;vec2 screen_width=abs(projected_extrude.xy/base_w*u_units_to_pixels);float max_extrude_component=max(screen_width.x,screen_width.y);if (width >=1.0 && base_w > 0.0 && max_extrude_component > 0.0001) {float min_pixel=1.05;if (max_extrude_component < min_pixel) {vec2 abs_pos=abs(gl_Position.xy);float is_out=max(abs_pos.x,abs_pos.y)/base_w;dilute_scale=mix(max_extrude_component/min_pixel,1.0,smoothstep(2.5,4.5,is_out));projected_extrude/=dilute_scale;}else if (gapwidth > 0.0) {float visible_ratio=(halfwidth+ANTIALIASING)/outset;vec2 visible_screen_width=screen_width*visible_ratio;float max_visible_component=max(visible_screen_width.x,visible_screen_width.y);dilute_scale=min(1.0,max_visible_component/min_pixel);}else\n{\n#ifdef RENDER_LINE_BORDER\nfloat border_ratio=(border_width*u_width_scale+ANTIALIASING)/outset;screen_width*=border_ratio;float max_border_component=max(screen_width.x,screen_width.y);dilute_border_scale=min(1.0,max_border_component/min_pixel);\n#endif\n}}\n#endif\n#endif\nv_tile_pos=(v_tile_pos+extrude)/EXTENT;\n#ifdef ELEVATED_ROADS\ngl_Position=gl_Position+projected_extrude;\n#ifdef VARIABLE_LINE_WIDTH\n#ifndef ELEVATED\nif (u_road_view_depth_bias > 0.0) {highp float z_in=gl_Position.z/gl_Position.w*0.5+0.5;highp float a=u_road_clip_to_view.x;highp float b=u_road_clip_to_view.y;highp float c=u_road_clip_to_view.z;highp float d=u_road_clip_to_view.w;highp float view=(a*z_in+b)/(c*z_in+d);highp float view_new=view+u_road_view_depth_bias;highp float z_new=(view_new*d-b)/(a-view_new*c);z_new=clamp(z_new,0.0,1.0);gl_Position.z=(z_new*2.0-1.0)*gl_Position.w;}\n#endif\n#endif\n#else\ngl_Position=mix(gl_Position+projected_extrude,AWAY,hidden);\n#endif\n#endif\n#ifdef ELEVATED_ROADS\n#ifdef RENDER_SHADOWS\nvec3 shd_pos=vec3(pos+(offset2+dist)*u_pixels_to_tile_units,a_z_offset);vec3 shd_pos0=shd_pos;vec3 shd_pos1=shd_pos;\n#ifdef NORMAL_OFFSET\nvec3 shd_pos_offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=shd_pos_offset*shadow_normal_offset_multiplier0();shd_pos1+=shd_pos_offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#endif\n#ifndef RENDER_TO_TEXTURE\nfloat epsilon=0.0001;float extrude_length_without_perspective=max(length(dist),epsilon);float extrude_length_with_perspective=max(length(projected_extrude_xy/gl_Position.w*u_units_to_pixels),epsilon);v_gamma_scale=mix(extrude_length_without_perspective/extrude_length_with_perspective,1.0,step(0.01,blur));\n#else\nv_gamma_scale=1.0;\n#endif\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_BORDER_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)\nhighp float a_uv_x=a_packed[0];float a_split_index=a_packed[1];\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_BORDER_GRADIENT)\nhighp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec3(a_uv_x,a_split_index*texel_height-half_texel_height,line_progress);\n#else\nv_uv=vec3(a_uv_x,0.0,line_progress);\n#endif\n#endif\n#ifdef RENDER_LINE_DASH\nvec4 dashf=vec4(dash);float totalLength=dashf.z+dashf.w/65535.0;float scale=totalLength==0.0 ? 0.0 : u_tile_units_to_pixels/totalLength;v_tex=vec2(a_linesofar*scale/(floorwidth*u_floor_width_scale),(-normal.y*dashf.y+dashf.x+0.5)/u_texsize.y);\n#endif\nv_width2_dilute=vec4(outset,inset,dilute_scale,dilute_border_scale);\n#ifdef VARIABLE_LINE_WIDTH\nv_width2_dilute.x=symmetric_outset;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n#ifdef INDICATOR_CUTOUT\nv_z_offset=a_z_offset;\n#endif\n}'),linePattern:Cs('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_indicator_cutout.fragment.glsl"\nuniform highp float u_device_pixel_ratio;uniform highp float u_width_scale;uniform highp float u_alpha_discard_threshold;uniform lowp float u_opacity_multiplier;uniform highp vec2 u_texsize;uniform highp float u_tile_units_to_pixels;uniform highp vec2 u_trim_offset;uniform highp vec2 u_trim_fade_range;uniform lowp vec4 u_trim_color;uniform sampler2D u_image;\n#ifdef APPLY_LUT_ON_GPU\nuniform highp sampler3D u_lutTexture;\n#endif\n#ifdef LINE_PATTERN_TRANSITION\nuniform float u_pattern_transition;\n#endif\nin vec2 v_normal;in vec2 v_width2;in highp float v_linesofar;in float v_gamma_scale;in float v_width;\n#ifdef RENDER_LINE_TRIM_OFFSET\nin highp vec3 v_uv;\n#endif\n#ifdef ELEVATED_ROADS\nin highp float v_road_z_offset;\n#endif\n#ifdef LINE_JOIN_NONE\nin vec2 v_pattern_data;\n#endif\n#ifdef INDICATOR_CUTOUT\nin highp float v_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\n#pragma mapbox: define mediump uvec4 pattern\n#ifdef LINE_PATTERN_TRANSITION\n#pragma mapbox: define mediump uvec4 pattern_b\n#endif\n#pragma mapbox: define mediump float pixel_ratio\n#pragma mapbox: define mediump float blur\n#pragma mapbox: define mediump float opacity\n#pragma mapbox: define lowp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize mediump uvec4 pattern\n#ifdef LINE_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump uvec4 pattern_b\n#endif\n#pragma mapbox: initialize mediump float pixel_ratio\n#pragma mapbox: initialize mediump float blur\n#pragma mapbox: initialize mediump float opacity\n#pragma mapbox: initialize lowp float emissive_strength\nvec2 pattern_tl=vec2(pattern.xy);vec2 pattern_br=vec2(pattern.zw);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;highp float pattern_size=display_size.x/u_tile_units_to_pixels;float aspect=display_size.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(u_width_scale*blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);highp float pattern_x=v_linesofar/pattern_size*aspect;highp float x=mod(pattern_x,1.0);highp float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;highp vec2 pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(x,y));highp vec2 lod_pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(pattern_x,y));vec4 color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef APPLY_LUT_ON_GPU\ncolor=applyLUT(u_lutTexture,color);\n#endif\n#ifdef LINE_PATTERN_TRANSITION\nvec2 pattern_b_tl=vec2(pattern_b.xy);vec2 pattern_b_br=vec2(pattern_b.zw);highp vec2 pos_b=mix(pattern_b_tl*texel_size-texel_size,pattern_b_br*texel_size+texel_size,vec2(x,y));vec4 color_b=textureLodCustom(u_image,pos_b,lod_pos);color=color*(1.0-u_pattern_transition)+color_b*u_pattern_transition;\n#endif\n#ifdef RENDER_LINE_TRIM_OFFSET\nhighp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=v_uv[2];if (trim_end > trim_start) {highp float start_transition=max(0.0,min(1.0,(line_progress-trim_start)/max(u_trim_fade_range[0],1.0e-9)));highp float end_transition=max(0.0,min(1.0,(trim_end-line_progress)/max(u_trim_fade_range[1],1.0e-9)));highp float transition_factor=min(start_transition,end_transition);color=mix(color,color.a*u_trim_color,transition_factor);}\n#endif\n#ifdef LINE_JOIN_NONE\nhighp float pattern_len=pattern_size/aspect;highp float segment_phase=pattern_len-mod(v_linesofar-v_pattern_data.x+pattern_len,pattern_len);highp float visible_start=segment_phase-step(pattern_len*0.5,segment_phase)*pattern_len;highp float visible_end=floor((v_pattern_data.y-segment_phase)/pattern_len)*pattern_len+segment_phase;visible_end+=step(pattern_len*0.5,v_pattern_data.y-visible_end)*pattern_len;if (v_pattern_data.x < visible_start || v_pattern_data.x >=visible_end) {color=vec4(0.0);}\n#endif\n#ifdef LIGHTING_3D_MODE\ncolor=apply_lighting_with_emission_ground(color,emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);\n#ifdef ELEVATED_ROADS\ncolor.rgb*=mix(v_road_z_offset !=0.0 ? u_ground_shadow_factor : vec3(1.0),vec3(1.0),light);\n#else\ncolor.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ncolor*=(alpha*opacity*u_opacity_multiplier);if (u_alpha_discard_threshold !=0.0) {if (color.a < u_alpha_discard_threshold) {discard;}}\n#ifdef INDICATOR_CUTOUT\ncolor=applyCutout(color,v_z_offset);\n#endif\nglFragColor=color;\n#ifdef DUAL_SOURCE_BLENDING\nglFragColorSrc1=vec4(vec3(0.0),emissive_strength);\n#else\n#ifdef USE_MRT1\nout_Target1=vec4(emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);\n#endif\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#define scale 0.015873016\nin ivec2 a_pos_normal;in uvec4 a_data;\n#if defined(ELEVATED) || defined(ELEVATED_ROADS)\nin vec4 a_z_offset_width;\n#endif\n#ifdef ELEVATION_GROUND_SCALE\nin float a_elevation_ground_scale;\n#endif\n#ifdef RENDER_LINE_TRIM_OFFSET\nin highp vec3 a_packed;\n#endif\nin highp float a_linesofar;\n#ifdef LINE_JOIN_NONE\nin highp vec3 a_pattern_data;out vec2 v_pattern_data;\n#endif\n#ifdef INDICATOR_CUTOUT\nout highp float v_z_offset;\n#endif\nuniform mat4 u_matrix;uniform float u_tile_units_to_pixels;uniform vec2 u_units_to_pixels;uniform mat2 u_pixels_to_tile_units;uniform float u_device_pixel_ratio;uniform float u_width_scale;uniform float u_floor_width_scale;\n#ifdef ELEVATED\nuniform lowp float u_zbias_factor;uniform lowp float u_tile_to_meter;float sample_elevation(vec2 apos) {\n#ifdef ELEVATION_REFERENCE_SEA\nreturn 0.0;\n#else\nreturn elevation(apos);\n#endif\n}\n#endif\nout vec2 v_normal;out vec2 v_width2;out highp float v_linesofar;out float v_gamma_scale;out float v_width;\n#ifdef RENDER_LINE_TRIM_OFFSET\nout highp vec3 v_uv;\n#endif\n#ifdef ELEVATED_ROADS\nout highp float v_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\n#pragma mapbox: define mediump float blur\n#pragma mapbox: define mediump float opacity\n#pragma mapbox: define mediump float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define mediump float floorwidth\n#pragma mapbox: define mediump uvec4 pattern\n#ifdef LINE_PATTERN_TRANSITION\n#pragma mapbox: define mediump uvec4 pattern_b\n#endif\n#pragma mapbox: define mediump float pixel_ratio\n#pragma mapbox: define lowp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize mediump float blur\n#pragma mapbox: initialize mediump float opacity\n#pragma mapbox: initialize mediump float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize mediump float floorwidth\n#pragma mapbox: initialize mediump uvec4 pattern\n#ifdef LINE_PATTERN_TRANSITION\n#pragma mapbox: initialize mediump uvec4 pattern_b\n#endif\n#pragma mapbox: initialize mediump float pixel_ratio\n#pragma mapbox: initialize lowp float emissive_strength\nfloat a_z_offset;\n#if defined(ELEVATED) || defined(ELEVATED_ROADS)\na_z_offset=a_z_offset_width.x;\n#endif\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=vec2(a_data.xy)-128.0;float a_direction=float(a_data.z & 3u)-1.0;vec2 pos_normal=vec2(a_pos_normal);vec2 pos=floor(pos_normal*0.5);vec2 normal=pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=(u_width_scale*width)/2.0;offset=-1.0*offset*u_width_scale;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);vec2 dist=outset*a_extrude*scale;float u=0.5*a_direction;float t=1.0-abs(u);vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float hidden=float(opacity==0.0);vec2 extrude=dist*u_pixels_to_tile_units;vec4 projected_extrude=u_matrix*vec4(extrude,0.0,0.0);vec2 projected_extrude_xy=projected_extrude.xy;\n#ifdef ELEVATED_ROADS\nv_road_z_offset=a_z_offset;gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,a_z_offset,1.0)+projected_extrude;\n#else\n#ifdef ELEVATED\nvec2 offsetTile=offset2*u_pixels_to_tile_units;vec2 offset_pos=pos+offsetTile;float ele=0.0;float scaled_z_offset=a_z_offset;\n#ifdef ELEVATION_GROUND_SCALE\nscaled_z_offset=a_z_offset*mix(1.0,u_exaggeration,a_elevation_ground_scale);\n#endif\n#ifdef CROSS_SLOPE_VERTICAL\nfloat top=pos_normal.y-2.0*floor(pos_normal.y*0.5);float line_height=2.0*u_tile_to_meter*outset*top*u_pixels_to_tile_units[1][1]+scaled_z_offset;ele=sample_elevation(offset_pos)+line_height;projected_extrude=vec4(0);\n#else\n#ifdef CROSS_SLOPE_HORIZONTAL\nfloat ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,max(ele1,ele2));ele=ele_max+scaled_z_offset;\n#else\nfloat ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,0.5*(ele1+ele2));ele=ele_max-ele0+ele1+scaled_z_offset;\n#endif\n#endif\ngl_Position=u_matrix*vec4(offset_pos,ele,1.0)+projected_extrude;float z=clamp(gl_Position.z/gl_Position.w,0.5,1.0);float zbias=max(0.00005,(pow(z,0.8)-z)*u_zbias_factor*u_exaggeration);gl_Position.z-=(gl_Position.w*zbias);gl_Position=mix(gl_Position,AWAY,hidden);\n#else\ngl_Position=mix(u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude,AWAY,hidden);\n#endif\n#endif\n#ifdef ELEVATED_ROADS\n#ifdef RENDER_SHADOWS\nvec3 shd_pos=vec3(pos+(offset2+dist)*u_pixels_to_tile_units,a_z_offset);vec3 shd_pos0=shd_pos;vec3 shd_pos1=shd_pos;\n#ifdef NORMAL_OFFSET\nvec3 shd_pos_offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=shd_pos_offset*shadow_normal_offset_multiplier0();shd_pos1+=shd_pos_offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#endif\n#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude_xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=mix(extrude_length_without_perspective/extrude_length_with_perspective,1.0,step(0.01,blur));\n#else\nv_gamma_scale=1.0;\n#endif\n#ifdef RENDER_LINE_TRIM_OFFSET\nhighp float a_uv_x=a_packed[0];highp float line_progress=a_packed[2];v_uv=vec3(a_uv_x,0.0,line_progress);\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=(floorwidth*u_floor_width_scale);\n#ifdef LINE_JOIN_NONE\nv_width=(floorwidth*u_floor_width_scale)+ANTIALIASING;mediump float pixels_to_tile_units=1.0/u_tile_units_to_pixels;mediump float pixel_ratio_inverse=1.0/pixel_ratio;mediump float aspect=v_width/(float(pattern.w-pattern.y)*pixel_ratio_inverse);highp float subt_multiple=float(pattern.z-pattern.x)*pixel_ratio_inverse*pixels_to_tile_units*aspect*32.0;highp float subt=floor(a_pattern_data.z/subt_multiple)*subt_multiple;float offset_sign=(fract(a_pattern_data.x)-0.5)*4.0;float line_progress_offset=offset_sign*v_width*0.5*pixels_to_tile_units;v_linesofar=(a_pattern_data.z-subt)+a_linesofar+line_progress_offset;v_pattern_data=vec2(a_pattern_data.x+line_progress_offset,a_pattern_data.y);\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n#ifdef INDICATOR_CUTOUT\nv_z_offset=a_z_offset;\n#endif\n}'),raster:Cs('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_raster_array.glsl"\nuniform float u_fade_t;uniform float u_opacity;uniform highp float u_raster_elevation;uniform highp float u_zoom_transition;in vec2 v_pos0;in vec2 v_pos1;in float v_depth;\n#ifdef PROJECTION_GLOBE_VIEW\nin float v_split_fade;\n#endif\nuniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;uniform float u_emissive_strength;\n#ifndef RASTER_ARRAY\nuniform highp sampler2D u_image0;uniform sampler2D u_image1;\n#endif\n#ifdef RASTER_COLOR\nuniform sampler2D u_color_ramp;uniform highp vec4 u_colorization_mix;uniform highp float u_colorization_offset;uniform vec2 u_texture_res;\n#endif\nvoid main() {vec4 color0,color1,color;vec2 value;\n#ifdef RASTER_COLOR\n#ifdef RASTER_ARRAY\n#ifdef RASTER_ARRAY_LINEAR\nvalue=mix(\nraTexture2D_image0_linear(v_pos0,u_texture_res,u_colorization_mix,u_colorization_offset),raTexture2D_image1_linear(v_pos1,u_texture_res,u_colorization_mix,u_colorization_offset),u_fade_t\n);\n#else\nvalue=mix(\nraTexture2D_image0_nearest(v_pos0,u_texture_res,u_colorization_mix,u_colorization_offset),raTexture2D_image1_nearest(v_pos1,u_texture_res,u_colorization_mix,u_colorization_offset),u_fade_t\n);\n#endif\nif (value.y > 0.0) value.x/=value.y;\n#else\ncolor=mix(texture(u_image0,v_pos0),texture(u_image1,v_pos1),u_fade_t);value=vec2(u_colorization_offset+dot(color.rgb,u_colorization_mix.rgb),color.a);\n#endif\ncolor=texture(u_color_ramp,vec2(value.x,0.5));if (color.a > 0.0) color.rgb/=color.a;color.a*=value.y;\n#else\ncolor0=texture(u_image0,v_pos0);color1=texture(u_image1,v_pos1);if (color0.a > 0.0) color0.rgb/=color0.a;if (color1.a > 0.0) color1.rgb/=color1.a;color=mix(color0,color1,u_fade_t);\n#endif\ncolor.a*=u_opacity;\n#ifdef GLOBE_POLES\ncolor.a*=1.0-smoothstep(0.0,0.05,u_zoom_transition);\n#endif\nvec3 rgb=color.rgb;rgb=vec3(\ndot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);vec3 out_color=mix(u_high_vec,u_low_vec,rgb);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(vec4(out_color,1.0),u_emissive_strength).rgb;\n#endif\n#ifdef FOG\nhighp float fog_limit_high_meters=1000000.0;highp float fog_limit_low_meters=600000.0;float fog_limit=1.0-smoothstep(fog_limit_low_meters,fog_limit_high_meters,u_raster_elevation);out_color=fog_dither(fog_apply(out_color,v_fog_pos,fog_limit));\n#endif\nglFragColor=vec4(out_color*color.a,color.a);\n#ifdef PROJECTION_GLOBE_VIEW\nglFragColor*=mix(1.0,1.0-smoothstep(0.0,0.05,u_zoom_transition),smoothstep(0.8,0.9,v_split_fade));\n#endif\n#ifdef RENDER_CUTOFF\nglFragColor=glFragColor*cutoff_opacity(u_cutoff_params,v_depth);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n#ifdef USE_MRT1\nout_Target1=vec4(u_emissive_strength*glFragColor.a,0.0,0.0,glFragColor.a);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform mat3 u_grid_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform vec2 u_perspective_transform;uniform vec2 u_texture_offset;uniform float u_raster_elevation;uniform float u_zoom_transition;uniform vec2 u_merc_center;\n#ifdef ELEVATED\nuniform lowp float u_zbias_factor;\n#endif\n#define GLOBE_UPSCALE GLOBE_RADIUS/6371008.8\n#ifdef GLOBE_POLES\nin vec3 a_globe_pos;in vec2 a_uv;\n#else\nin ivec2 a_pos;in uvec2 a_texture_pos;\n#endif\nout vec2 v_pos0;out vec2 v_pos1;out float v_depth;\n#ifdef PROJECTION_GLOBE_VIEW\nout float v_split_fade;\n#endif\nvoid main() {vec2 uv;\n#ifdef GLOBE_POLES\nvec3 globe_pos=a_globe_pos;uv=a_uv;float ele=u_raster_elevation;\n#ifdef ELEVATION_REFERENCE_GROUND\nele+=elevation(uv*EXTENT);\n#endif\nglobe_pos+=normalize(globe_pos)*ele*GLOBE_UPSCALE;gl_Position=u_matrix*u_globe_matrix*vec4(globe_pos,1.0);\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(a_globe_pos,1.0)).xyz);\n#endif\n#else\nvec4 world_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec2 texture_pos=vec2(a_texture_pos);uv=texture_pos/8192.0;vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float mercatorX=mercatorXfromLng(latLng[1]); \nfloat tiles=u_grid_matrix[0][2];if (tiles > 0.0) {float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];float uvY=mercatorY*tiles-idy;float uvX=mercatorX*tiles-idx;uv=vec2(uvX,uvY);}float ele=u_raster_elevation;\n#ifdef ELEVATION_REFERENCE_GROUND\nele+=elevation(uv*EXTENT)-decomposed_pos_and_skirt.z;\n#endif\nvec4 merc_world_pos=vec4(0.0); \nv_split_fade=0.0;if (u_zoom_transition > 0.0) {vec2 merc_pos=vec2(mercatorX,mercatorY);merc_world_pos=vec4(merc_pos,ele,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;float opposite_merc_center=mod(u_merc_center.x+0.5,1.0);float dist_from_poles=(abs(mercatorY-0.5)*2.0);float range=0.1;v_split_fade=abs(opposite_merc_center-mercatorX);v_split_fade=clamp(1.0-v_split_fade,0.0,1.0);v_split_fade=max(smoothstep(1.0-range,1.0,dist_from_poles),max(smoothstep(1.0-range,1.0,v_split_fade),smoothstep(1.0-range,1.0,1.0-v_split_fade)));}vec3 globe_pos=latLngToECEF(latLng.xy);globe_pos+=normalize(globe_pos)*ele*GLOBE_UPSCALE;vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);world_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition),1.0);\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n#else\nfloat ele=0.0;vec2 decodedPos=vec2(a_pos);\n#ifdef ELEVATION_REFERENCE_GROUND\nvec3 decomposedPosAndSkirt=decomposeToPosAndSkirt(a_pos);float skirt=decomposedPosAndSkirt.z;decodedPos=decomposedPosAndSkirt.xy;uv=decodedPos/8192.0;ele=elevation(decodedPos)-skirt;\n#else\nuv=vec2(a_texture_pos)/8192.0;\n#endif\nworld_pos=vec4(decodedPos,(u_raster_elevation+ele),1.0);\n#ifdef FOG\nv_fog_pos=fog_position(decodedPos);\n#endif\n#endif\nfloat w=1.0+dot(uv*EXTENT,u_perspective_transform);gl_Position=u_matrix*world_pos*w;\n#endif\nv_pos0=uv;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;v_pos0=u_texture_offset.x+u_texture_offset.y*v_pos0;v_pos1=u_texture_offset.x+u_texture_offset.y*v_pos1;\n#ifdef ELEVATED\nfloat z=clamp(gl_Position.z/gl_Position.w,0.5,1.0);float zbias=max(0.00005,(pow(z,0.8)-z)*u_zbias_factor);gl_Position.z-=(gl_Position.w*zbias);\n#endif\n#ifdef RENDER_CUTOFF\nv_depth=gl_Position.z;\n#endif\n}'),symbol:Cs('#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_indicator_cutout.fragment.glsl"\n#include "_prelude_feature_cutout.fragment.glsl"\n#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform sampler2D u_texture;\n#ifdef RENDER_TEXT_AND_SYMBOL\nuniform sampler2D u_texture_icon;\n#endif\nuniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;uniform bool u_is_sdf;uniform lowp float u_scale_factor;uniform lowp float u_opacity_multiplier;\n#ifdef ICON_TRANSITION\nuniform float u_icon_transition;\n#endif\n#ifdef COLOR_ADJUSTMENT\nuniform mat4 u_color_adj_mat;\n#endif\n#ifdef INDICATOR_CUTOUT\nin highp float v_z_offset;\n#else\n#ifdef RENDER_SHADOWS\nin highp float v_z_offset;\n#endif\n#endif\nin vec2 v_tex_a;\n#ifdef ICON_TRANSITION\nin vec2 v_tex_b;\n#endif\nin float v_draw_halo;in vec3 v_gamma_scale_size_fade_opacity;\n#ifdef RENDER_TEXT_AND_SYMBOL\nin float is_sdf;in vec2 v_tex_a_icon;\n#endif\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\n#ifdef APPLY_LUT_ON_GPU\nuniform highp sampler3D u_lutTexture;\n#endif\nin lowp float v_opacity;in lowp vec4 v_fill_np_color;in lowp vec4 v_halo_np_color;in lowp float v_halo_width;in lowp float v_halo_blur;\n#ifdef LIGHTING_3D_MODE\nin lowp float v_emissive_strength;\n#endif\nvoid main() {lowp float opacity=v_opacity;lowp vec4 fill_color=vec4(0.0);lowp vec4 halo_color=vec4(0.0);lowp float halo_width=0.0;lowp float halo_blur=0.0;if (u_is_sdf) {fill_color=vec4(v_fill_np_color.rgb*v_fill_np_color.a,v_fill_np_color.a);halo_color=vec4(v_halo_np_color.rgb*v_halo_np_color.a,v_halo_np_color.a);halo_width=v_halo_width;halo_blur=v_halo_blur;}lowp float emissive_strength=0.0;\n#ifdef LIGHTING_3D_MODE\nemissive_strength=v_emissive_strength;\n#endif\nvec4 out_color;float fade_opacity=v_gamma_scale_size_fade_opacity[2];\n#ifdef RENDER_TEXT_AND_SYMBOL\nif (is_sdf==ICON) {vec2 tex_icon=v_tex_a_icon;lowp float alpha=opacity*fade_opacity*u_opacity_multiplier;glFragColor=texture(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nreturn;}\n#endif\nvec2 cutout_factors=vec2(0.0);\n#ifdef FEATURE_CUTOUT\ncutout_factors=get_cutout_factors(gl_FragCoord);\n#endif\nif (u_is_sdf) {float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_gamma_scale_size_fade_opacity.x;float size=v_gamma_scale_size_fade_opacity.y;float fontScale=u_is_text ? size/24.0 : size;out_color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;bool draw_halo=v_draw_halo > 0.0;if (draw_halo) {out_color=halo_color;gamma=(halo_blur*u_scale_factor*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width*u_scale_factor/fontScale)/SDF_PX;}lowp float dist=texture(u_texture,v_tex_a).r;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);out_color*=alpha;} else {\n#ifdef ICON_TRANSITION\nvec4 a=texture(u_texture,v_tex_a)*(1.0-u_icon_transition);vec4 b=texture(u_texture,v_tex_b)*u_icon_transition;out_color=(a+b);\n#else\nout_color=texture(u_texture,v_tex_a);\n#endif\n#ifdef APPLY_LUT_ON_GPU\nout_color=applyLUT(u_lutTexture,out_color);\n#endif\n#ifdef COLOR_ADJUSTMENT\nout_color=u_color_adj_mat*out_color;\n#endif\n}out_color*=opacity*fade_opacity*u_opacity_multiplier;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);light=mix(light,1.0,cutout_factors.y);\n#ifdef TERRAIN\nout_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#else\nout_color.rgb*=mix(v_z_offset !=0.0 ? u_ground_shadow_factor : vec3(1.0),vec3(1.0),light);\n#endif\n#endif\n#endif\n#ifdef INDICATOR_CUTOUT\nout_color=applyCutout(out_color,v_z_offset);\n#endif\n#ifdef FEATURE_CUTOUT\nout_color=apply_feature_cutout(out_color,gl_FragCoord,cutout_factors.x,0.0);\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\n#define USING_APPEARANCE 1.0\nin ivec4 a_pos_offset;in uvec4 a_tex_size;in ivec4 a_pixeloffset;in vec4 a_projected_pos;in uint a_fade_opacity;\n#ifdef Z_OFFSET\nin float a_auto_z_offset;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nin ivec4 a_globe_anchor;in vec3 a_globe_normal;\n#endif\n#ifdef ICON_TRANSITION\nin uvec2 a_texb;\n#endif\n#ifdef OCCLUSION_QUERIES\nin float a_occlusion_query_opacity;\n#endif\n#ifdef ELEVATED_ROADS\nin vec3 a_x_axis;in vec3 a_y_axis;uniform float u_normal_scale;\n#endif\n#ifdef INDICATOR_CUTOUT\nout highp float v_z_offset;\n#else\n#ifdef RENDER_SHADOWS\nout highp float v_z_offset;\n#endif\n#endif\nuniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;\n#ifdef RENDER_SHADOWS\nuniform mat4 u_inv_matrix;\n#endif\nuniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_elevation_from_sea;uniform bool u_pitch_with_map;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_up_vector;\n#endif\n#ifdef RENDER_TEXT_AND_SYMBOL\nuniform vec2 u_texsize_icon;\n#endif\nuniform bool u_is_halo;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;\n#endif\nout vec2 v_tex_a;\n#ifdef ICON_TRANSITION\nout vec2 v_tex_b;\n#endif\nout float v_draw_halo;out vec3 v_gamma_scale_size_fade_opacity;\n#ifdef RENDER_TEXT_AND_SYMBOL\nout float is_sdf;out vec2 v_tex_a_icon;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\n#ifndef MAX_UBO_SIZE_VEC4\n#define MAX_UBO_SIZE_VEC4 1024u\n#endif\n#define SPP_HEADER_SIZE_VEC4 4u\nstruct SymbolPaintProperties {vec4 fill_np_color;vec4 halo_np_color;float opacity;float halo_width;float halo_blur;float emissive_strength;float occlusion_opacity;float z_offset;vec2 translate;};uniform lowp vec4 u_spp_fill_np_color;uniform lowp vec4 u_spp_halo_np_color;uniform lowp float u_spp_opacity;uniform lowp float u_spp_halo_width;uniform lowp float u_spp_halo_blur;uniform lowp float u_spp_emissive_strength;uniform lowp float u_spp_occlusion_opacity;uniform highp float u_spp_z_offset;uniform lowp vec2 u_spp_translate_rotation;uniform highp float u_spp_zoom_fraction;in float a_feature_index;layout(std140) uniform SymbolPaintPropertiesHeaderUniform {uvec4 header[SPP_HEADER_SIZE_VEC4];} u_spp_header;layout(std140) uniform SymbolPaintPropertiesUniform {vec4 properties[MAX_UBO_SIZE_VEC4];} u_spp_properties;layout(std140) uniform SymbolPaintPropertiesIndexUniform {uvec4 block_indices[MAX_UBO_SIZE_VEC4];} u_spp_index;out lowp float v_opacity;out lowp vec4 v_fill_np_color;out lowp vec4 v_halo_np_color;out lowp float v_halo_width;out lowp float v_halo_blur;\n#ifdef LIGHTING_3D_MODE\nout lowp float v_emissive_strength;\n#endif\nfloat zoomFactor(float zm,float zM) {if (zm==zM) return u_spp_zoom_fraction-zm >=0.0 ? 1.0 : 0.0;return clamp((u_spp_zoom_fraction-zm)/(zM-zm),0.0,1.0);}vec4 readColor(uint base,bool isDataDriven,uint offsetVec4,uint dzr,vec2 headerZoom,vec4 fallbackValue) {if (!isDataDriven) return fallbackValue;vec4 value=u_spp_properties.properties[base+offsetVec4];vec2 blockZoom=u_spp_properties.properties[base+offsetVec4+dzr].xy;vec2 zr=mix(headerZoom,blockZoom,float(dzr));return unpack_mix_color(value,zoomFactor(zr.x,zr.y));}uint uvec4At(uvec4 v,uint index) {return (index==0u) ? v.x :\n(index==1u) ? v.y :\n(index==2u) ? v.z : v.w;}float readScalar(uint base,bool isDataDriven,uint offsetVec4,float fallbackValue) {if (!isDataDriven) return fallbackValue;vec4 slot=u_spp_properties.properties[base+offsetVec4];return unpack_mix_vec2(slot.xy,zoomFactor(slot.z,slot.w));}vec2 readTranslate(uint base,bool isDataDriven,uint offsetVec4,uint dzr) {if (!isDataDriven) return vec2(0.0);vec4 value=u_spp_properties.properties[base+offsetVec4];vec2 blockZoom=u_spp_properties.properties[base+offsetVec4+dzr].xy;float t=zoomFactor(blockZoom.x,blockZoom.y)*float(dzr);return mix(value.xy,value.zw,t);}SymbolPaintProperties readSymbolPaintProperties() {uint dataDrivenMask=u_spp_header.header[0][0];uint dzrMask =u_spp_header.header[0][1];uint blockSizeVec4 =u_spp_header.header[0][2];uint fillColorDzr=dzrMask & 1u;uint haloColorDzr=(dzrMask >> 1u) & 1u;vec2 fillColorHeaderZoom=uintBitsToFloat(u_spp_header.header[3].xy);vec2 haloColorHeaderZoom=uintBitsToFloat(u_spp_header.header[3].zw);uint featureIndex=uint(a_feature_index);uvec4 indexSlot=u_spp_index.block_indices[featureIndex/4u];uint base=uvec4At(indexSlot,featureIndex % 4u)*blockSizeVec4;SymbolPaintProperties props;props.fill_np_color =readColor(base,(dataDrivenMask & (1u << 0u)) !=0u,u_spp_header.header[0][3],fillColorDzr,fillColorHeaderZoom,u_spp_fill_np_color);props.halo_np_color =readColor(base,(dataDrivenMask & (1u << 1u)) !=0u,u_spp_header.header[1][0],haloColorDzr,haloColorHeaderZoom,u_spp_halo_np_color);props.opacity =readScalar(base,(dataDrivenMask & (1u << 2u)) !=0u,u_spp_header.header[1][1],u_spp_opacity);props.halo_width =readScalar(base,(dataDrivenMask & (1u << 3u)) !=0u,u_spp_header.header[1][2],u_spp_halo_width);props.halo_blur =readScalar(base,(dataDrivenMask & (1u << 4u)) !=0u,u_spp_header.header[1][3],u_spp_halo_blur);props.emissive_strength=readScalar(base,(dataDrivenMask & (1u << 5u)) !=0u,u_spp_header.header[2][0],u_spp_emissive_strength);props.occlusion_opacity=readScalar(base,(dataDrivenMask & (1u << 6u)) !=0u,u_spp_header.header[2][1],u_spp_occlusion_opacity);props.z_offset =readScalar(base,(dataDrivenMask & (1u << 7u)) !=0u,u_spp_header.header[2][2],u_spp_z_offset);uint translateDzr=(dzrMask >> 8u) & 1u;props.translate =readTranslate(base,(dataDrivenMask & (1u << 8u)) !=0u,u_spp_header.header[2][3],translateDzr);return props;}vec2 unpack_opacity(uint packedOpacity) {return vec2(float(packedOpacity/2u)/127.0,float(packedOpacity & 1u));}void main() {SymbolPaintProperties paint_properties=readSymbolPaintProperties();lowp float opacity=paint_properties.opacity;v_opacity=opacity;v_fill_np_color=paint_properties.fill_np_color;v_halo_np_color=paint_properties.halo_np_color;v_halo_width=paint_properties.halo_width;v_halo_blur=paint_properties.halo_blur;\n#ifdef LIGHTING_3D_MODE\nv_emissive_strength=paint_properties.emissive_strength;\n#endif\nlowp float occlusion_opacity=paint_properties.occlusion_opacity;highp float z_offset=paint_properties.z_offset;vec2 a_pos=vec2(a_pos_offset.xy);vec2 a_offset=vec2(a_pos_offset.zw);vec2 a_tex=vec2(a_tex_size.xy);vec2 a_size=vec2(a_tex_size.zw);float a_size_min=floor(a_size[0]*0.5);float a_size_max= floor(a_size[1]*0.5);float a_apperance=a_size[1]-2.0*a_size_max;vec2 a_pxoffset=vec2(a_pixeloffset.xy);vec2 a_min_font_scale=vec2(a_pixeloffset.zw)/256.0;highp float segment_angle=-a_projected_pos[3];float size;if (a_apperance==USING_APPEARANCE) {size=a_size_max/128.0;} else if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size_max,u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;float e=u_elevation_from_sea ? z_offset : z_offset+elevation(tile_anchor);\n#ifdef Z_OFFSET\ne+=a_auto_z_offset;\n#endif\nvec3 h=elevationVector(tile_anchor)*e;float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;vec3 world_pos_globe;\n#ifdef PROJECTION_GLOBE_VIEW\nmercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos_globe=vec3(a_globe_anchor)+h;world_pos=mix_globe_mercator(world_pos_globe,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;\n#else\nworld_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetprojected_point;vec2 a;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetprojected_point=u_matrix*vec4(vec3(a_globe_anchor)+displacement,1);vec4 projected_point_globe=u_matrix*vec4(world_pos_globe,1);a=projected_point_globe.xy/projected_point_globe.w;\n#else\noffsetprojected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);a=projected_point.xy/projected_point.w;\n#endif\nvec2 b=offsetprojected_point.xy/offsetprojected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;\n#ifdef PROJECTION_GLOBE_VIEW\n#ifdef PROJECTED_POS_ON_VIEWPORT\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xyz+h,1.0);\n#else\nvec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz,mercator_pos,u_zoom_transition)+h;projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);\n#endif\n#else\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*max(a_min_font_scale,font_scale)+a_pxoffset/16.0);\n#ifdef TERRAIN\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\n#endif\n#ifdef Z_OFFSET\nz+=u_pitch_with_map ? a_auto_z_offset+z_offset : 0.0;\n#else\nz+=u_pitch_with_map ? z_offset : 0.0;\n#endif\nfloat occlusion_fade=globe_occlusion_fade;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float out_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));\n#ifdef DEPTH_OCCLUSION\nfloat depth_occlusion=occlusionFadeMultiSample(projected_point);float depth_occlusion_multplier=mix(occlusion_opacity,1.0,depth_occlusion);out_fade_opacity*=depth_occlusion_multplier;\n#endif\n#ifdef OCCLUSION_QUERIES\nfloat occludedFadeMultiplier=mix(occlusion_opacity,1.0,a_occlusion_query_opacity);out_fade_opacity*=occludedFadeMultiplier;\n#endif\n#ifdef Z_TEST_OCCLUSION\nout_fade_opacity*=occlusion_opacity;\n#endif\nfloat alpha=opacity*out_fade_opacity;float hidden=float(alpha==0.0 || projected_point.w <=0.0 || occlusion_fade==0.0);vec3 pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);pos=projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y;\n#else\n#ifdef ELEVATED_ROADS\nvec3 xAxis=vec3(a_x_axis.xy,a_x_axis.z*u_normal_scale);vec3 yAxis=vec3(a_y_axis.xy,a_y_axis.z*u_normal_scale);pos=projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y;\n#else\npos=vec3(projected_pos.xy/projected_pos.w+offset,z);\n#endif\n#endif\ngl_Position=mix(u_coord_matrix*vec4(pos,1.0),AWAY,hidden);{vec2 tr=paint_properties.translate;vec2 rotated_tr=vec2(\nu_spp_translate_rotation.x*tr.x-u_spp_translate_rotation.y*tr.y,u_spp_translate_rotation.y*tr.x+u_spp_translate_rotation.x*tr.y\n);gl_Position.xy+=(u_coord_matrix*vec4(rotated_tr,0.0,0.0)).xy;}float gamma_scale=gl_Position.w;v_draw_halo=(u_is_halo && float(gl_InstanceID)==0.0) ? 1.0 : 0.0;v_gamma_scale_size_fade_opacity=vec3(gamma_scale,size,out_fade_opacity);v_tex_a=a_tex/u_texsize;\n#ifdef RENDER_TEXT_AND_SYMBOL\nis_sdf=a_size[0]-2.0*a_size_min;v_tex_a_icon=a_tex/u_texsize_icon;\n#endif\n#ifdef ICON_TRANSITION\nv_tex_b=vec2(a_texb)/u_texsize;\n#endif\n#ifdef RENDER_SHADOWS\nvec4 shd_pos=u_inv_matrix*vec4(pos,1.0);vec3 shd_pos0=shd_pos.xyz;vec3 shd_pos1=shd_pos.xyz;\n#ifdef NORMAL_OFFSET\nvec3 shd_pos_offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=shd_pos_offset*shadow_normal_offset_multiplier0();shd_pos1+=shd_pos_offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef INDICATOR_CUTOUT\nv_z_offset=e;\n#else\n#ifdef RENDER_SHADOWS\nv_z_offset=e;\n#endif\n#endif\n}'),terrainRaster:Cs('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform sampler2D u_image0;\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nuniform sampler2D u_image1;uniform float u_emissive_texture_available;\n#endif\nin vec2 v_pos0;\n#ifdef FOG\nin float v_fog_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nin vec4 v_pos_light_view_0;in vec4 v_pos_light_view_1;\n#endif\nuniform vec3 u_ground_shadow_factor;void main() {vec4 image_color=texture(u_image0,v_pos0);vec4 color;\n#ifdef LIGHTING_3D_MODE\nconst vec3 normal=vec3(0.0,0.0,1.0);\n#ifdef RENDER_SHADOWS\nfloat cutoffOpacity=1.0;\n#ifdef RENDER_CUTOFF\ncutoffOpacity=cutoff_opacity(u_cutoff_params,1.0/gl_FragCoord.w);\n#endif\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nfloat emissive_strength=u_emissive_texture_available > 0.5 ? texture(u_image1,v_pos0).r : image_color.a;vec3 unlit_base=image_color.rgb*(1.0-emissive_strength);vec3 emissive_base=image_color.rgb*emissive_strength;float ndotl=u_shadow_direction.z;float occlusion=ndotl < 0.0 ? 1.0 : shadow_occlusion(v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w,0.0);ndotl=max(0.0,ndotl);vec3 lit=apply_lighting(unlit_base,normal,mix(1.0,(1.0-(u_shadow_intensity*occlusion))*ndotl,cutoffOpacity));vec3 emissive=compute_emissive_draped(emissive_base,1.0-u_shadow_intensity,occlusion,u_ground_shadow_factor);color.rgb=lit+emissive;color.a=1.0;\n#else\nfloat lighting_factor=shadowed_light_factor_normal_unbiased(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);color=apply_lighting(image_color,normal,mix(1.0,lighting_factor,cutoffOpacity));\n#endif\n#else\nfloat lighting_factor=u_lighting_directional_dir.z;color=apply_lighting(image_color,normal,lighting_factor);\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nfloat emissive_strength=u_emissive_texture_available > 0.5 ? texture(u_image1,v_pos0).r : image_color.a;color.rgb=mix(color.rgb,image_color.rgb,emissive_strength);color.a=1.0;\n#endif\n#endif\n#else\ncolor=image_color;\n#endif\n#ifdef FOG\n#ifdef ZERO_EXAGGERATION\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#else\ncolor=fog_dither(fog_apply_from_vert(color,v_fog_opacity));\n#endif\n#endif\nglFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_matrix;uniform float u_skirt_height;in ivec2 a_pos;out vec2 v_pos0;\n#ifdef FOG\nout float v_fog_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out vec4 v_pos_light_view_0;out vec4 v_pos_light_view_1;\n#endif\nvoid main() {vec3 decomposedPosAndSkirt=decomposeToPosAndSkirt(a_pos);float skirt=decomposedPosAndSkirt.z;vec2 decodedPos=decomposedPosAndSkirt.xy;float elevation=elevation(decodedPos)-skirt*u_skirt_height;v_pos0=decodedPos/8192.0;\n#ifdef VIEWPORT_ORIGIN_TOP_LEFT\nv_pos0.y=1.0-v_pos0.y;\n#endif\ngl_Position=u_matrix*vec4(decodedPos,elevation,1.0);\n#ifdef FOG\n#ifdef ZERO_EXAGGERATION\nv_fog_pos=fog_position(decodedPos);\n#else\nv_fog_opacity=fog(fog_position(vec3(decodedPos,elevation)));\n#endif\n#endif\n#ifdef RENDER_SHADOWS\nvec3 pos=vec3(decodedPos,elevation);v_pos_light_view_0=u_light_matrix_0*vec4(pos,1.);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1.);\n#endif\n}'),terrainDepth:Cs("precision highp float;in float v_depth;void main() {glFragColor=pack_depth(v_depth);}",'#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_matrix;in ivec2 a_pos;out float v_depth;void main() {float elevation=elevation(vec2(a_pos));gl_Position=u_matrix*vec4(a_pos,elevation,1.0);v_depth=gl_Position.z/gl_Position.w;}'),skybox:Cs('#include "_prelude_fog.fragment.glsl"\nin lowp vec3 v_uv;uniform lowp samplerCube u_cubemap;uniform lowp float u_opacity;uniform highp float u_temporal_offset;uniform highp vec3 u_sun_direction;float sun_disk(highp vec3 ray_direction,highp vec3 sun_direction) {highp float cos_angle=dot(normalize(ray_direction),sun_direction);const highp float cos_sun_angular_diameter=0.99996192306;const highp float smoothstep_delta=1e-5;return smoothstep(\ncos_sun_angular_diameter-smoothstep_delta,cos_sun_angular_diameter+smoothstep_delta,cos_angle);}float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec3 uv=v_uv;const float y_bias=0.015;uv.y+=y_bias;uv.y=pow(abs(uv.y),1.0/5.0);uv.y=map(uv.y,0.0,1.0,-1.0,1.0);vec3 sky_color=texture(u_cubemap,uv).rgb;\n#ifdef FOG\nsky_color=fog_apply_sky_gradient(v_uv.xzy,sky_color);\n#endif\nsky_color+=0.1*sun_disk(v_uv,u_sun_direction);glFragColor=vec4(sky_color*u_opacity,u_opacity);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n}',xEt),skyboxGradient:Cs('#include "_prelude_fog.fragment.glsl"\nin highp vec3 v_uv;uniform lowp sampler2D u_color_ramp;uniform highp vec3 u_center_direction;uniform lowp float u_radius;uniform lowp float u_opacity;uniform highp float u_temporal_offset;void main() {float progress=acos(dot(normalize(v_uv),u_center_direction))/u_radius;vec4 color=texture(u_color_ramp,vec2(progress,0.5));\n#ifdef FOG\ncolor.rgb=fog_apply_sky_gradient(v_uv.xzy,color.rgb/color.a)*color.a;\n#endif\ncolor*=u_opacity;glFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n}',xEt),skyboxCapture:Cs("\nin highp vec3 v_position;uniform highp float u_sun_intensity;uniform highp float u_luminance;uniform lowp vec3 u_sun_direction;uniform highp vec4 u_color_tint_r;uniform highp vec4 u_color_tint_m;precision highp float;\n#define BETA_R vec3(5.5e-6,13.0e-6,22.4e-6)\n#define BETA_M vec3(21e-6,21e-6,21e-6)\n#define MIE_G 0.76\n#define DENSITY_HEIGHT_SCALE_R 8000.0\n#define DENSITY_HEIGHT_SCALE_M 1200.0\n#define PLANET_RADIUS 6360e3\n#define ATMOSPHERE_RADIUS 6420e3\n#define SAMPLE_STEPS 10\n#define DENSITY_STEPS 4\nfloat ray_sphere_exit(vec3 orig,vec3 dir,float radius) {float a=dot(dir,dir);float b=2.0*dot(dir,orig);float c=dot(orig,orig)-radius*radius;float d=sqrt(b*b-4.0*a*c);return (-b+d)/(2.0*a);}vec3 extinction(vec2 density) {return exp(-vec3(BETA_R*u_color_tint_r.a*density.x+BETA_M*u_color_tint_m.a*density.y));}vec2 local_density(vec3 point) {float height=max(length(point)-PLANET_RADIUS,0.0);float exp_r=exp(-height/DENSITY_HEIGHT_SCALE_R);float exp_m=exp(-height/DENSITY_HEIGHT_SCALE_M);return vec2(exp_r,exp_m);}float phase_ray(float cos_angle) {return (3.0/(16.0*PI))*(1.0+cos_angle*cos_angle);}float phase_mie(float cos_angle) {return (3.0/(8.0*PI))*((1.0-MIE_G*MIE_G)*(1.0+cos_angle*cos_angle))/((2.0+MIE_G*MIE_G)*pow(1.0+MIE_G*MIE_G-2.0*MIE_G*cos_angle,1.5));}vec2 density_to_atmosphere(vec3 point,vec3 light_dir) {float ray_len=ray_sphere_exit(point,light_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(DENSITY_STEPS);vec2 density_point_to_atmosphere=vec2(0.0);for (int i=0; i < DENSITY_STEPS;++i) {vec3 point_on_ray=point+light_dir*((float(i)+0.5)*step_len);density_point_to_atmosphere+=local_density(point_on_ray)*step_len;;}return density_point_to_atmosphere;}vec3 atmosphere(vec3 ray_dir,vec3 sun_direction,float sun_intensity) {vec2 density_orig_to_point=vec2(0.0);vec3 scatter_r=vec3(0.0);vec3 scatter_m=vec3(0.0);vec3 origin=vec3(0.0,PLANET_RADIUS,0.0);float ray_len=ray_sphere_exit(origin,ray_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(SAMPLE_STEPS);for (int i=0; i < SAMPLE_STEPS;++i) {vec3 point_on_ray=origin+ray_dir*((float(i)+0.5)*step_len);vec2 density=local_density(point_on_ray)*step_len;density_orig_to_point+=density;vec2 density_point_to_atmosphere=density_to_atmosphere(point_on_ray,sun_direction);vec2 density_orig_to_atmosphere=density_orig_to_point+density_point_to_atmosphere;vec3 extinction=extinction(density_orig_to_atmosphere);scatter_r+=density.x*extinction;scatter_m+=density.y*extinction;}float cos_angle=dot(ray_dir,sun_direction);float phase_r=phase_ray(cos_angle);float phase_m=phase_mie(cos_angle);vec3 beta_r=BETA_R*u_color_tint_r.rgb*u_color_tint_r.a;vec3 beta_m=BETA_M*u_color_tint_m.rgb*u_color_tint_m.a;return (scatter_r*phase_r*beta_r+scatter_m*phase_m*beta_m)*sun_intensity;}const float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;vec3 uncharted2_tonemap(vec3 x) {return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}void main() {vec3 ray_direction=v_position;ray_direction.y=pow(ray_direction.y,5.0);const float y_bias=0.015;ray_direction.y+=y_bias;vec3 color=atmosphere(normalize(ray_direction),u_sun_direction,u_sun_intensity);float white_scale=1.0748724675633854;color=uncharted2_tonemap((log2(2.0/pow(u_luminance,4.0)))*color)*white_scale;glFragColor=vec4(color,1.0);}","in highp vec3 a_pos_3f;uniform mat3 u_matrix_3f;out highp vec3 v_position;float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec4 pos=vec4(u_matrix_3f*a_pos_3f,1.0);v_position=pos.xyz;\n#ifndef VIEWPORT_ORIGIN_TOP_LEFT\nv_position.y*=-1.0;\n#endif\nv_position.y=map(v_position.y,-1.0,1.0,0.0,1.0);gl_Position=vec4(a_pos_3f.xy,0.0,1.0);}"),globeRaster:Cs('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform sampler2D u_image0;\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nuniform sampler2D u_image1;uniform float u_emissive_texture_available;\n#endif\nuniform float u_far_z_cutoff;in vec2 v_pos0;\n#ifndef FOG\nuniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform vec2 u_viewport;\n#endif\nvoid main() {vec4 color;\n#ifdef CUSTOM_ANTIALIASING\nhighp vec2 uv=gl_FragCoord.xy/u_viewport;FLIP_VIEWPORT_UV_Y(uv);highp vec3 ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float norm_dist_from_center=1.0-length(closest_point-u_globe_pos)/u_globe_radius;const float antialias_pixel=2.0;highp float antialias_factor=antialias_pixel*fwidth(norm_dist_from_center);highp float antialias=smoothstep(0.0,antialias_factor,norm_dist_from_center);vec4 raster=texture(u_image0,v_pos0);\n#ifdef LIGHTING_3D_MODE\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nfloat emissive_strength=u_emissive_texture_available > 0.5 ? texture(u_image1,v_pos0).r : raster.a;raster=apply_lighting_with_emission_ground(raster,emissive_strength);color=vec4(clamp(raster.rgb,vec3(0),vec3(1))*antialias,antialias);\n#else\nraster=apply_lighting_ground(raster);color=vec4(raster.rgb*antialias,raster.a*antialias);\n#endif\n#else\ncolor=vec4(raster.rgb*antialias,raster.a*antialias);\n#endif\n#else\ncolor=texture(u_image0,v_pos0);\n#ifdef LIGHTING_3D_MODE\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nfloat emissive_strength=u_emissive_texture_available > 0.5 ? texture(u_image1,v_pos0).r : color.a;color=apply_lighting_with_emission_ground(color,emissive_strength);color.a=1.0;\n#else\ncolor=apply_lighting_ground(color);\n#endif\n#endif\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ncolor*=1.0-step(u_far_z_cutoff,1.0/gl_FragCoord.w);glFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_proj_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;\n#ifndef GLOBE_POLES\nuniform mat4 u_merc_matrix;\n#endif\nuniform float u_zoom_transition;uniform vec2 u_merc_center;\n#ifndef GLOBE_POLES\nuniform mat3 u_grid_matrix;\n#endif\nuniform float u_skirt_height;\n#ifdef GLOBE_POLES\nin vec3 a_globe_pos;in vec2 a_uv;\n#else\nin ivec2 a_pos;\n#endif\nout vec2 v_pos0;void main() {\n#ifdef GLOBE_POLES\nvec3 globe_pos=a_globe_pos;vec2 uv=a_uv;\n#else\nfloat tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float uvY=mercatorY*tiles-idy;float mercatorX=mercatorXfromLng(latLng[1]);float uvX=mercatorX*tiles-idx;vec3 globe_pos=latLngToECEF(latLng.xy);vec2 merc_pos=vec2(mercatorX,mercatorY);vec2 uv=vec2(uvX,uvY);\n#endif\nv_pos0=uv;\n#ifdef VIEWPORT_ORIGIN_TOP_LEFT\nv_pos0.y=1.0-v_pos0.y;\n#endif\nvec2 tile_pos=uv*EXTENT;vec3 globe_derived_up_vector=normalize(globe_pos)*u_tile_up_scale;\n#ifdef GLOBE_POLES\nvec3 up_vector=globe_derived_up_vector;\n#else\nvec3 up_vector=elevationVector(tile_pos);\n#endif\nfloat height=elevation(tile_pos);globe_pos+=up_vector*height;\n#ifndef GLOBE_POLES\nglobe_pos-=globe_derived_up_vector*u_skirt_height*decomposed_pos_and_skirt.z;\n#endif\n#ifdef GLOBE_POLES\nvec4 interpolated_pos=u_globe_matrix*vec4(globe_pos,1.0);\n#else\nvec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {merc_world_pos=vec4(merc_pos,height-u_skirt_height*decomposed_pos_and_skirt.z,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition),1.0);\n#endif\ngl_Position=u_proj_matrix*interpolated_pos;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n}'),globeAtmosphere:Cs('#include "_prelude_fog.fragment.glsl"\nuniform float u_transition;uniform highp float u_fadeout_range;uniform highp float u_temporal_offset;uniform vec4 u_atmosphere_fog_color;uniform vec4 u_high_color;uniform vec4 u_space_color;uniform float u_horizon_angle;in highp vec3 v_ray_dir;in highp vec3 v_horizon_dir;void main() {highp vec3 dir=normalize(v_ray_dir);float globe_pos_dot_dir;\n#ifdef PROJECTION_GLOBE_VIEW\nglobe_pos_dot_dir=dot(u_globe_pos,dir);highp vec3 closest_point_forward=abs(globe_pos_dot_dir)*dir;float norm_dist_from_center=length(closest_point_forward-u_globe_pos)/u_globe_radius;if (norm_dist_from_center < 0.98) {\n#ifdef ALPHA_PASS\nglFragColor=vec4(0,0,0,0);return;\n#else\n#ifdef NATIVE\nglFragColor=vec4(1,1,1,1);\n#else\nglFragColor=vec4(0,0,0,1);\n#endif\nreturn;\n#endif\n}\n#endif\nhighp vec3 horizon_dir=normalize(v_horizon_dir);float horizon_angle_mercator=dir.y < horizon_dir.y ?\n0.0 : max(acos(clamp(dot(dir,horizon_dir),-1.0,1.0)),0.0);float horizon_angle;\n#ifdef PROJECTION_GLOBE_VIEW\nhighp vec3 closest_point=globe_pos_dot_dir*dir;highp float closest_point_to_center=length(closest_point-u_globe_pos);highp float theta=asin(clamp(closest_point_to_center/length(u_globe_pos),-1.0,1.0));horizon_angle=globe_pos_dot_dir < 0.0 ?\nPI-theta-u_horizon_angle : theta-u_horizon_angle;float angle_t=pow(u_transition,10.0);horizon_angle=mix(horizon_angle,horizon_angle_mercator,angle_t);\n#else\nhorizon_angle=horizon_angle_mercator;\n#endif\nhorizon_angle/=PI;float t=exp(-horizon_angle/u_fadeout_range);float alpha_0=u_atmosphere_fog_color.a;float alpha_1=u_high_color.a;float alpha_2=u_space_color.a;vec3 color_stop_0=u_atmosphere_fog_color.rgb;vec3 color_stop_1=u_high_color.rgb;vec3 color_stop_2=u_space_color.rgb;\n#ifdef ALPHA_PASS\nfloat a0=mix(alpha_2,1.0,alpha_1);float a1=mix(a0,1.0,alpha_0);float a2=mix(a0,a1,t);float a =mix(alpha_2,a2,t);glFragColor=vec4(1.0,1.0,1.0,a);\n#else\nvec3 c0=mix(color_stop_2,color_stop_1,alpha_1);vec3 c1=mix(c0,color_stop_0,alpha_0);vec3 c2=mix(c0,c1,t);vec3 c=c2;glFragColor=vec4(c*t,t);\n#endif\n}',"in vec3 a_pos;in vec2 a_uv;uniform vec3 u_frustum_tl;uniform vec3 u_frustum_tr;uniform vec3 u_frustum_br;uniform vec3 u_frustum_bl;uniform float u_horizon;out highp vec3 v_ray_dir;out highp vec3 v_horizon_dir;void main() {v_ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,a_uv.x),mix(u_frustum_bl,u_frustum_br,a_uv.x),a_uv.y);v_horizon_dir=mix(\nmix(u_frustum_tl,u_frustum_bl,u_horizon),mix(u_frustum_tr,u_frustum_br,u_horizon),a_uv.x);gl_Position=vec4(a_pos,1.0);}"),stars:Cs("in highp vec2 v_uv;in mediump float v_intensity;float shapeCircle(in vec2 uv)\n{float beginFade=0.6;float lengthFromCenter=length(v_uv);return 1.0-clamp((lengthFromCenter-beginFade)/(1.0-beginFade),0.0,1.0);}void main() {float alpha=shapeCircle(v_uv);vec3 color=vec3(1.0,1.0,1.0);alpha*=v_intensity;glFragColor=vec4(color*alpha,alpha);HANDLE_WIREFRAME_DEBUG;}","\nin vec3 a_pos_3f;in vec2 a_uv;in float a_size_scale;in float a_opacity;uniform mat4 u_matrix;uniform vec3 u_up;uniform vec3 u_right;uniform float u_intensity_multiplier;out highp vec2 v_uv;out mediump float v_intensity;void main() {v_uv=a_uv;v_intensity=a_opacity*u_intensity_multiplier;vec3 pos=a_pos_3f;pos+=a_uv.x*u_right*a_size_scale;pos+=a_uv.y*u_up*a_size_scale;gl_Position=u_matrix*vec4(pos,1.0);}"),occlusion:Cs("uniform vec4 u_color;void main() {glFragColor=u_color;}",'#include "_prelude_terrain.vertex.glsl"\nin highp vec2 a_offset_xy;uniform highp vec3 u_anchorPos;uniform mat4 u_matrix;uniform vec2 u_screenSizePx;uniform vec2 u_occluderSizePx;void main() {vec3 world_pos=u_anchorPos;\n#ifdef TERRAIN\nfloat e=elevation(world_pos.xy);world_pos.z+=e;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1.0);projected_point.xy+=projected_point.w*a_offset_xy*0.5*u_occluderSizePx/u_screenSizePx;gl_Position=projected_point;}')};function oz(b,p){const y=b.split("\n");for(let T of y){if(T=T.trimStart(),"#"!==T[0])continue;if(!T.includes("if"))continue;if(T.startsWith("#endif"))continue;const S=T.match(g2r);if(S)for(const R of S)y2r.has(R)||p.add(R)}}function LEt(b){return new Set(["uint","int","uvec2","ivec2","uvec3","ivec3","uvec4","ivec4"]).has(b)}function Cs(b,p){const y=new Set,T=[],S=[];b=b.replace(SEt,(M,F)=>(S.push(F),"")),p=p.replace(SEt,(M,F)=>(T.push(F),""));let R=new Set(oce);oz(b,R),oz(p,R);for(const M of[...T,...S])ace[M]||(ace[M]=new Set,oz(kEt[M],ace[M])),R=new Set([...R,...ace[M]]);return{fragmentSource:b=b.replace(AEt,(M,F,G,q,Q)=>(y.add(Q),"define"===F?` +#ifndef HAS_UNIFORM_u_${Q} +${LEt(q)?"flat ":""}in ${G} ${q} ${Q}; +#else +uniform ${G} ${q} u_${Q}; +#endif +`:"initialize"===F?` +#ifdef HAS_UNIFORM_u_${Q} + ${G} ${q} ${Q} = u_${Q}; +#endif +`:"define-attribute"===F?` +#ifdef HAS_ATTRIBUTE_a_${Q} + in ${G} ${q} ${Q}; +#endif +`:"initialize-attribute"===F?"":void 0)),vertexSource:p=p.replace(AEt,(M,F,G,q,Q)=>{const ie=`MATERIAL_ATTRIBUTE_OFFSET_${Q}`,ae="float"===q?"vec2":q,de=`GET_ATTRIBUTE_${ae}(a_${Q}, materialInfo, ${ie})`,pe=Q.includes("color")?"color":ae;return"define-attribute-vertex-shader-only"===F?` +#ifdef HAS_ATTRIBUTE_a_${Q} +in ${G} ${q} a_${Q}; +#endif +`:y.has(Q)?"define"===F?` +#ifndef HAS_UNIFORM_u_${Q} +uniform lowp float u_${Q}_t; + #if !defined(${ie}) + in ${G} ${ae} a_${Q}; + #endif +${LEt(q)?"flat ":""}out ${G} ${q} ${Q}; +#else +uniform ${G} ${q} u_${Q}; +#endif +`:"initialize"===F?"vec4"===pe||"uvec4"===pe?` +#ifndef HAS_UNIFORM_u_${Q} + ${Q} = a_${Q}; +#else + ${G} ${q} ${Q} = u_${Q}; +#endif +`:` +#if !defined(HAS_UNIFORM_u_${Q}) + #ifdef ${ie} + ${Q} = unpack_mix_${pe}(${de}, u_${Q}_t); + #else + ${Q} = unpack_mix_${pe}(a_${Q}, u_${Q}_t); + #endif +#else + ${G} ${q} ${Q} = u_${Q}; +#endif +`:"define-attribute"===F?` +#ifdef HAS_ATTRIBUTE_a_${Q} + in ${G} ${q} a_${Q}; + out ${G} ${q} ${Q}; +#endif +`:"initialize-attribute"===F?` +#ifdef HAS_ATTRIBUTE_a_${Q} + ${Q} = a_${Q}; +#endif +`:void 0:"define"===F?` +#ifndef HAS_UNIFORM_u_${Q} +uniform lowp float u_${Q}_t; + #if !defined(${ie}) + in ${G} ${ae} a_${Q}; + #endif +#else +uniform ${G} ${q} u_${Q}; +#endif +`:"define-instanced"===F?"mat4"===pe?` +#ifdef INSTANCED_ARRAYS +in vec4 a_${Q}0; +in vec4 a_${Q}1; +in vec4 a_${Q}2; +in vec4 a_${Q}3; +#else +uniform ${G} ${q} u_${Q}; +#endif +`:` +#ifdef INSTANCED_ARRAYS +in ${G} ${ae} a_${Q}; +#else +uniform ${G} ${q} u_${Q}; +#endif +`:"initialize-attribute-custom"===F?` +#ifdef HAS_ATTRIBUTE_a_${Q} + ${G} ${q} ${Q} = a_${Q}; +#endif +`:"vec4"===pe||"uvec4"===pe?` +#ifndef HAS_UNIFORM_u_${Q} + #ifdef ${ie} + ${G} ${q} ${Q} = ${de}; + #else + ${G} ${q} ${Q} = a_${Q}; + #endif +#else + ${G} ${q} ${Q} = u_${Q}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${Q} + #ifdef ${ie} + ${G} ${q} ${Q} = unpack_mix_${pe}(${de}, u_${Q}_t); + #else + ${G} ${q} ${Q} = unpack_mix_${pe}(a_${Q}, u_${Q}_t); + #endif +#else + ${G} ${q} ${Q} = u_${Q}; +#endif +`}),usedDefines:R,vertexIncludes:T,fragmentIncludes:S}}var _2r={model:Cs('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_indicator_cutout.fragment.glsl"\n#include "_prelude_feature_cutout.fragment.glsl"\nuniform float u_opacity;\n#ifdef DITHERED_DISCARD\nuniform float u_dithered_discard_threshold;\n#endif\n#ifndef LIGHTING_3D_MODE\nuniform vec3 u_lightcolor;uniform vec3 u_lightpos;uniform float u_lightintensity;\n#endif\nuniform vec4 u_baseColorFactor;uniform vec4 u_emissiveFactor;uniform float u_metallicFactor;uniform float u_roughnessFactor;uniform float u_emissive_strength;in highp vec4 v_position_height;in lowp vec4 v_color_mix;\n#ifdef RENDER_SHADOWS\nin highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in float v_depth_shadows;\n#endif\n#ifdef OCCLUSION_TEXTURE_TRANSFORM\nuniform vec4 u_occlusionTextureTransform;\n#endif\n#pragma mapbox: define-attribute highp vec3 normal_3f\n#pragma mapbox: define-attribute highp vec3 color_3f\n#pragma mapbox: define-attribute highp vec4 color_4f\n#pragma mapbox: define-attribute highp vec2 uv_2f\n#pragma mapbox: initialize-attribute highp vec3 normal_3f\n#pragma mapbox: initialize-attribute highp vec3 color_3f\n#pragma mapbox: initialize-attribute highp vec4 color_4f\n#pragma mapbox: initialize-attribute highp vec2 uv_2f\n#ifdef HAS_ATTRIBUTE_a_pbr\nin lowp vec4 v_roughness_metallic_emissive_alpha;in mediump vec4 v_height_based_emission_params;\n#endif\n#ifdef HAS_TEXTURE_u_baseColorTexture\nuniform sampler2D u_baseColorTexture;uniform bool u_baseTextureIsAlpha;uniform bool u_alphaMask;uniform float u_alphaCutoff;\n#endif\n#ifdef HAS_TEXTURE_u_metallicRoughnessTexture\nuniform sampler2D u_metallicRoughnessTexture;\n#endif\n#ifdef HAS_TEXTURE_u_occlusionTexture\nuniform sampler2D u_occlusionTexture;uniform float u_aoIntensity;\n#endif\n#ifdef HAS_TEXTURE_u_normalTexture\nuniform sampler2D u_normalTexture;\n#endif\n#ifdef HAS_TEXTURE_u_emissionTexture\nuniform sampler2D u_emissionTexture;\n#endif\n#ifdef APPLY_LUT_ON_GPU\nuniform highp sampler3D u_lutTexture;\n#endif\n#ifdef FEATURE_CUTOUT_VERTEX\nin highp float v_cutout_factor;\n#endif\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nin highp float v_depth;uniform highp sampler2D u_depthTexture;uniform highp vec2 u_inv_depth_size;uniform highp vec2 u_depth_range_unpack;\n#ifdef DEPTH_D24\nhighp float unpack_depth(highp float depth) {return depth*u_depth_range_unpack.x+u_depth_range_unpack.y;}\n#else\nhighp float unpack_depth_rgba(highp vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}\n#endif\nbool isOccluded() {highp vec2 coord=gl_FragCoord.xy*u_inv_depth_size;\n#ifdef FLIP_Y\ncoord.y=1.0-coord.y;\n#endif\n#ifdef DEPTH_D24\nhighp float depth=unpack_depth(texture(u_depthTexture,coord).r);\n#else\nhighp float depth=unpack_depth_rgba(texture(u_depthTexture,coord));\n#endif\nreturn v_depth > depth+0.0005;}\n#endif\n#define saturate(_x) clamp(_x,0.,1.)\nvec3 linearTosRGB(vec3 color) {return pow(color,vec3(1./2.2));}vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}float calculate_NdotL(vec3 normal,vec3 lightDir) {const float ext=0.70710678118;return (clamp(dot(normal,lightDir),-ext,1.0)+ext)/(1.0+ext);}vec3 getDiffuseShadedColor(vec3 albedo,vec3 normal,vec3 lightDir,vec3 lightColor)\n{\n#ifdef LIGHTING_3D_MODE\nvec3 transformed_normal=vec3(-normal.xy,normal.z);float lighting_factor;\n#ifdef RENDER_SHADOWS\nlighting_factor=shadowed_light_factor_normal(transformed_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth_shadows);\n#else\nlighting_factor=saturate(dot(transformed_normal,u_lighting_directional_dir));\n#endif\nreturn apply_lighting(albedo,transformed_normal,lighting_factor);\n#else\nvec3 n=normal;float colorvalue=((albedo.x*0.2126)+(albedo.y*0.7152))+(albedo.z*0.0722);vec3 c=vec3(0.03,0.03,0.03);float directional=clamp(dot(n,vec3(lightDir)),0.0,1.0);directional=mix(1.0-u_lightintensity,max((1.0-colorvalue)+u_lightintensity,1.0),directional);vec3 c3=c+clamp((albedo*directional)*lightColor,mix(vec3(0.0),vec3(0.3),vec3(1.0)-lightColor),vec3(1.0));return c3;\n#endif\n}vec4 getBaseColor() {vec4 albedo=u_baseColorFactor;\n#ifdef HAS_ATTRIBUTE_a_color_3f\nalbedo*=vec4(color_3f,1.0);\n#endif\n#ifdef HAS_ATTRIBUTE_a_pbr\n#else\n#ifdef HAS_ATTRIBUTE_a_color_4f\nalbedo*=color_4f;\n#endif\n#endif\n#if defined (HAS_TEXTURE_u_baseColorTexture) && defined (HAS_ATTRIBUTE_a_uv_2f)\nvec4 texColor=texture(u_baseColorTexture,uv_2f);if(u_alphaMask) {if (texColor.w < u_alphaCutoff) {discard;}}\n#ifdef UNPREMULT_TEXTURE_IN_SHADER\ntexColor=vec4(unpremultiplyColor(texColor),1.0);\n#endif\nif(u_baseTextureIsAlpha) {if (texColor.r < 0.5) {discard;}} else {texColor.rgb=sRGBToLinear(texColor.rgb);albedo*=texColor;}\n#endif\nvec4 color=vec4(mix(albedo.rgb,v_color_mix.rgb,v_color_mix.a),albedo.a);\n#ifdef APPLY_LUT_ON_GPU\ncolor=applyLUT(u_lutTexture,color);\n#endif\nreturn color;}highp mat3 cotangentFrame(highp vec3 N,highp vec3 p,highp vec2 uv ) {\n#ifdef HAS_TEXTURE_u_normalTexture\nhighp vec3 dp1=vec3(dFdx(p.x),dFdx(p.y),dFdx(p.z));highp vec3 dp2=vec3(dFdy(p.x),dFdy(p.y),dFdy(p.z));highp vec2 duv1=vec2(dFdx(uv.x),dFdx(uv.y));highp vec2 duv2=vec2(dFdy(uv.x),dFdy(uv.y));highp vec3 dp2perp=cross( dp2,N );highp vec3 dp1perp=cross( N,dp1 );highp vec3 T=dp2perp*duv1.x+dp1perp*duv2.x;highp vec3 B=dp2perp*duv1.y+dp1perp*duv2.y;\n#ifdef FLIP_Y\nT=-T;B=-B;\n#endif\nhighp float lengthT=dot(T,T);highp float lengthB=dot(B,B);highp float maxLength=max(lengthT,lengthB);highp float invmax=inversesqrt( maxLength );highp mat3 res=mat3( T*invmax,B*invmax,N );return res;\n#else\nreturn mat3(1.0);\n#endif\n}highp vec3 getNormal(){highp vec3 n;\n#ifdef HAS_ATTRIBUTE_a_normal_3f\nn=normalize(normal_3f);\n#else\nhighp vec3 fdx=vec3(dFdx(v_position_height.x),dFdx(v_position_height.y),dFdx(v_position_height.z));highp vec3 fdy=vec3(dFdy(v_position_height.x),dFdy(v_position_height.y),dFdy(v_position_height.z));\n#ifdef FLIP_Y\nn=normalize(cross(fdx,fdy));\n#else\nn=normalize(cross(fdx,fdy))*-1.0;\n#endif\n#endif\n#if defined(HAS_TEXTURE_u_normalTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)\nvec3 nMap=texture( u_normalTexture,uv_2f).xyz;nMap=normalize(2.0*nMap-vec3(1.0));highp vec3 v=normalize(-v_position_height.xyz);highp mat3 TBN=cotangentFrame(n,v,uv_2f);n=normalize(TBN*nMap);\n#endif\nreturn n;}struct Material {float perceptualRoughness;float alphaRoughness;float metallic;vec3 f90;vec4 baseColor;vec3 diffuseColor;vec3 specularColor;highp vec3 normal;};Material getPBRMaterial() {Material mat;mat.baseColor=getBaseColor();mat.perceptualRoughness=u_roughnessFactor;mat.metallic=u_metallicFactor;\n#ifdef HAS_ATTRIBUTE_a_pbr\nmat.perceptualRoughness=v_roughness_metallic_emissive_alpha.x;mat.metallic=v_roughness_metallic_emissive_alpha.y;mat.baseColor.w*=v_roughness_metallic_emissive_alpha.w;\n#endif\n#if defined(HAS_TEXTURE_u_metallicRoughnessTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)\nvec4 mrSample=texture(u_metallicRoughnessTexture,uv_2f);mat.perceptualRoughness*=mrSample.g;mat.metallic*=mrSample.b;\n#endif\nconst float c_minRoughness=0.04;mat.perceptualRoughness=clamp(mat.perceptualRoughness,c_minRoughness,1.0);mat.metallic=saturate(mat.metallic);mat.alphaRoughness=mat.perceptualRoughness*mat.perceptualRoughness;const vec3 f0=vec3(0.04);mat.diffuseColor=mat.baseColor.rgb*(vec3(1.0)-f0);mat.diffuseColor*=1.0-mat.metallic;mat.specularColor=mix(f0,mat.baseColor.rgb,mat.metallic);highp float reflectance=max(max(mat.specularColor.r,mat.specularColor.g),mat.specularColor.b);highp float reflectance90=saturate(reflectance*25.0);mat.f90=vec3(reflectance90);mat.normal=getNormal();return mat;}float V_GGX(float NdotL,float NdotV,float roughness)\n{float a2=roughness*roughness;float GGXV=NdotL*sqrt(NdotV*NdotV*(1.0-a2)+a2);float GGXL=NdotV*sqrt(NdotL*NdotL*(1.0-a2)+a2);return 0.5/(GGXV+GGXL);}float V_GGXFast(float NdotL,float NdotV,float roughness) {float a=roughness;float GGXV=NdotL*(NdotV*(1.0-a)+a);float GGXL=NdotV*(NdotL*(1.0-a)+a);return 0.5/(GGXV+GGXL);}vec3 F_Schlick(vec3 specularColor,vec3 f90,float VdotH)\n{return specularColor+(f90-specularColor)*pow(clamp(1.0-VdotH,0.0,1.0),5.0);}vec3 F_SchlickFast(vec3 specularColor,float VdotH)\n{float x=1.0-VdotH;float x4=x*x*x*x;return specularColor+(1.0-specularColor)*x4*x;}float D_GGX(highp float NdotH,float alphaRoughness)\n{highp float a4=alphaRoughness*alphaRoughness;highp float f=(NdotH*a4-NdotH)*NdotH+1.0;return a4/(PI*f*f);}vec3 diffuseBurley(Material mat,float LdotH,float NdotL,float NdotV)\n{float f90=2.0*LdotH*LdotH*mat.alphaRoughness-0.5;return (mat.diffuseColor/PI)*(1.0+f90*pow((1.0-NdotL),5.0))*(1.0+f90*pow((1.0-NdotV),5.0));}vec3 diffuseLambertian(Material mat)\n{\n#ifdef LIGHTING_3D_MODE\nreturn mat.diffuseColor;\n#else\nreturn mat.diffuseColor/PI;\n#endif\n}vec3 EnvBRDFApprox(vec3 specularColor,float roughness,highp float NdotV)\n{vec4 c0=vec4(-1,-0.0275,-0.572,0.022);vec4 c1=vec4(1,0.0425,1.04,-0.04);highp vec4 r=roughness*c0+c1;highp float a004=min(r.x*r.x,exp2(-9.28*NdotV))*r.x+r.y;vec2 AB=vec2(-1.04,1.04)*a004+r.zw;return specularColor*AB.x+AB.y;}vec3 computeIndirectLightContribution(Material mat,float NdotV,vec3 normal)\n{vec3 env_light=vec3(0.65,0.65,0.65);\n#ifdef LIGHTING_3D_MODE\nfloat ambient_factor=calculate_ambient_directional_factor(normal);env_light=u_lighting_ambient_color*ambient_factor;\n#endif\nvec3 envBRDF=EnvBRDFApprox(mat.specularColor,mat.perceptualRoughness,NdotV);vec3 indirectSpecular= envBRDF*env_light;vec3 indirectDiffuse=mat.diffuseColor*env_light;return indirectSpecular+indirectDiffuse;}vec3 computeLightContribution(Material mat,vec3 lightPosition,vec3 lightColor)\n{highp vec3 n=mat.normal;highp vec3 v=normalize(-v_position_height.xyz);highp vec3 l=normalize(lightPosition);highp vec3 h=normalize(v+l);float NdotV=clamp(abs(dot(n,v)),0.001,1.0);float NdotL=saturate(dot(n,l));highp float NdotH=saturate(dot(n,h));float VdotH=saturate(dot(v,h));vec3 f=F_SchlickFast(mat.specularColor,VdotH);float g=V_GGXFast(NdotL,NdotV,mat.alphaRoughness);float d=D_GGX(NdotH,mat.alphaRoughness);vec3 diffuseTerm=(1.0-f)*diffuseLambertian(mat);vec3 specularTerm=f*g*d;vec3 transformed_normal=vec3(-n.xy,n.z);float lighting_factor;\n#ifdef RENDER_SHADOWS\nlighting_factor=shadowed_light_factor_normal(transformed_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth_shadows);\n#else\nlighting_factor=NdotL;\n#endif\nvec3 directLightColor=(specularTerm+diffuseTerm)*lighting_factor*lightColor;vec3 indirectLightColor=computeIndirectLightContribution(mat,NdotV,transformed_normal);vec3 color=(saturate(directLightColor)+indirectLightColor);float intensityFactor=1.0;\n#if !defined(LIGHTING_3D_MODE)\nconst vec3 luminosityFactor=vec3(0.2126,0.7152,0.0722);float luminance=dot(diffuseTerm,luminosityFactor);intensityFactor=mix((1.0-u_lightintensity),max((1.0-luminance+u_lightintensity),1.0),NdotL);\n#endif\ncolor*=intensityFactor;return color;}void main() {\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nif (isOccluded()) {discard;}\n#endif\nvec3 lightDir;vec3 lightColor;\n#ifdef LIGHTING_3D_MODE\nlightDir=u_lighting_directional_dir;lightDir.xy=-lightDir.xy;lightColor=u_lighting_directional_color;\n#else\nlightDir=u_lightpos;lightColor=u_lightcolor;\n#endif\nvec4 finalColor;\n#ifdef DIFFUSE_SHADED\nvec3 N=getNormal();vec3 baseColor=getBaseColor().rgb;vec3 diffuse=getDiffuseShadedColor(baseColor,N,lightDir,lightColor);\n#ifdef HAS_TEXTURE_u_occlusionTexture\nfloat ao=(texture(u_occlusionTexture,uv_2f).r-1.0)*u_aoIntensity+1.0;diffuse*=ao;\n#endif\nfinalColor=vec4(mix(diffuse,baseColor,u_emissive_strength),1.0)*u_opacity;\n#else\nMaterial mat=getPBRMaterial();vec3 color=computeLightContribution(mat,lightDir,lightColor);float ao=1.0;\n#if defined (HAS_TEXTURE_u_occlusionTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)\n#ifdef OCCLUSION_TEXTURE_TRANSFORM\nvec2 uv=uv_2f.xy*u_occlusionTextureTransform.zw+u_occlusionTextureTransform.xy;\n#else\nvec2 uv=uv_2f;\n#endif\nao=(texture(u_occlusionTexture,uv).x-1.0)*u_aoIntensity+1.0;color*=ao;\n#endif\nvec4 emissive=u_emissiveFactor;\n#if defined(HAS_TEXTURE_u_emissionTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)\nemissive.rgb*=sRGBToLinear(texture(u_emissionTexture,uv_2f).rgb);\n#endif\n#ifdef APPLY_LUT_ON_GPU\nfloat emissiveFactorLength=max(length(u_emissiveFactor.rgb),0.001);emissive.rgb=sRGBToLinear(applyLUT(u_lutTexture,linearTosRGB(emissive.rgb/emissiveFactorLength).rbg))*emissiveFactorLength;\n#endif\ncolor+=emissive.rgb;float opacity=mat.baseColor.w*u_opacity;\n#ifdef HAS_ATTRIBUTE_a_pbr\nfloat resEmission=v_roughness_metallic_emissive_alpha.z;resEmission*=v_height_based_emission_params.z+v_height_based_emission_params.w*pow(clamp(v_height_based_emission_params.x,0.0,1.0),v_height_based_emission_params.y);vec3 color_mix=v_color_mix.rgb;\n#ifdef APPLY_LUT_ON_GPU\ncolor_mix=applyLUT(u_lutTexture,color_mix);\n#endif\ncolor=mix(color,color_mix,min(1.0,resEmission));\n#ifdef HAS_ATTRIBUTE_a_color_4f\nfloat distance=length(vec2(1.3*max(0.0,abs(color_4f.x)-color_4f.z),color_4f.y));distance+= mix(0.5,0.0,clamp(resEmission-1.0,0.0,1.0));opacity*=v_roughness_metallic_emissive_alpha.w*saturate(1.0-distance*distance);\n#endif\n#endif\nvec3 unlitColor=mat.baseColor.rgb*ao+emissive.rgb;color=mix(color,unlitColor,u_emissive_strength);color=linearTosRGB(color);color*=opacity;finalColor=vec4(color,opacity);\n#endif\n#ifdef DITHERED_DISCARD\nif (abs(u_dithered_discard_threshold) < 1.0) {float ditherValue=fract(52.9829189*fract(0.06711056*gl_FragCoord.x+0.00583715*gl_FragCoord.y));float compareValue=mix(1.0-ditherValue,ditherValue,step(0.0,u_dithered_discard_threshold));if (abs(u_dithered_discard_threshold) < compareValue) {discard;}}\n#endif\n#ifdef FOG\nfinalColor=fog_dither(fog_apply_premultiplied(finalColor,v_fog_pos,v_position_height.w));\n#endif\n#ifdef RENDER_CUTOFF\nfinalColor*=v_cutoff_opacity;\n#endif\n#ifdef INDICATOR_CUTOUT\nfinalColor=applyCutout(finalColor,v_position_height.w);\n#endif\n#ifdef FEATURE_CUTOUT_VERTEX\napply_feature_cutout_dither(gl_FragCoord,v_cutout_factor);\n#else\n#ifdef FEATURE_CUTOUT\nfinalColor=apply_feature_cutout(finalColor,gl_FragCoord,get_cutout_factors(gl_FragCoord).x,0.0);\n#endif\n#endif\nglFragColor=finalColor;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\n#include "_prelude_feature_cutout.vertex.glsl"\nin vec3 a_pos_3f;\n#pragma mapbox: define-attribute highp vec3 normal_3f\n#pragma mapbox: define-attribute highp vec2 uv_2f\n#pragma mapbox: define-attribute highp vec3 color_3f\n#pragma mapbox: define-attribute highp vec4 color_4f\n#pragma mapbox: define-attribute-vertex-shader-only highp uvec4 pbr\n#pragma mapbox: define-attribute-vertex-shader-only highp vec3 heightBasedEmissiveStrength\nuniform mat4 u_matrix;uniform mat4 u_node_matrix;uniform mat4 u_lighting_matrix;uniform vec3 u_camera_pos;uniform vec4 u_color_mix;\n#ifdef INSTANCED_ARRAYS\nin vec4 a_normal_matrix0;in vec4 a_normal_matrix1;in vec4 a_normal_matrix2;in vec4 a_normal_matrix3;\n#else\nuniform highp mat4 u_normal_matrix;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out float v_depth_shadows;\n#endif\nout vec4 v_position_height;out lowp vec4 v_color_mix;\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nout highp float v_depth;\n#endif\n#ifdef FEATURE_CUTOUT_VERTEX\nout highp float v_cutout_factor;\n#endif\n#ifdef HAS_ATTRIBUTE_a_pbr\nout lowp vec4 v_roughness_metallic_emissive_alpha;out mediump vec4 v_height_based_emission_params;\n#endif\nvec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}void main() {\n#pragma mapbox: initialize-attribute highp vec3 normal_3f\n#pragma mapbox: initialize-attribute highp vec2 uv_2f\n#pragma mapbox: initialize-attribute highp vec3 color_3f\n#pragma mapbox: initialize-attribute highp vec4 color_4f\n#pragma mapbox: initialize-attribute-custom highp uvec4 pbr\n#pragma mapbox: initialize-attribute-custom highp vec3 heightBasedEmissiveStrength\nhighp mat4 normal_matrix;\n#ifdef INSTANCED_ARRAYS\nnormal_matrix=mat4(a_normal_matrix0,a_normal_matrix1,a_normal_matrix2,a_normal_matrix3);\n#else\nnormal_matrix=u_normal_matrix;\n#endif\n#ifdef FEATURE_CUTOUT_VERTEX\nv_cutout_factor=1.0;\n#endif\nvec3 local_pos;mat3 rs;\n#ifdef MODEL_POSITION_ON_GPU\nvec3 pos_color=normal_matrix[0].xyz;vec4 translate=normal_matrix[1];vec3 pos_a=floor(pos_color);vec3 rgb=1.05*(pos_color-pos_a);float hidden=float(pos_a.x > EXTENT);float color_mix=pos_a.z/100.0;v_color_mix=vec4(sRGBToLinear(rgb),color_mix);float meter_to_tile=normal_matrix[0].w;vec4 pos=vec4(pos_a.xy,translate.z,1.0);rs[0].x=normal_matrix[1].w;rs[0].yz=normal_matrix[2].xy;rs[1].xy=normal_matrix[2].zw;rs[1].z=normal_matrix[3].x;rs[2].xyz=normal_matrix[3].yzw;vec4 pos_node=u_lighting_matrix*vec4(a_pos_3f,1.0);vec3 rotated_pos_node=rs*pos_node.xyz;vec3 pos_model_tile=(rotated_pos_node+vec3(translate.xy,0.0))*vec3(meter_to_tile,meter_to_tile,1.0);pos.xyz+=pos_model_tile;local_pos=pos.xyz;gl_Position=mix(u_matrix*pos,AWAY,hidden);pos.z*=meter_to_tile;v_position_height.xyz=pos.xyz-u_camera_pos;\n#ifdef FEATURE_CUTOUT_VERTEX\nhighp vec4 ground_pos=vec4(pos_a.xy,0.0,1.0);highp vec4 cutout_clip_pos=mix(u_matrix*ground_pos,AWAY,hidden);highp vec3 cutout_ndc=cutout_clip_pos.xyz/cutout_clip_pos.w;vec2 uv=cutout_ndc.xy*0.5+0.5;highp float fragDepthNDC=cutout_ndc.z*0.5+0.5;\n#ifdef FLIP_Y\nfragDepthNDC=cutout_ndc.z;\n#endif\nhighp float cutoutFactor=get_cutout_factors_vert(uv).x;highp float cutoutDepthNDC=sample_cutout_depth(u_cutout_depth_image,uv);highp float groundThreshold=0.001;highp float groundLimit=clamp((fragDepthNDC+groundThreshold-cutoutDepthNDC)/groundThreshold+0.5,0.0,1.0);v_cutout_factor=mix(1.0-cutoutFactor,1.0,groundLimit);\n#endif\n#else\nlocal_pos=a_pos_3f;gl_Position=u_matrix*vec4(a_pos_3f,1);v_position_height.xyz=vec3(u_lighting_matrix*vec4(a_pos_3f,1));v_color_mix=vec4(sRGBToLinear(u_color_mix.rgb),u_color_mix.a);\n#endif\nv_position_height.w=a_pos_3f.z;\n#ifdef HAS_ATTRIBUTE_a_pbr\nvec4 albedo_c=decode_color(vec2(pbr.xy));vec2 e_r_m=unpack_float(float(pbr.z));vec2 r_m= unpack_float(e_r_m.y*16.0);r_m.r=r_m.r*16.0;v_color_mix=vec4(albedo_c.rgb,1.0);v_roughness_metallic_emissive_alpha=vec4(vec3(r_m,e_r_m.x)/255.0,albedo_c.a);v_roughness_metallic_emissive_alpha.z*=2.0;float heightBasedRelativeIntepolation=a_pos_3f.z*heightBasedEmissiveStrength.x+heightBasedEmissiveStrength.y;v_height_based_emission_params.x=heightBasedRelativeIntepolation;v_height_based_emission_params.y=heightBasedEmissiveStrength.z;vec2 emissionMultiplierValues=unpack_float(float(pbr.w))/256.0;v_height_based_emission_params.z=emissionMultiplierValues.x;v_height_based_emission_params.w=emissionMultiplierValues.y-emissionMultiplierValues.x;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(local_pos);\n#endif\n#ifdef RENDER_CUTOFF\nv_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z);\n#endif\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nv_depth=gl_Position.z/gl_Position.w;\n#ifdef CLIP_ZERO_TO_ONE\nv_depth=-1.0+2.0*v_depth; \n#endif\n#endif\n#ifdef HAS_ATTRIBUTE_a_normal_3f\n#ifdef MODEL_POSITION_ON_GPU\nfloat x_squared_scale=dot(rs[0],rs[0]);float y_squared_scale=dot(rs[1],rs[1]);float z_squared_scale=dot(rs[2],rs[2]);vec3 squared_scale=vec3(x_squared_scale,y_squared_scale,z_squared_scale);normal_3f=rs*((u_lighting_matrix*vec4(normal_3f,0.0)).xyz/squared_scale);normal_3f=normalize(normal_3f);\n#else\nnormal_3f=vec3(normal_matrix*vec4(normal_3f,0));\n#endif\n#endif\n#ifdef HAS_ATTRIBUTE_a_pbr\n#ifdef HAS_ATTRIBUTE_a_color_4f\nv_roughness_metallic_emissive_alpha.w=clamp(color_4f.a*v_roughness_metallic_emissive_alpha.w*(v_roughness_metallic_emissive_alpha.z-1.0),0.0,1.0);\n#endif\n#endif\n#ifdef RENDER_SHADOWS\nvec4 shadow_pos=u_node_matrix*vec4(local_pos,1.0);\n#ifdef NORMAL_OFFSET\n#ifdef HAS_ATTRIBUTE_a_normal_3f\n#ifdef MODEL_POSITION_ON_GPU\nvec3 offset=shadow_normal_offset(vec3(-normal_3f.xy,normal_3f.z));shadow_pos.xyz+=offset*shadow_normal_offset_multiplier0();\n#else\nvec3 offset=shadow_normal_offset_model(normal_3f);shadow_pos.xyz+=offset*shadow_normal_offset_multiplier0();\n#endif\n#endif\n#endif\nv_pos_light_view_0=u_light_matrix_0*shadow_pos;v_pos_light_view_1=u_light_matrix_1*shadow_pos;v_depth_shadows=gl_Position.w;\n#endif\n}'),modelDepth:Cs("void main() {}","in vec3 a_pos_3f;uniform mat4 u_matrix;\n#ifdef MODEL_POSITION_ON_GPU\n#ifdef INSTANCED_ARRAYS\nin vec4 a_normal_matrix0;in vec4 a_normal_matrix1;in vec4 a_normal_matrix2;in vec4 a_normal_matrix3;\n#else\nuniform highp mat4 u_instance;\n#endif\nuniform highp mat4 u_node_matrix;\n#endif\nvoid main() {\n#ifdef MODEL_POSITION_ON_GPU\nhighp mat4 instance;\n#ifdef INSTANCED_ARRAYS\ninstance=mat4(a_normal_matrix0,a_normal_matrix1,a_normal_matrix2,a_normal_matrix3);\n#else\ninstance=u_instance;\n#endif\nvec3 pos_color=instance[0].xyz;vec4 translate=instance[1];vec3 pos_a=floor(pos_color);float hidden=float(pos_a.x > EXTENT);float meter_to_tile=instance[0].w;vec4 pos=vec4(pos_a.xy,translate.z,1.0);mat3 rs;rs[0].x=instance[1].w;rs[0].yz=instance[2].xy;rs[1].xy=instance[2].zw;rs[1].z=instance[3].x;rs[2].xyz=instance[3].yzw;vec4 pos_node=u_node_matrix*vec4(a_pos_3f,1.0);vec3 rotated_pos_node=rs*pos_node.xyz;vec3 pos_model_tile=(rotated_pos_node+vec3(translate.xy,0.0))*vec3(meter_to_tile,meter_to_tile,1.0);pos.xyz+=pos_model_tile;gl_Position=mix(u_matrix*pos,AWAY,hidden);\n#else\ngl_Position=u_matrix*vec4(a_pos_3f,1);\n#endif\n}"),fillExtrusionDepth:Cs("void main() {}",'#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_material_table.vertex.glsl"\nuniform mat4 u_matrix;uniform float u_edge_radius;uniform float u_width_scale;uniform float u_vertical_scale;\n#ifdef TERRAIN\nuniform int u_height_type;uniform int u_base_type;\n#endif\nin ivec4 a_pos_normal_ed;\n#if defined(HAS_CENTROID) || defined(TERRAIN)\nin uvec2 a_centroid_pos;\n#endif\n#ifdef RENDER_WALL_MODE\nin ivec4 a_join_normal_inside;\n#endif\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp float line_width\n#pragma mapbox: define highp vec4 color\nvoid main() {DECLARE_MATERIAL_TABLE_INFO\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp float line_width\n#pragma mapbox: initialize highp vec4 color\nbase*=u_vertical_scale;height*=u_vertical_scale;vec3 top_up_ny=vec3(a_pos_normal_ed.xyz & 1);vec3 pos_nx=vec3(a_pos_normal_ed.xyz >> 1);base=max(0.0,base);height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=vec2(a_centroid_pos);\n#endif\nvec3 pos;\n#ifdef TERRAIN\nbool is_flat_height=centroid_pos.x !=0.0 && u_height_type==1;bool is_flat_base=centroid_pos.x !=0.0 && u_base_type==1;float ele=elevation(pos_nx.xy);bool is_elevation_encoded=centroid_pos.y==0.0 || (centroid_pos.y > 0.0 && int(centroid_pos.y)-(int(centroid_pos.y)/8)*8==7);float c_ele=is_flat_height || is_flat_base ? (is_elevation_encoded ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos)) : ele;float h_height=is_flat_height ? max(c_ele+height,ele+base+2.0) : ele+height;float h_base=is_flat_base ? max(c_ele+base,ele+base) : ele+(base==0.0 ?-5.0 : base);float h=t > 0.0 ? max(h_base,h_height) : h_base;pos=vec3(pos_nx.xy,h);\n#else\npos=vec3(pos_nx.xy,t > 0.0 ? height : base);\n#endif\n#ifdef RENDER_WALL_MODE\nvec3 join_normal_inside=vec3(a_join_normal_inside);vec2 wall_offset=u_width_scale*line_width*(join_normal_inside.xy/EXTENT);pos.xy+=(1.0-join_normal_inside.z)*wall_offset*0.5;pos.xy-=join_normal_inside.z*wall_offset*0.5;\n#endif\nfloat hidden=float((centroid_pos.x==0.0 && centroid_pos.y==1.0) || (color.a==0.0));gl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden);}'),fillExtrusionGroundEffect:Cs("uniform highp float u_ao_pass;uniform highp float u_opacity;uniform highp float u_flood_light_intensity;uniform highp vec3 u_flood_light_color;uniform highp float u_attenuation;uniform sampler2D u_fb;uniform float u_fb_size;\n#ifdef SDF_SUBPASS\nin highp vec2 v_pos;in highp vec4 v_line_segment;in highp float v_flood_light_radius_tile;in highp vec2 v_ao;float line_df(highp vec2 a,highp vec2 b,highp vec2 p) {highp vec2 ba=b-a;highp vec2 pa=p-a;highp float r=clamp(dot(pa,ba)/dot(ba,ba),0.0,1.0);return length(pa-r*ba);}\n#ifdef FOG\nin highp float v_fog;\n#endif\n#endif\nvoid main() {\n#ifdef CLEAR_SUBPASS\nvec4 color=vec4(1.0);\n#ifdef CLEAR_FROM_TEXTURE\ncolor=texture(u_fb,gl_FragCoord.xy/vec2(u_fb_size));\n#endif\nglFragColor=color;\n#else\n#ifdef SDF_SUBPASS\nhighp float d=line_df(v_line_segment.xy,v_line_segment.zw,v_pos);highp float effect_radius=mix(v_flood_light_radius_tile,v_ao.y,u_ao_pass);d/=effect_radius;d=min(d,1.0);d=1.0-pow(1.0-d,u_attenuation);highp float effect_intensity=mix(u_flood_light_intensity,v_ao.x,u_ao_pass);highp float fog=1.0;\n#ifdef FOG\nfog=v_fog;\n#endif\n#ifdef RENDER_CUTOFF\nfog*=v_cutoff_opacity;\n#endif\nglFragColor=vec4(vec3(0.0),mix(1.0,d,effect_intensity*u_opacity*fog));\n#else\n#ifdef USE_MRT1\nout_Target1=vec4(1.0-texture(u_fb,gl_FragCoord.xy/vec2(u_fb_size)).a,0.0,0.0,0.0);\n#else\nvec4 color=mix(vec4(u_flood_light_color,1.0),vec4(vec3(0.0),1.0),u_ao_pass);\n#ifdef OVERDRAW_INSPECTOR\ncolor=vec4(1.0);\n#endif\nglFragColor=color;\n#endif\n#endif\nHANDLE_WIREFRAME_DEBUG;\n#endif\n}",'#include "_prelude_fog.vertex.glsl"\nin highp ivec4 a_pos_end;in highp int a_angular_offset_factor;in highp uint a_hidden_by_landmark;\n#ifdef SDF_SUBPASS\nout highp vec2 v_pos;out highp vec4 v_line_segment;out highp float v_flood_light_radius_tile;out highp vec2 v_ao;\n#ifdef FOG\nout highp float v_fog;\n#endif\n#endif\nuniform highp float u_flood_light_intensity;uniform highp mat4 u_matrix;uniform highp float u_ao_pass;uniform highp float u_meter_to_tile;uniform highp float u_edge_radius;uniform highp float u_dynamic_offset;uniform highp vec2 u_ao;\n#pragma mapbox: define highp float flood_light_ground_radius\nconst float TANGENT_CUTOFF=4.0;const float NORM=32767.0;void main() {\n#pragma mapbox: initialize highp float flood_light_ground_radius\nvec4 pos_end=vec4(a_pos_end);vec2 p=pos_end.xy;vec2 q=floor(pos_end.zw*0.5);vec2 start_bottom=pos_end.zw-q*2.0;float fl_ground_radius=abs(flood_light_ground_radius);float direction=flood_light_ground_radius < 0.0 ?-1.0 : 1.0;float flood_radius_tile=fl_ground_radius*u_meter_to_tile;vec2 v=normalize(q-p);float ao_radius=u_ao.y/3.5;float effect_radius=mix(flood_radius_tile,ao_radius,u_ao_pass)+u_edge_radius;float angular_offset_factor=float(a_angular_offset_factor)/NORM*TANGENT_CUTOFF;float angular_offset=direction*angular_offset_factor*effect_radius;float top=1.0-start_bottom.y;float side=(0.5-start_bottom.x)*2.0;vec2 extrusion_parallel=v*side*mix(u_dynamic_offset,angular_offset,top);vec2 perp=vec2(v.y,-v.x);vec2 extrusion_perp=direction*perp*effect_radius*top;vec3 pos=vec3(mix(q,p,start_bottom.x),0.0);pos.xy+=extrusion_parallel+extrusion_perp;\n#ifdef SDF_SUBPASS\nv_pos=pos.xy;v_line_segment=vec4(p,q)+perp.xyxy*u_edge_radius;v_flood_light_radius_tile=flood_radius_tile;v_ao=vec2(u_ao.x,ao_radius);\n#ifdef FOG\nv_fog_pos=fog_position(pos);v_fog=1.0-fog(v_fog_pos);\n#endif\n#endif\nfloat hidden_by_landmark=0.0;\n#ifdef HAS_CENTROID\nhidden_by_landmark=float(a_hidden_by_landmark);\n#endif\nfloat isFloodlit=float(fl_ground_radius > 0.0 && u_flood_light_intensity > 0.0);float hidden=mix(1.0-isFloodlit,isFloodlit,u_ao_pass);hidden+=hidden_by_landmark;gl_Position=mix(u_matrix*vec4(pos,1.0),AWAY,float(hidden > 0.0));\n#ifdef RENDER_CUTOFF\nv_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z);\n#endif\n}'),groundShadow:Cs('#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_indicator_cutout.fragment.glsl"\n#include "_prelude_feature_cutout.fragment.glsl"\nprecision highp float;uniform vec3 u_ground_shadow_factor;in vec4 v_pos_light_view_0;in vec4 v_pos_light_view_1;\n#ifdef FOG\nin float v_fog_opacity;\n#endif\nvoid main() {float light=shadowed_light_factor_plane_bias(v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);vec3 shadow=mix(u_ground_shadow_factor,vec3(1.0),light);\n#ifdef RENDER_CUTOFF\nshadow=mix(vec3(1.0),shadow,cutoff_opacity(u_cutoff_params,1.0/gl_FragCoord.w));\n#endif\n#ifdef FOG\nshadow=mix(shadow,vec3(1.0),v_fog_opacity);\n#endif\n#ifdef INDICATOR_CUTOUT\nshadow=mix(shadow,vec3(1.0),1.0-applyCutout(vec4(1.0),0.0).r);\n#endif\n#ifdef FEATURE_CUTOUT\nvec2 uv=gl_FragCoord.xy*u_inv_viewport_size.xy;\n#ifdef FLIP_Y\nuv.y=1.0-uv.y;\n#endif\nhighp float cutoutFactor=get_cutout_factors(gl_FragCoord).y;highp float cutoutDepthNDC=sample_cutout_depth_bilinear(u_cutout_depth_image,uv);highp float fragDepthNDC=gl_FragCoord.z/u_feature_cutout_params.w;highp float groundThreshold=-0.001;highp float groundLimit=clamp((fragDepthNDC+groundThreshold-cutoutDepthNDC)/groundThreshold+0.5,0.0,1.0);cutoutFactor=mix(0.0,cutoutFactor,groundLimit);shadow=mix(shadow,vec3(1.0),cutoutFactor);\n#endif\nglFragColor=vec4(shadow,1.0);}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;in ivec2 a_pos;out vec4 v_pos_light_view_0;out vec4 v_pos_light_view_1;\n#ifdef FOG\nout float v_fog_opacity;\n#endif\nvoid main() {gl_Position=u_matrix*vec4(a_pos,0.0,1.0);v_pos_light_view_0=u_light_matrix_0*vec4(a_pos,0.0,1.0);v_pos_light_view_1=u_light_matrix_1*vec4(a_pos,0.0,1.0);\n#ifdef FOG\nv_fog_pos=fog_position(vec2(a_pos));v_fog_opacity=fog(v_fog_pos);\n#endif\n}')};const T2r=(b,p)=>({u_matrix:b,u_ground_shadow_factor:p});function DEt(b,p,y=0){const T=Math.pow(2,p.tileID.overscaledZ),S=p.tileSize*Math.pow(2,b.transform.tileZoom)/T,R=S*(p.tileID.canonical.x+p.tileID.wrap*T),M=S*p.tileID.canonical.y;return{u_image:0,u_texsize:p.imageAtlasTexture?p.imageAtlasTexture.size:[0,0],u_tile_units_to_pixels:1/rX(p,1,b.transform.tileZoom),u_pixel_coord_upper:[R>>16,M>>16],u_pixel_coord_lower:[65535&R,65535&M],u_pattern_transition:y}}const sce={terrain:0,flat:1},w2r=g(),FEt=[0,0,0],NEt=(b,p,y,T,S,R,M,F,G,q,Q,ie,ae,de,pe,_e,Se,Fe,Ye=[0,0,1],Xe=false)=>{let We=FEt,rt=0,lt=FEt;if(!Xe){const Tt=p.style.light,Lt=Tt.properties.get("position");if(We=[Lt.x,Lt.y,Lt.z],"viewport"===Tt.properties.get("anchor")){const un=f();m(un,-p.transform.angle),bt(We,We,un)}const Nt=Tt.properties.get("color").toPremultipliedRenderColor(null);rt=Tt.properties.get("intensity"),lt=[Nt.r,Nt.g,Nt.b]}const Bt=p.transform,ht={u_matrix:b,u_lightpos:We,u_lightintensity:rt,u_lightcolor:lt,u_vertical_gradient:+y,u_opacity:T,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:w2r,u_merc_center:[0,0],u_up_dir:[0,0,0],u_height_lift:0,u_height_type:sce[q],u_base_type:sce[Q],u_ao:S,u_edge_radius:R,u_width_scale:M,u_flood_light_color:pe,u_vertical_scale:_e,u_flood_light_intensity:Se,u_ground_shadow_factor:Fe,u_front_cutoff_params:Ye};return"globe"===Bt.projection.name&&(ht.u_tile_id=[F.canonical.x,F.canonical.y,1<{let In=Tt;null!=zn.groundRadiusBuffer&&(In=Tt.concat("HAS_ATTRIBUTE_a_flood_light_ground_radius"));const Gn=zn.programConfigurations.get(T.id),qn=p.isTileAffectedByFog(Ln),Zn=p.getOrCreateProgram("fillExtrusionGroundEffect",{config:Gn,defines:In,overrideFog:qn}),Hn=((pr,ni,Cr,Fr,Fi,Bi,no,Ii,mo,io)=>({u_matrix:pr,u_opacity:ni,u_ao_pass:Cr?1:0,u_meter_to_tile:Fr,u_ao:Fi,u_flood_light_intensity:Bi,u_flood_light_color:no,u_attenuation:Ii,u_edge_radius:mo,u_fb:0,u_fb_size:io,u_dynamic_offset:1}))(nn,ie,q,En,[ae,de*En],pe,_e,Se,ht>=17?0:un*En,Xe?Xe.size[0]:0),ur=[];Fe&&ur.push(zn.hiddenByLandmarkVertexBuffer),null!=zn.groundRadiusBuffer&&ur.push(zn.groundRadiusBuffer),p.uploadCommonUniforms(rt,Zn,Ln.toUnwrapped(),null,_n),Zn.draw(p,rt.gl.TRIANGLES,R,M,F,G,Hn,T.id,zn.vertexBuffer,zn.indexBuffer,or,T.paint,ht,Gn,ur)};for(const Ln of S){const zn=y.getTile(Ln),or=zn.getBucket(T);if(!or||or.projection.name!==Bt.projection.name||!or.groundEffect||or.groundEffect&&!or.groundEffect.hasData())continue;const nn=or.groundEffect,En=1/or.tileToMeter;{const In=p.translatePosMatrix(Ln.projMatrix,zn,Lt,Nt),Gn=nn.getDefaultSegment();Dn(Ln,nn,Gn,In,En)}if(Ye)for(let In=0;In<4;In++){const Gn=fTt[In](Ln),qn=y.getTile(Gn);if(!qn)continue;const Zn=qn.getBucket(T);if(!Zn||Zn.projection.name!==Bt.projection.name||!Zn.groundEffect||Zn.groundEffect&&!Zn.groundEffect.hasData())continue;const Hn=Zn.groundEffect;let ur,pr;0===In?(ur=[-8192,0,0],pr=1):1===In?(ur=[qr,0,0],pr=0):2===In?(ur=[0,-8192,0],pr=3):(ur=[0,qr,0],pr=2);const ni=Hn.regionSegments[pr];ni&&(L(OEt,Ln.projMatrix,ur),Dn(Ln,Hn,ni,p.translatePosMatrix(OEt,zn,Lt,Nt),En))}}}const E2r={model:b=>({u_matrix:new Ff(b),u_lighting_matrix:new Ff(b),u_normal_matrix:new Ff(b),u_node_matrix:new Ff(b),u_lightpos:new _u(b),u_lightintensity:new Eo(b),u_lightcolor:new _u(b),u_camera_pos:new _u(b),u_opacity:new Eo(b),u_baseColorFactor:new zv(b),u_emissiveFactor:new zv(b),u_metallicFactor:new Eo(b),u_roughnessFactor:new Eo(b),u_baseTextureIsAlpha:new vu(b),u_alphaMask:new vu(b),u_alphaCutoff:new Eo(b),u_baseColorTexture:new vu(b),u_metallicRoughnessTexture:new vu(b),u_normalTexture:new vu(b),u_occlusionTexture:new vu(b),u_emissionTexture:new vu(b),u_lutTexture:new vu(b),u_color_mix:new zv(b),u_aoIntensity:new Eo(b),u_emissive_strength:new Eo(b),u_occlusionTextureTransform:new zv(b),u_dithered_discard_threshold:new Eo(b)}),modelDepth:b=>({u_matrix:new Ff(b),u_instance:new Ff(b),u_node_matrix:new Ff(b)}),groundShadow:b=>({u_matrix:new Ff(b),u_ground_shadow_factor:new _u(b)}),fillExtrusionDepth:b=>({u_matrix:new Ff(b),u_edge_radius:new Eo(b),u_width_scale:new Eo(b),u_vertical_scale:new Eo(b),u_height_type:new vu(b),u_base_type:new vu(b)}),fillExtrusionGroundEffect:b=>({u_matrix:new Ff(b),u_opacity:new Eo(b),u_ao_pass:new Eo(b),u_meter_to_tile:new Eo(b),u_ao:new xd(b),u_flood_light_intensity:new Eo(b),u_flood_light_color:new _u(b),u_attenuation:new Eo(b),u_edge_radius:new Eo(b),u_fb:new vu(b),u_fb_size:new Eo(b),u_dynamic_offset:new Eo(b)})};function zEt(b){const p=b.properties.get("direction"),y=wr(p.x,p.y,p.z);y[2]=bn(y[2],0,75);const T=xr([y[0],y[1],y[2]]);return ce(T.x,T.y,T.z)}function UEt(b,p,y){const T="none"===p.properties.get("color-use-theme"),S=p.properties.get("color"),R=p.properties.get("intensity"),M=p.properties.get("direction"),F=[M.x,M.y,M.z],G="none"===y.properties.get("color-use-theme"),q=y.properties.get("color"),Q=y.properties.get("intensity"),ie=Math.max(mt([0,0,1],F),0),ae=[0,0,0];ge(ae,q.toPremultipliedRenderColor(G?null:b.getLut(p.scope)).toArray01Linear().slice(0,3),Q);const de=[0,0,0];return ge(de,S.toPremultipliedRenderColor(T?null:b.getLut(y.scope)).toArray01Linear().slice(0,3),ie*R),bi([ae[0]>0?ae[0]/(ae[0]+de[0]):0,ae[1]>0?ae[1]/(ae[1]+de[1]):0,ae[2]>0?ae[2]/(ae[2]+de[2]):0])}const lce=[];function VEt(b){return lce[b]=lce[b]||new Float64Array(16)}const cce=[],C2r=new Float32Array(16);class S2r{constructor(p,y){this.aabb=p,this.lastCascade=y}}class A2r{add(p,y){const T=this.receivers[p.key];void 0!==T?(T.aabb.min[0]=Math.min(T.aabb.min[0],y.min[0]),T.aabb.min[1]=Math.min(T.aabb.min[1],y.min[1]),T.aabb.min[2]=Math.min(T.aabb.min[2],y.min[2]),T.aabb.max[0]=Math.max(T.aabb.max[0],y.max[0]),T.aabb.max[1]=Math.max(T.aabb.max[1],y.max[1]),T.aabb.max[2]=Math.max(T.aabb.max[2],y.max[2])):this.receivers[p.key]=new S2r(y,null)}clear(){this.receivers={}}get(p){return this.receivers[p.key]}computeRequiredCascades(p,y,T){const S=xl.fromPoints(p.points);let R=0;for(const M in this.receivers){const F=this.receivers[M];if(!F)continue;if(!S.intersectsAabb(F.aabb))continue;F.aabb.min=S.closestPoint(F.aabb.min),F.aabb.max=S.closestPoint(F.aabb.max);const G=F.aabb.getCorners();for(let q=0;q1||ae[1]<-1||ae[1]>1){Q=false;break}}if(F.lastCascade=q,R=Math.max(R,q),Q)break}}return R+1}}function uce(b,p,y){const T=ct([],we([],y,p),we([],b,p)),S=re(T);return 0===S?[0,0,1,0]:(ge(T,T,1/S),[T[0],T[1],T[2],-mt(T,p)])}function k2r(b,p,y,T,S,R){const M=b.zoom,F=b.scale,G=b.worldSize,q=1/G,Q=b.aspect,ie=Math.sqrt(1+Q*Q)*Math.tan(.5*b.fovX),ae=ie*ie,de=T-y,pe=T+y;let _e,Se;ae>de/pe?(_e=T,Se=T*ie):(_e=.5*pe*(1+ae),Se=.5*Math.sqrt(de*de+2*(T*T+y*y)*ae+pe*pe*ae*ae));const Fe=b.projection.pixelsPerMeter(b.center.lat,G),Ye=[0,0,-_e*q];it(Ye,Ye,b._camera.getCameraToWorldMercator());let Xe=Se*q;const We=function(En){return En[0]/=F,En[1]/=F,En[2]=E(En[2],b._center.lat),En},rt=b._edgeInsets;if(!(0===rt.left&&0===rt.top&&0===rt.right&&0===rt.bottom||rt.left===rt.right&&rt.top===rt.bottom)){const En=b._camera.getWorldToCamera(b.worldSize,"meters"===b.projection.zAxisUnit?Fe:1),In=b._camera.getCameraToClipPerspective(b._fov,b.width/b.height,y,T);In[8]=2*-b.centerOffset.x/b.width,In[9]=2*b.centerOffset.y/b.height;const Gn=new Float64Array(16);J(Gn,In,En);const qn=new Float64Array(16);A(qn,Gn);const Zn=EA.fromInvProjectionMatrix(qn,G,M,true);for(const Hn of Zn.points){const ur=We(Hn);Xe=Math.max(Xe,Be(be([],Ye,ur)))}}Xe*=S/(S-1);const lt=Math.acos(p[2]),Bt=Math.atan2(-p[0],-p[1]),ht=new Qle;ht.position=Ye,ht.setPitchBearing(lt,Bt);const Tt=ht.getWorldToCamera(G,Fe),Lt=Xe*G,Nt=Math.min(b._mercatorZfromZoom(17)*G*-2,-2*Lt),un=ht.getCameraToClipOrthographic(-Lt,Lt,-Lt,Lt,Nt,(Lt+R*Fe)/p[2]),_n=new Float64Array(16);P(_n,un,Tt);const Dn=.5*S,Ln=[0,0,0];it(Ln,ce(Math.floor(1e6*Ye[0])/1e6*G,Math.floor(1e6*Ye[1])/1e6*G,0),_n),ge(Ln,Ln,Dn);const zn=[Math.floor(Ln[0]),Math.floor(Ln[1]),Math.floor(Ln[2])],or=[0,0,0];we(or,Ln,zn),ge(or,or,-1/Dn);const nn=new Float64Array(16);return _(nn),L(nn,nn,or),P(_n,nn,_n),[_n,Lt]}class IA extends tm{constructor(p,y,T,S){super(),this.id=p,this.type="model",this.models=[],this._options=y,this._modelsInfo=new Map,this._abortController=null}cancelModelRequests(){this._abortController&&(this._abortController.abort(),this._abortController=null)}async loadGLTFFromURI(p,y){return ywt((await this.map._requestManager.transformRequest(p,Ga.Model,y)).url,y)}async loadModel(p,y,T){try{const S=await this.loadGLTFFromURI(y.uri,T);if(T.aborted)return;const R=this._modelsInfo.get(p);if(!R)return;const M=j5e(S),F=R.modelSpec,G=new Twt(p,F.uri,F.position,F.orientation,M);IA.applyModelSpecification(G,F),G.computeBoundsAndApplyParent(),this.models.push(G),R.model=G}catch(S){if(T.aborted)return;this.fire(new hp(new Error(`Could not load model ${p} from ${y.uri}`,{cause:S})))}}async load(){this._abortController||(this._abortController=new AbortController);const p=this._abortController.signal,y=[];for(const T in this._options.models){const S=this._options.models[T],R=this._modelsInfo.get(T);if(R&&R.model){R.modelSpec=S;const M=R.model;M.position=null!=S.position?new Ea(S.position[0],S.position[1]):new Ea(0,0),M.orientation=S.orientation??[0,0,0],IA.applyModelSpecification(M,S),M.computeBoundsAndApplyParent(),this.models.push(M)}else R?R.modelSpec=S:(this._modelsInfo.set(T,{modelSpec:S,model:null}),y.push(this.loadModel(T,S,p)))}0!==y.length?(await Promise.allSettled(y),p.aborted||this.fire(new l0("data",{dataType:"source",sourceDataType:"metadata"}))):this.loaded()&&this.fire(new l0("data",{dataType:"source",sourceDataType:"metadata"}))}static arrayFromColorSpecification(p){const y=p;if(void 0===y)return;if(Array.isArray(y))return[y[0],y[1],y[2]];const T=Wo.parse(y);return T?[T.r,T.g,T.b]:void 0}static applyModelSpecification(p,y){if(y.nodeOverrides&&IA.convertNodeOverrides(p,y.nodeOverrides),y.materialOverrides&&IA.convertMaterialOverrides(p,y.materialOverrides),y.nodeOverrideNames&&(p.nodeOverrideNames=[...y.nodeOverrideNames]),y.materialOverrideNames&&(p.materialOverrideNames=[...y.materialOverrideNames]),y.featureProperties&&(p.featureProperties=y.featureProperties),y.lightOverrides){const T=y.lightOverrides,S=IA.arrayFromColorSpecification(T["light-ambient-color"]),R=IA.arrayFromColorSpecification(T["light-directional-color"]);p.lightOverrides={ambientIntensity:T["light-ambient-intensity"],ambientColor:S,directionalIntensity:T["light-directional-intensity"],directionalColor:R}}else p.lightOverrides=void 0}static convertNodeOverrides(p,y){if(Array.isArray(y)&&y.every(T=>"string"==typeof T)){p.nodeOverrideNames=[];for(const T of y)p.nodeOverrideNames.push(T)}else Object.entries(y).forEach(([T,S])=>{const R={orientation:[0,0,0],minZoom:void 0,maxZoom:void 0};if(Object.hasOwn(S,"orientation")){const M=S.orientation;M&&(R.orientation=M)}Object.hasOwn(S,"minzoom")&&(R.minZoom=S.minzoom),Object.hasOwn(S,"maxzoom")&&(R.maxZoom=S.maxzoom),p.nodeOverrides.set(T,R)})}static convertMaterialOverrides(p,y){if(Array.isArray(y)&&y.every(T=>"string"==typeof T)){p.materialOverrideNames=[];for(const T of y)p.materialOverrideNames.push(T)}else Object.entries(y).forEach(([T,S])=>{const R=IA.arrayFromColorSpecification(S["model-color"]),M={color:void 0!==R?new Wo(R[0],R[1],R[2]):new Wo(1,1,1),colorMix:0,emissionStrength:0,opacity:1},F=S["model-color-mix-intensity"];void 0!==F&&(M.colorMix=F);const G=S["model-emissive-strength"];void 0!==G&&(M.emissionStrength=G);const q=S["model-opacity"];void 0!==q&&(M.opacity=q),p.materialOverrides.set(T,M)})}onAdd(p){this.map=p,this.load()}hasTransition(){return false}loaded(){if(0===this._modelsInfo.size)return true;for(const p of this._modelsInfo.values())if(null==p.model)return false;return true}getModels(){return this.models}loadTile(p,y){}serialize(){return this._options}setProperty(p,y){return false}reload(){this.cancelModelRequests();const p=M7(this.id,this.scope);this.map.style.clearSource(p),this.models=[],this._modelsInfo.clear(),this.load()}onRemove(p){this.cancelModelRequests()}setModels(p){this.models=[];const y=new Map;for(const T in p){const S=p[T],R=this._modelsInfo.get(T);R&&R.modelSpec.uri===S.uri&&y.set(T,R)}if(this._modelsInfo.size!==y.size){this.cancelModelRequests();for(const[T,S]of y)S.model||y.delete(T)}this._modelsInfo=y,this._options.models=p,this.load()}}function $Et(b,p,y){try{p=function(S){if(!S.variants)return S;if(!Array.isArray(S.variants))throw new Error("variants must be an array");for(const R of S.variants){if(null==R||"object"!=typeof R||R.constructor!==Object)throw new Error("variant must be an object");if(!Array.isArray(R.capabilities))throw new Error("capabilities must be an array");if(1===R.capabilities.length&&"meshopt"===R.capabilities[0])return Object.assign(S,R)}return S}(p)}catch(S){return new Error("Failed to process TileJSON variants",{cause:S})}const T=Pr({...p,...b},["tilejson","tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","extra_bounds","scheme","tileSize","encoding","vector_layers","raster_layers","worldview_options","worldview_default","worldview"]);return b.url&&p.tiles&&b.tiles&&(T.tiles=p.tiles),T.tiles=y.canonicalizeTileset(T,b.url),T}function GEt(b,p,y,T,S){const R=function(F,G){if(F)return S(F);if(G){b.url&&G.tiles&&b.tiles&&delete b.tiles;const q=$Et(b,G,p);if(q instanceof Error)return S(q);S(null,q)}},M=function(F,G,q){if(!F)return null;if(!G&&!q)return F;q=q||F.worldview_default;const Q=Object.values(F.language||{});if(0===Q.length)return null;const ie=Object.values(F.worldview||{});if(0===ie.length)return null;const ae=Q.every(pe=>pe===G),de=ie.every(pe=>pe===q);return ae&&de?F:G in(F.language_options||{})||q in(F.worldview_options||{})?null:F.language_options&&F.worldview_options?F:null}(b.data,y,T);if(M)return Ct.frame(()=>R(null,M));if(b.url){const F=new AbortController;return(async()=>{const G=await p.transformRequest(p.normalizeSourceURL(b.url,null,y,T),Ga.Source,F.signal),{data:q}=await xu(G,F.signal);R(null,q)})().catch(G=>{F.signal.aborted||R(G)}),{cancel:()=>F.abort()}}return Ct.frame(()=>{const{data:F,...G}=b;R(null,G)})}function HEt(b,p){const y=Math.pow(2,p.z),T=Math.floor(ly(b.getWest())*y),S=Math.floor(Qm(b.getNorth())*y),R=Math.ceil(ly(b.getEast())*y),M=Math.ceil(Qm(b.getSouth())*y);return p.x>=T&&p.x=S&&p.ythis.maxzoom||p.z{q&&(q.useNormalOffset=true,Q||(q.enabled=true))},ae=p.getSource();if("light-beam"===b.renderPass&&"batched-model"!==ae.type)return;if("vector"===ae.type||"geojson"===ae.type)return function(We,rt,lt,Bt,ht){const Tt=We.transform,Lt="globe"===Tt.projection.name,Nt=Tt.getFreeCameraOptions().position;if(!We.modelManager)return;const un=We.modelManager;lt.modelManager=un;const _n=We.shadowRenderer;if(!Object.hasOwn(lt._unevaluatedLayout._values,"model-id"))return;const Dn=lt._unevaluatedLayout._values["model-id"],Ln={...lt.layout.get("model-id").parameters},zn=We.style.order.indexOf(lt.fqid),or=lt.paint.get("model-opacity").constantOr(1);for(const nn of Bt){const En=rt.getTile(nn).getBucket(lt);if(!En||En.projection.name!==Tt.projection.name)continue;const In=En.getModelUris();if(In&&!En.modelsRequested&&(un.addModelsFromBucket(In,ht),En.modelsRequested=true),Lt)Ln.zoom=nn.overscaledZ;else{const Cr=d2r(nn,Tt);Ln.zoom=Cr}const Gn=Dn.possiblyEvaluate(Ln);if(u2r(We,En,nn),H2.shadowUniformsInitialized=false,H2.useSingleShadowCascade=!!_n&&0===_n.getMaxCascadeForTile(nn.toUnwrapped()),"shadow"===We.renderPass&&_n){if(1===We.currentShadowCascade&&En.isInsideFirstShadowMapFrustum)continue;const Cr=Tt.calculatePosMatrix(nn.toUnwrapped(),Tt.worldSize);if(H2.tileMatrix.set(Cr),H2.shadowTileMatrix.set(_n.calculateShadowPassMatrixFromMatrix(Cr)),H2.aabb.min=[0,0,0],H2.aabb.max[0]=H2.aabb.max[1]=qr,H2.aabb.max[2]=0,h2r(En,H2,We,lt.scope))continue}const qn=1<0&&We.style.isLayerClipped(lt,rt.getSource())&&En.updateReplacement(nn,We.replacementSource,zn,lt.scope)&&(En.uploaded=false,En.upload(We.context));let Hn=0;const ur=new Array,pr=new Array,ni=new Array;for(let Cr in En.instancesPerModel){const Fr=En.instancesPerModel[Cr];Fr.features.length>0&&!Lt&&(Cr=Gn.evaluate(Fr.features[0].feature,{}));const Fi=un.getModel(Cr,ht);if(Fi||un.hasURLBeenRequested(Cr)||En.modelUris.includes(Cr)||(En.modelUris.push(Cr),En.modelsRequested=false),Fi&&Fi.uploaded)if(Lt){const Bi=ge([],[Nt.x,Nt.y,Nt.z],We.transform.worldSize);tt(Bi,Bi);for(let no=0;no0&&xa.elevationUpdate(Fr.terrain,Ii,io,Bi.source),xa.needsReEvaluation(Fr,mo,Bi)&&xa.evaluate(Bi))}})(We,rt,lt,Bt),function(){const Fr=new Map;let Fi,Bi,no;pr?(Fi=Bt.length-1,Bi=-1,no=-1):(Fi=0,Bi=Bt.length,no=1);const Ii=oe(),mo=new nt(0,0);for(let io=Fi;io!==Bi;io+=no){const xa=Bt[io],va=rt.getTile(xa).getBucket(lt);if(!va||!va.uploaded)continue;let ja=false;Nt&&(ja=0===Nt.getMaxCascadeForTile(xa.toUnwrapped()));const Ss=Tt.calculatePosMatrix(xa.toUnwrapped(),Tt.worldSize),_d=!!(4&va.modelTraits);P(TBe,zn,Ss),P(wBe,Tt.expandedFarZProjMatrix,Ss),A(nce,TBe),C(nce,nce);const y0=!Gn&&Nt&&Nt.enabled?Nt.computeCascadeTileMatrices(Ss):null;!Gn&&pr&&(A(kI,Ss),it(Ii,_n,kI),mo.x=Ii[0],mo.y=Ii[1]);const Tu=[];va.setFilter(lt.filter);for(const Ma of va.getNodesInfo()){if(Ma.hiddenByReplacement)continue;if(!Ma.node.meshes)continue;const Gl=Ma.node;let Ou=0;We.terrain&&Gl.elevation&&(Ou=Gl.elevation*We.terrain.exaggeration());const Td=()=>{const Hl=Ma.aabb,my=In.min,gy=In.max;return my[0]=Hl.min[0],my[1]=Hl.min[1],my[2]=Hl.min[2]+Ou,gy[0]=Hl.max[0],gy[1]=Hl.max[1],gy[2]=Hl.max[2]+Ou,it(my,my,Ss),it(gy,gy,Ss),In},Po=Td(),Nf=Ma.evaluatedScale;if(Nf[0]<=1&&Nf[1]<=1&&Nf[2]<=1&&0===Po.intersects(Hn))continue;if(!Gn){const Hl=Po.min,my=Po.max;ice[0]=.5*(Hl[0]+my[0]),ice[1]=.5*(Hl[1]+my[1]),ice[2]=.5*(Hl[2]+my[2]);const gy=Le(_n,ice)*Ln,sh=We._debugParams.lodSwitchDistance,W2=sh>=0;if(W2&&sh>=9999)Ma.targetLod=0;else{let Fb;if(W2)Fb=sh;else{const cm=(my[2]-Hl[2])*Ln*Nf[2],MA=Math.max(my[0]-Hl[0],my[1]-Hl[1])*Ln*Math.max(Nf[0],Nf[1]);let _T;_T=cm>=30?1:MA>=80?.5:Math.max(cm,MA)>=20?.25:0,Fb=2e3+3e3*_T}f2r(Ma,gy,Math.min(We.frameTimeDelta,1e3/30),Fb,We._debugParams.lodSwitchFadeDuration)}}if(!Gn&&pr){const Hl=1/6;Ma.cameraCollisionOpacity=_n[0]>Po.min[0]&&_n[0]Po.min[1]&&_n[1]!pr||1===Ma.opacity&&1===Gl.opacity?Ma.depthGl.depth?-1:1);for(const Ma of Tu){const Gl=Ma.nodeInfo,Ou=Gl.node;let Td=null;if(We._debugParams.show3DModelFootprints&&Ou.footprint){const Mh=Ou.id||Ou.name||"footprint";if(!Fr.has(Mh)){const py=lX(new Float64Array(16),wBe,Ma.tileTranslation,Ma.nodeInfo.evaluatedScale);Fr.set(Mh,{node:Ou,mvp:py})}}const Po=Ma.nodeInfo.evaluatedScale;lX(G2,TBe,Ma.tileTranslation,Po),rce[0]=1/Po[0],rce[1]=-1/Po[1],rce[2]=1/Po[2],I(kI,nce,rce),P(G2,G2,Ou.globalMatrix);const Nf=_d?0:Gl.evaluatedRMEA[0][2],Of=Gl.targetLod,sm=Ou.lodMeshes&&Ou.lodMeshes.length>0,lm=sm&&Of>0&&Of<1;if(Gn&&sm&&1===Math.round(Of))continue;const fy=!Gn&&Lt?fEt(dEt,Ma.nodeModelMatrix,We.transform):null,hy=Gn&&Nt?Nt.calculateShadowPassMatrixFromMatrix(Ma.nodeModelMatrix):null,Ih=lm?2:1,ah=sm&&1===Math.round(Of);for(let Mh=0;Mh=sX||BBe>=sX}const No=sh.material;let mf;No.occlusionTexture&&No.occlusionTexture.offsetScale&&(mf=No.occlusionTexture.offsetScale,cm.defines.push("OCCLUSION_TEXTURE_TRANSFORM")),lm&&cm.defines.push("DITHERED_DISCARD");const Wl=We.getOrCreateProgram("model",cm);if(!Gn&&Nt&&Nt.enabled)if(Td!==_T){for(let lh=0;lh0){const io=Array.from(Fr.keys()).sort();for(const xa of io){const{node:va,mvp:ja}=Fr.get(xa);pEt(We,0,va,ja)}}}()}(b,p,y,T),void ie();if("model"!==ae.type)return;const de=ae.getModels(),pe=[],_e=b.transform.getFreeCameraOptions().position,Se=ge([],[_e.x,_e.y,_e.z],b.transform.worldSize);tt(Se,Se);const Fe=[],Ye=[];let Xe=0;for(const We of de){const rt=p.getFeatureState("",We.id),lt={type:"Unknown",id:We.id,properties:We.featureProperties},Bt=y.paint.get("model-rotation").evaluate(lt,rt),ht=y.paint.get("model-scale").evaluate(lt,rt),Tt=y.paint.get("model-translation").evaluate(lt,rt),Lt=y.paint.get("model-opacity").evaluate(lt,rt);l2r(y,We.id,rt,We.featureProperties,We.nodeOverrideNames,We.nodeOverrides),c2r(y,We.id,rt,We.featureProperties,We.materialOverrideNames,We.materialOverrides),We.nodeOverrides.size>0&&We.computeBoundsAndApplyParent(),We.computeModelMatrix(b,Bt,ht,Tt,F,M,false);const Nt=U([],Se),un=W([],[1,1,1/Z(We.position.lat,b.transform.zoom)]);pe.push({zScaleMatrix:un,negCameraPosMatrix:Nt});for(const _n of We.nodes)ABe(b,_n,We.matrix,b.transform.expandedFarZProjMatrix,Xe,Fe,Ye,We.materialOverrides,Lt,void 0,We.lightOverrides);Xe++}if(Fe.sort((We,rt)=>rt.depth-We.depth),"shadow"!==b.renderPass){if(b._debugParams.show3DModelFootprints){const We=b.transform.projMatrix,rt=new Map,lt=(ht,Tt)=>{if(ht.footprint){const Lt=ht.id||ht.name||"footprint";if(!rt.has(Lt)){const Nt=P([],We,Tt);rt.set(Lt,{node:ht,mvp:Nt})}}};for(const ht of Ye)lt(ht.node,ht.modelMatrix);for(const ht of Fe)lt(ht.node,ht.modelMatrix);const Bt=Array.from(rt.keys()).sort();for(const ht of Bt){const{node:Tt,mvp:Lt}=rt.get(ht);pEt(b,0,Tt,Lt)}}mEt(b,y,Fe,Ye,pe),ie()}else{for(const We of Ye)cX(We.mesh,We.nodeModelMatrix,b,y);for(const We of Fe)cX(We.mesh,We.nodeModelMatrix,b,y);ie()}},prepare:function(b,p,y){const T=p.getSource();if(!T.loaded())return;if("vector"===T.type||"geojson"===T.type)return void(y.modelManager&&y.modelManager.upload(y,hEt(y,b)));if("batched-model"===T.type)return;if("model"!==T.type)return;const S=T.getModels();for(const R of S)R.upload(y.context)},shaders:_2r,programUniforms:E2r,ShadowRenderer:class{constructor(b){this.painter=b,this._enabled=false,this._drawShadowAfterLayer=-1,this._numCascadesToRender=0,this._cascades=[],this._groundShadowTiles=[],this._receivers=new A2r,this._depthMode=new Rh(b.context.gl.LEQUAL,Rh.ReadWrite,[0,1]),this._uniformValues={u_light_matrix_0:new Float32Array(16),u_light_matrix_1:new Float32Array(16),u_shadow_intensity:0,u_fade_range:[0,0],u_shadow_normal_offset:[1,1,1],u_shadow_texel_size:1,u_shadow_map_resolution:1,u_shadow_direction:[0,0,1],u_shadow_bias:[36e-5,.0012,.012],u_shadowmap_0:0,u_shadowmap_1:0},this._forceDisable=false,this._devtoolsFolder=null,this.useNormalOffset=false,this._shadowParameters={cascadeCount:2,normalOffset:3,shadowMapResolution:2048}}destroy(){for(const b of this._cascades)b.texture.destroy(),b.framebuffer.destroy();this._cascades=[]}updateShadowParameters(b,p){const y=this.painter;if(this._enabled=false,this._drawShadowAfterLayer=-1,this._receivers.clear(),!p||!p.properties)return;const T=p.properties.get("shadow-intensity"),S=p.properties.get("shadow-draw-before-layer");if(!p.shadowsEnabled()||T<=0)return;let R=-1,M=0;for(const Se of y.style.order){const Fe=y.style._mergedLayers[Se];Fe.hasShadowPass()&&!Fe.isHidden(b.zoom)&&(R=M),!S||S!==Se&&S!==Fe.slot||(this._drawShadowAfterLayer=M>0?M-1:0),M+=1}if(this._enabled=R>=0,!this.enabled)return;this._drawShadowAfterLayer<0&&(this._drawShadowAfterLayer=R);const F=y.context,G=this._shadowParameters.shadowMapResolution,q=this._shadowParameters.shadowMapResolution;if(0===this._cascades.length||this._shadowParameters.shadowMapResolution!==this._cascades[0].texture.size[0]){this._cascades=[];for(let Se=0;SeYe.dem).forEach(Ye=>{const Xe=Ye.dem.tree;Fe[0]=Math.min(Fe[0],Xe.minimums[0]),Fe[1]=Math.max(Fe[1],Xe.maximums[0])}),1e4!==Fe[0]&&(Q=(Fe[1]-Fe[0])*Se.exaggeration())}const ie=1.5*b.cameraToCenterDistance,ae=3*ie,de=new Float64Array(16);for(let Se=0;Se=0)return{};const S=function(F,G,q){const Q=q/(1<0&&(xe(S[1],S[1],[T[0]*R,0,0]),xe(S[2],S[2],[T[0]*R,0,0])),T[1]<0?(xe(S[0],S[0],[0,T[1]*R,0]),xe(S[1],S[1],[0,T[1]*R,0])):T[1]>0&&(xe(S[2],S[2],[0,T[1]*R,0]),xe(S[3],S[3],[0,T[1]*R,0]));const M={};return M.vertices=S,M.planes=[uce(S[1],S[0],S[4]),uce(S[2],S[1],S[5]),uce(S[3],S[2],S[6]),uce(S[0],S[3],S[7])],M}addShadowReceiver(b,p,y){this._receivers.add(b,xl.fromTileIdAndHeight(b,p,y))}getMaxCascadeForTile(b){const p=this._receivers.get(b);return p&&p.lastCascade?p.lastCascade:0}},drawGroundEffect:BEt,queryModelLayerRendered:function(b,p,y,T){const S=y.getSource();if(!S||"model"!==S.type)return{};const R=S,M={};M[b.id]=[];const F=M[b.id];let G=0;for(const q of R.models){const Q=y.getFeatureState(b.sourceLayer,q.id),ie={type:"Unknown",id:q.id,properties:q.featureProperties},ae=b.paint.get("model-rotation").evaluate(ie,Q),de=b.paint.get("model-scale").evaluate(ie,Q),pe=b.paint.get("model-translation").evaluate(ie,Q),_e=b.paint.get("model-elevation-reference");let Se=[];Lle(Se,q,T,q.position,ae,de,pe,"ground"===_e,"ground"===_e,false),"globe"===T.projection.name&&(Se=Mle(Se,T));const Fe=P([],T.projMatrix,Se),Ye=G5e(p.isPointQuery()?p.screenBounds:p.screenGeometry,T,Fe,q.aabb);if(null!=Ye){const Xe=new w4(void 0,0,0,0,q.id);Xe.layer=b.layer,Xe.properties=structuredClone(q.featureProperties),Xe.properties.layer=b.id,Xe.properties.uri=q.uri,Xe.properties.orientation=q.orientation,Xe.sourceLayer=b.sourceLayer,Xe.geometry={type:"Point",coordinates:[q.position.lng,q.position.lat]},Xe.state=Q,Xe.source=b.source,F.push({featureIndex:G,feature:Xe,intersectionZ:Ye})}++G}return M},queryModelLayerIntersectsFeature:function(b,p,y,T,S,R){if(!b.modelManager)return false;const M=b.modelManager,F=p.tile.getBucket(b);if(!(F&&F instanceof uBe))return false;for(const G in F.instancesPerModel){const q=F.instancesPerModel[G],Q=void 0!==y.id?y.id:y.properties&&Object.hasOwn(y.properties,"id")?y.properties.id:void 0;if(Object.hasOwn(q.idToFeaturesIndex,Q)){const ie=q.features[q.idToFeaturesIndex[Q]],ae=M.getModel(G,R||b.scope);if(!ae)return false;let de=[];const pe=new Ea(0,0),_e=F.canonical;let Se=Number.MAX_VALUE;for(let Fe=0;Fethis.map.style.clearSource(b))}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}load(b){this._loaded=false,this.fire(new l0("dataloading",{dataType:"source"}));const p=Array.isArray(this.map._language)?this.map._language.join():this.map._language,y=this.map.getWorldview();this._tileJSONRequest=GEt(this._options,this.map._requestManager,p,y,(T,S)=>{this._tileJSONRequest=null,this._loaded=true,T?(p&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${p}`),y&&2!==y.length&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${y}`),this.fire(new hp(T))):S&&(Object.assign(this,S),S.bounds&&(this.tileBounds=new dce(S.bounds,this.minzoom,this.maxzoom)),em(S.tiles,this.map._requestManager._customAccessToken),this.fire(new l0("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new l0("data",{dataType:"source",sourceDataType:"content"}))),b&&b(T)})}hasTransition(){return false}hasTile(b){return!this.tileBounds||this.tileBounds.contains(b.canonical)}loaded(){return this._loaded}async loadTile(b,p){const y=this.map._requestManager.normalizeTileURL(b.tileID.canonical.url(this.tiles,this.scheme)),T=!b.actor||"expired"===b.state;if(T)b.actor=this.dispatcher.getActor();else{if("loading"===b.state)return void(b.reloadCallback=p);if(b.buckets){const F=Object.values(b.buckets);for(const G of F)G.dirty=true;return void(b.state="loaded")}}const S=T?"loadTile":"reloadTile",R=new AbortController;b.request=R;const M=(F,G)=>(delete b.request,b.aborted?p(null):F&&!ha(F)?p(F):(this.map._refreshExpiredTiles&&G&&b.setExpiryData(Ot(G.headers)),b.loadModelData(G,this.map.painter),b.state="loaded",p(null),void(b.reloadCallback&&(this.loadTile(b,b.reloadCallback),b.reloadCallback=null))));try{const F=await this.map._requestManager.transformRequest(y,Ga.Tile,R.signal);if(R.signal.aborted)return p(null);const G={request:F,data:void 0,uid:b.uid,tileID:b.tileID,tileZoom:b.tileZoom,zoom:b.tileID.overscaledZ,tileSize:this.tileSize*b.tileID.overscaleFactor(),type:this.type,source:this.id,scope:this.scope,showCollisionBoxes:this.map.showCollisionBoxes,renderSourceType:b.renderSourceType,brightness:this.map.style&&this.map.style.getBrightness()||0,pixelRatio:Ct.devicePixelRatio,promoteId:this.promoteId};b.request=b.actor.sendCancelable(S,G,{},M)}catch(F){if(R.signal.aborted)return p(null);p(F)}}abortTile(b){b.request&&(b.request.abort(),delete b.request),b.actor&&b.actor.notify("abortTile",{uid:b.uid,type:this.type,source:this.id,scope:this.scope})}serialize(){return{...this._options}}},loadModel:async function(b,p,y){const T=await ywt(b),S=new Twt(p,y,void 0,void 0,j5e(T));return S.computeBoundsAndApplyParent(),S}};class WEt{constructor(p,y){this.tileID=p,this.x=p.canonical.x,this.y=p.canonical.y,this.z=p.canonical.z,this.grid=new t4(qr,qr,512),this.featureIndexArray=new Ha,this.promoteId=y,this.is3DTile=false,this.serializedLayersCache=new Map}insert(p,y,T,S,R,M=0,F=0){const G=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(T,S,R,M);const q=this.grid;for(let Q=0;Q=0&&ae[3]>=0&&q.insert(G,ae[0],ae[1],ae[2],ae[3])}}loadVTLayers(){if(!this.vtLayers){this.vtLayers=new XOe(new cle(this.rawTileData)).layers,this.sourceLayerCoder=new j2t(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={};for(const p in this.vtLayers)this.vtFeatures[p]=[]}return this.vtLayers}query(p,y){const{tilespaceGeometry:T,transform:S,tileTransform:R,pixelPosMatrix:M,availableImages:F,worldview:G}=y;this.loadVTLayers(),this.serializedLayersCache.clear();const q=y.queryRadius?y.queryRadius:0,Q=T.bufferedTilespaceBounds,ie=this.grid.queryKeys(Q.min.x,Q.min.y,Q.max.x,Q.max.y,(_e,Se,Fe,Ye)=>e5e(T.bufferedTilespaceGeometry,_e-q,Se-q,Fe+q,Ye+q));ie.sort(R2r);let ae=null;S.elevation&&ie.length>0&&(ae=tz.create(S.elevation,this.tileID));const de={};let pe;for(let _e=0;_e(Ye||(Ye=vt(Xe,this.tileID.canonical,R)),We.queryIntersectsFeature(T,Xe,rt,Ye,this.z,S,M,ae,lt,y.scope)))}return de}loadMatchingFeature(p,y,T,S,R,M){const{featureIndex:F,bucketIndex:G,sourceLayerIndex:q,layoutVertexArrayOffset:Q}=y,ie=this.bucketLayerIDs[G],ae=T.layers,de=Object.keys(ae);if(de.length&&!st(de,ie))return;const pe=T.sourceCache,_e=this.sourceLayerCoder.decode(q),Se=this.vtLayers[_e].feature(F),Fe=this.getId(Se,_e);for(let Ye=0;Ye`${F.key}: ${F.message}`).join(", ");return void yn(`Failed to create expression for promoteId: ${M}`)}this.promoteIdExpression=R.value}T=this.promoteIdExpression.evaluate({zoom:0},p)}else T=p.properties[S];"boolean"==typeof T&&(T=Number(T))}return T}}function YEt(b,p,y,T,S){return Pa(b,(R,M)=>{const F=p instanceof O2?p.get(M):null;return F&&F.evaluate?F.evaluate(y,T,void 0,S):F})}function R2r(b,p){return p-b}async function qEt(){return Promise.resolve()}li(WEt,"FeatureIndex",{omit:["rawTileData","sourceLayerCoder"]});const P2r={circle:class extends im{constructor(b,p,y,T){super(b,{layout:$wt||($wt=new Ql({"circle-sort-key":new Br(An.layout_circle["circle-sort-key"]),"circle-elevation-reference":new Ir(An.layout_circle["circle-elevation-reference"]),visibility:new Ir(An.layout_circle.visibility)})),paint:Gwt||(Gwt=new Ql({"circle-radius":new Br(An.paint_circle["circle-radius"]),"circle-color":new Br(An.paint_circle["circle-color"]),"circle-blur":new Br(An.paint_circle["circle-blur"]),"circle-opacity":new Br(An.paint_circle["circle-opacity"]),"circle-translate":new Ir(An.paint_circle["circle-translate"]),"circle-translate-anchor":new Ir(An.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Ir(An.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Ir(An.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Br(An.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Br(An.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Br(An.paint_circle["circle-stroke-opacity"]),"circle-emissive-strength":new Ir(An.paint_circle["circle-emissive-strength"]),"circle-color-use-theme":new Br({type:"string",default:"default","property-type":"data-driven"}),"circle-stroke-color-use-theme":new Br({type:"string",default:"default","property-type":"data-driven"})}))},p,y,T)}createBucket(b){return new qse(b)}queryRadius(b){const p=b;return ez("circle-radius",this,p)+ez("circle-stroke-width",this,p)+qle(this.paint.get("circle-translate"))}queryIntersectsFeature(b,p,y,T,S,R,M,F){const G=Xwt(this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),R.angle,b.pixelToTileUnitsFactor),q=this.paint.get("circle-radius").evaluate(p,y)+this.paint.get("circle-stroke-width").evaluate(p,y);return Kwt(b,T,R,M,F,"map"===this.paint.get("circle-pitch-alignment"),"map"===this.paint.get("circle-pitch-scale"),G,q)}getProgramIds(){return["circle"]}getDefaultProgramParams(b,p,y){const T=jwt(this);return{config:new h4(this,{zoom:p,lut:y}),defines:T,overrideFog:false}}is3D(b){return!b&&!!this.layout&&"none"!==this.layout.get("circle-elevation-reference")}hasElevation(){return this.layout&&"none"!==this.layout.get("circle-elevation-reference")}mayUse(b){return"HD"===b&&L7(this,"circle-elevation-reference",p=>"hd-road-markup"===p)}prepare(){return this.mayUse("HD")?Yle():Promise.resolve()}},heatmap:class extends im{createBucket(b){return new Jwt(b)}constructor(b,p,y,T){super(b,{layout:Qwt||(Qwt=new Ql({visibility:new Ir(An.layout_heatmap.visibility)})),paint:e2t||(e2t=new Ql({"heatmap-radius":new Br(An.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Br(An.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Ir(An.paint_heatmap["heatmap-intensity"]),"heatmap-color":new gT(An.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Ir(An.paint_heatmap["heatmap-opacity"]),"heatmap-color-use-theme":new Br({type:"string",default:"default","property-type":"data-driven"})}))},p,y,T),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(b){"heatmap-color"===b&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=tX({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}_clear(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null),this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null)}queryRadius(b){return ez("heatmap-radius",this,b)}queryIntersectsFeature(b,p,y,T,S,R,M,F){const G=this.paint.get("heatmap-radius").evaluate(p,y);return Kwt(b,T,R,M,F,true,true,new nt(0,0),G)}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}getProgramIds(){return["heatmap","heatmapTexture"]}getDefaultProgramParams(b,p,y){return"heatmap"===b?{config:new h4(this,{zoom:p,lut:y}),overrideFog:false}:{}}},hillshade:class extends im{constructor(b,p,y,T){super(b,{layout:t2t||(t2t=new Ql({visibility:new Ir(An.layout_hillshade.visibility)})),paint:n2t||(n2t=new Ql({"hillshade-illumination-direction":new Ir(An.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Ir(An.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Ir(An.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Ir(An.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Ir(An.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Ir(An.paint_hillshade["hillshade-accent-color"]),"hillshade-emissive-strength":new Ir(An.paint_hillshade["hillshade-emissive-strength"]),"hillshade-shadow-color-use-theme":new Br({type:"string",default:"default","property-type":"data-driven"}),"hillshade-highlight-color-use-theme":new Br({type:"string",default:"default","property-type":"data-driven"}),"hillshade-accent-color-use-theme":new Br({type:"string",default:"default","property-type":"data-driven"})}))},p,y,T)}shouldRedrape(){return this.hasOffscreenPass()&&"viewport"===this.paint.get("hillshade-illumination-anchor")}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}getProgramIds(){return["hillshade","hillshadePrepare"]}getDefaultProgramParams(b,p,y){return{overrideFog:false}}},fill:class extends im{constructor(b,p,y,T){super(b,{layout:r2t||(r2t=new Ql({"fill-sort-key":new Br(An.layout_fill["fill-sort-key"]),visibility:new Ir(An.layout_fill.visibility),"fill-elevation-reference":new Ir(An.layout_fill["fill-elevation-reference"]),"fill-construct-bridge-guard-rail":new Br(An.layout_fill["fill-construct-bridge-guard-rail"])})),paint:i2t||(i2t=new Ql({"fill-antialias":new Ir(An.paint_fill["fill-antialias"]),"fill-opacity":new Br(An.paint_fill["fill-opacity"]),"fill-color":new Br(An.paint_fill["fill-color"]),"fill-outline-color":new Br(An.paint_fill["fill-outline-color"]),"fill-translate":new Ir(An.paint_fill["fill-translate"]),"fill-translate-anchor":new Ir(An.paint_fill["fill-translate-anchor"]),"fill-pattern":new Br(An.paint_fill["fill-pattern"]),"fill-pattern-cross-fade":new Ir(An.paint_fill["fill-pattern-cross-fade"]),"fill-emissive-strength":new Ir(An.paint_fill["fill-emissive-strength"]),"fill-z-offset":new Br(An.paint_fill["fill-z-offset"]),"fill-bridge-guard-rail-color":new Br(An.paint_fill["fill-bridge-guard-rail-color"]),"fill-tunnel-structure-color":new Br(An.paint_fill["fill-tunnel-structure-color"]),"fill-color-use-theme":new Br({type:"string",default:"default","property-type":"data-driven"}),"fill-outline-color-use-theme":new Br({type:"string",default:"default","property-type":"data-driven"}),"fill-bridge-guard-rail-color-use-theme":new Br({type:"string",default:"default","property-type":"data-driven"}),"fill-tunnel-structure-color-use-theme":new Br({type:"string",default:"default","property-type":"data-driven"})}))},p,y,T)}getProgramIds(){const b=this.paint.get("fill-pattern"),p=b&&b.constantOr(1),y=[p?"fillPattern":"fill"];return this.paint.get("fill-antialias")&&y.push(p&&!this.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline"),y}getDefaultProgramParams(b,p,y){return{config:new h4(this,{zoom:p,lut:y}),overrideFog:false}}recalculate(b,p){super.recalculate(b,p);const y=this.paint._values["fill-outline-color"];"constant"===y.value.kind&&void 0===y.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(b){return new qOe(b)}queryRadius(){return qle(this.paint.get("fill-translate"))}queryIntersectsFeature(b,p,y,T,S,R){return!b.queryGeometry.isAboveHorizon&&KOe(qwt(b.tilespaceGeometry,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),R.angle,b.pixelToTileUnitsFactor),T)}isTileClipped(){return 0===this.paint.get("fill-z-offset").constantOr(1)}is3D(b){if(0!==this.paint.get("fill-z-offset").constantOr(1))return true;const p=this.layout&&"none"!==this.layout.get("fill-elevation-reference");return null!=b?p&&!b:p}hasElevation(){return this.layout&&"none"!==this.layout.get("fill-elevation-reference")}mayUse(b){return"HD"===b&&L7(this,"fill-elevation-reference",p=>"none"!==p)}prepare(){return this.mayUse("HD")?Yle():Promise.resolve()}hasShadowPass(){return this.layout&&"none"!==this.layout.get("fill-elevation-reference")}},"fill-extrusion":class extends im{constructor(b,p,y,T){super(b,{layout:s2t||(s2t=new Ql({visibility:new Ir(An["layout_fill-extrusion"].visibility),"fill-extrusion-edge-radius":new Ir(An["layout_fill-extrusion"]["fill-extrusion-edge-radius"]),"source-max-zoom":new Ir(An["layout_fill-extrusion"]["source-max-zoom"])})),paint:l2t||(l2t=new Ql({"fill-extrusion-opacity":new Ir(An["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Br(An["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Ir(An["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Ir(An["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Br(An["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-pattern-cross-fade":new Ir(An["paint_fill-extrusion"]["fill-extrusion-pattern-cross-fade"]),"fill-extrusion-height":new Br(An["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Br(An["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-height-alignment":new Ir(An["paint_fill-extrusion"]["fill-extrusion-height-alignment"]),"fill-extrusion-base-alignment":new Ir(An["paint_fill-extrusion"]["fill-extrusion-base-alignment"]),"fill-extrusion-vertical-gradient":new Ir(An["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]),"fill-extrusion-ambient-occlusion-intensity":new Ir(An["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-intensity"]),"fill-extrusion-ambient-occlusion-radius":new Ir(An["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-radius"]),"fill-extrusion-ambient-occlusion-wall-radius":new Ir(An["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-wall-radius"]),"fill-extrusion-ambient-occlusion-ground-radius":new Ir(An["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-ground-radius"]),"fill-extrusion-ambient-occlusion-ground-attenuation":new Ir(An["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-ground-attenuation"]),"fill-extrusion-flood-light-color":new Ir(An["paint_fill-extrusion"]["fill-extrusion-flood-light-color"]),"fill-extrusion-flood-light-intensity":new Ir(An["paint_fill-extrusion"]["fill-extrusion-flood-light-intensity"]),"fill-extrusion-flood-light-wall-radius":new Br(An["paint_fill-extrusion"]["fill-extrusion-flood-light-wall-radius"]),"fill-extrusion-flood-light-ground-radius":new Br(An["paint_fill-extrusion"]["fill-extrusion-flood-light-ground-radius"]),"fill-extrusion-flood-light-ground-attenuation":new Ir(An["paint_fill-extrusion"]["fill-extrusion-flood-light-ground-attenuation"]),"fill-extrusion-vertical-scale":new Ir(An["paint_fill-extrusion"]["fill-extrusion-vertical-scale"]),"fill-extrusion-rounded-roof":new Ir(An["paint_fill-extrusion"]["fill-extrusion-rounded-roof"]),"fill-extrusion-cutoff-fade-range":new Ir(An["paint_fill-extrusion"]["fill-extrusion-cutoff-fade-range"]),"fill-extrusion-front-cutoff":new Ir(An["paint_fill-extrusion"]["fill-extrusion-front-cutoff"]),"fill-extrusion-emissive-strength":new Br(An["paint_fill-extrusion"]["fill-extrusion-emissive-strength"]),"fill-extrusion-line-width":new Br(An["paint_fill-extrusion"]["fill-extrusion-line-width"]),"fill-extrusion-cast-shadows":new Ir(An["paint_fill-extrusion"]["fill-extrusion-cast-shadows"]),"fill-extrusion-color-use-theme":new Br({type:"string",default:"default","property-type":"data-driven"}),"fill-extrusion-flood-light-color-use-theme":new Br({type:"string",default:"default","property-type":"data-driven"})}))},p,y,T),this._stats={numRenderedVerticesInShadowPass:0,numRenderedVerticesInTransparentPass:0}}createBucket(b){return new Gle(b)}queryRadius(){return qle(this.paint.get("fill-extrusion-translate"))}is3D(b){return true}hasShadowPass(){return this.paint.get("fill-extrusion-cast-shadows")}cutoffRange(){return this.paint.get("fill-extrusion-cutoff-fade-range")}canCastShadows(){return true}getProgramIds(){return[this.paint.get("fill-extrusion-pattern").constantOr(1)?"fillExtrusionPattern":"fillExtrusion"]}queryIntersectsFeature(b,p,y,T,S,R,M,F,G){const q=Xwt(this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),R.angle,b.pixelToTileUnitsFactor),Q=this.paint.get("fill-extrusion-height").evaluate(p,y),ie=this.paint.get("fill-extrusion-base").evaluate(p,y),ae=[0,0],de=F&&R.elevation,pe=R.elevation?R.elevation.exaggeration():1,_e=b.tile.getBucket(this);if(_e instanceof Gle){const We=_e.centroidData.find(rt=>G>=rt.vertexArrayOffset&&GWe.polygon).flat());const Se=de?F:null,[Fe,Ye]=g2t(R,T,ie,Q,q,M,Se,ae,pe,R.center.lat,b.tileID.canonical),Xe=b.queryGeometry;return m2t(Fe,Ye,Xe.isPointQuery()?Xe.screenBounds:Xe.screenGeometry)}},building:class extends im{constructor(b,p,y,T){super(b,{layout:c2t||(c2t=new Ql({visibility:new Ir(An.layout_building.visibility),"building-facade":new Br(An.layout_building["building-facade"]),"building-facade-floors":new Br(An.layout_building["building-facade-floors"]),"building-facade-unit-width":new Br(An.layout_building["building-facade-unit-width"]),"building-facade-window":new Br(An.layout_building["building-facade-window"]),"building-roof-shape":new Br(An.layout_building["building-roof-shape"]),"building-height":new Br(An.layout_building["building-height"]),"building-base":new Br(An.layout_building["building-base"]),"building-flood-light-wall-radius":new Br(An.layout_building["building-flood-light-wall-radius"]),"building-flood-light-ground-radius":new Br(An.layout_building["building-flood-light-ground-radius"]),"building-flip-roof-orientation":new Br(An.layout_building["building-flip-roof-orientation"])})),paint:u2t||(u2t=new Ql({"building-opacity":new Ir(An.paint_building["building-opacity"]),"building-ambient-occlusion-intensity":new Ir(An.paint_building["building-ambient-occlusion-intensity"]),"building-ambient-occlusion-ground-intensity":new Ir(An.paint_building["building-ambient-occlusion-ground-intensity"]),"building-ambient-occlusion-ground-radius":new Ir(An.paint_building["building-ambient-occlusion-ground-radius"]),"building-ambient-occlusion-ground-attenuation":new Ir(An.paint_building["building-ambient-occlusion-ground-attenuation"]),"building-vertical-scale":new Ir(An.paint_building["building-vertical-scale"]),"building-cast-shadows":new Ir(An.paint_building["building-cast-shadows"]),"building-color":new Br(An.paint_building["building-color"]),"building-emissive-strength":new Br(An.paint_building["building-emissive-strength"]),"building-facade-emissive-chance":new Ir(An.paint_building["building-facade-emissive-chance"]),"building-cutoff-fade-range":new Ir(An.paint_building["building-cutoff-fade-range"]),"building-front-cutoff":new Ir(An.paint_building["building-front-cutoff"]),"building-flood-light-color":new Ir(An.paint_building["building-flood-light-color"]),"building-flood-light-intensity":new Ir(An.paint_building["building-flood-light-intensity"]),"building-flood-light-ground-attenuation":new Ir(An.paint_building["building-flood-light-ground-attenuation"]),"building-color-use-theme":new Br({type:"string",default:"default","property-type":"data-driven"}),"building-flood-light-color-use-theme":new Br({type:"string",default:"default","property-type":"data-driven"})}))},p,y,T),this._stats={numRenderedVerticesInShadowPass:0,numRenderedVerticesInTransparentPass:0}}mayUse(b){return"HD"===b}prepare(){return async function(){return function(){if(!Dr(self))return null;if(null!=a1||null!=Hwt)return null;if(null!=Q7)return Q7;const b=fetch(fn());return Q7=function(p){let y,T,S,R,M;function F(){y=new Uint8Array(M.buffer),T=new Int16Array(M.buffer),S=new Int32Array(M.buffer),R=new Float32Array(M.buffer)}function G(){throw new Error("Unexpected BuildingGen error.")}const q=()=>{},Q={a:{a:G,f:function(ie){const ae=y.length,de=Math.max(ie>>>0,Math.ceil(1.2*ae)),pe=Math.ceil((de-ae)/65536);try{return M.grow(pe),F(),true}catch(_e){return false}},g:G,b:q,c:q,d:q,e:q}};return(WebAssembly.instantiateStreaming?WebAssembly.instantiateStreaming(p,Q):p.then(ie=>ie.arrayBuffer()).then(ie=>WebAssembly.instantiate(ie,Q))).then(ie=>{const ae=ie.instance.exports;return(0,ae.g)(),M=ae.f,F(),new $wr({setStyle:ae.h,setAOOptions:ae.i,setMetricOptions:ae.j,setStructuralOptions:ae.k,setFacadeOptions:ae.l,setFauxFacadeOptions:ae.m,setFacadeClassifierOptions:ae.n,addFeature:ae.o,addFacade:ae.p,generateMesh:ae.q,getLastError:ae.r,getOuterRingLength:ae.s,getMeshCount:ae.t,getPositionsPtr:ae.u,getPositionsLength:ae.v,getNormalsPtr:ae.w,getNormalsLength:ae.x,getAOPtr:ae.y,getAOLength:ae.z,getUVPtr:ae.A,getUVLength:ae.B,getFauxFacadePtr:ae.C,getFauxFacadeLength:ae.D,getIndicesPtr:ae.E,getIndicesLength:ae.F,getBuildingPart:ae.G,getRingCount:ae.H,getRingPtr:ae.I,getRingLength:ae.J,malloc:ae.K,free:ae.L,heapU8:y,heap16:T,heap32:S,heapF32:R})})}(b).then(p=>{Q7=null,a1=p}).catch(p=>{yn("Could not load building-gen"),Q7=null,Hwt=p}),Q7}()}()}createBucket(b){return new Wwt(b)}cutoffRange(){return this.paint.get("building-cutoff-fade-range")}hasShadowPass(){return this.paint.get("building-cast-shadows")}hasLightBeamPass(){return true}canCastShadows(){return true}is3D(b){return true}queryRadius(b){return 0}queryIntersectsFeature(b,p,y,T,S,R,M,F,G,q){let Q=this.layout.get("building-height").evaluate(p,y);const ie=this.layout.get("building-base").evaluate(p,y),ae=b.tile.getBucket(this).getFootprint(p);if(ae){if(0!==ae.hiddenFlags)return false;Q=ae.height}const[de,pe]=g2t(R,T,ie,Q,new nt(0,0),M,null,[0,0],1,R.center.lat,b.tileID.canonical),_e=b.queryGeometry;return m2t(de,pe,_e.isPointQuery()?_e.screenBounds:_e.screenGeometry)}},line:class extends im{constructor(b,p,y,T){const S=T2t();super(b,S,p,y,T),S.layout&&(this.layout=new O2(S.layout)),this.gradientVersion=0,this.borderGradientVersion=0,this.hasElevatedBuckets=false,this.hasNonElevatedBuckets=false,this.lineBlendFbos=null,this.lineBlendDensityReadback=null}_handleSpecialPaintPropertyUpdate(b){if("line-gradient"===b){const p=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=p._styleExpression&&p._styleExpression.expression instanceof uA,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}else if("line-gradient-use-theme"===b)this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER;else if("line-border-gradient"===b){const p=this._transitionablePaint._values["line-border-gradient"].value.expression;this.borderStepInterpolant=p._styleExpression&&p._styleExpression.expression instanceof uA,this.borderGradientVersion=(this.borderGradientVersion+1)%Number.MAX_SAFE_INTEGER}else"line-border-gradient-use-theme"===b&&(this.borderGradientVersion=(this.borderGradientVersion+1)%Number.MAX_SAFE_INTEGER)}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}borderGradientExpression(){return this._transitionablePaint._values["line-border-gradient"].value.expression}widthExpression(){return this._transitionablePaint._values["line-width"].value.expression}emissiveStrengthExpression(){return this._transitionablePaint._values["line-emissive-strength"].value.expression}recalculate(b,p){super.recalculate(b,p),this.paint._values["line-floorwidth"]=(()=>{if(iX)return iX;const y=T2t();return iX=new Zwr(y.paint.properties["line-width"].specification),iX.useIntegerZoom=true,iX})().possiblyEvaluate(this._transitioningPaint._values["line-width"].value,b)}createBucket(b){return new i5e(b)}getProgramIds(){const b=[this.paint.get("line-pattern").constantOr(1)?"linePattern":"line"];return"default"!==this.paint.get("line-blend-mode")&&b.push("lineBlendComposite"),b}getDefaultProgramParams(b,p,y){if("lineBlendComposite"===b)return{};const T=v2t(this);return{config:new h4(this,{zoom:p,lut:y}),defines:T,overrideFog:false}}queryRadius(b){const p=b,y=C2t(ez("line-width",this,p),ez("line-gap-width",this,p)),T=ez("line-offset",this,p);return y/2+Math.abs(T)+qle(this.paint.get("line-translate"))}queryIntersectsFeature(b,p,y,T,S,R){if(b.queryGeometry.isAboveHorizon)return false;const M=qwt(b.tilespaceGeometry,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),R.angle,b.pixelToTileUnitsFactor),F=b.pixelToTileUnitsFactor/2*C2t(this.paint.get("line-width").evaluate(p,y),this.paint.get("line-gap-width").evaluate(p,y)),G=this.paint.get("line-offset").evaluate(p,y);return G&&(T=function(q,Q){const ie=[],ae=new nt(0,0);for(let de=0;de=3){for(let pe=0;pe"hd-road-markup"===p)}prepare(){return this.mayUse("HD")?Yle():Promise.resolve()}hasOffscreenPass(){return"default"!==this.paint.get("line-blend-mode")&&0!==this.paint.get("line-opacity").constantOr(1)&&0!==this.paint.get("line-width").constantOr(1)&&"none"!==this.visibility}resize(){this._destroyLineBlendFbo()}onRemove(b){this._destroyLineBlendFbo(b.painter&&b.painter.context&&b.painter.context.gl||void 0)}_clear(){this._destroyLineBlendFbo()}_destroyLineBlendFbo(b){this.lineBlendFbos&&(this.lineBlendFbos.destroy(),this.lineBlendFbos=null),b&&this.lineBlendDensityReadback&&this.lineBlendDensityReadback.destroy(b),this.lineBlendDensityReadback=null}},symbol:Xle,background:class extends im{constructor(b,p,y,T){super(b,{layout:k2t||(k2t=new Ql({visibility:new Ir(An.layout_background.visibility)})),paint:R2t||(R2t=new Ql({"background-pitch-alignment":new Ir(An.paint_background["background-pitch-alignment"]),"background-color":new Ir(An.paint_background["background-color"]),"background-pattern":new Ir(An.paint_background["background-pattern"]),"background-opacity":new Ir(An.paint_background["background-opacity"]),"background-emissive-strength":new Ir(An.paint_background["background-emissive-strength"]),"background-color-use-theme":new Br({type:"string",default:"default","property-type":"data-driven"})}))},p,y,T)}getProgramIds(){return[this.paint.get("background-pattern")?"backgroundPattern":"background"]}getDefaultProgramParams(b,p,y){return{overrideFog:false}}is3D(b){return"viewport"===this.paint.get("background-pitch-alignment")}},raster:M2t,"raster-particle":U2t,sky:class extends im{constructor(b,p,y,T){super(b,{layout:F2t||(F2t=new Ql({visibility:new Ir(An.layout_sky.visibility)})),paint:N2t||(N2t=new Ql({"sky-type":new Ir(An.paint_sky["sky-type"]),"sky-atmosphere-sun":new Ir(An.paint_sky["sky-atmosphere-sun"]),"sky-atmosphere-sun-intensity":new Ir(An.paint_sky["sky-atmosphere-sun-intensity"]),"sky-gradient-center":new Ir(An.paint_sky["sky-gradient-center"]),"sky-gradient-radius":new Ir(An.paint_sky["sky-gradient-radius"]),"sky-gradient":new gT(An.paint_sky["sky-gradient"]),"sky-atmosphere-halo-color":new Ir(An.paint_sky["sky-atmosphere-halo-color"]),"sky-atmosphere-color":new Ir(An.paint_sky["sky-atmosphere-color"]),"sky-opacity":new Ir(An.paint_sky["sky-opacity"]),"sky-gradient-use-theme":new Br({type:"string",default:"default","property-type":"data-driven"}),"sky-atmosphere-halo-color-use-theme":new Br({type:"string",default:"default","property-type":"data-driven"}),"sky-atmosphere-color-use-theme":new Br({type:"string",default:"default","property-type":"data-driven"})}))},p,y,T),this._updateColorRamp()}_clear(){this.skyboxFbo&&(this.skyboxFbo.destroy(),this.skyboxFbo=null),this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null),this._skyboxInvalidated=true}_handleSpecialPaintPropertyUpdate(b){"sky-gradient"===b?this._updateColorRamp():"sky-atmosphere-sun"!==b&&"sky-atmosphere-halo-color"!==b&&"sky-atmosphere-color"!==b&&"sky-atmosphere-sun-intensity"!==b||(this._skyboxInvalidated=true)}_updateColorRamp(){this.colorRamp=tX({expression:this._transitionablePaint._values["sky-gradient"].value.expression,evaluationKey:"skyRadialProgress"}),this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null)}needsSkyboxCapture(b){if(this._skyboxInvalidated||!this.skyboxTexture||!this.skyboxGeometry)return true;if(!this.paint.get("sky-atmosphere-sun")){const p=b.style.light.properties.get("position");return this._lightPosition.azimuthal!==p.azimuthal||this._lightPosition.polar!==p.polar}return false}getCenter(b,p){if("atmosphere"===this.paint.get("sky-type")){const T=this.paint.get("sky-atmosphere-sun"),S=!T,R=b.style.light,M=R.properties.get("position");return S&&"viewport"===R.properties.get("anchor")&&yn("The sun direction is attached to a light with viewport anchor, lighting may behave unexpectedly."),S?cBe(M.azimuthal,90-M.polar,p):cBe(T[0],90-T[1],p)}const y=this.paint.get("sky-gradient-center");return cBe(y[0],90-y[1],p)}isSky(){return true}markSkyboxValid(b){this._skyboxInvalidated=false,this._lightPosition=b.style.light.properties.get("position")}hasOffscreenPass(){return true}getProgramIds(){const b=this.paint.get("sky-type");return"atmosphere"===b?["skyboxCapture","skybox"]:"gradient"===b?["skyboxGradient"]:null}},slot:class extends im{constructor(b,p,y,T){super(b,{paint:O2t||(O2t=new Ql({}))},p,null)}},model:class extends im{constructor(b,p,y,T){super(b,{layout:B2t||(B2t=new Ql({visibility:new Ir(An.layout_model.visibility),"model-id":new Br(An.layout_model["model-id"]),"model-allow-density-reduction":new Ir(An.layout_model["model-allow-density-reduction"])})),paint:z2t||(z2t=new Ql({"model-opacity":new Br(An.paint_model["model-opacity"]),"model-rotation":new Br(An.paint_model["model-rotation"]),"model-scale":new Br(An.paint_model["model-scale"]),"model-translation":new Br(An.paint_model["model-translation"]),"model-color":new Br(An.paint_model["model-color"]),"model-color-mix-intensity":new Br(An.paint_model["model-color-mix-intensity"]),"model-type":new Ir(An.paint_model["model-type"]),"model-cast-shadows":new Ir(An.paint_model["model-cast-shadows"]),"model-receive-shadows":new Ir(An.paint_model["model-receive-shadows"]),"model-ambient-occlusion-intensity":new Ir(An.paint_model["model-ambient-occlusion-intensity"]),"model-emissive-strength":new Br(An.paint_model["model-emissive-strength"]),"model-roughness":new Br(An.paint_model["model-roughness"]),"model-height-based-emissive-strength-multiplier":new Br(An.paint_model["model-height-based-emissive-strength-multiplier"]),"model-cutoff-fade-range":new Ir(An.paint_model["model-cutoff-fade-range"]),"model-front-cutoff":new Ir(An.paint_model["model-front-cutoff"]),"model-elevation-reference":new Ir(An.paint_model["model-elevation-reference"]),"model-line-cutout-mode":new Ir(An.paint_model["model-line-cutout-mode"]),"model-color-use-theme":new Br({type:"string",default:"default","property-type":"data-driven"})}))},p,y,T),this.layer=b,this._stats={numRenderedVerticesInShadowPass:0,numRenderedVerticesInTransparentPass:0}}mayUse(b){return"Standard"===b}prepare(){return qEt()}createBucket(b){return new uBe(b)}getProgramIds(){return["model"]}is3D(b){return true}hasShadowPass(){return true}canCastShadows(){return true}hasLightBeamPass(){return true}cutoffRange(){return this.paint.get("model-cutoff-fade-range")}queryRadius(b){return b.isTiled3dModelBucket?8191:0}queryRenderedFeatures(b,p,y){return E4.queryModelLayerRendered?E4.queryModelLayerRendered(this,b,p,y):{}}queryIntersectsFeature(b,p,y,T,S,R,M,F,G,q){return!!E4.queryModelLayerIntersectsFeature&&E4.queryModelLayerIntersectsFeature(this,b,p,y,R,q)}_handleOverridablePaintPropertyUpdate(b,p,y){return!(!this.layout||p.isDataDriven()||y.isDataDriven()||"model-color"!==b&&"model-color-mix-intensity"!==b&&"model-rotation"!==b&&"model-scale"!==b&&"model-translation"!==b&&"model-emissive-strength"!==b)}_isPropertyZoomDependent(b){const p=this._transitionablePaint._values[b];return null!=p&&null!=p.value&&null!=p.value.expression&&p.value.expression instanceof hA}isZoomDependent(){return this._isPropertyZoomDependent("model-scale")||this._isPropertyZoomDependent("model-rotation")||this._isPropertyZoomDependent("model-translation")}},clip:class extends im{constructor(b,p,y,T){super(b,{layout:o2t||(o2t=new Ql({"clip-layer-types":new Ir(An.layout_clip["clip-layer-types"]),"clip-layer-scope":new Ir(An.layout_clip["clip-layer-scope"]),visibility:new Ir(An.layout_clip.visibility)})),paint:a2t||(a2t=new Ql({}))},p,y,T)}recalculate(b,p){super.recalculate(b,p)}createBucket(b){return new h2t(b)}is3D(b){return true}}};class PBe{constructor(p){this.capacity=p,this.cache=new Map}get(p){if(!this.cache.has(p))return;const y=this.cache.get(p);return this.cache.delete(p),this.cache.set(p,y),y}put(p,y){this.cache.has(p)?this.cache.delete(p):this.cache.size===this.capacity&&this.cache.delete(this.cache.keys().next().value),this.cache.set(p,y)}delete(p){this.cache.delete(p)}}li(PBe,"LRUCache");class I2r{constructor(p){this._callback=p,this._triggered=false,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=false,this._callback()})}trigger(){this._triggered||(this._triggered=true,this._channel?this._channel.port1.postMessage(true):setTimeout(()=>{this._triggered=false,this._callback()},0))}remove(){this._channel&&(this._channel.port1.close(),this._channel.port2.close()),this._callback=()=>{}}}const XEt={Other:0,Symbol:1,FillExtrusion:2,HdRoadCoverage:3,HdRoadElevation:4};class M2r{constructor(){this.tasks=new Map,yo(["process"],this),this.invoker=new I2r(this.process),this.nextId=0}add(p,y){const T=this.nextId++,S=function({type:R,renderSourceType:M,zoom:F}){F=F||0;const G=M===XEt.Symbol;return"message"===R?0:"maybePrepare"!==R||G?"parseTile"!==R||G?"parseTile"===R&&G?300-F:"maybePrepare"===R&&G?400-F:500:200-F:100-F}(y);if(0===S){try{p()}finally{}return null}return this.tasks.set(T,{fn:p,metadata:y,priority:S,id:T}),this.invoker.trigger(),{cancel:()=>{this.tasks.delete(T)}}}process(){try{const p=this.pick();if(!p)return;this.tasks.delete(p.id),this.tasks.size>0&&this.invoker.trigger(),p.fn()}finally{}}pick(){let p=null,y=1/0;for(const T of this.tasks.values())T.priorityp[M])return null}else{const F=1/T[M];let G=(b[M]-y[M])*F,q=(p[M]-y[M])*F;if(G>q){const Q=G;G=q,q=Q}if(G>S&&(S=G),qR)return null}return S}function QEt(b,p,y,T,S,R,M,F,G,q,Q){const ie=T-b,ae=S-p,de=R-y,pe=M-b,_e=F-p,Se=G-y,Fe=Q[1]*Se-Q[2]*_e,Ye=Q[2]*pe-Q[0]*Se,Xe=Q[0]*_e-Q[1]*pe,We=ie*Fe+ae*Ye+de*Xe;if(Math.abs(We)<1e-15)return null;const rt=1/We,lt=q[0]-b,Bt=q[1]-p,ht=q[2]-y,Tt=(lt*Fe+Bt*Ye+ht*Xe)*rt;if(Tt<0||Tt>1)return null;const Lt=Bt*de-ht*ae,Nt=ht*ie-lt*de,un=lt*ae-Bt*ie,_n=(Q[0]*Lt+Q[1]*Nt+Q[2]*un)*rt;return _n<0||Tt+_n>1?null:(pe*Lt+_e*Nt+Se*un)*rt}function eCt(b,p,y,T,S,R,M,F,G){const q=1<{const rt=Xe?1:0,lt=(Se+1)*Ye-rt,Bt=Fe*Ye,ht=(Fe+1)*Ye-rt;We[0]=Se*Ye,We[1]=Bt,We[2]=lt,We[3]=ht};let ie=new ZEt(q);const ae=1/q,{floatView:de,stride:pe}=R,_e=[];for(let Se=0;Seun&&(un=zn)}}ie.minimums.push(Bt),ie.maximums.push(un),ie.leaves.push(1)}for(G.push(ie),q/=2;q>=1;q/=2){const Se=G.at(-1);ie=new ZEt(q);for(let Fe=0;Fe0;){const{idx:pe,t:_e,nodex:Se,nodey:Fe,depth:Ye}=de.pop();if(this.leaves[pe]){eCt(Se,Fe,Ye,p,y,T,S,ie,ae);const We=1<1e-10,ur=Math.abs(M[1])>1e-10,pr=M[0]>=0?1:-1,ni=M[1]>=0?1:-1;let Cr=Math.max(0,Math.min(Ln-1,Math.floor((qn-or)/En))),Fr=Math.max(0,Math.min(zn-1,Math.floor((Zn-nn)/In)));const Fi=Hn?Math.abs(En/M[0]):Number.MAX_VALUE,Bi=ur?Math.abs(In/M[1]):Number.MAX_VALUE;let no=Hn?Gn+(or+(M[0]>=0?Cr+1:Cr)*En-qn)/M[0]:Number.MAX_VALUE,Ii=ur?Gn+(nn+(M[1]>=0?Fr+1:Fr)*In-Zn)/M[1]:Number.MAX_VALUE;const mo=(Td,Po)=>Lt[(Po+1)*Nt+Td+1]*F;let io=mo(un+Cr,Dn+Fr),xa=mo(un+Cr+1,Dn+Fr),va=mo(un+Cr,Dn+Fr+1),ja=mo(un+Cr+1,Dn+Fr+1),Ss=null;for(let Td=0;Td=0||R[2]+M[2]*Po<=Math.max(io,xa,va,ja)){const Of=or+Cr*En,sm=Of+En,lm=nn+Fr*In,fy=lm+In,hy=QEt(sm,lm,xa,Of,lm,io,Of,fy,va,R,M),Ih=QEt(Of,fy,va,sm,fy,ja,sm,lm,xa,R,M);null!=hy&&hy>=0&&(null===Ss||hy=0&&(null===Ss||Ih=Ln||Fr<0||Fr>=zn)break;if(null!==Ss&&Po>Ss)break;Nf?pr>0?(io=xa,va=ja,xa=mo(un+Cr+1,Dn+Fr),ja=mo(un+Cr+1,Dn+Fr+1)):(xa=io,ja=va,io=mo(un+Cr,Dn+Fr),va=mo(un+Cr,Dn+Fr+1)):ni>0?(io=va,xa=ja,va=mo(un+Cr,Dn+Fr+1),ja=mo(un+Cr+1,Dn+Fr+1)):(va=io,ja=xa,io=mo(un+Cr,Dn+Fr),xa=mo(un+Cr+1,Dn+Fr))}if(null!==Ss)return Ss||0;const _d=Ve([],R,M,_e),y0=(_d[0]-ie[0])/(ae[0]-ie[0]),Tu=(_d[1]-ie[1])/(ae[1]-ie[1]),Ma=RI(rt,Bt,this.dem)*F,Gl=RI(lt,Bt,this.dem)*F,Ou=RI(lt,ht,this.dem)*F;if(nCt(Ma,Gl,RI(rt,ht,this.dem)*F,Ou,y0,Tu)>=_d[2])return _e;continue}let Xe=0;for(let We=0;We=q[Q[ht]]&&(Q.splice(ht,0,We),Bt=true);Bt||(Q[Xe]=We),Xe++}}for(let We=0;We=this.dim+1||y<-1||y>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(y+1)*this.stride+(p+1)}static pack(p,y){const T=[0,0,0,0],S=fce.getUnpackVector(y);let R=Math.floor((p+S[3])/S[2]);return T[2]=R%256,R=Math.floor(R/256),T[1]=R%256,R=Math.floor(R/256),T[0]=R,T}getPixels(){return new U_t({width:this.stride,height:this.stride},this.pixels)}backfillBorder(p,y,T){if(this.dim!==p.dim)throw new Error("dem dimension mismatch");let S=y*this.dim,R=y*this.dim+this.dim,M=T*this.dim,F=T*this.dim+this.dim;switch(y){case-1:S=R-1;break;case 1:R=S+1}switch(T){case-1:M=F-1;break;case 1:F=M+1}const G=-y*this.dim,q=-T*this.dim;for(let Q=M;Q=1;T--){const S=1===T?1:0,R=2===T?1:0;for(let M=0;M>>1^-(1&b[p]);return b}function H2r(b,p){switch(p){case"uint32":return b;case"uint16":for(let y=0;y>4|(61440&T)>>8|(240&S)<<4|61440&S,b[y+1]=15&T|(3840&T)>>4|(15&S)<<8|(3840&S)<<4}return b;case"uint8":for(let y=0;y>6|(192&S)>>4|(192&R)>>2|192&M,b[y+1]=(48&T)>>4|(48&S)>>2|48&R|(48&M)<<2,b[y+2]=(12&T)>>2|12&S|(12&R)<<2|(12&M)<<4,b[y+3]=3&T|(3&S)<<2|(3&R)<<4|(3&M)<<6}return b;default:throw new Error(`Invalid pixel format, "${p}"`)}}li(fce,"DEMData"),li(tCt,"DemMinMaxQuadTree",{omit:["dem"]});var l1=Uint8Array,uX=Uint16Array,W2r=Int32Array,rCt=new l1([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),iCt=new l1([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Y2r=new l1([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),oCt=function(b,p){for(var y=new uX(31),T=0;T<31;++T)y[T]=p+=1<>1|(21845&vd)<<1;lCt[vd]=((65280&(az=(61680&(az=(52428&az)>>2|(13107&az)<<2))>>4|(3855&az)<<4))>>8|(255&az)<<8)>>1}var dX=function(b,p,y){for(var T=b.length,S=0,R=new uX(p);S>G]=q;return M},fX=new l1(288);for(vd=0;vd<144;++vd)fX[vd]=8;for(vd=144;vd<256;++vd)fX[vd]=9;for(vd=256;vd<280;++vd)fX[vd]=7;for(vd=280;vd<288;++vd)fX[vd]=8;var cCt=new l1(32);for(vd=0;vd<32;++vd)cCt[vd]=5;var j2r=dX(fX,9),K2r=dX(cCt,5),MBe=function(b){for(var p=b[0],y=1;yp&&(p=b[y]);return p},xT=function(b,p,y){var T=p/8|0;return(b[T]|b[T+1]<<8)>>(7&p)&y},LBe=function(b,p){var y=p/8|0;return(b[y]|b[y+1]<<8|b[y+2]<<16)>>(7&p)},Z2r=function(b){return(b+7)/8|0},J2r=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],vT=function(b,p,y){var T=new Error(p||J2r[b]);if(T.code=b,Error.captureStackTrace&&Error.captureStackTrace(T,vT),!y)throw T;return T},Q2r=new l1(0);var eEr="undefined"!=typeof TextDecoder&&new TextDecoder;try{eEr.decode(Q2r,{stream:true})}catch(b){}const tEr={gzip_data:"gzip"};class Uv extends Error{constructor(p){super(p),this.name="MRTError"}}const nEr={0:"uint32",1:"uint32",2:"uint16",3:"uint8"},uCt={uint32:1,uint16:2,uint8:4},rEr={uint32:Uint32Array,uint16:Uint16Array,uint8:Uint8Array};let DBe;class hce{constructor(p=5){this.x=NaN,this.y=NaN,this.z=NaN,this.layers={},this._cacheSize=p}getLayer(p){const y=this.layers[p];if(!y)throw new Uv(`Layer '${p}' not found`);return y}getHeaderLength(p){const y=new Uint8Array(p),T=new DataView(p);if(13!==y[0])throw new Uv("File is not a valid MRT.");return T.getUint32(1,true)}parseHeader(p){const y=new Uint8Array(p),T=this.getHeaderLength(p);if(y.length= ${T} but got buffer of length ${y.length}`);const S=function(R){const M={headerLength:0,x:0,y:0,z:0,layers:[]};let F;for(;F=R.nextField(void 0);)1===F?M.headerLength=R.readFixed32():2===F?M.x=R.readVarint():3===F?M.y=R.readVarint():4===F?M.z=R.readVarint():5===F&&M.layers.push(U2r(R,R.readVarint()+R.pos));return M}(new DBe(y.subarray(0,T)));if(!isNaN(this.x)&&(this.x!==S.x||this.y!==S.y||this.z!==S.z))throw new Uv(`Invalid attempt to parse header ${S.z}/${S.x}/${S.y} for tile ${this.z}/${this.x}/${this.y}`);this.x=S.x,this.y=S.y,this.z=S.z;for(const R of S.layers)this.layers[R.name]=new dCt(R,{cacheSize:this._cacheSize});return this}createDecodingTask(p){const y=[],T=this.getLayer(p.layerName);for(let S of p.blockIndices){const R=T.dataIndex[S],M=R.firstByte-p.firstByte,F=R.lastByte-p.firstByte;if(T._blocksInProgress.has(S))continue;const G={layerName:T.name,firstByte:M,lastByte:F,pixelFormat:T.pixelFormat,blockIndex:S,blockShape:[R.bands.length].concat(T.bandShape),buffer:T.buffer,codec:R.codec.codec,filters:R.filters.map(q=>q.filter)};T._blocksInProgress.add(S),y.push(G)}return new fCt(y,()=>{y.forEach(S=>T._blocksInProgress.delete(S.blockIndex))},(S,R)=>{if(y.forEach(M=>T._blocksInProgress.delete(M.blockIndex)),S)throw S;R.forEach(M=>{this.getLayer(M.layerName).processDecodedData(M)})})}}class dCt{constructor({version:p,name:y,units:T,tileSize:S,pixelFormat:R,buffer:M,dataIndex:F},G){if(this.version=p,1!==this.version)throw new Uv(`Cannot parse raster layer encoded with MRT version ${p}`);this.name=y,this.units=T,this.tileSize=S,this.buffer=M,this.pixelFormat=nEr[R],this.dataIndex=F,this.bandShape=[S+2*M,S+2*M,uCt[this.pixelFormat]],this._decodedBlocks=new PBe(G?G.cacheSize:5),this._blocksInProgress=new Set}get dimension(){return uCt[this.pixelFormat]}get cacheSize(){return this._decodedBlocks.capacity}getBandList(){return this.dataIndex.map(({bands:p})=>p).flat()}processDecodedData(p){const y=p.blockIndex.toString();this._decodedBlocks.get(y)||this._decodedBlocks.put(y,p.data)}getBlockForBand(p){let y=0;switch(typeof p){case"string":for(const[T,S]of this.dataIndex.entries()){for(const[R,M]of S.bands.entries())if(M===p)return{bandIndex:y+R,blockIndex:T,blockBandIndex:R};y+=S.bands.length}break;case"number":for(const[T,S]of this.dataIndex.entries()){if(p>=y&&pthis.cacheSize)throw new Uv(`Number of blocks to decode (${R.size}) exceeds cache size (${this.cacheSize}).`);return{layerName:this.name,firstByte:y,lastByte:T,blockIndices:S}}hasBand(p){const{blockIndex:y}=this.getBlockForBand(p);return y>=0}hasDataForBand(p){const{blockIndex:y}=this.getBlockForBand(p);return y>=0&&!!this._decodedBlocks.get(y.toString())}getBandView(p){const{blockIndex:y,blockBandIndex:T}=this.getBlockForBand(p);if(y<0)throw new Uv(`Band not found: ${JSON.stringify(p)}`);const S=this._decodedBlocks.get(y.toString());if(!S)throw new Uv(`Data for band ${JSON.stringify(p)} of layer "${this.name}" not decoded.`);const R=this.dataIndex[y],M=this.bandShape.reduce((q,Q)=>q*Q,1),F=T*M,G=S.subarray(F,F+M);return{data:G,bytes:new Uint8Array(G.buffer).subarray(G.byteOffset,G.byteOffset+G.byteLength),tileSize:this.tileSize,buffer:this.buffer,pixelFormat:this.pixelFormat,dimension:this.dimension,offset:R.offset,scale:R.scale}}}hce.setPbf=function(b){DBe=b};class fCt{constructor(p,y,T){this.tasks=p,this._onCancel=y,this._onComplete=T,this._finalized=false}cancel(){this._finalized||(this._onCancel(),this._finalized=true)}complete(p,y){this._finalized||(this._onComplete(p,y),this._finalized=true)}}hce.performDecoding=function(b,p){const y=new Uint8Array(b);return Promise.all(p.tasks.map(T=>{const{layerName:S,firstByte:R,lastByte:M,pixelFormat:F,blockShape:G,blockIndex:q,filters:Q,codec:ie}=T,ae=y.subarray(R,M+1),de=new Uint32Array(G[0]*G[1]*G[2]);let pe;if("gzip_data"!==ie)throw new Uv(`Unhandled codec: ${ie}`);return pe=function(_e,Se){if(!globalThis.DecompressionStream&&"gzip_data"===Se)return Promise.resolve((rt=function(ht){31==ht[0]&&139==ht[1]&&8==ht[2]||vT(6,"invalid gzip data");var Tt=ht[3],Lt=10;4&Tt&&(Lt+=2+(ht[10]|ht[11]<<8));for(var Nt=(Tt>>3&1)+(Tt>>4&1);Nt>0;Nt-=!ht[Lt++]);return Lt+(2&Tt)}(Fe=_e),rt+8>Fe.length&&vT(6,"invalid gzip data"),function(ht,Tt,Lt,Nt){var un=ht.length;if(!un||Tt.f&&!Tt.l)return Lt||new l1(0);var _n=!Lt,Dn=_n||2!=Tt.i,Ln=Tt.i;_n&&(Lt=new l1(3*un));var zn=function(Ih){var ah=Lt.length;if(Ih>ah){var Mh=new l1(Math.max(2*ah,Ih));Mh.set(Lt),Lt=Mh}},or=Tt.f||0,nn=Tt.p||0,En=Tt.b||0,In=Tt.l,Gn=Tt.d,qn=Tt.m,Zn=Tt.n,Hn=8*un;do{if(!In){or=xT(ht,nn,1);var ur=xT(ht,nn+1,3);if(nn+=3,!ur){var pr=ht[(va=Z2r(nn)+4)-4]|ht[va-3]<<8,ni=va+pr;if(ni>un){Ln&&vT(0);break}Dn&&zn(En+pr),Lt.set(ht.subarray(va,ni),En),Tt.b=En+=pr,Tt.p=nn=8*ni,Tt.f=or;continue}if(1==ur)In=j2r,Gn=K2r,qn=9,Zn=5;else if(2==ur){var Cr=xT(ht,nn,31)+257,Fr=xT(ht,nn+10,15)+4,Fi=Cr+xT(ht,nn+5,31)+1;nn+=14;for(var Bi=new l1(Fi),no=new l1(19),Ii=0;Ii>4)<16)Bi[Ii++]=va;else{var Ss=0,_d=0;for(16==va?(_d=3+xT(ht,nn,3),nn+=2,Ss=Bi[Ii-1]):17==va?(_d=3+xT(ht,nn,7),nn+=3):18==va&&(_d=11+xT(ht,nn,127),nn+=7);_d--;)Bi[Ii++]=Ss}}var y0=Bi.subarray(0,Cr),Tu=Bi.subarray(Cr);qn=MBe(y0),Zn=MBe(Tu),In=dX(y0,qn),Gn=dX(Tu,Zn)}else vT(1);if(nn>Hn){Ln&&vT(0);break}}Dn&&zn(En+131072);for(var Ma=(1<>4;if((nn+=15&Ss)>Hn){Ln&&vT(0);break}if(Ss||vT(2),Td<256)Lt[En++]=Td;else{if(256==Td){Ou=nn,In=null;break}var Po=Td-254;Td>264&&(Po=xT(ht,nn,(1<<(sm=rCt[Ii=Td-257]))-1)+sCt[Ii],nn+=sm);var Nf=Gn[LBe(ht,nn)&Gl],Of=Nf>>4;if(Nf||vT(3),nn+=15&Nf,Tu=X2r[Of],Of>3){var sm=iCt[Of];Tu+=LBe(ht,nn)&(1<Hn){Ln&&vT(0);break}Dn&&zn(En+131072);var lm=En+Po;if(EnIh.length)&&(Mh=Ih.length),new l1(Ih.subarray(0,Mh))}(Lt,0,En):Lt.subarray(0,En)}(Fe.subarray(rt,-8),{i:2},new l1(((Xe=Fe)[(We=Xe.length)-4]|Xe[We-3]<<8|Xe[We-2]<<16|Xe[We-1]<<24)>>>0),Ye)));var Fe,Ye,Xe,We,rt;const lt=tEr[Se];if(!lt)throw new Error(`Unhandled codec: ${Se}`);const Bt=new globalThis.DecompressionStream(lt);return new Response(new Blob([_e]).stream().pipeThrough(Bt)).arrayBuffer().then(ht=>new Uint8Array(ht))}(ae,ie).then(_e=>(function(Se,Fe){let Ye;for(;Ye=Se.nextField();)if(2===Ye)V2r(Se,Se.readVarint()+Se.pos,Fe);else if(3===Ye)throw new Error("Not implemented")}(new DBe(_e),de),new(0,rEr[F])(de.buffer))),pe.then(_e=>{for(let Se=Q.length-1;Se>=0;Se--)switch(Q[Se]){case"delta_filter":$2r(_e,G);break;case"zigzag_filter":G2r(_e);break;case"bitshuffle_filter":H2r(_e,F);break;default:throw new Uv(`Unhandled filter "${Q[Se]}"`)}return{layerName:S,blockIndex:q,data:_e}}).catch(_e=>{throw _e})}))},li(fCt,"MRTDecodingBatch",{omit:["_onCancel","_onComplete"]}),li(hce,"MapboxRasterTile"),li(dCt,"MapboxRasterLayer",{omit:["_blocksInProgress"]});const hCt=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],qd=new Uint32Array(96);class FBe{static from(p){if(!p||void 0===p.byteLength||p.buffer)throw new Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");const[y,T]=new Uint8Array(p,0,2);if(219!==y)throw new Error("Data does not appear to be in a KDBush format.");const S=T>>4;if(1!==S)throw new Error(`Got v${S} data when expected v1.`);const R=hCt[15&T];if(!R)throw new Error("Unrecognized array type.");const[M]=new Uint16Array(p,2,1),[F]=new Uint32Array(p,4,1);return new FBe(F,M,R,void 0,p)}constructor(p,y=64,T=Float64Array,S=ArrayBuffer,R){if(isNaN(p)||p<0)throw new Error(`Unexpected numItems value: ${p}.`);this.numItems=+p,this.nodeSize=Math.min(Math.max(+y,2),65535),this.ArrayType=T,this.IndexArrayType=p<65536?Uint16Array:Uint32Array;const M=hCt.indexOf(this.ArrayType),F=2*p*this.ArrayType.BYTES_PER_ELEMENT,G=p*this.IndexArrayType.BYTES_PER_ELEMENT,q=(8-G%8)%8;if(M<0)throw new Error(`Unexpected typed array class: ${T}.`);if(R)this.data=R,this.ids=new this.IndexArrayType(R,8,p),this.coords=new T(R,8+G+q,2*p),this._pos=2*p,this._finished=true;else{const Q=this.data=new S(8+F+G+q);this.ids=new this.IndexArrayType(Q,8,p),this.coords=new T(Q,8+G+q,2*p),this._pos=0,this._finished=false,new Uint8Array(Q,0,2).set([219,16+M]),new Uint16Array(Q,2,1)[0]=y,new Uint32Array(Q,4,1)[0]=p}}add(p,y){const T=this._pos>>1;return this.ids[T]=T,this.coords[this._pos++]=p,this.coords[this._pos++]=y,T}finish(){const p=this._pos>>1;if(p!==this.numItems)throw new Error(`Added ${p} items when expected ${this.numItems}.`);return NBe(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=true,this}range(p,y,T,S){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:R,coords:M,nodeSize:F}=this;qd[0]=0,qd[1]=R.length-1,qd[2]=0;let G=3;const q=[];for(;G>0;){const Q=qd[--G],ie=qd[--G],ae=qd[--G];if(ie-ae<=F){for(let Se=ae;Se<=ie;Se++){const Fe=M[2*Se],Ye=M[2*Se+1];Fe>=p&&Fe<=T&&Ye>=y&&Ye<=S&&q.push(R[Se])}continue}const de=ae+ie>>1,pe=M[2*de],_e=M[2*de+1];pe>=p&&pe<=T&&_e>=y&&_e<=S&&q.push(R[de]),(0===Q?p<=pe:y<=_e)&&(qd[G++]=ae,qd[G++]=de-1,qd[G++]=1-Q),(0===Q?T>=pe:S>=_e)&&(qd[G++]=de+1,qd[G++]=ie,qd[G++]=1-Q)}return q}within(p,y,T){const S=[];return this.withinInto(p,y,T,S),S}withinInto(p,y,T,S){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:R,coords:M,nodeSize:F}=this;qd[0]=0,qd[1]=R.length-1,qd[2]=0;let G=3,q=0;const Q=T*T;for(;G>0;){const ie=qd[--G],ae=qd[--G],de=qd[--G];if(ae-de<=F){for(let Fe=de;Fe<=ae;Fe++)mCt(M[2*Fe],M[2*Fe+1],p,y)<=Q&&(S[q++]=R[Fe]);continue}const pe=de+ae>>1,_e=M[2*pe],Se=M[2*pe+1];mCt(_e,Se,p,y)<=Q&&(S[q++]=R[pe]),(0===ie?p-T<=_e:y-T<=Se)&&(qd[G++]=de,qd[G++]=pe-1,qd[G++]=1-ie),(0===ie?p+T>=_e:y+T>=Se)&&(qd[G++]=pe+1,qd[G++]=ae,qd[G++]=1-ie)}return q}}function NBe(b,p,y,T,S,R){if(S-T<=y)return;const M=T+S>>1;pCt(b,p,M,T,S,R),NBe(b,p,y,T,M-1,1-R),NBe(b,p,y,M+1,S,1-R)}function pCt(b,p,y,T,S,R){for(;S>T;){if(S-T>600){const q=S-T+1,Q=y-T+1,ie=Math.log(q),ae=.5*Math.exp(2*ie/3),de=.5*Math.sqrt(ie*ae*(q-ae)/q)*(Q-q/2<0?-1:1);pCt(b,p,y,Math.max(T,Math.floor(y-Q*ae/q+de)),Math.min(S,Math.floor(y+(q-Q)*ae/q+de)),R)}const M=p[2*y+R];let F=T,G=S;for(hX(b,p,T,y),p[2*S+R]>M&&hX(b,p,T,S);FM;)G--}p[2*T+R]===M?hX(b,p,T,G):(G++,hX(b,p,G,S)),G<=y&&(T=G+1),y<=G&&(S=G-1)}}function hX(b,p,y,T){OBe(b,y,T),OBe(p,2*y,2*T),OBe(p,2*y+1,2*T+1)}function OBe(b,p,y){const T=b[p];b[p]=b[y],b[y]=T}function mCt(b,p,y,T){const S=b-y,R=p-T;return S*S+R*R}a.$=Ph,a.A=P2,a.B=Fv,a.C=Wo,a.D=lA,a.E=tm,a.F=mp,a.G=VF,a.H=jP,a.I=gd,a.J=I7,a.K=/^(.*)-transition$/,a.L=PBe,a.M=nq,a.N=eq,a.O=Rr,a.P=nt,a.Q=x,a.R=Ga,a.S=SA,a.T=fle,a.U=/^(.*)-use-theme$/,a.V=function(b,p){const y=SA(p.zoom);if(0===y)return U2(b);const T=Qse(b),S=h5e(T),R=ly(T.getWest())*p.worldSize,M=ly(T.getEast())*p.worldSize,F=Qm(T.getNorth())*p.worldSize,G=Qm(T.getSouth())*p.worldSize,q=[R,F,0],Q=[M,F,0],ie=[R,G,0],ae=[M,G,0],de=A([],p.globeMatrix);return it(q,q,de),it(Q,Q,de),it(ie,ie,de),it(ae,ae,de),S[0]=CA(S[0],ie,y),S[1]=CA(S[1],ae,y),S[2]=CA(S[2],Q,y),S[3]=CA(S[3],q,y),xl.fromPoints(S)},a.W=p5e,a.X=P,a.Y=g,a.Z=Rh,a._=s1,a.a=async function(b,p){b.headers||(b.headers={}),b.headers.accept="image/webp,*/*";const y=await function(T){return new Promise((S,R)=>{if(T&&T.aborted)return void R(T.reason);const M=()=>{const q=Ul.shift();q?q():Zs--};if(Zs{T&&T.removeEventListener("abort",G),S(M)},G=()=>{const q=Ul.indexOf(F);-1!==q&&Ul.splice(q,1),R(T.reason)};T&&T.addEventListener("abort",G),Ul.push(F)})}(p);try{const{data:T,headers:S}=await es(b,p);let R;try{R=await createImageBitmap(new Blob([new Uint8Array(T)],{type:"image/png"}))}catch(M){throw new Error(`Could not load image because of ${M.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`,{cause:M})}return p&&p.throwIfAborted(),{data:R,headers:S}}finally{y()}},a.a$=au,a.a0=uEt,a.a1=cc,a.a2=qr,a.a3=xd,a.a4=Eo,a.a5=Ff,a.a6=_u,a.a7=ly,a.a8=Qm,a.a9=J,a.aA=Z,a.aB=fTt,a.aC=Gle,a.aD=zwt,a.aE=iz,a.aF=UEt,a.aG=Ah,a.aH=(b,p,y,T,S,R,M,F,G,q,Q,ie,ae,de,pe,_e,Se,Fe,Ye=false)=>{const Xe=NEt(b,p,y,T,S,R,M,F,q,Q,ie,ae,de,pe,_e,Se,1,[0,0,0],[0,0,1],Ye),We={u_height_factor:-Math.pow(2,F.overscaledZ)/G.tileSize/8};return Object.assign(Xe,DEt(p,G,Fe),We)},a.aI=NEt,a.aJ=PA,a.aK=450,a.aL=7,a.aM=(b,p,y,T,S,R)=>({u_matrix:b,u_edge_radius:p,u_width_scale:y,u_vertical_scale:T,u_height_type:sce[S],u_base_type:sce[R]}),a.aN=I,a.aO=A,a.aP=C,a.aQ=BEt,a.aR=4,a.aS=2,a.aT=jOe,a.aU=KOe,a.aV=yo,a.aW=class{static calculate(b,p,y){const T=new Set,S=new Map,R=new Set,M=new Set;for(const G of Object.values(b))for(const[q,Q]of Object.entries(G.floors)){R.add(q),Q.isDefault&&M.add(q),Q.conflicts&&S.set(q,Q.conflicts);const ie=q===p,ae=Q.connections&&p&&Q.connections.has(p);(ie||ae)&&T.add(q)}const F=G=>{const q=S.get(G)||new Set;for(const Q of T)if((S.get(Q)||new Set).has(G)||q.has(Q))return true;return false};if(y)for(const G of y)R.has(G)&&(F(G)||T.add(G));for(const G of M)T.has(G)||F(G)||T.add(G);return T}},a.aX=vu,a.aY=zv,a.aZ=class extends Db{constructor(b){super(b),this.current=new Float32Array(9)}set(b,p,y){if(!this.fetchUniformLocation(b,p))return;const T=this.current;for(let S=0;S<9;S++)if(y[S]!==T[S]){T.set(y),this.gl.uniformMatrix3fv(this.location,false,T);break}}},a.a_=hn,a.aa=ji,a.ab=U_r,a.ac=Ls,a.ad=po,a.ae=uy,a.af=Ql,a.ag=Ir,a.ah=class{constructor(b){this.specification=b}possiblyEvaluate(b,p){return xr(b.expression.evaluate(p))}interpolate(b,p,y){return{x:Si(b.x,p.x,y),y:Si(b.y,p.y,y),z:Si(b.z,p.z,y),azimuthal:Si(b.azimuthal,p.azimuthal,y),polar:Si(b.polar,p.polar,y)}}},a.ai=Rl,a.aj=hA,a.ak=O2,a.al=Si,a.am=ir,a.an=65,a.ao=45,a.ap=function(b,p,y){const T=fe.fromLngLat(p),S=y.elevation?y.elevation.getAtPointOrZero(T):0;return cEt(b,T.x,T.y,S,y)},a.aq=function(b,p,y,T,S,R,M){const F=[[y,T,0],[S,T,0],[S,R,0],[y,R,0]];let G=Number.MAX_VALUE,q=-Number.MAX_VALUE;for(const Q of F){const ie=re(it([],Q,p));G=Math.min(G,ie),q=Math.max(q,ie)}return[tce(b,G,M.pitch),tce(b,q,M.pitch)]},a.ar=pp,a.as=cEt,a.at=sX,a.au=Fn,a.av=function(){return Vt++},a.aw=class{constructor(b,p,y){this.target=b,this.parent=p,this.mapId=y,this.pendingResponses=new Map,yo(["receive"],this),this.target.addEventListener("message",this.receive,false),this.scheduler=new M2r}send(b,p,y){const{signal:T,targetMapId:S,metadata:R}=y||{},M=Math.round(1e18*Math.random()).toString(36).substring(0,10),F=new Set;return T&&T.aborted?Promise.reject(T.reason):(this.target.postMessage({id:M,type:b,targetMapId:S,sourceMapId:this.mapId,data:tg(p,F)},[...F]),new Promise((G,q)=>{const Q={resolve:G,reject:q,metadata:R||jEt};if(T){const ie=()=>{this.pendingResponses.delete(M),q(T.reason)};T.addEventListener("abort",ie,{once:true}),Q.detach=()=>T.removeEventListener("abort",ie)}this.pendingResponses.set(M,Q)}))}notify(b,p,y){const{targetMapId:T}=y||{},S=new Set;this.target.postMessage({type:b,targetMapId:T,sourceMapId:this.mapId,data:tg(p,S)},[...S])}sendCancelable(b,p,y,T){const S=new AbortController;return this.send(b,p,{...y,signal:S.signal}).then(R=>T(null,R)).catch(R=>{"AbortError"!==R.name&&T(R)}),S}getWorkerSourceActor(b){return{scheduler:this.scheduler,send:(p,y,T)=>this.send(p,y,{...T,targetMapId:b}),notify:(p,y)=>{this.notify(p,y,{targetMapId:b})},sendCancelable:(p,y,T,S)=>this.sendCancelable(p,y,{...T,targetMapId:b},S)}}receive(b){const p=b.data;if(!p)return;const y=p.id;if(!p.targetMapId||this.mapId===p.targetMapId)if(Dr(self)){const T=this.pendingResponses.get(y);this.scheduler.add(()=>{this.processTask(y,p)},T&&T.metadata||jEt)}else this.processTask(y,p)}async processTask(b,p){if(""===p.type){const S=this.pendingResponses.get(b);if(this.pendingResponses.delete(b),S){S.detach&&S.detach();try{p.error?S.reject(kb(p.error)):S.resolve(kb(p.data))}catch(R){S.reject(R)}}return}const y=new Set,T=kb(p.data);try{let S;if(this.parent[p.type])S=await this.parent[p.type](p.sourceMapId,T);else{if(!this.parent.getWorkerSource)throw new Error(`Could not find function ${p.type}`);{const R=p.type.split("."),{source:M,scope:F}=T,G=this.parent.getWorkerSource(p.sourceMapId,{type:R[0],source:M,scope:F});S=await G[R[1]](T)}}if(!b)return;this.target.postMessage({id:b,type:"",sourceMapId:this.mapId,error:null,data:tg(S,y)},[...y])}catch(S){this.target.postMessage({id:b,type:"",sourceMapId:this.mapId,error:tg(S),data:null},[])}}remove(){for(const b of this.pendingResponses.values())b.detach&&b.detach(),b.reject(new DOMException("Actor removed","AbortError"));this.pendingResponses.clear(),this.scheduler.remove(),this.target.removeEventListener("message",this.receive,false)}},a.ax=class{constructor(b){this.specification=b}possiblyEvaluate(b,p){return function([y,T]){const S=xr([1,y,T]);return{x:S.x,y:S.y,z:S.z}}(b.expression.evaluate(p))}interpolate(b,p,y){return{x:Si(b.x,p.x,y),y:Si(b.y,p.y,y),z:Si(b.z,p.z,y)}}},a.ay=E4,a.az=EA,a.b=yp,a.b$=function(b,{x:p,y},T=0){return new nt(((p-T)*b.scale-b.x)*qr,(y*b.scale-b.y)*qr)},a.b0=bn,a.b1=6,a.b2=Qse,a.b3=function(b){const p=80.051129;b=bn(b,-80.051129,p)/p*90;const y=Math.pow(Math.abs(Math.sin(Fn(b))),3);return Math.round(y*(Aq.length-1))},a.b4=nle,a.b5=U2,a.b6=function(b){const p=b.pixelsPerMeter,y=p/E(1,b.center.lat),T=_(new Float64Array(16));return L(T,T,[b.point.x,b.point.y,0]),I(T,T,[y,y,p]),Float32Array.from(T)},a.b7=function(b,p,y,T){const S=p.getNorth(),R=p.getSouth(),M=p.getWest(),F=p.getEast(),G=1<0){const pe=180/T;h(de,de,[pe/q+1,0,0,0,pe/Q+1,0,-.5*pe/ie,.5*pe/ae,1])}return de[2]=G,de[5]=b.x,de[8]=b.y,de},a.b8=Ho,a.b9=256,a.bA=qOe,a.bB=vt,a.bC=wn,a.bD=cl,a.bE=l5e,a.bF=dI,a.bG=Dq,a.bH=it,a.bI=CA,a.bJ=Bn,a.bK=j_r,a.bL=W,a.bM=L,a.bN=function(){N2.isLoading()||N2.isLoaded()||"deferred"!==bq()||kse()},a.bO=ha,a.bP=pf,a.bQ=function(b,p){const y=[];for(const T in b)T in p||y.push(T);return y},a.bR=XEt,a.bS=fe,a.bT=er,a.bU="hd_road_coverage",a.bV=function(b){const p=b.indexOf(s4);return p>=0?b.slice(0,p):b},a.bW=Lse,a.bX=_I,a.bY=rle,a.bZ=function(b,p,y=0,T=true){const S=new nt(y,y),R=b.sub(S),M=p.add(S),F=[R,new nt(M.x,R.y),M,new nt(R.x,M.y)];return T&&F.push(R.clone()),F},a.b_=function(b,p){const y=[];for(let T=0;T1)return false;const y=p.getSource().maxzoom,T=1<1)return p;const S=T.getSource().maxzoom,R=1<{const F=this.getAtTileOffset(b,S,R,M),G=T.upVector(b.canonical,S.x,S.y);return ge(G,G,F*T.upVectorScale(b.canonical,p,y).metersToTile),G}}getForTilePoints(b,p,y,T){if(this.isUsingMockSource())return false;const S=tz.create(this,b,T);return!!S&&(p.forEach(R=>{R[2]=this.exaggeration()*S.getElevationAt(R[0],R[1],y,true)}),true)}getMinMaxForTile(b){if(this.isUsingMockSource())return null;const p=this.findDEMTileFor(b);if(!p||!p.dem)return null;const y=p.dem.tree,T=p.tileID,S=1<{T(R,M)},p):T(R,M),()=>{}}return S.callbacks.push(T),S.cancel||(S.cancel=y((R,M)=>{S.result=[R,M];for(const F of S.callbacks)this.scheduler?this.scheduler.add(()=>{F(R,M)},p):F(R,M);setTimeout(()=>delete this.entries[b],3e3)})),()=>{S.result||(S.callbacks=S.callbacks.filter(R=>R!==T),S.callbacks.length||(S.cancel(),delete this.entries[b]))}}},a.cd=function(b){if("provider"in b&&!b.provider)return null;let p=b.provider;if(!p&&"url"in b&&b.url&&(p=function(S){try{const R=new URL(S).pathname.split("/").pop()||"",M=R.lastIndexOf(".");return M>=0?R.slice(M+1):""}catch{return""}}(b.url)),!p)return null;const y=Ft.TILE_PROVIDER_URLS[p];if(!y)return null;let T;try{T=new URL(y,Ft.API_URL).href}catch(S){return new Error(`TileProvider "${p}" has an invalid URL: "${y}"`)}return{name:p,url:T}},a.ce=GEt,a.cf=dce,a.cg=ao,a.ch=function(b,p,y){const T=JSON.stringify(b.request);return b.data&&(this.deduped.entries[T]={result:[null,b.data]}),this.deduped.request(T,{type:"parseTile",renderSourceType:b.renderSourceType,zoom:b.tileZoom},S=>{const R=new AbortController;return es(b.request,R.signal).then(({data:M,headers:F})=>{S(null,{rawData:M,vectorTile:y?void 0:new XOe(new cle(M)),headers:F})}).catch(M=>{R.signal.aborted||(ha(M)?S(null,null):S(M))}),()=>{R.abort(),S(null,null)}},p)},a.ci=Ot,a.cj=function(b){wi++,wi>oi&&(b.getActor().notify("enforceCacheSizeLimit",ar),wi=0)},a.ck=em,a.cl=async function(b,p,y){const T=b.url&&!b.tiles?await p.transformRequest(b.url,Ga.Source,y):void 0;return{request:T,options:T?{...b,url:T.url}:b}},a.cm=function(b,p,y){return p?$Et(b,p,y):b.tiles&&b.tiles.length>0?{tiles:b.tiles}:new Error('TileJSON is missing required "tiles" property')},a.cn=async function(b,p){const y=KEt.get(b);if(y)return y;const T=IBe.get(b);if(void 0!==T)return T;const S=self.__mapboxImport(p).catch(R=>{throw new Error(`TileProvider "${b}" failed to load: ${R instanceof Error?R.message:String(R)}`)}).then(R=>{const M=R.default;if("function"!=typeof M)throw new Error(`TileProvider "${b}" module must default-export a class`);if("function"!=typeof M.prototype.loadTile)throw new Error(`TileProvider "${b}" class must have a loadTile method`);return KEt.set(b,M),M}).finally(()=>{IBe.delete(b)});return IBe.set(b,S),S},a.co=class{constructor(b,p){this.context=b,this.texture=p}bind(b,p){const{context:y}=this,{gl:T}=y;T.bindTexture(T.TEXTURE_2D,this.texture),b!==this.minFilter&&(T.texParameteri(T.TEXTURE_2D,T.TEXTURE_MAG_FILTER,b),T.texParameteri(T.TEXTURE_2D,T.TEXTURE_MIN_FILTER,b),this.minFilter=b),p!==this.wrapS&&(T.texParameteri(T.TEXTURE_2D,T.TEXTURE_WRAP_S,p),T.texParameteri(T.TEXTURE_2D,T.TEXTURE_WRAP_T,p),this.wrapS=p)}},a.cp=V,a.cq=function(b,p,y,T){for(;p>1;b[S]<=T?p=S+1:y=S}return p},a.cr=function(b,p,y,T){for(;p>1;b[S]{p.onloadstart=()=>y(),p.onerror=()=>T(new Error(`Could not load video: ${b.join(", ")}`))}),p},a.cx=M2t,a.cy=U2t,a.cz=Ea,a.d=class{constructor(b){this.cache=new Map,this.textures=new Map,this.textureAccessTimes=new Map,this.textureMemoryUsed=0,this.maxTextureMemory=1024*(b&&b.maxTextureMemoryMB?b.maxTextureMemoryMB:256)*1024,this.currentFrameAtlases=new Set,this.finalizationRegistry=new FinalizationRegistry(p=>{this.cache.delete(p),this.clearExpiredTextures()})}beginFrame(){this.currentFrameAtlases.clear()}calculateTextureMemory(b){return b.image?Math.ceil(b.image.width*b.image.height*4*(b.patternPositions.size>0?1.33:1)):0}evictTexture(b){const p=this.textures.get(b);if(p){const y=this.calculateTextureMemory(b);p.destroy(),this.textures.delete(b),this.textureAccessTimes.delete(b),this.textureMemoryUsed-=y,b.uploaded=false}}evictTexturesIfNeeded(b){for(;this.textureMemoryUsed+b>this.maxTextureMemory&&this.textures.size>0;){let p=null,y=1/0;for(const[T]of this.textures.entries()){if(this.currentFrameAtlases.has(T))continue;const S=this.textureAccessTimes.get(T)||0;S{if(!pe)return null;const ht=SA(ie.zoom);return 0===ht?null:{t:ht,invMatrix:ie.projection.createInversionMatrix(ie,q.canonical),mercCenter:[ly(ie.center.lng),Qm(ie.center.lat)]}})(),Se=[256/y.width*2+1,256/y.height*2+1],Fe=T?b.text.dynamicLayoutVertexArray:b.icon.dynamicLayoutVertexArray;Fe.clear();let Ye=null;pe&&(Ye=T?b.text.globeExtVertexArray:b.icon.globeExtVertexArray);const Xe=b.lineVertexArray,We=T?b.text.placedSymbolArray:b.icon.placedSymbolArray,rt=y.transform.width/y.transform.height;let lt,Bt=false;for(let ht=0;ht({u_cutoff_params:new zv(b)}),a.dI=b=>({u_light_matrix_0:new Ff(b),u_light_matrix_1:new Ff(b),u_fade_range:new xd(b),u_shadow_normal_offset:new _u(b),u_shadow_intensity:new Eo(b),u_shadow_texel_size:new Eo(b),u_shadow_map_resolution:new Eo(b),u_shadow_direction:new _u(b),u_shadow_bias:new _u(b),u_shadowmap_0:new vu(b),u_shadowmap_1:new vu(b)}),a.dJ=DEt,a.dK=sTt,a.dL=lBe,a.dM=$i,a.dN=Zi,a.dO=function(b,p){const y=[0,0,0];return it(y,y,nle(U2(p.canonical))),it(y,y,b),y},a.dP=rg,a.dQ=function(b,p,y,T,S,R){const{width:M,height:F}=T.imageManager.getPixelSize(p),G=Math.pow(2,R.tileID.overscaledZ),q=R.tileSize*Math.pow(2,T.transform.tileZoom)/G,Q=q*(R.tileID.canonical.x+R.tileID.wrap*G),ie=q*R.tileID.canonical.y;return{u_image:0,u_pattern_tl:y.tl,u_pattern_br:y.br,u_texsize:[M,F],u_pattern_size:y.displaySize,u_pattern_units_to_pixels:S?[T.transform.width,-1*T.transform.height]:[1/rX(R,1,T.transform.tileZoom),1/rX(R,1,T.transform.tileZoom)],u_pixel_coord_upper:[Q>>16,ie>>16],u_pixel_coord_lower:[65535&Q,65535&ie]}},a.dR=b=>({u_matrix:new Ff(b),u_texsize:new xd(b),u_pixels_to_tile_units:new HOe(b),u_device_pixel_ratio:new Eo(b),u_width_scale:new Eo(b),u_floor_width_scale:new Eo(b),u_image:new vu(b),u_units_to_pixels:new xd(b),u_tile_units_to_pixels:new Eo(b),u_alpha_discard_threshold:new Eo(b),u_trim_offset:new xd(b),u_trim_fade_range:new xd(b),u_trim_gradient_mix_range:new xd(b),u_trim_color:new zv(b),u_zbias_factor:new Eo(b),u_tile_to_meter:new Eo(b),u_ground_shadow_factor:new _u(b),u_pattern_transition:new Eo(b),u_opacity_multiplier:new Eo(b)}),a.dS=b=>({u_matrix:new Ff(b),u_pixels_to_tile_units:new HOe(b),u_device_pixel_ratio:new Eo(b),u_width_scale:new Eo(b),u_floor_width_scale:new Eo(b),u_units_to_pixels:new xd(b),u_dash_image:new vu(b),u_gradient_image:new vu(b),u_border_gradient_image:new vu(b),u_image_height:new Eo(b),u_texsize:new xd(b),u_tile_units_to_pixels:new Eo(b),u_alpha_discard_threshold:new Eo(b),u_trim_offset:new xd(b),u_trim_fade_range:new xd(b),u_trim_gradient_mix_range:new xd(b),u_trim_color:new zv(b),u_zbias_factor:new Eo(b),u_road_view_depth_bias:new Eo(b),u_road_clip_to_view:new zv(b),u_tile_to_meter:new Eo(b),u_ground_shadow_factor:new _u(b),u_opacity_multiplier:new Eo(b)}),a.dT=b=>({u_color:new Rq(b),u_matrix:new Ff(b),u_overlay:new vu(b),u_overlay_scale:new Eo(b)}),a.dU=b=>({u_camera_to_center_distance:new Eo(b),u_extrude_scale:new HOe(b),u_device_pixel_ratio:new Eo(b),u_matrix:new Ff(b),u_inv_rot_matrix:new Ff(b),u_merc_center:new xd(b),u_tile_id:new _u(b),u_zoom_transition:new Eo(b),u_up_dir:new _u(b),u_emissive_strength:new Eo(b)}),a.dV=b=>({u_matrix:new Ff(b),u_lightpos:new _u(b),u_lightintensity:new Eo(b),u_lightcolor:new _u(b),u_vertical_gradient:new Eo(b),u_height_factor:new Eo(b),u_edge_radius:new Eo(b),u_width_scale:new Eo(b),u_ao:new xd(b),u_height_type:new vu(b),u_base_type:new vu(b),u_tile_id:new _u(b),u_zoom_transition:new Eo(b),u_inv_rot_matrix:new Ff(b),u_merc_center:new xd(b),u_up_dir:new _u(b),u_height_lift:new Eo(b),u_image:new vu(b),u_texsize:new xd(b),u_pixel_coord_upper:new xd(b),u_pixel_coord_lower:new xd(b),u_tile_units_to_pixels:new Eo(b),u_opacity:new Eo(b),u_pattern_transition:new Eo(b)}),a.dW=b=>({u_matrix:new Ff(b),u_lightpos:new _u(b),u_lightintensity:new Eo(b),u_lightcolor:new _u(b),u_vertical_gradient:new Eo(b),u_opacity:new Eo(b),u_edge_radius:new Eo(b),u_width_scale:new Eo(b),u_ao:new xd(b),u_height_type:new vu(b),u_base_type:new vu(b),u_tile_id:new _u(b),u_zoom_transition:new Eo(b),u_inv_rot_matrix:new Ff(b),u_merc_center:new xd(b),u_up_dir:new _u(b),u_height_lift:new Eo(b),u_flood_light_color:new _u(b),u_vertical_scale:new Eo(b),u_flood_light_intensity:new Eo(b),u_ground_shadow_factor:new _u(b),u_front_cutoff_params:new _u(b)}),a.dX=xBe,a.dY=aX,a.dZ=tEt,a.d_=y4,a.da=gq,a.db=On,a.dc=QS,a.dd=ds,a.de=wr,a.df=function(b){return b.includes(s4)},a.dg=function(b){const p=b.lastIndexOf(s4);return p>=0?b.slice(p+1):""},a.dh=function(b){const p=[],y=b.id;return void 0===y&&p.push({message:`layers.${y}: missing required property "id"`}),void 0===b.render&&p.push({message:`layers.${y}: missing required method "render"`}),b.renderingMode&&"2d"!==b.renderingMode&&"3d"!==b.renderingMode&&p.push({message:`layers.${y}: property "renderingMode" must be either "2d" or "3d"`}),p},a.di=function(b,p,y,T){return"custom"===b.type?new Qwr(b,p):new P2r[b.type](b,p,y,T)},a.dj=Ms,a.dk=class extends w4{constructor(b,p){super(b._vectorTileFeature,b._z,b._x,b._y,b.id),b.state&&(this.state={...b.state}),this.target=p.target,this.namespace=p.namespace,p.properties&&(this.properties=p.properties),this.target&&("featuresetId"in this.target&&!this.target.importId||"layerId"in this.target)&&(this.source=b.source,this.sourceLayer=b.sourceLayer,this.layer=b.layer)}toJSON(){const b=super.toJSON();return b.target=this.target,b.namespace=this.namespace,b}},a.dl=yq,a.dm=zEt,a.dn=function(){return{API_URL:Ft.API_URL,DRACO_URL:Ft.DRACO_URL,MESHOPT_URL:Ft.MESHOPT_URL,MESHOPT_SIMD_URL:Ft.MESHOPT_SIMD_URL,BUILDING_GEN_URL:Ft.BUILDING_GEN_URL}},a.dp=Rq,a.dq=te,a.dr=jr,a.ds=function(b,p,y){const T=SA(y.zoom),S=b.style.map._antialias,R=b.terrain&&b.terrain.exaggeration()>0;return 0===T&&!S&&!R},a.dt=function(b,p,y){const T=_(new Float64Array(16)),S=(p/(1<{const M=b.transform,F="globe"===M.projection.name;let G;if("map"===R.paint.get("circle-pitch-alignment"))if(F){const Q=sTt(M.zoom,p.canonical)*M._pixelsPerMercatorPixel;G=Float32Array.from([Q,0,0,Q])}else G=M.calculatePixelsToTileUnitsMatrix(y);else G=new Float32Array([M.pixelsToGLUnits[0],0,0,M.pixelsToGLUnits[1]]);const q={u_camera_to_center_distance:b.transform.getCameraToCenterDistance(M.projection),u_matrix:b.translatePosMatrix(p.projMatrix,y,R.paint.get("circle-translate"),R.paint.get("circle-translate-anchor")),u_device_pixel_ratio:Ct.devicePixelRatio,u_extrude_scale:G,u_inv_rot_matrix:qwr,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0],u_emissive_strength:R.paint.get("circle-emissive-strength")};if(F){q.u_inv_rot_matrix=T,q.u_merc_center=S,q.u_tile_id=[p.canonical.x,p.canonical.y,1<{const Q=b.transform,ie=Q.pitch<15?Si(.07,.7,bn((14-Q.zoom)/5,0,1)):.07,ae="none"===y.paint.get("line-trim-color-use-theme").constantOr("default");return{u_matrix:x2t(b,p,y,T),u_texsize:p.imageAtlasTexture?p.imageAtlasTexture.size:[0,0],u_pixels_to_tile_units:Q.calculatePixelsToTileUnitsMatrix(p),u_device_pixel_ratio:S,u_width_scale:R,u_floor_width_scale:M,u_image:0,u_tile_units_to_pixels:b2t(p,Q),u_units_to_pixels:[1/Q.pixelsToGLUnits[0],1/Q.pixelsToGLUnits[1]],u_alpha_discard_threshold:0,u_trim_offset:F,u_trim_fade_range:y.paint.get("line-trim-fade-range"),u_trim_gradient_mix_range:[1,1],u_trim_color:y.paint.get("line-trim-color").toPremultipliedRenderColor(ae?null:y.lut).toArray01(),u_zbias_factor:ie,u_tile_to_meter:le(p.tileID.canonical,0),u_ground_shadow_factor:G,u_pattern_transition:q,u_opacity_multiplier:1}},a.e5=(b,p,y,T,S,R,M,F,G,q)=>{const Q=b.transform,ie=Q.calculatePixelsToTileUnitsMatrix(p),ae="none"===y.paint.get("line-trim-color-use-theme").constantOr("default"),de=Q.pitch<15?Si(.07,.7,bn((14-Q.zoom)/5,0,1)):.07;return{u_matrix:x2t(b,p,y,T),u_pixels_to_tile_units:ie,u_device_pixel_ratio:R,u_width_scale:M,u_floor_width_scale:F,u_units_to_pixels:[1/Q.pixelsToGLUnits[0],1/Q.pixelsToGLUnits[1]],u_dash_image:0,u_gradient_image:1,u_border_gradient_image:2,u_image_height:S,u_texsize:_2t(y)&&p.lineAtlasTexture?p.lineAtlasTexture.size:[0,0],u_tile_units_to_pixels:b2t(p,b.transform),u_alpha_discard_threshold:0,u_trim_offset:G,u_trim_fade_range:y.paint.get("line-trim-fade-range"),u_trim_gradient_mix_range:[1,1],u_trim_color:y.paint.get("line-trim-color").toPremultipliedRenderColor(ae?null:y.lut).toArray01(),u_zbias_factor:de,u_road_view_depth_bias:0,u_road_clip_to_view:[0,0,0,0],u_tile_to_meter:le(p.tileID.canonical,0),u_ground_shadow_factor:q,u_opacity_multiplier:1}},a.e6=ln,a.e7=tX,a.e8=5,a.e9=Jwr,a.eA=Ze,a.eB=k,a.eC=bA,a.eD=ct,a.eE=xl,a.eF=Ee,a.eG=ue,a.eH=function([b,p,y]){const T=Math.hypot(b,p,y),S=Math.atan2(b,y),R=.5*Math.PI-Math.acos(-p/T);return new Ea(Tr(S),Tr(R))},a.eI=Le,a.eJ=Me,a.eK=$5e,a.eL=Ft,a.eM=Lc,a.eN=al,a.eO=vBe,a.eP=class{constructor(b,p,y){this._transformRequestFn=b,this._customAccessToken=p,this._silenceAuthErrors=!!y,this._createSkuToken()}_createSkuToken(){const b=function(){let p="";for(let y=0;y<10;y++)p+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",kl,p].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=b.token,this._skuTokenExpiresAt=b.tokenExpiresAt}_isSkuTokenExpired(){return Date.now()>this._skuTokenExpiresAt}async transformRequest(b,p,y){if(!this._transformRequestFn)return{url:b};const T=y?{signal:y}:{};return await this._transformRequestFn(b,p,T)||{url:b}}normalizeStyleURL(b,p){if(!ao(b))return b;const y=sa(b);return y.params.push(`sdk=js-${s}`),y.path=`/styles/v1${y.path}`,this._makeAPIURL(y,this._customAccessToken||p)}normalizeGlyphsURL(b,p){if(!ao(b))return b;const y=sa(b);return y.path=`/fonts/v1${y.path}`,this._makeAPIURL(y,this._customAccessToken||p)}normalizeModelURL(b,p){if(!ao(b))return b;const y=sa(b);return y.path=`/models/v1${y.path}`,this._makeAPIURL(y,this._customAccessToken||p)}normalizeSourceURL(b,p,y,T){if(!ao(b))return b;const S=sa(b);return S.path=`/v4/${S.authority}.json`,S.params.push("secure"),y&&S.params.push(`language=${y}`),T&&S.params.push(`worldview=${T}`),this._makeAPIURL(S,this._customAccessToken||p)}normalizeIconsetURL(b,p){const y=sa(b);return ao(b)?(y.path=`/styles/v1${y.path}/iconset.pbf`,this._makeAPIURL(y,this._customAccessToken||p)):Zl(y)}normalizeSpriteURL(b,p,y,T){const S=sa(b);return ao(b)?(S.path=`/styles/v1${S.path}/sprite${p}${y}`,this._makeAPIURL(S,this._customAccessToken||T)):(S.path+=`${p}${y}`,Zl(S))}normalizeTileURL(b,p,y){if(this._isSkuTokenExpired()&&this._createSkuToken(),b&&!ao(b))return b;const T=sa(b);T.path=T.path.replace(Ht,(p||y&&"raster"!==T.authority&&512===y?"@2x":"")+".webp"),"raster"===T.authority?T.path=`/${Ft.RASTER_URL_PREFIX}${T.path}`:"rasterarrays"===T.authority?T.path=`/${Ft.RASTERARRAYS_URL_PREFIX}${T.path}`:"3dtiles"===T.authority?T.path=`/${Ft.TILES3D_URL_PREFIX}${T.path}`:(T.path=T.path.replace(Nu,"/"),T.path=`/${Ft.TILE_URL_VERSION}${T.path}`);const S=this._customAccessToken||function(R){for(const M of R){const F=M.match(zs);if(F)return F[1]}return null}(T.params)||Ft.ACCESS_TOKEN;return Ft.REQUIRE_ACCESS_TOKEN&&S&&this._skuToken&&T.params.push(`sku=${this._skuToken}`),this._makeAPIURL(T,S)}canonicalizeTileURL(b,p){const y=sa(b);if(!sl.test(y.path)||!ey.test(y.path))return b;let T="mapbox://";y.path.startsWith("/raster/v1/")?T+=`raster/${y.path.replace(`/${Ft.RASTER_URL_PREFIX}/`,"")}`:y.path.startsWith("/rasterarrays/v1/")?T+=`rasterarrays/${y.path.replace(`/${Ft.RASTERARRAYS_URL_PREFIX}/`,"")}`:T+=`tiles/${y.path.replace(`/${Ft.TILE_URL_VERSION}/`,"")}`;let S=y.params;return p&&(S=S.filter(R=>!R.match(zs))),S.length&&(T+=`?${S.join("&")}`),T}canonicalizeTileset(b,p){const y=!!p&&ao(p),T=[];for(const S of b.tiles||[])Li(S)?T.push(this.canonicalizeTileURL(S,y)):T.push(S);return T}_makeAPIURL(b,p){const y="See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes",T=sa(Ft.API_URL);if(b.protocol=T.protocol,b.authority=T.authority,"http"===b.protocol){const S=b.params.indexOf("secure");S>=0&&b.params.splice(S,1)}if("/"!==T.path&&(b.path=`${T.path}${b.path}`),!Ft.REQUIRE_ACCESS_TOKEN)return Zl(b);if(p=p||Ft.ACCESS_TOKEN,!this._silenceAuthErrors){if(!p)throw new Error(`An API access token is required to use Mapbox GL. ${y}`);if("s"===p[0])throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${y}`)}return b.params=b.params.filter(S=>!S.includes("access_token")),b.params.push(`access_token=${p||""}`),Zl(b)}},a.eQ=Qp,a.eR=function(b,p){p?Ch.add(b):Ch.delete(b)},a.eS=md,a.eT=Pv,a.eU=Df,a.eV=ih,a.eW=ry,a.eX=Zm,a.eY=fp,a.eZ=function(b){Ch.delete(b)},a.e_=iy,a.ea=Vr,a.eb=function(b,p){var y=Math.sin(p),T=Math.cos(p);return b[0]=T,b[1]=0,b[2]=-y,b[3]=0,b[4]=0,b[5]=1,b[6]=0,b[7]=0,b[8]=y,b[9]=0,b[10]=T,b[11]=0,b[12]=0,b[13]=0,b[14]=0,b[15]=1,b},a.ec=function(b,p){var y=Math.sin(p),T=Math.cos(p);return b[0]=1,b[1]=0,b[2]=0,b[3]=0,b[4]=0,b[5]=T,b[6]=y,b[7]=0,b[8]=0,b[9]=-y,b[10]=T,b[11]=0,b[12]=0,b[13]=0,b[14]=0,b[15]=1,b},a.ed=function(b,p){return b[0]=p[0],b[1]=p[1],b[2]=p[2],b[3]=p[4],b[4]=p[5],b[5]=p[6],b[6]=p[8],b[7]=p[9],b[8]=p[10],b},a.ee=f,a.ef=ta,a.eg=1,a.eh=nz,a.ei=0,a.ej=xo,a.ek=function(b,p,y,T,S){return bn((b-p)/(y-p)*(S-T)+T,T,S)},a.el=re,a.em=Wt,a.en=function(b,p){var y=p[0],T=p[1],S=p[2],R=p[3],M=p[4],F=p[5],G=p[6],q=p[7],Q=p[8],ie=Q*M-F*q,ae=-Q*R+F*G,de=q*R-M*G,pe=y*ie+T*ae+S*de;return pe?(b[0]=ie*(pe=1/pe),b[1]=(-Q*T+S*q)*pe,b[2]=(F*T-S*M)*pe,b[3]=ae*pe,b[4]=(Q*y-S*G)*pe,b[5]=(-F*y+S*R)*pe,b[6]=de*pe,b[7]=(-q*y+T*G)*pe,b[8]=(M*y-T*R)*pe,b):null},a.eo=Di,a.ep=class{constructor(){this._updateTime=0,this._sourceIds=[],this._activeRegions=[],this._prevRegions=[],this._globalClipBounds={min:new nt(1/0,1/0),max:new nt(-1/0,-1/0)}}clear(){this._activeRegions.length>0&&++this._updateTime,this._activeRegions=[],this._prevRegions=[]}get updateTime(){return this._updateTime}getReplacementRegionsForTile(b,p=false){const y=vTt(new nt(0,0),new nt(qr,qr),b),T=[];if(p&&!b5e(y,this._globalClipBounds))return T;for(const S of this._activeRegions){if(S.hiddenByOverlap)continue;if(!b5e(y,S))continue;const R=dTr(S.min,S.max,b);T.push({min:R.min,max:R.max,sourceId:this._sourceIds[S.priority],footprint:S.footprint,footprintTileId:S.tileId,order:S.order,clipMask:S.clipMask,clipScope:S.clipScope})}return T}setSources(b){this._setSources(b.map(p=>({getSourceId:()=>p.cache.id,getFootprints:()=>{const y=[];for(const T of p.cache.getVisibleCoordinates()){const S=p.cache.getTile(T).buckets[p.layer];S&&S.updateFootprints(T.toUnwrapped(),y)}return y},getOrder:()=>p.order,getClipMask:()=>p.clipMask,getClipScope:()=>p.clipScope})))}_addSource(b){const p=b.getFootprints();if(0===p.length)return;const y=b.getOrder(),T=b.getClipMask(),S=b.getClipScope();for(const R of p){if(!R.footprint)continue;const M=vTt(R.footprint.min,R.footprint.max,R.id);this._activeRegions.push({min:M.min,max:M.max,hiddenByOverlap:false,priority:this._sourceIds.length,tileId:R.id,footprint:R.footprint,order:y,clipMask:T,clipScope:S})}this._sourceIds.push(b.getSourceId())}_computeReplacement(){this._activeRegions.sort((p,y)=>p.priority-y.priority||sle(p.min,y.min)||sle(p.max,y.max)||p.order-y.order||p.clipMask-y.clipMask||function(T,S){const R=(M,F)=>M+F;return T.length-S.length||T.reduce(R,"").localeCompare(S.reduce(R,""))}(p.clipScope,y.clipScope));let b=this._activeRegions.length!==this._prevRegions.length;if(!b){let p=0;for(;!b&&p!==this._activeRegions.length;){const y=this._activeRegions[p],T=this._prevRegions[p];b=y.priority!==T.priority||!xTt(y,T)||y.order!==T.order||y.clipMask!==T.clipMask||!Rr(y.clipScope,T.clipScope),this._activeRegions[p].hiddenByOverlap=T.hiddenByOverlap,++p}}if(b){++this._updateTime;for(const y of this._activeRegions)y.order!==zq&&(this._globalClipBounds.min.x=Math.min(this._globalClipBounds.min.x,y.min.x),this._globalClipBounds.min.y=Math.min(this._globalClipBounds.min.y,y.min.y),this._globalClipBounds.max.x=Math.max(this._globalClipBounds.max.x,y.max.x),this._globalClipBounds.max.y=Math.max(this._globalClipBounds.max.y,y.max.y));const p=y=>{const T=this._activeRegions;if(y>=T.length)return y;const S=T[y].priority;for(;y1){let y=0,T=p(y);for(;y!==T;){let S=y;const R=y;for(;S!==T;){const M=this._activeRegions[S];M.hiddenByOverlap=false;for(let F=0;F=0;p--)this._addSource(b[p]);this._computeReplacement()}},a.eq=zq,a.er=class{constructor(b){this._createGrid(b),this._createPoles(b)}destroy(){this._poleIndexBuffer.destroy(),this._gridBuffer.destroy(),this._gridIndexBuffer.destroy(),this._poleNorthVertexBuffer.destroy(),this._poleSouthVertexBuffer.destroy();for(const b of this._poleSegments)b.destroy();for(const b of this._gridSegments)b.withSkirts.destroy(),b.withoutSkirts.destroy()}_fillGridMeshWithLods(b,p){const y=new wn,T=new po,S=[],R=b+1+2,M=p[0]+1,F=p[0]+1+(1+p.length),G=(q,Q,ie)=>{let ae=q===R-1?q-2:0===q?q:q-1;return ae+=ie?24575:0,[ae,Q]};for(let q=0;q=b.byteLength)&&yn("Invalid b3dm header information.")}return gwt(b,p)},a.fB=function(b,p){const y=b.json.extensionsUsed&&b.json.extensionsUsed.includes("mbx_bvh"),T=j5e(b);for(const S of T){if(!y)for(const R of S.meshes)mwr(R);S.lights&&(S.lightMeshIndex=S.meshes.length,S.meshes.push(gwr(S.lights,p)))}return T},a.fC=le,a.fD=Y2t,a.fE=li,a.fF=function(b,p){let y="";for(let T=0;T=8592&&b<=8595||8208===b||8229===b||8741===b||b>=9472&&b<=9547||65294===b||65309===b||65374===b||65507===b},a.fL=3,a.fM=$F,a.fN=M_t,a.fO=TA,a.fP=function(b){for(const p of b)if(!NOe(p.charCodeAt(0)))return false;return true},a.fQ=Cse,a.fR=s5e,a.fS=j_t,a.fT=eTt,a.fU=K_t,a.fV=RTt,a.fW=1,a.fX=Z_t,a.fY=J_t,a.fZ=Pt,a.f_=W7,a.fa=function(b){"string"!=typeof b||b.length>64||!ty.test(b)?yn(`Invalid SDK info "${b}"; expected a "Name/version" string. Ignoring.`):Hd=b},a.fb=bq,a.fc=function(b,p,y=false){if(rm===cy.deferred||rm===cy.loading||rm===cy.loaded)throw new Error("setRTLTextPlugin cannot be called multiple times.");F2=Ct.resolveURL(b),rm=cy.deferred,R7=p,lI(),y||kse()},a.fd=function(b){Ft.BUILDING_GEN_URL=Ct.resolveURL(b)},a.fe=fn,a.ff=function(b){const p=Ct.resolveURL(b);Ft.MESHOPT_URL=p,Ft.MESHOPT_SIMD_URL=p},a.fg=Qt,a.fh=function(b){Ft.DRACO_URL=Ct.resolveURL(b)},a.fi=Dt,a.fj=function(b){const p=pi();if(!p)return;const y=p.delete(tr);b&&y.then(()=>b()).catch(b)},a.fk=function(b){Ft.MAX_PARALLEL_IMAGE_REQUESTS=b},a.fl=function(b){Ft.API_URL=b},a.fm=function(b){Ft.ACCESS_TOKEN=b},a.fn="hd_road_elevation",a.fo=class{static parseFrom(b,p){const y=kA.parse(b);if(!y)return[];let{vertices:T,features:S}=y;const R=1/le(p);S.sort((q,Q)=>q.id-Q.id),T.sort((q,Q)=>q.id-Q.id||q.idx-Q.idx),T=T.filter((q,Q,ie)=>Q===ie.findIndex(ae=>ae.id===q.id&&ae.idx===q.idx));const M=new Array;let F=0;const G=T.length;for(const q of S){if(q.constantHeight){M.push(new RA(q.id,q.bounds,q.constantHeight));continue}for(;F!==G&&T[F].id0&&z5e(p,b.layers[0].source,b.sourceLayerName);(T||S)&&(b.hdExt=new twt(b,T,S))},a.fv=function(b,p){const y="hd-road-markup"===b.layers[0].layout.get("line-elevation-reference"),T=!!p&&p.length>0&&z5e(p,b.layers[0].source,b.sourceLayerName);(y||T)&&(b.hdExt=new nwt(y,T))},a.fw=qse,a.fx=function(b){const p=b.layers[0];"circle"===p.type&&"hd-road-markup"===p.layout.get("circle-elevation-reference")&&(b.hdExt=new rwt)},a.fy=function(b){"hd-road-markup"===b.layers[0].layout.get("symbol-elevation-reference")&&(b.hdExt=new iwt)},a.fz=WEt,a.g=xu,a.g0=tTt,a.g1=function(b,p){const y=b.stretchY||[[0,b.paddedRect.h-2]];return b.stretchX||b.stretchY?OTt(b.stretchX||[[0,b.paddedRect.w-2]])*OTt(y):1},a.g2=BTt,a.g3=xI,a.g4=2,a.g5=j2t,a.g6=V_t,a.g7=z5e,a.g8=function(b,p){const y=Ele(b);return null!==y&&!!(p&1<=0&&b<128)return this.pos>=this.length&&this.realloc(1),void(this.buf[this.pos++]=b);b>268435455||b<0?function(p,y){let T,S;if(p>=0?(T=p%4294967296|0,S=p/4294967296|0):(T=~(-p%4294967296),S=~(-p/4294967296),4294967295^T?T=T+1|0:(T=0,S=S+1|0)),p>=18446744073709552e3||p<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");y.realloc(10),function(R,M,F){F.buf[F.pos++]=127&R|128,R>>>=7,F.buf[F.pos++]=127&R|128,R>>>=7,F.buf[F.pos++]=127&R|128,R>>>=7,F.buf[F.pos++]=127&R|128,F.buf[F.pos]=127&(R>>>=7)}(T,0,y),function(R,M){const F=(7&R)<<4;M.buf[M.pos++]|=F|((R>>>=3)?128:0),R&&(M.buf[M.pos++]=127&R|((R>>>=7)?128:0),R&&(M.buf[M.pos++]=127&R|((R>>>=7)?128:0),R&&(M.buf[M.pos++]=127&R|((R>>>=7)?128:0),R&&(M.buf[M.pos++]=127&R|((R>>>=7)?128:0),R&&(M.buf[M.pos++]=127&R)))))}(S,y)}(b,this):(this.realloc(4),this.buf[this.pos++]=127&b|(b>127?128:0),b<=127||(this.buf[this.pos++]=127&(b>>>=7)|(b>127?128:0),b<=127||(this.buf[this.pos++]=127&(b>>>=7)|(b>127?128:0),b<=127||(this.buf[this.pos++]=b>>>7&127))))}writeSVarint(b){this.writeVarint(b<0?2*-b-1:2*b)}writeBoolean(b){this.writeVarint(+b)}writeString(b){b=String(b),this.realloc(4*b.length),this.pos++;const p=this.pos;this.pos=function(T,S,R){for(let M,F,G=0;G55295&&M<57344){if(!F){M>56319||G+1===S.length?(T[R++]=239,T[R++]=191,T[R++]=189):F=M;continue}if(M<56320){T[R++]=239,T[R++]=191,T[R++]=189,F=M;continue}M=F-55296<<10|M-56320|65536,F=null}else F&&(T[R++]=239,T[R++]=191,T[R++]=189,F=null);M<128?T[R++]=M:(M<2048?T[R++]=M>>6|192:(M<65536?T[R++]=M>>12|224:(T[R++]=M>>18|240,T[R++]=M>>12&63|128),T[R++]=M>>6&63|128),T[R++]=63&M|128)}return R}(this.buf,b,this.pos);const y=this.pos-p;y>=128&&CTt(p,y,this),this.pos=p-1,this.writeVarint(y),this.pos+=y}writeFloat(b){this.realloc(4),this.dataView.setFloat32(this.pos,b,true),this.pos+=4}writeDouble(b){this.realloc(8),this.dataView.setFloat64(this.pos,b,true),this.pos+=8}writeBytes(b){const p=b.length;this.writeVarint(p),this.realloc(p),this.buf.set(b,this.pos),this.pos+=p}writeRawMessage(b,p){this.pos++;const y=this.pos;b(p,this);const T=this.pos-y;T>=128&&CTt(y,T,this),this.pos=y-1,this.writeVarint(T),this.pos+=T}writeMessage(b,p,y){this.writeTag(b,2),this.writeRawMessage(p,y)}writePackedVarint(b,p){p.length&&this.writeMessage(b,fTr,p)}writePackedSVarint(b,p){p.length&&this.writeMessage(b,hTr,p)}writePackedBoolean(b,p){p.length&&this.writeMessage(b,gTr,p)}writePackedFloat(b,p){p.length&&this.writeMessage(b,pTr,p)}writePackedDouble(b,p){p.length&&this.writeMessage(b,mTr,p)}writePackedFixed32(b,p){p.length&&this.writeMessage(b,yTr,p)}writePackedSFixed32(b,p){p.length&&this.writeMessage(b,bTr,p)}writePackedFixed64(b,p){p.length&&this.writeMessage(b,xTr,p)}writePackedSFixed64(b,p){p.length&&this.writeMessage(b,vTr,p)}writeBytesField(b,p){this.writeTag(b,2),this.writeBytes(p)}writeFixed32Field(b,p){this.writeTag(b,5),this.writeFixed32(p)}writeSFixed32Field(b,p){this.writeTag(b,5),this.writeSFixed32(p)}writeFixed64Field(b,p){this.writeTag(b,1),this.writeFixed64(p)}writeSFixed64Field(b,p){this.writeTag(b,1),this.writeSFixed64(p)}writeVarintField(b,p){this.writeTag(b,0),this.writeVarint(p)}writeSVarintField(b,p){this.writeTag(b,0),this.writeSVarint(p)}writeStringField(b,p){this.writeTag(b,2),this.writeString(p)}writeFloatField(b,p){this.writeTag(b,5),this.writeFloat(p)}writeDoubleField(b,p){this.writeTag(b,1),this.writeDouble(p)}writeBooleanField(b,p){this.writeVarintField(b,+p)}},a.gj=Dr,a.gk=ale,a.gl=cy,a.gm=qEt,a.gn=function(b){Qr(),null!=Ar&&Ar.then(p=>{p.keys().then(y=>{for(let T=0;Tyn(S.message))}).catch(y=>yn(y.message))}).catch(p=>yn(p.message))},a.h=l0,a.i=ay,a.j=2,a.k=Uq,a.l=S2,a.m=M7,a.n=nA,a.o=Rt,a.p=STt,a.q=A2,a.r=tq,a.s=An,a.t=JF,a.u=Pse,a.v=hse,a.w=yn,a.x=v7,a.y=P7,a.z=oq});r(["require","./shared"],function(o,a){function s(ut){const ke=ut?ut.url.toString():void 0;return ke?performance.getEntriesByName(ke):[]}function l(ut,ke){if(Object.hasOwn(ut.layers,a.fn))return a.fo.parseFrom(ut.layers[a.fn],ke)}function u({buckets:ut,data:ke,sourceLayerCoder:je,canonical:gt,options:Rt}){if(!Rt.elevationFeatures||0===Rt.elevationFeatures.length)return;const Ct=[];for(const Ft of Object.values(ut))if(Ft instanceof a.bA&&Ft.hdExt){const Dt=Ft.hdExt.getUnevaluatedPortalGraph();Dt&&Ct.push(Dt)}const Mt=a.fp.evaluate(Ct);for(const Ft of Object.values(ut))if(Ft instanceof a.bA&&Ft.hdExt){const Dt=ke.layers[je.decode(Ft.sourceLayerIndex)];Ft.hdExt.setEvaluatedPortalGraph(Mt,Dt,gt,Rt.availableImages,Rt.brightness,Ft.worldview)}}function d(ut){const ke=[];for(let je=0;je0){let Dt=false;for(const Qt of Mt[0])if(Qt.x<0||Qt.x>a.a2||Qt.y<0||Qt.y>a.a2){Dt=true;break}if(Dt)continue}const Ft=1===Mt.length&&5===Mt[0].length&&Mt[0].some(Dt=>Dt.x<=0&&Dt.y<=0)&&Mt[0].some(Dt=>Dt.x>=a.a2&&Dt.y<=0)&&Mt[0].some(Dt=>Dt.x>=a.a2&&Dt.y>=a.a2)&&Mt[0].some(Dt=>Dt.x<=0&&Dt.y>=a.a2);ke.push(new a.fq(Ct,Ft?[]:Mt))}return ke}function f(ut,ke,je,gt,Rt){const Ct=a.fr(ke);if(null===Ct)return false;let Mt=je.x,Ft=je.y;const Dt=Rt??gt.z;if(gt.z!==Dt){const Qt=1<vn.map(On=>[On.x,On.y]));if(a.fs([Mt,Ft],fn))return true}return false}function h(ut,ke,je,gt){const Rt=ke.indoorState.activeFloorsVisible;if(!ke.sourceLayers)return Rt?ke.indoorState.activeFloors:void 0;const Ct=function(Dt,Qt){if(!Dt)return a.w("No source layers defined in indoor specification"),Qt;if(0===Dt.size)return Qt;const fn=Dt.difference(Qt);for(const vn of fn)a.w(`Missing source layer required in indoor specification: ${vn}`);return Qt.intersection(Qt)}(ke.sourceLayers,new Set(Object.keys(ut.layers))),Mt=ke.indoorState,Ft=function(Dt,Qt,fn,vn,On){const tr={};for(const ar of Qt){const oi=Dt.layers[ar];if(oi)for(let ei=0;eiar.map(oi=>a.ft(oi,vn,fn.extent)));return 0===tr.length?void 0:{type:"Polygon",coordinates:[tr[0]]}}(ut,ke);return{id:je,isDefault:gt,connections:Rt,conflicts:Ct,buildings:Mt,name:Ft,zIndex:Dt,geometry:Qt}}function _(ut,ke){return ke.every(je=>ut.properties&&null!=ut.properties[je])}function C(ut){return _(ut,["type","id","name"])&&"structure"===ut.properties.type}function A(ut){return _(ut,["type","id","name","z_index"])&&"floor"===ut.properties.type}function P(ut,ke){ut instanceof a.bA?a.fu(ut,ke):ut instanceof a.bz?a.fv(ut,ke):ut instanceof a.fw?a.fx(ut):ut instanceof a.bu&&a.fy(ut)}function L(ut){for(const ke in ut){const je=ut[ke];if(je instanceof a.bz&&je.hdExt&&je.hdExt.hasDeferredElevationFeatures)return true;if(je instanceof a.bu&&je.hdExt&&je.hdExt.hasDeferredElevationFeatures)return true}return false}class I{constructor(ke,je,gt){this.tileID=new a.bP(ke.tileID.overscaledZ,ke.tileID.wrap,ke.tileID.canonical.z,ke.tileID.canonical.x,ke.tileID.canonical.y),this.tileZoom=ke.tileZoom,this.uid=ke.uid,this.zoom=ke.zoom,this.canonical=ke.tileID.canonical,this.pixelRatio=ke.pixelRatio,this.tileSize=ke.tileSize,this.source=ke.source,this.overscaling=this.tileID.overscaleFactor(),this.projection=ke.projection,this.brightness=je,this.worldview=gt}async parse(ke,je,gt){this.status="parsing";const Rt=new a.bP(gt.tileID.overscaledZ,gt.tileID.wrap,gt.tileID.canonical.z,gt.tileID.canonical.x,gt.tileID.canonical.y),Ct=[],Mt=je.familiesBySource[gt.source],Ft=new a.fz(Rt,gt.promoteId);Ft.bucketLayerIDs=[],Ft.is3DTile=true;const Dt=await a.fA(ke),Qt=Dt.json.extensionsUsed&&Dt.json.extensionsUsed.includes("MAPBOX_mesh_features")||Dt.json.asset.extras&&Dt.json.asset.extras.MAPBOX_mesh_features,fn=Dt.json.extensionsUsed&&Dt.json.extensionsUsed.includes("EXT_meshopt_compression"),vn=new a.ai(this.zoom,{brightness:this.brightness,worldview:this.worldview});for(const On in Mt)for(const tr of Mt[On]){const ar=tr[0];Ft.bucketLayerIDs.push(tr.map(Ar=>a.m(Ar.id,Ar.scope))),ar.recalculate(vn,[]);const oi=a.fB(Dt,1/a.fC(gt.tileID.canonical)),ei=new a.fD(tr,oi,Rt,Qt,fn,this.brightness,Ft,this.worldview);Qt||(ei.needsUpload=true),Ct.push(ei),ei.evaluate(ar)}return this.status="done",{buckets:Ct,featureIndex:Ft,collisionBoxArray:null,glyphAtlasImage:null,lineAtlas:null,imageAtlas:null,brightness:null}}}class N{constructor({actor:ke,layerIndex:je,availableImages:gt,availableModels:Rt,brightness:Ct,worldview:Mt}){this.actor=ke,this.layerIndex=je,this.availableImages=gt,this.availableModels=Rt,this.brightness=Ct,this.loading={},this.loaded={},this.worldview=Mt}async loadTile(ke){const je=ke.uid,gt=new AbortController,Rt=this.loading[je]=new I(ke,this.brightness,this.worldview);Rt.abort=()=>gt.abort();const Ct=(Ft,Dt)=>{const Qt=Rt.reloadCallback;Qt&&(delete Rt.reloadCallback,Qt(Ft,Dt))};let Mt;try{Mt=(await a.cC(ke.request,gt.signal)).data}catch(Ft){if(delete this.loading[je],Rt.status="done",this.loaded[je]=Rt,gt.signal.aborted)return null;throw Ft}if(delete this.loading[je],!Mt||0===Mt.byteLength)return Rt.status="done",this.loaded[je]=Rt,null;try{const Ft=await Rt.parse(Mt,this.layerIndex,ke);return this.loaded[je]=Rt,Ct(null,Ft),Ft}catch(Ft){throw this.loaded[je]=Rt,Ct(Ft),Ft}}async reloadTile(ke){const je=this.loaded&&this.loaded[ke.uid];if(je)return je.projection=ke.projection,je.brightness=ke.brightness,"parsing"===je.status&&await new Promise((gt,Rt)=>{je.reloadCallback=Ct=>{Ct?Rt(Ct):gt()}}),this.loadTile(ke)}abortTile(ke){const je=ke.uid,gt=this.loading[je];gt&&(gt.abort&>.abort(),delete this.loading[je])}removeTile(ke){const je=this.loaded,gt=ke.uid;je&&je[gt]&&delete je[gt]}}function O(ut){if("number"==typeof ut||"boolean"==typeof ut||"string"==typeof ut||null==ut)return JSON.stringify(ut);if(Array.isArray(ut)){let je="[";for(const gt of ut)je+=`${O(gt)},`;return`${je}]`}let ke="{";for(const je of Object.keys(ut).sort())ke+=`${je}:${O(ut[je])},`;return`${ke}}`}function z(ut){let ke="";for(const je of a.cD)ke+=`/${O(ut[je])}`;return ke}function U(ut,ke){return function je(gt){return"string"==typeof gt&>===ke||(Array.isArray(gt)?gt.some(je):!(!gt||"object"!=typeof gt)&&Object.values(gt).some(je))}(ut)}class W{constructor(ke){this.keyCache=Object.create(null),this._layers=Object.create(null),this._layerConfigs=Object.create(null),ke&&this.replace(ke)}replace(ke,je){this._layerConfigs=Object.create(null),this._layers=Object.create(null),this.update(ke,[],je)}update(ke,je,gt){this._options=gt;for(const Ct of ke)this._layerConfigs[Ct.id]=Ct,(this._layers[Ct.id]=a.di(Ct,this.scope,null,this._options)).compileFilter(gt),this.keyCache[Ct.id]&&delete this.keyCache[Ct.id];for(const Ct of je)delete this.keyCache[Ct],delete this._layerConfigs[Ct],delete this._layers[Ct];this.familiesBySource=Object.create(null);const Rt=function(Ct,Mt){const Ft=Object.create(null);for(let Qt=0;Qtthis._layers[On.id]),Ft=Mt[0];if("none"===Ft.visibility)continue;const Dt=Ft.source||"";let Qt=this.familiesBySource[Dt];Qt||(Qt=this.familiesBySource[Dt]=Object.create(null));const fn=Ft.sourceLayer||"_geojsonTileLayer";let vn=Qt[fn];vn||(vn=Qt[fn]=[]),vn.push(Mt)}}}class H extends a.P{constructor(ke,je,gt,Rt,Ct){super(ke,je),this.angle=Rt,this.z=gt,void 0!==Ct&&(this.segment=Ct)}clone(){return new H(this.x,this.y,this.z,this.angle,this.segment)}}function $(ut,ke,je,gt,Rt){if(void 0===ke.segment)return true;let Ct=ke,Mt=ke.segment+1,Ft=0;for(;Ft>-je/2;){if(Mt--,Mt<0)return false;Ft-=ut[Mt].dist(Ct),Ct=ut[Mt]}Ft+=ut[Mt].dist(ut[Mt+1]),Mt++;const Dt=[];let Qt=0;for(;Ftgt;)Qt-=Dt.shift().angleDelta;if(Qt>Rt)return false;Mt++,Ft+=fn.dist(vn)}return true}function K(ut){let ke=0;for(let je=0;jeQt){const ar=(Qt-Dt)/tr,oi=a.al(vn.x,On.x,ar),ei=a.al(vn.y,On.y,ar),Ar=new H(oi,ei,0,On.angleTo(vn),fn);return!Mt||$(ut,Ar,Ft,Mt,ke)?Ar:void 0}Dt+=tr}}function J(ut,ke,je,gt,Rt,Ct,Mt,Ft,Dt){const Qt=X(gt,Ct,Mt),fn=j(gt,Rt),vn=fn*Mt,On=0===ut[0].x||ut[0].x===Dt||0===ut[0].y||ut[0].y===Dt;return ke-vn=0&&wi=0&&Li=0&&On+Qt<=fn){const ao=new H(wi,Li,0,pi,ar);gt&&!$(ut,ao,Ct,gt,Rt)||tr.push(ao)}}vn+=Ar}return Ft||tr.length||Mt||(tr=oe(ut,vn/2,je,gt,Rt,Ct,Mt,true,Dt)),tr}a.fE(H,"Anchor");class se{constructor(){this.scale=1,this.fontStack="",this.image=null}static forText(ke,je){const gt=new se;return gt.scale=ke||1,gt.fontStack=je,gt}static forImage(ke){const je=new se;return je.image=ke,je}}class re{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(ke,je,gt,Rt=1){const Ct=new re;for(let Mt=0;Mt=0&>>=ke&&ue[this.text.charCodeAt(gt)];gt--)je--;this.text=this.text.substring(ke,je),this.sectionIndex=this.sectionIndex.slice(ke,je)}substring(ke,je){const gt=new re;return gt.text=this.text.substring(ke,je),gt.sectionIndex=this.sectionIndex.slice(ke,je),gt.sections=this.sections,gt}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((ke,je)=>Math.max(ke,this.sections[je].scale),0)}addTextSection(ke,je){this.text+=ke.text,this.sections.push(se.forText(ke.scale,ke.fontStack||je));const gt=this.sections.length-1;for(let Rt=0;Rt=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function ce(ut,ke,je,gt,Rt,Ct,Mt,Ft,Dt,Qt,fn,vn,On,tr,ar,oi=1,ei=1){const Ar=re.fromFeature(ut,Rt,oi,ei);vn===a.cL.vertical&&Ar.verticalizePunctuation(On);let pi=[];const Qr=function(fo,fs,Ga,ea,ha,bo,aa){if(!fo)return[];const Ts=[],Xo=function(es,sc,Ul,Zs,kl,al,Lc){let uf=0;for(let Ht=0;Ht0&&md>Zl&&(Zl=md)}else{const Zm=Ga[ty.fontStack];if(!Zm)continue;Zm[ll]&&(em=Zm[ll]);const Dc=fs[ty.fontStack];if(!Dc)continue;const fp=Dc.glyphs[ll];if(!fp)continue;if(Wd=fp.metrics,ih=8203!==ll?a.d1:0,Lc){const Dl=void 0!==Dc.ascender?Math.abs(Dc.ascender):0,md=void 0!==Dc.descender?Math.abs(Dc.descender):0,iy=(Dl+md)*jc;GdCt)&&(Ct=ar.x),(!tr||ar.y>Mt)&&(Mt=ar.y)}const Dt=Math.min(Ct-gt,Mt-Rt);let Qt=Dt/2;const fn=new a.fM([],$e);if(0===Dt)return new a.P(gt,Rt);for(let tr=gt;trvn.d||!vn.d)&&(vn=tr,je&&console.log("found best %d after %d probes",Math.round(1e4*tr.d)/1e4,On)),tr.max-vn.d<=ke||(Qt=tr.h/2,fn.push(new Ee(tr.p.x-Qt,tr.p.y-Qt,Qt,ut)),fn.push(new Ee(tr.p.x+Qt,tr.p.y-Qt,Qt,ut)),fn.push(new Ee(tr.p.x-Qt,tr.p.y+Qt,Qt,ut)),fn.push(new Ee(tr.p.x+Qt,tr.p.y+Qt,Qt,ut)),On+=4)}return je&&(console.log(`num probes: ${On}`),console.log(`best distance: ${vn.d}`)),vn.p}function $e(ut,ke){return ke.max-ut.max}class Ee{constructor(ke,je,gt,Rt){this.p=new a.P(ke,je),this.h=gt,this.d=function(Ct,Mt){let Ft=false,Dt=1/0;for(let Qt=0;QtCt.y!=oi.y>Ct.y&&Ct.x<(oi.x-ar.x)*(Ct.y-ar.y)/(oi.y-ar.y)+ar.x&&(Ft=!Ft),Dt=Math.min(Dt,a.fN(Ct,ar,oi))}}return(Ft?1:-1)*Math.sqrt(Dt)}(this.p,Rt),this.max=this.d+this.h*Math.SQRT2}}const tt=Object.keys;function yt(ut){return void 0!==ut.imagePrimary&&void 0!==ut.top&&void 0!==ut.bottom&&void 0!==ut.left&&void 0!==ut.right}function mt(ut){return!ut.imagePrimary.stretchX}function ct(ut){return!ut.imagePrimary.stretchY}function Ge(ut){return{width:ut.right-ut.left,height:ut.bottom-ut.top}}const it=Number.POSITIVE_INFINITY;function bt(ut,ke,je,gt,Rt,Ct){const Mt=yt(ut)&&ut.collisionPadding?ut.collisionPadding:[0,0,0,0],Ft={top:ut.top-Mt[1],bottom:ut.bottom+Mt[3],left:ut.left-Mt[0],right:ut.right+Mt[2],scaled:false};return void 0!==gt&&function(Dt,Qt){Dt.top*=Qt,Dt.bottom*=Qt,Dt.left*=Qt,Dt.right*=Qt,Dt.scaled=true}(Ft,gt),Ct&&(Ft.left+=Ct[0],Ft.right+=Ct[0],Ft.top+=Ct[1],Ft.bottom+=Ct[1]),je&&function(Dt,Qt,fn){if(!Qt)return;const vn=a.au(Qt),On=new a.P(fn?fn[0]:0,fn?fn[1]:0),tr=new a.P(Dt.left,Dt.top),ar=new a.P(Dt.right,Dt.top),oi=new a.P(Dt.left,Dt.bottom),ei=new a.P(Dt.right,Dt.bottom);tr._rotateAround(vn,On),ar._rotateAround(vn,On),oi._rotateAround(vn,On),ei._rotateAround(vn,On),Dt.left=Math.min(tr.x,ar.x,oi.x,ei.x),Dt.right=Math.max(tr.x,ar.x,oi.x,ei.x),Dt.top=Math.min(tr.y,ar.y,oi.y,ei.y),Dt.bottom=Math.max(tr.y,ar.y,oi.y,ei.y)}(Ft,je,Rt),ke?{top:Math.min(ke.top,Ft.top),bottom:Math.max(ke.bottom,Ft.bottom),left:Math.min(ke.left,Ft.left),right:Math.max(ke.right,Ft.right),scaled:ke.scaled||Ft.scaled}:Ft}function He(ut,ke,je,gt,Rt,Ct,Mt,Ft=1,Dt,Qt,fn,vn,On,tr,ar,oi,ei){ut.createArrays(),ut.tilePixelRatio=a.a2/(512*ut.overscaling),ut.compareText={},ut.iconsNeedLinear=false;const Ar=ut.layers[0].layout,pi=ut.layers[0]._unevaluatedLayout._values,Qr={};Qr.scaleFactor=Ft,Qr.textSizeScaleRange=Ar.get("text-size-scale-range"),Qr.iconSizeScaleRange=Ar.get("icon-size-scale-range");const[wi,Li]=Qr.textSizeScaleRange,[ao,Mo]=Qr.iconSizeScaleRange;Qr.textScaleFactor=a.b0(Qr.scaleFactor,wi,Li),Qr.iconScaleFactor=a.b0(Qr.scaleFactor,ao,Mo);const fo=pi["text-size"],fs=pi["icon-size"];if("composite"===ut.textSizeData.kind){const{minZoom:Xo,maxZoom:Qa}=ut.textSizeData;Qr.compositeTextSizes=[fo.possiblyEvaluate(new a.ai(Xo,{worldview:fn}),Ct),fo.possiblyEvaluate(new a.ai(Qa,{worldview:fn}),Ct)]}if("composite"===ut.iconSizeData.kind){const{minZoom:Xo,maxZoom:Qa}=ut.iconSizeData;Qr.compositeIconSizes=[fs.possiblyEvaluate(new a.ai(Xo,{worldview:fn}),Ct,vn),fs.possiblyEvaluate(new a.ai(Qa,{worldview:fn}),Ct,vn)]}Qr.layoutTextSize=fo.possiblyEvaluate(new a.ai(Mt+1,{worldview:fn}),Ct),Qr.layoutIconSize=fs.possiblyEvaluate(new a.ai(Mt+1,{worldview:fn}),Ct,vn),Qr.textMaxSize=fo.possiblyEvaluate(new a.ai(18,{worldview:fn}),Ct);const Ga=Ar.get("symbol-placement"),ea="map"===Ar.get("text-rotation-alignment")&&"point"!==Ga,ha=Ar.get("text-size");let bo=false;const aa=[],Ts=null!=On&&0!==On;for(const Xo of ut.features){if(Ts&&Xo.properties&&oi&&oi(Xo.properties,On))continue;let Qa=65535;if(ut.hdExt&&Xo.properties&&Object.hasOwn(Xo.properties,a.fO)){const ll=+Xo.properties[a.fO];if(!Number.isNaN(ll)){const jc=ut.hdExt.resolveRoadElevation(Xo,ll);if("defer"===jc)continue;Qa=jc}}const xu=Ar.get("text-font").evaluate(Xo,{},Ct).join(","),es=ha.evaluate(Xo,{},Ct)*Qr.textScaleFactor,sc=Qr.layoutTextSize.evaluate(Xo,{},Ct)*Qr.textScaleFactor,Ul=Qr.layoutIconSize.evaluate(Xo,{},Ct,vn)*Qr.iconScaleFactor,Zs={horizontal:{},vertical:void 0},kl=Xo.text;let al,Lc=[0,0];if(kl){const ll=kl.toString(),jc=Ar.get("text-letter-spacing").evaluate(Xo,{},Ct)*a.d1,Wd=Ar.get("text-line-height").evaluate(Xo,{},Ct)*a.d1,em=a.fP(ll)?jc:0,dp=Ar.get("text-anchor").evaluate(Xo,{},Ct),ih=Ar.get("text-variable-anchor");if(!ih){const Dc=Ar.get("text-radial-offset").evaluate(Xo,{},Ct);if(Dc)Lc=a.cN(dp,[Dc*a.d1,it]);else{const fp=Ar.get("text-offset").evaluate(Xo,{},Ct);Lc=[fp[0]*a.d1,fp[1]*a.d1]}}let df=ea?"center":Ar.get("text-justify").evaluate(Xo,{},Ct);const ry="point"===Ga,Eb=ry?Ar.get("text-max-width").evaluate(Xo,{},Ct)*a.d1:1/0,Zm=Dc=>{ut.allowVerticalPlacement&&a.fQ(ll)&&(Zs.vertical=ce(kl,ke,je,Rt,xu,Eb,Wd,dp,Dc,em,Lc,a.cL.vertical,true,sc,es,Dt,Qr.textScaleFactor))};if(!ea&&ih){const Dc="auto"===df?ih.map(Dl=>a.cO(Dl)):[df];let fp=false;for(let Dl=0;Dl0?Ar/Dt:1;pi&&(ut.iconBBox=bt(pi,ut.iconBBox,ei,1!==Li?Li:void 0)),Qr&&(ut.iconVerticalBBox=bt(Qr,ut.iconVerticalBBox,ei+90,1!==Li?Li:void 0))}function we(ut,ke,je,gt,Rt,Ct,Mt,Ft){let Dt=null;const Qt=ke.getAppearanceValueAndResolveTokens(je,"icon-image",gt,Rt,Ft);if(Qt){const fn=ut.getResolvedImageFromTokens(Qt),vn=je.hasLayoutProperty("icon-size")?je.getUnevaluatedLayoutProperty("icon-size"):ke._unevaluatedLayout._values["icon-size"],On=a.f_(ut.zoom,vn,ut.worldview,Ft),tr=a.fR(fn,On,vn,Rt,ut.zoom,gt,ut.pixelRatio,Mt,ut.worldview,Ft);Dt=Ct.get(tr.iconPrimary.toString())}return Dt}function Ze(ut,ke,je,gt,Rt,Ct,Mt,Ft,Dt,Qt){const{appearanceTextOffset:fn,appearanceTextRotate:vn,appearanceTextSize:On}=a.fY(je,ke,gt,Rt,Ct,Mt,Ft),tr=On/Ft,ar=[(fn[0]-Ct[0])*tr,(fn[1]-Ct[1])*tr],oi=0!==ar[0]||0!==ar[1];Dt&&(ut.textBBox=bt(Dt,ut.textBBox,vn,tr,fn,oi?ar:void 0)),Qt&&(ut.textVerticalBBox=bt(Qt,ut.textVerticalBBox,vn+90,tr,fn,oi?ar:void 0))}function Be(ut,ke,je,gt,Rt,Ct,Mt,Ft){if(!ut||!ut.usvg)return;const Dt=Ge(je),Qt=Ge(gt),fn="both"!==Rt&&"width"!==Rt||!mt(je)?1:Qt.width/Dt.width,vn="both"!==Rt&&"height"!==Rt||!ct(je)?1:Qt.height/Dt.height;ke.scaleSelf(fn,vn);const On=ke.toString();Ct.set(On,ke),Mt.set(On,ut);const{imagePosition:tr}=a.fV(On,ut,a.fW);Ft.set(On,tr)}function qe(ut,ke,je){if(!ke)return;const gt=je.get(ut.toString()),Rt=je.get(ke.toString());gt&&Rt&&(gt.paddedRect.w===Rt.paddedRect.w&>.paddedRect.h===Rt.paddedRect.h||a.w(`Mismatch in icon variant sizes: ${ut.toString()} and ${ke.toString()}`),gt.usvg!==Rt.usvg&&a.w(`Mismatch in icon variant image types: ${ut.id} and ${ke.id}`))}function Qe(ut,ke,je,gt,Rt,Ct,Mt,Ft,Dt,Qt){ut.iconAtlasPositions=Qt.iconPositions;const{featureData:fn,sizes:vn,textAlongLine:On,symbolPlacement:tr,coveragePolygons:ar,coverageTileZoom:oi,symbolAnchorInFrcCoverage:ei}=ke,Ar=ke.hasAnySecondaryIcon||ut.hasAnySecondaryIcon;for(const pi of fn){const{shapedIcon:Qr,verticallyShapedIcon:wi,feature:Li,shapedTextOrientations:ao,shapedText:Mo,layoutTextSize:fo,textOffset:fs,isSDFIcon:Ga,iconPrimary:ea,iconSecondary:ha,iconTextFit:bo,iconOffset:aa,iconCollisionBounds:Ts,iconVerticalCollisionBounds:Xo,textCollisionBounds:Qa,elevationFeatureIndex:xu}=pi;ze(Qr,Qt.iconPositions,ea,ha),ze(wi,Qt.iconPositions,ea,ha),Me(ao,Qt.iconPositions),qe(ea,ha,Qt.iconPositions),(Mo||Qr)&&Ae(ut,Li,ao,Qr,wi,Dt,vn,fo,0,fs,Ga,gt,Rt,Mt,Ft,Ar,bo,aa,On,tr,Ts,Xo,Qa,0,0,ar,oi,ei,xu)}je&&ut.generateCollisionDebugBuffers(Ct,ut.collisionBoxArray,vn.textScaleFactor),ut.text.uboBinder&&ut.text.uboBinder.finalize(),ut.icon.uboBinder&&ut.icon.uboBinder.finalize()}function ze(ut,ke,je,gt){if(!ut)return;const Rt=ke.get(je.toString());if(Rt&&(ut.imagePrimary=Rt),gt){const Ct=ke.get(gt.toString());ut.imageSecondary=Ct}}function Me(ut,ke){for(const je in ut.horizontal)ye(ut.horizontal[je],ke);ye(ut.vertical,ke)}function ye(ut,ke){if(ut){for(const je of ut.positionedLines)for(const gt of je.positionedGlyphs)if(null!==gt.image){const Rt=gt.image.toString();gt.rect=ke.get(Rt).paddedRect}}}function Ne(ut,ke,je,gt,Rt,Ct,Mt,Ft,Dt){const Qt=Oe(Ct.horizontal)||Ct.vertical,fn=je.get("icon-text-fit-padding").evaluate(gt,{},Rt);let vn,On=ke;return ke&&"none"!==Dt&&(ut.allowVerticalPlacement&&Ct.vertical&&(vn=a.fU(ke,Ct.vertical,Dt,fn,Ft,Mt)),Qt&&(On=a.fU(ke,Qt,Dt,fn,Ft,Mt))),{defaultShapedIcon:On,verticallyShapedIcon:vn}}function Ae(ut,ke,je,gt,Rt,Ct,Mt,Ft,Dt,Qt,fn,vn,On,tr,ar,oi,ei,Ar,pi,Qr,wi,Li,ao,Mo,fo,fs,Ga,ea,ha=65535){let bo=Mt.textMaxSize.evaluate(ke,{},On);void 0===bo?bo=Ft*Mt.textScaleFactor:bo*=Mt.textScaleFactor;const aa=ut.layers[0].layout,Ts=a.d1,Xo=a.fT(Ft,Mt.textScaleFactor),Qa=Oe(je.horizontal)||je.vertical,xu=ut.hasAnyAppearanceLayoutProperty(["text-size","text-offset","text-rotate"]),es=ut.getAppearanceFeatureData(ke.index);("none"!==ei||xu)&&es&&(es.textShaping=Qa,es.iconTextFitPadding=aa.get("icon-text-fit-padding").evaluate(ke,{},On),es.fontScale=Xo,es.textScaleFactor=Mt.textScaleFactor);const sc="globe"===tr.name,Ul=ut.tilePixelRatio*bo/Ts,Zs=(Nu=ut.overscaling,ut.zoom>18&&Nu>2&&(Nu>>=1),Math.max(a.a2/(512*Nu),1)*aa.get("symbol-spacing")),kl=aa.get("text-padding")*ut.tilePixelRatio,al=aa.get("icon-padding")*ut.tilePixelRatio,Lc=a.au(aa.get("text-max-angle")),uf="map"===aa.get("icon-rotation-alignment")&&"point"!==Qr,Ht=Zs/2;var Nu;false===ut.hasAnyIconTextFit&&"none"!==ei&&(ut.hasAnyIconTextFit=true);const ey=(sl,zs,Df)=>{if(zs.x<0||zs.x>=a.a2||zs.y<0||zs.y>=a.a2)return;if(fs&&fs.length>0&&ke.properties&&ea&&ea(fs,ke.properties,zs,On,Ga))return;let pd=null;if(sc){const{x:sa,y:Zl,z:Gd}=tr.projectTilePoint(zs.x,zs.y,Df);pd={anchor:new H(sa,Zl,Gd,0,void 0),up:tr.upVector(Df,zs.x,zs.y)}}!function(sa,Zl,Gd,Qp,rh,Hd,ty,ny,ll,jc,Wd,em,dp,ih,df,ry,Eb,Zm,Dc,fp,Dl,md,iy,Pv,Ch,QS,l0,hp,c0,Cb,tm,gd){const Sb=sa.addToLineVertexArray(Zl,Qp);let Zx,Iv,Si,fT,Wo,Mv,o7,a7=0,pp=0,v2=0,Sh=0,eA=-1,_2=-1;const xi={};let ts=a.dc("");const wa=Gd?Gd.anchor:Zl,oh="none"!==hp;let u0=0,Na=0;if(void 0===ll._unevaluatedLayout.getValue("text-radial-offset")){const Vl=ll.layout.get("text-offset").evaluate(Dl,{},Ch);u0=Vl[0]*a.d1,Na=Vl[1]*a.d1}else u0=ll.layout.get("text-radial-offset").evaluate(Dl,{},Ch)*a.d1,Na=it;if(sa.allowVerticalPlacement&&rh.vertical){const Vl=rh.vertical;if(df)Mv=kt(Vl),ny&&(o7=kt(ny));else{const Fl=ll.layout.get("text-rotate").evaluate(Dl,{},Ch)+90;Si=Wt(jc,wa,Zl,Wd,em,dp,Vl,ih,Fl,ry,gd),ny&&(fT=Wt(jc,wa,Zl,Wd,em,dp,ny,Zm,Fl,null,tm))}}if(Hd){const Vl=ll.layout.get("icon-rotate").evaluate(Dl,{},Ch),Fl=a.f$(Hd,Vl,iy,oh,md.iconScaleFactor),d0=ny?a.f$(ny,Vl,iy,oh,md.iconScaleFactor):void 0;Iv=Wt(jc,wa,Zl,Wd,em,dp,Hd,Zm,Vl,null,Cb);const nm=function(yd,ay,Ah,UF,E2,Yd,f0,Qx,Zu){const XP=yd.layers[0],To=XP.appearances;let Jm=ay.length;if(Ah&&(Jm=Math.max(Jm,Ah.length)),0===To.length)return Jm;const[C2,nA]=UF.get("icon-size-scale-range"),S2=a.b0(1,C2,nA);for(const jP of To)if(jP.hasLayoutProperty("icon-image")){const A2=we(yd,XP,jP,E2,Yd,f0,S2,Zu);A2&&(Jm=Math.max(Jm,a.g1(A2)))}return Jm}(sa,Fl,d0,ll.layout,Dl,Ch,sa.iconAtlasPositions,0,Pv);a7=4*nm;const YP=ll.layout.get("icon-size").evaluate(Dl,{},Ch,Pv),tA=md.compositeIconSizes?md.compositeIconSizes[0].evaluate(Dl,{},Ch,Pv):0,qP=md.compositeIconSizes?md.compositeIconSizes[1].evaluate(Dl,{},Ch,Pv):0,w2=a.g0(sa.layerIds[0],sa.iconSizeData,YP,Hd.imagePrimary.usvg?1:md.iconScaleFactor,tA,qP);sa.addSymbols(sa.icon,Fl,w2,fp,Dc,Dl,void 0,Gd,Zl,Sb.lineStartIndex,Sb.lineLength,-1,Pv,Ch,QS,l0,sa.symbolInstances.length,nm),eA=sa.icon.placedSymbolArray.length-1,d0&&(pp=4*nm,sa.addSymbols(sa.icon,d0,w2,fp,Dc,Dl,a.cL.vertical,Gd,Zl,Sb.lineStartIndex,Sb.lineLength,-1,Pv,Ch,QS,l0,sa.symbolInstances.length,nm),_2=sa.icon.placedSymbolArray.length-1)}for(const Vl in rh.horizontal){const Fl=Vl,d0=rh.horizontal[Fl];Zx||(ts=a.dc(d0.text),df?Wo=kt(d0):Zx=Wt(jc,wa,Zl,Wd,em,dp,d0,ih,ll.layout.get("text-rotate").evaluate(Dl,{},Ch),ry,gd));const nm=1===d0.positionedLines.length;if(v2+=dt(sa,Gd,Zl,d0,ty,ll,df,Dl,ry,Sb,rh.vertical?a.cL.horizontal:a.cL.horizontalOnly,nm?tt(rh.horizontal):[Fl],xi,eA,md,Pv,Ch,sa.symbolInstances.length,QS),nm)break}rh.vertical&&(Sh+=dt(sa,Gd,Zl,rh.vertical,ty,ll,df,Dl,ry,Sb,a.cL.vertical,["vertical"],xi,_2,md,Pv,Ch,sa.symbolInstances.length,QS));let oy=-1;const Jx=(Vl,Fl)=>Vl?Math.max(Vl,Fl):Fl;oy=Jx(Wo,oy),oy=Jx(Mv,oy),oy=Jx(o7,oy);const T2=oy>-1?1:0;sa.glyphOffsetArray.length>=65535&&a.w("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==Dl.sortKey&&sa.addToSortKeyRanges(sa.symbolInstances.length,Dl.sortKey),sa.symbolInstances.emplaceBack(Zl.x,Zl.y,wa.x,wa.y,wa.z,xi.right>=0?xi.right:-1,xi.center>=0?xi.center:-1,xi.left>=0?xi.left:-1,xi.vertical>=0?xi.vertical:-1,eA,_2,ts,void 0!==Zx?Zx:sa.collisionBoxArray.length,void 0!==Zx?Zx+1:sa.collisionBoxArray.length,void 0!==Si?Si:sa.collisionBoxArray.length,void 0!==Si?Si+1:sa.collisionBoxArray.length,void 0!==Iv?Iv:sa.collisionBoxArray.length,void 0!==Iv?Iv+1:sa.collisionBoxArray.length,fT||sa.collisionBoxArray.length,fT?fT+1:sa.collisionBoxArray.length,Wd,v2,Sh,a7,pp,T2,0,u0,Na,oy,0,oh?1:0,c0)}(ut,zs,pd,sl,je,gt,Ct,Rt,ut.layers[0],ut.collisionBoxArray,ke.index,ke.sourceLayerIndex,ut.index,kl,pi,Qt,0,al,uf,Ar,ke,Mt,fn,vn,On,ar,oi,ei,ha,wi,Li,ao)};if("line"===Qr)for(const sl of a.cZ(ke.geometry,0,0,a.a2,a.a2)){const zs=J(sl,Zs,Lc,je.vertical||Qa,gt,Ts,Ul,ut.overscaling,a.a2);for(const Df of zs)Qa&&qt(ut,Qa.text,Ht,Df)||ey(sl,Df,On)}else if("line-center"===Qr){for(const sl of ke.geometry)if(sl.length>1){const zs=te(sl,Lc,je.vertical||Qa,gt,Ts,Ul);zs&&ey(sl,zs,On)}}else if("Polygon"===ke.type)for(const sl of a.fZ(ke.geometry,0)){const zs=Le(sl,16);ey(sl[0],new H(zs.x,zs.y,0,0,void 0),On)}else if("LineString"===ke.type)for(const sl of ke.geometry)ey(sl,new H(sl[0].x,sl[0].y,0,0,void 0),On);else if("Point"===ke.type)for(const sl of ke.geometry)for(const zs of sl)ey([zs],new H(zs.x,zs.y,0,0,void 0),On)}function dt(ut,ke,je,gt,Rt,Ct,Mt,Ft,Dt,Qt,fn,vn,On,tr,ar,oi,ei,Ar,pi){const Qr=a.g2(je,gt,Dt,Ct,Mt,Ft,Rt,ut.allowVerticalPlacement,void 0,ar.textScaleFactor),wi=Ct.layout.get("text-size").evaluate(Ft,{},ei),Li=ar.compositeTextSizes?ar.compositeTextSizes[0].evaluate(Ft,{},ei):0,ao=ar.compositeTextSizes?ar.compositeTextSizes[1].evaluate(Ft,{},ei):0,Mo=a.g0(ut.layerIds[0],ut.textSizeData,wi,ar.textScaleFactor,Li,ao);ut.addSymbols(ut.text,Qr,Mo,Dt,Mt,Ft,fn,ke,je,Qt.lineStartIndex,Qt.lineLength,tr,oi,ei,pi,false,Ar,Qr.length);for(const fo of vn)On[fo]=ut.text.placedSymbolArray.length-1;return 4*Qr.length}function Oe(ut){for(const ke in ut)return ut[ke];return null}function Wt(ut,ke,je,gt,Rt,Ct,Mt,Ft,Dt,Qt,fn){let vn,On,tr,ar;if(vn=fn?fn.top:Mt.top,On=fn?fn.bottom:Mt.bottom,tr=fn?fn.left:Mt.left,ar=fn?fn.right:Mt.right,yt(Mt)&&Mt.collisionPadding){const oi=Mt.collisionPadding;tr-=oi[0],vn-=oi[1],ar+=oi[2],On+=oi[3]}if(Dt){const oi=new a.P(tr,vn),ei=new a.P(ar,vn),Ar=new a.P(tr,On),pi=new a.P(ar,On),Qr=a.au(Dt);let wi=new a.P(0,0);Qt&&(wi=new a.P(Qt[0],Qt[1])),oi._rotateAround(Qr,wi),ei._rotateAround(Qr,wi),Ar._rotateAround(Qr,wi),pi._rotateAround(Qr,wi),tr=Math.min(oi.x,ei.x,Ar.x,pi.x),ar=Math.max(oi.x,ei.x,Ar.x,pi.x),vn=Math.min(oi.y,ei.y,Ar.y,pi.y),On=Math.max(oi.y,ei.y,Ar.y,pi.y)}return ut.emplaceBack(ke.x,ke.y,ke.z,je.x,je.y,tr,vn,ar,On,Ft,gt,Rt,Ct),ut.length-1}function kt(ut){yt(ut)&&ut.collisionPadding&&(ut.top-=ut.collisionPadding[1],ut.bottom+=ut.collisionPadding[3]);const ke=ut.bottom-ut.top;return ke>0?Math.max(10,ke):null}function qt(ut,ke,je,gt){const Rt=ut.compareText;if(ke in Rt){const Ct=Rt[ke];for(let Mt=Ct.length-1;Mt>=0;Mt--)if(gt.dist(Ct[Mt])=ke.maxzoom||"none"===ke.visibility)}parse(ke,je,gt,Rt,Ct,Mt){this._parseAfterHD(ke,je,gt,Rt,Ct,Mt)}_parseAfterHD(ke,je,gt,Rt,Ct,Mt){let Ft;if(this.status="parsing",this.data=ke,this.renderSourceType===a.bR.HdRoadCoverage){const ei=ke.layers[a.bU];Ft=ei&&d?d(ei):[]}this.collisionBoxArray=new a.bt;const Dt=new a.g5(Object.keys(ke.layers).sort()),Qt=new a.fz(this.tileID,this.promoteId);Qt.bucketLayerIDs=[];const fn={},vn=new a.g6(256,256),On={featureIndex:Qt,iconDependencies:new Map,patternDependencies:new Map,glyphDependencies:{},lineAtlas:vn,availableImages:gt,brightness:this.brightness,scaleFactor:this.scaleFactor,showElevationIdDebug:this.showElevationIdDebug,elevationFeatures:void 0,elevationParams:this.elevation,crossSourceElevationEnabled:this.crossSourceElevationEnabled,terrainEnabled:this.terrainEnabled,activeFloors:void 0};this.indoor&&h&&(On.activeFloors=h(ke,this.indoor,Ct,this.canonical));const tr=[],ar=je.familiesBySource[this.source];if(this.renderSourceType===a.bR.HdRoadElevation){const ei=l&&l(ke,this.canonical)||[],Ar=new sn({});return this.status="done",void Mt(null,{buckets:[],containsHdExt:false,containsStandardExt:false,featureIndex:Qt,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Ar.image,lineAtlas:vn,imageAtlas:null,brightness:this.brightness,parsedElevationFeatures:ei})}if(this.deferRoadStructure=false,this.renderSourceType!==a.bR.HdRoadCoverage&&null!=this.frcCoverage&&!this.frcCoverage.resolved&&null===this.frcCoverage.frcMask){for(const ei in ar)if(a.g7&&a.g7(this.frcCoverage.sourceLayers,this.source,ei)){this.deferRoadStructure=true;break}}for(const ei in ar){const Ar=ke.layers[ei];if(!Ar)continue;let pi=false,Qr=false,wi=false,Li=false;for(const ea of ar[ei])"symbol"===ea[0].type?pi=true:"fill-extrusion"===ea[0].type?Qr=true:wi=true,ea[0].is3D()&&"model"!==ea[0].type&&(Li=true);if(this.extraShadowCaster&&!Li)continue;if(this.renderSourceType===a.bR.Symbol&&!pi)continue;if(this.renderSourceType===a.bR.FillExtrusion&&!Qr)continue;if((this.renderSourceType===a.bR.Other||this.renderSourceType===a.bR.HdRoadCoverage)&&!wi)continue;const ao=null!=this.frcCoverage&&!!a.g7&&a.g7(this.frcCoverage.sourceLayers,this.source,ei);if(this.deferRoadStructure&&ao)continue;1===Ar.version&&a.w(`Vector tile source "${this.source}" layer "${ei}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const Mo=Dt.encode(ei),fo=[],fs=this.localizableLayerIds&&this.localizableLayerIds.has(ei);let Ga=false;for(let ea=0,ha=0;eaa.m(Ts.id,Ts.scope)));const aa=()=>{At(ea,this.zoom,On.brightness,gt,this.worldview,On.activeFloors);const Ts=fn[ha.id]=ha.createBucket({index:bo,layers:ea,zoom:this.zoom,lut:this.lut,canonical:this.canonical,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Mo,sourceLayerName:ei,sourceID:this.source,projection:this.projection.spec,tessellationStep:this.tessellationStep,styleDefinedModelURLs:Rt,worldview:this.worldview,localizable:fs,availableImages:gt,maxUniformBufferBindings:this.maxUniformBufferBindings,maxUniformBlockSizeDwords:this.maxUniformBlockSizeDwords});P&&P(Ts,this.frcCoverage?this.frcCoverage.sourceLayers:null),Ts.populate(fo,On,this.tileID.canonical,this.tileTransform)};ha.mayUse("HD")||ha.mayUse("Standard")?tr.push(ha.prepare().then(()=>aa())):aa()}}const oi=()=>{vn.trim();const ei=!(!On.elevationFeatures||!On.elevationFeatures.some(ea=>ea.heightRange.min<0));let Ar,pi,Qr,wi,Li,ao,Mo;const fo={type:"maybePrepare",renderSourceType:this.renderSourceType,zoom:this.zoom},fs=()=>{if(Ar)return this.status="done",Mt(Ar);if(this.extraShadowCaster){this.status="done";const ea=Object.values(fn).filter(bo=>!bo.isEmpty()),ha=On.elevationFeatures;Mt(null,{buckets:ea,containsHdExt:Jt(ea),containsStandardExt:Sn(ea),featureIndex:Qt,collisionBoxArray:null,hasTunnelGeometry:ei,glyphAtlasImage:null,lineAtlas:null,imageAtlas:null,brightness:On.brightness,hasDeferredElevationFeatures:!!L&&L(fn),parsedElevationFeatures:ha,glyphMap:null,iconMap:null,glyphPositions:null})}else if(pi&&Qr&&wi&&Mo){const ea=void 0,ha=new sn(pi),bo=new Map;for(const[Ts,Xo]of Qr.entries()){const{imagePosition:Qa}=a.fV(Ts,Xo,a.fW);bo.set(Ts,Qa)}const aa={};for(const Ts in fn){const Xo=fn[Ts];if(Xo instanceof a.bu){At(Xo.layers,this.zoom,On.brightness,gt,this.worldview,On.activeFloors);const Qa=Kt(this.frcCoverage,this.source,Xo.layers[0].sourceLayer);aa[Ts]=He(Xo,pi,ha.positions,Qr,bo,this.tileID.canonical,this.tileZoom,this.scaleFactor,this.pixelRatio,Li,this.worldview,gt,Qa.frcMask,Qa.polygons,Qa.tileZoom,a.g8||null,f||null)}}Li.size||ao.size?this.rasterizeTask=Ct.sendCancelable("rasterizeImages",{scope:this.scope,iconTasks:Li,patternTasks:ao},{},(Ts,Xo)=>{if(!Ts)for(const[Qa,xu]of Xo.entries())Qr.has(Qa)&&Qr.set(Qa,Object.assign(Qr.get(Qa),{data:xu})),wi.has(Qa)&&wi.set(Qa,Object.assign(wi.get(Qa),{data:xu}));Ga(aa,ha,ea,Mo)}):Ga(aa,ha,ea,Mo)}},Ga=(ea,ha,bo,aa)=>{const Ts=Qr.size>0||wi.size>0,Xo=Object.keys(ea).length>0,Qa=On.elevationFeatures;if(!Ts&&!Xo){this.status="done";const es=Object.values(fn).filter(sc=>!sc.isEmpty());return void Mt(null,{buckets:es,containsHdExt:Jt(es),containsStandardExt:Sn(es),featureIndex:Qt,collisionBoxArray:this.collisionBoxArray,hasTunnelGeometry:ei,glyphAtlasImage:ha.image,lineAtlas:vn,imageAtlas:null,brightness:On.brightness,hasDeferredRoadStructure:this.deferRoadStructure,frcCoveragePolygons:Ft,hasDeferredElevationFeatures:!!L&&L(fn),parsedElevationFeatures:Qa})}const xu=(es,sc)=>{for(const Zs in fn){const kl=fn[Zs];if(Zs in ea)Qe(kl,ea[Zs],this.showCollisionBoxes,gt,this.tileID.canonical,this.tileZoom,this.projection,this.brightness,Qr,sc);else if(kl.hasPattern&&(kl instanceof a.bz||kl instanceof a.bA||kl instanceof a.aC)){At(kl.layers,this.zoom,On.brightness,gt,this.worldview,On.activeFloors);const al=Object.fromEntries(sc.patternPositions);kl.addFeatures(On,this.tileID.canonical,al,gt,this.tileTransform,this.brightness)}}this.status="done";const Ul=Object.values(fn).filter(Zs=>!Zs.isEmpty());Mt(null,{buckets:Ul,containsHdExt:Jt(Ul),containsStandardExt:Sn(Ul),featureIndex:Qt,collisionBoxArray:this.collisionBoxArray,hasTunnelGeometry:ei,glyphAtlasImage:ha.image,lineAtlas:vn,imageAtlas:es,brightness:On.brightness,hasDeferredRoadStructure:this.deferRoadStructure,frcCoveragePolygons:Ft,hasDeferredElevationFeatures:!!L&&L(fn),parsedElevationFeatures:Qa})};if(Ts){const es=new Map,sc=a.ga(Qr,es),Ul=a.ga(wi,es),Zs=new a.gb(sc,Ul,aa,this.lut,this.scope,es);Ct.send("checkAtlasCache",{descriptor:Zs,scope:this.scope}).then(kl=>{let al,Lc;if(kl)al=new a.gc(kl.sourceHash),Lc=kl;else{const uf=new a.gd(Qr,wi,this.lut,aa,this.scope);al=uf,Lc=uf}xu(al,Lc)}).catch(kl=>{"AbortError"!==kl.name&&a.w(`[Worker] Error checking atlas cache: ${kl.message}`);const al=new a.gd(Qr,wi,this.lut,aa,this.scope);xu(al,al)})}else xu(null,{iconPositions:new Map,patternPositions:new Map})};if(!this.extraShadowCaster){const ea=a.g9(On.glyphDependencies,aa=>Object.keys(aa).map(Number));Object.keys(ea).length?Ct.send("getGlyphs",{uid:this.uid,stacks:ea},{metadata:fo}).then(aa=>{Ar||(pi=aa,fs())}).catch(aa=>{Ar||(Ar=aa,fs())}):pi={},Mo=new Map;const ha=Array.from(On.iconDependencies.keys()).map(aa=>a.I.parse(aa)),bo=Array.from(On.patternDependencies.keys()).map(aa=>a.I.parse(aa));ha.length||bo.length?Ct.send("getImages",{icons:ha,patterns:bo,source:this.source,scope:this.scope,tileID:this.tileID},{metadata:fo}).then(aa=>{if(!Ar){Qr=new Map,wi=new Map,Li=this.updateImageMapAndGetImageTaskQueue(Qr,aa.images,On.iconDependencies),ao=this.updateImageMapAndGetImageTaskQueue(wi,aa.images,On.patternDependencies);for(const[Ts,Xo]of aa.versions.entries())Mo.set(Ts,Xo);fs()}}).catch(aa=>{Ar||(Ar=aa,fs())}):(Qr=new Map,wi=new Map,Li=new Map,ao=new Map)}u&&u({buckets:fn,data:ke,sourceLayerCoder:Dt,canonical:this.tileID.canonical,options:On}),fs()};tr.length>0?Promise.allSettled(tr).then(oi).catch(Mt):oi()}updateParameters(ke){this.scaleFactor=ke.scaleFactor,this.showCollisionBoxes=ke.showCollisionBoxes,this.showElevationIdDebug=ke.showElevationIdDebug,this.projection=ke.projection,this.brightness=ke.brightness,this.tileTransform=a.bp(ke.tileID.canonical,ke.projection),this.extraShadowCaster=ke.extraShadowCaster,this.lut=ke.lut,this.worldview=ke.worldview,this.indoor=ke.indoor,this.frcCoverage=ke.frcCoverage||null,this.elevation=ke.elevation||null,this.terrainEnabled=!!ke.terrainEnabled}updateImageMapAndGetImageTaskQueue(ke,je,gt){const Rt=new Map;for(const Ct of je.keys()){const Mt=gt.get(Ct)||[];for(const Ft of Mt){const Dt=Ft.toString(),Qt=je.get(Ft.id.toString());Qt.usvg?Rt.has(Dt)||(Rt.set(Dt,Ft),ke.set(Dt,{...Qt})):ke.set(Dt,Qt)}}return Rt}cancelRasterize(){this.rasterizeTask&&this.rasterizeTask.abort()}}function At(ut,ke,je,gt,Rt,Ct){const Mt=new a.ai(ke,{brightness:je,worldview:Rt,activeFloors:Ct});for(const Ft of ut)Ft.recalculate(Mt,gt)}class lr extends a.E{constructor({actor:ke,layerIndex:je,availableImages:gt,availableModels:Rt,isSpriteLoaded:Ct,tileProvider:Mt,brightness:Ft,maxUniformBufferBindings:Dt,maxUniformBlockSizeDwords:Qt}){super(),this.actor=ke,this.layerIndex=je,this.availableImages=gt,this.availableModels=Rt,this.loadVectorData=a.ch,this.tileProvider=Mt,this.loading={},this.loaded={},this.deduped=new a.cc(ke.scheduler),this.isSpriteLoaded=Ct,this.scheduler=ke.scheduler,this.brightness=Ft,this.maxUniformBufferBindings=Dt,this.maxUniformBlockSizeDwords=Qt}loadTileData(ke,je){if(!this.tileProvider)return this.loadVectorData(ke,je);const gt=new AbortController;return this.loadTileWithProvider(this.tileProvider,ke,gt,je),()=>gt.abort()}async loadTileWithProvider(ke,je,gt,Rt){const{z:Ct,x:Mt,y:Ft}=je.tileID.canonical;try{const Dt=await ke.loadTile({z:Ct,x:Mt,y:Ft},{request:je.request,signal:gt.signal});if(gt.signal.aborted)return;if(null==Dt){const fn=new Error("Tile not found");return fn.status=404,Rt(fn)}if(null==Dt.data)return Rt(null,null);if(Dt.data instanceof ImageBitmap)return Rt(new Error("Vector tiles require ArrayBuffer data"));const Qt=new Headers;Dt.expires&&Qt.set("expires",Dt.expires),Dt.cacheControl&&Qt.set("cache-control",Dt.cacheControl),Rt(null,{rawData:Dt.data,headers:Qt})}catch(Dt){if(gt.signal.aborted)return;Rt(Dt instanceof Error?Dt:new Error(String(Dt)))}}_fetchTileData(ke,je){return new Promise((gt,Rt)=>{ke.abort=this.loadTileData(je,(Ct,Mt)=>{Ct?Rt(Ct):gt(Mt)})})}async _parse(ke,je){const gt=!this.isSpriteLoaded;return gt&&await this.once("isSpriteLoaded"),new Promise((Rt,Ct)=>{const Mt=()=>ke.parse(ke.vectorTile,this.layerIndex,this.availableImages,this.availableModels,this.actor,(Ft,Dt)=>{Ft?Ct(Ft):Rt(Dt)});gt&&this.scheduler?this.scheduler.add(Mt,{type:"parseTile",renderSourceType:je.renderSourceType,zoom:je.tileZoom}):Mt()})}async loadTile(ke){const je=ke.uid,gt=ke&&ke.request,Rt=gt&>.collectResourceTiming,Ct=this.loading[je]=new mn(ke);Ct.maxUniformBufferBindings=this.maxUniformBufferBindings,Ct.maxUniformBlockSizeDwords=this.maxUniformBlockSizeDwords;const Mt=(ar,oi)=>{const ei=Ct.reloadCallback;ei&&(delete Ct.reloadCallback,ar||!oi?ei(ar,null):Ct.parse(Ct.vectorTile,this.layerIndex,this.availableImages,this.availableModels,this.actor,ei))};let Ft,Dt;try{Ft=await this._fetchTileData(Ct,ke)}catch(ar){Dt=ar}const Qt=!this.loading[je];if(delete this.loading[je],Ct.cancelRasterize(),Dt||Qt||!Ft){if(Ct.status="done",Qt||(this.loaded[je]=Ct),Dt)throw Dt;return null}const fn=Ft.rawData;let vn;Ct.vectorTile=Ft.vectorTile||new a.ge(new a.cB(fn)),this.loaded=this.loaded||{},this.loaded[je]=Ct;try{vn=await this._parse(Ct,ke)}catch(ar){throw Mt(ar),ar}if(!vn)return Mt(null,null),null;const On={};if(Rt){const ar=s(gt);ar.length>0&&(On.resourceTiming=JSON.parse(JSON.stringify(ar)))}const tr={rawTileData:fn.slice(0),headers:Ft.headers,...vn,...On};return Mt(null,vn),tr}async reloadTile(ke){const je=this.loaded,gt=ke.uid;if(je&&je[gt])return new Promise((Rt,Ct)=>{const Mt=je[gt];Mt.updateParameters(ke);const Ft=(Dt,Qt)=>{const fn=Mt.reloadCallback;fn&&(delete Mt.reloadCallback,Mt.parse(Mt.vectorTile,this.layerIndex,this.availableImages,this.availableModels,this.actor,fn)),Dt?Ct(Dt):Rt(Qt)};"parsing"===Mt.status?Mt.reloadCallback=Ft:"done"===Mt.status?Mt.vectorTile?Mt.parse(Mt.vectorTile,this.layerIndex,this.availableImages,this.availableModels,this.actor,Ft):Ft():Rt(void 0)})}abortTile(ke){const je=ke.uid,gt=this.loading[je];gt&&(gt.abort&>.abort(),delete this.loading[je])}removeTile(ke){const je=this.loaded,gt=ke.uid;je&&je[gt]&&delete je[gt]}}class on{constructor(ke){this.tileProvider=ke.tileProvider,this.loading={}}async loadTile(ke){const je=ke.uid,gt=new AbortController;if(this.loading[je]={cancel:()=>gt.abort()},this.tileProvider)return this.loadTileWithProvider(this.tileProvider,je,ke,gt);try{const{data:Rt,headers:Ct}=await a.cC(ke.request,gt.signal);if(!Rt)return null;const Mt=await this.decodeTile(je,Rt,ke.encoding);return Mt.headers=Ct,Mt}catch(Rt){if(gt.signal.aborted)return null;throw Rt}finally{delete this.loading[je]}}async decodeTile(ke,je,gt){const Rt=je instanceof ImageBitmap?je:await createImageBitmap(new Blob([new Uint8Array(je)],{type:"image/png"})),Ct=1-(Rt.width-a.gf(Rt.width))/2,Mt=Ct<1,Ft=this.getImageData(Rt,Ct);return Rt.close(),{dem:new a.gg(ke,Ft,gt,Mt),borderReady:Mt}}async loadTileWithProvider(ke,je,gt,Rt){const{z:Ct,x:Mt,y:Ft}=gt.tileID.canonical;try{const Dt=await ke.loadTile({z:Ct,x:Mt,y:Ft},{request:gt.request,signal:Rt.signal});if(Rt.signal.aborted)return null;if(null==Dt){const vn=new Error("Tile not found");throw vn.status=404,vn}if(null==Dt.data)return null;const Qt=await this.decodeTile(je,Dt.data,gt.encoding);if(Rt.signal.aborted)return null;const fn=new Headers;return Dt.expires&&fn.set("expires",Dt.expires),Dt.cacheControl&&fn.set("cache-control",Dt.cacheControl),Qt.headers=fn,Qt}catch(Dt){if(Rt.signal.aborted)return null;throw Dt}finally{delete this.loading[je]}}async reloadTile(ke){}abortTile(ke){const je=ke.uid,gt=this.loading[je];gt&&(gt.cancel(),delete this.loading[je])}removeTile(ke){}getImageData(ke,je){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(ke.width,ke.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:true})),this.offscreenCanvas.width=ke.width,this.offscreenCanvas.height=ke.height,this.offscreenCanvasContext.drawImage(ke,0,0,ke.width,ke.height);const gt=this.offscreenCanvasContext.getImageData(-je,-je,ke.width+2*je,ke.height+2*je);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),gt}}const cr=a.gh.prototype.toGeoJSON;class Hr{constructor(ke){this._feature=ke,this.extent=a.a2,this.type=ke.type,this.properties=ke.tags,"id"in ke&&!isNaN(ke.id)&&(this.id=parseInt(ke.id,10))}loadGeometry(){if(1===this._feature.type){const ke=[];for(const je of this._feature.geometry)ke.push([new a.P(je[0],je[1])]);return ke}{const ke=[];for(const je of this._feature.geometry){const gt=[];for(const Rt of je)gt.push(new a.P(Rt[0],Rt[1]));ke.push(gt)}return ke}}toGeoJSON(ke,je,gt){return cr.call(this,ke,je,gt)}}class Mr{constructor(ke,je){this.name=ke,this.extent=a.a2,this.length=je.length,this._jsonFeatures=je}feature(ke){return new Hr(this._jsonFeatures[ke])}}class Er{constructor(ke){this.layers={},this.extent=a.a2;for(const je of Object.keys(ke))this.layers[je]=new Mr(je,ke[je])}}const vr=64/4096;class Yr{constructor(){this.features=new Map}clear(){this.features.clear()}load(ke=[],je){for(const gt of ke){const Rt=gt.id;if(null==Rt)continue;let Ct=this.features.get(Rt);Ct&&this.updateCache(Ct,je),gt.geometry?(Ct=Rr(gt),this.updateCache(Ct,je),this.features.set(Rt,Ct)):this.features.delete(Rt),this.updateCache(Ct,je)}}updateCache(ke,je){for(const{canonical:gt,uid:Rt}of Object.values(je)){const{z:Ct,x:Mt,y:Ft}=gt;nt(ke,Math.pow(2,Ct),Mt,Ft)&&delete je[Rt]}}getTile(ke,je,gt){const Rt=Math.pow(2,ke),Ct=[];for(const Mt of this.features.values())nt(Mt,Rt,je,gt)&&Ct.push(St(Mt,Rt,je,gt));return{features:Ct}}getFeatures(){return[...this.features.values()]}}function nt({minX:ut,minY:ke,maxX:je,maxY:gt},Rt,Ct,Mt){return ut<(Ct+1+vr)/Rt&&ke<(Mt+1+vr)/Rt&&je>(Ct-vr)/Rt&>>(Mt-vr)/Rt}function Rr(ut){const{id:ke,geometry:je,properties:gt}=ut;if(!je)return;if("GeometryCollection"===je.type)throw new Error("GeometryCollection not supported in dynamic mode.");const{type:Rt,coordinates:Ct}=je,Mt={id:ke,type:1,geometry:[],tags:gt,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0},Ft=Mt.geometry;if("Point"===Rt)Xr(Ct,Ft,Mt);else if("MultiPoint"===Rt)for(const Dt of Ct)Xr(Dt,Ft,Mt);else if("LineString"===Rt)Mt.type=2,dr(Ct,Ft,Mt);else if("MultiLineString"===Rt)Mt.type=2,rn(Ct,Ft,Mt);else if("Polygon"===Rt)Mt.type=3,rn(Ct,Ft,Mt,true);else{if("MultiPolygon"!==Rt)throw new Error("Input data is not a valid GeoJSON object.");Mt.type=3;for(const Dt of Ct)rn(Dt,Ft,Mt,true)}return Mt}function Xr([ut,ke],je,gt){const Rt=a.a7(ut);let Ct=a.a8(ke);Ct=Ct<0?0:Ct>1?1:Ct,je.push(Rt,Ct),gt.minX=Math.min(gt.minX,Rt),gt.minY=Math.min(gt.minY,Ct),gt.maxX=Math.max(gt.maxX,Rt),gt.maxY=Math.max(gt.maxY,Ct)}function dr(ut,ke,je,gt=false,Rt=false){const Ct=[];for(const Mt of ut)Xr(Mt,Ct,je);ke.push(Ct),gt&&function(Mt,Ft){let Dt=0;for(let Qt=0,fn=Mt.length,vn=fn-2;Qt0===Ft)for(let Qt=0,fn=Mt.length;Qt=Mt&&vn>=Mt||(Qt>=Mt?(fn+=Math.round(ar*((Mt-Qt)/tr)),Qt=Mt):vn>=Mt&&(On=fn+Math.round(ar*((Mt-Qt)/tr)),vn=Mt),fn>=Mt&&On>=Mt||(fn>=Mt?(Qt+=Math.round(tr*((Mt-fn)/ar)),fn=Mt):On>=Mt&&(vn=Qt+Math.round(tr*((Mt-fn)/ar)),On=Mt),Ft&&Qt===Ft.at(-1)[0]&&fn===Ft.at(-1)[1]||(Ft=[[Qt,fn]],Rt.push(Ft)),Ft.push([vn,On])))))}}function Pt(ut,ke,je,gt,Rt){const Ct=(je-vr)/ke,Mt=(gt-vr)/ke,Ft=(je+1+vr)/ke,Dt=(gt+1+vr)/ke;function Qt(On,tr){let ar=0;return OnFt&&(ar|=2),trDt&&(ar|=8),ar}let fn=[];for(let On=1;On<=8;On*=2){let tr=ut[ut.length-2],ar=ut.at(-1),oi=!(Qt(tr,ar)&On);for(let ei=0;ei>31}function Et(ut,ke){const{geometry:je,type:gt}=ut;let Rt=0,Ct=0;if(1===gt){ke.writeVarint(rr(1,je.length));for(const Mt of je){const Ft=Mt[0]-Rt,Dt=Mt[1]-Ct;ke.writeVarint(hr(Ft)),ke.writeVarint(hr(Dt)),Rt+=Ft,Ct+=Dt}}else for(const Mt of je){if(0===Mt.length)continue;ke.writeVarint(rr(1,1));const Ft=Mt.length-(3===gt?1:0);for(let Dt=0;Dtut},zt=Math.fround||(Gt=new Float32Array(1),ut=>(Gt[0]=+ut,Gt[0]));var Gt;class gn{constructor(ke){this.options=Object.assign(Object.create(ft),ke),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(ke){const{log:je,minZoom:gt,maxZoom:Rt}=this.options;je&&console.time("total time");const Ct=`prepare ${ke.length} points`;je&&console.time(Ct),this.points=ke;const Mt=[];for(let Dt=0;Dt=gt;Dt--){const Qt=+Date.now();Ft=this.trees[Dt]=this._createTree(this._cluster(Ft,Dt)),je&&console.log("z%d: %d clusters in %dms",Dt,Ft.numItems,+Date.now()-Qt)}return je&&console.timeEnd("total time"),this}getClusters(ke,je){let gt=((ke[0]+180)%360+360)%360-180;const Rt=Math.max(-90,Math.min(90,ke[1]));let Ct=180===ke[2]?180:((ke[2]+180)%360+360)%360-180;const Mt=Math.max(-90,Math.min(90,ke[3]));if(ke[2]-ke[0]>=360)gt=-180,Ct=180;else if(gt>Ct){const vn=this.getClusters([gt,Rt,180,Mt],je),On=this.getClusters([-180,Rt,Ct,Mt],je);return vn.concat(On)}const Ft=this.trees[this._limitZoom(je)],Dt=Ft.range(Jr(gt),jr(Mt),Jr(Ct),jr(Rt)),Qt=Ft.data,fn=[];for(const vn of Dt){const On=this.stride*vn;fn.push(Qt[On+5]>1?Fn(Qt,On,this.clusterProps):this.points[Qt[On+3]])}return fn}getChildren(ke){const je=this._getOriginId(ke),gt=this._getOriginZoom(ke),Rt="No cluster with the specified id.",Ct=this.trees[gt];if(!Ct)throw new Error(Rt);const Mt=Ct.data;if(je*this.stride>=Mt.length)throw new Error(Rt);const Ft=this.options.radius/(this.options.extent*Math.pow(2,gt-1)),Dt=Ct.within(Mt[je*this.stride],Mt[je*this.stride+1],Ft),Qt=[];for(const fn of Dt){const vn=fn*this.stride;Mt[vn+4]===ke&&Qt.push(Mt[vn+5]>1?Fn(Mt,vn,this.clusterProps):this.points[Mt[vn+3]])}if(0===Qt.length)throw new Error(Rt);return Qt}getLeaves(ke,je,gt){const Rt=[];return this._appendLeaves(Rt,ke,je=je||10,gt=gt||0,0),Rt}getTile(ke,je,gt){const Rt=this.trees[this._limitZoom(ke)],Ct=Math.pow(2,ke),{extent:Mt,radius:Ft}=this.options,Dt=Ft/Mt,Qt=(gt-Dt)/Ct,fn=(gt+1+Dt)/Ct,vn={features:[]};return this._addTileFeatures(Rt.range((je-Dt)/Ct,Qt,(je+1+Dt)/Ct,fn),Rt.data,je,gt,Ct,vn),0===je&&this._addTileFeatures(Rt.range(1-Dt/Ct,Qt,1,fn),Rt.data,Ct,gt,Ct,vn),je===Ct-1&&this._addTileFeatures(Rt.range(0,Qt,Dt/Ct,fn),Rt.data,-1,gt,Ct,vn),vn.features.length?vn:null}getClusterExpansionZoom(ke){let je=this._getOriginZoom(ke)-1;for(;je<=this.options.maxZoom;){const gt=this.getChildren(ke);if(je++,1!==gt.length)break;ke=gt[0].properties.cluster_id}return je}_appendLeaves(ke,je,gt,Rt,Ct){const Mt=this.getChildren(je);for(const Ft of Mt){const Dt=Ft.properties;if(Dt&&Dt.cluster?Ct+Dt.point_count<=Rt?Ct+=Dt.point_count:Ct=this._appendLeaves(ke,Dt.cluster_id,gt,Rt,Ct):Ct1;let fn,vn,On;if(Qt)fn=Tr(je,Dt,this.clusterProps),vn=je[Dt],On=je[Dt+1];else{const oi=this.points[je[Dt+3]];fn=oi.properties;const[ei,Ar]=oi.geometry.coordinates;vn=Jr(ei),On=jr(Ar)}const tr={type:1,geometry:[[Math.round(this.options.extent*(vn*Ct-gt)),Math.round(this.options.extent*(On*Ct-Rt))]],tags:fn};let ar;ar=Qt||this.options.generateId?je[Dt+3]:this.points[je[Dt+3]].id,void 0!==ar&&(tr.id=ar),Mt.features.push(tr)}}_limitZoom(ke){return Math.max(this.options.minZoom,Math.min(Math.floor(+ke),this.options.maxZoom+1))}_cluster(ke,je){const{radius:gt,extent:Rt,reduce:Ct,minPoints:Mt}=this.options,Ft=gt/(Rt*Math.pow(2,je)),Dt=ke.data,Qt=[],fn=this.stride;for(let vn=0;vnje&&(ei+=Dt[pi+5])}if(ei>oi&&ei>=Mt){let Ar,pi=On*oi,Qr=tr*oi,wi=-1;const Li=(vn/fn<<5)+(je+1)+this.points.length;for(const ao of ar){const Mo=ao*fn;if(Dt[Mo+2]<=je)continue;Dt[Mo+2]=je;const fo=Dt[Mo+5];pi+=Dt[Mo]*fo,Qr+=Dt[Mo+1]*fo,Dt[Mo+4]=Li,Ct&&(Ar||(Ar=this._map(Dt,vn,true),wi=this.clusterProps.length,this.clusterProps.push(Ar)),Ct(Ar,this._map(Dt,Mo)))}Dt[vn+4]=Li,Qt.push(pi/ei,Qr/ei,1/0,Li,-1,ei),Ct&&Qt.push(wi)}else{for(let Ar=0;Ar1)for(const Ar of ar){const pi=Ar*fn;if(!(Dt[pi+2]<=je)){Dt[pi+2]=je;for(let Qr=0;Qr>5}_getOriginZoom(ke){return(ke-this.points.length)%32}_map(ke,je,gt){if(ke[je+5]>1){const Mt=this.clusterProps[ke[je+6]];return gt?Object.assign({},Mt):Mt}const Rt=this.points[ke[je+3]].properties,Ct=this.options.map(Rt);return gt&&Ct===Rt?Object.assign({},Ct):Ct}}function Fn(ut,ke,je){return{type:"Feature",id:ut[ke+3],properties:Tr(ut,ke,je),geometry:{type:"Point",coordinates:[(gt=ut[ke],360*(gt-.5)),sr(ut[ke+1])]}};var gt}function Tr(ut,ke,je){const gt=ut[ke+5],Rt=gt>=1e4?`${Math.round(gt/1e3)}k`:gt>=1e3?Math.round(gt/100)/10+"k":gt,Ct=ut[ke+6],Mt=-1===Ct?{}:Object.assign({},je[Ct]);return Object.assign(Mt,{cluster:true,cluster_id:ut[ke+3],point_count:gt,point_count_abbreviated:Rt})}function Jr(ut){return ut/360+.5}function jr(ut){const ke=Math.sin(ut*Math.PI/180),je=.5-.25*Math.log((1+ke)/(1-ke))/Math.PI;return je<0?0:je>1?1:je}function sr(ut){const ke=(180-360*ut)*Math.PI/180;return 360*Math.atan(Math.exp(ke))/Math.PI-90}function bn(ut,ke,je,gt){let Rt=gt;const Ct=ke+(je-ke>>1);let Mt,Ft=je-ke;const Dt=ut[ke],Qt=ut[ke+1],fn=ut[je],vn=ut[je+1];for(let On=ke+3;OnRt)Mt=On,Rt=tr;else if(tr===Rt){const ar=Math.abs(On-Ct);argt&&(Mt-ke>3&&bn(ut,ke,Mt,gt),ut[Mt+2]=Rt,je-Mt>3&&bn(ut,Mt,je,gt))}function ir(ut,ke,je,gt,Rt,Ct){let Mt=Rt-je,Ft=Ct-gt;if(0!==Mt||0!==Ft){const Dt=((ut-je)*Mt+(ke-gt)*Ft)/(Mt*Mt+Ft*Ft);Dt>1?(je=Rt,gt=Ct):Dt>0&&(je+=Mt*Dt,gt+=Ft*Dt)}return Mt=ut-je,Ft=ke-gt,Mt*Mt+Ft*Ft}function Jn(ut,ke,je,gt){const Rt={id:ut??null,type:ke,geometry:je,tags:gt,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if("Point"===ke||"MultiPoint"===ke||"LineString"===ke)er(Rt,je);else if("Polygon"===ke)er(Rt,je[0]);else if("MultiLineString"===ke)for(const Ct of je)er(Rt,Ct);else if("MultiPolygon"===ke)for(const Ct of je)er(Rt,Ct[0]);return Rt}function er(ut,ke){for(let je=0;je0&&(Mt+=gt?(Rt*fn-Qt*Ct)/2:Math.sqrt(Math.pow(Qt-Rt,2)+Math.pow(fn-Ct,2))),Rt=Qt,Ct=fn}const Ft=ke.length-3;ke[2]=1,bn(ke,0,Ft,je),ke[Ft+2]=1,ke.size=Math.abs(Mt),ke.start=0,ke.end=ke.size}function ln(ut,ke,je,gt){for(let Rt=0;Rt1?1:je}function Pa(ut,ke,je,gt,Rt,Ct,Mt,Ft){if(gt/=ke,Ct>=(je/=ke)&&Mt=gt)return null;const Dt=[];for(const Qt of ut){const fn=Qt.geometry;let vn=Qt.type;const On=0===Rt?Qt.minX:Qt.minY,tr=0===Rt?Qt.maxX:Qt.maxY;if(On>=je&&tr=gt)continue;let ar=[];if("Point"===vn||"MultiPoint"===vn)Ms(fn,ar,je,gt,Rt);else if("LineString"===vn)ds(fn,ar,je,gt,Rt,false,Ft.lineMetrics);else if("MultiLineString"===vn)en(fn,ar,je,gt,Rt,false);else if("Polygon"===vn)en(fn,ar,je,gt,Rt,true);else if("MultiPolygon"===vn)for(const oi of fn){const ei=[];en(oi,ei,je,gt,Rt,true),ei.length&&ar.push(ei)}if(ar.length){if(Ft.lineMetrics&&"LineString"===vn){for(const oi of ar)Dt.push(Jn(Qt.id,vn,oi,Qt.tags));continue}"LineString"!==vn&&"MultiLineString"!==vn||(1===ar.length?(vn="LineString",ar=ar[0]):vn="MultiLineString"),"Point"!==vn&&"MultiPoint"!==vn||(vn=3===ar.length?"Point":"MultiPoint"),Dt.push(Jn(Qt.id,vn,ar,Qt.tags))}}return Dt.length?Dt:null}function Ms(ut,ke,je,gt,Rt){for(let Ct=0;Ct=je&&Mt<=gt&&yn(ke,ut[Ct],ut[Ct+1],ut[Ct+2])}}function ds(ut,ke,je,gt,Rt,Ct,Mt){let Ft=st(ut);const Dt=0===Rt?jn:xr;let Qt,fn,vn=ut.start;for(let ei=0;ei=je&&(fn=Dt(Ft,Ar,pi,wi,Li,je),Mt&&(Ft.start=vn+Qt*fn)):ao>gt?Mo<=gt&&(fn=Dt(Ft,Ar,pi,wi,Li,gt),Mt&&(Ft.start=vn+Qt*fn)):yn(Ft,Ar,pi,Qr),Mo=je&&(fn=Dt(Ft,Ar,pi,wi,Li,je),fo=true),Mo>gt&&ao<=gt&&(fn=Dt(Ft,Ar,pi,wi,Li,gt),fo=true),!Ct&&fo&&(Mt&&(Ft.end=vn+Qt*fn),ke.push(Ft),Ft=st(ut)),Mt&&(vn+=Qt)}let On=ut.length-3;const tr=ut[On],ar=ut[On+1],oi=0===Rt?tr:ar;oi>=je&&oi<=gt&&yn(Ft,tr,ar,ut[On+2]),On=Ft.length-3,Ct&&On>=3&&(Ft[On]!==Ft[0]||Ft[On+1]!==Ft[1])&&yn(Ft,Ft[0],Ft[1],Ft[2]),Ft.length&&ke.push(Ft)}function st(ut){const ke=[];return ke.size=ut.size,ke.start=ut.start,ke.end=ut.end,ke}function en(ut,ke,je,gt,Rt,Ct){for(const Mt of ut)ds(Mt,ke,je,gt,Rt,Ct,false)}function yn(ut,ke,je,gt){ut.push(ke,je,gt)}function jn(ut,ke,je,gt,Rt,Ct){const Mt=(Ct-ke)/(gt-ke);return yn(ut,Ct,je+(Rt-je)*Mt,1),Mt}function xr(ut,ke,je,gt,Rt,Ct){const Mt=(Ct-je)/(Rt-je);return yn(ut,ke+(gt-ke)*Mt,Ct,1),Mt}function wr(ut,ke){const je=[];for(let gt=0;gt0&&ke.size<(Rt?Mt:gt))return void(je.numPoints+=ke.length/3);const Ft=[];for(let Dt=0;DtMt)&&(je.numSimplified++,Ft.push(ke[Dt],ke[Dt+1])),je.numPoints++;Rt&&function(Dt,Qt){let fn=0;for(let vn=0,On=Dt.length,tr=On-2;vn0===Qt)for(let vn=0,On=Dt.length;vn24)throw new Error("maxZoom should be in the 0-24 range");if(je.promoteId&&je.generateId)throw new Error("promoteId and generateId cannot be used together.");let Rt=function(Ct,Mt){const Ft=[];if("FeatureCollection"===Ct.type)for(let Dt=0;Dt1&&console.time("creation"),tr=this.tiles[On]=Nn(ke,je,gt,Rt,Qt),this.tileCoords.push({z:je,x:gt,y:Rt}),fn)){fn>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",je,gt,Rt,tr.numFeatures,tr.numPoints,tr.numSimplified),console.timeEnd("creation"));const fo=`z${je}`;this.stats[fo]=(this.stats[fo]||0)+1,this.total++}if(tr.source=ke,null==Ct){if(je===Qt.indexMaxZoom||tr.numPoints<=Qt.indexMaxPoints)continue}else{if(je===Qt.maxZoom||je===Ct)continue;if(null!=Ct){const fo=Ct-je;if(gt!==Mt>>fo||Rt!==Ft>>fo)continue}}if(tr.source=null,0===ke.length)continue;fn>1&&console.time("clipping");const ar=.5*Qt.buffer/Qt.extent,oi=.5-ar,ei=.5+ar,Ar=1+ar;let pi=null,Qr=null,wi=null,Li=null;const ao=Pa(ke,vn,gt-ar,gt+ei,0,tr.minX,tr.maxX,Qt),Mo=Pa(ke,vn,gt+oi,gt+Ar,0,tr.minX,tr.maxX,Qt);ao&&(pi=Pa(ao,vn,Rt-ar,Rt+ei,1,tr.minY,tr.maxY,Qt),Qr=Pa(ao,vn,Rt+oi,Rt+Ar,1,tr.minY,tr.maxY,Qt)),Mo&&(wi=Pa(Mo,vn,Rt-ar,Rt+ei,1,tr.minY,tr.maxY,Qt),Li=Pa(Mo,vn,Rt+oi,Rt+Ar,1,tr.minY,tr.maxY,Qt)),fn>1&&console.timeEnd("clipping"),Dt.push(pi||[],je+1,2*gt,2*Rt),Dt.push(Qr||[],je+1,2*gt,2*Rt+1),Dt.push(wi||[],je+1,2*gt+1,2*Rt),Dt.push(Li||[],je+1,2*gt+1,2*Rt+1)}}getTile(ke,je,gt){ke=+ke,je=+je,gt=+gt;const Rt=this.options,{extent:Ct,debug:Mt}=Rt;if(ke<0||ke>24)return null;const Ft=1<1&&console.log("drilling down to z%d-%d-%d",ke,je,gt);let Qt,fn=ke,vn=je,On=gt;for(;!Qt&&fn>0;)fn--,vn>>=1,On>>=1,Qt=this.tiles[Zi(fn,vn,On)];return Qt&&Qt.source?(Mt>1&&(console.log("found parent tile z%d-%d-%d",fn,vn,On),console.time("drilling down")),this.splitTile(Qt.source,fn,vn,On,ke,je,gt),Mt>1&&console.timeEnd("drilling down"),this.tiles[Dt]?Pn(this.tiles[Dt],Ct):null):null}}function Zi(ut,ke,je){return 32*((1<Qt.tags&&"3d_elevation_id"in Qt.tags&&"source"in Qt.tags&&"elevation"===Qt.tags.source,Ct=gt.features.filter(Qt=>Rt(Qt));let Mt={_geojsonTileLayer:gt.features};Ct.length>0&&(Mt={_geojsonTileLayer:gt.features.filter(Qt=>!Rt(Qt)),hd_road_elevation:Ct});const Ft=new Er(Mt),Dt=function(Qt){const fn=new a.gi;for(const vn of Object.keys(Qt))fn.writeMessage(3,an,{name:vn,features:Qt[vn]});return fn.finish()}(Mt).buffer;ke(null,{vectorTile:Ft,rawData:Dt,headers:new Headers})}class Ao extends lr{constructor(ke){super(ke),this.loadVectorData=Fo,this._dynamicIndex=new Yr}async loadData(ke){const je=ke&&ke.request,gt=je&&je.collectResourceTiming;this._geoJSONIndex=null;let Rt=await new Promise((Mt,Ft)=>{this.loadGeoJSON(ke,(Dt,Qt)=>{Dt?Ft(Dt):Mt(Qt)})});if(!Rt)return{};if("object"!=typeof Rt)throw new Error(`Input data given to '${ke.source}' is not a valid GeoJSON object.`);if(ke.filter){const Mt=a.c(ke.filter,{type:"boolean","property-type":"data-driven",overridable:false,transition:false});if("error"===Mt.result)throw new Error(Mt.value.map(Ft=>`${Ft.key}: ${Ft.message}`).join(", "));Rt.features=Rt.features.filter(Ft=>Mt.value.evaluate({zoom:0},Ft))}ke.dynamic?("Feature"===Rt.type&&(Rt={type:"FeatureCollection",features:[Rt]}),ke.append||(this._dynamicIndex.clear(),this.loaded={}),this._dynamicIndex.load(Rt.features,this.loaded),ke.cluster&&(Rt.features=this._dynamicIndex.getFeatures())):this.loaded={},this._geoJSONIndex=ke.cluster?new gn(function({superclusterOptions:Mt,clusterProperties:Ft}){if(!Ft||!Mt)return Mt;const Dt={},Qt={},fn={accumulated:null,zoom:0},vn={properties:null},On=Object.keys(Ft);for(const tr of On){const[ar,oi]=Ft[tr],ei=a.c(oi),Ar=a.c("string"==typeof ar?[ar,["accumulated"],["get",tr]]:ar);Dt[tr]=ei.value,Qt[tr]=Ar.value}return Mt.map=tr=>{vn.properties=tr;const ar={};for(const oi of On)ar[oi]=Dt[oi].evaluate(fn,vn);return ar},Mt.reduce=(tr,ar)=>{vn.properties=ar;for(const oi of On)fn.accumulated=tr[oi],tr[oi]=Qt[oi].evaluate(fn,vn)},Mt}(ke)).load(Rt.features):ke.dynamic?this._dynamicIndex:function(Mt,Ft){return new $i(Mt,Ft)}(Rt,ke.geojsonVtOptions);const Ct={};if(gt){const Mt=s(je);Mt&&(Ct.resourceTiming={},Ct.resourceTiming[ke.source]=JSON.parse(JSON.stringify(Mt)))}return Ct}async reloadTile(ke){const je=this.loaded;if(je&&je[ke.uid]){if(ke.partial)return;return super.reloadTile(ke)}return this.loadTile(ke)}loadGeoJSON(ke,je){if(ke.request)a.g(ke.request).then(({data:gt})=>je(null,gt)).catch(gt=>je(gt));else{if("string"!=typeof ke.data)return je(new Error(`Input data given to '${ke.source}' is not a valid GeoJSON object.`));setTimeout(()=>{try{return je(null,JSON.parse(ke.data))}catch(gt){return je(new Error(`Input data given to '${ke.source}' is not a valid GeoJSON object.`))}},0)}}getClusterExpansionZoom(ke){return this._geoJSONIndex.getClusterExpansionZoom(ke.clusterId)}getClusterChildren(ke){return this._geoJSONIndex.getChildren(ke.clusterId)}getClusterLeaves(ke){return this._geoJSONIndex.getLeaves(ke.clusterId,ke.limit,ke.offset)}}a.cA.setPbf(a.cB);class Ho{constructor(ke){this._mrt=new a.cA(ke.partial?30:1/0),this._isHeaderLoaded=false,this.uid=ke.uid,this.tileID=ke.tileID,this.source=ke.source}async parse(ke){const je=this._mrt;this.status="parsing",this._entireBuffer=ke,je.parseHeader(ke),this._isHeaderLoaded=true;const gt=[];for(const Rt in je.layers){const Ct=je.getLayer(Rt),Mt=Ct.getDataRange(Ct.getBandList()),Ft=je.createDecodingTask(Mt),Dt=ke.slice(Mt.firstByte,Mt.lastByte+1);gt.push(a.cA.performDecoding(Dt,Ft).then(Qt=>Ft.complete(null,Qt)).catch(Qt=>Ft.complete(Qt,null)))}return await Promise.allSettled(gt),je}}class Ia{constructor({actor:ke}){this.actor=ke,this.loading={},this.loaded={}}async loadTile(ke){const je=ke.uid,gt=new AbortController,Rt=this.loading[je]=new Ho(ke);Rt.abort=()=>gt.abort();try{const{data:Ct,headers:Mt}=await a.cC(ke.request,gt.signal);return Ct?(this.loaded[je]=Rt,{mrt:await Rt.parse(Ct),headers:Mt}):(Rt.status="done",this.loaded[je]=Rt,null)}catch(Ct){if(gt.signal.aborted)return null;throw Rt.status="done",this.loaded[je]=Rt,Ct}finally{delete this.loading[je]}}async reloadTile(ke){}abortTile(ke){const je=ke.uid,gt=this.loading[je];gt&&(gt.abort&>.abort(),delete this.loading[je])}removeTile(ke){const je=ke.uid;this.loaded[je]&&delete this.loaded[je]}async decodeRasterArray(ke){return a.cA.performDecoding(ke.buffer,ke.task)}}class ba{constructor(ke){this.self=ke,this.actor=new a.aw(ke,this),this.layerIndexes={},this.availableImages={},this.availableModels={},this.isSpriteLoaded={},this.rtlPluginParsingListeners=[],this.projections={},this.defaultProjection=a.gk({name:"mercator"}),this.workerSourceTypes={vector:lr,geojson:Ao,"raster-dem":on},this.workerSources={},this.self.registerRTLTextPlugin=je=>{if(a.fG.isParsed())throw new Error("RTL text plugin already registered.");a.fG.setState({pluginStatus:a.gl.parsed,pluginURL:a.fG.getPluginURL()}),a.fG.applyArabicShaping=je.applyArabicShaping,a.fG.processBidirectionalText=je.processBidirectionalText,a.fG.processStyledBidirectionalText=je.processStyledBidirectionalText;for(const{resolve:gt}of this.rtlPluginParsingListeners)gt(true);this.rtlPluginParsingListeners=[]}}clearCaches(ke,je){delete this.layerIndexes[ke],delete this.availableImages[ke],delete this.availableModels[ke],delete this.workerSources[ke],delete this.isSpriteLoaded[ke]}checkIfReady(ke,je){}spriteLoaded(ke,je){const{scope:gt}=je;if(this.isSpriteLoaded[ke]||(this.isSpriteLoaded[ke]={}),this.isSpriteLoaded[ke][gt]=true,this.workerSources[ke]&&this.workerSources[ke][gt])for(const Rt in this.workerSources[ke][gt]){const Ct=this.workerSources[ke][gt][Rt];for(const Mt in Ct){const Ft=Ct[Mt];Ft instanceof lr&&(Ft.isSpriteLoaded=true,Ft.fire(new a.h("isSpriteLoaded")))}}}setImages(ke,je){this.availableImages[ke]||(this.availableImages[ke]={});const{scope:gt,images:Rt}=je;if(this.availableImages[ke][gt]=Rt,je.isSpriteLoaded&&this.spriteLoaded(ke,{scope:gt}),this.workerSources[ke]&&this.workerSources[ke][gt])for(const Ct in this.workerSources[ke][gt]){const Mt=this.workerSources[ke][gt][Ct];for(const Ft in Mt)Mt[Ft].availableImages=Rt}}setModels(ke,{scope:je,models:gt}){if(this.availableModels[ke]||(this.availableModels[ke]={}),this.availableModels[ke][je]=gt,this.workerSources[ke]&&this.workerSources[ke][je])for(const Rt in this.workerSources[ke][je]){const Ct=this.workerSources[ke][je][Rt];for(const Mt in Ct)Ct[Mt].availableModels=gt}}setProjection(ke,je){this.projections[ke]=a.gk(je)}setGlobalParams(ke,je){if(this.referrer=je.referrer,Object.assign(a.eL,je.config),je.contextOptions){const{maxBindingPoints:gt,maxUniformBlockSizeDwords:Rt}=je.contextOptions;this.maxUniformBufferBindings=gt,this.maxUniformBlockSizeDwords=Rt}}upsertRenderParams(ke,je){void 0!==je.brightness&&(this.brightness=je.brightness),void 0!==je.worldview&&(this.worldview=je.worldview)}setLayers(ke,je){this.getLayerIndex(ke,je.scope).replace(je.layers,je.options)}updateLayers(ke,je){this.getLayerIndex(ke,je.scope).update(je.layers,je.removedIds,je.options)}async loadTile(ke,je){if(je.projection=this.projections[ke]||this.defaultProjection,"batched-model"===je.type&&!this.workerSourceTypes["batched-model"]){if(await a.gm(),!N)throw new Error('Could not load Standard module for "batched-model" source.');this.workerSourceTypes["batched-model"]=N}return"raster-array"===je.type&&await this.ensureRasterArrayWorkerSource(),this.getWorkerSource(ke,je).loadTile(je)}async ensureRasterArraySource(ke,je){await this.ensureRasterArrayWorkerSource()}async ensureRasterArrayWorkerSource(){if(!this.workerSourceTypes["raster-array"]){if(await async function(){return Promise.resolve()}(),!Ia)throw new Error('Could not load raster-array module for "raster-array" source.');this.workerSourceTypes["raster-array"]=Ia}}async decodeRasterArray(ke,je){return await this.ensureRasterArrayWorkerSource(),this.getWorkerSource(ke,je).decodeRasterArray(je)}reloadTile(ke,je){return je.projection=this.projections[ke]||this.defaultProjection,this.getWorkerSource(ke,je).reloadTile(je)}abortTile(ke,je){const gt=this.getExistingWorkerSource(ke,je);return gt?gt.abortTile(je):void 0}removeTile(ke,je){const gt=this.getExistingWorkerSource(ke,je);return gt?gt.removeTile(je):void 0}getExistingWorkerSource(ke,je){const{type:gt,source:Rt,scope:Ct}=je,Mt=this.workerSources[ke];if(Mt&&Mt[Ct]&&Mt[Ct][gt])return Mt[Ct][gt][Rt]}async removeSource(ke,je){const{type:gt,source:Rt,scope:Ct}=je,Mt=this.workerSources[ke]&&this.workerSources[ke][Ct]&&this.workerSources[ke][Ct][gt],Ft=Mt&&Mt[Rt];Ft&&(delete Mt[Rt],Ft.removeSource&&await Ft.removeSource({source:Rt}))}async loadTileProvider(ke,je){const gt=new(await a.cn(je.name,je.url))(je.options);return this.getWorkerSource(ke,{type:je.type,source:je.source,scope:je.scope},gt),gt.load&&je.request?gt.load({request:je.request}):null}async syncRTLPluginState(ke,je){if(a.fG.isParsed())return true;if(a.fG.isParsing())return new Promise((Rt,Ct)=>{this.rtlPluginParsingListeners.push({resolve:Rt,reject:Ct})});a.fG.setState(je);const gt=a.fG.getPluginURL();if(!a.fG.isLoaded()||a.fG.isParsed()||a.fG.isParsing())return false;a.fG.setState({pluginStatus:a.gl.parsing,pluginURL:gt});try{return await self.__mapboxImport(gt),!!a.fG.isParsed()||new Promise((Rt,Ct)=>{this.rtlPluginParsingListeners.push({resolve:Rt,reject:Ct})})}catch(Rt){a.fG.setState({pluginStatus:a.gl.error,pluginURL:gt});for(const{reject:Ct}of this.rtlPluginParsingListeners)Ct(Rt);throw this.rtlPluginParsingListeners=[],Rt}}getAvailableImages(ke,je){this.availableImages[ke]||(this.availableImages[ke]={});let gt=this.availableImages[ke][je];return gt||(gt=[]),gt}getAvailableModels(ke,je){this.availableModels[ke]||(this.availableModels[ke]={});let gt=this.availableModels[ke][je];return gt||(gt={}),gt}getLayerIndex(ke,je){this.layerIndexes[ke]||(this.layerIndexes[ke]={});let gt=this.layerIndexes[ke][je];return gt||(gt=this.layerIndexes[ke][je]=new W,gt.scope=je),gt}getWorkerSource(ke,je,gt){const{type:Rt,source:Ct,scope:Mt}=je,Ft=this.workerSources;if(Ft[ke]||(Ft[ke]={}),Ft[ke][Mt]||(Ft[ke][Mt]={}),Ft[ke][Mt][Rt]||(Ft[ke][Mt][Rt]={}),this.isSpriteLoaded[ke]||(this.isSpriteLoaded[ke]={}),this.getExistingWorkerSource(ke,je))gt&&(Ft[ke][Mt][Rt][Ct].tileProvider=gt);else{const Dt=this.actor.getWorkerSourceActor(ke),Qt=this.workerSourceTypes[Rt];if(!Qt)throw new Error(`Unknown worker source type "${Rt}".`);Ft[ke][Mt][Rt][Ct]=new Qt({actor:Dt,layerIndex:this.getLayerIndex(ke,Mt),availableImages:this.getAvailableImages(ke,Mt),availableModels:this.getAvailableModels(ke,Mt),isSpriteLoaded:this.isSpriteLoaded[ke][Mt],tileProvider:gt,brightness:this.brightness,worldview:this.worldview,maxUniformBufferBindings:this.maxUniformBufferBindings,maxUniformBlockSizeDwords:this.maxUniformBlockSizeDwords})}return Ft[ke][Mt][Rt][Ct]}enforceCacheSizeLimit(ke,je){a.gn(je)}}return a.gj(self)&&(self.worker=new ba(self)),ba});r(["./shared"],function(o){const a={antialias:false,alpha:true,stencil:true,depth:true};let s,l;function u(k){const v=document.createElement("canvas"),E=Object.create(a);E.failIfMajorPerformanceCaveat=k;const D=v.getContext("webgl2",E);if(!D)return false;let V;try{V=D.createShader(D.VERTEX_SHADER)}catch(Y){return false}return!(!V||D.isContextLost())&&(D.shaderSource(V,"void main() {}"),D.compileShader(V),true===D.getShaderParameter(V,D.COMPILE_STATUS))}const d=/firefox/i,f=/macintosh/i;function h(k,v,E){const D=document.createElement(k);return null!=v&&(D.className=v),E&&E.appendChild(D),D}function m(k,v,E){const D=document.createElementNS("http://www.w3.org/2000/svg",k);for(const V of Object.keys(v))D.setAttributeNS(null,V,String(v[V]));return E&&E.appendChild(D),D}const g="undefined"!=typeof document?document.documentElement&&document.documentElement.style:null,x=g&&void 0!==g.userSelect?"userSelect":"WebkitUserSelect";let w;function _(){g&&x&&(w=g[x],g[x]="none")}function C(){g&&x&&(g[x]=w)}function A(k){k.preventDefault(),k.stopPropagation(),window.removeEventListener("click",A,true)}function P(){window.addEventListener("click",A,true),window.setTimeout(()=>{window.removeEventListener("click",A,true)},0)}function L(k,v){const E=k.getBoundingClientRect();return O(k,E,v)}function I(k,v){const E=k.getBoundingClientRect(),D=[];for(let V=0;V>16&255)/255,(k>>8&255)/255,(255&k)/255,1)}function Ie(k,v){const E={spread_method:1,stops:[],x1:0,y1:0,x2:1,y2:0};let D;for(;D=k.nextField(v);)1===D?E.transform=re(k,k.readVarint()+k.pos):2===D?E.spread_method=k.readVarint():3===D?E.stops.push(he(k,k.readVarint()+k.pos)):4===D?E.x1=k.readFloat():5===D?E.y1=k.readFloat():6===D?E.x2=k.readFloat():7===D&&(E.y2=k.readFloat());return E}function he(k,v){const E={offset:0,opacity:255,rgb_color:H};let D;for(;D=k.nextField(v);)1===D?E.offset=k.readFloat():2===D?E.opacity=k.readVarint():3===D&&(E.rgb_color=be(k.readVarint()));return E}function ve(k,v){const E={spread_method:1,stops:[],cx:.5,cy:.5,r:.5,fx:.5,fy:.5,fr:0};let D;for(;D=k.nextField(v);)1===D?E.transform=re(k,k.readVarint()+k.pos):2===D?E.spread_method=k.readVarint():3===D?E.stops.push(he(k,k.readVarint()+k.pos)):4===D?E.cx=k.readFloat():5===D?E.cy=k.readFloat():6===D?E.r=k.readFloat():7===D?E.fx=k.readFloat():8===D?E.fy=k.readFloat():9===D&&(E.fr=k.readFloat());return E}function ge(k,v){const E={children:[]};let D;for(;D=k.nextField(v);)1===D?E.transform=re(k,k.readVarint()+k.pos):2===D?E.clip_path_idx=k.readVarint():3===D&&E.children.push(oe(k,k.readVarint()+k.pos));return E}function Ve(k,v){const E={left:0,width:20,mask_type:1,children:[]};let D;for(;D=k.nextField(v);)1===D?E.left=E.top=k.readFloat():2===D?E.width=E.height=k.readFloat():3===D?E.top=k.readFloat():4===D?E.height=k.readFloat():5===D?E.mask_type=k.readVarint():6===D?E.mask_idx=k.readVarint():7===D&&E.children.push(oe(k,k.readVarint()+k.pos));return E.height??=E.width,E.top??=E.left,E}class Le{static calculate(v={},E=[]){const D=new Map,V=new Map;if(0===Object.keys(v).length)return D;E.forEach(Y=>{V.set(Y.name,Y.rgb_color||new o.C(0,0,0))});for(const[Y,Z]of Object.entries(v))V.has(Y)?D.set(V.get(Y).toString(),Z):console.warn(`Ignoring unknown image variable "${Y}"`);return D}}function $e(k,v=255,E){const D=E.get(k.toString())||k;return 255===v?D.toString():new o.C(D.r,D.g,D.b,D.a*v/255).toString()}const Ee=[];let tt=0;function yt(k,v){if(tt>=Ee.length){const D=o.o()?new OffscreenCanvas(k,v).getContext("2d",{willReadFrequently:true}):document.createElement("canvas").getContext("2d",{willReadFrequently:true});Ee.push(D)}const E=Ee[tt++];return E.canvas.width=k,E.canvas.height=v,E}function mt(){tt--}function ct(k,v,E,D,V){for(const Y of D.children)Ge(k,v,E,Y,V)}function Ge(k,v,E,D,V){D.group?(k.save(),function(Y,Z,ne,le,fe){const me=null!=le.mask_idx?ne.masks[le.mask_idx]:null,Pe=null!=le.clip_path_idx?ne.clip_paths[le.clip_path_idx]:null;if(le.transform&&(Z=qe(le.transform).preMultiplySelf(Z)),!function(Ke,ot,at){return 255!==Ke.opacity||ot||at}(le,null!=Pe,null!=me))return void ct(Y,Z,ne,le,fe);const Re=yt(Y.canvas.width,Y.canvas.height);ct(Re,Z,ne,le,fe),Pe&&Ze(Re,Z,ne,Pe),me&&Be(Re,Z,ne,me,fe),Y.globalAlpha=le.opacity/255,Y.drawImage(Re.canvas,0,0),mt()}(k,v,E,D.group,V),k.restore()):D.path&&(k.save(),function(Y,Z,ne,le,fe){Y.setTransform(Z),1===le.paint_order?(it(Y,ne,le,fe),He(Y,ne,le,fe)):(He(Y,ne,le,fe),it(Y,ne,le,fe))}(k,v,E,D.path,V),k.restore())}function it(k,v,E,D){const V=E.fill;if(!V)return;const Y=V.opacity/255;switch(k.save(),k.beginPath(),Qe(E,k),V.paint){case"rgb_color":k.fillStyle=$e(V.rgb_color,V.opacity,D);break;case"linear_gradient_idx":{const Z=v.linear_gradients[V.linear_gradient_idx];Z.transform&&k.setTransform(qe(Z.transform).preMultiplySelf(k.getTransform())),k.fillStyle=Je(k,Z,Y,D);break}case"radial_gradient_idx":{const Z=v.radial_gradients[V.radial_gradient_idx];Z.transform&&k.setTransform(qe(Z.transform).preMultiplySelf(k.getTransform())),k.fillStyle=Te(k,Z,Y,D)}}k.fill(bt(E)),k.restore()}function bt(k){return 1===k.rule?"nonzero":2===k.rule?"evenodd":void 0}function He(k,v,E,D){const V=E.stroke;if(!V)return;const Y=ze(E);k.lineWidth=V.width,k.miterLimit=V.miterlimit,k.setLineDash(V.dasharray),k.lineDashOffset=V.dashoffset;const Z=V.opacity/255;switch(V.paint){case"rgb_color":k.strokeStyle=$e(V.rgb_color,V.opacity,D);break;case"linear_gradient_idx":k.strokeStyle=Je(k,v.linear_gradients[V.linear_gradient_idx],Z,D,true);break;case"radial_gradient_idx":k.strokeStyle=Te(k,v.radial_gradients[V.radial_gradient_idx],Z,D,true)}switch(V.linejoin){case 2:case 1:k.lineJoin="miter";break;case 3:k.lineJoin="round";break;case 4:k.lineJoin="bevel"}switch(V.linecap){case 1:k.lineCap="butt";break;case 2:k.lineCap="round";break;case 3:k.lineCap="square"}k.stroke(Y)}function Je(k,v,E,D,V=false){if(1===v.stops.length){const Re=v.stops[0];return $e(Re.rgb_color,Re.opacity*E,D)}const{x1:Y,y1:Z,x2:ne,y2:le}=v;let fe=new DOMPoint(Y,Z),me=new DOMPoint(ne,le);if(V){const Re=qe(v.transform);fe=Re.transformPoint(fe),me=Re.transformPoint(me)}const Pe=k.createLinearGradient(fe.x,fe.y,me.x,me.y);for(const Re of v.stops)Pe.addColorStop(Re.offset,$e(Re.rgb_color,Re.opacity*E,D));return Pe}function Te(k,v,E,D,V=false){if(1===v.stops.length){const vt=v.stops[0];return $e(vt.rgb_color,vt.opacity*E,D)}const Y=qe(v.transform),{fx:Z,fy:ne,fr:le,cx:fe,cy:me,r:Pe}=v;let Re=new DOMPoint(Z,ne),Ke=new DOMPoint(fe,me),ot=le,at=Pe;if(V){Re=Y.transformPoint(Re),Ke=Y.transformPoint(Ke);const vt=(Y.a+Y.d)/2;ot=le*vt,at=v.r*vt}const xt=k.createRadialGradient(Re.x,Re.y,ot,Ke.x,Ke.y,at);for(const vt of v.stops)xt.addColorStop(vt.offset,$e(vt.rgb_color,vt.opacity*E,D));return xt}function we(k,v,E,D){const V=D.transform?qe(D.transform).preMultiplySelf(v):v,Y=yt(k.canvas.width,k.canvas.height);for(const ne of D.children)if(ne.group)we(Y,V,E,ne.group);else if(ne.path){const le=ne.path,fe=new Path2D;fe.addPath(ze(le),V),Y.fill(fe,bt(le))}const Z=null!=D.clip_path_idx?E.clip_paths[D.clip_path_idx]:null;Z&&Ze(Y,V,E,Z),k.globalCompositeOperation="source-over",k.drawImage(Y.canvas,0,0),mt()}function Ze(k,v,E,D){const V=yt(k.canvas.width,k.canvas.height);we(V,v,E,D),k.globalCompositeOperation="destination-in",k.drawImage(V.canvas,0,0),mt()}function Be(k,v,E,D,V){if(0===D.children.length)return;const Y=null!=D.mask_idx?E.masks[D.mask_idx]:null;Y&&Be(k,v,E,Y,V);const Z=k.canvas.width,ne=k.canvas.height,le=yt(Z,ne),fe=D.width,me=D.height,Pe=D.left,Re=D.top,Ke=new Path2D,ot=new Path2D;ot.rect(Pe,Re,fe,me),Ke.addPath(ot,v),le.clip(Ke);for(const vt of D.children)Ge(le,v,E,vt,V);const at=le.getImageData(0,0,Z,ne),xt=at.data;if(1===D.mask_type)for(let vt=0;vto.I.from(E))}getImageVersions(v){return this.imageVersions.get(v)||new Map}hasImageProviderForSource(v,E){const D=this.imageProviders.get(E);if(!D)return false;for(const V of D.values())if(V.sourceCache.getSource().id===v)return true;return false}getImages(v,E,D){const V=[],Y=[],Z=this.imageProviders.get(E);for(const me of v){if(!me.iconsetId){V.push(me);continue}const Pe=Z.get(me.iconsetId);Pe&&(this.getImage(me,E)?Y.push(me):Pe.addPendingRequest(me))}if(0===V.length)return void this._notify(Y,E,D);let ne=true;const le=!!this.loaded.get(E),fe=this.images.get(E);if(!le)for(const me of V)fe.has(me.toString())||(ne=false);le||ne?this._notify(V,E,D):this.requestors.push({ids:V,scope:E,callback:D})}rasterizeImages(v,E){const D=new Map,{iconTasks:V,patternTasks:Y,scope:Z}=v;for(const ne of[V,Y])for(const[le,fe]of ne.entries()){const me=this.getImage(fe.id,Z);me&&D.set(le,{image:me,imageVariant:fe})}E(null,this._rasterizeImages(Z,D))}_rasterizeImages(v,E){const D=new Map;for(const[V,{image:Y,imageVariant:Z}]of E.entries())D.set(V,this.imageRasterizer.rasterize(Z,Y,v,0));return D}getUpdatedImages(v){return this.updatedImages.get(v)||new Set}_notify(v,E,D){const V=this.images.get(E),Y=new Map;for(const Z of v){if(!V.get(Z.toString())){if(Z.iconsetId)continue;this.fire(new o.h("styleimagemissing",{id:Z.name}))}const ne=V.get(Z.toString());if(!ne){o.w(`Image "${Z.name}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`);continue}const le={data:ne.usvg?null:ne.data.clone(),pixelRatio:ne.pixelRatio,sdf:ne.sdf,usvg:ne.usvg,stretchX:ne.stretchX,stretchY:ne.stretchY,content:ne.content,hasRenderCallback:Boolean(ne.userImage&&ne.userImage.render)};ne.usvg&&Object.assign(le,{width:ne.icon.usvg_tree.width,height:ne.icon.usvg_tree.height}),Y.set(o.I.toString(Z),le)}D(null,{images:Y,versions:this.getImageVersions(E)})}getPixelSize(v){const{width:E,height:D}=this.atlasImage.get(v);return{width:E,height:D}}getPattern(v,E,D){const V=v.toString(),Y=this.patterns.get(E),Z=Y.get(V),ne=this.getImage(v,E);if(!ne)return null;if(Z){if(Z.position.version===ne.version)return Z.position;Z.position.version=ne.version}else{if(ne.usvg&&!ne.data){const le=this.getPatternInFlightId(V,E);if(this.patternsInFlight.has(le))return null;this.patternsInFlight.add(le);const fe=new o.i(v).scaleSelf(o.e.devicePixelRatio),me=new Map([[fe.toString(),{image:ne,imageVariant:fe}]]),Pe=this._rasterizeImages(E,me);return this.storePatternImage(fe,E,ne,D,Pe),null}this.storePattern(v,E,ne)}return this._updatePatternAtlas(E,D),Y.get(V).position}getPatternInFlightId(v,E){return o.m(v,E)}hasPatternsInFlight(){return 0!==this.patternsInFlight.size}storePatternImage(v,E,D,V,Y){const Z=v.toString(),ne=Y?Y.get(Z):void 0;ne&&(D.data=ne,this.storePattern(v.id,E,D),this._updatePatternAtlas(E,V),this.patternsInFlight.delete(this.getPatternInFlightId(v.id.toString(),E)))}storePattern(v,E,D){const V={w:D.data.width+2*o.j,h:D.data.height+2*o.j,x:0,y:0},Y=new o.k(V,D,o.j);this.patterns.get(E).set(v.toString(),{bin:V,position:Y})}destroyAtlasTextures(){for(const v of this.atlasTexture.values())v&&v.destroy();this.atlasTexture.clear()}bind(v,E){const D=v.gl;let V=this.atlasTexture.get(E);V?this.dirty&&(V.update(this.atlasImage.get(E)),this.dirty=false):(V=new o.T(v,this.atlasImage.get(E),D.RGBA8),this.atlasTexture.set(E,V)),V.bind(D.LINEAR,D.CLAMP_TO_EDGE)}_updatePatternAtlas(v,E){const D=this.patterns.get(v),V=Array.from(D.values()).map(({bin:fe})=>fe),{w:Y,h:Z}=o.p(V),ne=this.atlasImage.get(v);ne.resize({width:Y||1,height:Z||1});const le=this.images.get(v);for(const[fe,{bin:me,position:Pe}]of D.entries()){let Re=Pe.padding;const Ke=me.x+Re,ot=me.y+Re,at=le.get(fe).data,xt=at.width,vt=at.height;Re=Re>1?Re-1:Re,o.b.copy(at,ne,{x:0,y:0},{x:Ke,y:ot},{width:xt,height:vt},E),o.b.copy(at,ne,{x:0,y:vt-Re},{x:Ke,y:ot-Re},{width:xt,height:Re},E),o.b.copy(at,ne,{x:0,y:0},{x:Ke,y:ot+vt},{width:xt,height:Re},E),o.b.copy(at,ne,{x:xt-Re,y:0},{x:Ke-Re,y:ot},{width:Re,height:vt},E),o.b.copy(at,ne,{x:0,y:0},{x:Ke+xt,y:ot},{width:Re,height:vt},E),o.b.copy(at,ne,{x:xt-Re,y:vt-Re},{x:Ke-Re,y:ot-Re},{width:Re,height:Re},E),o.b.copy(at,ne,{x:0,y:vt-Re},{x:Ke+xt,y:ot-Re},{width:Re,height:Re},E),o.b.copy(at,ne,{x:0,y:0},{x:Ke+xt,y:ot+vt},{width:Re,height:Re},E),o.b.copy(at,ne,{x:xt-Re,y:0},{x:Ke-Re,y:ot+vt},{width:Re,height:Re},E)}this.dirty=true}beginFrame(){for(const v of this.images.keys())this.callbackDispatchedThisFrame.set(v,new Set);this.imageAtlasCache.beginFrame()}dispatchRenderCallbacks(v,E){const D=this.images.get(E);for(const V of v){if(this.callbackDispatchedThisFrame.get(E).has(V.toString()))continue;this.callbackDispatchedThisFrame.get(E).add(V.toString());const Y=D.get(V.toString());W(Y)&&this.updateImage(V,E,Y)}}}class Ne{constructor(v,E,D,V){this.message=(v?`${v}: `:"")+D,V&&(this.identifier=V),null!=E&&E.__line__&&(this.line=E.__line__)}}class Ae extends Ne{}function dt(k){const v=k.value,E=k.valueSpec,D=k.style,V=k.styleSpec,Y=k.key,Z=k.arrayElementValidator||Pt;if(!Array.isArray(v))return[new Ne(Y,v,`array expected, ${o.n(v)} found`)];if(E.length&&v.length!==E.length)return[new Ne(Y,v,`array length ${E.length} expected, length ${v.length} found`)];if(E["min-length"]&&v.lengthV)return[new Ne(v,E,`${E} is greater than the maximum value ${V}`)]}return[]}function Wt(k){const v=k.key,E=k.value;if(!o.l(E))return[new Ne(v,E,`object expected, ${o.n(E)} found`)];const D=k.valueSpec,V=o.u(E.type);let Y,Z,ne,le={};const fe="categorical"!==V&&void 0===E.property,me=!fe,Pe=function(at){const xt=at.stops;return Array.isArray(xt)&&Array.isArray(xt[0])&&o.l(xt[0][0])}(E),Re=an({key:k.key,value:k.value,valueSpec:k.styleSpec.function,style:k.style,styleSpec:k.styleSpec,objectElementValidators:{stops:function(at){if("identity"===V)return[new Ne(at.key,at.value,'identity function may not have a "stops" property')];let xt=[];const vt=at.value;return xt=xt.concat(dt({key:at.key,value:vt,valueSpec:at.valueSpec,style:at.style,styleSpec:at.styleSpec,arrayElementValidator:Ke})),Array.isArray(vt)&&0===vt.length&&xt.push(new Ne(at.key,vt,"array must have at least one stop")),xt},default:function(at){return Pt({key:at.key,value:at.value,valueSpec:D,style:at.style,styleSpec:at.styleSpec})}}});return"identity"===V&&fe&&Re.push(new Ne(k.key,k.value,'missing required property "property"')),"identity"===V||E.stops||Re.push(new Ne(k.key,k.value,'missing required property "stops"')),"exponential"===V&&D.expression&&!o.r(D)&&Re.push(new Ne(k.key,k.value,"exponential functions not supported")),k.styleSpec.$version>=8&&(me&&!o.t(D)?Re.push(new Ne(k.key,k.value,"property functions not supported")):fe&&!o.v(D)&&Re.push(new Ne(k.key,k.value,"zoom functions not supported"))),"categorical"!==V&&!Pe||void 0!==E.property||Re.push(new Ne(k.key,k.value,'"property" property is required')),Re;function Ke(at){let xt=[];const vt=at.value,It=at.key;if(!Array.isArray(vt))return[new Ne(It,vt,`array expected, ${o.n(vt)} found`)];if(2!==vt.length)return[new Ne(It,vt,`array length 2 expected, length ${vt.length} found`)];if(Pe){if(!o.l(vt[0]))return[new Ne(It,vt,`object expected, ${o.n(vt[0])} found`)];const jt=vt[0];if(void 0===jt.zoom)return[new Ne(It,vt,"object stop key must have zoom")];if(void 0===jt.value)return[new Ne(It,vt,"object stop key must have value")];const Zt=o.u(jt.zoom);if("number"!=typeof Zt)return[new Ne(It,jt.zoom,"stop zoom values must be numbers")];if(ne&&ne>Zt)return[new Ne(It,jt.zoom,"stop zoom values must appear in ascending order")];Zt!==ne&&(ne=Zt,Z=void 0,le={}),xt=xt.concat(an({key:`${It}[0]`,value:vt[0],valueSpec:{zoom:{}},style:at.style,styleSpec:at.styleSpec,objectElementValidators:{zoom:Oe,value:ot}}))}else xt=xt.concat(ot({key:`${It}[0]`,value:vt[0],style:at.style,styleSpec:at.styleSpec},vt));return o.x(o.y(vt[1]))?xt.concat([new Ne(`${It}[1]`,vt[1],"expressions are not allowed in function stops.")]):xt.concat(Pt({key:`${It}[1]`,value:vt[1],valueSpec:D,style:at.style,styleSpec:at.styleSpec}))}function ot(at,xt){const vt=o.n(at.value),It=o.u(at.value),jt=null!==at.value?at.value:xt;if(Y){if(vt!==Y)return[new Ne(at.key,jt,`${vt} stop domain type must match previous stop domain type ${Y}`)]}else Y=vt;if("number"!==vt&&"string"!==vt&&"boolean"!==vt&&"number"!=typeof It&&"string"!=typeof It&&"boolean"!=typeof It)return[new Ne(at.key,jt,"stop domain value must be a number, string, or boolean")];if("number"!==vt&&"categorical"!==V){let Zt=`number expected, ${vt} found`;return o.t(D)&&void 0===V&&(Zt+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Ne(at.key,jt,Zt)]}return"categorical"!==V||"number"!==vt||"number"==typeof It&&isFinite(It)&&Math.floor(It)===It?"categorical"!==V&&"number"===vt&&"number"==typeof It&&"number"==typeof Z&&void 0!==Z&&Itnew Ne(`${k.key}${D.key}`,k.value,D.message));const E=v.value.expression||v.value._styleExpression.expression;if("property"===k.expressionContext&&"text-font"===k.propertyKey&&!E.outputDefined())return[new Ne(k.key,k.value,`Invalid data expression for "${k.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===k.expressionContext&&"layout"===k.propertyType&&!o.A(E))return[new Ne(k.key,k.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===k.expressionContext)return qt(E,k);if("appearance"===k.expressionContext)return Jt(E,k);if(k.expressionContext&&0===k.expressionContext.indexOf("cluster")){if(!o.B(E,["zoom","feature-state"]))return[new Ne(k.key,k.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===k.expressionContext&&!o.D(E))return[new Ne(k.key,k.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function qt(k,v){const E=new Set(["zoom","feature-state","pitch","distance-from-center"]);if(v.valueSpec&&v.valueSpec.expression)for(const V of v.valueSpec.expression.parameters)E.delete(V);if(0===E.size)return[];const D=[];return k instanceof o.F&&E.has(k.name)?[new Ne(v.key,v.value,`["${k.name}"] expression is not supported in a filter for a ${v.object.type} layer with id: ${v.object.id}`)]:(k.eachChild(V=>{D.push(...qt(V,v))}),D)}const _t=new Set(["get","has","properties","geometry-type","id"]),sn=new Set(["zoom","pitch","distance-from-center","feature","feature-state","measure-light","heatmap-density","line-progress","raster-value","raster-particle-speed","sky-radial-progress"]);function Jt(k,v){if(v.valueSpec&&v.valueSpec.expression)for(const D of v.valueSpec.expression.parameters)sn.delete(D);if(0===sn.size)return[];const E=[];if(k instanceof o.F){const D=_t.has(k.name)?"feature":k.name;if(sn.has(D))return[new Ne(v.key,v.value,`["${k.name}"] is not an allowed parameter`)]}return k.eachChild(D=>{E.push(...Jt(D,v))}),E}function Sn(k){const v=k.key,E=k.value,D=k.valueSpec,V=[];return Array.isArray(D.values)?D.values.includes(o.u(E))||V.push(new Ne(v,E,`expected one of [${D.values.join(", ")}], ${JSON.stringify(E)} found`)):Object.keys(D.values).includes(o.u(E))||V.push(new Ne(v,E,`expected one of [${Object.keys(D.values).join(", ")}], ${JSON.stringify(E)} found`)),V}function Kt(k){if(o.J(o.y(k.value))){const v=k.layerType||"fill";return kt({...k,expressionContext:"filter",valueSpec:k.styleSpec[`filter_${v}`]})}return mn(k)}function mn(k){const v=k.value,E=k.key;if(!Array.isArray(v))return[new Ne(E,v,`array expected, ${o.n(v)} found`)];if(v.length<1)return[new Ne(E,v,"filter array must have at least 1 element")];const D=k.styleSpec;let V=Sn({key:`${E}[0]`,value:v[0],valueSpec:D.filter_operator});const Y=()=>{v.length>=2&&(o.H(v[1])||V.push(new Ne(`${E}[1]`,v[1],`string expected, ${o.n(v[1])} found`)));for(let Z=2;Z":case">=":v.length>=2&&"$type"===o.u(v[1])&&V.push(new Ne(E,v,`"$type" cannot be use with operator "${v[0]}"`)),3!==v.length&&V.push(new Ne(E,v,`filter array for operator "${v[0]}" must have 3 elements`)),Y();break;case"==":case"!=":3!==v.length&&V.push(new Ne(E,v,`filter array for operator "${v[0]}" must have 3 elements`)),Y();break;case"in":case"!in":Y();break;case"any":case"all":case"none":for(let Z=1;Z{fe in E&&v.push(new Ne(D,E[fe],`"${fe}" is prohibited for ref layers`))}),V.layers.forEach(fe=>{o.u(fe.id)===ne&&(le=fe)}),le?le.ref?v.push(new Ne(D,E.ref,"ref cannot reference another ref layer")):Z=o.u(le.type):"string"==typeof ne&&v.push(new Ne(D,E.ref,`ref layer "${ne}" not found`))}else if("background"!==Z&&"sky"!==Z&&"slot"!==Z)if(E.source)if(o.H(E.source)){const le=V.sources&&Object.hasOwn(V.sources,E.source)?V.sources[E.source]:void 0,fe=le&&o.u(le.type);le?"vector"===fe&&"raster"===Z?v.push(new Ne(D,E.source,`layer "${E.id}" requires a raster source`)):"raster"===fe&&"raster"!==Z?v.push(new Ne(D,E.source,`layer "${E.id}" requires a vector source`)):"vector"!==fe||E["source-layer"]?"raster-dem"===fe&&"hillshade"!==Z?v.push(new Ne(D,E.source,"raster-dem source can only be used with layer type 'hillshade'.")):"raster-array"!==fe||["raster","raster-particle"].includes(Z)?"line"===Z&&E.paint&&E.paint["line-gradient"]&&"geojson"===fe&&!le.lineMetrics?v.push(new Ne(D,E,`layer "${E.id}" specifies a line-gradient, which requires the GeoJSON source to have \`lineMetrics\` enabled.`)):"line"===Z&&E.paint&&E.paint["line-trim-offset"]&&"geojson"===fe&&!le.lineMetrics?v.push(new Ne(D,E,`layer "${E.id}" specifies a line-trim-offset, which requires the GeoJSON source to have \`lineMetrics\` enabled.`)):"raster-particle"===Z&&"raster-array"!==fe&&v.push(new Ne(D,E.source,`layer "${E.id}" requires a 'raster-array' source.`)):v.push(new Ne(D,E.source,"raster-array source can only be used with layer type 'raster'.")):v.push(new Ne(D,E,`layer "${E.id}" must specify a "source-layer"`)):v.push(new Ne(D,E.source,`source "${E.source}" not found`))}else v.push(new Ne(`${D}.source`,E.source,'"source" must be a string'));else v.push(new Ne(D,E,'missing required property "source"'));return v=v.concat(an({key:D,value:E,valueSpec:Y.layer,style:k.style,styleSpec:k.styleSpec,objectElementValidators:{"*":()=>[],type:()=>Pt({key:`${D}.type`,value:E.type,valueSpec:Y.layer.type,style:k.style,styleSpec:k.styleSpec,object:E,objectKey:"type"}),filter:le=>Kt({layerType:Z,...le}),layout:le=>an({layer:E,key:le.key,value:le.value,valueSpec:{},style:le.style,styleSpec:le.styleSpec,objectElementValidators:{"*":fe=>cr({layerType:Z,...fe})}}),paint:le=>an({layer:E,key:le.key,value:le.value,valueSpec:{},style:le.style,styleSpec:le.styleSpec,objectElementValidators:{"*":fe=>on({layerType:Z,layer:E,...fe})}}),appearances(le){const fe=dt({key:le.key,value:le.value,valueSpec:le.valueSpec,style:le.style,styleSpec:le.styleSpec,arrayElementValidator:Re=>function(Ke){const{key:ot,layer:at,layerType:xt}=Ke,vt=o.u(Ke.value),It=o.u(vt.name),jt=o.u(vt.condition),Zt=an({key:ot,value:vt,valueSpec:Ke.styleSpec.appearance,style:Ke.style,styleSpec:Ke.styleSpec,objectElementValidators:{condition:kn=>function(cn){const hn=[];return hn.push(...kt({key:cn.key,value:cn.object.condition,valueSpec:o.s.appearance.condition,expressionContext:"appearance"})),hn}({...kn}),properties:kn=>function(cn){const hn=[],{styleSpec:xn,layer:wn,layerType:Bn}=cn,Kn=xn[`paint_${Bn}`],Wn=xn[`layout_${Bn}`],Yn=cn.object[cn.objectKey];for(const Vn in Yn){const Zr=Vn in Kn?"paint":Vn in Wn?"layout":void 0;if(!Zr){hn.push(new Ne(cn.key,Vn,`unknown property "${Vn}" for layer type "${Bn}"`));continue}const Qn={...cn,key:`${cn.key}.${Vn}`,objectKey:Vn,layer:wn,layerType:Bn,value:Yn[Vn],valueSpec:"paint"===Zr?Kn[Vn]:Wn[Vn]};hn.push(...lr(Qn,Zr))}return hn}({layer:at,layerType:xt,...kn})}});return"hidden"!==It&&void 0===jt&&Zt.push(new Ne(Ke.key,"name",'Appearance with name different than "hidden" must have a condition')),Zt}({layerType:Z,layer:E,...Re})}),me=Array.isArray(le.value)?le.value:[],Pe=new Set;return me.forEach((Re,Ke)=>{const ot=o.u(Re.name);if(ot)if(Pe.has(ot)){const at=o.u(E.id);fe.push(new Ne(le.key,ot,`Duplicated appearance name "${ot}" for layer "${at}"`))}else Pe.add(ot)}),fe}}})),v}function Mr({key:k,value:v}){return o.H(v)?[]:[new Ne(k,v,`string expected, ${o.n(v)} found`)]}const Er={promoteId:function k({key:v,value:E}){if(o.H(E))return Mr({key:v,value:E});if(Array.isArray(E)){const V=[],Y=o.y(E),Z=o.c(Y);return"error"===Z.result?(Z.value.forEach(ne=>{V.push(new Ne(`${v}${ne.key}`,null,`${ne.message}`))}),V):(o.B(Z.value.expression,["zoom","heatmap-density","line-progress","raster-value","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center","measure-light","raster-particle-speed"])||V.push(new Ne(`${v}`,null,"promoteId expression should be only feature dependent")),V)}if(!o.l(E))return[new Ne(v,E,`string, expression or object expected, "${o.n(E)}" found`)];const D=[];for(const V in E)D.push(...k({key:`${v}.${V}`,value:E[V]}));return D}};function vr(k){const v=k.value,E=k.key,D=k.styleSpec,V=k.style;if(!o.l(v))return[new Ne(E,v,`object expected, ${o.n(v)} found`)];if(!("type"in v))return[new Ne(E,v,'"type" is required')];const Y=o.u(v.type);let Z=[];switch(["vector","raster","raster-dem","raster-array"].includes(Y)&&("url"in v||"tiles"in v||Z.push(new Ae(E,v,'Either "url" or "tiles" is required.'))),Y){case"vector":case"raster":case"raster-dem":case"raster-array":return Z=Z.concat(an({key:E,value:v,valueSpec:D[`source_${Y.replace("-","_")}`],style:k.style,styleSpec:D,objectElementValidators:Er})),Z;case"geojson":if(Z=an({key:E,value:v,valueSpec:D.source_geojson,style:V,styleSpec:D,objectElementValidators:Er}),"cluster"in v&&"clusterProperties"in v){if(!o.l(v.clusterProperties))return[new Ne(`${E}.clusterProperties`,v,`object expected, ${o.n(v)} found`)];for(const ne in v.clusterProperties){const le=v.clusterProperties[ne];if(!Array.isArray(le))return[new Ne(`${E}.clusterProperties.${ne}`,le,"array expected")];const[fe,me]=le,Pe="string"==typeof fe?[fe,["accumulated"],["get",ne]]:fe;Z.push(...kt({key:`${E}.${ne}.map`,value:me,expressionContext:"cluster-map"})),Z.push(...kt({key:`${E}.${ne}.reduce`,value:Pe,expressionContext:"cluster-reduce"}))}}return Z;case"video":return an({key:E,value:v,valueSpec:D.source_video,style:V,styleSpec:D});case"image":return an({key:E,value:v,valueSpec:D.source_image,style:V,styleSpec:D});case"canvas":return[new Ne(E,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Sn({key:`${E}.type`,value:v.type,valueSpec:{values:Yr(D)}})}}function Yr(k){return k.source.reduce((v,E)=>{const D=k[E];return"enum"===D.type.type&&(v=v.concat(Object.keys(D.type.values||{}))),v},[])}function nt(k,v){const E=!k.includes("://");try{return new URL(k,E&&v?"http://example.com":void 0),true}catch(D){return false}}function Rr(k){const v=k.value;return v?o.H(v)?nt(v,true)?[]:[new Ne(k.key,v,`invalid url "${v}"`)]:[new Ne(k.key,v,`string expected, "${o.n(v)}" found`)]:[]}function Xr(k){const v=k.value,E=k.styleSpec,D=E.light,V=k.style;if(void 0===v)return[];if(!o.l(v))return[new Ne("light",v,`object expected, ${o.n(v)} found`)];let Y=[];for(const Z in v){const ne=Z.match(o.K),le=Z.match(o.U);Y=Y.concat(le&&D[le[1]]?Pt({key:Z,value:v[Z],valueSpec:{type:"string"},style:V,styleSpec:E}):ne&&D[ne[1]]&&D[ne[1]].transition?Pt({key:Z,value:v[Z],valueSpec:E.transition,style:V,styleSpec:E}):D[Z]?Pt({key:Z,value:v[Z],valueSpec:D[Z],style:V,styleSpec:E}):[new Ne(Z,v[Z],`unknown property "${Z}"`)])}return Y}function dr(k){const v=k.value;if(!v)return[];const E=k.key;if(!o.l(v))return[new Ne(E,v,`object expected, ${o.n(v)} found`)];let D=[];const V=k.styleSpec,Y=V["light-3d"],Z=k.style,ne=k.style.lights;for(const me of["type","id"])if(!(me in v))return D=D.concat([new Ne(E,v,`missing property "${me}"`)]),D;if(!o.H(v.type))return D=D.concat([new Ne(`${E}.type`,v.type,"string expected")]),D;if(ne)for(let me=0;me[],array:dt,boolean:function(k){const v=k.value,E=k.key;return o.G(v)?[]:[new Ne(E,v,`boolean expected, ${o.n(v)} found`)]},number:Oe,color:function({key:k,value:v}){return o.H(v)?void 0===o.C.parse(o.u(v))?[new Ne(k,v,`color expected, "${v}" found`)]:[]:[new Ne(k,v,`color expected, ${o.n(v)} found`)]},enum:Sn,filter:Kt,function:Wt,layer:Hr,object:an,source:vr,model:Rr,light:Xr,"light-3d":dr,terrain:rn,fog:St,string:Mr,formatted:function(k){return 0===Mr(k).length?[]:kt(k)},resolvedImage:function(k){return 0===Mr(k).length?[]:kt(k)},projection:function(k){const v=k.value,E=k.styleSpec,D=E.projection,V=k.style;if(o.l(v)){let Y=[];for(const Z in v)Y=Y.concat(Pt({key:Z,value:v[Z],valueSpec:D[Z],style:V,styleSpec:E}));return Y}return o.H(v)?[]:[new Ne("projection",v,`object or string expected, ${o.n(v)} found`)]},import:function(k){const v=k.key,{value:E,styleSpec:D}=k;if(!o.l(E))return[new Ne(v,E,"import must be an object")];const{data:V,...Y}=E;Object.defineProperty(Y,"__line__",{value:E.__line__,enumerable:false});let Z=an({...k,value:Y,valueSpec:D.import});""===o.u(Y.id)&&Z.push(new Ne(`${k.key}.id`,Y,"import id can't be an empty string"));const ne=o.u(Y.id);return"__proto__"!==ne&&"constructor"!==ne&&"prototype"!==ne||Z.push(new Ne(`${k.key}.id`,Y,`import id can't be "${String(ne)}"`)),V&&(Z=Z.concat(Cn(V,D,{key:`${k.key}.data`}))),Z},iconset:function(k){const v=k.value,E=k.key,D=k.styleSpec,V=k.style;if(!o.l(v))return[new Ne(E,v,"object expected")];if(!v.type)return[new Ne(E,v,'"type" is required')];const Y=o.u(v.type);let Z=[];if(Z=Z.concat(an({key:E,value:v,valueSpec:D[`iconset_${Y}`],style:V,styleSpec:D})),function(ne,le){return!("source"!==ne||!le.source)}(Y,v)){const ne=V.sources&&Object.hasOwn(V.sources,v.source)?V.sources[v.source]:void 0,le=ne&&o.u(ne.type);ne?"raster-array"!==le&&Z.push(new Ne(E,v.source,`iconset cannot be used with a source of type ${String(le)}, it only be used with a "raster-array" source type`)):Z.push(new Ne(E,v.source,`source "${v.source}" not found`))}return Z},option:function(k){const v=k.styleSpec,E=k.value,D=o.l(E)&&true===o.u(E.array)||!o.l(E)?void 0:o.u(E.type);return an({...k,valueSpec:v.option,objectElementValidators:D?{default:V=>Array.isArray(V.value)?Pt({...V,valueSpec:{...V.valueSpec,type:D}}):Pt(V)}:void 0})}};function Pt(k,v=false){const E=k.value,D=k.valueSpec,V=k.styleSpec;if(D.expression){if(o.M(o.u(E)))return Wt(k);if(o.x(o.y(E)))return kt(k)}if(D.type&&Ut[D.type]){const Y=Ut[D.type](k);return true===v&&Y.length>0&&Array.isArray(k.value)?kt(k):Y}return an({...k,valueSpec:D.type?V[D.type]:D})}function an(k){const v=k.key,E=k.value,D=k.valueSpec||{},V=k.objectElementValidators||{},Y=k.style,Z=k.styleSpec;if(!o.l(E))return[new Ne(v,E,`object expected, ${o.n(E)} found`)];let ne=[];for(const le in E){if(!Object.hasOwn(E,le))continue;const fe=le.split(".")[0],me=Object.hasOwn(D,fe),Pe=Object.hasOwn(D,"*"),Re=me?D[fe]:Pe?D["*"]:void 0;let Ke;Object.hasOwn(V,fe)?Ke=V[fe]:me?Ke=Pt:Object.hasOwn(V,"*")?Ke=V["*"]:Pe&&(Ke=Pt),Ke?ne=ne.concat(Ke({key:(v?`${v}.`:v)+le,value:E[le],valueSpec:Re,style:Y,styleSpec:Z,object:E,objectKey:le},E)):ne.push(new Ae(v,E[le],`unknown property "${le}"`))}for(const le in D){if(!Object.hasOwn(D,le))continue;if(Object.hasOwn(V,le))continue;const fe=D[le];!fe.required||void 0!==fe.default||Object.hasOwn(E,le)&&void 0!==E[le]||ne.push(new Ne(v,E,`missing required property "${le}"`))}return ne}function Xt({key:k,value:v}){const E=Mr({key:k,value:v});if(E.length)return E;const D=v;return D.includes("{fontstack}")||E.push(new Ne(k,v,'"glyphs" url must include a "{fontstack}" token')),D.includes("{range}")||E.push(new Ne(k,v,'"glyphs" url must include a "{range}" token')),E}function Cn(k,v=o.s,E={}){return an({key:E.key||"",value:k,valueSpec:{...v.$root,"*":{type:"*"}},styleSpec:v,style:k,objectElementValidators:{glyphs:Xt}})}function rr(k){return k.slice().sort((v,E)=>v.line&&E.line?v.line-E.line:0)}const hr="setStyle",Et="addLayer",Tn="removeLayer",ft="setPaintProperty",zt="setLayerProperty",Gt="setTerrain",gn="removeImport",Fn="addIconset",Tr="removeIconset";function Jr(k,v,E){E.push({command:"addSource",args:[k,v[k]]})}function jr(k,v,E){v.push({command:"removeSource",args:[k]}),E[k]=true}function sr(k,v,E,D){jr(k,E,D),Jr(k,v,E)}function bn(k,v,E){let D;for(D in k[E])if(Object.hasOwn(k[E],D)&&"data"!==D&&!o.O(k[E][D],v[E][D]))return false;for(D in v[E])if(Object.hasOwn(v[E],D)&&"data"!==D&&!o.O(k[E][D],v[E][D]))return false;return true}function ir(k,v,E,D,V,Y){let Z;for(Z in v=v||{},k=k||{})Object.hasOwn(k,Z)&&(o.O(k[Z],v[Z])||E.push({command:Y,args:[D,Z,v[Z],V]}));for(Z in v)Object.hasOwn(v,Z)&&!Object.hasOwn(k,Z)&&(o.O(k[Z],v[Z])||E.push({command:Y,args:[D,Z,v[Z],V]}))}function Jn(k){return k.id}function er(k,v){return k[v.id]=v,k}const Pr=new o.C(1,0,0,1),Vt=new o.C(0,1,0,1),di=new o.C(0,0,1,1),ln=new o.C(1,0,1,1),yi=new o.C(0,1,1,1);function yo(k,v,E,D,V,Y,Z){const ne=k.context,le=k.transform,fe=ne.gl,me="globe"===le.projection.name,Pe=me?["PROJECTION_GLOBE_VIEW"]:[];let Re=o.Q(E.projMatrix);if(me&&o.S(le.zoom)>0){const Wn=o.V(E.canonical,le),Yn=o.W(Wn);Re=o.X(new Float32Array(16),le.globeMatrix,Yn),o.X(Re,le.projMatrix,Re)}const Ke=o.Y();Ke[12]+=2*V/(o.e.devicePixelRatio*le.width),Ke[13]+=2*Y/(o.e.devicePixelRatio*le.height),o.X(Re,Ke,Re);const ot=k.getOrCreateProgram("debug",{defines:Pe}),at=v.getTileByID(E.key);k.terrain&&k.terrain.setupElevationDraw(at,ot);const xt=o.Z.disabled,vt=o._.disabled,It=k.colorModeForRenderPass(),jt="$debug";ne.activeTexture.set(fe.TEXTURE0),k.emptyTexture.bind(fe.LINEAR,fe.CLAMP_TO_EDGE),me?at._makeGlobeTileDebugBuffers(k.context,le):at._makeDebugTileBoundsBuffers(k.context,le.projection);const Zt=at._tileDebugBuffer||k.debugBuffer,kn=at._tileDebugIndexBuffer||k.debugIndexBuffer,cn=at._tileDebugSegments||k.debugSegments;if(ot.draw(k,fe.LINE_STRIP,xt,vt,It,o.$.disabled,o.a0(Re,D.toPremultipliedRenderColor(null)),jt,Zt,kn,cn,null,null,null,[at._globeTileDebugBorderBuffer]),Z){const Wn=at.latestRawTileData,Yn=Math.floor((Wn&&Wn.byteLength||0)/1024);let Vn=E.canonical.toString();E.overscaledZ!==E.canonical.z&&(Vn+=` => ${E.overscaledZ}`),Vn+=` ${at.state}`,Vn+=` ${Yn}kb`,function(Zr,Qn){Zr.initDebugOverlayCanvas();const kr=Zr.debugOverlayCanvas,Vr=Zr.context.gl,mi=Zr.debugOverlayCanvas.getContext("2d");mi.clearRect(0,0,kr.width,kr.height),mi.shadowColor="white",mi.shadowBlur=2,mi.lineWidth=1.5,mi.strokeStyle="white",mi.textBaseline="top",mi.font="bold 36px Open Sans, sans-serif",mi.fillText(Qn,5,5),mi.strokeText(Qn,5,5),Zr.debugOverlayTexture.update(kr),Zr.debugOverlayTexture.bind(Vr.LINEAR,Vr.CLAMP_TO_EDGE)}(k,Vn)}const hn=v.getTile(E).tileSize,xn=512/Math.min(hn,512)*(E.overscaledZ/le.zoom)*.5,wn=at._tileDebugTextBuffer||k.debugBuffer,Bn=at._tileDebugTextIndexBuffer||k.quadTriangleIndexBuffer,Kn=at._tileDebugTextSegments||k.debugSegments;ot.draw(k,fe.TRIANGLES,xt,vt,o.a1.alphaBlended,o.$.disabled,o.a0(Re,o.C.transparent.toPremultipliedRenderColor(null),xn),jt,wn,Bn,Kn,null,null,null,[at._globeTileDebugTextBuffer])}function Pa(k,v,E,D){ds(k,0,v+E/2,k.transform.width,E,D)}function Ms(k,v,E,D){ds(k,v-E/2,0,E,k.transform.height,D)}function ds(k,v,E,D,V,Y){const Z=k.context,ne=Z.gl;ne.enable(ne.SCISSOR_TEST),ne.scissor(v*o.e.devicePixelRatio,E*o.e.devicePixelRatio,D*o.e.devicePixelRatio,V*o.e.devicePixelRatio),Z.clear({color:Y}),ne.disable(ne.SCISSOR_TEST)}function st(k,v,E){const D=k.context,V=D.gl,Y=E.projMatrix,Z=k.getOrCreateProgram("debug"),ne=v.getTileByID(E.key);k.terrain&&k.terrain.setupElevationDraw(ne,Z);const le=o.Z.disabled,fe=o._.disabled,me=k.colorModeForRenderPass(),Pe="$debug";D.activeTexture.set(V.TEXTURE0),k.emptyTexture.bind(V.LINEAR,V.CLAMP_TO_EDGE);const Re=ne.queryGeometryDebugViz,Ke=ne.queryBoundsDebugViz;if(Re&&Re.vertices.length>0){Re.lazyUpload(D);const ot=Re.vertexBuffer,at=Re.indexBuffer,xt=Re.segments;null!=ot&&null!=at&&null!=xt&&Z.draw(k,V.LINE_STRIP,le,fe,me,o.$.disabled,o.a0(Y,Re.color.toPremultipliedRenderColor(null)),Pe,ot,at,xt)}if(Ke&&Ke.vertices.length>0){Ke.lazyUpload(D);const ot=Ke.vertexBuffer,at=Ke.indexBuffer,xt=Ke.segments;null!=ot&&null!=at&&null!=xt&&Z.draw(k,V.LINE_STRIP,le,fe,me,o.$.disabled,o.a0(Y,Ke.color.toPremultipliedRenderColor(null)),Pe,ot,at,xt)}}const en=(k,v,E,D,V,Y,Z,ne)=>{const le=o.a2/Y.tileSize;return{u_matrix:k,u_inv_rot_matrix:v,u_camera_to_center_distance:E.getCameraToCenterDistance(ne),u_extrude_scale:[E.pixelsToGLUnits[0]/le,E.pixelsToGLUnits[1]/le],u_zoom_transition:D,u_tile_id:Z,u_merc_center:V}},yn=(k,v,E,D)=>({u_matrix:k,u_inv_matrix:v,u_camera_to_center_distance:E.getCameraToCenterDistance(D),u_viewport_size:[E.width,E.height]});function jn(k,v,E){const D=v.createTileMatrix(k,k.worldSize,E.toUnwrapped());return o.X(new Float32Array(16),k.projMatrix,D)}function xr(k,v,E){if(v.projection.name===E.projection.name)return k.projMatrix;const D=E.clone();return D.setProjection(v.projection),jn(D,v.getProjection(),k)}function wr(k,v,E){return v.name===E.projection.name?k.projMatrix:jn(E,v,k)}let Dr;const Pn={loaded:true,validateStyle:function(k,v=o.s){return rr(Cn(k,v))},validateSource:k=>rr(vr(k)),validateLight:k=>rr(Xr(k)),validateLights:k=>rr(dr(k)),validateTerrain:k=>rr(rn(k)),validateFog:k=>rr(St(k)),validateSnow:k=>rr(function(v){const E=v.value,D=v.style,V=v.styleSpec,Y=V.snow;if(void 0===E)return[];if(!o.l(E))return[new Ne("snow",E,`object expected, ${o.n(E)} found`)];let Z=[];for(const ne in E){const le=ne.match(o.K);Z=Z.concat(le&&Y[le[1]]&&Y[le[1]].transition?Pt({key:ne,value:E[ne],valueSpec:V.transition,style:D,styleSpec:V}):Y[ne]?Pt({key:ne,value:E[ne],valueSpec:Y[ne],style:D,styleSpec:V}):[new Ae(ne,E[ne],`unknown property "${ne}"`)])}return Z}(k)),validateRain:k=>rr(function(v){const E=v.value,D=v.style,V=v.styleSpec,Y=V.rain;if(void 0===E)return[];if(!o.l(E))return[new Ne("rain",E,`object expected, ${o.n(E)} found`)];let Z=[];for(const ne in E){const le=ne.match(o.K);Z=Z.concat(le&&Y[le[1]]&&Y[le[1]].transition?Pt({key:ne,value:E[ne],valueSpec:V.transition,style:D,styleSpec:V}):Y[ne]?Pt({key:ne,value:E[ne],valueSpec:Y[ne],style:D,styleSpec:V}):[new Ae(ne,E[ne],`unknown property "${ne}"`)])}return Z}(k)),validateLayer:k=>rr(Hr(k)),validateFilter:k=>rr(Kt(k)),validatePaintProperty:k=>rr(on(k)),validateLayoutProperty:k=>rr(cr(k)),validateModel:k=>rr(Rr(k)),diffStyles:function(k,v){if(!k)return[{command:hr,args:[v]}];let E=[];try{if(!o.O(k.version,v.version))return[{command:hr,args:[v]}];if(o.O(k.center,v.center)||E.push({command:"setCenter",args:[v.center]}),o.O(k.zoom,v.zoom)||E.push({command:"setZoom",args:[v.zoom]}),o.O(k.bearing,v.bearing)||E.push({command:"setBearing",args:[v.bearing]}),o.O(k.pitch,v.pitch)||E.push({command:"setPitch",args:[v.pitch]}),o.O(k.sprite,v.sprite)||E.push({command:"setSprite",args:[v.sprite]}),o.O(k.glyphs,v.glyphs)||E.push({command:"setGlyphs",args:[v.glyphs]}),o.O(k.imports,v.imports)||function(ne=[],le=[],fe){le=le||[];const me=(ne=ne||[]).map(Jn),Pe=le.map(Jn),Re=ne.reduce(er,{}),Ke=le.reduce(er,{}),ot=me.slice();let at,xt,vt,It;for(at=0,xt=0;at{ne.source&&D[ne.source]?E.push({command:Tn,args:[ne.id]}):Y.push(ne)});let Z=k.terrain;Z&&D[Z.source]&&(E.push({command:Gt,args:[void 0]}),Z=void 0),E=E.concat(V),o.O(Z,v.terrain)||E.push({command:Gt,args:[v.terrain]}),function(ne,le,fe){le=le||[];const me=(ne=ne||[]).map(Jn),Pe=le.map(Jn),Re=ne.reduce(er,{}),Ke=le.reduce(er,{}),ot=me.slice(),at=Object.create(null);let xt,vt,It,jt,Zt,kn,cn;for(xt=0,vt=0;xt0){const ci=o.Y(),Ri=Wr;o.a9(ci,Kn.placementInvProjMatrix,fe.glCoordMatrix),o.a9(ci,ci,Kn.placementViewportMatrix),xt.push({circleArray:ii,circleOffset:It,transform:Ri,invTransform:ci,projection:Kn.getProjection()}),vt+=ii.length/4,It=vt}if(!Lr)continue;k.terrain&&k.terrain.setupElevationDraw(Bn,qi);const Di=si?[wn.canonical.x,wn.canonical.y,1<{const E=Pn[k];return E?E(...v):[]}}const Ur=nr("validateStyle"),bi=nr("validateSource"),$i=nr("validateLight"),Zi=nr("validateLights"),Fo=nr("validateTerrain"),Ao=nr("validateFog"),Ho=nr("validateSnow"),Ia=nr("validateRain"),ba=nr("validateLayer"),ut=nr("validateFilter"),ke=nr("validatePaintProperty"),je=nr("validateLayoutProperty"),gt=nr("validateModel"),Rt=o.s.light;let Ct;class Mt extends o.E{constructor(v,E="flat"){super(),this._transitionable=new o.ae(Ct||(Ct=new o.af({anchor:new o.ag(Rt.anchor),position:new o.ah(Rt.position),color:new o.ag(Rt.color),intensity:new o.ag(Rt.intensity)}))),this.setLight(v,E),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(v,E,D={}){this._validate($i,v,D)||(this._transitionable.setTransitionOrValue(v),this.id=E)}updateTransitions(v){this._transitioning=this._transitionable.transitioned(v,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(v){this.properties=this._transitioning.possiblyEvaluate(v)}_validate(v,E,D){return(!D||false!==D.validate)&&Nn(this,v.call(Ur,{value:E,style:{glyphs:true,sprite:true},styleSpec:o.s}))}}const Ft=o.s.terrain;let Dt=class extends o.E{constructor(k,v,E,D,V){super(),this.scope=E,this._transitionable=new o.ae(new o.af({source:new o.ag(Ft.source),exaggeration:new o.ag(Ft.exaggeration)}),E,D),this._transitionable.setTransitionOrValue(k,D),this._transitioning=this._transitionable.untransitioned(),this.drapeRenderMode=v,this.worldview=V}get(){return this._transitionable.serialize()}set(k,v){this._transitionable.setTransitionOrValue(k,v)}updateTransitions(k){this._transitioning=this._transitionable.transitioned(k,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(k){this.properties=this._transitioning.possiblyEvaluate(k)}getExaggeration(k){return this._transitioning.possiblyEvaluate(new o.ai(k,{worldview:this.worldview})).get("exaggeration")}getAttenuationRange(){if(!this.isZoomDependent())return null;const k=this._transitionable._values.exaggeration;if(!k)return null;const v=k.value.expression;if(!v)return null;let E=-1,D=-1,V=1;for(const Y of v.zoomStops)V=v.evaluate(new o.ai(Y,{worldview:this.worldview})),V>.01?(E=Y,D=-1):D=Y;return V<.01&&E>0&&D>E?[E,D]:null}isZoomDependent(){const k=this._transitionable._values.exaggeration;return null!=k&&null!=k.value&&null!=k.value.expression&&k.value.expression instanceof o.aj}};function Qt(k,v){const E=k?k.terrain:null;return!!E&&(!v||!!v.projection.requiresDraping||!E.isZoomDependent()||E.getExaggeration(v.zoom)>0)}const fn=o.s.fog;class vn extends o.E{constructor(v,E,D,V){super();const Y=new o.af({range:new o.ag(fn.range),color:new o.ag(fn.color),"color-use-theme":new o.ag({type:"string","property-type":"data-constant",default:"default"}),"high-color":new o.ag(fn["high-color"]),"high-color-use-theme":new o.ag({type:"string","property-type":"data-constant",default:"default"}),"space-color":new o.ag(fn["space-color"]),"space-color-use-theme":new o.ag({type:"string","property-type":"data-constant",default:"default"}),"horizon-blend":new o.ag(fn["horizon-blend"]),"star-intensity":new o.ag(fn["star-intensity"]),"vertical-range":new o.ag(fn["vertical-range"])});this._transitionable=new o.ae(Y,D,V),this.set(v,V),this._transitioning=this._transitionable.untransitioned(),this._transform=E,this.properties=new o.ak(Y),this.scope=D}get state(){const v=this._transform,E="globe"===v.projection.name,D=o.S(v.zoom),V=this.properties.get("range"),Y=[2,4.5],Z=.5/Math.tan(.5*v._fov),ne=[V[0]+Z,V[1]+Z];return{range:E?[o.al(Y[0],ne[0],D),o.al(Y[1],ne[1],D)]:ne,horizonBlend:this.properties.get("horizon-blend"),alpha:this.properties.get("color").a}}get(){return this._transitionable.serialize()}set(v,E,D={}){if(this._validate(Ao,v,D))return;const V={...v};for(const Y of Object.keys(fn))void 0===V[Y]&&(V[Y]=fn[Y].default);this._options=V,this._transitionable.setTransitionOrValue(this._options,E)}getOpacity(v){if(!this._transform.projection.supportsFog)return 0;const E=this.properties&&this.properties.get("color")||1;return("globe"===this._transform.projection.name?1:o.am(o.ao,o.an,v))*E.a}getOpacityAtLatLng(v,E){return this._transform.projection.supportsFog?o.ap(this.state,v,E):0}getOpacityForTile(v){if(!this._transform.projection.supportsFog)return[1,1];const E=this._transform.calculateFogTileMatrix(v.toUnwrapped());return o.aq(this.state,E,0,0,o.a2,o.a2,this._transform)}getOpacityForBounds(v,E,D,V,Y){return this._transform.projection.supportsFog?o.aq(this.state,v,E,D,V,Y,this._transform):[1,1]}getRangeForProjection(){return this._transform.projection.supportsFog?this.state.range:[0,1]}isVisibleOnFrustum(v){if(!this._transform.projection.supportsFog)return false;const E=[4,5,6,7];for(const D of E){const V=v.points[D];let Y;if(V[2]>=0)Y=V;else{const Z=v.points[D-4];Y=o.ar(Z,V,Z[2]/(Z[2]-V[2]))}if(o.as(this.state,Y[0],Y[1],0,this._transform)>=o.at)return true}return false}updateConfig(v){this._transitionable.setTransitionOrValue(this._options,v)}updateTransitions(v){this._transitioning=this._transitionable.transitioned(v,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(v){this.properties=this._transitioning.possiblyEvaluate(v)}_validate(v,E,D){return(!D||false!==D.validate)&&Nn(this,v.call(Ur,{value:E,style:{glyphs:true,sprite:true},styleSpec:o.s}))}}let On,tr,ar=class extends o.E{constructor(k,v,E,D){super();const V=On||(On=new o.af({density:new o.ag(o.s.snow.density),intensity:new o.ag(o.s.snow.intensity),color:new o.ag(o.s.snow.color),opacity:new o.ag(o.s.snow.opacity),vignette:new o.ag(o.s.snow.vignette),"vignette-color":new o.ag(o.s.snow["vignette-color"]),"center-thinning":new o.ag(o.s.snow["center-thinning"]),direction:new o.ag(o.s.snow.direction),"flake-size":new o.ag(o.s.snow["flake-size"])}));this._transitionable=new o.ae(V,E,D),this.set(k,D),this._transitioning=this._transitionable.untransitioned(),this.properties=new o.ak(V),this.scope=E}get state(){const k=this.properties.get("opacity"),v=this.properties.get("color"),E=this.properties.get("direction"),D=o.au(E[0]),V=-Math.max(o.au(E[1]),.01),Y=[Math.cos(D)*Math.cos(V),Math.sin(D)*Math.cos(V),Math.sin(V)],Z=this.properties.get("vignette"),ne=this.properties.get("vignette-color"),le=new o.C(ne.r,ne.g,ne.b,Z);return{density:this.properties.get("density"),intensity:this.properties.get("intensity"),color:new o.C(v.r,v.g,v.b,v.a*k),direction:Y,centerThinning:this.properties.get("center-thinning"),flakeSize:this.properties.get("flake-size"),vignetteColor:le}}get(){return this._transitionable.serialize()}set(k,v,E={}){if(this._validate(Ho,k,E))return;const D={...k},V=o.s.snow;for(const Y of Object.keys(V))void 0===D[Y]&&(D[Y]=V[Y].default);this._options=D,this._transitionable.setTransitionOrValue(this._options,v)}updateConfig(k){this._transitionable.setTransitionOrValue(this._options,k)}updateTransitions(k){this._transitioning=this._transitionable.transitioned(k,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(k){this.properties=this._transitioning.possiblyEvaluate(k)}_validate(k,v,E){return(!E||false!==E.validate)&&Nn(this,k.call(Ur,{value:v,style:{glyphs:true,sprite:true},styleSpec:o.s}))}},oi=class extends o.E{constructor(k,v,E,D){super();const V=tr||(tr=new o.af({density:new o.ag(o.s.rain.density),intensity:new o.ag(o.s.rain.intensity),color:new o.ag(o.s.rain.color),opacity:new o.ag(o.s.rain.opacity),vignette:new o.ag(o.s.rain.vignette),"vignette-color":new o.ag(o.s.rain["vignette-color"]),"center-thinning":new o.ag(o.s.rain["center-thinning"]),direction:new o.ag(o.s.rain.direction),"droplet-size":new o.ag(o.s.rain["droplet-size"]),"distortion-strength":new o.ag(o.s.rain["distortion-strength"])}));this._transitionable=new o.ae(V,E,D),this.set(k,D),this._transitioning=this._transitionable.untransitioned(),this.properties=new o.ak(V),this.scope=E}get state(){const k=this.properties.get("opacity"),v=this.properties.get("color"),E=this.properties.get("direction"),D=o.au(E[0]),V=-Math.max(o.au(E[1]),.01),Y=[Math.cos(D)*Math.cos(V),Math.sin(D)*Math.cos(V),Math.sin(V)],Z=this.properties.get("vignette-color"),ne=new o.C(Z.r,Z.g,Z.b,this.properties.get("vignette"));return{density:this.properties.get("density"),intensity:this.properties.get("intensity"),color:new o.C(v.r,v.g,v.b,v.a*k),direction:Y,centerThinning:this.properties.get("center-thinning"),dropletSize:this.properties.get("droplet-size"),distortionStrength:this.properties.get("distortion-strength"),vignetteColor:ne}}get(){return this._transitionable.serialize()}set(k,v,E={}){if(this._validate(Ia,k,E))return;const D={...k},V=o.s.rain;for(const Y of Object.keys(V))void 0===D[Y]&&(D[Y]=V[Y].default);this._options=D,this._transitionable.setTransitionOrValue(this._options,v)}updateConfig(k){this._transitionable.setTransitionOrValue(this._options,k)}updateTransitions(k){this._transitioning=this._transitionable.transitioned(k,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(k){this.properties=this._transitioning.possiblyEvaluate(k)}_validate(k,v,E){return(!E||false!==E.validate)&&Nn(this,k.call(Ur,{value:v,style:{glyphs:true,sprite:true},styleSpec:o.s}))}};const ei={workerUrl:"",workerClass:null,workerParams:void 0};function Ar(k){return null!=ei.workerClass?new ei.workerClass:new self.Worker(ei.workerUrl,{name:k,type:"module",...ei.workerParams})}const pi="mapboxgl_preloaded_worker_pool";class Qr{constructor(v){this.active={},this.name=v}acquire(v,E=Qr.workerCount){if(!this.workers)for(this.workers=[];this.workers.length{E.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[pi]}numActive(){return Object.keys(this.active).length}}Qr.workerCount=2;class wi{constructor(v,E,D="Worker",V=Qr.workerCount){this.workerPool=v,this.actors=[],this.currentActor=0,this.id=o.av();const Y=this.workerPool.acquire(this.id,V);for(let Z=0;Z{this.ready=true}).catch(()=>{})}send(v,E,D){return Promise.all(this.actors.map(V=>V.send(v,E,D)))}broadcast(v,E){for(const D of this.actors)D.notify(v,E)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach(v=>{v.remove()}),this.actors=[],this.workerPool.release(this.id)}}wi.Actor=o.aw;class Li extends o.E{constructor(v,E,D,V){super(),this.scope=D,this._options=v,this.properties=new o.ak(E),this._transitionable=new o.ae(E,D,V),this._transitionable.setTransitionOrValue(v.properties),this._transitioning=this._transitionable.untransitioned()}updateConfig(v){this._transitionable.setTransitionOrValue(this._options.properties,v)}updateTransitions(v){this._transitioning=this._transitionable.transitioned(v,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(v){this.properties=this._transitioning.possiblyEvaluate(v)}get(){return this._options.properties=this._transitionable.serialize(),this._options}set(v,E){this._options=v,this._transitionable.setTransitionOrValue(v.properties,E)}shadowsEnabled(){return!!this.properties&&true===this.properties.get("cast-shadows")}}let ao;const Mo=()=>ao||(ao=new o.af({color:new o.ag(o.s.properties_light_ambient.color),"color-use-theme":new o.ag({type:"string",default:"default","property-type":"data-constant"}),intensity:new o.ag(o.s.properties_light_ambient.intensity)}));let fo;const fs=()=>fo||(fo=new o.af({direction:new o.ax(o.s.properties_light_directional.direction),color:new o.ag(o.s.properties_light_directional.color),"color-use-theme":new o.ag({type:"string",default:"default","property-type":"data-constant"}),intensity:new o.ag(o.s.properties_light_directional.intensity),"cast-shadows":new o.ag(o.s.properties_light_directional["cast-shadows"]),"shadow-quality":new o.ag(o.s.properties_light_directional["shadow-quality"]),"shadow-intensity":new o.ag(o.s.properties_light_directional["shadow-intensity"]),"shadow-draw-before-layer":new o.ag(o.s.properties_light_directional["shadow-draw-before-layer"])})),Ga=(k,v,E,D,V,Y,Z,ne,le,fe=[0,0,1])=>({u_matrix:k,u_normal_matrix:v,u_opacity:E,u_faux_facade_ao_intensity:D,u_camera_pos:V,u_tile_to_meter:Y,u_facade_emissive_chance:Z,u_flood_light_color:ne,u_flood_light_intensity:le,u_front_cutoff_params:fe}),ea=k=>({u_matrix:k}),ha=k=>({u_matrix:k}),bo=o.ay;async function aa(){return Promise.resolve()}function Ts(k,v,E,D,V,Y,Z,ne){E.resetLayerRenderingStats(k);const le=k.context,fe=le.gl,me=k.transform,Pe=E.paint.get("fill-extrusion-pattern"),Re=E.paint.get("fill-extrusion-pattern-cross-fade"),Ke=Pe.constantOr(null),ot=Pe.constantOr(1),at=E.paint.get("fill-extrusion-opacity"),xt=k.style.enable3dLights(),vt=E.paint.get(xt&&!ot?"fill-extrusion-ambient-occlusion-wall-radius":"fill-extrusion-ambient-occlusion-radius"),It=[E.paint.get("fill-extrusion-ambient-occlusion-intensity"),vt],jt=E.layout.get("fill-extrusion-edge-radius"),Zt=jt>0&&!E.paint.get("fill-extrusion-rounded-roof"),kn=Zt?0:jt,cn="globe"===me.projection.name?o.aD():0,hn="globe"===me.projection.name,xn=hn?o.S(me.zoom):0,wn=[o.a7(me.center.lng),o.a8(me.center.lat)],Bn="none"===E.paint.get("fill-extrusion-flood-light-color-use-theme").constantOr("default"),Kn=E.paint.get("fill-extrusion-flood-light-color").toNonPremultipliedRenderColor(Bn?null:E.lut).toArray01().slice(0,3),Wn=E.paint.get("fill-extrusion-flood-light-intensity"),Yn=E.paint.get("fill-extrusion-vertical-scale"),Vn=0!==E.paint.get("fill-extrusion-line-width").constantOr(1),Zr=E.paint.get("fill-extrusion-height-alignment"),Qn=E.paint.get("fill-extrusion-base-alignment"),kr=o.aE(k,E.paint.get("fill-extrusion-cutoff-fade-range")),Vr=E.paint.get("fill-extrusion-front-cutoff"),mi=Qa(me.pitch,Vr,!!k.terrain),si=mi[2]<1;si&&(k.maxFrontCutoffRawStart=Math.max(k.maxFrontCutoffRawStart,Vr[0]));const Kr=[];let qi;hn&&Kr.push("PROJECTION_GLOBE_VIEW"),It[0]>0&&Kr.push("FAUX_AO"),Zt&&Kr.push("ZERO_ROOF_RADIUS"),ne&&Kr.push("HAS_CENTROID"),Wn>0&&Kr.push("FLOOD_LIGHT"),kr.shouldRenderCutoff&&Kr.push("RENDER_CUTOFF"),si&&Kr.push("RENDER_FRONT_CUTOFF"),Vn&&Kr.push("RENDER_WALL_MODE");const Wr="shadow"===k.renderPass,Lr=k.shadowRenderer,ii=Wr&&!!Lr,Di=Wr?o.$.disabled:o.$.backCCW;k.shadowRenderer&&(k.shadowRenderer.useNormalOffset=true);let ci=[0,0,0];if(Lr){const Go=k.style.directionalLight,po=k.style.ambientLight;Go&&po&&(ci=o.aF(k.style,Go,po)),Wr||(Kr.push("RENDER_SHADOWS"),Lr.useNormalOffset&&Kr.push("NORMAL_OFFSET")),qi=Kr.concat(["SHADOWS_SINGLE_CASCADE"])}const Ri=ii?"fillExtrusionDepth":ot?"fillExtrusionPattern":"fillExtrusion",ji=E.getLayerRenderingStats();for(const Go of D){const po=v.getTile(Go),Oa=po.getBucket(E);if(!Oa||Oa.projection.name!==me.projection.name)continue;let Js=false;Lr&&(Js=0===Lr.getMaxCascadeForTile(Go.toUnwrapped()));const ws=k.isTileAffectedByFog(Go),ta=Oa.programConfigurations.get(E.id);let xo=false;if(Ke&&po.imageAtlas){const hs=po.imageAtlas,au=o.aG.from(Ke),su=au.getPrimary().scaleSelf(o.e.devicePixelRatio).toString(),ul=au.getSecondary(),Es=hs.patternPositions.get(su),Fc=ul?hs.patternPositions.get(ul.scaleSelf(o.e.devicePixelRatio).toString()):null;xo=!!Es&&!!Fc,Es&&ta.setConstantPatternPositions(Es,Fc)}Re>0&&(xo||ta.getPatternTransitionVertexBuffer("fill-extrusion-pattern"))&&Kr.push("FILL_EXTRUSION_PATTERN_TRANSITION");const Qs=k.getOrCreateProgram(Ri,{config:ta,defines:Js?qi:Kr,overrideFog:ws});if(k.terrain&&k.terrain.setupElevationDraw(po,Qs,{useMeterToDem:true}),!Oa.centroidVertexBuffer){const hs=Qs.getAttributeLocation(fe,"a_centroid_pos");-1!==hs&&fe.vertexAttribI4ui(hs,0,0,0,0)}!Wr&&Lr&&Lr.setupShadows(po.tileID.toUnwrapped(),Qs,"vector-tile"),ot&&(k.context.activeTexture.set(fe.TEXTURE0),po.imageAtlasTexture&&po.imageAtlasTexture.bind(fe.LINEAR,fe.CLAMP_TO_EDGE),ta.updatePaintBuffers());const lc=E.paint.get("fill-extrusion-vertical-gradient"),$l=1/Oa.tileToMeter;let la;if(Wr&&Lr){if(Zs(po.tileID,Oa.maxHeight,k))continue;const hs=Lr.calculateShadowPassMatrixFromTile(po.tileID.toUnwrapped());la=o.aM(hs,kn,$l,Yn,Zr,Qn)}else{const hs=k.translatePosMatrix(Go.expandedProjMatrix,po,E.paint.get("fill-extrusion-translate"),E.paint.get("fill-extrusion-translate-anchor")),au=me.projection.createInversionMatrix(me,Go.canonical),su=Qs.fixedDefines.includes("LIGHTING_3D_MODE");la=ot?o.aH(hs,k,lc,at,It,kn,$l,Go,po,cn,Zr,Qn,xn,wn,au,Kn,Yn,Re,su):o.aI(hs,k,lc,at,It,kn,$l,Go,cn,Zr,Qn,xn,wn,au,Kn,Yn,Wn,ci,mi,su)}k.uploadCommonUniforms(le,Qs,Go.toUnwrapped(),null,kr);let cl=Oa.segments;if("mercator"===me.projection.name&&!Wr&&(cl=Oa.getVisibleSegments(po.tileID,k.terrain,k.transform.getFrustum(0)),!cl.get().length))continue;if(ji)if(Wr)for(const hs of cl.get())ji.numRenderedVerticesInShadowPass+=hs.primitiveLength;else for(const hs of cl.get())ji.numRenderedVerticesInTransparentPass+=hs.primitiveLength;const Fs=[];(k.terrain||ne)&&Fs.push(Oa.centroidVertexBuffer),hn&&Fs.push(Oa.layoutVertexExtBuffer),Vn&&Fs.push(Oa.wallVertexBuffer),Qs.draw(k,le.gl.TRIANGLES,V,Y,Z,Di,la,E.id,Oa.layoutVertexBuffer,Oa.indexBuffer,cl,E.paint,k.transform.zoom,ta,Fs)}k.shadowRenderer&&(k.shadowRenderer.useNormalOffset=false)}class Xo{constructor(){this.translate=[0,0],this.translateAnchor="map",this.edgeRadius=0,this.cutoffFadeRange=0}}function Qa(k,v,E){if(!(v[2]<1)||E)return[0,0,1];const D=180*k/Math.PI;if(D<15)return[-.5,v[1],v[2]];const V=Math.min(1,Math.max(0,(D-15)/5)),Y=V*V*(3-2*V);return[-.5*(1-Y)+v[0]*Y,v[1],v[2]]}function xu(k,v,E,D,V,Y,Z){0===D.centroidVertexArray.length&&D.createCentroidsBuffer();const ne=Y?Y.findDEMTileFor(E):null;if(!(ne&&ne.dem||Z))return;Y&&ne&&ne.dem&&D.selfDEMTileTimestamp!==ne.dem._timestamp&&(D.borderDoneWithNeighborZ=[-1,-1,-1,-1],D.selfDEMTileTimestamp=ne.dem._timestamp);const le=(vt,It)=>{(vt.flags|It.flags)&o.aJ?(vt.flags|=o.aJ,It.flags|=o.aJ):(vt.flags&=~o.aJ,It.flags&=~o.aJ)},fe=vt=>new o.P(Math.ceil((vt+o.aK)*o.aL),0),me=(vt,It,jt)=>{const Zt=Math.ceil((vt+o.aK)*o.aL),kn=Math.floor(Math.max(0,Math.min(o.a2-1,jt))/4);return new o.P(Zt,kn<<5|(3&It)<<3|7)},Pe=vt=>{const It=v.getSource().minzoom,jt=kn=>{const cn=v.getTileByID(kn);if(cn&&cn.hasData())return cn.getBucket(V)},Zt=[0,-1,1];for(const kn of Zt){if(vt.overscaledZ+kn(Re[0]=Math.min(vt.min.y,It.min.y),Re[1]=Math.max(vt.max.y,It.max.y),Re[2]=o.a2-It.min.x>vt.max.x?It.min.x-o.a2:vt.max.x,Re),ot=(vt,It)=>(Re[0]=Math.min(vt.min.x,It.min.x),Re[1]=Math.max(vt.max.x,It.max.x),Re[2]=o.a2-It.min.y>vt.max.y?It.min.y-o.a2:vt.max.y,Re),at=[(vt,It)=>Ke(vt,It),(vt,It)=>Ke(It,vt),(vt,It)=>ot(vt,It),(vt,It)=>ot(It,vt)],xt=(vt,It,jt,Zt,kn,cn,hn)=>{if(!Y)return 0;const xn=[[cn?jt:vt,cn?vt:jt,0],[cn?jt:It,cn?It:jt,0]],wn=hn<0?o.a2+hn:hn,Bn=[cn?wn:(vt+It)/2,cn?(vt+It)/2:wn,0];return 0===jt&&hn<0||0!==jt&&hn>0?Y.getForTilePoints(kn,[Bn],true,Zt):xn.push(Bn),Y.getForTilePoints(E,xn,true,ne),Math.max(xn[0][2],xn[1][2],Bn[2])/Y.exaggeration()};for(let vt=0;vt<4;vt++){const It=D.borderFeatureIndices[vt];if(0===It.length)continue;const jt=o.aB[vt](E),Zt=Pe(jt);if(!(Zt&&Zt instanceof o.aC))continue;const kn=Y?Y.findDEMTileFor(jt):null;if(!(kn&&kn.dem||Z))continue;if(Y&&kn&&kn.dem&&D.borderDEMTileTimestamp[vt]!==kn.dem._timestamp&&(D.borderDoneWithNeighborZ[vt]=-1,D.borderDEMTileTimestamp[vt]=kn.dem._timestamp),D.borderDoneWithNeighborZ[vt]===Zt.canonical.z)continue;0===Zt.centroidVertexArray.length&&Zt.createCentroidsBuffer();const cn=(vt<2?1:5)-vt,hn=Zt.borderDoneWithNeighborZ[cn]!==D.canonical.z,xn=Zt.borderFeatureIndices[cn];let wn=0;if(D.canonical.z!==Zt.canonical.z){for(const Yn of It)D.showCentroid(D.featuresOnBorder[Yn]);if(hn)for(const Yn of xn)Zt.showCentroid(Zt.featuresOnBorder[Yn]);D.borderDoneWithNeighborZ[vt]=Zt.canonical.z,Zt.borderDoneWithNeighborZ[cn]=D.canonical.z;continue}const Bn=new Map,Kn=new Set,Wn=new Set;for(let Yn=0;Yn1||kr.intersectsCount()>1;{let Wr=0;if(kn&&kn.dem&&!qi){const Lr=at[vt](Zr,Vr),ii=vt%2?o.a2-1:0;Wr=xt(Lr[0],Math.min(o.a2-1,Lr[1]),ii,kn,jt,vt<2,Lr[2])}Zr.centroidXY=me(Wr,vt,Kr),Vr.centroidXY=me(Wr,cn,Kr)}if(D.writeCentroidToBuffer(Zr),Zt.writeCentroidToBuffer(Vr),void 0!==Vn.buildingId){for(const Wr of D.centroidData)Wr.buildingId===Vn.buildingId&&Wr!==Zr&&(Wr.centroidXY=Zr.centroidXY,D.writeCentroidToBuffer(Wr));for(const Wr of Zt.centroidData)Wr.buildingId===Vn.buildingId&&Wr!==Vr&&(Wr.centroidXY=Vr.centroidXY,Zt.writeCentroidToBuffer(Wr))}}for(const Yn of It){if(Kn.has(Yn))continue;const Vn=D.featuresOnBorder[Yn],Zr=D.centroidData.get(Vn.centroidDataIndex),Qn=Vn.borders[vt];let kr;for(;wnQn[0]+3||Vr[0]>Qn[0]-3)break;Zt.showCentroid(kr),wn++}if(kr&&wnQn[1]-3)break;if(mi++,++wn===xn.length)break;kr=Zt.featuresOnBorder[xn[wn]]}for(;Vr=xn.length){D.showCentroid(Vn);continue}kr=Zt.featuresOnBorder[xn[Vr]];let si=false;if(mi>=1){const Wr=kr.borders[cn];Math.abs(Qn[0]-Wr[0])<3&&Math.abs(Qn[1]-Wr[1])<3&&(mi=1,si=true,wn=Vr+1)}else if(0===mi){D.showCentroid(Vn);continue}const Kr=Zt.centroidData.get(kr.centroidDataIndex);Z&&si&&le(Zr,Kr);const qi=Vn.intersectsCount()>1||kr.intersectsCount()>1;if(mi>1)wn=Vr,Zr.centroidXY=Kr.centroidXY=new o.P(0,0);else if(kn&&kn.dem&&!qi){const Wr=at[vt](Zr,Kr),Lr=vt%2?o.a2-1:0,ii=xt(Wr[0],Math.min(o.a2-1,Wr[1]),Lr,kn,jt,vt<2,Wr[2]);Zr.centroidXY=Kr.centroidXY=fe(ii)}else qi?Zr.centroidXY=Kr.centroidXY=new o.P(0,0):(Zr.centroidXY=D.encodeBorderCentroid(Vn),Kr.centroidXY=Zt.encodeBorderCentroid(kr));D.writeCentroidToBuffer(Zr),Zt.writeCentroidToBuffer(Kr)}else D.showCentroid(Vn)}D.borderDoneWithNeighborZ[vt]=Zt.canonical.z,Zt.borderDoneWithNeighborZ[cn]=D.canonical.z}(D.needsCentroidUpdate||!D.centroidVertexBuffer&&0!==D.centroidVertexArray.length)&&D.uploadCentroid(k)}const es=[1,0,0],sc=[0,1,0],Ul=[0,0,1];function Zs(k,v,E){const D=E.transform,V=E.shadowRenderer;if(!V)return true;const Y=E.frameCounter,Z=E.currentShadowCascade;let ne=E._shadowCullCache;if(!ne||ne.frame!==Y||ne.cascade!==Z){const vt=D.tileSize*V._cascades[Z].scale,It=D.scaleZoom(vt),jt=V.shadowDirection,Zt=[jt[0],jt[1],-jt[2]],kn=[es,sc,Ul,Zt,[Zt[0],0,Zt[2]],[0,Zt[1],Zt[2]]];ne={frame:Y,cascade:Z,cameraFrustum:o.az.fromInvProjectionMatrix(D.invProjMatrix,D.worldSize,It,!("globe"===D.projection.name)),edges:kn,shadowDir:Zt,ws:vt,zoom:It},E._shadowCullCache=ne}const{cameraFrustum:le,edges:fe,shadowDir:me,ws:Pe,zoom:Re}=ne;let Ke=v;if(D.elevation){const vt=D.elevation.getMinMaxForTile(k);vt&&(Ke+=vt.max)}Ke/=o.aA(D.center.lat,Re);const ot=V.computeSimplifiedTileShadowVolume(k.toUnwrapped(),Ke,Pe,me);if(!ot)return false;const{vertices:at,planes:xt}=ot;return 0===le.intersectsPrecise(at,xt,fe)||0===V.getCurrentCascadeFrustum().intersectsPrecise(at,xt,fe)}const kl=new Float32Array(16),al=new Float32Array(16);function Lc(k){const{painter:v,source:E,layer:D,coords:V}=k;let Y=k.defines;const Z=v.context,ne="shadow"===v.renderPass,le="light-beam"===v.renderPass,fe=v.shadowRenderer,me=o.aA(v.transform.center.lat,v.transform.zoom),Pe=o.aE(v,D.paint.get("building-cutoff-fade-range"));Pe.shouldRenderCutoff&&(Y=Y.concat("RENDER_CUTOFF"));const Re=D.paint.get("building-front-cutoff"),Ke=Re[2]<1&&!v.terrain,ot=Qa(v.transform.pitch,Re,!!v.terrain);Ke&&(Y=Y.concat("RENDER_FRONT_CUTOFF"),v.maxFrontCutoffRawStart=Math.max(v.maxFrontCutoffRawStart,Re[0])),k.floodLightIntensity>0&&(Y=Y.concat("FLOOD_LIGHT"));for(const at of V){const xt=E.getTile(at),vt=xt.getBucket(D);if(!vt)continue;fe&&0===fe.getMaxCascadeForTile(at.toUnwrapped())&&(Y=Y.concat("SHADOWS_SINGLE_CASCADE"));const It=vt.programConfigurations.get(D.id);let jt,Zt;const kn=v.translatePosMatrix(at.expandedProjMatrix,xt,[0,0],"map");o.aN(kl,kn,[1,1,k.verticalScale]);const cn=kl;let hn;if(ne&&fe){if(Zs(xt.tileID,vt.maxHeight*me,v))continue;const wn=fe.calculateShadowPassMatrixFromTile(xt.tileID.toUnwrapped());o.aN(wn,wn,[1,1,k.verticalScale]),hn=ha(wn),jt=Zt=v.getOrCreateProgram("buildingDepth",{config:It,defines:Y,overrideFog:false})}else if(le)jt=Zt=v.getOrCreateProgram("buildingBloom",{config:It,defines:Y,overrideFog:false}),hn=ea(cn);else{const wn=v.transform.calculatePosMatrix(at.toUnwrapped(),v.transform.worldSize);o.aN(wn,wn,[1,1,k.verticalScale]),o.aN(al,wn,[1,-1,1/me]),o.aO(al,al),o.aP(al,al);const Bn=al,Kn=v.transform.getFreeCameraOptions().position,Wn=1<{if(le){const Kn=wn.entranceBloom;Bn.draw(v,Z.gl.TRIANGLES,k.depthMode,o._.disabled,k.blendMode,o.$.disabled,hn,D.id,Kn.layoutVertexBuffer,Kn.indexBuffer,Kn.segmentsBucket,D.paint,v.transform.zoom,It,[Kn.layoutAttenuationBuffer,Kn.layoutColorBuffer])}else{const Kn=wn.segmentsBucket;let Wn=[wn.layoutNormalBuffer,wn.layoutCentroidBuffer,wn.layoutColorBuffer,wn.layoutFloodLightDataBuffer];wn.layoutFacadePaintBuffer&&(Wn=Wn.concat([wn.layoutFacadeDataBuffer,wn.layoutFacadeVerticalRangeBuffer,wn.layoutFacadePaintBuffer])),Bn.draw(v,Z.gl.TRIANGLES,k.depthMode,o._.disabled,k.blendMode,ne?o.$.disabled:o.$.backCW,hn,D.id,wn.layoutVertexBuffer,wn.indexBuffer,Kn,D.paint,v.transform.zoom,It,Wn)}};v.uploadCommonUniforms(Z,Zt,at.toUnwrapped(),null,Pe),vt.buildingWithoutFacade&&xn(vt.buildingWithoutFacade,Zt),vt.buildingWithFacade&&(jt!==Zt&&v.uploadCommonUniforms(Z,jt,at.toUnwrapped(),null,Pe),xn(vt.buildingWithFacade,jt))}}function uf(k,v,E,D,V,Y,Z,ne,le,fe,me,Pe,Re,Ke){const ot=k.context.gl,at=k.depthModeForSublayer(1,o.Z.ReadOnly,ot.LEQUAL,true),xt=o.al(.1,3,me),vt=k._showOverdrawInspector,It=Pe,jt=new Xo;if(!vt){const Zt=new o._({func:ot.ALWAYS,mask:255},255,255,ot.KEEP,ot.KEEP,ot.REPLACE),kn=new o.a1([ot.ONE,ot.ONE,ot.ONE,ot.ONE],o.C.transparent,[false,false,false,true],ot.MIN);o.aQ(jt,k,v,E,D,at,Zt,kn,o.$.disabled,V,"sdf",Y,Z,ne,le,fe,xt,It,false,void 0)}{const Zt=vt?o._.disabled:new o._({func:ot.EQUAL,mask:255},255,255,ot.KEEP,ot.DECR,ot.DECR),kn=vt?k.colorModeForRenderPass():new o.a1([ot.ONE_MINUS_DST_ALPHA,ot.DST_ALPHA,ot.ONE,ot.ONE],o.C.transparent,[true,true,true,true]);o.aQ(jt,k,v,E,D,at,Zt,kn,o.$.disabled,V,"color",Y,Z,ne,le,fe,xt,It,false,void 0)}}class Ht{constructor(){this._previousClosestBuildingId=null,this._hysteresisRatio=.8,this._indoorMinimumZoom=16}findClosestBuilding(v,E,D,V,Y){if(Dle*this._hysteresisRatio&&(Z=this._previousClosestBuildingId):fe&&!Z&&(Z=this._previousClosestBuildingId),this._previousClosestBuildingId=Z,Z}_calculateDistance(v,E){if(!E.center)return Number.MAX_VALUE;const D=v.lat-E.center[1],V=v.lng-E.center[0];return D*D+V*V}_isBuildingVisible(v,E,D){if(!D)return false;for(const V of v.floorIds){const Y=v.floors[V];if(!Y.geometry)continue;const Z=Y.geometry;if("Polygon"===Z.type){const ne=this._convertRingToPoints(Z.coordinates[0]);if(o.aT(ne,D))return true}else if("MultiPolygon"===Z.type){const ne=this._convertMultiPolygonToPoints(Z.coordinates);if(o.aU(D,ne))return true}}return false}_convertRingToPoints(v){return v.map(E=>new o.P(E[0],E[1]))}_convertMultiPolygonToPoints(v){return v.map(E=>0===E.length?[]:E[0].map(D=>new o.P(D[0],D[1])))}}const Nu=.05,ey=(k,v,E,D,V,Y,Z,ne,le,fe,me,Pe)=>({u_matrix:k,u_normalize_matrix:v,u_globe_matrix:E,u_merc_matrix:D,u_grid_matrix:V,u_tl_parent:Y,u_scale_parent:fe,u_fade_t:me.mix,u_opacity:me.opacity,u_image0:0,u_image1:1,u_raster_elevation:Pe,u_zoom_transition:Z,u_merc_center:ne,u_cutoff_params:le}),sl=(k,v,E,D,V,Y,Z,ne,le,fe)=>({u_particle_texture:k,u_particle_texture_side_len:v,u_tile_offset:E,u_velocity:D,u_color_ramp:Y,u_velocity_res:V,u_max_speed:Z,u_uv_offset:ne,u_data_scale:[255*le[0],255*le[1]],u_data_offset:fe,u_particle_pos_scale:1.1,u_particle_pos_offset:[Nu,Nu]}),zs=(k,v,E,D,V,Y,Z,ne,le,fe)=>({u_particle_texture:k,u_particle_texture_side_len:v,u_velocity:E,u_velocity_res:D,u_max_speed:V,u_speed_factor:Y,u_reset_rate:Z,u_rand_seed:Math.random(),u_uv_offset:ne,u_data_scale:[255*le[0],255*le[1]],u_data_offset:fe,u_particle_pos_scale:1.1,u_particle_pos_offset:[Nu,Nu]});function Df(k,[v,E,D,V],[Y,Z]){if(Y===Z)return[0,0,0,0];const ne=255*(k-1)/(k*(Z-Y));return[v*ne,E*ne,D*ne,V*ne]}function pd(k,v,[E,D]){return E===D?0:.5/k+(v-E)*(k-1)/(k*(D-E))}var sa=o.a_([{name:"a_index",type:"Int16",components:1}]);class Zl{constructor(v,E,D,V){const Y={width:D[0],height:D[1],data:null},Z=v.gl;this.targetColorTexture=new o.T(v,Y,Z.RGBA8,{useMipmap:false}),this.backgroundColorTexture=new o.T(v,Y,Z.RGBA8,{useMipmap:false}),this.context=v,this.updateParticleTexture(E,V),this.lastInvalidatedAt=0}updateParticleTexture(v,E){if(this.particleTextureDimension===E.width)return;(this.particleTexture0||this.particleTexture1||this.particleIndexBuffer||this.particleSegment)&&(this.particleTexture0.destroy(),this.particleTexture1.destroy(),this.particleIndexBuffer.destroy(),this.particleSegment.destroy());const D=this.context.gl,V=E.width*E.height;this.particleTexture0=new o.T(this.context,E,D.RGBA8,{premultiply:false,useMipmap:false}),this.particleTexture1=new o.T(this.context,E,D.RGBA8,{premultiply:false,useMipmap:false});const Y=new o.a$;Y.reserve(V);for(let Z=0;Z0){const Y=o.e.now(),Z=(Y-k.timeAdded)/V,ne=v?(Y-v.timeAdded)/V:-1,le=E.getSource(),fe=D.coveringZoomLevel({tileSize:le.tileSize,roundZoom:le.roundZoom}),me=!v||Math.abs(v.tileID.overscaledZ-fe)>Math.abs(k.tileID.overscaledZ-fe),Pe=me&&k.refreshedUponExpiration?1:o.b0(me?Z:1-ne,0,1);return v?{opacity:1,mix:1-Pe,isFading:Z<1}:{opacity:Pe,mix:0,isFading:Z<1}}return{opacity:1,mix:0,isFading:false}}function Qp(k,v,E){if(!k)return null;const D=v.getTextureDescriptor(k,E,true);if(!D)return null;let{texture:V,mix:Y,offset:Z,tileSize:ne,buffer:le,format:fe}=D;if(!V||!fe)return null;let me=false;return"uint32"===fe&&(me=true,Y[3]=0,Y=Df(o.b9,Y,[0,E.paint.get("raster-particle-max-speed")]),Z=pd(o.b9,Z,[0,E.paint.get("raster-particle-max-speed")])),{texture:V,textureOffset:[le/(ne+2*le),ne/(ne+2*le)],tileSize:ne,scalarData:me,scale:Y,offset:Z,defines:["RASTER_ARRAY",{uint8:"DATA_FORMAT_UINT8",uint16:"DATA_FORMAT_UINT16",uint32:"DATA_FORMAT_UINT32"}[fe]]}}function rh(k){const v=k._nearZ,E=k.projection.farthestPixelDistance(k),D=E-v,V=.2*k.height,Y=v+V;return[v,E,(Y-V-v)/D,(Y-v)/D]}var Hd="#ifdef RASTER_ARRAY\nuniform sampler2D u_velocity;uniform mediump vec2 u_velocity_res;uniform mediump float u_max_speed;const vec4 NO_DATA=vec4(1);const vec2 INVALID_VELOCITY=vec2(-1);uniform highp vec2 u_uv_offset;uniform highp float u_data_offset;uniform highp vec2 u_data_scale;ivec4 rasterArrayLinearCoord(highp vec2 texCoord,highp vec2 texResolution,out highp vec2 fxy) {texCoord=texCoord*texResolution-0.5;fxy=fract(texCoord);texCoord-=fxy;return ivec4(texCoord.xxyy+vec2(1.5,0.5).xyxy);}highp vec2 lookup_velocity(highp vec2 uv) {uv=u_uv_offset.x+u_uv_offset.y*uv;highp vec2 fxy;ivec4 c=rasterArrayLinearCoord(uv,u_velocity_res,fxy);highp vec4 tl=texelFetch(u_velocity,c.yz,0);highp vec4 tr=texelFetch(u_velocity,c.xz,0);highp vec4 bl=texelFetch(u_velocity,c.yw,0);highp vec4 br=texelFetch(u_velocity,c.xw,0);if (tl==NO_DATA) {return INVALID_VELOCITY;}if (tr==NO_DATA) {return INVALID_VELOCITY;}if (bl==NO_DATA) {return INVALID_VELOCITY;}if (br==NO_DATA) {return INVALID_VELOCITY;}highp vec4 t=mix(mix(bl,br,fxy.x),mix(tl,tr,fxy.x),fxy.y);highp vec2 velocity=u_data_offset+vec2(dot(t.rg,u_data_scale),dot(t.ba,u_data_scale));velocity.y=-velocity.y;velocity/=max(u_max_speed,length(velocity));return velocity;}\n#endif\nuniform highp float u_particle_pos_scale;uniform highp vec2 u_particle_pos_offset;highp vec4 pack_pos_to_rgba(highp vec2 p) {highp vec2 v=(p+u_particle_pos_offset)/u_particle_pos_scale;highp vec4 r=vec4(v.x,fract(v.x*255.0),v.y,fract(v.y*255.0));return vec4(r.x-r.y/255.0,r.y,r.z-r.w/255.0,r.w);}highp vec2 unpack_pos_from_rgba(highp vec4 v) {v=floor(v*255.0+0.5)/255.0;highp vec2 p=vec2(v.x+(v.y/255.0),v.z+(v.w/255.0));return u_particle_pos_scale*p-u_particle_pos_offset;}";o.ba["_prelude_raster_particle.glsl"]||(o.ba["_prelude_raster_particle.glsl"]=Hd);var ty={building:o.bb('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_indicator_cutout.fragment.glsl"\n#include "_prelude_feature_cutout.fragment.glsl"\nconst float window_depth=0.5;const float ao_radius=0.2;in vec4 v_color;in highp vec3 v_normal;in highp vec3 v_pos;\n#ifdef RENDER_FRONT_CUTOFF\nin float v_front_cutoff_opacity;\n#endif\n#ifdef INDICATOR_CUTOUT\n#ifdef FEATURE_CUTOUT\nin vec4 v_ground_roof;\n#endif\n#endif\n#ifdef BUILDING_FAUX_FACADE\nin lowp float v_faux_facade;in highp float v_faux_facade_ed;in highp vec2 v_faux_facade_window;in highp vec2 v_faux_facade_floor;in highp vec2 v_faux_facade_range;in highp float v_aspect;in highp vec3 v_tbn_0;in highp vec3 v_tbn_1;in highp vec3 v_tbn_2;in highp vec4 v_faux_color_emissive;uniform float u_faux_facade_ao_intensity;\n#endif\n#ifdef RENDER_SHADOWS\nin highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;\n#endif\n#ifdef FLOOD_LIGHT\nin highp float v_flood_radius;in float v_has_flood_light;\n#endif\nuniform lowp float u_opacity;uniform vec3 u_camera_pos;uniform highp float u_tile_to_meter;uniform float u_facade_emissive_chance;uniform vec3 u_flood_light_color;uniform float u_flood_light_intensity;vec3 linearTosRGB(in vec3 color) {return pow(color,vec3(1./2.2));}\n#ifdef BUILDING_FAUX_FACADE\nhighp float hash12(in highp vec2 p) {highp vec3 p3 =fract(vec3(p.xyx)*0.1031);p3+=dot(p3,p3.yzx+33.33);return fract((p3.x+p3.y)*p3.z);}float min3(in vec3 v) {return min(min(v.x,v.y),v.z);}highp vec2 get_uv_mask_id(in highp vec2 q,out highp float mask,out highp vec2 id) {highp vec2 p=q;mask=step(v_faux_facade_range.x,p.y)*step(p.y,v_faux_facade_range.y);p.y=p.y-v_faux_facade_range.x;highp vec2 uv=modf(p/v_faux_facade_floor,id);highp vec4 d=(v_faux_facade_floor.xyxy+vec4(-v_faux_facade_window,v_faux_facade_window))*0.5;highp vec4 edge=d/v_faux_facade_floor.xyxy;highp vec2 m=step(edge.xy,uv)*step(uv,edge.zw);mask*=m.x*m.y;uv-=vec2(0.5);uv*=vec2(0.5)/(vec2(0.5)-edge.xy);uv+=vec2(0.5);return uv;}highp float ray_unit_box(in highp vec3 ray_o,in highp vec3 ray_d,in highp vec3 bmin,in highp vec3 bmax) {highp vec3 planes=mix(bmin,bmax,step(0.0,ray_d));highp vec3 t=(planes-ray_o)/ray_d;return min3(t);}float get_emissive(in vec2 id) {if (u_facade_emissive_chance > 0.0) {return (step(hash12(id),u_facade_emissive_chance)+0.05)*v_faux_color_emissive.a;}return 0.0;}vec3 get_shade_info(in highp vec3 v,in highp vec3 v_normalized,in vec3 color,in vec2 id,in mat3 tbn,inout vec3 out_normal,inout float out_emissive) {vec3 out_color=color;highp vec3 abs_v=abs(v_normalized);bool x_major=abs_v.x >=abs_v.y && abs_v.x >=abs_v.z;bool y_major=abs_v.y >=abs_v.x && abs_v.y >=abs_v.z;bool z_major=abs_v.z >=abs_v.x && abs_v.z >=abs_v.y;\n#if 0\nif (x_major) {out_color=v.x > 0.0 ? vec3(1.0,0.0,0.0) : vec3(0.0,1.0,1.0);} else if (y_major) {out_color=v.y > 0.0 ? vec3(0.0,1.0,0.0) : vec3(1.0,0.0,1.0);} else if (z_major) {out_color=v.z > 0.0 ? vec3(0.0,0.0,1.0) : vec3(1.0,1.0,0.0);}out_emissive=1.0;\n#else\nif (x_major) {out_normal=-sign(v.x)*tbn[0];} else if (y_major) {out_normal=vec3(0.0,0.0,-sign(v.y));} else if (z_major) {out_color=v_faux_color_emissive.rgb;out_emissive=v.z <=0.0 ? get_emissive(id) : out_emissive;}float ao=1.0;if (u_faux_facade_ao_intensity > 0.0) {vec4 ao_range=v_faux_facade_window.xxyy*0.5-vec4(0,ao_radius,0,ao_radius);vec2 ao_range_z=vec2(window_depth*0.5)-vec2(0.0,ao_radius);if (x_major || y_major) {ao*=smoothstep(-ao_range_z.x,-ao_range_z.y,v.z);} else if (z_major) {ao*=smoothstep(-ao_range.x,-ao_range.y,v.x)*(1.0-smoothstep(ao_range.y,ao_range.x,v.x));ao*=smoothstep(-ao_range.z,-ao_range.w,v.y)*(1.0-smoothstep(ao_range.w,ao_range.z,v.y));}ao=mix(1.0,min(1.0,ao+0.25),u_faux_facade_ao_intensity);}out_color*=ao;\n#endif\nreturn out_color;}\n#endif\nvec3 apply_lighting_linear(in vec3 color,in vec3 normal,in float dir_factor) {float ambient_directional_factor=calculate_ambient_directional_factor(normal);vec3 ambient_contrib=ambient_directional_factor*u_lighting_ambient_color;vec3 directional_contrib=u_lighting_directional_color*dir_factor;return color*(ambient_contrib+directional_contrib);}void main() {vec3 normal=normalize(v_normal);vec3 base_color=v_color.rgb;float emissive=v_color.a;\n#ifdef BUILDING_FAUX_FACADE\nif (v_faux_facade > 0.0) {highp mat3 tbn=mat3(v_tbn_0,v_tbn_1,v_tbn_2);highp vec3 v=vec3(v_pos.xy,v_pos.z/u_tile_to_meter)-u_camera_pos;highp vec3 view_tangent=transpose(tbn)*v;highp vec2 q=vec2(v_faux_facade_ed,v_pos.z);float mask=0.0;vec2 id=vec2(0.0);highp vec2 uv=get_uv_mask_id(q,mask,id);uv*=v_faux_facade_window;highp vec3 bmin=vec3(0.0,0.0,-window_depth);highp vec3 bmax=bmin+vec3(v_faux_facade_window,window_depth);highp vec3 ray_o=vec3(uv,0.0);highp vec3 ray_d=normalize(view_tangent);highp float t_min=ray_unit_box(ray_o,ray_d,bmin,bmax);highp vec3 hit=ray_o+t_min*ray_d;highp vec3 r=vec3(v_faux_facade_window,-window_depth);hit-=r*0.5;highp vec3 normalized=hit/r;vec3 out_normal=normal;float out_emissive=emissive;vec3 room_color=get_shade_info(hit,normalized,base_color,id,tbn,out_normal,out_emissive);base_color=mix(base_color,room_color,mask);normal=mix(normal,out_normal,mask);emissive=mix(emissive,out_emissive,mask);}\n#endif\nvec4 color=vec4(base_color,1.0);vec3 xy_flipped_normal=vec3(-normal.xy,normal.z);float shadowed_lighting_factor=0.0;\n#ifdef RENDER_SHADOWS\n#ifdef RENDER_CUTOFF\nshadowed_lighting_factor=shadowed_light_factor_normal_opacity(xy_flipped_normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w,v_cutoff_opacity);if (v_cutoff_opacity==0.0) {discard;}\n#else\nshadowed_lighting_factor=shadowed_light_factor_normal(xy_flipped_normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);\n#endif\n#else\nshadowed_lighting_factor=max(0.0,dot(xy_flipped_normal,u_lighting_directional_dir));\n#endif\ncolor.rgb=apply_lighting_linear(color.rgb,xy_flipped_normal,shadowed_lighting_factor);color.rgb=linearTosRGB(color.rgb);\n#ifdef FLOOD_LIGHT\nfloat flood_radiance=(1.0-min(v_pos.z/v_flood_radius,1.0))*u_flood_light_intensity*v_has_flood_light;color.rgb=mix(color.rgb,u_flood_light_color,flood_radiance);\n#endif\ncolor.rgb=mix(color.rgb,linearTosRGB(base_color.rgb),emissive);\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos,v_pos.z));\n#endif\ncolor*=u_opacity;\n#ifdef INDICATOR_CUTOUT\n#ifdef FEATURE_CUTOUT\n{float ditherOpacity=cutoutGroundRoofOpacity(v_ground_roof);if (ditherOpacity < 1.0) {int index=viewport_dither_index(gl_FragCoord.xy);if (ditherOpacity < DITHER_THRESHOLDS[index]) {discard;}}}\n#else\ncolor=applyCutout(color,v_pos.z);\n#endif\n#endif\n#ifdef RENDER_FRONT_CUTOFF\nif (v_front_cutoff_opacity < 1.0) {int index=viewport_dither_index(gl_FragCoord.xy);if (v_front_cutoff_opacity < DITHER_THRESHOLDS[index]) {discard;}}\n#endif\n#ifdef FEATURE_CUTOUT\ncolor=apply_feature_cutout(color,gl_FragCoord,get_cutout_factors(gl_FragCoord).x,0.0);\n#endif\nglFragColor=color;\n#ifdef DEBUG_SHOW_NORMALS\ncolor.rgb=xy_flipped_normal*0.5+vec3(0.5,0.5,0.5);color.a=1.0;glFragColor=color;\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nin vec3 a_pos_3f;in ivec4 a_normal_3;in ivec4 a_centroid_3;\n#ifdef FLOOD_LIGHT\nin int a_flood_light_wall_radius_1i16;\n#endif\n#ifdef BUILDING_FAUX_FACADE\nin uvec4 a_faux_facade_data;in uvec2 a_faux_facade_vertical_range;\n#endif\nuniform mat4 u_matrix;uniform mat4 u_normal_matrix;uniform highp float u_tile_to_meter;\n#ifdef RENDER_FRONT_CUTOFF\nuniform vec3 u_front_cutoff_params;out float v_front_cutoff_opacity;\n#endif\n#ifdef INDICATOR_CUTOUT\n#ifdef FEATURE_CUTOUT\nout vec4 v_ground_roof;\n#endif\n#endif\nout vec4 v_color;out vec3 v_normal;out highp vec3 v_pos;\n#ifdef BUILDING_FAUX_FACADE\nout lowp float v_faux_facade;out highp float v_faux_facade_ed;out highp vec2 v_faux_facade_window;out highp vec2 v_faux_facade_floor;out highp vec2 v_faux_facade_range;out highp float v_aspect;out highp vec3 v_tbn_0;out highp vec3 v_tbn_1;out highp vec3 v_tbn_2;out highp vec4 v_faux_color_emissive;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;\n#endif\n#ifdef FLOOD_LIGHT\nout highp float v_flood_radius;out float v_has_flood_light;\n#endif\nconst float MAX_UINT_16=65535.0;const float MAX_INT_16=32767.0;const float MAX_UINT_8=255.0;const float TWO_POW_8=256.0;const float FLOOD_LIGHT_MAX_RADIUS_METER=2048.0;vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}\n#ifdef BUILDING_FAUX_FACADE\nmat3 get_tbn(in vec3 normal) {const vec3 bitangent=vec3(0.0,0.0,1.0);vec3 tangent=normalize(vec3(normal.y,-normal.x,0.0));return mat3(tangent,bitangent,normal);}\n#endif\n#pragma mapbox: define-attribute-vertex-shader-only highp uvec2 part_color_emissive\n#pragma mapbox: define-attribute-vertex-shader-only highp uvec2 faux_facade_color_emissive\nvoid main() {\n#pragma mapbox: initialize-attribute-custom highp uvec2 part_color_emissive\n#pragma mapbox: initialize-attribute-custom highp uvec2 faux_facade_color_emissive\n#ifdef FLOOD_LIGHT\nv_flood_radius=(float(a_flood_light_wall_radius_1i16)/MAX_INT_16*FLOOD_LIGHT_MAX_RADIUS_METER);v_has_flood_light=step(0.0,v_flood_radius);\n#endif\nvec4 color_emissive=decode_color(vec2(part_color_emissive));v_color=vec4(sRGBToLinear(color_emissive.rgb),color_emissive.a);vec3 a_normal_3f=vec3(a_normal_3)/MAX_INT_16;v_normal=vec3(u_normal_matrix*vec4(a_normal_3f,0.0));float hidden=0.0;float depth_offset=0.0;vec2 centroid_xy=vec2(a_centroid_3.xy >> 2);vec2 spanBits=vec2(a_centroid_3.xy & 3);\n#ifdef BUILDING_FAUX_FACADE\nvec4 faux_facade_data=vec4(a_faux_facade_data);v_faux_facade=faux_facade_data.x;if (v_faux_facade > 0.0) {v_faux_facade_ed=faux_facade_data.x *u_tile_to_meter;float window_x_perc=floor(faux_facade_data.y/TWO_POW_8);float window_y_perc=faux_facade_data.y-TWO_POW_8*window_x_perc;vec2 window_perc=vec2(window_x_perc,window_y_perc)/MAX_UINT_8;v_faux_facade_floor=(faux_facade_data.zw/MAX_UINT_16*EXTENT)*u_tile_to_meter;v_faux_facade_window=window_perc*v_faux_facade_floor;v_faux_facade_range=(vec2(a_faux_facade_vertical_range)/MAX_UINT_16*EXTENT)*u_tile_to_meter;v_aspect=v_faux_facade_window.x/v_faux_facade_window.y;mat3 tbn=get_tbn(normalize(v_normal));v_tbn_0=tbn[0];v_tbn_1=tbn[1];v_tbn_2=tbn[2];v_faux_color_emissive=decode_color(vec2(faux_facade_color_emissive));v_faux_color_emissive.rgb=sRGBToLinear(v_faux_color_emissive.rgb);depth_offset=min(1000.0,float(a_centroid_3.z))*0.0000002;}\n#endif\nv_pos=a_pos_3f;\n#if defined(RENDER_CUTOFF) || defined(RENDER_FRONT_CUTOFF)\nfloat halfSpanX=spanBits.x*10.0/u_tile_to_meter;float halfSpanY=spanBits.y*10.0/u_tile_to_meter;vec2 screenUpInTile=vec2(u_matrix[0][1],u_matrix[1][1]);vec2 spanOffset=vec2(halfSpanX,halfSpanY)*sign(screenUpInTile);vec2 cutoff_highestCorner=centroid_xy+spanOffset;vec2 cutoff_lowestCorner=centroid_xy-spanOffset;\n#endif\n#if defined(RENDER_CUTOFF) || defined(RENDER_FRONT_CUTOFF)\nvec4 ground=u_matrix*vec4(centroid_xy,0.0,1.0);\n#endif\n#ifdef RENDER_CUTOFF\nv_cutoff_opacity=cutoff_opacity(u_cutoff_params,ground.z);hidden=float(v_cutoff_opacity==0.0);v_pos.z*=v_cutoff_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nvec3 shadow_pos=v_pos;\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset_model(v_normal);shadow_pos+=offset*shadow_normal_offset_multiplier0();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shadow_pos,1.0);v_pos_light_view_1=u_light_matrix_1*vec4(shadow_pos,1.0);\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(v_pos);\n#endif\n#ifdef RENDER_FRONT_CUTOFF\nv_front_cutoff_opacity=1.0;{hidden=max(hidden,float(ground.w <=0.0));float ndc_y=ground.y/max(ground.w,0.001);float threshold=u_front_cutoff_params.x*2.0-1.0;float range_ndc=u_front_cutoff_params.y*2.0;hidden=max(hidden,float(ndc_y < threshold-range_ndc));float t=clamp((ndc_y-(threshold-range_ndc))/max(range_ndc,0.001),0.0,1.0);v_front_cutoff_opacity=mix(u_front_cutoff_params.z,1.0,t);}\n#endif\ngl_Position=mix(u_matrix*vec4(v_pos,1),AWAY,hidden);gl_Position.z-=depth_offset*gl_Position.w;\n#ifdef INDICATOR_CUTOUT\n#ifdef FEATURE_CUTOUT\nvec4 ic_ground=u_matrix*vec4(v_pos.xy,0.0,1.0);vec4 ic_roof=u_matrix*vec4(v_pos.xy,v_pos.z,1.0);v_ground_roof=vec4(ic_ground.xy/ic_ground.w,ic_roof.xy/ic_roof.w);\n#endif\n#endif\n}'),buildingBloom:o.bb("in vec4 v_color_emissive;\n#pragma mapbox: define-attribute highp vec4 bloom_attenuation\nfloat saturate(float val) {return clamp(val,0.0,1.0);}void main() {\n#pragma mapbox: initialize-attribute highp vec4 bloom_attenuation\nfloat emission=v_color_emissive.a;float opacity=1.0;\n#ifdef HAS_ATTRIBUTE_a_bloom_attenuation\nfloat distance=length(vec2(1.3*max(0.0,abs(bloom_attenuation.x)-bloom_attenuation.z),bloom_attenuation.y));distance+= mix(0.5,0.0,clamp(emission-1.0,0.0,1.0));opacity*=saturate(1.0-distance*distance);\n#endif\n#ifdef RENDER_CUTOFF\nopacity*=v_cutoff_opacity;\n#endif\nglFragColor=vec4(v_color_emissive.rgb,1.0)*opacity;}","in vec3 a_pos_3f;\n#pragma mapbox: define-attribute-vertex-shader-only highp uvec2 part_color_emissive\n#pragma mapbox: define-attribute highp vec4 bloom_attenuation\nout vec4 v_color_emissive;uniform mat4 u_matrix;vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}void main() {\n#pragma mapbox: initialize-attribute-custom highp uvec2 part_color_emissive\n#pragma mapbox: initialize-attribute highp vec4 bloom_attenuation\n#ifdef HAS_ATTRIBUTE_a_part_color_emissive\nvec4 color_emissive=decode_color(vec2(part_color_emissive));float part_emissive=color_emissive.a*5.0;v_color_emissive=vec4(sRGBToLinear(color_emissive.rgb),part_emissive);\n#else\nv_color_emissive=vec4(1.0);\n#endif\ngl_Position=u_matrix*vec4(a_pos_3f,1.0);\n#ifdef RENDER_CUTOFF\nv_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z);\n#endif\n}"),buildingDepth:o.bb("void main() {}","in vec3 a_pos_3f;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos_3f,1.0);}"),rasterParticle:o.bb('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform float u_fade_t;uniform float u_opacity;uniform highp float u_raster_elevation;in vec2 v_pos0;in vec2 v_pos1;uniform sampler2D u_image0;uniform sampler2D u_image1;void main() {vec4 color0,color1,color;color0=texture(u_image0,v_pos0);color1=texture(u_image1,v_pos1);if (color0.a > 0.0) color0.rgb/=color0.a;if (color1.a > 0.0) color1.rgb/=color1.a;color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 out_color=color.rgb;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(vec4(out_color,1.0),1.0).rgb;\n#endif\n#ifdef FOG\nhighp float fog_limit_high_meters=1000000.0;highp float fog_limit_low_meters=600000.0;float fog_limit=1.0-smoothstep(fog_limit_low_meters,fog_limit_high_meters,u_raster_elevation);out_color=fog_dither(fog_apply(out_color,v_fog_pos,fog_limit));\n#endif\nglFragColor=vec4(out_color*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform mat3 u_grid_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_raster_elevation;uniform float u_zoom_transition;uniform vec2 u_merc_center;\n#define GLOBE_UPSCALE GLOBE_RADIUS/6371008.8\nin ivec2 a_pos;in uvec2 a_texture_pos;out vec2 v_pos0;out vec2 v_pos1;void main() {float w=1.0;vec2 uv;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float mercatorX=mercatorXfromLng(latLng[1]);float tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];float uvX=mercatorX*tiles-idx;float uvY=mercatorY*tiles-idy;uv=vec2(uvX,uvY);vec3 globe_pos=latLngToECEF(latLng.xy);globe_pos+=normalize(globe_pos)*u_raster_elevation*GLOBE_UPSCALE;vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {vec2 merc_pos=vec2(mercatorX,mercatorY);merc_world_pos=vec4(merc_pos,u_raster_elevation,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition)*w,w);gl_Position=u_matrix*interpolated_pos;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n#else\nuv=vec2(a_texture_pos)/8192.0;gl_Position=u_matrix*vec4(vec2(a_pos)*w,u_raster_elevation*w,w);\n#ifdef FOG\nv_fog_pos=fog_position(vec2(a_pos));\n#endif\n#endif\nv_pos0=uv;\n#ifdef VIEWPORT_ORIGIN_TOP_LEFT\nv_pos0.y=1.0-v_pos0.y;\n#endif\nv_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}'),rasterParticleDraw:o.bb("uniform sampler2D u_color_ramp;in float v_particle_speed;void main() {glFragColor=texture(u_color_ramp,vec2(v_particle_speed,0.5));}",'#include "_prelude_raster_particle.glsl"\nin int a_index;uniform sampler2D u_particle_texture;uniform float u_particle_texture_side_len;uniform vec2 u_tile_offset;out float v_particle_speed;void main() {ivec2 pixel_coord=ivec2(\nmod(float(a_index),u_particle_texture_side_len),float(a_index)/u_particle_texture_side_len);vec4 pixel=texelFetch(u_particle_texture,pixel_coord,0);vec2 pos=unpack_pos_from_rgba(pixel)+u_tile_offset;vec2 tex_coord=fract(pos);vec2 velocity=lookup_velocity(tex_coord);if (velocity==INVALID_VELOCITY) {gl_Position=AWAY;v_particle_speed=0.0;} else {gl_Position=vec4(2.0*pos-1.0,0,1);v_particle_speed=length(velocity);}gl_PointSize=1.0;}'),rasterParticleTexture:o.bb("uniform sampler2D u_texture;uniform float u_opacity;in vec2 v_tex_pos;void main() {vec4 color=texture(u_texture,v_tex_pos);glFragColor=vec4(floor(255.0*color*u_opacity)/255.0);}","in ivec2 a_pos;out vec2 v_tex_pos;void main() {vec2 uv=0.5*vec2(a_pos)+vec2(0.5);v_tex_pos=uv;\n#ifdef VIEWPORT_ORIGIN_TOP_LEFT\nv_tex_pos.y=1.0-v_tex_pos.y;\n#endif\ngl_Position=vec4(a_pos,0.0,1.0);}"),rasterParticleUpdate:o.bb('#include "_prelude_raster_particle.glsl"\nuniform sampler2D u_particle_texture;uniform mediump float u_particle_texture_side_len;uniform mediump float u_speed_factor;uniform highp float u_reset_rate;uniform highp float u_rand_seed;in highp vec2 v_tex_coord;vec2 linearstep(vec2 edge0,vec2 edge1,vec2 x) {return clamp((x-edge0)/(edge1-edge0),vec2(0),vec2(1));}const highp vec3 rand_constants=vec3(12.9898,78.233,4375.85453);highp float rand(const highp vec2 co) {highp float t=dot(rand_constants.xy,co);return fract(sin(t)*(rand_constants.z+t));}void main() {ivec2 pixel_coord=ivec2(v_tex_coord*u_particle_texture_side_len);highp vec4 pixel=texelFetch(u_particle_texture,pixel_coord,0);highp vec2 pos=unpack_pos_from_rgba(pixel);highp vec2 velocity=lookup_velocity(clamp(pos,0.0,1.0));highp vec2 dp=velocity==INVALID_VELOCITY ? vec2(0) : velocity*u_speed_factor;pos=pos+dp;highp vec2 seed=(pos+v_tex_coord)*u_rand_seed;highp vec2 random_pos=vec2(rand(seed+1.3),rand(seed+2.1));highp vec2 persist_rate=pow(\nlinearstep(vec2(-u_particle_pos_offset),vec2(0),pos)*linearstep(vec2(1.0+u_particle_pos_offset),vec2(1),pos),vec2(4)\n);highp vec2 per_frame_persist=pow(persist_rate,abs(dp)/u_particle_pos_offset);highp float drop_rate=1.0-per_frame_persist.x*per_frame_persist.y;drop_rate=any(greaterThanEqual(abs(pos-0.5),vec2(0.5+u_particle_pos_offset))) ? 1.0 : drop_rate;highp float drop=step(1.0-drop_rate-u_reset_rate,rand(seed));highp vec2 next_pos=mix(pos,random_pos,drop);glFragColor=pack_pos_to_rgba(next_pos);}',"in ivec2 a_pos;out vec2 v_tex_coord;void main() {v_tex_coord=0.5*vec2(a_pos+ivec2(1));gl_Position=vec4(a_pos,0.0,1.0);}"),snowParticle:o.bb("in highp vec2 uv;in highp float alphaMultiplier;uniform vec4 u_particleColor;uniform vec2 u_simpleShapeParameters;void main() {float t=clamp((length(uv)-u_simpleShapeParameters.x)/(1.0-u_simpleShapeParameters.x),0.0,1.0);float alpha=1.0-pow(t,pow(10.0,u_simpleShapeParameters.y));alpha*=alphaMultiplier;alpha*=u_particleColor.a;vec3 color=u_particleColor.rgb*alpha;glFragColor=vec4(color,alpha) ;HANDLE_WIREFRAME_DEBUG;}","\nin highp vec3 a_pos_3f;in highp vec2 a_uv;in highp vec4 a_snowParticleData;in highp vec4 a_snowParticleDataHorizontalOscillation;uniform mat4 u_modelview;uniform mat4 u_projection;uniform vec3 u_cam_pos;uniform vec2 u_screenSize;uniform float u_time;uniform float u_boxSize;uniform float u_velocityConeAperture; \nuniform float u_velocity;uniform vec3 u_direction;uniform float u_horizontalOscillationRadius; \nuniform float u_horizontalOscillationRate; \nuniform float u_billboardSize;uniform vec2 u_thinningCenterPos;uniform vec3 u_thinningShape;uniform float u_thinningAffectedRatio;uniform float u_thinningParticleOffset;out highp vec2 uv;out highp float alphaMultiplier;void main() {vec3 pos=a_pos_3f;float halfBoxSize=0.5*u_boxSize;pos.xyz*=halfBoxSize;pos+=u_cam_pos;float velocityConeApertureRad=radians(u_velocityConeAperture*0.5);float coneAnglePichRad=velocityConeApertureRad*a_snowParticleData.z;float coneAngleHeadingRad=a_snowParticleData.w*radians(360.0);vec3 localZ=normalize(u_direction);vec3 localX=normalize(cross(localZ,vec3(1,0,0)));vec3 localY=normalize(cross(localZ,localX));vec3 direction;direction.x=cos(coneAngleHeadingRad)*sin(coneAnglePichRad);direction.y=sin(coneAngleHeadingRad)*sin(coneAnglePichRad);direction.z=cos(coneAnglePichRad);direction=normalize(direction);vec3 simPosLocal=vec3(0,0,0);float velocityScale=(1.0+3.0*a_snowParticleData.y)*u_velocity;simPosLocal+=direction*velocityScale*u_time;float horizontalOscillationRadius=u_horizontalOscillationRadius*a_snowParticleDataHorizontalOscillation.x;float horizontalOscillationAngle=u_horizontalOscillationRate*u_time*(-1.0+2.0*a_snowParticleDataHorizontalOscillation.y);simPosLocal.xy+=horizontalOscillationRadius*vec2(cos(horizontalOscillationAngle),sin(horizontalOscillationAngle));vec3 simPos=localX*simPosLocal.x+\nlocalY*simPosLocal.y+localZ*simPosLocal.z;pos+=simPos;pos=fract((pos+vec3(halfBoxSize))/vec3(u_boxSize))*u_boxSize-vec3(halfBoxSize);float clipZ=-u_cam_pos.z+pos.z;vec4 posView=u_modelview*vec4(pos,1.0);float size=u_billboardSize;alphaMultiplier=1.0;vec4 posScreen=u_projection*posView;posScreen/=posScreen.w;posScreen.xy=vec2(0.5)+posScreen.xy*0.5;posScreen.xy*=u_screenSize;vec2 thinningCenterPos=u_thinningCenterPos.xy;thinningCenterPos.y=u_screenSize.y-thinningCenterPos.y;float screenDist=length((thinningCenterPos-posScreen.xy)/(0.5*u_screenSize));screenDist+=a_snowParticleData.x*u_thinningParticleOffset;float scaleFactorMode=0.0;float thinningShapeDist=u_thinningShape.x+u_thinningShape.y;if (screenDist < thinningShapeDist) {float thinningFadeRatio=clamp((screenDist-u_thinningShape.x)/u_thinningShape.y,0.0,1.0);thinningFadeRatio=pow(thinningFadeRatio,u_thinningShape.z);if (a_snowParticleData.x < u_thinningAffectedRatio) {scaleFactorMode=1.0-thinningFadeRatio;alphaMultiplier=thinningFadeRatio;}}vec4 posScreen1=u_projection*vec4(posView.x-size,posView.yzw);posScreen1/=posScreen1.w;vec4 posScreen2=u_projection*vec4(posView.x+size,posView.yzw);posScreen2/=posScreen2.w;posScreen1.xy=vec2(0.5)+posScreen1.xy*0.5;posScreen1.xy*=u_screenSize;posScreen2.xy=vec2(0.5)+posScreen2.xy*0.5;posScreen2.xy*=u_screenSize;float screenLength=length(posScreen1.xy-posScreen2.xy);float screenEpsilon=3.0;float scaleFactor=1.0;if (screenLength < screenEpsilon) {scaleFactor=screenEpsilon/max(screenLength,0.01);scaleFactor=mix(scaleFactor,1.0,scaleFactorMode);}float screenEpsilon2=15.0;if (screenLength > screenEpsilon2) {scaleFactor=screenEpsilon2/max(screenLength,0.01);}size*=scaleFactor;vec2 right=size*vec2(1,0);vec2 up=size*vec2(0,1);posView.xy+=right*a_uv.x;posView.xy+=up*a_uv.y;uv=a_uv;gl_Position=u_projection*posView;}"),rainParticle:o.bb("in highp vec2 uv;in highp float particleRandomValue;uniform sampler2D u_texScreen;uniform float u_distortionStrength;uniform vec4 u_color;uniform vec2 u_thinningCenterPos;uniform vec3 u_thinningShape;uniform float u_thinningAffectedRatio;uniform float u_thinningParticleOffset;uniform float u_shapeDirectionalPower;uniform float u_mode;void main() {vec2 st=uv*0.5+vec2(0.5);vec2 uvm=uv;uvm.y=-1.0+2.0*pow(st.y,u_shapeDirectionalPower);float shape=clamp(1.0-length(uvm),0.0,1.0);float alpha=abs(shape)*u_color.a;vec2 screenSize=vec2(textureSize(u_texScreen,0));vec2 thinningCenterPos=u_thinningCenterPos.xy;thinningCenterPos.y=screenSize.y-thinningCenterPos.y;float screenDist=length((thinningCenterPos-gl_FragCoord.xy)/(0.5*screenSize));screenDist+=(0.5+0.5*particleRandomValue)*u_thinningParticleOffset;float thinningShapeDist=u_thinningShape.x+u_thinningShape.y;float thinningAlpha=1.0;if (screenDist < thinningShapeDist) {float thinningFadeRatio=clamp((screenDist-u_thinningShape.x)/u_thinningShape.y,0.0,1.0);thinningFadeRatio=pow(thinningFadeRatio,u_thinningShape.z);thinningAlpha*=thinningFadeRatio;}vec2 offsetXY=normalize(uvm)*abs(shape);vec2 stScreen=(gl_FragCoord.xy+offsetXY*u_distortionStrength*thinningAlpha)/screenSize;vec3 colorScreen=texture(u_texScreen,stScreen).rgb;alpha*=thinningAlpha;glFragColor=mix(vec4(colorScreen,1.0),vec4(u_color.rgb*alpha,alpha),u_mode);HANDLE_WIREFRAME_DEBUG;}","\nin highp vec3 a_pos_3f;in highp vec2 a_uv;in highp vec4 a_rainParticleData;uniform mat4 u_modelview;uniform mat4 u_projection;uniform vec3 u_cam_pos;uniform float u_time;uniform float u_boxSize;uniform float u_velocityConeAperture; \nuniform float u_velocity; \nuniform vec2 u_rainDropletSize;uniform vec3 u_rainDirection;out highp vec2 uv;out highp float particleRandomValue;void main() {vec3 pos=a_pos_3f;float halfBoxSize=0.5*u_boxSize;pos*=halfBoxSize; \npos+=u_cam_pos;float velocityConeApertureRad=radians(u_velocityConeAperture*0.5);float coneAnglePichRad=velocityConeApertureRad*a_rainParticleData.z;float coneAngleHeadingRad=a_rainParticleData.w*radians(360.0);vec3 localZ=normalize(u_rainDirection);vec3 localX=normalize(cross(localZ,vec3(1,0,0)));vec3 localY=normalize(cross(localZ,localX));vec3 directionLocal;directionLocal.x=cos(coneAngleHeadingRad)*sin(coneAnglePichRad);directionLocal.y=sin(coneAngleHeadingRad)*sin(coneAnglePichRad);directionLocal.z=cos(coneAnglePichRad);directionLocal=normalize(directionLocal);vec3 directionWorld=localX*directionLocal.x+localY*directionLocal.y+localZ*directionLocal.z;float velocityScale=(1.0+3.0*a_rainParticleData.y)*u_velocity;vec3 simPosLocal=vec3(0,0,0);simPosLocal+=directionLocal*velocityScale*u_time;vec3 simPos=localX*simPosLocal.x+\nlocalY*simPosLocal.y+localZ*simPosLocal.z;pos+=simPos;pos=fract((pos+vec3(halfBoxSize))/vec3(u_boxSize))*u_boxSize-vec3(halfBoxSize);vec4 posView=u_modelview*vec4(pos,1.0);vec3 directionView=normalize((u_modelview*vec4(directionWorld,0.0)).xyz);vec3 side=cross(directionView,normalize(posView.xyz));posView.xyz+=side*a_uv.x*u_rainDropletSize.x;posView.xyz+=directionView*a_uv.y*u_rainDropletSize.y;uv=a_uv;particleRandomValue=a_rainParticleData.x;gl_Position=u_projection*posView;}"),vignette:o.bb("uniform vec3 u_vignetteShape;uniform vec4 u_vignetteColor;in vec2 st;void main() {float screenDist=length(st);float alpha=clamp((screenDist-u_vignetteShape.x)/u_vignetteShape.y,0.0,1.0);alpha=pow(alpha,u_vignetteShape.z)*u_vignetteColor.a;vec3 color=u_vignetteColor.rgb;glFragColor=vec4(color*alpha,alpha) ;}","in vec2 a_pos_2f;out vec2 st;void main() {st=a_pos_2f;gl_Position=vec4(a_pos_2f,0,1);}"),elevatedStructuresDepth:o.bb("void main() {}","in ivec2 a_pos;in float a_height;uniform mat4 u_matrix;uniform float u_depth_bias;void main() {gl_Position=u_matrix*vec4(a_pos,a_height,1);gl_Position.z=gl_Position.z+u_depth_bias;}"),elevatedStructures:o.bb('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_indicator_cutout.fragment.glsl"\n#include "_prelude_feature_cutout.fragment.glsl"\nin vec3 v_normal;in float v_height;\n#ifdef RENDER_SHADOWS\nin highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in float v_depth;\n#endif\nvec3 linearTosRGB(vec3 color) {return pow(color,vec3(1./2.2));}vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}vec3 compute_view_dependent_emissive_color(float ndotl,float emissive_strength,vec3 color)\n{color=sRGBToLinear(color);color=color*(ndotl+(1.0-min(ndotl*57.29,1.0))*emissive_strength);color=linearTosRGB(color.rgb);return color;}uniform float u_emissive_strength;uniform float u_opacity_multiplier;\n#pragma mapbox: define highp vec4 structure_color\nvoid main() {\n#pragma mapbox: initialize highp vec4 structure_color\nvec3 color=structure_color.xyz;vec2 cutout_factors=vec2(0.0);\n#ifdef FEATURE_CUTOUT\ncutout_factors=get_cutout_factors(gl_FragCoord);\n#endif\n#ifdef LIGHTING_3D_MODE\nvec3 normal=normalize(v_normal);vec3 transformed_normal=vec3(-normal.xy,normal.z);float ndotl=calculate_NdotL(transformed_normal);float emissive_strength=u_emissive_strength;emissive_strength=0.0;vec3 emissive_color=compute_view_dependent_emissive_color(ndotl,emissive_strength,color.xyz);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor_normal(transformed_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth);light=mix(light,1.0,cutout_factors.y);color.rgb=apply_lighting(color.rgb,transformed_normal,light);\n#else\ncolor=apply_lighting(color,transformed_normal);\n#endif\ncolor=mix(color,emissive_color,emissive_strength);if (v_height < 0.0) {float penetration=max(v_height+7.5,0.0);float occlusion=1.0-1.0/PI*acos(1.0-penetration/4.0);color=color*(1.0-pow(occlusion,2.0)*0.3);}\n#endif\n#ifdef FOG\ncolor=fog_apply(color,v_fog_pos);\n#endif\nvec4 out_color=vec4(color,1.0);\n#ifdef INDICATOR_CUTOUT\nout_color=applyCutout(out_color,v_height);\n#endif\n#ifdef FEATURE_CUTOUT\nout_color=apply_feature_cutout(out_color,gl_FragCoord,cutout_factors.x,v_height);\n#endif\nout_color*=u_opacity_multiplier;glFragColor=out_color;HANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nin ivec2 a_pos;in float a_height;in ivec4 a_pos_normal_3;uniform mat4 u_matrix;out vec3 v_normal;out float v_height;\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out float v_depth;\n#endif\n#pragma mapbox: define highp vec4 structure_color\nvoid main() {\n#pragma mapbox: initialize highp vec4 structure_color\nv_normal=vec3(a_pos_normal_3)/16384.0;v_height=a_height;vec3 pos=vec3(vec2(a_pos),a_height);gl_Position=u_matrix*vec4(pos,1);\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=pos;vec3 shd_pos1=pos;\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(vec3(-v_normal.xy,v_normal.z));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(vec2(a_pos));\n#endif\n}'),elevatedStructuresDepthReconstruct:o.bb('#include "_prelude_feature_cutout.fragment.glsl"\n#ifdef DEPTH_RECONSTRUCTION\nin float v_height;\n#endif\nvoid main() {\n#ifdef DEPTH_RECONSTRUCTION\nif (v_height >=0.0)\ndiscard;\n#else\n#ifdef FEATURE_CUTOUT\napply_feature_cutout(vec4(0.0,0.0,0.0,1.0),gl_FragCoord,get_cutout_factors(gl_FragCoord).x,0.0);\n#endif\n#endif\nglFragColor=vec4(1.0,0.0,0.0,1.0);}',"in ivec2 a_pos;in float a_height;uniform mat4 u_matrix;uniform vec3 u_camera_pos;uniform highp float u_depth_bias;uniform lowp float u_height_scale;uniform lowp float u_reset_depth;\n#ifdef DEPTH_RECONSTRUCTION\nout float v_height;\n#endif\nvoid main() {vec3 vpos=vec3(a_pos,a_height*u_height_scale);\n#ifdef DEPTH_RECONSTRUCTION\nif (u_camera_pos.z > vpos.z) {vpos-=(u_camera_pos-vpos)*(vpos.z/(u_camera_pos.z-vpos.z));}v_height=a_height;\n#endif\ngl_Position=u_matrix*vec4(vpos,1);gl_Position.z=u_reset_depth==1.0 ? gl_Position.w : gl_Position.z+u_depth_bias;}")};o.bb(Hd,"");const ny=o.a_([{type:"Float32",name:"a_pos_3f",components:3},{type:"Float32",name:"a_uv",components:2},{type:"Float32",name:"a_rainParticleData",components:4}]),ll=o.a_([{type:"Float32",name:"a_pos_2f",components:2}]);class jc{destroy(){this.vignetteVx&&this.vignetteVx.destroy(),this.vignetteIdx&&this.vignetteIdx.destroy()}draw(v,E){const D=v.getOrCreateProgram("vignette");if(!this.vignetteVx||!this.vignetteIdx){const Z=new o.bc,ne=new o.ad;Z.emplaceBack(-1,-1),Z.emplaceBack(1,-1),Z.emplaceBack(1,1),Z.emplaceBack(-1,1),ne.emplaceBack(0,1,2),ne.emplaceBack(0,2,3),this.vignetteVx=v.context.createVertexBuffer(Z,ll.members),this.vignetteIdx=v.context.createIndexBuffer(ne)}const V=o.ac.simpleSegment(0,0,4,6);if(this.vignetteVx&&this.vignetteIdx){v.uploadCommonUniforms(v.context,D);const Z={u_vignetteShape:(Y={vignetteShape:[E.start,E.range,Math.pow(10,E.fadePower)],vignetteColor:[E.color.r,E.color.g,E.color.b,E.color.a*E.strength]}).vignetteShape,u_vignetteColor:Y.vignetteColor};D.draw(v,v.context.gl.TRIANGLES,o.Z.disabled,o._.disabled,o.a1.alphaBlended,o.$.disabled,Z,"vignette",this.vignetteVx,this.vignetteIdx,V)}var Y}}class Wd{constructor(){this._accumulatedOffsetX=0,this._accumulatedOffsetY=0,this._accumulatedElevation=0}update(v,E){const D=v.getFreeCameraOptions().position,V=D.toAltitude(),Y=D.toLngLat(),Z=o.au(Y.lng),ne=o.au(Y.lat),le=v.pixelsPerMeter/E,fe=Z*o.bj,me=o.bj*Math.log(Math.tan(Math.PI/4+ne/2));if(void 0===this._offsetXPrev)this._offsetXPrev=0,this._offsetYPrev=0,this._elevationPrev=0,this._accumulatedOffsetX=0,this._accumulatedOffsetY=0,this._accumulatedElevation=0;else{const Pe=-this._offsetYPrev+me,Re=-this._elevationPrev+V;this._accumulatedOffsetX+=(-this._offsetXPrev+fe)*le,this._accumulatedOffsetY+=Pe*le,this._accumulatedElevation+=Re*le,this._offsetXPrev=fe,this._offsetYPrev=me,this._elevationPrev=V}}getPosition(){return[this._accumulatedOffsetX,this._accumulatedOffsetY,this._accumulatedElevation]}}function em(k,v){return[-(k[0]-Math.floor(k[0]/v)*v),-(k[1]-Math.floor(k[1]/v)*v),-(k[2]-Math.floor(k[2]/v)*v)]}function dp(k){const v=o.bi(1323123451230),E=[];for(let D=0;D({u_matrix:k,u_depth_bias:v}),Zm=(k,v)=>({u_matrix:k,u_ground_shadow_factor:v,u_opacity_multiplier:1}),Dc=(k,v,E,D,V)=>({u_matrix:k,u_camera_pos:[v[0],v[1],v[2]],u_depth_bias:E,u_height_scale:D,u_reset_depth:V}),fp={building:k=>({u_matrix:new o.a5(k),u_normal_matrix:new o.a5(k),u_opacity:new o.a4(k),u_faux_facade_ao_intensity:new o.a4(k),u_camera_pos:new o.a6(k),u_tile_to_meter:new o.a4(k),u_facade_emissive_chance:new o.a4(k),u_flood_light_color:new o.a6(k),u_flood_light_intensity:new o.a4(k),u_front_cutoff_params:new o.a6(k)}),buildingBloom:k=>({u_matrix:new o.a5(k)}),buildingDepth:k=>({u_matrix:new o.a5(k)}),elevatedStructuresDepth:k=>({u_matrix:new o.a5(k),u_depth_bias:new o.a4(k)}),elevatedStructures:k=>({u_matrix:new o.a5(k),u_ground_shadow_factor:new o.a6(k),u_opacity_multiplier:new o.a4(k)}),elevatedStructuresDepthReconstruct:k=>({u_matrix:new o.a5(k),u_camera_pos:new o.a6(k),u_depth_bias:new o.a4(k),u_height_scale:new o.a4(k),u_reset_depth:new o.a4(k)}),rasterParticle:k=>({u_matrix:new o.a5(k),u_normalize_matrix:new o.a5(k),u_globe_matrix:new o.a5(k),u_merc_matrix:new o.a5(k),u_grid_matrix:new o.aZ(k),u_tl_parent:new o.a3(k),u_scale_parent:new o.a4(k),u_fade_t:new o.a4(k),u_opacity:new o.a4(k),u_image0:new o.aX(k),u_image1:new o.aX(k),u_raster_elevation:new o.a4(k),u_zoom_transition:new o.a4(k),u_merc_center:new o.a3(k),u_cutoff_params:new o.aY(k)}),rasterParticleTexture:k=>({u_texture:new o.aX(k),u_opacity:new o.a4(k)}),rasterParticleDraw:k=>({u_particle_texture:new o.aX(k),u_particle_texture_side_len:new o.a4(k),u_tile_offset:new o.a3(k),u_velocity:new o.aX(k),u_color_ramp:new o.aX(k),u_velocity_res:new o.a3(k),u_max_speed:new o.a4(k),u_uv_offset:new o.a3(k),u_data_scale:new o.a3(k),u_data_offset:new o.a4(k),u_particle_pos_scale:new o.a4(k),u_particle_pos_offset:new o.a3(k)}),rasterParticleUpdate:k=>({u_particle_texture:new o.aX(k),u_particle_texture_side_len:new o.a4(k),u_velocity:new o.aX(k),u_velocity_res:new o.a3(k),u_max_speed:new o.a4(k),u_speed_factor:new o.a4(k),u_reset_rate:new o.a4(k),u_rand_seed:new o.a4(k),u_uv_offset:new o.a3(k),u_data_scale:new o.a3(k),u_data_offset:new o.a4(k),u_particle_pos_scale:new o.a4(k),u_particle_pos_offset:new o.a3(k)}),snowParticle:k=>({u_modelview:new o.a5(k),u_projection:new o.a5(k),u_time:new o.a4(k),u_cam_pos:new o.a6(k),u_velocityConeAperture:new o.a4(k),u_velocity:new o.a4(k),u_horizontalOscillationRadius:new o.a4(k),u_horizontalOscillationRate:new o.a4(k),u_boxSize:new o.a4(k),u_billboardSize:new o.a4(k),u_simpleShapeParameters:new o.a3(k),u_screenSize:new o.a3(k),u_thinningCenterPos:new o.a3(k),u_thinningShape:new o.a6(k),u_thinningAffectedRatio:new o.a4(k),u_thinningParticleOffset:new o.a4(k),u_particleColor:new o.aY(k),u_direction:new o.a6(k)}),rainParticle:k=>({u_modelview:new o.a5(k),u_projection:new o.a5(k),u_time:new o.a4(k),u_cam_pos:new o.a6(k),u_texScreen:new o.aX(k),u_velocityConeAperture:new o.a4(k),u_velocity:new o.a4(k),u_boxSize:new o.a4(k),u_rainDropletSize:new o.a3(k),u_distortionStrength:new o.a4(k),u_rainDirection:new o.a6(k),u_color:new o.aY(k),u_screenSize:new o.a3(k),u_thinningCenterPos:new o.a3(k),u_thinningShape:new o.a6(k),u_thinningAffectedRatio:new o.a4(k),u_thinningParticleOffset:new o.a4(k),u_shapeDirectionalPower:new o.a4(k),u_shapeNormalPower:new o.a4(k),u_mode:new o.a4(k)}),vignette:k=>({u_vignetteShape:new o.a6(k),u_vignetteColor:new o.aY(k)})};function Dl(k,v){const E=1<0;--E){const D=Math.floor(v.x/(1<0;--Pe){const Re=Math.floor(v.x/(1<ne[It]!=at>ne[It]&&Z[It]D&&(xt|=2),KeV&&(xt|=8),otD&&(vt|=2),atV&&(vt|=8),!(xt&vt)){if(0===xt||0===vt)return false;if(Ch(Re,Ke,ot,at,v,E,D,V))return false}}}for(let le=0;le<4;++le)if(!(1&Y[le]))return false;return true}function Ch(k,v,E,D,V,Y,Z,ne){const le=(fe,me,Pe,Re,Ke,ot,at,xt)=>{const vt=(Pe-fe)*(ot-me)-(Re-me)*(Ke-fe),It=(Pe-fe)*(xt-me)-(Re-me)*(at-fe);if(vt>0&&It>0||vt<0&&It<0)return false;const jt=(at-Ke)*(me-ot)-(xt-ot)*(fe-Ke),Zt=(at-Ke)*(Re-ot)-(xt-ot)*(Pe-Ke);return!(jt>0&&Zt>0||jt<0&&Zt<0)};return!!(le(k,v,E,D,V,Y,Z,Y)||le(k,v,E,D,Z,Y,Z,ne)||le(k,v,E,D,V,ne,Z,ne)||le(k,v,E,D,V,Y,V,ne))}class QS{constructor(){this._tileCoverages=[],this._snapshot=new iy}clear(){this._tileCoverages=[]}addTileCoverage(v,E){this._tileCoverages.push({tileId:v,polygons:E,frcMask:md(E)})}empty(){return 0===this._tileCoverages.length}updateSnapshotIfNeeded(){if(this._snapshot.equals(this._tileCoverages))return this._snapshot;const v=this._tileCoverages.map(E=>({tileId:E.tileId,polygons:E.polygons,frcMask:E.frcMask}));return this._snapshot=new iy(v),this._snapshot}}function l0(k,v){const E={};if(!v)return E;for(const D of k){const V=D.layerIds.map(Y=>v.getLayer(Y)).filter(Boolean);if(0!==V.length){D.layers=V,D.stateDependentLayerIds&&(D.stateDependentLayers=D.stateDependentLayerIds.map(Y=>V.filter(Z=>Z.id===Y)[0])),D.updateExpressions&&D.updateExpressions(V);for(const Y of V)E[Y.fqid]=D}}return E}const hp=32,c0=33,Cb=new Uint16Array(8184);for(let k=0;k<2046;k++){let v=k+2,E=0,D=0,V=0,Y=0,Z=0,ne=0;for(1&v?V=Y=Z=hp:E=D=ne=hp;(v>>=1)>1;){const fe=E+V>>1,me=D+Y>>1;1&v?(V=E,Y=D,E=Z,D=ne):(E=V,D=Y,V=Z,Y=ne),Z=fe,ne=me}const le=4*k;Cb[le+0]=E,Cb[le+1]=D,Cb[le+2]=V,Cb[le+3]=Y}const tm=new Uint16Array(2178),gd=new Uint8Array(1089),Sb=new Uint16Array(1089);function Zx(k){return 0===k?-.03125:32===k?.03125:0}var Iv=o.a_([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Uint16",components:2}]);const Si=(()=>({type:2,extent:o.a2,loadGeometry:()=>[[new o.P(0,0),new o.P(o.a2+1,0),new o.P(o.a2+1,o.a2+1),new o.P(0,o.a2+1),new o.P(0,0)]]}))();let fT,Wo=0;class Mv{constructor(v,E,D,V,Y,Z){this.tileID=v,this.uid=o.av(),this.uses=0,this.tileSize=E,this.tileZoom=D,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=false,this.hasTunnelGeometry=false,this.hasRTLText=false,this.dependencies={},this.isRaster=Y,V&&V.style&&(this._lastUpdatedBrightness=V.style.getBrightness()),this._lastAvailableImagesCount=0,this._firstPrepareComplete=false,this.expiredRequestCount=0,this.state="loading",V&&V.transform&&(this.projection=V.transform.projection),this.worldview=Z,this._hasAppearances=null}registerFadeDuration(v){const E=v+this.timeAdded;E0&&(this.frcCoveragePolygons=v.frcCoveragePolygons),this.hasDeferredRoadStructure=!!v.hasDeferredRoadStructure,void 0!==v.parsedElevationFeatures&&(this.parsedElevationFeatures=v.parsedElevationFeatures,this.parsedElevationGeneration=++Wo),this.hasDeferredElevationFeatures=!!v.hasDeferredElevationFeatures,this.hasSymbolBuckets=false,this.hasTunnelGeometry=!!v.hasTunnelGeometry;for(const V in this.buckets){const Y=this.buckets[V];if(Y instanceof o.bu){if(this.hasSymbolBuckets=true,!D)break;Y.justReloaded=true}}if(this.hasRTLText=false,this.hasSymbolBuckets)for(const V in this.buckets){const Y=this.buckets[V];if(Y instanceof o.bu&&Y.hasRTLText){this.hasRTLText=true,o.bN();break}}this.queryPadding=0;for(const V in this.buckets){const Y=this.buckets[V],Z=E.style.getOwnLayer(V);if(!Z)continue;const ne=Z.queryRadius(Y)||0;this.queryPadding=Math.max(this.queryPadding,ne)}v.imageAtlas&&(this.imageAtlas=E.style.imageManager.imageAtlasCache.getOrCache(v.imageAtlas)),v.glyphAtlasImage&&(this.glyphAtlasImage=v.glyphAtlasImage),v.lineAtlas&&(this.lineAtlas=v.lineAtlas),this._lastUpdatedBrightness=v.brightness}else this.collisionBoxArray=new o.bt}unloadVectorData(){if(this.hasData()){for(const v in this.buckets)this.buckets[v].destroy();this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&(this.imageAtlasTexture=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.lineAtlasTexture&&this.lineAtlasTexture.destroy(),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this._tileDebugIndexBuffer&&(this._tileDebugIndexBuffer.destroy(),this._tileDebugIndexBuffer=null),this._globeTileDebugBorderBuffer&&(this._globeTileDebugBorderBuffer.destroy(),this._globeTileDebugBorderBuffer=null),this._tileDebugTextBuffer&&(this._tileDebugTextBuffer.destroy(),this._tileDebugTextSegments.destroy(),this._tileDebugTextIndexBuffer.destroy(),this._tileDebugTextBuffer=null),this._globeTileDebugTextBuffer&&(this._globeTileDebugTextBuffer.destroy(),this._globeTileDebugTextBuffer=null),this.latestFeatureIndex=null,this.state="unloaded"}}loadModelData(v,E,D){v&&(v.resourceTiming&&(this.resourceTiming=v.resourceTiming),this.buckets={...this.buckets,...l0(v.buckets,E.style)},v.featureIndex&&(this.latestFeatureIndex=v.featureIndex))}getBucket(v){return this.buckets[v.fqid]}upload(v,E){for(const Y in this.buckets){const Z=this.buckets[Y];if(Z.uploadPending()){let ne={},le=[],fe={zoom:0,pitch:0,brightness:0,worldview:""};if(E){if(E.style){le=E.style.listImages();const me=Z.layers[0],Pe=me.sourceLayer||"_geojsonTileLayer",Re=E.style.getLayerSourceCache(me);Re&&(ne=Re._state.getState(Pe,void 0))}fe={zoom:E.transform.zoom||0,pitch:E.transform.pitch||0,brightness:E.style.getBrightness()||0,worldview:E.worldview||""}}Z.upload(v,this.tileID.canonical,ne,le,fe)}}const D=v.gl,V=this.imageAtlas;V&&E&&(this.imageAtlasTexture=E.style.imageManager.imageAtlasCache.getTextureForAtlas(V,v,D.RGBA8),V.uploaded=true),this.glyphAtlasImage&&(this.glyphAtlasTexture=new o.T(v,this.glyphAtlasImage,D.R8),this.glyphAtlasImage=null),this.lineAtlas&&!this.lineAtlas.uploaded&&(this.lineAtlasTexture=new o.T(v,this.lineAtlas.image,D.R8),this.lineAtlas.uploaded=true)}prepare(v,E,D){if(this.imageAtlas&&this.imageAtlasTexture&&E){const Re=E.style.getLut(D);this.imageAtlas.patchUpdatedImages(v,this.imageAtlasTexture,D,Re)}if(!E||!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData)return;const V=E.style.getBrightness(),Y=E.style.listImages(),Z=Y.length,ne=E.style._changes.getUpdatedPaintProperties(),le=Object.keys(this.buckets).some(Re=>this.buckets[Re].layers.some(Ke=>ne.has(Ke.fqid))),fe=Object.keys(this.buckets).some(Re=>this.buckets[Re].layers.some(Ke=>Ke.hasTransition&&Ke.hasTransition())),me=this._firstPrepareComplete&&Z!==this._lastAvailableImagesCount;null===this._hasAppearances&&(this._hasAppearances=this.hasAppearances(E));const Pe=this._lastUpdatedBrightness!==V;this._lastAvailableImagesCount=Z,this._firstPrepareComplete=true,(this._lastUpdatedBrightness||V||this._hasAppearances||le||fe||me)&&(!(this._hasAppearances||le||fe||me)&&this._lastUpdatedBrightness&&V&&Math.abs(this._lastUpdatedBrightness-V)<.001||(this.updateBuckets(E,Pe,void 0,me||le||fe,ne,Y),this._lastUpdatedBrightness=V))}evaluateQueryRenderedFeaturePadding(){let v=0;for(const E in this.buckets){const D=this.buckets[E];D.evaluateQueryRenderedFeaturePadding&&(v=Math.max(v,D.evaluateQueryRenderedFeaturePadding()))}return v}queryRenderedFeatures(v,E,D,V,Y,Z,ne){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData&&!this.latestFeatureIndex.is3DTile)return{};const le=this.evaluateQueryRenderedFeaturePadding(),fe=function(me,Pe){const Re=o.bL([],[.5*me.width,.5*-me.height,1]);return o.bM(Re,Re,[1,-1,0]),o.X(Re,Re,me.calculateProjMatrix(Pe.toUnwrapped())),Float32Array.from(Re)}(Y,this.tileID);return this.latestFeatureIndex.query(v,{tilespaceGeometry:E,pixelPosMatrix:fe,transform:V,availableImages:D,tileTransform:this.tileTransform,worldview:this.worldview,queryRadius:le,scope:ne})}querySourceFeatures(v,E){const D=this.latestFeatureIndex;if(!D||!D.rawTileData)return;const V=D.loadVTLayers(),Y=E?E.sourceLayer:"",Z=V._geojsonTileLayer||V[Y];if(!Z)return;const ne=o.bv(E&&E.filter),{z:le,x:fe,y:me}=this.tileID.canonical,Pe={z:le,x:fe,y:me};for(let Re=0;ReD)V=false;else if(E)if(this.expirationTimeD.appearances&&D.appearances.length>0))return true;return false}updateBuckets(v,E,D,V,Y,Z){if(!this.latestFeatureIndex)return;if(!v.style)return;const ne=Z||v.style.listImages(),le=v.style.getBrightness(),fe=Y||new Set;for(const me in this.buckets){if(!v.style.hasLayer(me))continue;const Pe=this.buckets[me],Re=Pe.layers[0],Ke=Re.sourceLayer||"_geojsonTileLayer",ot=v.style.getLayerSourceCache(Re),at=Pe.layers.some(cn=>fe.has(cn.fqid)),xt=(V||at)&&Pe instanceof o.bu?v.style.getOwnLayer(me):void 0;let vt=D&&D[Ke]||{};ot&&!D&&(vt=ot._state.getState(Ke,void 0));const It=this.imageAtlas?Object.fromEntries(this.imageAtlas.patternPositions):{},jt=Object.keys(vt).length>0&&!E;Pe.hasAppearances=Pe.layers.some(cn=>cn.appearances&&cn.appearances.length>0);const Zt=jt?Pe.stateDependentLayers:Pe.layers;if(jt&&0!==Pe.stateDependentLayers.length||E||at||V){const cn=this.latestFeatureIndex.loadVTLayers()[Ke];if(Pe.update(vt,cn,ne,It,Zt,E,le,this.tileID.canonical),(V||at)&&(!E||E&&Pe instanceof o.bu&&(!Pe.text.uboBinder||Pe.text.uboBinder.isLightConstant||!Pe.icon.uboBinder||Pe.icon.uboBinder.isLightConstant))&&Pe instanceof o.bu&&xt&&"symbol"===xt.type){const hn=Pe;hn.text&&hn.text.uboBinder&&hn.text.uboBinder.updateDynamicExpressions(xt,cn,this.tileID.canonical,ne,vt,le),hn.icon&&hn.icon.uboBinder&&hn.icon.uboBinder.updateDynamicExpressions(xt,cn,this.tileID.canonical,ne,vt,le)}if(Pe instanceof o.bu){const hn=Pe,xn=v.context;hn.text&&hn.text.uboBinder&&hn.text.uboBinder.upload(xn),hn.icon&&hn.icon.uboBinder&&hn.icon.uboBinder.upload(xn)}}if(jt&&0!==Pe.stateDependentLayers.length||E||Pe.hasAppearances){const cn={zoom:v.transform.zoom,pitch:v.transform.pitch,brightness:v.style.getBrightness()||0,worldview:v.worldview},hn=Pe.updateAppearances(this.tileID.canonical,vt,ne,cn,v.imageManager,jt&&0!==Pe.stateDependentLayers.length);if(hn&&hn.hasUboChanges){const xn=v.context;Pe instanceof o.bu&&Pe.text&&Pe.text.uboBinder&&Pe.text.uboBinder.upload(xn),Pe instanceof o.bu&&Pe.icon&&Pe.icon.uboBinder&&Pe.icon.uboBinder.upload(xn)}}(Pe instanceof o.bz||Pe instanceof o.bA)&&v._terrain&&v._terrain.enabled&&ot&&Pe.uploadPending()&&v._terrain._clearRenderCacheForTile(ot.id,this.tileID);const kn=v&&v.style&&v.style.getOwnLayer(me);kn&&(this.queryPadding=Math.max(this.queryPadding,kn.queryRadius(Pe)||0))}}holdingForFade(){return void 0!==this.symbolFadeHoldUntil}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil=0;xt--){const vt=4*xt,It=Cb[vt+0],jt=Cb[vt+1],Zt=Cb[vt+2],kn=Cb[vt+3],cn=It+Zt>>1,hn=jt+kn>>1,xn=cn+hn-jt,wn=hn+It-cn,Bn=jt*c0+It,Kn=kn*c0+Zt,Wn=hn*c0+cn,Yn=Math.hypot((tm[2*Bn+0]+tm[2*Kn+0])/2-tm[2*Wn+0],(tm[2*Bn+1]+tm[2*Kn+1])/2-tm[2*Wn+1])>=16;gd[Wn]=gd[Wn]||(Yn?1:0),xt<1022&&(gd[Wn]=gd[Wn]||gd[(jt+wn>>1)*c0+(It+xn>>1)]||gd[(kn+wn>>1)*c0+(Zt+xn>>1)])}const Pe=new o.bs,Re=new o.ad;let Ke=0;function ot(xt,vt){const It=vt*c0+xt;return 0===Sb[It]&&(Pe.emplaceBack(tm[2*It+0],tm[2*It+1],xt*o.a2/hp,vt*o.a2/hp),Sb[It]=++Ke),Sb[It]-1}function at(xt,vt,It,jt,Zt,kn){const cn=xt+It>>1,hn=vt+jt>>1;if(Math.abs(xt-Zt)+Math.abs(vt-kn)>1&&gd[hn*c0+cn])at(Zt,kn,xt,vt,cn,hn),at(It,jt,Zt,kn,cn,hn);else{const xn=ot(xt,vt),wn=ot(It,jt),Bn=ot(Zt,kn);Re.emplaceBack(xn,wn,Bn)}}return at(0,0,hp,hp,hp,0),at(hp,hp,0,0,0,hp),{vertices:Pe,indices:Re}}(this.tileID.canonical,E);V=Z.vertices,Y=Z.indices}else{V=new o.bs,Y=new o.ad;for(const{x:ne,y:le}of D)V.emplaceBack(ne,le,0,0);const Z=o.bF(V.int16.subarray(0,4*V.length),void 0,4);for(let ne=0;ne0&&(le=o.aO(new Float64Array(16),E.globeMatrix)),this._makeGlobeTileDebugBorderBuffer(v,V,E,Z,le,ne),this._makeGlobeTileDebugTextBuffer(v,V,E,Z,le,ne)}_globePoint(v,E,D,V,Y,Z,ne){let le=o.bG(v,E,D);if(Z){const fe=1<.5?Ke=-1:Re<-.5&&(Ke=1);let ot=(v/o.a2+D.x)/fe+Ke,at=(E/o.a2+D.y)/fe;ot=(ot-me)*V._pixelsPerMercatorPixel+me,at=(at-Pe)*V._pixelsPerMercatorPixel+Pe;const xt=[ot*V.worldSize,at*V.worldSize,0];o.bH(xt,xt,Z),le=o.bI(le,xt,ne)}return o.bH(le,le,Y)}_makeGlobeTileDebugBorderBuffer(v,E,D,V,Y,Z){const ne=new o.bC,le=new o.bD,fe=new o.bJ,me=(Re,Ke,ot,at,xt)=>{const vt=(ot-Re)/(xt-1),It=(at-Ke)/(xt-1),jt=ne.length;for(let Zt=0;ZtPe*Ke+ot;for(let Ke=0;Ke{this.remove(v,Y)},D)),this.data[V].push(Y),this.order.push(V),this.order.length>this.max){const Z=this._getAndRemoveByKey(this.order[0]);Z&&this.onRemove(Z)}return this}has(v){return v.wrapped().key in this.data}getAndRemove(v){return this.has(v)?this._getAndRemoveByKey(v.wrapped().key):null}_getAndRemoveByKey(v){const E=this.data[v].shift();return E.timeout&&clearTimeout(E.timeout),0===this.data[v].length&&delete this.data[v],this.order.splice(this.order.indexOf(v),1),E.value}getByKey(v){const E=this.data[v];return E?E[0].value:null}get(v){return this.has(v)?this.data[v.wrapped().key][0].value:null}remove(v,E){if(!this.has(v))return this;const D=v.wrapped().key,V=void 0===E?0:this.data[D].indexOf(E),Y=this.data[D][V];return this.data[D].splice(V,1),Y.timeout&&clearTimeout(Y.timeout),0===this.data[D].length&&delete this.data[D],this.onRemove(Y.value),this.order.splice(this.order.indexOf(D),1),this}setMaxSize(v){for(this.max=v;this.order.length>this.max;){const E=this._getAndRemoveByKey(this.order[0]);E&&this.onRemove(E)}return this}filter(v){const E=[];for(const D in this.data)for(const V of this.data[D])v(V.value)||E.push(V);for(const D of E)this.remove(D.value.tileID,D)}}class a7{constructor(){this.state=Object.create(null),this.stateChanges=Object.create(null),this.deletedStates=Object.create(null)}updateState(v,E,D){const V=String(E);if(this.stateChanges[v]=this.stateChanges[v]||Object.create(null),this.stateChanges[v][V]=this.stateChanges[v][V]||Object.create(null),Object.assign(this.stateChanges[v][V],D),null===this.deletedStates[v]){this.deletedStates[v]=Object.create(null);for(const Y in this.state[v])Y!==V&&(this.deletedStates[v][Y]=null)}else if(this.deletedStates[v]&&null===this.deletedStates[v][V]){this.deletedStates[v][V]=Object.create(null);for(const Y in this.state[v][V])D[Y]||(this.deletedStates[v][V][Y]=null)}else for(const Y in D)this.deletedStates[v]&&this.deletedStates[v][V]&&null===this.deletedStates[v][V][Y]&&delete this.deletedStates[v][V][Y]}removeFeatureState(v,E,D){if(null===this.deletedStates[v])return;const V=String(E);if(this.deletedStates[v]=this.deletedStates[v]||Object.create(null),D&&void 0!==E)null!==this.deletedStates[v][V]&&(this.deletedStates[v][V]=this.deletedStates[v][V]||Object.create(null),this.deletedStates[v][V][D]=null);else if(void 0!==E)if(this.stateChanges[v]&&this.stateChanges[v][V])for(D in this.deletedStates[v][V]=Object.create(null),this.stateChanges[v][V])this.deletedStates[v][V][D]=null;else this.deletedStates[v][V]=null;else this.deletedStates[v]=null}getState(v,E){const D=this.state[v]||Object.create(null),V=this.stateChanges[v]||Object.create(null),Y=this.deletedStates[v];if(null===Y)return Object.create(null);if(void 0!==E){const ne=String(E),le=Object.assign(Object.create(null),D[ne],V[ne]);if(Y){const fe=Y[E];if(null===fe)return Object.create(null);for(const me in fe)delete le[me]}return le}const Z=Object.assign(Object.create(null),D,V);if(Y)for(const ne in Y)delete Z[ne];return Z}initializeTileState(v,E){v.refreshFeatureState(E)}coalesceChanges(v,E){const D=Object.create(null);for(const V in this.stateChanges){this.state[V]=this.state[V]||Object.create(null);const Y=Object.create(null);for(const Z in this.stateChanges[V])this.state[V][Z]||(this.state[V][Z]=Object.create(null)),Object.assign(this.state[V][Z],this.stateChanges[V][Z]),Y[Z]=this.state[V][Z];D[V]=Y}for(const V in this.deletedStates){this.state[V]=this.state[V]||Object.create(null);const Y=Object.create(null);if(null===this.deletedStates[V])for(const Z in this.state[V])Y[Z]=Object.create(null),this.state[V][Z]=Object.create(null);else for(const Z in this.deletedStates[V]){if(null===this.deletedStates[V][Z])this.state[V][Z]=Object.create(null);else if(this.state[V][Z])for(const ne of Object.keys(this.deletedStates[V][Z]))delete this.state[V][Z][ne];Y[Z]=this.state[V][Z]}D[V]=D[V]||Object.create(null),Object.assign(D[V],Y)}if(this.stateChanges=Object.create(null),this.deletedStates=Object.create(null),0!==Object.keys(D).length)for(const V in v)v[V].refreshFeatureState(E,D)}}class pp extends o.E{constructor(v,E,D){super(),this.id=v,this._renderSourceType=D,this._maxzoomOverride=null,this.setSource(E),this._tiles={},this._cache=new o7(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._minTileCacheSize=E.minTileCacheSize,this._maxTileCacheSize=E.maxTileCacheSize,this._loadedParentTiles={},this.castsShadows=false,this.tileCoverLift=0,this._coveredTiles={},this._shadowCasterTiles={},this._state=new a7,this._isRaster="raster"===this._source.type||"raster-dem"===this._source.type||"raster-array"===this._source.type||"custom"===this._source.type&&"_dataType"in this._source&&"raster"===this._source._dataType,this._supportsFading="raster"===this._source.type||"raster-array"===this._source.type||"image"===this._source.type||"video"===this._source.type||"custom"===this._source.type,this._isRasterElevatedOverTerrain=false}onAdd(v){this.map=v,this._minTileCacheSize=void 0===this._minTileCacheSize&&v?v._minTileCacheSize:this._minTileCacheSize,this._maxTileCacheSize=void 0===this._maxTileCacheSize&&v?v._maxTileCacheSize:this._maxTileCacheSize}setSource(v){v.on("data",E=>{"source"===E.dataType&&"metadata"===E.sourceDataType&&(this._sourceLoaded=true),this._sourceLoaded&&!this._paused&&"source"===E.dataType&&"content"===E.sourceDataType&&(this.reload(),this.transform&&this.update(this.transform))}),v.on("error",()=>{this._sourceErrored=true}),this._source=v}loaded(){if(this._sourceErrored)return true;if(!this._sourceLoaded)return false;if(!this._source.loaded())return false;for(const v in this._tiles)if(!this._tiles[v].loaded())return false;return true}getSource(){return this._source}pause(){this._paused=true}resume(){if(!this._paused)return;const v=this._shouldReloadOnResume;this._paused=false,this._shouldReloadOnResume=false,v&&this.reload(),this.transform&&this.update(this.transform)}setMaxzoomOverride(v){this._maxzoomOverride=v}_loadTile(v,E){return v.renderSourceType=this._renderSourceType,v.isExtraShadowCaster=this._shadowCasterTiles[v.tileID.key],this._source.loadTile(v,E)}_unloadTile(v){if(this._source.unloadTile)return this._source.unloadTile(v)}_abortTile(v){if(this._source.abortTile)return this._source.abortTile(v)}serialize(){return this._source.serialize()}prepare(v){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const E in this._tiles){const D=this._tiles[E];D.upload(v,this.map?this.map.painter:void 0),D.prepare(this.map.style.imageManager,this.map?this.map.painter:null,this._source.scope)}}getIds(){return Object.values(this._tiles).map(v=>v.tileID).sort(v2).map(v=>v.key)}getRenderableIds(v,E){const D=[];for(const V in this._tiles)this._isIdRenderable(+V,v,E)&&D.push(this._tiles[V]);return v?D.sort((V,Y)=>{const Z=V.tileID,ne=Y.tileID,le=new o.P(Z.canonical.x,Z.canonical.y)._rotate(this.transform.angle),fe=new o.P(ne.canonical.x,ne.canonical.y)._rotate(this.transform.angle);return Z.overscaledZ-ne.overscaledZ||fe.y-le.y||fe.x-le.x}).map(V=>V.tileID.key):D.map(V=>V.tileID).sort(v2).map(V=>V.key)}hasRenderableParent(v){const E=this.findLoadedParent(v,0);return!!E&&this._isIdRenderable(E.tileID.key)}_isIdRenderable(v,E,D){return this._tiles[v]&&this._tiles[v].hasData()&&!this._coveredTiles[v]&&(E||!this._tiles[v].holdingForFade())&&(D||!this._shadowCasterTiles[v])}reload(){if(this._paused)this._shouldReloadOnResume=true;else{this._cache.reset();for(const v in this._tiles)"errored"!==this._tiles[v].state&&this._reloadTile(+v,"reloading")}}_reloadTile(v,E){const D=this._tiles[v];D&&("loading"!==D.state&&(D.state=E),this._loadTile(D,this._tileLoaded.bind(this,D,v,E)))}_tileLoaded(v,E,D,V,Y){if(V){if(v.state="errored",o.bO(V)){if(this._source.fire(new o.h("data",{dataType:"source",sourceDataType:"error",sourceId:this._source.id,tile:v})),!(v.tileID.key in this._loadedParentTiles))return;if("raster-dem"===this._source.type&&this.usedForTerrain&&this.map.painter.terrain){const ne=this.map.painter.terrain;this.update(this.transform,ne.getScaledDemTileSize(),true),ne.resetTileLookupCache(this.id)}else this.update(this.transform)}else this._source.fire(new o.f(V,{tile:v}));return}v.timeAdded=o.e.now(),"expired"===D&&(v.refreshedUponExpiration=true),this._setTileReloadTimer(E,v),"raster-dem"===this._source.type&&v.dem&&this._backfillDEM(v),this._state.initializeTileState(v,this.map?this.map.painter:null);let Z=new Headers;Y&&Y.headers&&(Z=Y.headers),this._source.fire(new o.h("data",{dataType:"source",tile:v,coord:v.tileID,sourceCacheId:this.id,responseHeaders:Z}))}_hasTunnelGeometry(){for(const v in this._tiles){const E=this._tiles[v];if(E&&E.hasTunnelGeometry)return true}return false}_backfillDEM(v){const E=this.getRenderableIds();for(let V=0;V1||(Math.abs(Z)>1&&(1===Math.abs(Z+le)?Z+=le:1===Math.abs(Z-le)&&(Z-=le)),Y.dem&&V.dem&&(V.dem.backfillBorder(Y.dem,Z,ne),V.neighboringTiles&&V.neighboringTiles[fe]&&(V.neighboringTiles[fe].backfilled=true)))}}getTile(v){return this.getTileByID(v.key)}getTileByID(v){return this._tiles[v]}_retainLoadedChildren(v,E,D,V){for(const Y in this._tiles){let Z=this._tiles[Y];if(V[Y]||!Z.hasData()||Z.tileID.overscaledZ<=E||Z.tileID.overscaledZ>D)continue;let ne=Z.tileID;for(;Z&&Z.tileID.overscaledZ>E+1;){const fe=Z.tileID.scaledTo(Z.tileID.overscaledZ-1);Z=this._tiles[fe.key],Z&&Z.hasData()&&(ne=fe)}let le=ne;for(;le.overscaledZ>E;)if(le=le.scaledTo(le.overscaledZ-1),v[le.key]){V[ne.key]=ne;break}}}findLoadedParent(v,E){if(v.key in this._loadedParentTiles){const D=this._loadedParentTiles[v.key];return D&&D.tileID.overscaledZ>=E?D:null}for(let D=v.overscaledZ-1;D>=E;D--){const V=v.scaledTo(D),Y=this._getLoadedTile(V);if(Y)return Y}}_getLoadedTile(v){const E=this._tiles[v.key];return E&&E.hasData()?E:this._cache.getByKey(this._source.reparseOverscaled?v.wrapped().key:v.canonical.key)}updateCacheSize(v,E){E=E||this._source.tileSize;const D=Math.ceil(v.width/E)+1,V=Math.ceil(v.height/E)+1,Y=Math.floor(D*V*5),Z="number"==typeof this._minTileCacheSize?Math.max(this._minTileCacheSize,Y):Y,ne="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,Z):Z;this._cache.setMaxSize(ne)}handleWrapJump(v){const E=Math.round((v-(void 0===this._prevLng?v:this._prevLng))/360);if(this._prevLng=v,E){const D={};for(const V in this._tiles){const Y=this._tiles[V];Y.tileID=Y.tileID.unwrapTo(Y.tileID.wrap+E),D[Y.tileID.key]=Y}this._tiles=D;for(const V in this._timers)clearTimeout(this._timers[V]),delete this._timers[V];for(const V in this._tiles)this._setTileReloadTimer(+V,this._tiles[V])}}update(v,E,D,V,Y){if(this.transform=v,!this._sourceLoaded||this._paused||this.transform.freezeTileCoverage)return;if(this.usedForTerrain&&!D)return;this.updateCacheSize(v,E),"globe"!==this.transform.projection.name&&this.handleWrapJump(this.transform.center.lng),this._shadowCasterTiles={},this._coveredTiles={};const Z="batched-model"===this._source.type;let ne,le=this._source.maxzoom;null!==this._maxzoomOverride&&(le=Math.min(le,this._maxzoomOverride));const fe=this.map&&this.map.painter?this.map.painter._terrain:null;if(fe&&fe.sourceCache===this&&fe.attenuationRange()){const Ke=fe.attenuationRange()[0],ot=Math.floor(Ke)-Math.log2(fe.getDemUpscale());le>ot&&(le=ot)}const me=null===this._maxzoomOverride&&this._source.reparseOverscaled;if(this.used||this.usedForTerrain){if(this._source.tileID)ne=v.getVisibleUnwrappedCoordinates(this._source.tileID).map(Ke=>new o.bP(Ke.canonical.z,Ke.wrap,Ke.canonical.z,Ke.canonical.x,Ke.canonical.y));else if(0!==this.tileCoverLift){const Ke=v.clone();Ke.tileCoverLift=this.tileCoverLift,ne=Ke.coveringTiles({tileSize:E||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:le,roundZoom:this._source.roundZoom&&!D,reparseOverscaled:me,isTerrainDEM:this.usedForTerrain,calculateQuadrantVisibility:Z}),this._source.minzoom<=1&&"globe"===v.projection.name&&(ne.push(new o.bP(1,0,1,0,0)),ne.push(new o.bP(1,0,1,1,0)),ne.push(new o.bP(1,0,1,0,1)),ne.push(new o.bP(1,0,1,1,1)))}else if(ne=v.coveringTiles({tileSize:E||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:le,roundZoom:this._source.roundZoom&&!D,reparseOverscaled:me,isTerrainDEM:this.usedForTerrain,calculateQuadrantVisibility:Z}),this._source.hasTile){const Ke=this._source.hasTile.bind(this._source);ne=ne.filter(ot=>Ke(ot))}}else ne=[];if(ne.length>0&&"globe"!==this.transform.projection.name&&!this.usedForTerrain&&!this._supportsFading){const Ke=v.coveringZoomLevel({tileSize:E||this._source.tileSize,roundZoom:this._source.roundZoom&&!D}),ot=Math.min(Ke,le);if(Z){const at=v.extendTileCover(ne,ot);for(const xt of at)ne.push(xt)}else if(Y){const at=this.transform.getFrustum(ot),xt=v.extendTileCoverToNearPlane(ne,at,ot);for(const vt of xt)ne.push(vt);if(ot>=18&&this._hasTunnelGeometry()){const vt=v.extendTileCoverForTunnels(ne,at,ot,20);for(const It of vt)ne.push(It)}}else if(this.castsShadows&&V){const at=v.extendTileCover(ne,ot,V,16);for(const xt of at)this._shadowCasterTiles[xt.key]=true,ne.push(xt)}}const Pe=this._updateRetainedTiles(ne);if(this._supportsFading&&0!==ne.length){const Ke={},ot={},at=o.e.now(),xt=Object.keys(Pe);for(const It of xt){const jt=Pe[It],Zt=this._tiles[It];if(!Zt||void 0!==Zt.fadeEndTime&&Zt.fadeEndTime<=at)continue;const kn=this.findLoadedParent(jt,Math.max(jt.overscaledZ-pp.maxOverzooming,this._source.minzoom));kn&&(this._addTile(kn.tileID),Ke[kn.tileID.key]=kn.tileID),ot[It]=jt}const vt=ne.at(-1).overscaledZ;for(const It in this._tiles){const jt=this._tiles[It];if(Pe[It]||!jt.hasData())continue;let Zt=jt.tileID;for(;Zt.overscaledZ>vt;){Zt=Zt.scaledTo(Zt.overscaledZ-1);const kn=this._tiles[Zt.key];if(kn&&kn.hasData()&&ot[Zt.key]){Pe[It]=jt.tileID;break}}}for(const It in Ke)Pe[It]||(this._coveredTiles[It]=true,Pe[It]=Ke[It])}for(const Ke in Pe)this._tiles[Ke].clearFadeHold();const Re=o.bQ(this._tiles,Pe);for(const Ke of Re){const ot=this._tiles[Ke];ot.hasSymbolBuckets&&!ot.holdingForFade()?ot.setHoldDuration(this.map._fadeDuration):ot.hasSymbolBuckets&&!ot.symbolFadeFinished()||this._removeTile(+Ke)}this._updateLoadedParentTileCache(),this._renderSourceType===o.bR.Symbol&&this._source.afterUpdate&&this._source.afterUpdate()}releaseSymbolFadeTiles(){for(const v in this._tiles)this._tiles[v].holdingForFade()&&this._removeTile(+v)}_updateRetainedTiles(v){const E={};if(0===v.length)return E;const D={},V=v.reduce((fe,me)=>Math.min(fe,me.overscaledZ),1/0),Y=v[0].overscaledZ,Z=Math.max(Y-pp.maxOverzooming,this._source.minzoom),ne=Math.max(Y+pp.maxUnderzooming,this._source.minzoom),le={};for(const fe of v){const me=this._addTile(fe);E[fe.key]=fe,me.hasData()||V=this._source.maxzoom){const Re=fe.children(this._source.maxzoom)[0],Ke=this.getTile(Re);if(Ke&&Ke.hasData()){E[Re.key]=Re;continue}}else{const Re=fe.children(this._source.maxzoom);if(E[Re[0].key]&&E[Re[1].key]&&E[Re[2].key]&&E[Re[3].key])continue}let Pe=me.wasRequested();for(let Re=fe.overscaledZ-1;Re>=Z;--Re){const Ke=fe.scaledTo(Re);if(D[Ke.key])break;if(D[Ke.key]=true,me=this.getTile(Ke),!me&&Pe&&(me=this._addTile(Ke)),me&&(E[Ke.key]=Ke,Pe=me.wasRequested(),me.hasData()))break}}return E}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const v in this._tiles){const E=[];let D,V=this._tiles[v].tileID;for(;V.overscaledZ>0;){if(V.key in this._loadedParentTiles){D=this._loadedParentTiles[V.key];break}E.push(V.key);const Y=V.scaledTo(V.overscaledZ-1);if(D=this._getLoadedTile(Y),D)break;V=Y}for(const Y of E)this._loadedParentTiles[Y]=D}}_addTile(v){let E=this._tiles[v.key];if(E)return true!==E.isExtraShadowCaster||!!this._shadowCasterTiles[v.key]||this._reloadTile(v.key,"reloading"),E;E=this._cache.getAndRemove(v),E&&(this._setTileReloadTimer(v.key,E),E.tileID=v,this._state.initializeTileState(E,this.map?this.map.painter:null),this._cacheTimers[v.key]&&(clearTimeout(this._cacheTimers[v.key]),delete this._cacheTimers[v.key],this._setTileReloadTimer(v.key,E)));const D=Boolean(E);if(!D){const V=this.map?this.map.painter:null,Y=this._source.tileSize*v.overscaleFactor();E="raster-array"===this._source.type?function(Z,ne,le,fe,me){if(!fT)throw new Error("Raster-array module is not loaded.");return fT(Z,ne,le,fe,me)}(v,Y,this.transform.tileZoom,V,this._isRaster):new Mv(v,Y,this.transform.tileZoom,V,this._isRaster,this._source.worldview),this._loadTile(E,this._tileLoaded.bind(this,E,v.key,E.state))}return E.uses++,this._tiles[v.key]=E,D||this._source.fire(new o.h("dataloading",{tile:E,coord:E.tileID,dataType:"source"})),E}_setTileReloadTimer(v,E){v in this._timers&&(clearTimeout(this._timers[v]),delete this._timers[v]);const D=E.getExpiryTimeout();D&&(this._timers[v]=setTimeout(()=>{this._reloadTile(v,"expired"),delete this._timers[v]},D))}_removeTile(v){const E=this._tiles[v];E&&(E.uses--,delete this._tiles[v],this._timers[v]&&(clearTimeout(this._timers[v]),delete this._timers[v]),E.uses>0||(E.hasData()&&"reloading"!==E.state||"empty"===E.state?this._cache.add(E.tileID,E,E.getExpiryTimeout()):(E.aborted=true,this._abortTile(E),this._unloadTile(E))))}clearTiles(){this._shouldReloadOnResume=false,this._paused=false;for(const v in this._tiles)this._removeTile(+v);this._source._clear&&this._source._clear(),this._cache.reset(),this.map&&this.usedForTerrain&&this.map.painter.terrain&&this.map.painter.terrain.resetTileLookupCache(this.id)}tilesIn(v,E,D){const V=[],Y=this.transform;if(!Y)return V;const Z="globe"===Y.projection.name,ne=o.a7(Y.center.lng),le=Y.getFreeCameraOptions().position||new o.bS(0,0,0);for(const fe in this._tiles){const me=this._tiles[fe];if(D&&me.clearQueryDebugViz(),me.holdingForFade())continue;let Pe;if(Z){const Re=me.tileID.canonical;if(0===Re.z){const Ke=[Math.abs(o.b0(ne,...Sh(Re,-1))-ne),Math.abs(o.b0(ne,...Sh(Re,1))-ne)];Pe=[0,2*Ke.indexOf(Math.min(...Ke))-1]}else{const Ke=[Math.abs(o.b0(ne,...Sh(Re,-1))-ne),Math.abs(o.b0(ne,...Sh(Re,0))-ne),Math.abs(o.b0(ne,...Sh(Re,1))-ne)];Pe=[Ke.indexOf(Math.min(...Ke))-1]}}else Pe=[0];for(const Re of Pe){const Ke=v.containsTile(me,Y,E,Re,le);Ke&&V.push(Ke)}}return V}getShadowCasterCoordinates(){return this._getRenderableCoordinates(false,true)}getVisibleCoordinates(v){return this._getRenderableCoordinates(v)}_getRenderableCoordinates(v,E){if(!this.transform)return[];const D=this.getRenderableIds(v,E).map(Y=>this._tiles[Y].tileID),V="globe"===this.transform.projection.name;for(const Y of D)Y.projMatrix=this.transform.calculateProjMatrix(Y.toUnwrapped()),Y.expandedProjMatrix=V?this.transform.calculateProjMatrix(Y.toUnwrapped(),false,true):Y.projMatrix;return D}sortCoordinatesByDistance(v){if(!this.transform)return v.slice();const E=v.slice(),D=this.transform._camera.position,V=this.transform._camera.forward(),Y={};for(const Z of E){const ne=1/(1<Y[Z.key]-Y[ne.key]),E}hasTransition(){if(this._source.hasTransition())return true;if(this._supportsFading){const v=o.e.now();for(const E in this._tiles){const D=this._tiles[E];if(void 0!==D.fadeEndTime&&D.fadeEndTime>=v)return true}}return false}setFeatureState(v,E,D){this._state.updateState(v=v||"_geojsonTileLayer",E,D)}removeFeatureState(v,E,D){this._state.removeFeatureState(v=v||"_geojsonTileLayer",E,D)}getFeatureState(v,E){return this._state.getState(v=v||"_geojsonTileLayer",E)}setDependencies(v,E,D){const V=this._tiles[v];V&&V.setDependencies(E,D)}reloadTilesForDependencies(v,E){for(const D in this._tiles)this._tiles[D].hasDependency(v,E)&&this._reloadTile(+D,"reloading");this._cache.filter(D=>!D.hasDependency(v,E))}_preloadTiles(v,E){if(!this._sourceLoaded){const le=()=>{this._sourceLoaded&&(this._source.off("data",le),this._preloadTiles(v,E))};return void this._source.on("data",le)}const D=new Map,V=Array.isArray(v)?v:[v],Y=this.map.painter.terrain,Z=this.usedForTerrain&&Y?Y.getScaledDemTileSize():this._source.tileSize;for(const le of V){const fe=le.coveringTiles({tileSize:Z,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!this.usedForTerrain,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain});for(const me of fe)D.set(me.key,me);this.usedForTerrain&&le.updateElevation(false)}const ne=Array.from(D.values());o.bT(ne,(le,fe)=>{const me=new Mv(le,this._source.tileSize*le.overscaleFactor(),this.transform.tileZoom,this.map.painter,this._isRaster,this._source.worldview);this._loadTile(me,Pe=>{"raster-dem"===this._source.type&&me.dem&&this._backfillDEM(me),fe(Pe,me)})},E)}}function v2(k,v){const E=Math.abs(2*k.wrap)-+(k.wrap<0),D=Math.abs(2*v.wrap)-+(v.wrap<0);return k.overscaledZ-v.overscaledZ||D-E||v.canonical.y-k.canonical.y||v.canonical.x-k.canonical.x}function Sh(k,v){const E=1<>D===k.x&&v.y>>D===k.y}const E=k.z-v.z;return k.x>>E===v.x&&k.y>>E===v.y}function _2(k,v){return k.sourceFQID!==v.sourceFQID?k.sourceFQID{return!!ne.hasDeferredElevationFeatures||Z&&(le=V,wa(D,fe=ne.tileID.canonical)!==wa(le,fe));var le,fe})}const yd=k=>({u_matrix:k});function ay(k,v){const E=k.context.gl;return new o._({func:E.EQUAL,mask:255},k._tileClippingMaskIDs[v.key]||0,0,E.KEEP,E.KEEP,E.KEEP)}function Ah(k,v){const E=k.context.gl;return new o._({func:E.EQUAL,mask:255},255&~(k._tileClippingMaskIDs[v.key]||0),0,E.KEEP,E.KEEP,E.KEEP)}function UF(k,v){if(!k.frcCoverageSnapshot||!k.frcCoverageRenderer)return null;const E=k.frcCoverageSnapshot.getTileOrParent(v.canonical);if(!E||0===E.frcMask)return null;const D=k.frcCoverageRenderer.getBuffers(E.tileId);if(!D)return null;const V=new o.bX(E.tileId.z,E.tileId.x,E.tileId.y),Y=new o.bY(v.wrap,V);return{buffers:D,projMatrix:k.transform.calculateProjMatrix(Y),coverageTile:E}}function E2(k,v,E){if(!k.frcCoverageSnapshot)return;const D=k.context,V=D.gl,Y=k.getOrCreateProgram("clippingMask");D.setColorMode(o.a1.disabled),D.setDepthMode(o.Z.disabled);for(const Z of v){const ne=UF(k,Z);if(!ne)continue;const le=ne.buffers.frcLevelSegments[E];le&&Y.draw(k,V.TRIANGLES,o.Z.disabled,new o._({func:V.EQUAL,mask:255},k._tileClippingMaskIDs[Z.key]||0,255,V.KEEP,V.KEEP,V.INVERT),o.a1.disabled,o.$.disabled,yd(ne.projMatrix),`$frc_coverage_${E}`,ne.buffers.vertexBuffer,ne.buffers.indexBuffer,le)}}function Yd(k,v,E){if(!k.frcCoverageSnapshot)return;const D=k.context,V=D.gl,Y=k.getOrCreateProgram("clippingMask");D.setColorMode(o.a1.disabled),D.setDepthMode(o.Z.disabled);for(const Z of v){const ne=UF(k,Z);if(!ne)continue;const le=ne.buffers.frcLevelSegments[E];le&&Y.draw(k,V.TRIANGLES,o.Z.disabled,new o._({func:V.EQUAL,mask:255},255&~(k._tileClippingMaskIDs[Z.key]||0),255,V.KEEP,V.KEEP,V.INVERT),o.a1.disabled,o.$.disabled,yd(ne.projMatrix),`$frc_coverage_restore_${E}`,ne.buffers.vertexBuffer,ne.buffers.indexBuffer,le)}}function f0(k,v,E,D,V){if(0===v.length)return;let Y=0;for(const ne of v)Y|=ne.frcMask;const Z=v.map(ne=>ne.coord);for(let ne=0;ne<9;++ne)if(Y&1<0&&V)for(const le of v)le.frcMask&1<0&&v.rings[0].length>0)return true;return false}function Zu(k){const v=k.frcCoverageFadeRange;return!v||v[1]<=v[0]?0:1-Math.max(0,Math.min(1,(k.transform.zoom-v[0])/(v[1]-v[0])))}const XP={loaded:true,drawBuilding:function(k,v,E,D){k.currentLayer0&&Y>0,fe=true;const me=E.paint.get("building-vertical-scale");if(me<=0)return;k.shadowRenderer||(fe=false);const Pe=k.conflationActive&&k.style.isLayerClipped(E,v.getSource()),Re=k.style.order.indexOf(E.fqid);if(function(Ke,ot,at,xt,vt,It){for(const jt of It){const Zt=ot.getTile(jt).getBucket(at);Zt&&(vt&&Zt.updateReplacement(jt,Ke.replacementSource,xt),Zt.uploadUpdatedIndexBuffer(Ke.context))}}(k,v,E,Re,Pe,D),function(Ke,ot,at,xt){for(const vt of xt){const It=ot.getTile(vt).getBucket(at);It&&It.needsEvaluation()&&It.uploadUpdatedColorBuffer(Ke.context)}}(k,v,E,D),E.resetLayerRenderingStats(k),k.shadowRenderer&&(k.shadowRenderer.useNormalOffset=true),"shadow"===k.renderPass&&k.shadowRenderer){const Ke=[],ot=k.shadowRenderer.getShadowPassDepthMode();Lc({painter:k,source:v,layer:E,coords:D,defines:Ke,blendMode:o.a1.disabled,depthMode:ot,opacity:ne,verticalScale:me,facadeEmissiveChance:0,facadeAOIntensity:0,floodLightIntensity:0,floodLightColor:[0,0,0]})}else if("translucent"===k.renderPass){let Ke=["HAS_ATTRIBUTE_a_part_color_emissive","LIGHTING_3D_MODE"];fe&&(Ke=Ke.concat("RENDER_SHADOWS")),k.shadowRenderer&&k.shadowRenderer.useNormalOffset&&(Ke=Ke.concat("NORMAL_OFFSET"));const ot=E.paint.get("building-facade-emissive-chance"),at=E.paint.get("building-ambient-occlusion-intensity"),xt=E.paint.get("building-flood-light-intensity"),vt="none"===E.paint.get("building-flood-light-color-use-theme").constantOr("default"),It=E.paint.get("building-flood-light-color").toNonPremultipliedRenderColor(vt?null:E.lut).toArray01().slice(0,3),jt=E.paint.get("building-flood-light-ground-attenuation"),Zt=xt>0,kn=new o.Z(k.context.gl.LEQUAL,o.Z.ReadWrite,k.depthRangeFor3D);ne<1&&Lc({painter:k,source:v,layer:E,coords:D,defines:Ke,blendMode:o.a1.disabled,depthMode:kn,opacity:ne,verticalScale:me,facadeEmissiveChance:ot,facadeAOIntensity:at,floodLightIntensity:xt,floodLightColor:It,depthOnly:true});const cn=k.colorModeForRenderPass();Lc({painter:k,source:v,layer:E,coords:D,defines:Ke,blendMode:cn,depthMode:kn,opacity:ne,verticalScale:me,facadeEmissiveChance:ot,facadeAOIntensity:at,floodLightIntensity:xt,floodLightColor:It});const hn=E.paint.get("building-front-cutoff");Qa(k.transform.pitch,hn,!!k.terrain),le&&uf(k,v,E,D,true,ne,V,Y,xt,It,Z,Pe),Zt&&uf(k,v,E,D,false,ne,V,Y,xt,It,jt,Pe)}else if("light-beam"===k.renderPass){const Ke=["HAS_ATTRIBUTE_a_part_color_emissive","HAS_ATTRIBUTE_a_bloom_attenuation"],ot=new o.Z(k.context.gl.LEQUAL,o.Z.ReadOnly,k.depthRangeFor3D);Lc({painter:k,source:v,layer:E,coords:D,defines:Ke,blendMode:o.a1.alphaBlended,depthMode:ot,opacity:ne,verticalScale:me,facadeEmissiveChance:0,facadeAOIntensity:0,floodLightIntensity:0,floodLightColor:[0,0,0]})}k.shadowRenderer&&(k.shadowRenderer.useNormalOffset=false),k.resetStencilClippingMasks()},BuildingTileBorderManager:class{constructor(){this.visibleTiles=[]}updateBorders(k,v){const E=[],D=[],V=k._getRenderableCoordinates(false,true);for(const ne of V){const le=k.getTile(ne);if(!le.hasData())continue;const fe=le.getBucket(v);fe&&(fe.isEmpty()||(E.push(ne.key),D.push({bucket:fe,tileID:ne.canonical})))}let Y=E.length!==this.visibleTiles.length;if(!Y){E.sort();for(let ne=0;nene.tileID.z-le.tileID.z||ne.tileID.x-le.tileID.x||ne.tileID.y-le.tileID.y);for(const ne of D){const le=new Array,fe=new Array,me=ne.bucket;for(const Pe of me.featuresOnBorder)me.footprints[Pe.footprintIndex].hiddenFlags&o.aR||(Z.has(Pe.featureId)?fe.push(Pe.footprintIndex):(Z.add(Pe.featureId),le.push(Pe.footprintIndex)));me.updateFootprintHiddenFlags(le,o.aS,false),me.updateFootprintHiddenFlags(fe,o.aS,true)}}},drawRasterParticle:function(k,v,E,D,V,Y){"offscreen"===k.renderPass&&function(Z,ne,le,fe){if(!fe.length)return;const me=Z.context,Pe=me.gl,Re=ne.getSource();if("raster-array"!==Re.type)return;const Ke=Math.ceil(Math.sqrt(le.paint.get("raster-particle-count")));let ot=le.particlePositionRGBAImage;if(!ot||ot.width!==Ke){const jt=function(Zt){const kn=Zt*Zt,cn=new Uint8Array(4*kn),hn=.9090909090909091;for(let xn=0;xno.aB[si](Yn));kr.push(Yn);const Vr=Yn.canonical.x,mi=Yn.canonical.y;for(const si of kr){const Kr=Zt.getTile(Bn?si.wrapped():si);if(!Kr)continue;const qi=Kr.rasterParticleState;if(!qi)continue;const Wr=si.canonical.x+(1<v.getTileByID(ne));for(const ne of Z)ne.updateNeeded(k.id,Y)&&D.prepareTile(ne,V,k.id,Y)},Rain:class extends df{constructor(){super(4.25),this._params={intensity:.5,timeFactor:1,velocityConeAperture:0,velocity:300,boxSize:2500,dropletSizeX:1,dropletSizeYScale:10,distortionStrength:70,screenThinning:{intensity:.57,start:.46,range:1.17,fadePower:.17,affectedRatio:1,particleOffset:-.2},color:{r:.66,g:.68,b:.74,a:.7},direction:{x:-50,y:-35},shapeDirPower:2,shapeNormalPower:1},this._vignetteParams={strength:1,start:.7,range:1,fadePower:.4,color:{r:.27,g:.27,b:.27,a:1}},this.particlesCount=16e3,this._devtoolsFolder=null,this._painter=null}destroy(){super.destroy()}update(k){const v=k.context;if(!this.particlesVx){const E=dp(this.particlesCount),D=new o.bk,V=new o.ad;let Y=0;const Z=o.bi(1323123451230);for(let ne=0;neZ)return;const ne=ih(0,1,D.revealStart,D.revealStart+D.revealRange,Z);if(!this.particlesVx||!this.particlesIdx)return;Y.strength*=ne;const le=this.updateOnRender(k,E.timeFactor),fe=k.context,me=fe.gl,Pe=k.transform;this.screenTexture&&this.screenTexture.size[0]===k.width&&this.screenTexture.size[1]===k.height||(this.screenTexture=new o.T(fe,{width:k.width,height:k.height,data:null},me.RGBA8)),E.distortionStrength>0&&(fe.activeTexture.set(me.TEXTURE0),this.screenTexture.bind(me.LINEAR,me.CLAMP_TO_EDGE),me.copyTexSubImage2D(me.TEXTURE_2D,0,0,0,0,0,k.width,k.height));const Re=k.getOrCreateProgram("rainParticle");k.uploadCommonUniforms(fe,Re),fe.activeTexture.set(me.TEXTURE0),this.screenTexture.bind(me.LINEAR,me.CLAMP_TO_EDGE);const Ke=[E.color.r,E.color.g,E.color.b,E.color.a],ot=(at,xt)=>{const vt=em(this._movement.getPosition(),at),It=E.dropletSizeX,jt=E.dropletSizeX*E.dropletSizeYScale,Zt=k.width/2,kn=k.height/2,cn=ih(0,E.screenThinning.start,0,1,E.screenThinning.intensity),hn=ih(.001,E.screenThinning.range,0,1,E.screenThinning.intensity),xn=ih(0,E.screenThinning.particleOffset,0,1,E.screenThinning.intensity),wn=(Bn={modelview:le.modelviewMatrix,projection:le.projectionMatrix,time:this._accumulatedTimeFromStart,camPos:vt,velocityConeAperture:E.velocityConeAperture,velocity:E.velocity,boxSize:at,rainDropletSize:[It,jt],distortionStrength:E.distortionStrength,rainDirection:V,color:Ke,screenSize:[Pe.width,Pe.height],thinningCenterPos:[Zt,kn],thinningShape:[cn,hn,Math.pow(10,E.screenThinning.fadePower)],thinningAffectedRatio:E.screenThinning.affectedRatio,thinningParticleOffset:xn,shapeDirectionalPower:E.shapeDirPower,shapeNormalPower:E.shapeNormalPower,mode:xt?0:1},{u_modelview:Float32Array.from(Bn.modelview),u_projection:Float32Array.from(Bn.projection),u_time:Bn.time,u_cam_pos:Bn.camPos,u_texScreen:0,u_velocityConeAperture:Bn.velocityConeAperture,u_velocity:Bn.velocity,u_boxSize:Bn.boxSize,u_rainDropletSize:Bn.rainDropletSize,u_distortionStrength:Bn.distortionStrength,u_rainDirection:Bn.rainDirection,u_color:Bn.color,u_screenSize:Bn.screenSize,u_thinningCenterPos:Bn.thinningCenterPos,u_thinningShape:Bn.thinningShape,u_thinningAffectedRatio:Bn.thinningAffectedRatio,u_thinningParticleOffset:Bn.thinningParticleOffset,u_shapeDirectionalPower:Bn.shapeDirectionalPower,u_shapeNormalPower:Bn.shapeNormalPower,u_mode:Bn.mode});var Bn;const Kn=Math.round(E.intensity*this.particlesCount),Wn=o.ac.simpleSegment(0,0,4*Kn,2*Kn);Re.draw(k,me.TRIANGLES,o.Z.disabled,o._.disabled,o.a1.alphaBlended,o.$.disabled,wn,"rain_particles",this.particlesVx,this.particlesIdx,Wn)};E.distortionStrength>0&&ot(E.boxSize,true),ot(E.boxSize,false),this._vignette.draw(k,Y)}},Snow:class extends df{constructor(){super(2.25),this._params={intensity:.85,timeFactor:.75,velocityConeAperture:70,velocity:40,horizontalOscillationRadius:4,horizontalOscillationRate:1.5,boxSize:2e3,billboardSize:2,shapeFadeStart:.27,shapeFadePower:.21,screenThinning:{intensity:.4,start:.15,range:1.4,fadePower:.24,affectedRatio:1,particleOffset:-.2},color:{r:1,g:1,b:1,a:1},direction:{x:-50,y:-35}},this._vignetteParams={strength:.3,start:.78,range:.46,fadePower:.2,color:{r:1,g:1,b:1,a:1}},this.particlesCount=16e3,this._devtoolsFolder=null,this._painter=null}destroy(){super.destroy()}update(k){const v=k.context;if(!this.particlesVx){const E=dp(this.particlesCount),D=new o.bl,V=new o.ad;let Y=0;const Z=o.bi(1323123451230);for(let ne=0;neZ)return;const ne=ih(0,1,D.revealStart,D.revealStart+D.revealRange,Z);Y.strength*=ne;const le=this.updateOnRender(k,E.timeFactor);if(!this.particlesVx||!this.particlesIdx)return;const fe=k.context,me=fe.gl,Pe=k.transform,Re=k.getOrCreateProgram("snowParticle");k.uploadCommonUniforms(fe,Re),((Ke,ot,at)=>{const xt=em(this._movement.getPosition(),Ke),vt=Pe.width/2,It=Pe.height/2,jt=ih(0,at.screenThinning.start,0,1,at.screenThinning.intensity),Zt=ih(.001,at.screenThinning.range,0,1,at.screenThinning.intensity),kn=ih(0,at.screenThinning.particleOffset,0,1,at.screenThinning.intensity),cn=(hn={modelview:le.modelviewMatrix,projection:le.projectionMatrix,time:this._accumulatedTimeFromStart,camPos:xt,velocityConeAperture:at.velocityConeAperture,velocity:at.velocity,horizontalOscillationRadius:at.horizontalOscillationRadius,horizontalOscillationRate:at.horizontalOscillationRate,boxSize:Ke,billboardSize:1*at.billboardSize,simpleShapeParameters:[at.shapeFadeStart,at.shapeFadePower],screenSize:[Pe.width,Pe.height],thinningCenterPos:[vt,It],thinningShape:[jt,Zt,Math.pow(10,at.screenThinning.fadePower)],thinningAffectedRatio:at.screenThinning.affectedRatio,thinningParticleOffset:kn,color:[at.color.r,at.color.g,at.color.b,at.color.a],direction:V},{u_modelview:Float32Array.from(hn.modelview),u_projection:Float32Array.from(hn.projection),u_time:hn.time,u_cam_pos:hn.camPos,u_velocityConeAperture:hn.velocityConeAperture,u_velocity:hn.velocity,u_horizontalOscillationRadius:hn.horizontalOscillationRadius,u_horizontalOscillationRate:hn.horizontalOscillationRate,u_boxSize:hn.boxSize,u_billboardSize:hn.billboardSize,u_simpleShapeParameters:hn.simpleShapeParameters,u_screenSize:hn.screenSize,u_thinningCenterPos:hn.thinningCenterPos,u_thinningShape:hn.thinningShape,u_thinningAffectedRatio:hn.thinningAffectedRatio,u_thinningParticleOffset:hn.thinningParticleOffset,u_particleColor:hn.color,u_direction:hn.direction});var hn;const xn=Math.round(at.intensity*this.particlesCount),wn=o.ac.simpleSegment(0,0,4*xn,2*xn);this.particlesVx&&this.particlesIdx&&Re.draw(k,me.TRIANGLES,o.Z.disabled,o._.disabled,o.a1.alphaBlended,o.$.disabled,cn,"snow_particles",this.particlesVx,this.particlesIdx,wn)})(E.boxSize,0,E),this._vignette.draw(k,Y)}},shaders:ty,programUniforms:fp,drawElevatedStructures:function(k){const{painter:v,sourceCache:E,layer:D,coords:V,colorMode:Y}=k,Z=v.context.gl,ne=k.painter.shadowRenderer,le=!!ne&&ne.enabled,fe=new o.Z(v.context.gl.LEQUAL,o.Z.ReadOnly,v.depthRangeFor3D);let me=[0,0,0];if(le){const Re=v.style.directionalLight,Ke=v.style.ambientLight;Re&&Ke&&(me=o.aF(v.style,Re,Ke))}const Pe=Re=>{for(const Ke of V){const ot=E.getTile(Ke),at=ot.getBucket(D);if(!at)continue;const xt=at.hdExt?at.hdExt.elevatedStructures:void 0;if(!xt)continue;let vt,It;if(Re?(vt=xt.renderableBridgeSegments,It=xt.bridgeProgramConfigurations.get(D.id)):(vt=xt.renderableTunnelSegments,It=xt.tunnelProgramConfigurations.get(D.id)),!vt||0===vt.segments[0].primitiveLength)continue;It.updatePaintBuffers(),v.prepareDrawTile();const jt=v.isTileAffectedByFog(Ke),Zt=[];le&&Zt.push("RENDER_SHADOWS","NORMAL_OFFSET");const kn=v.getOrCreateProgram("elevatedStructures",{config:It,overrideFog:jt,defines:Zt}),cn=v.translatePosMatrix(Ke.projMatrix,ot,D.paint.get("fill-translate"),D.paint.get("fill-translate-anchor"));le&&ne.setupShadows(ot.tileID.toUnwrapped(),kn,"vector-tile");const hn=Zm(cn,me);v.uploadCommonUniforms(v.context,kn,Ke.toUnwrapped()),kn.draw(v,Z.TRIANGLES,fe,o._.disabled,Y,o.$.backCCW,hn,D.id,xt.vertexBuffer,xt.indexBuffer,vt,D.paint,v.transform.zoom,It,[xt.vertexBufferNormal])}};Pe(true),Pe(false)},drawElevatedFillShadows:function(k){const{painter:v,sourceCache:E,layer:D,coords:V}=k,Y=v.context.gl,Z=k.painter.shadowRenderer;for(const ne of V){const le=E.getTile(ne),fe=le.getBucket(D);if(!fe)continue;const me=fe.hdExt?fe.hdExt.elevatedStructures:void 0;if(!me)continue;if(!me.shadowCasterSegments||0===me.shadowCasterSegments.segments[0].primitiveLength)continue;v.prepareDrawTile();const Pe=fe.bufferData.programConfigurations.get(D.id),Re=v.isTileAffectedByFog(ne),Ke=v.getOrCreateProgram("elevatedStructuresDepth",{config:Pe,overrideFog:Re}),ot=Z.calculateShadowPassMatrixFromTile(le.tileID.toUnwrapped());v.uploadCommonUniforms(v.context,Ke,ne.toUnwrapped());const at=Eb(ot,0);Ke.draw(v,Y.TRIANGLES,Z.getShadowPassDepthMode(),o._.disabled,o.a1.disabled,o.$.disabled,at,D.id,me.vertexBuffer,me.indexBuffer,me.shadowCasterSegments,D.paint,v.transform.zoom,Pe)}},drawDepthPrepass:function(k,v,E,D,V){if(!v)return;if(!E.layout||"none"===E.layout.get("fill-elevation-reference")||0===E.paint.get("fill-opacity").constantOr(1))return;const Y=k.context.gl,Z=new o.Z(k.context.gl.LEQUAL,o.Z.ReadWrite,k.depthRangeFor3D),ne=new o.Z(k.context.gl.GREATER,o.Z.ReadWrite,k.depthRangeFor3D),le=function(Ke){let ot=.01;return Ke.isOrthographic&&(ot=o.al(1e-4,ot,o.bo(Ke.pitch>=o.bn?1:Ke.pitch/o.bn))),2*ot}(k.transform),fe=k.transform.getFreeCameraOptions().position,me="elevatedStructuresDepthReconstruct",Pe=k.getOrCreateProgram(me,{defines:["DEPTH_RECONSTRUCTION"]}),Re=k.getOrCreateProgram(me);for(const Ke of D){const ot=v.getTile(Ke),at=ot.getBucket(E);if(!at)continue;if(!at.hdExt)continue;const xt=at.hdExt.elevatedStructures,vt=at.hdExt.elevationBufferData;if(!xt||!xt.depthSegments||!vt)continue;const It=vt.heightRange,jt=Dl(Ke.toUnwrapped(),fe),Zt=k.translatePosMatrix(Ke.projMatrix,ot,E.paint.get("fill-translate"),E.paint.get("fill-translate-anchor"));let kn,cn,hn,xn;if("initialize"===V){if(!It||It.min>=1||0===xt.depthSegments.segments[0].primitiveLength)continue;kn=Dc(Zt,jt,le,1,0),cn=Z,hn=xt.depthSegments,xn=Pe}else if("reset"===V){if(!It||It.min>=0||0===xt.maskSegments.segments[0].primitiveLength)continue;kn=Dc(Zt,jt,0,0,1),cn=ne,hn=xt.maskSegments,xn=Pe}else if("geometry"===V){if(0===xt.depthSegments.segments[0].primitiveLength)continue;kn=Dc(Zt,jt,le,1,0),cn=Z,hn=xt.depthSegments,xn=Re}xn.draw(k,Y.TRIANGLES,cn,o._.disabled,o.a1.disabled,o.$.disabled,kn,E.id,xt.vertexBuffer,xt.indexBuffer,hn,E.paint,k.transform.zoom)}},drawGroundShadowMask:function(k,v,E,D){if(!v)return;if(!E.layout||"none"===E.layout.get("fill-elevation-reference")||0===E.paint.get("fill-opacity").constantOr(1))return;const V=k.context.gl,Y=new o.Z(V.LEQUAL,o.Z.ReadOnly,k.depthRangeFor3D),Z=new o._({func:V.ALWAYS,mask:255},255,255,V.KEEP,V.KEEP,V.REPLACE),ne=k.transform.getFreeCameraOptions().position,le=k.getOrCreateProgram("elevatedStructuresDepthReconstruct");for(const fe of D){const me=v.getTile(fe),Pe=me.getBucket(E);if(!Pe)continue;const Re=Pe.hdExt?Pe.hdExt.elevatedStructures:void 0;if(!Re||!Re.depthSegments||0===Re.depthSegments.segments[0].primitiveLength)continue;const Ke=Dl(fe.toUnwrapped(),ne),ot=k.translatePosMatrix(fe.projMatrix,me,E.paint.get("fill-translate"),E.paint.get("fill-translate-anchor")),at=Dc(ot,Ke,0,1,0);le.draw(k,V.TRIANGLES,Y,Z,o.a1.disabled,o.$.disabled,at,E.id,Re.vertexBuffer,Re.indexBuffer,Re.depthSegments,E.paint,k.transform.zoom)}},IndoorManager:class extends o.E{constructor(k,v=false){super(),this._style=k,this._buildings={},this._activeFloors=new Set,this._closestBuildingId=null,this._indoorState={selectedFloorId:null,activeFloorsVisible:true,activeFloors:this._activeFloors},this._buildingDetectionStrategy=new Ht,this._initialLoadDone=false,o.aV(["_updateUI"],this);const E=()=>{this._style.isIndoorEnabled()&&(this._style.map.on("load",()=>{this._initialLoadDone=true,this._indoorState&&this._indoorState.needsUpdate&&(this._indoorState.needsUpdate=false,this._style.updateIndoorDependentLayers()),this._updateUI()}),this._style.map.on("move",this._updateUI),this._style.map.on("idle",this._updateUI))};v?(this._initialLoadDone=true,E()):this._style.on("style.load",E)}destroy(){this._buildings={},this._activeFloors=new Set,this._indoorState=null}selectFloor(k){k===this._selectedFloorId&&this._indoorState&&this._indoorState.activeFloorsVisible||(this._selectedFloorId=k,this._recalculateActiveFloors())}setActiveFloorsVisibility(k){this._updateActiveFloors(k),this._updateIndoorSelector()}setIndoorData(k){let v=false;for(const[E,D]of Object.entries(k.buildings))if(this._buildings[E])for(const V of D.floorIds)this._buildings[E].floorIds.add(V),this._buildings[E].floors[V]?this._mergeFloors(this._buildings[E].floors[V],D.floors[V]):(this._buildings[E].floors[V]=D.floors[V],v=true);else this._buildings[E]=D,v=true;v&&this._recalculateActiveFloors()}getIndoorTileOptions(k,v){return this._indoorState?{sourceLayers:this._style.getIndoorSourceLayers(k,v),indoorState:this._indoorState}:null}getControlState(){const k=this._buildings,v=this._closestBuildingId,E=v&&k?k[v]:void 0;if(!E)return{selectedFloorId:null,activeFloorsVisible:!!this._indoorState&&this._indoorState.activeFloorsVisible,floors:[]};let D=null;for(const Y of E.floorIds)if(this._activeFloors&&this._activeFloors.has(Y)){D=Y;break}const V=Array.from(E.floorIds).map(Y=>({id:Y,name:E.floors[Y].name,zIndex:E.floors[Y].zIndex})).sort((Y,Z)=>Z.zIndex-Y.zIndex).filter((Y,Z,ne)=>0===Z||Y.zIndex!==ne[Z-1].zIndex);return{selectedFloorId:D,activeFloorsVisible:!!this._indoorState&&this._indoorState.activeFloorsVisible,floors:V}}_updateUI(){this._initialLoadDone=true;const k=this._style.map.transform,v=this._buildingDetectionStrategy.findClosestBuilding(this._buildings,k.center,k.zoom,k.getBounds(),this._makeViewportPolygon());if(v!==this._closestBuildingId){const E=this._closestBuildingId;this._closestBuildingId=v,this._onBuildingTransition(E,v),this._updateIndoorSelector()}}_onBuildingTransition(k,v){if(!this._indoorState)return;const E=!!v&&!k;!v&&k?(this._indoorState.activeFloors=new Set,this._indoorState.activeFloorsVisible=false,this._style.updateIndoorDependentLayers()):E&&(this._recalculateActiveFloors(),this._updateActiveFloors(true))}_updateIndoorSelector(){this.fire(new o.h("selector-update",this.getControlState()))}_updateActiveFloors(k){this._indoorState={selectedFloorId:this._selectedFloorId,activeFloorsVisible:k,activeFloors:this._activeFloors},this._initialLoadDone?this._style.updateIndoorDependentLayers():this._indoorState.needsUpdate=true}_recalculateActiveFloors(){if(!this._buildings)return;const k=o.aW.calculate(this._buildings,this._selectedFloorId,this._activeFloors);(function(v,E){if(v===E)return true;if(!v||!E)return false;if(v.size!==E.size)return false;for(const D of v)if(!E.has(D))return false;return true})(k,this._activeFloors)||(this._activeFloors=k,this._updateActiveFloors(!!this._indoorState&&this._indoorState.activeFloorsVisible),this._updateIndoorSelector())}_mergeFloors(k,v){v.geometry&&(k.geometry?("Polygon"===k.geometry.type&&(k.geometry={type:"MultiPolygon",coordinates:[k.geometry.coordinates]}),"Polygon"===v.geometry.type?k.geometry.coordinates.push(v.geometry.coordinates):"MultiPolygon"===v.geometry.type&&k.geometry.coordinates.push(...v.geometry.coordinates)):k.geometry=v.geometry)}_makeViewportPolygon(){const k=this._style.map.transform,v=k.width,E=k.height;return[k.pointLocation(new o.P(0,0)),k.pointLocation(new o.P(v,0)),k.pointLocation(new o.P(v,E)),k.pointLocation(new o.P(0,E))].map(D=>new o.P(D.lng,D.lat))}},HdCoverageState:class{constructor(){this.coverageSourceCaches={},this.manager=new QS}},updateFrcCoverage:function(k,v){v.manager.clear();for(const D in k._mergedHdRoadCoverageSourceCaches){const V=k._mergedHdRoadCoverageSourceCaches[D]._tiles;for(const Y in V){const Z=V[Y];if(!Z||!Z.loaded())continue;const ne=Z.frcCoveragePolygons;v.manager.addTileCoverage(Z.tileID.canonical,ne&&ne.length>0?ne:[])}}const E=v.manager.updateSnapshotIfNeeded();if(k.map.painter&&(k.map.painter.frcCoverageSnapshot=E.empty()?null:E),!E.empty()){const D=[k._mergedOtherSourceCaches,k._mergedSymbolSourceCaches];for(const V of D)for(const Y in V){const Z=V[Y];for(const ne in Z._tiles){const le=Z._tiles[ne];le&&le.hasDeferredRoadStructure&&(le.hasDeferredRoadStructure=false,Z._reloadTile(+ne,"reloading"))}}}},updateHdCoverageSourceCache:function(k,v,E){if("fill"!==E.type||E.sourceLayer!==o.bU)return;if(v.coverageSourceCaches[E.source])return;const D=k.getOwnSource(E.source);if(!D||"vector"!==D.type)return;const V=`hd-road-coverage:${E.source}`,Y=o.m(V,k.scope),Z=k._sourceCaches[V]=new pp(Y,D,o.bR.HdRoadCoverage);v.coverageSourceCaches[E.source]=Z,Z.setMaxzoomOverride(14),Z.onAdd(k.map);const ne=k._otherSourceCaches[E.source];ne&&ne._sourceLoaded&&(Z._sourceLoaded=true)},updateFrcCoverageFadeRange:function(k,v){let E=null,D=null;const V={globals:{zoom:0}};k.forEachFragmentStyle(Y=>{if(E)return;const Z=Y.stylesheet?Y.stylesheet.schema:null;if(!Z||!Z.sdCoverageFadeRange)return;const ne=o.m("sdCoverageFadeRange",Y.scope),le=Y.options?Y.options.get(ne):void 0,fe=le?le.value||le.default:null;if(fe){const Ke=fe.evaluate(V);Array.isArray(Ke)&&2===Ke.length&&(Ke[0]>0||Ke[1]>0)&&(E=[Ke[0],Ke[1]])}const me=o.m("sdCoverageSourceLayers",Y.scope),Pe=Y.options?Y.options.get(me):void 0,Re=Pe?Pe.value||Pe.default:null;if(Re){const Ke=Re.evaluate(V);Array.isArray(Ke)&&Ke.length>0&&(D=Ke)}else{const Ke=k.stylesheet&&k.stylesheet.imports||[];for(const ot of Ke)if(ot.id===Y.scope){const at=ot.config?ot.config.sdCoverageSourceLayers:void 0;Array.isArray(at)&&at.length>0&&(D=at);break}}}),v.frcCoverageFadeRange=E,v.frcCoverageSourceLayers=null!=E?D||["road","structure"]:[]},HdElevationState:nm,setupAndUpdateElevationCoverage:function(k){if(!function(Y){for(const Z in Y._mergedLayers)if(oy(Y._mergedLayers[Z]))return true;return false}(k))return void tA(k);const v=Qt(k,k.map&&k.map.transform);k._hdElevation||(k._hdElevation=new nm);const E=k._hdElevation._terrainActiveLast;if(k._hdElevation._terrainActiveLast=v,void 0!==E&&E!==v&&d0(k,void 0,true),v)return void(k.map.painter&&(k.map.painter.elevationCoverageSnapshot=null));if(!Vl(k))return void tA(k);void 0===E&&d0(k,void 0,true);const D=k._hdElevation;D._needsCrossSourceElevation=true,k._crossSourceElevationActive=true,D._ingestFQIDs=Fl(k);const V=T2(k);k.forEachFragmentStyle(Y=>{for(const Z of V){if(!oh(Z,Y.scope))continue;const ne=o.bV(Z);if(Y._otherSourceCaches[ne]||Y._symbolSourceCaches[ne])continue;const le=Y.getOwnSource(ne);le&&"vector"===le.type&&(Y._hdElevation||(Y._hdElevation=new nm),qP(Y,Y._hdElevation,le))}}),k.mergeSources(),w2(k,D)},updateElevationCoverage:w2,updateHdElevationSourceCache:qP,markElevationIngestSourceCachesUsed:function(k){if(!k._hdElevation||!k._hdElevation._needsCrossSourceElevation)return;const v=k._hdElevation._ingestFQIDs;if(v)for(const E of v){const D=u0(k,E);D&&(D.used=true)}},updateCrossSourceElevationGate:function(k){k._crossSourceElevationActive=Vl(k);const v=k._mergedHdRoadElevationSourceCaches;v&&0!==Object.keys(v).length&&(k._hdElevation||(k._hdElevation=new nm),k._hdElevation._needsCrossSourceElevation=k._crossSourceElevationActive)},buildElevationRequestParams:function(k,v,E){if(v.renderSourceType===o.bR.HdRoadElevation)return null;if(Qt(k.style,k.transform))return null;if(!E)return null;const D=k.painter?k.painter.elevationCoverageSnapshot:null,V=!(!k.painter||!k.painter.elevationProvidersReady);return D?function(Y,Z,ne){const le=Y.getTilesIntersecting(Z);if(0===le.length)return{registry:[],hasCoveringTile:false,allProvidersReady:ne};const fe=[];for(const me of le)for(const Pe of me.features)fe.push({tileId:me.tileId,feature:Pe});return fe.sort((me,Pe)=>me.feature.id-Pe.feature.id),{registry:fe,hasCoveringTile:true,allProvidersReady:ne}}(D,v.tileID.canonical,V):{registry:[],hasCoveringTile:false,allProvidersReady:V}},FrcCoverageRenderer:class{constructor(){this.tileBuffers=new Map,this._context=null}update(k,v){this._context=k;const E=new Set;for(const D of v){if(0===D.frcMask)continue;let V=false;for(const Z of D.polygons)if(Z.hasGeometry()){V=true;break}if(!V)continue;const Y=`${D.tileId.z}/${D.tileId.x}/${D.tileId.y}`;if(E.add(Y),!this.tileBuffers.has(Y)){const Z=this._createBuffers(k,D);Z&&this.tileBuffers.set(Y,Z)}}for(const D of this.tileBuffers.keys())if(!E.has(D)){const V=this.tileBuffers.get(D);V.vertexBuffer.destroy(),V.indexBuffer.destroy();for(const Y of V.frcLevelSegments)Y&&Y.destroy();this.tileBuffers.delete(D)}}getBuffers(k){return this.tileBuffers.get(`${k.z}/${k.x}/${k.y}`)||null}destroy(){for(const k of this.tileBuffers.values()){k.vertexBuffer.destroy(),k.indexBuffer.destroy();for(const v of k.frcLevelSegments)v&&v.destroy()}this.tileBuffers.clear()}_createBuffers(k,v){const E=new o.bC,D=new o.ad,V=[];for(const Z of v.polygons){if(!Z.hasGeometry()||0===Z.rings.length)continue;const ne=E.length,le=D.length,fe=E.length,me=[],Pe=[];let Re=0;for(let ot=0;ot0&&Pe.push(Re);for(const xt of at)E.emplaceBack(xt.x,xt.y),me.push(xt.x,xt.y),Re++}}const Ke=o.bF(me,Pe.length>0?Pe:void 0);for(let ot=0;ot0&&k.program.draw(v,k.drawMode,k.depthMode,k.stencilMode,k.colorMode,o.$.disabled,k.uniformValues,k.layer.id,k.bufferData.layoutVertexBuffer,k.indexBuffer,le.frcNonRoadSegments,k.layer.paint,Re,k.programConfiguration,k.dynamicBuffers),"drawn"}return"fallthrough"},drawFillFrcCoverageSecondPass:function(k,v,E,D,V){if(0===E.length)return;const Y=Zu(k),Z=k.transform.zoom,ne=(le,fe,me)=>{1!==me&&(le.uniformValues.u_opacity_multiplier=me),le.program.draw(k,D,le.depthMode,fe,V,o.$.disabled,le.uniformValues,v.id,le.bufferData.layoutVertexBuffer,le.indexBuffer,le.segments,v.paint,Z,le.programConfiguration,le.dynamicBuffers),1!==me&&(le.uniformValues.u_opacity_multiplier=1)};f0(k,E,Y,(le,fe,me)=>ne(le,me,1),(le,fe,me)=>ne(le,me,Y))},drawLineFrcCoverageDetect:function(k,v,E,D,V,Y,Z,ne,le,fe){const me=v.hdExt&&v.hdExt.frcData;if(!me||0===me.frcPerLevel.size)return null;if(!k.frcCoverageSnapshot||D)return null;const Pe=k.frcCoverageSnapshot.getTileOrParent(E.canonical);if(!Pe||0===Pe.frcMask)return null;const Re=Qx(Pe.polygons),Ke=k.frcCoverageFadeRange,ot=null!=Ke&&k.transform.zoom>=Ke[0];if(Re&&ot){let at=false;for(const xt of me.frcPerLevel.keys())if(Pe.frcMask&1<0&&D(E,Z)},drawLineFrcFadePass:function(k,v,E,D,V,Y,Z){if(D.hasPolygonGeometry)return;const ne=v.hdExt&&v.hdExt.frcData;if(!ne||!k.frcCoverageFadeRange)return;const[le,fe]=k.frcCoverageFadeRange;if(le>=fe)return;const me=1-Math.max(0,Math.min(1,(k.transform.zoom-le)/(fe-le)));if(me<=0)return;const Pe=V?Y:k.stencilModeForClipping(E),Re=D.frcMask;for(const[Ke,ot]of ne.frcPerLevel)Re&1<{const Pe=ne.bucket.hdExt&&ne.bucket.hdExt.frcData,Re=Pe&&Pe.frcPerLevel.get(le);Re&&0!==Re.segments.length&&(1!==me&&(ne.uniformValues.u_opacity_multiplier=me),ne.program.draw(k,D.TRIANGLES,ne.depthMode,fe,ne.colorMode,o.$.disabled,ne.uniformValues,v.id,ne.bucket.layoutVertexBuffer,ne.bucket.indexBuffer,Re,v.paint,Y,ne.programConfiguration,[ne.bucket.layoutVertexBuffer2,ne.bucket.patternVertexBuffer,ne.bucket.zOffsetVertexBuffer,ne.bucket.elevationIdColVertexBuffer,ne.bucket.elevationGroundScaleVertexBuffer]),1!==me&&(ne.uniformValues.u_opacity_multiplier=1))};f0(k,E,V,(ne,le,fe)=>Z(ne,le,fe,1),(ne,le,fe)=>Z(ne,le,fe,V))}},To=XP;async function Jm(){return Promise.resolve()}class C2{constructor(v,E,D){this.screenBounds=v,this.cameraPoint=D.getCameraPoint(),this._screenRaycastCache={},this._cameraRaycastCache={},this.isAboveHorizon=E,this.screenGeometry=this.bufferedScreenGeometry(0),this.screenGeometryMercator=this._bufferedScreenMercator(0,D)}static createFromScreenPoints(v,E){let D,V;if(v instanceof o.P||"number"==typeof v[0]){const Y=o.P.convert(v);D=[Y],V=E.isPointAboveHorizon(Y)}else{const Y=o.P.convert(v[0]),Z=o.P.convert(v[1]),ne=Y.add(Z)._div(2);D=[Y,Z],V=o.bZ(Y,Z).every(le=>E.isPointAboveHorizon(le))&&E.isPointAboveHorizon(ne)}return new C2(D,V,E)}isPointQuery(){return 1===this.screenBounds.length}bufferedScreenGeometry(v){return o.bZ(this.screenBounds[0],1===this.screenBounds.length?this.screenBounds[0]:this.screenBounds[1],v)}bufferedCameraGeometry(v){const E=this.screenBounds[0],D=1===this.screenBounds.length?this.screenBounds[0].add(new o.P(1,1)):this.screenBounds[1],V=o.bZ(E,D,0,false);return this.cameraPoint.y>D.y&&(this.cameraPoint.x>E.x&&this.cameraPoint.x=D.x?V[2]=this.cameraPoint:this.cameraPoint.x<=E.x&&(V[3]=this.cameraPoint)),o.b_(V,v)}bufferedCameraGeometryGlobe(v){const E=this.screenBounds[0],D=1===this.screenBounds.length?this.screenBounds[0].add(new o.P(1,1)):this.screenBounds[1],V=o.bZ(E,D,v),Y=this.cameraPoint.clone(),Z=Number(Y.x>E.x)+Number(Y.x>D.x);switch(3*(Number(Y.y>E.y)+Number(Y.y>D.y))+Z){case 0:V[0]=Y,V[4]=Y.clone();break;case 1:V.splice(1,0,Y);break;case 2:V[1]=Y;break;case 3:V.splice(4,0,Y);break;case 5:V.splice(2,0,Y);break;case 6:V[3]=Y;break;case 7:V.splice(3,0,Y);break;case 8:V[2]=Y}return V}containsTile(v,E,D,V=0,Y){const Z=Math.max(v.queryPadding,v.evaluateQueryRenderedFeaturePadding())/E._pixelsPerMercatorPixel+1,ne=D?this._bufferedCameraMercator(Z,E):this._bufferedScreenMercator(Z,E);let le=v.tileID.wrap+(ne.unwrapped?V:0);const fe=ne.polygon.map(xt=>o.b$(v.tileTransform,xt,le));if(!o.c0(fe,0,0,o.a2,o.a2))return;le=v.tileID.wrap+(this.screenGeometryMercator.unwrapped?V:0);const me=this.screenGeometryMercator.polygon.map(xt=>o.c1(v.tileTransform,xt,le)),Pe=me.map(xt=>new o.P(xt[0],xt[1])),Re=o.c1(v.tileTransform,Y,le),Ke=me.map(xt=>{const vt=o.c2(xt,xt,Re);return o.c3(vt,vt),new o.c4(Re,vt)}),ot=o.c5(v,1,E.zoom)*E._pixelsPerMercatorPixel;return{queryGeometry:this,tilespaceGeometry:Pe,tilespaceRays:Ke,bufferedTilespaceGeometry:fe,bufferedTilespaceBounds:(at=o.c6(fe),at.min.x=o.b0(at.min.x,0,o.a2),at.min.y=o.b0(at.min.y,0,o.a2),at.max.x=o.b0(at.max.x,0,o.a2),at.max.y=o.b0(at.max.y,0,o.a2),at),tile:v,tileID:v.tileID,pixelToTileUnitsFactor:ot};var at}_bufferedScreenMercator(v,E){const D=jP(v);if(this._screenRaycastCache[D])return this._screenRaycastCache[D];{let V;return V="globe"===E.projection.name?this._projectAndResample(this.bufferedScreenGeometry(v),E):{polygon:this.bufferedScreenGeometry(v).map(Y=>E.pointCoordinate3D(Y)),unwrapped:true},this._screenRaycastCache[D]=V,V}}_bufferedCameraMercator(v,E){const D=jP(v);if(this._cameraRaycastCache[D])return this._cameraRaycastCache[D];{let V;return V="globe"===E.projection.name?this._projectAndResample(this.bufferedCameraGeometryGlobe(v),E):{polygon:this.bufferedCameraGeometry(v).map(Y=>E.pointCoordinate3D(Y)),unwrapped:true},this._cameraRaycastCache[D]=V,V}}_projectAndResample(v,E){const D=function(Y,Z){const ne=o.X([],Z.pixelMatrix,Z.globeMatrix),le=[0,-o.c8,0,1],fe=[0,o.c8,0,1],me=[0,0,0,1];o.c7(le,le,ne),o.c7(fe,fe,ne),o.c7(me,me,ne);const Pe=new o.P(le[0]/le[3],le[1]/le[3]),Re=new o.P(fe[0]/fe[3],fe[1]/fe[3]),Ke=o.c9(Y,Pe)&&le[3]1?nA(Y.slice(0,xt),Z):[],jt=xtnew o.P(S2(xn.x),xn.y)),jt=jt.map(xn=>new o.P(S2(xn.x),xn.y));const Zt=[...It];0===Zt.length&&Zt.push(jt.at(-1));const kn=Zt.at(-1),cn=o.al(kn.y,(0===jt.length?It[0]:jt[0]).y,vt);let hn;return hn=Ke?[new o.P(0,cn),new o.P(0,0),new o.P(1,0),new o.P(1,cn)]:[new o.P(1,cn),new o.P(1,1),new o.P(0,1),new o.P(0,cn)],Zt.push(...hn),0===jt.length?Zt.push(It[0]):Zt.push(...jt),{polygon:Zt.map(xn=>new o.bS(xn.x,xn.y)),unwrapped:false}}(v,E);if(D)return D;const V=function(Y,Z){let ne=false,le=-1/0,fe=0;for(let Pe=0;Pele&&(le=Y[Pe].x,fe=Pe);for(let Pe=0;Pe.5&&(Ke.x{Pe.x-=1}),{polygon:Y,unwrapped:ne}}(nA(v,E).map(Y=>new o.P(S2(Y.x),Y.y)),E);return{polygon:V.polygon.map(Y=>new o.bS(Y.x,Y.y)),unwrapped:V.unwrapped}}}function nA(k,v){return o.ca(k,E=>{const D=v.pointCoordinate3D(E);E.x=D.x,E.y=D.y},1/256)}function S2(k){return k<0?1+k%1:k%1}function jP(k){return 100*k|0}class A2 extends o.E{constructor(v,E,D,V){if(super(),this.id=v,this.dispatcher=D,this.type="vector",this.provider=E.provider,this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=true,this.isTileClipped=true,this._loaded=false,Object.assign(this,o.cb(E,["url","scheme","tileSize","promoteId"])),this._options={type:"vector",...E},this._collectResourceTiming=!!E.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(V),this._tileWorkers={},this._deduped=new o.cc}load(v){this._loaded=false,this.fire(new o.h("dataloading",{dataType:"source"}));const E=Array.isArray(this.map._language)?this.map._language.join():this.map._language,D=this.map.getWorldview(),V=(Z,ne)=>{this._tileJSONRequest=null,this._loaded=true,Z?(E&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${E}`),D&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${D}`),this.fire(new o.f(Z))):ne&&(this._setTileJSON(ne),To.updateCrossSourceElevationGate&&this.map.style&&To.updateCrossSourceElevationGate(this.map.style),o.ck(ne.tiles,this.map._requestManager._customAccessToken),this.fire(new o.h("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new o.h("data",{dataType:"source",sourceDataType:"content"}))),v&&v(Z)};this.provider=this._options.provider;const Y=o.cd(this._options);return Y instanceof Error?(this._loaded=true,this.fire(new o.f(Y)),void(v&&v())):this.provider&&!Y?(this._loaded=true,this.fire(new o.f(new Error(`TileProvider "${this.provider}" is not registered`))),void(v&&v())):void(this._tileJSONRequest=Y?this.loadTileJSONWithProvider(Y,V):o.ce(this._options,this.map._requestManager,E,D,V))}loadTileJSONWithProvider(v,E){this.provider=v.name;const D=new AbortController;return(async()=>{const{request:V,options:Y}=await o.cl(this._options,this.map._requestManager,D.signal);if(D.signal.aborted)return;const Z=await this.dispatcher.send("loadTileProvider",{name:v.name,url:v.url,source:this.id,scope:this.scope,type:this.type,options:Y,request:V},{signal:D.signal});if(D.signal.aborted)return;const ne=Z?Z.find(fe=>null!=fe):null,le=o.cm(this._options,ne,this.map._requestManager);le instanceof Error?E(le):E(null,le)})().catch(V=>{D.signal.aborted||E(V)}),{cancel:()=>D.abort()}}_setTileJSON(v){if(Object.assign(this,v),this.hasWorldviews=!!v.worldview_options,v.worldview_default&&(this.worldviewDefault=v.worldview_default),v.vector_layers){this.vectorLayers=v.vector_layers,this.vectorLayerIds=[],this.localizableLayerIds=new Set;for(const E of v.vector_layers)this.vectorLayerIds.push(E.id),v.worldview&&v.worldview[E.source]&&this.localizableLayerIds.add(E.id)}this.tileBounds=o.cf.fromTileJSON(v)}loaded(){return this._loaded}hasTile(v){return!this.tileBounds||this.tileBounds.contains(v.canonical)}onAdd(v){this.map=v,this.load()}reload(){this.cancelTileJSONRequest();const v=o.m(this.id,this.scope);this.load(()=>this.map.style.clearSource(v))}setTiles(v){return this._options.tiles=v,this.reload(),this}setUrl(v){return this.url=v,this._options.url=v,this.reload(),this}onRemove(v){this.cancelTileJSONRequest()}serialize(){return{...this._options}}async loadTile(v,E){const D=v.tileID.canonical.url(this.tiles,this.scheme),V=this.map._requestManager.normalizeTileURL(D),Y=!v.actor||"expired"===v.state;if(!Y&&"loading"===v.state)return void(v.reloadCallback=E);Y&&(v.actor=this._tileWorkers[V]=this._tileWorkers[V]||this.dispatcher.getActor());const Z=new AbortController;v.request=Z;try{const ne=await this.map._requestManager.transformRequest(V,o.R.Tile,Z.signal);if(Z.signal.aborted)return E(null);this.dispatchTile(v,V,D,ne,Z,Y,E)}catch(ne){if(Z.signal.aborted)return E(null);E(ne)}}dispatchTile(v,E,D,V,Y,Z,ne){const le=this.map.style?this.map.style.getLut(this.scope):null,fe=le?{image:le.image.clone()}:null,me=!(!this.map.style||!this.map.style._crossSourceElevationActive),Pe=!(!this.map.style||!me),Re={request:V,data:void 0,uid:v.uid,tileID:v.tileID,tileZoom:v.tileZoom,zoom:v.tileID.overscaledZ,maxZoom:this.maxzoom,lut:fe,tileSize:this.tileSize*v.tileID.overscaleFactor(),type:this.type,source:this.id,scope:this.scope,pixelRatio:o.e.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,showElevationIdDebug:!!this.map.painter&&this.map.painter._debugParams.showElevationIdDebug,promoteId:this.promoteId,renderSourceType:v.renderSourceType,frcCoverage:(()=>{const ot=this.map.painter,at=ot?ot.frcCoverageFadeRange:null;if(null==at)return null;const xt=ot?ot.frcCoverageSnapshot:null,vt=this.map.transform.zoom=Math.ceil(at[1]),Zt=xt&&jt?xt.getFullCoverageMask(v.tileID.canonical):null;return{frcMask:jt?Zt??null:null,resolved:vt||null!=xt,polygons:It&&0!==It.frcMask?It.polygons:null,tileZoom:It&&0!==It.frcMask?It.tileId.z:null,sourceLayers:ot?ot.frcCoverageSourceLayers:["road","structure"]}})(),terrainEnabled:Qt(this.map.style,this.map.transform),crossSourceElevationEnabled:Pe,elevation:To.buildElevationRequestParams?To.buildElevationRequestParams(this.map,v,me):null,brightness:this.map.style&&this.map.style.getBrightness()||0,extraShadowCaster:v.isExtraShadowCaster,tessellationStep:this.map._tessellationStep,scaleFactor:this.map.getScaleFactor(),worldview:this.map.getWorldview()||this.worldviewDefault,indoor:this.map.getIndoorTileOptions(this.id,this.scope)};if(this.hasWorldviews&&o.cg(D)&&(Re.localizableLayerIds=this.localizableLayerIds),Re.request.collectResourceTiming=this._collectResourceTiming,Z)if(this.dispatcher.ready||this.provider)v.request=v.actor.sendCancelable("loadTile",Re,{},Ke.bind(this));else{const ot=o.ch.call({deduped:this._deduped},Re,(at,xt)=>{v.aborted||(at||!xt?Ke.call(this,at):(Re.data={rawData:xt.rawData.slice(0),headers:xt.headers},v.actor&&(v.request=v.actor.sendCancelable("loadTile",Re,{},Ke.bind(this)))))},true);Y.signal.addEventListener("abort",ot,{once:true})}else v.request=v.actor.sendCancelable("reloadTile",Re,{},Ke.bind(this));function Ke(ot,at){return delete v.request,v.aborted?ne(null):ot?ne(ot):(at&&at.resourceTiming&&(v.resourceTiming=at.resourceTiming),this.map._refreshExpiredTiles&&at&&v.setExpiryData(o.ci(at.headers)),void function(){if(v.aborted)return ne(null);v.loadVectorData(at,this.map.painter),o.cj(this.dispatcher),ne(null,at),v.reloadCallback&&(this.loadTile(v,v.reloadCallback),v.reloadCallback=null)}.call(this))}}abortTile(v){v.request&&(v.request.abort(),delete v.request),v.actor&&v.actor.notify("abortTile",{uid:v.uid,type:this.type,source:this.id,scope:this.scope})}unloadTile(v,E){v.actor&&v.actor.notify("removeTile",{uid:v.uid,type:this.type,source:this.id,scope:this.scope}),v.destroy()}hasTransition(){return false}afterUpdate(){this._tileWorkers={}}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}class VF extends o.E{constructor(v,E,D,V){super(),this.id=v,this.dispatcher=D,this.setEventedParent(V),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=true,this.scheme="xyz",this.tileSize=512,this._loaded=false,this._options={type:"raster",...E},Object.assign(this,o.cb(E,["url","scheme","tileSize"]))}load(v){this._loaded=false,this.fire(new o.h("dataloading",{dataType:"source"}));const E=this.map.getWorldview(),D=(Y,Z)=>{this._tileJSONRequest=null,this._loaded=true,Y?this.fire(new o.f(Y)):Z&&(Object.assign(this,Z),Z.raster_layers&&(this.rasterLayers=Z.raster_layers,this.rasterLayerIds=this.rasterLayers.map(ne=>ne.id)),this.tileBounds=o.cf.fromTileJSON(Z),o.ck(Z.tiles),this.fire(new o.h("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new o.h("data",{dataType:"source",sourceDataType:"content"}))),v&&v(Y)};this.provider="string"==typeof this._options.provider?this._options.provider:void 0,this._tileProvider=void 0;const V=o.cd(this._options);return V instanceof Error?(this._loaded=true,this.fire(new o.f(V)),void(v&&v())):this.provider&&!V?(this._loaded=true,this.fire(new o.f(new Error(`TileProvider "${this.provider}" is not registered`))),void(v&&v())):void(this._tileJSONRequest=V?this.loadTileJSONWithProvider(V,D):o.ce(this._options,this.map._requestManager,null,E,D))}loadTileJSONWithProvider(v,E){this.provider=v.name;const D=new AbortController;return(async()=>{const{request:V,options:Y}=await o.cl(this._options,this.map._requestManager,D.signal);if(D.signal.aborted)return;const Z=await o.cn(v.name,v.url);if(D.signal.aborted)return;const ne=new Z(Y);let le=null;if(ne.load&&V&&(le=await ne.load({request:V}),D.signal.aborted))return;this._tileProvider=ne;const fe=o.cm(this._options,le,this.map._requestManager);fe instanceof Error?E(fe):E(null,fe)})().catch(V=>{D.signal.aborted||E(new Error(`Could not load tile provider ${v.name}`,{cause:V}))}),{cancel:()=>D.abort()}}loaded(){return this._loaded}onAdd(v){this.map=v,this.load()}reload(){this.cancelTileJSONRequest();const v=o.m(this.id,this.scope);this.load(()=>this.map.style.clearSource(v))}setTiles(v){return this._options.tiles=v,this.reload(),this}setUrl(v){return this.url=v,this._options.url=v,this.reload(),this}onRemove(v){this.cancelTileJSONRequest()}serialize(){return{...this._options}}hasTile(v){return!this.tileBounds||this.tileBounds.contains(v.canonical)}async loadTile(v,E){const D=o.e.devicePixelRatio>=2,V=this.map._requestManager.normalizeTileURL(v.tileID.canonical.url(this.tiles,this.scheme),D,this.tileSize),Y=new AbortController;if(v.request=Y,this._tileProvider)this.loadTileWithProvider(v,this._tileProvider,V,Y,E);else try{const Z=await this.map._requestManager.transformRequest(V,o.R.Tile,Y.signal);if(Y.signal.aborted)return delete v.request,E(null);const{data:ne,headers:le}=await o.a(Z,Y.signal);if(delete v.request,v.aborted)return E(null);const fe=o.ci(le);this.map._refreshExpiredTiles&&v.setExpiryData(fe),v.setTexture(ne,this.map.painter),v.state="loaded",o.cj(this.dispatcher),E(null)}catch(Z){if(delete v.request,Y.signal.aborted)return E(null);v.state="errored",E(Z)}}async loadTileWithProvider(v,E,D,V,Y){const{z:Z,x:ne,y:le}=v.tileID.canonical;try{const fe=await this.map._requestManager.transformRequest(D,o.R.Tile,V.signal);if(V.signal.aborted)return Y(null);const me=await E.loadTile({z:Z,x:ne,y:le},{request:fe,signal:V.signal});if(V.signal.aborted)return Y(null);if(null==me){const Re=new Error("Tile not found");return Re.status=404,v.state="errored",Y(Re)}if(null==me.data)return v.state="loaded",Y(null);const Pe=me.data instanceof ImageBitmap?me.data:await createImageBitmap(new Blob([me.data]));if(V.signal.aborted)return Y(null);v.setTexture(Pe,this.map.painter),v.state="loaded",this.map._refreshExpiredTiles&&v.setExpiryData({cacheControl:me.cacheControl,expires:me.expires}),Y(null)}catch(fe){if(V.signal.aborted)return Y(null);v.state="errored",Y(new Error(`Could not load tile from ${D}`,{cause:fe}))}finally{delete v.request}}abortTile(v,E){v.request&&(v.request.abort(),delete v.request),E&&E()}unloadTile(v,E){v.texture&&v.texture instanceof o.T?(v.destroy(false),v.texture&&v.texture instanceof o.T&&this.map.painter.saveTileTexture(v.texture)):v.destroy(),E&&E()}hasTransition(){return false}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}function s7(k,v,E,D,V,Y,Z,ne){const le=[k,v,1,E,D,1,V,Y,1],fe=[Z,ne,1],me=o.cu([],le),[Pe,Re,Ke]=o.ct(fe,fe,me);return o.cv(le,le,[Pe,0,0,0,Re,0,0,0,Ke])}function Lv(k,v,E,D,V,Y,Z,ne){const le=function(fe,me,Pe,Re,Ke,ot,at,xt){const vt=s7(0,0,1,0,1,1,0,1),It=s7(fe,me,Pe,Re,Ke,ot,at,xt),jt=o.cu([],vt);return o.cv(It,It,jt)}(k,v,E,D,V,Y,Z,ne);return[le[2]/le[8]/o.a2,le[5]/le[8]/o.a2]}function l7(k){return[k[0],Math.min(Math.max(k[1],-o.cp),o.cp)]}class sy extends o.E{constructor(v,E,D,V){super(),this.id=v,this.dispatcher=D,this.coordinates=E.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=false,this.onNorthPole=false,this.onSouthPole=false,this.setEventedParent(V),this.options=E,this._dirty=false}async load(v,E){if(this._loaded=E||false,this.fire(new o.h("dataloading",{dataType:"source"})),this.url=this.options.url,!this.url)return v&&(this.coordinates=v),this._loaded=true,void this._finishLoading();const D=new AbortController;this._imageRequest=D;try{const V=await this.map._requestManager.transformRequest(this.url,o.R.Image,D.signal),{data:Y}=await o.a(V,D.signal);this._imageRequest=null,this._loaded=true,this.image=Y,this._dirty=true,this.width=this.image.width,this.height=this.image.height,v&&(this.coordinates=v),this._finishLoading()}catch(V){if(D.signal.aborted)return;this._imageRequest=null,this._loaded=true,this.fire(new o.f(V))}}loaded(){return this._loaded}updateImage(v){return v.url?(this._imageRequest&&v.url!==this.options.url&&(this._imageRequest.abort(),this._imageRequest=null),this.options.url=v.url,this.load(v.coordinates,this._loaded),this):this}setTexture(v){if(!(v.handle instanceof WebGLTexture))throw new Error("The provided handle is not a WebGLTexture instance");return this.texture=new o.co(this.map.painter.context,v.handle),this.width=v.dimensions[0],this.height=v.dimensions[1],this._dirty=false,this._loaded=true,this._finishLoading(),this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new o.h("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(v){this.map=v,this.load()}onRemove(v){this._imageRequest&&(this._imageRequest.abort(),this._imageRequest=null),!this.texture||this.texture instanceof o.co||this.texture.destroy(),this.boundsBuffer&&(this.boundsBuffer.destroy(),this.elevatedGlobeVertexBuffer&&this.elevatedGlobeVertexBuffer.destroy(),this.elevatedGlobeIndexBuffer&&this.elevatedGlobeIndexBuffer.destroy())}setCoordinates(v){if(this.coordinates=v,this._boundsArray=void 0,this._unsupportedCoords=false,!v.length)return this;this.onNorthPole=false,this.onSouthPole=false;let E=v[0][1],D=v[0][1];for(const Y of v)Y[1]>D&&(D=Y[1]),Y[1]o.cp?this.onNorthPole=true:V<-o.cp&&(this.onSouthPole=true),!this.onNorthPole&&!this.onSouthPole){const Y=v.map(o.bS.fromLngLat);this.tileID=function(Z){let ne=1/0,le=1/0,fe=-1/0,me=-1/0;for(const at of Z)ne=Math.min(ne,at.x),le=Math.min(le,at.y),fe=Math.max(fe,at.x),me=Math.max(me,at.y);const Pe=Math.max(fe-ne,me-le),Re=Math.max(0,Math.floor(-Math.log2(Pe))),Ke=Math.pow(2,Re);let ot=Math.floor((ne+fe)/2*Ke);return ot>1&&(ot-=1),new o.bX(Re,ot,Math.floor((le+me)/2*Ke))}(Y),this.minzoom=this.maxzoom=this.tileID.z}return this.fire(new o.h("data",{dataType:"source",sourceDataType:"content"})),this}_clear(){!this.texture||this.texture instanceof o.co||(this.texture.destroy(),this._dirty=true),this.texture=null,this._boundsArray=void 0,this._unsupportedCoords=false}_prepareData(v){for(const kn in this.tiles){const cn=this.tiles[kn];"loaded"!==cn.state&&(cn.state="loaded",cn.texture=this.texture)}if(this._boundsArray||this.onNorthPole||this.onSouthPole||this._unsupportedCoords)return;const E=o.bp(new o.bX(0,0,0),this.map.transform.projection),D=[E.projection.project(this.coordinates[0][0],this.coordinates[0][1]),E.projection.project(this.coordinates[1][0],this.coordinates[1][1]),E.projection.project(this.coordinates[2][0],this.coordinates[2][1]),E.projection.project(this.coordinates[3][0],this.coordinates[3][1])];if(!function(kn){const cn=kn[1].x-kn[0].x,hn=kn[1].y-kn[0].y,xn=kn[2].x-kn[1].x,wn=kn[2].y-kn[1].y,Bn=kn[3].x-kn[2].x,Kn=kn[3].y-kn[2].y,Wn=kn[0].x-kn[3].x,Yn=kn[0].y-kn[3].y,Vn=cn*wn-xn*hn,Zr=xn*Kn-Bn*wn,Qn=Bn*Yn-Wn*Kn,kr=Wn*hn-cn*Yn;return Vn>0&&Zr>0&&Qn>0&&kr>0||Vn<0&&Zr<0&&Qn<0&&kr<0}(D))return console.warn("Image source coordinates are defining non-convex area in the Mercator projection"),void(this._unsupportedCoords=true);const V=o.bp(this.tileID,this.map.transform.projection),[Y,Z,ne,le]=this.coordinates.map(kn=>{const cn=V.projection.project(kn[0],kn[1]);return o.b$(V,cn)._round()});this.perspectiveTransform=Lv(Y.x,Y.y,Z.x,Z.y,ne.x,ne.y,le.x,le.y);const fe=this._boundsArray=new o.bs;fe.emplaceBack(Y.x,Y.y,0,0),fe.emplaceBack(Z.x,Z.y,o.a2,0),fe.emplaceBack(le.x,le.y,0,o.a2),fe.emplaceBack(ne.x,ne.y,o.a2,o.a2),this.boundsBuffer&&(this.boundsBuffer.destroy(),this.elevatedGlobeVertexBuffer&&this.elevatedGlobeVertexBuffer.destroy(),this.elevatedGlobeIndexBuffer&&this.elevatedGlobeIndexBuffer.destroy()),this.boundsBuffer=v.createVertexBuffer(fe,Iv.members),this.boundsSegments=o.ac.simpleSegment(0,0,4,2);const me=o.cs,Pe=me+1,Re=me+1,Ke=Pe*Re,ot=me*me*2,at=[],xt=function(kn){return[l7(kn[0]),l7(kn[1]),l7(kn[2]),l7(kn[3])]}(this.coordinates),[vt,It,jt,Zt]=function(kn){let cn=kn[0][0],hn=cn,xn=kn[0][1],wn=xn;for(let Bn=1;Bnhn&&(hn=kn[Bn][0]),kn[Bn][1]wn&&(wn=kn[Bn][1]);return[cn,xn,hn-cn,wn-xn]}(xt);{const kn=new o.bs,[cn,hn,xn,wn]=function(Kr){let qi=Kr[0].x,Wr=qi,Lr=Kr[0].y,ii=Lr;for(let Di=1;DiWr&&(Wr=Kr[Di].x),Kr[Di].yii&&(ii=Kr[Di].y);return[qi,Lr,Wr-qi,ii-Lr]}(D),Bn=Kr=>[(Kr.x-cn)/xn,(Kr.y-hn)/wn],[Kn,Wn,Yn,Vn]=D.map(Bn),Zr=function(Kr,qi,Wr,Lr,ii,Di,ci,Ri){const ji=s7(0,0,1,0,1,1,0,1),Go=s7(Kr,qi,Wr,Lr,ii,Di,ci,Ri),po=o.cu([],Go);return o.cv(ji,ji,po)}(Kn[0],Kn[1],Wn[0],Wn[1],Yn[0],Yn[1],Vn[0],Vn[1]);this.elevatedGlobePerspectiveTransform=Lv(Kn[0],Kn[1],Wn[0],Wn[1],Yn[0],Yn[1],Vn[0],Vn[1]);const Qn=(Kr,qi)=>{at.push(Kr.lng);const Wr=Math.round((Kr.lng-vt)/jt*o.a2),Lr=Math.round((Kr.lat-It)/Zt*o.a2),ii=Bn(qi),Di=o.ct([],[ii[0],ii[1],1],Zr),ci=Math.round(Di[0]/Di[2]*o.a2),Ri=Math.round(Di[1]/Di[2]*o.a2);kn.emplaceBack(Wr,Lr,ci,Ri)},kr=D[3].x-D[0].x,Vr=D[3].y-D[0].y,mi=D[2].x-D[1].x,si=D[2].y-D[1].y;for(let Kr=0;Kr{cn.emplaceBack(xn,wn,Bn);const Kn=at[xn],Wn=at[wn],Yn=at[Bn],Vn=Math.min(Math.min(Kn,Wn),Yn),Zr=Math.max(Math.max(Kn,Wn),Yn)-Vn;Zr>this.maxLongitudeTriangleSize&&(this.maxLongitudeTriangleSize=Zr),kn.push(Vn+Zr/2)};for(let xn=0;xnVn);Bn.sort((Yn,Vn)=>xn[Yn]-xn[Vn]);const Kn=[],Wn=new o.ad;for(let Yn=0;Yn{Z.segments.push({vertexOffset:0,primitiveOffset:Pe,vertexLength:E.segments[0].vertexLength,primitiveLength:Re,sortKey:void 0,vaos:{}})},le=.51*this.maxLongitudeTriangleSize;if(Math.abs(D[0]-V)<=le){const Pe=o.cq(D,0,D.length,V+le);return Pe===D.length||ne(Pe,o.cr(D,Pe+1,D.length,V+360-le)-Pe),Z}V{const{request:D,options:V}=await o.cl(this._options,this.map._requestManager,E.signal);if(E.signal.aborted)return;const Y=await this.dispatcher.send("loadTileProvider",{name:k.name,url:k.url,source:this.id,scope:this.scope,type:this.type,options:V,request:D},{signal:E.signal});if(E.signal.aborted)return;const Z=Y?Y.find(le=>null!=le):null,ne=o.cm(this._options,Z,this.map._requestManager);ne instanceof Error?v(ne):v(null,ne)})().catch(D=>{E.signal.aborted||v(D)}),{cancel:()=>E.abort()}}async loadTile(k,v){if(k.actor&&"expired"!==k.state)return;const E=this.map._requestManager.normalizeTileURL(k.tileID.canonical.url(this.tiles,this.scheme),false,this.tileSize);k.actor=this.dispatcher.getActor();const D=new AbortController;k.request=D;try{const V=await this.map._requestManager.transformRequest(E,o.R.Tile,D.signal);if(D.signal.aborted)return v(null);k.request=k.actor.sendCancelable("loadTile",{uid:k.uid,tileID:k.tileID,source:this.id,type:this.type,scope:this.scope,request:V,encoding:this.encoding},{},function(Y,Z){return delete k.request,k.aborted?v(null):Y?(k.state="errored",v(Y)):(Z&&(this.map._refreshExpiredTiles&&k.setExpiryData(o.ci(Z.headers)),Z.borderReady||k.neighboringTiles||(k.neighboringTiles=this._getNeighboringTiles(k.tileID)),k.dem=Z.dem,k.dem.onDeserialize(),k.needsHillshadePrepare=true,k.needsDEMTextureUpload=true),k.state="loaded",void v(null))}.bind(this))}catch(V){if(D.signal.aborted)return v(null);k.state="errored",v(V)}}abortTile(k,v){k.request&&(k.request.abort(),delete k.request),k.actor&&k.actor.notify("abortTile",{uid:k.uid,type:this.type,source:this.id,scope:this.scope}),v&&v()}_getNeighboringTiles(k){const v=k.canonical,E=Math.pow(2,v.z),D=(v.x-1+E)%E,V=0===v.x?k.wrap-1:k.wrap,Y=(v.x+1+E)%E,Z=v.x+1===E?k.wrap+1:k.wrap,ne={};return ne[new o.bP(k.overscaledZ,V,v.z,D,v.y).key]={backfilled:false},ne[new o.bP(k.overscaledZ,Z,v.z,Y,v.y).key]={backfilled:false},v.y>0&&(ne[new o.bP(k.overscaledZ,V,v.z,D,v.y-1).key]={backfilled:false},ne[new o.bP(k.overscaledZ,k.wrap,v.z,v.x,v.y-1).key]={backfilled:false},ne[new o.bP(k.overscaledZ,Z,v.z,Y,v.y-1).key]={backfilled:false}),v.y+1v(null,E)).catch(E=>v(E)),this}getClusterChildren(k,v){return this.actor.send("geojson.getClusterChildren",{clusterId:k,source:this.id,scope:this.scope}).then(E=>v(null,E)).catch(E=>v(E)),this}getClusterLeaves(k,v,E,D){return this.actor.send("geojson.getClusterLeaves",{source:this.id,scope:this.scope,clusterId:k,limit:v,offset:E}).then(V=>D(null,V)).catch(V=>D(V)),this}async _updateWorkerData(k=false){if(this._pendingLoad)return void(this._coalesce=true);this.fire(new o.h("dataloading",{dataType:"source"})),this._loaded=false;const v={append:k,...this.workerOptions};v.scope=this.scope;const E=this._data,D=new AbortController;this._pendingLoad=D;try{if("string"==typeof E){if(v.request=await this.map._requestManager.transformRequest(o.e.resolveURL(E),o.R.Source,D.signal),D.signal.aborted)return this._pendingLoad=null,void(this._coalesce=false);v.request.collectResourceTiming=this._collectResourceTiming}else v.data=JSON.stringify(E);const V=await this.actor.send(`${this.type}.loadData`,v,{signal:D.signal});this._loaded=true,this._pendingLoad=null;const Y={dataType:"source",sourceDataType:this._metadataFired?"content":"metadata"};this._collectResourceTiming&&V&&V.resourceTiming&&V.resourceTiming[this.id]&&(Y.resourceTiming=V.resourceTiming[this.id]),k&&(this._partialReload=true),this.fire(new o.h("data",Y)),this._partialReload=false,this._metadataFired=true}catch(V){if(D.signal.aborted)return this._pendingLoad=null,void(this._coalesce=false);this._loaded=true,this._pendingLoad=null,this.fire(new o.f(V))}this._coalesce&&(this._updateWorkerData(k),this._coalesce=false)}loaded(){return this._loaded}reload(){const k=o.m(this.id,this.scope);this.map.style.clearSource(k),this._updateWorkerData()}loadTile(k,v){const E=k.actor?"reloadTile":"loadTile";k.actor=this.actor;const D=this.map.style?this.map.style.getLut(this.scope):null,V=D?{image:D.image.clone()}:null,Y=this._partialReload,Z={type:this.type,uid:k.uid,tileID:k.tileID,tileZoom:k.tileZoom,zoom:k.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,lut:V,scope:this.scope,pixelRatio:o.e.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,showElevationIdDebug:!!this.map.painter&&this.map.painter._debugParams.showElevationIdDebug,promoteId:this.promoteId,brightness:this.map.style&&this.map.style.getBrightness()||0,extraShadowCaster:k.isExtraShadowCaster,scaleFactor:this.map.getScaleFactor(),partial:Y,worldview:this.map.getWorldview(),indoor:this.map.getIndoorTileOptions(this.id,this.scope)};k.request=this.actor.sendCancelable(E,Z,{},(ne,le)=>Y&&!le?(k.state="loaded",v(null)):(delete k.request,k.destroy(false),k.aborted?v(null):ne?v(ne):(k.loadVectorData(le,this.map.painter,"reloadTile"===E),void v(null))))}abortTile(k){k.request&&(k.request.abort(),delete k.request),k.aborted=true}unloadTile(k,v){this.actor.notify("removeTile",{uid:k.uid,type:this.type,source:this.id,scope:this.scope}),k.destroy()}onRemove(k){this._pendingLoad&&this._pendingLoad.abort()}serialize(){return{...this._options,type:this.type,data:this._data}}hasTransition(){return false}},video:class extends sy{constructor(k,v,E,D){super(k,v,E,D),this.roundZoom=true,this.type="video",this.options=v}async load(){this._loaded=false;const k=this.options,v=new AbortController;this._imageRequest=v;try{const E=await Promise.all(k.urls.map(async V=>(await this.map._requestManager.transformRequest(V,o.R.Source,v.signal)).url));if(v.signal.aborted)return;this.urls=E;const D=await o.cw(E);if(v.signal.aborted)return;this._imageRequest=null,this.video=D,this.video.loop=true,this.video.setAttribute("playsinline",""),this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(E){if(v.signal.aborted)return;this.fire(new o.f(E))}finally{this._loaded=true}}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(k){if(this.video){const v=this.video.seekable;kv.end(0)?this.fire(new o.f(new Ne(`sources.${this.id}`,null,`Playback for this video can be set only between the ${v.start(0)} and ${v.end(0)}-second mark.`))):this.video.currentTime=k}}getVideo(){return this.video}onAdd(k){this.map||(this.map=k,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;const k=this.map.painter.context,v=k.gl;this.texture?this.video.paused||(this.texture.bind(v.LINEAR,v.CLAMP_TO_EDGE),v.texSubImage2D(v.TEXTURE_2D,0,0,0,v.RGBA,v.UNSIGNED_BYTE,this.video)):(this.texture=new o.T(k,this.video,v.RGBA8),this.texture.bind(v.LINEAR,v.CLAMP_TO_EDGE),this.width=this.video.videoWidth,this.height=this.video.videoHeight),this._prepareData(k)}serialize(){return{type:"video",urls:this.options.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},image:sy,canvas:class extends sy{constructor(k,v,E,D){super(k,v,E,D),v.coordinates?Array.isArray(v.coordinates)&&4===v.coordinates.length&&!v.coordinates.some(V=>!Array.isArray(V)||2!==V.length||V.some(Y=>"number"!=typeof Y))||this.fire(new o.f(new Ne(`sources.${k}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new o.f(new Ne(`sources.${k}`,null,'missing required property "coordinates"'))),v.animate&&"boolean"!=typeof v.animate&&this.fire(new o.f(new Ne(`sources.${k}`,null,'optional "animate" property must be a boolean value'))),v.canvas?"string"==typeof v.canvas||v.canvas instanceof HTMLCanvasElement||this.fire(new o.f(new Ne(`sources.${k}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new o.f(new Ne(`sources.${k}`,null,'missing required property "canvas"'))),this.options=v,this.animate=void 0===v.animate||v.animate}async load(){this._loaded=true,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new o.f(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=true,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=false)},this._finishLoading())}getCanvas(){return this.canvas}onAdd(k){this.map=k,this.load(),this.canvas&&this.animate&&this.play()}onRemove(k){this.pause()}prepare(){let k=false;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,k=true),this.canvas.height!==this.height&&(this.height=this.canvas.height,k=true),this._hasInvalidDimensions())return;if(0===Object.keys(this.tiles).length)return;const v=this.map.painter.context;this.texture?!k&&!this._playing||this.texture instanceof o.co||this.texture.update(this.canvas,{premultiply:true}):this.texture=new o.T(v,this.canvas,v.gl.RGBA8,{premultiply:true}),this._prepareData(v)}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const k of[this.canvas.width,this.canvas.height])if(isNaN(k)||k<=0)return true;return false}},custom:class extends o.E{constructor(k,v,E,D){super(),this.id=k,this.type="custom",this._dataType="raster",this._dispatcher=E,this._implementation=v,this.setEventedParent(D),this.scheme="xyz",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this._loaded=false,this.roundZoom=true,this._implementation||this.fire(new o.f(new Error(`Missing implementation for ${this.id} custom source`))),this._implementation.loadTile||this.fire(new o.f(new Error(`Missing loadTile implementation for ${this.id} custom source`))),this._implementation.bounds&&(this.tileBounds=new o.cf(this._implementation.bounds,this.minzoom,this.maxzoom));const V=v;V.update=this._update.bind(this),V.clearTiles=this._clearTiles.bind(this),V.coveringTiles=this._coveringTiles.bind(this),Object.assign(this,o.cb(v,["dataType","scheme","minzoom","maxzoom","tileSize","attribution","minTileCacheSize","maxTileCacheSize"]))}serialize(){return o.cb(this,["type","scheme","minzoom","maxzoom","tileSize","attribution"])}load(){this._loaded=true,this.fire(new o.h("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new o.h("data",{dataType:"source",sourceDataType:"content"}))}loaded(){return this._loaded}onAdd(k){this.map=k,this._loaded=false,this.fire(new o.h("dataloading",{dataType:"source"})),this._implementation.onAdd&&this._implementation.onAdd(k),this.load()}onRemove(k){this._implementation.onRemove&&this._implementation.onRemove(k)}hasTile(k){if(this._implementation.hasTile){const{x:v,y:E,z:D}=k.canonical;return this._implementation.hasTile({x:v,y:E,z:D})}return!this.tileBounds||this.tileBounds.contains(k.canonical)}async loadTile(k,v){const{x:E,y:D,z:V}=k.tileID.canonical,Y=new AbortController;k.request=Y;try{const Z=await this._implementation.loadTile({x:E,y:D,z:V},{signal:Y.signal});if(delete k.request,k.aborted)return k.state="unloaded",v(null);if(void 0===Z)return k.state="errored",v(null);if(null===Z)return this.loadTileData(k,{width:this.tileSize,height:this.tileSize,data:null}),k.state="loaded",v(null);if(!function(ne){return ne instanceof ImageData||ne instanceof HTMLCanvasElement||ne instanceof ImageBitmap||ne instanceof HTMLImageElement}(Z))return k.state="errored",v(new Error(`Can't infer data type for ${this.id}, only raster data supported at the moment`));this.loadTileData(k,Z),k.state="loaded",v(null)}catch(Z){if(Y.signal.aborted)return;k.state="errored",v(Z)}}loadTileData(k,v){k.setTexture(v,this.map.painter)}unloadTile(k,v){if(k.texture&&k.texture instanceof o.T?(k.destroy(false),k.texture&&k.texture instanceof o.T&&this.map.painter.saveTileTexture(k.texture)):k.destroy(),this._implementation.unloadTile){const{x:E,y:D,z:V}=k.tileID.canonical;this._implementation.unloadTile({x:E,y:D,z:V})}v&&v()}abortTile(k,v){k.request&&(k.request.abort(),delete k.request),v&&v()}hasTransition(){return false}_coveringTiles(){return this.map.transform.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,roundZoom:this.roundZoom}).map(k=>({x:k.canonical.x,y:k.canonical.y,z:k.canonical.z}))}_clearTiles(){const k=o.m(this.id,this.scope);this.map.style.clearSource(k)}_update(){this.fire(new o.h("data",{dataType:"source",sourceDataType:"content"}))}}},c7=function(k,v,E,D){const V=k2(v.type);if(!V)throw new Error(`Unknown source type "${v.type}"`);const Y=new V(k,v,E,D);if(Y.id!==k)throw new Error(`Expected Source id to be ${k} instead of ${Y.id}`);return o.aV(["load","abort","unload","serialize","prepare"],Y),Y},k2=function(k){return Object.hasOwn(mp,k)?mp[k]:void 0};function ly([k,v],E,D,{scaled:V=true}={}){const{tileSize:Y,buffer:Z}=D,{x:ne,y:le,z:fe}=E;if(!isFinite(ne)||!isFinite(le)||!isFinite(fe))throw new Error("Invalid MRT header");const me=2**fe,Pe=me*o.a7(k),Re=me*o.a8(v);return function([Ke,ot],at,{scaled:xt=true}={}){if(!at)throw new Error("bandView is undefined");const{data:vt,tileSize:It,buffer:jt,offset:Zt,scale:kn,dimension:cn}=at;if(Ke<-jt||Ke>It+jt||ot<-jt||ot>It+jt)throw new Error(`Point (${Ke}, ${ot}) out of bounds for tileSize=${It}, buffer=${jt}`);const hn=(ot+jt)*(It+2*jt)+(Ke+jt);if(4294967295===new Uint32Array(vt.buffer)[hn])return null;let xn=[];xn=xt?[]:new(0,at.data.constructor)(cn);for(let wn=0;wn{try{const le=D.getHeaderLength(Z);if(le>v)return void(this.request=this.fetchHeader(le,E));D.parseHeader(Z),this._isHeaderLoaded=true;let fe=0;for(const me of Object.values(D.layers))fe=Math.max(fe,me.dataIndex.at(-1).lastByte);Z.byteLength>=fe&&(this.entireBuffer=Z),E(null,this.entireBuffer||Z,ne)}catch(le){E(le)}}).catch(Z=>{Y.signal.aborted||E(Z)}),this.request}fetchBandForRender(v,E,D,V){this.fetchBand(v,E,D,Y=>{if(Y)return void V(Y);this.updateTextureDescriptor(v,E,D);const Z=this.textureDescriptorPerLayer.get(E);V(null,Z?Z.img:null)})}fetchBand(v,E,D,V){const Y=this._mrt;if(!this._isHeaderLoaded||!Y)return void V(new Error("Tile header is not ready"));const Z=this.actor;if(!Z)return void V(new Error("Can't fetch tile band without an actor"));let ne;const le=o.m(String(D),o.m(this.tileID.key,v));let fe=this._taskQueue.get(le);fe?fe.add(V):(fe=new Set,fe.add(V),this._taskQueue.set(le,fe));const me=(ot,at)=>{ne.complete(ot,at),ot?V(ot):(fe.forEach(xt=>xt(null,at)),this._taskQueue.delete(le))},Pe=(ot,at)=>{if(ot)return V(ot);let xt,vt=false;if(null!==E){const jt=this._workQueuePerLayer.get(E)||[];jt.push(()=>{vt=true,xt&&xt.abort(),ne.cancel()}),this._workQueuePerLayer.has(E)||this._workQueuePerLayer.set(E,jt)}const It=()=>{vt||(xt=Z.sendCancelable("decodeRasterArray",{type:"raster-array",source:this.source,scope:this.scope,tileID:this.tileID,uid:this.uid,buffer:at,task:ne},{},me))};void 0!==this.workerReady?this.workerReady.then(It).catch(jt=>V(jt)):It()};let Re;try{Re=Y.getLayer(v)}catch(ot){if("reloading"===this.state)return;throw ot}if(!Re)return void V(new Error(`Unknown sourceLayer "${v}"`));if(Re.hasDataForBand(D))return fe.forEach(ot=>ot(null,null)),void this._taskQueue.delete(le);const Ke=Re.getDataRange([D]);if(ne=Y.createDecodingTask(Ke),!ne||ne.tasks.length)if(null!==E&&this.flushQueues(E),this.entireBuffer)Pe(null,this.entireBuffer.slice(Ke.firstByte,Ke.lastByte+1));else{const ot={...this.requestParams,headers:{Range:`bytes=${Ke.firstByte}-${Ke.lastByte}`}},at=new AbortController;if(o.cC(ot,at.signal).then(({data:xt})=>Pe(null,xt)).catch(xt=>{at.signal.aborted||Pe(xt)}),null!==E){const xt=this._fetchQueuePerLayer.get(E)||[];xt.push(()=>{at.abort(),ne.cancel()}),this._fetchQueuePerLayer.has(E)||this._fetchQueuePerLayer.set(E,xt)}}}updateNeeded(v,E){return(!this.textureDescriptorPerLayer.get(v)||this.textureDescriptorPerLayer.get(v).band!==E||this.refreshedUponExpiration)&&"errored"!==this.state}updateTextureDescriptor(v,E,D){if(!this._mrt)return;const V=this._mrt.getLayer(v);if(!V||!V.hasBand(D)||!V.hasDataForBand(D))return;const{bytes:Y,tileSize:Z,buffer:ne,offset:le,scale:fe}=V.getBandView(D),me=Z+2*ne,Pe=new o.b({width:me,height:me},Y),Re=this.texturePerLayer.get(E);Re&&Re instanceof o.T&&Re.update(Pe,{premultiply:false}),this.textureDescriptorPerLayer.set(E,{layer:v,band:D,img:Pe,buffer:ne,offset:le,tileSize:Z,format:V.pixelFormat,mix:[fe,256*fe,65536*fe,16777216*fe]})}destroy(v=false){if(super.destroy(v),delete this._mrt,!v)for(const E of this.texturePerLayer.values())E&&E instanceof o.T&&E.destroy();this.texturePerLayer.clear(),this.textureDescriptorPerLayer.clear(),this.fbo&&(this.fbo.destroy(),delete this.fbo),delete this.request,delete this.requestParams,this._isHeaderLoaded=false}}fT=(k,v,E,D,V)=>new Qm(k,v,E,D,V);const eg={RasterArrayTileSource:class extends VF{get partial(){return!this.map.style.imageManager.hasImageProviderForSource(this.id,this.scope)}constructor(k,v,E,D){super(k,v,E,D),this.type="raster-array",this.maxzoom=22,this._loadTilePending={},this._loadTileLoaded={},this._options={type:"raster-array",...v}}triggerRepaint(k){const v=this.map.painter._terrain,E=this.map.style.getSourceCache(this.id);v&&v.enabled&&E&&v._clearRenderCacheForTile(E.id,k.tileID),this.map.triggerRepaint()}async loadTile(k,v){const E=this.map._requestManager.normalizeTileURL(k.tileID.canonical.url(this.tiles,this.scheme),false,this.tileSize);k.source=this.id,k.scope=this.scope,void 0===this._workerReady&&(this._workerReady=this.dispatcher.send("ensureRasterArraySource",void 0).then(()=>{}),this._workerReady.catch(()=>{})),k.workerReady=this._workerReady,k.actor||(k.actor=this.dispatcher.getActor());const D=new AbortController;k.request=D;const V=(Y,Z,ne)=>{if(delete k.request,k.aborted)return v(null);if(Y)return k.state="errored",v(Y);if(this.map._refreshExpiredTiles&&Z&&k.setExpiryData(o.ci(ne)),this.partial&&"expired"!==k.state)k.state="empty";else if(!this.partial){if(!Z)return v(null);k.state="loaded",k._isHeaderLoaded=true,k._mrt=Z}v(null)};try{const Y=await this.map._requestManager.transformRequest(E,o.R.Tile,D.signal);if(D.signal.aborted)return v(null);k.requestParams=Y;const Z={request:Y,uid:k.uid,tileID:k.tileID,type:this.type,source:this.id,scope:this.scope,partial:this.partial};k.request=this.partial?k.fetchHeader(void 0,(ne,le,fe)=>{V(ne,le,fe)}):k.actor.sendCancelable("loadTile",Z,{},(ne,le)=>ne?V(ne):le?void V(null,le.mrt,le.headers):V(null,null))}catch(Y){if(D.signal.aborted)return v(null);k.state="errored",v(Y)}}abortTile(k){k.request&&(k.request.abort(),delete k.request),k.actor&&k.actor.notify("abortTile",{uid:k.uid,type:this.type,source:this.id,scope:this.scope})}unloadTile(k,v){const E=k.texturePerLayer;if(k.flushAllQueues(),E.size){k.destroy(false);for(const D of E.values())this.map.painter.saveTileTexture(D)}else k.destroy()}prepareTile(k,v,E,D){k._isHeaderLoaded&&("empty"!==k.state&&(k.state="reloading"),k.fetchBandForRender(v,E,D,(V,Y)=>{V?(k.state="errored",this.fire(new o.f(V))):Y&&(k._isHeaderLoaded=true,k.setTexturePerLayer(E,Y,this.map.painter),k.state="loaded"),this.triggerRepaint(k)}))}getInitialBand(k){if(!this.rasterLayers)return 0;const v=this.rasterLayers.find(({id:V})=>V===k),E=v&&v.fields,D=E&&E.bands&&E.bands;return D?D[0]:0}getTextureDescriptor(k,v,E){if(!k)return;const D=v.sourceLayer||this.rasterLayerIds&&this.rasterLayerIds[0];if(!D)return;let V=null;v instanceof o.cx?V=v.paint.get("raster-array-band"):v instanceof o.cy&&(V=v.paint.get("raster-particle-array-band"));const Y=V||this.getInitialBand(D);if(null!=Y)if(k.textureDescriptorPerLayer.get(v.id)){if(!k.updateNeeded(v.id,Y)||E)return{...k.textureDescriptorPerLayer.get(v.id),texture:k.texturePerLayer.get(v.id)}}else this.prepareTile(k,D,v.id,Y)}getImages(k,v){const E=new Map;for(const D of k)for(const V of v){const[Y,Z]=V.split("/"),ne=D.getLayer(Y);if(!ne)continue;if(!ne.hasBand(Z)||!ne.hasDataForBand(Z))continue;const{bytes:le,tileSize:fe,buffer:me}=ne.getBandView(Z),Pe=fe+2*me,Re={data:new o.b({width:Pe,height:Pe},le),pixelRatio:2,sdf:false,usvg:false,version:0};E.set(V,Re)}return E}queryRasterArrayValueByBandId(k,v,E){const D=v._mrt;return new Promise(V=>{const Y={},Z=new Set;for(const[ne,le]of Object.entries(D.layers)){if(E.layerName&&ne!==E.layerName)continue;const fe={};Y[ne]=fe;for(const{bands:me}of le.dataIndex)for(const Pe of me)E.bands&&!E.bands.includes(Pe)||(Z.add(o.m(ne,Pe)),v.fetchBand(ne,null,Pe,Re=>{o.e.frame(()=>{fe[Pe]=Re?null:ly([k.lng,k.lat],D,le.getBandView(Pe)),Z.delete(o.m(ne,Pe)),0===Z.size&&V(Y)})}))}0===Z.size&&V(Y)})}_loadTileForQuery(k){if(this._loadTileLoaded[k.uid])return Promise.resolve(k._mrt);if(k.uid in this._loadTilePending)return this._loadTilePending[k.uid];const v=this._fetchTileForQuery(k);return this._loadTilePending[k.uid]=v,v}async _fetchTileForQuery(k){const v=this.map._requestManager.normalizeTileURL(k.tileID.canonical.url(this.tiles,this.scheme),false,this.tileSize);try{const E={request:await this.map._requestManager.transformRequest(v,o.R.Tile),uid:k.uid,tileID:k.tileID,type:this.type,source:this.id,scope:this.scope,partial:false},D=await k.actor.send("loadTile",E);if(!D)return null;const V=D.mrt;return this.map._refreshExpiredTiles&&k.setExpiryData(o.ci(D.headers)),k._mrt=V,k._isHeaderLoaded=true,k.state="loaded",this._loadTileLoaded[k.uid]=true,V}finally{delete this._loadTilePending[k.uid]}}async queryRasterArrayValueByAllBands(k,v,E){return await this._loadTileForQuery(v)?this.queryRasterArrayValueByBandId(k,v,E):null}queryRasterArrayValue(k,v){const E=o.cz.convert(k),D=this.findLoadedParent(E);return D&&D._mrt?v.bands||!this.partial?this.queryRasterArrayValueByBandId(E,D,v):this.queryRasterArrayValueByAllBands(E,D,v):Promise.resolve(null)}findLoadedParent(k){const v=o.bS.fromLngLat(k,this.map.transform.tileSize),E=this.maxzoom+1,D=1<=D||Z<0||Z>=D)return null;const ne=this.map.style.getSourceCache(this.id),le=new o.bP(E,V,E,Y,Z);return ne.findLoadedParent(le,this.minzoom)}}},Ju=eg,hT={model:()=>aa().then(()=>bo.ModelSource),"batched-model":()=>aa().then(()=>bo.Tiled3dModelSource),"raster-array":()=>async function(){return Promise.resolve()}().then(()=>Ju.RasterArrayTileSource)};class gOe extends o.E{constructor(v,E,D,V){super(),this.id=v,this.type=E.type,this._options=E,this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.setEventedParent(V)}hasTransition(){return false}loaded(){return false}onAdd(v){}onRemove(v){}loadTile(v,E){}serialize(){return this._options}}function Wae(k,v,E=""){return`${E}:${v.id||""}:${v.layer.id}:${function(D){if("layerId"in D)return`layer:${D.layerId}`;{const{featuresetId:V,importId:Y}=D;return`featureset:${V}${Y?`:import:${Y}`:""}`}}(k.target)}`}function Yae(k,v,E,D=""){if(k.uniqueFeatureID){const V=Wae(k,v,D);if(E.has(V))return true;E.add(V)}return false}function qae(k,v,E,D,V=false,Y=void 0){const Z=v.sourceCache.transform,ne=v.sourceCache.tilesIn(k,v.has3DLayers,V);ne.sort(MY);const le=[];for(const fe of ne){const me=fe.tile.queryRenderedFeatures(v,fe,E,D,Z,V,Y);Object.keys(me).length&&le.push({wrappedTileID:fe.tile.tileID.wrapped().key,queryResults:me})}for(const fe in v.layers){const me=v.layers[fe];if(me.styleLayer){const Pe=me.styleLayer.queryRenderedFeatures(k,v.sourceCache,D);Object.keys(Pe).length&&le.push({wrappedTileID:0,queryResults:Pe})}}return 0===le.length?{}:function(fe){const me={},Pe={};for(const Re of fe){const Ke=Re.queryResults,ot=Re.wrappedTileID,at=Pe[ot]=Pe[ot]||{};for(const xt in Ke){const vt=Ke[xt],It=at[xt]=at[xt]||{},jt=me[xt]=me[xt]||[];for(const Zt of vt)It[Zt.featureIndex]||(It[Zt.featureIndex]=true,jt.push(Zt))}}return me}(le)}function yOe(k,v,E,D,V,Y){const Z={},ne=D.queryRenderedSymbols(k),le=[];for(const fe of Object.keys(ne).map(Number))le.push(V[fe]);le.sort(MY);for(const fe of le){const me=fe.featureIndex.lookupSymbolFeatures(ne[fe.bucketInstanceId],fe.bucketIndex,fe.sourceLayerIndex,v,E,Y);for(const Pe in me){const Re=Z[Pe]=Z[Pe]||[],Ke=me[Pe];Ke.sort((ot,at)=>{const xt=fe.featureSortOrder;if(xt){const vt=xt.indexOf(ot.featureIndex);return xt.indexOf(at.featureIndex)-vt}return at.featureIndex-ot.featureIndex});for(const ot of Ke)Re.push(ot)}}return Z}function IY(k,v){const E=k.getRenderableIds().map(Y=>k.getTileByID(Y)),D=[],V={};for(let Y=0;Y0:"building"===D.type?V=!D.isHidden(v)&&D.paint.get("building-opacity")>0:"model"===D.type&&(V=!D.isHidden(v)&&D.paint.get("model-opacity").constantOr(1)>0),this.layersGotHidden=this.layersGotHidden||!V&&E.visible,E.visible=V}}updateZOffset(v,E){this.currentBuildingBuckets=[];for(const V of this.layers){const Y=V.layer,Z=this.style.getLayerSourceCache(Y);let ne=1;"fill-extrusion"===Y.type?ne=V.visible?Y.paint.get("fill-extrusion-vertical-scale"):0:"building"===Y.type&&(ne=V.visible?Y.paint.get("building-vertical-scale"):0);let le=Z?Z.getTile(E):null;if(!le&&Z)for(const fe in Z._tiles){const me=Z._tiles[fe];if(E.canonical.isChildOf(me.tileID.canonical)){le=me;break}}this.currentBuildingBuckets.push({bucket:le?le.getBucket(Y):null,tileID:le?le.tileID:E,verticalScale:ne})}v.hasAnyZOffset=false;let D=false;for(let V=0;V{Z in V&&(Y[Z]=V[Z])}),E}function $F(k){k=k.slice();const v=Object.create(null);for(const E of k)v[E.id]=E;for(let E=0;ED.collisionGroupID===E}}return this.collisionGroups[v]}}function JP(k,v,E,D,V){const{horizontalAlign:Y,verticalAlign:Z}=o.cM(k),ne=-(Y-.5)*v,le=-(Z-.5)*E,fe=o.cN(k,D);return new o.P(ne+fe[0]*V,le+fe[1]*V)}function oA(k,v,E,D,V){const Y=new o.P(k,v);return E&&Y._rotate(D?V:-V),Y}function HF(k,v,E,D){const{leftJustifiedTextSymbolIndex:V,centerJustifiedTextSymbolIndex:Y,rightJustifiedTextSymbolIndex:Z,verticalPlacedTextSymbolIndex:ne,crossTileID:le}=E,fe=o.cO(v),me=D===o.cL.vertical?ne:"left"===fe?V:"center"===fe?Y:"right"===fe?Z:-1;V>=0&&(k.text.placedSymbolArray.get(V).crossTileID=me>=0&&V!==me?0:le),Y>=0&&(k.text.placedSymbolArray.get(Y).crossTileID=me>=0&&Y!==me?0:le),Z>=0&&(k.text.placedSymbolArray.get(Z).crossTileID=me>=0&&Z!==me?0:le),ne>=0&&(k.text.placedSymbolArray.get(ne).crossTileID=me>=0&&ne!==me?0:le)}function WF(k,v,E){const D=v===o.cL.horizontal||v===o.cL.horizontalOnly?v:0,V=v===o.cL.vertical?v:0,{leftJustifiedTextSymbolIndex:Y,centerJustifiedTextSymbolIndex:Z,rightJustifiedTextSymbolIndex:ne,verticalPlacedTextSymbolIndex:le}=E,fe=k.text.placedSymbolArray;Y>=0&&(fe.get(Y).placedOrientation=D),Z>=0&&(fe.get(Z).placedOrientation=D),ne>=0&&(fe.get(ne).placedOrientation=D),le>=0&&(fe.get(le).placedOrientation=V)}class u7{constructor(v,E,D,V,Y,Z,ne,le){this.transform=v.clone(),this.projection=v.projection.name,this.algorithm=V,this.collisionIndex=this.algorithm.createCollisionDetector(this.transform,Z,le),this.buildingIndex=ne,this.frontCutoffStart=0,this.placements={},this.opacities={},this.variableOffsets={},this.stale=false,this.commitTime=0,this.fadeDuration=E,this.retainedQueryData={},this.collisionGroups=new iA(D),this.collisionCircleArrays={},this.prevPlacement=Y,Y&&(Y.prevPlacement=void 0),this.placedOrientations={},this.lastReplacementSourceUpdateTime=0}getBucketParts(v,E,D,V,Y=1){const Z=D.getBucket(E),ne=D.latestFeatureIndex;if(!Z||!ne||E.fqid!==Z.layerIds[0])return;const le=Z.layers[0].layout,fe=Z.layers[0].paint,me=D.collisionBoxArray,Pe=Math.pow(2,this.transform.zoom-D.tileID.overscaledZ),Re=D.tileSize/o.a2,Ke=D.tileID.toUnwrapped();this.transform.setProjection(Z.projection);const ot=(at=D.tileID,xt=Z.getProjection(),vt=this.transform,xt.name===this.projection?vt.calculateProjMatrix(at.toUnwrapped()):jn(vt,xt,at));var at,xt,vt;const It="map"===le.get("text-pitch-alignment"),jt="map"===le.get("text-rotation-alignment");E.compileFilter(E.options);const Zt=E.dynamicFilter(),kn=E.dynamicFilterNeedsFeature(),cn=E.dynamicFilterNeedsGeometry(),hn=this.transform.calculatePixelsToTileUnitsMatrix(D),xn=o.cE(ot,D.tileID.canonical,It,jt,this.transform,Z.getProjection(),hn);let wn=null;const Bn=Z.getProjection().createInversionMatrix(this.transform,D.tileID.canonical);if(It){const mi=o.cF(ot,D.tileID.canonical,It,jt,this.transform,Z.getProjection(),hn);wn=o.X([],this.transform.labelPlaneMatrix,mi)}let Kn=null;Zt&&D.latestFeatureIndex&&(Kn={unwrappedTileID:Ke,dynamicFilter:Zt,dynamicFilterNeedsFeature:kn,needGeometry:cn}),this.retainedQueryData[Z.bucketInstanceId]=new DY(Z.bucketInstanceId,ne,Z.sourceLayerIndex,Z.index,D.tileID);const[Wn,Yn]=Z.layers[0].layout.get("text-size-scale-range"),Vn=o.b0(Y,Wn,Yn),[Zr,Qn]=le.get("icon-size-scale-range"),kr=o.b0(Y,Zr,Qn),Vr={bucket:Z,layout:le,paint:fe,posMatrix:ot,invMatrix:Bn,mercatorCenter:[o.a7(this.transform.center.lng),o.a8(this.transform.center.lat)],textLabelPlaneMatrix:xn,labelToScreenMatrix:wn,clippingData:Kn,scale:Pe,textPixelRatio:Re,holdingForFade:D.holdingForFade(),collisionBoxArray:me,partiallyEvaluatedTextSize:o.cG(Z.textSizeData,this.transform.zoom,Vn),partiallyEvaluatedIconSize:o.cG(Z.iconSizeData,this.transform.zoom,kr),collisionGroup:this.collisionGroups.get(Z.sourceID),latestFeatureIndex:D.latestFeatureIndex};if(V)for(const mi of Z.sortKeyRanges){const{sortKey:si,symbolInstanceStart:Kr,symbolInstanceEnd:qi}=mi;v.push({sortKey:si,symbolInstanceStart:Kr,symbolInstanceEnd:qi,parameters:Vr})}else v.push({symbolInstanceStart:0,symbolInstanceEnd:Z.symbolInstances.length,parameters:Vr})}placeLayerBucketPart(v,E,D,V=1){this.algorithm.placeLayerBucketPart(this,v,E,D,V)}commit(v){this.commitTime=v,this.zoomAtLastRecencyCheck=this.transform.zoom;const E=this.prevPlacement;let D=false;this.prevZoomAdjustment=E?E.zoomAdjustment(this.transform.zoom):0;const V=E?E.symbolFadeChange(v):1,Y=E?E.opacities:{},Z=E?E.variableOffsets:{},ne=E?E.placedOrientations:{};for(const le in this.placements){const fe=this.placements[le],me=Y[le];me?(this.opacities[le]=new ZP(me,V,fe.text,fe.icon,null,fe.clipped),D=D||fe.text!==me.text.placed||fe.icon!==me.icon.placed):(this.opacities[le]=new ZP(null,V,fe.text,fe.icon,fe.skipFade,fe.clipped),D=D||fe.text||fe.icon)}for(const le in Y){const fe=Y[le];if(!this.opacities[le]){const me=new ZP(fe,V,false,false);me.isHidden()||(this.opacities[le]=me,D=D||fe.text.placed||fe.icon.placed)}}for(const le in Z)this.variableOffsets[le]||!this.opacities[le]||this.opacities[le].isHidden()||(this.variableOffsets[le]=Z[le]);for(const le in ne)this.placedOrientations[le]||!this.opacities[le]||this.opacities[le].isHidden()||(this.placedOrientations[le]=ne[le]);D?this.lastPlacementChangeTime=v:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=E?E.lastPlacementChangeTime:v)}updateLayerOpacities(v,E,D,V,Y=false,Z=1){V&&(this.lastReplacementSourceUpdateTime=V.updateTime);const ne=new Set;for(const le of E){const fe=le.getBucket(v);if(fe&&le.latestFeatureIndex&&v.fqid===fe.layerIds[0]&&(this.updateBucketOpacities(fe,ne,le,le.collisionBoxArray,D,V,le.tileID,v.scope),"offset"===fe.elevationType&&this.buildingIndex&&this.buildingIndex.updateZOffset(fe,le.tileID),"road"===fe.elevationType&&fe.hdExt&&fe.hdExt.updateRoadElevation(fe,le.tileID.canonical),fe.updateZOffset(),Y&&le.collisionBoxArray)){const me=fe.layers[0].layout,[Pe,Re]=me.get("text-size-scale-range"),[Ke,ot]=me.get("icon-size-scale-range"),at=o.b0(Z,Pe,Re),xt=o.b0(Z,Ke,ot);fe.updateCollisionDebugBuffers(this.transform.zoom,le.collisionBoxArray,at,xt)}}}updateBucketOpacities(v,E,D,V,Y,Z,ne,le){v.hasTextData()&&v.text.opacityVertexArray.clear(),v.hasIconData()&&v.icon.opacityVertexArray.clear(),v.hasIconCollisionBoxData()&&v.iconCollisionBox.collisionVertexArray.clear(),v.hasTextCollisionBoxData()&&v.textCollisionBox.collisionVertexArray.clear();const fe=v.layers[0].layout,me=v.layers[0].paint,Pe=!!v.layers[0].dynamicFilter(),Re=new ZP(null,0,false,false,true),Ke=fe.get("text-allow-overlap"),ot=fe.get("icon-allow-overlap"),at=fe.get("text-variable-anchor"),xt="map"===fe.get("text-rotation-alignment"),vt="map"===fe.get("text-pitch-alignment"),It=me.get("symbol-z-offset"),jt="sea"===fe.get("symbol-elevation-reference"),Zt=!It.isConstant(),kn=new ZP(null,0,Ke&&(ot||!v.hasIconData()||fe.get("icon-optional")),ot&&(Ke||!v.hasTextData()||fe.get("text-optional")),true);!v.collisionArrays&&V&&(v.hasIconCollisionBoxData()||v.hasTextCollisionBoxData())&&v.deserializeCollisionBoxes(V);const cn=(xn,wn,Bn)=>{for(let Kn=0;Kn0||Kn>0,qi=Yn>0,Wr=this.placedOrientations[Wn],Lr=Wr===o.cL.vertical,ii=Wr===o.cL.horizontal||Wr===o.cL.horizontalOnly;!Kr&&!qi||si.isHidden()||hn++;let Di=false;if((Kr||qi)&&Z)for(const ci of v.activeReplacements){if(o.cH(ci,Y,o.cI.Symbol,le))continue;if(ci.min.x>Vn||Vn>ci.max.x||ci.min.y>Zr||Zr>ci.max.y)continue;const Ri=o.cJ(Vn,Zr,ne.canonical,ci.footprintTileId.canonical);if(Di=o.cK(Ri,ci.footprint),Di)break}if(Di&&this.collisionIndex.markSymbolAsClipped(v.bucketInstanceId,wn.featureIndex),Kr){const ci=Di?R2:NY(si.text);cn(v.text,Bn,Lr?R2:ci),cn(v.text,Kn,ii?R2:ci);const Ri=si.text.isHidden(),{leftJustifiedTextSymbolIndex:ji,centerJustifiedTextSymbolIndex:Go,rightJustifiedTextSymbolIndex:po,verticalPlacedTextSymbolIndex:Oa}=wn,Js=v.text.placedSymbolArray,ws=Ri||Lr?1:0;ji>=0&&(Js.get(ji).hidden=ws),Go>=0&&(Js.get(Go).hidden=ws),po>=0&&(Js.get(po).hidden=ws),Oa>=0&&(Js.get(Oa).hidden=Ri||ii?1:0);const ta=this.variableOffsets[Wn];ta&&HF(v,ta.anchor,wn,Wr);const xo=this.placedOrientations[Wn];xo&&(HF(v,"left",wn,xo),WF(v,xo,wn))}if(qi){const ci=Di?R2:NY(si.icon),{placedIconSymbolIndex:Ri,verticalPlacedIconSymbolIndex:ji}=wn,Go=v.icon.placedSymbolArray,po=si.icon.isHidden()?1:0;Ri>=0&&(cn(v.icon,Yn,Lr?R2:ci),Go.get(Ri).hidden=po),ji>=0&&(cn(v.icon,wn.numVerticalIconVertices,ii?R2:ci),Go.get(ji).hidden=po)}if(v.hasIconCollisionBoxData()||v.hasTextCollisionBoxData()){const ci=v.collisionArrays[xn];if(ci){let Ri=new o.P(0,0),ji=true;if(ci.textBox||ci.verticalTextBox){if(at){const po=this.variableOffsets[Wn];po?(Ri=JP(po.anchor,po.width,po.height,po.textOffset,po.textScale),xt&&Ri._rotate(vt?this.transform.angle:-this.transform.angle)):ji=false}Pe&&(ji=!si.clipped),ci.textBox&&Ab(v.textCollisionBox.collisionVertexArray,si.text.placed,!ji||Lr,Vr,jt,Ri.x,Ri.y),ci.verticalTextBox&&Ab(v.textCollisionBox.collisionVertexArray,si.text.placed,!ji||ii,Vr,jt,Ri.x,Ri.y)}const Go=ji&&Boolean(!ii&&ci.verticalIconBox);ci.iconBox&&Ab(v.iconCollisionBox.collisionVertexArray,si.icon.placed,Go,Vr,jt,wn.hasIconTextFit?Ri.x:0,wn.hasIconTextFit?Ri.y:0),ci.verticalIconBox&&Ab(v.iconCollisionBox.collisionVertexArray,si.icon.placed,!Go,Vr,jt,wn.hasIconTextFit?Ri.x:0,wn.hasIconTextFit?Ri.y:0)}}}if(v.fullyClipped=0===hn,v.sortFeatures(this.transform.angle),this.retainedQueryData[v.bucketInstanceId]&&(this.retainedQueryData[v.bucketInstanceId].featureSortOrder=v.featureSortOrder),v.hasTextData()&&v.text.opacityVertexBuffer&&v.text.opacityVertexBuffer.updateData(v.text.opacityVertexArray),v.hasIconData()&&v.icon.opacityVertexBuffer&&v.icon.opacityVertexBuffer.updateData(v.icon.opacityVertexArray),v.hasIconCollisionBoxData()&&v.iconCollisionBox.collisionVertexBuffer&&v.iconCollisionBox.collisionVertexBuffer.updateData(v.iconCollisionBox.collisionVertexArray),v.hasTextCollisionBoxData()&&v.textCollisionBox.collisionVertexBuffer&&v.textCollisionBox.collisionVertexBuffer.updateData(v.textCollisionBox.collisionVertexArray),v.bucketInstanceId in this.collisionCircleArrays){const xn=this.collisionCircleArrays[v.bucketInstanceId];v.placementInvProjMatrix=xn.invProjMatrix,v.placementViewportMatrix=xn.viewportMatrix,v.collisionCircleArray=xn.circles,delete this.collisionCircleArrays[v.bucketInstanceId]}}symbolFadeChange(v){return 0===this.fadeDuration?1:(v-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(v){return Math.max(0,(this.transform.zoom-v)/1.5)}hasTransitions(v){return v-this.lastPlacementChangeTimev}isStale(){return this.stale}setStale(){this.stale=true}}function Ab(k,v,E,D,V,Y,Z){k.emplaceBack(v?1:0,E?1:0,Y||0,Z||0,D,V?1:0),k.emplaceBack(v?1:0,E?1:0,Y||0,Z||0,D,V?1:0),k.emplaceBack(v?1:0,E?1:0,Y||0,Z||0,D,V?1:0),k.emplaceBack(v?1:0,E?1:0,Y||0,Z||0,D,V?1:0)}const FY=Math.pow(2,25),aA=Math.pow(2,24),d7=Math.pow(2,17),QP=Math.pow(2,16),f7=Math.pow(2,9),bOe=Math.pow(2,8),Kae=Math.pow(2,1);function NY(k){if(0===k.opacity&&!k.placed)return 0;if(1===k.opacity&&k.placed)return 4294967295;const v=k.placed?1:0,E=Math.floor(127*k.opacity);return E*FY+v*aA+E*d7+v*QP+E*f7+v*bOe+E*Kae+v}const R2=0;class xOe{constructor(v,E){this.reset(v,E)}reset(v,E){this.points=v||[],this._distances=[0];for(let D=1;D0?(V-Z)/ne:0;return this.points[Y].mult(1-le).add(this.points[E].mult(le))}}const Dv=100;class Zae{constructor(v,E){this.gridRightBoundary=0,this.gridBottomBoundary=0,this.clippedSymbols=new Map,this.reset(v,E)}reset(v,E){const D=v.width+200,V=v.height+200;D!==this.gridRightBoundary||V!==this.gridBottomBoundary?(this.grid=new o.cP(D,V,25),this.ignoredGrid=new o.cP(D,V,25)):(this.grid.clear(),this.ignoredGrid.clear()),this.transform=v,this.fogState=E,this.pitchfactor=Math.cos(v._pitch)*v.cameraToCenterDistance,this.screenRightBoundary=v.width+Dv,this.screenBottomBoundary=v.height+Dv,this.gridRightBoundary=D,this.gridBottomBoundary=V,this.clippedSymbols.clear()}clearClippedSymbolsForBucket(v){this.clippedSymbols.delete(v)}markSymbolAsClipped(v,E){let D=this.clippedSymbols.get(v);D||(D=new Set,this.clippedSymbols.set(v,D)),D.add(E)}placeCollisionBox(v,E,D,V,Y,Z,ne,le,fe,me,Pe){let Re=D.projectedAnchorX,Ke=D.projectedAnchorY,ot=D.projectedAnchorZ;const at=D.tileAnchorX,xt=D.tileAnchorY,vt=D.elevation,It=D.tileID,jt=v.getProjection();if(vt&&It){const[Yn,Vn,Zr]=jt.upVector(It.canonical,D.tileAnchorX,D.tileAnchorY),Qn=jt.upVectorScale(It.canonical,this.transform.center.lat,this.transform.worldSize).metersToTile;Re+=Yn*vt*Qn,Ke+=Vn*vt*Qn,ot+=Zr*vt*Qn}const Zt="globe"===v.projection.name,kn="globe"===v.projection.name?o.S(this.transform.zoom):0;if(It&&Zt&&kn<1&&!Z){const Yn=1<0,jt),hn=fe*cn.perspectiveRatio,xn=(D.x1*E+ne.x-D.padding)*hn+cn.point.x,wn=(D.y1*E+ne.y-D.padding)*hn+cn.point.y,Bn=(D.x2*E+ne.x+D.padding)*hn+cn.point.x,Kn=(D.y2*E+ne.y+D.padding)*hn+cn.point.y,Wn=cn.perspectiveRatio<=.55||cn.occluded;return!this.isInsideGrid(xn,wn,Bn,Kn)||!le&&this.grid.hitTest(xn,wn,Bn,Kn,Pe)||Wn?{box:[],offscreen:false,occluded:cn.occluded}:{box:[xn,wn,Bn,Kn],offscreen:this.isOffscreen(xn,wn,Bn,Kn),occluded:false}}placeCollisionCircles(v,E,D,V,Y,Z,ne,le,fe,me,Pe,Re,Ke,ot,at,xt){const vt=[],It=this.transform.elevation,jt=v.getProjection(),Zt="road"===v.elevationType,kn=!!It||Zt,cn=o.cW.getAtTileOffsetFunc(xt,this.transform.center.lat,this.transform.worldSize,jt),hn=new o.P(D.tileAnchorX,D.tileAnchorY),xn=new o.P(D.tileAnchorX,D.tileAnchorY);let{x:wn,y:Bn,z:Kn}=jt.projectTilePoint(xn.x,xn.y,xt.canonical),Wn=null;if(kn){Wn=Zt&&v.hdExt?v.hdExt.makeRoadSymbolElevationParams(v,v.text,V,xt,cn,It,jt,this.transform.center.lat,this.transform.worldSize):{getElevation:cn,elevation:It,elevationFeature:null};const[Di,ci,Ri]=Wn.getElevation(hn,It,Wn.elevationFeature);wn+=Di,Bn+=ci,Kn+=Ri}const Yn="globe"===jt.name,Vn=this.projectAndGetPerspectiveRatio(le,wn,Bn,Kn,xt,Yn||!!It||this.transform.pitch>0,jt),{perspectiveRatio:Zr}=Vn,Qn=(Re?ne/Zr:ne*Zr)/o.d1,kr=o.cX(wn,Bn,Kn,fe),Vr=D.lineOffsetX*Qn,mi=D.lineOffsetY*Qn,si=o.au(v.layers[0].layout.get("text-max-angle")),Kr=Math.cos(si),qi=Vn.signedDistanceFromCamera>0?o.cY(Qn,Z,Vr,mi,Zt&&1===D.flipState,kr,xn,D,Y,fe,{},kn&&!Re?Wn:null,Re&&kn,jt,xt,Re,Kr):null;let Wr=false,Lr=false,ii=true;if(qi&&!Vn.occluded){const Di=.5*ot*Zr+at,ci=new o.P(-100,-100),Ri=new o.P(this.screenRightBoundary,this.screenBottomBoundary),ji=new xOe,{first:Go,last:po}=qi,Oa=Go.path.length;let Js=[];for(let xo=Oa-1;xo>=1;xo--)Js.push(Go.path[xo]);for(let xo=1;xo(kn&&!Yn&&(lc=Wn.getElevation($lxo[3]<=0)&&(Js=[]));let ta=[];if(Js.length>0){let xo=1/0,Qs=-1/0,lc=1/0,$l=-1/0;for(const la of Js)xo=Math.min(xo,la[0]),lc=Math.min(lc,la[1]),Qs=Math.max(Qs,la[0]),$l=Math.max($l,la[1]);Qs>=ci.x&&xo<=Ri.x&&$l>=ci.y&&lc<=Ri.y&&(ta=[Js.map(la=>new o.P(la[0],la[1]))],(xoRi.x||lcRi.y)&&(ta=o.cZ(ta,ci.x,ci.y,Ri.x,Ri.y)))}for(const xo of ta){ji.reset(xo,.25*Di);let Qs=0;Qs=ji.length<=.5*Di?1:Math.ceil(ji.paddedLength/ws)+1;for(let lc=0;lc0?(o.c7(le,le,v),this.fogState&&Y&&"globe"!==ne.name&&(fe=o.c_(this.fogState,E,D,V,Y.toUnwrapped(),this.transform)>o.d2)):o.c$(le,le,v);const me=le[3];return{point:new o.P((le[0]/me+1)/2*this.transform.width+Dv,(-le[1]/me+1)/2*this.transform.height+Dv),perspectiveRatio:Math.min(.5+this.transform.getCameraToCenterDistance(ne)/me*.5,1.5),signedDistanceFromCamera:me,occluded:Z&&le[2]>me||fe}}isOffscreen(v,E,D,V){return D=this.screenRightBoundary||Vthis.screenBottomBoundary}isInsideGrid(v,E,D,V){return D>=0&&v=0&&E2}placeLayerBucketPart(k,v,E,D,V=1){const{bucket:Y,layout:Z,paint:ne,posMatrix:le,textLabelPlaneMatrix:fe,labelToScreenMatrix:me,clippingData:Pe,textPixelRatio:Re,mercatorCenter:Ke,invMatrix:ot,holdingForFade:at,collisionBoxArray:xt,partiallyEvaluatedTextSize:vt,partiallyEvaluatedIconSize:It,collisionGroup:jt,latestFeatureIndex:Zt}=v.parameters,kn=Z.get("text-optional"),cn=Z.get("icon-optional"),hn=Z.get("text-allow-overlap"),xn=Z.get("icon-allow-overlap"),wn="map"===Z.get("text-rotation-alignment"),Bn="map"===Z.get("icon-rotation-alignment"),Kn="map"===Z.get("text-pitch-alignment"),Wn=ne.get("symbol-z-offset"),Yn="sea"===Z.get("symbol-elevation-reference"),Vn=Z.get("symbol-placement"),Zr=Z.get("text-variable-anchor"),Qn=wn&&"point"!==Vn,kr=Bn&&"point"!==Vn,Vr=Zr&&Y.hasTextData(),mi=Y.hasIconTextFit()&&Vr&&Y.hasIconData();k.transform.setProjection(Y.projection);const si=Vr||Qn,Kr=kr||mi;let qi=hn&&(xn||!Y.hasIconData()||cn),Wr=xn&&(hn||!Y.hasTextData()||kn);const Lr=!Wn.isConstant();!Y.collisionArrays&&xt&&Y.deserializeCollisionBoxes(xt);const ii=(ci,Ri,ji)=>{const{crossTileID:Go,numVerticalGlyphVertices:po}=ci;let Oa=null;if(Pe&&Pe.dynamicFilterNeedsFeature||Lr){const $s=k.retainedQueryData[Y.bucketInstanceId],dl=Zt.loadFeature({featureIndex:ci.featureIndex,bucketIndex:$s.bucketIndex,sourceLayerIndex:$s.sourceLayerIndex,layoutVertexArrayOffset:0}),Ha=dl.properties?dl.properties.worldview:null;if(Y.localizable&&Y.worldview&&"string"==typeof Ha)if("all"===Ha)dl.properties.$localized=true;else{if(!Ha.split(",").includes(Y.worldview))return;dl.properties.$localized=true,dl.properties.worldview=Y.worldview}Oa=Pe&&Pe.needGeometry?o.bw(dl,true):dl}if(Pe&&!(0,Pe.dynamicFilter)({zoom:k.transform.zoom,pitch:k.transform.pitch,worldview:Y.worldview},Oa,k.retainedQueryData[Y.bucketInstanceId].tileID.canonical,new o.P(ci.tileAnchorX,ci.tileAnchorY),k.transform.calculateDistanceTileData(Pe.unwrappedTileID)))return k.placements[Go]=new GF(false,false,false,true),void E.add(Go);const Js=Wn.evaluate(Oa,{});if((ci.zOffset||0)+(Js||0)>0&&k.frontCutoffStart>0){const $s=2*k.frontCutoffStart-1,dl=[ci.tileAnchorX,ci.tileAnchorY,0,1],Ha=o.c7(o.d3(),dl,le);if(Ha[1]/Ha[3]<$s)return k.placements[Go]=new GF(false,false,false,true),void E.add(Go)}if(E.has(Go))return;if(at)return void(k.placements[Go]=new GF(false,false,false));let ws=false,ta=false,xo=true,Qs=false,lc=false,$l=null,la={box:null,offscreen:null,occluded:null},cl={box:null},Fs=null,hs=null,au=null,su=0,ul=0,Es=0;ji.textFeatureIndex?su=ji.textFeatureIndex:ci.useRuntimeCollisionCircles&&(su=ci.featureIndex),ji.verticalTextFeatureIndex&&(ul=ji.verticalTextFeatureIndex);const Fc=$s=>{$s.tileID=k.retainedQueryData[Y.bucketInstanceId].tileID;const dl=k.transform.elevation;if("road"===Y.elevationType)$s.elevation=Yn?Js:Js+o.cW.getAtTileOffset($s.tileID,new o.P($s.tileAnchorX,$s.tileAnchorY),dl,null);else{const Ha=Y.hdExt?Y.hdExt.elevationFeatures[ci.elevationFeatureIndex]:void 0;$s.elevation=Yn?Js:Js+o.cW.getAtTileOffset($s.tileID,new o.P($s.tileAnchorX,$s.tileAnchorY),dl,Ha)}$s.elevation+=ci.zOffset},ff=ji.textBox;if(ff){Fc(ff);const $s=Ha=>{let Kc=o.cL.horizontal;if(Y.allowVerticalPlacement&&!Ha&&k.prevPlacement){const hf=k.prevPlacement.placedOrientations[Go];hf&&(k.placedOrientations[Go]=hf,Kc=hf,WF(Y,Kc,ci))}return Kc},dl=(Ha,Kc)=>{if(Y.allowVerticalPlacement&&po>0&&ji.verticalTextBox){for(const hf of Y.writingModes)if(hf===o.cL.vertical?(la=Kc(),cl=la):la=Ha(),la&&la.box&&la.box.length)break}else la=Ha()};if(Zr){let Ha=Zr;if(k.prevPlacement&&k.prevPlacement.variableOffsets[Go]){const Lo=k.prevPlacement.variableOffsets[Go];Ha.indexOf(Lo.anchor)>0&&(Ha=Ha.filter(Nc=>Nc!==Lo.anchor),Ha.unshift(Lo.anchor))}const Kc=(Lo,Nc,kh)=>{const ng=Y.getSymbolInstanceTextSize(vt,ci,k.transform.zoom,Ri),n1=(Lo.x2-Lo.x1)*ng+2*Lo.padding,Ls=(Lo.y2-Lo.y1)*ng+2*Lo.padding,am=ci.hasIconTextFit&&!xn?Nc:null;am&&Fc(am);let p0={box:[],offscreen:false,occluded:false};const vA=hn?2*Ha.length:Ha.length;for(let r1=0;r1=Ha.length,ci,Ri,Y,kh,am,vt,It);if(i1&&(p0=i1.placedGlyphBoxes,p0&&p0.box&&p0.box.length)){ws=true,$l=i1.shift;break}}return p0};dl(()=>Kc(ff,ji.iconBox,o.cL.horizontal),()=>{const Lo=ji.verticalTextBox;return Lo&&Fc(Lo),Y.allowVerticalPlacement&&!(la&&la.box&&la.box.length)&&po>0&&Lo?Kc(Lo,ji.verticalIconBox,o.cL.vertical):{box:null,offscreen:null,occluded:null}}),la&&(ws=la.box,xo=la.offscreen,Qs=la.occluded);const hf=$s(!(!la||!la.box));if(!ws&&k.prevPlacement){const Lo=k.prevPlacement.variableOffsets[Go];Lo&&(k.variableOffsets[Go]=Lo,HF(Y,Lo.anchor,ci,hf))}}else{const Ha=(Kc,hf)=>{const Lo=Y.getSymbolInstanceTextSize(vt,ci,k.transform.zoom,Ri),Nc=k.collisionIndex.placeCollisionBox(Y,Lo,Kc,Ke,ot,si,new o.P(0,0),hn,Re,le,jt.predicate);return Nc&&Nc.box&&Nc.box.length&&(WF(Y,hf,ci),k.placedOrientations[Go]=hf),Nc};dl(()=>Ha(ff,o.cL.horizontal),()=>{const Kc=ji.verticalTextBox;return Y.allowVerticalPlacement&&po>0&&Kc?(Fc(Kc),Ha(Kc,o.cL.vertical)):{box:null,offscreen:null,occluded:null}}),$s(!!(la&&la.box&&la.box.length))}}if(Fs=la,ws=Fs&&Fs.box&&Fs.box.length>0,xo=Fs&&Fs.offscreen,Qs=Fs&&Fs.occluded,ci.useRuntimeCollisionCircles){const $s=ci.centerJustifiedTextSymbolIndex>=0?ci.centerJustifiedTextSymbolIndex:ci.verticalPlacedTextSymbolIndex,dl=Y.text.placedSymbolArray.get($s),Ha=o.d4(Y.textSizeData,vt,dl),Kc=Z.get("text-padding");hs=k.collisionIndex.placeCollisionCircles(Y,hn,dl,$s,Y.lineVertexArray,Y.glyphOffsetArray,Ha,le,fe,me,D,Kn,jt.predicate,ci.collisionCircleDiameter*Ha/o.d1,Kc,k.retainedQueryData[Y.bucketInstanceId].tileID),ws=hn||hs.circles.length>0&&!hs.collisionDetected,xo=xo&&hs.offscreen,Qs=hs.occluded}if(ji.iconFeatureIndex&&(Es=ji.iconFeatureIndex),ji.iconBox){const $s=dl=>{Fc(dl);const Ha=ci.hasIconTextFit&&$l?oA($l.x,$l.y,wn,Kn,k.transform.angle):new o.P(0,0),Kc=Y.getSymbolInstanceIconSize(It,k.transform.zoom,ci.placedIconSymbolIndex);return k.collisionIndex.placeCollisionBox(Y,Kc,dl,Ke,ot,Kr,Ha,xn,Re,le,jt.predicate)};cl&&cl.box&&cl.box.length&&ji.verticalIconBox?(au=$s(ji.verticalIconBox),ta=au.box.length>0):(au=$s(ji.iconBox),ta=au.box.length>0),xo=xo&&au.offscreen,lc=au.occluded}const Lb=kn||0===ci.numHorizontalGlyphVertices&&0===po,gp=cn||0===ci.numIconVertices;if(Lb||gp?gp?Lb||(ta=ta&&ws):ws=ta&&ws:ta=ws=ta&&ws,ws&&Fs&&Fs.box&&k.collisionIndex.insertCollisionBox(Fs.box,Z.get("text-ignore-placement"),Y.bucketInstanceId,cl&&cl.box&&ul?ul:su,jt.ID),ta&&au&&k.collisionIndex.insertCollisionBox(au.box,Z.get("icon-ignore-placement"),Y.bucketInstanceId,Es,jt.ID),hs&&(ws&&k.collisionIndex.insertCollisionCircles(hs.circles,Z.get("text-ignore-placement"),Y.bucketInstanceId,su,jt.ID),D)){const $s=Y.bucketInstanceId;let dl=k.collisionCircleArrays[$s];void 0===dl&&(dl=k.collisionCircleArrays[$s]=new jae);for(let Ha=0;Ha=0;--Ri){const ji=ci[Ri];ii(Y.symbolInstances.get(ji),ji,Y.collisionArrays[ji])}Y.hasAnyZOffset&&o.w(`${Y.layerIds[0]} layer symbol-z-elevate: symbols are not sorted by elevation if symbol-z-order is evaluated to viewport-y`)}else if(Y.hasAnyZOffset){const ci=Y.getSortedIndexesByZOffset();for(let Ri=0;Ri0){let Wn;return k.prevPlacement&&k.prevPlacement.variableOffsets[xn]&&k.prevPlacement.placements[xn]&&k.prevPlacement.placements[xn].text&&(Wn=k.prevPlacement.variableOffsets[xn].anchor),k.variableOffsets[xn]={textOffset:wn,width:Z,height:ne,anchor:v,textScale:le,prevAnchor:Wn},HF(vt,v,at,It),vt.allowVerticalPlacement&&(WF(vt,It,at),k.placedOrientations[xn]=It),{shift:Bn,placedGlyphBoxes:Kn}}}}};class Jae{constructor(v){this._sortAcrossTiles="viewport-y"!==v.layout.get("symbol-z-order")&&void 0!==v.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs=new Set,this._bucketParts=[]}continuePlacement(v,E,D,V,Y,Z){const ne=this._bucketParts;for(;this._currentTileIndexle.sortKey-fe.sortKey));this._currentPartIndex!this.isFullPlacementRequested()&&0!==this._fadeDuration&&this.placement.algorithm.shouldPause(o.e.now()-Z);for(;this._currentPlacementIndex>=0;){const le=E[v[this._currentPlacementIndex]],fe=this.placement.collisionIndex.transform.zoom;if("symbol"===le.type&&"none"!==le.visibility&&(!le.minzoom||le.minzoom<=fe)&&(!le.maxzoom||le.maxzoom>fe)){const me=le,Pe=me.layout.get("symbol-z-elevate"),Re=void 0!==me.layout.get("symbol-sort-key").constantOr(1),Ke=me.layout.get("symbol-z-order"),ot="viewport-y"===Ke||"auto"===Ke&&!("viewport-y"!==Ke&&Re),at=me.layout.get("text-allow-overlap")||me.layout.get("icon-allow-overlap")||me.layout.get("text-ignore-placement")||me.layout.get("icon-ignore-placement"),xt=ot&&at,vt=this._inProgressLayer=this._inProgressLayer||new Jae(me),It=o.m(le.source,le.scope);if(vt.continuePlacement(Pe||xt?V[It]:D[It],this.placement,this._showCollisionBoxes,le,ne,Y))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._forceFullPlacement=false,this._done=true}commit(v){return this._retiredCI=this.placement.prevPlacement?this.placement.prevPlacement.collisionIndex:null,this.placement.commit(v),this.placement}}const eI=512/o.a2/2;class _Oe{constructor(v,E,D){this.tileID=v,this.bucketInstanceId=D,this.index=new o.d5(E.length,16,Int32Array),this.keys=[],this.crossTileIDs=[];const V=v.canonical.x*o.a2,Y=v.canonical.y*o.a2;for(let Z=0;Zxt-vt);for(const xt of at){const vt=this.crossTileIDs[xt];if(this.keys[xt]===me&&!D.has(vt)){D.add(vt),fe.crossTileID=vt;break}}}}}class ese{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class OY{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(v){const E=Math.round((v-this.lng)/360);if(0!==E)for(const D in this.indexes){const V=this.indexes[D],Y={};for(const Z in V){const ne=V[Z];ne.tileID=ne.tileID.unwrapTo(ne.tileID.wrap+E),Y[ne.tileID.key]=ne}this.indexes[D]=Y}this.lng=v}addBucket(v,E,D){if(this.indexes[v.overscaledZ]&&this.indexes[v.overscaledZ][v.key]){if(this.indexes[v.overscaledZ][v.key].bucketInstanceId===E.bucketInstanceId)return false;this.removeBucketCrossTileIDs(v.overscaledZ,this.indexes[v.overscaledZ][v.key])}for(let Y=0;Yv.overscaledZ)for(const ne in Z){const le=Z[ne];le.tileID.isChildOf(v)&&le.findMatches(E.symbolInstances,v,V)}else{const ne=Z[v.scaledTo(Number(Y)).key];ne&&ne.findMatches(E.symbolInstances,v,V)}}for(let Y=0;Y{E[D]=true});for(const D in this.layerIndexes)E[D]||delete this.layerIndexes[D]}}class BY extends o.E{constructor(v){super(),this.requestManager=v,this.models=Object.create(null),this.models[""]=Object.create(null),this.modelUris=Object.create(null),this.modelUris[""]=Object.create(null),this.modelByURL=Object.create(null),this.numModelsLoading=Object.create(null)}async loadModel(v,E){try{const D=await this.requestManager.transformRequest(E,o.R.Model);return this.modelByURL[E]?(await aa(),bo.loadModel?await bo.loadModel(D.url,v,E):null):null}catch(D){if(404===D.status)return null;this.fire(new o.f(new Error(`Could not load model ${v} from ${E}`,{cause:D})))}}load(v,E,D={forceReload:false}){this.models[E]||(this.models[E]=Object.create(null));const V=Object.keys(v),Y=[],Z=[];for(const ne of V){const le=v[ne];this.hasURLBeenRequested(le)&&!D.forceReload||(this.modelByURL[le]={modelId:ne,scope:E},Y.push(this.loadModel(ne,le)),Z.push(ne)),this.models[E][ne]||(this.models[E][ne]={model:null,numReferences:1})}this.numModelsLoading[E]=(this.numModelsLoading[E]||0)+Z.length,Promise.allSettled(Y).then(ne=>{for(let le=0;le{this.fire(new o.f(new Error(`Could not load models: ${ne.message}`)))})}isLoaded(){for(const v in this.numModelsLoading)if(this.numModelsLoading[v]>0)return false;return true}hasModel(v,E,D={exactIdMatch:false}){return!!(D.exactIdMatch?this.getModel(v,E):this.getModelByURL(this.modelUris[E][v]))}getModel(v,E){return this.models[E]||(this.models[E]=Object.create(null)),this.models[E][v]?this.models[E][v].model:void 0}getModelByURL(v){if(!v)return null;const E=this.modelByURL[v];return E?this.models[E.scope][E.modelId].model:null}hasModelBeenAdded(v,E){return this.models[E]&&void 0!==this.models[E][v]}getModelURIs(v){return this.modelUris[v]||Object.create(null)}addModel(v,E,D){this.models[D]||(this.models[D]=Object.create(null)),this.modelUris[D]||(this.modelUris[D]=Object.create(null));const V=this.requestManager.normalizeModelURL(E);if((this.hasModel(v,D,{exactIdMatch:true})||this.hasModelBeenAdded(v,D))&&this.modelUris[D][v]===V)this.models[D][v].numReferences++;else if(this.hasURLBeenRequested(V)){const{scope:Y,modelId:Z}=this.modelByURL[V];this.models[Y][Z].numReferences++}else this.modelUris[D][v]=V,this.load({[v]:this.modelUris[D][v]},D)}addModelURLs(v,E){this.models[E]||(this.models[E]=Object.create(null)),this.modelUris[E]||(this.modelUris[E]=Object.create(null));const D=this.modelUris[E];for(const V of Object.keys(v))D[V]=this.requestManager.normalizeModelURL(v[V])}reloadModels(v){this.load(this.modelUris[v],v,{forceReload:true})}addModelsFromBucket(v,E){this.models[E]||(this.models[E]=Object.create(null)),this.modelUris[E]||(this.modelUris[E]=Object.create(null));const D=Object.create(null);for(const V of v)this.hasModel(V,E,{exactIdMatch:true})||this.hasURLBeenRequested(V)?this.models[E][V].numReferences++:this.modelUris[E][V]&&!this.hasURLBeenRequested(V)?D[V]=this.modelUris[E][V]:!this.hasURLBeenRequested(V)&&nt(V,false)&&(this.modelUris[E][V]=this.requestManager.normalizeModelURL(V),D[V]=this.modelUris[E][V]);this.load(D,E)}hasURLBeenRequested(v){return void 0!==this.modelByURL[v]}removeModel(v,E,D=false,V=false){if(this.models[E]&&this.models[E][v]&&(this.models[E][v].numReferences--,0===this.models[E][v].numReferences||V)){const Y=this.modelUris[E][v];D||delete this.modelUris[E][v],delete this.modelByURL[Y];const Z=this.models[E][v].model;if(!Z)return;delete this.models[E][v],Z.destroy()}}destroy(){for(const v of Object.keys(this.models))for(const E of Object.keys(this.models[v])){const D=this.models[v][E].model;delete this.models[v][E],D&&D.destroy()}this.models=Object.create(null),this.models[""]=Object.create(null),this.modelUris=Object.create(null),this.modelUris[""]=Object.create(null),this.modelByURL=Object.create(null),this.numModelsLoading=Object.create(null)}listModels(v){return this.models[v]||(this.models[v]=Object.create(null)),Object.keys(this.models[v])}upload(v,E){this.models[E]||(this.models[E]=Object.create(null));for(const D in this.models[E])this.models[E][D].model&&this.models[E][D].model.upload(v.context)}}const sA=["RENDER_SHADOWS","NORMAL_OFFSET"],lA=new Set(["symbol","circle"]),P2=class Xvt{constructor(){this._queue=[],this._needsBuild=true,this._idleHandle=null}needsBuild(){return this._needsBuild}buildQueue(v,E,D){null!=this._idleHandle&&"undefined"!=typeof cancelIdleCallback&&cancelIdleCallback(this._idleHandle),this._idleHandle=null,this._queue=[],this._needsBuild=false;const V=!!D.fog,Y=D.hasTerrain(),Z=!(!D.projection||"globe"!==D.projection.name),ne=Y||Z,le=!(!D.directionalLight||!D.directionalLight.shadowsEnabled()),fe=D.map&&D.map.painter,me=!fe||!fe.context.extParallelShaderCompile,Pe=!!fe&&"mrt-fallback"===fe.emissiveMode,Re=(Ke,ot=[],at={})=>{this._queue.push({programId:Ke,params:{...at.params,defines:ot,overrideFog:!!at.fog,overrideTerrain:!!at.terrain,overrideGlobe:!!at.globe,overrideRtt:!!at.rtt,precompiled:true}})};for(const Ke of v){if("none"===Ke.visibility)continue;const ot=Ke.getProgramIds();if(ot)for(const at of ot){if(lA.has(at))continue;const xt=Ke.getDefaultProgramParams(at,E.zoom,D._styleColorTheme.lut);if(!xt)continue;const vt=fe?fe.getShaderSource(at):null,It=ne&&(!vt||vt.usedDefines.has("RENDER_TO_TEXTURE")),jt=Pe&&It?(xt.defines||[]).concat("USE_MRT1"):xt.defines;if(me){Re(at,xt.defines,{params:xt}),It&&Re(at,jt,{params:xt,rtt:true});continue}const Zt=V&&(!vt||vt.usedDefines.has("FOG")),kn=Y&&!Ke.isDraped()&&(!vt||vt.usedDefines.has("TERRAIN")),cn=Z&&(!vt||vt.usedDefines.has("GLOBE")),hn=le&&Ke.hasElevation()&&(!vt||vt.usedDefines.has("RENDER_SHADOWS"));for(const xn of hn?[false,true]:[false]){const wn=xn?(xt.defines||[]).concat(sA):xt.defines||[];for(const Bn of kn?[false,true]:[false])for(const Kn of cn?[false,true]:[false])for(const Wn of Zt?[false,true]:[false])Re(at,wn,{params:xt,fog:Wn,terrain:Bn,globe:Kn})}It&&Re(at,jt,{params:xt,rtt:true})}}if(Re("clippingMask"),Y)for(const Ke of[false,true])Re("terrainRaster",Ke?["TERRAIN_VERTEX_MORPHING"]:[],{terrain:true,fog:V});if(!me){if(v.some(Ke=>"hillshade"===Ke.type)&&Re("hillshadePrepare"),le)for(const Ke of[false,true])for(const ot of[false,true]){const at=[];Ke&&at.push("RENDER_CUTOFF"),at.push("RENDER_SHADOWS"),ot&&at.push("NORMAL_OFFSET"),Re("groundShadow",at),V&&Re("groundShadow",at,{fog:true})}if(Z){for(const Ke of[[],["TERRAIN_VERTEX_MORPHING"],["GLOBE_POLES"]])for(const ot of[false,true]){const at=[...Ke,"PROJECTION_GLOBE_VIEW"];ot&&at.push("CUSTOM_ANTIALIASING"),Re("globeRaster",at,{terrain:Y,globe:true,fog:V})}for(const Ke of[false,true]){const ot=Ke?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"];Re("globeAtmosphere",ot,{fog:true,terrain:Y,globe:Ke}),Re("globeAtmosphere",[...ot,"ALPHA_PASS"],{fog:true,terrain:Y,globe:Ke})}Re("stars",[],{fog:V,terrain:Y,globe:true})}}}_executeBatch(v,E,D){if(D.map&&D.map.isMoving())return void(this._idleHandle=o.e.requestIdleCallback(ne=>this._executeBatch(ne,E,D)));E.context.sweepPendingPrograms();const V=E.context.extParallelShaderCompile?Xvt.DEADLINE_MARGIN_KHR_MS:Xvt.DEADLINE_MARGIN_SYNC_MS;let Y=0;for(;this._queue.length>0;){const ne=this._queue.shift();if(!ne)break;if(E.style=D,E._fogVisible=!!ne.params.overrideFog,E.getOrCreateProgram(ne.programId,ne.params),Y++,v.timeRemaining()<=V)break}const Z=0===this._queue.length||v.timeRemaining()>V;Y>0&&Z&&E.context.gl.flush(),this._idleHandle=this._queue.length>0||E.context._pendingPrograms.size>0?o.e.requestIdleCallback(ne=>this._executeBatch(ne,E,D)):null}processQueue(v,E){0!==this._queue.length&&(null!=this._idleHandle&&"undefined"!=typeof cancelIdleCallback&&cancelIdleCallback(this._idleHandle),this._idleHandle=o.e.requestIdleCallback(D=>this._executeBatch(D,v,E)))}reset(){null!=this._idleHandle&&"undefined"!=typeof cancelIdleCallback&&cancelIdleCallback(this._idleHandle),this._queue=[],this._idleHandle=null,this._needsBuild=true}};P2.DEADLINE_MARGIN_KHR_MS=5,P2.DEADLINE_MARGIN_SYNC_MS=25;let zY=P2;const Fv=o.s.colorTheme,tse=new o.af({data:new o.ag(Fv.data)});function UY(k){if(!k.metadata||!k.metadata.content_area)return;const v=o.e.devicePixelRatio,{left:E,top:D,width:V,height:Y}=k.metadata.content_area,Z=E*v,ne=D*v;return[Z,ne,Z+V*v,ne+Y*v]}function VY(k){if(k)return k.map(([v,E])=>[v*o.e.devicePixelRatio,E*o.e.devicePixelRatio])}class tI{constructor(v,E,D){this.id=v,this.scope=E,this.sourceCache=D,this.pendingRequests=new Set,this.missingRequests=new Set}addPendingRequest(v){this.missingRequests.has(v.name)||this.pendingRequests.has(v.name)||this.pendingRequests.add(v.name)}hasPendingRequests(){return this.pendingRequests.size>0}resolvePendingRequests(){const v=new Map;if(!this.sourceCache.loaded())return v;const E=this.sourceCache.getVisibleCoordinates();if(0===E.length)return v;const D=this.sourceCache.getSource();if("raster-array"!==D.type)return v;const V=E.map(Z=>this.sourceCache.getTile(Z)),Y=D.getImages(V,Array.from(this.pendingRequests));for(const[Z,ne]of Y)v.set(o.I.from({name:Z,iconsetId:this.id}),ne),this.pendingRequests.delete(Z);for(const Z of this.pendingRequests)this.missingRequests.add(Z);return this.pendingRequests.clear(),v}}const Nv=(k,v)=>Nn(k,v&&v.filter(E=>"source.canvas"!==E.identifier)),cA=(k,v)=>{const E=k.type&&!k.array&&Array.isArray(v)?{type:k.type,"property-type":"data-constant"}:void 0;return o.c(v,E)},TOe=new Set(["addLayer","removeLayer","setLights","setPaintProperty","setLayoutProperty","setLayerProperty","setSlot","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setTerrain","setFog","setSnow","setRain","setProjection","setCamera","addImport","removeImport","updateImport","addIconset","removeIconset"]),nse=new Set(["setCenter","setZoom","setBearing","setPitch"]),YF=new Set(["background","sky","slot","custom"]),qF={version:8,layers:[],sources:{}},uA={duration:300,delay:0};class I2 extends o.E{constructor(v,E={}){super(),this.map=v,this.scope=E.scope||"",this.globalId=null,this.fragments=[],this.importDepth=E.importDepth||0,this.importsCache=E.importsCache||new Map,this.resolvedImports=E.resolvedImports||new Set,this.transition={...uA},this._buildingIndex=new Xae(this),this.crossTileSymbolIndex=new h7,this._mergedOrder=[],this._drapedFirstOrder=[],this._mergedLayers=Object.create(null),this._mergedIndoor={},this._indoorEnabled=false,this._mergedSourceCaches={},this._mergedOtherSourceCaches=Object.create(null),this._mergedSymbolSourceCaches=Object.create(null),this._mergedFillExtrusionSourceCaches=Object.create(null),this._mergedHdRoadCoverageSourceCaches=Object.create(null),this._mergedHdRoadElevationSourceCaches=Object.create(null),this._hdCoverage=null,this._hdElevation=null,this._crossSourceElevationActive=false,this._clipLayerPresent=false,this._hasAppearances=false,this._has3DLayers=false,this._hasCircleLayers=false,this._hasSymbolLayers=false,this._importedAsBasemap=false,this._changes=E.styleChanges||new z,this._hasDataDrivenEmissive=false,this.indoorManager=null,this.dispatcher=E.dispatcher?E.dispatcher:new wi(LY(),this);const D={referrer:o.d7(),config:o.dn()};if(this.map.painter&&this.map.painter.context){const Y=this.map.painter.context.maxUniformBufferBindings,Z=Math.floor(this.map.painter.context.maxUniformBlockSize/4);D.contextOptions={maxBindingPoints:Y,maxUniformBlockSizeDwords:Z}}this.isRootStyle()&&this.dispatcher.broadcast("setGlobalParams",D),E.imageManager?this.imageManager=E.imageManager:(this.imageManager=new ye(this.map._spriteFormat),this.imageManager.setEventedParent(this)),this.imageManager.addScope(this.scope),this.glyphManager=E.glyphManager?E.glyphManager:new o.d8(v._requestManager,E.localFontFamily?o.d9.all:E.localIdeographFontFamily?o.d9.ideographs:o.d9.none,E.localFontFamily||E.localIdeographFontFamily,E.fontstackCompositing),E.modelManager?this.modelManager=E.modelManager:(this.modelManager=new BY(v._requestManager),this.modelManager.setEventedParent(this)),this._layers=Object.create(null),this._sourceCaches={},this._otherSourceCaches=Object.create(null),this._symbolSourceCaches=Object.create(null),this._fillExtrusionSourceCaches=Object.create(null),this._hdCoverage=null,this._hdElevation=null,this._crossSourceElevationActive=false,this._loaded=false,this._initialBroadcastDone=false,this._programPrecompiler=this.map._precompilePrograms&&this.isRootStyle()?new zY:null,this._availableImages=[],this._availableModels={},this._order=[],this._markersNeedUpdate=false,this.options=E.configOptions?E.configOptions:new Map,this._layerExpressionDependencies=E.layerExpressionDependencies?E.layerExpressionDependencies:new Map,this._config=E.config,this._styleColorTheme={lut:null,lutLoading:false,lutLoadingCorrelationID:0,colorTheme:null,colorThemeOverride:E.colorThemeOverride},this._styleColorThemeForScope={},this._initialConfig=E.initialConfig;const V=this;this._rtlTextPluginCallback=I2.registerForPluginStateChange(Y=>{V.dispatcher.send("syncRTLPluginState",{pluginStatus:Y.pluginStatus,pluginURL:Y.pluginURL}).then(Z=>{if(o.da(null),Z.every(ne=>ne))for(const ne in V._sourceCaches){const le=V._sourceCaches[ne],fe=le.getSource().type;"vector"!==fe&&"geojson"!==fe||le.reload()}}).catch(Z=>{o.da(Z)})}),this.on("data",Y=>{if("source"!==Y.dataType||"metadata"!==Y.sourceDataType)return;const Z=this.getOwnSource(Y.sourceId);if(Z&&Z.vectorLayerIds)for(const ne in this._layers){const le=this._layers[ne];le.source===Z.id&&this._validateLayer(le)}})}load(v){return v?("string"==typeof v?this.loadURL(v):this.loadJSON(v),this):this}_getGlobalId(v){if(!v)return null;if("string"==typeof v){if(o.cg(v))return v;const E=o.db(v);if(!E.startsWith("http"))try{return new URL(E,location.href).toString()}catch(D){return E}return E}return`json://${o.dc(JSON.stringify(v))}`}_diffStyle(v,E,D){this.globalId=this._getGlobalId(v),Ot();const V=(Y,Z)=>{try{Z(null,this.setState(Y,D))}catch(ne){Z(ne,false)}};if("string"==typeof v){const Y=this.map._requestManager.normalizeStyleURL(v),Z=new AbortController;this._request={cancel:()=>Z.abort()},(async()=>{const ne=await this.map._requestManager.transformRequest(Y,o.R.Style,Z.signal),{data:le}=await o.g(ne,Z.signal);this._request=null,V(le,E)})().catch(ne=>{this._request=null,Z.signal.aborted||this.fire(new o.f(ne))})}else"object"==typeof v&&V(v,E)}loadURL(v,E={}){this.fire(new o.h("dataloading",{dataType:"style"}));const D="boolean"==typeof E.validate?E.validate:!o.cg(v);D&&Ot(),this.globalId=this._getGlobalId(v),v=this.map._requestManager.normalizeStyleURL(v,E.accessToken),this.resolvedImports.add(v);const V=this.importsCache.get(v);if(V)return void this._load(V,D);const Y=new AbortController;this._request={cancel:()=>Y.abort()},(async()=>{const Z=await this.map._requestManager.transformRequest(v,o.R.Style,Y.signal),{data:ne}=await o.g(Z,Y.signal);this._request=null,this.importsCache.set(v,ne),this._load(ne,D)})().catch(Z=>{this._request=null,Y.signal.aborted||this.fire(new o.f(Z))})}loadJSON(v,E={}){this.fire(new o.h("dataloading",{dataType:"style"}));const D=false!==E.validate;D&&Ot(),this.globalId=this._getGlobalId(v),this._request=o.e.frame(()=>{this._request=null,this._load(v,D)})}loadEmpty(){this.fire(new o.h("dataloading",{dataType:"style"})),this._load(qF,false)}_loadImports(v,E,D){if(this.importDepth>=4)return o.w("Style doesn't support nesting deeper than 5"),Promise.resolve();const V=[];for(const Y of v){const Z=this._createFragmentStyle(Y),ne=new Promise(me=>{Z.once("style.import.load",me),Z.once("error",me)}).then(()=>{this.mergeAll(),this.fire(new o.h("data",{dataType:"style"}))});if(V.push(ne),this.resolvedImports.has(Y.url)){Z.loadEmpty();continue}const le=Y.data||this.importsCache.get(Y.url);le?(Y.data?(Z.fire(new o.h("dataloading",{dataType:"style"})),Z.globalId=Z._getGlobalId(le),E&&Ot(),queueMicrotask(()=>{Z._load(le,E)})):Z.loadJSON(le,{validate:E}),this._isInternalStyle(le)&&(Z.globalId=null)):Y.url?Z.loadURL(Y.url,{validate:E}):Z.loadEmpty();const fe={style:Z,id:Y.id,config:Y.config};if(D){const me=this.fragments.findIndex(({id:Pe})=>Pe===D);this.fragments=this.fragments.slice(0,me).concat(fe).concat(this.fragments.slice(me))}else this.fragments.push(fe)}return Promise.allSettled(V)}getImportGlobalIds(v=this,E=new Set){for(const D of v.fragments)D.style.globalId&&E.add(D.style.globalId),this.getImportGlobalIds(D.style,E);return[...E.values()]}_createFragmentStyle(v){const E=this.scope?o.m(v.id,this.scope):v.id;let D;const V=this._initialConfig&&this._initialConfig[E];(v.config||V)&&(D={...v.config,...V});const Y=new I2(this.map,{scope:E,styleChanges:this._changes,importDepth:this.importDepth+1,importsCache:this.importsCache,resolvedImports:new Set(this.resolvedImports),dispatcher:this.dispatcher,imageManager:this.imageManager,glyphManager:this.glyphManager,modelManager:this.modelManager,config:D,configOptions:this.options,colorThemeOverride:v["color-theme"],layerExpressionDependencies:this._layerExpressionDependencies});return Y.setEventedParent(this.map,{style:Y}),Y}_reloadImports(v=false){this.mergeAll(),this._updateMapProjection(),v||this.updateConfigDependencies(),this._updateLayers(this._dependentLayerIds(E=>E.isIndoorDependent)),this.map._triggerCameraUpdate(this.camera),(!v||this.isRootStyle()||this.map.style._initialBroadcastDone)&&(v&&this.isRootStyle()?(this.forEachFragmentStyle(E=>{this.dispatcher.broadcast("setLayers",{layers:E._serializeLayers(E._order),scope:E.scope,options:E.options})}),this._initialBroadcastDone=true):this.dispatcher.broadcast("setLayers",{layers:this._serializeLayers(this._order),scope:this.scope,options:this.options}))}_isInternalStyle(v){return this.isRootStyle()&&(v.fragment||!!v.schema&&false!==v.fragment)}async _load(v,E){if(this._isInternalStyle(v)){const Y={id:"basemap",data:v,url:""},Z={...qF,imports:[Y],...v.center?{center:v.center}:{},...v.bearing?{bearing:v.bearing}:{},...v.pitch?{pitch:v.pitch}:{},...v.zoom?{zoom:v.zoom}:{},...v.light?{light:v.light}:{}};return this._importedAsBasemap=true,void this._load(Z,E)}if(this.updateConfig(this._config,v.schema),E){if(await Ot(),!this.dispatcher.actors.length)return;if(Nv(this,Ur(v)))return}this._loaded=true;for(const Y in v.sources)this.addSource(Y,v.sources[Y],{validate:false,isInitialLoad:true});this.stylesheet=o.dd(v);const D=()=>{if(v.iconsets)for(const fe in v.iconsets)this.addIconset(fe,v.iconsets[fe]);v.sprite?this._loadIconset(v.sprite):(this.imageManager.setLoaded(true,this.scope),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope})),!this.glyphManager.url&&v.glyphs&&this.glyphManager.setURL(v.glyphs);const Y=$F(this.stylesheet.layers);if(this._order=Y.map(fe=>fe.id),this.stylesheet.light&&o.w("The `light` root property is deprecated, prefer using `lights` with `flat` light type instead."),this.stylesheet.lights)if(1===this.stylesheet.lights.length&&"flat"===this.stylesheet.lights[0].type){const fe=this.stylesheet.lights[0];this.light=new Mt(fe.properties,fe.id)}else this.setLights(this.stylesheet.lights);this.light||(this.light=new Mt(this.stylesheet.light)),this._layers=Object.create(null);let Z=false;for(const fe of Y){const me=o.di(fe,this.scope,this._styleColorTheme.lut,this.options);this._layerExpressionDependencies.set(me.fqid,new U(me)),this._hasAppearances=this._hasAppearances||0!==me.getAppearances().length,me.setEventedParent(this,{layer:{id:me.id}}),this._layers[me.id]=me,this._updateHdCoverageSourceCache(me)&&(Z=true);const Pe=this.getOwnLayerSourceCache(me),Re=!!this.directionalLight&&this.directionalLight.shadowsEnabled();Pe&&me.canCastShadows()&&Re&&(Pe.castsShadows=true)}if(Z&&Jm().then(()=>{if(!this.map)return;for(const me in this._layers)this._updateHdCoverageSourceCache(this._layers[me]);this.map.style.mergeAll();const fe=this.map.transform;for(const me in this.map.style._mergedHdRoadCoverageSourceCaches){const Pe=this.map.style._mergedHdRoadCoverageSourceCaches[me];Pe.used=true,fe&&Pe.update(fe)}this.map._update()}),this.glyphManager.url){const fe=new Set;for(const me in this._layers){const Pe=this._layers[me];if("symbol"===Pe.type&&Pe.layout){const Re=Pe.layout.get("text-font");Re&&Re.value&&"constant"===Re.value.kind&&fe.add(Re.value.value.join(","))}}for(const me of fe)this.glyphManager.prefetchRange(me,0)}this.stylesheet.featuresets&&this.setFeaturesetSelectors(this.stylesheet.featuresets),this.stylesheet.models&&this.addModelURLs(this.stylesheet.models);const ne=this.stylesheet.terrain;ne&&(this.checkCanvasFingerprintNoise(),this.disableElevatedTerrain||this.terrainSetForDrapingOnly()||this._createTerrain(ne,1)),this.stylesheet.fog&&this._createFog(this.stylesheet.fog),this.stylesheet.snow&&this._createSnow(this.stylesheet.snow),this.stylesheet.rain&&this._createRain(this.stylesheet.rain),this.stylesheet.transition&&this.setTransition(this.stylesheet.transition),this.fire(new o.h("data",{dataType:"style"}));const le=this.isRootStyle();v.imports?this._loadImports(v.imports,E).then(()=>{this._reloadImports(true),this.fire(new o.h(le?"style.load":"style.import.load"))}).catch(fe=>{this.fire(new o.f(new Error("Failed to load imports",fe))),this.fire(new o.h(le?"style.load":"style.import.load"))}):(this._reloadImports(true),this.fire(new o.h(le?"style.load":"style.import.load")))};this._styleColorTheme.colorTheme=this.stylesheet["color-theme"];const V=this._styleColorTheme.colorThemeOverride?this._styleColorTheme.colorThemeOverride:this._styleColorTheme.colorTheme;if(V){const Y=this._evaluateColorThemeData(V);this._loadColorTheme(Y).then(()=>{D()}).catch(Z=>{o.w(`Couldn't load color theme from the stylesheet: ${Z}`),D()})}else this._styleColorTheme.lut=null,D()}isRootStyle(){return 0===this.importDepth}hasAppearances(){return this._hasAppearances||this.fragments.some(v=>v.style.hasAppearances())}mergeAll(){let v,E,D,V,Y,Z,ne,le,fe,me;const Pe={};this.terrain&&this.terrain.scope!==this.scope&&delete this.terrain,this.forEachFragmentStyle(Re=>{if(Re.stylesheet){if(Re.disableElevatedTerrain&&(this.disableElevatedTerrain=true),null!=Re.light&&(v=Re.light),Re.stylesheet.lights)for(const Ke of Re.stylesheet.lights)"ambient"===Ke.type&&null!=Re.ambientLight&&(E=Re.ambientLight),"directional"===Ke.type&&null!=Re.directionalLight&&(D=Re.directionalLight);V=this._prioritizeTerrain(V,Re.terrain,Re.stylesheet.terrain),Re.stylesheet.fog&&null!=Re.fog&&(Y=Re.fog),Re.stylesheet.snow&&null!=Re.snow&&(Z=Re.snow),Re.stylesheet.rain&&null!=Re.rain&&(ne=Re.rain),null!=Re.stylesheet.camera&&(me=Re.stylesheet.camera),null!=Re.stylesheet.projection&&(le=Re.stylesheet.projection),null!=Re.stylesheet.transition&&(fe=Re.stylesheet.transition),Pe[Re.scope]=Re._styleColorTheme}}),this.light=v,this.ambientLight=E,this.directionalLight=D,this.fog=Y,this.snow=Z,this.rain=ne,this._styleColorThemeForScope=Pe,null===V?delete this.terrain:this.terrain=V,this.camera=me||{"camera-projection":"perspective"},this.projection=le||{name:"mercator"},this.transition={...uA,...fe},this.mergeSources(),this.mergeLayers(),this.mergeIndoor(),this._programPrecompiler&&this._programPrecompiler.reset()}forEachFragmentStyle(v){const E=D=>{for(const V of D.fragments)E(V.style);v(D)};E(this)}_prioritizeTerrain(v,E,D){const V=v&&0===v.drapeRenderMode;return null===D?E&&0===E.drapeRenderMode?E:V?v:null:null!=E&&(!v||V||E&&1===E.drapeRenderMode)?E:v}mergeTerrain(){let v;this.terrain&&this.terrain.scope!==this.scope&&delete this.terrain,this.forEachFragmentStyle(E=>{v=this._prioritizeTerrain(v,E.terrain,E.stylesheet.terrain)}),null===v?delete this.terrain:this.terrain=v,this._programPrecompiler&&this._programPrecompiler.reset()}mergeProjection(){let v;this.forEachFragmentStyle(E=>{null!=E.stylesheet.projection&&(v=E.stylesheet.projection)}),this.projection=v||{name:"mercator"},this._programPrecompiler&&this._programPrecompiler.reset()}mergeSources(){const v={},E=Object.create(null),D=Object.create(null),V=Object.create(null),Y=Object.create(null),Z=Object.create(null);this.forEachFragmentStyle(ne=>{for(const le in ne._sourceCaches){const fe=o.m(le,ne.scope);v[fe]=ne._sourceCaches[le]}for(const le in ne._otherSourceCaches){const fe=o.m(le,ne.scope);E[fe]=ne._otherSourceCaches[le]}for(const le in ne._symbolSourceCaches){const fe=o.m(le,ne.scope);D[fe]=ne._symbolSourceCaches[le]}for(const le in ne._fillExtrusionSourceCaches){const fe=o.m(le,ne.scope);V[fe]=ne._fillExtrusionSourceCaches[le]}if(ne._hdCoverage){const le=ne._hdCoverage.coverageSourceCaches;for(const fe in le)Y[o.m(fe,ne.scope)]=le[fe]}if(ne._hdElevation){const le=ne._hdElevation.elevationSourceCaches;for(const fe in le)Z[fe]=le[fe]}}),this._mergedSourceCaches=v,this._mergedOtherSourceCaches=E,this._mergedSymbolSourceCaches=D,this._mergedFillExtrusionSourceCaches=V,this._mergedHdRoadCoverageSourceCaches=Y,this._mergedHdRoadElevationSourceCaches=Z,Object.keys(Y).length>0&&!this._hdCoverage&&To.HdCoverageState&&(this._hdCoverage=new To.HdCoverageState),To.updateCrossSourceElevationGate&&To.updateCrossSourceElevationGate(this)}mergeIndoor(){this._mergedIndoor={},this.forEachFragmentStyle(v=>{if(v.stylesheet&&v.stylesheet.indoor)for(const E of Object.values(v.stylesheet.indoor)){const D=E,V=o.m(D.sourceId,v.scope);this._mergedIndoor[V]=new Set(D.sourceLayers||[])}}),this._updateIndoorEnabled()}_updateIndoorEnabled(){const v=this._indoorEnabled;if(this._indoorEnabled=false,Object.keys(this._mergedIndoor).length>0)for(const E of this._mergedOrder){const D=this._mergedLayers[E];if("none"!==D.visibility&&this._mergedIndoor[o.m(D.source,D.scope)]){this._indoorEnabled=true;break}}!this._indoorEnabled||v||this.indoorManager||Jm().then(()=>{this._initIndoorManager()})}_initIndoorManager(){if(!this.indoorManager&&To.IndoorManager&&this.isRootStyle()&&0!==Object.keys(this._mergedIndoor).length&&(this.indoorManager=new To.IndoorManager(this,this._loaded),this._loaded))for(const v of Object.keys(this._mergedIndoor)){const E=this._mergedSourceCaches[v]||this._mergedOtherSourceCaches[v];E&&E.reload()}}mergeLayers(){const v={},E=[],D=Object.create(null);this._mergedSlots=[],this._has3DLayers=false,this._hasCircleLayers=false,this._hasSymbolLayers=false,this.forEachFragmentStyle(Z=>{for(const ne of Z._order){const le=Z._layers[ne];if("slot"===le.type){const fe=o.bV(ne);if(v[fe])continue;v[fe]=[]}le.slot&&v[le.slot]?v[le.slot].push(le):E.push(le)}}),this._mergedOrder=[];let V=-1;const Y=(Z=[])=>{for(const ne of Z)if("slot"===ne.type){const le=o.bV(ne.id);v[le]&&Y(v[le]),this._mergedSlots.push(le)}else{const le=o.m(ne.id,ne.scope);this._mergedOrder.push(le),D[le]=ne,ne.is3D(!!this.terrain)&&(this._has3DLayers=true,V=this._mergedOrder.length-1),"circle"===ne.type&&(this._hasCircleLayers=true),"symbol"===ne.type&&(this._hasSymbolLayers=true),"clip"===ne.type&&(this._clipLayerPresent=true)}};if(Y(E),this._has3DLayers){const Z={};for(let ne=0;neZ[ne]-Z[le])}this._mergedLayers=D,this.updateDrapeFirstLayers(),this._buildingIndex.processLayersChanged(),this._updateDataDrivenEmissiveStrength()}terrainSetForDrapingOnly(){return!!this.terrain&&0===this.terrain.drapeRenderMode}getCamera(){return this.stylesheet.camera}setCamera(v){return this.stylesheet.camera={...this.stylesheet.camera,...v},this.camera=this.stylesheet.camera,this}_evaluateColorThemeData(v){return v.data?function(E,D,V){const Y={...D};for(const ne of Object.keys(Fv))void 0===Y[ne]&&(Y[ne]=Fv[ne].default);const Z=new o.ae(tse,E,new Map(V));return Z.setTransitionOrValue(Y,V),Z.untransitioned().possiblyEvaluate(new o.ai(0,{worldview:void 0}))}(this.scope,v,this.options).get("data"):null}_loadColorTheme(v){this._styleColorTheme.lutLoading=true,this._styleColorTheme.lutLoadingCorrelationID+=1;const E=this._styleColorTheme.lutLoadingCorrelationID;return new Promise((D,V)=>{const Y="data:image/png;base64,";if(!v||0===v.length)return this._styleColorTheme.lut=null,this._styleColorTheme.lutLoading=false,void D();let Z=v;Z.startsWith(Y)||(Z=Y+Z);const ne=o.I.from("mapbox-reserved-lut"),le=new Image;le.src=Z,le.onerror=()=>{this._styleColorTheme.lutLoading=false,V(new Error("Failed to load image data"))},le.onload=()=>{if(this._styleColorTheme.lutLoadingCorrelationID!==E)return void D();this._styleColorTheme.lutLoading=false;const{width:fe,height:me,data:Pe}=o.e.getImageData(le);if(me>32)return void V(new Error("The height of the image must be less than or equal to 32 pixels."));if(fe!==me*me)return void V(new Error("The width of the image must be equal to the height squared."));this.getImage(ne)&&this.removeImage(ne),this.addImage(ne,{data:new o.b({width:fe,height:me},Pe),pixelRatio:1,sdf:false,usvg:false,version:0});const Re=this.imageManager.getImage(ne,this.scope);Re?(this._styleColorTheme.lut={image:Re.data,data:v},D()):V(new Error("Missing LUT image."))}})}getLut(v){const E=this._styleColorThemeForScope[v];return E?E.lut:null}setProjection(v){v?this.stylesheet.projection=v:delete this.stylesheet.projection,this.mergeProjection(),this._updateMapProjection()}applyProjectionUpdate(){this._loaded&&(this.dispatcher.broadcast("setProjection",this.map.transform.projectionOptions),this.map.transform.projection.requiresDraping?this.hasTerrain()||this.setTerrainForDraping():this.terrainSetForDrapingOnly()&&this.setTerrain(null,0))}_updateMapProjection(){this.isRootStyle()&&(this.map._useExplicitProjection?this.applyProjectionUpdate():this.map._prioritizeAndUpdateProjection(null,this.projection))}_loadSprite(v){const E=new AbortController;this._spriteRequest=E,function(D,V,Y,Z){let ne,le,fe;const me=o.e.devicePixelRatio>1?"@2x":"";function Pe(Re){fe||Re&&Y.aborted||(Re&&(fe=Re),function(){if(fe)Z(fe);else if(ne&&le){const Ke=o.e.getImageData(le),ot={};for(const at in ne){const{width:xt,height:vt,x:It,y:jt,sdf:Zt,pixelRatio:kn,stretchX:cn,stretchY:hn,content:xn}=ne[at],wn=new o.b({width:xt,height:vt});o.b.copy(Ke,wn,{x:It,y:jt},{x:0,y:0},{width:xt,height:vt},null),ot[at]={data:wn,pixelRatio:void 0!==kn?kn:1,sdf:void 0!==Zt&&Zt,stretchX:cn,stretchY:hn,content:xn,usvg:false,version:0}}Z(null,ot)}}())}(async function(){const Re=await V.transformRequest(V.normalizeSpriteURL(D,me,".json"),o.R.SpriteJSON,Y),{data:Ke}=await o.g(Re,Y);fe||(ne=Ke)})().then(()=>Pe(void 0),Re=>Pe(Re)),async function(){const Re=await V.transformRequest(V.normalizeSpriteURL(D,me,".png"),o.R.SpriteImage,Y),{data:Ke}=await o.a(Re,Y);fe||(le=Ke)}().then(()=>Pe(void 0),Re=>Pe(Re))}(v,this.map._requestManager,E.signal,(D,V)=>{if(this._spriteRequest=null,D)this.dispatcher.broadcast("spriteLoaded",{scope:this.scope}),this.fire(new o.f(D));else if(V){const Y=new Map;for(const Z in V)Y.set(o.I.from(Z),V[Z]);this.addImages(Y,true)}this.imageManager.setLoaded(true,this.scope),this.fire(new o.h("data",{dataType:"style"}))})}addIconset(v,E){if("sprite"===E.type)return void this._loadSprite(E.url);const D=this.getOwnSourceCache(E.source);if(!D)return void this.fire(new o.f(new Error(`Source "${E.source}" as specified by iconset "${v}" does not exist and cannot be used as an iconset source`)));if("raster-array"!==D.getSource().type)return void this.fire(new o.f(new Error(`Source "${E.source}" as specified by iconset "${v}" is not a "raster-array" source and cannot be used as an iconset source`)));const V=new tI(v,this.scope,D);this.imageManager.addImageProvider(V,this.scope)}removeIconset(v){this.imageManager.removeImageProvider(v,this.scope)}_loadIconset(v){if(!o.cg(v)&&"icon_set"!==this.map._spriteFormat||"raster"===this.map._spriteFormat)return void this._loadSprite(v);const E="auto"===this.map._spriteFormat,D=new AbortController;this._spriteRequest=D,async function(V,Y,Z,ne){try{const le=await Y.transformRequest(Y.normalizeIconsetURL(V),o.R.Iconset,Z),{data:fe}=await o.cC(le,Z),me={},Pe=function(Re){const Ke={icons:[]};let ot;for(;ot=Re.nextField(void 0);)1===ot&&Ke.icons.push(K(Re,Re.readVarint()+Re.pos));return Ke}(new o.cB(fe));for(const Re of Pe.icons){const Ke={version:1,pixelRatio:o.e.devicePixelRatio,content:UY(Re),stretchX:Re.metadata?VY(Re.metadata.stretch_x_areas):void 0,stretchY:Re.metadata?VY(Re.metadata.stretch_y_areas):void 0,sdf:false,usvg:true,icon:Re};me[Re.name]=Ke}ne(null,me)}catch(le){Z.aborted||ne(le)}}(v,this.map._requestManager,D.signal,(V,Y)=>{if(this._spriteRequest=null,V)E?this._loadSprite(v):(this.dispatcher.broadcast("spriteLoaded",{scope:this.scope}),this.fire(new o.f(V)));else if(Y){const Z=new Map;for(const ne in Y)Z.set(o.I.from(ne),Y[ne]);this.addImages(Z,true)}this.imageManager.setLoaded(true,this.scope),this.fire(new o.h("data",{dataType:"style"}))})}_validateLayer(v){const E=this.getOwnSource(v.source);if(!E)return;const D=v.sourceLayer;D&&("geojson"===E.type||E.vectorLayerIds&&!E.vectorLayerIds.includes(D))&&this.fire(new o.f(new Error(`Source layer "${D}" does not exist on source "${E.id}" as specified by style layer "${v.id}"`)))}loaded(){if(!this._loaded)return false;if(Object.keys(this._changes.getUpdatedSourceCaches()).length)return false;for(const v in this._sourceCaches)if(!this._sourceCaches[v].loaded())return false;if(!this.imageManager.isLoaded())return false;if(this.imageManager.hasPatternsInFlight())return false;if(!this.modelManager.isLoaded())return false;if(this._styleColorTheme.lutLoading)return false;for(const{style:v}of this.fragments)if(!v.loaded())return false;return true}_serializeImports(){if(this.stylesheet.imports)return this.stylesheet.imports.map((v,E)=>{const D=this.fragments[E];return D&&D.style&&(v.data=D.style.serialize()),v})}_serializeSources(){const v={};for(const E in this._sourceCaches){const D=this._sourceCaches[E].getSource();v[D.id]||(v[D.id]=D.serialize())}return v}_serializeLayers(v){const E=[];for(const D of v){const V=this._layers[D];V&&"custom"!==V.type&&E.push(V.serialize())}return E}hasLightTransitions(){return!(!this.light||!this.light.hasTransition())||!(!this.ambientLight||!this.ambientLight.hasTransition())||!(!this.directionalLight||!this.directionalLight.hasTransition())}hasFogTransition(){return!!this.fog&&this.fog.hasTransition()}hasSnowTransition(){return!!this.snow&&this.snow.hasTransition()}hasRainTransition(){return!!this.rain&&this.rain.hasTransition()}hasTransitions(){if(this.hasLightTransitions())return true;if(this.hasFogTransition())return true;if(this.hasSnowTransition())return true;if(this.hasRainTransition())return true;for(const v in this._sourceCaches)if(this._sourceCaches[v].hasTransition())return true;for(const v in this._layers)if(this._layers[v].hasTransition())return true;return false}_updateDataDrivenEmissiveStrength(){for(const v in this._mergedLayers){const E=this._mergedLayers[v];if(E._transitionablePaint&&E._transitionablePaint._values){const D=E._transitionablePaint._values["line-emissive-strength"];if(D&&D.value&&D.value.isDataDriven())return void(this._hasDataDrivenEmissive=true)}}this._hasDataDrivenEmissive=false}hasDataDrivenEmissiveStrength(){return this._hasDataDrivenEmissive}get order(){return this.terrain?this._drapedFirstOrder:this._mergedOrder}_getOrder(v){return v?this.order:this._mergedOrder}isLayerDraped(v){return!!this.terrain&&v.isDraped(this.getLayerSourceCache(v))}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading")}_checkLayer(v){const E=this.getOwnLayer(v);if(E)return E;this.fire(new o.f(new Error(`The layer '${v}' does not exist in the map's style.`)))}_checkSource(v){const E=this.getOwnSource(v);if(E)return E;this.fire(new o.f(new Error(`The source '${v}' does not exist in the map's style.`)))}handleIdle(){const v=this.map.painter;v&&(v.context.sweepPendingPrograms(),this._programPrecompiler&&this._programPrecompiler.processQueue(v,this))}handleContextLost(){this._programPrecompiler&&this._programPrecompiler.reset()}update(v){if(!this._loaded)return;this.ambientLight&&this.ambientLight.recalculate(v),this.directionalLight&&this.directionalLight.recalculate(v);const E=this.calculateLightsBrightness();v.brightness=E||0;let D=false;E!==this._brightness&&(this._brightness=E,D=true),v.worldview!==this._worldview&&(this._worldview=v.worldview,D=true),D&&this.dispatcher.broadcast("upsertRenderParams",{brightness:this._brightness,worldview:this._worldview});const V=this._changes.isDirty();let Y=false;if(this._changes.isDirty()){const fe=this._changes.getLayerUpdatesByScope();for(const me in fe){const{updatedIds:Pe,removedIds:Re}=fe[me];(Pe||Re)&&(this._updateWorkerLayers(me,Pe,Re),Y=true)}this.updateSourceCaches(),this._updateTilesForChangedImages(),this.updateLayers(v),this.light&&this.light.updateTransitions(v),this.ambientLight&&this.ambientLight.updateTransitions(v),this.directionalLight&&this.directionalLight.updateTransitions(v),this.fog&&this.fog.updateTransitions(v),this.snow&&this.snow.updateTransitions(v),this.rain&&this.rain.updateTransitions(v),this._changes.reset()}const Z={};for(const fe in this._mergedSourceCaches){const me=this._mergedSourceCaches[fe];Z[fe]=me.used,me.used=false,me.tileCoverLift=0}const ne={};for(const fe of this._mergedOrder){const me=this._mergedLayers[fe];if(("none"!==me.visibility||me.hasTransition())&&me.recalculate(v,this._availableImages),!me.isHidden(v.zoom)){me.mayUse("HD")&&(me.prepare(),Jm()),me.mayUse("Standard")&&(me.prepare(),aa());const Pe=this.getLayerSourceCache(me);Pe&&(Pe.used=true,Pe.tileCoverLift=Math.max(Pe.tileCoverLift,me.tileCoverLift()))}if(me.source){const Pe=o.m(me.source,me.scope),Re=this._mergedHdRoadCoverageSourceCaches[Pe];Re&&!Re.used&&(Re.used=true)}if("fill-extrusion"===me.type){const Pe=o.m(me.source,me.scope);if(Pe in this._mergedFillExtrusionSourceCaches){const Re=me.layout&&me.layout.get("source-max-zoom");if(null!=Re){const Ke=ne[Pe];ne[Pe]=null==Ke?Re:Math.min(Ke,Re)}}}}if(this._programPrecompiler&&this._programPrecompiler.needsBuild()){const fe=this._mergedOrder.map(me=>this._mergedLayers[me]);this._programPrecompiler.buildQueue(fe,v,this)}for(const fe in this._mergedFillExtrusionSourceCaches)this._mergedFillExtrusionSourceCaches[fe].setMaxzoomOverride(ne[fe]??null);this.terrain&&Y&&this.mergeLayers();const le=this.imageManager.getPendingImageProviders();for(const fe of le)fe.sourceCache.used=true;for(const fe in Z){const me=this._mergedSourceCaches[fe];Z[fe]!==me.used&&me.getSource().fire(new o.h("data",{sourceDataType:"visibility",dataType:"source",sourceId:me.getSource().id}))}this.light&&this.light.recalculate(v),this.terrain&&this.terrain.recalculate(v),this.fog&&this.fog.recalculate(v),this.snow&&this.snow.recalculate(v),this.rain&&this.rain.recalculate(v),this.z=v.zoom,this._markersNeedUpdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=false),this.imageManager.clearUpdatedImages(this.scope),V&&this.fire(new o.h("data",{dataType:"style"}))}updateImageProviders(){const v=this.imageManager.getPendingImageProviders();for(const E of v){const D=E.resolvePendingRequests(),V=this.getFragmentStyle(E.scope);V&&V.addImages(D)}}_updateTilesForChangedImages(){const v={};for(const E in this._mergedSourceCaches){const D=this._mergedSourceCaches[E].getSource().scope;v[D]=v[D]||this._changes.getUpdatedImages(D),0!==v[D].length&&this._mergedSourceCaches[E].reloadTilesForDependencies(["icons","patterns"],v[D])}for(const E in v)this._changes.resetUpdatedImages(E)}_updateWorkerLayers(v,E,D){const V=this.getFragmentStyle(v);V&&this.dispatcher.broadcast("updateLayers",{layers:E?V._serializeLayers(E):[],scope:v,removedIds:D||[],options:V.options})}setState(v,E){if(this._checkLoaded(),Nv(this,Ur(v)))return false;if((v=o.dd(v)).layers=$F(v.layers),!Pn.diffStyles)throw new Error("Debug module not loaded; cannot diff style.");const D=Pn.diffStyles(this.serialize(),v).filter(Z=>!nse.has(Z.command));if(0===D.length)return false;const V=D.filter(Z=>!TOe.has(Z.command));if(V.length>0)throw new Error(`Unimplemented: ${V.map(Z=>Z.command).join(", ")}.`);const Y=[];return D.forEach(Z=>{Y.push(this[Z.command](...Z.args))}),E&&Promise.all(Y).then(E).catch(E),this.stylesheet=v,this.mergeAll(),this.dispatcher.broadcast("setLayers",{layers:this._serializeLayers(this._order),scope:this.scope,options:this.options}),true}_updateWorkerImages(v=false){this._availableImages=this.imageManager.listImages(this.scope);const E={scope:this.scope,images:this._availableImages};v&&(E.isSpriteLoaded=true),this.dispatcher.broadcast("setImages",E)}_updateWorkerModels(){this._availableModels=this.modelManager.getModelURIs(this.scope),this.dispatcher.broadcast("setModels",{scope:this.scope,models:this._availableModels})}addImages(v,E){if(0===v.size)return E&&this.dispatcher.broadcast("spriteLoaded",{scope:this.scope}),this;for(const[D,V]of v.entries()){if(this.getImage(D))return this.fire(new o.f(new Error(`An image with the name "${D.name}" already exists.`)));this.imageManager.addImage(D,this.scope,V),this._changes.updateImage(D,this.scope)}return this._updateWorkerImages(E),this.fire(new o.h("data",{dataType:"style"})),this}addImage(v,E){return this.getImage(v)?this.fire(new o.f(new Error(`An image with the name "${v.name}" already exists.`))):(this.imageManager.addImage(v,this.scope,E),this._changes.updateImage(v,this.scope),this._updateWorkerImages(),this.fire(new o.h("data",{dataType:"style"})),this)}updateImage(v,E,D=false){this.imageManager.updateImage(v,this.scope,E),D&&(this._changes.updateImage(v,this.scope),this._updateWorkerImages(),this.fire(new o.h("data",{dataType:"style"})))}getImage(v){return this.imageManager.getImage(v,this.scope)}removeImage(v){return this.getImage(v)?(this.imageManager.removeImage(v,this.scope),this._changes.updateImage(v,this.scope),this._updateWorkerImages(),this.fire(new o.h("data",{dataType:"style"})),this):this.fire(new o.f(new Error("No image with this name exists.")))}listImages(){return this._checkLoaded(),this._availableImages.slice()}getActualScope(){return this._importedAsBasemap?"basemap":this.scope}addModelURLs(v){return this.modelManager.addModelURLs(v,this.getActualScope()),this._updateWorkerModels(),this.fire(new o.h("data",{dataType:"style"})),this}addModel(v,E,D={}){return this._checkLoaded(),this._validate(gt,`models.${v}`,E,null,D)||(this.modelManager.addModel(v,E,this.getActualScope()),this.fire(new o.h("data",{dataType:"style"}))),this}hasModel(v){return this.modelManager.hasModel(v,this.getActualScope())}removeModel(v){return this.hasModel(v)?(this.modelManager.removeModel(v,this.getActualScope(),false,true),this.fire(new o.h("data",{dataType:"style"})),this):this.fire(new o.f(new Error("No model with this ID exists.")))}listModels(){return this._checkLoaded(),this.modelManager.listModels(this.getActualScope())}addSource(v,E,D={}){if(this._checkLoaded(),void 0!==this.getOwnSource(v))throw new Error(`There is already a source with ID "${v}".`);if(!E.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(E).join(", ")}.`);if(["vector","raster","geojson","video","image"].includes(E.type)&&this._validate(bi,`sources.${v}`,E,null,D))return;this.map&&this.map._collectResourceTiming&&(E.collectResourceTiming=true);const V=Object.hasOwn(hT,E.type)&&!k2(E.type),Y=V?new gOe(v,E,this.dispatcher,this):c7(v,E,this.dispatcher,this);Y.scope=this.scope;const Z=le=>{le.setEventedParent(this,()=>({isSourceLoaded:this._isSourceCacheLoaded(le.id),source:le.serialize(),sourceId:le.id}))};Z(Y);const ne=le=>{const fe=(le===o.bR.Symbol?"symbol:":le===o.bR.FillExtrusion?"fill-extrusion:":"other:")+Y.id,me=o.m(fe,this.scope),Pe=this._sourceCaches[fe]=new pp(me,Y,le);le===o.bR.Symbol?this._symbolSourceCaches[Y.id]=Pe:le===o.bR.FillExtrusion?this._fillExtrusionSourceCaches[Y.id]=Pe:this._otherSourceCaches[Y.id]=Pe,Pe.onAdd(this.map)};ne(o.bR.Other),"vector"!==E.type&&"geojson"!==E.type||(ne(o.bR.Symbol),"vector"===E.type&&ne(o.bR.FillExtrusion)),Y.onAdd&&Y.onAdd(this.map),V&&async function(le){if(k2(le))return;const fe=hT[le];if(!fe)throw new Error(`Unknown source type "${le}"`);const me=await fe();me&&!k2(le)&&function(Pe,Re){mp[Pe]=Re}(le,me)}(E.type).then(()=>{const le=k2(E.type),fe=this._otherSourceCaches[v];if(!fe||fe.getSource()!==Y)return;if(!le)return void this.fire(new o.f(new Error(`Could not load module for source type "${E.type}".`)));const me=c7(v,E,this.dispatcher,this);me.scope=this.scope,Z(me),fe.setSource(me),me.onAdd&&me.onAdd(this.map),this._changes.setDirty()}),D.isInitialLoad||(this.mergeSources(),this._changes.setDirty())}removeSource(v){this._checkLoaded();const E=this.getOwnSource(v);if(!E)throw new Error("There is no source with this ID");for(const V in this._layers)if(this._layers[V].source===v)return this.fire(new o.f(new Error(`Source "${v}" cannot be removed while layer "${V}" is using it.`)));if(this.terrain&&this.terrain.scope===this.scope&&this.terrain.get().source===v)return this.fire(new o.f(new Error(`Source "${v}" cannot be removed while terrain is using it.`)));if(this.stylesheet.iconsets){const V=Object.entries(this.stylesheet.iconsets).find(([Y,Z])=>"source"===Z.type&&Z.source===v);if(V)return this.fire(new o.f(new Error(`Source "${v}" cannot be removed while iconset "${V[0]}" is using it.`)))}const D=this.getOwnSourceCaches(v);for(const V of D){const Y=o.bV(V.id);delete this._sourceCaches[Y],this._changes.discardSourceCacheUpdate(V.id),V.fire(new o.h("data",{sourceDataType:"metadata",dataType:"source",sourceId:V.getSource().id})),V.setEventedParent(null),V.clearTiles()}return delete this._otherSourceCaches[v],delete this._symbolSourceCaches[v],delete this._fillExtrusionSourceCaches[v],this._hdCoverage&&delete this._hdCoverage.coverageSourceCaches[v],this._hdElevation&&delete this._hdElevation.elevationSourceCaches[o.m(v,this.scope)],this.mergeSources(),E.setEventedParent(null),E.onRemove&&E.onRemove(this.map),this.dispatcher.broadcast("removeSource",{type:E.type,source:v,scope:E.scope}),this._changes.setDirty(),this}setGeoJSONSourceData(v,E){this._checkLoaded(),this.getOwnSource(v).setData(E),this._changes.setDirty()}getOwnSource(v){const E=this.getOwnSourceCache(v);return E&&E.getSource()}getOwnSources(){const v=[];for(const E in this._otherSourceCaches){const D=this.getOwnSourceCache(E);D&&v.push(D.getSource())}return v}areTilesLoaded(){const v=this._mergedSourceCaches;for(const E in v){const D=v[E]._tiles;for(const V in D){const Y=D[V];if("loaded"!==Y.state&&"errored"!==Y.state)return false}}return true}setLights(v){if(this._checkLoaded(),this._programPrecompiler&&this._programPrecompiler.reset(),!v)return delete this.ambientLight,void delete this.directionalLight;const E=this._getTransitionParameters();for(const Y of v){if(this._validate(Zi,"lights",Y))return;switch(Y.type){case"ambient":if(this.ambientLight){const Z=this.ambientLight;Z.set(Y),Z.updateTransitions(E)}else this.ambientLight=new Li(Y,Mo(),this.scope,this.options);break;case"directional":if(this.directionalLight){const Z=this.directionalLight;Z.set(Y),Z.updateTransitions(E)}else this.directionalLight=new Li(Y,fs(),this.scope,this.options)}}const D=Object.assign(E,{worldview:this.map.getWorldview()}),V=new o.ai(this.z||0,D);this.ambientLight&&this.ambientLight.recalculate(V),this.directionalLight&&this.directionalLight.recalculate(V),this._brightness=this.calculateLightsBrightness(),this.dispatcher.broadcast("upsertRenderParams",{brightness:this._brightness})}calculateLightsBrightness(){const v=this.directionalLight,E=this.ambientLight;if(!v||!E)return;const D=Re=>.2126*(Re[0]<=.03928?Re[0]/12.92:Math.pow((Re[0]+.055)/1.055,2.4))+.7152*(Re[1]<=.03928?Re[1]/12.92:Math.pow((Re[1]+.055)/1.055,2.4))+.0722*(Re[2]<=.03928?Re[2]/12.92:Math.pow((Re[2]+.055)/1.055,2.4)),V=v.properties.get("color").toNonPremultipliedRenderColor(null).toArray01(),Y=v.properties.get("intensity"),Z=v.properties.get("direction"),ne=1-o.de(Z.x,Z.y,Z.z)[2]/90,le=D(V)*Y*ne,fe=E.properties.get("color").toNonPremultipliedRenderColor(null).toArray01(),me=E.properties.get("intensity"),Pe=D(fe)*me;return Number(((le+Pe)/2).toFixed(6))}getBrightness(){return this._brightness}getLights(){if(!this.enable3dLights())return null;const v=[];return this.directionalLight&&v.push(this.directionalLight.get()),this.ambientLight&&v.push(this.ambientLight.get()),v}enable3dLights(){return!!this.ambientLight&&!!this.directionalLight}getFragmentStyle(v){if(null==v||""===v&&this.isRootStyle())return this;if(o.df(v)){const E=o.dg(v),D=this.fragments.find(({id:Y})=>Y===E);if(!D)return;const V=o.bV(v);return D.style.getFragmentStyle(V)}{const E=this.fragments.find(({id:D})=>D===v);return E?E.style:void 0}}setFeaturesetSelectors(v){if(!v)return;const E=(D,V="")=>`${D}::${V}`;this._featuresetSelectors={};for(const D in v){const V={},Y=this._featuresetSelectors[D]=[];for(const Z of v[D].selectors){if(Z.featureNamespace){const le=this.getOwnLayer(Z.layer);if(!le){o.w(`Layer is undefined for selector: ${Z.layer}`);continue}const fe=E(le.source,le.sourceLayer);if(fe in V&&V[fe]!==Z.featureNamespace){o.w(`"featureNamespace ${Z.featureNamespace} of featureset ${D}'s selector is not associated to the same source, skip this selector`);continue}V[fe]=Z.featureNamespace}let ne;if(Z.properties)for(const le in Z.properties){const fe=o.c(Z.properties[le]);"success"===fe.result&&(ne=ne||{},ne[le]=fe.value)}Y.push({layerId:Z.layer,namespace:Z.featureNamespace,properties:ne,uniqueFeatureID:Z._uniqueFeatureID})}}}getFeaturesetDescriptors(v){const E=this.getFragmentStyle(v);if(!E||!E.stylesheet.featuresets)return[];const D=[];for(const V in E.stylesheet.featuresets)D.push({featuresetId:V,importId:E.scope?E.scope:void 0});return D}getFeaturesetLayers(v,E){const D=this.getFragmentStyle(E),V=D.stylesheet.featuresets;if(!V||!V[v])return this.fire(new o.f(new Error(`The featureset '${v}' does not exist in the map's style and cannot be queried.`))),[];const Y=[];for(const Z of V[v].selectors){const ne=D.getOwnLayer(Z.layer);ne&&Y.push(ne)}return Y}getConfigProperty(v,E){const D=this.getFragmentStyle(v);if(!D)return null;const V=o.m(E,D.scope),Y=D.options.get(V),Z=Y?Y.value||Y.default:null;return Z?Z.serialize():null}isIndoorEnabled(){return this._indoorEnabled}getIndoorSourceLayers(v,E){const D=o.m(v,E);return this._mergedIndoor[D]}setIndoorData(v,E){this.indoorManager&&this.indoorManager.setIndoorData(E)}updateIndoorDependentLayers(){this._updateLayers(this._dependentLayerIds(v=>v.isIndoorDependent)),this.map._styleDirty=true,this.map.triggerRepaint()}setConfigProperty(v,E,D){const V=this.getFragmentStyle(v);if(!V)return;const Y=V.stylesheet.schema;if(!Y||!Y[E])return;const Z=cA(Y[E],D);if("success"!==Z.result)return void Nv(this,Z.value);const ne=Z.value.expression,le=o.m(E,V.scope),fe=V.options.get(le);if(!fe)return;let me;const{minValue:Pe,maxValue:Re,stepValue:Ke,type:ot,values:at}=Y[E],xt=cA(Y[E],Y[E].default);"success"===xt.result&&(me=xt.value.expression),me?(this.options.set(le,{...fe,value:ne,default:me,minValue:Pe,maxValue:Re,stepValue:Ke,type:ot,values:at}),this.updateConfigDependencies(E)):this.fire(new o.f(new Error(`No schema defined for the config option "${E}" in the "${v}" fragment.`)))}getConfig(v){const E=this.getFragmentStyle(v);if(!E)return null;const D=E.stylesheet.schema;if(!D)return null;const V={};for(const Y in D){const Z=o.m(Y,E.scope),ne=E.options.get(Z),le=ne?ne.value||ne.default:null;V[Y]=le?le.serialize():null}return V}setConfig(v,E){const D=this.getFragmentStyle(v);D&&(D.updateConfig(E,D.stylesheet.schema),this.updateConfigDependencies())}getSchema(v){const E=this.getFragmentStyle(v);return E?E.stylesheet.schema:null}setSchema(v,E){const D=this.getFragmentStyle(v);D&&(D.stylesheet.schema=E,D.updateConfig(D._config,E),this.updateConfigDependencies())}updateConfig(v,E){if(this._config=v,v||E)if(E)for(const D in E){let V,Y;const Z=cA(E[D],E[D].default);if("success"===Z.result&&(V=Z.value.expression),v&&void 0!==v[D]){const Re=cA(E[D],v[D]);"success"===Re.result&&(Y=Re.value.expression)}const{minValue:ne,maxValue:le,stepValue:fe,type:me,values:Pe}=E[D];if(V){const Re=o.m(D,this.scope);this.options.set(Re,{default:V,value:Y,minValue:ne,maxValue:le,stepValue:fe,type:me,values:Pe})}else this.fire(new o.f(new Error(`No schema defined for config option "${D}".`)))}else this.fire(new o.f(new Error("Attempting to set config for a style without schema.")))}_updateLayers(v){for(const E of v){const D=this.getLayer(E);D&&(D.possiblyEvaluateVisibility(),this._updateLayer(D),this._changes.setDirty())}}_dependentLayerIds(v){const E=[];for(const[D,V]of this._layerExpressionDependencies)v(V)&&E.push(D);return E}updateConfigDependencies(v){this._updateLayers(this._dependentLayerIds(E=>v?E.hasConfigDependency(v):E.isConfigDependent)),this.ambientLight&&this.ambientLight.updateConfig(this.options),this.directionalLight&&this.directionalLight.updateConfig(this.options),this.fog&&this.fog.updateConfig(this.options),this.snow&&this.snow.updateConfig(this.options),this.rain&&this.rain.updateConfig(this.options),this.forEachFragmentStyle(E=>{const D=E._styleColorTheme.colorThemeOverride?E._styleColorTheme.colorThemeOverride:E._styleColorTheme.colorTheme;if(D){const V=E._evaluateColorThemeData(D);(!E._styleColorTheme.lut&&""!==V||E._styleColorTheme.lut&&V!==E._styleColorTheme.lut.data)&&E.setColorTheme(D)}}),this._updateIndoorEnabled(),this._changes.setDirty()}addLayer(v,E,D={}){this._checkLoaded();const V=v.id;if(this._layers[V])return void this.fire(new o.f(new Error(`Layer with id "${V}" already exists on this map`)));let Y;if("custom"===v.type){if(Nv(this,o.dh(v)))return;Y=o.di(v,this.scope,this._styleColorTheme.lut,this.options)}else{if("object"==typeof v.source&&(this.addSource(V,v.source),v=o.dd(v),v=Object.assign(v,{source:V})),this._validate(ba,`layers.${V}`,v,{arrayIndex:-1},D))return;Y=o.di(v,this.scope,this._styleColorTheme.lut,this.options),this._validateLayer(Y),Y.setEventedParent(this,{layer:{id:V}})}this._layerExpressionDependencies.set(Y.fqid,new U(Y));let Z=this._order.length;if(E){const me=this._order.indexOf(E);if(-1===me)return void this.fire(new o.f(new Error(`Layer with id "${E}" does not exist on this map.`)));Y.slot&&Y.slot!==this._layers[E].slot?o.w(`Layer with id "${E}" has a different slot. Layers can only be rearranged within the same slot.`):Z=me}this._order.splice(Z,0,V),this._handleLayerOrderChange(),this._layers[V]=Y;const ne=this.getOwnLayerSourceCache(Y),le=!!this.directionalLight&&this.directionalLight.shadowsEnabled();ne&&Y.canCastShadows()&&le&&(ne.castsShadows=true);const fe=this._changes.getRemovedLayer(Y);if(fe&&Y.source&&ne&&"custom"!==Y.type){this._changes.discardLayerRemoval(Y);const me=o.m(Y.source,Y.scope);fe.type!==Y.type?this._changes.updateSourceCache(me,"clear"):(this._changes.updateSourceCache(me,"reload"),ne.pause())}this._updateLayer(Y),Y.onAdd&&Y.onAdd(this.map),Y.scope=this.scope,this.mergeLayers()}moveLayer(v,E){this._checkLoaded();const D=this._checkLayer(v);if(!D)return;if(v===E)return;const V=this._order.indexOf(v);this._order.splice(V,1);let Y=this._order.length;if(E){const Z=this._order.indexOf(E);if(-1===Z)return void this.fire(new o.f(new Error(`Layer with id "${E}" does not exist on this map.`)));D.slot&&D.slot!==this._layers[E].slot?o.w(`Layer with id "${E}" has a different slot. Layers can only be rearranged within the same slot.`):Y=Z}this._order.splice(Y,0,v),this._changes.setDirty(),this._handleLayerOrderChange(),this.mergeLayers()}removeLayer(v){this._checkLoaded();const E=this._checkLayer(v);if(!E)return;E.setEventedParent(null);const D=this._order.indexOf(v);this._order.splice(D,1),delete this._layers[v],this._changes.setDirty(),this._handleLayerOrderChange(),this._layerExpressionDependencies.delete(E.fqid),this._changes.removeLayer(E);const V=this.getOwnLayerSourceCache(E);if(V&&V.castsShadows){let Y=false;for(const Z in this._layers)if(this._layers[Z].source===E.source&&this._layers[Z].canCastShadows()){Y=true;break}V.castsShadows=Y}E.onRemove&&E.onRemove(this.map),this.mergeLayers()}getOwnLayer(v){return this._layers[v]}hasLayer(v){return v in this._mergedLayers}hasLayerType(v){for(const E in this._layers)if(this._layers[E].type===v)return true;return false}setLayerZoomRange(v,E,D){this._checkLoaded();const V=this._checkLayer(v);V&&(V.minzoom===E&&V.maxzoom===D||(null!=E&&(V.minzoom=E),null!=D&&(V.maxzoom=D),this._updateLayer(V)))}getSlots(){return this._checkLoaded(),this._mergedSlots}setSlot(v,E){this._checkLoaded();const D=this._checkLayer(v);D&&D.slot!==E&&(D.slot=E,this._updateLayer(D))}setFilter(v,E,D={}){this._checkLoaded();const V=this._checkLayer(v);if(!V)return;if(o.O(V.filter,E))return;const Y=this._layerExpressionDependencies.get(V.fqid);if(null==E)return V.filter=void 0,Y&&Y.invalidateFilter(),void this._updateLayer(V);this._validate(ut,`layers.${V.id}.filter`,E,{layerType:V.type},D)||(V.filter=o.dd(E),Y&&Y.invalidateFilter(),this._updateLayer(V))}getFilter(v){const E=this._checkLayer(v);if(E)return o.dd(E.filter)}setLayoutProperty(v,E,D,V={}){this._checkLoaded();const Y=this._checkLayer(v);if(Y&&!o.O(Y.getLayoutProperty(E),D)){if(null!=D&&(!V||false!==V.validate)&&Nv(Y,je.call(Ur,{key:`layers.${v}.layout.${E}`,layerType:Y.type,objectKey:E,value:D,styleSpec:o.s,style:{glyphs:true,sprite:true}})))return;Y.setLayoutProperty(E,D),this._updateLayer(Y)}}getLayerProperty(v,E){const D=this._checkLayer(v);if(D){switch(E){case"minzoom":return D.minzoom;case"maxzoom":return D.maxzoom;case"filter":return this.getFilter(v);case"slot":return D.slot;case"appearances":return D.getAppearances().map(V=>V.serialize())}return D.isPaintProperty(E)?this.getPaintProperty(v,E):this.getLayoutProperty(v,E)}}setLayerProperty(v,E,D,V={}){this._checkLoaded();const Y=this._checkLayer(v);if(Y){switch(E){case"appearances":return Y.setAppearances(D),void this._updateLayer(Y);case"minzoom":return this.setLayerZoomRange(v,D);case"maxzoom":return this.setLayerZoomRange(v,null,D);case"filter":return this.setFilter(v,D,V);case"slot":return this.setSlot(v,D)}Y.isPaintProperty(E)?this.setPaintProperty(v,E,D,V):this.setLayoutProperty(v,E,D,V)}}getLayoutProperty(v,E){const D=this._checkLayer(v);if(D)return D.getLayoutProperty(E)}setPaintProperty(v,E,D,V={}){this._checkLoaded();const Y=this._checkLayer(v);Y&&(o.O(Y.getPaintProperty(E),D)||(null==D||V&&false===V.validate||!Nv(Y,ke.call(Ur,{key:`layers.${v}.paint.${E}`,layerType:Y.type,objectKey:E,value:D,styleSpec:o.s})))&&(Y.setPaintProperty(E,D)&&this._updateLayer(Y),this._changes.updatePaintProperties(Y)))}getPaintProperty(v,E){const D=this._checkLayer(v);if(D)return D.getPaintProperty(E)}setFeatureState(v,E){if(this._checkLoaded(),"target"in v){if("featuresetId"in v.target){const{featuresetId:le,importId:fe}=v.target,me=this.getFragmentStyle(fe),Pe=me.getFeaturesetLayers(le);for(const{source:Re,sourceLayer:Ke}of Pe)me.setFeatureState({id:v.id,source:Re,sourceLayer:Ke},E)}else if("layerId"in v.target){const{layerId:le}=v.target,fe=this.getLayer(le);if(!fe)return;const me=this.getFragmentStyle(fe.scope);if(!me)return;me.setFeatureState({id:v.id,source:fe.source,sourceLayer:fe.sourceLayer},E)}return}const D=v.source,V=v.sourceLayer,Y=this._checkSource(D);if(!Y)return;const Z=Y.type;if("geojson"===Z&&V)return void this.fire(new o.f(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));if("vector"===Z&&!V)return void this.fire(new o.f(new Error("The sourceLayer parameter must be provided for vector source types.")));void 0===v.id&&this.fire(new o.f(new Error("The feature id parameter must be provided.")));const ne=this.getOwnSourceCaches(D);for(const le of ne)le.setFeatureState(V,v.id,E)}removeFeatureState(v,E){if(this._checkLoaded(),"target"in v){if("featuresetId"in v.target){const{featuresetId:le,importId:fe}=v.target,me=this.getFragmentStyle(fe),Pe=me.getFeaturesetLayers(le);for(const{source:Re,sourceLayer:Ke}of Pe)me.removeFeatureState({id:v.id,source:Re,sourceLayer:Ke},E)}else if("layerId"in v.target){const{layerId:le}=v.target,fe=this.getLayer(le);if(!fe)return;const me=this.getFragmentStyle(fe.scope);if(!me)return;me.removeFeatureState({id:v.id,source:fe.source,sourceLayer:fe.sourceLayer},E)}return}const D=v.source,V=this._checkSource(D);if(!V)return;const Y=V.type,Z="vector"===Y?v.sourceLayer:void 0;if("vector"===Y&&!Z)return void this.fire(new o.f(new Error("The sourceLayer parameter must be provided for vector source types.")));if(E&&"string"!=typeof v.id&&"number"!=typeof v.id)return void this.fire(new o.f(new Error("A feature id is required to remove its specific state property.")));const ne=this.getOwnSourceCaches(D);for(const le of ne)le.removeFeatureState(Z,v.id,E)}getFeatureState(v){if(this._checkLoaded(),"target"in v){let Y;if("featuresetId"in v.target){const{featuresetId:Z,importId:ne}=v.target,le=this.getFragmentStyle(ne),fe=le.getFeaturesetLayers(Z);for(const{source:me,sourceLayer:Pe}of fe){const Re=le.getFeatureState({id:v.id,source:me,sourceLayer:Pe});if(Re&&!Y)Y=Re;else if(!o.O(Y,Re))return void this.fire(new o.f(new Error("The same feature id exists in multiple sources in the featureset, but their feature states are not consistent through the sources.")))}}else if("layerId"in v.target){const{layerId:Z}=v.target,ne=this.getLayer(Z);if(!ne)return;const le=this.getFragmentStyle(ne.scope);if(!le)return;Y=le.getFeatureState({id:v.id,source:ne.source,sourceLayer:ne.sourceLayer})}return Y}const E=v.source,D=v.sourceLayer,V=this._checkSource(E);if(V){if("vector"!==V.type||D)return void 0===v.id&&this.fire(new o.f(new Error("The feature id parameter must be provided."))),this.getOwnSourceCaches(E)[0].getFeatureState(D,v.id);this.fire(new o.f(new Error("The sourceLayer parameter must be provided for vector source types.")))}}resetFeatureStates(v){if(this._checkLoaded(),"featuresetId"in v){const{featuresetId:E,importId:D}=v,V=this.getFragmentStyle(D);if(!V)return;const Y=V.getFeaturesetLayers(E);for(const{source:Z,sourceLayer:ne}of Y)V.removeFeatureState({source:Z,sourceLayer:ne})}else{const{layerId:E}=v,D=this.getLayer(E);if(!D)return void this.fire(new o.f(new Error(`The layer '${E}' does not exist in the map's style and cannot be used to reset feature states.`)));this.removeFeatureState({source:D.source,sourceLayer:D.sourceLayer})}}setTransition(v){return this.stylesheet.transition={...this.stylesheet.transition,...v},this.transition=this.stylesheet.transition,this}getTransition(){return{...this.stylesheet.transition}}setWorldview(v){v!==this._worldview&&(this._worldview=v,this.dispatcher.broadcast("upsertRenderParams",{worldview:this._worldview}),this.reloadSources())}serialize(){this._checkLoaded();const v=this.getTerrain(),E=v&&this.terrain&&this.terrain.scope===this.scope?v:this.stylesheet.terrain;return o.dj({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,fragment:this.stylesheet.fragment,iconsets:this.stylesheet.iconsets,featuresets:this.stylesheet.featuresets,imports:this._serializeImports(),schema:this.stylesheet.schema,camera:this.stylesheet.camera,light:this.stylesheet.light,lights:this.stylesheet.lights,terrain:E,fog:this.stylesheet.fog,snow:this.stylesheet.snow,rain:this.stylesheet.rain,indoor:this.stylesheet.indoor,center:this.stylesheet.center,"color-theme":this.stylesheet["color-theme"],zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,projection:this.stylesheet.projection,sources:this._serializeSources(),layers:this._serializeLayers(this._order)},D=>void 0!==D)}_updateFilteredLayers(v){for(const E of Object.values(this._mergedLayers))v(E)&&this._updateLayer(E)}_updateLayer(v){this._changes.updateLayer(v);const E=this.getLayerSourceCache(v),D=o.m(v.source,v.scope),V=this._changes.getUpdatedSourceCaches();v.source&&!V[D]&&E&&"raster"!==E.getSource().type&&(this._changes.updateSourceCache(D,"reload"),E.pause()),v.invalidateCompiledFilter()}_flattenAndSortRenderedFeatures(v){const E=ne=>this._mergedLayers[ne].is3D(!!this.terrain),D=this.order,V={},Y=[];for(let ne=D.length-1;ne>=0;ne--){const le=D[ne];if(E(le)){V[le]=ne;for(const fe of v){const me=fe[le];if(me)for(const Pe of me)Y.push(Pe)}}}Y.sort((ne,le)=>le.intersectionZ-ne.intersectionZ);const Z=[];for(let ne=D.length-1;ne>=0;ne--){const le=D[ne];if(E(le))for(let fe=Y.length-1;fe>=0;fe--){const me=Y[fe].feature;if(me.layer&&V[me.layer.id]{if(YF.has(me.type))return;const Pe=this.getOwnLayerSourceCache(me),Re=Y[Pe.id]=Y[Pe.id]||{sourceCache:Pe,layers:{},has3DLayers:false};me.is3D(!!this.terrain)&&(Re.has3DLayers=true),Re.layers[me.fqid]=Re.layers[me.fqid]||{styleLayer:me,targets:[]},Re.layers[me.fqid].targets.push({filter:V})};if(E&&E.layers){if(!Array.isArray(E.layers))return this.fire(new o.f(new Error("parameters.layers must be an Array."))),[];for(const me of E.layers){const Pe=this._layers[me];if(!Pe)return this.fire(new o.f(new Error(`The layer '${me}' does not exist in the map's style and cannot be queried for features.`))),[];Z(Pe)}}else for(const me in this._layers)Z(this._layers[me]);const ne=this._queryRenderedFeatures(v,Y,D),le=this._flattenAndSortRenderedFeatures(ne),fe=[];for(const me of le)o.bW(me.layer.id)===this.scope&&fe.push(me);return fe}queryRenderedFeatureset(v,E,D){let V;E&&!Array.isArray(E)&&E.filter&&(this._validate(ut,"queryRenderedFeatures.filter",E.filter,null,E),V=o.bv(E.filter));const Y="mock",Z=[];if(E&&E.target)Z.push({...E,targetId:Y,filter:V});else{const me=this.getFeaturesetDescriptors();for(const Pe of me)Z.push({targetId:Y,filter:V,target:Pe});for(const{style:Pe}of this.fragments){const Re=Pe.getFeaturesetDescriptors();for(const Ke of Re)Z.push({targetId:Y,filter:V,target:Ke})}}const ne=this.queryRenderedTargets(v,Z,D),le=[],fe=new Set;for(const me of ne)for(const Pe of me.variants[Y])Yae(Pe,me,fe)||le.push(new o.dk(me,Pe));return le}queryRenderedTargets(v,E,D){const V={},Y=(ne,le,fe,me)=>{const Pe=V[le.id]=V[le.id]||{sourceCache:le,layers:{},has3DLayers:false};if(Pe.layers[ne.fqid]=Pe.layers[ne.fqid]||{styleLayer:ne,targets:[]},ne.is3D(!!this.terrain)&&(Pe.has3DLayers=true),!me)return fe.uniqueFeatureID=false,void Pe.layers[ne.fqid].targets.push(fe);Pe.layers[ne.fqid].targets.push({...fe,namespace:me.namespace,properties:me.properties,uniqueFeatureID:me.uniqueFeatureID})};for(const ne of E)if("featuresetId"in ne.target){const{featuresetId:le,importId:fe}=ne.target,me=this.getFragmentStyle(fe);if(!me||!me._featuresetSelectors)continue;const Pe=me._featuresetSelectors[le];if(!Pe){this.fire(new o.f(new Error(`The featureset '${le}' does not exist in the map's style and cannot be queried for features.`)));continue}for(const Re of Pe){const Ke=me.getOwnLayer(Re.layerId);Ke&&!YF.has(Ke.type)&&Y(Ke,me.getOwnLayerSourceCache(Ke),ne,Re)}}else if("layerId"in ne.target){const{layerId:le}=ne.target,fe=this.getLayer(le);if(!fe||YF.has(fe.type))continue;Y(fe,this.getLayerSourceCache(fe),ne)}const Z=this._queryRenderedFeatures(v,V,D);return this._flattenAndSortRenderedFeatures(Z)}_queryRenderedFeatures(v,E,D){const V=[],Y=!!this.map._showQueryGeometry,Z=C2.createFromScreenPoints(v,D);for(const ne in E){const le=qae(Z,E[ne],this._availableImages,D,Y,this.getActualScope());Object.keys(le).length&&V.push(le)}if(this.placement)for(const ne in E){if(E[ne].sourceCache._renderSourceType!==o.bR.Symbol)continue;const le=yOe(Z.screenGeometry,E[ne],this._availableImages,this.placement.collisionIndex,this.placement.retainedQueryData,this.map.getWorldview());Object.keys(le).length&&V.push(le)}return V}querySourceFeatures(v,E){const D=E&&E.filter;D&&this._validate(ut,"querySourceFeatures.filter",D,null,E);let V=[];const Y=this.getOwnSourceCaches(v);for(const Z of Y)V=V.concat(IY(Z,E));return V}getFlatLight(){return this.light.getLight()}setFlatLight(v,E,D={}){this._checkLoaded();const V=this.light.getLight();let Y=false;for(const ne in v)if(!o.O(v[ne],V[ne])){Y=true;break}if(!Y)return;const Z=this._getTransitionParameters();this.light.setLight(v,E,D),this.light.updateTransitions(Z)}hasTerrain(){return!!this.terrain&&1===this.terrain.drapeRenderMode}getTerrain(){return this.hasTerrain()?this.terrain.get():null}setTerrainForDraping(){this.setTerrain({source:"",exaggeration:0},0)}checkCanvasFingerprintNoise(){void 0===this.disableElevatedTerrain&&(this.disableElevatedTerrain=o.e.hasCanvasFingerprintNoise(),this.disableElevatedTerrain&&o.w("Terrain and hillshade are disabled because of Canvas2D limitations when fingerprinting protection is enabled (e.g. in private browsing mode)."))}setTerrain(v,E=1){if(this._checkLoaded(),!v)return this.terrainSetForDrapingOnly()||(delete this.terrain,this.map.transform.projection.requiresDraping&&this.setTerrainForDraping()),0===E&&delete this.terrain,null===v?this.stylesheet.terrain=null:delete this.stylesheet.terrain,this._force3DLayerUpdate(),void(this._markersNeedUpdate=true);this.checkCanvasFingerprintNoise();let D=v;const V=!("source"in v)||null==v.source;if(1===E){if(this.disableElevatedTerrain)return;if("source"in D&&"object"==typeof D.source){const ne="terrain-dem-src";this.addSource(ne,D.source),D=o.dd(D),D=Object.assign(D,{source:ne})}const Y={...D},Z={};if(this.terrain&&V){Y.source=this.terrain.get().source;const ne=this.terrain?this.getFragmentStyle(this.terrain.scope):null;ne&&(Z.style=ne.serialize())}if(this._validate(Fo,"terrain",Y,Z))return}if(!this.terrain||this.terrain.scope!==this.scope&&!V||this.terrain&&E!==this.terrain.drapeRenderMode){if(!D)return;this._createTerrain(D,E),this.fire(new o.h("data",{dataType:"style"}))}else{const Y=this.terrain,Z=Y.get();for(const ne of Object.keys(o.s.terrain))!Object.hasOwn(D,ne)&&o.s.terrain[ne].default&&(D[ne]=o.s.terrain[ne].default);for(const ne in v)if(!o.O(v[ne],Z[ne])){Y.set(v,this.options),this.stylesheet.terrain=v;const le=this._getTransitionParameters({duration:0});Y.updateTransitions(le),this.fire(new o.h("data",{dataType:"style"}));break}}this.mergeTerrain(),this.updateDrapeFirstLayers(),this._markersNeedUpdate=true}_createFog(v){const E=this.fog=new vn(v,this.map.transform,this.scope,this.options);this.stylesheet.fog=E.get();const D=this._getTransitionParameters({duration:0});E.updateTransitions(D)}_createSnow(v){const E=this.snow=new ar(v,this.map.transform,this.scope,this.options);this.stylesheet.snow=E.get();const D=this._getTransitionParameters({duration:0});E.updateTransitions(D)}_createRain(v){const E=this.rain=new oi(v,this.map.transform,this.scope,this.options);this.stylesheet.rain=E.get();const D=this._getTransitionParameters({duration:0});E.updateTransitions(D)}_updateMarkersOpacity(){0!==this.map._markers.length&&this.map._requestDomTask(()=>{for(const v of this.map._markers)v._evaluateOpacity()})}getFog(){return this.fog?this.fog.get():null}setFog(v){if(this._checkLoaded(),v)if(this.fog){const E=this.fog;if(!o.O(E.get(),v)){E.set(v,this.options),this.stylesheet.fog=E.get();const D=this._getTransitionParameters({duration:0});E.updateTransitions(D)}}else this._createFog(v);else delete this.fog,delete this.stylesheet.fog;this._markersNeedUpdate=true,this._programPrecompiler&&this._programPrecompiler.reset()}getSnow(){return this.snow?this.snow.get():null}setSnow(v){if(this._checkLoaded(),!v)return delete this.snow,void delete this.stylesheet.snow;if(this.snow){const E=this.snow;if(!o.O(E.get(),v)){E.set(v,this.options),this.stylesheet.snow=E.get();const D=this._getTransitionParameters({duration:0});E.updateTransitions(D)}}else this._createSnow(v);this._markersNeedUpdate=true}getRain(){return this.rain?this.rain.get():null}setRain(v){if(this._checkLoaded(),!v)return delete this.rain,void delete this.stylesheet.rain;if(this.rain){const E=this.rain;if(!o.O(E.get(),v)){E.set(v,this.options),this.stylesheet.rain=E.get();const D=this._getTransitionParameters({duration:0});E.updateTransitions(D)}}else this._createRain(v);this._markersNeedUpdate=true}_reloadColorTheme(){const v=()=>{for(const V in this._layers)this._layers[V].lut=this._styleColorTheme.lut;for(const V in this._sourceCaches)this._sourceCaches[V].clearTiles()},E=this._styleColorTheme.colorThemeOverride?this._styleColorTheme.colorThemeOverride:this._styleColorTheme.colorTheme;if(!E)return this._styleColorTheme.lut=null,void v();const D=this._evaluateColorThemeData(E);this._loadColorTheme(D).then(()=>{this.fire(new o.h("colorthemeset")),v()}).catch(V=>{o.w(`Couldn't set color theme: ${V}`)})}setColorTheme(v){this._checkLoaded(),this._styleColorTheme.colorThemeOverride&&o.w("Note: setColorTheme is called on a style with a color-theme override, the passed color-theme won't be visible."),this._styleColorTheme.colorTheme=v,this._reloadColorTheme()}setImportColorTheme(v,E){const D=this.getFragmentStyle(v);D&&(D._styleColorTheme.colorThemeOverride=E,D._reloadColorTheme())}_getTransitionParameters(v){return{now:o.e.now(),transition:Object.assign(this.transition,v)}}updateDrapeFirstLayers(){if(!this.terrain)return;const v=[],E=[];for(const D of this._mergedOrder)this.isLayerDraped(this._mergedLayers[D])?v.push(D):E.push(D);this._drapedFirstOrder=[],this._drapedFirstOrder.push(...v),this._drapedFirstOrder.push(...E)}_createTerrain(v,E){const D=this.terrain=new Dt(v,E,this.scope,this.options,this.map.getWorldview());1===E&&(this.stylesheet.terrain=v),this.mergeTerrain(),this.updateDrapeFirstLayers(),this._force3DLayerUpdate();const V=this._getTransitionParameters({duration:0});D.updateTransitions(V)}_force3DLayerUpdate(){for(const v in this._layers){const E=this._layers[v];"fill-extrusion"===E.type&&this._updateLayer(E)}}_forceSymbolLayerUpdate(){for(const v in this._layers){const E=this._layers[v];"symbol"===E.type&&this._updateLayer(E)}}_validate(v,E,D,V,Y={}){if(Y&&false===Y.validate)return false;const Z={...this.serialize()};return Nv(this,v.call(Ur,{key:E,style:Z,value:D,styleSpec:o.s,...V}))}_remove(){this._programPrecompiler&&(this._programPrecompiler.reset(),this._programPrecompiler=null),this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null),o.dl.off("pluginStateChange",this._rtlTextPluginCallback);for(const v in this._mergedLayers)this._mergedLayers[v].setEventedParent(null);for(const v in this._mergedSourceCaches){const E=this._mergedSourceCaches[v];E.clearTiles(),E.setEventedParent(null);const D=E.getSource();D&&D.onRemove&&D.onRemove(this.map)}this.imageManager.removeScope(this.scope),this.imageManager.imageAtlasCache.clear(),this.setEventedParent(null),delete this.fog,delete this.snow,delete this.rain,delete this.terrain,delete this.ambientLight,delete this.directionalLight,this.indoorManager&&this.indoorManager.destroy(),this.isRootStyle()&&(this.imageManager.setEventedParent(null),this.modelManager.setEventedParent(null),this.modelManager.destroy(),this.dispatcher.remove())}clearSource(v){const E=this.getSourceCaches(v);for(const D of E)D.clearTiles()}clearSources(){for(const v in this._mergedSourceCaches)this._mergedSourceCaches[v].clearTiles()}clearLayers(){for(const v in this._mergedLayers){const E=this._mergedLayers[v];E._clear&&E._clear()}}reloadSource(v){const E=this.getSourceCaches(v);for(const D of E)D.resume(),D.reload()}reloadSources(){for(const v of this.getSources())v.reload&&v.reload()}reloadModels(){this.modelManager.reloadModels(""),this.forEachFragmentStyle(v=>{v.modelManager.reloadModels(v.scope)})}updateSources(v){let E;this.directionalLight&&(E=o.dm(this.directionalLight));const D=new Set,V=new Set,Y=new Set;for(const Z in this._mergedLayers){const ne=this._mergedLayers[Z];"building"===ne.type?D.add(ne.source):"raster"===ne.type&&ne.paint&&"ground"===ne.paint.get("raster-elevation-reference")&&Y.add(ne.source),ne.hasElevation()&&!V.has(ne.source)&&V.add(ne.source)}this.updateFrcCoverageFadeRange();for(const Z in this._mergedSourceCaches){const ne=this._mergedSourceCaches[Z],le=V.has(ne._source.id);ne._isRasterElevatedOverTerrain=Y.has(ne._source.id),D.has(ne._source.id)&&(ne._source.reparseOverscaled=false),ne.update(v,void 0,void 0,E,le)}this.updateFrcCoverage(),this.updateElevationCoverage(),To.markElevationIngestSourceCachesUsed&&To.markElevationIngestSourceCachesUsed(this)}_reloadSources(){for(const v in this._sourceCaches){const E=this._sourceCaches[v];E.resume(),E.reload()}}updateFrcCoverageFadeRange(){this.map.painter&&To.updateFrcCoverageFadeRange&&To.updateFrcCoverageFadeRange(this,this.map.painter)}updateFrcCoverage(){this._hdCoverage&&To.updateFrcCoverage&&To.updateFrcCoverage(this,this._hdCoverage)}updateElevationCoverage(){this.isRootStyle()&&To.setupAndUpdateElevationCoverage&&To.setupAndUpdateElevationCoverage(this)}_handleLayerOrderChange(){this._requestFullLabelPlacement(),this.fire(new o.h("neworder"))}_requestFullLabelPlacement(){this.pauseablePlacement||(this.pauseablePlacement=new Qae),this.pauseablePlacement.requestFullPlacement()}_setLabelPlacementStale(){this.placement&&this.placement.setStale()}_updatePlacement(v,E,D,V,Y,Z){this.pauseablePlacement||(this.pauseablePlacement=new Qae);let ne=false,le=false;const fe={},me={};for(const xt of this._mergedOrder){const vt=this._mergedLayers[xt];if("symbol"!==vt.type)continue;const It=o.m(vt.source,vt.scope);let jt=fe[It];if(!jt){const kn=this.getLayerSourceCache(vt);if(!kn)continue;const cn=kn.getRenderableIds(true).map(hn=>kn.getTileByID(hn));me[It]=cn.slice(),jt=fe[It]=cn.sort((hn,xn)=>xn.tileID.overscaledZ-hn.tileID.overscaledZ||(hn.tileID.isLessThan(xn.tileID)?-1:1))}const Zt=this.crossTileSymbolIndex.addLayer(vt,jt,v.center.lng,v.projection);ne=ne||Zt}this.crossTileSymbolIndex.pruneUnusedLayers(this._mergedOrder);const Pe=Boolean(this.placement&&!v.equals(this.placement.transform)),Re=Boolean(this.placement&&(0!==this.placement.lastReplacementSourceUpdateTime&&!Y||this.placement.lastReplacementSourceUpdateTime!==Y.updateTime)),Ke=Pe||Re||ne,ot=(Ke||this.pauseablePlacement.isStale())&&0===D,at=this.pauseablePlacement.isDone()&&!this.placement.stillRecent(o.e.now(),v.zoom)&&0!==D;if((this.pauseablePlacement.isFullPlacementRequested()||!this.pauseablePlacement.placement||ot||at)&&(this.pauseablePlacement=this.pauseablePlacement.startNewPlacement(v,this._mergedOrder,E,D,V,this.placement,this.fog&&v.projection.supportsFog?this.fog.state:null,this._buildingIndex,Z),this.map.painter)){const xt=this.map.painter.maxFrontCutoffRawStart;if(xt>0){const vt=180*v.pitch/Math.PI;if(vt>=15){const It=Math.min(1,Math.max(0,(vt-15)/5)),jt=It*It*(3-2*It);this.pauseablePlacement.placement.frontCutoffStart=-.5*(1-jt)+xt*jt}}}if(this.pauseablePlacement.isDone()?Ke&&0!==D&&this.pauseablePlacement.setStale():(this.pauseablePlacement.continuePlacement(this._mergedOrder,this._mergedLayers,fe,me,this.map.painter.scaleFactor),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(o.e.now()),le=true),ne&&this.pauseablePlacement.setStale()),le||ne){this._buildingIndex.onNewFrame(v.zoom);for(let xt=0;xtY===v.id))return void this.fire(new o.f(new Error(`Import with id '${v.id}' already exists in the map's style.`)));if(!E)return D.push(v),this._loadImports([v],true);const V=D.findIndex(({id:Y})=>Y===E);return-1===V&&this.fire(new o.f(new Error(`Import with id "${E}" does not exist on this map.`))),this.stylesheet.imports=D.slice(0,V).concat(v).concat(D.slice(V)),this._loadImports([v],true,E)}updateImport(v,E){this._checkLoaded();const D=this.stylesheet.imports||[],V=this.getImportIndex(v);return-1===V?this:"string"==typeof E?(this.setImportUrl(v,E),this):(E.url&&E.url!==D[V].url&&this.setImportUrl(v,E.url),o.O(E.config,D[V].config)||this.setImportConfig(v,E.config,E.data.schema),o.O(E.data,D[V].data)||this.setImportData(v,E.data),this)}moveImport(v,E){this._checkLoaded();let D=this.stylesheet.imports||[];const V=this.getImportIndex(v);if(-1===V)return this;const Y=this.getImportIndex(E);if(-1===Y)return this;const Z=D[V],ne=this.fragments[V];return D=D.filter(({id:le})=>le!==v),this.fragments=this.fragments.filter(({id:le})=>le!==v),this.stylesheet.imports=D.slice(0,Y).concat(Z).concat(D.slice(Y)),this.fragments=this.fragments.slice(0,Y).concat(ne).concat(this.fragments.slice(Y)),this.mergeLayers(),this}setImportUrl(v,E){this._checkLoaded();const D=this.stylesheet.imports||[],V=this.getImportIndex(v);if(-1===V)return this;D[V].url=E;const Y=this.fragments[V];return Y.style=this._createFragmentStyle(D[V]),Y.style.on("style.import.load",()=>this.mergeAll()),Y.style.loadURL(E),this}setImportData(v,E){this._checkLoaded();const D=this.getImportIndex(v),V=this.stylesheet.imports||[];return-1===D?this:E?(this.fragments[D].style.setState(E),this._reloadImports(),this):(delete V[D].data,this.setImportUrl(v,V[D].url))}setImportConfig(v,E,D){this._checkLoaded();const V=this.getImportIndex(v),Y=this.stylesheet.imports||[];if(-1===V)return this;E?Y[V].config=E:delete Y[V].config;const Z=this.fragments[V];D&&Z.style.stylesheet&&(Z.style.stylesheet.schema=D);const ne=Z.style.stylesheet&&Z.style.stylesheet.schema;return Z.config=E,Z.style.updateConfig(E,ne),this.updateConfigDependencies(),this}removeImport(v){this._checkLoaded();const E=this.stylesheet.imports||[],D=this.getImportIndex(v);-1!==D&&(E.splice(D,1),this.fragments[D].style._remove(),this.fragments.splice(D,1),this._reloadImports())}getImportIndex(v){const E=(this.stylesheet.imports||[]).findIndex(D=>D.id===v);return-1===E&&this.fire(new o.f(new Error(`Import '${v}' does not exist in the map's style and cannot be updated.`))),E}getLayer(v){return this._mergedLayers[v]}getSources(){const v=[];for(const E in this._mergedOtherSourceCaches){const D=this._mergedOtherSourceCaches[E];D&&v.push(D.getSource())}return v}getSource(v,E){const D=this.getSourceCache(v,E);return D&&D.getSource()}getLayerSource(v){const E=this.getLayerSourceCache(v);return E&&E.getSource()}getSourceCache(v,E){const D=o.m(v,E);return this._mergedOtherSourceCaches[D]}getLayerSourceCache(v){const E=o.m(v.source,v.scope);return"symbol"===v.type?this._mergedSymbolSourceCaches[E]:"fill-extrusion"===v.type?this._mergedFillExtrusionSourceCaches[E]||this._mergedOtherSourceCaches[E]:"fill"===v.type&&v.sourceLayer===o.bU&&this._mergedHdRoadCoverageSourceCaches[E]?this._mergedHdRoadCoverageSourceCaches[E]:this._mergedOtherSourceCaches[E]}getSourceCaches(v){return null==v?Object.values(this._mergedSourceCaches):[this._mergedOtherSourceCaches[v],this._mergedSymbolSourceCaches[v],this._mergedFillExtrusionSourceCaches[v],this._mergedHdRoadCoverageSourceCaches[v],this._mergedHdRoadElevationSourceCaches[v]].filter(Boolean)}updateSourceCaches(){const v=this._changes.getUpdatedSourceCaches();for(const E in v){const D=v[E];"reload"===D?this.reloadSource(E):"clear"===D&&this.clearSource(E)}}updateLayers(v){const E=this._changes.getUpdatedPaintProperties();for(const D of E){const V=this.getLayer(D);V&&V.updateTransitions(v)}}getGlyphsUrl(){return this.stylesheet.glyphs}setGlyphsUrl(v){this.stylesheet.glyphs=v,this.glyphManager.setURL(v)}getOwnSourceCache(v){return this._otherSourceCaches[v]}getOwnLayerSourceCache(v){return"symbol"===v.type?this._symbolSourceCaches[v.source]:"fill-extrusion"===v.type&&this._fillExtrusionSourceCaches[v.source]||this._otherSourceCaches[v.source]}getOwnSourceCaches(v){return[this._otherSourceCaches[v],this._symbolSourceCaches[v],this._fillExtrusionSourceCaches[v],this._hdCoverage&&this._hdCoverage.coverageSourceCaches[v],this._hdElevation&&this._hdElevation.elevationSourceCaches[o.m(v,this.scope)]].filter(Boolean)}_updateHdCoverageSourceCache(v){return To.HdCoverageState&&To.updateHdCoverageSourceCache?(this._hdCoverage||(this._hdCoverage=new To.HdCoverageState),To.updateHdCoverageSourceCache(this,this._hdCoverage,v),false):"fill"===v.type&&v.sourceLayer===o.bU}_isSourceCacheLoaded(v){const E=this.getOwnSourceCaches(v);return 0===E.length?(this.fire(new o.f(new Error(`There is no source with ID '${v}'`))),false):E.every(D=>D.loaded())}has3DLayers(){return this._has3DLayers}hasSymbolLayers(){return this._hasSymbolLayers}hasCircleLayers(){return this._hasCircleLayers}isLayerClipped(v,E){if(!this._clipLayerPresent&&"fill-extrusion"!==v.type&&"building"!==v.type)return false;const D="fill-extrusion"===v.type&&("building"===v.sourceLayer||"procedural_buildings"===v.sourceLayer),V="building"===v.type;if(v.is3D(!!this.terrain)){if(D||V||E&&"batched-model"===E.type)return true;if("model"===v.type)return true}else if("symbol"===v.type)return true;return false}_clearWorkerCaches(){this.dispatcher.broadcast("clearCaches")}getBOMObject(){}destroy(){this._clearWorkerCaches(),this.imageManager.imageAtlasCache.clear(),this.fragments.forEach(v=>{v.style._remove()}),this.terrainSetForDrapingOnly()&&(delete this.terrain,delete this.stylesheet.terrain)}async getImages(v,E){const D=new Promise((le,fe)=>{this.imageManager.getImages(E.icons.concat(E.patterns),E.scope,(me,Pe)=>{me?fe(me):le(Pe)})});this._updateTilesForChangedImages();const V=E.icons.map(le=>o.I.toString(le)),Y=E.patterns.map(le=>o.I.toString(le)),Z=le=>{le&&(le.setDependencies(E.tileID.key,"icons",V),le.setDependencies(E.tileID.key,"patterns",Y))},ne=o.m(E.source,E.scope);return Z(this._mergedOtherSourceCaches[ne]),Z(this._mergedSymbolSourceCaches[ne]),(E.icons.some(le=>le.iconsetId)||E.patterns.some(le=>le.iconsetId))&&this.fire(new o.h("data",{dataType:"style"})),D}async rasterizeImages(v,E){return new Promise((D,V)=>{this.imageManager.rasterizeImages(E,(Y,Z)=>{Y?V(Y):D(Z)})})}async checkAtlasCache(v,E){const D=this.imageManager.imageAtlasCache.findCachedAtlas(E.descriptor);return D&&D.contentDescriptor?{iconPositions:D.iconPositions,patternPositions:D.patternPositions,sourceHash:D.contentDescriptor.hash}:null}async getGlyphs(v,E){return new Promise((D,V)=>{this.glyphManager.getGlyphs(E.stacks,(Y,Z)=>{Y?V(Y):D(Z)})})}}I2.registerForPluginStateChange=o.d6;class rse{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffers=[],this.vao=null}bind(v,E,D,V,Y,Z,ne,le){this.context=v;let fe=this.boundPaintVertexBuffers.length!==V.length;for(let Pe=0;!fe&&Pe{const kn=jt.paint.get("hillshade-shadow-color"),cn="none"===jt.paint.get("hillshade-shadow-color-use-theme").constantOr("default"),hn=jt.paint.get("hillshade-highlight-color"),xn="none"===jt.paint.get("hillshade-highlight-color-use-theme").constantOr("default"),wn=jt.paint.get("hillshade-accent-color"),Bn="none"===jt.paint.get("hillshade-accent-color-use-theme").constantOr("default"),Kn=jt.paint.get("hillshade-emissive-strength");let Wn=o.au(jt.paint.get("hillshade-illumination-direction"));if("viewport"===jt.paint.get("hillshade-illumination-anchor"))Wn-=vt.transform.angle;else if(vt.style&&vt.style.enable3dLights()&&vt.style.directionalLight){const Vn=vt.style.directionalLight.properties.get("direction"),Zr=o.de(Vn.x,Vn.y,Vn.z);Wn=o.au(Zr[1])}const Yn=!vt.options.moving;return{u_matrix:Zt||vt.transform.calculateProjMatrix(It.tileID.toUnwrapped(),Yn),u_image:0,u_latrange:ise(0,It.tileID),u_light:[jt.paint.get("hillshade-exaggeration"),Wn],u_shadow:kn.toPremultipliedRenderColor(cn?null:jt.lut),u_highlight:hn.toPremultipliedRenderColor(xn?null:jt.lut),u_emissive_strength:Kn,u_accent:wn.toPremultipliedRenderColor(Bn?null:jt.lut)}})(k,E,D,k.terrain?v.projMatrix:null);k.uploadCommonUniforms(ne,Re,v.toUnwrapped());const{tileBoundsBuffer:ot,tileBoundsIndexBuffer:at,tileBoundsSegments:xt}=k.getTileBoundsBuffers(E);Re.draw(k,le.TRIANGLES,V,Y,Z,o.$.disabled,Ke,D.id,ot,at,xt)}function $Y(k,v,E){if(!v.needsDEMTextureUpload)return;const D=k.context,V=D.gl;D.pixelStoreUnpackPremultiplyAlpha.set(false),v.demTexture=v.demTexture||k.getTileTexture(E.stride);const Y=E.getPixels();v.demTexture?v.demTexture.update(Y,{premultiply:false}):v.demTexture=new o.T(D,Y,V.R32F,{premultiply:false}),v.needsDEMTextureUpload=false}function wOe(k,v,E){const D=k.context,V=D.gl;if(!v.dem)return;const Y=v.dem;if(D.activeTexture.set(V.TEXTURE1),$Y(k,v,Y),!v.demTexture)return;v.demTexture.bind(V.NEAREST,V.CLAMP_TO_EDGE);const Z=Y.dim;D.activeTexture.set(V.TEXTURE0);let ne=v.hillshadeFBO;if(!ne){const Re=new o.T(D,{width:Z,height:Z,data:null},V.RGBA8);Re.bind(V.LINEAR,V.CLAMP_TO_EDGE),ne=v.hillshadeFBO=D.createFramebuffer(Z,Z,1,"renderbuffer"),ne.colorAttachment0.set(Re.texture)}D.bindFramebuffer.set(ne.framebuffer),D.viewport.set([0,0,Z,Z]);const{tileBoundsBuffer:le,tileBoundsIndexBuffer:fe,tileBoundsSegments:me}=k.getMercatorTileBoundsBuffers(),Pe=[];k.linearFloatFilteringSupported()&&Pe.push("TERRAIN_DEM_FLOAT_FORMAT"),k.terrain&&k.terrain.renderingToTexture&&"mrt-fallback"===k.emissiveMode&&Pe.push("USE_MRT1"),k.getOrCreateProgram("hillshadePrepare",{defines:Pe}).draw(k,V.TRIANGLES,o.Z.disabled,o._.disabled,o.a1.unblended,o.$.disabled,((Re,Ke)=>{const ot=Ke.stride,at=o.Y();return o.dq(at,0,o.a2,-o.a2,0,0,1),o.bM(at,at,[0,-o.a2,0]),{u_matrix:at,u_image:1,u_dimension:[ot,ot],u_zoom:Re.overscaledZ}})(v.tileID,Y),E.id,le,fe,me),v.needsHillshadePrepare=false}class Jl{constructor(v){this.gl=v.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=false}get(){return this.current}set(v){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class EOe extends Jl{getDefault(){return o.C.transparent.toNonPremultipliedRenderColor(null)}set(v){const E=this.current;(v.r!==E.r||v.g!==E.g||v.b!==E.b||v.a!==E.a||this.dirty)&&(this.gl.clearColor(v.r,v.g,v.b,v.a),this.current=v,this.dirty=false)}}class GY extends Jl{getDefault(){return 1}set(v){(v!==this.current||this.dirty)&&(this.gl.clearDepth(v),this.current=v,this.dirty=false)}}class HY extends Jl{getDefault(){return 0}set(v){(v!==this.current||this.dirty)&&(this.gl.clearStencil(v),this.current=v,this.dirty=false)}}class WY extends Jl{getDefault(){return[true,true,true,true]}set(v){const E=this.current;(v[0]!==E[0]||v[1]!==E[1]||v[2]!==E[2]||v[3]!==E[3]||this.dirty)&&(this.gl.colorMask(v[0],v[1],v[2],v[3]),this.current=v,this.dirty=false)}}class YY extends Jl{getDefault(){return true}set(v){(v!==this.current||this.dirty)&&(this.gl.depthMask(v),this.current=v,this.dirty=false)}}class ose extends Jl{getDefault(){return 255}set(v){(v!==this.current||this.dirty)&&(this.gl.stencilMask(v),this.current=v,this.dirty=false)}}class ase extends Jl{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(v){const E=this.current;(v.func!==E.func||v.ref!==E.ref||v.mask!==E.mask||this.dirty)&&(this.gl.stencilFunc(v.func,v.ref,v.mask),this.current=v,this.dirty=false)}}class COe extends Jl{getDefault(){const v=this.gl;return[v.KEEP,v.KEEP,v.KEEP]}set(v){const E=this.current;(v[0]!==E[0]||v[1]!==E[1]||v[2]!==E[2]||this.dirty)&&(this.gl.stencilOp(v[0],v[1],v[2]),this.current=v,this.dirty=false)}}class XF extends Jl{getDefault(){return false}set(v){if(v===this.current&&!this.dirty)return;const E=this.gl;v?E.enable(E.STENCIL_TEST):E.disable(E.STENCIL_TEST),this.current=v,this.dirty=false}}class jF extends Jl{getDefault(){return[0,1]}set(v){const E=this.current;(v[0]!==E[0]||v[1]!==E[1]||this.dirty)&&(this.gl.depthRange(v[0],v[1]),this.current=v,this.dirty=false)}}class sse extends Jl{getDefault(){return false}set(v){if(v===this.current&&!this.dirty)return;const E=this.gl;v?E.enable(E.DEPTH_TEST):E.disable(E.DEPTH_TEST),this.current=v,this.dirty=false}}class h0 extends Jl{getDefault(){return this.gl.LESS}set(v){(v!==this.current||this.dirty)&&(this.gl.depthFunc(v),this.current=v,this.dirty=false)}}class qY extends Jl{getDefault(){return false}set(v){if(v===this.current&&!this.dirty)return;const E=this.gl;v?E.enable(E.BLEND):E.disable(E.BLEND),this.current=v,this.dirty=false}}class p7 extends Jl{getDefault(){const v=this.gl;return[v.ONE,v.ZERO,v.ONE,v.ZERO]}set(v){const E=this.current;(v[0]!==E[0]||v[1]!==E[1]||v[2]!==E[2]||v[3]!==E[3]||this.dirty)&&(this.gl.blendFuncSeparate(v[0],v[1],v[2],v[3]),this.current=v,this.dirty=false)}}class SOe extends Jl{getDefault(){return o.C.transparent.toNonPremultipliedRenderColor(null)}set(v){const E=this.current;(v.r!==E.r||v.g!==E.g||v.b!==E.b||v.a!==E.a||this.dirty)&&(this.gl.blendColor(v.r,v.g,v.b,v.a),this.current=v,this.dirty=false)}}class m7 extends Jl{getDefault(){return this.gl.FUNC_ADD}set(v){(v!==this.current||this.dirty)&&(this.gl.blendEquationSeparate(v,v),this.current=v,this.dirty=false)}}class XY extends Jl{getDefault(){return false}set(v){if(v===this.current&&!this.dirty)return;const E=this.gl;v?E.enable(E.CULL_FACE):E.disable(E.CULL_FACE),this.current=v,this.dirty=false}}class jY extends Jl{getDefault(){return this.gl.BACK}set(v){(v!==this.current||this.dirty)&&(this.gl.cullFace(v),this.current=v,this.dirty=false)}}class KY extends Jl{getDefault(){return this.gl.CCW}set(v){(v!==this.current||this.dirty)&&(this.gl.frontFace(v),this.current=v,this.dirty=false)}}let ZY=class extends Jl{getDefault(){return null}set(k){(k!==this.current||this.dirty)&&(this.gl.useProgram(k),this.current=k,this.dirty=false)}};class g7 extends Jl{getDefault(){return this.gl.TEXTURE0}set(v){(v!==this.current||this.dirty)&&(this.gl.activeTexture(v),this.current=v,this.dirty=false)}}class lse extends Jl{getDefault(){const v=this.gl;return[0,0,v.drawingBufferWidth,v.drawingBufferHeight]}set(v){const E=this.current;(v[0]!==E[0]||v[1]!==E[1]||v[2]!==E[2]||v[3]!==E[3]||this.dirty)&&(this.gl.viewport(v[0],v[1],v[2],v[3]),this.current=v,this.dirty=false)}}class cse extends Jl{getDefault(){return null}set(v){if(v===this.current&&!this.dirty)return;const E=this.gl;E.bindFramebuffer(E.FRAMEBUFFER,v),this.current=v,this.dirty=false}}class rI extends Jl{getDefault(){return null}set(v){if(v===this.current&&!this.dirty)return;const E=this.gl;E.bindRenderbuffer(E.RENDERBUFFER,v),this.current=v,this.dirty=false}}class AOe extends Jl{getDefault(){return null}set(v){if(v===this.current&&!this.dirty)return;const E=this.gl;E.bindTexture(E.TEXTURE_2D,v),this.current=v,this.dirty=false}}class kOe extends Jl{getDefault(){return null}set(v){if(v===this.current&&!this.dirty)return;const E=this.gl;E.bindBuffer(E.ARRAY_BUFFER,v),this.current=v,this.dirty=false}}class ROe extends Jl{getDefault(){return null}set(v){const E=this.gl;E.bindBuffer(E.ELEMENT_ARRAY_BUFFER,v),this.current=v,this.dirty=false}}class POe extends Jl{getDefault(){return null}set(v){this.gl&&(v!==this.current||this.dirty)&&(this.gl.bindVertexArray(v),this.current=v,this.dirty=false)}}class IOe extends Jl{getDefault(){return 4}set(v){if(v===this.current&&!this.dirty)return;const E=this.gl;E.pixelStorei(E.UNPACK_ALIGNMENT,v),this.current=v,this.dirty=false}}class MOe extends Jl{getDefault(){return false}set(v){if(v===this.current&&!this.dirty)return;const E=this.gl;E.pixelStorei(E.UNPACK_PREMULTIPLY_ALPHA_WEBGL,v),this.current=v,this.dirty=false}}class JY extends Jl{getDefault(){return false}set(v){if(v===this.current&&!this.dirty)return;const E=this.gl;E.pixelStorei(E.UNPACK_FLIP_Y_WEBGL,v),this.current=v,this.dirty=false}}class KF extends Jl{constructor(v,E){super(v),this.context=v,this.parent=E}getDefault(){return null}}class iI extends KF{constructor(v,E,D=0){super(v,E),this.attachmentPoint=v.gl.COLOR_ATTACHMENT0+D}setDirty(){this.dirty=true}set(v){if(v===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const E=this.gl;E.framebufferTexture2D(E.FRAMEBUFFER,this.attachmentPoint,E.TEXTURE_2D,v,0),this.current=v,this.dirty=false}}class dA extends KF{attachment(){return this.gl.DEPTH_ATTACHMENT}set(v){if(v===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const E=this.gl;E.framebufferRenderbuffer(E.FRAMEBUFFER,this.attachment(),E.RENDERBUFFER,v),this.current=v,this.dirty=false}}class use extends KF{attachment(){return this.gl.DEPTH_ATTACHMENT}set(v){if(v===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const E=this.gl;E.framebufferTexture2D(E.FRAMEBUFFER,this.attachment(),E.TEXTURE_2D,v,0),this.current=v,this.dirty=false}}class dse extends dA{attachment(){return this.gl.DEPTH_STENCIL_ATTACHMENT}}const fse=(k,v,E,D)=>({u_matrix:k,u_image0:0,u_image1:1,u_skirt_height:v,u_ground_shadow_factor:E,u_emissive_texture_available:D}),y7=(k,v,E,D,V,Y,Z,ne,le,fe,me,Pe,Re,Ke,ot,at,xt)=>({u_proj_matrix:Float32Array.from(k),u_globe_matrix:v,u_normalize_matrix:Float32Array.from(D),u_merc_matrix:E,u_zoom_transition:V,u_merc_center:Y,u_image0:0,u_image1:1,u_frustum_tl:Z,u_frustum_tr:ne,u_frustum_br:le,u_frustum_bl:fe,u_globe_pos:me,u_globe_radius:Pe,u_viewport:Re,u_grid_matrix:xt?Float32Array.from(xt):new Float32Array(9),u_skirt_height:Ke,u_far_z_cutoff:ot,u_emissive_texture_available:at});function pT(k,v){return null!=k&&null!=v&&!(!k.hasData()||!v.hasData())&&null!=k.demTexture&&null!=v.demTexture&&k.tileID.key!==v.tileID.key}const M2=new class{constructor(){this.operations={}}newMorphing(k,v,E,D,V){if(k in this.operations){const Y=this.operations[k];Y.to.tileID.key!==E.tileID.key&&(Y.queued=E)}else this.operations[k]={startTime:D,phase:0,duration:V,from:v,to:E,queued:null}}getMorphValuesForProxy(k){if(!(k in this.operations))return null;const v=this.operations[k];return{from:v.from,to:v.to,phase:v.phase}}update(k){for(const v in this.operations){const E=this.operations[v];for(E.phase=(k-E.startTime)/E.duration;E.phase>=1||!this._validOp(E);)if(!this._nextOp(E,k)){delete this.operations[v];break}}}_nextOp(k,v){return!!k.queued&&(k.from=k.to,k.to=k.queued,k.queued=null,k.phase=0,k.startTime=v,true)}_validOp(k){return k.from.hasData()&&k.to.hasData()}};function ZF(k,v,E){if(0===v)return 0;const D=v<1&&514===E?.25/v:1;return 6*Math.pow(1.5,22-k)*Math.max(v,1)*D}function b7(k,v){const E=1<{if(Y[Z.key]="",!this._tiles[Z.key]){const ne=new Mv(Z,this._source.tileSize*Z.overscaleFactor(),v.tileZoom,void 0,void 0,this._source.worldview);ne.state="loaded",this._tiles[Z.key]=ne}return Y},{});for(const Y in this._tiles)Y in V||(this.freeFBO(Y),this._tiles[Y].unloadVectorData(),delete this._tiles[Y])}freeFBO(v){const E=this.proxyCachedFBO[v];if(void 0!==E){const D=Object.values(E);this.renderCachePool.push(...D),delete this.proxyCachedFBO[v]}}deallocRenderCache(){this.renderCache.forEach(v=>v.fb.destroy()),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}}class JF extends o.bP{constructor(v,E,D){super(v.overscaledZ,v.wrap,v.canonical.z,v.canonical.x,v.canonical.y),this.proxyTileKey=E,this.projMatrix=D}}class eq extends o.cW{constructor(v,E){super(),this.painter=v,this.terrainTileForTile={},this.prevTerrainTileForTile={};const[D,V,Y]=function(){const le=new o.bC,fe=new o.ad,me=131;le.reserve(17161),fe.reserve(33800);const Pe=o.a2/128,Re=o.a2+Pe/2,Ke=Re+Pe;for(let at=-Pe;atRe||at<0||at>Re?24575:0,It=o.b0(Math.round(xt),0,o.a2),jt=o.b0(Math.round(at),0,o.a2);le.emplaceBack(It+vt,jt)}const ot=(at,xt)=>{const vt=xt*me+at;fe.emplaceBack(vt+1,vt,vt+me),fe.emplaceBack(vt+me,vt+me+1,vt+1)};for(let at=1;at<129;at++)for(let xt=1;xt<129;xt++)ot(xt,at);return[0,129].forEach(at=>{for(let xt=0;xt<130;xt++)ot(xt,at),ot(at,xt)}),[le,fe,32768]}(),Z=v.context;this.gridBuffer=Z.createVertexBuffer(D,o.bE.members),this.gridIndexBuffer=Z.createIndexBuffer(V),this.gridSegments=o.ac.simpleSegment(0,0,D.length,V.length),this.gridNoSkirtSegments=o.ac.simpleSegment(0,0,D.length,Y),this.proxyCoords=[],this.proxiedCoords={},this._visibleDemTiles=[],this._drapedRenderBatches=[],this._sourceTilesOverlap={},this.proxySourceCache=new QY(E.map),this.orthoMatrix=o.Y(),o.dq(this.orthoMatrix,"globe"===this.painter.transform.projection.name?.015:0,o.a2,0,o.a2,0,1);const ne=Z.gl;this._overlapStencilMode=new o._({func:ne.GEQUAL,mask:255},0,255,ne.KEEP,ne.KEEP,ne.REPLACE),this._previousZoom=v.transform.zoom,this.pool=[],this._findCoveringTileCache={},this._tilesDirty={},this.style=E,this._useVertexMorphing=true,this._exaggeration=1,this._mockSourceCache=new L2(E.map),this._pendingGroundEffectLayers=[],this._emissiveTexture=false,this._devtoolsFolder=null}set style(v){v.on("data",this._onStyleDataEvent.bind(this)),this._style=v,this._style.map.on("moveend",()=>{this._clearLineLayersFromRenderCache()})}update(v,E,D){if(v&&v.terrain){this._style!==v&&(this.style=v,this._evaluationZoom=void 0);const V=v.terrain.properties,Y=0===v.terrain.drapeRenderMode,Z=v.terrain.isZoomDependent();this._previousUpdateTimestamp=this.enabled?this._updateTimestamp:void 0,this._updateTimestamp=o.e.now();const ne=v.terrain&&v.terrain.scope,le=V.get("source"),fe=Y?this._mockSourceCache:v.getSourceCache(le,ne);if(!fe)return void o.w(`Couldn't find terrain source "${le}".`);if(this.sourceCache=fe,this._attenuationRange=v.terrain.getAttenuationRange(),this._exaggeration=Z?this.calculateExaggeration(E):V.get("exaggeration"),!E.projection.requiresDraping&&Z&&0===this._exaggeration)return void this._disable();this.enabled=true;const me=()=>{this.sourceCache.used&&o.w(`Raster DEM source '${this.sourceCache.id}' is used both for terrain and as layer source. +This leads to lower resolution of hillshade. For full hillshade resolution but higher memory consumption, define another raster DEM source.`);const Pe=this.getScaledDemTileSize();this.sourceCache.update(E,Pe,true),this.resetTileLookupCache(this.sourceCache.id)};this.sourceCache.usedForTerrain||(this.resetTileLookupCache(this.sourceCache.id),this.sourceCache.usedForTerrain=true,me(),this._initializing=true),me(),E.updateElevation(true,D),this.resetTileLookupCache(this.proxySourceCache.id),this.proxySourceCache.update(E),this._emptyDEMTextureDirty=true,this._previousZoom=E.zoom}else this._disable()}calculateExaggeration(v){if(this._attenuationRange&&v.zoom>=Math.ceil(this._attenuationRange[1]))return this._style.terrain.getExaggeration(v.zoom);const E=this._previousCameraAltitude,D=v.getFreeCameraOptions().position.z/v.pixelsPerMeter*v.worldSize;this._previousCameraAltitude=D;const V=null!=E?D-E:Number.MAX_VALUE;if(Math.abs(V)<2)return this._exaggeration;const Y=v.zoom,Z=this._style.terrain;if(!this._previousUpdateTimestamp)return Z.getExaggeration(Y);let ne=Y-this._previousZoom;const le=this._previousUpdateTimestamp;let fe=Y;null!=this._evaluationZoom&&(fe=this._evaluationZoom,Math.abs(Y-fe)>.5&&(ne=.5*(Y-fe+ne)),ne*V<0&&(fe+=ne)),this._evaluationZoom=fe;const me=Z.getExaggeration(fe),Pe=me===Z.getExaggeration(Math.max(0,fe-.1));if(Pe&&Math.abs(me-this._exaggeration)<.01)return me;let Re=Math.min(.1,.00375*(this._updateTimestamp-le));return(Pe||me<.1||Math.abs(ne)<1e-4)&&(Re=Math.min(.2,4*Re)),o.al(this._exaggeration,me,Re)}resetTileLookupCache(v){this._findCoveringTileCache[v]={}}attenuationRange(){return this._attenuationRange}getDemUpscale(){return this.proxySourceCache.getSource().tileSize/128}getScaledDemTileSize(){return this.sourceCache.getSource().tileSize/128*this.proxySourceCache.getSource().tileSize}_onStyleDataEvent(v){"source"===v.dataType&&v.coord?this._clearRenderCacheForTile(v.sourceCacheId,v.coord):"style"===v.dataType&&(this.invalidateRenderCache=true,this._evaluationZoom=void 0,this._previousUpdateTimestamp=void 0,this._previousCameraAltitude=void 0)}_disable(){if(this.enabled&&(this.enabled=false,this._emptyDEMTextureDirty=true,this._sharedDepthStencil=void 0,this._evaluationZoom=void 0,this._previousUpdateTimestamp=void 0,this.proxySourceCache.deallocRenderCache(),this._style))for(const v in this._style._mergedSourceCaches)this._style._mergedSourceCaches[v].usedForTerrain=false}destroy(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this.pool.forEach(v=>v.fb.destroy()),this.pool=[],this.framebufferCopyTexture&&this.framebufferCopyTexture.destroy()}_source(){return this.enabled?this.sourceCache:null}isUsingMockSource(){return this.sourceCache===this._mockSourceCache}exaggeration(){return this.enabled?this._exaggeration:0}get visibleDemTiles(){return this._visibleDemTiles}get drapeBufferSize(){const v=2*this.proxySourceCache.getSource().tileSize;return[v,v]}set useVertexMorphing(v){this._useVertexMorphing=v}updateTileBinding(v){if(!this.enabled)return;this.prevTerrainTileForTile=this.terrainTileForTile;const E=this.proxySourceCache,D=this.painter.transform;this._initializing&&(this._initializing=0===D._centerAltitude&&-1===this.getAtPointOrZero(o.bS.fromLngLat(D.center),-1),this._emptyDEMTextureDirty=!this._initializing);const V=this.proxyCoords=E.getIds().map(le=>{const fe=E.getTileByID(le).tileID;return fe.projMatrix=D.calculateProjMatrix(fe.toUnwrapped()),fe});!function(le,fe){const me=fe.transform.pointCoordinate(fe.transform.getCameraPoint()),Pe=new o.P(me.x,me.y);le.sort((Re,Ke)=>{if(Ke.overscaledZ-Re.overscaledZ)return Ke.overscaledZ-Re.overscaledZ;const ot=new o.P(Re.canonical.x+(1<{this.proxyToSource[le.key]={}}),this.terrainTileForTile={};const Z=this._style._mergedSourceCaches;for(const le in Z){const fe=Z[le];if(!fe.used)continue;if(!fe.transform)continue;if(fe!==this.sourceCache&&this.resetTileLookupCache(fe.id),this._setupProxiedCoordsForOrtho(fe,v[le],Y),fe.usedForTerrain)continue;const me=v[le];(fe.getSource().reparseOverscaled||fe._isRasterElevatedOverTerrain)&&this._assignTerrainTiles(me)}this.proxiedCoords[E.id]=V.map(le=>new JF(le,le.key,this.orthoMatrix)),this._assignTerrainTiles(V),this._prepareDEMTextures(),this._setupDrapedRenderBatches(),this._initFBOPool(),this._setupRenderCache(Y),this.renderingToTexture=false;const ne={};this._visibleDemTiles=[];for(const le of this.proxyCoords){const fe=this.terrainTileForTile[le.key];if(!fe)continue;const me=fe.tileID.key;me in ne||(this._visibleDemTiles.push(fe),ne[me]=me)}}_assignTerrainTiles(v){this._initializing||v.forEach(E=>{if(this.terrainTileForTile[E.key])return;const D=this._findTileCoveringTileID(E,this.sourceCache);D&&(this.terrainTileForTile[E.key]=D)})}_prepareDEMTextures(){const v=this.painter.context,E=v.gl;for(const D in this.terrainTileForTile){const V=this.terrainTileForTile[D],Y=V.dem;!Y||V.demTexture&&!V.needsDEMTextureUpload||(v.activeTexture.set(E.TEXTURE1),$Y(this.painter,V,Y))}}_prepareDemTileUniforms(v,E,D,V){if(!E||null==E.demTexture)return false;const Y=v.tileID.canonical,Z=Math.pow(2,E.tileID.canonical.z-Y.z),ne=V||"";return D[`u_dem_tl${ne}`]=[Y.x*Z%1,Y.y*Z%1],D[`u_dem_scale${ne}`]=Z,true}get emptyDEMTexture(){return!this._emptyDEMTextureDirty&&this._emptyDEMTexture?this._emptyDEMTexture:this._updateEmptyDEMTexture()}_getLoadedAreaMinimum(){if(!this.enabled)return 0;let v=0;const E=this._visibleDemTiles.reduce((D,V)=>{if(!V.dem)return D;const Y=V.dem.tree.minimums[0];return Y>0&&v++,D+Y},0);return v?E/v:0}_updateEmptyDEMTexture(){const v=this.painter.context,E=v.gl;v.activeTexture.set(E.TEXTURE2);const D=this._getLoadedAreaMinimum(),V=new o.du({width:1,height:1},new Float32Array([D]));this._emptyDEMTextureDirty=false;let Y=this._emptyDEMTexture;return Y?Y.update(V,{premultiply:false}):Y=this._emptyDEMTexture=new o.T(v,V,E.R32F,{premultiply:false}),Y}setupElevationDraw(v,E,D){const V=this.painter.context,Y=V.gl,Z={u_dem:2,u_dem_prev:4,u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_depth_range_unpack:[0,1],u_occluder_half_size:16,u_occlusion_depth_offset:-1e-4,u_exaggeration:0};Z.u_exaggeration=this.exaggeration();let ne=null,le=null,fe=1;if(D&&D.morphing&&this._useVertexMorphing){const Ke=D.morphing.srcDemTile,ot=D.morphing.dstDemTile;fe=D.morphing.phase,Ke&&ot&&(this._prepareDemTileUniforms(v,Ke,Z,"_prev")&&(le=Ke),this._prepareDemTileUniforms(v,ot,Z)&&(ne=ot))}const me=Ke=>Ke&&Ke.demTexture&&this.painter.linearFloatFilteringSupported()?Y.LINEAR:Y.NEAREST;let Pe=null;var Re;if(this.enabled?le&&ne?(Pe=ne.demTexture,V.activeTexture.set(Y.TEXTURE4),le.demTexture.bind(me(le),Y.CLAMP_TO_EDGE),Z.u_dem_lerp=fe):(ne=this.terrainTileForTile[v.tileID.key],Pe=this._prepareDemTileUniforms(v,ne,Z)?ne.demTexture:this.emptyDEMTexture):Pe=this.emptyDEMTexture,V.activeTexture.set(Y.TEXTURE2),Pe&&(Z.u_dem_size=1===(Re=Pe).size[0]?1:Re.size[0]-2,Pe.bind(me(ne),Y.CLAMP_TO_EDGE)),this.painter.setupDepthForOcclusion(D&&D.useDepthForOcclusion,E,Z),D&&D.useMeterToDem&&ne){const Ke=(1<{if(vt===Vn)return;const Zr=[];1===Vn&&Zr.push("TERRAIN_VERTEX_MORPHING"),Zr.push("PROJECTION_GLOBE_VIEW"),jt&&Zr.push("CUSTOM_ANTIALIASING");const Qn=fe.isTileAffectedByFog(Yn);xt=fe.getOrCreateProgram("globeRaster",{defines:Zr,overrideFog:Qn}),vt=Vn},kn=fe.colorModeForRenderPass(),cn=new o.Z(at.LEQUAL,o.Z.ReadWrite,fe.depthRangeFor3D);M2.update(Ke);const hn=o.b6(It),xn=[o.a7(It.center.lng),o.a8(It.center.lat)],wn=fe.globeSharedBuffers,Bn=[It.width*o.e.devicePixelRatio,It.height*o.e.devicePixelRatio],Kn=Float32Array.from(It.globeMatrix),Wn={useDenormalizedUpVectorScale:true};{const Yn=fe.transform,Vn=ZF(Yn.zoom,me.exaggeration(),me.sourceCache._source.tileSize);vt=-1;const Zr=at.TRIANGLES;for(const Qn of Re){const kr=Pe.getTile(Qn),Vr=o._.disabled,mi=me.prevTerrainTileForTile[Qn.key],si=me.terrainTileForTile[Qn.key];pT(mi,si)&&M2.newMorphing(Qn.key,mi,si,Ke,250),x7(fe,kr.emissiveTexture),ot.activeTexture.set(at.TEXTURE0),kr.texture&&kr.texture.bind(at.LINEAR,at.CLAMP_TO_EDGE);const Kr=M2.getMorphValuesForProxy(Qn.key),qi=Kr?1:0;Kr&&Object.assign(Wn,{morphing:{srcDemTile:Kr.from,dstDemTile:Kr.to,phase:o.dr(Kr.phase)}});const Wr=o.b2(Qn.canonical),Lr=o.b3(Wr.getCenter().lat),ii=o.b7(Qn.canonical,Wr,Lr,Yn.worldSize/Yn._pixelsPerMercatorPixel),Di=o.b4(o.b5(Qn.canonical)),ci="mrt-fallback"===fe.emissiveMode?1:0,Ri=y7(Yn.expandedFarZProjMatrix,Kn,hn,Di,o.S(Yn.zoom),xn,Yn.frustumCorners.TL,Yn.frustumCorners.TR,Yn.frustumCorners.BR,Yn.frustumCorners.BL,Yn.globeCenterInViewSpace,Yn.globeRadius,Bn,Vn,Yn._farZ,ci,ii);if(Zt(Qn,qi),xt&&(me.setupElevationDraw(kr,xt,Wn),fe.uploadCommonUniforms(ot,xt,Qn.toUnwrapped()),wn)){const[ji,Go,po]=wn.getGridBuffers(Lr,0!==Vn);xt.draw(fe,Zr,cn,Vr,kn,o.$.backCCW,Ri,"globe_raster",ji,Go,po)}}}if(wn&&(fe.renderDefaultNorthPole||fe.renderDefaultSouthPole)){const Yn=["GLOBE_POLES","PROJECTION_GLOBE_VIEW"];jt&&Yn.push("CUSTOM_ANTIALIASING"),xt=fe.getOrCreateProgram("globeRaster",{defines:Yn});for(const Vn of Re){const{x:Zr,y:Qn,z:kr}=Vn.canonical,Vr=0===Qn,mi=Qn===(1<ji.draw(fe,at.TRIANGLES,cn,o._.disabled,kn,o.$.disabled,y7(It.expandedFarZProjMatrix,ii,ii,Di,0,xn,It.frustumCorners.TL,It.frustumCorners.TR,It.frustumCorners.BR,It.frustumCorners.BL,It.globeCenterInViewSpace,It.globeRadius,Bn,0,It._farZ,ci),"globe_pole_raster",Go,qi,Wr);me.setupElevationDraw(Lr,xt,Wn),fe.uploadCommonUniforms(ot,xt,Vn.toUnwrapped()),Vr&&fe.renderDefaultNorthPole&&Ri(xt,si),mi&&fe.renderDefaultSouthPole&&(ii=o.aN(o.Y(),ii,[1,-1,1]),Ri(xt,Kr))}}}}(V,Y,Z,ne,le);else{const fe=V.context,me=fe.gl;let Pe,Re;const Ke=V.shadowRenderer,ot=o.aE(V,V.longestCutoffRange),at=kn=>{if(Re===kn)return;const cn=[];1===kn&&cn.push("TERRAIN_VERTEX_MORPHING"),ot.shouldRenderCutoff&&cn.push("RENDER_CUTOFF"),Ke&&(cn.push("RENDER_SHADOWS"),Ke.useNormalOffset&&cn.push("NORMAL_OFFSET")),Pe=V.getOrCreateProgram("terrainRaster",{defines:cn}),Re=kn},xt=V.colorModeForRenderPass(),vt=new o.Z(me.LEQUAL,o.Z.ReadWrite,V.depthRangeFor3D);M2.update(le);const It=V.transform,jt=ZF(It.zoom,Y.exaggeration(),Y.sourceCache._source.tileSize);let Zt=[0,0,0];if(Ke){const kn=V.style.directionalLight,cn=V.style.ambientLight;kn&&cn&&(Zt=o.aF(V.style,kn,cn))}{Re=-1;const kn=me.TRIANGLES,[cn,hn]=[Y.gridIndexBuffer,Y.gridSegments];for(const xn of ne){const wn=Z.getTile(xn),Bn=o._.disabled,Kn=Y.prevTerrainTileForTile[xn.key],Wn=Y.terrainTileForTile[xn.key];pT(Kn,Wn)&&M2.newMorphing(xn.key,Kn,Wn,le,250),x7(V,wn.emissiveTexture),fe.activeTexture.set(me.TEXTURE0),wn.texture&&wn.texture.bind(me.LINEAR,me.CLAMP_TO_EDGE);const Yn=M2.getMorphValuesForProxy(xn.key),Vn=Yn?1:0;let Zr;Yn&&(Zr={morphing:{srcDemTile:Yn.from,dstDemTile:Yn.to,phase:o.dr(Yn.phase)}});const Qn="mrt-fallback"===V.emissiveMode?1:0,kr=fse(xn.projMatrix,b7(xn.canonical,It.renderWorldCopies)?jt/10:jt,Zt,Qn);if(at(Vn),!Pe)continue;Y.setupElevationDraw(wn,Pe,Zr);const Vr=xn.toUnwrapped();Ke&&Ke.setupShadows(Vr,Pe),V.uploadCommonUniforms(fe,Pe,Vr,null,ot),Pe.draw(V,kn,vt,Bn,xt,o.$.backCCW,kr,"terrain_raster",Y.gridBuffer,cn,hn)}}}}(E,this,this.proxySourceCache,v,this._updateTimestamp),this.renderingToTexture=true,E.gpuTimingDeferredRenderEnd(),v.splice(0,v.length))}renderBatch(v){if(0===this._drapedRenderBatches.length)return v+1;this.renderingToTexture=true;const E=this.painter,D=this.painter.context,V=this.proxySourceCache,Y=this.proxiedCoords[V.id],Z=this._drapedRenderBatches.shift(),ne=E.style.order,le=[];this._updateFBOs("mrt-fallback"===E.emissiveMode);let fe=0;for(const me of Y){const Pe=V.getTileByID(me.proxyTileKey),Re=V.proxyCachedFBO[me.key]?V.proxyCachedFBO[me.key][v]:void 0,Ke=void 0!==Re?V.renderCache[Re]:this.pool[fe++],ot=void 0!==Re;if(Pe.texture=Ke.tex,Pe.emissiveTexture=Ke.emissiveTex,ot&&!Ke.dirty){le.push(Pe.tileID);continue}D.bindFramebuffer.set(Ke.fb.framebuffer);const at=D.gl;let xt;at.drawBuffers("mrt-fallback"===E.emissiveMode?[at.COLOR_ATTACHMENT0,at.COLOR_ATTACHMENT1]:[at.COLOR_ATTACHMENT0]),this.renderedToTile=false,Ke.dirty&&(D.clear({color:o.C.transparent,stencil:0}),Ke.dirty=false);for(let vt=Z.start;vt<=Z.end;++vt){const It=E.style._mergedLayers[ne[vt]];if(It.isHidden(E.transform.zoom))continue;const jt=E.style.getLayerSourceCache(It),Zt=jt?this.proxyToSource[me.key][jt.id]:[me];if(!Zt)continue;const kn=Zt;D.viewport.set([0,0,Ke.fb.width,Ke.fb.height]),xt!==(jt?jt.id:null)&&(this._setupStencil(Ke,Zt,It,jt),xt=jt?jt.id:null),E.renderLayer(E,jt,It,kn)}if(at.drawBuffers([at.COLOR_ATTACHMENT0]),0===this._drapedRenderBatches.length)for(const vt of this._pendingGroundEffectLayers){const It=E.style._mergedLayers[ne[vt]];if(It.isHidden(E.transform.zoom))continue;const jt=E.style.getLayerSourceCache(It),Zt=jt?this.proxyToSource[me.key][jt.id]:[me];if(!Zt)continue;const kn=Zt;D.viewport.set([0,0,Ke.fb.width,Ke.fb.height]),xt!==(jt?jt.id:null)&&(this._setupStencil(Ke,Zt,It,jt),xt=jt?jt.id:null),E.renderLayer(E,jt,It,kn)}this.renderedToTile?(Ke.dirty=true,le.push(Pe.tileID)):ot||--fe,5===fe&&(fe=0,this.renderToBackBuffer(le))}return this.renderToBackBuffer(le),this.renderingToTexture=false,D.bindFramebuffer.set(null),D.viewport.set([0,0,E.width,E.height]),Z.end+1}postRender(){}isLayerOrderingCorrect(v){const E=v.order.length;let D=-1,V=E;for(let Y=0;YD}getMinElevationBelowMSL(){let v=0;return this._visibleDemTiles.filter(E=>E.dem).forEach(E=>{v=Math.min(v,E.dem.tree.minimums[0])}),0===v?v:(v-30)*this._exaggeration}raycast(v,E,D){if(!this._visibleDemTiles)return null;const V=this._visibleDemTiles.filter(Y=>Y.dem).map(Y=>{const Z=Y.tileID,ne=1<(null!==Y.t?Y.t:Number.MAX_VALUE)-(null!==Z.t?Z.t:Number.MAX_VALUE));for(const Y of V){if(null==Y.t)return null;const Z=Y.tile.dem.tree.raycast(Y.minx,Y.miny,Y.maxx,Y.maxy,v,E,D);if(null!=Z)return Z}return null}_createFBO(){const v=this.painter.context,E=v.gl,D=this.drapeBufferSize;v.activeTexture.set(E.TEXTURE0);const V=new o.T(v,{width:D[0],height:D[1],data:null},E.RGBA8);V.bind(E.LINEAR,E.CLAMP_TO_EDGE);const Y=v.createFramebuffer(D[0],D[1],1,null);let Z;return Y.colorAttachment0.set(V.texture),this._emissiveTexture&&(Z=new o.T(v,{width:D[0],height:D[1],data:null},E.R8),Z.bind(E.LINEAR,E.CLAMP_TO_EDGE),Y.createColorAttachment(v,1),Y.colorAttachment1.set(Z.texture)),Y.depthAttachment=new dse(v,Y.framebuffer),void 0===this._sharedDepthStencil?(this._sharedDepthStencil=v.createRenderbuffer(v.gl.DEPTH_STENCIL,D[0],D[1]),this._stencilRef=0,Y.depthAttachment.set(this._sharedDepthStencil),v.clear({stencil:0})):Y.depthAttachment.set(this._sharedDepthStencil),v.extTextureFilterAnisotropic&&E.texParameterf(E.TEXTURE_2D,v.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,v.extTextureFilterAnisotropicMax),{fb:Y,tex:V,emissiveTex:Z,dirty:false}}_updateFBOs(v){if(this._emissiveTexture!==v){for(const E of this.pool)this._updateFBO(E,v);for(const E of this.proxySourceCache.renderCache)this._updateFBO(E,v);this._emissiveTexture=v}}_updateFBO(v,E){const D=v.fb,V=this.painter.context,Y=V.gl,Z=this.drapeBufferSize;if(E){const ne=new o.T(V,{width:Z[0],height:Z[1],data:null},Y.R8);ne.bind(Y.LINEAR,Y.CLAMP_TO_EDGE),v.emissiveTex=ne,D.createColorAttachment(V,1),D.colorAttachment1.set(ne.texture)}else v.emissiveTex=void 0,D.removeColorAttachment(V,1);v.dirty=true}_initFBOPool(){for(;this.pool.length{const E=this._style._mergedLayers[v],D=E.isHidden(this.painter.transform.zoom);return"hillshade"===E.type||"custom"===E.type?!D&&E.shouldRedrape():!D&&E.hasTransition()})}_clearLineLayersFromRenderCache(){let v=false;for(const D of this._style.getSources())if(D instanceof A2){v=true;break}if(!v)return;const E={};for(let D=0;Dle>ne.end)||o.w("fill-extrusion with flood lighting and/or ground ambient occlusion should be moved to be on top of all draped layers.")}this._drapedRenderBatches=D}_setupRenderCache(v){const E=this.proxySourceCache;if(this._shouldDisableRenderCache()||this.invalidateRenderCache){if(this.invalidateRenderCache=false,E.renderCache.length>E.renderCachePool.length){const Z=Object.values(E.proxyCachedFBO);E.proxyCachedFBO={};for(let ne=0;ne=0;Z--){const ne=D[Z];if(E.getTileByID(ne.key),void 0!==E.proxyCachedFBO[ne.key]){const le=v[ne.key],fe=this.proxyToSource[ne.key];let me=0;for(const Pe in fe){const Re=fe[Pe],Ke=le[Pe];if(!Ke||Ke.length!==Re.length||Re.some((ot,at)=>ot!==Ke[at]||V[Pe]&&Object.hasOwn(V[Pe],ot.key))){me=-1;break}++me}for(const Pe in E.proxyCachedFBO[ne.key])E.renderCache[E.proxyCachedFBO[ne.key][Pe]].dirty=me<0||me!==Object.values(le).length}}const Y=[...this._drapedRenderBatches];Y.sort((Z,ne)=>ne.end-ne.start-(Z.end-Z.start));for(const Z of Y)for(const ne of D){if(E.proxyCachedFBO[ne.key])continue;let le=E.renderCachePool.pop();void 0===le&&E.renderCache.length<50&&(le=E.renderCache.length,E.renderCache.push(this._createFBO())),void 0!==le&&(E.proxyCachedFBO[ne.key]={},E.proxyCachedFBO[ne.key][Z.start]=le,E.renderCache[le].dirty=true)}this._tilesDirty={}}_setupStencil(v,E,D,V){if(!V||!this._sourceTilesOverlap[V.id])return void(this._overlapStencilType&&(this._overlapStencilType=false));const Y=this.painter.context,Z=Y.gl;if(E.length<=1)return void(this._overlapStencilType=false);let ne;if(D.isTileClipped())ne=E.length,this._overlapStencilMode.test={func:Z.EQUAL,mask:255},this._overlapStencilType="Clip";else{if(!(E[0].overscaledZ>E.at(-1).overscaledZ))return void(this._overlapStencilType=false);ne=1,this._overlapStencilMode.test={func:Z.GREATER,mask:255},this._overlapStencilType="Mask"}this._stencilRef+ne>255&&(Y.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=ne,this._overlapStencilMode.ref=this._stencilRef,D.isTileClipped()&&this._renderTileClippingMasks(E,this._overlapStencilMode.ref)}clipOrMaskOverlapStencilType(){return"Clip"===this._overlapStencilType||"Mask"===this._overlapStencilType}stencilModeForRTTOverlap(v){return this.renderingToTexture&&this._overlapStencilType?("Clip"===this._overlapStencilType&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[v.key]),this._overlapStencilMode):o._.disabled}_renderTileClippingMasks(v,E){const D=this.painter,V=this.painter.context,Y=V.gl;D._tileClippingMaskIDs={},V.setColorMode(o.a1.disabled),V.setDepthMode(o.Z.disabled);const Z=D.getOrCreateProgram("clippingMask");for(const ne of v){const le=D._tileClippingMaskIDs[ne.key]=--E;Z.draw(D,Y.TRIANGLES,o.Z.disabled,new o._({func:Y.ALWAYS,mask:0},le,255,Y.KEEP,Y.KEEP,Y.REPLACE),o.a1.disabled,o.$.disabled,yd(ne.projMatrix),"$clipping",D.tileExtentBuffer,D.quadTriangleIndexBuffer,D.tileExtentSegments)}}pointCoordinate(v){const E=this.painter.transform;if(v.x<0||v.x>E.width||v.y<0||v.y>E.height)return null;const D=[v.x,v.y,1,1];o.c7(D,D,E.pixelMatrixInverse),o.dx(D,D,1/D[3]),D[0]/=E.worldSize,D[1]/=E.worldSize;const V=E._camera.position,Y=o.dv(1,E.center.lat),Z=[V[0],V[1],V[2]/Y,0],ne=o.dy([],D.slice(0,3),Z);o.c3(ne,ne);const le=this.raycast(Z,ne,this._exaggeration);return null!==le&&le?(o.dz(Z,Z,ne,le),Z[3]=Z[2],Z[2]*=Y,Z):null}_setupProxiedCoordsForOrtho(v,E,D){if(v.getSource()instanceof sy)return this._setupProxiedCoordsForImageSource(v,E,D);this._findCoveringTileCache[v.id]=this._findCoveringTileCache[v.id]||{};const V=this.proxiedCoords[v.id]=[],Y=this.proxyCoords;for(let le=0;leme.overscaledZ-fe.overscaledZ)}_setupProxiedCoordsForImageSource(v,E,D){if(!v.getSource().loaded())return;const V=this.proxiedCoords[v.id]=[],Y=this.proxyCoords,Z=v.getSource(),ne=Z.tileID;if(!ne)return;const le=new o.P(ne.x,ne.y)._div(1<(Pe.min.x=Math.min(Pe.min.x,Re.x-le.x),Pe.min.y=Math.min(Pe.min.y,Re.y-le.y),Pe.max.x=Math.max(Pe.max.x,Re.x-le.x),Pe.max.y=Math.max(Pe.max.y,Re.y-le.y),Pe),{min:new o.P(Number.MAX_VALUE,Number.MAX_VALUE),max:new o.P(-Number.MAX_VALUE,-Number.MAX_VALUE)}),me=(Pe,Re)=>{const Ke=Pe.wrap+Pe.canonical.x/(1<xt+fe.max.x||ot+atvt+fe.max.y};for(let Pe=0;PeZ.key===E.tileID.key);if(Y)return Y}if(E.tileID.key!==v.key){const Y=v.canonical.z-E.tileID.canonical.z;let Z,ne,le;V=o.Y();const fe=E.tileID.wrap-v.wrap<0?(Z=o.a2>>Y,ne=Z*((E.tileID.canonical.x<=Pe){const Re=v.canonical.z-Pe;E.getSource().reparseOverscaled?(ne=Math.max(v.canonical.z+2,E.transform.tileZoom),Z=new o.bP(ne,v.wrap,Pe,v.canonical.x>>Re,v.canonical.y>>Re)):0!==Re&&(ne=Pe,Z=new o.bP(ne,v.wrap,Pe,v.canonical.x>>Re,v.canonical.y>>Re))}Z.key!==v.key&&(fe.push(Z.key),D=E.getTile(Z))}const me=Pe=>{fe.forEach(Re=>{V[Re]=Pe}),fe.length=0};for(ne-=1;ne>=le&&(!D||!D.hasData());ne--){D&&me(D.tileID.key);const Pe=Z.calculateScaledKey(ne);if(D=E.getTileByID(Pe),D&&D.hasData())break;const Re=V[Pe];if(null===Re)break;void 0===Re?fe.push(Pe):D=E.getTileByID(Re)}return me(D?D.tileID.key:null),D&&D.hasData()?D:null}findDEMTileFor(v){return this.enabled?this._findTileCoveringTileID(v,this.sourceCache):null}prepareDrawTile(){this.renderedToTile=true}_clearRenderCacheForTile(v,E){let D=this._tilesDirty[v];D||(D=this._tilesDirty[v]={}),D[E.key]=true}}function hse(k,v,E){const D=function(ne,le,fe){const me=o.dE(le,ne),Pe=o.dE(fe,[.2126,.7152,.0722]),Re=1-.3*Math.min(Pe,1),Ke=o.al(Re,1,Math.min(me+1,1));return o.al(.92,1,Math.asin(o.b0(le[2],-1,1))/Math.PI+.5)*Ke}(k,[0,0,1],v),V=[0,0,0];o.dB(V,E.slice(0,3),D);const Y=[0,0,0];o.dB(Y,v.slice(0,3),k[2]);const Z=[0,0,0];return o.dC(Z,V,Y),o.dD(Z)}const tq=["fill","fillOutline","fillPattern","line","linePattern","background","backgroundPattern","hillshade","raster"],nq=["stars","rainParticle","snowParticle","fillExtrusion","fillExtrusionGroundEffect","building","buildingBloom","elevatedStructures","model","symbol"];class pse{static cacheKey(v,E,D,V){const Y=[E];V&&Y.push(V.cacheKey);for(const Z of D)("string"==typeof Z&&Z.includes(" ")||v.usedDefines.has(Z))&&Y.push(Z);return Y.join("/")}constructor(v,E,D,V,Y,Z,ne=false){const le=v.gl;this.program=le.createProgram(),this._context=v,this._fixedUniformsFn=Y,this._pending=true,this._precompiled=ne,this.attributes={},this.configuration=V,this.name=E,this.fixedDefines=[...Z],ne?v._compileStats.precompiled++:v._compileStats.onDemand++;const fe=`#version 300 es +${(V?V.defines():[]).concat(Z.map(xt=>`#define ${xt}`)).join("\n")}`,me=[fe,o.dF];for(const xt of D.fragmentIncludes)me.push(o.ba[xt]);me.push(D.fragmentSource);const Pe=me.join("\n"),Re=[fe,o.dG];for(const xt of D.vertexIncludes)Re.push(o.ba[xt]);this.forceManualRenderingForInstanceIDShaders=v.forceManualRenderingForInstanceIDShaders&&D.vertexSource.includes("gl_InstanceID"),this.forceManualRenderingForInstanceIDShaders&&Re.push("uniform int u_instanceID;"),Re.push(D.vertexSource);let Ke=Re.join("\n");this.forceManualRenderingForInstanceIDShaders&&(Ke=Ke.replaceAll("gl_InstanceID","u_instanceID"));const ot=le.createShader(le.FRAGMENT_SHADER);if(le.isContextLost())return this.failedToCreate=true,void(this._pending=false);le.shaderSource(ot,Pe),le.compileShader(ot),le.attachShader(this.program,ot);const at=le.createShader(le.VERTEX_SHADER);if(le.isContextLost())return this.failedToCreate=true,void(this._pending=false);le.shaderSource(at,Ke),le.compileShader(at),le.attachShader(this.program,at),le.linkProgram(this.program),this._fragmentShader=ot,this._vertexShader=at,v.extParallelShaderCompile?v._pendingPrograms.add(this):this._finalize()}_finalize(){if(!this._pending)return;this._pending=false;const v=this._context,E=v.gl;v._pendingPrograms.delete(this);const D=o.e.now(),V=E.getProgramParameter(this.program,E.LINK_STATUS),Y=o.e.now()-D,Z=v._compileStats;if(Z.totalStallMs+=Y,Y>Z.maxStallMs&&(Z.maxStallMs=Y),Y>1){Z.framesMissed+=Math.floor(60*Y/1e3);const fe=this.fixedDefines.join(",");Z.stalls.push({name:`${this.name}${fe?"/":""}${fe}`,ms:Y,timestamp:D})}if(this._fragmentShader&&(V||o.w(`Fragment shader '${this.name}': ${E.getShaderInfoLog(this._fragmentShader)}`),E.deleteShader(this._fragmentShader),this._fragmentShader=null),this._vertexShader&&(V||o.w(`Vertex shader '${this.name}': ${E.getShaderInfoLog(this._vertexShader)}`),E.deleteShader(this._vertexShader),this._vertexShader=null),!V)return o.w(`Failed to link program '${this.name}': ${E.getProgramInfoLog(this.program)}`),void(this.failedToCreate=true);this.fixedUniforms=this._fixedUniformsFn(v),this.fixedUniformsEntries=Object.entries(this.fixedUniforms),this.binderUniforms=this.configuration?this.configuration.getUniforms(v):[],this.forceManualRenderingForInstanceIDShaders&&(this.instancingUniforms=(fe=>({u_instanceID:new o.aX(fe)}))(v));const ne=this.fixedDefines,le=this.name;(ne.includes("TERRAIN")||ne.includes("ELEVATED")||le.includes("symbol")||le.includes("circle"))&&(this.terrainUniforms=(fe=>({u_dem:new o.aX(fe),u_dem_prev:new o.aX(fe),u_dem_tl:new o.a3(fe),u_dem_scale:new o.a4(fe),u_dem_tl_prev:new o.a3(fe),u_dem_scale_prev:new o.a4(fe),u_dem_size:new o.a4(fe),u_dem_lerp:new o.a4(fe),u_exaggeration:new o.a4(fe),u_depth:new o.aX(fe),u_depth_size_inv:new o.a3(fe),u_depth_range_unpack:new o.a3(fe),u_occluder_half_size:new o.a4(fe),u_occlusion_depth_offset:new o.a4(fe),u_meter_to_dem:new o.a4(fe),u_label_plane_matrix_inv:new o.a5(fe)}))(v)),ne.includes("GLOBE")&&(this.globeUniforms=(fe=>({u_tile_tl_up:new o.a6(fe),u_tile_tr_up:new o.a6(fe),u_tile_br_up:new o.a6(fe),u_tile_bl_up:new o.a6(fe),u_tile_up_scale:new o.a4(fe)}))(v)),ne.includes("FOG")&&(this.fogUniforms=(fe=>({u_fog_matrix:new o.a5(fe),u_fog_range:new o.a3(fe),u_fog_color:new o.aY(fe),u_fog_horizon_blend:new o.a4(fe),u_fog_vertical_limit:new o.a3(fe),u_fog_temporal_offset:new o.a4(fe),u_frustum_tl:new o.a6(fe),u_frustum_tr:new o.a6(fe),u_frustum_br:new o.a6(fe),u_frustum_bl:new o.a6(fe),u_globe_pos:new o.a6(fe),u_globe_radius:new o.a4(fe),u_globe_transition:new o.a4(fe),u_is_globe:new o.aX(fe),u_viewport:new o.a3(fe)}))(v)),ne.includes("RENDER_CUTOFF")&&(this.cutoffUniforms=o.dH(v)),ne.includes("LIGHTING_3D_MODE")&&(this.lightsUniforms=(fe=>({u_lighting_ambient_color:new o.a6(fe),u_lighting_directional_dir:new o.a6(fe),u_lighting_directional_color:new o.a6(fe),u_ground_radiance:new o.a6(fe)}))(v)),ne.includes("RENDER_SHADOWS")&&(this.shadowUniforms=o.dI(v))}maybeFinalize(){if(!this._pending)return;const v=this._context.extParallelShaderCompile;v&&!this._context.gl.getProgramParameter(this.program,v.COMPLETION_STATUS_KHR)||this._finalize()}_ensureReady(){this._pending&&(this._finalize(),this._context.sweepPendingPrograms())}getAttributeLocation(v,E){this._ensureReady();let D=this.attributes[E];return void 0===D&&(D=this.attributes[E]=v.getAttribLocation(this.program,E)),D}_setUniformGroup(v,E,D){this._ensureReady();const V=this[E];if(!this.failedToCreate&&V){v.program.set(this.program);for(const Y in D){const Z=V[Y];Z&&Z.set(this.program,Y,D[Y])}}}setTerrainUniformValues(v,E){this._setUniformGroup(v,"terrainUniforms",E)}setGlobeUniformValues(v,E){this._setUniformGroup(v,"globeUniforms",E)}setFogUniformValues(v,E){this._setUniformGroup(v,"fogUniforms",E)}setCutoffUniformValues(v,E){this._setUniformGroup(v,"cutoffUniforms",E)}setLightsUniformValues(v,E){this._setUniformGroup(v,"lightsUniforms",E)}setShadowUniformValues(v,E){this._setUniformGroup(v,"shadowUniforms",E)}_drawDebugWireframe(v,E,D,V,Y,Z,ne,le,fe,me){const Pe=v.options.wireframe;if(false===Pe.terrain&&false===Pe.layers2D&&false===Pe.layers3D)return;const Re=v.context;if(!(()=>!(!Pe.terrain||"terrainRaster"!==this.name&&"globeRaster"!==this.name)||!(!Pe.layers2D||v._terrain&&v._terrain.renderingToTexture||!tq.includes(this.name))||!(!Pe.layers3D||!nq.includes(this.name)))())return;const Ke=Re.gl,ot=v.wireframeDebugCache.getLinesFromTrianglesBuffer(v.frameCounter,Y,Re);if(!ot)return;const at=[...this.fixedDefines,"DEBUG_WIREFRAME"],xt=v.getOrCreateProgram(this.name,{config:this.configuration,defines:at});xt._ensureReady(),Re.program.set(xt.program);const vt=(Zt,kn,cn)=>{if(kn[Zt]&&cn[Zt])for(const hn in kn[Zt])cn[Zt][hn]&&cn[Zt][hn].set(cn.program,hn,kn[Zt][hn].current)};fe&&fe.setUniforms(xt.program,Re,xt.binderUniforms,ne,{zoom:le}),vt("fixedUniforms",this,xt),vt("terrainUniforms",this,xt),vt("globeUniforms",this,xt),vt("fogUniforms",this,xt),vt("lightsUniforms",this,xt),vt("shadowUniforms",this,xt),ot.bind(),Re.setColorMode(new o.a1([Ke.ONE,Ke.ONE_MINUS_SRC_ALPHA,Ke.ZERO,Ke.ONE],o.C.transparent,[true,true,true,false])),Re.setDepthMode(new o.Z(E.func===Ke.LESS?Ke.LEQUAL:E.func,o.Z.ReadOnly,E.range)),Re.setStencilMode(o._.disabled);const It=3*Z.primitiveLength*2,jt=3*Z.primitiveOffset*2*2;if(this.forceManualRenderingForInstanceIDShaders){const Zt=me||1;for(let kn=0;kn1?Ke.drawElementsInstanced(Ke.LINES,It,Ke.UNSIGNED_SHORT,jt,me):Ke.drawElements(Ke.LINES,It,Ke.UNSIGNED_SHORT,jt);Y.bind(),Re.program.set(this.program),Re.setDepthMode(E),Re.setStencilMode(D),Re.setColorMode(V)}checkUniforms(v,E,D){if(this.fixedDefines.includes(E)){for(const V of Object.keys(D))if(!D[V].initialized)throw new Error(`Program '${this.name}', from draw '${v}': uniform ${V} not set but required by ${E} being defined`)}}draw(v,E,D,V,Y,Z,ne,le,fe,me,Pe,Re,Ke,ot,at,xt){const vt=v.context,It=vt.gl;if(this._ensureReady(),this.failedToCreate)return;vt.program.set(this.program),vt.setDepthMode(D),vt.setStencilMode(V),vt.setColorMode(Y),vt.setCullFace(Z);for(const[xn,wn]of this.fixedUniformsEntries)wn.set(this.program,xn,ne[xn]);ot&&ot.setUniforms(this.program,vt,this.binderUniforms,Re,{zoom:Ke});const jt={[It.POINTS]:1,[It.LINES]:2,[It.TRIANGLES]:3,[It.LINE_STRIP]:1}[E];this.checkUniforms(le,"RENDER_SHADOWS",this.shadowUniforms);const Zt=at||[],kn=ot?ot.getPaintVertexBuffers():[],cn=E===It.TRIANGLES&&me,hn=xt&&xt>0?1:void 0;for(const xn of Pe.get()){const wn=xn.vaos||(xn.vaos={});if((wn[le]||(wn[le]=new rse)).bind(vt,this,fe,kn,me,xn.vertexOffset,Zt,hn),this.forceManualRenderingForInstanceIDShaders){const Bn=xt||1;for(let Kn=0;Kn1?It.drawElementsInstanced(E,xn.primitiveLength*jt,It.UNSIGNED_SHORT,xn.primitiveOffset*jt*2,xt):me?It.drawElements(E,xn.primitiveLength*jt,It.UNSIGNED_SHORT,xn.primitiveOffset*jt*2):It.drawArrays(E,xn.vertexOffset,xn.vertexLength);cn&&this._drawDebugWireframe(v,D,V,Y,me,xn,Re,Ke,ot,xt)}}}const rq=(k,v,E)=>({u_matrix:k,u_emissive_strength:v,u_ground_shadow_factor:E,u_opacity_multiplier:1}),oI=(k,v,E,D,V,Y=0)=>Object.assign(rq(k,v,V),o.dJ(E,D,Y)),LOe=(k,v,E,D)=>({u_matrix:k,u_world:E,u_emissive_strength:v,u_ground_shadow_factor:D,u_opacity_multiplier:1}),DOe=(k,v,E,D,V,Y,Z=0)=>Object.assign(oI(k,v,E,D,Y,Z),{u_world:V}),mse=(k,v,E)=>({u_image:k,u_texel_size:v,u_first_pass:E?1:0}),FOe=o.Y(),iq=(k,v,E,D,V,Y,Z)=>{const ne=k.transform,le="globe"===ne.projection.name,fe=le?o.dK(ne.zoom,v.canonical)*ne._pixelsPerMercatorPixel:o.c5(E,1,Y),me={u_matrix:v.projMatrix,u_extrude_scale:fe,u_intensity:Z,u_inv_rot_matrix:FOe,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(le){me.u_inv_rot_matrix=D,me.u_merc_center=V,me.u_tile_id=[v.canonical.x,v.canonical.y,1<({u_matrix:v,u_normalize_matrix:E,u_globe_matrix:D,u_merc_matrix:V,u_grid_matrix:Y,u_tl_parent:Z,u_scale_parent:me,u_fade_t:Pe.mix,u_opacity:Pe.opacity*Re.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:Re.paint.get("raster-brightness-min"),u_brightness_high:Re.paint.get("raster-brightness-max"),u_saturation_factor:o.dN(Re.paint.get("raster-saturation")),u_contrast_factor:o.dM(Re.paint.get("raster-contrast")),u_spin_weights:_7(Re.paint.get("raster-hue-rotate")),u_perspective_transform:Ke,u_raster_elevation:ot,u_zoom_transition:ne,u_merc_center:le,u_cutoff_params:fe,u_colorization_mix:Df(o.dL,xt,It),u_colorization_offset:pd(o.dL,vt,It),u_color_ramp:at,u_texture_offset:[Zt/(jt+2*Zt),jt/(jt+2*Zt)],u_texture_res:[jt+2*Zt,jt+2*Zt],u_emissive_strength:kn,u_zbias_factor:v7(k)});function _7(k){k*=Math.PI/180;const v=Math.sin(k),E=Math.cos(k);return[(2*E+1)/3,(-Math.sqrt(3)*v-E+1)/3,(Math.sqrt(3)*v-E+1)/3]}const hA=o.Y(),oq=(k,v,E,D,V,Y,Z,ne,le,fe,me,Pe,Re,Ke,ot,at,xt,vt,It,jt,Zt,kn,cn,hn,xn)=>{const wn=V.transform,Bn={u_is_size_zoom_constant:+("constant"===k||"source"===k),u_is_size_feature_constant:+("constant"===k||"camera"===k),u_size_t:v?v.uSizeT:0,u_size:v?v.uSize:0,u_camera_to_center_distance:wn.getCameraToCenterDistance(jt),u_rotate_symbol:+E,u_aspect_ratio:wn.width/wn.height,u_fade_change:V.options.fadeDuration?V.symbolFadeChange:1,u_matrix:Y,u_label_plane_matrix:Z,u_coord_matrix:ne,u_is_text:+fe,u_is_sdf:+me,u_elevation_from_sea:le?1:0,u_pitch_with_map:+D,u_texsize:Pe,u_texsize_icon:Re,u_texture:0,u_texture_icon:1,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:hA,u_merc_center:[0,0],u_camera_forward:[0,0,0],u_ecef_origin:[0,0,0],u_tile_matrix:hA,u_up_vector:[0,-1,0],u_color_adj_mat:cn,u_icon_transition:hn||0,u_gamma_scale:me?D?V.transform.getCameraToCenterDistance(jt)*Math.cos(V.terrain?0:V.transform._pitch):1:0,u_device_pixel_ratio:o.e.devicePixelRatio,u_is_halo:1,u_scale_factor:xn||1,u_ground_shadow_factor:Zt,u_inv_matrix:o.aO(o.Y(),Z),u_normal_scale:kn,u_lutTexture:o.dP.LUT,u_spp_fill_np_color:[0,0,0,1],u_spp_halo_np_color:[0,0,0,0],u_spp_opacity:1,u_spp_halo_width:0,u_spp_halo_blur:0,u_spp_emissive_strength:0,u_spp_occlusion_opacity:1,u_spp_z_offset:0,u_spp_translate_rotation:[1,0],u_spp_zoom_fraction:0,u_opacity_multiplier:1};return"globe"===jt.name&&(Bn.u_tile_id=[ot.canonical.x,ot.canonical.y,1<({u_matrix:k,u_emissive_strength:v,u_opacity:E,u_color:D}),e4=(k,v,E,D,V,Y,Z,ne,le)=>Object.assign(o.dQ(V,Y,Z,D,ne,le),{u_matrix:k,u_emissive_strength:v,u_opacity:E}),t4={fillExtrusion:o.dW,fillExtrusionPattern:o.dV,fill:k=>({u_matrix:new o.a5(k),u_emissive_strength:new o.a4(k),u_ground_shadow_factor:new o.a6(k),u_opacity_multiplier:new o.a4(k)}),fillPattern:k=>({u_matrix:new o.a5(k),u_emissive_strength:new o.a4(k),u_image:new o.aX(k),u_texsize:new o.a3(k),u_pixel_coord_upper:new o.a3(k),u_pixel_coord_lower:new o.a3(k),u_tile_units_to_pixels:new o.a4(k),u_ground_shadow_factor:new o.a6(k),u_pattern_transition:new o.a4(k),u_opacity_multiplier:new o.a4(k)}),fillOutline:k=>({u_matrix:new o.a5(k),u_emissive_strength:new o.a4(k),u_world:new o.a3(k),u_ground_shadow_factor:new o.a6(k),u_opacity_multiplier:new o.a4(k)}),fillOutlinePattern:k=>({u_matrix:new o.a5(k),u_emissive_strength:new o.a4(k),u_world:new o.a3(k),u_image:new o.aX(k),u_texsize:new o.a3(k),u_pixel_coord_upper:new o.a3(k),u_pixel_coord_lower:new o.a3(k),u_tile_units_to_pixels:new o.a4(k),u_ground_shadow_factor:new o.a6(k),u_pattern_transition:new o.a4(k),u_opacity_multiplier:new o.a4(k)}),lineBlendComposite:k=>({u_image:new o.aX(k),u_opacity:new o.a4(k),u_blend_mode:new o.aX(k),u_max_density:new o.a4(k)}),lineBlendReduce:k=>({u_image:new o.aX(k),u_texel_size:new o.a3(k),u_first_pass:new o.aX(k)}),circle:o.dU,collisionBox:k=>({u_matrix:new o.a5(k),u_inv_rot_matrix:new o.a5(k),u_camera_to_center_distance:new o.a4(k),u_extrude_scale:new o.a3(k),u_zoom_transition:new o.a4(k),u_merc_center:new o.a3(k),u_tile_id:new o.a6(k)}),collisionCircle:k=>({u_matrix:new o.a5(k),u_inv_matrix:new o.a5(k),u_camera_to_center_distance:new o.a4(k),u_viewport_size:new o.a3(k)}),debug:o.dT,clippingMask:k=>({u_matrix:new o.a5(k)}),heatmap:k=>({u_extrude_scale:new o.a4(k),u_intensity:new o.a4(k),u_matrix:new o.a5(k),u_inv_rot_matrix:new o.a5(k),u_merc_center:new o.a3(k),u_tile_id:new o.a6(k),u_zoom_transition:new o.a4(k),u_up_dir:new o.a6(k)}),heatmapTexture:k=>({u_image:new o.aX(k),u_color_ramp:new o.aX(k),u_opacity:new o.a4(k)}),hillshade:k=>({u_matrix:new o.a5(k),u_image:new o.aX(k),u_latrange:new o.a3(k),u_light:new o.a3(k),u_shadow:new o.dp(k),u_highlight:new o.dp(k),u_emissive_strength:new o.a4(k),u_accent:new o.dp(k)}),hillshadePrepare:k=>({u_matrix:new o.a5(k),u_image:new o.aX(k),u_dimension:new o.a3(k),u_zoom:new o.a4(k)}),line:o.dS,linePattern:o.dR,raster:k=>({u_matrix:new o.a5(k),u_normalize_matrix:new o.a5(k),u_globe_matrix:new o.a5(k),u_merc_matrix:new o.a5(k),u_grid_matrix:new o.aZ(k),u_tl_parent:new o.a3(k),u_scale_parent:new o.a4(k),u_fade_t:new o.a4(k),u_opacity:new o.a4(k),u_image0:new o.aX(k),u_image1:new o.aX(k),u_brightness_low:new o.a4(k),u_brightness_high:new o.a4(k),u_saturation_factor:new o.a4(k),u_contrast_factor:new o.a4(k),u_spin_weights:new o.a6(k),u_perspective_transform:new o.a3(k),u_raster_elevation:new o.a4(k),u_zoom_transition:new o.a4(k),u_merc_center:new o.a3(k),u_cutoff_params:new o.aY(k),u_colorization_mix:new o.aY(k),u_colorization_offset:new o.a4(k),u_color_ramp:new o.aX(k),u_texture_offset:new o.a3(k),u_texture_res:new o.a3(k),u_emissive_strength:new o.a4(k),u_zbias_factor:new o.a4(k)}),symbol:k=>({u_is_size_zoom_constant:new o.aX(k),u_is_size_feature_constant:new o.aX(k),u_size_t:new o.a4(k),u_size:new o.a4(k),u_camera_to_center_distance:new o.a4(k),u_rotate_symbol:new o.aX(k),u_aspect_ratio:new o.a4(k),u_fade_change:new o.a4(k),u_matrix:new o.a5(k),u_label_plane_matrix:new o.a5(k),u_coord_matrix:new o.a5(k),u_is_text:new o.aX(k),u_is_sdf:new o.aX(k),u_elevation_from_sea:new o.aX(k),u_pitch_with_map:new o.aX(k),u_texsize:new o.a3(k),u_texsize_icon:new o.a3(k),u_texture:new o.aX(k),u_texture_icon:new o.aX(k),u_gamma_scale:new o.a4(k),u_device_pixel_ratio:new o.a4(k),u_tile_id:new o.a6(k),u_zoom_transition:new o.a4(k),u_inv_rot_matrix:new o.a5(k),u_merc_center:new o.a3(k),u_camera_forward:new o.a6(k),u_tile_matrix:new o.a5(k),u_up_vector:new o.a6(k),u_ecef_origin:new o.a6(k),u_is_halo:new o.aX(k),u_icon_transition:new o.a4(k),u_color_adj_mat:new o.a5(k),u_scale_factor:new o.a4(k),u_ground_shadow_factor:new o.a6(k),u_inv_matrix:new o.a5(k),u_normal_scale:new o.a4(k),u_lutTexture:new o.aX(k),u_spp_fill_np_color:new o.aY(k),u_spp_halo_np_color:new o.aY(k),u_spp_opacity:new o.a4(k),u_spp_halo_width:new o.a4(k),u_spp_halo_blur:new o.a4(k),u_spp_emissive_strength:new o.a4(k),u_spp_occlusion_opacity:new o.a4(k),u_spp_z_offset:new o.a4(k),u_spp_translate_rotation:new o.a3(k),u_spp_zoom_fraction:new o.a4(k),u_opacity_multiplier:new o.a4(k)}),background:k=>({u_matrix:new o.a5(k),u_emissive_strength:new o.a4(k),u_opacity:new o.a4(k),u_color:new o.dp(k)}),backgroundPattern:k=>({u_matrix:new o.a5(k),u_emissive_strength:new o.a4(k),u_opacity:new o.a4(k),u_image:new o.aX(k),u_pattern_tl:new o.a3(k),u_pattern_br:new o.a3(k),u_texsize:new o.a3(k),u_pattern_size:new o.a3(k),u_pixel_coord_upper:new o.a3(k),u_pixel_coord_lower:new o.a3(k),u_pattern_units_to_pixels:new o.a3(k)}),terrainRaster:k=>({u_matrix:new o.a5(k),u_image0:new o.aX(k),u_image1:new o.aX(k),u_skirt_height:new o.a4(k),u_ground_shadow_factor:new o.a6(k),u_emissive_texture_available:new o.a4(k)}),skybox:k=>({u_matrix:new o.a5(k),u_sun_direction:new o.a6(k),u_cubemap:new o.aX(k),u_opacity:new o.a4(k),u_temporal_offset:new o.a4(k)}),skyboxGradient:k=>({u_matrix:new o.a5(k),u_color_ramp:new o.aX(k),u_center_direction:new o.a6(k),u_radius:new o.a4(k),u_opacity:new o.a4(k),u_temporal_offset:new o.a4(k)}),skyboxCapture:k=>({u_matrix_3f:new o.aZ(k),u_sun_direction:new o.a6(k),u_sun_intensity:new o.a4(k),u_color_tint_r:new o.aY(k),u_color_tint_m:new o.aY(k),u_luminance:new o.a4(k)}),globeRaster:k=>({u_proj_matrix:new o.a5(k),u_globe_matrix:new o.a5(k),u_normalize_matrix:new o.a5(k),u_merc_matrix:new o.a5(k),u_zoom_transition:new o.a4(k),u_merc_center:new o.a3(k),u_image0:new o.aX(k),u_image1:new o.aX(k),u_grid_matrix:new o.aZ(k),u_skirt_height:new o.a4(k),u_far_z_cutoff:new o.a4(k),u_frustum_tl:new o.a6(k),u_frustum_tr:new o.a6(k),u_frustum_br:new o.a6(k),u_frustum_bl:new o.a6(k),u_globe_pos:new o.a6(k),u_globe_radius:new o.a4(k),u_viewport:new o.a3(k),u_emissive_texture_available:new o.a4(k)}),globeAtmosphere:k=>({u_frustum_tl:new o.a6(k),u_frustum_tr:new o.a6(k),u_frustum_br:new o.a6(k),u_frustum_bl:new o.a6(k),u_horizon:new o.a4(k),u_transition:new o.a4(k),u_fadeout_range:new o.a4(k),u_atmosphere_fog_color:new o.aY(k),u_high_color:new o.aY(k),u_space_color:new o.aY(k),u_temporal_offset:new o.a4(k),u_horizon_angle:new o.a4(k)}),stars:k=>({u_matrix:new o.a5(k),u_up:new o.a6(k),u_right:new o.a6(k),u_intensity_multiplier:new o.a4(k)}),occlusion:k=>({u_matrix:new o.a5(k),u_anchorPos:new o.a6(k),u_screenSizePx:new o.a3(k),u_occluderSizePx:new o.a3(k),u_color:new o.aY(k)})};class e1{constructor(v,E,D,V){this.id=e1.uniqueIdxCounter,e1.uniqueIdxCounter++,this.context=v;const Y=v.gl;this.buffer=Y.createBuffer(),this.dynamicDraw=Boolean(D),this.context.unbindVAO(),v.bindElementBuffer.set(this.buffer),Y.bufferData(Y.ELEMENT_ARRAY_BUFFER,E.arrayBuffer,this.dynamicDraw?Y.DYNAMIC_DRAW:Y.STATIC_DRAW),this.dynamicDraw||V||E.destroy()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(v){this.id=e1.uniqueIdxCounter,e1.uniqueIdxCounter++;const E=this.context.gl;this.context.unbindVAO(),this.bind(),E.bufferSubData(E.ELEMENT_ARRAY_BUFFER,0,v.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}e1.uniqueIdxCounter=0;const li={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class gse{constructor(v,E,D,V,Y,Z){this.length=E.length,this.attributes=D,this.itemSize=E.bytesPerElement,this.dynamicDraw=V,this.instanceCount=Z,this.context=v;const ne=v.gl;this.buffer=ne.createBuffer(),v.bindVertexBuffer.set(this.buffer),ne.bufferData(ne.ARRAY_BUFFER,E.arrayBuffer,this.dynamicDraw?ne.DYNAMIC_DRAW:ne.STATIC_DRAW),this.dynamicDraw||Y||E.destroy()}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(v){const E=this.context.gl;this.bind(),E.bufferSubData(E.ARRAY_BUFFER,0,v.arrayBuffer)}enableAttributes(v,E){for(const D of this.attributes){const V=E.getAttributeLocation(v,D.name);-1!==V&&v.enableVertexAttribArray(V)}}setVertexAttribPointers(v,E,D){for(const V of this.attributes){const Y=E.getAttributeLocation(v,V.name);if(-1!==Y){const Z=V.offset+this.itemSize*(D||0);"Float32"===V.type?v.vertexAttribPointer(Y,V.components,v.FLOAT,false,this.itemSize,Z):v.vertexAttribIPointer(Y,V.components,v[li[V.type]],this.itemSize,Z)}}}setVertexAttribDivisor(v,E,D){for(let V=0;V0&&v.vertexAttribDivisor(Y,D)}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class pA{constructor(v,E,D,V,Y){this.context=v,this.width=E,this.height=D;const Z=this.framebuffer=v.gl.createFramebuffer();V>0&&(this.colorAttachment0=new iI(v,Z,0)),V>1&&(this.colorAttachment1=new iI(v,Z,1)),Y&&(this.depthAttachmentType=Y,this.depthAttachment="renderbuffer"===Y?new dA(v,Z):new use(v,Z))}static createWithTexture(v,E,D,V,Y){const Z=v.gl;if(v.activeTexture.set(Z.TEXTURE1),v.viewport.set([0,0,D,V]),E&&E.width===D&&E.height===V)return Z.bindTexture(Z.TEXTURE_2D,E.colorAttachment0.get()),v.bindFramebuffer.set(E.framebuffer),E;E&&E.destroy();const ne=v.extRenderToTextureHalfFloat||v.extColorBufferFloat?v.gl.RGBA16F:v.gl.RGBA8,le=new o.T(v,{width:D,height:V,data:null},ne);le.bind(Z.LINEAR,Z.CLAMP_TO_EDGE);const fe=v.createFramebuffer(D,V,1,null);if(fe.format=ne,fe.colorAttachment0.set(le.texture),Y){const me=v.createRenderbuffer(Z.DEPTH24_STENCIL8,D,V);v.bindFramebuffer.set(fe.framebuffer),Z.framebufferRenderbuffer(Z.FRAMEBUFFER,Z.DEPTH_STENCIL_ATTACHMENT,Z.RENDERBUFFER,me),fe._stencilRbo=me}return fe}createColorAttachment(v,E){0===E?this.colorAttachment0=new iI(v,this.framebuffer,0):1===E&&(this.colorAttachment1=new iI(v,this.framebuffer,1))}removeColorAttachment(v,E){const D=this.context.gl;let V;0===E?(V=this.colorAttachment0.get(),this.colorAttachment0=void 0):1===E&&(V=this.colorAttachment1.get(),this.colorAttachment1=void 0),V&&D.deleteTexture(V)}destroy(){const v=this.context.gl;if(this.colorAttachment0){const E=this.colorAttachment0.get();E&&v.deleteTexture(E)}if(this.colorAttachment1){const E=this.colorAttachment1.get();E&&v.deleteTexture(E)}if(this.depthAttachment&&this.depthAttachmentType)if("renderbuffer"===this.depthAttachmentType){const E=this.depthAttachment.get();E&&v.deleteRenderbuffer(E)}else{const E=this.depthAttachment.get();E&&v.deleteTexture(E)}this._stencilRbo&&(v.deleteRenderbuffer(this._stencilRbo),this._stencilRbo=null),v.deleteFramebuffer(this.framebuffer)}}class yse{constructor(v,E){this.gl=v,this._pendingPrograms=new Set,this._compileStats={precompiled:0,onDemand:0,totalStallMs:0,maxStallMs:0,framesMissed:0,stalls:[]},this.clearColor=new EOe(this),this.clearDepth=new GY(this),this.clearStencil=new HY(this),this.colorMask=new WY(this),this.depthMask=new YY(this),this.stencilMask=new ose(this),this.stencilFunc=new ase(this),this.stencilOp=new COe(this),this.stencilTest=new XF(this),this.depthRange=new jF(this),this.depthTest=new sse(this),this.depthFunc=new h0(this),this.blend=new qY(this),this.blendFunc=new p7(this),this.blendColor=new SOe(this),this.blendEquation=new m7(this),this.cullFace=new XY(this),this.cullFaceSide=new jY(this),this.frontFace=new KY(this),this.program=new ZY(this),this.activeTexture=new g7(this),this.viewport=new lse(this),this.bindFramebuffer=new cse(this),this.bindRenderbuffer=new rI(this),this.bindTexture=new AOe(this),this.bindVertexBuffer=new kOe(this),this.bindElementBuffer=new ROe(this),this.bindVertexArrayOES=new POe(this),this.pixelStoreUnpack=new IOe(this),this.pixelStoreUnpackPremultiplyAlpha=new MOe(this),this.pixelStoreUnpackFlipY=new JY(this),this.options=E?{...E}:{},this.options.extTextureFilterAnisotropicForceOff||(this.extTextureFilterAnisotropic=v.getExtension("EXT_texture_filter_anisotropic")||v.getExtension("MOZ_EXT_texture_filter_anisotropic")||v.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=v.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT))),this.extDebugRendererInfo=v.getExtension("WEBGL_debug_renderer_info"),this.extDebugRendererInfo&&(this.renderer=v.getParameter(this.extDebugRendererInfo.UNMASKED_RENDERER_WEBGL),this.vendor=v.getParameter(this.extDebugRendererInfo.UNMASKED_VENDOR_WEBGL)),this.forceManualRenderingForInstanceIDShaders=E&&!!E.forceManualRenderingForInstanceIDShaders||this.renderer&&this.renderer.includes("PowerVR"),this.options.extTextureFloatLinearForceOff||(this.extTextureFloatLinear=v.getExtension("OES_texture_float_linear")),this.extRenderToTextureHalfFloat=v.getExtension("EXT_color_buffer_half_float"),this.extColorBufferFloat=v.getExtension("EXT_color_buffer_float"),this.extTimerQuery=v.getExtension("EXT_disjoint_timer_query_webgl2"),this.maxTextureSize=v.getParameter(v.MAX_TEXTURE_SIZE),this.maxUniformBlockSize=Math.min(v.getParameter(v.MAX_UNIFORM_BLOCK_SIZE),32768),this.maxUniformBufferBindings=v.getParameter(v.MAX_UNIFORM_BUFFER_BINDINGS),this.extBlendFuncExtended=v.getExtension("WEBGL_blend_func_extended"),this.extParallelShaderCompile=v.getExtension("KHR_parallel_shader_compile")}sweepPendingPrograms(){if(0!==this._pendingPrograms.size)for(const v of this._pendingPrograms)v.maybeFinalize()}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=true,this.clearDepth.dirty=true,this.clearStencil.dirty=true,this.colorMask.dirty=true,this.depthMask.dirty=true,this.stencilMask.dirty=true,this.stencilFunc.dirty=true,this.stencilOp.dirty=true,this.stencilTest.dirty=true,this.depthRange.dirty=true,this.depthTest.dirty=true,this.depthFunc.dirty=true,this.blend.dirty=true,this.blendFunc.dirty=true,this.blendColor.dirty=true,this.blendEquation.dirty=true,this.cullFace.dirty=true,this.cullFaceSide.dirty=true,this.frontFace.dirty=true,this.program.dirty=true,this.activeTexture.dirty=true,this.viewport.dirty=true,this.bindFramebuffer.dirty=true,this.bindRenderbuffer.dirty=true,this.bindTexture.dirty=true,this.bindVertexBuffer.dirty=true,this.bindElementBuffer.dirty=true,this.bindVertexArrayOES.dirty=true,this.pixelStoreUnpack.dirty=true,this.pixelStoreUnpackPremultiplyAlpha.dirty=true,this.pixelStoreUnpackFlipY.dirty=true}createIndexBuffer(v,E,D){return new e1(this,v,E,D)}createVertexBuffer(v,E,D,V,Y){return new gse(this,v,E,D,V,Y)}createRenderbuffer(v,E,D){const V=this.gl,Y=V.createRenderbuffer();return this.bindRenderbuffer.set(Y),V.renderbufferStorage(V.RENDERBUFFER,v,E,D),this.bindRenderbuffer.set(null),Y}createFramebuffer(v,E,D,V){return new pA(this,v,E,D,V)}clear({color:v,depth:E,stencil:D,colorMask:V}){const Y=this.gl;let Z=0;v&&(Z|=Y.COLOR_BUFFER_BIT,this.clearColor.set(v.toNonPremultipliedRenderColor(null)),this.colorMask.set(V||[true,true,true,true])),void 0!==E&&(Z|=Y.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(E),this.depthMask.set(true)),void 0!==D&&(Z|=Y.STENCIL_BUFFER_BIT,this.clearStencil.set(D),this.stencilMask.set(255)),Y.clear(Z)}setCullFace(v){false===v.enable?this.cullFace.set(false):(this.cullFace.set(true),this.cullFaceSide.set(v.mode),this.frontFace.set(v.frontFace))}setDepthMode(v){v.func!==this.gl.ALWAYS||v.mask?(this.depthTest.set(true),this.depthFunc.set(v.func),this.depthMask.set(v.mask),this.depthRange.set(v.range)):this.depthTest.set(false)}setStencilMode(v){v.test.func!==this.gl.ALWAYS||v.mask?(this.stencilTest.set(true),this.stencilMask.set(v.mask),this.stencilOp.set([v.fail,v.depthFail,v.pass]),this.stencilFunc.set({func:v.test.func,ref:v.ref,mask:v.test.mask})):this.stencilTest.set(false)}setColorMode(v){o.O(v.blendFunction,o.a1.Replace)?this.blend.set(false):(this.blend.set(true),this.blendFunc.set(v.blendFunction),this.blendColor.set(v.blendColor),v.blendEquation?this.blendEquation.set(v.blendEquation):this.blendEquation.setDefault()),this.colorMask.set(v.mask)}unbindVAO(){this.bindVertexArrayOES.set(null)}}const tg=o.Y();function kb(k){const v=k._camera.getWorldToCamera(k.worldSize,1),E=o.X([],v,k.globeMatrix);o.aO(E,E);const D=[0,0,0],V=[0,1,0,0];return o.c7(V,V,E),D[0]=V[0],D[1]=V[1],D[2]=V[2],o.c3(D,D),D}function bse({width:k,height:v,anchor:E,textOffset:D,textScale:V},Y){const{horizontalAlign:Z,verticalAlign:ne}=o.cM(E),le=-(Z-.5)*k,fe=-(ne-.5)*v,me=o.cN(E,D);return new o.P((le/V+me[0])*Y,(fe/V+me[1])*Y)}function xse(k,v,E,D,V,Y,Z,ne,le,fe){const me=k.text.placedSymbolArray,Pe=k.text.dynamicLayoutVertexArray,Re=k.icon.dynamicLayoutVertexArray,Ke={},ot=k.getProjection(),at=wr(Z,ot,V),xt=V.elevation,vt=ot.upVectorScale(Z.canonical,V.center.lat,V.worldSize).metersToTile;Pe.clear();for(let It=0;It=0&&(Ke[jt.associatedIconIndex]={x:Wn,y:Yn,z:Vn,angle:mi})}else o.dY(cn,Pe)}if(fe){Re.clear();const It=k.icon.placedSymbolArray;for(let jt=0;jt{let Es=[0,0,0];if(ul){const Fc=k.style.directionalLight,ff=k.style.ambientLight;Fc&&ff&&(Es=o.aF(k.style,Fc,ff))}return Es},ta=ul=>{const Es=Math.floor(k.context.maxUniformBlockSize/4),Fc=Math.floor(Es/4);ul.push(`MAX_UBO_SIZE_VEC4 ${Fc}u`)},xo=ul=>{wn.depthOcclusionForSymbolsAndCircles&&(E.hasOcclusionOpacityProperties||k.terrain)&&(ul.push("DEPTH_D24"),ul.push("DEPTH_OCCLUSION"))},Qs=ul=>{E.lut&&!cn&&(E.lut.texture||(E.lut.texture=new o.e0(k.context,E.lut.image,[E.lut.image.height,E.lut.image.height,E.lut.image.height],hn.gl.RGBA8)),hn.activeTexture.set(hn.gl.TEXTURE0+o.dP.LUT),E.lut.texture&&E.lut.texture.bind(hn.gl.LINEAR,hn.gl.CLAMP_TO_EDGE),ul.push("APPLY_LUT_ON_GPU"))},lc=()=>{const ul=Bn&&"point"!==E.layout.get("symbol-placement"),Es=[];xo(Es),Qs(Es);const Fc=ul||po,ff="road"===ii.elevationType,Lb=k.shadowRenderer,gp=ff&&Wn&&!!Lb&&Lb.enabled,t1=ws(gp),$s=ff&&Wn&&!k.terrain?kr:Qn,dl=E.paint.get("icon-image-cross-fade");k.terrainRenderModeElevated()&&Wn&&Es.push("PITCH_WITH_MAP_TERRAIN"),Di&&(Es.push("PROJECTION_GLOBE_VIEW"),Fc&&Es.push("PROJECTED_POS_ON_VIEWPORT")),dl>0&&ii.hasAnySecondaryIcon&&Es.push("ICON_TRANSITION"),!ii.icon.zOffsetVertexBuffer||ff&&k.terrain||Es.push("Z_OFFSET"),0===vt&&0===It&&0===jt&&1===Zt||Es.push("COLOR_ADJUSTMENT"),gp&&Es.push("RENDER_SHADOWS","NORMAL_OFFSET"),ff&&Wn&&!k.terrain&&ii.icon.orientationVertexBuffer&&Es.push("ELEVATED_ROADS"),ta(Es);const Ha=k.getOrCreateProgram("symbol",{defines:Es}),Kc=Lr.imageAtlasTexture?Lr.imageAtlasTexture.size:[0,0],hf=ii.iconSizeData,Lo=o.cG(hf,wn.zoom),Nc=Wn||!wn.isOrthographic,kh=o.dX(Ri,Lr.tileID.canonical,Wn,Bn,wn,ii.getProjection(),ji),ng=o.cF(Ri,Lr.tileID.canonical,Wn,Bn,wn,ii.getProjection(),ji),n1=ii.icon.uboBinder&&ii.icon.uboBinder.hasPerFeatureTranslate()?[0,0]:ne,Ls=k.translatePosMatrix(ng,Lr,n1,fe,true),am=k.translatePosMatrix(Ri,Lr,n1,fe),p0=Fc?tg:kh,vA=Bn&&!Wn&&!ul;let r1=qi;!si&&!wn.mercatorFromTransition||Bn||(r1=kb(wn));const i1=Di?r1:qi,U7=E.getColorAdjustmentMatrix(vt,It,jt,Zt),mI=oq(hf.kind,Lo,vA,Wn,k,am,p0,Ls,kn,false,ii.sdfIcons,Kc,[0,0],0,Wr,ci,Vr,Oa,i1,ii.getProjection(),t1,Js,U7,dl,null),gI=Lr.imageAtlasTexture?Lr.imageAtlasTexture:null,Db=1!==E.layout.get("icon-size").constantOr(0)||ii.iconsNeedLinear,vu=ii.sdfIcons||k.options.rotating||k.options.zooming||Db||Nc?xn.LINEAR:xn.NEAREST,Eo=ii.sdfIcons&&0!==E.paint.get("icon-halo-width").constantOr(1),xd=k.terrain&&Wn&&ul?o.aO(o.Y(),kh):tg;if(ul&&ii.icon){const _u=o.cW.getAtTileOffsetFunc(Wr,wn.center.lat,wn.worldSize,ii.getProjection()),kq=o.cE(Ri,Lr.tileID.canonical,Wn,Bn,wn,ii.getProjection(),ji),zv=E.layout.get("icon-size-scale-range"),Rq=o.b0(k.scaleFactor,zv[0],zv[1]);o.d$(ii,Ri,k,false,kq,ng,Wn,at,_u,Wr,Rq)}return{program:Ha,buffers:ii.icon,uniformValues:mI,atlasTexture:gI,atlasTextureIcon:null,atlasInterpolation:vu,atlasInterpolationIcon:null,isSDF:ii.sdfIcons,hasHalo:Eo,depthMode:$s,tile:Lr,renderWithShadows:gp,labelPlaneMatrixInv:xd}},$l=()=>{const ul=Kn&&"point"!==E.layout.get("symbol-placement"),Es=[],Fc=ul||mi||po,ff="road"===ii.elevationType,Lb=k.shadowRenderer,gp=ff&&Yn&&!!Lb&&Lb.enabled,t1=ws(gp),$s=ff&&Yn&&!k.terrain?kr:Qn;k.terrainRenderModeElevated()&&Yn&&Es.push("PITCH_WITH_MAP_TERRAIN"),Di&&(Es.push("PROJECTION_GLOBE_VIEW"),Fc&&Es.push("PROJECTED_POS_ON_VIEWPORT")),!ii.text.zOffsetVertexBuffer||ff&&k.terrain||Es.push("Z_OFFSET"),ii.iconsInText&&Es.push("RENDER_TEXT_AND_SYMBOL"),gp&&Es.push("RENDER_SHADOWS","NORMAL_OFFSET"),ff&&Yn&&!k.terrain&&ii.text.orientationVertexBuffer&&Es.push("ELEVATED_ROADS"),xo(Es),ta(Es);const dl=k.getOrCreateProgram("symbol",{defines:Es});let Ha,Kc=[0,0],hf=null;const Lo=ii.textSizeData;ii.iconsInText&&(Kc=Lr.imageAtlasTexture?Lr.imageAtlasTexture.size:[0,0],hf=Lr.imageAtlasTexture?Lr.imageAtlasTexture:null,Ha=Yn||!wn.isOrthographic||k.options.rotating||k.options.zooming||"composite"===Lo.kind||"camera"===Lo.kind?xn.LINEAR:xn.NEAREST);const Nc=Lr.glyphAtlasTexture?Lr.glyphAtlasTexture.size:[0,0],kh=E.layout.get("text-size-scale-range"),ng=o.b0(k.scaleFactor,kh[0],kh[1]),n1=o.cG(Lo,wn.zoom,ng),Ls=o.dX(Ri,Lr.tileID.canonical,Yn,Kn,wn,ii.getProjection(),ji),am=o.cF(Ri,Lr.tileID.canonical,Yn,Kn,wn,ii.getProjection(),ji),p0=ii.text.uboBinder&&ii.text.uboBinder.hasPerFeatureTranslate()?[0,0]:le,vA=k.translatePosMatrix(am,Lr,p0,me,true),r1=k.translatePosMatrix(Ri,Lr,p0,me),i1=Fc?tg:Ls,U7=Kn&&!Yn&&!ul;let mI=qi;!si&&!wn.mercatorFromTransition||Kn||(mI=kb(wn));const gI=oq(Lo.kind,n1,U7,Yn,k,r1,i1,vA,kn,true,true,Nc,Kc,0,Wr,ci,Vr,Oa,Di?mI:qi,ii.getProjection(),t1,Js,null,null,ng),Db=Lr.glyphAtlasTexture?Lr.glyphAtlasTexture:null,vu=xn.LINEAR,Eo=0!==E.paint.get("text-halo-width").constantOr(1),xd=k.terrain&&Yn&&ul?o.aO(o.Y(),Ls):tg;if(ul&&ii.text){const _u=o.cW.getAtTileOffsetFunc(Wr,wn.center.lat,wn.worldSize,ii.getProjection()),kq=o.cE(Ri,Lr.tileID.canonical,Yn,Kn,wn,ii.getProjection(),ji);o.d$(ii,Ri,k,true,kq,am,Yn,xt,_u,Wr,ng)}return{program:dl,buffers:ii.text,uniformValues:gI,atlasTexture:Db,atlasTextureIcon:hf,atlasInterpolation:vu,atlasInterpolationIcon:Ha,isSDF:true,hasHalo:Eo,depthMode:$s,tile:Lr,renderWithShadows:gp,labelPlaneMatrixInv:xd}},la=ii.icon.segments.get().length,cl=ii.text.segments.get().length,Fs=la&&!Z.onlyText?lc():null,hs=cl&&!Z.onlyIcons?$l():null,au=E.paint.get("icon-opacity").constantOr(1),su=E.paint.get("text-opacity").constantOr(1);if(Vn&&ii.canOverlap){Zr=true;const ul=au&&!Z.onlyText?ii.icon.segments.get():[],Es=su&&!Z.onlyIcons?ii.text.segments.get():[];for(const Fc of ul)Kr.push({segments:new o.ac([Fc]),sortKey:Fc.sortKey,state:Fs});for(const Fc of Es)Kr.push({segments:new o.ac([Fc]),sortKey:Fc.sortKey,state:hs})}else Z.onlyText||Kr.push({segments:au?ii.icon.segments:new o.ac([]),sortKey:0,state:Fs}),Z.onlyIcons||Kr.push({segments:su?ii.text.segments:new o.ac([]),sortKey:0,state:hs})}Zr&&Kr.sort((Wr,Lr)=>Wr.sortKey-Lr.sortKey);for(const Wr of Kr){const Lr=Wr.state;if(Lr)if(k.terrain?k.terrain.setupElevationDraw(Lr.tile,Lr.program,{useDepthForOcclusion:wn.depthOcclusionForSymbolsAndCircles,labelPlaneMatrixInv:Lr.labelPlaneMatrixInv}):k.setupDepthForOcclusion(wn.depthOcclusionForSymbolsAndCircles,Lr.program),hn.activeTexture.set(xn.TEXTURE0),Lr.atlasTexture&&Lr.atlasTexture.bind(Lr.atlasInterpolation,xn.CLAMP_TO_EDGE,true),Lr.atlasTextureIcon&&(hn.activeTexture.set(xn.TEXTURE1),Lr.atlasTextureIcon&&Lr.atlasTextureIcon.bind(Lr.atlasInterpolationIcon,xn.CLAMP_TO_EDGE,true)),Lr.renderWithShadows&&k.shadowRenderer.setupShadows(Lr.tile.tileID.toUnwrapped(),Lr.program,"vector-tile"),k.uploadCommonLightUniforms(k.context,Lr.program),Lr.hasHalo){const ii=Lr.uniformValues;ii.u_is_halo=1,w7(Lr.buffers,Wr.segments,E,k,Lr.program,Lr.depthMode,V,Y,ii,2),ii.u_is_halo=0}else{if(Lr.isSDF){const ii=Lr.uniformValues;Lr.hasHalo&&(ii.u_is_halo=1,w7(Lr.buffers,Wr.segments,E,k,Lr.program,Lr.depthMode,V,Y,ii,1)),ii.u_is_halo=0}w7(Lr.buffers,Wr.segments,E,k,Lr.program,Lr.depthMode,V,Y,Lr.uniformValues,1)}}}function w7(k,v,E,D,V,Y,Z,ne,le,fe){const me=D.context,Pe=me.gl,Re=[k.dynamicLayoutVertexBuffer,k.opacityVertexBuffer,k.iconTransitioningVertexBuffer,k.globeExtVertexBuffer,k.zOffsetVertexBuffer,k.orientationVertexBuffer];k.featureIdBuffer&&Re.push(k.featureIdBuffer);const Ke=k.uboBinder?null:k.programConfigurations.get(E.id);if(k.uboBinder){k.uboBinder.layer=E;const xt=D.transform.zoom,vt=D.style.getBrightness?D.style.getBrightness():null,It=k.uboBinder.getConstantUniformValues(xt,vt);le.u_spp_fill_np_color=It.fill_np_color,le.u_spp_halo_np_color=It.halo_np_color,le.u_spp_opacity=It.opacity,le.u_spp_halo_width=It.halo_width,le.u_spp_halo_blur=It.halo_blur,le.u_spp_emissive_strength=It.emissive_strength,le.u_spp_occlusion_opacity=It.occlusion_opacity,le.u_spp_z_offset=It.z_offset,le.u_spp_zoom_fraction=xt-k.uboBinder._floorZoom;const jt=E.paint.get(k.uboBinder.isText?"text-translate-anchor":"icon-translate-anchor"),Zt=k.uboBinder.hasPerFeatureTranslate()&&"map"===jt?D.transform.angle:0;le.u_spp_translate_rotation=[Math.cos(Zt),Math.sin(Zt)]}const{batchIndices:ot,batchSegments:at}=k.getBatchGrouping(v);for(const xt of ot){const vt=at.get(xt);k.uboBinder&&k.uboBinder.bind(me,V.program,xt),V.draw(D,Pe.TRIANGLES,Y,Z,ne,o.$.disabled,le,E.id,k.layoutVertexBuffer,k.indexBuffer,vt,E.paint,D.transform.zoom,Ke,Re,fe)}}function E7(k,v,E,D,V,Y){const Z=E.paint.get("line-width"),ne=E.paint.get("line-emissive-strength").isConstant(),le=E.paint.get("line-emissive-strength").constantOr(0),fe=E.paint.get("line-occlusion-opacity"),me=E.layout.get("line-elevation-reference"),Pe="meters"===E.layout.get("line-width-unit"),Re="sea"===me,Ke=!(!k.terrain||!k.terrain.enabled),ot=k.context,at=ot.gl;if(E.hasElevatedBuckets&&"globe"===k.transform.projection.name)return;const xt=E.layout.get("line-cross-slope"),vt=void 0!==xt,It=xt<1,jt=V||k.colorModeForDrapableLayerRenderPass(ne?le:null),Zt=k.terrain&&k.terrain.renderingToTexture||Y,kn=Zt?1:o.e.devicePixelRatio,cn=E.paint.get("line-dasharray"),hn=cn.constantOr(1),xn=E.layout.get("line-cap"),wn=cn.constantOr(null),Bn=xn.constantOr(null),Kn=E.paint.get("line-pattern"),Wn=Kn.constantOr(1),Yn=E.paint.get("line-pattern-cross-fade"),Vn=Kn.constantOr(null),Zr=E.paint.get("line-opacity").constantOr(1);let Qn=!Wn&&1!==Zr||k.depthOcclusion&&fe>0&&fe<1;const kr=E.paint.get("line-gradient"),Vr=0!==E.paint.get("line-border-width").constantOr(1)?E.paint.get("line-border-gradient"):null,mi=Wn?"linePattern":"line",si=o.e3(E);let Kr;if(Zt&&k.terrain&&k.terrain.clipOrMaskOverlapStencilType()&&(Qn=false),0!==fe&&k.depthOcclusion){const Ri=E.paint._values["line-opacity"];Ri&&Ri.value&&"constant"===Ri.value.kind?Kr=Ri.value:o.w(`Occlusion opacity for layer ${E.id} is supported only when line-opacity isn't data-driven.`)}"constant"!==Z.value.kind&&false===Z.value.isLineProgressConstant&&si.push("VARIABLE_LINE_WIDTH");const qi=E.paint.get("line-emissive-strength");Wn||"constant"===qi.value.kind||false!==qi.value.isLineProgressConstant||si.push("VARIABLE_LINE_EMISSIVE_STRENGTH"),k._debugParams.showElevationIdDebug&&si.push("DEBUG_ELEVATION_ID"),Zt&&("dual-source-blending"!==k.emissiveMode||ne?"mrt-fallback"===k.emissiveMode&&si.push("USE_MRT1"):si.push("DUAL_SOURCE_BLENDING"));const Wr={},Lr=[],ii=(Ri,ji,Go,po,Oa,Js)=>{for(const ws of Ri){const ta=v.getTile(ws);if(Wn&&!ta.patternsLoaded())continue;const xo=ta.getBucket(E);if(!xo)continue;if("none"!==xo.elevationType&&!Oa||"none"===xo.elevationType&&Oa)continue;k.prepareDrawTile();const Qs=[...ji],lc="road"===xo.elevationType,$l=k.shadowRenderer,la=lc&&!!$l&&$l.enabled;let cl=[0,0,0];if(la){const Lo=k.style.directionalLight,Nc=k.style.ambientLight;Lo&&Nc&&(cl=o.aF(k.style,Lo,Nc)),Qs.push("RENDER_SHADOWS","NORMAL_OFFSET")}const Fs=xo.programConfigurations.get(E.id);let hs=false;if(Vn&&ta.imageAtlas){const Lo=o.aG.from(Vn),Nc=Lo.getPrimary().scaleSelf(kn).toString(),kh=ta.imageAtlas.patternPositions.get(Nc),ng=Lo.getSecondary(),n1=ng?ta.imageAtlas.patternPositions.get(ng.scaleSelf(kn).toString()):null;hs=!!kh&&!!n1,kh&&Fs.setConstantPatternPositions(kh,n1)}Yn>0&&(hs||Fs.getPatternTransitionVertexBuffer("line-pattern"))&&Qs.push("LINE_PATTERN_TRANSITION"),xo.elevationGroundScaleVertexBuffer&&Qs.push("ELEVATION_GROUND_SCALE");const au=k.isTileAffectedByFog(ws),su=k.getOrCreateProgram(mi,{config:Fs,defines:Qs,overrideFog:au});if(!Wn&&wn&&Bn&&ta.lineAtlas){const Lo=ta.lineAtlas.getDash(wn,Bn);Lo&&Fs.setConstantPatternPositions(Lo)}la&&$l.setupShadows(ta.tileID.toUnwrapped(),su,"vector-tile");let[ul,Es]=E.paint.get("line-trim-offset");if("round"===Bn||"square"===Bn){const Lo=1;ul!==Es&&(0===ul&&(ul-=Lo),1===Es&&(Es+=Lo))}const Fc=Zt?ws.projMatrix:null,ff=Pe?1/xo.tileToMeter/o.c5(ta,1,k.transform.zoom):1,Lb=Pe?1/xo.tileToMeter/o.c5(ta,1,Math.floor(k.transform.zoom)):1,gp=hn?E.paint._values["line-floorwidth"]:null;let t1;if(gp&&"constant"===gp.value.kind){const Lo=xo.zoom;Lo in Wr||(Wr[Lo]=Math.max(.01,E.widthExpression().evaluate({zoom:Lo}))),t1=gp.value.value;const Nc=Math.floor(k.transform.zoom);gp.value.value=Wr[Lo]*Math.pow(2,Nc-ta.tileID.overscaledZ)}const $s=Wn?o.e4(k,ta,E,Fc,kn,ff,Lb,[ul,Es],cl,Yn):o.e5(k,ta,E,Fc,xo.lineClipsArray.length,kn,ff,Lb,[ul,Es],cl),dl=(Lo,Nc,kh,ng,n1,Ls)=>{let am=Lo.texture;if(Nc!==Lo.version){let p0=256;if(kh){const vA=v.getSource().maxzoom,r1=ws.canonical.z===vA?Math.ceil(1<{Nc&&0!==Nc.get().length&&(null!=Kr&&(Kr.value=Zr*fe),void 0!==kh&&($s.u_opacity_multiplier=kh),su.draw(k,at.TRIANGLES,Go,Lo,jt,o.$.disabled,$s,E.id,xo.layoutVertexBuffer,xo.indexBuffer,Nc,E.paint,k.transform.zoom,Fs,[xo.layoutVertexBuffer2,xo.patternVertexBuffer,xo.zOffsetVertexBuffer,xo.elevationIdColVertexBuffer,xo.elevationGroundScaleVertexBuffer]),void 0!==kh&&($s.u_opacity_multiplier=1),null!=Kr&&(Kr.value=Zr))},hf=Lo=>{Ha&&Ha.active&&To.drawLineFrcRenderLine?To.drawLineFrcRenderLine(xo,Ha,Lo,Kc):Kc(Lo,xo.segments)};if(Qn&&!Oa){const Lo=k.stencilModeForClipping(ws).ref;0===Lo&&Zt&&ot.clear({stencil:0});const Nc={func:at.EQUAL,mask:255};$s.u_alpha_discard_threshold=.8,hf(new o._(Nc,Lo,255,at.KEEP,at.KEEP,at.INVERT)),$s.u_alpha_discard_threshold=0,hf(new o._(Nc,Lo,255,at.KEEP,at.KEEP,at.KEEP))}else $s.u_alpha_discard_threshold=Qn&&Oa&&Js?.8:0,hf(Oa?po:k.stencilModeForClipping(ws));Ha&&To.drawLineFrcFadePass&&To.drawLineFrcFadePass(k,xo,ws,Ha,Oa,po,Kc),void 0!==t1&&(gp.value.value=t1)}};let Di=k.depthModeForSublayer(0,o.Z.ReadOnly);const ci=new o.Z(k.depthOcclusion?at.GREATER:at.LEQUAL,o.Z.ReadOnly,k.depthRangeFor3D);if(E.hasNonElevatedBuckets){const Ri=!Zt&&k.terrain;0!==fe&&Ri?o.w(`Occlusion opacity for layer ${E.id} is supported on terrain only if the layer has line-z-offset enabled.`):Ri?o.w(`Cannot render non-elevated lines in immediate mode when terrain is enabled. Layer: ${E.id}.`):ii(D,si,Di,o._.disabled,false,true)}if(E.hasElevatedBuckets){"hd-road-markup"===me?Ke||(Di=ci,si.push("ELEVATED_ROADS")):(si.push("ELEVATED"),Di=ci,vt&&si.push(It?"CROSS_SLOPE_HORIZONTAL":"CROSS_SLOPE_VERTICAL"),Re&&si.push("ELEVATION_REFERENCE_SEA"));const Ri=Qn?k.stencilModeFor3D():o._.disabled;"hd-road-markup"!==me&&(k.forceTerrainMode=true),ii(D,si,Di,Ri,true,true),Qn&&ii(D,si,Di,Ri,true,false),"hd-road-markup"!==me&&(k.forceTerrainMode=false)}To.drawLineFrcCoverageSecondPass&&To.drawLineFrcCoverageSecondPass(k,E,Lr),Qn&&(k.resetStencilClippingMasks(),Zt&&ot.clear({stencil:0})),0===fe||k.depthOcclusion||Zt||k.layersWithOcclusionOpacity.push(k.currentLayer)}class aq{destroy(){this.fbo&&(this.fbo.destroy(),this.fbo=null),this.drapeFbo&&(this.drapeFbo.destroy(),this.drapeFbo=null)}}class C7{constructor(v){this.pbo=v.createBuffer(),this.sync=null,this.fboA=null,this.fboB=null,this.maxDensity=0}destroy(v){this.sync&&(v.deleteSync(this.sync),this.sync=null),v.deleteBuffer(this.pbo),this.fboA&&(this.fboA.destroy(),this.fboA=null),this.fboB&&(this.fboB.destroy(),this.fboB=null)}}const aI={additive:{clearColor:new o.C(0,0,0,0),colorMode:o.a1.additiveAlphaWeighted,compositeUniformValue:1},multiply:{clearColor:new o.C(1,1,1,1),colorMode:o.a1.multiply,compositeUniformValue:0}};function mA(k){return!(!k.extRenderToTextureHalfFloat&&!k.extColorBufferFloat)}function S7(k,v){return"additive"===k&&mA(v)?o.a1.additiveAlphaWeightedUnboundedAlpha:aI[k].colorMode}function sq(k,v,E){const D=k.context,V=D.gl;let Y=E.width,Z=E.height,ne=E.colorAttachment0.get();v.lineBlendDensityReadback||(v.lineBlendDensityReadback=new C7(V));const le=v.lineBlendDensityReadback;let fe=0,me=true;for(;Y>1||Z>1;){const Ke=Math.max(1,Math.floor(Y/2)),ot=Math.max(1,Math.floor(Z/2)),at=0===fe?"fboA":"fboB";le[at]=pA.createWithTexture(D,le[at],Ke,ot,false);const xt=le[at];D.bindFramebuffer.set(xt.framebuffer),D.viewport.set([0,0,Ke,ot]),D.activeTexture.set(V.TEXTURE0),V.bindTexture(V.TEXTURE_2D,ne),k.getOrCreateProgram("lineBlendReduce").draw(k,V.TRIANGLES,o.Z.disabled,o._.disabled,o.a1.unblended,o.$.disabled,mse(0,[1/Y,1/Z],me),v.id,k.viewportBuffer,k.quadTriangleIndexBuffer,k.viewportSegments,v.paint,k.transform.zoom),Y=Ke,Z=ot,ne=xt.colorAttachment0.get(),fe=1-fe,me=false}const Pe=mA(D),Re=Pe?16:4;le.sync&&(V.deleteSync(le.sync),le.sync=null),V.bindBuffer(V.PIXEL_PACK_BUFFER,le.pbo),V.bufferData(V.PIXEL_PACK_BUFFER,Re,V.STREAM_READ),V.readPixels(0,0,1,1,V.RGBA,Pe?V.FLOAT:V.UNSIGNED_BYTE,0),V.bindBuffer(V.PIXEL_PACK_BUFFER,null),le.sync=V.fenceSync(V.SYNC_GPU_COMMANDS_COMPLETE,0),D.viewport.set([0,0,k.width,k.height])}function lq(k,v,E){if(!mA(k.context))return;const D=v.lineBlendDensityReadback;D&&D.sync?(function(V,Y,Z){if(V.sync&&Y.getSyncParameter(V.sync,Y.SYNC_STATUS)===Y.SIGNALED){if(Y.deleteSync(V.sync),V.sync=null,Y.bindBuffer(Y.PIXEL_PACK_BUFFER,V.pbo),mA(Z)){const ne=new Float32Array(4);Y.getBufferSubData(Y.PIXEL_PACK_BUFFER,0,ne);const le=ne[1];V.maxDensity=Math.max(2*(le>0?ne[0]/le:0),1)}else V.maxDensity=1;Y.bindBuffer(Y.PIXEL_PACK_BUFFER,null)}}(D,k.context.gl,k.context),D.sync||(sq(k,v,E),k.style.map.triggerRepaint())):(sq(k,v,E),k.style.map.triggerRepaint())}function cq(k,v,E,D,V,Y){const Z=k.context,ne=Z.gl,le="additive"===E?1:v.paint.get("line-opacity").constantOr(1),fe="additive"===E?function(Pe,Re){const Ke=Re.paint.get("line-blend-additive-clamp");if(Ke>0)return Ke;const ot=Re.lineBlendDensityReadback;return ot&&0!==ot.maxDensity?ot.maxDensity:null}(0,v):1;if(null===fe)return;Z.bindFramebuffer.set(V),Y&&Z.viewport.set([0,0,Y[0],Y[1]]),Z.activeTexture.set(ne.TEXTURE0),ne.bindTexture(ne.TEXTURE_2D,D.colorAttachment0.get());const me=S7(E,k.context);k.getOrCreateProgram("lineBlendComposite").draw(k,ne.TRIANGLES,o.Z.disabled,o._.disabled,me,o.$.disabled,((Pe,Re,Ke,ot)=>({u_image:0,u_opacity:Re,u_blend_mode:Ke,u_max_density:ot}))(0,le,aI[E].compositeUniformValue,fe),v.id,k.viewportBuffer,k.quadTriangleIndexBuffer,k.viewportSegments,v.paint,k.transform.zoom)}function A7(k,v,E,D){const{painter:V,sourceCache:Y,layer:Z,coords:ne,colorMode:le,elevationType:fe,terrainEnabled:me,pass:Pe}=k,Re=V.context.gl,Ke=Z.paint.get("fill-pattern"),ot=Z.paint.get("fill-pattern-cross-fade"),at=Ke.constantOr(null);let xt=fe;"road"!==fe||v&&!me||(xt="none");const vt="road"===xt,It=k.painter.shadowRenderer,jt=vt&&!!It&&It.enabled,Zt=new o.Z(V.context.gl.LEQUAL,o.Z.ReadOnly,V.depthRangeFor3D);let kn=[0,0,0];if(jt){const wn=V.style.directionalLight,Bn=V.style.ambientLight;wn&&Bn&&(kn=o.aF(V.style,wn,Bn))}const cn=Ke&&Ke.constantOr(1),hn=V.terrain&&V.terrain.renderingToTexture,xn=(wn,Bn)=>{let Kn,Wn,Yn,Vn,Zr;Bn?(Kn=cn&&!Z.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",Yn=Re.LINES):(Kn=cn?"fillPattern":"fill",Yn=Re.TRIANGLES);const Qn=[];for(const kr of ne){const Vr=Y.getTile(kr);if(cn&&!Vr.patternsLoaded())continue;const mi=Vr.getBucket(Z);if(!mi)continue;const si=v?mi.hdExt&&mi.hdExt.elevationBufferData:mi.bufferData;if(!si||si.isEmpty())continue;V.prepareDrawTile();const Kr=si.programConfigurations.get(Z.id),qi=V.isTileAffectedByFog(kr),Wr=[],Lr=[];vt&&(Wr.push("ELEVATED_ROADS"),Lr.push(si.elevatedLayoutVertexBuffer)),jt&&Wr.push("RENDER_SHADOWS","NORMAL_OFFSET"),hn&&E&&Wr.push("USE_MRT1"),cn&&(V.context.activeTexture.set(Re.TEXTURE0),Vr.imageAtlasTexture&&Vr.imageAtlasTexture.bind(Re.LINEAR,Re.CLAMP_TO_EDGE),Kr.updatePaintBuffers());let ii=false;if(at&&Vr.imageAtlas){const Oa=Vr.imageAtlas,Js=o.aG.from(at),ws=Js.getPrimary().scaleSelf(o.e.devicePixelRatio).toString(),ta=Js.getSecondary(),xo=Oa.patternPositions.get(ws),Qs=ta?Oa.patternPositions.get(ta.scaleSelf(o.e.devicePixelRatio).toString()):null;ii=!!xo&&!!Qs,xo&&Kr.setConstantPatternPositions(xo,Qs)}ot>0&&(ii||Kr.getPatternTransitionVertexBuffer("fill-pattern"))&&Wr.push("FILL_PATTERN_TRANSITION");const Di=V.getOrCreateProgram(Kn,{config:Kr,overrideFog:qi,defines:Wr}),ci=V.translatePosMatrix(kr.projMatrix,Vr,Z.paint.get("fill-translate"),Z.paint.get("fill-translate-anchor"));jt&&It.setupShadows(Vr.tileID.toUnwrapped(),Di,"vector-tile");const Ri=Z.paint.get("fill-emissive-strength");if(Bn){Vn=si.lineIndexBuffer,Zr=si.lineSegments;const Oa=V.terrain&&V.terrain.renderingToTexture?V.terrain.drapeBufferSize:[Re.drawingBufferWidth,Re.drawingBufferHeight];Wn="fillOutlinePattern"===Kn&&cn?DOe(ci,Ri,V,Vr,Oa,kn,ot):LOe(ci,Ri,Oa,kn)}else Vn=si.indexBuffer,Zr=si.triangleSegments,Wn=cn?oI(ci,Ri,V,Vr,kn,ot):rq(ci,Ri,kn);V.uploadCommonUniforms(V.context,Di,kr.toUnwrapped());let ji=wn;if(("road"===fe&&!me||"offset"===fe)&&(ji=Zt),!Zr||Zr.get&&0===Zr.get().length)continue;const Go=D||V.stencilModeForClipping(kr);let po="fallthrough";!Bn&&To.drawFillFrcCoverageFirstPass&&(po=To.drawFillFrcCoverageFirstPass({painter:V,layer:Z,bucket:mi,coord:kr,elevatedGeometry:v,program:Di,programConfiguration:Kr,uniformValues:Wn,drawMode:Yn,depthMode:ji,stencilMode:Go,colorMode:le,bufferData:si,indexBuffer:Vn,segments:Zr,dynamicBuffers:Lr,polygonCoverageTiles:Qn})),"fallthrough"===po&&Di.draw(V,Yn,ji,Go,le,o.$.disabled,Wn,Z.id,si.layoutVertexBuffer,Vn,Zr,Z.paint,V.transform.zoom,Kr,Lr)}!Bn&&To.drawFillFrcCoverageSecondPass&&To.drawFillFrcCoverageSecondPass(V,Z,Qn,Yn,le)};V.renderPass===Pe&&xn(V.depthModeForSublayer(1,"opaque"===V.renderPass?o.Z.ReadWrite:o.Z.ReadOnly),false),"none"===xt&&"translucent"===V.renderPass&&Z.paint.get("fill-antialias")&&xn(V.depthModeForSublayer(Z.getPaintProperty("fill-outline-color")?2:0,o.Z.ReadOnly),true)}function uq(k){return[k[0]*o.e9,k[1]*o.e9,k[2]*o.e9,0]}function n4(k,v,E,D,V,Y,Z,ne,le){const fe=D.getSource(),me=E.globeSharedBuffers;if(!me)return;let Pe,Re,Ke;if(v&&(Pe=D.getTile(v)),fe instanceof sy?(Re=fe.texture,Ke=o.dt(0,0,E.transform)):Pe&&v&&(Re=Pe.texture,Ke=o.dt(v.canonical.z,v.canonical.x,E.transform)),!Re||!Ke)return;k||(Ke=o.aN(o.Y(),Ke,[1,-1,1]));const ot=E.context,at=ot.gl,xt="nearest"===V.paint.get("raster-resampling")?at.NEAREST:at.LINEAR,vt=E.colorModeForDrapableLayerRenderPass(Y),It=Z.defines;It.push("GLOBE_POLES");const jt=new o.Z(at.LEQUAL,o.Z.ReadWrite,E.depthRangeFor3D),Zt=E.transform.expandedFarZProjMatrix,kn=Float32Array.from(o.b4(o.b5(new o.bX(0,0,0))));E.terrain&&E.terrain.prepareDrawTile(),ot.activeTexture.set(at.TEXTURE0),Re.bind(xt,at.CLAMP_TO_EDGE),ot.activeTexture.set(at.TEXTURE1),Re.bind(xt,at.CLAMP_TO_EDGE),"useMipmap"in Re&&ot.extTextureFilterAnisotropic&&E.transform.pitch>20&&at.texParameterf(at.TEXTURE_2D,ot.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,ot.extTextureFilterAnisotropicMax);const[cn,hn,xn,wn]=v?me.getPoleBuffers(v.canonical.z,false):me.getPoleBuffers(0,true),Bn=V.paint.get("raster-elevation");let Kn;k?(Kn=cn,E.renderDefaultNorthPole=0!==Bn):(Kn=hn,E.renderDefaultSouthPole=0!==Bn);const Wn=uq(Z.mix),Yn=((Zr,Qn,kr,Vr,mi,si,Kr,qi,Wr,Lr,ii,Di,ci,Ri)=>fA(Zr,Qn,kr,Vr,new Float32Array(16),new Float32Array(9),[0,0],mi,[0,0],[0,0,0,0],1,{opacity:1,mix:0},Kr,[0,0],Wr,2,ii,Di,ci,1,0,Ri))(E,Zt,kn,Ke,o.S(E.transform.zoom),0,V,0,Bn,0,Wn,Z.offset,Z.range,Y),Vn=E.getOrCreateProgram("raster",{defines:It});E.uploadCommonUniforms(ot,Vn,null),Vn.draw(E,at.TRIANGLES,jt,le,vt,ne,Yn,V.id,Kn,xn,wn)}function dq(k){if(k.isOrthographic)return[0,0,0,0];const v=k._nearZ,E=k.projection.farthestPixelDistance(k),D=E-v,V=.2*k.height,Y=v+V;return[v,E,(Y-V-v)/D,(Y-v)/D]}function vse(k,v,E,D){if(k)return"raster-array"===v.type?v.getTextureDescriptor(k,E,true):{texture:k.texture,mix:uq(D.mix),offset:D.offset,buffer:0,tileSize:1}}const _se=o.d0(new Float32Array(16)),Tse=o.a_([{name:"a_pos_3f",components:3,type:"Float32"}]),{members:wse}=Tse;function Ov(k,v,E,D){k.emplaceBack(v,E,D)}class fq{constructor(v){this.vertexArray=new o.ea,this.indices=new o.ad,Ov(this.vertexArray,-1,-1,1),Ov(this.vertexArray,1,-1,1),Ov(this.vertexArray,-1,1,1),Ov(this.vertexArray,1,1,1),Ov(this.vertexArray,-1,-1,-1),Ov(this.vertexArray,1,-1,-1),Ov(this.vertexArray,-1,1,-1),Ov(this.vertexArray,1,1,-1),this.indices.emplaceBack(5,1,3),this.indices.emplaceBack(3,7,5),this.indices.emplaceBack(6,2,0),this.indices.emplaceBack(0,4,6),this.indices.emplaceBack(2,6,7),this.indices.emplaceBack(7,3,2),this.indices.emplaceBack(5,4,0),this.indices.emplaceBack(0,1,5),this.indices.emplaceBack(0,2,3),this.indices.emplaceBack(3,1,0),this.indices.emplaceBack(7,6,4),this.indices.emplaceBack(4,5,7),this.vertexBuffer=v.createVertexBuffer(this.vertexArray,wse),this.indexBuffer=v.createIndexBuffer(this.indices),this.segment=o.ac.simpleSegment(0,0,36,12)}}function D2(k,v,E,D,V,Y){const Z=k.context.gl,ne=v.paint.get("sky-atmosphere-color"),le=v.paint.get("sky-atmosphere-halo-color"),fe=v.paint.get("sky-atmosphere-sun-intensity"),me=((Pe,Re,Ke,ot,at)=>({u_matrix_3f:Pe,u_sun_direction:Re,u_sun_intensity:Ke,u_color_tint_r:[ot.r,ot.g,ot.b,ot.a],u_color_tint_m:[at.r,at.g,at.b,at.a],u_luminance:5e-5}))(o.ed(o.ee(),D),V,fe,ne.toPremultipliedRenderColor(null),le.toPremultipliedRenderColor(null));Z.framebufferTexture2D(Z.FRAMEBUFFER,Z.COLOR_ATTACHMENT0,Z.TEXTURE_CUBE_MAP_POSITIVE_X+Y,v.skyboxTexture,0),E.draw(k,Z.TRIANGLES,o.Z.disabled,o._.disabled,o.a1.unblended,o.$.frontCW,me,"skyboxCapture",v.skyboxGeometry.vertexBuffer,v.skyboxGeometry.indexBuffer,v.skyboxGeometry.segment)}const Ese=o.a_([{type:"Float32",name:"a_pos",components:3},{type:"Float32",name:"a_uv",components:2}]);class hq{constructor(v){const E=new o.ef;E.emplaceBack(-1,1,1,0,0),E.emplaceBack(1,1,1,1,0),E.emplaceBack(1,-1,1,1,1),E.emplaceBack(-1,-1,1,0,1);const D=new o.ad;D.emplaceBack(0,1,2),D.emplaceBack(2,3,0),this.vertexBuffer=v.createVertexBuffer(E,Ese.members),this.indexBuffer=v.createIndexBuffer(D),this.segments=o.ac.simpleSegment(0,0,4,2)}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy()}}const pq=o.a_([{type:"Float32",name:"a_pos_3f",components:3},{type:"Float32",name:"a_uv",components:2},{type:"Float32",name:"a_size_scale",components:1},{type:"Float32",name:"a_opacity",components:1}]);class Cse{constructor(){this.colorModeAlphaBlendedWriteRGB=new o.a1([o.eg,o.eh,o.eg,o.eh],o.C.transparent,[true,true,true,false]),this.colorModeWriteAlpha=new o.a1([o.eg,o.ei,o.eg,o.ei],o.C.transparent,[false,false,false,true]),this.params={starsCount:16e3,sizeMultiplier:.15,sizeRange:100,intensityRange:200},this.updateNeeded=true,this._painter=null,this._devtoolsFolder=null}update(v){this._painter=v;const E=v.context;if(!this.atmosphereBuffer||this.updateNeeded){this.updateNeeded=false,this.atmosphereBuffer=new hq(E);let D=this.params;const V=D.sizeRange,Y=D.intensityRange,Z=function(Pe){const Re=o.bi(30),Ke=[];for(let ot=0;ot{const xn="globe"===Y.projection.name?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"];hn&&xn.push("ALPHA_PASS");const wn=v.getOrCreateProgram("globeAtmosphere",{defines:xn}),Bn=((Wn,Yn,Vn,Zr,Qn,kr,Vr,mi,si,Kr,qi,Wr)=>({u_frustum_tl:Wn,u_frustum_tr:Yn,u_frustum_br:Vn,u_frustum_bl:Zr,u_horizon:Qn,u_transition:kr,u_fadeout_range:Vr,u_atmosphere_fog_color:mi.toArray01(),u_high_color:si.toArray01(),u_space_color:Kr.toArray01(),u_temporal_offset:qi,u_horizon_angle:Wr}))(Y.frustumCorners.TL,Y.frustumCorners.TR,Y.frustumCorners.BR,Y.frustumCorners.BL,Y.frustumCorners.horizon,ne,xt,me,Re,ot,It,kn);v.uploadCommonUniforms(D,wn);const Kn=this.atmosphereBuffer;Kn&&wn.draw(v,V.TRIANGLES,Z,o._.disabled,hn?this.colorModeWriteAlpha:this.colorModeAlphaBlendedWriteRGB,o.$.backCW,Bn,hn?"atmosphere_glow_alpha":"atmosphere_glow",Kn.vertexBuffer,Kn.indexBuffer,Kn.segments)};cn(false),cn(true)}drawStars(v,E){const D=o.b0(E.properties.get("star-intensity"),0,1);if(0===D)return;const V=v.context,Y=V.gl,Z=v.transform,ne=v.getOrCreateProgram("stars"),le=o.bd([]);o.be(le,le,-Z._pitch),o.bf(le,le,-Z.angle),o.be(le,le,o.au(Z._center.lat)),o.em(le,le,-o.au(Z._center.lng));const fe=o.bg(new Float32Array(16),le),me=o.X([],Z.starsProjMatrix,fe),Pe=o.ed([],fe),Re=o.en([],Pe);let Ke=this.params.sizeMultiplier;const ot=[0,1,0];o.ct(ot,ot,Re),o.dB(ot,ot,Ke);const at=[1,0,0];o.ct(at,at,Re),o.dB(at,at,Ke);const xt=(vt=ot,It=at,jt=D,{u_matrix:Float32Array.from(me),u_up:vt,u_right:It,u_intensity_multiplier:jt});var vt,It,jt;v.uploadCommonUniforms(V,ne),this.starsVx&&this.starsIdx&&ne.draw(v,Y.TRIANGLES,o.Z.disabled,o._.disabled,this.colorModeAlphaBlendedWriteRGB,o.$.disabled,xt,"atmosphere_stars",this.starsVx,this.starsIdx,this.starsSegments)}}class NOe{}class mq{constructor(){this._storage=new Map}getLinesFromTrianglesBuffer(v,E,D){{const Pe=this._storage.get(E.id);if(Pe)return Pe.lastUsedFrameIdx=v,Pe.buf}const V=D.gl,Y=V.getBufferParameter(V.ELEMENT_ARRAY_BUFFER,V.BUFFER_SIZE),Z=new ArrayBuffer(Y),ne=new Int16Array(Z);V.getBufferSubData(V.ELEMENT_ARRAY_BUFFER,0,new Int16Array(Z));const le=new o.eo;for(let Pe=0;Pe30&&(D.buf.destroy(),this._storage.delete(E))}destroy(){for(const[v,E]of this._storage)E.buf.destroy(),this._storage.delete(v)}}class Sse{constructor(){this.occluderSize=30,this.depthOffset=-1e-4}}const sI={symbol:function(k,v,E,D,V){if("translucent"!==k.renderPass)return;const Y=o._.disabled,Z=k.colorModeForRenderPass(),ne=E.layout.get("text-variable-anchor"),le=E.layout.get("text-size-scale-range"),fe=o.b0(k.scaleFactor,le[0],le[1]);ne&&function(Re,Ke,ot,at,xt,vt,It,jt){const Zt=Ke.transform,kn="map"===xt,cn="map"===vt;for(const hn of Re){const xn=at.getTile(hn),wn=xn.getBucket(ot);if(!wn||!wn.text||!wn.text.segments.get().length)continue;const Bn=o.cG(wn.textSizeData,Zt.zoom,jt),Kn=wr(hn,wn.getProjection(),Zt),Wn=Zt.calculatePixelsToTileUnitsMatrix(xn),Yn=o.dX(Kn,xn.tileID.canonical,cn,kn,Zt,wn.getProjection(),Wn),Vn=wn.hasIconTextFit()&&wn.hasIconData();Bn&&xse(wn,kn,cn,It,Zt,Yn,hn,Math.pow(2,Zt.zoom-xn.tileID.overscaledZ),Bn,Vn)}}(D,k,E,v,E.layout.get("text-rotation-alignment"),E.layout.get("text-pitch-alignment"),V,fe);const me=0!==E.paint.get("icon-opacity").constantOr(1),Pe=0!==E.paint.get("text-opacity").constantOr(1);void 0!==E.layout.get("symbol-sort-key").constantOr(1)&&(me||Pe)?T7(k,v,E,D,Y,Z):(me&&T7(k,v,E,D,Y,Z,{onlyIcons:true}),Pe&&T7(k,v,E,D,Y,Z,{onlyText:true})),v.map.showCollisionBoxes&&Pn.drawCollisionDebug&&(Pn.drawCollisionDebug(k,v,E,D,E.paint.get("text-translate"),E.paint.get("text-translate-anchor"),true),Pn.drawCollisionDebug(k,v,E,D,E.paint.get("icon-translate"),E.paint.get("icon-translate-anchor"),false))},circle:function(k,v,E,D){if("translucent"!==k.renderPass)return;const V=E.paint.get("circle-opacity"),Y=E.paint.get("circle-stroke-width"),Z=E.paint.get("circle-stroke-opacity"),ne=void 0!==E.layout.get("circle-sort-key").constantOr(1),le=E.paint.get("circle-emissive-strength");if(0===V.constantOr(1)&&(0===Y.constantOr(1)||0===Z.constantOr(1)))return;const fe=k.context,me=fe.gl,Pe=k.transform,Re=!(!k.terrain||!k.terrain.enabled),Ke=E.layout.get("circle-elevation-reference"),ot=k.depthModeForSublayer(0,o.Z.ReadOnly),at=new o.Z(k.context.gl.LEQUAL,o.Z.ReadOnly,k.depthRangeFor3D),xt="none"===Ke||Re?ot:at,vt=o._.disabled,It=k.colorModeForDrapableLayerRenderPass(le),jt="globe"===Pe.projection.name,Zt=[o.a7(Pe.center.lng),o.a8(Pe.center.lat)],kn=[];for(let hn=0;hnhn.sortKey-xn.sortKey);const cn={useDepthForOcclusion:Pe.depthOcclusionForSymbolsAndCircles};for(const hn of kn){const{programConfiguration:xn,program:wn,layoutVertexBuffer:Bn,dynamicBuffers:Kn,indexBuffer:Wn,uniformValues:Yn,tile:Vn}=hn.state,Zr=hn.segments;k.terrain&&k.terrain.setupElevationDraw(Vn,wn,cn),k.uploadCommonUniforms(fe,wn,Vn.tileID.toUnwrapped()),wn.draw(k,me.TRIANGLES,xt,vt,It,o.$.disabled,Yn,E.id,Bn,Wn,Zr,E.paint,Pe.zoom,xn,Kn)}},heatmap:function(k,v,E,D){if(0!==E.paint.get("heatmap-opacity"))if("offscreen"===k.renderPass){const V=k.context,Y=V.gl,Z=o._.disabled,ne=new o.a1([Y.ONE,Y.ONE,Y.ONE,Y.ONE],o.C.transparent,[true,true,true,true]),le="globe"===k.transform.projection.name?.5:.25;E.heatmapFbo=pA.createWithTexture(V,E.heatmapFbo,k.width*le,k.height*le),V.clear({color:o.C.transparent});const fe=k.transform,me="globe"===fe.projection.name,Pe=me?["PROJECTION_GLOBE_VIEW"]:[],Re=me?o.$.frontCCW:o.$.disabled,Ke=[o.a7(fe.center.lng),o.a8(fe.center.lat)];for(let ot=0;ot({u_image:0,u_color_ramp:1,u_opacity:Pe.paint.get("heatmap-opacity")}))(0,Y),Y.id,V.viewportBuffer,V.quadTriangleIndexBuffer,V.viewportSegments,Y.paint,V.transform.zoom)}(k,E))},line:function(k,v,E,D){const V=E.paint.get("line-opacity"),Y=E.paint.get("line-width");if(0===V.constantOr(1)||0===Y.constantOr(1))return;const Z=E.paint.get("line-blend-mode"),ne=k.terrain&&k.terrain.renderingToTexture;if("default"===Z||"globe"===k.transform.projection.name)"translucent"===k.renderPass&&E7(k,v,E,D);else{if(ne)return void function(le,fe,me,Pe,Re){if("translucent"!==le.renderPass)return;const Ke=le.context,ot=Ke.gl,at=le.terrain;if(!at)return;const xt=Ke.bindFramebuffer.current,vt="mrt-fallback"===le.emissiveMode,It=at.drapeBufferSize[0],jt=at.drapeBufferSize[1];me.lineBlendFbos||(me.lineBlendFbos=new aq),me.lineBlendFbos.drapeFbo=pA.createWithTexture(Ke,me.lineBlendFbos.drapeFbo,It,jt,true),vt&&ot.drawBuffers([ot.COLOR_ATTACHMENT0]),Ke.clear({color:aI[Re].clearColor,depth:1,stencil:0});const Zt=le.currentStencilSource,kn=le._tileClippingMaskIDs,cn=le.nextStencilID;le.currentStencilSource=void 0,le._tileClippingMaskIDs={},le.nextStencilID=1;const hn=le._terrain;le._terrain=null,le._renderTileClippingMasks(me,fe,Pe),E7(le,fe,me,Pe,S7(Re,le.context),true),le._terrain=hn,le.currentStencilSource=Zt,le._tileClippingMaskIDs=kn,le.nextStencilID=cn,vt&&ot.drawBuffers([ot.COLOR_ATTACHMENT0,ot.COLOR_ATTACHMENT1]);const xn=at.drapeBufferSize,wn=me.lineBlendFbos&&me.lineBlendFbos.drapeFbo;wn&&("additive"===Re&&lq(le,me,wn),cq(le,me,Re,wn,xt,xn))}(k,v,E,D,Z);if("offscreen"===k.renderPass)return void function(le,fe,me,Pe,Re){const Ke=le.context,ot=Math.ceil(le.width),at=Math.ceil(le.height);me.lineBlendFbos||(me.lineBlendFbos=new aq),me.lineBlendFbos.fbo=pA.createWithTexture(Ke,me.lineBlendFbos.fbo,ot,at,true),Ke.clear({color:aI[Re].clearColor,depth:1,stencil:0});const xt=le.currentStencilSource,vt=le._tileClippingMaskIDs,It=le.nextStencilID;le.currentStencilSource=void 0,le._tileClippingMaskIDs={},le.nextStencilID=1,le._renderTileClippingMasks(me,fe,Pe);const jt=le.renderPass;le.renderPass="translucent",E7(le,fe,me,Pe,S7(Re,le.context)),le.renderPass=jt,le.currentStencilSource=xt,le._tileClippingMaskIDs=vt,le.nextStencilID=It,Ke.viewport.set([0,0,le.width,le.height]),"additive"===Re&&lq(le,me,me.lineBlendFbos.fbo)}(k,v,E,D,Z);if("translucent"===k.renderPass){const le=E.lineBlendFbos&&E.lineBlendFbos.fbo;return void(le&&cq(k,E,Z,le,null))}}},fill:function(k,v,E,D){const V=E.paint.get("fill-color"),Y=E.paint.get("fill-opacity");if(0===Y.constantOr(1))return;const Z=E.paint.get("fill-emissive-strength"),ne=k.colorModeForDrapableLayerRenderPass(Z),le=E.paint.get("fill-pattern"),fe=k.opaquePassEnabledForLayer()&&!le.constantOr(1)&&1===V.constantOr(o.C.transparent).a&&1===Y.constantOr(0)?"opaque":"translucent";let me="none";"none"!==E.layout.get("fill-elevation-reference")?me="road":0!==E.paint.get("fill-z-offset").constantOr(1)&&(me="offset");const Pe=!(!k.terrain||!k.terrain.enabled),Re={painter:k,sourceCache:v,layer:E,coords:D,colorMode:ne,elevationType:me,terrainEnabled:Pe,pass:fe};if("shadow"===k.renderPass)return void(k.shadowRenderer&&"road"===me&&!Pe&&To.drawElevatedFillShadows&&To.drawElevatedFillShadows(Re));const Ke="mrt-fallback"===k.emissiveMode;if("offset"!==me){if(A7(Re,false,Ke),"road"===me){const ot=!Pe&&"translucent"===k.renderPass;ot&&To.drawDepthPrepass&&To.drawDepthPrepass(k,v,E,D,"geometry"),A7(Re,true,Ke,o._.disabled),ot&&To.drawElevatedStructures&&To.drawElevatedStructures(Re)}}else A7(Re,false,Ke,k.stencilModeFor3D())},"fill-extrusion":function(k,v,E,D){const V=E.paint.get("fill-extrusion-opacity"),Y=k.context,Z=Y.gl,ne=k.terrain,le=ne&&ne.renderingToTexture;if(0===V)return;const fe="mrt-fallback"===k.emissiveMode,me=k.conflationActive&&k.style.isLayerClipped(E,v.getSource()),Pe=k.style.order.indexOf(E.fqid);if(me&&function(Re,Ke,ot,at,xt){for(const vt of at){const It=Ke.getTile(vt).getBucket(ot);It&&(It.updateReplacement(vt,Re.replacementSource,xt),It.uploadCentroid(Re.context))}}(k,v,E,D,Pe),ne||me)for(const Re of D){const Ke=v.getTile(Re).getBucket(E);Ke&&xu(k.context,v,Re,Ke,E,ne,me)}if("shadow"===k.renderPass&&k.shadowRenderer){if(ne&&V<.65&&E._transitionablePaint._values["fill-extrusion-opacity"].value.expression instanceof o.aj)return;const Re=k.shadowRenderer.getShadowPassDepthMode();Ts(k,v,E,D,Re,o._.disabled,o.a1.disabled,me)}else if("translucent"===k.renderPass){const Re=!E.paint.get("fill-extrusion-pattern").constantOr(1),Ke=E.paint.get("fill-extrusion-color").constantOr(o.C.white);if(!le&&0!==Ke.a){const at=new o.Z(k.context.gl.LEQUAL,o.Z.ReadWrite,k.depthRangeFor3D);1===V&&Re?Ts(k,v,E,D,at,o._.disabled,o.a1.unblended,me):(Ts(k,v,E,D,at,o._.disabled,o.a1.disabled,me),Ts(k,v,E,D,at,k.stencilModeFor3D(),k.colorModeForRenderPass(),me),k.resetStencilClippingMasks())}const ot=k.style.enable3dLights()&&Re&&(!ne&&"globe"!==k.transform.projection.name||le);if(ot&&!bo.drawGroundEffect&&aa(),ot&&bo.drawGroundEffect){const at=E.paint.get("fill-extrusion-opacity"),xt=E.paint.get("fill-extrusion-ambient-occlusion-intensity"),vt=E.paint.get("fill-extrusion-ambient-occlusion-ground-radius"),It=E.paint.get("fill-extrusion-flood-light-intensity"),jt="none"===E.paint.get("fill-extrusion-flood-light-color-use-theme").constantOr("default"),Zt=E.paint.get("fill-extrusion-flood-light-color").toNonPremultipliedRenderColor(jt?null:E.lut).toArray01().slice(0,3),kn=xt>0&&vt>0,cn=It>0,hn=new Xo;hn.translate=E.paint.get("fill-extrusion-translate"),hn.translateAnchor=E.paint.get("fill-extrusion-translate-anchor"),hn.edgeRadius=E.layout.get("fill-extrusion-edge-radius"),hn.cutoffFadeRange=E.paint.get("fill-extrusion-cutoff-fade-range");const xn=wn=>{const Bn=k.depthModeForSublayer(1,o.Z.ReadOnly,Z.LEQUAL,true),Kn=E.paint.get(wn?"fill-extrusion-ambient-occlusion-ground-attenuation":"fill-extrusion-flood-light-ground-attenuation"),Wn=o.al(.1,3,Kn),Yn=k._showOverdrawInspector;if(!Yn){const Vn=new o._({func:Z.ALWAYS,mask:255},255,255,Z.KEEP,Z.KEEP,Z.REPLACE),Zr=new o.a1([Z.ONE,Z.ONE,Z.ONE,Z.ONE],o.C.transparent,[false,false,false,true],Z.MIN);bo.drawGroundEffect(hn,k,v,E,D,Bn,Vn,Zr,o.$.disabled,wn,"sdf",at,xt,vt,It,Zt,Wn,me,false)}{const Vn=Yn?o._.disabled:new o._({func:Z.EQUAL,mask:255},255,255,Z.KEEP,Z.DECR,Z.DECR),Zr=Yn?k.colorModeForRenderPass():new o.a1([Z.ONE_MINUS_DST_ALPHA,Z.DST_ALPHA,Z.ONE,Z.ONE],o.C.transparent,[true,true,true,true]);bo.drawGroundEffect(hn,k,v,E,D,Bn,Vn,Zr,o.$.disabled,wn,"color",at,xt,vt,It,Zt,Wn,me,false)}};if(le){const wn=()=>{const Kn=ne.drapeBufferSize[0],Wn=ne.drapeBufferSize[1];let Yn=ne.framebufferCopyTexture;return Yn&&(!Yn||Yn.size[0]===Kn&&Yn.size[1]===Wn)||(Yn&&Yn.destroy(),Yn=ne.framebufferCopyTexture=new o.T(Y,new o.b({width:Kn,height:Wn}),Z.RGBA8)),Yn.bind(Z.LINEAR,Z.CLAMP_TO_EDGE),Z.copyTexSubImage2D(Z.TEXTURE_2D,0,0,0,0,0,Kn,Wn),Yn},Bn=(Kn,Wn,Yn)=>{const Vn=k.depthModeForSublayer(1,o.Z.ReadOnly,Z.LEQUAL,false),Zr=E.paint.get(Kn?"fill-extrusion-ambient-occlusion-ground-attenuation":"fill-extrusion-flood-light-ground-attenuation"),Qn=o.al(.1,3,Zr);{const kr=new o.a1([Z.ONE,Z.ONE,Z.ONE,Z.ONE],o.C.transparent,[false,false,false,true]);bo.drawGroundEffect(hn,k,v,E,D,Vn,o._.disabled,kr,o.$.disabled,Kn,"clear",at,xt,vt,It,Zt,Qn,me,Wn)}{const kr=new o._({func:Z.ALWAYS,mask:255},255,255,Z.KEEP,Z.KEEP,Z.REPLACE),Vr=new o.a1([Z.ONE,Z.ONE,Z.ONE,Z.ONE],o.C.transparent,[false,false,false,true],Z.MIN);bo.drawGroundEffect(hn,k,v,E,D,Vn,kr,Vr,o.$.disabled,Kn,"sdf",at,xt,vt,It,Zt,Qn,me,Wn)}fe&&!Kn&&(Yn=wn());{const kr=Kn?Z.ZERO:Z.ONE_MINUS_DST_ALPHA,Vr=new o._({func:Z.EQUAL,mask:255},255,255,Z.KEEP,Z.DECR,Z.DECR),mi=new o.a1([kr,Z.DST_ALPHA,Z.ONE_MINUS_DST_ALPHA,Z.ZERO],o.C.transparent,[true,true,true,true]);bo.drawGroundEffect(hn,k,v,E,D,Vn,Vr,mi,o.$.disabled,Kn,"color",at,xt,vt,It,Zt,Qn,me,Wn)}if(!fe||Kn){const kr=new o.a1([Z.ONE,Z.ONE,Z.ONE,Kn?Z.ZERO:Z.ONE],o.C.transparent,[false,false,false,true],Kn?Z.FUNC_ADD:Z.MAX);bo.drawGroundEffect(hn,k,v,E,D,Vn,o._.disabled,kr,o.$.disabled,Kn,"clear",at,xt,vt,It,Zt,Qn,me,Wn,Yn)}else{Z.drawBuffers([Z.NONE,Z.COLOR_ATTACHMENT1]);const kr=new o._({func:Z.EQUAL,mask:255},254,255,Z.KEEP,Z.DECR,Z.DECR),Vr=new o.a1([Z.ONE,Z.ONE,Z.ONE,Z.ONE],o.C.transparent,[true,false,false,false],Z.MAX);bo.drawGroundEffect(hn,k,v,E,D,Vn,kr,Vr,o.$.disabled,Kn,"emissive",at,xt,vt,It,Zt,Qn,me,Wn,Yn),Z.drawBuffers([Z.COLOR_ATTACHMENT0])}};if(kn||cn){let Kn;k.prepareDrawTile(),fe&&!kn||(Kn=wn()),kn&&Bn(true,false,Kn),cn&&Bn(false,true,Kn)}}else kn&&xn(true),cn&&xn(false),(kn||cn)&&k.resetStencilClippingMasks()}}},hillshade:function(k,v,E,D){if("offscreen"!==k.renderPass&&"translucent"!==k.renderPass)return;if(k.style.disableElevatedTerrain)return;const V=k.context,Y=k.terrain&&k.terrain.renderingToTexture,[Z,ne]="translucent"!==k.renderPass||Y?[{},D]:k.stencilConfigForOverlap(D);for(const le of ne){const fe=v.getTile(le);if(fe.needsHillshadePrepare&&"offscreen"===k.renderPass)wOe(k,fe,E);else if("translucent"===k.renderPass){const me=k.depthModeForSublayer(0,o.Z.ReadOnly),Pe=E.paint.get("hillshade-emissive-strength"),Re=k.colorModeForDrapableLayerRenderPass(Pe),Ke=Y&&k.terrain?k.terrain.stencilModeForRTTOverlap(le):Z[le.overscaledZ];nI(k,le,fe,E,me,Ke,Re)}}V.viewport.set([0,0,k.width,k.height]),k.resetStencilClippingMasks()},raster:function(k,v,E,D,V,Y){if("translucent"!==k.renderPass)return;const Z=E.paint.get("raster-opacity");if(0===Z)return;const ne="globe"===k.transform.projection.name,le=0!==E.paint.get("raster-elevation"),fe=le&&ne,me=k.terrain&&k.terrain.exaggeration()>0&&le&&"ground"===E.paint.get("raster-elevation-reference"),Pe=!ne&&me;if(k.renderElevatedRasterBackface&&!fe)return;const Re=k.context,Ke=Re.gl,ot=v.getSource(),at=function(wn,Bn,Kn,Wn,Yn){const Vn=Bn.paint.get("raster-color"),Zr="raster-array"===wn.type,Qn=[],kr=Bn.paint.get("raster-resampling"),Vr=Bn.paint.get("raster-color-mix");let mi=Bn.paint.get("raster-color-range");const si=[Vr[0],Vr[1],Vr[2],0],Kr=Vr[3];let qi="nearest"===kr?Wn.NEAREST:Wn.LINEAR;if(Zr&&(Qn.push("RASTER_ARRAY"),Vn||Qn.push("RASTER_COLOR"),"linear"===kr&&Qn.push("RASTER_ARRAY_LINEAR"),qi=Wn.NEAREST,!mi&&wn.rasterLayers)){const Wr=wn.rasterLayers.find(({id:Lr})=>Lr===Bn.sourceLayer);Wr&&Wr.fields&&Wr.fields.range&&(mi=Wr.fields.range)}if(mi=mi||[0,1],Vn){Qn.push("RASTER_COLOR"),Kn.activeTexture.set(Wn.TEXTURE2),Bn.updateColorRamp(mi);let Wr=Bn.colorRampTexture;Wr||(Wr=Bn.colorRampTexture=new o.T(Kn,Bn.colorRamp,Wn.RGBA8)),Wr.bind(qi,Wn.CLAMP_TO_EDGE)}return Yn&&Qn.push("USE_MRT1"),{mix:si,range:mi,offset:Kr,defines:Qn,resampling:qi}}(ot,E,Re,Ke,k.terrain&&k.terrain.renderingToTexture&&"mrt-fallback"===k.emissiveMode);if(ot instanceof sy&&!D.length&&!ne)return;const xt=E.paint.get("raster-emissive-strength"),vt=k.colorModeForDrapableLayerRenderPass(xt),It=k.terrain&&k.terrain.renderingToTexture,jt=!k.options.moving,Zt="nearest"===E.paint.get("raster-resampling")?Ke.NEAREST:Ke.LINEAR;if(ot instanceof sy&&!D.length&&(ot.onNorthPole||ot.onSouthPole)){const wn=le?k.stencilModeFor3D():o._.disabled;return void n4(!!ot.onNorthPole,null,k,v,E,xt,at,o.$.disabled,wn)}if(!D.length)return;const[kn,cn]=ot instanceof sy||It?[{},D]:k.stencilConfigForOverlap(D),hn=cn.at(-1).overscaledZ;fe&&at.defines.push("PROJECTION_GLOBE_VIEW"),le&&at.defines.push("RENDER_CUTOFF","ELEVATED"),me&&at.defines.push("ELEVATION_REFERENCE_GROUND");const xn=(wn,Bn,Kn)=>{for(const Wn of wn){const Yn=Wn.toUnwrapped(),Vn=v.getTile(Wn);if(It&&(!Vn||!Vn.hasData()))continue;Re.activeTexture.set(Ke.TEXTURE0);const Zr=vse(Vn,ot,E,at);if(!Zr||!Zr.texture)continue;const{texture:Qn,mix:kr,offset:Vr,tileSize:mi,buffer:si}=Zr;let Kr,qi;It?(Kr=o.Z.disabled,qi=Wn.projMatrix):le?(Kr=new o.Z(Ke.LEQUAL,o.Z.ReadWrite,k.depthRangeFor3D),qi=ne?k.transform.expandedFarZProjMatrix:k.transform.calculateProjMatrix(Yn,jt)):(Kr=k.depthModeForSublayer(Wn.overscaledZ-hn,1===Z?o.Z.ReadWrite:o.Z.ReadOnly,Ke.LESS),qi=k.transform.calculateProjMatrix(Yn,jt));const Wr=k.terrain&&It?k.terrain.stencilModeForRTTOverlap(Wn):kn[Wn.overscaledZ],Lr=Y?0:E.paint.get("raster-fade-duration");Vn.registerFadeDuration(Lr);const ii=v.findLoadedParent(Wn,0),Di=Gd(Vn,ii,v,k.transform,Lr);let ci,Ri;!Di.isFading&&Vn.refreshedUponExpiration&&(Vn.refreshedUponExpiration=false),k.terrain&&k.terrain.prepareDrawTile(),Re.activeTexture.set(Ke.TEXTURE0),Qn.bind(Zt,Ke.CLAMP_TO_EDGE),Re.activeTexture.set(Ke.TEXTURE1),ii?(ii.texture&&ii.texture.bind(Zt,Ke.CLAMP_TO_EDGE),ci=Math.pow(2,ii.tileID.overscaledZ-Vn.tileID.overscaledZ),Ri=[Vn.tileID.canonical.x*ci%1,Vn.tileID.canonical.y*ci%1]):Qn.bind(Zt,Ke.CLAMP_TO_EDGE),"useMipmap"in Qn&&Re.extTextureFilterAnisotropic&&k.transform.pitch>20&&Ke.texParameterf(Ke.TEXTURE_2D,Re.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,Re.extTextureFilterAnisotropicMax);const ji=k.transform;let Go;const po=le?dq(ji):[0,0,0,0];let Oa,Js,ws,ta,xo,Qs=0;if(fe&&ot instanceof sy&&ot.coordinates.length>3)Oa=Float32Array.from(o.b4(o.b5(new o.bX(0,0,0)))),Js=Float32Array.from(ji.globeMatrix),ws=Float32Array.from(o.b6(ji)),ta=[o.a7(ji.center.lng),o.a8(ji.center.lat)],Go=ot.elevatedGlobePerspectiveTransform,xo=ot.elevatedGlobeGridMatrix||new Float32Array(9);else if(fe){const cl=o.b2(Wn.canonical);Qs=o.b3(cl.getCenter().lat),Oa=Float32Array.from(o.b4(o.b5(Wn.canonical))),Js=Float32Array.from(ji.globeMatrix),ws=Float32Array.from(o.b6(ji)),ta=[o.a7(ji.center.lng),o.a8(ji.center.lat)],Go=[0,0],xo=Float32Array.from(o.b7(Wn.canonical,cl,Qs,ji.worldSize/ji._pixelsPerMercatorPixel))}else Go=ot instanceof sy?ot.perspectiveTransform:[0,0],Oa=new Float32Array(16),Js=new Float32Array(9),ws=new Float32Array(16),ta=[0,0],xo=new Float32Array(9);const lc=fA(k,qi,Oa,Js,ws,xo,Ri||[0,0],o.S(k.transform.zoom),ta,po,ci||1,Di,E,Go,le?E.paint.get("raster-elevation"):0,2,kr,Vr,at.range,mi,si,xt),$l=k.isTileAffectedByFog(Wn),la=k.getOrCreateProgram("raster",{defines:at.defines,overrideFog:$l});if(k.uploadCommonUniforms(Re,la,Yn),ot instanceof sy){const cl=ot.elevatedGlobeVertexBuffer,Fs=ot.elevatedGlobeIndexBuffer;if(It||!ne)ot.boundsBuffer&&ot.boundsSegments&&la.draw(k,Ke.TRIANGLES,Kr,o._.disabled,vt,o.$.disabled,lc,E.id,ot.boundsBuffer,k.quadTriangleIndexBuffer,ot.boundsSegments);else if(cl&&Fs){const hs=ji.zoom<=o.e8?ot.elevatedGlobeSegments:ot.getSegmentsForLongitude(ji.center.lng);hs&&la.draw(k,Ke.TRIANGLES,Kr,o._.disabled,vt,Bn,lc,E.id,cl,Fs,hs)}}else if(fe){Kr=new o.Z(Ke.LEQUAL,o.Z.ReadOnly,k.depthRangeFor3D);const cl=k.globeSharedBuffers;if(cl){me&&(k.terrain.setupElevationDraw(Vn,la),k.uploadCommonUniforms(Re,la,Vn.tileID.toUnwrapped()));const[Fs,hs,au]=cl.getGridBuffers(Qs,false),su=la.getAttributeLocation(Ke,"a_texture_pos");-1!==su&&Ke.vertexAttribI4ui(su,0,0,0,0),la.draw(k,Ke.TRIANGLES,Kr,Kn||Wr,k.colorModeForRenderPass(),Bn,lc,E.id,Fs,hs,au)}}else if(Pe)Kr=new o.Z(Ke.LEQUAL,o.Z.ReadWrite,k.depthRangeFor3D),k.terrain.setupElevationDraw(Vn,la),k.uploadCommonUniforms(Re,la,Vn.tileID.toUnwrapped()),ji.pitch>20&&la.draw(k,Ke.TRIANGLES,Kr,o._.disabled,o.a1.disabled,o.$.frontCCW,lc,E.id,k.terrain.gridBuffer,k.terrain.gridIndexBuffer,k.terrain.gridSegments),la.draw(k,Ke.TRIANGLES,Kr,Wr,vt,o.$.backCCW,lc,E.id,k.terrain.gridBuffer,k.terrain.gridIndexBuffer,k.terrain.gridSegments);else{const{tileBoundsBuffer:cl,tileBoundsIndexBuffer:Fs,tileBoundsSegments:hs}=k.getTileBoundsBuffers(Vn);la.draw(k,Ke.TRIANGLES,Kr,Wr,vt,o.$.disabled,lc,E.id,cl,Fs,hs)}}if(!(ot instanceof sy)&&fe)for(const Wn of wn){const Yn=Wn.canonical.y===(1<hn.tileID)),Ke&&(fe.activeTexture.set(me.TEXTURE0),k.imageManager.bind(k.context,E.scope));const cn=[];if(k.terrain&&k.terrain.renderingToTexture&&"mrt-fallback"===k.emissiveMode&&cn.push("USE_MRT1"),le){const hn=k.getOrCreateProgram(jt,{overrideFog:false,overrideRtt:true,defines:cn}),xn=_se,wn=new o.bP(0,0,0,0,0),Bn=Ke?e4(xn,ne,Z,k,Ke,E.scope,ot,le,{tileID:wn,tileSize:Re}):QF(xn,ne,Z,V.toPremultipliedRenderColor(Y?null:E.lut));return void hn.draw(k,me.TRIANGLES,vt,xt,It,o.$.disabled,Bn,E.id,k.viewportBuffer,k.quadTriangleIndexBuffer,k.viewportSegments)}for(const hn of kn){const xn=k.isTileAffectedByFog(hn),wn=k.getOrCreateProgram(jt,{overrideFog:xn,defines:cn}),Bn=hn.toUnwrapped(),Kn=D?hn.projMatrix:k.transform.calculateProjMatrix(Bn);k.prepareDrawTile();const Wn=v?v.getTile(hn):Zt?Zt[hn.key]:new Mv(hn,Re,Pe.zoom,k),Yn=Ke?e4(Kn,ne,Z,k,Ke,E.scope,ot,le,{tileID:hn,tileSize:Re}):QF(Kn,ne,Z,V.toPremultipliedRenderColor(Y?null:E.lut));k.uploadCommonUniforms(fe,wn,Bn);const{tileBoundsBuffer:Vn,tileBoundsIndexBuffer:Zr,tileBoundsSegments:Qn}=k.getTileBoundsBuffers(Wn);wn.draw(k,me.TRIANGLES,vt,xt,It,o.$.disabled,Yn,E.id,Vn,Zr,Qn)}},sky:function(k,v,E){const D=k._atmosphere?o.S(k.transform.zoom):1,V=E.paint.get("sky-opacity")*D;if(0===V)return;const Y=k.context,Z=E.paint.get("sky-type"),ne=new o.Z(Y.gl.LEQUAL,o.Z.ReadOnly,[0,1]),le=k.frameCounter/1e3%1;"atmosphere"===Z?"offscreen"===k.renderPass?E.needsSkyboxCapture(k)&&(function(fe,me){const Pe=fe.context,Re=Pe.gl;let Ke=me.skyboxFbo;if(!Ke){Ke=me.skyboxFbo=Pe.createFramebuffer(32,32,1,null),me.skyboxGeometry=new fq(Pe),me.skyboxTexture=Pe.gl.createTexture(),Re.bindTexture(Re.TEXTURE_CUBE_MAP,me.skyboxTexture),Re.texParameteri(Re.TEXTURE_CUBE_MAP,Re.TEXTURE_WRAP_S,Re.CLAMP_TO_EDGE),Re.texParameteri(Re.TEXTURE_CUBE_MAP,Re.TEXTURE_WRAP_T,Re.CLAMP_TO_EDGE),Re.texParameteri(Re.TEXTURE_CUBE_MAP,Re.TEXTURE_MIN_FILTER,Re.LINEAR),Re.texParameteri(Re.TEXTURE_CUBE_MAP,Re.TEXTURE_MAG_FILTER,Re.LINEAR);for(let vt=0;vt<6;++vt)Re.texImage2D(Re.TEXTURE_CUBE_MAP_POSITIVE_X+vt,0,Re.RGBA,32,32,0,Re.RGBA,Re.UNSIGNED_BYTE,null)}Pe.bindFramebuffer.set(Ke.framebuffer),Pe.viewport.set([0,0,32,32]);const ot=me.getCenter(fe,true),at=fe.getOrCreateProgram("skyboxCapture"),xt=new Float64Array(16);o.eb(xt,.5*-Math.PI),D2(fe,me,at,xt,ot,0),o.eb(xt,.5*Math.PI),D2(fe,me,at,xt,ot,1),o.ec(xt,.5*-Math.PI),D2(fe,me,at,xt,ot,2),o.ec(xt,.5*Math.PI),D2(fe,me,at,xt,ot,3),o.d0(xt),D2(fe,me,at,xt,ot,4),o.eb(xt,Math.PI),D2(fe,me,at,xt,ot,5),Pe.viewport.set([0,0,fe.width,fe.height])}(k,E),E.markSkyboxValid(k)):"sky"===k.renderPass&&function(fe,me,Pe,Re,Ke){const ot=fe.context,at=ot.gl,xt=fe.transform,vt=fe.getOrCreateProgram("skybox");ot.activeTexture.set(at.TEXTURE0),at.bindTexture(at.TEXTURE_CUBE_MAP,me.skyboxTexture);const It=((jt,Zt,kn,cn,hn)=>({u_matrix:jt,u_sun_direction:Zt,u_cubemap:0,u_opacity:cn,u_temporal_offset:hn}))(xt.skyboxMatrix,me.getCenter(fe,false),0,Re,Ke);fe.uploadCommonUniforms(ot,vt),vt.draw(fe,at.TRIANGLES,Pe,o._.disabled,fe.colorModeForRenderPass(),o.$.backCW,It,"skybox",me.skyboxGeometry.vertexBuffer,me.skyboxGeometry.indexBuffer,me.skyboxGeometry.segment)}(k,E,ne,V,le):"gradient"===Z&&"sky"===k.renderPass&&function(fe,me,Pe,Re,Ke){const ot=fe.context,at=ot.gl,xt=fe.transform,vt=fe.getOrCreateProgram("skyboxGradient");me.skyboxGeometry||(me.skyboxGeometry=new fq(ot)),ot.activeTexture.set(at.TEXTURE0);let It=me.colorRampTexture;It||(It=me.colorRampTexture=new o.T(ot,me.colorRamp,at.RGBA8)),It.bind(at.LINEAR,at.CLAMP_TO_EDGE);const jt=((Zt,kn,cn,hn,xn)=>({u_matrix:Zt,u_color_ramp:0,u_center_direction:kn,u_radius:o.au(cn),u_opacity:hn,u_temporal_offset:xn}))(xt.skyboxMatrix,me.getCenter(fe,false),me.paint.get("sky-gradient-radius"),Re,Ke);fe.uploadCommonUniforms(ot,vt),vt.draw(fe,at.TRIANGLES,Pe,o._.disabled,fe.colorModeForRenderPass(),o.$.backCW,jt,"skyboxGradient",me.skyboxGeometry.vertexBuffer,me.skyboxGeometry.indexBuffer,me.skyboxGeometry.segment)}(k,E,ne,V,le)},custom:function(k,v,E,D){const V=k.context,Y=E.implementation;if(!k.transform.projection.unsupportedLayers||!k.transform.projection.unsupportedLayers.includes("custom")||k.terrain&&(k.terrain.renderingToTexture||"offscreen"===k.renderPass)&&E.isDraped(v)){if("offscreen"===k.renderPass){const Z=Y.prerender;if(Z){if(k.setCustomLayerDefaults(),V.setColorMode(k.colorModeForRenderPass()),"globe"===k.transform.projection.name){const ne=k.transform.pointMerc;Z.call(Y,V.gl,k.transform.customLayerMatrix(),k.transform.getProjection(),k.transform.globeToMercatorMatrix(),o.S(k.transform.zoom),[ne.x,ne.y],k.transform.pixelsPerMeterRatio)}else Z.call(Y,V.gl,k.transform.customLayerMatrix());V.setDirty(),k.setBaseState()}}else if("translucent"===k.renderPass){if(k.terrain&&k.terrain.renderingToTexture){const ne=Y.renderToTile;if(ne){const le=D[0].canonical,fe={x:le.x+D[0].wrap*(Y.wrapTileId?0:1<v.getTileByID(ne));for(const ne of Z)ne.updateNeeded(k.id,Y)&&D.prepareTile(ne,V,k.id,Y)}};async function Ase(k){if(await aa(),Object.assign(sI,{model:bo.drawModels}),Object.assign(k7,{model:bo.prepare}),k&&!k._destroyed&&!k._shadowRenderer){const v=bo.ShadowRenderer;v&&(k._shadowRenderer=new v(k))}}class cy{constructor(v,E,D,V,Y){this.context=new yse(v,E),this.transform=D,this._tileTextures={},this.frameCopies=[],this.loadTimeStamps=[],this.frcCoverageSnapshot=null,this.elevationCoverageSnapshot=null,this.elevationProvidersReady=void 0,this.frcCoverageFadeRange=null,this.frcCoverageSourceLayers=[],this.frcCoverageRenderer=To.FrcCoverageRenderer?new To.FrcCoverageRenderer:null,this._debugParams={averageFPS:0,fpsHistory:[],fpsWindow:30,continousRedraw:false,enabledLayers:{},buildingsShowNormals:false,buildingsDrawGroundAO:true,buildingsDrawShadowPass:true,buildingsDrawTranslucentPass:true,showTerrainProxyTiles:false,terrainSortTilesHiZFirst:true,terrainDisableRenderCache:false,forceEnablePrecipitation:false,overrideSnowParams:false,snowParamsOverride:null,snowRevealParamsOverride:null,snowVignetteParamsOverride:null,overrideRainParams:false,rainParamsOverride:null,rainRevealParamsOverride:null,rainVignetteParamsOverride:null,overrideStarsParams:false,starsParamsOverride:null,show3DModelFootprints:false,showElevationIdDebug:false,lodSwitchDistance:-1,lodSwitchFadeDuration:.5},this.occlusionParams=new Sse,this.setup(),this.numSublayers=pp.maxUnderzooming+pp.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.deferredRenderGpuTimeQueries=[],this.gpuTimers={},this.frameCounter=0,this.frameTimeDelta=0,this.lastPaintStartTimeStamp=0,this._shadowCullCache=null,this._backgroundTiles={},this.conflationActive=false,this.replacementSource=new o.ep,this.longestCutoffRange=0,this.minCutoffZoom=0,this._fogVisible=false,this._cachedTileFogOpacities={},this._wireframeDebugCache=new mq,this.renderDefaultNorthPole=true,this.renderDefaultSouthPole=true,this.layersWithOcclusionOpacity=[];const Z=new o.b({width:1,height:1},Uint8Array.of(0,0,0,0));this.emptyDepthTexture=new o.T(this.context,Z,v.RGBA8),this._clippingActiveLastFrame=false,this.scaleFactor=V,this.maxFrontCutoffRawStart=0,this.worldview=Y,this._forceEmissiveMode=false,this.emissiveMode="constant"}updateTerrain(v,E){const D=!!v&&!!v.terrain&&this.transform.projection.supportsTerrain;if(!(D||this._terrain&&this._terrain.enabled))return;this._terrain||(this._terrain=new eq(this,v));const V=this._terrain;this.transform.elevation=D?V:null,V.update(v,this.transform,E),this.transform.elevation&&!V.enabled&&(this.transform.elevation=null)}_updateFog(v){const E=v.fog;if(!E||"globe"===this.transform.projection.name||E.getOpacity(this.transform.pitch)<1||E.properties.get("horizon-blend")<.03)return void(this.transform.fogCullDistSq=null);const[D,V]=E.getRangeForProjection();if(D>V)return void(this.transform.fogCullDistSq=null);const Y=D+.78*(V-D);this.transform.fogCullDistSq=Y*Y}get terrain(){return this.transform._terrainEnabled()&&this._terrain&&this._terrain.enabled||this._forceTerrainMode?this._terrain:null}get forceTerrainMode(){return this._forceTerrainMode}set forceTerrainMode(v){v&&!this._terrain&&(this._terrain=new eq(this,this.style)),this._forceTerrainMode=v}get shadowRenderer(){return this._shadowRenderer&&this._shadowRenderer.enabled?this._shadowRenderer:null}get wireframeDebugCache(){return this._wireframeDebugCache}resize(v,E){if(this.width=v*o.e.devicePixelRatio,this.height=E*o.e.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const D of this.style.order)this.style._mergedLayers[D].resize()}setup(){const v=this.context,E=new o.bC;E.emplaceBack(0,0),E.emplaceBack(o.a2,0),E.emplaceBack(0,o.a2),E.emplaceBack(o.a2,o.a2),this.tileExtentBuffer=v.createVertexBuffer(E,o.bE.members),this.tileExtentSegments=o.ac.simpleSegment(0,0,4,2);const D=new o.bC;D.emplaceBack(0,0),D.emplaceBack(o.a2,0),D.emplaceBack(0,o.a2),D.emplaceBack(o.a2,o.a2),this.debugBuffer=v.createVertexBuffer(D,o.bE.members),this.debugSegments=o.ac.simpleSegment(0,0,4,5);const V=new o.bC;V.emplaceBack(-1,-1),V.emplaceBack(1,-1),V.emplaceBack(-1,1),V.emplaceBack(1,1),this.viewportBuffer=v.createVertexBuffer(V,o.bE.members),this.viewportSegments=o.ac.simpleSegment(0,0,4,2);const Y=new o.bs;Y.emplaceBack(0,0,0,0),Y.emplaceBack(o.a2,0,o.a2,0),Y.emplaceBack(0,o.a2,0,o.a2),Y.emplaceBack(o.a2,o.a2,o.a2,o.a2),this.mercatorBoundsBuffer=v.createVertexBuffer(Y,Iv.members),this.mercatorBoundsSegments=o.ac.simpleSegment(0,0,4,2);const Z=new o.ad;Z.emplaceBack(0,1,2),Z.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=v.createIndexBuffer(Z);const ne=new o.bD;for(const fe of[0,1,3,2,0])ne.emplaceBack(fe);this.debugIndexBuffer=v.createIndexBuffer(ne),this.emptyTexture=new o.T(v,new o.b({width:1,height:1},Uint8Array.of(0,0,0,0)),v.gl.RGBA8),this.identityMat=o.Y();const le=this.context.gl;this.stencilClearMode=new o._({func:le.ALWAYS,mask:0},0,255,le.ZERO,le.ZERO,le.ZERO),this.loadTimeStamps.push(performance.now())}getMercatorTileBoundsBuffers(){return{tileBoundsBuffer:this.mercatorBoundsBuffer,tileBoundsIndexBuffer:this.quadTriangleIndexBuffer,tileBoundsSegments:this.mercatorBoundsSegments}}getTileBoundsBuffers(v){return v._makeTileBoundsBuffers(this.context,this.transform.projection),v._tileBoundsBuffer?{tileBoundsBuffer:v._tileBoundsBuffer,tileBoundsIndexBuffer:v._tileBoundsIndexBuffer,tileBoundsSegments:v._tileBoundsSegments}:this.getMercatorTileBoundsBuffers()}clearStencil(){const v=this.context.gl;this.nextStencilID=1,this.currentStencilSource=void 0,this._tileClippingMaskIDs={},this.getOrCreateProgram("clippingMask").draw(this,v.TRIANGLES,o.Z.disabled,this.stencilClearMode,o.a1.disabled,o.$.disabled,yd(this.identityMat),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}resetStencilClippingMasks(){this.terrain||(this.currentStencilSource=void 0,this._tileClippingMaskIDs={})}_renderTileClippingMasks(v,E,D){if(!E||this.currentStencilSource===E.id||!v.isTileClipped()||!D||0===D.length)return;if(this._tileClippingMaskIDs&&!this.terrain){let ne=false;for(const le of D)if(void 0===this._tileClippingMaskIDs[le.key]){ne=true;break}if(!ne)return}this.currentStencilSource=E.id;const V=this.context,Y=V.gl;this.nextStencilID+D.length>256&&this.clearStencil(),V.setColorMode(o.a1.disabled),V.setDepthMode(o.Z.disabled);const Z=this.getOrCreateProgram("clippingMask");this._tileClippingMaskIDs={};for(const ne of D){const le=E.getTile(ne),fe=this._tileClippingMaskIDs[ne.key]=this.nextStencilID++,{tileBoundsBuffer:me,tileBoundsIndexBuffer:Pe,tileBoundsSegments:Re}=this.getTileBoundsBuffers(le);Z.draw(this,Y.TRIANGLES,o.Z.disabled,new o._({func:Y.ALWAYS,mask:0},fe,255,Y.KEEP,Y.KEEP,Y.REPLACE),o.a1.disabled,o.$.disabled,yd(ne.projMatrix),"$clipping",me,Pe,Re)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const v=this.nextStencilID++,E=this.context.gl;return new o._({func:E.NOTEQUAL,mask:255},v,255,E.KEEP,E.KEEP,E.REPLACE)}stencilModeForClipping(v){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(v);const E=this.context.gl;return new o._({func:E.EQUAL,mask:255},this._tileClippingMaskIDs[v.key],0,E.KEEP,E.KEEP,E.REPLACE)}stencilConfigForOverlap(v){const E=this.context.gl,D=v.sort((Z,ne)=>ne.overscaledZ-Z.overscaledZ),V=D.at(-1).overscaledZ,Y=D[0].overscaledZ-V+1;if(Y>1){this.currentStencilSource=void 0,this.nextStencilID+Y>256&&this.clearStencil();const Z={};for(let ne=0;nethis.style&&this.style.enable3dLights()&&this.terrain&&this.terrain.renderingToTexture)()&&"translucent"===this.renderPass?null!=v&&"mrt-fallback"!==this.emissiveMode||"constant"===this.emissiveMode?new o.a1([E.ONE,E.ONE_MINUS_SRC_ALPHA,E.CONSTANT_ALPHA,E.ONE_MINUS_SRC_ALPHA],new o.C(0,0,0,v??0),[true,true,true,true]):"dual-source-blending"===this.emissiveMode?new o.a1([E.ONE,E.ONE_MINUS_SRC_ALPHA,this.context.extBlendFuncExtended.SRC1_ALPHA_WEBGL,E.ONE_MINUS_SRC_ALPHA],o.C.transparent,[true,true,true,true]):this.colorModeForRenderPass():this.colorModeForRenderPass()}depthModeForSublayer(v,E,D,V=false){if(this.depthOcclusion)return new o.Z(this.context.gl.GREATER,o.Z.ReadOnly,this.depthRangeFor3D);if(!this.opaquePassEnabledForLayer()&&!V)return o.Z.disabled;const Y=1-((1+this.currentLayer)*this.numSublayers+v)*this.depthEpsilon;return new o.Z(D||this.context.gl.LEQUAL,E,[Y,Y])}opaquePassEnabledForLayer(){return this.currentLayerthis.style._getOrder(V);let Z=Y(),ne=false,le=false,fe=null,me=0,Pe=false;for(const Qn of Z){const kr=D[Qn];"none"!==kr.visibility&&("circle"===kr.type?ne=true:"building"===kr.type?(fe=kr,++me):"symbol"===kr.type&&(kr.hasOcclusionOpacityProperties?le=true:ne=true))}this.updateEmissiveMode();let Re=Z.map(Qn=>D[Qn]);const Ke=this.style._mergedSourceCaches;this.imageManager=v.imageManager,this.modelManager=v.modelManager,this.symbolFadeChange=v.placement.symbolFadeChange(o.e.now()),this.imageManager.beginFrame();for(const Qn in Ke){const kr=Ke[Qn];kr.used&&(kr.prepare(this.context),kr.getSource().usedInConflation&&++me)}let ot=false;for(const Qn of Re)Qn.isHidden(this.transform.zoom)||("clip"===Qn.type&&(ot=true),this.prepareLayer(Qn));const at={},xt={},vt={},It={},jt={};for(const Qn in Ke){const kr=Ke[Qn];at[Qn]=kr.getVisibleCoordinates(),xt[Qn]=at[Qn].slice().reverse(),vt[Qn]=kr.getVisibleCoordinates(true).reverse(),It[Qn]=kr.getShadowCasterCoordinates(),jt[Qn]=kr.sortCoordinatesByDistance(at[Qn])}const Zt=Qn=>{const kr=this.style.getLayerSourceCache(Qn);return kr&&kr.used?kr.getSource():null};if(me||ot||this._clippingActiveLastFrame){const Qn=[],kr=[];let Vr=0;for(const mi of Re)this.isSourceForClippingOrConflation(mi,Zt(mi))&&(Qn.push(mi),kr.push(Vr)),Vr++;if(Qn&&(ot||Qn.length>1)||this._clippingActiveLastFrame){ot=false;const mi=[];for(let si=0;si0){const mi=Zt(kr);mi&&(this.minCutoffZoom=Math.max(mi.minzoom,this.minCutoffZoom)),kr.minzoom&&(this.minCutoffZoom=Math.max(kr.minzoom,this.minCutoffZoom))}kr.is3D(V)&&(this.opaquePassCutoff===1/0&&(this.opaquePassCutoff=Qn),this._lastOcclusionLayer=Qn)}const kn=this.style&&this.style.fog;kn?(this._fogVisible=0!==kn.getOpacity(this.transform.pitch),this._fogVisible&&"globe"!==this.transform.projection.name&&(this._fogVisible=kn.isVisibleOnFrustum(this.transform.cameraFrustum))):this._fogVisible=false,this._cachedTileFogOpacities={},this.terrain&&(this.terrain.updateTileBinding(vt),this.opaquePassCutoff=0,Z=Y(),Re=Z.map(Qn=>D[Qn])),this.style.enable3dLights()&&!this._shadowRenderer&&Ase(this);const cn=this._shadowRenderer;if(cn){cn.updateShadowParameters(this.transform,this.style.directionalLight);for(const Qn in Ke)for(const kr of at[Qn]){let Vr={min:0,max:0};this.terrain&&(Vr=this.terrain.getMinMaxForTile(kr)||Vr),cn.addShadowReceiver(kr.toUnwrapped(),Vr.min,Vr.max)}}"globe"!==this.transform.projection.name||this.globeSharedBuffers||(this.globeSharedBuffers=new o.er(this.context)),this.style.fog&&this.transform.projection.supportsFog?(this._atmosphere||(this._atmosphere=new Cse),this._atmosphere.update(this)):this._atmosphere&&(this._atmosphere.destroy(),this._atmosphere=void 0);let hn=!(!this.style||!this.style.snow),xn=!(!this.style||!this.style.rain);if(hn&&!this._snow&&To.Snow&&(this._snow=new To.Snow),!hn&&this._snow&&(this._snow.destroy(),delete this._snow),xn&&!this._rain&&To.Rain&&(this._rain=new To.Rain),!xn&&this._rain&&(this._rain.destroy(),delete this._rain),this._snow&&this._snow.update(this),this._rain&&this._rain.update(this),fe&&(!this.buildingTileBorderManager&&To.BuildingTileBorderManager&&(this.buildingTileBorderManager=new To.BuildingTileBorderManager),this.buildingTileBorderManager)){const Qn=this.style.getLayerSourceCache(fe);this.buildingTileBorderManager.updateBorders(Qn,fe)}if(!o.es(this.context.gl))return;this.renderPass="offscreen";for(const Qn of Re){const kr=v.getLayerSourceCache(Qn);if(!Qn.hasOffscreenPass()||Qn.isHidden(this.transform.zoom))continue;const Vr=kr?xt[kr.id]:void 0;("custom"===Qn.type||"raster"===Qn.type||"raster-particle"===Qn.type||Qn.isSky()||Vr&&Vr.length)&&this.renderLayer(this,kr,Qn,Vr)}this.depthRangeFor3D=[0,1-(Re.length+2)*this.numSublayers*this.depthEpsilon],this._shadowRenderer&&(this.renderPass="shadow",this._shadowRenderer.drawShadowPass(this.style,It)),this.context.bindFramebuffer.set(null),this.context.viewport.set([0,0,this.width,this.height]);const wn="globe"===this.transform.projection.name||this.transform.isHorizonVisible(),Bn=(()=>{if(E.showOverdrawInspector)return o.C.black;const Qn=this.style.fog;if(Qn&&this.transform.projection.supportsFog){const kr=this.style.getLut(Qn.scope);if(!wn){const Vr="none"===Qn.properties.get("color-use-theme"),mi=Qn.properties.get("color").toNonPremultipliedRenderColor(Vr?null:kr).toArray01();return new o.C(...mi)}if(wn){const Vr="none"===Qn.properties.get("space-color-use-theme"),mi=Qn.properties.get("space-color").toNonPremultipliedRenderColor(Vr?null:kr).toArray01();return new o.C(...mi)}}return o.C.transparent})();if(this.context.clear({color:Bn,depth:1}),this.clearStencil(),this._showOverdrawInspector=E.showOverdrawInspector,this.renderPass="opaque",this.style.fog&&this.transform.projection.supportsFog&&this._atmosphere&&!this._showOverdrawInspector&&wn&&this._atmosphere.drawStars(this,this.style.fog),!this.terrain)for(this.currentLayer=Z.length-1;this.currentLayer>=0;this.currentLayer--){const Qn=Re[this.currentLayer],kr=v.getLayerSourceCache(Qn);if(Qn.isSky())continue;const Vr=kr?(Qn.is3D(V)?jt:xt)[kr.id]:void 0;this._renderTileClippingMasks(Qn,kr,Vr),this.renderLayer(this,kr,Qn,Vr)}if(this.style.fog&&this.transform.projection.supportsFog&&this._atmosphere&&!this._showOverdrawInspector&&wn&&this._atmosphere.drawAtmosphereGlow(this,this.style.fog),this.renderPass="sky",(!this._atmosphere||o.S(this.transform.zoom)>0)&&("globe"===this.transform.projection.name||this.transform.isHorizonVisible()))for(this.currentLayer=0;this.currentLayer{for(this.currentLayer=0;this.currentLayer=this._lastOcclusionLayer&&this.layersWithOcclusionOpacity.length>0){const Vr=this.currentLayer;this.depthOcclusion=true;for(const mi of this.layersWithOcclusionOpacity){this.currentLayer=mi;const si=Re[this.currentLayer],Kr=v.getLayerSourceCache(si),qi=Kr?xt[Kr.id]:void 0;this.terrain||this._renderTileClippingMasks(si,Kr,Kr?at[Kr.id]:void 0),this.renderLayer(this,Kr,si,qi)}this.depthOcclusion=false,this.currentLayer=Vr,this.renderPass="translucent",this.layersWithOcclusionOpacity=[]}++this.currentLayer}}if(this.terrain&&this.terrain.postRender(),this._snow&&this._snow.draw(this),this._rain&&this._rain.draw(this),this.options.showTileBoundaries||this.options.showQueryGeometry||this.options.showTileAABBs){let Qn=null;Re.forEach(kr=>{const Vr=v.getLayerSourceCache(kr);Vr&&!kr.isHidden(this.transform.zoom)&&Vr.getVisibleCoordinates().length&&(!Qn||Qn.getSource().maxzoom0?E.pop():null}terrainRenderModeElevated(){return this.style&&this.style.hasTerrain()&&!!this.terrain&&!this.terrain.renderingToTexture||this.forceTerrainMode}linearFloatFilteringSupported(){return null!=this.context.extTextureFloatLinear}currentGlobalDefines(v,E,D,V,Y){const Z=void 0===D?this.terrain&&this.terrain.renderingToTexture:D,ne=void 0===V?this.terrainRenderModeElevated():V,le=void 0===Y?"globe"===this.transform.projection.name:Y,fe=[];return this.style&&this.style.enable3dLights()&&("globeRaster"===v||"terrainRaster"===v?(fe.push("LIGHTING_3D_MODE"),fe.push("LIGHTING_3D_ALPHA_EMISSIVENESS")):Z||fe.push("LIGHTING_3D_MODE")),ne&&(fe.push("TERRAIN"),this.linearFloatFilteringSupported()&&fe.push("TERRAIN_DEM_FLOAT_FORMAT")),le&&fe.push("GLOBE"),!this._fogVisible||Z||void 0!==E&&!E||fe.push("FOG"),Z&&fe.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&fe.push("OVERDRAW_INSPECTOR"),fe}getOrCreateProgram(v,E){this.cache=this.cache||{};const{defines:D,config:V,overrideFog:Y,overrideRtt:Z,overrideTerrain:ne,overrideGlobe:le,precompiled:fe}=E||{},me=this.currentGlobalDefines(v,Y,Z,ne,le).concat(D||[]),Pe=this.getShaderSource(v),Re=To.programUniforms,Ke=bo.programUniforms,ot=t4[v]||Re&&Re[v]||Ke&&Ke[v],at=pse.cacheKey(Pe,v,me,V);return this.cache[at]||(this.cache[at]=new pse(this.context,v,Pe,V,ot,me,fe)),this.cache[at]}getShaderSource(v){const E=To.shaders,D=bo.shaders;return o.et[v]||E&&E[v]||D&&D[v]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.frontFace.setDefault(),this.context.cullFaceSide.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const v=this.context.gl;this.context.cullFace.set(false),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(v.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new o.T(this.context,this.debugOverlayCanvas,this.context.gl.RGBA8))}destroy(){this._terrain&&this._terrain.destroy(),this._atmosphere&&(this._atmosphere.destroy(),this._atmosphere=void 0),this.globeSharedBuffers&&this.globeSharedBuffers.destroy(),this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this._wireframeDebugCache.destroy(),this.depthFBO&&(this.depthFBO.destroy(),this.depthFBO=void 0,this.depthTexture=void 0),this.emptyDepthTexture&&this.emptyDepthTexture.destroy(),this._destroyed=true}prepareDrawTile(){this.terrain&&this.terrain.prepareDrawTile()}uploadCommonLightUniforms(v,E,D){if(this.style.enable3dLights()){const V=this.style.directionalLight,Y=this.style.ambientLight;if(V&&Y){const Z=((ne,le,fe,me)=>{const Pe=ne.properties.get("direction"),Re="none"===ne.properties.get("color-use-theme"),Ke=ne.properties.get("color").toNonPremultipliedRenderColor(Re?null:fe.getLut(ne.scope)).toArray01();let ot=ne.properties.get("intensity");const at="none"===le.properties.get("color-use-theme"),xt=le.properties.get("color").toNonPremultipliedRenderColor(at?null:fe.getLut(le.scope)).toArray01();let vt=le.properties.get("intensity");const It=[Pe.x,Pe.y,Pe.z];me&&(void 0!==me.ambientIntensity&&(vt=me.ambientIntensity),void 0!==me.directionalIntensity&&(ot=me.directionalIntensity),void 0!==me.ambientColor&&(xt[0]=me.ambientColor[0],xt[1]=me.ambientColor[1],xt[2]=me.ambientColor[2]),void 0!==me.directionalColor&&(Ke[0]=me.directionalColor[0],Ke[1]=me.directionalColor[1],Ke[2]=me.directionalColor[2]));const jt=o.dA(xt,vt),Zt=o.dA(Ke,ot);return{u_lighting_ambient_color:jt,u_lighting_directional_dir:It,u_lighting_directional_color:Zt,u_ground_radiance:hse(It,Zt,jt)}})(V,Y,this.style,D);E.setLightsUniformValues(v,Z)}}}uploadCommonUniforms(v,E,D,V,Y,Z){if(this.uploadCommonLightUniforms(v,E,Z),this.terrain&&this.terrain.renderingToTexture)return;const ne=this.style.fog;if(ne){const le=ne.getOpacity(this.transform.pitch),fe=((me,Pe,Re,Ke,ot,at,xt,vt,It,jt,Zt,kn)=>{const cn=me.transform,hn="none"===Pe.properties.get("color-use-theme"),xn=Pe.properties.get("color").toNonPremultipliedRenderColor(hn?null:me.style.getLut(Pe.scope)).toArray01();xn[3]=Ke;const wn=me.frameCounter/1e3%1,[Bn,Kn]=Pe.properties.get("vertical-range");return{u_fog_matrix:Re?cn.calculateFogTileMatrix(Re):kn||me.identityMat,u_fog_range:Pe.getRangeForProjection(),u_fog_color:xn,u_fog_horizon_blend:Pe.properties.get("horizon-blend"),u_fog_vertical_limit:[Math.min(Bn,Kn),Kn],u_fog_temporal_offset:wn,u_frustum_tl:ot,u_frustum_tr:at,u_frustum_br:xt,u_frustum_bl:vt,u_globe_pos:It,u_globe_radius:jt,u_viewport:Zt,u_globe_transition:o.S(cn.zoom),u_is_globe:+("globe"===cn.projection.name)}})(this,ne,D,le,this.transform.frustumCorners.TL,this.transform.frustumCorners.TR,this.transform.frustumCorners.BR,this.transform.frustumCorners.BL,this.transform.globeCenterInViewSpace,this.transform.globeRadius,[this.transform.width*o.e.devicePixelRatio,this.transform.height*o.e.devicePixelRatio],V);E.setFogUniformValues(v,fe)}Y&&E.setCutoffUniformValues(v,Y.uniformValues)}setTileLoadedFlag(v){this.tileLoaded=v}saveCanvasCopy(){const v=this.canvasCopy();v&&(this.frameCopies.push(v),this.tileLoaded=false)}canvasCopy(){const v=this.context.gl,E=v.createTexture();return v.bindTexture(v.TEXTURE_2D,E),v.copyTexImage2D(v.TEXTURE_2D,0,v.RGBA,0,0,v.drawingBufferWidth,v.drawingBufferHeight,0),E}getCanvasCopiesAndTimestamps(){return{canvasCopies:this.frameCopies,timeStamps:this.loadTimeStamps}}averageElevationNeedsEasing(){if(!this.transform._elevation)return false;const v=this.style&&this.style.fog;return!!v&&0!==v.getOpacity(this.transform.pitch)}getBackgroundTiles(){const v=this._backgroundTiles,E=this._backgroundTiles={},D=this.transform.coveringTiles({tileSize:512});for(const V of D)E[V.key]=v[V.key]||new Mv(V,512,this.transform.tileZoom,this,void 0,this.worldview);return E}clearBackgroundTiles(){this._backgroundTiles={}}isSourceForClippingOrConflation(v,E){return!(!v.is3D(!(!this.terrain||!this.terrain.enabled))||"clip"!==v.type&&"building"!==v.type&&(v.minzoom&&v.minzoom>this.transform.zoom||(this.style._clipLayerPresent||"building"!==v.sourceLayer&&"procedural_buildings"!==v.sourceLayer)&&(!E||"batched-model"!==E.type)))}isTileAffectedByFog(v){if(!this.style||!this.style.fog)return false;if("globe"===this.transform.projection.name)return true;let E=this._cachedTileFogOpacities[v.key];return E||(this._cachedTileFogOpacities[v.key]=E=this.style.fog.getOpacityForTile(v)),E[0]>=o.at||E[1]>=o.at}setupDepthForOcclusion(v,E,D){const V=this.context,Y=V.gl,Z=!!D;var ne;D||(D={u_dem:2,u_dem_prev:4,u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_depth_range_unpack:[0,1],u_occluder_half_size:16,u_occlusion_depth_offset:-1e-4,u_exaggeration:0}),V.activeTexture.set(Y.TEXTURE3),v&&this.depthFBO&&this.depthTexture?(this.depthTexture.bind(Y.NEAREST,Y.CLAMP_TO_EDGE),D.u_depth_size_inv=[1/this.depthFBO.width,1/this.depthFBO.height],D.u_depth_range_unpack=[2/((ne=this.depthRangeFor3D)[1]-ne[0]),-1-2*ne[0]/(ne[1]-ne[0])],D.u_occluder_half_size=.5*this.occlusionParams.occluderSize,D.u_occlusion_depth_offset=this.occlusionParams.depthOffset):this.emptyDepthTexture.bind(Y.NEAREST,Y.CLAMP_TO_EDGE),V.activeTexture.set(Y.TEXTURE0),Z||E.setTerrainUniformValues(V,D)}updateEmissiveMode(){if(this._forceEmissiveMode)return;const v=this.style.hasDataDrivenEmissiveStrength();this.emissiveMode=v?this.context.extBlendFuncExtended?"dual-source-blending":"mrt-fallback":"constant"}}function R7(k,v){let E=false,D=null;const V=()=>{D=null,E&&(k(),D=setTimeout(V,v),E=false)};return()=>(E=true,D||V(),D)}const rm=/(#.+)?$/;class F2{constructor(v){this._hashName=v&&encodeURIComponent(v),o.aV(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=R7(this._updateHashUnthrottled.bind(this),300)}addTo(v){return this._map=v,window.addEventListener("hashchange",this._onHashChange,false),v.on("moveend",this._updateHash),this}remove(){return this._map?(this._map.off("moveend",this._updateHash),window.removeEventListener("hashchange",this._onHashChange,false),clearTimeout(this._updateHash()),this._map=void 0,this):this}getHashString(){const v=this._map;if(!v)return"";const E=gq(v);if(this._hashName){const D=this._hashName;let V=false;const Y=location.hash.slice(1).split("&").map(Z=>{const ne=Z.split("=")[0];return ne===D?(V=true,`${ne}=${E}`):Z}).filter(Z=>Z);return V||Y.push(`${D}=${E}`),`#${Y.join("&")}`}return`#${E}`}_getCurrentHash(){const v=location.hash.replace("#","");if(this._hashName){let E;return v.split("&").map(D=>D.split("=")).forEach(D=>{D[0]===this._hashName&&(E=D)}),(E&&E[1]||"").split("/")}return v.split("/")}_onHashChange(){const v=this._map;if(!v)return false;const E=this._getCurrentHash();if(E.length>=3&&!E.some(D=>isNaN(Number(D)))){const D=v.dragRotate.isEnabled()&&v.touchZoomRotate.isEnabled()?+(E[3]||0):v.getBearing();return v.jumpTo({center:[+E[2],+E[1]],zoom:+E[0],bearing:D,pitch:+(E[4]||0)}),true}return false}_updateHashUnthrottled(){history.replaceState(history.state,"",location.href.replace(rm,this.getHashString()))}}function gq(k,v){const E=k.getCenter(),D=Math.round(100*k.getZoom())/100,V=Math.ceil((D*Math.LN2+Math.log(512/360/.5))/Math.LN10),Y=Math.pow(10,V),Z=Math.round(E.lng*Y)/Y,ne=Math.round(E.lat*Y)/Y,le=k.getBearing(),fe=k.getPitch();let me=v?`/${Z}/${ne}/${D}`:`${D}/${ne}/${Z}`;return(le||fe)&&(me+="/"+Math.round(10*le)/10),fe&&(me+=`/${Math.round(fe)}`),me}const lI={linearity:.3,easing:o.ev(0,0,.3,1)},yq={deceleration:2500,maxSpeed:1400,...lI},bq={deceleration:20,maxSpeed:1400,...lI},kse={deceleration:1e3,maxSpeed:360,...lI},N2={deceleration:1e3,maxSpeed:90,...lI};class Rl{constructor(v){this._map=v,this.clear()}clear(){this._inertiaBuffer=[]}record(v){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:o.e.now(),settings:v})}_drainInertiaBuffer(){const v=this._inertiaBuffer,E=o.e.now();for(;v.length>0&&E-v[0].time>160;)v.shift()}_onMoveEnd(v){if(this._map._prefersReducedMotion())return;if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const E={zoom:0,bearing:0,pitch:0,pan:new o.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:Y}of this._inertiaBuffer)E.zoom+=Y.zoomDelta||0,E.bearing+=Y.bearingDelta||0,E.pitch+=Y.pitchDelta||0,Y.panDelta&&E.pan._add(Y.panDelta),Y.around&&(E.around=Y.around),Y.pinchAround&&(E.pinchAround=Y.pinchAround);const D=this._inertiaBuffer.at(-1).time-this._inertiaBuffer[0].time,V={};if(E.pan.mag()){const Y=cI(E.pan.mag(),D,{...yq,...v||{}});V.offset=E.pan.mult(Y.amount/E.pan.mag()),V.center=this._map.transform.center,gA(V,Y)}if(E.zoom){const Y=cI(E.zoom,D,bq);V.zoom=this._map.transform.zoom+Y.amount,gA(V,Y)}if(E.bearing){const Y=cI(E.bearing,D,kse);V.bearing=this._map.transform.bearing+o.b0(Y.amount,-179,179),gA(V,Y)}if(E.pitch){const Y=cI(E.pitch,D,N2);V.pitch=this._map.transform.pitch+Y.amount,gA(V,Y)}if(V.zoom||V.bearing){const Y=void 0===E.pinchAround?E.around:E.pinchAround;V.around=Y?this._map.unproject(Y):this._map.getCenter()}return this.clear(),V.noMoveStart=true,V}}function gA(k,v){(!k.duration||k.durationE.unproject(le)),ne=Y.reduce((le,fe,me,Pe)=>le.add(fe.div(Pe.length)),new o.P(0,0));super(v,{points:Y,point:ne,lngLats:Z,lngLat:E.unproject(ne),originalEvent:D}),this._defaultPrevented=false}}class Rse extends o.h{preventDefault(){this._defaultPrevented=true}get defaultPrevented(){return this._defaultPrevented}constructor(v,E){super("wheel",{originalEvent:E}),this._defaultPrevented=false}}class xq{constructor(v,E){this._map=v,this._clickTolerance=E.clickTolerance}reset(){this._mousedownPos=void 0}wheel(v){return this._firePreventable(new Rse(this._map,v))}mousedown(v,E){return this._mousedownPos=E,this._firePreventable(new uy(v.type,this._map,v))}mouseup(v){this._map.fire(new uy(v.type,this._map,v))}preclick(v){const E=new MouseEvent("preclick",v);this._map.fire(new uy(E.type,this._map,E))}click(v,E){this._mousedownPos&&this._mousedownPos.dist(E)>=this._clickTolerance||(this.preclick(v),this._map.fire(new uy(v.type,this._map,v)))}dblclick(v){return this._firePreventable(new uy(v.type,this._map,v))}mouseover(v){this._map.fire(new uy(v.type,this._map,v))}mouseout(v){this._map.fire(new uy(v.type,this._map,v))}touchstart(v){return this._firePreventable(new r4(v.type,this._map,v))}touchmove(v){this._map.fire(new r4(v.type,this._map,v))}touchend(v){this._map.fire(new r4(v.type,this._map,v))}touchcancel(v){this._map.fire(new r4(v.type,this._map,v))}_firePreventable(v){if(this._map.fire(v),v.defaultPrevented)return{}}isEnabled(){return true}isActive(){return false}enable(){}disable(){}}class mT{constructor(v){this._map=v}reset(){this._delayContextMenu=false,this._contextMenuEvent=void 0}mousemove(v){this._map.fire(new uy(v.type,this._map,v))}mousedown(){this._delayContextMenu=true}mouseup(){this._delayContextMenu=false,this._contextMenuEvent&&(this._map.fire(new uy("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(v){this._delayContextMenu?this._contextMenuEvent=v:this._map.fire(new uy(v.type,this._map,v)),this._map.listens("contextmenu")&&v.preventDefault()}isEnabled(){return true}isActive(){return false}enable(){}disable(){}}class O2{constructor(v,E){this._map=v,this._el=v.getCanvasContainer(),this._container=v.getContainer(),this._clickTolerance=E.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=true)}disable(){this.isEnabled()&&(this._enabled=false)}mousedown(v,E){this.isEnabled()&&v.shiftKey&&0===v.button&&(_(),this._startPos=this._lastPos=E,this._active=true)}mousemoveWindow(v,E){if(!this._active)return;const D=E,V=this._startPos,Y=this._lastPos;if(!V||!Y||Y.equals(D)||!this._box&&D.dist(V){this._box&&(this._box.style.transform=`translate(${Z}px,${le}px)`,this._box.style.width=ne-Z+"px",this._box.style.height=fe-le+"px")})}mouseupWindow(v,E){if(!this._active)return;const D=this._startPos,V=E;if(D&&0===v.button){if(this.reset(),P(),D.x!==V.x||D.y!==V.y)return this._map.fire(new o.h("boxzoomend",{originalEvent:v})),{cameraAnimation:Y=>Y.fitScreenCoordinates(D,V,this._map.getBearing(),{linear:false})};this._fireEvent("boxzoomcancel",v)}}keydown(v){this._active&&27===v.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",v))}blur(){this.reset()}reset(){this._active=false,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.remove(),this._box=null),C(),delete this._startPos,delete this._lastPos}_fireEvent(v,E){return this._map.fire(new o.h(v,{originalEvent:E}))}}function Ir(k,v){const E={};for(let D=0;Dthis.numTouches)&&(this.aborted=true),this.aborted||(0===this.startTime&&(this.startTime=v.timeStamp),D.length===this.numTouches&&(this.centroid=function(V){const Y=new o.P(0,0);for(const Z of V)Y._add(Z);return Y.div(V.length)}(E),this.touches=Ir(D,E)))}touchmove(v,E,D){if(this.aborted||!this.centroid)return;const V=Ir(D,E);for(const Y in this.touches){const Z=V[Y];(!Z||Z.dist(this.touches[Y])>30)&&(this.aborted=true)}}touchend(v,E,D){if((!this.centroid||v.timeStamp-this.startTime>500)&&(this.aborted=true),0===D.length){const V=!this.aborted&&this.centroid;if(this.reset(),V)return V}}}class gT{constructor(v){this.singleTap=new Br(v),this.numTaps=v.numTaps,this.reset()}reset(){this.lastTime=1/0,this.lastTap=void 0,this.count=0,this.singleTap.reset()}touchstart(v,E,D){this.singleTap.touchstart(v,E,D)}touchmove(v,E,D){this.singleTap.touchmove(v,E,D)}touchend(v,E,D){const V=this.singleTap.touchend(v,E,D);if(V){const Y=v.timeStamp-this.lastTime<500,Z=!this.lastTap||this.lastTap.dist(V)<30;if(Y&&Z||this.reset(),this.count++,this.lastTime=v.timeStamp,this.lastTap=V,this.count===this.numTaps)return this.reset(),V}}}class Ql{constructor(){this._zoomIn=new gT({numTouches:1,numTaps:2}),this._zoomOut=new gT({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=false,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(v,E,D){this._zoomIn.touchstart(v,E,D),this._zoomOut.touchstart(v,E,D)}touchmove(v,E,D){this._zoomIn.touchmove(v,E,D),this._zoomOut.touchmove(v,E,D)}touchend(v,E,D){const V=this._zoomIn.touchend(v,E,D),Y=this._zoomOut.touchend(v,E,D);return V?(this._active=true,v.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:Z=>Z.easeTo({duration:300,zoom:Z.getZoom()+1,around:Z.unproject(V)},{originalEvent:v})}):Y?(this._active=true,v.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:Z=>Z.easeTo({duration:300,zoom:Z.getZoom()-1,around:Z.unproject(Y)},{originalEvent:v})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=true}disable(){this._enabled=false,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const An=0,Pse=2,P7={[An]:1,[Pse]:2},I7={Control:"ctrlKey",Alt:"altKey",Shift:"shiftKey",Meta:"metaKey"};class i4{constructor(v){this.reset(),this._clickTolerance=v.clickTolerance||1}blur(){this.reset()}reset(){this._active=false,this._moved=false,this._lastPoint=void 0,this._eventButton=void 0}_correctButton(v,E){return false}_move(v,E){return{}}mousedown(v,E){if(this._lastPoint)return;const D=N(v);this._correctButton(v,D)&&(this._lastPoint=E,this._eventButton=D)}mousemoveWindow(v,E){const D=this._lastPoint;if(D){if(v.preventDefault(),null!=this._eventButton&&function(V,Y){const Z=P7[Y];return void 0===V.buttons||(V.buttons&Z)!==Z}(v,this._eventButton))this.reset();else if(this._moved||!(E.dist(D)0&&(this._active=true);const V=Ir(D,E),Y=new o.P(0,0),Z=new o.P(0,0);let ne=0;for(const fe in V){const me=V[fe],Pe=this._touches[fe];Pe&&(Y._add(me),Z._add(me.sub(Pe)),ne++,V[fe]=me)}if(this._touches=V,ne{this._alertContainer.classList.remove("mapboxgl-touch-pan-blocker-show"),this._alertContainer.removeAttribute("role")},500)}}class _q{constructor(){this.reset()}reset(){this._active=false,this._firstTwoTouches=void 0}_start(v){}_move(v,E,D){return{}}touchstart(v,E,D){this._firstTwoTouches||D.length<2||(this._firstTwoTouches=[D[0].identifier,D[1].identifier],this._start([E[0],E[1]]))}touchmove(v,E,D){const V=this._firstTwoTouches;if(!V)return;v.preventDefault();const[Y,Z]=V,ne=o4(D,E,Y),le=o4(D,E,Z);if(!ne||!le)return;const fe=this._aroundCenter?null:ne.add(le).div(2);return this._move([ne,le],fe,v)}touchend(v,E,D){if(!this._firstTwoTouches)return;const[V,Y]=this._firstTwoTouches,Z=o4(D,E,V),ne=o4(D,E,Y);Z&&ne||(this._active&&P(),this.reset())}touchcancel(){this.reset()}enable(v){this._enabled=true,this._aroundCenter=!!v&&"center"===v.around}disable(){this._enabled=false,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function o4(k,v,E){for(let D=0;DMath.abs(k.x)}class s4 extends _q{constructor(v){super(),this._map=v}reset(){super.reset(),this._valid=void 0,this._firstMove=void 0,this._lastPoints=void 0}_start(v){this._lastPoints=v,uI(v[0].sub(v[1]))&&(this._valid=false)}_move(v,E,D){const V=this._lastPoints;if(!V)return;const Y=v[0].sub(V[0]),Z=v[1].sub(V[1]);return this._map._cooperativeGestures&&!o.ew()&&D.touches.length<3||(this._valid=this.gestureBeginsVertically(Y,Z,D.timeStamp),!this._valid)?void 0:(this._lastPoints=v,this._active=true,{pitchDelta:(Y.y+Z.y)/2*-.5})}gestureBeginsVertically(v,E,D){if(void 0!==this._valid)return this._valid;const V=v.mag()>=2,Y=E.mag()>=2;if(!V&&!Y)return;if(!V||!Y)return this._firstMove??=D,D-this._firstMove<100&&void 0;const Z=v.y>0==E.y>0;return uI(v)&&uI(E)&&Z}}const M7={panStep:100,bearingStep:15,pitchStep:10};class Lse{constructor(){const v=M7;this._panStep=v.panStep,this._bearingStep=v.bearingStep,this._pitchStep=v.pitchStep,this._rotationDisabled=false,this._panDisabled=false}blur(){this.reset()}reset(){this._active=false}keydown(v){if(v.altKey||v.ctrlKey||v.metaKey)return;let E=0,D=0,V=0,Y=0,Z=0;switch(v.keyCode){case 61:case 107:case 171:case 187:E=1;break;case 189:case 109:case 173:E=-1;break;case 37:v.shiftKey?D=-1:(v.preventDefault(),Y=-1);break;case 39:v.shiftKey?D=1:(v.preventDefault(),Y=1);break;case 38:v.shiftKey?V=1:(v.preventDefault(),Z=-1);break;case 40:v.shiftKey?V=-1:(v.preventDefault(),Z=1);break;default:return}return this._rotationDisabled&&(D=0,V=0),this._panDisabled&&(Y=0,Z=0),{cameraAnimation:ne=>{const le=ne.getZoom();ne.easeTo({duration:300,easeId:"keyboardHandler",easing:Dse,zoom:E?Math.round(le)+E*(v.shiftKey?2:1):le,bearing:ne.getBearing()+D*this._bearingStep,pitch:ne.getPitch()+V*this._pitchStep,offset:[-Y*this._panStep,-Z*this._panStep],center:ne.getCenter()},{originalEvent:v})}}}enable(){this._enabled=true}disable(){this._enabled=false,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=true}enableRotation(){this._rotationDisabled=false}disablePan(){this._panDisabled=true}enablePan(){this._panDisabled=false}}function Dse(k){return k*(2-k)}const Eq=4.000244140625,Fse=1/450,Nse=/(Mac|iPad)/i;class BOe{constructor(v,E){this._map=v,this._el=v.getCanvasContainer(),this._handler=E,this._delta=0,this._lastDelta=0,this._defaultZoomRate=.01,this._wheelZoomRate=Fse,o.aV(["_onTimeout","_addScrollZoomBlocker","_showBlockerAlert"],this)}setZoomRate(v){this._defaultZoomRate=v}setWheelZoomRate(v){this._wheelZoomRate=v}isEnabled(){return!!this._enabled}isActive(){return this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(v){this.isEnabled()||(this._enabled=true,this._aroundCenter=!!v&&"center"===v.around,this._map._cooperativeGestures&&this._addScrollZoomBlocker())}disable(){this.isEnabled()&&(this._enabled=false,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove()))}wheel(v){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!(v.ctrlKey||v.metaKey||this.isZooming()||o.ew()))return void this._showBlockerAlert();"hidden"!==this._alertContainer.style.visibility&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}let E=v.deltaMode===WheelEvent.DOM_DELTA_LINE?40*v.deltaY:v.deltaY;const D=o.e.now(),V=D-(this._lastWheelEventTime||0);this._lastWheelEventTime=D,0!==E&&E%Eq===0?this._type="wheel":0!==E&&Math.abs(E)<4?this._type="trackpad":V>400?(this._type=null,this._lastValue=E,this._timeout=window.setTimeout(this._onTimeout,40,v)):this._type||(this._type=Math.abs(V*E)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,E+=this._lastValue)),v.shiftKey&&E&&(E/=4),this._type&&(this._lastWheelEvent=v,this._delta-=E,this._active||this._start(v)),v.preventDefault()}_onTimeout(v){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(v)}_start(v){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=true,this.isZooming()||(this._zooming=true),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const E=L(this._el,v);this._aroundPoint=this._aroundCenter?this._map.transform.centerPoint:E,this._aroundCoord=this._map.transform.pointCoordinate3D(this._aroundPoint),this._targetZoom=void 0,this._frameId||(this._frameId=true,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId)return;if(this._frameId=null,!this.isActive())return;const v=this._map.transform;"wheel"===this._type&&v.projection.wrap&&(v._center.lng>=180||v._center.lng<=-180)&&(this._prevEase=null,this._easing=null,this._lastWheelEvent=null,this._lastWheelEventTime=0);const E=()=>v._terrainEnabled()&&this._aroundCoord?v.computeZoomRelativeTo(this._aroundCoord):v.zoom;if(0!==this._delta){const fe="wheel"===this._type&&Math.abs(this._delta)>Eq?this._wheelZoomRate:this._defaultZoomRate;let me=2/(1+Math.exp(-Math.abs(this._delta*fe)));this._delta<0&&0!==me&&(me=1/me);const Pe=E(),Re=Math.pow(2,Pe),Ke="number"==typeof this._targetZoom?v.zoomScale(this._targetZoom):Re;this._targetZoom=Math.min(v.maxZoom,Math.max(v.minZoom,v.scaleZoom(Ke*me))),"wheel"===this._type&&(this._startZoom=Pe,this._easing=this._smoothOutEasing(200)),this._lastDelta=this._delta,this._delta=0}const D="number"==typeof this._targetZoom?this._targetZoom:E(),V=this._startZoom,Y=this._easing;let Z,ne=false;if("wheel"===this._type&&V&&Y){const fe=Math.min((o.e.now()-this._lastWheelEventTime)/200,1),me=Y(fe);Z=o.al(V,D,me),fe<1?this._frameId||(this._frameId=true):ne=true}else Z=D,ne=true;this._active=true,ne&&(this._active=false,this._finishTimeout=window.setTimeout(()=>{this._zooming=false,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200));let le=Z-E();return le*this._lastDelta<0&&(le=0),{noInertia:true,needsRenderFrame:!ne,zoomDelta:le,around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}_smoothOutEasing(v){let E=o.ex;if(this._prevEase){const D=this._prevEase,V=(o.e.now()-D.start)/D.duration,Y=D.easing(V+.01)-D.easing(V),Z=.27/Math.sqrt(Y*Y+1e-4)*.01,ne=Math.sqrt(.0729-Z*Z);E=o.ev(Z,ne,.25,1)}return this._prevEase={start:o.e.now(),duration:v,easing:E},E}blur(){this.reset()}reset(){this._active=false}_addScrollZoomBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=h("div","mapboxgl-scroll-zoom-blocker",this._map._container),this._alertContainer.textContent=Nse.test(navigator.userAgent)?this._map._getUIString("ScrollZoomBlocker.CmdMessage"):this._map._getUIString("ScrollZoomBlocker.CtrlMessage"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=window.setTimeout(()=>{this._alertContainer.classList.remove("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.removeAttribute("role")},200)}}class Ose{constructor(v,E){this._clickZoom=v,this._tapZoom=E}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class zOe{constructor(){this.reset()}reset(){this._active=false}blur(){this.reset()}dblclick(v,E){return v.preventDefault(),{cameraAnimation:D=>{D.easeTo({duration:300,zoom:D.getZoom()+(v.shiftKey?-1:1),around:D.unproject(E)},{originalEvent:v})}}}enable(){this._enabled=true}disable(){this._enabled=false,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class im{constructor(){this._tap=new gT({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=false,this._swipePoint=void 0,this._swipeTouch=0,this._tapTime=0,this._tap.reset()}touchstart(v,E,D){this._swipePoint||(this._tapTime&&v.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?D.length>0&&(this._swipePoint=E[0],this._swipeTouch=D[0].identifier):this._tap.touchstart(v,E,D))}touchmove(v,E,D){if(this._tapTime){if(this._swipePoint){if(D[0].identifier!==this._swipeTouch)return;const V=E[0],Y=V.y-this._swipePoint.y;return this._swipePoint=V,v.preventDefault(),this._active=true,{zoomDelta:Y/128}}}else this._tap.touchmove(v,E,D)}touchend(v,E,D){this._tapTime?this._swipePoint&&0===D.length&&this.reset():this._tap.touchend(v,E,D)&&(this._tapTime=v.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=true}disable(){this._enabled=false,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class L7{constructor(v,E,D){this._el=v,this._mousePan=E,this._touchPan=D}enable(v){this._inertiaOptions=v||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class dI{constructor(v,E,D){this._pitchWithRotate=v.pitchWithRotate,this._mouseRotate=E,this._mousePitch=D,this._pitchDisabled=false}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&!this._pitchDisabled&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._pitchDisabled||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}disablePitch(){this._pitchDisabled=true,this._mousePitch.disable()}enablePitch(){this._pitchDisabled=false,this._pitchWithRotate&&this._mouseRotate.isEnabled()&&this._mousePitch.enable()}}class Bse{constructor(v,E,D,V){this._el=v,this._touchZoom=E,this._touchRotate=D,this._tapDragZoom=V,this._rotationDisabled=false,this._tapDragZoomDisabled=false,this._enabled=true}enable(v){this._touchZoom.enable(v),this._rotationDisabled||this._touchRotate.enable(v),this._tapDragZoomDisabled||this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&(this._tapDragZoomDisabled||this._tapDragZoom.isEnabled())}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=true,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=false,this._touchZoom.isEnabled()&&this._touchRotate.enable()}disableTapDragZoom(){this._tapDragZoomDisabled=true,this._tapDragZoom.disable()}enableTapDragZoom(){this._tapDragZoomDisabled=false,this._touchZoom.isEnabled()&&this._tapDragZoom.enable()}}const Bv=k=>k.zoom||k.drag||k.pitch||k.rotate;class l4 extends o.h{}class UOe{constructor(){this.constants=[1,1,.01],this.radius=0}setup(v,E){const D=o.c2([],E,v);this.radius=o.el(D[2]<0?o.ez([],D,this.constants):[D[0],D[1],0])}projectRay(v){o.ez(v,v,this.constants),o.c3(v,v),o.eA(v,v,this.constants);const E=o.dB([],v,this.radius);if(E[2]>0){const D=o.dB([],[0,0,1],o.dE(E,[0,0,1])),V=o.dB([],o.c3([],[E[0],E[1],0]),this.radius),Y=o.dC([],E,o.dB([],o.c2([],o.dC([],V,D),E),2));E[0]=Y[0],E[1]=Y[1]}return E}}function D7(k){return k.panDelta&&k.panDelta.mag()||k.zoomDelta||k.bearingDelta||k.pitchDelta}class VOe{constructor(v,E){this._map=v,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Rl(v),this._bearingSnap=E.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new UOe,this._dragOrigin=null,this._mouseBeingPressed=false,this._activeTouchCount=0,this._eventsInProgress={},this._addDefaultHandlers(E),o.aV(["handleEvent","handleWindowEvent"],this);const D=this._el;this._listeners=[[D,"touchstart",{passive:true}],[D,"touchmove",{passive:false}],[D,"touchend",void 0],[D,"touchcancel",void 0],[D,"mousedown",void 0],[D,"mousemove",void 0],[D,"mouseup",void 0],[document,"mousemove",{capture:true}],[document,"mouseup",void 0],[D,"mouseover",void 0],[D,"mouseout",void 0],[D,"dblclick",void 0],[D,"click",void 0],[D,"keydown",{capture:false}],[D,"keyup",void 0],[D,"wheel",{passive:false}],[D,"contextmenu",void 0],[window,"blur",void 0]];for(const[V,Y,Z]of this._listeners){const ne=V===document?this.handleWindowEvent:this.handleEvent;V.addEventListener(Y,ne,Z)}}destroy(){for(const[v,E,D]of this._listeners){const V=v===document?this.handleWindowEvent:this.handleEvent;v.removeEventListener(E,V,D)}}_addDefaultHandlers(v){const E=this._map,D=E.getCanvasContainer();this._add("mapEvent",new xq(E,v));const V=E.boxZoom=new O2(E,v);this._add("boxZoom",V);const Y=new Ql,Z=new zOe;E.doubleClickZoom=new Ose(Z,Y),this._add("tapZoom",Y),this._add("clickZoom",Z);const ne=new im;this._add("tapDragZoom",ne);const le=E.touchPitch=new s4(E);this._add("touchPitch",le);const fe=new vq(v),me=new yA(v);E.dragRotate=new dI(v,fe,me),this._add("mouseRotate",fe,["mousePitch"]),this._add("mousePitch",me,["mouseRotate"]);const Pe=new Ise(v),Re=new OOe(E,v);E.dragPan=new L7(D,Pe,Re),this._add("mousePan",Pe),this._add("touchPan",Re,["touchZoom","touchRotate"]);const Ke=new Mse,ot=new Tq;E.touchZoomRotate=new Bse(D,ot,Ke,ne),this._add("touchRotate",Ke,["touchPan","touchZoom"]),this._add("touchZoom",ot,["touchPan","touchRotate"]),this._add("blockableMapEvent",new mT(E));const at=E.scrollZoom=new BOe(E,this);this._add("scrollZoom",at,["mousePan"]);const xt=E.keyboard=new Lse;this._add("keyboard",xt);for(const vt of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])v.interactive&&v[vt]&&E[vt].enable(v[vt])}_add(v,E,D){this._handlers.push({handlerName:v,handler:E,allowed:D}),this._handlersById[v]=E}stop(v="never"){if(!this._updatingCamera&&!("always"===v||"ifPointerDown"===v&&this._isPointerDown())){for(const{handler:E}of this._handlers)E.reset();this._inertia.clear(),this._fireEvents({},{},false),this._changes=[],this._originalZoom=void 0}}isActive(){for(const{handler:v}of this._handlers)if(v.isActive())return true;return false}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Bv(this._eventsInProgress)||this.isZooming()}_isDragging(){return!!this._eventsInProgress.drag}_blockedByActive(v,E,D){for(const V in v)if(!(V===D||E&&E.includes(V)))return true;return false}handleWindowEvent(v){this.handleEvent(v,`${v.type}Window`)}_getMapTouches(v){const E=[];for(const D of v)this._el.contains(D.target)&&E.push(D);return E}_updatePointerLiveness(v){switch(v.type){case"mousedown":this._mouseBeingPressed=true;break;case"mousemove":0===v.buttons&&(this._mouseBeingPressed=false);break;case"mouseup":this._mouseBeingPressed=false;break;case"touchstart":case"touchmove":case"touchend":case"touchcancel":this._activeTouchCount=v.touches?v.touches.length:0;break;case"blur":this._mouseBeingPressed=false,this._activeTouchCount=0}}_isPointerDown(){return this._mouseBeingPressed||this._activeTouchCount>0}handleEvent(v,E){this._updatePointerLiveness(v),this._updatingCamera=true;const D="renderFrame"===v.type,V=D?void 0:v,Y={needsRenderFrame:false},Z={},ne={},le=v.touches?this._getMapTouches(v.touches):void 0,fe=le?I(this._el,le):D?void 0:L(this._el,v);for(const{handlerName:Re,handler:Ke,allowed:ot}of this._handlers){if(!Ke.isEnabled())continue;let at;this._blockedByActive(ne,ot,Re)?Ke.reset():Ke[E||v.type]&&(at=Ke[E||v.type](v,fe,le),this.mergeHandlerResult(Y,Z,at,Re,V),at&&at.needsRenderFrame&&this._triggerRenderFrame()),(at||Ke.isActive())&&(ne[Re]=Ke)}const me={};for(const Re in this._previousActiveHandlers)ne[Re]||(me[Re]=V);this._previousActiveHandlers=ne,(Object.keys(me).length||D7(Y))&&(this._changes.push([Y,Z,me]),this._triggerRenderFrame()),(Object.keys(ne).length||D7(Y))&&this._map._stop({keepGesture:"always"}),this._updatingCamera=false;const{cameraAnimation:Pe}=Y;Pe&&(this._inertia.clear(),this._fireEvents({},{},true),this._changes=[],Pe(this._map))}mergeHandlerResult(v,E,D,V,Y){if(!D)return;Object.assign(v,D);const Z={handlerName:V,originalEvent:D.originalEvent||Y};void 0!==D.zoomDelta&&(E.zoom=Z),void 0!==D.panDelta&&(E.drag=Z),void 0!==D.pitchDelta&&(E.pitch=Z),void 0!==D.bearingDelta&&(E.rotate=Z)}_applyChanges(){const v={},E={},D={};for(const[V,Y,Z]of this._changes)V.panDelta&&(v.panDelta=(v.panDelta||new o.P(0,0))._add(V.panDelta)),V.zoomDelta&&(v.zoomDelta=(v.zoomDelta||0)+V.zoomDelta),V.bearingDelta&&(v.bearingDelta=(v.bearingDelta||0)+V.bearingDelta),V.pitchDelta&&(v.pitchDelta=(v.pitchDelta||0)+V.pitchDelta),void 0!==V.around&&(v.around=V.around),void 0!==V.aroundCoord&&(v.aroundCoord=V.aroundCoord),void 0!==V.pinchAround&&(v.pinchAround=V.pinchAround),V.noInertia&&(v.noInertia=V.noInertia),Object.assign(E,Y),Object.assign(D,Z);this._updateMapTransform(v,E,D),this._changes=[]}_updateMapTransform(v,E,D){const V=this._map,Y=V.transform,Z=It=>[It.x,It.y,It.z];if((()=>{const It=this._eventsInProgress.drag;return It&&!this._handlersById[It.handlerName].isActive()})()&&!D7(v)){const It=Y.zoom;Y.cameraElevationReference="sea",null!=this._originalZoom&&Y._orthographicProjectionAtLowPitch&&"globe"!==Y.projection.name&&0===Y.pitch?(Y.cameraElevationReference="ground",Y.zoom=this._originalZoom):(Y.recenterOnTerrain(),Y.cameraElevationReference="ground"),It!==Y.zoom&&this._map._update(true)}if(Y._isCameraConstrained&&V._stop({keepGesture:"always"}),!D7(v))return void this._fireEvents(E,D,true);let{panDelta:ne,zoomDelta:le,bearingDelta:fe,pitchDelta:me,around:Pe,aroundCoord:Re,pinchAround:Ke}=v;Y._isCameraConstrained&&(le>0&&(le=0),Y._isCameraConstrained=false),void 0!==Ke&&(Pe=Ke),(le||(It=>E[It]&&!this._eventsInProgress[It])("drag"))&&Pe&&(this._dragOrigin=Z(Y.pointCoordinate3D(Pe)),this._originalZoom=Y.zoom,this._trackingEllipsoid.setup(Y._camera.position,this._dragOrigin)),Y.cameraElevationReference="sea",V._stop({keepGesture:"always"}),Pe=Pe||V.transform.centerPoint,fe&&(Y.bearing+=fe),me&&(Y.pitch+=me),Y._updateCameraState();const ot=[0,0,0];if(ne)if("mercator"===Y.projection.name){const It=this._trackingEllipsoid.projectRay(Y.screenPointToMercatorRay(Pe).dir),jt=this._trackingEllipsoid.projectRay(Y.screenPointToMercatorRay(Pe.sub(ne)).dir);ot[0]=jt[0]-It[0],ot[1]=jt[1]-It[1]}else{const It=Y.pointCoordinate(Pe);if("globe"===Y.projection.name){ne=ne.rotate(-Y.angle);const jt=Y._pixelsPerMercatorPixel/Y.worldSize;ot[0]=-ne.x*o.ey(o.br(It.y))*jt,ot[1]=-ne.y*o.ey(Y.center.lat)*jt}else{const jt=Y.pointCoordinate(Pe.sub(ne));It&&jt&&(ot[0]=jt.x-It.x,ot[1]=jt.y-It.y)}}const at=Y.zoom,xt=[0,0,0];if(le){const It=Z(Re||Y.pointCoordinate3D(Pe)),jt={dir:o.c3([],o.c2([],It,Y._camera.position))};if(jt.dir[2]<0){const Zt=Y.zoomDeltaToMovement(It,le);o.dB(xt,jt.dir,Zt)}}const vt=o.dC(ot,ot,xt);Y._translateCameraConstrained(vt),le&&Math.abs(Y.zoom-at)>1e-4&&Y.recenterOnTerrain(),Y.cameraElevationReference="ground",this._map._update(),v.noInertia||this._inertia.record(v),this._fireEvents(E,D,true)}_fireEvents(v,E,D){const V=Bv(this._eventsInProgress),Y=Bv(v),Z={};for(const me in v){const{originalEvent:Pe}=v[me];this._eventsInProgress[me]||(Z[`${me}start`]=Pe),this._eventsInProgress[me]=v[me]}!V&&Y&&this._fireEvent("movestart",Y.originalEvent);for(const me in Z)this._fireEvent(me,Z[me]);Y&&this._fireEvent("move",Y.originalEvent);for(const me in v){const{originalEvent:Pe}=v[me];this._fireEvent(me,Pe)}const ne={};let le;for(const me in this._eventsInProgress){const{handlerName:Pe,originalEvent:Re}=this._eventsInProgress[me];this._handlersById[Pe].isActive()||(delete this._eventsInProgress[me],le=E[Pe]||Re,ne[`${me}end`]=le)}for(const me in ne)this._fireEvent(me,ne[me]);const fe=Bv(this._eventsInProgress);if(D&&(V||Y)&&!fe){this._updatingCamera=true;const me=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),Pe=Re=>0!==Re&&-this._bearingSnap{this._frameId=void 0,this.handleEvent(new l4("renderFrame",{timeStamp:v})),this._applyChanges()})}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}const zse="map.setFreeCameraOptions(...) and map.getFreeCameraOptions() are not yet supported for non-mercator projections.";class $Oe extends o.E{constructor(v,E){super(),this._moving=false,this._zooming=false,this.transform=v,this._bearingSnap=E.bearingSnap,this._respectPrefersReducedMotion=false!==E.respectPrefersReducedMotion,o.aV(["_renderFrameCallback"],this)}getCenter(){return new o.cz(this.transform.center.lng,this.transform.center.lat)}setCenter(v,E){return this.jumpTo({center:v},E)}panBy(v,E,D){return v=o.P.convert(v).mult(-1),this.panTo(this.transform.center,{offset:v,...E},D)}panTo(v,E,D){return this.easeTo({center:v,...E},D)}getZoom(){return this.transform.zoom}setZoom(v,E){return this.jumpTo({zoom:v},E),this}zoomTo(v,E,D){return this.easeTo({zoom:v,...E},D)}zoomIn(v,E){return this.zoomTo(this.getZoom()+1,v,E),this}zoomOut(v,E){return this.zoomTo(this.getZoom()-1,v,E),this}getBearing(){return this.transform.bearing}setBearing(v,E){return this.jumpTo({bearing:v},E),this}getPadding(){return this.transform.padding}setPadding(v,E){return this.jumpTo({padding:v},E),this}rotateTo(v,E,D){return this.easeTo({bearing:v,...E},D)}resetNorth(v,E){return this.rotateTo(0,{duration:1e3,...v},E),this}resetNorthPitch(v,E){return this.easeTo({bearing:0,pitch:0,duration:1e3,...v},E),this}snapToNorth(v,E){return Math.abs(this.getBearing())v.aspect?D/(2*Math.tan(.5*v.fovX)*v.aspect):V/(2*Math.tan(.5*v.fovY)*v.aspect)}_cameraForBoundsOnGlobe(v,E,D,V,Y,Z){const ne=v.clone(),le=this._extendCameraOptions(Z);ne.bearing=V,ne.pitch=Y;const fe=o.cz.convert(E),me=o.cz.convert(D),Pe=.5*(fe.lat+me.lat),Re=.5*(fe.lng+me.lng),Ke=o.eC(Pe,Re),ot=o.c3([],Ke),at=o.c3([],o.eD([],ot,[0,1,0])),xt=o.eD([],at,ot),vt=[at[0],at[1],at[2],0,xt[0],xt[1],xt[2],0,ot[0],ot[1],ot[2],0,0,0,0,1],It=[Ke,o.eC(fe.lat,fe.lng),o.eC(me.lat,fe.lng),o.eC(me.lat,me.lng),o.eC(fe.lat,me.lng),o.eC(Pe,fe.lng),o.eC(Pe,me.lng),o.eC(fe.lat,Re),o.eC(me.lat,Re)];let jt=o.eE.fromPoints(It.map(si=>[o.dE(at,si),o.dE(xt,si),o.dE(ot,si)]));const Zt=o.bH([],jt.center,vt);0===o.eF(Zt)&&o.eG(Zt,0,0,1),o.c3(Zt,Zt),o.dB(Zt,Zt,o.c8),ne.center=o.eH(Zt);const kn=ne.getWorldToCameraMatrix(),cn=o.aO(new Float64Array(16),kn);jt=o.eE.applyTransform(jt,o.X([],kn,vt));const hn=this._extendAABB(jt,ne,le,V);if(!hn)return void o.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");jt=hn,o.bH(Zt,Zt,kn);const xn=.5*(jt.max[2]-jt.min[2]),wn=this._minimumAABBFrustumDistance(ne,jt),Bn=o.dB([],[0,0,1],xn),Kn=o.dC(Bn,Zt,Bn),Wn=wn+(0===ne.pitch?0:o.eI(Zt,Kn)),Yn=ne.globeCenterInViewSpace,Vn=o.c2([],Zt,[Yn[0],Yn[1],Yn[2]]);o.c3(Vn,Vn),o.dB(Vn,Vn,Wn);const Zr=o.dC([],Zt,Vn);o.bH(Zr,Zr,cn);const Qn=o.bj/o.c8,kr=o.el(Zr),Vr=o.dv(Math.max(kr*Qn-o.bj,Number.EPSILON),0),mi=Math.min(ne.zoomFromMercatorZAdjusted(Vr),le.maxZoom);return mi>.5*(o.e8+o.b1)?(ne.setProjection({name:"mercator"}),ne.zoom=mi,this._cameraForBounds(ne,E,D,V,Y,Z)):{center:ne.center,zoom:mi,bearing:V,pitch:Y}}_extendAABB(v,E,D,V){const Y=.5*((D.padding.left||0)+(D.padding.right||0)),Z=.5*((D.padding.top||0)+(D.padding.bottom||0)),ne=Z,le=Y,fe=Y,me=Z,Pe=E.width-(le+fe),Re=E.height-(ne+me),Ke=o.c2([],v.max,v.min),ot=Math.min(Pe/Ke[0],Re/Ke[1]),at=Math.min(E.scaleZoom(E.scale*ot),D.maxZoom);if(isNaN(at))return null;const xt=E.scale/E.zoomScale(at),vt=new o.eE([v.min[0]-le*xt,v.min[1]-me*xt,v.min[2]],[v.max[0]+fe*xt,v.max[1]+ne*xt,v.max[2]]),It=("number"==typeof D.offset.x&&"number"==typeof D.offset.y?new o.P(D.offset.x,D.offset.y):o.P.convert(D.offset)).rotate(-o.au(V));return vt.center[0]-=It.x*xt,vt.center[1]+=It.y*xt,vt}queryTerrainElevation(v,E){const D=this.transform.elevation;return D?(E={exaggerated:true,...E},D.getAtPoint(o.bS.fromLngLat(v),null,E.exaggerated)):null}_cameraForBounds(v,E,D,V,Y,Z){if("globe"===v.projection.name)return this._cameraForBoundsOnGlobe(v,E,D,V,Y,Z);const ne=v.clone(),le=this._extendCameraOptions(Z);ne.bearing=V,ne.pitch=Y;const fe=o.cz.convert(E),me=o.cz.convert(D),Pe=new o.cz(fe.lng,me.lat),Re=new o.cz(me.lng,fe.lat),Ke=ne.project(fe),ot=ne.project(me),at=this.queryTerrainElevation(fe),xt=this.queryTerrainElevation(me),vt=this.queryTerrainElevation(Pe),It=this.queryTerrainElevation(Re),jt=[[Ke.x,Ke.y,Math.min(at||0,xt||0,vt||0,It||0)],[ot.x,ot.y,Math.max(at||0,xt||0,vt||0,It||0)]];let Zt=o.eE.fromPoints(jt);const kn=ne.getWorldToCameraMatrix(),cn=o.aO(new Float64Array(16),kn);Zt=o.eE.applyTransform(Zt,kn);const hn=this._extendAABB(Zt,ne,le,V);if(!hn)return void o.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");Zt=hn;const xn=.5*o.c2([],Zt.max,Zt.min)[2],wn=this._minimumAABBFrustumDistance(ne,Zt),Bn=[0,0,1,0];o.c7(Bn,Bn,kn),o.eJ(Bn,Bn);const Kn=o.dB([],Bn,wn+xn),Wn=o.dC([],Zt.center,Kn);o.bH(Zt.center,Zt.center,cn),o.bH(Wn,Wn,cn);const Yn=ne.unproject(new o.P(Zt.center[0],Zt.center[1])),Vn=o.eK(ne.projection,Yn),Zr=Math.pow(2,Vn),Qn=Math.min(ne._zoomFromMercatorZ(Wn[2]*ne.pixelsPerMeter*Zr/ne.worldSize),le.maxZoom);return ne.mercatorFromTransition&&Qn<.5*(o.e8+o.b1)?(ne.setProjection({name:"globe"}),ne.zoom=Qn,this._cameraForBounds(ne,E,D,V,Y,Z)):{center:Yn,zoom:Qn,bearing:V,pitch:Y}}fitBounds(v,E,D){const V=this.cameraForBounds(v,E);return this._fitInternal(V,E,D)}fitScreenCoordinates(v,E,D,V,Y){const Z=o.P.convert(v),ne=o.P.convert(E),le=new o.P(Math.min(Z.x,ne.x),Math.min(Z.y,ne.y)),fe=new o.P(Math.max(Z.x,ne.x),Math.max(Z.y,ne.y));if("mercator"===this.transform.projection.name&&this.transform.anyCornerOffEdge(Z,ne))return this;const me=this.transform.pointLocation3D(le),Pe=this.transform.pointLocation3D(fe),Re=this.transform.pointLocation3D(new o.P(le.x,fe.y)),Ke=this.transform.pointLocation3D(new o.P(fe.x,le.y)),ot=[Math.min(me.lng,Pe.lng,Re.lng,Ke.lng),Math.min(me.lat,Pe.lat,Re.lat,Ke.lat)],at=[Math.max(me.lng,Pe.lng,Re.lng,Ke.lng),Math.max(me.lat,Pe.lat,Re.lat,Ke.lat)],xt=V&&V.pitch?V.pitch:this.getPitch(),vt=this._cameraForBounds(this.transform,ot,at,D,xt,V);return this._fitInternal(vt,V,Y)}_fitInternal(v,E,D){return v?(E=Object.assign(v,E)).linear?this.easeTo(E,D):this.flyTo(E,D):this}jumpTo(v,E){this._stop({keepGesture:"ifPointerDown"});const D=v.preloadOnly?this.transform.clone():this.transform;let V=false,Y=false,Z=false;"zoom"in v&&D.zoom!==+v.zoom&&(V=true,D.zoom=+v.zoom),void 0!==v.center&&(D.center=o.cz.convert(v.center)),"bearing"in v&&D.bearing!==+v.bearing&&(Y=true,D.bearing=+v.bearing),"pitch"in v&&D.pitch!==+v.pitch&&(Z=true,D.pitch=+v.pitch),"fov"in v&&(D.fov=+v.fov);const ne="number"==typeof v.padding?this._extendPadding(v.padding):v.padding;if(null!=v.padding&&!D.isPaddingEqual(ne))if(false===v.retainPadding){const le=D.clone();le.padding=ne,D.setLocationAtPoint(D.center,le.centerPoint)}else D.padding=ne;return v.preloadOnly?(this._preloadTiles(D),this):(this.fire(new o.h("movestart",E)).fire(new o.h("move",E)),V&&this.fire(new o.h("zoomstart",E)).fire(new o.h("zoom",E)).fire(new o.h("zoomend",E)),Y&&this.fire(new o.h("rotatestart",E)).fire(new o.h("rotate",E)).fire(new o.h("rotateend",E)),Z&&this.fire(new o.h("pitchstart",E)).fire(new o.h("pitch",E)).fire(new o.h("pitchend",E)),this.fire(new o.h("moveend",E)))}getFreeCameraOptions(){return this.transform.projection.supportsFreeCamera||o.w(zse),this.transform.getFreeCameraOptions()}setFreeCameraOptions(v,E){const D=this.transform;if(!D.projection.supportsFreeCamera)return o.w(zse),this;this.stop();const V=D.zoom,Y=D.pitch,Z=D.bearing;D.setFreeCameraOptions(v);const ne=V!==D.zoom,le=Y!==D.pitch,fe=Z!==D.bearing;return this.fire(new o.h("movestart",E)).fire(new o.h("move",E)),ne&&this.fire(new o.h("zoomstart",E)).fire(new o.h("zoom",E)).fire(new o.h("zoomend",E)),fe&&this.fire(new o.h("rotatestart",E)).fire(new o.h("rotate",E)).fire(new o.h("rotateend",E)),le&&this.fire(new o.h("pitchstart",E)).fire(new o.h("pitch",E)).fire(new o.h("pitchend",E)),this.fire(new o.h("moveend",E)),this}easeTo(v,E){this._stop({easeId:v.easeId}),(false===(v={offset:[0,0],duration:500,easing:o.ex,...v}).animate||this._prefersReducedMotion(v))&&(v.duration=0);const D=this.transform,V=this.getZoom(),Y=this.getBearing(),Z=this.getPitch(),ne=this.getPadding(),le=this.getVerticalFieldOfView(),fe="zoom"in v?+v.zoom:V,me="bearing"in v?this._normalizeBearing(v.bearing,Y):Y,Pe="pitch"in v?+v.pitch:Z,Re="fov"in v?+v.fov:le,Ke=this._extendPadding(v.padding),ot=o.P.convert(v.offset);let at,xt,vt;if("globe"===D.projection.name){const Yn=o.bS.fromLngLat(D.center),Vn=ot.rotate(-D.angle);Yn.x+=Vn.x/D.worldSize,Yn.y+=Vn.y/D.worldSize;const Zr=Yn.toLngLat(),Qn=o.cz.convert(v.center||Zr);this._normalizeCenter(Qn),at=D.centerPoint.add(Vn),xt=new o.P(Yn.x,Yn.y).mult(D.worldSize),vt=new o.P(o.a7(Qn.lng),o.a8(Qn.lat)).mult(D.worldSize).sub(xt)}else{at=D.centerPoint.add(ot);const Yn=D.pointLocation(at),Vn=o.cz.convert(v.center||Yn);this._normalizeCenter(Vn),xt=D.project(Yn),vt=D.project(Vn).sub(xt)}const It=D.zoomScale(fe-V);let jt,Zt;v.around&&(jt=o.cz.convert(v.around),Zt=D.locationPoint(jt));const kn=this._zooming||fe!==V,cn=this._rotating||Y!==me,hn=this._pitching||Pe!==Z,xn=Re!==le,wn=!D.isPaddingEqual(Ke),Bn=false===v.retainPadding?D.clone():D,Kn=Yn=>Vn=>{if(kn&&(Yn.zoom=o.al(V,fe,Vn)),cn&&(Yn.bearing=o.al(Y,me,Vn)),hn&&(Yn.pitch=o.al(Z,Pe,Vn)),xn&&(Yn.fov=o.al(le,Re,Vn)),wn&&(Bn.interpolatePadding(ne,Ke,Vn),at=Bn.centerPoint.add(ot)),jt)Yn.setLocationAtPoint(jt,Zt);else{const Zr=Yn.zoomScale(Yn.zoom-V),Qn=fe>V?Math.min(2,It):Math.max(.5,It),kr=Math.pow(Qn,1-Vn),Vr=Yn.unproject(xt.add(vt.mult(Vn*kr)).mult(Zr));Yn.setLocationAtPoint(Yn.renderWorldCopies?Vr.wrap():Vr,at)}return v.preloadOnly||this._fireMoveEvents(E),Yn};if(v.preloadOnly){const Yn=this._emulate(Kn,v.duration,D);return this._preloadTiles(Yn),this}const Wn={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=kn,this._rotating=cn,this._pitching=hn,this._padding=wn,this._easeId=v.easeId,this._prepareEase(E,v.noMoveStart,Wn),this._ease(Kn(D),Yn=>{"sea"===D.cameraElevationReference&&D.recenterOnTerrain(),this._afterEase(E,Yn)},v),this}_prepareEase(v,E,D={}){this._moving=true,this.transform.cameraElevationReference="sea",this.transform._orthographicProjectionAtLowPitch&&0===this.transform.pitch&&"globe"!==this.transform.projection.name&&(this.transform.cameraElevationReference="ground"),E||D.moving||this.fire(new o.h("movestart",v)),this._zooming&&!D.zooming&&this.fire(new o.h("zoomstart",v)),this._rotating&&!D.rotating&&this.fire(new o.h("rotatestart",v)),this._pitching&&!D.pitching&&this.fire(new o.h("pitchstart",v))}_fireMoveEvents(v){this.fire(new o.h("move",v)),this._zooming&&this.fire(new o.h("zoom",v)),this._rotating&&this.fire(new o.h("rotate",v)),this._pitching&&this.fire(new o.h("pitch",v))}_afterEase(v,E){if(this._easeId&&E&&this._easeId===E)return;this._easeId=void 0,this.transform.cameraElevationReference="ground";const D=this._zooming,V=this._rotating,Y=this._pitching;this._moving=false,this._zooming=false,this._rotating=false,this._pitching=false,this._padding=false,D&&this.fire(new o.h("zoomend",v)),V&&this.fire(new o.h("rotateend",v)),Y&&this.fire(new o.h("pitchend",v)),this.fire(new o.h("moveend",v))}flyTo(v,E){if(this._prefersReducedMotion(v)){const Wr=o.cb(v,["center","zoom","bearing","pitch","fov","around","padding","retainPadding"]);return this.jumpTo(Wr,E)}this.stop(),v={offset:[0,0],speed:1.2,curve:1.42,easing:o.ex,...v};const D=this.transform,V=this.getZoom(),Y=this.getBearing(),Z=this.getPitch(),ne=this.getPadding(),le=this.getVerticalFieldOfView(),fe="zoom"in v?o.b0(+v.zoom,D.minZoom,D.maxZoom):V,me="bearing"in v?this._normalizeBearing(v.bearing,Y):Y,Pe="pitch"in v?+v.pitch:Z,Re="fov"in v?+v.fov:le,Ke=Re!==le,ot=this._extendPadding(v.padding),at=D.zoomScale(fe-V),xt=o.P.convert(v.offset);let vt=D.centerPoint.add(xt);const It=D.pointLocation(vt),jt=o.cz.convert(v.center||It);this._normalizeCenter(jt);const Zt=D.project(It),kn=D.project(jt).sub(Zt);let cn=v.curve;const hn=Math.max(D.width,D.height),xn=hn/at,wn=kn.mag();if("minZoom"in v){const Wr=o.b0(Math.min(v.minZoom,V,fe),D.minZoom,D.maxZoom),Lr=hn/D.zoomScale(Wr-V);cn=Math.sqrt(Lr/wn*2)}const Bn=cn*cn;function Kn(Wr){const Lr=(xn*xn-hn*hn+(Wr?-1:1)*Bn*Bn*wn*wn)/(2*(Wr?xn:hn)*Bn*wn);return Math.log(Math.sqrt(Lr*Lr+1)-Lr)}function Wn(Wr){return(Math.exp(Wr)-Math.exp(-Wr))/2}function Yn(Wr){return(Math.exp(Wr)+Math.exp(-Wr))/2}const Vn=Kn(0);let Zr=function(Wr){return Yn(Vn)/Yn(Vn+cn*Wr)},Qn=function(Wr){return hn*((Yn(Vn)*(Wn(Lr=Vn+cn*Wr)/Yn(Lr))-Wn(Vn))/Bn)/wn;var Lr},kr=(Kn(1)-Vn)/cn;if(Math.abs(wn)<1e-6||!isFinite(kr)){if(Math.abs(hn-xn)<1e-6)return this.easeTo(v,E);const Wr=xnv.maxDuration&&(v.duration=0);const Vr=Y!==me,mi=Pe!==Z,si=!D.isPaddingEqual(ot),Kr=false===v.retainPadding?D.clone():D,qi=Wr=>Lr=>{const ii=Lr*kr,Di=1/Zr(ii);Wr.zoom=1===Lr?fe:V+Wr.scaleZoom(Di),Vr&&(Wr.bearing=o.al(Y,me,Lr)),mi&&(Wr.pitch=o.al(Z,Pe,Lr)),Ke&&(Wr.fov=o.al(le,Re,Lr)),si&&(Kr.interpolatePadding(ne,ot,Lr),vt=Kr.centerPoint.add(xt));const ci=1===Lr?jt:Wr.unproject(Zt.add(kn.mult(Qn(ii))).mult(Di));return Wr.setLocationAtPoint(Wr.renderWorldCopies?ci.wrap():ci,vt),Wr._updateCameraOnTerrain(),v.preloadOnly||this._fireMoveEvents(E),Wr};if(v.preloadOnly){const Wr=this._emulate(qi,v.duration,D);return this._preloadTiles(Wr),this}return this._zooming=true,this._rotating=Vr,this._pitching=mi,this._padding=si,this._prepareEase(E,false),this._ease(qi(D),()=>this._afterEase(E),v),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_requestRenderFrame(v){}_cancelRenderFrame(v){}_stop({easeId:v,keepGesture:E}={}){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),this._easeFrameId=void 0,this._onEaseFrame=void 0),this._onEaseEnd){const V=this._onEaseEnd;this._onEaseEnd=void 0,V.call(this,v)}const D=this.handlers;return D&&D.stop(E),this}_ease(v,E,D){false===D.animate||0===D.duration?(v(1),E()):(this._easeStart=o.e.now(),this._easeOptions=D,this._onEaseFrame=v,this._onEaseEnd=E,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const v=Math.min((o.e.now()-this._easeStart)/this._easeOptions.duration,1),E=this._onEaseFrame;E&&E(this._easeOptions.easing(v)),v<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(v,E){v=o.cU(v,-180,180);const D=Math.abs(v-E);return Math.abs(v-360-E)180?-360:D<-180?360:0}_prefersReducedMotion(v){return this._respectPrefersReducedMotion&&o.e.prefersReducedMotion&&!(v&&v.essential)}_emulate(v,E,D){const V=Math.ceil(15*E/1e3),Y=[],Z=v(D.clone());for(let ne=0;ne<=V;ne++){const le=Z(ne/V);Y.push(le.clone())}return Y}_preloadTiles(v,E){}}const GOe=/^(https?:|mailto:)/i;class Use{constructor(v={}){this.options=v,o.aV(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}getDefaultPosition(){return"bottom-right"}onAdd(v){const E=this.options&&this.options.compact,D=v._getUIString("AttributionControl.ToggleAttribution");this._map=v,this._container=h("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=h("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.type="button",this._compactButton.addEventListener("click",this._toggleAttribution),this._compactButton.setAttribute("aria-label",D);const V=h("span","mapboxgl-ctrl-icon",this._compactButton);return V.setAttribute("aria-hidden","true"),V.setAttribute("title",D),this._innerContainer=h("div","mapboxgl-ctrl-attrib-inner",this._container),E&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===E&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0}_toggleAttribution(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","true"))}_updateEditLink(){let v=this._editLink;v||(v=this._editLink=this._container.querySelector(".mapbox-improve-map"));const E=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||o.eL.ACCESS_TOKEN}];if(v){const D=E.reduce((V,Y,Z)=>(Y.value&&(V+=`${Y.key}=${Y.value}${ZV.length-Y.length),v=v.filter((V,Y)=>{for(let Z=Y+1;Zfunction(Y){const Z=new DOMParser().parseFromString(Y,"text/html");return Array.from(Z.body.querySelectorAll("*")).reverse().forEach(ne=>{const le=ne.textContent||"";if("A"!==ne.tagName)return void ne.replaceWith(...ne.childNodes);const fe=ne.getAttribute("href");if(!fe||!GOe.test(fe))return void ne.replaceWith(Z.createTextNode(le));const me=Z.createElement("a");me.href=fe,me.textContent=le,me.rel="noopener nofollow";const Pe=ne.getAttribute("class");Pe&&(me.className=Pe),ne.replaceWith(me)}),Z.body.innerHTML}(V)).join(" | ");D!==this._attribHTML&&(this._attribHTML=D,v.length?(this._innerContainer.innerHTML=D,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")}}class F7{constructor(){o.aV(["_updateLogo","_updateCompact"],this)}onAdd(v){this._map=v,this._container=h("div","mapboxgl-ctrl");const E=h("a","mapboxgl-ctrl-logo");return E.target="_blank",E.rel="noopener nofollow",E.href="https://www.mapbox.com/",E.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),E.setAttribute("rel","noopener nofollow"),this._container.appendChild(E),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)}getDefaultPosition(){return"bottom-left"}_updateLogo(v){v&&"metadata"!==v.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")}_logoRequired(){if(!this._map.style)return true;const v=this._map.style._sourceCaches;if(0===Object.entries(v).length)return true;for(const E in v){const D=v[E].getSource();if(Object.hasOwn(D,"mapbox_logo")&&!D.mapbox_logo)return false}return true}_updateCompact(){const v=this._container.children;if(v.length){const E=v[0];this._map.getCanvasContainer().offsetWidth<250?E.classList.add("mapboxgl-compact"):E.classList.remove("mapboxgl-compact")}}}class Vse{constructor(){this._queue=[],this._id=0,this._cleared=false,this._currentlyRunning=false}add(v){const E=++this._id;return this._queue.push({callback:v,id:E,cancelled:false}),E}remove(v){const E=this._currentlyRunning,D=E?this._queue.concat(E):this._queue;for(const V of D)if(V.id===v)return void(V.cancelled=true)}run(v=0){const E=this._currentlyRunning=this._queue;this._queue=[];for(const D of E)if(!D.cancelled&&(D.callback(v),this._cleared))break;this._cleared=false,this._currentlyRunning=false}clear(){this._currentlyRunning&&(this._cleared=true),this._queue=[]}}class $se{constructor(v){this.jumpTo(v)}getValue(v){if(v<=this._startTime)return this._start;if(v>=this._endTime)return this._end;const E=o.dr((v-this._startTime)/(this._endTime-this._startTime));return this._start*(1-E)+this._end*E}isEasing(v){return v>=this._startTime&&v<=this._endTime}jumpTo(v){this._startTime=-1/0,this._endTime=-1/0,this._start=v,this._end=v}easeTo(v,E,D){this._start=this.getValue(E),this._end=v,this._startTime=E,this._endTime=E+D}}const c4={"AttributionControl.ToggleAttribution":"Toggle attribution","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox homepage","Map.Title":"Map","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScrollZoomBlocker.CtrlMessage":"Use ctrl + scroll to zoom the map","ScrollZoomBlocker.CmdMessage":"Use \u2318 + scroll to zoom the map","TouchPanBlocker.Message":"Use two fingers to move the map"};class Gse extends o.h{constructor(v,E,D,V){const{point:Y,lngLat:Z,originalEvent:ne,target:le}=v;super(v.type,{point:Y,lngLat:Z,originalEvent:ne,target:le}),this.preventDefault=()=>{v.preventDefault()},this.id=E,this.interaction=D,this.feature=V}}class bd{constructor(v){this.map=v,this.interactionsByType=new Map,this.delegatedInteractions=new Map,this.typeById=new Map,this.filters=new Map,this.handleType=this.handleType.bind(this),this.handleMove=this.handleMove.bind(this),this.handleOut=this.handleOut.bind(this),this.hoveredFeatures=new Map,this.prevHoveredFeatures=new Map}add(v,E){if(this.typeById.has(v))throw new Error(`Interaction id "${v}" already exists.`);const D=E.filter;let V=E.type;D&&this.filters.set(v,o.bv(D)),"mouseover"===V&&(V="mouseenter"),"mouseout"===V&&(V="mouseleave");const Y=this.interactionsByType.get(V)||new Map;"mouseenter"===V||"mouseleave"===V?(0===this.delegatedInteractions.size&&(this.map.on("mousemove",this.handleMove),this.map.on("mouseout",this.handleOut)),this.delegatedInteractions.set(v,E)):0===Y.size&&this.map.on(V,this.handleType),0===Y.size&&this.interactionsByType.set(V,Y),Y.set(v,E),this.typeById.set(v,V)}get(v){const E=this.typeById.get(v);if(!E)return;const D=this.interactionsByType.get(E);return D?D.get(v):void 0}remove(v){const E=this.typeById.get(v);if(!E)return;this.typeById.delete(v),this.filters.delete(v);const D=this.interactionsByType.get(E);D&&(D.delete(v),"mouseenter"===E||"mouseleave"===E?(this.delegatedInteractions.delete(v),0===this.delegatedInteractions.size&&(this.map.off("mousemove",this.handleMove),this.map.off("mouseout",this.handleOut))):0===D.size&&this.map.off(E,this.handleType))}queryTargets(v,E){const D=[];for(const[V,Y]of E)Y.target&&D.push({targetId:V,target:Y.target,filter:this.filters.get(V)});return this.map.style.queryRenderedTargets(v,D,this.map.transform)}handleMove(v){this.prevHoveredFeatures=this.hoveredFeatures,this.hoveredFeatures=new Map;const E=this.queryTargets(v.point,Array.from(this.delegatedInteractions).reverse());E.length&&(v.type="mouseenter",this.handleType(v,E));const D=new Map;for(const[V,{feature:Y}]of this.prevHoveredFeatures)this.hoveredFeatures.has(V)||D.set(Y.id,Y);D.size&&(v.type="mouseleave",this.handleType(v,Array.from(D.values())))}handleOut(v){const E=Array.from(this.hoveredFeatures.values()).map(({feature:D})=>D);E.length&&(v.type="mouseleave",this.handleType(v,E)),this.hoveredFeatures.clear()}handleType(v,E){const D="mouseenter"===v.type;if(D&&!this.interactionsByType.has(v.type))return void o.w("mouseenter interaction required for mouseleave to work.");const V=Array.from(this.interactionsByType.get(v.type)).reverse(),Y=!!E;E=E||this.queryTargets(v.point,V);let Z=false;const ne=new Set;for(const le of E){for(const[fe,me]of V){if(!me.target)continue;const Pe=le.variants?le.variants[fe]:null;if(Pe){for(const Re of Pe){if(Yae(Re,le,ne,fe))continue;const Ke=new o.dk(le,Re),ot=Wae(Re,le,fe);Y&&void 0!==Ke.id&&(Ke.state=this.map.getFeatureState(Ke));const at=D?this.prevHoveredFeatures.get(ot):null,xt=new Gse(v,fe,me,Ke),vt=at?at.stop:me.handler(xt);if(D&&this.hoveredFeatures.set(ot,{feature:le,stop:vt}),false!==vt){Z=true;break}}if(Z)break}}if(Z)break}if(!Z)for(const[le,fe]of V){const{handler:me,target:Pe}=fe;if(!Pe&&false!==me(new Gse(v,le,fe,null)))break}}}function fI(k,v){if(Array.isArray(k)&&Array.isArray(v)){const E=new Set(k),D=new Set(v);return E.size===D.size&&k.every(V=>D.has(V))}return o.O(k,v)}const Hse=/matrix.*\((.+)\)/,N7={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:85,interactive:true,scrollZoom:true,boxZoom:true,dragRotate:true,dragPan:true,keyboard:true,doubleClickZoom:true,touchZoomRotate:true,touchPitch:true,cooperativeGestures:false,performanceMetricsCollection:true,bearingSnap:7,clickTolerance:3,pitchWithRotate:true,hash:false,attributionControl:true,antialias:false,failIfMajorPerformanceCaveat:false,preserveDrawingBuffer:false,trackResize:true,renderWorldCopies:true,refreshExpiredTiles:true,minTileCacheSize:null,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,fontstackCompositing:"client",transformRequest:null,accessToken:null,fadeDuration:300,respectPrefersReducedMotion:true,crossSourceCollisions:true,collectResourceTiming:false,testMode:false,precompilePrograms:true,scaleFactor:1},O7={showCompass:true,showZoom:true,visualizePitch:false};class u4{constructor(v,E,D=false){this._clickTolerance=10,this.element=E,this.mouseRotate=new vq({clickTolerance:v.dragRotate._mouseRotate._clickTolerance}),this.map=v,D&&(this.mousePitch=new yA({clickTolerance:v.dragRotate._mousePitch._clickTolerance})),o.aV(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),E.addEventListener("mousedown",this.mousedown),E.addEventListener("touchstart",this.touchstart,{passive:false}),E.addEventListener("touchmove",this.touchmove),E.addEventListener("touchend",this.touchend),E.addEventListener("touchcancel",this.reset)}down(v,E){this.mouseRotate.mousedown(v,E),this.mousePitch&&this.mousePitch.mousedown(v,E),_()}move(v,E){const D=this.map,V=this.mouseRotate.mousemoveWindow(v,E),Y=V&&V.bearingDelta;if(Y&&D.setBearing(D.getBearing()+Y),this.mousePitch){const Z=this.mousePitch.mousemoveWindow(v,E),ne=Z&&Z.pitchDelta;ne&&D.setPitch(D.getPitch()+ne)}}off(){const v=this.element;v.removeEventListener("mousedown",this.mousedown),v.removeEventListener("touchstart",this.touchstart),v.removeEventListener("touchmove",this.touchmove),v.removeEventListener("touchend",this.touchend),v.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){C(),window.removeEventListener("mousemove",this.mousemove),window.removeEventListener("mouseup",this.mouseup)}mousedown(v){this.down({...v,button:v.button,type:v.type,ctrlKey:true,preventDefault:()=>v.preventDefault()},L(this.element,v)),window.addEventListener("mousemove",this.mousemove),window.addEventListener("mouseup",this.mouseup)}mousemove(v){this.move(v,L(this.element,v))}mouseup(v){this.mouseRotate.mouseupWindow(v),this.mousePitch&&this.mousePitch.mouseupWindow(v),this.offTemp()}touchstart(v){1!==v.targetTouches.length?this.reset():(this._startPos=this._lastPos=I(this.element,v.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:true,preventDefault:()=>v.preventDefault()},this._startPos))}touchmove(v){1!==v.targetTouches.length?this.reset():(this._lastPos=I(this.element,v.targetTouches)[0],this.move({buttons:1,preventDefault:()=>v.preventDefault()},this._lastPos))}touchend(v){0===v.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)E.width||v.y>E.height;E.locationPoint3D(D).distSqr(v)180;){const D=E.locationPoint3D(k);if(D.x>=0&&D.y>=0&&D.x<=E.width&&D.y<=E.height)break;k.lng>E.center.lng?k.lng-=360:k.lng+=360}return k}const B7={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"},d4=/\s+/,Rb={rotation:0,rotationAlignment:"auto",pitchAlignment:"auto",occludedOpacity:.2,altitude:0};class z7 extends o.E{constructor(v,E){super(),(v instanceof HTMLElement||E)&&(v={element:v,...E}),o.aV(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],this);const{anchor:D="center",color:V="#3FB1CE",scale:Y=1,draggable:Z=false,clickTolerance:ne=0,rotation:le=Rb.rotation,rotationAlignment:fe=Rb.rotationAlignment,pitchAlignment:me=Rb.pitchAlignment,occludedOpacity:Pe=Rb.occludedOpacity,altitude:Re=Rb.altitude}=v||{};this._anchor=D,this._color=V,this._scale=Y,this._draggable=Z,this._clickTolerance=ne,this._rotation=le,this._rotationAlignment=fe,this._pitchAlignment=me,this._occludedOpacity=Pe,this._altitude=Re,this._state="inactive",this._isDragging=false,this._pointerEvents=null,this._updateMoving=()=>this._update(true),v&&v.element?(this._element=v.element,this._offset=o.P.convert(v&&v.offset||[0,0])):(this._defaultMarker=true,this._element=this._createDefaultMarker(),this._offset=o.P.convert(v&&v.offset||[0,-14])),this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label","Map marker"),this._element.hasAttribute("role")||this._element.setAttribute("role","img"),this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",ot=>{ot.preventDefault()}),this._element.addEventListener("mousedown",ot=>{ot.preventDefault()});const Ke=this._element.classList;for(const ot in B7)Ke.remove(`mapboxgl-marker-anchor-${ot}`);Ke.add(`mapboxgl-marker-anchor-${this._anchor}`),v&&v.className&&Ke.add(...v.className.trim().split(d4)),this._popup=null}_createDefaultMarker(){const v=h("div"),E=m("svg",{display:"block",height:41*this._scale+"px",width:27*this._scale+"px",viewBox:"0 0 27 41"},v);this._svgElement=E;const D=m("radialGradient",{id:"shadowGradient"},m("defs",{},E));m("stop",{offset:"10%","stop-opacity":.4},D),m("stop",{offset:"100%","stop-opacity":.05},D);const V=m("ellipse",{cx:13.5,cy:34.8,rx:10.5,ry:5.25,fill:"url(#shadowGradient)"});return this._shadowElement=V,0===this._altitude&&E.insertBefore(V,E.firstChild),m("path",{fill:this._color,d:"M27,13.5C27,19.07 20.25,27 14.75,34.5C14.02,35.5 12.98,35.5 12.25,34.5C6.75,27 0,19.22 0,13.5C0,6.04 6.04,0 13.5,0C20.96,0 27,6.04 27,13.5Z"},E),m("path",{opacity:.25,d:"M13.5,0C6.04,0 0,6.04 0,13.5C0,19.22 6.75,27 12.25,34.5C13,35.52 14.02,35.5 14.75,34.5C20.25,27 27,19.07 27,13.5C27,6.04 20.96,0 13.5,0ZM13.5,1C20.42,1 26,6.58 26,13.5C26,15.9 24.5,19.18 22.22,22.74C19.95,26.3 16.71,30.14 13.94,33.91C13.74,34.18 13.61,34.32 13.5,34.44C13.39,34.32 13.26,34.18 13.06,33.91C10.28,30.13 7.41,26.31 5.02,22.77C2.62,19.23 1,15.95 1,13.5C1,6.58 6.58,1 13.5,1Z"},E),m("circle",{fill:"white",cx:13.5,cy:13.5,r:5.5},E),v}addTo(v){return v===this._map||(this.remove(),this._map=v,v.getCanvasContainer().appendChild(this._element),v.on("move",this._updateMoving),v.on("moveend",this._update),v.on("remove",this._clearFadeTimer),v._addMarker(this),this.setDraggable(this._draggable),this._update(),v.on("click",this._onMapClick)),this}remove(){const v=this._map;return v&&(v.off("click",this._onMapClick),v.off("move",this._updateMoving),v.off("moveend",this._update),v.off("mousedown",this._addDragHandler),v.off("touchstart",this._addDragHandler),v.off("mouseup",this._onUp),v.off("touchend",this._onUp),v.off("mousemove",this._onMove),v.off("touchmove",this._onMove),v.off("remove",this._clearFadeTimer),v._removeMarker(this),this._map=void 0),this._clearFadeTimer(),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(v){return this._lngLat=o.cz.convert(v),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(true),this}setAltitude(v){if(v===this._altitude)return this;const E=this._altitude;return this._altitude=v||Rb.altitude,this._defaultMarker&&0===E!=(0===this._altitude)&&(0===this._altitude?this._svgElement.insertBefore(this._shadowElement,this._svgElement.firstChild):this._shadowElement.remove()),this._update(),this}getAltitude(){return this._altitude}getElement(){return this._element}setPopup(v){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeAttribute("role"),this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),v){if(!("offset"in v.options)){const E=38.1,D=13.5,V=Math.sqrt(Math.pow(D,2)/2);v.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-E],"bottom-left":[V,-1*(E-D+V)],"bottom-right":[-V,-1*(E-D+V)],left:[D,-1*(E-D)],right:[-D,-1*(E-D)]}:this._offset}this._popup=v,v._marker=this,v._altitude=this._altitude,this._lngLat&&this._popup.setLngLat(this._lngLat),this._element.setAttribute("role","button"),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress),this._element.setAttribute("aria-expanded","false")}return this}_onKeyPress(v){const E=v.code,D=v.charCode||v.keyCode;"Space"!==E&&"Enter"!==E&&32!==D&&13!==D||this.togglePopup()}_onMapClick(v){const E=v.originalEvent.target,D=this._element;this._popup&&(E===D||D.contains(E))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const v=this._popup;return v?(v.isOpen()?(v.remove(),this._element.setAttribute("aria-expanded","false")):this._map&&(v.addTo(this._map),this._element.setAttribute("aria-expanded","true")),this):this}_behindTerrain(){const v=this._map,E=this._pos;if(!v||!E)return false;const D=v.unproject(E,this._altitude),V=v.getFreeCameraOptions();if(!V.position)return false;const Y=V.position.toLngLat();return Y.distanceTo(D)<.9*Y.distanceTo(this._lngLat)}_evaluateOpacity(){const v=this._map;if(!v)return;const E=this._pos;if(!E||E.x<0||E.x>v.transform.width||E.y<0||E.y>v.transform.height)return void this._clearFadeTimer();const D=v.unproject(E,this._altitude);let V;v._showingGlobe()&&o.f2(v.transform,this._lngLat)?V=0:(V=1-v._queryFogOpacity(D),v.transform._terrainEnabled()&&v.style&&v.style.hasTerrain()&&this._behindTerrain()&&(V*=this._occludedOpacity)),this._element.style.opacity=`${V}`;const Y=this._element.style.pointerEvents;(null===this._pointerEvents?""===Y:Y===this._pointerEvents)&&(this._pointerEvents=V>0?"auto":"none",this._element.style.pointerEvents=this._pointerEvents),this._popup&&this._popup._setOpacity(V),this._fadeTimer=null}_clearFadeTimer(){this._fadeTimer&&(clearTimeout(this._fadeTimer),this._fadeTimer=null)}_updateDOM(){const v=this._pos;if(!v||!this._map)return;const E=this._offset.mult(this._scale);this._element.style.transform=` + translate(${v.x}px,${v.y}px) + ${B7[this._anchor]} + ${this._calculateXYTransform()} ${this._calculateZTransform()} + translate(${E.x}px,${E.y}px) + `}_calculateXYTransform(){const v=this._pos,E=this._map,D=this.getPitchAlignment();if(!E||!v||"map"!==D)return"";if(!E._showingGlobe()){const le=E.getPitch();return le?`rotateX(${le}deg)`:""}const V=o.f3(o.f4(E.transform,this._lngLat)),Y=v.sub(o.f5(E.transform)),Z=Math.abs(Y.x)+Math.abs(Y.y);if(0===Z)return"";const ne=V/Z;return`rotateX(${-Y.y*ne}deg) rotateY(${Y.x*ne}deg)`}_calculateZTransform(){const v=this._pos,E=this._map;if(!E||!v)return"";let D=0;const V=this.getRotationAlignment();if("map"===V)if(E._showingGlobe()){const Y=E.project(new o.cz(this._lngLat.lng,this._lngLat.lat+.001),this._altitude),Z=E.project(new o.cz(this._lngLat.lng,this._lngLat.lat-.001),this._altitude).sub(Y);D=o.f3(Math.atan2(Z.y,Z.x))-90}else D=-E.getBearing();else if("horizon"===V){const Y=o.am(4,6,E.getZoom()),Z=o.f5(E.transform);Z.y+=Y*E.transform.height;const ne=v.sub(Z),le=o.f3(Math.atan2(ne.y,ne.x));D=(le>90?le-270:le+90)*(1-Y)}return D+=this._rotation,D?`rotateZ(${D}deg)`:""}_update(v){cancelAnimationFrame(this._updateFrameId);const E=this._map;E&&(E.transform.renderWorldCopies&&(this._lngLat=Cq(this._lngLat,this._pos,E.transform)),this._pos=E.project(this._lngLat,this._altitude),true===v?this._updateFrameId=requestAnimationFrame(()=>{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM())}):this._pos=this._pos.round(),E._requestDomTask(()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),(E._showingGlobe()||E.style&&E.style.hasTerrain()||E.getFog())&&!this._fadeTimer&&(this._fadeTimer=window.setTimeout(this._evaluateOpacity.bind(this),60)))}))}getOffset(){return this._offset}setOffset(v){return this._offset=o.P.convert(v),this._update(),this}addClassName(v){return this._element.classList.add(v),this}removeClassName(v){return this._element.classList.remove(v),this}toggleClassName(v){return this._element.classList.toggle(v)}_onMove(v){const E=this._map;if(!E)return;const D=this._pointerdownPos,V=this._positionDelta;if(D&&V){if(!this._isDragging){const Y=this._clickTolerance||E._clickTolerance;if(v.point.dist(D)`mapboxgl-ctrl-geolocate-${k}`,om=["waiting","active","active-error","background","background-error"].map(hI),Pb={positionOptions:{enableHighAccuracy:false,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:false,showAccuracyCircle:true,showUserLocation:true,showUserHeading:false,showButton:true,followUserLocation:true},Aq={maxWidth:100,unit:"metric"},Ib={kilometer:"km",meter:"m",mile:"mi",foot:"ft","nautical-mile":"nm"},Mb=/\s+/,pI={closeButton:true,closeOnClick:true,focusAfterOpen:true,className:"",maxWidth:"240px",altitude:0},bA=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function xA(k=new o.P(0,0),v="bottom"){if("number"==typeof k){const E=Math.round(Math.sqrt(.5*Math.pow(k,2)));switch(v){case"top":return new o.P(0,k);case"top-left":return new o.P(E,E);case"top-right":return new o.P(-E,E);case"bottom":return new o.P(0,-k);case"bottom-left":return new o.P(E,-E);case"bottom-right":return new o.P(-E,-E);case"left":return new o.P(k,0);case"right":return new o.P(-k,0)}return new o.P(0,0)}return k instanceof o.P||Array.isArray(k)?o.P.convert(k):o.P.convert(k[v]||[0,0])}const f4="undefined"!=typeof document?document.currentScript:null;o.f6(f4&&f4.src&&o.f7(f4.src)?"cdn":"other");const Ea={version:o.f1,supported:function(k){return!function(v){return"undefined"!=typeof window&&"undefined"!=typeof document?Object.hasOwn?function(){const E=document.createElement("canvas");E.width=E.height=1;const D=E.getContext("2d");return!!D&&D.getImageData(0,0,1,1).width===E.width}()?function(E){return E?(void 0===l&&(l=u(true)),l):(void 0===s&&(s=u(false)),s)}(v)?"":"insufficient WebGL2 support":"insufficient Canvas/getImageData support":"Object.hasOwn not supported":"not a browser"}(k)},setRTLTextPlugin:o.fc,getRTLTextPluginStatus:o.fb,setSdkInfo:o.fa,addTileProvider:o.f9,Map:class extends $Oe{constructor(k){o.eM.mark(o.eN.create);const v=k;if(null!=(k={...N7,...k}).minZoom&&null!=k.maxZoom&&k.minZoom>k.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=k.minPitch&&null!=k.maxPitch&&k.minPitch>k.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=k.minPitch&&k.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=k.maxPitch&&k.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");super(new o.eO(k.minZoom,k.maxZoom,k.minPitch,k.maxPitch,k.renderWorldCopies,null,null),k),this._repaint=!!k.repaint,this._interactive=k.interactive,this._minTileCacheSize=k.minTileCacheSize,this._maxTileCacheSize=k.maxTileCacheSize,this._failIfMajorPerformanceCaveat=k.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=k.preserveDrawingBuffer,this._antialias=k.antialias,this._trackResize=k.trackResize,this._bearingSnap=k.bearingSnap,this._refreshExpiredTiles=k.refreshExpiredTiles,this._fadeDuration=k.fadeDuration,this._placementAlgorithm=k.placementAlgorithm||"default",this._isInitialLoad=true,this._crossSourceCollisions=k.crossSourceCollisions,this._collectResourceTiming=k.collectResourceTiming,this._language=this._parseLanguage(k.language),this._worldview=k.worldview,this._renderTaskQueue=new Vse,this._domRenderTaskQueue=new Vse,this._controls=[],this._markers=[],this._popups=[],this._mapId=o.av(),this._locale={...c4,...k.locale},this._clickTolerance=k.clickTolerance,this._cooperativeGestures=k.cooperativeGestures,this._performanceMetricsCollection=k.performanceMetricsCollection,this._tessellationStep=k.tessellationStep,this._containerWidth=0,this._containerHeight=0,this._showParseStatus=true,this._precompilePrograms=k.precompilePrograms,this._averageElevationLastSampledAt=-1/0,this._averageElevationExaggeration=0,this._averageElevation=new $se(0),this._interactionRange=[1/0,-1/0],this._visibilityHidden=0,this._useExplicitProjection=false,this._frameId=0,this._scaleFactor=k.scaleFactor,this._requestManager=new o.eP(k.transformRequest,k.accessToken,k.testMode);const E=o.eQ(k.accessToken||o.eL.ACCESS_TOKEN);if(E&&"atlas"in E&&"number"==typeof E.atlas&&(this._tokenExpiration=E.atlas),this._silenceAuthErrors=!!k.testMode,this._contextCreateOptions=k.contextCreateOptions?{...k.contextCreateOptions}:{},"string"==typeof k.container){const D=document.getElementById(k.container);if(!D)throw new Error(`Container '${k.container.toString()}' not found.`);this._container=D}else{if(!(k.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=k.container}if(this._container.childNodes.length>0&&o.w("The map container element should be empty, otherwise the map's interactivity will be negatively impacted. If you want to display a message when WebGL is not supported, use the Mapbox GL Supported plugin instead."),k.maxBounds&&this.setMaxBounds(k.maxBounds),this._spriteFormat="auto",o.aV(["_onWindowOnline","_onWindowResize","_onVisibilityChange","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");if(this.on("move",()=>this._update(false)),this.on("moveend",()=>this._update(false)),this.on("zoom",()=>this._update(true)),this._fullscreenchangeEvent="onfullscreenchange"in document?"fullscreenchange":"webkitfullscreenchange",window.addEventListener("online",this._onWindowOnline,false),window.addEventListener("resize",this._onWindowResize,false),window.addEventListener("orientationchange",this._onWindowResize,false),window.addEventListener(this._fullscreenchangeEvent,this._onWindowResize,false),window.addEventListener("visibilitychange",this._onVisibilityChange,false),this.handlers=new VOe(this,k),this._localFontFamily=k.localFontFamily,this._localIdeographFontFamily=k.localIdeographFontFamily,this._fontstackCompositing=k.fontstackCompositing,(k.style||!k.testMode)&&this.setStyle(k.style||o.eL.DEFAULT_STYLE,{config:k.config,localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily,fontstackCompositing:this._fontstackCompositing}),k.projection&&this.setProjection(k.projection),k.hash&&(this._hash=new F2("string"==typeof k.hash&&k.hash||void 0).addTo(this)),!this._hash||!this._hash._onHashChange()){null==v.center&&null==v.zoom||(this.transform._unmodified=false),this.jumpTo({center:k.center,zoom:k.zoom,bearing:k.bearing,pitch:k.pitch});const D=k.bounds;D&&(this.resize(),this.fitBounds(D,{...k.fitBoundsOptions,duration:0}))}this.resize(),k.attributionControl&&this.addControl(new Use({customAttribution:k.customAttribution})),this._logoControl=new F7,this.addControl(this._logoControl,k.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this._postStyleLoadEvent(),this._postStyleWithAppearanceEvent()}),this.on("data",D=>{this._update("style"===D.dataType),this.fire(new o.h(`${D.dataType}data`,D))}),this.on("dataloading",D=>{this.fire(new o.h(`${D.dataType}dataloading`,D))}),this._interactions=new bd(this)}_getMapId(){return this._mapId}addControl(k,v){if(void 0===v&&(v=k.getDefaultPosition?k.getDefaultPosition():"top-right"),!k||!k.onAdd)return this.fire(new o.f(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const E=k.onAdd(this);this._controls.push(k);const D=this._controlPositions[v];return v.includes("bottom")?D.insertBefore(E,D.firstChild):D.appendChild(E),this}removeControl(k){if(!k||!k.onRemove)return this.fire(new o.f(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const v=this._controls.indexOf(k);return v>-1&&this._controls.splice(v,1),k.onRemove(this),this}hasControl(k){return this._controls.includes(k)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}resize(k){if(this._updateContainerDimensions(),this._containerWidth===this.transform.width&&this._containerHeight===this.transform.height)return this;this._resizeCanvas(this._containerWidth,this._containerHeight),this.transform.resize(this._containerWidth,this._containerHeight),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight));const v=!this._moving;return v&&this.fire(new o.h("movestart",k)).fire(new o.h("move",k)),this.fire(new o.h("resize",k)),v&&this.fire(new o.h("moveend",k)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(k){return this.transform.setMaxBounds(o.eB.convert(k)),this._update()}setMinZoom(k){if((k=k??-2)>=-2&&k<=this.transform.maxZoom)return this.transform.minZoom=k,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=k,this._update(),this.getZoom()>k?this.setZoom(k):this.fire(new o.h("zoomstart")).fire(new o.h("zoom")).fire(new o.h("zoomend")),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(k){if((k=k??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(k>=0&&k<=this.transform.maxPitch)return this.transform.minPitch=k,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(k>=this.transform.minPitch)return this.transform.maxPitch=k,this._update(),this.getPitch()>k?this.setPitch(k):this.fire(new o.h("pitchstart")).fire(new o.h("pitch")).fire(new o.h("pitchend")),this;throw new Error("maxPitch must be greater than or equal to minPitch")}getMaxPitch(){return this.transform.maxPitch}getScaleFactor(){return this._scaleFactor}setScaleFactor(k){return this._scaleFactor=k,this.painter.scaleFactor=k,this.style&&this.style._setLabelPlacementStale(),this.style._updateFilteredLayers(v=>"symbol"===v.type),this._update(true),this}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(k){return this.transform.renderWorldCopies=k,this.transform.renderWorldCopies||this._forceMarkerAndPopupUpdate(true),this._update()}getLanguage(){return this._language}_parseLanguage(k){return"auto"===k?navigator.language:Array.isArray(k)?0===k.length?void 0:k.map(v=>"auto"===v?navigator.language:v):k}setLanguage(k){const v=this._parseLanguage(k);if(!this.style||v===this._language)return this;this._language=v,this.style.reloadSources();for(const E of this._controls)E._setLanguage&&E._setLanguage(this._language);return this}getWorldview(){return this._worldview}setWorldview(k){return this.style&&k!==this._worldview?(this._worldview=k,this._styleDirty=true,this.style.setWorldview(k),this):this}getProjection(){return this.transform.mercatorFromTransition?{name:"globe",center:[0,0]}:this.transform.getProjection()}_showingGlobe(){return"globe"===this.transform.projection.name}setProjection(k){return this._lazyInitEmptyStyle(),k?"string"==typeof k&&(k={name:k}):k=null,this._useExplicitProjection=!!k,this._prioritizeAndUpdateProjection(k,this.style.projection)}_updateProjectionTransition(){if("globe"!==this.getProjection().name)return;const k=this.transform,v=k.projection.name;let E;"globe"===v&&k.zoom>=o.b1?(k.setMercatorFromTransition(),E=true):"mercator"===v&&k.zoom=o.b1?this.transform.setMercatorFromTransition():this.transform.setProjection(k),this.style.applyProjectionUpdate();const D="mercator"===this.transform.getProjection().name&&E!==this.transform.mercatorFromTransition;return(v||D)&&(this.painter.clearBackgroundTiles(),this.style.clearSources(),this._update(true),this._forceMarkerAndPopupUpdate(true)),this}project(k,v){return this.transform.locationPoint3D(o.cz.convert(k),v)}unproject(k,v){return this.transform.pointLocation3D(o.P.convert(k),v)}isMoving(){return this._moving||this.handlers&&this.handlers.isMoving()||false}isZooming(){return this._zooming||this.handlers&&this.handlers.isZooming()||false}isRotating(){return this._rotating||this.handlers&&this.handlers.isRotating()||false}_isDragging(){return this.handlers&&this.handlers._isDragging()||false}_createDelegatedListener(k,v,E){const D=V=>{let Y=[];if(Array.isArray(v)){const Z=v.filter(ne=>this.getLayer(ne));Y=Z.length?this.queryRenderedFeatures(V,{layers:Z}):[]}else Y=this.queryRenderedFeatures(V,{target:v});return Y};if("mouseenter"===k||"mouseover"===k){let V=false;const Y=Z=>{const ne=D(Z.point);ne.length?V||(V=true,E.call(this,new uy(k,this,Z.originalEvent,{features:ne}))):V=false};return{listener:E,targets:v,delegates:{mousemove:Y,mouseout:()=>{V=false}}}}if("mouseleave"===k||"mouseout"===k){let V=false;const Y=ne=>{D(ne.point).length?V=true:V&&(V=false,E.call(this,new uy(k,this,ne.originalEvent)))},Z=ne=>{V&&(V=false,E.call(this,new uy(k,this,ne.originalEvent)))};return{listener:E,targets:v,delegates:{mousemove:Y,mouseout:Z}}}{const V=Y=>{const Z=D(Y.point);Z.length&&(Y.features=Z,E.call(this,Y),delete Y.features)};return{listener:E,targets:v,delegates:{[k]:V}}}}on(k,v,E){if("function"==typeof v||void 0===E)return super.on(k,v);if("string"==typeof v&&(v=[v]),!this._areTargetsValid(v))return this;const D=this._createDelegatedListener(k,v,E);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[k]=this._delegatedListeners[k]||[],this._delegatedListeners[k].push(D);for(const V in D.delegates)this.on(V,D.delegates[V]);return this}once(k,v,E){if("function"==typeof v||void 0===E)return super.once(k,v);if("string"==typeof v&&(v=[v]),!this._areTargetsValid(v))return this;const D=this._createDelegatedListener(k,v,E);for(const V in D.delegates)this.once(V,D.delegates[V]);return this}off(k,v,E){if("function"==typeof v||void 0===E)return super.off(k,v);if("string"==typeof v&&(v=[v]),!this._areTargetsValid(v))return this;const D=this._delegatedListeners?this._delegatedListeners[k]:void 0;return D&&(V=>{for(let Y=0;Y{if(E){const V="string"==typeof E?E:E instanceof Error?E.message:E.error;o.w(`Unable to perform style diff: ${V}. Rebuilding the style from scratch.`),this._updateStyle(k,v)}else D&&this._update(true)},()=>this._postStyleLoadEvent()),this):(this._localIdeographFontFamily=v.localIdeographFontFamily,this._localFontFamily=v.localFontFamily,this._fontstackCompositing=v.fontstackCompositing,this._updateStyle(k,v))}_getUIString(k){const v=this._locale[k];if(null==v)throw new Error(`Missing UI string '${k}'`);return v}_updateStyle(k,v){if(this.style&&(this.style.setEventedParent(null),this.style._remove(),this.style=void 0),k){const E={...v};v&&v.config&&(E.initialConfig=v.config,delete E.config),this.style=new I2(this,E).load(k),this.style.setEventedParent(this,{style:this.style})}return this._updateTerrain(),this}_lazyInitEmptyStyle(){this.style||(this.style=new I2(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():(o.w("There is no style added to the map."),false)}_isValidId(k){return null==k?(this.fire(new o.f(new Error("IDs can't be empty."))),false):o.df(k)?(this.fire(new o.f(new Error(`IDs can't contain special symbols: "${k}".`))),false):"__proto__"!==k&&"constructor"!==k&&"prototype"!==k||(this.fire(new o.f(new Error(`IDs can't be "${k}".`))),false)}_isTargetValid(k){return"featuresetId"in k?this._isValidId("importId"in k?k.importId:k.featuresetId):"layerId"in k&&this._isValidId(k.layerId)}_areTargetsValid(k){if(Array.isArray(k)){for(const v of k)if(!this._isValidId(v))return false;return true}return this._isTargetValid(k)}addSource(k,v){return this._isValidId(k)?(this._lazyInitEmptyStyle(),this.style.addSource(k,v),this._update(true)):this}isSourceLoaded(k){return!!this._isValidId(k)&&!!this.style&&this.style._isSourceCacheLoaded(k)}areTilesLoaded(){return this.style.areTilesLoaded()}removeSource(k){return this._isValidId(k)?(this.style.removeSource(k),this._updateTerrain(),this._update(true)):this}getSource(k){return this._isValidId(k)?this.style.getOwnSource(k):null}addImage(k,v,{pixelRatio:E=1,sdf:D=false,stretchX:V,stretchY:Y,content:Z}={}){this._lazyInitEmptyStyle();const ne=o.I.from(k);if(v instanceof HTMLImageElement||ImageBitmap&&v instanceof ImageBitmap){const{width:le,height:fe,data:me}=o.e.getImageData(v);this.style.addImage(ne,{data:new o.b({width:le,height:fe},me),pixelRatio:E,stretchX:V,stretchY:Y,content:Z,sdf:D,version:0,usvg:false})}else if(void 0===v.width||void 0===v.height)this.fire(new o.f(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));else{const{width:le,height:fe}=v,me=v;this.style.addImage(ne,{data:new o.b({width:le,height:fe},new Uint8Array(me.data)),pixelRatio:E,stretchX:V,stretchY:Y,content:Z,sdf:D,usvg:false,version:0,userImage:me}),me.onAdd&&me.onAdd(this,k)}}updateImage(k,v){this._lazyInitEmptyStyle();const E=o.I.from(k),D=this.style.getImage(E);if(!D)return void this.fire(new o.f(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const V=v instanceof HTMLImageElement||ImageBitmap&&v instanceof ImageBitmap?o.e.getImageData(v):v,{width:Y,height:Z,data:ne}=V;if(void 0===Y||void 0===Z)return void this.fire(new o.f(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(Y!==(D.usvg?D.icon.usvg_tree.width:D.data.width)||Z!==(D.usvg?D.icon.usvg_tree.height:D.data.height))return void this.fire(new o.f(new Error(`The width and height of the updated image (${Y}, ${Z}) + must be that same as the previous version of the image + (${D.data.width}, ${D.data.height})`)));const le=!(v instanceof HTMLImageElement||ImageBitmap&&v instanceof ImageBitmap);let fe=false;D.usvg?(D.data=new o.b({width:Y,height:Z},new Uint8Array(ne)),D.usvg=false,D.icon=void 0,fe=true):D.data.replace(ne,le),this.style.updateImage(E,D,fe)}hasImage(k){return k?!!this.style&&!!this.style.getImage(o.I.from(k)):(this.fire(new o.f(new Error("Missing required image id"))),false)}removeImage(k){this.style.removeImage(o.I.from(k))}loadImage(k,v){(async()=>{const E=await this._requestManager.transformRequest(k,o.R.Image),{data:D}=await o.a(E);return D})().then(E=>v(null,E)).catch(v)}listImages(){return this.style.listImages().map(k=>k.name)}addModel(k,v){this._lazyInitEmptyStyle(),this.style.addModel(k,v)}hasModel(k){return k?this.style.hasModel(k):(this.fire(new o.f(new Error("Missing required model id"))),false)}removeModel(k){this.style.removeModel(k)}listModels(){return this.style.listModels()}addLayer(k,v){return this._isValidId(k.id)?(this._lazyInitEmptyStyle(),this.style.addLayer(k,v),this._update(true)):this}getSlot(k){const v=this.getLayer(k);return v&&v.slot||null}setSlot(k,v){return this.style.setSlot(k,v),this.style.mergeLayers(),this._update(true)}addImport(k,v){return this._isValidId(k.id)?(this.style.addImport(k,v).catch(E=>this.fire(new o.f(new Error("Failed to add import",E)))),this):this}updateImport(k,v){return"string"!=typeof v&&v.id!==k?(this.removeImport(k),this.addImport(v)):(this.style.updateImport(k,v),this._update(true))}removeImport(k){return this.style.removeImport(k),this}moveImport(k,v){return this.style.moveImport(k,v),this._update(true)}moveLayer(k,v){return this._isValidId(k)?(this.style.moveLayer(k,v),this._update(true)):this}removeLayer(k){return this._isValidId(k)?(this.style.removeLayer(k),this._update(true)):this}getLayer(k){if(!this._isValidId(k))return null;const v=this.style.getOwnLayer(k);return v?"custom"===v.type?v.implementation:v.serialize():void 0}getSlots(){return this.style.getSlots()}setLayerZoomRange(k,v,E){return this._isValidId(k)?(this.style.setLayerZoomRange(k,v,E),this._update(true)):this}setFilter(k,v,E={}){return this._isValidId(k)?(this.style.setFilter(k,v,E),this._update(true)):this}getFilter(k){return this._isValidId(k)?this.style.getFilter(k):null}setPaintProperty(k,v,E,D={}){return this._isValidId(k)?(this.style.setPaintProperty(k,v,E,D),this._update(true)):this}getPaintProperty(k,v){return this._isValidId(k)?this.style.getPaintProperty(k,v):null}setLayoutProperty(k,v,E,D={}){return this._isValidId(k)?(this.style.setLayoutProperty(k,v,E,D),this._update(true)):this}getLayoutProperty(k,v){return this._isValidId(k)?this.style.getLayoutProperty(k,v):null}getLayerProperty(k,v){return this._isValidId(k)?this.style.getLayerProperty(k,v):null}setLayerProperty(k,v,E,D={}){return this._isValidId(k)?("appearances"===v&&this._postAddingAppearancesToStyleEvent(),this.style.setLayerProperty(k,v,E,D),this._update(true)):this}getGlyphsUrl(){return this.style.getGlyphsUrl()}setGlyphsUrl(k){return this.style.setGlyphsUrl(k),this._update(true)}getSchema(k){return this.style.getSchema(k)}setSchema(k,v){return this.style.setSchema(k,v),this._update(true)}getConfig(k){return this.style.getConfig(k)}setConfig(k,v){return this.style.setConfig(k,v),this._update(true)}getConfigProperty(k,v){return this.style.getConfigProperty(k,v)}setConfigProperty(k,v,E){return this.style.setConfigProperty(k,v,E),this._update(true)}getFeaturesetDescriptors(k){return this.style.getFeaturesetDescriptors(k)}setLights(k){if(this._lazyInitEmptyStyle(),k&&1===k.length&&"flat"===k[0].type){const v=k[0];v.properties?this.style.setFlatLight(v.properties,v.id,{}):this.style.setFlatLight({},"flat")}else this.style.setLights(k),this.painter.terrain&&(this.painter.terrain.invalidateRenderCache=true);return this._update(true)}getLights(){const k=this.style.getLights()||[];return 0===k.length&&k.push({id:this.style.light.id,type:"flat",properties:this.style.getFlatLight()}),k}setLight(k,v={}){return console.log("The `map.setLight` function is deprecated, prefer using `map.setLights` with `flat` light type instead."),this.setLights([{id:"flat",type:"flat",properties:k}])}getLight(){return console.log("The `map.getLight` function is deprecated, prefer using `map.getLights` instead."),this.style.getFlatLight()}setTerrain(k){return this._lazyInitEmptyStyle(),!k&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(k),this._averageElevationLastSampledAt=-1/0,this._update(true)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(k){return this._lazyInitEmptyStyle(),this.style.setFog(k),this._update(true)}getFog(){return this.style?this.style.getFog():null}setSnow(k){return this._lazyInitEmptyStyle(),this.style.setSnow(k),this._update(true)}getSnow(){return this.style?this.style.getSnow():null}setRain(k){return this._lazyInitEmptyStyle(),this.style.setRain(k),this._update(true)}getRain(){return this.style?this.style.getRain():null}setColorTheme(k){return this._lazyInitEmptyStyle(),this.style.setColorTheme(k),this._update(true)}setImportColorTheme(k,v){return this._lazyInitEmptyStyle(),this.style.setImportColorTheme(k,v),this._update(true)}setCamera(k){return this.style.setCamera(k),this._triggerCameraUpdate(k)}getNearClipOffset(){return this.transform.nearClipOffset}setNearClipOffset(k){const v=this.transform.nearClipOffset!==k;return this.transform.nearClipOffset=k,this._update(v)}_triggerCameraUpdate(k){return this._update(this.transform.setOrthographicProjectionAtLowPitch("orthographic"===k["camera-projection"]))}getCamera(){return this.style.camera}_queryFogOpacity(k){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(o.cz.convert(k),this.transform):0}setFeatureState(k,v){return k.source&&!this._isValidId(k.source)?this:(this.style.setFeatureState(k,v),this._update())}removeFeatureState(k,v){return k.source&&!this._isValidId(k.source)?this:(this.style.removeFeatureState(k,v),this._update())}getFeatureState(k){return k.source&&!this._isValidId(k.source)?null:this.style.getFeatureState(k)}resetFeatureStates(k){return this.style.resetFeatureStates(k),this._update()}_selectIndoorFloor(k){this.style.indoorManager&&this.style.indoorManager.selectFloor(k)}_setIndoorActiveFloorsVisibility(k){this.style.indoorManager&&this.style.indoorManager.setActiveFloorsVisibility(k)}getIndoorTileOptions(k,v){return this.style&&this.style.isIndoorEnabled()&&this.style.indoorManager?this.style.indoorManager.getIndoorTileOptions(k,v):null}_updateContainerDimensions(){if(!this._container)return;const k=this._container.getBoundingClientRect().width||400,v=this._container.getBoundingClientRect().height||300;let E,D,V,Y=this._container;for(;Y&&(!D||!V);){const Z=window.getComputedStyle(Y).transform;Z&&"none"!==Z&&(E=Z.match(Hse)[1].split(", "),E[0]&&"0"!==E[0]&&"1"!==E[0]&&(D=E[0]),E[3]&&"0"!==E[3]&&"1"!==E[3]&&(V=E[3])),Y=Y.parentElement}this._containerWidth=D?Math.abs(k/D):k,this._containerHeight=V?Math.abs(v/V):v}_detectMissingCSS(){"rgb(250, 128, 114)"!==window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&o.w("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")}_setupContainer(){const k=this._container;k.classList.add("mapboxgl-map"),(this._missingCSSCanary=h("div","mapboxgl-canary",k)).style.visibility="hidden",this._detectMissingCSS();const v=this._canvasContainer=h("div","mapboxgl-canvas-container",k);this._canvas=h("canvas","mapboxgl-canvas",v),this._interactive&&(v.classList.add("mapboxgl-interactive"),this._canvas.setAttribute("tabindex","0")),this._canvas.addEventListener("webglcontextlost",this._contextLost,false),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,false),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);const E=this._controlContainer=h("div","mapboxgl-control-container",k),D=this._controlPositions={};["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"].forEach(V=>{D[V]=h("div",`mapboxgl-ctrl-${V}`,E)}),this._container.addEventListener("scroll",this._onMapScroll,false)}_resizeCanvas(k,v){const E=o.e.devicePixelRatio||1;this._canvas.width=E*Math.ceil(k),this._canvas.height=E*Math.ceil(v),this._canvas.style.width=`${k}px`,this._canvas.style.height=`${v}px`}_addMarker(k){this._markers.push(k)}_removeMarker(k){const v=this._markers.indexOf(k);-1!==v&&this._markers.splice(v,1)}_addPopup(k){this._popups.push(k)}_removePopup(k){const v=this._popups.indexOf(k);-1!==v&&this._popups.splice(v,1)}_setupPainter(){const k={...a,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||false},v=this._canvas.getContext("webgl2",k);v?(o.eR(v,true),this.painter=new cy(v,this._contextCreateOptions,this.transform,this._scaleFactor,this._worldview),this.on("data",E=>{if("source"===E.dataType){const D=this.transform.elevation?this.transform.elevation._source():null;D&&E.sourceCacheId===D.id&&this.style&&this.style._setLabelPlacementStale(),this.style&&E.sourceCacheId&&this.style._buildingIndex.hasLayerForSourceCache(E.sourceCacheId)&&this.style._requestFullLabelPlacement(),this.painter.setTileLoadedFlag(true)}})):this.fire(new o.f(new Error("Failed to initialize WebGL")))}_contextLost(k){k.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.style&&this.style.handleContextLost(),this.fire(new o.h("webglcontextlost",{originalEvent:k}))}_contextRestored(k){this._setupPainter(),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight)),this._updateTerrain(),this.style&&(this.style.clearLayers(),this.style.imageManager.destroyAtlasTextures(),this.style.imageManager.imageAtlasCache.destroyTextures(),this.style.reloadModels(),this.style.clearSources()),this._update(),this.fire(new o.h("webglcontextrestored",{originalEvent:k}))}_onMapScroll(k){if(k.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,false}idle(){return!this.isMoving()&&this.loaded()}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}frameReady(){return this.loaded()&&!this._placementDirty}_update(k){return this.style?(this._styleDirty=this._styleDirty||k,this._sourcesDirty=true,this.triggerRepaint(),this):this}_requestRenderFrame(k){return this._update(),this._renderTaskQueue.add(k)}_cancelRenderFrame(k){this._renderTaskQueue.remove(k)}_requestDomTask(k){!this.loaded()||this.loaded()&&!this.isMoving()?k():this._domRenderTaskQueue.add(k)}_render(k){let v;this.fire(new o.h("renderstart")),++this._frameId;const E=this.painter.context.extTimerQuery,D=o.e.now(),V=this.painter.context.gl;if(this.listens("gpu-timing-frame")&&(v=V.createQuery(),V.beginQuery(E.TIME_ELAPSED_EXT,v)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&(this._interactionRange[0]=Math.min(this._interactionRange[0],performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],performance.now())),this._renderTaskQueue.run(k),this._domRenderTaskQueue.run(k),this._removed)return;this._updateProjectionTransition();const Y=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=false;const le=this.transform.zoom,fe=this.transform.pitch,me=o.e.now(),Pe=new o.ai(le,{now:me,fadeDuration:Y,pitch:fe,transition:this._loaded?this.style.transition:{duration:0,delay:0},worldview:this._worldview});this.style.update(Pe)}this.style&&this.style.hasFogTransition()&&(this.style._markersNeedUpdate=true,this._sourcesDirty=true);let Z=false;if(this.style&&this._sourcesDirty?(this._sourcesDirty=false,this.painter._updateFog(this.style),this._updateTerrain(),Z=this._updateAverageElevation(D),this.style.updateSources(this.transform),this.style.updateImageProviders(),this.isMoving()||this._forceMarkerAndPopupUpdate()):Z=this._updateAverageElevation(D),this.style&&(this._placementDirty=this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,Y,this._crossSourceCollisions,this.painter.replacementSource,this._placementAlgorithm)),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showParseStatus:this.showParseStatus,wireframe:{terrain:this.showTerrainWireframe,layers2D:this.showLayers2DWireframe,layers3D:this.showLayers3DWireframe},showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,showTileAABBs:this.showTileAABBs,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:Y,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),gpuTimingDeferredRender:!!this.listens("gpu-timing-deferred-render"),speedIndexTiming:this.speedIndexTiming,paintStartTimeStamp:k}),this.fire(new o.h("render")),this.loaded()&&!this._loaded&&(this._loaded=true,o.eM.mark(o.eN.load),this.fire(new o.h("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=true),this.style&&(this.style.snow||this.style.rain)&&(this._styleDirty=true),this.style&&this.style.imageManager.hasPatternsInFlight()&&(this._styleDirty=true),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),v){const le=o.e.now()-D;V.endQuery(E.TIME_ELAPSED_EXT),setTimeout(()=>{const fe=V.getQueryParameter(v,V.QUERY_RESULT)/1e6;V.deleteQuery(v),this.fire(new o.h("gpu-timing-frame",{cpuTime:le,gpuTime:fe}))},50)}if(this.listens("gpu-timing-layer")){const le=this.painter.collectGpuTimers();setTimeout(()=>{const fe=this.painter.queryGpuTimers(le);this.fire(new o.h("gpu-timing-layer",{layerTimes:fe}))},50)}if(this.listens("gpu-timing-deferred-render")){const le=this.painter.collectDeferredRenderGpuQueries();setTimeout(()=>{const fe=this.painter.queryGpuTimeDeferredRender(le);this.fire(new o.h("gpu-timing-deferred-render",{gpuTime:fe}))},50)}const ne=this._sourcesDirty||this._styleDirty||this._placementDirty||Z;if(ne||this._repaint)this.triggerRepaint();else{const le=this.idle();if(le&&(Z=this._updateAverageElevation(D,true)),Z)this.triggerRepaint();else{if(this._triggerFrame(false),le&&(this.fire(new o.h("idle")),this._isInitialLoad=false,this.speedIndexTiming)){const fe=this._calculateSpeedIndex();this.fire(new o.h("speedindexcompleted",{speedIndex:fe})),this.speedIndexTiming=false}le&&this.style&&this.style.handleIdle()}}!this._loaded||this._fullyLoaded||ne||(this._fullyLoaded=true,o.eM.mark(o.eN.fullLoad),this._performanceMetricsCollection&&o.eS(this._requestManager._customAccessToken,{width:this.painter.width,height:this.painter.height,interactionRange:this._interactionRange,visibilityHidden:this._visibilityHidden,terrainEnabled:this.painter.style.hasTerrain(),fogEnabled:!!this.painter.style.getFog(),projection:this.getProjection().name,zoom:this.transform.zoom,renderer:this.painter.context.renderer,vendor:this.painter.context.vendor}),this._authenticate())}_forceMarkerAndPopupUpdate(k){for(const v of this._markers)k&&!this.getRenderWorldCopies()&&(v._lngLat=v._lngLat.wrap()),v._update();for(const v of this._popups)!k||this.getRenderWorldCopies()||v._trackPointer||(v._lngLat=v._lngLat.wrap()),v._update()}_updateAverageElevation(k,v=false){const E=V=>(this.transform.averageElevation=V,this._update(false),true);if(!this.painter.averageElevationNeedsEasing())return 0!==this.transform.averageElevation&&E(0);const D=this.transform.elevation&&this.transform.elevation.exaggeration()!==this._averageElevationExaggeration;if(D||(v||k-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(k)){const V=this.transform.averageElevation;let Y=this.transform.sampleAverageElevation();null!=this.transform.elevation&&(this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(Y)?Y=0:this._averageElevationLastSampledAt=k;const Z=Math.abs(V-Y);if(Z>1){if(this._isInitialLoad||D)return this._averageElevation.jumpTo(Y),E(Y);this._averageElevation.easeTo(Y,k,300)}else if(Z>1e-4)return this._averageElevation.jumpTo(Y),E(Y)}return!!this._averageElevation.isEasing(k)&&E(this._averageElevation.getValue(k))}_isTokenExpired(){return null!=this._tokenExpiration&&Date.now()>this._tokenExpiration}_revokeAuth(){const k=this.painter.context.gl;o.eR(k,false),this._logoControl instanceof F7&&this._logoControl._updateLogo(),k&&k.clear(k.DEPTH_BUFFER_BIT|k.COLOR_BUFFER_BIT|k.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new o.f(new Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/")))}_authenticate(){o.eT(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,k=>{k&&(k.message!==o.eU&&401!==k.status||this._revokeAuth())}),this._isTokenExpired()&&this._revokeAuth(),o.eV(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,()=>{})}_postStyleLoadEvent(){this.style.globalId&&o.eW(this._requestManager._customAccessToken,{map:this,style:this.style.globalId,importedStyles:this.style.getImportGlobalIds()})}_postStyleWithAppearanceEvent(){this.style.globalId&&this.style.hasAppearances()&&o.eX(this._requestManager._customAccessToken)}_postAddingAppearancesToStyleEvent(){o.eY(this._requestManager._customAccessToken)}_updateTerrain(){const k=this._isDragging();this.painter.updateTerrain(this.style,k)}_calculateSpeedIndex(){const k=this.painter.canvasCopy(),v=this.painter.getCanvasCopiesAndTimestamps();v.timeStamps.push(performance.now());const E=this.painter.context.gl,D=E.createFramebuffer();function V(Y){E.framebufferTexture2D(E.FRAMEBUFFER,E.COLOR_ATTACHMENT0,E.TEXTURE_2D,Y,0);const Z=new Uint8Array(E.drawingBufferWidth*E.drawingBufferHeight*4);return E.readPixels(0,0,E.drawingBufferWidth,E.drawingBufferHeight,E.RGBA,E.UNSIGNED_BYTE,Z),Z}return E.bindFramebuffer(E.FRAMEBUFFER,D),this._canvasPixelComparison(V(k),v.canvasCopies.map(V),v.timeStamps)}_canvasPixelComparison(k,v,E){let D=E[1]-E[0];const V=k.length/4;for(let Y=0;Y{const E=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,E&&this._render(v)}))}_preloadTiles(k){const v=this.style?this.style.getSourceCaches():[];return o.bT(v,(E,D)=>E._preloadTiles(k,D),()=>{this.triggerRepaint()}),this}_onWindowOnline(){this._update()}_onWindowResize(k){this._trackResize&&this.resize({originalEvent:k})._update()}_onVisibilityChange(){"hidden"===document.visibilityState&&this._visibilityHidden++}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(k){this._showTileBoundaries!==k&&(this._showTileBoundaries=k,k&&Ot(),this._update())}get showParseStatus(){return!!this._showParseStatus}set showParseStatus(k){this._showParseStatus!==k&&(this._showParseStatus=k,this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(k){this._showTerrainWireframe!==k&&(this._showTerrainWireframe=k,this._update())}get showLayers2DWireframe(){return!!this._showLayers2DWireframe}set showLayers2DWireframe(k){this._showLayers2DWireframe!==k&&(this._showLayers2DWireframe=k,this._update())}get showLayers3DWireframe(){return!!this._showLayers3DWireframe}set showLayers3DWireframe(k){this._showLayers3DWireframe!==k&&(this._showLayers3DWireframe=k,this._update())}get showElevationIdDebug(){return!!this.painter&&this.painter._debugParams.showElevationIdDebug}set showElevationIdDebug(k){this.painter&&this.painter._debugParams.showElevationIdDebug!==k&&(this.painter._debugParams.showElevationIdDebug=k,this.style&&k?this.style._reloadSources():this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(k){this._speedIndexTiming!==k&&(this._speedIndexTiming=k,this._update())}get showPadding(){return!!this._showPadding}set showPadding(k){this._showPadding!==k&&(this._showPadding=k,k&&Ot(),this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(k){this._showCollisionBoxes!==k&&(this._showCollisionBoxes=k,k&&Ot(),this.style&&k?this.style._reloadSources():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(k){this._showOverdrawInspector!==k&&(this._showOverdrawInspector=k,this._update())}get repaint(){return!!this._repaint}set repaint(k){this._repaint!==k&&(this._repaint=k,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(k){this._vertices=k,this._update()}get showTileAABBs(){return!!this._showTileAABBs}set showTileAABBs(k){this._showTileAABBs!==k&&(this._showTileAABBs=k,k&&this._update())}_setCacheLimits(k,v){o.f0(k,v)}get version(){return o.f1}},NavigationControl:class{constructor(k={}){this.options={...O7,...k},this._container=h("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",v=>v.preventDefault()),this.options.showZoom&&(o.aV(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",v=>{this._map&&this._map.zoomIn({},{originalEvent:v})}),h("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",v=>{this._map&&this._map.zoomOut({},{originalEvent:v})}),h("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(o.aV(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",v=>{const E=this._map;E&&(this.options.visualizePitch?E.resetNorthPitch({},{originalEvent:v}):E.resetNorth({},{originalEvent:v}))}),this._compassIcon=h("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const k=this._map;if(!k)return;const v=k.getZoom(),E=v===k.getMaxZoom(),D=v===k.getMinZoom();this._zoomInButton.disabled=E,this._zoomOutButton.disabled=D,this._zoomInButton.setAttribute("aria-disabled",E.toString()),this._zoomOutButton.setAttribute("aria-disabled",D.toString())}_rotateCompassArrow(){const k=this._map;if(!k)return;const v=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(k.transform.pitch*(Math.PI/180)),.5)}) rotateX(${k.transform.pitch}deg) rotateZ(${k.transform.angle*(180/Math.PI)}deg)`:`rotate(${k.transform.angle*(180/Math.PI)}deg)`;k._requestDomTask(()=>{this._compassIcon&&(this._compassIcon.style.transform=v)})}onAdd(k){return this._map=k,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),k.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&k.on("pitch",this._rotateCompassArrow),k.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new u4(k,this._compass,this.options.visualizePitch)),this._container}onRemove(){const k=this._map;k&&(this._container.remove(),this.options.showZoom&&k.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&k.off("pitch",this._rotateCompassArrow),k.off("rotate",this._rotateCompassArrow),this._handler&&this._handler.off(),this._handler=void 0),this._map=void 0)}_createButton(k,v){const E=h("button",k,this._container);return E.type="button",E.addEventListener("click",v),E}_setButtonTitle(k,v){if(!this._map)return;const E=this._map._getUIString(`NavigationControl.${v}`);k.setAttribute("aria-label",E),k.firstElementChild&&k.firstElementChild.setAttribute("title",E)}},GeolocateControl:class extends o.E{constructor(k={}){super();const v=navigator.geolocation;this.options={geolocation:v,...Pb,...k},o.aV(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=R7(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(k){return this._map=k,this._container=h("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkGeolocationSupport(this._setupUI),this._container}onRemove(){this._clearRequestTimeout(),void 0!==this._geolocationWatchID&&(this.options.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("zoom",this._onZoom),this._map=void 0,this._numberOfWatches=0,this._noTimeout=false}_checkGeolocationSupport(k){const v=(E=!!this.options.geolocation)=>{this._supportsGeolocation=E,k(E)};void 0!==this._supportsGeolocation?k(this._supportsGeolocation):void 0!==navigator.permissions?navigator.permissions.query({name:"geolocation"}).then(E=>v("denied"!==E.state)).catch(()=>v()):v()}_isOutOfMapMaxBounds(k){const v=this._map.getMaxBounds(),E=k.coords;return!!v&&(E.longitudev.getEast()||E.latitudev.getNorth())}_setWatchState(k){this._watchState=k;const v=this._geolocateButton.classList;v.remove(...om);for(const E of Sq[k])v.add(hI(E))}_setButtonTitle(k){const v=this._map._getUIString(k);this._geolocateButton.setAttribute("aria-label",v),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",v)}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":this._setWatchState("ACTIVE_ERROR");break;case"BACKGROUND":this._setWatchState("BACKGROUND_ERROR")}}_onSuccess(k){if(this._map){if(this._clearRequestTimeout(),this._isOutOfMapMaxBounds(k))return this._setErrorState(),this.fire(new o.h("outofmaxbounds",k)),this._updateMarker(),void this._finish();if(this._lastKnownPosition=k,this.options.trackUserLocation)switch(this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._setWatchState(this.options.followUserLocation?"ACTIVE_LOCK":"BACKGROUND");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._setWatchState("BACKGROUND")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(k),this.options.followUserLocation&&(!this.options.trackUserLocation||"ACTIVE_LOCK"===this._watchState)&&this._updateCamera(k),this.options.showUserLocation&&this._userLocationDotMarker.removeClassName("mapboxgl-user-location-dot-stale"),this.fire(new o.h("geolocate",{coords:k.coords,timestamp:k.timestamp,...k.toJSON?{toJSON:k.toJSON.bind(k)}:{}})),this._finish()}}_updateCamera(k){const v=new o.cz(k.coords.longitude,k.coords.latitude),E=k.coords.accuracy,D={bearing:this._map.getBearing(),...this.options.fitBoundsOptions};this._map.fitBounds(v.toBounds(E),D,{geolocateSource:true})}_updateMarker(k){if(k){const v=new o.cz(k.coords.longitude,k.coords.latitude);this.options.showAccuracyCircle?this._accuracyCircleMarker.setLngLat(v).addTo(this._map):this._accuracyCircleMarker.remove(),this._userLocationDotMarker.setLngLat(v).addTo(this._map),this._accuracy=k.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const k=this._map.transform,v=o.dv(1,k._center.lat)*k.worldSize,E=Math.ceil(2*this._accuracy*v);this._circleElement.style.width=`${E}px`,this._circleElement.style.height=`${E}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&"number"==typeof this._heading?(this._userLocationDotMarker.setRotation(this._heading),this._userLocationDotMarker.addClassName("mapboxgl-user-location-show-heading")):(this._userLocationDotMarker.removeClassName("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(k){if(this._map){if(this._clearRequestTimeout(),this.options.trackUserLocation)if(1===k.code)this._setWatchState("OFF"),this._geolocateButton.disabled=true,this._setButtonTitle("GeolocateControl.LocationNotAvailable"),void 0!==this._geolocationWatchID&&this._clearWatch();else{if(3===k.code&&this._noTimeout)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._userLocationDotMarker.addClassName("mapboxgl-user-location-dot-stale"),this.fire(new o.h("error",{code:k.code,message:k.message,PERMISSION_DENIED:k.PERMISSION_DENIED,POSITION_UNAVAILABLE:k.POSITION_UNAVAILABLE,TIMEOUT:k.TIMEOUT})),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_startRequestTimeout(){this._clearRequestTimeout();const k=this.options.positionOptions.timeout;k&&(this._requestTimeoutId=window.setTimeout(()=>{this._onError({code:3,message:"Geolocation request timed out"})},k))}_clearRequestTimeout(){void 0!==this._requestTimeoutId&&(clearTimeout(this._requestTimeoutId),this._requestTimeoutId=void 0)}_setupUI(k){void 0!==this._map&&(this._container.addEventListener("contextmenu",v=>v.preventDefault()),this._geolocateButton=h("button","mapboxgl-ctrl-geolocate",this._container),h("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",false===k?(o.w("Geolocation support is not available so the GeolocateControl will be disabled."),this._geolocateButton.disabled=true,this._setButtonTitle("GeolocateControl.LocationNotAvailable")):this._setButtonTitle("GeolocateControl.FindMyLocation"),this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._createUserLocationMarkers(),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=true,this.options.showButton||(this._container.style.display="none"),this.options.trackUserLocation&&this._map.on("movestart",v=>{v.geolocateSource||"ACTIVE_LOCK"!==this._watchState||v.originalEvent&&"resize"===v.originalEvent.type||(this._setWatchState("BACKGROUND"),this.fire(new o.h("trackuserlocationend")))}),this.fire(new o.h("ready")))}_onDeviceOrientation(k){this._userLocationDotMarker&&(k.webkitCompassHeading?this._heading=k.webkitCompassHeading:true===k.absolute&&(this._heading=-1*k.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return o.w("Geolocate control triggered before added to a map"),false;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._setWatchState("WAITING_ACTIVE"),this.fire(new o.h("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._numberOfWatches--,this._noTimeout=false,this._setWatchState("OFF"),this.fire(new o.h("trackuserlocationend"));break;case"BACKGROUND":this._setWatchState("ACTIVE_LOCK"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new o.h("trackuserlocationstart"))}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let k;this._geolocateButton.classList.add(hI("waiting")),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(k={maximumAge:6e5,timeout:0},this._noTimeout=true):(k=this.options.positionOptions,this._noTimeout=false),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,k),this._startRequestTimeout(),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else this.options.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._startRequestTimeout(),this._timeoutId=window.setTimeout(this._finish,1e4);return true}setFollowUserLocation(k){return this.options.followUserLocation=k??Pb.followUserLocation,this.options.trackUserLocation&&"OFF"!==this._watchState&&(this.options.followUserLocation?"BACKGROUND"!==this._watchState&&"BACKGROUND_ERROR"!==this._watchState||(this._setWatchState("ACTIVE_LOCK"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new o.h("trackuserlocationstart"))):"ACTIVE_LOCK"!==this._watchState&&"ACTIVE_ERROR"!==this._watchState||(this._setWatchState("BACKGROUND"),this.fire(new o.h("trackuserlocationend")))),this}setShowAccuracyCircle(k){if(this.options.showAccuracyCircle=k??Pb.showAccuracyCircle,!this._accuracyCircleMarker)return this;if(this.options.showAccuracyCircle){if(this.options.showUserLocation&&this._lastKnownPosition){const{longitude:v,latitude:E,accuracy:D}=this._lastKnownPosition.coords;this._accuracy=D,this._accuracyCircleMarker.setLngLat(new o.cz(v,E)).addTo(this._map),this._updateCircleRadius()}}else this._accuracyCircleMarker.remove();return this}setShowUserHeading(k){return this.options.showUserHeading=k??Pb.showUserHeading,this._setup?(this.options.showUserHeading?void 0!==this._geolocationWatchID&&this._addDeviceOrientationListener():(this._removeDeviceOrientationListener(),this._heading=void 0,this._userLocationDotMarker&&this._updateMarkerRotation()),this):this}setFitBoundsOptions(k){return this.options.fitBoundsOptions=k??Pb.fitBoundsOptions,this}setShowUserLocation(k){return this.options.showUserLocation=k??Pb.showUserLocation,this._setup?(this.options.showUserLocation?(this._userLocationDotMarker||(this._createUserLocationMarkers(),this._map.on("zoom",this._onZoom)),!this._lastKnownPosition||void 0!==this._watchState&&"OFF"===this._watchState||this._updateMarker(this._lastKnownPosition)):(this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this._accuracyCircleMarker&&this._accuracyCircleMarker.remove()),this):this}_addDeviceOrientationListener(){const k=()=>{const v="ondeviceorientationabsolute"in window?"deviceorientationabsolute":"deviceorientation";window.addEventListener(v,this._onDeviceOrientation)};"function"==typeof DeviceOrientationEvent.requestPermission?DeviceOrientationEvent.requestPermission().then(v=>{"granted"===v&&k()}).catch(console.error):k()}_removeDeviceOrientationListener(){window.removeEventListener("deviceorientation",this._onDeviceOrientation),window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation)}_createUserLocationMarkers(){this._dotElement=h("div","mapboxgl-user-location"),this._dotElement.appendChild(h("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(h("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new z7({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=h("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new z7({element:this._circleElement,pitchAlignment:"map"})}_clearWatch(){this._clearRequestTimeout(),this.options.geolocation.clearWatch(this._geolocationWatchID),this._removeDeviceOrientationListener(),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove(hI("waiting")),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:Use,ScaleControl:class{constructor(k={}){this.options={...Aq,...k},o.aV(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){const k=this.options.maxWidth||100,v=this._map,E=v._containerHeight/2,D=v._containerWidth/2-k/2,V=v.unproject([D,E]),Y=v.unproject([D+k,E]),Z=V.distanceTo(Y);if("imperial"===this.options.unit){const ne=3.2808*Z;ne>5280?this._setScale(k,ne/5280,"mile"):this._setScale(k,ne,"foot")}else"nautical"===this.options.unit?this._setScale(k,Z/1852,"nautical-mile"):Z>=1e3?this._setScale(k,Z/1e3,"kilometer"):this._setScale(k,Z,"meter")}_setScale(k,v,E){this._map._requestDomTask(()=>{const D=function(Y){const Z=Math.pow(10,`${Math.floor(Y)}`.length-1);let ne=Y/Z;return ne=ne>=10?10:ne>=5?5:ne>=3?3:ne>=2?2:ne>=1?1:function(le){const fe=Math.pow(10,Math.ceil(-Math.log(le)/Math.LN10));return Math.round(le*fe)/fe}(ne),Z*ne}(v),V=D/v;this._container.innerHTML="nautical-mile"!==E?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:E}).format(D):`${D} ${Ib[E]}`,this._container.style.width=k*V+"px"})}onAdd(k){return this._map=k,this._language=k.getLanguage(),this._container=h("div","mapboxgl-ctrl mapboxgl-ctrl-scale",k.getContainer()),this._container.dir="auto",this._map.on("move",this._update),this._update(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._update),this._map=void 0}_setLanguage(k){this._language=k,this._update()}setUnit(k){this.options.unit=k,this._update()}},FullscreenControl:class{constructor(k={}){this._fullscreen=false,k&&k.container&&(k.container instanceof HTMLElement?this._container=k.container:o.w("Full screen control 'container' must be a DOM element.")),o.aV(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(k){return this._map=k,this._container||(this._container=this._map.getContainer()),this._controlContainer=h("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",o.w("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!document.fullscreenEnabled&&!document.webkitFullscreenEnabled)}_setupUI(){const k=this._fullscreenButton=h("button","mapboxgl-ctrl-fullscreen",this._controlContainer);h("span","mapboxgl-ctrl-icon",k).setAttribute("aria-hidden","true"),k.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const k=this._getTitle();this._fullscreenButton.setAttribute("aria-label",k),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",k)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(document.fullscreenElement||document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?document.exitFullscreen?document.exitFullscreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},IndoorControl:class{constructor(){o.aV(["_onIndoorUpdate","_onStyleData","_scrollUp","_scrollDown","_toggleIndoor"],this),this._visibleFloorStart=0,this._lastSelectedFloorId=null}onAdd(k){return this._map=k,this._container=h("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.style.display="none",this._map.on("styledata",this._onStyleData),this._map.on("idle",this._onStyleData),this._updateConnection(),this._container}_onStyleData(){this._updateConnection()}_updateConnection(){if(this._map&&this._map.style&&this._map.style.indoorManager){const k=this._map.style.indoorManager;k.off("selector-update",this._onIndoorUpdate),k.on("selector-update",this._onIndoorUpdate),this._onIndoorUpdate(k.getControlState()),this._map.off("idle",this._onStyleData)}}_createButton(k,v){const E=h("button",k,this._container);return E.type="button",E.addEventListener("click",v),E}_setButtonTitle(k,v){k.setAttribute("aria-label",v),k.textContent=v}onRemove(){this._container&&this._container.remove(),this._map&&(this._map.off("styledata",this._onStyleData),this._map.off("idle",this._onStyleData),this._map.style&&this._map.style.indoorManager&&this._map.style.indoorManager.off("selector-update",this._onIndoorUpdate),this._map=null)}getDefaultPosition(){return"top-right"}_onIndoorUpdate(k){if(!k||!k.floors||0===k.floors.length)return this._model=k,void(this._container.style.display="none");const v=this._model;this._model=k,this._container.style.display="inline-block";const E=!v||v.floors.length!==k.floors.length||v.floors.some((D,V)=>D.id!==k.floors[V].id);if(E&&(this._visibleFloorStart=0,this._lastSelectedFloorId=null),k.selectedFloorId){if(k.selectedFloorId!==this._lastSelectedFloorId||E){const D=k.floors.findIndex(V=>V.id===k.selectedFloorId);if(-1!==D){const V=k.floors.length;let Y,Z;V<=5?(Y=0,Z=V-1):0===this._visibleFloorStart?(Y=0,Z=3):this._visibleFloorStart>=V-3?(Y=V-3-1,Z=V-1):(Y=this._visibleFloorStart,Z=this._visibleFloorStart+3-1),DZ&&(this._visibleFloorStart=D-2)}}this._lastSelectedFloorId=k.selectedFloorId}this._render()}_render(){if(!this._container||!this._model||!this._model.floors)return;this._container.innerHTML="";const k=this._createButton("mapboxgl-ctrl-indoor-toggle",this._toggleIndoor);h("span","mapboxgl-ctrl-icon",k).setAttribute("aria-hidden","true"),this._model.activeFloorsVisible||k.classList.add("mapboxgl-ctrl-level-button-selected"),this._container.appendChild(k);const v=this._model.floors,E=v.length;if(E<=5)return void v.forEach(Z=>this._createFloorButton(Z));const D=0===this._visibleFloorStart,V=this._visibleFloorStart>=E-3;if(D)this._createFloorButton(v[0]);else{const Z=this._createButton("mapboxgl-ctrl-arrow-up",this._scrollUp);h("span","mapboxgl-ctrl-icon",Z).setAttribute("aria-hidden","true"),this._container.appendChild(Z)}let Y=[];if(Y=D?v.slice(1,4):V?v.slice(this._visibleFloorStart-1,this._visibleFloorStart+3-1):v.slice(this._visibleFloorStart,this._visibleFloorStart+3),Y.forEach(Z=>this._createFloorButton(Z)),V)this._createFloorButton(v[E-1]);else{const Z=this._createButton("mapboxgl-ctrl-arrow-down",this._scrollDown);h("span","mapboxgl-ctrl-icon",Z).setAttribute("aria-hidden","true"),this._container.appendChild(Z)}}_createFloorButton(k){const v=this._createButton("mapboxgl-ctrl-level-button",()=>{const Y=k.id;this._model&&this._model.selectedFloorId===Y&&this._model.activeFloorsVisible||this._map&&(this._model&&!this._model.activeFloorsVisible&&this._map.style&&this._map.style.indoorManager&&this._map.style.indoorManager.setActiveFloorsVisibility(true),this._map._selectIndoorFloor(Y))}),E=(k.name||"").trim(),D=k.zIndex.toString(),V=E?Array.from(E).slice(0,3).join(""):D;this._setButtonTitle(v,V),this._model&&this._model.activeFloorsVisible&&k.id===this._model.selectedFloorId&&v.classList.add("mapboxgl-ctrl-level-button-selected"),this._container&&this._container.appendChild(v)}_toggleIndoor(){this._map&&this._map.style&&this._map.style.indoorManager&&this._model&&this._model.activeFloorsVisible&&this._map.style.indoorManager.setActiveFloorsVisibility(false)}_scrollUp(){if(this._visibleFloorStart>0){this._visibleFloorStart--,1===this._visibleFloorStart&&(this._visibleFloorStart=0);const k=this._model&&this._model.floors||[];if(k.length>3){const v=k.length-3;this._visibleFloorStart===v-1&&(this._visibleFloorStart=v-2)}this._render()}}_scrollDown(){if(this._model&&this._model.floors){const k=this._model.floors.length-3;this._visibleFloorStartk&&(this._visibleFloorStart=k),this._render())}}},Popup:class extends o.E{constructor(k){super(),this.options=Object.assign(Object.create(pI),k),this._altitude=this.options.altitude,o.aV(["_update","_onClose","remove","_onMouseEvent"],this),this._classList=new Set(k&&k.className?k.className.trim().split(Mb):[])}addTo(k){return this._map&&this.remove(),this._map=k,this.options.closeOnClick&&k.on("preclick",this._onClose),this.options.closeOnMove&&k.on("move",this._onClose),k.on("remove",this.remove),this._update(),k._addPopup(this),this._focusFirstElement(),this._trackPointer?(k.on("mousemove",this._onMouseEvent),k.on("mouseup",this._onMouseEvent),k._canvasContainer.classList.add("mapboxgl-track-pointer")):k.on("move",this._update),this.fire(new o.h("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);const k=this._map;return k&&(k.off("move",this._update),k.off("move",this._onClose),k.off("preclick",this._onClose),k.off("click",this._onClose),k.off("remove",this.remove),k.off("mousemove",this._onMouseEvent),k.off("mouseup",this._onMouseEvent),k.off("drag",this._onMouseEvent),k._canvasContainer&&k._canvasContainer.classList.remove("mapboxgl-track-pointer"),k._removePopup(this),this._map=void 0),this.fire(new o.h("close")),this}getLngLat(){return this._lngLat}setLngLat(k){this._lngLat=o.cz.convert(k),this._pos=null,this._trackPointer=false,this._update();const v=this._map;return v&&(v.on("move",this._update),v.off("mousemove",this._onMouseEvent),v._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}getAltitude(){return this._altitude}setAltitude(k){return this._altitude=k,this._update(),this}trackPointer(){this._trackPointer=true,this._pos=null,this._update();const k=this._map;return k&&(k.off("move",this._update),k.on("mousemove",this._onMouseEvent),k.on("drag",this._onMouseEvent),k._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(k){return this.setDOMContent(document.createTextNode(k))}setHTML(k){const v=document.createDocumentFragment(),E=document.createElement("body");let D;for(E.innerHTML=k;D=E.firstChild,D;)v.appendChild(D);return this.setDOMContent(v)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(k){return this.options.maxWidth=k,this._update(),this}setDOMContent(k){let v=this._content;if(v)for(;v.hasChildNodes();)v.firstChild&&v.removeChild(v.firstChild);else v=this._content=h("div","mapboxgl-popup-content",this._container||void 0);if(v.appendChild(k),this.options.closeButton){const E=this._closeButton=h("button","mapboxgl-popup-close-button",v);E.type="button",E.setAttribute("aria-label","Close popup"),E.innerHTML='',E.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}addClassName(k){return this._classList.add(k),this._updateClassList(),this}removeClassName(k){return this._classList.delete(k),this._updateClassList(),this}setOffset(k){return this.options.offset=k,this._update(),this}toggleClassName(k){let v;return this._classList.delete(k)?v=false:(this._classList.add(k),v=true),this._updateClassList(),v}_onMouseEvent(k){this._update(k.point)}_getAnchor(k){if(this.options.anchor)return this.options.anchor;const v=this._map,E=this._container,D=this._pos;if(!v||!E||!D)return"bottom";const V=E.offsetWidth,Y=E.offsetHeight,Z=D.xv.transform.width-V/2;if(D.y+kv.transform.height-Y){if(Z)return"bottom-left";if(ne)return"bottom-right"}return Z?"left":ne?"right":"bottom"}_updateClassList(){const k=this._container;if(!k)return;const v=[...this._classList];v.push("mapboxgl-popup"),this._anchor&&v.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&v.push("mapboxgl-popup-track-pointer"),k.className=v.join(" ")}_update(k){const v=this._map,E=this._content;if(!v||!this._lngLat&&!this._trackPointer||!E)return;let D=this._container;if(D||(D=this._container=h("div","mapboxgl-popup",v.getContainer()),this._tip=h("div","mapboxgl-popup-tip",D),D.appendChild(E)),this.options.maxWidth&&D.style.maxWidth!==this.options.maxWidth&&(D.style.maxWidth=this.options.maxWidth),v.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Cq(this._lngLat,this._pos,v.transform)),!this._trackPointer||k){const V=this._pos=this._trackPointer&&k instanceof o.P?k:v.project(this._lngLat,this._altitude),Y=xA(this.options.offset),Z=this._anchor=this._getAnchor(Y.y),ne=xA(this.options.offset,Z),le=V.add(ne).round();v._requestDomTask(()=>{this._container&&Z&&(this._container.style.transform=`${B7[Z]} translate(${le.x}px,${le.y}px)`)})}if(!this._marker&&v._showingGlobe()){const V=o.f2(v.transform,this._lngLat)?0:1;this._setOpacity(V)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const k=this._container.querySelector(bA);k&&k.focus()}_onClose(){this.remove()}_setOpacity(k){this._container&&(this._container.style.opacity=`${k}`),this._content&&(this._content.style.pointerEvents=k?"auto":"none")}},Marker:z7,Style:I2,LngLat:o.cz,LngLatBounds:o.eB,Point:o.P,MercatorCoordinate:o.bS,FreeCameraOptions:o.f8,Evented:o.E,config:o.eL,prewarm:function(){LY().acquire(pi)},clearPrewarmedResources:function(){const k=KP;k&&(k.isPreloaded()&&1===k.numActive()?(k.release(pi),KP=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return o.eL.ACCESS_TOKEN},set accessToken(k){o.fm(k)},get baseApiUrl(){return o.eL.API_URL},set baseApiUrl(k){o.fl(k)},get workerCount(){return Qr.workerCount},set workerCount(k){!function(v){Qr.workerCount=v}(k)},get maxParallelImageRequests(){return o.eL.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(k){o.fk(k)},clearStorage(k){o.fj(k)},get workerUrl(){return ei.workerUrl},set workerUrl(k){ei.workerUrl=k},get workerClass(){return ei.workerClass},set workerClass(k){ei.workerClass=k},get dracoUrl(){return o.fi()},set dracoUrl(k){o.fh(k)},get meshoptUrl(){return o.fg()},set meshoptUrl(k){o.ff(k)},get buildingGenUrl(){return o.fe()},set buildingGenUrl(k){o.fd(k)},setNow:o.e.setNow,restoreNow:o.e.restoreNow};return Ea});var i=n;return i})});bs();function II(){return new WBe}var WBe=class e{index={};array=[];size(){return this.array.length}empty(){return this.array.length===0}itemAt(t){return this.array[t]}contains(t){return this.index[t.id()]!==void 0}find(t){const n=this.index[t.id()];return n===void 0?void 0:this.array[n]}setDefault(t,n){const r=this.index[t.id()];if(r===void 0){const i=new yce(t,n());this.index[t.id()]=this.array.length;this.array.push(i);return i}else{return this.array[r]}}insert(t,n){const r=new yce(t,n);const i=this.index[t.id()];if(i===void 0){this.index[t.id()]=this.array.length;this.array.push(r)}else{this.array[i]=r}return r}erase(t){const n=this.index[t.id()];if(n===void 0){return void 0}this.index[t.id()]=void 0;const r=this.array[n];const i=this.array.pop();if(r!==i){this.array[n]=i;this.index[i.first.id()]=n}return r}copy(){const t=new e;for(let n=0;n0;let r=II();for(let i=0,o=e.length;i=","="][this._operator]+" 0 ("+this._strength.toString()+")"}_expression;_operator;_strength;_id=wEr++};var wEr=0;var xce=class{maxIterations=1e3;constructor(){}createConstraint(t,n,r,i=As.required){let o=new _l(t,n,r,i);this.addConstraint(o);return o}addConstraint(t){let n=this._cnMap.find(t);if(n!==void 0){throw new Error("duplicate constraint")}let r=this._createRow(t);let i=r.row;let o=r.tag;let a=this._chooseSubject(i,o);if(a.type()===uc.Invalid&&i.allDummies()){if(!bce(i.constant())){throw new Error("unsatisfiable constraint")}else{a=o.marker}}if(a.type()===uc.Invalid){if(!this._addWithArtificialVariable(i)){throw new Error("unsatisfiable constraint")}}else{i.solveFor(a);this._substitute(a,i);this._rowMap.insert(a,i)}this._cnMap.insert(t,o);this._optimize(this._objective)}removeConstraint(t){let n=this._cnMap.erase(t);if(n===void 0){throw new Error("unknown constraint")}this._removeConstraintEffects(t,n.second);let r=n.second.marker;let i=this._rowMap.erase(r);if(i===void 0){let o=this._getMarkerLeavingSymbol(r);if(o.type()===uc.Invalid){throw new Error("failed to find leaving row")}i=this._rowMap.erase(o);i.second.solveForEx(o,r);this._substitute(r,i.second)}this._optimize(this._objective)}hasConstraint(t){return this._cnMap.contains(t)}getConstraints(){return this._cnMap.array.map(({first:t})=>t)}addEditVariable(t,n){let r=this._editMap.find(t);if(r!==void 0){throw new Error("duplicate edit variable")}n=As.clip(n);if(n===As.required){throw new Error("bad required strength")}let i=new _c(t);let o=new _l(i,Ws.Eq,void 0,n);this.addConstraint(o);let a=this._cnMap.find(o).second;let s={tag:a,constraint:o,constant:0};this._editMap.insert(t,s)}removeEditVariable(t){let n=this._editMap.erase(t);if(n===void 0){throw new Error("unknown edit variable")}this.removeConstraint(n.second.constraint)}hasEditVariable(t){return this._editMap.contains(t)}suggestValue(t,n){let r=this._editMap.find(t);if(r===void 0){throw new Error("unknown edit variable")}let i=this._rowMap;let o=r.second;let a=n-o.constant;o.constant=n;let s=o.tag.marker;let l=i.find(s);if(l!==void 0){if(l.second.add(-a)<0){this._infeasibleRows.push(s)}this._dualOptimize();return}let u=o.tag.other;l=i.find(u);if(l!==void 0){if(l.second.add(a)<0){this._infeasibleRows.push(u)}this._dualOptimize();return}for(let d=0,f=i.size();dthis._makeSymbol(uc.External);return this._varMap.setDefault(t,n).second}_createRow(t){let n=t.expression();let r=new _ce(n.constant());let i=n.terms();for(let l=0,u=i.size();l0&&l.type()!==uc.Dummy){let d=this._objective.coefficientFor(l);let f=d/u;if(f0);if(bce(r.second+=n)){this._cellMap.erase(t)}}insertRow(t,n=1){this._constant+=t._constant*n;let r=t._cellMap;for(let i=0,o=r.size();i{u["center"]="center";u["topLeft"]="topLeft";u["topCenter"]="topCenter";u["topRight"]="topRight";u["left"]="left";u["right"]="right";u["bottomLeft"]="bottomLeft";u["bottomCenter"]="bottomCenter";u["bottomRight"]="bottomRight";return u})(TCt||{});var wCt=(n=>{n["horizontal"]="horizontal";n["vertical"]="vertical";return n})(wCt||{});var Tce=class{static apply(t,n,r={}){if(!n.length)return;const i=REr(t,r.frame);const o=r.direction??IEr(n,r);const a=r.align??"center";const s=r.horizontalPadding??0;const l=r.verticalPadding??0;const u=r.horizontalGap??0;const d=r.verticalGap??0;const f=new xce;const h=n.map((x,w)=>MEr(f,x,w));const m=ECt({option:u,axis:"horizontal",frame:i,padding:s,shapeVars:h});const g=ECt({option:d,axis:"vertical",frame:i,padding:l,shapeVars:h});f.maxIterations=2e4;LEr(f,h,i,a,{horizontalPadding:s,verticalPadding:l},o);if(n.length>1){DEr(f,h,i,o,m,g,a,{horizontalPadding:s,verticalPadding:l})}else{FEr(f,h[0],i,a,s,l)}f.updateVariables();for(const{shape:x,left:w,top:_}of h){const C=x.position??{};C.left=w.value();C.top=_.value();x.position=C}}};function REr(e,t){if(!t||t==="slide"){return{left:e.frame.left,top:e.frame.top,width:e.frame.width,height:e.frame.height}}if(PEr(t)){const n=t.position??{};if(n.left==null||n.top==null||n.width==null||n.height==null){throw new Error("Container shape must have left/top/width/height.")}return{left:n.left,top:n.top,width:n.width,height:n.height}}return{left:t.left,top:t.top,width:t.width,height:t.height}}function PEr(e){return typeof e==="object"&&e!==null&&"position"in e}function IEr(e,t){return"vertical"}function MEr(e,t,n){const r=t.position??{};if(r.width==null||r.height==null){throw new Error("Auto-layout requires position.width and position.height.")}const i=new MI(`shape_${n}_left`);const o=new MI(`shape_${n}_top`);if(r.left!=null){e.addEditVariable(i,As.weak);e.suggestValue(i,r.left)}if(r.top!=null){e.addEditVariable(o,As.weak);e.suggestValue(o,r.top)}return{shape:t,index:n,left:i,top:o,width:r.width,height:r.height}}function LEr(e,t,n,r,i,o){if(t.length<=1){return}const{horizontalPadding:a,verticalPadding:s}=i;const l=n.left+a;const u=n.left+n.width-a;const d=n.top+s;const f=n.top+n.height-s;const h=n.left+n.width/2;const m=n.top+n.height/2;const{horizontal:g,vertical:x}=CCt(r);if(o==="vertical"){for(const w of t){const _=new _c(w.left).plus(w.width);const C=new _c(w.left).plus(w.width/2);switch(g){case"left":e.addConstraint(new _l(w.left,Ws.Eq,l,As.strong));break;case"center":e.addConstraint(new _l(C,Ws.Eq,h,As.strong));break;case"right":e.addConstraint(new _l(_,Ws.Eq,u,As.strong));break}}if(x==="top"){const w=t[0];e.addConstraint(new _l(w.top,Ws.Eq,d,As.strong))}else if(x==="bottom"){const w=t[t.length-1];const _=new _c(w.top).plus(w.height);e.addConstraint(new _l(_,Ws.Eq,f,As.strong))}}else{for(const w of t){const _=new _c(w.top).plus(w.height);const C=new _c(w.top).plus(w.height/2);switch(x){case"top":e.addConstraint(new _l(w.top,Ws.Eq,d,As.strong));break;case"center":e.addConstraint(new _l(C,Ws.Eq,m,As.strong));break;case"bottom":e.addConstraint(new _l(_,Ws.Eq,f,As.strong));break}}if(g==="left"){const w=t[0];e.addConstraint(new _l(w.left,Ws.Eq,l,As.strong))}else if(g==="right"){const w=t[t.length-1];const _=new _c(w.left).plus(w.width);e.addConstraint(new _l(_,Ws.Eq,u,As.strong))}}}function CCt(e){switch(e){case"topLeft":return{vertical:"top",horizontal:"left"};case"topCenter":return{vertical:"top",horizontal:"center"};case"topRight":return{vertical:"top",horizontal:"right"};case"left":return{horizontal:"left"};case"center":return{vertical:"center",horizontal:"center"};case"right":return{horizontal:"right"};case"bottomLeft":return{vertical:"bottom",horizontal:"left"};case"bottomCenter":return{vertical:"bottom",horizontal:"center"};case"bottomRight":return{vertical:"bottom",horizontal:"right"};default:return{}}}function DEr(e,t,n,r,i,o,a,s){const{horizontalPadding:l,verticalPadding:u}=s;const d=CCt(a);if(r==="vertical"){const f=t[0];const h=n.top+u;if(d.vertical!=="bottom"){e.addConstraint(new _l(f.top,Ws.Eq,h,As.strong))}for(let m=1;m{return l+(t==="horizontal"?u.width:u.height)},0);const a=t==="horizontal"?n.width:n.height;const s=a-r*2;return(s-o)/(i.length-1)}if(typeof e==="number"){return e}return 0}bs();var pX=class e{#e;constructor(t){this.#e=SCt(t)}static fromProto(t){return new e(t)}static fromConfig(t){if("proto"in t){return new e(t.proto)}if("slide"in t){return new e({slide:NEr(t.slide)})}if("element"in t){return new e({element:OEr(t.element)})}if("textRange"in t){return new e({textRange:BEr(t.textRange)})}if("textMatch"in t){return new e({textRange:zEr(t.textMatch)})}if("cell"in t){return new e({spreadsheetCell:UEr(t.cell)})}return new e({spreadsheetRange:VEr(t.range)})}toProto(){return SCt(this.#e)}get kind(){if(this.#e.slide){return"slide"}if(this.#e.element){return"element"}if(this.#e.textRange){return"textRange"}if(this.#e.spreadsheetCell){return"spreadsheetCell"}if(this.#e.spreadsheetRange){return"spreadsheetRange"}return"unknown"}get slideId(){return this.#e.slide?.slideId??this.#e.element?.slideId??this.#e.textRange?.slideId}get elementId(){return this.#e.element?.elementId??this.#e.textRange?.elementId}get spreadsheetCell(){const t=this.#e.spreadsheetCell;if(!t){return void 0}return{sheetName:t.sheetName,sheetId:t.sheetId,address:t.address}}get spreadsheetRange(){const t=this.#e.spreadsheetRange;if(!t){return void 0}return{sheetName:t.sheetName,sheetId:t.sheetId,startAddress:t.startAddress,endAddress:t.endAddress}}};var NEr=e=>{if(!e.id){throw new Error("Slide target requires a slide id.")}return{slideId:e.id}};var OEr=e=>{if(!e.id){throw new Error("Element target requires an element id.")}const t=e.slideId;if(!t){throw new Error("Element target requires a slide id.")}return{slideId:t,elementId:e.id}};var BEr=e=>{const{element:t,startCp:n,length:r}=e;if(!t.id){throw new Error("Text range target requires an element id.")}const i=t.slideId;if(!i){throw new Error("Text range target requires a slide id.")}return{slideId:i,elementId:t.id,startCp:n,length:r,context:ACt(e.context)}};var zEr=e=>{const{element:t,query:n}=e;if(!t.id){throw new Error("Text match target requires an element id.")}const r=t.slideId;if(!r){throw new Error("Text match target requires a slide id.")}if(!n){throw new Error("Text match target requires a query.")}const i=t.text.toString();const o=e.occurrence??0;const a=GEr(i,n,o);if(a<0){throw new Error(`Text match target could not find "${n}".`)}return{slideId:r,elementId:t.id,startCp:a,length:n.length,context:ACt(e.context)}};var ACt=e=>{if(!e){return void 0}const t=e.contextLength!==void 0||e.contextHash!==void 0;if(!t){return void 0}return{contextLength:e.contextLength,contextHash:e.contextHash}};var UEr=e=>{const{worksheet:t,address:n}=kCt(e);const r=fi(n);if(!r){throw new Error(`Invalid cell address: ${n}`)}if(r.ref.includes(":")){throw new Error(`Cell target expects a single cell: ${n}`)}return{sheetName:t.name,sheetId:t.sheetId,address:r.ref}};var VEr=e=>{const{worksheet:t,address:n}=kCt(e);const r=fi(n);if(!r){throw new Error(`Invalid range address: ${n}`)}const i=ho(r.bounds.startRow,r.bounds.startCol);const o=ho(r.bounds.endRow,r.bounds.endCol);return{sheetName:t.name,sheetId:t.sheetId,startAddress:i,endAddress:o}};var kCt=e=>{if($Er(e)){const i=e.__getWorksheet();if(!i){throw new Error("Range target requires a worksheet.")}const{ref:o}=Pl(e.address);return{worksheet:i,address:o}}const{worksheet:t,address:n}=e;const{ref:r}=Pl(n);return{worksheet:t,address:r}};var $Er=e=>{return typeof e==="object"&&e!==null&&"__getWorksheet"in e};var GEr=(e,t,n)=>{let r=-1;let i=0;for(let o=0;o<=n;o+=1){r=e.indexOf(t,i);if(r===-1){return-1}i=r+t.length}return r};var SCt=e=>{if(e.spreadsheetCell){const t=e.spreadsheetCell;return{spreadsheetCell:{sheetName:t.sheetName,sheetId:t.sheetId,address:t.address}}}if(e.spreadsheetRange){const t=e.spreadsheetRange;return{spreadsheetRange:{sheetName:t.sheetName,sheetId:t.sheetId,startAddress:t.startAddress,endAddress:t.endAddress}}}if(e.slide){return{slide:{slideId:e.slide.slideId}}}if(e.element){return{element:{slideId:e.element.slideId,elementId:e.element.elementId}}}if(e.textRange){const t=e.textRange.context;return{textRange:{slideId:e.textRange.slideId,elementId:e.textRange.elementId,startCp:e.textRange.startCp,length:e.textRange.length,context:t?{contextLength:t.contextLength,contextHash:t.contextHash}:void 0}}}return{}};var DI=9525;var d1=1/DI;var wce=72/96;var RCt=9144e3;var PCt=6858e3;var Bo=e=>{if(e===void 0||e===null){return 0}return e*d1};var Qi=e=>{return Math.round(e*DI)};var DIo=e=>{if(e===void 0||e===null||Number.isNaN(e)){return void 0}return Math.round(e*wce*100)};var dz=class e{#e;#t;constructor(t,n){this.#e=ICt(t);this.#t=n;this.#e.reactions??=[];this.#e.citations??=[]}static fromProto(t,n){return new e(t,n)}static create(t,n){if(!t.id){throw new Error("Comment id is required.")}if(!t.authorId){throw new Error("Comment authorId is required.")}const r=HEr(t.body);const i=YEr(t.position);return new e({id:t.id,parentId:t.parentId,authorId:t.authorId,createdAt:t.createdAt??n.now(),editedAt:t.editedAt,body:r,isDeleted:t.isDeleted??false,reactions:t.reactions?YBe(t.reactions):[],citations:t.citations??[],position:i},n)}get id(){return this.#e.id}get parentId(){return this.#e.parentId}get authorId(){return this.#e.authorId}get createdAt(){return this.#e.createdAt}get editedAt(){return this.#e.editedAt}get text(){return this.#e.body?.plainText??""}set text(t){this.edit(t)}get reactions(){return this.#e.reactions?YBe(this.#e.reactions):[]}get position(){return this.#e.position?{...this.#e.position}:void 0}get positionPx(){const t=this.#e.position;if(!t){return void 0}return{x:Bo(t.xEmu),y:Bo(t.yEmu)}}edit(t,n={}){this.#e.body={plainText:t};this.#e.editedAt=n.editedAt??this.#t.now()}delete(){this.#e.isDeleted=true}toggleReaction(t,n){if(!t){throw new Error("Reaction type is required.")}const r=this.#t.resolveAuthorId(n);const i=this.#e.reactions??[];const o=i.find(s=>s.type===t);if(!o){i.push({type:t,instances:[{authorId:r,time:this.#t.now()}]});this.#e.reactions=i;return}const a=o.instances.findIndex(s=>s.authorId===r);if(a>=0){o.instances.splice(a,1);if(o.instances.length===0){const s=i.indexOf(o);if(s>=0){i.splice(s,1)}}}else{o.instances.push({authorId:r,time:this.#t.now()})}this.#e.reactions=i}toProto(){return ICt(this.#e)}};var HEr=e=>{if(typeof e==="string"){return{plainText:e}}if(e.plainText===void 0){throw new Error("Comment body requires plainText.")}return{plainText:e.plainText}};var WEr=e=>{return"xEmu"in e&&"yEmu"in e};var YEr=e=>{if(!e){return void 0}if(WEr(e)){return{xEmu:e.xEmu,yEmu:e.yEmu}}const t=e.unit??"px";if(t==="emu"){return{xEmu:e.x,yEmu:e.y}}return{xEmu:Qi(e.x),yEmu:Qi(e.y)}};var ICt=e=>{if(!e.id){throw new Error("Comment id is required.")}if(!e.authorId){throw new Error("Comment authorId is required.")}if(!e.createdAt){throw new Error("Comment createdAt is required.")}return{id:e.id,parentId:e.parentId,authorId:e.authorId,createdAt:e.createdAt,editedAt:e.editedAt,body:e.body?{plainText:e.body.plainText}:void 0,isDeleted:e.isDeleted??false,reactions:e.reactions?YBe(e.reactions):[],citations:e.citations?[...e.citations]:[],position:e.position?{xEmu:e.position.xEmu,yEmu:e.position.yEmu}:void 0}};var YBe=e=>{return e.map(t=>{if(!t.type){throw new Error("Comment reaction requires a type.")}return{type:t.type,instances:qEr(t.instances??[])}})};var qEr=e=>{return e.map(t=>{if(!t.authorId){throw new Error("Reaction instance requires authorId.")}if(!t.time){throw new Error("Reaction instance requires time.")}return{authorId:t.authorId,time:t.time}})};var XEr=/[xy]/g;var Ece="abcdefghijklmnopqrstuvwxyz0123456789";var jEr=/^[A-Za-z0-9.-]+$/;var LCt=0xffffffffffffffffn;var KEr=0xcbf29ce484222325n;var ZEr=0x100000001b3n;var JEr=6364136223846793005n;var QEr=1442695040888963407n;function eCr(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(XEr,e=>{const t=Math.floor(Math.random()*16);const n=e==="x"?t:t&3|8;return n.toString(16)})}function Vv(){if(typeof crypto!=="undefined"&&"randomUUID"in crypto){try{return crypto.randomUUID()}catch{}}return eCr()}function ec(e=6){const t=Math.max(4,Math.floor(e));const n=new Uint8Array(t);if(typeof crypto!=="undefined"&&"getRandomValues"in crypto){try{crypto.getRandomValues(n)}catch{}}if(n.every(i=>i===0)){for(let i=0;i{if(e instanceof TT){return false}return typeof e==="object"&&e!==null&&"displayName"in e};var Ace=e=>{if(e instanceof TT){return true}return typeof e==="object"&&e!==null&&"id"in e};var rCr=e=>{if(!e.id){throw new Error("Person id is required.")}if(!e.displayName){throw new Error("Person displayName is required.")}return{id:e.id,displayName:e.displayName,initials:e.initials,email:e.email,avatarUrl:e.avatarUrl,userId:e.userId,providerId:e.providerId}};var kce=class{#e=[];#t=new Map;constructor(t=[]){t.forEach(n=>{this.#n(n)})}get items(){return[...this.#e]}getById(t){return this.#t.get(t)}add(t){const n=TT.create(t);const r=this.#t.get(n.id);if(r){r.update(n.toProto());return r}this.#e.push(n);this.#t.set(n.id,n);return n}register(t){const n=this.#t.get(t.id);if(n){n.update(t.toProto());return n}this.#e.push(t);this.#t.set(t.id,t);return t}toProto(){return this.#e.map(t=>t.toProto())}replace(t=[]){this.#e=[];this.#t=new Map;t.forEach(n=>{this.#n(n)})}#n(t){const n=TT.fromProto(t);this.#e.push(n);this.#t.set(n.id,n)}};function OCt(){let e=0;let t=0;for(let r=0;r<28;r+=7){let i=this.buf[this.pos++];e|=(i&127)<>4;if((n&128)==0){this.assertBounds();return[e,t]}for(let r=3;r<=31;r+=7){let i=this.buf[this.pos++];t|=(i&127)<>>o;const s=!(a>>>7==0&&t==0);const l=(s?a|128:a)&255;n.push(l);if(!s){return}}const r=e>>>28&15|(t&7)<<4;const i=!(t>>3==0);n.push((i?r|128:r)&255);if(!i){return}for(let o=3;o<31;o=o+7){const a=t>>>o;const s=!(a>>>7==0);const l=(s?a|128:a)&255;n.push(l);if(!s){return}}n.push(t>>>31&1)}var Rce=4294967296;function qBe(e){const t=e[0]==="-";if(t){e=e.slice(1)}const n=1e6;let r=0;let i=0;function o(a,s){const l=Number(e.slice(a,s));i*=n;r=r*n+l;if(r>=Rce){i=i+(r/Rce|0);r=r%Rce}}o(-24,-18);o(-18,-12);o(-12,-6);o(-6);return t?zCt(r,i):jBe(r,i)}function BCt(e,t){let n=jBe(e,t);const r=n.hi&2147483648;if(r){n=zCt(n.lo,n.hi)}const i=XBe(n.lo,n.hi);return r?"-"+i:i}function XBe(e,t){({lo:e,hi:t}=iCr(e,t));if(t<=2097151){return String(Rce*t+e)}const n=e&16777215;const r=(e>>>24|t<<8)&16777215;const i=t>>16&65535;let o=n+r*6777216+i*6710656;let a=r+i*8147497;let s=i*2;const l=1e7;if(o>=l){a+=Math.floor(o/l);o%=l}if(a>=l){s+=Math.floor(a/l);a%=l}return s.toString()+NCt(a)+NCt(o)}function iCr(e,t){return{lo:e>>>0,hi:t>>>0}}function jBe(e,t){return{lo:e|0,hi:t|0}}function zCt(e,t){t=~t;if(e){e=~e+1}else{t+=1}return jBe(e,t)}var NCt=e=>{const t=String(e);return"0000000".slice(t.length)+t};function KBe(e,t){if(e>=0){while(e>127){t.push(e&127|128);e=e>>>7}t.push(e)}else{for(let n=0;n<9;n++){t.push(e&127|128);e=e>>7}t.push(1)}}function UCt(){let e=this.buf[this.pos++];let t=e&127;if((e&128)==0){this.assertBounds();return t}e=this.buf[this.pos++];t|=(e&127)<<7;if((e&128)==0){this.assertBounds();return t}e=this.buf[this.pos++];t|=(e&127)<<14;if((e&128)==0){this.assertBounds();return t}e=this.buf[this.pos++];t|=(e&127)<<21;if((e&128)==0){this.assertBounds();return t}e=this.buf[this.pos++];t|=(e&15)<<28;for(let n=5;(e&128)!==0&&n<10;n++)e=this.buf[this.pos++];if((e&128)!=0)throw new Error("invalid varint");this.assertBounds();return t>>>0}var wT=oCr();function oCr(){const e=new DataView(new ArrayBuffer(8));const t=typeof BigInt==="function"&&typeof e.getBigInt64==="function"&&typeof e.getBigUint64==="function"&&typeof e.setBigInt64==="function"&&typeof e.setBigUint64==="function"&&(typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1");if(t){const n=BigInt("-9223372036854775808");const r=BigInt("9223372036854775807");const i=BigInt("0");const o=BigInt("18446744073709551615");return{zero:BigInt(0),supported:true,parse(a){const s=typeof a=="bigint"?a:BigInt(a);if(s>r||so||s>>0)}raw(t){if(this.buf.length){this.chunks.push(new Uint8Array(this.buf));this.buf=[]}this.chunks.push(t);return this}uint32(t){GCt(t);while(t>127){this.buf.push(t&127|128);t=t>>>7}this.buf.push(t);return this}int32(t){QBe(t);KBe(t,this.buf);return this}bool(t){this.buf.push(t?1:0);return this}bytes(t){this.uint32(t.byteLength);return this.raw(t)}string(t){let n=this.encodeUtf8(t);this.uint32(n.byteLength);return this.raw(n)}float(t){dCr(t);let n=new Uint8Array(4);new DataView(n.buffer).setFloat32(0,t,true);return this.raw(n)}double(t){let n=new Uint8Array(8);new DataView(n.buffer).setFloat64(0,t,true);return this.raw(n)}fixed32(t){GCt(t);let n=new Uint8Array(4);new DataView(n.buffer).setUint32(0,t,true);return this.raw(n)}sfixed32(t){QBe(t);let n=new Uint8Array(4);new DataView(n.buffer).setInt32(0,t,true);return this.raw(n)}sint32(t){QBe(t);t=(t<<1^t>>31)>>>0;KBe(t,this.buf);return this}sfixed64(t){let n=new Uint8Array(8),r=new DataView(n.buffer),i=wT.enc(t);r.setInt32(0,i.lo,true);r.setInt32(4,i.hi,true);return this.raw(n)}fixed64(t){let n=new Uint8Array(8),r=new DataView(n.buffer),i=wT.uEnc(t);r.setInt32(0,i.lo,true);r.setInt32(4,i.hi,true);return this.raw(n)}int64(t){let n=wT.enc(t);Pce(n.lo,n.hi,this.buf);return this}sint64(t){const n=wT.enc(t),r=n.hi>>31,i=n.lo<<1^r,o=(n.hi<<1|n.lo>>>31)^r;Pce(i,o,this.buf);return this}uint64(t){const n=wT.uEnc(t);Pce(n.lo,n.hi,this.buf);return this}};var Ue=class{constructor(t,n=JBe().decodeUtf8){this.decodeUtf8=n;this.varint64=OCt;this.uint32=UCt;this.buf=t;this.len=t.length;this.pos=0;this.view=new DataView(t.buffer,t.byteOffset,t.byteLength)}tag(){let t=this.uint32(),n=t>>>3,r=t&7;if(n<=0||r<0||r>5)throw new Error("illegal tag: field no "+n+" wire type "+r);return[n,r]}skip(t,n){let r=this.pos;switch(t){case FI.Varint:while(this.buf[this.pos++]&128){}break;case FI.Bit64:this.pos+=4;case FI.Bit32:this.pos+=4;break;case FI.LengthDelimited:let i=this.uint32();this.pos+=i;break;case FI.StartGroup:for(;;){const[o,a]=this.tag();if(a===FI.EndGroup){if(n!==void 0&&o!==n){throw new Error("invalid end group tag")}break}this.skip(a,o)}break;default:throw new Error("cant skip wire type "+t)}this.assertBounds();return this.buf.subarray(r,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)}int64(){return wT.dec(...this.varint64())}uint64(){return wT.uDec(...this.varint64())}sint64(){let[t,n]=this.varint64();let r=-(t&1);t=(t>>>1|(n&1)<<31)^r;n=n>>>1^r;return wT.dec(t,n)}bool(){let[t,n]=this.varint64();return t!==0||n!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,true)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,true)}fixed64(){return wT.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return wT.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,true)}double(){return this.view.getFloat64((this.pos+=8)-8,true)}bytes(){let t=this.uint32(),n=this.pos;this.pos+=t;this.assertBounds();return this.buf.subarray(n,n+t)}string(){return this.decodeUtf8(this.bytes())}};function QBe(e){if(typeof e=="string"){e=Number(e)}else if(typeof e!="number"){throw new Error("invalid int32: "+typeof e)}if(!Number.isInteger(e)||e>cCr||elCr||e<0)throw new Error("invalid uint32: "+e)}function dCr(e){if(typeof e=="string"){const t=e;e=Number(e);if(Number.isNaN(e)&&t!=="NaN"){throw new Error("invalid float32: "+t)}}else if(typeof e!="number"){throw new Error("invalid float32: "+typeof e)}if(Number.isFinite(e)&&(e>aCr||e{o[o["COLOR_TYPE_UNSPECIFIED"]=0]="COLOR_TYPE_UNSPECIFIED";o[o["COLOR_TYPE_RGB"]=1]="COLOR_TYPE_RGB";o[o["COLOR_TYPE_SCHEME"]=2]="COLOR_TYPE_SCHEME";o[o["COLOR_TYPE_SYSTEM"]=3]="COLOR_TYPE_SYSTEM";o[o["UNRECOGNIZED"]=-1]="UNRECOGNIZED";return o})(Zc||{});function HCt(){return{xEmu:void 0,yEmu:void 0,widthEmu:void 0,heightEmu:void 0,rotation:void 0,horizontalFlip:void 0,verticalFlip:void 0}}var $v={encode(e,t=new tn){if(e.xEmu!==void 0){t.uint32(8).int64(e.xEmu)}if(e.yEmu!==void 0){t.uint32(16).int64(e.yEmu)}if(e.widthEmu!==void 0){t.uint32(24).int64(e.widthEmu)}if(e.heightEmu!==void 0){t.uint32(32).int64(e.heightEmu)}if(e.rotation!==void 0){t.uint32(40).int32(e.rotation)}if(e.horizontalFlip!==void 0){t.uint32(48).bool(e.horizontalFlip)}if(e.verticalFlip!==void 0){t.uint32(56).bool(e.verticalFlip)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=HCt();while(n.pos>>3){case 1:{if(o!==8){break}i.xEmu=X2(n.int64());continue}case 2:{if(o!==16){break}i.yEmu=X2(n.int64());continue}case 3:{if(o!==24){break}i.widthEmu=X2(n.int64());continue}case 4:{if(o!==32){break}i.heightEmu=X2(n.int64());continue}case 5:{if(o!==40){break}i.rotation=n.int32();continue}case 6:{if(o!==48){break}i.horizontalFlip=n.bool();continue}case 7:{if(o!==56){break}i.verticalFlip=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return $v.fromPartial(e??{})},fromPartial(e){const t=HCt();t.xEmu=e.xEmu??void 0;t.yEmu=e.yEmu??void 0;t.widthEmu=e.widthEmu??void 0;t.heightEmu=e.heightEmu??void 0;t.rotation=e.rotation??void 0;t.horizontalFlip=e.horizontalFlip??void 0;t.verticalFlip=e.verticalFlip??void 0;return t}};function WCt(){return{tint:void 0,shade:void 0,lumMod:void 0,lumOff:void 0,satMod:void 0,alpha:void 0}}var NI={encode(e,t=new tn){if(e.tint!==void 0){t.uint32(8).int32(e.tint)}if(e.shade!==void 0){t.uint32(16).int32(e.shade)}if(e.lumMod!==void 0){t.uint32(24).int32(e.lumMod)}if(e.lumOff!==void 0){t.uint32(32).int32(e.lumOff)}if(e.satMod!==void 0){t.uint32(40).int32(e.satMod)}if(e.alpha!==void 0){t.uint32(48).int32(e.alpha)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=WCt();while(n.pos>>3){case 1:{if(o!==8){break}i.tint=n.int32();continue}case 2:{if(o!==16){break}i.shade=n.int32();continue}case 3:{if(o!==24){break}i.lumMod=n.int32();continue}case 4:{if(o!==32){break}i.lumOff=n.int32();continue}case 5:{if(o!==40){break}i.satMod=n.int32();continue}case 6:{if(o!==48){break}i.alpha=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return NI.fromPartial(e??{})},fromPartial(e){const t=WCt();t.tint=e.tint??void 0;t.shade=e.shade??void 0;t.lumMod=e.lumMod??void 0;t.lumOff=e.lumOff??void 0;t.satMod=e.satMod??void 0;t.alpha=e.alpha??void 0;return t}};function YCt(){return{type:0,value:"",transform:void 0,lastColor:void 0}}var hi={encode(e,t=new tn){if(e.type!==0){t.uint32(8).int32(e.type)}if(e.value!==""){t.uint32(18).string(e.value)}if(e.transform!==void 0){NI.encode(e.transform,t.uint32(26).fork()).join()}if(e.lastColor!==void 0){t.uint32(34).string(e.lastColor)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=YCt();while(n.pos>>3){case 1:{if(o!==8){break}i.type=n.int32();continue}case 2:{if(o!==18){break}i.value=n.string();continue}case 3:{if(o!==26){break}i.transform=NI.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.lastColor=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return hi.fromPartial(e??{})},fromPartial(e){const t=YCt();t.type=e.type??0;t.value=e.value??"";t.transform=e.transform!==void 0&&e.transform!==null?NI.fromPartial(e.transform):void 0;t.lastColor=e.lastColor??void 0;return t}};function qCt(){return{script:"",typeface:""}}var Ice={encode(e,t=new tn){if(e.script!==""){t.uint32(10).string(e.script)}if(e.typeface!==""){t.uint32(18).string(e.typeface)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=qCt();while(n.pos>>3){case 1:{if(o!==10){break}i.script=n.string();continue}case 2:{if(o!==18){break}i.typeface=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Ice.fromPartial(e??{})},fromPartial(e){const t=qCt();t.script=e.script??"";t.typeface=e.typeface??"";return t}};function XCt(){return{latinTypeface:void 0,eastAsianTypeface:void 0,complexScriptTypeface:void 0,supplementalFonts:[]}}var k4={encode(e,t=new tn){if(e.latinTypeface!==void 0){t.uint32(10).string(e.latinTypeface)}if(e.eastAsianTypeface!==void 0){t.uint32(18).string(e.eastAsianTypeface)}if(e.complexScriptTypeface!==void 0){t.uint32(26).string(e.complexScriptTypeface)}for(const n of e.supplementalFonts){Ice.encode(n,t.uint32(34).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=XCt();while(n.pos>>3){case 1:{if(o!==10){break}i.latinTypeface=n.string();continue}case 2:{if(o!==18){break}i.eastAsianTypeface=n.string();continue}case 3:{if(o!==26){break}i.complexScriptTypeface=n.string();continue}case 4:{if(o!==34){break}i.supplementalFonts.push(Ice.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return k4.fromPartial(e??{})},fromPartial(e){const t=XCt();t.latinTypeface=e.latinTypeface??void 0;t.eastAsianTypeface=e.eastAsianTypeface??void 0;t.complexScriptTypeface=e.complexScriptTypeface??void 0;t.supplementalFonts=e.supplementalFonts?.map(n=>Ice.fromPartial(n))||[];return t}};function jCt(){return{name:void 0,majorFont:void 0,minorFont:void 0}}var gX={encode(e,t=new tn){if(e.name!==void 0){t.uint32(10).string(e.name)}if(e.majorFont!==void 0){k4.encode(e.majorFont,t.uint32(18).fork()).join()}if(e.minorFont!==void 0){k4.encode(e.minorFont,t.uint32(26).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=jCt();while(n.pos>>3){case 1:{if(o!==10){break}i.name=n.string();continue}case 2:{if(o!==18){break}i.majorFont=k4.decode(n,n.uint32());continue}case 3:{if(o!==26){break}i.minorFont=k4.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return gX.fromPartial(e??{})},fromPartial(e){const t=jCt();t.name=e.name??void 0;t.majorFont=e.majorFont!==void 0&&e.majorFont!==null?k4.fromPartial(e.majorFont):void 0;t.minorFont=e.minorFont!==void 0&&e.minorFont!==null?k4.fromPartial(e.minorFont):void 0;return t}};function KCt(){return{ref:void 0,fill:void 0}}var BI={encode(e,t=new tn){if(e.ref!==void 0){Mce.encode(e.ref,t.uint32(18).fork()).join()}if(e.fill!==void 0){Ei.encode(e.fill,t.uint32(26).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=KCt();while(n.pos>>3){case 2:{if(o!==18){break}i.ref=Mce.decode(n,n.uint32());continue}case 3:{if(o!==26){break}i.fill=Ei.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return BI.fromPartial(e??{})},fromPartial(e){const t=KCt();t.ref=e.ref!==void 0&&e.ref!==null?Mce.fromPartial(e.ref):void 0;t.fill=e.fill!==void 0&&e.fill!==null?Ei.fromPartial(e.fill):void 0;return t}};function ZCt(){return{index:0,schemeColor:""}}var Mce={encode(e,t=new tn){if(e.index!==0){t.uint32(8).int32(e.index)}if(e.schemeColor!==""){t.uint32(18).string(e.schemeColor)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=ZCt();while(n.pos>>3){case 1:{if(o!==8){break}i.index=n.int32();continue}case 2:{if(o!==18){break}i.schemeColor=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Mce.fromPartial(e??{})},fromPartial(e){const t=ZCt();t.index=e.index??0;t.schemeColor=e.schemeColor??"";return t}};function JCt(){return{id:void 0,type:0,color:void 0,gradientStops:[],relId:void 0,gradientKind:void 0,angleDeg:void 0,isScaled:void 0,pathType:void 0,fillRect:void 0,gradientFlip:void 0,tileRect:void 0,imageReference:void 0,alphaModFix:void 0,lum:void 0,srcRect:void 0,stretchFillRect:void 0,tile:void 0,duotone:void 0,pattern:void 0,grayscale:void 0,rotateWithShape:void 0,pictureEffects:[]}}var Ei={encode(e,t=new tn){if(e.id!==void 0){t.uint32(82).string(e.id)}if(e.type!==0){t.uint32(8).int32(e.type)}if(e.color!==void 0){hi.encode(e.color,t.uint32(18).fork()).join()}for(const n of e.gradientStops){Bce.encode(n,t.uint32(26).fork()).join()}if(e.relId!==void 0){t.uint32(34).string(e.relId)}if(e.gradientKind!==void 0){t.uint32(40).int32(e.gradientKind)}if(e.angleDeg!==void 0){t.uint32(49).double(e.angleDeg)}if(e.isScaled!==void 0){t.uint32(56).bool(e.isScaled)}if(e.pathType!==void 0){t.uint32(64).int32(e.pathType)}if(e.fillRect!==void 0){f1.encode(e.fillRect,t.uint32(74).fork()).join()}if(e.gradientFlip!==void 0){t.uint32(176).int32(e.gradientFlip)}if(e.tileRect!==void 0){f1.encode(e.tileRect,t.uint32(186).fork()).join()}if(e.imageReference!==void 0){v0.encode(e.imageReference,t.uint32(90).fork()).join()}if(e.alphaModFix!==void 0){t.uint32(96).int32(e.alphaModFix)}if(e.lum!==void 0){t.uint32(104).bool(e.lum)}if(e.srcRect!==void 0){f1.encode(e.srcRect,t.uint32(114).fork()).join()}if(e.stretchFillRect!==void 0){f1.encode(e.stretchFillRect,t.uint32(122).fork()).join()}if(e.tile!==void 0){Lce.encode(e.tile,t.uint32(146).fork()).join()}if(e.duotone!==void 0){R4.encode(e.duotone,t.uint32(130).fork()).join()}if(e.pattern!==void 0){Dce.encode(e.pattern,t.uint32(138).fork()).join()}if(e.grayscale!==void 0){t.uint32(152).bool(e.grayscale)}if(e.rotateWithShape!==void 0){t.uint32(160).bool(e.rotateWithShape)}for(const n of e.pictureEffects){Oce.encode(n,t.uint32(170).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=JCt();while(n.pos>>3){case 10:{if(o!==82){break}i.id=n.string();continue}case 1:{if(o!==8){break}i.type=n.int32();continue}case 2:{if(o!==18){break}i.color=hi.decode(n,n.uint32());continue}case 3:{if(o!==26){break}i.gradientStops.push(Bce.decode(n,n.uint32()));continue}case 4:{if(o!==34){break}i.relId=n.string();continue}case 5:{if(o!==40){break}i.gradientKind=n.int32();continue}case 6:{if(o!==49){break}i.angleDeg=n.double();continue}case 7:{if(o!==56){break}i.isScaled=n.bool();continue}case 8:{if(o!==64){break}i.pathType=n.int32();continue}case 9:{if(o!==74){break}i.fillRect=f1.decode(n,n.uint32());continue}case 22:{if(o!==176){break}i.gradientFlip=n.int32();continue}case 23:{if(o!==186){break}i.tileRect=f1.decode(n,n.uint32());continue}case 11:{if(o!==90){break}i.imageReference=v0.decode(n,n.uint32());continue}case 12:{if(o!==96){break}i.alphaModFix=n.int32();continue}case 13:{if(o!==104){break}i.lum=n.bool();continue}case 14:{if(o!==114){break}i.srcRect=f1.decode(n,n.uint32());continue}case 15:{if(o!==122){break}i.stretchFillRect=f1.decode(n,n.uint32());continue}case 18:{if(o!==146){break}i.tile=Lce.decode(n,n.uint32());continue}case 16:{if(o!==130){break}i.duotone=R4.decode(n,n.uint32());continue}case 17:{if(o!==138){break}i.pattern=Dce.decode(n,n.uint32());continue}case 19:{if(o!==152){break}i.grayscale=n.bool();continue}case 20:{if(o!==160){break}i.rotateWithShape=n.bool();continue}case 21:{if(o!==170){break}i.pictureEffects.push(Oce.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Ei.fromPartial(e??{})},fromPartial(e){const t=JCt();t.id=e.id??void 0;t.type=e.type??0;t.color=e.color!==void 0&&e.color!==null?hi.fromPartial(e.color):void 0;t.gradientStops=e.gradientStops?.map(n=>Bce.fromPartial(n))||[];t.relId=e.relId??void 0;t.gradientKind=e.gradientKind??void 0;t.angleDeg=e.angleDeg??void 0;t.isScaled=e.isScaled??void 0;t.pathType=e.pathType??void 0;t.fillRect=e.fillRect!==void 0&&e.fillRect!==null?f1.fromPartial(e.fillRect):void 0;t.gradientFlip=e.gradientFlip??void 0;t.tileRect=e.tileRect!==void 0&&e.tileRect!==null?f1.fromPartial(e.tileRect):void 0;t.imageReference=e.imageReference!==void 0&&e.imageReference!==null?v0.fromPartial(e.imageReference):void 0;t.alphaModFix=e.alphaModFix??void 0;t.lum=e.lum??void 0;t.srcRect=e.srcRect!==void 0&&e.srcRect!==null?f1.fromPartial(e.srcRect):void 0;t.stretchFillRect=e.stretchFillRect!==void 0&&e.stretchFillRect!==null?f1.fromPartial(e.stretchFillRect):void 0;t.tile=e.tile!==void 0&&e.tile!==null?Lce.fromPartial(e.tile):void 0;t.duotone=e.duotone!==void 0&&e.duotone!==null?R4.fromPartial(e.duotone):void 0;t.pattern=e.pattern!==void 0&&e.pattern!==null?Dce.fromPartial(e.pattern):void 0;t.grayscale=e.grayscale??void 0;t.rotateWithShape=e.rotateWithShape??void 0;t.pictureEffects=e.pictureEffects?.map(n=>Oce.fromPartial(n))||[];return t}};function QCt(){return{offsetX:void 0,offsetY:void 0,scaleX:void 0,scaleY:void 0,flip:void 0,alignment:void 0}}var Lce={encode(e,t=new tn){if(e.offsetX!==void 0){t.uint32(8).int64(e.offsetX)}if(e.offsetY!==void 0){t.uint32(16).int64(e.offsetY)}if(e.scaleX!==void 0){t.uint32(24).int32(e.scaleX)}if(e.scaleY!==void 0){t.uint32(32).int32(e.scaleY)}if(e.flip!==void 0){t.uint32(42).string(e.flip)}if(e.alignment!==void 0){t.uint32(50).string(e.alignment)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=QCt();while(n.pos>>3){case 1:{if(o!==8){break}i.offsetX=X2(n.int64());continue}case 2:{if(o!==16){break}i.offsetY=X2(n.int64());continue}case 3:{if(o!==24){break}i.scaleX=n.int32();continue}case 4:{if(o!==32){break}i.scaleY=n.int32();continue}case 5:{if(o!==42){break}i.flip=n.string();continue}case 6:{if(o!==50){break}i.alignment=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Lce.fromPartial(e??{})},fromPartial(e){const t=QCt();t.offsetX=e.offsetX??void 0;t.offsetY=e.offsetY??void 0;t.scaleX=e.scaleX??void 0;t.scaleY=e.scaleY??void 0;t.flip=e.flip??void 0;t.alignment=e.alignment??void 0;return t}};function eSt(){return{patternType:0,color:void 0,preset:void 0}}var Dce={encode(e,t=new tn){if(e.patternType!==0){t.uint32(8).int32(e.patternType)}if(e.color!==void 0){hi.encode(e.color,t.uint32(26).fork()).join()}if(e.preset!==void 0){t.uint32(34).string(e.preset)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=eSt();while(n.pos>>3){case 1:{if(o!==8){break}i.patternType=n.int32();continue}case 3:{if(o!==26){break}i.color=hi.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.preset=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Dce.fromPartial(e??{})},fromPartial(e){const t=eSt();t.patternType=e.patternType??0;t.color=e.color!==void 0&&e.color!==null?hi.fromPartial(e.color):void 0;t.preset=e.preset??void 0;return t}};function tSt(){return{id:""}}var v0={encode(e,t=new tn){if(e.id!==""){t.uint32(10).string(e.id)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=tSt();while(n.pos>>3){case 1:{if(o!==10){break}i.id=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return v0.fromPartial(e??{})},fromPartial(e){const t=tSt();t.id=e.id??"";return t}};function nSt(){return{darkColor:void 0,lightColor:void 0}}var R4={encode(e,t=new tn){if(e.darkColor!==void 0){hi.encode(e.darkColor,t.uint32(10).fork()).join()}if(e.lightColor!==void 0){hi.encode(e.lightColor,t.uint32(18).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=nSt();while(n.pos>>3){case 1:{if(o!==10){break}i.darkColor=hi.decode(n,n.uint32());continue}case 2:{if(o!==18){break}i.lightColor=hi.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return R4.fromPartial(e??{})},fromPartial(e){const t=nSt();t.darkColor=e.darkColor!==void 0&&e.darkColor!==null?hi.fromPartial(e.darkColor):void 0;t.lightColor=e.lightColor!==void 0&&e.lightColor!==null?hi.fromPartial(e.lightColor):void 0;return t}};function rSt(){return{brightness:void 0,contrast:void 0}}var Fce={encode(e,t=new tn){if(e.brightness!==void 0){t.uint32(8).int32(e.brightness)}if(e.contrast!==void 0){t.uint32(16).int32(e.contrast)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=rSt();while(n.pos>>3){case 1:{if(o!==8){break}i.brightness=n.int32();continue}case 2:{if(o!==16){break}i.contrast=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Fce.fromPartial(e??{})},fromPartial(e){const t=rSt();t.brightness=e.brightness??void 0;t.contrast=e.contrast??void 0;return t}};function iSt(){return{fromColor:void 0,toColor:void 0,useAlpha:void 0}}var Nce={encode(e,t=new tn){if(e.fromColor!==void 0){hi.encode(e.fromColor,t.uint32(10).fork()).join()}if(e.toColor!==void 0){hi.encode(e.toColor,t.uint32(18).fork()).join()}if(e.useAlpha!==void 0){t.uint32(24).bool(e.useAlpha)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=iSt();while(n.pos>>3){case 1:{if(o!==10){break}i.fromColor=hi.decode(n,n.uint32());continue}case 2:{if(o!==18){break}i.toColor=hi.decode(n,n.uint32());continue}case 3:{if(o!==24){break}i.useAlpha=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Nce.fromPartial(e??{})},fromPartial(e){const t=iSt();t.fromColor=e.fromColor!==void 0&&e.fromColor!==null?hi.fromPartial(e.fromColor):void 0;t.toColor=e.toColor!==void 0&&e.toColor!==null?hi.fromPartial(e.toColor):void 0;t.useAlpha=e.useAlpha??void 0;return t}};function oSt(){return{type:0,alphaModFix:void 0,luminance:void 0,duotone:void 0,biLevelThreshold:void 0,colorChange:void 0}}var Oce={encode(e,t=new tn){if(e.type!==0){t.uint32(8).int32(e.type)}if(e.alphaModFix!==void 0){t.uint32(16).int32(e.alphaModFix)}if(e.luminance!==void 0){Fce.encode(e.luminance,t.uint32(26).fork()).join()}if(e.duotone!==void 0){R4.encode(e.duotone,t.uint32(34).fork()).join()}if(e.biLevelThreshold!==void 0){t.uint32(40).int32(e.biLevelThreshold)}if(e.colorChange!==void 0){Nce.encode(e.colorChange,t.uint32(50).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=oSt();while(n.pos>>3){case 1:{if(o!==8){break}i.type=n.int32();continue}case 2:{if(o!==16){break}i.alphaModFix=n.int32();continue}case 3:{if(o!==26){break}i.luminance=Fce.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.duotone=R4.decode(n,n.uint32());continue}case 5:{if(o!==40){break}i.biLevelThreshold=n.int32();continue}case 6:{if(o!==50){break}i.colorChange=Nce.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Oce.fromPartial(e??{})},fromPartial(e){const t=oSt();t.type=e.type??0;t.alphaModFix=e.alphaModFix??void 0;t.luminance=e.luminance!==void 0&&e.luminance!==null?Fce.fromPartial(e.luminance):void 0;t.duotone=e.duotone!==void 0&&e.duotone!==null?R4.fromPartial(e.duotone):void 0;t.biLevelThreshold=e.biLevelThreshold??void 0;t.colorChange=e.colorChange!==void 0&&e.colorChange!==null?Nce.fromPartial(e.colorChange):void 0;return t}};function aSt(){return{position:void 0,color:void 0}}var Bce={encode(e,t=new tn){if(e.position!==void 0){t.uint32(8).int32(e.position)}if(e.color!==void 0){hi.encode(e.color,t.uint32(18).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=aSt();while(n.pos>>3){case 1:{if(o!==8){break}i.position=n.int32();continue}case 2:{if(o!==18){break}i.color=hi.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Bce.fromPartial(e??{})},fromPartial(e){const t=aSt();t.position=e.position??void 0;t.color=e.color!==void 0&&e.color!==null?hi.fromPartial(e.color):void 0;return t}};function sSt(){return{noAutofit:void 0,normalAutoFit:void 0,shapeAutoFit:void 0}}var OI={encode(e,t=new tn){if(e.noAutofit!==void 0){zce.encode(e.noAutofit,t.uint32(10).fork()).join()}if(e.normalAutoFit!==void 0){Vce.encode(e.normalAutoFit,t.uint32(18).fork()).join()}if(e.shapeAutoFit!==void 0){Uce.encode(e.shapeAutoFit,t.uint32(26).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=sSt();while(n.pos>>3){case 1:{if(o!==10){break}i.noAutofit=zce.decode(n,n.uint32());continue}case 2:{if(o!==18){break}i.normalAutoFit=Vce.decode(n,n.uint32());continue}case 3:{if(o!==26){break}i.shapeAutoFit=Uce.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return OI.fromPartial(e??{})},fromPartial(e){const t=sSt();t.noAutofit=e.noAutofit!==void 0&&e.noAutofit!==null?zce.fromPartial(e.noAutofit):void 0;t.normalAutoFit=e.normalAutoFit!==void 0&&e.normalAutoFit!==null?Vce.fromPartial(e.normalAutoFit):void 0;t.shapeAutoFit=e.shapeAutoFit!==void 0&&e.shapeAutoFit!==null?Uce.fromPartial(e.shapeAutoFit):void 0;return t}};function lSt(){return{}}var zce={encode(e,t=new tn){return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=lSt();while(n.pos>>3){}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return zce.fromPartial(e??{})},fromPartial(e){const t=lSt();return t}};function cSt(){return{}}var Uce={encode(e,t=new tn){return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=cSt();while(n.pos>>3){}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Uce.fromPartial(e??{})},fromPartial(e){const t=cSt();return t}};function uSt(){return{fontScale:void 0,lineSpaceReduction:void 0}}var Vce={encode(e,t=new tn){if(e.fontScale!==void 0){t.uint32(8).int32(e.fontScale)}if(e.lineSpaceReduction!==void 0){t.uint32(16).int32(e.lineSpaceReduction)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=uSt();while(n.pos>>3){case 1:{if(o!==8){break}i.fontScale=n.int32();continue}case 2:{if(o!==16){break}i.lineSpaceReduction=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Vce.fromPartial(e??{})},fromPartial(e){const t=uSt();t.fontScale=e.fontScale??void 0;t.lineSpaceReduction=e.lineSpaceReduction??void 0;return t}};function dSt(){return{anchor:void 0,vertical:void 0,rotation:void 0,bold:void 0,italic:void 0,fontSize:void 0,fill:void 0,alignment:void 0,underline:void 0,bottomInset:void 0,leftInset:void 0,rightInset:void 0,topInset:void 0,useParagraphSpacing:void 0,name:void 0,family:void 0,scheme:void 0,typeface:void 0,characterSpacing:void 0,wrap:void 0,autoFit:void 0,outline:void 0,shadow:void 0,capitalization:void 0,highlight:void 0,columnCount:void 0,columnSpacing:void 0,rightToLeftColumns:void 0,baseline:void 0,anchorCenter:void 0,kerningMinimumFontSize:void 0}}var Gi={encode(e,t=new tn){if(e.anchor!==void 0){t.uint32(8).int32(e.anchor)}if(e.vertical!==void 0){t.uint32(16).int32(e.vertical)}if(e.rotation!==void 0){t.uint32(24).int32(e.rotation)}if(e.bold!==void 0){t.uint32(32).bool(e.bold)}if(e.italic!==void 0){t.uint32(40).bool(e.italic)}if(e.fontSize!==void 0){t.uint32(48).int32(e.fontSize)}if(e.fill!==void 0){Ei.encode(e.fill,t.uint32(58).fork()).join()}if(e.alignment!==void 0){t.uint32(64).int32(e.alignment)}if(e.underline!==void 0){t.uint32(74).string(e.underline)}if(e.bottomInset!==void 0){t.uint32(80).int32(e.bottomInset)}if(e.leftInset!==void 0){t.uint32(88).int32(e.leftInset)}if(e.rightInset!==void 0){t.uint32(96).int32(e.rightInset)}if(e.topInset!==void 0){t.uint32(104).int32(e.topInset)}if(e.useParagraphSpacing!==void 0){t.uint32(112).bool(e.useParagraphSpacing)}if(e.name!==void 0){t.uint32(122).string(e.name)}if(e.family!==void 0){t.uint32(128).int32(e.family)}if(e.scheme!==void 0){t.uint32(138).string(e.scheme)}if(e.typeface!==void 0){t.uint32(146).string(e.typeface)}if(e.characterSpacing!==void 0){t.uint32(152).int32(e.characterSpacing)}if(e.wrap!==void 0){t.uint32(160).int32(e.wrap)}if(e.autoFit!==void 0){OI.encode(e.autoFit,t.uint32(170).fork()).join()}if(e.outline!==void 0){ui.encode(e.outline,t.uint32(178).fork()).join()}if(e.shadow!==void 0){$ce.encode(e.shadow,t.uint32(186).fork()).join()}if(e.capitalization!==void 0){t.uint32(192).int32(e.capitalization)}if(e.highlight!==void 0){hi.encode(e.highlight,t.uint32(202).fork()).join()}if(e.columnCount!==void 0){t.uint32(208).int32(e.columnCount)}if(e.columnSpacing!==void 0){t.uint32(216).int32(e.columnSpacing)}if(e.rightToLeftColumns!==void 0){t.uint32(224).bool(e.rightToLeftColumns)}if(e.baseline!==void 0){t.uint32(232).int32(e.baseline)}if(e.anchorCenter!==void 0){t.uint32(240).bool(e.anchorCenter)}if(e.kerningMinimumFontSize!==void 0){t.uint32(248).int32(e.kerningMinimumFontSize)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=dSt();while(n.pos>>3){case 1:{if(o!==8){break}i.anchor=n.int32();continue}case 2:{if(o!==16){break}i.vertical=n.int32();continue}case 3:{if(o!==24){break}i.rotation=n.int32();continue}case 4:{if(o!==32){break}i.bold=n.bool();continue}case 5:{if(o!==40){break}i.italic=n.bool();continue}case 6:{if(o!==48){break}i.fontSize=n.int32();continue}case 7:{if(o!==58){break}i.fill=Ei.decode(n,n.uint32());continue}case 8:{if(o!==64){break}i.alignment=n.int32();continue}case 9:{if(o!==74){break}i.underline=n.string();continue}case 10:{if(o!==80){break}i.bottomInset=n.int32();continue}case 11:{if(o!==88){break}i.leftInset=n.int32();continue}case 12:{if(o!==96){break}i.rightInset=n.int32();continue}case 13:{if(o!==104){break}i.topInset=n.int32();continue}case 14:{if(o!==112){break}i.useParagraphSpacing=n.bool();continue}case 15:{if(o!==122){break}i.name=n.string();continue}case 16:{if(o!==128){break}i.family=n.int32();continue}case 17:{if(o!==138){break}i.scheme=n.string();continue}case 18:{if(o!==146){break}i.typeface=n.string();continue}case 19:{if(o!==152){break}i.characterSpacing=n.int32();continue}case 20:{if(o!==160){break}i.wrap=n.int32();continue}case 21:{if(o!==170){break}i.autoFit=OI.decode(n,n.uint32());continue}case 22:{if(o!==178){break}i.outline=ui.decode(n,n.uint32());continue}case 23:{if(o!==186){break}i.shadow=$ce.decode(n,n.uint32());continue}case 24:{if(o!==192){break}i.capitalization=n.int32();continue}case 25:{if(o!==202){break}i.highlight=hi.decode(n,n.uint32());continue}case 26:{if(o!==208){break}i.columnCount=n.int32();continue}case 27:{if(o!==216){break}i.columnSpacing=n.int32();continue}case 28:{if(o!==224){break}i.rightToLeftColumns=n.bool();continue}case 29:{if(o!==232){break}i.baseline=n.int32();continue}case 30:{if(o!==240){break}i.anchorCenter=n.bool();continue}case 31:{if(o!==248){break}i.kerningMinimumFontSize=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Gi.fromPartial(e??{})},fromPartial(e){const t=dSt();t.anchor=e.anchor??void 0;t.vertical=e.vertical??void 0;t.rotation=e.rotation??void 0;t.bold=e.bold??void 0;t.italic=e.italic??void 0;t.fontSize=e.fontSize??void 0;t.fill=e.fill!==void 0&&e.fill!==null?Ei.fromPartial(e.fill):void 0;t.alignment=e.alignment??void 0;t.underline=e.underline??void 0;t.bottomInset=e.bottomInset??void 0;t.leftInset=e.leftInset??void 0;t.rightInset=e.rightInset??void 0;t.topInset=e.topInset??void 0;t.useParagraphSpacing=e.useParagraphSpacing??void 0;t.name=e.name??void 0;t.family=e.family??void 0;t.scheme=e.scheme??void 0;t.typeface=e.typeface??void 0;t.characterSpacing=e.characterSpacing??void 0;t.wrap=e.wrap??void 0;t.autoFit=e.autoFit!==void 0&&e.autoFit!==null?OI.fromPartial(e.autoFit):void 0;t.outline=e.outline!==void 0&&e.outline!==null?ui.fromPartial(e.outline):void 0;t.shadow=e.shadow!==void 0&&e.shadow!==null?$ce.fromPartial(e.shadow):void 0;t.capitalization=e.capitalization??void 0;t.highlight=e.highlight!==void 0&&e.highlight!==null?hi.fromPartial(e.highlight):void 0;t.columnCount=e.columnCount??void 0;t.columnSpacing=e.columnSpacing??void 0;t.rightToLeftColumns=e.rightToLeftColumns??void 0;t.baseline=e.baseline??void 0;t.anchorCenter=e.anchorCenter??void 0;t.kerningMinimumFontSize=e.kerningMinimumFontSize??void 0;return t}};function fSt(){return{color:void 0,blurRadius:void 0,distance:void 0,direction:void 0,alignment:void 0,rotateWithShape:void 0,alignmentType:void 0}}var $ce={encode(e,t=new tn){if(e.color!==void 0){hi.encode(e.color,t.uint32(10).fork()).join()}if(e.blurRadius!==void 0){t.uint32(16).int32(e.blurRadius)}if(e.distance!==void 0){t.uint32(24).int32(e.distance)}if(e.direction!==void 0){t.uint32(32).int32(e.direction)}if(e.alignment!==void 0){t.uint32(42).string(e.alignment)}if(e.rotateWithShape!==void 0){t.uint32(48).bool(e.rotateWithShape)}if(e.alignmentType!==void 0){t.uint32(56).int32(e.alignmentType)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=fSt();while(n.pos>>3){case 1:{if(o!==10){break}i.color=hi.decode(n,n.uint32());continue}case 2:{if(o!==16){break}i.blurRadius=n.int32();continue}case 3:{if(o!==24){break}i.distance=n.int32();continue}case 4:{if(o!==32){break}i.direction=n.int32();continue}case 5:{if(o!==42){break}i.alignment=n.string();continue}case 6:{if(o!==48){break}i.rotateWithShape=n.bool();continue}case 7:{if(o!==56){break}i.alignmentType=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return $ce.fromPartial(e??{})},fromPartial(e){const t=fSt();t.color=e.color!==void 0&&e.color!==null?hi.fromPartial(e.color):void 0;t.blurRadius=e.blurRadius??void 0;t.distance=e.distance??void 0;t.direction=e.direction??void 0;t.alignment=e.alignment??void 0;t.rotateWithShape=e.rotateWithShape??void 0;t.alignmentType=e.alignmentType??void 0;return t}};function hSt(){return{color:void 0,blurRadius:void 0,distance:void 0,direction:void 0,alignment:void 0,rotateWithShape:void 0,horizontalScale:void 0,verticalScale:void 0,horizontalSkew:void 0,verticalSkew:void 0,alignmentType:void 0}}var DA={encode(e,t=new tn){if(e.color!==void 0){hi.encode(e.color,t.uint32(18).fork()).join()}if(e.blurRadius!==void 0){t.uint32(24).int32(e.blurRadius)}if(e.distance!==void 0){t.uint32(32).int32(e.distance)}if(e.direction!==void 0){t.uint32(40).int32(e.direction)}if(e.alignment!==void 0){t.uint32(50).string(e.alignment)}if(e.rotateWithShape!==void 0){t.uint32(56).bool(e.rotateWithShape)}if(e.horizontalScale!==void 0){t.uint32(64).int32(e.horizontalScale)}if(e.verticalScale!==void 0){t.uint32(72).int32(e.verticalScale)}if(e.horizontalSkew!==void 0){t.uint32(80).int32(e.horizontalSkew)}if(e.verticalSkew!==void 0){t.uint32(88).int32(e.verticalSkew)}if(e.alignmentType!==void 0){t.uint32(96).int32(e.alignmentType)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=hSt();while(n.pos>>3){case 2:{if(o!==18){break}i.color=hi.decode(n,n.uint32());continue}case 3:{if(o!==24){break}i.blurRadius=n.int32();continue}case 4:{if(o!==32){break}i.distance=n.int32();continue}case 5:{if(o!==40){break}i.direction=n.int32();continue}case 6:{if(o!==50){break}i.alignment=n.string();continue}case 7:{if(o!==56){break}i.rotateWithShape=n.bool();continue}case 8:{if(o!==64){break}i.horizontalScale=n.int32();continue}case 9:{if(o!==72){break}i.verticalScale=n.int32();continue}case 10:{if(o!==80){break}i.horizontalSkew=n.int32();continue}case 11:{if(o!==88){break}i.verticalSkew=n.int32();continue}case 12:{if(o!==96){break}i.alignmentType=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return DA.fromPartial(e??{})},fromPartial(e){const t=hSt();t.color=e.color!==void 0&&e.color!==null?hi.fromPartial(e.color):void 0;t.blurRadius=e.blurRadius??void 0;t.distance=e.distance??void 0;t.direction=e.direction??void 0;t.alignment=e.alignment??void 0;t.rotateWithShape=e.rotateWithShape??void 0;t.horizontalScale=e.horizontalScale??void 0;t.verticalScale=e.verticalScale??void 0;t.horizontalSkew=e.horizontalSkew??void 0;t.verticalSkew=e.verticalSkew??void 0;t.alignmentType=e.alignmentType??void 0;return t}};function pSt(){return{position:void 0,alignment:void 0,leader:void 0}}var Gce={encode(e,t=new tn){if(e.position!==void 0){t.uint32(8).int32(e.position)}if(e.alignment!==void 0){t.uint32(16).int32(e.alignment)}if(e.leader!==void 0){t.uint32(26).string(e.leader)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=pSt();while(n.pos>>3){case 1:{if(o!==8){break}i.position=n.int32();continue}case 2:{if(o!==16){break}i.alignment=n.int32();continue}case 3:{if(o!==26){break}i.leader=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Gce.fromPartial(e??{})},fromPartial(e){const t=pSt();t.position=e.position??void 0;t.alignment=e.alignment??void 0;t.leader=e.leader??void 0;return t}};function mSt(){return{top:void 0,right:void 0,bottom:void 0,left:void 0}}var Hce={encode(e,t=new tn){if(e.top!==void 0){ui.encode(e.top,t.uint32(10).fork()).join()}if(e.right!==void 0){ui.encode(e.right,t.uint32(18).fork()).join()}if(e.bottom!==void 0){ui.encode(e.bottom,t.uint32(26).fork()).join()}if(e.left!==void 0){ui.encode(e.left,t.uint32(34).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=mSt();while(n.pos>>3){case 1:{if(o!==10){break}i.top=ui.decode(n,n.uint32());continue}case 2:{if(o!==18){break}i.right=ui.decode(n,n.uint32());continue}case 3:{if(o!==26){break}i.bottom=ui.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.left=ui.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Hce.fromPartial(e??{})},fromPartial(e){const t=mSt();t.top=e.top!==void 0&&e.top!==null?ui.fromPartial(e.top):void 0;t.right=e.right!==void 0&&e.right!==null?ui.fromPartial(e.right):void 0;t.bottom=e.bottom!==void 0&&e.bottom!==null?ui.fromPartial(e.bottom):void 0;t.left=e.left!==void 0&&e.left!==null?ui.fromPartial(e.left):void 0;return t}};function gSt(){return{bulletCharacter:void 0,marginLeft:void 0,indent:void 0,lineSpacingPercent:void 0,lineSpacingPoints:void 0,autoNumberType:void 0,autoNumberStartAt:void 0,outlineLevel:void 0,tabStops:[],borders:void 0,fill:void 0,snapToGrid:void 0,bulletTypeface:void 0,bulletTypefaceFollowsText:void 0,bulletColor:void 0,bulletColorFollowsText:void 0,bulletSizePercent:void 0,bulletSizePoints:void 0,bulletSizeFollowsText:void 0,marginRight:void 0,spaceBeforePercent:void 0,spaceBeforePoints:void 0,spaceAfterPercent:void 0,spaceAfterPoints:void 0,defaultTabSize:void 0}}var Xd={encode(e,t=new tn){if(e.bulletCharacter!==void 0){t.uint32(10).string(e.bulletCharacter)}if(e.marginLeft!==void 0){t.uint32(16).int32(e.marginLeft)}if(e.indent!==void 0){t.uint32(24).int32(e.indent)}if(e.lineSpacingPercent!==void 0){t.uint32(32).int32(e.lineSpacingPercent)}if(e.lineSpacingPoints!==void 0){t.uint32(40).int32(e.lineSpacingPoints)}if(e.autoNumberType!==void 0){t.uint32(50).string(e.autoNumberType)}if(e.autoNumberStartAt!==void 0){t.uint32(56).int32(e.autoNumberStartAt)}if(e.outlineLevel!==void 0){t.uint32(64).int32(e.outlineLevel)}for(const n of e.tabStops){Gce.encode(n,t.uint32(74).fork()).join()}if(e.borders!==void 0){Hce.encode(e.borders,t.uint32(82).fork()).join()}if(e.fill!==void 0){Ei.encode(e.fill,t.uint32(90).fork()).join()}if(e.snapToGrid!==void 0){t.uint32(96).bool(e.snapToGrid)}if(e.bulletTypeface!==void 0){t.uint32(106).string(e.bulletTypeface)}if(e.bulletTypefaceFollowsText!==void 0){t.uint32(248).bool(e.bulletTypefaceFollowsText)}if(e.bulletColor!==void 0){hi.encode(e.bulletColor,t.uint32(114).fork()).join()}if(e.bulletColorFollowsText!==void 0){t.uint32(256).bool(e.bulletColorFollowsText)}if(e.bulletSizePercent!==void 0){t.uint32(120).int32(e.bulletSizePercent)}if(e.bulletSizePoints!==void 0){t.uint32(128).int32(e.bulletSizePoints)}if(e.bulletSizeFollowsText!==void 0){t.uint32(264).bool(e.bulletSizeFollowsText)}if(e.marginRight!==void 0){t.uint32(136).int32(e.marginRight)}if(e.spaceBeforePercent!==void 0){t.uint32(144).int32(e.spaceBeforePercent)}if(e.spaceBeforePoints!==void 0){t.uint32(232).int32(e.spaceBeforePoints)}if(e.spaceAfterPercent!==void 0){t.uint32(152).int32(e.spaceAfterPercent)}if(e.spaceAfterPoints!==void 0){t.uint32(240).int32(e.spaceAfterPoints)}if(e.defaultTabSize!==void 0){t.uint32(216).int32(e.defaultTabSize)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=gSt();while(n.pos>>3){case 1:{if(o!==10){break}i.bulletCharacter=n.string();continue}case 2:{if(o!==16){break}i.marginLeft=n.int32();continue}case 3:{if(o!==24){break}i.indent=n.int32();continue}case 4:{if(o!==32){break}i.lineSpacingPercent=n.int32();continue}case 5:{if(o!==40){break}i.lineSpacingPoints=n.int32();continue}case 6:{if(o!==50){break}i.autoNumberType=n.string();continue}case 7:{if(o!==56){break}i.autoNumberStartAt=n.int32();continue}case 8:{if(o!==64){break}i.outlineLevel=n.int32();continue}case 9:{if(o!==74){break}i.tabStops.push(Gce.decode(n,n.uint32()));continue}case 10:{if(o!==82){break}i.borders=Hce.decode(n,n.uint32());continue}case 11:{if(o!==90){break}i.fill=Ei.decode(n,n.uint32());continue}case 12:{if(o!==96){break}i.snapToGrid=n.bool();continue}case 13:{if(o!==106){break}i.bulletTypeface=n.string();continue}case 31:{if(o!==248){break}i.bulletTypefaceFollowsText=n.bool();continue}case 14:{if(o!==114){break}i.bulletColor=hi.decode(n,n.uint32());continue}case 32:{if(o!==256){break}i.bulletColorFollowsText=n.bool();continue}case 15:{if(o!==120){break}i.bulletSizePercent=n.int32();continue}case 16:{if(o!==128){break}i.bulletSizePoints=n.int32();continue}case 33:{if(o!==264){break}i.bulletSizeFollowsText=n.bool();continue}case 17:{if(o!==136){break}i.marginRight=n.int32();continue}case 18:{if(o!==144){break}i.spaceBeforePercent=n.int32();continue}case 29:{if(o!==232){break}i.spaceBeforePoints=n.int32();continue}case 19:{if(o!==152){break}i.spaceAfterPercent=n.int32();continue}case 30:{if(o!==240){break}i.spaceAfterPoints=n.int32();continue}case 27:{if(o!==216){break}i.defaultTabSize=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Xd.fromPartial(e??{})},fromPartial(e){const t=gSt();t.bulletCharacter=e.bulletCharacter??void 0;t.marginLeft=e.marginLeft??void 0;t.indent=e.indent??void 0;t.lineSpacingPercent=e.lineSpacingPercent??void 0;t.lineSpacingPoints=e.lineSpacingPoints??void 0;t.autoNumberType=e.autoNumberType??void 0;t.autoNumberStartAt=e.autoNumberStartAt??void 0;t.outlineLevel=e.outlineLevel??void 0;t.tabStops=e.tabStops?.map(n=>Gce.fromPartial(n))||[];t.borders=e.borders!==void 0&&e.borders!==null?Hce.fromPartial(e.borders):void 0;t.fill=e.fill!==void 0&&e.fill!==null?Ei.fromPartial(e.fill):void 0;t.snapToGrid=e.snapToGrid??void 0;t.bulletTypeface=e.bulletTypeface??void 0;t.bulletTypefaceFollowsText=e.bulletTypefaceFollowsText??void 0;t.bulletColor=e.bulletColor!==void 0&&e.bulletColor!==null?hi.fromPartial(e.bulletColor):void 0;t.bulletColorFollowsText=e.bulletColorFollowsText??void 0;t.bulletSizePercent=e.bulletSizePercent??void 0;t.bulletSizePoints=e.bulletSizePoints??void 0;t.bulletSizeFollowsText=e.bulletSizeFollowsText??void 0;t.marginRight=e.marginRight??void 0;t.spaceBeforePercent=e.spaceBeforePercent??void 0;t.spaceBeforePoints=e.spaceBeforePoints??void 0;t.spaceAfterPercent=e.spaceAfterPercent??void 0;t.spaceAfterPoints=e.spaceAfterPoints??void 0;t.defaultTabSize=e.defaultTabSize??void 0;return t}};function ySt(){return{id:"",name:"",description:void 0,textStyle:void 0,paragraphStyle:void 0,basedOn:void 0,tags:[],nextId:void 0,spaceBefore:void 0,spaceAfter:void 0,type:void 0}}var h1={encode(e,t=new tn){if(e.id!==""){t.uint32(10).string(e.id)}if(e.name!==""){t.uint32(18).string(e.name)}if(e.description!==void 0){t.uint32(26).string(e.description)}if(e.textStyle!==void 0){Gi.encode(e.textStyle,t.uint32(34).fork()).join()}if(e.paragraphStyle!==void 0){Xd.encode(e.paragraphStyle,t.uint32(42).fork()).join()}if(e.basedOn!==void 0){t.uint32(50).string(e.basedOn)}for(const n of e.tags){t.uint32(58).string(n)}if(e.nextId!==void 0){t.uint32(66).string(e.nextId)}if(e.spaceBefore!==void 0){t.uint32(72).int32(e.spaceBefore)}if(e.spaceAfter!==void 0){t.uint32(80).int32(e.spaceAfter)}if(e.type!==void 0){t.uint32(88).int32(e.type)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=ySt();while(n.pos>>3){case 1:{if(o!==10){break}i.id=n.string();continue}case 2:{if(o!==18){break}i.name=n.string();continue}case 3:{if(o!==26){break}i.description=n.string();continue}case 4:{if(o!==34){break}i.textStyle=Gi.decode(n,n.uint32());continue}case 5:{if(o!==42){break}i.paragraphStyle=Xd.decode(n,n.uint32());continue}case 6:{if(o!==50){break}i.basedOn=n.string();continue}case 7:{if(o!==58){break}i.tags.push(n.string());continue}case 8:{if(o!==66){break}i.nextId=n.string();continue}case 9:{if(o!==72){break}i.spaceBefore=n.int32();continue}case 10:{if(o!==80){break}i.spaceAfter=n.int32();continue}case 11:{if(o!==88){break}i.type=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return h1.fromPartial(e??{})},fromPartial(e){const t=ySt();t.id=e.id??"";t.name=e.name??"";t.description=e.description??void 0;t.textStyle=e.textStyle!==void 0&&e.textStyle!==null?Gi.fromPartial(e.textStyle):void 0;t.paragraphStyle=e.paragraphStyle!==void 0&&e.paragraphStyle!==null?Xd.fromPartial(e.paragraphStyle):void 0;t.basedOn=e.basedOn??void 0;t.tags=e.tags?.map(n=>n)||[];t.nextId=e.nextId??void 0;t.spaceBefore=e.spaceBefore??void 0;t.spaceAfter=e.spaceAfter??void 0;t.type=e.type??void 0;return t}};function bSt(){return{id:"",type:0,author:void 0,initials:void 0,createdAt:void 0}}var yX={encode(e,t=new tn){if(e.id!==""){t.uint32(10).string(e.id)}if(e.type!==0){t.uint32(16).int32(e.type)}if(e.author!==void 0){t.uint32(26).string(e.author)}if(e.initials!==void 0){t.uint32(34).string(e.initials)}if(e.createdAt!==void 0){t.uint32(42).string(e.createdAt)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=bSt();while(n.pos>>3){case 1:{if(o!==10){break}i.id=n.string();continue}case 2:{if(o!==16){break}i.type=n.int32();continue}case 3:{if(o!==26){break}i.author=n.string();continue}case 4:{if(o!==34){break}i.initials=n.string();continue}case 5:{if(o!==42){break}i.createdAt=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return yX.fromPartial(e??{})},fromPartial(e){const t=bSt();t.id=e.id??"";t.type=e.type??0;t.author=e.author??void 0;t.initials=e.initials??void 0;t.createdAt=e.createdAt??void 0;return t}};function xSt(){return{id:void 0,level:0,textStyle:void 0,paragraphStyle:void 0,spaceBefore:void 0,spaceAfter:void 0}}var Lh={encode(e,t=new tn){if(e.id!==void 0){t.uint32(10).string(e.id)}if(e.level!==0){t.uint32(16).int32(e.level)}if(e.textStyle!==void 0){Gi.encode(e.textStyle,t.uint32(26).fork()).join()}if(e.paragraphStyle!==void 0){Xd.encode(e.paragraphStyle,t.uint32(34).fork()).join()}if(e.spaceBefore!==void 0){t.uint32(40).int32(e.spaceBefore)}if(e.spaceAfter!==void 0){t.uint32(48).int32(e.spaceAfter)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=xSt();while(n.pos>>3){case 1:{if(o!==10){break}i.id=n.string();continue}case 2:{if(o!==16){break}i.level=n.int32();continue}case 3:{if(o!==26){break}i.textStyle=Gi.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.paragraphStyle=Xd.decode(n,n.uint32());continue}case 5:{if(o!==40){break}i.spaceBefore=n.int32();continue}case 6:{if(o!==48){break}i.spaceAfter=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Lh.fromPartial(e??{})},fromPartial(e){const t=xSt();t.id=e.id??void 0;t.level=e.level??0;t.textStyle=e.textStyle!==void 0&&e.textStyle!==null?Gi.fromPartial(e.textStyle):void 0;t.paragraphStyle=e.paragraphStyle!==void 0&&e.paragraphStyle!==null?Xd.fromPartial(e.paragraphStyle):void 0;t.spaceBefore=e.spaceBefore??void 0;t.spaceAfter=e.spaceAfter??void 0;return t}};function vSt(){return{style:0,widthEmu:void 0,fill:void 0,compound:void 0,sketch:void 0,cap:void 0,join:void 0}}var ui={encode(e,t=new tn){if(e.style!==0){t.uint32(8).int32(e.style)}if(e.widthEmu!==void 0){t.uint32(16).int32(e.widthEmu)}if(e.fill!==void 0){Ei.encode(e.fill,t.uint32(26).fork()).join()}if(e.compound!==void 0){t.uint32(32).int32(e.compound)}if(e.sketch!==void 0){Wce.encode(e.sketch,t.uint32(42).fork()).join()}if(e.cap!==void 0){t.uint32(48).int32(e.cap)}if(e.join!==void 0){t.uint32(56).int32(e.join)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=vSt();while(n.pos>>3){case 1:{if(o!==8){break}i.style=n.int32();continue}case 2:{if(o!==16){break}i.widthEmu=n.int32();continue}case 3:{if(o!==26){break}i.fill=Ei.decode(n,n.uint32());continue}case 4:{if(o!==32){break}i.compound=n.int32();continue}case 5:{if(o!==42){break}i.sketch=Wce.decode(n,n.uint32());continue}case 6:{if(o!==48){break}i.cap=n.int32();continue}case 7:{if(o!==56){break}i.join=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return ui.fromPartial(e??{})},fromPartial(e){const t=vSt();t.style=e.style??0;t.widthEmu=e.widthEmu??void 0;t.fill=e.fill!==void 0&&e.fill!==null?Ei.fromPartial(e.fill):void 0;t.compound=e.compound??void 0;t.sketch=e.sketch!==void 0&&e.sketch!==null?Wce.fromPartial(e.sketch):void 0;t.cap=e.cap??void 0;t.join=e.join??void 0;return t}};function _St(){return{type:0,presetGeometry:"",seed:void 0}}var Wce={encode(e,t=new tn){if(e.type!==0){t.uint32(8).int32(e.type)}if(e.presetGeometry!==""){t.uint32(18).string(e.presetGeometry)}if(e.seed!==void 0){t.uint32(24).uint32(e.seed)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=_St();while(n.pos>>3){case 1:{if(o!==8){break}i.type=n.int32();continue}case 2:{if(o!==18){break}i.presetGeometry=n.string();continue}case 3:{if(o!==24){break}i.seed=n.uint32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Wce.fromPartial(e??{})},fromPartial(e){const t=_St();t.type=e.type??0;t.presetGeometry=e.presetGeometry??"";t.seed=e.seed??void 0;return t}};function TSt(){return{l:void 0,t:void 0,r:void 0,b:void 0}}var f1={encode(e,t=new tn){if(e.l!==void 0){t.uint32(8).int32(e.l)}if(e.t!==void 0){t.uint32(16).int32(e.t)}if(e.r!==void 0){t.uint32(24).int32(e.r)}if(e.b!==void 0){t.uint32(32).int32(e.b)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=TSt();while(n.pos>>3){case 1:{if(o!==8){break}i.l=n.int32();continue}case 2:{if(o!==16){break}i.t=n.int32();continue}case 3:{if(o!==24){break}i.r=n.int32();continue}case 4:{if(o!==32){break}i.b=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return f1.fromPartial(e??{})},fromPartial(e){const t=TSt();t.l=e.l??void 0;t.t=e.t??void 0;t.r=e.r??void 0;t.b=e.b??void 0;return t}};function wSt(){return{contentType:"",data:new Uint8Array(0),id:"",prompt:void 0,uri:void 0}}var yy={encode(e,t=new tn){if(e.contentType!==""){t.uint32(10).string(e.contentType)}if(e.data.length!==0){t.uint32(18).bytes(e.data)}if(e.id!==""){t.uint32(26).string(e.id)}if(e.prompt!==void 0){t.uint32(34).string(e.prompt)}if(e.uri!==void 0){t.uint32(42).string(e.uri)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=wSt();while(n.pos>>3){case 1:{if(o!==10){break}i.contentType=n.string();continue}case 2:{if(o!==18){break}i.data=n.bytes();continue}case 3:{if(o!==26){break}i.id=n.string();continue}case 4:{if(o!==34){break}i.prompt=n.string();continue}case 5:{if(o!==42){break}i.uri=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return yy.fromPartial(e??{})},fromPartial(e){const t=wSt();t.contentType=e.contentType??"";t.data=e.data??new Uint8Array(0);t.id=e.id??"";t.prompt=e.prompt??void 0;t.uri=e.uri??void 0;return t}};function ESt(){return{id:"",tetherId:"",uri:void 0,title:void 0,type:0,sourceType:void 0,targetId:"",contentLineRange:void 0,contentId:void 0}}var FA={encode(e,t=new tn){if(e.id!==""){t.uint32(10).string(e.id)}if(e.tetherId!==""){t.uint32(18).string(e.tetherId)}if(e.uri!==void 0){t.uint32(26).string(e.uri)}if(e.title!==void 0){t.uint32(34).string(e.title)}if(e.type!==0){t.uint32(40).int32(e.type)}if(e.sourceType!==void 0){t.uint32(48).int32(e.sourceType)}if(e.targetId!==""){t.uint32(58).string(e.targetId)}if(e.contentLineRange!==void 0){Yce.encode(e.contentLineRange,t.uint32(66).fork()).join()}if(e.contentId!==void 0){t.uint32(74).string(e.contentId)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=ESt();while(n.pos>>3){case 1:{if(o!==10){break}i.id=n.string();continue}case 2:{if(o!==18){break}i.tetherId=n.string();continue}case 3:{if(o!==26){break}i.uri=n.string();continue}case 4:{if(o!==34){break}i.title=n.string();continue}case 5:{if(o!==40){break}i.type=n.int32();continue}case 6:{if(o!==48){break}i.sourceType=n.int32();continue}case 7:{if(o!==58){break}i.targetId=n.string();continue}case 8:{if(o!==66){break}i.contentLineRange=Yce.decode(n,n.uint32());continue}case 9:{if(o!==74){break}i.contentId=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return FA.fromPartial(e??{})},fromPartial(e){const t=ESt();t.id=e.id??"";t.tetherId=e.tetherId??"";t.uri=e.uri??void 0;t.title=e.title??void 0;t.type=e.type??0;t.sourceType=e.sourceType??void 0;t.targetId=e.targetId??"";t.contentLineRange=e.contentLineRange!==void 0&&e.contentLineRange!==null?Yce.fromPartial(e.contentLineRange):void 0;t.contentId=e.contentId??void 0;return t}};function CSt(){return{startLineNum:0,endLineNum:void 0}}var Yce={encode(e,t=new tn){if(e.startLineNum!==0){t.uint32(8).uint64(e.startLineNum)}if(e.endLineNum!==void 0){t.uint32(16).uint64(e.endLineNum)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=CSt();while(n.pos>>3){case 1:{if(o!==8){break}i.startLineNum=X2(n.uint64());continue}case 2:{if(o!==16){break}i.endLineNum=X2(n.uint64());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Yce.fromPartial(e??{})},fromPartial(e){const t=CSt();t.startLineNum=e.startLineNum??0;t.endLineNum=e.endLineNum??void 0;return t}};function SSt(){return{id:"",displayName:"",initials:void 0,email:void 0,avatarUrl:void 0,userId:void 0,providerId:void 0}}var NA={encode(e,t=new tn){if(e.id!==""){t.uint32(10).string(e.id)}if(e.displayName!==""){t.uint32(18).string(e.displayName)}if(e.initials!==void 0){t.uint32(26).string(e.initials)}if(e.email!==void 0){t.uint32(34).string(e.email)}if(e.avatarUrl!==void 0){t.uint32(42).string(e.avatarUrl)}if(e.userId!==void 0){t.uint32(50).string(e.userId)}if(e.providerId!==void 0){t.uint32(58).string(e.providerId)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=SSt();while(n.pos>>3){case 1:{if(o!==10){break}i.id=n.string();continue}case 2:{if(o!==18){break}i.displayName=n.string();continue}case 3:{if(o!==26){break}i.initials=n.string();continue}case 4:{if(o!==34){break}i.email=n.string();continue}case 5:{if(o!==42){break}i.avatarUrl=n.string();continue}case 6:{if(o!==50){break}i.userId=n.string();continue}case 7:{if(o!==58){break}i.providerId=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return NA.fromPartial(e??{})},fromPartial(e){const t=SSt();t.id=e.id??"";t.displayName=e.displayName??"";t.initials=e.initials??void 0;t.email=e.email??void 0;t.avatarUrl=e.avatarUrl??void 0;t.userId=e.userId??void 0;t.providerId=e.providerId??void 0;return t}};function ASt(){return{plainText:""}}var qce={encode(e,t=new tn){if(e.plainText!==""){t.uint32(10).string(e.plainText)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=ASt();while(n.pos>>3){case 1:{if(o!==10){break}i.plainText=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return qce.fromPartial(e??{})},fromPartial(e){const t=ASt();t.plainText=e.plainText??"";return t}};function kSt(){return{sheetName:"",sheetId:void 0,address:""}}var Xce={encode(e,t=new tn){if(e.sheetName!==""){t.uint32(10).string(e.sheetName)}if(e.sheetId!==void 0){t.uint32(18).string(e.sheetId)}if(e.address!==""){t.uint32(26).string(e.address)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=kSt();while(n.pos>>3){case 1:{if(o!==10){break}i.sheetName=n.string();continue}case 2:{if(o!==18){break}i.sheetId=n.string();continue}case 3:{if(o!==26){break}i.address=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Xce.fromPartial(e??{})},fromPartial(e){const t=kSt();t.sheetName=e.sheetName??"";t.sheetId=e.sheetId??void 0;t.address=e.address??"";return t}};function RSt(){return{sheetName:"",sheetId:void 0,startAddress:"",endAddress:""}}var jce={encode(e,t=new tn){if(e.sheetName!==""){t.uint32(10).string(e.sheetName)}if(e.sheetId!==void 0){t.uint32(18).string(e.sheetId)}if(e.startAddress!==""){t.uint32(26).string(e.startAddress)}if(e.endAddress!==""){t.uint32(34).string(e.endAddress)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=RSt();while(n.pos>>3){case 1:{if(o!==10){break}i.sheetName=n.string();continue}case 2:{if(o!==18){break}i.sheetId=n.string();continue}case 3:{if(o!==26){break}i.startAddress=n.string();continue}case 4:{if(o!==34){break}i.endAddress=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return jce.fromPartial(e??{})},fromPartial(e){const t=RSt();t.sheetName=e.sheetName??"";t.sheetId=e.sheetId??void 0;t.startAddress=e.startAddress??"";t.endAddress=e.endAddress??"";return t}};function PSt(){return{slideId:""}}var Kce={encode(e,t=new tn){if(e.slideId!==""){t.uint32(10).string(e.slideId)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=PSt();while(n.pos>>3){case 1:{if(o!==10){break}i.slideId=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Kce.fromPartial(e??{})},fromPartial(e){const t=PSt();t.slideId=e.slideId??"";return t}};function ISt(){return{slideId:"",elementId:""}}var Zce={encode(e,t=new tn){if(e.slideId!==""){t.uint32(10).string(e.slideId)}if(e.elementId!==""){t.uint32(18).string(e.elementId)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=ISt();while(n.pos>>3){case 1:{if(o!==10){break}i.slideId=n.string();continue}case 2:{if(o!==18){break}i.elementId=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Zce.fromPartial(e??{})},fromPartial(e){const t=ISt();t.slideId=e.slideId??"";t.elementId=e.elementId??"";return t}};function MSt(){return{contextLength:void 0,contextHash:void 0}}var Jce={encode(e,t=new tn){if(e.contextLength!==void 0){t.uint32(8).uint32(e.contextLength)}if(e.contextHash!==void 0){t.uint32(16).uint32(e.contextHash)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=MSt();while(n.pos>>3){case 1:{if(o!==8){break}i.contextLength=n.uint32();continue}case 2:{if(o!==16){break}i.contextHash=n.uint32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Jce.fromPartial(e??{})},fromPartial(e){const t=MSt();t.contextLength=e.contextLength??void 0;t.contextHash=e.contextHash??void 0;return t}};function LSt(){return{slideId:"",elementId:"",startCp:0,length:0,context:void 0}}var Qce={encode(e,t=new tn){if(e.slideId!==""){t.uint32(10).string(e.slideId)}if(e.elementId!==""){t.uint32(18).string(e.elementId)}if(e.startCp!==0){t.uint32(24).uint32(e.startCp)}if(e.length!==0){t.uint32(32).uint32(e.length)}if(e.context!==void 0){Jce.encode(e.context,t.uint32(42).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=LSt();while(n.pos>>3){case 1:{if(o!==10){break}i.slideId=n.string();continue}case 2:{if(o!==18){break}i.elementId=n.string();continue}case 3:{if(o!==24){break}i.startCp=n.uint32();continue}case 4:{if(o!==32){break}i.length=n.uint32();continue}case 5:{if(o!==42){break}i.context=Jce.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Qce.fromPartial(e??{})},fromPartial(e){const t=LSt();t.slideId=e.slideId??"";t.elementId=e.elementId??"";t.startCp=e.startCp??0;t.length=e.length??0;t.context=e.context!==void 0&&e.context!==null?Jce.fromPartial(e.context):void 0;return t}};function DSt(){return{spreadsheetCell:void 0,spreadsheetRange:void 0,slide:void 0,element:void 0,textRange:void 0}}var eue={encode(e,t=new tn){if(e.spreadsheetCell!==void 0){Xce.encode(e.spreadsheetCell,t.uint32(10).fork()).join()}if(e.spreadsheetRange!==void 0){jce.encode(e.spreadsheetRange,t.uint32(18).fork()).join()}if(e.slide!==void 0){Kce.encode(e.slide,t.uint32(26).fork()).join()}if(e.element!==void 0){Zce.encode(e.element,t.uint32(34).fork()).join()}if(e.textRange!==void 0){Qce.encode(e.textRange,t.uint32(42).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=DSt();while(n.pos>>3){case 1:{if(o!==10){break}i.spreadsheetCell=Xce.decode(n,n.uint32());continue}case 2:{if(o!==18){break}i.spreadsheetRange=jce.decode(n,n.uint32());continue}case 3:{if(o!==26){break}i.slide=Kce.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.element=Zce.decode(n,n.uint32());continue}case 5:{if(o!==42){break}i.textRange=Qce.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return eue.fromPartial(e??{})},fromPartial(e){const t=DSt();t.spreadsheetCell=e.spreadsheetCell!==void 0&&e.spreadsheetCell!==null?Xce.fromPartial(e.spreadsheetCell):void 0;t.spreadsheetRange=e.spreadsheetRange!==void 0&&e.spreadsheetRange!==null?jce.fromPartial(e.spreadsheetRange):void 0;t.slide=e.slide!==void 0&&e.slide!==null?Kce.fromPartial(e.slide):void 0;t.element=e.element!==void 0&&e.element!==null?Zce.fromPartial(e.element):void 0;t.textRange=e.textRange!==void 0&&e.textRange!==null?Qce.fromPartial(e.textRange):void 0;return t}};function FSt(){return{authorId:"",time:""}}var tue={encode(e,t=new tn){if(e.authorId!==""){t.uint32(10).string(e.authorId)}if(e.time!==""){t.uint32(18).string(e.time)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=FSt();while(n.pos>>3){case 1:{if(o!==10){break}i.authorId=n.string();continue}case 2:{if(o!==18){break}i.time=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return tue.fromPartial(e??{})},fromPartial(e){const t=FSt();t.authorId=e.authorId??"";t.time=e.time??"";return t}};function NSt(){return{type:"",instances:[]}}var nue={encode(e,t=new tn){if(e.type!==""){t.uint32(10).string(e.type)}for(const n of e.instances){tue.encode(n,t.uint32(18).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=NSt();while(n.pos>>3){case 1:{if(o!==10){break}i.type=n.string();continue}case 2:{if(o!==18){break}i.instances.push(tue.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return nue.fromPartial(e??{})},fromPartial(e){const t=NSt();t.type=e.type??"";t.instances=e.instances?.map(n=>tue.fromPartial(n))||[];return t}};function OSt(){return{xEmu:0,yEmu:0}}var rue={encode(e,t=new tn){if(e.xEmu!==0){t.uint32(8).int64(e.xEmu)}if(e.yEmu!==0){t.uint32(16).int64(e.yEmu)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=OSt();while(n.pos>>3){case 1:{if(o!==8){break}i.xEmu=X2(n.int64());continue}case 2:{if(o!==16){break}i.yEmu=X2(n.int64());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return rue.fromPartial(e??{})},fromPartial(e){const t=OSt();t.xEmu=e.xEmu??0;t.yEmu=e.yEmu??0;return t}};function BSt(){return{id:"",parentId:void 0,authorId:"",createdAt:"",editedAt:void 0,body:void 0,isDeleted:false,reactions:[],citations:[],position:void 0}}var iue={encode(e,t=new tn){if(e.id!==""){t.uint32(10).string(e.id)}if(e.parentId!==void 0){t.uint32(18).string(e.parentId)}if(e.authorId!==""){t.uint32(26).string(e.authorId)}if(e.createdAt!==""){t.uint32(34).string(e.createdAt)}if(e.editedAt!==void 0){t.uint32(42).string(e.editedAt)}if(e.body!==void 0){qce.encode(e.body,t.uint32(50).fork()).join()}if(e.isDeleted!==false){t.uint32(56).bool(e.isDeleted)}for(const n of e.reactions){nue.encode(n,t.uint32(66).fork()).join()}for(const n of e.citations){t.uint32(74).string(n)}if(e.position!==void 0){rue.encode(e.position,t.uint32(82).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=BSt();while(n.pos>>3){case 1:{if(o!==10){break}i.id=n.string();continue}case 2:{if(o!==18){break}i.parentId=n.string();continue}case 3:{if(o!==26){break}i.authorId=n.string();continue}case 4:{if(o!==34){break}i.createdAt=n.string();continue}case 5:{if(o!==42){break}i.editedAt=n.string();continue}case 6:{if(o!==50){break}i.body=qce.decode(n,n.uint32());continue}case 7:{if(o!==56){break}i.isDeleted=n.bool();continue}case 8:{if(o!==66){break}i.reactions.push(nue.decode(n,n.uint32()));continue}case 9:{if(o!==74){break}i.citations.push(n.string());continue}case 10:{if(o!==82){break}i.position=rue.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return iue.fromPartial(e??{})},fromPartial(e){const t=BSt();t.id=e.id??"";t.parentId=e.parentId??void 0;t.authorId=e.authorId??"";t.createdAt=e.createdAt??"";t.editedAt=e.editedAt??void 0;t.body=e.body!==void 0&&e.body!==null?qce.fromPartial(e.body):void 0;t.isDeleted=e.isDeleted??false;t.reactions=e.reactions?.map(n=>nue.fromPartial(n))||[];t.citations=e.citations?.map(n=>n)||[];t.position=e.position!==void 0&&e.position!==null?rue.fromPartial(e.position):void 0;return t}};function zSt(){return{id:"",target:void 0,comments:[],status:0,resolvedBy:void 0,resolvedAt:void 0}}var OA={encode(e,t=new tn){if(e.id!==""){t.uint32(10).string(e.id)}if(e.target!==void 0){eue.encode(e.target,t.uint32(18).fork()).join()}for(const n of e.comments){iue.encode(n,t.uint32(26).fork()).join()}if(e.status!==0){t.uint32(32).int32(e.status)}if(e.resolvedBy!==void 0){t.uint32(42).string(e.resolvedBy)}if(e.resolvedAt!==void 0){t.uint32(50).string(e.resolvedAt)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=zSt();while(n.pos>>3){case 1:{if(o!==10){break}i.id=n.string();continue}case 2:{if(o!==18){break}i.target=eue.decode(n,n.uint32());continue}case 3:{if(o!==26){break}i.comments.push(iue.decode(n,n.uint32()));continue}case 4:{if(o!==32){break}i.status=n.int32();continue}case 5:{if(o!==42){break}i.resolvedBy=n.string();continue}case 6:{if(o!==50){break}i.resolvedAt=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return OA.fromPartial(e??{})},fromPartial(e){const t=zSt();t.id=e.id??"";t.target=e.target!==void 0&&e.target!==null?eue.fromPartial(e.target):void 0;t.comments=e.comments?.map(n=>iue.fromPartial(n))||[];t.status=e.status??0;t.resolvedBy=e.resolvedBy??void 0;t.resolvedAt=e.resolvedAt??void 0;return t}};var mX=(()=>{if(typeof globalThis!=="undefined"){return globalThis}if(typeof self!=="undefined"){return self}if(typeof window!=="undefined"){return window}if(typeof global!=="undefined"){return global}throw"Unable to locate global object"})();function X2(e){const t=mX.Number(e.toString());if(t>mX.Number.MAX_SAFE_INTEGER){throw new mX.Error("Value is larger than Number.MAX_SAFE_INTEGER")}if(t>>3){case 1:{if(o!==10){break}i.title=n.string();continue}case 2:{if(o!==18){break}i.categories.push(n.string());continue}case 3:{if(o!==26){break}i.series.push(F4.decode(n,n.uint32()));continue}case 4:{if(o!==34){break}i.bbox=$v.decode(n,n.uint32());continue}case 5:{if(o!==40){break}i.type=n.int32();continue}case 6:{if(o!==48){break}i.styleIndex=n.int32();continue}case 7:{if(o!==58){break}i.id=n.string();continue}case 8:{if(o!==66){break}i.xAxis=j2.decode(n,n.uint32());continue}case 9:{if(o!==74){break}i.yAxis=j2.decode(n,n.uint32());continue}case 10:{if(o!==80){break}i.barDirection=n.int32();continue}case 11:{if(o!==88){break}i.hasLegend=n.bool();continue}case 12:{if(o!==98){break}i.legend=gue.decode(n,n.uint32());continue}case 13:{if(o!==106){break}i.titleTextStyle=Gi.decode(n,n.uint32());continue}case 14:{if(o!==114){break}i.dataLabels=Z2.decode(n,n.uint32());continue}case 15:{if(o!==122){break}i.chartFill=Ei.decode(n,n.uint32());continue}case 16:{if(o!==130){break}i.chartLine=ui.decode(n,n.uint32());continue}case 24:{if(o!==194){break}i.chartSpaceFill=Ei.decode(n,n.uint32());continue}case 25:{if(o!==202){break}i.chartSpaceLine=ui.decode(n,n.uint32());continue}case 26:{if(o!==208){break}i.roundedCorners=n.bool();continue}case 70:{if(o!==562){break}i.chartSpaceTextStyle=Gi.decode(n,n.uint32());continue}case 71:{if(o!==570){break}i.dataTable=oue.decode(n,n.uint32());continue}case 17:{if(o!==138){break}i.plotAreaFill=Ei.decode(n,n.uint32());continue}case 18:{if(o!==146){break}i.plotAreaLine=ui.decode(n,n.uint32());continue}case 30:{if(o!==242){break}i.plotAreaManualLayout=zf.decode(n,n.uint32());continue}case 19:{if(o!==154){break}i.pivot=Gue.decode(n,n.uint32());continue}case 20:{if(o!==162){break}i.pivotOptions=Hue.decode(n,n.uint32());continue}case 21:{if(o!==170){break}i.pivotFormats.push(Wue.decode(n,n.uint32()));continue}case 22:{if(o!==178){break}i.mapOptions=Pue.decode(n,n.uint32());continue}case 23:{if(o!==186){break}i.style=Bue.decode(n,n.uint32());continue}case 28:{if(o!==224){break}i.displayBlanksAs=n.int32();continue}case 29:{if(o!==232){break}i.showDlblsOverMax=n.bool();continue}case 41:{if(o!==330){break}i.view3d=Yue.decode(n,n.uint32());continue}case 50:{if(o!==402){break}i.barOptions=D4.decode(n,n.uint32());continue}case 51:{if(o!==410){break}i.lineOptions=N4.decode(n,n.uint32());continue}case 52:{if(o!==418){break}i.areaOptions=O4.decode(n,n.uint32());continue}case 53:{if(o!==426){break}i.pieOptions=Tue.decode(n,n.uint32());continue}case 59:{if(o!==474){break}i.ofPieOptions=wue.decode(n,n.uint32());continue}case 54:{if(o!==434){break}i.doughnutOptions=Eue.decode(n,n.uint32());continue}case 55:{if(o!==442){break}i.scatterOptions=B4.decode(n,n.uint32());continue}case 56:{if(o!==450){break}i.bubbleOptions=z4.decode(n,n.uint32());continue}case 57:{if(o!==458){break}i.radarOptions=U4.decode(n,n.uint32());continue}case 58:{if(o!==466){break}i.surfaceOptions=Cue.decode(n,n.uint32());continue}case 60:{if(o!==482){break}i.chartGroups.push(mue.decode(n,n.uint32()));continue}case 63:{if(o!==506){break}i.axes.push(j2.decode(n,n.uint32()));continue}case 44:{if(o!==354){break}i.treemapOptions=Mue.decode(n,n.uint32());continue}case 45:{if(o!==362){break}i.boxWhiskerOptions=Lue.decode(n,n.uint32());continue}case 46:{if(o!==370){break}i.histogramOptions=Due.decode(n,n.uint32());continue}case 47:{if(o!==378){break}i.waterfallOptions=Nue.decode(n,n.uint32());continue}case 48:{if(o!==386){break}i.funnelOptions=Oue.decode(n,n.uint32());continue}case 49:{if(o!==392){break}i.titlePosition=n.int32();continue}case 62:{if(o!==496){break}i.titleAlignment=n.int32();continue}case 65:{if(o!==520){break}i.titleOverlay=n.bool();continue}case 64:{if(o!==514){break}i.titleParagraphs.push(sue.decode(n,n.uint32()));continue}case 69:{if(o!==554){break}i.titleText=p1.decode(n,n.uint32());continue}case 66:{if(o!==530){break}i.titleManualLayout=zf.decode(n,n.uint32());continue}case 67:{if(o!==536){break}i.autoTitleDeleted=n.bool();continue}case 68:{if(o!==546){break}i.userShapes.push(aue.decode(n,n.uint32()));continue}case 61:{if(o!==490){break}i.externalData=Fue.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return dm.fromPartial(e??{})},fromPartial(e){const t=USt();t.title=e.title??"";t.categories=e.categories?.map(n=>n)||[];t.series=e.series?.map(n=>F4.fromPartial(n))||[];t.bbox=e.bbox!==void 0&&e.bbox!==null?$v.fromPartial(e.bbox):void 0;t.type=e.type??0;t.styleIndex=e.styleIndex??0;t.id=e.id??"";t.xAxis=e.xAxis!==void 0&&e.xAxis!==null?j2.fromPartial(e.xAxis):void 0;t.yAxis=e.yAxis!==void 0&&e.yAxis!==null?j2.fromPartial(e.yAxis):void 0;t.barDirection=e.barDirection??0;t.hasLegend=e.hasLegend??false;t.legend=e.legend!==void 0&&e.legend!==null?gue.fromPartial(e.legend):void 0;t.titleTextStyle=e.titleTextStyle!==void 0&&e.titleTextStyle!==null?Gi.fromPartial(e.titleTextStyle):void 0;t.dataLabels=e.dataLabels!==void 0&&e.dataLabels!==null?Z2.fromPartial(e.dataLabels):void 0;t.chartFill=e.chartFill!==void 0&&e.chartFill!==null?Ei.fromPartial(e.chartFill):void 0;t.chartLine=e.chartLine!==void 0&&e.chartLine!==null?ui.fromPartial(e.chartLine):void 0;t.chartSpaceFill=e.chartSpaceFill!==void 0&&e.chartSpaceFill!==null?Ei.fromPartial(e.chartSpaceFill):void 0;t.chartSpaceLine=e.chartSpaceLine!==void 0&&e.chartSpaceLine!==null?ui.fromPartial(e.chartSpaceLine):void 0;t.roundedCorners=e.roundedCorners??void 0;t.chartSpaceTextStyle=e.chartSpaceTextStyle!==void 0&&e.chartSpaceTextStyle!==null?Gi.fromPartial(e.chartSpaceTextStyle):void 0;t.dataTable=e.dataTable!==void 0&&e.dataTable!==null?oue.fromPartial(e.dataTable):void 0;t.plotAreaFill=e.plotAreaFill!==void 0&&e.plotAreaFill!==null?Ei.fromPartial(e.plotAreaFill):void 0;t.plotAreaLine=e.plotAreaLine!==void 0&&e.plotAreaLine!==null?ui.fromPartial(e.plotAreaLine):void 0;t.plotAreaManualLayout=e.plotAreaManualLayout!==void 0&&e.plotAreaManualLayout!==null?zf.fromPartial(e.plotAreaManualLayout):void 0;t.pivot=e.pivot!==void 0&&e.pivot!==null?Gue.fromPartial(e.pivot):void 0;t.pivotOptions=e.pivotOptions!==void 0&&e.pivotOptions!==null?Hue.fromPartial(e.pivotOptions):void 0;t.pivotFormats=e.pivotFormats?.map(n=>Wue.fromPartial(n))||[];t.mapOptions=e.mapOptions!==void 0&&e.mapOptions!==null?Pue.fromPartial(e.mapOptions):void 0;t.style=e.style!==void 0&&e.style!==null?Bue.fromPartial(e.style):void 0;t.displayBlanksAs=e.displayBlanksAs??void 0;t.showDlblsOverMax=e.showDlblsOverMax??void 0;t.view3d=e.view3d!==void 0&&e.view3d!==null?Yue.fromPartial(e.view3d):void 0;t.barOptions=e.barOptions!==void 0&&e.barOptions!==null?D4.fromPartial(e.barOptions):void 0;t.lineOptions=e.lineOptions!==void 0&&e.lineOptions!==null?N4.fromPartial(e.lineOptions):void 0;t.areaOptions=e.areaOptions!==void 0&&e.areaOptions!==null?O4.fromPartial(e.areaOptions):void 0;t.pieOptions=e.pieOptions!==void 0&&e.pieOptions!==null?Tue.fromPartial(e.pieOptions):void 0;t.ofPieOptions=e.ofPieOptions!==void 0&&e.ofPieOptions!==null?wue.fromPartial(e.ofPieOptions):void 0;t.doughnutOptions=e.doughnutOptions!==void 0&&e.doughnutOptions!==null?Eue.fromPartial(e.doughnutOptions):void 0;t.scatterOptions=e.scatterOptions!==void 0&&e.scatterOptions!==null?B4.fromPartial(e.scatterOptions):void 0;t.bubbleOptions=e.bubbleOptions!==void 0&&e.bubbleOptions!==null?z4.fromPartial(e.bubbleOptions):void 0;t.radarOptions=e.radarOptions!==void 0&&e.radarOptions!==null?U4.fromPartial(e.radarOptions):void 0;t.surfaceOptions=e.surfaceOptions!==void 0&&e.surfaceOptions!==null?Cue.fromPartial(e.surfaceOptions):void 0;t.chartGroups=e.chartGroups?.map(n=>mue.fromPartial(n))||[];t.axes=e.axes?.map(n=>j2.fromPartial(n))||[];t.treemapOptions=e.treemapOptions!==void 0&&e.treemapOptions!==null?Mue.fromPartial(e.treemapOptions):void 0;t.boxWhiskerOptions=e.boxWhiskerOptions!==void 0&&e.boxWhiskerOptions!==null?Lue.fromPartial(e.boxWhiskerOptions):void 0;t.histogramOptions=e.histogramOptions!==void 0&&e.histogramOptions!==null?Due.fromPartial(e.histogramOptions):void 0;t.waterfallOptions=e.waterfallOptions!==void 0&&e.waterfallOptions!==null?Nue.fromPartial(e.waterfallOptions):void 0;t.funnelOptions=e.funnelOptions!==void 0&&e.funnelOptions!==null?Oue.fromPartial(e.funnelOptions):void 0;t.titlePosition=e.titlePosition??void 0;t.titleAlignment=e.titleAlignment??void 0;t.titleOverlay=e.titleOverlay??void 0;t.titleParagraphs=e.titleParagraphs?.map(n=>sue.fromPartial(n))||[];t.titleText=e.titleText!==void 0&&e.titleText!==null?p1.fromPartial(e.titleText):void 0;t.titleManualLayout=e.titleManualLayout!==void 0&&e.titleManualLayout!==null?zf.fromPartial(e.titleManualLayout):void 0;t.autoTitleDeleted=e.autoTitleDeleted??void 0;t.userShapes=e.userShapes?.map(n=>aue.fromPartial(n))||[];t.externalData=e.externalData!==void 0&&e.externalData!==null?Fue.fromPartial(e.externalData):void 0;return t}};function VSt(){return{showHorizontalBorder:void 0,showVerticalBorder:void 0,showOutlineBorder:void 0,showLegendKey:void 0,fill:void 0,stroke:void 0}}var oue={encode(e,t=new tn){if(e.showHorizontalBorder!==void 0){t.uint32(16).bool(e.showHorizontalBorder)}if(e.showVerticalBorder!==void 0){t.uint32(24).bool(e.showVerticalBorder)}if(e.showOutlineBorder!==void 0){t.uint32(32).bool(e.showOutlineBorder)}if(e.showLegendKey!==void 0){t.uint32(40).bool(e.showLegendKey)}if(e.fill!==void 0){Ei.encode(e.fill,t.uint32(50).fork()).join()}if(e.stroke!==void 0){ui.encode(e.stroke,t.uint32(58).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=VSt();while(n.pos>>3){case 2:{if(o!==16){break}i.showHorizontalBorder=n.bool();continue}case 3:{if(o!==24){break}i.showVerticalBorder=n.bool();continue}case 4:{if(o!==32){break}i.showOutlineBorder=n.bool();continue}case 5:{if(o!==40){break}i.showLegendKey=n.bool();continue}case 6:{if(o!==50){break}i.fill=Ei.decode(n,n.uint32());continue}case 7:{if(o!==58){break}i.stroke=ui.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return oue.fromPartial(e??{})},fromPartial(e){const t=VSt();t.showHorizontalBorder=e.showHorizontalBorder??void 0;t.showVerticalBorder=e.showVerticalBorder??void 0;t.showOutlineBorder=e.showOutlineBorder??void 0;t.showLegendKey=e.showLegendKey??void 0;t.fill=e.fill!==void 0&&e.fill!==null?Ei.fromPartial(e.fill):void 0;t.stroke=e.stroke!==void 0&&e.stroke!==null?ui.fromPartial(e.stroke):void 0;return t}};function $St(){return{kind:0,fromX:void 0,fromY:void 0,toX:void 0,toY:void 0,textStyle:void 0,fill:void 0,stroke:void 0,textBody:void 0}}var aue={encode(e,t=new tn){if(e.kind!==0){t.uint32(8).int32(e.kind)}if(e.fromX!==void 0){t.uint32(17).double(e.fromX)}if(e.fromY!==void 0){t.uint32(25).double(e.fromY)}if(e.toX!==void 0){t.uint32(33).double(e.toX)}if(e.toY!==void 0){t.uint32(41).double(e.toY)}if(e.textStyle!==void 0){Gi.encode(e.textStyle,t.uint32(50).fork()).join()}if(e.fill!==void 0){Ei.encode(e.fill,t.uint32(58).fork()).join()}if(e.stroke!==void 0){ui.encode(e.stroke,t.uint32(66).fork()).join()}if(e.textBody!==void 0){M4.encode(e.textBody,t.uint32(74).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=$St();while(n.pos>>3){case 1:{if(o!==8){break}i.kind=n.int32();continue}case 2:{if(o!==17){break}i.fromX=n.double();continue}case 3:{if(o!==25){break}i.fromY=n.double();continue}case 4:{if(o!==33){break}i.toX=n.double();continue}case 5:{if(o!==41){break}i.toY=n.double();continue}case 6:{if(o!==50){break}i.textStyle=Gi.decode(n,n.uint32());continue}case 7:{if(o!==58){break}i.fill=Ei.decode(n,n.uint32());continue}case 8:{if(o!==66){break}i.stroke=ui.decode(n,n.uint32());continue}case 9:{if(o!==74){break}i.textBody=M4.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return aue.fromPartial(e??{})},fromPartial(e){const t=$St();t.kind=e.kind??0;t.fromX=e.fromX??void 0;t.fromY=e.fromY??void 0;t.toX=e.toX??void 0;t.toY=e.toY??void 0;t.textStyle=e.textStyle!==void 0&&e.textStyle!==null?Gi.fromPartial(e.textStyle):void 0;t.fill=e.fill!==void 0&&e.fill!==null?Ei.fromPartial(e.fill):void 0;t.stroke=e.stroke!==void 0&&e.stroke!==null?ui.fromPartial(e.stroke):void 0;t.textBody=e.textBody!==void 0&&e.textBody!==null?M4.fromPartial(e.textBody):void 0;return t}};function GSt(){return{runs:[],textStyle:void 0,paragraphStyle:void 0}}var sue={encode(e,t=new tn){for(const n of e.runs){lue.encode(n,t.uint32(10).fork()).join()}if(e.textStyle!==void 0){Gi.encode(e.textStyle,t.uint32(18).fork()).join()}if(e.paragraphStyle!==void 0){Xd.encode(e.paragraphStyle,t.uint32(26).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=GSt();while(n.pos>>3){case 1:{if(o!==10){break}i.runs.push(lue.decode(n,n.uint32()));continue}case 2:{if(o!==18){break}i.textStyle=Gi.decode(n,n.uint32());continue}case 3:{if(o!==26){break}i.paragraphStyle=Xd.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return sue.fromPartial(e??{})},fromPartial(e){const t=GSt();t.runs=e.runs?.map(n=>lue.fromPartial(n))||[];t.textStyle=e.textStyle!==void 0&&e.textStyle!==null?Gi.fromPartial(e.textStyle):void 0;t.paragraphStyle=e.paragraphStyle!==void 0&&e.paragraphStyle!==null?Xd.fromPartial(e.paragraphStyle):void 0;return t}};function HSt(){return{text:"",textStyle:void 0}}var lue={encode(e,t=new tn){if(e.text!==""){t.uint32(10).string(e.text)}if(e.textStyle!==void 0){Gi.encode(e.textStyle,t.uint32(18).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=HSt();while(n.pos>>3){case 1:{if(o!==10){break}i.text=n.string();continue}case 2:{if(o!==18){break}i.textStyle=Gi.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return lue.fromPartial(e??{})},fromPartial(e){const t=HSt();t.text=e.text??"";t.textStyle=e.textStyle!==void 0&&e.textStyle!==null?Gi.fromPartial(e.textStyle):void 0;return t}};function WSt(){return{richText:void 0,stringReference:void 0,stringLiteral:void 0,textData:void 0}}var p1={encode(e,t=new tn){if(e.richText!==void 0){M4.encode(e.richText,t.uint32(10).fork()).join()}if(e.stringReference!==void 0){cue.encode(e.stringReference,t.uint32(18).fork()).join()}if(e.stringLiteral!==void 0){L4.encode(e.stringLiteral,t.uint32(26).fork()).join()}if(e.textData!==void 0){due.encode(e.textData,t.uint32(34).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=WSt();while(n.pos>>3){case 1:{if(o!==10){break}i.richText=M4.decode(n,n.uint32());continue}case 2:{if(o!==18){break}i.stringReference=cue.decode(n,n.uint32());continue}case 3:{if(o!==26){break}i.stringLiteral=L4.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.textData=due.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return p1.fromPartial(e??{})},fromPartial(e){const t=WSt();t.richText=e.richText!==void 0&&e.richText!==null?M4.fromPartial(e.richText):void 0;t.stringReference=e.stringReference!==void 0&&e.stringReference!==null?cue.fromPartial(e.stringReference):void 0;t.stringLiteral=e.stringLiteral!==void 0&&e.stringLiteral!==null?L4.fromPartial(e.stringLiteral):void 0;t.textData=e.textData!==void 0&&e.textData!==null?due.fromPartial(e.textData):void 0;return t}};function YSt(){return{paragraphs:[]}}var M4={encode(e,t=new tn){for(const n of e.paragraphs){fue.encode(n,t.uint32(10).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=YSt();while(n.pos>>3){case 1:{if(o!==10){break}i.paragraphs.push(fue.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return M4.fromPartial(e??{})},fromPartial(e){const t=YSt();t.paragraphs=e.paragraphs?.map(n=>fue.fromPartial(n))||[];return t}};function qSt(){return{formula:void 0,cache:void 0}}var cue={encode(e,t=new tn){if(e.formula!==void 0){t.uint32(10).string(e.formula)}if(e.cache!==void 0){L4.encode(e.cache,t.uint32(18).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=qSt();while(n.pos>>3){case 1:{if(o!==10){break}i.formula=n.string();continue}case 2:{if(o!==18){break}i.cache=L4.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return cue.fromPartial(e??{})},fromPartial(e){const t=qSt();t.formula=e.formula??void 0;t.cache=e.cache!==void 0&&e.cache!==null?L4.fromPartial(e.cache):void 0;return t}};function XSt(){return{pointCount:void 0,points:[]}}var L4={encode(e,t=new tn){if(e.pointCount!==void 0){t.uint32(8).uint32(e.pointCount)}for(const n of e.points){uue.encode(n,t.uint32(18).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=XSt();while(n.pos>>3){case 1:{if(o!==8){break}i.pointCount=n.uint32();continue}case 2:{if(o!==18){break}i.points.push(uue.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return L4.fromPartial(e??{})},fromPartial(e){const t=XSt();t.pointCount=e.pointCount??void 0;t.points=e.points?.map(n=>uue.fromPartial(n))||[];return t}};function jSt(){return{index:void 0,value:void 0}}var uue={encode(e,t=new tn){if(e.index!==void 0){t.uint32(8).uint32(e.index)}if(e.value!==void 0){t.uint32(18).string(e.value)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=jSt();while(n.pos>>3){case 1:{if(o!==8){break}i.index=n.uint32();continue}case 2:{if(o!==18){break}i.value=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return uue.fromPartial(e??{})},fromPartial(e){const t=jSt();t.index=e.index??void 0;t.value=e.value??void 0;return t}};function KSt(){return{formula:void 0,value:void 0}}var due={encode(e,t=new tn){if(e.formula!==void 0){t.uint32(10).string(e.formula)}if(e.value!==void 0){t.uint32(18).string(e.value)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=KSt();while(n.pos>>3){case 1:{if(o!==10){break}i.formula=n.string();continue}case 2:{if(o!==18){break}i.value=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return due.fromPartial(e??{})},fromPartial(e){const t=KSt();t.formula=e.formula??void 0;t.value=e.value??void 0;return t}};function ZSt(){return{runs:[],textStyle:void 0,paragraphStyle:void 0}}var fue={encode(e,t=new tn){for(const n of e.runs){hue.encode(n,t.uint32(10).fork()).join()}if(e.textStyle!==void 0){Gi.encode(e.textStyle,t.uint32(18).fork()).join()}if(e.paragraphStyle!==void 0){Xd.encode(e.paragraphStyle,t.uint32(26).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=ZSt();while(n.pos>>3){case 1:{if(o!==10){break}i.runs.push(hue.decode(n,n.uint32()));continue}case 2:{if(o!==18){break}i.textStyle=Gi.decode(n,n.uint32());continue}case 3:{if(o!==26){break}i.paragraphStyle=Xd.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return fue.fromPartial(e??{})},fromPartial(e){const t=ZSt();t.runs=e.runs?.map(n=>hue.fromPartial(n))||[];t.textStyle=e.textStyle!==void 0&&e.textStyle!==null?Gi.fromPartial(e.textStyle):void 0;t.paragraphStyle=e.paragraphStyle!==void 0&&e.paragraphStyle!==null?Xd.fromPartial(e.paragraphStyle):void 0;return t}};function JSt(){return{text:void 0,lineBreak:void 0,field:void 0,textStyle:void 0}}var hue={encode(e,t=new tn){if(e.text!==void 0){t.uint32(10).string(e.text)}if(e.lineBreak!==void 0){t.uint32(24).bool(e.lineBreak)}if(e.field!==void 0){pue.encode(e.field,t.uint32(34).fork()).join()}if(e.textStyle!==void 0){Gi.encode(e.textStyle,t.uint32(18).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=JSt();while(n.pos>>3){case 1:{if(o!==10){break}i.text=n.string();continue}case 3:{if(o!==24){break}i.lineBreak=n.bool();continue}case 4:{if(o!==34){break}i.field=pue.decode(n,n.uint32());continue}case 2:{if(o!==18){break}i.textStyle=Gi.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return hue.fromPartial(e??{})},fromPartial(e){const t=JSt();t.text=e.text??void 0;t.lineBreak=e.lineBreak??void 0;t.field=e.field!==void 0&&e.field!==null?pue.fromPartial(e.field):void 0;t.textStyle=e.textStyle!==void 0&&e.textStyle!==null?Gi.fromPartial(e.textStyle):void 0;return t}};function QSt(){return{text:void 0,type:void 0,id:void 0}}var pue={encode(e,t=new tn){if(e.text!==void 0){t.uint32(10).string(e.text)}if(e.type!==void 0){t.uint32(18).string(e.type)}if(e.id!==void 0){t.uint32(26).string(e.id)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=QSt();while(n.pos>>3){case 1:{if(o!==10){break}i.text=n.string();continue}case 2:{if(o!==18){break}i.type=n.string();continue}case 3:{if(o!==26){break}i.id=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return pue.fromPartial(e??{})},fromPartial(e){const t=QSt();t.text=e.text??void 0;t.type=e.type??void 0;t.id=e.id??void 0;return t}};function eAt(){return{type:0,series:[],dataLabels:void 0,barOptions:void 0,lineOptions:void 0,areaOptions:void 0,scatterOptions:void 0,bubbleOptions:void 0,radarOptions:void 0,axisIds:[]}}var mue={encode(e,t=new tn){if(e.type!==0){t.uint32(8).int32(e.type)}for(const n of e.series){F4.encode(n,t.uint32(18).fork()).join()}if(e.dataLabels!==void 0){Z2.encode(e.dataLabels,t.uint32(26).fork()).join()}if(e.barOptions!==void 0){D4.encode(e.barOptions,t.uint32(34).fork()).join()}if(e.lineOptions!==void 0){N4.encode(e.lineOptions,t.uint32(42).fork()).join()}if(e.areaOptions!==void 0){O4.encode(e.areaOptions,t.uint32(50).fork()).join()}if(e.scatterOptions!==void 0){B4.encode(e.scatterOptions,t.uint32(66).fork()).join()}if(e.bubbleOptions!==void 0){z4.encode(e.bubbleOptions,t.uint32(74).fork()).join()}if(e.radarOptions!==void 0){U4.encode(e.radarOptions,t.uint32(82).fork()).join()}t.uint32(90).fork();for(const n of e.axisIds){t.uint32(n)}t.join();return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=eAt();while(n.pos>>3){case 1:{if(o!==8){break}i.type=n.int32();continue}case 2:{if(o!==18){break}i.series.push(F4.decode(n,n.uint32()));continue}case 3:{if(o!==26){break}i.dataLabels=Z2.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.barOptions=D4.decode(n,n.uint32());continue}case 5:{if(o!==42){break}i.lineOptions=N4.decode(n,n.uint32());continue}case 6:{if(o!==50){break}i.areaOptions=O4.decode(n,n.uint32());continue}case 8:{if(o!==66){break}i.scatterOptions=B4.decode(n,n.uint32());continue}case 9:{if(o!==74){break}i.bubbleOptions=z4.decode(n,n.uint32());continue}case 10:{if(o!==82){break}i.radarOptions=U4.decode(n,n.uint32());continue}case 11:{if(o===88){i.axisIds.push(n.uint32());continue}if(o===90){const a=n.uint32()+n.pos;while(n.posF4.fromPartial(n))||[];t.dataLabels=e.dataLabels!==void 0&&e.dataLabels!==null?Z2.fromPartial(e.dataLabels):void 0;t.barOptions=e.barOptions!==void 0&&e.barOptions!==null?D4.fromPartial(e.barOptions):void 0;t.lineOptions=e.lineOptions!==void 0&&e.lineOptions!==null?N4.fromPartial(e.lineOptions):void 0;t.areaOptions=e.areaOptions!==void 0&&e.areaOptions!==null?O4.fromPartial(e.areaOptions):void 0;t.scatterOptions=e.scatterOptions!==void 0&&e.scatterOptions!==null?B4.fromPartial(e.scatterOptions):void 0;t.bubbleOptions=e.bubbleOptions!==void 0&&e.bubbleOptions!==null?z4.fromPartial(e.bubbleOptions):void 0;t.radarOptions=e.radarOptions!==void 0&&e.radarOptions!==null?U4.fromPartial(e.radarOptions):void 0;t.axisIds=e.axisIds?.map(n=>n)||[];return t}};function tAt(){return{position:0,overlay:void 0,textStyle:void 0,fill:void 0,stroke:void 0,manualLayout:void 0,deletedEntryIndices:[]}}var gue={encode(e,t=new tn){if(e.position!==0){t.uint32(8).int32(e.position)}if(e.overlay!==void 0){t.uint32(16).bool(e.overlay)}if(e.textStyle!==void 0){Gi.encode(e.textStyle,t.uint32(26).fork()).join()}if(e.fill!==void 0){Ei.encode(e.fill,t.uint32(34).fork()).join()}if(e.stroke!==void 0){ui.encode(e.stroke,t.uint32(42).fork()).join()}if(e.manualLayout!==void 0){zf.encode(e.manualLayout,t.uint32(50).fork()).join()}t.uint32(58).fork();for(const n of e.deletedEntryIndices){t.uint32(n)}t.join();return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=tAt();while(n.pos>>3){case 1:{if(o!==8){break}i.position=n.int32();continue}case 2:{if(o!==16){break}i.overlay=n.bool();continue}case 3:{if(o!==26){break}i.textStyle=Gi.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.fill=Ei.decode(n,n.uint32());continue}case 5:{if(o!==42){break}i.stroke=ui.decode(n,n.uint32());continue}case 6:{if(o!==50){break}i.manualLayout=zf.decode(n,n.uint32());continue}case 7:{if(o===56){i.deletedEntryIndices.push(n.uint32());continue}if(o===58){const a=n.uint32()+n.pos;while(n.posn)||[];return t}};function nAt(){return{direction:void 0,grouping:void 0,varyColors:void 0,gapWidth:void 0,overlap:void 0,gapDepth:void 0,bar3dShape:void 0}}var D4={encode(e,t=new tn){if(e.direction!==void 0){t.uint32(8).int32(e.direction)}if(e.grouping!==void 0){t.uint32(16).int32(e.grouping)}if(e.varyColors!==void 0){t.uint32(24).bool(e.varyColors)}if(e.gapWidth!==void 0){t.uint32(32).uint32(e.gapWidth)}if(e.overlap!==void 0){t.uint32(40).sint32(e.overlap)}if(e.gapDepth!==void 0){t.uint32(48).uint32(e.gapDepth)}if(e.bar3dShape!==void 0){t.uint32(56).int32(e.bar3dShape)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=nAt();while(n.pos>>3){case 1:{if(o!==8){break}i.direction=n.int32();continue}case 2:{if(o!==16){break}i.grouping=n.int32();continue}case 3:{if(o!==24){break}i.varyColors=n.bool();continue}case 4:{if(o!==32){break}i.gapWidth=n.uint32();continue}case 5:{if(o!==40){break}i.overlap=n.sint32();continue}case 6:{if(o!==48){break}i.gapDepth=n.uint32();continue}case 7:{if(o!==56){break}i.bar3dShape=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return D4.fromPartial(e??{})},fromPartial(e){const t=nAt();t.direction=e.direction??void 0;t.grouping=e.grouping??void 0;t.varyColors=e.varyColors??void 0;t.gapWidth=e.gapWidth??void 0;t.overlap=e.overlap??void 0;t.gapDepth=e.gapDepth??void 0;t.bar3dShape=e.bar3dShape??void 0;return t}};function rAt(){return{id:void 0,name:"",values:[],formula:"",stringCache:"",categories:[],categoryFormula:"",fill:void 0,stroke:void 0,points:[],valuesFormatCode:void 0,categoryFormatCode:void 0,invertIfNegative:void 0,uniqueId:void 0,explosion:void 0,marker:void 0,xValues:[],xFormula:"",xValuesFormatCode:void 0,bubbleSizes:[],bubbleSizeFormula:"",categoryPaths:[],dataLabels:void 0,dataLabelOverrides:[],trendlines:[],errorBars:[],ownerIndex:void 0,axisIds:[],categoryIndices:[],categoryPointCount:void 0,valueIndices:[],valuePointCount:void 0,bubbleSizesFormatCode:void 0,smooth:void 0,hidden:void 0}}var F4={encode(e,t=new tn){if(e.id!==void 0){t.uint32(66).string(e.id)}if(e.name!==""){t.uint32(10).string(e.name)}t.uint32(18).fork();for(const n of e.values){t.double(n)}t.join();if(e.formula!==""){t.uint32(26).string(e.formula)}if(e.stringCache!==""){t.uint32(34).string(e.stringCache)}for(const n of e.categories){t.uint32(42).string(n)}if(e.categoryFormula!==""){t.uint32(50).string(e.categoryFormula)}if(e.fill!==void 0){Ei.encode(e.fill,t.uint32(58).fork()).join()}if(e.stroke!==void 0){ui.encode(e.stroke,t.uint32(74).fork()).join()}for(const n of e.points){Sue.encode(n,t.uint32(82).fork()).join()}if(e.valuesFormatCode!==void 0){t.uint32(90).string(e.valuesFormatCode)}if(e.categoryFormatCode!==void 0){t.uint32(98).string(e.categoryFormatCode)}if(e.invertIfNegative!==void 0){t.uint32(104).bool(e.invertIfNegative)}if(e.uniqueId!==void 0){t.uint32(114).string(e.uniqueId)}if(e.explosion!==void 0){t.uint32(120).uint32(e.explosion)}if(e.marker!==void 0){J2.encode(e.marker,t.uint32(130).fork()).join()}t.uint32(138).fork();for(const n of e.xValues){t.double(n)}t.join();if(e.xFormula!==""){t.uint32(146).string(e.xFormula)}if(e.xValuesFormatCode!==void 0){t.uint32(154).string(e.xValuesFormatCode)}t.uint32(162).fork();for(const n of e.bubbleSizes){t.double(n)}t.join();if(e.bubbleSizeFormula!==""){t.uint32(170).string(e.bubbleSizeFormula)}for(const n of e.categoryPaths){Iue.encode(n,t.uint32(178).fork()).join()}if(e.dataLabels!==void 0){Z2.encode(e.dataLabels,t.uint32(186).fork()).join()}for(const n of e.dataLabelOverrides){Rue.encode(n,t.uint32(194).fork()).join()}for(const n of e.trendlines){vue.encode(n,t.uint32(202).fork()).join()}for(const n of e.errorBars){yue.encode(n,t.uint32(210).fork()).join()}if(e.ownerIndex!==void 0){t.uint32(216).uint32(e.ownerIndex)}t.uint32(226).fork();for(const n of e.axisIds){t.uint32(n)}t.join();t.uint32(234).fork();for(const n of e.categoryIndices){t.uint32(n)}t.join();if(e.categoryPointCount!==void 0){t.uint32(240).uint32(e.categoryPointCount)}t.uint32(250).fork();for(const n of e.valueIndices){t.uint32(n)}t.join();if(e.valuePointCount!==void 0){t.uint32(256).uint32(e.valuePointCount)}if(e.bubbleSizesFormatCode!==void 0){t.uint32(266).string(e.bubbleSizesFormatCode)}if(e.smooth!==void 0){t.uint32(272).bool(e.smooth)}if(e.hidden!==void 0){t.uint32(280).bool(e.hidden)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=rAt();while(n.pos>>3){case 8:{if(o!==66){break}i.id=n.string();continue}case 1:{if(o!==10){break}i.name=n.string();continue}case 2:{if(o===17){i.values.push(n.double());continue}if(o===18){const a=n.uint32()+n.pos;while(n.posn)||[];t.formula=e.formula??"";t.stringCache=e.stringCache??"";t.categories=e.categories?.map(n=>n)||[];t.categoryFormula=e.categoryFormula??"";t.fill=e.fill!==void 0&&e.fill!==null?Ei.fromPartial(e.fill):void 0;t.stroke=e.stroke!==void 0&&e.stroke!==null?ui.fromPartial(e.stroke):void 0;t.points=e.points?.map(n=>Sue.fromPartial(n))||[];t.valuesFormatCode=e.valuesFormatCode??void 0;t.categoryFormatCode=e.categoryFormatCode??void 0;t.invertIfNegative=e.invertIfNegative??void 0;t.uniqueId=e.uniqueId??void 0;t.explosion=e.explosion??void 0;t.marker=e.marker!==void 0&&e.marker!==null?J2.fromPartial(e.marker):void 0;t.xValues=e.xValues?.map(n=>n)||[];t.xFormula=e.xFormula??"";t.xValuesFormatCode=e.xValuesFormatCode??void 0;t.bubbleSizes=e.bubbleSizes?.map(n=>n)||[];t.bubbleSizeFormula=e.bubbleSizeFormula??"";t.categoryPaths=e.categoryPaths?.map(n=>Iue.fromPartial(n))||[];t.dataLabels=e.dataLabels!==void 0&&e.dataLabels!==null?Z2.fromPartial(e.dataLabels):void 0;t.dataLabelOverrides=e.dataLabelOverrides?.map(n=>Rue.fromPartial(n))||[];t.trendlines=e.trendlines?.map(n=>vue.fromPartial(n))||[];t.errorBars=e.errorBars?.map(n=>yue.fromPartial(n))||[];t.ownerIndex=e.ownerIndex??void 0;t.axisIds=e.axisIds?.map(n=>n)||[];t.categoryIndices=e.categoryIndices?.map(n=>n)||[];t.categoryPointCount=e.categoryPointCount??void 0;t.valueIndices=e.valueIndices?.map(n=>n)||[];t.valuePointCount=e.valuePointCount??void 0;t.bubbleSizesFormatCode=e.bubbleSizesFormatCode??void 0;t.smooth=e.smooth??void 0;t.hidden=e.hidden??void 0;return t}};function iAt(){return{direction:0,type:0,valueType:0,noEndCap:void 0,value:void 0,fill:void 0,stroke:void 0,plus:void 0,minus:void 0}}var yue={encode(e,t=new tn){if(e.direction!==0){t.uint32(8).int32(e.direction)}if(e.type!==0){t.uint32(16).int32(e.type)}if(e.valueType!==0){t.uint32(24).int32(e.valueType)}if(e.noEndCap!==void 0){t.uint32(32).bool(e.noEndCap)}if(e.value!==void 0){t.uint32(41).double(e.value)}if(e.fill!==void 0){Ei.encode(e.fill,t.uint32(50).fork()).join()}if(e.stroke!==void 0){ui.encode(e.stroke,t.uint32(58).fork()).join()}if(e.plus!==void 0){P4.encode(e.plus,t.uint32(66).fork()).join()}if(e.minus!==void 0){P4.encode(e.minus,t.uint32(74).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=iAt();while(n.pos>>3){case 1:{if(o!==8){break}i.direction=n.int32();continue}case 2:{if(o!==16){break}i.type=n.int32();continue}case 3:{if(o!==24){break}i.valueType=n.int32();continue}case 4:{if(o!==32){break}i.noEndCap=n.bool();continue}case 5:{if(o!==41){break}i.value=n.double();continue}case 6:{if(o!==50){break}i.fill=Ei.decode(n,n.uint32());continue}case 7:{if(o!==58){break}i.stroke=ui.decode(n,n.uint32());continue}case 8:{if(o!==66){break}i.plus=P4.decode(n,n.uint32());continue}case 9:{if(o!==74){break}i.minus=P4.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return yue.fromPartial(e??{})},fromPartial(e){const t=iAt();t.direction=e.direction??0;t.type=e.type??0;t.valueType=e.valueType??0;t.noEndCap=e.noEndCap??void 0;t.value=e.value??void 0;t.fill=e.fill!==void 0&&e.fill!==null?Ei.fromPartial(e.fill):void 0;t.stroke=e.stroke!==void 0&&e.stroke!==null?ui.fromPartial(e.stroke):void 0;t.plus=e.plus!==void 0&&e.plus!==null?P4.fromPartial(e.plus):void 0;t.minus=e.minus!==void 0&&e.minus!==null?P4.fromPartial(e.minus):void 0;return t}};function oAt(){return{values:[],formula:"",valuesFormatCode:void 0}}var P4={encode(e,t=new tn){t.uint32(10).fork();for(const n of e.values){t.double(n)}t.join();if(e.formula!==""){t.uint32(18).string(e.formula)}if(e.valuesFormatCode!==void 0){t.uint32(26).string(e.valuesFormatCode)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=oAt();while(n.pos>>3){case 1:{if(o===9){i.values.push(n.double());continue}if(o===10){const a=n.uint32()+n.pos;while(n.posn)||[];t.formula=e.formula??"";t.valuesFormatCode=e.valuesFormatCode??void 0;return t}};function aAt(){return{x:void 0,y:void 0,w:void 0,h:void 0,layoutTarget:void 0,xMode:void 0,yMode:void 0,wMode:void 0,hMode:void 0}}var zf={encode(e,t=new tn){if(e.x!==void 0){t.uint32(9).double(e.x)}if(e.y!==void 0){t.uint32(17).double(e.y)}if(e.w!==void 0){t.uint32(25).double(e.w)}if(e.h!==void 0){t.uint32(33).double(e.h)}if(e.layoutTarget!==void 0){t.uint32(40).int32(e.layoutTarget)}if(e.xMode!==void 0){t.uint32(48).int32(e.xMode)}if(e.yMode!==void 0){t.uint32(56).int32(e.yMode)}if(e.wMode!==void 0){t.uint32(64).int32(e.wMode)}if(e.hMode!==void 0){t.uint32(72).int32(e.hMode)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=aAt();while(n.pos>>3){case 1:{if(o!==9){break}i.x=n.double();continue}case 2:{if(o!==17){break}i.y=n.double();continue}case 3:{if(o!==25){break}i.w=n.double();continue}case 4:{if(o!==33){break}i.h=n.double();continue}case 5:{if(o!==40){break}i.layoutTarget=n.int32();continue}case 6:{if(o!==48){break}i.xMode=n.int32();continue}case 7:{if(o!==56){break}i.yMode=n.int32();continue}case 8:{if(o!==64){break}i.wMode=n.int32();continue}case 9:{if(o!==72){break}i.hMode=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return zf.fromPartial(e??{})},fromPartial(e){const t=aAt();t.x=e.x??void 0;t.y=e.y??void 0;t.w=e.w??void 0;t.h=e.h??void 0;t.layoutTarget=e.layoutTarget??void 0;t.xMode=e.xMode??void 0;t.yMode=e.yMode??void 0;t.wMode=e.wMode??void 0;t.hMode=e.hMode??void 0;return t}};function sAt(){return{text:void 0,numberFormatCode:void 0,numberFormatSourceLinked:void 0,manualLayout:void 0,textStyle:void 0,fill:void 0,stroke:void 0,textRuns:[]}}var bue={encode(e,t=new tn){if(e.text!==void 0){t.uint32(10).string(e.text)}if(e.numberFormatCode!==void 0){t.uint32(18).string(e.numberFormatCode)}if(e.numberFormatSourceLinked!==void 0){t.uint32(24).bool(e.numberFormatSourceLinked)}if(e.manualLayout!==void 0){zf.encode(e.manualLayout,t.uint32(34).fork()).join()}if(e.textStyle!==void 0){Gi.encode(e.textStyle,t.uint32(42).fork()).join()}if(e.fill!==void 0){Ei.encode(e.fill,t.uint32(50).fork()).join()}if(e.stroke!==void 0){ui.encode(e.stroke,t.uint32(58).fork()).join()}for(const n of e.textRuns){xue.encode(n,t.uint32(66).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=sAt();while(n.pos>>3){case 1:{if(o!==10){break}i.text=n.string();continue}case 2:{if(o!==18){break}i.numberFormatCode=n.string();continue}case 3:{if(o!==24){break}i.numberFormatSourceLinked=n.bool();continue}case 4:{if(o!==34){break}i.manualLayout=zf.decode(n,n.uint32());continue}case 5:{if(o!==42){break}i.textStyle=Gi.decode(n,n.uint32());continue}case 6:{if(o!==50){break}i.fill=Ei.decode(n,n.uint32());continue}case 7:{if(o!==58){break}i.stroke=ui.decode(n,n.uint32());continue}case 8:{if(o!==66){break}i.textRuns.push(xue.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return bue.fromPartial(e??{})},fromPartial(e){const t=sAt();t.text=e.text??void 0;t.numberFormatCode=e.numberFormatCode??void 0;t.numberFormatSourceLinked=e.numberFormatSourceLinked??void 0;t.manualLayout=e.manualLayout!==void 0&&e.manualLayout!==null?zf.fromPartial(e.manualLayout):void 0;t.textStyle=e.textStyle!==void 0&&e.textStyle!==null?Gi.fromPartial(e.textStyle):void 0;t.fill=e.fill!==void 0&&e.fill!==null?Ei.fromPartial(e.fill):void 0;t.stroke=e.stroke!==void 0&&e.stroke!==null?ui.fromPartial(e.stroke):void 0;t.textRuns=e.textRuns?.map(n=>xue.fromPartial(n))||[];return t}};function lAt(){return{text:"",textStyle:void 0}}var xue={encode(e,t=new tn){if(e.text!==""){t.uint32(10).string(e.text)}if(e.textStyle!==void 0){Gi.encode(e.textStyle,t.uint32(18).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=lAt();while(n.pos>>3){case 1:{if(o!==10){break}i.text=n.string();continue}case 2:{if(o!==18){break}i.textStyle=Gi.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return xue.fromPartial(e??{})},fromPartial(e){const t=lAt();t.text=e.text??"";t.textStyle=e.textStyle!==void 0&&e.textStyle!==null?Gi.fromPartial(e.textStyle):void 0;return t}};function cAt(){return{type:0,name:void 0,order:void 0,period:void 0,forward:void 0,backward:void 0,intercept:void 0,displayEquation:void 0,displayRSquared:void 0,stroke:void 0,label:void 0}}var vue={encode(e,t=new tn){if(e.type!==0){t.uint32(8).int32(e.type)}if(e.name!==void 0){t.uint32(18).string(e.name)}if(e.order!==void 0){t.uint32(24).uint32(e.order)}if(e.period!==void 0){t.uint32(32).uint32(e.period)}if(e.forward!==void 0){t.uint32(41).double(e.forward)}if(e.backward!==void 0){t.uint32(49).double(e.backward)}if(e.intercept!==void 0){t.uint32(57).double(e.intercept)}if(e.displayEquation!==void 0){t.uint32(64).bool(e.displayEquation)}if(e.displayRSquared!==void 0){t.uint32(72).bool(e.displayRSquared)}if(e.stroke!==void 0){ui.encode(e.stroke,t.uint32(82).fork()).join()}if(e.label!==void 0){bue.encode(e.label,t.uint32(90).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=cAt();while(n.pos>>3){case 1:{if(o!==8){break}i.type=n.int32();continue}case 2:{if(o!==18){break}i.name=n.string();continue}case 3:{if(o!==24){break}i.order=n.uint32();continue}case 4:{if(o!==32){break}i.period=n.uint32();continue}case 5:{if(o!==41){break}i.forward=n.double();continue}case 6:{if(o!==49){break}i.backward=n.double();continue}case 7:{if(o!==57){break}i.intercept=n.double();continue}case 8:{if(o!==64){break}i.displayEquation=n.bool();continue}case 9:{if(o!==72){break}i.displayRSquared=n.bool();continue}case 10:{if(o!==82){break}i.stroke=ui.decode(n,n.uint32());continue}case 11:{if(o!==90){break}i.label=bue.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return vue.fromPartial(e??{})},fromPartial(e){const t=cAt();t.type=e.type??0;t.name=e.name??void 0;t.order=e.order??void 0;t.period=e.period??void 0;t.forward=e.forward??void 0;t.backward=e.backward??void 0;t.intercept=e.intercept??void 0;t.displayEquation=e.displayEquation??void 0;t.displayRSquared=e.displayRSquared??void 0;t.stroke=e.stroke!==void 0&&e.stroke!==null?ui.fromPartial(e.stroke):void 0;t.label=e.label!==void 0&&e.label!==null?bue.fromPartial(e.label):void 0;return t}};function uAt(){return{fill:void 0,stroke:void 0}}var I4={encode(e,t=new tn){if(e.fill!==void 0){Ei.encode(e.fill,t.uint32(10).fork()).join()}if(e.stroke!==void 0){ui.encode(e.stroke,t.uint32(18).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=uAt();while(n.pos>>3){case 1:{if(o!==10){break}i.fill=Ei.decode(n,n.uint32());continue}case 2:{if(o!==18){break}i.stroke=ui.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return I4.fromPartial(e??{})},fromPartial(e){const t=uAt();t.fill=e.fill!==void 0&&e.fill!==null?Ei.fromPartial(e.fill):void 0;t.stroke=e.stroke!==void 0&&e.stroke!==null?ui.fromPartial(e.stroke):void 0;return t}};function dAt(){return{gapWidth:void 0,upBars:void 0,downBars:void 0}}var _ue={encode(e,t=new tn){if(e.gapWidth!==void 0){t.uint32(8).uint32(e.gapWidth)}if(e.upBars!==void 0){I4.encode(e.upBars,t.uint32(18).fork()).join()}if(e.downBars!==void 0){I4.encode(e.downBars,t.uint32(26).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=dAt();while(n.pos>>3){case 1:{if(o!==8){break}i.gapWidth=n.uint32();continue}case 2:{if(o!==18){break}i.upBars=I4.decode(n,n.uint32());continue}case 3:{if(o!==26){break}i.downBars=I4.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return _ue.fromPartial(e??{})},fromPartial(e){const t=dAt();t.gapWidth=e.gapWidth??void 0;t.upBars=e.upBars!==void 0&&e.upBars!==null?I4.fromPartial(e.upBars):void 0;t.downBars=e.downBars!==void 0&&e.downBars!==null?I4.fromPartial(e.downBars):void 0;return t}};function fAt(){return{grouping:void 0,smooth:void 0,varyColors:void 0,upDownBars:void 0,highLowLine:void 0,gapDepth:void 0}}var N4={encode(e,t=new tn){if(e.grouping!==void 0){t.uint32(8).int32(e.grouping)}if(e.smooth!==void 0){t.uint32(16).bool(e.smooth)}if(e.varyColors!==void 0){t.uint32(24).bool(e.varyColors)}if(e.upDownBars!==void 0){_ue.encode(e.upDownBars,t.uint32(34).fork()).join()}if(e.highLowLine!==void 0){ui.encode(e.highLowLine,t.uint32(42).fork()).join()}if(e.gapDepth!==void 0){t.uint32(48).uint32(e.gapDepth)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=fAt();while(n.pos>>3){case 1:{if(o!==8){break}i.grouping=n.int32();continue}case 2:{if(o!==16){break}i.smooth=n.bool();continue}case 3:{if(o!==24){break}i.varyColors=n.bool();continue}case 4:{if(o!==34){break}i.upDownBars=_ue.decode(n,n.uint32());continue}case 5:{if(o!==42){break}i.highLowLine=ui.decode(n,n.uint32());continue}case 6:{if(o!==48){break}i.gapDepth=n.uint32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return N4.fromPartial(e??{})},fromPartial(e){const t=fAt();t.grouping=e.grouping??void 0;t.smooth=e.smooth??void 0;t.varyColors=e.varyColors??void 0;t.upDownBars=e.upDownBars!==void 0&&e.upDownBars!==null?_ue.fromPartial(e.upDownBars):void 0;t.highLowLine=e.highLowLine!==void 0&&e.highLowLine!==null?ui.fromPartial(e.highLowLine):void 0;t.gapDepth=e.gapDepth??void 0;return t}};function hAt(){return{grouping:void 0,varyColors:void 0,gapDepth:void 0}}var O4={encode(e,t=new tn){if(e.grouping!==void 0){t.uint32(8).int32(e.grouping)}if(e.varyColors!==void 0){t.uint32(16).bool(e.varyColors)}if(e.gapDepth!==void 0){t.uint32(24).uint32(e.gapDepth)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=hAt();while(n.pos>>3){case 1:{if(o!==8){break}i.grouping=n.int32();continue}case 2:{if(o!==16){break}i.varyColors=n.bool();continue}case 3:{if(o!==24){break}i.gapDepth=n.uint32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return O4.fromPartial(e??{})},fromPartial(e){const t=hAt();t.grouping=e.grouping??void 0;t.varyColors=e.varyColors??void 0;t.gapDepth=e.gapDepth??void 0;return t}};function pAt(){return{firstSliceAngle:void 0,varyColors:void 0}}var Tue={encode(e,t=new tn){if(e.firstSliceAngle!==void 0){t.uint32(8).uint32(e.firstSliceAngle)}if(e.varyColors!==void 0){t.uint32(16).bool(e.varyColors)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=pAt();while(n.pos>>3){case 1:{if(o!==8){break}i.firstSliceAngle=n.uint32();continue}case 2:{if(o!==16){break}i.varyColors=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Tue.fromPartial(e??{})},fromPartial(e){const t=pAt();t.firstSliceAngle=e.firstSliceAngle??void 0;t.varyColors=e.varyColors??void 0;return t}};function mAt(){return{ofPieType:void 0,splitType:void 0,splitPosition:void 0,gapWidth:void 0,secondPieSize:void 0,secondaryIndices:[],varyColors:void 0,serLines:[]}}var wue={encode(e,t=new tn){if(e.ofPieType!==void 0){t.uint32(8).int32(e.ofPieType)}if(e.splitType!==void 0){t.uint32(16).int32(e.splitType)}if(e.splitPosition!==void 0){t.uint32(25).double(e.splitPosition)}if(e.gapWidth!==void 0){t.uint32(32).uint32(e.gapWidth)}if(e.secondPieSize!==void 0){t.uint32(40).uint32(e.secondPieSize)}t.uint32(50).fork();for(const n of e.secondaryIndices){t.uint32(n)}t.join();if(e.varyColors!==void 0){t.uint32(56).bool(e.varyColors)}for(const n of e.serLines){ui.encode(n,t.uint32(66).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=mAt();while(n.pos>>3){case 1:{if(o!==8){break}i.ofPieType=n.int32();continue}case 2:{if(o!==16){break}i.splitType=n.int32();continue}case 3:{if(o!==25){break}i.splitPosition=n.double();continue}case 4:{if(o!==32){break}i.gapWidth=n.uint32();continue}case 5:{if(o!==40){break}i.secondPieSize=n.uint32();continue}case 6:{if(o===48){i.secondaryIndices.push(n.uint32());continue}if(o===50){const a=n.uint32()+n.pos;while(n.posn)||[];t.varyColors=e.varyColors??void 0;t.serLines=e.serLines?.map(n=>ui.fromPartial(n))||[];return t}};function gAt(){return{holeSize:void 0,firstSliceAngle:void 0,varyColors:void 0}}var Eue={encode(e,t=new tn){if(e.holeSize!==void 0){t.uint32(8).uint32(e.holeSize)}if(e.firstSliceAngle!==void 0){t.uint32(16).uint32(e.firstSliceAngle)}if(e.varyColors!==void 0){t.uint32(24).bool(e.varyColors)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=gAt();while(n.pos>>3){case 1:{if(o!==8){break}i.holeSize=n.uint32();continue}case 2:{if(o!==16){break}i.firstSliceAngle=n.uint32();continue}case 3:{if(o!==24){break}i.varyColors=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Eue.fromPartial(e??{})},fromPartial(e){const t=gAt();t.holeSize=e.holeSize??void 0;t.firstSliceAngle=e.firstSliceAngle??void 0;t.varyColors=e.varyColors??void 0;return t}};function yAt(){return{style:void 0,varyColors:void 0}}var B4={encode(e,t=new tn){if(e.style!==void 0){t.uint32(8).int32(e.style)}if(e.varyColors!==void 0){t.uint32(16).bool(e.varyColors)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=yAt();while(n.pos>>3){case 1:{if(o!==8){break}i.style=n.int32();continue}case 2:{if(o!==16){break}i.varyColors=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return B4.fromPartial(e??{})},fromPartial(e){const t=yAt();t.style=e.style??void 0;t.varyColors=e.varyColors??void 0;return t}};function bAt(){return{is3d:void 0,scale:void 0,showNegative:void 0,varyColors:void 0,sizeRepresents:void 0}}var z4={encode(e,t=new tn){if(e.is3d!==void 0){t.uint32(8).bool(e.is3d)}if(e.scale!==void 0){t.uint32(16).uint32(e.scale)}if(e.showNegative!==void 0){t.uint32(24).bool(e.showNegative)}if(e.varyColors!==void 0){t.uint32(32).bool(e.varyColors)}if(e.sizeRepresents!==void 0){t.uint32(40).int32(e.sizeRepresents)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=bAt();while(n.pos>>3){case 1:{if(o!==8){break}i.is3d=n.bool();continue}case 2:{if(o!==16){break}i.scale=n.uint32();continue}case 3:{if(o!==24){break}i.showNegative=n.bool();continue}case 4:{if(o!==32){break}i.varyColors=n.bool();continue}case 5:{if(o!==40){break}i.sizeRepresents=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return z4.fromPartial(e??{})},fromPartial(e){const t=bAt();t.is3d=e.is3d??void 0;t.scale=e.scale??void 0;t.showNegative=e.showNegative??void 0;t.varyColors=e.varyColors??void 0;t.sizeRepresents=e.sizeRepresents??void 0;return t}};function xAt(){return{style:void 0,varyColors:void 0}}var U4={encode(e,t=new tn){if(e.style!==void 0){t.uint32(8).int32(e.style)}if(e.varyColors!==void 0){t.uint32(16).bool(e.varyColors)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=xAt();while(n.pos>>3){case 1:{if(o!==8){break}i.style=n.int32();continue}case 2:{if(o!==16){break}i.varyColors=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return U4.fromPartial(e??{})},fromPartial(e){const t=xAt();t.style=e.style??void 0;t.varyColors=e.varyColors??void 0;return t}};function vAt(){return{wireframe:void 0}}var Cue={encode(e,t=new tn){if(e.wireframe!==void 0){t.uint32(8).bool(e.wireframe)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=vAt();while(n.pos>>3){case 1:{if(o!==8){break}i.wireframe=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Cue.fromPartial(e??{})},fromPartial(e){const t=vAt();t.wireframe=e.wireframe??void 0;return t}};function _At(){return{idx:0,fill:void 0,stroke:void 0,explosion:void 0,outerShadow:void 0,marker:void 0}}var Sue={encode(e,t=new tn){if(e.idx!==0){t.uint32(8).int32(e.idx)}if(e.fill!==void 0){Ei.encode(e.fill,t.uint32(18).fork()).join()}if(e.stroke!==void 0){ui.encode(e.stroke,t.uint32(26).fork()).join()}if(e.explosion!==void 0){t.uint32(32).uint32(e.explosion)}if(e.outerShadow!==void 0){DA.encode(e.outerShadow,t.uint32(42).fork()).join()}if(e.marker!==void 0){J2.encode(e.marker,t.uint32(50).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=_At();while(n.pos>>3){case 1:{if(o!==8){break}i.idx=n.int32();continue}case 2:{if(o!==18){break}i.fill=Ei.decode(n,n.uint32());continue}case 3:{if(o!==26){break}i.stroke=ui.decode(n,n.uint32());continue}case 4:{if(o!==32){break}i.explosion=n.uint32();continue}case 5:{if(o!==42){break}i.outerShadow=DA.decode(n,n.uint32());continue}case 6:{if(o!==50){break}i.marker=J2.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Sue.fromPartial(e??{})},fromPartial(e){const t=_At();t.idx=e.idx??0;t.fill=e.fill!==void 0&&e.fill!==null?Ei.fromPartial(e.fill):void 0;t.stroke=e.stroke!==void 0&&e.stroke!==null?ui.fromPartial(e.stroke):void 0;t.explosion=e.explosion??void 0;t.outerShadow=e.outerShadow!==void 0&&e.outerShadow!==null?DA.fromPartial(e.outerShadow):void 0;t.marker=e.marker!==void 0&&e.marker!==null?J2.fromPartial(e.marker):void 0;return t}};function TAt(){return{builtInUnit:void 0,customUnit:void 0,label:void 0}}var Aue={encode(e,t=new tn){if(e.builtInUnit!==void 0){t.uint32(8).int32(e.builtInUnit)}if(e.customUnit!==void 0){t.uint32(17).double(e.customUnit)}if(e.label!==void 0){kue.encode(e.label,t.uint32(26).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=TAt();while(n.pos>>3){case 1:{if(o!==8){break}i.builtInUnit=n.int32();continue}case 2:{if(o!==17){break}i.customUnit=n.double();continue}case 3:{if(o!==26){break}i.label=kue.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Aue.fromPartial(e??{})},fromPartial(e){const t=TAt();t.builtInUnit=e.builtInUnit??void 0;t.customUnit=e.customUnit??void 0;t.label=e.label!==void 0&&e.label!==null?kue.fromPartial(e.label):void 0;return t}};function wAt(){return{textStyle:void 0,manualLayout:void 0,fill:void 0,stroke:void 0,chartText:void 0}}var kue={encode(e,t=new tn){if(e.textStyle!==void 0){Gi.encode(e.textStyle,t.uint32(10).fork()).join()}if(e.manualLayout!==void 0){zf.encode(e.manualLayout,t.uint32(18).fork()).join()}if(e.fill!==void 0){Ei.encode(e.fill,t.uint32(26).fork()).join()}if(e.stroke!==void 0){ui.encode(e.stroke,t.uint32(34).fork()).join()}if(e.chartText!==void 0){p1.encode(e.chartText,t.uint32(42).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=wAt();while(n.pos>>3){case 1:{if(o!==10){break}i.textStyle=Gi.decode(n,n.uint32());continue}case 2:{if(o!==18){break}i.manualLayout=zf.decode(n,n.uint32());continue}case 3:{if(o!==26){break}i.fill=Ei.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.stroke=ui.decode(n,n.uint32());continue}case 5:{if(o!==42){break}i.chartText=p1.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return kue.fromPartial(e??{})},fromPartial(e){const t=wAt();t.textStyle=e.textStyle!==void 0&&e.textStyle!==null?Gi.fromPartial(e.textStyle):void 0;t.manualLayout=e.manualLayout!==void 0&&e.manualLayout!==null?zf.fromPartial(e.manualLayout):void 0;t.fill=e.fill!==void 0&&e.fill!==null?Ei.fromPartial(e.fill):void 0;t.stroke=e.stroke!==void 0&&e.stroke!==null?ui.fromPartial(e.stroke):void 0;t.chartText=e.chartText!==void 0&&e.chartText!==null?p1.fromPartial(e.chartText):void 0;return t}};function EAt(){return{textStyle:void 0,line:void 0,min:void 0,max:void 0,majorGridlines:void 0,minorGridlines:void 0,numberFormatCode:void 0,numberFormatSourceLinked:void 0,majorUnit:void 0,minorUnit:void 0,position:void 0,orientation:void 0,majorTickMark:void 0,minorTickMark:void 0,tickLabelPosition:void 0,crossBetween:void 0,crosses:void 0,crossValue:void 0,deleted:void 0,title:void 0,titleTextStyle:void 0,tickLabelInterval:void 0,tickMarkInterval:void 0,id:void 0,kind:void 0,crossingAxisId:void 0,categoryGapWidth:void 0,unit:void 0,logBase:void 0,baseTimeUnit:void 0,majorTimeUnit:void 0,minorTimeUnit:void 0,titleManualLayout:void 0,displayUnits:void 0,titleText:void 0,titleOverlay:void 0,labelOffsetPercent:void 0,labelAlignment:void 0,noMultiLevelLabels:void 0}}var j2={encode(e,t=new tn){if(e.textStyle!==void 0){Gi.encode(e.textStyle,t.uint32(10).fork()).join()}if(e.line!==void 0){ui.encode(e.line,t.uint32(18).fork()).join()}if(e.min!==void 0){t.uint32(25).double(e.min)}if(e.max!==void 0){t.uint32(33).double(e.max)}if(e.majorGridlines!==void 0){ui.encode(e.majorGridlines,t.uint32(42).fork()).join()}if(e.minorGridlines!==void 0){ui.encode(e.minorGridlines,t.uint32(50).fork()).join()}if(e.numberFormatCode!==void 0){t.uint32(58).string(e.numberFormatCode)}if(e.numberFormatSourceLinked!==void 0){t.uint32(168).bool(e.numberFormatSourceLinked)}if(e.majorUnit!==void 0){t.uint32(65).double(e.majorUnit)}if(e.minorUnit!==void 0){t.uint32(73).double(e.minorUnit)}if(e.position!==void 0){t.uint32(80).int32(e.position)}if(e.orientation!==void 0){t.uint32(88).int32(e.orientation)}if(e.majorTickMark!==void 0){t.uint32(96).int32(e.majorTickMark)}if(e.minorTickMark!==void 0){t.uint32(104).int32(e.minorTickMark)}if(e.tickLabelPosition!==void 0){t.uint32(112).int32(e.tickLabelPosition)}if(e.crossBetween!==void 0){t.uint32(120).int32(e.crossBetween)}if(e.crosses!==void 0){t.uint32(128).int32(e.crosses)}if(e.crossValue!==void 0){t.uint32(137).double(e.crossValue)}if(e.deleted!==void 0){t.uint32(144).bool(e.deleted)}if(e.title!==void 0){t.uint32(154).string(e.title)}if(e.titleTextStyle!==void 0){Gi.encode(e.titleTextStyle,t.uint32(162).fork()).join()}if(e.tickLabelInterval!==void 0){t.uint32(176).uint32(e.tickLabelInterval)}if(e.tickMarkInterval!==void 0){t.uint32(184).uint32(e.tickMarkInterval)}if(e.id!==void 0){t.uint32(192).uint32(e.id)}if(e.kind!==void 0){t.uint32(200).int32(e.kind)}if(e.crossingAxisId!==void 0){t.uint32(208).uint32(e.crossingAxisId)}if(e.categoryGapWidth!==void 0){t.uint32(217).double(e.categoryGapWidth)}if(e.unit!==void 0){t.uint32(224).int32(e.unit)}if(e.logBase!==void 0){t.uint32(233).double(e.logBase)}if(e.baseTimeUnit!==void 0){t.uint32(240).int32(e.baseTimeUnit)}if(e.majorTimeUnit!==void 0){t.uint32(248).int32(e.majorTimeUnit)}if(e.minorTimeUnit!==void 0){t.uint32(256).int32(e.minorTimeUnit)}if(e.titleManualLayout!==void 0){zf.encode(e.titleManualLayout,t.uint32(266).fork()).join()}if(e.displayUnits!==void 0){Aue.encode(e.displayUnits,t.uint32(274).fork()).join()}if(e.titleText!==void 0){p1.encode(e.titleText,t.uint32(282).fork()).join()}if(e.titleOverlay!==void 0){t.uint32(288).bool(e.titleOverlay)}if(e.labelOffsetPercent!==void 0){t.uint32(296).uint32(e.labelOffsetPercent)}if(e.labelAlignment!==void 0){t.uint32(304).int32(e.labelAlignment)}if(e.noMultiLevelLabels!==void 0){t.uint32(312).bool(e.noMultiLevelLabels)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=EAt();while(n.pos>>3){case 1:{if(o!==10){break}i.textStyle=Gi.decode(n,n.uint32());continue}case 2:{if(o!==18){break}i.line=ui.decode(n,n.uint32());continue}case 3:{if(o!==25){break}i.min=n.double();continue}case 4:{if(o!==33){break}i.max=n.double();continue}case 5:{if(o!==42){break}i.majorGridlines=ui.decode(n,n.uint32());continue}case 6:{if(o!==50){break}i.minorGridlines=ui.decode(n,n.uint32());continue}case 7:{if(o!==58){break}i.numberFormatCode=n.string();continue}case 21:{if(o!==168){break}i.numberFormatSourceLinked=n.bool();continue}case 8:{if(o!==65){break}i.majorUnit=n.double();continue}case 9:{if(o!==73){break}i.minorUnit=n.double();continue}case 10:{if(o!==80){break}i.position=n.int32();continue}case 11:{if(o!==88){break}i.orientation=n.int32();continue}case 12:{if(o!==96){break}i.majorTickMark=n.int32();continue}case 13:{if(o!==104){break}i.minorTickMark=n.int32();continue}case 14:{if(o!==112){break}i.tickLabelPosition=n.int32();continue}case 15:{if(o!==120){break}i.crossBetween=n.int32();continue}case 16:{if(o!==128){break}i.crosses=n.int32();continue}case 17:{if(o!==137){break}i.crossValue=n.double();continue}case 18:{if(o!==144){break}i.deleted=n.bool();continue}case 19:{if(o!==154){break}i.title=n.string();continue}case 20:{if(o!==162){break}i.titleTextStyle=Gi.decode(n,n.uint32());continue}case 22:{if(o!==176){break}i.tickLabelInterval=n.uint32();continue}case 23:{if(o!==184){break}i.tickMarkInterval=n.uint32();continue}case 24:{if(o!==192){break}i.id=n.uint32();continue}case 25:{if(o!==200){break}i.kind=n.int32();continue}case 26:{if(o!==208){break}i.crossingAxisId=n.uint32();continue}case 27:{if(o!==217){break}i.categoryGapWidth=n.double();continue}case 28:{if(o!==224){break}i.unit=n.int32();continue}case 29:{if(o!==233){break}i.logBase=n.double();continue}case 30:{if(o!==240){break}i.baseTimeUnit=n.int32();continue}case 31:{if(o!==248){break}i.majorTimeUnit=n.int32();continue}case 32:{if(o!==256){break}i.minorTimeUnit=n.int32();continue}case 33:{if(o!==266){break}i.titleManualLayout=zf.decode(n,n.uint32());continue}case 34:{if(o!==274){break}i.displayUnits=Aue.decode(n,n.uint32());continue}case 35:{if(o!==282){break}i.titleText=p1.decode(n,n.uint32());continue}case 36:{if(o!==288){break}i.titleOverlay=n.bool();continue}case 37:{if(o!==296){break}i.labelOffsetPercent=n.uint32();continue}case 38:{if(o!==304){break}i.labelAlignment=n.int32();continue}case 39:{if(o!==312){break}i.noMultiLevelLabels=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return j2.fromPartial(e??{})},fromPartial(e){const t=EAt();t.textStyle=e.textStyle!==void 0&&e.textStyle!==null?Gi.fromPartial(e.textStyle):void 0;t.line=e.line!==void 0&&e.line!==null?ui.fromPartial(e.line):void 0;t.min=e.min??void 0;t.max=e.max??void 0;t.majorGridlines=e.majorGridlines!==void 0&&e.majorGridlines!==null?ui.fromPartial(e.majorGridlines):void 0;t.minorGridlines=e.minorGridlines!==void 0&&e.minorGridlines!==null?ui.fromPartial(e.minorGridlines):void 0;t.numberFormatCode=e.numberFormatCode??void 0;t.numberFormatSourceLinked=e.numberFormatSourceLinked??void 0;t.majorUnit=e.majorUnit??void 0;t.minorUnit=e.minorUnit??void 0;t.position=e.position??void 0;t.orientation=e.orientation??void 0;t.majorTickMark=e.majorTickMark??void 0;t.minorTickMark=e.minorTickMark??void 0;t.tickLabelPosition=e.tickLabelPosition??void 0;t.crossBetween=e.crossBetween??void 0;t.crosses=e.crosses??void 0;t.crossValue=e.crossValue??void 0;t.deleted=e.deleted??void 0;t.title=e.title??void 0;t.titleTextStyle=e.titleTextStyle!==void 0&&e.titleTextStyle!==null?Gi.fromPartial(e.titleTextStyle):void 0;t.tickLabelInterval=e.tickLabelInterval??void 0;t.tickMarkInterval=e.tickMarkInterval??void 0;t.id=e.id??void 0;t.kind=e.kind??void 0;t.crossingAxisId=e.crossingAxisId??void 0;t.categoryGapWidth=e.categoryGapWidth??void 0;t.unit=e.unit??void 0;t.logBase=e.logBase??void 0;t.baseTimeUnit=e.baseTimeUnit??void 0;t.majorTimeUnit=e.majorTimeUnit??void 0;t.minorTimeUnit=e.minorTimeUnit??void 0;t.titleManualLayout=e.titleManualLayout!==void 0&&e.titleManualLayout!==null?zf.fromPartial(e.titleManualLayout):void 0;t.displayUnits=e.displayUnits!==void 0&&e.displayUnits!==null?Aue.fromPartial(e.displayUnits):void 0;t.titleText=e.titleText!==void 0&&e.titleText!==null?p1.fromPartial(e.titleText):void 0;t.titleOverlay=e.titleOverlay??void 0;t.labelOffsetPercent=e.labelOffsetPercent??void 0;t.labelAlignment=e.labelAlignment??void 0;t.noMultiLevelLabels=e.noMultiLevelLabels??void 0;return t}};function CAt(){return{showValue:void 0,position:0,textStyle:void 0,leaderLine:void 0,fill:void 0,stroke:void 0,showCategoryName:void 0,showSeriesName:void 0,showLegendKey:void 0,showPercent:void 0,showBubbleSize:void 0,showLeaderLines:void 0,showDataLabelsRange:void 0,dataLabelsRangeFormula:void 0,showFlagsPresentMask:void 0,separator:void 0,numberFormatCode:void 0,numberFormatSourceLinked:void 0,deleted:void 0}}var Z2={encode(e,t=new tn){if(e.showValue!==void 0){t.uint32(8).bool(e.showValue)}if(e.position!==0){t.uint32(16).int32(e.position)}if(e.textStyle!==void 0){Gi.encode(e.textStyle,t.uint32(26).fork()).join()}if(e.leaderLine!==void 0){ui.encode(e.leaderLine,t.uint32(34).fork()).join()}if(e.fill!==void 0){Ei.encode(e.fill,t.uint32(42).fork()).join()}if(e.stroke!==void 0){ui.encode(e.stroke,t.uint32(50).fork()).join()}if(e.showCategoryName!==void 0){t.uint32(56).bool(e.showCategoryName)}if(e.showSeriesName!==void 0){t.uint32(64).bool(e.showSeriesName)}if(e.showLegendKey!==void 0){t.uint32(72).bool(e.showLegendKey)}if(e.showPercent!==void 0){t.uint32(80).bool(e.showPercent)}if(e.showBubbleSize!==void 0){t.uint32(88).bool(e.showBubbleSize)}if(e.showLeaderLines!==void 0){t.uint32(96).bool(e.showLeaderLines)}if(e.showDataLabelsRange!==void 0){t.uint32(104).bool(e.showDataLabelsRange)}if(e.dataLabelsRangeFormula!==void 0){t.uint32(114).string(e.dataLabelsRangeFormula)}if(e.showFlagsPresentMask!==void 0){t.uint32(120).uint32(e.showFlagsPresentMask)}if(e.separator!==void 0){t.uint32(130).string(e.separator)}if(e.numberFormatCode!==void 0){t.uint32(138).string(e.numberFormatCode)}if(e.numberFormatSourceLinked!==void 0){t.uint32(144).bool(e.numberFormatSourceLinked)}if(e.deleted!==void 0){t.uint32(152).bool(e.deleted)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=CAt();while(n.pos>>3){case 1:{if(o!==8){break}i.showValue=n.bool();continue}case 2:{if(o!==16){break}i.position=n.int32();continue}case 3:{if(o!==26){break}i.textStyle=Gi.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.leaderLine=ui.decode(n,n.uint32());continue}case 5:{if(o!==42){break}i.fill=Ei.decode(n,n.uint32());continue}case 6:{if(o!==50){break}i.stroke=ui.decode(n,n.uint32());continue}case 7:{if(o!==56){break}i.showCategoryName=n.bool();continue}case 8:{if(o!==64){break}i.showSeriesName=n.bool();continue}case 9:{if(o!==72){break}i.showLegendKey=n.bool();continue}case 10:{if(o!==80){break}i.showPercent=n.bool();continue}case 11:{if(o!==88){break}i.showBubbleSize=n.bool();continue}case 12:{if(o!==96){break}i.showLeaderLines=n.bool();continue}case 13:{if(o!==104){break}i.showDataLabelsRange=n.bool();continue}case 14:{if(o!==114){break}i.dataLabelsRangeFormula=n.string();continue}case 15:{if(o!==120){break}i.showFlagsPresentMask=n.uint32();continue}case 16:{if(o!==130){break}i.separator=n.string();continue}case 17:{if(o!==138){break}i.numberFormatCode=n.string();continue}case 18:{if(o!==144){break}i.numberFormatSourceLinked=n.bool();continue}case 19:{if(o!==152){break}i.deleted=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Z2.fromPartial(e??{})},fromPartial(e){const t=CAt();t.showValue=e.showValue??void 0;t.position=e.position??0;t.textStyle=e.textStyle!==void 0&&e.textStyle!==null?Gi.fromPartial(e.textStyle):void 0;t.leaderLine=e.leaderLine!==void 0&&e.leaderLine!==null?ui.fromPartial(e.leaderLine):void 0;t.fill=e.fill!==void 0&&e.fill!==null?Ei.fromPartial(e.fill):void 0;t.stroke=e.stroke!==void 0&&e.stroke!==null?ui.fromPartial(e.stroke):void 0;t.showCategoryName=e.showCategoryName??void 0;t.showSeriesName=e.showSeriesName??void 0;t.showLegendKey=e.showLegendKey??void 0;t.showPercent=e.showPercent??void 0;t.showBubbleSize=e.showBubbleSize??void 0;t.showLeaderLines=e.showLeaderLines??void 0;t.showDataLabelsRange=e.showDataLabelsRange??void 0;t.dataLabelsRangeFormula=e.dataLabelsRangeFormula??void 0;t.showFlagsPresentMask=e.showFlagsPresentMask??void 0;t.separator=e.separator??void 0;t.numberFormatCode=e.numberFormatCode??void 0;t.numberFormatSourceLinked=e.numberFormatSourceLinked??void 0;t.deleted=e.deleted??void 0;return t}};function SAt(){return{idx:0,text:void 0,position:void 0,textStyle:void 0,fill:void 0,stroke:void 0,showValue:void 0,showCategoryName:void 0,showSeriesName:void 0,showLegendKey:void 0,showPercent:void 0,showBubbleSize:void 0,separator:void 0,manualLayout:void 0,chartText:void 0}}var Rue={encode(e,t=new tn){if(e.idx!==0){t.uint32(8).int32(e.idx)}if(e.text!==void 0){t.uint32(18).string(e.text)}if(e.position!==void 0){t.uint32(24).int32(e.position)}if(e.textStyle!==void 0){Gi.encode(e.textStyle,t.uint32(34).fork()).join()}if(e.fill!==void 0){Ei.encode(e.fill,t.uint32(42).fork()).join()}if(e.stroke!==void 0){ui.encode(e.stroke,t.uint32(50).fork()).join()}if(e.showValue!==void 0){t.uint32(56).bool(e.showValue)}if(e.showCategoryName!==void 0){t.uint32(64).bool(e.showCategoryName)}if(e.showSeriesName!==void 0){t.uint32(72).bool(e.showSeriesName)}if(e.showLegendKey!==void 0){t.uint32(80).bool(e.showLegendKey)}if(e.showPercent!==void 0){t.uint32(88).bool(e.showPercent)}if(e.showBubbleSize!==void 0){t.uint32(96).bool(e.showBubbleSize)}if(e.separator!==void 0){t.uint32(106).string(e.separator)}if(e.manualLayout!==void 0){zf.encode(e.manualLayout,t.uint32(114).fork()).join()}if(e.chartText!==void 0){p1.encode(e.chartText,t.uint32(122).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=SAt();while(n.pos>>3){case 1:{if(o!==8){break}i.idx=n.int32();continue}case 2:{if(o!==18){break}i.text=n.string();continue}case 3:{if(o!==24){break}i.position=n.int32();continue}case 4:{if(o!==34){break}i.textStyle=Gi.decode(n,n.uint32());continue}case 5:{if(o!==42){break}i.fill=Ei.decode(n,n.uint32());continue}case 6:{if(o!==50){break}i.stroke=ui.decode(n,n.uint32());continue}case 7:{if(o!==56){break}i.showValue=n.bool();continue}case 8:{if(o!==64){break}i.showCategoryName=n.bool();continue}case 9:{if(o!==72){break}i.showSeriesName=n.bool();continue}case 10:{if(o!==80){break}i.showLegendKey=n.bool();continue}case 11:{if(o!==88){break}i.showPercent=n.bool();continue}case 12:{if(o!==96){break}i.showBubbleSize=n.bool();continue}case 13:{if(o!==106){break}i.separator=n.string();continue}case 14:{if(o!==114){break}i.manualLayout=zf.decode(n,n.uint32());continue}case 15:{if(o!==122){break}i.chartText=p1.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Rue.fromPartial(e??{})},fromPartial(e){const t=SAt();t.idx=e.idx??0;t.text=e.text??void 0;t.position=e.position??void 0;t.textStyle=e.textStyle!==void 0&&e.textStyle!==null?Gi.fromPartial(e.textStyle):void 0;t.fill=e.fill!==void 0&&e.fill!==null?Ei.fromPartial(e.fill):void 0;t.stroke=e.stroke!==void 0&&e.stroke!==null?ui.fromPartial(e.stroke):void 0;t.showValue=e.showValue??void 0;t.showCategoryName=e.showCategoryName??void 0;t.showSeriesName=e.showSeriesName??void 0;t.showLegendKey=e.showLegendKey??void 0;t.showPercent=e.showPercent??void 0;t.showBubbleSize=e.showBubbleSize??void 0;t.separator=e.separator??void 0;t.manualLayout=e.manualLayout!==void 0&&e.manualLayout!==null?zf.fromPartial(e.manualLayout):void 0;t.chartText=e.chartText!==void 0&&e.chartText!==null?p1.fromPartial(e.chartText):void 0;return t}};function AAt(){return{mapArea:void 0,projection:void 0,labelLayout:void 0,dataLevel:void 0,showUnknown:void 0,onlyRegionsWithData:void 0,regionFilter:void 0,colorScale:[],buckets:void 0,classification:void 0,colorScaleDetails:void 0}}var Pue={encode(e,t=new tn){if(e.mapArea!==void 0){t.uint32(8).int32(e.mapArea)}if(e.projection!==void 0){t.uint32(16).int32(e.projection)}if(e.labelLayout!==void 0){t.uint32(24).int32(e.labelLayout)}if(e.dataLevel!==void 0){t.uint32(32).int32(e.dataLevel)}if(e.showUnknown!==void 0){t.uint32(40).bool(e.showUnknown)}if(e.onlyRegionsWithData!==void 0){t.uint32(48).bool(e.onlyRegionsWithData)}if(e.regionFilter!==void 0){t.uint32(58).string(e.regionFilter)}for(const n of e.colorScale){hi.encode(n,t.uint32(66).fork()).join()}if(e.buckets!==void 0){t.uint32(72).int32(e.buckets)}if(e.classification!==void 0){t.uint32(80).int32(e.classification)}if(e.colorScaleDetails!==void 0){$ue.encode(e.colorScaleDetails,t.uint32(90).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=AAt();while(n.pos>>3){case 1:{if(o!==8){break}i.mapArea=n.int32();continue}case 2:{if(o!==16){break}i.projection=n.int32();continue}case 3:{if(o!==24){break}i.labelLayout=n.int32();continue}case 4:{if(o!==32){break}i.dataLevel=n.int32();continue}case 5:{if(o!==40){break}i.showUnknown=n.bool();continue}case 6:{if(o!==48){break}i.onlyRegionsWithData=n.bool();continue}case 7:{if(o!==58){break}i.regionFilter=n.string();continue}case 8:{if(o!==66){break}i.colorScale.push(hi.decode(n,n.uint32()));continue}case 9:{if(o!==72){break}i.buckets=n.int32();continue}case 10:{if(o!==80){break}i.classification=n.int32();continue}case 11:{if(o!==90){break}i.colorScaleDetails=$ue.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Pue.fromPartial(e??{})},fromPartial(e){const t=AAt();t.mapArea=e.mapArea??void 0;t.projection=e.projection??void 0;t.labelLayout=e.labelLayout??void 0;t.dataLevel=e.dataLevel??void 0;t.showUnknown=e.showUnknown??void 0;t.onlyRegionsWithData=e.onlyRegionsWithData??void 0;t.regionFilter=e.regionFilter??void 0;t.colorScale=e.colorScale?.map(n=>hi.fromPartial(n))||[];t.buckets=e.buckets??void 0;t.classification=e.classification??void 0;t.colorScaleDetails=e.colorScaleDetails!==void 0&&e.colorScaleDetails!==null?$ue.fromPartial(e.colorScaleDetails):void 0;return t}};function kAt(){return{levels:[]}}var Iue={encode(e,t=new tn){for(const n of e.levels){t.uint32(10).string(n)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=kAt();while(n.pos>>3){case 1:{if(o!==10){break}i.levels.push(n.string());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Iue.fromPartial(e??{})},fromPartial(e){const t=kAt();t.levels=e.levels?.map(n=>n)||[];return t}};function RAt(){return{parentLabelLayout:void 0}}var Mue={encode(e,t=new tn){if(e.parentLabelLayout!==void 0){t.uint32(8).int32(e.parentLabelLayout)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=RAt();while(n.pos>>3){case 1:{if(o!==8){break}i.parentLabelLayout=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Mue.fromPartial(e??{})},fromPartial(e){const t=RAt();t.parentLabelLayout=e.parentLabelLayout??void 0;return t}};function PAt(){return{showMeanLine:void 0,showMeanMarker:void 0,showNonOutliers:void 0,showOutliers:void 0,quartileMethod:void 0}}var Lue={encode(e,t=new tn){if(e.showMeanLine!==void 0){t.uint32(8).bool(e.showMeanLine)}if(e.showMeanMarker!==void 0){t.uint32(16).bool(e.showMeanMarker)}if(e.showNonOutliers!==void 0){t.uint32(24).bool(e.showNonOutliers)}if(e.showOutliers!==void 0){t.uint32(32).bool(e.showOutliers)}if(e.quartileMethod!==void 0){t.uint32(40).int32(e.quartileMethod)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=PAt();while(n.pos>>3){case 1:{if(o!==8){break}i.showMeanLine=n.bool();continue}case 2:{if(o!==16){break}i.showMeanMarker=n.bool();continue}case 3:{if(o!==24){break}i.showNonOutliers=n.bool();continue}case 4:{if(o!==32){break}i.showOutliers=n.bool();continue}case 5:{if(o!==40){break}i.quartileMethod=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Lue.fromPartial(e??{})},fromPartial(e){const t=PAt();t.showMeanLine=e.showMeanLine??void 0;t.showMeanMarker=e.showMeanMarker??void 0;t.showNonOutliers=e.showNonOutliers??void 0;t.showOutliers=e.showOutliers??void 0;t.quartileMethod=e.quartileMethod??void 0;return t}};function IAt(){return{intervalClosed:void 0,binWidth:void 0,binCount:void 0,underflow:void 0,overflow:void 0,aggregated:void 0}}var Due={encode(e,t=new tn){if(e.intervalClosed!==void 0){t.uint32(8).int32(e.intervalClosed)}if(e.binWidth!==void 0){t.uint32(17).double(e.binWidth)}if(e.binCount!==void 0){t.uint32(24).uint32(e.binCount)}if(e.underflow!==void 0){t.uint32(33).double(e.underflow)}if(e.overflow!==void 0){t.uint32(41).double(e.overflow)}if(e.aggregated!==void 0){t.uint32(48).bool(e.aggregated)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=IAt();while(n.pos>>3){case 1:{if(o!==8){break}i.intervalClosed=n.int32();continue}case 2:{if(o!==17){break}i.binWidth=n.double();continue}case 3:{if(o!==24){break}i.binCount=n.uint32();continue}case 4:{if(o!==33){break}i.underflow=n.double();continue}case 5:{if(o!==41){break}i.overflow=n.double();continue}case 6:{if(o!==48){break}i.aggregated=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Due.fromPartial(e??{})},fromPartial(e){const t=IAt();t.intervalClosed=e.intervalClosed??void 0;t.binWidth=e.binWidth??void 0;t.binCount=e.binCount??void 0;t.underflow=e.underflow??void 0;t.overflow=e.overflow??void 0;t.aggregated=e.aggregated??void 0;return t}};function MAt(){return{artifactId:"",autoUpdate:void 0}}var Fue={encode(e,t=new tn){if(e.artifactId!==""){t.uint32(10).string(e.artifactId)}if(e.autoUpdate!==void 0){t.uint32(16).bool(e.autoUpdate)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=MAt();while(n.pos>>3){case 1:{if(o!==10){break}i.artifactId=n.string();continue}case 2:{if(o!==16){break}i.autoUpdate=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Fue.fromPartial(e??{})},fromPartial(e){const t=MAt();t.artifactId=e.artifactId??"";t.autoUpdate=e.autoUpdate??void 0;return t}};function LAt(){return{subtotalIndices:[]}}var Nue={encode(e,t=new tn){t.uint32(10).fork();for(const n of e.subtotalIndices){t.uint32(n)}t.join();return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=LAt();while(n.pos>>3){case 1:{if(o===8){i.subtotalIndices.push(n.uint32());continue}if(o===10){const a=n.uint32()+n.pos;while(n.posn)||[];return t}};function DAt(){return{gapWidth:void 0}}var Oue={encode(e,t=new tn){if(e.gapWidth!==void 0){t.uint32(9).double(e.gapWidth)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=DAt();while(n.pos>>3){case 1:{if(o!==9){break}i.gapWidth=n.double();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Oue.fromPartial(e??{})},fromPartial(e){const t=DAt();t.gapWidth=e.gapWidth??void 0;return t}};function FAt(){return{styleId:void 0,colorStyleId:void 0,palette:[],themeName:void 0,colorStyleMethod:void 0,chartStyleEntries:[],chartStyleMarkerLayout:void 0,colorStyleVariations:[]}}var Bue={encode(e,t=new tn){if(e.styleId!==void 0){t.uint32(8).int32(e.styleId)}if(e.colorStyleId!==void 0){t.uint32(16).int32(e.colorStyleId)}for(const n of e.palette){hi.encode(n,t.uint32(26).fork()).join()}if(e.themeName!==void 0){t.uint32(34).string(e.themeName)}if(e.colorStyleMethod!==void 0){t.uint32(42).string(e.colorStyleMethod)}for(const n of e.chartStyleEntries){Vue.encode(n,t.uint32(50).fork()).join()}if(e.chartStyleMarkerLayout!==void 0){J2.encode(e.chartStyleMarkerLayout,t.uint32(58).fork()).join()}for(const n of e.colorStyleVariations){NI.encode(n,t.uint32(66).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=FAt();while(n.pos>>3){case 1:{if(o!==8){break}i.styleId=n.int32();continue}case 2:{if(o!==16){break}i.colorStyleId=n.int32();continue}case 3:{if(o!==26){break}i.palette.push(hi.decode(n,n.uint32()));continue}case 4:{if(o!==34){break}i.themeName=n.string();continue}case 5:{if(o!==42){break}i.colorStyleMethod=n.string();continue}case 6:{if(o!==50){break}i.chartStyleEntries.push(Vue.decode(n,n.uint32()));continue}case 7:{if(o!==58){break}i.chartStyleMarkerLayout=J2.decode(n,n.uint32());continue}case 8:{if(o!==66){break}i.colorStyleVariations.push(NI.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Bue.fromPartial(e??{})},fromPartial(e){const t=FAt();t.styleId=e.styleId??void 0;t.colorStyleId=e.colorStyleId??void 0;t.palette=e.palette?.map(n=>hi.fromPartial(n))||[];t.themeName=e.themeName??void 0;t.colorStyleMethod=e.colorStyleMethod??void 0;t.chartStyleEntries=e.chartStyleEntries?.map(n=>Vue.fromPartial(n))||[];t.chartStyleMarkerLayout=e.chartStyleMarkerLayout!==void 0&&e.chartStyleMarkerLayout!==null?J2.fromPartial(e.chartStyleMarkerLayout):void 0;t.colorStyleVariations=e.colorStyleVariations?.map(n=>NI.fromPartial(n))||[];return t}};function NAt(){return{index:void 0,modifiers:void 0,color:void 0,styleColor:void 0}}var K2={encode(e,t=new tn){if(e.index!==void 0){t.uint32(8).uint32(e.index)}if(e.modifiers!==void 0){t.uint32(18).string(e.modifiers)}if(e.color!==void 0){hi.encode(e.color,t.uint32(26).fork()).join()}if(e.styleColor!==void 0){t.uint32(34).string(e.styleColor)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=NAt();while(n.pos>>3){case 1:{if(o!==8){break}i.index=n.uint32();continue}case 2:{if(o!==18){break}i.modifiers=n.string();continue}case 3:{if(o!==26){break}i.color=hi.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.styleColor=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return K2.fromPartial(e??{})},fromPartial(e){const t=NAt();t.index=e.index??void 0;t.modifiers=e.modifiers??void 0;t.color=e.color!==void 0&&e.color!==null?hi.fromPartial(e.color):void 0;t.styleColor=e.styleColor??void 0;return t}};function OAt(){return{index:0,modifiers:void 0,color:void 0,styleColor:void 0}}var zue={encode(e,t=new tn){if(e.index!==0){t.uint32(8).int32(e.index)}if(e.modifiers!==void 0){t.uint32(18).string(e.modifiers)}if(e.color!==void 0){hi.encode(e.color,t.uint32(26).fork()).join()}if(e.styleColor!==void 0){t.uint32(34).string(e.styleColor)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=OAt();while(n.pos>>3){case 1:{if(o!==8){break}i.index=n.int32();continue}case 2:{if(o!==18){break}i.modifiers=n.string();continue}case 3:{if(o!==26){break}i.color=hi.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.styleColor=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return zue.fromPartial(e??{})},fromPartial(e){const t=OAt();t.index=e.index??0;t.modifiers=e.modifiers??void 0;t.color=e.color!==void 0&&e.color!==null?hi.fromPartial(e.color):void 0;t.styleColor=e.styleColor??void 0;return t}};function BAt(){return{anchor:void 0,vertical:void 0,rotation:void 0,useParagraphSpacing:void 0,leftInset:void 0,topInset:void 0,rightInset:void 0,bottomInset:void 0,wrap:void 0,anchorCenter:void 0,autoFit:void 0}}var Uue={encode(e,t=new tn){if(e.anchor!==void 0){t.uint32(8).int32(e.anchor)}if(e.vertical!==void 0){t.uint32(16).int32(e.vertical)}if(e.rotation!==void 0){t.uint32(24).int32(e.rotation)}if(e.useParagraphSpacing!==void 0){t.uint32(32).bool(e.useParagraphSpacing)}if(e.leftInset!==void 0){t.uint32(40).int32(e.leftInset)}if(e.topInset!==void 0){t.uint32(48).int32(e.topInset)}if(e.rightInset!==void 0){t.uint32(56).int32(e.rightInset)}if(e.bottomInset!==void 0){t.uint32(64).int32(e.bottomInset)}if(e.wrap!==void 0){t.uint32(72).int32(e.wrap)}if(e.anchorCenter!==void 0){t.uint32(80).bool(e.anchorCenter)}if(e.autoFit!==void 0){OI.encode(e.autoFit,t.uint32(90).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=BAt();while(n.pos>>3){case 1:{if(o!==8){break}i.anchor=n.int32();continue}case 2:{if(o!==16){break}i.vertical=n.int32();continue}case 3:{if(o!==24){break}i.rotation=n.int32();continue}case 4:{if(o!==32){break}i.useParagraphSpacing=n.bool();continue}case 5:{if(o!==40){break}i.leftInset=n.int32();continue}case 6:{if(o!==48){break}i.topInset=n.int32();continue}case 7:{if(o!==56){break}i.rightInset=n.int32();continue}case 8:{if(o!==64){break}i.bottomInset=n.int32();continue}case 9:{if(o!==72){break}i.wrap=n.int32();continue}case 10:{if(o!==80){break}i.anchorCenter=n.bool();continue}case 11:{if(o!==90){break}i.autoFit=OI.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Uue.fromPartial(e??{})},fromPartial(e){const t=BAt();t.anchor=e.anchor??void 0;t.vertical=e.vertical??void 0;t.rotation=e.rotation??void 0;t.useParagraphSpacing=e.useParagraphSpacing??void 0;t.leftInset=e.leftInset??void 0;t.topInset=e.topInset??void 0;t.rightInset=e.rightInset??void 0;t.bottomInset=e.bottomInset??void 0;t.wrap=e.wrap??void 0;t.anchorCenter=e.anchorCenter??void 0;t.autoFit=e.autoFit!==void 0&&e.autoFit!==null?OI.fromPartial(e.autoFit):void 0;return t}};function zAt(){return{kind:0,modifiers:void 0,lineReference:void 0,fillReference:void 0,effectReference:void 0,fontReference:void 0,fill:void 0,line:void 0,textStyle:void 0,body:void 0,lineWidthScale:void 0}}var Vue={encode(e,t=new tn){if(e.kind!==0){t.uint32(8).int32(e.kind)}if(e.modifiers!==void 0){t.uint32(18).string(e.modifiers)}if(e.lineReference!==void 0){K2.encode(e.lineReference,t.uint32(26).fork()).join()}if(e.fillReference!==void 0){K2.encode(e.fillReference,t.uint32(34).fork()).join()}if(e.effectReference!==void 0){K2.encode(e.effectReference,t.uint32(42).fork()).join()}if(e.fontReference!==void 0){zue.encode(e.fontReference,t.uint32(50).fork()).join()}if(e.fill!==void 0){Ei.encode(e.fill,t.uint32(58).fork()).join()}if(e.line!==void 0){ui.encode(e.line,t.uint32(66).fork()).join()}if(e.textStyle!==void 0){Gi.encode(e.textStyle,t.uint32(82).fork()).join()}if(e.body!==void 0){Uue.encode(e.body,t.uint32(90).fork()).join()}if(e.lineWidthScale!==void 0){t.uint32(98).string(e.lineWidthScale)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=zAt();while(n.pos>>3){case 1:{if(o!==8){break}i.kind=n.int32();continue}case 2:{if(o!==18){break}i.modifiers=n.string();continue}case 3:{if(o!==26){break}i.lineReference=K2.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.fillReference=K2.decode(n,n.uint32());continue}case 5:{if(o!==42){break}i.effectReference=K2.decode(n,n.uint32());continue}case 6:{if(o!==50){break}i.fontReference=zue.decode(n,n.uint32());continue}case 7:{if(o!==58){break}i.fill=Ei.decode(n,n.uint32());continue}case 8:{if(o!==66){break}i.line=ui.decode(n,n.uint32());continue}case 10:{if(o!==82){break}i.textStyle=Gi.decode(n,n.uint32());continue}case 11:{if(o!==90){break}i.body=Uue.decode(n,n.uint32());continue}case 12:{if(o!==98){break}i.lineWidthScale=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Vue.fromPartial(e??{})},fromPartial(e){const t=zAt();t.kind=e.kind??0;t.modifiers=e.modifiers??void 0;t.lineReference=e.lineReference!==void 0&&e.lineReference!==null?K2.fromPartial(e.lineReference):void 0;t.fillReference=e.fillReference!==void 0&&e.fillReference!==null?K2.fromPartial(e.fillReference):void 0;t.effectReference=e.effectReference!==void 0&&e.effectReference!==null?K2.fromPartial(e.effectReference):void 0;t.fontReference=e.fontReference!==void 0&&e.fontReference!==null?zue.fromPartial(e.fontReference):void 0;t.fill=e.fill!==void 0&&e.fill!==null?Ei.fromPartial(e.fill):void 0;t.line=e.line!==void 0&&e.line!==null?ui.fromPartial(e.line):void 0;t.textStyle=e.textStyle!==void 0&&e.textStyle!==null?Gi.fromPartial(e.textStyle):void 0;t.body=e.body!==void 0&&e.body!==null?Uue.fromPartial(e.body):void 0;t.lineWidthScale=e.lineWidthScale??void 0;return t}};function UAt(){return{type:void 0,colors:[]}}var $ue={encode(e,t=new tn){if(e.type!==void 0){t.uint32(8).int32(e.type)}for(const n of e.colors){hi.encode(n,t.uint32(18).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=UAt();while(n.pos>>3){case 1:{if(o!==8){break}i.type=n.int32();continue}case 2:{if(o!==18){break}i.colors.push(hi.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return $ue.fromPartial(e??{})},fromPartial(e){const t=UAt();t.type=e.type??void 0;t.colors=e.colors?.map(n=>hi.fromPartial(n))||[];return t}};function VAt(){return{pivotTableQualifiedName:"",pivotTableName:void 0,pivotCacheId:void 0,fmtId:void 0,pivotTableId:void 0}}var Gue={encode(e,t=new tn){if(e.pivotTableQualifiedName!==""){t.uint32(10).string(e.pivotTableQualifiedName)}if(e.pivotTableName!==void 0){t.uint32(18).string(e.pivotTableName)}if(e.pivotCacheId!==void 0){t.uint32(24).uint32(e.pivotCacheId)}if(e.fmtId!==void 0){t.uint32(32).uint32(e.fmtId)}if(e.pivotTableId!==void 0){t.uint32(42).string(e.pivotTableId)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=VAt();while(n.pos>>3){case 1:{if(o!==10){break}i.pivotTableQualifiedName=n.string();continue}case 2:{if(o!==18){break}i.pivotTableName=n.string();continue}case 3:{if(o!==24){break}i.pivotCacheId=n.uint32();continue}case 4:{if(o!==32){break}i.fmtId=n.uint32();continue}case 5:{if(o!==42){break}i.pivotTableId=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Gue.fromPartial(e??{})},fromPartial(e){const t=VAt();t.pivotTableQualifiedName=e.pivotTableQualifiedName??"";t.pivotTableName=e.pivotTableName??void 0;t.pivotCacheId=e.pivotCacheId??void 0;t.fmtId=e.fmtId??void 0;t.pivotTableId=e.pivotTableId??void 0;return t}};function $At(){return{dropZonesVisible:void 0,showFilterButtons:void 0,showCategoryButtons:void 0,showDataButtons:void 0,showSeriesButtons:void 0}}var Hue={encode(e,t=new tn){if(e.dropZonesVisible!==void 0){t.uint32(8).bool(e.dropZonesVisible)}if(e.showFilterButtons!==void 0){t.uint32(16).bool(e.showFilterButtons)}if(e.showCategoryButtons!==void 0){t.uint32(24).bool(e.showCategoryButtons)}if(e.showDataButtons!==void 0){t.uint32(32).bool(e.showDataButtons)}if(e.showSeriesButtons!==void 0){t.uint32(40).bool(e.showSeriesButtons)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=$At();while(n.pos>>3){case 1:{if(o!==8){break}i.dropZonesVisible=n.bool();continue}case 2:{if(o!==16){break}i.showFilterButtons=n.bool();continue}case 3:{if(o!==24){break}i.showCategoryButtons=n.bool();continue}case 4:{if(o!==32){break}i.showDataButtons=n.bool();continue}case 5:{if(o!==40){break}i.showSeriesButtons=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Hue.fromPartial(e??{})},fromPartial(e){const t=$At();t.dropZonesVisible=e.dropZonesVisible??void 0;t.showFilterButtons=e.showFilterButtons??void 0;t.showCategoryButtons=e.showCategoryButtons??void 0;t.showDataButtons=e.showDataButtons??void 0;t.showSeriesButtons=e.showSeriesButtons??void 0;return t}};function GAt(){return{idx:0,fill:void 0,stroke:void 0,text:void 0}}var Wue={encode(e,t=new tn){if(e.idx!==0){t.uint32(8).uint32(e.idx)}if(e.fill!==void 0){Ei.encode(e.fill,t.uint32(18).fork()).join()}if(e.stroke!==void 0){ui.encode(e.stroke,t.uint32(26).fork()).join()}if(e.text!==void 0){Gi.encode(e.text,t.uint32(34).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=GAt();while(n.pos>>3){case 1:{if(o!==8){break}i.idx=n.uint32();continue}case 2:{if(o!==18){break}i.fill=Ei.decode(n,n.uint32());continue}case 3:{if(o!==26){break}i.stroke=ui.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.text=Gi.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Wue.fromPartial(e??{})},fromPartial(e){const t=GAt();t.idx=e.idx??0;t.fill=e.fill!==void 0&&e.fill!==null?Ei.fromPartial(e.fill):void 0;t.stroke=e.stroke!==void 0&&e.stroke!==null?ui.fromPartial(e.stroke):void 0;t.text=e.text!==void 0&&e.text!==null?Gi.fromPartial(e.text):void 0;return t}};function HAt(){return{symbol:void 0,size:void 0,fill:void 0,stroke:void 0}}var J2={encode(e,t=new tn){if(e.symbol!==void 0){t.uint32(8).int32(e.symbol)}if(e.size!==void 0){t.uint32(16).uint32(e.size)}if(e.fill!==void 0){Ei.encode(e.fill,t.uint32(26).fork()).join()}if(e.stroke!==void 0){ui.encode(e.stroke,t.uint32(34).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=HAt();while(n.pos>>3){case 1:{if(o!==8){break}i.symbol=n.int32();continue}case 2:{if(o!==16){break}i.size=n.uint32();continue}case 3:{if(o!==26){break}i.fill=Ei.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.stroke=ui.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return J2.fromPartial(e??{})},fromPartial(e){const t=HAt();t.symbol=e.symbol??void 0;t.size=e.size??void 0;t.fill=e.fill!==void 0&&e.fill!==null?Ei.fromPartial(e.fill):void 0;t.stroke=e.stroke!==void 0&&e.stroke!==null?ui.fromPartial(e.stroke):void 0;return t}};function WAt(){return{rotX:void 0,rotY:void 0,rightAngleAxes:void 0,perspective:void 0,heightPercent:void 0,depthPercent:void 0}}var Yue={encode(e,t=new tn){if(e.rotX!==void 0){t.uint32(8).int32(e.rotX)}if(e.rotY!==void 0){t.uint32(16).int32(e.rotY)}if(e.rightAngleAxes!==void 0){t.uint32(24).bool(e.rightAngleAxes)}if(e.perspective!==void 0){t.uint32(32).uint32(e.perspective)}if(e.heightPercent!==void 0){t.uint32(40).uint32(e.heightPercent)}if(e.depthPercent!==void 0){t.uint32(48).uint32(e.depthPercent)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=WAt();while(n.pos>>3){case 1:{if(o!==8){break}i.rotX=n.int32();continue}case 2:{if(o!==16){break}i.rotY=n.int32();continue}case 3:{if(o!==24){break}i.rightAngleAxes=n.bool();continue}case 4:{if(o!==32){break}i.perspective=n.uint32();continue}case 5:{if(o!==40){break}i.heightPercent=n.uint32();continue}case 6:{if(o!==48){break}i.depthPercent=n.uint32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Yue.fromPartial(e??{})},fromPartial(e){const t=WAt();t.rotX=e.rotX??void 0;t.rotY=e.rotY??void 0;t.rightAngleAxes=e.rightAngleAxes??void 0;t.perspective=e.perspective??void 0;t.heightPercent=e.heightPercent??void 0;t.depthPercent=e.depthPercent??void 0;return t}};function YAt(){return{id:"",kind:0,title:void 0}}var que={encode(e,t=new tn){if(e.id!==""){t.uint32(10).string(e.id)}if(e.kind!==0){t.uint32(16).int32(e.kind)}if(e.title!==void 0){t.uint32(26).string(e.title)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=YAt();while(n.pos>>3){case 1:{if(o!==10){break}i.id=n.string();continue}case 2:{if(o!==16){break}i.kind=n.int32();continue}case 3:{if(o!==26){break}i.title=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return que.fromPartial(e??{})},fromPartial(e){const t=YAt();t.id=e.id??"";t.kind=e.kind??0;t.title=e.title??void 0;return t}};function qAt(){return{assetId:void 0,contentType:void 0,widthPx:void 0,heightPx:void 0}}var Xue={encode(e,t=new tn){if(e.assetId!==void 0){t.uint32(10).string(e.assetId)}if(e.contentType!==void 0){t.uint32(18).string(e.contentType)}if(e.widthPx!==void 0){t.uint32(24).int32(e.widthPx)}if(e.heightPx!==void 0){t.uint32(32).int32(e.heightPx)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=qAt();while(n.pos>>3){case 1:{if(o!==10){break}i.assetId=n.string();continue}case 2:{if(o!==18){break}i.contentType=n.string();continue}case 3:{if(o!==24){break}i.widthPx=n.int32();continue}case 4:{if(o!==32){break}i.heightPx=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Xue.fromPartial(e??{})},fromPartial(e){const t=qAt();t.assetId=e.assetId??void 0;t.contentType=e.contentType??void 0;t.widthPx=e.widthPx??void 0;t.heightPx=e.heightPx??void 0;return t}};function XAt(){return{sheetId:void 0,rangeA1:void 0,showGridlines:void 0,showHeaders:void 0,zoom:void 0}}var jue={encode(e,t=new tn){if(e.sheetId!==void 0){t.uint32(10).string(e.sheetId)}if(e.rangeA1!==void 0){t.uint32(18).string(e.rangeA1)}if(e.showGridlines!==void 0){t.uint32(24).bool(e.showGridlines)}if(e.showHeaders!==void 0){t.uint32(32).bool(e.showHeaders)}if(e.zoom!==void 0){t.uint32(41).double(e.zoom)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=XAt();while(n.pos>>3){case 1:{if(o!==10){break}i.sheetId=n.string();continue}case 2:{if(o!==18){break}i.rangeA1=n.string();continue}case 3:{if(o!==24){break}i.showGridlines=n.bool();continue}case 4:{if(o!==32){break}i.showHeaders=n.bool();continue}case 5:{if(o!==41){break}i.zoom=n.double();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return jue.fromPartial(e??{})},fromPartial(e){const t=XAt();t.sheetId=e.sheetId??void 0;t.rangeA1=e.rangeA1??void 0;t.showGridlines=e.showGridlines??void 0;t.showHeaders=e.showHeaders??void 0;t.zoom=e.zoom??void 0;return t}};function jAt(){return{artifact:void 0,workbook:void 0,preview:void 0}}var bX={encode(e,t=new tn){if(e.artifact!==void 0){que.encode(e.artifact,t.uint32(10).fork()).join()}if(e.workbook!==void 0){jue.encode(e.workbook,t.uint32(82).fork()).join()}if(e.preview!==void 0){Xue.encode(e.preview,t.uint32(162).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=jAt();while(n.pos>>3){case 1:{if(o!==10){break}i.artifact=que.decode(n,n.uint32());continue}case 10:{if(o!==82){break}i.workbook=jue.decode(n,n.uint32());continue}case 20:{if(o!==162){break}i.preview=Xue.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return bX.fromPartial(e??{})},fromPartial(e){const t=jAt();t.artifact=e.artifact!==void 0&&e.artifact!==null?que.fromPartial(e.artifact):void 0;t.workbook=e.workbook!==void 0&&e.workbook!==null?jue.fromPartial(e.workbook):void 0;t.preview=e.preview!==void 0&&e.preview!==null?Xue.fromPartial(e.preview):void 0;return t}};function KAt(){return{id:void 0,displayMode:void 0,paragraphProperties:void 0,root:void 0}}var xX={encode(e,t=new tn){if(e.id!==void 0){t.uint32(10).string(e.id)}if(e.displayMode!==void 0){t.uint32(16).int32(e.displayMode)}if(e.paragraphProperties!==void 0){Kue.encode(e.paragraphProperties,t.uint32(26).fork()).join()}if(e.root!==void 0){go.encode(e.root,t.uint32(34).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=KAt();while(n.pos>>3){case 1:{if(o!==10){break}i.id=n.string();continue}case 2:{if(o!==16){break}i.displayMode=n.int32();continue}case 3:{if(o!==26){break}i.paragraphProperties=Kue.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.root=go.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return xX.fromPartial(e??{})},fromPartial(e){const t=KAt();t.id=e.id??void 0;t.displayMode=e.displayMode??void 0;t.paragraphProperties=e.paragraphProperties!==void 0&&e.paragraphProperties!==null?Kue.fromPartial(e.paragraphProperties):void 0;t.root=e.root!==void 0&&e.root!==null?go.fromPartial(e.root):void 0;return t}};function ZAt(){return{justification:void 0}}var Kue={encode(e,t=new tn){if(e.justification!==void 0){t.uint32(8).int32(e.justification)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=ZAt();while(n.pos>>3){case 1:{if(o!==8){break}i.justification=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Kue.fromPartial(e??{})},fromPartial(e){const t=ZAt();t.justification=e.justification??void 0;return t}};function JAt(){return{id:void 0,style:void 0,sequence:void 0,token:void 0,fraction:void 0,radical:void 0,scripts:void 0,nary:void 0,delimited:void 0,function:void 0,matrix:void 0,accent:void 0,bar:void 0,enclosure:void 0,limit:void 0,phantom:void 0,equationArray:void 0}}var go={encode(e,t=new tn){if(e.id!==void 0){t.uint32(10).string(e.id)}if(e.style!==void 0){Que.encode(e.style,t.uint32(18).fork()).join()}if(e.sequence!==void 0){Zue.encode(e.sequence,t.uint32(26).fork()).join()}if(e.token!==void 0){Jue.encode(e.token,t.uint32(34).fork()).join()}if(e.fraction!==void 0){ede.encode(e.fraction,t.uint32(42).fork()).join()}if(e.radical!==void 0){tde.encode(e.radical,t.uint32(50).fork()).join()}if(e.scripts!==void 0){nde.encode(e.scripts,t.uint32(58).fork()).join()}if(e.nary!==void 0){rde.encode(e.nary,t.uint32(66).fork()).join()}if(e.delimited!==void 0){ide.encode(e.delimited,t.uint32(74).fork()).join()}if(e.function!==void 0){ode.encode(e.function,t.uint32(82).fork()).join()}if(e.matrix!==void 0){lde.encode(e.matrix,t.uint32(90).fork()).join()}if(e.accent!==void 0){cde.encode(e.accent,t.uint32(98).fork()).join()}if(e.bar!==void 0){ude.encode(e.bar,t.uint32(106).fork()).join()}if(e.enclosure!==void 0){dde.encode(e.enclosure,t.uint32(114).fork()).join()}if(e.limit!==void 0){fde.encode(e.limit,t.uint32(122).fork()).join()}if(e.phantom!==void 0){hde.encode(e.phantom,t.uint32(130).fork()).join()}if(e.equationArray!==void 0){pde.encode(e.equationArray,t.uint32(138).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=JAt();while(n.pos>>3){case 1:{if(o!==10){break}i.id=n.string();continue}case 2:{if(o!==18){break}i.style=Que.decode(n,n.uint32());continue}case 3:{if(o!==26){break}i.sequence=Zue.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.token=Jue.decode(n,n.uint32());continue}case 5:{if(o!==42){break}i.fraction=ede.decode(n,n.uint32());continue}case 6:{if(o!==50){break}i.radical=tde.decode(n,n.uint32());continue}case 7:{if(o!==58){break}i.scripts=nde.decode(n,n.uint32());continue}case 8:{if(o!==66){break}i.nary=rde.decode(n,n.uint32());continue}case 9:{if(o!==74){break}i.delimited=ide.decode(n,n.uint32());continue}case 10:{if(o!==82){break}i.function=ode.decode(n,n.uint32());continue}case 11:{if(o!==90){break}i.matrix=lde.decode(n,n.uint32());continue}case 12:{if(o!==98){break}i.accent=cde.decode(n,n.uint32());continue}case 13:{if(o!==106){break}i.bar=ude.decode(n,n.uint32());continue}case 14:{if(o!==114){break}i.enclosure=dde.decode(n,n.uint32());continue}case 15:{if(o!==122){break}i.limit=fde.decode(n,n.uint32());continue}case 16:{if(o!==130){break}i.phantom=hde.decode(n,n.uint32());continue}case 17:{if(o!==138){break}i.equationArray=pde.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return go.fromPartial(e??{})},fromPartial(e){const t=JAt();t.id=e.id??void 0;t.style=e.style!==void 0&&e.style!==null?Que.fromPartial(e.style):void 0;t.sequence=e.sequence!==void 0&&e.sequence!==null?Zue.fromPartial(e.sequence):void 0;t.token=e.token!==void 0&&e.token!==null?Jue.fromPartial(e.token):void 0;t.fraction=e.fraction!==void 0&&e.fraction!==null?ede.fromPartial(e.fraction):void 0;t.radical=e.radical!==void 0&&e.radical!==null?tde.fromPartial(e.radical):void 0;t.scripts=e.scripts!==void 0&&e.scripts!==null?nde.fromPartial(e.scripts):void 0;t.nary=e.nary!==void 0&&e.nary!==null?rde.fromPartial(e.nary):void 0;t.delimited=e.delimited!==void 0&&e.delimited!==null?ide.fromPartial(e.delimited):void 0;t.function=e.function!==void 0&&e.function!==null?ode.fromPartial(e.function):void 0;t.matrix=e.matrix!==void 0&&e.matrix!==null?lde.fromPartial(e.matrix):void 0;t.accent=e.accent!==void 0&&e.accent!==null?cde.fromPartial(e.accent):void 0;t.bar=e.bar!==void 0&&e.bar!==null?ude.fromPartial(e.bar):void 0;t.enclosure=e.enclosure!==void 0&&e.enclosure!==null?dde.fromPartial(e.enclosure):void 0;t.limit=e.limit!==void 0&&e.limit!==null?fde.fromPartial(e.limit):void 0;t.phantom=e.phantom!==void 0&&e.phantom!==null?hde.fromPartial(e.phantom):void 0;t.equationArray=e.equationArray!==void 0&&e.equationArray!==null?pde.fromPartial(e.equationArray):void 0;return t}};function QAt(){return{children:[]}}var Zue={encode(e,t=new tn){for(const n of e.children){go.encode(n,t.uint32(10).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=QAt();while(n.pos>>3){case 1:{if(o!==10){break}i.children.push(go.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Zue.fromPartial(e??{})},fromPartial(e){const t=QAt();t.children=e.children?.map(n=>go.fromPartial(n))||[];return t}};function ekt(){return{text:"",kind:void 0,language:void 0}}var Jue={encode(e,t=new tn){if(e.text!==""){t.uint32(10).string(e.text)}if(e.kind!==void 0){t.uint32(16).int32(e.kind)}if(e.language!==void 0){t.uint32(26).string(e.language)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=ekt();while(n.pos>>3){case 1:{if(o!==10){break}i.text=n.string();continue}case 2:{if(o!==16){break}i.kind=n.int32();continue}case 3:{if(o!==26){break}i.language=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Jue.fromPartial(e??{})},fromPartial(e){const t=ekt();t.text=e.text??"";t.kind=e.kind??void 0;t.language=e.language??void 0;return t}};function tkt(){return{bold:void 0,italic:void 0,fontSize:void 0,typeface:void 0,language:void 0,fill:void 0,variant:void 0,normalText:void 0,literal:void 0}}var Que={encode(e,t=new tn){if(e.bold!==void 0){t.uint32(8).bool(e.bold)}if(e.italic!==void 0){t.uint32(16).bool(e.italic)}if(e.fontSize!==void 0){t.uint32(24).int32(e.fontSize)}if(e.typeface!==void 0){t.uint32(34).string(e.typeface)}if(e.language!==void 0){t.uint32(42).string(e.language)}if(e.fill!==void 0){Ei.encode(e.fill,t.uint32(50).fork()).join()}if(e.variant!==void 0){t.uint32(56).int32(e.variant)}if(e.normalText!==void 0){t.uint32(64).bool(e.normalText)}if(e.literal!==void 0){t.uint32(72).bool(e.literal)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=tkt();while(n.pos>>3){case 1:{if(o!==8){break}i.bold=n.bool();continue}case 2:{if(o!==16){break}i.italic=n.bool();continue}case 3:{if(o!==24){break}i.fontSize=n.int32();continue}case 4:{if(o!==34){break}i.typeface=n.string();continue}case 5:{if(o!==42){break}i.language=n.string();continue}case 6:{if(o!==50){break}i.fill=Ei.decode(n,n.uint32());continue}case 7:{if(o!==56){break}i.variant=n.int32();continue}case 8:{if(o!==64){break}i.normalText=n.bool();continue}case 9:{if(o!==72){break}i.literal=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Que.fromPartial(e??{})},fromPartial(e){const t=tkt();t.bold=e.bold??void 0;t.italic=e.italic??void 0;t.fontSize=e.fontSize??void 0;t.typeface=e.typeface??void 0;t.language=e.language??void 0;t.fill=e.fill!==void 0&&e.fill!==null?Ei.fromPartial(e.fill):void 0;t.variant=e.variant??void 0;t.normalText=e.normalText??void 0;t.literal=e.literal??void 0;return t}};function nkt(){return{kind:void 0,numerator:void 0,denominator:void 0}}var ede={encode(e,t=new tn){if(e.kind!==void 0){t.uint32(8).int32(e.kind)}if(e.numerator!==void 0){go.encode(e.numerator,t.uint32(18).fork()).join()}if(e.denominator!==void 0){go.encode(e.denominator,t.uint32(26).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=nkt();while(n.pos>>3){case 1:{if(o!==8){break}i.kind=n.int32();continue}case 2:{if(o!==18){break}i.numerator=go.decode(n,n.uint32());continue}case 3:{if(o!==26){break}i.denominator=go.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return ede.fromPartial(e??{})},fromPartial(e){const t=nkt();t.kind=e.kind??void 0;t.numerator=e.numerator!==void 0&&e.numerator!==null?go.fromPartial(e.numerator):void 0;t.denominator=e.denominator!==void 0&&e.denominator!==null?go.fromPartial(e.denominator):void 0;return t}};function rkt(){return{degree:void 0,radicand:void 0,hideDegree:void 0}}var tde={encode(e,t=new tn){if(e.degree!==void 0){go.encode(e.degree,t.uint32(10).fork()).join()}if(e.radicand!==void 0){go.encode(e.radicand,t.uint32(18).fork()).join()}if(e.hideDegree!==void 0){t.uint32(24).bool(e.hideDegree)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=rkt();while(n.pos>>3){case 1:{if(o!==10){break}i.degree=go.decode(n,n.uint32());continue}case 2:{if(o!==18){break}i.radicand=go.decode(n,n.uint32());continue}case 3:{if(o!==24){break}i.hideDegree=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return tde.fromPartial(e??{})},fromPartial(e){const t=rkt();t.degree=e.degree!==void 0&&e.degree!==null?go.fromPartial(e.degree):void 0;t.radicand=e.radicand!==void 0&&e.radicand!==null?go.fromPartial(e.radicand):void 0;t.hideDegree=e.hideDegree??void 0;return t}};function ikt(){return{base:void 0,subscript:void 0,superscript:void 0,presubscript:void 0,presuperscript:void 0}}var nde={encode(e,t=new tn){if(e.base!==void 0){go.encode(e.base,t.uint32(10).fork()).join()}if(e.subscript!==void 0){go.encode(e.subscript,t.uint32(18).fork()).join()}if(e.superscript!==void 0){go.encode(e.superscript,t.uint32(26).fork()).join()}if(e.presubscript!==void 0){go.encode(e.presubscript,t.uint32(34).fork()).join()}if(e.presuperscript!==void 0){go.encode(e.presuperscript,t.uint32(42).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=ikt();while(n.pos>>3){case 1:{if(o!==10){break}i.base=go.decode(n,n.uint32());continue}case 2:{if(o!==18){break}i.subscript=go.decode(n,n.uint32());continue}case 3:{if(o!==26){break}i.superscript=go.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.presubscript=go.decode(n,n.uint32());continue}case 5:{if(o!==42){break}i.presuperscript=go.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return nde.fromPartial(e??{})},fromPartial(e){const t=ikt();t.base=e.base!==void 0&&e.base!==null?go.fromPartial(e.base):void 0;t.subscript=e.subscript!==void 0&&e.subscript!==null?go.fromPartial(e.subscript):void 0;t.superscript=e.superscript!==void 0&&e.superscript!==null?go.fromPartial(e.superscript):void 0;t.presubscript=e.presubscript!==void 0&&e.presubscript!==null?go.fromPartial(e.presubscript):void 0;t.presuperscript=e.presuperscript!==void 0&&e.presuperscript!==null?go.fromPartial(e.presuperscript):void 0;return t}};function okt(){return{operator:"",lowerLimit:void 0,upperLimit:void 0,body:void 0,limitPlacement:void 0,hideSubscript:void 0,hideSuperscript:void 0}}var rde={encode(e,t=new tn){if(e.operator!==""){t.uint32(10).string(e.operator)}if(e.lowerLimit!==void 0){go.encode(e.lowerLimit,t.uint32(18).fork()).join()}if(e.upperLimit!==void 0){go.encode(e.upperLimit,t.uint32(26).fork()).join()}if(e.body!==void 0){go.encode(e.body,t.uint32(34).fork()).join()}if(e.limitPlacement!==void 0){t.uint32(40).int32(e.limitPlacement)}if(e.hideSubscript!==void 0){t.uint32(48).bool(e.hideSubscript)}if(e.hideSuperscript!==void 0){t.uint32(56).bool(e.hideSuperscript)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=okt();while(n.pos>>3){case 1:{if(o!==10){break}i.operator=n.string();continue}case 2:{if(o!==18){break}i.lowerLimit=go.decode(n,n.uint32());continue}case 3:{if(o!==26){break}i.upperLimit=go.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.body=go.decode(n,n.uint32());continue}case 5:{if(o!==40){break}i.limitPlacement=n.int32();continue}case 6:{if(o!==48){break}i.hideSubscript=n.bool();continue}case 7:{if(o!==56){break}i.hideSuperscript=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return rde.fromPartial(e??{})},fromPartial(e){const t=okt();t.operator=e.operator??"";t.lowerLimit=e.lowerLimit!==void 0&&e.lowerLimit!==null?go.fromPartial(e.lowerLimit):void 0;t.upperLimit=e.upperLimit!==void 0&&e.upperLimit!==null?go.fromPartial(e.upperLimit):void 0;t.body=e.body!==void 0&&e.body!==null?go.fromPartial(e.body):void 0;t.limitPlacement=e.limitPlacement??void 0;t.hideSubscript=e.hideSubscript??void 0;t.hideSuperscript=e.hideSuperscript??void 0;return t}};function akt(){return{beginDelimiter:void 0,separatorDelimiter:void 0,endDelimiter:void 0,items:[],grow:void 0,shape:void 0}}var ide={encode(e,t=new tn){if(e.beginDelimiter!==void 0){t.uint32(10).string(e.beginDelimiter)}if(e.separatorDelimiter!==void 0){t.uint32(18).string(e.separatorDelimiter)}if(e.endDelimiter!==void 0){t.uint32(26).string(e.endDelimiter)}for(const n of e.items){go.encode(n,t.uint32(34).fork()).join()}if(e.grow!==void 0){t.uint32(40).bool(e.grow)}if(e.shape!==void 0){t.uint32(50).string(e.shape)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=akt();while(n.pos>>3){case 1:{if(o!==10){break}i.beginDelimiter=n.string();continue}case 2:{if(o!==18){break}i.separatorDelimiter=n.string();continue}case 3:{if(o!==26){break}i.endDelimiter=n.string();continue}case 4:{if(o!==34){break}i.items.push(go.decode(n,n.uint32()));continue}case 5:{if(o!==40){break}i.grow=n.bool();continue}case 6:{if(o!==50){break}i.shape=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return ide.fromPartial(e??{})},fromPartial(e){const t=akt();t.beginDelimiter=e.beginDelimiter??void 0;t.separatorDelimiter=e.separatorDelimiter??void 0;t.endDelimiter=e.endDelimiter??void 0;t.items=e.items?.map(n=>go.fromPartial(n))||[];t.grow=e.grow??void 0;t.shape=e.shape??void 0;return t}};function skt(){return{name:void 0,argument:void 0}}var ode={encode(e,t=new tn){if(e.name!==void 0){go.encode(e.name,t.uint32(10).fork()).join()}if(e.argument!==void 0){go.encode(e.argument,t.uint32(18).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=skt();while(n.pos>>3){case 1:{if(o!==10){break}i.name=go.decode(n,n.uint32());continue}case 2:{if(o!==18){break}i.argument=go.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return ode.fromPartial(e??{})},fromPartial(e){const t=skt();t.name=e.name!==void 0&&e.name!==null?go.fromPartial(e.name):void 0;t.argument=e.argument!==void 0&&e.argument!==null?go.fromPartial(e.argument):void 0;return t}};function lkt(){return{justification:void 0}}var ade={encode(e,t=new tn){if(e.justification!==void 0){t.uint32(8).int32(e.justification)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=lkt();while(n.pos>>3){case 1:{if(o!==8){break}i.justification=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return ade.fromPartial(e??{})},fromPartial(e){const t=lkt();t.justification=e.justification??void 0;return t}};function ckt(){return{cells:[]}}var sde={encode(e,t=new tn){for(const n of e.cells){go.encode(n,t.uint32(10).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=ckt();while(n.pos>>3){case 1:{if(o!==10){break}i.cells.push(go.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return sde.fromPartial(e??{})},fromPartial(e){const t=ckt();t.cells=e.cells?.map(n=>go.fromPartial(n))||[];return t}};function ukt(){return{columns:[],rows:[],columnCount:void 0}}var lde={encode(e,t=new tn){for(const n of e.columns){ade.encode(n,t.uint32(10).fork()).join()}for(const n of e.rows){sde.encode(n,t.uint32(18).fork()).join()}if(e.columnCount!==void 0){t.uint32(24).int32(e.columnCount)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=ukt();while(n.pos>>3){case 1:{if(o!==10){break}i.columns.push(ade.decode(n,n.uint32()));continue}case 2:{if(o!==18){break}i.rows.push(sde.decode(n,n.uint32()));continue}case 3:{if(o!==24){break}i.columnCount=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return lde.fromPartial(e??{})},fromPartial(e){const t=ukt();t.columns=e.columns?.map(n=>ade.fromPartial(n))||[];t.rows=e.rows?.map(n=>sde.fromPartial(n))||[];t.columnCount=e.columnCount??void 0;return t}};function dkt(){return{character:"",base:void 0,position:void 0}}var cde={encode(e,t=new tn){if(e.character!==""){t.uint32(10).string(e.character)}if(e.base!==void 0){go.encode(e.base,t.uint32(18).fork()).join()}if(e.position!==void 0){t.uint32(24).int32(e.position)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=dkt();while(n.pos>>3){case 1:{if(o!==10){break}i.character=n.string();continue}case 2:{if(o!==18){break}i.base=go.decode(n,n.uint32());continue}case 3:{if(o!==24){break}i.position=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return cde.fromPartial(e??{})},fromPartial(e){const t=dkt();t.character=e.character??"";t.base=e.base!==void 0&&e.base!==null?go.fromPartial(e.base):void 0;t.position=e.position??void 0;return t}};function fkt(){return{position:void 0,base:void 0}}var ude={encode(e,t=new tn){if(e.position!==void 0){t.uint32(8).int32(e.position)}if(e.base!==void 0){go.encode(e.base,t.uint32(18).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=fkt();while(n.pos>>3){case 1:{if(o!==8){break}i.position=n.int32();continue}case 2:{if(o!==18){break}i.base=go.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return ude.fromPartial(e??{})},fromPartial(e){const t=fkt();t.position=e.position??void 0;t.base=e.base!==void 0&&e.base!==null?go.fromPartial(e.base):void 0;return t}};function hkt(){return{body:void 0,hideTop:void 0,hideBottom:void 0,hideLeft:void 0,hideRight:void 0,strikeHorizontal:void 0,strikeVertical:void 0,strikeTopLeftToBottomRight:void 0,strikeBottomLeftToTopRight:void 0}}var dde={encode(e,t=new tn){if(e.body!==void 0){go.encode(e.body,t.uint32(10).fork()).join()}if(e.hideTop!==void 0){t.uint32(16).bool(e.hideTop)}if(e.hideBottom!==void 0){t.uint32(24).bool(e.hideBottom)}if(e.hideLeft!==void 0){t.uint32(32).bool(e.hideLeft)}if(e.hideRight!==void 0){t.uint32(40).bool(e.hideRight)}if(e.strikeHorizontal!==void 0){t.uint32(48).bool(e.strikeHorizontal)}if(e.strikeVertical!==void 0){t.uint32(56).bool(e.strikeVertical)}if(e.strikeTopLeftToBottomRight!==void 0){t.uint32(64).bool(e.strikeTopLeftToBottomRight)}if(e.strikeBottomLeftToTopRight!==void 0){t.uint32(72).bool(e.strikeBottomLeftToTopRight)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=hkt();while(n.pos>>3){case 1:{if(o!==10){break}i.body=go.decode(n,n.uint32());continue}case 2:{if(o!==16){break}i.hideTop=n.bool();continue}case 3:{if(o!==24){break}i.hideBottom=n.bool();continue}case 4:{if(o!==32){break}i.hideLeft=n.bool();continue}case 5:{if(o!==40){break}i.hideRight=n.bool();continue}case 6:{if(o!==48){break}i.strikeHorizontal=n.bool();continue}case 7:{if(o!==56){break}i.strikeVertical=n.bool();continue}case 8:{if(o!==64){break}i.strikeTopLeftToBottomRight=n.bool();continue}case 9:{if(o!==72){break}i.strikeBottomLeftToTopRight=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return dde.fromPartial(e??{})},fromPartial(e){const t=hkt();t.body=e.body!==void 0&&e.body!==null?go.fromPartial(e.body):void 0;t.hideTop=e.hideTop??void 0;t.hideBottom=e.hideBottom??void 0;t.hideLeft=e.hideLeft??void 0;t.hideRight=e.hideRight??void 0;t.strikeHorizontal=e.strikeHorizontal??void 0;t.strikeVertical=e.strikeVertical??void 0;t.strikeTopLeftToBottomRight=e.strikeTopLeftToBottomRight??void 0;t.strikeBottomLeftToTopRight=e.strikeBottomLeftToTopRight??void 0;return t}};function pkt(){return{kind:void 0,base:void 0,limit:void 0}}var fde={encode(e,t=new tn){if(e.kind!==void 0){t.uint32(8).int32(e.kind)}if(e.base!==void 0){go.encode(e.base,t.uint32(18).fork()).join()}if(e.limit!==void 0){go.encode(e.limit,t.uint32(26).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=pkt();while(n.pos>>3){case 1:{if(o!==8){break}i.kind=n.int32();continue}case 2:{if(o!==18){break}i.base=go.decode(n,n.uint32());continue}case 3:{if(o!==26){break}i.limit=go.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return fde.fromPartial(e??{})},fromPartial(e){const t=pkt();t.kind=e.kind??void 0;t.base=e.base!==void 0&&e.base!==null?go.fromPartial(e.base):void 0;t.limit=e.limit!==void 0&&e.limit!==null?go.fromPartial(e.limit):void 0;return t}};function mkt(){return{body:void 0,show:void 0,zeroWidth:void 0,zeroAscent:void 0,zeroDescent:void 0}}var hde={encode(e,t=new tn){if(e.body!==void 0){go.encode(e.body,t.uint32(10).fork()).join()}if(e.show!==void 0){t.uint32(16).bool(e.show)}if(e.zeroWidth!==void 0){t.uint32(24).bool(e.zeroWidth)}if(e.zeroAscent!==void 0){t.uint32(32).bool(e.zeroAscent)}if(e.zeroDescent!==void 0){t.uint32(40).bool(e.zeroDescent)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=mkt();while(n.pos>>3){case 1:{if(o!==10){break}i.body=go.decode(n,n.uint32());continue}case 2:{if(o!==16){break}i.show=n.bool();continue}case 3:{if(o!==24){break}i.zeroWidth=n.bool();continue}case 4:{if(o!==32){break}i.zeroAscent=n.bool();continue}case 5:{if(o!==40){break}i.zeroDescent=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return hde.fromPartial(e??{})},fromPartial(e){const t=mkt();t.body=e.body!==void 0&&e.body!==null?go.fromPartial(e.body):void 0;t.show=e.show??void 0;t.zeroWidth=e.zeroWidth??void 0;t.zeroAscent=e.zeroAscent??void 0;t.zeroDescent=e.zeroDescent??void 0;return t}};function gkt(){return{rows:[],justification:void 0,baseJustification:void 0}}var pde={encode(e,t=new tn){for(const n of e.rows){go.encode(n,t.uint32(10).fork()).join()}if(e.justification!==void 0){t.uint32(16).int32(e.justification)}if(e.baseJustification!==void 0){t.uint32(26).string(e.baseJustification)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=gkt();while(n.pos>>3){case 1:{if(o!==10){break}i.rows.push(go.decode(n,n.uint32()));continue}case 2:{if(o!==16){break}i.justification=n.int32();continue}case 3:{if(o!==26){break}i.baseJustification=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return pde.fromPartial(e??{})},fromPartial(e){const t=gkt();t.rows=e.rows?.map(n=>go.fromPartial(n))||[];t.justification=e.justification??void 0;t.baseJustification=e.baseJustification??void 0;return t}};var pl=(g=>{g[g["ELEMENT_TYPE_UNSPECIFIED"]=0]="ELEMENT_TYPE_UNSPECIFIED";g[g["ELEMENT_TYPE_TEXT"]=1]="ELEMENT_TYPE_TEXT";g[g["ELEMENT_TYPE_TEXT_GROUP"]=2]="ELEMENT_TYPE_TEXT_GROUP";g[g["ELEMENT_TYPE_IMAGE"]=3]="ELEMENT_TYPE_IMAGE";g[g["ELEMENT_TYPE_CHART"]=4]="ELEMENT_TYPE_CHART";g[g["ELEMENT_TYPE_SHAPE"]=5]="ELEMENT_TYPE_SHAPE";g[g["ELEMENT_TYPE_CHART_REFERENCE"]=6]="ELEMENT_TYPE_CHART_REFERENCE";g[g["ELEMENT_TYPE_IMAGE_REFERENCE"]=7]="ELEMENT_TYPE_IMAGE_REFERENCE";g[g["ELEMENT_TYPE_VIDEO_REFERENCE"]=8]="ELEMENT_TYPE_VIDEO_REFERENCE";g[g["ELEMENT_TYPE_TABLE"]=9]="ELEMENT_TYPE_TABLE";g[g["ELEMENT_TYPE_GROUP"]=10]="ELEMENT_TYPE_GROUP";g[g["ELEMENT_TYPE_EMBEDDED_ARTIFACT"]=11]="ELEMENT_TYPE_EMBEDDED_ARTIFACT";g[g["ELEMENT_TYPE_SMART_ART"]=12]="ELEMENT_TYPE_SMART_ART";g[g["UNRECOGNIZED"]=-1]="UNRECOGNIZED";return g})(pl||{});function ykt(){return{id:void 0,slides:[],theme:void 0,layouts:[],charts:[],images:[],contentReferences:[],people:[],threads:[],fonts:[],defaultTextStyle:void 0,textStyles:[],tableStyles:void 0,viewProperties:void 0,firstSlideNumber:void 0}}var VI={encode(e,t=new tn){if(e.id!==void 0){t.uint32(82).string(e.id)}for(const n of e.slides){G4.encode(n,t.uint32(10).fork()).join()}if(e.theme!==void 0){_0.encode(e.theme,t.uint32(18).fork()).join()}for(const n of e.layouts){Cde.encode(n,t.uint32(26).fork()).join()}for(const n of e.charts){dm.encode(n,t.uint32(74).fork()).join()}for(const n of e.images){yy.encode(n,t.uint32(34).fork()).join()}for(const n of e.contentReferences){FA.encode(n,t.uint32(42).fork()).join()}for(const n of e.people){NA.encode(n,t.uint32(90).fork()).join()}for(const n of e.threads){OA.encode(n,t.uint32(98).fork()).join()}for(const n of e.fonts){yde.encode(n,t.uint32(106).fork()).join()}if(e.defaultTextStyle!==void 0){mde.encode(e.defaultTextStyle,t.uint32(122).fork()).join()}for(const n of e.textStyles){h1.encode(n,t.uint32(50).fork()).join()}if(e.tableStyles!==void 0){_de.encode(e.tableStyles,t.uint32(58).fork()).join()}if(e.viewProperties!==void 0){Tde.encode(e.viewProperties,t.uint32(66).fork()).join()}if(e.firstSlideNumber!==void 0){t.uint32(112).int32(e.firstSlideNumber)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=ykt();while(n.pos>>3){case 10:{if(o!==82){break}i.id=n.string();continue}case 1:{if(o!==10){break}i.slides.push(G4.decode(n,n.uint32()));continue}case 2:{if(o!==18){break}i.theme=_0.decode(n,n.uint32());continue}case 3:{if(o!==26){break}i.layouts.push(Cde.decode(n,n.uint32()));continue}case 9:{if(o!==74){break}i.charts.push(dm.decode(n,n.uint32()));continue}case 4:{if(o!==34){break}i.images.push(yy.decode(n,n.uint32()));continue}case 5:{if(o!==42){break}i.contentReferences.push(FA.decode(n,n.uint32()));continue}case 11:{if(o!==90){break}i.people.push(NA.decode(n,n.uint32()));continue}case 12:{if(o!==98){break}i.threads.push(OA.decode(n,n.uint32()));continue}case 13:{if(o!==106){break}i.fonts.push(yde.decode(n,n.uint32()));continue}case 15:{if(o!==122){break}i.defaultTextStyle=mde.decode(n,n.uint32());continue}case 6:{if(o!==50){break}i.textStyles.push(h1.decode(n,n.uint32()));continue}case 7:{if(o!==58){break}i.tableStyles=_de.decode(n,n.uint32());continue}case 8:{if(o!==66){break}i.viewProperties=Tde.decode(n,n.uint32());continue}case 14:{if(o!==112){break}i.firstSlideNumber=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return VI.fromPartial(e??{})},fromPartial(e){const t=ykt();t.id=e.id??void 0;t.slides=e.slides?.map(n=>G4.fromPartial(n))||[];t.theme=e.theme!==void 0&&e.theme!==null?_0.fromPartial(e.theme):void 0;t.layouts=e.layouts?.map(n=>Cde.fromPartial(n))||[];t.charts=e.charts?.map(n=>dm.fromPartial(n))||[];t.images=e.images?.map(n=>yy.fromPartial(n))||[];t.contentReferences=e.contentReferences?.map(n=>FA.fromPartial(n))||[];t.people=e.people?.map(n=>NA.fromPartial(n))||[];t.threads=e.threads?.map(n=>OA.fromPartial(n))||[];t.fonts=e.fonts?.map(n=>yde.fromPartial(n))||[];t.defaultTextStyle=e.defaultTextStyle!==void 0&&e.defaultTextStyle!==null?mde.fromPartial(e.defaultTextStyle):void 0;t.textStyles=e.textStyles?.map(n=>h1.fromPartial(n))||[];t.tableStyles=e.tableStyles!==void 0&&e.tableStyles!==null?_de.fromPartial(e.tableStyles):void 0;t.viewProperties=e.viewProperties!==void 0&&e.viewProperties!==null?Tde.fromPartial(e.viewProperties):void 0;t.firstSlideNumber=e.firstSlideNumber??void 0;return t}};function bkt(){return{levels:[]}}var mde={encode(e,t=new tn){for(const n of e.levels){Lh.encode(n,t.uint32(10).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=bkt();while(n.pos>>3){case 1:{if(o!==10){break}i.levels.push(Lh.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return mde.fromPartial(e??{})},fromPartial(e){const t=bkt();t.levels=e.levels?.map(n=>Lh.fromPartial(n))||[];return t}};function xkt(){return{type:0,contentType:"",data:new Uint8Array(0),subsetted:void 0}}var gde={encode(e,t=new tn){if(e.type!==0){t.uint32(24).int32(e.type)}if(e.contentType!==""){t.uint32(34).string(e.contentType)}if(e.data.length!==0){t.uint32(42).bytes(e.data)}if(e.subsetted!==void 0){t.uint32(48).bool(e.subsetted)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=xkt();while(n.pos>>3){case 3:{if(o!==24){break}i.type=n.int32();continue}case 4:{if(o!==34){break}i.contentType=n.string();continue}case 5:{if(o!==42){break}i.data=n.bytes();continue}case 6:{if(o!==48){break}i.subsetted=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return gde.fromPartial(e??{})},fromPartial(e){const t=xkt();t.type=e.type??0;t.contentType=e.contentType??"";t.data=e.data??new Uint8Array(0);t.subsetted=e.subsetted??void 0;return t}};function vkt(){return{name:void 0,altName:void 0,family:void 0,embeddedFonts:[]}}var yde={encode(e,t=new tn){if(e.name!==void 0){t.uint32(10).string(e.name)}if(e.altName!==void 0){t.uint32(18).string(e.altName)}if(e.family!==void 0){t.uint32(26).string(e.family)}for(const n of e.embeddedFonts){gde.encode(n,t.uint32(34).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=vkt();while(n.pos>>3){case 1:{if(o!==10){break}i.name=n.string();continue}case 2:{if(o!==18){break}i.altName=n.string();continue}case 3:{if(o!==26){break}i.family=n.string();continue}case 4:{if(o!==34){break}i.embeddedFonts.push(gde.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return yde.fromPartial(e??{})},fromPartial(e){const t=vkt();t.name=e.name??void 0;t.altName=e.altName??void 0;t.family=e.family??void 0;t.embeddedFonts=e.embeddedFonts?.map(n=>gde.fromPartial(n))||[];return t}};function _kt(){return{colorScheme:void 0,backgroundFillStyleList:[],fillStyleList:[],lineStyleList:[],effectStyleList:[],fontScheme:void 0,name:void 0,objectDefaults:void 0}}var _0={encode(e,t=new tn){if(e.colorScheme!==void 0){xde.encode(e.colorScheme,t.uint32(10).fork()).join()}for(const n of e.backgroundFillStyleList){Ei.encode(n,t.uint32(18).fork()).join()}for(const n of e.fillStyleList){Ei.encode(n,t.uint32(58).fork()).join()}for(const n of e.lineStyleList){ui.encode(n,t.uint32(26).fork()).join()}for(const n of e.effectStyleList){ofe.encode(n,t.uint32(34).fork()).join()}if(e.fontScheme!==void 0){gX.encode(e.fontScheme,t.uint32(42).fork()).join()}if(e.name!==void 0){t.uint32(50).string(e.name)}if(e.objectDefaults!==void 0){bde.encode(e.objectDefaults,t.uint32(66).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=_kt();while(n.pos>>3){case 1:{if(o!==10){break}i.colorScheme=xde.decode(n,n.uint32());continue}case 2:{if(o!==18){break}i.backgroundFillStyleList.push(Ei.decode(n,n.uint32()));continue}case 7:{if(o!==58){break}i.fillStyleList.push(Ei.decode(n,n.uint32()));continue}case 3:{if(o!==26){break}i.lineStyleList.push(ui.decode(n,n.uint32()));continue}case 4:{if(o!==34){break}i.effectStyleList.push(ofe.decode(n,n.uint32()));continue}case 5:{if(o!==42){break}i.fontScheme=gX.decode(n,n.uint32());continue}case 6:{if(o!==50){break}i.name=n.string();continue}case 8:{if(o!==66){break}i.objectDefaults=bde.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return _0.fromPartial(e??{})},fromPartial(e){const t=_kt();t.colorScheme=e.colorScheme!==void 0&&e.colorScheme!==null?xde.fromPartial(e.colorScheme):void 0;t.backgroundFillStyleList=e.backgroundFillStyleList?.map(n=>Ei.fromPartial(n))||[];t.fillStyleList=e.fillStyleList?.map(n=>Ei.fromPartial(n))||[];t.lineStyleList=e.lineStyleList?.map(n=>ui.fromPartial(n))||[];t.effectStyleList=e.effectStyleList?.map(n=>ofe.fromPartial(n))||[];t.fontScheme=e.fontScheme!==void 0&&e.fontScheme!==null?gX.fromPartial(e.fontScheme):void 0;t.name=e.name??void 0;t.objectDefaults=e.objectDefaults!==void 0&&e.objectDefaults!==null?bde.fromPartial(e.objectDefaults):void 0;return t}};function Tkt(){return{shape:void 0,line:void 0,text:void 0}}var bde={encode(e,t=new tn){if(e.shape!==void 0){fl.encode(e.shape,t.uint32(10).fork()).join()}if(e.line!==void 0){fl.encode(e.line,t.uint32(18).fork()).join()}if(e.text!==void 0){fl.encode(e.text,t.uint32(26).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=Tkt();while(n.pos>>3){case 1:{if(o!==10){break}i.shape=fl.decode(n,n.uint32());continue}case 2:{if(o!==18){break}i.line=fl.decode(n,n.uint32());continue}case 3:{if(o!==26){break}i.text=fl.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return bde.fromPartial(e??{})},fromPartial(e){const t=Tkt();t.shape=e.shape!==void 0&&e.shape!==null?fl.fromPartial(e.shape):void 0;t.line=e.line!==void 0&&e.line!==null?fl.fromPartial(e.line):void 0;t.text=e.text!==void 0&&e.text!==null?fl.fromPartial(e.text):void 0;return t}};function wkt(){return{name:"",colors:[]}}var xde={encode(e,t=new tn){if(e.name!==""){t.uint32(10).string(e.name)}for(const n of e.colors){vde.encode(n,t.uint32(18).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=wkt();while(n.pos>>3){case 1:{if(o!==10){break}i.name=n.string();continue}case 2:{if(o!==18){break}i.colors.push(vde.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return xde.fromPartial(e??{})},fromPartial(e){const t=wkt();t.name=e.name??"";t.colors=e.colors?.map(n=>vde.fromPartial(n))||[];return t}};function Ekt(){return{name:"",color:void 0}}var vde={encode(e,t=new tn){if(e.name!==""){t.uint32(10).string(e.name)}if(e.color!==void 0){hi.encode(e.color,t.uint32(18).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=Ekt();while(n.pos>>3){case 1:{if(o!==10){break}i.name=n.string();continue}case 2:{if(o!==18){break}i.color=hi.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return vde.fromPartial(e??{})},fromPartial(e){const t=Ekt();t.name=e.name??"";t.color=e.color!==void 0&&e.color!==null?hi.fromPartial(e.color):void 0;return t}};function Ckt(){return{defaultStyleId:void 0,outerXml:void 0,definitions:[]}}var _de={encode(e,t=new tn){if(e.defaultStyleId!==void 0){t.uint32(10).string(e.defaultStyleId)}if(e.outerXml!==void 0){t.uint32(18).string(e.outerXml)}for(const n of e.definitions){zI.encode(n,t.uint32(26).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=Ckt();while(n.pos>>3){case 1:{if(o!==10){break}i.defaultStyleId=n.string();continue}case 2:{if(o!==18){break}i.outerXml=n.string();continue}case 3:{if(o!==26){break}i.definitions.push(zI.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return _de.fromPartial(e??{})},fromPartial(e){const t=Ckt();t.defaultStyleId=e.defaultStyleId??void 0;t.outerXml=e.outerXml??void 0;t.definitions=e.definitions?.map(n=>zI.fromPartial(n))||[];return t}};function Skt(){return{gridSpacingCxEmu:void 0,gridSpacingCyEmu:void 0,slideViewSnapToGrid:void 0,slideViewSnapToObjects:void 0,slideViewShowGuides:void 0}}var Tde={encode(e,t=new tn){if(e.gridSpacingCxEmu!==void 0){t.uint32(8).int64(e.gridSpacingCxEmu)}if(e.gridSpacingCyEmu!==void 0){t.uint32(16).int64(e.gridSpacingCyEmu)}if(e.slideViewSnapToGrid!==void 0){t.uint32(24).bool(e.slideViewSnapToGrid)}if(e.slideViewSnapToObjects!==void 0){t.uint32(32).bool(e.slideViewSnapToObjects)}if(e.slideViewShowGuides!==void 0){t.uint32(40).bool(e.slideViewShowGuides)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=Skt();while(n.pos>>3){case 1:{if(o!==8){break}i.gridSpacingCxEmu=hl(n.int64());continue}case 2:{if(o!==16){break}i.gridSpacingCyEmu=hl(n.int64());continue}case 3:{if(o!==24){break}i.slideViewSnapToGrid=n.bool();continue}case 4:{if(o!==32){break}i.slideViewSnapToObjects=n.bool();continue}case 5:{if(o!==40){break}i.slideViewShowGuides=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Tde.fromPartial(e??{})},fromPartial(e){const t=Skt();t.gridSpacingCxEmu=e.gridSpacingCxEmu??void 0;t.gridSpacingCyEmu=e.gridSpacingCyEmu??void 0;t.slideViewSnapToGrid=e.slideViewSnapToGrid??void 0;t.slideViewSnapToObjects=e.slideViewSnapToObjects??void 0;t.slideViewShowGuides=e.slideViewShowGuides??void 0;return t}};function Akt(){return{id:void 0,name:void 0,orientation:0,position:void 0,userDrawn:void 0,color:void 0}}var wde={encode(e,t=new tn){if(e.id!==void 0){t.uint32(8).uint32(e.id)}if(e.name!==void 0){t.uint32(18).string(e.name)}if(e.orientation!==0){t.uint32(24).int32(e.orientation)}if(e.position!==void 0){t.uint32(32).int32(e.position)}if(e.userDrawn!==void 0){t.uint32(40).bool(e.userDrawn)}if(e.color!==void 0){hi.encode(e.color,t.uint32(50).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=Akt();while(n.pos>>3){case 1:{if(o!==8){break}i.id=n.uint32();continue}case 2:{if(o!==18){break}i.name=n.string();continue}case 3:{if(o!==24){break}i.orientation=n.int32();continue}case 4:{if(o!==32){break}i.position=n.int32();continue}case 5:{if(o!==40){break}i.userDrawn=n.bool();continue}case 6:{if(o!==50){break}i.color=hi.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return wde.fromPartial(e??{})},fromPartial(e){const t=Akt();t.id=e.id??void 0;t.name=e.name??void 0;t.orientation=e.orientation??0;t.position=e.position??void 0;t.userDrawn=e.userDrawn??void 0;t.color=e.color!==void 0&&e.color!==null?hi.fromPartial(e.color):void 0;return t}};function kkt(){return{slideNumber:void 0,header:void 0,footer:void 0,dateTime:void 0}}var Ede={encode(e,t=new tn){if(e.slideNumber!==void 0){t.uint32(8).bool(e.slideNumber)}if(e.header!==void 0){t.uint32(16).bool(e.header)}if(e.footer!==void 0){t.uint32(24).bool(e.footer)}if(e.dateTime!==void 0){t.uint32(32).bool(e.dateTime)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=kkt();while(n.pos>>3){case 1:{if(o!==8){break}i.slideNumber=n.bool();continue}case 2:{if(o!==16){break}i.header=n.bool();continue}case 3:{if(o!==24){break}i.footer=n.bool();continue}case 4:{if(o!==32){break}i.dateTime=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Ede.fromPartial(e??{})},fromPartial(e){const t=kkt();t.slideNumber=e.slideNumber??void 0;t.header=e.header??void 0;t.footer=e.footer??void 0;t.dateTime=e.dateTime??void 0;return t}};function Rkt(){return{id:"",innerXml:void 0,outerXml:void 0,name:"",type:"",background:void 0,elements:[],bodyLevelStyles:[],titleLevelStyles:[],otherLevelStyles:[],parentLayoutId:"",colorMap:void 0,theme:void 0,showMasterShapes:void 0,showMasterPlaceholderAnimations:void 0,matchingName:void 0,preserve:void 0,userDrawn:void 0,furnitureVisibility:void 0,slideGuides:[]}}var Cde={encode(e,t=new tn){if(e.id!==""){t.uint32(10).string(e.id)}if(e.innerXml!==void 0){t.uint32(50).string(e.innerXml)}if(e.outerXml!==void 0){t.uint32(58).string(e.outerXml)}if(e.name!==""){t.uint32(66).string(e.name)}if(e.type!==""){t.uint32(74).string(e.type)}if(e.background!==void 0){BI.encode(e.background,t.uint32(82).fork()).join()}for(const n of e.elements){fl.encode(n,t.uint32(90).fork()).join()}for(const n of e.bodyLevelStyles){Lh.encode(n,t.uint32(98).fork()).join()}for(const n of e.titleLevelStyles){Lh.encode(n,t.uint32(106).fork()).join()}for(const n of e.otherLevelStyles){Lh.encode(n,t.uint32(114).fork()).join()}if(e.parentLayoutId!==""){t.uint32(122).string(e.parentLayoutId)}if(e.colorMap!==void 0){K4.encode(e.colorMap,t.uint32(130).fork()).join()}if(e.theme!==void 0){_0.encode(e.theme,t.uint32(138).fork()).join()}if(e.showMasterShapes!==void 0){t.uint32(144).bool(e.showMasterShapes)}if(e.showMasterPlaceholderAnimations!==void 0){t.uint32(152).bool(e.showMasterPlaceholderAnimations)}if(e.matchingName!==void 0){t.uint32(162).string(e.matchingName)}if(e.preserve!==void 0){t.uint32(168).bool(e.preserve)}if(e.userDrawn!==void 0){t.uint32(176).bool(e.userDrawn)}if(e.furnitureVisibility!==void 0){Ede.encode(e.furnitureVisibility,t.uint32(186).fork()).join()}for(const n of e.slideGuides){wde.encode(n,t.uint32(194).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=Rkt();while(n.pos>>3){case 1:{if(o!==10){break}i.id=n.string();continue}case 6:{if(o!==50){break}i.innerXml=n.string();continue}case 7:{if(o!==58){break}i.outerXml=n.string();continue}case 8:{if(o!==66){break}i.name=n.string();continue}case 9:{if(o!==74){break}i.type=n.string();continue}case 10:{if(o!==82){break}i.background=BI.decode(n,n.uint32());continue}case 11:{if(o!==90){break}i.elements.push(fl.decode(n,n.uint32()));continue}case 12:{if(o!==98){break}i.bodyLevelStyles.push(Lh.decode(n,n.uint32()));continue}case 13:{if(o!==106){break}i.titleLevelStyles.push(Lh.decode(n,n.uint32()));continue}case 14:{if(o!==114){break}i.otherLevelStyles.push(Lh.decode(n,n.uint32()));continue}case 15:{if(o!==122){break}i.parentLayoutId=n.string();continue}case 16:{if(o!==130){break}i.colorMap=K4.decode(n,n.uint32());continue}case 17:{if(o!==138){break}i.theme=_0.decode(n,n.uint32());continue}case 18:{if(o!==144){break}i.showMasterShapes=n.bool();continue}case 19:{if(o!==152){break}i.showMasterPlaceholderAnimations=n.bool();continue}case 20:{if(o!==162){break}i.matchingName=n.string();continue}case 21:{if(o!==168){break}i.preserve=n.bool();continue}case 22:{if(o!==176){break}i.userDrawn=n.bool();continue}case 23:{if(o!==186){break}i.furnitureVisibility=Ede.decode(n,n.uint32());continue}case 24:{if(o!==194){break}i.slideGuides.push(wde.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Cde.fromPartial(e??{})},fromPartial(e){const t=Rkt();t.id=e.id??"";t.innerXml=e.innerXml??void 0;t.outerXml=e.outerXml??void 0;t.name=e.name??"";t.type=e.type??"";t.background=e.background!==void 0&&e.background!==null?BI.fromPartial(e.background):void 0;t.elements=e.elements?.map(n=>fl.fromPartial(n))||[];t.bodyLevelStyles=e.bodyLevelStyles?.map(n=>Lh.fromPartial(n))||[];t.titleLevelStyles=e.titleLevelStyles?.map(n=>Lh.fromPartial(n))||[];t.otherLevelStyles=e.otherLevelStyles?.map(n=>Lh.fromPartial(n))||[];t.parentLayoutId=e.parentLayoutId??"";t.colorMap=e.colorMap!==void 0&&e.colorMap!==null?K4.fromPartial(e.colorMap):void 0;t.theme=e.theme!==void 0&&e.theme!==null?_0.fromPartial(e.theme):void 0;t.showMasterShapes=e.showMasterShapes??void 0;t.showMasterPlaceholderAnimations=e.showMasterPlaceholderAnimations??void 0;t.matchingName=e.matchingName??void 0;t.preserve=e.preserve??void 0;t.userDrawn=e.userDrawn??void 0;t.furnitureVisibility=e.furnitureVisibility!==void 0&&e.furnitureVisibility!==null?Ede.fromPartial(e.furnitureVisibility):void 0;t.slideGuides=e.slideGuides?.map(n=>wde.fromPartial(n))||[];return t}};function Pkt(){return{index:0,useLayoutId:"",elements:[],widthEmu:0,heightEmu:0,innerXml:void 0,outerXml:void 0,background:void 0,id:"",notesSlide:void 0,creationId:void 0,showMasterShapes:void 0,colorMap:void 0}}var G4={encode(e,t=new tn){if(e.index!==0){t.uint32(8).int32(e.index)}if(e.useLayoutId!==""){t.uint32(18).string(e.useLayoutId)}for(const n of e.elements){fl.encode(n,t.uint32(26).fork()).join()}if(e.widthEmu!==0){t.uint32(40).int64(e.widthEmu)}if(e.heightEmu!==0){t.uint32(48).int64(e.heightEmu)}if(e.innerXml!==void 0){t.uint32(58).string(e.innerXml)}if(e.outerXml!==void 0){t.uint32(66).string(e.outerXml)}if(e.background!==void 0){BI.encode(e.background,t.uint32(82).fork()).join()}if(e.id!==""){t.uint32(90).string(e.id)}if(e.notesSlide!==void 0){G4.encode(e.notesSlide,t.uint32(98).fork()).join()}if(e.creationId!==void 0){t.uint32(106).string(e.creationId)}if(e.showMasterShapes!==void 0){t.uint32(112).bool(e.showMasterShapes)}if(e.colorMap!==void 0){K4.encode(e.colorMap,t.uint32(122).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=Pkt();while(n.pos>>3){case 1:{if(o!==8){break}i.index=n.int32();continue}case 2:{if(o!==18){break}i.useLayoutId=n.string();continue}case 3:{if(o!==26){break}i.elements.push(fl.decode(n,n.uint32()));continue}case 5:{if(o!==40){break}i.widthEmu=hl(n.int64());continue}case 6:{if(o!==48){break}i.heightEmu=hl(n.int64());continue}case 7:{if(o!==58){break}i.innerXml=n.string();continue}case 8:{if(o!==66){break}i.outerXml=n.string();continue}case 10:{if(o!==82){break}i.background=BI.decode(n,n.uint32());continue}case 11:{if(o!==90){break}i.id=n.string();continue}case 12:{if(o!==98){break}i.notesSlide=G4.decode(n,n.uint32());continue}case 13:{if(o!==106){break}i.creationId=n.string();continue}case 14:{if(o!==112){break}i.showMasterShapes=n.bool();continue}case 15:{if(o!==122){break}i.colorMap=K4.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return G4.fromPartial(e??{})},fromPartial(e){const t=Pkt();t.index=e.index??0;t.useLayoutId=e.useLayoutId??"";t.elements=e.elements?.map(n=>fl.fromPartial(n))||[];t.widthEmu=e.widthEmu??0;t.heightEmu=e.heightEmu??0;t.innerXml=e.innerXml??void 0;t.outerXml=e.outerXml??void 0;t.background=e.background!==void 0&&e.background!==null?BI.fromPartial(e.background):void 0;t.id=e.id??"";t.notesSlide=e.notesSlide!==void 0&&e.notesSlide!==null?G4.fromPartial(e.notesSlide):void 0;t.creationId=e.creationId??void 0;t.showMasterShapes=e.showMasterShapes??void 0;t.colorMap=e.colorMap!==void 0&&e.colorMap!==null?K4.fromPartial(e.colorMap):void 0;return t}};function Ikt(){return{bbox:void 0,zIndex:void 0,innerXml:void 0,outerXml:void 0,shape:void 0,image:void 0,chartReference:void 0,video:void 0,table:void 0,imageReference:void 0,codeBlock:void 0,embeddedArtifact:void 0,smartArt:void 0,paragraphs:[],name:void 0,type:0,placeholderIndex:void 0,placeholderType:void 0,textStyle:void 0,effects:[],children:[],groupChildBbox:void 0,levelsStyles:[],fill:void 0,line:void 0,scene3d:void 0,shape3d:void 0,imageMask:void 0,lineReference:void 0,fillReference:void 0,effectReference:void 0,fontReference:void 0,hyperlink:void 0,id:"",creationId:void 0,placement:void 0,connector:void 0,citations:[],hidden:void 0,placeholderHasCustomPrompt:void 0,pictureHasPresetGeometry:void 0,useBackgroundFill:void 0}}var fl={encode(e,t=new tn){if(e.bbox!==void 0){$v.encode(e.bbox,t.uint32(10).fork()).join()}if(e.zIndex!==void 0){t.uint32(16).int32(e.zIndex)}if(e.innerXml!==void 0){t.uint32(58).string(e.innerXml)}if(e.outerXml!==void 0){t.uint32(66).string(e.outerXml)}if(e.shape!==void 0){cfe.encode(e.shape,t.uint32(34).fork()).join()}if(e.image!==void 0){ufe.encode(e.image,t.uint32(42).fork()).join()}if(e.chartReference!==void 0){Pde.encode(e.chartReference,t.uint32(146).fork()).join()}if(e.video!==void 0){dfe.encode(e.video,t.uint32(162).fork()).join()}if(e.table!==void 0){Kde.encode(e.table,t.uint32(170).fork()).join()}if(e.imageReference!==void 0){v0.encode(e.imageReference,t.uint32(26).fork()).join()}if(e.codeBlock!==void 0){UI.encode(e.codeBlock,t.uint32(74).fork()).join()}if(e.embeddedArtifact!==void 0){Ide.encode(e.embeddedArtifact,t.uint32(290).fork()).join()}if(e.smartArt!==void 0){Mde.encode(e.smartArt,t.uint32(306).fork()).join()}for(const n of e.paragraphs){jd.encode(n,t.uint32(50).fork()).join()}if(e.name!==void 0){t.uint32(82).string(e.name)}if(e.type!==0){t.uint32(88).int32(e.type)}if(e.placeholderIndex!==void 0){t.uint32(96).int32(e.placeholderIndex)}if(e.placeholderType!==void 0){t.uint32(106).string(e.placeholderType)}if(e.textStyle!==void 0){Gi.encode(e.textStyle,t.uint32(114).fork()).join()}for(const n of e.effects){nE.encode(n,t.uint32(122).fork()).join()}for(const n of e.children){fl.encode(n,t.uint32(138).fork()).join()}if(e.groupChildBbox!==void 0){$v.encode(e.groupChildBbox,t.uint32(330).fork()).join()}for(const n of e.levelsStyles){Lh.encode(n,t.uint32(130).fork()).join()}if(e.fill!==void 0){Ei.encode(e.fill,t.uint32(154).fork()).join()}if(e.line!==void 0){ui.encode(e.line,t.uint32(242).fork()).join()}if(e.scene3d!==void 0){Sde.encode(e.scene3d,t.uint32(250).fork()).join()}if(e.shape3d!==void 0){Ade.encode(e.shape3d,t.uint32(258).fork()).join()}if(e.imageMask!==void 0){rE.encode(e.imageMask,t.uint32(266).fork()).join()}if(e.lineReference!==void 0){wd.encode(e.lineReference,t.uint32(178).fork()).join()}if(e.fillReference!==void 0){wd.encode(e.fillReference,t.uint32(186).fork()).join()}if(e.effectReference!==void 0){wd.encode(e.effectReference,t.uint32(194).fork()).join()}if(e.fontReference!==void 0){wd.encode(e.fontReference,t.uint32(202).fork()).join()}if(e.hyperlink!==void 0){ET.encode(e.hyperlink,t.uint32(210).fork()).join()}if(e.id!==""){t.uint32(218).string(e.id)}if(e.creationId!==void 0){t.uint32(274).string(e.creationId)}if(e.placement!==void 0){Xde.encode(e.placement,t.uint32(282).fork()).join()}if(e.connector!==void 0){jde.encode(e.connector,t.uint32(226).fork()).join()}for(const n of e.citations){t.uint32(234).string(n)}if(e.hidden!==void 0){t.uint32(296).bool(e.hidden)}if(e.placeholderHasCustomPrompt!==void 0){t.uint32(312).bool(e.placeholderHasCustomPrompt)}if(e.pictureHasPresetGeometry!==void 0){t.uint32(320).bool(e.pictureHasPresetGeometry)}if(e.useBackgroundFill!==void 0){t.uint32(336).bool(e.useBackgroundFill)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=Ikt();while(n.pos>>3){case 1:{if(o!==10){break}i.bbox=$v.decode(n,n.uint32());continue}case 2:{if(o!==16){break}i.zIndex=n.int32();continue}case 7:{if(o!==58){break}i.innerXml=n.string();continue}case 8:{if(o!==66){break}i.outerXml=n.string();continue}case 4:{if(o!==34){break}i.shape=cfe.decode(n,n.uint32());continue}case 5:{if(o!==42){break}i.image=ufe.decode(n,n.uint32());continue}case 18:{if(o!==146){break}i.chartReference=Pde.decode(n,n.uint32());continue}case 20:{if(o!==162){break}i.video=dfe.decode(n,n.uint32());continue}case 21:{if(o!==170){break}i.table=Kde.decode(n,n.uint32());continue}case 3:{if(o!==26){break}i.imageReference=v0.decode(n,n.uint32());continue}case 9:{if(o!==74){break}i.codeBlock=UI.decode(n,n.uint32());continue}case 36:{if(o!==290){break}i.embeddedArtifact=Ide.decode(n,n.uint32());continue}case 38:{if(o!==306){break}i.smartArt=Mde.decode(n,n.uint32());continue}case 6:{if(o!==50){break}i.paragraphs.push(jd.decode(n,n.uint32()));continue}case 10:{if(o!==82){break}i.name=n.string();continue}case 11:{if(o!==88){break}i.type=n.int32();continue}case 12:{if(o!==96){break}i.placeholderIndex=n.int32();continue}case 13:{if(o!==106){break}i.placeholderType=n.string();continue}case 14:{if(o!==114){break}i.textStyle=Gi.decode(n,n.uint32());continue}case 15:{if(o!==122){break}i.effects.push(nE.decode(n,n.uint32()));continue}case 17:{if(o!==138){break}i.children.push(fl.decode(n,n.uint32()));continue}case 41:{if(o!==330){break}i.groupChildBbox=$v.decode(n,n.uint32());continue}case 16:{if(o!==130){break}i.levelsStyles.push(Lh.decode(n,n.uint32()));continue}case 19:{if(o!==154){break}i.fill=Ei.decode(n,n.uint32());continue}case 30:{if(o!==242){break}i.line=ui.decode(n,n.uint32());continue}case 31:{if(o!==250){break}i.scene3d=Sde.decode(n,n.uint32());continue}case 32:{if(o!==258){break}i.shape3d=Ade.decode(n,n.uint32());continue}case 33:{if(o!==266){break}i.imageMask=rE.decode(n,n.uint32());continue}case 22:{if(o!==178){break}i.lineReference=wd.decode(n,n.uint32());continue}case 23:{if(o!==186){break}i.fillReference=wd.decode(n,n.uint32());continue}case 24:{if(o!==194){break}i.effectReference=wd.decode(n,n.uint32());continue}case 25:{if(o!==202){break}i.fontReference=wd.decode(n,n.uint32());continue}case 26:{if(o!==210){break}i.hyperlink=ET.decode(n,n.uint32());continue}case 27:{if(o!==218){break}i.id=n.string();continue}case 34:{if(o!==274){break}i.creationId=n.string();continue}case 35:{if(o!==282){break}i.placement=Xde.decode(n,n.uint32());continue}case 28:{if(o!==226){break}i.connector=jde.decode(n,n.uint32());continue}case 29:{if(o!==234){break}i.citations.push(n.string());continue}case 37:{if(o!==296){break}i.hidden=n.bool();continue}case 39:{if(o!==312){break}i.placeholderHasCustomPrompt=n.bool();continue}case 40:{if(o!==320){break}i.pictureHasPresetGeometry=n.bool();continue}case 42:{if(o!==336){break}i.useBackgroundFill=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return fl.fromPartial(e??{})},fromPartial(e){const t=Ikt();t.bbox=e.bbox!==void 0&&e.bbox!==null?$v.fromPartial(e.bbox):void 0;t.zIndex=e.zIndex??void 0;t.innerXml=e.innerXml??void 0;t.outerXml=e.outerXml??void 0;t.shape=e.shape!==void 0&&e.shape!==null?cfe.fromPartial(e.shape):void 0;t.image=e.image!==void 0&&e.image!==null?ufe.fromPartial(e.image):void 0;t.chartReference=e.chartReference!==void 0&&e.chartReference!==null?Pde.fromPartial(e.chartReference):void 0;t.video=e.video!==void 0&&e.video!==null?dfe.fromPartial(e.video):void 0;t.table=e.table!==void 0&&e.table!==null?Kde.fromPartial(e.table):void 0;t.imageReference=e.imageReference!==void 0&&e.imageReference!==null?v0.fromPartial(e.imageReference):void 0;t.codeBlock=e.codeBlock!==void 0&&e.codeBlock!==null?UI.fromPartial(e.codeBlock):void 0;t.embeddedArtifact=e.embeddedArtifact!==void 0&&e.embeddedArtifact!==null?Ide.fromPartial(e.embeddedArtifact):void 0;t.smartArt=e.smartArt!==void 0&&e.smartArt!==null?Mde.fromPartial(e.smartArt):void 0;t.paragraphs=e.paragraphs?.map(n=>jd.fromPartial(n))||[];t.name=e.name??void 0;t.type=e.type??0;t.placeholderIndex=e.placeholderIndex??void 0;t.placeholderType=e.placeholderType??void 0;t.textStyle=e.textStyle!==void 0&&e.textStyle!==null?Gi.fromPartial(e.textStyle):void 0;t.effects=e.effects?.map(n=>nE.fromPartial(n))||[];t.children=e.children?.map(n=>fl.fromPartial(n))||[];t.groupChildBbox=e.groupChildBbox!==void 0&&e.groupChildBbox!==null?$v.fromPartial(e.groupChildBbox):void 0;t.levelsStyles=e.levelsStyles?.map(n=>Lh.fromPartial(n))||[];t.fill=e.fill!==void 0&&e.fill!==null?Ei.fromPartial(e.fill):void 0;t.line=e.line!==void 0&&e.line!==null?ui.fromPartial(e.line):void 0;t.scene3d=e.scene3d!==void 0&&e.scene3d!==null?Sde.fromPartial(e.scene3d):void 0;t.shape3d=e.shape3d!==void 0&&e.shape3d!==null?Ade.fromPartial(e.shape3d):void 0;t.imageMask=e.imageMask!==void 0&&e.imageMask!==null?rE.fromPartial(e.imageMask):void 0;t.lineReference=e.lineReference!==void 0&&e.lineReference!==null?wd.fromPartial(e.lineReference):void 0;t.fillReference=e.fillReference!==void 0&&e.fillReference!==null?wd.fromPartial(e.fillReference):void 0;t.effectReference=e.effectReference!==void 0&&e.effectReference!==null?wd.fromPartial(e.effectReference):void 0;t.fontReference=e.fontReference!==void 0&&e.fontReference!==null?wd.fromPartial(e.fontReference):void 0;t.hyperlink=e.hyperlink!==void 0&&e.hyperlink!==null?ET.fromPartial(e.hyperlink):void 0;t.id=e.id??"";t.creationId=e.creationId??void 0;t.placement=e.placement!==void 0&&e.placement!==null?Xde.fromPartial(e.placement):void 0;t.connector=e.connector!==void 0&&e.connector!==null?jde.fromPartial(e.connector):void 0;t.citations=e.citations?.map(n=>n)||[];t.hidden=e.hidden??void 0;t.placeholderHasCustomPrompt=e.placeholderHasCustomPrompt??void 0;t.pictureHasPresetGeometry=e.pictureHasPresetGeometry??void 0;t.useBackgroundFill=e.useBackgroundFill??void 0;return t}};function Mkt(){return{index:"",color:void 0}}var wd={encode(e,t=new tn){if(e.index!==""){t.uint32(10).string(e.index)}if(e.color!==void 0){hi.encode(e.color,t.uint32(18).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=Mkt();while(n.pos>>3){case 1:{if(o!==10){break}i.index=n.string();continue}case 2:{if(o!==18){break}i.color=hi.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return wd.fromPartial(e??{})},fromPartial(e){const t=Mkt();t.index=e.index??"";t.color=e.color!==void 0&&e.color!==null?hi.fromPartial(e.color):void 0;return t}};function Lkt(){return{camera:void 0,lightRig:void 0}}var Sde={encode(e,t=new tn){if(e.camera!==void 0){kde.encode(e.camera,t.uint32(10).fork()).join()}if(e.lightRig!==void 0){Rde.encode(e.lightRig,t.uint32(18).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=Lkt();while(n.pos>>3){case 1:{if(o!==10){break}i.camera=kde.decode(n,n.uint32());continue}case 2:{if(o!==18){break}i.lightRig=Rde.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Sde.fromPartial(e??{})},fromPartial(e){const t=Lkt();t.camera=e.camera!==void 0&&e.camera!==null?kde.fromPartial(e.camera):void 0;t.lightRig=e.lightRig!==void 0&&e.lightRig!==null?Rde.fromPartial(e.lightRig):void 0;return t}};function Dkt(){return{zEmu:void 0,extrusionHeightEmu:void 0,contourWidthEmu:void 0,presetMaterial:void 0,bevelTop:void 0,bevelBottom:void 0,extrusionColor:void 0,contourColor:void 0}}var Ade={encode(e,t=new tn){if(e.zEmu!==void 0){t.uint32(8).int64(e.zEmu)}if(e.extrusionHeightEmu!==void 0){t.uint32(16).int64(e.extrusionHeightEmu)}if(e.contourWidthEmu!==void 0){t.uint32(24).int64(e.contourWidthEmu)}if(e.presetMaterial!==void 0){t.uint32(34).string(e.presetMaterial)}if(e.bevelTop!==void 0){V4.encode(e.bevelTop,t.uint32(42).fork()).join()}if(e.bevelBottom!==void 0){V4.encode(e.bevelBottom,t.uint32(50).fork()).join()}if(e.extrusionColor!==void 0){hi.encode(e.extrusionColor,t.uint32(58).fork()).join()}if(e.contourColor!==void 0){hi.encode(e.contourColor,t.uint32(66).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=Dkt();while(n.pos>>3){case 1:{if(o!==8){break}i.zEmu=hl(n.int64());continue}case 2:{if(o!==16){break}i.extrusionHeightEmu=hl(n.int64());continue}case 3:{if(o!==24){break}i.contourWidthEmu=hl(n.int64());continue}case 4:{if(o!==34){break}i.presetMaterial=n.string();continue}case 5:{if(o!==42){break}i.bevelTop=V4.decode(n,n.uint32());continue}case 6:{if(o!==50){break}i.bevelBottom=V4.decode(n,n.uint32());continue}case 7:{if(o!==58){break}i.extrusionColor=hi.decode(n,n.uint32());continue}case 8:{if(o!==66){break}i.contourColor=hi.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Ade.fromPartial(e??{})},fromPartial(e){const t=Dkt();t.zEmu=e.zEmu??void 0;t.extrusionHeightEmu=e.extrusionHeightEmu??void 0;t.contourWidthEmu=e.contourWidthEmu??void 0;t.presetMaterial=e.presetMaterial??void 0;t.bevelTop=e.bevelTop!==void 0&&e.bevelTop!==null?V4.fromPartial(e.bevelTop):void 0;t.bevelBottom=e.bevelBottom!==void 0&&e.bevelBottom!==null?V4.fromPartial(e.bevelBottom):void 0;t.extrusionColor=e.extrusionColor!==void 0&&e.extrusionColor!==null?hi.fromPartial(e.extrusionColor):void 0;t.contourColor=e.contourColor!==void 0&&e.contourColor!==null?hi.fromPartial(e.contourColor):void 0;return t}};function Fkt(){return{widthEmu:void 0,heightEmu:void 0,preset:void 0}}var V4={encode(e,t=new tn){if(e.widthEmu!==void 0){t.uint32(8).int64(e.widthEmu)}if(e.heightEmu!==void 0){t.uint32(16).int64(e.heightEmu)}if(e.preset!==void 0){t.uint32(26).string(e.preset)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=Fkt();while(n.pos>>3){case 1:{if(o!==8){break}i.widthEmu=hl(n.int64());continue}case 2:{if(o!==16){break}i.heightEmu=hl(n.int64());continue}case 3:{if(o!==26){break}i.preset=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return V4.fromPartial(e??{})},fromPartial(e){const t=Fkt();t.widthEmu=e.widthEmu??void 0;t.heightEmu=e.heightEmu??void 0;t.preset=e.preset??void 0;return t}};function Nkt(){return{preset:"",rotation:void 0}}var kde={encode(e,t=new tn){if(e.preset!==""){t.uint32(10).string(e.preset)}if(e.rotation!==void 0){H4.encode(e.rotation,t.uint32(18).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=Nkt();while(n.pos>>3){case 1:{if(o!==10){break}i.preset=n.string();continue}case 2:{if(o!==18){break}i.rotation=H4.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return kde.fromPartial(e??{})},fromPartial(e){const t=Nkt();t.preset=e.preset??"";t.rotation=e.rotation!==void 0&&e.rotation!==null?H4.fromPartial(e.rotation):void 0;return t}};function Okt(){return{rig:"",direction:"",rotation:void 0}}var Rde={encode(e,t=new tn){if(e.rig!==""){t.uint32(10).string(e.rig)}if(e.direction!==""){t.uint32(18).string(e.direction)}if(e.rotation!==void 0){H4.encode(e.rotation,t.uint32(26).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=Okt();while(n.pos>>3){case 1:{if(o!==10){break}i.rig=n.string();continue}case 2:{if(o!==18){break}i.direction=n.string();continue}case 3:{if(o!==26){break}i.rotation=H4.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Rde.fromPartial(e??{})},fromPartial(e){const t=Okt();t.rig=e.rig??"";t.direction=e.direction??"";t.rotation=e.rotation!==void 0&&e.rotation!==null?H4.fromPartial(e.rotation):void 0;return t}};function Bkt(){return{latitude:void 0,longitude:void 0,revolution:void 0}}var H4={encode(e,t=new tn){if(e.latitude!==void 0){t.uint32(8).int32(e.latitude)}if(e.longitude!==void 0){t.uint32(16).int32(e.longitude)}if(e.revolution!==void 0){t.uint32(24).int32(e.revolution)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=Bkt();while(n.pos>>3){case 1:{if(o!==8){break}i.latitude=n.int32();continue}case 2:{if(o!==16){break}i.longitude=n.int32();continue}case 3:{if(o!==24){break}i.revolution=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return H4.fromPartial(e??{})},fromPartial(e){const t=Bkt();t.latitude=e.latitude??void 0;t.longitude=e.longitude??void 0;t.revolution=e.revolution??void 0;return t}};function zkt(){return{id:""}}var Pde={encode(e,t=new tn){if(e.id!==""){t.uint32(10).string(e.id)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=zkt();while(n.pos>>3){case 1:{if(o!==10){break}i.id=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Pde.fromPartial(e??{})},fromPartial(e){const t=zkt();t.id=e.id??"";return t}};function Ukt(){return{embeddedView:void 0,previewImageReference:void 0}}var Ide={encode(e,t=new tn){if(e.embeddedView!==void 0){bX.encode(e.embeddedView,t.uint32(10).fork()).join()}if(e.previewImageReference!==void 0){v0.encode(e.previewImageReference,t.uint32(18).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=Ukt();while(n.pos>>3){case 1:{if(o!==10){break}i.embeddedView=bX.decode(n,n.uint32());continue}case 2:{if(o!==18){break}i.previewImageReference=v0.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Ide.fromPartial(e??{})},fromPartial(e){const t=Ukt();t.embeddedView=e.embeddedView!==void 0&&e.embeddedView!==null?bX.fromPartial(e.embeddedView):void 0;t.previewImageReference=e.previewImageReference!==void 0&&e.previewImageReference!==null?v0.fromPartial(e.previewImageReference):void 0;return t}};function Vkt(){return{dataModel:void 0,layoutNode:void 0}}var Mde={encode(e,t=new tn){if(e.dataModel!==void 0){Hde.encode(e.dataModel,t.uint32(50).fork()).join()}if(e.layoutNode!==void 0){W4.encode(e.layoutNode,t.uint32(90).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=Vkt();while(n.pos>>3){case 6:{if(o!==50){break}i.dataModel=Hde.decode(n,n.uint32());continue}case 11:{if(o!==90){break}i.layoutNode=W4.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Mde.fromPartial(e??{})},fromPartial(e){const t=Vkt();t.dataModel=e.dataModel!==void 0&&e.dataModel!==null?Hde.fromPartial(e.dataModel):void 0;t.layoutNode=e.layoutNode!==void 0&&e.layoutNode!==null?W4.fromPartial(e.layoutNode):void 0;return t}};function $kt(){return{name:void 0,styleLabel:void 0,children:[]}}var W4={encode(e,t=new tn){if(e.name!==void 0){t.uint32(10).string(e.name)}if(e.styleLabel!==void 0){t.uint32(18).string(e.styleLabel)}for(const n of e.children){eE.encode(n,t.uint32(50).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=$kt();while(n.pos>>3){case 1:{if(o!==10){break}i.name=n.string();continue}case 2:{if(o!==18){break}i.styleLabel=n.string();continue}case 6:{if(o!==50){break}i.children.push(eE.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return W4.fromPartial(e??{})},fromPartial(e){const t=$kt();t.name=e.name??void 0;t.styleLabel=e.styleLabel??void 0;t.children=e.children?.map(n=>eE.fromPartial(n))||[];return t}};function Gkt(){return{layoutNode:void 0,algorithm:void 0,shape:void 0,presentationOf:void 0,forEach:void 0,choose:void 0,constraints:void 0,rules:void 0}}var eE={encode(e,t=new tn){if(e.layoutNode!==void 0){W4.encode(e.layoutNode,t.uint32(10).fork()).join()}if(e.algorithm!==void 0){Lde.encode(e.algorithm,t.uint32(18).fork()).join()}if(e.shape!==void 0){Fde.encode(e.shape,t.uint32(26).fork()).join()}if(e.presentationOf!==void 0){Nde.encode(e.presentationOf,t.uint32(34).fork()).join()}if(e.forEach!==void 0){Ode.encode(e.forEach,t.uint32(42).fork()).join()}if(e.choose!==void 0){Bde.encode(e.choose,t.uint32(50).fork()).join()}if(e.constraints!==void 0){Ude.encode(e.constraints,t.uint32(58).fork()).join()}if(e.rules!==void 0){$de.encode(e.rules,t.uint32(66).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=Gkt();while(n.pos>>3){case 1:{if(o!==10){break}i.layoutNode=W4.decode(n,n.uint32());continue}case 2:{if(o!==18){break}i.algorithm=Lde.decode(n,n.uint32());continue}case 3:{if(o!==26){break}i.shape=Fde.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.presentationOf=Nde.decode(n,n.uint32());continue}case 5:{if(o!==42){break}i.forEach=Ode.decode(n,n.uint32());continue}case 6:{if(o!==50){break}i.choose=Bde.decode(n,n.uint32());continue}case 7:{if(o!==58){break}i.constraints=Ude.decode(n,n.uint32());continue}case 8:{if(o!==66){break}i.rules=$de.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return eE.fromPartial(e??{})},fromPartial(e){const t=Gkt();t.layoutNode=e.layoutNode!==void 0&&e.layoutNode!==null?W4.fromPartial(e.layoutNode):void 0;t.algorithm=e.algorithm!==void 0&&e.algorithm!==null?Lde.fromPartial(e.algorithm):void 0;t.shape=e.shape!==void 0&&e.shape!==null?Fde.fromPartial(e.shape):void 0;t.presentationOf=e.presentationOf!==void 0&&e.presentationOf!==null?Nde.fromPartial(e.presentationOf):void 0;t.forEach=e.forEach!==void 0&&e.forEach!==null?Ode.fromPartial(e.forEach):void 0;t.choose=e.choose!==void 0&&e.choose!==null?Bde.fromPartial(e.choose):void 0;t.constraints=e.constraints!==void 0&&e.constraints!==null?Ude.fromPartial(e.constraints):void 0;t.rules=e.rules!==void 0&&e.rules!==null?$de.fromPartial(e.rules):void 0;return t}};function Hkt(){return{type:"",parameters:[]}}var Lde={encode(e,t=new tn){if(e.type!==""){t.uint32(10).string(e.type)}for(const n of e.parameters){Dde.encode(n,t.uint32(26).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=Hkt();while(n.pos>>3){case 1:{if(o!==10){break}i.type=n.string();continue}case 3:{if(o!==26){break}i.parameters.push(Dde.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Lde.fromPartial(e??{})},fromPartial(e){const t=Hkt();t.type=e.type??"";t.parameters=e.parameters?.map(n=>Dde.fromPartial(n))||[];return t}};function Wkt(){return{type:"",value:void 0}}var Dde={encode(e,t=new tn){if(e.type!==""){t.uint32(10).string(e.type)}if(e.value!==void 0){t.uint32(18).string(e.value)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=Wkt();while(n.pos>>3){case 1:{if(o!==10){break}i.type=n.string();continue}case 2:{if(o!==18){break}i.value=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Dde.fromPartial(e??{})},fromPartial(e){const t=Wkt();t.type=e.type??"";t.value=e.value??void 0;return t}};function Ykt(){return{type:void 0}}var Fde={encode(e,t=new tn){if(e.type!==void 0){t.uint32(10).string(e.type)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=Ykt();while(n.pos>>3){case 1:{if(o!==10){break}i.type=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Fde.fromPartial(e??{})},fromPartial(e){const t=Ykt();t.type=e.type??void 0;return t}};function qkt(){return{axes:[],pointTypes:[],starts:[],counts:[],steps:[]}}var tE={encode(e,t=new tn){for(const n of e.axes){t.uint32(10).string(n)}for(const n of e.pointTypes){t.uint32(18).string(n)}t.uint32(34).fork();for(const n of e.starts){t.int32(n)}t.join();t.uint32(42).fork();for(const n of e.counts){t.uint32(n)}t.join();t.uint32(50).fork();for(const n of e.steps){t.int32(n)}t.join();return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=qkt();while(n.pos>>3){case 1:{if(o!==10){break}i.axes.push(n.string());continue}case 2:{if(o!==18){break}i.pointTypes.push(n.string());continue}case 4:{if(o===32){i.starts.push(n.int32());continue}if(o===34){const a=n.uint32()+n.pos;while(n.posn)||[];t.pointTypes=e.pointTypes?.map(n=>n)||[];t.starts=e.starts?.map(n=>n)||[];t.counts=e.counts?.map(n=>n)||[];t.steps=e.steps?.map(n=>n)||[];return t}};function Xkt(){return{iterator:void 0}}var Nde={encode(e,t=new tn){if(e.iterator!==void 0){tE.encode(e.iterator,t.uint32(10).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=Xkt();while(n.pos>>3){case 1:{if(o!==10){break}i.iterator=tE.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Nde.fromPartial(e??{})},fromPartial(e){const t=Xkt();t.iterator=e.iterator!==void 0&&e.iterator!==null?tE.fromPartial(e.iterator):void 0;return t}};function jkt(){return{reference:void 0,iterator:void 0,children:[]}}var Ode={encode(e,t=new tn){if(e.reference!==void 0){t.uint32(18).string(e.reference)}if(e.iterator!==void 0){tE.encode(e.iterator,t.uint32(26).fork()).join()}for(const n of e.children){eE.encode(n,t.uint32(34).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=jkt();while(n.pos>>3){case 2:{if(o!==18){break}i.reference=n.string();continue}case 3:{if(o!==26){break}i.iterator=tE.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.children.push(eE.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Ode.fromPartial(e??{})},fromPartial(e){const t=jkt();t.reference=e.reference??void 0;t.iterator=e.iterator!==void 0&&e.iterator!==null?tE.fromPartial(e.iterator):void 0;t.children=e.children?.map(n=>eE.fromPartial(n))||[];return t}};function Kkt(){return{branches:[]}}var Bde={encode(e,t=new tn){for(const n of e.branches){zde.encode(n,t.uint32(18).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=Kkt();while(n.pos>>3){case 2:{if(o!==18){break}i.branches.push(zde.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Bde.fromPartial(e??{})},fromPartial(e){const t=Kkt();t.branches=e.branches?.map(n=>zde.fromPartial(n))||[];return t}};function Zkt(){return{isElse:false,iterator:void 0,function:void 0,argument:void 0,operator:void 0,value:void 0,children:[]}}var zde={encode(e,t=new tn){if(e.isElse!==false){t.uint32(8).bool(e.isElse)}if(e.iterator!==void 0){tE.encode(e.iterator,t.uint32(26).fork()).join()}if(e.function!==void 0){t.uint32(34).string(e.function)}if(e.argument!==void 0){t.uint32(42).string(e.argument)}if(e.operator!==void 0){t.uint32(50).string(e.operator)}if(e.value!==void 0){t.uint32(58).string(e.value)}for(const n of e.children){eE.encode(n,t.uint32(66).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=Zkt();while(n.pos>>3){case 1:{if(o!==8){break}i.isElse=n.bool();continue}case 3:{if(o!==26){break}i.iterator=tE.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.function=n.string();continue}case 5:{if(o!==42){break}i.argument=n.string();continue}case 6:{if(o!==50){break}i.operator=n.string();continue}case 7:{if(o!==58){break}i.value=n.string();continue}case 8:{if(o!==66){break}i.children.push(eE.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return zde.fromPartial(e??{})},fromPartial(e){const t=Zkt();t.isElse=e.isElse??false;t.iterator=e.iterator!==void 0&&e.iterator!==null?tE.fromPartial(e.iterator):void 0;t.function=e.function??void 0;t.argument=e.argument??void 0;t.operator=e.operator??void 0;t.value=e.value??void 0;t.children=e.children?.map(n=>eE.fromPartial(n))||[];return t}};function Jkt(){return{constraints:[]}}var Ude={encode(e,t=new tn){for(const n of e.constraints){Vde.encode(n,t.uint32(10).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=Jkt();while(n.pos>>3){case 1:{if(o!==10){break}i.constraints.push(Vde.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Ude.fromPartial(e??{})},fromPartial(e){const t=Jkt();t.constraints=e.constraints?.map(n=>Vde.fromPartial(n))||[];return t}};function Qkt(){return{type:"",forTarget:void 0,forName:void 0,pointType:void 0,referenceType:void 0,referenceFor:void 0,referenceForName:void 0,referencePointType:void 0,operator:void 0,value:void 0,factor:void 0}}var Vde={encode(e,t=new tn){if(e.type!==""){t.uint32(10).string(e.type)}if(e.forTarget!==void 0){t.uint32(18).string(e.forTarget)}if(e.forName!==void 0){t.uint32(26).string(e.forName)}if(e.pointType!==void 0){t.uint32(34).string(e.pointType)}if(e.referenceType!==void 0){t.uint32(42).string(e.referenceType)}if(e.referenceFor!==void 0){t.uint32(50).string(e.referenceFor)}if(e.referenceForName!==void 0){t.uint32(58).string(e.referenceForName)}if(e.referencePointType!==void 0){t.uint32(66).string(e.referencePointType)}if(e.operator!==void 0){t.uint32(74).string(e.operator)}if(e.value!==void 0){t.uint32(81).double(e.value)}if(e.factor!==void 0){t.uint32(89).double(e.factor)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=Qkt();while(n.pos>>3){case 1:{if(o!==10){break}i.type=n.string();continue}case 2:{if(o!==18){break}i.forTarget=n.string();continue}case 3:{if(o!==26){break}i.forName=n.string();continue}case 4:{if(o!==34){break}i.pointType=n.string();continue}case 5:{if(o!==42){break}i.referenceType=n.string();continue}case 6:{if(o!==50){break}i.referenceFor=n.string();continue}case 7:{if(o!==58){break}i.referenceForName=n.string();continue}case 8:{if(o!==66){break}i.referencePointType=n.string();continue}case 9:{if(o!==74){break}i.operator=n.string();continue}case 10:{if(o!==81){break}i.value=n.double();continue}case 11:{if(o!==89){break}i.factor=n.double();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Vde.fromPartial(e??{})},fromPartial(e){const t=Qkt();t.type=e.type??"";t.forTarget=e.forTarget??void 0;t.forName=e.forName??void 0;t.pointType=e.pointType??void 0;t.referenceType=e.referenceType??void 0;t.referenceFor=e.referenceFor??void 0;t.referenceForName=e.referenceForName??void 0;t.referencePointType=e.referencePointType??void 0;t.operator=e.operator??void 0;t.value=e.value??void 0;t.factor=e.factor??void 0;return t}};function eRt(){return{rules:[]}}var $de={encode(e,t=new tn){for(const n of e.rules){Gde.encode(n,t.uint32(10).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=eRt();while(n.pos>>3){case 1:{if(o!==10){break}i.rules.push(Gde.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return $de.fromPartial(e??{})},fromPartial(e){const t=eRt();t.rules=e.rules?.map(n=>Gde.fromPartial(n))||[];return t}};function tRt(){return{type:"",forTarget:void 0,forName:void 0,value:void 0,factor:void 0,max:void 0}}var Gde={encode(e,t=new tn){if(e.type!==""){t.uint32(10).string(e.type)}if(e.forTarget!==void 0){t.uint32(18).string(e.forTarget)}if(e.forName!==void 0){t.uint32(26).string(e.forName)}if(e.value!==void 0){t.uint32(41).double(e.value)}if(e.factor!==void 0){t.uint32(49).double(e.factor)}if(e.max!==void 0){t.uint32(57).double(e.max)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=tRt();while(n.pos>>3){case 1:{if(o!==10){break}i.type=n.string();continue}case 2:{if(o!==18){break}i.forTarget=n.string();continue}case 3:{if(o!==26){break}i.forName=n.string();continue}case 5:{if(o!==41){break}i.value=n.double();continue}case 6:{if(o!==49){break}i.factor=n.double();continue}case 7:{if(o!==57){break}i.max=n.double();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Gde.fromPartial(e??{})},fromPartial(e){const t=tRt();t.type=e.type??"";t.forTarget=e.forTarget??void 0;t.forName=e.forName??void 0;t.value=e.value??void 0;t.factor=e.factor??void 0;t.max=e.max??void 0;return t}};function nRt(){return{points:[],connections:[]}}var Hde={encode(e,t=new tn){for(const n of e.points){Wde.encode(n,t.uint32(10).fork()).join()}for(const n of e.connections){Yde.encode(n,t.uint32(18).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=nRt();while(n.pos>>3){case 1:{if(o!==10){break}i.points.push(Wde.decode(n,n.uint32()));continue}case 2:{if(o!==18){break}i.connections.push(Yde.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Hde.fromPartial(e??{})},fromPartial(e){const t=nRt();t.points=e.points?.map(n=>Wde.fromPartial(n))||[];t.connections=e.connections?.map(n=>Yde.fromPartial(n))||[];return t}};function rRt(){return{modelId:"",type:void 0,connectionId:void 0,paragraphs:[]}}var Wde={encode(e,t=new tn){if(e.modelId!==""){t.uint32(10).string(e.modelId)}if(e.type!==void 0){t.uint32(18).string(e.type)}if(e.connectionId!==void 0){t.uint32(26).string(e.connectionId)}for(const n of e.paragraphs){jd.encode(n,t.uint32(42).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=rRt();while(n.pos>>3){case 1:{if(o!==10){break}i.modelId=n.string();continue}case 2:{if(o!==18){break}i.type=n.string();continue}case 3:{if(o!==26){break}i.connectionId=n.string();continue}case 5:{if(o!==42){break}i.paragraphs.push(jd.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Wde.fromPartial(e??{})},fromPartial(e){const t=rRt();t.modelId=e.modelId??"";t.type=e.type??void 0;t.connectionId=e.connectionId??void 0;t.paragraphs=e.paragraphs?.map(n=>jd.fromPartial(n))||[];return t}};function iRt(){return{modelId:"",type:void 0,sourceId:"",destinationId:"",sourcePosition:0,destinationPosition:0,parentTransitionId:void 0,siblingTransitionId:void 0,presentationId:void 0}}var Yde={encode(e,t=new tn){if(e.modelId!==""){t.uint32(10).string(e.modelId)}if(e.type!==void 0){t.uint32(18).string(e.type)}if(e.sourceId!==""){t.uint32(26).string(e.sourceId)}if(e.destinationId!==""){t.uint32(34).string(e.destinationId)}if(e.sourcePosition!==0){t.uint32(40).uint32(e.sourcePosition)}if(e.destinationPosition!==0){t.uint32(48).uint32(e.destinationPosition)}if(e.parentTransitionId!==void 0){t.uint32(58).string(e.parentTransitionId)}if(e.siblingTransitionId!==void 0){t.uint32(66).string(e.siblingTransitionId)}if(e.presentationId!==void 0){t.uint32(74).string(e.presentationId)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=iRt();while(n.pos>>3){case 1:{if(o!==10){break}i.modelId=n.string();continue}case 2:{if(o!==18){break}i.type=n.string();continue}case 3:{if(o!==26){break}i.sourceId=n.string();continue}case 4:{if(o!==34){break}i.destinationId=n.string();continue}case 5:{if(o!==40){break}i.sourcePosition=n.uint32();continue}case 6:{if(o!==48){break}i.destinationPosition=n.uint32();continue}case 7:{if(o!==58){break}i.parentTransitionId=n.string();continue}case 8:{if(o!==66){break}i.siblingTransitionId=n.string();continue}case 9:{if(o!==74){break}i.presentationId=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Yde.fromPartial(e??{})},fromPartial(e){const t=iRt();t.modelId=e.modelId??"";t.type=e.type??void 0;t.sourceId=e.sourceId??"";t.destinationId=e.destinationId??"";t.sourcePosition=e.sourcePosition??0;t.destinationPosition=e.destinationPosition??0;t.parentTransitionId=e.parentTransitionId??void 0;t.siblingTransitionId=e.siblingTransitionId??void 0;t.presentationId=e.presentationId??void 0;return t}};function oRt(){return{type:0,side:void 0}}var qde={encode(e,t=new tn){if(e.type!==0){t.uint32(8).int32(e.type)}if(e.side!==void 0){t.uint32(18).string(e.side)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=oRt();while(n.pos>>3){case 1:{if(o!==8){break}i.type=n.int32();continue}case 2:{if(o!==18){break}i.side=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return qde.fromPartial(e??{})},fromPartial(e){const t=oRt();t.type=e.type??0;t.side=e.side??void 0;return t}};function aRt(){return{type:0,anchorParagraphId:void 0,horizontalRelativeFrom:void 0,verticalRelativeFrom:void 0,xOffsetEmu:void 0,yOffsetEmu:void 0,horizontalAlignment:void 0,verticalAlignment:void 0,wrap:void 0,distanceTopEmu:void 0,distanceBottomEmu:void 0,distanceLeftEmu:void 0,distanceRightEmu:void 0,behindDocument:void 0,layoutInCell:void 0,allowOverlap:void 0,relativeHeight:void 0,locked:void 0}}var Xde={encode(e,t=new tn){if(e.type!==0){t.uint32(8).int32(e.type)}if(e.anchorParagraphId!==void 0){t.uint32(18).string(e.anchorParagraphId)}if(e.horizontalRelativeFrom!==void 0){t.uint32(26).string(e.horizontalRelativeFrom)}if(e.verticalRelativeFrom!==void 0){t.uint32(34).string(e.verticalRelativeFrom)}if(e.xOffsetEmu!==void 0){t.uint32(40).int64(e.xOffsetEmu)}if(e.yOffsetEmu!==void 0){t.uint32(48).int64(e.yOffsetEmu)}if(e.horizontalAlignment!==void 0){t.uint32(58).string(e.horizontalAlignment)}if(e.verticalAlignment!==void 0){t.uint32(66).string(e.verticalAlignment)}if(e.wrap!==void 0){qde.encode(e.wrap,t.uint32(74).fork()).join()}if(e.distanceTopEmu!==void 0){t.uint32(80).int64(e.distanceTopEmu)}if(e.distanceBottomEmu!==void 0){t.uint32(88).int64(e.distanceBottomEmu)}if(e.distanceLeftEmu!==void 0){t.uint32(96).int64(e.distanceLeftEmu)}if(e.distanceRightEmu!==void 0){t.uint32(104).int64(e.distanceRightEmu)}if(e.behindDocument!==void 0){t.uint32(112).bool(e.behindDocument)}if(e.layoutInCell!==void 0){t.uint32(120).bool(e.layoutInCell)}if(e.allowOverlap!==void 0){t.uint32(128).bool(e.allowOverlap)}if(e.relativeHeight!==void 0){t.uint32(136).uint32(e.relativeHeight)}if(e.locked!==void 0){t.uint32(144).bool(e.locked)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=aRt();while(n.pos>>3){case 1:{if(o!==8){break}i.type=n.int32();continue}case 2:{if(o!==18){break}i.anchorParagraphId=n.string();continue}case 3:{if(o!==26){break}i.horizontalRelativeFrom=n.string();continue}case 4:{if(o!==34){break}i.verticalRelativeFrom=n.string();continue}case 5:{if(o!==40){break}i.xOffsetEmu=hl(n.int64());continue}case 6:{if(o!==48){break}i.yOffsetEmu=hl(n.int64());continue}case 7:{if(o!==58){break}i.horizontalAlignment=n.string();continue}case 8:{if(o!==66){break}i.verticalAlignment=n.string();continue}case 9:{if(o!==74){break}i.wrap=qde.decode(n,n.uint32());continue}case 10:{if(o!==80){break}i.distanceTopEmu=hl(n.int64());continue}case 11:{if(o!==88){break}i.distanceBottomEmu=hl(n.int64());continue}case 12:{if(o!==96){break}i.distanceLeftEmu=hl(n.int64());continue}case 13:{if(o!==104){break}i.distanceRightEmu=hl(n.int64());continue}case 14:{if(o!==112){break}i.behindDocument=n.bool();continue}case 15:{if(o!==120){break}i.layoutInCell=n.bool();continue}case 16:{if(o!==128){break}i.allowOverlap=n.bool();continue}case 17:{if(o!==136){break}i.relativeHeight=n.uint32();continue}case 18:{if(o!==144){break}i.locked=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Xde.fromPartial(e??{})},fromPartial(e){const t=aRt();t.type=e.type??0;t.anchorParagraphId=e.anchorParagraphId??void 0;t.horizontalRelativeFrom=e.horizontalRelativeFrom??void 0;t.verticalRelativeFrom=e.verticalRelativeFrom??void 0;t.xOffsetEmu=e.xOffsetEmu??void 0;t.yOffsetEmu=e.yOffsetEmu??void 0;t.horizontalAlignment=e.horizontalAlignment??void 0;t.verticalAlignment=e.verticalAlignment??void 0;t.wrap=e.wrap!==void 0&&e.wrap!==null?qde.fromPartial(e.wrap):void 0;t.distanceTopEmu=e.distanceTopEmu??void 0;t.distanceBottomEmu=e.distanceBottomEmu??void 0;t.distanceLeftEmu=e.distanceLeftEmu??void 0;t.distanceRightEmu=e.distanceRightEmu??void 0;t.behindDocument=e.behindDocument??void 0;t.layoutInCell=e.layoutInCell??void 0;t.allowOverlap=e.allowOverlap??void 0;t.relativeHeight=e.relativeHeight??void 0;t.locked=e.locked??void 0;return t}};function sRt(){return{fromElementId:"",fromIdx:0,toElementId:"",toIdx:0,lineStyle:void 0}}var jde={encode(e,t=new tn){if(e.fromElementId!==""){t.uint32(10).string(e.fromElementId)}if(e.fromIdx!==0){t.uint32(16).int32(e.fromIdx)}if(e.toElementId!==""){t.uint32(26).string(e.toElementId)}if(e.toIdx!==0){t.uint32(32).int32(e.toIdx)}if(e.lineStyle!==void 0){Cfe.encode(e.lineStyle,t.uint32(42).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=sRt();while(n.pos>>3){case 1:{if(o!==10){break}i.fromElementId=n.string();continue}case 2:{if(o!==16){break}i.fromIdx=n.int32();continue}case 3:{if(o!==26){break}i.toElementId=n.string();continue}case 4:{if(o!==32){break}i.toIdx=n.int32();continue}case 5:{if(o!==42){break}i.lineStyle=Cfe.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return jde.fromPartial(e??{})},fromPartial(e){const t=sRt();t.fromElementId=e.fromElementId??"";t.fromIdx=e.fromIdx??0;t.toElementId=e.toElementId??"";t.toIdx=e.toIdx??0;t.lineStyle=e.lineStyle!==void 0&&e.lineStyle!==null?Cfe.fromPartial(e.lineStyle):void 0;return t}};function lRt(){return{rows:[],columnWidths:[],properties:void 0}}var Kde={encode(e,t=new tn){for(const n of e.rows){tfe.encode(n,t.uint32(10).fork()).join()}t.uint32(18).fork();for(const n of e.columnWidths){t.int32(n)}t.join();if(e.properties!==void 0){Y4.encode(e.properties,t.uint32(26).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=lRt();while(n.pos>>3){case 1:{if(o!==10){break}i.rows.push(tfe.decode(n,n.uint32()));continue}case 2:{if(o===16){i.columnWidths.push(n.int32());continue}if(o===18){const a=n.uint32()+n.pos;while(n.postfe.fromPartial(n))||[];t.columnWidths=e.columnWidths?.map(n=>n)||[];t.properties=e.properties!==void 0&&e.properties!==null?Y4.fromPartial(e.properties):void 0;return t}};function cRt(){return{fill:void 0,rightToLeft:void 0,firstRow:void 0,firstColumn:void 0,lastRow:void 0,lastColumn:void 0,bandedRows:void 0,bandedColumns:void 0,styleId:void 0,effects:[],styleXml:void 0,alignment:void 0,borders:void 0,cellMargins:void 0,keepTogether:void 0,fillReference:void 0,effectReference:void 0}}var Y4={encode(e,t=new tn){if(e.fill!==void 0){Ei.encode(e.fill,t.uint32(10).fork()).join()}if(e.rightToLeft!==void 0){t.uint32(16).bool(e.rightToLeft)}if(e.firstRow!==void 0){t.uint32(24).bool(e.firstRow)}if(e.firstColumn!==void 0){t.uint32(32).bool(e.firstColumn)}if(e.lastRow!==void 0){t.uint32(40).bool(e.lastRow)}if(e.lastColumn!==void 0){t.uint32(48).bool(e.lastColumn)}if(e.bandedRows!==void 0){t.uint32(56).bool(e.bandedRows)}if(e.bandedColumns!==void 0){t.uint32(64).bool(e.bandedColumns)}if(e.styleId!==void 0){t.uint32(74).string(e.styleId)}for(const n of e.effects){nE.encode(n,t.uint32(82).fork()).join()}if(e.styleXml!==void 0){t.uint32(90).string(e.styleXml)}if(e.alignment!==void 0){t.uint32(96).int32(e.alignment)}if(e.borders!==void 0){Zde.encode(e.borders,t.uint32(106).fork()).join()}if(e.cellMargins!==void 0){Qde.encode(e.cellMargins,t.uint32(114).fork()).join()}if(e.keepTogether!==void 0){t.uint32(120).bool(e.keepTogether)}if(e.fillReference!==void 0){wd.encode(e.fillReference,t.uint32(130).fork()).join()}if(e.effectReference!==void 0){wd.encode(e.effectReference,t.uint32(138).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=cRt();while(n.pos>>3){case 1:{if(o!==10){break}i.fill=Ei.decode(n,n.uint32());continue}case 2:{if(o!==16){break}i.rightToLeft=n.bool();continue}case 3:{if(o!==24){break}i.firstRow=n.bool();continue}case 4:{if(o!==32){break}i.firstColumn=n.bool();continue}case 5:{if(o!==40){break}i.lastRow=n.bool();continue}case 6:{if(o!==48){break}i.lastColumn=n.bool();continue}case 7:{if(o!==56){break}i.bandedRows=n.bool();continue}case 8:{if(o!==64){break}i.bandedColumns=n.bool();continue}case 9:{if(o!==74){break}i.styleId=n.string();continue}case 10:{if(o!==82){break}i.effects.push(nE.decode(n,n.uint32()));continue}case 11:{if(o!==90){break}i.styleXml=n.string();continue}case 12:{if(o!==96){break}i.alignment=n.int32();continue}case 13:{if(o!==106){break}i.borders=Zde.decode(n,n.uint32());continue}case 14:{if(o!==114){break}i.cellMargins=Qde.decode(n,n.uint32());continue}case 15:{if(o!==120){break}i.keepTogether=n.bool();continue}case 16:{if(o!==130){break}i.fillReference=wd.decode(n,n.uint32());continue}case 17:{if(o!==138){break}i.effectReference=wd.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Y4.fromPartial(e??{})},fromPartial(e){const t=cRt();t.fill=e.fill!==void 0&&e.fill!==null?Ei.fromPartial(e.fill):void 0;t.rightToLeft=e.rightToLeft??void 0;t.firstRow=e.firstRow??void 0;t.firstColumn=e.firstColumn??void 0;t.lastRow=e.lastRow??void 0;t.lastColumn=e.lastColumn??void 0;t.bandedRows=e.bandedRows??void 0;t.bandedColumns=e.bandedColumns??void 0;t.styleId=e.styleId??void 0;t.effects=e.effects?.map(n=>nE.fromPartial(n))||[];t.styleXml=e.styleXml??void 0;t.alignment=e.alignment??void 0;t.borders=e.borders!==void 0&&e.borders!==null?Zde.fromPartial(e.borders):void 0;t.cellMargins=e.cellMargins!==void 0&&e.cellMargins!==null?Qde.fromPartial(e.cellMargins):void 0;t.keepTogether=e.keepTogether??void 0;t.fillReference=e.fillReference!==void 0&&e.fillReference!==null?wd.fromPartial(e.fillReference):void 0;t.effectReference=e.effectReference!==void 0&&e.effectReference!==null?wd.fromPartial(e.effectReference):void 0;return t}};function uRt(){return{line:void 0,none:void 0,lineReference:void 0}}var Il={encode(e,t=new tn){if(e.line!==void 0){ui.encode(e.line,t.uint32(10).fork()).join()}if(e.none!==void 0){t.uint32(16).bool(e.none)}if(e.lineReference!==void 0){wd.encode(e.lineReference,t.uint32(26).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=uRt();while(n.pos>>3){case 1:{if(o!==10){break}i.line=ui.decode(n,n.uint32());continue}case 2:{if(o!==16){break}i.none=n.bool();continue}case 3:{if(o!==26){break}i.lineReference=wd.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Il.fromPartial(e??{})},fromPartial(e){const t=uRt();t.line=e.line!==void 0&&e.line!==null?ui.fromPartial(e.line):void 0;t.none=e.none??void 0;t.lineReference=e.lineReference!==void 0&&e.lineReference!==null?wd.fromPartial(e.lineReference):void 0;return t}};function dRt(){return{top:void 0,right:void 0,bottom:void 0,left:void 0,insideHorizontal:void 0,insideVertical:void 0}}var Zde={encode(e,t=new tn){if(e.top!==void 0){Il.encode(e.top,t.uint32(10).fork()).join()}if(e.right!==void 0){Il.encode(e.right,t.uint32(18).fork()).join()}if(e.bottom!==void 0){Il.encode(e.bottom,t.uint32(26).fork()).join()}if(e.left!==void 0){Il.encode(e.left,t.uint32(34).fork()).join()}if(e.insideHorizontal!==void 0){Il.encode(e.insideHorizontal,t.uint32(42).fork()).join()}if(e.insideVertical!==void 0){Il.encode(e.insideVertical,t.uint32(50).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=dRt();while(n.pos>>3){case 1:{if(o!==10){break}i.top=Il.decode(n,n.uint32());continue}case 2:{if(o!==18){break}i.right=Il.decode(n,n.uint32());continue}case 3:{if(o!==26){break}i.bottom=Il.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.left=Il.decode(n,n.uint32());continue}case 5:{if(o!==42){break}i.insideHorizontal=Il.decode(n,n.uint32());continue}case 6:{if(o!==50){break}i.insideVertical=Il.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Zde.fromPartial(e??{})},fromPartial(e){const t=dRt();t.top=e.top!==void 0&&e.top!==null?Il.fromPartial(e.top):void 0;t.right=e.right!==void 0&&e.right!==null?Il.fromPartial(e.right):void 0;t.bottom=e.bottom!==void 0&&e.bottom!==null?Il.fromPartial(e.bottom):void 0;t.left=e.left!==void 0&&e.left!==null?Il.fromPartial(e.left):void 0;t.insideHorizontal=e.insideHorizontal!==void 0&&e.insideHorizontal!==null?Il.fromPartial(e.insideHorizontal):void 0;t.insideVertical=e.insideVertical!==void 0&&e.insideVertical!==null?Il.fromPartial(e.insideVertical):void 0;return t}};function fRt(){return{top:void 0,right:void 0,bottom:void 0,left:void 0,diagonalDown:void 0,diagonalUp:void 0}}var Jde={encode(e,t=new tn){if(e.top!==void 0){Il.encode(e.top,t.uint32(10).fork()).join()}if(e.right!==void 0){Il.encode(e.right,t.uint32(18).fork()).join()}if(e.bottom!==void 0){Il.encode(e.bottom,t.uint32(26).fork()).join()}if(e.left!==void 0){Il.encode(e.left,t.uint32(34).fork()).join()}if(e.diagonalDown!==void 0){Il.encode(e.diagonalDown,t.uint32(42).fork()).join()}if(e.diagonalUp!==void 0){Il.encode(e.diagonalUp,t.uint32(50).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=fRt();while(n.pos>>3){case 1:{if(o!==10){break}i.top=Il.decode(n,n.uint32());continue}case 2:{if(o!==18){break}i.right=Il.decode(n,n.uint32());continue}case 3:{if(o!==26){break}i.bottom=Il.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.left=Il.decode(n,n.uint32());continue}case 5:{if(o!==42){break}i.diagonalDown=Il.decode(n,n.uint32());continue}case 6:{if(o!==50){break}i.diagonalUp=Il.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Jde.fromPartial(e??{})},fromPartial(e){const t=fRt();t.top=e.top!==void 0&&e.top!==null?Il.fromPartial(e.top):void 0;t.right=e.right!==void 0&&e.right!==null?Il.fromPartial(e.right):void 0;t.bottom=e.bottom!==void 0&&e.bottom!==null?Il.fromPartial(e.bottom):void 0;t.left=e.left!==void 0&&e.left!==null?Il.fromPartial(e.left):void 0;t.diagonalDown=e.diagonalDown!==void 0&&e.diagonalDown!==null?Il.fromPartial(e.diagonalDown):void 0;t.diagonalUp=e.diagonalUp!==void 0&&e.diagonalUp!==null?Il.fromPartial(e.diagonalUp):void 0;return t}};function hRt(){return{left:void 0,right:void 0,top:void 0,bottom:void 0}}var Qde={encode(e,t=new tn){if(e.left!==void 0){t.uint32(8).int32(e.left)}if(e.right!==void 0){t.uint32(16).int32(e.right)}if(e.top!==void 0){t.uint32(24).int32(e.top)}if(e.bottom!==void 0){t.uint32(32).int32(e.bottom)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=hRt();while(n.pos>>3){case 1:{if(o!==8){break}i.left=n.int32();continue}case 2:{if(o!==16){break}i.right=n.int32();continue}case 3:{if(o!==24){break}i.top=n.int32();continue}case 4:{if(o!==32){break}i.bottom=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Qde.fromPartial(e??{})},fromPartial(e){const t=hRt();t.left=e.left??void 0;t.right=e.right??void 0;t.top=e.top??void 0;t.bottom=e.bottom??void 0;return t}};function pRt(){return{id:void 0,text:"",textStyle:void 0,paragraphs:[],levelsStyles:[],fill:void 0,lines:void 0,gridSpan:void 0,rowSpan:void 0,horizontalMerge:void 0,verticalMerge:void 0,textDirection:void 0,marginLeft:void 0,marginRight:void 0,marginTop:void 0,marginBottom:void 0,anchor:void 0,anchorCenter:void 0,horizontalOverflow:void 0,elements:[]}}var efe={encode(e,t=new tn){if(e.id!==void 0){t.uint32(58).string(e.id)}if(e.text!==""){t.uint32(10).string(e.text)}if(e.textStyle!==void 0){Gi.encode(e.textStyle,t.uint32(18).fork()).join()}for(const n of e.paragraphs){jd.encode(n,t.uint32(26).fork()).join()}for(const n of e.levelsStyles){Lh.encode(n,t.uint32(34).fork()).join()}if(e.fill!==void 0){Ei.encode(e.fill,t.uint32(42).fork()).join()}if(e.lines!==void 0){q4.encode(e.lines,t.uint32(50).fork()).join()}if(e.gridSpan!==void 0){t.uint32(64).int32(e.gridSpan)}if(e.rowSpan!==void 0){t.uint32(72).int32(e.rowSpan)}if(e.horizontalMerge!==void 0){t.uint32(80).bool(e.horizontalMerge)}if(e.verticalMerge!==void 0){t.uint32(88).bool(e.verticalMerge)}if(e.textDirection!==void 0){t.uint32(98).string(e.textDirection)}if(e.marginLeft!==void 0){t.uint32(104).int32(e.marginLeft)}if(e.marginRight!==void 0){t.uint32(112).int32(e.marginRight)}if(e.marginTop!==void 0){t.uint32(120).int32(e.marginTop)}if(e.marginBottom!==void 0){t.uint32(128).int32(e.marginBottom)}if(e.anchor!==void 0){t.uint32(138).string(e.anchor)}if(e.anchorCenter!==void 0){t.uint32(144).bool(e.anchorCenter)}if(e.horizontalOverflow!==void 0){t.uint32(154).string(e.horizontalOverflow)}for(const n of e.elements){fl.encode(n,t.uint32(162).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=pRt();while(n.pos>>3){case 7:{if(o!==58){break}i.id=n.string();continue}case 1:{if(o!==10){break}i.text=n.string();continue}case 2:{if(o!==18){break}i.textStyle=Gi.decode(n,n.uint32());continue}case 3:{if(o!==26){break}i.paragraphs.push(jd.decode(n,n.uint32()));continue}case 4:{if(o!==34){break}i.levelsStyles.push(Lh.decode(n,n.uint32()));continue}case 5:{if(o!==42){break}i.fill=Ei.decode(n,n.uint32());continue}case 6:{if(o!==50){break}i.lines=q4.decode(n,n.uint32());continue}case 8:{if(o!==64){break}i.gridSpan=n.int32();continue}case 9:{if(o!==72){break}i.rowSpan=n.int32();continue}case 10:{if(o!==80){break}i.horizontalMerge=n.bool();continue}case 11:{if(o!==88){break}i.verticalMerge=n.bool();continue}case 12:{if(o!==98){break}i.textDirection=n.string();continue}case 13:{if(o!==104){break}i.marginLeft=n.int32();continue}case 14:{if(o!==112){break}i.marginRight=n.int32();continue}case 15:{if(o!==120){break}i.marginTop=n.int32();continue}case 16:{if(o!==128){break}i.marginBottom=n.int32();continue}case 17:{if(o!==138){break}i.anchor=n.string();continue}case 18:{if(o!==144){break}i.anchorCenter=n.bool();continue}case 19:{if(o!==154){break}i.horizontalOverflow=n.string();continue}case 20:{if(o!==162){break}i.elements.push(fl.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return efe.fromPartial(e??{})},fromPartial(e){const t=pRt();t.id=e.id??void 0;t.text=e.text??"";t.textStyle=e.textStyle!==void 0&&e.textStyle!==null?Gi.fromPartial(e.textStyle):void 0;t.paragraphs=e.paragraphs?.map(n=>jd.fromPartial(n))||[];t.levelsStyles=e.levelsStyles?.map(n=>Lh.fromPartial(n))||[];t.fill=e.fill!==void 0&&e.fill!==null?Ei.fromPartial(e.fill):void 0;t.lines=e.lines!==void 0&&e.lines!==null?q4.fromPartial(e.lines):void 0;t.gridSpan=e.gridSpan??void 0;t.rowSpan=e.rowSpan??void 0;t.horizontalMerge=e.horizontalMerge??void 0;t.verticalMerge=e.verticalMerge??void 0;t.textDirection=e.textDirection??void 0;t.marginLeft=e.marginLeft??void 0;t.marginRight=e.marginRight??void 0;t.marginTop=e.marginTop??void 0;t.marginBottom=e.marginBottom??void 0;t.anchor=e.anchor??void 0;t.anchorCenter=e.anchorCenter??void 0;t.horizontalOverflow=e.horizontalOverflow??void 0;t.elements=e.elements?.map(n=>fl.fromPartial(n))||[];return t}};function mRt(){return{top:void 0,right:void 0,bottom:void 0,left:void 0,diagonalDown:void 0,diagonalUp:void 0}}var q4={encode(e,t=new tn){if(e.top!==void 0){ui.encode(e.top,t.uint32(10).fork()).join()}if(e.right!==void 0){ui.encode(e.right,t.uint32(18).fork()).join()}if(e.bottom!==void 0){ui.encode(e.bottom,t.uint32(26).fork()).join()}if(e.left!==void 0){ui.encode(e.left,t.uint32(34).fork()).join()}if(e.diagonalDown!==void 0){ui.encode(e.diagonalDown,t.uint32(42).fork()).join()}if(e.diagonalUp!==void 0){ui.encode(e.diagonalUp,t.uint32(50).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=mRt();while(n.pos>>3){case 1:{if(o!==10){break}i.top=ui.decode(n,n.uint32());continue}case 2:{if(o!==18){break}i.right=ui.decode(n,n.uint32());continue}case 3:{if(o!==26){break}i.bottom=ui.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.left=ui.decode(n,n.uint32());continue}case 5:{if(o!==42){break}i.diagonalDown=ui.decode(n,n.uint32());continue}case 6:{if(o!==50){break}i.diagonalUp=ui.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return q4.fromPartial(e??{})},fromPartial(e){const t=mRt();t.top=e.top!==void 0&&e.top!==null?ui.fromPartial(e.top):void 0;t.right=e.right!==void 0&&e.right!==null?ui.fromPartial(e.right):void 0;t.bottom=e.bottom!==void 0&&e.bottom!==null?ui.fromPartial(e.bottom):void 0;t.left=e.left!==void 0&&e.left!==null?ui.fromPartial(e.left):void 0;t.diagonalDown=e.diagonalDown!==void 0&&e.diagonalDown!==null?ui.fromPartial(e.diagonalDown):void 0;t.diagonalUp=e.diagonalUp!==void 0&&e.diagonalUp!==null?ui.fromPartial(e.diagonalUp):void 0;return t}};function gRt(){return{id:void 0,cells:[],heightEmu:void 0}}var tfe={encode(e,t=new tn){if(e.id!==void 0){t.uint32(26).string(e.id)}for(const n of e.cells){efe.encode(n,t.uint32(10).fork()).join()}if(e.heightEmu!==void 0){t.uint32(16).int32(e.heightEmu)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=gRt();while(n.pos>>3){case 3:{if(o!==26){break}i.id=n.string();continue}case 1:{if(o!==10){break}i.cells.push(efe.decode(n,n.uint32()));continue}case 2:{if(o!==16){break}i.heightEmu=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return tfe.fromPartial(e??{})},fromPartial(e){const t=gRt();t.id=e.id??void 0;t.cells=e.cells?.map(n=>efe.fromPartial(n))||[];t.heightEmu=e.heightEmu??void 0;return t}};function yRt(){return{textStyle:void 0,paragraphStyle:void 0,fill:void 0,lines:void 0,marginLeft:void 0,marginRight:void 0,marginTop:void 0,marginBottom:void 0,anchor:void 0,textDirection:void 0,borders:void 0,fillReference:void 0}}var nfe={encode(e,t=new tn){if(e.textStyle!==void 0){Gi.encode(e.textStyle,t.uint32(10).fork()).join()}if(e.paragraphStyle!==void 0){Xd.encode(e.paragraphStyle,t.uint32(18).fork()).join()}if(e.fill!==void 0){Ei.encode(e.fill,t.uint32(26).fork()).join()}if(e.lines!==void 0){q4.encode(e.lines,t.uint32(34).fork()).join()}if(e.marginLeft!==void 0){t.uint32(40).int32(e.marginLeft)}if(e.marginRight!==void 0){t.uint32(48).int32(e.marginRight)}if(e.marginTop!==void 0){t.uint32(56).int32(e.marginTop)}if(e.marginBottom!==void 0){t.uint32(64).int32(e.marginBottom)}if(e.anchor!==void 0){t.uint32(74).string(e.anchor)}if(e.textDirection!==void 0){t.uint32(82).string(e.textDirection)}if(e.borders!==void 0){Jde.encode(e.borders,t.uint32(90).fork()).join()}if(e.fillReference!==void 0){wd.encode(e.fillReference,t.uint32(98).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=yRt();while(n.pos>>3){case 1:{if(o!==10){break}i.textStyle=Gi.decode(n,n.uint32());continue}case 2:{if(o!==18){break}i.paragraphStyle=Xd.decode(n,n.uint32());continue}case 3:{if(o!==26){break}i.fill=Ei.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.lines=q4.decode(n,n.uint32());continue}case 5:{if(o!==40){break}i.marginLeft=n.int32();continue}case 6:{if(o!==48){break}i.marginRight=n.int32();continue}case 7:{if(o!==56){break}i.marginTop=n.int32();continue}case 8:{if(o!==64){break}i.marginBottom=n.int32();continue}case 9:{if(o!==74){break}i.anchor=n.string();continue}case 10:{if(o!==82){break}i.textDirection=n.string();continue}case 11:{if(o!==90){break}i.borders=Jde.decode(n,n.uint32());continue}case 12:{if(o!==98){break}i.fillReference=wd.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return nfe.fromPartial(e??{})},fromPartial(e){const t=yRt();t.textStyle=e.textStyle!==void 0&&e.textStyle!==null?Gi.fromPartial(e.textStyle):void 0;t.paragraphStyle=e.paragraphStyle!==void 0&&e.paragraphStyle!==null?Xd.fromPartial(e.paragraphStyle):void 0;t.fill=e.fill!==void 0&&e.fill!==null?Ei.fromPartial(e.fill):void 0;t.lines=e.lines!==void 0&&e.lines!==null?q4.fromPartial(e.lines):void 0;t.marginLeft=e.marginLeft??void 0;t.marginRight=e.marginRight??void 0;t.marginTop=e.marginTop??void 0;t.marginBottom=e.marginBottom??void 0;t.anchor=e.anchor??void 0;t.textDirection=e.textDirection??void 0;t.borders=e.borders!==void 0&&e.borders!==null?Jde.fromPartial(e.borders):void 0;t.fillReference=e.fillReference!==void 0&&e.fillReference!==null?wd.fromPartial(e.fillReference):void 0;return t}};function bRt(){return{tableProperties:void 0,cellStyle:void 0,textStyle:void 0,paragraphStyle:void 0,spaceBefore:void 0,spaceAfter:void 0}}var X4={encode(e,t=new tn){if(e.tableProperties!==void 0){Y4.encode(e.tableProperties,t.uint32(10).fork()).join()}if(e.cellStyle!==void 0){nfe.encode(e.cellStyle,t.uint32(18).fork()).join()}if(e.textStyle!==void 0){Gi.encode(e.textStyle,t.uint32(26).fork()).join()}if(e.paragraphStyle!==void 0){Xd.encode(e.paragraphStyle,t.uint32(34).fork()).join()}if(e.spaceBefore!==void 0){t.uint32(40).int32(e.spaceBefore)}if(e.spaceAfter!==void 0){t.uint32(48).int32(e.spaceAfter)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=bRt();while(n.pos>>3){case 1:{if(o!==10){break}i.tableProperties=Y4.decode(n,n.uint32());continue}case 2:{if(o!==18){break}i.cellStyle=nfe.decode(n,n.uint32());continue}case 3:{if(o!==26){break}i.textStyle=Gi.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.paragraphStyle=Xd.decode(n,n.uint32());continue}case 5:{if(o!==40){break}i.spaceBefore=n.int32();continue}case 6:{if(o!==48){break}i.spaceAfter=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return X4.fromPartial(e??{})},fromPartial(e){const t=bRt();t.tableProperties=e.tableProperties!==void 0&&e.tableProperties!==null?Y4.fromPartial(e.tableProperties):void 0;t.cellStyle=e.cellStyle!==void 0&&e.cellStyle!==null?nfe.fromPartial(e.cellStyle):void 0;t.textStyle=e.textStyle!==void 0&&e.textStyle!==null?Gi.fromPartial(e.textStyle):void 0;t.paragraphStyle=e.paragraphStyle!==void 0&&e.paragraphStyle!==null?Xd.fromPartial(e.paragraphStyle):void 0;t.spaceBefore=e.spaceBefore??void 0;t.spaceAfter=e.spaceAfter??void 0;return t}};function xRt(){return{condition:0,style:void 0}}var rfe={encode(e,t=new tn){if(e.condition!==0){t.uint32(8).int32(e.condition)}if(e.style!==void 0){X4.encode(e.style,t.uint32(18).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=xRt();while(n.pos>>3){case 1:{if(o!==8){break}i.condition=n.int32();continue}case 2:{if(o!==18){break}i.style=X4.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return rfe.fromPartial(e??{})},fromPartial(e){const t=xRt();t.condition=e.condition??0;t.style=e.style!==void 0&&e.style!==null?X4.fromPartial(e.style):void 0;return t}};function vRt(){return{id:"",name:"",basedOn:void 0,wholeTable:void 0,conditionalStyles:[]}}var zI={encode(e,t=new tn){if(e.id!==""){t.uint32(10).string(e.id)}if(e.name!==""){t.uint32(18).string(e.name)}if(e.basedOn!==void 0){t.uint32(26).string(e.basedOn)}if(e.wholeTable!==void 0){X4.encode(e.wholeTable,t.uint32(34).fork()).join()}for(const n of e.conditionalStyles){rfe.encode(n,t.uint32(42).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=vRt();while(n.pos>>3){case 1:{if(o!==10){break}i.id=n.string();continue}case 2:{if(o!==18){break}i.name=n.string();continue}case 3:{if(o!==26){break}i.basedOn=n.string();continue}case 4:{if(o!==34){break}i.wholeTable=X4.decode(n,n.uint32());continue}case 5:{if(o!==42){break}i.conditionalStyles.push(rfe.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return zI.fromPartial(e??{})},fromPartial(e){const t=vRt();t.id=e.id??"";t.name=e.name??"";t.basedOn=e.basedOn??void 0;t.wholeTable=e.wholeTable!==void 0&&e.wholeTable!==null?X4.fromPartial(e.wholeTable):void 0;t.conditionalStyles=e.conditionalStyles?.map(n=>rfe.fromPartial(n))||[];return t}};function _Rt(){return{id:void 0,runs:[],textStyle:void 0,bulletCharacter:void 0,marginLeft:void 0,indent:void 0,spaceAfter:void 0,spaceBefore:void 0,styleId:void 0,paragraphStyle:void 0,docxSectionBreakCarrier:void 0,inlineNodes:[],level:void 0,endParagraphTextStyle:void 0}}var jd={encode(e,t=new tn){if(e.id!==void 0){t.uint32(74).string(e.id)}for(const n of e.runs){j4.encode(n,t.uint32(10).fork()).join()}if(e.textStyle!==void 0){Gi.encode(e.textStyle,t.uint32(18).fork()).join()}if(e.bulletCharacter!==void 0){t.uint32(26).string(e.bulletCharacter)}if(e.marginLeft!==void 0){t.uint32(32).int32(e.marginLeft)}if(e.indent!==void 0){t.uint32(40).int32(e.indent)}if(e.spaceAfter!==void 0){t.uint32(48).int32(e.spaceAfter)}if(e.spaceBefore!==void 0){t.uint32(56).int32(e.spaceBefore)}if(e.styleId!==void 0){t.uint32(66).string(e.styleId)}if(e.paragraphStyle!==void 0){Xd.encode(e.paragraphStyle,t.uint32(82).fork()).join()}if(e.docxSectionBreakCarrier!==void 0){t.uint32(88).bool(e.docxSectionBreakCarrier)}for(const n of e.inlineNodes){ife.encode(n,t.uint32(98).fork()).join()}if(e.level!==void 0){t.uint32(104).int32(e.level)}if(e.endParagraphTextStyle!==void 0){Gi.encode(e.endParagraphTextStyle,t.uint32(114).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=_Rt();while(n.pos>>3){case 9:{if(o!==74){break}i.id=n.string();continue}case 1:{if(o!==10){break}i.runs.push(j4.decode(n,n.uint32()));continue}case 2:{if(o!==18){break}i.textStyle=Gi.decode(n,n.uint32());continue}case 3:{if(o!==26){break}i.bulletCharacter=n.string();continue}case 4:{if(o!==32){break}i.marginLeft=n.int32();continue}case 5:{if(o!==40){break}i.indent=n.int32();continue}case 6:{if(o!==48){break}i.spaceAfter=n.int32();continue}case 7:{if(o!==56){break}i.spaceBefore=n.int32();continue}case 8:{if(o!==66){break}i.styleId=n.string();continue}case 10:{if(o!==82){break}i.paragraphStyle=Xd.decode(n,n.uint32());continue}case 11:{if(o!==88){break}i.docxSectionBreakCarrier=n.bool();continue}case 12:{if(o!==98){break}i.inlineNodes.push(ife.decode(n,n.uint32()));continue}case 13:{if(o!==104){break}i.level=n.int32();continue}case 14:{if(o!==114){break}i.endParagraphTextStyle=Gi.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return jd.fromPartial(e??{})},fromPartial(e){const t=_Rt();t.id=e.id??void 0;t.runs=e.runs?.map(n=>j4.fromPartial(n))||[];t.textStyle=e.textStyle!==void 0&&e.textStyle!==null?Gi.fromPartial(e.textStyle):void 0;t.bulletCharacter=e.bulletCharacter??void 0;t.marginLeft=e.marginLeft??void 0;t.indent=e.indent??void 0;t.spaceAfter=e.spaceAfter??void 0;t.spaceBefore=e.spaceBefore??void 0;t.styleId=e.styleId??void 0;t.paragraphStyle=e.paragraphStyle!==void 0&&e.paragraphStyle!==null?Xd.fromPartial(e.paragraphStyle):void 0;t.docxSectionBreakCarrier=e.docxSectionBreakCarrier??void 0;t.inlineNodes=e.inlineNodes?.map(n=>ife.fromPartial(n))||[];t.level=e.level??void 0;t.endParagraphTextStyle=e.endParagraphTextStyle!==void 0&&e.endParagraphTextStyle!==null?Gi.fromPartial(e.endParagraphTextStyle):void 0;return t}};function TRt(){return{textRun:void 0,math:void 0}}var ife={encode(e,t=new tn){if(e.textRun!==void 0){j4.encode(e.textRun,t.uint32(10).fork()).join()}if(e.math!==void 0){xX.encode(e.math,t.uint32(18).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=TRt();while(n.pos>>3){case 1:{if(o!==10){break}i.textRun=j4.decode(n,n.uint32());continue}case 2:{if(o!==18){break}i.math=xX.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return ife.fromPartial(e??{})},fromPartial(e){const t=TRt();t.textRun=e.textRun!==void 0&&e.textRun!==null?j4.fromPartial(e.textRun):void 0;t.math=e.math!==void 0&&e.math!==null?xX.fromPartial(e.math):void 0;return t}};function wRt(){return{id:void 0,text:"",textStyle:void 0,hyperlink:void 0,citations:[],reviewMarkIds:[],styleId:void 0,fieldType:void 0}}var j4={encode(e,t=new tn){if(e.id!==void 0){t.uint32(34).string(e.id)}if(e.text!==""){t.uint32(10).string(e.text)}if(e.textStyle!==void 0){Gi.encode(e.textStyle,t.uint32(18).fork()).join()}if(e.hyperlink!==void 0){ET.encode(e.hyperlink,t.uint32(26).fork()).join()}for(const n of e.citations){t.uint32(42).string(n)}for(const n of e.reviewMarkIds){t.uint32(50).string(n)}if(e.styleId!==void 0){t.uint32(58).string(e.styleId)}if(e.fieldType!==void 0){t.uint32(66).string(e.fieldType)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=wRt();while(n.pos>>3){case 4:{if(o!==34){break}i.id=n.string();continue}case 1:{if(o!==10){break}i.text=n.string();continue}case 2:{if(o!==18){break}i.textStyle=Gi.decode(n,n.uint32());continue}case 3:{if(o!==26){break}i.hyperlink=ET.decode(n,n.uint32());continue}case 5:{if(o!==42){break}i.citations.push(n.string());continue}case 6:{if(o!==50){break}i.reviewMarkIds.push(n.string());continue}case 7:{if(o!==58){break}i.styleId=n.string();continue}case 8:{if(o!==66){break}i.fieldType=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return j4.fromPartial(e??{})},fromPartial(e){const t=wRt();t.id=e.id??void 0;t.text=e.text??"";t.textStyle=e.textStyle!==void 0&&e.textStyle!==null?Gi.fromPartial(e.textStyle):void 0;t.hyperlink=e.hyperlink!==void 0&&e.hyperlink!==null?ET.fromPartial(e.hyperlink):void 0;t.citations=e.citations?.map(n=>n)||[];t.reviewMarkIds=e.reviewMarkIds?.map(n=>n)||[];t.styleId=e.styleId??void 0;t.fieldType=e.fieldType??void 0;return t}};function ERt(){return{uri:"",isExternal:false,action:""}}var ET={encode(e,t=new tn){if(e.uri!==""){t.uint32(10).string(e.uri)}if(e.isExternal!==false){t.uint32(16).bool(e.isExternal)}if(e.action!==""){t.uint32(26).string(e.action)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=ERt();while(n.pos>>3){case 1:{if(o!==10){break}i.uri=n.string();continue}case 2:{if(o!==16){break}i.isExternal=n.bool();continue}case 3:{if(o!==26){break}i.action=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return ET.fromPartial(e??{})},fromPartial(e){const t=ERt();t.uri=e.uri??"";t.isExternal=e.isExternal??false;t.action=e.action??"";return t}};function CRt(){return{effects:[]}}var ofe={encode(e,t=new tn){for(const n of e.effects){nE.encode(n,t.uint32(10).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=CRt();while(n.pos>>3){case 1:{if(o!==10){break}i.effects.push(nE.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return ofe.fromPartial(e??{})},fromPartial(e){const t=CRt();t.effects=e.effects?.map(n=>nE.fromPartial(n))||[];return t}};function SRt(){return{type:0,shadow:void 0,glow:void 0,reflection:void 0,softEdges:void 0}}var nE={encode(e,t=new tn){if(e.type!==0){t.uint32(8).int32(e.type)}if(e.shadow!==void 0){DA.encode(e.shadow,t.uint32(18).fork()).join()}if(e.glow!==void 0){afe.encode(e.glow,t.uint32(26).fork()).join()}if(e.reflection!==void 0){lfe.encode(e.reflection,t.uint32(34).fork()).join()}if(e.softEdges!==void 0){sfe.encode(e.softEdges,t.uint32(42).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=SRt();while(n.pos>>3){case 1:{if(o!==8){break}i.type=n.int32();continue}case 2:{if(o!==18){break}i.shadow=DA.decode(n,n.uint32());continue}case 3:{if(o!==26){break}i.glow=afe.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.reflection=lfe.decode(n,n.uint32());continue}case 5:{if(o!==42){break}i.softEdges=sfe.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return nE.fromPartial(e??{})},fromPartial(e){const t=SRt();t.type=e.type??0;t.shadow=e.shadow!==void 0&&e.shadow!==null?DA.fromPartial(e.shadow):void 0;t.glow=e.glow!==void 0&&e.glow!==null?afe.fromPartial(e.glow):void 0;t.reflection=e.reflection!==void 0&&e.reflection!==null?lfe.fromPartial(e.reflection):void 0;t.softEdges=e.softEdges!==void 0&&e.softEdges!==null?sfe.fromPartial(e.softEdges):void 0;return t}};function ARt(){return{color:void 0,radiusEmu:void 0}}var afe={encode(e,t=new tn){if(e.color!==void 0){hi.encode(e.color,t.uint32(10).fork()).join()}if(e.radiusEmu!==void 0){t.uint32(16).int64(e.radiusEmu)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=ARt();while(n.pos>>3){case 1:{if(o!==10){break}i.color=hi.decode(n,n.uint32());continue}case 2:{if(o!==16){break}i.radiusEmu=hl(n.int64());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return afe.fromPartial(e??{})},fromPartial(e){const t=ARt();t.color=e.color!==void 0&&e.color!==null?hi.fromPartial(e.color):void 0;t.radiusEmu=e.radiusEmu??void 0;return t}};function kRt(){return{radiusEmu:void 0}}var sfe={encode(e,t=new tn){if(e.radiusEmu!==void 0){t.uint32(8).int64(e.radiusEmu)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=kRt();while(n.pos>>3){case 1:{if(o!==8){break}i.radiusEmu=hl(n.int64());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return sfe.fromPartial(e??{})},fromPartial(e){const t=kRt();t.radiusEmu=e.radiusEmu??void 0;return t}};function RRt(){return{blurRadiusEmu:void 0,startAlpha:void 0,startPosition:void 0,endAlpha:void 0,endPosition:void 0,distanceEmu:void 0,direction:void 0,fadeDirection:void 0,horizontalScale:void 0,verticalScale:void 0,horizontalSkew:void 0,verticalSkew:void 0,alignment:void 0,rotateWithShape:void 0,alignmentType:void 0}}var lfe={encode(e,t=new tn){if(e.blurRadiusEmu!==void 0){t.uint32(8).int64(e.blurRadiusEmu)}if(e.startAlpha!==void 0){t.uint32(16).int32(e.startAlpha)}if(e.startPosition!==void 0){t.uint32(24).int32(e.startPosition)}if(e.endAlpha!==void 0){t.uint32(32).int32(e.endAlpha)}if(e.endPosition!==void 0){t.uint32(40).int32(e.endPosition)}if(e.distanceEmu!==void 0){t.uint32(48).int64(e.distanceEmu)}if(e.direction!==void 0){t.uint32(56).int32(e.direction)}if(e.fadeDirection!==void 0){t.uint32(64).int32(e.fadeDirection)}if(e.horizontalScale!==void 0){t.uint32(72).int32(e.horizontalScale)}if(e.verticalScale!==void 0){t.uint32(80).int32(e.verticalScale)}if(e.horizontalSkew!==void 0){t.uint32(88).int32(e.horizontalSkew)}if(e.verticalSkew!==void 0){t.uint32(96).int32(e.verticalSkew)}if(e.alignment!==void 0){t.uint32(106).string(e.alignment)}if(e.rotateWithShape!==void 0){t.uint32(112).bool(e.rotateWithShape)}if(e.alignmentType!==void 0){t.uint32(120).int32(e.alignmentType)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=RRt();while(n.pos>>3){case 1:{if(o!==8){break}i.blurRadiusEmu=hl(n.int64());continue}case 2:{if(o!==16){break}i.startAlpha=n.int32();continue}case 3:{if(o!==24){break}i.startPosition=n.int32();continue}case 4:{if(o!==32){break}i.endAlpha=n.int32();continue}case 5:{if(o!==40){break}i.endPosition=n.int32();continue}case 6:{if(o!==48){break}i.distanceEmu=hl(n.int64());continue}case 7:{if(o!==56){break}i.direction=n.int32();continue}case 8:{if(o!==64){break}i.fadeDirection=n.int32();continue}case 9:{if(o!==72){break}i.horizontalScale=n.int32();continue}case 10:{if(o!==80){break}i.verticalScale=n.int32();continue}case 11:{if(o!==88){break}i.horizontalSkew=n.int32();continue}case 12:{if(o!==96){break}i.verticalSkew=n.int32();continue}case 13:{if(o!==106){break}i.alignment=n.string();continue}case 14:{if(o!==112){break}i.rotateWithShape=n.bool();continue}case 15:{if(o!==120){break}i.alignmentType=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return lfe.fromPartial(e??{})},fromPartial(e){const t=RRt();t.blurRadiusEmu=e.blurRadiusEmu??void 0;t.startAlpha=e.startAlpha??void 0;t.startPosition=e.startPosition??void 0;t.endAlpha=e.endAlpha??void 0;t.endPosition=e.endPosition??void 0;t.distanceEmu=e.distanceEmu??void 0;t.direction=e.direction??void 0;t.fadeDirection=e.fadeDirection??void 0;t.horizontalScale=e.horizontalScale??void 0;t.verticalScale=e.verticalScale??void 0;t.horizontalSkew=e.horizontalSkew??void 0;t.verticalSkew=e.verticalSkew??void 0;t.alignment=e.alignment??void 0;t.rotateWithShape=e.rotateWithShape??void 0;t.alignmentType=e.alignmentType??void 0;return t}};function PRt(){return{geometry:0,fill:void 0,line:void 0,adjustmentList:[],rectFormula:void 0,customPaths:[],customGeometryGuides:[]}}var cfe={encode(e,t=new tn){if(e.geometry!==0){t.uint32(8).int32(e.geometry)}if(e.fill!==void 0){Ei.encode(e.fill,t.uint32(42).fork()).join()}if(e.line!==void 0){ui.encode(e.line,t.uint32(50).fork()).join()}for(const n of e.adjustmentList){Q2.encode(n,t.uint32(58).fork()).join()}if(e.rectFormula!==void 0){ffe.encode(e.rectFormula,t.uint32(66).fork()).join()}for(const n of e.customPaths){vfe.encode(n,t.uint32(74).fork()).join()}for(const n of e.customGeometryGuides){Q2.encode(n,t.uint32(82).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=PRt();while(n.pos>>3){case 1:{if(o!==8){break}i.geometry=n.int32();continue}case 5:{if(o!==42){break}i.fill=Ei.decode(n,n.uint32());continue}case 6:{if(o!==50){break}i.line=ui.decode(n,n.uint32());continue}case 7:{if(o!==58){break}i.adjustmentList.push(Q2.decode(n,n.uint32()));continue}case 8:{if(o!==66){break}i.rectFormula=ffe.decode(n,n.uint32());continue}case 9:{if(o!==74){break}i.customPaths.push(vfe.decode(n,n.uint32()));continue}case 10:{if(o!==82){break}i.customGeometryGuides.push(Q2.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return cfe.fromPartial(e??{})},fromPartial(e){const t=PRt();t.geometry=e.geometry??0;t.fill=e.fill!==void 0&&e.fill!==null?Ei.fromPartial(e.fill):void 0;t.line=e.line!==void 0&&e.line!==null?ui.fromPartial(e.line):void 0;t.adjustmentList=e.adjustmentList?.map(n=>Q2.fromPartial(n))||[];t.rectFormula=e.rectFormula!==void 0&&e.rectFormula!==null?ffe.fromPartial(e.rectFormula):void 0;t.customPaths=e.customPaths?.map(n=>vfe.fromPartial(n))||[];t.customGeometryGuides=e.customGeometryGuides?.map(n=>Q2.fromPartial(n))||[];return t}};function IRt(){return{name:"",formula:""}}var Q2={encode(e,t=new tn){if(e.name!==""){t.uint32(10).string(e.name)}if(e.formula!==""){t.uint32(18).string(e.formula)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=IRt();while(n.pos>>3){case 1:{if(o!==10){break}i.name=n.string();continue}case 2:{if(o!==18){break}i.formula=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Q2.fromPartial(e??{})},fromPartial(e){const t=IRt();t.name=e.name??"";t.formula=e.formula??"";return t}};function MRt(){return{geometry:"",cropLeft:0,cropTop:0,cropRight:0,cropBottom:0,adjustmentList:[]}}var rE={encode(e,t=new tn){if(e.geometry!==""){t.uint32(10).string(e.geometry)}if(e.cropLeft!==0){t.uint32(16).uint32(e.cropLeft)}if(e.cropTop!==0){t.uint32(24).uint32(e.cropTop)}if(e.cropRight!==0){t.uint32(32).uint32(e.cropRight)}if(e.cropBottom!==0){t.uint32(40).uint32(e.cropBottom)}for(const n of e.adjustmentList){Q2.encode(n,t.uint32(50).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=MRt();while(n.pos>>3){case 1:{if(o!==10){break}i.geometry=n.string();continue}case 2:{if(o!==16){break}i.cropLeft=n.uint32();continue}case 3:{if(o!==24){break}i.cropTop=n.uint32();continue}case 4:{if(o!==32){break}i.cropRight=n.uint32();continue}case 5:{if(o!==40){break}i.cropBottom=n.uint32();continue}case 6:{if(o!==50){break}i.adjustmentList.push(Q2.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return rE.fromPartial(e??{})},fromPartial(e){const t=MRt();t.geometry=e.geometry??"";t.cropLeft=e.cropLeft??0;t.cropTop=e.cropTop??0;t.cropRight=e.cropRight??0;t.cropBottom=e.cropBottom??0;t.adjustmentList=e.adjustmentList?.map(n=>Q2.fromPartial(n))||[];return t}};function LRt(){return{contentType:"",data:new Uint8Array(0),mask:void 0,alt:""}}var ufe={encode(e,t=new tn){if(e.contentType!==""){t.uint32(10).string(e.contentType)}if(e.data.length!==0){t.uint32(18).bytes(e.data)}if(e.mask!==void 0){rE.encode(e.mask,t.uint32(26).fork()).join()}if(e.alt!==""){t.uint32(34).string(e.alt)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=LRt();while(n.pos>>3){case 1:{if(o!==10){break}i.contentType=n.string();continue}case 2:{if(o!==18){break}i.data=n.bytes();continue}case 3:{if(o!==26){break}i.mask=rE.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.alt=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return ufe.fromPartial(e??{})},fromPartial(e){const t=LRt();t.contentType=e.contentType??"";t.data=e.data??new Uint8Array(0);t.mask=e.mask!==void 0&&e.mask!==null?rE.fromPartial(e.mask):void 0;t.alt=e.alt??"";return t}};function DRt(){return{contentType:"",data:new Uint8Array(0),mask:void 0,alt:""}}var dfe={encode(e,t=new tn){if(e.contentType!==""){t.uint32(10).string(e.contentType)}if(e.data.length!==0){t.uint32(18).bytes(e.data)}if(e.mask!==void 0){rE.encode(e.mask,t.uint32(26).fork()).join()}if(e.alt!==""){t.uint32(34).string(e.alt)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=DRt();while(n.pos>>3){case 1:{if(o!==10){break}i.contentType=n.string();continue}case 2:{if(o!==18){break}i.data=n.bytes();continue}case 3:{if(o!==26){break}i.mask=rE.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.alt=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return dfe.fromPartial(e??{})},fromPartial(e){const t=DRt();t.contentType=e.contentType??"";t.data=e.data??new Uint8Array(0);t.mask=e.mask!==void 0&&e.mask!==null?rE.fromPartial(e.mask):void 0;t.alt=e.alt??"";return t}};function FRt(){return{accent1:"",accent2:"",accent3:"",accent4:"",accent5:"",accent6:"",bg1:"",bg2:"",tx1:"",tx2:"",hlink:"",folHlink:""}}var K4={encode(e,t=new tn){if(e.accent1!==""){t.uint32(10).string(e.accent1)}if(e.accent2!==""){t.uint32(18).string(e.accent2)}if(e.accent3!==""){t.uint32(26).string(e.accent3)}if(e.accent4!==""){t.uint32(34).string(e.accent4)}if(e.accent5!==""){t.uint32(42).string(e.accent5)}if(e.accent6!==""){t.uint32(50).string(e.accent6)}if(e.bg1!==""){t.uint32(58).string(e.bg1)}if(e.bg2!==""){t.uint32(66).string(e.bg2)}if(e.tx1!==""){t.uint32(74).string(e.tx1)}if(e.tx2!==""){t.uint32(82).string(e.tx2)}if(e.hlink!==""){t.uint32(90).string(e.hlink)}if(e.folHlink!==""){t.uint32(98).string(e.folHlink)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=FRt();while(n.pos>>3){case 1:{if(o!==10){break}i.accent1=n.string();continue}case 2:{if(o!==18){break}i.accent2=n.string();continue}case 3:{if(o!==26){break}i.accent3=n.string();continue}case 4:{if(o!==34){break}i.accent4=n.string();continue}case 5:{if(o!==42){break}i.accent5=n.string();continue}case 6:{if(o!==50){break}i.accent6=n.string();continue}case 7:{if(o!==58){break}i.bg1=n.string();continue}case 8:{if(o!==66){break}i.bg2=n.string();continue}case 9:{if(o!==74){break}i.tx1=n.string();continue}case 10:{if(o!==82){break}i.tx2=n.string();continue}case 11:{if(o!==90){break}i.hlink=n.string();continue}case 12:{if(o!==98){break}i.folHlink=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return K4.fromPartial(e??{})},fromPartial(e){const t=FRt();t.accent1=e.accent1??"";t.accent2=e.accent2??"";t.accent3=e.accent3??"";t.accent4=e.accent4??"";t.accent5=e.accent5??"";t.accent6=e.accent6??"";t.bg1=e.bg1??"";t.bg2=e.bg2??"";t.tx1=e.tx1??"";t.tx2=e.tx2??"";t.hlink=e.hlink??"";t.folHlink=e.folHlink??"";return t}};function NRt(){return{t:"",l:"",r:"",b:""}}var ffe={encode(e,t=new tn){if(e.t!==""){t.uint32(10).string(e.t)}if(e.l!==""){t.uint32(18).string(e.l)}if(e.r!==""){t.uint32(26).string(e.r)}if(e.b!==""){t.uint32(34).string(e.b)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=NRt();while(n.pos>>3){case 1:{if(o!==10){break}i.t=n.string();continue}case 2:{if(o!==18){break}i.l=n.string();continue}case 3:{if(o!==26){break}i.r=n.string();continue}case 4:{if(o!==34){break}i.b=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return ffe.fromPartial(e??{})},fromPartial(e){const t=NRt();t.t=e.t??"";t.l=e.l??"";t.r=e.r??"";t.b=e.b??"";return t}};function ORt(){return{x:0,y:0}}var hfe={encode(e,t=new tn){if(e.x!==0){t.uint32(8).int64(e.x)}if(e.y!==0){t.uint32(16).int64(e.y)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=ORt();while(n.pos>>3){case 1:{if(o!==8){break}i.x=hl(n.int64());continue}case 2:{if(o!==16){break}i.y=hl(n.int64());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return hfe.fromPartial(e??{})},fromPartial(e){const t=ORt();t.x=e.x??0;t.y=e.y??0;return t}};function BRt(){return{x:0,y:0}}var pfe={encode(e,t=new tn){if(e.x!==0){t.uint32(8).int64(e.x)}if(e.y!==0){t.uint32(16).int64(e.y)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=BRt();while(n.pos>>3){case 1:{if(o!==8){break}i.x=hl(n.int64());continue}case 2:{if(o!==16){break}i.y=hl(n.int64());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return pfe.fromPartial(e??{})},fromPartial(e){const t=BRt();t.x=e.x??0;t.y=e.y??0;return t}};function zRt(){return{}}var mfe={encode(e,t=new tn){return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=zRt();while(n.pos>>3){}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return mfe.fromPartial(e??{})},fromPartial(e){const t=zRt();return t}};function URt(){return{x1:0,y1:0,x:0,y:0}}var gfe={encode(e,t=new tn){if(e.x1!==0){t.uint32(8).int64(e.x1)}if(e.y1!==0){t.uint32(16).int64(e.y1)}if(e.x!==0){t.uint32(24).int64(e.x)}if(e.y!==0){t.uint32(32).int64(e.y)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=URt();while(n.pos>>3){case 1:{if(o!==8){break}i.x1=hl(n.int64());continue}case 2:{if(o!==16){break}i.y1=hl(n.int64());continue}case 3:{if(o!==24){break}i.x=hl(n.int64());continue}case 4:{if(o!==32){break}i.y=hl(n.int64());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return gfe.fromPartial(e??{})},fromPartial(e){const t=URt();t.x1=e.x1??0;t.y1=e.y1??0;t.x=e.x??0;t.y=e.y??0;return t}};function VRt(){return{x1:0,y1:0,x2:0,y2:0,x:0,y:0}}var yfe={encode(e,t=new tn){if(e.x1!==0){t.uint32(8).int64(e.x1)}if(e.y1!==0){t.uint32(16).int64(e.y1)}if(e.x2!==0){t.uint32(24).int64(e.x2)}if(e.y2!==0){t.uint32(32).int64(e.y2)}if(e.x!==0){t.uint32(40).int64(e.x)}if(e.y!==0){t.uint32(48).int64(e.y)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=VRt();while(n.pos>>3){case 1:{if(o!==8){break}i.x1=hl(n.int64());continue}case 2:{if(o!==16){break}i.y1=hl(n.int64());continue}case 3:{if(o!==24){break}i.x2=hl(n.int64());continue}case 4:{if(o!==32){break}i.y2=hl(n.int64());continue}case 5:{if(o!==40){break}i.x=hl(n.int64());continue}case 6:{if(o!==48){break}i.y=hl(n.int64());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return yfe.fromPartial(e??{})},fromPartial(e){const t=VRt();t.x1=e.x1??0;t.y1=e.y1??0;t.x2=e.x2??0;t.y2=e.y2??0;t.x=e.x??0;t.y=e.y??0;return t}};function $Rt(){return{widthRadius:0,heightRadius:0,startAngle:0,swingAngle:0}}var bfe={encode(e,t=new tn){if(e.widthRadius!==0){t.uint32(8).int64(e.widthRadius)}if(e.heightRadius!==0){t.uint32(16).int64(e.heightRadius)}if(e.startAngle!==0){t.uint32(24).int64(e.startAngle)}if(e.swingAngle!==0){t.uint32(32).int64(e.swingAngle)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=$Rt();while(n.pos>>3){case 1:{if(o!==8){break}i.widthRadius=hl(n.int64());continue}case 2:{if(o!==16){break}i.heightRadius=hl(n.int64());continue}case 3:{if(o!==24){break}i.startAngle=hl(n.int64());continue}case 4:{if(o!==32){break}i.swingAngle=hl(n.int64());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return bfe.fromPartial(e??{})},fromPartial(e){const t=$Rt();t.widthRadius=e.widthRadius??0;t.heightRadius=e.heightRadius??0;t.startAngle=e.startAngle??0;t.swingAngle=e.swingAngle??0;return t}};function GRt(){return{moveTo:void 0,lineTo:void 0,close:void 0,quadBezTo:void 0,cubicBezTo:void 0,arcTo:void 0}}var xfe={encode(e,t=new tn){if(e.moveTo!==void 0){hfe.encode(e.moveTo,t.uint32(10).fork()).join()}if(e.lineTo!==void 0){pfe.encode(e.lineTo,t.uint32(18).fork()).join()}if(e.close!==void 0){mfe.encode(e.close,t.uint32(26).fork()).join()}if(e.quadBezTo!==void 0){gfe.encode(e.quadBezTo,t.uint32(34).fork()).join()}if(e.cubicBezTo!==void 0){yfe.encode(e.cubicBezTo,t.uint32(42).fork()).join()}if(e.arcTo!==void 0){bfe.encode(e.arcTo,t.uint32(50).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=GRt();while(n.pos>>3){case 1:{if(o!==10){break}i.moveTo=hfe.decode(n,n.uint32());continue}case 2:{if(o!==18){break}i.lineTo=pfe.decode(n,n.uint32());continue}case 3:{if(o!==26){break}i.close=mfe.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.quadBezTo=gfe.decode(n,n.uint32());continue}case 5:{if(o!==42){break}i.cubicBezTo=yfe.decode(n,n.uint32());continue}case 6:{if(o!==50){break}i.arcTo=bfe.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return xfe.fromPartial(e??{})},fromPartial(e){const t=GRt();t.moveTo=e.moveTo!==void 0&&e.moveTo!==null?hfe.fromPartial(e.moveTo):void 0;t.lineTo=e.lineTo!==void 0&&e.lineTo!==null?pfe.fromPartial(e.lineTo):void 0;t.close=e.close!==void 0&&e.close!==null?mfe.fromPartial(e.close):void 0;t.quadBezTo=e.quadBezTo!==void 0&&e.quadBezTo!==null?gfe.fromPartial(e.quadBezTo):void 0;t.cubicBezTo=e.cubicBezTo!==void 0&&e.cubicBezTo!==null?yfe.fromPartial(e.cubicBezTo):void 0;t.arcTo=e.arcTo!==void 0&&e.arcTo!==null?bfe.fromPartial(e.arcTo):void 0;return t}};function HRt(){return{id:void 0,widthEmu:0,heightEmu:0,commands:[]}}var vfe={encode(e,t=new tn){if(e.id!==void 0){t.uint32(34).string(e.id)}if(e.widthEmu!==0){t.uint32(8).int64(e.widthEmu)}if(e.heightEmu!==0){t.uint32(16).int64(e.heightEmu)}for(const n of e.commands){xfe.encode(n,t.uint32(26).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=HRt();while(n.pos>>3){case 4:{if(o!==34){break}i.id=n.string();continue}case 1:{if(o!==8){break}i.widthEmu=hl(n.int64());continue}case 2:{if(o!==16){break}i.heightEmu=hl(n.int64());continue}case 3:{if(o!==26){break}i.commands.push(xfe.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return vfe.fromPartial(e??{})},fromPartial(e){const t=HRt();t.id=e.id??void 0;t.widthEmu=e.widthEmu??0;t.heightEmu=e.heightEmu??0;t.commands=e.commands?.map(n=>xfe.fromPartial(n))||[];return t}};function WRt(){return{themeId:""}}var _fe={encode(e,t=new tn){if(e.themeId!==""){t.uint32(10).string(e.themeId)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=WRt();while(n.pos>>3){case 1:{if(o!==10){break}i.themeId=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return _fe.fromPartial(e??{})},fromPartial(e){const t=WRt();t.themeId=e.themeId??"";return t}};function YRt(){return{runtime:"",exitCode:0,durationMs:0,timestampIso8601:""}}var Tfe={encode(e,t=new tn){if(e.runtime!==""){t.uint32(10).string(e.runtime)}if(e.exitCode!==0){t.uint32(16).int32(e.exitCode)}if(e.durationMs!==0){t.uint32(25).double(e.durationMs)}if(e.timestampIso8601!==""){t.uint32(34).string(e.timestampIso8601)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=YRt();while(n.pos>>3){case 1:{if(o!==10){break}i.runtime=n.string();continue}case 2:{if(o!==16){break}i.exitCode=n.int32();continue}case 3:{if(o!==25){break}i.durationMs=n.double();continue}case 4:{if(o!==34){break}i.timestampIso8601=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Tfe.fromPartial(e??{})},fromPartial(e){const t=YRt();t.runtime=e.runtime??"";t.exitCode=e.exitCode??0;t.durationMs=e.durationMs??0;t.timestampIso8601=e.timestampIso8601??"";return t}};function qRt(){return{id:"",kind:0,theme:void 0,script:void 0}}var UI={encode(e,t=new tn){if(e.id!==""){t.uint32(10).string(e.id)}if(e.kind!==0){t.uint32(16).int32(e.kind)}if(e.theme!==void 0){_fe.encode(e.theme,t.uint32(26).fork()).join()}if(e.script!==void 0){wfe.encode(e.script,t.uint32(58).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=qRt();while(n.pos>>3){case 1:{if(o!==10){break}i.id=n.string();continue}case 2:{if(o!==16){break}i.kind=n.int32();continue}case 3:{if(o!==26){break}i.theme=_fe.decode(n,n.uint32());continue}case 7:{if(o!==58){break}i.script=wfe.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return UI.fromPartial(e??{})},fromPartial(e){const t=qRt();t.id=e.id??"";t.kind=e.kind??0;t.theme=e.theme!==void 0&&e.theme!==null?_fe.fromPartial(e.theme):void 0;t.script=e.script!==void 0&&e.script!==null?wfe.fromPartial(e.script):void 0;return t}};function XRt(){return{id:"",language:"",initSource:""}}var _X={encode(e,t=new tn){if(e.id!==""){t.uint32(10).string(e.id)}if(e.language!==""){t.uint32(18).string(e.language)}if(e.initSource!==""){t.uint32(26).string(e.initSource)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=XRt();while(n.pos>>3){case 1:{if(o!==10){break}i.id=n.string();continue}case 2:{if(o!==18){break}i.language=n.string();continue}case 3:{if(o!==26){break}i.initSource=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return _X.fromPartial(e??{})},fromPartial(e){const t=XRt();t.id=e.id??"";t.language=e.language??"";t.initSource=e.initSource??"";return t}};function jRt(){return{language:"",source:"",returnMode:0,environmentId:"",result:void 0,execution:void 0}}var wfe={encode(e,t=new tn){if(e.language!==""){t.uint32(10).string(e.language)}if(e.source!==""){t.uint32(18).string(e.source)}if(e.returnMode!==0){t.uint32(32).int32(e.returnMode)}if(e.environmentId!==""){t.uint32(42).string(e.environmentId)}if(e.result!==void 0){Efe.encode(e.result,t.uint32(50).fork()).join()}if(e.execution!==void 0){Tfe.encode(e.execution,t.uint32(58).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=jRt();while(n.pos>>3){case 1:{if(o!==10){break}i.language=n.string();continue}case 2:{if(o!==18){break}i.source=n.string();continue}case 4:{if(o!==32){break}i.returnMode=n.int32();continue}case 5:{if(o!==42){break}i.environmentId=n.string();continue}case 6:{if(o!==50){break}i.result=Efe.decode(n,n.uint32());continue}case 7:{if(o!==58){break}i.execution=Tfe.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return wfe.fromPartial(e??{})},fromPartial(e){const t=jRt();t.language=e.language??"";t.source=e.source??"";t.returnMode=e.returnMode??0;t.environmentId=e.environmentId??"";t.result=e.result!==void 0&&e.result!==null?Efe.fromPartial(e.result):void 0;t.execution=e.execution!==void 0&&e.execution!==null?Tfe.fromPartial(e.execution):void 0;return t}};function KRt(){return{json:void 0,stdout:void 0,refs:[],error:void 0}}var Efe={encode(e,t=new tn){if(e.json!==void 0){t.uint32(18).string(e.json)}if(e.stdout!==void 0){t.uint32(26).string(e.stdout)}for(const n of e.refs){t.uint32(34).string(n)}if(e.error!==void 0){t.uint32(42).string(e.error)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=KRt();while(n.pos>>3){case 2:{if(o!==18){break}i.json=n.string();continue}case 3:{if(o!==26){break}i.stdout=n.string();continue}case 4:{if(o!==34){break}i.refs.push(n.string());continue}case 5:{if(o!==42){break}i.error=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Efe.fromPartial(e??{})},fromPartial(e){const t=KRt();t.json=e.json??void 0;t.stdout=e.stdout??void 0;t.refs=e.refs?.map(n=>n)||[];t.error=e.error??void 0;return t}};function ZRt(){return{cap:void 0,join:void 0,head:void 0,tail:void 0}}var Cfe={encode(e,t=new tn){if(e.cap!==void 0){t.uint32(40).int32(e.cap)}if(e.join!==void 0){t.uint32(48).int32(e.join)}if(e.head!==void 0){$4.encode(e.head,t.uint32(58).fork()).join()}if(e.tail!==void 0){$4.encode(e.tail,t.uint32(66).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=ZRt();while(n.pos>>3){case 5:{if(o!==40){break}i.cap=n.int32();continue}case 6:{if(o!==48){break}i.join=n.int32();continue}case 7:{if(o!==58){break}i.head=$4.decode(n,n.uint32());continue}case 8:{if(o!==66){break}i.tail=$4.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Cfe.fromPartial(e??{})},fromPartial(e){const t=ZRt();t.cap=e.cap??void 0;t.join=e.join??void 0;t.head=e.head!==void 0&&e.head!==null?$4.fromPartial(e.head):void 0;t.tail=e.tail!==void 0&&e.tail!==null?$4.fromPartial(e.tail):void 0;return t}};function JRt(){return{type:0,width:0,length:0}}var $4={encode(e,t=new tn){if(e.type!==0){t.uint32(8).int32(e.type)}if(e.width!==0){t.uint32(16).int32(e.width)}if(e.length!==0){t.uint32(24).int32(e.length)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=JRt();while(n.pos>>3){case 1:{if(o!==8){break}i.type=n.int32();continue}case 2:{if(o!==16){break}i.width=n.int32();continue}case 3:{if(o!==24){break}i.length=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return $4.fromPartial(e??{})},fromPartial(e){const t=JRt();t.type=e.type??0;t.width=e.width??0;t.length=e.length??0;return t}};var vX=(()=>{if(typeof globalThis!=="undefined"){return globalThis}if(typeof self!=="undefined"){return self}if(typeof window!=="undefined"){return window}if(typeof global!=="undefined"){return global}throw"Unable to locate global object"})();function hl(e){const t=vX.Number(e.toString());if(t>vX.Number.MAX_SAFE_INTEGER){throw new vX.Error("Value is larger than Number.MAX_SAFE_INTEGER")}if(t{m[m["DATA_CONSOLIDATE_FUNCTION_UNSPECIFIED"]=0]="DATA_CONSOLIDATE_FUNCTION_UNSPECIFIED";m[m["DATA_CONSOLIDATE_FUNCTION_SUM"]=1]="DATA_CONSOLIDATE_FUNCTION_SUM";m[m["DATA_CONSOLIDATE_FUNCTION_AVERAGE"]=2]="DATA_CONSOLIDATE_FUNCTION_AVERAGE";m[m["DATA_CONSOLIDATE_FUNCTION_COUNT"]=3]="DATA_CONSOLIDATE_FUNCTION_COUNT";m[m["DATA_CONSOLIDATE_FUNCTION_COUNT_NUMBERS"]=4]="DATA_CONSOLIDATE_FUNCTION_COUNT_NUMBERS";m[m["DATA_CONSOLIDATE_FUNCTION_MAXIMUM"]=5]="DATA_CONSOLIDATE_FUNCTION_MAXIMUM";m[m["DATA_CONSOLIDATE_FUNCTION_MINIMUM"]=6]="DATA_CONSOLIDATE_FUNCTION_MINIMUM";m[m["DATA_CONSOLIDATE_FUNCTION_PRODUCT"]=7]="DATA_CONSOLIDATE_FUNCTION_PRODUCT";m[m["DATA_CONSOLIDATE_FUNCTION_STD_DEV"]=8]="DATA_CONSOLIDATE_FUNCTION_STD_DEV";m[m["DATA_CONSOLIDATE_FUNCTION_STD_DEVP"]=9]="DATA_CONSOLIDATE_FUNCTION_STD_DEVP";m[m["DATA_CONSOLIDATE_FUNCTION_VARIANCE"]=10]="DATA_CONSOLIDATE_FUNCTION_VARIANCE";m[m["DATA_CONSOLIDATE_FUNCTION_VARIANCEP"]=11]="DATA_CONSOLIDATE_FUNCTION_VARIANCEP";m[m["UNRECOGNIZED"]=-1]="UNRECOGNIZED";return m})(TX||{});function QRt(){return{id:void 0,sheets:[],styles:void 0,theme:void 0,contentReferences:[],images:[],people:[],threads:[],notes:[],slicerCaches:[],pivotCaches:[],timelineCaches:[],definedNames:void 0,metadata:void 0,featurePropertyBags:void 0,textStyles:[],codeEnvironments:[],codeBlocks:[],calculationChain:void 0}}var rN={encode(e,t=new tn){if(e.id!==void 0){t.uint32(82).string(e.id)}for(const n of e.sheets){nhe.encode(n,t.uint32(10).fork()).join()}if(e.styles!==void 0){phe.encode(e.styles,t.uint32(18).fork()).join()}if(e.theme!==void 0){_0.encode(e.theme,t.uint32(26).fork()).join()}for(const n of e.contentReferences){FA.encode(n,t.uint32(34).fork()).join()}for(const n of e.images){yy.encode(n,t.uint32(42).fork()).join()}for(const n of e.people){NA.encode(n,t.uint32(162).fork()).join()}for(const n of e.threads){OA.encode(n,t.uint32(170).fork()).join()}for(const n of e.notes){xhe.encode(n,t.uint32(178).fork()).join()}for(const n of e.slicerCaches){spe.encode(n,t.uint32(186).fork()).join()}for(const n of e.pivotCaches){lpe.encode(n,t.uint32(194).fork()).join()}for(const n of e.timelineCaches){Uhe.encode(n,t.uint32(202).fork()).join()}if(e.definedNames!==void 0){Qfe.encode(e.definedNames,t.uint32(210).fork()).join()}if(e.metadata!==void 0){kfe.encode(e.metadata,t.uint32(218).fork()).join()}if(e.featurePropertyBags!==void 0){qfe.encode(e.featurePropertyBags,t.uint32(226).fork()).join()}for(const n of e.textStyles){h1.encode(n,t.uint32(234).fork()).join()}for(const n of e.codeEnvironments){_X.encode(n,t.uint32(242).fork()).join()}for(const n of e.codeBlocks){UI.encode(n,t.uint32(250).fork()).join()}if(e.calculationChain!==void 0){Sfe.encode(e.calculationChain,t.uint32(258).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=QRt();while(n.pos>>3){case 10:{if(o!==82){break}i.id=n.string();continue}case 1:{if(o!==10){break}i.sheets.push(nhe.decode(n,n.uint32()));continue}case 2:{if(o!==18){break}i.styles=phe.decode(n,n.uint32());continue}case 3:{if(o!==26){break}i.theme=_0.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.contentReferences.push(FA.decode(n,n.uint32()));continue}case 5:{if(o!==42){break}i.images.push(yy.decode(n,n.uint32()));continue}case 20:{if(o!==162){break}i.people.push(NA.decode(n,n.uint32()));continue}case 21:{if(o!==170){break}i.threads.push(OA.decode(n,n.uint32()));continue}case 22:{if(o!==178){break}i.notes.push(xhe.decode(n,n.uint32()));continue}case 23:{if(o!==186){break}i.slicerCaches.push(spe.decode(n,n.uint32()));continue}case 24:{if(o!==194){break}i.pivotCaches.push(lpe.decode(n,n.uint32()));continue}case 25:{if(o!==202){break}i.timelineCaches.push(Uhe.decode(n,n.uint32()));continue}case 26:{if(o!==210){break}i.definedNames=Qfe.decode(n,n.uint32());continue}case 27:{if(o!==218){break}i.metadata=kfe.decode(n,n.uint32());continue}case 28:{if(o!==226){break}i.featurePropertyBags=qfe.decode(n,n.uint32());continue}case 29:{if(o!==234){break}i.textStyles.push(h1.decode(n,n.uint32()));continue}case 30:{if(o!==242){break}i.codeEnvironments.push(_X.decode(n,n.uint32()));continue}case 31:{if(o!==250){break}i.codeBlocks.push(UI.decode(n,n.uint32()));continue}case 32:{if(o!==258){break}i.calculationChain=Sfe.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return rN.fromPartial(e??{})},fromPartial(e){const t=QRt();t.id=e.id??void 0;t.sheets=e.sheets?.map(n=>nhe.fromPartial(n))||[];t.styles=e.styles!==void 0&&e.styles!==null?phe.fromPartial(e.styles):void 0;t.theme=e.theme!==void 0&&e.theme!==null?_0.fromPartial(e.theme):void 0;t.contentReferences=e.contentReferences?.map(n=>FA.fromPartial(n))||[];t.images=e.images?.map(n=>yy.fromPartial(n))||[];t.people=e.people?.map(n=>NA.fromPartial(n))||[];t.threads=e.threads?.map(n=>OA.fromPartial(n))||[];t.notes=e.notes?.map(n=>xhe.fromPartial(n))||[];t.slicerCaches=e.slicerCaches?.map(n=>spe.fromPartial(n))||[];t.pivotCaches=e.pivotCaches?.map(n=>lpe.fromPartial(n))||[];t.timelineCaches=e.timelineCaches?.map(n=>Uhe.fromPartial(n))||[];t.definedNames=e.definedNames!==void 0&&e.definedNames!==null?Qfe.fromPartial(e.definedNames):void 0;t.metadata=e.metadata!==void 0&&e.metadata!==null?kfe.fromPartial(e.metadata):void 0;t.featurePropertyBags=e.featurePropertyBags!==void 0&&e.featurePropertyBags!==null?qfe.fromPartial(e.featurePropertyBags):void 0;t.textStyles=e.textStyles?.map(n=>h1.fromPartial(n))||[];t.codeEnvironments=e.codeEnvironments?.map(n=>_X.fromPartial(n))||[];t.codeBlocks=e.codeBlocks?.map(n=>UI.fromPartial(n))||[];t.calculationChain=e.calculationChain!==void 0&&e.calculationChain!==null?Sfe.fromPartial(e.calculationChain):void 0;return t}};function ePt(){return{cells:[]}}var Sfe={encode(e,t=new tn){for(const n of e.cells){Afe.encode(n,t.uint32(10).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=ePt();while(n.pos>>3){case 1:{if(o!==10){break}i.cells.push(Afe.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Sfe.fromPartial(e??{})},fromPartial(e){const t=ePt();t.cells=e.cells?.map(n=>Afe.fromPartial(n))||[];return t}};function tPt(){return{cellReference:"",sheetId:void 0,newLevel:void 0,array:void 0,inChildChain:void 0}}var Afe={encode(e,t=new tn){if(e.cellReference!==""){t.uint32(10).string(e.cellReference)}if(e.sheetId!==void 0){t.uint32(16).int32(e.sheetId)}if(e.newLevel!==void 0){t.uint32(24).bool(e.newLevel)}if(e.array!==void 0){t.uint32(32).bool(e.array)}if(e.inChildChain!==void 0){t.uint32(40).bool(e.inChildChain)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=tPt();while(n.pos>>3){case 1:{if(o!==10){break}i.cellReference=n.string();continue}case 2:{if(o!==16){break}i.sheetId=n.int32();continue}case 3:{if(o!==24){break}i.newLevel=n.bool();continue}case 4:{if(o!==32){break}i.array=n.bool();continue}case 5:{if(o!==40){break}i.inChildChain=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Afe.fromPartial(e??{})},fromPartial(e){const t=tPt();t.cellReference=e.cellReference??"";t.sheetId=e.sheetId??void 0;t.newLevel=e.newLevel??void 0;t.array=e.array??void 0;t.inChildChain=e.inChildChain??void 0;return t}};function nPt(){return{metadataTypes:[],futureMetadata:[],cellMetadata:[],valueMetadata:[],richData:void 0}}var kfe={encode(e,t=new tn){for(const n of e.metadataTypes){Rfe.encode(n,t.uint32(10).fork()).join()}for(const n of e.futureMetadata){Pfe.encode(n,t.uint32(18).fork()).join()}for(const n of e.cellMetadata){Lfe.encode(n,t.uint32(26).fork()).join()}for(const n of e.valueMetadata){Nfe.encode(n,t.uint32(34).fork()).join()}if(e.richData!==void 0){zfe.encode(e.richData,t.uint32(42).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=nPt();while(n.pos>>3){case 1:{if(o!==10){break}i.metadataTypes.push(Rfe.decode(n,n.uint32()));continue}case 2:{if(o!==18){break}i.futureMetadata.push(Pfe.decode(n,n.uint32()));continue}case 3:{if(o!==26){break}i.cellMetadata.push(Lfe.decode(n,n.uint32()));continue}case 4:{if(o!==34){break}i.valueMetadata.push(Nfe.decode(n,n.uint32()));continue}case 5:{if(o!==42){break}i.richData=zfe.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return kfe.fromPartial(e??{})},fromPartial(e){const t=nPt();t.metadataTypes=e.metadataTypes?.map(n=>Rfe.fromPartial(n))||[];t.futureMetadata=e.futureMetadata?.map(n=>Pfe.fromPartial(n))||[];t.cellMetadata=e.cellMetadata?.map(n=>Lfe.fromPartial(n))||[];t.valueMetadata=e.valueMetadata?.map(n=>Nfe.fromPartial(n))||[];t.richData=e.richData!==void 0&&e.richData!==null?zfe.fromPartial(e.richData):void 0;return t}};function rPt(){return{name:"",minSupportedVersion:void 0,copy:void 0,pasteAll:void 0,pasteValues:void 0,merge:void 0,splitFirst:void 0,rowColShift:void 0,clearFormats:void 0,clearComments:void 0,assign:void 0,coerce:void 0,cellMeta:void 0}}var Rfe={encode(e,t=new tn){if(e.name!==""){t.uint32(10).string(e.name)}if(e.minSupportedVersion!==void 0){t.uint32(16).int32(e.minSupportedVersion)}if(e.copy!==void 0){t.uint32(24).bool(e.copy)}if(e.pasteAll!==void 0){t.uint32(32).bool(e.pasteAll)}if(e.pasteValues!==void 0){t.uint32(40).bool(e.pasteValues)}if(e.merge!==void 0){t.uint32(48).bool(e.merge)}if(e.splitFirst!==void 0){t.uint32(56).bool(e.splitFirst)}if(e.rowColShift!==void 0){t.uint32(64).bool(e.rowColShift)}if(e.clearFormats!==void 0){t.uint32(72).bool(e.clearFormats)}if(e.clearComments!==void 0){t.uint32(80).bool(e.clearComments)}if(e.assign!==void 0){t.uint32(88).bool(e.assign)}if(e.coerce!==void 0){t.uint32(96).bool(e.coerce)}if(e.cellMeta!==void 0){t.uint32(104).bool(e.cellMeta)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=rPt();while(n.pos>>3){case 1:{if(o!==10){break}i.name=n.string();continue}case 2:{if(o!==16){break}i.minSupportedVersion=n.int32();continue}case 3:{if(o!==24){break}i.copy=n.bool();continue}case 4:{if(o!==32){break}i.pasteAll=n.bool();continue}case 5:{if(o!==40){break}i.pasteValues=n.bool();continue}case 6:{if(o!==48){break}i.merge=n.bool();continue}case 7:{if(o!==56){break}i.splitFirst=n.bool();continue}case 8:{if(o!==64){break}i.rowColShift=n.bool();continue}case 9:{if(o!==72){break}i.clearFormats=n.bool();continue}case 10:{if(o!==80){break}i.clearComments=n.bool();continue}case 11:{if(o!==88){break}i.assign=n.bool();continue}case 12:{if(o!==96){break}i.coerce=n.bool();continue}case 13:{if(o!==104){break}i.cellMeta=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Rfe.fromPartial(e??{})},fromPartial(e){const t=rPt();t.name=e.name??"";t.minSupportedVersion=e.minSupportedVersion??void 0;t.copy=e.copy??void 0;t.pasteAll=e.pasteAll??void 0;t.pasteValues=e.pasteValues??void 0;t.merge=e.merge??void 0;t.splitFirst=e.splitFirst??void 0;t.rowColShift=e.rowColShift??void 0;t.clearFormats=e.clearFormats??void 0;t.clearComments=e.clearComments??void 0;t.assign=e.assign??void 0;t.coerce=e.coerce??void 0;t.cellMeta=e.cellMeta??void 0;return t}};function iPt(){return{name:"",count:void 0,blocks:[]}}var Pfe={encode(e,t=new tn){if(e.name!==""){t.uint32(10).string(e.name)}if(e.count!==void 0){t.uint32(16).int32(e.count)}for(const n of e.blocks){Ife.encode(n,t.uint32(26).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=iPt();while(n.pos>>3){case 1:{if(o!==10){break}i.name=n.string();continue}case 2:{if(o!==16){break}i.count=n.int32();continue}case 3:{if(o!==26){break}i.blocks.push(Ife.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Pfe.fromPartial(e??{})},fromPartial(e){const t=iPt();t.name=e.name??"";t.count=e.count??void 0;t.blocks=e.blocks?.map(n=>Ife.fromPartial(n))||[];return t}};function oPt(){return{extensionUri:void 0,dynamicArrayProperties:void 0,richValueBlockIndex:void 0}}var Ife={encode(e,t=new tn){if(e.extensionUri!==void 0){t.uint32(10).string(e.extensionUri)}if(e.dynamicArrayProperties!==void 0){Mfe.encode(e.dynamicArrayProperties,t.uint32(18).fork()).join()}if(e.richValueBlockIndex!==void 0){t.uint32(24).int32(e.richValueBlockIndex)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=oPt();while(n.pos>>3){case 1:{if(o!==10){break}i.extensionUri=n.string();continue}case 2:{if(o!==18){break}i.dynamicArrayProperties=Mfe.decode(n,n.uint32());continue}case 3:{if(o!==24){break}i.richValueBlockIndex=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Ife.fromPartial(e??{})},fromPartial(e){const t=oPt();t.extensionUri=e.extensionUri??void 0;t.dynamicArrayProperties=e.dynamicArrayProperties!==void 0&&e.dynamicArrayProperties!==null?Mfe.fromPartial(e.dynamicArrayProperties):void 0;t.richValueBlockIndex=e.richValueBlockIndex??void 0;return t}};function aPt(){return{isDynamic:void 0,collapsed:void 0}}var Mfe={encode(e,t=new tn){if(e.isDynamic!==void 0){t.uint32(8).bool(e.isDynamic)}if(e.collapsed!==void 0){t.uint32(16).bool(e.collapsed)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=aPt();while(n.pos>>3){case 1:{if(o!==8){break}i.isDynamic=n.bool();continue}case 2:{if(o!==16){break}i.collapsed=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Mfe.fromPartial(e??{})},fromPartial(e){const t=aPt();t.isDynamic=e.isDynamic??void 0;t.collapsed=e.collapsed??void 0;return t}};function sPt(){return{blocks:[]}}var Lfe={encode(e,t=new tn){for(const n of e.blocks){Dfe.encode(n,t.uint32(10).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=sPt();while(n.pos>>3){case 1:{if(o!==10){break}i.blocks.push(Dfe.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Lfe.fromPartial(e??{})},fromPartial(e){const t=sPt();t.blocks=e.blocks?.map(n=>Dfe.fromPartial(n))||[];return t}};function lPt(){return{entries:[]}}var Dfe={encode(e,t=new tn){for(const n of e.entries){Ffe.encode(n,t.uint32(10).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=lPt();while(n.pos>>3){case 1:{if(o!==10){break}i.entries.push(Ffe.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Dfe.fromPartial(e??{})},fromPartial(e){const t=lPt();t.entries=e.entries?.map(n=>Ffe.fromPartial(n))||[];return t}};function cPt(){return{type:void 0,value:void 0}}var Ffe={encode(e,t=new tn){if(e.type!==void 0){t.uint32(8).int32(e.type)}if(e.value!==void 0){t.uint32(16).int32(e.value)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=cPt();while(n.pos>>3){case 1:{if(o!==8){break}i.type=n.int32();continue}case 2:{if(o!==16){break}i.value=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Ffe.fromPartial(e??{})},fromPartial(e){const t=cPt();t.type=e.type??void 0;t.value=e.value??void 0;return t}};function uPt(){return{blocks:[]}}var Nfe={encode(e,t=new tn){for(const n of e.blocks){Ofe.encode(n,t.uint32(10).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=uPt();while(n.pos>>3){case 1:{if(o!==10){break}i.blocks.push(Ofe.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Nfe.fromPartial(e??{})},fromPartial(e){const t=uPt();t.blocks=e.blocks?.map(n=>Ofe.fromPartial(n))||[];return t}};function dPt(){return{entries:[]}}var Ofe={encode(e,t=new tn){for(const n of e.entries){Bfe.encode(n,t.uint32(10).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=dPt();while(n.pos>>3){case 1:{if(o!==10){break}i.entries.push(Bfe.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Ofe.fromPartial(e??{})},fromPartial(e){const t=dPt();t.entries=e.entries?.map(n=>Bfe.fromPartial(n))||[];return t}};function fPt(){return{type:void 0,value:void 0}}var Bfe={encode(e,t=new tn){if(e.type!==void 0){t.uint32(8).int32(e.type)}if(e.value!==void 0){t.uint32(16).int32(e.value)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=fPt();while(n.pos>>3){case 1:{if(o!==8){break}i.type=n.int32();continue}case 2:{if(o!==16){break}i.value=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Bfe.fromPartial(e??{})},fromPartial(e){const t=fPt();t.type=e.type??void 0;t.value=e.value??void 0;return t}};function hPt(){return{structures:[],values:[],typesInfo:void 0}}var zfe={encode(e,t=new tn){for(const n of e.structures){Ufe.encode(n,t.uint32(10).fork()).join()}for(const n of e.values){$fe.encode(n,t.uint32(18).fork()).join()}if(e.typesInfo!==void 0){Gfe.encode(e.typesInfo,t.uint32(26).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=hPt();while(n.pos>>3){case 1:{if(o!==10){break}i.structures.push(Ufe.decode(n,n.uint32()));continue}case 2:{if(o!==18){break}i.values.push($fe.decode(n,n.uint32()));continue}case 3:{if(o!==26){break}i.typesInfo=Gfe.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return zfe.fromPartial(e??{})},fromPartial(e){const t=hPt();t.structures=e.structures?.map(n=>Ufe.fromPartial(n))||[];t.values=e.values?.map(n=>$fe.fromPartial(n))||[];t.typesInfo=e.typesInfo!==void 0&&e.typesInfo!==null?Gfe.fromPartial(e.typesInfo):void 0;return t}};function pPt(){return{type:void 0,keys:[]}}var Ufe={encode(e,t=new tn){if(e.type!==void 0){t.uint32(10).string(e.type)}for(const n of e.keys){Vfe.encode(n,t.uint32(18).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=pPt();while(n.pos>>3){case 1:{if(o!==10){break}i.type=n.string();continue}case 2:{if(o!==18){break}i.keys.push(Vfe.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Ufe.fromPartial(e??{})},fromPartial(e){const t=pPt();t.type=e.type??void 0;t.keys=e.keys?.map(n=>Vfe.fromPartial(n))||[];return t}};function mPt(){return{name:void 0,type:void 0}}var Vfe={encode(e,t=new tn){if(e.name!==void 0){t.uint32(10).string(e.name)}if(e.type!==void 0){t.uint32(18).string(e.type)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=mPt();while(n.pos>>3){case 1:{if(o!==10){break}i.name=n.string();continue}case 2:{if(o!==18){break}i.type=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Vfe.fromPartial(e??{})},fromPartial(e){const t=mPt();t.name=e.name??void 0;t.type=e.type??void 0;return t}};function gPt(){return{structureIndex:void 0,values:[],fallbackType:void 0}}var $fe={encode(e,t=new tn){if(e.structureIndex!==void 0){t.uint32(8).int32(e.structureIndex)}for(const n of e.values){t.uint32(18).string(n)}if(e.fallbackType!==void 0){t.uint32(26).string(e.fallbackType)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=gPt();while(n.pos>>3){case 1:{if(o!==8){break}i.structureIndex=n.int32();continue}case 2:{if(o!==18){break}i.values.push(n.string());continue}case 3:{if(o!==26){break}i.fallbackType=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return $fe.fromPartial(e??{})},fromPartial(e){const t=gPt();t.structureIndex=e.structureIndex??void 0;t.values=e.values?.map(n=>n)||[];t.fallbackType=e.fallbackType??void 0;return t}};function yPt(){return{globalKeyFlags:void 0,richValueTypes:[]}}var Gfe={encode(e,t=new tn){if(e.globalKeyFlags!==void 0){J4.encode(e.globalKeyFlags,t.uint32(10).fork()).join()}for(const n of e.richValueTypes){Hfe.encode(n,t.uint32(18).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=yPt();while(n.pos>>3){case 1:{if(o!==10){break}i.globalKeyFlags=J4.decode(n,n.uint32());continue}case 2:{if(o!==18){break}i.richValueTypes.push(Hfe.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Gfe.fromPartial(e??{})},fromPartial(e){const t=yPt();t.globalKeyFlags=e.globalKeyFlags!==void 0&&e.globalKeyFlags!==null?J4.fromPartial(e.globalKeyFlags):void 0;t.richValueTypes=e.richValueTypes?.map(n=>Hfe.fromPartial(n))||[];return t}};function bPt(){return{name:void 0,keyFlags:void 0}}var Hfe={encode(e,t=new tn){if(e.name!==void 0){t.uint32(10).string(e.name)}if(e.keyFlags!==void 0){J4.encode(e.keyFlags,t.uint32(18).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=bPt();while(n.pos>>3){case 1:{if(o!==10){break}i.name=n.string();continue}case 2:{if(o!==18){break}i.keyFlags=J4.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Hfe.fromPartial(e??{})},fromPartial(e){const t=bPt();t.name=e.name??void 0;t.keyFlags=e.keyFlags!==void 0&&e.keyFlags!==null?J4.fromPartial(e.keyFlags):void 0;return t}};function xPt(){return{keys:[]}}var J4={encode(e,t=new tn){for(const n of e.keys){Wfe.encode(n,t.uint32(10).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=xPt();while(n.pos>>3){case 1:{if(o!==10){break}i.keys.push(Wfe.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return J4.fromPartial(e??{})},fromPartial(e){const t=xPt();t.keys=e.keys?.map(n=>Wfe.fromPartial(n))||[];return t}};function vPt(){return{name:void 0,flags:[]}}var Wfe={encode(e,t=new tn){if(e.name!==void 0){t.uint32(10).string(e.name)}for(const n of e.flags){Yfe.encode(n,t.uint32(18).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=vPt();while(n.pos>>3){case 1:{if(o!==10){break}i.name=n.string();continue}case 2:{if(o!==18){break}i.flags.push(Yfe.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Wfe.fromPartial(e??{})},fromPartial(e){const t=vPt();t.name=e.name??void 0;t.flags=e.flags?.map(n=>Yfe.fromPartial(n))||[];return t}};function _Pt(){return{name:void 0,value:void 0}}var Yfe={encode(e,t=new tn){if(e.name!==void 0){t.uint32(10).string(e.name)}if(e.value!==void 0){t.uint32(16).bool(e.value)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=_Pt();while(n.pos>>3){case 1:{if(o!==10){break}i.name=n.string();continue}case 2:{if(o!==16){break}i.value=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Yfe.fromPartial(e??{})},fromPartial(e){const t=_Pt();t.name=e.name??void 0;t.value=e.value??void 0;return t}};function TPt(){return{count:void 0,bags:[]}}var qfe={encode(e,t=new tn){if(e.count!==void 0){t.uint32(8).uint32(e.count)}for(const n of e.bags){Xfe.encode(n,t.uint32(18).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=TPt();while(n.pos>>3){case 1:{if(o!==8){break}i.count=n.uint32();continue}case 2:{if(o!==18){break}i.bags.push(Xfe.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return qfe.fromPartial(e??{})},fromPartial(e){const t=TPt();t.count=e.count??void 0;t.bags=e.bags?.map(n=>Xfe.fromPartial(n))||[];return t}};function wPt(){return{type:0,extRef:void 0,bagExtensionId:void 0,att:void 0,customType:void 0,properties:[]}}var Xfe={encode(e,t=new tn){if(e.type!==0){t.uint32(8).int32(e.type)}if(e.extRef!==void 0){t.uint32(18).string(e.extRef)}if(e.bagExtensionId!==void 0){t.uint32(24).uint32(e.bagExtensionId)}if(e.att!==void 0){t.uint32(34).string(e.att)}if(e.customType!==void 0){t.uint32(42).string(e.customType)}for(const n of e.properties){jfe.encode(n,t.uint32(50).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=wPt();while(n.pos>>3){case 1:{if(o!==8){break}i.type=n.int32();continue}case 2:{if(o!==18){break}i.extRef=n.string();continue}case 3:{if(o!==24){break}i.bagExtensionId=n.uint32();continue}case 4:{if(o!==34){break}i.att=n.string();continue}case 5:{if(o!==42){break}i.customType=n.string();continue}case 6:{if(o!==50){break}i.properties.push(jfe.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Xfe.fromPartial(e??{})},fromPartial(e){const t=wPt();t.type=e.type??0;t.extRef=e.extRef??void 0;t.bagExtensionId=e.bagExtensionId??void 0;t.att=e.att??void 0;t.customType=e.customType??void 0;t.properties=e.properties?.map(n=>jfe.fromPartial(n))||[];return t}};function EPt(){return{key:"",bagIdValue:void 0,intValue:void 0,decimalValue:void 0,stringValue:void 0,boolValue:void 0,relationshipId:void 0,arrayValue:void 0}}var jfe={encode(e,t=new tn){if(e.key!==""){t.uint32(10).string(e.key)}if(e.bagIdValue!==void 0){t.uint32(16).uint32(e.bagIdValue)}if(e.intValue!==void 0){t.uint32(24).int32(e.intValue)}if(e.decimalValue!==void 0){t.uint32(33).double(e.decimalValue)}if(e.stringValue!==void 0){t.uint32(42).string(e.stringValue)}if(e.boolValue!==void 0){t.uint32(48).bool(e.boolValue)}if(e.relationshipId!==void 0){t.uint32(58).string(e.relationshipId)}if(e.arrayValue!==void 0){Kfe.encode(e.arrayValue,t.uint32(66).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=EPt();while(n.pos>>3){case 1:{if(o!==10){break}i.key=n.string();continue}case 2:{if(o!==16){break}i.bagIdValue=n.uint32();continue}case 3:{if(o!==24){break}i.intValue=n.int32();continue}case 4:{if(o!==33){break}i.decimalValue=n.double();continue}case 5:{if(o!==42){break}i.stringValue=n.string();continue}case 6:{if(o!==48){break}i.boolValue=n.bool();continue}case 7:{if(o!==58){break}i.relationshipId=n.string();continue}case 8:{if(o!==66){break}i.arrayValue=Kfe.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return jfe.fromPartial(e??{})},fromPartial(e){const t=EPt();t.key=e.key??"";t.bagIdValue=e.bagIdValue??void 0;t.intValue=e.intValue??void 0;t.decimalValue=e.decimalValue??void 0;t.stringValue=e.stringValue??void 0;t.boolValue=e.boolValue??void 0;t.relationshipId=e.relationshipId??void 0;t.arrayValue=e.arrayValue!==void 0&&e.arrayValue!==null?Kfe.fromPartial(e.arrayValue):void 0;return t}};function CPt(){return{values:[]}}var Kfe={encode(e,t=new tn){for(const n of e.values){Zfe.encode(n,t.uint32(10).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=CPt();while(n.pos>>3){case 1:{if(o!==10){break}i.values.push(Zfe.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Kfe.fromPartial(e??{})},fromPartial(e){const t=CPt();t.values=e.values?.map(n=>Zfe.fromPartial(n))||[];return t}};function SPt(){return{bagIdValue:void 0,intValue:void 0,doubleValue:void 0,stringValue:void 0,boolValue:void 0,relationshipId:void 0}}var Zfe={encode(e,t=new tn){if(e.bagIdValue!==void 0){t.uint32(8).uint32(e.bagIdValue)}if(e.intValue!==void 0){t.uint32(16).int32(e.intValue)}if(e.doubleValue!==void 0){t.uint32(25).double(e.doubleValue)}if(e.stringValue!==void 0){t.uint32(34).string(e.stringValue)}if(e.boolValue!==void 0){t.uint32(40).bool(e.boolValue)}if(e.relationshipId!==void 0){t.uint32(50).string(e.relationshipId)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=SPt();while(n.pos>>3){case 1:{if(o!==8){break}i.bagIdValue=n.uint32();continue}case 2:{if(o!==16){break}i.intValue=n.int32();continue}case 3:{if(o!==25){break}i.doubleValue=n.double();continue}case 4:{if(o!==34){break}i.stringValue=n.string();continue}case 5:{if(o!==40){break}i.boolValue=n.bool();continue}case 6:{if(o!==50){break}i.relationshipId=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Zfe.fromPartial(e??{})},fromPartial(e){const t=SPt();t.bagIdValue=e.bagIdValue??void 0;t.intValue=e.intValue??void 0;t.doubleValue=e.doubleValue??void 0;t.stringValue=e.stringValue??void 0;t.boolValue=e.boolValue??void 0;t.relationshipId=e.relationshipId??void 0;return t}};function APt(){return{name:"",text:"",localSheetId:void 0,hidden:void 0,comment:void 0,description:void 0,customMenu:void 0,help:void 0,statusBar:void 0,shortcutKey:void 0,function:void 0,vbProcedure:void 0,functionGroupId:void 0,publishToServer:void 0,workbookParameter:void 0,xlm:void 0}}var Jfe={encode(e,t=new tn){if(e.name!==""){t.uint32(10).string(e.name)}if(e.text!==""){t.uint32(18).string(e.text)}if(e.localSheetId!==void 0){t.uint32(24).int32(e.localSheetId)}if(e.hidden!==void 0){t.uint32(32).bool(e.hidden)}if(e.comment!==void 0){t.uint32(42).string(e.comment)}if(e.description!==void 0){t.uint32(50).string(e.description)}if(e.customMenu!==void 0){t.uint32(58).string(e.customMenu)}if(e.help!==void 0){t.uint32(66).string(e.help)}if(e.statusBar!==void 0){t.uint32(74).string(e.statusBar)}if(e.shortcutKey!==void 0){t.uint32(82).string(e.shortcutKey)}if(e.function!==void 0){t.uint32(88).bool(e.function)}if(e.vbProcedure!==void 0){t.uint32(96).bool(e.vbProcedure)}if(e.functionGroupId!==void 0){t.uint32(104).int32(e.functionGroupId)}if(e.publishToServer!==void 0){t.uint32(112).bool(e.publishToServer)}if(e.workbookParameter!==void 0){t.uint32(120).bool(e.workbookParameter)}if(e.xlm!==void 0){t.uint32(128).bool(e.xlm)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=APt();while(n.pos>>3){case 1:{if(o!==10){break}i.name=n.string();continue}case 2:{if(o!==18){break}i.text=n.string();continue}case 3:{if(o!==24){break}i.localSheetId=n.int32();continue}case 4:{if(o!==32){break}i.hidden=n.bool();continue}case 5:{if(o!==42){break}i.comment=n.string();continue}case 6:{if(o!==50){break}i.description=n.string();continue}case 7:{if(o!==58){break}i.customMenu=n.string();continue}case 8:{if(o!==66){break}i.help=n.string();continue}case 9:{if(o!==74){break}i.statusBar=n.string();continue}case 10:{if(o!==82){break}i.shortcutKey=n.string();continue}case 11:{if(o!==88){break}i.function=n.bool();continue}case 12:{if(o!==96){break}i.vbProcedure=n.bool();continue}case 13:{if(o!==104){break}i.functionGroupId=n.int32();continue}case 14:{if(o!==112){break}i.publishToServer=n.bool();continue}case 15:{if(o!==120){break}i.workbookParameter=n.bool();continue}case 16:{if(o!==128){break}i.xlm=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Jfe.fromPartial(e??{})},fromPartial(e){const t=APt();t.name=e.name??"";t.text=e.text??"";t.localSheetId=e.localSheetId??void 0;t.hidden=e.hidden??void 0;t.comment=e.comment??void 0;t.description=e.description??void 0;t.customMenu=e.customMenu??void 0;t.help=e.help??void 0;t.statusBar=e.statusBar??void 0;t.shortcutKey=e.shortcutKey??void 0;t.function=e.function??void 0;t.vbProcedure=e.vbProcedure??void 0;t.functionGroupId=e.functionGroupId??void 0;t.publishToServer=e.publishToServer??void 0;t.workbookParameter=e.workbookParameter??void 0;t.xlm=e.xlm??void 0;return t}};function kPt(){return{names:[]}}var Qfe={encode(e,t=new tn){for(const n of e.names){Jfe.encode(n,t.uint32(10).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=kPt();while(n.pos>>3){case 1:{if(o!==10){break}i.names.push(Jfe.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Qfe.fromPartial(e??{})},fromPartial(e){const t=kPt();t.names=e.names?.map(n=>Jfe.fromPartial(n))||[];return t}};function RPt(){return{rowId:"",colId:"",colOffset:"",rowOffset:""}}var bp={encode(e,t=new tn){if(e.rowId!==""){t.uint32(10).string(e.rowId)}if(e.colId!==""){t.uint32(18).string(e.colId)}if(e.colOffset!==""){t.uint32(26).string(e.colOffset)}if(e.rowOffset!==""){t.uint32(34).string(e.rowOffset)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=RPt();while(n.pos>>3){case 1:{if(o!==10){break}i.rowId=n.string();continue}case 2:{if(o!==18){break}i.colId=n.string();continue}case 3:{if(o!==26){break}i.colOffset=n.string();continue}case 4:{if(o!==34){break}i.rowOffset=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return bp.fromPartial(e??{})},fromPartial(e){const t=RPt();t.rowId=e.rowId??"";t.colId=e.colId??"";t.colOffset=e.colOffset??"";t.rowOffset=e.rowOffset??"";return t}};function PPt(){return{fromAnchor:void 0,toAnchor:void 0,chart:void 0,imageReference:void 0,extentCx:void 0,extentCy:void 0,shape:void 0}}var ehe={encode(e,t=new tn){if(e.fromAnchor!==void 0){bp.encode(e.fromAnchor,t.uint32(10).fork()).join()}if(e.toAnchor!==void 0){bp.encode(e.toAnchor,t.uint32(18).fork()).join()}if(e.chart!==void 0){dm.encode(e.chart,t.uint32(26).fork()).join()}if(e.imageReference!==void 0){v0.encode(e.imageReference,t.uint32(34).fork()).join()}if(e.extentCx!==void 0){t.uint32(42).string(e.extentCx)}if(e.extentCy!==void 0){t.uint32(50).string(e.extentCy)}if(e.shape!==void 0){fl.encode(e.shape,t.uint32(58).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=PPt();while(n.pos>>3){case 1:{if(o!==10){break}i.fromAnchor=bp.decode(n,n.uint32());continue}case 2:{if(o!==18){break}i.toAnchor=bp.decode(n,n.uint32());continue}case 3:{if(o!==26){break}i.chart=dm.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.imageReference=v0.decode(n,n.uint32());continue}case 5:{if(o!==42){break}i.extentCx=n.string();continue}case 6:{if(o!==50){break}i.extentCy=n.string();continue}case 7:{if(o!==58){break}i.shape=fl.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return ehe.fromPartial(e??{})},fromPartial(e){const t=PPt();t.fromAnchor=e.fromAnchor!==void 0&&e.fromAnchor!==null?bp.fromPartial(e.fromAnchor):void 0;t.toAnchor=e.toAnchor!==void 0&&e.toAnchor!==null?bp.fromPartial(e.toAnchor):void 0;t.chart=e.chart!==void 0&&e.chart!==null?dm.fromPartial(e.chart):void 0;t.imageReference=e.imageReference!==void 0&&e.imageReference!==null?v0.fromPartial(e.imageReference):void 0;t.extentCx=e.extentCx??void 0;t.extentCy=e.extentCy??void 0;t.shape=e.shape!==void 0&&e.shape!==null?fl.fromPartial(e.shape):void 0;return t}};function IPt(){return{password:void 0,algorithmName:void 0,hashValue:void 0,saltValue:void 0,spinCount:void 0,sheet:void 0,objects:void 0,scenarios:void 0,formatCells:void 0,formatColumns:void 0,formatRows:void 0,insertColumns:void 0,insertRows:void 0,insertHyperlinks:void 0,deleteColumns:void 0,deleteRows:void 0,selectLockedCells:void 0,sort:void 0,autoFilter:void 0,pivotTables:void 0,selectUnlockedCells:void 0}}var the={encode(e,t=new tn){if(e.password!==void 0){t.uint32(10).bytes(e.password)}if(e.algorithmName!==void 0){t.uint32(18).string(e.algorithmName)}if(e.hashValue!==void 0){t.uint32(26).string(e.hashValue)}if(e.saltValue!==void 0){t.uint32(34).string(e.saltValue)}if(e.spinCount!==void 0){t.uint32(40).uint32(e.spinCount)}if(e.sheet!==void 0){t.uint32(48).bool(e.sheet)}if(e.objects!==void 0){t.uint32(56).bool(e.objects)}if(e.scenarios!==void 0){t.uint32(64).bool(e.scenarios)}if(e.formatCells!==void 0){t.uint32(72).bool(e.formatCells)}if(e.formatColumns!==void 0){t.uint32(80).bool(e.formatColumns)}if(e.formatRows!==void 0){t.uint32(88).bool(e.formatRows)}if(e.insertColumns!==void 0){t.uint32(96).bool(e.insertColumns)}if(e.insertRows!==void 0){t.uint32(104).bool(e.insertRows)}if(e.insertHyperlinks!==void 0){t.uint32(112).bool(e.insertHyperlinks)}if(e.deleteColumns!==void 0){t.uint32(120).bool(e.deleteColumns)}if(e.deleteRows!==void 0){t.uint32(128).bool(e.deleteRows)}if(e.selectLockedCells!==void 0){t.uint32(136).bool(e.selectLockedCells)}if(e.sort!==void 0){t.uint32(144).bool(e.sort)}if(e.autoFilter!==void 0){t.uint32(152).bool(e.autoFilter)}if(e.pivotTables!==void 0){t.uint32(160).bool(e.pivotTables)}if(e.selectUnlockedCells!==void 0){t.uint32(168).bool(e.selectUnlockedCells)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=IPt();while(n.pos>>3){case 1:{if(o!==10){break}i.password=n.bytes();continue}case 2:{if(o!==18){break}i.algorithmName=n.string();continue}case 3:{if(o!==26){break}i.hashValue=n.string();continue}case 4:{if(o!==34){break}i.saltValue=n.string();continue}case 5:{if(o!==40){break}i.spinCount=n.uint32();continue}case 6:{if(o!==48){break}i.sheet=n.bool();continue}case 7:{if(o!==56){break}i.objects=n.bool();continue}case 8:{if(o!==64){break}i.scenarios=n.bool();continue}case 9:{if(o!==72){break}i.formatCells=n.bool();continue}case 10:{if(o!==80){break}i.formatColumns=n.bool();continue}case 11:{if(o!==88){break}i.formatRows=n.bool();continue}case 12:{if(o!==96){break}i.insertColumns=n.bool();continue}case 13:{if(o!==104){break}i.insertRows=n.bool();continue}case 14:{if(o!==112){break}i.insertHyperlinks=n.bool();continue}case 15:{if(o!==120){break}i.deleteColumns=n.bool();continue}case 16:{if(o!==128){break}i.deleteRows=n.bool();continue}case 17:{if(o!==136){break}i.selectLockedCells=n.bool();continue}case 18:{if(o!==144){break}i.sort=n.bool();continue}case 19:{if(o!==152){break}i.autoFilter=n.bool();continue}case 20:{if(o!==160){break}i.pivotTables=n.bool();continue}case 21:{if(o!==168){break}i.selectUnlockedCells=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return the.fromPartial(e??{})},fromPartial(e){const t=IPt();t.password=e.password??void 0;t.algorithmName=e.algorithmName??void 0;t.hashValue=e.hashValue??void 0;t.saltValue=e.saltValue??void 0;t.spinCount=e.spinCount??void 0;t.sheet=e.sheet??void 0;t.objects=e.objects??void 0;t.scenarios=e.scenarios??void 0;t.formatCells=e.formatCells??void 0;t.formatColumns=e.formatColumns??void 0;t.formatRows=e.formatRows??void 0;t.insertColumns=e.insertColumns??void 0;t.insertRows=e.insertRows??void 0;t.insertHyperlinks=e.insertHyperlinks??void 0;t.deleteColumns=e.deleteColumns??void 0;t.deleteRows=e.deleteRows??void 0;t.selectLockedCells=e.selectLockedCells??void 0;t.sort=e.sort??void 0;t.autoFilter=e.autoFilter??void 0;t.pivotTables=e.pivotTables??void 0;t.selectUnlockedCells=e.selectUnlockedCells??void 0;return t}};function MPt(){return{id:void 0,sheetId:void 0,index:0,name:"",rows:[],innerXml:"",outerXml:"",columns:[],defaultRowHeight:0,drawings:[],defaultColWidth:0,baseColWidth:void 0,showGridLines:void 0,mergedCells:[],conditionalFormattings:[],sharedFormulas:[],tables:[],pivotTables:[],slicers:[],tabColor:void 0,timelines:[],sparklineGroups:void 0,dataValidations:void 0,dimensionRef:void 0,autoFilter:void 0,sortState:void 0,sheetProtection:void 0}}var nhe={encode(e,t=new tn){if(e.id!==void 0){t.uint32(90).string(e.id)}if(e.sheetId!==void 0){t.uint32(162).string(e.sheetId)}if(e.index!==0){t.uint32(8).int32(e.index)}if(e.name!==""){t.uint32(18).string(e.name)}for(const n of e.rows){lhe.encode(n,t.uint32(26).fork()).join()}if(e.innerXml!==""){t.uint32(34).string(e.innerXml)}if(e.outerXml!==""){t.uint32(42).string(e.outerXml)}for(const n of e.columns){dhe.encode(n,t.uint32(50).fork()).join()}if(e.defaultRowHeight!==0){t.uint32(61).float(e.defaultRowHeight)}for(const n of e.drawings){ehe.encode(n,t.uint32(66).fork()).join()}if(e.defaultColWidth!==0){t.uint32(77).float(e.defaultColWidth)}if(e.baseColWidth!==void 0){t.uint32(173).float(e.baseColWidth)}if(e.showGridLines!==void 0){t.uint32(80).bool(e.showGridLines)}for(const n of e.mergedCells){oE.encode(n,t.uint32(98).fork()).join()}for(const n of e.conditionalFormattings){Ehe.encode(n,t.uint32(106).fork()).join()}for(const n of e.sharedFormulas){uhe.encode(n,t.uint32(114).fork()).join()}for(const n of e.tables){Ohe.encode(n,t.uint32(122).fork()).join()}for(const n of e.pivotTables){Qhe.encode(n,t.uint32(130).fork()).join()}for(const n of e.slicers){epe.encode(n,t.uint32(138).fork()).join()}if(e.tabColor!==void 0){hi.encode(e.tabColor,t.uint32(146).fork()).join()}for(const n of e.timelines){Bhe.encode(n,t.uint32(154).fork()).join()}if(e.sparklineGroups!==void 0){rhe.encode(e.sparklineGroups,t.uint32(218).fork()).join()}if(e.dataValidations!==void 0){ahe.encode(e.dataValidations,t.uint32(226).fork()).join()}if(e.dimensionRef!==void 0){t.uint32(234).string(e.dimensionRef)}if(e.autoFilter!==void 0){lE.encode(e.autoFilter,t.uint32(242).fork()).join()}if(e.sortState!==void 0){sE.encode(e.sortState,t.uint32(250).fork()).join()}if(e.sheetProtection!==void 0){the.encode(e.sheetProtection,t.uint32(258).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=MPt();while(n.pos>>3){case 11:{if(o!==90){break}i.id=n.string();continue}case 20:{if(o!==162){break}i.sheetId=n.string();continue}case 1:{if(o!==8){break}i.index=n.int32();continue}case 2:{if(o!==18){break}i.name=n.string();continue}case 3:{if(o!==26){break}i.rows.push(lhe.decode(n,n.uint32()));continue}case 4:{if(o!==34){break}i.innerXml=n.string();continue}case 5:{if(o!==42){break}i.outerXml=n.string();continue}case 6:{if(o!==50){break}i.columns.push(dhe.decode(n,n.uint32()));continue}case 7:{if(o!==61){break}i.defaultRowHeight=n.float();continue}case 8:{if(o!==66){break}i.drawings.push(ehe.decode(n,n.uint32()));continue}case 9:{if(o!==77){break}i.defaultColWidth=n.float();continue}case 21:{if(o!==173){break}i.baseColWidth=n.float();continue}case 10:{if(o!==80){break}i.showGridLines=n.bool();continue}case 12:{if(o!==98){break}i.mergedCells.push(oE.decode(n,n.uint32()));continue}case 13:{if(o!==106){break}i.conditionalFormattings.push(Ehe.decode(n,n.uint32()));continue}case 14:{if(o!==114){break}i.sharedFormulas.push(uhe.decode(n,n.uint32()));continue}case 15:{if(o!==122){break}i.tables.push(Ohe.decode(n,n.uint32()));continue}case 16:{if(o!==130){break}i.pivotTables.push(Qhe.decode(n,n.uint32()));continue}case 17:{if(o!==138){break}i.slicers.push(epe.decode(n,n.uint32()));continue}case 18:{if(o!==146){break}i.tabColor=hi.decode(n,n.uint32());continue}case 19:{if(o!==154){break}i.timelines.push(Bhe.decode(n,n.uint32()));continue}case 27:{if(o!==218){break}i.sparklineGroups=rhe.decode(n,n.uint32());continue}case 28:{if(o!==226){break}i.dataValidations=ahe.decode(n,n.uint32());continue}case 29:{if(o!==234){break}i.dimensionRef=n.string();continue}case 30:{if(o!==242){break}i.autoFilter=lE.decode(n,n.uint32());continue}case 31:{if(o!==250){break}i.sortState=sE.decode(n,n.uint32());continue}case 32:{if(o!==258){break}i.sheetProtection=the.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return nhe.fromPartial(e??{})},fromPartial(e){const t=MPt();t.id=e.id??void 0;t.sheetId=e.sheetId??void 0;t.index=e.index??0;t.name=e.name??"";t.rows=e.rows?.map(n=>lhe.fromPartial(n))||[];t.innerXml=e.innerXml??"";t.outerXml=e.outerXml??"";t.columns=e.columns?.map(n=>dhe.fromPartial(n))||[];t.defaultRowHeight=e.defaultRowHeight??0;t.drawings=e.drawings?.map(n=>ehe.fromPartial(n))||[];t.defaultColWidth=e.defaultColWidth??0;t.baseColWidth=e.baseColWidth??void 0;t.showGridLines=e.showGridLines??void 0;t.mergedCells=e.mergedCells?.map(n=>oE.fromPartial(n))||[];t.conditionalFormattings=e.conditionalFormattings?.map(n=>Ehe.fromPartial(n))||[];t.sharedFormulas=e.sharedFormulas?.map(n=>uhe.fromPartial(n))||[];t.tables=e.tables?.map(n=>Ohe.fromPartial(n))||[];t.pivotTables=e.pivotTables?.map(n=>Qhe.fromPartial(n))||[];t.slicers=e.slicers?.map(n=>epe.fromPartial(n))||[];t.tabColor=e.tabColor!==void 0&&e.tabColor!==null?hi.fromPartial(e.tabColor):void 0;t.timelines=e.timelines?.map(n=>Bhe.fromPartial(n))||[];t.sparklineGroups=e.sparklineGroups!==void 0&&e.sparklineGroups!==null?rhe.fromPartial(e.sparklineGroups):void 0;t.dataValidations=e.dataValidations!==void 0&&e.dataValidations!==null?ahe.fromPartial(e.dataValidations):void 0;t.dimensionRef=e.dimensionRef??void 0;t.autoFilter=e.autoFilter!==void 0&&e.autoFilter!==null?lE.fromPartial(e.autoFilter):void 0;t.sortState=e.sortState!==void 0&&e.sortState!==null?sE.fromPartial(e.sortState):void 0;t.sheetProtection=e.sheetProtection!==void 0&&e.sheetProtection!==null?the.fromPartial(e.sheetProtection):void 0;return t}};function LPt(){return{groups:[]}}var rhe={encode(e,t=new tn){for(const n of e.groups){ohe.encode(n,t.uint32(10).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=LPt();while(n.pos>>3){case 1:{if(o!==10){break}i.groups.push(ohe.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return rhe.fromPartial(e??{})},fromPartial(e){const t=LPt();t.groups=e.groups?.map(n=>ohe.fromPartial(n))||[];return t}};function DPt(){return{formula:void 0,reference:void 0}}var ihe={encode(e,t=new tn){if(e.formula!==void 0){t.uint32(10).string(e.formula)}if(e.reference!==void 0){t.uint32(18).string(e.reference)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=DPt();while(n.pos>>3){case 1:{if(o!==10){break}i.formula=n.string();continue}case 2:{if(o!==18){break}i.reference=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return ihe.fromPartial(e??{})},fromPartial(e){const t=DPt();t.formula=e.formula??void 0;t.reference=e.reference??void 0;return t}};function FPt(){return{uid:void 0,manualMax:void 0,manualMin:void 0,lineWeight:void 0,type:void 0,dateAxis:void 0,displayEmptyCellsAs:void 0,markers:void 0,high:void 0,low:void 0,first:void 0,last:void 0,negative:void 0,displayXAxis:void 0,displayHidden:void 0,minAxisType:void 0,maxAxisType:void 0,rightToLeft:void 0,seriesColor:void 0,negativeColor:void 0,axisColor:void 0,markersColor:void 0,firstMarkerColor:void 0,lastMarkerColor:void 0,highMarkerColor:void 0,lowMarkerColor:void 0,formula:void 0,sparklines:[]}}var ohe={encode(e,t=new tn){if(e.uid!==void 0){t.uint32(10).string(e.uid)}if(e.manualMax!==void 0){t.uint32(17).double(e.manualMax)}if(e.manualMin!==void 0){t.uint32(25).double(e.manualMin)}if(e.lineWeight!==void 0){t.uint32(33).double(e.lineWeight)}if(e.type!==void 0){t.uint32(40).int32(e.type)}if(e.dateAxis!==void 0){t.uint32(48).bool(e.dateAxis)}if(e.displayEmptyCellsAs!==void 0){t.uint32(56).int32(e.displayEmptyCellsAs)}if(e.markers!==void 0){t.uint32(64).bool(e.markers)}if(e.high!==void 0){t.uint32(72).bool(e.high)}if(e.low!==void 0){t.uint32(80).bool(e.low)}if(e.first!==void 0){t.uint32(88).bool(e.first)}if(e.last!==void 0){t.uint32(96).bool(e.last)}if(e.negative!==void 0){t.uint32(104).bool(e.negative)}if(e.displayXAxis!==void 0){t.uint32(112).bool(e.displayXAxis)}if(e.displayHidden!==void 0){t.uint32(120).bool(e.displayHidden)}if(e.minAxisType!==void 0){t.uint32(128).int32(e.minAxisType)}if(e.maxAxisType!==void 0){t.uint32(136).int32(e.maxAxisType)}if(e.rightToLeft!==void 0){t.uint32(144).bool(e.rightToLeft)}if(e.seriesColor!==void 0){hi.encode(e.seriesColor,t.uint32(154).fork()).join()}if(e.negativeColor!==void 0){hi.encode(e.negativeColor,t.uint32(162).fork()).join()}if(e.axisColor!==void 0){hi.encode(e.axisColor,t.uint32(170).fork()).join()}if(e.markersColor!==void 0){hi.encode(e.markersColor,t.uint32(178).fork()).join()}if(e.firstMarkerColor!==void 0){hi.encode(e.firstMarkerColor,t.uint32(186).fork()).join()}if(e.lastMarkerColor!==void 0){hi.encode(e.lastMarkerColor,t.uint32(194).fork()).join()}if(e.highMarkerColor!==void 0){hi.encode(e.highMarkerColor,t.uint32(202).fork()).join()}if(e.lowMarkerColor!==void 0){hi.encode(e.lowMarkerColor,t.uint32(210).fork()).join()}if(e.formula!==void 0){t.uint32(218).string(e.formula)}for(const n of e.sparklines){ihe.encode(n,t.uint32(226).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=FPt();while(n.pos>>3){case 1:{if(o!==10){break}i.uid=n.string();continue}case 2:{if(o!==17){break}i.manualMax=n.double();continue}case 3:{if(o!==25){break}i.manualMin=n.double();continue}case 4:{if(o!==33){break}i.lineWeight=n.double();continue}case 5:{if(o!==40){break}i.type=n.int32();continue}case 6:{if(o!==48){break}i.dateAxis=n.bool();continue}case 7:{if(o!==56){break}i.displayEmptyCellsAs=n.int32();continue}case 8:{if(o!==64){break}i.markers=n.bool();continue}case 9:{if(o!==72){break}i.high=n.bool();continue}case 10:{if(o!==80){break}i.low=n.bool();continue}case 11:{if(o!==88){break}i.first=n.bool();continue}case 12:{if(o!==96){break}i.last=n.bool();continue}case 13:{if(o!==104){break}i.negative=n.bool();continue}case 14:{if(o!==112){break}i.displayXAxis=n.bool();continue}case 15:{if(o!==120){break}i.displayHidden=n.bool();continue}case 16:{if(o!==128){break}i.minAxisType=n.int32();continue}case 17:{if(o!==136){break}i.maxAxisType=n.int32();continue}case 18:{if(o!==144){break}i.rightToLeft=n.bool();continue}case 19:{if(o!==154){break}i.seriesColor=hi.decode(n,n.uint32());continue}case 20:{if(o!==162){break}i.negativeColor=hi.decode(n,n.uint32());continue}case 21:{if(o!==170){break}i.axisColor=hi.decode(n,n.uint32());continue}case 22:{if(o!==178){break}i.markersColor=hi.decode(n,n.uint32());continue}case 23:{if(o!==186){break}i.firstMarkerColor=hi.decode(n,n.uint32());continue}case 24:{if(o!==194){break}i.lastMarkerColor=hi.decode(n,n.uint32());continue}case 25:{if(o!==202){break}i.highMarkerColor=hi.decode(n,n.uint32());continue}case 26:{if(o!==210){break}i.lowMarkerColor=hi.decode(n,n.uint32());continue}case 27:{if(o!==218){break}i.formula=n.string();continue}case 28:{if(o!==226){break}i.sparklines.push(ihe.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return ohe.fromPartial(e??{})},fromPartial(e){const t=FPt();t.uid=e.uid??void 0;t.manualMax=e.manualMax??void 0;t.manualMin=e.manualMin??void 0;t.lineWeight=e.lineWeight??void 0;t.type=e.type??void 0;t.dateAxis=e.dateAxis??void 0;t.displayEmptyCellsAs=e.displayEmptyCellsAs??void 0;t.markers=e.markers??void 0;t.high=e.high??void 0;t.low=e.low??void 0;t.first=e.first??void 0;t.last=e.last??void 0;t.negative=e.negative??void 0;t.displayXAxis=e.displayXAxis??void 0;t.displayHidden=e.displayHidden??void 0;t.minAxisType=e.minAxisType??void 0;t.maxAxisType=e.maxAxisType??void 0;t.rightToLeft=e.rightToLeft??void 0;t.seriesColor=e.seriesColor!==void 0&&e.seriesColor!==null?hi.fromPartial(e.seriesColor):void 0;t.negativeColor=e.negativeColor!==void 0&&e.negativeColor!==null?hi.fromPartial(e.negativeColor):void 0;t.axisColor=e.axisColor!==void 0&&e.axisColor!==null?hi.fromPartial(e.axisColor):void 0;t.markersColor=e.markersColor!==void 0&&e.markersColor!==null?hi.fromPartial(e.markersColor):void 0;t.firstMarkerColor=e.firstMarkerColor!==void 0&&e.firstMarkerColor!==null?hi.fromPartial(e.firstMarkerColor):void 0;t.lastMarkerColor=e.lastMarkerColor!==void 0&&e.lastMarkerColor!==null?hi.fromPartial(e.lastMarkerColor):void 0;t.highMarkerColor=e.highMarkerColor!==void 0&&e.highMarkerColor!==null?hi.fromPartial(e.highMarkerColor):void 0;t.lowMarkerColor=e.lowMarkerColor!==void 0&&e.lowMarkerColor!==null?hi.fromPartial(e.lowMarkerColor):void 0;t.formula=e.formula??void 0;t.sparklines=e.sparklines?.map(n=>ihe.fromPartial(n))||[];return t}};function NPt(){return{items:[]}}var ahe={encode(e,t=new tn){for(const n of e.items){she.encode(n,t.uint32(10).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=NPt();while(n.pos>>3){case 1:{if(o!==10){break}i.items.push(she.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return ahe.fromPartial(e??{})},fromPartial(e){const t=NPt();t.items=e.items?.map(n=>she.fromPartial(n))||[];return t}};function OPt(){return{sqref:"",type:void 0,errorStyle:void 0,imeMode:void 0,operator:void 0,allowBlank:void 0,showDropDown:void 0,showInputMessage:void 0,showErrorMessage:void 0,errorTitle:void 0,errorMessage:void 0,promptTitle:void 0,promptMessage:void 0,formula1:void 0,formula2:void 0,uid:void 0}}var she={encode(e,t=new tn){if(e.sqref!==""){t.uint32(10).string(e.sqref)}if(e.type!==void 0){t.uint32(16).int32(e.type)}if(e.errorStyle!==void 0){t.uint32(24).int32(e.errorStyle)}if(e.imeMode!==void 0){t.uint32(32).int32(e.imeMode)}if(e.operator!==void 0){t.uint32(40).int32(e.operator)}if(e.allowBlank!==void 0){t.uint32(48).bool(e.allowBlank)}if(e.showDropDown!==void 0){t.uint32(56).bool(e.showDropDown)}if(e.showInputMessage!==void 0){t.uint32(64).bool(e.showInputMessage)}if(e.showErrorMessage!==void 0){t.uint32(72).bool(e.showErrorMessage)}if(e.errorTitle!==void 0){t.uint32(82).string(e.errorTitle)}if(e.errorMessage!==void 0){t.uint32(90).string(e.errorMessage)}if(e.promptTitle!==void 0){t.uint32(98).string(e.promptTitle)}if(e.promptMessage!==void 0){t.uint32(106).string(e.promptMessage)}if(e.formula1!==void 0){t.uint32(114).string(e.formula1)}if(e.formula2!==void 0){t.uint32(122).string(e.formula2)}if(e.uid!==void 0){t.uint32(130).string(e.uid)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=OPt();while(n.pos>>3){case 1:{if(o!==10){break}i.sqref=n.string();continue}case 2:{if(o!==16){break}i.type=n.int32();continue}case 3:{if(o!==24){break}i.errorStyle=n.int32();continue}case 4:{if(o!==32){break}i.imeMode=n.int32();continue}case 5:{if(o!==40){break}i.operator=n.int32();continue}case 6:{if(o!==48){break}i.allowBlank=n.bool();continue}case 7:{if(o!==56){break}i.showDropDown=n.bool();continue}case 8:{if(o!==64){break}i.showInputMessage=n.bool();continue}case 9:{if(o!==72){break}i.showErrorMessage=n.bool();continue}case 10:{if(o!==82){break}i.errorTitle=n.string();continue}case 11:{if(o!==90){break}i.errorMessage=n.string();continue}case 12:{if(o!==98){break}i.promptTitle=n.string();continue}case 13:{if(o!==106){break}i.promptMessage=n.string();continue}case 14:{if(o!==114){break}i.formula1=n.string();continue}case 15:{if(o!==122){break}i.formula2=n.string();continue}case 16:{if(o!==130){break}i.uid=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return she.fromPartial(e??{})},fromPartial(e){const t=OPt();t.sqref=e.sqref??"";t.type=e.type??void 0;t.errorStyle=e.errorStyle??void 0;t.imeMode=e.imeMode??void 0;t.operator=e.operator??void 0;t.allowBlank=e.allowBlank??void 0;t.showDropDown=e.showDropDown??void 0;t.showInputMessage=e.showInputMessage??void 0;t.showErrorMessage=e.showErrorMessage??void 0;t.errorTitle=e.errorTitle??void 0;t.errorMessage=e.errorMessage??void 0;t.promptTitle=e.promptTitle??void 0;t.promptMessage=e.promptMessage??void 0;t.formula1=e.formula1??void 0;t.formula2=e.formula2??void 0;t.uid=e.uid??void 0;return t}};function BPt(){return{index:0,cells:[],height:0,customHeight:false,styleIndex:void 0,hidden:void 0}}var lhe={encode(e,t=new tn){if(e.index!==0){t.uint32(8).int32(e.index)}for(const n of e.cells){che.encode(n,t.uint32(18).fork()).join()}if(e.height!==0){t.uint32(29).float(e.height)}if(e.customHeight!==false){t.uint32(32).bool(e.customHeight)}if(e.styleIndex!==void 0){t.uint32(40).int32(e.styleIndex)}if(e.hidden!==void 0){t.uint32(48).bool(e.hidden)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=BPt();while(n.pos>>3){case 1:{if(o!==8){break}i.index=n.int32();continue}case 2:{if(o!==18){break}i.cells.push(che.decode(n,n.uint32()));continue}case 3:{if(o!==29){break}i.height=n.float();continue}case 4:{if(o!==32){break}i.customHeight=n.bool();continue}case 5:{if(o!==40){break}i.styleIndex=n.int32();continue}case 6:{if(o!==48){break}i.hidden=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return lhe.fromPartial(e??{})},fromPartial(e){const t=BPt();t.index=e.index??0;t.cells=e.cells?.map(n=>che.fromPartial(n))||[];t.height=e.height??0;t.customHeight=e.customHeight??false;t.styleIndex=e.styleIndex??void 0;t.hidden=e.hidden??void 0;return t}};function zPt(){return{address:"",value:void 0,formula:void 0,dataType:0,styleIndex:void 0,paragraphs:[],textStyle:void 0,sharedFormulaSi:void 0,formulaType:void 0,formulaRef:void 0,formulaAlwaysCalculateArray:void 0,formulaCalculateCell:void 0,cellMetadataIndex:void 0,dataTableRowInput:void 0,dataTableColumnInput:void 0,dataTableRowOriented:void 0,dataTableTwoVariable:void 0,valueMetadataIndex:void 0,hyperlink:void 0}}var che={encode(e,t=new tn){if(e.address!==""){t.uint32(10).string(e.address)}if(e.value!==void 0){t.uint32(18).string(e.value)}if(e.formula!==void 0){t.uint32(26).string(e.formula)}if(e.dataType!==0){t.uint32(32).int32(e.dataType)}if(e.styleIndex!==void 0){t.uint32(40).int32(e.styleIndex)}for(const n of e.paragraphs){jd.encode(n,t.uint32(50).fork()).join()}if(e.textStyle!==void 0){Gi.encode(e.textStyle,t.uint32(58).fork()).join()}if(e.sharedFormulaSi!==void 0){t.uint32(64).int32(e.sharedFormulaSi)}if(e.formulaType!==void 0){t.uint32(72).int32(e.formulaType)}if(e.formulaRef!==void 0){t.uint32(82).string(e.formulaRef)}if(e.formulaAlwaysCalculateArray!==void 0){t.uint32(88).bool(e.formulaAlwaysCalculateArray)}if(e.formulaCalculateCell!==void 0){t.uint32(152).bool(e.formulaCalculateCell)}if(e.cellMetadataIndex!==void 0){t.uint32(96).int32(e.cellMetadataIndex)}if(e.dataTableRowInput!==void 0){t.uint32(106).string(e.dataTableRowInput)}if(e.dataTableColumnInput!==void 0){t.uint32(114).string(e.dataTableColumnInput)}if(e.dataTableRowOriented!==void 0){t.uint32(120).bool(e.dataTableRowOriented)}if(e.dataTableTwoVariable!==void 0){t.uint32(128).bool(e.dataTableTwoVariable)}if(e.valueMetadataIndex!==void 0){t.uint32(136).int32(e.valueMetadataIndex)}if(e.hyperlink!==void 0){ET.encode(e.hyperlink,t.uint32(146).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=zPt();while(n.pos>>3){case 1:{if(o!==10){break}i.address=n.string();continue}case 2:{if(o!==18){break}i.value=n.string();continue}case 3:{if(o!==26){break}i.formula=n.string();continue}case 4:{if(o!==32){break}i.dataType=n.int32();continue}case 5:{if(o!==40){break}i.styleIndex=n.int32();continue}case 6:{if(o!==50){break}i.paragraphs.push(jd.decode(n,n.uint32()));continue}case 7:{if(o!==58){break}i.textStyle=Gi.decode(n,n.uint32());continue}case 8:{if(o!==64){break}i.sharedFormulaSi=n.int32();continue}case 9:{if(o!==72){break}i.formulaType=n.int32();continue}case 10:{if(o!==82){break}i.formulaRef=n.string();continue}case 11:{if(o!==88){break}i.formulaAlwaysCalculateArray=n.bool();continue}case 19:{if(o!==152){break}i.formulaCalculateCell=n.bool();continue}case 12:{if(o!==96){break}i.cellMetadataIndex=n.int32();continue}case 13:{if(o!==106){break}i.dataTableRowInput=n.string();continue}case 14:{if(o!==114){break}i.dataTableColumnInput=n.string();continue}case 15:{if(o!==120){break}i.dataTableRowOriented=n.bool();continue}case 16:{if(o!==128){break}i.dataTableTwoVariable=n.bool();continue}case 17:{if(o!==136){break}i.valueMetadataIndex=n.int32();continue}case 18:{if(o!==146){break}i.hyperlink=ET.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return che.fromPartial(e??{})},fromPartial(e){const t=zPt();t.address=e.address??"";t.value=e.value??void 0;t.formula=e.formula??void 0;t.dataType=e.dataType??0;t.styleIndex=e.styleIndex??void 0;t.paragraphs=e.paragraphs?.map(n=>jd.fromPartial(n))||[];t.textStyle=e.textStyle!==void 0&&e.textStyle!==null?Gi.fromPartial(e.textStyle):void 0;t.sharedFormulaSi=e.sharedFormulaSi??void 0;t.formulaType=e.formulaType??void 0;t.formulaRef=e.formulaRef??void 0;t.formulaAlwaysCalculateArray=e.formulaAlwaysCalculateArray??void 0;t.formulaCalculateCell=e.formulaCalculateCell??void 0;t.cellMetadataIndex=e.cellMetadataIndex??void 0;t.dataTableRowInput=e.dataTableRowInput??void 0;t.dataTableColumnInput=e.dataTableColumnInput??void 0;t.dataTableRowOriented=e.dataTableRowOriented??void 0;t.dataTableTwoVariable=e.dataTableTwoVariable??void 0;t.valueMetadataIndex=e.valueMetadataIndex??void 0;t.hyperlink=e.hyperlink!==void 0&&e.hyperlink!==null?ET.fromPartial(e.hyperlink):void 0;return t}};function UPt(){return{si:0,base:"",anchor:""}}var uhe={encode(e,t=new tn){if(e.si!==0){t.uint32(8).int32(e.si)}if(e.base!==""){t.uint32(18).string(e.base)}if(e.anchor!==""){t.uint32(26).string(e.anchor)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=UPt();while(n.pos>>3){case 1:{if(o!==8){break}i.si=n.int32();continue}case 2:{if(o!==18){break}i.base=n.string();continue}case 3:{if(o!==26){break}i.anchor=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return uhe.fromPartial(e??{})},fromPartial(e){const t=UPt();t.si=e.si??0;t.base=e.base??"";t.anchor=e.anchor??"";return t}};function VPt(){return{min:0,max:0,width:0,customWidth:false,styleIndex:void 0,hidden:void 0}}var dhe={encode(e,t=new tn){if(e.min!==0){t.uint32(8).int32(e.min)}if(e.max!==0){t.uint32(16).int32(e.max)}if(e.width!==0){t.uint32(29).float(e.width)}if(e.customWidth!==false){t.uint32(32).bool(e.customWidth)}if(e.styleIndex!==void 0){t.uint32(40).int32(e.styleIndex)}if(e.hidden!==void 0){t.uint32(48).bool(e.hidden)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=VPt();while(n.pos>>3){case 1:{if(o!==8){break}i.min=n.int32();continue}case 2:{if(o!==16){break}i.max=n.int32();continue}case 3:{if(o!==29){break}i.width=n.float();continue}case 4:{if(o!==32){break}i.customWidth=n.bool();continue}case 5:{if(o!==40){break}i.styleIndex=n.int32();continue}case 6:{if(o!==48){break}i.hidden=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return dhe.fromPartial(e??{})},fromPartial(e){const t=VPt();t.min=e.min??0;t.max=e.max??0;t.width=e.width??0;t.customWidth=e.customWidth??false;t.styleIndex=e.styleIndex??void 0;t.hidden=e.hidden??void 0;return t}};function $Pt(){return{style:"",color:void 0,indexedColorId:void 0}}var by={encode(e,t=new tn){if(e.style!==""){t.uint32(10).string(e.style)}if(e.color!==void 0){hi.encode(e.color,t.uint32(18).fork()).join()}if(e.indexedColorId!==void 0){t.uint32(24).int32(e.indexedColorId)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=$Pt();while(n.pos>>3){case 1:{if(o!==10){break}i.style=n.string();continue}case 2:{if(o!==18){break}i.color=hi.decode(n,n.uint32());continue}case 3:{if(o!==24){break}i.indexedColorId=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return by.fromPartial(e??{})},fromPartial(e){const t=$Pt();t.style=e.style??"";t.color=e.color!==void 0&&e.color!==null?hi.fromPartial(e.color):void 0;t.indexedColorId=e.indexedColorId??void 0;return t}};function GPt(){return{left:void 0,right:void 0,top:void 0,bottom:void 0,diagonal:void 0,diagonalUp:void 0,diagonalDown:void 0}}var Q4={encode(e,t=new tn){if(e.left!==void 0){by.encode(e.left,t.uint32(10).fork()).join()}if(e.right!==void 0){by.encode(e.right,t.uint32(18).fork()).join()}if(e.top!==void 0){by.encode(e.top,t.uint32(26).fork()).join()}if(e.bottom!==void 0){by.encode(e.bottom,t.uint32(34).fork()).join()}if(e.diagonal!==void 0){by.encode(e.diagonal,t.uint32(42).fork()).join()}if(e.diagonalUp!==void 0){t.uint32(48).bool(e.diagonalUp)}if(e.diagonalDown!==void 0){t.uint32(56).bool(e.diagonalDown)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=GPt();while(n.pos>>3){case 1:{if(o!==10){break}i.left=by.decode(n,n.uint32());continue}case 2:{if(o!==18){break}i.right=by.decode(n,n.uint32());continue}case 3:{if(o!==26){break}i.top=by.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.bottom=by.decode(n,n.uint32());continue}case 5:{if(o!==42){break}i.diagonal=by.decode(n,n.uint32());continue}case 6:{if(o!==48){break}i.diagonalUp=n.bool();continue}case 7:{if(o!==56){break}i.diagonalDown=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Q4.fromPartial(e??{})},fromPartial(e){const t=GPt();t.left=e.left!==void 0&&e.left!==null?by.fromPartial(e.left):void 0;t.right=e.right!==void 0&&e.right!==null?by.fromPartial(e.right):void 0;t.top=e.top!==void 0&&e.top!==null?by.fromPartial(e.top):void 0;t.bottom=e.bottom!==void 0&&e.bottom!==null?by.fromPartial(e.bottom):void 0;t.diagonal=e.diagonal!==void 0&&e.diagonal!==null?by.fromPartial(e.diagonal):void 0;t.diagonalUp=e.diagonalUp??void 0;t.diagonalDown=e.diagonalDown??void 0;return t}};function HPt(){return{id:0,formatCode:""}}var eN={encode(e,t=new tn){if(e.id!==0){t.uint32(8).int32(e.id)}if(e.formatCode!==""){t.uint32(18).string(e.formatCode)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=HPt();while(n.pos>>3){case 1:{if(o!==8){break}i.id=n.int32();continue}case 2:{if(o!==18){break}i.formatCode=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return eN.fromPartial(e??{})},fromPartial(e){const t=HPt();t.id=e.id??0;t.formatCode=e.formatCode??"";return t}};function WPt(){return{numFmtId:void 0,fontId:void 0,fillId:void 0,borderId:void 0,xfId:void 0,applyFill:void 0,applyFont:void 0,applyBorder:void 0,applyAlignment:void 0,horizontalAlignment:void 0,verticalAlignment:void 0,applyNumberFormat:void 0,applyProtection:void 0,wrapText:void 0,shrinkToFit:void 0,featurePropertyBagIndex:void 0,locked:void 0,formulaHidden:void 0}}var tN={encode(e,t=new tn){if(e.numFmtId!==void 0){t.uint32(8).int32(e.numFmtId)}if(e.fontId!==void 0){t.uint32(16).int32(e.fontId)}if(e.fillId!==void 0){t.uint32(24).int32(e.fillId)}if(e.borderId!==void 0){t.uint32(32).int32(e.borderId)}if(e.xfId!==void 0){t.uint32(40).int32(e.xfId)}if(e.applyFill!==void 0){t.uint32(48).bool(e.applyFill)}if(e.applyFont!==void 0){t.uint32(56).bool(e.applyFont)}if(e.applyBorder!==void 0){t.uint32(64).bool(e.applyBorder)}if(e.applyAlignment!==void 0){t.uint32(72).bool(e.applyAlignment)}if(e.horizontalAlignment!==void 0){t.uint32(82).string(e.horizontalAlignment)}if(e.verticalAlignment!==void 0){t.uint32(90).string(e.verticalAlignment)}if(e.applyNumberFormat!==void 0){t.uint32(96).bool(e.applyNumberFormat)}if(e.applyProtection!==void 0){t.uint32(104).bool(e.applyProtection)}if(e.wrapText!==void 0){t.uint32(112).bool(e.wrapText)}if(e.shrinkToFit!==void 0){t.uint32(120).bool(e.shrinkToFit)}if(e.featurePropertyBagIndex!==void 0){t.uint32(128).uint32(e.featurePropertyBagIndex)}if(e.locked!==void 0){t.uint32(136).bool(e.locked)}if(e.formulaHidden!==void 0){t.uint32(144).bool(e.formulaHidden)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=WPt();while(n.pos>>3){case 1:{if(o!==8){break}i.numFmtId=n.int32();continue}case 2:{if(o!==16){break}i.fontId=n.int32();continue}case 3:{if(o!==24){break}i.fillId=n.int32();continue}case 4:{if(o!==32){break}i.borderId=n.int32();continue}case 5:{if(o!==40){break}i.xfId=n.int32();continue}case 6:{if(o!==48){break}i.applyFill=n.bool();continue}case 7:{if(o!==56){break}i.applyFont=n.bool();continue}case 8:{if(o!==64){break}i.applyBorder=n.bool();continue}case 9:{if(o!==72){break}i.applyAlignment=n.bool();continue}case 10:{if(o!==82){break}i.horizontalAlignment=n.string();continue}case 11:{if(o!==90){break}i.verticalAlignment=n.string();continue}case 12:{if(o!==96){break}i.applyNumberFormat=n.bool();continue}case 13:{if(o!==104){break}i.applyProtection=n.bool();continue}case 14:{if(o!==112){break}i.wrapText=n.bool();continue}case 15:{if(o!==120){break}i.shrinkToFit=n.bool();continue}case 16:{if(o!==128){break}i.featurePropertyBagIndex=n.uint32();continue}case 17:{if(o!==136){break}i.locked=n.bool();continue}case 18:{if(o!==144){break}i.formulaHidden=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return tN.fromPartial(e??{})},fromPartial(e){const t=WPt();t.numFmtId=e.numFmtId??void 0;t.fontId=e.fontId??void 0;t.fillId=e.fillId??void 0;t.borderId=e.borderId??void 0;t.xfId=e.xfId??void 0;t.applyFill=e.applyFill??void 0;t.applyFont=e.applyFont??void 0;t.applyBorder=e.applyBorder??void 0;t.applyAlignment=e.applyAlignment??void 0;t.horizontalAlignment=e.horizontalAlignment??void 0;t.verticalAlignment=e.verticalAlignment??void 0;t.applyNumberFormat=e.applyNumberFormat??void 0;t.applyProtection=e.applyProtection??void 0;t.wrapText=e.wrapText??void 0;t.shrinkToFit=e.shrinkToFit??void 0;t.featurePropertyBagIndex=e.featurePropertyBagIndex??void 0;t.locked=e.locked??void 0;t.formulaHidden=e.formulaHidden??void 0;return t}};function YPt(){return{index:0,format:void 0}}var fhe={encode(e,t=new tn){if(e.index!==0){t.uint32(8).int32(e.index)}if(e.format!==void 0){tN.encode(e.format,t.uint32(18).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=YPt();while(n.pos>>3){case 1:{if(o!==8){break}i.index=n.int32();continue}case 2:{if(o!==18){break}i.format=tN.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return fhe.fromPartial(e??{})},fromPartial(e){const t=YPt();t.index=e.index??0;t.format=e.format!==void 0&&e.format!==null?tN.fromPartial(e.format):void 0;return t}};function qPt(){return{index:0,name:"",builtinId:"",xfId:void 0}}var hhe={encode(e,t=new tn){if(e.index!==0){t.uint32(8).int32(e.index)}if(e.name!==""){t.uint32(18).string(e.name)}if(e.builtinId!==""){t.uint32(26).string(e.builtinId)}if(e.xfId!==void 0){t.uint32(32).int32(e.xfId)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=qPt();while(n.pos>>3){case 1:{if(o!==8){break}i.index=n.int32();continue}case 2:{if(o!==18){break}i.name=n.string();continue}case 3:{if(o!==26){break}i.builtinId=n.string();continue}case 4:{if(o!==32){break}i.xfId=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return hhe.fromPartial(e??{})},fromPartial(e){const t=qPt();t.index=e.index??0;t.name=e.name??"";t.builtinId=e.builtinId??"";t.xfId=e.xfId??void 0;return t}};function XPt(){return{fonts:[],fills:[],cellXfs:[],borders:[],cellStyles:[],cellStyleXfs:[],numberFormats:[],dxfs:[],indexedColors:[],mruColors:[]}}var phe={encode(e,t=new tn){for(const n of e.fonts){Gi.encode(n,t.uint32(10).fork()).join()}for(const n of e.fills){Ei.encode(n,t.uint32(18).fork()).join()}for(const n of e.cellXfs){tN.encode(n,t.uint32(26).fork()).join()}for(const n of e.borders){Q4.encode(n,t.uint32(34).fork()).join()}for(const n of e.cellStyles){hhe.encode(n,t.uint32(42).fork()).join()}for(const n of e.cellStyleXfs){fhe.encode(n,t.uint32(50).fork()).join()}for(const n of e.numberFormats){eN.encode(n,t.uint32(58).fork()).join()}for(const n of e.dxfs){mhe.encode(n,t.uint32(66).fork()).join()}for(const n of e.indexedColors){hi.encode(n,t.uint32(74).fork()).join()}for(const n of e.mruColors){hi.encode(n,t.uint32(82).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=XPt();while(n.pos>>3){case 1:{if(o!==10){break}i.fonts.push(Gi.decode(n,n.uint32()));continue}case 2:{if(o!==18){break}i.fills.push(Ei.decode(n,n.uint32()));continue}case 3:{if(o!==26){break}i.cellXfs.push(tN.decode(n,n.uint32()));continue}case 4:{if(o!==34){break}i.borders.push(Q4.decode(n,n.uint32()));continue}case 5:{if(o!==42){break}i.cellStyles.push(hhe.decode(n,n.uint32()));continue}case 6:{if(o!==50){break}i.cellStyleXfs.push(fhe.decode(n,n.uint32()));continue}case 7:{if(o!==58){break}i.numberFormats.push(eN.decode(n,n.uint32()));continue}case 8:{if(o!==66){break}i.dxfs.push(mhe.decode(n,n.uint32()));continue}case 9:{if(o!==74){break}i.indexedColors.push(hi.decode(n,n.uint32()));continue}case 10:{if(o!==82){break}i.mruColors.push(hi.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return phe.fromPartial(e??{})},fromPartial(e){const t=XPt();t.fonts=e.fonts?.map(n=>Gi.fromPartial(n))||[];t.fills=e.fills?.map(n=>Ei.fromPartial(n))||[];t.cellXfs=e.cellXfs?.map(n=>tN.fromPartial(n))||[];t.borders=e.borders?.map(n=>Q4.fromPartial(n))||[];t.cellStyles=e.cellStyles?.map(n=>hhe.fromPartial(n))||[];t.cellStyleXfs=e.cellStyleXfs?.map(n=>fhe.fromPartial(n))||[];t.numberFormats=e.numberFormats?.map(n=>eN.fromPartial(n))||[];t.dxfs=e.dxfs?.map(n=>mhe.fromPartial(n))||[];t.indexedColors=e.indexedColors?.map(n=>hi.fromPartial(n))||[];t.mruColors=e.mruColors?.map(n=>hi.fromPartial(n))||[];return t}};function jPt(){return{font:void 0,fill:void 0,border:void 0,numberFormat:void 0}}var mhe={encode(e,t=new tn){if(e.font!==void 0){Gi.encode(e.font,t.uint32(10).fork()).join()}if(e.fill!==void 0){Ei.encode(e.fill,t.uint32(18).fork()).join()}if(e.border!==void 0){Q4.encode(e.border,t.uint32(26).fork()).join()}if(e.numberFormat!==void 0){eN.encode(e.numberFormat,t.uint32(34).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=jPt();while(n.pos>>3){case 1:{if(o!==10){break}i.font=Gi.decode(n,n.uint32());continue}case 2:{if(o!==18){break}i.fill=Ei.decode(n,n.uint32());continue}case 3:{if(o!==26){break}i.border=Q4.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.numberFormat=eN.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return mhe.fromPartial(e??{})},fromPartial(e){const t=jPt();t.font=e.font!==void 0&&e.font!==null?Gi.fromPartial(e.font):void 0;t.fill=e.fill!==void 0&&e.fill!==null?Ei.fromPartial(e.fill):void 0;t.border=e.border!==void 0&&e.border!==null?Q4.fromPartial(e.border):void 0;t.numberFormat=e.numberFormat!==void 0&&e.numberFormat!==null?eN.fromPartial(e.numberFormat):void 0;return t}};function KPt(){return{plainText:""}}var ghe={encode(e,t=new tn){if(e.plainText!==""){t.uint32(10).string(e.plainText)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=KPt();while(n.pos>>3){case 1:{if(o!==10){break}i.plainText=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return ghe.fromPartial(e??{})},fromPartial(e){const t=KPt();t.plainText=e.plainText??"";return t}};function ZPt(){return{sheetName:"",sheetId:void 0,address:""}}var yhe={encode(e,t=new tn){if(e.sheetName!==""){t.uint32(10).string(e.sheetName)}if(e.sheetId!==void 0){t.uint32(18).string(e.sheetId)}if(e.address!==""){t.uint32(26).string(e.address)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=ZPt();while(n.pos>>3){case 1:{if(o!==10){break}i.sheetName=n.string();continue}case 2:{if(o!==18){break}i.sheetId=n.string();continue}case 3:{if(o!==26){break}i.address=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return yhe.fromPartial(e??{})},fromPartial(e){const t=ZPt();t.sheetName=e.sheetName??"";t.sheetId=e.sheetId??void 0;t.address=e.address??"";return t}};function JPt(){return{sheetName:"",sheetId:void 0,startAddress:"",endAddress:""}}var oE={encode(e,t=new tn){if(e.sheetName!==""){t.uint32(10).string(e.sheetName)}if(e.sheetId!==void 0){t.uint32(18).string(e.sheetId)}if(e.startAddress!==""){t.uint32(26).string(e.startAddress)}if(e.endAddress!==""){t.uint32(34).string(e.endAddress)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=JPt();while(n.pos>>3){case 1:{if(o!==10){break}i.sheetName=n.string();continue}case 2:{if(o!==18){break}i.sheetId=n.string();continue}case 3:{if(o!==26){break}i.startAddress=n.string();continue}case 4:{if(o!==34){break}i.endAddress=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return oE.fromPartial(e??{})},fromPartial(e){const t=JPt();t.sheetName=e.sheetName??"";t.sheetId=e.sheetId??void 0;t.startAddress=e.startAddress??"";t.endAddress=e.endAddress??"";return t}};function QPt(){return{cell:void 0,range:void 0}}var bhe={encode(e,t=new tn){if(e.cell!==void 0){yhe.encode(e.cell,t.uint32(10).fork()).join()}if(e.range!==void 0){oE.encode(e.range,t.uint32(18).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=QPt();while(n.pos>>3){case 1:{if(o!==10){break}i.cell=yhe.decode(n,n.uint32());continue}case 2:{if(o!==18){break}i.range=oE.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return bhe.fromPartial(e??{})},fromPartial(e){const t=QPt();t.cell=e.cell!==void 0&&e.cell!==null?yhe.fromPartial(e.cell):void 0;t.range=e.range!==void 0&&e.range!==null?oE.fromPartial(e.range):void 0;return t}};function eIt(){return{id:"",target:void 0,authorId:"",createdAt:"",body:void 0}}var xhe={encode(e,t=new tn){if(e.id!==""){t.uint32(10).string(e.id)}if(e.target!==void 0){bhe.encode(e.target,t.uint32(18).fork()).join()}if(e.authorId!==""){t.uint32(26).string(e.authorId)}if(e.createdAt!==""){t.uint32(34).string(e.createdAt)}if(e.body!==void 0){ghe.encode(e.body,t.uint32(42).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=eIt();while(n.pos>>3){case 1:{if(o!==10){break}i.id=n.string();continue}case 2:{if(o!==18){break}i.target=bhe.decode(n,n.uint32());continue}case 3:{if(o!==26){break}i.authorId=n.string();continue}case 4:{if(o!==34){break}i.createdAt=n.string();continue}case 5:{if(o!==42){break}i.body=ghe.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return xhe.fromPartial(e??{})},fromPartial(e){const t=eIt();t.id=e.id??"";t.target=e.target!==void 0&&e.target!==null?bhe.fromPartial(e.target):void 0;t.authorId=e.authorId??"";t.createdAt=e.createdAt??"";t.body=e.body!==void 0&&e.body!==null?ghe.fromPartial(e.body):void 0;return t}};function tIt(){return{type:"",val:void 0,gte:void 0}}var aE={encode(e,t=new tn){if(e.type!==""){t.uint32(10).string(e.type)}if(e.val!==void 0){t.uint32(18).string(e.val)}if(e.gte!==void 0){t.uint32(24).bool(e.gte)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=tIt();while(n.pos>>3){case 1:{if(o!==10){break}i.type=n.string();continue}case 2:{if(o!==18){break}i.val=n.string();continue}case 3:{if(o!==24){break}i.gte=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return aE.fromPartial(e??{})},fromPartial(e){const t=tIt();t.type=e.type??"";t.val=e.val??void 0;t.gte=e.gte??void 0;return t}};function nIt(){return{cfvos:[],colors:[]}}var vhe={encode(e,t=new tn){for(const n of e.cfvos){aE.encode(n,t.uint32(10).fork()).join()}for(const n of e.colors){hi.encode(n,t.uint32(18).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=nIt();while(n.pos>>3){case 1:{if(o!==10){break}i.cfvos.push(aE.decode(n,n.uint32()));continue}case 2:{if(o!==18){break}i.colors.push(hi.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return vhe.fromPartial(e??{})},fromPartial(e){const t=nIt();t.cfvos=e.cfvos?.map(n=>aE.fromPartial(n))||[];t.colors=e.colors?.map(n=>hi.fromPartial(n))||[];return t}};function rIt(){return{cfvos:[],color:void 0,gradient:void 0,minLength:void 0,maxLength:void 0,showValue:void 0,border:void 0,negativeBarColorSameAsPositive:void 0,negativeBarBorderColorSameAsPositive:void 0,direction:void 0,axisPosition:void 0,borderColor:void 0,negativeFillColor:void 0,negativeBorderColor:void 0,axisColor:void 0}}var _he={encode(e,t=new tn){for(const n of e.cfvos){aE.encode(n,t.uint32(10).fork()).join()}if(e.color!==void 0){hi.encode(e.color,t.uint32(18).fork()).join()}if(e.gradient!==void 0){t.uint32(24).bool(e.gradient)}if(e.minLength!==void 0){t.uint32(32).uint32(e.minLength)}if(e.maxLength!==void 0){t.uint32(40).uint32(e.maxLength)}if(e.showValue!==void 0){t.uint32(48).bool(e.showValue)}if(e.border!==void 0){t.uint32(56).bool(e.border)}if(e.negativeBarColorSameAsPositive!==void 0){t.uint32(64).bool(e.negativeBarColorSameAsPositive)}if(e.negativeBarBorderColorSameAsPositive!==void 0){t.uint32(72).bool(e.negativeBarBorderColorSameAsPositive)}if(e.direction!==void 0){t.uint32(82).string(e.direction)}if(e.axisPosition!==void 0){t.uint32(90).string(e.axisPosition)}if(e.borderColor!==void 0){hi.encode(e.borderColor,t.uint32(98).fork()).join()}if(e.negativeFillColor!==void 0){hi.encode(e.negativeFillColor,t.uint32(106).fork()).join()}if(e.negativeBorderColor!==void 0){hi.encode(e.negativeBorderColor,t.uint32(114).fork()).join()}if(e.axisColor!==void 0){hi.encode(e.axisColor,t.uint32(122).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=rIt();while(n.pos>>3){case 1:{if(o!==10){break}i.cfvos.push(aE.decode(n,n.uint32()));continue}case 2:{if(o!==18){break}i.color=hi.decode(n,n.uint32());continue}case 3:{if(o!==24){break}i.gradient=n.bool();continue}case 4:{if(o!==32){break}i.minLength=n.uint32();continue}case 5:{if(o!==40){break}i.maxLength=n.uint32();continue}case 6:{if(o!==48){break}i.showValue=n.bool();continue}case 7:{if(o!==56){break}i.border=n.bool();continue}case 8:{if(o!==64){break}i.negativeBarColorSameAsPositive=n.bool();continue}case 9:{if(o!==72){break}i.negativeBarBorderColorSameAsPositive=n.bool();continue}case 10:{if(o!==82){break}i.direction=n.string();continue}case 11:{if(o!==90){break}i.axisPosition=n.string();continue}case 12:{if(o!==98){break}i.borderColor=hi.decode(n,n.uint32());continue}case 13:{if(o!==106){break}i.negativeFillColor=hi.decode(n,n.uint32());continue}case 14:{if(o!==114){break}i.negativeBorderColor=hi.decode(n,n.uint32());continue}case 15:{if(o!==122){break}i.axisColor=hi.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return _he.fromPartial(e??{})},fromPartial(e){const t=rIt();t.cfvos=e.cfvos?.map(n=>aE.fromPartial(n))||[];t.color=e.color!==void 0&&e.color!==null?hi.fromPartial(e.color):void 0;t.gradient=e.gradient??void 0;t.minLength=e.minLength??void 0;t.maxLength=e.maxLength??void 0;t.showValue=e.showValue??void 0;t.border=e.border??void 0;t.negativeBarColorSameAsPositive=e.negativeBarColorSameAsPositive??void 0;t.negativeBarBorderColorSameAsPositive=e.negativeBarBorderColorSameAsPositive??void 0;t.direction=e.direction??void 0;t.axisPosition=e.axisPosition??void 0;t.borderColor=e.borderColor!==void 0&&e.borderColor!==null?hi.fromPartial(e.borderColor):void 0;t.negativeFillColor=e.negativeFillColor!==void 0&&e.negativeFillColor!==null?hi.fromPartial(e.negativeFillColor):void 0;t.negativeBorderColor=e.negativeBorderColor!==void 0&&e.negativeBorderColor!==null?hi.fromPartial(e.negativeBorderColor):void 0;t.axisColor=e.axisColor!==void 0&&e.axisColor!==null?hi.fromPartial(e.axisColor):void 0;return t}};function iIt(){return{iconSet:"",showValue:void 0,reverse:void 0,custom:void 0,cfvos:[],percent:void 0}}var The={encode(e,t=new tn){if(e.iconSet!==""){t.uint32(10).string(e.iconSet)}if(e.showValue!==void 0){t.uint32(16).bool(e.showValue)}if(e.reverse!==void 0){t.uint32(24).bool(e.reverse)}if(e.custom!==void 0){t.uint32(32).bool(e.custom)}for(const n of e.cfvos){aE.encode(n,t.uint32(42).fork()).join()}if(e.percent!==void 0){t.uint32(48).bool(e.percent)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=iIt();while(n.pos>>3){case 1:{if(o!==10){break}i.iconSet=n.string();continue}case 2:{if(o!==16){break}i.showValue=n.bool();continue}case 3:{if(o!==24){break}i.reverse=n.bool();continue}case 4:{if(o!==32){break}i.custom=n.bool();continue}case 5:{if(o!==42){break}i.cfvos.push(aE.decode(n,n.uint32()));continue}case 6:{if(o!==48){break}i.percent=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return The.fromPartial(e??{})},fromPartial(e){const t=iIt();t.iconSet=e.iconSet??"";t.showValue=e.showValue??void 0;t.reverse=e.reverse??void 0;t.custom=e.custom??void 0;t.cfvos=e.cfvos?.map(n=>aE.fromPartial(n))||[];t.percent=e.percent??void 0;return t}};function oIt(){return{type:"",priority:void 0,dxfId:void 0,operator:void 0,formula:[],colorScale:void 0,dataBar:void 0,iconSet:void 0,stopIfTrue:void 0,aboveAverage:void 0,percent:void 0,bottom:void 0,text:void 0,timePeriod:void 0,rank:void 0,stdDev:void 0,equalAverage:void 0,id:void 0}}var whe={encode(e,t=new tn){if(e.type!==""){t.uint32(10).string(e.type)}if(e.priority!==void 0){t.uint32(16).int32(e.priority)}if(e.dxfId!==void 0){t.uint32(24).int32(e.dxfId)}if(e.operator!==void 0){t.uint32(34).string(e.operator)}for(const n of e.formula){t.uint32(42).string(n)}if(e.colorScale!==void 0){vhe.encode(e.colorScale,t.uint32(82).fork()).join()}if(e.dataBar!==void 0){_he.encode(e.dataBar,t.uint32(90).fork()).join()}if(e.iconSet!==void 0){The.encode(e.iconSet,t.uint32(98).fork()).join()}if(e.stopIfTrue!==void 0){t.uint32(48).bool(e.stopIfTrue)}if(e.aboveAverage!==void 0){t.uint32(56).bool(e.aboveAverage)}if(e.percent!==void 0){t.uint32(64).bool(e.percent)}if(e.bottom!==void 0){t.uint32(72).bool(e.bottom)}if(e.text!==void 0){t.uint32(106).string(e.text)}if(e.timePeriod!==void 0){t.uint32(114).string(e.timePeriod)}if(e.rank!==void 0){t.uint32(120).int32(e.rank)}if(e.stdDev!==void 0){t.uint32(128).int32(e.stdDev)}if(e.equalAverage!==void 0){t.uint32(136).bool(e.equalAverage)}if(e.id!==void 0){t.uint32(146).string(e.id)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=oIt();while(n.pos>>3){case 1:{if(o!==10){break}i.type=n.string();continue}case 2:{if(o!==16){break}i.priority=n.int32();continue}case 3:{if(o!==24){break}i.dxfId=n.int32();continue}case 4:{if(o!==34){break}i.operator=n.string();continue}case 5:{if(o!==42){break}i.formula.push(n.string());continue}case 10:{if(o!==82){break}i.colorScale=vhe.decode(n,n.uint32());continue}case 11:{if(o!==90){break}i.dataBar=_he.decode(n,n.uint32());continue}case 12:{if(o!==98){break}i.iconSet=The.decode(n,n.uint32());continue}case 6:{if(o!==48){break}i.stopIfTrue=n.bool();continue}case 7:{if(o!==56){break}i.aboveAverage=n.bool();continue}case 8:{if(o!==64){break}i.percent=n.bool();continue}case 9:{if(o!==72){break}i.bottom=n.bool();continue}case 13:{if(o!==106){break}i.text=n.string();continue}case 14:{if(o!==114){break}i.timePeriod=n.string();continue}case 15:{if(o!==120){break}i.rank=n.int32();continue}case 16:{if(o!==128){break}i.stdDev=n.int32();continue}case 17:{if(o!==136){break}i.equalAverage=n.bool();continue}case 18:{if(o!==146){break}i.id=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return whe.fromPartial(e??{})},fromPartial(e){const t=oIt();t.type=e.type??"";t.priority=e.priority??void 0;t.dxfId=e.dxfId??void 0;t.operator=e.operator??void 0;t.formula=e.formula?.map(n=>n)||[];t.colorScale=e.colorScale!==void 0&&e.colorScale!==null?vhe.fromPartial(e.colorScale):void 0;t.dataBar=e.dataBar!==void 0&&e.dataBar!==null?_he.fromPartial(e.dataBar):void 0;t.iconSet=e.iconSet!==void 0&&e.iconSet!==null?The.fromPartial(e.iconSet):void 0;t.stopIfTrue=e.stopIfTrue??void 0;t.aboveAverage=e.aboveAverage??void 0;t.percent=e.percent??void 0;t.bottom=e.bottom??void 0;t.text=e.text??void 0;t.timePeriod=e.timePeriod??void 0;t.rank=e.rank??void 0;t.stdDev=e.stdDev??void 0;t.equalAverage=e.equalAverage??void 0;t.id=e.id??void 0;return t}};function aIt(){return{ranges:[],rules:[]}}var Ehe={encode(e,t=new tn){for(const n of e.ranges){oE.encode(n,t.uint32(10).fork()).join()}for(const n of e.rules){whe.encode(n,t.uint32(18).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=aIt();while(n.pos>>3){case 1:{if(o!==10){break}i.ranges.push(oE.decode(n,n.uint32()));continue}case 2:{if(o!==18){break}i.rules.push(whe.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Ehe.fromPartial(e??{})},fromPartial(e){const t=aIt();t.ranges=e.ranges?.map(n=>oE.fromPartial(n))||[];t.rules=e.rules?.map(n=>whe.fromPartial(n))||[];return t}};function sIt(){return{id:0,name:"",totalsRowLabel:void 0,totalsRowFunction:void 0,dataDxfId:void 0,calculatedColumnFormula:void 0,calculatedColumnFormulaArray:void 0,totalsRowFormula:void 0,totalsRowFormulaArray:void 0}}var Che={encode(e,t=new tn){if(e.id!==0){t.uint32(8).int32(e.id)}if(e.name!==""){t.uint32(18).string(e.name)}if(e.totalsRowLabel!==void 0){t.uint32(26).string(e.totalsRowLabel)}if(e.totalsRowFunction!==void 0){t.uint32(34).string(e.totalsRowFunction)}if(e.dataDxfId!==void 0){t.uint32(40).int32(e.dataDxfId)}if(e.calculatedColumnFormula!==void 0){t.uint32(50).string(e.calculatedColumnFormula)}if(e.calculatedColumnFormulaArray!==void 0){t.uint32(56).bool(e.calculatedColumnFormulaArray)}if(e.totalsRowFormula!==void 0){t.uint32(66).string(e.totalsRowFormula)}if(e.totalsRowFormulaArray!==void 0){t.uint32(72).bool(e.totalsRowFormulaArray)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=sIt();while(n.pos>>3){case 1:{if(o!==8){break}i.id=n.int32();continue}case 2:{if(o!==18){break}i.name=n.string();continue}case 3:{if(o!==26){break}i.totalsRowLabel=n.string();continue}case 4:{if(o!==34){break}i.totalsRowFunction=n.string();continue}case 5:{if(o!==40){break}i.dataDxfId=n.int32();continue}case 6:{if(o!==50){break}i.calculatedColumnFormula=n.string();continue}case 7:{if(o!==56){break}i.calculatedColumnFormulaArray=n.bool();continue}case 8:{if(o!==66){break}i.totalsRowFormula=n.string();continue}case 9:{if(o!==72){break}i.totalsRowFormulaArray=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Che.fromPartial(e??{})},fromPartial(e){const t=sIt();t.id=e.id??0;t.name=e.name??"";t.totalsRowLabel=e.totalsRowLabel??void 0;t.totalsRowFunction=e.totalsRowFunction??void 0;t.dataDxfId=e.dataDxfId??void 0;t.calculatedColumnFormula=e.calculatedColumnFormula??void 0;t.calculatedColumnFormulaArray=e.calculatedColumnFormulaArray??void 0;t.totalsRowFormula=e.totalsRowFormula??void 0;t.totalsRowFormulaArray=e.totalsRowFormulaArray??void 0;return t}};function lIt(){return{name:"",showFirstColumn:void 0,showLastColumn:void 0,showRowStripes:void 0,showColumnStripes:void 0}}var She={encode(e,t=new tn){if(e.name!==""){t.uint32(10).string(e.name)}if(e.showFirstColumn!==void 0){t.uint32(16).bool(e.showFirstColumn)}if(e.showLastColumn!==void 0){t.uint32(24).bool(e.showLastColumn)}if(e.showRowStripes!==void 0){t.uint32(32).bool(e.showRowStripes)}if(e.showColumnStripes!==void 0){t.uint32(40).bool(e.showColumnStripes)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=lIt();while(n.pos>>3){case 1:{if(o!==10){break}i.name=n.string();continue}case 2:{if(o!==16){break}i.showFirstColumn=n.bool();continue}case 3:{if(o!==24){break}i.showLastColumn=n.bool();continue}case 4:{if(o!==32){break}i.showRowStripes=n.bool();continue}case 5:{if(o!==40){break}i.showColumnStripes=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return She.fromPartial(e??{})},fromPartial(e){const t=lIt();t.name=e.name??"";t.showFirstColumn=e.showFirstColumn??void 0;t.showLastColumn=e.showLastColumn??void 0;t.showRowStripes=e.showRowStripes??void 0;t.showColumnStripes=e.showColumnStripes??void 0;return t}};function cIt(){return{values:[],blank:void 0,dateGroupItems:[]}}var Ahe={encode(e,t=new tn){for(const n of e.values){t.uint32(10).string(n)}if(e.blank!==void 0){t.uint32(16).bool(e.blank)}for(const n of e.dateGroupItems){khe.encode(n,t.uint32(26).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=cIt();while(n.pos>>3){case 1:{if(o!==10){break}i.values.push(n.string());continue}case 2:{if(o!==16){break}i.blank=n.bool();continue}case 3:{if(o!==26){break}i.dateGroupItems.push(khe.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Ahe.fromPartial(e??{})},fromPartial(e){const t=cIt();t.values=e.values?.map(n=>n)||[];t.blank=e.blank??void 0;t.dateGroupItems=e.dateGroupItems?.map(n=>khe.fromPartial(n))||[];return t}};function uIt(){return{dateTimeGrouping:void 0,year:void 0,month:void 0,day:void 0,hour:void 0,minute:void 0,second:void 0}}var khe={encode(e,t=new tn){if(e.dateTimeGrouping!==void 0){t.uint32(8).int32(e.dateTimeGrouping)}if(e.year!==void 0){t.uint32(16).int32(e.year)}if(e.month!==void 0){t.uint32(24).int32(e.month)}if(e.day!==void 0){t.uint32(32).int32(e.day)}if(e.hour!==void 0){t.uint32(40).int32(e.hour)}if(e.minute!==void 0){t.uint32(48).int32(e.minute)}if(e.second!==void 0){t.uint32(56).int32(e.second)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=uIt();while(n.pos>>3){case 1:{if(o!==8){break}i.dateTimeGrouping=n.int32();continue}case 2:{if(o!==16){break}i.year=n.int32();continue}case 3:{if(o!==24){break}i.month=n.int32();continue}case 4:{if(o!==32){break}i.day=n.int32();continue}case 5:{if(o!==40){break}i.hour=n.int32();continue}case 6:{if(o!==48){break}i.minute=n.int32();continue}case 7:{if(o!==56){break}i.second=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return khe.fromPartial(e??{})},fromPartial(e){const t=uIt();t.dateTimeGrouping=e.dateTimeGrouping??void 0;t.year=e.year??void 0;t.month=e.month??void 0;t.day=e.day??void 0;t.hour=e.hour??void 0;t.minute=e.minute??void 0;t.second=e.second??void 0;return t}};function dIt(){return{operator:void 0,value:void 0}}var Rhe={encode(e,t=new tn){if(e.operator!==void 0){t.uint32(8).int32(e.operator)}if(e.value!==void 0){t.uint32(18).string(e.value)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=dIt();while(n.pos>>3){case 1:{if(o!==8){break}i.operator=n.int32();continue}case 2:{if(o!==18){break}i.value=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Rhe.fromPartial(e??{})},fromPartial(e){const t=dIt();t.operator=e.operator??void 0;t.value=e.value??void 0;return t}};function fIt(){return{filters:[],and:void 0}}var Phe={encode(e,t=new tn){for(const n of e.filters){Rhe.encode(n,t.uint32(10).fork()).join()}if(e.and!==void 0){t.uint32(16).bool(e.and)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=fIt();while(n.pos>>3){case 1:{if(o!==10){break}i.filters.push(Rhe.decode(n,n.uint32()));continue}case 2:{if(o!==16){break}i.and=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Phe.fromPartial(e??{})},fromPartial(e){const t=fIt();t.filters=e.filters?.map(n=>Rhe.fromPartial(n))||[];t.and=e.and??void 0;return t}};function hIt(){return{type:void 0,value:void 0,maxValue:void 0,valueIso:void 0,maxValueIso:void 0}}var Ihe={encode(e,t=new tn){if(e.type!==void 0){t.uint32(8).int32(e.type)}if(e.value!==void 0){t.uint32(17).double(e.value)}if(e.maxValue!==void 0){t.uint32(25).double(e.maxValue)}if(e.valueIso!==void 0){t.uint32(34).string(e.valueIso)}if(e.maxValueIso!==void 0){t.uint32(42).string(e.maxValueIso)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=hIt();while(n.pos>>3){case 1:{if(o!==8){break}i.type=n.int32();continue}case 2:{if(o!==17){break}i.value=n.double();continue}case 3:{if(o!==25){break}i.maxValue=n.double();continue}case 4:{if(o!==34){break}i.valueIso=n.string();continue}case 5:{if(o!==42){break}i.maxValueIso=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Ihe.fromPartial(e??{})},fromPartial(e){const t=hIt();t.type=e.type??void 0;t.value=e.value??void 0;t.maxValue=e.maxValue??void 0;t.valueIso=e.valueIso??void 0;t.maxValueIso=e.maxValueIso??void 0;return t}};function pIt(){return{dxfId:void 0,cellColor:void 0}}var Mhe={encode(e,t=new tn){if(e.dxfId!==void 0){t.uint32(8).int32(e.dxfId)}if(e.cellColor!==void 0){t.uint32(16).bool(e.cellColor)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=pIt();while(n.pos>>3){case 1:{if(o!==8){break}i.dxfId=n.int32();continue}case 2:{if(o!==16){break}i.cellColor=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Mhe.fromPartial(e??{})},fromPartial(e){const t=pIt();t.dxfId=e.dxfId??void 0;t.cellColor=e.cellColor??void 0;return t}};function mIt(){return{top:void 0,percent:void 0,value:void 0,filterValue:void 0}}var Lhe={encode(e,t=new tn){if(e.top!==void 0){t.uint32(8).bool(e.top)}if(e.percent!==void 0){t.uint32(16).bool(e.percent)}if(e.value!==void 0){t.uint32(25).double(e.value)}if(e.filterValue!==void 0){t.uint32(33).double(e.filterValue)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=mIt();while(n.pos>>3){case 1:{if(o!==8){break}i.top=n.bool();continue}case 2:{if(o!==16){break}i.percent=n.bool();continue}case 3:{if(o!==25){break}i.value=n.double();continue}case 4:{if(o!==33){break}i.filterValue=n.double();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Lhe.fromPartial(e??{})},fromPartial(e){const t=mIt();t.top=e.top??void 0;t.percent=e.percent??void 0;t.value=e.value??void 0;t.filterValue=e.filterValue??void 0;return t}};function gIt(){return{iconSet:void 0,iconId:void 0}}var Dhe={encode(e,t=new tn){if(e.iconSet!==void 0){t.uint32(8).int32(e.iconSet)}if(e.iconId!==void 0){t.uint32(16).int32(e.iconId)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=gIt();while(n.pos>>3){case 1:{if(o!==8){break}i.iconSet=n.int32();continue}case 2:{if(o!==16){break}i.iconId=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Dhe.fromPartial(e??{})},fromPartial(e){const t=gIt();t.iconSet=e.iconSet??void 0;t.iconId=e.iconId??void 0;return t}};function yIt(){return{colId:0,type:"",filters:void 0,customFilters:void 0,dynamicFilter:void 0,colorFilter:void 0,hiddenButton:void 0,showButton:void 0,iconFilter:void 0,top10:void 0,typeEnum:void 0}}var Fhe={encode(e,t=new tn){if(e.colId!==0){t.uint32(8).int32(e.colId)}if(e.type!==""){t.uint32(18).string(e.type)}if(e.filters!==void 0){Ahe.encode(e.filters,t.uint32(26).fork()).join()}if(e.customFilters!==void 0){Phe.encode(e.customFilters,t.uint32(34).fork()).join()}if(e.dynamicFilter!==void 0){Ihe.encode(e.dynamicFilter,t.uint32(42).fork()).join()}if(e.colorFilter!==void 0){Mhe.encode(e.colorFilter,t.uint32(50).fork()).join()}if(e.hiddenButton!==void 0){t.uint32(56).bool(e.hiddenButton)}if(e.showButton!==void 0){t.uint32(64).bool(e.showButton)}if(e.iconFilter!==void 0){Dhe.encode(e.iconFilter,t.uint32(74).fork()).join()}if(e.top10!==void 0){Lhe.encode(e.top10,t.uint32(82).fork()).join()}if(e.typeEnum!==void 0){t.uint32(240).int32(e.typeEnum)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=yIt();while(n.pos>>3){case 1:{if(o!==8){break}i.colId=n.int32();continue}case 2:{if(o!==18){break}i.type=n.string();continue}case 3:{if(o!==26){break}i.filters=Ahe.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.customFilters=Phe.decode(n,n.uint32());continue}case 5:{if(o!==42){break}i.dynamicFilter=Ihe.decode(n,n.uint32());continue}case 6:{if(o!==50){break}i.colorFilter=Mhe.decode(n,n.uint32());continue}case 7:{if(o!==56){break}i.hiddenButton=n.bool();continue}case 8:{if(o!==64){break}i.showButton=n.bool();continue}case 9:{if(o!==74){break}i.iconFilter=Dhe.decode(n,n.uint32());continue}case 10:{if(o!==82){break}i.top10=Lhe.decode(n,n.uint32());continue}case 30:{if(o!==240){break}i.typeEnum=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Fhe.fromPartial(e??{})},fromPartial(e){const t=yIt();t.colId=e.colId??0;t.type=e.type??"";t.filters=e.filters!==void 0&&e.filters!==null?Ahe.fromPartial(e.filters):void 0;t.customFilters=e.customFilters!==void 0&&e.customFilters!==null?Phe.fromPartial(e.customFilters):void 0;t.dynamicFilter=e.dynamicFilter!==void 0&&e.dynamicFilter!==null?Ihe.fromPartial(e.dynamicFilter):void 0;t.colorFilter=e.colorFilter!==void 0&&e.colorFilter!==null?Mhe.fromPartial(e.colorFilter):void 0;t.hiddenButton=e.hiddenButton??void 0;t.showButton=e.showButton??void 0;t.iconFilter=e.iconFilter!==void 0&&e.iconFilter!==null?Dhe.fromPartial(e.iconFilter):void 0;t.top10=e.top10!==void 0&&e.top10!==null?Lhe.fromPartial(e.top10):void 0;t.typeEnum=e.typeEnum??void 0;return t}};function bIt(){return{ref:"",descending:void 0,sortBy:void 0,customList:void 0,dxfId:void 0,iconSet:void 0,iconId:void 0}}var Nhe={encode(e,t=new tn){if(e.ref!==""){t.uint32(10).string(e.ref)}if(e.descending!==void 0){t.uint32(16).bool(e.descending)}if(e.sortBy!==void 0){t.uint32(24).int32(e.sortBy)}if(e.customList!==void 0){t.uint32(34).string(e.customList)}if(e.dxfId!==void 0){t.uint32(40).int32(e.dxfId)}if(e.iconSet!==void 0){t.uint32(48).int32(e.iconSet)}if(e.iconId!==void 0){t.uint32(56).int32(e.iconId)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=bIt();while(n.pos>>3){case 1:{if(o!==10){break}i.ref=n.string();continue}case 2:{if(o!==16){break}i.descending=n.bool();continue}case 3:{if(o!==24){break}i.sortBy=n.int32();continue}case 4:{if(o!==34){break}i.customList=n.string();continue}case 5:{if(o!==40){break}i.dxfId=n.int32();continue}case 6:{if(o!==48){break}i.iconSet=n.int32();continue}case 7:{if(o!==56){break}i.iconId=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Nhe.fromPartial(e??{})},fromPartial(e){const t=bIt();t.ref=e.ref??"";t.descending=e.descending??void 0;t.sortBy=e.sortBy??void 0;t.customList=e.customList??void 0;t.dxfId=e.dxfId??void 0;t.iconSet=e.iconSet??void 0;t.iconId=e.iconId??void 0;return t}};function xIt(){return{ref:"",conditions:[],columnSort:void 0,caseSensitive:void 0,sortMethod:void 0}}var sE={encode(e,t=new tn){if(e.ref!==""){t.uint32(10).string(e.ref)}for(const n of e.conditions){Nhe.encode(n,t.uint32(18).fork()).join()}if(e.columnSort!==void 0){t.uint32(24).bool(e.columnSort)}if(e.caseSensitive!==void 0){t.uint32(32).bool(e.caseSensitive)}if(e.sortMethod!==void 0){t.uint32(40).int32(e.sortMethod)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=xIt();while(n.pos>>3){case 1:{if(o!==10){break}i.ref=n.string();continue}case 2:{if(o!==18){break}i.conditions.push(Nhe.decode(n,n.uint32()));continue}case 3:{if(o!==24){break}i.columnSort=n.bool();continue}case 4:{if(o!==32){break}i.caseSensitive=n.bool();continue}case 5:{if(o!==40){break}i.sortMethod=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return sE.fromPartial(e??{})},fromPartial(e){const t=xIt();t.ref=e.ref??"";t.conditions=e.conditions?.map(n=>Nhe.fromPartial(n))||[];t.columnSort=e.columnSort??void 0;t.caseSensitive=e.caseSensitive??void 0;t.sortMethod=e.sortMethod??void 0;return t}};function vIt(){return{ref:"",columns:[],sortState:void 0}}var lE={encode(e,t=new tn){if(e.ref!==""){t.uint32(10).string(e.ref)}for(const n of e.columns){Fhe.encode(n,t.uint32(18).fork()).join()}if(e.sortState!==void 0){sE.encode(e.sortState,t.uint32(26).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=vIt();while(n.pos>>3){case 1:{if(o!==10){break}i.ref=n.string();continue}case 2:{if(o!==18){break}i.columns.push(Fhe.decode(n,n.uint32()));continue}case 3:{if(o!==26){break}i.sortState=sE.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return lE.fromPartial(e??{})},fromPartial(e){const t=vIt();t.ref=e.ref??"";t.columns=e.columns?.map(n=>Fhe.fromPartial(n))||[];t.sortState=e.sortState!==void 0&&e.sortState!==null?sE.fromPartial(e.sortState):void 0;return t}};function _It(){return{id:0,name:"",displayName:"",ref:"",columns:[],style:void 0,totalsRowShown:void 0,headerRowCount:void 0,totalsRowCount:void 0,autoFilter:void 0,dataDxfId:void 0,headerRowCellStyle:void 0,sortState:void 0,headerRowBorderDxfId:void 0}}var Ohe={encode(e,t=new tn){if(e.id!==0){t.uint32(8).int32(e.id)}if(e.name!==""){t.uint32(18).string(e.name)}if(e.displayName!==""){t.uint32(26).string(e.displayName)}if(e.ref!==""){t.uint32(34).string(e.ref)}for(const n of e.columns){Che.encode(n,t.uint32(42).fork()).join()}if(e.style!==void 0){She.encode(e.style,t.uint32(50).fork()).join()}if(e.totalsRowShown!==void 0){t.uint32(56).bool(e.totalsRowShown)}if(e.headerRowCount!==void 0){t.uint32(64).int32(e.headerRowCount)}if(e.totalsRowCount!==void 0){t.uint32(72).int32(e.totalsRowCount)}if(e.autoFilter!==void 0){lE.encode(e.autoFilter,t.uint32(82).fork()).join()}if(e.dataDxfId!==void 0){t.uint32(88).int32(e.dataDxfId)}if(e.headerRowCellStyle!==void 0){t.uint32(98).string(e.headerRowCellStyle)}if(e.sortState!==void 0){sE.encode(e.sortState,t.uint32(106).fork()).join()}if(e.headerRowBorderDxfId!==void 0){t.uint32(112).int32(e.headerRowBorderDxfId)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=_It();while(n.pos>>3){case 1:{if(o!==8){break}i.id=n.int32();continue}case 2:{if(o!==18){break}i.name=n.string();continue}case 3:{if(o!==26){break}i.displayName=n.string();continue}case 4:{if(o!==34){break}i.ref=n.string();continue}case 5:{if(o!==42){break}i.columns.push(Che.decode(n,n.uint32()));continue}case 6:{if(o!==50){break}i.style=She.decode(n,n.uint32());continue}case 7:{if(o!==56){break}i.totalsRowShown=n.bool();continue}case 8:{if(o!==64){break}i.headerRowCount=n.int32();continue}case 9:{if(o!==72){break}i.totalsRowCount=n.int32();continue}case 10:{if(o!==82){break}i.autoFilter=lE.decode(n,n.uint32());continue}case 11:{if(o!==88){break}i.dataDxfId=n.int32();continue}case 12:{if(o!==98){break}i.headerRowCellStyle=n.string();continue}case 13:{if(o!==106){break}i.sortState=sE.decode(n,n.uint32());continue}case 14:{if(o!==112){break}i.headerRowBorderDxfId=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Ohe.fromPartial(e??{})},fromPartial(e){const t=_It();t.id=e.id??0;t.name=e.name??"";t.displayName=e.displayName??"";t.ref=e.ref??"";t.columns=e.columns?.map(n=>Che.fromPartial(n))||[];t.style=e.style!==void 0&&e.style!==null?She.fromPartial(e.style):void 0;t.totalsRowShown=e.totalsRowShown??void 0;t.headerRowCount=e.headerRowCount??void 0;t.totalsRowCount=e.totalsRowCount??void 0;t.autoFilter=e.autoFilter!==void 0&&e.autoFilter!==null?lE.fromPartial(e.autoFilter):void 0;t.dataDxfId=e.dataDxfId??void 0;t.headerRowCellStyle=e.headerRowCellStyle??void 0;t.sortState=e.sortState!==void 0&&e.sortState!==null?sE.fromPartial(e.sortState):void 0;t.headerRowBorderDxfId=e.headerRowBorderDxfId??void 0;return t}};function TIt(){return{name:"",caption:"",cache:"",fromAnchor:void 0,toAnchor:void 0,cacheId:void 0,width:void 0,height:void 0,fill:void 0,line:void 0}}var Bhe={encode(e,t=new tn){if(e.name!==""){t.uint32(10).string(e.name)}if(e.caption!==""){t.uint32(18).string(e.caption)}if(e.cache!==""){t.uint32(26).string(e.cache)}if(e.fromAnchor!==void 0){bp.encode(e.fromAnchor,t.uint32(34).fork()).join()}if(e.toAnchor!==void 0){bp.encode(e.toAnchor,t.uint32(42).fork()).join()}if(e.cacheId!==void 0){t.uint32(48).int32(e.cacheId)}if(e.width!==void 0){t.uint32(57).double(e.width)}if(e.height!==void 0){t.uint32(65).double(e.height)}if(e.fill!==void 0){Ei.encode(e.fill,t.uint32(74).fork()).join()}if(e.line!==void 0){ui.encode(e.line,t.uint32(82).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=TIt();while(n.pos>>3){case 1:{if(o!==10){break}i.name=n.string();continue}case 2:{if(o!==18){break}i.caption=n.string();continue}case 3:{if(o!==26){break}i.cache=n.string();continue}case 4:{if(o!==34){break}i.fromAnchor=bp.decode(n,n.uint32());continue}case 5:{if(o!==42){break}i.toAnchor=bp.decode(n,n.uint32());continue}case 6:{if(o!==48){break}i.cacheId=n.int32();continue}case 7:{if(o!==57){break}i.width=n.double();continue}case 8:{if(o!==65){break}i.height=n.double();continue}case 9:{if(o!==74){break}i.fill=Ei.decode(n,n.uint32());continue}case 10:{if(o!==82){break}i.line=ui.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Bhe.fromPartial(e??{})},fromPartial(e){const t=TIt();t.name=e.name??"";t.caption=e.caption??"";t.cache=e.cache??"";t.fromAnchor=e.fromAnchor!==void 0&&e.fromAnchor!==null?bp.fromPartial(e.fromAnchor):void 0;t.toAnchor=e.toAnchor!==void 0&&e.toAnchor!==null?bp.fromPartial(e.toAnchor):void 0;t.cacheId=e.cacheId??void 0;t.width=e.width??void 0;t.height=e.height??void 0;t.fill=e.fill!==void 0&&e.fill!==null?Ei.fromPartial(e.fill):void 0;t.line=e.line!==void 0&&e.line!==null?ui.fromPartial(e.line):void 0;return t}};function wIt(){return{index:void 0,value:"",selected:void 0}}var zhe={encode(e,t=new tn){if(e.index!==void 0){t.uint32(8).int32(e.index)}if(e.value!==""){t.uint32(18).string(e.value)}if(e.selected!==void 0){t.uint32(24).bool(e.selected)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=wIt();while(n.pos>>3){case 1:{if(o!==8){break}i.index=n.int32();continue}case 2:{if(o!==18){break}i.value=n.string();continue}case 3:{if(o!==24){break}i.selected=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return zhe.fromPartial(e??{})},fromPartial(e){const t=wIt();t.index=e.index??void 0;t.value=e.value??"";t.selected=e.selected??void 0;return t}};function EIt(){return{name:"",caption:void 0,pivotCacheId:void 0,pivotTableIds:[],columnName:void 0,items:[]}}var Uhe={encode(e,t=new tn){if(e.name!==""){t.uint32(10).string(e.name)}if(e.caption!==void 0){t.uint32(18).string(e.caption)}if(e.pivotCacheId!==void 0){t.uint32(24).int32(e.pivotCacheId)}t.uint32(34).fork();for(const n of e.pivotTableIds){t.int32(n)}t.join();if(e.columnName!==void 0){t.uint32(42).string(e.columnName)}for(const n of e.items){zhe.encode(n,t.uint32(50).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=EIt();while(n.pos>>3){case 1:{if(o!==10){break}i.name=n.string();continue}case 2:{if(o!==18){break}i.caption=n.string();continue}case 3:{if(o!==24){break}i.pivotCacheId=n.int32();continue}case 4:{if(o===32){i.pivotTableIds.push(n.int32());continue}if(o===34){const a=n.uint32()+n.pos;while(n.posn)||[];t.columnName=e.columnName??void 0;t.items=e.items?.map(n=>zhe.fromPartial(n))||[];return t}};function CIt(){return{reference:"",firstHeaderRow:void 0,firstDataRow:void 0,firstHeaderColumn:void 0,firstDataColumn:void 0,rowPageCount:void 0,columnPageCount:void 0}}var Vhe={encode(e,t=new tn){if(e.reference!==""){t.uint32(10).string(e.reference)}if(e.firstHeaderRow!==void 0){t.uint32(16).int32(e.firstHeaderRow)}if(e.firstDataRow!==void 0){t.uint32(24).int32(e.firstDataRow)}if(e.firstHeaderColumn!==void 0){t.uint32(32).int32(e.firstHeaderColumn)}if(e.firstDataColumn!==void 0){t.uint32(40).int32(e.firstDataColumn)}if(e.rowPageCount!==void 0){t.uint32(48).int32(e.rowPageCount)}if(e.columnPageCount!==void 0){t.uint32(56).int32(e.columnPageCount)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=CIt();while(n.pos>>3){case 1:{if(o!==10){break}i.reference=n.string();continue}case 2:{if(o!==16){break}i.firstHeaderRow=n.int32();continue}case 3:{if(o!==24){break}i.firstDataRow=n.int32();continue}case 4:{if(o!==32){break}i.firstHeaderColumn=n.int32();continue}case 5:{if(o!==40){break}i.firstDataColumn=n.int32();continue}case 6:{if(o!==48){break}i.rowPageCount=n.int32();continue}case 7:{if(o!==56){break}i.columnPageCount=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Vhe.fromPartial(e??{})},fromPartial(e){const t=CIt();t.reference=e.reference??"";t.firstHeaderRow=e.firstHeaderRow??void 0;t.firstDataRow=e.firstDataRow??void 0;t.firstHeaderColumn=e.firstHeaderColumn??void 0;t.firstDataColumn=e.firstDataColumn??void 0;t.rowPageCount=e.rowPageCount??void 0;t.columnPageCount=e.columnPageCount??void 0;return t}};function SIt(){return{type:void 0,index:void 0,hidden:void 0,calculated:void 0,missing:void 0,repeatedItemCount:void 0,dataFieldIndex:void 0,hideDetails:void 0,memberPropertyIndexes:[],memberProperties:[],name:void 0}}var iE={encode(e,t=new tn){if(e.type!==void 0){t.uint32(10).string(e.type)}if(e.index!==void 0){t.uint32(16).int32(e.index)}if(e.hidden!==void 0){t.uint32(24).bool(e.hidden)}if(e.calculated!==void 0){t.uint32(32).bool(e.calculated)}if(e.missing!==void 0){t.uint32(40).bool(e.missing)}if(e.repeatedItemCount!==void 0){t.uint32(48).int32(e.repeatedItemCount)}if(e.dataFieldIndex!==void 0){t.uint32(56).int32(e.dataFieldIndex)}if(e.hideDetails!==void 0){t.uint32(64).bool(e.hideDetails)}t.uint32(74).fork();for(const n of e.memberPropertyIndexes){t.int32(n)}t.join();for(const n of e.memberProperties){$he.encode(n,t.uint32(82).fork()).join()}if(e.name!==void 0){t.uint32(90).string(e.name)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=SIt();while(n.pos>>3){case 1:{if(o!==10){break}i.type=n.string();continue}case 2:{if(o!==16){break}i.index=n.int32();continue}case 3:{if(o!==24){break}i.hidden=n.bool();continue}case 4:{if(o!==32){break}i.calculated=n.bool();continue}case 5:{if(o!==40){break}i.missing=n.bool();continue}case 6:{if(o!==48){break}i.repeatedItemCount=n.int32();continue}case 7:{if(o!==56){break}i.dataFieldIndex=n.int32();continue}case 8:{if(o!==64){break}i.hideDetails=n.bool();continue}case 9:{if(o===72){i.memberPropertyIndexes.push(n.int32());continue}if(o===74){const a=n.uint32()+n.pos;while(n.posn)||[];t.memberProperties=e.memberProperties?.map(n=>$he.fromPartial(n))||[];t.name=e.name??void 0;return t}};function AIt(){return{value:void 0}}var $he={encode(e,t=new tn){if(e.value!==void 0){t.uint32(8).int32(e.value)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=AIt();while(n.pos>>3){case 1:{if(o!==8){break}i.value=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return $he.fromPartial(e??{})},fromPartial(e){const t=AIt();t.value=e.value??void 0;return t}};function kIt(){return{value:void 0}}var Ghe={encode(e,t=new tn){if(e.value!==void 0){t.uint32(8).uint32(e.value)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=kIt();while(n.pos>>3){case 1:{if(o!==8){break}i.value=n.uint32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Ghe.fromPartial(e??{})},fromPartial(e){const t=kIt();t.value=e.value??void 0;return t}};function RIt(){return{field:void 0,count:void 0,selected:void 0,values:[]}}var Hhe={encode(e,t=new tn){if(e.field!==void 0){t.uint32(8).uint32(e.field)}if(e.count!==void 0){t.uint32(16).uint32(e.count)}if(e.selected!==void 0){t.uint32(24).bool(e.selected)}for(const n of e.values){Ghe.encode(n,t.uint32(34).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=RIt();while(n.pos>>3){case 1:{if(o!==8){break}i.field=n.uint32();continue}case 2:{if(o!==16){break}i.count=n.uint32();continue}case 3:{if(o!==24){break}i.selected=n.bool();continue}case 4:{if(o!==34){break}i.values.push(Ghe.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Hhe.fromPartial(e??{})},fromPartial(e){const t=RIt();t.field=e.field??void 0;t.count=e.count??void 0;t.selected=e.selected??void 0;t.values=e.values?.map(n=>Ghe.fromPartial(n))||[];return t}};function PIt(){return{field:void 0,dataOnly:void 0,labelOnly:void 0,outline:void 0,fieldPosition:void 0,references:[],type:void 0,axis:void 0,collapsedLevelsAreSubtotals:void 0,grandRow:void 0,grandColumn:void 0,offset:void 0}}var cE={encode(e,t=new tn){if(e.field!==void 0){t.uint32(8).int32(e.field)}if(e.dataOnly!==void 0){t.uint32(16).bool(e.dataOnly)}if(e.labelOnly!==void 0){t.uint32(24).bool(e.labelOnly)}if(e.outline!==void 0){t.uint32(32).bool(e.outline)}if(e.fieldPosition!==void 0){t.uint32(40).uint32(e.fieldPosition)}for(const n of e.references){Hhe.encode(n,t.uint32(50).fork()).join()}if(e.type!==void 0){t.uint32(58).string(e.type)}if(e.axis!==void 0){t.uint32(66).string(e.axis)}if(e.collapsedLevelsAreSubtotals!==void 0){t.uint32(72).bool(e.collapsedLevelsAreSubtotals)}if(e.grandRow!==void 0){t.uint32(80).bool(e.grandRow)}if(e.grandColumn!==void 0){t.uint32(88).bool(e.grandColumn)}if(e.offset!==void 0){t.uint32(98).string(e.offset)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=PIt();while(n.pos>>3){case 1:{if(o!==8){break}i.field=n.int32();continue}case 2:{if(o!==16){break}i.dataOnly=n.bool();continue}case 3:{if(o!==24){break}i.labelOnly=n.bool();continue}case 4:{if(o!==32){break}i.outline=n.bool();continue}case 5:{if(o!==40){break}i.fieldPosition=n.uint32();continue}case 6:{if(o!==50){break}i.references.push(Hhe.decode(n,n.uint32()));continue}case 7:{if(o!==58){break}i.type=n.string();continue}case 8:{if(o!==66){break}i.axis=n.string();continue}case 9:{if(o!==72){break}i.collapsedLevelsAreSubtotals=n.bool();continue}case 10:{if(o!==80){break}i.grandRow=n.bool();continue}case 11:{if(o!==88){break}i.grandColumn=n.bool();continue}case 12:{if(o!==98){break}i.offset=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return cE.fromPartial(e??{})},fromPartial(e){const t=PIt();t.field=e.field??void 0;t.dataOnly=e.dataOnly??void 0;t.labelOnly=e.labelOnly??void 0;t.outline=e.outline??void 0;t.fieldPosition=e.fieldPosition??void 0;t.references=e.references?.map(n=>Hhe.fromPartial(n))||[];t.type=e.type??void 0;t.axis=e.axis??void 0;t.collapsedLevelsAreSubtotals=e.collapsedLevelsAreSubtotals??void 0;t.grandRow=e.grandRow??void 0;t.grandColumn=e.grandColumn??void 0;t.offset=e.offset??void 0;return t}};function IIt(){return{area:void 0}}var Whe={encode(e,t=new tn){if(e.area!==void 0){cE.encode(e.area,t.uint32(10).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=IIt();while(n.pos>>3){case 1:{if(o!==10){break}i.area=cE.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Whe.fromPartial(e??{})},fromPartial(e){const t=IIt();t.area=e.area!==void 0&&e.area!==null?cE.fromPartial(e.area):void 0;return t}};function MIt(){return{index:0,name:"",axis:void 0,dataField:void 0,showAll:void 0,subtotalTop:void 0,items:[],numberFormatId:void 0,sortType:void 0,multipleItemSelectionAllowed:void 0,autoSortScope:void 0,compact:void 0,outline:void 0,defaultSubtotal:void 0,measureFilter:void 0,allDrilled:void 0,dataSourceSort:void 0,defaultAttributeDrillState:void 0,dragToRow:void 0,dragToColumn:void 0,dragToPage:void 0,axisEnum:void 0,sortTypeEnum:void 0}}var Yhe={encode(e,t=new tn){if(e.index!==0){t.uint32(8).int32(e.index)}if(e.name!==""){t.uint32(18).string(e.name)}if(e.axis!==void 0){t.uint32(26).string(e.axis)}if(e.dataField!==void 0){t.uint32(32).bool(e.dataField)}if(e.showAll!==void 0){t.uint32(40).bool(e.showAll)}if(e.subtotalTop!==void 0){t.uint32(48).bool(e.subtotalTop)}for(const n of e.items){iE.encode(n,t.uint32(58).fork()).join()}if(e.numberFormatId!==void 0){t.uint32(64).uint32(e.numberFormatId)}if(e.sortType!==void 0){t.uint32(74).string(e.sortType)}if(e.multipleItemSelectionAllowed!==void 0){t.uint32(80).bool(e.multipleItemSelectionAllowed)}if(e.autoSortScope!==void 0){Whe.encode(e.autoSortScope,t.uint32(90).fork()).join()}if(e.compact!==void 0){t.uint32(96).bool(e.compact)}if(e.outline!==void 0){t.uint32(104).bool(e.outline)}if(e.defaultSubtotal!==void 0){t.uint32(112).bool(e.defaultSubtotal)}if(e.measureFilter!==void 0){t.uint32(120).bool(e.measureFilter)}if(e.allDrilled!==void 0){t.uint32(128).bool(e.allDrilled)}if(e.dataSourceSort!==void 0){t.uint32(136).bool(e.dataSourceSort)}if(e.defaultAttributeDrillState!==void 0){t.uint32(144).bool(e.defaultAttributeDrillState)}if(e.dragToRow!==void 0){t.uint32(152).bool(e.dragToRow)}if(e.dragToColumn!==void 0){t.uint32(160).bool(e.dragToColumn)}if(e.dragToPage!==void 0){t.uint32(168).bool(e.dragToPage)}if(e.axisEnum!==void 0){t.uint32(240).int32(e.axisEnum)}if(e.sortTypeEnum!==void 0){t.uint32(248).int32(e.sortTypeEnum)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=MIt();while(n.pos>>3){case 1:{if(o!==8){break}i.index=n.int32();continue}case 2:{if(o!==18){break}i.name=n.string();continue}case 3:{if(o!==26){break}i.axis=n.string();continue}case 4:{if(o!==32){break}i.dataField=n.bool();continue}case 5:{if(o!==40){break}i.showAll=n.bool();continue}case 6:{if(o!==48){break}i.subtotalTop=n.bool();continue}case 7:{if(o!==58){break}i.items.push(iE.decode(n,n.uint32()));continue}case 8:{if(o!==64){break}i.numberFormatId=n.uint32();continue}case 9:{if(o!==74){break}i.sortType=n.string();continue}case 10:{if(o!==80){break}i.multipleItemSelectionAllowed=n.bool();continue}case 11:{if(o!==90){break}i.autoSortScope=Whe.decode(n,n.uint32());continue}case 12:{if(o!==96){break}i.compact=n.bool();continue}case 13:{if(o!==104){break}i.outline=n.bool();continue}case 14:{if(o!==112){break}i.defaultSubtotal=n.bool();continue}case 15:{if(o!==120){break}i.measureFilter=n.bool();continue}case 16:{if(o!==128){break}i.allDrilled=n.bool();continue}case 17:{if(o!==136){break}i.dataSourceSort=n.bool();continue}case 18:{if(o!==144){break}i.defaultAttributeDrillState=n.bool();continue}case 19:{if(o!==152){break}i.dragToRow=n.bool();continue}case 20:{if(o!==160){break}i.dragToColumn=n.bool();continue}case 21:{if(o!==168){break}i.dragToPage=n.bool();continue}case 30:{if(o!==240){break}i.axisEnum=n.int32();continue}case 31:{if(o!==248){break}i.sortTypeEnum=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Yhe.fromPartial(e??{})},fromPartial(e){const t=MIt();t.index=e.index??0;t.name=e.name??"";t.axis=e.axis??void 0;t.dataField=e.dataField??void 0;t.showAll=e.showAll??void 0;t.subtotalTop=e.subtotalTop??void 0;t.items=e.items?.map(n=>iE.fromPartial(n))||[];t.numberFormatId=e.numberFormatId??void 0;t.sortType=e.sortType??void 0;t.multipleItemSelectionAllowed=e.multipleItemSelectionAllowed??void 0;t.autoSortScope=e.autoSortScope!==void 0&&e.autoSortScope!==null?Whe.fromPartial(e.autoSortScope):void 0;t.compact=e.compact??void 0;t.outline=e.outline??void 0;t.defaultSubtotal=e.defaultSubtotal??void 0;t.measureFilter=e.measureFilter??void 0;t.allDrilled=e.allDrilled??void 0;t.dataSourceSort=e.dataSourceSort??void 0;t.defaultAttributeDrillState=e.defaultAttributeDrillState??void 0;t.dragToRow=e.dragToRow??void 0;t.dragToColumn=e.dragToColumn??void 0;t.dragToPage=e.dragToPage??void 0;t.axisEnum=e.axisEnum??void 0;t.sortTypeEnum=e.sortTypeEnum??void 0;return t}};function LIt(){return{field:0,item:void 0,name:void 0,hierarchy:void 0}}var qhe={encode(e,t=new tn){if(e.field!==0){t.uint32(8).int32(e.field)}if(e.item!==void 0){t.uint32(16).int32(e.item)}if(e.name!==void 0){t.uint32(26).string(e.name)}if(e.hierarchy!==void 0){t.uint32(32).int32(e.hierarchy)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=LIt();while(n.pos>>3){case 1:{if(o!==8){break}i.field=n.int32();continue}case 2:{if(o!==16){break}i.item=n.int32();continue}case 3:{if(o!==26){break}i.name=n.string();continue}case 4:{if(o!==32){break}i.hierarchy=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return qhe.fromPartial(e??{})},fromPartial(e){const t=LIt();t.field=e.field??0;t.item=e.item??void 0;t.name=e.name??void 0;t.hierarchy=e.hierarchy??void 0;return t}};function DIt(){return{field:0,name:void 0,subtotal:void 0,numberFormatId:void 0,showAs:void 0,baseField:void 0,baseItem:void 0,subtotalEnum:void 0}}var Xhe={encode(e,t=new tn){if(e.field!==0){t.uint32(8).int32(e.field)}if(e.name!==void 0){t.uint32(18).string(e.name)}if(e.subtotal!==void 0){t.uint32(26).string(e.subtotal)}if(e.numberFormatId!==void 0){t.uint32(32).uint32(e.numberFormatId)}if(e.showAs!==void 0){t.uint32(42).string(e.showAs)}if(e.baseField!==void 0){t.uint32(48).int32(e.baseField)}if(e.baseItem!==void 0){t.uint32(56).int32(e.baseItem)}if(e.subtotalEnum!==void 0){t.uint32(240).int32(e.subtotalEnum)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=DIt();while(n.pos>>3){case 1:{if(o!==8){break}i.field=n.int32();continue}case 2:{if(o!==18){break}i.name=n.string();continue}case 3:{if(o!==26){break}i.subtotal=n.string();continue}case 4:{if(o!==32){break}i.numberFormatId=n.uint32();continue}case 5:{if(o!==42){break}i.showAs=n.string();continue}case 6:{if(o!==48){break}i.baseField=n.int32();continue}case 7:{if(o!==56){break}i.baseItem=n.int32();continue}case 30:{if(o!==240){break}i.subtotalEnum=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Xhe.fromPartial(e??{})},fromPartial(e){const t=DIt();t.field=e.field??0;t.name=e.name??void 0;t.subtotal=e.subtotal??void 0;t.numberFormatId=e.numberFormatId??void 0;t.showAs=e.showAs??void 0;t.baseField=e.baseField??void 0;t.baseItem=e.baseItem??void 0;t.subtotalEnum=e.subtotalEnum??void 0;return t}};function FIt(){return{field:0,type:"",name:void 0,description:void 0,evaluationOrder:void 0,measureField:void 0,autoFilter:void 0,typeEnum:void 0}}var jhe={encode(e,t=new tn){if(e.field!==0){t.uint32(8).int32(e.field)}if(e.type!==""){t.uint32(18).string(e.type)}if(e.name!==void 0){t.uint32(26).string(e.name)}if(e.description!==void 0){t.uint32(34).string(e.description)}if(e.evaluationOrder!==void 0){t.uint32(40).int32(e.evaluationOrder)}if(e.measureField!==void 0){t.uint32(48).uint32(e.measureField)}if(e.autoFilter!==void 0){lE.encode(e.autoFilter,t.uint32(58).fork()).join()}if(e.typeEnum!==void 0){t.uint32(240).int32(e.typeEnum)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=FIt();while(n.pos>>3){case 1:{if(o!==8){break}i.field=n.int32();continue}case 2:{if(o!==18){break}i.type=n.string();continue}case 3:{if(o!==26){break}i.name=n.string();continue}case 4:{if(o!==34){break}i.description=n.string();continue}case 5:{if(o!==40){break}i.evaluationOrder=n.int32();continue}case 6:{if(o!==48){break}i.measureField=n.uint32();continue}case 7:{if(o!==58){break}i.autoFilter=lE.decode(n,n.uint32());continue}case 30:{if(o!==240){break}i.typeEnum=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return jhe.fromPartial(e??{})},fromPartial(e){const t=FIt();t.field=e.field??0;t.type=e.type??"";t.name=e.name??void 0;t.description=e.description??void 0;t.evaluationOrder=e.evaluationOrder??void 0;t.measureField=e.measureField??void 0;t.autoFilter=e.autoFilter!==void 0&&e.autoFilter!==null?lE.fromPartial(e.autoFilter):void 0;t.typeEnum=e.typeEnum??void 0;return t}};function NIt(){return{formatId:void 0,area:void 0}}var Khe={encode(e,t=new tn){if(e.formatId!==void 0){t.uint32(8).uint32(e.formatId)}if(e.area!==void 0){cE.encode(e.area,t.uint32(18).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=NIt();while(n.pos>>3){case 1:{if(o!==8){break}i.formatId=n.uint32();continue}case 2:{if(o!==18){break}i.area=cE.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Khe.fromPartial(e??{})},fromPartial(e){const t=NIt();t.formatId=e.formatId??void 0;t.area=e.area!==void 0&&e.area!==null?cE.fromPartial(e.area):void 0;return t}};function OIt(){return{scope:void 0,priority:void 0,areas:[],scopeEnum:void 0}}var Zhe={encode(e,t=new tn){if(e.scope!==void 0){t.uint32(10).string(e.scope)}if(e.priority!==void 0){t.uint32(16).uint32(e.priority)}for(const n of e.areas){cE.encode(n,t.uint32(26).fork()).join()}if(e.scopeEnum!==void 0){t.uint32(240).int32(e.scopeEnum)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=OIt();while(n.pos>>3){case 1:{if(o!==10){break}i.scope=n.string();continue}case 2:{if(o!==16){break}i.priority=n.uint32();continue}case 3:{if(o!==26){break}i.areas.push(cE.decode(n,n.uint32()));continue}case 30:{if(o!==240){break}i.scopeEnum=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Zhe.fromPartial(e??{})},fromPartial(e){const t=OIt();t.scope=e.scope??void 0;t.priority=e.priority??void 0;t.areas=e.areas?.map(n=>cE.fromPartial(n))||[];t.scopeEnum=e.scopeEnum??void 0;return t}};function BIt(){return{outline:void 0,multipleItemSelectionAllowed:void 0,subtotalTop:void 0,showInFieldList:void 0,dragToRow:void 0,dragToColumn:void 0,dragToPage:void 0,dragToData:void 0,dragOff:void 0,includeNewItemsInFilter:void 0,caption:void 0}}var Jhe={encode(e,t=new tn){if(e.outline!==void 0){t.uint32(8).bool(e.outline)}if(e.multipleItemSelectionAllowed!==void 0){t.uint32(16).bool(e.multipleItemSelectionAllowed)}if(e.subtotalTop!==void 0){t.uint32(24).bool(e.subtotalTop)}if(e.showInFieldList!==void 0){t.uint32(32).bool(e.showInFieldList)}if(e.dragToRow!==void 0){t.uint32(40).bool(e.dragToRow)}if(e.dragToColumn!==void 0){t.uint32(48).bool(e.dragToColumn)}if(e.dragToPage!==void 0){t.uint32(56).bool(e.dragToPage)}if(e.dragToData!==void 0){t.uint32(64).bool(e.dragToData)}if(e.dragOff!==void 0){t.uint32(72).bool(e.dragOff)}if(e.includeNewItemsInFilter!==void 0){t.uint32(80).bool(e.includeNewItemsInFilter)}if(e.caption!==void 0){t.uint32(90).string(e.caption)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=BIt();while(n.pos>>3){case 1:{if(o!==8){break}i.outline=n.bool();continue}case 2:{if(o!==16){break}i.multipleItemSelectionAllowed=n.bool();continue}case 3:{if(o!==24){break}i.subtotalTop=n.bool();continue}case 4:{if(o!==32){break}i.showInFieldList=n.bool();continue}case 5:{if(o!==40){break}i.dragToRow=n.bool();continue}case 6:{if(o!==48){break}i.dragToColumn=n.bool();continue}case 7:{if(o!==56){break}i.dragToPage=n.bool();continue}case 8:{if(o!==64){break}i.dragToData=n.bool();continue}case 9:{if(o!==72){break}i.dragOff=n.bool();continue}case 10:{if(o!==80){break}i.includeNewItemsInFilter=n.bool();continue}case 11:{if(o!==90){break}i.caption=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Jhe.fromPartial(e??{})},fromPartial(e){const t=BIt();t.outline=e.outline??void 0;t.multipleItemSelectionAllowed=e.multipleItemSelectionAllowed??void 0;t.subtotalTop=e.subtotalTop??void 0;t.showInFieldList=e.showInFieldList??void 0;t.dragToRow=e.dragToRow??void 0;t.dragToColumn=e.dragToColumn??void 0;t.dragToPage=e.dragToPage??void 0;t.dragToData=e.dragToData??void 0;t.dragOff=e.dragOff??void 0;t.includeNewItemsInFilter=e.includeNewItemsInFilter??void 0;t.caption=e.caption??void 0;return t}};function zIt(){return{hierarchyUsage:void 0}}var Z4={encode(e,t=new tn){if(e.hierarchyUsage!==void 0){t.uint32(8).int32(e.hierarchyUsage)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=zIt();while(n.pos>>3){case 1:{if(o!==8){break}i.hierarchyUsage=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Z4.fromPartial(e??{})},fromPartial(e){const t=zIt();t.hierarchyUsage=e.hierarchyUsage??void 0;return t}};function UIt(){return{name:"",cacheId:0,location:void 0,dataOnRows:void 0,rowGrandTotals:void 0,columnGrandTotals:void 0,pivotFields:[],rowFields:[],columnFields:[],pageFields:[],dataFields:[],filters:[],compact:void 0,outline:void 0,showDrill:void 0,styleName:void 0,rowItems:[],columnItems:[],showRowHeaders:void 0,showColHeaders:void 0,showRowStripes:void 0,showColStripes:void 0,showLastColumn:void 0,applyNumberFormats:void 0,applyBorderFormats:void 0,applyFontFormats:void 0,applyPatternFormats:void 0,applyAlignmentFormats:void 0,applyWidthHeightFormats:void 0,dataCaption:void 0,updatedVersion:void 0,minRefreshableVersion:void 0,useAutoFormatting:void 0,itemPrintTitles:void 0,createdVersion:void 0,indent:void 0,outlineData:void 0,multipleFieldFilters:void 0,chartFormat:void 0,extensionListXml:void 0,grandTotalCaption:void 0,compactData:void 0,formats:[],conditionalFormats:[],rowHeaderCaption:void 0,columnHeaderCaption:void 0,dataPosition:void 0,pivotHierarchies:[],subtotalHiddenItems:void 0,showHeaders:void 0,rowHierarchyUsages:[],columnHierarchyUsages:[]}}var Qhe={encode(e,t=new tn){if(e.name!==""){t.uint32(10).string(e.name)}if(e.cacheId!==0){t.uint32(16).int32(e.cacheId)}if(e.location!==void 0){Vhe.encode(e.location,t.uint32(26).fork()).join()}if(e.dataOnRows!==void 0){t.uint32(32).bool(e.dataOnRows)}if(e.rowGrandTotals!==void 0){t.uint32(40).bool(e.rowGrandTotals)}if(e.columnGrandTotals!==void 0){t.uint32(48).bool(e.columnGrandTotals)}for(const n of e.pivotFields){Yhe.encode(n,t.uint32(58).fork()).join()}t.uint32(66).fork();for(const n of e.rowFields){t.int32(n)}t.join();t.uint32(74).fork();for(const n of e.columnFields){t.int32(n)}t.join();for(const n of e.pageFields){qhe.encode(n,t.uint32(82).fork()).join()}for(const n of e.dataFields){Xhe.encode(n,t.uint32(90).fork()).join()}for(const n of e.filters){jhe.encode(n,t.uint32(98).fork()).join()}if(e.compact!==void 0){t.uint32(104).bool(e.compact)}if(e.outline!==void 0){t.uint32(112).bool(e.outline)}if(e.showDrill!==void 0){t.uint32(120).bool(e.showDrill)}if(e.styleName!==void 0){t.uint32(130).string(e.styleName)}for(const n of e.rowItems){iE.encode(n,t.uint32(138).fork()).join()}for(const n of e.columnItems){iE.encode(n,t.uint32(146).fork()).join()}if(e.showRowHeaders!==void 0){t.uint32(152).bool(e.showRowHeaders)}if(e.showColHeaders!==void 0){t.uint32(160).bool(e.showColHeaders)}if(e.showRowStripes!==void 0){t.uint32(168).bool(e.showRowStripes)}if(e.showColStripes!==void 0){t.uint32(176).bool(e.showColStripes)}if(e.showLastColumn!==void 0){t.uint32(184).bool(e.showLastColumn)}if(e.applyNumberFormats!==void 0){t.uint32(192).bool(e.applyNumberFormats)}if(e.applyBorderFormats!==void 0){t.uint32(200).bool(e.applyBorderFormats)}if(e.applyFontFormats!==void 0){t.uint32(208).bool(e.applyFontFormats)}if(e.applyPatternFormats!==void 0){t.uint32(216).bool(e.applyPatternFormats)}if(e.applyAlignmentFormats!==void 0){t.uint32(224).bool(e.applyAlignmentFormats)}if(e.applyWidthHeightFormats!==void 0){t.uint32(232).bool(e.applyWidthHeightFormats)}if(e.dataCaption!==void 0){t.uint32(242).string(e.dataCaption)}if(e.updatedVersion!==void 0){t.uint32(248).uint32(e.updatedVersion)}if(e.minRefreshableVersion!==void 0){t.uint32(256).uint32(e.minRefreshableVersion)}if(e.useAutoFormatting!==void 0){t.uint32(264).bool(e.useAutoFormatting)}if(e.itemPrintTitles!==void 0){t.uint32(272).bool(e.itemPrintTitles)}if(e.createdVersion!==void 0){t.uint32(280).uint32(e.createdVersion)}if(e.indent!==void 0){t.uint32(289).double(e.indent)}if(e.outlineData!==void 0){t.uint32(296).bool(e.outlineData)}if(e.multipleFieldFilters!==void 0){t.uint32(304).bool(e.multipleFieldFilters)}if(e.chartFormat!==void 0){t.uint32(312).uint32(e.chartFormat)}if(e.extensionListXml!==void 0){t.uint32(322).string(e.extensionListXml)}if(e.grandTotalCaption!==void 0){t.uint32(330).string(e.grandTotalCaption)}if(e.compactData!==void 0){t.uint32(336).bool(e.compactData)}for(const n of e.formats){Khe.encode(n,t.uint32(346).fork()).join()}for(const n of e.conditionalFormats){Zhe.encode(n,t.uint32(354).fork()).join()}if(e.rowHeaderCaption!==void 0){t.uint32(362).string(e.rowHeaderCaption)}if(e.columnHeaderCaption!==void 0){t.uint32(370).string(e.columnHeaderCaption)}if(e.dataPosition!==void 0){t.uint32(376).uint32(e.dataPosition)}for(const n of e.pivotHierarchies){Jhe.encode(n,t.uint32(386).fork()).join()}if(e.subtotalHiddenItems!==void 0){t.uint32(392).bool(e.subtotalHiddenItems)}if(e.showHeaders!==void 0){t.uint32(400).bool(e.showHeaders)}for(const n of e.rowHierarchyUsages){Z4.encode(n,t.uint32(410).fork()).join()}for(const n of e.columnHierarchyUsages){Z4.encode(n,t.uint32(418).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=UIt();while(n.pos>>3){case 1:{if(o!==10){break}i.name=n.string();continue}case 2:{if(o!==16){break}i.cacheId=n.int32();continue}case 3:{if(o!==26){break}i.location=Vhe.decode(n,n.uint32());continue}case 4:{if(o!==32){break}i.dataOnRows=n.bool();continue}case 5:{if(o!==40){break}i.rowGrandTotals=n.bool();continue}case 6:{if(o!==48){break}i.columnGrandTotals=n.bool();continue}case 7:{if(o!==58){break}i.pivotFields.push(Yhe.decode(n,n.uint32()));continue}case 8:{if(o===64){i.rowFields.push(n.int32());continue}if(o===66){const a=n.uint32()+n.pos;while(n.posYhe.fromPartial(n))||[];t.rowFields=e.rowFields?.map(n=>n)||[];t.columnFields=e.columnFields?.map(n=>n)||[];t.pageFields=e.pageFields?.map(n=>qhe.fromPartial(n))||[];t.dataFields=e.dataFields?.map(n=>Xhe.fromPartial(n))||[];t.filters=e.filters?.map(n=>jhe.fromPartial(n))||[];t.compact=e.compact??void 0;t.outline=e.outline??void 0;t.showDrill=e.showDrill??void 0;t.styleName=e.styleName??void 0;t.rowItems=e.rowItems?.map(n=>iE.fromPartial(n))||[];t.columnItems=e.columnItems?.map(n=>iE.fromPartial(n))||[];t.showRowHeaders=e.showRowHeaders??void 0;t.showColHeaders=e.showColHeaders??void 0;t.showRowStripes=e.showRowStripes??void 0;t.showColStripes=e.showColStripes??void 0;t.showLastColumn=e.showLastColumn??void 0;t.applyNumberFormats=e.applyNumberFormats??void 0;t.applyBorderFormats=e.applyBorderFormats??void 0;t.applyFontFormats=e.applyFontFormats??void 0;t.applyPatternFormats=e.applyPatternFormats??void 0;t.applyAlignmentFormats=e.applyAlignmentFormats??void 0;t.applyWidthHeightFormats=e.applyWidthHeightFormats??void 0;t.dataCaption=e.dataCaption??void 0;t.updatedVersion=e.updatedVersion??void 0;t.minRefreshableVersion=e.minRefreshableVersion??void 0;t.useAutoFormatting=e.useAutoFormatting??void 0;t.itemPrintTitles=e.itemPrintTitles??void 0;t.createdVersion=e.createdVersion??void 0;t.indent=e.indent??void 0;t.outlineData=e.outlineData??void 0;t.multipleFieldFilters=e.multipleFieldFilters??void 0;t.chartFormat=e.chartFormat??void 0;t.extensionListXml=e.extensionListXml??void 0;t.grandTotalCaption=e.grandTotalCaption??void 0;t.compactData=e.compactData??void 0;t.formats=e.formats?.map(n=>Khe.fromPartial(n))||[];t.conditionalFormats=e.conditionalFormats?.map(n=>Zhe.fromPartial(n))||[];t.rowHeaderCaption=e.rowHeaderCaption??void 0;t.columnHeaderCaption=e.columnHeaderCaption??void 0;t.dataPosition=e.dataPosition??void 0;t.pivotHierarchies=e.pivotHierarchies?.map(n=>Jhe.fromPartial(n))||[];t.subtotalHiddenItems=e.subtotalHiddenItems??void 0;t.showHeaders=e.showHeaders??void 0;t.rowHierarchyUsages=e.rowHierarchyUsages?.map(n=>Z4.fromPartial(n))||[];t.columnHierarchyUsages=e.columnHierarchyUsages?.map(n=>Z4.fromPartial(n))||[];return t}};function VIt(){return{name:"",caption:"",cache:"",lockedPosition:void 0,displayHeader:void 0,showNoDataItems:void 0,sortBy:void 0,style:void 0,fromAnchor:void 0,toAnchor:void 0,cacheId:void 0,width:void 0,height:void 0,isMultiSelect:void 0,fill:void 0,line:void 0,headerTextStyle:void 0,sortByEnum:void 0,columnCount:void 0,rowHeight:void 0,level:void 0,startItem:void 0}}var epe={encode(e,t=new tn){if(e.name!==""){t.uint32(10).string(e.name)}if(e.caption!==""){t.uint32(18).string(e.caption)}if(e.cache!==""){t.uint32(26).string(e.cache)}if(e.lockedPosition!==void 0){t.uint32(32).bool(e.lockedPosition)}if(e.displayHeader!==void 0){t.uint32(40).bool(e.displayHeader)}if(e.showNoDataItems!==void 0){t.uint32(48).bool(e.showNoDataItems)}if(e.sortBy!==void 0){t.uint32(58).string(e.sortBy)}if(e.style!==void 0){t.uint32(66).string(e.style)}if(e.fromAnchor!==void 0){bp.encode(e.fromAnchor,t.uint32(74).fork()).join()}if(e.toAnchor!==void 0){bp.encode(e.toAnchor,t.uint32(82).fork()).join()}if(e.cacheId!==void 0){t.uint32(88).int32(e.cacheId)}if(e.width!==void 0){t.uint32(97).double(e.width)}if(e.height!==void 0){t.uint32(105).double(e.height)}if(e.isMultiSelect!==void 0){t.uint32(112).bool(e.isMultiSelect)}if(e.fill!==void 0){Ei.encode(e.fill,t.uint32(122).fork()).join()}if(e.line!==void 0){ui.encode(e.line,t.uint32(130).fork()).join()}if(e.headerTextStyle!==void 0){Gi.encode(e.headerTextStyle,t.uint32(138).fork()).join()}if(e.sortByEnum!==void 0){t.uint32(144).int32(e.sortByEnum)}if(e.columnCount!==void 0){t.uint32(152).int32(e.columnCount)}if(e.rowHeight!==void 0){t.uint32(160).uint32(e.rowHeight)}if(e.level!==void 0){t.uint32(168).uint32(e.level)}if(e.startItem!==void 0){t.uint32(176).uint32(e.startItem)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=VIt();while(n.pos>>3){case 1:{if(o!==10){break}i.name=n.string();continue}case 2:{if(o!==18){break}i.caption=n.string();continue}case 3:{if(o!==26){break}i.cache=n.string();continue}case 4:{if(o!==32){break}i.lockedPosition=n.bool();continue}case 5:{if(o!==40){break}i.displayHeader=n.bool();continue}case 6:{if(o!==48){break}i.showNoDataItems=n.bool();continue}case 7:{if(o!==58){break}i.sortBy=n.string();continue}case 8:{if(o!==66){break}i.style=n.string();continue}case 9:{if(o!==74){break}i.fromAnchor=bp.decode(n,n.uint32());continue}case 10:{if(o!==82){break}i.toAnchor=bp.decode(n,n.uint32());continue}case 11:{if(o!==88){break}i.cacheId=n.int32();continue}case 12:{if(o!==97){break}i.width=n.double();continue}case 13:{if(o!==105){break}i.height=n.double();continue}case 14:{if(o!==112){break}i.isMultiSelect=n.bool();continue}case 15:{if(o!==122){break}i.fill=Ei.decode(n,n.uint32());continue}case 16:{if(o!==130){break}i.line=ui.decode(n,n.uint32());continue}case 17:{if(o!==138){break}i.headerTextStyle=Gi.decode(n,n.uint32());continue}case 18:{if(o!==144){break}i.sortByEnum=n.int32();continue}case 19:{if(o!==152){break}i.columnCount=n.int32();continue}case 20:{if(o!==160){break}i.rowHeight=n.uint32();continue}case 21:{if(o!==168){break}i.level=n.uint32();continue}case 22:{if(o!==176){break}i.startItem=n.uint32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return epe.fromPartial(e??{})},fromPartial(e){const t=VIt();t.name=e.name??"";t.caption=e.caption??"";t.cache=e.cache??"";t.lockedPosition=e.lockedPosition??void 0;t.displayHeader=e.displayHeader??void 0;t.showNoDataItems=e.showNoDataItems??void 0;t.sortBy=e.sortBy??void 0;t.style=e.style??void 0;t.fromAnchor=e.fromAnchor!==void 0&&e.fromAnchor!==null?bp.fromPartial(e.fromAnchor):void 0;t.toAnchor=e.toAnchor!==void 0&&e.toAnchor!==null?bp.fromPartial(e.toAnchor):void 0;t.cacheId=e.cacheId??void 0;t.width=e.width??void 0;t.height=e.height??void 0;t.isMultiSelect=e.isMultiSelect??void 0;t.fill=e.fill!==void 0&&e.fill!==null?Ei.fromPartial(e.fill):void 0;t.line=e.line!==void 0&&e.line!==null?ui.fromPartial(e.line):void 0;t.headerTextStyle=e.headerTextStyle!==void 0&&e.headerTextStyle!==null?Gi.fromPartial(e.headerTextStyle):void 0;t.sortByEnum=e.sortByEnum??void 0;t.columnCount=e.columnCount??void 0;t.rowHeight=e.rowHeight??void 0;t.level=e.level??void 0;t.startItem=e.startItem??void 0;return t}};function $It(){return{index:void 0,value:"",selected:void 0,hasData:void 0,hidden:void 0}}var tpe={encode(e,t=new tn){if(e.index!==void 0){t.uint32(8).int32(e.index)}if(e.value!==""){t.uint32(18).string(e.value)}if(e.selected!==void 0){t.uint32(24).bool(e.selected)}if(e.hasData!==void 0){t.uint32(32).bool(e.hasData)}if(e.hidden!==void 0){t.uint32(40).bool(e.hidden)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=$It();while(n.pos>>3){case 1:{if(o!==8){break}i.index=n.int32();continue}case 2:{if(o!==18){break}i.value=n.string();continue}case 3:{if(o!==24){break}i.selected=n.bool();continue}case 4:{if(o!==32){break}i.hasData=n.bool();continue}case 5:{if(o!==40){break}i.hidden=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return tpe.fromPartial(e??{})},fromPartial(e){const t=$It();t.index=e.index??void 0;t.value=e.value??"";t.selected=e.selected??void 0;t.hasData=e.hasData??void 0;t.hidden=e.hidden??void 0;return t}};function GIt(){return{tabId:0,name:""}}var npe={encode(e,t=new tn){if(e.tabId!==0){t.uint32(8).uint32(e.tabId)}if(e.name!==""){t.uint32(18).string(e.name)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=GIt();while(n.pos>>3){case 1:{if(o!==8){break}i.tabId=n.uint32();continue}case 2:{if(o!==18){break}i.name=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return npe.fromPartial(e??{})},fromPartial(e){const t=GIt();t.tabId=e.tabId??0;t.name=e.name??"";return t}};function HIt(){return{name:"",caption:void 0,hidden:void 0,parentNames:[]}}var rpe={encode(e,t=new tn){if(e.name!==""){t.uint32(10).string(e.name)}if(e.caption!==void 0){t.uint32(18).string(e.caption)}if(e.hidden!==void 0){t.uint32(24).bool(e.hidden)}for(const n of e.parentNames){t.uint32(34).string(n)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=HIt();while(n.pos>>3){case 1:{if(o!==10){break}i.name=n.string();continue}case 2:{if(o!==18){break}i.caption=n.string();continue}case 3:{if(o!==24){break}i.hidden=n.bool();continue}case 4:{if(o!==34){break}i.parentNames.push(n.string());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return rpe.fromPartial(e??{})},fromPartial(e){const t=HIt();t.name=e.name??"";t.caption=e.caption??void 0;t.hidden=e.hidden??void 0;t.parentNames=e.parentNames?.map(n=>n)||[];return t}};function WIt(){return{startItem:void 0,items:[]}}var ipe={encode(e,t=new tn){if(e.startItem!==void 0){t.uint32(8).uint32(e.startItem)}for(const n of e.items){rpe.encode(n,t.uint32(18).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=WIt();while(n.pos>>3){case 1:{if(o!==8){break}i.startItem=n.uint32();continue}case 2:{if(o!==18){break}i.items.push(rpe.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return ipe.fromPartial(e??{})},fromPartial(e){const t=WIt();t.startItem=e.startItem??void 0;t.items=e.items?.map(n=>rpe.fromPartial(n))||[];return t}};function YIt(){return{uniqueName:"",sourceCaption:void 0,count:void 0,ranges:[]}}var ope={encode(e,t=new tn){if(e.uniqueName!==""){t.uint32(10).string(e.uniqueName)}if(e.sourceCaption!==void 0){t.uint32(18).string(e.sourceCaption)}if(e.count!==void 0){t.uint32(24).uint32(e.count)}for(const n of e.ranges){ipe.encode(n,t.uint32(34).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=YIt();while(n.pos>>3){case 1:{if(o!==10){break}i.uniqueName=n.string();continue}case 2:{if(o!==18){break}i.sourceCaption=n.string();continue}case 3:{if(o!==24){break}i.count=n.uint32();continue}case 4:{if(o!==34){break}i.ranges.push(ipe.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return ope.fromPartial(e??{})},fromPartial(e){const t=YIt();t.uniqueName=e.uniqueName??"";t.sourceCaption=e.sourceCaption??void 0;t.count=e.count??void 0;t.ranges=e.ranges?.map(n=>ipe.fromPartial(n))||[];return t}};function qIt(){return{name:"",parentNames:[]}}var ape={encode(e,t=new tn){if(e.name!==""){t.uint32(10).string(e.name)}for(const n of e.parentNames){t.uint32(18).string(n)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=qIt();while(n.pos>>3){case 1:{if(o!==10){break}i.name=n.string();continue}case 2:{if(o!==18){break}i.parentNames.push(n.string());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return ape.fromPartial(e??{})},fromPartial(e){const t=qIt();t.name=e.name??"";t.parentNames=e.parentNames?.map(n=>n)||[];return t}};function XIt(){return{name:"",caption:void 0,sourceName:void 0,type:void 0,pivotCacheId:void 0,pivotTableIds:[],tableId:void 0,tableName:void 0,columnName:void 0,crossFilter:void 0,sortOrder:void 0,items:[],typeEnum:void 0,crossFilterEnum:void 0,pivotTableRefs:[],olap:void 0,olapLevels:[],olapSelections:[]}}var spe={encode(e,t=new tn){if(e.name!==""){t.uint32(10).string(e.name)}if(e.caption!==void 0){t.uint32(18).string(e.caption)}if(e.sourceName!==void 0){t.uint32(26).string(e.sourceName)}if(e.type!==void 0){t.uint32(34).string(e.type)}if(e.pivotCacheId!==void 0){t.uint32(40).int32(e.pivotCacheId)}t.uint32(50).fork();for(const n of e.pivotTableIds){t.int32(n)}t.join();if(e.tableId!==void 0){t.uint32(56).int32(e.tableId)}if(e.tableName!==void 0){t.uint32(66).string(e.tableName)}if(e.columnName!==void 0){t.uint32(74).string(e.columnName)}if(e.crossFilter!==void 0){t.uint32(82).string(e.crossFilter)}if(e.sortOrder!==void 0){t.uint32(90).string(e.sortOrder)}for(const n of e.items){tpe.encode(n,t.uint32(98).fork()).join()}if(e.typeEnum!==void 0){t.uint32(104).int32(e.typeEnum)}if(e.crossFilterEnum!==void 0){t.uint32(112).int32(e.crossFilterEnum)}for(const n of e.pivotTableRefs){npe.encode(n,t.uint32(122).fork()).join()}if(e.olap!==void 0){t.uint32(128).bool(e.olap)}for(const n of e.olapLevels){ope.encode(n,t.uint32(138).fork()).join()}for(const n of e.olapSelections){ape.encode(n,t.uint32(146).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=XIt();while(n.pos>>3){case 1:{if(o!==10){break}i.name=n.string();continue}case 2:{if(o!==18){break}i.caption=n.string();continue}case 3:{if(o!==26){break}i.sourceName=n.string();continue}case 4:{if(o!==34){break}i.type=n.string();continue}case 5:{if(o!==40){break}i.pivotCacheId=n.int32();continue}case 6:{if(o===48){i.pivotTableIds.push(n.int32());continue}if(o===50){const a=n.uint32()+n.pos;while(n.posn)||[];t.tableId=e.tableId??void 0;t.tableName=e.tableName??void 0;t.columnName=e.columnName??void 0;t.crossFilter=e.crossFilter??void 0;t.sortOrder=e.sortOrder??void 0;t.items=e.items?.map(n=>tpe.fromPartial(n))||[];t.typeEnum=e.typeEnum??void 0;t.crossFilterEnum=e.crossFilterEnum??void 0;t.pivotTableRefs=e.pivotTableRefs?.map(n=>npe.fromPartial(n))||[];t.olap=e.olap??void 0;t.olapLevels=e.olapLevels?.map(n=>ope.fromPartial(n))||[];t.olapSelections=e.olapSelections?.map(n=>ape.fromPartial(n))||[];return t}};function jIt(){return{id:0,name:void 0,fields:[],worksheetSourceReference:void 0,worksheetSourceSheet:void 0,refreshedBy:void 0,refreshedDate:void 0,createdVersion:void 0,refreshedVersion:void 0,minRefreshableVersion:void 0,recordCount:void 0,extensionListXml:void 0,worksheetSourceName:void 0,sourceType:void 0,connectionId:void 0,saveData:void 0,backgroundQuery:void 0,supportSubquery:void 0,supportAdvancedDrill:void 0,cacheHierarchies:[],dimensions:[],measureGroups:[],maps:[],records:[],recordsCount:void 0,refreshOnLoad:void 0,workbookExtensionCache:void 0}}var lpe={encode(e,t=new tn){if(e.id!==0){t.uint32(8).int32(e.id)}if(e.name!==void 0){t.uint32(18).string(e.name)}for(const n of e.fields){dpe.encode(n,t.uint32(26).fork()).join()}if(e.worksheetSourceReference!==void 0){t.uint32(50).string(e.worksheetSourceReference)}if(e.worksheetSourceSheet!==void 0){t.uint32(58).string(e.worksheetSourceSheet)}if(e.refreshedBy!==void 0){t.uint32(66).string(e.refreshedBy)}if(e.refreshedDate!==void 0){t.uint32(74).string(e.refreshedDate)}if(e.createdVersion!==void 0){t.uint32(80).uint32(e.createdVersion)}if(e.refreshedVersion!==void 0){t.uint32(88).uint32(e.refreshedVersion)}if(e.minRefreshableVersion!==void 0){t.uint32(96).uint32(e.minRefreshableVersion)}if(e.recordCount!==void 0){t.uint32(104).uint32(e.recordCount)}if(e.extensionListXml!==void 0){t.uint32(114).string(e.extensionListXml)}if(e.worksheetSourceName!==void 0){t.uint32(122).string(e.worksheetSourceName)}if(e.sourceType!==void 0){t.uint32(128).int32(e.sourceType)}if(e.connectionId!==void 0){t.uint32(136).uint32(e.connectionId)}if(e.saveData!==void 0){t.uint32(144).bool(e.saveData)}if(e.backgroundQuery!==void 0){t.uint32(152).bool(e.backgroundQuery)}if(e.supportSubquery!==void 0){t.uint32(160).bool(e.supportSubquery)}if(e.supportAdvancedDrill!==void 0){t.uint32(168).bool(e.supportAdvancedDrill)}for(const n of e.cacheHierarchies){hpe.encode(n,t.uint32(178).fork()).join()}for(const n of e.dimensions){ppe.encode(n,t.uint32(194).fork()).join()}for(const n of e.measureGroups){mpe.encode(n,t.uint32(202).fork()).join()}for(const n of e.maps){gpe.encode(n,t.uint32(210).fork()).join()}for(const n of e.records){ype.encode(n,t.uint32(218).fork()).join()}if(e.recordsCount!==void 0){t.uint32(224).uint32(e.recordsCount)}if(e.refreshOnLoad!==void 0){t.uint32(232).bool(e.refreshOnLoad)}if(e.workbookExtensionCache!==void 0){t.uint32(240).bool(e.workbookExtensionCache)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=jIt();while(n.pos>>3){case 1:{if(o!==8){break}i.id=n.int32();continue}case 2:{if(o!==18){break}i.name=n.string();continue}case 3:{if(o!==26){break}i.fields.push(dpe.decode(n,n.uint32()));continue}case 6:{if(o!==50){break}i.worksheetSourceReference=n.string();continue}case 7:{if(o!==58){break}i.worksheetSourceSheet=n.string();continue}case 8:{if(o!==66){break}i.refreshedBy=n.string();continue}case 9:{if(o!==74){break}i.refreshedDate=n.string();continue}case 10:{if(o!==80){break}i.createdVersion=n.uint32();continue}case 11:{if(o!==88){break}i.refreshedVersion=n.uint32();continue}case 12:{if(o!==96){break}i.minRefreshableVersion=n.uint32();continue}case 13:{if(o!==104){break}i.recordCount=n.uint32();continue}case 14:{if(o!==114){break}i.extensionListXml=n.string();continue}case 15:{if(o!==122){break}i.worksheetSourceName=n.string();continue}case 16:{if(o!==128){break}i.sourceType=n.int32();continue}case 17:{if(o!==136){break}i.connectionId=n.uint32();continue}case 18:{if(o!==144){break}i.saveData=n.bool();continue}case 19:{if(o!==152){break}i.backgroundQuery=n.bool();continue}case 20:{if(o!==160){break}i.supportSubquery=n.bool();continue}case 21:{if(o!==168){break}i.supportAdvancedDrill=n.bool();continue}case 22:{if(o!==178){break}i.cacheHierarchies.push(hpe.decode(n,n.uint32()));continue}case 24:{if(o!==194){break}i.dimensions.push(ppe.decode(n,n.uint32()));continue}case 25:{if(o!==202){break}i.measureGroups.push(mpe.decode(n,n.uint32()));continue}case 26:{if(o!==210){break}i.maps.push(gpe.decode(n,n.uint32()));continue}case 27:{if(o!==218){break}i.records.push(ype.decode(n,n.uint32()));continue}case 28:{if(o!==224){break}i.recordsCount=n.uint32();continue}case 29:{if(o!==232){break}i.refreshOnLoad=n.bool();continue}case 30:{if(o!==240){break}i.workbookExtensionCache=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return lpe.fromPartial(e??{})},fromPartial(e){const t=jIt();t.id=e.id??0;t.name=e.name??void 0;t.fields=e.fields?.map(n=>dpe.fromPartial(n))||[];t.worksheetSourceReference=e.worksheetSourceReference??void 0;t.worksheetSourceSheet=e.worksheetSourceSheet??void 0;t.refreshedBy=e.refreshedBy??void 0;t.refreshedDate=e.refreshedDate??void 0;t.createdVersion=e.createdVersion??void 0;t.refreshedVersion=e.refreshedVersion??void 0;t.minRefreshableVersion=e.minRefreshableVersion??void 0;t.recordCount=e.recordCount??void 0;t.extensionListXml=e.extensionListXml??void 0;t.worksheetSourceName=e.worksheetSourceName??void 0;t.sourceType=e.sourceType??void 0;t.connectionId=e.connectionId??void 0;t.saveData=e.saveData??void 0;t.backgroundQuery=e.backgroundQuery??void 0;t.supportSubquery=e.supportSubquery??void 0;t.supportAdvancedDrill=e.supportAdvancedDrill??void 0;t.cacheHierarchies=e.cacheHierarchies?.map(n=>hpe.fromPartial(n))||[];t.dimensions=e.dimensions?.map(n=>ppe.fromPartial(n))||[];t.measureGroups=e.measureGroups?.map(n=>mpe.fromPartial(n))||[];t.maps=e.maps?.map(n=>gpe.fromPartial(n))||[];t.records=e.records?.map(n=>ype.fromPartial(n))||[];t.recordsCount=e.recordsCount??void 0;t.refreshOnLoad=e.refreshOnLoad??void 0;t.workbookExtensionCache=e.workbookExtensionCache??void 0;return t}};function KIt(){return{parent:void 0,base:void 0,rangePr:void 0,groupItems:[]}}var cpe={encode(e,t=new tn){if(e.parent!==void 0){t.uint32(8).int32(e.parent)}if(e.base!==void 0){t.uint32(16).int32(e.base)}if(e.rangePr!==void 0){upe.encode(e.rangePr,t.uint32(26).fork()).join()}for(const n of e.groupItems){t.uint32(34).string(n)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=KIt();while(n.pos>>3){case 1:{if(o!==8){break}i.parent=n.int32();continue}case 2:{if(o!==16){break}i.base=n.int32();continue}case 3:{if(o!==26){break}i.rangePr=upe.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.groupItems.push(n.string());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return cpe.fromPartial(e??{})},fromPartial(e){const t=KIt();t.parent=e.parent??void 0;t.base=e.base??void 0;t.rangePr=e.rangePr!==void 0&&e.rangePr!==null?upe.fromPartial(e.rangePr):void 0;t.groupItems=e.groupItems?.map(n=>n)||[];return t}};function ZIt(){return{groupBy:"",startDate:"",endDate:"",startNum:void 0,endNum:void 0,groupInterval:void 0}}var upe={encode(e,t=new tn){if(e.groupBy!==""){t.uint32(10).string(e.groupBy)}if(e.startDate!==""){t.uint32(18).string(e.startDate)}if(e.endDate!==""){t.uint32(26).string(e.endDate)}if(e.startNum!==void 0){t.uint32(33).double(e.startNum)}if(e.endNum!==void 0){t.uint32(41).double(e.endNum)}if(e.groupInterval!==void 0){t.uint32(49).double(e.groupInterval)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=ZIt();while(n.pos>>3){case 1:{if(o!==10){break}i.groupBy=n.string();continue}case 2:{if(o!==18){break}i.startDate=n.string();continue}case 3:{if(o!==26){break}i.endDate=n.string();continue}case 4:{if(o!==33){break}i.startNum=n.double();continue}case 5:{if(o!==41){break}i.endNum=n.double();continue}case 6:{if(o!==49){break}i.groupInterval=n.double();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return upe.fromPartial(e??{})},fromPartial(e){const t=ZIt();t.groupBy=e.groupBy??"";t.startDate=e.startDate??"";t.endDate=e.endDate??"";t.startNum=e.startNum??void 0;t.endNum=e.endNum??void 0;t.groupInterval=e.groupInterval??void 0;return t}};function JIt(){return{name:"",numFmtId:void 0,sharedItems:void 0,fieldGroup:void 0,caption:void 0,hierarchy:void 0,level:void 0,cachedUniqueNames:[],formula:void 0,databaseField:void 0}}var dpe={encode(e,t=new tn){if(e.name!==""){t.uint32(10).string(e.name)}if(e.numFmtId!==void 0){t.uint32(16).uint32(e.numFmtId)}if(e.sharedItems!==void 0){bpe.encode(e.sharedItems,t.uint32(26).fork()).join()}if(e.fieldGroup!==void 0){cpe.encode(e.fieldGroup,t.uint32(34).fork()).join()}if(e.caption!==void 0){t.uint32(42).string(e.caption)}if(e.hierarchy!==void 0){t.uint32(48).int32(e.hierarchy)}if(e.level!==void 0){t.uint32(56).uint32(e.level)}for(const n of e.cachedUniqueNames){fpe.encode(n,t.uint32(66).fork()).join()}if(e.formula!==void 0){t.uint32(74).string(e.formula)}if(e.databaseField!==void 0){t.uint32(80).bool(e.databaseField)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=JIt();while(n.pos>>3){case 1:{if(o!==10){break}i.name=n.string();continue}case 2:{if(o!==16){break}i.numFmtId=n.uint32();continue}case 3:{if(o!==26){break}i.sharedItems=bpe.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.fieldGroup=cpe.decode(n,n.uint32());continue}case 5:{if(o!==42){break}i.caption=n.string();continue}case 6:{if(o!==48){break}i.hierarchy=n.int32();continue}case 7:{if(o!==56){break}i.level=n.uint32();continue}case 8:{if(o!==66){break}i.cachedUniqueNames.push(fpe.decode(n,n.uint32()));continue}case 9:{if(o!==74){break}i.formula=n.string();continue}case 10:{if(o!==80){break}i.databaseField=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return dpe.fromPartial(e??{})},fromPartial(e){const t=JIt();t.name=e.name??"";t.numFmtId=e.numFmtId??void 0;t.sharedItems=e.sharedItems!==void 0&&e.sharedItems!==null?bpe.fromPartial(e.sharedItems):void 0;t.fieldGroup=e.fieldGroup!==void 0&&e.fieldGroup!==null?cpe.fromPartial(e.fieldGroup):void 0;t.caption=e.caption??void 0;t.hierarchy=e.hierarchy??void 0;t.level=e.level??void 0;t.cachedUniqueNames=e.cachedUniqueNames?.map(n=>fpe.fromPartial(n))||[];t.formula=e.formula??void 0;t.databaseField=e.databaseField??void 0;return t}};function QIt(){return{index:void 0,name:""}}var fpe={encode(e,t=new tn){if(e.index!==void 0){t.uint32(8).uint32(e.index)}if(e.name!==""){t.uint32(18).string(e.name)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=QIt();while(n.pos>>3){case 1:{if(o!==8){break}i.index=n.uint32();continue}case 2:{if(o!==18){break}i.name=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return fpe.fromPartial(e??{})},fromPartial(e){const t=QIt();t.index=e.index??void 0;t.name=e.name??"";return t}};function e3t(){return{uniqueName:"",caption:void 0,measure:void 0,attribute:void 0,defaultMemberUniqueName:void 0,allUniqueName:void 0,dimensionUniqueName:void 0,measureGroup:void 0,count:void 0,oneField:void 0,memberValueDatatype:void 0,unbalanced:void 0,hidden:void 0,fieldUsageIndexes:[],time:void 0}}var hpe={encode(e,t=new tn){if(e.uniqueName!==""){t.uint32(10).string(e.uniqueName)}if(e.caption!==void 0){t.uint32(18).string(e.caption)}if(e.measure!==void 0){t.uint32(24).bool(e.measure)}if(e.attribute!==void 0){t.uint32(32).bool(e.attribute)}if(e.defaultMemberUniqueName!==void 0){t.uint32(42).string(e.defaultMemberUniqueName)}if(e.allUniqueName!==void 0){t.uint32(50).string(e.allUniqueName)}if(e.dimensionUniqueName!==void 0){t.uint32(58).string(e.dimensionUniqueName)}if(e.measureGroup!==void 0){t.uint32(74).string(e.measureGroup)}if(e.count!==void 0){t.uint32(80).uint32(e.count)}if(e.oneField!==void 0){t.uint32(88).bool(e.oneField)}if(e.memberValueDatatype!==void 0){t.uint32(96).uint32(e.memberValueDatatype)}if(e.unbalanced!==void 0){t.uint32(104).bool(e.unbalanced)}if(e.hidden!==void 0){t.uint32(112).bool(e.hidden)}t.uint32(122).fork();for(const n of e.fieldUsageIndexes){t.int32(n)}t.join();if(e.time!==void 0){t.uint32(128).bool(e.time)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=e3t();while(n.pos>>3){case 1:{if(o!==10){break}i.uniqueName=n.string();continue}case 2:{if(o!==18){break}i.caption=n.string();continue}case 3:{if(o!==24){break}i.measure=n.bool();continue}case 4:{if(o!==32){break}i.attribute=n.bool();continue}case 5:{if(o!==42){break}i.defaultMemberUniqueName=n.string();continue}case 6:{if(o!==50){break}i.allUniqueName=n.string();continue}case 7:{if(o!==58){break}i.dimensionUniqueName=n.string();continue}case 9:{if(o!==74){break}i.measureGroup=n.string();continue}case 10:{if(o!==80){break}i.count=n.uint32();continue}case 11:{if(o!==88){break}i.oneField=n.bool();continue}case 12:{if(o!==96){break}i.memberValueDatatype=n.uint32();continue}case 13:{if(o!==104){break}i.unbalanced=n.bool();continue}case 14:{if(o!==112){break}i.hidden=n.bool();continue}case 15:{if(o===120){i.fieldUsageIndexes.push(n.int32());continue}if(o===122){const a=n.uint32()+n.pos;while(n.posn)||[];t.time=e.time??void 0;return t}};function t3t(){return{measure:void 0,name:"",uniqueName:"",caption:""}}var ppe={encode(e,t=new tn){if(e.measure!==void 0){t.uint32(8).bool(e.measure)}if(e.name!==""){t.uint32(18).string(e.name)}if(e.uniqueName!==""){t.uint32(26).string(e.uniqueName)}if(e.caption!==""){t.uint32(34).string(e.caption)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=t3t();while(n.pos>>3){case 1:{if(o!==8){break}i.measure=n.bool();continue}case 2:{if(o!==18){break}i.name=n.string();continue}case 3:{if(o!==26){break}i.uniqueName=n.string();continue}case 4:{if(o!==34){break}i.caption=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return ppe.fromPartial(e??{})},fromPartial(e){const t=t3t();t.measure=e.measure??void 0;t.name=e.name??"";t.uniqueName=e.uniqueName??"";t.caption=e.caption??"";return t}};function n3t(){return{name:"",caption:""}}var mpe={encode(e,t=new tn){if(e.name!==""){t.uint32(10).string(e.name)}if(e.caption!==""){t.uint32(18).string(e.caption)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=n3t();while(n.pos>>3){case 1:{if(o!==10){break}i.name=n.string();continue}case 2:{if(o!==18){break}i.caption=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return mpe.fromPartial(e??{})},fromPartial(e){const t=n3t();t.name=e.name??"";t.caption=e.caption??"";return t}};function r3t(){return{measureGroup:0,dimension:0}}var gpe={encode(e,t=new tn){if(e.measureGroup!==0){t.uint32(8).uint32(e.measureGroup)}if(e.dimension!==0){t.uint32(16).uint32(e.dimension)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=r3t();while(n.pos>>3){case 1:{if(o!==8){break}i.measureGroup=n.uint32();continue}case 2:{if(o!==16){break}i.dimension=n.uint32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return gpe.fromPartial(e??{})},fromPartial(e){const t=r3t();t.measureGroup=e.measureGroup??0;t.dimension=e.dimension??0;return t}};function i3t(){return{type:void 0,text:void 0,number:void 0,boolean:void 0,dateTime:void 0,sharedItemIndex:void 0,unused:void 0}}var nN={encode(e,t=new tn){if(e.type!==void 0){t.uint32(8).int32(e.type)}if(e.text!==void 0){t.uint32(18).string(e.text)}if(e.number!==void 0){t.uint32(25).double(e.number)}if(e.boolean!==void 0){t.uint32(32).bool(e.boolean)}if(e.dateTime!==void 0){t.uint32(42).string(e.dateTime)}if(e.sharedItemIndex!==void 0){t.uint32(48).uint32(e.sharedItemIndex)}if(e.unused!==void 0){t.uint32(56).bool(e.unused)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=i3t();while(n.pos>>3){case 1:{if(o!==8){break}i.type=n.int32();continue}case 2:{if(o!==18){break}i.text=n.string();continue}case 3:{if(o!==25){break}i.number=n.double();continue}case 4:{if(o!==32){break}i.boolean=n.bool();continue}case 5:{if(o!==42){break}i.dateTime=n.string();continue}case 6:{if(o!==48){break}i.sharedItemIndex=n.uint32();continue}case 7:{if(o!==56){break}i.unused=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return nN.fromPartial(e??{})},fromPartial(e){const t=i3t();t.type=e.type??void 0;t.text=e.text??void 0;t.number=e.number??void 0;t.boolean=e.boolean??void 0;t.dateTime=e.dateTime??void 0;t.sharedItemIndex=e.sharedItemIndex??void 0;t.unused=e.unused??void 0;return t}};function o3t(){return{values:[]}}var ype={encode(e,t=new tn){for(const n of e.values){nN.encode(n,t.uint32(10).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=o3t();while(n.pos>>3){case 1:{if(o!==10){break}i.values.push(nN.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return ype.fromPartial(e??{})},fromPartial(e){const t=o3t();t.values=e.values?.map(n=>nN.fromPartial(n))||[];return t}};function a3t(){return{values:[],containsBlank:void 0,containsDate:void 0,containsNumeric:void 0,containsString:void 0,containsSemiMixedTypes:void 0,containsNonDate:void 0,containsInteger:void 0,minValue:void 0,maxValue:void 0,minDate:void 0,maxDate:void 0,count:void 0,containsMixedTypes:void 0,items:[],longText:void 0}}var bpe={encode(e,t=new tn){for(const n of e.values){t.uint32(10).string(n)}if(e.containsBlank!==void 0){t.uint32(16).bool(e.containsBlank)}if(e.containsDate!==void 0){t.uint32(24).bool(e.containsDate)}if(e.containsNumeric!==void 0){t.uint32(32).bool(e.containsNumeric)}if(e.containsString!==void 0){t.uint32(40).bool(e.containsString)}if(e.containsSemiMixedTypes!==void 0){t.uint32(48).bool(e.containsSemiMixedTypes)}if(e.containsNonDate!==void 0){t.uint32(56).bool(e.containsNonDate)}if(e.containsInteger!==void 0){t.uint32(64).bool(e.containsInteger)}if(e.minValue!==void 0){t.uint32(73).double(e.minValue)}if(e.maxValue!==void 0){t.uint32(81).double(e.maxValue)}if(e.minDate!==void 0){t.uint32(90).string(e.minDate)}if(e.maxDate!==void 0){t.uint32(98).string(e.maxDate)}if(e.count!==void 0){t.uint32(104).uint32(e.count)}if(e.containsMixedTypes!==void 0){t.uint32(112).bool(e.containsMixedTypes)}for(const n of e.items){nN.encode(n,t.uint32(122).fork()).join()}if(e.longText!==void 0){t.uint32(128).bool(e.longText)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=a3t();while(n.pos>>3){case 1:{if(o!==10){break}i.values.push(n.string());continue}case 2:{if(o!==16){break}i.containsBlank=n.bool();continue}case 3:{if(o!==24){break}i.containsDate=n.bool();continue}case 4:{if(o!==32){break}i.containsNumeric=n.bool();continue}case 5:{if(o!==40){break}i.containsString=n.bool();continue}case 6:{if(o!==48){break}i.containsSemiMixedTypes=n.bool();continue}case 7:{if(o!==56){break}i.containsNonDate=n.bool();continue}case 8:{if(o!==64){break}i.containsInteger=n.bool();continue}case 9:{if(o!==73){break}i.minValue=n.double();continue}case 10:{if(o!==81){break}i.maxValue=n.double();continue}case 11:{if(o!==90){break}i.minDate=n.string();continue}case 12:{if(o!==98){break}i.maxDate=n.string();continue}case 13:{if(o!==104){break}i.count=n.uint32();continue}case 14:{if(o!==112){break}i.containsMixedTypes=n.bool();continue}case 15:{if(o!==122){break}i.items.push(nN.decode(n,n.uint32()));continue}case 16:{if(o!==128){break}i.longText=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return bpe.fromPartial(e??{})},fromPartial(e){const t=a3t();t.values=e.values?.map(n=>n)||[];t.containsBlank=e.containsBlank??void 0;t.containsDate=e.containsDate??void 0;t.containsNumeric=e.containsNumeric??void 0;t.containsString=e.containsString??void 0;t.containsSemiMixedTypes=e.containsSemiMixedTypes??void 0;t.containsNonDate=e.containsNonDate??void 0;t.containsInteger=e.containsInteger??void 0;t.minValue=e.minValue??void 0;t.maxValue=e.maxValue??void 0;t.minDate=e.minDate??void 0;t.maxDate=e.maxDate??void 0;t.count=e.count??void 0;t.containsMixedTypes=e.containsMixedTypes??void 0;t.items=e.items?.map(n=>nN.fromPartial(n))||[];t.longText=e.longText??void 0;return t}};var fm=(Ht=>{Ht[Ht["SHAPE_GEOMETRY_UNSPECIFIED"]=0]="SHAPE_GEOMETRY_UNSPECIFIED";Ht[Ht["SHAPE_GEOMETRY_LINE"]=1]="SHAPE_GEOMETRY_LINE";Ht[Ht["SHAPE_GEOMETRY_LINE_INV"]=2]="SHAPE_GEOMETRY_LINE_INV";Ht[Ht["SHAPE_GEOMETRY_TRIANGLE"]=3]="SHAPE_GEOMETRY_TRIANGLE";Ht[Ht["SHAPE_GEOMETRY_RT_TRIANGLE"]=4]="SHAPE_GEOMETRY_RT_TRIANGLE";Ht[Ht["SHAPE_GEOMETRY_RECT"]=5]="SHAPE_GEOMETRY_RECT";Ht[Ht["SHAPE_GEOMETRY_DIAMOND"]=6]="SHAPE_GEOMETRY_DIAMOND";Ht[Ht["SHAPE_GEOMETRY_PARALLELOGRAM"]=7]="SHAPE_GEOMETRY_PARALLELOGRAM";Ht[Ht["SHAPE_GEOMETRY_TRAPEZOID"]=8]="SHAPE_GEOMETRY_TRAPEZOID";Ht[Ht["SHAPE_GEOMETRY_NON_ISOSCELES_TRAPEZOID"]=9]="SHAPE_GEOMETRY_NON_ISOSCELES_TRAPEZOID";Ht[Ht["SHAPE_GEOMETRY_PENTAGON"]=10]="SHAPE_GEOMETRY_PENTAGON";Ht[Ht["SHAPE_GEOMETRY_HEXAGON"]=11]="SHAPE_GEOMETRY_HEXAGON";Ht[Ht["SHAPE_GEOMETRY_HEPTAGON"]=12]="SHAPE_GEOMETRY_HEPTAGON";Ht[Ht["SHAPE_GEOMETRY_OCTAGON"]=13]="SHAPE_GEOMETRY_OCTAGON";Ht[Ht["SHAPE_GEOMETRY_DECAGON"]=14]="SHAPE_GEOMETRY_DECAGON";Ht[Ht["SHAPE_GEOMETRY_DODECAGON"]=15]="SHAPE_GEOMETRY_DODECAGON";Ht[Ht["SHAPE_GEOMETRY_STAR4"]=16]="SHAPE_GEOMETRY_STAR4";Ht[Ht["SHAPE_GEOMETRY_STAR5"]=17]="SHAPE_GEOMETRY_STAR5";Ht[Ht["SHAPE_GEOMETRY_STAR6"]=18]="SHAPE_GEOMETRY_STAR6";Ht[Ht["SHAPE_GEOMETRY_STAR7"]=19]="SHAPE_GEOMETRY_STAR7";Ht[Ht["SHAPE_GEOMETRY_STAR8"]=20]="SHAPE_GEOMETRY_STAR8";Ht[Ht["SHAPE_GEOMETRY_STAR10"]=21]="SHAPE_GEOMETRY_STAR10";Ht[Ht["SHAPE_GEOMETRY_STAR12"]=22]="SHAPE_GEOMETRY_STAR12";Ht[Ht["SHAPE_GEOMETRY_STAR16"]=23]="SHAPE_GEOMETRY_STAR16";Ht[Ht["SHAPE_GEOMETRY_STAR24"]=24]="SHAPE_GEOMETRY_STAR24";Ht[Ht["SHAPE_GEOMETRY_STAR32"]=25]="SHAPE_GEOMETRY_STAR32";Ht[Ht["SHAPE_GEOMETRY_ROUND_RECT"]=26]="SHAPE_GEOMETRY_ROUND_RECT";Ht[Ht["SHAPE_GEOMETRY_ROUND1_RECT"]=27]="SHAPE_GEOMETRY_ROUND1_RECT";Ht[Ht["SHAPE_GEOMETRY_ROUND2_SAME_RECT"]=28]="SHAPE_GEOMETRY_ROUND2_SAME_RECT";Ht[Ht["SHAPE_GEOMETRY_ROUND2_DIAG_RECT"]=29]="SHAPE_GEOMETRY_ROUND2_DIAG_RECT";Ht[Ht["SHAPE_GEOMETRY_SNIP_ROUND_RECT"]=30]="SHAPE_GEOMETRY_SNIP_ROUND_RECT";Ht[Ht["SHAPE_GEOMETRY_SNIP1_RECT"]=31]="SHAPE_GEOMETRY_SNIP1_RECT";Ht[Ht["SHAPE_GEOMETRY_SNIP2_SAME_RECT"]=32]="SHAPE_GEOMETRY_SNIP2_SAME_RECT";Ht[Ht["SHAPE_GEOMETRY_SNIP2_DIAG_RECT"]=33]="SHAPE_GEOMETRY_SNIP2_DIAG_RECT";Ht[Ht["SHAPE_GEOMETRY_PLAQUE"]=34]="SHAPE_GEOMETRY_PLAQUE";Ht[Ht["SHAPE_GEOMETRY_ELLIPSE"]=35]="SHAPE_GEOMETRY_ELLIPSE";Ht[Ht["SHAPE_GEOMETRY_TEARDROP"]=36]="SHAPE_GEOMETRY_TEARDROP";Ht[Ht["SHAPE_GEOMETRY_HOME_PLATE"]=37]="SHAPE_GEOMETRY_HOME_PLATE";Ht[Ht["SHAPE_GEOMETRY_CHEVRON"]=38]="SHAPE_GEOMETRY_CHEVRON";Ht[Ht["SHAPE_GEOMETRY_PIE_WEDGE"]=39]="SHAPE_GEOMETRY_PIE_WEDGE";Ht[Ht["SHAPE_GEOMETRY_PIE"]=40]="SHAPE_GEOMETRY_PIE";Ht[Ht["SHAPE_GEOMETRY_BLOCK_ARC"]=41]="SHAPE_GEOMETRY_BLOCK_ARC";Ht[Ht["SHAPE_GEOMETRY_DONUT"]=42]="SHAPE_GEOMETRY_DONUT";Ht[Ht["SHAPE_GEOMETRY_NO_SMOKING"]=43]="SHAPE_GEOMETRY_NO_SMOKING";Ht[Ht["SHAPE_GEOMETRY_RIGHT_ARROW"]=44]="SHAPE_GEOMETRY_RIGHT_ARROW";Ht[Ht["SHAPE_GEOMETRY_LEFT_ARROW"]=45]="SHAPE_GEOMETRY_LEFT_ARROW";Ht[Ht["SHAPE_GEOMETRY_UP_ARROW"]=46]="SHAPE_GEOMETRY_UP_ARROW";Ht[Ht["SHAPE_GEOMETRY_DOWN_ARROW"]=47]="SHAPE_GEOMETRY_DOWN_ARROW";Ht[Ht["SHAPE_GEOMETRY_STRIPED_RIGHT_ARROW"]=48]="SHAPE_GEOMETRY_STRIPED_RIGHT_ARROW";Ht[Ht["SHAPE_GEOMETRY_NOTCHED_RIGHT_ARROW"]=49]="SHAPE_GEOMETRY_NOTCHED_RIGHT_ARROW";Ht[Ht["SHAPE_GEOMETRY_BENT_UP_ARROW"]=50]="SHAPE_GEOMETRY_BENT_UP_ARROW";Ht[Ht["SHAPE_GEOMETRY_LEFT_RIGHT_ARROW"]=51]="SHAPE_GEOMETRY_LEFT_RIGHT_ARROW";Ht[Ht["SHAPE_GEOMETRY_UP_DOWN_ARROW"]=52]="SHAPE_GEOMETRY_UP_DOWN_ARROW";Ht[Ht["SHAPE_GEOMETRY_LEFT_UP_ARROW"]=53]="SHAPE_GEOMETRY_LEFT_UP_ARROW";Ht[Ht["SHAPE_GEOMETRY_LEFT_RIGHT_UP_ARROW"]=54]="SHAPE_GEOMETRY_LEFT_RIGHT_UP_ARROW";Ht[Ht["SHAPE_GEOMETRY_QUAD_ARROW"]=55]="SHAPE_GEOMETRY_QUAD_ARROW";Ht[Ht["SHAPE_GEOMETRY_LEFT_ARROW_CALLOUT"]=56]="SHAPE_GEOMETRY_LEFT_ARROW_CALLOUT";Ht[Ht["SHAPE_GEOMETRY_RIGHT_ARROW_CALLOUT"]=57]="SHAPE_GEOMETRY_RIGHT_ARROW_CALLOUT";Ht[Ht["SHAPE_GEOMETRY_UP_ARROW_CALLOUT"]=58]="SHAPE_GEOMETRY_UP_ARROW_CALLOUT";Ht[Ht["SHAPE_GEOMETRY_DOWN_ARROW_CALLOUT"]=59]="SHAPE_GEOMETRY_DOWN_ARROW_CALLOUT";Ht[Ht["SHAPE_GEOMETRY_LEFT_RIGHT_ARROW_CALLOUT"]=60]="SHAPE_GEOMETRY_LEFT_RIGHT_ARROW_CALLOUT";Ht[Ht["SHAPE_GEOMETRY_UP_DOWN_ARROW_CALLOUT"]=61]="SHAPE_GEOMETRY_UP_DOWN_ARROW_CALLOUT";Ht[Ht["SHAPE_GEOMETRY_QUAD_ARROW_CALLOUT"]=62]="SHAPE_GEOMETRY_QUAD_ARROW_CALLOUT";Ht[Ht["SHAPE_GEOMETRY_BENT_ARROW"]=63]="SHAPE_GEOMETRY_BENT_ARROW";Ht[Ht["SHAPE_GEOMETRY_UTURN_ARROW"]=64]="SHAPE_GEOMETRY_UTURN_ARROW";Ht[Ht["SHAPE_GEOMETRY_CIRCULAR_ARROW"]=65]="SHAPE_GEOMETRY_CIRCULAR_ARROW";Ht[Ht["SHAPE_GEOMETRY_LEFT_CIRCULAR_ARROW"]=66]="SHAPE_GEOMETRY_LEFT_CIRCULAR_ARROW";Ht[Ht["SHAPE_GEOMETRY_LEFT_RIGHT_CIRCULAR_ARROW"]=67]="SHAPE_GEOMETRY_LEFT_RIGHT_CIRCULAR_ARROW";Ht[Ht["SHAPE_GEOMETRY_CURVED_RIGHT_ARROW"]=68]="SHAPE_GEOMETRY_CURVED_RIGHT_ARROW";Ht[Ht["SHAPE_GEOMETRY_CURVED_LEFT_ARROW"]=69]="SHAPE_GEOMETRY_CURVED_LEFT_ARROW";Ht[Ht["SHAPE_GEOMETRY_CURVED_UP_ARROW"]=70]="SHAPE_GEOMETRY_CURVED_UP_ARROW";Ht[Ht["SHAPE_GEOMETRY_CURVED_DOWN_ARROW"]=71]="SHAPE_GEOMETRY_CURVED_DOWN_ARROW";Ht[Ht["SHAPE_GEOMETRY_SWOOSH_ARROW"]=72]="SHAPE_GEOMETRY_SWOOSH_ARROW";Ht[Ht["SHAPE_GEOMETRY_CUBE"]=73]="SHAPE_GEOMETRY_CUBE";Ht[Ht["SHAPE_GEOMETRY_CAN"]=74]="SHAPE_GEOMETRY_CAN";Ht[Ht["SHAPE_GEOMETRY_LIGHTNING_BOLT"]=75]="SHAPE_GEOMETRY_LIGHTNING_BOLT";Ht[Ht["SHAPE_GEOMETRY_HEART"]=76]="SHAPE_GEOMETRY_HEART";Ht[Ht["SHAPE_GEOMETRY_SUN"]=77]="SHAPE_GEOMETRY_SUN";Ht[Ht["SHAPE_GEOMETRY_MOON"]=78]="SHAPE_GEOMETRY_MOON";Ht[Ht["SHAPE_GEOMETRY_SMILEY_FACE"]=79]="SHAPE_GEOMETRY_SMILEY_FACE";Ht[Ht["SHAPE_GEOMETRY_IRREGULAR_SEAL1"]=80]="SHAPE_GEOMETRY_IRREGULAR_SEAL1";Ht[Ht["SHAPE_GEOMETRY_IRREGULAR_SEAL2"]=81]="SHAPE_GEOMETRY_IRREGULAR_SEAL2";Ht[Ht["SHAPE_GEOMETRY_FOLDED_CORNER"]=82]="SHAPE_GEOMETRY_FOLDED_CORNER";Ht[Ht["SHAPE_GEOMETRY_BEVEL"]=83]="SHAPE_GEOMETRY_BEVEL";Ht[Ht["SHAPE_GEOMETRY_FRAME"]=84]="SHAPE_GEOMETRY_FRAME";Ht[Ht["SHAPE_GEOMETRY_HALF_FRAME"]=85]="SHAPE_GEOMETRY_HALF_FRAME";Ht[Ht["SHAPE_GEOMETRY_CORNER"]=86]="SHAPE_GEOMETRY_CORNER";Ht[Ht["SHAPE_GEOMETRY_DIAG_STRIPE"]=87]="SHAPE_GEOMETRY_DIAG_STRIPE";Ht[Ht["SHAPE_GEOMETRY_CHORD"]=88]="SHAPE_GEOMETRY_CHORD";Ht[Ht["SHAPE_GEOMETRY_ARC"]=89]="SHAPE_GEOMETRY_ARC";Ht[Ht["SHAPE_GEOMETRY_LEFT_BRACKET"]=90]="SHAPE_GEOMETRY_LEFT_BRACKET";Ht[Ht["SHAPE_GEOMETRY_RIGHT_BRACKET"]=91]="SHAPE_GEOMETRY_RIGHT_BRACKET";Ht[Ht["SHAPE_GEOMETRY_LEFT_BRACE"]=92]="SHAPE_GEOMETRY_LEFT_BRACE";Ht[Ht["SHAPE_GEOMETRY_RIGHT_BRACE"]=93]="SHAPE_GEOMETRY_RIGHT_BRACE";Ht[Ht["SHAPE_GEOMETRY_BRACKET_PAIR"]=94]="SHAPE_GEOMETRY_BRACKET_PAIR";Ht[Ht["SHAPE_GEOMETRY_BRACE_PAIR"]=95]="SHAPE_GEOMETRY_BRACE_PAIR";Ht[Ht["SHAPE_GEOMETRY_STRAIGHT_CONNECTOR1"]=96]="SHAPE_GEOMETRY_STRAIGHT_CONNECTOR1";Ht[Ht["SHAPE_GEOMETRY_BENT_CONNECTOR2"]=97]="SHAPE_GEOMETRY_BENT_CONNECTOR2";Ht[Ht["SHAPE_GEOMETRY_BENT_CONNECTOR3"]=98]="SHAPE_GEOMETRY_BENT_CONNECTOR3";Ht[Ht["SHAPE_GEOMETRY_BENT_CONNECTOR4"]=99]="SHAPE_GEOMETRY_BENT_CONNECTOR4";Ht[Ht["SHAPE_GEOMETRY_BENT_CONNECTOR5"]=100]="SHAPE_GEOMETRY_BENT_CONNECTOR5";Ht[Ht["SHAPE_GEOMETRY_CURVED_CONNECTOR2"]=101]="SHAPE_GEOMETRY_CURVED_CONNECTOR2";Ht[Ht["SHAPE_GEOMETRY_CURVED_CONNECTOR3"]=102]="SHAPE_GEOMETRY_CURVED_CONNECTOR3";Ht[Ht["SHAPE_GEOMETRY_CURVED_CONNECTOR4"]=103]="SHAPE_GEOMETRY_CURVED_CONNECTOR4";Ht[Ht["SHAPE_GEOMETRY_CURVED_CONNECTOR5"]=104]="SHAPE_GEOMETRY_CURVED_CONNECTOR5";Ht[Ht["SHAPE_GEOMETRY_CALLOUT1"]=105]="SHAPE_GEOMETRY_CALLOUT1";Ht[Ht["SHAPE_GEOMETRY_CALLOUT2"]=106]="SHAPE_GEOMETRY_CALLOUT2";Ht[Ht["SHAPE_GEOMETRY_CALLOUT3"]=107]="SHAPE_GEOMETRY_CALLOUT3";Ht[Ht["SHAPE_GEOMETRY_ACCENT_CALLOUT1"]=108]="SHAPE_GEOMETRY_ACCENT_CALLOUT1";Ht[Ht["SHAPE_GEOMETRY_ACCENT_CALLOUT2"]=109]="SHAPE_GEOMETRY_ACCENT_CALLOUT2";Ht[Ht["SHAPE_GEOMETRY_ACCENT_CALLOUT3"]=110]="SHAPE_GEOMETRY_ACCENT_CALLOUT3";Ht[Ht["SHAPE_GEOMETRY_BORDER_CALLOUT1"]=111]="SHAPE_GEOMETRY_BORDER_CALLOUT1";Ht[Ht["SHAPE_GEOMETRY_BORDER_CALLOUT2"]=112]="SHAPE_GEOMETRY_BORDER_CALLOUT2";Ht[Ht["SHAPE_GEOMETRY_BORDER_CALLOUT3"]=113]="SHAPE_GEOMETRY_BORDER_CALLOUT3";Ht[Ht["SHAPE_GEOMETRY_ACCENT_BORDER_CALLOUT1"]=114]="SHAPE_GEOMETRY_ACCENT_BORDER_CALLOUT1";Ht[Ht["SHAPE_GEOMETRY_ACCENT_BORDER_CALLOUT2"]=115]="SHAPE_GEOMETRY_ACCENT_BORDER_CALLOUT2";Ht[Ht["SHAPE_GEOMETRY_ACCENT_BORDER_CALLOUT3"]=116]="SHAPE_GEOMETRY_ACCENT_BORDER_CALLOUT3";Ht[Ht["SHAPE_GEOMETRY_WEDGE_RECT_CALLOUT"]=117]="SHAPE_GEOMETRY_WEDGE_RECT_CALLOUT";Ht[Ht["SHAPE_GEOMETRY_WEDGE_ROUND_RECT_CALLOUT"]=118]="SHAPE_GEOMETRY_WEDGE_ROUND_RECT_CALLOUT";Ht[Ht["SHAPE_GEOMETRY_WEDGE_ELLIPSE_CALLOUT"]=119]="SHAPE_GEOMETRY_WEDGE_ELLIPSE_CALLOUT";Ht[Ht["SHAPE_GEOMETRY_CLOUD_CALLOUT"]=120]="SHAPE_GEOMETRY_CLOUD_CALLOUT";Ht[Ht["SHAPE_GEOMETRY_CLOUD"]=121]="SHAPE_GEOMETRY_CLOUD";Ht[Ht["SHAPE_GEOMETRY_RIBBON"]=122]="SHAPE_GEOMETRY_RIBBON";Ht[Ht["SHAPE_GEOMETRY_RIBBON2"]=123]="SHAPE_GEOMETRY_RIBBON2";Ht[Ht["SHAPE_GEOMETRY_ELLIPSE_RIBBON"]=124]="SHAPE_GEOMETRY_ELLIPSE_RIBBON";Ht[Ht["SHAPE_GEOMETRY_ELLIPSE_RIBBON2"]=125]="SHAPE_GEOMETRY_ELLIPSE_RIBBON2";Ht[Ht["SHAPE_GEOMETRY_LEFT_RIGHT_RIBBON"]=126]="SHAPE_GEOMETRY_LEFT_RIGHT_RIBBON";Ht[Ht["SHAPE_GEOMETRY_VERTICAL_SCROLL"]=127]="SHAPE_GEOMETRY_VERTICAL_SCROLL";Ht[Ht["SHAPE_GEOMETRY_HORIZONTAL_SCROLL"]=128]="SHAPE_GEOMETRY_HORIZONTAL_SCROLL";Ht[Ht["SHAPE_GEOMETRY_WAVE"]=129]="SHAPE_GEOMETRY_WAVE";Ht[Ht["SHAPE_GEOMETRY_DOUBLE_WAVE"]=130]="SHAPE_GEOMETRY_DOUBLE_WAVE";Ht[Ht["SHAPE_GEOMETRY_PLUS"]=131]="SHAPE_GEOMETRY_PLUS";Ht[Ht["SHAPE_GEOMETRY_FLOW_CHART_PROCESS"]=132]="SHAPE_GEOMETRY_FLOW_CHART_PROCESS";Ht[Ht["SHAPE_GEOMETRY_FLOW_CHART_DECISION"]=133]="SHAPE_GEOMETRY_FLOW_CHART_DECISION";Ht[Ht["SHAPE_GEOMETRY_FLOW_CHART_INPUT_OUTPUT"]=134]="SHAPE_GEOMETRY_FLOW_CHART_INPUT_OUTPUT";Ht[Ht["SHAPE_GEOMETRY_FLOW_CHART_PREDEFINED_PROCESS"]=135]="SHAPE_GEOMETRY_FLOW_CHART_PREDEFINED_PROCESS";Ht[Ht["SHAPE_GEOMETRY_FLOW_CHART_INTERNAL_STORAGE"]=136]="SHAPE_GEOMETRY_FLOW_CHART_INTERNAL_STORAGE";Ht[Ht["SHAPE_GEOMETRY_FLOW_CHART_DOCUMENT"]=137]="SHAPE_GEOMETRY_FLOW_CHART_DOCUMENT";Ht[Ht["SHAPE_GEOMETRY_FLOW_CHART_MULTIDOCUMENT"]=138]="SHAPE_GEOMETRY_FLOW_CHART_MULTIDOCUMENT";Ht[Ht["SHAPE_GEOMETRY_FLOW_CHART_TERMINATOR"]=139]="SHAPE_GEOMETRY_FLOW_CHART_TERMINATOR";Ht[Ht["SHAPE_GEOMETRY_FLOW_CHART_PREPARATION"]=140]="SHAPE_GEOMETRY_FLOW_CHART_PREPARATION";Ht[Ht["SHAPE_GEOMETRY_FLOW_CHART_MANUAL_INPUT"]=141]="SHAPE_GEOMETRY_FLOW_CHART_MANUAL_INPUT";Ht[Ht["SHAPE_GEOMETRY_FLOW_CHART_MANUAL_OPERATION"]=142]="SHAPE_GEOMETRY_FLOW_CHART_MANUAL_OPERATION";Ht[Ht["SHAPE_GEOMETRY_FLOW_CHART_CONNECTOR"]=143]="SHAPE_GEOMETRY_FLOW_CHART_CONNECTOR";Ht[Ht["SHAPE_GEOMETRY_FLOW_CHART_PUNCHED_CARD"]=144]="SHAPE_GEOMETRY_FLOW_CHART_PUNCHED_CARD";Ht[Ht["SHAPE_GEOMETRY_FLOW_CHART_PUNCHED_TAPE"]=145]="SHAPE_GEOMETRY_FLOW_CHART_PUNCHED_TAPE";Ht[Ht["SHAPE_GEOMETRY_FLOW_CHART_SUMMING_JUNCTION"]=146]="SHAPE_GEOMETRY_FLOW_CHART_SUMMING_JUNCTION";Ht[Ht["SHAPE_GEOMETRY_FLOW_CHART_OR"]=147]="SHAPE_GEOMETRY_FLOW_CHART_OR";Ht[Ht["SHAPE_GEOMETRY_FLOW_CHART_COLLATE"]=148]="SHAPE_GEOMETRY_FLOW_CHART_COLLATE";Ht[Ht["SHAPE_GEOMETRY_FLOW_CHART_SORT"]=149]="SHAPE_GEOMETRY_FLOW_CHART_SORT";Ht[Ht["SHAPE_GEOMETRY_FLOW_CHART_EXTRACT"]=150]="SHAPE_GEOMETRY_FLOW_CHART_EXTRACT";Ht[Ht["SHAPE_GEOMETRY_FLOW_CHART_MERGE"]=151]="SHAPE_GEOMETRY_FLOW_CHART_MERGE";Ht[Ht["SHAPE_GEOMETRY_FLOW_CHART_OFFLINE_STORAGE"]=152]="SHAPE_GEOMETRY_FLOW_CHART_OFFLINE_STORAGE";Ht[Ht["SHAPE_GEOMETRY_FLOW_CHART_ONLINE_STORAGE"]=153]="SHAPE_GEOMETRY_FLOW_CHART_ONLINE_STORAGE";Ht[Ht["SHAPE_GEOMETRY_FLOW_CHART_MAGNETIC_TAPE"]=154]="SHAPE_GEOMETRY_FLOW_CHART_MAGNETIC_TAPE";Ht[Ht["SHAPE_GEOMETRY_FLOW_CHART_MAGNETIC_DISK"]=155]="SHAPE_GEOMETRY_FLOW_CHART_MAGNETIC_DISK";Ht[Ht["SHAPE_GEOMETRY_FLOW_CHART_MAGNETIC_DRUM"]=156]="SHAPE_GEOMETRY_FLOW_CHART_MAGNETIC_DRUM";Ht[Ht["SHAPE_GEOMETRY_FLOW_CHART_DISPLAY"]=157]="SHAPE_GEOMETRY_FLOW_CHART_DISPLAY";Ht[Ht["SHAPE_GEOMETRY_FLOW_CHART_DELAY"]=158]="SHAPE_GEOMETRY_FLOW_CHART_DELAY";Ht[Ht["SHAPE_GEOMETRY_FLOW_CHART_ALTERNATE_PROCESS"]=159]="SHAPE_GEOMETRY_FLOW_CHART_ALTERNATE_PROCESS";Ht[Ht["SHAPE_GEOMETRY_FLOW_CHART_OFFPAGE_CONNECTOR"]=160]="SHAPE_GEOMETRY_FLOW_CHART_OFFPAGE_CONNECTOR";Ht[Ht["SHAPE_GEOMETRY_ACTION_BUTTON_BLANK"]=161]="SHAPE_GEOMETRY_ACTION_BUTTON_BLANK";Ht[Ht["SHAPE_GEOMETRY_ACTION_BUTTON_HOME"]=162]="SHAPE_GEOMETRY_ACTION_BUTTON_HOME";Ht[Ht["SHAPE_GEOMETRY_ACTION_BUTTON_HELP"]=163]="SHAPE_GEOMETRY_ACTION_BUTTON_HELP";Ht[Ht["SHAPE_GEOMETRY_ACTION_BUTTON_INFORMATION"]=164]="SHAPE_GEOMETRY_ACTION_BUTTON_INFORMATION";Ht[Ht["SHAPE_GEOMETRY_ACTION_BUTTON_FORWARD_NEXT"]=165]="SHAPE_GEOMETRY_ACTION_BUTTON_FORWARD_NEXT";Ht[Ht["SHAPE_GEOMETRY_ACTION_BUTTON_BACK_PREVIOUS"]=166]="SHAPE_GEOMETRY_ACTION_BUTTON_BACK_PREVIOUS";Ht[Ht["SHAPE_GEOMETRY_ACTION_BUTTON_END"]=167]="SHAPE_GEOMETRY_ACTION_BUTTON_END";Ht[Ht["SHAPE_GEOMETRY_ACTION_BUTTON_BEGINNING"]=168]="SHAPE_GEOMETRY_ACTION_BUTTON_BEGINNING";Ht[Ht["SHAPE_GEOMETRY_ACTION_BUTTON_RETURN"]=169]="SHAPE_GEOMETRY_ACTION_BUTTON_RETURN";Ht[Ht["SHAPE_GEOMETRY_ACTION_BUTTON_DOCUMENT"]=170]="SHAPE_GEOMETRY_ACTION_BUTTON_DOCUMENT";Ht[Ht["SHAPE_GEOMETRY_ACTION_BUTTON_SOUND"]=171]="SHAPE_GEOMETRY_ACTION_BUTTON_SOUND";Ht[Ht["SHAPE_GEOMETRY_ACTION_BUTTON_MOVIE"]=172]="SHAPE_GEOMETRY_ACTION_BUTTON_MOVIE";Ht[Ht["SHAPE_GEOMETRY_GEAR6"]=173]="SHAPE_GEOMETRY_GEAR6";Ht[Ht["SHAPE_GEOMETRY_GEAR9"]=174]="SHAPE_GEOMETRY_GEAR9";Ht[Ht["SHAPE_GEOMETRY_FUNNEL"]=175]="SHAPE_GEOMETRY_FUNNEL";Ht[Ht["SHAPE_GEOMETRY_MATH_PLUS"]=176]="SHAPE_GEOMETRY_MATH_PLUS";Ht[Ht["SHAPE_GEOMETRY_MATH_MINUS"]=177]="SHAPE_GEOMETRY_MATH_MINUS";Ht[Ht["SHAPE_GEOMETRY_MATH_MULTIPLY"]=178]="SHAPE_GEOMETRY_MATH_MULTIPLY";Ht[Ht["SHAPE_GEOMETRY_MATH_DIVIDE"]=179]="SHAPE_GEOMETRY_MATH_DIVIDE";Ht[Ht["SHAPE_GEOMETRY_MATH_EQUAL"]=180]="SHAPE_GEOMETRY_MATH_EQUAL";Ht[Ht["SHAPE_GEOMETRY_MATH_NOT_EQUAL"]=181]="SHAPE_GEOMETRY_MATH_NOT_EQUAL";Ht[Ht["SHAPE_GEOMETRY_CORNER_TABS"]=182]="SHAPE_GEOMETRY_CORNER_TABS";Ht[Ht["SHAPE_GEOMETRY_SQUARE_TABS"]=183]="SHAPE_GEOMETRY_SQUARE_TABS";Ht[Ht["SHAPE_GEOMETRY_PLAQUE_TABS"]=184]="SHAPE_GEOMETRY_PLAQUE_TABS";Ht[Ht["SHAPE_GEOMETRY_CHART_X"]=185]="SHAPE_GEOMETRY_CHART_X";Ht[Ht["SHAPE_GEOMETRY_CHART_STAR"]=186]="SHAPE_GEOMETRY_CHART_STAR";Ht[Ht["SHAPE_GEOMETRY_CHART_PLUS"]=187]="SHAPE_GEOMETRY_CHART_PLUS";Ht[Ht["SHAPE_GEOMETRY_CUSTOM"]=188]="SHAPE_GEOMETRY_CUSTOM";Ht[Ht["UNRECOGNIZED"]=-1]="UNRECOGNIZED";return Ht})(fm||{});var s3t={"0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","+":"+","-":"-","=":"=","(":"(",")":")",n:"n",i:"i",x:"x"};var e6e={"0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","+":"+","-":"-","=":"=","(":"(",")":")",a:"a",e:"e",i:"i",o:"o",r:"r",u:"u",v:"v",x:"x"};var l3t={"0":"\u2070","1":"\xB9","2":"\xB2","3":"\xB3","4":"\u2074","5":"\u2075","6":"\u2076","7":"\u2077","8":"\u2078","9":"\u2079","+":"\u207A","-":"\u207B","=":"\u207C","(":"\u207D",")":"\u207E",n:"\u207F",i:"\u2071",x:"\u02E3"};var t6e={"0":"\u2080","1":"\u2081","2":"\u2082","3":"\u2083","4":"\u2084","5":"\u2085","6":"\u2086","7":"\u2087","8":"\u2088","9":"\u2089","+":"\u208A","-":"\u208B","=":"\u208C","(":"\u208D",")":"\u208E",a:"\u2090",e:"\u2091",i:"\u1D62",o:"\u2092",r:"\u1D63",u:"\u1D64",v:"\u1D65",x:"\u2093"};var fCr={alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",theta:"\u03B8",lambda:"\u03BB",mu:"\u03BC",pi:"\u03C0",sigma:"\u03C3",phi:"\u03C6",omega:"\u03C9"};var hCr={cdot:"\xB7",times:"\xD7",pm:"\xB1",mp:"\u2213",leq:"\u2264",geq:"\u2265",neq:"\u2260",infty:"\u221E",to:"\u2192",rightarrow:"\u2192"};var pCr=new Set(["matrix","bmatrix","pmatrix"]);function d3t(e){const t=e.displayMode==="block"?2:1;const n=new r6e(e.latex,t);return n.parseMath()}function fz(e){if(!e?.root){return""}return h3t(hm(e.root))}function f3t(e){return h3t(e.map(t=>{if(t.math){return fz(t.math)}return t.textRun?.text??""}).join(""))}var r6e=class e{#e;#t;#n=0;constructor(t,n){this.#e=t;this.#t=n}parseMath(){const t=this.parseSequence()??{sequence:{children:[]}};return{displayMode:this.#t,paragraphProperties:this.#t===2?{justification:4}:void 0,root:t}}parseSequence(t){const n=[];while(!this.isAtEnd()){this.skipWhitespace();const r=this.peek();if(this.isAtEnd()||r==="}"||t?.stopAt?.includes(r)||t?.stopAtRightCommand&&this.startsWithCommand("right")){break}if(t?.stopBeforeRelation&&this.isRelationOperator(r)){break}const i=this.parseNode();if(!i){break}n.push(i)}if(n.length===0){return void 0}if(n.length===1){return n[0]}return{sequence:{children:n}}}parseNode(){const t=this.parseBase();if(!t){return void 0}const n=this.parsePostfix(t);const r=n.nary;if(r&&(r.operator==="\u222B"||r.operator==="\u2211")&&r.body===void 0){const i=this.parseSequence({stopBeforeRelation:true});if(!i){return n}return{nary:{...r,body:i}}}return n}parseBase(){this.skipWhitespace();if(this.isAtEnd()){return void 0}const t=this.peek();if(t==="{"){this.consume();const n=this.parseSequence();if(this.peek()==="}"){this.consume()}return n??this.createToken("",4)}if(t==="\\"){return this.parseCommand()}if(this.isDigit(t)){return this.createToken(this.readWhile(n=>this.isDigit(n)),2)}if(this.isIdentifierStart(t)){return this.createToken(this.readWhile(n=>this.isIdentifierPart(n)),1)}if(this.isOperator(t)){this.consume();return this.createToken(t,3)}this.consume();return this.createToken(t,5)}parseCommand(){this.consume();const t=this.readCommandName();if(t==="frac"){const i=this.parseRequiredArgument();const o=this.parseRequiredArgument();return{fraction:{kind:1,numerator:i,denominator:o}}}if(t==="sqrt"){const i=this.parseOptionalBracketArgument();const o=this.parseRequiredArgument();return{radical:{radicand:o,degree:i,hideDegree:i===void 0?true:void 0}}}if(t==="hat"||t==="widehat"){return{accent:{character:"\u02C6",base:this.parseRequiredArgument(),position:1}}}if(t==="bar"||t==="overline"){return{bar:{base:this.parseRequiredArgument(),position:1}}}if(t==="cancel"){return{enclosure:{body:this.parseRequiredArgument(),strikeHorizontal:true}}}if(t==="phantom"){return{phantom:{body:this.parseRequiredArgument(),show:false,zeroWidth:true}}}if(t==="Box"||t==="square"){return this.createToken("\u25A1",5)}if(t==="text"||t==="mathrm"){return{...this.createToken(this.readRequiredRawBraceText(),4),style:{variant:1,normalText:true}}}if(t==="operatorname"){const i=this.createToken(this.readRequiredRawBraceText(),1);const o=this.parseFunctionArgument();if(o){return{function:{name:i,argument:o}}}return i}if(t==="left"){return this.parseLeftDelimited()}if(t==="begin"){const i=this.readRequiredRawBraceText();if(pCr.has(i)){return this.parseMatrixEnvironment(i)}return this.createToken(i,4)}if(t==="int"){return{nary:{operator:"\u222B",limitPlacement:this.#t===2?2:1}}}if(t==="sum"){return{nary:{operator:"\u2211",limitPlacement:this.#t===2?2:1}}}if(t==="lim"){return{limit:{base:this.createToken("lim",1),limit:this.createToken("",4),kind:1}}}if(t===","){return this.createToken(" ",4)}const n=fCr[t];if(n){return this.createToken(n,5)}const r=hCr[t];if(r){return this.createToken(r,3)}return this.createToken(t,1)}parsePostfix(t){let n=t;while(true){this.skipWhitespace();const r=this.peek();if(r!=="_"&&r!=="^"){break}this.consume();const i=this.parseScriptArgument();if(!i){break}if(n.nary){n=r==="_"?{nary:{...n.nary,lowerLimit:i}}:{nary:{...n.nary,upperLimit:i}};continue}if(n.limit&&r==="_"){n={limit:{...n.limit,limit:i}};continue}const o=n.scripts?{...n.scripts}:{base:n};if(r==="_"){o.subscript=i}else{o.superscript=i}n={scripts:o}}return n}parseScriptArgument(){this.skipWhitespace();if(this.peek()==="{"){this.consume();const t=this.parseSequence();if(this.peek()==="}"){this.consume()}return t}return this.parseBase()}parseRequiredArgument(){const t=this.parseScriptArgument();if(t){return t}return this.createToken("",4)}parseOptionalBracketArgument(){this.skipWhitespace();if(this.peek()!=="["){return void 0}this.consume();const t=this.parseSequence({stopAt:["]"]});if(this.peek()==="]"){this.consume()}return t}parseFunctionArgument(){this.skipWhitespace();if(this.startsWithCommand("left")){return this.parseBase()}if(this.peek()==="("||this.peek()==="["){return this.parsePlainDelimited()}return void 0}parsePlainDelimited(){const t=this.consume();const n=t==="["?"]":")";return this.parseDelimitedItems(t,n,{stopAt:[n],consumeEndDelimiter:true})}parseLeftDelimited(){const t=this.readDelimiterToken();return this.parseDelimitedItems(t,this.readRightDelimiter(),{stopAtRightCommand:true,consumeRightCommand:true})}parseDelimitedItems(t,n,r){const i=[];while(!this.isAtEnd()){this.skipWhitespace();if(r.stopAt?.includes(this.peek())||r.stopAtRightCommand&&this.startsWithCommand("right")){break}const a=this.parseSequence({stopAt:[",",...r.stopAt??[]],stopAtRightCommand:r.stopAtRightCommand});if(a){i.push(a)}this.skipWhitespace();if(this.peek()===","){this.consume();continue}if(r.stopAt?.includes(this.peek())||r.stopAtRightCommand&&this.startsWithCommand("right")){break}}let o=n;if(r.consumeEndDelimiter&&this.peek()===n){this.consume()}if(r.consumeRightCommand&&this.startsWithCommand("right")){this.consume();this.readCommandName();o=this.readDelimiterToken()}return{delimited:{beginDelimiter:t,separatorDelimiter:",",endDelimiter:o,grow:true,items:i}}}parseMatrixEnvironment(t){const n=this.readUntil(`\\end{${t}}`);const r=n.split(/\\\\/).map(a=>a.trim()).filter(a=>a.length>0).map(a=>a.split("&").map(s=>this.parseMathCell(s.trim())));const i=r.reduce((a,s)=>Math.max(a,s.length),0);const o={matrix:{columns:Array.from({length:i},()=>({justification:2})),rows:r.map(a=>({cells:a}))}};if(t==="bmatrix"||t==="pmatrix"){return{delimited:{beginDelimiter:t==="bmatrix"?"[":"(",separatorDelimiter:"",endDelimiter:t==="bmatrix"?"]":")",grow:true,items:[o]}}}return o}parseMathCell(t){const n=new e(t,this.#t).parseMath();if(!n.root){throw new Error("LaTeX matrix cell did not produce a math root.")}return n.root}readRequiredRawBraceText(){this.skipWhitespace();if(this.peek()!=="{"){return""}this.consume();const t=this.#n;let n=1;while(!this.isAtEnd()&&n>0){const i=this.consume();if(i==="{"){n+=1}else if(i==="}"){n-=1}}const r=n===0?this.#n-1:this.#n;return this.#e.slice(t,r)}readDelimiterToken(){this.skipWhitespace();if(this.peek()!=="\\"){return this.consume()}this.consume();const t=this.readCommandName();if(t==="{"){return"{"}if(t==="}"){return"}"}if(t==="."){return""}return t}readRightDelimiter(){return")"}readCommandName(){const t=this.peek();if(!t){return""}if(this.isLetter(t)){return this.readWhile(n=>this.isLetter(n))}this.consume();return t}readWhile(t){const n=this.#n;while(!this.isAtEnd()&&t(this.peek())){this.#n+=1}return this.#e.slice(n,this.#n)}readUntil(t){const n=this.#e.indexOf(t,this.#n);if(n===-1){const i=this.#e.slice(this.#n);this.#n=this.#e.length;return i}const r=this.#e.slice(this.#n,n);this.#n=n+t.length;return r}startsWithCommand(t){const n=`\\${t}`;if(!this.#e.startsWith(n,this.#n)){return false}const r=this.#e[this.#n+n.length]??"";return!this.isLetter(r)}createToken(t,n){return{token:{text:t,kind:n}}}isAtEnd(){return this.#n>=this.#e.length}peek(){return this.#e[this.#n]??""}consume(){const t=this.peek();this.#n+=1;return t}skipWhitespace(){while(!this.isAtEnd()){const t=this.peek();if(t!==" "&&t!=="\n"&&t!==" "&&t!=="\r"){break}this.#n+=1}}isDigit(t){return t>="0"&&t<="9"}isLetter(t){return/[A-Za-z]/.test(t)}isIdentifierStart(t){return this.isLetter(t)}isIdentifierPart(t){return this.isLetter(t)||this.isDigit(t)}isOperator(t){return t==="="||t==="+"||t==="-"||t==="*"||t==="/"||t==="("||t===")"||t==="["||t==="]"}isRelationOperator(t){return t==="="}};function hm(e){if(!e){return""}if(e.sequence){return mCr(e.sequence.children)}if(e.token){return e.token.text}if(e.fraction){const t=hm(e.fraction.numerator);const n=hm(e.fraction.denominator);if(!t&&!n){return""}return`${n6e(t)}\u2044${n6e(n)}`}if(e.radical){const t=hm(e.radical.radicand);return`\u221A${n6e(t)}`}if(e.scripts){const t=hm(e.scripts.base);const n=wX(e.scripts.subscript,t6e,e6e,"_");const r=wX(e.scripts.superscript,l3t,s3t,"^");return`${t}${n}${r}`}if(e.nary){const t=wX(e.nary.lowerLimit,t6e,e6e,"_");const n=wX(e.nary.upperLimit,l3t,s3t,"^");const r=hm(e.nary.body);return`${e.nary.operator}${t}${n}${r?` ${r}`:""}`}if(e.delimited){const t=e.delimited.items.map(r=>hm(r));const n=e.delimited.separatorDelimiter??"";return`${e.delimited.beginDelimiter??""}${t.join(n)}${e.delimited.endDelimiter??""}`}if(e.function){const t=hm(e.function.name);const n=hm(e.function.argument);return`${t}(${n})`}if(e.matrix){return e.matrix.rows.map(t=>t.cells.map(n=>hm(n)).join(", ")).join("; ")}if(e.accent){return`${e.accent.character}${hm(e.accent.base)}`}if(e.bar){return hm(e.bar.base)}if(e.enclosure){return hm(e.enclosure.body)}if(e.limit){return`${hm(e.limit.base)}${wX(e.limit.limit,t6e,e6e,"_")}`}if(e.phantom){return e.phantom.show?hm(e.phantom.body):""}if(e.equationArray){return e.equationArray.rows.map(t=>hm(t)).join(" ")}return""}function mCr(e){let t="";for(const n of e){const r=hm(n);if(!r){continue}if(n.token?.kind===3){if(r==="("||r==="["){t+=r;continue}if(r===")"||r==="]"){t=t.trimEnd();t+=r;continue}t=t.trimEnd();t+=` ${r} `;continue}t+=r}return t}function wX(e,t,n,r){if(!e){return""}const i=hm(e);const o=c3t(i,t);if(o!==void 0){return o}const a=c3t(i,n);if(a!==void 0){return r==="_"?`_${a}`:`^${a}`}return`${r}(${i})`}function c3t(e,t){if(!e){return""}let n="";for(const r of e){if(r===" "){continue}const i=t[r];if(!i){return void 0}n+=i}return n}function n6e(e){const t=e.trim();if(!t){return""}return t.length===1?t:`(${t})`}function h3t(e){return e.replace(/\s+/g," ").trim()}var T0=1e5;var vpe=2.3;var d6e=1/vpe;function Dh(e,t,n){if(Number.isNaN(e)){return t}return Math.min(Math.max(e,t),n)}function EX(e){const t=e.replace("#","");return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16)}}function m3t(e){const t=n=>Dh(Math.round(n),0,255).toString(16).padStart(2,"0");return`#${t(e.r)}${t(e.g)}${t(e.b)}`.toUpperCase()}function p6e(e,t,n){e/=255;t/=255;n/=255;const r=Math.max(e,t,n);const i=Math.min(e,t,n);let o=0;let a=0;const s=(r+i)/2;if(r!==i){const l=r-i;a=s>.5?l/(2-r-i):l/(r+i);switch(r){case e:o=(t-n)/l+(t{if(f<0)f+=1;if(f>1)f-=1;if(f<1/6)return u+(d-u)*6*f;if(f<1/2)return d;if(f<2/3)return u+(d-u)*(2/3-f)*6;return u};const s=n<.5?n*(1+t):n+t-n*t;const l=2*n-s;r=a(l,s,e+1/3);i=a(l,s,e);o=a(l,s,e-1/3)}return{r:Math.round(r*255),g:Math.round(i*255),b:Math.round(o*255)}}function gCr(e,t){const n=p6e(e.r,e.g,e.b);if(typeof t.satMod==="number"){n.s=Dh(n.s*(t.satMod/1e5),0,1)}if(typeof t.lumMod==="number"){n.l=Dh(n.l*(t.lumMod/1e5),0,1)}if(typeof t.lumOff==="number"){n.l=Dh(n.l+t.lumOff/1e5,0,1)}return m6e(n.h,n.s,n.l)}function yCr(e,t){const n=Dh(t/1e5,-1,1);const r=i=>n>=0?i+(255-i)*n:i*(1+n);return{r:r(e.r),g:r(e.g),b:r(e.b)}}function f6e(e){return Math.floor(Dh(e,0,255)*T0/255)}function h6e(e){return Math.floor(Dh(e,0,T0)*255/T0)}function hz(e,t){return Math.round(Math.pow(Dh(e,0,T0)/T0,t)*T0)}function g3t(e){return{r:hz(f6e(e.r),vpe),g:hz(f6e(e.g),vpe),b:hz(f6e(e.b),vpe)}}function y3t(e){return{r:h6e(hz(e.r,d6e)),g:h6e(hz(e.g,d6e)),b:h6e(hz(e.b,d6e))}}function p3t(e,t){const n=Dh(t/T0,0,1);const r=g3t(e);return y3t({r:Math.floor(r.r*n),g:Math.floor(r.g*n),b:Math.floor(r.b*n)})}function bCr(e,t){const n=Dh(t/T0,0,1);const r=g3t(e);return y3t({r:Math.floor(T0-(T0-r.r)*n),g:Math.floor(T0-(T0-r.g)*n),b:Math.floor(T0-(T0-r.b)*n)})}function b3t(e,t){const n=Dh(t/1e5,-1,1);const r=p6e(e.r,e.g,e.b);let i=Math.round(r.l*255);if(n<0){i=Math.round(i*(1+n))}else{i=Math.round(i*(1-n)+(255-Math.floor(255*(1-n))))}r.l=Dh(i/255,0,1);return m6e(r.h,r.s,r.l)}function xCr(e,t){return b3t(e,-t)}function vCr(e,t){const n=Dh(t/1e5,0,1);const r=p6e(e.r,e.g,e.b);r.l=Dh(r.l*n,0,1);return m6e(r.h,r.s,r.l)}function _pe(e,t,n="drawingml"){if(!t){return{r:Dh(Math.round(e.r),0,255),g:Dh(Math.round(e.g),0,255),b:Dh(Math.round(e.b),0,255)}}let r={...e};if(typeof t.satMod==="number"||typeof t.lumMod==="number"||typeof t.lumOff==="number"){r=gCr(r,t)}if(typeof t.tint==="number"){r=n==="spreadsheetml"?b3t(r,t.tint):n==="drawingml-crgb"?t.tint<0?p3t(r,T0+t.tint):bCr(r,t.tint):yCr(r,t.tint)}if(typeof t.shade==="number"){r=n==="spreadsheetml"?xCr(r,t.shade):n==="drawingml-crgb"?p3t(r,t.shade):vCr(r,t.shade)}return{r:Dh(Math.round(r.r),0,255),g:Dh(Math.round(r.g),0,255),b:Dh(Math.round(r.b),0,255)}}var x3t={"amber-100":"#FEF3C6","amber-200":"#FEE685","amber-300":"#FFD230","amber-400":"#FFB900","amber-50":"#FFFBEB","amber-500":"#FE9A00","amber-600":"#E17100","amber-700":"#BB4D00","amber-800":"#973C00","amber-900":"#7B3306","amber-950":"#461901","black":"#000000","blue-100":"#DBEAFE","blue-200":"#BEDBFF","blue-300":"#8EC5FF","blue-400":"#51A2FF","blue-50":"#EFF6FF","blue-500":"#2B7FFF","blue-600":"#155DFC","blue-700":"#1447E6","blue-800":"#193CB8","blue-900":"#1C398E","blue-950":"#162456","cyan-100":"#CEFAFE","cyan-200":"#A2F4FD","cyan-300":"#53EAFD","cyan-400":"#00D3F2","cyan-50":"#ECFEFF","cyan-500":"#00B8DB","cyan-600":"#0092B8","cyan-700":"#007595","cyan-800":"#005F78","cyan-900":"#104E64","cyan-950":"#053345","emerald-100":"#D0FAE5","emerald-200":"#A4F4CF","emerald-300":"#5EE9B5","emerald-400":"#00D492","emerald-50":"#ECFDF5","emerald-500":"#00BC7D","emerald-600":"#009966","emerald-700":"#007A55","emerald-800":"#006045","emerald-900":"#004F3B","emerald-950":"#002C22","fuchsia-100":"#FAE8FF","fuchsia-200":"#F6CFFF","fuchsia-300":"#F4A8FF","fuchsia-400":"#ED6AFF","fuchsia-50":"#FDF4FF","fuchsia-500":"#E12AFB","fuchsia-600":"#C800DE","fuchsia-700":"#A800B7","fuchsia-800":"#8A0194","fuchsia-900":"#721378","fuchsia-950":"#4B004F","gray-100":"#F3F4F6","gray-200":"#E5E7EB","gray-300":"#D1D5DC","gray-400":"#99A1AF","gray-50":"#F9FAFB","gray-500":"#6A7282","gray-600":"#4A5565","gray-700":"#364153","gray-800":"#1E2939","gray-900":"#101828","gray-950":"#030712","green-100":"#DCFCE7","green-200":"#B9F8CF","green-300":"#7BF1A8","green-400":"#05DF72","green-50":"#F0FDF4","green-500":"#00C950","green-600":"#00A63E","green-700":"#008236","green-800":"#016630","green-900":"#0D542B","green-950":"#032E15","indigo-100":"#E0E7FF","indigo-200":"#C6D2FF","indigo-300":"#A3B3FF","indigo-400":"#7C86FF","indigo-50":"#EEF2FF","indigo-500":"#615FFF","indigo-600":"#4F39F6","indigo-700":"#432DD7","indigo-800":"#372AAC","indigo-900":"#312C85","indigo-950":"#1E1A4D","lime-100":"#ECFCCA","lime-200":"#D8F999","lime-300":"#BBF451","lime-400":"#9AE600","lime-50":"#F7FEE7","lime-500":"#7CCF00","lime-600":"#5EA500","lime-700":"#497D00","lime-800":"#3C6300","lime-900":"#35530E","lime-950":"#192E03","mauve-100":"#F3F1F3","mauve-200":"#E7E4E7","mauve-300":"#D7D0D7","mauve-400":"#A89EA9","mauve-50":"#FAFAFA","mauve-500":"#79697B","mauve-600":"#594C5B","mauve-700":"#463947","mauve-800":"#2A212C","mauve-900":"#1D161E","mauve-950":"#0C090C","mist-100":"#F1F3F3","mist-200":"#E3E7E8","mist-300":"#D0D6D8","mist-400":"#9CA8AB","mist-50":"#F9FBFB","mist-500":"#67787C","mist-600":"#4B585B","mist-700":"#394447","mist-800":"#22292B","mist-900":"#161B1D","mist-950":"#090B0C","neutral-100":"#F5F5F5","neutral-200":"#E5E5E5","neutral-300":"#D4D4D4","neutral-400":"#A1A1A1","neutral-50":"#FAFAFA","neutral-500":"#737373","neutral-600":"#525252","neutral-700":"#404040","neutral-800":"#262626","neutral-900":"#171717","neutral-950":"#0A0A0A","olive-100":"#F4F4F0","olive-200":"#E8E8E3","olive-300":"#D8D8D0","olive-400":"#ABAB9C","olive-50":"#FBFBF9","olive-500":"#7C7C67","olive-600":"#5B5B4B","olive-700":"#474739","olive-800":"#2B2B22","olive-900":"#1D1D16","olive-950":"#0C0C09","orange-100":"#FFEDD4","orange-200":"#FFD6A7","orange-300":"#FFB86A","orange-400":"#FF8904","orange-50":"#FFF7ED","orange-500":"#FF6900","orange-600":"#F54900","orange-700":"#CA3500","orange-800":"#9F2D00","orange-900":"#7E2A0C","orange-950":"#441306","pink-100":"#FCE7F3","pink-200":"#FCCEE8","pink-300":"#FDA5D5","pink-400":"#FB64B6","pink-50":"#FDF2F8","pink-500":"#F6339A","pink-600":"#E60076","pink-700":"#C6005C","pink-800":"#A3004C","pink-900":"#861043","pink-950":"#510424","purple-100":"#F3E8FF","purple-200":"#E9D4FF","purple-300":"#DAB2FF","purple-400":"#C27AFF","purple-50":"#FAF5FF","purple-500":"#AD46FF","purple-600":"#9810FA","purple-700":"#8200DB","purple-800":"#6E11B0","purple-900":"#59168B","purple-950":"#3C0366","red-100":"#FFE2E2","red-200":"#FFC9C9","red-300":"#FFA2A2","red-400":"#FF6467","red-50":"#FEF2F2","red-500":"#FB2C36","red-600":"#E7000B","red-700":"#C10007","red-800":"#9F0712","red-900":"#82181A","red-950":"#460809","rose-100":"#FFE4E6","rose-200":"#FFCCD3","rose-300":"#FFA1AD","rose-400":"#FF637E","rose-50":"#FFF1F2","rose-500":"#FF2056","rose-600":"#EC003F","rose-700":"#C70036","rose-800":"#A50036","rose-900":"#8B0836","rose-950":"#4D0218","sky-100":"#DFF2FE","sky-200":"#B8E6FE","sky-300":"#74D4FF","sky-400":"#00BCFF","sky-50":"#F0F9FF","sky-500":"#00A6F4","sky-600":"#0084D1","sky-700":"#0069A8","sky-800":"#00598A","sky-900":"#024A70","sky-950":"#052F4A","slate-100":"#F1F5F9","slate-200":"#E2E8F0","slate-300":"#CAD5E2","slate-400":"#90A1B9","slate-50":"#F8FAFC","slate-500":"#62748E","slate-600":"#45556C","slate-700":"#314158","slate-800":"#1D293D","slate-900":"#0F172B","slate-950":"#020618","stone-100":"#F5F5F4","stone-200":"#E7E5E4","stone-300":"#D6D3D1","stone-400":"#A6A09B","stone-50":"#FAFAF9","stone-500":"#79716B","stone-600":"#57534D","stone-700":"#44403B","stone-800":"#292524","stone-900":"#1C1917","stone-950":"#0C0A09","taupe-100":"#F3F1F1","taupe-200":"#E8E4E3","taupe-300":"#D8D2D0","taupe-400":"#ABA09C","taupe-50":"#FBFAF9","taupe-500":"#7C6D67","taupe-600":"#5B4F4B","taupe-700":"#473C39","taupe-800":"#2B2422","taupe-900":"#1D1816","taupe-950":"#0C0A09","teal-100":"#CBFBF1","teal-200":"#96F7E4","teal-300":"#46ECD5","teal-400":"#00D5BE","teal-50":"#F0FDFA","teal-500":"#00BBA7","teal-600":"#009689","teal-700":"#00786F","teal-800":"#005F5A","teal-900":"#0B4F4A","teal-950":"#022F2E","violet-100":"#EDE9FE","violet-200":"#DDD6FF","violet-300":"#C4B4FF","violet-400":"#A684FF","violet-50":"#F5F3FF","violet-500":"#8E51FF","violet-600":"#7F22FE","violet-700":"#7008E7","violet-800":"#5D0EC0","violet-900":"#4D179A","violet-950":"#2F0D68","white":"#FFFFFF","yellow-100":"#FEF9C2","yellow-200":"#FFF085","yellow-300":"#FFDF20","yellow-400":"#FDC700","yellow-50":"#FEFCE8","yellow-500":"#F0B100","yellow-600":"#D08700","yellow-700":"#A65F00","yellow-800":"#894B00","yellow-900":"#733E0A","yellow-950":"#432004","zinc-100":"#F4F4F5","zinc-200":"#E4E4E7","zinc-300":"#D4D4D8","zinc-400":"#9F9FA9","zinc-50":"#FAFAFA","zinc-500":"#71717B","zinc-600":"#52525C","zinc-700":"#3F3F46","zinc-800":"#27272A","zinc-900":"#18181B","zinc-950":"#09090B"};var g6e=e=>{if(!Number.isFinite(e))return 0;if(e<0)return 0;if(e>1)return 1;return e};var _Cr=e=>{if(!e)return void 0;const t=e.trim();if(!t)return void 0;if(t.endsWith("%")){const r=Number(t.slice(0,-1));if(Number.isNaN(r))return void 0;return g6e(r/100)}const n=Number(t);if(Number.isNaN(n))return void 0;if(n>1){return g6e(n/100)}return g6e(n)};function pz(e){const t=e.trim();if(!t)return null;const n=t.toLowerCase();const r=n.indexOf("/");const i=(r>=0?n.slice(0,r):n).trim();const o=r>=0?n.slice(r+1):void 0;if(!i)return null;const a=x3t[i];if(typeof a!=="string"){return null}const s=_Cr(o);return s===void 0?{hex:a}:{hex:a,alpha:s}}var TCr=["accent1","accent2","accent3","accent4","accent5","accent6","bg1","bg2","tx1","tx2","dk1","lt1","dk2","lt2","hlink","folHlink"];var wCr=new Set(TCr);var ECr={background1:"bg1",background2:"bg2",text1:"tx1",text2:"tx2",dark1:"dk1",dark2:"dk2",light1:"lt1",light2:"lt2"};var CCr={[0]:"unspecified",[1]:"rgb",[2]:"theme",[3]:"system",[-1]:"unspecified"};var _3t=/^[0-9a-f]+$/i;var SCr=/^rgba?\(\s*(\d{1,3})\s*(?:,\s*|\s+)(\d{1,3})\s*(?:,\s*|\s+)(\d{1,3})(?:\s*(?:\/|,)\s*([\d.]+%?))?\s*\)$/i;var m1="#000000";var ACr=false;function BA(e){if(ACr){console.warn(`[Color] ${e}`)}}function kCr(e){return wCr.has(e)}function wpe(e){if(Number.isNaN(e)){return 0}return Math.min(Math.max(Math.round(e),0),255)}function y6e(e){return wpe(e).toString(16).padStart(2,"0")}function zA(e){if(Number.isNaN(e)){return 0}return Math.min(Math.max(e,0),1)}function CX(e){if(Number.isNaN(e)){return 0}if(e>1){return zA(e/100)}return zA(e)}function b6e(e){if(!e){return void 0}const t=Object.values(e).some(m=>m!==void 0);if(!t){return void 0}const{opacity:n,lighten:r,darken:i}=e;const o=typeof r==="number"&&r!==0;const a=typeof i==="number"&&i!==0;if(o&&a){throw new Error("Color transform cannot set both lighten and darken; pick one.")}const s={};if(typeof n==="number"){s.alpha=Math.round(CX(n)*1e5)}if(typeof r==="number"&&r!==0){const m=CX(r);s.lumMod=Math.round((1-m)*1e5);s.lumOff=Math.round(m*1e5)}if(typeof i==="number"&&i!==0){s.lumMod=Math.round((1-CX(i))*1e5)}const l=s.alpha!==void 0;const u=s.tint!==void 0;const d=s.shade!==void 0;const f=s.lumMod!==void 0;const h=s.lumOff!==void 0;return l||u||d||f||h?s:void 0}function RCr(e){if(!e){return void 0}const t=e.alpha;const n=e.tint;const r=e.shade;const i=e.lumMod;const o=e.lumOff;const a={};if(typeof t==="number"){a.opacity=zA(t/1e5)}if(typeof i==="number"||typeof o==="number"){const s=typeof i==="number"?Math.min(Math.max(i/1e5,0),1):1;const l=typeof o==="number"?Math.min(Math.max(o/1e5,0),1):0;if(l>0){a.lighten=Math.round(l*1e5)/1e5}else if(s<1){a.darken=Math.round((1-s)*1e5)/1e5}}if(typeof n==="number"){const s=Math.min(Math.max(n/1e5,-1),1);if(s>0&&a.lighten===void 0){a.lighten=Math.round((1-s)*1e5)/1e5}else if(s===0&&a.lighten===void 0){a.lighten=1}else if(s<0&&a.darken===void 0){a.darken=Math.round(Math.abs(s)*1e5)/1e5}}if(typeof r==="number"){const s=Math.min(Math.max(r/1e5,0),1);if(s<1&&a.darken===void 0){a.darken=Math.round((1-s)*1e5)/1e5}}return Object.keys(a).length>0?a:void 0}function PCr(e){if(!e){return void 0}const t=e.tint;if(typeof t!=="number"||t>=0){return e}const n={...e};delete n.tint;if(n.lumMod===void 0&&n.shade===void 0){n.lumMod=Math.min(Math.max(Math.round(1e5+t),0),1e5)}return n}function ICr(e){if(!e){return void 0}const t=e.trim();if(!t){return void 0}if(t.endsWith("%")){const r=Number(t.slice(0,-1));if(Number.isNaN(r)){return void 0}return zA(r/100)}const n=Number(t);if(Number.isNaN(n)){return void 0}if(n>1&&n<=100){return zA(n/100)}return zA(n)}function v6e(e){if(!e.startsWith("#")){return null}const t=e.slice(1);if(!_3t.test(t)){return null}if(t.length===3||t.length===4){const[n,r,i]=t.slice(0,3);const o=`#${n}${n}${r}${r}${i}${i}`.toUpperCase();if(t.length===4){const a=t[3];const s=`${a}${a}`;const l=parseInt(s,16);if(Number.isNaN(l)){return null}return{hex:o,alpha:zA(l/255)}}return{hex:o}}if(t.length===6){return{hex:`#${t.toUpperCase()}`}}if(t.length===8){const n=t.slice(0,6);const r=t.slice(6);const i=parseInt(r,16);if(Number.isNaN(i)){return null}return{hex:`#${n.toUpperCase()}`,alpha:zA(i/255)}}return null}function MCr(e){const t=SCr.exec(e);if(!t){return null}const n=wpe(Number(t[1]));const r=wpe(Number(t[2]));const i=wpe(Number(t[3]));const o=ICr(t[4]);return{hex:`#${y6e(n)}${y6e(r)}${y6e(i)}`.toUpperCase(),alpha:o}}function v3t(e){const t=e.trim();if(!t){return void 0}if(t.endsWith("%")){const r=Number(t.slice(0,-1));return Number.isFinite(r)?r:void 0}const n=Number(t);return Number.isFinite(n)?n:void 0}function LCr(e){const t=e.trim();if(!t||t.includes("(")){return null}let n=t;let r;let i;let o;const a=/^(.*)\/([\d.]+%?)$/.exec(n);if(a){n=a[1]?.trim()??"";r=v3t(a[2]??"");if(r===void 0){return null}}const s=/^(.*?)([+-])([\d.]+%?)$/.exec(n);if(s){n=s[1]?.trim()??"";const l=v3t(s[3]??"");if(l===void 0){return null}if(s[2]==="+"){i=l}else{o=l}}if(!n||r===void 0&&i===void 0&&o===void 0){return null}return{base:n,transform:{opacity:r,lighten:i,darken:o}}}function x6e(e){const t=e.trim();if(!t){return null}const n=t.toLowerCase();const r=ECr[n]??n;if(kCr(r)){return{type:2,value:r}}if(n==="transparent"){return{type:1,value:m1,alpha:0}}if(!t.startsWith("#")&&_3t.test(t)&&[3,4,6,8].includes(t.length)){const s=v6e(`#${t}`);if(s){return{type:1,value:s.hex,alpha:s.alpha}}}const i=v6e(t);if(i){return{type:1,value:i.hex,alpha:i.alpha}}const o=MCr(t);if(o){return{type:1,value:o.hex,alpha:o.alpha}}const a=pz(t);if(a){return{type:1,value:a.hex,alpha:a.alpha}}return null}var Mi=class e{#e;#t=false;#n;#r;constructor(t,n){this.#r=n;this.#t=true;if(typeof t==="string"){this.#e={type:1,value:t,transform:void 0,lastColor:void 0};this.#e.value=this.#i(t)}else if(t?.type==="proto"){if(!t.proto||t.proto.type===0){this.#e={type:0,value:"",transform:void 0,lastColor:void 0};this.#t=false;this.#n=void 0;return}else{this.#e={type:t.proto?.type,value:t.proto?.value,transform:t.proto?.transform,lastColor:t.proto?.lastColor};if(this.#e.type===1&&this.#e.value.length===8){this.#e.value=this.#e.value.slice(2)}if(this.#e.type===1){this.#e.value=iN(this.#e.value)}}}else if(t?.type==="rgb"){const r=x6e(t.value);const i=r?.type===1?r:null;const o=typeof i?.alpha==="number"||typeof t.transform?.opacity==="number"?(i?.alpha??1)*CX(t.transform?.opacity??1):void 0;this.#e={type:1,value:i?.value??iN(t.value),transform:b6e({opacity:o,lighten:t.transform?.lighten,darken:t.transform?.darken}),lastColor:void 0}}else if(t?.type==="theme"){this.#e={type:2,value:t.value,transform:b6e(t.transform),lastColor:void 0}}else{throw new Error("Invalid color config")}this.#o()}get value(){return this.#e.value}get hex(){if(!this.#t){BA("Color.hex() is not available for unset colors; defaulting to #000000.");return m1}if(this.#n===void 0){this.#o()}return this.#n??m1}#i(t){const n=t.trim();if(!n){BA("Color string cannot be empty; defaulting to #000000.");this.#e.type=1;this.#a(void 0);return m1}const r=LCr(n);const i=r?x6e(r.base):null;const o=i??x6e(n);if(o){this.#e.type=o.type;this.#e.value=o.value;const a=i?r?.transform:void 0;const s=typeof o.alpha==="number"||typeof a?.opacity==="number"?(o.alpha??1)*CX(a?.opacity??1):void 0;const l=b6e({opacity:s,lighten:a?.lighten,darken:a?.darken});this.#e.transform=l;return o.value}BA(`Unsupported color string "${t}"; defaulting to #000000.`);this.#e.type=1;this.#e.value=m1;this.#a(void 0);return m1}#a(t){if(t===void 0||Number.isNaN(t)||t>=1){if(!this.#e.transform){this.#o();return}const{alpha:i,...o}=this.#e.transform;const a=Object.values(o).some(s=>s!==void 0&&s!==0);this.#e.transform=a?o:void 0;this.#o();return}const n=Math.max(0,Math.min(t,1));const r={...this.#e.transform??{}};r.alpha=Math.round(n*1e5);this.#e.transform=r;this.#o()}get transform(){return this.#e.transform}set transform(t){this.#e.transform=t;this.#o()}get type(){return CCr[this.#e.type]}get lastColor(){return this.#e.lastColor}toProto(){if(!this.#t){return void 0}const t=this.#e.type===1?iN(this.#e.value).slice(1):this.#e.value;return{type:this.#e.type,value:t,transform:PCr(this.#e.transform),lastColor:this.#e.lastColor}}toConfig(){if(!this.#t){return void 0}if(this.type==="theme"){const t=RCr(this.#e.transform);if(!t){return this.#e.value}return{type:"theme",value:this.#e.value,transform:t}}if(this.type==="rgb"){const t=this.#e.transform;const n=t?.alpha;const{alpha:r,...i}=t??{};const o=Object.values(i).some(l=>l!==void 0&&l!==0);const a=iN(this.#e.value);const s=o?Tpe(a,t):a;if(typeof n==="number"){const{r:l,g:u,b:d}=EX(s);const f=zA(n/1e5);return`rgba(${l}, ${u}, ${d}, ${f})`}return s}if(this.type==="system"){const t=this.#e.lastColor;return t?iN(t):m1}return void 0}toMarkdown(){return this.hex}clone(){return new e({type:"proto",proto:this.#e})}#o(){if(!this.#t){this.#n=void 0;return}const t=this.#e.type??0;if(t===1){this.#n=Tpe(this.#e.value,this.#e.transform);return}if(t===3){let n=this.#e.lastColor;if(!n){BA("System color missing lastColor fallback; defaulting to #000000.");n=m1}this.#n=Tpe(n,this.#e.transform);return}if(t===2){const n=this.#r?.resolveThemeColor;if(!n){BA("Color.hex() cannot resolve theme colors without a PresentationRuntime; defaulting to #000000.");this.#n=m1;return}const r=n(this.#e.value);if(!r){BA(`Presentation runtime could not resolve theme color "${this.#e.value}"; defaulting to #000000.`);this.#n=m1;return}const i=iN(r);this.#n=Tpe(i,this.#e.transform);return}BA("Color has an unsupported type; defaulting to #000000.");this.#n=m1}};function iN(e){if(!e){BA("Color is missing a hex value; defaulting to #000000.");return m1}const t=e.startsWith("#")?e:`#${e}`;const n=v6e(t);if(!n){BA(`Invalid hex color "${e}"; defaulting to #000000.`);return m1}return n.hex}function Tpe(e,t){const n=iN(e);if(!t){return n.toUpperCase()}return m3t(_pe(EX(n),t,"drawingml-crgb"))}var S3t={world:2,auto:1,dataOnly:3,region:4};var A3t={[2]:"world",[1]:"auto",[3]:"dataOnly",[4]:"region",[0]:void 0,[-1]:void 0};var k3t={countryOrRegion:2,stateOrProvince:3,county:4,postalCode:5,countryOrRegionCode:6,stateCode:7,countyCode:8,auto:1};var R3t={[2]:"countryOrRegion",[3]:"stateOrProvince",[4]:"county",[5]:"postalCode",[6]:"countryOrRegionCode",[7]:"stateCode",[8]:"countyCode",[1]:"auto",[0]:void 0,[-1]:void 0};var P3t={none:1,bestFit:2,showAll:3};var I3t={[1]:"none",[2]:"bestFit",[3]:"showAll",[0]:void 0,[-1]:void 0};var M3t={mercator:2,auto:1,miller:3,albers:4};var L3t={[2]:"mercator",[1]:"auto",[3]:"miller",[4]:"albers",[0]:void 0,[-1]:void 0};var tMo={overlapping:3,banner:2,none:1};var D3t={[1]:"none",[3]:"overlapping",[2]:"banner",[0]:void 0,[-1]:void 0};var F3t={inclusive:1,exclusive:2};var N3t={[1]:"inclusive",[2]:"exclusive",[0]:void 0,[-1]:void 0};var VCr=(n=>{n["pixels"]="px";n["emu"]="emu";return n})(VCr||{});var O3t={inner:1,outer:2};var Ape={[1]:"inner",[2]:"outer",[0]:void 0,[-1]:void 0};var AX={edge:1,factor:2};var uE={[1]:"edge",[2]:"factor",[0]:void 0,[-1]:void 0};var w0={line:13,pie:16,bar:4,doughnut:8,scatter:18,bubble:5,radar:17,treemap:29,sunburst:30,map:23,waterfall:27,line3D:12,pie3D:15,area3D:1,bar3D:3,funnel:28,histogram:24,boxWhisker:26,stock:20,surface3D:21,ofPie:14,surface:22,pareto:25,combo:31,area:2};var B3t={standard:1,stacked:2,percentStacked:3};var kpe={[1]:"standard",[2]:"stacked",[3]:"percentStacked",[0]:void 0,[-1]:void 0};var z3t={standard:1,stacked:2,percentStacked:3};var Rpe={[1]:"standard",[2]:"stacked",[3]:"percentStacked",[0]:void 0,[-1]:void 0};var Ppe={[13]:"line",[16]:"pie",[4]:"bar",[2]:"area",[8]:"doughnut",[18]:"scatter",[5]:"bubble",[17]:"radar",[29]:"treemap",[30]:"sunburst",[23]:"map",[27]:"waterfall",[12]:"line3D",[15]:"pie3D",[1]:"area3D",[3]:"bar3D",[28]:"funnel",[24]:"histogram",[26]:"boxWhisker",[20]:"stock",[21]:"surface3D",[14]:"ofPie",[0]:void 0,[22]:"surface",[25]:"pareto",[31]:"combo",[-1]:void 0};var $Cr={none:"none",shrinkText:"shrinkText",resizeShapeToFitText:"resizeShapeToFitText"};var nMo=$Cr;var GCr={square:"square",none:"none"};var rMo=GCr;var U3t={square:2,none:1};var Ipe={[2]:"square",[1]:"none",[0]:void 0,[-1]:void 0};var yf={line:1,lineInv:2,triangle:3,rtTriangle:4,rect:5,diamond:6,parallelogram:7,trapezoid:8,nonIsoscelesTrapezoid:9,pentagon:10,hexagon:11,heptagon:12,octagon:13,decagon:14,dodecagon:15,star4:16,star5:17,star6:18,star7:19,star8:20,star10:21,star12:22,star16:23,star24:24,star32:25,roundRect:26,round1Rect:27,round2SameRect:28,round2DiagRect:29,snipRoundRect:30,snip1Rect:31,snip2SameRect:32,snip2DiagRect:33,plaque:34,ellipse:35,teardrop:36,homePlate:37,chevron:38,pieWedge:39,pie:40,blockArc:41,donut:42,noSmoking:43,rightArrow:44,leftArrow:45,upArrow:46,downArrow:47,stripedRightArrow:48,notchedRightArrow:49,bentUpArrow:50,leftRightArrow:51,upDownArrow:52,leftUpArrow:53,leftRightUpArrow:54,quadArrow:55,leftArrowCallout:56,rightArrowCallout:57,upArrowCallout:58,downArrowCallout:59,leftRightArrowCallout:60,upDownArrowCallout:61,quadArrowCallout:62,bentArrow:63,uturnArrow:64,circularArrow:65,leftCircularArrow:66,leftRightCircularArrow:67,curvedRightArrow:68,curvedLeftArrow:69,curvedUpArrow:70,curvedDownArrow:71,swooshArrow:72,cube:73,can:74,lightningBolt:75,heart:76,sun:77,moon:78,smileyFace:79,irregularSeal1:80,irregularSeal2:81,foldedCorner:82,bevel:83,frame:84,halfFrame:85,corner:86,diagStripe:87,chord:88,arc:89,leftBracket:90,rightBracket:91,leftBrace:92,rightBrace:93,bracketPair:94,bracePair:95,straightConnector1:96,bentConnector2:97,bentConnector3:98,bentConnector4:99,bentConnector5:100,curvedConnector2:101,curvedConnector3:102,curvedConnector4:103,curvedConnector5:104,callout1:105,callout2:106,callout3:107,accentCallout1:108,accentCallout2:109,accentCallout3:110,borderCallout1:111,borderCallout2:112,borderCallout3:113,accentBorderCallout1:114,accentBorderCallout2:115,accentBorderCallout3:116,wedgeRectCallout:117,wedgeRoundRectCallout:118,wedgeEllipseCallout:119,cloudCallout:120,cloud:121,ribbon:122,ribbon2:123,ellipseRibbon:124,ellipseRibbon2:125,leftRightRibbon:126,verticalScroll:127,horizontalScroll:128,wave:129,doubleWave:130,plus:131,flowChartProcess:132,flowChartDecision:133,flowChartInputOutput:134,flowChartPredefinedProcess:135,flowChartInternalStorage:136,flowChartDocument:137,flowChartMultidocument:138,flowChartTerminator:139,flowChartPreparation:140,flowChartManualInput:141,flowChartManualOperation:142,flowChartConnector:143,flowChartPunchedCard:144,flowChartPunchedTape:145,flowChartSummingJunction:146,flowChartOr:147,flowChartCollate:148,flowChartSort:149,flowChartExtract:150,flowChartMerge:151,flowChartOfflineStorage:152,flowChartOnlineStorage:153,flowChartMagneticTape:154,flowChartMagneticDisk:155,flowChartDatabase:155,flowChartMagneticDrum:156,flowChartDisplay:157,flowChartDelay:158,flowChartAlternateProcess:159,flowChartOffpageConnector:160,actionButtonBlank:161,actionButtonHome:162,actionButtonHelp:163,actionButtonInformation:164,actionButtonForwardNext:165,actionButtonBackPrevious:166,actionButtonEnd:167,actionButtonBeginning:168,actionButtonReturn:169,actionButtonDocument:170,actionButtonSound:171,actionButtonMovie:172,gear6:173,gear9:174,funnel:175,mathPlus:176,mathMinus:177,mathMultiply:178,mathDivide:179,mathEqual:180,mathNotEqual:181,cornerTabs:182,squareTabs:183,plaqueTabs:184,chartX:185,chartStar:186,chartPlus:187,custom:188,textbox:5};var iMo={title:"title",subtitle:"subTitle",body:"body",picture:"pic",chart:"chart",table:"tbl",content:"content",header:"hdr",footer:"ftr",dateTime:"dt",slideNumber:"sldNum"};var oMo={title:"title",subTitle:"subtitle",body:"body",picture:"picture",chart:"chart",tbl:"table",content:"content",hdr:"header",ftr:"footer",dt:"dateTime",sldNum:"slideNumber"};var Mpe={left:2,top:3,topRight:5,right:1,bottom:4};var V3t={[2]:"left",[3]:"top",[5]:"topRight",[1]:"right",[4]:"bottom",[0]:void 0,[-1]:void 0};var kX={center:3,inEnd:2,outEnd:1,left:4,right:5,top:6,bottom:7,insideBase:8,bestFit:9};var Lpe={[3]:"center",[2]:"inEnd",[1]:"outEnd",[4]:"left",[5]:"right",[6]:"top",[7]:"bottom",[8]:"insideBase",[9]:"bestFit",[0]:void 0,[-1]:void 0};var $3t={left:1,right:2,top:3,bottom:4};var G3t={[1]:"left",[2]:"right",[3]:"top",[4]:"bottom",[0]:void 0,[-1]:void 0};var H3t={minMax:1,maxMin:2};var W3t={[1]:"minMax",[2]:"maxMin",[0]:void 0,[-1]:void 0};var S6e={none:1,inside:2,outside:3,cross:4};var A6e={[1]:"none",[2]:"inside",[3]:"outside",[4]:"cross",[0]:void 0,[-1]:void 0};var k6e={high:1,low:2,nextTo:3,none:4};var Y3t={[1]:"high",[2]:"low",[3]:"nextTo",[4]:"none",[0]:void 0,[-1]:void 0};var q3t={between:1,midpointCategory:2};var X3t={[1]:"between",[2]:"midpointCategory",[0]:void 0,[-1]:void 0};var j3t={autoZero:1,min:2,max:3,at:4};var K3t={[1]:"autoZero",[2]:"min",[3]:"max",[4]:"at",[0]:void 0,[-1]:void 0};var Z3t={linear:1,exponential:2,logarithmic:3,polynomial:4,power:5,movingAverage:6};var J3t={[1]:"linear",[2]:"exponential",[3]:"logarithmic",[4]:"polynomial",[5]:"power",[6]:"movingAverage",[0]:void 0,[-1]:void 0};var Q3t={standardError:4,percentage:2,standardDeviation:3};var R6e={[4]:"standardError",[2]:"percentage",[3]:"standardDeviation",[1]:void 0,[5]:void 0,[0]:void 0,[-1]:void 0};var eMt={none:1,circle:3,square:4,diamond:5,triangle:6,x:7,star:8,plus:9,dot:2,dash:10};var tMt={[1]:"none",[3]:"circle",[4]:"square",[5]:"diamond",[6]:"triangle",[7]:"x",[8]:"star",[9]:"plus",[2]:"dot",[10]:"dash",[-1]:void 0,[0]:void 0};var Dpe={column:1,bar:2};var nMt={[1]:"column",[2]:"bar",[0]:void 0,[-1]:void 0};var rMt={clustered:1,stacked:2,percentStacked:3};var Fpe={[1]:"clustered",[2]:"stacked",[3]:"percentStacked",[0]:void 0,[-1]:void 0};var iMt={line:2,lineWithMarkers:1,smooth:4,smoothWithMarkers:5,marker:3};var oMt={[2]:"line",[1]:"lineWithMarkers",[4]:"smooth",[5]:"smoothWithMarkers",[3]:"marker",[0]:void 0,[-1]:void 0};var aMo={top:1,middle:2,bottom:3};var gz={[1]:"top",[2]:"middle",[3]:"bottom",[0]:void 0,[-1]:void 0};var HCr=(n=>{n["horizontal"]="horizontal";n["vertical"]="vertical";return n})(HCr||{});var RX={none:1,solid:2,mediumGray:3,darkGray:4,lightGray:5,darkHorizontal:6,darkVertical:7,darkDown:8,darkUp:9,darkGrid:10,darkTrellis:11,lightHorizontal:12,lightVertical:13,lightDown:14,lightUp:15,lightGrid:16,lightTrellis:17,gray125:18,gray0625:19,percent5:20,percent10:21,percent20:22,percent25:23,percent30:24,percent40:25,percent50:26,percent60:27,percent70:28,percent75:29,percent80:30,percent90:31,horizontal:32,vertical:33,narrowHorizontal:34,narrowVertical:35,dashedHorizontal:36,dashedVertical:37,cross:38,largeGrid:39,smallGrid:40,dotGrid:41,downwardDiagonal:42,upwardDiagonal:43,wideDownwardDiagonal:44,wideUpwardDiagonal:45,dashedDownwardDiagonal:46,dashedUpwardDiagonal:47,diagonalCross:48,smallCheck:49,largeCheck:50,smallConfetti:51,largeConfetti:52,horizontalBrick:53,diagonalBrick:54,solidDiamond:55,openDiamond:56,dottedDiamond:57,plaid:58,sphere:59,weave:60,divot:61,shingle:62,wave:63,trellis:64,zigZag:65};var aMt={[0]:null,[-1]:null};for(const[e,t]of Object.entries(RX)){aMt[t]=e}var WCr=aMt;var Npe=RX;var oN=class{#e={patternType:0};#t;#n=false;constructor(t){if(t.type==="proto"){const n=t.proto;if(!n){return}this.#e.patternType=n.patternType??0;this.#t=n.color?new Mi({type:"proto",proto:n.color}):void 0;this.#r();return}this.#e.patternType=Npe[t.type];this.#t=new Mi(t.color);this.#r()}get type(){return WCr[this.#e.patternType]}get patternType(){return this.#e.patternType}set type(t){this.#e.patternType=Npe[t];this.#r()}get color(){return this.#t}set color(t){this.#t=t instanceof Mi?t:new Mi(t);this.#r()}toProto(){if(!this.#n){return null}return{patternType:this.#e.patternType,color:this.#t?.toProto()??void 0}}toConfig(){if(!this.#n){return void 0}const t=this.type;if(!t||!this.#t){return void 0}const n=this.#t.toConfig();if(!n){return void 0}return{type:t,color:n}}#r(){this.#n=this.#e.patternType!==0||!!this.#t}};var YCr=/\s/;function Ope(e,t){const n=[];let r=0;let i=null;let o="";for(let s=0;s0){n.push(u)}o="";continue}o+=l}const a=o.trim();if(a.length>0){n.push(a)}return n}function aN(e){const t=[];let n=0;let r=null;let i="";const o=()=>{const a=i.trim();if(a.length>0){t.push(a)}i=""};for(let a=0;a=2&&(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))){return t.slice(1,-1)}return t}function I6e(e){const t=e.trim();if(!t){return null}if(t.toLowerCase()==="none"){return{type:"none"}}const n=P6e(t,["linear","gradient"]);if(n!==null){return uMt(n,"linear")}const r=P6e(t,["path","radial"]);if(r!==null){return uMt(r,"path")}return null}function uMt(e,t){const n=Ope(e,",");if(n.length<2){throw new Error(`${t}(...) fill requires at least two color stops.`)}let r;let i=n;const o=sMt(n[0]??"");if(t==="linear"&&o!==null){r=o;i=n.slice(1)}if(i.length<2){throw new Error(`${t}(...) fill requires at least two color stops.`)}const a=i.map(qCr);const s=XCr(a);return{type:"gradient",gradientKind:t,angleDeg:r,stops:s}}function qCr(e){const t=e.trim();if(!t){throw new Error("Gradient stop cannot be empty.")}let n=0;for(let r=t.length-1;r>=0;r-=1){const i=t[r];if(!i){continue}if(i===")"){n+=1;continue}if(i==="("){n=Math.max(0,n-1);continue}if(n===0&&/\s/.test(i)){const o=t.slice(0,r).trim();const a=t.slice(r+1).trim();const s=lMt(a);if(o.length>0&&s!==null){return{color:o,offset:s}}break}}return{color:t}}function XCr(e){if(e.every(n=>n.offset!==void 0)){return e.map(n=>({color:n.color,offset:dMt(n.offset??0)}))}const t=e.length-1;return e.map((n,r)=>({color:n.color,offset:dMt(r/t*100)}))}function dMt(e){return Math.max(0,Math.min(Math.round(e*1e3),1e5))}var jCr={solid:"solid",dash:"dashed",dashed:"dashed",dot:"dotted",dotted:"dotted",dashdot:"dash-dot","dash-dot":"dash-dot",dashdotdot:"dash-dot-dot","dash-dot-dot":"dash-dot-dot"};function fMt(e){const t=e.trim();if(!t){return null}if(t.toLowerCase()==="none"){return{style:"solid",fill:{type:"none"}}}const n=aN(t);if(n.length===0){return null}let r;let i;const o=[];n.forEach(a=>{const s=UA(a);if(s!==null&&r===void 0){r=s;return}const l=jCr[a.trim().toLowerCase()];if(l&&i===void 0){i=l;return}o.push(a)});if(o.length===0){if(r===void 0&&i===void 0){return null}return{style:i??"solid",width:r}}return{style:i??"solid",width:r??1,fill:o.join(" ")}}function yz(e){const t=e.trim();return t.includes(":")||t.includes(";")}function bz(e){const t=e.trim();if(!t){return{}}const n=Ope(t,";");const r={};n.forEach(i=>{const o=i.indexOf(":");if(o<=0){throw new Error(`Text style declaration "${i}" must use "key: value" syntax.`)}const a=i.slice(0,o).trim().toLowerCase();const s=i.slice(o+1).trim();if(!s){return}switch(a){case"font":ZCr(r,s);return;case"size":case"font-size":{const l=hMt(s);if(l!==null){r.fontSize=l}return}case"family":case"font-family":case"typeface":r.typeface=Bpe(s);return;case"weight":case"font-weight":r.bold=pMt(s);return;case"italic":case"font-style":r.italic=eSr(s,"italic");return;case"color":r.color=s;return;case"fill":r.fill=s;return;case"highlight":r.highlight=s;return;case"outline":case"stroke":{const l=fMt(s);if(l){r.outline=l}return}case"shadow":case"text-shadow":r.shadow=s;return;case"leading":{const l=cMt(s);if(l!==null){r.lineSpacing=l}return}case"align":case"alignment":r.alignment=s;return;case"anchor":case"valign":case"vertical-align":case"vertical-alignment":r.anchor=KCr(s);return;case"wrap":r.wrap=tSr(s);return;case"underline":r.underline=nSr(s);return;case"inset":case"insets":case"padding":r.insets=rSr(s);return;case"autofit":case"auto-fit":r.autoFit=iSr(s);return;default:throw new Error(`Unsupported text style declaration key "${a}".`)}});return r}function KCr(e){const t=e.trim().toLowerCase();if(t==="top"){return 1}if(t==="middle"||t==="center"){return 2}if(t==="bottom"){return 3}throw new Error(`Unsupported text anchor "${e}".`)}function PX(e){if(typeof e!=="string"){return e}return yz(e)?bz(e):e}function ZCr(e,t){const n=aN(t);if(n.length===0){return}let r=-1;n.forEach((i,o)=>{if(r>=0){return}const[a,s]=i.split("/",2);if(s!==void 0){throw new Error(`Text style font shorthand does not support slash line spacing. Use "leading: " instead.`)}const l=JCr(a??"");if(l===null){return}r=o;e.fontSize=l});if(r>=0){const i=n.slice(0,r);const o=n.slice(r+1);i.forEach(a=>{const s=a.toLowerCase();if(s==="italic"){e.italic=true;return}if(QCr(s)){e.bold=pMt(s)}});if(o.length>0){e.typeface=Bpe(o.join(" "))}return}e.typeface=Bpe(n.join(" "))}function hMt(e){const t=e.trim().toLowerCase();if(!t){return null}if(t.endsWith("pt")){const n=Number(t.slice(0,-2));if(!Number.isFinite(n)){return null}return n*96/72}return UA(t)}function JCr(e){const t=e.trim().toLowerCase();if(!t||!t.endsWith("px")&&!t.endsWith("pt")){return null}return hMt(t)}function QCr(e){return e==="normal"||e==="regular"||e==="medium"||e==="semibold"||e==="bold"||/^\d+$/.test(e)}function pMt(e){const t=e.trim().toLowerCase();if(t==="bold"||t==="semibold"){return true}if(t==="medium"||t==="normal"||t==="regular"){return false}const n=Number(t);if(!Number.isFinite(n)){throw new Error(`Unsupported font weight "${e}".`)}return n>=600}function eSr(e,t){const n=e.trim().toLowerCase();if(n===t||n==="true"||n==="yes"){return true}if(n==="normal"||n==="false"||n==="no"){return false}throw new Error(`Unsupported boolean-like value "${e}".`)}function tSr(e){const t=e.trim().toLowerCase();if(t==="square"||t==="wrap"||t==="wrapped"){return"square"}if(t==="none"||t==="nowrap"||t==="no-wrap"){return"none"}throw new Error(`Unsupported text wrap value "${e}".`)}function nSr(e){const t=e.trim().toLowerCase();if(t==="true"||t==="yes"||t==="underline"){return"sng"}if(t==="false"||t==="none"){return"none"}return e.trim()}function rSr(e){const t=aN(e);const n=t.map(i=>UA(i));if(n.some(i=>i===null)){throw new Error(`Unsupported inset value "${e}".`)}const r=n;if(r.length===1){return{top:r[0],right:r[0],bottom:r[0],left:r[0]}}if(r.length===2){return{top:r[0],right:r[1],bottom:r[0],left:r[1]}}if(r.length===3){return{top:r[0],right:r[1],bottom:r[2],left:r[1]}}if(r.length===4){return{top:r[0],right:r[1],bottom:r[2],left:r[3]}}throw new Error(`Inset value "${e}" must contain 1-4 lengths.`)}function iSr(e){const t=e.trim().toLowerCase();if(t==="none"){return"none"}if(t==="shrink"||t==="shrinktext"||t==="shrink-text"){return"shrinkText"}if(t==="resize"||t==="resizeshapetofittext"||t==="resize-shape"){return"resizeShapeToFitText"}throw new Error(`Unsupported autoFit value "${e}".`)}function YI(e){const t=e.trim();if(!t)return null;const n=t.toLowerCase();switch(n){case"shadow-none":case"shadow-sm":case"shadow":case"shadow-md":case"shadow-lg":case"shadow-xl":case"shadow-2xl":return n;default:return null}}function xz(e){const t=e.trim();if(!t){return null}if(t.toLowerCase()==="none"||t.toLowerCase()==="shadow-none"){return{kind:"none"}}const n=YI(t);if(n){return xz(oSr(n))}const r=aN(t);if(r.length<3){return null}const i=UA(r[0]??"");const o=UA(r[1]??"");const a=UA(r[2]??"");if(i===null||o===null||a===null){return null}let s=r[3];if(!s&&r.length===3){s="#000000/0.18"}else if(!s){return null}const l=new Mi(s).toProto();const u=Math.sqrt(i*i+o*o);const d=Math.round(Math.atan2(o,i)*180*6e4/Math.PI);return{kind:"custom",effectStyle:{effects:[{type:1,shadow:{color:l??void 0,blurRadius:Qi(a),distance:Qi(u),direction:d}}]}}}function oSr(e){switch(e){case"shadow-sm":return"0px 1px 2px #000000/0.10";case"shadow":return"0px 2px 4px #000000/0.12";case"shadow-md":return"0px 4px 8px #000000/0.16";case"shadow-lg":return"0px 10px 15px #000000/0.16";case"shadow-xl":return"0px 20px 25px #000000/0.18";case"shadow-2xl":return"0px 25px 50px #000000/0.22";case"shadow-none":default:return"none"}}var L6e="linear";var mMt={[1]:"linear",[2]:"path",[0]:null,[-1]:null};var D6e={linear:1,path:2};function sSr(e,t){if(e!==2){return t??null}if(t===void 0||t===0){return D6e[L6e]}return t}function gMt(e){if(e===void 0){return null}if(!Number.isFinite(e)){throw new Error("Gradient angleDeg must be a finite number.")}return(e%360+360)%360}function lSr(e){if(!e||e.type!==0){return false}const t=(e.gradientStops?.length??0)>0;const n=e.color!==void 0||e.pattern!==void 0||e.relId!==void 0||e.imageReference!==void 0||e.alphaModFix!==void 0||!!e.pictureEffects?.length||e.stretchFillRect!==void 0||e.fillRect!==void 0||e.pathType!==void 0&&e.pathType!==0||e.srcRect!==void 0||e.tile!==void 0||e.gradientKind!==void 0&&e.gradientKind!==0||e.angleDeg!==void 0;return!t&&!n}var gi=class{#e;#t;#n;#r;#i;#a;#o;#s;#l;#c;#u;#f;#d;#p;#m;#h;#g;#y;#x;#v=false;#_=false;constructor(t){if(typeof t==="string"){const n=I6e(t);if(n&&typeof n==="object"&&n.type==="none"){this.#_=true;this.#n=0;this.#r=sN();this.#i=void 0;this.#a=null;this.#o=null;this.#l=void 0;this.#c=void 0;this.#u=void 0;this.#f=void 0;return}if(n&&typeof n==="object"&&n.type==="gradient"){this.#n=2;this.#r=sN();this.#i=n.stops.map(i=>({position:i.offset,color:new Mi(i.color).toProto()??void 0}));this.#a=D6e[n.gradientKind??L6e];this.#o=gMt(n.angleDeg);this.#s=n.isScaled;this.#m=n.tileRect;return}const r=t.trim().toLowerCase();if(r==="none"){this.#_=true;this.#n=0;this.#r=sN();this.#i=void 0;this.#a=null;this.#o=null;this.#l=void 0;this.#c=void 0;this.#u=void 0;this.#f=void 0;return}this.#n=1;this.#r=new Mi(t)}else if(t?.type==="proto"){this.#v=t.proto!==void 0;this.#_=lSr(t.proto);this.#n=t.proto?.type??0;this.#r=new Mi({type:"proto",proto:t.proto?.color});this.#l=new oN({type:"proto",proto:t.proto?.pattern});this.#e=t.proto?.relId;this.#i=t.proto?.gradientStops??[];this.#a=sSr(this.#n,t.proto?.gradientKind);this.#o=t.proto?.angleDeg??null;this.#s=t.proto?.isScaled;this.#c=t.proto?.imageReference;this.#u=t.proto?.alphaModFix;this.#f=t.proto?.pictureEffects;this.#d=t.proto?.stretchFillRect;this.#p=t.proto?.fillRect;this.#m=t.proto?.tileRect;this.#h=t.proto?.pathType;this.#g=t.proto?.srcRect;this.#y=t.proto?.rotateWithShape;this.#x=t.proto?.tile}else if(t?.type==="none"){this.#_=true;this.#n=0;this.#r=sN();this.#i=void 0;this.#a=null;this.#o=null;this.#l=void 0;this.#c=void 0;this.#u=void 0;this.#f=void 0}else if(t?.type==="solid"){this.#n=1;this.#r=new Mi(t.color);this.#l=t.pattern?new oN(t.pattern):void 0}else if(t?.type==="gradient"){this.#n=2;this.#r=sN();this.#i=t.stops.map(n=>({position:n.offset,color:new Mi(n.color).toProto()??void 0}));this.#a=D6e[t.gradientKind??L6e];this.#o=gMt(t.angleDeg);this.#s=t.isScaled;this.#m=t.tileRect;this.#p=t.fillRect;this.#h=t.pathType}else if(t?.type==="image"){this.#n=4;this.#r=sN();this.#c=t.imageReference;this.#u=t.alphaModFix;this.#f=t.pictureEffects;this.#d=t.stretchFillRect;this.#p=t.fillRect;this.#h=t.pathType;this.#g=t.srcRect;this.#y=t.rotateWithShape;this.#x=t.tile}else{this.#n=0;this.#r=sN();this.#i=void 0;this.#a=null;this.#o=null;this.#l=void 0;this.#c=void 0;this.#u=void 0;this.#f=void 0}}get type(){return this.#n}get isSet(){return this.#_||this.#n!==0}get isExplicitNone(){return this.#_}get relId(){return this.#e}get gradientKind(){return this.#a?mMt[this.#a]:null}get angleDeg(){return this.#o??null}get isScaled(){return this.#s}get imageReference(){return this.#c}get stretchFillRect(){return this.#d}get fillRect(){return this.#p}get tileRect(){return this.#m}get srcRect(){return this.#g}get rotateWithShape(){return this.#y}get tile(){return this.#x}get pathType(){return this.#h}get alphaModFix(){return this.#u}get pictureEffects(){return this.#f}get transparency(){return this.#t}get gradientStops(){return this.#i}get pattern(){return this.#l}get color(){return this.#r}set color(t){this.#n=1;this.#r=new Mi(t);this.#i=[];this.#a=null;this.#o=null;this.#s=void 0;this.#m=void 0;this.#e=void 0;this.#c=void 0;this.#u=void 0;this.#f=void 0;this.#d=void 0;this.#p=void 0;this.#h=void 0;this.#g=void 0;this.#y=void 0;this.#x=void 0}toProto(){const t=this.#r.toProto();const n=this.#l?.toProto();const r=this.#i;const i=n&&(this.#n===1||this.#n===0)?3:this.#n;const o={type:i,color:t??void 0,gradientStops:r??[],relId:this.#e,gradientKind:this.#a??void 0,angleDeg:this.#o??void 0,isScaled:this.#s,pattern:n??void 0,imageReference:this.#c,alphaModFix:this.#u,pictureEffects:this.#f??[],stretchFillRect:this.#d,fillRect:this.#p,tileRect:this.#m,pathType:this.#h,srcRect:this.#g,rotateWithShape:this.#y,tile:this.#x};const a=i!==0||!!t||!!n||!!this.#e||this.#a!=null||this.#o!=null||this.#s!==void 0||this.#c!==void 0||this.#u!==void 0||!!this.#f?.length||this.#d!==void 0||this.#p!==void 0||this.#m!==void 0||this.#h!==void 0||this.#g!==void 0||this.#y!==void 0||this.#x!==void 0;if(!a){if(this.#_){return{type:0,color:void 0,gradientStops:[],pictureEffects:[]}}return this.#v?{type:0,color:void 0,gradientStops:[],pictureEffects:[]}:void 0}return o}toConfig(t={}){if(this.#_){return{type:"none"}}if(this.#v&&t.preserveProto!==false){return{type:"proto",proto:this.toProto()}}const n=this.#l?.toConfig();const r=this.#r.toConfig();const i=!!n;if(this.#n===4&&this.#c!==void 0){return{type:"image",imageReference:this.#c,alphaModFix:this.#u,pictureEffects:this.#f,stretchFillRect:this.#d,fillRect:this.#p,pathType:this.#h,srcRect:this.#g,rotateWithShape:this.#y,tile:this.#x}}if(this.#n===2){const o=this.#i?.map(s=>({offset:s.position,color:new Mi({type:"proto",proto:s.color}).toConfig()}))??[];const a=this.#a!==void 0&&this.#a!==null?mMt[this.#a]??void 0:void 0;return{type:"gradient",stops:o,angleDeg:this.#o??void 0,gradientKind:a,isScaled:this.#s,tileRect:this.#m,fillRect:this.#p,pathType:this.#h}}if(!r&&!i){return void 0}if(!i&&typeof r==="string"){return r}return{type:"solid",color:r,pattern:n}}};function sN(){return new Mi({type:"proto",proto:void 0})}var yMt=e=>{if(e===void 0||e===null){return void 0}if(typeof e!=="string"){return void 0}const t=e.trim();if(!t){return void 0}const n=t.toLowerCase().replace(/[^a-z]+/g,"");switch(n){case"solid":return"solid";case"dash":case"dashed":return"dashed";case"dot":case"dotted":return"dotted";case"dashdot":return"dash-dot";case"dashdotdot":return"dash-dot-dot";default:return void 0}};var Upe=e=>{if(e===void 0||e===null){return void 0}if(typeof e!=="string"){return void 0}const t=e.trim();if(!t){return void 0}const n=t.toLowerCase().replace(/[^a-z]+/g,"");switch(n){case"single":return"single";case"double":return"double";case"thickthin":return"thick-thin";case"thinthick":return"thin-thick";case"triple":return"triple";default:return void 0}};var F6e={solid:1,dashed:2,dotted:3,"dash-dot":4,"dash-dot-dot":5};var uSr={[0]:void 0,[1]:"solid",[2]:"dashed",[3]:"dotted",[4]:"dash-dot",[5]:"dash-dot-dot"};var N6e={single:1,double:2,"thick-thin":3,"thin-thick":4,triple:5};var dSr={[0]:void 0,[1]:"single",[2]:"double",[3]:"thick-thin",[4]:"thin-thick",[5]:"triple"};var eo=class{#e;#t;#n;#r;#i;#a;#o;#s;#l=false;constructor(t){if(!t){this.#e=void 0;this.#t=new gi;this.#n=void 0;this.#r=void 0;this.#i=void 0;this.#a=void 0;return}if("type"in t){this.#l=t.proto!==void 0;const n=t.proto?.widthEmu;this.#e=n===void 0?void 0:Bo(n);this.#t=new gi({type:"proto",proto:t.proto?.fill});const r=t.proto?.style;this.#r=r===void 0||r===0?void 0:r;this.#n=this.#r===void 0?void 0:uSr[this.#r]??void 0;const i=t.proto?.compound;this.#a=i===void 0||i===0?void 0:i;this.#i=this.#a===void 0?void 0:dSr[this.#a]??void 0}else{const n=t.width??t.weight;const r=t.fill??t.color;const i=typeof t.style==="string"?Upe(t.style):void 0;const o=typeof t.style==="string"?yMt(t.style)??(i?"solid":void 0):t.style;const a=typeof t.compound==="string"?Upe(t.compound):t.compound??i;this.#e=n;this.#t=new gi(r);this.#n=o;this.#r=o?F6e[o]:void 0;this.#i=a;this.#a=a?N6e[a]:void 0}}get width(){return this.#e}get isSet(){return this.#c()}set width(t){this.#e=t;this.#o?.(this)}get fill(){return this.#t}get format(){return{line:this}}get visible(){const t=this.#t.toProto();if(!t){return true}const n=t.type===0&&t.color===void 0;return!n}set visible(t){const n=Boolean(t);if(!n){if(!this.visible){return}this.#s=this.#t.toConfig();this.fill={type:"none"};return}if(this.visible){return}this.fill=this.#s}get color(){const t=this.#t.toConfig();if(typeof t==="string"){return t}if(t&&typeof t==="object"&&"color"in t){const n=t.color;return typeof n==="string"?n:void 0}return void 0}set color(t){if(typeof t!=="string"||t.trim().length===0){return}this.fill=t}get style(){return this.#n}set style(t){const n=typeof t==="string"?Upe(t):void 0;const r=typeof t==="string"?yMt(t)??(n?"solid":void 0):t;this.#n=r;this.#r=r?F6e[r]:void 0;if(n){this.compound=n;return}this.#o?.(this)}get compound(){return this.#i}set compound(t){const n=typeof t==="string"?Upe(t):t;this.#i=n;this.#a=n?N6e[n]:void 0;this.#o?.(this)}set fill(t){this.#t=new gi(t);this.#o?.(this)}setChangeHandler(t){this.#o=t}#c(){return this.#e!==void 0||this.#t.toProto()!==void 0||this.#n!==void 0||this.#r!==void 0||this.#i!==void 0||this.#a!==void 0}toProto(){if(!this.#c()){return void 0}const t=this.#n!==void 0?F6e[this.#n]:this.#r;const n=t===void 0?0:t;const r=this.#i!==void 0?N6e[this.#i]:this.#a;return{widthEmu:this.#e===void 0?void 0:Qi(this.#e),fill:this.#t.toProto(),style:n,compound:r}}toConfig(t={}){if(!this.#c()){return void 0}if(this.#l&&t.preserveProto!==false){return{type:"proto",proto:this.toProto()}}return{style:this.#n??"solid",compound:this.#i,width:this.#e,fill:this.#t.toConfig(t)}}};function QMo(){return[{name:"accent1",value:"#4472C4"},{name:"accent2",value:"#ED7D31"},{name:"accent3",value:"#A5A5A5"},{name:"accent4",value:"#FFC000"},{name:"accent5",value:"#5B9BD5"},{name:"accent6",value:"#70AD47"},{name:"bg1",value:"#FFFFFF"},{name:"bg2",value:"#000000"},{name:"tx1",value:"#1F1F1F"},{name:"tx2",value:"#FFFFFF"}]}function xMt(e){switch(e){case"gap":return 1;case"zero":return 2;case"span":return 3;default:return 0}}function eLo(e){switch(e){case"line":return 2;case"lineWithMarkers":return 1;case"marker":return 3;case"smooth":return 4;case"smoothWithMarkers":return 5;default:return 0}}function vMt(e){switch(e){case"banner":return 2;case"none":return 1;case"overlapping":return 3;default:return 0}}function tLo(e){switch(e){case"auto":return 1;case"world":return 2;case"dataOnly":return 3;case"region":return 4;default:return 0}}function nLo(e){switch(e){case"auto":return 1;case"mercator":return 2;case"miller":return 3;case"albers":return 4;default:return 0}}function rLo(e){switch(e){case"none":return 1;case"bestFit":return 2;case"showAll":return 3;default:return 0}}function iLo(e){switch(e){case"auto":return 1;case"countryOrRegion":return 2;case"stateOrProvince":return 3;case"county":return 4;case"postalCode":return 5;case"countryOrRegionCode":return 6;case"stateCode":return 7;case"countyCode":return 8;default:return 0}}function oLo(e){return Npe[e]??0}function XI(e){switch(e){case"center":return 2;case"right":return 3;case"justify":return 4;case"left":default:return 1}}function dE(e){switch(e){case 2:return"center";case 3:return"right";case 1:return"left";case 4:return"justify";default:return void 0}}function IX(e){switch(e){case"middle":return 2;case"bottom":return 3;case"top":default:return 1}}function $pe(e){if(e===void 0){return void 0}if(typeof e==="number"){return Vpe(e)}if(e==="left"||e==="center"||e==="right"||e==="justify"){return XI(e)}return Vpe(e)}function Vpe(e){if(e===void 0||e===null){return void 0}if(typeof e==="number"){if(!Number.isFinite(e)||!Number.isInteger(e)){throw new Error("text alignment must be an integer enum value.")}return e}const t=e.trim();if(!t){return void 0}const n=t.toLowerCase();if(n==="left"){return XI("left")}if(n==="center"||n==="centre"||n==="middle"){return XI("center")}if(n==="right"){return XI("right")}if(n==="justify"){return XI("justify")}if(/^-?\d+$/.test(t)){const r=Number(t);if(!Number.isFinite(r)||!Number.isInteger(r)){throw new Error(`Unsupported text alignment value: "${e}"`)}return r}if(t==="ALIGNMENT_TYPE_UNSPECIFIED"){return 0}if(t==="ALIGNMENT_TYPE_LEFT"){return 1}if(t==="ALIGNMENT_TYPE_CENTER"){return 2}if(t==="ALIGNMENT_TYPE_RIGHT"){return 3}if(t==="UNRECOGNIZED"){return-1}throw new Error(`Unsupported text alignment value: "${e}"`)}var TMt=1e5;var fSr=100;function hSr(e){if(e===void 0){return void 0}return e/TMt}function pSr(e){if(e===void 0){return void 0}return Math.round(e*TMt)}var mSr=e=>typeof e==="object"&&e!==null&&!Array.isArray(e);function gSr(e){if(e===void 0){return void 0}if(typeof e!=="string"){return e}const t=xz(e);if(!t||t.kind==="none"){return void 0}const n=t.effectStyle.effects.find(r=>r.shadow)?.shadow;if(!n){return void 0}return{color:n.color,blurRadius:n.blurRadius,distance:n.distance,direction:n.direction,alignment:n.alignment,rotateWithShape:n.rotateWithShape}}function Uf(e,t){if(!t){return}if("anchor"in t)e.anchor=t.anchor;if("verticalAlignment"in t){e.anchor=t.verticalAlignment===void 0?void 0:IX(t.verticalAlignment)}if("vertical"in t)e.vertical=t.vertical;if("rotation"in t)e.rotation=t.rotation;if("bold"in t)e.bold=t.bold;if("italic"in t)e.italic=t.italic;if("fontSize"in t){e.fontSize=Bb(t.fontSize)}else if("fontSizePt"in t){e.fontSize=t.fontSizePt===void 0?void 0:t.fontSizePt*96/72}if("characterSpacing"in t)e.characterSpacing=t.characterSpacing;if("lineSpacing"in t)e.lineSpacing=t.lineSpacing;if("alignment"in t)e.alignment=t.alignment;if("underline"in t)e.underline=t.underline;if("fill"in t&&t.fill!==void 0)e.fill=t.fill;if("color"in t)e.color=t.color;if("highlight"in t)e.highlight=t.highlight;if("outline"in t)e.outline=t.outline;if("shadow"in t)e.shadow=t.shadow;if("capitalization"in t)e.capitalization=t.capitalization;if("textTransform"in t)e.textTransform=t.textTransform;if("useParagraphSpacing"in t)e.useParagraphSpacing=t.useParagraphSpacing;if("wrap"in t)e.wrap=t.wrap;if("autoFit"in t)e.autoFit=t.autoFit;if("autoFitScale"in t)e.autoFitScale=t.autoFitScale;if("autoFitLineSpaceReduction"in t)e.autoFitLineSpaceReduction=t.autoFitLineSpaceReduction;if("name"in t)e.name=t.name;if("family"in t)e.family=t.family;if("scheme"in t)e.scheme=t.scheme;if("typeface"in t)e.typeface=t.typeface;if("insets"in t)e.insets=t.insets}function Bb(e){if(e===void 0){return void 0}if(typeof e==="number"){return e}const t=e.trim().toLowerCase();const n=/^(-?\d+(?:\.\d+)?)\s*(px|pt)$/.exec(t);if(!n){throw new Error(`fontSize string must use px or pt units, received "${e}".`)}const r=Number(n[1]);if(!Number.isFinite(r)||r<0){throw new Error(`fontSize must be a non-negative finite value.`)}return n[2]==="pt"?r*96/72:r}function lN(e){if(typeof e==="string"){return yz(e)?bz(e):null}if(!mSr(e)){return null}return e}function ySr(e){if(e?.noAutofit){return{type:"none"}}if(e?.normalAutoFit){return{type:"shrinkText",scale:hSr(e.normalAutoFit.fontScale),lineSpaceReduction:e.normalAutoFit.lineSpaceReduction}}if(e?.shapeAutoFit){return{type:"resizeShapeToFitText"}}return{}}function _Mt(e){if(!e.type){return void 0}if(e.type==="none"){return{noAutofit:{}}}if(e.type==="resizeShapeToFitText"){return{shapeAutoFit:{}}}if(e.type==="shrinkText"){return{normalAutoFit:{fontScale:pSr(e.scale),lineSpaceReduction:e.lineSpaceReduction}}}return void 0}function bSr(e){if(e===void 0){return void 0}if(e==="none"){return 1}if(e==="uppercase"){return 3}return 2}function xSr(e){if(e===1){return"none"}if(e===3){return"uppercase"}if(e===2){return"smallCaps"}return void 0}var ko=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(t){this.#t=new gi({type:"proto",proto:t?.fill});this.#n=t?.highlight?new Mi({type:"proto",proto:t.highlight}):void 0;this.#r=new eo({type:"proto",proto:t?.outline});const n=ySr(t?.autoFit);this.#e={anchor:t?.anchor,vertical:t?.vertical,rotation:t?.rotation,bold:t?.bold,italic:t?.italic,fontSize:t?.fontSize,characterSpacing:t?.characterSpacing,alignment:Vpe(t?.alignment),underline:t?.underline,bottomInset:t?.bottomInset,leftInset:t?.leftInset,rightInset:t?.rightInset,topInset:t?.topInset,useParagraphSpacing:t?.useParagraphSpacing,wrap:t?.wrap,name:t?.name,family:t?.family,scheme:t?.scheme,typeface:t?.typeface,shadow:t?.shadow,capitalization:t?.capitalization};this.#i=n.type;this.#a=n.scale;this.#o=n.lineSpaceReduction;this.#s=void 0}get anchor(){return this.#e.anchor}set anchor(t){this.#e.anchor=t}get vertical(){return this.#e.vertical}set vertical(t){this.#e.vertical=t}get rotation(){return this.#e.rotation}set rotation(t){this.#e.rotation=t}get bold(){return this.#e.bold}set bold(t){this.#e.bold=t}get italic(){return this.#e.italic}set italic(t){this.#e.italic=t}get fontSize(){const t=this.#e.fontSize;if(t===void 0)return void 0;const n=t/100;return n*96/72}set fontSize(t){if(t===void 0){this.#e.fontSize=void 0;return}const n=t*72/96;this.#e.fontSize=Math.round(n*100)}get fontSizeCentipoints(){return this.#e.fontSize}get characterSpacing(){return this.#e.characterSpacing}set characterSpacing(t){this.#e.characterSpacing=t}get alignment(){return this.#e.alignment}set alignment(t){this.#e.alignment=$pe(t)}get lineSpacing(){const t=this.#s;if(t===void 0||!Number.isFinite(t)){return void 0}return t/1e5}set lineSpacing(t){if(t===void 0){this.#s=void 0;return}this.#s=Math.round(t*1e5)}get underline(){return this.#e.underline}set underline(t){this.#e.underline=t}get fill(){return this.#t}set fill(t){this.#t=new gi(t)}get color(){if(!this.#t){return void 0}return this.#t.color.clone()}set color(t){if(t===void 0){this.#t=new gi;return}this.#t=new gi({type:"solid",color:t})}get highlight(){return this.#n}set highlight(t){if(t===void 0){this.#n=void 0;return}const n=new Mi(t);this.#n=n.toProto()?n:void 0}get outline(){return this.#r}set outline(t){if(t instanceof eo){this.#r=t;return}this.#r=new eo(t)}get shadow(){return this.#e.shadow}set shadow(t){this.#e.shadow=gSr(t)}get capitalization(){return this.#e.capitalization}set capitalization(t){this.#e.capitalization=t}get textTransform(){return xSr(this.#e.capitalization)}set textTransform(t){this.#e.capitalization=bSr(t)}get useParagraphSpacing(){return this.#e.useParagraphSpacing}set useParagraphSpacing(t){this.#e.useParagraphSpacing=t}get wrap(){const t=this.#e.wrap;if(t===void 0){return void 0}return Ipe[t]}get wrapProto(){return this.#e.wrap}set wrap(t){if(t===void 0){this.#e.wrap=void 0;return}this.#e.wrap=U3t[t]}get autoFit(){return this.#i}set autoFit(t){this.#i=t;if(t!=="shrinkText"){this.#a=void 0;this.#o=void 0}}get autoFitScale(){return this.#a}set autoFitScale(t){this.#a=t}get autoFitLineSpaceReduction(){return this.#o}set autoFitLineSpaceReduction(t){this.#o=t}get name(){return this.#e.name}set name(t){this.#e.name=t}get family(){return this.#e.family}set family(t){this.#e.family=t}get scheme(){return this.#e.scheme}set scheme(t){this.#e.scheme=t}get typeface(){return this.#e.typeface}set typeface(t){this.#e.typeface=t}get topInsetEmu(){return this.#e.topInset}get rightInsetEmu(){return this.#e.rightInset}get bottomInsetEmu(){return this.#e.bottomInset}get leftInsetEmu(){return this.#e.leftInset}get autoFitProto(){return _Mt({type:this.#i,scale:this.#a,lineSpaceReduction:this.#o})}get insets(){const{topInset:t,rightInset:n,bottomInset:r,leftInset:i}=this.#e;if(t===void 0&&n===void 0&&r===void 0&&i===void 0){return void 0}return{top:t===void 0?void 0:Bo(t),right:n===void 0?void 0:Bo(n),bottom:r===void 0?void 0:Bo(r),left:i===void 0?void 0:Bo(i)}}set insets(t){this.#e.topInset=t?.top===void 0?void 0:Qi(t.top);this.#e.rightInset=t?.right===void 0?void 0:Qi(t.right);this.#e.bottomInset=t?.bottom===void 0?void 0:Qi(t.bottom);this.#e.leftInset=t?.left===void 0?void 0:Qi(t.left)}get isSet(){return Object.values(this.toProto()).some(t=>t!==void 0)}toProto(){const{lineSpacing:t,...n}=this.#e;const r=_Mt({type:this.#i,scale:this.#a,lineSpaceReduction:this.#o});return{anchor:n.anchor,vertical:n.vertical,rotation:n.rotation,bold:n.bold,italic:n.italic,fontSize:n.fontSize===void 0?void 0:Math.max(fSr,n.fontSize),characterSpacing:n.characterSpacing,fill:this.#t?.toProto(),outline:this.#r?.toProto(),alignment:n.alignment,underline:n.underline,bottomInset:n.bottomInset,leftInset:n.leftInset,rightInset:n.rightInset,topInset:n.topInset,useParagraphSpacing:n.useParagraphSpacing,wrap:n.wrap,autoFit:r,name:n.name,family:n.family,scheme:n.scheme,typeface:n.typeface,shadow:n.shadow,capitalization:n.capitalization,highlight:this.#n?.toProto()}}};var vSr="";var jI=class{#e;#t;#n;constructor(t,n){this.#e=t;this.#e.fontFamilyCache?.addTextStyle(n.textStyle);this.#t={id:n.id??"",text:n.text??"",styleId:n.styleId,fieldType:n.fieldType,hyperlink:n.hyperlink?{...n.hyperlink}:void 0,citations:[...n.citations??[]],reviewMarkIds:[...n.reviewMarkIds??[]]};this.#n=n.textStyle?new ko(n.textStyle):void 0}get id(){return this.#t.id}set id(t){this.#t.id=t}get text(){return this.#t.text}set text(t){this.#t.text=t}get styleId(){return this.#t.styleId}set styleId(t){this.#t.styleId=t}get textStyle(){return this.#n}set textStyle(t){this.#n=t}get resolvedTextStyle(){const t=this.#e.getParagraph?.();if(!t){return void 0}return this.#e.getResolvedRunTextStyle?.(t,this)}get citations(){return[...this.#t.citations]}set citations(t){this.#t.citations=[...t]}addCitation(t){this.#t.citations.push(t)}clearCitations(){this.#t.citations=[]}get reviewMarkIds(){return[...this.#t.reviewMarkIds]}set reviewMarkIds(t){this.#t.reviewMarkIds=[...t]}get hyperlink(){return this.#t.hyperlink?{...this.#t.hyperlink}:void 0}set hyperlink(t){if(!t){this.#t.hyperlink=void 0;return}const n=this.#r(t);this.#t.hyperlink={...n}}toProto(){return{id:this.#t.id,text:this.#t.text,styleId:this.#t.styleId,fieldType:this.#t.fieldType,textStyle:this.#n?.toProto(),hyperlink:this.#t.hyperlink?{...this.#t.hyperlink}:void 0,citations:[...this.#t.citations],reviewMarkIds:[...this.#t.reviewMarkIds]}}#r(t){const n=this.#t.hyperlink;const r=t?.uri??n?.uri??"";const i=t?.isExternal??t?.isExternal??n?.isExternal??false;const o=t?.action??t?.action??n?.action??vSr;return{...n??{},...t,uri:r,isExternal:i,action:o}}};var Gpe=class{#e;#t;constructor(t,n=[]){this.#e=t;this.#t=(n??[]).map(r=>new jI(this.#n(),r))}get items(){return[...this.#t]}get length(){return this.#t.length}getItem(t){if(t<0||t>=this.#t.length){return void 0}return this.#t[t]}add(t=""){const n=new jI(this.#n(),{id:"",text:t});this.#t.push(n);return n}replace(t){this.#t=[...t]}cloneWithText(t,n){const r=t.toProto();r.id="";r.text=n;return new jI(this.#n(),r)}clear(){this.#t=[]}toProto(){return this.#t.map(t=>t.toProto())}#n(){return this.#e}};function vz(e){if(!e){return void 0}const t=structuredClone(e);t.tabStops=t.tabStops??[];return t}var ST=class{#e;#t;#n;#r;#i;constructor(t,n){this.#e=t;this.#e.fontFamilyCache?.addTextStyle(n.textStyle);this.#e.fontFamilyCache?.addTextStyle(n.endParagraphTextStyle);this.#t={id:n.id??"",bulletCharacter:n.bulletCharacter,marginLeft:n.marginLeft,indent:n.indent,spaceAfter:n.spaceAfter,spaceBefore:n.spaceBefore,styleId:n.styleId,level:n.level,docxSectionBreakCarrier:n.docxSectionBreakCarrier,paragraphStyle:vz(n.paragraphStyle),endParagraphTextStyle:structuredClone(n.endParagraphTextStyle)};this.#i=structuredClone(n.inlineNodes??[]);this.#n=new Gpe(this.#a(),n.runs??[]);this.#r=n.textStyle?new ko(n.textStyle):void 0}get id(){return this.#t.id}set id(t){this.#t.id=t}get bulletCharacter(){return this.#t.bulletCharacter}set bulletCharacter(t){this.#t.bulletCharacter=t;this.#o({bulletCharacter:t})}get marginLeft(){return this.#t.marginLeft}set marginLeft(t){this.#t.marginLeft=t;this.#o({marginLeft:t})}get indent(){return this.#t.indent}set indent(t){this.#t.indent=t;this.#o({indent:t})}get lineSpacingPercent(){return this.#t.paragraphStyle?.lineSpacingPercent}set lineSpacingPercent(t){this.#o({lineSpacingPercent:t})}get spaceAfter(){return this.#t.spaceAfter}set spaceAfter(t){this.#t.spaceAfter=t}get spaceBefore(){return this.#t.spaceBefore}set spaceBefore(t){this.#t.spaceBefore=t}get style(){return{bulletCharacter:this.#t.bulletCharacter,marginLeft:this.#t.marginLeft,indent:this.#t.indent,spaceBefore:this.#t.spaceBefore,spaceAfter:this.#t.spaceAfter}}set style(t){if(t.bulletCharacter!==void 0){this.bulletCharacter=t.bulletCharacter}if(t.marginLeft!==void 0){this.marginLeft=t.marginLeft}if(t.indent!==void 0){this.indent=t.indent}if(t.spaceBefore!==void 0){this.spaceBefore=t.spaceBefore}if(t.spaceAfter!==void 0){this.spaceAfter=t.spaceAfter}}get styleId(){return this.#t.styleId}set styleId(t){this.#t.styleId=t}get level(){return this.#t.level}set level(t){this.#t.level=t}get docxSectionBreakCarrier(){return this.#t.docxSectionBreakCarrier===true}get paragraphStyle(){return vz(this.#t.paragraphStyle)}set paragraphStyle(t){this.#t.paragraphStyle=vz(t)}get resolvedTextStyle(){return this.#e.getResolvedParagraphTextStyle?.(this)}get resolvedParagraphStyle(){const t=this.#e.getResolvedParagraphStyle?.(this);return t?{...t}:void 0}get runs(){return this.#n}get inlineNodes(){return structuredClone(this.#i)}set inlineNodes(t){this.#i=structuredClone(t)}addRun(t=""){return this.#n.add(t)}get textStyle(){return this.#r}set textStyle(t){this.#r=t}toPlainText(){if(this.#n.items.length===0&&this.#i.length>0){return f3t(this.#i)}return this.#n.items.map(t=>t.text).join("")}setPlainText(t){const n=new jI(this.#a(),{id:"",text:t});this.#n.replace([n]);this.#i=[]}toProto(){const t=this.#i.some(r=>r.math!==void 0);const n=this.#n.items.length===0||t?structuredClone(this.#i):[];return{id:this.#t.id,runs:this.#n.toProto(),textStyle:this.#r?.toProto(),bulletCharacter:this.#t.bulletCharacter,marginLeft:this.#t.marginLeft,indent:this.#t.indent,spaceAfter:this.#t.spaceAfter,spaceBefore:this.#t.spaceBefore,styleId:this.#t.styleId,level:this.#t.level,docxSectionBreakCarrier:this.#t.docxSectionBreakCarrier,inlineNodes:n,paragraphStyle:vz(this.#t.paragraphStyle),endParagraphTextStyle:structuredClone(this.#t.endParagraphTextStyle)}}#a(){return{...this.#e,getParagraph:()=>this}}#o(t){const n=vz(this.#t.paragraphStyle)??{};for(const[r,i]of Object.entries(t)){if(i===void 0){delete n[r]}else{n[r]=i}}this.#t.paragraphStyle=Object.keys(n).length>0?vz(n):void 0}};var Hv=class{#e;#t;constructor(t,n=[]){this.#e=t;this.#t=(n??[]).map(r=>new ST(this.#n(),r))}get items(){return[...this.#t]}get length(){return this.#t.length}getItem(t){if(t<0||t>=this.#t.length){return void 0}return this.#t[t]}add(){const t=new ST(this.#n(),{id:"",runs:[]});this.#t.push(t);return t}append(t){const n=new ST(this.#n(),t);this.#t.push(n);return n}insertAt(t,n){const r=new ST(this.#n(),n);if(t<0||t>=this.#t.length){this.#t.push(r)}else{this.#t.splice(t,0,r)}return r}removeAt(t){if(t<0||t>=this.#t.length){return void 0}const[n]=this.#t.splice(t,1);return n}clear(){this.#t=[]}setFromLines(t){const n=t??[];if(n.length===0){const r=new ST(this.#n(),{id:"",runs:[]});r.setPlainText("");this.#t=[r];return}this.#t=n.map(r=>{const i=new ST(this.#n(),{id:"",runs:[]});i.setPlainText(r??"");return i})}toPlainText(){return this.#t.map(t=>t.toPlainText()).join("\n")}setFromPlainText(t){const n=t.length===0?[]:t.split(/\r?\n/).map(r=>r.replace(/\r$/,""));if(n.length===0){const r=new ST(this.#n(),{id:"",runs:[]});r.setPlainText("");this.#t=[r];return}this.#t=n.map(r=>{const i=new ST(this.#n(),{id:"",runs:[]});i.setPlainText(r);return i})}toProto(){return this.#t.map(t=>t.toProto())}#n(){return this.#e}};var wMt=typeof Intl!=="undefined"?Intl:void 0;var EMt=typeof wMt?.Segmenter==="function"?new wMt.Segmenter:void 0;var CMt=1024;var cN=new Map;function pm(e){if(!e){return[]}const t=cN.get(e);if(t){return t}if(EMt){const r=[];for(const i of EMt.segment(e)){if(i.segment){r.push(i.segment)}}if(cN.size>=CMt){cN.clear()}cN.set(e,r);return r}const n=Array.from(e);if(cN.size>=CMt){cN.clear()}cN.set(e,n);return n}var _Sr="\u2022";var TSr=285750;var wSr=-285750;var ESr=342900;var CSr=-342900;var SSr="arabicPeriod";var ASr=720;var kSr=-360;var RSr=720;var PSr=-360;function uN(e,t,n="presentation"){const r=n==="document"?ASr:TSr;const i=n==="document"?kSr:wSr;const o=n==="document"?RSr:ESr;const a=n==="document"?PSr:CSr;if(t==="list"){e.bulletCharacter=_Sr;e.marginLeft=r;e.indent=i;const s=e.paragraphStyle??{tabStops:[]};e.paragraphStyle={...s,autoNumberType:void 0};return}if(t==="numberedList"){e.bulletCharacter=void 0;e.marginLeft=o;e.indent=a;const s=e.paragraphStyle??{tabStops:[]};e.paragraphStyle={...s,autoNumberType:SSr}}}var ISr=new Set(["font-bold","font-semibold","font-black"]);var MSr=new Set(["font-normal","font-light","font-medium","font-thin","font-extralight","font-extrabold"]);function SMt(e){const t=e.trim();if(!t)return null;const n=t.toLowerCase();if(ISr.has(n)){return true}if(MSr.has(n)){return false}return null}var LSr={"leading-none":1,"leading-tight":1.25,"leading-snug":1.375,"leading-normal":1.5,"leading-relaxed":1.625,"leading-loose":2};var DSr={"leading-3":12,"leading-4":16,"leading-5":20,"leading-6":24,"leading-7":28,"leading-8":32,"leading-9":36,"leading-10":40};var FSr=e=>{const t=/^leading-\[([0-9]+(?:\.[0-9]+)?)\]$/.exec(e);if(t){const r=Number(t[1]);return Number.isFinite(r)&&r>0?r:null}const n=/^leading-\[([0-9]+(?:\.[0-9]+)?)%\]$/.exec(e);if(n){const r=Number(n[1]);if(!Number.isFinite(r)||r<=0){return null}return r/100}return null};var NSr=(e,t)=>{const n=/^leading-\[([0-9]+(?:\.[0-9]+)?)px\]$/.exec(e);if(!n){return null}const r=Number(n[1]);if(!Number.isFinite(r)||r<=0){return null}const i=t!==void 0&&Number.isFinite(t)&&t>0?t:16;return r/i};function AMt(e,t={}){const n=e.trim().toLowerCase();if(!n){return null}const r=LSr[n];if(typeof r==="number"){return r}const i=FSr(n);if(i!==null){return i}const o=NSr(n,t.fontSizePx);if(o!==null){return o}const a=DSr[n];if(typeof a==="number"){const s=t.fontSizePx!==void 0&&Number.isFinite(t.fontSizePx)&&t.fontSizePx>0?t.fontSizePx:16;return a/s}return null}var OSr={"text-xs":12,"text-sm":14,"text-base":16,"text-lg":18,"text-xl":20,"text-2xl":24,"text-3xl":30,"text-4xl":36,"text-5xl":48,"text-6xl":60};function kMt(e){const t=e.trim();if(!t)return null;const n=t.toLowerCase();const r=OSr[n];if(typeof r==="number"){return r}const i=/^text-\[([0-9]+(?:\.[0-9]+)?)px\]$/.exec(n);if(!i){return null}const o=Number(i[1]);if(!Number.isFinite(o)||o<=0){return null}return o}function MX(e){const t=e.split(/\s+/).map(i=>i.trim()).filter(i=>i.length>0);if(t.length===0){return null}const n={};let r=false;for(const i of t){const o=SMt(i);if(o!==null){n.bold=o;r=true;continue}if(i==="italic"){n.italic=true;r=true;continue}const a=YI(i);if(a){n.shadow=a;r=true;continue}const s=kMt(i);if(s!==null){n.fontSize=s;r=true;continue}const l=AMt(i,{fontSizePx:typeof n.fontSize==="number"?n.fontSize:void 0});if(l!==null){n.lineSpacing=l;r=true;continue}if(i.startsWith("text-")){const u=i.slice("text-".length);const d=pz(u);if(d){n.color={type:"rgb",value:d.hex,transform:d.alpha===void 0?void 0:{opacity:d.alpha}};r=true}}}return r?n:null}function fE(e){if(e===void 0){return void 0}if(typeof e==="string"){return e}if("type"in e&&e.type!=="proto"){return e}const t=new Mi(e).toConfig();if(!t){return void 0}if(typeof t==="object"&&"type"in t){return t.type==="proto"?void 0:t}return t}function dN(e){if(e===void 0){return void 0}if(typeof e==="string"){return e}if("type"in e&&e.type!=="proto"){return e}const t=new gi(e).toConfig({preserveProto:false});if(!t){return void 0}if(typeof t==="object"&&"type"in t){return t.type==="proto"?void 0:t}return t}function _z(e){if(e===void 0){return void 0}const t=new eo(e).toConfig({preserveProto:false});if(!t||"type"in t){return void 0}return{style:t.style,width:t.width,fill:dN(t.fill)}}function B6e(e){const t={};const n=z6e(e);if(n!==void 0){t.className=n}if("bold"in e){t.bold=e.bold}if("italic"in e){t.italic=e.italic}if("underline"in e){t.underline=e.underline}if("fontSize"in e){t.fontSize=Bb(e.fontSize)}if("characterSpacing"in e){t.characterSpacing=e.characterSpacing}if("typeface"in e){t.typeface=e.typeface}if("lineSpacing"in e){t.lineSpacing=e.lineSpacing}if("alignment"in e){t.alignment=MMt(e.alignment)}if("verticalAlignment"in e){t.verticalAlignment=e.verticalAlignment}else if("anchor"in e){t.verticalAlignment=e.anchor?gz[e.anchor]:void 0}if("autoFit"in e){t.autoFit=e.autoFit}if("wrap"in e){t.wrap=e.wrap}if("insets"in e){t.insets=e.insets}const r=LX(e);if(r!==void 0){t.style=r}const i=IMt(e);if("fill"in e){t.fill=dN(e.fill)}if("color"in e||i!==void 0){t.color=fE(i)}if("highlight"in e){t.highlight=fE(e.highlight)}if("outline"in e){t.outline=_z(e.outline)}if("shadow"in e){t.shadow=e.shadow}return t}function RMt(e){const t={};const n=z6e(e);if(n!==void 0){t.className=n}if("bold"in e){t.bold=e.bold}if("italic"in e){t.italic=e.italic}if("underline"in e){t.underline=e.underline}if("fontSize"in e){t.fontSize=Bb(e.fontSize)}if("characterSpacing"in e){t.characterSpacing=e.characterSpacing}if("typeface"in e){t.typeface=e.typeface}if("lineSpacing"in e){t.lineSpacing=e.lineSpacing}if("alignment"in e){t.alignment=MMt(e.alignment)}const r=LX(e);if(r!==void 0){t.style=r}const i=IMt(e);if("fill"in e){t.fill=dN(e.fill)}if("color"in e||i!==void 0){t.color=fE(i)}if("highlight"in e){t.highlight=fE(e.highlight)}if("outline"in e){t.outline=_z(e.outline)}if("shadow"in e){t.shadow=e.shadow}return t}function PMt(e,t){const n=LX(t);if(n!==void 0){e.styleId=n;uN(e,n);for(const i of e.runs.items){i.textStyle=void 0}}const r=e.textStyle?new ko(e.textStyle.toProto()):new ko;Uf(r,t);e.textStyle=r;if("lineSpacing"in t){e.lineSpacingPercent=t.lineSpacing===void 0?void 0:Math.round(t.lineSpacing*1e5)}}function LX(e){const t=e["style"];if(typeof t!=="string"){return void 0}const n=t.trim();return n.length>0?n:void 0}function DX(e){const t=e?.trim();return t&&t.length>0?t:void 0}function Hpe(e){const t=z6e(e);const n=t?MX(t):null;const r={};if(n){Object.assign(r,n)}for(const[i,o]of Object.entries(e)){if(i==="className"){continue}r[i]=o}return{className:t,styleConfig:r}}function IMt(e){if("color"in e){return e.color}if(!("fill"in e)){return void 0}const t=new ko;Uf(t,{fill:e.fill});return t.color?.toConfig()}function z6e(e){const t=e["className"];if(typeof t!=="string"){return void 0}return DX(t)}function MMt(e){return dE($pe(e))}var E0=class e{#e;#t;#n;#r=false;#i;constructor(t,n,r={}){this.#e=t;this.#t=n.map(i=>({...i})).filter(i=>i.startOffset{if(i.paragraphIndex!==o.paragraphIndex){return i.paragraphIndex-o.paragraphIndex}return i.startOffset-o.startOffset});this.#n={...r}}static empty(t,n={}){return new e(t,[],n)}get isEmpty(){return this.#t.length===0}get bold(){return this.#f(t=>t.bold)}set bold(t){this.#s((n,r)=>{this.#_(r,n).bold=t});this.#c({bold:t})}get italic(){return this.#f(t=>t.italic)}set italic(t){this.#s((n,r)=>{this.#_(r,n).italic=t});this.#c({italic:t})}get fontSize(){return this.#f(t=>t.fontSize)}set fontSize(t){this.#s((n,r)=>{this.#_(r,n).fontSize=t});this.#c({fontSize:t})}get typeface(){return this.#f(t=>t.typeface)}set typeface(t){this.#s((n,r)=>{this.#_(r,n).typeface=t});this.#c({typeface:t})}get underline(){return this.#f(t=>t.underline)}set underline(t){this.#s((n,r)=>{this.#_(r,n).underline=t});this.#c({underline:t})}get color(){return this.#f(t=>{const n=t.color;return n?.toProto()?n:void 0},(t,n)=>this.#w(t,n))}set color(t){this.#s((n,r)=>{const i=this.#_(r,n);i.fill={type:"solid",color:t}});this.#c({color:fE(t)})}get fill(){return this.#f(t=>{const n=t.fill;return n?.toProto()?n:void 0},(t,n)=>this.#I(t,n))}set fill(t){this.#s((n,r)=>{const i=this.#_(r,n);i.fill=t});this.#c({fill:dN(t)})}get highlight(){return this.#f(t=>{const n=t.highlight;return n?.toProto()?n:void 0},(t,n)=>this.#w(t,n))}set highlight(t){this.#s((n,r)=>{this.#_(r,n).highlight=t});this.#c({highlight:fE(t)})}get outline(){return this.#f(t=>{const n=t.outline;return n?.toProto()?n:void 0},(t,n)=>this.#M(t,n))}set outline(t){this.#s((n,r)=>{const i=this.#_(r,n);i.outline=t});this.#c({outline:_z(t)})}get shadow(){return this.#f(t=>t.shadow,(t,n)=>JSON.stringify(t)===JSON.stringify(n))}set shadow(t){this.#s((n,r)=>{const i=this.#_(r,n);i.shadow=t});this.#c({shadow:t})}get hyperlink(){return this.#d((t,n)=>t.hyperlink,(t,n)=>this.#A(t,n))}set hyperlink(t){this.#s(n=>{n.hyperlink=t?{...t}:void 0});this.#c({link:t?{...t}:null})}get link(){return this.hyperlink}set link(t){this.hyperlink=t}get citations(){return this.#d(t=>t.citations,(t,n)=>this.#k(t,n))}set citations(t){const n=t?[...t]:[];this.#s(r=>{r.citations=n})}set reviewMarks(t){const n=(t??[]).map(r=>typeof r==="string"?r:r.id).filter(r=>Boolean(r));this.#s(r=>{r.reviewMarkIds=n})}get alignment(){return this.#p(t=>dE(t.alignment))}set alignment(t){this.#l(n=>{const r=this.#E(n);r.alignment=t});this.#c({alignment:t})}get spacingBefore(){return this.#m(t=>t.spaceBefore)}set spacingBefore(t){this.#l(n=>{n.spaceBefore=t});this.#c({spacingBefore:t})}get lineSpacing(){const t=this.#m(n=>n.lineSpacingPercent);if(t===void 0){return void 0}return t/1e5}set lineSpacing(t){this.#l(n=>{n.lineSpacingPercent=t===void 0?void 0:Math.round(t*1e5)});this.#c({lineSpacing:t})}get spacingAfter(){return this.#m(t=>t.spaceAfter)}set spacingAfter(t){this.#l(n=>{n.spaceAfter=t});this.#c({spacingAfter:t})}get indentLeft(){return this.#m(t=>t.marginLeft)}set indentLeft(t){this.#l(n=>{n.marginLeft=t});this.#c({indentLeft:t})}get indentFirstLine(){return this.#m(t=>t.indent)}set indentFirstLine(t){this.#l(n=>{n.indent=t});this.#c({indentFirstLine:t})}get style(){const t=this.#m(o=>o.styleId);if(t!==void 0){return t}const n=this.#h();const r=n.some(o=>{const a=o.styleId;return a!==void 0&&a!==""});if(r){return void 0}const i=this.#S();return i?.name}set style(t){const n=lN(t);if(n){this.#a(n);return}if(t!==void 0&&typeof t!=="string"){return}const r=typeof t==="string"&&t.trim().length>0?t:void 0;const i=r?this.#n.resolveTextStyle?.(r):void 0;this.#l(o=>{o.styleId=r;o.textStyle=i;uN(o,r,this.#n.listPresetProfile??"presentation");this.#C(o)});this.#n.setDefaultTextStyle?.(i);this.#R();this.#c({style:r})}get className(){return this.#i}set className(t){const n=DX(t);this.#i=n;if(!n){return}this.#a({className:n})}#a(t){const{className:n,styleConfig:r}=Hpe(t);if(n!==void 0){this.#i=n}this.#s((o,a)=>{const s=this.#_(a,o);Uf(s,r)});this.#l(o=>{PMt(o,r)});const i=this.#o(r);this.#n.setDefaultTextStyle?.(i);this.#R();this.#c(RMt(t))}#o(t){const n=this.#S();const r=n?new ko(n.toProto()):new ko;Uf(r,t);return r}getTextRange(){if(this.isEmpty){return void 0}if(this.#t.length===0){return void 0}const t=this.#t[0];const n=this.#t[this.#t.length-1];const r=this.#P();const i=(r[t.paragraphIndex]??0)+t.startOffset;const o=(r[n.paragraphIndex]??0)+n.endOffset;return{startCp:i,length:Math.max(0,o-i)}}replace(t){if(this.isEmpty){return}const n=this.#F();if(!n){return}this.#b();const{paragraph:r,paragraphIndex:i,startOffset:o,endOffset:a}=n;const s=r.runs;const l=s.items;if(l.length===0){return}const u=[];let d=0;for(const C of l){const A=C.text;const P=A.length;const L=d;const I=L+P;if(P>0&&L>=o&&I<=a){u.push(C)}d=I}if(u.length===0){return}const f=this.#O(t);const h=r.toPlainText().length;const m=o===0&&a===h;const g=this.#L(t,s,u[0]);const x=[];d=0;let w=g.length===0;for(const C of l){const A=C.text;const P=A.length;const L=d;const I=L+P;const N=P>0&&L>=o&&I<=a;if(!N){x.push(C)}else if(!w){for(const O of g){x.push(O)}w=true}d=I}if(!w){for(const C of g){x.push(C)}}s.replace(x);if(m&&f){this.#B(r,f)}const _=this.#D(g);if(_===0){this.#t=[]}else{this.#t=[{paragraphIndex:i,startOffset:o,endOffset:o+_}]}this.#r=false;this.#R()}insertAfter(t){if(this.isEmpty){return e.empty(this.#e,this.#N())}const n=this.#F();if(!n){return e.empty(this.#e,this.#N())}this.#b();const{paragraph:r,paragraphIndex:i,endOffset:o}=n;const a=r.runs;const s=a.items;if(s.length===0){return e.empty(this.#e,this.#N())}const l=[];const u=[];let d=0;for(const[_,C]of s.entries()){const A=C.text;const P=A.length;const L=d;const I=L+P;if(P>0&&L>=n.startOffset&&I<=o){l.push(_);u.push(C)}d=I}if(u.length===0){return e.empty(this.#e,this.#N())}const f=u[u.length-1];const h=this.#L(t,a,f);if(h.length===0){return e.empty(this.#e,this.#N())}const m=l[l.length-1];const g=[];s.forEach((_,C)=>{g.push(_);if(C===m){for(const A of h){g.push(A)}}});a.replace(g);this.#r=false;this.#R();const x=this.#D(h);const w=x===0?[]:[{paragraphIndex:i,startOffset:o,endOffset:o+x}];return new e(this.#e,w,this.#N())}#s(t){if(this.isEmpty){return}this.#b();this.#y(t);this.#R()}#l(t){if(this.isEmpty){return}this.#x(t);this.#R()}#c(t){if(!this.#n.recordOp){return}if(!Object.values(t).some(o=>o!==void 0)){return}const n=this.#n.getAnchorId?.();if(!n){return}const r=this.getTextRange();if(!r||r.length<=0){return}const i=this.#u(n,r);if(!i){return}this.#n.recordOp({op:"textrange.style.set",target:i,props:t})}#u(t,n){if(t.startsWith("@")){return`tr/${t}/${n.startCp}/${n.length}`}const r=t.indexOf("/");if(r<=0||r===t.length-1){return void 0}const i=t.slice(0,r);const o=t.slice(r+1);if(!i||!o){return void 0}return`tr/${i}/${o}/${n.startCp}/${n.length}`}#f(t,n=this.#T){return this.#d((r,i)=>{const o=r.textStyle;if(o){const l=t(o);if(l!==void 0){return l}}const a=i.textStyle;if(a){const l=t(a);if(l!==void 0){return l}}const s=this.#S();return s?t(s):void 0},n)}#d(t,n=this.#T){const r=this.#g();if(r.length===0){return void 0}let i;let o=false;for(const{run:a,paragraph:s}of r){const l=t(a,s);if(!o){o=true;i=l;continue}if(!n(i,l)){return void 0}}return i}#p(t,n=this.#T){return this.#m(r=>{const i=r.textStyle;if(i){const a=t(i);if(a!==void 0){return a}}const o=this.#S();return o?t(o):void 0},n)}#m(t,n=this.#T){const r=this.#h();if(r.length===0){return void 0}let i;let o=false;for(const a of r){const s=t(a);if(!o){o=true;i=s;continue}if(!n(i,s)){return void 0}}return i}#h(){const t=[];const n=new Set;this.#x(r=>{if(!n.has(r)){n.add(r);t.push(r)}});return t}#g(){const t=[];const n=new Set;this.#b();this.#y((r,i)=>{if(!n.has(r)){n.add(r);t.push({run:r,paragraph:i})}});return t}#y(t){const n=this.#v();for(const[r,i]of n.entries()){const o=this.#e.getItem(r);if(!o){continue}const a=o.runs.items;if(a.length===0){continue}const s=[...i].sort((d,f)=>d.startOffset-f.startOffset);let l=0;let u=0;for(const d of a){const f=d.text;const h=f.length;if(h===0){continue}const m=l;const g=m+h;while(um){break}u+=1}const x=s[u];if(!x){break}if(x.startOffset<=m&&g<=x.endOffset&&x.startOffset!==x.endOffset){t(d,o)}l=g}}}#x(t){const n=this.#v();for(const r of n.keys()){const i=this.#e.getItem(r);if(i){t(i)}}}#v(){const t=new Map;for(const n of this.#t){if(!t.has(n.paragraphIndex)){t.set(n.paragraphIndex,[])}t.get(n.paragraphIndex).push(n)}return t}#_(t,n){let r=n.textStyle;if(!r){const i=t.textStyle??this.#S();r=i?new ko(i.toProto()):new ko;n.textStyle=r}return r}#E(t){let n=t.textStyle;if(!n){const r=this.#S();n=r?new ko(r.toProto()):new ko;t.textStyle=n}return n}#S(){return this.#n.getDefaultTextStyle?.()}#C(t){const n=t.runs.items;for(const r of n){r.textStyle=void 0}}#b(){if(this.#r||this.isEmpty){return}const t=this.#v();for(const[n,r]of t.entries()){const i=this.#e.getItem(n);if(!i){continue}const o=i.runs;const a=o.items;if(a.length===0){continue}const s=new Set;for(const f of r){s.add(f.startOffset);s.add(f.endOffset)}const l=[...s].sort((f,h)=>f-h);const u=[];let d=0;for(const f of a){const h=f.text;const m=h.length;const g=d;const x=g+m;const w=l.filter(P=>P>g&&PObject.is(r,n[i]))}#P(){const t=[];const n=this.#e.items;let r=0;n.forEach((i,o)=>{t[o]=r;r+=i.toPlainText().length;if(os.paragraphIndex));if(t.size!==1){return void 0}const[n]=t;if(n===void 0){return void 0}const r=this.#e.getItem(n);if(!r){return void 0}const i=this.#t.filter(s=>s.paragraphIndex===n);if(i.length===0){return void 0}const o=Math.min(...i.map(s=>s.startOffset));const a=Math.max(...i.map(s=>s.endOffset));return{paragraph:r,paragraphIndex:n,startOffset:o,endOffset:a}}#L(t,n,r){if(this.#z(t)){const a=t.paragraphs.items;if(a.length===0){return[]}const s=a[0];if(!s){return[]}const l=s.runs.items;if(l.length===0){return[]}return l.map(u=>n.cloneWithText(u,u.text))}const i=t??"";const o=typeof i==="string"?i:String(i);if(o.length===0){return[]}return[n.cloneWithText(r,o)]}#O(t){if(!this.#z(t)){return void 0}const n=t.paragraphs.items;if(n.length===0){return void 0}return n[0]}#B(t,n){t.styleId=n.styleId;const r=n.textStyle;t.textStyle=r?new ko(r.toProto()):void 0;t.bulletCharacter=n.bulletCharacter;t.marginLeft=n.marginLeft;t.indent=n.indent;t.spaceAfter=n.spaceAfter;t.spaceBefore=n.spaceBefore;t.paragraphStyle=n.paragraphStyle?{...n.paragraphStyle}:void 0}#D(t){return t.reduce((n,r)=>n+r.text.length,0)}#z(t){if(typeof t!=="object"||t===null){return false}const n=t;if(!n.paragraphs){return false}return n.paragraphs instanceof Hv}#N(){return{...this.#n}}#R(){this.#n.onLayoutInvalidated?.()}};var nj=Ui(vme());var GDt="data-granola-style";var HDt="data-granola-paragraph-properties";var WDt="data-granola-token-kind";var _1="data-granola-node-kind";var YDt="data-granola-fraction-kind";var qDt="data-granola-limit-placement";var XDt="data-granola-hide-subscript";var jDt="data-granola-hide-superscript";var KDt="data-granola-grow";var ZDt="data-granola-shape";var JDt="data-granola-implicit-delimiters";var QDt="data-granola-base-justification";var eFt="data-granola-justification";var tFt="data-granola-show";var nFt="data-granola-zero-width";var rFt="data-granola-zero-ascent";var iFt="data-granola-zero-descent";function wme(e){if(!e?.root){return e}return aFt(oFt(e))}function iFo(e){return cFt(oFt(e))}function oFo(e){return aFt(JRr(e.mathml),e.displayMode)}function oFt(e){const t={display:e?.displayMode===2?"block":"inline"};if(e?.paragraphProperties){t[HDt]=JSON.stringify(e.paragraphProperties)}return{tag:"math",attributes:t,children:e?.root?[Bc(e.root)]:[]}}function aFt(e,t){if(e.tag!=="math"){throw new Error("MathML root must be a `` element.")}const n=Sd(l3(e.children.map(a=>Jc(a)).filter(a=>a!==void 0)))??{sequence:{children:[]}};const r=e.attributes["display"];const i=r==="block"||t==="block"?2:1;const o=uFt(e.attributes[HDt]);return{displayMode:i,paragraphProperties:o??(i===2?{justification:4}:void 0),root:n}}function Sd(e){if(!e){return void 0}if(e.token){return IRr(e)}if(e.sequence){return G8e(l3(e.sequence.children.flatMap(t=>_me(Sd(t)))),e.style)}if(e.fraction){return{...e,fraction:{...e.fraction,numerator:Sd(e.fraction.numerator),denominator:Sd(e.fraction.denominator)}}}if(e.radical){return{...e,radical:{...e.radical,degree:Sd(e.radical.degree),radicand:Sd(e.radical.radicand)}}}if(e.scripts){return{...e,scripts:{...e.scripts,base:Sd(e.scripts.base),subscript:Sd(e.scripts.subscript),superscript:Sd(e.scripts.superscript),presubscript:Sd(e.scripts.presubscript),presuperscript:Sd(e.scripts.presuperscript)}}}if(e.nary){return{...e,nary:{...e.nary,lowerLimit:Sd(e.nary.lowerLimit),upperLimit:Sd(e.nary.upperLimit),body:Sd(e.nary.body)}}}if(e.delimited){return{...e,delimited:{...e.delimited,items:e.delimited.items.flatMap(t=>_me(Sd(t)))}}}if(e.function){return{...e,function:{...e.function,name:Sd(e.function.name),argument:Sd(e.function.argument)}}}if(e.matrix){return{...e,matrix:{...e.matrix,rows:e.matrix.rows.map(t=>({...t,cells:t.cells.flatMap(n=>_me(Sd(n)))}))}}}if(e.accent){return{...e,accent:{...e.accent,base:Sd(e.accent.base)}}}if(e.bar){return{...e,bar:{...e.bar,base:Sd(e.bar.base)}}}if(e.enclosure){return{...e,enclosure:{...e.enclosure,body:Sd(e.enclosure.body)}}}if(e.limit){return{...e,limit:{...e.limit,base:Sd(e.limit.base),limit:Sd(e.limit.limit)}}}if(e.phantom){return{...e,phantom:{...e.phantom,body:Sd(e.phantom.body)}}}if(e.equationArray){return{...e,equationArray:{...e.equationArray,rows:e.equationArray.rows.flatMap(t=>_me(Sd(t)))}}}return e}function _me(e){if(!e){return[]}return e.sequence?.children??[e]}function IRr(e){const t=e.token;if(!t){return e}const n=MRr(t.text,t.kind);if(n.length===1){return e}return{style:e.style,sequence:{children:n.map(r=>({style:e.style,token:r}))}}}function MRr(e,t){const n=Array.from(e);if(n.length<=1||t===4||t===2&&n.every(i=>sFt(i))||t===1&&n.every(i=>$8e(i))){return[{text:e,kind:t}]}const r=[];for(const i of n){const o=LRr(i,t);const a=r[r.length-1];if(a&&DRr(a.kind,o,t)){a.text+=i;continue}r.push({text:i,kind:o})}return r}function LRr(e,t){if(sFt(e)){return 2}if(FRr(e)||NRr(e)){return 3}if(t===1&&$8e(e)){return 1}if($8e(e)){return 5}return t??5}function DRr(e,t,n){if(e!==t){return false}if(t===2){return true}return t===1&&n===1}function $8e(e){return/^\p{L}$/u.test(e)}function sFt(e){return/^\p{N}$/u.test(e)}function FRr(e){return/^[=<>≤≥≠≈∼±∓+\-−×÷·∧∨∪∩∘⊗⊕∫∑∏(){}\[\]|⌈⌉⌊⌋]$/u.test(e)}function NRr(e){return/^[,;:!]$/u.test(e)}function Bc(e){if(e.token){return Uo(QRr(e.token.kind),{...sg(e.style),[WDt]:String(e.token.kind??0)},[],e.token.text)}if(e.sequence){return Uo("mrow",sg(e.style),e.sequence.children.map(t=>Bc(t)))}if(e.fraction){return ORr(e.fraction,e.style)}if(e.radical){return BRr(e.radical,e.style)}if(e.scripts){return zRr(e.scripts,e.style)}if(e.nary){return URr(e.nary,e.style)}if(e.delimited){return VRr(e.delimited,e.style)}if(e.function){return Uo("mrow",{...sg(e.style),[_1]:"function"},[e.function.name?Bc(e.function.name):Uo("mi",{},[],""),e.function.argument?Bc(e.function.argument):Uo("mrow",{},[])])}if(e.matrix){return $Rr(e.matrix,e.style)}if(e.accent){return GRr(e.accent,e.style)}if(e.bar){return HRr(e.bar,e.style)}if(e.enclosure){return WRr(e.enclosure,e.style)}if(e.limit){return YRr(e.limit,e.style)}if(e.phantom){return qRr(e.phantom,e.style)}if(e.equationArray){return XRr(e.equationArray,e.style)}return Uo("mrow",sg(e.style),[])}function ORr(e,t){const n={...sg(t),[YDt]:tPr(e.kind)};if(e.kind===4){n["linethickness"]="0"}if(e.kind===2){n["bevelled"]="true"}return Uo("mfrac",n,[e.numerator?Bc(e.numerator):Uo("mrow",{},[]),e.denominator?Bc(e.denominator):Uo("mrow",{},[])])}function BRr(e,t){const n=e.radicand?Bc(e.radicand):Uo("mrow",{},[]);if(e.hideDegree||!e.degree){return Uo("msqrt",sg(t),[n])}return Uo("mroot",sg(t),[n,Bc(e.degree)])}function zRr(e,t){const n=e.base?Bc(e.base):Uo("mi",{},[],"");const r=sg(t);if(e.presubscript||e.presuperscript){return Uo("mmultiscripts",r,[n,e.subscript?Bc(e.subscript):Uo("none",{},[]),e.superscript?Bc(e.superscript):Uo("none",{},[]),Uo("mprescripts",{},[]),e.presubscript?Bc(e.presubscript):Uo("none",{},[]),e.presuperscript?Bc(e.presuperscript):Uo("none",{},[])])}if(e.subscript&&e.superscript){return Uo("msubsup",r,[n,Bc(e.subscript),Bc(e.superscript)])}if(e.subscript){return Uo("msub",r,[n,Bc(e.subscript)])}if(e.superscript){return Uo("msup",r,[n,Bc(e.superscript)])}return Uo("mrow",r,[n])}function URr(e,t){const n=Uo("mo",{},[],e.operator);const r=rPr(n,e.lowerLimit,e.upperLimit,e.limitPlacement);const i=[r];if(e.body){i.push(Bc(e.body))}return Uo("mrow",{...sg(t),[_1]:"nary",[qDt]:iPr(e.limitPlacement),[XDt]:String(e.hideSubscript===true),[jDt]:String(e.hideSuperscript===true)},i)}function VRr(e,t){const n=e.beginDelimiter!==void 0&&e.beginDelimiter.length>0||e.endDelimiter!==void 0&&e.endDelimiter.length>0||e.separatorDelimiter!==void 0&&e.separatorDelimiter.length>0;const r=!n;return Uo("mfenced",{...sg(t),open:r?"(":e.beginDelimiter??"",close:r?")":e.endDelimiter??"",separators:e.separatorDelimiter??"",[KDt]:String(e.grow!==false),[ZDt]:e.shape??"",...r?{[JDt]:"default-parens"}:{}},e.items.map(i=>Bc(i)))}function $Rr(e,t){const n=e.columns.map(r=>lPr(r.justification)).join(" ");return Uo("mtable",{...sg(t),[_1]:"matrix",...n?{columnalign:n}:{}},e.rows.map(r=>Uo("mtr",{},r.cells.map(i=>Uo("mtd",{},[Bc(i)])))))}function GRr(e,t){const n=e.position===2?"munder":"mover";return Uo(n,{...sg(t),[_1]:"accent"},[e.base?Bc(e.base):Uo("mrow",{},[]),Uo("mo",{},[],e.character)])}function HRr(e,t){const n=e.position===2?"munder":"mover";const r=e.position===2?"_":"\xAF";return Uo(n,{...sg(t),[_1]:"bar"},[e.base?Bc(e.base):Uo("mrow",{},[]),Uo("mo",{},[],r)])}function WRr(e,t){return Uo("menclose",{...sg(t),notation:aPr(e)},[e.body?Bc(e.body):Uo("mrow",{},[])])}function YRr(e,t){return Uo(e.kind===1?"munder":"mover",{...sg(t),[_1]:"limit"},[e.base?Bc(e.base):Uo("mrow",{},[]),e.limit?Bc(e.limit):Uo("mrow",{},[])])}function qRr(e,t){return Uo("mphantom",{...sg(t),[tFt]:String(e.show!==false),[nFt]:String(e.zeroWidth===true),[rFt]:String(e.zeroAscent===true),[iFt]:String(e.zeroDescent===true)},[e.body?Bc(e.body):Uo("mrow",{},[])])}function XRr(e,t){return Uo("mtable",{...sg(t),[_1]:"equation-array",...e.justification!==void 0?{[eFt]:String(e.justification)}:{},...e.baseJustification?{[QDt]:e.baseJustification}:{}},e.rows.map(n=>Uo("mtr",{},[Uo("mtd",{},[Bc(n)])])))}function Jc(e){if(e.tag==="semantics"){return l3(e.children.filter(t=>t.tag!=="annotation"&&t.tag!=="annotation-xml").map(t=>Jc(t)).filter(t=>t!==void 0))}if(e.tag==="mstyle"){return G8e(l3(e.children.map(t=>Jc(t)).filter(t=>t!==void 0)),ym(e.attributes))}if(W8e(e.tag)){return{style:ym(e.attributes),token:{text:e.text??"",kind:ePr(e)}}}if(e.tag==="mrow"){if(e.attributes[_1]==="function"){return{style:ym(e.attributes),function:{name:Jc(e.children[0]??Uo("mi",{},[],"")),argument:Jc(e.children[1]??Uo("mrow",{},[]))}}}if(e.attributes[_1]==="nary"){return jRr(e)}return G8e(l3(e.children.map(t=>Jc(t)).filter(t=>t!==void 0)),ym(e.attributes))}if(e.tag==="mfrac"){return{style:ym(e.attributes),fraction:{kind:nPr(e.attributes),numerator:Jc(e.children[0]??Uo("mrow",{},[])),denominator:Jc(e.children[1]??Uo("mrow",{},[]))}}}if(e.tag==="msqrt"){return{style:ym(e.attributes),radical:{radicand:l3(e.children.map(t=>Jc(t)).filter(t=>t!==void 0)),hideDegree:true}}}if(e.tag==="mroot"){return{style:ym(e.attributes),radical:{radicand:Jc(e.children[0]??Uo("mrow",{},[])),degree:Jc(e.children[1]??Uo("mrow",{},[]))}}}if(e.tag==="msub"||e.tag==="msup"||e.tag==="msubsup"){return{style:ym(e.attributes),scripts:{base:Jc(e.children[0]??Uo("mrow",{},[])),subscript:e.tag!=="msup"?Jc(e.children[1]??Uo("mrow",{},[])):void 0,superscript:e.tag!=="msub"?Jc(e.children[e.tag==="msup"?1:2]??Uo("mrow",{},[])):void 0}}}if(e.tag==="mmultiscripts"){return KRr(e)}if(e.tag==="munder"||e.tag==="mover"||e.tag==="munderover"){return ZRr(e)}if(e.tag==="mfenced"){const t=e.attributes[JDt]==="default-parens";return{style:ym(e.attributes),delimited:{beginDelimiter:t?"":e.attributes["open"]??"",endDelimiter:t?"":e.attributes["close"]??"",separatorDelimiter:e.attributes["separators"]??"",items:e.children.map(n=>Jc(n)).filter(n=>n!==void 0),grow:wN(e.attributes[KDt]),shape:e.attributes[ZDt]}}}if(e.tag==="menclose"){return{style:ym(e.attributes),enclosure:sPr(e)}}if(e.tag==="mphantom"){return{style:ym(e.attributes),phantom:{body:Jc(e.children[0]??Uo("mrow",{},[])),show:wN(e.attributes[tFt]),zeroWidth:wN(e.attributes[nFt]),zeroAscent:wN(e.attributes[rFt]),zeroDescent:wN(e.attributes[iFt])}}}if(e.tag==="mtable"){if(e.attributes[_1]==="equation-array"){return{style:ym(e.attributes),equationArray:{rows:e.children.map(t=>uPr(t)).filter(t=>t!==void 0),justification:pFt(e.attributes[eFt]),baseJustification:e.attributes[QDt]}}}return{style:ym(e.attributes),matrix:{columns:cPr(e.attributes["columnalign"]),rows:e.children.filter(t=>t.tag==="mtr"||t.tag==="mlabeledtr").map(t=>({cells:t.children.filter(n=>n.tag==="mtd").map(n=>hFt(n)??Uo("mrow",{},[])).map(n=>Jc(n)).filter(n=>n!==void 0)}))}}}if(e.tag==="math"){return l3(e.children.map(t=>Jc(t)).filter(t=>t!==void 0))}return l3(e.children.map(t=>Jc(t)).filter(t=>t!==void 0))}function jRr(e){const t=e.children[0];const n=e.children[1];const{operator:r,lowerLimit:i,upperLimit:o,limitPlacement:a}=dFt(t);return{style:ym(e.attributes),nary:{operator:r,lowerLimit:i,upperLimit:o,body:n?Jc(n):void 0,limitPlacement:oPr(e.attributes[qDt])??a,hideSubscript:wN(e.attributes[XDt]),hideSuperscript:wN(e.attributes[jDt])}}}function KRr(e){const t=[...e.children];const n=t.findIndex(o=>o.tag==="mprescripts");const r=n>=0?t.slice(1,n):t.slice(1);const i=n>=0?t.slice(n+1):[];return{style:ym(e.attributes),scripts:{base:Jc(t[0]??Uo("mrow",{},[])),subscript:Tme(r[0]),superscript:Tme(r[1]),presubscript:Tme(i[0]),presuperscript:Tme(i[1])}}}function ZRr(e){if(e.attributes[_1]==="accent"){return{style:ym(e.attributes),accent:{character:H8e(e.children[1]),base:Jc(e.children[0]??Uo("mrow",{},[])),position:e.tag==="munder"?2:1}}}if(e.attributes[_1]==="bar"){return{style:ym(e.attributes),bar:{base:Jc(e.children[0]??Uo("mrow",{},[])),position:e.tag==="munder"?2:1}}}if(e.attributes[_1]==="limit"){return{style:ym(e.attributes),limit:{kind:e.tag==="munder"?1:2,base:Jc(e.children[0]??Uo("mrow",{},[])),limit:Jc(e.children[1]??Uo("mrow",{},[]))}}}const{operator:t,lowerLimit:n,upperLimit:r,limitPlacement:i}=dFt(e);return{nary:{operator:t,lowerLimit:n,upperLimit:r,limitPlacement:i}}}function JRr(e){const t=(0,nj.parse)(e,{lowerCaseTagName:false,comment:false});const n=(t.tagName&&t.tagName.toLowerCase()==="math"?t:void 0)??t.querySelector("math");if(!n){throw new Error("Expected a `` root in the provided MathML.")}return lFt(n)}function lFt(e){const t=e.tagName.toLowerCase();const n={};for(const[o,a]of Object.entries(e.attributes)){n[o]=a}const r=e.childNodes.filter(o=>o.nodeType===nj.NodeType.ELEMENT_NODE).map(o=>lFt(o));const i=W8e(t)?e.text:e.childNodes.filter(o=>o.nodeType===nj.NodeType.TEXT_NODE).map(o=>o.rawText).join("").trim()||void 0;return{tag:t,attributes:n,children:r,text:i}}function cFt(e){const t=Object.entries(e.attributes).map(([i,o])=>` ${i}="${dPr(o)}"`).join("");const n=e.children.map(i=>cFt(i)).join("");const r=e.text?fPr(e.text):"";if(!r&&!n){return`<${e.tag}${t}/>`}return`<${e.tag}${t}>${r}${n}`}function Uo(e,t,n,r){return{tag:e,attributes:t,children:n,text:r}}function l3(e){if(e.length===0){return void 0}if(e.length===1){return e[0]}return{sequence:{children:e}}}function G8e(e,t){if(!e||!t){return e}return{...e,style:e.style??t}}function sg(e){return e?{[GDt]:JSON.stringify(e)}:{}}function ym(e){return uFt(e[GDt])}function uFt(e){if(!e){return void 0}try{return JSON.parse(e)}catch{return void 0}}function QRr(e){if(e===2){return"mn"}if(e===3){return"mo"}if(e===4){return"mtext"}return"mi"}function ePr(e){const t=pFt(e.attributes[WDt]);if(t!==void 0){return t}if(e.tag==="mn"){return 2}if(e.tag==="mo"){return 3}if(e.tag==="mtext"){return 4}return 1}function W8e(e){return e==="mi"||e==="mn"||e==="mo"||e==="mtext"}function tPr(e){if(e===1){return"bar"}if(e===2){return"skewed"}if(e===3){return"linear"}if(e===4){return"no-bar"}return"unspecified"}function nPr(e){const t=e[YDt];if(t==="bar"){return 1}if(t==="skewed"){return 2}if(t==="linear"){return 3}if(t==="no-bar"){return 4}if(e["linethickness"]==="0"){return 4}if(e["bevelled"]==="true"){return 2}return 0}function rPr(e,t,n,r){const i=r!==1;if(t&&n){return Uo(i?"munderover":"msubsup",{},[e,Bc(t),Bc(n)])}if(t){return Uo(i?"munder":"msub",{},[e,Bc(t)])}if(n){return Uo(i?"mover":"msup",{},[e,Bc(n)])}return e}function dFt(e){if(!e){return{operator:""}}if(e.tag==="msub"||e.tag==="msup"||e.tag==="msubsup"||e.tag==="munder"||e.tag==="mover"||e.tag==="munderover"){const t=e.children[0];const n=H8e(t);const r=e.tag==="msub"||e.tag==="msubsup"||e.tag==="munder"||e.tag==="munderover"?Jc(e.children[1]??Uo("mrow",{},[])):void 0;const i=e.tag==="msup"||e.tag==="msubsup"||e.tag==="mover"||e.tag==="munderover"?Jc(e.children[e.tag==="msup"||e.tag==="mover"?1:2]??Uo("mrow",{},[])):void 0;const o=e.tag==="munder"||e.tag==="mover"||e.tag==="munderover"?2:1;return{operator:n,lowerLimit:r,upperLimit:i,limitPlacement:o}}return{operator:H8e(e)}}function iPr(e){if(e===2){return"under-over"}if(e===1){return"sub-sup"}return"unspecified"}function oPr(e){if(e==="under-over"){return 2}if(e==="sub-sup"){return 1}return void 0}function Tme(e){if(!e||e.tag==="none"){return void 0}return Jc(e)}function H8e(e){if(!e){return""}if(W8e(e.tag)){return e.text??""}return fFt(e)}function fFt(e){return`${e.text??""}${e.children.map(t=>fFt(t)).join("")}`}function aPr(e){const t=[];if(!e.hideTop||!e.hideRight||!e.hideBottom||!e.hideLeft){t.push("box")}if(e.strikeHorizontal){t.push("horizontalstrike")}if(e.strikeVertical){t.push("verticalstrike")}if(e.strikeTopLeftToBottomRight){t.push("downdiagonalstrike")}if(e.strikeBottomLeftToTopRight){t.push("updiagonalstrike")}return t.join(" ")}function sPr(e){const t=new Set((e.attributes["notation"]??"").split(/\s+/).map(n=>n.trim()).filter(n=>n.length>0));return{body:Jc(e.children[0]??Uo("mrow",{},[])),hideTop:!t.has("box"),hideBottom:!t.has("box"),hideLeft:!t.has("box"),hideRight:!t.has("box"),strikeHorizontal:t.has("horizontalstrike"),strikeVertical:t.has("verticalstrike"),strikeTopLeftToBottomRight:t.has("downdiagonalstrike"),strikeBottomLeftToTopRight:t.has("updiagonalstrike")}}function lPr(e){if(e===1){return"left"}if(e===3){return"right"}return"center"}function cPr(e){if(!e){return[]}return e.split(/\s+/).map(t=>t.trim()).filter(t=>t.length>0).map(t=>({justification:t==="left"?1:t==="right"?3:2}))}function uPr(e){const t=e.children.find(n=>n.tag==="mtd");if(!t){return void 0}return Jc(hFt(t)??Uo("mrow",{},[]))}function hFt(e){return e.children[0]}function pFt(e){if(e===void 0){return void 0}const t=Number.parseInt(e,10);return Number.isFinite(t)?t:void 0}function wN(e){if(e===void 0){return void 0}return e==="true"}function dPr(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(//g,">")}function fPr(e){return e.replace(/&/g,"&").replace(//g,">")}function Lz(e,t="inline"){const n=e??t;if(n==="block"){return 2}if(n==="inline"){return 1}return n}function mFt(e){const t=Lz(e.displayMode);return{id:e.id,displayMode:t,paragraphProperties:e.paragraphProperties??(t===2?{justification:4}:void 0),root:Qu(e.root)}}function gFt(e){return structuredClone(e)}function Qu(e){return structuredClone(e)}function cFo(e,t){return{style:vy(t),sequence:{children:e.map(n=>Qu(n))}}}function rj(e){return{style:vy(e.style),token:{text:e.text,kind:e.kind??1,language:e.language}}}function uFo(e,t){return rj({text:e,style:t,kind:1})}function dFo(e,t){return rj({text:String(e),style:t,kind:2})}function fFo(e,t){return rj({text:e,style:t,kind:3})}function hFo(e,t){return rj({text:e,style:t,kind:4})}function pFo(e,t){return rj({text:e,style:t,kind:5})}function mFo(e,t){return{...Qu(e),style:vy(t)}}function gFo(e){return{style:vy(e.style),fraction:{kind:e.kind??1,numerator:Qu(e.numerator),denominator:Qu(e.denominator)}}}function yFo(e){return{style:vy(e.style),radical:{radicand:Qu(e.radicand),degree:e.degree?Qu(e.degree):void 0,hideDegree:e.hideDegree}}}function bFo(e){return{style:vy(e.style),scripts:{base:Qu(e.base),subscript:e.subscript?Qu(e.subscript):void 0,superscript:e.superscript?Qu(e.superscript):void 0,presubscript:e.presubscript?Qu(e.presubscript):void 0,presuperscript:e.presuperscript?Qu(e.presuperscript):void 0}}}function xFo(e){return{style:vy(e.style),nary:{operator:e.operator,lowerLimit:e.lowerLimit?Qu(e.lowerLimit):void 0,upperLimit:e.upperLimit?Qu(e.upperLimit):void 0,body:e.body?Qu(e.body):void 0,limitPlacement:e.limitPlacement,hideSubscript:e.hideSubscript,hideSuperscript:e.hideSuperscript}}}function vFo(e){return{style:vy(e.style),delimited:{beginDelimiter:e.beginDelimiter,separatorDelimiter:e.separatorDelimiter,endDelimiter:e.endDelimiter,grow:e.grow,shape:e.shape,items:e.items.map(t=>Qu(t))}}}function _Fo(e){return{style:vy(e.style),function:{name:Qu(e.name),argument:Qu(e.argument)}}}function TFo(e){return{style:vy(e.style),matrix:{columns:e.columns?.map(t=>({...t}))??Array.from({length:e.columnCount??e.rows[0]?.length??0},()=>({justification:2})),columnCount:e.columnCount,rows:e.rows.map(t=>({cells:t.map(n=>Qu(n))}))}}}function wFo(e){return{style:vy(e.style),accent:{character:e.character,base:Qu(e.base),position:e.position??1}}}function EFo(e){return{style:vy(e.style),bar:{base:Qu(e.base),position:e.position??1}}}function CFo(e){return{style:vy(e.style),enclosure:{body:e.body?Qu(e.body):void 0,hideTop:e.hideTop,hideBottom:e.hideBottom,hideLeft:e.hideLeft,hideRight:e.hideRight,strikeHorizontal:e.strikeHorizontal,strikeVertical:e.strikeVertical,strikeTopLeftToBottomRight:e.strikeTopLeftToBottomRight,strikeBottomLeftToTopRight:e.strikeBottomLeftToTopRight}}}function SFo(e){return{style:vy(e.style),limit:{base:Qu(e.base),limit:Qu(e.limit),kind:e.kind??1}}}function AFo(e){return{style:vy(e.style),phantom:{body:Qu(e.body),show:e.show,zeroWidth:e.zeroWidth,zeroAscent:e.zeroAscent,zeroDescent:e.zeroDescent}}}function kFo(e){return{style:vy(e.style),equationArray:{rows:e.rows.map(t=>Qu(t)),justification:e.justification,baseJustification:e.baseJustification}}}function vy(e){return e?structuredClone(e):void 0}var hPr=/^(-?\d+(?:\.\d+)?)(pt|px)$/i;function LT(e){if(Cme(e)){return true}if(!Array.isArray(e)){return false}if(EPr(e)){return true}return e.every(wPr)}function pPr(e){const t=hPr.exec(e.trim());if(!t){throw new Error(`Unsupported font size "${e}". Use unit strings like "11pt" or "16px".`)}const n=Number(t[1]);const r=t[2]?.toLowerCase();if(Number.isNaN(n)){throw new Error(`Invalid font size "${e}".`)}if(r==="px"){return n}if(r==="pt"){return n*96/72}throw new Error(`Unsupported font size unit in "${e}".`)}function S0(e){if(Array.isArray(e)&&e.length===0){return[]}const t=Array.isArray(e)&&!MT(e)?e:[e];if(t.length===0){return[]}return t.map(n=>MT(n)?mPr(n):gPr(n))}function mPr(e){const t=vFt(e);const n={id:"",inlineNodes:t.inlineNodes,runs:t.runs,textStyle:t.textStyle};return n}function gPr(e){const t=vFt(e.runs??[]);return{id:"",inlineNodes:t.inlineNodes,runs:t.runs,textStyle:t.textStyle,bulletCharacter:e.bulletCharacter,marginLeft:e.marginLeft,indent:e.indent,spaceBefore:e.spaceBefore,spaceAfter:e.spaceAfter,styleId:e.styleId,paragraphStyle:e.paragraphStyle?{...e.paragraphStyle,tabStops:e.paragraphStyle.tabStops??[]}:void 0}}function vFt(e){const t=e.some(Wv);if(!t){return{runs:e.filter(_Pr).map(o=>yFt(o)).map(o=>bFt(o)),inlineNodes:[],textStyle:void 0}}const n=e.filter(o=>Wv(o)&&xFt(o)===2);if(n.length>0){const o=e.length===1&&Wv(e[0])&&xFt(e[0])===2;if(!o){throw new Error('Block math paragraphs must contain exactly one `{ latex, displayMode: "block" }` entry.')}}const r=[];const i=[];for(const o of e){if(Wv(o)){const s=TPr(o);const l=fz(s);r.push({id:"",text:l,citations:[],reviewMarkIds:[]});i.push({math:s});continue}const a=bFt(yFt(o));r.push(a);i.push({textRun:yPr(a)})}return{runs:r,inlineNodes:i,textStyle:n.length>0?{alignment:2}:void 0}}function yFt(e){if(Y8e(e)){return e}return{run:String(e)}}function yPr(e){return{...e,citations:[...e.citations],reviewMarkIds:[...e.reviewMarkIds]}}function bFt(e){const t={id:"",text:e.run??"",hyperlink:e.link?{...e.link,action:e.link.action??""}:void 0,citations:[],reviewMarkIds:[]};const n=bPr(e.textStyle);if(n){t.textStyle=n}return t}function bPr(e){if(!e){return void 0}const t=new ko;if(e.bold!==void 0){t.bold=e.bold}if(e.italic!==void 0){t.italic=e.italic}if(e.underline!==void 0){t.underline=e.underline}if(e.fontSize){t.fontSize=pPr(e.fontSize)}if(e.characterSpacing!==void 0){t.characterSpacing=e.characterSpacing}if(e.typeface!==void 0){t.typeface=e.typeface}const n=e.fill??e.color;if(n!==void 0){t.fill=xPr(n)}if(e.highlight!==void 0){t.highlight=e.highlight}if(e.outline!==void 0){t.outline=e.outline}if(e.shadow!==void 0){t.shadow=e.shadow}const r=t.toProto();const i=Object.values(r).some(o=>{if(o===void 0||o===null){return false}if(Array.isArray(o)){return o.length>0}if(typeof o==="object"){return Object.keys(o).length>0}return true});return i?r:void 0}function xPr(e){if(typeof e==="string"){return e}if(e.type==="solid"){return{...e}}return e}function Y8e(e){if(!e||typeof e!=="object"){return false}return"run"in e}function Wv(e){return q8e(e)||X8e(e)||vPr(e)}function q8e(e){if(!e||typeof e!=="object"||Array.isArray(e)){return false}return"latex"in e}function X8e(e){if(!e||typeof e!=="object"||Array.isArray(e)){return false}return"math"in e}function vPr(e){if(!e||typeof e!=="object"||Array.isArray(e)){return false}return"node"in e}function _Pr(e){return!Wv(e)}function TPr(e){if(q8e(e)){const t=d3t(e);return wme(t)??t}if(X8e(e)){const t=gFt(e.math);if(e.displayMode!==void 0){t.displayMode=Lz(e.displayMode)}return t}return mFt({root:e.node,displayMode:e.displayMode,paragraphProperties:e.paragraphProperties})}function xFt(e){if(q8e(e)){return Lz(e.displayMode)}if(X8e(e)){return Lz(e.displayMode,e.math.displayMode)}return Lz(e.displayMode)}function MT(e){return Array.isArray(e)&&e.every(_Ft)}function Cme(e){if(!e||typeof e!=="object"||Array.isArray(e)){return false}return"runs"in e||"bulletCharacter"in e||"marginLeft"in e||"indent"in e||"spaceBefore"in e||"spaceAfter"in e||"styleId"in e||"paragraphStyle"in e}function wPr(e){return MT(e)||Cme(e)}function EPr(e){return Array.isArray(e)&&e.every(_Ft)&&e.some(t=>Y8e(t)||Wv(t))}function _Ft(e){if(typeof e==="string"||typeof e==="number"){return true}return Y8e(e)||Wv(e)}function TFt(e){const t=(e.runs??[]).map(n=>CPr(n));if(!SPr(e)){return t.length>0?t:[""]}return{runs:t.length>0?t:[""],bulletCharacter:e.bulletCharacter,marginLeft:e.marginLeft,indent:e.indent,spaceBefore:e.spaceBefore,spaceAfter:e.spaceAfter,styleId:e.styleId,paragraphStyle:e.paragraphStyle?{...e.paragraphStyle,tabStops:e.paragraphStyle.tabStops??[]}:void 0}}function CPr(e){const t=e.textStyle;const n={};const r=t?new ko(t):void 0;if(t?.bold!==void 0){n.bold=t.bold}if(t?.italic!==void 0){n.italic=t.italic}if(t?.underline!==void 0){n.underline=t.underline}if(r?.fontSize!==void 0){n.fontSize=`${r.fontSize}px`}if(t?.characterSpacing!==void 0){n.characterSpacing=t.characterSpacing}if(r?.typeface!==void 0){n.typeface=r.typeface}const i=wFt(r?.fill?.toConfig({preserveProto:false}));if(i!==void 0){n.fill=i}const o=Eme(r?.highlight?.toConfig());if(o!==void 0){n.highlight=o}const a=APr(r?.outline?.toConfig({preserveProto:false}));if(a!==void 0){n.outline=a}if(t?.shadow!==void 0){n.shadow="shadow"}const s=Object.keys(n).length>0;const l=e.hyperlink!==void 0;if(!s&&!l){return e.text??""}return{run:e.text??"",textStyle:s?n:void 0,link:l?{uri:e.hyperlink?.uri??"",isExternal:e.hyperlink?.isExternal??false,action:e.hyperlink?.action??""}:void 0}}function SPr(e){return e.bulletCharacter!==void 0||e.marginLeft!==void 0||e.indent!==void 0||e.spaceBefore!==void 0||e.spaceAfter!==void 0||e.styleId!==void 0||e.paragraphStyle!==void 0}function wFt(e){if(e===void 0){return void 0}if(typeof e==="string"){return e}if(e.type==="proto"){return void 0}if(e.type==="none"){return e}if(e.type==="image"){return e}if(e.type==="solid"){const t=Eme(e.color);if(t===void 0){return void 0}return{type:"solid",color:t,pattern:kPr(e.pattern)}}return{type:"gradient",angleDeg:e.angleDeg,gradientKind:e.gradientKind,stops:e.stops.flatMap(t=>{const n=Eme(t.color);return n===void 0?[]:[{offset:t.offset,color:n}]})}}function APr(e){if(e===void 0){return void 0}const t=new eo(e).toConfig({preserveProto:false});if(!t||"type"in t){return void 0}return{style:t.style,width:t.width,fill:wFt(t.fill)}}function Eme(e){if(e===void 0||typeof e==="string"){return e}if(e.type==="proto"){return void 0}return e}function kPr(e){if(e===void 0||e.type==="proto"){return void 0}const t=Eme(e.color);if(t===void 0){return void 0}return{type:e.type,color:t}}var RPr={stub:()=>{},getImageById:()=>void 0,createImageAsset:()=>{throw new Error("createImageAsset is not available in detached text contexts.")},getChartById:()=>void 0,getTextStyleByName:()=>void 0,createChartAsset:()=>{throw new Error("createChartAsset is not available in detached text contexts.")},attachChartAsset:e=>{throw new Error("attachChartAsset is not available in detached text contexts.")}};var Yv=class e{#e;#t;#n;#r;#i;#a;#o;#s;#l;#c;#u;#f;#d;#p;constructor(t,n={}){this.#e=t;this.#t=n.getDefaultTextStyle;this.#n=n.setDefaultTextStyle;this.#r=n.getVerticalAlignment;this.#i=n.setVerticalAlignment;this.#a=n.resolveTextStyle;this.#o=n.listPresetProfile??"presentation";this.#c=n.onLayoutInvalidated;this.#u=n.onMutated;this.#f=n.record?.recordOp;this.#d=n.record?.getTargetRef;this.#p=n.record?.getAnchorId;this.#s=this.#$(this.#e.items);if(!this.#s){const r=this.defaultTextStyle;if(r?.name){this.#s=r.name}}if(n.autoFit!==void 0){this.#w(n.autoFit,(r,i)=>{r.autoFit=i})}}static create(t="",n=RPr){const r=new Hv(n,[]);const i=new e(r,{resolveTextStyle:o=>n.getTextStyleByName(o),listPresetProfile:n.getListPresetProfile?.()??"presentation"});i.set(t);return i}toString(){return this.#e.toPlainText()}get(t){if(!t){return E0.empty(this.#e,this.#H())}const n=this.toString();const r=n.indexOf(t);if(r===-1){return E0.empty(this.#e,this.#H())}const i=r+t.length;const o=this.#G(r,i);return new E0(this.#e,o,this.#H())}getRange(t,n){const r=Math.max(0,Math.floor(t));const i=Math.max(0,Math.floor(n));if(i===0){return E0.empty(this.#e,this.#H())}const o=r+i;const a=this.#G(r,o);if(a.length===0){return E0.empty(this.#e,this.#H())}return new E0(this.#e,a,this.#H())}selectRunRanges(t){if(!Array.isArray(t)||t.length===0){return E0.empty(this.#e,this.#H())}const n=this.#W(t);if(n.length===0){return E0.empty(this.#e,this.#H())}return new E0(this.#e,n,this.#H())}set(t){this.#S(t);if(t instanceof e){this.#P(t);this.#U();return}if(LT(t)){this.#B(t);this.#U();return}if(Array.isArray(t)){if(LT(t)){this.#B(t);this.#U();return}this.#F(t);this.#U();return}this.#M(t);this.#U()}add(t){if(t===void 0||t===null){return}if(Array.isArray(t)){if(LT(t)){this.#D(t);this.#U();return}for(const n of t){this.add(n)}return}if(t instanceof e){this.#z(t);this.#U();return}this.#I(String(t));this.#U()}get paragraphs(){return this.#e}replace(t,n){if(!t){return}this.#C(t,n);const r=this.get(t);if(r.isEmpty){return}r.replace(n);this.#U()}get bold(){const t=this.#A();const n=t.bold;if(n!==void 0){return n}return this.defaultTextStyle?.bold}set bold(t){const n=this.#A();if(!n.isEmpty){n.bold=t}this.#w(t,(r,i)=>{r.bold=i});this.#b({bold:t})}get italic(){const t=this.#A();const n=t.italic;if(n!==void 0){return n}return this.defaultTextStyle?.italic}set italic(t){const n=this.#A();if(!n.isEmpty){n.italic=t}this.#w(t,(r,i)=>{r.italic=i});this.#b({italic:t})}get fontSize(){const t=this.#A();const n=t.fontSize;if(n!==void 0){return n}return this.defaultTextStyle?.fontSize}set fontSize(t){const n=this.#A();if(!n.isEmpty){n.fontSize=t}this.#w(t,(r,i)=>{r.fontSize=i});this.#b({fontSize:t})}get typeface(){const t=this.#A();const n=t.typeface;if(n!==void 0){return n}return this.defaultTextStyle?.typeface}set typeface(t){const n=this.#A();if(!n.isEmpty){n.typeface=t}this.#w(t,(r,i)=>{r.typeface=i});this.#b({typeface:t})}get lineSpacing(){const t=this.#A();const n=t.lineSpacing;if(n!==void 0){return n}return this.defaultTextStyle?.lineSpacing}set lineSpacing(t){const n=this.#A();if(!n.isEmpty){n.lineSpacing=t}this.#w(t,(r,i)=>{r.lineSpacing=i});this.#b({lineSpacing:t})}get underline(){const t=this.#A();const n=t.underline;if(n!==void 0){return n}return this.defaultTextStyle?.underline}set underline(t){const n=this.#A();if(!n.isEmpty){n.underline=t}this.#w(t,(r,i)=>{r.underline=i});this.#b({underline:t})}get color(){const t=this.#A();const n=t.color;if(n!==void 0){return n}const r=this.defaultTextStyle;const i=r?.color;return i?.toProto()?i:void 0}set color(t){const n=this.#A();if(!n.isEmpty){n.color=t}this.#w(t,(r,i)=>{if(i){r.fill={type:"solid",color:i}}});this.#b({color:fE(t)})}get fill(){const t=this.#A();const n=t.fill;if(n!==void 0){return n}const r=this.defaultTextStyle;const i=r?.fill;return i?.toProto()?i:void 0}set fill(t){const n=this.#A();if(!n.isEmpty){n.fill=t}this.#w(t,(r,i)=>{if(i!==void 0){r.fill=i}});this.#b({fill:dN(t)})}get highlight(){const t=this.#A();const n=t.highlight;if(n!==void 0){return n}const r=this.defaultTextStyle?.highlight;return r?.toProto()?r:void 0}set highlight(t){const n=this.#A();if(!n.isEmpty){n.highlight=t}this.#w(t,(r,i)=>{r.highlight=i});this.#b({highlight:fE(t)})}get outline(){const t=this.#A();const n=t.outline;if(n!==void 0){return n}const r=this.defaultTextStyle;const i=r?.outline;return i?.toProto()?i:void 0}set outline(t){const n=this.#A();if(!n.isEmpty){n.outline=t}this.#w(t,(r,i)=>{r.outline=i});this.#b({outline:_z(t)})}get shadow(){const t=this.#A();const n=t.shadow;if(n!==void 0){return n}return this.defaultTextStyle?.shadow}set shadow(t){const n=this.#A();if(!n.isEmpty){n.shadow=t}this.#w(t,(r,i)=>{r.shadow=i});this.#b({shadow:t})}get alignment(){const t=this.#A();const n=t.alignment;if(n!==void 0){return n}const r=this.defaultTextStyle;return r?dE(r.alignment):void 0}set alignment(t){const n=this.#A();if(!n.isEmpty){n.alignment=t}this.#w(t,(r,i)=>{r.alignment=i});this.#b({alignment:t})}get verticalAlignment(){if(this.#r){return this.#r()}const t=this.defaultTextStyle;return t?.anchor?gz[t.anchor]:void 0}set verticalAlignment(t){if(this.#i){this.#i(t)}else{this.#w(t,(n,r)=>{n.anchor=r?IX(r):void 0})}this.#U();this.#b({verticalAlignment:t})}get autoFit(){return this.defaultTextStyle?.autoFit}set autoFit(t){this.#w(t,(n,r)=>{n.autoFit=r});this.#U();this.#b({autoFit:t})}get wrap(){return this.defaultTextStyle?.wrap}set wrap(t){this.#w(t,(n,r)=>{n.wrap=r});this.#U();this.#b({wrap:t})}get insets(){return this.defaultTextStyle?.insets}set insets(t){this.#w(t,(n,r)=>{n.insets=r});this.#U();this.#b({insets:t})}get style(){const t=this.#e.items;const n=this.#$(t);if(n!==void 0){this.#s=n??this.#s;return n}return this.#s??this.defaultTextStyle?.name}set style(t){const n=lN(t);if(n){this.#h(n);return}if(t!==void 0&&typeof t!=="string"){return}this.#m(t)}#m(t,n={}){const r=this.#e.items;const i=t!==void 0&&t.trim().length>0?t:void 0;const o=i?this.#a?.(i):void 0;this.#s=i??void 0;const a=this.defaultTextStyle?new ko(this.defaultTextStyle.toProto()):void 0;const s=o?new ko(o.toProto()):void 0;const l=i!==void 0?this.#Y(s?.toProto(),a?.toProto()):a?.toProto();const u=l?new ko(l):void 0;if(r.length>0){for(const d of r){d.styleId=i;d.textStyle=u?new ko(u.toProto()):void 0;uN(d,i,this.#o);this.#E(d)}}this.defaultTextStyle=u;if(n.record??true){this.#b({style:i});this.#K()}}get className(){return this.#l}set className(t){const n=DX(t);this.#l=n;if(!n){return}this.#g({className:n})}get defaultTextStyle(){return this.#t?.()}set defaultTextStyle(t){this.#n?.(t)}#h(t){const n=this.#y(t);if(n!==void 0){this.#m(n,{record:false})}const r=this.#x(t);if(Object.keys(r).length>0){this.#g(r,{record:false})}this.#v(t);this.#b(this.#_(t,n))}#g(t,n={}){const{className:r,styleConfig:i}=Hpe(t);if(r!==void 0){this.#l=r}const o=LX(i);if(o!==void 0){this.#s=o}if(Object.keys(i).length>0){const s=this.#A({recordOps:false});if(!s.isEmpty){s.style=i}this.#w(i,(l,u)=>{if(!u){return}Uf(l,u)});this.#U()}const a=B6e(t);if("lineSpacing"in i){a.lineSpacing=i.lineSpacing}if(n.record??true){this.#b(a)}}#y(t){if(t.styleName!==void 0){const i=t.styleName.trim();return i.length>0?i:void 0}const n=t.style;if(n===void 0){return void 0}const r=n.trim();return r.length>0?r:void 0}#x(t){const n={};if(t.anchor!==void 0){n.anchor=t.anchor}if(t.vertical!==void 0){n.vertical=t.vertical}if(t.rotation!==void 0){n.rotation=t.rotation}if(t.className!==void 0){n.className=t.className}if(t.bold!==void 0){n.bold=t.bold}if(t.italic!==void 0){n.italic=t.italic}if(t.underline!==void 0){n.underline=t.underline}if(t.fill!==void 0){n.fill=t.fill}if(t.highlight!==void 0){n.highlight=t.highlight}if(t.outline!==void 0){n.outline=t.outline}if(t.shadow!==void 0){n.shadow=t.shadow}if(t.capitalization!==void 0){n.capitalization=t.capitalization}if(t.textTransform!==void 0){n.textTransform=t.textTransform}if(t.fontSize!==void 0){n.fontSize=t.fontSize}if(t.characterSpacing!==void 0){n.characterSpacing=t.characterSpacing}if(t.lineSpacing!==void 0){n.lineSpacing=t.lineSpacing}if(t.color!==void 0){n.color=t.color}if(t.alignment!==void 0){n.alignment=t.alignment}if(t.useParagraphSpacing!==void 0){n.useParagraphSpacing=t.useParagraphSpacing}if(t.autoFitScale!==void 0){n.autoFitScale=t.autoFitScale}if(t.autoFitLineSpaceReduction!==void 0){n.autoFitLineSpaceReduction=t.autoFitLineSpaceReduction}if(t.name!==void 0){n.name=t.name}if(t.family!==void 0){n.family=t.family}if(t.scheme!==void 0){n.scheme=t.scheme}if(t.typeface!==void 0){n.typeface=t.typeface}return n}#v(t){let n=false;if(t.verticalAlignment!==void 0){if(this.#i){this.#i(t.verticalAlignment)}else{this.#w(t.verticalAlignment,(r,i)=>{r.anchor=i?IX(i):void 0})}n=true}if(t.autoFit!==void 0){this.#w(t.autoFit,(r,i)=>{r.autoFit=i});n=true}if(t.wrap!==void 0){this.#w(t.wrap,(r,i)=>{r.wrap=i});n=true}if(t.insets!==void 0){this.#w(t.insets,(r,i)=>{r.insets=i});n=true}if(n){this.#U()}}#_(t,n){const r=B6e(this.#x(t));if(n!==void 0){r.style=n}if(t.verticalAlignment!==void 0){r.verticalAlignment=t.verticalAlignment}if(t.autoFit!==void 0){r.autoFit=t.autoFit}if(t.wrap!==void 0){r.wrap=t.wrap}if(t.insets!==void 0){r.insets=t.insets}return r}#E(t){const n=t.runs.items;for(const r of n){r.textStyle=void 0}}#S(t){if(!this.#f){return}const n=this.#d?.();if(!n){return}this.#f({op:"text.set",target:n,value:this.#T(t)})}#C(t,n){if(!this.#f||!t){return}const r=this.#d?.();if(!r){return}this.#f({op:"text.replace",target:r,find:t,value:this.#T(n)})}#b(t){if(!Object.values(t).some(r=>r!==void 0)){return}this.#K();if(!this.#f){return}const n=this.#d?.();if(!n){return}this.#f({op:"text.style.set",target:n,props:t})}#T(t){if(t instanceof e){return this.#k(t)}if(LT(t)){return t}if(Array.isArray(t)){return t.map(n=>String(n??""))}return String(t??"")}#k(t){const n=t.paragraphs.items;if(n.length===0){return""}const r=n.map(s=>TFt(s.toProto()));const i=r.every(s=>MT(s));const o=r.filter(s=>MT(s));const a=i&&o.every(s=>s.every(l=>typeof l==="string"||typeof l==="number"));if(a){const s=o.map(l=>l.map(u=>String(u)).join(""));return s.length===1?s[0]??"":s}if(r.length===1){return r[0]??""}return r}#P(t){const n=t.paragraphs.items;const r=this.defaultTextStyle?new ko(this.defaultTextStyle.toProto()):void 0;const i=t.defaultTextStyle?new ko(t.defaultTextStyle.toProto()):void 0;this.#e.clear();if(n.length===0){this.#e.setFromPlainText("");this.defaultTextStyle=i??r;this.#s=t.style??this.#s;this.#N();return}for(const a of n){const s=this.#V(a);this.#e.append(s)}this.defaultTextStyle=i??r;const o=this.#$(this.#e.items);this.#s=t.style??o??this.#s;this.#N()}#A(t){const n=this.#e.items.map((i,o)=>{const a=i.toPlainText().length;if(a===0){return void 0}return{paragraphIndex:o,startOffset:0,endOffset:a}}).filter(i=>Boolean(i));const r=this.#H();if(t?.recordOps===false){r.recordOp=void 0}return new E0(this.#e,n,r)}#w(t,n){let r=this.defaultTextStyle;if(!r){if(t===void 0){return}r=new ko;this.defaultTextStyle=r}n(r,t)}#I(t){const n=this.#e.add();n.setPlainText(t);this.#R(n)}#M(t){const n=t.length===0?[]:t.split(/\r?\n/).map(r=>r.replace(/\r$/,""));this.#F(n)}#F(t){const n=(t??[]).map(a=>String(a??""));const r=n.length===0?[""]:n;const i=this.#e.items;const o=i[i.length-1];for(let a=0;a=r.length;a-=1){this.#e.removeAt(a)}this.#N()}#L(t,n){const r=t.runs;const i=r.items;if(i.length===0){t.setPlainText(n);return}const o=i.find(a=>a.text.length>0)??i[0];if(!o){t.setPlainText(n);return}r.replace([r.cloneWithText(o,n)]);t.inlineNodes=[]}#O(t,n){if(!t){return{id:"",inlineNodes:[],runs:[{id:"",text:n,citations:[],reviewMarkIds:[]}]}}const r=this.#V(t);r.inlineNodes=[];const i=r.runs??[];if(i.length===0){r.runs=[{id:"",text:n,citations:[],reviewMarkIds:[]}];return r}const o=i.find(a=>(a.text??"").length>0)??i[0];r.runs=[{...o,id:"",text:n}];return r}#B(t){const n=S0(t);this.#e.clear();if(n.length===0){this.#e.setFromPlainText("")}else{for(const r of n){this.#e.append(r)}}this.#N()}#D(t){const n=S0(t);if(n.length===0){return}for(const r of n){this.#e.append(r)}this.#N()}#z(t){const n=t.paragraphs.items;if(n.length===0){this.#I("");return}for(const r of n){const i=this.#V(r);this.#e.append(i)}}#N(){const t=this.#e.items;for(const n of t){this.#R(n)}}#R(t){const n=this.#s?this.#s.trim():void 0;const r=this.defaultTextStyle;if(n&&(!t.styleId||t.styleId.length===0)){t.styleId=n;uN(t,n,this.#o)}if(r&&!t.textStyle){t.textStyle=new ko(r.toProto())}}#$(t){if(t.length===0){return void 0}let n;let r=false;for(const i of t){const o=i.styleId;if(!r){r=true;n=o;continue}if(!Object.is(n,o)){return void 0}}return n}#Y(t,n){if(!t&&!n){return void 0}const r={...t??{}};if(n){for(const[i,o]of Object.entries(n)){if(o!==void 0){r[i]=o}}}return r}#V(t){const n=t.toProto();n.id="";if(n.runs){n.runs=n.runs.map(r=>({...r,id:""}))}return n}#G(t,n){const r=[];const i=this.#e.items;let o=0;i.forEach((a,s)=>{const l=a.toPlainText();const u=o;const d=u+l.length;const f=Math.max(u,t);const h=Math.min(d,n);if(f=o.length)continue;const a=o[r.runIndex];if(!a)continue;const s=a.text??"";const l=this.#j(i,r.runIndex);const u=l+this.#Z(s,r.start);const d=l+this.#Z(s,r.end);if(d<=u)continue;n.push({paragraphIndex:r.paragraphIndex,startOffset:u,endOffset:d})}return n}#j(t,n){const r=t.runs.items;let i=0;const o=Math.max(0,Math.min(n,r.length));for(let a=0;a{if(!o){return}if(!n.has(o)){n.add(o);r.push(o)}const a=Ame(o);if(a!==void 0&&!n.has(a)){n.add(a);r.push(a)}};i(e);for(const o of t?.additionalSourceTypes??[]){i(o)}for(let o=0;on.has(i));if(r.length===0){return false}if(r.some(IPr)){return true}return e.placeholderIndex===void 0||t.placeholderIndex===void 0||e.placeholderIndex===t.placeholderIndex}function Sme(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g," ").trim().replace(/\s+/g," ")}function Rme(e){const t=Ame(e.rawType??void 0);if(t){return Sme(t)}if(!e.name){return void 0}const n=e.name.trim();if(n.length===0){return void 0}return Sme(n)}var ti=1/9525;function RFt(e){return e.xEmu!==0||e.yEmu!==0||e.widthEmu!==0||e.heightEmu!==0}function K8e(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function Pme(e){if(Array.isArray(e)){return e.map(n=>Pme(n))}if(!K8e(e)){return e}const t={};for(const[n,r]of Object.entries(e)){t[n]=Pme(r)}return t}function Z8e(e,t){if(!t){return e}for(const[n,r]of Object.entries(t)){const i=e[n];if(i===void 0||i===null){e[n]=Pme(r);continue}if(K8e(i)&&K8e(r)){Z8e(i,r)}}return e}var T1=(e,...t)=>{const n=Z8e({},Pme(e)??{});for(const r of t){Z8e(n,r)}return n};function j8e(e){if(!e){return void 0}if(e instanceof ko){return kFt({anchor:e.anchor,vertical:e.vertical,rotation:e.rotation,bold:e.bold,italic:e.italic,fontSize:e.fontSizeCentipoints,characterSpacing:e.characterSpacing,fill:e.fill?.isSet?e.fill:void 0,alignment:e.alignment,underline:e.underline,bottomInset:e.bottomInsetEmu,leftInset:e.leftInsetEmu,rightInset:e.rightInsetEmu,topInset:e.topInsetEmu,useParagraphSpacing:e.useParagraphSpacing,wrap:e.wrapProto,autoFit:e.autoFitProto,name:e.name,family:e.family,scheme:e.scheme,typeface:e.typeface,shadow:e.shadow,capitalization:e.capitalization,highlight:e.highlight?.toProto()})}return kFt(e)}function kFt(e){const t={...e};if(t.anchor===0){delete t.anchor}if(t.vertical===0){delete t.vertical}if(t.alignment===0){delete t.alignment}if(t.capitalization===0){delete t.capitalization}return t}function A0(e,t,n){const r=0;const i=e.placeholderIndex??0;function o(I){return c3(I)}const a=e.placeholderType!==void 0||e.placeholderIndex!==void 0;let s=a?EFt(e.placeholderType):"otherStyle";if(e.placeholderType==="subTitle"&&s==="titleStyle"){s="bodyStyle"}const{layout:l,masterLayout:u}=n.resolveRenderContext();const d=e.placeholderIndex!==void 0&&e.placeholderType===void 0;const f=j8e(e.textStyle)??{};const h={bold:false,italic:false,fontSize:1400,fill:void 0,underline:"none",useParagraphSpacing:false};const m=e.levelsStyles?.[r]?.textStyle;let g;let x;let w;let _;let C;const A=o(e.placeholderType);const P=l?.findPlaceholder(A,i,{allowIndexMatchWithoutType:d});if(P?.textStyle)g=j8e(P.textStyle);if(P?.levelsStyles?.[r]?.textStyle){x=P.levelsStyles[r].textStyle}if(u){const I=o(e.placeholderType);const N=u.findPlaceholder(I,i,{allowIndexMatchWithoutType:d});if(N?.textStyle)w=j8e(N.textStyle);if(N?.levelsStyles?.[r]?.textStyle){_=N.levelsStyles[r].textStyle}if(s==="titleStyle"&&u?.titleLevelStyles?.[r]?.textStyle){C=u.titleLevelStyles[r].textStyle}else if(s==="bodyStyle"&&u?.bodyLevelStyles?.[r]?.textStyle){C=u.bodyLevelStyles[r].textStyle}else if(u?.otherLevelStyles?.[r]?.textStyle){C=u.otherLevelStyles[r].textStyle}}const L=e.fontReference?.color?{fill:{type:1,color:e.fontReference.color,gradientStops:[],pictureEffects:[]}}:void 0;return T1(f,L,m,g,x,w,_,C,h)}function XA(e){if(!e)return void 0;const t=String(e).trim();if(!t)return void 0;if(/[^A-Za-z0-9_-]/.test(t)){const n=t.replace(/'/g,"\\'");return`'${n}'`}return t}function $f(e,t,n){if(e.bbox&&RFt(e.bbox)){const{xEmu:s,yEmu:l,widthEmu:u,heightEmu:d}=e.bbox;return{x:(s??0)*ti,y:(l??0)*ti,width:(u??0)*ti,height:(d??0)*ti}}const r=e.placeholderIndex;const i=new Set(c3(e.placeholderType));const o=s=>{if(!s){return void 0}if(r!==void 0){const l=s.elements.find(u=>u.placeholderIndex===r);if(l){return l}}if(i.size>0){const l=s.elements.find(u=>{const d=u.placeholderTypeCandidates;return d.some(f=>i.has(f))});if(l){return l}}return void 0};const a=s=>{if(!s){return void 0}const{left:l,top:u,width:d,height:f}=s;if(l===void 0||u===void 0||d===void 0||f===void 0||d<=0||f<=0){return void 0}return{x:l,y:u,width:d,height:f}};if(r!==void 0||i.size>0){const{layout:s,masterLayout:l}=n.resolveRenderContext();const u=o(s);const d=a(u?.frame);if(d){return d}const f=o(l);const h=a(f?.frame);if(h){return h}}return{x:0,y:0,width:0,height:0}}var PFt=6e4;function u3(e){if(e===void 0||e===null){return void 0}return e/PFt}function jA(e){if(e===void 0||e===null||Number.isNaN(e)){return void 0}return Math.round(e*PFt)}function Dz(e){const t=u3(e);if(!t)return 0;return t*Math.PI/180}function IFt(e,t,n,r){const{x:i,y:o,width:a,height:s}=$f(t,n,r);const l=!!t.bbox?.horizontalFlip;const u=!!t.bbox?.verticalFlip;const d=Dz(t.bbox?.rotation??0);const f=a/2;const h=s/2;const m=l?-1:1;const g=u?-1:1;e.save();e.translate(i+f,o+h);if(d!==0)e.rotate(d);if(m===-1||g===-1)e.scale(m,g);e.translate(-f,-h)}function _E(e,t){const{left:n,top:r,width:i,height:o}=t;const a=t.horizontalFlip===true;const s=t.verticalFlip===true;const l=(t.rotation??0)*Math.PI/180;const u=i/2;const d=o/2;const f=a?-1:1;const h=s?-1:1;e.save();e.translate(n+u,r+d);if(l!==0)e.rotate(l);if(f===-1||h===-1)e.scale(f,h);e.translate(-u,-d)}var _y=e=>{if(e===void 0||e===null||Number.isNaN(e)){return void 0}return Number(e)};var Ime=e=>{if(e===void 0||e===null||Number.isNaN(e)){return void 0}return Number(e)};var LPr=e=>{if(e===void 0||e===null){return void 0}return Bo(e)};var KA=class e{#e;#t;#n;#r;#i;#a;#o;#s;#l;#c=false;#u;constructor(t,n=false){if(!t){this.#e=void 0;this.#t=void 0;this.#n=void 0;this.#r=void 0;this.#i=void 0;this.#a=void 0;this.#o=void 0;this.#c=n;return}if(t.left!==void 0){this.#e=_y(t.left)}if(t.top!==void 0){this.#t=_y(t.top)}if(t.width!==void 0){this.#n=_y(t.width)}if(t.height!==void 0){this.#r=_y(t.height)}if(t.rotation!==void 0){this.#i=Ime(t.rotation)}if(t.horizontalFlip!==void 0){this.#a=Boolean(t.horizontalFlip)}if(t.verticalFlip!==void 0){this.#o=Boolean(t.verticalFlip)}this.#c=n}static fromProto(t){if(!t){return new e}const n={left:t.xEmu!==void 0?Bo(t.xEmu):void 0,top:t.yEmu!==void 0?Bo(t.yEmu):void 0,width:t.widthEmu!==void 0?Bo(t.widthEmu):void 0,height:t.heightEmu!==void 0?Bo(t.heightEmu):void 0,rotation:u3(t.rotation)??void 0,horizontalFlip:t.horizontalFlip??void 0,verticalFlip:t.verticalFlip??void 0};return new e(n,true)}bindToBboxStruct(t,n){this.#l=t;if(n&&t.size===0){this.#C(t,n)}}clone(){const t=this.#S();const n=new e(t,this.#d());n.#u=this.#u;return n}setChangeHandler(t){this.#u=t}setPreview(t){if(!t){this.#s=void 0;return}const n={};if(t.left!==void 0){const r=_y(t.left);if(r!==void 0){n.left=r}}if(t.top!==void 0){const r=_y(t.top);if(r!==void 0){n.top=r}}if(t.width!==void 0){const r=_y(t.width);if(r!==void 0){n.width=r}}if(t.height!==void 0){const r=_y(t.height);if(r!==void 0){n.height=r}}if(t.rotation!==void 0){const r=Ime(t.rotation);if(r!==void 0){n.rotation=r}}if(t.horizontalFlip!==void 0){n.horizontalFlip=Boolean(t.horizontalFlip)}if(t.verticalFlip!==void 0){n.verticalFlip=Boolean(t.verticalFlip)}if(Object.keys(n).length===0){this.#s=void 0;return}this.#s=n}clearPreview(){this.#s=void 0}getPreviewRect(){if(!this.#s){return void 0}const t=this.#S();return{...t,...this.#s}}#f(t){if(this.#u){this.#u(t)}}#d(){return this.#l?this.#l.size>0:this.#c}#p(t){if(!this.#l){return void 0}const n=this.#l.get(t);return typeof n==="number"?n:void 0}#m(t){if(!this.#l){return void 0}const n=this.#l.get(t);if(n===void 0){return void 0}return Boolean(n)}#h(t){if(!this.#s){return void 0}switch(t){case"xEmu":return this.#s.left;case"yEmu":return this.#s.top;case"widthEmu":return this.#s.width;case"heightEmu":return this.#s.height;default:return void 0}}#g(){return this.#s?.rotation}#y(t){if(!this.#s){return void 0}return this.#s[t]}#x(t){const n=this.#h(t);if(n===void 0){return void 0}return Qi(n)}#v(t,n){if(this.#l){return LPr(this.#p(t))}return n}#_(t){if(this.#l){return u3(this.#p("rotation"))}return t}#E(t,n){if(this.#l){return this.#m(t)}return n}#S(){const t={};const n=this.#v("xEmu",this.#e);if(n!==void 0){t.left=n}const r=this.#v("yEmu",this.#t);if(r!==void 0){t.top=r}const i=this.#v("widthEmu",this.#n);if(i!==void 0){t.width=i}const o=this.#v("heightEmu",this.#r);if(o!==void 0){t.height=o}const a=this.#_(this.#i);if(a!==void 0){t.rotation=a}const s=this.#E("horizontalFlip",this.#a);if(s!==void 0){t.horizontalFlip=s}const l=this.#E("verticalFlip",this.#o);if(l!==void 0){t.verticalFlip=l}return t}#C(t,n){if(n.xEmu!==void 0)t.set("xEmu",n.xEmu);if(n.yEmu!==void 0)t.set("yEmu",n.yEmu);if(n.widthEmu!==void 0)t.set("widthEmu",n.widthEmu);if(n.heightEmu!==void 0)t.set("heightEmu",n.heightEmu);if(n.rotation!==void 0)t.set("rotation",n.rotation);if(n.horizontalFlip!==void 0){t.set("horizontalFlip",n.horizontalFlip)}if(n.verticalFlip!==void 0){t.set("verticalFlip",n.verticalFlip)}}reset(){if(this.#l){this.#l.delete("xEmu");this.#l.delete("yEmu");this.#l.delete("widthEmu");this.#l.delete("heightEmu");this.#l.delete("rotation");this.#l.delete("horizontalFlip");this.#l.delete("verticalFlip")}this.#e=void 0;this.#t=void 0;this.#n=void 0;this.#r=void 0;this.#i=void 0;this.#a=void 0;this.#o=void 0;this.#s=void 0;this.#c=false}set(t){if(t instanceof e){const n=t.#S();const r=t.#d();this.reset();this.merge(n);this.#c=r;return}this.reset();if(t){this.merge(t)}}merge(t){if(t.left!==void 0){const n=_y(t.left);if(this.#l){if(n===void 0){this.#l.delete("xEmu")}else{this.#l.set("xEmu",Qi(n))}}else{this.#e=n}this.#c=true}if(t.top!==void 0){const n=_y(t.top);if(this.#l){if(n===void 0){this.#l.delete("yEmu")}else{this.#l.set("yEmu",Qi(n))}}else{this.#t=n}this.#c=true}if(t.width!==void 0){const n=_y(t.width);if(this.#l){if(n===void 0){this.#l.delete("widthEmu")}else{this.#l.set("widthEmu",Qi(n))}}else{this.#n=n}this.#c=true}if(t.height!==void 0){const n=_y(t.height);if(this.#l){if(n===void 0){this.#l.delete("heightEmu")}else{this.#l.set("heightEmu",Qi(n))}}else{this.#r=n}this.#c=true}if(t.rotation!==void 0){const n=Ime(t.rotation);if(this.#l){if(n===void 0){this.#l.delete("rotation")}else{const r=jA(n);if(r!==void 0){this.#l.set("rotation",r)}else{this.#l.delete("rotation")}}}else{this.#i=n}this.#c=true}if(t.horizontalFlip!==void 0){const n=Boolean(t.horizontalFlip);if(this.#l){this.#l.set("horizontalFlip",n)}else{this.#a=n}this.#c=true}if(t.verticalFlip!==void 0){const n=Boolean(t.verticalFlip);if(this.#l){this.#l.set("verticalFlip",n)}else{this.#o=n}this.#c=true}}toProto(){const t=this.#s!==void 0&&(this.#s.left!==void 0||this.#s.top!==void 0||this.#s.width!==void 0||this.#s.height!==void 0||this.#s.rotation!==void 0||this.#s.horizontalFlip!==void 0||this.#s.verticalFlip!==void 0);if(this.#l){const d={};const f=this.#x("xEmu")??this.#p("xEmu");if(f!==void 0){d.xEmu=f}const h=this.#x("yEmu")??this.#p("yEmu");if(h!==void 0){d.yEmu=h}const m=this.#x("widthEmu")??this.#p("widthEmu");if(m!==void 0){d.widthEmu=m}const g=this.#x("heightEmu")??this.#p("heightEmu");if(g!==void 0){d.heightEmu=g}const x=this.#g();const w=x!==void 0?jA(x):this.#p("rotation");if(w!==void 0&&Number.isFinite(w)){d.rotation=w}const _=this.#y("horizontalFlip")??this.#m("horizontalFlip");if(_!==void 0){d.horizontalFlip=_}const C=this.#y("verticalFlip")??this.#m("verticalFlip");if(C!==void 0){d.verticalFlip=C}if(Object.keys(d).length===0){return void 0}return d}if(!this.#c&&!t){return void 0}const n={};const r=this.#x("xEmu");if(r!==void 0){n.xEmu=r}else if(this.#e!==void 0){n.xEmu=Qi(this.#e)}const i=this.#x("yEmu");if(i!==void 0){n.yEmu=i}else if(this.#t!==void 0){n.yEmu=Qi(this.#t)}const o=this.#x("widthEmu");if(o!==void 0){n.widthEmu=o}else if(this.#n!==void 0){n.widthEmu=Qi(this.#n)}const a=this.#x("heightEmu");if(a!==void 0){n.heightEmu=a}else if(this.#r!==void 0){n.heightEmu=Qi(this.#r)}const s=this.#g();if(s!==void 0||this.#i!==void 0){const d=jA(s??this.#i);if(d!==void 0){n.rotation=d}}const l=this.#y("horizontalFlip");if(l!==void 0||this.#a!==void 0){n.horizontalFlip=l??this.#a}const u=this.#y("verticalFlip");if(u!==void 0||this.#o!==void 0){n.verticalFlip=u??this.#o}if(Object.keys(n).length===0){return void 0}return n}toJSON(){return{left:this.left,top:this.top,width:this.width,height:this.height,rotation:this.rotation,horizontalFlip:this.horizontalFlip,verticalFlip:this.verticalFlip}}toPartialRect(){return this.#S()}get left(){return this.#v("xEmu",this.#e)??0}set left(t){const n=_y(t);if(this.#l){if(n===void 0){this.#l.delete("xEmu")}else{this.#l.set("xEmu",Qi(n))}}else{this.#e=n}this.#c=true;if(n!==void 0){this.#f({left:n})}}get top(){return this.#v("yEmu",this.#t)??0}set top(t){const n=_y(t);if(this.#l){if(n===void 0){this.#l.delete("yEmu")}else{this.#l.set("yEmu",Qi(n))}}else{this.#t=n}this.#c=true;if(n!==void 0){this.#f({top:n})}}get width(){return this.#v("widthEmu",this.#n)??0}set width(t){const n=_y(t);if(this.#l){if(n===void 0){this.#l.delete("widthEmu")}else{this.#l.set("widthEmu",Qi(n))}}else{this.#n=n}this.#c=true;if(n!==void 0){this.#f({width:n})}}get height(){return this.#v("heightEmu",this.#r)??0}set height(t){const n=_y(t);if(this.#l){if(n===void 0){this.#l.delete("heightEmu")}else{this.#l.set("heightEmu",Qi(n))}}else{this.#r=n}this.#c=true;if(n!==void 0){this.#f({height:n})}}get rotation(){return this.#_(this.#i)}set rotation(t){const n=Ime(t);if(this.#l){if(n===void 0){this.#l.delete("rotation")}else{const r=jA(n);if(r!==void 0){this.#l.set("rotation",r)}else{this.#l.delete("rotation")}}}else{this.#i=n}this.#c=true;if(n!==void 0){this.#f({rotation:n})}}get horizontalFlip(){return this.#E("horizontalFlip",this.#a)}set horizontalFlip(t){const n=t===void 0||t===null?void 0:Boolean(t);if(this.#l){if(n===void 0){this.#l.delete("horizontalFlip")}else{this.#l.set("horizontalFlip",n)}}else{this.#a=n}this.#c=true;if(n!==void 0){this.#f({horizontalFlip:n})}}get verticalFlip(){return this.#E("verticalFlip",this.#o)}set verticalFlip(t){const n=t===void 0||t===null?void 0:Boolean(t);if(this.#l){if(n===void 0){this.#l.delete("verticalFlip")}else{this.#l.set("verticalFlip",n)}}else{this.#o=n}this.#c=true;if(n!==void 0){this.#f({verticalFlip:n})}}};var J8e=100;var DPr="H";var FPr="g";var Mme;var Q8e=new Set;var MFt=false;var Dme=new Map;var OFt=[];var Fme=new Map;function BFt(e){return e.trim().replace(/^(['"])(.*)\1$/,"$2").replace(/\\(['"])/g,"$1").normalize("NFKC").replace(/\s+/g," ").trim().toLocaleLowerCase("en-US")}function NPr(e){const t=[];let n="";let r;let i=false;const o=()=>{const a=BFt(n);if(a)t.push(a);n=""};for(let a=0;aa.weight===r.weight&&a.style===r.style&&e7e(a.width)===r.width);if(o>=0)i.splice(o,1);i.push(r);Dme.set(n,i)}}function t7e(){Dme.clear();LFt(OFt);Fme.forEach(LFt)}function r7e(e){OFt=[...e];Fme.clear();t7e()}function c4o(e){const t=Symbol("office-font-design-metrics");Fme.set(t,[...e]);t7e();let n=true;return()=>{if(!n)return;n=false;if(Fme.delete(t)){t7e()}}}function u4o(){r7e([])}function DFt(e){return["","ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"].indexOf(e7e(e))||5}function FFt(e){switch(zFt(e)){case"italic":return 1;case"oblique":return 2;default:return 0}}function BPr(e,t){if(e<=5){return t<=e?10-e+t:10-t}return t>=e?10+e-t:t}function zPr(e,t){return[[3,1,2],[1,3,2],[1,2,3]][e]?.[t]??0}function UPr(e,t){if(e===t)return 1e3;if(e<400){return t<=e?1e3-e+t:1e3-t}if(e<=500){if(t>=e&&t<=500){return 1e3+e-t}return t<=e?500+t:1e3-t}return t>e?1e3+e-t:t}function NFt(e,t){return[BPr(DFt(e.stretch),DFt(t.width)),zPr(FFt(e.style),FFt(t.style)),UPr(OPr(e.weight),t.weight)]}function VPr(e,t){for(let n=0;n0}return false}function $Pr(e){for(const t of NPr(e.family)){const n=Dme.get(t);const r=n?.[0];if(!r)continue;let i=r;let o=NFt(e,i);for(let a=1;ae())}function HPr(){if(MFt)return;const e=globalThis.fonts;if(!e||typeof e.addEventListener!=="function")return;const t=()=>VFt();e.addEventListener("loadingdone",t);e.addEventListener("loadingerror",t);MFt=true}function ij(e){Q8e.add(e);HPr();return()=>{Q8e.delete(e)}}function d4o(){VFt()}function DT(e,t){const n=e.style&&e.style!=="normal"?`${e.style} `:"";const r=e.weight&&e.weight!=="normal"?`${e.weight} `:"";const i=e.stretch&&e.stretch!=="normal"?`${e.stretch} `:"";return`${n}${r}${i}${t}px ${e.family}`.trim()}function WPr(e){const t=e.style?.trim().toLowerCase()||"normal";const n=e.weight?.trim().toLowerCase()||"normal";const r=e.stretch?.trim().toLowerCase()||"normal";return`${t}|${n}|${r}|${e.family}`}function Lme(e,t){if(typeof e==="number"&&Number.isFinite(e)&&e>0){return e}return t}function i7e(e,t,n=J8e){const r=Lme(e.actualBoundingBoxAscent,n*.8);const i=Lme(t.actualBoundingBoxDescent,n*.2);const o=Lme(e.fontBoundingBoxAscent,r);const a=Lme(t.fontBoundingBoxDescent,i);const s=o+a;const l=r+i;const u=Math.max(0,s-l);return{ascentEm:o/n,descentEm:a/n,lineGapEm:u/n,measuredAtPx:n}}var n7e=class{#e=new Map;#t;constructor(){this.#t=ij(()=>this.reset())}getFontKey(t){return WPr(t)}getMetrics(t){const n=this.getFontKey(t);const r=this.#e.get(n);if(r)return r;const i=this.measure(t);this.#e.set(n,i);return i}getMetricsForSize(t,n){const r=this.getMetrics(t);const i=r.ascentEm*n;const o=r.descentEm*n;const a=r.lineGapEm*n;const s=$Pr(t);return{ascentPx:i,descentPx:o,lineGapPx:a,officeAscentPx:s?s.ascent/s.unitsPerEm*n:void 0,officeDescentPx:s?s.descent/s.unitsPerEm*n:void 0,officeMetricsSource:s?.source}}reset(){this.#e.clear()}dispose(){this.reset();this.#t?.();this.#t=void 0}measure(t){const n=ZA();n.font=DT(t,J8e);const r=n.measureText(DPr);const i=n.measureText(FPr);return i7e(r,i,J8e)}};var $Ft=new n7e;var YPr=2e3;var qPr=.01;var XPr=1e3;var GFt=1/6;function jPr(e){const t=e.lines;if(!Array.isArray(t)||t.length===0){return void 0}const n=t.flatMap(o=>{const a=o;return Array.isArray(a.runs)?a.runs:[]});if(n.length===0){return void 0}const r=new Set(n.map(o=>typeof o.family==="string"?o.family.trim().toLocaleLowerCase("en-US"):"").filter(Boolean));if(r.size!==1){return void 0}const i=e.fontBoundingBoxAscent;return Number.isFinite(i)&&i>0?UFt(i):void 0}var KPr=/^[\p{Script=Latn}\p{Script=Cyrl}\p{Script=Grek}\p{Script=Han}\p{Script=Hira}\p{Script=Kana}\p{Script=Hang}\p{Script=Bopo}\p{Script=Zyyy}\p{Script=Zinh}]*$/u;var Nme=class{#e;#t=new Map;#n=new Map;#r=new Map;#i=new Map;#a;constructor(){this.#a=ij(()=>this.reset())}measureTokenWidth(t,n){const r=`${t}__${n}`;const i=this.#t.get(r);if(i!==void 0){return i}const o=this.#o();o.font=t;o.textBaseline="alphabetic";const a=o.measureText(n).width;this.#t.set(r,a);if(this.#t.size>YPr){const s=this.#t.keys().next().value;if(s){this.#t.delete(s)}}return a}buildAdvance(t,n,r,i,o,a,s=0){const l=o??pm(i);const u=new Float32Array(l.length+1);u[0]=0;if(l.length===0){return u}const d=a!==void 0&&Number.isFinite(a)&&a>0&&KPr.test(i)?a:0;let f=0;if(d!==0){for(let m=0;m0){f+=s}u[m+1]=f}return u}let h;for(let m=0;m0){f+=s}u[m+1]=f;h=g}return u}measureInkBounds(t,n,r=0){const i=`${t}__ink__${r}__${n}`;const o=this.#n.get(i);if(o){return o}const a=this.#o();a.font=t;a.textBaseline="alphabetic";const s=a.letterSpacing;if(r!==0){a.letterSpacing=`${r}px`}try{const l=a.measureText(n);const u={leftPx:typeof l.actualBoundingBoxLeft==="number"&&Number.isFinite(l.actualBoundingBoxLeft)?Math.max(0,l.actualBoundingBoxLeft):0,rightPx:typeof l.actualBoundingBoxRight==="number"&&Number.isFinite(l.actualBoundingBoxRight)?Math.max(0,l.actualBoundingBoxRight):Math.max(0,l.width),ascentPx:typeof l.actualBoundingBoxAscent==="number"&&Number.isFinite(l.actualBoundingBoxAscent)?Math.max(0,l.actualBoundingBoxAscent):0,descentPx:typeof l.actualBoundingBoxDescent==="number"&&Number.isFinite(l.actualBoundingBoxDescent)?Math.max(0,l.actualBoundingBoxDescent):0,paintBaselineCompensationPx:jPr(l)};this.#n.set(i,u);return u}finally{if(r!==0){a.letterSpacing=s}}}reset(){this.#t.clear();this.#n.clear();this.#r.clear();this.#i.clear()}dispose(){this.reset();this.#a?.();this.#a=void 0;this.#e=void 0}#o(){if(!this.#e){this.#e=ZA()}return this.#e}getGlyphWidth(t,n,r,i){const o=this.getSizeBucketKey(t,n);const a=this.#r.get(o)??this.#r.set(o,new Map).get(o);const s=a.get(i);if(s!==void 0){return s}const l=this.measureDirect(r,i);a.set(i,l);return l}getKerningAdjustment(t,n,r,i,o){if(!i||!o){return 0}const a=`${this.getSizeBucketKey(t,r)}__${i}${o}`;const s=this.#i.get(a);if(s!==void 0){return s}const l=this.measureDirect(n,i+o);const u=this.getGlyphWidth(t,r,n,i);const d=this.getGlyphWidth(t,r,n,o);const f=l-(u+d);const h=Math.abs(f)0&&Math.abs(m-1)>.01){u=MIr(u,m)}const g=wIr(r,i);const x=t.runs?.[0]??CIr(r);const w=fz(r);const _={text:w,widthPx:u.widthPx,font:u.primaryFont,fontKey:u.primaryFontKey,fill:u.fill,px:u.fontPx,ascentPx:u.ascentPx,descentPx:u.descentPx,run:x,paraIndex:0,runIndex:0,charStart:0,charEnd:w.length,advance:new Float32Array([0,u.widthPx]),inkLeftPx:u.inkLeftPx,inkRightPx:u.inkRightPx,inkAscentPx:u.inkAscentPx,inkDescentPx:u.inkDescentPx,mathLayout:u};const C=u.ascentPx+u.descentPx;return[{segments:[_],widthPx:u.widthPx,heightPx:C,contentHeightPx:C,naturalHeightPx:C,leadingBeforePx:0,leadingAfterPx:0,align:g,offsetPx:0,availableWidthPx:e.boxWidthPx,baselineOffsetPx:u.ascentPx,maxAscentPx:u.ascentPx,maxDescentPx:u.descentPx,maxPx:C,inkLeftPx:u.inkLeftPx,inkRightPx:u.inkRightPx,inkAscentPx:u.inkAscentPx,inkDescentPx:u.inkDescentPx}]}function n4t(e){if(!e?.inlineNodes?.length){return void 0}const t=e.inlineNodes.some(r=>r.textRun!==void 0);const n=e.inlineNodes.some(r=>r.math!==void 0);if(t||!n){return void 0}return e}function TIr(e){const t=e.inlineNodes?.map(n=>n.math).filter(n=>n!==void 0);if(!t?.length){return void 0}if(t.length===1){return t[0]}return{displayMode:t[0]?.displayMode,paragraphProperties:t[0]?.paragraphProperties,root:{sequence:{children:t.map(n=>n.root).filter(n=>n!==void 0)}}}}function wIr(e,t){const n=e.paragraphProperties?.justification;if(n===2||n===4){return"center"}if(n===3){return"right"}if(t.alignment===2){return"center"}if(t.alignment===3){return"right"}return"left"}function EIr(e,t){return e.fontSize?zc(e.fontSize,t):void 0}function Ad(e){if(!e){return false}if(e.style?.fontSize!==void 0){return true}if(e.sequence?.children?.some(t=>Ad(t))){return true}if(Ad(e.fraction?.numerator)||Ad(e.fraction?.denominator)||Ad(e.radical?.degree)||Ad(e.radical?.radicand)||Ad(e.scripts?.base)||Ad(e.scripts?.subscript)||Ad(e.scripts?.superscript)||Ad(e.scripts?.presubscript)||Ad(e.scripts?.presuperscript)||Ad(e.nary?.lowerLimit)||Ad(e.nary?.upperLimit)||Ad(e.nary?.body)||e.delimited?.items?.some(t=>Ad(t))||Ad(e.function?.name)||Ad(e.function?.argument)||e.matrix?.rows?.some(t=>t.cells?.some(n=>Ad(n)))||Ad(e.accent?.base)||Ad(e.bar?.base)||Ad(e.enclosure?.body)||Ad(e.limit?.base)||Ad(e.limit?.limit)||Ad(e.phantom?.body)||e.equationArray?.rows?.some(t=>Ad(t))){return true}return false}function CIr(e){return{id:"",text:fz(e),citations:[],reviewMarkIds:[]}}function kd(e,t,n){const r=SIr(e.style,t,n);if(e.token){return LIr(e,r,n)}if(e.sequence){return IIr(e.sequence.children,r,n)}if(e.fraction){return DIr(e.fraction,r,n)}if(e.radical){return FIr(e.radical,r,n)}if(e.scripts){return NIr(e.scripts,r,n)}if(e.nary){return WIr(e.nary,r,n)}if(e.delimited){return OIr(e.delimited,r,n)}if(e.function){return zIr(e.function,r,n)}if(e.limit){return YIr(e.limit,r,n)}if(e.accent){return qIr(e.accent,r,n)}if(e.bar){return XIr(e.bar,r,n)}if(e.enclosure?.body){return kd(e.enclosure.body,r,n)}if(e.phantom?.body){return kd(e.phantom.body,r,n)}if(e.matrix?.rows?.length){return jIr(e.matrix,r,n)}if(e.equationArray?.rows?.length){return ZIr(e.equationArray.rows,r,n)}return p3("?",r,n)}function SIr(e,t,n){return{fontPx:e?.fontSize!==void 0?zc(e.fontSize,n.textScale):t.fontPx,typeface:XA(e?.typeface)??t.typeface,italic:e?.italic!==void 0?e.italic:t.italic,bold:e?.bold!==void 0?e.bold:t.bold,fill:oo(e?.fill?.color,n.themeMap,t.fill)??t.fill}}function AIr(e,t){const n=e.token;if(!n){return t}if(o4t(n)){return{...t,italic:false}}if(a4t(n.text)){return{...t,italic:false}}const r=n.kind===void 0||n.kind===0||n.kind===5||n.kind===1&&!Vme(n);if(e.style?.italic!==void 0){return t}return{...t,italic:r}}function p3(e,t,n){const r=u7e(t);const i=DT(r,t.fontPx);const o=n.fontMetrics.getFontKey(r);const a=n.fontMetrics.getMetricsForSize(r,t.fontPx);const s=n.measureCache.measureTokenWidth(i,e);const l=n.measureCache.measureInkBounds(i,e);const u=l.ascentPx>0?l.ascentPx:a.ascentPx;const d=l.descentPx>0?l.descentPx:a.descentPx;return{widthPx:s,ascentPx:u,descentPx:d,primaryFont:i,primaryFontKey:o,fontPx:t.fontPx,fill:t.fill,inkLeftPx:l.leftPx,inkRightPx:l.rightPx,inkAscentPx:l.ascentPx,inkDescentPx:l.descentPx,draw:(f,h,m)=>{f.font=i;f.fillStyle=t.fill;f.textAlign="left";f.textBaseline="alphabetic";f.fillText(e,h,m)}}}function u7e(e){return{style:e.italic?"italic":"normal",weight:e.bold?"700":"normal",family:kIr(e.typeface)}}function kIr(e){const t=e.trim();if(!t){return Ume}const n=t.replace(/^['"]|['"]$/g,"").toLowerCase();if(n===sj.toLowerCase()||n===aj.toLowerCase()||n===Fz.toLowerCase()){return Ume}const r=XA(t);return`${TE(r,"presentation")}, ${Ume}`}function RIr(e){const t=XA(e.typeface);if(t){return t}const n=XA(e.name);if(n){return n}return Fz}function d7e(e){const t=EN(e.typeface);return Uu(t.axisHeight,e.fontPx,t)}function ek(e){return e.inkAscentPx>0?e.inkAscentPx:e.ascentPx}function h3(e){return e.inkDescentPx>0?e.inkDescentPx:e.descentPx}function f7e(e,t,n=0){const r=e.reduce((s,l)=>s+l.widthPx,0)+Math.max(0,e.length-1)*n;const i=e.reduce((s,l)=>Math.max(s,l.ascentPx),0);const o=e.reduce((s,l)=>Math.max(s,l.descentPx),0);const a=e[0]??lg(t);return{widthPx:r,ascentPx:i,descentPx:o,primaryFont:a.primaryFont,primaryFontKey:a.primaryFontKey,fontPx:a.fontPx,fill:a.fill,inkLeftPx:e[0]?.inkLeftPx??0,inkRightPx:r,inkAscentPx:i,inkDescentPx:o,draw:(s,l,u)=>{let d=l;for(const f of e){f.draw(s,d,u);d+=f.widthPx+n}}}}function PIr(e,t,n){if(e.length===0){return lg(n)}const r=e.reduce((s,l)=>s+l.widthPx,0)+t.reduce((s,l)=>s+l,0);const i=e.reduce((s,l)=>Math.max(s,l.ascentPx),0);const o=e.reduce((s,l)=>Math.max(s,l.descentPx),0);const a=e[0];if(!a){return lg(n)}return{widthPx:r,ascentPx:i,descentPx:o,primaryFont:a.primaryFont,primaryFontKey:a.primaryFontKey,fontPx:a.fontPx,fill:a.fill,inkLeftPx:a.inkLeftPx,inkRightPx:r,inkAscentPx:i,inkDescentPx:o,draw:(s,l,u)=>{let d=l;for(let f=0;fkd(a,t,n));const i=VIr(e.map(a=>wE(a)));const o=e.slice(0,-1).map((a,s)=>UIr(a,e[s+1]??a,r[s]??lg(t),i[s]??"ord",i[s+1]??"ord",t));return PIr(r,o,t)}function lg(e){const t=u7e(e);const n=DT(t,e.fontPx);const r=`${t.family}|${t.style}|${t.weight}`;return{widthPx:0,ascentPx:e.fontPx*.8,descentPx:e.fontPx*.2,primaryFont:n,primaryFontKey:r,fontPx:e.fontPx,fill:e.fill,inkLeftPx:0,inkRightPx:0,inkAscentPx:0,inkDescentPx:0,draw:()=>{}}}function MIr(e,t){return{widthPx:e.widthPx*t,ascentPx:e.ascentPx*t,descentPx:e.descentPx*t,primaryFont:e.primaryFont,primaryFontKey:e.primaryFontKey,fontPx:e.fontPx*t,fill:e.fill,inkLeftPx:e.inkLeftPx*t,inkRightPx:e.inkRightPx*t,inkAscentPx:e.inkAscentPx*t,inkDescentPx:e.inkDescentPx*t,draw:(n,r,i)=>{n.save();n.translate(r,i);n.scale(t,t);e.draw(n,0,0);n.restore()}}}function tk(e,t){return{...e,fontPx:Math.max(8,e.fontPx*t)}}function LIr(e,t,n){return p3(e.token?.text??"",AIr(e,t),n)}function DIr(e,t,n){const r=tk(t,uIr);const i=e.numerator?kd(e.numerator,r,n):lg(r);const o=e.denominator?kd(e.denominator,r,n):lg(r);const a=EN(t.typeface);const s=e.kind===void 0||e.kind===0||e.kind===1;const l=s?Math.max(t.fontPx*fIr,Uu(a.minConnectorOverlap,t.fontPx,a)*.25):0;const u=Math.max(i.widthPx,o.widthPx)+l*2;let d=0;let f=0;let h;let m=0;if(s){m=Math.max(1,Uu(a.fractionRuleThickness,t.fontPx,a));const C=d7e(t);const A=Uu(n.displayStyle==="block"?a.fractionNumeratorDisplayStyleShiftUp:a.fractionNumeratorShiftUp,t.fontPx,a);const P=Uu(n.displayStyle==="block"?a.fractionDenominatorDisplayStyleShiftDown:a.fractionDenominatorShiftDown,t.fontPx,a);const L=Uu(n.displayStyle==="block"?a.fractionNumeratorDisplayStyleGapMin:a.fractionNumeratorGapMin,t.fontPx,a);const I=Uu(n.displayStyle==="block"?a.fractionDenominatorDisplayStyleGapMin:a.fractionDenominatorGapMin,t.fontPx,a);const N=-C-m/2;const O=-C+m/2;d=-A;f=P;const z=d+h3(i);const U=N-z;if(U{const L=A+(u-i.widthPx)/2;const I=A+(u-o.widthPx)/2;const N=P+d;const O=P+f;i.draw(C,L,N);if(s&&h!==void 0){const z=P+h;C.save();C.strokeStyle=t.fill;C.lineWidth=m;C.beginPath();C.moveTo(A,z);C.lineTo(A+u,z);C.stroke();C.restore()}o.draw(C,I,O)}}}function FIr(e,t,n){const r=EN(t.typeface);const i=e.radicand?kd(e.radicand,t,n):lg(t);const o=!e.hideDegree&&e.degree?kd(e.degree,tk(t,cIr),n):void 0;const a=Math.max(1,Uu(r.radicalRuleThickness,t.fontPx,r));const s=Uu(n.displayStyle==="block"?r.radicalDisplayStyleVerticalGap:r.radicalVerticalGap,t.fontPx,r);const l=Uu(r.radicalExtraAscender,t.fontPx,r);const u=Uu(r.minConnectorOverlap,t.fontPx,r);const d=p3("\u221A",t,n);const f=ek(i)+h3(i)+s+a+l;const h=ek(d)+h3(d);const m=Math.max(1,f/Math.max(h,1));const g=m>1.01?p3("\u221A",tk(t,m),n):d;const x=Math.max(a,u*.35);const w=Math.max(g.inkRightPx,g.widthPx-a*.5);const _=o?o.widthPx*.55:0;const C=Math.max(u*.45,a);const A=_+Math.max(0,w-C);const P=_+w+x;const L=Math.max(_+g.widthPx,o?.widthPx??0,P+i.widthPx);const I=-ek(i)-s-a/2;const N=I-a/2;const O=N-l+ek(g);const z=o?O-g.ascentPx*.42:0;const U=Math.max(-Math.min(O-g.ascentPx,N-l,o?z-o.ascentPx:Number.POSITIVE_INFINITY),i.ascentPx);const W=Math.max(O+g.descentPx,i.descentPx,o?z+o.descentPx:Number.NEGATIVE_INFINITY);return{widthPx:L,ascentPx:U,descentPx:W,primaryFont:g.primaryFont,primaryFontKey:g.primaryFontKey,fontPx:t.fontPx,fill:t.fill,inkLeftPx:0,inkRightPx:L,inkAscentPx:U,inkDescentPx:W,draw:(H,$,K)=>{if(o){o.draw(H,$,K+z)}g.draw(H,$+_,K+O);const X=$+P;i.draw(H,X,K);const j=K+I;H.save();H.strokeStyle=t.fill;H.lineWidth=a;H.lineCap="butt";H.beginPath();H.moveTo($+A,j);H.lineTo(X+i.widthPx,j);H.stroke();H.restore()}}}function NIr(e,t,n){const r=e.base?kd(e.base,t,n):lg(t);const i=tk(t,QFt);const o=e.subscript?kd(e.subscript,i,n):void 0;const a=e.superscript?kd(e.superscript,i,n):void 0;const s=e.presubscript?kd(e.presubscript,i,n):void 0;const l=e.presuperscript?kd(e.presuperscript,i,n):void 0;return h7e(r,o,a,s,l,t)}function h7e(e,t,n,r,i,o){const a=EN(o.typeface);const s=Math.max(Uu(a.spaceAfterScript,o.fontPx,a)*.75,o.fontPx*.04);const l=t||n?Uu(a.spaceAfterScript,o.fontPx,a):0;const u=Math.max(n?.widthPx??0,t?.widthPx??0);const d=Math.max(i?.widthPx??0,r?.widthPx??0);let f=n||i?Uu(a.superscriptShiftUp,o.fontPx,a):0;let h=t||r?Uu(a.subscriptShiftDown,o.fontPx,a):0;const m=n??i;if(m){f=Math.max(f,ek(e)-Uu(a.superscriptBaselineDropMax,o.fontPx,a),Uu(a.superscriptBottomMin,o.fontPx,a)+h3(m))}const g=t??r;if(g){h=Math.max(h,h3(e)+Uu(a.subscriptBaselineDropMin,o.fontPx,a),ek(g)-Uu(a.subscriptTopMax,o.fontPx,a))}if(n&&t){const P=h+f-ek(t)-h3(n);const L=Uu(a.subSuperscriptGapMin,o.fontPx,a);if(P0?s:0)+e.widthPx+(u>0?s:0)+u+l;const C=d+(d>0?s:0);const A=C+e.widthPx+(u>0?s:0);return{widthPx:_,ascentPx:x,descentPx:w,primaryFont:e.primaryFont,primaryFontKey:e.primaryFontKey,fontPx:o.fontPx,fill:o.fill,inkLeftPx:0,inkRightPx:_,inkAscentPx:x,inkDescentPx:w,draw:(P,L,I)=>{const N=L;if(i){i.draw(P,N+d-i.widthPx,I-f)}if(r){r.draw(P,N+d-r.widthPx,I+h)}e.draw(P,L+C,I);if(n){n.draw(P,L+A,I-f)}if(t){t.draw(P,L+A,I+h)}}}}function OIr(e,t,n){const r=EN(t.typeface);const i=e.items.map(J=>kd(J,t,n));const o=e.separatorDelimiter&&e.separatorDelimiter.length>0?p3(e.separatorDelimiter,t,n):void 0;const a=[];i.forEach((J,oe)=>{if(oe>0&&o){a.push(o)}a.push(J)});const s=f7e(a,t,t.fontPx*.04);const l=(!e.beginDelimiter||e.beginDelimiter.length===0)&&(!e.endDelimiter||e.endDelimiter.length===0);const u=l?"(":e.beginDelimiter??"";const d=l?")":e.endDelimiter??"";const f=t.fontPx;const h=s.ascentPx+s.descentPx;const m=Uu(r.delimitedSubFormulaMinHeight,t.fontPx,r);const g=h>m?Math.min(lIr,h/Math.max(f,1)):1;const x=u?JFt(u,t,n,g,h):void 0;const w=d?JFt(d,t,n,g,h):void 0;const _=d3(e.items[0]);const C=f3(e.items[e.items.length-1]);const A=x&&_?Math.max(t.fontPx*ZFt,r4t("open",wE(_),t)):0;const P=w&&C?Math.max(t.fontPx*ZFt,i4t(C,HIr(d,3),i[i.length-1]??s,wE(C),"close",t)):0;const L=x&&w?[A,P]:x?[A]:w?[P]:[];const I=(s.descentPx-s.ascentPx)/2;const N=x?I-(x.descentPx-x.ascentPx)/2:0;const O=w?I-(w.descentPx-w.ascentPx)/2:0;const z=0;const U=z+(x?x.widthPx+(L[0]??0):0);const W=U+s.widthPx+(x&&w?L[1]??0:x?0:L[0]??0);const H=(x?.widthPx??0)+s.widthPx+(w?.widthPx??0)+L.reduce((J,oe)=>J+oe,0);const $=Math.min(-s.ascentPx,x?N-x.ascentPx:Number.POSITIVE_INFINITY,w?O-w.ascentPx:Number.POSITIVE_INFINITY);const K=Math.max(s.descentPx,x?N+x.descentPx:Number.NEGATIVE_INFINITY,w?O+w.descentPx:Number.NEGATIVE_INFINITY);const X=Math.max(0,-$);const j=Math.max(0,K);const te=x??s;return{widthPx:H,ascentPx:X,descentPx:j,primaryFont:te.primaryFont,primaryFontKey:te.primaryFontKey,fontPx:te.fontPx,fill:te.fill,inkLeftPx:0,inkRightPx:H,inkAscentPx:X,inkDescentPx:j,draw:(J,oe,se)=>{if(x){x.draw(J,oe+z,se+N)}s.draw(J,oe+U,se);if(w){w.draw(J,oe+W,se+O)}}}}function JFt(e,t,n,r,i){if((e==="["||e==="]")&&i>t.fontPx*vIr){return BIr(e,t,i)}return p3(e,tk(t,r),n)}function BIr(e,t,n){const r=EN(t.typeface);const i=Math.max(1,Uu(r.radicalRuleThickness,t.fontPx,r));const o=n+i*2;const a=d7e(t);const s=o/2+a;const l=Math.max(0,o-s);const u=Math.max(t.fontPx*_Ir,i*4);const d=u7e(t);const f=DT(d,t.fontPx);const h=`${d.family}|${d.style}|${d.weight}`;return{widthPx:u,ascentPx:s,descentPx:l,primaryFont:f,primaryFontKey:h,fontPx:t.fontPx,fill:t.fill,inkLeftPx:0,inkRightPx:u,inkAscentPx:s,inkDescentPx:l,draw:(m,g,x)=>{const w=i/2;const _=x-s+w;const C=x+l-w;const A=e==="["?g+w:g+u-w;const P=e==="["?g+u:g;m.save();m.strokeStyle=t.fill;m.lineWidth=i;m.lineCap="butt";m.lineJoin="miter";m.beginPath();m.moveTo(A,_);m.lineTo(A,C);m.moveTo(A,_);m.lineTo(P,_);m.moveTo(A,C);m.lineTo(P,C);m.stroke();m.restore()}}}function zIr(e,t,n){const r=e.name?kd(e.name,t,n):lg(t);const i=e.argument?kd(e.argument,t,n):lg(t);return f7e([r,i],t,t.fontPx*yIr)}function UIr(e,t,n,r,i,o){return r4t(r,i,o)+i4t(e,t,n,r,i,o)}function VIr(e){const t=[...e];let n;for(let i=0;i=0;i-=1){if(t[i]==="bin"&&(r===void 0||r==="rel"||r==="close"||r==="punct")){t[i]="ord"}r=t[i]}return t}function r4t(e,t,n){const r=$Ir(e,t);if(r===1){return n.fontPx*hIr}if(r===2){return n.fontPx*pIr}if(r===3){return n.fontPx*mIr}return 0}function $Ir(e,t){if(e==="ord"&&t==="op"||e==="ord"&&t==="inner"||e==="op"&&t==="ord"||e==="op"&&t==="op"||e==="op"&&t==="inner"||e==="close"&&t==="op"||e==="close"&&t==="inner"||e==="punct"&&(t==="ord"||t==="op"||t==="rel"||t==="open"||t==="close"||t==="punct"||t==="inner")||e==="inner"&&(t==="ord"||t==="op"||t==="open"||t==="punct"||t==="inner")){return 1}if(e==="ord"&&t==="bin"||e==="bin"&&(t==="ord"||t==="op"||t==="open"||t==="inner")||e==="close"&&t==="bin"||e==="inner"&&t==="bin"){return 2}if(e==="ord"&&t==="rel"||e==="op"&&t==="rel"||e==="rel"&&(t==="ord"||t==="op"||t==="open"||t==="inner")||e==="close"&&t==="rel"||e==="inner"&&t==="rel"){return 3}return 0}function i4t(e,t,n,r,i,o){if(r!=="ord"||i!=="op"&&i!=="open"&&i!=="inner"||!c7e(e)||n.widthPx<=0){return 0}if(t.token?.text==="|"||e.token?.text==="|"){return 0}return Math.max(o.fontPx*gIr,n.widthPx*.02)}function wE(e){if(e.token){return GIr(e.token)}if(e.function||e.nary){return"op"}if(e.fraction||e.radical||e.delimited||e.matrix||e.equationArray){return"inner"}if(e.scripts?.base){return wE(e.scripts.base)}if(e.limit?.base){return wE(e.limit.base)}if(e.accent?.base){return wE(e.accent.base)}if(e.bar?.base){return wE(e.bar.base)}if(e.enclosure?.body){return wE(e.enclosure.body)}if(e.phantom?.body){return wE(e.phantom.body)}if(e.sequence?.children?.length){const t=e.sequence.children[0];if(t){return wE(t)}}return"ord"}function GIr(e){if(c4t(e)){return"open"}if(u4t(e)){return"close"}if(d4t(e)){return"punct"}if(s4t(e)){return"rel"}if(l4t(e)){return"bin"}if(e.kind===3||Vme(e)){return"op"}return"ord"}function c7e(e){if(e.token&&o4t(e.token)){return false}if(e.token&&a4t(e.token.text)){return true}if(e.style?.italic===false){return false}if(e.style?.italic===true){return true}if(e.token){return!Vme(e.token)&&(e.token.kind===void 0||e.token.kind===0||e.token.kind===1||e.token.kind===5)}if(e.scripts?.base){return c7e(e.scripts.base)}if(e.delimited?.items.length===1){const t=e.delimited.items[0];if(t){return c7e(t)}}return false}function Vme(e){return/^(arccos|arcsin|arctan|argmax|argmin|cos|cosh|cot|csc|det|dim|exp|inf|lim|ln|log|max|min|sec|sin|sinh|sup|tan|tanh)$/i.test(e.text)}function o4t(e){return Vme(e)||s4t(e)||l4t(e)||c4t(e)||u4t(e)||d4t(e)||e.kind===3}function a4t(e){const t=Array.from(e,n=>n.codePointAt(0));return t.length>0&&t.every(n=>n!==void 0&&(n>=119808&&n<=120831||n>=65024&&n<=65039))}function d3(e){if(!e){return void 0}if(e.sequence?.children.length){return d3(e.sequence.children[0])}if(e.scripts?.base){return d3(e.scripts.base)}if(e.limit?.base){return d3(e.limit.base)}if(e.accent?.base){return d3(e.accent.base)}if(e.bar?.base){return d3(e.bar.base)}if(e.enclosure?.body){return d3(e.enclosure.body)}if(e.phantom?.body){return d3(e.phantom.body)}return e}function f3(e){if(!e){return void 0}if(e.sequence?.children.length){return f3(e.sequence.children[e.sequence.children.length-1])}if(e.scripts?.base){return f3(e.scripts.base)}if(e.limit?.base){return f3(e.limit.base)}if(e.accent?.base){return f3(e.accent.base)}if(e.bar?.base){return f3(e.bar.base)}if(e.enclosure?.body){return f3(e.enclosure.body)}if(e.phantom?.body){return f3(e.phantom.body)}return e}function HIr(e,t){return{token:{text:e,kind:t}}}function s4t(e){return/^(=|<|>|≤|≥|≠|≈|≡|∼|→|←|↔|⇒|⇐|⇔|∈|∉|⊂|⊆|⊃|⊇|∝|∥)$/.test(e.text)}function l4t(e){return/^(\+|-|−|±|∓|×|÷|·|\*|∪|∩|∘|⊗|⊕|∧|∨)$/.test(e.text)}function c4t(e){return/^(\(|\[|\{|⌈|⌊|⟨)$/.test(e.text)}function u4t(e){return/^(\)|\]|\}|⌉|⌋|⟩|!)$/.test(e.text)}function d4t(e){return/^(,|;|:)$/.test(e.text)}function WIr(e,t,n){const r=e.operator==="\u222B"?1.35:1.58;const i=p3(e.operator,tk(t,r),n);const o=e.body?kd(e.body,t,n):lg(t);const a=tk(t,dIr);const s=!e.hideSubscript&&e.lowerLimit?kd(e.lowerLimit,a,n):void 0;const l=!e.hideSuperscript&&e.upperLimit?kd(e.upperLimit,a,n):void 0;const u=n.displayStyle==="block"&&e.limitPlacement!==1;if(!u){const w=h7e(i,s,l,void 0,void 0,t);return f7e([w,o],t,t.fontPx*KFt)}const d=t.fontPx*.08;const f=Math.max(i.widthPx,l?.widthPx??0,s?.widthPx??0);const h=t.fontPx*KFt;const m=f+h+o.widthPx;const g=Math.max(o.ascentPx,i.ascentPx+(l?d+l.ascentPx+l.descentPx:0));const x=Math.max(o.descentPx,i.descentPx+(s?d+s.ascentPx+s.descentPx:0));return{widthPx:m,ascentPx:g,descentPx:x,primaryFont:i.primaryFont,primaryFontKey:i.primaryFontKey,fontPx:t.fontPx,fill:t.fill,inkLeftPx:0,inkRightPx:m,inkAscentPx:g,inkDescentPx:x,draw:(w,_,C)=>{const A=_;const P=A+(f-i.widthPx)/2;i.draw(w,P,C);if(l){const L=A+(f-l.widthPx)/2;const I=C-i.ascentPx-d-l.descentPx;l.draw(w,L,I)}if(s){const L=A+(f-s.widthPx)/2;const I=C+i.descentPx+d+s.ascentPx;s.draw(w,L,I)}o.draw(w,_+f+h,C)}}}function YIr(e,t,n){const r=e.base?kd(e.base,t,n):lg(t);const i=e.limit?kd(e.limit,tk(t,QFt),n):void 0;return h7e(r,e.kind===1?i:void 0,e.kind===2?i:void 0,void 0,void 0,t)}function qIr(e,t,n){const r=e.base?kd(e.base,t,n):lg(t);const i=p3(e.character||"\xAF",tk(t,.82),n);const o=t.fontPx*.04;const a=e.position===2?r.ascentPx:r.ascentPx+i.ascentPx+i.descentPx+o;const s=e.position===2?r.descentPx+i.ascentPx+i.descentPx+o:r.descentPx;return{widthPx:Math.max(r.widthPx,i.widthPx),ascentPx:a,descentPx:s,primaryFont:r.primaryFont,primaryFontKey:r.primaryFontKey,fontPx:t.fontPx,fill:t.fill,inkLeftPx:0,inkRightPx:Math.max(r.widthPx,i.widthPx),inkAscentPx:a,inkDescentPx:s,draw:(l,u,d)=>{const f=u+(Math.max(r.widthPx,i.widthPx)-i.widthPx)/2;const h=u+(Math.max(r.widthPx,i.widthPx)-r.widthPx)/2;r.draw(l,h,d);if(e.position===2){i.draw(l,f,d+r.descentPx+o+i.ascentPx)}else{i.draw(l,f,d-r.ascentPx-o-i.descentPx)}}}}function XIr(e,t,n){const r=e.base?kd(e.base,t,n):lg(t);const i=t.fontPx*.05;const o=Math.max(1,t.fontPx*.04);const a=e.position===2?r.ascentPx:r.ascentPx+i+o;const s=e.position===2?r.descentPx+i+o:r.descentPx;return{widthPx:r.widthPx,ascentPx:a,descentPx:s,primaryFont:r.primaryFont,primaryFontKey:r.primaryFontKey,fontPx:t.fontPx,fill:t.fill,inkLeftPx:0,inkRightPx:r.widthPx,inkAscentPx:a,inkDescentPx:s,draw:(l,u,d)=>{r.draw(l,u,d);const f=e.position===2?d+r.descentPx+i:d-r.ascentPx-i;l.save();l.strokeStyle=t.fill;l.lineWidth=o;l.beginPath();l.moveTo(u,f);l.lineTo(u+r.widthPx,f);l.stroke();l.restore()}}}function jIr(e,t,n){const r=e.rows;const i=Math.max(e.columnCount??0,e.columns.length,r.reduce((w,_)=>Math.max(w,_.cells?.length??0),0));const o=r.map(w=>Array.from({length:i},(_,C)=>{const A=w.cells?.[C];return A?kd(A,t,n):lg(t)}));const a=Array.from({length:i},(w,_)=>o.reduce((C,A)=>Math.max(C,A[_]?.widthPx??0),0));const s=o.map(w=>({ascentPx:w.reduce((_,C)=>Math.max(_,C.ascentPx),0),descentPx:w.reduce((_,C)=>Math.max(_,C.descentPx),0)}));const l=t.fontPx*bIr;const u=t.fontPx*xIr;const d=a.reduce((w,_)=>w+_,0)+Math.max(0,i-1)*l;const f=s.reduce((w,_)=>w+_.ascentPx+_.descentPx,0)+Math.max(0,r.length-1)*u;const h=d7e(t);const m=f/2+h;const g=Math.max(0,f-m);const x=o[0]?.[0]??lg(t);return{widthPx:d,ascentPx:m,descentPx:g,primaryFont:x.primaryFont,primaryFontKey:x.primaryFontKey,fontPx:t.fontPx,fill:t.fill,inkLeftPx:0,inkRightPx:d,inkAscentPx:m,inkDescentPx:g,draw:(w,_,C)=>{let A=C-m;for(let P=0;Pkd(r,t,n)),t,t.fontPx*.18)}function JIr(e,t,n){const r=e.reduce((s,l)=>Math.max(s,l.widthPx),0);const i=e.reduce((s,l)=>s+l.ascentPx+l.descentPx,0)+Math.max(0,e.length-1)*n;const o=i;const a=e[0]??lg(t);return{widthPx:r,ascentPx:o,descentPx:0,primaryFont:a.primaryFont,primaryFontKey:a.primaryFontKey,fontPx:t.fontPx,fill:t.fill,inkLeftPx:0,inkRightPx:r,inkAscentPx:o,inkDescentPx:0,draw:(s,l,u)=>{let d=u-o;for(const f of e){const h=d+f.ascentPx;f.draw(s,l+(r-f.widthPx)/2,h);d+=f.ascentPx+f.descentPx+n}}}}var EE=class{#e;#t;#n;#r;#i;#a;constructor(t){this.#e=structuredClone(Array.from(t??[]));for(const n of this.#e){switch(n.type){case 1:this.#t=n.shadow;break;case 2:this.#n=n.shadow;break;case 3:this.#r=n.glow;break;case 4:this.#i=n.reflection;break;case 5:this.#a=n.softEdges;break}}}get outerShadow(){return this.#t}get innerShadow(){return this.#n}get glow(){return this.#r}get reflection(){return this.#i}get softEdges(){return this.#a}get isSet(){return this.#e.length>0}toProto(){return structuredClone(this.#e)}};var QIr="docx:contextualSpacing";var f4t="__docxContextualSpacing:";var e3r=`${f4t}true`;function Gme(e,t){if(!e&&!t){return void 0}const n={...t??{}};for(const[r,i]of Object.entries(e??{})){if(i!==void 0){n[r]=i}}return n}function $me(e){return e===void 0?void 0:structuredClone(e)}function t3r(e,t){if(!e&&!t){return void 0}const n={top:$me(e?.top??t?.top),right:$me(e?.right??t?.right),bottom:$me(e?.bottom??t?.bottom),left:$me(e?.left??t?.left)};return n.top||n.right||n.bottom||n.left?n:void 0}function Vb(e,t){const n=Gme(e,t);if(!n){return void 0}const r=e?.tabStops??[];const i=t?.tabStops??[];if(r.length>0){n.tabStops=r.map(a=>structuredClone(a))}else if(i.length>0){n.tabStops=i.map(a=>structuredClone(a))}else{n.tabStops=[]}const o=t3r(e?.borders,t?.borders);if(o){n.borders=o}if(e?.fill){n.fill=structuredClone(e.fill)}else if(t?.fill){n.fill=structuredClone(t.fill)}return n}function n3r(e){const t=e.indexOf(":");return t>=0?e.slice(0,t+1):e}function m7e(e){const t=e?.trim().toLowerCase();return t?t:void 0}function g7e(...e){const t=[];const n=new Map;for(const r of e){if(!r){continue}for(const i of r.split(";")){const o=i.trim();if(!o){continue}const a=n3r(o).toLowerCase();if(!n.has(a)){t.push(a)}n.set(a,o)}}if(t.length===0){return void 0}return t.map(r=>n.get(r)).join(";")}function r3r(e,t){if(!e){return void 0}const n=t.toLowerCase();for(const r of e.split(";")){const i=r.trim();if(!i||!i.toLowerCase().startsWith(n)){continue}const o=i.slice(t.length).trim();if(o){return o}}return void 0}function Hme(e){const t=r3r(e?.scheme,f4t);const n=m7e(t);return n==="1"||n==="true"||n==="yes"||n==="on"}function h4t(e){const t=g7e(e?.scheme,e3r);if(!t){return e}if(e?.scheme===t){return e}return{...e??{},scheme:t}}function i3r(e){return(e??[]).some(t=>m7e(t)===m7e(QIr))}function k0(e,t){const n=Gme(e,t);if(!n){return void 0}const r=g7e(t?.scheme,e?.scheme);if(r){n.scheme=r}return n}function o3r(e){for(const t of e){if(t.id?.toLowerCase()==="normal"){return t.id}}for(const t of e){if(t.name?.toLowerCase()==="normal"&&t.id){return t.id}}for(const t of e){if(t.id){return t.id}}return void 0}function p7e(e){const t=e?.trim().toLowerCase();return t?t:void 0}var Nz=class{#e;#t=new Map;#n=new Map;#r=new Map;#i=new Set;constructor(t=[]){this.#e=o3r(t);for(const n of t){if(n.id){this.#t.set(n.id,n);const i=p7e(n.id);if(i){this.#n.set(i,n.id)}}const r=p7e(n.name);if(r&&n.id){this.#n.set(r,n.id)}}}resolve(t){return this.resolveExplicit(t??this.#e)}resolveStyleIdByName(t){const n=p7e(t);if(!n){return void 0}return this.#n.get(n)}resolveByName(t){const n=this.resolveStyleIdByName(t);if(!n){return void 0}return this.resolveExplicit(n)}resolveExplicit(t){if(!t){return void 0}if(this.#r.has(t)){return this.#r.get(t)??void 0}if(this.#i.has(t)){return void 0}const n=this.#t.get(t);if(!n){this.#r.set(t,null);return void 0}this.#i.add(t);const r=this.resolveExplicit(n.basedOn);this.#i.delete(t);const i={textStyle:k0(n.textStyle,r?.textStyle),paragraphStyle:Vb(n.paragraphStyle,r?.paragraphStyle),spaceBefore:n.spaceBefore??r?.spaceBefore,spaceAfter:n.spaceAfter??r?.spaceAfter,contextualSpacing:i3r(n.tags)||r?.contextualSpacing===true};this.#r.set(t,i);return i}};var a3r={accent1:"accent1",accent2:"accent2",accent3:"accent3",accent4:"accent4",accent5:"accent5",accent6:"accent6",bg1:"lt1",tx1:"dk1",bg2:"lt2",tx2:"dk2",hlink:"hlink",folHlink:"folHlink"};function s3r(e){return{...e,background1:e["background1"]??e["bg1"]??e["lt1"]??"",background2:e["background2"]??e["bg2"]??e["lt2"]??"",text1:e["text1"]??e["tx1"]??e["dk1"]??"",text2:e["text2"]??e["tx2"]??e["lt1"]??"",dark1:e["dark1"]??e["dk1"]??"",dark2:e["dark2"]??e["dk2"]??"",light1:e["light1"]??e["lt1"]??"",light2:e["light2"]??e["lt2"]??"",hyperlink:e["hyperlink"]??e["hlink"]??"",followedhyperlink:e["followedhyperlink"]??e["folHlink"]??""}}function SN(e,t){if(!e){return{colorMap:{},fillStyleMap:{},lineStyleMap:{},effectMap:{}}}const n={};const r=e.fillStyleList??[];for(const[d,f]of r.entries()){n[d+1]=f}const i={};const o=e.lineStyleList??[];for(const[d,f]of o.entries()){i[d+1]=f}const a={};const s=e.effectStyleList??[];for(const[d,f]of s.entries()){a[d+1]=new EE(f.effects)}const l=e.hexColorMap;const u={...l};for(const[d,f]of Object.entries({...a3r,...t})){const h=l[f];if(h){u[d]=h}}return{colorMap:s3r(u),fillStyleMap:n,lineStyleMap:i,effectMap:a,fontScheme:e.fontScheme}}function p4t(e){return typeof e==="number"&&!Number.isNaN(e)}function y7e(e,t){if(!e||!e.levelsStyles?.length)return void 0;const n=e.levelsStyles;const r=t?.paragraphStyle?.marginLeft;if(p4t(r)){let i;let o=Number.POSITIVE_INFINITY;for(const a of n){const s=a.paragraphStyle?.marginLeft;if(!p4t(s))continue;const l=Math.abs(s-r);if(li.level===1)??n[0]}function $4o(e,t){const n=Vb(t,e?.paragraphStyle);return n??{tabStops:[]}}function m4t(e,t){const n=y7e(e,t);const r=t?.spaceBefore;const i=t?.spaceAfter;return{spaceBefore:r!==void 0?r:n?.spaceBefore,spaceAfter:i!==void 0?i:n?.spaceAfter}}function lj(e,t){if(e===void 0){return 0}if(t==="twips"){return QA(e)}return CN(e)}function b7e(e,t){return t*(e/1e5)}function l3r({element:e,paragraph:t,defaults:n}){const r=m4t(e,t);return{spaceBefore:r.spaceBefore!==void 0?r.spaceBefore:n?.spaceBefore,spaceAfter:r.spaceAfter!==void 0?r.spaceAfter:n?.spaceAfter}}function g4t({element:e,paragraph:t,unit:n,defaults:r}){const i=l3r({element:e,paragraph:t,defaults:r});return{spaceBeforePx:lj(i.spaceBefore,n),spaceAfterPx:lj(i.spaceAfter,n)}}function x7e(e,t){const n=Math.max(0,e);const r=Math.max(0,t);return Math.min(n,r)}function y4t(e,t){const n=x7e(e,t);return Math.max(0,t-n)}function b4t({element:e,unit:t,defaults:n}){const r=e.paragraphs??[];if(r.length===0){return{firstParagraphSpaceBeforePx:0,lastParagraphSpaceAfterPx:0}}const i=r[0];const o=r[r.length-1];const a=g4t({element:e,paragraph:i,unit:t,defaults:n});const s=g4t({element:e,paragraph:o,unit:t,defaults:n});return{firstParagraphSpaceBeforePx:a.spaceBeforePx,lastParagraphSpaceAfterPx:s.spaceAfterPx}}var c3r=9;function Wme(e,t){const n=Vb(e,t);if(!n){return void 0}if(e?.bulletCharacter!==void 0){n.autoNumberType=void 0;n.autoNumberStartAt=void 0}else if(e?.autoNumberType!==void 0){n.bulletCharacter=void 0;n.autoNumberStartAt=e.autoNumberStartAt}if(e?.bulletTypeface!==void 0){n.bulletTypefaceFollowsText=void 0}else if(e?.bulletTypefaceFollowsText!==void 0){n.bulletTypeface=void 0}if(e?.spaceBeforePercent!==void 0){n.spaceBeforePoints=void 0}else if(e?.spaceBeforePoints!==void 0){n.spaceBeforePercent=void 0}if(e?.spaceAfterPercent!==void 0){n.spaceAfterPoints=void 0}else if(e?.spaceAfterPoints!==void 0){n.spaceAfterPercent=void 0}return n}function Yme(e,t){const{layout:n,masterLayout:r}=t.resolveRenderContext();const i=e.placeholderIndex??0;const o=e.placeholderIndex!==void 0&&e.placeholderType===void 0;const a=c3(e.placeholderType);const s=n?.findPlaceholder(a,i,{allowIndexMatchWithoutType:o});const l=r?.findPlaceholder(a,i,{allowIndexMatchWithoutType:o});const u=u3r(e,r);const d=[];for(let f=0;fn.level===t+1)}function v4t(e,t){const n=Xme(t);return Oz(e.levelsStyles,n)??Oz(e.levelsStyles,0)}function u3r(e,t){if(!t){return[]}const n=d3r(e.placeholderType,e.placeholderIndex!==void 0);if(n==="titleStyle"){return t.titleLevelStyles}if(n==="bodyStyle"){return t.bodyLevelStyles}return t.otherLevelStyles}function d3r(e,t){if(e===void 0&&!t){return"otherStyle"}switch(e){case"title":case"ctrTitle":return"titleStyle";case"body":case"obj":case"content":case"subTitle":case"":case void 0:return"bodyStyle";default:return"otherStyle"}}function f3r(...e){let t;let n;for(let i=e.length-1;i>=0;i-=1){t=Gme(e[i]?.textStyle,t);n=Wme(e[i]?.paragraphStyle,n)}const r={textStyle:t,paragraphStyle:n,spaceBefore:x4t(e.map(i=>i?.spaceBefore)),spaceAfter:x4t(e.map(i=>i?.spaceAfter))};return Object.values(r).some(i=>i!==void 0)?r:void 0}function x4t(e){for(const t of e){if(t!==void 0){return t}}return void 0}function Bz(e,t){const n=AN(e);if(n===void 0){return void 0}return v7e(n,t)??n}function v7e(e,t){if(t===void 0){return void 0}if(e==="+mj-lt"){return AN(t.majorFont?.latinTypeface)}if(e==="+mj-ea"){return AN(t.majorFont?.eastAsianTypeface)}if(e==="+mj-cs"){return AN(t.majorFont?.complexScriptTypeface)}if(e==="+mn-lt"){return AN(t.minorFont?.latinTypeface)}if(e==="+mn-ea"){return AN(t.minorFont?.eastAsianTypeface)}if(e==="+mn-cs"){return AN(t.minorFont?.complexScriptTypeface)}return void 0}function AN(e){return e===void 0||e.length===0?void 0:e}var h3r=14;var p3r=h3r*100;var m3r=1;var g3r=1.2;var y3r=.8;var b3r=1e9;var x3r=.8;var v3r=.2;var I4t=/\s/;var _3r=1024;var T3r=96/1440;var w3r="__docxHighlight:";var E3r="__docxAlign:";var C3r="__docxCaps:";var S3r="__docxParagraphRightIndent:";var A3r="__docxComplexScriptFontSize:";var k3r="__docxComplexScriptTypeface:";var R3r="__docxEastAsiaTypeface:";var _4t="__docxBreak:rendered__";var P3r="#0563c1";var I3r="single";var jme=new Map;var M3r={yellow:"#fff200",darkyellow:"#c9a000",green:"#00b050",darkgreen:"#006100",cyan:"#00b0f0",magenta:"#c000c0",blue:"#4472c4",darkblue:"#1f3864",red:"#ff0000",darkred:"#9c0006",gray:"#808080",darkgray:"#404040",lightgray:"#d9d9d9",black:"#111111"};function Qme(e){return e?e*ti:0}function Kme(e){return e?e*T3r:0}function T4t(e,...t){const n=e==="before"?"spaceBeforePercent":"spaceAfterPercent";const r=e==="before"?"spaceBeforePoints":"spaceAfterPoints";for(const i of t){const o=i.paragraphStyle?.[n];if(o!==void 0){return{kind:"percent",value:o}}const a=i.paragraphStyle?.[r];if(a!==void 0){return{kind:"typed-points",value:a}}if(i.legacyValue!==void 0){return{kind:"legacy",value:i.legacyValue}}}return void 0}function L3r(e){switch(e){case 2:return"center";case 3:return"right";case 4:return"decimal";case 5:return"bar";case 6:return"clear";case 1:case 0:default:return"left"}}function D3r(e){const t=(e?.tabStops??[]).map(n=>{if(n.position===void 0){return void 0}return{positionPx:Qme(n.position),alignment:L3r(n.alignment)}}).filter(n=>n!==void 0);return t.sort((n,r)=>n.positionPx-r.positionPx)}function F3r(e,t){const n=e?.trim().toLowerCase();const r=t?.trim().toLowerCase();return!!n&&n===r}function w4t(e,t){return F3r(e?.styleId,t?.styleId)&&Hme(t?.textStyle)}function N3r(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"")}function kN(e,t){if(!e){return void 0}const n=e.split(";").map(i=>i.trim()).filter(i=>i.length>0);const r=t.toLowerCase();for(const i of n){if(!i.toLowerCase().startsWith(r)){continue}const o=i.slice(t.length).trim();if(o.length>0){return o}}return void 0}function O3r(e){const t=e.indexOf(":");return t>=0?e.slice(0,t+1):e}function _7e(...e){const t=[];const n=new Map;for(const r of e){if(!r){continue}for(const i of r.split(";")){const o=i.trim();if(!o){continue}const a=O3r(o).toLowerCase();if(!n.has(a)){t.push(a)}n.set(a,o)}}if(t.length===0){return void 0}return t.map(r=>n.get(r)).join(";")}function B3r(e){const t=kN(e,w3r);if(!t){return void 0}if(t.startsWith("#")){return t}return M3r[N3r(t)]}function z3r(e){const t=kN(e,E3r);if(!t){return void 0}const n=t.toLowerCase();if(n==="justify"||n==="justified"){return"justify"}if(n==="center"){return"center"}if(n==="right"){return"right"}return"left"}function U3r(e){const t=kN(e,C3r);if(!t){return false}const n=t.toLowerCase();return n==="1"||n==="true"||n==="yes"||n==="on"}function V3r(e,t){return U3r(t)?e.toUpperCase():e}function $3r(e,t){if(t===3||t===2){return e.toUpperCase()}return e}function G3r(e,t){return $3r(V3r(e,t?.scheme),t?.capitalization)}function H3r(e){const t=kN(e,A3r);if(!t){return void 0}const n=Number.parseInt(t,10);return Number.isFinite(n)&&n>0?n*50:void 0}function W3r(e,t){const n=kN(e,t);if(!n){return void 0}const r=Number.parseInt(n,10);return Number.isFinite(r)?r:void 0}function Y3r(e){return kN(e,k3r)??kN(e,R3r)}function E4t(e){return e?.fontSize??H3r(e?.scheme)}function C4t(e){return e?.typeface??e?.name??Y3r(e?.scheme)}function q3r(e,t){if(t&&(!e?.underline||e.underline==="none")){return I3r}return e?.underline}function Zme(e,t){let n=Math.max(1,Math.floor(e));let r="";while(n>0){n--;r=String.fromCharCode(97+n%26)+r;n=Math.floor(n/26)}return t?r.toUpperCase():r}function S4t(e,t){let n=Math.max(1,Math.min(3999,Math.floor(e)));const r=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]];let i="";for(const[a,s]of r){while(n>=a){i+=s;n-=a}}const o=t?i:i.toLowerCase();return o}function X3r(e,t){switch(t){case"arabicBracketBoth":return`[${e}]`;case"arabicPeriod":return`${e}.`;case"arabicPlain":return`${e}`;case"alphaLcPeriod":return`${Zme(e,false)}.`;case"alphaUcPeriod":return`${Zme(e,true)}.`;case"alphaLcParenR":return`${Zme(e,false)})`;case"alphaUcParenR":return`${Zme(e,true)})`;case"romanLcPeriod":return`${S4t(e,false)}.`;case"romanUcPeriod":return`${S4t(e,true)}.`;default:return`${e}.`}}function j3r(e){function t(o){const a=pm(o);const s=[];let l=[];let u=null;const d=()=>{if(!l.length||!u){return}s.push({type:u,text:l.join(""),graphemes:l.slice()});l=[];u=null};for(let f=0;f=0?o:e.length;if(a>i){r.push(...t(e.slice(i,a)))}if(o<0){break}i=o+_4t.length}if(jme.size>=_3r){jme.clear()}jme.set(e,r);return r}function A4t(e,t,n){const r=n-t;const i=new Float32Array(r+1);const o=nk(e,t);for(let a=0;a<=r;a++){i[a]=nk(e,t+a)-o}return i}function K3r(e,t,n){let r=t+1;let i=e.length-1;let o=t;const a=nk(e,t);while(r<=i){const s=Math.floor((r+i)/2);const l=nk(e,s)-a;if(l<=n){o=s;r=s+1}else{i=s-1}}return o}function nk(e,t){if(e.length===0){return 0}if(t<=0){return e[0]??0}if(t>=e.length){return e[e.length-1]??0}return e[t]??0}function Z3r({contentHeightPx:e,lineFontPx:t,lineMultiple:n,naturalHeightPx:r}){if(n<1){return e*y3r}if(n>1){return t+(e-r)}return t}function J3r({contentHeightPx:e,ascentPx:t,descentPx:n}){if(!Number.isFinite(e)||!Number.isFinite(t)||!Number.isFinite(n)||e<=0||t<=0||n<=0){return void 0}return e*t/(t+n)}function Q3r({baseAscentPx:e,baseDescentPx:t,officeAscentPx:n,officeDescentPx:r,lineFontPx:i,lineMultiple:o,lineSpacingPx:a,minimumContentHeightPx:s,model:l,usePresentationBaselineMetrics:u}){const d=l==="presentation"?i*g3r:e+t;const f=a!==void 0?a:l==="presentation"?d*o:o<1?d*o:Math.max(d,i*o);const h=s!==void 0?Math.max(f,s):f;const m=l==="presentation"?a!==void 0?e+(h-d)/2:Z3r({contentHeightPx:h,lineFontPx:i,lineMultiple:o,naturalHeightPx:d}):e+(h-d)/2;const g=u&&a===void 0&&n!==void 0&&r!==void 0?J3r({contentHeightPx:h,ascentPx:n,descentPx:r}):void 0;const x=g??m;const w=x-e;const _=h-x-t;return{naturalHeightPx:d,contentHeightPx:h,baselineOffsetPx:x,leadingBeforePx:w,leadingAfterPx:_}}function eMr(e,t){if(e===void 0||e===0){return void 0}return zc(e,t)}function k4t(e,t){if(!e||t!==void 0){return void 0}return GFt}function Jme(e,t){if(e===void 0||e.text.length===0||t.text.length===0||e.run!==t.run||e.paraIndex!==t.paraIndex||e.runIndex!==t.runIndex||e.charEnd!==t.charStart||e.characterSpacingPx!==t.characterSpacingPx||t.characterSpacingPx===void 0){return 0}return t.characterSpacingPx}function R4t(e,t){return{...e,text:"",widthPx:t,charEnd:e.charStart,advance:new Float32Array(1),inkLeftPx:0,inkRightPx:0,inkAscentPx:0,inkDescentPx:0,highlight:void 0,underline:void 0}}function tMr({tabStops:e,defaultTabStopPx:t,offsetPx:n,currentWidthPx:r}){const i=e.find(o=>o.positionPx-n>r+.01);if(i){return{positionPx:i.positionPx-n,alignment:i.alignment}}if(t>0){return{positionPx:Math.ceil((n+r+.01)/t)*t-n,alignment:"left"}}return{positionPx:r,alignment:"left"}}function P4t({tabTarget:e,currentWidthPx:t,fieldWidthPx:n}){switch(e.alignment){case"center":return Math.max(t,e.positionPx-n/2);case"right":case"decimal":return Math.max(t,e.positionPx-n);case"bar":case"clear":case"left":default:return Math.max(t,e.positionPx)}}function nMr(e){if(e.layoutProfile){return e.layoutProfile}return e.paragraphSpacingUnit==="twips"?"document":"presentation"}function rMr(e,t){return e.paragraphSpacingUnit??(t==="document"?"twips":"points")}var ege=class{constructor(t,n){this.fontMetrics=t;this.measureCache=n}layout(t){const{element:n}=t;if(!n.paragraphs||n.paragraphs.length===0){return{lines:[],contentHeightPx:0}}const r=[];const i=t.textScale??1;const o=t.wrap?t.boxWidthPx:b3r;const a=zc(p3r,i);const s=nMr(t);const l={};let u=0;for(let f=0;f{iMr(f)})}const d=r.reduce((f,h)=>f+h.heightPx,0);return{lines:r,contentHeightPx:d}}layoutParagraph({element:t,paragraph:n,paraIndex:r,request:i,layoutProfile:o,defaultFontPx:a,effectiveBoxW:s,listCounters:l,lines:u,paragraphCount:d,previousParagraphSpaceAfterPx:f}){let h;if(i.masterDefaults?.paragraphLevels){h=qme(i.masterDefaults.paragraphLevels,n)}const m=n.level!==void 0||n.paragraphStyle?.outlineLevel!==void 0?v4t(t,n):y7e(t,n);const g=Xme(n);let x=m?.textStyle;let w;let _;if(o==="presentation"){if(!n.styleId){w=t.textStyle}if(g>0){if(m?.level!==g+1){x=void 0}}if(g>0||n.styleId){_={bold:false}}}const C=T1({},n.textStyle,x,w,h?.textStyle,_);const A=Wme(m?.paragraphStyle,h?.paragraphStyle);const P=n.bulletCharacter!==void 0?{...n.paragraphStyle??{tabStops:[]},bulletCharacter:n.bulletCharacter}:n.paragraphStyle;const L=Wme(P,A)??{tabStops:[]};const I=rMr(i,o);const N=T4t("before",{paragraphStyle:n.paragraphStyle,legacyValue:n.spaceBefore},{paragraphStyle:m?.paragraphStyle,legacyValue:m?.spaceBefore},{paragraphStyle:h?.paragraphStyle,legacyValue:h?.spaceBefore},{legacyValue:i.masterDefaults?.spaceBefore});const O=T4t("after",{paragraphStyle:n.paragraphStyle,legacyValue:n.spaceAfter},{paragraphStyle:m?.paragraphStyle,legacyValue:m?.spaceAfter},{paragraphStyle:h?.paragraphStyle,legacyValue:h?.spaceAfter},{legacyValue:i.masterDefaults?.spaceAfter});const z=N?.kind==="typed-points"?CN(N.value):N?.kind==="legacy"?lj(N.value,I):0;const U=O?.kind==="typed-points"?CN(O.value):O?.kind==="legacy"?lj(O.value,I):0;const W=N?.kind==="percent"?N.value:void 0;const H=O?.kind==="percent"?O.value:void 0;const $=t.paragraphs?.[r-1];const K=t.paragraphs?.[r+1];const X=w4t($,n);const j=w4t(n,K);const te=X?0:z;const J=j?0:U;const oe=o==="document"?Kme:Qme;const se=n.marginLeft!==void 0?oe(n.marginLeft):Qme(L.marginLeft);const re=n.indent!==void 0?oe(n.indent):Qme(L.indent);const ce=Kme(W3r(C?.scheme,S3r));const ue=!!L.bulletCharacter;const xe=!!L.autoNumberType;const be=ue||xe;const Ie=se+re;const he=se;const ve=(L.lineSpacingPercent??i.masterDefaults?.lineSpacingPercent??Math.round(m3r*1e5))/1e5;const ge=ve>0?ve:1;const Ve=D3r(L);const Le=o==="document"?Kme(i.defaultTabStopTwips??720):0;const $e=o==="document"?"document":"presentation";const Ee=o==="presentation";const tt=L.lineSpacingPoints!==void 0&&L.lineSpacingPoints>0?CN(L.lineSpacingPoints):void 0;const yt=o==="document"&&i.documentGridLinePitchTwips!==void 0&&L.snapToGrid!==false?Kme(i.documentGridLinePitchTwips):void 0;const mt=o==="presentation";const ct=i.elementStyle?.useParagraphSpacing===true;const Ge=r===0;const it=r===d-1;const bt=u.length;const He=[];let Je=0;let Te="left";let we=0;let Ze=0;let Be=true;let qe=false;let Qe;let ze;const Me=()=>Be?Ie:he;const ye=()=>Math.max(1,s-Me()-ce);const Ne=T1({},C,i.elementStyle);const Ae=_7e(i.elementStyle?.scheme,C?.scheme);const dt=z3r(Ae);Te=dt??(Number(Ne.alignment)===4?"justify":Ne.alignment===2?"center":Ne.alignment===3?"right":"left");const Oe=()=>{if(!He.some(Er=>Er.text.length>0&&Er.text.trim().length>0)){return}let Mr=0;while(He.length>0){const Er=He[He.length-1];if(!Er||Er.text.length===0||Er.text.trim().length>0||!I4t.test(Er.text)){break}Mr+=Er.widthPx;He.pop();const vr=He[He.length-1];const Yr=Jme(vr,Er);if(vr&&Yr!==0){vr.widthPx-=Yr;const nt=vr.advance.length-1;vr.advance[nt]=nk(vr.advance,nt)-Yr;Mr+=Yr}}if(Mr===0){return}Je=Math.max(0,Je-Mr);we=He.reduce((Er,vr)=>Math.max(Er,vr.ascentPx),0);Ze=He.reduce((Er,vr)=>Math.max(Er,vr.descentPx),0)};const Wt=Mr=>{const Er=He[He.length-1];const vr=Jme(Er,Mr);if(Er&&vr!==0){Er.widthPx+=vr;const Yr=Er.advance.length-1;Er.advance[Yr]=nk(Er.advance,Yr)+vr;Je+=vr}He.push(Mr);Je+=Mr.widthPx;we=Math.max(we,Mr.ascentPx);Ze=Math.max(Ze,Mr.descentPx)};const kt=()=>{if(!Qe){return}const Mr=Qe;Qe=void 0;if(Mr.referenceSegment&&Mr.widthPx>0&&Mr.segments.length>0){const Er=P4t({tabTarget:{positionPx:Mr.tabStartPx,alignment:Mr.alignment},currentWidthPx:Mr.startWidthPx,fieldWidthPx:Mr.widthPx});const vr=Math.max(0,Er-Je);if(vr>0){Wt(R4t(Mr.referenceSegment,vr))}}for(const Er of Mr.segments){Wt(Er)}};const qt=()=>{const Mr=u[u.length-1];if(!Mr){return}if(!Mr.segments.some(Er=>Er.paraIndex===r)){return}Mr.flowBreakAfter=true};const _t=(Mr=0,Er)=>{kt();ze=void 0;if(He.length===0)return;if(o!=="spreadsheet"){Oe()}const vr=He.reduce((Pt,an)=>Math.max(Pt,an.px),0)||a;const Yr=we>0?we:vr*x3r;const nt=Ze>0?Ze:vr*v3r;const Rr=He.length>0&&He.every(Pt=>Pt.officeAscentPx!==void 0&&Pt.officeDescentPx!==void 0);const Xr=Rr?He.reduce((Pt,an)=>Math.max(Pt,an.officeAscentPx??0),0):void 0;const dr=Rr?He.reduce((Pt,an)=>Math.max(Pt,an.officeDescentPx??0),0):void 0;const rn=Q3r({baseAscentPx:Yr,baseDescentPx:nt,officeAscentPx:Xr,officeDescentPx:dr,lineFontPx:vr,lineMultiple:ge,lineSpacingPx:tt,minimumContentHeightPx:yt,model:$e,usePresentationBaselineMetrics:Ee});const St=Me();const Ut=ye();u.push({segments:He.slice(),widthPx:Je,heightPx:rn.contentHeightPx+Mr,contentHeightPx:rn.contentHeightPx,naturalHeightPx:rn.naturalHeightPx,leadingBeforePx:rn.leadingBeforePx,leadingAfterPx:rn.leadingAfterPx,align:Te,offsetPx:St,availableWidthPx:Ut,baselineOffsetPx:rn.baselineOffsetPx,maxAscentPx:Yr,maxDescentPx:nt,maxPx:Yr+nt,flowBreakAfter:Er?.flowBreakAfter??false});He.length=0;Je=0;we=0;Ze=0;Be=false;Qe=void 0;ze=void 0};const sn=xe?`${L.autoNumberType}|${se}|${re}`:"";let Jt=0;if(xe){const Mr=L.autoNumberStartAt;if(l[sn]===void 0){l[sn]=typeof Mr==="number"&&Mr>0?Mr:1}Jt=l[sn]}const Sn=n.runs??[];for(let Mr=0;Mr.5){He.push({text:"",widthPx:di,font:Pt,fontKey:an,fill:rr,fillSource:hr,outlineSource:Et,shadowSource:Tn,highlight:ft,underline:zt,px:Rr,ascentPx:Xt.ascentPx,descentPx:Xt.descentPx,officeAscentPx:Xt.officeAscentPx,officeDescentPx:Xt.officeDescentPx,run:Er,paraIndex:r,runIndex:Mr,charStart:sr.length,charEnd:sr.length,advance:new Float32Array(1),inkLeftPx:0,inkRightPx:0,inkAscentPx:0,inkDescentPx:0});Je+=di}}qe=true;if(xe){l[sn]=Jt+1}}const Tr=Er.text?G3r(Er.text,vr):"";const Jr=Tr?j3r(Tr):[];if(!Jr.length){He.push({text:"",widthPx:0,font:Pt,fontKey:an,fill:rr,fillSource:hr,outlineSource:Et,shadowSource:Tn,highlight:ft,underline:zt,px:Rr,ascentPx:Xt.ascentPx,descentPx:Xt.descentPx,officeAscentPx:Xt.officeAscentPx,officeDescentPx:Xt.officeDescentPx,run:Er,paraIndex:r,runIndex:Mr,charStart:0,charEnd:0,advance:new Float32Array(1),inkLeftPx:0,inkRightPx:0,inkAscentPx:0,inkDescentPx:0});we=Math.max(we,Xt.ascentPx);Ze=Math.max(Ze,Xt.descentPx);continue}let jr=0;for(const sr of Jr){if(sr.type==="flowBreak"){kt();ze=void 0;if(He.length>0){_t(0,{flowBreakAfter:true})}else{qt()}jr+=sr.text.length;continue}if(sr.type==="newline"){kt();ze=void 0;if(He.length===0){Wt({text:"",widthPx:0,font:Pt,fontKey:an,fill:rr,fillSource:hr,outlineSource:Et,shadowSource:Tn,highlight:ft,underline:zt,px:Rr,ascentPx:Xt.ascentPx,descentPx:Xt.descentPx,officeAscentPx:Xt.officeAscentPx,officeDescentPx:Xt.officeDescentPx,run:Er,paraIndex:r,runIndex:Mr,charStart:jr,charEnd:jr,advance:new Float32Array(1),inkLeftPx:0,inkRightPx:0,inkAscentPx:0,inkDescentPx:0})}_t();continue}if(sr.type==="tab"){kt();const Pr=ze!==void 0?Math.max(Je,ze):Je;const Vt=tMr({tabStops:Ve,defaultTabStopPx:Le,offsetPx:Me(),currentWidthPx:Pr});if(Vt.alignment==="left"||Vt.alignment==="bar"||Vt.alignment==="clear"){ze=P4t({tabTarget:Vt,currentWidthPx:Pr,fieldWidthPx:0})}else{ze=void 0;Qe={startWidthPx:Je,tabStartPx:Vt.positionPx,alignment:Vt.alignment,segments:[],widthPx:0,maxAscentPx:0,maxDescentPx:0,referenceSegment:void 0}}jr+=sr.text.length;continue}const bn=sr.graphemes??pm(sr.text);if(!bn.length)continue;const ir=this.measureCache.buildAdvance(an,Pt,Rr,sr.text,bn,Fn,Gt);const Jn=(Pr,Vt)=>{if(Pr>=Vt){return Vt}const di=Pr===0&&Vt===bn.length?sr.text:bn.slice(Pr,Vt).join("");const ln=A4t(ir,Pr,Vt);if(Pr!==0&&Gt!==void 0){ln.set(this.measureCache.buildAdvance(an,Pt,Rr,di,bn.slice(Pr,Vt),Fn,Gt))}const yi=nk(ln,ln.length-1);const yo=this.measureCache.measureInkBounds(Pt,di,Gt);const Pa=jr;const Ms=Pa+di.length;const ds={text:di,widthPx:yi,font:Pt,fontKey:an,fill:rr,fillSource:hr,outlineSource:Et,shadowSource:Tn,highlight:ft,underline:zt,px:Rr,characterSpacingPx:Gt,ascentPx:Xt.ascentPx,descentPx:Xt.descentPx,officeAscentPx:Xt.officeAscentPx,officeDescentPx:Xt.officeDescentPx,paintBaselineCompensationPx:Ee?yo.paintBaselineCompensationPx:void 0,run:Er,paraIndex:r,runIndex:Mr,charStart:Pa,charEnd:Ms,advance:ln,inkLeftPx:yo.leftPx,inkRightPx:yo.rightPx,inkAscentPx:yo.ascentPx,inkDescentPx:yo.descentPx};if(ze!==void 0){const st=Math.max(0,ze-Je);if(st>0){Wt(R4t(ds,st))}ze=void 0}if(Qe){const st=Qe.segments[Qe.segments.length-1];Qe.segments.push(ds);Qe.widthPx+=yi+Jme(st,ds);Qe.maxAscentPx=Math.max(Qe.maxAscentPx,Xt.ascentPx);Qe.maxDescentPx=Math.max(Qe.maxDescentPx,Xt.descentPx);if(!Qe.referenceSegment){Qe.referenceSegment=ds}}else{Wt(ds)}jr=Ms;return Vt};let er=0;while(er0){_t();continue}const yo=K3r(ln,0,Vt);const Pa=er+Math.max(1,yo);er=Jn(er,Pa);if(erMr?.segments.reduce((Er,vr)=>Math.max(Er,vr.px),0)||a;const lr=!X&&W!==void 0?b7e(W,At(Kt)):te;const on=!j&&H!==void 0?b7e(H,At(mn)):J;let cr=y4t(f,lr);let Hr=on;if(mt){cr=lr;if(Ge&&!ct){cr=0}if(it&&!ct){Hr=0}}if(cr>0){u.splice(bt,0,{segments:[],widthPx:0,heightPx:cr,contentHeightPx:0,align:"left",offsetPx:0,availableWidthPx:i.boxWidthPx,baselineOffsetPx:0,maxAscentPx:0,maxDescentPx:0,maxPx:0})}if(Hr>0&&mn){mn.heightPx+=Hr}return Hr}};function iMr(e){if(e.segments.length===0){return}let t=0;let n=Number.POSITIVE_INFINITY;let r=Number.NEGATIVE_INFINITY;let i=0;let o=0;e.segments.forEach(s=>{const l=s.inkRightPx>0||s.inkAscentPx>0||s.inkDescentPx>0;if(l){n=Math.min(n,t-s.inkLeftPx);r=Math.max(r,t+s.inkRightPx);i=Math.max(i,s.inkAscentPx);o=Math.max(o,s.inkDescentPx)}t+=s.widthPx});if(!Number.isFinite(n)||!Number.isFinite(r)){return}const a=Math.max(0,r-n);if(a<=0){return}e.inkLeftPx=n;e.inkRightPx=r;e.inkAscentPx=i;e.inkDescentPx=o}function FT(e,t,n){switch(t){case 1:case 0:e.setLineDash([]);break;case 2:e.setLineDash([4*n,4*n]);break;case 6:e.setLineDash([8*n,4*n]);break;case 7:e.setLineDash([3*n,3*n]);break;case 3:e.lineCap="round";e.setLineDash([n,2*n]);break;case 4:e.lineCap="round";e.setLineDash([4*n,2*n,n,2*n]);break;case 8:e.lineCap="round";e.setLineDash([n,2*n]);break;case 5:e.lineCap="round";e.setLineDash([4*n,2*n,n,2*n,n,2*n]);break;case 9:e.lineCap="butt";e.setLineDash([8*n,3*n,n,3*n]);break;case 10:e.lineCap="butt";e.setLineDash([3*n,2*n,n,2*n]);break;case 11:e.lineCap="butt";e.setLineDash([8*n,3*n,n,2*n,n,3*n]);break;case 12:e.lineCap="butt";e.setLineDash([3*n,2*n,n,2*n,n,2*n]);break;default:e.setLineDash([])}}var M4t=16;function oMr(e,t){const n=t?e:e/1e5;return Math.min(1,Math.max(0,n))}function tge(e){return`rgba(${e.r},${e.g},${e.b},${e.a})`}function aMr(e,t,n){return e+(t-e)*n}function sMr(e,t){return e.a<1||t.a<1}function lMr(e,t,n){const r=n+(e.a-t.a)*n*(1-n);return{r:e.r+(t.r-e.r)*r,g:e.g+(t.g-e.g)*r,b:e.b+(t.b-e.b)*r,a:aMr(e.a,t.a,n)}}function nge(e,t,n,r){const i=[...t].sort((s,l)=>(s.position??0)-(l.position??0));const o=i.every(s=>Math.abs(s.position??0)<=1);const a=i.map(s=>({color:oj(s.color,n,r)??{r:0,g:0,b:0,a:0},offset:oMr(s.position??0,o)}));if(a.length===1){e.addColorStop(0,tge(a[0].color));return}a.forEach((s,l)=>{if(l===0){e.addColorStop(s.offset,tge(s.color));return}const u=a[l-1];if(s.offset>u.offset&&sMr(u.color,s.color)){for(let d=1;d(se??0)/1e5;const d=n.fillRect;const f=u(d?.l);const h=u(d?.t);const m=u(d?.r);const g=u(d?.b);const x=(f+(1-m))/2;const w=(h+(1-g))/2;const _=o+x*s;const C=a+w*l;const A=o+f*s;const P=a+h*l;const L=o+(1-m)*s;const I=a+(1-g)*l;const N=_-A;const O=L-_;const z=C-P;const U=I-C;const W=(se,re)=>Math.hypot(se-_,re-C);const H=Math.max(W(o,a),W(o+s,a),W(o,a+l),W(o+s,a+l));const $=Math.max(Math.abs(N),Math.abs(O),Math.abs(z),Math.abs(U));const K=Math.abs(L-A)<1e-6||Math.abs(I-P)<1e-6;const X=_o+s||Ca+l;const j=K||X;let te;switch(n.pathType){case 3:te=j?Math.max(1e-6,H):Math.max(1e-6,Math.min(N,O,z,U));break;case 2:te=j?Math.max(1e-6,H):Math.max(1e-6,$);break;case 1:case 0:case-1:default:te=Math.max(1e-6,H);break}const J=e.createRadialGradient(_,C,0,_,C,te);const oe=n.gradientStops??[];if(oe.length===0){const se=oo(n.color,r,{colorSpace:i?.colorSpace,defaultFill:"transparent"});J.addColorStop(0,se);J.addColorStop(1,se);return J}nge(J,oe,r,i);return J}var Ty=(e,t)=>Math.max(1,t*e);var T7e=(e,t)=>Ty(e,t)/2;var F4t=(e,t,n,r,i)=>{e.fillStyle=n;e.fillRect(0,0,2*r,2*r);e.fillStyle=t;const o=Ty(i,1);e.fillRect(0,r-o/2,2*r,o)};var N4t=(e,t,n,r,i)=>{e.fillStyle=n;e.fillRect(0,0,2*r,2*r);e.fillStyle=t;const o=Ty(i,1);e.fillRect(r-o/2,0,o,2*r)};var cMr=(e,t,n,r,i)=>{F4t(e,t,n,r,i);N4t(e,t,"rgba(0,0,0,0)",r,i)};function O4t(e,t,n){e.fillStyle=t;e.fillRect(0,0,2*n,2*n)}function w7e(e,t,n,r,i){e.strokeStyle=t;const o=Ty(r,1);e.lineWidth=o;e.lineCap="butt";e.lineJoin="bevel";e.miterLimit=1;if(i?.dashed){e.setLineDash([n*.6,n*.6])}e.beginPath();e.moveTo(-2*n,2*n);e.lineTo(2*n,-2*n);e.moveTo(0,2*n);e.lineTo(4*n,-2*n);e.moveTo(2*n,2*n);e.lineTo(6*n,-2*n);e.stroke();if(i?.dashed){e.setLineDash([])}}var B4t=(e,t,n,r,i)=>{O4t(e,n,r);w7e(e,t,r,i)};var uMr=(e,t,n,r,i)=>{O4t(e,n,r);w7e(e,t,r,i,{dashed:true})};var dMr=(e,t,n,r,i)=>{B4t(e,t,n,r,i);e.save();e.translate(r,r);e.rotate(Math.PI/2);e.translate(-r,-r);w7e(e,t,r,i);e.restore()};var z4t=(e,t,n,r,i)=>{e.fillStyle=n;e.fillRect(0,0,2*r,2*r);e.fillStyle=t;const o=Ty(i,1);e.fillRect(0,r-o/2,2*r,o);e.fillRect(r-o/2,0,o,2*r)};var fMr=(e,t,n,r,i)=>{e.fillStyle=n;e.fillRect(0,0,2*r,2*r);e.fillStyle=t;const o=Math.max(1,.75*i);e.beginPath();e.arc(.5*r,.5*r,o,0,Math.PI*2);e.fill();e.beginPath();e.arc(1.5*r,1.5*r,o,0,Math.PI*2);e.fill()};var hMr=(e,t,n,r,i)=>{e.fillStyle=n;e.fillRect(0,0,2*r,2*r);e.fillStyle=t;const o=T7e(i,1);e.fillRect(0,0,r-o,r-o);e.fillRect(r+o,r+o,r-o,r-o)};var pMr=(e,t,n,r,i)=>{z4t(e,t,n,r,i);e.strokeStyle=t;e.lineWidth=Ty(i,2);e.lineCap="butt";e.lineJoin="miter";e.miterLimit=2;e.beginPath();e.moveTo(0,0);e.lineTo(2*r,2*r);e.moveTo(0,2*r);e.lineTo(2*r,0);e.stroke()};var mMr=(e,t,n,r,i)=>{e.fillStyle=n;e.fillRect(0,0,2*r,2*r);e.strokeStyle=t;e.lineWidth=Ty(i,1);e.setLineDash([r*.6,r*.6]);e.lineCap="butt";e.lineJoin="miter";e.miterLimit=2;e.beginPath();e.moveTo(0,r);e.lineTo(2*r,r);e.stroke();e.setLineDash([])};var gMr=(e,t,n,r,i)=>{e.fillStyle=n;e.fillRect(0,0,2*r,2*r);e.strokeStyle=t;e.lineWidth=Ty(i,1);e.setLineDash([r*.6,r*.6]);e.lineCap="butt";e.lineJoin="miter";e.miterLimit=2;e.beginPath();e.moveTo(r,0);e.lineTo(r,2*r);e.stroke();e.setLineDash([])};var yMr=(e,t,n,r,i)=>{e.fillStyle=n;e.fillRect(0,0,2*r,2*r);e.fillStyle=t;const o=Ty(i,3);e.fillRect(0,r-o/2,2*r,o);e.fillRect(r-o/2,0,o,2*r)};var bMr=(e,t,n,r,i)=>{e.fillStyle=n;e.fillRect(0,0,2*r,2*r);e.strokeStyle=t;e.lineWidth=Ty(i,1);e.lineCap="butt";e.lineJoin="miter";e.miterLimit=2;e.beginPath();const o=T7e(i,1);e.moveTo(0,o);e.lineTo(2*r,o);e.moveTo(0,r+o);e.lineTo(2*r,r+o);e.moveTo(0,2*r+o);e.lineTo(2*r,2*r+o);e.moveTo(o,0);e.lineTo(o,r);e.moveTo(r+o,0);e.lineTo(r+o,r);e.moveTo(.5*r+o,r);e.lineTo(.5*r+o,2*r);e.moveTo(1.5*r+o,r);e.lineTo(1.5*r+o,2*r);e.stroke()};var xMr=(e,t,n,r,i)=>{e.fillStyle=n;e.fillRect(0,0,2*r,2*r);e.strokeStyle=t;e.lineWidth=Ty(i,1);e.lineCap="butt";e.lineJoin="miter";e.miterLimit=2;const o=T7e(i,1);e.beginPath();e.moveTo(-r,r);e.lineTo(r,-r);e.moveTo(0,2*r);e.lineTo(2*r,0);e.moveTo(r,2*r);e.lineTo(3*r,0);e.moveTo(0,o);e.lineTo(2*r,o);e.moveTo(0,r+o);e.lineTo(2*r,r+o);e.moveTo(0,2*r+o);e.lineTo(2*r,2*r+o);e.stroke()};var vMr=(e,t,n,r)=>{e.fillStyle=n;e.fillRect(0,0,2*r,2*r);e.fillStyle=t;const i=.55*r;const o=(a,s)=>{e.beginPath();e.moveTo(a,s-i);e.lineTo(a+i,s);e.lineTo(a,s+i);e.lineTo(a-i,s);e.closePath();e.fill()};o(.5*r,.5*r);o(1.5*r,1.5*r)};var _Mr=(e,t,n,r,i)=>{e.fillStyle=n;e.fillRect(0,0,2*r,2*r);e.strokeStyle=t;e.lineWidth=Ty(i,1);e.lineCap="butt";e.lineJoin="miter";e.miterLimit=2;const o=.55*r;const a=(s,l)=>{e.beginPath();e.moveTo(s,l-o);e.lineTo(s+o,l);e.lineTo(s,l+o);e.lineTo(s-o,l);e.closePath();e.stroke()};a(.5*r,.5*r);a(1.5*r,1.5*r)};var TMr=(e,t,n,r,i)=>{e.fillStyle=n;e.fillRect(0,0,2*r,2*r);e.fillStyle=t;const o=Math.max(1,.65*i);const a=[[r,.5*r],[.5*r,r],[r,1.5*r],[1.5*r,r]];for(const[s,l]of a){e.beginPath();e.arc(s,l,o,0,Math.PI*2);e.fill()}};var wMr=(e,t,n,r)=>{e.fillStyle=n;e.fillRect(0,0,2*r,2*r);e.fillStyle=t;const i=Math.max(1,Math.round(.5*(r/6)));const o=[[.3*r,.4*r],[1.2*r,.6*r],[.8*r,1.3*r],[1.6*r,1.7*r]];for(const[a,s]of o){e.fillRect(Math.round(a)-i,Math.round(s)-i,2*i,2*i)}};var EMr=(e,t,n,r)=>{e.fillStyle=n;e.fillRect(0,0,2*r,2*r);e.fillStyle=t;const i=Math.max(1,Math.round(.9*(r/6)));const o=[[.4*r,.5*r],[1.3*r,.8*r],[.6*r,1.5*r],[1.7*r,1.2*r]];for(const[a,s]of o){e.fillRect(Math.round(a)-i,Math.round(s)-i,2*i,2*i)}};var CMr=(e,t,n,r)=>{e.fillStyle=n;e.fillRect(0,0,2*r,2*r);e.fillStyle=t;const i=Math.max(1,Math.round(.25*r));const o=[[.5*r,.5*r],[1.5*r,.5*r],[.5*r,1.5*r],[1.5*r,1.5*r]];for(const[a,s]of o){e.beginPath();e.arc(a,s,i,0,Math.PI*2);e.fill()}};var SMr=(e,t,n,r)=>{e.fillStyle=n;e.fillRect(0,0,2*r,2*r);e.fillStyle=t;const i=Math.max(2,Math.round(.4*r));e.fillRect(0,r-i/2,2*r,i);e.fillRect(r-i/2,0,i,2*r)};var AMr=(e,t,n,r,i)=>{e.fillStyle=n;e.fillRect(0,0,2*r,2*r);e.strokeStyle=t;e.lineWidth=Ty(i,1);e.lineCap="butt";e.lineJoin="miter";e.miterLimit=2;const o=Math.max(1,Math.round(.3*r));const a=[[.5*r,.5*r],[1.5*r,1.5*r]];for(const[s,l]of a){e.beginPath();e.arc(s,l,o,0,Math.PI*2);e.stroke()}};var kMr=(e,t,n,r,i)=>{e.fillStyle=n;e.fillRect(0,0,2*r,2*r);e.strokeStyle=t;e.lineWidth=Ty(i,1);e.lineCap="butt";e.lineJoin="miter";e.miterLimit=2;const o=.5*r;e.beginPath();e.arc(.5*r,r,o,Math.PI,0);e.arc(1.5*r,r,o,Math.PI,0);e.arc(r,2*r,o,Math.PI,0);e.stroke()};var RMr=(e,t,n,r,i)=>{e.fillStyle=n;e.fillRect(0,0,2*r,2*r);e.strokeStyle=t;e.lineWidth=Ty(i,1);e.lineCap="butt";e.lineJoin="miter";e.miterLimit=2;e.beginPath();e.moveTo(0,r);e.bezierCurveTo(.5*r,.5*r,1.5*r,1.5*r,2*r,r);e.stroke()};var PMr=(e,t,n,r,i)=>{e.fillStyle=n;e.fillRect(0,0,2*r,2*r);e.strokeStyle=t;e.lineWidth=Ty(i,1);e.lineCap="butt";e.lineJoin="miter";e.miterLimit=2;e.beginPath();e.moveTo(0,r);e.lineTo(.5*r,.5*r);e.lineTo(r,r);e.lineTo(1.5*r,1.5*r);e.lineTo(2*r,r);e.stroke()};var U4t={horz:F4t,vert:N4t,cross:cMr,diag:B4t,diagDashed:uMr,diagCross:dMr,grid:z4t,dots:fMr,check:hMr,trellis:pMr,horzDashed:mMr,vertDashed:gMr,plaid:yMr,horizontalBrick:bMr,diagonalBrick:xMr,solidDiamond:vMr,openDiamond:_Mr,dottedDiamond:TMr,confettiSmall:wMr,confettiLarge:EMr,sphere:CMr,weave:SMr,divot:AMr,shingle:kMr,wave:RMr,zigZag:PMr};function IMr(e){return e?.patternType??2}function MMr(e){return e?.color}var LMr={[5]:{id:"dots",scale:1.8},[3]:{id:"dots",scale:1.15},[4]:{id:"dots",scale:.85},[6]:{id:"horz",scale:.25},[12]:{id:"horz",scale:.5},[32]:{id:"horz",scale:1},[34]:{id:"horz",scale:.5},[36]:{id:"horzDashed",scale:1.5},[7]:{id:"vert",scale:.25},[13]:{id:"vert",scale:.5},[33]:{id:"vert",scale:1},[35]:{id:"vert",scale:.5},[37]:{id:"vertDashed",scale:1.5},[38]:{id:"cross"},[48]:{id:"cross",extraAngle:45,scale:1},[8]:{id:"vert",extraAngle:135,scale:.5},[9]:{id:"vert",extraAngle:45,scale:.5},[14]:{id:"vert",extraAngle:135,scale:.5},[15]:{id:"vert",extraAngle:45,scale:.5},[42]:{id:"vert",extraAngle:135,scale:1},[43]:{id:"vert",extraAngle:45,scale:1},[44]:{id:"vert",extraAngle:135,scale:1},[45]:{id:"vert",extraAngle:45,scale:1},[46]:{id:"vertDashed",extraAngle:135,scale:1.5},[47]:{id:"vertDashed",extraAngle:45,scale:1.5},[40]:{id:"grid",scale:.5},[39]:{id:"grid",scale:2},[16]:{id:"grid",scale:1.2},[10]:{id:"grid",scale:.85},[41]:{id:"dots",scale:1},[49]:{id:"check",scale:1},[50]:{id:"check",scale:2},[64]:{id:"trellis",scale:1},[17]:{id:"trellis",scale:1.5},[11]:{id:"trellis",scale:.85},[51]:{id:"confettiSmall",scale:1},[52]:{id:"confettiLarge",scale:1},[53]:{id:"horizontalBrick",scale:1},[54]:{id:"diagonalBrick",scale:1},[55]:{id:"solidDiamond",scale:1},[56]:{id:"openDiamond",scale:1},[57]:{id:"dottedDiamond",scale:1},[58]:{id:"plaid",scale:1},[59]:{id:"sphere",scale:1},[60]:{id:"weave",scale:1},[61]:{id:"divot",scale:1},[62]:{id:"shingle",scale:1},[63]:{id:"wave",scale:1},[65]:{id:"zigZag",scale:1},[19]:{id:"dots",scale:2.3},[18]:{id:"dots",scale:1.9},[20]:{id:"dots",scale:2.6},[21]:{id:"dots",scale:2.1},[22]:{id:"dots",scale:1.7},[23]:{id:"dots",scale:1.55},[24]:{id:"dots",scale:1.45},[25]:{id:"dots",scale:1.3},[26]:{id:"dots",scale:1.15},[27]:{id:"dots",scale:1},[28]:{id:"dots",scale:.9},[29]:{id:"dots",scale:.85},[30]:{id:"dots",scale:.8},[31]:{id:"dots",scale:.7}};var V4t=new Map;function DMr(){const e=globalThis.devicePixelRatio;return typeof e==="number"&&Number.isFinite(e)&&e>0?e:1}function FMr(e,t,n,r,i){return[e,t,n,r,i].join("|")}function $4t(e,t){if(typeof OffscreenCanvas!=="undefined"){return new OffscreenCanvas(e,t)}throw new Error("OffscreenCanvas API not available for pattern tiles.")}function NMr(e,t,n,r,i){const o=2*r,a=2*r;const s=$4t(o,a);const l=s.getContext("2d");if(l){l.imageSmoothingEnabled=false;const u=U4t[e];u?.(l,t,n,r,i)}return s}function G4t(e,t,n,r,i){const o=i?.dpr??DMr();const a=typeof e.getTransform==="function"?e.getTransform():null;const s=a?Math.hypot(a.a,a.b):1;const l=a?Math.hypot(a.c,a.d):1;const u=Math.max(1,Math.min(8,Math.ceil(Math.max(s,l))));const d=o*u;const f=oo(n.color,r,{colorSpace:i?.colorSpace,defaultFill:"#ffffff"});const h=oo(MMr(n.pattern),r,{colorSpace:i?.colorSpace,defaultFill:f});const m=IMr(n.pattern);if(m===1){return"transparent"}if(m===2||m===0){return h}const g=LMr[m]??{id:"grid",scale:1,extraAngle:0};const x=m===42||m===43||m===44||m===45||m===46||m===47||m===48||m===8||m===9||m===14||m===15;const w=x?3:4;const _=Math.max(w,Math.round(6*(i?.scale??g.scale??1)));const C=_*d;const A=g.id??"grid";const P=FMr(A,h,f,_,d);let L=V4t.get(P);if(!L){L=NMr(A,h,f,C,d);V4t.set(P,L)}const I=(i?.angleDeg??0)+(g.extraAngle??0);const N=i?.anchor??"object";const O=i?.anchorX??(N==="object"?t.x+t.width/2:0);const z=i?.anchorY??(N==="object"?t.y+t.height/2:0);const U=e.createPattern(L,"repeat");const W=typeof U.setTransform==="function";if(W){const ue=L.width/d;const xe=L.height/d;const be=((O-ue/2)%ue+ue)%ue;const Ie=((z-xe/2)%xe+xe)%xe;const he=I;const ve=new DOMMatrix().translate(be,Ie).rotate(he).scale(1/d,1/d);U.setTransform(ve);return U}const H=L.width/d;const $=L.height/d;const K=((O-H/2)%H+H)%H;const X=((z-$/2)%$+$)%$;const j=L.width;const te=L.height;const J=$4t(j*8,te*8);const oe=J.getContext("2d");oe.imageSmoothingEnabled=false;const se=oe.createPattern(L,"repeat");oe.save();const re=K*d;const ce=X*d;oe.translate(J.width/2,J.height/2);oe.rotate(I*Math.PI/180);oe.translate(-(J.width/2-re),-(J.height/2-ce));oe.fillStyle=se;oe.fillRect(-j,-te,J.width+2*j,J.height+2*te);oe.restore();return e.createPattern(J,"repeat")}var H4t=new WeakMap;var W4t=new WeakMap;var BMr={colorMap:{},effectMap:{},lineStyleMap:{}};function ige(e){return Math.max(0,Math.min(255,Math.round(e)))}function zMr(e){return Math.max(0,Math.min(1,e))}function Y4t(e,t){return zMr((e??t)/1e5)}function q4t(e,t,n){return n*29+t*151+e*76>>8&255}function UMr(e,t,n){return n*28+t*151+e*77>>8&255}function VMr(e){const t=Math.max(-100,Math.min(100,(e??0)/1e3));if(t>=0){return 128/(128-1.27*t)}return(128+1.27*t)/128}function rge(e,t){if(!e)return null;if(!t&&e.type===2)return null;return oj(e,t??BMr)??null}function $Mr(e){const t=e?.split(";")[0]?.trim().toLowerCase();switch(t){case"image/jpeg":case"image/jpg":return 15;case"image/png":case"image/tiff":case"image/tif":return 1;case"image/bmp":case"image/x-bmp":case"image/x-ms-bmp":return 0;default:return 9}}function GMr(e){for(let t=3;tr||Math.abs((e[s+1]??0)-t.g)>r||Math.abs((e[s+2]??0)-t.b)>r){continue}e[s]=n.r;e[s+1]=n.g;e[s+2]=n.b;if(a){e[s+3]=o}}}function jMr(e,t){switch(e.type){case 1:return{type:1,amount:e.alphaModFix};case 2:return{type:2,brightness:e.luminance?.brightness,contrast:e.luminance?.contrast};case 3:return{type:3};case 4:return{type:4,darkColor:rge(e.duotone?.darkColor,t.themeMap),lightColor:rge(e.duotone?.lightColor,t.themeMap)};case 5:return{type:5,threshold:e.biLevelThreshold};case 6:{const n=rge(e.colorChange?.toColor,t.themeMap);return{type:6,fromColor:rge(e.colorChange?.fromColor,t.themeMap),toColor:e.colorChange?.useAlpha===false&&n?{...n,a:1}:n,tolerance:$Mr(t.contentType)}}default:return void 0}}function KMr(e){const t=e.pictureEffects??[];const n={alphaOpacity:1};t.forEach(r=>{const i=jMr(r,e);if(!i)return;switch(i.type){case 1:n.alphaOpacity=Y4t(i.amount,1e5);break;case 6:n.colorChange=i;break;case 4:n.duotone=i;break;case 5:case 3:n.colorMode=i;break;case 2:n.luminance=i;break}});return n}function oge(e){if(!e)return"none";return`${e.r},${e.g},${e.b},${e.a}`}function ZMr(e){return e.fromColor!==null&&e.toColor!==null&&(e.fromColor.r!==e.toColor.r||e.fromColor.g!==e.toColor.g||e.fromColor.b!==e.toColor.b||e.toColor.a<1)}function X4t(e){return`${oge(e.fromColor)}:${oge(e.toColor)}:${e.tolerance}`}function JMr(e){const t=e.colorChange?X4t(e.colorChange):"none";const n=e.duotone?`${oge(e.duotone.darkColor)}:${oge(e.duotone.lightColor)}`:"none";const r=e.colorMode?`${e.colorMode.type}:${e.colorMode.type===5?e.colorMode.threshold:""}`:"none";const i=e.luminance?`${e.luminance.brightness}:${e.luminance.contrast}`:"none";return`${t}|${n}|${r}|${i}`}function j4t(e){return Boolean(e.darkColor&&e.lightColor)}function K4t(e){return(e.brightness??0)!==0||(e.contrast??0)!==0}function QMr(e,t){if(!ZMr(t))return e;const n=X4t(t);let r=H4t.get(e);const i=r?.get(n);if(i)return i;const o=new OffscreenCanvas(e.width,e.height);const a=o.getContext("2d");if(!a)return e;a.drawImage(e,0,0);const s=a.getImageData(0,0,e.width,e.height);const{data:l}=s;XMr(l,t.fromColor,t.toColor,t.tolerance,GMr(l));a.putImageData(s,0,0);r??=new Map;r.set(n,o);H4t.set(e,r);return o}function eLr(e){return Boolean(e.duotone&&j4t(e.duotone)||e.colorMode||e.luminance&&K4t(e.luminance))}function tLr(e,t){if(t.duotone&&j4t(t.duotone)){qMr(e,t.duotone.darkColor,t.duotone.lightColor)}if(t.colorMode?.type===5){YMr(e,t.colorMode.threshold)}else if(t.colorMode){HMr(e)}if(t.luminance&&K4t(t.luminance)){WMr(e,t.luminance.brightness,t.luminance.contrast)}}function nLr(e,t,n){if(e.opacity===1||t<=0||n<=0)return e.source;const r=new OffscreenCanvas(t,n);const i=r.getContext("2d");if(!i)return e.source;i.globalAlpha=e.opacity;i.drawImage(e.source,0,0);return r}function rk(e,t={}){const n=KMr(t);if(e.width<=0||e.height<=0){return{source:e,opacity:n.alphaOpacity}}let r=e;if(n.colorChange){r=QMr(e,n.colorChange)}if(!eLr(n)){return{source:r,opacity:n.alphaOpacity}}const i=JMr(n);let o=W4t.get(e);const a=o?.get(i);if(a){return{source:a,opacity:n.alphaOpacity}}const s=new OffscreenCanvas(e.width,e.height);const l=s.getContext("2d");if(!l)return{source:r,opacity:n.alphaOpacity};l.drawImage(r,0,0);const u=l.getImageData(0,0,e.width,e.height);tLr(u.data,n);l.putImageData(u,0,0);o??=new Map;o.set(i,s);W4t.set(e,o);return{source:s,opacity:n.alphaOpacity}}function Z4t(e,t={}){return nLr(rk(e,t),e.width,e.height)}function J4t(e){if(!e)return false;if(e.type==="system"){return e.value==="auto"&&!e.lastColor}return e.type===3&&e.value==="auto"&&!e.lastColor}function Q4t(e){if(!e)return true;return e.type==="unspecified"||e.type===0}function rLr(e){if("isSet"in e&&!e.isSet){return true}if(e.type===4){return false}if((e.gradientStops?.length??0)>0){return false}const t=!Q4t(e.color)&&!J4t(e.color);const n=e.pattern?.color;const r=!Q4t(n)&&!J4t(n);if(t||r){return false}const i=e.pattern?.patternType??0;return i===0||i===1||i===2}function iLr(e){return e.gradientKind}function oLr(e){return e===void 0||e===null||e==="linear"||e===0||e===1}function m3(e){return(e??0)/1e5}function aLr(e,t,n,r){const i=Z4t(t,{pictureEffects:e.pictureEffects,contentType:r,themeMap:n});const o=e.srcRect;if(!o){return{source:i,width:t.width,height:t.height}}const a=m3(o.l);const s=m3(o.t);const l=m3(o.r);const u=m3(o.b);const d=a*t.width;const f=s*t.height;const h=t.width*(1-a-l);const m=t.height*(1-s-u);const g=Math.max(1,Math.round(h));const x=Math.max(1,Math.round(m));const w=new OffscreenCanvas(g,x);const _=w.getContext("2d");if(!_){return{source:i,width:t.width,height:t.height}}_.drawImage(i,d,f,h,m,0,0,g,x);return{source:w,width:g,height:x}}function sLr(e,t){const n=e.stretchFillRect;if(!n){return t}const r=m3(n.l);const i=m3(n.t);const o=m3(n.r);const a=m3(n.b);return{x:t.x+r*t.width,y:t.y+i*t.height,width:t.width*(1-r-o),height:t.height*(1-i-a)}}function lLr(e,t,n,r,i,o){const a=n.imageReference?.id;if(!a){return void 0}const s=r?.get(a);if(!s){return void 0}const l=aLr(n,s.bitmap,o,s.contentType);const u=sLr(n,t);if(l.width<=0||l.height<=0){return void 0}const d=e.createPattern(l.source,"no-repeat");if(!d){return void 0}if(i==="cover"){const f=Math.max(u.width/l.width,u.height/l.height);const h=l.width*f;const m=l.height*f;d.setTransform({a:f,b:0,c:0,d:f,e:u.x+(u.width-h)/2,f:u.y+(u.height-m)/2});return d}d.setTransform({a:u.width/l.width,b:0,c:0,d:u.height/l.height,e:u.x,f:u.y});return d}function Uc(e,t,n,r,i="transparent"){const o=typeof i==="string"?{defaultFill:i}:i;const a=o.defaultFill??"transparent";if(!n)return a;if(rLr(n)){return a}if(n.type===4){return lLr(e,t,n,o.pictureFillBitmaps,o.pictureFillFit,r)??a}if(n.type===2&&n.gradientStops?.length){const s=iLr(n);if(oLr(s)){return L4t(e,t,n,r,o)}if(s==="path"||s===2){return D4t(e,t,n,r,o)}}if(n.pattern){return G4t(e,t,n,r,o)}return oo(n.color,r,o)}var cLr=6e4;function age(e,t){const n=Number.isFinite(t)?t:0;if(n===0){return{x:0,y:0}}const r=typeof e==="number"&&Number.isFinite(e)?e:0;const i=r/cLr;const o=i*Math.PI/180;return{x:n*Math.cos(o),y:n*Math.sin(o)}}var uLr=4/3;var sge=class{render(t){const{lines:n}=t;if(!n.length)return void 0;const r=n.reduce((m,g)=>m+g.heightPx,0);const i=this.resolveTopY(t,r);const o=t.rotationDeg*Math.PI/180;const a=t.draw;const s=a&&o!==0;const l=t.ctx;if(a){l.textAlign="left";l.textBaseline="alphabetic";if(s){l.save();l.translate(t.box.x,i);l.rotate(o)}}const u=[];let d=i;for(let m=0;m{return/\s/.test(U.text)?z+1:z},0):0;const L=A?Math.max(0,C-g.widthPx):0;const I=P>0?L/P:0;const N=[];let O=w;for(let z=0;z0&&/\s/.test(U.text)?I:0;N.push({seg:U,xPx:O,advancePx:U.widthPx+W,highlight:this.resolveSegmentHighlight(g.segments,z)});O+=U.widthPx+W}if(a){this.drawSegmentHighlights(l,N,_,s,t.box.x,i)}for(const{seg:z,xPx:U}of N){z.xPx=U;if(a){if(z.mathLayout){if(s){z.mathLayout.draw(l,U-t.box.x,_-i)}else{z.mathLayout.draw(l,U,_)}}else{l.font=z.font;const W=this.resolveSegmentFill(t,z);const H=this.resolveSegmentOutlineFill(t,z);const $=this.resolveSegmentShadowStyle(t,z);const K=s?U-t.box.x:U;const X=_+(z.paintBaselineCompensationPx??0);const j=s?X-i:X;const te=l.letterSpacing;l.letterSpacing="0px";if(z.characterSpacingPx!==void 0){l.letterSpacing=`${z.characterSpacingPx}px`}try{if($){this.applyCanvasShadowStyle(l,$)}if(H){this.applySegmentOutlineStyle(l,z.outlineSource);l.strokeStyle=H;l.strokeText(z.text,K,j);l.setLineDash([])}l.fillStyle=W;l.fillText(z.text,K,j)}finally{if($){this.clearCanvasShadowStyle(l)}l.letterSpacing=te}}if(z.underline&&z.underline!=="none"&&z.widthPx>0){const W=_+Math.max(1,z.descentPx*.35);const H=Math.max(1,z.px*.05);l.strokeStyle=this.resolveSegmentFill(t,z);l.lineWidth=H;l.beginPath();if(s){l.moveTo(U-t.box.x,W-i);l.lineTo(U-t.box.x+z.widthPx,W-i)}else{l.moveTo(U,W);l.lineTo(U+z.widthPx,W)}l.stroke()}if(z.run?.hyperlink?.uri){const W={x:U,y:_-z.ascentPx,width:z.widthPx,height:z.ascentPx+z.descentPx,url:z.run.hyperlink.uri,action:z.run.hyperlink.action};u.push(W);t.linkRects?.push(W)}}}d+=g.heightPx}if(a&&s){l.restore()}const f=o!==0?Math.abs(t.box.width*Math.cos(o))+Math.abs(r*Math.sin(o)):t.box.width;const h=o!==0?Math.abs(t.box.width*Math.sin(o))+Math.abs(r*Math.cos(o)):r;return{x:t.box.x,y:i,width:f,height:h,unrotatedWidth:t.box.width,unrotatedHeight:r,lines:n.map(m=>({segments:m.segments,x:m.x,widthPx:m.widthPx,heightPx:m.heightPx,contentHeightPx:m.contentHeightPx,naturalHeightPx:m.naturalHeightPx,leadingBeforePx:m.leadingBeforePx,leadingAfterPx:m.leadingAfterPx,align:m.align,offsetPx:m.offsetPx,availableWidthPx:m.availableWidthPx,baselineOffsetPx:m.baselineOffsetPx,topY:m.topY,baselineY:m.baselineY,maxAscentPx:m.maxAscentPx,maxDescentPx:m.maxDescentPx,maxPx:m.maxPx,inkLeftPx:m.inkLeftPx,inkRightPx:m.inkRightPx,inkAscentPx:m.inkAscentPx,inkDescentPx:m.inkDescentPx})),linkRects:u}}resolveTopY(t,n){const{anchor:r}=t;const i=t.box;switch(r){case 3:return i.y+(i.height-n);case 2:return i.y+(i.height-n)/2;case 1:default:return i.y}}resolveLineX(t,n){const r=this.resolveAvailableWidthPx(t.width,n);if(n.align==="center"){return t.x+n.offsetPx+(r-n.widthPx)/2}if(n.align==="right"){return t.x+n.offsetPx+r-n.widthPx}return t.x+n.offsetPx}resolveBaselineY(t,n){return n+t.baselineOffsetPx}shouldJustifyLine(t,n,r,i){if(r.align!=="justify"||r.segments.length===0){return false}const o=this.resolveAvailableWidthPx(i,r);const a=o-r.widthPx;if(a<=.5){return false}const s=r.segments[0]?.paraIndex;if(s===void 0){return false}for(let l=n+1;l{if(!s){return}const u=r-s.maxAscentPx;const d=s.maxAscentPx+s.maxDescentPx;t.fillStyle=s.color;if(i){t.fillRect(s.startXPx-o,u-a,s.endXPx-s.startXPx,d)}else{t.fillRect(s.startXPx,u,s.endXPx-s.startXPx,d)}s=void 0};for(const{seg:u,xPx:d,advancePx:f,highlight:h}of n){if(!h){l();continue}const m=d+f;if(s&&s.color===h&&Math.abs(s.endXPx-d)<=.5){s.endXPx=m;s.maxAscentPx=Math.max(s.maxAscentPx,u.ascentPx);s.maxDescentPx=Math.max(s.maxDescentPx,u.descentPx);continue}l();s={color:h,startXPx:d,endXPx:m,maxAscentPx:u.ascentPx,maxDescentPx:u.descentPx}}l()}};function eNt(e){if(!e){return false}if("isExplicitNone"in e){return e.isExplicitNone}return e.type===0&&e.color===void 0&&(e.gradientStops?.length??0)===0&&e.pattern===void 0&&e.imageReference===void 0&&e.relId===void 0}function dLr(e){switch(e){case 2:return"round";case 3:return"square";case 1:case 0:default:return"butt"}}function fLr(e){switch(e){case 1:return"round";case 2:return"bevel";case 3:case 0:default:return"miter"}}var tNt={bottomInset:45720,leftInset:91440,rightInset:91440,topInset:45720};var g3=tNt;var ZNo={top:Bo(g3.topInset),right:Bo(g3.rightInset),bottom:Bo(g3.bottomInset),left:Bo(g3.leftInset)};function cg(e){return{top:lge({insetPx:e?.insets?.top,insetEmu:e?.topInset,defaultInsetEmu:g3.topInset}),right:lge({insetPx:e?.insets?.right,insetEmu:e?.rightInset,defaultInsetEmu:g3.rightInset}),bottom:lge({insetPx:e?.insets?.bottom,insetEmu:e?.bottomInset,defaultInsetEmu:g3.bottomInset}),left:lge({insetPx:e?.insets?.left,insetEmu:e?.leftInset,defaultInsetEmu:g3.leftInset})}}function nNt(e){const t={top:cge(e?.insets?.top,e?.topInset),right:cge(e?.insets?.right,e?.rightInset),bottom:cge(e?.insets?.bottom,e?.bottomInset),left:cge(e?.insets?.left,e?.leftInset)};return Object.values(t).some(n=>n!==void 0)?t:void 0}function lge({insetPx:e,insetEmu:t,defaultInsetEmu:n}){if(e!==void 0){return e}if(t!==void 0){return Bo(t)}return Bo(n)}function cge(e,t){if(e!==void 0){return e}if(t!==void 0){return Bo(t)}return void 0}function ik(e,t,n){const r=Yme(e,n).map(o=>{if(e.fontReference?.color===void 0||o?.textStyle?.fill===void 0){return o}const a={...o.textStyle};a.fill=void 0;return{...o,textStyle:a}});const i=r[0];return{lineSpacingPercent:i?.paragraphStyle?.lineSpacingPercent,spaceBefore:i?.spaceBefore,spaceAfter:i?.spaceAfter,paragraphLevels:r}}function cj(e){return cg(e)}var rNt=$Ft;var iNt=new Nme;var hLr=new ege(rNt,iNt);var pLr=new sge;var mLr={colorMap:{tx1:"#000000"},lineStyleMap:{},effectMap:{}};function oNt(e,t){let n=0;let r=0;let i=0;let o=0;if(t?.bboxPx){({x:n,y:r,width:i,height:o}=t.bboxPx)}else if(e.bbox){const m=e.bbox.xEmu??0;const g=e.bbox.yEmu??0;const x=e.bbox.widthEmu??0;const w=e.bbox.heightEmu??0;n=m*ti;r=g*ti;i=x*ti;o=w*ti}const a=t?.resolvedStyle??e.textStyle;const s=t?.paddingPx??cj(a);const l=s?.left??0;const u=s?.right??0;const d=s?.top??0;const f=s?.bottom??0;const h=i-(l+u);return{elementStyle:a,box:{x:n+l+Math.min(0,h)/2,y:r+d,width:Math.max(0,h),height:Math.max(0,o-(d+f))}}}function _p(e,t,n){if(!e.paragraphs||e.paragraphs.length===0){return void 0}const{elementStyle:r,box:i}=oNt(e,n);const o=t.colorMap?.["tx1"]??"#000000";if(e4t(e)){const s=t4t({element:e,elementStyle:r,themeMap:t,defaultTextFill:o,textScale:n?.textScale??1,boxWidthPx:i.width,boxHeightPx:i.height,fontMetrics:rNt,measureCache:iNt});if(!s?.length){return void 0}return{lines:s}}const a=hLr.layout({element:e,elementStyle:r,themeMap:t,defaultTextFill:o,textScale:n?.textScale??1,wrap:n?.wrap??true,boxWidthPx:i.width,defaultTabStopTwips:n?.defaultTabStopTwips,masterDefaults:n?.masterDefaults,paragraphSpacingUnit:n?.paragraphSpacingUnit,layoutProfile:n?.layoutProfile,documentGridLinePitchTwips:n?.documentGridLinePitchTwips});if(!a.lines.length){return void 0}return{lines:a.lines}}function y3(e,t,n,r,i){if(!t.lines.length){return void 0}const{elementStyle:o,box:a}=oNt(e,i);const s=i?.themeMap??mLr;return pLr.render({ctx:n,lines:t.lines,box:a,themeMap:s,defaultTextFill:s.colorMap?.["tx1"]??"#000000",anchor:o?.anchor??1,rotationDeg:o?.rotation??0,draw:i?.mode!=="layout",linkRects:r,pictureFillBitmaps:i?.pictureFillBitmaps})}function ed(e,t,n,r,i){const o=_p(e,n,i);if(!o){return void 0}return y3(e,o,t,r,{...i,themeMap:n})}var E7e=null;var C7e=null;var S7e=null;var aNt=null;var lNt=null;function cNt(e){E7e=e}function uNt(e){C7e=e}function dNt(e){S7e=e}function fNt(e){lNt=e}function hNt(){return lNt}function zz(){if(!E7e){throw new Error(["Workbook help plugin is not installed.","Load it with:"," const { installWorkbookHelp } = await import('@oai/granola/plugins/workbook-help');"," installWorkbookHelp();"].join("\n"))}return E7e}function k7e(){if(!C7e){throw new Error(["Workbook export plugin is not installed.","Load it with:"," const { installWorkbookExport } = await import('@oai/granola/plugins/workbook-export');"," installWorkbookExport();"].join("\n"))}return C7e}function pNt(){if(!S7e){throw new Error(["Presentation help plugin is not installed.","Load it with:"," const { installPresentationHelp } = await import('@oai/granola/plugins/presentation-help');"," installPresentationHelp();"].join("\n"))}return S7e}function R7e(){if(!aNt){throw new Error(["Google Sheets plugin is not installed.","Load it with:"," const { installGoogleSheetsPlugin } = await import('@oai/granola/plugins/google-sheets');"," installGoogleSheetsPlugin();"].join("\n"))}return aNt}var A7e=null;var sNt=false;function mNt(e){A7e=e}function $b(e){if(!A7e){if(!sNt){sNt=true;console.warn(["Preset shape definitions are not installed.","Some shapes will not render until you load:"," const { installPresetShapeDefinitions } = await import('@oai/granola/plugins/preset-shape-definitions');"," installPresetShapeDefinitions();"].join("\n"))}return void 0}const t=A7e;return t[e]}var ok=6e4;function gLr(e){return e*Math.PI/180}function Uz(e){return gLr(e/ok)}var uge={cd4:90*ok,cd2:180*ok,"3cd4":270*ok,"5cd4":450*ok,"7cd4":630*ok,"3cd2":540*ok,cd:360*ok};function gNt(e,t){if(e in t)return t[e];if(e in uge)return uge[e];if(/^-?\d+$/.test(e))return parseInt(e,10);return Number.NaN}var yNt={val:e=>e,"+-":(e,t,n)=>e+t-n,"*/":(e,t,n)=>e*t/(n||1),sum:(...e)=>e.reduce((t,n)=>t+n,0),prod:(...e)=>e.reduce((t,n)=>t*n,1),min:(...e)=>Math.min(...e),max:(...e)=>Math.max(...e),abs:e=>Math.abs(e),mid:(e,t)=>(e+t)/2,mod:(...e)=>{if(e.length===0)return Number.NaN;return Math.hypot(...e)},sqrt:e=>Math.sqrt(Math.max(e,0)),sin:(e,t)=>t===void 0?Math.sin(Uz(e)):e*Math.sin(Uz(t)),cos:(e,t)=>t===void 0?Math.cos(Uz(e)):e*Math.cos(Uz(t)),tan:(e,t)=>t===void 0?Math.tan(Uz(e)):e*Math.tan(Uz(t)),at2:(e,t)=>{const n=Math.atan2(t,e);const r=n*180/Math.PI;return r*ok},cat2:(e,t,n)=>e*Math.cos(Math.atan2(n,t)),sat2:(e,t,n)=>e*Math.sin(Math.atan2(n,t)),pin:(...e)=>{if(e.length!==3)throw new Error("pin expects 3 arguments");{const[t,n,r]=e;if(typeof t==="number"&&typeof n==="number"&&typeof r==="number"&&!Number.isNaN(n)&&!Number.isNaN(t)&&!Number.isNaN(r)){const i=Math.min(t,r),o=Math.max(t,r);return Math.min(Math.max(n,i),o)}}{const[t,n,r]=e;if(typeof t==="number"&&typeof n==="number"&&typeof r==="number"){const i=Math.min(n,r),o=Math.max(n,r);return Math.min(Math.max(t,i),o)}}return Number.NaN},"?:":(e,t,n)=>e>0?t:n,"+/":(...e)=>{if(e.length===0)return Number.NaN;const t=(e.length>=2?e[e.length-1]:2)||2;const n=(e.length>=2?e.slice(0,-1):e).reduce((r,i)=>r+i,0);return n/t}};function uj(e,t){const n=e.trim().split(/\s+/);const r=n[0];if(!r)return Number.NaN;if(yNt[r]){const i=n.slice(1).map(o=>gNt(o,t));if(i.some(o=>typeof o!=="number"||Number.isNaN(o))){return Number.NaN}return yNt[r](...i)}if(n.length===1&&n[0]){const i=gNt(n[0],t);return typeof i==="number"&&!Number.isNaN(i)?i:Number.NaN}throw new Error(`Unsupported formula: ${e}`)}function R0(e,t){if(!e)return Number.NaN;if(/^(val|\+-|\*\/|\+\/|sum|prod|min|max|abs|mid|mod|sqrt|sin|cos|tan|at2|cat2|sat2|pin|\?:)(?:\s|$)/.test(e))return uj(e,t);if(e in t){const n=t[e];return typeof n==="number"&&!Number.isNaN(n)?n:Number.NaN}if(e in uge){const n=uge[e];return typeof n==="number"&&!Number.isNaN(n)?n:Number.NaN}if(/^-?\d+$/.test(e))return parseInt(e,10);return Number.NaN}var bNt={adj1:"a1",adj2:"a2",adj3:"a3",adj4:"a4",adj5:"a5",adj6:"a6",adj7:"a7",adj8:"a8"};function ak(e,t,n,r={}){const i=yLr(t,n);const o=e.avLst??{};for(const[l,u]of Object.entries(o)){const d=r[l]??u;i[l]=uj(d,i);if(bNt[l]){const f=bNt[l];i[f]=i[l]}}const a=e.gdLst??{};const s=[];for(const[l,u]of Object.entries(a)){const d=uj(u,i);if(Number.isNaN(d)){s.push([l,u]);continue}i[l]=d}for(const[l,u]of s){i[l]=uj(u,i)}return i}function yLr(e,t){const n=Math.min(e,t);const r={w:e,h:t,l:0,t:0,r:e,b:t,hc:e/2,vc:t/2,ss:n,wd2:e/2,wd3:e/3,wd4:e/4,wd5:e/5,wd6:e/6,wd8:e/8,wd10:e/10,wd12:e/12,wd32:e/32,hd2:t/2,hd3:t/3,hd4:t/4,hd5:t/5,hd6:t/6,hd8:t/8,hd10:t/10,ssd2:n/2,ssd6:n/6,ssd8:n/8,ssd16:n/16,ssd32:n/32};return r}function Vz({element:e,bboxPx:t,source:n}){const r=e?.shape;const i=n?.geometry??r?.geometry;const o=n?.preset??(i===void 0?void 0:$b(i));const a=o?.rect;if(!a){return t}const s=ak(o,t.width,t.height,bLr(n?.adjustmentList??r?.adjustmentList));const l=dge(a.l,s,0);const u=dge(a.t,s,0);const d=dge(a.r,s,t.width);const f=dge(a.b,s,t.height);const h=d-l;const m=f-u;if(!Number.isFinite(l)||!Number.isFinite(u)||!Number.isFinite(h)||!Number.isFinite(m)||h<=0||m<=0){return t}return{x:t.x+l,y:t.y+u,width:h,height:m}}function bLr(e){const t={};for(const n of e??[]){if(n.name!==void 0&&n.formula!==void 0){t[n.name]=n.formula}}return t}function dge(e,t,n){if(e===void 0){return n}return R0(e,t)}function xNt(e){const{element:t,presentation:n,slide:r,wrap:i,textScale:o}=e;const{themeMap:a}=r.resolveRenderContext();const s=ZA();const l=$f(t,n,r);const u=Vz({element:t,bboxPx:l});const d=e.resolvedStyle??A0(t,n,r);const f=cj(d);const h=ed(t,s,a,void 0,{mode:"layout",resolvedStyle:d,masterDefaults:ik(t,n,r),bboxPx:u,paddingPx:f,textScale:o,wrap:i});const m=Math.max(0,u.width-(f.left+f.right));const g=Math.max(0,u.height-(f.top+f.bottom));const x=h?.lines??[];const w=x.reduce((C,A)=>Math.max(C,A.widthPx),0);const _=h?.unrotatedHeight??h?.height??0;return{outerWidthPx:l.width,outerHeightPx:l.height,textFrameWidthPx:u.width,textFrameHeightPx:u.height,contentWidthPx:m,contentHeightPx:g,maxLineWidthPx:w,textHeightPx:_,paddingPx:f}}function vNt(e){const{element:t,presentation:n,slide:r,wrap:i}=e;const o=e.minScale??.1;const a=e.maxIterations??20;let s=o;let l=1;let u=o;for(let d=0;d0?i/n:i,height:r>0?o/r:o}}function _Nt(e){return P7e(e).height}var xLr=8;function Rd(e,t,n){const r=t?`${t}.${n}`:n;const i=A4(`${e}:${r}`,xLr);return`${e}/${i}`}function fge(e,t){const n=e.trim();if(!n){return void 0}const r=vLr(n,t.prefix,t.aliases??[]);if(!r){return void 0}const i=Array.from(t.localIds).filter(a=>typeof a==="string"&&a.length>0);if(i.length===0){return void 0}if(i.includes(r)){return r}if(!t.slideId){return void 0}const o=`${t.prefix}/${r}`;return i.find(a=>Rd(t.prefix,t.slideId,a)===o)}function vLr(e,t,n){const r=e.indexOf("/");if(r===-1){return e}if(r<=0||r===e.length-1){return void 0}const i=e.slice(0,r).trim().toLowerCase();const o=new Set([t,...n.map(a=>a.toLowerCase())]);if(!o.has(i)){return void 0}return e.slice(r+1).trim()}function hge(e){return{index:e,color:void 0}}function _Lr(e){const t=e.lineReference!==void 0||e.fillReference!==void 0||e.effectReference!==void 0||e.fontReference!==void 0;if(!t){return}e.lineReference??=hge("0");e.fillReference??=hge("0");e.effectReference??=hge("0");e.fontReference??=hge("major")}var bm=class{context;data;#e;#t;#n;#r;#i;#a=false;#o=false;constructor(t,n){this.context=t;this.context.fontFamilyCache?.addTextStyle(n.textStyle);this.context.fontFamilyCache?.addLevelStyles(n.levelsStyles);this.context.fontFamilyCache?.addElements(n.children);this.#r=KA.fromProto(n.bbox);this.#r.setChangeHandler(i=>{this.recordPositionSet(i)});this.#i=new EE(n.effects);const r=this.#s(n.id);this.data={id:r,name:n.name??"",zIndex:n.zIndex,type:n.type??0,children:n.children??[],levelsStyles:n.levelsStyles??[],citations:n.citations??[],placement:n.placement,placeholderIndex:n.placeholderIndex,placeholderType:n.placeholderType,placeholderHasCustomPrompt:n.placeholderHasCustomPrompt,hyperlink:n.hyperlink,fill:n.fill,line:n.line,lineReference:n.lineReference,fillReference:n.fillReference,effectReference:n.effectReference,fontReference:n.fontReference,shape:n.shape,pictureHasPresetGeometry:n.pictureHasPresetGeometry,useBackgroundFill:n.useBackgroundFill,chartReference:n.chartReference,imageReference:n.imageReference,video:n.video,table:n.table,embeddedArtifact:n.embeddedArtifact,smartArt:n.smartArt,codeBlock:n.codeBlock,connector:n.connector,creationId:n.creationId??Ob(),hidden:n.hidden};this.#e=new Hv(this.#l(),n.paragraphs??[]);this.#n=n.textStyle?new ko(n.textStyle):void 0}get name(){return this.data.name??""}set name(t){this.data.name=t;this.recordShapeSet({name:t})}get slideId(){return this.context.getSlide?.().id}get paragraphs(){return this.#e}get placeholderIndex(){return this.data.placeholderIndex}get placeholderType(){return this.data.placeholderType}get placeholderTypeCandidates(){return c3(this.placeholderType,{additionalSourceTypes:[this.data.placeholderType]})}get hasPlaceholderMetadata(){return this.placeholderIndex!==void 0||this.placeholderType!==void 0||this.data.placeholderType!==void 0}get hyperlink(){return this.data.hyperlink}get effects(){return this.#i}get placement(){return this.data.placement?structuredClone(this.data.placement):void 0}set placement(t){this.data.placement=t?structuredClone(t):void 0;this.#E()}get text(){if(!this.#t){this.#t=new Yv(this.#e,{getDefaultTextStyle:()=>this.#n,setDefaultTextStyle:t=>{if(t instanceof ko||t===void 0){this.#n=t??void 0;return}if(t===null){this.#n=void 0;return}this.#n=new ko(t)},resolveTextStyle:t=>this.context.getTextStyleByName(t),listPresetProfile:this.context.getListPresetProfile?.()??"presentation",onLayoutInvalidated:()=>this.#h(),onMutated:()=>this.#E(),record:{recordOp:t=>this.recordPatchOp(t),getTargetRef:()=>this.recordTargetRef(),getAnchorId:()=>this.recordTargetRef()}})}return this.#t}set text(t){this.text.set(t)}get textStyle(){return this.#n}set textStyle(t){this.#n=t;this.#E()}get rotation(){return this.#r.rotation}get zIndex(){return this.data.zIndex}get hidden(){return this.data.hidden}set zIndex(t){this.data.zIndex=t;this.recordShapeSet({zIndex:t})}set rotation(t){if(t===void 0||t===null){this.#r.rotation=void 0;return}this.#r.rotation=t;this.recordShapeSet({position:{rotation:t}})}get levelsStyles(){return this.data.levelsStyles}get position(){return this.#r}set position(t){if(t===void 0){this.#r.reset();this.#h();return}if(t instanceof KA){this.#r=t.clone();this.#h();return}this.#r.merge(t);this.#h();this.recordPositionSet(this.#_(t))}get frame(){const{left:t,top:n,width:r,height:i}=this.position;if(t===void 0||n===void 0||r===void 0||i===void 0){return void 0}return{left:t,top:n,width:r,height:i}}resolveFrame(){const t=this.#d(this.#r.toPartialRect());if(t){return t}const n=this.#c();if(n){return this.#p(n)}return this.#p({left:0,top:0,width:0,height:0})}set frame(t){if(t===void 0){this.#r.reset();this.#h();return}const n={};if(t.left!==void 0){n.left=t.left}if(t.top!==void 0){n.top=t.top}if(t.width!==void 0){n.width=t.width}if(t.height!==void 0){n.height=t.height}if(Object.keys(n).length===0){return}this.#r.merge(n);this.#h();this.recordPositionSet(n)}get previewFrame(){return this.#r.getPreviewRect()}set previewFrame(t){this.#r.setPreview(t)}clearPreviewFrame(){this.#r.clearPreview()}commitPreviewFrame(){const t=this.#r.getPreviewRect();if(!t){return}this.frame=t;this.#r.clearPreview()}#s(t){const n=this.context.getSlide?.();const r=[...n?.elements?.items.map(i=>i.id)??[],...this.context.getExistingElementIds?.()??[]];if(t&&t.trim().length>0&&!r.includes(t)&&(!n?.id||TLr(t))){return t}return FCt(r)}getParagraphs(){return this.#e}#l(){return{...this.context,fontFamilyCache:this.context.fontFamilyCache,getResolvedParagraphTextStyle:t=>this.context.getResolvedParagraphTextStyle?.(t,this.#n),getResolvedParagraphStyle:t=>this.context.getResolvedParagraphStyle?.(t),getResolvedRunTextStyle:(t,n)=>this.context.getResolvedRunTextStyle?.(t,n,this.#n)}}#c(){const t=this.placeholderIndex;const n=new Set(this.placeholderTypeCandidates);if(t===void 0&&n.size===0){return void 0}const r=this.context.getPresentation?.();const i=this.context.getSlide?.();if(!r||!i){return void 0}const{layout:o,masterLayout:a}=i.resolveRenderContext();const s=this.#u(o,t,n);if(s){return s}return this.#u(a,t,n)}#u(t,n,r){const i=this.#f(t,n,r);if(!i){return void 0}const o=i.resolveFrame();return this.#m(o)?o:void 0}#f(t,n,r){if(!t){return void 0}if(n!==void 0){const i=t.elements.find(o=>o.placeholderIndex===n);if(i){return i}}if(r.size===0){return void 0}return t.elements.find(i=>{const o=i.placeholderTypeCandidates;return o.some(a=>r.has(a))})}#d(t){if(t.width===void 0||t.height===void 0||t.width<=0||t.height<=0){return void 0}return{left:t.left??0,top:t.top??0,width:t.width,height:t.height,rotation:t.rotation,horizontalFlip:t.horizontalFlip,verticalFlip:t.verticalFlip}}#p(t){const n=this.#r.toPartialRect();return{left:n.left??t.left,top:n.top??t.top,width:n.width!==void 0&&n.width>0?n.width:t.width,height:n.height!==void 0&&n.height>0?n.height:t.height,rotation:n.rotation??t.rotation,horizontalFlip:n.horizontalFlip??t.horizontalFlip,verticalFlip:n.verticalFlip??t.verticalFlip}}#m(t){return t.width>0&&t.height>0}toProto(){if(this.#a&&!this.#o){this.#g()}const t={...this.data,effects:this.#i.toProto(),textStyle:this.#n?.toProto(),paragraphs:this.#e.toProto()};const n=this.#r.toProto();if(n){t.bbox=n}_Lr(t);return t}#h(){if(this.#o){return}this.#a=true;this.#g()}#g(){const t=this.#n;if(!t){this.#a=false;return}const n=t.autoFit;if(!n){t.autoFitScale=void 0;t.autoFitLineSpaceReduction=void 0;this.#a=false;return}if(this.#e.toPlainText().length===0){t.autoFitScale=void 0;t.autoFitLineSpaceReduction=void 0;this.#a=false;return}const r=this.context.getPresentation?.();const i=this.context.getSlide?.();if(!r||!i){return}const o=this.#y();const a=t.wrap!=="none";this.#o=true;try{if(n==="shrinkText"){const s=vNt({element:o,presentation:r,slide:i,wrap:a});t.autoFitScale=s}else if(n==="resizeShapeToFitText"){const s=_Nt({element:o,presentation:r,slide:i,wrap:a});const l=this.frame;const u=l?.height;if(u!==void 0&&s>u){this.#r.merge({height:s})}}else{t.autoFitScale=void 0;t.autoFitLineSpaceReduction=void 0}}finally{this.#o=false;this.#a=false;this.context.invalidateRenderContextCache?.()}}#y(){const t={...this.data,effects:this.#i.toProto(),textStyle:this.#n?.toProto(),paragraphs:this.#e.toProto()};const n=this.#r.toProto();if(n){t.bbox=n}return t}recordShapeSet(t){if(!Object.values(t).some(i=>i!==void 0)){return}this.#E();const n=this.#x();if(!n||!n.startsWith("sh/")){return}const r=this.recordTargetRef(n);if(!r){return}this.recordPatchOp({op:"shape.set",target:r,props:t})}recordPositionSet(t){this.recordShapeSet({position:t})}elementAnchor(){return this.#x()}recordTargetRef(t){const n=t??this.#x();if(!n){return void 0}const r=this.context.getPresentation?.()?.getRecorder?.();if(!r){return n}return r.targetRefForElement(this,n)}recordPatchOp(t){this.#E();const n=this.context.getPresentation?.();n?.queuePresentationCollabPublish();const r=n?.getRecorder?.();if(!r){return}r.record(t)}#x(){const t=this.#v();if(!t){return void 0}const n=this.context.getSlide?.().id;if(!n||!this.data.id){return void 0}return Rd(t,n,this.data.id)}#v(){switch(this.data.type){case 5:case 1:case 2:return"sh";case 4:case 6:return"ch";case 3:case 7:return"im";case 9:return"tb";case 11:return"ea";default:return void 0}}#_(t){if(!t||t instanceof KA){return void 0}const n={};if(t.left!==void 0)n.left=t.left;if(t.top!==void 0)n.top=t.top;if(t.width!==void 0)n.width=t.width;if(t.height!==void 0)n.height=t.height;if(t.rotation!==void 0)n.rotation=t.rotation;if(t.horizontalFlip!==void 0){n.horizontalFlip=t.horizontalFlip}if(t.verticalFlip!==void 0){n.verticalFlip=t.verticalFlip}return Object.keys(n).length>0?n:void 0}#E(){this.context.onElementMutated?.(this.data.id)}};var TLr=e=>{const t=e.trim();if(!t){return false}const n=Number(t);return Number.isFinite(n)&&n>0};var TNt=e=>{if(!e){return void 0}return e.split(";")[0]?.trim().toLowerCase()};var pge=e=>{if(!e||e.byteLength<4){return void 0}if(e.byteLength>=8&&e[0]===137&&e[1]===80&&e[2]===78&&e[3]===71&&e[4]===13&&e[5]===10&&e[6]===26&&e[7]===10){return"image/png"}if(e[0]===255&&e[1]===216&&e[2]===255){return"image/jpeg"}if(e.byteLength>=4&&e[0]===71&&e[1]===73&&e[2]===70&&e[3]===56){return"image/gif"}if(e.byteLength>=12&&e[0]===82&&e[1]===73&&e[2]===70&&e[3]===70&&e[8]===87&&e[9]===69&&e[10]===66&&e[11]===80){return"image/webp"}return void 0};var wLr=new Set([192,193,194,195,197,198,199,201,202,203,205,206,207]);var I7e=(e,t,n)=>{if(t+n.length>e.byteLength){return false}for(let r=0;r{if(e.byteLength<24){return void 0}if(e[0]!==137||e[1]!==80||e[2]!==78||e[3]!==71){return void 0}const t=new DataView(e.buffer,e.byteOffset,e.byteLength);const n=t.getUint32(16);const r=t.getUint32(20);if(n<=0||r<=0){return void 0}return{width:n,height:r}};var CLr=e=>{if(e.byteLength<10){return void 0}if(!I7e(e,0,"GIF")){return void 0}const t=new DataView(e.buffer,e.byteOffset,e.byteLength);const n=t.getUint16(6,true);const r=t.getUint16(8,true);if(n<=0||r<=0){return void 0}return{width:n,height:r}};var SLr=e=>{if(e.byteLength<4){return void 0}const t=new DataView(e.buffer,e.byteOffset,e.byteLength);if(t.getUint8(0)!==255||t.getUint8(1)!==216){return void 0}let n=2;while(n+9e.byteLength){break}if(wLr.has(r)){const o=(t.getUint8(n+5)<<8)+t.getUint8(n+6);const a=(t.getUint8(n+7)<<8)+t.getUint8(n+8);if(a<=0||o<=0){return void 0}return{width:a,height:o}}n+=2+i}return void 0};var ALr=e=>{if(e.byteLength<30){return void 0}if(!I7e(e,0,"RIFF")||!I7e(e,8,"WEBP")){return void 0}const t=new DataView(e.buffer,e.byteOffset,e.byteLength);const n=String.fromCharCode(t.getUint8(12),t.getUint8(13),t.getUint8(14),t.getUint8(15));const r=20;switch(n){case"VP8X":{if(e.byteLength>14&16383)+1;if(o<=0||a<=0){return void 0}return{width:o,height:a}}case"VP8 ":{if(e.byteLength{const n=TNt(t)??pge(e);switch(n){case"image/png":return ELr(e);case"image/jpeg":case"image/jpg":return SLr(e);case"image/gif":return CLr(e);case"image/webp":return ALr(e);default:return void 0}};var gge=(e,t,n)=>{if(Number.isNaN(e)){return t}return Math.min(Math.max(e,t),n)};var yge=(e,t,n,r)=>({l:Math.round(gge(e,0,1)*1e5),t:Math.round(gge(t,0,1)*1e5),r:Math.round(gge(n,0,1)*1e5),b:Math.round(gge(r,0,1)*1e5)});var M7e=(e,t,n,r)=>{const i=t/n;if(e==="contain"){let s=0;let l=0;if(r>i){const u=t/r;l=(n-u)/2/n}else if(ri){o=(1-i/r)/2}else if(r{if(e<=0||t<=0||n<=0){return{width:0,height:0,offsetX:0,offsetY:0}}const r=e/t;let i=e;let o=t;if(n>r){o=e/n}else if(ni.trim()).filter(i=>i.length>0);if(t.length===0){return null}const n={};let r=false;for(const i of t){if(i.startsWith("bg-")){const s=i.slice("bg-".length);const l=pz(s);if(l){n.fill=new gi({type:"solid",color:{type:"rgb",value:l.hex,transform:l.alpha===void 0?void 0:{opacity:l.alpha}}}).toConfig();r=true}continue}const o=bge(i);if(o!==null){n.borderRadius=o;r=true;continue}const a=YI(i);if(a){n.shadow=a;r=true}}return r?n:null}function D7e(e){const t=e?.trim();return t&&t.length>0?t:void 0}function F7e(e){if(!e){return null}return RN(e)}function $z(e){if(typeof e==="number"){if(!Number.isFinite(e)||e<0){throw new Error("borderRadius must be a non-negative finite number (px).")}return e}const t=e.trim();if(!t){throw new Error("borderRadius cannot be an empty string.")}const n=bge(t);if(n!==null){return n}const r=Number(t);if(Number.isFinite(r)&&r>=0){return r}throw new Error(`Unsupported borderRadius token: "${e}"`)}function N7e(e,t){if(e===void 0){return void 0}const n=YI(e);if(n){if(n==="shadow-none"){return void 0}const i={"shadow-none":0,"shadow-sm":4,shadow:5,"shadow-md":6,"shadow-lg":7,"shadow-xl":8,"shadow-2xl":9};const o=i[n];if(!Number.isFinite(o)||o<=0){return void 0}return{index:String(o),color:void 0}}const r=xz(e);if(!r||r.kind==="none"){return void 0}if(!t){throw new Error(`Custom shadow "${e}" requires a presentation theme context.`)}return{index:t.ensureEffectStyle(r.effectStyle),color:void 0}}function O7e(e,t){if(qv(e.x,t.x)||qv(e.y,t.y)){return[e,t]}const n=(e.x+t.x)/2;return[e,{x:n,y:e.y},{x:n,y:t.y},t]}function ENt(e){const t=[];for(const n of e){if(n.cmd==="moveTo"||n.cmd==="lineTo"){t.push({x:n.x,y:n.y})}else if(n.cmd==="cubicBezTo"){t.push({x:n.x,y:n.y})}}return Gz(t)}function Gz(e){if(e.length<2){return e}const t=[];for(const r of e){const i=t[t.length-1];if(i&&PLr(i,r)){continue}t.push(r)}if(t.length<=2){return t}const n=[t[0]];for(let r=1;r=Math.abs(r)){return n>=0?3:1}return r>=0?2:0}function z7e(e,t,n){return{x:e.x+t.x*n,y:e.y+t.y*n}}function CNt(e){for(let t=0;t1e5){return 1e5}return e}var SNt=5e4;var DLr=e=>{if(e<0)return 0;if(e>SNt)return SNt;return e};var dj=e=>{const{widthPx:t,heightPx:n,radiusPx:r}=e;if(!Number.isFinite(t)||t<=0){return void 0}if(!Number.isFinite(n)||n<=0){return void 0}if(!Number.isFinite(r)||r<0){return void 0}const i=Math.min(t,n);const o=Math.round(r/i*1e5);const a=DLr(o);return[{name:"adj",formula:`val ${a}`}]};var Tge="application/octet-stream";var FLr={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".svg":"image/svg+xml"};function NLr(e){const t=e.split(/[?#]/)[0]??e;return t.trim().toLowerCase()}function ANt(e){const t=NLr(e);const n=Object.entries(FLr);for(const[r,i]of n){if(t.endsWith(r)){return i}}return void 0}function _ge(e,t,n){if(typeof e==="number"){return fj(e,0,1)}const r=e.trim();const i=/^(\d+(?:\.\d+)?)%$/.exec(r);if(i){return fj(Number(i[1])/100,0,1)}const o=/^(\d+(?:\.\d+)?)px$/i.exec(r);if(o){if(t===void 0){throw new Error(`${n} uses px units but the image dimensions are unavailable.`)}return fj(Number(o[1])/t,0,1)}throw new Error(`${n} must be a number, a "[number]%" string, or a "[number]px" string.`)}function OLr(e){const t=globalThis;const n=t["Buffer"];if(n&&typeof n.from==="function"){const i=n.from(e,"base64");return i instanceof Uint8Array?i:new Uint8Array(i)}const r=t["atob"];if(typeof r==="function"){const i=r(e);const o=new Uint8Array(i.length);for(let a=0;a0)||typeof e.prompt==="string"||typeof e.uri==="string"}function PNt(e){const t={};const n="blob"in e&&RNt(e.blob)?CE(e):void 0;if("alt"in e&&e.alt!==void 0){t["alt"]=e.alt}if("fit"in e&&e.fit!==void 0){t["fit"]=e.fit}if(n?.contentType){t["contentType"]=n.contentType}else if("contentType"in e&&e.contentType!==void 0){t["contentType"]=e.contentType}if("position"in e&&e.position!==void 0){t["position"]={...e.position}}if("frame"in e&&e.frame!==void 0){t["frame"]={...e.frame}}if("crop"in e&&e.crop!==void 0){t["crop"]={...e.crop}}if("geometry"in e&&e.geometry!==void 0){t["geometry"]=e.geometry}if("borderRadius"in e&&e.borderRadius!==void 0){t["borderRadius"]=e.borderRadius}if(n?.prompt!==void 0){t["prompt"]=n.prompt}else if("prompt"in e&&typeof e.prompt==="string"){t["prompt"]=e.prompt}if("path"in e&&typeof e.path==="string"){t["path"]=e.path}if("uri"in e&&typeof e.uri==="string"){t["uri"]=e.uri}if("dataUrl"in e&&typeof e.dataUrl==="string"){t["dataUrl"]=e.dataUrl}if(n?.data&&n.data.length>0&&n.contentType){t["dataUrl"]=`data:${n.contentType};base64,${BLr(n.data)}`}return t}var fj=(e,t,n)=>{if(Number.isNaN(e)){return t}return Math.min(Math.max(e,t),n)};var GLr=Object.entries(yf).reduce((e,[t,n])=>{if(t==="custom"||t==="connector"||t==="textbox"){return e}if(e[n]===void 0){e[n]=t}return e},{});var INt=e=>{return"path"in e||"blob"in e||"dataUrl"in e||"uri"in e};function HLr(e){const{options:t}=e;if("fit"in t&&t.fit!==void 0){return t}if(!INt(t)){return t}if((e.frameWidth??0)<=0||(e.frameHeight??0)<=0){return t}return{...t,fit:e.currentFit??"cover"}}var ug=class extends bm{type="image";#e;#t;#n;#r;#i;#a;#o;#s;#l;#c;#u=false;constructor(t,n){super(t,n);this.data.line=n.line;this.data.imageReference=n.imageReference?.id?{id:n.imageReference.id}:void 0;if(this.data.type===void 0||this.data.type===0){this.data.type=7}const r=n.image;this.#n=r?.alt??"";this.#r=void 0;this.#t=void 0;this.#e=false;this.#i=false;this.#a=this.#S(n);this.#o=this.#C(n);this.#s=n.imageMask?.adjustmentList?.map(i=>({...i}));this.#l=void 0;this.#c=void 0;if(!this.data.imageReference&&r){const i={};if(r.data&&r.data.length>0){i.data=new Uint8Array(r.data);i.contentType=r.contentType&&r.contentType.length>0?r.contentType:Tge}else if(r.contentType){i.contentType=r.contentType}const o=this.context.createImageAsset(i);this.setImageReference(o.id)}this.data.shape=void 0;this.data.image=void 0;this.#x()}get id(){return this.data.id}get aid(){return this.slideId?kNt("im",this.slideId,this.id):void 0}toSnapshot(){this.#x();const t=this.slideId;const n=this.id;return{aid:kNt("im",t,n),kind:"image",id:n,slideId:t,name:this.name,alt:this.alt,prompt:this.prompt,isPlaceholder:this.isPlaceholder,contentType:this.image?.contentType,fit:this.fit,geometry:this.geometry,crop:this.crop,rotation:this.rotation,flipHorizontal:this.flipHorizontal,flipVertical:this.flipVertical,lockAspectRatio:this.lockAspectRatio,frame:this.frame}}get image(){const t=this.data.imageReference?.id;if(!t){return void 0}return this.context.getImageById(t)}get imageReferenceId(){return this.data.imageReference?.id}async getBitmap(){const t=this.image;if(!t){if(this.prompt||this.isPlaceholder){return void 0}console.warn("Image element missing asset",{elementId:this.id});return void 0}if(this.#E(t)){return void 0}const n=this.resolveFrame();try{return await t.getBitmap(n.width,n.height)}catch(r){console.warn("Image element asset decode failure",{elementId:this.id,assetId:t.id,contentType:t.contentType,uri:t.uri??null},r);return void 0}}get alt(){return this.#n}set alt(t){this.#n=t??"";this.#k({alt:this.#n})}get prompt(){this.#x();return this.#r}set prompt(t){const n=this.#v(t);if(n){this.#g().prompt=n}else{const r=this.image;if(r){r.prompt=void 0}}this.#r=n;this.#i=Boolean(n&&!this.#_(this.image));this.#A()}get isPlaceholder(){this.#x();return this.#i}set isPlaceholder(t){this.#i=Boolean(t);this.#A()}get fit(){return this.#t}set fit(t){this.#t=t;this.#k({fit:t})}get geometry(){return this.#o}get line(){return new eo({type:"proto",proto:this.data.line})}set geometry(t){if(!t){this.#o=void 0;this.#s=void 0;this.#l=void 0;this.data.shape=void 0;this.#k({geometry:void 0});return}this.#o=t;this.#s=void 0;if(t!=="roundRect"){this.#l=void 0}this.data.shape=void 0;this.#k({geometry:t})}get borderRadius(){return this.#l}set borderRadius(t){if(t===void 0){this.#s=void 0;this.#l=void 0;this.#A();return}if(this.#o!==void 0&&this.#o!=="rect"&&this.#o!=="roundRect"){throw new Error("image.borderRadius only supports rect or roundRect image masks.")}const n=$z(t);this.#s=void 0;this.#l=t;if(n>0){this.#o="roundRect"}else if(this.#o==="roundRect"){this.#o=void 0}this.data.shape=void 0;this.#A();this.#k({borderRadius:t})}get lockAspectRatio(){return this.#e}set lockAspectRatio(t){this.#e=Boolean(t);this.#k({lockAspectRatio:this.#e})}get crop(){if(!this.#a){return void 0}return{...this.#a}}set crop(t){if(!t){this.#a=void 0;if(this.data.fill?.srcRect){this.data.fill={...this.data.fill,srcRect:void 0}}this.#k({crop:void 0});return}const n=this.#m();const r={left:_ge(t.left,n?.width,"image.crop.left"),top:_ge(t.top,n?.height,"image.crop.top"),right:_ge(t.right,n?.width,"image.crop.right"),bottom:_ge(t.bottom,n?.height,"image.crop.bottom")};this.#a=r;const i=a=>Math.round(fj(a,0,1)*1e5);const o=this.data.fill??{id:"",type:0,color:void 0,gradientStops:[],pictureEffects:[]};o.type=o.type??0;if(!Array.isArray(o.gradientStops)){o.gradientStops=[]}o.srcRect={l:i(r.left),t:i(r.top),r:i(r.right),b:i(r.bottom)};this.data.fill=o;this.#k({crop:r})}get width(){return this.position.width}set width(t){const n=Number.isFinite(t)?Math.max(0,t):0;const r=this.#f();const i=this.#e?this.#d(r):void 0;r.width=n;if(i&&i>0&&this.#e){r.height=n/i}this.position=r}get height(){return this.position.height}set height(t){const n=Number.isFinite(t)?Math.max(0,t):0;const r=this.#f();const i=this.#e?this.#d(r):void 0;r.height=n;if(i&&i>0&&this.#e){r.width=n*i}this.position=r}get size(){return{width:this.position.width,height:this.position.height}}set size(t){const n=this.#f();if(t.width!==void 0){n.width=t.width}if(t.height!==void 0){n.height=t.height}this.position=n}get flipHorizontal(){return this.position.horizontalFlip}set flipHorizontal(t){this.position.horizontalFlip=Boolean(t)}get flipVertical(){return this.position.verticalFlip}set flipVertical(t){this.position.verticalFlip=Boolean(t)}replace(t){const n=HLr({options:t,currentFit:this.fit,frameWidth:this.position.width,frameHeight:this.position.height});this.#w(()=>{if("alt"in n&&n.alt!==void 0){this.alt=n.alt}if("fit"in n&&n.fit!==void 0){this.fit=n.fit;this.lockAspectRatio=true}if("prompt"in n){this.prompt=n.prompt}else if(INt(n)){this.prompt=void 0}const r=CE(n);this.applyAssetPayload(r);this.#x()});this.#P(n)}regenerate(t={}){const n=this.context.getPresentation?.();if(!n){throw new Error("Image regeneration is not available in this context.")}const r=this.elementAnchor();const i=this.slideId;if(!r||!r.startsWith("im/")||!i){throw new Error("Image regeneration requires a slide-anchored image.")}const o=t.prompt??this.prompt??this.image?.prompt;const a=typeof o==="string"&&o.trim().length>0?o.trim():void 0;if(!a){throw new Error("image.regenerate requires a prompt. Set image.prompt or pass { prompt }.")}this.prompt=a;const s={requestId:`imggen_${ec()}`,aid:r,slideId:i,elementId:this.id,prompt:a,kind:t.kind??"content",fit:t.fit??this.fit??"contain",frameWidthPx:this.frame?.width,frameHeightPx:this.frame?.height,size:t.size,quality:t.quality,background:t.background,outputFormat:t.outputFormat,source:"image.regenerate"};n.queueImageGenerationRequest(s)}delete(){const t=this.elementAnchor();if(t&&t.startsWith("im/")){const n=this.recordTargetRef(t);if(n){this.recordPatchOp({op:"image.remove",target:n})}}this.context.deleteElement?.(this.id)}setImageReference(t){this.data.imageReference=t?{id:t}:void 0;this.#c=void 0;this.#x()}resolveFrame(){const t=super.resolveFrame();if(this.#t!=="contain"||!this.#e){return t}if(t.width<=0||t.height<=0){return t}const n=this.#p();if(!n){return t}const{width:r,height:i,offsetX:o,offsetY:a}=L7e(t.width,t.height,n);if(r<=0||i<=0){return t}return{...t,left:t.left+o,top:t.top+a,width:r,height:i}}resolveImageFill(){const t=this.data.fill?.pictureEffects;if(!this.#t||!this.#e){return{srcRect:this.data.fill?.srcRect,stretchFillRect:this.data.fill?.stretchFillRect,pictureEffects:t}}const n=super.resolveFrame();if(n.width<=0||n.height<=0){return{srcRect:this.data.fill?.srcRect,stretchFillRect:this.data.fill?.stretchFillRect,pictureEffects:t}}const r=this.#p();if(!r){return{srcRect:this.data.fill?.srcRect,stretchFillRect:this.data.fill?.stretchFillRect,pictureEffects:t}}if(this.#t==="contain"){return{pictureEffects:t}}return{...M7e(this.#t,n.width,n.height,r),pictureEffects:t}}resolveImageMask(){if(!this.#o){return void 0}return{geometry:this.#o,adjustmentList:this.#T()??[]}}toProto(){const t=super.toProto();if(t.image){t.image=void 0}if(t.imageReference&&!t.imageReference.id){t.imageReference=void 0}if(t.shape){t.shape=void 0}this.#h(t);const n=this.#b();t.imageMask=n;return t}applyAssetPayload(t){if(!$Lr(t)){return}const n=this.#g();this.#y(n,t);this.#x()}recordPositionSet(t){this.#k({position:t})}#f(){return this.position.toJSON()}#d(t){const n=t.width??0;const r=t.height??0;if(n<=0||r<=0){return void 0}return n/r}#p(){if(this.#c!==void 0){return this.#c}const t=this.#m();if(!t){return void 0}const n=t.width/t.height;if(!Number.isFinite(n)||n<=0){return void 0}this.#c=n;return n}#m(){const t=this.image;if(!t){return void 0}const n=t.data;return n&&n.byteLength>0?mge(n,t.contentType):void 0}#h(t){if(!this.#t||!this.#e){return}const n=this.position.width;const r=this.position.height;if(n<=0||r<=0){return}const i=this.#p();if(!i){return}if(this.#t==="contain"){const{width:s,height:l,offsetX:u,offsetY:d}=L7e(n,r,i);if(s>0&&l>0){const f=t.bbox?{...t.bbox}:{};const h=this.position.left;const m=this.position.top;f.xEmu=Qi(h+u);f.yEmu=Qi(m+d);f.widthEmu=Qi(s);f.heightEmu=Qi(l);t.bbox=f}if(t.fill){t.fill={...t.fill,srcRect:void 0,stretchFillRect:void 0}}return}const o=M7e(this.#t,n,r,i);const a=t.fill?{...t.fill}:{id:"",type:0,color:void 0,gradientStops:[],pictureEffects:[]};a.type=a.type??0;if(!Array.isArray(a.gradientStops)){a.gradientStops=[]}a.srcRect=o.srcRect;a.stretchFillRect=o.stretchFillRect;t.fill=a}#g(){let t=this.image;if(!t){t=this.context.createImageAsset();this.setImageReference(t.id)}return t}#y(t,n){if(n.data||n.uri!==void 0||n.contentType){this.#c=void 0}if(n.data){t.data=n.data;if(!n.contentType){n.contentType=Tge}t.uri=n.uri??void 0;t.prompt=n.prompt??void 0}if(n.contentType){t.contentType=n.contentType}if(n.uri!==void 0){t.uri=n.uri;if(!n.data){t.data=new Uint8Array}}else if(n.data){t.uri=void 0}if(n.prompt!==void 0){t.prompt=n.prompt}else if(n.data||n.uri){t.prompt=void 0}}#x(){const t=this.image;const n=this.#v(t?.prompt??this.#r);this.#r=n;this.#i=Boolean(n&&!this.#_(t))}#v(t){if(typeof t!=="string"){return void 0}const n=t.trim();return n.length>0?n:void 0}#_(t){if(!t){return false}if(t.data.byteLength>0){return true}return typeof t.uri==="string"&&t.uri.trim().length>0}#E(t){return Boolean(this.prompt&&!this.#_(t))}#S(t){const n=t.fill?.srcRect;if(!n){return void 0}const r=i=>{if(i===void 0){return 0}return fj(i,0,1e5)/1e5};return{left:r(n.l),top:r(n.t),right:r(n.r),bottom:r(n.b)}}#C(t){const n=t;const r=n.imageMask?.geometry;if(r!==void 0){if(r in yf&&r!=="custom"&&r!=="connector"){return r}}const i=n.image?.mask?.geometry;if(typeof i==="string"){if(i in yf&&i!=="custom"&&i!=="connector"){return i}}const o=t.shape?.geometry;if(o===void 0||o===0||o===-1){return void 0}return GLr[o]}#b(){const t=this.resolveImageMask();if(!t){return void 0}const n={geometry:t.geometry,cropLeft:0,cropTop:0,cropRight:0,cropBottom:0,adjustmentList:t.adjustmentList};return n}#T(){if(this.#l===void 0){return this.#s}if(this.#o!=="roundRect"){return void 0}const t=$z(this.#l);if(t<=0){return void 0}return dj({widthPx:this.position.width,heightPx:this.position.height,radiusPx:t})}#k(t){if(this.#u){return}this.#A();if(!Object.values(t).some(i=>i!==void 0)){return}const n=this.elementAnchor();if(!n||!n.startsWith("im/")){return}const r=this.recordTargetRef(n);if(!r){return}this.recordPatchOp({op:"image.set",target:r,props:t})}#P(t){if(this.#u){return}const n=this.elementAnchor();if(!n||!n.startsWith("im/")){return}const r=this.recordTargetRef(n);if(!r){return}this.recordPatchOp({op:"image.replace",target:r,props:VLr(t)})}#A(){this.context.getPresentation?.()?.queuePresentationCollabPublish()}#w(t){const n=this.#u;this.#u=true;try{t()}finally{this.#u=n}}};function kNt(e,t,n){return Rd(e,t,n)}bs();var MNt="__IF_TRUE_SENTINEL__";var LNt="__IF_FALSE_SENTINEL__";var WLr=1e-12;var YLr=15;var GNt=Symbol("rangeMetadata");function pa(e){const t=e.map(r=>r.map(i=>Vo(i)?xs("#VALUE!"):i));const n=t.reduce((r,i)=>Math.max(r,i.length),0);for(const r of t){while(r.length[...t])}function U7e(e,t){const n=e.values.map(r=>r.map(i=>t(i)));return pa(n)}function G7e(e,t,n){if(Vo(e)&&Vo(t)){if(e.rows!==t.rows||e.cols!==t.cols){return xs("#VALUE!")}const r=[];for(let i=0;in(r,t))}if(Vo(t)){return U7e(t,r=>n(e,r))}return n(e,t)}function x3(e,t){Object.defineProperty(e,GNt,{value:t,enumerable:false,configurable:false})}function v3(e){if(!Array.isArray(e)){return null}const t=e;return t[GNt]??null}function Cge(e,t){const n=v3(e);if(n){x3(t,n)}}function Ey(e,t){switch(e.kind){case"NumberLiteral":return e.value;case"StringLiteral":return e.value;case"BooleanLiteral":return e.value;case"ErrorLiteral":return xs(e.value);case"ArrayLiteral":return pa(e.elements.map(n=>n.map(r=>Ey(r,t))));case"RangeRef":return HNt(e.ref,t);case"FunctionCall":return rDr(e,t);case"CallExpr":return oDr(e,t);case"UnaryOp":return XLr(e,t);case"BinaryOp":return jLr(e,t);case"MissingArg":return null;default:return xs("#NOT_IMPLEMENTED!")}}function XLr(e,t){const n=Ey(e.expr,t);if(zi(n)){return n}if(Vo(n)){return U7e(n,r=>DNt(e.op,r))}return DNt(e.op,n)}function DNt(e,t){const n=pj(t);if(zi(n)){if(e==="+"){return t}return n}const r=n;switch(e){case"-":return-r;case"+":return r;case"%":return r/100;default:return xs("#VALUE!")}}function jLr(e,t){if(e.op===":"){return KLr(e.left,e.right,t)}const n=Ey(e.left,t);if(zi(n)){return n}const r=Ey(e.right,t);if(zi(r)){return r}switch(e.op){case"+":case"-":case"*":case"/":case"^":return JLr(e.op,n,r);case"&":return QLr(n,r);case"=":case"<>":case"<":case">":case"<=":case">=":return eDr(e.op,n,r);default:return xs("#VALUE!")}}function KLr(e,t,n){const r=FNt(e,n);if(zi(r)){return r}const i=FNt(t,n);if(zi(i)){return i}const o=r.sheet?.sheetName??i.sheet?.sheetName??n.currentSheet;if(!o){return xs("#REF!")}const a=r.sheet?.sheetName??o;const s=i.sheet?.sheetName??o;if(a!==s){return xs("#REF!")}const l={...r,sheet:{sheetName:a}};const u={...i,sheet:{sheetName:s}};const d=H7e({kind:"Range",start:l,end:u},n);return pa(d)}function FNt(e,t){if(e.kind==="RangeRef"&&e.ref.kind==="Cell"){const n=e.ref.addr.sheet?.sheetName??t.currentSheet;if(!n){return xs("#REF!")}return{...e.ref.addr,sheet:{sheetName:n}}}if(e.kind==="FunctionCall"){const n=e.name.toUpperCase();if(n==="INDEX"||n==="_XLFN.INDEX"){return ZLr(e,t)}}return xs("#VALUE!")}function ZLr(e,t){const n=e.args[0];const r=e.args[1];const i=e.args[2];if(!n||!r||!i){return xs("#VALUE!")}const o=b3(n,t);if(!Array.isArray(o)){return xs("#REF!")}const a=v3(o);if(!a){return xs("#REF!")}const s=wge(b3(r,t));if(zi(s)){return s}const l=wge(b3(i,t));if(zi(l)){return l}const u=pj(s);if(zi(u)){return u}const d=pj(l);if(zi(d)){return d}if(!Number.isInteger(u)||!Number.isInteger(d)){return xs("#VALUE!")}if(u<1||d<1){return xs("#VALUE!")}const f=a[u-1]?.[d-1];if(!f){return xs("#REF!")}const h=f.sheet?.sheetName??t.currentSheet;if(!h){return xs("#REF!")}return{...f,sheet:{sheetName:h}}}function JLr(e,t,n){if(Vo(t)||Vo(n)){return G7e(t,n,(r,i)=>NNt(e,r,i))}return NNt(e,t,n)}function NNt(e,t,n){const r=pj(t);if(zi(r)){return r}const i=pj(n);if(zi(i)){return i}const o=r;const a=i;switch(e){case"+":return o+a;case"-":return o-a;case"*":return o*a;case"/":if(a===0){return xs("#DIV/0!")}return o/a;case"^":return Number.isNaN(o)||Number.isNaN(a)?xs("#NUM!"):Math.pow(o,a);default:return xs("#VALUE!")}}function QLr(e,t){if(Vo(e)||Vo(t)){return G7e(e,t,(n,r)=>ONt(n,r))}return ONt(e,t)}function ONt(e,t){const n=Ege(e);if(zi(n)){return n}const r=Ege(t);if(zi(r)){return r}return`${n}${r}`}function eDr(e,t,n){if(Vo(t)||Vo(n)){return G7e(t,n,(r,i)=>BNt(e,r,i))}return BNt(e,t,n)}function BNt(e,t,n){const r=$7e(t);const i=$7e(n);if(zi(r)){return r}if(zi(i)){return i}if(typeof r==="number"&&typeof i==="number"){return V7e(e,r,i)}if(typeof r==="number"&&i===null&&typeof n==="string"){return UNt(e,{numberOnLeft:true,numberValue:r,textValue:n})}if(typeof i==="number"&&r===null&&typeof t==="string"){return UNt(e,{numberOnLeft:false,numberValue:i,textValue:t})}const o=Ege(t);if(zi(o)){return o}const a=Ege(n);if(zi(a)){return a}return V7e(e,o,a)}function V7e(e,t,n){if(typeof t==="number"&&typeof n==="number"){return nDr(e,t,n)}if(typeof t==="string"&&typeof n==="string"){return tDr(e,t,n)}switch(e){case"=":return t===n;case"<>":return t!==n;case"<":return t":return t>n;case"<=":return t<=n;case">=":return t>=n;default:return false}}function tDr(e,t,n){const r=zNt(t);const i=zNt(n);switch(e){case"=":return r===i;case"<>":return r!==i;case"<":return r":return r>i;case"<=":return r<=i;case">=":return r>=i;default:return false}}function zNt(e){return e.toLocaleUpperCase()}function nDr(e,t,n){const r=$Nt(t);const i=$Nt(n);const o=r-i;const a=Math.abs(o)<=WLr;switch(e){case"=":return a;case"<>":return!a;case"<":return a?false:o<0;case">":return a?false:o>0;case"<=":return a?true:o<0;case">=":return a?true:o>0;default:return false}}function UNt(e,t){const{numberOnLeft:n,numberValue:r,textValue:i}=t;const o=i.trim();if(i===""){const s=0;const l=n?r:s;const u=n?s:r;return V7e(e,l,u)}const a=o==="";if(a){return VNt(e,n)}switch(e){case"=":return false;case"<>":return true;default:return VNt(e,n)}}function VNt(e,t){switch(e){case"<":case"<=":return t;case">":case">=":return!t;case"=":return false;case"<>":return true;default:return xs("#VALUE!")}}function $Nt(e){if(!Number.isFinite(e)){return e}const t=Number(e.toPrecision(YLr));return t}function rDr(e,t){if(t.handleFunctionCall){const r=t.handleFunctionCall(e);if(r!==void 0){return r}}if(e.name.toUpperCase()==="IF"){return iDr(e,t)}const n=[];for(const r of e.args){const i=b3(r,t);n.push(i)}return t.callFunction(e.name,n)}function iDr(e,t){if(e.args.length===0){return xs("#VALUE!")}const n=e.args[0];if(!n){return xs("#VALUE!")}const r=b3(n,t);const i=t.callFunction(e.name,[r,MNt,LNt]);if(i===MNt){const o=e.args[1];if(o&&o.kind!=="MissingArg"){const a=b3(o,t);return wge(a)}return 0}if(i===LNt){const o=e.args[2];if(o&&o.kind!=="MissingArg"){const a=b3(o,t);return wge(a)}return 0}return i}function b3(e,t){if(e.kind==="MissingArg"){return void 0}if(e.kind==="RangeRef"){if(e.ref.kind==="Cell"){const r=e.ref.addr.sheet?.sheetName??t.currentSheet;if(!r){return[[xs("#REF!")]]}const i=YNt(e.ref.addr,t);const o=i?t.getCellValue(i):xs("#REF!");const a=[[o??null]];const s={...e.ref.addr,sheet:{sheetName:r}};x3(a,[[s]]);return a}if(e.ref.kind==="Range"){return H7e(e.ref,t)}if(e.ref.kind==="ColumnRange"){return WNt(e.ref,t)}if(e.ref.kind==="WholeColumn"){return aDr(e.ref,t)}if(e.ref.kind==="WholeRow"){return sDr(e.ref,t)}if(e.ref.kind==="Named"){if(qNt(e.ref.name)){return[[xs("#REF!")]]}const r=t.resolveNamedReference?.(e.ref.name,"range",e.ref.sheet?.sheetName);if(r&&Array.isArray(r)){return r}const i=t.resolveNamedReference?.(e.ref.name,"scalar",e.ref.sheet?.sheetName);if(i!==null&&i!==void 0){if(mj(i)){return xs("#VALUE!")}if(Array.isArray(i)){return i}if(zi(i)){return i}return[[i]]}return xs("#NAME?")}if(e.ref.kind==="Structured"){const r=t.resolveStructuredReference?.(e.ref.reference,"range");if(Array.isArray(r)){return r}if(r!==null&&r!==void 0){if(zi(r)){return r}return[[r]]}return xs("#NAME?")}}const n=Ey(e,t);if(Vo(n)){return qLr(n)}return n}function wge(e){if(e===void 0){return""}if(Array.isArray(e)){return e[0]?.[0]??xs("#VALUE!")}return e}function HNt(e,t){switch(e.kind){case"Cell":{const n=YNt(e.addr,t);if(!n){return xs("#REF!")}return t.getCellValue(n)}case"Spill":return HNt(e.base,t);case"Range":{const n=H7e(e,t);return pa(n)}case"ColumnRange":{const n=WNt(e,t);return pa(n)}case"Named":{if(qNt(e.name)){return xs("#REF!")}const n=t.resolveNamedReference?.(e.name,"scalar",e.sheet?.sheetName);if(n===null||n===void 0){return xs("#NAME?")}if(Array.isArray(n)){return n[0]?.[0]??xs("#VALUE!")}if(zi(n)){return n}if(mj(n)){return xs("#VALUE!")}return n}case"Structured":{const n=t.resolveStructuredReference?.(e.reference,"scalar");if(n===null||n===void 0){return xs("#NAME?")}if(Array.isArray(n)){return n[0]?.[0]??xs("#VALUE!")}if(zi(n)){return n}return n}default:return xs("#VALUE!")}}function oDr(e,t){const n=Ey(e.callee,t);if(!mj(n)){return xs("#VALUE!")}const r=[];for(const i of e.args){r.push(b3(i,t))}return n.invoke(r,t)}function H7e(e,t){const n=e.start.sheet?.sheetName??e.end.sheet?.sheetName??t.currentSheet;if(!n){return[[{kind:"Error",code:"#REF!"}]]}const r=Math.min(e.start.row,e.end.row);const i=Math.max(e.start.row,e.end.row);const o=Math.min(e.start.col,e.end.col);const a=Math.max(e.start.col,e.end.col);const s=[];const l=[];for(let u=r;u<=i;u+=1){const d=[];const f=[];for(let h=o;h<=a;h+=1){const m={sheet:{sheetName:n},row:u,col:h,absRow:false,absCol:false};f.push(m);const g=t.cellAddressToKey(m);if(!g){d.push({kind:"Error",code:"#REF!"});continue}d.push(t.getCellValue(g))}s.push(d);l.push(f)}x3(s,l);return s}function WNt(e,t){const n=e.sheet?.sheetName??t.currentSheet;if(!n){return[[xs("#REF!")]]}if(!t.getColumnExtent){return[]}const r=Math.min(e.startCol,e.endCol);const i=Math.max(e.startCol,e.endCol);let o=Infinity;let a=-Infinity;for(let u=r;u<=i;u+=1){const d=t.getColumnExtent(n,u);if(!d){continue}o=Math.min(o,d.startRow);a=Math.max(a,d.endRow)}if(!Number.isFinite(o)||!Number.isFinite(a)){return[]}const s=[];const l=[];for(let u=o;u<=a;u+=1){const d=[];const f=[];for(let h=r;h<=i;h+=1){const m={sheet:{sheetName:n},row:u,col:h,absRow:false,absCol:false};f.push(m);const g=t.cellAddressToKey(m);if(!g){d.push({kind:"Error",code:"#REF!"});continue}d.push(t.getCellValue(g))}s.push(d);l.push(f)}x3(s,l);return s}function aDr(e,t){const n=e.sheet?.sheetName??t.currentSheet;if(!n){return[[xs("#REF!")]]}const r=t.getColumnExtent?.(n,e.col);if(!r){return[]}const i=[];const o=[];for(let a=r.startRow;a<=r.endRow;a+=1){const s={sheet:{sheetName:n},row:a,col:e.col,absRow:false,absCol:false};o.push([s]);const l=t.cellAddressToKey(s);i.push([t.getCellValue(l)])}x3(i,o);return i}function sDr(e,t){const n=e.sheet?.sheetName??t.currentSheet;if(!n){return[[xs("#REF!")]]}const r=t.getRowExtent?.(n,e.row);if(!r){return[]}const i=[];const o=[];for(let s=r.startCol;s<=r.endCol;s+=1){const l={sheet:{sheetName:n},row:e.row,col:s,absRow:false,absCol:false};o.push(l);const u=t.cellAddressToKey(l);i.push(t.getCellValue(u))}const a=[i];x3(a,[o]);return a}function pj(e){const t=$7e(e);if(t===null){return xs("#VALUE!")}return t}function $7e(e){if(Vo(e)){return xs("#VALUE!")}if(zi(e)){return e}if(mj(e)){return xs("#VALUE!")}if(e==null){return 0}if(typeof e==="number"){return e}if(typeof e==="boolean"){return e?1:0}if(typeof e==="string"){if(e===""){return 0}const t=e.trim();if(t===""){return null}const n=Number(e);return Number.isNaN(n)?null:n}return null}function Ege(e){if(Vo(e)){return xs("#VALUE!")}if(zi(e)){return e}if(mj(e)){return xs("#VALUE!")}if(e==null){return""}return String(e)}function YNt(e,t){const n=e.sheet?.sheetName??t.currentSheet;if(!n){return null}const r={...e,sheet:{sheetName:n}};return t.cellAddressToKey(r)}function xs(e){return{kind:"Error",code:e}}function zi(e){return typeof e==="object"&&e!==null&&e.kind==="Error"}function mj(e){return typeof e==="object"&&e!==null&&e.kind==="Lambda"}function qNt(e){if(typeof e!=="string"){return false}const t=e.trim().toUpperCase();if(t==="#REF!"){return true}if(t.endsWith("!#REF!")){return true}const n=t.lastIndexOf("!");if(n>=0){return t.slice(n+1)==="#REF!"}return false}var lDr=(h=>{h["automatic"]="Automatic";h["sum"]="Sum";h["count"]="Count";h["average"]="Average";h["max"]="Max";h["min"]="Min";h["product"]="Product";h["countNumbers"]="CountNumbers";h["standardDeviation"]="StandardDeviation";h["standardDeviationP"]="StandardDeviationP";h["variance"]="Variance";h["varianceP"]="VarianceP";return h})(lDr||{});var cDr=(a=>{a["none"]="None";a["percentOfColumnTotal"]="PercentOfColumnTotal";a["percentOfRowTotal"]="PercentOfRowTotal";a["percentOfGrandTotal"]="PercentOfGrandTotal";a["differenceFrom"]="DifferenceFrom";a["percentDifferenceFrom"]="PercentDifferenceFrom";return a})(cDr||{});var uDr=(j=>{j["before"]="Before";j["after"]="After";j["between"]="Between";j["equals"]="Equals";j["yesterday"]="Yesterday";j["today"]="Today";j["tomorrow"]="Tomorrow";j["thisWeek"]="ThisWeek";j["lastWeek"]="LastWeek";j["nextWeek"]="NextWeek";j["thisMonth"]="ThisMonth";j["lastMonth"]="LastMonth";j["nextMonth"]="NextMonth";j["thisQuarter"]="ThisQuarter";j["lastQuarter"]="LastQuarter";j["nextQuarter"]="NextQuarter";j["thisYear"]="ThisYear";j["lastYear"]="LastYear";j["nextYear"]="NextYear";j["yearToDate"]="YearToDate";j["allDatesInPeriodJanuary"]="AllDatesInPeriodJanuary";j["allDatesInPeriodFebruary"]="AllDatesInPeriodFebruary";j["allDatesInPeriodMarch"]="AllDatesInPeriodMarch";j["allDatesInPeriodApril"]="AllDatesInPeriodApril";j["allDatesInPeriodMay"]="AllDatesInPeriodMay";j["allDatesInPeriodJune"]="AllDatesInPeriodJune";j["allDatesInPeriodJuly"]="AllDatesInPeriodJuly";j["allDatesInPeriodAugust"]="AllDatesInPeriodAugust";j["allDatesInPeriodSeptember"]="AllDatesInPeriodSeptember";j["allDatesInPeriodOctober"]="AllDatesInPeriodOctober";j["allDatesInPeriodNovember"]="AllDatesInPeriodNovember";j["allDatesInPeriodDecember"]="AllDatesInPeriodDecember";return j})(uDr||{});var dDr=(f=>{f["beginsWith"]="BeginsWith";f["endsWith"]="EndsWith";f["contains"]="Contains";f["notContains"]="NotContains";f["equals"]="Equals";f["notEquals"]="NotEquals";f["greaterThan"]="GreaterThan";f["greaterThanOrEqualTo"]="GreaterThanOrEqualTo";f["lessThan"]="LessThan";f["lessThanOrEqualTo"]="LessThanOrEqualTo";f["between"]="Between";return f})(dDr||{});var fDr=(f=>{f["equals"]="Equals";f["notEquals"]="NotEquals";f["greaterThan"]="GreaterThan";f["greaterThanOrEqualTo"]="GreaterThanOrEqualTo";f["lessThan"]="LessThan";f["lessThanOrEqualTo"]="LessThanOrEqualTo";f["between"]="Between";f["topN"]="TopN";f["bottomN"]="BottomN";f["topPercent"]="TopPercent";f["bottomPercent"]="BottomPercent";return f})(fDr||{});var hDr=(l=>{l["general"]="General";l["left"]="Left";l["center"]="Center";l["right"]="Right";l["fill"]="Fill";l["justify"]="Justify";l["centerAcrossSelection"]="CenterAcrossSelection";l["distributed"]="Distributed";return l})(hDr||{});var pDr=(r=>{r["compact"]="Compact";r["outline"]="Outline";r["tabular"]="Tabular";return r})(pDr||{});var mDr=(a=>{a["year"]="Year";a["month"]="Month";a["day"]="Day";a["hour"]="Hour";a["minute"]="Minute";a["second"]="Second";return a})(mDr||{});var XNt={fontSize:11,typeface:"Carlito"};var W7e=[{type:3,color:void 0,gradientStops:[],pictureEffects:[],pattern:{patternType:1,color:void 0}},{type:3,color:void 0,gradientStops:[],pictureEffects:[],pattern:{patternType:18,color:void 0}}];var jNt={numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0};var gj={style:"",color:void 0,indexedColorId:void 0};var KNt={left:{...gj},right:{...gj},top:{...gj},bottom:{...gj},diagonal:{...gj}};var ZNt={index:0,builtinId:"0",name:"Normal",xfId:0};var Y7e={index:0,format:{numFmtId:0,fontId:0,fillId:0,borderId:0}};var JNt={name:"ChatGPT",colorScheme:{name:"ChatGPT",colors:[{name:"accent1",color:{type:1,value:"156082",transform:{}}},{name:"accent2",color:{type:1,value:"E97132",transform:{}}},{name:"accent3",color:{type:1,value:"196B24",transform:{}}},{name:"accent4",color:{type:1,value:"0F9ED5",transform:{}}},{name:"accent5",color:{type:1,value:"A02B93",transform:{}}},{name:"accent6",color:{type:1,value:"4EA72E",transform:{}}},{name:"dk1",color:{type:3,value:"windowText",lastColor:"000000",transform:{}}},{name:"lt1",color:{type:3,value:"window",lastColor:"FFFFFF",transform:{}}},{name:"dk2",color:{type:1,value:"0E2841",transform:{}}},{name:"lt2",color:{type:1,value:"E8E8E8",transform:{}}},{name:"hlink",color:{type:1,value:"467886",transform:{}}},{name:"folHlink",color:{type:1,value:"96607D",transform:{}}}]},fillStyleList:[{type:1,color:{type:2,value:"phClr",transform:{}},gradientStops:[],pictureEffects:[],pattern:void 0},{type:2,color:void 0,gradientStops:[{position:0,color:{type:2,value:"phClr",transform:{lumMod:11e4,satMod:105e3,tint:67e3}}},{position:5e4,color:{type:2,value:"phClr",transform:{lumMod:105e3,satMod:103e3,tint:73e3}}},{position:1e5,color:{type:2,value:"phClr",transform:{lumMod:105e3,satMod:109e3,tint:81e3}}}],pictureEffects:[],gradientKind:1,angleDeg:90,isScaled:false,pattern:void 0},{type:2,color:void 0,gradientStops:[{position:0,color:{type:2,value:"phClr",transform:{satMod:103e3,lumMod:102e3,tint:94e3}}},{position:5e4,color:{type:2,value:"phClr",transform:{satMod:11e4,lumMod:1e5,shade:1e5}}},{position:1e5,color:{type:2,value:"phClr",transform:{lumMod:99e3,satMod:12e4,shade:78e3}}}],pictureEffects:[],gradientKind:1,angleDeg:90,isScaled:false,pattern:void 0}],backgroundFillStyleList:[{type:1,color:{type:2,value:"phClr",transform:{}},gradientStops:[],pictureEffects:[],pattern:void 0},{type:1,color:{type:2,value:"phClr",transform:{tint:95e3,satMod:17e4}},gradientStops:[],pictureEffects:[],pattern:void 0},{type:2,color:void 0,gradientStops:[{position:0,color:{type:2,value:"phClr",transform:{tint:93e3,shade:98e3,lumMod:102e3,satMod:15e4}}},{position:5e4,color:{type:2,value:"phClr",transform:{tint:98e3,shade:9e4,lumMod:103e3,satMod:13e4}}},{position:1e5,color:{type:2,value:"phClr",transform:{shade:63e3,satMod:12e4}}}],pictureEffects:[],gradientKind:1,angleDeg:90,isScaled:false,pattern:void 0}],lineStyleList:[{style:1,widthEmu:12700,fill:{type:1,color:{type:2,value:"phClr",transform:{}},gradientStops:[],pictureEffects:[],pattern:void 0}},{style:1,widthEmu:19050,fill:{type:1,color:{type:2,value:"phClr",transform:{}},gradientStops:[],pictureEffects:[],pattern:void 0}},{style:1,widthEmu:25400,fill:{type:1,color:{type:2,value:"phClr",transform:{}},gradientStops:[],pictureEffects:[],pattern:void 0}}],effectStyleList:[{effects:[]},{effects:[]},{effects:[{type:1,shadow:{color:{type:1,value:"000000",transform:{alpha:63e3}},blurRadius:57150,distance:19050,direction:54e5}}]}]};var gDr={colorSpace:"spreadsheetml"};var Sge=class{#e;#t;#n;#r;#i;#a;#o;#s;#l;#c;#u;#f=0;#d;constructor(t,n){const r=t??{};this.#d=n;const i=r.fonts&&r.fonts.length>0?r.fonts:[XNt];this.#e=i.map(l=>new AE(l));const o=(()=>{const l=r.fills??[];if(l.length===0){return W7e}if(l.length===1){const u=l[0];const d=u?.pattern?.patternType;if(u?.type===3&&d===1){return[...l,W7e[1]]}}return l})();this.#t=o.map(l=>new gi({type:"proto",proto:l}));const a=r.borders&&r.borders.length>0?r.borders:[KNt];this.#n=a.map(l=>new kE(l));this.#i=SE(r.cellStyles);this.#a=SE(r.cellStyleXfs);if(this.#i.length===0){this.#i=[{...ZNt}]}if(this.#a.length===0){const l=Y7e.format;const u=Y7e.index;this.#a=[{index:u,format:l?{...l}:void 0}]}const s=r.cellXfs&&r.cellXfs.length>0?r.cellXfs:[jNt];this.#r=s.map(l=>{const u=new Hz(l);this.#y(u.fontId);const d=this.#a[u.xfId??0]?.format?.fontId;this.#y(d);return u});this.#o=SE(r.dxfs);for(const l of this.#o){this.#d?.addTextStyle(l.font)}this.#s=SE(r.indexedColors);this.#l=SE(r.mruColors);this.#c=(r.numberFormats??[]).map(l=>new Age(l));this.#u=this.#E()}describe(t){const n=typeof t==="number"&&t>=0&&t=0&&tt.toProto()),fills:this.#t.map(t=>{const n=t.toProto();if(!n){throw new Error("Stored fill is missing proto data.")}return n}),cellXfs:this.#r.map(t=>t.toProto()),borders:this.#n.map(t=>t.toProto()),cellStyles:SE(this.#i),cellStyleXfs:SE(this.#a),numberFormats:this.#c.map(t=>t.toProto()),dxfs:SE(this.#o),indexedColors:SE(this.#s),mruColors:SE(this.#l)}}registerDifferentialFormat(t,n){const r={};if(t.fill){const i=t.fill instanceof gi?t.fill:new gi(t.fill);const o=i.toProto();if(o){r.fill=xDr(o)}}if(t.font){const i=new AE;i.bold=t.font.bold;i.italic=t.font.italic;i.size=t.font.size;i.name=t.font.name;if(t.font.color){i.color=t.font.color instanceof Mi?t.font.color:new Mi(t.font.color)}r.font=i.toProto();this.#d?.addTextStyle(r.font)}if(t.border){const i=yDr(t.border);if(i.hasValues()){r.border=i.toProto()}}if(t.numberFormat){const i=this.#_(void 0,t.numberFormat);if(i!==void 0){const o={id:i,formatCode:t.numberFormat};r.numberFormat=o}}if(n){vDr(r,n)}this.#o.push(r);this.#f+=1;return this.#o.length-1}#p(t){if(t===void 0){return void 0}const n=this.#t[t];if(!n){return void 0}return bDr(n)}#m(t){if(t===void 0){return void 0}const n=this.#e[t];return n?n.clone():void 0}#h(t){if(t===void 0){return void 0}const n=this.#n[t];return n?n.clone():void 0}#g(t){const n=t.clone();this.#d?.addFamily(n.name);const r=this.#C(n);if(r!==void 0){return r}this.#e.push(n);return this.#e.length-1}#y(t){if(t===void 0){return}this.#d?.addFamily(this.#e[t]?.name)}#x(t){const n=t.toProto();if(!n){throw new Error("Fill is missing proto data.")}const r=new gi({type:"proto",proto:n});const i=this.#b(r);if(i!==void 0){return i}this.#t.push(r);return this.#t.length-1}#v(t){const n=t.clone();const r=this.#T(n);if(r!==void 0){return r}this.#n.push(n);return this.#n.length-1}#_(t,n){if(n&&n.trim()!==""){const r=this.#c.find(o=>o.formatCode===n);if(r?.id!==void 0){return r.id}const i=this.#u++;this.#c.push(new Age({id:i,formatCode:n}));return i}return t}#E(){const t=this.#c.map(r=>r.id??0).filter(r=>r>0);const n=t.length?Math.max(...t):0;return Math.max(200,n+1)}#S(t){if(t===void 0){return void 0}const n=this.#c.find(r=>r.id===t);return n?.formatCode}#C(t){for(let n=0;nq7e(t))}function q7e(e){if(e===null||e===void 0){return e}if(Array.isArray(e)){return e.map(t=>q7e(t))}if(typeof e==="object"){const t=e;const n={};for(const[r,i]of Object.entries(t)){n[r]=q7e(i)}return n}return e}function kge(e){return JSON.stringify(e??null)}function xDr(e){if(e.type!==1){return e}return{...e,type:3,pattern:{patternType:2,color:e.color}}}function vDr(e,t){if(e.fill?.color){const n=X7e(e.fill.color,t);if(n){e.fill={...e.fill,color:n}}}if(e.font?.fill?.color){const n=X7e(e.font.fill.color,t);if(n){e.font={...e.font,fill:{...e.font.fill,color:n}}}}if(e.border){e.border={...e.border,top:bj(e.border.top,t),bottom:bj(e.border.bottom,t),left:bj(e.border.left,t),right:bj(e.border.right,t),diagonal:bj(e.border.diagonal,t)}}}function bj(e,t){if(!e?.color){return e}const n=X7e(e.color,t);if(!n){return e}return{...e,color:n}}function X7e(e,t){if(e.type!==2&&e.type!==3){return e}const n=Bme(e,t,gDr);const r=_Dr(n);if(!r){return e}const{r:i,g:o,b:a,a:s}=r;const l=f=>f.toString(16).padStart(2,"0");const u=Math.max(0,Math.min(1,s));const d=l(Math.round(u*255));return{type:1,value:`${d}${l(i)}${l(o)}${l(a)}`.toUpperCase(),transform:void 0}}function _Dr(e){const t=e.match(/^rgba?\((\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*([\d.]+))?\)$/i);if(!t){return null}const n=Math.max(0,Math.min(255,Number(t[1])));const r=Math.max(0,Math.min(255,Number(t[2])));const i=Math.max(0,Math.min(255,Number(t[3])));const o=t[4]===void 0?1:Number(t[4]);if([n,r,i,o].some(a=>Number.isNaN(a))){return null}return{r:n,g:r,b:i,a:o}}var PN=(e,t,n)=>({effects:[{type:1,shadow:{color:{type:1,value:"000000",transform:{alpha:Math.round(e*1e5)}},blurRadius:Qi(t),distance:Qi(n),direction:54e5}}]});var w1={name:"ChatGPT",colorScheme:{name:"ChatGPT",colors:[{name:"accent1",color:{type:1,value:"D53D4F",transform:void 0}},{name:"accent2",color:{type:1,value:"FDAE60",transform:void 0}},{name:"accent3",color:{type:1,value:"FEDE8A",transform:void 0}},{name:"accent4",color:{type:1,value:"E4F596",transform:void 0}},{name:"accent5",color:{type:1,value:"66C1A4",transform:void 0}},{name:"accent6",color:{type:1,value:"2F81B4",transform:void 0}},{name:"dk1",color:{type:1,value:"000000",transform:void 0}},{name:"lt1",color:{type:1,value:"FFFFFF",transform:void 0}},{name:"dk2",color:{type:1,value:"0E2841",transform:void 0}},{name:"lt2",color:{type:1,value:"E8E8E8",transform:void 0}},{name:"hlink",color:{type:1,value:"467886",transform:void 0}},{name:"folHlink",color:{type:1,value:"96607D",transform:void 0}}]},fillStyleList:[{type:1,color:{type:2,value:"phClr",transform:void 0},gradientStops:[],pictureEffects:[],pattern:void 0},{type:2,color:void 0,gradientStops:[{position:0,color:{type:2,value:"phClr",transform:{lumMod:11e4,satMod:105e3,tint:67e3}}},{position:5e4,color:{type:2,value:"phClr",transform:{lumMod:105e3,satMod:103e3,tint:73e3}}},{position:1e5,color:{type:2,value:"phClr",transform:{lumMod:105e3,satMod:109e3,tint:81e3}}}],pictureEffects:[],gradientKind:1,angleDeg:90,isScaled:false,pattern:void 0},{type:2,color:void 0,gradientStops:[{position:0,color:{type:2,value:"phClr",transform:{satMod:103e3,lumMod:102e3,tint:94e3}}},{position:5e4,color:{type:2,value:"phClr",transform:{satMod:11e4,lumMod:1e5,shade:1e5}}},{position:1e5,color:{type:2,value:"phClr",transform:{lumMod:99e3,satMod:12e4,shade:78e3}}}],pictureEffects:[],gradientKind:1,angleDeg:90,isScaled:false,pattern:void 0}],backgroundFillStyleList:[{type:1,color:{type:2,value:"phClr",transform:void 0},gradientStops:[],pictureEffects:[],pattern:void 0},{type:1,color:{type:2,value:"phClr",transform:{tint:95e3,satMod:17e4}},gradientStops:[],pictureEffects:[],pattern:void 0},{type:2,color:void 0,gradientStops:[{position:0,color:{type:2,value:"phClr",transform:{tint:93e3,shade:98e3,lumMod:102e3,satMod:15e4}}},{position:5e4,color:{type:2,value:"phClr",transform:{tint:98e3,shade:9e4,lumMod:103e3,satMod:13e4}}},{position:1e5,color:{type:2,value:"phClr",transform:{shade:63e3,satMod:12e4}}}],pictureEffects:[],gradientKind:1,angleDeg:90,isScaled:false,pattern:void 0}],lineStyleList:[{style:1,widthEmu:12700,fill:{type:1,color:{type:2,value:"phClr",transform:void 0},gradientStops:[],pictureEffects:[],pattern:void 0}},{style:1,widthEmu:19050,fill:{type:1,color:{type:2,value:"phClr",transform:void 0},gradientStops:[],pictureEffects:[],pattern:void 0}},{style:1,widthEmu:25400,fill:{type:1,color:{type:2,value:"phClr",transform:void 0},gradientStops:[],pictureEffects:[],pattern:void 0}}],effectStyleList:[{effects:[]},{effects:[]},PN(.16,6,2),PN(.06,2,1),PN(.08,3,1),PN(.1,6,2),PN(.12,12,4),PN(.16,18,6),PN(.24,28,10)]};var TDr=4;var Z7e={display:72,subtitle:48,section:24,body:16,caption:11};var eOt=(e,t={})=>{const n=t.name??"space";const r=Wz(t.step??TDr,`${n}.step`);if(typeof e==="number"){return j7e(e,n)}const i=e.trim().toLowerCase();const o=K7e(i,"px");if(o!==void 0){return j7e(o,n)}if(!i.startsWith("s-")){throw new Error(`${n} token must start with "s-" or use "[number]px".`)}const a=i.slice(2).trim();return j7e(Number(a),`${n} token`)*r};var wDr=(e,t={})=>{const n=t.name??"fontSize";if(typeof e==="number"){return Wz(e,n)}const r=e.trim().toLowerCase();const i=K7e(r,"px");if(i!==void 0){return Wz(i,n)}const o=K7e(r,"pt");if(o!==void 0){return Wz(o*96/72,n)}if(!r.startsWith("text-")){throw new Error(`${n} token must start with "text-" or use "[number]px"/"[number]pt".`)}const a=r.slice(5).trim();if(a.length===0){throw new Error(`${n} token must include a value after "text-".`)}const s=t.fontSizeTokens??Z7e;const l=s[a];if(l!==void 0){return Wz(l,`${n} token`)}const u=Number(a);if(Number.isFinite(u)){return Wz(u,`${n} token`)}const d=Object.keys(s).sort();throw new Error(`${n} token "text-${a}" is unknown. Available text tokens: ${d.join(", ")}`)};var tOt=(e,t={})=>{const{fontSize:n,...r}=e;const i={...r};if(n!==void 0){i.fontSize=wDr(n,{fontSizeTokens:t.fontSizeTokens,name:t.name?`${t.name}.fontSize`:"fontSize"})}return i};var j7e=(e,t)=>{if(!Number.isFinite(e)||e<0){throw new Error(`${t} must be a non-negative number.`)}return e};var Wz=(e,t)=>{if(!Number.isFinite(e)||e<=0){throw new Error(`${t} must be a positive number.`)}return e};var K7e=(e,t)=>{const n=new RegExp(`^(\\d+(?:\\.\\d+)?)\\s*${t}$`,"i").exec(e);return n?Number(n[1]):void 0};var nOt={accent1:new Mi("#156082"),accent2:new Mi("#E97132"),accent3:new Mi("#196B24"),accent4:new Mi("#0F9ED5"),accent5:new Mi("#A02B93"),accent6:new Mi("#4EA72E"),bg1:new Mi("#FFFFFF"),bg2:new Mi("#000000"),tx1:new Mi("#1F1F1F"),tx2:new Mi("#FFFFFF"),dk1:new Mi("#000000"),lt1:new Mi("#FFFFFF"),dk2:new Mi("#0E2841"),lt2:new Mi("#E8E8E8"),hlink:new Mi("#467886"),folHlink:new Mi("#96607D")};var EDr={display:{fontSize:"text-display",bold:true,alignment:"center",wrap:"none"},subtitle:{fontSize:"text-subtitle",italic:true,alignment:"center",wrap:"none"},section:{fontSize:"text-section",bold:true,alignment:"left",wrap:"none"},body:{fontSize:"text-body",alignment:"left",wrap:"square"},caption:{fontSize:"text-caption",alignment:"left",wrap:"none"}};var P0=class{#e;#t;#n;#r;#i;#a;constructor(t,n,r){this.#e=t;void this.#e;this.#a=r;const i=n?.colorScheme?.colors?.reduce((a,s)=>{a[s.name]=new Mi({type:"proto",proto:s.color},r);return a},{})??nOt;const o=Rge(n?.colorScheme?.name)??"ChatGPT";this.#r=Rge(rOt(n))??o;this.#t={name:o,themeColors:i};this.#n={fillStyleList:n?.fillStyleList??w1.fillStyleList,backgroundFillStyleList:n?.backgroundFillStyleList??w1.backgroundFillStyleList,lineStyleList:n?.lineStyleList??w1.lineStyleList,effectStyleList:n?.effectStyleList??w1.effectStyleList};this.#i=n?.fontScheme;if(this.#o()){this.textStyles()}}replaceFromProto(t){const n=t?.colorScheme?.colors?.reduce((i,o)=>{i[o.name]=new Mi({type:"proto",proto:o.color},this.#a);return i},{})??nOt;const r=Rge(t?.colorScheme?.name)??"ChatGPT";this.#r=Rge(rOt(t))??r;this.#t={name:r,themeColors:n};this.#n={fillStyleList:t?.fillStyleList??w1.fillStyleList,backgroundFillStyleList:t?.backgroundFillStyleList??w1.backgroundFillStyleList,lineStyleList:t?.lineStyleList??w1.lineStyleList,effectStyleList:t?.effectStyleList??w1.effectStyleList};this.#i=t?.fontScheme}get lineStyleList(){return this.#n.lineStyleList}get effectStyleList(){return this.#n.effectStyleList}get backgroundFillStyleList(){return this.#n.backgroundFillStyleList}get fillStyleList(){return this.#n.fillStyleList}get fontScheme(){return this.#i}get name(){return this.#r}set name(t){this.#r=t;this.#e.queueCollaborativePublish?.()}set colorScheme(t){this.#t={name:t.name,themeColors:Object.entries(t.themeColors).reduce((n,[r,i])=>{n[r]=new Mi(i,this.#a);return n},{})};this.#e.queueCollaborativePublish?.()}get colorScheme(){return this.#t}get hexColorMap(){return Object.fromEntries(Object.entries(this.#t.themeColors).map(([t,n])=>[t,n?.hex??""]))}resolveThemeColorHex(t){const n=this.#t.themeColors[t];if(!n){return void 0}return n.hex}ensureEffectStyle(t){const n=JSON.stringify(t);const r=this.#n.effectStyleList.findIndex(i=>JSON.stringify(i)===n);if(r>=0){return String(r+1)}this.#n.effectStyleList.push(t);this.#e.queueCollaborativePublish?.();return String(this.#n.effectStyleList.length)}textStyles(t){const n=t??EDr;if(!this.#o()){throw new Error("presentation.theme.textStyles(...) requires a presentation-backed theme context.")}const r={};for(const[i,o]of Object.entries(n)){const a=CDr(i);const s=this.#e.addTextStyle(a);const l=tOt(o,{fontSizeTokens:Z7e,name:`presentation.theme.textStyles(${a})`});Uf(s,l);r[i]=a}return r}toProto(){const t={name:this.#r,colorScheme:{name:this.#t.name,colors:Object.entries(this.#t.themeColors).map(([n,r])=>({name:n,color:r.toProto()}))},fillStyleList:this.#n.fillStyleList,backgroundFillStyleList:this.#n.backgroundFillStyleList,lineStyleList:this.#n.lineStyleList,effectStyleList:this.#n.effectStyleList,fontScheme:this.#i};return t}#o(){return typeof this.#e.addTextStyle==="function"&&typeof this.#e.resolveTextStyle==="function"}};var CDr=e=>{const t=e.trim();if(t.length===0){throw new Error("theme text style names must be non-empty.")}return t};var Rge=e=>{return e!==void 0&&e.length>0?e:void 0};var rOt=e=>e?.name;var SDr={accent1:"accent1",accent2:"accent2",accent3:"accent3",accent4:"accent4",accent5:"accent5",accent6:"accent6",bg1:"lt1",tx1:"dk1",bg2:"lt2",tx2:"dk2",hlink:"hlink",folHlink:"folHlink"};function Fh(e){const t=new P0({stub:()=>{}},e);return SN(t,SDr)}Yl();var lOt=Ui(_3());var xj={colorSpace:"spreadsheetml"};var Q7e="indexed:";function H5o(e){const t=e?.size??11;const n=e?.bold?"bold ":"";const r=e?.italic?"italic ":"";const i=e?.family?`"${e.family}", sans-serif`:"sans-serif";return`${n}${r}${t}px ${i}`}function cOt(e,t,n){if(!t?.transform)return e;return oo({type:1,value:e,transform:t.transform},n,xj)}function uOt(e,t,n){if(!e?.startsWith(Q7e))return void 0;const r=parseInt(e.slice(Q7e.length),10);if(Number.isNaN(r))return void 0;const i=uz(r);return i?cOt(i,t,n):void 0}function Pge(e,t,n){const r=uz(t);if(r){return n?cOt(r,e,n):r}if(e?.type!==3||typeof e.value!=="string"||n===void 0){return void 0}return uOt(e.value,e,n)}var oOt=lOt.default.get_table();var aOt={5:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',41:'_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)'};function sOt(e,t,n,r,i,o,a){if(!e||!t)return;const s=!r||e.applyAlignment||e.applyAlignment===void 0;if(e.numFmtId!=null){n.numberFormatId=e.numFmtId;const l=t.numberFormats?.find(u=>u.id===e.numFmtId);if(l?.formatCode){n.numberFormatCode=l.formatCode}else if(oOt[e.numFmtId]){n.numberFormatCode=oOt[e.numFmtId]}else if(aOt[e.numFmtId]){n.numberFormatCode=aOt[e.numFmtId]}else{n.numberFormatCode=void 0}}if(e.fillId!=null&&(!r||e.applyFill||e.applyFill===void 0)){const l=t.fills?.[e.fillId];const u=l?.pattern?.patternType;const d=u===2;const f=!!(l?.color||l?.pattern?.color);if(l?.color){const h=Pge(l.color,void 0,i)??oo(l.color,i,xj);if(h)n.fill=h}else{const h=l?.pattern?.color;const m=Pge(h,void 0,i);if(m){n.fill=m}else if(h?.value){const g=h.value;n.fill=HBe(g)}else if(d&&!f){n.fill="#000000"}}}if(e.fontId!=null&&((!r||e.applyFont)??true)){const l=t.fonts[e.fontId];const u=n.font??={};if(typeof l?.fontSize==="number"){const h=l.fontSize*(96/72);u.size=h;(n.fontSources??={}).size=o}if(l?.bold!=null){u.bold=l.bold;(n.fontSources??={}).bold=o}if(l?.italic!=null){u.italic=l.italic;(n.fontSources??={}).italic=o}if(l?.underline!=null){u.underline=!!l.underline;(n.fontSources??={}).underline=o}const d=l?.typeface??l?.name;if(d){u.family=d;(n.fontSources??={}).family=o}const f=l?.fill?.color;if(f){let h;if(f.type===3&&typeof f.value==="string"){if(f.value==="auto"){h="#000000"}else{h=uOt(f.value,f,i)}}if(!h){h=oo(f,i,xj)}if(h){u.color=h;n.textColor=h;(n.fontSources??={}).color=o}}}if(e.horizontalAlignment&&s){switch(e.horizontalAlignment){case"left":case"center":case"right":n.align=e.horizontalAlignment;break;default:break}}if(e.verticalAlignment&&s){const l=String(e.verticalAlignment).toLowerCase();switch(l){case"top":n.verticalAlign=1;break;case"center":case"middle":n.verticalAlign=2;break;case"bottom":n.verticalAlign=3;break}}if(e.wrapText!==void 0&&s){n.wrapText=e.wrapText}if(e.borderId!=null&&(!r||e.applyBorder||e.applyBorder===void 0)){const l=t.borders[e.borderId];if(l){n.borders??={};n.borderStyles??={};const u=(d,f)=>{if(d){const h=d.type===3;const m=d.value;if(d.type===2&&typeof m==="string"&&m.startsWith("theme:")){const g=oo(d,i,xj);if(g)return g}if(d.type===1&&typeof m==="string"){const g=m.replace(/^#/i,"");if(g.length===8){return HBe(g)}if(g.length===6){return`#${g}`}}if(h&&m==="auto"){return"#000000"}if(h&&m?.startsWith(Q7e)){const g=Pge(d,f,i);if(g)return g}return oo(d,i,xj)}return Pge(void 0,f,i)};if(l.left?.style){let d=u(l.left.color,l.left.indexedColorId);if(!d)d="#000000";if(d)n.borders.left=d;n.borderStyles.left=l.left.style;(n.borderSources??={}).left=o}if(l.right?.style){let d=u(l.right.color,l.right.indexedColorId);if(!d)d="#000000";if(d)n.borders.right=d;n.borderStyles.right=l.right.style;(n.borderSources??={}).right=o}if(l.top?.style){let d=u(l.top.color,l.top.indexedColorId);if(!d)d="#000000";if(d)n.borders.top=d;n.borderStyles.top=l.top.style;(n.borderSources??={}).top=o}if(l.bottom?.style){let d=u(l.bottom.color,l.bottom.indexedColorId);if(!d)d="#000000";if(d)n.borders.bottom=d;n.borderStyles.bottom=l.bottom.style;(n.borderSources??={}).bottom=o}if(l.diagonal?.style){let d=u(l.diagonal.color,l.diagonal.indexedColorId);if(!d)d="#000000";if(d)n.borders.diagonal=d;n.borderStyles.diagonal=l.diagonal.style;(n.borderSources??={}).diagonal=o}if(l.diagonalUp!=null)n.borderDiagonalUp=!!l.diagonalUp;if(l.diagonalDown!=null)n.borderDiagonalDown=!!l.diagonalDown}}}function kDr(e,t){if(!t)return e;const n={...e};if(n.fontId!=null&&n.fontId===t.fontId){n.fontId=void 0}if(n.fillId!=null&&n.fillId===t.fillId){n.fillId=void 0}if(n.borderId!=null&&n.borderId===t.borderId){n.borderId=void 0}if(n.numFmtId!=null&&n.numFmtId===t.numFmtId){n.numFmtId=void 0}return n}function jv(e){const{styles:t}=e;const n=Fh(e.theme);const r={};if(!t)return r;t.cellXfs.forEach((i,o)=>{const a={};const s=i.xfId!=null&&t.cellStyleXfs&&t.cellStyleXfs[i.xfId]?t.cellStyleXfs[i.xfId]?.format:void 0;if(s){sOt(s,t,a,false,n,"base",`base:${o}`)}sOt(kDr(i,s),t,a,true,n,"cell",`cell:${o}`);r[o]=a});return r}var RDr=11*96/72;var dOt=7;var PDr="0123456789";function vj(e){const t=e[0]?.font;const n={style:t?.italic?"italic":"normal",weight:t?.bold?"700":"normal",family:TE(t?.family,"spreadsheet")};const r=t?.size??RDr;let i;try{i=ZA()}catch{return dOt}i.font=DT(n,r);let o=0;for(const a of PDr){o=Math.max(o,i.measureText(a).width)}return o>0?o:dOt}var fOt=Ui(_3());function IDr(e){return e.replace(/([0#?])((?:,+))\.([0#?]+)/g,(t,n,r,i)=>`${n}.${i}${r}`)}function T3(e,t,n,r){if(e.value===""||e.value==null){return""}const i=r??e.styleIndex??0;const o=t[i]??{};const a=o.numberFormatCode??(o.numberFormatId!=null?`#${o.numberFormatId}`:"");const s=n?`${e.value}||${a}`:void 0;if(s&&n?.has(s))return n.get(s)??"";let l=e.value;const u=o.numberFormatCode??o.numberFormatId;if(u!==void 0&&u!==null){const d=Number(e.value);if(!Number.isNaN(d)){try{const f=typeof u==="string"?IDr(u):u;l=fOt.default.format(f,d)}catch{l=e.value}}}if(s)n?.set(s,l);return l}Yl();function Yz(e,t){const n=typeof e.defaultColWidth==="number"&&e.defaultColWidth>0?e.defaultColWidth:typeof e.baseColWidth==="number"&&e.baseColWidth>0?e.baseColWidth:LA;const r=og(n,t);const i=[];const o=e.columns?.reduce((u,d)=>Math.max(u,(d.max??d.min??1)-1),0)??0;const a=e.rows?.reduce((u,d)=>{const f=d.cells?.reduce((h,m)=>Math.max(h,ps(m.address??"A1")),0)??0;return Math.max(u,f)},0)??0;const s=e.mergedCells?.reduce((u,d)=>Math.max(u,ps(d.endAddress??d.startAddress)),0)??0;const l=Math.max(1,Math.max(o,a,s)+1);for(let u=0;uMath.max(a,(s.index??1)-1),0)??0;const i=e.mergedCells?.reduce((a,s)=>Math.max(a,vl(s.endAddress??s.startAddress)-1),0)??0;const o=Math.max(1,Math.max(r,i)+1);for(let a=0;a=n.length)continue;if(a.hidden){n[s]=0;continue}if((a.customHeight||a.height!==0)&&a.height!=null){n[s]=Bu(a.height)}}return n}Yl();bs();var Xz=e=>{if(!e)return void 0;let t=e.replace(/\s*\(Body\)\s*$/i,"");t=t.replace(/\s+Regular$/i,"");t=t.replace(/\s+Bold$/i,"");t=t.replace(/\s+Italic$/i,"");return t.trim()};function MDr(e){return{color:e,type:1,gradientStops:[],pictureEffects:[]}}function Ige({currentTextStyle:e,baseStyle:t,baseStyleFontColor:n,tableCellStyle:r,pivotFontColor:i,pivotBold:o,conditionalFormattingTextColor:a,numberFormatColorOverride:s}){const l={};const u=t.fontSources?.color==="cell"?n:null;const d=t.fontSources?.color==="cell"?null:n;if(o||r?.font?.bold===true){l.bold=true}else if(e.bold!=null){l.bold=e.bold}else if(r?.font?.bold!=null){l.bold=r.font.bold}else if(t.font?.bold!=null){l.bold=!!t.font.bold}const f=a??s??i??u??r?.font?.color??e.fill?.color??d??null;if(f){l.fill=MDr(f)}return l}var Mge=4;var LDr=8;function pOt(e){return e.type===4&&e.showDropDown!==true}function eze(e){return Math.min(LDr,Math.max(0,e-Mge*2))}function Lge(e){const t=eze(e);return t>0?t+Mge*2:0}var DDr=12;var FDr=2;var NDr=4;var ODr=4;function BDr(e,t){const n=/^([A-Z]+):([A-Z]+)$/i.exec(e.trim());if(n){const i=n[1];const o=n[2];if(!i||!o)return null;const a=ps(i);const s=ps(o);return{startCol:Math.min(a,s),endCol:Math.max(a,s)}}const r=t??fi(e)?.bounds??null;if(!r)return null;return{startCol:r.startCol,endCol:r.endCol,rowStart:r.startRow,rowEnd:r.endRow}}function zDr(e,t){const n=/^(\d+):(\d+)$/i.exec(e.trim());if(n){const i=Number(n[1])-1;const o=Number(n[2])-1;return{startRow:Math.min(i,o),endRow:Math.max(i,o)}}const r=t??fi(e)?.bounds??null;if(!r)return null;return{startRow:r.startRow,endRow:r.endRow,colStart:r.startCol,colEnd:r.endCol}}function mOt(e){const t=[];for(const n of e.columns??[]){const r=n;const i=typeof r?.styleIndex==="number"?r.styleIndex:void 0;if(typeof i==="number"){const o=Math.max(0,(n.min??1)-1);const a=Math.max(o,(n.max??n.min??1)-1);for(let s=o;s<=a;s++){if(t[s]==null)t[s]=i}}}return t}function gOt(e){const t=new Map;for(const n of e.rows??[]){if(typeof n.styleIndex==="number"){const r=Math.max(0,(n.index??1)-1);t.set(r,n.styleIndex)}}return t}function yOt(e,t,n,r,i){const o=r.get(t);const a=i[n];return e?.styleIndex??o??a??0}function UDr(e){if(e?.align==="center")return 2;if(e?.align==="right")return 3;return 1}function VDr(e){const{element:t,style:n,tableCellStyle:r}=e;if(!n){return}for(const i of t.paragraphs??[]){for(const o of i.runs??[]){o.textStyle=o.textStyle??{};if(typeof o.textStyle.fontSize==="number"&&o.textStyle.fontSize>0&&o.textStyle.fontSize<100){o.textStyle.fontSize=Math.round(o.textStyle.fontSize*100)}if(!(typeof o.textStyle.fontSize==="number"&&o.textStyle.fontSize>0)){const s=n.font?.size;const l=typeof s==="number"&&s>0?s*72/96:11;o.textStyle.fontSize=Math.round(l*100)}if(o.textStyle.italic==null&&n.font?.italic!=null){o.textStyle.italic=!!n.font.italic}if(o.textStyle.name==null){o.textStyle.name=Xz(n.font?.family)}if(o.textStyle.underline==null&&n.font?.underline!=null){o.textStyle.underline=n.font.underline?"single":"none"}const a=Ige({currentTextStyle:o.textStyle,baseStyle:n,baseStyleFontColor:null,tableCellStyle:r});if(a.bold!=null){o.textStyle.bold=a.bold}}}}function bOt(e){const{style:t,themeMap:n,wrap:r,boxWidthPx:i,paragraphs:o,tableCellStyle:a}=e;const s=t?.font?.size??11*(96/72);const{padLr:l,padTb:u}=PI(s);const d=UDr(t);const f={paragraphs:o,textStyle:{alignment:d,anchor:1},bbox:{xEmu:0,yEmu:0,widthEmu:Math.round(Math.max(i,1)*9525),heightEmu:Math.round(Math.max(s+u*2,1)*9525)},type:1,effects:[],children:[],levelsStyles:[],id:"",citations:[]};VDr({element:f,style:t,tableCellStyle:a});const h=_p(f,n,{resolvedStyle:{alignment:d},bboxPx:{x:0,y:0,width:Math.max(i,1),height:Math.max(s+u*2,1)},paddingPx:{left:l,right:l,top:u,bottom:u},mode:"layout",textScale:1,wrap:r,layoutProfile:"spreadsheet"});const m=(h?.lines?.reduce((x,w)=>Math.max(x,w.widthPx),0)??0)+l*2;const g=h?.lines?.reduce((x,w)=>x+w.heightPx,0)??0;return{widthPx:m,heightPx:g}}function xOt(e,t,n,r){const i=`${e.value??""}__${r}`;if(n.has(i)){return n.get(i)??""}const o=T3(e,t,n,r);n.set(i,o);return o}function $Dr(e,t){if(t!==""){return true}for(const n of e.paragraphs??[]){for(const r of n.runs??[]){if(r.text!==""){return true}}}return false}function GDr(e){const t=new Set;for(const n of e){if(n.headerRows===0){continue}const r=n.startRow+n.headerRows-1;for(let i=n.startRow;i<=r;i++){for(let o=n.startCol;o<=n.endCol;o++){t.add(`${i}:${o}`)}}}return t}function vOt(e,t,n){return e.find(r=>r.contains(t,n))}function HDr(e){const t=e?.font?.size??11*(96/72);const{padLr:n}=PI(t);return Math.max(0,DDr+FDr+NDr+ODr-n)}function WDr(e){const t=[];for(const n of e){for(const r of n.ranges){const i=r.startAddress;const o=r.endAddress;if(!i||!o){continue}const a=vl(i);const s=vl(o);const l=ps(i);const u=ps(o);t.push({startRow:Math.min(a,s),endRow:Math.max(a,s),startCol:Math.min(l,u),endCol:Math.max(l,u)})}}return t}function YDr(e,t,n){return e.some(r=>t>=r.startRow&&t<=r.endRow&&n>=r.startCol&&n<=r.endCol)}function _Ot(e){const{address:t,bounds:n,workbook:r,worksheet:i}=e;const o=BDr(t,n);if(!o)return;const a=r.toProto();const s=a.sheets?.find(L=>L.name===i.name)??null;if(!s)return;const l=Fh(a.theme);const u=jv(a);const d=vj(u);const f=i.__getSpreadsheetRenderMetadata(l);const h=mOt(s);const m=gOt(s);const g=f.tableResolvers;const x=GDr(g);const w=WDr(f.listValidationEntries);const _=new Map;const C=qz(s);const A=Bu(s.defaultRowHeight&&s.defaultRowHeight!==0?s.defaultRowHeight:ig);const P=i.__getColumns();for(let L=o.startCol;L<=o.endCol;L++){const I=i.__getColumnExtent(L);const N=o.rowStart??I?.minRow??0;const O=o.rowEnd??I?.maxRow??N;if(N>O)continue;let z=0;for(let $=N;$<=O;$++){const K=i.__getCell($,L);if(!K)continue;const X=yOt(K,$,L,m,h);const j=u[X];const te=vOt(g,$,L)?.resolveCell($,L);const J=xOt(K,u,_,X);if(!$Dr(K,J)){continue}const oe=K.paragraphs&&K.paragraphs.length>0?K.paragraphs:[{runs:[{text:J,citations:[],reviewMarkIds:[]}],inlineNodes:[]}];const{widthPx:se}=bOt({style:j,themeMap:l,wrap:false,boxWidthPx:1e6,paragraphs:oe,tableCellStyle:te});let re=se;if(x.has(`${$}:${L}`)){re+=HDr(j)}if(YDr(w,$,L)){re+=Lge(C[$]??A)}if(re>z){z=re}}if(z<=0)continue;const U=cz(Math.ceil(z),d);const W=L+1;let H=P.find($=>{const K=$.min??$.max??1;const X=$.max??$.min??K;return W>=K&&W<=X})??null;if(!H){H={min:W,max:W,width:U,customWidth:true};P.push(H)}H.min=W;H.max=W;H.width=U;H.customWidth=true;H.hidden=H.hidden??false}}function TOt(e){const{address:t,bounds:n,workbook:r,worksheet:i}=e;const o=zDr(t,n);if(!o)return;const a=r.toProto();const s=a.sheets?.find(P=>P.name===i.name)??null;if(!s)return;const l=Fh(a.theme);const u=jv(a);const d=vj(u);const f=i.__getSpreadsheetRenderMetadata(l);const h=mOt(s);const m=gOt(s);const g=f.tableResolvers;const x=new Map;const w=Yz(s,d);const _=i.__getMergedRangeIndex();const C=Bu(s.defaultRowHeight&&s.defaultRowHeight!==0?s.defaultRowHeight:ig);const A=i.__getRows();for(let P=o.startRow;P<=o.endRow;P++){const L=i.__getRowExtent(P);const I=o.colStart??L?.minCol??0;const N=o.colEnd??L?.maxCol??I;if(I>N)continue;let O=0;for(let U=I;U<=N;U++){const W=i.__getCell(P,U);if(!W)continue;const H=_.findBoundsForCell(P,U);if(H){if(H.rowMin!==H.rowMax||P!==H.rowMin||U!==H.colMin){continue}}const $=yOt(W,P,U,m,h);const K=u[$];const X=vOt(g,P,U)?.resolveCell(P,U);const j=xOt(W,u,x,$);const te=W.paragraphs&&W.paragraphs.length>0?W.paragraphs:[{runs:[{text:j,citations:[],reviewMarkIds:[]}],inlineNodes:[]}];let J=0;for(let se=U;se<=(H?.colMax??U);se++){J+=w[se]??0}if(J<=0)continue;const{heightPx:oe}=bOt({style:K,themeMap:l,wrap:K?.wrapText===true,boxWidthPx:K?.wrapText===true?Math.max(J??0,1):1e6,paragraphs:te,tableCellStyle:X});if(oe>O){O=oe}}if(O<=0)continue;const z=i.__getOrCreateRow(P);z.height=gce(Math.max(C,O));z.customHeight=true;z.hidden=z.hidden??false;if(!A.includes(z)){A.push(z)}}}Yl();var rze=class extends gi{#e;constructor(t,n){const r=t.toProto();super(r?{type:"proto",proto:r}:void 0);this.#e=n}get color(){return super.color}set color(t){super.color=t;this.#e(this)}};var Tj=class{#e;#t;#n;#r;#i;constructor(t){this.#e=t;const n=r=>this.#b(r);this.#r=new Nge({readState:()=>this.#d(),applyChange:r=>this.#m(r),record:n});this.#i=new ize(this,n)}reset(){this.#t=void 0;this.#n=void 0}get font(){return this.#r}set font(t){if(t instanceof Nge){return}if(!t||typeof t!=="object"){throw new Error("RangeFormat.font setter requires a config object.")}this.setFont(t)}setFont(t){if(!t||typeof t!=="object"){throw new Error("RangeFormat.setFont(patch) requires a config object.")}const n={};const r=Oge(t.color);this.#m(i=>{if(t.bold!==void 0)i.bold=t.bold;if(t.italic!==void 0)i.italic=t.italic;if(t.size!==void 0)i.size=t.size;if(t.name!==void 0)i.name=t.name;if(t.color!==void 0)i.color=sze(t.color)});if(t.bold!==void 0)n.bold=t.bold;if(t.italic!==void 0)n.italic=t.italic;if(t.size!==void 0)n.size=t.size;if(t.name!==void 0)n.name=t.name;if(r!==void 0)n.color=r;if(Object.keys(n).length>0){this.#b({font:n})}}get borders(){return this.#i}set borders(t){if(!t){throw new Error("RangeFormat.borders setter requires a config object.")}if("preset"in t){const{preset:n,style:r,color:i}=t;if(r!==void 0||i!==void 0){this.#i.apply({preset:n,style:r,color:i})}else{this.#i.setPreset(n)}return}this.#i.assign(t)}get fill(){const t=this.#d().fill;return t?new rze(t,n=>this.#o(n)):void 0}set fill(t){this.#o(t)}get numberFormat(){return this.#d().numberFormatCode}#a(t){const n=this.#T();const r=()=>t?Dge(t):void 0;let i;this.#S(()=>{this.#e.editCells(true,a=>{if(!a.cell){return}const s=a.cell.styleIndex??this.#e.getLogicalStyleIndex(a.row,a.col)??0;const l=n.describe(s);const u=this.#p(l);u.fill=r();const{styleId:d,styleIndex:f}=this.#E(u);a.cell.styleIndex=f;this.#e.setLogicalStyleIndex(a.row,a.col,f);this.#C(a.row,a.col,d);if(!i){i=this.#g(u);i.styleIndex=f}})});if(i){this.#t=i;return}const o=this.#g(this.#d());o.fill=r();this.#t=o}#o(t){const n=KDr(t);if(n!==void 0){this.#b({fill:n})}const r=COt(t);this.#a(r)}set numberFormat(t){if(t===void 0||typeof t==="string"){this.#h(d=>{d.numberFormatCode=t;d.numberFormatId=void 0});if(t!==void 0){this.#b({numberFormat:t})}return}if(!Array.isArray(t)){throw new Error("RangeFormat.numberFormat expects a format code string or a 2D array of strings.")}const n=this.#e.getBounds();if(!n){throw new Error("RangeFormat.numberFormat 2D array assignment requires a range with bounds.")}const r=qDr(t);if(r.ragged){const d=this.#e.getAddress()||"range";throw new Error(`RangeFormat.numberFormat expects a rectangular 2D array for ${d} (ragged rows: ${r.colCounts.join(", ")}).`)}let i=t;const o=r.rows===n.rows&&r.cols===n.cols&&!r.ragged;const a=r.rows===n.rows&&r.cols===1&&n.cols>=1;const s=r.rows===1&&r.cols===n.cols&&n.rows>=1;const l=r.rows===1&&r.cols===1;if(!o){if(l){const d=i[0]?.[0];if(typeof d!=="string"){throw new Error("RangeFormat.numberFormat 2D array expects string values for every cell.")}this.numberFormat=d;return}if(a){i=Array.from({length:n.rows},(d,f)=>{const h=i[f]?.[0];return Array.from({length:n.cols},()=>h)})}else if(s){i=Array.from({length:n.rows},()=>[...i[0]??[]])}else{const d=r.rows>0&&r.cols>0&&r.rows<=n.rows&&r.cols<=n.cols;if(!d){const x=this.#e.getAddress()||"range";throw new Error(`RangeFormat.numberFormat expects a ${n.rows}x${n.cols} matrix for ${x}, got ${r.rows}x${r.cols}. You can also pass a 1xN or Nx1 matrix to broadcast across rows/columns.`)}const f=this.#e.getAddress()||"range";const h=n.rows%r.rows===0;const m=n.cols%r.cols===0;const g=h&&m?"tiled":"stretched";console.warn(`RangeFormat.numberFormat expanded a ${r.rows}x${r.cols} matrix to ${n.rows}x${n.cols} for ${f} (${g}).`);i=Array.from({length:n.rows},(x,w)=>{const _=h?w%r.rows:Math.min(w,r.rows-1);return Array.from({length:n.cols},(C,A)=>{const P=m?A%r.cols:Math.min(A,r.cols-1);return t[_]?.[P]??""})})}}const u=XDr(i);if(u!==null){this.numberFormat=u;return}this.#s(i)}#s(t){const n=this.#T();let r;this.#S(()=>{this.#e.editCells(true,o=>{if(!o.cell){return}const a=t[o.relativeRow]?.[o.relativeCol];if(typeof a!=="string"){throw new Error("RangeFormat.numberFormat 2D array expects string values for every cell.")}const s=this.#e.getLogicalStyleIndex(o.row,o.col)??o.cell.styleIndex??0;const l=n.describe(s);const u=this.#p(l);u.numberFormatCode=a;u.numberFormatId=void 0;const{styleId:d,styleIndex:f}=this.#E(u);o.cell.styleIndex=f;this.#e.setLogicalStyleIndex(o.row,o.col,f);this.#C(o.row,o.col,d);if(!r){r=this.#g(u);r.styleIndex=f}})});if(r){this.#t=r;return}const i=this.#g(this.#d());i.numberFormatCode=t[0]?.[0];i.numberFormatId=void 0;this.#t=i}get wrapText(){return this.#d().wrapText??false}set wrapText(t){this.#h(n=>{n.wrapText=t});this.#b({wrapText:t})}get horizontalAlignment(){const t=this.#d().horizontalAlignment??"General";return nze(t)}set horizontalAlignment(t){const n=QDr(t);this.#h(r=>{r.horizontalAlignment=n});this.#b({horizontalAlignment:nze(n)})}get verticalAlignment(){return this.#d().verticalAlignment??"bottom"}set verticalAlignment(t){const n=eFr(t);this.#h(r=>{r.verticalAlignment=n});this.#b({verticalAlignment:n})}get rowHeight(){return this.#l()}set rowHeight(t){this.#c(t);if(Number.isFinite(t)){this.#b({rowHeight:t})}}get rowHeightPx(){const t=this.rowHeight;return t===void 0?void 0:Bu(t)}set rowHeightPx(t){if(!Number.isFinite(t)||t<0){throw new Error("RangeFormat.rowHeightPx must be a non-negative number.")}this.rowHeight=gce(t)}get columnWidth(){return this.#u()}set columnWidth(t){this.#f(t);if(Number.isFinite(t)){this.#b({columnWidth:t})}}get columnWidthPx(){const t=this.columnWidth;return t===void 0?void 0:og(t,this.#k())}set columnWidthPx(t){if(!Number.isFinite(t)||t<0){throw new Error("RangeFormat.columnWidthPx must be a non-negative number.")}this.columnWidth=cz(t,this.#k())}get styleId(){const t=this.#e.getFirstCell(false);if(t){const n=this.#e.getLogicalStyleIndex(t.row,t.col);if(n!=null){return n}}return this.#d().styleIndex}autofitColumns(){const t=this.#e.getBounds();const n=t?{startRow:t.startRow,startCol:t.startCol,endRow:t.startRow+t.rows-1,endCol:t.startCol+t.cols-1}:null;const r=this.#e.getWorkbook();const i=this.#e.getWorksheet();if(!r||!i){return}r.recalculate();_Ot({address:this.#e.getAddress(),bounds:n,workbook:r,worksheet:i});if(t){for(let o=0;o=d&&s<=f){l=u.hidden?0:u.width}}if(l===void 0){if(o){return void 0}continue}if(!o){i=l;o=true;continue}if(i!==l){return void 0}}return o?i:void 0}#f(t){if(!Number.isFinite(t)||t<0){throw new Error("RangeFormat.columnWidth must be a non-negative number.")}const n=this.#e.getBounds();const r=this.#e.getWorksheet();if(!n||!r){return}const i=r.__getColumns();for(let o=0;ol.min===a&&(l.max??l.min)===a);if(s){s.width=t;s.customWidth=true;s.hidden=false;continue}i.push({min:a,max:a,width:t,customWidth:true,hidden:false});r.__syncColumnSizeRef(n.startCol+o);continue}for(let o=0;o{this.#e.editCells(true,i=>{if(!i.cell){return}const o=this.#e.getLogicalStyleIndex(i.row,i.col)??i.cell.styleIndex??0;const a=r.describe(o);const s=this.#p(a);s.border=this.#v(t,s.border,i.relativeRow,i.relativeCol,n.rows,n.cols);const{styleId:l,styleIndex:u}=this.#E(s);i.cell.styleIndex=u;this.#e.setLogicalStyleIndex(i.row,i.col,u);this.#C(i.row,i.col,l);if(i.relativeRow===0&&i.relativeCol===0){this.#t=s;this.#t.styleIndex=u}})});this.#n=this.#x(t)}updateBorders(t){const n=this.#x(this.#n)??this.#y();t(n);this.applyBorderBlueprint(n);this.#n=this.#x(n)}getBorderBlueprintSnapshot(){return this.#x(this.#n)??this.#y()}#d(){if(this.#t){return this.#t}const t=this.#e.getFirstCell(true);const n=this.#T();if(!t||!t.cell){const o=n.describe(0);this.#t=this.#p(o);return this.#t}const r=t.cell.styleIndex??0;const i=n.describe(r);this.#t=this.#p(i);return this.#t}#p(t){return{styleIndex:t.styleIndex,fill:t.fill?Dge(t.fill):void 0,font:tze(t.font),border:Fge(t.border),numberFormatCode:t.numberFormatCode,numberFormatId:t.numberFormatId,wrapText:t.wrapText,horizontalAlignment:t.horizontalAlignment?SOt(t.horizontalAlignment):void 0,verticalAlignment:t.verticalAlignment?AOt(t.verticalAlignment):void 0,featurePropertyBagIndex:t.featurePropertyBagIndex}}#m(t){this.#h(n=>{n.font??=new AE;t(n.font)})}#h(t){const n=this.#T();let r;this.#S(()=>{this.#e.editCells(true,o=>{if(!o.cell){return}const a=this.#e.getLogicalStyleIndex(o.row,o.col)??o.cell.styleIndex??0;const s=n.describe(a);const l=this.#p(s);t(l);const{styleId:u,styleIndex:d}=this.#E(l);o.cell.styleIndex=d;this.#e.setLogicalStyleIndex(o.row,o.col,d);this.#C(o.row,o.col,u);if(!r){r=this.#g(l);r.styleIndex=d}})});if(r){this.#t=r;return}const i=this.#g(this.#d());t(i);this.#t=i}#g(t){return{styleIndex:t.styleIndex,fill:t.fill?Dge(t.fill):void 0,font:tze(t.font),border:Fge(t.border),numberFormatCode:t.numberFormatCode,numberFormatId:t.numberFormatId,wrapText:t.wrapText,horizontalAlignment:t.horizontalAlignment,verticalAlignment:t.verticalAlignment,featurePropertyBagIndex:t.featurePropertyBagIndex}}#y(){const t=this.#d();const n={};const r=t.border;if(r){n.top=_j(r.top);n.bottom=_j(r.bottom);n.left=_j(r.left);n.right=_j(r.right);n.diagonal=_j(r.diagonal);n.diagonalUp=r.diagonalUp;n.diagonalDown=r.diagonalDown}return n}#x(t){if(!t)return void 0;const n={};n.top=bf(t.top);n.bottom=bf(t.bottom);n.left=bf(t.left);n.right=bf(t.right);n.insideHorizontal=bf(t.insideHorizontal);n.insideVertical=bf(t.insideVertical);n.diagonal=bf(t.diagonal);if(t.diagonalUp!==void 0)n.diagonalUp=t.diagonalUp;if(t.diagonalDown!==void 0)n.diagonalDown=t.diagonalDown;return n}#v(t,n,r,i,o,a){const s=Fge(n)??new kE;const l=r===0;const u=r===o-1;const d=i===0;const f=i===a-1;if(t.top&&l){s.top=RE(t.top)}if(t.bottom&&u){s.bottom=RE(t.bottom)}if(t.left&&d){s.left=RE(t.left)}if(t.right&&f){s.right=RE(t.right)}if(t.insideHorizontal){if(r>0){s.top=RE(t.insideHorizontal)}if(r0){s.left=RE(t.insideVertical)}if(i{n.bold=t});if(t!==void 0){this.#r({bold:t})}}get italic(){return this.#e().font?.italic}set italic(t){this.#t(n=>{n.italic=t});if(t!==void 0){this.#r({italic:t})}}get size(){return this.#e().font?.size}set size(t){this.#t(n=>{n.size=t});if(t!==void 0){this.#r({size:t})}}get name(){return this.#e().font?.name}set name(t){this.#t(n=>{n.name=t});if(t!==void 0){this.#r({name:t})}}get color(){const t=this.#e().font?.color;return t?t.clone():void 0}set color(t){this.#t(r=>{r.color=sze(t)});const n=Oge(t);if(n!==void 0){this.#r({color:n})}}#r(t){if(Object.keys(t).length===0){return}this.#n({font:t})}};var ize=class{#e;#t;constructor(t,n){this.#e=t;this.#t=n}get top(){return new NT(this,"top")}set top(t){this.setEdgeState("top",dg(t))}get bottom(){return new NT(this,"bottom")}set bottom(t){this.setEdgeState("bottom",dg(t))}get left(){return new NT(this,"left")}set left(t){this.setEdgeState("left",dg(t))}get right(){return new NT(this,"right")}set right(t){this.setEdgeState("right",dg(t))}get insideHorizontal(){return new NT(this,"insideHorizontal")}set insideHorizontal(t){this.setEdgeState("insideHorizontal",dg(t))}get insideVertical(){return new NT(this,"insideVertical")}set insideVertical(t){this.setEdgeState("insideVertical",dg(t))}get diagonalUp(){return new NT(this,"diagonalUp")}set diagonalUp(t){this.setEdgeState("diagonalUp",dg(t))}get diagonalDown(){return new NT(this,"diagonalDown")}set diagonalDown(t){this.setEdgeState("diagonalDown",dg(t))}assign(t){this.#e.updateBorders(r=>{for(const[i,o]of Object.entries(t)){if(i==="inside"){const l=dg(o);r.insideHorizontal=bf(l);r.insideVertical=bf(l);continue}const a=aze(i);if(!a){continue}if(a==="diagonalUp"||a==="diagonalDown"){const l=dg(o);if(!l){if(a==="diagonalUp"){r.diagonalUp=false}else{r.diagonalDown=false}if(!r.diagonalUp&&!r.diagonalDown){r.diagonal=void 0}continue}r.diagonal=bf(l);if(a==="diagonalUp"){r.diagonalUp=true}else{r.diagonalDown=true}continue}const s=dg(o);if(s){r[a]=bf(s)}else{delete r[a]}}});const n=JDr(t);this.#n(n)}getItem(t){const n=aze(t);if(!n){throw new Error(`Unsupported border edge "${t}"`)}return new NT(this,n)}setPreset(t){this.#e.updateBorders(n=>{if(t==="none"){const o=dg({style:"none"});n.top=bf(o);n.bottom=bf(o);n.left=bf(o);n.right=bf(o);n.insideHorizontal=void 0;n.insideVertical=void 0;n.diagonal=void 0;n.diagonalUp=false;n.diagonalDown=false;return}const r=EOt(t);const i=dg({style:"thin"});for(const o of r){if(o==="diagonalUp"||o==="diagonalDown"){continue}n[o]=bf(i)}if(t==="doubleBottom"){const o=dg({style:"double"});n.bottom=bf(o)}});this.#n({preset:t})}apply(t){this.#e.updateBorders(r=>{if(t.preset==="none"){Object.keys(r).forEach(o=>{delete r[o]});r.diagonalUp=false;r.diagonalDown=false;return}const i=EOt(t.preset);for(const o of i){if(o==="diagonalUp"||o==="diagonalDown"){continue}r[o]=bf(dg({style:t.style,color:t.color}))}if(t.preset==="doubleBottom"){r.bottom=bf(dg({style:"double",color:t.color}))}});const n=ZDr(t);this.#n(n)}setEdgeState(t,n){this.#e.updateBorders(i=>{if(n===void 0){if(t==="diagonalUp"){i.diagonalUp=false;if(!i.diagonalDown){i.diagonal=void 0}}else if(t==="diagonalDown"){i.diagonalDown=false;if(!i.diagonalUp){i.diagonal=void 0}}else{delete i[t]}return}if(t==="diagonalUp"||t==="diagonalDown"){i.diagonal=bf(n);if(t==="diagonalUp"){i.diagonalUp=true}else{i.diagonalDown=true}return}i[t]=bf(n)});const r=n===void 0?{style:"none"}:oze(n);if(r){this.#n({[t]:r})}}getEdgeState(t){const n=this.#e.getBorderBlueprintSnapshot();if(t==="diagonalUp"||t==="diagonalDown"){const r=t==="diagonalUp"?n.diagonalUp:n.diagonalDown;if(!r){return void 0}return bf(n.diagonal)}return bf(n[t])}#n(t){if(!t||Object.keys(t).length===0){return}this.#t({borders:t})}toProto(){const t=this.#e.getBorderBlueprintSnapshot();const n={};const r=i=>{const o=RE(i);return o?o.toProto():void 0};n.top=r(t.top);n.bottom=r(t.bottom);n.left=r(t.left);n.right=r(t.right);n.diagonal=r(t.diagonal);n.diagonalUp=t.diagonalUp;n.diagonalDown=t.diagonalDown;return n}};var NT=class{#e;#t;constructor(t,n){this.#e=t;this.#t=n}get style(){return this.#n()?.style}set style(t){const n={...this.#n()??{},style:t};this.#e.setEdgeState(this.#t,n)}get color(){const t=this.#n()?.color;return t?t.clone():void 0}set color(t){const n={...this.#n()??{},color:t};this.#e.setEdgeState(this.#t,dg(n))}get fill(){const t=this.#n()?.color;if(!t)return void 0;const n=t.toProto();if(!n)return void 0;return new gi({type:"solid",color:{type:"proto",proto:n}})}set fill(t){const n=COt(t);const r=n?nFr(n):void 0;this.color=r}get weight(){return this.#n()?.weight}set weight(t){const n={...this.#n()??{},weight:t};this.#e.setEdgeState(this.#t,n)}#n(){return this.#e.getEdgeState(this.#t)}};function Dge(e){const t=e.toProto();if(!t){return new gi}return new gi({type:"proto",proto:t})}function tze(e){return e?e.clone():void 0}function Fge(e){return e?e.clone():void 0}function bf(e){if(!e)return void 0;const t={};if(e.style!==void 0)t.style=e.style;if(e.color)t.color=e.color.clone();if(e.weight!==void 0)t.weight=e.weight;return Object.keys(t).length>0?t:void 0}function COt(e){if(e===void 0||e===null){return void 0}const t=e instanceof gi?e:new gi(e);return t.toProto()?t:void 0}function qDr(e){if(!Array.isArray(e)){throw new Error("Expected a 2D array.")}const t=[];for(let o=0;oo!==r);return{rows:n,cols:r,ragged:i,colCounts:t}}function XDr(e){const t=e[0]?.[0];if(typeof t!=="string"){return null}for(let n=0;n0?t:void 0}function ZDr(e){const t={preset:e.preset};if(e.style!==void 0){t.style=e.style}const n=Oge(e.color);if(n!==void 0){t.color=n}return t}function JDr(e){const t={};for(const[n,r]of Object.entries(e)){if(n==="inside"){const a=oze(r);if(a){t["inside"]=a}continue}const i=aze(n);if(!i){continue}const o=oze(r);if(o){t[i]=o}}return Object.keys(t).length>0?t:void 0}function dg(e){if(!e){return void 0}const t={};if(e.style!==void 0){t.style=e.style}if(e.weight!==void 0){t.weight=e.weight}if(e.color!==void 0){const n=sze(e.color);if(n){t.color=n}}return Object.keys(t).length>0?t:void 0}function RE(e){if(!e){return void 0}const t=new Xv;t.style=e.style;t.weight=e.weight;t.color=e.color?e.color.clone():void 0;return t}function _j(e){if(!e){return void 0}return{style:e.style,color:e.color?e.color.clone():void 0,weight:e.weight}}function SOt(e){const t=e.toLowerCase();switch(t){case"left":return"Left";case"center":return"Center";case"right":return"Right";case"fill":return"Fill";case"justify":return"Justify";case"centeracrossselection":return"CenterAcrossSelection";case"distributed":return"Distributed";case"general":return"General";default:return void 0}}function QDr(e){const t=SOt(String(e));if(!t){throw new Error(`Unsupported horizontal alignment "${e}".`)}return t}function nze(e){switch(e){case"Left":return"left";case"Center":return"center";case"Right":return"right";case"Fill":return"fill";case"Justify":return"justify";case"CenterAcrossSelection":return"centerAcrossSelection";case"Distributed":return"distributed";case"General":default:return"general"}}function AOt(e){switch(e.toLowerCase()){case"top":return"top";case"center":case"middle":return"middle";case"bottom":return"bottom";default:return void 0}}function eFr(e){const t=AOt(String(e));if(!t){throw new Error(`Unsupported vertical alignment "${e}".`)}return t}function tFr(e){switch(e){case"top":return"top";case"middle":return"center";case"bottom":return"bottom"}}function EOt(e){switch(e){case"outside":return["top","bottom","left","right"];case"inside":return["insideHorizontal","insideVertical"];case"all":return["top","bottom","left","right","insideHorizontal","insideVertical"];case"doubleBottom":return["bottom"];case"none":default:return[]}}function aze(e){const t=e.trim().toLowerCase();switch(t){case"top":case"edgetop":return"top";case"bottom":case"edgebottom":return"bottom";case"left":case"edgeleft":return"left";case"right":case"edgeright":return"right";case"insidehorizontal":return"insideHorizontal";case"insidevertical":return"insideVertical";case"diagonalup":return"diagonalUp";case"diagonaldown":return"diagonalDown";default:return void 0}}function nFr(e){const t=e.toProto();if(!t){return void 0}if(t.color){return new Mi({type:"proto",proto:t.color})}if(t.pattern?.color){return new Mi({type:"proto",proto:t.pattern.color})}const n=t.gradientStops?.[t.gradientStops.length-1];if(n?.color){return new Mi({type:"proto",proto:n.color})}return void 0}bs();var rFr="3TrafficLights1";var kOt={"3Arrows":{name:"3Arrows",iconCount:3,slotAspectRatio:.95},"3Triangles":{name:"3Triangles",iconCount:3,slotAspectRatio:.95},"4Arrows":{name:"4Arrows",iconCount:4,slotAspectRatio:.95},"5Arrows":{name:"5Arrows",iconCount:5,slotAspectRatio:.95},"3ArrowsGray":{name:"3ArrowsGray",iconCount:3,slotAspectRatio:.95},"4ArrowsGray":{name:"4ArrowsGray",iconCount:4,slotAspectRatio:.95},"5ArrowsGray":{name:"5ArrowsGray",iconCount:5,slotAspectRatio:.95},"3TrafficLights1":{name:"3TrafficLights1",iconCount:3,slotAspectRatio:.82},"3Signs":{name:"3Signs",iconCount:3,slotAspectRatio:.9},"4RedToBlack":{name:"4RedToBlack",iconCount:4,slotAspectRatio:.9},"3TrafficLights2":{name:"3TrafficLights2",iconCount:3,slotAspectRatio:.82},"4TrafficLights":{name:"4TrafficLights",iconCount:4,slotAspectRatio:.82},"3Symbols":{name:"3Symbols",iconCount:3,slotAspectRatio:1.1},"3Flags":{name:"3Flags",iconCount:3,slotAspectRatio:1.05},"3Symbols2":{name:"3Symbols2",iconCount:3,slotAspectRatio:1.05},"3Stars":{name:"3Stars",iconCount:3,slotAspectRatio:.95},"5Quarters":{name:"5Quarters",iconCount:5,slotAspectRatio:.95},"5Boxes":{name:"5Boxes",iconCount:5,slotAspectRatio:1.05},"4Rating":{name:"4Rating",iconCount:4,slotAspectRatio:1.35},"5Rating":{name:"5Rating",iconCount:5,slotAspectRatio:1.35}};var EBo=Object.freeze(Object.keys(kOt));function lze(e){const t=e?.trim();return t&&t.length>0?t:rFr}function jz(e){const t=lze(e);return kOt[t]??null}function Bge(e){const t=jz(e.iconSetName);if(t){return t.iconCount}const n=e.fallbackThresholdCount;if(n===4||n===5){return n}return 3}function zge(e){if(e>=5){return[0,20,40,60,80]}if(e===4){return[0,25,50,75]}return[0,33,67]}var iFr={colorSpace:"spreadsheetml"};var Uge=class{#e;constructor(t){this.#e=t}get type(){return this.#e.type}get rule(){return this.#e}};var Vge=class{#e;constructor(t){this.#e=t}get items(){return this.#e.__getConditionalFormattings()}add(t){const{range:n,rule:r}=t;const{target:i}=cze(this.#e,n);const o=oFr(this.#e.__getConditionalFormattings(),i)??aFr(this.#e.__getConditionalFormattings(),i);const a=lFr(this.#e,r,this.#t());o.rules=o.rules??[];o.rules.push(a);this.#e.workbook.invalidateConditionalFormattingCache(this.#e.name);uFr(this.#e,i,r);return new Uge(a)}clear(t){const{target:n}=cze(this.#e,t);const r=dFr(n);const i=this.#e.__getConditionalFormattings();let o=false;for(let l=i.length-1;l>=0;l-=1){const u=i[l];if(!u)continue;if(uze(u,n)){i.splice(l,1);o=true}}this.#e.workbook.invalidateConditionalFormattingCache(this.#e.name);this.#e.__queueCollaborativePublish();if(!o||!r){return}const a=this.#e.workbook.getRecorder();if(!a){return}const s={op:"conditionalformat.clear",target:{sheet:this.#e.name,range:r}};a.record(s)}#t(){let t=0;for(const n of this.#e.__getConditionalFormattings()){for(const r of n.rules??[]){const i=typeof r.priority==="number"?r.priority:0;t=Math.max(t,i)}}return t+1}};var $ge=class{#e;constructor(t){this.#e=t}addColorScale(t){if(typeof t==="object"&&t!==null&&"minColor"in t&&"maxColor"in t){const n=t;const r=[n.minColor,...n.midColor?[n.midColor]:[],n.maxColor];return this.add("colorScale",{colors:r,thresholds:n.thresholds})}return this.add("colorScale",t)}addDataBar(t){return this.add("dataBar",t)}addIconSet(t){return this.add("iconSet",t)}addExpression(t,n){const r=typeof t==="object"&&t!==null&&"formula"in t;const i=r?t.formula:t;const o=r&&"format"in t?t.format:n;const a={formula:i};if(o){a.format=o}return this.add("expression",a)}addCustom(t,n){return this.addExpression(t,n)}addCellIs(t){return this.add("cellIs",t)}add(t,n){const r=this.#t();const i=this.#e.address;const o=vFr(String(t));const a=_Fr(o,n);const s={...a,type:o};return r.conditionalFormattings.add({range:i,rule:s})}get items(){const t=this.#t();const{target:n}=cze(t,this.#e.address);return sFr(t.__getConditionalFormattings(),n)}getItemAt(t){const n=this.items[t];if(!n){throw new Error(`Conditional format at index ${t} not found.`)}return n}clearAll(){const t=this.#t();t.conditionalFormattings.clear(this.#e.address)}deleteAll(){this.clearAll()}clear(){this.clearAll()}#t(){const t=xf(this.#e);if(!t){throw new Error("Range is not attached to a worksheet.")}return t}};function cze(e,t){const{sheetName:n,ref:r}=Pl(t);if(n&&n!==e.name){throw new Error(`Conditional formatting range must target "${e.name}", received "${n}".`)}const i=fi(r);if(!i){throw new Error(`Invalid range address: ${t}`)}const o=i.bounds;const a=ho(o.startRow,o.startCol);const s=ho(o.endRow,o.endCol);return{ref:i.ref,target:{sheetName:e.name,sheetId:e.id??"",startAddress:a,endAddress:s}}}function oFr(e,t){return e.find(n=>uze(n,t))}function uze(e,t){return(e.ranges??[]).some(n=>n.startAddress===t.startAddress&&n.endAddress===t.endAddress&&(!n.sheetName||n.sheetName===t.sheetName))}function aFr(e,t){const n={ranges:[t],rules:[]};e.push(n);return n}function sFr(e,t){const n=[];for(const r of e){if(!uze(r,t))continue;for(const i of r.rules??[]){n.push(new Uge(i))}}return n}function lFr(e,t,n){switch(t.type){case"aboveAverage":return bFr(e,t,n);case"beginsWith":case"containsText":case"endsWith":case"notContainsText":return pFr(e,t,n);case"cellIs":return fFr(e,t,n);case"expression":return hFr(e,t,n);case"colorScale":return xFr(e,t,n);case"containsBlanks":case"containsErrors":case"duplicateValues":case"notContainsBlanks":case"notContainsErrors":case"uniqueValues":return mFr(e,t,n);case"timePeriod":return gFr(e,t,n);case"top10":return yFr(e,t,n);case"dataBar":return CFr(e,t,n);case"iconSet":return SFr(t,n)}}function cFr(e){if(!e||typeof e!=="object"||Array.isArray(e)){return void 0}const t=e;const n=t["format"];if(n&&typeof n==="object"&&!Array.isArray(n)){return n}return e}function uFr(e,t,n){e.__queueCollaborativePublish();const r=e.workbook.getRecorder();if(!r){return}const i=LOt({sheet:e.name,target:t,rule:n});if(i){r.record(i)}}function dFr(e){const t=e.startAddress;if(!t){return null}const n=e.endAddress;return n&&n!==t?`${t}:${n}`:t}function IN(e,t){const n=cFr(t);if(!n){return void 0}return e.workbook.getStyleRegistry().registerDifferentialFormat(n,Fh(e.workbook.theme))}function fFr(e,t,n){const r=ROt(t.formula);const i=IN(e,t.format);return{type:"cellIs",priority:n,operator:t.operator,formula:r,dxfId:i}}function hFr(e,t,n){const r=ROt(t.formula);const i=IN(e,t.format);return{type:"expression",priority:n,formula:r,dxfId:i}}function pFr(e,t,n){return{type:t.type,priority:n,dxfId:IN(e,t.format),operator:t.type,text:t.text,formula:[]}}function mFr(e,t,n){return{type:t.type,priority:n,dxfId:IN(e,t.format),formula:[]}}function gFr(e,t,n){return{type:"timePeriod",priority:n,dxfId:IN(e,t.format),formula:[],timePeriod:t.timePeriod}}function yFr(e,t,n){return{type:"top10",priority:n,dxfId:IN(e,t.format),formula:[],rank:t.rank,percent:t.percent,bottom:t.bottom}}function bFr(e,t,n){return{type:"aboveAverage",priority:n,dxfId:IN(e,t.format),formula:[],aboveAverage:t.aboveAverage,equalAverage:t.equalAverage,stdDev:t.stdDev}}function xFr(e,t,n){const r=Fh(e.workbook.theme);const i=(t.colors??[]).map(s=>MOt(new Mi(s).toProto(),r)).filter(s=>Boolean(s));const o=POt(t.thresholds,i.length,"percentile");const a={cfvos:o,colors:i};return{type:"colorScale",priority:n,formula:[],colorScale:a}}var vFr=e=>{const t=e.replace(/[^a-z0-9]/gi,"").toLowerCase();switch(t){case"aboveaverage":return"aboveAverage";case"beginswith":return"beginsWith";case"cellis":case"cellvalue":return"cellIs";case"colorscale":return"colorScale";case"containsblanks":return"containsBlanks";case"containserrors":return"containsErrors";case"containstext":return"containsText";case"databar":return"dataBar";case"duplicatevalues":return"duplicateValues";case"endswith":return"endsWith";case"iconset":return"iconSet";case"notcontainsblanks":return"notContainsBlanks";case"notcontainserrors":return"notContainsErrors";case"notcontainstext":return"notContainsText";case"expression":case"custom":return"expression";case"timeperiod":return"timePeriod";case"top10":return"top10";case"uniquevalues":return"uniqueValues";default:break}const n=["aboveAverage","beginsWith","cellIs","colorScale","containsBlanks","containsErrors","containsText","dataBar","duplicateValues","endsWith","iconSet","expression","notContainsBlanks","notContainsErrors","notContainsText","timePeriod","top10","uniqueValues"].join(", ");throw new Error(`Unsupported conditional format type: ${e}. Supported types: ${n}. Use Custom as an alias for expression rules.`)};function _Fr(e,t){if(!t||typeof t!=="object"){throw new Error(`Conditional format "${e}" requires a config object. Example: range.conditionalFormats.add("${e}", { ... })`)}if(e==="cellIs"){const n=t;if(n.operator===void 0||n.formula===void 0){throw new Error('cellIs rules require "operator" and "formula" fields.\nExample: range.conditionalFormats.add("CellValue", { operator: "lessThan", formula: 0, format: { fill: "#F8CBAD" } })\nOr: range.conditionalFormats.addCellIs({ operator: "lessThan", formula: 0, format: { fill: "#F8CBAD" } })')}}if(e==="iconSet"){const n=t;if(!n.iconSet){throw new Error('iconSet rules require an "iconSet" value.')}}if(e==="expression"){const n=t;if(n.formula===void 0){throw new Error('expression rules require a "formula" value.')}}if(e==="containsText"||e==="notContainsText"||e==="beginsWith"||e==="endsWith"){const n=t;if(!n.text||!n.text.trim()){throw new Error(`${e} rules require a non-empty "text" value.`)}}if(e==="timePeriod"){const n=t;if(!n.timePeriod){throw new Error('timePeriod rules require a "timePeriod" value.')}}if(e==="top10"){const n=t;if(n.rank!==void 0&&(!Number.isFinite(n.rank)||n.rank<=0)){throw new Error('top10 rules require "rank" to be a positive number.')}}if(e==="aboveAverage"){const n=t;if(n.stdDev!==void 0&&(!Number.isFinite(n.stdDev)||n.stdDev<0)){throw new Error('aboveAverage rules require "stdDev" to be zero or a positive number.')}}if(e==="colorScale"){return TFr(t)}return t}function TFr(e){if(e.colors&&e.colors.length>=2){return e}const t=e.criteria;if(!t){throw new Error('colorScale rules require "colors" (2-3 entries) or "criteria".')}const n=wFr(t);const r=n.map(o=>o.color).filter(o=>Boolean(o));if(r.length<2){throw new Error("colorScale criteria require at least 2 color entries.")}const i=n.map(o=>EFr(o));return{colors:r,thresholds:i}}function wFr(e){if(Array.isArray(e)){return e}const t=[];if(e.minimum){t.push(e.minimum)}if(e.midpoint){t.push(e.midpoint)}if(e.maximum){t.push(e.maximum)}return t}function EFr(e){const t=e.type??"";const n=t.toLowerCase();const r=e.value!==void 0&&e.value!==null?e.value:e.formula;const i=typeof r==="string"?r.trim().replace(/^=/,""):r??void 0;switch(n){case"lowestvalue":case"min":return"min";case"highestvalue":case"max":return"max";case"percent":return{type:"percent",value:i};case"percentile":return{type:"percentile",value:i};case"num":case"number":return{type:"num",value:i};default:if(i!==void 0){return{type:"num",value:i}}throw new Error('colorScale criteria entries require a "type" or a numeric "value".')}}function CFr(e,t,n){const r=Fh(e.workbook.theme);const i=t.color!==void 0?t.color:"accent1";const o=MOt(new Mi(i).toProto(),r);const a=POt(t.thresholds,2,"percent");const s={cfvos:a,color:o??new Mi("accent1").toProto(),gradient:t.gradient};return{type:"dataBar",priority:n,formula:[],dataBar:s}}function SFr(e,t){const n=Bge({iconSetName:e.iconSet,fallbackThresholdCount:e.thresholds?.length});const r={iconSet:e.iconSet,showValue:e.showValue,reverse:e.reverse,custom:e.custom,percent:e.percent,cfvos:kFr(e.thresholds,n)};return{type:"iconSet",priority:t,formula:[],iconSet:r}}function ROt(e){const t=Array.isArray(e)?e:[e];return t.map(n=>AFr(n))}function AFr(e){if(typeof e==="number"){return String(e)}const t=e.trim();return t.startsWith("=")?t.slice(1):t}function POt(e,t,n){const r=e&&e.length>0?e.map(i=>IOt(i,n)):RFr(t);return r.slice(0,Math.max(1,t))}function kFr(e,t){const n=Math.max(1,t);const r=e?.map(a=>IOt(a,"percent"))??[];const i=zge(n).map(a=>({type:"percent",val:String(a)}));const o=i.map((a,s)=>r[s]??a);return o.slice(0,n)}function RFr(e){if(e<=2){return[{type:"min"},{type:"max"}]}return[{type:"min"},{type:"percentile",val:"50"},{type:"max"}]}function IOt(e,t){if(typeof e==="number"){return{type:"num",val:String(e)}}if(typeof e==="string"){const r=e.trim();if(r==="min"||r==="max"){return{type:r}}if(r.endsWith("%")){return{type:t,val:r.slice(0,-1)}}return{type:"num",val:r}}const n=e.value===void 0||e.value===null?void 0:String(e.value);return{type:e.type,val:n}}function MOt(e,t){if(!e){return void 0}if(e.type!==2&&e.type!==3){return e}const n=Bme(e,t,iFr);const r=PFr(n);if(!r){return e}const{r:i,g:o,b:a,a:s}=r;const l=f=>f.toString(16).padStart(2,"0");const u=Math.max(0,Math.min(1,s));const d=l(Math.round(u*255));return{type:1,value:`${d}${l(i)}${l(o)}${l(a)}`.toUpperCase(),transform:void 0,lastColor:void 0}}function PFr(e){const t=e.match(/^rgba?\((\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*([\d.]+))?\)$/i);if(!t){return null}const n=Math.max(0,Math.min(255,Number(t[1])));const r=Math.max(0,Math.min(255,Number(t[2])));const i=Math.max(0,Math.min(255,Number(t[3])));const o=t[4]===void 0?1:Number(t[4]);if([n,r,i,o].some(a=>Number.isNaN(a))){return null}return{r:n,g:r,b:i,a:o}}bs();var LFr={none:1,whole:2,decimal:3,list:4,date:5,time:6,textLength:7,custom:8};var DFr={between:1,notBetween:2,equal:3,notEqual:4,lessThan:5,lessThanOrEqual:6,greaterThan:7,greaterThanOrEqual:8};var FOt={stop:1,warning:2,information:3};var Gge=class{#e;constructor(t){this.#e=t}get items(){return this.#e.__getDataValidations()}getForAddress(t){const n=Hge(this.#e,t);const r=fi(n)?.bounds;if(!r){return null}let i=null;let o=Number.POSITIVE_INFINITY;for(const a of this.#e.__getDataValidations()){const s=a.sqref;if(!s){continue}const l=fi(s)?.bounds;if(!l||!UFr(l,r)){continue}const u=VFr(l);if(u=0;s-=1){if(r[s]?.sqref===n){r.splice(s,1);i=true}}if(!i){return}this.#e.__invalidateViewportLayout();this.#e.__queueCollaborativePublish();const o=this.#e.workbook.getRecorder();if(!o){return}const a={op:"datavalidation.clear",target:{sheet:this.#e.name,range:n}};o.record(a)}};var wj=class{#e;constructor(t){this.#e=t}get rule(){const t=this.#n();if(!t){return null}const n=$Fr(t.type);return{type:n,operator:GFr(t.operator),formula1:t.formula1??void 0,formula2:t.formula2??void 0,values:n==="list"?zFr(t.formula1):void 0}}set rule(t){if(!t){this.clear();return}const n=this.#r();NOt(n,t);w3(this.#t(),n)}get prompt(){const t=this.#n();if(!t){return null}return{title:t.promptTitle??void 0,message:t.promptMessage??void 0,show:t.showInputMessage??void 0}}set prompt(t){if(!t){const r=this.#n();if(!r){return}r.promptTitle=void 0;r.promptMessage=void 0;r.showInputMessage=void 0;w3(this.#t(),r);return}const n=this.#r();n.promptTitle=t.title??void 0;n.promptMessage=t.message??void 0;n.showInputMessage=t.show??true;w3(this.#t(),n)}get errorAlert(){const t=this.#n();if(!t){return null}return{title:t.errorTitle??void 0,message:t.errorMessage??void 0,style:HFr(t.errorStyle),show:t.showErrorMessage??void 0}}set errorAlert(t){if(!t){const r=this.#n();if(!r){return}r.errorTitle=void 0;r.errorMessage=void 0;r.errorStyle=void 0;r.showErrorMessage=void 0;w3(this.#t(),r);return}const n=this.#r();n.errorTitle=t.title??void 0;n.errorMessage=t.message??void 0;n.showErrorMessage=t.show??true;if(t.style){n.errorStyle=FOt[t.style]}w3(this.#t(),n)}get ignoreBlanks(){const t=this.#n();return t?.allowBlank??false}set ignoreBlanks(t){const n=this.#r();n.allowBlank=Boolean(t);w3(this.#t(),n)}get inCellDropDown(){const t=this.#n();if(!t||t.showDropDown===void 0){return true}return!t.showDropDown}set inCellDropDown(t){const n=this.#r();n.showDropDown=!t;w3(this.#t(),n)}clear(){const t=this.#t();t.dataValidations.clear(this.#e.address)}#t(){const t=xf(this.#e);if(!t){throw new Error("Range is not attached to a worksheet.")}return t}#n(){const t=this.#t();return t.dataValidations.getForAddress(this.#e.address)??void 0}#r(){const t=this.#t();const n=Hge(t,this.#e.address);let r=t.__getDataValidations().find(i=>i.sqref===n);if(!r){r={sqref:n};t.__getDataValidations().push(r)}return r}};function FFr(e,t,n){const r=Hge(e,t);const i={sqref:r};NOt(i,n.rule);NFr(i,n.prompt);OFr(i,n.errorAlert);if(n.ignoreBlanks!==void 0){i.allowBlank=Boolean(n.ignoreBlanks)}if(n.inCellDropDown!==void 0){i.showDropDown=!n.inCellDropDown}return i}function NOt(e,t){e.type=LFr[t.type];e.operator=t.operator?DFr[t.operator]:void 0;const n=BFr(t);e.formula1=n.formula1;e.formula2=n.formula2}function NFr(e,t){if(!t){return}e.promptTitle=t.title??void 0;e.promptMessage=t.message??void 0;e.showInputMessage=t.show??true}function OFr(e,t){if(!t){return}e.errorTitle=t.title??void 0;e.errorMessage=t.message??void 0;e.showErrorMessage=t.show??true;if(t.style){e.errorStyle=FOt[t.style]}}function BFr(e){if(e.type==="list"&&e.values&&e.values.length>0){const r=e.values.join(",");return{formula1:`"${r}"`}}const t=DOt(e.formula1);const n=DOt(e.formula2);return{formula1:t,formula2:n}}function DOt(e){if(e===void 0||e===null){return void 0}if(typeof e==="number"){return String(e)}const t=e.trim();return t.startsWith("=")?t.slice(1):t}function Hge(e,t){const{sheetName:n,ref:r}=Pl(t);if(n&&n!==e.name){throw new Error(`Data validation range must target "${e.name}", received "${n}".`)}const i=fi(r);if(!i){throw new Error(`Invalid range address: ${t}`)}return i.ref}function zFr(e){if(!e){return void 0}const t=e.trim();if(t.length<2||!t.startsWith('"')||!t.endsWith('"')){return void 0}return t.slice(1,-1).split(",").map(n=>n.replaceAll('""','"'))}function UFr(e,t){return e.startRow<=t.startRow&&e.startCol<=t.startCol&&e.endRow>=t.endRow&&e.endCol>=t.endCol}function VFr(e){return(e.endRow-e.startRow+1)*(e.endCol-e.startCol+1)}function $Fr(e){switch(e){case 1:return"none";case 2:return"whole";case 3:return"decimal";case 4:return"list";case 5:return"date";case 6:return"time";case 7:return"textLength";case 8:return"custom";default:return"custom"}}function GFr(e){switch(e){case 1:return"between";case 2:return"notBetween";case 3:return"equal";case 4:return"notEqual";case 5:return"lessThan";case 6:return"lessThanOrEqual";case 7:return"greaterThan";case 8:return"greaterThanOrEqual";default:return void 0}}function HFr(e){switch(e){case 1:return"stop";case 2:return"warning";case 3:return"information";default:return void 0}}function w3(e,t){e.__invalidateViewportLayout();e.__queueCollaborativePublish();const n=e.workbook.getRecorder();if(!n||!t.sqref){return}n.deferOnce(`datavalidation.set:${e.name}:${t.sqref}`,()=>OOt({sheet:e.name,record:t}))}var WFr=new Set(["TRUE","FALSE"]);var Kv={kind:"NumberLiteral",value:0};var YFr=16384;var qFr=/^(\$?)([A-Za-z]{1,3})(\$?)(\d{1,7})$/;var XFr=/^(\$?)([A-Za-z]{1,3})$/;var dze={":":150,",":140,"^":110,"*":100,"/":100,"+":90,"-":90,"&":80,"=":70,"<>":70,"<":70,">":70,"<=":70,">=":70};var jFr=new Set(["^"]);var BOt=130;function zOt(e){if(!e){return false}return e===" "||e===" "||e==="\n"||e==="\r"}function MN(e){if(!e){return false}return e>="0"&&e<="9"}function $Ot(e){if(!e){return false}return e>="A"&&e<="Z"||e>="a"&&e<="z"||e==="_"||e==="$"||e==="\\"}function KFr(e){if(!e){return false}return $Ot(e)||MN(e)||e==="."||e==="?"||e==="#"}function ZFr(e,t){let n=t+1;let r="";while(n":case"<":{const o=r;let a=i;if(r+1")){a+=n[r+1];r+=1}t.push({type:"Operator",value:a,start:o,end:r+1});r+=1;continue}case"(":t.push({type:"ParenOpen",value:i,start:r,end:r+1});r+=1;continue;case")":t.push({type:"ParenClose",value:i,start:r,end:r+1});r+=1;continue;case",":t.push({type:"Comma",value:i,start:r,end:r+1});r+=1;continue;case":":t.push({type:"Colon",value:i,start:r,end:r+1});r+=1;continue;case"!":t.push({type:"Bang",value:i,start:r,end:r+1});r+=1;continue;case"@":t.push({type:"At",value:i,start:r,end:r+1});r+=1;continue;case"{":t.push({type:"LBrace",value:i,start:r,end:r+1});r+=1;continue;case"}":t.push({type:"RBrace",value:i,start:r,end:r+1});r+=1;continue;case";":t.push({type:"Semicolon",value:i,start:r,end:r+1});r+=1;continue;default:t.push({type:"Operator",value:i,start:r,end:r+1});r+=1}}t.push({type:"EOF",value:"",start:n.length,end:n.length});return t}var fze=class{tokens;index=0;errors=[];constructor(t){this.tokens=t}parse(){const t=this.parseExpression();this.consumeUntilEOF();return t}consumeUntilEOF(){while(!this.isAtEnd()){const t=this.peekToken();if(t?.type==="EOF"){return}if(t&&t.type!=="Whitespace"){this.errors.push(`Unexpected token ${t.value}`)}this.index+=1}}parseExpression(t=0,n=[]){let r=this.parsePrefix(n);r=this.parsePostfix(r);while(true){const i=this.peekNonWhitespace();if(!i||n.includes(i.type)||i.type==="EOF"){break}const o=this.getBinaryOperatorInfo(i,n);if(!o||o.precedence0){n.push({kind:"MissingArg"})}this.matchToken("ParenClose");i=true;break}if(a.type==="Comma"){if(o){n.push({kind:"MissingArg"})}this.matchToken("Comma");o=true;continue}const s=this.parseExpression(0,["Comma","ParenClose"]);n.push(s);o=false;const l=this.peekNonWhitespace();if(l?.type==="Comma"){this.matchToken("Comma");o=true;continue}if(l?.type==="ParenClose"){this.matchToken("ParenClose");i=true;break}if(!l){break}this.errors.push(`Unexpected token ${l.value} in invocation arguments`);this.advanceToken()}if(!i){this.errors.push("Missing closing parenthesis after invocation")}return{kind:"CallExpr",callee:t,args:n}}parsePrimary(){const t=this.peekNonWhitespace();if(!t){return Kv}switch(t.type){case"Number":this.advanceToken();return{kind:"NumberLiteral",value:Number(t.value)};case"String":this.advanceToken();return{kind:"StringLiteral",value:t.value};case"Boolean":{this.advanceToken();const n={kind:"BooleanLiteral",value:t.value==="TRUE"};const r=this.peekNonWhitespace();if(r?.type==="ParenOpen"){this.matchToken("ParenOpen");if(this.peekNonWhitespace()?.type==="ParenClose"){this.matchToken("ParenClose")}else{this.errors.push(`Boolean literal ${t.value} cannot accept arguments`);this.parseExpression(0,["ParenClose"]);if(!this.matchToken("ParenClose")){this.errors.push(`Missing closing parenthesis after boolean literal ${t.value}`)}}}return n}case"Error":this.advanceToken();return{kind:"ErrorLiteral",value:t.value};case"Identifier":return this.parseIdentifierExpression();case"StructuredRef":return this.parseStructuredReferenceExpression();case"ParenOpen":return this.parseParenthesizedExpression();case"LBrace":return this.parseArrayLiteral();default:this.errors.push(`Unexpected token ${t.value}`);this.advanceToken();return Kv}}parseParenthesizedExpression(){this.matchToken("ParenOpen");const t=this.parseExpression(0,["ParenClose"]);if(!this.matchToken("ParenClose")){this.errors.push("Missing closing parenthesis")}return t}parseArrayLiteral(){this.matchToken("LBrace");const t=[];let n=[];while(!this.isAtEnd()){const r=this.peekNonWhitespace();if(!r){break}if(r.type==="RBrace"){this.matchToken("RBrace");t.push(n);return{kind:"ArrayLiteral",elements:t}}const i=this.parseExpression(0,["Comma","Semicolon","RBrace"]);n.push(i);const o=this.peekNonWhitespace();if(!o){break}if(o.type==="Comma"){this.matchToken("Comma");continue}if(o.type==="Semicolon"){this.matchToken("Semicolon");t.push(n);n=[];continue}if(o.type==="RBrace"){this.matchToken("RBrace");t.push(n);return{kind:"ArrayLiteral",elements:t}}this.errors.push(`Unexpected token ${o.value} in array literal`);this.advanceToken()}this.errors.push("Unterminated array literal");return{kind:"ArrayLiteral",elements:t}}parseIdentifierExpression(){const t=this.consumeToken("Identifier");if(!t){return Kv}const n=this.peekNonWhitespace();if(n?.type==="Bang"){return this.parseSheetQualifiedReference(t.value)}if(n?.type==="ParenOpen"){return this.parseFunctionCall(t.value)}if(n?.type==="StructuredRef"){return this.parseStructuredReferenceExpression(t.value)}return this.createRangeRefFromIdentifier(t.value)}parseStructuredReferenceExpression(t){const n=this.consumeToken("StructuredRef");if(!n){return Kv}const r=r4r(n.value,t);if(!r){const i=t?`${t}`:"";this.errors.push(`Invalid structured reference ${i}${n.value}`);return Kv}return{kind:"RangeRef",ref:{kind:"Structured",reference:r}}}parseSheetQualifiedReference(t){const n=t.replace(/!+$/,"");if(!this.matchToken("Bang")){this.errors.push(`Expected '!' after sheet name ${t}`);return Kv}const r={sheetName:n};const i=this.peekNonWhitespace();if(!i){this.errors.push(`Missing reference after '${t}!'`);return Kv}if(i.type==="Identifier"){const o=this.consumeToken("Identifier");if(!o){return Kv}return this.createRangeRefFromIdentifier(o.value,r)}if(i.type==="Number"){const o=this.consumeToken("Number");if(!o){return Kv}const a=Number(o.value);if(Number.isInteger(a)&&a>0){return{kind:"RangeRef",ref:{kind:"WholeRow",sheet:r,row:a}}}}if(i.type==="Error"){const o=this.consumeToken("Error");if(!o){return Kv}return{kind:"RangeRef",ref:{kind:"Named",name:o.value,sheet:r}}}this.errors.push(`Unsupported sheet-qualified reference near ${t}!${i.value}`);this.advanceToken();return Kv}parseFunctionCall(t){const n=t.toUpperCase();this.matchToken("ParenOpen");const r=[];const i=this.peekNonWhitespace();if(i?.type==="ParenClose"){this.matchToken("ParenClose");return{kind:"FunctionCall",name:n,args:r}}let o=false;let a=true;while(!this.isAtEnd()){const s=this.peekNonWhitespace();if(!s){break}if(s.type==="ParenClose"){if(a&&r.length>0){r.push({kind:"MissingArg"})}this.matchToken("ParenClose");o=true;break}if(s.type==="Comma"){if(a){r.push({kind:"MissingArg"})}this.matchToken("Comma");a=true;continue}const l=this.parseExpression(0,["Comma","ParenClose"]);r.push(l);a=false;const u=this.peekNonWhitespace();if(u?.type==="Comma"){this.matchToken("Comma");a=true;continue}if(u?.type==="ParenClose"){this.matchToken("ParenClose");o=true;break}if(!u){break}this.errors.push(`Unexpected token ${u.value} in function arguments`);this.advanceToken()}if(!o){this.errors.push(`Missing closing parenthesis for function ${n}`)}return{kind:"FunctionCall",name:n,args:r}}createRangeRefFromIdentifier(t,n){const r=t.trim();const i=Wge(r,n);if(i){return{kind:"RangeRef",ref:{kind:"Cell",addr:i}}}return{kind:"RangeRef",ref:{kind:"Named",name:r,sheet:n}}}buildBinaryExpr(t,n,r){if(n===":"){const i=this.combineRange(t,r);if(i){return{kind:"RangeRef",ref:i}}}return{kind:"BinaryOp",op:n,left:t,right:r}}combineRange(t,n){const r=this.exprToRangeRef(t,true);const i=this.exprToRangeRef(n,true);if(!r||!i){return null}if(r.kind==="Cell"&&i.kind==="Cell"){const o=r.addr.sheet?.sheetName;const a=i.addr.sheet?.sheetName;if(o&&a&&o!==a){return null}const s=r.addr.sheet??i.addr.sheet;const l=UOt(r.addr,s);const u=UOt(i.addr,s??i.addr.sheet);if(!l.sheet&&u.sheet){l.sheet={...u.sheet}}if(!u.sheet&&l.sheet){u.sheet={...l.sheet}}return{kind:"Range",start:l,end:u}}if(r.kind==="WholeColumn"&&i.kind==="WholeColumn"&&VOt(r.sheet,i.sheet)){const o=r.sheet&&r.sheet.sheetName?{...r.sheet}:i.sheet&&i.sheet.sheetName?{...i.sheet}:void 0;if(r.col===i.col){return{kind:"WholeColumn",sheet:o,col:r.col}}const a=Math.min(r.col,i.col);const s=Math.max(r.col,i.col);return{kind:"ColumnRange",sheet:o,startCol:a,endCol:s}}if(r.kind==="WholeRow"&&i.kind==="WholeRow"&&r.row===i.row&&VOt(r.sheet,i.sheet)){return{kind:"WholeRow",sheet:r.sheet?{...r.sheet}:i.sheet?{...i.sheet}:void 0,row:r.row}}return null}exprToRangeRef(t,n=false){if(t.kind==="RangeRef"){if(n&&t.ref.kind==="Named"){const r=Yge(t.ref.name,t.ref.sheet);if(r){return r}}return t.ref}if(t.kind==="NumberLiteral"&&Number.isInteger(t.value)&&t.value>0){return{kind:"WholeRow",row:t.value,sheet:void 0}}return null}getBinaryOperatorInfo(t,n){if(t.type==="Comma"&&!n.includes("Comma")){return{operator:",",precedence:dze[","]??0,rightAssociative:false}}if(t.type==="Colon"){return{operator:":",precedence:dze[":"]??0,rightAssociative:false}}if(t.type==="Operator"){const r=dze[t.value];if(r===void 0){return null}return{operator:t.value,precedence:r,rightAssociative:jFr.has(t.value)}}return null}consumeToken(t){const n=this.peekToken();if(!n||n.type!==t){this.errors.push(`Expected token ${t} but found ${n?n.value:"EOF"}`);return null}this.index+=1;return n}matchToken(t){const n=this.peekToken();if(n?.type===t){this.index+=1;return true}return false}peekToken(){this.skipWhitespace();return this.tokens[this.index]??null}peekNonWhitespace(){this.skipWhitespace();return this.tokens[this.index]??null}advanceToken(){this.skipWhitespace();if(!this.isAtEnd()){this.index+=1}}isAtEnd(){return this.index>=this.tokens.length}skipWhitespace(){while(!this.isAtEnd()&&this.tokens[this.index]?.type==="Whitespace"){this.index+=1}}};function PE(e){const t=Kz(e);const n=new fze(t);const r=n.parse();return{expr:r,errors:n.errors}}function r4r(e,t){if(!e.startsWith("[")||!e.endsWith("]")){return null}const n=o4r(e);if(n.length===0){return null}if(n.length===1&&n[0]?.trim()===""){return{tableName:t?.trim()||void 0,section:"All"}}let r=null;let i;for(const o of n){const a=o.trim();if(!a){return null}const s=/^@(.+)$/.exec(a);if(s){if(r!==null){return null}const d=s[1]?.trim();if(!d){return null}r="ThisRow";i=d;continue}const l=a.toUpperCase();const u=a4r(l);if(u){if(r!==null){return null}r=u;continue}if(i!==void 0){return null}i=a}if(r===null){r="Data"}return{tableName:t?.trim()||void 0,section:r,columnName:i}}function Wge(e,t){const n=qFr.exec(e);if(!n){return null}const r=n[1]??"";const i=n[2];const o=n[3]??"";const a=n[4];if(!i||!a){return null}const s=E1(i);if(!s){return null}const l=Number(a);return{sheet:t?{...t}:void 0,row:l,col:s,absRow:o==="$",absCol:r==="$"}}function Yge(e,t){const n=XFr.exec(e);if(!n){return null}const r=n[2];if(!r){return null}const i=E1(r);if(!i||i>YFr){return null}return{kind:"WholeColumn",sheet:t?{...t}:void 0,col:i}}function UOt(e,t){const n=i4r(e);if(t&&!n.sheet){n.sheet={...t}}return n}function VOt(e,t){if(!e||!e.sheetName){return true}if(!t||!t.sheetName){return true}return e.sheetName===t.sheetName}function E1(e){const t=e.toUpperCase();let n=0;for(let r=0;r90){return 0}n=n*26+(i-64)}return n}function fg(e){if(e<=0){return""}let t=e;let n="";while(t>0){t-=1;n=String.fromCharCode(65+t%26)+n;t=Math.floor(t/26)}return n}function i4r(e){return{sheet:e.sheet?{...e.sheet}:void 0,row:e.row,col:e.col,absRow:e.absRow,absCol:e.absCol}}function o4r(e){if(e.startsWith("[[")&&e.endsWith("]]")){const t=e.slice(2,-2);return t.split(/\]\s*,\s*\[/)}return[e.slice(1,-1)]}function a4r(e){switch(e){case"#ALL":return"All";case"#DATA":return"Data";case"#HEADERS":return"Headers";case"#TOTALS":return"Totals";case"#THIS ROW":return"ThisRow";default:return null}}function HOt(e){const t=s4r(e.sourceBounds,e.destinationBounds);if(t==="none"){return null}if(!t){throw new Error(`Range.fillFrom requires destination to extend source in exactly one direction while sharing the other axis. Source is ${e.sourceRangeAddress||"(unnamed range)"}, destination is ${e.destinationRangeAddress||"(unnamed range)"}.`)}const n=[];for(let r=0;r=n.startRow&&e<=qge(n)&&t>=n.startCol&&t<=Xge(n)}function s4r(e,t){const n=qge(e);const r=Xge(e);const i=qge(t);const o=Xge(t);const a=t.startCol===e.startCol&&o===r;const s=t.startRow===e.startRow&&i===n;if(a&&t.startRow===e.startRow&&i>=n){return i===n?"none":"down"}if(a&&i===n&&t.startRow<=e.startRow){return t.startRow===e.startRow?"none":"up"}if(s&&t.startCol===e.startCol&&o>=r){return o===r?"none":"right"}if(s&&o===r&&t.startCol<=e.startCol){return t.startCol===e.startCol?"none":"left"}return null}function l4r(e){const t=qge(e.sourceBounds);const n=Xge(e.sourceBounds);if(e.direction==="down"){return{row:e.sourceBounds.startRow+(e.destinationRow-t-1)%e.sourceBounds.rows,col:e.destinationCol}}if(e.direction==="up"){return{row:e.sourceBounds.startRow+(e.sourceBounds.startRow-e.destinationRow-1)%e.sourceBounds.rows,col:e.destinationCol}}if(e.direction==="right"){return{row:e.destinationRow,col:e.sourceBounds.startCol+(e.destinationCol-n-1)%e.sourceBounds.cols}}return{row:e.destinationRow,col:e.sourceBounds.startCol+(e.sourceBounds.startCol-e.destinationCol-1)%e.sourceBounds.cols}}var qOt=new WeakMap;var c4r=e=>{if(!e||typeof e!=="object"){return false}const t=e.prompt;return"rule"in e||"errorAlert"in e||"ignoreBlanks"in e||"inCellDropDown"in e||t!==void 0&&typeof t==="object"&&t!==null};function hze(e){if(e instanceof Date){return e.toISOString()}return e??null}var WOt=Date.UTC(1899,11,30);var YOt=24*60*60*1e3;var u4r=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/;function d4r(e){if(e instanceof Date){return e}if(typeof e==="string"){const t=Number(e);if(!Number.isFinite(t)){return null}return new Date(WOt+t*YOt)}if(typeof e==="number"&&Number.isFinite(e)){return new Date(WOt+e*YOt)}return null}var Zv=class e{#e;#t;#n;#r;#i;#a;#o;#s;#l;#c;constructor(t={}){this.#e=t.address;this.#t=t.format??new Tj(this.#S());this.#o=t.worksheet;qOt.set(this,t.worksheet)}get address(){return this.#e??""}getAddress(){return this.address}write(t,n={}){const r=this.#d();const i=this.#o;if(!r||!i){throw new Error("Range.write requires a range attached to a worksheet.")}const o=n.resize??"auto";const a=n.overwrite??"allow";if(t!==null&&typeof t==="object"&&!Array.isArray(t)){const f=t;const h=[f.values!==void 0?"values":null,f.formulas!==void 0?"formulas":null,f.formulasR1C1!==void 0?"formulasR1C1":null].filter(A=>A!==null);if(h.length===0){throw new Error("Range.write(payload) expects one of: { values }, { formulas }, { formulasR1C1 }.")}if(h.length>1){throw new Error(`Range.write(payload) expects exactly one field; got ${h.join(", ")}.`)}const m=h[0];if(m==="values"){return this.write(f.values??null,n)}const g=f[m];const x=Array.isArray(g)&&(g.length===0||!Array.isArray(g[0]))?[g]:g;const w=x.length;const _=x.reduce((A,P)=>Math.max(A,Array.isArray(P)?P.length:0),0);if(w<=0||_<=0){throw new Error("Range.write expects a non-empty 2D matrix.")}const C=o==="none"?this:i.getRange(Io({startRow:r.startRow,startCol:r.startCol,endRow:r.startRow+w-1,endCol:r.startCol+_-1}));if(n.clear){C.clear({applyTo:n.clear})}if(a==="error"){const A=C.#v({worksheet:i,bounds:C.#d()});if(A.length>0){const P=i.name?`${i.name}!`:"";const L=A.map(I=>`${P}${I}`).join(", ");throw new Error(`Range.write would overwrite existing values in ${L}. Pass overwrite: 'allow' to proceed.`)}}if(m==="formulas"){C.formulas=x}else{C.formulasR1C1=x}return C}if(t===null){const f=n.clear??"contents";if(o==="none"){this.clear({applyTo:f});return this}this.clear({applyTo:f});return this}const s=Array.isArray(t)&&(t.length===0||!Array.isArray(t[0]))?[t]:t;const l=s.length;const u=s.reduce((f,h)=>Math.max(f,Array.isArray(h)?h.length:0),0);if(l<=0||u<=0){throw new Error("Range.write expects a non-empty 2D matrix.")}const d=o==="none"?this:i.getRange(Io({startRow:r.startRow,startCol:r.startCol,endRow:r.startRow+l-1,endCol:r.startCol+u-1}));if(n.clear){d.clear({applyTo:n.clear})}if(a==="error"){const f=d.#v({worksheet:i,bounds:d.#d()});if(f.length>0){const h=i.name?`${i.name}!`:"";const m=f.map(g=>`${h}${g}`).join(", ");throw new Error(`Range.write would overwrite existing values in ${m}. Pass overwrite: 'allow' to proceed.`)}}d.values=s;return d}get rowCount(){const t=this.#d();if(!t){throw new Error("Range is not attached to a worksheet.")}return t.rows}getRowCount(){return this.rowCount}get columnCount(){const t=this.#d();if(!t){throw new Error("Range is not attached to a worksheet.")}return t.cols}getColumnCount(){return this.columnCount}get format(){return this.#t}set format(t){if(t instanceof Tj){return}if(!t||typeof t!=="object"){throw new Error("Range.format setter requires a config object.")}const n=t;if("fill"in n){this.#t.fill=n.fill}if("font"in n&&n.font){this.#t.font=n.font}if("borders"in n&&n.borders){this.#t.borders=n.borders}if("numberFormat"in n&&n.numberFormat!==void 0){this.#t.numberFormat=n.numberFormat}if("wrapText"in n&&n.wrapText!==void 0){this.#t.wrapText=Boolean(n.wrapText)}if("horizontalAlignment"in n&&n.horizontalAlignment!==void 0){this.#t.horizontalAlignment=n.horizontalAlignment}if("verticalAlignment"in n&&n.verticalAlignment!==void 0){this.#t.verticalAlignment=n.verticalAlignment}if("rowHeightPx"in n&&n.rowHeightPx!==void 0){this.#t.rowHeightPx=n.rowHeightPx}else if("rowHeight"in n&&n.rowHeight!==void 0){this.#t.rowHeight=n.rowHeight}if("columnWidthPx"in n&&n.columnWidthPx!==void 0){this.#t.columnWidthPx=n.columnWidthPx}else if("columnWidth"in n&&n.columnWidth!==void 0){this.#t.columnWidth=n.columnWidth}}get rowIndex(){const t=this.#d();if(!t){throw new Error("Range is not attached to a worksheet.")}return t.startRow}get columnIndex(){const t=this.#d();if(!t){throw new Error("Range is not attached to a worksheet.")}return t.startCol}getRowIndex(){return this.rowIndex}getColumnIndex(){return this.columnIndex}getRange(t){if(typeof t!=="string"){throw new Error("Range.getRange(address) requires an A1 string address.")}const n=xf(this);if(!n){throw new Error("Range is not attached to a worksheet.")}return n.getRange(t)}setNumberFormat(t){this.format.numberFormat=t}get sparklines(){this.#c??=new pze(this);return this.#c}get conditionalFormats(){if(!this.#s){this.#s=new $ge(this)}return this.#s}get dataValidation(){if(!this.#l){this.#l=new wj(this)}return this.#l}set dataValidation(t){if(t instanceof wj){return}if(t==null){this.dataValidation.clear();return}const n=this.dataValidation;if(c4r(t)){if("rule"in t&&t.rule!==void 0){n.rule=t.rule}if("prompt"in t&&t.prompt!==void 0){n.prompt=t.prompt}if("errorAlert"in t&&t.errorAlert!==void 0){n.errorAlert=t.errorAlert}if("ignoreBlanks"in t&&t.ignoreBlanks!==void 0){n.ignoreBlanks=t.ignoreBlanks}if("inCellDropDown"in t&&t.inCellDropDown!==void 0){n.inCellDropDown=t.inCellDropDown}return}if(t.allowBlank!==void 0){n.ignoreBlanks=t.allowBlank}if(t.list){if(t.list.inCellDropDown!==void 0){n.inCellDropDown=t.list.inCellDropDown}if(t.list.source!==void 0){n.rule=Array.isArray(t.list.source)?{type:"list",values:t.list.source}:{type:"list",formula1:t.list.source}}else{n.rule={type:"list"}}}const r=t.promptTitle!==void 0||t.prompt!==void 0||t.showInputMessage!==void 0;if(r){n.prompt={title:t.promptTitle,message:t.prompt,show:t.showInputMessage}}const i=t.errorTitle!==void 0||t.errorMessage!==void 0||t.showErrorMessage!==void 0||t.errorStyle!==void 0;if(i){n.errorAlert={title:t.errorTitle,message:t.errorMessage,show:t.showErrorMessage,style:t.errorStyle}}}getCell(t,n){if(!Number.isFinite(t)||!Number.isFinite(n)){throw new Error("Range.getCell(row, column) requires numeric arguments.")}if(!Number.isInteger(t)||!Number.isInteger(n)){throw new Error("Range.getCell(row, column) requires integer arguments.")}if(t<0||n<0){throw new Error("Range.getCell(row, column) requires non-negative indexes.")}const r=xf(this);if(!r){throw new Error("Range is not attached to a worksheet.")}const i=this.#d();if(!i){throw new Error("Range is not attached to a worksheet.")}const o=i.startRow+t;const a=i.startCol+n;const s=i.startRow+i.rows-1;const l=i.startCol+i.cols-1;if(o>s||a>l){const u=this.address||"range";throw new Error(`Range.getCell(${t}, ${n}) is outside the bounds of ${u}.`)}return r.getRangeByIndexes(o,a,1,1)}getRow(t){if(!Number.isFinite(t)){throw new Error("Range.getRow(rowOffset) requires a numeric argument.")}if(!Number.isInteger(t)){throw new Error("Range.getRow(rowOffset) requires an integer offset.")}if(t<0){throw new Error("Range.getRow(rowOffset) requires a non-negative offset.")}const n=xf(this);if(!n){throw new Error("Range is not attached to a worksheet.")}const r=this.#d();if(!r){throw new Error("Range is not attached to a worksheet.")}const i=r.startRow+t;const o=r.startRow+r.rows-1;if(i>o){const s=this.address||"range";throw new Error(`Range.getRow(${t}) is outside the bounds of ${s}.`)}const a=Io({startRow:i,endRow:i,startCol:r.startCol,endCol:r.startCol+r.cols-1});return n.getRange(a)}getColumn(t){if(!Number.isFinite(t)){throw new Error("Range.getColumn(columnOffset) requires a numeric argument.")}if(!Number.isInteger(t)){throw new Error("Range.getColumn(columnOffset) requires an integer offset.")}if(t<0){throw new Error("Range.getColumn(columnOffset) requires a non-negative offset.")}const n=xf(this);if(!n){throw new Error("Range is not attached to a worksheet.")}const r=this.#d();if(!r){throw new Error("Range is not attached to a worksheet.")}const i=r.startCol+t;const o=r.startCol+r.cols-1;if(i>o){const s=this.address||"range";throw new Error(`Range.getColumn(${t}) is outside the bounds of ${s}.`)}const a=Io({startRow:r.startRow,endRow:r.startRow+r.rows-1,startCol:i,endCol:i});return n.getRange(a)}getRangeByIndexes(t,n,r,i){for(const[g,x]of[["rowOffset",t],["columnOffset",n],["rowCount",r],["columnCount",i]]){if(!Number.isFinite(x)||!Number.isInteger(x)){throw new Error(`Range.getRangeByIndexes ${g} must be an integer.`)}}if(t<0||n<0){throw new Error("Range.getRangeByIndexes requires non-negative row and column offsets.")}if(r<=0||i<=0){throw new Error("Range.getRangeByIndexes requires positive row and column counts.")}const o=xf(this);if(!o){throw new Error("Range is not attached to a worksheet.")}const a=this.#d();if(!a){throw new Error("Range is not attached to a worksheet.")}const s=a.startRow+t;const l=a.startCol+n;const u=s+r-1;const d=l+i-1;const f=a.startRow+a.rows-1;const h=a.startCol+a.cols-1;if(s>f||l>h||u>f||d>h){const g=this.address||"range";throw new Error(`Range.getRangeByIndexes(${t}, ${n}, ${r}, ${i}) is outside the bounds of ${g}.`)}const m=Io({startRow:s,startCol:l,endRow:u,endCol:d});return o.getRange(m)}getOffsetRange(t,n,r,i){for(const[g,x]of[["rowOffset",t],["columnOffset",n]]){if(!Number.isFinite(x)||!Number.isInteger(x)){throw new Error(`Range.getOffsetRange ${g} must be an integer.`)}}if(r!==void 0&&(!Number.isFinite(r)||!Number.isInteger(r))){throw new Error("Range.getOffsetRange rowCount must be an integer.")}if(i!==void 0&&(!Number.isFinite(i)||!Number.isInteger(i))){throw new Error("Range.getOffsetRange columnCount must be an integer.")}const o=xf(this);if(!o){throw new Error("Range is not attached to a worksheet.")}const a=this.#d();if(!a){throw new Error("Range is not attached to a worksheet.")}const s=r??a.rows;const l=i??a.cols;if(s<=0||l<=0){throw new Error("Range.getOffsetRange requires positive row/column counts.")}const u=a.startRow+t;const d=a.startCol+n;if(u<0||d<0){throw new Error("Range.getOffsetRange would start outside the worksheet.")}const f=u+s-1;const h=d+l-1;const m=Io({startRow:u,startCol:d,endRow:f,endCol:h});return o.getRange(m)}getResizedRange(t,n){for(const[a,s]of[["deltaRows",t],["deltaColumns",n]]){if(!Number.isFinite(s)||!Number.isInteger(s)){throw new Error(`Range.getResizedRange ${a} must be an integer.`)}}const r=this.#d();if(!r){throw new Error("Range is not attached to a worksheet.")}const i=r.rows+t;const o=r.cols+n;if(i<=0||o<=0){throw new Error("Range.getResizedRange requires resulting row/column counts to be positive.")}return this.getOffsetRange(0,0,i,o)}getResizeRange(t,n){for(const[r,i]of[["rowCount",t],["columnCount",n]]){if(!Number.isFinite(i)||!Number.isInteger(i)){throw new Error(`Range.getResizeRange ${r} must be an integer.`)}}if(t<=0||n<=0){throw new Error("Range.getResizeRange requires positive row/column counts.")}return this.getOffsetRange(0,0,t,n)}offset(t,n,r,i){return this.getOffsetRange(t,n,r,i)}resize(t,n){return this.getResizeRange(t,n)}getCurrentRegion(){const t=xf(this);if(!t){throw new Error("Range is not attached to a worksheet.")}const n=this.#d();if(!n){throw new Error("Range is not attached to a worksheet.")}const r=n.startRow;const i=n.startCol;if(!this.#y(t,r,i)){return t.getRangeByIndexes(r,i,1,1)}let o=r;let a=r;let s=i;let l=i;const u=h=>{for(let m=s;m<=l;m+=1){if(this.#y(t,h,m)){return true}}return false};const d=h=>{for(let m=o;m<=a;m+=1){if(this.#y(t,m,h)){return true}}return false};while(true){let h=false;if(o>0&&u(o-1)){o-=1;h=true}if(u(a+1)){a+=1;h=true}if(s>0&&d(s-1)){s-=1;h=true}if(d(l+1)){l+=1;h=true}if(!h){break}}const f=Io({startRow:o,startCol:s,endRow:a,endCol:l});return t.getRange(f)}__getWorksheet(){return this.#o}get formulas(){if(this.#o){const t=this.#T();this.#n=t;return t}return this.#n??[]}get formulasR1C1(){const t=this.#d();const n=this.#o;if(t&&n){const r=[];for(let i=0;i0&&s.cols>0){const d=this.#g(r,s.rows,s.cols);const f=i.name?`${i.name}!`:"";console.warn(`Range.formulas shrank from ${f}${this.address} to ${f}${d} (${r.rows}x${r.cols} -> ${s.rows}x${s.cols}).`);i.getRange(d).formulas=a;return}}else{const d=this.#g(r,s.rows,s.cols);const f=this.#x({worksheet:i,bounds:r,spillRows:s.rows,spillCols:s.cols});if(f.length===0){const x=i.name?`${i.name}!`:"";console.warn(`Range.formulas spilled from ${x}${this.address} to ${x}${d} (${r.rows}x${r.cols} -> ${s.rows}x${s.cols}).`);i.getRange(d).formulas=a;return}const h=this.#h(r);const m=i.name?`${i.name}!`:"";const g=f.map(x=>`${m}${x}`).join(", ");throw new Error(`Range.formulas expects a ${r.rows}x${r.cols} matrix for ${this.address}, got ${s.rows}x${s.cols}. To write this ${s.rows}x${s.cols} matrix starting at ${h}, use ${d}. Writing to that spill range would overwrite existing values in ${g}.`)}}if(!l){this.#m(a,r,"formulas")}}if(r&&i){const a=this.#_(n,r,"formulas");const s=[];i.workbook.batchCellInputWrites(()=>{for(let d=0;d[...f])};l.record(d)}return}const o=Array.isArray(n)&&!Array.isArray(n[0])?[n]:n;this.#n=o.map(a=>a.map(s=>s??""));this.#r=void 0;this.#i=void 0;this.#a=void 0}set formulasR1C1(t){const n=this.#d();const r=this.#o;if(!n||!r){this.#r=t.map(o=>o.map(a=>a??""));this.#n=void 0;this.#i=void 0;this.#a=void 0;return}const i=[];for(let o=0;o0&&d.cols>0){const h=this.#g(o,d.rows,d.cols);const m=a.name?`${a.name}!`:"";console.warn(`Range.values shrank from ${m}${this.address} to ${m}${h} (${o.rows}x${o.cols} -> ${d.rows}x${d.cols}).`);a.getRange(h).values=u;return}}else{const h=this.#g(o,d.rows,d.cols);const m=this.#x({worksheet:a,bounds:o,spillRows:d.rows,spillCols:d.cols});if(m.length===0){const _=a.name?`${a.name}!`:"";console.warn(`Range.values spilled from ${_}${this.address} to ${_}${h} (${o.rows}x${o.cols} -> ${d.rows}x${d.cols}).`);a.getRange(h).values=u;return}const g=this.#h(o);const x=a.name?`${a.name}!`:"";const w=m.map(_=>`${x}${_}`).join(", ");throw new Error(`Range.values expects a ${o.rows}x${o.cols} matrix for ${this.address}, got ${d.rows}x${d.cols}. To write this ${d.rows}x${d.cols} matrix starting at ${g}, use ${h}. Writing to that spill range would overwrite existing values in ${w}.`)}}if(!s){this.#m(u,o,"values")}}if(o&&a){if(i===null){a.workbook.batchCellInputWrites(()=>{for(let C=0;C{for(let w=0;w_.map(C=>hze(C)))};g.record(w)}return}if(i===null){this.#i=[];this.#a=[];this.#n=void 0;this.#r=void 0;return}const l=Array.isArray(i)&&!Array.isArray(i[0])?[i]:i;this.#i=l.map(u=>u.map(d=>d??null));this.#n=void 0;this.#r=void 0;this.#a=this.#i}#u(t){const n=xf(this);if(!n){throw new Error("Range.values callback requires a range on a worksheet.")}const r=this.#d();if(!r){throw new Error("Range.values callback requires a range with bounds.")}const i=this.values;const o=[];for(let a=0;a{for(let r=0;r{for(let r=0;rHOt({coerceCellValue:d=>this.#M(d),destinationBounds:i,destinationRangeAddress:this.address,readSourceCell:(d,f)=>r.__getCell(d,f),shouldCollectValues:l,sourceBounds:o,sourceRangeAddress:t.address,shiftFormulaRefs:jge,clearCell:(d,f)=>{const h=n.__getOrCreateCell(d,f);h.formula=void 0;h.value=void 0;h.dataType=0;n.__notifyCellValueChanged(h.address);n.__setRawValue(d,f,null);n.writeCellInputToYjs(h)},writeFormulaCell:(d,f,h)=>{const m=n.__getOrCreateCell(d,f);m.formula=h;m.value=void 0;m.dataType=0;n.__notifyCellFormulaChanged(m.address,`=${h}`);n.__setRawValue(d,f,void 0);n.writeCellInputToYjs(m)},writeValueCell:(d,f,h)=>{const m=n.__getOrCreateCell(d,f);m.formula=void 0;m.value=h.value;m.dataType=h.dataType??0;n.__notifyCellValueChanged(m.address);n.__setRawValue(d,f,Kge(h));n.writeCellInputToYjs(m)}}));if(a&&s&&n.name&&u){const d={op:"range.values.set",target:{sheet:n.name,range:s},values:u.map(f=>f.map(h=>hze(h)))};a.record(d)}}copyFrom(t,n,r,i){const o=this.#o;const a=t.__getWorksheet();if(!o||!a){throw new Error("Range.copyFrom requires both ranges to be attached to worksheets.")}const s=typeof n==="object"&&n!==null?n:{copyType:n,skipBlanks:r,transpose:i};if(s.skipBlanks){throw new Error("Range.copyFrom skipBlanks is not supported yet.")}if(s.transpose){throw new Error("Range.copyFrom transpose is not supported yet.")}const l=this.#d();const u=t.getBoundingBox();if(!l||!u){throw new Error("Range.copyFrom requires both ranges to have bounds.")}const d=(s.copyType??"all").toLowerCase();const f=u.rows===1&&u.cols===1;const h=!f&&u.rows>0&&u.cols>0&&l.rows>0&&l.cols>0&&l.rows%u.rows===0&&l.cols%u.cols===0;const m=f||h||u.rows===l.rows&&u.cols===l.cols;if(!m){throw new Error(`Range.copyFrom requires source and destination to match shape (or source to be 1x1). Source is ${u.rows}x${u.cols}, destination is ${l.rows}x${l.cols}. If you are filling down/right from a seed block, pass a source block whose size evenly tiles the destination.`)}if(d==="values"){const P=t.values;if(f){const L=P[0]?.[0]??null;const I=Array.from({length:l.rows},()=>Array.from({length:l.cols},()=>L));this.values=I}else if(h){const L=[];for(let I=0;I{for(let P=0;P[...L])};g.record(P)}else if(_){const P={op:"range.values.set",target:{sheet:o.name,range:x},values:A.map(L=>L.map(I=>hze(I)))};g.record(P)}}}copyTo(t,n,r,i){t.copyFrom(this,n,r,i)}getBoundingBox(){return this.#d()}#d(){if(!this.#e)return null;const t=fi(this.#e);if(!t)return null;const n=x0(t.bounds);return{startRow:t.bounds.startRow,startCol:t.bounds.startCol,rows:n.rows,cols:n.cols}}#p(t,n){if(!Array.isArray(t)){throw new Error(`Range.${n} expects a 2D array.`)}const r=[];for(let s=0;ss!==o);return{rows:i,cols:o,ragged:a,colCounts:r}}#m(t,n,r){const{rows:i,cols:o,ragged:a,colCounts:s}=this.#p(t,r);const l=n.rows;const u=n.cols;if(i!==l||a||o!==u){const d=this.address||"range";const f=a?` (ragged rows: ${s.join(", ")})`:"";const h=!a&&i===u&&o===l&&(l===1||u===1)&&(i===1||o===1);const m=h?" Input looks transposed; pass a row-shaped matrix like [[...]] or a 1D array for single-row/single-column ranges.":"";const g=!a&&i>0&&o>0?(()=>{const x=this.#h(n);const w=this.#g(n,i,o);if(!w||w===d){return""}return` To write this ${i}x${o} matrix starting at ${x}, use ${w}.`})():"";throw new Error(`Range.${r} expects a ${l}x${u} matrix for ${d}, got ${i}x${o}${f}.${m}${g}`)}}#h(t){return Io({startRow:t.startRow,startCol:t.startCol,endRow:t.startRow,endCol:t.startCol})}#g(t,n,r){return Io({startRow:t.startRow,startCol:t.startCol,endRow:t.startRow+n-1,endCol:t.startCol+r-1})}#y(t,n,r){const i=t.__getCell(n,r);const o=i?.formula??"";if(typeof o==="string"&&o.trim()!==""){return true}const a=t.__getRawValue(n,r);if(a!==void 0){if(a===null){return false}return typeof a==="string"?a!=="":true}const s=i?.value;if(s==null){return false}return typeof s==="string"?s!=="":true}#x(t){const n=Math.max(1,t.sampleLimit??3);const{startRow:r,startCol:i,rows:o,cols:a}=t.bounds;const s=r+o-1;const l=i+a-1;const u=r+t.spillRows-1;const d=i+t.spillCols-1;const f=[];for(let h=r;h<=u;h+=1){for(let m=i;m<=d;m+=1){if(h<=s&&m<=l){continue}if(this.#y(t.worksheet,h,m)){f.push(Io({startRow:h,startCol:m,endRow:h,endCol:m}));if(f.length>=n){return f}}}}return f}#v(t){const n=t.bounds;if(!n){return[]}const r=Math.max(1,t.sampleLimit??3);const i=n.startRow+n.rows-1;const o=n.startCol+n.cols-1;const a=[];for(let s=n.startRow;s<=i;s+=1){for(let l=n.startCol;l<=o;l+=1){if(this.#y(t.worksheet,s,l)){a.push(Io({startRow:s,startCol:l,endRow:s,endCol:l}));if(a.length>=r){return a}}}}return a}#_(t,n,r){if(!Array.isArray(t)){throw new Error(`Range.${r} expects a 2D array.`)}const i=t.length===0||!Array.isArray(t[0]);if(i){const d=t;if(n.rows===1&&n.cols===1){return[d]}if(n.rows===1){return[d]}if(n.cols===1){return d.map(h=>[h])}const f=this.address||"range";throw new Error(`Range.${r} expects a ${n.rows}x${n.cols} matrix for ${f}, but you passed a 1D array. Use a 2D array like [[...], ...].`)}const o=t;const{rows:a,cols:s,ragged:l,colCounts:u}=this.#p(o,r);if(!l&&a===n.cols&&s===n.rows){if((n.rows===1||n.cols===1)&&(a===1||s===1)){const d=[];for(let f=0;fn.cols){const h=this.address||"range";throw new Error(`Range.${r} expects a ${n.rows}x${n.cols} matrix for ${h}, but one or more rows exceed the expected column count.`)}const f=[];for(let h=0;h{const r=0;const i=n.workbook.__getOrCreateStyleIdForStyleIndex(r);for(let o=0;othis.#d(),getWorkbook:()=>this.#o?.workbook,getWorksheet:()=>this.#o,getAddress:()=>this.address,editCells:(t,n)=>this.#b(t,n),getFirstCell:t=>this.#C(t),setLogicalStyleIndex:(t,n,r)=>this.#o?.__setLogicalStyleIndex(t,n,r),getLogicalStyleIndex:(t,n)=>this.#o?.__getLogicalStyleIndex(t,n),setCellStyleRef:(t,n,r)=>this.#o?.__setCellStyleRef(t,n,r)}}#C(t){let n=null;this.#b(t,r=>{if(!n){n=r}});return n}#b(t,n){const r=this.#d();const i=this.#o;if(!r||!i){return}for(let o=0;o{const u=E1(a);const d=Number(l);if(!u||!d){return i}let f=u;let h=d;if(!o){f=u+n}if(!s){h=d+t}if(f<1||h<1||f>jOt||h>XOt){return i}const m=fg(f);return`${o}${m}${s}${h}`})}function KOt(e,t){if(!e.includes('"')){return t(e)}let n="";let r=0;while(r{const o=/R(\[[-+]?\d+\]|\d+)?C(\[[-+]?\d+\]|\d+)?/gi;return i.replace(o,(a,s,l,u)=>{const d=i[u-1];const f=i[u+a.length];if(Zge(d)||Zge(f)){return a}const h=P=>{if(!P){return{absolute:false,value:0}}const L=P.trim();if(L.startsWith("[")&&L.endsWith("]")){const N=Number(L.slice(1,-1));if(!Number.isFinite(N)||!Number.isInteger(N)){throw new Error(`Invalid R1C1 reference: ${a}`)}return{absolute:false,value:N}}const I=Number(L);if(!Number.isFinite(I)||!Number.isInteger(I)||I<1){throw new Error(`Invalid R1C1 reference: ${a}`)}return{absolute:true,value:I}};const m=h(s);const g=h(l);const x=m.absolute?m.value:t+m.value;const w=g.absolute?g.value:n+g.value;if(x<1||w<1||x>XOt||w>jOt){throw new Error(`R1C1 reference ${a} resolves outside worksheet bounds.`)}const _=fg(w);const C=g.absolute?"$":"";const A=m.absolute?"$":"";return`${C}${_}${A}${x}`})};return KOt(e,r)}function h4r(e,t,n){const r=i=>{const o=/(\$?)([A-Z]{1,3})(\$?)(\d{1,7})/g;return i.replace(o,(a,s,l,u,d,f)=>{const h=i[f-1];const m=i[f+a.length];if(Zge(h)||Zge(m)){return a}const g=E1(l);const x=Number(d);if(!g||!x){return a}const w=u?`R${x}`:(()=>{const C=x-t;if(C===0)return"R";return`R[${C}]`})();const _=s?`C${g}`:(()=>{const C=g-n;if(C===0)return"C";return`C[${C}]`})();return`${w}${_}`})};return KOt(e,r)}function Kge(e){if(!e)return null;if(e.value==null)return null;switch(e.dataType){case 5:return Number(e.value);case 4:return e.value==="TRUE"||e.value==="1";case 7:return new Date(e.value);default:return e.value}}var QOt=Object.entries(yf).reduce((e,[t,n])=>{if(!(n in e)){e[n]=t}return e},{});function e5t(e){const{threadId:t,target:n,body:r,author:i,createdAt:o}=e;const a=n5t(n);if(!a){return null}return{op:"thread.add",id:t,target:a,body:typeof r==="string"?r:r.plainText??"",author:i,createdAt:o}}function t5t(e){const{threadId:t,target:n,rootBody:r,rootAuthorId:i,rootCreatedAt:o}=e;const a=n5t(n);if(!a){return null}const s={target:a};if(r!==void 0){s.rootBody=r}if(i!==void 0){s.rootAuthorId=i}if(o!==void 0){s.rootCreatedAt=o}return{id:t,selector:s}}function n5t(e){const t=e.spreadsheetCell;if(t?.sheetName&&t.address){return{cell:{sheet:t.sheetName,address:t.address}}}const n=e.spreadsheetRange;const r=n?.startAddress??n?.endAddress;if(n?.sheetName&&r){const i=n.endAddress;return{range:{sheet:n.sheetName,range:i&&i!==r?`${r}:${i}`:r}}}return null}function r5t(e){const{sheet:t,chart:n,fallbackType:r,as:i}=e;const o=n.type??r;if(!o){return null}const a={op:"chart.add",sheet:t,props:o5t(n,o,{includeId:true})};if(i){a.as=i}return a}function i5t(e){const{sheet:t,chart:n}=e;const r=n.type;if(!r){return null}return{op:"chart.set",target:{sheet:t,selector:gze(n)},props:o5t(n,r,{includeId:false})}}function o5t(e,t,n){const r={chartType:t,anchor:a5t(e.anchor)};if(n?.includeId){r.id=e.id}if(e.titleText!==void 0){r.title=e.titleText}const i=e.categories;if(i.length>0){r.categories=[...i]}const o=p4r(e.series.items);if(o.length>0){r.series=o}if(e.hasLegend!==void 0){r.hasLegend=e.hasLegend}const a=e.legend.position;if(a!==void 0){r.legend={position:a}}const s=b4r(e);if(s){r.dataLabels=s}if(e.displayBlanksAs!==void 0){r.displayBlanksAs=e.displayBlanksAs}const l=x4r(e);if(l){r.barOptions=l}const u=v4r(e);if(u){r.pieOptions=u}const d=_4r(e);if(d){r.doughnutOptions=d}const f=ZOt(e.plotAreaFill,e.plotAreaLine);if(f){r.plotArea=f}const h=ZOt(e.chartFill,e.chartLine);if(h){r.chartArea=h}return r}function gze(e){const t=e.series.items.map(n=>n.name);return{anchor:a5t(e.anchor),chartType:e.type,title:e.titleText,...t.length>0?{seriesNames:t}:{}}}function a5t(e){const t=e.from;const n=e.to;const r=e.extent;const i={from:{...t}};if(n){i.to={...n}}if(r){i.extent={...r}}return i}function p4r(e){if(e.length===0){return[]}return e.map(t=>m4r(t))}function m4r(e){const t={name:e.name};const n=e.values;if(n!==void 0){t.values=[...n]}const r=e.xValues;if(r!==void 0){t.xValues=[...r]}const i=e.categories;if(i.length>0){t.categories=[...i]}if(e.formula!==void 0){t.formula=e.formula}if(e.categoryFormula!==void 0){t.categoryFormula=e.categoryFormula}if(e.xFormula!==void 0){t.xFormula=e.xFormula}if(e.valuesFormatCode!==void 0){t.valuesFormatCode=e.valuesFormatCode}if(e.xValuesFormatCode!==void 0){t.xValuesFormatCode=e.xValuesFormatCode}const o=g4r(e.stroke);if(o){t.stroke=o}const a=y4r(e.marker);if(a){t.marker=a}const s=yze(e.fill);if(s!==void 0){t.fill=s}return t}function g4r(e){return s5t(e)}function s5t(e){const t=yze(e.fill);const n=t===void 0&&typeof e.color==="string"?e.color:void 0;const r=typeof e.style==="string"?e.style:void 0;const i=typeof e.width==="number"?e.width:void 0;if(t===void 0&&n===void 0&&r===void 0&&i===void 0){return void 0}const o={};if(t!==void 0){o.fill=t}if(n!==void 0){o.color=n}if(r!==void 0){o.style=r}if(i!==void 0){o.width=i}return o}function y4r(e){const t=e.symbol;const n=e.size;if(t===void 0&&n===void 0){return void 0}const r={};if(t!==void 0){r.symbol=t}if(n!==void 0){r.size=n}return r}function b4r(e){const t=e.dataLabels;const n={position:t.position,showValue:t.showValue,showSeriesName:t.showSeriesName,showCategoryName:t.showCategoryName,showPercent:t.showPercent,showLeaderLines:t.showLeaderLines};const r=Object.values(n).some(i=>i===true);return r?n:void 0}function x4r(e){const t=e.barOptions;const n={direction:t.direction,grouping:t.grouping,varyColors:t.varyColors?true:void 0,gapWidth:t.gapWidth,gapDepth:t.gapDepth,overlap:t.overlap,bar3dShape:t.bar3dShape};return Object.values(n).some(r=>r!==void 0)?n:void 0}function v4r(e){const t=e.pieOptions.firstSliceAngle;return t!==void 0?{firstSliceAngle:t}:void 0}function _4r(e){const t=e.doughnutOptions.holeSize;const n=e.doughnutOptions.firstSliceAngle;return t!==void 0||n!==void 0?{...t!==void 0?{holeSize:t}:{},...n!==void 0?{firstSliceAngle:n}:{}}:void 0}function ZOt(e,t){const n=yze(e);const r=s5t(t);if(n===void 0&&r===void 0){return void 0}return{...n!==void 0?{fill:n}:{},...r!==void 0?{line:r}:{}}}function yze(e){if(!e||typeof e!=="object"||!("toConfig"in e)||typeof e.toConfig!=="function"){return void 0}const t=e.toConfig();if(!t){return void 0}if(typeof t==="object"&&t!==null&&"type"in t){if(t.type==="proto"){return void 0}}return t}function mze(e){if(typeof e==="number"||typeof e==="string"){return e}return{...e}}function T4r(e){switch(e.type){case"aboveAverage":return{type:"aboveAverage",aboveAverage:e.aboveAverage,equalAverage:e.equalAverage,stdDev:e.stdDev,format:LN(e.format)};case"beginsWith":case"cellIs":case"containsText":case"endsWith":case"notContainsText":if(e.type!=="cellIs"){return{type:e.type,text:e.text,format:LN(e.format)}}return{type:"cellIs",operator:e.operator,formula:e.formula,format:LN(e.format)};case"colorScale":return{type:"colorScale",colors:(e.colors??[]).map(t=>IE(t)).filter(t=>t!==void 0),thresholds:e.thresholds?.map(t=>mze(t))};case"dataBar":return{type:"dataBar",color:IE(e.color),thresholds:e.thresholds?.map(t=>mze(t)),gradient:e.gradient};case"containsBlanks":case"containsErrors":case"duplicateValues":case"notContainsBlanks":case"notContainsErrors":case"uniqueValues":return{type:e.type,format:LN(e.format)};case"iconSet":return{type:"iconSet",iconSet:e.iconSet,showValue:e.showValue,reverse:e.reverse,custom:e.custom,percent:e.percent,thresholds:e.thresholds?.map(t=>mze(t))};case"expression":return{type:"expression",formula:e.formula,format:LN(e.format)};case"timePeriod":return{type:"timePeriod",timePeriod:e.timePeriod,format:LN(e.format)};case"top10":return{type:"top10",rank:e.rank,percent:e.percent,bottom:e.bottom,format:LN(e.format)};default:return null}}function LOt(e){const{sheet:t,target:n,rule:r}=e;const i=T4r(r);if(!i){return null}const o=w4r(n);if(!o){return null}return{op:"conditionalformat.add",target:{sheet:t,range:o},props:{rule:i}}}function w4r(e){const t=e.startAddress;if(!t){return null}const n=e.endAddress;return n&&n!==t?`${t}:${n}`:t}function LN(e){if(!e){return void 0}const t=S4r(e.fill);const n=E4r(e.font);const r=C4r(e.border);const i={};if(t!==void 0){i.fill=t}if(n!==void 0){i.font=n}if(r!==void 0){i.border=r}if(e.numberFormat!==void 0){i.numberFormat=e.numberFormat}return Object.keys(i).length>0?i:void 0}function E4r(e){if(!e){return void 0}const t=IE(e.color);const n={};if(e.bold!==void 0){n.bold=e.bold}if(e.italic!==void 0){n.italic=e.italic}if(e.size!==void 0){n.size=e.size}if(e.name!==void 0){n.name=e.name}if(t!==void 0){n.color=t}return Object.keys(n).length>0?n:void 0}function C4r(e){if(!e){return void 0}const t={};const n=Ej(e.top);const r=Ej(e.bottom);const i=Ej(e.left);const o=Ej(e.right);const a=Ej(e.diagonal);if(n!==void 0){t.top=n}if(r!==void 0){t.bottom=r}if(i!==void 0){t.left=i}if(o!==void 0){t.right=o}if(a!==void 0){t.diagonal=a}if(e.diagonalUp!==void 0){t.diagonalUp=e.diagonalUp}if(e.diagonalDown!==void 0){t.diagonalDown=e.diagonalDown}return Object.keys(t).length>0?t:void 0}function Ej(e){if(!e){return void 0}const t=IE(e.color);const n={};if(e.style!==void 0){n.style=e.style}if(e.weight!==void 0){n.weight=e.weight}if(t!==void 0){n.color=t}return Object.keys(n).length>0?n:void 0}function S4r(e){if(!e){return void 0}if(e instanceof gi){return JOt(e.toConfig())??l5t(e.toProto())}return JOt(e)}function JOt(e){if(!e){return void 0}if(typeof e==="string"){return e}switch(e.type){case"none":return{type:"none"};case"solid":{const t=IE(e.color);if(!t){return void 0}const n=c5t(e.pattern);return n?{type:"solid",color:t,pattern:n}:{type:"solid",color:t}}case"gradient":return{type:"gradient",stops:e.stops.map(t=>{const n=IE(t.color);if(!n){return void 0}return{offset:t.offset,color:n}}).filter(t=>t!==void 0),angleDeg:e.angleDeg,gradientKind:e.gradientKind};case"image":return{type:"image",imageReference:e.imageReference,pictureEffects:e.pictureEffects,stretchFillRect:e.stretchFillRect,fillRect:e.fillRect,pathType:e.pathType,srcRect:e.srcRect};case"proto":return l5t(e.proto)}}function l5t(e){if(!e){return void 0}const t=new gi({type:"proto",proto:e});if(t.type===4&&t.imageReference){return{type:"image",imageReference:t.imageReference,pictureEffects:t.pictureEffects,stretchFillRect:t.stretchFillRect,fillRect:t.fillRect,pathType:t.pathType,srcRect:t.srcRect}}if(t.type===2){return{type:"gradient",stops:(t.gradientStops??[]).map(i=>{const o=i.position;const a=IE(i.color?{type:"proto",proto:i.color}:void 0);if(o===void 0||!a){return void 0}return{offset:o,color:a}}).filter(i=>i!==void 0),angleDeg:t.angleDeg??void 0,gradientKind:t.gradientKind??void 0}}const n=IE(t.color);const r=t.pattern?c5t(t.pattern.toConfig()):void 0;if(n){return r?{type:"solid",color:n,pattern:r}:{type:"solid",color:n}}if(r){return{type:"solid",color:r.color,pattern:r}}return void 0}function c5t(e){if(!e){return void 0}const t=e.type==="proto"?new oN({type:"proto",proto:e.proto}).toConfig():e;if(!t||t.type==="proto"){return void 0}const n=IE(t.color);if(!n){return void 0}return{type:t.type,color:n}}function IE(e){if(!e){return void 0}const t=(e instanceof Mi?e:new Mi(e)).toConfig();if(!t){return void 0}if(typeof t==="string"){return t}if(t.type==="rgb"||t.type==="theme"){return t}if(!t.proto){return void 0}return IE({type:"proto",proto:t.proto})}function E3(e){if(e===void 0){return void 0}const t=new Mi(e).toConfig();if(!t){return void 0}if(typeof t==="string"){return t}return t.type==="proto"?void 0:t}function u5t(e){const{group:t,sheetName:n,targetUid:r}=e;return{op:"sparkline.set",target:{sheet:n,uid:r??t.uid,selector:bze(t,n)},props:f5t(t,n,{includeUid:false})}}function d5t(e){const{group:t,sheetName:n,as:r}=e;const i={op:"sparkline.add",props:f5t(t,n,{includeUid:true})};if(r){i.as=r}return i}function bze(e,t){return{uid:e.uid,targetRange:Cj(e.locationRange,t),sourceData:Cj(e.sourceData,t)}}function f5t(e,t,n){const r={type:e.type,targetRange:Cj(e.locationRange,t),sourceData:Cj(e.sourceData,t),lineWeight:e.lineWeight,displayEmptyCellsAs:e.displayEmptyCellsAs,displayHidden:e.displayHidden,axis:{...e.axis.manualMin!==void 0?{manualMin:e.axis.manualMin}:{},...e.axis.manualMax!==void 0?{manualMax:e.axis.manualMax}:{},minMode:e.axis.minMode,maxMode:e.axis.maxMode,showAxis:e.axis.showAxis,rightToLeft:e.axis.rightToLeft},markers:{show:e.markers.show,high:e.markers.high,low:e.markers.low,first:e.markers.first,last:e.markers.last,negative:e.markers.negative}};if(n?.includeUid){r.uid=e.uid}const i=e.dateAxisRange;if(i){r.dateAxisRange=Cj(i,t)}const o=E3(e.seriesColor?.toConfig());if(o!==void 0){r.seriesColor=o}const a=E3(e.negativeColor?.toConfig());if(a!==void 0){r.negativeColor=a}const s=E3(e.axisColor?.toConfig());if(s!==void 0){r.axisColor=s}const l=E3(e.markersColor?.toConfig());if(l!==void 0){r.markersColor=l}const u=E3(e.firstMarkerColor?.toConfig());if(u!==void 0){r.firstMarkerColor=u}const d=E3(e.lastMarkerColor?.toConfig());if(d!==void 0){r.lastMarkerColor=d}const f=E3(e.highMarkerColor?.toConfig());if(f!==void 0){r.highMarkerColor=f}const h=E3(e.lowMarkerColor?.toConfig());if(h!==void 0){r.lowMarkerColor=h}return r}function Cj(e,t){const n=xf(e);if(!n){throw new Error("Sparkline ranges must be attached to a worksheet.")}return{sheet:n.name||t,range:e.address}}function OOt(e){const{sheet:t,record:n}=e;if(!n.sqref){return null}const r={rule:A4r(n)};const i=k4r(n);if(i){r.prompt=i}const o=R4r(n);if(o){r.errorAlert=o}if(n.allowBlank!==void 0){r.ignoreBlanks=n.allowBlank}if(n.showDropDown!==void 0){r.inCellDropDown=!n.showDropDown}return{op:"datavalidation.set",target:{sheet:t,range:n.sqref},props:r}}function A4r(e){const t={type:h5t(e.type)};const n=I4r(e.operator);if(n!==void 0){t.operator=n}const r=P4r(e);if(r){t.values=r;return t}if(e.formula1!==void 0){t.formula1=e.formula1}if(e.formula2!==void 0){t.formula2=e.formula2}return t}function k4r(e){if(e.promptTitle===void 0&&e.promptMessage===void 0&&e.showInputMessage===void 0){return void 0}const t={};if(e.promptTitle!==void 0){t.title=e.promptTitle}if(e.promptMessage!==void 0){t.message=e.promptMessage}if(e.showInputMessage!==void 0){t.show=e.showInputMessage}return t}function R4r(e){if(e.errorTitle===void 0&&e.errorMessage===void 0&&e.errorStyle===void 0&&e.showErrorMessage===void 0){return void 0}const t={};if(e.errorTitle!==void 0){t.title=e.errorTitle}if(e.errorMessage!==void 0){t.message=e.errorMessage}const n=M4r(e.errorStyle);if(n!==void 0){t.style=n}if(e.showErrorMessage!==void 0){t.show=e.showErrorMessage}return t}function P4r(e){if(h5t(e.type)!=="list"){return void 0}if(e.formula2!==void 0){return void 0}const t=e.formula1?.trim();if(!t||t.length<2){return void 0}if(!t.startsWith('"')||!t.endsWith('"')){return void 0}const n=t.slice(1,-1);return n?n.split(","):[]}function h5t(e){switch(e){case 2:return"whole";case 3:return"decimal";case 4:return"list";case 5:return"date";case 6:return"time";case 7:return"textLength";case 8:return"custom";case 1:case 0:case-1:default:return"none"}}function I4r(e){switch(e){case 1:return"between";case 2:return"notBetween";case 3:return"equal";case 4:return"notEqual";case 5:return"lessThan";case 6:return"lessThanOrEqual";case 7:return"greaterThan";case 8:return"greaterThanOrEqual";default:return void 0}}function M4r(e){switch(e){case 1:return"stop";case 2:return"warning";case 3:return"information";default:return void 0}}function p5t(e){const{sheet:t,shape:n,as:r}=e;const i=L4r(n);if(!i){return null}const o={op:"shape.add",sheet:t,props:i};if(r){o.as=r}return o}function m5t(e){const{sheet:t,shape:n}=e;const r=g5t(n);if(!Object.values(r).some(i=>i!==void 0)){return null}return{op:"shape.set",target:{sheet:t,selector:xze(n)},props:r}}function xze(e){const t=e.toProto().shape?.geometry;const n=t?QOt[t]:void 0;return{anchor:e.anchor.toConfig(),...n?{geometry:n}:{},...e.name?{name:e.name}:{}}}function L4r(e){const t=g5t(e);const n=e.toProto().shape?.geometry;const r=n?QOt[n]:void 0;const i=F4r(e.line);if(!r||r==="custom"){return null}return{id:e.id,geometry:r,...t.anchor?{anchor:t.anchor}:{},...t.fill?{fill:t.fill}:{},...i?{line:i}:{}}}function g5t(e){const t=vze(e.fill);const n=D4r(e.line);return{name:e.name,zIndex:e.zIndex,placeholderType:e.placeholderType,placeholderIndex:e.placeholderIndex,position:e.position,anchor:e.anchor.toConfig(),...t!==void 0?{fill:t}:{},...n!==void 0?{line:n}:{}}}function D4r(e){const t=vze(e.fill);const n=e.style;const r=e.width;if(t===void 0&&n===void 0&&r===void 0){return void 0}return{...t!==void 0?{fill:t}:{},style:n??"solid",...r!==void 0?{width:r}:{}}}function F4r(e){const t=vze(e.fill);const n=e.style??"solid";const r=e.width;if(t===void 0&&n===void 0&&r===void 0){return void 0}return{style:n,...t!==void 0?{fill:t}:{},...r!==void 0?{width:r}:{}}}function vze(e){if(!e||typeof e!=="object"||!("toConfig"in e)||typeof e.toConfig!=="function"){return void 0}const t=e.toConfig();if(!t){return void 0}if(typeof t==="object"&&t!==null&&"type"in t){if(t.type==="proto"){return void 0}}return t}function y5t(e){const{sheet:t,source:n,anchor:r,as:i}=e;const o=N4r(n,r);if(!o){return null}const a={op:"image.add",sheet:t,props:o};if(i){a.as=i}return a}function b5t(e){const{sheet:t,image:n,previous:r,source:i,targetImageId:o}=e;return{op:"image.set",target:{...r,sheet:t,imageId:o??r.imageId},props:{imageId:n.imageId,anchor:n.anchor.toConfig(),...O4r(i)}}}function N4r(e,t){const n=hj(e);if("path"in n){const r={path:n.path};if("prompt"in n&&n.prompt!==void 0){r.prompt=n.prompt}if(t){r.anchor=t}return r}if("dataUrl"in n){const r={dataUrl:n.dataUrl};if(n.contentType!==void 0){r.contentType=n.contentType}if("prompt"in n&&n.prompt!==void 0){r.prompt=n.prompt}if(t){r.anchor=t}return r}if("uri"in n){const r={uri:n.uri};if("prompt"in n&&n.prompt!==void 0){r.prompt=n.prompt}if(t){r.anchor=t}return r}if("prompt"in n){return t?{prompt:n.prompt,anchor:t}:{prompt:n.prompt}}return null}function O4r(e){if(!e){return{}}const t=hj(e);if("path"in t){const n={path:t.path};if("prompt"in t&&t.prompt!==void 0){n.prompt=t.prompt}return n}if("dataUrl"in t){const n={dataUrl:t.dataUrl};if(t.contentType!==void 0){n.contentType=t.contentType}if("prompt"in t&&t.prompt!==void 0){n.prompt=t.prompt}return n}if("uri"in t){const n={uri:t.uri};if("prompt"in t&&t.prompt!==void 0){n.prompt=t.prompt}return n}if("prompt"in t){return{prompt:t.prompt}}return{}}var OT=class e{#e;#t;#n;#r;#i;#a;#o;constructor(t,n){this.#r=t.id;this.#t=t.target;this.#n=t.comments;this.#i=t.status;this.#a=t.resolvedBy;this.#o=t.resolvedAt;this.#e=n}static create(t,n){const r=pX.fromConfig(t.target);const i=n.resolveAuthorId(t.author);const o=_ze(n);const a=dz.create({id:t.id,authorId:i,createdAt:t.createdAt,body:t.body,position:t.position},o);return new e({id:t.id,target:r,comments:[a],status:t.status??1},n)}static fromProto(t,n){if(!t.id){throw new Error("Thread id is required.")}if(!t.target){throw new Error("Thread target is required.")}const r=_ze(n);const i=(t.comments??[]).map(o=>dz.fromProto(o,r));return new e({id:t.id,target:pX.fromProto(t.target),comments:i,status:t.status??0,resolvedBy:t.resolvedBy,resolvedAt:t.resolvedAt},n)}get id(){return this.#r}get target(){return this.#t}get comments(){return[...this.#n]}get status(){return this.#i}get resolvedBy(){return this.#a}get resolvedAt(){return this.#o}toSnapshot(){return{aid:`th/${this.#r}`,kind:"thread",id:this.#r,status:this.#i,target:{slideId:this.#t.slideId,elementId:this.#t.elementId,spreadsheetCell:this.#t.spreadsheetCell,spreadsheetRange:this.#t.spreadsheetRange},comments:this.#n.map(t=>({id:t.id,text:t.text,authorId:t.authorId,createdAt:t.createdAt}))}}addReply(t,n={}){const r=this.#n[0];if(!r){throw new Error("Cannot reply to a thread without a root comment.")}const i=this.#e.resolveAuthorId(n.author);const o=_ze(this.#e);const a=dz.create({id:n.id??Ob(),parentId:r.id,authorId:i,createdAt:n.createdAt,body:t,position:n.position},o);this.#n.push(a);this.#e.recordOp?.({op:"thread.reply",target:this.#s(),body:t,author:n.author,createdAt:n.createdAt,position:n.position});return a}getComment(t){return this.#n.find(n=>n.id===t)}resolve(t,n){this.#i=2;this.#a=this.#e.resolveAuthorId(t);this.#o=n??this.#e.now();this.#e.recordOp?.({op:"thread.resolve",target:this.#s()})}reopen(){this.#i=1;this.#a=void 0;this.#o=void 0;this.#e.recordOp?.({op:"thread.reopen",target:this.#s()})}delete(){this.#e.recordOp?.({op:"thread.remove",target:this.#s()});this.#e.removeThread(this)}toProto(){return{id:this.#r,target:this.#t.toProto(),comments:this.#n.map(t=>t.toProto()),status:this.#i,resolvedBy:this.#a,resolvedAt:this.#o}}#s(){const t=this.#n[0];const n=t5t({threadId:this.#r,target:{spreadsheetCell:this.#t.spreadsheetCell,spreadsheetRange:this.#t.spreadsheetRange},rootBody:t?.text,rootAuthorId:t?.authorId,rootCreatedAt:t?.createdAt});if(n){return n}return`th/${this.#r}`}};var _ze=e=>{return{resolveAuthorId:e.resolveAuthorId,now:e.now}};var Jge=class{#e=[];#t=new Map;#n;constructor(t=[],n){this.#n=n;t.forEach(r=>{this.#r(OT.fromProto(r,this.#o()))})}get items(){return[...this.#e]}getById(t){return this.#t.get(t)}add(t,n,r={}){return this.#a(t,n,r)}__addForApply(t,n,r={}){return this.#a(t,n,r)}toProto(){return this.#e.map(t=>t.toProto())}replace(t=[]){this.#e=[];this.#t=new Map;t.forEach(n=>{this.#r(OT.fromProto(n,this.#o()))})}#r(t){this.#e.push(t);this.#t.set(t.id,t)}#i(t){const n=this.#e.indexOf(t);if(n>=0){this.#e.splice(n,1)}this.#t.delete(t.id)}#a(t,n,r){const i=r.id??ec();const o=r.position??B4r(t);const a=OT.create({id:i,target:t,body:n,author:r.author,createdAt:r.createdAt,position:o,status:r.status},this.#o());this.#r(a);return a}#o(){return{resolveAuthorId:this.#n.resolveAuthorId,now:this.#n.now,removeThread:t=>this.#i(t),recordOp:this.#n.recordOp}}};var B4r=e=>{if("element"in e){return Tze(e.element)}if("textRange"in e){return Tze(e.textRange.element)}if("textMatch"in e){return Tze(e.textMatch.element)}if("slide"in e){return z4r(e.slide)}return void 0};var Tze=e=>{const t=e.frame;if(!t){return{x:0,y:0}}return{x:t.left??0,y:t.top??0}};var z4r=e=>{const t=e.frame;return{x:t.width/2,y:t.height/2}};var C3=class{people;threads;#e;#t;constructor(t={}){this.people=new kce(t.people??[]);this.#t=t.recordOp;this.threads=new Jge(t.threads??[],{resolveAuthorId:n=>this.#r(n),now:()=>this.#i(),recordOp:n=>this.#t?.(n)})}get self(){if(!this.#e){return void 0}return this.people.getById(this.#e)}setSelf(t){const n=this.#n(t);this.#e=n.id;this.#t?.({op:"comments.self.set",person:n.toProto()});return n}clearSelf(){this.#e=void 0}addThread(t,n,r={}){const i=this.threads.add(t,n,r);const o=i.comments[0];const a=o?this.people.getById(o.authorId)?.toProto():void 0;const s=e5t({threadId:i.id,target:{spreadsheetCell:i.target.spreadsheetCell,spreadsheetRange:i.target.spreadsheetRange},body:n,author:a,createdAt:o?.createdAt});if(s)this.#t?.(s);return i}__addThreadForApply(t,n,r={}){return this.threads.__addForApply(t,n,r)}getThread(t){return this.threads.getById(t)}toProto(){return{people:this.people.toProto(),threads:this.threads.toProto()}}replaceFromProto(t){const n=this.#e;this.people.replace(t.people??[]);this.threads.replace(t.threads??[]);if(n&&!this.people.getById(n)){this.#e=void 0}}#n(t){if(t instanceof TT){return this.people.register(t)}if(Sce(t)){return this.people.add(t)}if(Ace(t)){const n=this.people.getById(t.id);if(!n){throw new Error(`Person id not found: ${t.id}`)}return n}throw new Error("Unsupported person input.")}#r(t){if(!t){if(!this.#e){throw new Error("Comment author is required when self is not set. Call comments.self.set(...) or pass an author.")}return this.#e}return this.#n(t).id}#i(){return new Date().toISOString()}};bs();var Qge=class{#e;#t;#n;constructor(t){this.#e=t;this.#t=new Map;this.#n=new Map}createApi(t){const n=t;const r=this;return{addRange:(i,o,a)=>this.addRange(i,o,{...a,sheetName:a?.sheetName??n}),addFunction:(i,o)=>this.addFunction(i,{...o,sheetName:o.sheetName??n}),add:(i,o,a)=>{const s=typeof o==="string"?o:this.#f(o,n);this.addRange(i,s,{sheetName:n});return this.getItemApi(i,n)},getItem:i=>{const o=this.getItemApi(i,n);if(o.isNullObject){throw new Error(`Defined name ${i} not found`)}return o},getItemOrNullObject:i=>this.getItemApi(i,n),get items(){const i=n?r.#u(n):r.#c();return i.map(o=>new eye(r,o))}}}ingest(t){if(!t){return}for(const n of t){this.#i(n)}}replace(t){this.#t.clear();this.#n.clear();this.ingest(t);this.#e.onChange?.()}addRange(t,n,r){this.#r(t,n,r)}#r(t,n,r={}){const i=r.record??true;const o=this.normalizeName(t);if(!o){throw new Error("Defined name requires a non-empty name")}const a=this.normalizeFormula(n);const s=r.sheetName;const l=s!==void 0&&s!==null?this.#e.getLocalSheetIdByName(s):void 0;if(s&&l===void 0){throw new Error(`Worksheet ${s} was not found`)}const u={name:t,text:a.startsWith("=")?a.slice(1):a,localSheetId:l??void 0};this.#i(u,a);this.#e.onChange?.();if(i){this.#e.recordOp?.({op:"names.range.add",name:t,formula:x5t(a),description:r.description,sheet:s})}}addFunction(t,n){this.#r(t,n.lambda,{sheetName:n.sheetName,description:n.description,record:false});this.#e.recordOp?.({op:"names.function.add",name:t,lambda:x5t(this.normalizeFormula(n.lambda)),description:n.description,parameters:n.parameters,returns:n.returns,sheet:n.sheetName})}buildProto(){const t=[];const n=r=>{for(const i of r.values()){t.push({...i.proto})}};n(this.#t);for(const r of this.#n.values()){n(r)}return t}lookup(t,n){const r=n?.trim().toUpperCase();if(r&&this.#n.has(r)){const i=this.#n.get(r);const o=i?.get(t);if(o){return o}}return this.#t.get(t)}normalizeName(t){return t?.trim().toUpperCase()??""}normalizeFormula(t){if(!t){return"="}const n=t.trim();if(!n){return"="}return n.startsWith("=")?n:`=${n}`}parseEntry(t){if(!t.parsed){const n=PE(t.normalizedFormula);t.parsed=n;if(n.errors.length===0){t.isLambda=this.#s(n.expr)}}return t.parsed??null}makeGuardKey(t){return`${(t.scopeSheet??"__WORKBOOK__").toUpperCase()}::${t.normalizedName}`}resolveRange(t){const n=this.parseEntry(t);if(!n||n.errors.length>0){throw new Error(`Defined name "${t.proto.name??t.normalizedName}" has an invalid formula.`)}if(n.expr.kind!=="RangeRef"){throw new Error(`Defined name "${t.proto.name??t.normalizedName}" does not refer to a range.`)}const{sheetName:r,ref:i}=Pl(t.normalizedFormula);const o=r?.trim()||t.scopeSheet?.trim();if(!o){throw new Error(`Defined name "${t.proto.name??t.normalizedName}" refers to "${t.normalizedFormula}", which is missing a worksheet scope.`)}const a=this.#e.getWorksheetByName(o);if(!a){throw new Error(`Worksheet "${o}" was not found for defined name "${t.proto.name??t.normalizedName}".`)}return a.getRange(i)}#i(t,n){const r=this.normalizeName(t.name);if(!r||r.startsWith("_XLNM.")){return}const i=this.#e.getSheetNameByLocalId(t.localSheetId??null);const o=n??this.normalizeFormula(t.text);const a={proto:{...t},normalizedName:r,normalizedFormula:o,scopeSheet:i,parsed:void 0,isLambda:false};this.#a(a)}#a(t){if(t.scopeSheet){const n=this.#o(t.scopeSheet);n.set(t.normalizedName,t);return}this.#t.set(t.normalizedName,t)}#o(t){const n=t.trim().toUpperCase();let r=this.#n.get(n);if(!r){r=new Map;this.#n.set(n,r)}return r}#s(t){return t.kind==="FunctionCall"&&(t.name==="LAMBDA"||t.name==="_XLFN.LAMBDA")}delete(t,n){const r=this.normalizeName(t);if(!r){throw new Error("Defined name requires a non-empty name")}const i=this.#l(r,n);if(!i){throw new Error(`Defined name ${t} not found`)}if(i.scopeSheet){const o=i.scopeSheet.trim().toUpperCase();const a=this.#n.get(o);a?.delete(i.normalizedName)}else{this.#t.delete(i.normalizedName)}this.#e.onChange?.();this.#e.recordOp?.({op:"names.remove",name:i.proto.name??t,sheet:i.scopeSheet})}getItemApi(t,n){const r=this.normalizeName(t);if(!r){return new tye(t||"")}const i=this.#l(r,n);if(!i){return new tye(t)}return new eye(this,i)}#l(t,n){if(n){const r=n.trim().toUpperCase();const i=this.#n.get(r);return i?.get(t)}return this.#t.get(t)}#c(){return[...this.#t.values()].sort((t,n)=>t.normalizedName.localeCompare(n.normalizedName))}#u(t){const n=t.trim().toUpperCase();const r=this.#n.get(n);return r?[...r.values()].sort((i,o)=>i.normalizedName.localeCompare(o.normalizedName)):[]}#f(t,n){const r=xf(t);const i=r?.name??n??"";if(!i){throw new Error("Defined names require a worksheet-scoped Range when passing a Range input.")}const o=U4r(i);return`${o}!${t.address}`}};var eye=class{#e;#t;constructor(t,n){this.#e=t;this.#t=n}get isNullObject(){return false}get name(){return this.#t.proto.name??""}get formula(){return this.#t.normalizedFormula}getRange(){return this.#e.resolveRange(this.#t)}delete(){this.#e.delete(this.name,this.#t.scopeSheet)}};var tye=class{#e;constructor(t){this.#e=t}get isNullObject(){return true}get name(){return this.#e}get formula(){return"="}getRange(){const t=this.#e||"Unknown";throw new Error(`Defined name "${t}" not found.`)}delete(){const t=this.#e||"Unknown";throw new Error(`Defined name "${t}" not found.`)}};function U4r(e){const t=e.replace(/'/g,"''");return`'${t}'`}function x5t(e){return e.startsWith("=")?e.slice(1):e}function v5t(){return{id:void 0,charts:[],name:"",widthEmu:0,heightEmu:0,elements:[],images:[],footnotes:[],comments:[],commentReferences:[],textStyles:[],reviewMarks:[],sections:[],numberingDefinitions:[],paragraphNumberings:[],tableStyleDefinitions:[],endnotes:[],settings:void 0,theme:void 0,fonts:[]}}var FN={encode(e,t=new tn){if(e.id!==void 0){t.uint32(50).string(e.id)}for(const n of e.charts){dm.encode(n,t.uint32(10).fork()).join()}if(e.name!==""){t.uint32(18).string(e.name)}if(e.widthEmu!==0){t.uint32(24).int64(e.widthEmu)}if(e.heightEmu!==0){t.uint32(32).int64(e.heightEmu)}for(const n of e.elements){fl.encode(n,t.uint32(42).fork()).join()}for(const n of e.images){yy.encode(n,t.uint32(58).fork()).join()}for(const n of e.footnotes){nye.encode(n,t.uint32(66).fork()).join()}for(const n of e.comments){iye.encode(n,t.uint32(74).fork()).join()}for(const n of e.commentReferences){oye.encode(n,t.uint32(82).fork()).join()}for(const n of e.textStyles){h1.encode(n,t.uint32(90).fork()).join()}for(const n of e.reviewMarks){yX.encode(n,t.uint32(98).fork()).join()}for(const n of e.sections){gye.encode(n,t.uint32(106).fork()).join()}for(const n of e.numberingDefinitions){pye.encode(n,t.uint32(114).fork()).join()}for(const n of e.paragraphNumberings){mye.encode(n,t.uint32(122).fork()).join()}for(const n of e.tableStyleDefinitions){zI.encode(n,t.uint32(130).fork()).join()}for(const n of e.endnotes){rye.encode(n,t.uint32(138).fork()).join()}if(e.settings!==void 0){aye.encode(e.settings,t.uint32(146).fork()).join()}if(e.theme!==void 0){_0.encode(e.theme,t.uint32(154).fork()).join()}for(const n of e.fonts){lye.encode(n,t.uint32(162).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=v5t();while(n.pos>>3){case 6:{if(o!==50){break}i.id=n.string();continue}case 1:{if(o!==10){break}i.charts.push(dm.decode(n,n.uint32()));continue}case 2:{if(o!==18){break}i.name=n.string();continue}case 3:{if(o!==24){break}i.widthEmu=yye(n.int64());continue}case 4:{if(o!==32){break}i.heightEmu=yye(n.int64());continue}case 5:{if(o!==42){break}i.elements.push(fl.decode(n,n.uint32()));continue}case 7:{if(o!==58){break}i.images.push(yy.decode(n,n.uint32()));continue}case 8:{if(o!==66){break}i.footnotes.push(nye.decode(n,n.uint32()));continue}case 9:{if(o!==74){break}i.comments.push(iye.decode(n,n.uint32()));continue}case 10:{if(o!==82){break}i.commentReferences.push(oye.decode(n,n.uint32()));continue}case 11:{if(o!==90){break}i.textStyles.push(h1.decode(n,n.uint32()));continue}case 12:{if(o!==98){break}i.reviewMarks.push(yX.decode(n,n.uint32()));continue}case 13:{if(o!==106){break}i.sections.push(gye.decode(n,n.uint32()));continue}case 14:{if(o!==114){break}i.numberingDefinitions.push(pye.decode(n,n.uint32()));continue}case 15:{if(o!==122){break}i.paragraphNumberings.push(mye.decode(n,n.uint32()));continue}case 16:{if(o!==130){break}i.tableStyleDefinitions.push(zI.decode(n,n.uint32()));continue}case 17:{if(o!==138){break}i.endnotes.push(rye.decode(n,n.uint32()));continue}case 18:{if(o!==146){break}i.settings=aye.decode(n,n.uint32());continue}case 19:{if(o!==154){break}i.theme=_0.decode(n,n.uint32());continue}case 20:{if(o!==162){break}i.fonts.push(lye.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return FN.fromPartial(e??{})},fromPartial(e){const t=v5t();t.id=e.id??void 0;t.charts=e.charts?.map(n=>dm.fromPartial(n))||[];t.name=e.name??"";t.widthEmu=e.widthEmu??0;t.heightEmu=e.heightEmu??0;t.elements=e.elements?.map(n=>fl.fromPartial(n))||[];t.images=e.images?.map(n=>yy.fromPartial(n))||[];t.footnotes=e.footnotes?.map(n=>nye.fromPartial(n))||[];t.comments=e.comments?.map(n=>iye.fromPartial(n))||[];t.commentReferences=e.commentReferences?.map(n=>oye.fromPartial(n))||[];t.textStyles=e.textStyles?.map(n=>h1.fromPartial(n))||[];t.reviewMarks=e.reviewMarks?.map(n=>yX.fromPartial(n))||[];t.sections=e.sections?.map(n=>gye.fromPartial(n))||[];t.numberingDefinitions=e.numberingDefinitions?.map(n=>pye.fromPartial(n))||[];t.paragraphNumberings=e.paragraphNumberings?.map(n=>mye.fromPartial(n))||[];t.tableStyleDefinitions=e.tableStyleDefinitions?.map(n=>zI.fromPartial(n))||[];t.endnotes=e.endnotes?.map(n=>rye.fromPartial(n))||[];t.settings=e.settings!==void 0&&e.settings!==null?aye.fromPartial(e.settings):void 0;t.theme=e.theme!==void 0&&e.theme!==null?_0.fromPartial(e.theme):void 0;t.fonts=e.fonts?.map(n=>lye.fromPartial(n))||[];return t}};function _5t(){return{id:"",paragraphs:[],referenceRunIds:[]}}var nye={encode(e,t=new tn){if(e.id!==""){t.uint32(10).string(e.id)}for(const n of e.paragraphs){jd.encode(n,t.uint32(18).fork()).join()}for(const n of e.referenceRunIds){t.uint32(26).string(n)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=_5t();while(n.pos>>3){case 1:{if(o!==10){break}i.id=n.string();continue}case 2:{if(o!==18){break}i.paragraphs.push(jd.decode(n,n.uint32()));continue}case 3:{if(o!==26){break}i.referenceRunIds.push(n.string());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return nye.fromPartial(e??{})},fromPartial(e){const t=_5t();t.id=e.id??"";t.paragraphs=e.paragraphs?.map(n=>jd.fromPartial(n))||[];t.referenceRunIds=e.referenceRunIds?.map(n=>n)||[];return t}};function T5t(){return{id:"",paragraphs:[],referenceRunIds:[]}}var rye={encode(e,t=new tn){if(e.id!==""){t.uint32(10).string(e.id)}for(const n of e.paragraphs){jd.encode(n,t.uint32(18).fork()).join()}for(const n of e.referenceRunIds){t.uint32(26).string(n)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=T5t();while(n.pos>>3){case 1:{if(o!==10){break}i.id=n.string();continue}case 2:{if(o!==18){break}i.paragraphs.push(jd.decode(n,n.uint32()));continue}case 3:{if(o!==26){break}i.referenceRunIds.push(n.string());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return rye.fromPartial(e??{})},fromPartial(e){const t=T5t();t.id=e.id??"";t.paragraphs=e.paragraphs?.map(n=>jd.fromPartial(n))||[];t.referenceRunIds=e.referenceRunIds?.map(n=>n)||[];return t}};function w5t(){return{id:"",author:"",initials:"",createdAt:"",paragraphs:[]}}var iye={encode(e,t=new tn){if(e.id!==""){t.uint32(10).string(e.id)}if(e.author!==""){t.uint32(18).string(e.author)}if(e.initials!==""){t.uint32(26).string(e.initials)}if(e.createdAt!==""){t.uint32(34).string(e.createdAt)}for(const n of e.paragraphs){jd.encode(n,t.uint32(42).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=w5t();while(n.pos>>3){case 1:{if(o!==10){break}i.id=n.string();continue}case 2:{if(o!==18){break}i.author=n.string();continue}case 3:{if(o!==26){break}i.initials=n.string();continue}case 4:{if(o!==34){break}i.createdAt=n.string();continue}case 5:{if(o!==42){break}i.paragraphs.push(jd.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return iye.fromPartial(e??{})},fromPartial(e){const t=w5t();t.id=e.id??"";t.author=e.author??"";t.initials=e.initials??"";t.createdAt=e.createdAt??"";t.paragraphs=e.paragraphs?.map(n=>jd.fromPartial(n))||[];return t}};function E5t(){return{commentId:"",runIds:[]}}var oye={encode(e,t=new tn){if(e.commentId!==""){t.uint32(10).string(e.commentId)}for(const n of e.runIds){t.uint32(18).string(n)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=E5t();while(n.pos>>3){case 1:{if(o!==10){break}i.commentId=n.string();continue}case 2:{if(o!==18){break}i.runIds.push(n.string());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return oye.fromPartial(e??{})},fromPartial(e){const t=E5t();t.commentId=e.commentId??"";t.runIds=e.runIds?.map(n=>n)||[];return t}};function C5t(){return{numberingFormat:void 0,defaultNoteIds:[],numberingStart:void 0,numberingRestart:void 0,position:void 0}}var DN={encode(e,t=new tn){if(e.numberingFormat!==void 0){t.uint32(10).string(e.numberingFormat)}for(const n of e.defaultNoteIds){t.uint32(18).string(n)}if(e.numberingStart!==void 0){t.uint32(24).int32(e.numberingStart)}if(e.numberingRestart!==void 0){t.uint32(34).string(e.numberingRestart)}if(e.position!==void 0){t.uint32(42).string(e.position)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=C5t();while(n.pos>>3){case 1:{if(o!==10){break}i.numberingFormat=n.string();continue}case 2:{if(o!==18){break}i.defaultNoteIds.push(n.string());continue}case 3:{if(o!==24){break}i.numberingStart=n.int32();continue}case 4:{if(o!==34){break}i.numberingRestart=n.string();continue}case 5:{if(o!==42){break}i.position=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return DN.fromPartial(e??{})},fromPartial(e){const t=C5t();t.numberingFormat=e.numberingFormat??void 0;t.defaultNoteIds=e.defaultNoteIds?.map(n=>n)||[];t.numberingStart=e.numberingStart??void 0;t.numberingRestart=e.numberingRestart??void 0;t.position=e.position??void 0;return t}};function S5t(){return{defaultTabStop:void 0,autoHyphenation:void 0,mirrorMargins:void 0,footnoteProperties:void 0,endnoteProperties:void 0,displayBackgroundShape:void 0,backgroundFill:void 0}}var aye={encode(e,t=new tn){if(e.defaultTabStop!==void 0){t.uint32(8).int32(e.defaultTabStop)}if(e.autoHyphenation!==void 0){t.uint32(16).bool(e.autoHyphenation)}if(e.mirrorMargins!==void 0){t.uint32(24).bool(e.mirrorMargins)}if(e.footnoteProperties!==void 0){DN.encode(e.footnoteProperties,t.uint32(34).fork()).join()}if(e.endnoteProperties!==void 0){DN.encode(e.endnoteProperties,t.uint32(42).fork()).join()}if(e.displayBackgroundShape!==void 0){t.uint32(48).bool(e.displayBackgroundShape)}if(e.backgroundFill!==void 0){Ei.encode(e.backgroundFill,t.uint32(58).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=S5t();while(n.pos>>3){case 1:{if(o!==8){break}i.defaultTabStop=n.int32();continue}case 2:{if(o!==16){break}i.autoHyphenation=n.bool();continue}case 3:{if(o!==24){break}i.mirrorMargins=n.bool();continue}case 4:{if(o!==34){break}i.footnoteProperties=DN.decode(n,n.uint32());continue}case 5:{if(o!==42){break}i.endnoteProperties=DN.decode(n,n.uint32());continue}case 6:{if(o!==48){break}i.displayBackgroundShape=n.bool();continue}case 7:{if(o!==58){break}i.backgroundFill=Ei.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return aye.fromPartial(e??{})},fromPartial(e){const t=S5t();t.defaultTabStop=e.defaultTabStop??void 0;t.autoHyphenation=e.autoHyphenation??void 0;t.mirrorMargins=e.mirrorMargins??void 0;t.footnoteProperties=e.footnoteProperties!==void 0&&e.footnoteProperties!==null?DN.fromPartial(e.footnoteProperties):void 0;t.endnoteProperties=e.endnoteProperties!==void 0&&e.endnoteProperties!==null?DN.fromPartial(e.endnoteProperties):void 0;t.displayBackgroundShape=e.displayBackgroundShape??void 0;t.backgroundFill=e.backgroundFill!==void 0&&e.backgroundFill!==null?Ei.fromPartial(e.backgroundFill):void 0;return t}};function A5t(){return{relationshipId:"",key:void 0,type:0,contentType:"",data:new Uint8Array(0),subsetted:void 0}}var sye={encode(e,t=new tn){if(e.relationshipId!==""){t.uint32(10).string(e.relationshipId)}if(e.key!==void 0){t.uint32(18).string(e.key)}if(e.type!==0){t.uint32(24).int32(e.type)}if(e.contentType!==""){t.uint32(34).string(e.contentType)}if(e.data.length!==0){t.uint32(42).bytes(e.data)}if(e.subsetted!==void 0){t.uint32(48).bool(e.subsetted)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=A5t();while(n.pos>>3){case 1:{if(o!==10){break}i.relationshipId=n.string();continue}case 2:{if(o!==18){break}i.key=n.string();continue}case 3:{if(o!==24){break}i.type=n.int32();continue}case 4:{if(o!==34){break}i.contentType=n.string();continue}case 5:{if(o!==42){break}i.data=n.bytes();continue}case 6:{if(o!==48){break}i.subsetted=n.bool();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return sye.fromPartial(e??{})},fromPartial(e){const t=A5t();t.relationshipId=e.relationshipId??"";t.key=e.key??void 0;t.type=e.type??0;t.contentType=e.contentType??"";t.data=e.data??new Uint8Array(0);t.subsetted=e.subsetted??void 0;return t}};function k5t(){return{name:"",altName:void 0,family:void 0,embeddedFonts:[]}}var lye={encode(e,t=new tn){if(e.name!==""){t.uint32(10).string(e.name)}if(e.altName!==void 0){t.uint32(18).string(e.altName)}if(e.family!==void 0){t.uint32(26).string(e.family)}for(const n of e.embeddedFonts){sye.encode(n,t.uint32(34).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=k5t();while(n.pos>>3){case 1:{if(o!==10){break}i.name=n.string();continue}case 2:{if(o!==18){break}i.altName=n.string();continue}case 3:{if(o!==26){break}i.family=n.string();continue}case 4:{if(o!==34){break}i.embeddedFonts.push(sye.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return lye.fromPartial(e??{})},fromPartial(e){const t=k5t();t.name=e.name??"";t.altName=e.altName??void 0;t.family=e.family??void 0;t.embeddedFonts=e.embeddedFonts?.map(n=>sye.fromPartial(n))||[];return t}};function R5t(){return{top:0,bottom:0,left:0,right:0,header:0,footer:0,gutter:0}}var cye={encode(e,t=new tn){if(e.top!==0){t.uint32(8).int32(e.top)}if(e.bottom!==0){t.uint32(16).int32(e.bottom)}if(e.left!==0){t.uint32(24).int32(e.left)}if(e.right!==0){t.uint32(32).int32(e.right)}if(e.header!==0){t.uint32(40).int32(e.header)}if(e.footer!==0){t.uint32(48).int32(e.footer)}if(e.gutter!==0){t.uint32(56).int32(e.gutter)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=R5t();while(n.pos>>3){case 1:{if(o!==8){break}i.top=n.int32();continue}case 2:{if(o!==16){break}i.bottom=n.int32();continue}case 3:{if(o!==24){break}i.left=n.int32();continue}case 4:{if(o!==32){break}i.right=n.int32();continue}case 5:{if(o!==40){break}i.header=n.int32();continue}case 6:{if(o!==48){break}i.footer=n.int32();continue}case 7:{if(o!==56){break}i.gutter=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return cye.fromPartial(e??{})},fromPartial(e){const t=R5t();t.top=e.top??0;t.bottom=e.bottom??0;t.left=e.left??0;t.right=e.right??0;t.header=e.header??0;t.footer=e.footer??0;t.gutter=e.gutter??0;return t}};function P5t(){return{widthEmu:0,heightEmu:0,pageMargin:void 0}}var uye={encode(e,t=new tn){if(e.widthEmu!==0){t.uint32(8).int64(e.widthEmu)}if(e.heightEmu!==0){t.uint32(16).int64(e.heightEmu)}if(e.pageMargin!==void 0){cye.encode(e.pageMargin,t.uint32(26).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=P5t();while(n.pos>>3){case 1:{if(o!==8){break}i.widthEmu=yye(n.int64());continue}case 2:{if(o!==16){break}i.heightEmu=yye(n.int64());continue}case 3:{if(o!==26){break}i.pageMargin=cye.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return uye.fromPartial(e??{})},fromPartial(e){const t=P5t();t.widthEmu=e.widthEmu??0;t.heightEmu=e.heightEmu??0;t.pageMargin=e.pageMargin!==void 0&&e.pageMargin!==null?cye.fromPartial(e.pageMargin):void 0;return t}};function I5t(){return{count:0,space:0,widths:[],hasSeparatorLine:false}}var dye={encode(e,t=new tn){if(e.count!==0){t.uint32(8).int32(e.count)}if(e.space!==0){t.uint32(16).int32(e.space)}t.uint32(26).fork();for(const n of e.widths){t.int32(n)}t.join();if(e.hasSeparatorLine!==false){t.uint32(32).bool(e.hasSeparatorLine)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=I5t();while(n.pos>>3){case 1:{if(o!==8){break}i.count=n.int32();continue}case 2:{if(o!==16){break}i.space=n.int32();continue}case 3:{if(o===24){i.widths.push(n.int32());continue}if(o===26){const a=n.uint32()+n.pos;while(n.posn)||[];t.hasSeparatorLine=e.hasSeparatorLine??false;return t}};function M5t(){return{type:void 0,linePitch:void 0,charSpace:void 0}}var fye={encode(e,t=new tn){if(e.type!==void 0){t.uint32(10).string(e.type)}if(e.linePitch!==void 0){t.uint32(16).int32(e.linePitch)}if(e.charSpace!==void 0){t.uint32(24).int32(e.charSpace)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=M5t();while(n.pos>>3){case 1:{if(o!==10){break}i.type=n.string();continue}case 2:{if(o!==16){break}i.linePitch=n.int32();continue}case 3:{if(o!==24){break}i.charSpace=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return fye.fromPartial(e??{})},fromPartial(e){const t=M5t();t.type=e.type??void 0;t.linePitch=e.linePitch??void 0;t.charSpace=e.charSpace??void 0;return t}};function L5t(){return{elements:[]}}var C1={encode(e,t=new tn){for(const n of e.elements){fl.encode(n,t.uint32(10).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=L5t();while(n.pos>>3){case 1:{if(o!==10){break}i.elements.push(fl.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return C1.fromPartial(e??{})},fromPartial(e){const t=L5t();t.elements=e.elements?.map(n=>fl.fromPartial(n))||[];return t}};function D5t(){return{level:0,numberFormat:"",levelText:"",startAt:0,paragraphStyleId:""}}var hye={encode(e,t=new tn){if(e.level!==0){t.uint32(8).int32(e.level)}if(e.numberFormat!==""){t.uint32(18).string(e.numberFormat)}if(e.levelText!==""){t.uint32(26).string(e.levelText)}if(e.startAt!==0){t.uint32(32).int32(e.startAt)}if(e.paragraphStyleId!==""){t.uint32(42).string(e.paragraphStyleId)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=D5t();while(n.pos>>3){case 1:{if(o!==8){break}i.level=n.int32();continue}case 2:{if(o!==18){break}i.numberFormat=n.string();continue}case 3:{if(o!==26){break}i.levelText=n.string();continue}case 4:{if(o!==32){break}i.startAt=n.int32();continue}case 5:{if(o!==42){break}i.paragraphStyleId=n.string();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return hye.fromPartial(e??{})},fromPartial(e){const t=D5t();t.level=e.level??0;t.numberFormat=e.numberFormat??"";t.levelText=e.levelText??"";t.startAt=e.startAt??0;t.paragraphStyleId=e.paragraphStyleId??"";return t}};function F5t(){return{numId:"",abstractNumId:"",levels:[]}}var pye={encode(e,t=new tn){if(e.numId!==""){t.uint32(10).string(e.numId)}if(e.abstractNumId!==""){t.uint32(18).string(e.abstractNumId)}for(const n of e.levels){hye.encode(n,t.uint32(26).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=F5t();while(n.pos>>3){case 1:{if(o!==10){break}i.numId=n.string();continue}case 2:{if(o!==18){break}i.abstractNumId=n.string();continue}case 3:{if(o!==26){break}i.levels.push(hye.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return pye.fromPartial(e??{})},fromPartial(e){const t=F5t();t.numId=e.numId??"";t.abstractNumId=e.abstractNumId??"";t.levels=e.levels?.map(n=>hye.fromPartial(n))||[];return t}};function N5t(){return{paragraphId:"",numId:"",level:0}}var mye={encode(e,t=new tn){if(e.paragraphId!==""){t.uint32(10).string(e.paragraphId)}if(e.numId!==""){t.uint32(18).string(e.numId)}if(e.level!==0){t.uint32(24).int32(e.level)}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=N5t();while(n.pos>>3){case 1:{if(o!==10){break}i.paragraphId=n.string();continue}case 2:{if(o!==18){break}i.numId=n.string();continue}case 3:{if(o!==24){break}i.level=n.int32();continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return mye.fromPartial(e??{})},fromPartial(e){const t=N5t();t.paragraphId=e.paragraphId??"";t.numId=e.numId??"";t.level=e.level??0;return t}};function O5t(){return{id:"",breakType:0,pageSetup:void 0,columns:void 0,elements:[],header:void 0,footer:void 0,startsWithPageBreak:false,pageNumberStart:void 0,pageNumberFormat:void 0,differentFirstPage:void 0,firstHeader:void 0,firstFooter:void 0,documentGrid:void 0}}var gye={encode(e,t=new tn){if(e.id!==""){t.uint32(10).string(e.id)}if(e.breakType!==0){t.uint32(16).int32(e.breakType)}if(e.pageSetup!==void 0){uye.encode(e.pageSetup,t.uint32(26).fork()).join()}if(e.columns!==void 0){dye.encode(e.columns,t.uint32(34).fork()).join()}for(const n of e.elements){fl.encode(n,t.uint32(42).fork()).join()}if(e.header!==void 0){C1.encode(e.header,t.uint32(50).fork()).join()}if(e.footer!==void 0){C1.encode(e.footer,t.uint32(58).fork()).join()}if(e.startsWithPageBreak!==false){t.uint32(64).bool(e.startsWithPageBreak)}if(e.pageNumberStart!==void 0){t.uint32(72).int32(e.pageNumberStart)}if(e.pageNumberFormat!==void 0){t.uint32(82).string(e.pageNumberFormat)}if(e.differentFirstPage!==void 0){t.uint32(88).bool(e.differentFirstPage)}if(e.firstHeader!==void 0){C1.encode(e.firstHeader,t.uint32(98).fork()).join()}if(e.firstFooter!==void 0){C1.encode(e.firstFooter,t.uint32(106).fork()).join()}if(e.documentGrid!==void 0){fye.encode(e.documentGrid,t.uint32(114).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=O5t();while(n.pos>>3){case 1:{if(o!==10){break}i.id=n.string();continue}case 2:{if(o!==16){break}i.breakType=n.int32();continue}case 3:{if(o!==26){break}i.pageSetup=uye.decode(n,n.uint32());continue}case 4:{if(o!==34){break}i.columns=dye.decode(n,n.uint32());continue}case 5:{if(o!==42){break}i.elements.push(fl.decode(n,n.uint32()));continue}case 6:{if(o!==50){break}i.header=C1.decode(n,n.uint32());continue}case 7:{if(o!==58){break}i.footer=C1.decode(n,n.uint32());continue}case 8:{if(o!==64){break}i.startsWithPageBreak=n.bool();continue}case 9:{if(o!==72){break}i.pageNumberStart=n.int32();continue}case 10:{if(o!==82){break}i.pageNumberFormat=n.string();continue}case 11:{if(o!==88){break}i.differentFirstPage=n.bool();continue}case 12:{if(o!==98){break}i.firstHeader=C1.decode(n,n.uint32());continue}case 13:{if(o!==106){break}i.firstFooter=C1.decode(n,n.uint32());continue}case 14:{if(o!==114){break}i.documentGrid=fye.decode(n,n.uint32());continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return gye.fromPartial(e??{})},fromPartial(e){const t=O5t();t.id=e.id??"";t.breakType=e.breakType??0;t.pageSetup=e.pageSetup!==void 0&&e.pageSetup!==null?uye.fromPartial(e.pageSetup):void 0;t.columns=e.columns!==void 0&&e.columns!==null?dye.fromPartial(e.columns):void 0;t.elements=e.elements?.map(n=>fl.fromPartial(n))||[];t.header=e.header!==void 0&&e.header!==null?C1.fromPartial(e.header):void 0;t.footer=e.footer!==void 0&&e.footer!==null?C1.fromPartial(e.footer):void 0;t.startsWithPageBreak=e.startsWithPageBreak??false;t.pageNumberStart=e.pageNumberStart??void 0;t.pageNumberFormat=e.pageNumberFormat??void 0;t.differentFirstPage=e.differentFirstPage??void 0;t.firstHeader=e.firstHeader!==void 0&&e.firstHeader!==null?C1.fromPartial(e.firstHeader):void 0;t.firstFooter=e.firstFooter!==void 0&&e.firstFooter!==null?C1.fromPartial(e.firstFooter):void 0;t.documentGrid=e.documentGrid!==void 0&&e.documentGrid!==null?fye.fromPartial(e.documentGrid):void 0;return t}};function B5t(){return{id:void 0,elements:[],charts:[]}}var Jz={encode(e,t=new tn){if(e.id!==void 0){t.uint32(10).string(e.id)}for(const n of e.elements){fl.encode(n,t.uint32(18).fork()).join()}for(const n of e.charts){dm.encode(n,t.uint32(26).fork()).join()}return t},decode(e,t){const n=e instanceof Ue?e:new Ue(e);let r=t===void 0?n.len:n.pos+t;const i=B5t();while(n.pos>>3){case 1:{if(o!==10){break}i.id=n.string();continue}case 2:{if(o!==18){break}i.elements.push(fl.decode(n,n.uint32()));continue}case 3:{if(o!==26){break}i.charts.push(dm.decode(n,n.uint32()));continue}}if((o&7)===4||o===0){break}n.skip(o&7)}return i},create(e){return Jz.fromPartial(e??{})},fromPartial(e){const t=B5t();t.id=e.id??void 0;t.elements=e.elements?.map(n=>fl.fromPartial(n))||[];t.charts=e.charts?.map(n=>dm.fromPartial(n))||[];return t}};var Sj=(()=>{if(typeof globalThis!=="undefined"){return globalThis}if(typeof self!=="undefined"){return self}if(typeof window!=="undefined"){return window}if(typeof global!=="undefined"){return global}throw"Unable to locate global object"})();function yye(e){const t=Sj.Number(e.toString());if(t>Sj.Number.MAX_SAFE_INTEGER){throw new Sj.Error("Value is larger than Number.MAX_SAFE_INTEGER")}if(t0?t:void 0}};var wze=class{#e;constructor(t){this.#e=t}get numberFormat(){return this.#e.numberFormatCode}set numberFormat(t){this.#e.numberFormatCode=t}};var U5t=e=>typeof e==="object"&&e!==null&&!Array.isArray(e);var V4r=e=>{if(e!==void 0&&(!Number.isFinite(e)||e<2||e>1e3)){throw new Error("Logarithmic axis base must be from 2 through 1000")}return e};var V5t=e=>{if(typeof e!=="string"){return e}const t=e.trim();if(!t){return void 0}switch(t.toLowerCase()){case"nextto":return"nextTo";case"nexttoaxis":case"next_to_axis":case"next-to-axis":return"nextTo";case"high":return"high";case"low":return"low";case"none":return"none";default:return t}};var Eze=class{#e;constructor(t){this.#e=t}get text(){return this.#e.getText()}set text(t){this.#e.setText(t??void 0)}get textStyle(){return this.#e.textStyle}};var ME=class{#e;#t;#n;#r;#i;#a;#o;#s;#l;#c;#u;#f;#d;#p;#m;#h;#g;#y;#x;#v;#_;#E;#S;#C=false;#b;#T;#k;#P;#A;#w;#I;#M;#F;#L;#O;#B;#D;#z;#N;#R(){this.#C=false}constructor(t,n){this.#t=t?.id;this.#n=t?.kind;this.#r=t?.crossingAxisId;this.#i=t?.categoryGapWidth;this.#a=t?.unit;this.#o=t?.baseTimeUnit;this.#s=t?.majorTimeUnit;this.#l=t?.minorTimeUnit;this.#e=t?.kind===2?"dateAxis":t?.kind===1?"textAxis":void 0;this.#p=t?.title;this.#m=t?.titleManualLayout?structuredClone(t.titleManualLayout):void 0;this.#h=t?.titleOverlay;this.#g=t?.numberFormatCode;this.#y=t?.numberFormatSourceLinked;this.#x=t?.min;this.#v=t?.max;this.#_=t?.logBase;this.#E=t?.majorUnit;this.#S=t?.minorUnit;this.#e=t?.axisType;this.#c=t?.tickLabelInterval;this.#u=t?.tickMarkInterval;this.#f=t?.tickLabelDistanceFromAxis;this.#d=t?.labelOffsetPercent;this.#C=t?.deleted??false;n?.addTextStyle(t?.titleTextStyle);this.#b=new ko(t?.titleTextStyle);this.#T=new Eze({getText:()=>this.#p,setText:r=>{this.#p=r??void 0;if(r!==void 0){if(r){this.#h??=false}this.#R()}},textStyle:this.#b});n?.addTextStyle(t?.textStyle);this.#k=new ko(t?.textStyle);this.#P=new eo({type:"proto",proto:t?.line});this.#P.setChangeHandler(()=>this.#R());this.#A=new eo({type:"proto",proto:t?.majorGridlines});this.#w=new eo({type:"proto",proto:t?.minorGridlines});this.#I=t?.position?G3t[t.position]:void 0;this.#M=t?.orientation?W3t[t.orientation]:void 0;this.#F=t?.majorTickMark?A6e[t.majorTickMark]:void 0;this.#L=t?.minorTickMark?A6e[t.minorTickMark]:void 0;this.#O=t?.tickLabelPosition?Y3t[t.tickLabelPosition]:void 0;this.#B=t?.crossBetween?X3t[t.crossBetween]:void 0;this.#D=t?.crosses?K3t[t.crosses]:void 0;this.#z=t?.crossValue;this.#N=new wze(this)}get format(){return this.#N}get axisType(){return this.#e}set axisType(t){this.#e=t??void 0;this.#n=t==="dateAxis"?2:t==="textAxis"?1:void 0;if(t!==void 0){this.#R()}}get tickLabelInterval(){return this.#c}set tickLabelInterval(t){this.#c=t??void 0;if(t!==void 0){this.#R()}}get tickMarkInterval(){return this.#u}set tickMarkInterval(t){this.#u=t??void 0;if(t!==void 0){this.#R()}}get tickLabelDistanceFromAxis(){return this.#f}set tickLabelDistanceFromAxis(t){this.#f=t??void 0;if(t!==void 0){this.#R()}}get labelOffsetPercent(){return this.#d}set labelOffsetPercent(t){if(t!==void 0&&(!Number.isInteger(t)||t<0||t>1e3)){throw new Error("Axis label offset must be from 0 through 1000 percent")}this.#d=t;if(t!==void 0){this.#R()}}get line(){return this.#P}set line(t){this.#P=t;this.#P.setChangeHandler(()=>this.#R());this.#R()}get title(){return this.#T}get titleManualLayout(){return this.#m}set title(t){if(typeof t==="string"){this.#T.text=t;return}if(t==null){this.#T.text=void 0;return}if(!U5t(t)){return}this.#R();if("text"in t){const n=t.text;this.#T.text=typeof n==="string"?n:void 0}if("textStyle"in t){const n=t.textStyle;const r=lN(n);if(r){Uf(this.#T.textStyle,r)}}}get numberFormatCode(){return this.#g}set numberFormatCode(t){this.#g=t??void 0;if(t!==void 0){this.#R()}}get numberFormatSourceLinked(){return this.#y}set numberFormatSourceLinked(t){this.#y=t===void 0?void 0:Boolean(t);if(t!==void 0){this.#R()}}get min(){return this.#x}get textStyle(){return this.#k}set textStyle(t){this.#k=t;this.#R()}get majorGridlines(){return this.#A}set majorGridlines(t){if(!t){this.#A=new eo}else{this.#A=t}}get minorGridlines(){return this.#w}set minorGridlines(t){this.#w=t??new eo}get position(){return this.#I}set position(t){this.#I=t??void 0;if(t!==void 0){this.#R()}}get orientation(){return this.#M}set orientation(t){this.#M=t??void 0;if(t!==void 0){this.#R()}}get majorTickMark(){return this.#F}set majorTickMark(t){this.#F=t??void 0;if(t!==void 0){this.#R()}}get minorTickMark(){return this.#L}set minorTickMark(t){this.#L=t??void 0;if(t!==void 0){this.#R()}}get tickLabelPosition(){return this.#O}set tickLabelPosition(t){const n=t===void 0?void 0:V5t(t);this.#O=n??void 0;if(t!==void 0){this.#R()}}get crossBetween(){return this.#B}set crossBetween(t){this.#B=t??void 0;if(t!==void 0){this.#R()}}get crosses(){return this.#D}set crosses(t){this.#D=t??void 0;if(this.#D!=="at"){this.#z=void 0}if(t!==void 0){this.#R()}}get crossesAt(){return this.#z}set crossesAt(t){this.#z=t??void 0;if(this.#z!==void 0){this.#D="at";this.#R()}}set min(t){this.#x=t??void 0;if(t!==void 0){this.#R()}}get max(){return this.#v}set max(t){this.#v=t??void 0;if(t!==void 0){this.#R()}}get logBase(){return this.#_}set logBase(t){this.#_=V4r(t);if(t!==void 0){this.#R()}}get majorUnit(){return this.#E}set majorUnit(t){this.#E=t??void 0;if(t!==void 0){this.#R()}}get minorUnit(){return this.#S}set minorUnit(t){this.#S=t??void 0;if(t!==void 0){this.#R()}}get deleted(){return this.#C}set deleted(t){this.#C=Boolean(t)}get visible(){return!this.#C}set visible(t){this.#C=!t}toProto(){const t={};if(this.#t!==void 0){t.id=this.#t}if(this.#n!==void 0){t.kind=this.#n}if(this.#r!==void 0){t.crossingAxisId=this.#r}if(this.#i!==void 0){t.categoryGapWidth=this.#i}if(this.#a!==void 0){t.unit=this.#a}if(this.#o!==void 0){t.baseTimeUnit=this.#o}if(this.#s!==void 0){t.majorTimeUnit=this.#s}if(this.#l!==void 0){t.minorTimeUnit=this.#l}if(this.#p){t.title=this.#p}if(this.#h!==void 0){t.titleOverlay=this.#h}if(this.#m){t.titleManualLayout=structuredClone(this.#m)}if(this.#g){t.numberFormatCode=this.#g}if(this.#y!==void 0){t.numberFormatSourceLinked=this.#y}if(this.#x!==void 0){t.min=this.#x}if(this.#v!==void 0){t.max=this.#v}if(this.#_!==void 0){t.logBase=this.#_}if(this.#E!==void 0){t.majorUnit=this.#E}if(this.#S!==void 0){t.minorUnit=this.#S}const n=this.#k.toProto();if(this.#k.isSet){t.textStyle=n}const r=this.#b.toProto();if(this.#b.isSet){t.titleTextStyle=r}const i=this.#P.toProto();if(i){t.line=i}const o=this.#A.toProto();if(o){t.majorGridlines=o}const a=this.#w.toProto();if(a){t.minorGridlines=a}if(this.#I){t.position=$3t[this.#I]}if(this.#M){t.orientation=H3t[this.#M]}if(this.#F){t.majorTickMark=S6e[this.#F]}if(this.#L){t.minorTickMark=S6e[this.#L]}if(this.#O&&this.#O in k6e){t.tickLabelPosition=k6e[this.#O]}if(this.#B){t.crossBetween=q3t[this.#B]}if(this.#D){t.crosses=j3t[this.#D]}if(this.#z!==void 0){t.crossValue=this.#z}if(this.#C){t.deleted=true}if(this.#c!==void 0)t.tickLabelInterval=this.#c;if(this.#u!==void 0)t.tickMarkInterval=this.#u;if(this.#e)t.axisType=this.#e;if(this.#f!==void 0)t.tickLabelDistanceFromAxis=this.#f;if(this.#d!==void 0)t.labelOffsetPercent=this.#d;return Object.keys(t).length>0?t:void 0}};function Cze(e,t){if(!t){return}const n="deleted"in t&&typeof t.deleted==="boolean"||"visible"in t&&typeof t.visible==="boolean";const r=Object.keys(t).some(o=>o!=="deleted"&&o!=="visible");if(!n&&r){e.deleted=false}if("deleted"in t&&typeof t.deleted==="boolean"){e.deleted=t.deleted}else if("visible"in t&&typeof t.visible==="boolean"){e.deleted=!t.visible}if("axisType"in t){e.axisType=t.axisType??void 0}if("tickLabelInterval"in t){e.tickLabelInterval=t.tickLabelInterval??void 0}if("tickMarkInterval"in t){e.tickMarkInterval=t.tickMarkInterval??void 0}if("tickLabelDistanceFromAxis"in t){e.tickLabelDistanceFromAxis=t.tickLabelDistanceFromAxis??void 0}if("labelOffsetPercent"in t){e.labelOffsetPercent=t.labelOffsetPercent}if("numberFormatCode"in t){e.numberFormatCode=t.numberFormatCode??void 0}if("numberFormatSourceLinked"in t){e.numberFormatSourceLinked=t.numberFormatSourceLinked??void 0}if("min"in t){e.min=t.min??void 0}if("max"in t){e.max=t.max??void 0}if("logBase"in t){e.logBase=t.logBase??void 0}if("majorUnit"in t){e.majorUnit=t.majorUnit??void 0}if("minorUnit"in t){e.minorUnit=t.minorUnit??void 0}if("position"in t){e.position=t.position??void 0}if("orientation"in t){e.orientation=t.orientation??void 0}if("majorTickMark"in t){e.majorTickMark=t.majorTickMark??void 0}if("minorTickMark"in t){e.minorTickMark=t.minorTickMark??void 0}if("tickLabelPosition"in t){e.tickLabelPosition=t.tickLabelPosition===void 0?void 0:V5t(t.tickLabelPosition)??void 0}if("crossBetween"in t){e.crossBetween=t.crossBetween??void 0}if("crosses"in t){e.crosses=t.crosses??void 0}if("crossesAt"in t){e.crossesAt=t.crossesAt??void 0}else if("crossValue"in t){e.crossesAt=t.crossValue??void 0}if("textStyle"in t&&t.textStyle!==void 0){const o=t.textStyle;Uf(e.textStyle,o)}if("line"in t&&t.line!==void 0){const o=t.line;e.line=o instanceof eo?o:new eo(o)}if("majorGridlines"in t){const o=t.majorGridlines;e.majorGridlines=o==null?void 0:o instanceof eo?o:new eo(o)}if("minorGridlines"in t){const o=t.minorGridlines;e.minorGridlines=o==null?void 0:o instanceof eo?o:new eo(o)}if(!("title"in t)){return}const i=t.title;if(typeof i==="string"){e.title.text=i;return}if(i==null){e.title.text=void 0;return}if(!U5t(i)){return}if("text"in i){const o=i.text;e.title.text=typeof o==="string"?o:void 0}if("textStyle"in i){const o=i.textStyle;const a=lN(o);if(a){Uf(e.title.textStyle,a)}}}var xye=class{#e;#t;#n=false;#r;#i;#a;#o;constructor(t){this.#e=t?.direction?nMt[t.direction]:void 0;this.#t=t?.grouping?Fpe[t.grouping]:void 0;this.#n=t?.varyColors??false;this.#r=t?.gapWidth;this.#i=t?.gapDepth;this.#a=t?.overlap;this.#o=t?.bar3dShape}get grouping(){return this.#t}set grouping(t){this.#t=t}get direction(){return this.#e}set direction(t){this.#e=t}get varyColors(){return this.#n}set varyColors(t){this.#n=t}get gapWidth(){return this.#r}set gapWidth(t){this.#r=t}get gapDepth(){return this.#i}set gapDepth(t){this.#i=t}get overlap(){return this.#a}set overlap(t){this.#a=t}get bar3dShape(){return this.#o}set bar3dShape(t){this.#o=t}toProto(){const t={};const n=this.#e?Dpe[this.#e]:void 0;if(n!==void 0&&n!==0){t.direction=n}const r=this.#t?rMt[this.#t]:void 0;if(r!==void 0&&r!==0){t.grouping=r}if(this.#n){t.varyColors=true}if(this.#r!==void 0){t.gapWidth=this.#r}if(this.#i!==void 0){t.gapDepth=this.#i}let i=this.#a;if(i===void 0&&(this.#t==="stacked"||this.#t==="percentStacked")){i=100}if(i!==void 0){t.overlap=i}if(this.#o!==void 0){t.bar3dShape=this.#o}return Object.keys(t).length>0?t:void 0}};var vye=class{showMeanLine;showMeanMarker;showNonOutliers;showOutliers;#e;constructor(t){this.showMeanLine=t?.showMeanLine;this.showMeanMarker=t?.showMeanMarker;this.showNonOutliers=t?.showNonOutliers;this.showOutliers=t?.showOutliers;this.#e=t?.quartileMethod?N3t[t.quartileMethod]:void 0}get quartileMethod(){return this.#e}set quartileMethod(t){this.#e=t}toProto(){const t={};if(this.showMeanLine!==void 0){t.showMeanLine=this.showMeanLine}if(this.showMeanMarker!==void 0){t.showMeanMarker=this.showMeanMarker}if(this.showNonOutliers!==void 0){t.showNonOutliers=this.showNonOutliers}if(this.showOutliers!==void 0){t.showOutliers=this.showOutliers}if(this.#e!==void 0){t.quartileMethod=F3t[this.#e]}return Object.keys(t).length>0?t:void 0}};var _ye=class{#e;#t;#n;#r;#i;constructor(t){this.#e=t?.is3d;this.#t=t?.scale;this.#n=t?.showNegative;this.#r=t?.sizeRepresents;this.#i=t?.varyColors}get is3d(){return this.#e}set is3d(t){this.#e=t}get scale(){return this.#t}set scale(t){this.#t=t}get showNegative(){return this.#n}set showNegative(t){this.#n=t}get sizeRepresents(){return this.#r}set sizeRepresents(t){this.#r=t}get varyColors(){return this.#i}set varyColors(t){this.#i=t}toProto(){const t={};if(this.#e!==void 0){t.is3d=this.#e}if(this.#t!==void 0){t.scale=this.#t}if(this.#n!==void 0){t.showNegative=this.#n}if(this.#r!==void 0){t.sizeRepresents=this.#r}if(this.#i!==void 0){t.varyColors=this.#i}if(Object.keys(t).length===0){return void 0}return t}};var S3=class{#e;#t=false;#n;#r=false;#i=false;#a=false;#o=false;#s=false;#l=false;#c=false;#u;#f;#d;#p;textStyle;#m;constructor(t,n){this.#t=t!==void 0;n?.addTextStyle(t?.textStyle);this.textStyle=new ko(t?.textStyle);this.#m=new eo({type:"proto",proto:t?.stroke});if(t?.kind==="dataCallout"){this.#e="dataCallout"}else{this.#e=t?.position?Lpe[t.position]:void 0}this.#p=t?.fill?new gi({type:"proto",proto:t.fill}):void 0;this.#n=t?.deleted;if(t!==void 0){this.#r=t.showValue;this.#i=t.showSeriesName;this.#a=t.showCategoryName;this.#o=t.showLegendKey;this.#s=t.showPercent;this.#l=t.showBubbleSize;this.#c=t.showLeaderLines}this.#u=t?.numberFormatCode;this.#f=t?.numberFormatSourceLinked;this.#d=t?.separator}get position(){return this.#e}set position(t){this.#e=t??void 0}get deleted(){return this.#n}set deleted(t){this.#n=t}get showValue(){return this.#r??false}set showValue(t){this.#t=true;this.#r=Boolean(t)}get showSeriesName(){return this.#i??false}set showSeriesName(t){this.#t=true;this.#i=Boolean(t)}get showCategoryName(){return this.#a??false}set showCategoryName(t){this.#t=true;this.#a=Boolean(t)}get showLegendKey(){return this.#o??false}set showLegendKey(t){this.#t=true;this.#o=t}get showPercent(){return this.#s??false}set showPercent(t){this.#t=true;this.#s=Boolean(t)}get showBubbleSize(){return this.#l??false}set showBubbleSize(t){this.#t=true;this.#l=t}get showLeaderLines(){return this.#c??false}set showLeaderLines(t){this.#t=true;this.#c=Boolean(t)}get numberFormatCode(){return this.#u}set numberFormatCode(t){this.#u=t??void 0}get numberFormatSourceLinked(){return this.#f}set numberFormatSourceLinked(t){this.#f=t}get separator(){return this.#d}set separator(t){this.#d=t??void 0}get stroke(){return this.#m}set stroke(t){this.#m=new eo(t)}get line(){return this.stroke}set line(t){this.stroke=t}get fill(){return this.#p}set fill(t){this.#p=new gi(t)}toProto(){const t=this.#e!==void 0&&this.#e!=="dataCallout"?kX[this.#e]:void 0;const n=this.textStyle.toProto();const r=this.textStyle.isSet;const i=this.#p?.toProto();const o=this.#m.toProto();const a=this.#t||this.#n!==void 0||this.#u!==void 0||this.#f!==void 0||this.#d!==void 0||t!==void 0&&t!==0||this.#e==="dataCallout"||r||i!==void 0||o!==void 0;if(!a){return void 0}const s={position:t??0,textStyle:void 0,leaderLine:void 0,fill:i??void 0,stroke:o??void 0};if(r){s.textStyle=n}if(this.#n!==void 0){s.deleted=this.#n}if(this.#r!==void 0){s.showValue=this.#r}if(this.#i!==void 0){s.showSeriesName=this.#i}if(this.#a!==void 0){s.showCategoryName=this.#a}if(this.#s!==void 0){s.showPercent=this.#s}if(this.#o!==void 0){s.showLegendKey=this.#o}if(this.#l!==void 0){s.showBubbleSize=this.#l}if(this.#c!==void 0){s.showLeaderLines=this.#c}if(this.#u!==void 0){s.numberFormatCode=this.#u}if(this.#f!==void 0){s.numberFormatSourceLinked=this.#f}if(this.#d!==void 0){s.separator=this.#d}if(this.#e==="dataCallout"){s.kind="dataCallout"}return s}};var Qz=class{#e=false;#t=false;#n;#r;#i;constructor(t,n){this.#e=t!==void 0&&t.visible!==false;this.#t=t?.showLegendKey??false;this.#n=t?.fill?new gi({type:"proto",proto:t.fill}):void 0;this.#r=t?.stroke?new eo({type:"proto",proto:t.stroke}):void 0;n?.addTextStyle(t?.textStyle);this.#i=new ko(t?.textStyle)}get visible(){return this.#e}set visible(t){this.#e=Boolean(t)}get showLegendKey(){return this.#t}set showLegendKey(t){this.#t=Boolean(t)}get fill(){return this.#n}set fill(t){this.#n=t?new gi(t):void 0}get stroke(){return this.#r}set stroke(t){this.#r=t?new eo(t):void 0}get line(){return this.stroke}set line(t){this.stroke=t}get textStyle(){return this.#i}toProto(){if(!this.#e){return void 0}const t=this.#i.isSet?this.#i.toProto():void 0;const n=this.#n?.toProto();const r=this.#r?.toProto();return{visible:this.#e,showLegendKey:this.#t,textStyle:t,fill:n,stroke:r}}};var e9=class{#e;#t;constructor(t){this.#e=t?.holeSize;this.#t=t?.firstSliceAngle}get holeSize(){return this.#e}set holeSize(t){this.#e=t}get firstSliceAngle(){return this.#t}set firstSliceAngle(t){this.#t=t}toProto(){const t={};if(this.#e!==void 0){t.holeSize=this.#e}if(this.#t!==void 0){t.firstSliceAngle=this.#t}return Object.keys(t).length>0?t:void 0}};var Tye=class{#e;constructor(t){this.#e=t?.gapWidth}get gapWidth(){return this.#e}set gapWidth(t){this.#e=t}toProto(){if(this.#e===void 0){return void 0}return{gapWidth:this.#e}}};var Aj=class{#e;#t;#n;#r;#i;#a;constructor(t){this.#e=t?.intervalClosed;this.#t=t?.binWidth;this.#n=t?.binCount;this.#r=t?.underflow;this.#i=t?.overflow;this.#a=t?.aggregated}toProto(){const t={};if(this.#e!==void 0){t.intervalClosed=this.#e}if(this.#t!==void 0){t.binWidth=this.#t}if(this.#n!==void 0){t.binCount=this.#n}if(this.#r!==void 0){t.underflow=this.#r}if(this.#i!==void 0){t.overflow=this.#i}if(this.#a!==void 0){t.aggregated=this.#a}return Object.keys(t).length>0?t:void 0}};var $4r=e=>{if(typeof e!=="string"){return e}const t=e.trim();if(!t){return void 0}switch(t.toLowerCase()){case"left":return"left";case"top":return"top";case"topright":case"top_right":case"top-right":return"topRight";case"right":return"right";case"bottom":return"bottom";default:return void 0}};var A3=class{#e;#t=false;#n;#r;#i;#a;#o;#s;constructor(t,n,r){this.#e=t?.position?V3t[t.position]:void 0;this.#t=t?.overlay??false;this.#n=new gi({type:"proto",proto:t?.fill});r?.addTextStyle(t?.textStyle);this.#r=new ko(t?.textStyle);this.#i=new eo;this.#a=t?.manualLayout?{...t.manualLayout}:void 0;this.#o=t?.deletedEntryIndices??[];this.#s=n;Object.preventExtensions(this)}get position(){return this.#e}set position(t){const n=$4r(t);if(!n){throw new Error(`Unsupported legend position: ${String(t)}`)}this.#e=n}get overlay(){return this.#t}get textStyle(){return this.#r}set overlay(t){this.#t=Boolean(t)}get fill(){return this.#n}set fill(t){this.#n=new gi(t)}get stroke(){return this.#i}set stroke(t){this.#i=new eo(t)}get line(){return this.stroke}set line(t){this.stroke=t}get manualLayout(){return this.#a}set manualLayout(t){this.#a=t}get deletedEntryIndices(){return this.#o}get visible(){return Boolean(this.#s?.getHasLegend())}set visible(t){if(!this.#s){throw new Error("legend.visible is not available without a chart host.")}if(typeof t!=="boolean"){throw new Error("legend.visible must be a boolean.")}this.#s.setHasLegend(t)}toProto(){const t={};const n=this.#e?Mpe[this.#e]:void 0;t.position=n??0;t.overlay=this.#t;t.textStyle=this.textStyle.toProto();const r=this.#n?.toProto();if(r){t.fill=r}const i=this.#i.toProto();if(i){t.stroke=i}if(this.#a){t.manualLayout={...this.#a}}t.deletedEntryIndices=[...this.#o];if(t.position===void 0&&t.overlay===void 0&&!t.textStyle&&!t.fill&&!t.stroke&&!t.manualLayout&&this.#o.length===0){return void 0}return t}};var wye=class{#e;#t;#n=false;#r;constructor(t){this.#e=t?.grouping?Rpe[t.grouping]:void 0;this.#t=t?.smooth;this.#r=t?.varyColors}get grouping(){return this.#e}set grouping(t){this.#e=t}get smooth(){return this.#t??false}set smooth(t){this.#t=t;this.#n=true}get hasExplicitSmooth(){return this.#n}get varyColors(){return this.#r??false}set varyColors(t){this.#r=t}toProto(){const t={};if(this.#e){t.grouping=z3t[this.#e]}if(this.#t!==void 0){t.smooth=this.#t}if(this.#r!==void 0){t.varyColors=this.#r}return Object.keys(t).length>0?t:void 0}};var Eye=class{#e;#t;#n;#r;#i;#a;constructor(t){this.#e=t?.mapArea?A3t[t.mapArea]:void 0;this.#t=t?.projection?L3t[t.projection]:void 0;this.#n=t?.labelLayout?I3t[t.labelLayout]:void 0;this.#r=t?.dataLevel?R3t[t.dataLevel]:void 0;this.#i=t?.showUnknown;this.#a=t?.onlyRegionsWithData}get mapArea(){return this.#e}set mapArea(t){this.#e=t}get projection(){return this.#t}set projection(t){this.#t=t}get labelLayout(){return this.#n}set labelLayout(t){this.#n=t}get dataLevel(){return this.#r}set dataLevel(t){this.#r=t}get showUnknown(){return this.#i}set showUnknown(t){this.#i=t}get onlyRegionsWithData(){return this.#a}set onlyRegionsWithData(t){this.#a=t}toProto(){const t=this.#e?S3t[this.#e]:void 0;const n=this.#t?M3t[this.#t]:void 0;const r=this.#n?P3t[this.#n]:void 0;const i=this.#r?k3t[this.#r]:void 0;const o={colorScale:[]};const a=t!==void 0&&t!==0;const s=n!==void 0&&n!==0;const l=r!==void 0&&r!==0;const u=i!==void 0&&i!==0;if(a){o.mapArea=t}if(s){o.projection=n}if(l){o.labelLayout=r}if(u){o.dataLevel=i}if(this.#i!==void 0){o.showUnknown=this.#i}if(this.#a!==void 0){o.onlyRegionsWithData=this.#a}const d=a||s||l||u||this.#i!==void 0||this.#a!==void 0;return d?o:void 0}};var t9=class{#e;constructor(t){this.#e=t?.firstSliceAngle}get firstSliceAngle(){return this.#e}set firstSliceAngle(t){this.#e=t}toProto(){if(this.#e===void 0){return void 0}return{firstSliceAngle:this.#e}}};var Cye=class{#e;#t;constructor(t){this.#e=t?.style?oMt[t.style]:void 0;this.#t=t?.varyColors??false}get style(){return this.#e}set style(t){this.#e=t}get varyColors(){return this.#t}set varyColors(t){this.#t=t}toProto(){const t={};const n=this.#e?iMt[this.#e]:void 0;if(n!==void 0){t.style=n}if(this.#t){t.varyColors=this.#t}return Object.keys(t).length>0?t:void 0}};var kj=class{#e="none";#t;#n;#r;constructor(t){const n=t?.find(r=>R6e[r.valueType]!==void 0);this.#e=n?R6e[n.valueType]??"none":"none";this.#t=n?.value;this.#n=n?.noEndCap===true?"noCap":n?.noEndCap===false?"cap":void 0;this.#r=new eo({type:"proto",proto:n?.stroke})}get type(){return this.#e}set type(t){this.#e=t}get value(){return this.#t}set value(t){this.#t=t??void 0}get endStyle(){return this.#n}set endStyle(t){this.#n=t??void 0}get line(){return this.#r}set line(t){this.#r=new eo(t)}toProto(){const t=this.#e;if(t==="none"){return void 0}const n=this.#r.toProto();return[{direction:2,type:1,valueType:Q3t[t],noEndCap:this.#n==="noCap"?true:void 0,value:this.#t,stroke:n}]}};var Rj=class{#e;#t;#n;#r;#i;#a;#o;#s;#l;#c;textStyle;#u;constructor(t,n){this.#e=t?.idx;n?.addTextStyle(t?.textStyle);this.textStyle=new ko(t?.textStyle);this.#u=new eo({type:"proto",proto:t?.stroke});if(t?.kind==="dataCallout"){this.#n="dataCallout"}else{this.#n=t?.position?Lpe[t.position]:void 0}this.#t=t?.text;this.#r=t?.fill?new gi({type:"proto",proto:t.fill}):void 0;this.#i=t?.showValue;this.#a=t?.showSeriesName;this.#o=t?.showCategoryName;this.#s=t?.showLegendKey;this.#l=t?.showPercent;this.#c=t?.showBubbleSize}get idx(){return this.#e}set idx(t){this.#e=t??void 0}get text(){return this.#t}set text(t){this.#t=t??void 0}get position(){return this.#n}set position(t){this.#n=t??void 0}get fill(){return this.#r}set fill(t){this.#r=t?new gi(t):void 0}get stroke(){return this.#u}set stroke(t){this.#u=new eo(t)}get line(){return this.stroke}set line(t){this.stroke=t}get showValue(){return this.#i??false}set showValue(t){this.#i=Boolean(t)}get showSeriesName(){return this.#a??false}set showSeriesName(t){this.#a=Boolean(t)}get showCategoryName(){return this.#o??false}set showCategoryName(t){this.#o=Boolean(t)}get showLegendKey(){return this.#s??false}set showLegendKey(t){this.#s=Boolean(t)}get showPercent(){return this.#l??false}set showPercent(t){this.#l=Boolean(t)}get showBubbleSize(){return this.#c??false}set showBubbleSize(t){this.#c=Boolean(t)}toProto(){const t=this.#e;if(t===void 0||t===null){return void 0}const n=this.textStyle.toProto();const r=this.#r?.toProto();const i=this.#u.toProto();const o=this.#n!==void 0&&this.#n!=="dataCallout"?kX[this.#n]:void 0;const a={idx:t};if(this.#t!==void 0){a.text=this.#t}if(o!==void 0&&o!==0){a.position=o}if(this.#n&&!(this.#n in kX)){a.positionName=this.#n;if(this.#n==="dataCallout"){a.kind="dataCallout"}}if(this.#i!==void 0){a.showValue=this.#i}if(this.#a!==void 0){a.showSeriesName=this.#a}if(this.#o!==void 0){a.showCategoryName=this.#o}if(this.#s!==void 0){a.showLegendKey=this.#s}if(this.#l!==void 0){a.showPercent=this.#l}if(this.#c!==void 0){a.showBubbleSize=this.#c}if(this.textStyle.isSet){a.textStyle=n}if(r){a.fill=r}if(i){a.stroke=i}return a}};var Sye=class{#e;#t;constructor(t,n){this.#t=n;this.#e=[];if(t){for(const r of t){const i=new Rj(r,this.#t);const o=this.#e.findIndex(a=>a.idx===i.idx);if(o===-1){this.#e.push(i)}else{this.#e[o]=i}}}}add(t){const n=this.#e.find(i=>i.idx===t);if(n){return n}const r=new Rj({idx:t,showValue:false,showSeriesName:false,showCategoryName:false,showLegendKey:false,showPercent:false,showBubbleSize:false},this.#t);this.#e.push(r);return r}get length(){return this.#e.length}toProto(){return this.#e.map(t=>t.toProto()).filter(t=>Boolean(t))}};var Aye=class{#e;#t;#n;#r;constructor(t){this.#e=t?.symbol?tMt[t.symbol]:void 0;this.#t=t?.size;this.#n=new gi({type:"proto",proto:t?.fill});this.#r=structuredClone(t?.stroke)}get symbol(){return this.#e}set symbol(t){this.#e=t}get size(){return this.#t}set size(t){this.#t=t}get fill(){return this.#n}set fill(t){this.#n=new gi(t)}toProto(){const t=this.#e?eMt[this.#e]:void 0;const n=this.#t;const r=this.#n.toProto();const i=structuredClone(this.#r);if(t===void 0&&n===void 0&&r===void 0&&i===void 0){return void 0}return{symbol:t,size:n,fill:r,stroke:i}}};var Pj=class{#e;#t;#n;constructor(t){this.#e=t?.idx;this.#t=t?.fill?new gi({type:"proto",proto:t.fill}):void 0;this.#n=new eo({type:"proto",proto:t?.stroke})}get idx(){return this.#e}set idx(t){this.#e=t??void 0}get fill(){return this.#t}set fill(t){this.#t=new gi(t)}get stroke(){return this.#n}set stroke(t){this.#n=new eo(t)}get line(){return this.stroke}set line(t){this.stroke=t}toProto(){const t=this.#e;if(t===void 0||t===null){return void 0}const n=this.#t?.toProto();const r=this.#n.toProto();if(!n&&!r){return void 0}return{idx:t,fill:n,stroke:r}}};var kye=class{#e;constructor(t){this.#e=[];if(t){this.#e=t.map(n=>new Pj(n))}}get items(){return[...this.#e]}add(t){const n=new Pj({idx:t,fill:void 0,stroke:void 0});this.#e.push(n);return n}toProto(){return this.#e.map(t=>t.toProto()).filter(t=>Boolean(t))}};var Sze=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(t,n){this.#e=t?.text??void 0;this.#t=t?.numberFormatCode??void 0;this.#n=t?.numberFormatSourceLinked??void 0;this.#r=t?.manualLayout??void 0;n?.addTextStyle(t?.textStyle);this.#i=new ko(t?.textStyle);this.#a=t?.fill?new gi({type:"proto",proto:t.fill}):void 0;this.#o=t?.stroke?new eo({type:"proto",proto:t.stroke}):void 0;this.#s=(t?.textRuns??[]).map(r=>{n?.addTextStyle(r.textStyle);return{text:r.text??"",textStyle:r.textStyle?new ko(r.textStyle):void 0}})}get text(){return this.#e}set text(t){this.#e=t??void 0}get numberFormatCode(){return this.#t}set numberFormatCode(t){this.#t=t??void 0}get numberFormatSourceLinked(){return this.#n}set numberFormatSourceLinked(t){this.#n=t===void 0?void 0:Boolean(t)}get manualLayout(){return this.#r}set manualLayout(t){this.#r=t??void 0}get textStyle(){return this.#i}set textStyle(t){this.#i=t}get fill(){return this.#a}set fill(t){this.#a=t?new gi(t):void 0}get stroke(){return this.#o}set stroke(t){this.#o=t?new eo(t):void 0}get line(){return this.stroke}set line(t){this.stroke=t}get textRuns(){return this.#s.map(t=>({text:t.text,textStyle:t.textStyle?new ko(t.textStyle.toProto()):void 0}))}set textRuns(t){const n=t??[];this.#s=n.map(r=>{const i=r.text??"";const o=new ko;const a=r.textStyle;if(a){if(a.fontSize!==void 0)o.fontSize=Bb(a.fontSize);if(a.fill!==void 0)o.fill=a.fill;if(a.bold!==void 0)o.bold=a.bold;if(a.italic!==void 0)o.italic=a.italic;if(a.underline!==void 0)o.underline=a.underline;if(a.name!==void 0)o.name=a.name;if(a.family!==void 0)o.family=a.family;if(a.alignment!==void 0)o.alignment=a.alignment}return{text:i,textStyle:a?o:void 0}})}toProto(){const t=this.#i.toProto();const n=this.#a?.toProto();const r=this.#o?.toProto();const i=this.#s.map(s=>{const l=s.text??"";const u=s.textStyle?.toProto();if(!l.trim()&&!u){return null}const d={text:l};if(u)d.textStyle=u;return d}).filter(s=>s!==null);const o=this.#e!==void 0||this.#t!==void 0||this.#n!==void 0||this.#r!==void 0||Boolean(t)||Boolean(n)||Boolean(r)||i.length>0;if(!o)return void 0;const a={textRuns:i};if(this.#e!==void 0)a.text=this.#e;if(this.#t!==void 0)a.numberFormatCode=this.#t;if(this.#n!==void 0)a.numberFormatSourceLinked=this.#n;if(this.#r!==void 0)a.manualLayout=this.#r;if(t)a.textStyle=t;if(n)a.fill=n;if(r)a.stroke=r;return a}};var Ij=class{#e;#t;#n;#r;#i;#a;#o;#s;#l;#c;#u;constructor(t,n){this.#e=t?.type?J3t[t.type]:void 0;this.#t=t?.name??void 0;this.#n=t?.order??void 0;this.#r=t?.period??void 0;this.#i=t?.forward??void 0;this.#a=t?.backward??void 0;this.#o=t?.intercept??void 0;this.#s=t?.displayEquation??void 0;this.#l=t?.displayRSquared??void 0;this.#c=t?.stroke?new eo({type:"proto",proto:t.stroke}):void 0;this.#u=new Sze(t?.label,n)}get type(){return this.#e}set type(t){this.#e=t??void 0}get name(){return this.#t}set name(t){this.#t=t??void 0}get polynomialOrder(){return this.#n}set polynomialOrder(t){this.#n=t??void 0}get movingAveragePeriod(){return this.#r}set movingAveragePeriod(t){this.#r=t??void 0}get forecastForward(){return this.#i}set forecastForward(t){this.#i=t??void 0}get forecastBackward(){return this.#a}set forecastBackward(t){this.#a=t??void 0}get intercept(){return this.#o}set intercept(t){this.#o=t??void 0}get displayEquation(){return this.#s}set displayEquation(t){this.#s=t===void 0?void 0:Boolean(t)}get displayRSquared(){return this.#l}set displayRSquared(t){this.#l=t===void 0?void 0:Boolean(t)}get stroke(){if(!this.#c){this.#c=new eo}return this.#c}set stroke(t){this.#c=new eo(t)}get line(){return this.stroke}set line(t){this.stroke=t}get label(){return this.#u}set label(t){this.#u=t}toProto(){if(!this.#e){return void 0}const t=this.#c?.toProto();const n=this.#u.toProto();const r={type:Z3t[this.#e]};if(this.#t!==void 0)r.name=this.#t;if(this.#n!==void 0)r.order=this.#n;if(this.#r!==void 0)r.period=this.#r;if(this.#i!==void 0)r.forward=this.#i;if(this.#a!==void 0)r.backward=this.#a;if(this.#o!==void 0)r.intercept=this.#o;if(this.#s!==void 0)r.displayEquation=this.#s;if(this.#l!==void 0)r.displayRSquared=this.#l;if(t)r.stroke=t;if(n)r.label=n;return r}};var Rye=class{#e;#t;constructor(t,n){this.#t=n;this.#e=(t??[]).map(r=>new Ij(r,this.#t))}get items(){return[...this.#e]}get length(){return this.#e.length}add(t,n){const r=new Ij(void 0,this.#t);r.type=t;if(n){if(n.name!==void 0)r.name=n.name;if(n.polynomialOrder!==void 0)r.polynomialOrder=n.polynomialOrder;if(n.movingAveragePeriod!==void 0)r.movingAveragePeriod=n.movingAveragePeriod;if(n.forecastForward!==void 0)r.forecastForward=n.forecastForward;if(n.forecastBackward!==void 0)r.forecastBackward=n.forecastBackward;if(n.intercept!==void 0)r.intercept=n.intercept;if(n.displayEquation!==void 0)r.displayEquation=n.displayEquation;if(n.displayRSquared!==void 0)r.displayRSquared=n.displayRSquared;if(n.line!==void 0)r.stroke=n.line;else if(n.stroke!==void 0)r.stroke=n.stroke;if(n.label)G4r(r.label,n.label)}this.#e.push(r);return r}clear(){this.#e=[]}toProto(){return this.#e.map(t=>t.toProto()).filter(t=>Boolean(t))}};function G4r(e,t){if(t.text!==void 0)e.text=t.text;if(t.numberFormatCode!==void 0)e.numberFormatCode=t.numberFormatCode;if(t.numberFormatSourceLinked!==void 0)e.numberFormatSourceLinked=t.numberFormatSourceLinked;if(t.manualLayout!==void 0){e.manualLayout={x:t.manualLayout.x,y:t.manualLayout.y,w:t.manualLayout.w,h:t.manualLayout.h}}if(t.textStyle){const n=e.textStyle;const r=t.textStyle;if(r.fontSize!==void 0)n.fontSize=Bb(r.fontSize);if(r.fill!==void 0)n.fill=r.fill;if(r.bold!==void 0)n.bold=r.bold;if(r.italic!==void 0)n.italic=r.italic;if(r.underline!==void 0)n.underline=r.underline;if(r.name!==void 0)n.name=r.name;if(r.family!==void 0)n.family=r.family;if(r.alignment!==void 0)n.alignment=r.alignment}if(t.fill!==void 0)e.fill=t.fill;if(t.line!==void 0)e.stroke=t.line;else if(t.stroke!==void 0)e.stroke=t.stroke;if(t.textRuns!==void 0)e.textRuns=t.textRuns}function k3(e){const t=e.values??[];const n=e.valueIndices??[];if(n.length===0||n.length!==t.length){return[...t]}const r=Math.max(t.length,...n.map(o=>o+1));const i=Array.from({length:r},()=>Number.NaN);t.forEach((o,a)=>{const s=n[a];if(s!==void 0){i[s]=o}});return i}var H4r="\u200B";function Pye(e){return e==null?"":typeof e==="string"?e:String(e)}function $5t(e){if(e.length===0)return[];if(Array.isArray(e[0])){const t=e;if(t.length===1){return(t[0]??[]).map(Pye)}return t.map(n=>Pye(n?.[0]))}return e.map(Pye)}function Iye(e,t){if(e==null)return[];if(Array.isArray(e))return $5t(e);if(typeof e==="string")return[e];if(typeof e==="object"){const n=e.values;if(Array.isArray(n))return $5t(n);const r=e;if(typeof r[Symbol.iterator]==="function"){return Array.from(e,Pye)}}throw new TypeError(`${t} must be a string[] (e.g. ['2020','2021']). If you have a Range, pass range.values and flatten to 1D first.`)}function G5t(e){return H4r.repeat(e+1)}function H5t(e){if(e<=0){return[]}return Array.from({length:e},(t,n)=>G5t(n))}function Aze(e){const t=e?.categories??[];const n=e?.categoryIndices??[];const r=e?.valueIndices??[];if(t.length>0){const i=n.length>0?n:r;return Math.max(t.length,...i.map(o=>o+1))}return Math.max(e?.values?.length??0,...r.map(i=>i+1))}function W4r(e){if(e.categoryIndices&&e.categoryIndices.length>0){return e.categoryIndices}return e.valueIndices??[]}function Mj(e){if(!e)return[];const t=e.categories??[];if(t.length===0)return[];const n=W4r(e);if(n.lengtho+1));if(r<=t.length){return[...t]}const i=Array.from({length:r},(o,a)=>G5t(a));t.forEach((o,a)=>{const s=n[a];if(s!==void 0&&Number.isInteger(s)&&s>=0){i[s]=o}});return i}function xm(e,t){const n=Mj(e);if(n.length>0){return n}if(t&&t.length>0){return[...t]}return H5t(Aze(e))}function Nh(e,t){if(!e){return[]}const n=e.categories??[];if(n.length>0){return[...n]}const r=e.series??[];if(t!==void 0){const o=Mj(r[t]);if(o.length>0){return o}}for(const o of r){const a=Mj(o);if(a.length>0){return a}}const i=r.reduce((o,a)=>Math.max(o,Aze(a)),0);if(i<=0){return[]}return H5t(i)}var kze=class{#e;constructor(t){this.#e=t}clear(){this.#e.fill={type:"none"}}setSolidColor(t){this.#e.fill=t}get color(){const t=this.#e.fill;const n=t?.toConfig();return typeof n==="string"?n:void 0}set color(t){if(typeof t!=="string"||t.trim().length===0){return}this.#e.fill=t}};var Rze=class{#e;constructor(t){this.#e=t}get visible(){return this.#e.stroke.visible}set visible(t){this.#e.stroke.visible=t}get color(){return this.#e.stroke.color}set color(t){this.#e.stroke.color=t}get style(){return this.#e.stroke.style}set style(t){this.#e.stroke.style=t}get weight(){return this.#e.stroke.width}set weight(t){this.#e.stroke.width=t}};var Pze=class{#e;#t;#n;constructor(t){this.#e=t;this.#t=new kze(t);this.#n=new Rze(t)}get fill(){return this.#t}set fill(t){this.#e.fill=t}get line(){return this.#n}set line(t){this.#e.stroke=t}};var Lj=class{#e;#t;#n;#r;#i;#a;#o;#s;#l;#c;#u;#f;#d;#p;#m;#h;#g;#y;#x;#v;#_;#E;#S;#C;#b;#T;#k;#P;#A=false;#w;constructor(t,n,r){this.#e=t?.name??"";this.#t=t?.values;this.#n=t?.valueIndices;this.#r=t?.valuePointCount;this.#i=t?.categories;this.#a=t?.categoryIndices;this.#o=t?.categoryPointCount;this.#s=t?.xValues;this.#l=t?.xFormula;this.#c=t?.bubbleSizes;this.#u=t?.categoryPaths?.map(i=>i.levels)??[];this.#f=t?.valuesFormatCode;this.#d=t?.xValuesFormatCode;this.#p=t?.fill?new gi({type:"proto",proto:t.fill}):void 0;this.#m=t?.explosion;this.#h=t?.smooth;this.#y=new eo({type:"proto",proto:t?.stroke});this.#v=new Aye(t?.marker);this.#_=new S3(t?.dataLabels,r);this.#E=new kye(t?.points);this.#S=new Sye(t?.dataLabelOverrides,r);this.#C=new Rye(t?.trendlines,r);this.#b=new kj(t?.errorBars);this.#T=t?.formula;this.#k=t?.stringCache;this.#P=t?.categoryFormula;this.#w=n}setChangeHandler(t){this.#w=t}get name(){return this.#e}set name(t){this.#e=t;this.#w?.()}get values(){if(!this.#t){return void 0}return this.resolveValues()}set values(t){this.#t=t;this.#n=void 0;this.#r=void 0;this.#w?.()}resolveValues(){return k3(this.#I)}get categories(){return Mj(this.#I)}set categories(t){this.#i=this.#M(t);this.#a=void 0;this.#o=void 0;this.#w?.()}resolveCategories(t){return xm(this.#I,t)}get#I(){return{categories:this.#i,categoryIndices:this.#a,categoryPointCount:this.#o,values:this.#t,valueIndices:this.#n,valuePointCount:this.#r}}get xValues(){return this.#s}set xValues(t){this.#s=t;this.#w?.()}get xFormula(){return this.#l}set xFormula(t){this.#l=t??void 0;this.#w?.()}get categoryPaths(){return this.#u?.map(t=>[...t])??[]}get marker(){return this.#v}set marker(t){this.#v=t}set categoryPaths(t){this.#u=(t??[]).map(n=>[...n??[]]);this.#w?.()}get bubbleSizes(){return this.#c}set bubbleSizes(t){this.#c=t;this.#w?.()}get valuesFormatCode(){return this.#f}set valuesFormatCode(t){this.#f=t??void 0;this.#w?.()}get xValuesFormatCode(){return this.#d}set xValuesFormatCode(t){this.#d=t??void 0;this.#w?.()}get fill(){return this.#p}set fill(t){this.#p=t?new gi(t):void 0;this.#w?.()}get format(){if(!this.#x){this.#x=new Pze(this)}return this.#x}get explosion(){return this.#m}set explosion(t){this.#m=t??void 0;this.#w?.()}get smooth(){return this.#h}set smooth(t){this.#h=t;this.#w?.()}get stroke(){return this.#y}set stroke(t){this.#y=new eo(t);this.#w?.()}get line(){return this.stroke}set line(t){this.stroke=t}setCategoryNormalizer(t){this.#g=t;if(t){this.#i=this.#i?t(this.#i):void 0}this.#w?.()}#M(t){const n=Iye(t,"ChartSeries.categories");const r=this.#g?this.#g(n):n;return[...r]}get dataLabelOverrides(){return this.#S}get dataLabels(){return this.#_}set dataLabels(t){this.#_=t;this.#w?.()}set dataLabelOverrides(t){this.#S=t;this.#w?.()}get trendlines(){return this.#C}set trendlines(t){this.#C=t;this.#w?.()}get errorBars(){return this.#b}set errorBars(t){if(t instanceof kj){this.#b=t;this.#w?.();return}if(t.type!==void 0)this.#b.type=t.type;if(t.value!==void 0)this.#b.value=t.value;if(t.endStyle!==void 0)this.#b.endStyle=t.endStyle;if(t.line!==void 0)this.#b.line=t.line;this.#w?.()}get points(){return this.#E}set points(t){this.#E=t;this.#w?.()}get formula(){return this.#T}set formula(t){this.#T=t??void 0;this.#w?.()}get categoryFormula(){return this.#P}set categoryFormula(t){this.#P=t??void 0;this.#w?.()}get isNullObject(){return false}delete(){this.#A=true;this.#w?.()}__isDeleted(){return this.#A}toProto(){if(this.#A){return void 0}const t=this.#i&&this.#i.length>0?[...this.#i]:[];const n=this.#v.toProto();const r=this.#p?.toProto();const i=this.#y.toProto();const o=this.#_.toProto();const a=this.#E.toProto();const s=this.#S.toProto();const l=this.#C.toProto();const u=this.#b.toProto();const d=this.#u?.map(h=>({levels:h}));const f={name:this.#e??"",values:this.#t??[],xFormula:this.#l??"",categories:t,valuesFormatCode:this.#f,xValues:this.#s??[],xValuesFormatCode:this.#d,bubbleSizes:this.#c??[],bubbleSizeFormula:"",categoryPaths:d??[],dataLabels:o,dataLabelOverrides:s,trendlines:l,errorBars:u??[],axisIds:[],categoryIndices:this.#a??[],valueIndices:this.#n??[],points:a,explosion:this.#m,smooth:this.#h,fill:r,stroke:i,marker:n,formula:this.#T??"",stringCache:this.#k??"",categoryFormula:this.#P??""};if(this.#r!==void 0){f.valuePointCount=this.#r}if(this.#o!==void 0){f.categoryPointCount=this.#o}return f}};var Mye=class{#e;#t;#n;constructor(t,n,r){this.#t=n;this.#n=r;this.#e=[];if(t){this.#e=t.map(i=>this.#r(new Lj(i,void 0,this.#n)))}}add(t){const n=this.#r(new Lj({name:t},void 0,this.#n));this.#e.push(n);this.#t?.();return n}setChangeHandler(t){this.#t=t;for(const n of this.#e){n.setChangeHandler(()=>this.#t?.())}}getItemAt(t){const n=this.#e.filter(i=>!i.__isDeleted());const r=n[t];if(!r){throw new Error(`Chart series at index ${t} not found`)}return r}deleteAt(t){this.getItemAt(t).delete()}get items(){return this.#e.filter(t=>!t.__isDeleted())}clear(){if(this.#e.length===0){return}this.#e=[];this.#t?.()}deleteAll(){this.clear()}toProto(){return this.#e.map(t=>t.toProto()).filter(t=>Boolean(t))}get length(){return this.#e.filter(t=>!t.__isDeleted()).length}#r(t){t.setChangeHandler(()=>this.#t?.());return t}};var Lye=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(t){this.#e=t?.styleId;this.#t=t?.colorStyleId;this.#n=t?.palette.map(n=>new Mi({type:"proto",proto:n}))??[];this.#r=t?.themeName;this.#i=t?.colorStyleMethod;this.#a=structuredClone(t?.chartStyleEntries??[]);this.#o=structuredClone(t?.chartStyleMarkerLayout);this.#s=structuredClone(t?.colorStyleVariations??[])}get styleId(){return this.#e}set styleId(t){this.#e=t}get colorStyleId(){return this.#t}set colorStyleId(t){this.#t=t}set palette(t){this.#n=t}get themeName(){return this.#r}get colorStyleMethod(){return this.#i}set colorStyleMethod(t){this.#i=t}toProto(){if(this.#e===void 0&&this.#t===void 0&&this.#r===void 0&&this.#i===void 0&&this.#n.length===0&&this.#a.length===0&&this.#o===void 0&&this.#s.length===0){return void 0}const t={styleId:this.#e,colorStyleId:this.#t,palette:this.#n.map(n=>n.toProto()),themeName:this.#r,colorStyleMethod:this.#i,chartStyleEntries:structuredClone(this.#a),chartStyleMarkerLayout:structuredClone(this.#o),colorStyleVariations:structuredClone(this.#s)};return t}};var Dye=class{#e;constructor(t){this.#e=t?.parentLabelLayout?D3t[t.parentLabelLayout]:void 0}get parentLabelLayout(){return this.#e}set parentLabelLayout(t){this.#e=t}toProto(){if(!this.#e){return void 0}const t=vMt(this.#e);if(t===0){return void 0}return{parentLabelLayout:t}}};var Fye=class{rotX;rotY;perspective;rightAngleAxes;constructor(t){this.rotX=t?.rotX;this.rotY=t?.rotY;this.perspective=t?.perspective;this.rightAngleAxes=t?.rightAngleAxes}toProto(){if(this.rotX===void 0&&this.rotY===void 0&&this.perspective===void 0&&this.rightAngleAxes===void 0){return void 0}return{rotX:this.rotX,rotY:this.rotY,perspective:this.perspective,rightAngleAxes:this.rightAngleAxes}}};function BT(e){return typeof e==="number"&&Number.isFinite(e)}function zT(e){const t=Math.abs(e);const n=t>=1e3?0:t>=100?1:t>=10?2:3;return e.toFixed(n)}function Nye(e,t){if(e.length<2)return void 0;const n=e.map(s=>s.y);const r=n.reduce((s,l)=>s+l,0)/n.length;let i=0;let o=0;for(const s of e){const l=t(s.x);i+=(s.y-r)**2;o+=(s.y-l)**2}if(i<=1e-12)return void 0;const a=1-o/i;return Number.isFinite(a)?Math.max(0,Math.min(1,a)):void 0}function W5t(e,t){if(e.length<2)return null;if(BT(t)){let h=0;let m=0;for(const C of e){h+=C.x*C.x;m+=C.x*(C.y-t)}if(Math.abs(h)<1e-12)return null;const g=m/h;const x=t;const w=C=>g*C+x;const _=Nye(e,w);return{evalY:w,equation:`y = ${zT(g)}x + ${zT(x)}`,rSquared:_}}const n=e.length;let r=0;let i=0;let o=0;let a=0;for(const h of e){r+=h.x;i+=h.y;o+=h.x*h.x;a+=h.x*h.y}const s=n*o-r*r;if(Math.abs(s)<1e-12)return null;const l=(n*a-r*i)/s;const u=(i-l*r)/n;const d=h=>l*h+u;const f=Nye(e,d);return{evalY:d,equation:`y = ${zT(l)}x + ${zT(u)}`,rSquared:f}}function Y4r(e,t){const n=e.filter(h=>h.x>0);if(n.length<2)return null;const r=n.map(h=>({x:Math.log(h.x),y:h.y}));const i=W5t(r,BT(t)?t:void 0);if(!i)return null;const o=h=>h>0?i.evalY(Math.log(h)):Number.NaN;const a=Nye(n,o);const s=/y\s*=\s*([-\d.]+)x\s*\+\s*([-\d.]+)/.exec(i.equation);const l=s?Number(s[1]):void 0;const u=s?Number(s[2]):void 0;const d=BT(l)?zT(l):"?";const f=BT(u)?zT(u):"?";return{evalY:o,equation:`y = ${d}ln(x) + ${f}`,rSquared:a}}function q4r(e,t){const n=e.length;const r=e.map((i,o)=>[...i,t[o]]);for(let i=0;iMath.abs(r[o][i]))o=s}if(Math.abs(r[o][i])<1e-12)return null;if(o!==i)[r[i],r[o]]=[r[o],r[i]];const a=r[i][i];for(let s=i;si[n])}function X4r(e,t,n){const r=Math.max(2,Math.min(6,Math.floor(t)));const i=r+1;if(e.lengthArray(a).fill(0));const l=Array(a).fill(0);for(const x of e){const w=Array(i*2).fill(0);w[0]=1;for(let C=1;C{let w=0;let _=1;for(const C of d){w+=C*_;_*=x}return w};const h=Nye(e,f);const m=[];d.forEach((x,w)=>{if(!Number.isFinite(x))return;if(w===0){m.push(zT(x));return}const _=x>=0?"+":"-";const C=Math.abs(x);const A=zT(C);const P=w===1?"x":`x^${w}`;m.push(`${_} ${A}${P}`)});const g=`y = ${m.join(" ")}`;return{coeffs:d,evalY:f,equation:g,rSquared:h}}function j4r(e,t){const n=Math.max(2,Math.floor(t));const r=[];for(let i=0;il+u.y,0)/a.length;r.push({x:e[i].x,y:s})}return r}function Ize(e,t,n,r){const i=Math.max(2,Math.floor(n));if(!Number.isFinite(e)||!Number.isFinite(t)||t===e){return[]}const o=[];for(let a=0;aBT(g.x)&&BT(g.y));if(n.length<2)return null;const r=n.map(g=>g.x);const i=Math.min(...r);const o=Math.max(...r);const a=BT(e.forecastForward)?e.forecastForward:0;const s=BT(e.forecastBackward)?e.forecastBackward:0;const l=i-s;const u=o+a;const d=Boolean(e.displayEquation)||Boolean(e.displayRSquared);if(t==="movingAverage"){const g=BT(e.movingAveragePeriod)?e.movingAveragePeriod:2;const x=j4r(n,g);return{type:t,points:x,label:d?{text:`Moving average (period = ${Math.floor(g)})`}:void 0}}if(t==="polynomial"){const g=BT(e.polynomialOrder)?e.polynomialOrder:2;const x=X4r(n,g,e.intercept);if(!x)return null;const w=Ize(l,u,64,x.evalY);const _=d?{text:[e.displayEquation?x.equation:void 0,e.displayRSquared&&x.rSquared!==void 0?`R^2 = ${zT(x.rSquared)}`:void 0].filter(C=>typeof C==="string"&&C.length>0).join("\n"),rSquared:x.rSquared}:void 0;return{type:t,points:w,label:_}}if(t==="logarithmic"){const g=Y4r(n,e.intercept);if(!g)return null;const x=Ize(l,u,64,g.evalY);const w=d?{text:[e.displayEquation?g.equation:void 0,e.displayRSquared&&g.rSquared!==void 0?`R^2 = ${zT(g.rSquared)}`:void 0].filter(_=>typeof _==="string"&&_.length>0).join("\n"),rSquared:g.rSquared}:void 0;return{type:t,points:x,label:w}}const f=W5t(n,e.intercept);if(!f)return null;const h=Ize(l,u,64,f.evalY);const m=d?{text:[e.displayEquation?f.equation:void 0,e.displayRSquared&&f.rSquared!==void 0?`R^2 = ${zT(f.rSquared)}`:void 0].filter(g=>typeof g==="string"&&g.length>0).join("\n"),rSquared:f.rSquared}:void 0;return{type:t,points:h,label:m}}function K4r(e,t){t.addTextStyle(e.dataLabels?.textStyle);for(const n of e.dataLabelOverrides??[]){t.addTextStyle(n.textStyle)}for(const n of e.trendlines??[]){t.addTextStyle(n.label?.textStyle);for(const r of n.label?.textRuns??[]){t.addTextStyle(r.textStyle)}}}function Z4r(e,t){if(!e||!t){return}for(const n of e.chartGroups??[]){t.addTextStyle(n.dataLabels?.textStyle);for(const r of n.series??[]){K4r(r,t)}}}function J4r(e){if(!e)return void 0;const t={};const n=e.layoutTarget!==void 0?Ape[e.layoutTarget]:void 0;if(n)t.target=n;const r=e.xMode!==void 0?uE[e.xMode]:void 0;const i=e.yMode!==void 0?uE[e.yMode]:void 0;const o=e.wMode!==void 0?uE[e.wMode]:void 0;const a=e.hMode!==void 0?uE[e.hMode]:void 0;if(r)t.xMode=r;if(i)t.yMode=i;if(o)t.wMode=o;if(a)t.hMode=a;if(typeof e.x==="number")t.x=e.x;if(typeof e.y==="number")t.y=e.y;if(typeof e.w==="number")t.w=e.w;if(typeof e.h==="number")t.h=e.h;return Object.keys(t).length>0?t:void 0}function Q4r(e){const t={};const n=e.target??e.layoutTarget;const r=n?O3t[n]:void 0;if(r!==void 0)t.layoutTarget=r;if(e.xMode)t.xMode=AX[e.xMode];if(e.yMode)t.yMode=AX[e.yMode];if(e.wMode)t.wMode=AX[e.wMode];if(e.hMode)t.hMode=AX[e.hMode];if(typeof e.x==="number")t.x=e.x;if(typeof e.y==="number")t.y=e.y;if(typeof e.w==="number")t.w=e.w;if(typeof e.h==="number")t.h=e.h;return Object.keys(t).length>0?t:void 0}var Tp=class{#e;#t;#n;#r;#i;#a;#o;#s;#l;#c=[];#u;#f;#d=false;#p;#m;#h;#g;#y;#x=[];#v=[];#_;#E;#S;#C;#b;#T;#k;#P;#A;#w;#I;#M;#F;#L;#O;#B;#D;#z;#N;#R;#$;#Y;#V;#G;#W;constructor(t,n){Z4r(t,n);this.#e=t?.id??Vv();this.#t=t?.type?Ppe[t.type]:void 0;this.#u=t?.hasLegend;const r=t?.series?.length===1&&t.titleTextStyle!==void 0?t.series[0]?.name:void 0;this.#n=t?.title||r;this.#o=t?.titlePlacement;this.#s=t?.titleOverlay;this.#r=structuredClone(t?.titleParagraphs??[]);this.#i=t?.titleManualLayout?structuredClone(t.titleManualLayout):void 0;this.#a=t?.autoTitleDeleted;this.#l=t?.styleIndex;this.#c=t?.categories??[];this.#E=new Lye(t?.style);this.#S=new eo({type:"proto",proto:t?.chartLine});this.#C=new eo({type:"proto",proto:t?.chartSpaceLine});this.#p=t?.chartFill?new gi({type:"proto",proto:t.chartFill}):void 0;this.#m=t?.chartSpaceFill?new gi({type:"proto",proto:t.chartSpaceFill}):void 0;this.#h=t?.plotAreaFill?new gi({type:"proto",proto:t.plotAreaFill}):void 0;this.#g=J4r(t?.plotAreaManualLayout);this.#y=new Aj(t?.histogramOptions);this.#x=structuredClone(t?.axes??[]);for(const i of t?.axes??[]){n?.addTextStyle(i.textStyle);n?.addTextStyle(i.titleTextStyle)}this.#v=structuredClone(t?.chartGroups??[]);this.#T=t?.roundedCorners;this.#b=new eo({type:"proto",proto:t?.plotAreaLine});this.#k=new A3(t?.legend,{getHasLegend:()=>this.#u,setHasLegend:i=>{this.#u=i}},n);this.#P=new S3(t?.dataLabels,n);this.#A=new Qz(t?.dataTable,n);n?.addTextStyle(t?.titleTextStyle);this.#w=new ko(t?.titleTextStyle);this.#I=new ME(t?.xAxis,n);this.#M=new ME(t?.yAxis,n);this.#F=new xye(t?.barOptions);this.#L=new wye(t?.lineOptions);this.#O=new bye(t?.areaOptions);this.#B=new Cye(t?.scatterOptions);this.#D=new _ye(t?.bubbleOptions);this.#z=new t9(t?.pieOptions);this.#N=new vye(t?.boxWhiskerOptions);this.#R=new e9(t?.doughnutOptions);this.#$=new Tye(t?.funnelOptions);this.#Y=new Dye(t?.treemapOptions);this.#V=new Eye(t?.mapOptions);this.#G=new Fye(t?.view3d);this.#W=new Mye(t?.series,void 0,n)}get id(){return this.#e}get type(){return this.#t}set type(t){if(this.#t===t){return}this.#t=t}get funnelOptions(){return this.#$}set funnelOptions(t){this.#$=t}get title(){return this.#n}set title(t){this.#n=t;this.#r=[];if(t&&this.#o===void 0&&this.#s===void 0){this.#o="aboveChart"}}get titleParagraphs(){return this.#r}get titleManualLayout(){return this.#i}get autoTitleDeleted(){return this.#a}get titlePlacement(){return this.#o}set titlePlacement(t){this.#o=t??void 0}get styleIndex(){return this.#l}set styleIndex(t){this.#l=t??void 0}get categories(){return[...this.#c]}resolveCategories(t){if(this.#c.length>0){return[...this.#c]}const n=this.#W.items;if(t!==void 0){return n[t]?.resolveCategories()??[]}let r=[];for(const i of n){const o=i.resolveCategories();if(o.length>r.length){r=o}}return r}getCategories(t){return this.resolveCategories(t)}resolveSeriesCategories(t){return this.#W.items[t]?.resolveCategories(this.#c)??this.resolveCategories(t)}resolveSeriesValues(t){return this.#W.items[t]?.resolveValues()??[]}set categories(t){this.#c=Iye(t,"Chart.categories")}get chartGroups(){return structuredClone(this.#v)}set chartGroups(t){this.#v=structuredClone(t??[]);this.#_=void 0}get comboRenderGroups(){if(!this.#_){this.#_=this.#j()}return this.#_}get yAxis(){return this.#M}get valueAxis(){return this.#M}set yAxis(t){if(t instanceof ME){this.#M=t;return}if(t&&typeof t==="object"){Cze(this.#M,t)}}get barOptions(){return this.#F}set barOptions(t){this.#F=t}get lineOptions(){return this.#L}set lineOptions(t){this.#L=t}get areaOptions(){return this.#O}set areaOptions(t){this.#O=t}get scatterOptions(){return this.#B}set scatterOptions(t){this.#B=t}get bubbleOptions(){return this.#D}set bubbleOptions(t){this.#D=t}get pieOptions(){return this.#z}set pieOptions(t){this.#z=t}get boxWhiskerOptions(){return this.#N}set boxWhiskerOptions(t){this.#N=t}get doughnutOptions(){return this.#R}set doughnutOptions(t){this.#R=t}get xAxis(){return this.#I}get categoryAxis(){return this.#I}set xAxis(t){if(t instanceof ME){this.#I=t;return}if(t&&typeof t==="object"){Cze(this.#I,t)}}get legend(){return this.#k}set legend(t){this.#k=t}get hasLegend(){return this.#u}get mapOptions(){return this.#V}set mapOptions(t){this.#V=t}get dataLabels(){return this.#P}set dataLabels(t){this.#P=t}get dataTable(){return this.#A}set dataTable(t){this.#A=t}get titleTextStyle(){return this.#w}get style(){return this.#E}get chartLine(){return this.#S}get chartSpaceLine(){return this.#C}get treemapOptions(){return this.#Y}set chartLine(t){this.#S=t}set chartSpaceLine(t){this.#C=t}get plotAreaLine(){return this.#b}set hasLegend(t){this.#u=t}set titleTextStyle(t){this.#w=t}get displayBlanksAs(){return this.#f}set displayBlanksAs(t){this.#f=t??void 0}get showDlblsOverMax(){return this.#d}set showDlblsOverMax(t){this.#d=Boolean(t)}get chartFill(){return this.#p}set chartFill(t){this.#p=new gi(t)}get chartSpaceFill(){return this.#m}set chartSpaceFill(t){this.#m=new gi(t)}get plotAreaFill(){return this.#h}set plotAreaFill(t){this.#h=new gi(t)}get plotAreaManualLayout(){return this.#g?{...this.#g}:void 0}set plotAreaManualLayout(t){this.#g=t?{...t}:void 0}get histogramOptions(){return this.#y.toProto()}set histogramOptions(t){this.#y=new Aj(t)}get series(){return this.#W}get roundedCorners(){return this.#T}set roundedCorners(t){this.#T=t??void 0}buildTrendlineRenderCache(){const t=new Map;const n=this.#t==="scatter"||this.#t==="bubble";const r=this.#W.items;for(let i=0;i{if(n){const f=o.xValues??[];const h=o.values??[];const m=f.map((g,x)=>({x:g,y:h[x]})).filter(g=>typeof g.y==="number").filter(g=>Number.isFinite(g.x)&&Number.isFinite(g.y)).map(g=>({x:g.x,y:g.y}));return m.slice().sort((g,x)=>g.x-x.x)}const u=o.values??[];const d=u.map((f,h)=>({x:h,y:f})).filter(f=>typeof f.y==="number").filter(f=>Number.isFinite(f.x)&&Number.isFinite(f.y)).map(f=>({x:f.x,y:f.y}));return d})();const l=a.map(u=>sk({type:u.type??"linear",points:s,polynomialOrder:u.polynomialOrder,movingAveragePeriod:u.movingAveragePeriod,forecastForward:u.forecastForward,forecastBackward:u.forecastBackward,intercept:u.intercept,displayEquation:u.displayEquation,displayRSquared:u.displayRSquared}));if(l.some(u=>u!==null)){t.set(i,l)}}return{bySeriesIndex:t}}get view3d(){return this.#G}set view3d(t){this.#G=t}#j(){if(this.#t!=="combo"||this.#v.length===0){return[]}const t=new Map(this.#x.flatMap(o=>o.id===void 0?[]:[[o.id,o]]));const n=this.#I.toProto();const r=this.#M.toProto();let i=0;return this.#v.map((o,a)=>{const s=o.axisIds.flatMap(m=>{const g=t.get(m);return g?[g]:[]});const l=o.axisIds.length>0;const u=s.find(m=>m.kind===1||m.kind===2)??(l?s[0]:n);const d=s.find(m=>m.kind===3&&m!==u)??(l?s[1]:r);const f=d?.id!==void 0&&r?.id!==void 0?d.id===r.id:d===r||a===0;const h={group:o,xAxis:u,yAxis:d,firstSeriesIndex:i,isPrimaryValueAxis:f};i+=o.series.length;return h})}toProto(){const t=[...this.#c];const n=this.#W.toProto();if(this.#t==="line"&&this.#L.hasExplicitSmooth){for(const j of n){if(j.smooth===void 0){j.smooth=this.#L.smooth}}}const r=this.#E.toProto();const i=this.#k.toProto();const o=this.#P.toProto();const a=this.#w.toProto();const s=this.#I.toProto();const l=this.#M.toProto();const u=this.#p?.toProto();const d=this.#m?.toProto();const f=this.#h?.toProto();const h=this.#S.toProto();const m=this.#C.toProto();const g=this.#b.toProto();const x=this.#F.toProto();const w=this.#L.toProto();const _=this.#O.toProto();const C=this.#B.toProto();const A=this.#D.toProto();const P=this.#z.toProto();const L=this.#N.toProto();const I=this.#R.toProto();const N=this.#$.toProto();const O=this.#Y.toProto();const z=this.#y.toProto();const U=this.#V.toProto();const W=this.#G.toProto();const H=this.#t?w0[this.#t]:void 0;if(H===void 0){return void 0}const $={id:this.#e,title:this.#n??"",categories:t,series:n,type:H,barDirection:this.barOptions.direction?Dpe[this.barOptions.direction]:0,styleIndex:this.#l??0,hasLegend:this.#u??false,pivotFormats:[],titleParagraphs:structuredClone(this.#r),bbox:void 0,xAxis:s,yAxis:l,axes:structuredClone(this.#x),chartGroups:structuredClone(this.#v),userShapes:[],legend:i};if(this.#o){$.titlePlacement=this.#o;if(this.#o!=="none"){$.titleOverlay=this.#o==="centeredOverlay"}}else if(this.#s!==void 0){$.titleOverlay=this.#s}const K=this.#A.toProto();if(K){$.dataTable=K}const X=this.#g?Q4r(this.#g):void 0;if(X){$.plotAreaManualLayout=X}if(this.#i){$.titleManualLayout=structuredClone(this.#i)}if(this.#a!==void 0){$.autoTitleDeleted=this.#a}if(o){$.dataLabels=o}if(this.#w.isSet){$.titleTextStyle=a}if(u){$.chartFill=u}if(h){$.chartLine=h}if(d){$.chartSpaceFill=d}if(m){$.chartSpaceLine=m}if(this.#T!==void 0){$.roundedCorners=this.#T}if(f){$.plotAreaFill=f}if(g){$.plotAreaLine=g}if(U){$.mapOptions=U}if(r){$.style=r}if(this.#f!==void 0){$.displayBlanksAs=xMt(this.#f)}if(this.#d){$.showDlblsOverMax=true}if(W){$.view3d=W}if(x){$.barOptions=x}if(w){$.lineOptions=w}if(_){$.areaOptions=_}if(P){$.pieOptions=P}if(L){$.boxWhiskerOptions=L}if(I){$.doughnutOptions=I}if(N){$.funnelOptions=N}if(C){$.scatterOptions=C}if(A){$.bubbleOptions=A}if(O){$.treemapOptions=O}if(z){$.histogramOptions=z}return $}};var eNr=new Set(["pie","pie3D","doughnut","treemap","sunburst","map","funnel","ofPie"]);var Y5t="#D4D4D4";var q5t="#666666";var R3=class{#e;#t;#n;constructor(t,n){this.#e=t;this.#t=(n??[]).map(r=>new Tp(r??{},this.#e.fontFamilyCache));this.#n=new Map(this.#t.map(r=>[r.id,r]))}get items(){return[...this.#t]}getById(t){if(!t){return void 0}return this.#n.get(t)}add(t){const n=new Tp({type:w0[t]},this.#e.fontFamilyCache);n.hasLegend=true;n.legend.position="bottom";if(!eNr.has(t)){n.xAxis.line.width=1;n.xAxis.line.style="solid";n.xAxis.line.fill=Y5t;n.xAxis.textStyle.fill=q5t;n.yAxis.line.width=1;n.yAxis.line.style="solid";n.yAxis.line.fill=Y5t;n.yAxis.textStyle.fill=q5t;n.yAxis.deleted=true}if(t==="scatter"&&n.scatterOptions.style===void 0){n.scatterOptions.style="marker"}this.#t.push(n);this.#n.set(n.id,n);return n}attach(t){const n=this.#n.get(t.id);if(n){return n}this.#t.push(t);this.#n.set(t.id,t);return t}replace(t){this.#t=(t??[]).map(n=>new Tp(n??{},this.#e.fontFamilyCache));this.#n=new Map(this.#t.map(n=>[n.id,n]))}toProto(){return this.#t.map(t=>t.toProto()).filter(t=>Boolean(t)).map(t=>({...t,barDirection:t.barDirection??0}))}};var tNr=new Set(["image/emf","image/x-emf","application/emf","application/x-emf"]);function Jv(e){return Boolean(e&&tNr.has(e.trim().toLowerCase()))}async function X5t(e,t={}){const n=hNt();if(!n){return void 0}try{return await n.rasterizeEmf(e,t)}catch(r){console.warn(`Unable to render EMF image (${e.byteLength} bytes)`,r);return void 0}}var nNr=new Set(["image/wmf","image/x-wmf","application/wmf","application/x-wmf"]);function Oye(e){if(!e){return false}const t=e.trim().toLowerCase();return Jv(t)||nNr.has(t)}async function Dj(e,t,n={}){if(!Jv(e)){return void 0}return X5t(t,n)}var Bye=2048;var rNr=4096;var iNr=2048*2048;var Mze=1e3;function zye(e){if(e===void 0||!Number.isFinite(e)||e<=0){return void 0}return Math.max(1/Mze,Math.round(e*Mze)/Mze)}function j5t(e={}){return{targetWidth:zye(e.targetWidth),targetHeight:zye(e.targetHeight),devicePixelRatio:zye(e.devicePixelRatio)??1}}function NN(){const e=globalThis.devicePixelRatio;return zye(typeof e==="number"?e:void 0)??1}function n9(e={}){const t=j5t(e);return`${t.targetWidth??"auto"}x${t.targetHeight??"auto"}@${t.devicePixelRatio}`}function K5t(e,t={}){const n=Number.isFinite(e)&&e>0?e:1;const r=j5t(t);const i=r.targetWidth===void 0?void 0:r.targetWidth*r.devicePixelRatio;const o=r.targetHeight===void 0?void 0:r.targetHeight*r.devicePixelRatio;let a;let s;if(i!==void 0&&o!==void 0){const m=Math.max(i/n,o);a=n*m;s=m}else if(i!==void 0){a=i;s=i/n}else if(o!==void 0){a=o*n;s=o}else if(n>=1){a=Bye;s=Bye/n}else{a=Bye*n;s=Bye}let l=Math.max(1,Math.ceil(a));let u=Math.max(1,Math.ceil(s));const d=rNr/Math.max(l,u);const f=Math.sqrt(iNr/(l*u));const h=Math.min(1,d,f);if(h<1){l=Math.max(1,Math.floor(l*h));u=Math.max(1,Math.floor(u*h))}return{width:l,height:u}}var Uye="image/svg+xml";var Z5t=e=>{if(e.buffer instanceof ArrayBuffer){return e}const t=new Uint8Array(e.byteLength);t.set(e);return t};var oNr=(e,t,n)=>{if(/\bwidth\s*=|\bheight\s*=/.test(e)){return new Blob([e],{type:Uye})}const r=e.replace(/]*)>/,``);return new Blob([r],{type:Uye})};var J5t=()=>{const e=globalThis.devicePixelRatio;return typeof e==="number"&&Number.isFinite(e)&&e>0?e:1};var Vye=e=>{const t=Math.round(e??1);return t>0?t:1};var aNr=()=>{const e=globalThis.Image;if(e){return e}return void 0};var sNr=async(e,t)=>{const n=aNr();if(!n||typeof URL==="undefined"||typeof URL.createObjectURL!=="function"){return void 0}const r=URL.createObjectURL(e);try{const i=new n;if(typeof i.decode==="function"){i.src=r;await i.decode()}else{const o=new Promise((a,s)=>{i.onload=()=>a();i.onerror=()=>s(new Error("Failed to decode SVG image payload."))});i.src=r;await o}return await createImageBitmap(i,t)}finally{if(typeof URL.revokeObjectURL==="function"){URL.revokeObjectURL(r)}}};var lNr=async(e,t)=>{try{const n=await sNr(e,t);if(n){return n}}catch{}return createImageBitmap(e,t)};var cNr=e=>{if(!e){return false}return Oye(e)};var Q5t=async(e,t,n)=>{const r=e.contentType||"";if(cNr(r)){const o=await Dj(r,e.data,Jv(r)?{targetWidth:t,targetHeight:n,devicePixelRatio:NN()}:{});if(o){return o}console.warn(`Unsupported image: ${r}`);return void 0}if(e.contentType===Uye){const o=Vye(t);const a=Vye(n);const s=J5t();const l=new TextDecoder;const u=l.decode(e.data);const d=oNr(u,o,a);try{return await lNr(d,{resizeWidth:Math.max(1,Math.round(o*s)),resizeHeight:Math.max(1,Math.round(a*s))})}catch(f){console.warn(`Unsupported SVG payload (${e.data?.byteLength??0} bytes)`,f);return void 0}}const i=new Blob([Z5t(e.data)],{type:r||"application/octet-stream"});try{return await createImageBitmap(i)}catch(o){console.warn(`Unsupported image payload: ${r||"unknown mime"} (${e.data?.byteLength??0} bytes)`,o);return void 0}};var uNr=e=>{const t=globalThis["Buffer"];if(t&&typeof t.from==="function"){return Z5t(t.from(e,"base64"))}if(typeof atob==="function"){const n=atob(e);const r=new Uint8Array(n.length);for(let i=0;i{const t=/^data:([^;,]+);base64,(.+)$/i.exec(e);if(!t){return void 0}const n=t[1]?.trim().toLowerCase();const r=t[2];if(!n||!r){return void 0}return{contentType:n,data:uNr(r)}};var fNr=async(e,t,n)=>{if(!e.uri){return void 0}const r=e.uri.startsWith("data:")?dNr(e.uri):void 0;if(r){return Q5t(r,t,n)}return void 0};var lk=class{#e;#t;constructor(t,n){const r=n?.id&&n.id.length>0?n.id:Vv();this.#e={id:r,contentType:n?.contentType??"",data:n?.data?new Uint8Array(n.data):new Uint8Array,prompt:n?.prompt??void 0,uri:n?.uri??void 0};this.#t=new Map}get id(){return this.#e.id}get contentType(){return this.#e.contentType}set contentType(t){this.#e.contentType=t;this.#r()}get data(){return new Uint8Array(this.#e.data)}set data(t){this.#e.data=new Uint8Array(t);this.#r()}get prompt(){return this.#e.prompt}set prompt(t){this.#e.prompt=t??void 0}get uri(){return this.#e.uri}set uri(t){this.#e.uri=t??void 0;this.#r()}toProto(){return{id:this.#e.id,contentType:this.#e.contentType,data:new Uint8Array(this.#e.data),prompt:this.#e.prompt,uri:this.#e.uri}}async getBitmap(t,n){const r=this.#n(t,n);const i=this.#t.get(r);if(i){return i}const o=this.#i(t,n).catch(async()=>{console.warn(`Failed to create bitmap for image`);return void 0});this.#t.set(r,o);if(Jv(this.#e.contentType)){const a=await o;if(a===void 0&&this.#t.get(r)===o){this.#t.delete(r)}return a}return o}#n(t,n){const r=`${this.#e.id}:${this.#e.data.byteLength}:${this.#e.contentType}:${this.#e.uri??""}`;if(this.#a()){const i=Vye(t);const o=Vye(n);const a=J5t();return`${r}:${i}x${o}@${Math.round(a*100)/100}`}if(Jv(this.#e.contentType)){return`${r}:${n9({targetWidth:t,targetHeight:n,devicePixelRatio:NN()})}`}return r}#r(){this.#t.clear()}async#i(t,n){if(this.#e.data.byteLength===0&&this.#e.uri){return fNr({contentType:this.#e.contentType,uri:this.#e.uri},t,n)}const r={contentType:this.#e.contentType,data:this.#e.data};return Q5t(r,t,n)}#a(){return this.#e.contentType===Uye}};var P3=class{#e;#t;#n;constructor(t,n){this.#e=t;this.#t=(n??[]).map(r=>{const i=new lk(this.#r(),r??{});return i});this.#n=new Map(this.#t.map(r=>[r.id,r]))}get items(){return[...this.#t]}getById(t){if(!t){return void 0}return this.#n.get(t)}add(t={}){const n={id:t.id??"",contentType:t.contentType??"",data:t.data?new Uint8Array(t.data):new Uint8Array,prompt:t.prompt,uri:t.uri};const r=new lk(this.#r(),n);this.#t.push(r);this.#n.set(r.id,r);return r}replace(t){this.#t=(t??[]).map(n=>new lk(this.#r(),n??{}));this.#n=new Map(this.#t.map(n=>[n.id,n]))}toProto(){return this.#t.map(t=>t.toProto())}#r(){return this.#e}};var Fj=class{#e;constructor(t=[]){this.#e=t.map(n=>new r9(n))}get items(){return[...this.#e]}add(t={}){const n=new r9({id:t.id??"",tetherId:t.tetherId??"",targetId:t.targetId??"",type:t.type??0,...t});this.#e.push(n);return n}replace(t){this.#e=t.map(n=>new r9(n))}toProto(){return this.#e.map(t=>t.toProto())}};var r9=class{#e;constructor(t){this.#e={...t,id:t.id??"",tetherId:t.tetherId??"",targetId:t.targetId??"",type:t.type??0}}get id(){return this.#e.id}set id(t){this.#e.id=t}get title(){return this.#e.title??""}set title(t){this.#e.title=t}get uri(){return this.#e.uri??""}set uri(t){this.#e.uri=t}get locator(){return this.#e.locator??""}set locator(t){this.#e.locator=t}get evidence(){return this.#e.evidence??""}set evidence(t){this.#e.evidence=t}get note(){return this.#e.note??""}set note(t){this.#e.note=t}toProto(){return structuredClone(this.#e)}};var Lze={accent1:"#156082",accent2:"#E97132",accent3:"#196B24",accent4:"#0F9ED5",accent5:"#A02B93",accent6:"#4EA72E",bg1:"#FFFFFF",bg2:"#000000",tx1:"#1F1F1F",tx2:"#FFFFFF",dk1:"#000000",lt1:"#FFFFFF",dk2:"#0E2841",lt2:"#E8E8E8",hlink:"#467886",folHlink:"#96607D"};function pNr(e){if(!e){return void 0}const t=new ko;Uf(t,e);return t.toProto()}function ck(e){const t=e.paragraphStyle?{...e.paragraphStyle,tabStops:e.paragraphStyle.tabStops??[]}:void 0;return{id:e.id,name:e.name,basedOn:e.basedOn,textStyle:pNr(e.textStyle),paragraphStyle:t,spaceBefore:e.spaceBefore,spaceAfter:e.spaceAfter,tags:[]}}function eBt(){const e=new P0({stub:()=>{}},void 0);e.colorScheme={name:"Office",themeColors:{...Lze}};return e.toProto()}function tBt(){return[{name:"Aptos",family:"swiss",embeddedFonts:[]},{name:"Aptos Display",family:"swiss",embeddedFonts:[]},{name:"Times New Roman",family:"roman",embeddedFonts:[]},{name:"Cambria Math",family:"roman",embeddedFonts:[]}]}function nBt(){return{defaultTabStop:720}}function rBt(){return[ck({id:"Normal",name:"Normal",textStyle:{typeface:"Aptos",fontSize:"12pt"},paragraphStyle:{lineSpacingPercent:115833},spaceAfter:160}),ck({id:"Title",name:"Title",basedOn:"Normal",textStyle:{typeface:"Aptos Display",fontSize:"28pt",color:"#1F1F1F"},paragraphStyle:{lineSpacingPercent:1e5},spaceAfter:80}),ck({id:"Subtitle",name:"Subtitle",basedOn:"Normal",textStyle:{typeface:"Aptos",fontSize:"14pt",color:"#6B7280"},paragraphStyle:{lineSpacingPercent:1e5},spaceAfter:80}),ck({id:"Heading1",name:"Heading 1",basedOn:"Normal",textStyle:{typeface:"Aptos Display",fontSize:"20pt",color:"#156082"},paragraphStyle:{lineSpacingPercent:1e5},spaceBefore:360,spaceAfter:80}),ck({id:"Heading2",name:"Heading 2",basedOn:"Normal",textStyle:{typeface:"Aptos Display",fontSize:"16pt",color:"#156082"},paragraphStyle:{lineSpacingPercent:1e5},spaceBefore:160,spaceAfter:80}),ck({id:"Quote",name:"Quote",basedOn:"Normal",textStyle:{italic:true,color:"#6B7280"},paragraphStyle:{lineSpacingPercent:115833},spaceBefore:80,spaceAfter:80}),ck({id:"IntenseQuote",name:"Intense Quote",basedOn:"Quote",textStyle:{bold:true,color:"#156082"},paragraphStyle:{lineSpacingPercent:115833},spaceBefore:80,spaceAfter:80}),ck({id:"ListParagraph",name:"List Paragraph",basedOn:"Normal",paragraphStyle:{marginLeft:457200,indent:-228600}}),ck({id:"Caption",name:"Caption",basedOn:"Normal",textStyle:{fontSize:"9pt",italic:true,color:"#6B7280"},paragraphStyle:{lineSpacingPercent:1e5},spaceAfter:80})]}function mNr(){const e={id:"doc-run-1",text:"Start writing here...",textStyle:void 0,hyperlink:void 0,citations:[],reviewMarkIds:[]};return{id:"doc-paragraph-1",runs:[e],inlineNodes:[],textStyle:void 0,styleId:"Normal"}}function iBt(){return{id:"doc-element-1",type:1,paragraphs:[mNr()],bbox:void 0,zIndex:0,innerXml:"",outerXml:"",shape:void 0,image:void 0,chartReference:void 0,video:void 0,table:void 0,name:"",placeholderIndex:0,placeholderType:"",effects:[],children:[],levelsStyles:[],fill:void 0,lineReference:void 0,fillReference:void 0,effectReference:void 0,fontReference:void 0,hyperlink:void 0,textStyle:void 0,citations:[]}}function oBt(){const e=iBt();const t=iBt();const n=12240;const r=15840;return{id:"walnut-document",name:"New document",widthEmu:n,heightEmu:r,charts:[],elements:[e],images:[],footnotes:[],comments:[],commentReferences:[],textStyles:rBt(),reviewMarks:[],tableStyleDefinitions:[],endnotes:[],settings:nBt(),theme:eBt(),fonts:tBt(),sections:[{id:"doc-section-1",breakType:0,pageSetup:{widthEmu:n,heightEmu:r,pageMargin:void 0},columns:{count:1,space:0,widths:[],hasSeparatorLine:false},elements:[t],header:void 0,footer:void 0,startsWithPageBreak:false,differentFirstPage:void 0,firstHeader:void 0,firstFooter:void 0}],numberingDefinitions:[],paragraphNumberings:[]}}function Sa(e){return structuredClone(e)}var Nj=class{#e;#t;constructor(t=[],n={}){this.#e=Sa(t);this.#t=n.onMutated}get items(){return Sa(this.#e)}getById(t){if(!t){return void 0}const n=this.#e.find(r=>r.id===t);return n?Sa(n):void 0}set(t){const n=Sa(t);const r=this.#e.findIndex(i=>i.id===n.id);if(r>=0){this.#e[r]=n}else{this.#e.push(n)}this.#t?.();return Sa(n)}delete(t){const n=this.#e.findIndex(r=>r.id===t);if(n<0){return false}this.#e.splice(n,1);this.#t?.();return true}replace(t){this.#e=Sa(t);this.#t?.()}toProto(){return Sa(this.#e)}};var Oj=class{#e;#t;constructor(t=[],n={}){this.#e=Sa(t);this.#t=n.onMutated}get items(){return Sa(this.#e)}getByCommentId(t){if(!t){return void 0}const n=this.#e.find(r=>r.commentId===t);return n?Sa(n):void 0}set(t){const n=Sa(t);const r=this.#e.findIndex(i=>i.commentId===n.commentId);if(r>=0){this.#e[r]=n}else{this.#e.push(n)}this.#t?.();return Sa(n)}delete(t){const n=this.#e.findIndex(r=>r.commentId===t);if(n<0){return false}this.#e.splice(n,1);this.#t?.();return true}replace(t){this.#e=Sa(t);this.#t?.()}toProto(){return Sa(this.#e)}};var $ye=class{#e;#t;#n;#r;constructor(t){this.#e=new C3({people:t.people??[],threads:t.threads??[]});this.#t=t.documentId??"";this.#n=t.textElementId??"";this.#r=t.resolveTextRange}get people(){return this.#e.people}get threads(){return this.#e.threads}setSelf(t){return this.#e.setSelf(t)}addThread(t,n,r={}){const i=this.#i(t.textRange);return this.#e.addThread({proto:i},n,r)}toProto(){return this.#e.toProto()}#i(t){const n=this.#r(t);const r=n?.startCp??0;const i=n?.length??0;const o={slideId:this.#t,elementId:this.#n,startCp:r,length:i};return{textRange:o}}};function gNr(e,t){if(t instanceof ArrayBuffer){return`ArrayBuffer:${t.byteLength}`}if(ArrayBuffer.isView(t)){return`${t.constructor.name}:${t.byteLength}`}return t}function yNr(e){return JSON.stringify(e,gNr)}var Gye=class{#e;#t;reset(){this.#e=void 0;this.#t=void 0}getPages(t,n,r="default"){const i=`${r}:${yNr(t)}`;if(i===this.#e&&this.#t){return this.#t}const o=n(t);this.#e=i;this.#t=o;return o}};var Bj=class{#e;constructor(t,n){this.#e=structuredClone(t);n?.addParagraphs(t.paragraphs)}get id(){return this.#e.id??""}toProto(){return structuredClone(this.#e)}};var zj=class{#e=[];#t;#n;#r;#i;constructor(t){this.#t=t.documentId??"";this.#n=t.textElementId??"";this.#r=t.resolveTextRange;this.#i=t.onMutated;const n=t.endnotes??[];this.#e=n.map(r=>new Bj(r,t.fontFamilyCache))}get items(){return[...this.#e]}add(t,n){const r=this.#a(t);const i=this.#o(n.range);const o={id:Ob(),paragraphs:r,referenceTextRange:i,referenceRunIds:[]};const a=new Bj(o);this.#e.push(a);this.#i?.();return a}replace(t){this.#e=t.map(n=>new Bj(n));this.#i?.()}toProto(){return this.#e.map(t=>t.toProto())}#a(t){if(LT(t)){return S0(t)}return S0([String(t)])}#o(t){const n=this.#r(t);if(!n){return void 0}return{slideId:this.#t,elementId:this.#n,startCp:n.startCp,length:n.length}}};var Uj=class{#e;#t;constructor(t=[],n={}){this.#e=Sa(t);this.#t=n.onMutated}get items(){return Sa(this.#e)}getByName(t){if(!t){return void 0}const n=this.#e.find(r=>r.name===t);return n?Sa(n):void 0}set(t){const n=Sa(t);const r=this.#e.findIndex(i=>i.name===n.name);if(r>=0){this.#e[r]=n}else{this.#e.push(n)}this.#t?.();return Sa(n)}delete(t){const n=this.#e.findIndex(r=>r.name===t);if(n<0){return false}this.#e.splice(n,1);this.#t?.();return true}replace(t){this.#e=Sa(t);this.#t?.()}toProto(){return Sa(this.#e)}};var Hye=class{#e;constructor(t,n){this.#e=t;n?.addParagraphs(t.paragraphs)}get id(){return this.#e.id??""}toProto(){return{...this.#e,referenceRunIds:this.#e.referenceRunIds??[],paragraphs:this.#e.paragraphs?this.#e.paragraphs.map(t=>({...t,runs:t.runs?.map(n=>({...n}))??[]})):[]}}};var Wye=class{#e=[];#t;#n;#r;#i;constructor(t){this.#t=t.documentId??"";this.#n=t.textElementId??"";this.#r=t.resolveTextRange;this.#i=t.onMutated;const n=t.footnotes??[];this.#e=n.map(r=>new Hye(r,t.fontFamilyCache))}add(t,n){const r=this.#a(t);const i=this.#o(n.range);const o={id:Ob(),paragraphs:r,referenceTextRange:i,referenceRunIds:[]};const a=new Hye(o);this.#e.push(a);this.#i?.();return a}toProto(){return this.#e.map(t=>t.toProto())}#a(t){if(LT(t)){return S0(t)}return S0([String(t)])}#o(t){const n=this.#r(t);if(!n){return void 0}return{slideId:this.#t,elementId:this.#n,startCp:n.startCp,length:n.length}}};uk();h9e();var td="Carlito, Segoe UI, Helvetica, Arial, sans-serif";var Bh=10;var r0e=11;var i0e=10;var nd="#666";var I0=Wj;var x6t=150;var M3=2;var v6t={top:12,right:12,bottom:12,left:12};var oVo=Hj({decimal:".",thousands:",",grouping:[3],currency:["","$"],percent:" %"});function OE(e){return e?.typeface??e?.name??td}R1();zh();function P5r(e){if(e.categories.length>0){return e.categories.length}return e.series.reduce((t,n)=>Math.max(t,n.values.length),0)}function h9(e){const t=e.chartGroups;const n=e.resolveCategories();if(e.type==="combo"&&t.length>0){let r=Number.POSITIVE_INFINITY;let i=Number.NEGATIVE_INFINITY;for(const o of t){const a=S8t({type:o.type!==void 0?Ppe[o.type]:void 0,categories:n,series:o.series.map(s=>({values:k3(s)})),barGrouping:o.barOptions?.grouping!==void 0?Fpe[o.barOptions.grouping]:void 0,areaGrouping:o.areaOptions?.grouping!==void 0?kpe[o.areaOptions.grouping]:void 0,lineGrouping:o.lineOptions?.grouping!==void 0?Rpe[o.lineOptions.grouping]:void 0});r=Math.min(r,a.min);i=Math.max(i,a.max)}return{min:Number.isFinite(r)?r:0,max:Number.isFinite(i)?i:0}}return S8t({type:e.type,categories:n,series:e.series.items.map((r,i)=>({values:e.resolveSeriesValues(i)})),barGrouping:e.barOptions.grouping,areaGrouping:e.areaOptions.grouping,lineGrouping:e.lineOptions.grouping})}function S8t(e){const t=e.type==="area"||e.type==="area3D";const n=e.type==="line"||e.type==="line3D";const r=e.barGrouping;const i=e.areaGrouping;const o=e.lineGrouping;let a=false;let s=false;if(t){a=i==="stacked";s=i==="percentStacked"}else if(n){a=o==="stacked";s=o==="percentStacked"}else{a=r==="stacked";s=r==="percentStacked"}if(a){if(e.series.length===1){return A8t(e.series)}const l=P5r(e);let u=0;let d=0;for(let f=0;f{const x=g.values[f]??0;if(x>=0)h+=x;else m+=x});if(h>u)u=h;if(md.values.some(f=>(f??0)<0));const u=e.series.some(d=>d.values.some(f=>(f??0)>0));return{min:l?-1:0,max:u?1:0}}return A8t(e.series)}function A8t(e){const t=e.flatMap(a=>a.values);const[n,r]=Cy(t);const i=n!==void 0&&Number.isFinite(n)?n:0;const o=r!==void 0&&Number.isFinite(r)?r:0;return{min:i,max:o}}function T0e(e,t){const n=t??new Set;const r=e.series.findIndex((m,g)=>!n.has(g));if(r===-1){return{categories:[],seriesIndex:-1,segments:[],extents:{min:0,max:0}}}const i=e.series[r];const o=i?.values??[];const a=Nh(e,r);const s=new Set(e.waterfallOptions?.subtotalIndices??[]);const l=Math.max(o.length,a.length);let u=0;let d=0;let f=0;const h=[];for(let m=0;m=0?"increase":"decrease"}u=P;d=Math.min(d,C,A);f=Math.max(f,C,A);h.push({index:m,category:w,value:g,start:C,end:A,cumulativeBefore:_,cumulativeAfter:P,isSubtotal:x,kind:L,labelValue:x?P:g})}d=Math.min(d,0);f=Math.max(f,0);return{categories:a,seriesIndex:r,segments:h,extents:{min:d,max:f}}}function k8t(e){if(e===void 0||!Number.isFinite(e)){return 0}const t=Math.max(-100,Math.min(100,e));return-t/100}function p9(e,t){const n=Math.max(1,Math.floor(e));const r=k8t(t);return 1/(n+r*(n-1))}function w0e(e){const t=Math.max(1,Math.floor(e.seriesCount));const n=Math.max(0,Math.min(t-1,Math.floor(e.orderIndex)));const r=e.reverse?t-1-n:n;const i=k8t(e.overlap);return r*(1+i)*p9(t,e.overlap)}function I5r(e){return e!==2&&e!==3}function E0e(e,t){if(!t||t.size===0){return e}let n=0;for(let r=0;r=0?t:x6t;const a=o/100;if(!I5r(n)){return a/(1+a)}const s=Math.max(1,Math.floor(r));const l=a*p9(s,i);return l/(1+l)}function S0e(e){return e/2}zh();R1();R1();var M8t=10;var R8t=5;var P8t=20/21;var I8t=5/6;var L8t=new WeakMap;function A0e({automaticMin:e,automaticMax:t,automaticPositiveMin:n,range:r,axis:i,niceCount:o}){if(i?.logBase!==void 0){return M5r({automaticMin:e,automaticMax:t,automaticPositiveMin:n,range:r,axis:i,nice:o!==false})}const a=wc().domain([i?.min??e,i?.max??t]).range(r);if(o===false||i?.min!==void 0&&i.max!==void 0){return a}if(o===void 0){a.nice()}else{a.nice(o)}const[s,l]=a.domain();if(s===void 0||l===void 0){throw new Error("Expected a two-value chart scale domain")}return a.domain([i?.min??s,i?.max??l])}function cK(e){if(e.axis?.logBase!==void 0){return A0e({automaticMin:e.automaticMin,automaticMax:e.automaticMax,automaticPositiveMin:e.automaticPositiveMin,range:e.range,axis:e.axis,niceCount:e.maximumAutoMainIncrementCount??M8t})}return JN(e)}function JN(e){const{automaticMin:t,automaticMax:n,range:r,axis:i,expandWideValuesToZero:o=true,expandNarrowValuesTowardZero:a=true,limitNarrowAutoMainIncrementCount:s=true,maximumAutoMainIncrementCount:l=M8t,minimumAutomaticMax:u,automaticMajorUnit:d}=e;const{domain:f,majorUnit:h}=L5r({sourceMin:t,sourceMax:n,axis:i,expandWideValuesToZero:o,expandNarrowValuesTowardZero:a,limitNarrowAutoMainIncrementCount:s,maximumAutoMainIncrementCount:l,automaticMajorUnit:d});if(i?.max===void 0&&u!==void 0&&f[1]1e3){throw new Error("Logarithmic chart axis base must be from 2 through 1000")}const s=i.min??(e>0?e:n);const l=i.max??t;if(s===void 0||!Number.isFinite(s)||!Number.isFinite(l)||s<=0||l<=0){throw new Error("Logarithmic chart axis bounds must be positive")}const u=rK().base(a).domain([s,l]).range(r);if(!o||i.min!==void 0&&i.max!==void 0){return u}u.nice();const[d,f]=u.domain();if(d===void 0||f===void 0){throw new Error("Expected a two-value logarithmic chart scale domain")}return u.domain([i.min??d,i.max??f])}function QN(e){let t;for(const n of e){if(n===void 0||!Number.isFinite(n)||n<=0)continue;t=t===void 0?n:Math.min(t,n)}return t}function L5r({sourceMin:e,sourceMax:t,axis:n,expandWideValuesToZero:r,expandNarrowValuesTowardZero:i,limitNarrowAutoMainIncrementCount:o,maximumAutoMainIncrementCount:a,automaticMajorUnit:s}){const l=n?.min===void 0;const u=n?.max===void 0;const d=n?.min??e;const f=n?.max??t;const h=t-e;let m=e;let g=t;let x=a;if(l&&e>0){const A=e!==t&&e/t>=I8t;if(A&&i){m=e-h/2;if(o){x=Math.min(x,R8t)}}else if(r){m=0}}if(u&&t<0){const A=e!==t&&t/e>=I8t;if(A&&i){g=t+h/2;if(o){x=Math.min(x,R8t)}}else if(r){g=0}}const w=(u?g:f)-(l?m:d);const _=n?.majorUnit!==void 0&&Number.isFinite(n.majorUnit)&&n.majorUnit>0?n.majorUnit:void 0;let C=_??s;if(C===void 0){let A=1;if(w>0){A=w/x}C=D5r(A)}while(true){let A=l?N5r(m,C):d;let P=u?D8t(g,C):f;if(A===P){P=A+C}const L=P-A;if(l&&A!==0&&L>0&&(P-e)/L>P8t){A-=C}const I=P-A;if(u&&P!==0&&I>0&&(t-A)/I>P8t){P+=C}A=Number(A.toPrecision(15));P=Number(P.toPrecision(15));const N=Math.floor(Number(((P-A)/C).toPrecision(15)));if(_!==void 0||s!==void 0||N<=x){return{domain:[A,P],majorUnit:C}}C=F5r(C)}}function D5r(e){if(!Number.isFinite(e)||e<=0)return 1;const t=10**Math.floor(Math.log10(e));const n=e/t;if(n<=1)return t;if(n<=2)return 2*t;if(n<=5)return 5*t;return 10*t}function F5r(e){const t=10**Math.floor(Math.log10(e));const n=e/t;if(n<2)return 2*t;if(n<5)return 5*t;return 10*t}function N5r(e,t){return Math.floor(e/t)*t}function D8t(e,t){return Math.ceil(e/t)*t}var O5r=2;var B5r=2;var K9e=1e-9;var F8t=20/21;function g9(e){const t=m9(e.axis?.min);const n=m9(e.axis?.max);const r=m9(e.dataMin)??0;const i=m9(e.dataMax)??0;const[o,a]=e.includeZeroBaseline?[Math.min(0,r),Math.max(0,i)]:z5r(r,i);return{min:t??o,max:n??a,dataMin:r,dataMax:i,hasExplicitMin:t!==void 0,hasExplicitMax:n!==void 0,includeZeroBaseline:e.includeZeroBaseline,expandAutoBorderHeadroom:e.expandAutoBorderHeadroom??false}}function z5r(e,t){if(e===t){return[e,t]}const n=Math.min(e,t);const r=Math.max(e,t);const i=Math.abs(hk(n,r,B5r));if(!Number.isFinite(i)||i<=0){return[e,t]}const o=Math.floor(n/i)*i-i;const a=Math.ceil(r/i)*i;const s=n>0&&o<=0?n:o;const l=r<0&&a>=0?r:a;return e<=t?[s,l]:[l,s]}function eO(e,t,n){e.domain([t.min,t.max]);if(!t.hasExplicitMin||!t.hasExplicitMax){e.nice(n)}let[r=t.min,i=t.max]=e.domain();if(t.hasExplicitMin){r=t.min}if(t.hasExplicitMax){i=t.max}if(!t.includeZeroBaseline){if(!t.hasExplicitMin&&t.dataMin>0&&r<=0){r=t.min}if(!t.hasExplicitMax&&t.dataMax<0&&i>=0){i=t.max}}const o=Y8t(r,i,n);if(t.expandAutoBorderHeadroom&&o>0&&i>r){const a=i-r;if(!t.hasExplicitMin&&r!==0&&(i-t.dataMin)/a>F8t){r-=o}if(!t.hasExplicitMax&&i!==0&&(t.dataMax-r)/a>F8t){i+=o}}e.domain([r,i]);return e}function P1(e,t){const[n=0,r=0]=e.domain();const i=Math.min(n,r);const o=Math.max(n,r);return Math.max(i,Math.min(o,t))}function y9(e,t){const[n=0,r=0]=t.domain();const i=Math.min(n,r);const o=Math.max(n,r);switch(e?.crosses){case void 0:case 0:case 1:return P1(t,0);case 2:return i;case 3:return o;case 4:return e.crossValue!==void 0&&Number.isFinite(e.crossValue)?P1(t,e.crossValue):i;default:return P1(t,0)}}function tO(e,t,n){const r=G8t(e?.majorUnit)??vk(t);const i=m9(e?.min);if(r===void 0){if(i!==void 0){const[o=0,a=0]=t.domain();const s=Y8t(o,a,n);if(s>0){return Z9e({domain:t.domain(),unit:s,explicitStart:i})}}return t.ticks(n)}return Z9e({domain:t.domain(),unit:r,explicitStart:i})}function O8t(e,t,n){const r=G8t(e?.minorUnit);if(r===void 0){return U5r(n)}const i=new Set(n.map(o=>N8t(o)));return Z9e({domain:t.domain(),unit:r,explicitStart:m9(e?.min)}).filter(o=>!i.has(N8t(o)))}function B8t(e,t){if(e.yAxis?.deleted!==true||t<=0){return false}return $8t(e)}function z8t(e,t){if(e.yAxis?.deleted!==true||t<=0){return false}if(J9e(e)){return false}return $8t(e)}function J9e(e){return V8t(e).some(V5r)}function U8t(e){return V8t(e).some(H8t)}function V8t(e){return[e.dataLabels?.numberFormatCode,...e.series.map(t=>t.dataLabels?.numberFormatCode)]}function $8t(e){return[e.dataLabels?.numberFormatCode,...e.series.flatMap(t=>[t.dataLabels?.numberFormatCode,t.valuesFormatCode])].some(H8t)}function Z9e(e){const[t=0,n=0]=e.domain;const r=t>n;const i=r?n:t;const o=r?t:n;const a=e.explicitStart!==void 0?e.explicitStart:Math.ceil((i-K9e)/e.unit)*e.unit;const s=[];for(let l=a;l<=o+K9e;l=a+s.length*e.unit){if(l>=i-K9e){s.push(W8t(l))}}return r?s.reverse():s}function U5r(e){if(e.length<=1)return[];const t=[];for(let n=0;n0?e:void 0}function H8t(e){return e?.includes("%")??false}function V5r(e){return e?.includes('"%"')??false}function W8t(e){return Number(e.toPrecision(14))}function N8t(e){return W8t(e).toString()}function Y8t(e,t,n){const r=wc().domain([e,t]).ticks(n);for(let o=1;o0){return l}}const i=Math.abs(hk(e,t,n));return Number.isFinite(i)?i:0}$E();var N7t=Ui(_3());var O7t=Date.UTC(1899,11,30);var B7t=24*60*60*1e3;function w9(e){return e?.kind===2}function xUe(e,t){const n=t.filter(Number.isFinite);if(n.length===0)return void 0;const r=Math.min(...n);const i=Math.max(...n);const o=U7t(e);const a=e.min??(o?V7t(r,o):r);const s=e.max??(o?$7t(i,o):i);if(a===s)return[a,a+1];return[a,s]}function J5r(e,t){const n=t[0];const r=t[t.length-1];if(n===void 0||r===void 0)return void 0;const i=U7t(e);if(!i)return void 0;const o=Math.min(n,r);const a=Math.max(n,r);const s=$7t(o,i);const l=[];for(let u=s;u<=a;u=G7t(u,i)){l.push(Number(u.toPrecision(15)))}if(r({category:o,value:Number(o)})).filter(({value:o})=>Number.isFinite(o));if(i.length===0)return void 0;return r.map(o=>{const a=Number(o);let s=i[0];for(const l of i.slice(1)){if(s&&Math.abs(l.value-a)>=Math.abs(s.value-a)){continue}s=l}if(!s)throw new Error("Expected a date-axis category");return{positionCategory:s.category,serial:a,label:SK(o,e)}})}function SK(e,t){if(!w9(t))return e;const n=Number(e);if(!Number.isFinite(n)||!t?.numberFormatCode)return e;try{return N7t.default.format(t.numberFormatCode,n)}catch{return e}}function U7t(e){const t=e.majorUnit;const n=e.majorTimeUnit??e.baseTimeUnit;if(t===void 0||!Number.isFinite(t)||t<=0||n===void 0||n===0||n===-1){return void 0}if(n!==1&&!Number.isInteger(t)){return void 0}return{count:t,unit:n}}function V7t(e,t){if(t.unit===1){return Math.floor(e/t.count)*t.count}const n=H7t(e);if(t.unit===2){const i=n.getUTCFullYear()*12+n.getUTCMonth();const o=Math.floor(i/t.count)*t.count;return U0e(new Date(Date.UTC(Math.floor(o/12),o%12,1)))}const r=Math.floor(n.getUTCFullYear()/t.count)*t.count;return U0e(new Date(Date.UTC(r,0,1)))}function $7t(e,t){const n=V7t(e,t);return n>=e?n:G7t(n,t)}function G7t(e,t){if(t.unit===1){return e+t.count}const n=H7t(e);if(t.unit===2){return U0e(new Date(Date.UTC(n.getUTCFullYear(),n.getUTCMonth()+t.count,1)))}return U0e(new Date(Date.UTC(n.getUTCFullYear()+t.count,0,1)))}function H7t(e){return new Date(O7t+e*B7t)}function U0e(e){return(e.getTime()-O7t)/B7t}function W7t(e){return(e??[]).reduce((t,n)=>Number.isFinite(n)?Math.max(t,Math.trunc(n)):t,-1)}function Q5r(e){return Math.max(e.categoryPointCount??0,e.valuePointCount??0,W7t(e.categoryIndices)+1,W7t(e.valueIndices)+1,e.categories?.length??0,e.values?.length??0)}function eBr(e){const t=new Set(e.filter(r=>r!==void 0));let n=" ";return e.map(r=>{if(r!==void 0)return r;while(t.has(n)){n+=" "}const i=n;t.add(i);n+=" ";return i})}function dO(e){if(w9(e.xAxis)){return Nh(e)}const t=e.categories??[];const n=e.series??[];const r=n[0];const i=t.length>0?t:r?.categories??[];const o=Math.max(i.length,...n.map(Q5r));if(o===0){return[]}const a=Array.from({length:o});let s=[];if(t.length===0&&r){if(r.categoryIndices?.length===i.length){s=r.categoryIndices}else if(r.valueIndices?.length===i.length){s=r.valueIndices}}i.forEach((l,u)=>{const d=s[u]??u;if(d>=0&&d[i,r]))}return new Map(t.map((r,i)=>[r,n[i]??0]))}function E9(e,t){const n=dO(e);const r=e.series.map((f,h)=>h).filter(f=>!t?.has(f));const i=e.barOptions?.grouping;const o=i===2?"stacked":i===3?"percent":"clustered";const a=n.map(()=>[]);if(o==="clustered"||r.length===0){const f=e.series.map(Y7t);n.forEach((h,m)=>{r.forEach(g=>{const x=e.series[g];if(!x)return;let w=f[g]?.get(m);let _=true;if(w===void 0||!Number.isFinite(w)){w=0;_=false}a[m]?.push({seriesIndex:g,hasValue:_,valueRaw:w,start:0,end:w})})});return{categories:n,visibleSeries:r,mode:o,segmentsByCategory:a}}const s=e.series.map(Y7t);const l=n.map((f,h)=>{const m={};r.forEach(g=>{const x=e.series[g];m[String(g)]=x&&s[g]?s[g]?.get(h)??0:0});return m});const u=lO().keys(r.map(f=>String(f))).value((f,h)=>f[h]??0).order(VE);if(o==="percent"){u.offset(cO)}else{u.offset(uO)}const d=u(l);d.forEach(f=>{const h=f.key;const m=Number.parseInt(h,10);n.forEach((g,x)=>{const w=f[x];if(!w)return;const _=Number.isFinite(w[0])?w[0]:0;const C=Number.isFinite(w[1])?w[1]:0;let A=s[m]?.get(x);let P=true;if(A===void 0||!Number.isFinite(A)){A=0;P=false}a[x]?.push({seriesIndex:m,hasValue:P,valueRaw:A,start:_,end:C})})});return{categories:n,visibleSeries:r,mode:o,segmentsByCategory:a}}function V0e(e){return e.xAxis?.orientation===2}var vUe=5;var tBr=4;function AK(e){const t=e.type===4&&e.barOptions?.direction!==2;if(!t){return vUe}return e.yAxis?.deleted===true&&e.yAxis.majorGridlines!==void 0?tBr:vUe}function O3(e,t,n,r){const i=e.type===4||e.type===3;const o=i?dO(e):r.resolveCategories();let a=0;let s=0;for(const U of r.series.items){for(const W of U.trendlines.items){const H=W.forecastBackward!==void 0&&Number.isFinite(W.forecastBackward)?Math.max(0,Math.floor(W.forecastBackward)):0;const $=W.forecastForward!==void 0&&Number.isFinite(W.forecastForward)?Math.max(0,Math.floor(W.forecastForward)):0;a=Math.max(a,H);s=Math.max(s,$)}}const l=a>0||s>0?nBr(o,a,s):o;const u=V0e(e)?[...l].reverse():l;let d;let f;if(e.type===27){const U=T0e(e);d=U.extents.min;f=U.extents.max}else{const U=h9(r);d=U.min;f=U.max}const h=e.type===4&&e.barOptions?.direction!==2;const m=h&&z8t(e,d);const g=!m&&(e.type!==31||f>=0);const x=g9({axis:e.yAxis,dataMin:d,dataMax:f,includeZeroBaseline:g,expandAutoBorderHeadroom:h&&e.barOptions?.grouping!==3&&!m});const w=C0e({gapWidth:e.barOptions?.gapWidth,grouping:e.barOptions?.grouping,seriesCount:E0e(e.series.length,n),overlap:e.barOptions?.overlap});const _=e.type===13||e.type===12;const C=e.type===2||e.type===1;const A=_||C?w9e().domain(u).range([t.x,t.x+t.width]).padding(_?.5:0):Gb().domain(u).range([t.x,t.x+t.width]).paddingInner(w).paddingOuter(S0e(w));const P=h&&!m?AK(e):vUe;const L=d>0&&d=5/6;const I=f<0&&d=5/6;const N=h&&e.barOptions?.grouping===2&&e.yAxis?.deleted===true&&e.yAxis.majorGridlines===void 0&&!m;const O=e.yAxis?.logBase!==void 0||(e.chartGroups?.length??0)>0||N||e.yAxis?.deleted!==true&&(L||I);const z=O?cK({automaticMin:d,automaticMax:f,automaticPositiveMin:QN(e.series.flatMap(U=>U.values)),range:[t.y+t.height,t.y],axis:e.yAxis,expandWideValuesToZero:!(e.type===31&&f<0)}):eO(wc().range([t.y+t.height,t.y]),x,P);return{x:A,y:z}}function nBr(e,t,n){if(e.length===0)return e;if(t<=0&&n<=0)return e;const r=new Set(e);const i=s=>{let l=s;while(r.has(l)){l=`${l}_`}r.add(l);return l};const o=t>0?Array.from({length:t},(s,l)=>i(`__trendpad_before_${l+1}__`)):[];const a=n>0?Array.from({length:n},(s,l)=>i(`__trendpad_after_${l+1}__`)):[];return[...o,...e,...a]}function _k(e){return typeof e.bandwidth==="function"}function Yb(e,t){if(t===void 0)return void 0;if(_k(e)){const n=e(t);return n!==void 0?n+e.bandwidth()/2:void 0}return e(t)}function fO(e){return e===16||e===15||e===8}function n_(e,t,n){if(e.measureText(t).width<=n)return t;const r="\u2026";let i=0,o=t.length;while(i360){const r=n/6e4;if(Number.isFinite(r)&&Math.abs(r)<=360){n=r}else if(Number.isFinite(n)){n=n%360}}if(!Number.isFinite(n)){return 0}if(Math.abs(n)>=360){n=n%360}if(Math.abs(n)<.001){return 0}return n}function rd(e,t,n,r={}){const i=t?.fill?.color!==void 0?oo(t.fill.color,n,r.color):r.color;const o=t?.widthEmu;const a=o!==void 0&&o!==null&&Number.isFinite(Number(o))?Math.max(0,Number(o)*ti):r.widthPx;if(i){e.strokeStyle=i}if(a!==void 0){e.lineWidth=a}const s=t?.style;switch(s){case 2:e.setLineDash([4,3]);break;case 3:e.setLineDash([1,2]);break;case 4:e.setLineDash([4,2,1,2]);break;case 5:e.setLineDash([4,2,1,2,1,2]);break;case 1:case 0:default:e.setLineDash([]);break}return{color:i,widthPx:a}}var rBr=72;var iBr=96;function B3(e){if(!e||typeof e!=="object")return{};const t=e;const n=t["tickLabelInterval"];const r=typeof n==="number"&&Number.isFinite(n)?n:void 0;const i=t["tickMarkInterval"];const o=typeof i==="number"&&Number.isFinite(i)?i:void 0;const a=t["tickLabelDistanceFromAxis"];const s=typeof a==="number"&&Number.isFinite(a)?a:void 0;const l=t["tickLabelPositionName"];const u=typeof l==="string"?l:void 0;return{tickLabelInterval:r,tickMarkInterval:o,tickLabelDistanceFromAxis:s,tickLabelPositionName:u}}function XT(e){const t=B3(e);return t.tickLabelDistanceFromAxis!==void 0?t.tickLabelDistanceFromAxis*iBr/rBr:0}function Qc(e){if(e&&typeof e==="object"){const n=e;if(n["tickLabelPosition"]===4){return true}}const t=B3(e);return t.tickLabelPositionName?.toLowerCase()==="none"}function C9(e,t,n){if(!isFinite(n)||n===0)return{width:e,height:t};const r=Math.cos(n);const i=Math.sin(n);const o=Math.abs(e*r)+Math.abs(t*i);const a=Math.abs(e*i)+Math.abs(t*r);return{width:o,height:a}}function Tm(e,t,n,r,i){const o=t?.trim();if(!o)return void 0;const a={...n};if(a.fontSize===void 0||!Number.isFinite(a.fontSize)||a.fontSize<=0){a.fontSize=Math.round(r*75)}const s={type:1,paragraphs:[{runs:[{text:o,citations:[],reviewMarkIds:[]}],inlineNodes:[]}],textStyle:a,effects:[],children:[],citations:[],levelsStyles:[],id:"axis-title"};const l=_p(s,e,{wrap:false});if(l===void 0){return void 0}const u=l.lines[0];if(u===void 0){return void 0}const d=u.segments[0];if(d===void 0){return void 0}const f=l.lines.map(C=>C.segments.map(A=>A.text).join(""));const h=u.heightPx;const m=l.lines.reduce((C,A)=>Math.max(C,A.widthPx),0);const g=l.lines.reduce((C,A)=>C+A.heightPx,0);const x=n?.rotation??i;const w=x*Math.PI/180;const _=C9(m,g,w);return{text:o,lines:f,lineHeight:h,contentWidth:m,contentHeight:g,rotationRad:w,width:_.width,height:_.height,font:d.font}}function q7t(e){const{ctx:t,text:n,anchorX:r,anchorY:i,rotationDeg:o,fontSizePx:a,side:s}=e;const l=t.measureText(n).width;if(!(l>0)||!(a>0))return;const u=oBr({widthPx:l,heightPx:a,rotationDeg:o,side:s});t.save();t.translate(r,i);t.rotate(o*Math.PI/180);t.textAlign="left";t.textBaseline="top";t.fillText(n,u.leftPx,u.topPx);t.restore()}function oBr(e){const{widthPx:t,heightPx:n,rotationDeg:r}=e;const i=r<0?-t:0;const o=-n/2;return{leftPx:i,topPx:o,widthPx:t,heightPx:n}}uk();var X7t=Ui(_3());var aBr=/^\$?(?:#,##)?0(?:\.0+)?M$/i;function M1(e,t){const n=e?.numberFormatCode;if(e?.numberFormatSourceLinked===false){return n}if(n!==void 0&&n!=="General"){return n}for(const r of t){const i=r.valuesFormatCode;if(i!==void 0&&i!=="General"){return i}}return n}function uh(e,t){if(!Number.isFinite(e))return"";if(t){try{const n=aBr.test(t.trim())?"General":t;return X7t.default.format(n,e)}catch{}}return Oh("~s")(e)}var sBr=6;var lBr=4;function r_(e){const{ctx:t,axis:n,scale:r,preferredTickCount:i,themeMap:o}=e;const a=wl(n,o);t.font=Cc(a);const s=Qc(n);const l=Math.max(1,Math.floor(i||1));if(s){const d=H0e(r,n,l);return{ticks:d,minorTicks:j7t(r,n,d),labelBandWidth:0,hideTickLabels:true,preferredTickCount:l,chosenTickCount:l,minTickSeparationPx:K7t(r,d)}}let u;for(let d=l;d>=1;d-=1){const f=cBr({ctx:t,axis:n,scale:r,fontSizePx:a.fontSize,preferredTickCount:l,tickCount:d});if(f.fits){return f}if(!u||f.overflowPx0?d+sBr:0,hideTickLabels:false,preferredTickCount:o,chosenTickCount:a,minTickSeparationPx:l,fits:s.length<=1||f<=0,overflowPx:f}}function H0e(e,t,n){return t?.logBase!==void 0?uBr(e,t.logBase):tO(t,e,n)}function j7t(e,t,n){return t?.logBase!==void 0?dBr(e,t.logBase):O8t(t,e,n)}function uBr(e,t){const[n,r]=e.domain();if(n===void 0||r===void 0){throw new Error("Expected a two-value logarithmic chart scale domain")}const i=Math.min(n,r);const o=Math.max(n,r);const a=Math.log(t);const s=Math.ceil(Math.log(i)/a-1e-12);const l=Math.floor(Math.log(o)/a+1e-12);const u=Array.from({length:Math.max(0,l-s+1)},(d,f)=>Number((t**(s+f)).toPrecision(15)));return r>=n?u:u.reverse()}function dBr(e,t){if(!Number.isInteger(t))return[];const[n,r]=e.domain();if(n===void 0||r===void 0){throw new Error("Expected a two-value logarithmic chart scale domain")}const i=Math.min(n,r);const o=Math.max(n,r);const a=Math.log(t);const s=Math.floor(Math.log(i)/a);const l=Math.ceil(Math.log(o)/a);const u=[];for(let d=s;d<=l;d+=1){const f=t**d;for(let h=2;ho)continue;u.push(m)}}u.sort((d,f)=>d-f);return r>=n?u:u.reverse()}function K7t(e,t){if(t.length<=1)return Number.POSITIVE_INFINITY;let n=Number.POSITIVE_INFINITY;for(let r=1;r{t.fillText(w,m,g+_*r.lineHeight)});t.restore()}var fBr=6;var Q7t=8;var hBr=.5;function _Ue(e,t){return Math.abs(e-t)<=hBr}function pBr(e,t,n,r,i){const o=e.measureText(t).width;if(!Number.isFinite(o)||o<=0||i<=r){return n}const a=Math.min(o/2,(i-r)/2);return Math.min(Math.max(n,r+a),i-a)}function W0e(e,t,n,r,i,o,a="all",s=r){const{x:l,y:u}=n;const d=Nh(t);const f=o?.tickCategories??d;const h=o?.tickLabels??f.map(ue=>SK(ue,t.xAxis));const m=a!=="foreground";const g=a!=="background";const x=a!=="foreground";e.save();e.font=`${Bh}px ${td}`;e.fillStyle=nd;e.strokeStyle=nd;e.lineWidth=1;const w=wl(t.xAxis,i);let _=u(y9(t.xAxis,u));if(!Number.isFinite(_)){_=r.y+r.height}const C=r.y+r.height;const A=r.y;const P=Math.abs(_-C)<=Math.abs(_-A);let L=P;if(t.xAxis?.position===4){L=true}else if(t.xAxis?.position===3){L=false}const I=L?1:-1;let N=_;let O=L;if(t.xAxis?.tickLabelPosition===2){N=u(Math.min(...u.domain()));O=Math.abs(N-C)<=Math.abs(N-A)}else if(t.xAxis?.tickLabelPosition===1){N=u(Math.max(...u.domain()));O=Math.abs(N-C)<=Math.abs(N-A)}const z=O?1:-1;const U=4;const W=B3(t.xAxis);const H=t.xAxis;const $=!!H?.deleted;let K=0;if(!$){const ue=GE(H);if(m&&ue&&H?.line?.fill?.color){e.strokeStyle=w.lineColor;e.beginPath();e.moveTo(r.x,_);e.lineTo(r.x+r.width,_);e.stroke()}e.strokeStyle=w.lineColor;e.lineWidth=1;e.font=Cc(w);const xe=$0e(e,w.fontSize);const be=o?.labelLineHeightPx??(Number.isFinite(xe)?xe:Bh);const Ie=o?.tickLabelDistancePx??XT(t.xAxis);const he=U+2+Ie;const ve=o?.rotationDeg??G0e(t.xAxis);const ge=ve*Math.PI/180;if(o){K=o.labelBandHeight}else{let it=0;h.forEach(He=>{const Je=He??"";const Te=e.measureText(Je).width;if(Te>it)it=Te});const bt=C9(it,w.fontSize,ge);K=it>0?bt.height+fBr+Ie:0}e.textAlign="center";e.textBaseline=O?"top":"bottom";e.fillStyle=w.textColor;const Ve=o?.hideTickLabels??Qc(t.xAxis);const Le=ue&&H?.majorTickMark!==void 0&&H.majorTickMark!==0&&H.majorTickMark!==1;const $e=Boolean(H?.majorGridlines?.fill?.color);const Ee=H?.majorGridlines;const tt=W.tickLabelInterval;const yt=o?.step??(tt!==void 0&&tt>0?Math.floor(tt):1);const mt=W.tickMarkInterval;const ct=mt!==void 0&&mt>0?Math.floor(mt):yt;const Ge=o?new Set(o.visibleIndices):void 0;f.forEach((it,bt)=>{const He=o?.tickPositionsPx?.[bt]??Yb(l,it);if(He===void 0)return;const Je=Ge!==void 0?Ge.has(bt):yt<=1||bt%yt===0;const Te=ct<=1||bt%ct===0;if(m&&Te&&$e&&Ee){e.save();rd(e,Ee,i,{color:w.gridLineColor??w.lineColor,widthPx:1});if(!_Ue(He,r.x)){e.beginPath();e.moveTo(He,r.y);e.lineTo(He,r.y+r.height);e.stroke()}e.restore()}if(m&&Te&&Le){e.beginPath();e.moveTo(He,_);e.lineTo(He,_+I*U);e.stroke()}const we=o?.labelMaxWidthPx??(_k(l)?l.step():r.width/Math.max(1,f.length));const Ze=n_(e,h[bt]??it,we);const Be=o?.labelLinesByIndex[bt]??[Ze];if(!g||Ve||!Je){return}if(ge!==0){q7t({ctx:e,text:Ze,anchorX:He,anchorY:N+z*he,rotationDeg:ve,fontSizePx:w.fontSize,side:O?"bottom":"top"})}else{const qe=N+z*he;Be.forEach((Qe,ze)=>{const Me=pBr(e,Qe,He,r.x,r.x+r.width);const ye=O?qe+ze*be:qe-(Be.length-1-ze)*be;e.fillText(Qe,Me,ye)})}})}const X=wl(t.yAxis,i);const j=t.yAxis;const te=!!j?.deleted;let J=0;const oe=Boolean(j?.majorGridlines?.fill?.color);const se=Boolean(j?.minorGridlines?.fill?.color);if(x&&(!te||oe||se)){const ue=!te&&GE(j);if(ue&&j?.line?.fill?.color){e.strokeStyle=X.lineColor;e.beginPath();e.moveTo(r.x,r.y);e.lineTo(r.x,r.y+r.height);e.stroke()}e.textAlign="right";e.textBaseline="middle";e.fillStyle=X.textColor;const xe=r_({ctx:e,axis:j,scale:u,preferredTickCount:AK(t),themeMap:i});if(!te){J=xe.labelBandWidth}const be=ue&&!te&&j?.majorTickMark!==void 0&&j.majorTickMark!==0&&j.majorTickMark!==1;const Ie=xe.ticks;const he=se?xe.minorTicks:[];if(se&&j?.minorGridlines){e.save();rd(e,j.minorGridlines,i,{color:X.gridLineColor??X.lineColor,widthPx:.75});he.forEach(ve=>{const ge=u(ve);if(!Number.isFinite(ge))return;if(_Ue(ge,_))return;e.beginPath();e.moveTo(r.x,ge);e.lineTo(r.x+r.width,ge);e.stroke()});e.restore()}Ie.forEach(ve=>{const ge=u(ve);if(oe&&j?.majorGridlines){e.save();rd(e,j.majorGridlines,i,{color:X.gridLineColor??X.lineColor,widthPx:1});if(!_Ue(ge,_)){e.beginPath();e.moveTo(r.x,ge);e.lineTo(r.x+r.width,ge);e.stroke()}e.restore()}if(be){e.strokeStyle=X.lineColor;e.beginPath();e.moveTo(r.x-4,ge);e.lineTo(r.x,ge);e.stroke()}if(!te&&!xe.hideTickLabels){e.font=Cc(X);const Ve=uh(ve,t.yAxis?.numberFormatCode);e.fillText(Ve,r.x-6,ge)}})}const re=Tm(i,H?.title,H?.titleTextStyle,w.fontSize,0);const ce=Tm(i,j?.title,j?.titleTextStyle,X.fontSize,-90);if(g&&re){const ue=K+Q7t+re.height/2;const xe=N+z*ue;z3({ctx:e,axis:H,metrics:re,automaticCenter:{x:r.x+r.width/2,y:xe},chartArea:s,themeMap:i,fallbackColor:w.textColor})}if(x&&ce){let ue=Q7t;if(te){ue=0}const xe=r.x-J-ue-ce.width/2;const be=r.y+r.height/2;z3({ctx:e,axis:j,metrics:ce,automaticCenter:{x:xe,y:be},chartArea:s,themeMap:i,fallbackColor:X.textColor})}e.restore()}var ezt={colorSpace:"drawingml-crgb"};function jT(e,t,n){return oo(e,t,{...ezt,defaultFill:n})}function A9(e,t,n,r,i="transparent"){return Uc(e,t,n,r,{...ezt,defaultFill:i})}var TUe=["accent1","accent2","accent3","accent4","accent5","accent6"];function mBr(e){if(e===void 0||!Number.isFinite(e)){return void 0}const t=Math.trunc(e);if(t>=101&&t<=148){return t-100}return t>=1&&t<=48?t:void 0}function gBr(e,t){const n=mBr(t);if(n!==void 0){const r=(n-1)%8+1;if(r>=3){return TUe[r-3]??"accent1"}}return TUe[e%TUe.length]??"accent1"}function id(e,t,n,r={}){if(e.fill?.color){return jT(e.fill.color,n)}const i=e.stroke?.fill?.color?jT(e.stroke.fill.color,n):void 0;if(i){return i}const o=gBr(t,r.chartStyleIndex);const a=n.colorMap[o];if(a){return a}return I0[t%I0.length]}zh();VT();R1();var yBr="mapbox://mapbox.country-boundaries-v1";var tzt="country_boundaries";function bBr(e){if(!e)return"map";return e.replace(/[^a-zA-Z0-9_-]/g,"_")||"map"}function wUe(e){const t=e?Kd(e):null;if(!t){return{start:"#c1e4ff",end:"#0f5aad",fallback:"#d6dbe1"}}const n=t.brighter(1.8).formatHex();const r=t.darker(.6).formatHex();return{start:n,end:r,fallback:"#d6dbe1"}}function rzt(e,t,n,r,i={}){const o=e.map;if(!t.series.length)return;const a=0;if(i.hiddenSeriesIndices?.has(a)||t.series[a]==null){e.clear();return}const s=t.series[a];const l=s.categories&&s.categories.length>0?s.categories:t.categories;const u=s.values??[];if(!l||l.length===0||u.length===0){e.clear();return}const d=new Map;l.forEach(($,K)=>{const X=u[K];const j=xBr($);if(j&&typeof X==="number"&&Number.isFinite(X)){d.set(j,X)}});if(d.size===0){e.clear();return}const f=Array.from(d.values());const[h,m]=Cy(f);const g=id(s,a,r);const x=wUe(g);const w=h??0;const _=m??w;const C=_===w?1:0;const A=wc().domain([w,_+C]).range([x.start,x.end]);const P=new Map;const L=new Map;d.forEach(($,K)=>{P.set(K,A($));L.set(K,.9)});const I=nzt(P,x.fallback);const N=nzt(L,.55);const O=bBr(i.elementId??t.id??"chart");const z=`granola-map-source-${O}`;const U=`granola-map-fill-${O}`;const W=`granola-map-outline-${O}`;const H=()=>{if(!o.getSource(z)){o.addSource(z,{type:"vector",url:yBr});e.trackSource(z)}if(!o.getLayer(U)){o.addLayer({id:U,type:"fill",source:z,"source-layer":tzt,paint:{"fill-color":I,"fill-opacity":N}});e.trackLayer(U)}else{o.setPaintProperty(U,"fill-color",I);o.setPaintProperty(U,"fill-opacity",N)}if(!o.getLayer(W)){o.addLayer({id:W,type:"line",source:z,"source-layer":tzt,paint:{"line-color":"#ffffff","line-width":.5,"line-opacity":.6}});e.trackLayer(W)}const $=.2;const K=[0,15];const X=o.getZoom();const j=o.getCenter();if(Math.abs(X-$)>.01||Math.abs(j.lng-K[0])>.5||Math.abs(j.lat-K[1])>.5){o.jumpTo({center:K,zoom:$,bearing:0,pitch:0})}};if(o.isStyleLoaded()){H()}else{const $=()=>{o.off("styledata",$);o.off("load",$);H()};o.on("styledata",$);o.on("load",$)}}function xBr(e){if(typeof e!=="string"){return null}const t=e.trim();if(!t){return null}return t.toUpperCase()}function nzt(e,t){const n=["case"];e.forEach((r,i)=>{n.push(vBr(i),r)});n.push(t);return n}function vBr(e){return["any",["==",["upcase",["coalesce",["get","name_en"],""]],e],["==",["upcase",["coalesce",["get","name"],""]],e],["==",["upcase",["coalesce",["get","iso_3166_1_alpha_2"],""]],e],["==",["upcase",["coalesce",["get","iso_3166_1_alpha_3"],""]],e]]}function Y0e(e,t){if(!e.points||e.points.length===0)return void 0;for(let n=0;ntypeof g.value==="number"&&g.value>0?g.value:0).sort((g,x)=>(x.value??0)-(g.value??0));const s=Math.max(0,t.width);const l=Math.max(0,t.height);const u=LK().tile(MK).size([s,l]).paddingInner(1).paddingOuter(0).round(true);const d=u(a);const f=Vzt(n,r);const h=d.leaves().filter(g=>(g.value??0)>0).map(g=>{const x=t.x+g.x0;const w=t.y+g.y0;const _=Math.max(0,g.x1-g.x0);const C=Math.max(0,g.y1-g.y0);const A=g.data.path;const P=g.parent?.data.path??[];const L=P.length>0?P[P.length-1]:void 0;const I=A.length>0?A[0]:void 0;const N=I&&I.length>0?I:g.data.name;return{x,y:w,width:_,height:C,value:g.value??0,name:g.data.name,path:A,depth:g.depth,parentName:L,topParentName:I,fill:f(N)}});const m=d.descendants().filter(g=>g.depth>0&&g.children&&g.children.length>0).map(g=>({name:g.data.name,path:g.data.path,depth:g.depth,x:t.x+g.x0,y:t.y+g.y0,width:Math.max(0,g.x1-g.x0),height:Math.max(0,g.y1-g.y0)})).sort((g,x)=>g.depth-x.depth);return{leaves:h,parents:m}}function zzt(e){const t=new Map;for(const n of e.series){const r=n.values??[];const i=IBr(n.categoryPaths,r.length);const o=xm(n,e.categories);for(let a=0;a0){u=[m]}}if(!u||u.length===0)continue;const d=[...u].reverse();const f=d.join(PBr);const h=t.get(f);if(h){h.value+=s}else{t.set(f,{path:d,value:s})}}}return Array.from(t.values())}function IBr(e,t){if(!e||e.length===0){return new Array(t).fill(void 0)}if(e.length>=t)return e;const n=e.slice();while(n.length{let a=r.children.get(i);if(!a){a={name:i,path:r.path.concat(i),children:new Map};r.children.set(i,a)}r=a;if(o===n.path.length-1){r.value=(r.value??0)+n.value}})}return t}function Uzt(e){const t=Array.from(e.children.values()).map(Uzt);if(t.length===0){return{name:e.name,path:e.path,value:e.value??0}}return{name:e.name,path:e.path,children:t}}function Vzt(e,t){const n=new Set;for(const l of t){const u=l.path[0];if(u&&u.length>0){n.add(u)}}const r=Array.from(n.values());if(r.length===0){return l=>I0[0]??"#999999"}const i=["accent1","accent2","accent3","accent4","accent5","accent6"];const o=l=>{const u=i[l%i.length];const d=e.colorMap[u??""];if(d)return d;return I0[l%I0.length]??I0[0]??"#999999"};const a=r.map((l,u)=>o(u));const s=mg().domain(r).range(a);return l=>{if(!l){return I0[0]??"#999999"}if(s.domain().includes(l)){return s(l)}const u=s.domain().length;return o(u)}}function $zt(e,t){const n=zzt(e);if(n.length===0)return[];const r=Vzt(t,n);const i=new Set;for(const o of n){const a=o.path[0];if(!a||i.has(a))continue;i.add(a)}return Array.from(i.values()).map(o=>({key:o,label:o,color:r(o)}))}uk();var Gzt=Ui(_3());function qb(e,t){if(t){try{return Gzt.default.format(t,e)}catch{}}return Oh("~s")(e)}zh();function K0e(e){const t=e.marker?.symbol;return t!==void 0&&t!==1&&t!==0&&t!==-1}function Z0e(e,t,n,r,i,o){const a=t.marker?.size;const s=a!==void 0&&Number.isFinite(a)?a*96/72:6;const l=Math.min(o??Number.POSITIVE_INFINITY,Math.max(s,3));const u=l/2;const d={x:r.x-u,y:r.y-u,width:l,height:l};const f=t.marker?.fill;const h=f?A9(e,d,f,n,"transparent"):i;const m=t.marker?.stroke;const g=m?.fill?.color?jT(m.fill.color,n):void 0;const x=m?.widthEmu!==void 0?m.widthEmu*ti:void 0;e.save();e.setLineDash([]);e.beginPath();e.arc(r.x,r.y,u,0,Math.PI*2);if(h!=="transparent"){e.fillStyle=h;e.fill()}if(g&&x!==0){e.strokeStyle=g;e.lineWidth=x??1;e.stroke()}e.restore()}var LBr=2;var DBr="#fff";var FBr=1;function DK(e,t,n){const r=PK(e,n);let i=r.color;if(i===void 0){i=id(e,t,n)}if(i===void 0){throw new Error("Expected a rendered line-series color")}let o=r.widthPx;if(o===void 0){o=LBr}let a=o>0;if(r.visible===false){a=false}return{color:i,widthPx:o,visible:a}}function J0e(e,t,n){const r=Uh(e,t,n);let i=r.color;if(i===void 0){i=DBr}let o=r.widthPx;if(o===void 0){o=FBr}let a=o>0;if(r.visible===false){a=false}return{color:i,widthPx:o,visible:a}}function NBr(e,t){const n=e.legend?.textStyle?.fill?.color;if(n){return oo(n,t)}return nd}var OBr=[{label:"Increase",slot:"accent1",fallback:"#5b9bd5"},{label:"Decrease",slot:"accent2",fallback:"#ed7d31"},{label:"Total",slot:"accent3",fallback:"#a5a5a5"}];function BBr(e){return OBr.map(t=>({label:t.label,seriesIndex:0,chartType:27,fillColor:e.colorMap?.[t.slot]??t.fallback}))}var tbe=120;var Xb=12;var FK=4;var gO=12;var ebe=12;var yO=8;var zBr=new Set([16,15,8]);var Sy=8;var UBr=8;var VBr=6;var P9=16;var nbe=i0e;var RUe=8;var $Br=24;var GBr=2;var HBr=1;function Hzt(e,t,n,r){e.save();e.globalAlpha=r.opacity;if(r.lineVisible){rd(e,t.stroke,n,{color:r.color,widthPx:r.lineWidth});e.beginPath();e.moveTo(r.x,r.y);e.lineTo(r.x+r.width,r.y);e.stroke()}if(!r.markerVisible){e.restore();return}Z0e(e,t,n,{x:r.x+r.width/2,y:r.y},r.color,nbe);e.restore()}function WBr(e){return zBr.has(e.type)}function YBr(e){const t=e.barOptions?.direction??e.barDirection;const n=e.barOptions?.grouping;return e.type===4&&t===2&&n!==2&&n!==3&&e.xAxis?.orientation===1}function Yzt(e){return e===13||e===12}function NK(e){if(e.hasVisibleSymbol===false){return{width:0,height:0}}return Yzt(e.chartType)||e.chartType===18?{width:$Br,height:GBr}:{width:i0e,height:i0e}}function OK(e){if(e.hasVisibleSymbol===false){return 0}return VBr}function qBr(e,t){const n=e.series.map(()=>({type:e.type,scatterStyle:e.scatterOptions?.style}));if(e.type!==31)return n;for(const r of t.comboRenderGroups){for(let i=0;i!t.has(r))}function qzt(e){if(e===5){return 1}return e??1}function BK(e){return e===3||e===4}function Xzt(e){if(e===4){return{top:Sy,bottom:UBr}}return{top:Sy,bottom:Sy}}function jzt(e){const t=e.legend?.manualLayout;return t?.w!==void 0&&Number.isFinite(t.w)&&t.w>0&&t.h!==void 0&&Number.isFinite(t.h)&&t.h>0}function XBr(e,t){const n=new Tp(e);const r=new Set(n.legend.deletedEntryIndices);if(WBr(e)){const a=e.series[0];if(!a)return[];const s=e.series.indexOf(a);const l=xm(a,e.categories);const u=a.values?.length??0;const d=Math.max(u,l.length);if(d===0)return[];const f=a.name||"Slice";const h=[];for(let m=0;m({label:s.label,seriesIndex:0,chartType:29,fillColor:s.color})),r)}if(e.type===27){return Q0e(BBr(t),r)}const i=qBr(e,n);const o=Q0e(e.series.map((a,s)=>{const l=i[s];const u=l?.type??e.type;const d={label:a.name||`Series ${s+1}`,seriesIndex:s,chartType:u};if(u===18){const f=DK(a,s,t);const h=f.visible;let m=a.marker?.symbol!==1;if(l?.scatterStyle!==void 0&&l.scatterStyle!==3&&l.scatterStyle!==1&&l.scatterStyle!==5){m=false}d.scatterLineVisible=h;d.scatterMarkerVisible=m;d.hasVisibleSymbol=h||m}return d}),r);return YBr(e)?o.reverse():o}function Kzt(e,t){if(!e.series.length)return null;const n=e.series[0];if(!n)return null;const r=xm(n,e.categories);const i=n.values??[];if(!r||r.length===0||i.length===0){return null}const o=[];r.forEach((g,x)=>{const w=i[x];if(g!=null&&typeof w==="number"&&Number.isFinite(w)){o.push(w)}});if(o.length===0)return null;const[a,s]=Cy(o);const l=a??0;const u=s??l;const d=id(n,0,t);const f=wUe(d);const h=n.valuesFormatCode??void 0;const m=n.name?.trim();return{min:l,max:u,rampStart:f.start,rampEnd:f.end,minLabel:qb(l,h),maxLabel:qb(u,h),seriesName:m&&m.length>0?m:void 0}}function jBr(e,t,n,r){const i=t.legend?.textStyle?.fontSize;const o=i?zc(i):r0e;const a=OE(t.legend?.textStyle);e.font=`${o}px ${a}`;const s=Kzt(t,n);if(!s)return{width:0,height:0};const l=e.measureText(s.minLabel).width;const u=e.measureText(s.maxLabel).width;const d=s.seriesName?e.measureText(s.seriesName).width:0;const f=!!s.seriesName;const h=f?o:0;const m=f?ebe:0;if(BK(r)){const P=tbe;const L=Math.max(P,d);const I=Xb*2+L;const N=Xb*2+h+m+gO+FK+o;return{width:I,height:N}}const g=Math.max(l,u);const x=g>0?FK:0;const w=gO;const _=Math.max(w+x+g,d);const C=Xb*2+_;const A=Xb*2+h+m+tbe;return{width:C,height:A}}function Zzt(e,t,n,r={}){e.save();const i=qzt(r.position??t.legend?.position);if(t.type===23){const{width:_,height:C}=jBr(e,t,n,i);e.restore();return{width:_,height:C,entries:[],labelWidths:[]}}const o=t.legend?.textStyle?.fontSize;const a=o?zc(o):r0e;const s=OE(t.legend?.textStyle);e.font=`${a}px ${s}`;const l=XBr(t,n);const u=BK(i??1);const d=u&&jzt(t);const f=o??Math.round(a*75);const h=l.map(_=>{if(d)return e.measureText(_.label).width;const C={paragraphs:[{runs:[{text:_.label,citations:[],reviewMarkIds:[]}],inlineNodes:[]}],textStyle:{name:s,fontSize:f},effects:[],children:[],levelsStyles:[],id:"legend-label",citations:[],type:1};const A=ed(C,e,n,void 0,{mode:"layout",wrap:false});if(!A)return 0;const P=A.lines.reduce((L,I)=>Math.max(L,I.widthPx),0);return P});const m=l.map((_,C)=>{const A=h[C]??0;return NK(_).width+OK(_)+A});let g;let x;let w;if(u){const _=t.legend?.manualLayout;const C=r.maxWidthPx!==void 0?Math.max(0,r.maxWidthPx-(d?0:Sy*2)):Number.POSITIVE_INFINITY;let A=false;if(_!==void 0){const N=_.w!==void 0&&Number.isFinite(_.w);const O=_.h!==void 0&&Number.isFinite(_.h);A=N||O}w=d?JBr(m,C):KBr(m,C,A);const P=w.reduce((N,O)=>Math.max(N,O.width),0);g=Math.max(0,P+Sy*2);const{top:L,bottom:I}=Xzt(i);x=w.length*nbe+Math.max(0,w.length-1)*RUe+L+I}else{const _=l.length*nbe+Math.max(0,l.length-1)*P9;const C=l.reduce((A,P,L)=>{const I=h[L]??0;return Math.max(A,NK(P).width+OK(P)+I)},0);g=C+Sy*2;x=_+Sy*2}e.restore();return{width:g,height:x,entries:l,labelWidths:h,rows:w}}function Jzt(e,t,n,r={}){const{width:i,height:o,entries:a}=Zzt(e,t,n,r);return{width:i,height:o,entries:a}}function KBr(e,t,n=false){if(e.length===0)return[];const r=[];let i={itemIndices:[],width:0};for(let a=0;a0?P9:0;const u=i.width+l+s;const d=i.itemIndices.length>0&&Number.isFinite(t)&&u>t;if(d){r.push(i);i={itemIndices:[a],width:s};continue}i.itemIndices.push(a);i.width=u}r.push(i);if(!n||r.length<=1)return r;const o=ZBr(e,r.length,t);return o??r}function ZBr(e,t,n){const r=Math.floor(e.length/t);const i=e.length%t;const o=[];let a=0;for(let s=0;sa+h);const d=u.reduce((f,h,m)=>{const g=m>0?P9:0;return f+g+(e[h]??0)},0);if(Number.isFinite(n)&&d>n){return void 0}o.push({itemIndices:u,width:d});a+=l}return o}function JBr(e,t){for(let n=e.length;n>0;n--){const r=Array.from({length:n},()=>0);for(const[a,s]of e.entries()){const l=a%n;r[l]=Math.max(r[l]??0,s)}const i=r.reduce((a,s)=>a+s,0);if(n>1&&i>t)continue;const o=[];for(let a=0;aa+d);const l=s.reduce((u,d)=>u+(e[d]??0),0);o.push({itemIndices:s,width:l})}return o}return[]}function Wzt(e,t,n,r,i){const o=Math.max(0,e-t);const a=r*2+Math.max(0,n-1)*i;const s=n>0?(o-a)/(n+1):0;if(s<0){const l=o/(n+1);return{padding:l,gap:l}}return{padding:r+s,gap:i+s}}function Tk(e,t,n,r,i=3,o){if(t.series.length===0)return;e.save();const a=NBr(t,r);const s=t.legend?.textStyle?.fontSize;const l=s?zc(s):r0e;const u=OE(t.legend?.textStyle);e.font=`${l}px ${u}`;const d=qzt(i);const f=BK(d)?Math.max(0,n.width):void 0;if(t.type===23){QBr(e,t,n,r,d,l,a,o);e.restore();return}const{width:h,height:m,entries:g,labelWidths:x,rows:w}=Zzt(e,t,r,{position:d,maxWidthPx:f});if(g.length===0){e.restore();return}const _=nbe;const C=BK(d);const A=t.legend?.manualLayout;const P=C&&jzt(t);let L=h;let I=m;let N=n.x+yO;let O=n.y+yO;const z=C?Xzt(d):null;const U=z?.top??Sy;if(C){if(P){N=n.x;O=n.y;L=n.width;I=n.height}else{const j=L;const te=Math.max(0,n.width);const J=Math.max(0,(te-j)/2);N=n.x+J;O=n.y}}else if(d===2||d===1){N=n.x+yO;O=Math.max(n.y+yO,n.y+(n.height-I)/2)}const W=Boolean(t.legend?.overlay);const H={x:N,y:O,width:L,height:I};e.beginPath();e.rect(N,O,L,I);if(t.legend?.fill){e.fillStyle=Uc(e,H,t.legend.fill,r,"transparent");e.fill()}else if(W){e.save();e.globalAlpha=.85;e.fillStyle="#ffffff";e.fill();e.restore()}const $=Boolean(t.legend?.stroke?.fill?.color);if($){rd(e,t.legend?.stroke,r,{widthPx:.75});e.stroke()}else if(W){e.save();e.strokeStyle="#d0d0d0";e.lineWidth=.75;e.setLineDash([]);e.stroke();e.restore()}const K=Array.isArray(o?.hiddenSeriesIndices)?new Set(o?.hiddenSeriesIndices):o?.hiddenSeriesIndices;const X=(j,te,J,oe)=>{const se=t.series[j.seriesIndex];if(!se)return;const re=j.label;const ce=x[te]??e.measureText(re).width;const ue=Yzt(j.chartType)||j.chartType===18;const{width:xe,height:be}=NK(j);const Ie=j.pointIndex;let he=j.fillColor;if(he===void 0){if(Ie!==void 0){he=Pd(se,Ie,Ie,r)}else{he=id(se,j.seriesIndex,r)}}let ve;let ge;let Ve=false;let Le=K0e(se);if(ue){const He=DK(se,j.seriesIndex,r);ve=He.color;ge=He.widthPx;Ve=He.visible;if(j.scatterLineVisible!==void 0){Ve=j.scatterLineVisible}if(j.scatterMarkerVisible!==void 0){Le=j.scatterMarkerVisible}}else if(Ie!==void 0){const He=J0e(se,Ie,r);ve=He.color;ge=He.widthPx}else{const He=PK(se,r);ve=He.color;ge=He.widthPx}const $e=oe-be/2;const Ee=xe;const tt=be;const yt=2;let mt=ve;if(mt===void 0){mt=he}let ct=false;if(Ie!==void 0){ct=Zd(se,Ie)}const Ge=K?.has(j.seriesIndex)??false;if(Ge){if(ue&&mt&&ge!==void 0){Hzt(e,se,r,{x:J,y:oe,width:Ee,color:mt,lineWidth:ge,lineVisible:Ve,markerVisible:Le,opacity:.5})}else{const He=J+.5;const Je=$e+.5;const Te=Ee-1;const we=tt-1;const Ze=Math.max(0,yt-.5);e.beginPath();e.moveTo(He+Ze,Je);e.lineTo(He+Te-Ze,Je);e.quadraticCurveTo(He+Te,Je,He+Te,Je+Ze);e.lineTo(He+Te,Je+we-Ze);e.quadraticCurveTo(He+Te,Je+we,He+Te-Ze,Je+we);e.lineTo(He+Ze,Je+we);e.quadraticCurveTo(He,Je+we,He,Je+we-Ze);e.lineTo(He,Je+Ze);e.quadraticCurveTo(He,Je,He+Ze,Je);e.closePath();let Be=false;if(ve!==void 0&&ge!==void 0&&ge>0){e.strokeStyle=ve;e.lineWidth=ge;Be=true}else if(he){e.strokeStyle=he;e.lineWidth=HBr;Be=true}if(Be){e.stroke()}}}else{if(ue&&mt&&ge!==void 0){Hzt(e,se,r,{x:J,y:oe,width:Ee,color:mt,lineWidth:ge,lineVisible:Ve,markerVisible:Le,opacity:1})}else{if(!ct&&he){e.fillStyle=he}e.beginPath();e.moveTo(J+yt,$e);e.lineTo(J+Ee-yt,$e);e.quadraticCurveTo(J+Ee,$e,J+Ee,$e+yt);e.lineTo(J+Ee,$e+tt-yt);e.quadraticCurveTo(J+Ee,$e+tt,J+Ee-yt,$e+tt);e.lineTo(J+yt,$e+tt);e.quadraticCurveTo(J,$e+tt,J,$e+tt-yt);e.lineTo(J,$e+yt);e.quadraticCurveTo(J,$e,J+yt,$e);e.closePath();if(!ct&&he){e.fill()}if(ve!==void 0&&ge!==void 0&&ge>0){e.strokeStyle=ve;e.lineWidth=ge;e.stroke()}}}e.fillStyle=a;e.textAlign="left";e.textBaseline="middle";const it=OK(j);const bt=J+Ee+it;e.fillText(re,bt,oe);if(o?.chartHoverTargets){const He=J+Ee;const Je=oe;const Te=Ee+it+ce;const we=oe-_/2;const Ze=_;o.chartHoverTargets.push({kind:"legend",x:J,y:we,width:Te,height:Ze,value:0,color:he,anchorX:He,anchorY:Je,elementId:o.elementId,seriesIndex:j.seriesIndex,seriesName:se.name})}};if(C){const j=w??[];const te=Math.max(0,L-Sy*2);let J=false;if(!P&&A!==void 0&&j.length>1){const ve=A.w!==void 0&&Number.isFinite(A.w);const ge=A.h!==void 0&&Number.isFinite(A.h);J=ve||ge}let oe=0;if(J){oe=j.reduce((ve,ge)=>Math.max(ve,ge.itemIndices.length),0)}let se=0;if(oe>0){se=Math.max(0,n.width)/oe}let re=0;if(J){re=Math.max(_,(n.height-Sy*2-_)/(j.length-1))}const ce=P?j.reduce((ve,ge)=>Math.max(ve,ge.itemIndices.length),0):0;const ue=Array.from({length:ce},()=>0);for(const ve of j){for(const[ge,Ve]of ve.itemIndices.entries()){const Le=g[Ve];if(Le===void 0)continue;const $e=NK(Le).width+OK(Le)+(x[Ve]??0);ue[ge]=Math.max(ue[ge]??0,$e)}}const xe=ue.reduce((ve,ge)=>ve+ge,0);const be=Wzt(n.width,xe,ce,Sy,P9);const Ie=j.length*_;const he=Wzt(n.height,Ie,j.length,Sy,RUe);j.forEach((ve,ge)=>{let Ve=P?n.x+be.padding:N+Sy+Math.max(0,(te-ve.width)/2);let Le=P?n.y+he.padding+_/2+ge*(_+he.gap):O+U+_/2+ge*(_+RUe);if(J){Le=n.y+Sy+_/2+ge*re}ve.itemIndices.forEach(($e,Ee)=>{const tt=g[$e];if(!tt)return;let yt=Ve;if(J){yt=n.x+yO+Sy+Ee*se}X(tt,$e,yt,Le);const mt=x[$e]??e.measureText(tt.label).width;const{width:ct}=NK(tt);if(!J){Ve+=P?(ue[Ee]??0)+be.gap:ct+OK(tt)+mt+P9}})})}else{const j=N+Sy;let te=O+U;g.forEach((J,oe)=>{X(J,oe,j,te+_/2);te+=_+P9})}e.restore()}function QBr(e,t,n,r,i,o,a,s){const l=Kzt(t,r);if(!l)return;const u=Array.isArray(s?.hiddenSeriesIndices)?new Set(s?.hiddenSeriesIndices):s?.hiddenSeriesIndices;if(u?.has(0))return;const d=e.measureText(l.minLabel).width;const f=e.measureText(l.maxLabel).width;const h=l.seriesName?e.measureText(l.seriesName).width:0;const m=!!l.seriesName;const g=BK(i);const x=Math.max(0,n.width-Xb*2);if(x<=0)return;if(g){const K=Math.max(0,Math.min(x,tbe));if(K<=0)return;const X=Math.max(K,h);let j=Math.max(0,(x-X)/2);if(i===2){j=0}else if(i===1){j=Math.max(0,x-X)}const te=Math.max(0,(X-K)/2);const J=n.x+Xb+j+te;const oe=Math.max(0,n.height-Xb*2);const se=(m?o+ebe:0)+gO+FK+o;const re=Math.max(0,(oe-se)/2);const ce=n.y+Xb+re;const ue=ce+(m?o+ebe:0);const xe=e.createLinearGradient(J,ue,J+K,ue);xe.addColorStop(0,l.rampStart);xe.addColorStop(1,l.rampEnd);e.fillStyle=xe;e.fillRect(J,ue,K,gO);e.strokeStyle="rgba(0, 0, 0, 0.12)";e.lineWidth=1;e.strokeRect(J,ue,K,gO);const be=ue+gO+FK;e.fillStyle=a;e.textBaseline="top";e.textAlign="left";e.fillText(l.minLabel,J,be);e.textAlign="right";e.fillText(l.maxLabel,J+K,be);if(l.seriesName){e.textAlign="center";e.textBaseline="top";const Ie=n.x+Xb+j+X/2;e.fillText(l.seriesName,Ie,ce)}return}const w=Math.max(d,f);const _=w>0?FK:0;const C=Math.max(0,Math.min(gO,x-_-w));if(C<=0)return;const A=Math.max(C+_+w,h);const P=Math.max(0,(x-A)/2);const L=n.x+Xb+P;const I=L+C+_;const N=Math.max(0,n.height-Xb*2);const O=m?o+ebe:0;const z=Math.max(0,N-O);const U=Math.min(tbe,z);if(U<=0)return;const W=n.y+Xb+O;const H=W+U;const $=e.createLinearGradient(L,H,L,W);$.addColorStop(0,l.rampStart);$.addColorStop(1,l.rampEnd);e.fillStyle=$;e.fillRect(L,W,C,U);e.strokeStyle="rgba(0, 0, 0, 0.12)";e.lineWidth=1;e.strokeRect(L,W,C,U);e.fillStyle=a;e.textAlign="left";e.textBaseline="middle";if(w>0){e.fillText(l.maxLabel,I,W);e.fillText(l.minLabel,I,H)}if(l.seriesName){e.textAlign="center";e.textBaseline="top";const K=n.x+Xb+P+A/2;e.fillText(l.seriesName,K,n.y+Xb)}}zh();$E();function PUe(e){return e?.kind==="dataCallout"}function rbe(e,t){return t?.deleted??e?.deleted??false}function ibe(e){return e.series.some(t=>{if(rbe(e.dataLabels,t.dataLabels)){return false}return t.dataLabels!==void 0?t.dataLabels.showValue===true:e.dataLabels?.showValue===true})}function wm(e,t,n,r){const i=e.dataLabels;const o=t.dataLabels;let a;if(t.dataLabelOverrides){for(let m=t.dataLabelOverrides.length-1;m>=0;m-=1){const g=t.dataLabelOverrides[m];if(g?.idx===n){a=g;break}}}const s=a?.showValue??(o!==void 0?o.showValue===true:i?.showValue===true);const l=rbe(i,o);const u=a?.position??o?.position??i?.position??1;const d=a?.text;let f;if(d!==void 0){f=d}else{const m=o?.numberFormatCode??i?.numberFormatCode??t.valuesFormatCode??void 0;f=qb(r,m)}const h=a?.textStyle??o?.textStyle??i?.textStyle??void 0;return{show:!l&&(d!==void 0||s),position:u,callout:PUe(a)||PUe(o)||PUe(i),text:f,textStyle:h,fill:a?.fill??o?.fill??i?.fill}}function e6r(e,t,n,r,i,o){const a="text"in o?o.text:void 0;if(a)return a;const s=xm(t,e.categories);const l=[];if(o.showSeriesName&&t.name){l.push(t.name)}if(o.showCategoryName){const u=s[n];if(u)l.push(u)}if(o.showValue){l.push(qb(r,t.valuesFormatCode??void 0))}if(o.showPercent&&i>0){l.push(`${Math.round(r/i*100)}%`)}if(o.showBubbleSize){const u=t.bubbleSizes?.[n];if(u!==void 0){l.push(qb(u))}}return l.join("\n")}function t6r(e,t,n,r,i){const o=t.dataLabels;const a=e.dataLabels;if(rbe(a,o)){return void 0}const s=t.dataLabelOverrides?.find(h=>h.idx===n);const l=s??o??a;if(!l)return void 0;const u=e6r(e,t,n,r,i,l);if(!u)return void 0;const d=l.position??o?.position??a?.position??3;const f="showLeaderLines"in l?l.showLeaderLines??false:o?.showLeaderLines??a?.showLeaderLines??false;return{text:u,position:d!==0?d:3,textStyle:s?.textStyle??o?.textStyle??a?.textStyle,fill:s?.fill??o?.fill??a?.fill,stroke:s?.stroke??o?.stroke??a?.stroke,showLeaderLines:f}}function n6r(e,t,n,r,i,o){const a=t.position===1?r:r*.7;const s=i>0?i+(r-i)/2:r*.55;const l=t.position===1?r*1.12:t.position===2?r*.78:s;const u=Math.sin(n)*a;const d=-Math.cos(n)*a;const f=Math.sin(n)*l;const h=-Math.cos(n)*l;const m=t.textStyle?.fontSize?zc(t.textStyle.fontSize):Bh;const g=t.textStyle?.bold??true;const x=t.textStyle?.fill?.color?oo(t.textStyle.fill.color,o):nd;const w=t.text.split("\n");const _=m*1.2;const C=5;const A=4;e.save();e.font=`${g?"bold ":""}${m}px ${td}`;e.textAlign="center";e.textBaseline="middle";const P=Math.max(...w.map(z=>e.measureText(z).width));const L=P+C*2;const I=_*w.length+A*2;const N={x:f-L/2,y:h-I/2,width:L,height:I};if(t.showLeaderLines&&t.position===1){e.save();rd(e,t.stroke,o,{color:"#808080",widthPx:.75});e.beginPath();e.moveTo(u,d);e.lineTo(f,h);e.stroke();e.restore()}if(t.fill){const z=Uc(e,N,t.fill,o,"transparent");e.fillStyle=z;e.fillRect(N.x,N.y,N.width,N.height)}if(t.stroke?.fill?.color){rd(e,t.stroke,o,{widthPx:.75});e.strokeRect(N.x,N.y,N.width,N.height)}e.fillStyle=x;const O=h-(w.length-1)*_/2;w.forEach((z,U)=>{e.fillText(z,f,O+U*_)});e.restore()}function IUe(e,t,n,r,i,o){const a=t.series[0];if(!a)return;if(o?.has(0))return;const s=a.values;const l=mk(s);if(l===0)return;const u=n.x+n.width/2;const d=n.y+n.height/2;const f=Math.min(n.width,n.height)/2;const h=t.type===8;const m=h?Math.max(0,Math.min(100,t.doughnutOptions?.holeSize??55)):0;const g=h?f*(m/100):0;const x=Hb().innerRadius(g).outerRadius(f).context(e);const w=h?t.doughnutOptions?.firstSliceAngle:t.pieOptions?.firstSliceAngle;const _=(w??0)/360*Math.PI*2;const C=oO().sort(null).startAngle(_).endAngle(_+Math.PI*2);const A=xm(a,t.categories);e.save();e.translate(u,d);e.lineJoin="bevel";C(s).forEach((P,L)=>{const I=P.index??L;const N=Pd(a,I,I,r);const O=Zd(a,I);if(!O){if(N)e.fillStyle=N;e.beginPath();x(P);e.fill()}const z=J0e(a,I,r);if(z.visible){e.beginPath();x(P);e.strokeStyle=z.color;e.lineWidth=z.widthPx;e.stroke()}if(i){const W=g;const H=f;const $=(P.startAngle+P.endAngle)/2;const K=u+Math.cos($)*H;const X=d+Math.sin($)*H;const j=A[I]??t.categories?.[I]??a.name;i.push({kind:"pie",cx:u,cy:d,rInner:W,rOuter:H,startAngle:P.startAngle,endAngle:P.endAngle,value:P.value,seriesName:a.name,category:j,color:N,anchorX:K,anchorY:X})}const U=t6r(t,a,I,P.value,l);if(U){n6r(e,U,(P.startAngle+P.endAngle)/2,f,g,r)}});e.restore()}R1();function V3(e,t,n,r,i={}){const o=i.horizontalCategory?hO(t,n):wl(t,n);const a=cg(t?.textStyle);e.save();e.font=Cc(o);e.textBaseline="alphabetic";const s=Array.from(r,h=>e.measureText(h));e.restore();const l=Math.max(0,...s.map(h=>h.width));const u=Math.max(0,...s.map(h=>h.actualBoundingBoxAscent));const d=Math.max(0,...s.map(h=>h.actualBoundingBoxDescent));const f={styles:o,insets:a,maxGlyphWidth:l,maxAscent:u,maxDescent:d,maxBodyWidth:0,maxBodyHeight:0};if(l>0){f.maxBodyWidth=l+a.left+a.right}if(u+d>0){f.maxBodyHeight=u+d+a.top+a.bottom}return f}function I9(e,t,n,r,i){const[o,a]=n.domain();const s=t?.majorUnit??vk(n);if(o!==void 0&&a!==void 0&&s!==void 0&&s>0){const g=Math.max(1,Math.round(Math.abs(a-o)/s));return tO(t,n,g)}const l=n.ticks();const u=M1(t,i);const d=V3(e,t,r,l.map(g=>uh(g,u)));if(d.maxBodyWidth<=0)return l;const[f,h]=n.range();if(f===void 0||h===void 0){throw new Error("Expected a two-value chart scale range")}const m=Math.max(1,Math.floor(Math.abs(h-f)/d.maxBodyWidth));return tO(t,n,m)}function zK(e,t){const n=XT(e);if(e?.labelOffsetPercent===void 0){return t+n}return t*e.labelOffsetPercent/100+n}function M9(e,t,n={}){const r=e?.majorTickMark;if(r===1||(r===void 0||r===0)&&n.defaultVisible!==true){return{inside:0,outside:0}}if(r===2){return{inside:t,outside:0}}if(r===4){return{inside:t,outside:t}}return{inside:0,outside:t}}function Qzt(e){return e.xAxis?.orientation!==2}function obe(e){return e.yAxis?.orientation===2}function abe(e){return e.xAxis?.position===2}var UK=5;var MUe=UK*2;function r6r(e,t,n,r){if(n===void 0||r===void 0||Qc(e.yAxis)){return false}const{ctx:i,themeMap:o}=n;const a=M1(e.yAxis,e.series);const s=tO(e.yAxis,r,UK).map(d=>uh(d,a));const{maxBodyWidth:l}=V3(i,e.yAxis,o,s);if(l<=0){return false}const u=Math.floor(Math.abs(t[1]-t[0])/l);return ui.max){const g={...d,automaticMax:m};const x=JN(g);const w=e9t(e,x,r);if(w===void 0){return x}return JN({...g,maximumAutoMainIncrementCount:Math.min(g.maximumAutoMainIncrementCount,w)})}}if(h===void 0){return f}return JN({...d,maximumAutoMainIncrementCount:Math.min(d.maximumAutoMainIncrementCount,h)})}const o=!B8t(e,i.min);return eO(wc().range(n),g9({axis:e.yAxis,dataMin:i.min,dataMax:i.max,includeZeroBaseline:o,expandAutoBorderHeadroom:e.barOptions?.grouping!==3}),UK)}var n9t=4;function r9t(e){if(!Qc(e.xAxis)||e.xAxis?.textStyle?.fontSize===void 0||e.yAxis?.deleted||Qc(e.yAxis)){return false}const t=M1(e.yAxis,e.series);return t!==void 0&&t!=="General"}function i6r(e){const{axis:t,ctx:n,categories:r,maximumReservePx:i,themeMap:o,availableChartPaddingPx:a,categoryAxisOnRight:s}=e;if(t?.deleted||Qc(t)){return 0}const{styles:l,insets:u,maxGlyphWidth:d}=V3(n,t,o,r,{horizontalCategory:true});const f=M9(t,n9t);const h=GE(t)?f.outside:0;const m=t?.line;const g=GE(t)&&m?.fill?.color!==void 0&&m.widthEmu!==void 0?m.widthEmu*ti:0;const x=s?u.right:u.left;const w=d>0?Math.max(0,d+zK(t,l.fontSize)+x-a-g):0;const _=Tm(o,t?.title,t?.titleTextStyle,l.fontSize,-90);const C=cg(t?.titleTextStyle);const A=_?_.width+C.top+C.bottom:0;return Math.max(0,Math.min(i,h+w+A))}function o6r(e){const{axis:t,canvasPixelHeightPx:n,existingEdgePaddingPx:r,maximumReservePx:i,themeMap:o,valueAxisOnTop:a}=e;if(t?.deleted){return 0}const s=wl(t,o);const l=M9(t,n9t,{defaultVisible:true});const u=GE(t)?l.outside:0;const d=cg(t?.textStyle);const f=Math.round((d.top+d.bottom)/n)*n;const h=a?d.top:d.bottom;const m=Math.min(Math.floor(h/n)*n,r);const g=Qc(t)?0:s.fontSize+f-m+XT(t)+u;const x=Tm(o,t?.title,t?.titleTextStyle,s.fontSize,0);const w=cg(t?.titleTextStyle);const _=x?x.height+w.top+w.bottom:0;return Math.min(i,g+_)}function a6r(e){const{categories:t,chart:n,ctx:r,plotDims:i,themeMap:o}=e;if(n.yAxis?.deleted){return 0}const a=Qc(n.yAxis);if(!a&&!r9t(n)){return 0}if(a){if(n.xAxis?.deleted||Qc(n.xAxis)){return 0}const{maxAscent:l,maxDescent:u}=V3(r,n.xAxis,o,t,{horizontalCategory:true});const d=(l+u)*t.length;const f=Math.max(0,(i.height-d)/2);return Math.min(f,l)}const s=hO(n.xAxis,o);return Math.min(Math.max(0,i.height/2),s.fontSize)}function s6r(e){const{chart:t,ctx:n,themeMap:r}=e;const i=wl(t.yAxis,r);n.save();n.textBaseline="alphabetic";const o=t.series.reduce((a,s)=>s.values.reduce((l,u,d)=>{if(!Number.isFinite(u))return l;const f=wm(t,s,d,u);if(!f.show||f.position!==1){return l}const h={...i,fontSize:Bh,fontFamily:OE(f.textStyle),isBold:f.textStyle?.bold??true};if(f.textStyle?.fontSize){h.fontSize=zc(f.textStyle.fontSize)}n.font=Cc(h);const m=n.measureText(f.text);const g=cg(f.textStyle);return{top:Math.max(l.top,m.actualBoundingBoxAscent+g.top),bottom:Math.max(l.bottom,m.actualBoundingBoxAscent+g.bottom),width:Math.max(l.width,m.width+g.left+g.right),height:Math.max(l.height,m.actualBoundingBoxAscent+m.actualBoundingBoxDescent+g.top+g.bottom)}},a),{top:0,bottom:0,width:0,height:0});n.restore();return o}function l6r(e){const t=e.getTransform();const n=Math.hypot(t.a,t.b);const r=Math.hypot(t.c,t.d);if(!Number.isFinite(n)||n<=0||!Number.isFinite(r)||r<=0){throw new Error("Chart layout requires a finite, nonzero canvas transform")}return{width:1/n,height:1/r}}function c6r(e){const{axis:t,chart:n,chartModel:r,ctx:i,minimumDataLabelWidth:o,minimumPixelWidth:a,plotDims:s,themeMap:l}=e;if(s.width<=0){return 0}const u=Math.max(o,a);if(t?.deleted||Qc(t)){return Math.min(s.width,u)}const d=L9(n,r,[s.x,s.x+s.width],{ctx:i,themeMap:l});const f=M1(t,n.series);const h=I9(i,t,d,l,n.series).map(g=>uh(g,f));const{maxBodyWidth:m}=V3(i,t,l,h);return Math.min(s.width,Math.max(m,u))}function u6r(e){const{axis:t,categories:n,ctx:r,minimumDataLabelHeight:i,minimumPixelHeight:o,plotDims:a,themeMap:s}=e;if(a.height<=0||n.length===0){return 0}const l=Math.max(i,o);if(t?.deleted||Qc(t)){return Math.min(a.height,l*n.length)}const{maxAscent:u,maxDescent:d}=V3(r,t,s,n,{horizontalCategory:true});const f=Math.max(l,u+d);return Math.min(a.height,f*n.length)}function sbe(e){const{dimension:t,minimumPlotDimension:n,requestedMaximumFraction:r}=e;if(r!==void 0){return Math.min(Math.max(0,t),Math.max(0,t*r))}return Math.max(0,t-n)}function i9t(e){const{axis:t,chart:n,edge:r,availableChartPaddingPx:i}=e;if(!Qc(n.xAxis)){return 0}const o=cg(t?.textStyle);const a=XT(t);if(r9t(n)){return a+o[r]}return a+o.top+o[r]-i}function d6r(e){const{axis:t,chart:n,chartModel:r,ctx:i,plotDims:o,themeMap:a,maximumReservePx:s,availableLeftPaddingPx:l,availableChartLeftPaddingPx:u}=e;const d=M1(t,n.series);const f=Qc(n.xAxis);if(t?.deleted||Qc(t)){return 0}if(!f&&(d===void 0||d==="General")){return 0}const h=L9(n,r,[o.x,o.x+o.width],{ctx:i,themeMap:a});const m=h.domain();if(!f&&(m.every(_=>_>=0)||m.every(_=>_<=0))){return 0}const g=wl(t,a);const x=i9t({axis:t,chart:n,edge:"left",availableChartPaddingPx:u});i.save();i.font=Cc(g);const w=I9(i,t,h,a,n.series).reduce((_,C)=>{const A=h(C);const P=uh(C,d);const L=i.measureText(P).width;const I=o.x-(A-L/2);if(I<=0){return _}return Math.max(_,I+x)},0);i.restore();return Math.min(s,Math.max(0,w-l))}function f6r(e){const{axis:t,chart:n,chartModel:r,ctx:i,maximumReservePx:o,plotDims:a,themeMap:s,availableChartRightPaddingPx:l}=e;if(t?.deleted||Qc(t)){return 0}const u=L9(n,r,[a.x,a.x+a.width],{ctx:i,themeMap:s});const d=a.x+a.width;const f=wl(t,s);const h=i9t({axis:t,chart:n,edge:"right",availableChartPaddingPx:l});const m=M1(t,n.series);i.save();i.font=Cc(f);const g=I9(i,t,u,s,n.series).reduce((x,w)=>{const _=u(w);const C=uh(w,m);const A=i.measureText(C).width;const P=_+A/2-d;if(P<=0){return x}return Math.max(x,P+h)},0);i.restore();return Math.min(o,g)}function h6r(e){const{chart:t,chartModel:n,ctx:r,plotDims:i,themeMap:o}=e;if(i.width<=0){return 0}const a=i.width;const s=[0,a];if(obe(t)){s.reverse()}const l=L9(t,n,s,{ctx:r,themeMap:o});return l(P1(l,0))/a}function p6r(e){const{crossingRatio:t,plotWidth:n,requiredAxisOffset:r,reservedRight:i}=e;if(t>=1){return 0}const o=Math.max(0,n-i);return Math.max(0,Math.min(r,(r-t*o)/(1-t)))}function LUe(e){return e.xAxis?.orientation===2}function o9t(e,t,n,r,i){const o=Math.max(0,i.availableLeftPaddingPx??0);const a=Math.max(0,i.availableChartLeftPaddingPx??0);const s=Math.max(0,i.availableChartRightPaddingPx??0);const l=Math.max(0,i.availableChartTopPaddingPx??0);const u=Math.max(0,i.availableChartBottomPaddingPx??0);const d=i.chartModel.resolveCategories();const f=abe(t);const h=s6r({chart:t,ctx:e,themeMap:r});const m=l6r(e);const g=c6r({axis:t.yAxis,chart:t,chartModel:i.chartModel,ctx:e,minimumDataLabelWidth:h.width,minimumPixelWidth:m.width,plotDims:n,themeMap:r});const x=sbe({dimension:n.width,minimumPlotDimension:g,requestedMaximumFraction:i.maxLeftFrac});const w=i6r({ctx:e,categories:d,axis:t.xAxis,themeMap:r,maximumReservePx:x,availableChartPaddingPx:f?s:a,categoryAxisOnRight:f});const _={x:n.x,y:n.y,width:Math.max(0,n.width-w),height:n.height};if(!f){_.x+=w}const C=d6r({axis:t.yAxis,chart:t,chartModel:i.chartModel,ctx:e,plotDims:_,themeMap:r,maximumReservePx:sbe({dimension:_.width,minimumPlotDimension:g,requestedMaximumFraction:i.maxLeftFrac}),availableLeftPaddingPx:o,availableChartLeftPaddingPx:a});const A=f6r({axis:t.yAxis,chart:t,chartModel:i.chartModel,ctx:e,plotDims:_,themeMap:r,maximumReservePx:sbe({dimension:_.width,minimumPlotDimension:g,requestedMaximumFraction:i.maxRightFrac}),availableChartRightPaddingPx:s});const P=f?Math.max(w,A):A;const L=h6r({chart:t,chartModel:i.chartModel,ctx:e,plotDims:_,themeMap:r});const I=f?0:Math.max(C,p6r({crossingRatio:L,plotWidth:n.width,requiredAxisOffset:w,reservedRight:P}));const N={x:n.x+I,y:_.y,width:Math.max(0,n.width-I-P),height:_.height};const O=LUe(t);const z=a6r({ctx:e,categories:d,chart:t,plotDims:N,themeMap:r});const U=Qc(t.yAxis)||!Qc(t.xAxis)&&t.series.length!==1?{top:0,bottom:0}:h;const W=z+Math.max(0,(O?U.top:U.bottom)-z-(O?l:u));const H=o6r({axis:t.yAxis,canvasPixelHeightPx:m.height,existingEdgePaddingPx:W,themeMap:r,valueAxisOnTop:O,maximumReservePx:sbe({dimension:N.height,minimumPlotDimension:u6r({axis:t.xAxis,categories:d,ctx:e,minimumDataLabelHeight:h.height,minimumPixelHeight:m.height,plotDims:N,themeMap:r}),requestedMaximumFraction:i.maxBottomFrac})});const $=z+Math.max(0,U.top-z-l)+(O?H:0);const K=z+Math.max(0,U.bottom-z-u)+(O?0:H);const X=I+L*N.width;const j=f?n.width-X+s:Math.max(o,a)+X;const te=Math.max(0,j-zK(t.xAxis,hO(t.xAxis,r).fontSize));return{plotDims:{x:N.x,y:N.y+$,width:N.width,height:Math.max(0,N.height-$-K)},reservedLeft:I,categoryLabelMaxWidth:te,reservedRight:P,reservedTop:$,reservedBottom:K}}var m6r=.5;function g6r(e,t){return Math.abs(e-t)<=m6r}function y6r(e,t,n,r){if(r?.categoryLabelMaxWidth!==void 0){return r.categoryLabelMaxWidth}if(r?.reservedLeft!==void 0){return Math.max(0,r.reservedLeft-n)}return t.reduce((i,o)=>Math.max(i,e.measureText(o).width),0)}function a9t(e,t,n,r,i=true,o,a){const{x:s,y:l}=n;const u=dO(t);e.save();e.lineWidth=1;const d=t.xAxis;const f=t.yAxis;const h=M1(f,t.series);const m=!!d?.deleted;const g=s(P1(s,0));const x=abe(t);const w=B3(d);const _=w.tickLabelInterval!==void 0&&w.tickLabelInterval>0?Math.floor(w.tickLabelInterval):1;const C=w.tickMarkInterval!==void 0&&w.tickMarkInterval>0?Math.floor(w.tickMarkInterval):_;const A=d?.majorGridlines;if(A?.fill?.color&&u.length>0){e.save();rd(e,A,o);if(f?.crossBetween===2){u.forEach((I,N)=>{if(C>1&&N%C!==0){return}const O=l(I);if(O===void 0){return}const z=O+l.bandwidth()/2;e.beginPath();e.moveTo(r.x,z);e.lineTo(r.x+r.width,z);e.stroke()})}else{for(const I of u.keys()){if(C>1&&I%C!==0){continue}const N=r.y+I*l.step();e.beginPath();e.moveTo(r.x,N);e.lineTo(r.x+r.width,N);e.stroke()}if(C<=1||u.length%C===0){const I=r.y+r.height;e.beginPath();e.moveTo(r.x,I);e.lineTo(r.x+r.width,I);e.stroke()}}e.restore()}if(!m){const I=hO(d,o);e.font=Cc(I);e.fillStyle=I.textColor;e.strokeStyle=I.lineColor;e.textAlign=x?"left":"right";e.textBaseline="middle";const N=GE(d);if(N&&d?.line?.fill?.color){e.beginPath();e.moveTo(g,r.y);e.lineTo(g,r.y+r.height);e.stroke()}const O=Qc(d);const z=zK(d,I.fontSize);const U=y6r(e,u,z,a);const W=M9(d,4);u.forEach((H,$)=>{const K=(l(H)??0)+l.bandwidth()/2;const X=C<=1||$%C===0;const j=_<=1||$%_===0;if(N&&(W.inside>0||W.outside>0)&&X){const te=x?1:-1;e.beginPath();e.moveTo(g+te*W.outside,K);e.lineTo(g-te*W.inside,K);e.stroke()}if(!O&&j){const te=n_(e,H,U);e.fillText(te,g+(x?z:-z),K)}})}const P=!!f?.deleted;const L=i&&!!f?.majorGridlines?.fill?.color;if(!P||L){const I=wl(f,o);const N=GE(f);e.font=Cc(I);e.fillStyle=I.textColor;e.strokeStyle=I.lineColor;e.textAlign="center";const O=LUe(t);e.textBaseline=O?"bottom":"top";const z=O?r.y:r.y+r.height;const U=M9(f,4,{defaultVisible:true});const W=O?-1:1;const H=z-W*U.inside;const $=z+W*U.outside;const K=cg(f?.textStyle);const X=K.top+K.bottom+XT(f);const j=z+W*X;const te=O?r.y+r.height:z;if(!P&&N){e.beginPath();e.moveTo(r.x,z);e.lineTo(r.x+r.width,z);e.stroke()}const J=Qc(f);const oe=U.inside>0||U.outside>0;I9(e,f,s,o,t.series).forEach(se=>{const re=s(se);if(!P&&N&&oe){e.beginPath();e.moveTo(re,H);e.lineTo(re,$);e.stroke()}if(L&&!g6r(re,g)){e.save();rd(e,f?.majorGridlines,o,{color:I.gridLineColor??I.lineColor,widthPx:1});e.beginPath();e.moveTo(re,r.y);e.lineTo(re,te);e.stroke();e.restore()}if(!P&&!J){e.fillText(uh(se,h),re,j)}})}e.restore()}function WE(e,t,n,r,i,o,a={}){const s=r?.fontSize?zc(r.fontSize):Bh;const l=r?.fill?.color?oo(r.fill.color,i):nd;const u=r?.bold??true;e.save();e.fillStyle=l;e.font=`${u?"bold ":""}${s}px ${td}`;e.textBaseline="middle";e.textAlign="center";const d=a.callout??false;const f=4;const h=e.measureText(t).width;const m=h+f*2;const g=s+f*2;const x=a.box;const w=a.isPositive??true;const _=a.orientation??"vertical";let C=o.x;let A=o.y;const P=n??1;if(x&&_==="horizontal"){switch(P){case 8:C=w?x.x+m/2+4:x.x+x.width-m/2-4;A=x.y+x.height/2;break;case 2:C=w?x.x+x.width-m/2-4:x.x+m/2+4;A=x.y+x.height/2;break;case 3:C=x.x+x.width/2;A=x.y+x.height/2;break;case 1:default:C=w?x.x+x.width+m/2+4:x.x-m/2-4;A=x.y+x.height/2;break}}else if(x){switch(P){case 8:C=x.x+x.width/2;A=w?x.y+x.height-g/2:x.y+g/2;break;case 2:C=x.x+x.width/2;A=w?x.y+g/2:x.y+x.height-g/2;break;case 3:C=x.x+x.width/2;A=x.y+x.height/2;break;case 1:default:C=x.x+x.width/2;A=w?x.y-g/2-4:x.y+x.height+g/2+4;break}}else{switch(P){case 8:case 2:C=o.x;A=o.y+g/2+6;break;case 3:C=o.x;A=o.y;break;case 1:default:C=o.x;A=o.y-g/2-6;break}}const L={x:C-m/2,y:A-g/2,width:m,height:g};if(d){const I=3;const N=C-m/2;const O=A-g/2;e.save();if(a.fill){e.fillStyle=Uc(e,L,a.fill,i,"transparent")}else{e.globalAlpha=.92;e.fillStyle="#ffffff"}e.beginPath();e.moveTo(N+I,O);e.lineTo(N+m-I,O);e.quadraticCurveTo(N+m,O,N+m,O+I);e.lineTo(N+m,O+g-I);e.quadraticCurveTo(N+m,O+g,N+m-I,O+g);e.lineTo(N+I,O+g);e.quadraticCurveTo(N,O+g,N,O+g-I);e.lineTo(N,O+I);e.quadraticCurveTo(N,O,N+I,O);e.closePath();e.fill();e.restore();e.save();e.strokeStyle="#b0b0b0";e.lineWidth=.75;e.setLineDash([]);e.stroke();e.restore();e.save();e.strokeStyle="#b0b0b0";e.lineWidth=.75;e.setLineDash([]);e.beginPath();e.moveTo(o.x,o.y);e.lineTo(C,A);e.stroke();e.restore()}else if(a.fill){e.fillStyle=Uc(e,L,a.fill,i,"transparent");e.fillRect(L.x,L.y,L.width,L.height)}e.fillStyle=l;e.fillText(t,C,A);e.restore()}function s9t(e,t,n,r,i,o){const{x:a,y:s}=n;const l=E9(t,o);const u=l.categories;const d=l.mode==="clustered";const f=t.xAxis?.orientation===1;const h=new Map(l.visibleSeries.map((m,g)=>[m,g]));u.forEach((m,g)=>{const x=s(m);if(x===void 0)return;const w=l.segmentsByCategory[g];if(!w)return;const _=d||w.length===0?void 0:w.reduce((A,P,L)=>{if(!P.hasValue)return A;if(P.end{if(!P.hasValue)return A;if(P.end>=P.start)return A;if(A===void 0)return L;const I=w[A];if(!I)return A;return I.end>P.end?L:A},void 0);w.forEach((A,P)=>{if(!A.hasValue)return;const L=t.series[A.seriesIndex];if(!L)return;const I=A.valueRaw;const N=h.get(A.seriesIndex);if(N===void 0)return;const O=d?s.bandwidth()*w0e({orderIndex:N,seriesCount:l.visibleSeries.length,overlap:t.barOptions?.overlap,reverse:f}):0;const z=d?x+O:x;const U=d?s.bandwidth()*p9(l.visibleSeries.length,t.barOptions?.overlap):s.bandwidth();const W=a(P1(a,A.start));const H=a(P1(a,A.end));const $=Math.min(W,H);const K=Math.max(W,H);const X=Math.abs(K-$);const j=A.end>=A.start;const te=Zd(L,g);const J=Pd(L,g,A.seriesIndex,r,{chartStyleIndex:t.styleIndex});const oe=U3(e,{x:$,y:z,width:X,height:U},L,g,A.seriesIndex,r,{chartStyleIndex:t.styleIndex});if(!te&&oe)e.fillStyle=oe;const se=M3;const re=Math.max(0,Math.min(se,U/2,X));const ce=d||(A.end>=A.start?P===_:P===C);const ue=ce?re:0;e.beginPath();if(j){e.moveTo($,z);e.lineTo(K-ue,z);e.arcTo(K,z,K,z+ue,ue);e.lineTo(K,z+U-ue);e.arcTo(K,z+U,K-ue,z+U,ue);e.lineTo($,z+U);e.closePath()}else{e.moveTo(K,z);e.lineTo($+ue,z);e.arcTo($,z,$,z+ue,ue);e.lineTo($,z+U-ue);e.arcTo($,z+U,$+ue,z+U,ue);e.lineTo(K,z+U);e.closePath()}if(!te&&oe)e.fill();const{color:xe,widthPx:be}=Uh(L,g,r);if(xe){e.strokeStyle=xe;e.lineWidth=be??1;e.stroke()}if(i){const he=j?K:$;i.push({kind:"bar-horizontal",x:$,y:z,width:X,height:U,seriesName:L.name,category:m,value:I,color:J,anchorX:he,anchorY:z})}const Ie=wm(t,L,g,I);if(Ie.show&&U>0){WE(e,Ie.text,Ie.position,Ie.textStyle,r,{x:j?K:$,y:z+U/2},{box:{x:$,y:z,width:X,height:U},isPositive:j,callout:Ie.callout,orientation:"horizontal",fill:Ie.fill})}})})}function lbe(e,t,n,r,i,o){if(!_k(n.x))return;const a=n.x;const s=n.y;const l=E9(t,o);const u=l.categories;const d=l.mode==="clustered";const f=new Map(l.visibleSeries.map((h,m)=>[h,m]));u.forEach((h,m)=>{const g=a(h);if(g===void 0)return;const x=l.segmentsByCategory[m];const w=d||x?.length===0?void 0:x?.reduce((C,A,P)=>{if(!A.hasValue)return C;if(A.end{if(!A.hasValue)return C;if(A.end>=A.start)return C;if(C===void 0)return P;const L=x[C];if(!L)return C;return L.end>A.end?P:C},void 0);x?.forEach((C,A)=>{if(!C.hasValue)return;const P=t.series[C.seriesIndex];if(!P)return;const L=C.valueRaw;const I=Zd(P,m);const N=Pd(P,m,C.seriesIndex,r,{chartStyleIndex:t.styleIndex});const O=f.get(C.seriesIndex);if(O===void 0)return;const z=d?a.bandwidth()*w0e({orderIndex:O,seriesCount:l.visibleSeries.length,overlap:t.barOptions?.overlap,reverse:V0e(t)}):0;const U=d?g+z:g;const W=d?a.bandwidth()*p9(l.visibleSeries.length,t.barOptions?.overlap):a.bandwidth();const H=s(P1(s,C.start));const $=s(P1(s,C.end));const K=Math.min(H,$);const X=Math.abs($-H);const j=K+X;const te=U3(e,{x:U,y:Math.min(K,j),width:W,height:X},P,m,C.seriesIndex,r,{chartStyleIndex:t.styleIndex});const J=M3;const oe=Math.max(0,Math.min(J,W/2,X));const se=d||(C.end>=C.start?A===w:A===_);const re=se?oe:0;e.beginPath();if(L>=0){e.moveTo(U,j);e.lineTo(U,K+re);e.arcTo(U,K,U+re,K,re);e.lineTo(U+W-re,K);e.arcTo(U+W,K,U+W,K+re,re);e.lineTo(U+W,j);e.closePath()}else{e.moveTo(U,K);e.lineTo(U,j-re);e.arcTo(U,j,U+re,j,re);e.lineTo(U+W-re,j);e.arcTo(U+W,j,U+W,j-re,re);e.lineTo(U+W,K);e.closePath()}if(!I&&te){e.fillStyle=te;e.fill()}const{color:ce,widthPx:ue}=Uh(P,m,r);if(ce){e.strokeStyle=ce;e.lineWidth=ue??1;e.stroke()}if(i){const be=Math.min(K,j);i.push({kind:"bar-vertical",x:U,y:K,width:W,height:X,seriesName:P.name,category:h,value:L,color:N,anchorX:U+W,anchorY:be})}const xe=wm(t,P,m,L);if(xe.show&&W>0){const be=L>=0;WE(e,xe.text,xe.position,xe.textStyle,r,{x:U+W/2,y:K},{box:{x:U,y:Math.min(K,j),width:W,height:X},isPositive:be,callout:xe.callout,fill:xe.fill})}})})}var axe="179";var M9t=0;var dVe=1;var L9t=2;var fVe=1;var sxe=2;var KE=3;var Ik=0;var D0=1;var ZE=2;var Dk=0;var wO=1;var hVe=2;var pVe=3;var mVe=4;var D9t=5;var j3=100;var F9t=101;var N9t=102;var O9t=103;var B9t=104;var z9t=200;var U9t=201;var V9t=202;var $9t=203;var Lbe=204;var Dbe=205;var G9t=206;var H9t=207;var W9t=208;var Y9t=209;var q9t=210;var X9t=211;var j9t=212;var K9t=213;var Z9t=214;var lxe=0;var cxe=1;var uxe=2;var EO=3;var dxe=4;var fxe=5;var hxe=6;var pxe=7;var gVe=0;var J9t=1;var Q9t=2;var ow=0;var eUt=1;var tUt=2;var nUt=3;var rUt=4;var iUt=5;var oUt=6;var aUt=7;var yVe=300;var PO=301;var IO=302;var mxe=303;var gxe=304;var _Z=306;var Fbe=1e3;var X3=1001;var Nbe=1002;var o_=1003;var sUt=1004;var TZ=1005;var tw=1006;var yxe=1007;var Q3=1008;var aw=1009;var bVe=1010;var xVe=1011;var iU=1012;var bxe=1013;var eM=1014;var JE=1015;var oU=1016;var xxe=1017;var vxe=1018;var aU=1020;var vVe=35902;var _Ve=1021;var TVe=1022;var s_=1023;var Z9=1026;var sU=1027;var wVe=1028;var _xe=1029;var EVe=1030;var Txe=1031;var wxe=1033;var wZ=33776;var EZ=33777;var CZ=33778;var SZ=33779;var Exe=35840;var Cxe=35841;var Sxe=35842;var Axe=35843;var kxe=36196;var Rxe=37492;var Pxe=37496;var Ixe=37808;var Mxe=37809;var Lxe=37810;var Dxe=37811;var Fxe=37812;var Nxe=37813;var Oxe=37814;var Bxe=37815;var zxe=37816;var Uxe=37817;var Vxe=37818;var $xe=37819;var Gxe=37820;var Hxe=37821;var AZ=36492;var Wxe=36494;var Yxe=36495;var CVe=36283;var qxe=36284;var Xxe=36285;var jxe=36286;var ZK=2300;var Obe=2301;var Mbe=2302;var iVe=2400;var oVe=2401;var aVe=2402;var lUt=3200;var cUt=3201;var SVe=0;var uUt=1;var Fk="";var L0="srgb";var CO="srgb-linear";var JK="linear";var du="srgb";var TO=7680;var sVe=519;var dUt=512;var fUt=513;var hUt=514;var AVe=515;var pUt=516;var mUt=517;var gUt=518;var yUt=519;var Bbe=35044;var kVe="300 es";var ew=2e3;var QK=2001;var Mk=class{addEventListener(t,n){if(this._listeners===void 0)this._listeners={};const r=this._listeners;if(r[t]===void 0){r[t]=[]}if(r[t].indexOf(n)===-1){r[t].push(n)}}hasEventListener(t,n){const r=this._listeners;if(r===void 0)return false;return r[t]!==void 0&&r[t].indexOf(n)!==-1}removeEventListener(t,n){const r=this._listeners;if(r===void 0)return;const i=r[t];if(i!==void 0){const o=i.indexOf(n);if(o!==-1){i.splice(o,1)}}}dispatchEvent(t){const n=this._listeners;if(n===void 0)return;const r=n[t.type];if(r!==void 0){t.target=this;const i=r.slice(0);for(let o=0,a=i.length;o>8&255]+Ay[e>>16&255]+Ay[e>>24&255]+"-"+Ay[t&255]+Ay[t>>8&255]+"-"+Ay[t>>16&15|64]+Ay[t>>24&255]+"-"+Ay[n&63|128]+Ay[n>>8&255]+"-"+Ay[n>>16&255]+Ay[n>>24&255]+Ay[r&255]+Ay[r>>8&255]+Ay[r>>16&255]+Ay[r>>24&255];return i.toLowerCase()}function Ml(e,t,n){return Math.max(t,Math.min(n,e))}function RVe(e,t){return(e%t+t)%t}function b6r(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)}function x6r(e,t,n){if(e!==t){return(n-e)/(t-e)}else{return 0}}function KK(e,t,n){return(1-n)*e+n*t}function v6r(e,t,n,r){return KK(e,t,1-Math.exp(-n*r))}function _6r(e,t=1){return t-Math.abs(RVe(e,t*2)-t)}function T6r(e,t,n){if(e<=t)return 0;if(e>=n)return 1;e=(e-t)/(n-t);return e*e*(3-2*e)}function w6r(e,t,n){if(e<=t)return 0;if(e>=n)return 1;e=(e-t)/(n-t);return e*e*e*(e*(e*6-15)+10)}function E6r(e,t){return e+Math.floor(Math.random()*(t-e+1))}function C6r(e,t){return e+Math.random()*(t-e)}function S6r(e){return e*(.5-Math.random())}function A6r(e){if(e!==void 0)l9t=e;let t=l9t+=1831565813;t=Math.imul(t^t>>>15,t|1);t^=t+Math.imul(t^t>>>7,t|61);return((t^t>>>14)>>>0)/4294967296}function k6r(e){return e*jK}function R6r(e){return e*J9}function P6r(e){return(e&e-1)===0&&e!==0}function I6r(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function M6r(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}function L6r(e,t,n,r,i){const o=Math.cos;const a=Math.sin;const s=o(n/2);const l=a(n/2);const u=o((t+r)/2);const d=a((t+r)/2);const f=o((t-r)/2);const h=a((t-r)/2);const m=o((r-t)/2);const g=a((r-t)/2);switch(i){case"XYX":e.set(s*d,l*f,l*h,s*u);break;case"YZY":e.set(l*h,s*d,l*f,s*u);break;case"ZXZ":e.set(l*f,l*h,s*d,s*u);break;case"XZX":e.set(s*d,l*g,l*m,s*u);break;case"YXY":e.set(l*m,s*d,l*g,s*u);break;case"ZYZ":e.set(l*g,l*m,s*d,s*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function QT(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw new Error("Invalid component type.")}}function uu(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(e*4294967295);case Uint16Array:return Math.round(e*65535);case Uint8Array:return Math.round(e*255);case Int32Array:return Math.round(e*2147483647);case Int16Array:return Math.round(e*32767);case Int8Array:return Math.round(e*127);default:throw new Error("Invalid component type.")}}var MO={DEG2RAD:jK,RAD2DEG:J9,generateUUID:Rk,clamp:Ml,euclideanModulo:RVe,mapLinear:b6r,inverseLerp:x6r,lerp:KK,damp:v6r,pingpong:_6r,smoothstep:T6r,smootherstep:w6r,randInt:E6r,randFloat:C6r,randFloatSpread:S6r,seededRandom:A6r,degToRad:k6r,radToDeg:R6r,isPowerOfTwo:P6r,ceilPowerOfTwo:I6r,floorPowerOfTwo:M6r,setQuaternionFromProperEuler:L6r,normalize:uu,denormalize:QT};var Ys=class e{constructor(t=0,n=0){e.prototype.isVector2=true;this.x=t;this.y=n}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,n){this.x=t;this.y=n;return this}setScalar(t){this.x=t;this.y=t;return this}setX(t){this.x=t;return this}setY(t){this.y=t;return this}setComponent(t,n){switch(t){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){this.x=t.x;this.y=t.y;return this}add(t){this.x+=t.x;this.y+=t.y;return this}addScalar(t){this.x+=t;this.y+=t;return this}addVectors(t,n){this.x=t.x+n.x;this.y=t.y+n.y;return this}addScaledVector(t,n){this.x+=t.x*n;this.y+=t.y*n;return this}sub(t){this.x-=t.x;this.y-=t.y;return this}subScalar(t){this.x-=t;this.y-=t;return this}subVectors(t,n){this.x=t.x-n.x;this.y=t.y-n.y;return this}multiply(t){this.x*=t.x;this.y*=t.y;return this}multiplyScalar(t){this.x*=t;this.y*=t;return this}divide(t){this.x/=t.x;this.y/=t.y;return this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const n=this.x,r=this.y;const i=t.elements;this.x=i[0]*n+i[3]*r+i[6];this.y=i[1]*n+i[4]*r+i[7];return this}min(t){this.x=Math.min(this.x,t.x);this.y=Math.min(this.y,t.y);return this}max(t){this.x=Math.max(this.x,t.x);this.y=Math.max(this.y,t.y);return this}clamp(t,n){this.x=Ml(this.x,t.x,n.x);this.y=Ml(this.y,t.y,n.y);return this}clampScalar(t,n){this.x=Ml(this.x,t,n);this.y=Ml(this.y,t,n);return this}clampLength(t,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Ml(r,t,n))}floor(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this}ceil(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this}round(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this}roundToZero(){this.x=Math.trunc(this.x);this.y=Math.trunc(this.y);return this}negate(){this.x=-this.x;this.y=-this.y;return this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){const t=Math.atan2(-this.y,-this.x)+Math.PI;return t}angleTo(t){const n=Math.sqrt(this.lengthSq()*t.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(t)/n;return Math.acos(Ml(r,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const n=this.x-t.x,r=this.y-t.y;return n*n+r*r}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,n){this.x+=(t.x-this.x)*n;this.y+=(t.y-this.y)*n;return this}lerpVectors(t,n,r){this.x=t.x+(n.x-t.x)*r;this.y=t.y+(n.y-t.y)*r;return this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,n=0){this.x=t[n];this.y=t[n+1];return this}toArray(t=[],n=0){t[n]=this.x;t[n+1]=this.y;return t}fromBufferAttribute(t,n){this.x=t.getX(n);this.y=t.getY(n);return this}rotateAround(t,n){const r=Math.cos(n),i=Math.sin(n);const o=this.x-t.x;const a=this.y-t.y;this.x=o*r-a*i+t.x;this.y=o*i+a*r+t.y;return this}random(){this.x=Math.random();this.y=Math.random();return this}*[Symbol.iterator](){yield this.x;yield this.y}};var Lk=class{constructor(t=0,n=0,r=0,i=1){this.isQuaternion=true;this._x=t;this._y=n;this._z=r;this._w=i}static slerpFlat(t,n,r,i,o,a,s){let l=r[i+0],u=r[i+1],d=r[i+2],f=r[i+3];const h=o[a+0],m=o[a+1],g=o[a+2],x=o[a+3];if(s===0){t[n+0]=l;t[n+1]=u;t[n+2]=d;t[n+3]=f;return}if(s===1){t[n+0]=h;t[n+1]=m;t[n+2]=g;t[n+3]=x;return}if(f!==x||l!==h||u!==m||d!==g){let w=1-s;const _=l*h+u*m+d*g+f*x,C=_>=0?1:-1,A=1-_*_;if(A>Number.EPSILON){const L=Math.sqrt(A),I=Math.atan2(L,_*C);w=Math.sin(w*I)/L;s=Math.sin(s*I)/L}const P=s*C;l=l*w+h*P;u=u*w+m*P;d=d*w+g*P;f=f*w+x*P;if(w===1-s){const L=1/Math.sqrt(l*l+u*u+d*d+f*f);l*=L;u*=L;d*=L;f*=L}}t[n]=l;t[n+1]=u;t[n+2]=d;t[n+3]=f}static multiplyQuaternionsFlat(t,n,r,i,o,a){const s=r[i];const l=r[i+1];const u=r[i+2];const d=r[i+3];const f=o[a];const h=o[a+1];const m=o[a+2];const g=o[a+3];t[n]=s*g+d*f+l*m-u*h;t[n+1]=l*g+d*h+u*f-s*m;t[n+2]=u*g+d*m+s*h-l*f;t[n+3]=d*g-s*f-l*h-u*m;return t}get x(){return this._x}set x(t){this._x=t;this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t;this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t;this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t;this._onChangeCallback()}set(t,n,r,i){this._x=t;this._y=n;this._z=r;this._w=i;this._onChangeCallback();return this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){this._x=t.x;this._y=t.y;this._z=t.z;this._w=t.w;this._onChangeCallback();return this}setFromEuler(t,n=true){const r=t._x,i=t._y,o=t._z,a=t._order;const s=Math.cos;const l=Math.sin;const u=s(r/2);const d=s(i/2);const f=s(o/2);const h=l(r/2);const m=l(i/2);const g=l(o/2);switch(a){case"XYZ":this._x=h*d*f+u*m*g;this._y=u*m*f-h*d*g;this._z=u*d*g+h*m*f;this._w=u*d*f-h*m*g;break;case"YXZ":this._x=h*d*f+u*m*g;this._y=u*m*f-h*d*g;this._z=u*d*g-h*m*f;this._w=u*d*f+h*m*g;break;case"ZXY":this._x=h*d*f-u*m*g;this._y=u*m*f+h*d*g;this._z=u*d*g+h*m*f;this._w=u*d*f-h*m*g;break;case"ZYX":this._x=h*d*f-u*m*g;this._y=u*m*f+h*d*g;this._z=u*d*g-h*m*f;this._w=u*d*f+h*m*g;break;case"YZX":this._x=h*d*f+u*m*g;this._y=u*m*f+h*d*g;this._z=u*d*g-h*m*f;this._w=u*d*f-h*m*g;break;case"XZY":this._x=h*d*f-u*m*g;this._y=u*m*f-h*d*g;this._z=u*d*g+h*m*f;this._w=u*d*f+h*m*g;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}if(n===true)this._onChangeCallback();return this}setFromAxisAngle(t,n){const r=n/2,i=Math.sin(r);this._x=t.x*i;this._y=t.y*i;this._z=t.z*i;this._w=Math.cos(r);this._onChangeCallback();return this}setFromRotationMatrix(t){const n=t.elements,r=n[0],i=n[4],o=n[8],a=n[1],s=n[5],l=n[9],u=n[2],d=n[6],f=n[10],h=r+s+f;if(h>0){const m=.5/Math.sqrt(h+1);this._w=.25/m;this._x=(d-l)*m;this._y=(o-u)*m;this._z=(a-i)*m}else if(r>s&&r>f){const m=2*Math.sqrt(1+r-s-f);this._w=(d-l)/m;this._x=.25*m;this._y=(i+a)/m;this._z=(o+u)/m}else if(s>f){const m=2*Math.sqrt(1+s-r-f);this._w=(o-u)/m;this._x=(i+a)/m;this._y=.25*m;this._z=(l+d)/m}else{const m=2*Math.sqrt(1+f-r-s);this._w=(a-i)/m;this._x=(o+u)/m;this._y=(l+d)/m;this._z=.25*m}this._onChangeCallback();return this}setFromUnitVectors(t,n){let r=t.dot(n)+1;if(r<1e-8){r=0;if(Math.abs(t.x)>Math.abs(t.z)){this._x=-t.y;this._y=t.x;this._z=0;this._w=r}else{this._x=0;this._y=-t.z;this._z=t.y;this._w=r}}else{this._x=t.y*n.z-t.z*n.y;this._y=t.z*n.x-t.x*n.z;this._z=t.x*n.y-t.y*n.x;this._w=r}return this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Ml(this.dot(t),-1,1)))}rotateTowards(t,n){const r=this.angleTo(t);if(r===0)return this;const i=Math.min(1,n/r);this.slerp(t,i);return this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){this._x*=-1;this._y*=-1;this._z*=-1;this._onChangeCallback();return this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();if(t===0){this._x=0;this._y=0;this._z=0;this._w=1}else{t=1/t;this._x=this._x*t;this._y=this._y*t;this._z=this._z*t;this._w=this._w*t}this._onChangeCallback();return this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,n){const r=t._x,i=t._y,o=t._z,a=t._w;const s=n._x,l=n._y,u=n._z,d=n._w;this._x=r*d+a*s+i*u-o*l;this._y=i*d+a*l+o*s-r*u;this._z=o*d+a*u+r*l-i*s;this._w=a*d-r*s-i*l-o*u;this._onChangeCallback();return this}slerp(t,n){if(n===0)return this;if(n===1)return this.copy(t);const r=this._x,i=this._y,o=this._z,a=this._w;let s=a*t._w+r*t._x+i*t._y+o*t._z;if(s<0){this._w=-t._w;this._x=-t._x;this._y=-t._y;this._z=-t._z;s=-s}else{this.copy(t)}if(s>=1){this._w=a;this._x=r;this._y=i;this._z=o;return this}const l=1-s*s;if(l<=Number.EPSILON){const m=1-n;this._w=m*a+n*this._w;this._x=m*r+n*this._x;this._y=m*i+n*this._y;this._z=m*o+n*this._z;this.normalize();return this}const u=Math.sqrt(l);const d=Math.atan2(u,s);const f=Math.sin((1-n)*d)/u,h=Math.sin(n*d)/u;this._w=a*f+this._w*h;this._x=r*f+this._x*h;this._y=i*f+this._y*h;this._z=o*f+this._z*h;this._onChangeCallback();return this}slerpQuaternions(t,n,r){return this.copy(t).slerp(n,r)}random(){const t=2*Math.PI*Math.random();const n=2*Math.PI*Math.random();const r=Math.random();const i=Math.sqrt(1-r);const o=Math.sqrt(r);return this.set(i*Math.sin(t),i*Math.cos(t),o*Math.sin(n),o*Math.cos(n))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,n=0){this._x=t[n];this._y=t[n+1];this._z=t[n+2];this._w=t[n+3];this._onChangeCallback();return this}toArray(t=[],n=0){t[n]=this._x;t[n+1]=this._y;t[n+2]=this._z;t[n+3]=this._w;return t}fromBufferAttribute(t,n){this._x=t.getX(n);this._y=t.getY(n);this._z=t.getZ(n);this._w=t.getW(n);this._onChangeCallback();return this}toJSON(){return this.toArray()}_onChange(t){this._onChangeCallback=t;return this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x;yield this._y;yield this._z;yield this._w}};var gr=class e{constructor(t=0,n=0,r=0){e.prototype.isVector3=true;this.x=t;this.y=n;this.z=r}set(t,n,r){if(r===void 0)r=this.z;this.x=t;this.y=n;this.z=r;return this}setScalar(t){this.x=t;this.y=t;this.z=t;return this}setX(t){this.x=t;return this}setY(t){this.y=t;return this}setZ(t){this.z=t;return this}setComponent(t,n){switch(t){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){this.x=t.x;this.y=t.y;this.z=t.z;return this}add(t){this.x+=t.x;this.y+=t.y;this.z+=t.z;return this}addScalar(t){this.x+=t;this.y+=t;this.z+=t;return this}addVectors(t,n){this.x=t.x+n.x;this.y=t.y+n.y;this.z=t.z+n.z;return this}addScaledVector(t,n){this.x+=t.x*n;this.y+=t.y*n;this.z+=t.z*n;return this}sub(t){this.x-=t.x;this.y-=t.y;this.z-=t.z;return this}subScalar(t){this.x-=t;this.y-=t;this.z-=t;return this}subVectors(t,n){this.x=t.x-n.x;this.y=t.y-n.y;this.z=t.z-n.z;return this}multiply(t){this.x*=t.x;this.y*=t.y;this.z*=t.z;return this}multiplyScalar(t){this.x*=t;this.y*=t;this.z*=t;return this}multiplyVectors(t,n){this.x=t.x*n.x;this.y=t.y*n.y;this.z=t.z*n.z;return this}applyEuler(t){return this.applyQuaternion(c9t.setFromEuler(t))}applyAxisAngle(t,n){return this.applyQuaternion(c9t.setFromAxisAngle(t,n))}applyMatrix3(t){const n=this.x,r=this.y,i=this.z;const o=t.elements;this.x=o[0]*n+o[3]*r+o[6]*i;this.y=o[1]*n+o[4]*r+o[7]*i;this.z=o[2]*n+o[5]*r+o[8]*i;return this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const n=this.x,r=this.y,i=this.z;const o=t.elements;const a=1/(o[3]*n+o[7]*r+o[11]*i+o[15]);this.x=(o[0]*n+o[4]*r+o[8]*i+o[12])*a;this.y=(o[1]*n+o[5]*r+o[9]*i+o[13])*a;this.z=(o[2]*n+o[6]*r+o[10]*i+o[14])*a;return this}applyQuaternion(t){const n=this.x,r=this.y,i=this.z;const o=t.x,a=t.y,s=t.z,l=t.w;const u=2*(a*i-s*r);const d=2*(s*n-o*i);const f=2*(o*r-a*n);this.x=n+l*u+a*f-s*d;this.y=r+l*d+s*u-o*f;this.z=i+l*f+o*d-a*u;return this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const n=this.x,r=this.y,i=this.z;const o=t.elements;this.x=o[0]*n+o[4]*r+o[8]*i;this.y=o[1]*n+o[5]*r+o[9]*i;this.z=o[2]*n+o[6]*r+o[10]*i;return this.normalize()}divide(t){this.x/=t.x;this.y/=t.y;this.z/=t.z;return this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){this.x=Math.min(this.x,t.x);this.y=Math.min(this.y,t.y);this.z=Math.min(this.z,t.z);return this}max(t){this.x=Math.max(this.x,t.x);this.y=Math.max(this.y,t.y);this.z=Math.max(this.z,t.z);return this}clamp(t,n){this.x=Ml(this.x,t.x,n.x);this.y=Ml(this.y,t.y,n.y);this.z=Ml(this.z,t.z,n.z);return this}clampScalar(t,n){this.x=Ml(this.x,t,n);this.y=Ml(this.y,t,n);this.z=Ml(this.z,t,n);return this}clampLength(t,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Ml(r,t,n))}floor(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);return this}ceil(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);return this}round(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);return this}roundToZero(){this.x=Math.trunc(this.x);this.y=Math.trunc(this.y);this.z=Math.trunc(this.z);return this}negate(){this.x=-this.x;this.y=-this.y;this.z=-this.z;return this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,n){this.x+=(t.x-this.x)*n;this.y+=(t.y-this.y)*n;this.z+=(t.z-this.z)*n;return this}lerpVectors(t,n,r){this.x=t.x+(n.x-t.x)*r;this.y=t.y+(n.y-t.y)*r;this.z=t.z+(n.z-t.z)*r;return this}cross(t){return this.crossVectors(this,t)}crossVectors(t,n){const r=t.x,i=t.y,o=t.z;const a=n.x,s=n.y,l=n.z;this.x=i*l-o*s;this.y=o*a-r*l;this.z=r*s-i*a;return this}projectOnVector(t){const n=t.lengthSq();if(n===0)return this.set(0,0,0);const r=t.dot(this)/n;return this.copy(t).multiplyScalar(r)}projectOnPlane(t){DUe.copy(this).projectOnVector(t);return this.sub(DUe)}reflect(t){return this.sub(DUe.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const n=Math.sqrt(this.lengthSq()*t.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(t)/n;return Math.acos(Ml(r,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const n=this.x-t.x,r=this.y-t.y,i=this.z-t.z;return n*n+r*r+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,n,r){const i=Math.sin(n)*t;this.x=i*Math.sin(r);this.y=Math.cos(n)*t;this.z=i*Math.cos(r);return this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,n,r){this.x=t*Math.sin(n);this.y=r;this.z=t*Math.cos(n);return this}setFromMatrixPosition(t){const n=t.elements;this.x=n[12];this.y=n[13];this.z=n[14];return this}setFromMatrixScale(t){const n=this.setFromMatrixColumn(t,0).length();const r=this.setFromMatrixColumn(t,1).length();const i=this.setFromMatrixColumn(t,2).length();this.x=n;this.y=r;this.z=i;return this}setFromMatrixColumn(t,n){return this.fromArray(t.elements,n*4)}setFromMatrix3Column(t,n){return this.fromArray(t.elements,n*3)}setFromEuler(t){this.x=t._x;this.y=t._y;this.z=t._z;return this}setFromColor(t){this.x=t.r;this.y=t.g;this.z=t.b;return this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,n=0){this.x=t[n];this.y=t[n+1];this.z=t[n+2];return this}toArray(t=[],n=0){t[n]=this.x;t[n+1]=this.y;t[n+2]=this.z;return t}fromBufferAttribute(t,n){this.x=t.getX(n);this.y=t.getY(n);this.z=t.getZ(n);return this}random(){this.x=Math.random();this.y=Math.random();this.z=Math.random();return this}randomDirection(){const t=Math.random()*Math.PI*2;const n=Math.random()*2-1;const r=Math.sqrt(1-n*n);this.x=r*Math.cos(t);this.y=n;this.z=r*Math.sin(t);return this}*[Symbol.iterator](){yield this.x;yield this.y;yield this.z}};var DUe=new gr;var c9t=new Lk;var Gs=class e{constructor(t,n,r,i,o,a,s,l,u){e.prototype.isMatrix3=true;this.elements=[1,0,0,0,1,0,0,0,1];if(t!==void 0){this.set(t,n,r,i,o,a,s,l,u)}}set(t,n,r,i,o,a,s,l,u){const d=this.elements;d[0]=t;d[1]=i;d[2]=s;d[3]=n;d[4]=o;d[5]=l;d[6]=r;d[7]=a;d[8]=u;return this}identity(){this.set(1,0,0,0,1,0,0,0,1);return this}copy(t){const n=this.elements;const r=t.elements;n[0]=r[0];n[1]=r[1];n[2]=r[2];n[3]=r[3];n[4]=r[4];n[5]=r[5];n[6]=r[6];n[7]=r[7];n[8]=r[8];return this}extractBasis(t,n,r){t.setFromMatrix3Column(this,0);n.setFromMatrix3Column(this,1);r.setFromMatrix3Column(this,2);return this}setFromMatrix4(t){const n=t.elements;this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]);return this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,n){const r=t.elements;const i=n.elements;const o=this.elements;const a=r[0],s=r[3],l=r[6];const u=r[1],d=r[4],f=r[7];const h=r[2],m=r[5],g=r[8];const x=i[0],w=i[3],_=i[6];const C=i[1],A=i[4],P=i[7];const L=i[2],I=i[5],N=i[8];o[0]=a*x+s*C+l*L;o[3]=a*w+s*A+l*I;o[6]=a*_+s*P+l*N;o[1]=u*x+d*C+f*L;o[4]=u*w+d*A+f*I;o[7]=u*_+d*P+f*N;o[2]=h*x+m*C+g*L;o[5]=h*w+m*A+g*I;o[8]=h*_+m*P+g*N;return this}multiplyScalar(t){const n=this.elements;n[0]*=t;n[3]*=t;n[6]*=t;n[1]*=t;n[4]*=t;n[7]*=t;n[2]*=t;n[5]*=t;n[8]*=t;return this}determinant(){const t=this.elements;const n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],u=t[7],d=t[8];return n*a*d-n*s*u-r*o*d+r*s*l+i*o*u-i*a*l}invert(){const t=this.elements,n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],u=t[7],d=t[8],f=d*a-s*u,h=s*l-d*o,m=u*o-a*l,g=n*f+r*h+i*m;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const x=1/g;t[0]=f*x;t[1]=(i*u-d*r)*x;t[2]=(s*r-i*a)*x;t[3]=h*x;t[4]=(d*n-i*l)*x;t[5]=(i*o-s*n)*x;t[6]=m*x;t[7]=(r*l-u*n)*x;t[8]=(a*n-r*o)*x;return this}transpose(){let t;const n=this.elements;t=n[1];n[1]=n[3];n[3]=t;t=n[2];n[2]=n[6];n[6]=t;t=n[5];n[5]=n[7];n[7]=t;return this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const n=this.elements;t[0]=n[0];t[1]=n[3];t[2]=n[6];t[3]=n[1];t[4]=n[4];t[5]=n[7];t[6]=n[2];t[7]=n[5];t[8]=n[8];return this}setUvTransform(t,n,r,i,o,a,s){const l=Math.cos(o);const u=Math.sin(o);this.set(r*l,r*u,-r*(l*a+u*s)+a+t,-i*u,i*l,-i*(-u*a+l*s)+s+n,0,0,1);return this}scale(t,n){this.premultiply(FUe.makeScale(t,n));return this}rotate(t){this.premultiply(FUe.makeRotation(-t));return this}translate(t,n){this.premultiply(FUe.makeTranslation(t,n));return this}makeTranslation(t,n){if(t.isVector2){this.set(1,0,t.x,0,1,t.y,0,0,1)}else{this.set(1,0,t,0,1,n,0,0,1)}return this}makeRotation(t){const n=Math.cos(t);const r=Math.sin(t);this.set(n,-r,0,r,n,0,0,0,1);return this}makeScale(t,n){this.set(t,0,0,0,n,0,0,0,1);return this}equals(t){const n=this.elements;const r=t.elements;for(let i=0;i<9;i++){if(n[i]!==r[i])return false}return true}fromArray(t,n=0){for(let r=0;r<9;r++){this.elements[r]=t[r+n]}return this}toArray(t=[],n=0){const r=this.elements;t[n]=r[0];t[n+1]=r[1];t[n+2]=r[2];t[n+3]=r[3];t[n+4]=r[4];t[n+5]=r[5];t[n+6]=r[6];t[n+7]=r[7];t[n+8]=r[8];return t}clone(){return new this.constructor().fromArray(this.elements)}};var FUe=new Gs;function PVe(e){for(let t=e.length-1;t>=0;--t){if(e[t]>=65535)return true}return false}function eZ(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function bUt(){const e=eZ("canvas");e.style.display="block";return e}var u9t={};function SO(e){if(e in u9t)return;u9t[e]=true;console.warn(e)}function xUt(e,t,n){return new Promise(function(r,i){function o(){switch(e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:i();break;case e.TIMEOUT_EXPIRED:setTimeout(o,n);break;default:r()}}setTimeout(o,n)})}var d9t=new Gs().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322);var f9t=new Gs().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function D6r(){const e={enabled:true,workingColorSpace:CO,spaces:{},convert:function(i,o,a){if(this.enabled===false||o===a||!o||!a){return i}if(this.spaces[o].transfer===du){i.r=Pk(i.r);i.g=Pk(i.g);i.b=Pk(i.b)}if(this.spaces[o].primaries!==this.spaces[a].primaries){i.applyMatrix3(this.spaces[o].toXYZ);i.applyMatrix3(this.spaces[a].fromXYZ)}if(this.spaces[a].transfer===du){i.r=K9(i.r);i.g=K9(i.g);i.b=K9(i.b)}return i},workingToColorSpace:function(i,o){return this.convert(i,this.workingColorSpace,o)},colorSpaceToWorking:function(i,o){return this.convert(i,o,this.workingColorSpace)},getPrimaries:function(i){return this.spaces[i].primaries},getTransfer:function(i){if(i===Fk)return JK;return this.spaces[i].transfer},getLuminanceCoefficients:function(i,o=this.workingColorSpace){return i.fromArray(this.spaces[o].luminanceCoefficients)},define:function(i){Object.assign(this.spaces,i)},_getMatrix:function(i,o,a){return i.copy(this.spaces[o].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(i){return this.spaces[i].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(i=this.workingColorSpace){return this.spaces[i].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(i,o){SO("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace().");return e.workingToColorSpace(i,o)},toWorkingColorSpace:function(i,o){SO("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking().");return e.colorSpaceToWorking(i,o)}};const t=[.64,.33,.3,.6,.15,.06];const n=[.2126,.7152,.0722];const r=[.3127,.329];e.define({[CO]:{primaries:t,whitePoint:r,transfer:JK,toXYZ:d9t,fromXYZ:f9t,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:L0},outputColorSpaceConfig:{drawingBufferColorSpace:L0}},[L0]:{primaries:t,whitePoint:r,transfer:du,toXYZ:d9t,fromXYZ:f9t,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:L0}}});return e}var dc=D6r();function Pk(e){return e<.04045?e*.0773993808:Math.pow(e*.9478672986+.0521327014,2.4)}function K9(e){return e<.0031308?e*12.92:1.055*Math.pow(e,.41666)-.055}var D9;var zbe=class{static getDataURL(t,n="image/png"){if(/^data:/i.test(t.src)){return t.src}if(typeof HTMLCanvasElement==="undefined"){return t.src}let r;if(t instanceof HTMLCanvasElement){r=t}else{if(D9===void 0)D9=eZ("canvas");D9.width=t.width;D9.height=t.height;const i=D9.getContext("2d");if(t instanceof ImageData){i.putImageData(t,0,0)}else{i.drawImage(t,0,0,t.width,t.height)}r=D9}return r.toDataURL(n)}static sRGBToLinear(t){if(typeof HTMLImageElement!=="undefined"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement!=="undefined"&&t instanceof HTMLCanvasElement||typeof ImageBitmap!=="undefined"&&t instanceof ImageBitmap){const n=eZ("canvas");n.width=t.width;n.height=t.height;const r=n.getContext("2d");r.drawImage(t,0,0,t.width,t.height);const i=r.getImageData(0,0,t.width,t.height);const o=i.data;for(let a=0;a1?true:false;this.pmremVersion=0}get width(){return this.source.getSize(OUe).x}get height(){return this.source.getSize(OUe).y}get depth(){return this.source.getSize(OUe).z}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(t,n){this.updateRanges.push({start:t,count:n})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name;this.source=t.source;this.mipmaps=t.mipmaps.slice(0);this.mapping=t.mapping;this.channel=t.channel;this.wrapS=t.wrapS;this.wrapT=t.wrapT;this.magFilter=t.magFilter;this.minFilter=t.minFilter;this.anisotropy=t.anisotropy;this.format=t.format;this.internalFormat=t.internalFormat;this.type=t.type;this.offset.copy(t.offset);this.repeat.copy(t.repeat);this.center.copy(t.center);this.rotation=t.rotation;this.matrixAutoUpdate=t.matrixAutoUpdate;this.matrix.copy(t.matrix);this.generateMipmaps=t.generateMipmaps;this.premultiplyAlpha=t.premultiplyAlpha;this.flipY=t.flipY;this.unpackAlignment=t.unpackAlignment;this.colorSpace=t.colorSpace;this.renderTarget=t.renderTarget;this.isRenderTargetTexture=t.isRenderTargetTexture;this.isArrayTexture=t.isArrayTexture;this.userData=JSON.parse(JSON.stringify(t.userData));this.needsUpdate=true;return this}setValues(t){for(const n in t){const r=t[n];if(r===void 0){console.warn(`THREE.Texture.setValues(): parameter '${n}' has value of undefined.`);continue}const i=this[n];if(i===void 0){console.warn(`THREE.Texture.setValues(): property '${n}' does not exist.`);continue}if(i&&r&&(i.isVector2&&r.isVector2)){i.copy(r)}else if(i&&r&&(i.isVector3&&r.isVector3)){i.copy(r)}else if(i&&r&&(i.isMatrix3&&r.isMatrix3)){i.copy(r)}else{this[n]=r}}}toJSON(t){const n=t===void 0||typeof t==="string";if(!n&&t.textures[this.uuid]!==void 0){return t.textures[this.uuid]}const r={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(Object.keys(this.userData).length>0)r.userData=this.userData;if(!n){t.textures[this.uuid]=r}return r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==yVe)return t;t.applyMatrix3(this.matrix);if(t.x<0||t.x>1){switch(this.wrapS){case Fbe:t.x=t.x-Math.floor(t.x);break;case X3:t.x=t.x<0?0:1;break;case Nbe:if(Math.abs(Math.floor(t.x)%2)===1){t.x=Math.ceil(t.x)-t.x}else{t.x=t.x-Math.floor(t.x)}break}}if(t.y<0||t.y>1){switch(this.wrapT){case Fbe:t.y=t.y-Math.floor(t.y);break;case X3:t.y=t.y<0?0:1;break;case Nbe:if(Math.abs(Math.floor(t.y)%2)===1){t.y=Math.ceil(t.y)-t.y}else{t.y=t.y-Math.floor(t.y)}break}}if(this.flipY){t.y=1-t.y}return t}set needsUpdate(t){if(t===true){this.version++;this.source.needsUpdate=true}}set needsPMREMUpdate(t){if(t===true){this.pmremVersion++}}};Zb.DEFAULT_IMAGE=null;Zb.DEFAULT_MAPPING=yVe;Zb.DEFAULT_ANISOTROPY=1;var fu=class e{constructor(t=0,n=0,r=0,i=1){e.prototype.isVector4=true;this.x=t;this.y=n;this.z=r;this.w=i}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,n,r,i){this.x=t;this.y=n;this.z=r;this.w=i;return this}setScalar(t){this.x=t;this.y=t;this.z=t;this.w=t;return this}setX(t){this.x=t;return this}setY(t){this.y=t;return this}setZ(t){this.z=t;return this}setW(t){this.w=t;return this}setComponent(t,n){switch(t){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){this.x=t.x;this.y=t.y;this.z=t.z;this.w=t.w!==void 0?t.w:1;return this}add(t){this.x+=t.x;this.y+=t.y;this.z+=t.z;this.w+=t.w;return this}addScalar(t){this.x+=t;this.y+=t;this.z+=t;this.w+=t;return this}addVectors(t,n){this.x=t.x+n.x;this.y=t.y+n.y;this.z=t.z+n.z;this.w=t.w+n.w;return this}addScaledVector(t,n){this.x+=t.x*n;this.y+=t.y*n;this.z+=t.z*n;this.w+=t.w*n;return this}sub(t){this.x-=t.x;this.y-=t.y;this.z-=t.z;this.w-=t.w;return this}subScalar(t){this.x-=t;this.y-=t;this.z-=t;this.w-=t;return this}subVectors(t,n){this.x=t.x-n.x;this.y=t.y-n.y;this.z=t.z-n.z;this.w=t.w-n.w;return this}multiply(t){this.x*=t.x;this.y*=t.y;this.z*=t.z;this.w*=t.w;return this}multiplyScalar(t){this.x*=t;this.y*=t;this.z*=t;this.w*=t;return this}applyMatrix4(t){const n=this.x,r=this.y,i=this.z,o=this.w;const a=t.elements;this.x=a[0]*n+a[4]*r+a[8]*i+a[12]*o;this.y=a[1]*n+a[5]*r+a[9]*i+a[13]*o;this.z=a[2]*n+a[6]*r+a[10]*i+a[14]*o;this.w=a[3]*n+a[7]*r+a[11]*i+a[15]*o;return this}divide(t){this.x/=t.x;this.y/=t.y;this.z/=t.z;this.w/=t.w;return this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const n=Math.sqrt(1-t.w*t.w);if(n<1e-4){this.x=1;this.y=0;this.z=0}else{this.x=t.x/n;this.y=t.y/n;this.z=t.z/n}return this}setAxisAngleFromRotationMatrix(t){let n,r,i,o;const a=.01,s=.1,l=t.elements,u=l[0],d=l[4],f=l[8],h=l[1],m=l[5],g=l[9],x=l[2],w=l[6],_=l[10];if(Math.abs(d-h)P&&A>L){if(AL){if(P1}this.dispose()}this.viewport.set(0,0,t,n);this.scissor.set(0,0,t,n)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width;this.height=t.height;this.depth=t.depth;this.scissor.copy(t.scissor);this.scissorTest=t.scissorTest;this.viewport.copy(t.viewport);this.textures.length=0;for(let n=0,r=t.textures.length;n=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,n){return n.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){this.clampPoint(t.center,KT);return KT.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let n,r;if(t.normal.x>0){n=t.normal.x*this.min.x;r=t.normal.x*this.max.x}else{n=t.normal.x*this.max.x;r=t.normal.x*this.min.x}if(t.normal.y>0){n+=t.normal.y*this.min.y;r+=t.normal.y*this.max.y}else{n+=t.normal.y*this.max.y;r+=t.normal.y*this.min.y}if(t.normal.z>0){n+=t.normal.z*this.min.z;r+=t.normal.z*this.max.z}else{n+=t.normal.z*this.max.z;r+=t.normal.z*this.min.z}return n<=-t.constant&&r>=-t.constant}intersectsTriangle(t){if(this.isEmpty()){return false}this.getCenter(VK);ube.subVectors(this.max,VK);F9.subVectors(t.a,VK);N9.subVectors(t.b,VK);O9.subVectors(t.c,VK);$3.subVectors(N9,F9);G3.subVectors(O9,N9);bO.subVectors(F9,O9);let n=[0,-$3.z,$3.y,0,-G3.z,G3.y,0,-bO.z,bO.y,$3.z,0,-$3.x,G3.z,0,-G3.x,bO.z,0,-bO.x,-$3.y,$3.x,0,-G3.y,G3.x,0,-bO.y,bO.x,0];if(!BUe(n,F9,N9,O9,ube)){return false}n=[1,0,0,0,1,0,0,0,1];if(!BUe(n,F9,N9,O9,ube)){return false}dbe.crossVectors($3,G3);n=[dbe.x,dbe.y,dbe.z];return BUe(n,F9,N9,O9,ube)}clampPoint(t,n){return n.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,KT).distanceTo(t)}getBoundingSphere(t){if(this.isEmpty()){t.makeEmpty()}else{this.getCenter(t.center);t.radius=this.getSize(KT).length()*.5}return t}intersect(t){this.min.max(t.min);this.max.min(t.max);if(this.isEmpty())this.makeEmpty();return this}union(t){this.min.min(t.min);this.max.max(t.max);return this}applyMatrix4(t){if(this.isEmpty())return this;wk[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t);wk[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t);wk[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t);wk[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t);wk[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t);wk[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t);wk[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t);wk[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t);this.setFromPoints(wk);return this}translate(t){this.min.add(t);this.max.add(t);return this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(t){this.min.fromArray(t.min);this.max.fromArray(t.max);return this}};var wk=[new gr,new gr,new gr,new gr,new gr,new gr,new gr,new gr];var KT=new gr;var cbe=new a_;var F9=new gr;var N9=new gr;var O9=new gr;var $3=new gr;var G3=new gr;var bO=new gr;var VK=new gr;var ube=new gr;var dbe=new gr;var xO=new gr;function BUe(e,t,n,r,i){for(let o=0,a=e.length-3;o<=a;o+=3){xO.fromArray(e,o);const s=i.x*Math.abs(xO.x)+i.y*Math.abs(xO.y)+i.z*Math.abs(xO.z);const l=t.dot(xO);const u=n.dot(xO);const d=r.dot(xO);if(Math.max(-Math.max(l,u,d),Math.min(l,u,d))>s){return false}}return true}var O6r=new a_;var $K=new gr;var zUe=new gr;var AO=class{constructor(t=new gr,n=-1){this.isSphere=true;this.center=t;this.radius=n}set(t,n){this.center.copy(t);this.radius=n;return this}setFromPoints(t,n){const r=this.center;if(n!==void 0){r.copy(n)}else{O6r.setFromPoints(t).getCenter(r)}let i=0;for(let o=0,a=t.length;othis.radius*this.radius){n.sub(this.center).normalize();n.multiplyScalar(this.radius).add(this.center)}return n}getBoundingBox(t){if(this.isEmpty()){t.makeEmpty();return t}t.set(this.center,this.center);t.expandByScalar(this.radius);return t}applyMatrix4(t){this.center.applyMatrix4(t);this.radius=this.radius*t.getMaxScaleOnAxis();return this}translate(t){this.center.add(t);return this}expandByPoint(t){if(this.isEmpty()){this.center.copy(t);this.radius=0;return this}$K.subVectors(t,this.center);const n=$K.lengthSq();if(n>this.radius*this.radius){const r=Math.sqrt(n);const i=(r-this.radius)*.5;this.center.addScaledVector($K,i/r);this.radius+=i}return this}union(t){if(t.isEmpty()){return this}if(this.isEmpty()){this.copy(t);return this}if(this.center.equals(t.center)===true){this.radius=Math.max(this.radius,t.radius)}else{zUe.subVectors(t.center,this.center).setLength(t.radius);this.expandByPoint($K.copy(t.center).add(zUe));this.expandByPoint($K.copy(t.center).sub(zUe))}return this}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(t){this.radius=t.radius;this.center.fromArray(t.center);return this}};var Ek=new gr;var UUe=new gr;var fbe=new gr;var H3=new gr;var VUe=new gr;var hbe=new gr;var $Ue=new gr;var nZ=class{constructor(t=new gr,n=new gr(0,0,-1)){this.origin=t;this.direction=n}set(t,n){this.origin.copy(t);this.direction.copy(n);return this}copy(t){this.origin.copy(t.origin);this.direction.copy(t.direction);return this}at(t,n){return n.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){this.direction.copy(t).sub(this.origin).normalize();return this}recast(t){this.origin.copy(this.at(t,Ek));return this}closestPointToPoint(t,n){n.subVectors(t,this.origin);const r=n.dot(this.direction);if(r<0){return n.copy(this.origin)}return n.copy(this.origin).addScaledVector(this.direction,r)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const n=Ek.subVectors(t,this.origin).dot(this.direction);if(n<0){return this.origin.distanceToSquared(t)}Ek.copy(this.origin).addScaledVector(this.direction,n);return Ek.distanceToSquared(t)}distanceSqToSegment(t,n,r,i){UUe.copy(t).add(n).multiplyScalar(.5);fbe.copy(n).sub(t).normalize();H3.copy(this.origin).sub(UUe);const o=t.distanceTo(n)*.5;const a=-this.direction.dot(fbe);const s=H3.dot(this.direction);const l=-H3.dot(fbe);const u=H3.lengthSq();const d=Math.abs(1-a*a);let f,h,m,g;if(d>0){f=a*l-s;h=a*s-l;g=o*d;if(f>=0){if(h>=-g){if(h<=g){const x=1/d;f*=x;h*=x;m=f*(f+a*h+2*s)+h*(a*f+h+2*l)+u}else{h=o;f=Math.max(0,-(a*h+s));m=-f*f+h*(h+2*l)+u}}else{h=-o;f=Math.max(0,-(a*h+s));m=-f*f+h*(h+2*l)+u}}else{if(h<=-g){f=Math.max(0,-(-a*o+s));h=f>0?-o:Math.min(Math.max(-o,-l),o);m=-f*f+h*(h+2*l)+u}else if(h<=g){f=0;h=Math.min(Math.max(-o,-l),o);m=h*(h+2*l)+u}else{f=Math.max(0,-(a*o+s));h=f>0?o:Math.min(Math.max(-o,-l),o);m=-f*f+h*(h+2*l)+u}}}else{h=a>0?-o:o;f=Math.max(0,-(a*h+s));m=-f*f+h*(h+2*l)+u}if(r){r.copy(this.origin).addScaledVector(this.direction,f)}if(i){i.copy(UUe).addScaledVector(fbe,h)}return m}intersectSphere(t,n){Ek.subVectors(t.center,this.origin);const r=Ek.dot(this.direction);const i=Ek.dot(Ek)-r*r;const o=t.radius*t.radius;if(i>o)return null;const a=Math.sqrt(o-i);const s=r-a;const l=r+a;if(l<0)return null;if(s<0)return this.at(l,n);return this.at(s,n)}intersectsSphere(t){if(t.radius<0)return false;return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const n=t.normal.dot(this.direction);if(n===0){if(t.distanceToPoint(this.origin)===0){return 0}return null}const r=-(this.origin.dot(t.normal)+t.constant)/n;return r>=0?r:null}intersectPlane(t,n){const r=this.distanceToPlane(t);if(r===null){return null}return this.at(r,n)}intersectsPlane(t){const n=t.distanceToPoint(this.origin);if(n===0){return true}const r=t.normal.dot(this.direction);if(r*n<0){return true}return false}intersectBox(t,n){let r,i,o,a,s,l;const u=1/this.direction.x,d=1/this.direction.y,f=1/this.direction.z;const h=this.origin;if(u>=0){r=(t.min.x-h.x)*u;i=(t.max.x-h.x)*u}else{r=(t.max.x-h.x)*u;i=(t.min.x-h.x)*u}if(d>=0){o=(t.min.y-h.y)*d;a=(t.max.y-h.y)*d}else{o=(t.max.y-h.y)*d;a=(t.min.y-h.y)*d}if(r>a||o>i)return null;if(o>r||isNaN(r))r=o;if(a=0){s=(t.min.z-h.z)*f;l=(t.max.z-h.z)*f}else{s=(t.max.z-h.z)*f;l=(t.min.z-h.z)*f}if(r>l||s>i)return null;if(s>r||r!==r)r=s;if(l=0?r:i,n)}intersectsBox(t){return this.intersectBox(t,Ek)!==null}intersectTriangle(t,n,r,i,o){VUe.subVectors(n,t);hbe.subVectors(r,t);$Ue.crossVectors(VUe,hbe);let a=this.direction.dot($Ue);let s;if(a>0){if(i)return null;s=1}else if(a<0){s=-1;a=-a}else{return null}H3.subVectors(this.origin,t);const l=s*this.direction.dot(hbe.crossVectors(H3,hbe));if(l<0){return null}const u=s*this.direction.dot(VUe.cross(H3));if(u<0){return null}if(l+u>a){return null}const d=-s*H3.dot($Ue);if(d<0){return null}return this.at(d/a,o)}applyMatrix4(t){this.origin.applyMatrix4(t);this.direction.transformDirection(t);return this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}};var vf=class e{constructor(t,n,r,i,o,a,s,l,u,d,f,h,m,g,x,w){e.prototype.isMatrix4=true;this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];if(t!==void 0){this.set(t,n,r,i,o,a,s,l,u,d,f,h,m,g,x,w)}}set(t,n,r,i,o,a,s,l,u,d,f,h,m,g,x,w){const _=this.elements;_[0]=t;_[4]=n;_[8]=r;_[12]=i;_[1]=o;_[5]=a;_[9]=s;_[13]=l;_[2]=u;_[6]=d;_[10]=f;_[14]=h;_[3]=m;_[7]=g;_[11]=x;_[15]=w;return this}identity(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this}clone(){return new e().fromArray(this.elements)}copy(t){const n=this.elements;const r=t.elements;n[0]=r[0];n[1]=r[1];n[2]=r[2];n[3]=r[3];n[4]=r[4];n[5]=r[5];n[6]=r[6];n[7]=r[7];n[8]=r[8];n[9]=r[9];n[10]=r[10];n[11]=r[11];n[12]=r[12];n[13]=r[13];n[14]=r[14];n[15]=r[15];return this}copyPosition(t){const n=this.elements,r=t.elements;n[12]=r[12];n[13]=r[13];n[14]=r[14];return this}setFromMatrix3(t){const n=t.elements;this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1);return this}extractBasis(t,n,r){t.setFromMatrixColumn(this,0);n.setFromMatrixColumn(this,1);r.setFromMatrixColumn(this,2);return this}makeBasis(t,n,r){this.set(t.x,n.x,r.x,0,t.y,n.y,r.y,0,t.z,n.z,r.z,0,0,0,0,1);return this}extractRotation(t){const n=this.elements;const r=t.elements;const i=1/B9.setFromMatrixColumn(t,0).length();const o=1/B9.setFromMatrixColumn(t,1).length();const a=1/B9.setFromMatrixColumn(t,2).length();n[0]=r[0]*i;n[1]=r[1]*i;n[2]=r[2]*i;n[3]=0;n[4]=r[4]*o;n[5]=r[5]*o;n[6]=r[6]*o;n[7]=0;n[8]=r[8]*a;n[9]=r[9]*a;n[10]=r[10]*a;n[11]=0;n[12]=0;n[13]=0;n[14]=0;n[15]=1;return this}makeRotationFromEuler(t){const n=this.elements;const r=t.x,i=t.y,o=t.z;const a=Math.cos(r),s=Math.sin(r);const l=Math.cos(i),u=Math.sin(i);const d=Math.cos(o),f=Math.sin(o);if(t.order==="XYZ"){const h=a*d,m=a*f,g=s*d,x=s*f;n[0]=l*d;n[4]=-l*f;n[8]=u;n[1]=m+g*u;n[5]=h-x*u;n[9]=-s*l;n[2]=x-h*u;n[6]=g+m*u;n[10]=a*l}else if(t.order==="YXZ"){const h=l*d,m=l*f,g=u*d,x=u*f;n[0]=h+x*s;n[4]=g*s-m;n[8]=a*u;n[1]=a*f;n[5]=a*d;n[9]=-s;n[2]=m*s-g;n[6]=x+h*s;n[10]=a*l}else if(t.order==="ZXY"){const h=l*d,m=l*f,g=u*d,x=u*f;n[0]=h-x*s;n[4]=-a*f;n[8]=g+m*s;n[1]=m+g*s;n[5]=a*d;n[9]=x-h*s;n[2]=-a*u;n[6]=s;n[10]=a*l}else if(t.order==="ZYX"){const h=a*d,m=a*f,g=s*d,x=s*f;n[0]=l*d;n[4]=g*u-m;n[8]=h*u+x;n[1]=l*f;n[5]=x*u+h;n[9]=m*u-g;n[2]=-u;n[6]=s*l;n[10]=a*l}else if(t.order==="YZX"){const h=a*l,m=a*u,g=s*l,x=s*u;n[0]=l*d;n[4]=x-h*f;n[8]=g*f+m;n[1]=f;n[5]=a*d;n[9]=-s*d;n[2]=-u*d;n[6]=m*f+g;n[10]=h-x*f}else if(t.order==="XZY"){const h=a*l,m=a*u,g=s*l,x=s*u;n[0]=l*d;n[4]=-f;n[8]=u*d;n[1]=h*f+x;n[5]=a*d;n[9]=m*f-g;n[2]=g*f-m;n[6]=s*d;n[10]=x*f+h}n[3]=0;n[7]=0;n[11]=0;n[12]=0;n[13]=0;n[14]=0;n[15]=1;return this}makeRotationFromQuaternion(t){return this.compose(B6r,t,z6r)}lookAt(t,n,r){const i=this.elements;L1.subVectors(t,n);if(L1.lengthSq()===0){L1.z=1}L1.normalize();W3.crossVectors(r,L1);if(W3.lengthSq()===0){if(Math.abs(r.z)===1){L1.x+=1e-4}else{L1.z+=1e-4}L1.normalize();W3.crossVectors(r,L1)}W3.normalize();pbe.crossVectors(L1,W3);i[0]=W3.x;i[4]=pbe.x;i[8]=L1.x;i[1]=W3.y;i[5]=pbe.y;i[9]=L1.y;i[2]=W3.z;i[6]=pbe.z;i[10]=L1.z;return this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,n){const r=t.elements;const i=n.elements;const o=this.elements;const a=r[0],s=r[4],l=r[8],u=r[12];const d=r[1],f=r[5],h=r[9],m=r[13];const g=r[2],x=r[6],w=r[10],_=r[14];const C=r[3],A=r[7],P=r[11],L=r[15];const I=i[0],N=i[4],O=i[8],z=i[12];const U=i[1],W=i[5],H=i[9],$=i[13];const K=i[2],X=i[6],j=i[10],te=i[14];const J=i[3],oe=i[7],se=i[11],re=i[15];o[0]=a*I+s*U+l*K+u*J;o[4]=a*N+s*W+l*X+u*oe;o[8]=a*O+s*H+l*j+u*se;o[12]=a*z+s*$+l*te+u*re;o[1]=d*I+f*U+h*K+m*J;o[5]=d*N+f*W+h*X+m*oe;o[9]=d*O+f*H+h*j+m*se;o[13]=d*z+f*$+h*te+m*re;o[2]=g*I+x*U+w*K+_*J;o[6]=g*N+x*W+w*X+_*oe;o[10]=g*O+x*H+w*j+_*se;o[14]=g*z+x*$+w*te+_*re;o[3]=C*I+A*U+P*K+L*J;o[7]=C*N+A*W+P*X+L*oe;o[11]=C*O+A*H+P*j+L*se;o[15]=C*z+A*$+P*te+L*re;return this}multiplyScalar(t){const n=this.elements;n[0]*=t;n[4]*=t;n[8]*=t;n[12]*=t;n[1]*=t;n[5]*=t;n[9]*=t;n[13]*=t;n[2]*=t;n[6]*=t;n[10]*=t;n[14]*=t;n[3]*=t;n[7]*=t;n[11]*=t;n[15]*=t;return this}determinant(){const t=this.elements;const n=t[0],r=t[4],i=t[8],o=t[12];const a=t[1],s=t[5],l=t[9],u=t[13];const d=t[2],f=t[6],h=t[10],m=t[14];const g=t[3],x=t[7],w=t[11],_=t[15];return g*(+o*l*f-i*u*f-o*s*h+r*u*h+i*s*m-r*l*m)+x*(+n*l*m-n*u*h+o*a*h-i*a*m+i*u*d-o*l*d)+w*(+n*u*f-n*s*m-o*a*f+r*a*m+o*s*d-r*u*d)+_*(-i*s*d-n*l*f+n*s*h+i*a*f-r*a*h+r*l*d)}transpose(){const t=this.elements;let n;n=t[1];t[1]=t[4];t[4]=n;n=t[2];t[2]=t[8];t[8]=n;n=t[6];t[6]=t[9];t[9]=n;n=t[3];t[3]=t[12];t[12]=n;n=t[7];t[7]=t[13];t[13]=n;n=t[11];t[11]=t[14];t[14]=n;return this}setPosition(t,n,r){const i=this.elements;if(t.isVector3){i[12]=t.x;i[13]=t.y;i[14]=t.z}else{i[12]=t;i[13]=n;i[14]=r}return this}invert(){const t=this.elements,n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],u=t[7],d=t[8],f=t[9],h=t[10],m=t[11],g=t[12],x=t[13],w=t[14],_=t[15],C=f*w*u-x*h*u+x*l*m-s*w*m-f*l*_+s*h*_,A=g*h*u-d*w*u-g*l*m+a*w*m+d*l*_-a*h*_,P=d*x*u-g*f*u+g*s*m-a*x*m-d*s*_+a*f*_,L=g*f*l-d*x*l-g*s*h+a*x*h+d*s*w-a*f*w;const I=n*C+r*A+i*P+o*L;if(I===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const N=1/I;t[0]=C*N;t[1]=(x*h*o-f*w*o-x*i*m+r*w*m+f*i*_-r*h*_)*N;t[2]=(s*w*o-x*l*o+x*i*u-r*w*u-s*i*_+r*l*_)*N;t[3]=(f*l*o-s*h*o-f*i*u+r*h*u+s*i*m-r*l*m)*N;t[4]=A*N;t[5]=(d*w*o-g*h*o+g*i*m-n*w*m-d*i*_+n*h*_)*N;t[6]=(g*l*o-a*w*o-g*i*u+n*w*u+a*i*_-n*l*_)*N;t[7]=(a*h*o-d*l*o+d*i*u-n*h*u-a*i*m+n*l*m)*N;t[8]=P*N;t[9]=(g*f*o-d*x*o-g*r*m+n*x*m+d*r*_-n*f*_)*N;t[10]=(a*x*o-g*s*o+g*r*u-n*x*u-a*r*_+n*s*_)*N;t[11]=(d*s*o-a*f*o-d*r*u+n*f*u+a*r*m-n*s*m)*N;t[12]=L*N;t[13]=(d*x*i-g*f*i+g*r*h-n*x*h-d*r*w+n*f*w)*N;t[14]=(g*s*i-a*x*i-g*r*l+n*x*l+a*r*w-n*s*w)*N;t[15]=(a*f*i-d*s*i+d*r*l-n*f*l-a*r*h+n*s*h)*N;return this}scale(t){const n=this.elements;const r=t.x,i=t.y,o=t.z;n[0]*=r;n[4]*=i;n[8]*=o;n[1]*=r;n[5]*=i;n[9]*=o;n[2]*=r;n[6]*=i;n[10]*=o;n[3]*=r;n[7]*=i;n[11]*=o;return this}getMaxScaleOnAxis(){const t=this.elements;const n=t[0]*t[0]+t[1]*t[1]+t[2]*t[2];const r=t[4]*t[4]+t[5]*t[5]+t[6]*t[6];const i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(n,r,i))}makeTranslation(t,n,r){if(t.isVector3){this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1)}else{this.set(1,0,0,t,0,1,0,n,0,0,1,r,0,0,0,1)}return this}makeRotationX(t){const n=Math.cos(t),r=Math.sin(t);this.set(1,0,0,0,0,n,-r,0,0,r,n,0,0,0,0,1);return this}makeRotationY(t){const n=Math.cos(t),r=Math.sin(t);this.set(n,0,r,0,0,1,0,0,-r,0,n,0,0,0,0,1);return this}makeRotationZ(t){const n=Math.cos(t),r=Math.sin(t);this.set(n,-r,0,0,r,n,0,0,0,0,1,0,0,0,0,1);return this}makeRotationAxis(t,n){const r=Math.cos(n);const i=Math.sin(n);const o=1-r;const a=t.x,s=t.y,l=t.z;const u=o*a,d=o*s;this.set(u*a+r,u*s-i*l,u*l+i*s,0,u*s+i*l,d*s+r,d*l-i*a,0,u*l-i*s,d*l+i*a,o*l*l+r,0,0,0,0,1);return this}makeScale(t,n,r){this.set(t,0,0,0,0,n,0,0,0,0,r,0,0,0,0,1);return this}makeShear(t,n,r,i,o,a){this.set(1,r,o,0,t,1,a,0,n,i,1,0,0,0,0,1);return this}compose(t,n,r){const i=this.elements;const o=n._x,a=n._y,s=n._z,l=n._w;const u=o+o,d=a+a,f=s+s;const h=o*u,m=o*d,g=o*f;const x=a*d,w=a*f,_=s*f;const C=l*u,A=l*d,P=l*f;const L=r.x,I=r.y,N=r.z;i[0]=(1-(x+_))*L;i[1]=(m+P)*L;i[2]=(g-A)*L;i[3]=0;i[4]=(m-P)*I;i[5]=(1-(h+_))*I;i[6]=(w+C)*I;i[7]=0;i[8]=(g+A)*N;i[9]=(w-C)*N;i[10]=(1-(h+x))*N;i[11]=0;i[12]=t.x;i[13]=t.y;i[14]=t.z;i[15]=1;return this}decompose(t,n,r){const i=this.elements;let o=B9.set(i[0],i[1],i[2]).length();const a=B9.set(i[4],i[5],i[6]).length();const s=B9.set(i[8],i[9],i[10]).length();const l=this.determinant();if(l<0)o=-o;t.x=i[12];t.y=i[13];t.z=i[14];ZT.copy(this);const u=1/o;const d=1/a;const f=1/s;ZT.elements[0]*=u;ZT.elements[1]*=u;ZT.elements[2]*=u;ZT.elements[4]*=d;ZT.elements[5]*=d;ZT.elements[6]*=d;ZT.elements[8]*=f;ZT.elements[9]*=f;ZT.elements[10]*=f;n.setFromRotationMatrix(ZT);r.x=o;r.y=a;r.z=s;return this}makePerspective(t,n,r,i,o,a,s=ew,l=false){const u=this.elements;const d=2*o/(n-t);const f=2*o/(r-i);const h=(n+t)/(n-t);const m=(r+i)/(r-i);let g,x;if(l){g=o/(a-o);x=a*o/(a-o)}else{if(s===ew){g=-(a+o)/(a-o);x=-2*a*o/(a-o)}else if(s===QK){g=-a/(a-o);x=-a*o/(a-o)}else{throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+s)}}u[0]=d;u[4]=0;u[8]=h;u[12]=0;u[1]=0;u[5]=f;u[9]=m;u[13]=0;u[2]=0;u[6]=0;u[10]=g;u[14]=x;u[3]=0;u[7]=0;u[11]=-1;u[15]=0;return this}makeOrthographic(t,n,r,i,o,a,s=ew,l=false){const u=this.elements;const d=2/(n-t);const f=2/(r-i);const h=-(n+t)/(n-t);const m=-(r+i)/(r-i);let g,x;if(l){g=1/(a-o);x=a/(a-o)}else{if(s===ew){g=-2/(a-o);x=-(a+o)/(a-o)}else if(s===QK){g=-1/(a-o);x=-o/(a-o)}else{throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+s)}}u[0]=d;u[4]=0;u[8]=0;u[12]=h;u[1]=0;u[5]=f;u[9]=0;u[13]=m;u[2]=0;u[6]=0;u[10]=g;u[14]=x;u[3]=0;u[7]=0;u[11]=0;u[15]=1;return this}equals(t){const n=this.elements;const r=t.elements;for(let i=0;i<16;i++){if(n[i]!==r[i])return false}return true}fromArray(t,n=0){for(let r=0;r<16;r++){this.elements[r]=t[r+n]}return this}toArray(t=[],n=0){const r=this.elements;t[n]=r[0];t[n+1]=r[1];t[n+2]=r[2];t[n+3]=r[3];t[n+4]=r[4];t[n+5]=r[5];t[n+6]=r[6];t[n+7]=r[7];t[n+8]=r[8];t[n+9]=r[9];t[n+10]=r[10];t[n+11]=r[11];t[n+12]=r[12];t[n+13]=r[13];t[n+14]=r[14];t[n+15]=r[15];return t}};var B9=new gr;var ZT=new vf;var B6r=new gr(0,0,0);var z6r=new gr(1,1,1);var W3=new gr;var pbe=new gr;var L1=new gr;var h9t=new vf;var p9t=new Lk;var nw=class e{constructor(t=0,n=0,r=0,i=e.DEFAULT_ORDER){this.isEuler=true;this._x=t;this._y=n;this._z=r;this._order=i}get x(){return this._x}set x(t){this._x=t;this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t;this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t;this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t;this._onChangeCallback()}set(t,n,r,i=this._order){this._x=t;this._y=n;this._z=r;this._order=i;this._onChangeCallback();return this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){this._x=t._x;this._y=t._y;this._z=t._z;this._order=t._order;this._onChangeCallback();return this}setFromRotationMatrix(t,n=this._order,r=true){const i=t.elements;const o=i[0],a=i[4],s=i[8];const l=i[1],u=i[5],d=i[9];const f=i[2],h=i[6],m=i[10];switch(n){case"XYZ":this._y=Math.asin(Ml(s,-1,1));if(Math.abs(s)<.9999999){this._x=Math.atan2(-d,m);this._z=Math.atan2(-a,o)}else{this._x=Math.atan2(h,u);this._z=0}break;case"YXZ":this._x=Math.asin(-Ml(d,-1,1));if(Math.abs(d)<.9999999){this._y=Math.atan2(s,m);this._z=Math.atan2(l,u)}else{this._y=Math.atan2(-f,o);this._z=0}break;case"ZXY":this._x=Math.asin(Ml(h,-1,1));if(Math.abs(h)<.9999999){this._y=Math.atan2(-f,m);this._z=Math.atan2(-a,u)}else{this._y=0;this._z=Math.atan2(l,o)}break;case"ZYX":this._y=Math.asin(-Ml(f,-1,1));if(Math.abs(f)<.9999999){this._x=Math.atan2(h,m);this._z=Math.atan2(l,o)}else{this._x=0;this._z=Math.atan2(-a,u)}break;case"YZX":this._z=Math.asin(Ml(l,-1,1));if(Math.abs(l)<.9999999){this._x=Math.atan2(-d,u);this._y=Math.atan2(-f,o)}else{this._x=0;this._y=Math.atan2(s,m)}break;case"XZY":this._z=Math.asin(-Ml(a,-1,1));if(Math.abs(a)<.9999999){this._x=Math.atan2(h,u);this._y=Math.atan2(s,o)}else{this._x=Math.atan2(-d,m);this._y=0}break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}this._order=n;if(r===true)this._onChangeCallback();return this}setFromQuaternion(t,n,r){h9t.makeRotationFromQuaternion(t);return this.setFromRotationMatrix(h9t,n,r)}setFromVector3(t,n=this._order){return this.set(t.x,t.y,t.z,n)}reorder(t){p9t.setFromEuler(this);return this.setFromQuaternion(p9t,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){this._x=t[0];this._y=t[1];this._z=t[2];if(t[3]!==void 0)this._order=t[3];this._onChangeCallback();return this}toArray(t=[],n=0){t[n]=this._x;t[n+1]=this._y;t[n+2]=this._z;t[n+3]=this._order;return t}_onChange(t){this._onChangeCallback=t;return this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x;yield this._y;yield this._z;yield this._order}};nw.DEFAULT_ORDER="XYZ";var rZ=class{constructor(){this.mask=1|0}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<1){for(let n=0;n1){for(let r=0;r0)i.userData=this.userData;i.layers=this.layers.mask;i.matrix=this.matrix.toArray();i.up=this.up.toArray();if(this.matrixAutoUpdate===false)i.matrixAutoUpdate=false;if(this.isInstancedMesh){i.type="InstancedMesh";i.count=this.count;i.instanceMatrix=this.instanceMatrix.toJSON();if(this.instanceColor!==null)i.instanceColor=this.instanceColor.toJSON()}if(this.isBatchedMesh){i.type="BatchedMesh";i.perObjectFrustumCulled=this.perObjectFrustumCulled;i.sortObjects=this.sortObjects;i.drawRanges=this._drawRanges;i.reservedRanges=this._reservedRanges;i.geometryInfo=this._geometryInfo.map(s=>({...s,boundingBox:s.boundingBox?s.boundingBox.toJSON():void 0,boundingSphere:s.boundingSphere?s.boundingSphere.toJSON():void 0}));i.instanceInfo=this._instanceInfo.map(s=>({...s}));i.availableInstanceIds=this._availableInstanceIds.slice();i.availableGeometryIds=this._availableGeometryIds.slice();i.nextIndexStart=this._nextIndexStart;i.nextVertexStart=this._nextVertexStart;i.geometryCount=this._geometryCount;i.maxInstanceCount=this._maxInstanceCount;i.maxVertexCount=this._maxVertexCount;i.maxIndexCount=this._maxIndexCount;i.geometryInitialized=this._geometryInitialized;i.matricesTexture=this._matricesTexture.toJSON(t);i.indirectTexture=this._indirectTexture.toJSON(t);if(this._colorsTexture!==null){i.colorsTexture=this._colorsTexture.toJSON(t)}if(this.boundingSphere!==null){i.boundingSphere=this.boundingSphere.toJSON()}if(this.boundingBox!==null){i.boundingBox=this.boundingBox.toJSON()}}function o(s,l){if(s[l.uuid]===void 0){s[l.uuid]=l.toJSON(t)}return l.uuid}if(this.isScene){if(this.background){if(this.background.isColor){i.background=this.background.toJSON()}else if(this.background.isTexture){i.background=this.background.toJSON(t).uuid}}if(this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==true){i.environment=this.environment.toJSON(t).uuid}}else if(this.isMesh||this.isLine||this.isPoints){i.geometry=o(t.geometries,this.geometry);const s=this.geometry.parameters;if(s!==void 0&&s.shapes!==void 0){const l=s.shapes;if(Array.isArray(l)){for(let u=0,d=l.length;u0){i.children=[];for(let s=0;s0){i.animations=[];for(let s=0;s0)r.geometries=s;if(l.length>0)r.materials=l;if(u.length>0)r.textures=u;if(d.length>0)r.images=d;if(f.length>0)r.shapes=f;if(h.length>0)r.skeletons=h;if(m.length>0)r.animations=m;if(g.length>0)r.nodes=g}r.object=i;return r;function a(s){const l=[];for(const u in s){const d=s[u];delete d.metadata;l.push(d)}return l}}clone(t){return new this.constructor().copy(this,t)}copy(t,n=true){this.name=t.name;this.up.copy(t.up);this.position.copy(t.position);this.rotation.order=t.rotation.order;this.quaternion.copy(t.quaternion);this.scale.copy(t.scale);this.matrix.copy(t.matrix);this.matrixWorld.copy(t.matrixWorld);this.matrixAutoUpdate=t.matrixAutoUpdate;this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate;this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate;this.layers.mask=t.layers.mask;this.visible=t.visible;this.castShadow=t.castShadow;this.receiveShadow=t.receiveShadow;this.frustumCulled=t.frustumCulled;this.renderOrder=t.renderOrder;this.animations=t.animations.slice();this.userData=JSON.parse(JSON.stringify(t.userData));if(n===true){for(let r=0;r0){return i.multiplyScalar(1/Math.sqrt(o))}return i.set(0,0,0)}static getBarycoord(t,n,r,i,o){JT.subVectors(i,n);Sk.subVectors(r,n);HUe.subVectors(t,n);const a=JT.dot(JT);const s=JT.dot(Sk);const l=JT.dot(HUe);const u=Sk.dot(Sk);const d=Sk.dot(HUe);const f=a*u-s*s;if(f===0){o.set(0,0,0);return null}const h=1/f;const m=(u*l-s*d)*h;const g=(a*d-s*l)*h;return o.set(1-m-g,g,m)}static containsPoint(t,n,r,i){if(this.getBarycoord(t,n,r,i,Ak)===null){return false}return Ak.x>=0&&Ak.y>=0&&Ak.x+Ak.y<=1}static getInterpolation(t,n,r,i,o,a,s,l){if(this.getBarycoord(t,n,r,i,Ak)===null){l.x=0;l.y=0;if("z"in l)l.z=0;if("w"in l)l.w=0;return null}l.setScalar(0);l.addScaledVector(o,Ak.x);l.addScaledVector(a,Ak.y);l.addScaledVector(s,Ak.z);return l}static getInterpolatedAttribute(t,n,r,i,o,a){XUe.setScalar(0);jUe.setScalar(0);KUe.setScalar(0);XUe.fromBufferAttribute(t,n);jUe.fromBufferAttribute(t,r);KUe.fromBufferAttribute(t,i);a.setScalar(0);a.addScaledVector(XUe,o.x);a.addScaledVector(jUe,o.y);a.addScaledVector(KUe,o.z);return a}static isFrontFacing(t,n,r,i){JT.subVectors(r,n);Sk.subVectors(t,n);return JT.cross(Sk).dot(i)<0?true:false}set(t,n,r){this.a.copy(t);this.b.copy(n);this.c.copy(r);return this}setFromPointsAndIndices(t,n,r,i){this.a.copy(t[n]);this.b.copy(t[r]);this.c.copy(t[i]);return this}setFromAttributeAndIndices(t,n,r,i){this.a.fromBufferAttribute(t,n);this.b.fromBufferAttribute(t,r);this.c.fromBufferAttribute(t,i);return this}clone(){return new this.constructor().copy(this)}copy(t){this.a.copy(t.a);this.b.copy(t.b);this.c.copy(t.c);return this}getArea(){JT.subVectors(this.c,this.b);Sk.subVectors(this.a,this.b);return JT.cross(Sk).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return e.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,n){return e.getBarycoord(t,this.a,this.b,this.c,n)}getInterpolation(t,n,r,i,o){return e.getInterpolation(t,this.a,this.b,this.c,n,r,i,o)}containsPoint(t){return e.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return e.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,n){const r=this.a,i=this.b,o=this.c;let a,s;V9.subVectors(i,r);$9.subVectors(o,r);WUe.subVectors(t,r);const l=V9.dot(WUe);const u=$9.dot(WUe);if(l<=0&&u<=0){return n.copy(r)}YUe.subVectors(t,i);const d=V9.dot(YUe);const f=$9.dot(YUe);if(d>=0&&f<=d){return n.copy(i)}const h=l*f-d*u;if(h<=0&&l>=0&&d<=0){a=l/(l-d);return n.copy(r).addScaledVector(V9,a)}qUe.subVectors(t,o);const m=V9.dot(qUe);const g=$9.dot(qUe);if(g>=0&&m<=g){return n.copy(o)}const x=m*u-l*g;if(x<=0&&u>=0&&g<=0){s=u/(u-g);return n.copy(r).addScaledVector($9,s)}const w=d*g-m*f;if(w<=0&&f-d>=0&&m-g>=0){v9t.subVectors(o,i);s=(f-d)/(f-d+(m-g));return n.copy(i).addScaledVector(v9t,s)}const _=1/(w+x+h);a=x*_;s=h*_;return n.copy(r).addScaledVector(V9,a).addScaledVector($9,s)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}};var vUt={"aliceblue":15792383,"antiquewhite":16444375,"aqua":65535,"aquamarine":8388564,"azure":15794175,"beige":16119260,"bisque":16770244,"black":0,"blanchedalmond":16772045,"blue":255,"blueviolet":9055202,"brown":10824234,"burlywood":14596231,"cadetblue":6266528,"chartreuse":8388352,"chocolate":13789470,"coral":16744272,"cornflowerblue":6591981,"cornsilk":16775388,"crimson":14423100,"cyan":65535,"darkblue":139,"darkcyan":35723,"darkgoldenrod":12092939,"darkgray":11119017,"darkgreen":25600,"darkgrey":11119017,"darkkhaki":12433259,"darkmagenta":9109643,"darkolivegreen":5597999,"darkorange":16747520,"darkorchid":10040012,"darkred":9109504,"darksalmon":15308410,"darkseagreen":9419919,"darkslateblue":4734347,"darkslategray":3100495,"darkslategrey":3100495,"darkturquoise":52945,"darkviolet":9699539,"deeppink":16716947,"deepskyblue":49151,"dimgray":6908265,"dimgrey":6908265,"dodgerblue":2003199,"firebrick":11674146,"floralwhite":16775920,"forestgreen":2263842,"fuchsia":16711935,"gainsboro":14474460,"ghostwhite":16316671,"gold":16766720,"goldenrod":14329120,"gray":8421504,"green":32768,"greenyellow":11403055,"grey":8421504,"honeydew":15794160,"hotpink":16738740,"indianred":13458524,"indigo":4915330,"ivory":16777200,"khaki":15787660,"lavender":15132410,"lavenderblush":16773365,"lawngreen":8190976,"lemonchiffon":16775885,"lightblue":11393254,"lightcoral":15761536,"lightcyan":14745599,"lightgoldenrodyellow":16448210,"lightgray":13882323,"lightgreen":9498256,"lightgrey":13882323,"lightpink":16758465,"lightsalmon":16752762,"lightseagreen":2142890,"lightskyblue":8900346,"lightslategray":7833753,"lightslategrey":7833753,"lightsteelblue":11584734,"lightyellow":16777184,"lime":65280,"limegreen":3329330,"linen":16445670,"magenta":16711935,"maroon":8388608,"mediumaquamarine":6737322,"mediumblue":205,"mediumorchid":12211667,"mediumpurple":9662683,"mediumseagreen":3978097,"mediumslateblue":8087790,"mediumspringgreen":64154,"mediumturquoise":4772300,"mediumvioletred":13047173,"midnightblue":1644912,"mintcream":16121850,"mistyrose":16770273,"moccasin":16770229,"navajowhite":16768685,"navy":128,"oldlace":16643558,"olive":8421376,"olivedrab":7048739,"orange":16753920,"orangered":16729344,"orchid":14315734,"palegoldenrod":15657130,"palegreen":10025880,"paleturquoise":11529966,"palevioletred":14381203,"papayawhip":16773077,"peachpuff":16767673,"peru":13468991,"pink":16761035,"plum":14524637,"powderblue":11591910,"purple":8388736,"rebeccapurple":6697881,"red":16711680,"rosybrown":12357519,"royalblue":4286945,"saddlebrown":9127187,"salmon":16416882,"sandybrown":16032864,"seagreen":3050327,"seashell":16774638,"sienna":10506797,"silver":12632256,"skyblue":8900331,"slateblue":6970061,"slategray":7372944,"slategrey":7372944,"snow":16775930,"springgreen":65407,"steelblue":4620980,"tan":13808780,"teal":32896,"thistle":14204888,"tomato":16737095,"turquoise":4251856,"violet":15631086,"wheat":16113331,"white":16777215,"whitesmoke":16119285,"yellow":16776960,"yellowgreen":10145074};var Y3={h:0,s:0,l:0};var gbe={h:0,s:0,l:0};function ZUe(e,t,n){if(n<0)n+=1;if(n>1)n-=1;if(n<1/6)return e+(t-e)*6*n;if(n<1/2)return t;if(n<2/3)return e+(t-e)*6*(2/3-n);return e}var ms=class{constructor(t,n,r){this.isColor=true;this.r=1;this.g=1;this.b=1;return this.set(t,n,r)}set(t,n,r){if(n===void 0&&r===void 0){const i=t;if(i&&i.isColor){this.copy(i)}else if(typeof i==="number"){this.setHex(i)}else if(typeof i==="string"){this.setStyle(i)}}else{this.setRGB(t,n,r)}return this}setScalar(t){this.r=t;this.g=t;this.b=t;return this}setHex(t,n=L0){t=Math.floor(t);this.r=(t>>16&255)/255;this.g=(t>>8&255)/255;this.b=(t&255)/255;dc.colorSpaceToWorking(this,n);return this}setRGB(t,n,r,i=dc.workingColorSpace){this.r=t;this.g=n;this.b=r;dc.colorSpaceToWorking(this,i);return this}setHSL(t,n,r,i=dc.workingColorSpace){t=RVe(t,1);n=Ml(n,0,1);r=Ml(r,0,1);if(n===0){this.r=this.g=this.b=r}else{const o=r<=.5?r*(1+n):r+n-r*n;const a=2*r-o;this.r=ZUe(a,o,t+1/3);this.g=ZUe(a,o,t);this.b=ZUe(a,o,t-1/3)}dc.colorSpaceToWorking(this,i);return this}setStyle(t,n=L0){function r(o){if(o===void 0)return;if(parseFloat(o)<1){console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(t)){let o;const a=i[1];const s=i[2];switch(a){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s)){r(o[4]);return this.setRGB(Math.min(255,parseInt(o[1],10))/255,Math.min(255,parseInt(o[2],10))/255,Math.min(255,parseInt(o[3],10))/255,n)}if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s)){r(o[4]);return this.setRGB(Math.min(100,parseInt(o[1],10))/100,Math.min(100,parseInt(o[2],10))/100,Math.min(100,parseInt(o[3],10))/100,n)}break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s)){r(o[4]);return this.setHSL(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,n)}break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){const o=i[1];const a=o.length;if(a===3){return this.setRGB(parseInt(o.charAt(0),16)/15,parseInt(o.charAt(1),16)/15,parseInt(o.charAt(2),16)/15,n)}else if(a===6){return this.setHex(parseInt(o,16),n)}else{console.warn("THREE.Color: Invalid hex color "+t)}}else if(t&&t.length>0){return this.setColorName(t,n)}return this}setColorName(t,n=L0){const r=vUt[t.toLowerCase()];if(r!==void 0){this.setHex(r,n)}else{console.warn("THREE.Color: Unknown color "+t)}return this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){this.r=t.r;this.g=t.g;this.b=t.b;return this}copySRGBToLinear(t){this.r=Pk(t.r);this.g=Pk(t.g);this.b=Pk(t.b);return this}copyLinearToSRGB(t){this.r=K9(t.r);this.g=K9(t.g);this.b=K9(t.b);return this}convertSRGBToLinear(){this.copySRGBToLinear(this);return this}convertLinearToSRGB(){this.copyLinearToSRGB(this);return this}getHex(t=L0){dc.workingToColorSpace(ky.copy(this),t);return Math.round(Ml(ky.r*255,0,255))*65536+Math.round(Ml(ky.g*255,0,255))*256+Math.round(Ml(ky.b*255,0,255))}getHexString(t=L0){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,n=dc.workingColorSpace){dc.workingToColorSpace(ky.copy(this),n);const r=ky.r,i=ky.g,o=ky.b;const a=Math.max(r,i,o);const s=Math.min(r,i,o);let l,u;const d=(s+a)/2;if(s===a){l=0;u=0}else{const f=a-s;u=d<=.5?f/(a+s):f/(2-a-s);switch(a){case r:l=(i-o)/f+(i0!==t>0){this.version++}this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t===void 0)return;for(const n in t){const r=t[n];if(r===void 0){console.warn(`THREE.Material: parameter '${n}' has value of undefined.`);continue}const i=this[n];if(i===void 0){console.warn(`THREE.Material: '${n}' is not a property of THREE.${this.type}.`);continue}if(i&&i.isColor){i.set(r)}else if(i&&i.isVector3&&(r&&r.isVector3)){i.copy(r)}else{this[n]=r}}}toJSON(t){const n=t===void 0||typeof t==="string";if(n){t={textures:{},images:{}}}const r={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};r.uuid=this.uuid;r.type=this.type;if(this.name!=="")r.name=this.name;if(this.color&&this.color.isColor)r.color=this.color.getHex();if(this.roughness!==void 0)r.roughness=this.roughness;if(this.metalness!==void 0)r.metalness=this.metalness;if(this.sheen!==void 0)r.sheen=this.sheen;if(this.sheenColor&&this.sheenColor.isColor)r.sheenColor=this.sheenColor.getHex();if(this.sheenRoughness!==void 0)r.sheenRoughness=this.sheenRoughness;if(this.emissive&&this.emissive.isColor)r.emissive=this.emissive.getHex();if(this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1)r.emissiveIntensity=this.emissiveIntensity;if(this.specular&&this.specular.isColor)r.specular=this.specular.getHex();if(this.specularIntensity!==void 0)r.specularIntensity=this.specularIntensity;if(this.specularColor&&this.specularColor.isColor)r.specularColor=this.specularColor.getHex();if(this.shininess!==void 0)r.shininess=this.shininess;if(this.clearcoat!==void 0)r.clearcoat=this.clearcoat;if(this.clearcoatRoughness!==void 0)r.clearcoatRoughness=this.clearcoatRoughness;if(this.clearcoatMap&&this.clearcoatMap.isTexture){r.clearcoatMap=this.clearcoatMap.toJSON(t).uuid}if(this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture){r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid}if(this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture){r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid;r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()}if(this.dispersion!==void 0)r.dispersion=this.dispersion;if(this.iridescence!==void 0)r.iridescence=this.iridescence;if(this.iridescenceIOR!==void 0)r.iridescenceIOR=this.iridescenceIOR;if(this.iridescenceThicknessRange!==void 0)r.iridescenceThicknessRange=this.iridescenceThicknessRange;if(this.iridescenceMap&&this.iridescenceMap.isTexture){r.iridescenceMap=this.iridescenceMap.toJSON(t).uuid}if(this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture){r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid}if(this.anisotropy!==void 0)r.anisotropy=this.anisotropy;if(this.anisotropyRotation!==void 0)r.anisotropyRotation=this.anisotropyRotation;if(this.anisotropyMap&&this.anisotropyMap.isTexture){r.anisotropyMap=this.anisotropyMap.toJSON(t).uuid}if(this.map&&this.map.isTexture)r.map=this.map.toJSON(t).uuid;if(this.matcap&&this.matcap.isTexture)r.matcap=this.matcap.toJSON(t).uuid;if(this.alphaMap&&this.alphaMap.isTexture)r.alphaMap=this.alphaMap.toJSON(t).uuid;if(this.lightMap&&this.lightMap.isTexture){r.lightMap=this.lightMap.toJSON(t).uuid;r.lightMapIntensity=this.lightMapIntensity}if(this.aoMap&&this.aoMap.isTexture){r.aoMap=this.aoMap.toJSON(t).uuid;r.aoMapIntensity=this.aoMapIntensity}if(this.bumpMap&&this.bumpMap.isTexture){r.bumpMap=this.bumpMap.toJSON(t).uuid;r.bumpScale=this.bumpScale}if(this.normalMap&&this.normalMap.isTexture){r.normalMap=this.normalMap.toJSON(t).uuid;r.normalMapType=this.normalMapType;r.normalScale=this.normalScale.toArray()}if(this.displacementMap&&this.displacementMap.isTexture){r.displacementMap=this.displacementMap.toJSON(t).uuid;r.displacementScale=this.displacementScale;r.displacementBias=this.displacementBias}if(this.roughnessMap&&this.roughnessMap.isTexture)r.roughnessMap=this.roughnessMap.toJSON(t).uuid;if(this.metalnessMap&&this.metalnessMap.isTexture)r.metalnessMap=this.metalnessMap.toJSON(t).uuid;if(this.emissiveMap&&this.emissiveMap.isTexture)r.emissiveMap=this.emissiveMap.toJSON(t).uuid;if(this.specularMap&&this.specularMap.isTexture)r.specularMap=this.specularMap.toJSON(t).uuid;if(this.specularIntensityMap&&this.specularIntensityMap.isTexture)r.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid;if(this.specularColorMap&&this.specularColorMap.isTexture)r.specularColorMap=this.specularColorMap.toJSON(t).uuid;if(this.envMap&&this.envMap.isTexture){r.envMap=this.envMap.toJSON(t).uuid;if(this.combine!==void 0)r.combine=this.combine}if(this.envMapRotation!==void 0)r.envMapRotation=this.envMapRotation.toArray();if(this.envMapIntensity!==void 0)r.envMapIntensity=this.envMapIntensity;if(this.reflectivity!==void 0)r.reflectivity=this.reflectivity;if(this.refractionRatio!==void 0)r.refractionRatio=this.refractionRatio;if(this.gradientMap&&this.gradientMap.isTexture){r.gradientMap=this.gradientMap.toJSON(t).uuid}if(this.transmission!==void 0)r.transmission=this.transmission;if(this.transmissionMap&&this.transmissionMap.isTexture)r.transmissionMap=this.transmissionMap.toJSON(t).uuid;if(this.thickness!==void 0)r.thickness=this.thickness;if(this.thicknessMap&&this.thicknessMap.isTexture)r.thicknessMap=this.thicknessMap.toJSON(t).uuid;if(this.attenuationDistance!==void 0&&this.attenuationDistance!==Infinity)r.attenuationDistance=this.attenuationDistance;if(this.attenuationColor!==void 0)r.attenuationColor=this.attenuationColor.getHex();if(this.size!==void 0)r.size=this.size;if(this.shadowSide!==null)r.shadowSide=this.shadowSide;if(this.sizeAttenuation!==void 0)r.sizeAttenuation=this.sizeAttenuation;if(this.blending!==wO)r.blending=this.blending;if(this.side!==Ik)r.side=this.side;if(this.vertexColors===true)r.vertexColors=true;if(this.opacity<1)r.opacity=this.opacity;if(this.transparent===true)r.transparent=true;if(this.blendSrc!==Lbe)r.blendSrc=this.blendSrc;if(this.blendDst!==Dbe)r.blendDst=this.blendDst;if(this.blendEquation!==j3)r.blendEquation=this.blendEquation;if(this.blendSrcAlpha!==null)r.blendSrcAlpha=this.blendSrcAlpha;if(this.blendDstAlpha!==null)r.blendDstAlpha=this.blendDstAlpha;if(this.blendEquationAlpha!==null)r.blendEquationAlpha=this.blendEquationAlpha;if(this.blendColor&&this.blendColor.isColor)r.blendColor=this.blendColor.getHex();if(this.blendAlpha!==0)r.blendAlpha=this.blendAlpha;if(this.depthFunc!==EO)r.depthFunc=this.depthFunc;if(this.depthTest===false)r.depthTest=this.depthTest;if(this.depthWrite===false)r.depthWrite=this.depthWrite;if(this.colorWrite===false)r.colorWrite=this.colorWrite;if(this.stencilWriteMask!==255)r.stencilWriteMask=this.stencilWriteMask;if(this.stencilFunc!==sVe)r.stencilFunc=this.stencilFunc;if(this.stencilRef!==0)r.stencilRef=this.stencilRef;if(this.stencilFuncMask!==255)r.stencilFuncMask=this.stencilFuncMask;if(this.stencilFail!==TO)r.stencilFail=this.stencilFail;if(this.stencilZFail!==TO)r.stencilZFail=this.stencilZFail;if(this.stencilZPass!==TO)r.stencilZPass=this.stencilZPass;if(this.stencilWrite===true)r.stencilWrite=this.stencilWrite;if(this.rotation!==void 0&&this.rotation!==0)r.rotation=this.rotation;if(this.polygonOffset===true)r.polygonOffset=true;if(this.polygonOffsetFactor!==0)r.polygonOffsetFactor=this.polygonOffsetFactor;if(this.polygonOffsetUnits!==0)r.polygonOffsetUnits=this.polygonOffsetUnits;if(this.linewidth!==void 0&&this.linewidth!==1)r.linewidth=this.linewidth;if(this.dashSize!==void 0)r.dashSize=this.dashSize;if(this.gapSize!==void 0)r.gapSize=this.gapSize;if(this.scale!==void 0)r.scale=this.scale;if(this.dithering===true)r.dithering=true;if(this.alphaTest>0)r.alphaTest=this.alphaTest;if(this.alphaHash===true)r.alphaHash=true;if(this.alphaToCoverage===true)r.alphaToCoverage=true;if(this.premultipliedAlpha===true)r.premultipliedAlpha=true;if(this.forceSinglePass===true)r.forceSinglePass=true;if(this.wireframe===true)r.wireframe=true;if(this.wireframeLinewidth>1)r.wireframeLinewidth=this.wireframeLinewidth;if(this.wireframeLinecap!=="round")r.wireframeLinecap=this.wireframeLinecap;if(this.wireframeLinejoin!=="round")r.wireframeLinejoin=this.wireframeLinejoin;if(this.flatShading===true)r.flatShading=true;if(this.visible===false)r.visible=false;if(this.toneMapped===false)r.toneMapped=false;if(this.fog===false)r.fog=false;if(Object.keys(this.userData).length>0)r.userData=this.userData;function i(o){const a=[];for(const s in o){const l=o[s];delete l.metadata;a.push(l)}return a}if(n){const o=i(t.textures);const a=i(t.images);if(o.length>0)r.textures=o;if(a.length>0)r.images=a}return r}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name;this.blending=t.blending;this.side=t.side;this.vertexColors=t.vertexColors;this.opacity=t.opacity;this.transparent=t.transparent;this.blendSrc=t.blendSrc;this.blendDst=t.blendDst;this.blendEquation=t.blendEquation;this.blendSrcAlpha=t.blendSrcAlpha;this.blendDstAlpha=t.blendDstAlpha;this.blendEquationAlpha=t.blendEquationAlpha;this.blendColor.copy(t.blendColor);this.blendAlpha=t.blendAlpha;this.depthFunc=t.depthFunc;this.depthTest=t.depthTest;this.depthWrite=t.depthWrite;this.stencilWriteMask=t.stencilWriteMask;this.stencilFunc=t.stencilFunc;this.stencilRef=t.stencilRef;this.stencilFuncMask=t.stencilFuncMask;this.stencilFail=t.stencilFail;this.stencilZFail=t.stencilZFail;this.stencilZPass=t.stencilZPass;this.stencilWrite=t.stencilWrite;const n=t.clippingPlanes;let r=null;if(n!==null){const i=n.length;r=new Array(i);for(let o=0;o!==i;++o){r[o]=n[o].clone()}}this.clippingPlanes=r;this.clipIntersection=t.clipIntersection;this.clipShadows=t.clipShadows;this.shadowSide=t.shadowSide;this.colorWrite=t.colorWrite;this.precision=t.precision;this.polygonOffset=t.polygonOffset;this.polygonOffsetFactor=t.polygonOffsetFactor;this.polygonOffsetUnits=t.polygonOffsetUnits;this.dithering=t.dithering;this.alphaTest=t.alphaTest;this.alphaHash=t.alphaHash;this.alphaToCoverage=t.alphaToCoverage;this.premultipliedAlpha=t.premultipliedAlpha;this.forceSinglePass=t.forceSinglePass;this.visible=t.visible;this.toneMapped=t.toneMapped;this.userData=JSON.parse(JSON.stringify(t.userData));return this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){if(t===true)this.version++}};var iZ=class extends XE{constructor(t){super();this.isMeshBasicMaterial=true;this.type="MeshBasicMaterial";this.color=new ms(16777215);this.map=null;this.lightMap=null;this.lightMapIntensity=1;this.aoMap=null;this.aoMapIntensity=1;this.specularMap=null;this.alphaMap=null;this.envMap=null;this.envMapRotation=new nw;this.combine=gVe;this.reflectivity=1;this.refractionRatio=.98;this.wireframe=false;this.wireframeLinewidth=1;this.wireframeLinecap="round";this.wireframeLinejoin="round";this.fog=true;this.setValues(t)}copy(t){super.copy(t);this.color.copy(t.color);this.map=t.map;this.lightMap=t.lightMap;this.lightMapIntensity=t.lightMapIntensity;this.aoMap=t.aoMap;this.aoMapIntensity=t.aoMapIntensity;this.specularMap=t.specularMap;this.alphaMap=t.alphaMap;this.envMap=t.envMap;this.envMapRotation.copy(t.envMapRotation);this.combine=t.combine;this.reflectivity=t.reflectivity;this.refractionRatio=t.refractionRatio;this.wireframe=t.wireframe;this.wireframeLinewidth=t.wireframeLinewidth;this.wireframeLinecap=t.wireframeLinecap;this.wireframeLinejoin=t.wireframeLinejoin;this.fog=t.fog;return this}};var Vh=new gr;var ybe=new Ys;var W6r=0;var jb=class{constructor(t,n,r=false){if(Array.isArray(t)){throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.")}this.isBufferAttribute=true;Object.defineProperty(this,"id",{value:W6r++});this.name="";this.array=t;this.itemSize=n;this.count=t!==void 0?t.length/n:0;this.normalized=r;this.usage=Bbe;this.updateRanges=[];this.gpuType=JE;this.version=0}onUploadCallback(){}set needsUpdate(t){if(t===true)this.version++}setUsage(t){this.usage=t;return this}addUpdateRange(t,n){this.updateRanges.push({start:t,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){this.name=t.name;this.array=new t.array.constructor(t.array);this.itemSize=t.itemSize;this.count=t.count;this.normalized=t.normalized;this.usage=t.usage;this.gpuType=t.gpuType;return this}copyAt(t,n,r){t*=this.itemSize;r*=n.itemSize;for(let i=0,o=this.itemSize;in.count){console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry.")}n.needsUpdate=true}return this}computeBoundingBox(){if(this.boundingBox===null){this.boundingBox=new a_}const t=this.attributes.position;const n=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this);this.boundingBox.set(new gr(-Infinity,-Infinity,-Infinity),new gr(Infinity,Infinity,Infinity));return}if(t!==void 0){this.boundingBox.setFromBufferAttribute(t);if(n){for(let r=0,i=n.length;r0)t.userData=this.userData;if(this.parameters!==void 0){const l=this.parameters;for(const u in l){if(l[u]!==void 0)t[u]=l[u]}return t}t.data={attributes:{}};const n=this.index;if(n!==null){t.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)}}const r=this.attributes;for(const l in r){const u=r[l];t.data.attributes[l]=u.toJSON(t.data)}const i={};let o=false;for(const l in this.morphAttributes){const u=this.morphAttributes[l];const d=[];for(let f=0,h=u.length;f0){i[l]=d;o=true}}if(o){t.data.morphAttributes=i;t.data.morphTargetsRelative=this.morphTargetsRelative}const a=this.groups;if(a.length>0){t.data.groups=JSON.parse(JSON.stringify(a))}const s=this.boundingSphere;if(s!==null){t.data.boundingSphere=s.toJSON()}return t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null;this.attributes={};this.morphAttributes={};this.groups=[];this.boundingBox=null;this.boundingSphere=null;const n={};this.name=t.name;const r=t.index;if(r!==null){this.setIndex(r.clone())}const i=t.attributes;for(const u in i){const d=i[u];this.setAttribute(u,d.clone(n))}const o=t.morphAttributes;for(const u in o){const d=[];const f=o[u];for(let h=0,m=f.length;h0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[];this.morphTargetDictionary={};for(let o=0,a=i.length;o(t.far-t.near)**2)return}_9t.copy(o).invert();vO.copy(t.ray).applyMatrix4(_9t);if(r.boundingBox!==null){if(vO.intersectsBox(r.boundingBox)===false)return}this._computeIntersections(t,n,vO)}_computeIntersections(t,n,r){let i;const o=this.geometry;const a=this.material;const s=o.index;const l=o.attributes.position;const u=o.attributes.uv;const d=o.attributes.uv1;const f=o.attributes.normal;const h=o.groups;const m=o.drawRange;if(s!==null){if(Array.isArray(a)){for(let g=0,x=h.length;gn.far)return null;return{distance:u,point:wbe.clone(),object:e}}function Ebe(e,t,n,r,i,o,a,s,l,u){e.getVertexPosition(s,xbe);e.getVertexPosition(l,vbe);e.getVertexPosition(u,_be);const d=q6r(e,t,n,r,xbe,vbe,_be,w9t);if(d){const f=new gr;kk.getBarycoord(w9t,xbe,vbe,_be,f);if(i){d.uv=kk.getInterpolatedAttribute(i,s,l,u,f,new Ys)}if(o){d.uv1=kk.getInterpolatedAttribute(o,s,l,u,f,new Ys)}if(a){d.normal=kk.getInterpolatedAttribute(a,s,l,u,f,new gr);if(d.normal.dot(r.direction)>0){d.normal.multiplyScalar(-1)}}const h={a:s,b:l,c:u,normal:new gr,materialIndex:0};kk.getNormal(xbe,vbe,_be,h.normal);d.face=h;d.barycoord=f}return d}var K3=class e extends wp{constructor(t=1,n=1,r=1,i=1,o=1,a=1){super();this.type="BoxGeometry";this.parameters={width:t,height:n,depth:r,widthSegments:i,heightSegments:o,depthSegments:a};const s=this;i=Math.floor(i);o=Math.floor(o);a=Math.floor(a);const l=[];const u=[];const d=[];const f=[];let h=0;let m=0;g("z","y","x",-1,-1,r,n,t,a,o,0);g("z","y","x",1,-1,r,n,-t,a,o,1);g("x","z","y",1,1,t,r,n,i,a,2);g("x","z","y",1,-1,t,r,-n,i,a,3);g("x","y","z",1,-1,t,n,r,i,o,4);g("x","y","z",-1,-1,t,n,-r,i,o,5);this.setIndex(l);this.setAttribute("position",new Kb(u,3));this.setAttribute("normal",new Kb(d,3));this.setAttribute("uv",new Kb(f,2));function g(x,w,_,C,A,P,L,I,N,O,z){const U=P/N;const W=L/O;const H=P/2;const $=L/2;const K=I/2;const X=N+1;const j=O+1;let te=0;let J=0;const oe=new gr;for(let se=0;se0?1:-1;d.push(oe.x,oe.y,oe.z);f.push(ce/N);f.push(1-se/O);te+=1}}for(let se=0;se0)n.defines=this.defines;n.vertexShader=this.vertexShader;n.fragmentShader=this.fragmentShader;n.lights=this.lights;n.clipping=this.clipping;const r={};for(const i in this.extensions){if(this.extensions[i]===true)r[i]=true}if(Object.keys(r).length>0)n.extensions=r;return n}};var sZ=class extends Cm{constructor(){super();this.isCamera=true;this.type="Camera";this.matrixWorldInverse=new vf;this.projectionMatrix=new vf;this.projectionMatrixInverse=new vf;this.coordinateSystem=ew;this._reversedDepth=false}get reversedDepth(){return this._reversedDepth}copy(t,n){super.copy(t,n);this.matrixWorldInverse.copy(t.matrixWorldInverse);this.projectionMatrix.copy(t.projectionMatrix);this.projectionMatrixInverse.copy(t.projectionMatrixInverse);this.coordinateSystem=t.coordinateSystem;return this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t);this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,n){super.updateWorldMatrix(t,n);this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}};var q3=new gr;var E9t=new Ys;var C9t=new Ys;var Ry=class extends sZ{constructor(t=50,n=1,r=.1,i=2e3){super();this.isPerspectiveCamera=true;this.type="PerspectiveCamera";this.fov=t;this.zoom=1;this.near=r;this.far=i;this.focus=10;this.aspect=n;this.view=null;this.filmGauge=35;this.filmOffset=0;this.updateProjectionMatrix()}copy(t,n){super.copy(t,n);this.fov=t.fov;this.zoom=t.zoom;this.near=t.near;this.far=t.far;this.focus=t.focus;this.aspect=t.aspect;this.view=t.view===null?null:Object.assign({},t.view);this.filmGauge=t.filmGauge;this.filmOffset=t.filmOffset;return this}setFocalLength(t){const n=.5*this.getFilmHeight()/t;this.fov=J9*2*Math.atan(n);this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(jK*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return J9*2*Math.atan(Math.tan(jK*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,n,r){q3.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse);n.set(q3.x,q3.y).multiplyScalar(-t/q3.z);q3.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse);r.set(q3.x,q3.y).multiplyScalar(-t/q3.z)}getViewSize(t,n){this.getViewBounds(t,E9t,C9t);return n.subVectors(C9t,E9t)}setViewOffset(t,n,r,i,o,a){this.aspect=t/n;if(this.view===null){this.view={enabled:true,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}}this.view.enabled=true;this.view.fullWidth=t;this.view.fullHeight=n;this.view.offsetX=r;this.view.offsetY=i;this.view.width=o;this.view.height=a;this.updateProjectionMatrix()}clearViewOffset(){if(this.view!==null){this.view.enabled=false}this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let n=t*Math.tan(jK*.5*this.fov)/this.zoom;let r=2*n;let i=this.aspect*r;let o=-.5*i;const a=this.view;if(this.view!==null&&this.view.enabled){const l=a.fullWidth,u=a.fullHeight;o+=a.offsetX*i/l;n-=a.offsetY*r/u;i*=a.width/l;r*=a.height/u}const s=this.filmOffset;if(s!==0)o+=t*s/this.getFilmWidth();this.projectionMatrix.makePerspective(o,o+i,n,n-r,t,this.far,this.coordinateSystem,this.reversedDepth);this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const n=super.toJSON(t);n.object.fov=this.fov;n.object.zoom=this.zoom;n.object.near=this.near;n.object.far=this.far;n.object.focus=this.focus;n.object.aspect=this.aspect;if(this.view!==null)n.object.view=Object.assign({},this.view);n.object.filmGauge=this.filmGauge;n.object.filmOffset=this.filmOffset;return n}};var H9=-90;var W9=1;var $be=class extends Cm{constructor(t,n,r){super();this.type="CubeCamera";this.renderTarget=r;this.coordinateSystem=null;this.activeMipmapLevel=0;const i=new Ry(H9,W9,t,n);i.layers=this.layers;this.add(i);const o=new Ry(H9,W9,t,n);o.layers=this.layers;this.add(o);const a=new Ry(H9,W9,t,n);a.layers=this.layers;this.add(a);const s=new Ry(H9,W9,t,n);s.layers=this.layers;this.add(s);const l=new Ry(H9,W9,t,n);l.layers=this.layers;this.add(l);const u=new Ry(H9,W9,t,n);u.layers=this.layers;this.add(u)}updateCoordinateSystem(){const t=this.coordinateSystem;const n=this.children.concat();const[r,i,o,a,s,l]=n;for(const u of n)this.remove(u);if(t===ew){r.up.set(0,1,0);r.lookAt(1,0,0);i.up.set(0,1,0);i.lookAt(-1,0,0);o.up.set(0,0,-1);o.lookAt(0,1,0);a.up.set(0,0,1);a.lookAt(0,-1,0);s.up.set(0,1,0);s.lookAt(0,0,1);l.up.set(0,1,0);l.lookAt(0,0,-1)}else if(t===QK){r.up.set(0,-1,0);r.lookAt(-1,0,0);i.up.set(0,-1,0);i.lookAt(1,0,0);o.up.set(0,0,1);o.lookAt(0,1,0);a.up.set(0,0,-1);a.lookAt(0,-1,0);s.up.set(0,-1,0);s.lookAt(0,0,1);l.up.set(0,-1,0);l.lookAt(0,0,-1)}else{throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t)}for(const u of n){this.add(u);u.updateMatrixWorld()}}update(t,n){if(this.parent===null)this.updateMatrixWorld();const{renderTarget:r,activeMipmapLevel:i}=this;if(this.coordinateSystem!==t.coordinateSystem){this.coordinateSystem=t.coordinateSystem;this.updateCoordinateSystem()}const[o,a,s,l,u,d]=this.children;const f=t.getRenderTarget();const h=t.getActiveCubeFace();const m=t.getActiveMipmapLevel();const g=t.xr.enabled;t.xr.enabled=false;const x=r.texture.generateMipmaps;r.texture.generateMipmaps=false;t.setRenderTarget(r,0,i);t.render(n,o);t.setRenderTarget(r,1,i);t.render(n,a);t.setRenderTarget(r,2,i);t.render(n,s);t.setRenderTarget(r,3,i);t.render(n,l);t.setRenderTarget(r,4,i);t.render(n,u);r.texture.generateMipmaps=x;t.setRenderTarget(r,5,i);t.render(n,d);t.setRenderTarget(f,h,m);t.xr.enabled=g;r.texture.needsPMREMUpdate=true}};var lZ=class extends Zb{constructor(t=[],n=PO,r,i,o,a,s,l,u,d){super(t,n,r,i,o,a,s,l,u,d);this.isCubeTexture=true;this.flipY=false}get images(){return this.image}set images(t){this.image=t}};var Gbe=class extends qE{constructor(t=1,n={}){super(t,t,n);this.isWebGLCubeRenderTarget=true;const r={width:t,height:t,depth:1};const i=[r,r,r,r,r,r];this.texture=new lZ(i);this._setTextureOptions(n);this.texture.isRenderTargetTexture=true}fromEquirectangularTexture(t,n){this.texture.type=n.type;this.texture.colorSpace=n.colorSpace;this.texture.generateMipmaps=n.generateMipmaps;this.texture.minFilter=n.minFilter;this.texture.magFilter=n.magFilter;const r={uniforms:{tEquirect:{value:null}},vertexShader:` + + varying vec3 vWorldDirection; + + vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); + + } + + void main() { + + vWorldDirection = transformDirection( position, modelMatrix ); + + #include + #include + + } + `,fragmentShader:` + + uniform sampler2D tEquirect; + + varying vec3 vWorldDirection; + + #include + + void main() { + + vec3 direction = normalize( vWorldDirection ); + + vec2 sampleUV = equirectUv( direction ); + + gl_FragColor = texture2D( tEquirect, sampleUV ); + + } + `};const i=new K3(5,5,5);const o=new rw({name:"CubemapFromEquirect",uniforms:LO(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:D0,blending:Dk});o.uniforms.tEquirect.value=n;const a=new Sm(i,o);const s=n.minFilter;if(n.minFilter===Q3)n.minFilter=tw;const l=new $be(1,10,this);l.update(t,a);n.minFilter=s;a.geometry.dispose();a.material.dispose();return this}clear(t,n=true,r=true,i=true){const o=t.getRenderTarget();for(let a=0;a<6;a++){t.setRenderTarget(this,a);t.clear(n,r,i)}t.setRenderTarget(o)}};var Py=class extends Cm{constructor(){super();this.isGroup=true;this.type="Group"}};var Z6r={type:"move"};var eU=class{constructor(){this._targetRay=null;this._grip=null;this._hand=null}getHandSpace(){if(this._hand===null){this._hand=new Py;this._hand.matrixAutoUpdate=false;this._hand.visible=false;this._hand.joints={};this._hand.inputState={pinching:false}}return this._hand}getTargetRaySpace(){if(this._targetRay===null){this._targetRay=new Py;this._targetRay.matrixAutoUpdate=false;this._targetRay.visible=false;this._targetRay.hasLinearVelocity=false;this._targetRay.linearVelocity=new gr;this._targetRay.hasAngularVelocity=false;this._targetRay.angularVelocity=new gr}return this._targetRay}getGripSpace(){if(this._grip===null){this._grip=new Py;this._grip.matrixAutoUpdate=false;this._grip.visible=false;this._grip.hasLinearVelocity=false;this._grip.linearVelocity=new gr;this._grip.hasAngularVelocity=false;this._grip.angularVelocity=new gr}return this._grip}dispatchEvent(t){if(this._targetRay!==null){this._targetRay.dispatchEvent(t)}if(this._grip!==null){this._grip.dispatchEvent(t)}if(this._hand!==null){this._hand.dispatchEvent(t)}return this}connect(t){if(t&&t.hand){const n=this._hand;if(n){for(const r of t.hand.values()){this._getHandJoint(n,r)}}}this.dispatchEvent({type:"connected",data:t});return this}disconnect(t){this.dispatchEvent({type:"disconnected",data:t});if(this._targetRay!==null){this._targetRay.visible=false}if(this._grip!==null){this._grip.visible=false}if(this._hand!==null){this._hand.visible=false}return this}update(t,n,r){let i=null;let o=null;let a=null;const s=this._targetRay;const l=this._grip;const u=this._hand;if(t&&n.session.visibilityState!=="visible-blurred"){if(u&&t.hand){a=true;for(const x of t.hand.values()){const w=n.getJointPose(x,r);const _=this._getHandJoint(u,x);if(w!==null){_.matrix.fromArray(w.transform.matrix);_.matrix.decompose(_.position,_.rotation,_.scale);_.matrixWorldNeedsUpdate=true;_.jointRadius=w.radius}_.visible=w!==null}const d=u.joints["index-finger-tip"];const f=u.joints["thumb-tip"];const h=d.position.distanceTo(f.position);const m=.02;const g=.005;if(u.inputState.pinching&&h>m+g){u.inputState.pinching=false;this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})}else if(!u.inputState.pinching&&h<=m-g){u.inputState.pinching=true;this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this})}}else{if(l!==null&&t.gripSpace){o=n.getPose(t.gripSpace,r);if(o!==null){l.matrix.fromArray(o.transform.matrix);l.matrix.decompose(l.position,l.rotation,l.scale);l.matrixWorldNeedsUpdate=true;if(o.linearVelocity){l.hasLinearVelocity=true;l.linearVelocity.copy(o.linearVelocity)}else{l.hasLinearVelocity=false}if(o.angularVelocity){l.hasAngularVelocity=true;l.angularVelocity.copy(o.angularVelocity)}else{l.hasAngularVelocity=false}}}}if(s!==null){i=n.getPose(t.targetRaySpace,r);if(i===null&&o!==null){i=o}if(i!==null){s.matrix.fromArray(i.transform.matrix);s.matrix.decompose(s.position,s.rotation,s.scale);s.matrixWorldNeedsUpdate=true;if(i.linearVelocity){s.hasLinearVelocity=true;s.linearVelocity.copy(i.linearVelocity)}else{s.hasLinearVelocity=false}if(i.angularVelocity){s.hasAngularVelocity=true;s.angularVelocity.copy(i.angularVelocity)}else{s.hasAngularVelocity=false}this.dispatchEvent(Z6r)}}}if(s!==null){s.visible=i!==null}if(l!==null){l.visible=o!==null}if(u!==null){u.visible=a!==null}return this}_getHandJoint(t,n){if(t.joints[n.jointName]===void 0){const r=new Py;r.matrixAutoUpdate=false;r.visible=false;t.joints[n.jointName]=r;t.add(r)}return t.joints[n.jointName]}};var cZ=class extends Cm{constructor(){super();this.isScene=true;this.type="Scene";this.background=null;this.environment=null;this.fog=null;this.backgroundBlurriness=0;this.backgroundIntensity=1;this.backgroundRotation=new nw;this.environmentIntensity=1;this.environmentRotation=new nw;this.overrideMaterial=null;if(typeof __THREE_DEVTOOLS__!=="undefined"){__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}}copy(t,n){super.copy(t,n);if(t.background!==null)this.background=t.background.clone();if(t.environment!==null)this.environment=t.environment.clone();if(t.fog!==null)this.fog=t.fog.clone();this.backgroundBlurriness=t.backgroundBlurriness;this.backgroundIntensity=t.backgroundIntensity;this.backgroundRotation.copy(t.backgroundRotation);this.environmentIntensity=t.environmentIntensity;this.environmentRotation.copy(t.environmentRotation);if(t.overrideMaterial!==null)this.overrideMaterial=t.overrideMaterial.clone();this.matrixAutoUpdate=t.matrixAutoUpdate;return this}toJSON(t){const n=super.toJSON(t);if(this.fog!==null)n.object.fog=this.fog.toJSON();if(this.backgroundBlurriness>0)n.object.backgroundBlurriness=this.backgroundBlurriness;if(this.backgroundIntensity!==1)n.object.backgroundIntensity=this.backgroundIntensity;n.object.backgroundRotation=this.backgroundRotation.toArray();if(this.environmentIntensity!==1)n.object.environmentIntensity=this.environmentIntensity;n.object.environmentRotation=this.environmentRotation.toArray();return n}};var Hbe=class{constructor(t,n){this.isInterleavedBuffer=true;this.array=t;this.stride=n;this.count=t!==void 0?t.length/n:0;this.usage=Bbe;this.updateRanges=[];this.version=0;this.uuid=Rk()}onUploadCallback(){}set needsUpdate(t){if(t===true)this.version++}setUsage(t){this.usage=t;return this}addUpdateRange(t,n){this.updateRanges.push({start:t,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){this.array=new t.array.constructor(t.array);this.count=t.count;this.stride=t.stride;this.usage=t.usage;return this}copyAt(t,n,r){t*=this.stride;r*=n.stride;for(let i=0,o=this.stride;it.far)return;n.push({distance:l,point:WK.clone(),uv:kk.getInterpolation(WK,Cbe,qK,Sbe,S9t,eVe,A9t,new Ys),face:null,object:this})}copy(t,n){super.copy(t,n);if(t.center!==void 0)this.center.copy(t.center);this.material=t.material;return this}};function Abe(e,t,n,r,i,o){j9.subVectors(e,n).addScalar(.5).multiply(r);if(i!==void 0){YK.x=o*j9.x-i*j9.y;YK.y=i*j9.x+o*j9.y}else{YK.copy(j9)}e.copy(t);e.x+=YK.x;e.y+=YK.y;e.applyMatrix4(TUt)}var tVe=new gr;var J6r=new gr;var Q6r=new Gs;var YE=class{constructor(t=new gr(1,0,0),n=0){this.isPlane=true;this.normal=t;this.constant=n}set(t,n){this.normal.copy(t);this.constant=n;return this}setComponents(t,n,r,i){this.normal.set(t,n,r);this.constant=i;return this}setFromNormalAndCoplanarPoint(t,n){this.normal.copy(t);this.constant=-n.dot(this.normal);return this}setFromCoplanarPoints(t,n,r){const i=tVe.subVectors(r,n).cross(J6r.subVectors(t,n)).normalize();this.setFromNormalAndCoplanarPoint(i,t);return this}copy(t){this.normal.copy(t.normal);this.constant=t.constant;return this}normalize(){const t=1/this.normal.length();this.normal.multiplyScalar(t);this.constant*=t;return this}negate(){this.constant*=-1;this.normal.negate();return this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,n){return n.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,n){const r=t.delta(tVe);const i=this.normal.dot(r);if(i===0){if(this.distanceToPoint(t.start)===0){return n.copy(t.start)}return null}const o=-(t.start.dot(this.normal)+this.constant)/i;if(o<0||o>1){return null}return n.copy(t.start).addScaledVector(r,o)}intersectsLine(t){const n=this.distanceToPoint(t.start);const r=this.distanceToPoint(t.end);return n<0&&r>0||r<0&&n>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,n){const r=n||Q6r.getNormalMatrix(t);const i=this.coplanarPoint(tVe).applyMatrix4(t);const o=this.normal.applyMatrix3(r).normalize();this.constant=-i.dot(o);return this}translate(t){this.constant-=t.dot(this.normal);return this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}};var _O=new AO;var e8r=new Ys(.5,.5);var kbe=new gr;var nU=class{constructor(t=new YE,n=new YE,r=new YE,i=new YE,o=new YE,a=new YE){this.planes=[t,n,r,i,o,a]}set(t,n,r,i,o,a){const s=this.planes;s[0].copy(t);s[1].copy(n);s[2].copy(r);s[3].copy(i);s[4].copy(o);s[5].copy(a);return this}copy(t){const n=this.planes;for(let r=0;r<6;r++){n[r].copy(t.planes[r])}return this}setFromProjectionMatrix(t,n=ew,r=false){const i=this.planes;const o=t.elements;const a=o[0],s=o[1],l=o[2],u=o[3];const d=o[4],f=o[5],h=o[6],m=o[7];const g=o[8],x=o[9],w=o[10],_=o[11];const C=o[12],A=o[13],P=o[14],L=o[15];i[0].setComponents(u-a,m-d,_-g,L-C).normalize();i[1].setComponents(u+a,m+d,_+g,L+C).normalize();i[2].setComponents(u+s,m+f,_+x,L+A).normalize();i[3].setComponents(u-s,m-f,_-x,L-A).normalize();if(r){i[4].setComponents(l,h,w,P).normalize();i[5].setComponents(u-l,m-h,_-w,L-P).normalize()}else{i[4].setComponents(u-l,m-h,_-w,L-P).normalize();if(n===ew){i[5].setComponents(u+l,m+h,_+w,L+P).normalize()}else if(n===QK){i[5].setComponents(l,h,w,P).normalize()}else{throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+n)}}return this}intersectsObject(t){if(t.boundingSphere!==void 0){if(t.boundingSphere===null)t.computeBoundingSphere();_O.copy(t.boundingSphere).applyMatrix4(t.matrixWorld)}else{const n=t.geometry;if(n.boundingSphere===null)n.computeBoundingSphere();_O.copy(n.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(_O)}intersectsSprite(t){_O.center.set(0,0,0);const n=e8r.distanceTo(t.center);_O.radius=.7071067811865476+n;_O.applyMatrix4(t.matrixWorld);return this.intersectsSphere(_O)}intersectsSphere(t){const n=this.planes;const r=t.center;const i=-t.radius;for(let o=0;o<6;o++){const a=n[o].distanceToPoint(r);if(a0?t.max.x:t.min.x;kbe.y=i.normal.y>0?t.max.y:t.min.y;kbe.z=i.normal.z>0?t.max.z:t.min.z;if(i.distanceToPoint(kbe)<0){return false}}return true}containsPoint(t){const n=this.planes;for(let r=0;r<6;r++){if(n[r].distanceToPoint(t)<0){return false}}return true}clone(){return new this.constructor().copy(this)}};var jE=class extends XE{constructor(t){super();this.isLineBasicMaterial=true;this.type="LineBasicMaterial";this.color=new ms(16777215);this.map=null;this.linewidth=1;this.linecap="round";this.linejoin="round";this.fog=true;this.setValues(t)}copy(t){super.copy(t);this.color.copy(t.color);this.map=t.map;this.linewidth=t.linewidth;this.linecap=t.linecap;this.linejoin=t.linejoin;this.fog=t.fog;return this}};var Wbe=new gr;var Ybe=new gr;var k9t=new vf;var XK=new nZ;var Rbe=new AO;var nVe=new gr;var R9t=new gr;var iw=class extends Cm{constructor(t=new wp,n=new jE){super();this.isLine=true;this.type="Line";this.geometry=t;this.material=n;this.morphTargetDictionary=void 0;this.morphTargetInfluences=void 0;this.updateMorphTargets()}copy(t,n){super.copy(t,n);this.material=Array.isArray(t.material)?t.material.slice():t.material;this.geometry=t.geometry;return this}computeLineDistances(){const t=this.geometry;if(t.index===null){const n=t.attributes.position;const r=[0];for(let i=1,o=n.count;i0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[];this.morphTargetDictionary={};for(let o=0,a=i.length;or)return;nVe.applyMatrix4(e.matrixWorld);const u=t.ray.origin.distanceTo(nVe);if(ut.far)return;return{distance:u,point:R9t.clone().applyMatrix4(e.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:e}}var fZ=class extends Zb{constructor(t,n,r,i,o,a,s,l,u){super(t,n,r,i,o,a,s,l,u);this.isCanvasTexture=true;this.needsUpdate=true}};var hZ=class extends Zb{constructor(t,n,r=eM,i,o,a,s=o_,l=o_,u,d=Z9,f=1){if(d!==Z9&&d!==sU){throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat")}const h={width:t,height:n,depth:f};super(h,i,o,a,s,l,d,r,u);this.isDepthTexture=true;this.flipY=false;this.generateMipmaps=false;this.compareFunction=null}copy(t){super.copy(t);this.source=new Q9(Object.assign({},t.image));this.compareFunction=t.compareFunction;return this}toJSON(t){const n=super.toJSON(t);if(this.compareFunction!==null)n.compareFunction=this.compareFunction;return n}};var pZ=class e extends wp{constructor(t=1,n=1,r=1,i=32,o=1,a=false,s=0,l=Math.PI*2){super();this.type="CylinderGeometry";this.parameters={radiusTop:t,radiusBottom:n,height:r,radialSegments:i,heightSegments:o,openEnded:a,thetaStart:s,thetaLength:l};const u=this;i=Math.floor(i);o=Math.floor(o);const d=[];const f=[];const h=[];const m=[];let g=0;const x=[];const w=r/2;let _=0;C();if(a===false){if(t>0)A(true);if(n>0)A(false)}this.setIndex(d);this.setAttribute("position",new Kb(f,3));this.setAttribute("normal",new Kb(h,3));this.setAttribute("uv",new Kb(m,2));function C(){const P=new gr;const L=new gr;let I=0;const N=(n-t)/r;for(let O=0;O<=o;O++){const z=[];const U=O/o;const W=U*(n-t)+t;for(let H=0;H<=i;H++){const $=H/i;const K=$*l+s;const X=Math.sin(K);const j=Math.cos(K);L.x=W*X;L.y=-U*r+w;L.z=W*j;f.push(L.x,L.y,L.z);P.set(X,N,j).normalize();h.push(P.x,P.y,P.z);m.push($,1-U);z.push(g++)}x.push(z)}for(let O=0;O0||z!==0){d.push(U,W,$);I+=3}if(n>0||z!==o-1){d.push(W,H,$);I+=3}}}u.addGroup(_,I,0);_+=I}function A(P){const L=g;const I=new Ys;const N=new gr;let O=0;const z=P===true?t:n;const U=P===true?1:-1;for(let H=1;H<=i;H++){f.push(0,w*U,0);h.push(0,U,0);m.push(.5,.5);g++}const W=g;for(let H=0;H<=i;H++){const $=H/i;const K=$*l+s;const X=Math.cos(K);const j=Math.sin(K);N.x=z*j;N.y=w*U;N.z=z*X;f.push(N.x,N.y,N.z);h.push(0,U,0);I.x=X*.5+.5;I.y=j*.5*U+.5;m.push(I.x,I.y);g++}for(let H=0;H0!==t>0){this.version++}this._anisotropy=t}get clearcoat(){return this._clearcoat}set clearcoat(t){if(this._clearcoat>0!==t>0){this.version++}this._clearcoat=t}get iridescence(){return this._iridescence}set iridescence(t){if(this._iridescence>0!==t>0){this.version++}this._iridescence=t}get dispersion(){return this._dispersion}set dispersion(t){if(this._dispersion>0!==t>0){this.version++}this._dispersion=t}get sheen(){return this._sheen}set sheen(t){if(this._sheen>0!==t>0){this.version++}this._sheen=t}get transmission(){return this._transmission}set transmission(t){if(this._transmission>0!==t>0){this.version++}this._transmission=t}copy(t){super.copy(t);this.defines={"STANDARD":"","PHYSICAL":""};this.anisotropy=t.anisotropy;this.anisotropyRotation=t.anisotropyRotation;this.anisotropyMap=t.anisotropyMap;this.clearcoat=t.clearcoat;this.clearcoatMap=t.clearcoatMap;this.clearcoatRoughness=t.clearcoatRoughness;this.clearcoatRoughnessMap=t.clearcoatRoughnessMap;this.clearcoatNormalMap=t.clearcoatNormalMap;this.clearcoatNormalScale.copy(t.clearcoatNormalScale);this.dispersion=t.dispersion;this.ior=t.ior;this.iridescence=t.iridescence;this.iridescenceMap=t.iridescenceMap;this.iridescenceIOR=t.iridescenceIOR;this.iridescenceThicknessRange=[...t.iridescenceThicknessRange];this.iridescenceThicknessMap=t.iridescenceThicknessMap;this.sheen=t.sheen;this.sheenColor.copy(t.sheenColor);this.sheenColorMap=t.sheenColorMap;this.sheenRoughness=t.sheenRoughness;this.sheenRoughnessMap=t.sheenRoughnessMap;this.transmission=t.transmission;this.transmissionMap=t.transmissionMap;this.thickness=t.thickness;this.thicknessMap=t.thicknessMap;this.attenuationDistance=t.attenuationDistance;this.attenuationColor.copy(t.attenuationColor);this.specularIntensity=t.specularIntensity;this.specularIntensityMap=t.specularIntensityMap;this.specularColor.copy(t.specularColor);this.specularColorMap=t.specularColorMap;return this}};var Xbe=class extends XE{constructor(t){super();this.isMeshDepthMaterial=true;this.type="MeshDepthMaterial";this.depthPacking=lUt;this.map=null;this.alphaMap=null;this.displacementMap=null;this.displacementScale=1;this.displacementBias=0;this.wireframe=false;this.wireframeLinewidth=1;this.setValues(t)}copy(t){super.copy(t);this.depthPacking=t.depthPacking;this.map=t.map;this.alphaMap=t.alphaMap;this.displacementMap=t.displacementMap;this.displacementScale=t.displacementScale;this.displacementBias=t.displacementBias;this.wireframe=t.wireframe;this.wireframeLinewidth=t.wireframeLinewidth;return this}};var jbe=class extends XE{constructor(t){super();this.isMeshDistanceMaterial=true;this.type="MeshDistanceMaterial";this.map=null;this.alphaMap=null;this.displacementMap=null;this.displacementScale=1;this.displacementBias=0;this.setValues(t)}copy(t){super.copy(t);this.map=t.map;this.alphaMap=t.alphaMap;this.displacementMap=t.displacementMap;this.displacementScale=t.displacementScale;this.displacementBias=t.displacementBias;return this}};function Ibe(e,t){if(!e||e.constructor===t)return e;if(typeof t.BYTES_PER_ELEMENT==="number"){return new t(e)}return Array.prototype.slice.call(e)}function t8r(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}var kO=class{constructor(t,n,r,i){this.parameterPositions=t;this._cachedIndex=0;this.resultBuffer=i!==void 0?i:new n.constructor(r);this.sampleValues=n;this.valueSize=r;this.settings=null;this.DefaultSettings_={}}evaluate(t){const n=this.parameterPositions;let r=this._cachedIndex,i=n[r],o=n[r-1];e:{t:{let a;n:{r:if(!(t=o)){const s=n[1];if(t=o){break t}}a=r;r=0;break n}break e}while(r>>1;if(tn){--a}++a;if(o!==0||a!==i){if(o>=a){a=Math.max(a,1);o=a-1}const s=this.getValueSize();this.times=r.slice(o,a);this.values=this.values.slice(o*s,a*s)}return this}validate(){let t=true;const n=this.getValueSize();if(n-Math.floor(n)!==0){console.error("THREE.KeyframeTrack: Invalid value size in track.",this);t=false}const r=this.times,i=this.values,o=r.length;if(o===0){console.error("THREE.KeyframeTrack: Track is empty.",this);t=false}let a=null;for(let s=0;s!==o;s++){const l=r[s];if(typeof l==="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,s,l);t=false;break}if(a!==null&&a>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,s,l,a);t=false;break}a=l}if(i!==void 0){if(t8r(i)){for(let s=0,l=i.length;s!==l;++s){const u=i[s];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,s,u);t=false;break}}}}return t}optimize(){const t=this.times.slice(),n=this.values.slice(),r=this.getValueSize(),i=this.getInterpolation()===Mbe,o=t.length-1;let a=1;for(let s=1;s0){t[a]=t[o];for(let s=o*r,l=a*r,u=0;u!==r;++u){n[l+u]=n[s+u]}++a}if(a!==t.length){this.times=t.slice(0,a);this.values=n.slice(0,a*r)}else{this.times=t;this.values=n}return this}clone(){const t=this.times.slice();const n=this.values.slice();const r=this.constructor;const i=new r(this.name,t,n);i.createInterpolant=this.createInterpolant;return i}};F1.prototype.ValueTypeName="";F1.prototype.TimeBufferType=Float32Array;F1.prototype.ValueBufferType=Float32Array;F1.prototype.DefaultInterpolation=Obe;var Z3=class extends F1{constructor(t,n,r){super(t,n,r)}};Z3.prototype.ValueTypeName="bool";Z3.prototype.ValueBufferType=Array;Z3.prototype.DefaultInterpolation=ZK;Z3.prototype.InterpolantFactoryMethodLinear=void 0;Z3.prototype.InterpolantFactoryMethodSmooth=void 0;var Qbe=class extends F1{constructor(t,n,r,i){super(t,n,r,i)}};Qbe.prototype.ValueTypeName="color";var exe=class extends F1{constructor(t,n,r,i){super(t,n,r,i)}};exe.prototype.ValueTypeName="number";var txe=class extends kO{constructor(t,n,r,i){super(t,n,r,i)}interpolate_(t,n,r,i){const o=this.resultBuffer,a=this.sampleValues,s=this.valueSize,l=(r-n)/(i-n);let u=t*s;for(let d=u+s;u!==d;u+=4){Lk.slerpFlat(o,0,a,u-s,a,u,l)}return o}};var yZ=class extends F1{constructor(t,n,r,i){super(t,n,r,i)}InterpolantFactoryMethodLinear(t){return new txe(this.times,this.values,this.getValueSize(),t)}};yZ.prototype.ValueTypeName="quaternion";yZ.prototype.InterpolantFactoryMethodSmooth=void 0;var J3=class extends F1{constructor(t,n,r){super(t,n,r)}};J3.prototype.ValueTypeName="string";J3.prototype.ValueBufferType=Array;J3.prototype.DefaultInterpolation=ZK;J3.prototype.InterpolantFactoryMethodLinear=void 0;J3.prototype.InterpolantFactoryMethodSmooth=void 0;var nxe=class extends F1{constructor(t,n,r,i){super(t,n,r,i)}};nxe.prototype.ValueTypeName="vector";var rxe=class{constructor(t,n,r){const i=this;let o=false;let a=0;let s=0;let l=void 0;const u=[];this.onStart=void 0;this.onLoad=t;this.onProgress=n;this.onError=r;this.abortController=new AbortController;this.itemStart=function(d){s++;if(o===false){if(i.onStart!==void 0){i.onStart(d,a,s)}}o=true};this.itemEnd=function(d){a++;if(i.onProgress!==void 0){i.onProgress(d,a,s)}if(a===s){o=false;if(i.onLoad!==void 0){i.onLoad()}}};this.itemError=function(d){if(i.onError!==void 0){i.onError(d)}};this.resolveURL=function(d){if(l){return l(d)}return d};this.setURLModifier=function(d){l=d;return this};this.addHandler=function(d,f){u.push(d,f);return this};this.removeHandler=function(d){const f=u.indexOf(d);if(f!==-1){u.splice(f,2)}return this};this.getHandler=function(d){for(let f=0,h=u.length;fm.start-g.start);let h=0;for(let m=1;m0;P=(L?n:t).get(P)}return P}function x(A){let P=false;const L=g(A);if(L===null){_(s,l)}else if(L&&L.isColor){_(L,1);P=true}const I=e.xr.getEnvironmentBlendMode();if(I==="additive"){r.buffers.color.setClear(0,0,0,1,a)}else if(I==="alpha-blend"){r.buffers.color.setClear(0,0,0,0,a)}if(e.autoClear||P){r.buffers.depth.setTest(true);r.buffers.depth.setMask(true);r.buffers.color.setMask(true);e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil)}}function w(A,P){const L=g(P);if(L&&(L.isCubeTexture||L.mapping===_Z)){if(d===void 0){d=new Sm(new K3(1,1,1),new rw({name:"BackgroundCubeMaterial",uniforms:LO(QE.backgroundCube.uniforms),vertexShader:QE.backgroundCube.vertexShader,fragmentShader:QE.backgroundCube.fragmentShader,side:D0,depthTest:false,depthWrite:false,fog:false,allowOverride:false}));d.geometry.deleteAttribute("normal");d.geometry.deleteAttribute("uv");d.onBeforeRender=function(I,N,O){this.matrixWorld.copyPosition(O.matrixWorld)};Object.defineProperty(d.material,"envMap",{get:function(){return this.uniforms.envMap.value}});i.update(d)}DO.copy(P.backgroundRotation);DO.x*=-1;DO.y*=-1;DO.z*=-1;if(L.isCubeTexture&&L.isRenderTargetTexture===false){DO.y*=-1;DO.z*=-1}d.material.uniforms.envMap.value=L;d.material.uniforms.flipEnvMap.value=L.isCubeTexture&&L.isRenderTargetTexture===false?-1:1;d.material.uniforms.backgroundBlurriness.value=P.backgroundBlurriness;d.material.uniforms.backgroundIntensity.value=P.backgroundIntensity;d.material.uniforms.backgroundRotation.value.setFromMatrix4(Wzr.makeRotationFromEuler(DO));d.material.toneMapped=dc.getTransfer(L.colorSpace)!==du;if(f!==L||h!==L.version||m!==e.toneMapping){d.material.needsUpdate=true;f=L;h=L.version;m=e.toneMapping}d.layers.enableAll();A.unshift(d,d.geometry,d.material,0,0,null)}else if(L&&L.isTexture){if(u===void 0){u=new Sm(new mZ(2,2),new rw({name:"BackgroundMaterial",uniforms:LO(QE.background.uniforms),vertexShader:QE.background.vertexShader,fragmentShader:QE.background.fragmentShader,side:Ik,depthTest:false,depthWrite:false,fog:false,allowOverride:false}));u.geometry.deleteAttribute("normal");Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}});i.update(u)}u.material.uniforms.t2D.value=L;u.material.uniforms.backgroundIntensity.value=P.backgroundIntensity;u.material.toneMapped=dc.getTransfer(L.colorSpace)!==du;if(L.matrixAutoUpdate===true){L.updateMatrix()}u.material.uniforms.uvTransform.value.copy(L.matrix);if(f!==L||h!==L.version||m!==e.toneMapping){u.material.needsUpdate=true;f=L;h=L.version;m=e.toneMapping}u.layers.enableAll();A.unshift(u,u.geometry,u.material,0,0,null)}}function _(A,P){A.getRGB(Kxe,IVe(e));r.buffers.color.setClear(Kxe.r,Kxe.g,Kxe.b,P,a)}function C(){if(d!==void 0){d.geometry.dispose();d.material.dispose();d=void 0}if(u!==void 0){u.geometry.dispose();u.material.dispose();u=void 0}}return{getClearColor:function(){return s},setClearColor:function(A,P=1){s.set(A);l=P;_(s,l)},getClearAlpha:function(){return l},setClearAlpha:function(A){l=A;_(s,l)},render:x,addToRenderList:w,dispose:C}}function qzr(e,t){const n=e.getParameter(e.MAX_VERTEX_ATTRIBS);const r={};const i=h(null);let o=i;let a=false;function s(U,W,H,$,K){let X=false;const j=f($,H,W);if(o!==j){o=j;u(o.object)}X=m(U,$,H,K);if(X)g(U,$,H,K);if(K!==null){t.update(K,e.ELEMENT_ARRAY_BUFFER)}if(X||a){a=false;P(U,W,H,$);if(K!==null){e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.get(K).buffer)}}}function l(){return e.createVertexArray()}function u(U){return e.bindVertexArray(U)}function d(U){return e.deleteVertexArray(U)}function f(U,W,H){const $=H.wireframe===true;let K=r[U.id];if(K===void 0){K={};r[U.id]=K}let X=K[W.id];if(X===void 0){X={};K[W.id]=X}let j=X[$];if(j===void 0){j=h(l());X[$]=j}return j}function h(U){const W=[];const H=[];const $=[];for(let K=0;K=0){const se=K[J];let re=X[J];if(re===void 0){if(J==="instanceMatrix"&&U.instanceMatrix)re=U.instanceMatrix;if(J==="instanceColor"&&U.instanceColor)re=U.instanceColor}if(se===void 0)return true;if(se.attribute!==re)return true;if(re&&se.data!==re.data)return true;j++}}if(o.attributesNum!==j)return true;if(o.index!==$)return true;return false}function g(U,W,H,$){const K={};const X=W.attributes;let j=0;const te=H.getAttributes();for(const J in te){const oe=te[J];if(oe.location>=0){let se=X[J];if(se===void 0){if(J==="instanceMatrix"&&U.instanceMatrix)se=U.instanceMatrix;if(J==="instanceColor"&&U.instanceColor)se=U.instanceColor}const re={};re.attribute=se;if(se&&se.data){re.data=se.data}K[J]=re;j++}}o.attributes=K;o.attributesNum=j;o.index=$}function x(){const U=o.newAttributes;for(let W=0,H=U.length;W=0){let oe=K[te];if(oe===void 0){if(te==="instanceMatrix"&&U.instanceMatrix)oe=U.instanceMatrix;if(te==="instanceColor"&&U.instanceColor)oe=U.instanceColor}if(oe!==void 0){const se=oe.normalized;const re=oe.itemSize;const ce=t.get(oe);if(ce===void 0)continue;const ue=ce.buffer;const xe=ce.type;const be=ce.bytesPerElement;const Ie=xe===e.INT||xe===e.UNSIGNED_INT||oe.gpuType===bxe;if(oe.isInterleavedBufferAttribute){const he=oe.data;const ve=he.stride;const ge=oe.offset;if(he.isInstancedInterleavedBuffer){for(let Ve=0;Ve0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0){return"highp"}N="mediump"}if(N==="mediump"){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0){return"mediump"}}return"lowp"}let u=n.precision!==void 0?n.precision:"highp";const d=l(u);if(d!==u){console.warn("THREE.WebGLRenderer:",u,"not supported, using",d,"instead.");u=d}const f=n.logarithmicDepthBuffer===true;const h=n.reversedDepthBuffer===true&&t.has("EXT_clip_control");const m=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);const g=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS);const x=e.getParameter(e.MAX_TEXTURE_SIZE);const w=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE);const _=e.getParameter(e.MAX_VERTEX_ATTRIBS);const C=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS);const A=e.getParameter(e.MAX_VARYING_VECTORS);const P=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS);const L=g>0;const I=e.getParameter(e.MAX_SAMPLES);return{isWebGL2:true,getMaxAnisotropy:o,getMaxPrecision:l,textureFormatReadable:a,textureTypeReadable:s,precision:u,logarithmicDepthBuffer:f,reversedDepthBuffer:h,maxTextures:m,maxVertexTextures:g,maxTextureSize:x,maxCubemapSize:w,maxAttributes:_,maxVertexUniforms:C,maxVaryings:A,maxFragmentUniforms:P,vertexTextures:L,maxSamples:I}}function Kzr(e){const t=this;let n=null,r=0,i=false,o=false;const a=new YE,s=new Gs,l={value:null,needsUpdate:false};this.uniform=l;this.numPlanes=0;this.numIntersection=0;this.init=function(f,h){const m=f.length!==0||h||r!==0||i;i=h;r=f.length;return m};this.beginShadows=function(){o=true;d(null)};this.endShadows=function(){o=false};this.setGlobalState=function(f,h){n=d(f,h,0)};this.setState=function(f,h,m){const g=f.clippingPlanes,x=f.clipIntersection,w=f.clipShadows;const _=e.get(f);if(!i||g===null||g.length===0||o&&!w){if(o){d(null)}else{u()}}else{const C=o?0:r,A=C*4;let P=_.clippingState||null;l.value=P;P=d(g,h,A,m);for(let L=0;L!==A;++L){P[L]=n[L]}_.clippingState=P;this.numIntersection=x?this.numPlanes:0;this.numPlanes+=C}};function u(){if(l.value!==n){l.value=n;l.needsUpdate=r>0}t.numPlanes=r;t.numIntersection=0}function d(f,h,m,g){const x=f!==null?f.length:0;let w=null;if(x!==0){w=l.value;if(g!==true||w===null){const _=m+x*4,C=h.matrixWorldInverse;s.getNormalMatrix(C);if(w===null||w.length<_){w=new Float32Array(_)}for(let A=0,P=m;A!==x;++A,P+=4){a.copy(f[A]).applyMatrix4(C,s);a.normal.toArray(w,P);w[P+3]=a.constant}}l.value=w;l.needsUpdate=true}t.numPlanes=x;t.numIntersection=0;return w}}function Zzr(e){let t=new WeakMap;function n(a,s){if(s===mxe){a.mapping=PO}else if(s===gxe){a.mapping=IO}return a}function r(a){if(a&&a.isTexture){const s=a.mapping;if(s===mxe||s===gxe){if(t.has(a)){const l=t.get(a).texture;return n(l,a.mapping)}else{const l=a.image;if(l&&l.height>0){const u=new Gbe(l.height);u.fromEquirectangularTexture(e,a);t.set(a,u);a.addEventListener("dispose",i);return n(u.texture,a.mapping)}else{return null}}}}return a}function i(a){const s=a.target;s.removeEventListener("dispose",i);const l=t.get(s);if(l!==void 0){t.delete(s);l.dispose()}}function o(){t=new WeakMap}return{get:r,dispose:o}}var cU=4;var EUt=[.125,.215,.35,.446,.526,.582];var OO=20;var FVe=new xZ;var CUt=new ms;var NVe=null;var OVe=0;var BVe=0;var zVe=false;var NO=(1+Math.sqrt(5))/2;var lU=1/NO;var SUt=[new gr(-NO,lU,0),new gr(NO,lU,0),new gr(-lU,0,NO),new gr(lU,0,NO),new gr(0,NO,-lU),new gr(0,NO,lU),new gr(-1,1,-1),new gr(1,1,-1),new gr(-1,1,1),new gr(1,1,1)];var Jzr=new gr;var Qxe=class{constructor(t){this._renderer=t;this._pingPongRenderTarget=null;this._lodMax=0;this._cubeSize=0;this._lodPlanes=[];this._sizeLods=[];this._sigmas=[];this._blurMaterial=null;this._cubemapMaterial=null;this._equirectMaterial=null;this._compileMaterial(this._blurMaterial)}fromScene(t,n=0,r=.1,i=100,o={}){const{size:a=256,position:s=Jzr}=o;NVe=this._renderer.getRenderTarget();OVe=this._renderer.getActiveCubeFace();BVe=this._renderer.getActiveMipmapLevel();zVe=this._renderer.xr.enabled;this._renderer.xr.enabled=false;this._setSize(a);const l=this._allocateTargets();l.depthBuffer=true;this._sceneToCubeUV(t,r,i,l,s);if(n>0){this._blur(l,0,0,n)}this._applyPMREM(l);this._cleanup(l);return l}fromEquirectangular(t,n=null){return this._fromTexture(t,n)}fromCubemap(t,n=null){return this._fromTexture(t,n)}compileCubemapShader(){if(this._cubemapMaterial===null){this._cubemapMaterial=RUt();this._compileMaterial(this._cubemapMaterial)}}compileEquirectangularShader(){if(this._equirectMaterial===null){this._equirectMaterial=kUt();this._compileMaterial(this._equirectMaterial)}}dispose(){this._dispose();if(this._cubemapMaterial!==null)this._cubemapMaterial.dispose();if(this._equirectMaterial!==null)this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t));this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){if(this._blurMaterial!==null)this._blurMaterial.dispose();if(this._pingPongRenderTarget!==null)this._pingPongRenderTarget.dispose();for(let t=0;t2?L:0,L,L);f.setRenderTarget(i);if(_){f.render(w,l)}f.render(t,l)}w.geometry.dispose();w.material.dispose();f.toneMapping=m;f.autoClear=h;t.background=C}_textureToCubeUV(t,n){const r=this._renderer;const i=t.mapping===PO||t.mapping===IO;if(i){if(this._cubemapMaterial===null){this._cubemapMaterial=RUt()}this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===false?-1:1}else{if(this._equirectMaterial===null){this._equirectMaterial=kUt()}}const o=i?this._cubemapMaterial:this._equirectMaterial;const a=new Sm(this._lodPlanes[0],o);const s=o.uniforms;s["envMap"].value=t;const l=this._cubeSize;Zxe(n,0,0,3*l,2*l);r.setRenderTarget(n);r.render(a,FVe)}_applyPMREM(t){const n=this._renderer;const r=n.autoClear;n.autoClear=false;const i=this._lodPlanes.length;for(let o=1;oOO){console.warn(`sigmaRadians, ${o}, is too large and will clip, as it requested ${w} samples when the maximum is set to ${OO}`)}const _=[];let C=0;for(let N=0;NA-cU?i-A+cU:0);const I=4*(this._cubeSize-P);Zxe(n,L,I,3*P,2*P);l.setRenderTarget(n);l.render(f,FVe)}};function Qzr(e){const t=[];const n=[];const r=[];let i=e;const o=e-cU+1+EUt.length;for(let a=0;ae-cU){l=EUt[a-e+cU-1]}else if(a===0){l=0}r.push(l);const u=1/(s-2);const d=-u;const f=1+u;const h=[d,d,f,d,f,f,d,d,f,f,d,f];const m=6;const g=6;const x=3;const w=2;const _=1;const C=new Float32Array(x*g*m);const A=new Float32Array(w*g*m);const P=new Float32Array(_*g*m);for(let I=0;I2?0:-1;const z=[N,O,0,N+2/3,O,0,N+2/3,O+1,0,N,O,0,N+2/3,O+1,0,N,O+1,0];C.set(z,x*g*I);A.set(h,w*g*I);const U=[I,I,I,I,I,I];P.set(U,_*g*I)}const L=new wp;L.setAttribute("position",new jb(C,x));L.setAttribute("uv",new jb(A,w));L.setAttribute("faceIndex",new jb(P,_));t.push(L);if(i>cU){i--}}return{lodPlanes:t,sizeLods:n,sigmas:r}}function AUt(e,t,n){const r=new qE(e,t,n);r.texture.mapping=_Z;r.texture.name="PMREM.cubeUv";r.scissorTest=true;return r}function Zxe(e,t,n,r,i){e.viewport.set(t,n,r,i);e.scissor.set(t,n,r,i)}function e9r(e,t,n){const r=new Float32Array(OO);const i=new gr(0,1,0);const o=new rw({name:"SphericalGaussianBlur",defines:{"n":OO,"CUBEUV_TEXEL_WIDTH":1/t,"CUBEUV_TEXEL_HEIGHT":1/n,"CUBEUV_MAX_MIP":`${e}.0`},uniforms:{"envMap":{value:null},"samples":{value:1},"weights":{value:r},"latitudinal":{value:false},"dTheta":{value:0},"mipInt":{value:0},"poleAxis":{value:i}},vertexShader:jVe(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + uniform int samples; + uniform float weights[ n ]; + uniform bool latitudinal; + uniform float dTheta; + uniform float mipInt; + uniform vec3 poleAxis; + + #define ENVMAP_TYPE_CUBE_UV + #include + + vec3 getSample( float theta, vec3 axis ) { + + float cosTheta = cos( theta ); + // Rodrigues' axis-angle rotation + vec3 sampleDirection = vOutputDirection * cosTheta + + cross( axis, vOutputDirection ) * sin( theta ) + + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); + + return bilinearCubeUV( envMap, sampleDirection, mipInt ); + + } + + void main() { + + vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); + + if ( all( equal( axis, vec3( 0.0 ) ) ) ) { + + axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); + + } + + axis = normalize( axis ); + + gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); + + for ( int i = 1; i < n; i++ ) { + + if ( i >= samples ) { + + break; + + } + + float theta = dTheta * float( i ); + gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); + gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); + + } + + } + `,blending:Dk,depthTest:false,depthWrite:false});return o}function kUt(){return new rw({name:"EquirectangularToCubeUV",uniforms:{"envMap":{value:null}},vertexShader:jVe(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + + #include + + void main() { + + vec3 outputDirection = normalize( vOutputDirection ); + vec2 uv = equirectUv( outputDirection ); + + gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); + + } + `,blending:Dk,depthTest:false,depthWrite:false})}function RUt(){return new rw({name:"CubemapToCubeUV",uniforms:{"envMap":{value:null},"flipEnvMap":{value:-1}},vertexShader:jVe(),fragmentShader:` + + precision mediump float; + precision mediump int; + + uniform float flipEnvMap; + + varying vec3 vOutputDirection; + + uniform samplerCube envMap; + + void main() { + + gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); + + } + `,blending:Dk,depthTest:false,depthWrite:false})}function jVe(){return` + + precision mediump float; + precision mediump int; + + attribute float faceIndex; + + varying vec3 vOutputDirection; + + // RH coordinate system; PMREM face-indexing convention + vec3 getDirection( vec2 uv, float face ) { + + uv = 2.0 * uv - 1.0; + + vec3 direction = vec3( uv, 1.0 ); + + if ( face == 0.0 ) { + + direction = direction.zyx; // ( 1, v, u ) pos x + + } else if ( face == 1.0 ) { + + direction = direction.xzy; + direction.xz *= -1.0; // ( -u, 1, -v ) pos y + + } else if ( face == 2.0 ) { + + direction.x *= -1.0; // ( -u, v, 1 ) pos z + + } else if ( face == 3.0 ) { + + direction = direction.zyx; + direction.xz *= -1.0; // ( -1, v, -u ) neg x + + } else if ( face == 4.0 ) { + + direction = direction.xzy; + direction.xy *= -1.0; // ( -u, -1, v ) neg y + + } else if ( face == 5.0 ) { + + direction.z *= -1.0; // ( u, v, -1 ) neg z + + } + + return direction; + + } + + void main() { + + vOutputDirection = getDirection( uv, faceIndex ); + gl_Position = vec4( position, 1.0 ); + + } + `}function t9r(e){let t=new WeakMap;let n=null;function r(s){if(s&&s.isTexture){const l=s.mapping;const u=l===mxe||l===gxe;const d=l===PO||l===IO;if(u||d){let f=t.get(s);const h=f!==void 0?f.texture.pmremVersion:0;if(s.isRenderTargetTexture&&s.pmremVersion!==h){if(n===null)n=new Qxe(e);f=u?n.fromEquirectangular(s,f):n.fromCubemap(s,f);f.texture.pmremVersion=s.pmremVersion;t.set(s,f);return f.texture}else{if(f!==void 0){return f.texture}else{const m=s.image;if(u&&m&&m.height>0||d&&m&&i(m)){if(n===null)n=new Qxe(e);f=u?n.fromEquirectangular(s):n.fromCubemap(s);f.texture.pmremVersion=s.pmremVersion;t.set(s,f);s.addEventListener("dispose",o);return f.texture}else{return null}}}}}return s}function i(s){let l=0;const u=6;for(let d=0;dt.maxTextureSize){L=Math.ceil(P/t.maxTextureSize);P=t.maxTextureSize}const I=new Float32Array(P*L*4*f);const N=new tZ(I,P,L,f);N.type=JE;N.needsUpdate=true;const O=A*4;for(let U=0;U0)return e;const i=t*n;let o=IUt[i];if(o===void 0){o=new Float32Array(i);IUt[i]=o}if(t!==0){r.toArray(o,0);for(let a=1,s=0;a!==t;++a){s+=n;e[a].toArray(o,s)}}return o}function Ep(e,t){if(e.length!==t.length)return false;for(let n=0,r=e.length;n":" "} ${s}: ${n[a]}`)}return r.join("\n")}var BUt=new Gs;function J9r(e){dc._getMatrix(BUt,dc.workingColorSpace,e);const t=`mat3( ${BUt.elements.map(n=>n.toFixed(4))} )`;switch(dc.getTransfer(e)){case JK:return[t,"LinearTransferOETF"];case du:return[t,"sRGBTransferOETF"];default:console.warn("THREE.WebGLProgram: Unsupported color space: ",e);return[t,"LinearTransferOETF"]}}function zUt(e,t,n){const r=e.getShaderParameter(t,e.COMPILE_STATUS);const i=e.getShaderInfoLog(t)||"";const o=i.trim();if(r&&o==="")return"";const a=/ERROR: 0:(\d+)/.exec(o);if(a){const s=parseInt(a[1]);return n.toUpperCase()+"\n\n"+o+"\n\n"+Z9r(e.getShaderSource(t),s)}else{return o}}function Q9r(e,t){const n=J9r(t);return[`vec4 ${e}( vec4 value ) {`,` return ${n[1]}( vec4( value.rgb * ${n[0]}, value.a ) );`,"}"].join("\n")}function eUr(e,t){let n;switch(t){case eUt:n="Linear";break;case tUt:n="Reinhard";break;case nUt:n="Cineon";break;case rUt:n="ACESFilmic";break;case oUt:n="AgX";break;case aUt:n="Neutral";break;case iUt:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t);n="Linear"}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}var Jxe=new gr;function tUr(){dc.getLuminanceCoefficients(Jxe);const e=Jxe.x.toFixed(4);const t=Jxe.y.toFixed(4);const n=Jxe.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${e}, ${t}, ${n} );`," return dot( weights, rgb );","}"].join("\n")}function nUr(e){const t=[e.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",e.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""];return t.filter(kZ).join("\n")}function rUr(e){const t=[];for(const n in e){const r=e[n];if(r===false)continue;t.push("#define "+n+" "+r)}return t.join("\n")}function iUr(e,t){const n={};const r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let i=0;i/gm;function HVe(e){return e.replace(oUr,sUr)}var aUr=new Map;function sUr(e,t){let n=tl[t];if(n===void 0){const r=aUr.get(t);if(r!==void 0){n=tl[r];console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,r)}else{throw new Error("Can not resolve #include <"+t+">")}}return HVe(n)}var lUr=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function $Ut(e){return e.replace(lUr,cUr)}function cUr(e,t,n,r){let i="";for(let o=parseInt(t);o0){w+="\n"}_=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,g].filter(kZ).join("\n");if(_.length>0){_+="\n"}}else{w=[GUt(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,g,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.batchingColor?"#define USE_BATCHING_COLOR":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+d:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&n.flatShading===false?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===false?"#define USE_MORPHNORMALS":"",n.morphColors?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.reversedDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif","\n"].filter(kZ).join("\n");_=[GUt(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,g,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.envMap?"#define "+d:"",n.envMap?"#define "+f:"",h?"#define CUBEUV_TEXEL_WIDTH "+h.texelWidth:"",h?"#define CUBEUV_TEXEL_HEIGHT "+h.texelHeight:"",h?"#define CUBEUV_MAX_MIP "+h.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.dispersion?"#define USE_DISPERSION":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&n.flatShading===false?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor||n.batchingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.reversedDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==ow?"#define TONE_MAPPING":"",n.toneMapping!==ow?tl["tonemapping_pars_fragment"]:"",n.toneMapping!==ow?eUr("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",tl["colorspace_pars_fragment"],Q9r("linearToOutputTexel",n.outputColorSpace),tUr(),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(kZ).join("\n")}a=HVe(a);a=UUt(a,n);a=VUt(a,n);s=HVe(s);s=UUt(s,n);s=VUt(s,n);a=$Ut(a);s=$Ut(s);if(n.isRawShaderMaterial!==true){C="#version 300 es\n";w=[m,"#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+w;_=["#define varying in",n.glslVersion===kVe?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===kVe?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+_}const A=C+w+a;const P=C+_+s;const L=OUt(i,i.VERTEX_SHADER,A);const I=OUt(i,i.FRAGMENT_SHADER,P);i.attachShader(x,L);i.attachShader(x,I);if(n.index0AttributeName!==void 0){i.bindAttribLocation(x,0,n.index0AttributeName)}else if(n.morphTargets===true){i.bindAttribLocation(x,0,"position")}i.linkProgram(x);function N(W){if(e.debug.checkShaderErrors){const H=i.getProgramInfoLog(x)||"";const $=i.getShaderInfoLog(L)||"";const K=i.getShaderInfoLog(I)||"";const X=H.trim();const j=$.trim();const te=K.trim();let J=true;let oe=true;if(i.getProgramParameter(x,i.LINK_STATUS)===false){J=false;if(typeof e.debug.onShaderError==="function"){e.debug.onShaderError(i,x,L,I)}else{const se=zUt(i,L,"vertex");const re=zUt(i,I,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(x,i.VALIDATE_STATUS)+"\n\nMaterial Name: "+W.name+"\nMaterial Type: "+W.type+"\n\nProgram Info Log: "+X+"\n"+se+"\n"+re)}}else if(X!==""){console.warn("THREE.WebGLProgram: Program Info Log:",X)}else if(j===""||te===""){oe=false}if(oe){W.diagnostics={runnable:J,programLog:X,vertexShader:{log:j,prefix:w},fragmentShader:{log:te,prefix:_}}}}i.deleteShader(L);i.deleteShader(I);O=new uU(i,x);z=iUr(i,x)}let O;this.getUniforms=function(){if(O===void 0){N(this)}return O};let z;this.getAttributes=function(){if(z===void 0){N(this)}return z};let U=n.rendererExtensionParallelShaderCompile===false;this.isReady=function(){if(U===false){U=i.getProgramParameter(x,j9r)}return U};this.destroy=function(){r.releaseStatesOfProgram(this);i.deleteProgram(x);this.program=void 0};this.type=n.shaderType;this.name=n.shaderName;this.id=K9r++;this.cacheKey=t;this.usedTimes=1;this.program=x;this.vertexShader=L;this.fragmentShader=I;return this}var gUr=0;var WVe=class{constructor(){this.shaderCache=new Map;this.materialCache=new Map}update(t){const n=t.vertexShader;const r=t.fragmentShader;const i=this._getShaderStage(n);const o=this._getShaderStage(r);const a=this._getShaderCacheForMaterial(t);if(a.has(i)===false){a.add(i);i.usedTimes++}if(a.has(o)===false){a.add(o);o.usedTimes++}return this}remove(t){const n=this.materialCache.get(t);for(const r of n){r.usedTimes--;if(r.usedTimes===0)this.shaderCache.delete(r.code)}this.materialCache.delete(t);return this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear();this.materialCache.clear()}_getShaderCacheForMaterial(t){const n=this.materialCache;let r=n.get(t);if(r===void 0){r=new Set;n.set(t,r)}return r}_getShaderStage(t){const n=this.shaderCache;let r=n.get(t);if(r===void 0){r=new YVe(t);n.set(t,r)}return r}};var YVe=class{constructor(t){this.id=gUr++;this.code=t;this.usedTimes=0}};function yUr(e,t,n,r,i,o,a){const s=new rZ;const l=new WVe;const u=new Set;const d=[];const f=i.logarithmicDepthBuffer;const h=i.vertexTextures;let m=i.precision;const g={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function x(z){u.add(z);if(z===0)return"uv";return`uv${z}`}function w(z,U,W,H,$){const K=H.fog;const X=$.geometry;const j=z.isMeshStandardMaterial?H.environment:null;const te=(z.isMeshStandardMaterial?n:t).get(z.envMap||j);const J=!!te&&te.mapping===_Z?te.image.height:null;const oe=g[z.type];if(z.precision!==null){m=i.getMaxPrecision(z.precision);if(m!==z.precision){console.warn("THREE.WebGLProgram.getParameters:",z.precision,"not supported, using",m,"instead.")}}const se=X.morphAttributes.position||X.morphAttributes.normal||X.morphAttributes.color;const re=se!==void 0?se.length:0;let ce=0;if(X.morphAttributes.position!==void 0)ce=1;if(X.morphAttributes.normal!==void 0)ce=2;if(X.morphAttributes.color!==void 0)ce=3;let ue,xe;let be,Ie;if(oe){const cr=QE[oe];ue=cr.vertexShader;xe=cr.fragmentShader}else{ue=z.vertexShader;xe=z.fragmentShader;l.update(z);be=l.getVertexShaderID(z);Ie=l.getFragmentShaderID(z)}const he=e.getRenderTarget();const ve=e.state.buffers.depth.getReversed();const ge=$.isInstancedMesh===true;const Ve=$.isBatchedMesh===true;const Le=!!z.map;const $e=!!z.matcap;const Ee=!!te;const tt=!!z.aoMap;const yt=!!z.lightMap;const mt=!!z.bumpMap;const ct=!!z.normalMap;const Ge=!!z.displacementMap;const it=!!z.emissiveMap;const bt=!!z.metalnessMap;const He=!!z.roughnessMap;const Je=z.anisotropy>0;const Te=z.clearcoat>0;const we=z.dispersion>0;const Ze=z.iridescence>0;const Be=z.sheen>0;const qe=z.transmission>0;const Qe=Je&&!!z.anisotropyMap;const ze=Te&&!!z.clearcoatMap;const Me=Te&&!!z.clearcoatNormalMap;const ye=Te&&!!z.clearcoatRoughnessMap;const Ne=Ze&&!!z.iridescenceMap;const Ae=Ze&&!!z.iridescenceThicknessMap;const dt=Be&&!!z.sheenColorMap;const Oe=Be&&!!z.sheenRoughnessMap;const Wt=!!z.specularMap;const kt=!!z.specularColorMap;const qt=!!z.specularIntensityMap;const _t=qe&&!!z.transmissionMap;const sn=qe&&!!z.thicknessMap;const Jt=!!z.gradientMap;const Sn=!!z.alphaMap;const Kt=z.alphaTest>0;const mn=!!z.alphaHash;const At=!!z.extensions;let lr=ow;if(z.toneMapped){if(he===null||he.isXRRenderTarget===true){lr=e.toneMapping}}const on={shaderID:oe,shaderType:z.type,shaderName:z.name,vertexShader:ue,fragmentShader:xe,defines:z.defines,customVertexShaderID:be,customFragmentShaderID:Ie,isRawShaderMaterial:z.isRawShaderMaterial===true,glslVersion:z.glslVersion,precision:m,batching:Ve,batchingColor:Ve&&$._colorsTexture!==null,instancing:ge,instancingColor:ge&&$.instanceColor!==null,instancingMorph:ge&&$.morphTexture!==null,supportsVertexTextures:h,outputColorSpace:he===null?e.outputColorSpace:he.isXRRenderTarget===true?he.texture.colorSpace:CO,alphaToCoverage:!!z.alphaToCoverage,map:Le,matcap:$e,envMap:Ee,envMapMode:Ee&&te.mapping,envMapCubeUVHeight:J,aoMap:tt,lightMap:yt,bumpMap:mt,normalMap:ct,displacementMap:h&&Ge,emissiveMap:it,normalMapObjectSpace:ct&&z.normalMapType===uUt,normalMapTangentSpace:ct&&z.normalMapType===SVe,metalnessMap:bt,roughnessMap:He,anisotropy:Je,anisotropyMap:Qe,clearcoat:Te,clearcoatMap:ze,clearcoatNormalMap:Me,clearcoatRoughnessMap:ye,dispersion:we,iridescence:Ze,iridescenceMap:Ne,iridescenceThicknessMap:Ae,sheen:Be,sheenColorMap:dt,sheenRoughnessMap:Oe,specularMap:Wt,specularColorMap:kt,specularIntensityMap:qt,transmission:qe,transmissionMap:_t,thicknessMap:sn,gradientMap:Jt,opaque:z.transparent===false&&z.blending===wO&&z.alphaToCoverage===false,alphaMap:Sn,alphaTest:Kt,alphaHash:mn,combine:z.combine,mapUv:Le&&x(z.map.channel),aoMapUv:tt&&x(z.aoMap.channel),lightMapUv:yt&&x(z.lightMap.channel),bumpMapUv:mt&&x(z.bumpMap.channel),normalMapUv:ct&&x(z.normalMap.channel),displacementMapUv:Ge&&x(z.displacementMap.channel),emissiveMapUv:it&&x(z.emissiveMap.channel),metalnessMapUv:bt&&x(z.metalnessMap.channel),roughnessMapUv:He&&x(z.roughnessMap.channel),anisotropyMapUv:Qe&&x(z.anisotropyMap.channel),clearcoatMapUv:ze&&x(z.clearcoatMap.channel),clearcoatNormalMapUv:Me&&x(z.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ye&&x(z.clearcoatRoughnessMap.channel),iridescenceMapUv:Ne&&x(z.iridescenceMap.channel),iridescenceThicknessMapUv:Ae&&x(z.iridescenceThicknessMap.channel),sheenColorMapUv:dt&&x(z.sheenColorMap.channel),sheenRoughnessMapUv:Oe&&x(z.sheenRoughnessMap.channel),specularMapUv:Wt&&x(z.specularMap.channel),specularColorMapUv:kt&&x(z.specularColorMap.channel),specularIntensityMapUv:qt&&x(z.specularIntensityMap.channel),transmissionMapUv:_t&&x(z.transmissionMap.channel),thicknessMapUv:sn&&x(z.thicknessMap.channel),alphaMapUv:Sn&&x(z.alphaMap.channel),vertexTangents:!!X.attributes.tangent&&(ct||Je),vertexColors:z.vertexColors,vertexAlphas:z.vertexColors===true&&!!X.attributes.color&&X.attributes.color.itemSize===4,pointsUvs:$.isPoints===true&&!!X.attributes.uv&&(Le||Sn),fog:!!K,useFog:z.fog===true,fogExp2:!!K&&K.isFogExp2,flatShading:z.flatShading===true&&z.wireframe===false,sizeAttenuation:z.sizeAttenuation===true,logarithmicDepthBuffer:f,reversedDepthBuffer:ve,skinning:$.isSkinnedMesh===true,morphTargets:X.morphAttributes.position!==void 0,morphNormals:X.morphAttributes.normal!==void 0,morphColors:X.morphAttributes.color!==void 0,morphTargetsCount:re,morphTextureStride:ce,numDirLights:U.directional.length,numPointLights:U.point.length,numSpotLights:U.spot.length,numSpotLightMaps:U.spotLightMap.length,numRectAreaLights:U.rectArea.length,numHemiLights:U.hemi.length,numDirLightShadows:U.directionalShadowMap.length,numPointLightShadows:U.pointShadowMap.length,numSpotLightShadows:U.spotShadowMap.length,numSpotLightShadowsWithMaps:U.numSpotLightShadowsWithMaps,numLightProbes:U.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:z.dithering,shadowMapEnabled:e.shadowMap.enabled&&W.length>0,shadowMapType:e.shadowMap.type,toneMapping:lr,decodeVideoTexture:Le&&z.map.isVideoTexture===true&&dc.getTransfer(z.map.colorSpace)===du,decodeVideoTextureEmissive:it&&z.emissiveMap.isVideoTexture===true&&dc.getTransfer(z.emissiveMap.colorSpace)===du,premultipliedAlpha:z.premultipliedAlpha,doubleSided:z.side===ZE,flipSided:z.side===D0,useDepthPacking:z.depthPacking>=0,depthPacking:z.depthPacking||0,index0AttributeName:z.index0AttributeName,extensionClipCullDistance:At&&z.extensions.clipCullDistance===true&&r.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(At&&z.extensions.multiDraw===true||Ve)&&r.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:z.customProgramCacheKey()};on.vertexUv1s=u.has(1);on.vertexUv2s=u.has(2);on.vertexUv3s=u.has(3);u.clear();return on}function _(z){const U=[];if(z.shaderID){U.push(z.shaderID)}else{U.push(z.customVertexShaderID);U.push(z.customFragmentShaderID)}if(z.defines!==void 0){for(const W in z.defines){U.push(W);U.push(z.defines[W])}}if(z.isRawShaderMaterial===false){C(U,z);A(U,z);U.push(e.outputColorSpace)}U.push(z.customProgramCacheKey);return U.join()}function C(z,U){z.push(U.precision);z.push(U.outputColorSpace);z.push(U.envMapMode);z.push(U.envMapCubeUVHeight);z.push(U.mapUv);z.push(U.alphaMapUv);z.push(U.lightMapUv);z.push(U.aoMapUv);z.push(U.bumpMapUv);z.push(U.normalMapUv);z.push(U.displacementMapUv);z.push(U.emissiveMapUv);z.push(U.metalnessMapUv);z.push(U.roughnessMapUv);z.push(U.anisotropyMapUv);z.push(U.clearcoatMapUv);z.push(U.clearcoatNormalMapUv);z.push(U.clearcoatRoughnessMapUv);z.push(U.iridescenceMapUv);z.push(U.iridescenceThicknessMapUv);z.push(U.sheenColorMapUv);z.push(U.sheenRoughnessMapUv);z.push(U.specularMapUv);z.push(U.specularColorMapUv);z.push(U.specularIntensityMapUv);z.push(U.transmissionMapUv);z.push(U.thicknessMapUv);z.push(U.combine);z.push(U.fogExp2);z.push(U.sizeAttenuation);z.push(U.morphTargetsCount);z.push(U.morphAttributeCount);z.push(U.numDirLights);z.push(U.numPointLights);z.push(U.numSpotLights);z.push(U.numSpotLightMaps);z.push(U.numHemiLights);z.push(U.numRectAreaLights);z.push(U.numDirLightShadows);z.push(U.numPointLightShadows);z.push(U.numSpotLightShadows);z.push(U.numSpotLightShadowsWithMaps);z.push(U.numLightProbes);z.push(U.shadowMapType);z.push(U.toneMapping);z.push(U.numClippingPlanes);z.push(U.numClipIntersection);z.push(U.depthPacking)}function A(z,U){s.disableAll();if(U.supportsVertexTextures)s.enable(0);if(U.instancing)s.enable(1);if(U.instancingColor)s.enable(2);if(U.instancingMorph)s.enable(3);if(U.matcap)s.enable(4);if(U.envMap)s.enable(5);if(U.normalMapObjectSpace)s.enable(6);if(U.normalMapTangentSpace)s.enable(7);if(U.clearcoat)s.enable(8);if(U.iridescence)s.enable(9);if(U.alphaTest)s.enable(10);if(U.vertexColors)s.enable(11);if(U.vertexAlphas)s.enable(12);if(U.vertexUv1s)s.enable(13);if(U.vertexUv2s)s.enable(14);if(U.vertexUv3s)s.enable(15);if(U.vertexTangents)s.enable(16);if(U.anisotropy)s.enable(17);if(U.alphaHash)s.enable(18);if(U.batching)s.enable(19);if(U.dispersion)s.enable(20);if(U.batchingColor)s.enable(21);if(U.gradientMap)s.enable(22);z.push(s.mask);s.disableAll();if(U.fog)s.enable(0);if(U.useFog)s.enable(1);if(U.flatShading)s.enable(2);if(U.logarithmicDepthBuffer)s.enable(3);if(U.reversedDepthBuffer)s.enable(4);if(U.skinning)s.enable(5);if(U.morphTargets)s.enable(6);if(U.morphNormals)s.enable(7);if(U.morphColors)s.enable(8);if(U.premultipliedAlpha)s.enable(9);if(U.shadowMapEnabled)s.enable(10);if(U.doubleSided)s.enable(11);if(U.flipSided)s.enable(12);if(U.useDepthPacking)s.enable(13);if(U.dithering)s.enable(14);if(U.transmission)s.enable(15);if(U.sheen)s.enable(16);if(U.opaque)s.enable(17);if(U.pointsUvs)s.enable(18);if(U.decodeVideoTexture)s.enable(19);if(U.decodeVideoTextureEmissive)s.enable(20);if(U.alphaToCoverage)s.enable(21);z.push(s.mask)}function P(z){const U=g[z.type];let W;if(U){const H=QE[U];W=_Ut.clone(H.uniforms)}else{W=z.uniforms}return W}function L(z,U){let W;for(let H=0,$=d.length;H<$;H++){const K=d[H];if(K.cacheKey===U){W=K;++W.usedTimes;break}}if(W===void 0){W=new mUr(e,U,z,o);d.push(W)}return W}function I(z){if(--z.usedTimes===0){const U=d.indexOf(z);d[U]=d[d.length-1];d.pop();z.destroy()}}function N(z){l.remove(z)}function O(){l.dispose()}return{getParameters:w,getProgramCacheKey:_,getUniforms:P,acquireProgram:L,releaseProgram:I,releaseShaderCache:N,programs:d,dispose:O}}function bUr(){let e=new WeakMap;function t(a){return e.has(a)}function n(a){let s=e.get(a);if(s===void 0){s={};e.set(a,s)}return s}function r(a){e.delete(a)}function i(a,s,l){e.get(a)[s]=l}function o(){e=new WeakMap}return{has:t,get:n,remove:r,update:i,dispose:o}}function xUr(e,t){if(e.groupOrder!==t.groupOrder){return e.groupOrder-t.groupOrder}else if(e.renderOrder!==t.renderOrder){return e.renderOrder-t.renderOrder}else if(e.material.id!==t.material.id){return e.material.id-t.material.id}else if(e.z!==t.z){return e.z-t.z}else{return e.id-t.id}}function HUt(e,t){if(e.groupOrder!==t.groupOrder){return e.groupOrder-t.groupOrder}else if(e.renderOrder!==t.renderOrder){return e.renderOrder-t.renderOrder}else if(e.z!==t.z){return t.z-e.z}else{return e.id-t.id}}function WUt(){const e=[];let t=0;const n=[];const r=[];const i=[];function o(){t=0;n.length=0;r.length=0;i.length=0}function a(f,h,m,g,x,w){let _=e[t];if(_===void 0){_={id:f.id,object:f,geometry:h,material:m,groupOrder:g,renderOrder:f.renderOrder,z:x,group:w};e[t]=_}else{_.id=f.id;_.object=f;_.geometry=h;_.material=m;_.groupOrder=g;_.renderOrder=f.renderOrder;_.z=x;_.group=w}t++;return _}function s(f,h,m,g,x,w){const _=a(f,h,m,g,x,w);if(m.transmission>0){r.push(_)}else if(m.transparent===true){i.push(_)}else{n.push(_)}}function l(f,h,m,g,x,w){const _=a(f,h,m,g,x,w);if(m.transmission>0){r.unshift(_)}else if(m.transparent===true){i.unshift(_)}else{n.unshift(_)}}function u(f,h){if(n.length>1)n.sort(f||xUr);if(r.length>1)r.sort(h||HUt);if(i.length>1)i.sort(h||HUt)}function d(){for(let f=t,h=e.length;f=o.length){a=new WUt;o.push(a)}else{a=o[i]}}return a}function n(){e=new WeakMap}return{get:t,dispose:n}}function _Ur(){const e={};return{get:function(t){if(e[t.id]!==void 0){return e[t.id]}let n;switch(t.type){case"DirectionalLight":n={direction:new gr,color:new ms};break;case"SpotLight":n={position:new gr,direction:new gr,color:new ms,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new gr,color:new ms,distance:0,decay:0};break;case"HemisphereLight":n={direction:new gr,skyColor:new ms,groundColor:new ms};break;case"RectAreaLight":n={color:new ms,position:new gr,halfWidth:new gr,halfHeight:new gr};break}e[t.id]=n;return n}}}function TUr(){const e={};return{get:function(t){if(e[t.id]!==void 0){return e[t.id]}let n;switch(t.type){case"DirectionalLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ys};break;case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ys};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ys,shadowCameraNear:1,shadowCameraFar:1e3};break}e[t.id]=n;return n}}}var wUr=0;function EUr(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+(t.map?1:0)-(e.map?1:0)}function CUr(e){const t=new _Ur;const n=TUr();const r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let u=0;u<9;u++)r.probe.push(new gr);const i=new gr;const o=new vf;const a=new vf;function s(u){let d=0,f=0,h=0;for(let z=0;z<9;z++)r.probe[z].set(0,0,0);let m=0;let g=0;let x=0;let w=0;let _=0;let C=0;let A=0;let P=0;let L=0;let I=0;let N=0;u.sort(EUr);for(let z=0,U=u.length;z0){if(e.has("OES_texture_float_linear")===true){r.rectAreaLTC1=vo.LTC_FLOAT_1;r.rectAreaLTC2=vo.LTC_FLOAT_2}else{r.rectAreaLTC1=vo.LTC_HALF_1;r.rectAreaLTC2=vo.LTC_HALF_2}}r.ambient[0]=d;r.ambient[1]=f;r.ambient[2]=h;const O=r.hash;if(O.directionalLength!==m||O.pointLength!==g||O.spotLength!==x||O.rectAreaLength!==w||O.hemiLength!==_||O.numDirectionalShadows!==C||O.numPointShadows!==A||O.numSpotShadows!==P||O.numSpotMaps!==L||O.numLightProbes!==N){r.directional.length=m;r.spot.length=x;r.rectArea.length=w;r.point.length=g;r.hemi.length=_;r.directionalShadow.length=C;r.directionalShadowMap.length=C;r.pointShadow.length=A;r.pointShadowMap.length=A;r.spotShadow.length=P;r.spotShadowMap.length=P;r.directionalShadowMatrix.length=C;r.pointShadowMatrix.length=A;r.spotLightMatrix.length=P+L-I;r.spotLightMap.length=L;r.numSpotLightShadowsWithMaps=I;r.numLightProbes=N;O.directionalLength=m;O.pointLength=g;O.spotLength=x;O.rectAreaLength=w;O.hemiLength=_;O.numDirectionalShadows=C;O.numPointShadows=A;O.numSpotShadows=P;O.numSpotMaps=L;O.numLightProbes=N;r.version=wUr++}}function l(u,d){let f=0;let h=0;let m=0;let g=0;let x=0;const w=d.matrixWorldInverse;for(let _=0,C=u.length;_=a.length){s=new YUt(e);a.push(s)}else{s=a[o]}}return s}function r(){t=new WeakMap}return{get:n,dispose:r}}var AUr="void main() {\n gl_Position = vec4( position, 1.0 );\n}";var kUr="uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n const float samples = float( VSM_SAMPLES );\n float mean = 0.0;\n float squared_mean = 0.0;\n float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n float uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n for ( float i = 0.0; i < samples; i ++ ) {\n float uvOffset = uvStart + i * uvStride;\n #ifdef HORIZONTAL_PASS\n vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean / samples;\n squared_mean = squared_mean / samples;\n float std_dev = sqrt( squared_mean - mean * mean );\n gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}";function RUr(e,t,n){let r=new nU;const i=new Ys,o=new Ys,a=new fu,s=new Xbe({depthPacking:cUt}),l=new jbe,u={},d=n.maxTextureSize;const f={[Ik]:D0,[D0]:Ik,[ZE]:ZE};const h=new rw({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ys},radius:{value:4}},vertexShader:AUr,fragmentShader:kUr});const m=h.clone();m.defines.HORIZONTAL_PASS=1;const g=new wp;g.setAttribute("position",new jb(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const x=new Sm(g,h);const w=this;this.enabled=false;this.autoUpdate=true;this.needsUpdate=false;this.type=fVe;let _=this.type;this.render=function(I,N,O){if(w.enabled===false)return;if(w.autoUpdate===false&&w.needsUpdate===false)return;if(I.length===0)return;const z=e.getRenderTarget();const U=e.getActiveCubeFace();const W=e.getActiveMipmapLevel();const H=e.state;H.setBlending(Dk);if(H.buffers.depth.getReversed()){H.buffers.color.setClear(0,0,0,0)}else{H.buffers.color.setClear(1,1,1,1)}H.buffers.depth.setTest(true);H.setScissorTest(false);const $=_!==KE&&this.type===KE;const K=_===KE&&this.type!==KE;for(let X=0,j=I.length;Xd||i.y>d){if(i.x>d){o.x=Math.floor(d/oe.x);i.x=o.x*oe.x;J.mapSize.x=o.x}if(i.y>d){o.y=Math.floor(d/oe.y);i.y=o.y*oe.y;J.mapSize.y=o.y}}if(J.map===null||$===true||K===true){const re=this.type!==KE?{minFilter:o_,magFilter:o_}:{};if(J.map!==null){J.map.dispose()}J.map=new qE(i.x,i.y,re);J.map.texture.name=te.name+".shadowMap";J.camera.updateProjectionMatrix()}e.setRenderTarget(J.map);e.clear();const se=J.getViewportCount();for(let re=0;re0||N.map&&N.alphaTest>0||N.alphaToCoverage===true){const H=U.uuid,$=N.uuid;let K=u[H];if(K===void 0){K={};u[H]=K}let X=K[$];if(X===void 0){X=U.clone();K[$]=X;N.addEventListener("dispose",L)}U=X}}U.visible=N.visible;U.wireframe=N.wireframe;if(z===KE){U.side=N.shadowSide!==null?N.shadowSide:N.side}else{U.side=N.shadowSide!==null?N.shadowSide:f[N.side]}U.alphaMap=N.alphaMap;U.alphaTest=N.alphaToCoverage===true?.5:N.alphaTest;U.map=N.map;U.clipShadows=N.clipShadows;U.clippingPlanes=N.clippingPlanes;U.clipIntersection=N.clipIntersection;U.displacementMap=N.displacementMap;U.displacementScale=N.displacementScale;U.displacementBias=N.displacementBias;U.wireframeLinewidth=N.wireframeLinewidth;U.linewidth=N.linewidth;if(O.isPointLight===true&&U.isMeshDistanceMaterial===true){const H=e.properties.get(U);H.light=O}return U}function P(I,N,O,z,U){if(I.visible===false)return;const W=I.layers.test(N.layers);if(W&&(I.isMesh||I.isLine||I.isPoints)){if((I.castShadow||I.receiveShadow&&U===KE)&&(!I.frustumCulled||r.intersectsObject(I))){I.modelViewMatrix.multiplyMatrices(O.matrixWorldInverse,I.matrixWorld);const $=t.update(I);const K=I.material;if(Array.isArray(K)){const X=$.groups;for(let j=0,te=X.length;j=1}else if(J.indexOf("OpenGL ES")!==-1){te=parseFloat(/^OpenGL ES (\d)/.exec(J)[1]);j=te>=2}let oe=null;let se={};const re=e.getParameter(e.SCISSOR_BOX);const ce=e.getParameter(e.VIEWPORT);const ue=new fu().fromArray(re);const xe=new fu().fromArray(ce);function be(_t,sn,Jt,Sn){const Kt=new Uint8Array(4);const mn=e.createTexture();e.bindTexture(_t,mn);e.texParameteri(_t,e.TEXTURE_MIN_FILTER,e.NEAREST);e.texParameteri(_t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let At=0;AtZe||qe.height>Ze){Be=Ze/Math.max(qe.width,qe.height)}if(Be<1){if(typeof HTMLImageElement!=="undefined"&&Te instanceof HTMLImageElement||typeof HTMLCanvasElement!=="undefined"&&Te instanceof HTMLCanvasElement||typeof ImageBitmap!=="undefined"&&Te instanceof ImageBitmap||typeof VideoFrame!=="undefined"&&Te instanceof VideoFrame){const Qe=Math.floor(Be*qe.width);const ze=Math.floor(Be*qe.height);if(f===void 0)f=g(Qe,ze);const Me=we?g(Qe,ze):f;Me.width=Qe;Me.height=ze;const ye=Me.getContext("2d");ye.drawImage(Te,0,0,Qe,ze);console.warn("THREE.WebGLRenderer: Texture has been resized from ("+qe.width+"x"+qe.height+") to ("+Qe+"x"+ze+").");return Me}else{if("data"in Te){console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+qe.width+"x"+qe.height+").")}return Te}}return Te}function w(Te){return Te.generateMipmaps}function _(Te){e.generateMipmap(Te)}function C(Te){if(Te.isWebGLCubeRenderTarget)return e.TEXTURE_CUBE_MAP;if(Te.isWebGL3DRenderTarget)return e.TEXTURE_3D;if(Te.isWebGLArrayRenderTarget||Te.isCompressedArrayTexture)return e.TEXTURE_2D_ARRAY;return e.TEXTURE_2D}function A(Te,we,Ze,Be,qe=false){if(Te!==null){if(e[Te]!==void 0)return e[Te];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+Te+"'")}let Qe=we;if(we===e.RED){if(Ze===e.FLOAT)Qe=e.R32F;if(Ze===e.HALF_FLOAT)Qe=e.R16F;if(Ze===e.UNSIGNED_BYTE)Qe=e.R8}if(we===e.RED_INTEGER){if(Ze===e.UNSIGNED_BYTE)Qe=e.R8UI;if(Ze===e.UNSIGNED_SHORT)Qe=e.R16UI;if(Ze===e.UNSIGNED_INT)Qe=e.R32UI;if(Ze===e.BYTE)Qe=e.R8I;if(Ze===e.SHORT)Qe=e.R16I;if(Ze===e.INT)Qe=e.R32I}if(we===e.RG){if(Ze===e.FLOAT)Qe=e.RG32F;if(Ze===e.HALF_FLOAT)Qe=e.RG16F;if(Ze===e.UNSIGNED_BYTE)Qe=e.RG8}if(we===e.RG_INTEGER){if(Ze===e.UNSIGNED_BYTE)Qe=e.RG8UI;if(Ze===e.UNSIGNED_SHORT)Qe=e.RG16UI;if(Ze===e.UNSIGNED_INT)Qe=e.RG32UI;if(Ze===e.BYTE)Qe=e.RG8I;if(Ze===e.SHORT)Qe=e.RG16I;if(Ze===e.INT)Qe=e.RG32I}if(we===e.RGB_INTEGER){if(Ze===e.UNSIGNED_BYTE)Qe=e.RGB8UI;if(Ze===e.UNSIGNED_SHORT)Qe=e.RGB16UI;if(Ze===e.UNSIGNED_INT)Qe=e.RGB32UI;if(Ze===e.BYTE)Qe=e.RGB8I;if(Ze===e.SHORT)Qe=e.RGB16I;if(Ze===e.INT)Qe=e.RGB32I}if(we===e.RGBA_INTEGER){if(Ze===e.UNSIGNED_BYTE)Qe=e.RGBA8UI;if(Ze===e.UNSIGNED_SHORT)Qe=e.RGBA16UI;if(Ze===e.UNSIGNED_INT)Qe=e.RGBA32UI;if(Ze===e.BYTE)Qe=e.RGBA8I;if(Ze===e.SHORT)Qe=e.RGBA16I;if(Ze===e.INT)Qe=e.RGBA32I}if(we===e.RGB){if(Ze===e.UNSIGNED_INT_5_9_9_9_REV)Qe=e.RGB9_E5}if(we===e.RGBA){const ze=qe?JK:dc.getTransfer(Be);if(Ze===e.FLOAT)Qe=e.RGBA32F;if(Ze===e.HALF_FLOAT)Qe=e.RGBA16F;if(Ze===e.UNSIGNED_BYTE)Qe=ze===du?e.SRGB8_ALPHA8:e.RGBA8;if(Ze===e.UNSIGNED_SHORT_4_4_4_4)Qe=e.RGBA4;if(Ze===e.UNSIGNED_SHORT_5_5_5_1)Qe=e.RGB5_A1}if(Qe===e.R16F||Qe===e.R32F||Qe===e.RG16F||Qe===e.RG32F||Qe===e.RGBA16F||Qe===e.RGBA32F){t.get("EXT_color_buffer_float")}return Qe}function P(Te,we){let Ze;if(Te){if(we===null||we===eM||we===aU){Ze=e.DEPTH24_STENCIL8}else if(we===JE){Ze=e.DEPTH32F_STENCIL8}else if(we===iU){Ze=e.DEPTH24_STENCIL8;console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")}}else{if(we===null||we===eM||we===aU){Ze=e.DEPTH_COMPONENT24}else if(we===JE){Ze=e.DEPTH_COMPONENT32F}else if(we===iU){Ze=e.DEPTH_COMPONENT16}}return Ze}function L(Te,we){if(w(Te)===true||Te.isFramebufferTexture&&Te.minFilter!==o_&&Te.minFilter!==tw){return Math.log2(Math.max(we.width,we.height))+1}else if(Te.mipmaps!==void 0&&Te.mipmaps.length>0){return Te.mipmaps.length}else if(Te.isCompressedTexture&&Array.isArray(Te.image)){return we.mipmaps.length}else{return 1}}function I(Te){const we=Te.target;we.removeEventListener("dispose",I);O(we);if(we.isVideoTexture){d.delete(we)}}function N(Te){const we=Te.target;we.removeEventListener("dispose",N);U(we)}function O(Te){const we=r.get(Te);if(we.__webglInit===void 0)return;const Ze=Te.source;const Be=h.get(Ze);if(Be){const qe=Be[we.__cacheKey];qe.usedTimes--;if(qe.usedTimes===0){z(Te)}if(Object.keys(Be).length===0){h.delete(Ze)}}r.remove(Te)}function z(Te){const we=r.get(Te);e.deleteTexture(we.__webglTexture);const Ze=Te.source;const Be=h.get(Ze);delete Be[we.__cacheKey];a.memory.textures--}function U(Te){const we=r.get(Te);if(Te.depthTexture){Te.depthTexture.dispose();r.remove(Te.depthTexture)}if(Te.isWebGLCubeRenderTarget){for(let Be=0;Be<6;Be++){if(Array.isArray(we.__webglFramebuffer[Be])){for(let qe=0;qe=i.maxTextures){console.warn("THREE.WebGLTextures: Trying to use "+Te+" texture units while this GPU supports only "+i.maxTextures)}W+=1;return Te}function K(Te){const we=[];we.push(Te.wrapS);we.push(Te.wrapT);we.push(Te.wrapR||0);we.push(Te.magFilter);we.push(Te.minFilter);we.push(Te.anisotropy);we.push(Te.internalFormat);we.push(Te.format);we.push(Te.type);we.push(Te.generateMipmaps);we.push(Te.premultiplyAlpha);we.push(Te.flipY);we.push(Te.unpackAlignment);we.push(Te.colorSpace);return we.join()}function X(Te,we){const Ze=r.get(Te);if(Te.isVideoTexture)bt(Te);if(Te.isRenderTargetTexture===false&&Te.isExternalTexture!==true&&Te.version>0&&Ze.__version!==Te.version){const Be=Te.image;if(Be===null){console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.")}else if(Be.complete===false){console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}else{Ie(Ze,Te,we);return}}else if(Te.isExternalTexture){Ze.__webglTexture=Te.sourceTexture?Te.sourceTexture:null}n.bindTexture(e.TEXTURE_2D,Ze.__webglTexture,e.TEXTURE0+we)}function j(Te,we){const Ze=r.get(Te);if(Te.isRenderTargetTexture===false&&Te.version>0&&Ze.__version!==Te.version){Ie(Ze,Te,we);return}n.bindTexture(e.TEXTURE_2D_ARRAY,Ze.__webglTexture,e.TEXTURE0+we)}function te(Te,we){const Ze=r.get(Te);if(Te.isRenderTargetTexture===false&&Te.version>0&&Ze.__version!==Te.version){Ie(Ze,Te,we);return}n.bindTexture(e.TEXTURE_3D,Ze.__webglTexture,e.TEXTURE0+we)}function J(Te,we){const Ze=r.get(Te);if(Te.version>0&&Ze.__version!==Te.version){he(Ze,Te,we);return}n.bindTexture(e.TEXTURE_CUBE_MAP,Ze.__webglTexture,e.TEXTURE0+we)}const oe={[Fbe]:e.REPEAT,[X3]:e.CLAMP_TO_EDGE,[Nbe]:e.MIRRORED_REPEAT};const se={[o_]:e.NEAREST,[sUt]:e.NEAREST_MIPMAP_NEAREST,[TZ]:e.NEAREST_MIPMAP_LINEAR,[tw]:e.LINEAR,[yxe]:e.LINEAR_MIPMAP_NEAREST,[Q3]:e.LINEAR_MIPMAP_LINEAR};const re={[dUt]:e.NEVER,[yUt]:e.ALWAYS,[fUt]:e.LESS,[AVe]:e.LEQUAL,[hUt]:e.EQUAL,[gUt]:e.GEQUAL,[pUt]:e.GREATER,[mUt]:e.NOTEQUAL};function ce(Te,we){if(we.type===JE&&t.has("OES_texture_float_linear")===false&&(we.magFilter===tw||we.magFilter===yxe||we.magFilter===TZ||we.magFilter===Q3||we.minFilter===tw||we.minFilter===yxe||we.minFilter===TZ||we.minFilter===Q3)){console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device.")}e.texParameteri(Te,e.TEXTURE_WRAP_S,oe[we.wrapS]);e.texParameteri(Te,e.TEXTURE_WRAP_T,oe[we.wrapT]);if(Te===e.TEXTURE_3D||Te===e.TEXTURE_2D_ARRAY){e.texParameteri(Te,e.TEXTURE_WRAP_R,oe[we.wrapR])}e.texParameteri(Te,e.TEXTURE_MAG_FILTER,se[we.magFilter]);e.texParameteri(Te,e.TEXTURE_MIN_FILTER,se[we.minFilter]);if(we.compareFunction){e.texParameteri(Te,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE);e.texParameteri(Te,e.TEXTURE_COMPARE_FUNC,re[we.compareFunction])}if(t.has("EXT_texture_filter_anisotropic")===true){if(we.magFilter===o_)return;if(we.minFilter!==TZ&&we.minFilter!==Q3)return;if(we.type===JE&&t.has("OES_texture_float_linear")===false)return;if(we.anisotropy>1||r.get(we).__currentAnisotropy){const Ze=t.get("EXT_texture_filter_anisotropic");e.texParameterf(Te,Ze.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(we.anisotropy,i.getMaxAnisotropy()));r.get(we).__currentAnisotropy=we.anisotropy}}}function ue(Te,we){let Ze=false;if(Te.__webglInit===void 0){Te.__webglInit=true;we.addEventListener("dispose",I)}const Be=we.source;let qe=h.get(Be);if(qe===void 0){qe={};h.set(Be,qe)}const Qe=K(we);if(Qe!==Te.__cacheKey){if(qe[Qe]===void 0){qe[Qe]={texture:e.createTexture(),usedTimes:0};a.memory.textures++;Ze=true}qe[Qe].usedTimes++;const ze=qe[Te.__cacheKey];if(ze!==void 0){qe[Te.__cacheKey].usedTimes--;if(ze.usedTimes===0){z(we)}}Te.__cacheKey=Qe;Te.__webglTexture=qe[Qe].texture}return Ze}function xe(Te,we,Ze){return Math.floor(Math.floor(Te/Ze)/we)}function be(Te,we,Ze,Be){const qe=4;const Qe=Te.updateRanges;if(Qe.length===0){n.texSubImage2D(e.TEXTURE_2D,0,0,0,we.width,we.height,Ze,Be,we.data)}else{Qe.sort((Ae,dt)=>Ae.start-dt.start);let ze=0;for(let Ae=1;Ae0){if(_t&&sn){n.texStorage2D(e.TEXTURE_2D,Sn,Wt,qt[0].width,qt[0].height)}for(let Kt=0,mn=qt.length;Kt0){const At=DVe(kt.width,kt.height,we.format,we.type);for(const lr of we.layerUpdates){const on=kt.data.subarray(lr*At/kt.data.BYTES_PER_ELEMENT,(lr+1)*At/kt.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,Kt,0,0,lr,kt.width,kt.height,1,dt,on)}we.clearLayerUpdates()}else{n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,Kt,0,0,0,kt.width,kt.height,Ae.depth,dt,kt.data)}}}else{n.compressedTexImage3D(e.TEXTURE_2D_ARRAY,Kt,Wt,kt.width,kt.height,Ae.depth,0,kt.data,0,0)}}else{console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()")}}else{if(_t){if(Jt){n.texSubImage3D(e.TEXTURE_2D_ARRAY,Kt,0,0,0,kt.width,kt.height,Ae.depth,dt,Oe,kt.data)}}else{n.texImage3D(e.TEXTURE_2D_ARRAY,Kt,Wt,kt.width,kt.height,Ae.depth,0,dt,Oe,kt.data)}}}}else{if(_t&&sn){n.texStorage2D(e.TEXTURE_2D,Sn,Wt,qt[0].width,qt[0].height)}for(let Kt=0,mn=qt.length;Kt0){const Kt=DVe(Ae.width,Ae.height,we.format,we.type);for(const mn of we.layerUpdates){const At=Ae.data.subarray(mn*Kt/Ae.data.BYTES_PER_ELEMENT,(mn+1)*Kt/Ae.data.BYTES_PER_ELEMENT);n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,mn,Ae.width,Ae.height,1,dt,Oe,At)}we.clearLayerUpdates()}else{n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,Ae.width,Ae.height,Ae.depth,dt,Oe,Ae.data)}}}else{n.texImage3D(e.TEXTURE_2D_ARRAY,0,Wt,Ae.width,Ae.height,Ae.depth,0,dt,Oe,Ae.data)}}else if(we.isData3DTexture){if(_t){if(sn){n.texStorage3D(e.TEXTURE_3D,Sn,Wt,Ae.width,Ae.height,Ae.depth)}if(Jt){n.texSubImage3D(e.TEXTURE_3D,0,0,0,0,Ae.width,Ae.height,Ae.depth,dt,Oe,Ae.data)}}else{n.texImage3D(e.TEXTURE_3D,0,Wt,Ae.width,Ae.height,Ae.depth,0,dt,Oe,Ae.data)}}else if(we.isFramebufferTexture){if(sn){if(_t){n.texStorage2D(e.TEXTURE_2D,Sn,Wt,Ae.width,Ae.height)}else{let Kt=Ae.width,mn=Ae.height;for(let At=0;At>=1;mn>>=1}}}}else{if(qt.length>0){if(_t&&sn){const Kt=Je(qt[0]);n.texStorage2D(e.TEXTURE_2D,Sn,Wt,Kt.width,Kt.height)}for(let Kt=0,mn=qt.length;Kt0)Sn++;const mn=Je(dt[0]);n.texStorage2D(e.TEXTURE_CUBE_MAP,Sn,qt,mn.width,mn.height)}for(let mn=0;mn<6;mn++){if(Ae){if(_t){if(Jt){n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+mn,0,0,0,dt[mn].width,dt[mn].height,Wt,kt,dt[mn].data)}}else{n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+mn,0,qt,dt[mn].width,dt[mn].height,0,Wt,kt,dt[mn].data)}for(let At=0;At>Qe);const Oe=Math.max(1,we.height>>Qe);if(qe===e.TEXTURE_3D||qe===e.TEXTURE_2D_ARRAY){n.texImage3D(qe,Qe,ye,dt,Oe,we.depth,0,ze,Me,null)}else{n.texImage2D(qe,Qe,ye,dt,Oe,0,ze,Me,null)}}n.bindFramebuffer(e.FRAMEBUFFER,Te);if(it(we)){s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,Be,qe,Ae.__webglTexture,0,Ge(we))}else if(qe===e.TEXTURE_2D||qe>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&qe<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z){e.framebufferTexture2D(e.FRAMEBUFFER,Be,qe,Ae.__webglTexture,Qe)}n.bindFramebuffer(e.FRAMEBUFFER,null)}function ge(Te,we,Ze){e.bindRenderbuffer(e.RENDERBUFFER,Te);if(we.depthBuffer){const Be=we.depthTexture;const qe=Be&&Be.isDepthTexture?Be.type:null;const Qe=P(we.stencilBuffer,qe);const ze=we.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;const Me=Ge(we);const ye=it(we);if(ye){s.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,Me,Qe,we.width,we.height)}else if(Ze){e.renderbufferStorageMultisample(e.RENDERBUFFER,Me,Qe,we.width,we.height)}else{e.renderbufferStorage(e.RENDERBUFFER,Qe,we.width,we.height)}e.framebufferRenderbuffer(e.FRAMEBUFFER,ze,e.RENDERBUFFER,Te)}else{const Be=we.textures;for(let qe=0;qe{delete we.__boundDepthTexture;delete we.__depthDisposeCallback;Be.removeEventListener("dispose",qe)};Be.addEventListener("dispose",qe);we.__depthDisposeCallback=qe}we.__boundDepthTexture=Be}if(Te.depthTexture&&!we.__autoAllocateDepthBuffer){if(Ze)throw new Error("target.depthTexture not supported in Cube render targets");const Be=Te.texture.mipmaps;if(Be&&Be.length>0){Ve(we.__webglFramebuffer[0],Te)}else{Ve(we.__webglFramebuffer,Te)}}else{if(Ze){we.__webglDepthbuffer=[];for(let Be=0;Be<6;Be++){n.bindFramebuffer(e.FRAMEBUFFER,we.__webglFramebuffer[Be]);if(we.__webglDepthbuffer[Be]===void 0){we.__webglDepthbuffer[Be]=e.createRenderbuffer();ge(we.__webglDepthbuffer[Be],Te,false)}else{const qe=Te.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;const Qe=we.__webglDepthbuffer[Be];e.bindRenderbuffer(e.RENDERBUFFER,Qe);e.framebufferRenderbuffer(e.FRAMEBUFFER,qe,e.RENDERBUFFER,Qe)}}}else{const Be=Te.texture.mipmaps;if(Be&&Be.length>0){n.bindFramebuffer(e.FRAMEBUFFER,we.__webglFramebuffer[0])}else{n.bindFramebuffer(e.FRAMEBUFFER,we.__webglFramebuffer)}if(we.__webglDepthbuffer===void 0){we.__webglDepthbuffer=e.createRenderbuffer();ge(we.__webglDepthbuffer,Te,false)}else{const qe=Te.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;const Qe=we.__webglDepthbuffer;e.bindRenderbuffer(e.RENDERBUFFER,Qe);e.framebufferRenderbuffer(e.FRAMEBUFFER,qe,e.RENDERBUFFER,Qe)}}}n.bindFramebuffer(e.FRAMEBUFFER,null)}function $e(Te,we,Ze){const Be=r.get(Te);if(we!==void 0){ve(Be.__webglFramebuffer,Te,Te.texture,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,0)}if(Ze!==void 0){Le(Te)}}function Ee(Te){const we=Te.texture;const Ze=r.get(Te);const Be=r.get(we);Te.addEventListener("dispose",N);const qe=Te.textures;const Qe=Te.isWebGLCubeRenderTarget===true;const ze=qe.length>1;if(!ze){if(Be.__webglTexture===void 0){Be.__webglTexture=e.createTexture()}Be.__version=we.version;a.memory.textures++}if(Qe){Ze.__webglFramebuffer=[];for(let Me=0;Me<6;Me++){if(we.mipmaps&&we.mipmaps.length>0){Ze.__webglFramebuffer[Me]=[];for(let ye=0;ye0){Ze.__webglFramebuffer=[];for(let Me=0;Me0&&it(Te)===false){Ze.__webglMultisampledFramebuffer=e.createFramebuffer();Ze.__webglColorRenderbuffer=[];n.bindFramebuffer(e.FRAMEBUFFER,Ze.__webglMultisampledFramebuffer);for(let Me=0;Me0){for(let ye=0;ye0){for(let ye=0;ye0){if(it(Te)===false){const we=Te.textures;const Ze=Te.width;const Be=Te.height;let qe=e.COLOR_BUFFER_BIT;const Qe=Te.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;const ze=r.get(Te);const Me=we.length>1;if(Me){for(let Ne=0;Ne0){n.bindFramebuffer(e.DRAW_FRAMEBUFFER,ze.__webglFramebuffer[0])}else{n.bindFramebuffer(e.DRAW_FRAMEBUFFER,ze.__webglFramebuffer)}for(let Ne=0;Ne0&&t.has("WEBGL_multisampled_render_to_texture")===true&&we.__useRenderToTexture!==false}function bt(Te){const we=a.render.frame;if(d.get(Te)!==we){d.set(Te,we);Te.update()}}function He(Te,we){const Ze=Te.colorSpace;const Be=Te.format;const qe=Te.type;if(Te.isCompressedTexture===true||Te.isVideoTexture===true)return we;if(Ze!==CO&&Ze!==Fk){if(dc.getTransfer(Ze)===du){if(Be!==s_||qe!==aw){console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.")}}else{console.error("THREE.WebGLTextures: Unsupported texture color space:",Ze)}}return we}function Je(Te){if(typeof HTMLImageElement!=="undefined"&&Te instanceof HTMLImageElement){u.width=Te.naturalWidth||Te.width;u.height=Te.naturalHeight||Te.height}else if(typeof VideoFrame!=="undefined"&&Te instanceof VideoFrame){u.width=Te.displayWidth;u.height=Te.displayHeight}else{u.width=Te.width;u.height=Te.height}return u}this.allocateTextureUnit=$;this.resetTextureUnits=H;this.setTexture2D=X;this.setTexture2DArray=j;this.setTexture3D=te;this.setTextureCube=J;this.rebindTextures=$e;this.setupRenderTarget=Ee;this.updateRenderTargetMipmap=tt;this.updateMultisampleRenderTarget=ct;this.setupDepthRenderbuffer=Le;this.setupFrameBufferTexture=ve;this.useMultisampledRTT=it}function LUr(e,t){function n(r,i=Fk){let o;const a=dc.getTransfer(i);if(r===aw)return e.UNSIGNED_BYTE;if(r===xxe)return e.UNSIGNED_SHORT_4_4_4_4;if(r===vxe)return e.UNSIGNED_SHORT_5_5_5_1;if(r===vVe)return e.UNSIGNED_INT_5_9_9_9_REV;if(r===bVe)return e.BYTE;if(r===xVe)return e.SHORT;if(r===iU)return e.UNSIGNED_SHORT;if(r===bxe)return e.INT;if(r===eM)return e.UNSIGNED_INT;if(r===JE)return e.FLOAT;if(r===oU)return e.HALF_FLOAT;if(r===_Ve)return e.ALPHA;if(r===TVe)return e.RGB;if(r===s_)return e.RGBA;if(r===Z9)return e.DEPTH_COMPONENT;if(r===sU)return e.DEPTH_STENCIL;if(r===wVe)return e.RED;if(r===_xe)return e.RED_INTEGER;if(r===EVe)return e.RG;if(r===Txe)return e.RG_INTEGER;if(r===wxe)return e.RGBA_INTEGER;if(r===wZ||r===EZ||r===CZ||r===SZ){if(a===du){o=t.get("WEBGL_compressed_texture_s3tc_srgb");if(o!==null){if(r===wZ)return o.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(r===EZ)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(r===CZ)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(r===SZ)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{return null}}else{o=t.get("WEBGL_compressed_texture_s3tc");if(o!==null){if(r===wZ)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===EZ)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===CZ)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===SZ)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}else{return null}}}if(r===Exe||r===Cxe||r===Sxe||r===Axe){o=t.get("WEBGL_compressed_texture_pvrtc");if(o!==null){if(r===Exe)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===Cxe)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===Sxe)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===Axe)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else{return null}}if(r===kxe||r===Rxe||r===Pxe){o=t.get("WEBGL_compressed_texture_etc");if(o!==null){if(r===kxe||r===Rxe)return a===du?o.COMPRESSED_SRGB8_ETC2:o.COMPRESSED_RGB8_ETC2;if(r===Pxe)return a===du?o.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:o.COMPRESSED_RGBA8_ETC2_EAC}else{return null}}if(r===Ixe||r===Mxe||r===Lxe||r===Dxe||r===Fxe||r===Nxe||r===Oxe||r===Bxe||r===zxe||r===Uxe||r===Vxe||r===$xe||r===Gxe||r===Hxe){o=t.get("WEBGL_compressed_texture_astc");if(o!==null){if(r===Ixe)return a===du?o.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:o.COMPRESSED_RGBA_ASTC_4x4_KHR;if(r===Mxe)return a===du?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:o.COMPRESSED_RGBA_ASTC_5x4_KHR;if(r===Lxe)return a===du?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:o.COMPRESSED_RGBA_ASTC_5x5_KHR;if(r===Dxe)return a===du?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:o.COMPRESSED_RGBA_ASTC_6x5_KHR;if(r===Fxe)return a===du?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:o.COMPRESSED_RGBA_ASTC_6x6_KHR;if(r===Nxe)return a===du?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:o.COMPRESSED_RGBA_ASTC_8x5_KHR;if(r===Oxe)return a===du?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:o.COMPRESSED_RGBA_ASTC_8x6_KHR;if(r===Bxe)return a===du?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:o.COMPRESSED_RGBA_ASTC_8x8_KHR;if(r===zxe)return a===du?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:o.COMPRESSED_RGBA_ASTC_10x5_KHR;if(r===Uxe)return a===du?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:o.COMPRESSED_RGBA_ASTC_10x6_KHR;if(r===Vxe)return a===du?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:o.COMPRESSED_RGBA_ASTC_10x8_KHR;if(r===$xe)return a===du?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:o.COMPRESSED_RGBA_ASTC_10x10_KHR;if(r===Gxe)return a===du?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:o.COMPRESSED_RGBA_ASTC_12x10_KHR;if(r===Hxe)return a===du?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:o.COMPRESSED_RGBA_ASTC_12x12_KHR}else{return null}}if(r===AZ||r===Wxe||r===Yxe){o=t.get("EXT_texture_compression_bptc");if(o!==null){if(r===AZ)return a===du?o.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:o.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(r===Wxe)return o.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(r===Yxe)return o.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else{return null}}if(r===CVe||r===qxe||r===Xxe||r===jxe){o=t.get("EXT_texture_compression_rgtc");if(o!==null){if(r===AZ)return o.COMPRESSED_RED_RGTC1_EXT;if(r===qxe)return o.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(r===Xxe)return o.COMPRESSED_RED_GREEN_RGTC2_EXT;if(r===jxe)return o.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else{return null}}if(r===aU)return e.UNSIGNED_INT_24_8;return e[r]!==void 0?e[r]:null}return{convert:n}}var e1e=class extends Zb{constructor(t=null){super();this.sourceTexture=t;this.isExternalTexture=true}};var DUr=` +void main() { + + gl_Position = vec4( position, 1.0 ); + +}`;var FUr=` +uniform sampler2DArray depthColor; +uniform float depthWidth; +uniform float depthHeight; + +void main() { + + vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); + + if ( coord.x >= 1.0 ) { + + gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; + + } else { + + gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; + + } + +}`;var qVe=class{constructor(){this.texture=null;this.mesh=null;this.depthNear=0;this.depthFar=0}init(t,n){if(this.texture===null){const r=new e1e(t.texture);if(t.depthNear!==n.depthNear||t.depthFar!==n.depthFar){this.depthNear=t.depthNear;this.depthFar=t.depthFar}this.texture=r}}getMesh(t){if(this.texture!==null){if(this.mesh===null){const n=t.cameras[0].viewport;const r=new rw({vertexShader:DUr,fragmentShader:FUr,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new Sm(new mZ(20,20),r)}}return this.mesh}reset(){this.texture=null;this.mesh=null}getDepthTexture(){return this.texture}};var XVe=class extends Mk{constructor(t,n){super();const r=this;let i=null;let o=1;let a=null;let s="local-floor";let l=1;let u=null;let d=null;let f=null;let h=null;let m=null;let g=null;const x=new qVe;const w={};const _=n.getContextAttributes();let C=null;let A=null;const P=[];const L=[];const I=new Ys;let N=null;const O=new Ry;O.viewport=new fu;const z=new Ry;z.viewport=new fu;const U=[O,z];const W=new oxe;let H=null;let $=null;this.cameraAutoUpdate=true;this.enabled=false;this.isPresenting=false;this.getController=function(be){let Ie=P[be];if(Ie===void 0){Ie=new eU;P[be]=Ie}return Ie.getTargetRaySpace()};this.getControllerGrip=function(be){let Ie=P[be];if(Ie===void 0){Ie=new eU;P[be]=Ie}return Ie.getGripSpace()};this.getHand=function(be){let Ie=P[be];if(Ie===void 0){Ie=new eU;P[be]=Ie}return Ie.getHandSpace()};function K(be){const Ie=L.indexOf(be.inputSource);if(Ie===-1){return}const he=P[Ie];if(he!==void 0){he.update(be.inputSource,be.frame,u||a);he.dispatchEvent({type:be.type,data:be.inputSource})}}function X(){i.removeEventListener("select",K);i.removeEventListener("selectstart",K);i.removeEventListener("selectend",K);i.removeEventListener("squeeze",K);i.removeEventListener("squeezestart",K);i.removeEventListener("squeezeend",K);i.removeEventListener("end",X);i.removeEventListener("inputsourceschange",j);for(let be=0;be=0){L[ve]=null;P[ve].disconnect(he)}}for(let Ie=0;Ie=L.length){L.push(he);ve=Ve;break}else if(L[Ve]===null){L[Ve]=he;ve=Ve;break}}if(ve===-1)break}const ge=P[ve];if(ge){ge.connect(he)}}}const te=new gr;const J=new gr;function oe(be,Ie,he){te.setFromMatrixPosition(Ie.matrixWorld);J.setFromMatrixPosition(he.matrixWorld);const ve=te.distanceTo(J);const ge=Ie.projectionMatrix.elements;const Ve=he.projectionMatrix.elements;const Le=ge[14]/(ge[10]-1);const $e=ge[14]/(ge[10]+1);const Ee=(ge[9]+1)/ge[5];const tt=(ge[9]-1)/ge[5];const yt=(ge[8]-1)/ge[0];const mt=(Ve[8]+1)/Ve[0];const ct=Le*yt;const Ge=Le*mt;const it=ve/(-yt+mt);const bt=it*-yt;Ie.matrixWorld.decompose(be.position,be.quaternion,be.scale);be.translateX(bt);be.translateZ(it);be.matrixWorld.compose(be.position,be.quaternion,be.scale);be.matrixWorldInverse.copy(be.matrixWorld).invert();if(ge[10]===-1){be.projectionMatrix.copy(Ie.projectionMatrix);be.projectionMatrixInverse.copy(Ie.projectionMatrixInverse)}else{const He=Le+it;const Je=$e+it;const Te=ct-bt;const we=Ge+(ve-bt);const Ze=Ee*$e/Je*He;const Be=tt*$e/Je*He;be.projectionMatrix.makePerspective(Te,we,Ze,Be,He,Je);be.projectionMatrixInverse.copy(be.projectionMatrix).invert()}}function se(be,Ie){if(Ie===null){be.matrixWorld.copy(be.matrix)}else{be.matrixWorld.multiplyMatrices(Ie.matrixWorld,be.matrix)}be.matrixWorldInverse.copy(be.matrixWorld).invert()}this.updateCamera=function(be){if(i===null)return;let Ie=be.near;let he=be.far;if(x.texture!==null){if(x.depthNear>0)Ie=x.depthNear;if(x.depthFar>0)he=x.depthFar}W.near=z.near=O.near=Ie;W.far=z.far=O.far=he;if(H!==W.near||$!==W.far){i.updateRenderState({depthNear:W.near,depthFar:W.far});H=W.near;$=W.far}W.layers.mask=be.layers.mask|6;O.layers.mask=W.layers.mask&3;z.layers.mask=W.layers.mask&5;const ve=be.parent;const ge=W.cameras;se(W,ve);for(let Ve=0;Ve0){w.alphaTest.value=_.alphaTest}const C=t.get(_);const A=C.envMap;const P=C.envMapRotation;if(A){w.envMap.value=A;FO.copy(P);FO.x*=-1;FO.y*=-1;FO.z*=-1;if(A.isCubeTexture&&A.isRenderTargetTexture===false){FO.y*=-1;FO.z*=-1}w.envMapRotation.value.setFromMatrix4(NUr.makeRotationFromEuler(FO));w.flipEnvMap.value=A.isCubeTexture&&A.isRenderTargetTexture===false?-1:1;w.reflectivity.value=_.reflectivity;w.ior.value=_.ior;w.refractionRatio.value=_.refractionRatio}if(_.lightMap){w.lightMap.value=_.lightMap;w.lightMapIntensity.value=_.lightMapIntensity;n(_.lightMap,w.lightMapTransform)}if(_.aoMap){w.aoMap.value=_.aoMap;w.aoMapIntensity.value=_.aoMapIntensity;n(_.aoMap,w.aoMapTransform)}}function a(w,_){w.diffuse.value.copy(_.color);w.opacity.value=_.opacity;if(_.map){w.map.value=_.map;n(_.map,w.mapTransform)}}function s(w,_){w.dashSize.value=_.dashSize;w.totalSize.value=_.dashSize+_.gapSize;w.scale.value=_.scale}function l(w,_,C,A){w.diffuse.value.copy(_.color);w.opacity.value=_.opacity;w.size.value=_.size*C;w.scale.value=A*.5;if(_.map){w.map.value=_.map;n(_.map,w.uvTransform)}if(_.alphaMap){w.alphaMap.value=_.alphaMap;n(_.alphaMap,w.alphaMapTransform)}if(_.alphaTest>0){w.alphaTest.value=_.alphaTest}}function u(w,_){w.diffuse.value.copy(_.color);w.opacity.value=_.opacity;w.rotation.value=_.rotation;if(_.map){w.map.value=_.map;n(_.map,w.mapTransform)}if(_.alphaMap){w.alphaMap.value=_.alphaMap;n(_.alphaMap,w.alphaMapTransform)}if(_.alphaTest>0){w.alphaTest.value=_.alphaTest}}function d(w,_){w.specular.value.copy(_.specular);w.shininess.value=Math.max(_.shininess,1e-4)}function f(w,_){if(_.gradientMap){w.gradientMap.value=_.gradientMap}}function h(w,_){w.metalness.value=_.metalness;if(_.metalnessMap){w.metalnessMap.value=_.metalnessMap;n(_.metalnessMap,w.metalnessMapTransform)}w.roughness.value=_.roughness;if(_.roughnessMap){w.roughnessMap.value=_.roughnessMap;n(_.roughnessMap,w.roughnessMapTransform)}if(_.envMap){w.envMapIntensity.value=_.envMapIntensity}}function m(w,_,C){w.ior.value=_.ior;if(_.sheen>0){w.sheenColor.value.copy(_.sheenColor).multiplyScalar(_.sheen);w.sheenRoughness.value=_.sheenRoughness;if(_.sheenColorMap){w.sheenColorMap.value=_.sheenColorMap;n(_.sheenColorMap,w.sheenColorMapTransform)}if(_.sheenRoughnessMap){w.sheenRoughnessMap.value=_.sheenRoughnessMap;n(_.sheenRoughnessMap,w.sheenRoughnessMapTransform)}}if(_.clearcoat>0){w.clearcoat.value=_.clearcoat;w.clearcoatRoughness.value=_.clearcoatRoughness;if(_.clearcoatMap){w.clearcoatMap.value=_.clearcoatMap;n(_.clearcoatMap,w.clearcoatMapTransform)}if(_.clearcoatRoughnessMap){w.clearcoatRoughnessMap.value=_.clearcoatRoughnessMap;n(_.clearcoatRoughnessMap,w.clearcoatRoughnessMapTransform)}if(_.clearcoatNormalMap){w.clearcoatNormalMap.value=_.clearcoatNormalMap;n(_.clearcoatNormalMap,w.clearcoatNormalMapTransform);w.clearcoatNormalScale.value.copy(_.clearcoatNormalScale);if(_.side===D0){w.clearcoatNormalScale.value.negate()}}}if(_.dispersion>0){w.dispersion.value=_.dispersion}if(_.iridescence>0){w.iridescence.value=_.iridescence;w.iridescenceIOR.value=_.iridescenceIOR;w.iridescenceThicknessMinimum.value=_.iridescenceThicknessRange[0];w.iridescenceThicknessMaximum.value=_.iridescenceThicknessRange[1];if(_.iridescenceMap){w.iridescenceMap.value=_.iridescenceMap;n(_.iridescenceMap,w.iridescenceMapTransform)}if(_.iridescenceThicknessMap){w.iridescenceThicknessMap.value=_.iridescenceThicknessMap;n(_.iridescenceThicknessMap,w.iridescenceThicknessMapTransform)}}if(_.transmission>0){w.transmission.value=_.transmission;w.transmissionSamplerMap.value=C.texture;w.transmissionSamplerSize.value.set(C.width,C.height);if(_.transmissionMap){w.transmissionMap.value=_.transmissionMap;n(_.transmissionMap,w.transmissionMapTransform)}w.thickness.value=_.thickness;if(_.thicknessMap){w.thicknessMap.value=_.thicknessMap;n(_.thicknessMap,w.thicknessMapTransform)}w.attenuationDistance.value=_.attenuationDistance;w.attenuationColor.value.copy(_.attenuationColor)}if(_.anisotropy>0){w.anisotropyVector.value.set(_.anisotropy*Math.cos(_.anisotropyRotation),_.anisotropy*Math.sin(_.anisotropyRotation));if(_.anisotropyMap){w.anisotropyMap.value=_.anisotropyMap;n(_.anisotropyMap,w.anisotropyMapTransform)}}w.specularIntensity.value=_.specularIntensity;w.specularColor.value.copy(_.specularColor);if(_.specularColorMap){w.specularColorMap.value=_.specularColorMap;n(_.specularColorMap,w.specularColorMapTransform)}if(_.specularIntensityMap){w.specularIntensityMap.value=_.specularIntensityMap;n(_.specularIntensityMap,w.specularIntensityMapTransform)}}function g(w,_){if(_.matcap){w.matcap.value=_.matcap}}function x(w,_){const C=t.get(_).light;w.referencePosition.value.setFromMatrixPosition(C.matrixWorld);w.nearDistance.value=C.shadow.camera.near;w.farDistance.value=C.shadow.camera.far}return{refreshFogUniforms:r,refreshMaterialUniforms:i}}function BUr(e,t,n,r){let i={};let o={};let a=[];const s=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function l(C,A){const P=A.program;r.uniformBlockBinding(C,P)}function u(C,A){let P=i[C.id];if(P===void 0){g(C);P=d(C);i[C.id]=P;C.addEventListener("dispose",w)}const L=A.program;r.updateUBOMapping(C,L);const I=t.render.frame;if(o[C.id]!==I){h(C);o[C.id]=I}}function d(C){const A=f();C.__bindingPointIndex=A;const P=e.createBuffer();const L=C.__size;const I=C.usage;e.bindBuffer(e.UNIFORM_BUFFER,P);e.bufferData(e.UNIFORM_BUFFER,L,I);e.bindBuffer(e.UNIFORM_BUFFER,null);e.bindBufferBase(e.UNIFORM_BUFFER,A,P);return P}function f(){for(let C=0;C0)P+=L-I;C.__size=P;C.__cache={};return this}function x(C){const A={boundary:0,storage:0};if(typeof C==="number"||typeof C==="boolean"){A.boundary=4;A.storage=4}else if(C.isVector2){A.boundary=8;A.storage=8}else if(C.isVector3||C.isColor){A.boundary=16;A.storage=12}else if(C.isVector4){A.boundary=16;A.storage=16}else if(C.isMatrix3){A.boundary=48;A.storage=48}else if(C.isMatrix4){A.boundary=64;A.storage=64}else if(C.isTexture){console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group.")}else{console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",C)}return A}function w(C){const A=C.target;A.removeEventListener("dispose",w);const P=a.indexOf(A.__bindingPointIndex);a.splice(P,1);e.deleteBuffer(i[A.id]);delete i[A.id];delete o[A.id]}function _(){for(const C in i){e.deleteBuffer(i[C])}a=[];i={};o={}}return{bind:l,update:u,dispose:_}}var t1e=class{constructor(t={}){const{canvas:n=bUt(),context:r=null,depth:i=true,stencil:o=false,alpha:a=false,antialias:s=false,premultipliedAlpha:l=true,preserveDrawingBuffer:u=false,powerPreference:d="default",failIfMajorPerformanceCaveat:f=false,reversedDepthBuffer:h=false}=t;this.isWebGLRenderer=true;let m;if(r!==null){if(typeof WebGLRenderingContext!=="undefined"&&r instanceof WebGLRenderingContext){throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.")}m=r.getContextAttributes().alpha}else{m=a}const g=new Uint32Array(4);const x=new Int32Array(4);let w=null;let _=null;const C=[];const A=[];this.domElement=n;this.debug={checkShaderErrors:true,onShaderError:null};this.autoClear=true;this.autoClearColor=true;this.autoClearDepth=true;this.autoClearStencil=true;this.sortObjects=true;this.clippingPlanes=[];this.localClippingEnabled=false;this.toneMapping=ow;this.toneMappingExposure=1;this.transmissionResolutionScale=1;const P=this;let L=false;this._outputColorSpace=L0;let I=0;let N=0;let O=null;let z=-1;let U=null;const W=new fu;const H=new fu;let $=null;const K=new ms(0);let X=0;let j=n.width;let te=n.height;let J=1;let oe=null;let se=null;const re=new fu(0,0,j,te);const ce=new fu(0,0,j,te);let ue=false;const xe=new nU;let be=false;let Ie=false;const he=new vf;const ve=new gr;const ge=new fu;const Ve={background:null,fog:null,environment:null,overrideMaterial:null,isScene:true};let Le=false;function $e(){return O===null?J:1}let Ee=r;function tt(Et,Tn){return n.getContext(Et,Tn)}try{const Et={alpha:true,depth:i,stencil:o,antialias:s,premultipliedAlpha:l,preserveDrawingBuffer:u,powerPreference:d,failIfMajorPerformanceCaveat:f};if("setAttribute"in n)n.setAttribute("data-engine",`three.js r${axe}`);n.addEventListener("webglcontextlost",Jt,false);n.addEventListener("webglcontextrestored",Sn,false);n.addEventListener("webglcontextcreationerror",Kt,false);if(Ee===null){const Tn="webgl2";Ee=tt(Tn,Et);if(Ee===null){if(tt(Tn)){throw new Error("Error creating WebGL context with your selected attributes.")}else{throw new Error("Error creating WebGL context.")}}}}catch(Et){console.error("THREE.WebGLRenderer: "+Et.message);throw Et}let yt,mt,ct,Ge;let it,bt,He,Je,Te,we,Ze;let Be,qe,Qe,ze,Me,ye;let Ne,Ae,dt,Oe;let Wt,kt,qt;function _t(){yt=new n9r(Ee);yt.init();Wt=new LUr(Ee,yt);mt=new jzr(Ee,yt,t,Wt);ct=new IUr(Ee,yt);if(mt.reversedDepthBuffer&&h){ct.buffers.depth.setReversed(true)}Ge=new o9r(Ee);it=new bUr;bt=new MUr(Ee,yt,ct,it,mt,Wt,Ge);He=new Zzr(P);Je=new t9r(P);Te=new d8r(Ee);kt=new qzr(Ee,Te);we=new r9r(Ee,Te,Ge,kt);Ze=new s9r(Ee,we,Te,Ge);Ae=new a9r(Ee,mt,bt);Me=new Kzr(it);Be=new yUr(P,He,Je,yt,mt,kt,Me);qe=new OUr(P,it);Qe=new vUr;ze=new SUr(yt);Ne=new Yzr(P,He,Je,ct,Ze,m,l);ye=new RUr(P,Ze,mt);qt=new BUr(Ee,Ge,mt,ct);dt=new Xzr(Ee,yt,Ge);Oe=new i9r(Ee,yt,Ge);Ge.programs=Be.programs;P.capabilities=mt;P.extensions=yt;P.properties=it;P.renderLists=Qe;P.shadowMap=ye;P.state=ct;P.info=Ge}_t();const sn=new XVe(P,Ee);this.xr=sn;this.getContext=function(){return Ee};this.getContextAttributes=function(){return Ee.getContextAttributes()};this.forceContextLoss=function(){const Et=yt.get("WEBGL_lose_context");if(Et)Et.loseContext()};this.forceContextRestore=function(){const Et=yt.get("WEBGL_lose_context");if(Et)Et.restoreContext()};this.getPixelRatio=function(){return J};this.setPixelRatio=function(Et){if(Et===void 0)return;J=Et;this.setSize(j,te,false)};this.getSize=function(Et){return Et.set(j,te)};this.setSize=function(Et,Tn,ft=true){if(sn.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}j=Et;te=Tn;n.width=Math.floor(Et*J);n.height=Math.floor(Tn*J);if(ft===true){n.style.width=Et+"px";n.style.height=Tn+"px"}this.setViewport(0,0,Et,Tn)};this.getDrawingBufferSize=function(Et){return Et.set(j*J,te*J).floor()};this.setDrawingBufferSize=function(Et,Tn,ft){j=Et;te=Tn;J=ft;n.width=Math.floor(Et*ft);n.height=Math.floor(Tn*ft);this.setViewport(0,0,Et,Tn)};this.getCurrentViewport=function(Et){return Et.copy(W)};this.getViewport=function(Et){return Et.copy(re)};this.setViewport=function(Et,Tn,ft,zt){if(Et.isVector4){re.set(Et.x,Et.y,Et.z,Et.w)}else{re.set(Et,Tn,ft,zt)}ct.viewport(W.copy(re).multiplyScalar(J).round())};this.getScissor=function(Et){return Et.copy(ce)};this.setScissor=function(Et,Tn,ft,zt){if(Et.isVector4){ce.set(Et.x,Et.y,Et.z,Et.w)}else{ce.set(Et,Tn,ft,zt)}ct.scissor(H.copy(ce).multiplyScalar(J).round())};this.getScissorTest=function(){return ue};this.setScissorTest=function(Et){ct.setScissorTest(ue=Et)};this.setOpaqueSort=function(Et){oe=Et};this.setTransparentSort=function(Et){se=Et};this.getClearColor=function(Et){return Et.copy(Ne.getClearColor())};this.setClearColor=function(){Ne.setClearColor(...arguments)};this.getClearAlpha=function(){return Ne.getClearAlpha()};this.setClearAlpha=function(){Ne.setClearAlpha(...arguments)};this.clear=function(Et=true,Tn=true,ft=true){let zt=0;if(Et){let Gt=false;if(O!==null){const gn=O.texture.format;Gt=gn===wxe||gn===Txe||gn===_xe}if(Gt){const gn=O.texture.type;const Fn=gn===aw||gn===eM||gn===iU||gn===aU||gn===xxe||gn===vxe;const Tr=Ne.getClearColor();const Jr=Ne.getClearAlpha();const jr=Tr.r;const sr=Tr.g;const bn=Tr.b;if(Fn){g[0]=jr;g[1]=sr;g[2]=bn;g[3]=Jr;Ee.clearBufferuiv(Ee.COLOR,0,g)}else{x[0]=jr;x[1]=sr;x[2]=bn;x[3]=Jr;Ee.clearBufferiv(Ee.COLOR,0,x)}}else{zt|=Ee.COLOR_BUFFER_BIT}}if(Tn){zt|=Ee.DEPTH_BUFFER_BIT}if(ft){zt|=Ee.STENCIL_BUFFER_BIT;this.state.buffers.stencil.setMask(4294967295)}Ee.clear(zt)};this.clearColor=function(){this.clear(true,false,false)};this.clearDepth=function(){this.clear(false,true,false)};this.clearStencil=function(){this.clear(false,false,true)};this.dispose=function(){n.removeEventListener("webglcontextlost",Jt,false);n.removeEventListener("webglcontextrestored",Sn,false);n.removeEventListener("webglcontextcreationerror",Kt,false);Ne.dispose();Qe.dispose();ze.dispose();it.dispose();He.dispose();Je.dispose();Ze.dispose();kt.dispose();qt.dispose();Be.dispose();sn.dispose();sn.removeEventListener("sessionstart",Mr);sn.removeEventListener("sessionend",Er);vr.stop()};function Jt(Et){Et.preventDefault();console.log("THREE.WebGLRenderer: Context Lost.");L=true}function Sn(){console.log("THREE.WebGLRenderer: Context Restored.");L=false;const Et=Ge.autoReset;const Tn=ye.enabled;const ft=ye.autoUpdate;const zt=ye.needsUpdate;const Gt=ye.type;_t();Ge.autoReset=Et;ye.enabled=Tn;ye.autoUpdate=ft;ye.needsUpdate=zt;ye.type=Gt}function Kt(Et){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",Et.statusMessage)}function mn(Et){const Tn=Et.target;Tn.removeEventListener("dispose",mn);At(Tn)}function At(Et){lr(Et);it.remove(Et)}function lr(Et){const Tn=it.get(Et).programs;if(Tn!==void 0){Tn.forEach(function(ft){Be.releaseProgram(ft)});if(Et.isShaderMaterial){Be.releaseShaderCache(Et)}}}this.renderBufferDirect=function(Et,Tn,ft,zt,Gt,gn){if(Tn===null)Tn=Ve;const Fn=Gt.isMesh&&Gt.matrixWorld.determinant()<0;const Tr=Pt(Et,Tn,ft,zt,Gt);ct.setMaterial(zt,Fn);let Jr=ft.index;let jr=1;if(zt.wireframe===true){Jr=we.getWireframeAttribute(ft);if(Jr===void 0)return;jr=2}const sr=ft.drawRange;const bn=ft.attributes.position;let ir=sr.start*jr;let Jn=(sr.start+sr.count)*jr;if(gn!==null){ir=Math.max(ir,gn.start*jr);Jn=Math.min(Jn,(gn.start+gn.count)*jr)}if(Jr!==null){ir=Math.max(ir,0);Jn=Math.min(Jn,Jr.count)}else if(bn!==void 0&&bn!==null){ir=Math.max(ir,0);Jn=Math.min(Jn,bn.count)}const er=Jn-ir;if(er<0||er===Infinity)return;kt.setup(Gt,zt,Tr,ft,Jr);let Pr;let Vt=dt;if(Jr!==null){Pr=Te.get(Jr);Vt=Oe;Vt.setIndex(Pr)}if(Gt.isMesh){if(zt.wireframe===true){ct.setLineWidth(zt.wireframeLinewidth*$e());Vt.setMode(Ee.LINES)}else{Vt.setMode(Ee.TRIANGLES)}}else if(Gt.isLine){let di=zt.linewidth;if(di===void 0)di=1;ct.setLineWidth(di*$e());if(Gt.isLineSegments){Vt.setMode(Ee.LINES)}else if(Gt.isLineLoop){Vt.setMode(Ee.LINE_LOOP)}else{Vt.setMode(Ee.LINE_STRIP)}}else if(Gt.isPoints){Vt.setMode(Ee.POINTS)}else if(Gt.isSprite){Vt.setMode(Ee.TRIANGLES)}if(Gt.isBatchedMesh){if(Gt._multiDrawInstances!==null){SO("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection.");Vt.renderMultiDrawInstances(Gt._multiDrawStarts,Gt._multiDrawCounts,Gt._multiDrawCount,Gt._multiDrawInstances)}else{if(!yt.get("WEBGL_multi_draw")){const di=Gt._multiDrawStarts;const ln=Gt._multiDrawCounts;const yi=Gt._multiDrawCount;const yo=Jr?Te.get(Jr).bytesPerElement:1;const Pa=it.get(zt).currentProgram.getUniforms();for(let Ms=0;Ms{function gn(){zt.forEach(function(Fn){const Tr=it.get(Fn);const Jr=Tr.currentProgram;if(Jr.isReady()){zt.delete(Fn)}});if(zt.size===0){Gt(Et);return}setTimeout(gn,10)}if(yt.get("KHR_parallel_shader_compile")!==null){gn()}else{setTimeout(gn,10)}})};let cr=null;function Hr(Et){if(cr)cr(Et)}function Mr(){vr.stop()}function Er(){vr.start()}const vr=new qUt;vr.setAnimationLoop(Hr);if(typeof self!=="undefined")vr.setContext(self);this.setAnimationLoop=function(Et){cr=Et;sn.setAnimationLoop(Et);Et===null?vr.stop():vr.start()};sn.addEventListener("sessionstart",Mr);sn.addEventListener("sessionend",Er);this.render=function(Et,Tn){if(Tn!==void 0&&Tn.isCamera!==true){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(L===true)return;if(Et.matrixWorldAutoUpdate===true)Et.updateMatrixWorld();if(Tn.parent===null&&Tn.matrixWorldAutoUpdate===true)Tn.updateMatrixWorld();if(sn.enabled===true&&sn.isPresenting===true){if(sn.cameraAutoUpdate===true)sn.updateCamera(Tn);Tn=sn.getCamera()}if(Et.isScene===true)Et.onBeforeRender(P,Et,Tn,O);_=ze.get(Et,A.length);_.init(Tn);A.push(_);he.multiplyMatrices(Tn.projectionMatrix,Tn.matrixWorldInverse);xe.setFromProjectionMatrix(he,ew,Tn.reversedDepth);Ie=this.localClippingEnabled;be=Me.init(this.clippingPlanes,Ie);w=Qe.get(Et,C.length);w.init();C.push(w);if(sn.enabled===true&&sn.isPresenting===true){const gn=P.xr.getDepthSensingMesh();if(gn!==null){Yr(gn,Tn,-Infinity,P.sortObjects)}}Yr(Et,Tn,0,P.sortObjects);w.finish();if(P.sortObjects===true){w.sort(oe,se)}Le=sn.enabled===false||sn.isPresenting===false||sn.hasDepthSensing()===false;if(Le){Ne.addToRenderList(w,Et)}this.info.render.frame++;if(be===true)Me.beginShadows();const ft=_.state.shadowsArray;ye.render(ft,Et,Tn);if(be===true)Me.endShadows();if(this.info.autoReset===true)this.info.reset();const zt=w.opaque;const Gt=w.transmissive;_.setupLights();if(Tn.isArrayCamera){const gn=Tn.cameras;if(Gt.length>0){for(let Fn=0,Tr=gn.length;Fn0)Rr(zt,Gt,Et,Tn);if(Le)Ne.render(Et);nt(w,Et,Tn)}if(O!==null&&N===0){bt.updateMultisampleRenderTarget(O);bt.updateRenderTargetMipmap(O)}if(Et.isScene===true)Et.onAfterRender(P,Et,Tn);kt.resetDefaultState();z=-1;U=null;A.pop();if(A.length>0){_=A[A.length-1];if(be===true)Me.setGlobalState(P.clippingPlanes,_.state.camera)}else{_=null}C.pop();if(C.length>0){w=C[C.length-1]}else{w=null}};function Yr(Et,Tn,ft,zt){if(Et.visible===false)return;const Gt=Et.layers.test(Tn.layers);if(Gt){if(Et.isGroup){ft=Et.renderOrder}else if(Et.isLOD){if(Et.autoUpdate===true)Et.update(Tn)}else if(Et.isLight){_.pushLight(Et);if(Et.castShadow){_.pushShadow(Et)}}else if(Et.isSprite){if(!Et.frustumCulled||xe.intersectsSprite(Et)){if(zt){ge.setFromMatrixPosition(Et.matrixWorld).applyMatrix4(he)}const Fn=Ze.update(Et);const Tr=Et.material;if(Tr.visible){w.push(Et,Fn,Tr,ft,ge.z,null)}}}else if(Et.isMesh||Et.isLine||Et.isPoints){if(!Et.frustumCulled||xe.intersectsObject(Et)){const Fn=Ze.update(Et);const Tr=Et.material;if(zt){if(Et.boundingSphere!==void 0){if(Et.boundingSphere===null)Et.computeBoundingSphere();ge.copy(Et.boundingSphere.center)}else{if(Fn.boundingSphere===null)Fn.computeBoundingSphere();ge.copy(Fn.boundingSphere.center)}ge.applyMatrix4(Et.matrixWorld).applyMatrix4(he)}if(Array.isArray(Tr)){const Jr=Fn.groups;for(let jr=0,sr=Jr.length;jr0)Xr(Gt,Tn,ft);if(gn.length>0)Xr(gn,Tn,ft);if(Fn.length>0)Xr(Fn,Tn,ft);ct.buffers.depth.setTest(true);ct.buffers.depth.setMask(true);ct.buffers.color.setMask(true);ct.setPolygonOffset(false)}function Rr(Et,Tn,ft,zt){const Gt=ft.isScene===true?ft.overrideMaterial:null;if(Gt!==null){return}if(_.state.transmissionRenderTarget[zt.id]===void 0){_.state.transmissionRenderTarget[zt.id]=new qE(1,1,{generateMipmaps:true,type:yt.has("EXT_color_buffer_half_float")||yt.has("EXT_color_buffer_float")?oU:aw,minFilter:Q3,samples:4,stencilBuffer:o,resolveDepthBuffer:false,resolveStencilBuffer:false,colorSpace:dc.workingColorSpace})}const gn=_.state.transmissionRenderTarget[zt.id];const Fn=zt.viewport||W;gn.setSize(Fn.z*P.transmissionResolutionScale,Fn.w*P.transmissionResolutionScale);const Tr=P.getRenderTarget();const Jr=P.getActiveCubeFace();const jr=P.getActiveMipmapLevel();P.setRenderTarget(gn);P.getClearColor(K);X=P.getClearAlpha();if(X<1)P.setClearColor(16777215,.5);P.clear();if(Le)Ne.render(ft);const sr=P.toneMapping;P.toneMapping=ow;const bn=zt.viewport;if(zt.viewport!==void 0)zt.viewport=void 0;_.setupLightsView(zt);if(be===true)Me.setGlobalState(P.clippingPlanes,zt);Xr(Et,ft,zt);bt.updateMultisampleRenderTarget(gn);bt.updateRenderTargetMipmap(gn);if(yt.has("WEBGL_multisampled_render_to_texture")===false){let ir=false;for(let Jn=0,er=Tn.length;Jn0);const bn=!!ft.morphAttributes.position;const ir=!!ft.morphAttributes.normal;const Jn=!!ft.morphAttributes.color;let er=ow;if(zt.toneMapped){if(O===null||O.isXRRenderTarget===true){er=P.toneMapping}}const Pr=ft.morphAttributes.position||ft.morphAttributes.normal||ft.morphAttributes.color;const Vt=Pr!==void 0?Pr.length:0;const di=it.get(zt);const ln=_.state.lights;if(be===true){if(Ie===true||Et!==U){const jn=Et===U&&zt.id===z;Me.setState(zt,Et,jn)}}let yi=false;if(zt.version===di.__version){if(di.needsLights&&di.lightsStateVersion!==ln.state.version){yi=true}else if(di.outputColorSpace!==Tr){yi=true}else if(Gt.isBatchedMesh&&di.batching===false){yi=true}else if(!Gt.isBatchedMesh&&di.batching===true){yi=true}else if(Gt.isBatchedMesh&&di.batchingColor===true&&Gt.colorTexture===null){yi=true}else if(Gt.isBatchedMesh&&di.batchingColor===false&&Gt.colorTexture!==null){yi=true}else if(Gt.isInstancedMesh&&di.instancing===false){yi=true}else if(!Gt.isInstancedMesh&&di.instancing===true){yi=true}else if(Gt.isSkinnedMesh&&di.skinning===false){yi=true}else if(!Gt.isSkinnedMesh&&di.skinning===true){yi=true}else if(Gt.isInstancedMesh&&di.instancingColor===true&&Gt.instanceColor===null){yi=true}else if(Gt.isInstancedMesh&&di.instancingColor===false&&Gt.instanceColor!==null){yi=true}else if(Gt.isInstancedMesh&&di.instancingMorph===true&&Gt.morphTexture===null){yi=true}else if(Gt.isInstancedMesh&&di.instancingMorph===false&&Gt.morphTexture!==null){yi=true}else if(di.envMap!==Jr){yi=true}else if(zt.fog===true&&di.fog!==gn){yi=true}else if(di.numClippingPlanes!==void 0&&(di.numClippingPlanes!==Me.numPlanes||di.numIntersection!==Me.numIntersection)){yi=true}else if(di.vertexAlphas!==jr){yi=true}else if(di.vertexTangents!==sr){yi=true}else if(di.morphTargets!==bn){yi=true}else if(di.morphNormals!==ir){yi=true}else if(di.morphColors!==Jn){yi=true}else if(di.toneMapping!==er){yi=true}else if(di.morphTargetsCount!==Vt){yi=true}}else{yi=true;di.__version=zt.version}let yo=di.currentProgram;if(yi===true){yo=rn(zt,Tn,Gt)}let Pa=false;let Ms=false;let ds=false;const st=yo.getUniforms(),en=di.uniforms;if(ct.useProgram(yo.program)){Pa=true;Ms=true;ds=true}if(zt.id!==z){z=zt.id;Ms=true}if(Pa||U!==Et){const jn=ct.buffers.depth.getReversed();if(jn&&Et.reversedDepth!==true){Et._reversedDepth=true;Et.updateProjectionMatrix()}st.setValue(Ee,"projectionMatrix",Et.projectionMatrix);st.setValue(Ee,"viewMatrix",Et.matrixWorldInverse);const xr=st.map.cameraPosition;if(xr!==void 0){xr.setValue(Ee,ve.setFromMatrixPosition(Et.matrixWorld))}if(mt.logarithmicDepthBuffer){st.setValue(Ee,"logDepthBufFC",2/(Math.log(Et.far+1)/Math.LN2))}if(zt.isMeshPhongMaterial||zt.isMeshToonMaterial||zt.isMeshLambertMaterial||zt.isMeshBasicMaterial||zt.isMeshStandardMaterial||zt.isShaderMaterial){st.setValue(Ee,"isOrthographic",Et.isOrthographicCamera===true)}if(U!==Et){U=Et;Ms=true;ds=true}}if(Gt.isSkinnedMesh){st.setOptional(Ee,Gt,"bindMatrix");st.setOptional(Ee,Gt,"bindMatrixInverse");const jn=Gt.skeleton;if(jn){if(jn.boneTexture===null)jn.computeBoneTexture();st.setValue(Ee,"boneTexture",jn.boneTexture,bt)}}if(Gt.isBatchedMesh){st.setOptional(Ee,Gt,"batchingTexture");st.setValue(Ee,"batchingTexture",Gt._matricesTexture,bt);st.setOptional(Ee,Gt,"batchingIdTexture");st.setValue(Ee,"batchingIdTexture",Gt._indirectTexture,bt);st.setOptional(Ee,Gt,"batchingColorTexture");if(Gt._colorsTexture!==null){st.setValue(Ee,"batchingColorTexture",Gt._colorsTexture,bt)}}const yn=ft.morphAttributes;if(yn.position!==void 0||yn.normal!==void 0||yn.color!==void 0){Ae.update(Gt,ft,yo)}if(Ms||di.receiveShadow!==Gt.receiveShadow){di.receiveShadow=Gt.receiveShadow;st.setValue(Ee,"receiveShadow",Gt.receiveShadow)}if(zt.isMeshGouraudMaterial&&zt.envMap!==null){en.envMap.value=Jr;en.flipEnvMap.value=Jr.isCubeTexture&&Jr.isRenderTargetTexture===false?-1:1}if(zt.isMeshStandardMaterial&&zt.envMap===null&&Tn.environment!==null){en.envMapIntensity.value=Tn.environmentIntensity}if(Ms){st.setValue(Ee,"toneMappingExposure",P.toneMappingExposure);if(di.needsLights){an(en,ds)}if(gn&&zt.fog===true){qe.refreshFogUniforms(en,gn)}qe.refreshMaterialUniforms(en,zt,J,te,_.state.transmissionRenderTarget[Et.id]);uU.upload(Ee,St(di),en,bt)}if(zt.isShaderMaterial&&zt.uniformsNeedUpdate===true){uU.upload(Ee,St(di),en,bt);zt.uniformsNeedUpdate=false}if(zt.isSpriteMaterial){st.setValue(Ee,"center",Gt.center)}st.setValue(Ee,"modelViewMatrix",Gt.modelViewMatrix);st.setValue(Ee,"normalMatrix",Gt.normalMatrix);st.setValue(Ee,"modelMatrix",Gt.matrixWorld);if(zt.isShaderMaterial||zt.isRawShaderMaterial){const jn=zt.uniformsGroups;for(let xr=0,wr=jn.length;xr0&&bt.useMultisampledRTT(Et)===false){Gt=it.get(Et).__webglMultisampledFramebuffer}else{if(Array.isArray(sr)){Gt=sr[ft]}else{Gt=sr}}W.copy(Et.viewport);H.copy(Et.scissor);$=Et.scissorTest}else{W.copy(re).multiplyScalar(J).floor();H.copy(ce).multiplyScalar(J).floor();$=ue}if(ft!==0){Gt=Cn}const Tr=ct.bindFramebuffer(Ee.FRAMEBUFFER,Gt);if(Tr&&zt){ct.drawBuffers(Et,Gt)}ct.viewport(W);ct.scissor(H);ct.setScissorTest($);if(gn){const Jr=it.get(Et.texture);Ee.framebufferTexture2D(Ee.FRAMEBUFFER,Ee.COLOR_ATTACHMENT0,Ee.TEXTURE_CUBE_MAP_POSITIVE_X+Tn,Jr.__webglTexture,ft)}else if(Fn){const Jr=Tn;for(let jr=0;jr=0&&Tn<=Et.width-zt&&(ft>=0&&ft<=Et.height-Gt)){if(Et.textures.length>1)Ee.readBuffer(Ee.COLOR_ATTACHMENT0+Tr);Ee.readPixels(Tn,ft,zt,Gt,Wt.convert(sr),Wt.convert(bn),gn)}}finally{const jr=O!==null?it.get(O).__webglFramebuffer:null;ct.bindFramebuffer(Ee.FRAMEBUFFER,jr)}}};this.readRenderTargetPixelsAsync=async function(Et,Tn,ft,zt,Gt,gn,Fn,Tr=0){if(!(Et&&Et.isWebGLRenderTarget)){throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")}let Jr=it.get(Et).__webglFramebuffer;if(Et.isWebGLCubeRenderTarget&&Fn!==void 0){Jr=Jr[Fn]}if(Jr){if(Tn>=0&&Tn<=Et.width-zt&&(ft>=0&&ft<=Et.height-Gt)){ct.bindFramebuffer(Ee.FRAMEBUFFER,Jr);const jr=Et.textures[Tr];const sr=jr.format;const bn=jr.type;if(!mt.textureFormatReadable(sr)){throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.")}if(!mt.textureTypeReadable(bn)){throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.")}const ir=Ee.createBuffer();Ee.bindBuffer(Ee.PIXEL_PACK_BUFFER,ir);Ee.bufferData(Ee.PIXEL_PACK_BUFFER,gn.byteLength,Ee.STREAM_READ);if(Et.textures.length>1)Ee.readBuffer(Ee.COLOR_ATTACHMENT0+Tr);Ee.readPixels(Tn,ft,zt,Gt,Wt.convert(sr),Wt.convert(bn),0);const Jn=O!==null?it.get(O).__webglFramebuffer:null;ct.bindFramebuffer(Ee.FRAMEBUFFER,Jn);const er=Ee.fenceSync(Ee.SYNC_GPU_COMMANDS_COMPLETE,0);Ee.flush();await xUt(Ee,er,4);Ee.bindBuffer(Ee.PIXEL_PACK_BUFFER,ir);Ee.getBufferSubData(Ee.PIXEL_PACK_BUFFER,0,gn);Ee.deleteBuffer(ir);Ee.deleteSync(er);return gn}else{throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")}}};this.copyFramebufferToTexture=function(Et,Tn=null,ft=0){const zt=Math.pow(2,-ft);const Gt=Math.floor(Et.image.width*zt);const gn=Math.floor(Et.image.height*zt);const Fn=Tn!==null?Tn.x:0;const Tr=Tn!==null?Tn.y:0;bt.setTexture2D(Et,0);Ee.copyTexSubImage2D(Ee.TEXTURE_2D,ft,0,0,Fn,Tr,Gt,gn);ct.unbindTexture()};const rr=Ee.createFramebuffer();const hr=Ee.createFramebuffer();this.copyTextureToTexture=function(Et,Tn,ft=null,zt=null,Gt=0,gn=null){if(gn===null){if(Gt!==0){SO("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels.");gn=Gt;Gt=0}else{gn=0}}let Fn,Tr,Jr,jr,sr,bn;let ir,Jn,er;const Pr=Et.isCompressedTexture?Et.mipmaps[gn]:Et.image;if(ft!==null){Fn=ft.max.x-ft.min.x;Tr=ft.max.y-ft.min.y;Jr=ft.isBox3?ft.max.z-ft.min.z:1;jr=ft.min.x;sr=ft.min.y;bn=ft.isBox3?ft.min.z:0}else{const yn=Math.pow(2,-Gt);Fn=Math.floor(Pr.width*yn);Tr=Math.floor(Pr.height*yn);if(Et.isDataArrayTexture){Jr=Pr.depth}else if(Et.isData3DTexture){Jr=Math.floor(Pr.depth*yn)}else{Jr=1}jr=0;sr=0;bn=0}if(zt!==null){ir=zt.x;Jn=zt.y;er=zt.z}else{ir=0;Jn=0;er=0}const Vt=Wt.convert(Tn.format);const di=Wt.convert(Tn.type);let ln;if(Tn.isData3DTexture){bt.setTexture3D(Tn,0);ln=Ee.TEXTURE_3D}else if(Tn.isDataArrayTexture||Tn.isCompressedArrayTexture){bt.setTexture2DArray(Tn,0);ln=Ee.TEXTURE_2D_ARRAY}else{bt.setTexture2D(Tn,0);ln=Ee.TEXTURE_2D}Ee.pixelStorei(Ee.UNPACK_FLIP_Y_WEBGL,Tn.flipY);Ee.pixelStorei(Ee.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Tn.premultiplyAlpha);Ee.pixelStorei(Ee.UNPACK_ALIGNMENT,Tn.unpackAlignment);const yi=Ee.getParameter(Ee.UNPACK_ROW_LENGTH);const yo=Ee.getParameter(Ee.UNPACK_IMAGE_HEIGHT);const Pa=Ee.getParameter(Ee.UNPACK_SKIP_PIXELS);const Ms=Ee.getParameter(Ee.UNPACK_SKIP_ROWS);const ds=Ee.getParameter(Ee.UNPACK_SKIP_IMAGES);Ee.pixelStorei(Ee.UNPACK_ROW_LENGTH,Pr.width);Ee.pixelStorei(Ee.UNPACK_IMAGE_HEIGHT,Pr.height);Ee.pixelStorei(Ee.UNPACK_SKIP_PIXELS,jr);Ee.pixelStorei(Ee.UNPACK_SKIP_ROWS,sr);Ee.pixelStorei(Ee.UNPACK_SKIP_IMAGES,bn);const st=Et.isDataArrayTexture||Et.isData3DTexture;const en=Tn.isDataArrayTexture||Tn.isData3DTexture;if(Et.isDepthTexture){const yn=it.get(Et);const jn=it.get(Tn);const xr=it.get(yn.__renderTarget);const wr=it.get(jn.__renderTarget);ct.bindFramebuffer(Ee.READ_FRAMEBUFFER,xr.__webglFramebuffer);ct.bindFramebuffer(Ee.DRAW_FRAMEBUFFER,wr.__webglFramebuffer);for(let Dr=0;Dr.97;const d=!u&&a>=.03&&a<.11;const f=!u&&a>=.11&&a<.2;s=s*1.25+.06;l=l*.92+.04;if(d){s=Math.min(1,s*1.35+.08);l=l+.03}if(f){s=Math.min(1,s*1.2+.06);l=l+.01}if(u){s=Math.min(1,s*1.2+.06);l=l-.12}l=Math.max(u?.32:.4,Math.min(.72,l));const h=new gZ({color:i,metalness:0,roughness:.6,clearcoat:1,clearcoatRoughness:.35,reflectivity:.5,emissive:i.clone().multiplyScalar(.75),transmission:0,thickness:.1,opacity:1});t.set(n,h);return h}function tM(e,t){return t/Math.max(e,1)}function sea(e,t,n,r,i={}){const{width:o,height:a}=r;const s=i.sensitivityX??zUr;const l=i.sensitivityY??UUr;const u=i.maxPitch??VUr;const d=Math.max(o,1);const f=Math.max(a,1);const h=t/d*s;const m=n/f*l;e.order="YXZ";e.y-=h;const g=MO.clamp(e.x+m,-u,u);e.x=g}uk();var eVt=Ui(_3());var GUr=false;var KVe=.3;var HUr=new gr(-.25,.15,.8).normalize();var QUt=0;var nM=0;function ZVe(e,t={}){const{fontSize:n=28,color:r="#1f2933",backgroundColor:i,padding:o=Math.ceil(n*.35),fontFamily:a=td,weight:s="500",worldUnitsPerPixel:l=.004}=t;if(typeof OffscreenCanvas==="undefined"){throw new Error("OffscreenCanvas API is not available for chart text sprites.")}const u=new OffscreenCanvas(1,1);const d=u.getContext("2d");if(!d){throw new Error("Failed to acquire 2D context for text sprite")}d.font=`${s} ${n}px ${a}`;const f=d.measureText(e);const h=Math.ceil(f.width);const m=Math.ceil(n*1.35);u.width=Math.max(1,h+o*2);u.height=Math.max(1,m+o*2);d.font=`${s} ${n}px ${a}`;d.textAlign="center";d.textBaseline="middle";if(i){d.fillStyle=i;d.fillRect(0,0,u.width,u.height)}else{d.clearRect(0,0,u.width,u.height)}d.fillStyle=r;d.fillText(e,u.width/2,u.height/2+n*.05);const g=new fZ(u);g.anisotropy=8;g.needsUpdate=true;const x=new tU({map:g,transparent:true});x.depthTest=false;x.depthWrite=false;const w=new dZ(x);w.scale.set(u.width*l,u.height*l,1);w.center.set(.5,.5);return w}function WUr(e,t,n,r,i){const o=Math.max(fU*.25,$h);const a=e.barOptions?.grouping??0;if(!_k(t.x)||e.series.length===0){return{segments:[],bounds:{minX:0,maxX:0,maxHeight:0,minHeight:0},barDepth:o,chartDepth:o,categoryCount:0,seriesLanes:[],grouping:a,categories:[]}}const s=E9(e,i);const l=s.categories;if(l.length===0){return{segments:[],bounds:{minX:0,maxX:0,maxHeight:0,minHeight:0},barDepth:o,chartDepth:o,categoryCount:0,seriesLanes:[],grouping:a,categories:[]}}const u=t.x;const d=t.y;const f=tM(n.width,BO);const h=tM(n.height,RZ);const m=tM(n.width,fU);const g=d(0);const x=Number.isFinite(g)?g-n.y:n.height;const w=ve=>(x-ve)*h;const _=s.mode==="clustered";const C=a===0;const A=s.visibleSeries;const P=C?Math.max(A.length,1):1;const L=Math.max(u.bandwidth(),1);const I=L*.2;const N=Math.max(L-I,L*.4);const O=C?N*.2:0;const z=C?Math.max(N-O,N*.5):N;const U=C?z/Math.max(P,1):N;const W=C?Math.max(U*m,$h):o;const H=C&&!_?Math.min(Math.max(W*.15,$h*.5),Math.max(W-$h,0)*.5):0;const $=C?Math.max(W-H*2,$h):o;const K=C?Math.max(O*m,W*.1):0;const X=C?K:0;const j=C?A.map((ve,ge)=>X+W/2+ge*(W+K)):[W/2];const te=C?A.map((ve,ge)=>({seriesIndex:ve,label:(e.series[ve]?.name??"").trim()||`Series ${ge+1}`,centerZ:j[ge]??W/2})):[];const J=[];let oe=Number.POSITIVE_INFINITY;let se=Number.NEGATIVE_INFINITY;let re=Number.POSITIVE_INFINITY;let ce=Number.NEGATIVE_INFINITY;let ue=0;let xe=0;l.forEach((ve,ge)=>{const Ve=u(ve);if(Ve===void 0)return;const Le=Ve-n.x;const $e=s.segmentsByCategory[ge]??[];const Ee=$e.filter(mt=>{const ct=e.series[mt.seriesIndex];if(!ct)return false;if(Zd(ct,ge))return false;const Ge=Pd(ct,ge,mt.seriesIndex,r);return!!Ge});const tt=Ee.length||1;const yt=N/Math.max(tt,1);Ee.forEach((mt,ct)=>{const Ge=e.series[mt.seriesIndex];if(!Ge)return;const it=Pd(Ge,ge,mt.seriesIndex,r);if(!it)return;const bt=C?Math.max(0,A.indexOf(mt.seriesIndex)):_?ct:0;const He=C?N:_?yt:L;const Je=C?(L-N)/2:_?(L-N)/2+yt*bt:0;const Te=d(mt.start);const we=d(mt.end);if(!Number.isFinite(Te)||!Number.isFinite(we)||!Number.isFinite(He)){return}const Ze=Te-n.y;const Be=we-n.y;const qe=w(Ze);const Qe=w(Be);const ze=Math.max(Math.abs(Qe-qe),Nk);const Me=(qe+Qe)/2;const ye=Le+Je+He/2;const Ne=ye*f;let Ae=Math.max(He*f,$h);let dt=C?$:W;let Oe=j[bt]??j[0]??$/2;if(C&&!_){const sn=Math.max(Math.min(Ae,$),$h);Ae=sn;dt=sn}if(!C){if(_){dt=Ae}else{dt=o}Oe=dt/2}J.push({key:`${ge}-${mt.seriesIndex}-${ct}`,seriesIndex:mt.seriesIndex,position:{x:Ne,y:Me,z:Oe},size:{width:Ae,height:ze,depth:dt},materialKey:it});const Wt=Ne-Ae/2;const kt=Ne+Ae/2;oe=Math.min(oe,Wt);se=Math.max(se,kt);ue=Math.max(ue,Me+ze/2);xe=Math.min(xe,Me-ze/2);const qt=Oe-dt/2;const _t=Oe+dt/2;re=Math.min(re,qt);ce=Math.max(ce,_t)})});if(!Number.isFinite(oe)||!Number.isFinite(se)){oe=0;se=BO}const be=Number.isFinite(oe)?oe:0;if(be!==0){J.forEach(ve=>{ve.position={...ve.position,x:ve.position.x-be}});oe-=be;se-=be}if(C&&!_&&J.length>0&&Number.isFinite(re)&&Number.isFinite(ce)){re-=H;ce+=H}if(!Number.isFinite(re)||!Number.isFinite(ce)){re=0;ce=C?j[j.length-1]??$:o}const Ie=Number.isFinite(re)?re:0;if(Ie!==0){J.forEach(ve=>{ve.position={...ve.position,z:ve.position.z-Ie}});te.forEach(ve=>{ve.centerZ-=Ie});re-=Ie;ce-=Ie}const he=Number.isFinite(ce)?Math.max(ce,$h):o;return{segments:J,bounds:{minX:oe,maxX:se,maxHeight:Math.max(ue,Nk),minHeight:Math.min(xe,0)},barDepth:o,chartDepth:he,categoryCount:l.length,seriesLanes:te,grouping:a,categories:l}}function tVt(e,t,n,r,i,o){const a=WUr(t,n,r,i,o);e.clear();if(a.segments.length===0){e.renderer.setScissorTest(false);return}const s=new Map;const l=e.renderer;const u=e.camera;const{width:d,height:f}=e.dims;const h=1;const m=Math.max(1,d*h);const g=Math.max(1,f*h);const x=l.getViewport(new fu);const w=l.getScissor(new fu);const _=l.getScissorTest();const C=u.aspect;l.setViewport(0,0,m,g);l.setScissor(0,0,m,g);l.setScissorTest(true);if(g>0){u.aspect=d/Math.max(f,1);u.updateProjectionMatrix()}const{bounds:A,chartDepth:P,seriesLanes:L,grouping:I,categories:N}=a;const O=Math.max(A.maxX-A.minX,$h);const z=O*.5;const U=-z;const W=0;const H=Math.max(P,$h);const $=Math.min(A.minHeight,0);const K=Math.max(A.maxHeight,Nk);const X=K-$||Nk;const j=n.x;const te=n.y;const J=tM(r.width,BO);const oe=tM(r.height,RZ);const se=te(0);const re=Number.isFinite(se)?se-r.y:r.height;const ce=Xt=>{const Cn=te(Xt);if(!Number.isFinite(Cn))return null;const rr=Cn-r.y;return(re-rr)*oe};const ue=Math.max(j.bandwidth(),1);const xe=Xt=>{const Cn=j(Xt);if(Cn===void 0)return null;const rr=Cn-r.x+ue/2;return rr*J-A.minX};const be=ce(0)??0;const Ie=($+K)*.5;const he=P*.5;const ve=Xt=>Xt-Ie;const ge=Xt=>Xt-he;const Ve=new Py;const Le=new Py;const $e=new Py;const Ee=new Py;Ee.renderOrder=20;const tt=wl(t.xAxis,i);const yt=wl(t.yAxis,i);const mt=!!t.yAxis?.majorGridlines?.fill?.color;const ct=yt.gridLineColor??yt.lineColor;const Ge=(()=>{const Xt=t.yAxis?.numberFormatCode;const Cn=Oh("~s");return rr=>{if(Xt){try{return eVt.default.format(Xt,rr)}catch{}}return Cn(rr)}})();const it=new jE({color:new ms(tt.lineColor??"#2563eb"),transparent:true,opacity:.9});const bt=new jE({color:new ms(yt.lineColor??"#1f2937"),transparent:true,opacity:.9});const He=new jE({color:new ms(tt.lineColor??"#2563eb"),transparent:true,opacity:.9});const Je=new jE({color:new ms(ct??"#cbdcfb"),transparent:true,opacity:.25});const Te=new jE({color:new ms("#dbeafe"),transparent:true,opacity:.2});const we=new iw(new wp().setFromPoints([new gr(U,ve(be),ge(W)),new gr(U+O,ve(be),ge(W))]),it.clone());we.renderOrder=5;$e.add(we);const Ze=new iw(new wp().setFromPoints([new gr(U,ve(be),ge(W)),new gr(U,ve(be),ge(W+H))]),He.clone());Ze.renderOrder=5;$e.add(Ze);const Be=new iw(new wp().setFromPoints([new gr(U,ve($),ge(W+H)),new gr(U,ve(K),ge(W+H))]),bt.clone());Be.renderOrder=5;$e.add(Be);const qe=te.ticks(6);qe.forEach(Xt=>{const Cn=ce(Xt);if(Cn===null)return;const rr=Math.abs(Xt)<1e-6;if(mt&&!rr){const Et=new iw(new wp().setFromPoints([new gr(U,ve(Cn),ge(W)),new gr(U+O,ve(Cn),ge(W))]),Je.clone());Et.renderOrder=-2;Le.add(Et);const Tn=new iw(new wp().setFromPoints([new gr(U,ve(Cn),ge(W+H)),new gr(U+O,ve(Cn),ge(W+H))]),Je.clone());Tn.renderOrder=-2;Le.add(Tn)}const hr=ZVe(Ge(Xt),{fontSize:26,color:yt.textColor??"#1f2933",weight:"500"});hr.position.set(U-Math.max(O,H)*.08,ve(Cn),ge(W-H*.05));Ee.add(hr)});N.forEach(Xt=>{const Cn=xe(Xt);if(Cn===null)return;const rr=U+Cn;const hr=new iw(new wp().setFromPoints([new gr(rr,ve(be),ge(W)),new gr(rr,ve(be),ge(W+H))]),Te.clone());hr.renderOrder=-2;Le.add(hr);const Et=ZVe(String(Xt),{fontSize:26,color:tt.textColor??"#111827"});Et.position.set(rr,ve(be-Math.min(X*.12,.5)),ge(W-H*.06));Ee.add(Et)});if(I===0&&L.length){const Xt=new Map;a.segments.forEach(hr=>{if(!Xt.has(hr.seriesIndex)){Xt.set(hr.seriesIndex,hr.size.depth)}});const Cn=new Set;L.forEach(hr=>{const Et=Xt.get(hr.seriesIndex)??0;const Tn=W+hr.centerZ;const ft=ZVe(hr.label,{fontSize:24,color:tt.textColor??"#111827",weight:"500"});ft.position.set(U+O+Math.max(O,H)*.06,ve(be-Math.min(X*.08,.4)),ge(Tn));Ee.add(ft);if(Et>0){Cn.add(Tn-Et/2);Cn.add(Tn+Et/2)}});const rr=Te.clone();rr.opacity=.3;Array.from(Cn).sort((hr,Et)=>hr-Et).forEach(hr=>{const Et=new iw(new wp().setFromPoints([new gr(U,ve(be),ge(hr)),new gr(U+O,ve(be),ge(hr))]),rr.clone());Et.renderOrder=-2;Le.add(Et)})}a.segments.forEach(Xt=>{const Cn=new K3(Xt.size.width,Xt.size.height,Xt.size.depth);const rr=i1e(Xt.materialKey,s);const hr=new Sm(Cn,rr);hr.castShadow=true;hr.receiveShadow=true;hr.position.set(U+Xt.position.x,ve(Xt.position.y),ge(W+Xt.position.z));Ve.add(hr)});e.chartGroup.add(Le);e.chartGroup.add(Ve);e.chartGroup.add($e);e.chartGroup.add(Ee);const Qe=e.chartGroup.rotation.clone();const ze=Math.abs(Qe.x)>1e-5||Math.abs(Qe.y)>1e-5||Math.abs(Qe.z)>1e-5;if(ze){e.chartGroup.rotation.set(0,0,0)}e.chartGroup.updateMatrixWorld(true);const Me=GUr?e.chartGroup:Ve;const ye=new a_().setFromObject(Me);const Ne=new gr;const Ae=new gr;ye.getCenter(Ne);ye.getSize(Ae);if(Ae.x===0&&Ae.y===0&&Ae.z===0){Ae.set(Math.max(O,1),Math.max(X,1),Math.max(H,1))}const dt=MO.degToRad(u.fov*.5);const Oe=Math.max(.001,dt);const Wt=u.aspect||1;const kt=Math.atan(Math.tan(Oe)*Wt);const qt=Math.max(.001,kt);const _t=Math.max(Math.tan(Oe),1e-4);const sn=Math.max(Math.tan(qt),1e-4);const Jt=Ae.clone().multiplyScalar(.5);Jt.x=Math.max(Jt.x*(1+KVe),$h);Jt.y=Math.max(Jt.y*(1+KVe),Nk);Jt.z=Math.max(Jt.z*(1+KVe),$h);const Sn=Ne.clone();const Kt=HUr.clone().normalize();const mn=Kt.clone().negate();let At=new gr(0,1,0);if(Math.abs(mn.dot(At))>.99){At=new gr(1,0,0)}let lr=new gr().crossVectors(At,mn);if(lr.lengthSq()<1e-6){At=new gr(0,0,1);lr=new gr().crossVectors(At,mn)}lr.normalize();const on=new gr().crossVectors(mn,lr).normalize();const cr=[];[-1,1].forEach(Xt=>{[-1,1].forEach(Cn=>{[-1,1].forEach(rr=>{cr.push(new gr(Jt.x*Xt,Jt.y*Cn,Jt.z*rr))})})});const Hr=cr.map(Xt=>Sn.clone().add(Xt));const Mr=Jt.length()*2;const Er=Xt=>{u.position.copy(Sn).addScaledVector(Kt,Xt);if(QUt!==0){u.position.addScaledVector(lr,QUt)}if(nM!==0){u.position.addScaledVector(lr,nM)}const Cn=nM?Sn.clone().addScaledVector(lr,nM):Sn;u.up.copy(on);u.near=.1;u.far=Math.max(u.near+1,Xt+Mr*4);u.lookAt(Cn);u.updateMatrixWorld(true);u.updateProjectionMatrix()};const vr=Xt=>{Er(Xt);const Cn=nM?Sn.clone().addScaledVector(lr,nM):Sn;u.lookAt(Cn);u.updateMatrixWorld(true);u.updateProjectionMatrix();let rr=0;let hr=0;let Et=Number.POSITIVE_INFINITY;let Tn=0;Hr.forEach(zt=>{const Gt=zt.clone().project(u);rr=Math.max(rr,Math.abs(Gt.x));hr=Math.max(hr,Math.abs(Gt.y));const gn=zt.clone().applyMatrix4(u.matrixWorldInverse);const Fn=-gn.z;Et=Math.min(Et,Fn);Tn=Math.max(Tn,Fn)});const ft=rr<=1&&hr<=1&&Et>0;return{fits:ft,maxAbsX:rr,maxAbsY:hr,minDepth:Et,maxDepth:Tn}};const Yr=Math.max(Jt.x/sn,Jt.y/_t)+Jt.z;let nt=.1;let Rr=Math.max(Yr,nt*4);let Xr=vr(Rr);let dr=0;while(!Xr.fits&&dr<24){Rr*=2;Xr=vr(Rr);dr+=1}let rn=Xr;for(let Xt=0;Xt<28;Xt+=1){const Cn=(nt+Rr)*.5;const rr=vr(Cn);if(rr.fits){Rr=Cn;rn=rr}else{nt=Cn}}const St=Rr;Er(St);const Ut=nM?Sn.clone().addScaledVector(lr,nM):Sn;rn=vr(St);const Pt=Math.max(.1,Math.min(rn.minDepth*.8,rn.minDepth-.05));const an=Math.max(Pt+1,rn.maxDepth*1.2);u.near=Pt;u.far=an;u.lookAt(Ut);u.updateMatrixWorld(true);u.updateProjectionMatrix();if(ze){e.chartGroup.rotation.copy(Qe);e.chartGroup.updateMatrixWorld(true)}l.render(e.scene,u);l.setViewport(x);l.setScissor(w);l.setScissorTest(_);if(!_){l.setScissorTest(false)}u.aspect=C;u.updateProjectionMatrix()}zh();$E();var JVe=.25;var YUr=new gr(-.25,.2,.85).normalize();var nVt=0;var rM=0;var qUr=.001;var XUr=64;function rVt(e,t,n,r,i){const o=t.series[0];if(!o){PZ(e);return}if(i?.has(0)){PZ(e);return}const a=o.values??[];const s=mk(a);if(!Number.isFinite(s)||s===0){PZ(e);return}const l=Math.max(Math.min(n.width,n.height)/2,1);const u=l*2;const d=tM(Math.max(u,1),Math.min(BO,fU));const f=Math.max(l*d,$h*2);const h=Math.max(Math.min(f*.35,RZ*.6),$h*2);const m=(t.pieOptions?.firstSliceAngle??0)/360*Math.PI*2;const g=oO().sort(null).startAngle(m).endAngle(m+Math.PI*2);const x=g(a).filter(C=>Number.isFinite(C.value)&&C.value!==0);if(x.length===0){PZ(e);return}e.clear();const w=new Map;const _=new Py;_.name="pie3dSlices";x.forEach((C,A)=>{const P=C.index??A;if(Zd(o,P)){return}const L=Pd(o,P,P,r);if(!L)return;const I=C.endAngle-C.startAngle;const N=Math.max(Math.abs(I),qUr);if(!Number.isFinite(N))return;const O=jUr(Math.PI/2-C.endAngle);const z=Math.max(XUr,Math.ceil(N/(Math.PI/32)));const U=new pZ(f,f,h,z,1,false,O,N);const W=i1e(L,w);const H=new Sm(U,W);H.castShadow=true;H.receiveShadow=true;_.add(H)});if(_.children.length===0){PZ(e);return}e.chartGroup.add(_);KUr(e,_)}function jUr(e){const t=Math.PI*2;const n=e%t;return n<0?n+t:n}function PZ(e){e.clear();e.renderer.setScissorTest(false)}function KUr(e,t){const n=e.renderer;const r=e.camera;const{width:i,height:o}=e.dims;const a=1;const s=Math.max(1,i*a);const l=Math.max(1,o*a);const u=n.getViewport(new fu);const d=n.getScissor(new fu);const f=n.getScissorTest();const h=r.aspect;n.setViewport(0,0,s,l);n.setScissor(0,0,s,l);n.setScissorTest(true);if(l>0){r.aspect=i/Math.max(o,1);r.updateProjectionMatrix()}const m=e.chartGroup.rotation.clone();const g=Math.abs(m.x)>1e-5||Math.abs(m.y)>1e-5||Math.abs(m.z)>1e-5;if(g){e.chartGroup.rotation.set(0,0,0)}e.chartGroup.updateMatrixWorld(true);const x=new a_().setFromObject(t);const w=new gr;const _=new gr;x.getCenter(w);x.getSize(_);if(_.x===0&&_.y===0&&_.z===0){_.set(Math.max(BO*.5,$h),Math.max(Nk,.2),Math.max(fU*.5,$h))}const C=MO.degToRad(r.fov*.5);const A=Math.max(.001,C);const P=r.aspect||1;const L=Math.atan(Math.tan(A)*P);const I=Math.max(.001,L);const N=Math.max(Math.tan(A),1e-4);const O=Math.max(Math.tan(I),1e-4);const z=_.clone().multiplyScalar(.5);z.x=Math.max(z.x*(1+JVe),$h);z.y=Math.max(z.y*(1+JVe),Nk);z.z=Math.max(z.z*(1+JVe),$h);const U=w.clone();const W=YUr.clone().normalize();const H=W.clone().negate();let $=new gr(0,1,0);if(Math.abs(H.dot($))>.99){$=new gr(1,0,0)}let K=new gr().crossVectors($,H);if(K.lengthSq()<1e-6){$=new gr(0,0,1);K=new gr().crossVectors($,H)}K.normalize();const X=new gr().crossVectors(H,K).normalize();const j=[];[-1,1].forEach(Le=>{[-1,1].forEach($e=>{[-1,1].forEach(Ee=>{j.push(new gr(z.x*Le,z.y*$e,z.z*Ee))})})});const te=j.map(Le=>U.clone().add(Le));const J=z.length()*2;const oe=Le=>{r.position.copy(U).addScaledVector(W,Le);if(nVt!==0){r.position.addScaledVector(K,nVt)}if(rM!==0){r.position.addScaledVector(K,rM)}const $e=rM!==0?U.clone().addScaledVector(K,rM):U;r.up.copy(X);r.near=.1;r.far=Math.max(r.near+1,Le+J*4);r.lookAt($e);r.updateMatrixWorld(true);r.updateProjectionMatrix()};const se=Le=>{oe(Le);const $e=rM!==0?U.clone().addScaledVector(K,rM):U;r.lookAt($e);r.updateMatrixWorld(true);r.updateProjectionMatrix();let Ee=0;let tt=0;let yt=Number.POSITIVE_INFINITY;let mt=0;te.forEach(Ge=>{const it=Ge.clone().project(r);Ee=Math.max(Ee,Math.abs(it.x));tt=Math.max(tt,Math.abs(it.y));const bt=Ge.clone().applyMatrix4(r.matrixWorldInverse);const He=-bt.z;yt=Math.min(yt,He);mt=Math.max(mt,He)});const ct=Ee<=1&&tt<=1&&yt>0;return{fits:ct,maxAbsX:Ee,maxAbsY:tt,minDepth:yt,maxDepth:mt}};const re=Math.max(z.x/O,z.y/N)+z.z;let ce=.1;let ue=Math.max(re,ce*4);let xe=se(ue);let be=0;while(!xe.fits&&be<24){ue*=2;xe=se(ue);be+=1}let Ie=xe;for(let Le=0;Le<28;Le+=1){const $e=(ce+ue)*.5;const Ee=se($e);if(Ee.fits){ue=$e;Ie=Ee}else{ce=$e}}const he=ue;oe(he);const ve=rM!==0?U.clone().addScaledVector(K,rM):U;Ie=se(he);const ge=Math.max(.1,Math.min(Ie.minDepth*.8,Ie.minDepth-.05));const Ve=Math.max(ge+1,Ie.maxDepth*1.2);r.near=ge;r.far=Ve;r.lookAt(ve);r.updateMatrixWorld(true);r.updateProjectionMatrix();if(g){e.chartGroup.rotation.copy(m);e.chartGroup.updateMatrixWorld(true)}n.render(e.scene,r);n.setViewport(u);n.setScissor(d);n.setScissorTest(f);if(!f){n.setScissorTest(false)}r.aspect=h;r.updateProjectionMatrix()}$E();$E();function iVt(e,t){const n=Nh(e);const r=e.series.map(k3);const i=e.series.map((h,m)=>m).filter(h=>!t?.has(h));const o=e.lineOptions?.grouping;const a=o===2?"stacked":o===3?"percent":"standard";const s=i.map(h=>({seriesIndex:h,values:n.map(()=>0),tuples:n.map(()=>({start:0,end:0}))}));if(a==="standard"||i.length===0){for(const h of s){const m=r[h.seriesIndex];if(!m){continue}for(let g=0;g{const g={};i.forEach(x=>{const w=r[x];if(!w){return}const _=w[m];if(_!==void 0&&Number.isFinite(_)){g[String(x)]=_}else{g[String(x)]=0}});return g});const u=lO().keys(i.map(h=>String(h))).value((h,m)=>h[m]??0).order(VE);if(a==="percent"){u.offset(cO)}else{u.offset(uO)}const d=new Map(s.map(h=>[h.seriesIndex,h]));const f=u(l);f.forEach(h=>{const m=Number.parseInt(h.key,10);const g=d.get(m);if(!g)return;n.forEach((x,w)=>{const _=h[w];if(!_)return;const C=Number.isFinite(_[0])?_[0]:0;const A=Number.isFinite(_[1])?_[1]:C;g.tuples[w]={start:C,end:A};g.values[w]=A})});return{categories:n,visibleSeries:i,mode:a,layers:s}}function oVt(e,t,n,r,i,o){const a=id(n,r,o)??"#666666";const s=i?.stroke;const l=i?.line;const u=s??l;if(u){rd(e,u,o,{color:a,widthPx:1.25});return}e.strokeStyle=a;e.lineWidth=1.25;e.setLineDash([4,3])}function ZUr(e){const t=e?.label;const n=typeof t?.text==="string"&&t.text.trim().length>0;const r=(t?.textRuns?.length??0)>0;return Boolean(e?.displayEquation)||Boolean(e?.displayRSquared)||n||r}function JUr(e,t){const n=e.label;const r=n?.textStyle;if(n&&(n.textRuns?.length??0)>0){return{paragraphs:[{runs:n.textRuns.map(l=>({text:l.text??"",textStyle:l.textStyle??r}))}],resolvedStyle:r,manualLayout:n.manualLayout}}const i=n&&typeof n.text==="string"?n.text.trim():"";const o=(e.displayEquation||e.displayRSquared)&&t?.label?.text?t.label.text:"";const a=i.length>0?i:o;if(!a)return null;const s=a.split(/\r?\n/).filter(l=>l.trim().length>0).map(l=>({runs:[{text:l,textStyle:r}]}));return{paragraphs:s,resolvedStyle:r,manualLayout:n?.manualLayout}}function QUr(e,t){const n=typeof t?.x==="number"?t.x:.54;const r=typeof t?.y==="number"?t.y:.06;const i=typeof t?.w==="number"?t.w:.42;const o=typeof t?.h==="number"?t.h:.28;const a=6;const s=e.x+e.width*n+a;const l=e.y+e.height*r+a;const u=Math.max(0,e.width*i-a*2);const d=Math.max(0,e.height*o-a*2);return{x:s,y:l,width:u,height:d}}function aVt(e,t,n,r,i){if(!ZUr(t))return;const o=JUr(t,n);if(!o)return;const a=QUr(i,o.manualLayout);if(a.width<=0||a.height<=0)return;const s=t.label;const l=Boolean(s?.fill)||Boolean(s?.stroke)||Boolean(s?.line);if(l){e.save();e.fillStyle="rgba(255,255,255,0.85)";e.strokeStyle="rgba(0,0,0,0.20)";e.lineWidth=1;e.beginPath();e.rect(a.x,a.y,a.width,a.height);e.fill();e.stroke();e.restore()}const u={type:1,paragraphs:o.paragraphs,textStyle:{...o.resolvedStyle&&typeof o.resolvedStyle==="object"?o.resolvedStyle:{},fontSize:typeof o.resolvedStyle?.fontSize==="number"?o.resolvedStyle.fontSize:9,alignment:1},effects:[],children:[],citations:[],levelsStyles:[],id:""};const d=u.textStyle;if(!d.fill){u.textStyle["fill"]={type:1,color:{type:1,value:"FF111111",transform:void 0},gradientStops:[]}}ed(u,e,r,void 0,{bboxPx:a,resolvedStyle:u.textStyle,wrap:true})}function sVt(e,t,n,r,i,o,a,s,l){if(!n.trendlines?.length)return;const u=i.filter(d=>Number.isFinite(d.x)&&Number.isFinite(d.y));if(u.length<2)return;n.trendlines.forEach((d,f)=>{oVt(e,t,n,r,d,o);const h=cVt[d.type]??lVt;const m=l?.[f]??sk({type:h,points:u,polynomialOrder:d.order,movingAveragePeriod:d.period,forecastForward:d.forward,forecastBackward:d.backward,intercept:d.intercept,displayEquation:d.displayEquation,displayRSquared:d.displayRSquared});if(!m||m.points.length<2)return;e.beginPath();let g=false;for(const x of m.points){const w=a.x(x.x);const _=a.y(x.y);if(!Number.isFinite(w)||!Number.isFinite(_))continue;if(!g){e.moveTo(w,_);g=true}else{e.lineTo(w,_)}}if(g)e.stroke();aVt(e,d,m,o,s)})}function o1e(e,t,n,r,i,o,a,s,l,u){const d=[];const f=[];for(let m=0;m{const g=f.findIndex(O=>Number.isFinite(O));const x=(()=>{for(let O=f.length-1;O>=0;O--){if(Number.isFinite(f[O]))return O}return-1})();const w=g>=0?f[g]:0;const _=x>=0?f[x]:w;let C=0;if(g>=0&&x>g){let O=0;let z=0;for(let U=g+1;U<=x;U++){const W=f[U-1];const H=f[U];if(!Number.isFinite(W)||!Number.isFinite(H))continue;const $=H-W;if(!Number.isFinite($)||$<=0)continue;O+=$;z+=1}if(z>0)C=O/z}if(C>0&&m0&&m>x){return _+(m-x)*C}const A=Math.max(0,Math.min(i.length-1,Math.floor(m)));const P=Math.max(0,Math.min(i.length-1,Math.ceil(m)));const L=f[A]??w;const I=f[P]??L;if(A===P)return L;const N=(m-A)/(P-A);return L+(I-L)*N};if(!n.trendlines?.length)return;n.trendlines.forEach((m,g)=>{oVt(e,t,n,r,m,a);const x=cVt[m.type]??lVt;const w=u?.[g]??sk({type:x,points:d,polynomialOrder:m.order,movingAveragePeriod:m.period,forecastForward:m.forward,forecastBackward:m.backward,intercept:m.intercept,displayEquation:m.displayEquation,displayRSquared:m.displayRSquared});if(!w||w.points.length<2)return;e.beginPath();let _=false;for(const C of w.points){const A=h(C.x);const P=s.y(C.y);if(!Number.isFinite(A)||!Number.isFinite(P))continue;if(!_){e.moveTo(A,P);_=true}else{e.lineTo(A,P)}}if(_)e.stroke();aVt(e,m,w,a,l)})}var lVt="linear";var cVt={[1]:"linear",[2]:"exponential",[3]:"logarithmic",[4]:"polynomial",[5]:"power",[6]:"movingAverage"};function eVr(e){if(e.length===0)return 0;return e.reduce((t,n)=>t+n,0)/e.length}function uVt(e){if(e.length<2)return 0;const t=eVr(e);const n=e.reduce((r,i)=>r+(i-t)*(i-t),0)/(e.length-1);return Math.sqrt(Math.max(0,n))}function tVr(e,t,n){if(e.valueType===2){const r=typeof e.value==="number"&&Number.isFinite(e.value)?e.value:10;return Math.abs(n)*(r/100)}if(e.valueType===3){return uVt(t)}if(e.valueType===4){const r=uVt(t);return t.length>0?r/Math.sqrt(t.length):0}return 0}function a1e(e,t,n,r,i,o){const a=t.errorBars?.[0];if(!a)return;if(i.length===0)return;const s=i.map(d=>d.value).filter(d=>Number.isFinite(d));if(s.length===0)return;e.save();rd(e,a.stroke,r,{color:"#666666",widthPx:1});const l=5;const u=a.noEndCap!==true;i.forEach(d=>{const f=tVr(a,s,d.value);if(!Number.isFinite(f)||f<=0)return;const h=o.y(d.value+f);const m=o.y(d.value-f);if(!Number.isFinite(h)||!Number.isFinite(m))return;e.beginPath();e.moveTo(d.x,h);e.lineTo(d.x,m);e.stroke();if(u){e.beginPath();e.moveTo(d.x-l,h);e.lineTo(d.x+l,h);e.moveTo(d.x-l,m);e.lineTo(d.x+l,m);e.stroke()}});e.restore()}function s1e(e,t,n,r,i,o,a,s){const{x:l,y:u}=r;const d=iVt(t,a);const f=d.categories;d.layers.forEach(h=>{const m=t.series[h.seriesIndex];if(!m)return;const g=k3(m);const x=t.type===13&&d.mode==="standard"&&t.displayBlanksAs===3;const w=DK(m,h.seriesIndex,i);const _=w.color;e.strokeStyle=_;e.lineWidth=w.widthPx;const C=[];const A=[];for(let P=0;P0&&w.visible){e.save();rd(e,m.stroke,i,{color:_,widthPx:w.widthPx});const P=Wb().defined(L=>Number.isFinite(L.cx)&&Number.isFinite(L.cy)).x(L=>L.cx).y(L=>L.cy).curve(aO).context(e);if(m.smooth===false||m.smooth===void 0&&t.type===12&&t.lineOptions?.smooth===false){P.curve(I1)}e.beginPath();P(A);e.stroke();e.restore()}if(m.trendlines?.length){const P=s?.bySeriesIndex.get(h.seriesIndex);o1e(e,t,m,h.seriesIndex,f,h.values,i,{y:u,xCenter:L=>Yb(l,L)},n,P)}if(m.errorBars?.length){a1e(e,m,h.seriesIndex,i,C.map(P=>({x:P.cx,y:P.cy,value:P.value})),{y:u})}C.forEach(P=>{const L=wm(t,m,P.idx,P.value);if(!L.show)return;WE(e,L.text,L.position,L.textStyle,i,{x:P.cx,y:P.cy},{callout:L.callout,fill:L.fill})});if(!K0e(m)||C.length===0){return}C.forEach(({cx:P,cy:L})=>{Z0e(e,m,i,{x:P,y:L},_)})})}function dVt(e,t){const{group:n,xAxis:r,yAxis:i}=t;return{...e,type:n.type,series:n.series,xAxis:r,yAxis:i,dataLabels:n.dataLabels,barOptions:n.barOptions,lineOptions:n.lineOptions,areaOptions:n.areaOptions,scatterOptions:n.scatterOptions,bubbleOptions:n.bubbleOptions,radarOptions:n.radarOptions}}VT();$E();function fVt(e,t){const n=Nh(e);const r=e.series.map((d,f)=>f).filter(d=>!t?.has(d));const i=e.areaOptions?.grouping;const o=i===2?"stacked":i===3?"percent":"standard";const a=r.map(d=>({seriesIndex:d,tuples:n.map(()=>({start:0,end:0}))}));if(o==="standard"||r.length===0){n.forEach((d,f)=>{r.forEach(h=>{const m=a.find(x=>x.seriesIndex===h);if(!m)return;const g=e.series[h]?.values[f]??0;m.tuples[f]={start:0,end:g}})});return{categories:n,visibleSeries:r,mode:o,layers:a}}const s=n.map((d,f)=>{const h={};r.forEach(m=>{const g=e.series[m];h[String(m)]=g?.values[f]??0});return h});const l=lO().keys(r.map(d=>String(d))).value((d,f)=>d[f]??0).order(VE);if(o==="percent"){l.offset(cO)}else{l.offset(uO)}const u=l(s);u.forEach(d=>{const f=Number.parseInt(d.key,10);const h=a.find(m=>m.seriesIndex===f);if(!h)return;n.forEach((m,g)=>{const x=d[g];if(!x)return;const w=Number.isFinite(x[0])?x[0]:0;const _=Number.isFinite(x[1])?x[1]:0;h.tuples[g]={start:w,end:_}})});return{categories:n,visibleSeries:r,mode:o,layers:a}}function l1e(e,t,n,r,i,o,a){const s=n.x;const l=n.y;const u=fVt(t,a?new Set(a):void 0);const d=u.categories;e.save();e.beginPath();e.rect(i.x,i.y,i.width,i.height);e.clip();u.layers.forEach(f=>{const h=f.seriesIndex;const m=t.series[h];if(!m)return;const g=m.stroke?.fill;const x=g?.type===0&&g.color===void 0;const w=id(m,h,r);const _=(()=>{if(!w)return void 0;const P=Kd(w);if(P){return P.formatRgb()}return w})();let C=_;if(m.fill){C=A9(e,i,m.fill,r)}if(C)e.fillStyle=C;if(w)e.strokeStyle=w;e.lineWidth=1;e.beginPath();let A=false;for(let P=0;P=0;P--){const L=d[P];const I=Yb(s,L);if(I===void 0)continue;const N=f.tuples[P];const O=N?.start??0;const z=l(O);e.lineTo(I,z)}e.closePath();e.fill();if(!x){e.stroke()}if(o){const P=6;d.forEach((L,I)=>{const N=Yb(s,L);if(N===void 0)return;const O=f.tuples[I];const z=O?.end??0;const U=l(z);o.push({kind:"area-point",x:N-P/2,y:U-P/2,width:P,height:P,seriesName:m.name,category:L,value:m.values[I]??0,color:w,anchorX:N,anchorY:U})})}});e.restore()}var nVr=.5;var rVr=8;var iVr=5;function mVt(e){const{ctx:t,axis:n,scale:r,dims:i,themeMap:o,side:a,baselineY:s}=e;const l=e.chartArea??i;const u=wl(n,o);const d=a==="left"?i.x:i.x+i.width;const f=a==="left"?-1:1;const h=a==="left"?"right":"left";if(n?.deleted){hVt({ctx:t,axis:n,axisX:d,direction:f,labelBandWidth:0,dims:i,chartArea:l,themeMap:o,fallbackColor:u.textColor,fallbackFontSize:u.fontSize});return 0}t.save();if(n?.line?.fill?.color){t.strokeStyle=u.lineColor;t.beginPath();t.moveTo(d,i.y);t.lineTo(d,i.y+i.height);t.stroke()}t.textAlign=h;t.textBaseline="middle";t.fillStyle=u.textColor;const m=r_({ctx:t,axis:n,scale:r,preferredTickCount:iVr,themeMap:o});const g=Boolean(n?.majorGridlines?.fill?.color);const x=Boolean(n?.minorGridlines?.fill?.color);const w=n?.majorTickMark!==void 0&&n.majorTickMark!==0&&n.majorTickMark!==1;const _=x?m.minorTicks:[];if(x&&n?.minorGridlines){t.save();rd(t,n.minorGridlines,o,{color:u.gridLineColor??u.lineColor,widthPx:.75});_.forEach(C=>{const A=r(C);if(!Number.isFinite(A)||pVt(A,s))return;t.beginPath();t.moveTo(i.x,A);t.lineTo(i.x+i.width,A);t.stroke()});t.restore()}m.ticks.forEach(C=>{const A=r(C);if(!Number.isFinite(A))return;if(g&&n?.majorGridlines){t.save();rd(t,n.majorGridlines,o,{color:u.gridLineColor??u.lineColor,widthPx:1});if(!pVt(A,s)){t.beginPath();t.moveTo(i.x,A);t.lineTo(i.x+i.width,A);t.stroke()}t.restore()}if(w){t.strokeStyle=u.lineColor;t.beginPath();t.moveTo(d,A);t.lineTo(d+f*4,A);t.stroke()}if(!m.hideTickLabels){t.font=`${u.fontSize}px ${u.fontFamily}`;const P=uh(C,n?.numberFormatCode);t.fillText(P,d+f*6,A)}});hVt({ctx:t,axis:n,axisX:d,direction:f,labelBandWidth:m.labelBandWidth,dims:i,chartArea:l,themeMap:o,fallbackColor:u.textColor,fallbackFontSize:u.fontSize});t.restore();return m.labelBandWidth}function hVt(e){const{ctx:t,axis:n,axisX:r,direction:i,labelBandWidth:o,dims:a,chartArea:s,themeMap:l,fallbackColor:u,fallbackFontSize:d}=e;const f=Tm(l,n?.title,n?.titleTextStyle,d,-90);if(!f)return;let h=rVr;if(n?.deleted){h=0}const m=r+i*(o+h+f.width/2);z3({ctx:t,axis:n,metrics:f,automaticCenter:{x:m,y:a.y+a.height/2},chartArea:s,themeMap:l,fallbackColor:u})}function pVt(e,t){return Math.abs(e-t)<=nVr}function IZ(e,t,n){const r=new Tp(e).comboRenderGroups;const i=r.map(a=>{const s=dVt(e,a);const l=aVr(a.firstSeriesIndex,a.group.series.length,n);return{renderGroup:a,groupChart:s,groupScales:O3(s,t,l,new Tp(s)),groupHiddenSeriesIndices:l}});const o=new Map;for(const a of i){const s=oVr(a.renderGroup);const l=o.get(s)??[];l.push(a);o.set(s,l)}for(const a of o.values()){if(a.length<2)continue;const s=a[0];if(!s)continue;const l={...e,type:31,series:a.flatMap(({renderGroup:d})=>d.group.series.map(f=>f)),chartGroups:a.map(({renderGroup:d})=>d.group),xAxis:s.renderGroup.xAxis,yAxis:s.renderGroup.yAxis};const u=O3(l,t,void 0,new Tp(l)).y;for(const d of a){d.groupScales={...d.groupScales,y:u}}}return i}function gVt(e,t,n,r,i,o,a,s,l){const u=l??IZ(t,n,a);if(u.length===0){return}const d=new Set;for(const{renderGroup:f,groupScales:h}of u){const m=f.yAxis;if(f.isPrimaryValueAxis||!m)continue;if(m.id!==void 0&&d.has(m.id))continue;const g=m.position===1?"left":m.position===2?"right":void 0;if(!g)continue;const x=h.y.domain();const w=x[0];const _=x[x.length-1];if(w===void 0||_===void 0)continue;const C=h.y(Math.min(w,_));mVt({ctx:e,axis:m,scale:h.y,dims:n,chartArea:r,themeMap:i,side:g,baselineY:C});if(m.id!==void 0)d.add(m.id)}for(const{renderGroup:f,groupChart:h,groupScales:m,groupHiddenSeriesIndices:g}of u){const x=f.group;switch(x.type){case 4:lbe(e,h,m,i,o,g);break;case 13:case 12:s1e(e,h,n,m,i,o,g,s);break;case 2:case 1:l1e(e,h,m,i,n,o,g);break;default:break}}}function oVr(e){if(e.yAxis?.id!==void 0){return`axis:${e.yAxis.id}`}return e.isPrimaryValueAxis?"axis:primary":`group:${e.firstSeriesIndex}`}function aVr(e,t,n){if(!n){return void 0}const r=new Set;for(let i=0;i0?r:void 0}R1();VT();function yVt(e,t){const n=Nh(e);const r=n.length;const i=e.series.map((h,m)=>m).filter(h=>!t?.has(h));const o=i.map(h=>({seriesIndex:h,values:Array.from({length:r},()=>0)}));let a=Number.POSITIVE_INFINITY;let s=Number.NEGATIVE_INFINITY;n.forEach((h,m)=>{i.forEach(g=>{const x=e.series[g];const w=x?.values[m];const _=typeof w==="number"&&Number.isFinite(w)?w:0;const C=o.find(A=>A.seriesIndex===g);if(!C)return;C.values[m]=_;a=Math.min(a,_);s=Math.max(s,_)})});if(a===Number.POSITIVE_INFINITY){a=0}if(s===Number.NEGATIVE_INFINITY){s=0}const l=e.yAxis&&e.yAxis.min!==void 0?Number(e.yAxis.min):void 0;const u=e.yAxis&&e.yAxis.max!==void 0?Number(e.yAxis.max):void 0;let d=l!==void 0&&Number.isFinite(l)?l:Math.min(0,a);let f=u!==void 0&&Number.isFinite(u)?u:s;if(!Number.isFinite(d)){d=0}if(!Number.isFinite(f)){f=0}if(f{const U=s.length;if(U===0)return-Math.PI/2;return-Math.PI/2+z*2*Math.PI/U};const _=z=>{if(!Number.isFinite(z))return h;if(zm)return m;return z};const C=wl(t.xAxis,r);const A=t.yAxis?.majorGridlines?.fill?.color?oo(t.yAxis.majorGridlines.fill.color,r):void 0;const P=A??bVt;const L=Array.from(new Set([...g.ticks(5),m])).filter(z=>Number.isFinite(z)&&z>h&&z<=m).sort((z,U)=>z-U);if(L.length>0){e.save();e.strokeStyle=P;e.lineWidth=1;L.forEach(z=>{const U=g(z);if(!Number.isFinite(U)||U<=0)return;e.beginPath();s.forEach((W,H)=>{const $=w(H);const K=l+U*Math.cos($);const X=u+U*Math.sin($);if(H===0){e.moveTo(K,X)}else{e.lineTo(K,X)}});e.closePath();e.stroke()});e.restore()}const I=t.yAxis?.line?.fill?.color?oo(t.yAxis.line.fill.color,r):bVt;e.save();e.strokeStyle=I;e.lineWidth=1;s.forEach((z,U)=>{const W=w(U);const H=l+x*Math.cos(W);const $=u+x*Math.sin(W);e.beginPath();e.moveTo(l,u);e.lineTo(H,$);e.stroke()});e.restore();e.save();e.font=Cc(C);e.fillStyle=C.textColor;const N=x+Math.max(C.fontSize,10);s.forEach((z,U)=>{const W=w(U);const H=Math.cos(W);const $=Math.sin(W);const K=l+N*H;const X=u+N*$;if(H>.25)e.textAlign="left";else if(H<-.25)e.textAlign="right";else e.textAlign="center";if($>.25)e.textBaseline="top";else if($<-.25)e.textBaseline="bottom";else e.textBaseline="middle";e.fillText(z,K,X)});e.restore();const O=t.radarOptions?.style??1;a.layers.forEach(z=>{const U=t.series[z.seriesIndex];if(!U)return;const W=id(U,z.seriesIndex,r);if(W){e.strokeStyle=W}e.lineWidth=2;const H=s.map((X,j)=>{const te=z.values[j]??h;const J=_(te);const oe=g(J);const se=w(j);return{x:l+oe*Math.cos(se),y:u+oe*Math.sin(se),value:J,idx:j}});if(H.length===0)return;e.beginPath();H.forEach((X,j)=>{if(j===0){e.moveTo(X.x,X.y)}else{e.lineTo(X.x,X.y)}});e.closePath();if(O===3){const X=(()=>{if(!W)return void 0;const j=Kd(W);if(j){return j.formatRgb()}return W})();if(X){e.fillStyle=X;e.fill()}}e.stroke();const $=U.marker?.symbol;const K=O===2&&$!==void 0&&$!==1&&$!==0;if(K){const X=U.marker?.size;const j=X!==void 0&&Number.isFinite(X)?X*96/72:6;const te=Math.max(j/2,1.5);H.forEach(J=>{const oe=J.idx;const se=Zd(U,oe);const re=Pd(U,oe,z.seriesIndex,r);const ce=Uh(U,oe,r);e.beginPath();e.arc(J.x,J.y,te,0,Math.PI*2);if(!se){const xe=re??W;if(xe){e.fillStyle=xe;e.fill()}}const ue=ce.color??W;if(ue){e.strokeStyle=ue;e.lineWidth=ce.widthPx??1;e.stroke()}})}if(i){H.forEach(X=>{const j=s[X.idx];const te=U.values[X.idx]??0;i.push({kind:"line-point",x:X.x-3,y:X.y-3,width:6,height:6,seriesName:U.name,category:j,value:te,color:W,anchorX:X.x,anchorY:X.y})})}})}R1();var sVr=6;function c1e(e){if(e===void 0){return 1}return e/100}function MZ(e,t,n){if(e===void 0||t===void 0){return sVr*n}return t(e)*n}var lVr=.25;var QVe=6;var cVr=5;var uVr=9/10;var u1e=1;var e$e=.1;function dVr(e){if(!Number.isFinite(e)||e<=0){return 1}const t=10**Math.floor(Math.log10(e));const n=e/t;if(n<1.5){return t}if(n<3){return 2*t}if(n<7){return 5*t}return 10*t}function fVr({axis:e,extent:t,points:n,value:r,radiusScale:i,scaleMultiplier:o,rangeSpan:a}){if(e?.min!==void 0||e?.max!==void 0||e?.majorUnit!==void 0||!e?.numberFormatCode?.includes("%")||a<=0){return void 0}const s=t[1]-t[0];if(!Number.isFinite(s)||s<=0)return void 0;let l=Number.POSITIVE_INFINITY;let u=Number.NEGATIVE_INFINITY;for(const d of n){const f=r(d);const h=MZ(d.size,i,o)/a*s;l=Math.min(l,f-h);u=Math.max(u,f+h)}if(!Number.isFinite(l)||!Number.isFinite(u)){return void 0}return dVr((u-l)/cVr)}function vVt(e,t){if(t!==void 0){return void 0}if(e===void 0||e.min===void 0&&e.max===void 0){return QVe}if(e.min!==void 0&&e.min!==0&&e.max===void 0){return QVe}if(e.min===void 0&&e.max===u1e&&e.numberFormatCode?.includes("%")){return QVe}return void 0}function _Vt(e,t,n,r){if(t?.min===void 0||t.min===0||t.max!==void 0||n!==void 0){return}const i=vk(e);const[o,a]=e.domain();if(i===void 0||o===void 0||a===void 0||a<=o||(r-o)/(a-o)<=uVr){return}e.domain([o,a+i])}function TVt(e,t){if(e?.min!==0||e.max!==void 0||!e.numberFormatCode?.includes("%")||t<=0||t>=u1e){return void 0}const n=Math.ceil(t/e$e)*e$e;if(Number(n.toPrecision(15))===u1e-e$e){return u1e}return void 0}function t$e(e){return{xTickCount:Math.max(2,Math.floor(e.width/80)),yTickCount:Math.max(2,Math.floor(e.height/60))}}function wVt([e,t]){if(!Number.isFinite(e)||!Number.isFinite(t)){return[0,1]}if(e===t){if(e===0)return[-1,1];const n=Math.abs(e)*.1||1;return[e-n,t+n]}return[e,t]}function EVt({scale:e,axis:t,points:n,value:r,radiusScale:i,scaleMultiplier:o}){if(t?.logBase!==void 0){return}const a=vk(e);const s=t?.min===void 0;const l=t?.max===void 0;const[u,d]=e.range();if(u===void 0||d===void 0){throw new Error("Expected a two-value bubble scale range")}const f=Math.abs(d-u);if(a===void 0||!Number.isFinite(a)||a<=0||f<=0||!s&&!l){return}while(true){const[h,m]=e.domain();if(h===void 0||m===void 0){throw new Error("Expected a two-value bubble scale domain")}const g=Math.min(h,m);const x=Math.max(h,m);const w=x-g;if(w<=0){return}let _=false;let C=false;for(const L of n){const I=r(L);const N=MZ(L.size,i,o)/f;const O=(I-g)/w;if(s&&O0}else if(e.bubbleOptions?.sizeRepresents===2){l=wc().domain([0,W]).range([0,H])}else{l=I9e().domain([0,W]).range([0,H])}}const u=[i?.min??n.extents.x[0],i?.max??n.extents.x[1]];const d=[o?.min??n.extents.y[0],o?.max??n.extents.y[1]];const f=wVt(u);const h=wVt(d);const m=[t.x,t.x+t.width];const g=[t.y+t.height,t.y];if(i?.orientation===2){m.reverse()}if(o?.orientation===2){g.reverse()}const{xTickCount:x,yTickCount:w}=t$e(t);const _=r?.niceXDomain??true;const C=n.series.flatMap(({points:W})=>W.map(H=>H.x));const A=n.series.flatMap(({points:W})=>W.map(H=>H.y));const P=n.series.flatMap(W=>W.points);const L=c1e(e.bubbleOptions?.scale);const I=TVt(i,f[1]);const N=TVt(o,h[1]);let O;if(s){O=cK({automaticMin:f[0],automaticMax:f[1],automaticPositiveMin:QN(C),range:m,axis:i,expandWideValuesToZero:false,expandNarrowValuesTowardZero:false,maximumAutoMainIncrementCount:vVt(i,I),minimumAutomaticMax:I})}else{let W=false;if(_){W=x}O=A0e({automaticMin:f[0],automaticMax:f[1],automaticPositiveMin:QN(C),range:m,axis:i,niceCount:W})}let z;if(l!==void 0){z=fVr({axis:o,extent:h,points:P,value:W=>W.y,radiusScale:l,scaleMultiplier:L,rangeSpan:Math.abs(g[1]-g[0])})}let U;if(s){U=cK({automaticMin:h[0],automaticMax:h[1],automaticPositiveMin:QN(A),range:g,axis:o,maximumAutoMainIncrementCount:vVt(o,N),minimumAutomaticMax:N,automaticMajorUnit:z})}else{U=A0e({automaticMin:h[0],automaticMax:h[1],automaticPositiveMin:QN(A),range:g,axis:o,niceCount:w})}if(s&&l!==void 0){_Vt(O,i,I,f[1]);_Vt(U,o,N,h[1]);EVt({scale:O,axis:i,points:P,value:W=>W.x,radiusScale:l,scaleMultiplier:L});EVt({scale:U,axis:o,points:P,value:W=>W.y,radiusScale:l,scaleMultiplier:L})}return{x:O,y:U,r:l}}function CVt(e,t=v6t){return{x:e.x+t.left,y:e.y+t.top,width:e.width-t.left-t.right,height:e.height-t.top-t.bottom}}var hVr=yO*2;var RVt=96/25.4/100;var SVt=210*RVt;var AVt=185*RVt;function kVt(e,t,n){const r=Math.min(t,n);const i=Math.min(Math.max(0,e),r+SVt);return{reserveWidth:i,legendWidth:Math.max(0,i-SVt)}}function PVt(e,t,n,r,i={}){let o=n;if(!t.hasLegend)return{plotDims:o};const a=t.legend?.position??1;const s=a===5?1:a;const{width:l,height:u}=Jzt(e,t,r,{position:s,maxWidthPx:s===3||s===4?Math.max(0,o.width):void 0});const d=l+hVr;const f=i.outerDims&&i.outerDims.width>0?Math.max(0,i.outerDims.width*(i.maxSideFrac??.35)):Number.POSITIVE_INFINITY;let h;const m=Boolean(t.legend?.overlay);const g=8;switch(s){case 3:{const w=Math.min(Math.max(0,o.height),u);const _=Math.min(Math.max(0,o.height),w+AVt);h=m?{x:o.x+g,y:o.y+g,width:Math.max(0,o.width-g*2),height:w}:{x:o.x,y:o.y,width:o.width,height:w};if(!m){o={x:o.x,y:o.y+_,width:o.width,height:Math.max(0,o.height-_)}}break}case 4:{const w=Math.min(Math.max(0,o.height),u);const _=Math.min(Math.max(0,o.height),w+AVt);const C=Math.max(o.y,o.y+o.height-w);h=m?{x:o.x+g,y:o.y+Math.max(0,o.height-w)-g,width:Math.max(0,o.width-g*2),height:w}:{x:o.x,y:C,width:o.width,height:w};if(!m){o={x:o.x,y:o.y,width:o.width,height:Math.max(0,o.height-_)}}break}case 2:{const{reserveWidth:w,legendWidth:_}=kVt(o.width,d,f);h=m?{x:o.x+g,y:o.y+g,width:_,height:Math.max(0,o.height-g*2)}:{x:o.x,y:o.y,width:_,height:o.height};if(!m){o={x:o.x+w,y:o.y,width:Math.max(0,o.width-w),height:o.height}}break}case 1:default:{const{reserveWidth:w,legendWidth:_}=kVt(o.width,d,f);h=m?{x:o.x+Math.max(0,o.width-_)-g,y:o.y+g,width:_,height:Math.max(0,o.height-g*2)}:{x:o.x+Math.max(0,o.width-_),y:o.y,width:_,height:o.height};if(!m){o={x:o.x,y:o.y,width:Math.max(0,o.width-w),height:o.height}}break}}const x=t.legend?.manualLayout;if(x&&h&&RK(x)){return{plotDims:n,legendRect:pO(i.outerDims??n,h,x),legendPosition:s}}return{plotDims:o,legendRect:h,legendPosition:s}}zh();R1();var pVr=[0,-45,-90];var IVt=6;var mVr=4;var gVr=6;var yVr=2;var LVt=1e-6;function DVt(e){const{ctx:t,axis:n,categories:r,scale:i,plotDims:o,themeMap:a,maxLabelBandHeightPx:s,labelHeightPx:l}=e;const u=wl(n,a);t.font=Cc(u);const d={...n?.textStyle};if(d.fontSize===void 0||!Number.isFinite(d.fontSize)||d.fontSize<=0){d.fontSize=Math.round(u.fontSize*75)}const f=l??$0e(t,u.fontSize);const h=XT(n);const m=Qc(n);const g=wVr(n);const x=EVr(n);const w=n&&w9(n)?z7t(n,r):void 0;const _=n&&w?xUe(n,r.map(Number)):void 0;const C=w?.map(({positionCategory:H})=>H)??r;const A=w?.map(({label:H})=>H)??C.map(H=>SK(H,n));const P=w&&_?w.map(({serial:H})=>SVr(H,_,o)):void 0;const L=MVt(t,A);const I=n!==void 0&&w9(n)&&g===void 0&&A.some(H=>/\s/.test(H));const N=I?MVt(t,A.map(H=>IVr(t,H))):void 0;if(C.length===0||m){return{step:g??1,rotationDeg:x??0,labelMaxWidthPx:0,labelBandHeight:0,labelLinesByIndex:{},visibleIndices:n$e(C.length,g??1),hideTickLabels:m,tickLabelDistancePx:h,autoRotation:false,autoStep:false,tickCategories:C,tickLabels:A,tickPositionsPx:P}}const O=A.map(H=>{const $={type:1,paragraphs:[{runs:[{text:H,citations:[],reviewMarkIds:[]}],inlineNodes:[]}],textStyle:d,effects:[],children:[],citations:[],levelsStyles:[],id:"category-axis-label"};const K=_p($,a,{wrap:false});if(K===void 0){return void 0}return K.lines.reduce((X,j)=>Math.max(X,j.widthPx),0)});const z=g?[g]:w?[1]:Array.from({length:C.length},(H,$)=>$+1);const U=x!==void 0?[x]:[...pVr];let W;for(const H of z){for(const $ of U){const K=bVr({ctx:t,categories:C,labels:A,scale:i,plotDims:o,labelHeightPx:f,step:H,rotationDeg:$,maxLabelBandHeightPx:s,tickLabelDistancePx:h,minimumReadableWidthPx:L,wrappedMinimumReadableWidthPx:N,compactLabelLineHeightPx:I?l??u.fontSize:void 0,labelWidthsPx:O,explicitRotation:x,explicitStep:g,tickPositionsPx:P});if(K.fits){return K}if(!W||K.overflowPx=m*2;const I=CVr(i,n,A,_,L?0:mVr);const N=PVr(l);const O=AVr(I,a,N);const z=kVr(C,a,N);const U=RVr(Math.min(O,z,o.width));const W=l===0?Math.max(1,Math.floor(C/(L?m:a))):1;const H=l===0&&W>1&&!P;const $=L&&H;const K=P?o.width:U;let X=0;let j=0;const te={};for(const xe of A){const be=xVr({ctx:t,label:r[xe]??"",maxWidthPx:K,maxLineCount:W,allowWordWrap:H});te[xe]=be;j=Math.max(j,be.length);for(const Ie of be){const he=t.measureText(Ie).width;if(he>X){X=he}}}const J=$&&j>1?m:a;const oe=l===0?{width:X,height:j*J}:C9(X,a,N);const se=A.length>0?oe.height+IVt+d:0;const re=MVr(x,w)?Math.max(0,($?h??f:f)-U):0;const ce=TVr({ctx:t,categories:r,visibleIndices:A,labelMaxWidthPx:U,rotationDeg:l,explicitRotation:x});const ue=Math.max(0,se-u,re,ce);return{step:s,rotationDeg:l,labelMaxWidthPx:U,labelBandHeight:se,...$&&j>1?{labelLineHeightPx:J}:{},labelLinesByIndex:te,visibleIndices:A,hideTickLabels:false,tickLabelDistancePx:d,autoRotation:x===void 0,autoStep:w===void 0,tickCategories:n,tickLabels:r,tickPositionsPx:_,fits:ue<=0,overflowPx:ue}}function xVr(e){const{allowWordWrap:t,ctx:n,label:r,maxLineCount:i,maxWidthPx:o}=e;const a=r.split(/\r\n|\n|\r/);if(a.length<=1){return t?_Vr(n,r,o,i):[n_(n,r,o)]}const s=Math.max(1,i);const l=a.slice(0,s);if(l.lengthn_(n,u.trim(),o))}function vVr(e){const{categories:t,plotDims:n,scale:r,labelWidthsPx:i,visibleIndices:o,tickPositionsPx:a}=e;const s=n.x+n.width;let l=Number.NEGATIVE_INFINITY;for(const u of o){const d=t[u];if(!r$e(d))continue;const f=a?.[u]??Yb(r,d);if(f===void 0||!Number.isFinite(f)){continue}const h=i[u];if(h===void 0||!Number.isFinite(h)||h<=0||h>n.width){return false}const m=h/2;const g=Math.min(Math.max(f,n.x+m),s-m);const x=g-m;const w=g+m;if(xn){break}l=u;s+=1}a.push(n_(e,l,n))}return a.length>0?a:[n_(e,t,n)]}function TVr(e){const{categories:t,ctx:n,explicitRotation:r,labelMaxWidthPx:i,rotationDeg:o,visibleIndices:a}=e;if(r!==void 0||o!==0||i<=0){return 0}let s=0;for(const l of a){const u=t[l];if(!r$e(u))continue;if(/\s/.test(u))continue;const d=n.measureText(u).width;if(!Number.isFinite(d))continue;s=Math.max(s,d-i)}return Math.max(0,s-yVr)}function wVr(e){const t=B3(e);if(t.tickLabelInterval===void 0||!Number.isFinite(t.tickLabelInterval)){return void 0}return Math.max(1,Math.floor(t.tickLabelInterval))}function EVr(e){const t=e?.textStyle?.rotation;if(typeof t!=="number"||!Number.isFinite(t)){return void 0}if(t===-1e3)return 0;return G0e(e)}function n$e(e,t){if(e<=0)return[];const n=Math.max(1,Math.floor(t));const r=[];for(let i=0;i0}function AVr(e,t,n){if(!Number.isFinite(e)){return Number.POSITIVE_INFINITY}const r=Math.abs(Math.cos(n));const i=Math.abs(Math.sin(n));const o=e-t*i;if(o<=0){return 0}if(r<=LVt){return Number.POSITIVE_INFINITY}return o/r}function kVr(e,t,n){if(!Number.isFinite(e)){return Number.POSITIVE_INFINITY}const r=Math.abs(Math.cos(n));const i=Math.abs(Math.sin(n));const o=e-t*r;if(o<=0){return 0}if(i<=LVt){return Number.POSITIVE_INFINITY}return o/i}function RVr(e){if(!Number.isFinite(e)){return Number.MAX_SAFE_INTEGER}return Math.max(0,Math.floor(e))}function PVr(e){const t=Math.abs(e%180);return t*Math.PI/180}function MVt(e,t){const n=t.map(i=>e.measureText(i).width).filter(i=>Number.isFinite(i)&&i>0).sort((i,o)=>i-o);if(n.length===0){return 0}const r=n[Math.floor(n.length/2)]??n[0]??0;return Math.min(r,Math.max(e.measureText("0000\u2026").width,r*.35))}function IVr(e,t){const n=t.trim().split(/\s+/).filter(Boolean);let r="";let i=0;for(const o of n){const a=e.measureText(o).width;if(a>i){r=o;i=a}}return r}function MVr(e,t){return!(e!==void 0&&t!==void 0)}var i$e=8;var LVr=.4;function FVt(e,t,n,r,i){const o=i.maxLeftFrac??1;const a=i.maxBottomFrac??LVr;const s=i.chartModel.resolveCategories();const l=t.yAxis;const u=!!l?.deleted;const d=wl(l,r);const f=AK(t);e.font=Cc(d);const h=t.barOptions?.grouping;let m=0;let g=0;if(t.type===31){const ve=h9(i.chartModel);const ge=ve.max>=0;m=ge?Math.min(0,ve.min):ve.min;g=ge?Math.max(0,ve.max):ve.max}else if(h===2){const ve=pk(s.map((Ve,Le)=>mk(t.series,$e=>Math.max(0,$e.values[Le]??0))))??0;const ge=-(pk(s.map((Ve,Le)=>mk(t.series,$e=>Math.max(0,-($e.values[Le]??0)))))??0);m=Math.min(0,ge);g=Math.max(0,ve)}else if(h===3){m=0;g=1}else{const ve=t.series.flatMap(Ve=>Ve.values);const ge=Cy(ve);m=Math.min(0,ge[0]??0);g=ge[1]??0}if(t.series.some(ve=>(ve?.trendlines?.length??0)>0)){let ve=Number.POSITIVE_INFINITY;let ge=Number.NEGATIVE_INFINITY;for(const Ve of t.series){if(!Ve?.trendlines?.length)continue;const Le=Ve.values??[];const $e=[];for(let Ee=0;Ee=0});const w=eO(wc().range([n.y+n.height,n.y]),x,f);const _=!u?r_({ctx:e,axis:l,scale:w,preferredTickCount:f,themeMap:r}):void 0;const C=Tm(r,l?.title,l?.titleTextStyle,d.fontSize,-90);const A=!u?_?.labelBandWidth??0:0;let P=0;if(C&&!mO(l)){P=C.width;if(!u){P+=i$e}}const L=n.width*o;const I=Math.min(L,A+P);let N=0;if(t.type===31){const ve=new Set;const ge=IZ(t,n,i.hiddenSeriesIndices);for(const{renderGroup:Ve,groupScales:Le}of ge){const $e=Ve.yAxis;if(Ve.isPrimaryValueAxis||$e===void 0||$e.deleted||$e.position!==2){continue}if($e.id!==void 0&&ve.has($e.id)){continue}const Ee=r_({ctx:e,axis:$e,scale:Le.y,preferredTickCount:f,themeMap:r});const tt=wl($e,r);const yt=Tm(r,$e.title,$e.titleTextStyle,tt.fontSize,-90);let mt=0;if(yt&&!mO($e)){mt=i$e+yt.width}N=Math.max(N,Ee.labelBandWidth+mt);if($e.id!==void 0){ve.add($e.id)}}N=Math.min(n.width,N)}const O=Math.max(0,i.availableTopPaddingPx??0);const z=u?0:ibe(t)?d.fontSize/2:Math.max(0,d.fontSize/2-O);const U=wl(t.xAxis,r);e.font=Cc(U);const W=t.xAxis;const H=!!W?.deleted;const $=Tm(r,W?.title,W?.titleTextStyle,U.fontSize,0);const K=$&&!mO(W)?i$e+$.height:0;const X=w.domain();const j=w(Math.min(...X));const te=w(Math.max(...X));let J=W?.position===3;if(W?.tickLabelPosition===1){J=te0&&oe.height>0?DVt({ctx:e,axis:W,categories:s,scale:O3(t,oe,i.hiddenSeriesIndices,i.chartModel).x,plotDims:oe,themeMap:r,maxLabelBandHeightPx:Math.max(0,re-K)}):void 0;const ue=H?0:Math.min(re,(ce?.labelBandHeight??0)+K);let xe=z;let be=ue;if(J){xe=Math.max(z,ue);be=0}const Ie={x:i.preservePlotArea?n.x:n.x+I,y:i.preservePlotArea?n.y:n.y+xe,width:i.preservePlotArea?n.width:Math.max(0,n.width-I-N),height:i.preservePlotArea?n.height:Math.max(0,n.height-xe-be)};const he=!u?r_({ctx:e,axis:l,scale:eO(wc().range([Ie.y+Ie.height,Ie.y]),x,f),preferredTickCount:f,themeMap:r}):void 0;return{plotDims:Ie,reservedLeft:I,reservedRight:N,reservedTop:xe,reservedBottom:be,xAxisPlan:ce,yAxisPlan:he}}var DVr="linear";var FVr={[1]:"linear",[2]:"exponential",[3]:"logarithmic",[4]:"polynomial",[5]:"power",[6]:"movingAverage"};var NVr=6;var NVt=8;function o$e(e,t){return uh(e,t)}function a$e(e,t,n,r,i){const o=t.xAxis??t.yAxis;const a=t.yAxis??t.xAxis;const s=wl(o,i);const l=wl(a,i);const u=!!o?.deleted;const d=!!a?.deleted;const f=Qc(o);const{xTickCount:h,yTickCount:m}=t$e(r);const g=u?[]:H0e(n.x,o,h);const x=!d?r_({ctx:e,axis:a,scale:n.y,preferredTickCount:m,themeMap:i}):void 0;const w=x?.ticks??[];const _=o?.majorTickMark!==void 0&&o.majorTickMark!==0&&o.majorTickMark!==1;const C=a?.majorTickMark!==void 0&&a.majorTickMark!==0&&a.majorTickMark!==1;const A=!!o?.majorGridlines?.fill?.color;const P=!!a?.majorGridlines?.fill?.color;e.font=Cc(s);const L=!u&&!f&&g.length>0?s.fontSize+NVr:0;const I=!d?x?.labelBandWidth??0:0;const N=!u?Tm(i,o?.title,o?.titleTextStyle,s.fontSize,0):void 0;const O=!d?Tm(i,a?.title,a?.titleTextStyle,l.fontSize,-90):void 0;return{xAxis:o,yAxis:a,xStyles:s,yStyles:l,xAxisDeleted:u,yAxisDeleted:d,hideXTickLabels:f,xTicks:g,yTicks:w,yAxisPlan:x,showXTicks:_,showYTicks:C,drawXGrid:A,drawYGrid:P,xLabelBand:L,yLabelBand:I,xTitleMetrics:N,yTitleMetrics:O}}function s$e(e,t,n,r,i,o={}){const a=o.maxLeftFrac??1;const s=o.maxBottomFrac??1;const l=a$e(e,t,n,r,i);const u=r.width*a;const d=r.height*s;const f=l.yAxisDeleted?0:Math.min(u,l.yLabelBand+(l.yTitleMetrics&&!mO(l.yAxis)?NVt+l.yTitleMetrics.width:0));const h=l.xAxisDeleted?0:Math.min(d,l.xLabelBand+(l.xTitleMetrics&&!mO(l.xAxis)?NVt+l.xTitleMetrics.height:0));return{plotDims:o.preservePlotArea?r:{x:r.x+f,y:r.y,width:Math.max(0,r.width-f),height:Math.max(0,r.height-h)},reservedLeft:f,reservedBottom:h,yAxisPlan:l.yAxisPlan}}var OVr=.2;var BVr=12;function OVt(e,t,n=OVr){const r=zVr(e)??(UVr(e)?VVr(e):void 0);if(r===void 0)return{reservedTop:0};const i=r+BVr;const o=t.height*n;return{reservedTop:Math.min(o,i)}}function zVr(e){const t=e.barOptions?.direction??e.barDirection;if((e.type===4||e.type===3)&&t===2){return void 0}const n=e.dataLabels;if(n?.showValue!==true||!ibe(e)||n.position!==1){return void 0}return n.textStyle?.fontSize?zc(n.textStyle.fontSize):Bh}function UVr(e){return e.type===4&&e.barOptions?.direction!==2&&e.yAxis?.deleted===true&&U8t(e)&&!J9e(e)}function VVr(e){let t;for(const n of e.series){for(let r=0;r({runs:r.runs.map(i=>({text:i.text,textStyle:i.textStyle,citations:[],reviewMarkIds:[]})),textStyle:r.textStyle,paragraphStyle:r.paragraphStyle,inlineNodes:[]}));return UVt(e,n)}function VVt(e){const t=e.titleParagraphs??[];if(t.length>0){return t.map(n=>n.runs.map(r=>r.text).join("")).join("\n")}if(e.title?.trim()){return e.title}if(e.autoTitleDeleted===false&&e.series?.length===1){return e.series[0]?.name??""}return""}function zVt(e){return e?.lines.reduce((t,n)=>t+n.heightPx,0)??0}function XVr(e,t){if(t>=e.length){return e}const n=e.slice(0,Math.max(0,t)).trimEnd();return n.length>0?`${n}\u2026`:"\u2026"}function jVr(e,t,n){const r=VVt(e);if(!r.trim()){return{text:"",element:void 0,layoutHeight:0}}const i=qVr(e);if(i){return{text:r,element:i,layoutHeight:zVt(_p(i,t,{bboxPx:n}))}}const o=f=>{const h=YVr(e,f);return{element:h,height:zVt(_p(h,t,{bboxPx:n}))}};const a=o(r);if(a.height<=n.height){return{text:r,element:a.element,layoutHeight:a.height}}let s=0;let l=r.length;let u="\u2026";let d=o(u);while(s<=l){const f=Math.floor((s+l)/2);const h=XVr(r,f);const m=o(h);if(m.height<=n.height){u=h;d=m;s=f+1}else{l=f-1}}return{text:u,element:d.element,layoutHeight:d.height}}function $Vt(e,t,n,r=HVr){if(!VVt(e).trim())return{text:"",reserved:0,layoutHeight:0};const i=e.titlePlacement;if(i==="none"){return{text:"",reserved:0,layoutHeight:0}}const o={x:t.x,y:t.y,width:t.width,height:Math.max(0,t.height*r)};let a=o;if(e.titleManualLayout){a=pO(t,o,e.titleManualLayout)}const s=e.titleManualLayout?.w;if(e.titleManualLayout&&e.plotAreaManualLayout&&(s===void 0||!Number.isFinite(s))){const x=pO(t,o,e.plotAreaManualLayout);const w=x.x+x.width;a={...a,width:Math.min(a.width,Math.max(0,w-a.x))}}const l=jVr(e,n,a);const u=l.layoutHeight;if(u<=0||!l.element){return{text:"",reserved:0,layoutHeight:0}}const d=e.titleManualLayout?.h;const f=d!==void 0&&Number.isFinite(d);let h=Math.min(a.height,u+GVr);if(f){h=a.height}const m={x:a.x,y:a.y,width:a.width,height:h};let g=0;if(i!=="centeredOverlay"){g=Math.min(t.height,Math.max(0,m.y-t.y)+m.height)}return{text:l.text,element:l.element,rect:m,reserved:g,layoutHeight:u}}zh();function LZ(e){if(typeof e==="number"&&Number.isFinite(e))return e;if(typeof e==="string"){const t=e.trim();if(t.length===0)return void 0;const n=Number(t);if(Number.isFinite(n))return n}return void 0}function KVr(e,t,n){const r=[];const i=t.xValues??[];const o=xm(t,e.categories);const a=n.length;const s=i.length>a&&n.every(u=>ua&&n.every(u=>ui)}function d1e(e,t={}){const n=t.hiddenSeriesIndices??new Set;const r=[];const i=[];const o=[];const a=[];e.series.forEach((g,x)=>{if(n.has(x))return;const w=g.values??[];const _=w.length;const C=ZVr(g,_);const A=KVr(e,g,C);const P=g.bubbleSizes??[];const L=P.length>_&&C.every(N=>N0){const g=Cy(a);if(g[0]===void 0||g[1]===void 0){throw new Error("Expected a non-empty bubble size extent")}const x=Math.max(0,g[0]);const w=Math.max(x,g[1]);m=[x,w]}return{series:r,extents:{x:[u,d],y:[f,h],size:m}}}function f1e(e,t){return d1e(e,{hiddenSeriesIndices:t,includeBubbleSize:true})}zh();uk();function GVt(e,t,n,r,i){const o=Math.abs(t-e);const a=Number.isFinite(o)&&o>0?Math.max(1,2-Math.floor(Math.log10(o))):2;const s=Oh(`.${a}~f`);const l=i===1;const u=l||n===0?"[":"(";const d=l&&n!==r-1?")":"]";const f=Number.isFinite(e)?s(e):"";const h=Number.isFinite(t)?s(t):"";return`${u}${f}, ${h}${d}`}function sw(e){if(typeof e==="number"&&Number.isFinite(e)){return e}if(typeof e==="string"){const t=e.trim();if(t.length===0)return void 0;const n=Number(t);if(Number.isFinite(n))return n}return void 0}function QVr(e){const t=/(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)[^\d\-+eE]+(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)/;const n=e.match(t);if(n){const i=sw(n[1]);const o=sw(n[2]);if(i!==void 0&&o!==void 0){return i<=o?[i,o]:[o,i]}}const r=sw(e);if(r!==void 0){return[r,r]}return void 0}function e$r(e,t){const[n,r]=Cy(e);const i=sw(t?.underflow)??(n!==void 0&&Number.isFinite(n)?n:0);const o=sw(t?.overflow)??(r!==void 0&&Number.isFinite(r)?r:i+1);if(i===o){return[Math.floor(i),Math.ceil(i+1)]}return i0){return r}const i=sw(n?.binCount);if(i!==void 0&&i>0){return t/Math.max(1,Math.floor(i))}const o=o0e(e);if(o!==void 0&&Number.isFinite(o)&&o>0){const a=3.5*o/Math.cbrt(e.length);const s=10**Math.floor(Math.log10(a));const l=a/s;const u=[1,2,4,5,10].reduce((d,f)=>Math.abs(f-l)0?d:void 0;i.forEach((m,g)=>{const x=sw(o[g]);if(x===void 0||x<0){return}const w=m?QVr(m):void 0;let _=0;let C=0;if(w){_=w[0];C=w[1];if(_===C){const A=f??1;C=_+A}}else{const A=f??1;_=s;C=s+A}s=C;l=Math.min(l,_);u=Math.max(u,C);a.push({x0:_,x1:C,count:x,label:m})});if(a.length===0){return void 0}const h=a.reduce((m,g)=>Math.max(m,g.count),0);a.forEach((m,g)=>{if(!m.label){m.label=GVt(m.x0,m.x1,g,a.length,n?.intervalClosed)}});return{bins:a,extents:{x:[l,u],y:[0,h]},seriesIndex:t}}function h1e(e,t){const n=t?.hiddenSeriesIndices;const r=e.series.findIndex((C,A)=>!n?.has(A));if(r===-1){return{bins:[],extents:{x:[0,1],y:[0,1]},seriesIndex:-1}}const i=e.histogramOptions;if(i?.aggregated){const C=n$r(e,r,i);if(C)return C}const o=e.series[r];const a=o?.values??[];const s=a.map(C=>sw(C)).filter(C=>C!==void 0);if(s.length===0){return{bins:[],extents:{x:[0,1],y:[0,1]},seriesIndex:r}}const[l,u]=e$r(s,i);const d=Math.max(u-l,1);const f=t$r(s,d,i);const h=sw(i?.binCount);const m=h!==void 0&&h>0?Math.max(1,Math.floor(h)):Math.max(1,Math.ceil(d/f));const g=l+m*f;const x=i?.intervalClosed===1;const w=Array.from({length:m},(C,A)=>{const P=l+A*f;const L=A===m-1?g:P+f;return{x0:P,x1:L,count:0,label:GVt(P,L,A,m,i?.intervalClosed)}});s.forEach(C=>{const A=w.findIndex((L,I)=>{if(x){return I===w.length-1?C>=L.x0&&C<=L.x1:C>=L.x0&&C=L.x0&&C<=L.x1:C>L.x0&&C<=L.x1});if(A===-1)return;const P=w[A];P.count+=1});const _=w.reduce((C,A)=>Math.max(C,A.count),0);return{bins:w,extents:{x:[l,g],y:[0,_]},seriesIndex:r}}function hU(e,t){return d1e(e,{hiddenSeriesIndices:t})}var p1e=.02;var r$r=350;var i$r=730;var o$r=68;var a$r=96/25.4/100;function s$r(e){return e*a$r}function l$r(e,t){if(fO(e.type)){const n=e.doughnutOptions?.holeSize;const r=e.type===8&&n!==void 0&&n<=o$r?i$r:r$r;const i=s$r(r);return{top:i,right:i,bottom:i,left:i}}return{top:t.height*p1e,right:t.width*p1e,bottom:t.height*p1e,left:t.width*p1e}}function m1e(e){return typeof e==="number"&&Number.isFinite(e)?e:void 0}function c$r(e){const t=e.plotAreaManualLayout;if(!t)return void 0;const n=t.layoutTarget!==void 0?Ape[t.layoutTarget]??"outer":"outer";const r={target:n,xMode:t.xMode!==void 0?uE[t.xMode]:void 0,yMode:t.yMode!==void 0?uE[t.yMode]:void 0,wMode:t.wMode!==void 0?uE[t.wMode]:void 0,hMode:t.hMode!==void 0?uE[t.hMode]:void 0,x:m1e(t.x),y:m1e(t.y),w:m1e(t.w),h:m1e(t.h)};return r.x!==void 0||r.y!==void 0||r.w!==void 0||r.h!==void 0?r:void 0}function l$e(e){return Math.max(0,Math.min(1,e))}function HVt(e,t,n,r,i,o){if(i===void 0)return r;const a=e+t*l$e(i);if(o==="edge"){return Math.max(0,a-n)}return a-e}function WVt(e,t,n){const r=n.x!==void 0?e.x+e.width*l$e(n.x):t.x;const i=n.y!==void 0?e.y+e.height*l$e(n.y):t.y;const o=HVt(e.x,e.width,r,t.width,n.w,n.wMode);const a=HVt(e.y,e.height,i,t.height,n.h,n.hMode);const s=Math.max(0,e.x+e.width-r);const l=Math.max(0,e.y+e.height-i);return{x:r,y:i,width:Math.min(o,s),height:Math.min(a,l)}}function YVt(e){return e.type===18||e.type===5}function qVt(e){const t=e.barOptions?.direction??e.barDirection;return(e.type===4||e.type===3)&&t===2}function u$r(e){return!fO(e.type)&&e.type!==29&&e.type!==30&&e.type!==17&&(e.type!==3||qVt(e))&&e.type!==23&&e.type!==28}function d$r(e,t,n,r,i,o,a,s,l,u,d){if(!u$r(t))return void 0;const f=o==="inner";if(qVt(t)){if(f)return void 0;return o9t(e,t,n,r,{chartModel:u,availableLeftPaddingPx:s,availableChartLeftPaddingPx:l.left,availableChartRightPaddingPx:l.right,availableChartTopPaddingPx:l.top,availableChartBottomPaddingPx:l.bottom})}if(t.type===24){const h=h1e(t,i?{hiddenSeriesIndices:i}:void 0);const m={series:[],extents:h.extents};const g=zO(t,n,m,{niceXDomain:false});return s$e(e,t,g,n,r,{preservePlotArea:f})}if(YVt(t)){const h=t.type===5?f1e(t,i):hU(t,i);const m=zO(t,n,h);return s$e(e,t,m,n,r,{preservePlotArea:f})}return FVt(e,t,n,r,{chartModel:u,preservePlotArea:f,availableTopPaddingPx:a,hiddenSeriesIndices:i,maxBottomPx:d})}function XVt(e,t,n,r,i){const o=i.topExtraPaddingPx??0;const a={x:n.x,y:n.y+o,width:n.width,height:Math.max(0,n.height-o)};const s=$Vt(t,a,r,.5);const l=s.rect;const u={x:a.x,y:a.y+s.reserved,width:a.width,height:Math.max(0,a.height-s.reserved)};const d=l$r(t,n);let f=CVt(u,d);let h;let m;if(!i.skipLegend&&t.hasLegend){const N=PVt(e,t,f,r,{outerDims:n,maxSideFrac:.28});f=N.plotDims;h=N.legendRect;m=N.legendPosition}const g=c$r(t);if(g?.target==="outer"){f=WVt(n,f,g)}const x=g?.target==="inner"?WVt(n,f,g):f;const w=Math.max(0,x.y-u.y);const _=g?.target==="outer"?Math.max(0,x.x-n.x):0;const C={top:Math.max(0,x.y-n.y),right:Math.max(0,n.x+n.width-(x.x+x.width)),bottom:Math.max(0,n.y+n.height-(x.y+x.height)),left:Math.max(0,x.x-n.x)};const A=g?.target==="inner"?Math.max(0,n.y+n.height-(x.y+x.height)):void 0;const P=d$r(e,t,x,r,i.hiddenSeriesIndices,g?.target,w,_,C,i.chartModel,A);let L=P?.plotDims??f;if(g?.target==="inner"){L=x;const N=P?.reservedLeft??0;let O=0;if(P&&"reservedRight"in P){O=P.reservedRight}const z=P?.reservedBottom??0;const U=Math.max(n.x,x.x-N);const W=x.y;f={x:U,y:W,width:Math.min(n.x+n.width-U,x.width+N+O),height:Math.min(n.y+n.height-W,x.height+z)}}if(t.type!==29&&t.type!==30&&t.type!==23&&t.type!==28){const N=OVt(t,L);if(N.reservedTop>0){L={x:L.x,y:L.y+N.reservedTop,width:L.width,height:Math.max(0,L.height-N.reservedTop)}}}const I=BVt(t,L,{maxHeightFrac:.32,minHeightPx:56});L=I.plotDims;return{chartArea:n,contentArea:a,title:s,titleRect:l,remainingSpace:u,defaultDiagramPadding:d,plotAreaIncludingAxes:f,plotAreaExcludingAxes:L,plotDims:L,legendRect:h,legendPosition:m,axesLayout:P,xAxisPlan:!YVt(t)&&P&&"xAxisPlan"in P?P.xAxisPlan:void 0,dataTableRect:I.tableRect,manualLayout:g}}function DZ(e,t,n,r,i){const o=t.dataTable;if(!o?.visible)return;if(n.width<=0||n.height<=0)return;const a=Nh(t);const s=[];t.series.forEach((A,P)=>{if(!A)return;if(i?.has(P))return;s.push({series:A,idx:P})});if(s.length===0||a.length===0)return;const l=o.showLegendKey;const u=1+s.length;const d=1+a.length;const f=n.width/u;const h=n.height/d;e.save();const m=o.fill;if(m){e.fillStyle=Uc(e,n,m,r,"transparent");e.fillRect(n.x,n.y,n.width,n.height)}const g=o.stroke;if(g){rd(e,g,r,{color:"#c0c0c0",widthPx:.75})}else{e.strokeStyle="#c0c0c0";e.lineWidth=.75;e.setLineDash([])}e.beginPath();e.rect(n.x,n.y,n.width,n.height);e.stroke();for(let A=1;A{const I=n.x+(1+L)*f+f/2;const N=n.y+h/2;const O=A.name?.trim()||`Series ${P+1}`;e.fillText(O,I,N);if(l){const z=Math.min(10,h-4);const U=I-f/2+4;const W=N-z/2;e.save();e.fillStyle=id(A,P,r)??"#666666";e.fillRect(U,W,z,z);e.restore()}});a.forEach((A,P)=>{const L=n.y+(1+P)*h+h/2;e.fillText(String(A??""),n.x+f/2,L);s.forEach(({series:I},N)=>{const O=I.values?.[P];const z=typeof O==="number"&&Number.isFinite(O)?qb(O,I.valuesFormatCode??void 0):"";const U=n.x+(1+N)*f+f/2;e.fillText(z,U,L)})});e.restore()}VT();var f$r=36;var g1e=24;var h$r=2;var eC=4;var c$e=.5;var KVt=`700 12px ${td}`;var u$e=14;var p$r=4;function d$e(e,t,n,r){if(t.leaves.length===0)return;const i=r.chart.series[0]?.valuesFormatCode??void 0;const o=T$r(t.parents,t.leaves);e.save();e.beginPath();e.rect(n.x,n.y,n.width,n.height);e.clip();const a=r.chart.treemapOptions?.parentLabelLayout;let s;if(a===3){s=_$r(e,o,t.leaves)}m$r(e,t.leaves,i,s?.byLeafKey);b$r(e,a,s);e.restore()}function m$r(e,t,n,r){for(const i of t){if(i.width<=0||i.height<=0)continue;g$r(e,i);const o=r?.get(QVt(i));const a=o?{verticalAlign:"bottom",reservedTop:o.reservedTop}:void 0;y$r(e,i,n,a)}}function g$r(e,t){e.save();e.beginPath();v$r(e,t.x,t.y,t.width,t.height,h$r);e.fillStyle=t.fill;e.fill();e.lineWidth=.5;e.strokeStyle="rgba(255,255,255,0.6)";e.stroke();e.restore()}function y$r(e,t,n,r){const i=t.width-eC*2;const o=Math.max(0,r?.reservedTop??0);const a=t.y+eC+o;const s=t.y+t.height-eC;const l=s-a;if(i=l){a.push(jVt(e,s,n))}e.restore();return a}function jVt(e,t,n){if(e.measureText(t).width<=n){return t}let r=t;while(r.length>1&&e.measureText(`${r}\u2026`).width>n){r=r.slice(0,-1)}return`${r}\u2026`}function b$r(e,t,n){if(!t||t===1){return}switch(t){case 3:x$r(e,n);break;case 2:break;default:break}}function x$r(e,t){if(!t||t.placements.length===0)return;e.save();e.textAlign="left";e.textBaseline="top";for(const n of t.placements){const{leaf:r,lines:i}=n;if(r.width<=0||r.height<=0||i.length===0)continue;const o=r.width-eC*2;if(o<=0)continue;const a=Kd(r.fill)??Kd("#000000");const s=JVt(a);e.save();e.beginPath();e.rect(r.x,r.y,r.width,r.height);e.clip();e.font=KVt;e.fillStyle=s;let l=r.y+eC;for(const u of i){e.fillText(u,r.x+eC,l,o);l+=u$e}e.restore()}e.restore()}function v$r(e,t,n,r,i,o){const a=Math.min(o,r/2,i/2);e.moveTo(t+a,n);e.lineTo(t+r-a,n);e.quadraticCurveTo(t+r,n,t+r,n+a);e.lineTo(t+r,n+i-a);e.quadraticCurveTo(t+r,n+i,t+r-a,n+i);e.lineTo(t+a,n+i);e.quadraticCurveTo(t,n+i,t,n+i-a);e.lineTo(t,n+a);e.quadraticCurveTo(t,n,t+a,n);e.closePath()}function JVt(e){if(!e)return"#1a1a1a";const t=e.rgb();const n=t.r/255;const r=t.g/255;const i=t.b/255;const o=.2126*n+.7152*r+.0722*i;return o>.55?"#1a1a1a":"#ffffff"}function _$r(e,t,n){const r=[];const i=new Map;for(const o of t){const a=n.filter(w=>e$t(w,o));if(a.length===0)continue;const s=E$r(a);if(!s)continue;const l=s.width-eC*2;const u=s.height-eC*2;if(l<=0||u<=g1e)continue;const d=Math.max(u$e,u-g1e);const f=ZVt(e,o.name,l,d,KVt);if(f.length===0)continue;const h=f.length*u$e;const m=h+p$r;if(u-mt.some(r=>w$r(r,n)))}function QVt(e){return e.path.join("\0")||e.name}function e$t(e,t){if(e.path.lengthtypeof m.value==="number"&&m.value>0?m.value:0).sort((m,g)=>(g.value??0)-(m.value??0));const l=SUe().size([2*Math.PI,i]);const u=l(s);const d=R$r(n,r);const f=u.descendants().filter(m=>m.depth>0&&(m.value??0)>0&&Number.isFinite(m.x0)&&Number.isFinite(m.x1)&&m.x1>m.x0).map(m=>{const g=m.data.path;const x=g[0];const w=d(x);return{name:m.data.name,path:g,value:m.value??0,depth:m.depth,startAngle:m.x0,endAngle:m.x1,innerRadius:Math.max(0,m.y0),outerRadius:Math.max(0,m.y1),fill:w}});const h=f.reduce((m,g)=>Math.max(m,g.depth),0);return{arcs:f,maxDepth:h,radius:i}}function S$r(e){const t=new Map;for(const n of e.series){const r=n.values??[];const i=A$r(n.categoryPaths,r.length);const o=xm(n,e.categories);for(let a=0;atypeof m==="string"&&m.length>0)??void 0;if(!u||u.length===0){const m=o?.[a];if(typeof m==="string"&&m.length>0){u=[m]}}if(!u||u.length===0)continue;const d=[...u].reverse();const f=d.join(C$r);const h=t.get(f);if(h){h.value+=s}else{t.set(f,{path:d,value:s})}}}return Array.from(t.values())}function A$r(e,t){if(!e||e.length===0){return new Array(t).fill(void 0)}if(e.length>=t)return e;const n=e.slice();while(n.length{let a=r.children.get(i);if(!a){a={name:i,path:[...r.path,i],children:new Map};r.children.set(i,a)}r=a;if(o===n.path.length-1){r.value=(r.value??0)+n.value}})}return t}function t$t(e){const t=Array.from(e.children.values()).map(t$t);if(t.length===0){return{name:e.name,path:e.path,value:e.value??0}}return{name:e.name,path:e.path,children:t}}function R$r(e,t){const n=new Set;for(const l of t){const u=l.path[0];if(u&&u.length>0){n.add(u)}}const r=Array.from(n.values());if(r.length===0){return()=>I0[0]??"#999999"}const i=["accent1","accent2","accent3","accent4","accent5","accent6"];const o=l=>{const u=i[l%i.length];const d=e.colorMap[u??""];if(d)return d;return I0[l%I0.length]??I0[0]??"#999999"};const a=r.map((l,u)=>o(u));const s=mg().domain(r).range(a);return l=>{if(!l){return I0[0]??"#999999"}if(n.has(l)){return s(l)}const u=s.domain().length;return o(u)}}$E();VT();function h$e(e,t,n,r){if(t.arcs.length===0||t.radius===0)return;const i=r.padAngle??.005;const o=t.radius;const a=n.x+n.width/2;const s=n.y+n.height/2;const l=Hb().startAngle(u=>u.startAngle).endAngle(u=>u.endAngle).padAngle(u=>Math.min((u.endAngle-u.startAngle)/2*.25,i)).padRadius(o*.5).innerRadius(u=>u.innerRadius).outerRadius(u=>Math.max(u.innerRadius,u.outerRadius-1)).context(e);e.save();e.translate(a,s);for(const u of t.arcs){e.beginPath();l(u);e.fillStyle=u.fill;e.fill()}D$r(e,t.arcs,l,r.valueFormatCode);e.restore()}var P$r=28;var I$r=14;var M$r=48;var L$r=24;var n$t=`600 11px ${td}`;var r$t=`500 10px ${td}`;var i$t=14;function D$r(e,t,n,r){for(const i of t){if(!i.name)continue;const o=i.endAngle-i.startAngle;if(!Number.isFinite(o)||o<=0)continue;const a=Math.max(0,i.outerRadius-i.innerRadius);if(al-6)continue;let d=i.value>0&&a>=L$r&&l>=M$r;let f="";if(d){f=qb(i.value,r);const _=o$t(e,r$t,f);if(_>l-6){d=false}}const[h,m]=n.centroid(i);const{primary:g,secondary:x}=F$r(i.fill);e.save();e.textAlign="center";e.textBaseline="middle";e.font=n$t;e.fillStyle=g;const w=d?m-i$t/2:m;e.fillText(i.name,h,w);if(d){e.font=r$t;e.fillStyle=x;const _=m+i$t/2;e.fillText(f,h,_)}e.restore()}}function o$t(e,t,n){e.save();e.font=t;const r=e.measureText(n).width;e.restore();return r}function F$r(e){const t=Kd(e);if(!t){return{primary:"#1a1a1a",secondary:"rgba(0,0,0,0.7)"}}const n=t.rgb();const r=n.r/255;const i=n.g/255;const o=n.b/255;const a=.2126*r+.7152*i+.0722*o;if(a>.55){return{primary:"#1a1a1a",secondary:"rgba(0,0,0,0.6)"}}return{primary:"#ffffff",secondary:"rgba(255,255,255,0.8)"}}var a$t=8;var N$r=.5;function s$t(e,t){return Math.abs(e-t)<=N$r}function p$e(e,t,n,r,i,o=r){const a=a$e(e,t,n,r,i);const{xAxis:s,yAxis:l,xStyles:u,yStyles:d,xAxisDeleted:f,yAxisDeleted:h,hideXTickLabels:m,xTicks:g,yTicks:x,yAxisPlan:w,showXTicks:_,showYTicks:C,drawXGrid:A,drawYGrid:P,xLabelBand:L,yLabelBand:I,xTitleMetrics:N,yTitleMetrics:O}=a;const z=r.y+r.height;const U=r.x;e.save();e.lineWidth=1;if(!f&&s?.line?.fill?.color){e.strokeStyle=u.lineColor??nd;e.beginPath();e.moveTo(r.x,z);e.lineTo(r.x+r.width,z);e.stroke()}if(!h&&l?.line?.fill?.color){e.strokeStyle=d.lineColor??nd;e.beginPath();e.moveTo(U,r.y);e.lineTo(U,r.y+r.height);e.stroke()}if(!f){e.font=Cc(u);e.textAlign="center";e.textBaseline="top";e.fillStyle=u.textColor;const W=u.gridLineColor??u.lineColor;g.forEach(H=>{const $=n.x(H);if(!Number.isFinite($))return;if(A&&!s$t($,U)){e.strokeStyle=W;e.beginPath();e.moveTo($,r.y);e.lineTo($,r.y+r.height);e.stroke()}if(_){e.strokeStyle=u.lineColor;e.beginPath();e.moveTo($,z);e.lineTo($,z+4);e.stroke()}if(!m){const K=o$e(H,s?.numberFormatCode);e.fillText(K,$,z+6)}})}if(!h){e.font=Cc(d);e.textAlign="right";e.textBaseline="middle";e.fillStyle=d.textColor;const W=d.gridLineColor??d.lineColor;x.forEach(H=>{const $=n.y(H);if(!Number.isFinite($))return;if(P&&!s$t($,z)){e.strokeStyle=W;e.beginPath();e.moveTo(r.x,$);e.lineTo(r.x+r.width,$);e.stroke()}if(C){e.strokeStyle=d.lineColor;e.beginPath();e.moveTo(U-4,$);e.lineTo(U,$);e.stroke()}if(!w?.hideTickLabels){const K=o$e(H,l?.numberFormatCode);e.fillText(K,U-6,$)}})}if(N){const W=L+a$t+N.height/2;const H=z+W;z3({ctx:e,axis:s,metrics:N,automaticCenter:{x:r.x+r.width/2,y:H},chartArea:o,themeMap:i,fallbackColor:u.textColor??nd})}if(O){const W=r.x-I-a$t-O.width/2;const H=r.y+r.height/2;z3({ctx:e,axis:l,metrics:O,automaticCenter:{x:W,y:H},chartArea:o,themeMap:i,fallbackColor:d.textColor??nd})}e.restore()}$E();function O$r(e){if(e===void 0)return true;return e===3||e===1||e===5}function B$r(e){if(e===void 0)return true;return e!==3}function z$r(e){return e===4||e===5}function U$r(e){const t=e.stroke?.widthEmu;if(t===void 0||t===null){return void 0}const n=Number(t)*ti;if(!Number.isFinite(n)){return void 0}return Math.max(0,n)}function l$t(e,t,n,r,i,o,a,s,l){const u=s??hU(t,a);const d=t.scatterOptions?.style;const f=B$r(d);const h=O$r(d);const m=z$r(d);const g=m?sO:I1;u.series.forEach(({series:x,seriesIndex:w,points:_})=>{if(_.length===0){return}const C=id(x,w,i);const A=C??e.strokeStyle;if(f){const z=U$r(x);if(z!==0){e.save();e.strokeStyle=A;e.lineWidth=z??2;const U=Wb().defined(W=>Number.isFinite(W.x)&&Number.isFinite(W.y)).x(W=>r.x(W.x)).y(W=>r.y(W.y)).curve(g).context(e);e.beginPath();U(_);e.stroke();e.restore()}}if(x.trendlines?.length){const z=l?.bySeriesIndex.get(w);sVt(e,t,x,w,_.map(U=>({x:U.x,y:U.y})),i,{x:r.x,y:r.y},n,z)}if(x.errorBars?.length){a1e(e,x,w,i,_.map(z=>{const U=r.x(z.x);const W=r.y(z.y);return{x:U,y:W,value:z.y}}).filter(z=>Number.isFinite(z.x)&&Number.isFinite(z.y)),{y:r.y})}if(!h){return}const P=x.marker?.symbol;const L=P===void 0||P===0||P!==1;if(!L){return}const I=x.marker?.size;const N=I!==void 0&&Number.isFinite(I)?I*96/72:6;const O=Math.max(N/2-1,2);_.forEach(z=>{const U=r.x(z.x);const W=r.y(z.y);if(!Number.isFinite(U)||!Number.isFinite(W))return;const H=Zd(x,z.idx)?void 0:Pd(x,z.idx,w,i);const $=Uh(x,z.idx,i);e.save();e.beginPath();e.arc(U,W,O,0,Math.PI*2);if(H){e.fillStyle=H;e.fill()}else{e.fillStyle=A;e.fill()}const K=$.color??A;const X=$.widthPx!==void 0?$.widthPx:Math.max(1,O/3);e.lineWidth=X;e.strokeStyle=K;e.stroke();e.restore();if(o){o.push({kind:"scatter-point",x:U-O,y:W-O,width:O*2,height:O*2,seriesName:x.name,category:String(z.x),value:z.y,color:H??C??A,anchorX:U,anchorY:W})}const j=wm(t,x,z.idx,z.y);if(j.show){WE(e,j.text,j.position,j.textStyle,i,{x:U,y:W},{callout:j.callout,fill:j.fill})}})})}var V$r=12700;var m$e=Bo(V$r);function y1e(e){if(!e){return false}if(e instanceof eo){return e.fill.isExplicitNone}return $$r(e.fill)}function b1e({line:e,themeLine:t}){const n=c$t(e);if(n!==void 0){return n}if(y1e(e)){return 0}const r=c$t(t);if(r!==void 0){return r}if(e!==void 0||t!==void 0&&!y1e(t)){return m$e}return 0}function c$t(e){if(!e){return void 0}if(e instanceof eo){return e.width}const t=e.widthEmu;if(t===void 0||t===null){return void 0}return Number.isFinite(t)?Bo(t):void 0}function u$t(e){if(!e){return true}return e.type===0}function $$r(e){if(!e){return false}if(Object.keys(e).length===0){return true}if(e.type!==0){return false}const t=(e.gradientStops?.length??0)>0;const n=!u$t(e.color);const r=e.pattern!==void 0&&(e.pattern.patternType!==0||!u$t(e.pattern.color));const i=e.imageReference!==void 0;const o=e.relId!==void 0;const a=e.gradientKind!==void 0||e.angleDeg!==void 0||e.pathType!==void 0;const s=e.fillRect!==void 0||e.stretchFillRect!==void 0||e.srcRect!==void 0;const l=e.pictureEffects!==void 0&&e.pictureEffects.length>0;return!t&&!n&&!r&&!i&&!o&&!a&&!s&&!l}function d$t(e,t,n,r,i,o,a){const s=n.r;const l=c1e(t.bubbleOptions?.scale);e.save();e.beginPath();e.rect(o.x,o.y,o.width,o.height);e.clip();r.series.forEach(({series:u,seriesIndex:d,points:f})=>{const h=id(u,d,i);const m=h??e.fillStyle;f.forEach(g=>{const x=n.x(g.x);const w=n.y(g.y);if(!Number.isFinite(x)||!Number.isFinite(w))return;const _=MZ(g.size,s,l);if(_===0){return}const C=Zd(u,g.idx);let A;let P;if(!C){A=Pd(u,g.idx,d,i);if(A===void 0){A=m}P=U3(e,{x:x-_,y:w-_,width:_*2,height:_*2},u,g.idx,d,i);if(P===void 0){P=m}}const L=Uh(u,g.idx,i);let I=L.color;if(I===void 0){I=m}let N=L.widthPx;if(N===void 0){N=m$e}let O=A;if(O===void 0){O=m}e.save();e.beginPath();e.arc(x,w,_,0,Math.PI*2);if(P!==void 0){e.fillStyle=P;e.fill()}if(L.visible!==false&&N>0){e.lineWidth=N;e.strokeStyle=I;e.stroke()}e.restore();if(a){a.push({kind:"bubble-point",x:x-_,y:w-_,width:_*2,height:_*2,seriesName:u.name,category:String(g.x),value:g.y,color:O,anchorX:x,anchorY:w})}})});e.restore()}function f$t(e,t,n,r,i,o){const a=r.seriesIndex;if(a<0)return;const s=t.series[a];if(!s)return;const{x:l,y:u}=n;const d=u(0);const f=1;r.bins.forEach((h,m)=>{if(!Number.isFinite(h.count)||h.count<=0)return;const g=l(h.x0);const x=l(h.x1);if(!Number.isFinite(g)||!Number.isFinite(x))return;const w=Math.min(g,x);const _=Math.max(g,x);const C=Math.max(0,_-w);if(C<=0)return;const A=u(h.count);if(!Number.isFinite(A)||!Number.isFinite(d))return;const P=Math.max(0,d-A);if(P<=0)return;const L=Zd(s,m);const I=Pd(s,m,a,i);const N=Uh(s,m,i);const O=N.color;const z=N.widthPx??1;if(O&&z>0){e.strokeStyle=O;e.lineWidth=z}else{e.lineWidth=0}const U=C>f;const W=U?w+f/2:w;const H=U?Math.max(0,C-f):C;e.beginPath();e.rect(W,A,H,P);const $=U3(e,{x:W,y:A,width:H,height:P},s,m,a,i);if(!L&&$){e.fillStyle=$;e.fill()}if(e.lineWidth>0&&O){e.stroke()}if(o){o.push({kind:"bar-vertical",x:W,y:A,width:H,height:P,seriesName:s.name??void 0,category:h.label??void 0,value:h.count,color:I??void 0,anchorX:W+H/2,anchorY:A,elementId:t.id??void 0,seriesIndex:a})}const K=wm(t,s,m,h.count);if(K.show){WE(e,K.text,K.position,K.textStyle,i,{x:W+H/2,y:A},{box:{x:W,y:A,width:H,height:P},isPositive:true,callout:K.callout,fill:K.fill})}})}var G$r="#c7c7c7";var H$r=1;var W$r={increase:"#5b9bd5",decrease:"#ed7d31",total:"#a5a5a5"};function h$t(e,t){const n=t==="increase"?"accent1":t==="decrease"?"accent2":"accent3";const r=e.colorMap?.[n];if(r&&r.length>0){return r}return W$r[t]}function Y$r(e,t){if(!e.points||e.points.length===0)return void 0;for(let n=0;n=t.start;const P=Math.max(0,Math.min(M3,r/2,h));const L=A||t.kind==="total";const I=L?P:0;const N=!L?P:0;e.beginPath();if(A){e.moveTo(n,f);e.lineTo(n,d+I);e.arcTo(n,d,n+I,d,I);e.lineTo(n+r-I,d);e.arcTo(n+r,d,n+r,d+I,I);e.lineTo(n+r,f);e.closePath()}else{e.moveTo(n,d);e.lineTo(n,f-N);e.arcTo(n,f,n+N,f,N);e.lineTo(n+r-N,f);e.arcTo(n+r,f,n+r,f-N,N);e.lineTo(n+r,d);e.closePath()}if(w){e.fillStyle=w;e.fill()}if(_){e.strokeStyle=_;e.lineWidth=C??1;e.stroke()}return{top:d,bottom:f}}function j$r(e,t,n,r,i,o){const a=t.series[n];if(!a)return;const s=wm(t,a,r.index,r.labelValue);if(!s.show||i.width<=0)return;const l=s.textStyle?.fontSize?zc(s.textStyle.fontSize):Bh;const u=s.textStyle?.fill?.color?oo(s.textStyle.fill.color,o):void 0;e.save();e.fillStyle=u??nd;const d=s.textStyle?.bold??true;e.font=`${d?"bold ":""}${l}px ${td}`;e.textAlign="center";e.textBaseline="middle";const f=r.end>=r.start;const h=i.x+i.width/2;const m=i.bottom-i.top;let g=f?i.top-12:i.bottom+12;switch(s.position){case 2:g=f?i.top+12:i.bottom-12;break;case 3:g=i.top+m/2;break;default:g=f?i.top-12:i.bottom+12;break}e.fillText(s.text,h,g);e.restore()}function p$t(e,t,n,r,i,o={}){if(!_k(n.x)||r.seriesIndex===-1)return;const a=n.x;const s=n.y;const l=a.bandwidth();const u=r.seriesIndex;const d=t.series[u];if(!d)return;let f;r.segments.forEach(h=>{const m=a(h.category);if(m===void 0)return;if(h.kind!=="total"&&f){q$r(e,f.x,m,h.cumulativeBefore,l,s)}const g=X$r(e,h,m,l,s,t,u,i);if(g){j$r(e,t,u,h,{...g,x:m,width:l},i);if(o.chartHoverTargets){o.chartHoverTargets.push({kind:"bar-vertical",x:m,y:g.top,width:l,height:g.bottom-g.top,category:h.category,seriesName:d.name,value:h.value,color:h$t(i,h.kind),anchorX:m,anchorY:g.top})}f={x:m,cumulativeAfter:h.cumulativeAfter}}})}var K$r=.5;var g$e=6;var m$t=8;function Z$r(e,t){return Math.abs(e-t)<=K$r}function g$t(e,t,n,r,i,o){const a=t.xAxis;const s=t.yAxis;const l=wl(a,o);const u=wl(s,o);const d=r.y+r.height;const f=r.x;e.save();e.lineWidth=1;const h=!!a?.deleted;const m=!!s?.deleted;let g=0;if(!h&&a?.line?.fill?.color){e.strokeStyle=l.lineColor??nd;e.beginPath();e.moveTo(r.x,d);e.lineTo(r.x+r.width,d);e.stroke()}if(!m&&s?.line?.fill?.color){e.strokeStyle=u.lineColor??nd;e.beginPath();e.moveTo(f,r.y);e.lineTo(f,r.y+r.height);e.stroke()}if(!m){const x=Math.max(2,Math.floor(r.height/60));const w=r_({ctx:e,axis:s,scale:n.y,preferredTickCount:x,themeMap:o});const _=w.ticks;const C=s?.majorTickMark!==void 0&&s.majorTickMark!==0&&s.majorTickMark!==1;const A=!!s?.majorGridlines?.fill?.color;const P=u.gridLineColor??u.lineColor;e.font=Cc(u);e.fillStyle=u.textColor;e.textAlign="right";e.textBaseline="middle";_.forEach(L=>{const I=n.y(L);if(!Number.isFinite(I))return;if(A&&!Z$r(I,d)){e.save();e.strokeStyle=P??nd;e.beginPath();e.moveTo(r.x,I);e.lineTo(r.x+r.width,I);e.stroke();e.restore()}if(C){e.strokeStyle=u.lineColor??nd;e.beginPath();e.moveTo(f-4,I);e.lineTo(f,I);e.stroke()}if(!w.hideTickLabels){const N=uh(L,s?.numberFormatCode);e.fillText(N,f-6,I)}});g=Math.max(g,Math.max(0,w.labelBandWidth-g$e))}if(!h){const x=i.bins.length;const w=4;const _=d+w+2;const C=x>0?l.fontSize+g$e:0;if(x>0){e.font=Cc(l);e.fillStyle=l.textColor;e.textAlign="center";e.textBaseline="top";i.bins.forEach(P=>{const L=n.x(P.x0);const I=n.x(P.x1);if(!Number.isFinite(L)||!Number.isFinite(I))return;const N=L+(I-L)/2;const O=P.label??"";if(a?.majorTickMark!==void 0&&a.majorTickMark!==0&&a.majorTickMark!==1){e.strokeStyle=l.lineColor??nd;e.beginPath();e.moveTo(N,d);e.lineTo(N,d+w);e.stroke()}e.fillText(O,N,_)})}const A=Tm(o,a?.title,a?.titleTextStyle,l.fontSize,0);if(A){const P=a?.titleTextStyle;const L=P?.fill?.color?oo(P.fill.color,o):l.textColor;e.save();e.fillStyle=L??l.textColor;e.font=A.font;e.textAlign="center";e.textBaseline="middle";e.translate(r.x+r.width/2,d+C+m$t+A.height/2);e.rotate(A.rotationRad);e.fillText(A.text,0,0);e.restore()}}if(!m){const x=g>0?g+g$e:0;const w=Tm(o,s?.title,s?.titleTextStyle,u.fontSize,-90);if(w){const _=s?.titleTextStyle;const C=_?.fill?.color?oo(_.fill.color,o):u.textColor;e.save();e.fillStyle=C??u.textColor;e.font=w.font;e.textAlign="center";e.textBaseline="middle";e.translate(r.x-x-m$t-w.width/2,r.y+r.height/2);e.rotate(w.rotationRad);e.fillText(w.text,0,0);e.restore()}}e.restore()}function y$t(e,t,n,r,i,o){if(n.seriesIndex===-1||n.segments.length===0){return}const a=t.series[n.seriesIndex];if(!a)return;e.save();e.lineJoin="round";e.lineCap="round";const s=[];n.segments.forEach(l=>{const u=l.y1-l.y0;if(u<=0)return;const d=Zd(a,l.index);const f=d?void 0:Pd(a,l.index,n.seriesIndex,r);const{color:h,widthPx:m}=Uh(a,l.index,r);e.beginPath();e.moveTo(l.topLeftX,l.y0);e.lineTo(l.topRightX,l.y0);e.lineTo(l.bottomRightX,l.y1);e.lineTo(l.bottomLeftX,l.y1);e.closePath();if(f){e.fillStyle=f;e.fill()}const g=h??(f?f:"#ffffff");const x=m??(h?1:0);if(x>0){e.strokeStyle=g;e.lineWidth=x;e.stroke()}s.push({text:l.category,centerY:l.y0+u/2});if(i){const w=Math.max(l.topRightX-l.topLeftX,l.bottomRightX-l.bottomLeftX);const _=Math.min(l.topLeftX,l.bottomLeftX);const C=l.centerX;const A=l.y0+u/2;i.push({kind:"bar-vertical",x:_,y:l.y0,width:w,height:u,category:l.category,seriesName:a.name,value:l.value,color:f??h,anchorX:C,anchorY:A,seriesIndex:n.seriesIndex})}});if(o&&s.length>0){e.save();e.font=o.font;e.fillStyle=o.textColor;e.textAlign="right";e.textBaseline="middle";s.forEach(l=>{e.fillText(l.text,o.labelX,l.centerY)});e.restore()}e.restore()}zh();function J$r(e,t,n){return Math.min(Math.max(e,t),n)}function y$e(e,t,n){const r=n??new Set;const i=e.series.findIndex((I,N)=>!r.has(N));if(i===-1){return{seriesIndex:-1,segments:[]}}const o=e.series[i];const a=Nh(e,i);const s=o?.values??[];const l=Math.max(a.length,s.length);if(l===0){return{seriesIndex:i,segments:[]}}const u=[];for(let I=0;I1?(l-1)*h:0);const g=Math.max(0,t.height);const x=m>0?g/m:0;const w=x*h;const _=t.x+t.width/2;let C=t.y;const A=[];for(let I=0;I0&&A.length>0){const I=L/2;A.forEach(N=>{N.y0+=I;N.y1+=I})}return{seriesIndex:i,segments:A}}zh();function Q$r(e){if(typeof e!=="number")return void 0;if(!Number.isFinite(e))return void 0;return e}function eGr(e){if(e.boxWhiskerOptions?.quartileMethod){return e.boxWhiskerOptions.quartileMethod}return 2}function tGr(e,t){const n=e.length;if(n===0)return NaN;if(n===1)return e[0]??NaN;const r=(n+1)*t;const i=Math.floor(r);const o=r-i;if(i<=0)return e[0];if(i>=n)return e[n-1];const a=e[i-1];const s=e[i];return a+o*(s-a)}function b$e(e,t,n){if(e.length===0)return NaN;if(n===1){return v9e(e,t)??NaN}return tGr(e,t)}function nGr(e,t,n,r){const i=e?.[n];if(i&&i.length>0)return i;const o=t[n];if(o&&o.length>0)return o;return r}function b$t(e,t={}){if(e.type!==26){throw new Error("prepareBoxWhiskerData called for non box-whisker chart")}const n=t.hiddenSeriesIndices;const r=eGr(e);const i=Nh(e);const o=[];const a=new Set;const s=e.series.map((f,h)=>({series:f,seriesIndex:h})).filter(({seriesIndex:f})=>!n?.has(f)).map(({series:f,seriesIndex:h})=>{const m=new Map;const g=f.values?.length??0;const x=f.name&&f.name.length>0?f.name:`Series ${h+1}`;const w=xm(f,e.categories);for(let _=0;_0){i.forEach(f=>{if(!a.has(f)){a.add(f);o.push(f)}})}const l=[];let u=Number.POSITIVE_INFINITY;let d=Number.NEGATIVE_INFINITY;o.forEach(f=>{const h=[];s.forEach(({seriesIndex:m,valuesByCategory:g})=>{const x=g.get(f);if(!x||x.length===0)return;const w=x.slice().sort(($,K)=>$-K);if(w.length===0)return;const _=b$e(w,.25,r);const C=b$e(w,.5,r);const A=b$e(w,.75,r);const P=A-_;const L=_-1.5*P;const I=A+1.5*P;const N=[];const O=[];w.forEach($=>{if($I){N.push($)}else{O.push($)}});const z=O.length>0?O[0]:w[0];const U=O.length>0?O[O.length-1]:w[w.length-1];const W=l0e(w)??void 0;const H={seriesIndex:m,categoryKey:f,valuesSorted:w,q1:_,median:C,q3:A,whiskerLow:z,whiskerHigh:U,min:w[0],max:w[w.length-1],iqr:P,outliers:N,nonOutliers:O,mean:W};u=Math.min(u,H.min,H.whiskerLow,...H.outliers);d=Math.max(d,H.max,H.whiskerHigh,...H.outliers);h.push(H)});l.push({key:f,series:h})});if(!Number.isFinite(u)){u=0}if(!Number.isFinite(d)){d=1}if(u===d){u-=1;d+=1}return{categories:o,seriesOrder:s.map(f=>f.seriesIndex),byCategory:l,extents:{min:u,max:d}}}R1();function x$t(e,t){const n=Gb().domain(e.categories).range([t.x,t.x+t.width]).paddingInner(.3).paddingOuter(.2);const r=Math.max(0,n.bandwidth());const i=Gb().domain(e.seriesOrder).range([0,r]).paddingInner(.2).paddingOuter(.1);const o=wc().domain([e.extents.min,e.extents.max]).nice().range([t.y+t.height,t.y]);return{x:n,xSeries:i,y:o}}var rGr=2;var iGr=.6;var oGr=3;var aGr=2;var sGr=3;function x$e(e,t,n,r,i,o,a){if(!Number.isFinite(t)||!Number.isFinite(n))return;e.beginPath();e.arc(t,n,r,0,Math.PI*2);if(i){e.fillStyle=i;e.fill()}if(o&&a>0){e.strokeStyle=o;e.lineWidth=a;e.stroke()}}function lGr(e,t,n,r){const i=e.series[t.seriesIndex];if(!i){return{strokeWidth:1,noFill:false}}const o=Zd(i,n);const a=Pd(i,n,t.seriesIndex,r)??id(i,t.seriesIndex,r);const s=Uh(i,n,r);const l=s.color??(a?a:id(i,t.seriesIndex,r));const u=s.widthPx??1;return{fillColor:o?void 0:a,strokeColor:l??void 0,strokeWidth:u>0?u:1,noFill:o}}function v$t(e,t,n,r,i,o={}){const{chartHoverTargets:a}=o;const s=t.boxWhiskerOptions?.showMeanMarker??false;const l=t.boxWhiskerOptions?.showMeanLine??false;const u=t.boxWhiskerOptions?.showOutliers??true;const d=t.boxWhiskerOptions?.showNonOutliers??false;const f=new Map;const h=new Map;r.categories.forEach((m,g)=>{const x=n.x(m);if(x===void 0)return;h.set(m,g)});r.byCategory.forEach(m=>{const g=n.x(m.key);if(g===void 0)return;const x=h.get(m.key)??0;const w=n.x.bandwidth();const _=n.xSeries.bandwidth();m.series.forEach(C=>{const A=t.series[C.seriesIndex];if(!A)return;const P=n.xSeries(C.seriesIndex);const L=_>0?_:Math.max(w*.5,Math.min(w,12));const I=P!==void 0?P:Math.max(0,(w-L)/2);const N=g+I;const O=N+L;const z=N+L/2;const U=n.y(C.q1);const W=n.y(C.q3);const H=n.y(C.median);const $=n.y(C.whiskerLow);const K=n.y(C.whiskerHigh);if(!Number.isFinite(U)||!Number.isFinite(W)||!Number.isFinite(H)||!Number.isFinite($)||!Number.isFinite(K)){return}const X=Math.min(U,W);const j=Math.max(Math.abs(W-U),1);const te=Math.min(L*iGr,L);const J=te/2;const oe=lGr(t,C,x,i);e.beginPath();e.rect(N,X,L,j);if(oe.fillColor){e.fillStyle=oe.fillColor;e.fill()}if(oe.strokeColor){e.strokeStyle=oe.strokeColor;e.lineWidth=oe.strokeWidth;e.stroke()}if(oe.strokeColor){e.beginPath();e.strokeStyle=oe.strokeColor;e.lineWidth=Math.max(rGr,oe.strokeWidth);e.moveTo(N,H);e.lineTo(O,H);e.stroke()}if(oe.strokeColor){e.beginPath();e.strokeStyle=oe.strokeColor;e.lineWidth=oe.strokeWidth;e.moveTo(z,W);e.lineTo(z,K);e.moveTo(z-J,K);e.lineTo(z+J,K);e.moveTo(z,U);e.lineTo(z,$);e.moveTo(z-J,$);e.lineTo(z+J,$);e.stroke()}if(u){C.outliers.forEach(se=>{const re=n.y(se);if(!Number.isFinite(re))return;x$e(e,z,re,oGr,oe.strokeColor??oe.fillColor,oe.strokeColor,oe.strokeWidth);if(a){a.push({kind:"scatter-point",anchorX:z,anchorY:re,seriesName:A.name??void 0,category:m.key,value:se,color:oe.fillColor??oe.strokeColor??void 0,elementId:t.id??void 0,seriesIndex:C.seriesIndex})}})}if(d){C.nonOutliers.forEach(se=>{const re=n.y(se);if(!Number.isFinite(re))return;x$e(e,z,re,aGr,oe.fillColor??oe.strokeColor,oe.strokeColor,Math.max(1,oe.strokeWidth/2))})}if(s&&C.mean!==void 0){const se=n.y(C.mean);if(Number.isFinite(se)){x$e(e,z,se,sGr,oe.strokeColor??oe.fillColor,oe.strokeColor,oe.strokeWidth);if(a){a.push({kind:"scatter-point",anchorX:z,anchorY:se,seriesName:A.name??void 0,category:m.key,value:C.mean,color:oe.fillColor??oe.strokeColor??void 0,elementId:t.id??void 0,seriesIndex:C.seriesIndex})}if(!f.has(C.seriesIndex)){f.set(C.seriesIndex,[])}f.get(C.seriesIndex).push({x:z,y:se,categoryIndex:x,color:oe.strokeColor??oe.fillColor})}}if(a){a.push({kind:"bar-vertical",x:N,y:X,width:L,height:j,seriesName:A.name??void 0,category:m.key,value:C.median,color:oe.fillColor??oe.strokeColor??void 0,anchorX:z,anchorY:H,elementId:t.id??void 0,seriesIndex:C.seriesIndex})}})});if(l){f.forEach((m,g)=>{const x=m.filter(A=>Number.isFinite(A.x)&&Number.isFinite(A.y)).sort((A,P)=>A.categoryIndex-P.categoryIndex);if(x.length<2)return;const w=t.series[g];const _=w?id(w,g,i):void 0;const C=x[0]?.color??_??"#444444";e.beginPath();e.strokeStyle=C;e.lineWidth=1.5;e.lineJoin="round";x.forEach((A,P)=>{if(P===0)e.moveTo(A.x,A.y);else e.lineTo(A.x,A.y)});e.stroke()})}}var cGr=.05;var uGr=16;function x1e(e){return Math.min(uGr,Math.max(0,Math.min(e.width,e.height)*cGr))}function v1e(e,t,n){const r=Math.min(n,t.width/2,t.height/2);const i=t.x+t.width;const o=t.y+t.height;e.beginPath();e.moveTo(t.x+r,t.y);e.lineTo(i-r,t.y);e.quadraticCurveTo(i,t.y,i,t.y+r);e.lineTo(i,o-r);e.quadraticCurveTo(i,o,i-r,o);e.lineTo(t.x+r,o);e.quadraticCurveTo(t.x,o,t.x,o-r);e.lineTo(t.x,t.y+r);e.quadraticCurveTo(t.x,t.y,t.x+r,t.y);e.closePath()}function _$t(e,t,n,r,i=false){const o=Uc(e,t,n,r,"transparent");e.fillStyle=o;if(i){v1e(e,t,x1e(t));e.fill()}else{e.fillRect(t.x,t.y,t.width,t.height)}}function T$t(e,t,n,r,i=false){if(!n)return;if(!n.fill?.color)return;rd(e,n,r,{widthPx:.5});if(i){v1e(e,t,x1e(t));e.stroke()}else{e.strokeRect(t.x,t.y,t.width,t.height)}}function w$t(e,t,n,r,i={}){const o=t.chartFill??t.chartSpaceFill;const a=t.chartLine??t.chartSpaceLine;const s=t.roundedCorners===true;if(o){_$t(e,n,o,r,s)}else if(i.excelDefaults){e.fillStyle="#ffffff";if(s){v1e(e,n,x1e(n));e.fill()}else{e.fillRect(n.x,n.y,n.width,n.height)}}const l=a?.fill;const u=l!==void 0&&l.type===0&&l.color===void 0;if(a?.fill?.color){T$t(e,n,a,r,s)}else if(u){}else if(i.excelDefaults){e.save();e.strokeStyle="#d0d0d0";e.lineWidth=.5;e.setLineDash([]);if(s){v1e(e,n,x1e(n));e.stroke()}else{e.strokeRect(n.x,n.y,n.width,n.height)}e.restore()}}function UO(e,t,n,r){if(t.plotAreaFill){_$t(e,n,t.plotAreaFill,r)}if(t.plotAreaLine?.fill?.color){T$t(e,n,t.plotAreaLine,r)}}var aoa=M3;var dGr=2;var fGr=0;var hGr={[1]:"linear",[3]:"logarithmic",[4]:"polynomial",[6]:"movingAverage"};function pGr(e,t){if(e.xAxis?.deleted)return false;const[n=0,r=0]=t.y.domain();const i=Math.min(n,r);const o=Math.max(n,r);const a=y9(e.xAxis,t.y);const s=Math.max(1,o-i)*1e-9;return Number.isFinite(a)&&a>i+s&&a0?e.id:`${Math.round(g.x)}:${Math.round(g.y)}:${Math.round(g.width)}:${Math.round(g.height)}`;C$t(t,_,g,{themeMap:A,chartHoverTargets:o,hiddenSeriesIndices:a,elementId:P,elementZIndex:e.zIndex??0,mapCtx:s??void 0,threeCtx:l??void 0,on3DViewport:u,onMapViewport:d,textLayoutCollector:f,titleBlockId:_?.id?`chartTitle:${_.id}`:void 0,chartModel:w,trendlineRenderCache:C})}function iM(e,t,n,r={}){const i=r.themeMap??{colorMap:{},effectMap:{},lineStyleMap:{}};const o=new Tp(t);C$t(e,t,n,{...r,themeMap:i,mapCtx:r.mapCtx??void 0,threeCtx:r.threeCtx??void 0,chartModel:o})}function C$t(e,t,n,r){e.save();const i=t.type===29;const o=t.type===30;const a=t.type===17;const s=t.type===3;const l=t.type===23;const u=t.type===28;const d=t.type===26;const f=t.type===24;const h=t.type===18||t.type===5;const m=t.barOptions?.direction??t.barDirection;const g=(t.type===4||t.type===3)&&m===2;w$t(e,t,n,r.themeMap,{excelDefaults:r.excelDefaults});const x=r.hiddenSeriesIndices!==void 0?new Set(r.hiddenSeriesIndices):void 0;const w=XVt(e,t,n,r.themeMap,{chartModel:r.chartModel,skipLegend:r.skipLegend,hiddenSeriesIndices:x,topExtraPaddingPx:fGr});const _=w.title;const C=w.plotDims;const A=w.legendRect;const P=w.legendPosition??1;const L=!h?w.axesLayout?.xAxisPlan:void 0;const I=w.dataTableRect;let N=false;const O=t.titlePlacement;const z=_.element;if(_.text&&z&&O!=="none"){let $=z.textStyle?.anchor;let K=w.titleRect;if(O==="centeredOverlay"){$=2;if(fO(t.type)){K=mGr(t,C,_.layoutHeight)}else{K={x:C.x,y:C.y+dGr,width:C.width,height:Math.max(0,_.layoutHeight+4)}}}if(K){const X={...z.textStyle,anchor:$};let j;if(O==="centeredOverlay"){j={left:0,right:0,top:0,bottom:0}}const te=ed(z,e,r.themeMap,void 0,{bboxPx:K,resolvedStyle:X,paddingPx:j});if(te&&r.textLayoutCollector){let J=r.titleBlockId;if(J===void 0){let oe=r.elementId??"chart";if(t.id){oe=t.id}J=`chartTitle:${oe}`}r.textLayoutCollector.add({id:J,layout:te,rotationDeg:0,zIndex:r.elementZIndex??0,hitBox:K,getRunText:(oe,se)=>z.paragraphs[oe]?.runs[se]?.text??""})}}}if(g){const $=w.axesLayout;if($!==void 0&&!("categoryLabelMaxWidth"in $)){throw new Error("Horizontal bar charts require a horizontal axis layout")}UO(e,t,C,r.themeMap);const K=t9t(t,C,x,r.chartModel,{ctx:e,themeMap:r.themeMap});a9t(e,t,K,C,true,r.themeMap,$);if(A)Tk(e,t,A,r.themeMap,P,{elementId:r.elementId,chartHoverTargets:r.chartHoverTargets,hiddenSeriesIndices:r.hiddenSeriesIndices});s9t(e,t,K,r.themeMap,r.chartHoverTargets,x);if(I){DZ(e,t,I,r.themeMap,x);N=true}e.restore();return}const U=t.type===31?IZ(t,C,x):void 0;const W=U?.find(({renderGroup:$})=>$.isPrimaryValueAxis)?.groupScales;const H=!i&&!o&&!a&&!l&&!u&&!d?W??O3(t,C,x,r.chartModel):void 0;if(H&&!fO(t.type)&&t.series.some($=>($?.trendlines?.length??0)>0)){let $=Number.POSITIVE_INFINITY;let K=Number.NEGATIVE_INFINITY;t.series.forEach(X=>{if(!X?.trendlines?.length)return;const j=X.values??[];const te=[];for(let J=0;J{const oe=J.type?hGr[J.type]??"linear":"linear";const se=sk({type:oe,points:te,polynomialOrder:J.order,movingAveragePeriod:J.period,forecastForward:J.forward,forecastBackward:J.backward,intercept:J.intercept,displayEquation:false,displayRSquared:false});if(!se?.points?.length)return;se.points.forEach(re=>{if(!Number.isFinite(re.y))return;$=Math.min($,re.y);K=Math.max(K,re.y)})})});if(Number.isFinite($)&&Number.isFinite(K)&&$!==K){const X=H.y.domain();const j=X[0]??0;const te=X[1]??0;const J=Math.min(j,$);const oe=Math.max(te,K);if(J!==j||oe!==te){H.y.domain([J,oe]).nice()}}}if(!i&&!o&&a){UO(e,t,C,r.themeMap);if(A)Tk(e,t,A,r.themeMap,P,{elementId:r.elementId,chartHoverTargets:r.chartHoverTargets,hiddenSeriesIndices:r.hiddenSeriesIndices});xVt(e,t,C,r.themeMap,r.chartHoverTargets,r.hiddenSeriesIndices?new Set(r.hiddenSeriesIndices):void 0);if(I){DZ(e,t,I,r.themeMap,x);N=true}}else if(!i&&!o&&!l&&!u){if(d){const $=b$t(t,{hiddenSeriesIndices:x});const K=x$t($,C);UO(e,t,C,r.themeMap);W0e(e,t,K,C,r.themeMap,L,"all",n);if(A)Tk(e,t,A,r.themeMap,P,{elementId:r.elementId,chartHoverTargets:r.chartHoverTargets,hiddenSeriesIndices:r.hiddenSeriesIndices});v$t(e,t,K,$,r.themeMap,{chartHoverTargets:r.chartHoverTargets});if(I){DZ(e,t,I,r.themeMap,x);N=true}}else if(H){UO(e,t,C,r.themeMap);const $=!fO(t.type)&&!h&&!s&&!f;const K=$&&pGr(t,H);if($){W0e(e,t,H,C,r.themeMap,L,K?"background":"all",n)}if(A)Tk(e,t,A,r.themeMap,P,{elementId:r.elementId,chartHoverTargets:r.chartHoverTargets,hiddenSeriesIndices:r.hiddenSeriesIndices});switch(t.type){case 4:{lbe(e,t,H,r.themeMap,r.chartHoverTargets,x);const X=Nh(t);t.series.forEach((j,te)=>{if(!j?.trendlines?.length)return;const J=r.trendlineRenderCache?.bySeriesIndex.get(te);o1e(e,t,j,te,X,j.values??[],r.themeMap,{y:H.y,xCenter:oe=>Yb(H.x,oe)},C,J)});break}case 31:gVt(e,t,C,n,r.themeMap,r.chartHoverTargets,x,r.trendlineRenderCache,U);break;case 27:{const X=T0e(t,x);p$t(e,t,H,X,r.themeMap,{chartHoverTargets:r.chartHoverTargets});break}case 3:{if(!r.threeCtx){if(r.on3DViewport){const te=n.width-Math.max(0,C.x-n.x);const J=n.height-Math.max(0,C.y-n.y);const oe={x:C.x,y:C.y,width:Math.max(0,Math.min(C.width,te)),height:Math.max(0,Math.min(C.height,J))};r.on3DViewport({elementId:r.elementId??"",plotDims:oe})}e.restore();return}const X={x:0,y:0,width:C.width,height:C.height};const j=O3(t,X,x,r.chartModel);tVt(r.threeCtx,t,j,X,r.themeMap,x);break}case 13:case 12:s1e(e,t,C,H,r.themeMap,r.chartHoverTargets,x,r.trendlineRenderCache);break;case 2:case 1:l1e(e,t,H,r.themeMap,C,r.chartHoverTargets,x);break;case 24:{const X=h1e(t,x?{hiddenSeriesIndices:x}:void 0);const j={series:[],extents:X.extents};const te=zO(t,C,j,{niceXDomain:false});g$t(e,t,te,C,X,r.themeMap);f$t(e,t,te,X,r.themeMap,r.chartHoverTargets);break}case 15:{if(!r.threeCtx){if(r.on3DViewport){const j=n.width-Math.max(0,C.x-n.x);const te=n.height-Math.max(0,C.y-n.y);const J={x:C.x,y:C.y,width:Math.max(0,Math.min(C.width,j)),height:Math.max(0,Math.min(C.height,te))};r.on3DViewport({elementId:r.elementId??"",plotDims:J});e.restore();return}IUe(e,t,C,r.themeMap,r.chartHoverTargets,x);break}const X={x:0,y:0,width:C.width,height:C.height};rVt(r.threeCtx,t,X,r.themeMap,x);break}case 16:case 8:IUe(e,t,C,r.themeMap,r.chartHoverTargets,x);break;case 18:{const X=r.hiddenSeriesIndices!==void 0?new Set(r.hiddenSeriesIndices):void 0;const j=hU(t,X);const te=zO(t,C,j);p$e(e,t,te,C,r.themeMap,n);l$t(e,t,C,te,r.themeMap,r.chartHoverTargets,X,j,r.trendlineRenderCache);break}case 5:{const X=r.hiddenSeriesIndices!==void 0?new Set(r.hiddenSeriesIndices):void 0;const j=f1e(t,X);const te=zO(t,C,j);p$e(e,t,te,C,r.themeMap,n);d$t(e,t,te,j,r.themeMap,C,r.chartHoverTargets);break}default:break}if(K){W0e(e,t,H,C,r.themeMap,L,"foreground",n)}}}else if(u){if(A)Tk(e,t,A,r.themeMap,P,{elementId:r.elementId,chartHoverTargets:r.chartHoverTargets,hiddenSeriesIndices:r.hiddenSeriesIndices});const $=y$e(t,C,x);const K=yGr(e,t,$,C,r.themeMap);const X=K!==null?y$e(t,K.plotDims,x):$;y$t(e,t,X,r.themeMap,r.chartHoverTargets,K?.labels)}else if(l){if(A)Tk(e,t,A,r.themeMap,P,{elementId:r.elementId,chartHoverTargets:r.chartHoverTargets,hiddenSeriesIndices:r.hiddenSeriesIndices});const $=n.width-Math.max(0,C.x-n.x);const K=n.height-Math.max(0,C.y-n.y);const X={x:C.x,y:C.y,width:Math.max(0,Math.min(C.width,$)),height:Math.max(0,Math.min(C.height,K))};if(r.onMapViewport){r.onMapViewport({elementId:r.elementId??"",plotDims:X})}if(!r.mapCtx){e.restore();return}rzt(r.mapCtx,t,C,r.themeMap,{elementId:r.elementId,hiddenSeriesIndices:x})}else if(i){UO(e,t,C,r.themeMap);const $=kUe(t,C,r.themeMap);d$e(e,$,C,{chart:t,themeMap:r.themeMap});if(A)Tk(e,t,A,r.themeMap,P,{elementId:r.elementId,chartHoverTargets:r.chartHoverTargets,hiddenSeriesIndices:r.hiddenSeriesIndices})}else if(o){UO(e,t,C,r.themeMap);const $=f$e(t,C,r.themeMap);h$e(e,$,C,{themeMap:r.themeMap,valueFormatCode:t.series[0]?.valuesFormatCode??void 0});if(A)Tk(e,t,A,r.themeMap,P,{elementId:r.elementId,chartHoverTargets:r.chartHoverTargets,hiddenSeriesIndices:r.hiddenSeriesIndices})}if(I&&!N){DZ(e,t,I,r.themeMap,x)}e.restore()}var v$e=8;var gGr=.35;function yGr(e,t,n,r,i){if(n.segments.length===0){return null}if(r.width<=0){return null}const o=wl(t.yAxis,i);const a=`${o.fontSize}px ${td}`;e.save();e.font=a;let s=0;for(const d of n.segments){const f=e.measureText(d.category).width;if(f>s){s=f}}e.restore();if(!Number.isFinite(s)||s<=0){return null}const l=Math.min(r.width*gGr,s+v$e);if(l<=v$e||l>=r.width){return null}const u={x:r.x+l,y:r.y,width:Math.max(0,r.width-l),height:r.height};return{plotDims:u,labels:{labelX:r.x+l-v$e,font:a,textColor:o.textColor}}}var lw=Math.PI*2;var xGr=180/Math.PI;var S$t=Math.PI/180;var A$t=1e-6;function _$e(e){if(!Number.isFinite(e))return e;let t=e%lw;if(t<0)t+=lw;return t}function k$t(e,t,n){if(!Number.isFinite(e)||t===0||n===0)return _$e(e);const r=e*xGr%360;const i=r<0?r+360:r;if(i===0||i===90||i===180||i===270){return i*S$t}const o=i*S$t;const a=n*Math.cos(o);const s=t*Math.sin(o);if(Math.abs(a)<1e-12&&Math.abs(s)<1e-12)return o;let l=Math.atan2(s,a);if(l<0)l+=lw;return l}function R$t(e,t,n,r=true,i=true,o=false,a=true){if(a)e.beginPath();let s=0;let l=0;let u=0;let d=0;const f=o?{}:void 0;const h=/^-?\d+(?:\.\d+)?$/;const m=t.w&&h.test(t.w)?Number(t.w):void 0;const g=t.h&&h.test(t.h)?Number(t.h):void 0;const x=m?n.w/m:void 0;const w=g?n.h/g:void 0;const _=typeof x==="number"&&Number.isFinite(x);const C=typeof w==="number"&&Number.isFinite(w);const A=(U,W)=>{if(!U)return Number.NaN;const H=h.test(U)&&(W==="x"&&_||W==="y"&&C);if(H){const $=W==="x"?x??1:w??1;return Number(U)*$}return R0(U,n)};const P=(U,W)=>{if(!U)return R0(U,n);if(h.test(U)&&(W==="x"&&_||W==="y"&&C)){const H=W==="x"?x??1:w??1;return Number(U)*H}return R0(U,n)};const L=(U,W,H,$)=>{if(!f||f.start)return;if(!Number.isFinite(U)||!Number.isFinite(W))return;if(!Number.isFinite(H)||!Number.isFinite($))return;if(Math.hypot(H,$){if(!f)return;if(!Number.isFinite(U)||!Number.isFinite(W))return;if(!Number.isFinite(H)||!Number.isFinite($))return;if(Math.hypot(H,$){s=A(U,"x");l=A(W,"y");u=s;d=l;e.moveTo(s,l)};for(const U of t.commands){switch(U.cmd){case"moveTo":{N(U.x,U.y);break}case"lineTo":{const W=A(U.x,"x");const H=A(U.y,"y");const $=s;const K=l;s=W;l=H;const X=W-$;const j=H-K;L($,K,X,j);I(W,H,X,j);e.lineTo(W,H);break}case"quadBezTo":{const W=A(U.x1,"x");const H=A(U.y1,"y");const $=A(U.x,"x");const K=A(U.y,"y");const X=s;const j=l;s=$;l=K;L(X,j,W-X,H-j);I($,K,$-W,K-H);e.quadraticCurveTo(W,H,$,K);break}case"cubicBezTo":{const W=A(U.x1,"x");const H=A(U.y1,"y");const $=A(U.x2,"x");const K=A(U.y2,"y");const X=A(U.x,"x");const j=A(U.y,"y");const te=s;const J=l;s=X;l=j;L(te,J,W-te,H-J);I(X,j,X-$,j-K);e.bezierCurveTo(W,H,$,K,X,j);break}case"arcTo":{const W=P(U.wR,"x");const H=P(U.hR,"y");const $=Math.abs(W);const K=Math.abs(H);const X=O(R0(U.stAng,n));let j=O(R0(U.swAng,n));if(j>lw)j=lw;if(j<-lw)j=-lw;const te=X+j;const J=k$t(X,$,K);let oe=k$t(te,$,K);const se=j<0;let re=oe-J;if(j<0&&re>=0){oe-=lw;re=oe-J}else if(j>0&&re<=0){oe+=lw;re=oe-J}if(Math.abs(j)>1e-9&&Math.abs(re)<1e-9){oe=J+(j<0?-lw:lw);re=oe-J}const ce=s-W*Math.cos(J);const ue=l-H*Math.sin(J);const xe=se?-1:1;const be=_$e(J);const Ie=_$e(oe);e.ellipse(ce,ue,$,K,0,be,Ie,se);L(s,l,xe*-W*Math.sin(J),xe*H*Math.cos(J));s=ce+W*Math.cos(oe);l=ue+H*Math.sin(oe);I(s,l,xe*-W*Math.sin(oe),xe*H*Math.cos(oe));break}case"close":{e.closePath();const W=s;const H=l;s=u;l=d;const $=s-W;const K=l-H;L(W,H,$,K);I(s,l,$,K);break}}}function O(U){return U/6e4*Math.PI/180}const z=e.globalCompositeOperation;if(t.fill==="darken")e.globalCompositeOperation="darken";if(t.fill&&t.fill!=="none"&&r)e.fill();if((t.stroke??true)&&i)e.stroke();e.globalCompositeOperation=z;return f}function T$e(e,t,{w:n,h:r,x:i=0,y:o=0,adjustments:a={},fill:s=true,stroke:l=true,collectMetrics:u=false}){e.save();e.translate(i,o);const d=ak(t,n,r,a);const f=[];for(const h of t.paths){const m=R$t(e,h,d,s,l,u);if(u&&m)f.push(m)}e.restore();return u?f:void 0}function P$t(e,t,{w:n,h:r,x:i=0,y:o=0,adjustments:a={}}){e.beginPath();e.save();e.translate(i,o);const s=ak(t,n,r,a);for(const l of t.paths){R$t(e,l,s,false,false,false,false)}e.restore()}function I$t(e,t,n={}){let r=0;let i=0;const o=n.scaleX??1;const a=n.scaleY??1;const s=u=>u*ti*o;const l=u=>u*ti*a;e.beginPath();for(const u of t){if(u.moveTo){r=Number(u.moveTo.x??r)||0;i=Number(u.moveTo.y??i)||0;e.moveTo(s(r),l(i))}else if(u.lineTo){if(u.lineTo.x!==void 0)r=Number(u.lineTo.x);if(u.lineTo.y!==void 0)i=Number(u.lineTo.y);e.lineTo(s(r),l(i))}else if(u.quadBezTo){const d=Number(u.quadBezTo.x1??r);const f=Number(u.quadBezTo.y1??i);r=Number(u.quadBezTo.x??r);i=Number(u.quadBezTo.y??i);e.quadraticCurveTo(s(d),l(f),s(r),l(i))}else if(u.cubicBezTo){const d=Number(u.cubicBezTo.x1??r);const f=Number(u.cubicBezTo.y1??i);const h=Number(u.cubicBezTo.x2??r);const m=Number(u.cubicBezTo.y2??i);r=Number(u.cubicBezTo.x??r);i=Number(u.cubicBezTo.y??i);e.bezierCurveTo(s(d),l(f),s(h),l(m),s(r),l(i))}else if(u.close!==void 0){e.closePath()}}}var _1e=(e,t,n,r,i,o,a,s)=>{if(!(e.connector&&o>0))return;const l=a??vGr(e,n,r);const u=l?.start;const d=l?.end;if(!u||!d)return;const f=Math.atan2(d.y-u.y,d.x-u.x)||0;const h=typeof d.angle==="number"&&Number.isFinite(d.angle)?d.angle:f;const m=typeof u.angle==="number"&&Number.isFinite(u.angle)?u.angle:f;const g=(x,w,_,C)=>{const A=C==="head"?e.connector?.lineStyle?.head:e.connector?.lineStyle?.tail;if(!A)return;const P=w$e(A,o);if(!P)return;const{type:L,halfWidthPx:I,lengthPx:N}=P;const O=s?.[C]??i;t.save();t.translate(x,w);t.rotate(_);t.fillStyle=O;t.strokeStyle=O;t.lineWidth=Math.max(1,o);if(L===5){t.beginPath();t.ellipse(0,0,I,I,0,0,Math.PI*2);t.fill()}else if(L===4){t.beginPath();t.moveTo(0,0);t.lineTo(-N/2,-I);t.lineTo(-N,0);t.lineTo(-N/2,I);t.closePath();t.fill()}else if(L===6){t.save();const z=t.lineCap;const U=t.lineJoin;const W=t.miterLimit??10;t.lineCap="round";t.lineJoin="round";t.miterLimit=3.5;t.beginPath();t.moveTo(0,0);t.lineTo(-N,-I);t.moveTo(0,0);t.lineTo(-N,I);t.stroke();t.lineCap=z;t.lineJoin=U;t.miterLimit=W;t.restore()}else if(L===3){const z=-L$t(N);t.beginPath();t.moveTo(0,0);t.lineTo(-N,-I);t.lineTo(z,0);t.lineTo(-N,I);t.closePath();t.fill()}else{t.beginPath();t.moveTo(0,0);t.lineTo(-N,-I);t.lineTo(-N,I);t.closePath();t.fill()}t.restore()};g(u.x,u.y,m+Math.PI,"head");g(d.x,d.y,h,"tail")};var M$t=(e,t)=>{const n=w$e(e.connector?.lineStyle?.head,t);const r=w$e(e.connector?.lineStyle?.tail,t);return{startPx:n?.strokeInsetPx??0,endPx:r?.strokeInsetPx??0}};var w$e=(e,t)=>{if(!e)return void 0;const n=e.type;if(!n||n===1)return void 0;const r=e.width;const i=e.length;const o=r===3?5.5:r===2?4.5:3.5;const a=i===3?6.5:i===2?5.5:4.5;const s=o*t/2;const l=a*t;const u=n===3?l*.72:l;const d=n===4?u/2:n===5?0:n===6?0:n===3?L$t(u):u;return{type:n,halfWidthPx:s,lengthPx:u,strokeInsetPx:d}};var L$t=e=>e*.68;var vGr=(e,t,n)=>{const{width:r,height:i}=$f(e,t,n);if(r===0&&i===0)return void 0;const o=r>=i;if(o){return{start:{x:0,y:i/2,angle:0},end:{x:r,y:i/2,angle:0}}}return{start:{x:r/2,y:0,angle:Math.PI/2},end:{x:r/2,y:i,angle:Math.PI/2}}};var _Gr=6e4;var T1e={clearancePx:12,bendPenaltyPx:20,cornerRadiusPx:24,portStubPx:24};var TGr={[97]:1,[98]:2,[99]:3,[100]:4};var wGr={[101]:1,[102]:2,[103]:3,[104]:4};var EGr=.38;var D$t=.3;var F$t=.7;var N$t=18;var O$t=.5;function S1e(e){const{connectorEl:t,elements:n,pres:r,slide:i}=e;const o=t.connector;if(!o){throw new Error("Connector element is missing connector metadata.")}const a=kGr(t);const s=SGr(e.options);const l=B$t(n,o.fromElementId);const u=B$t(n,o.toElementId);if(!l||!u){throw new Error("Connected elements not found for connector.")}const d=VO({element:l,siteIndex:o.fromIdx,pres:r,slide:i});const f=VO({element:u,siteIndex:o.toIdx,pres:r,slide:i});const h=Math.max(0,s.clearancePx);const m=AGr({fromAnchor:d,toAnchor:f,clearance:h,requestedPortStubPx:s.portStubPx});const g=z$t(d.point,d.normal,m);const x=z$t(f.point,f.normal,m);const w=A$e({el:l,pres:r,slide:i,clearance:h});const _=A$e({el:u,pres:r,slide:i,clearance:h});const C=w&&_?OGr(w,_):void 0;const A=BGr({fromNormal:d.normal,toNormal:f.normal,meetingPoint:C});const P=new Set([t.id]);if(w&&(w1e(g,w)||w1e(x,w))){P.add(l.id)}if(_&&(w1e(g,_)||w1e(x,_))){P.add(u.id)}const L=DGr({elements:n,excludeIds:P,pres:r,slide:i,clearance:h});let I;switch(a){case"straight":{I=E$e(d.point,f.point);break}case"elbow":{const N=s.maxBendsOverride??TGr[t.shape?.geometry??-1]??4;try{const O=W$t({start:g,end:x,obstacles:L,maxBends:N,bendPenalty:s.bendPenaltyPx,preferredStartDir:nC(d.normal),preferredEndDir:R$e(nC(f.normal)),meetingGuidance:A});const z=[d.point,...O,f.point];I=A1e(z)}catch{I=P$e(d,f)}break}case"curved":{const N=V$t({fromAnchor:d,toAnchor:f,obstacles:L});if(N){I=N}else{const O=s.maxBendsOverride??wGr[t.shape?.geometry??-1]??4;try{const z=W$t({start:g,end:x,obstacles:L,maxBends:O,bendPenalty:s.bendPenaltyPx,preferredStartDir:nC(d.normal),preferredEndDir:R$e(nC(f.normal)),meetingGuidance:A});const U=[d.point,...z,f.point];I=HGr(U)}catch{I=V$t({fromAnchor:d,toAnchor:f,obstacles:[]})??E$e(d.point,f.point)}}break}default:I=E$e(d.point,f.point)}return{connectorId:t.id,kind:a,commands:I}}function P$e(e,t){return A1e(CGr(e,t))}function CGr(e,t){const n=e.point;const r=t.point;if(K$t(n,r)){return[n,r]}if(Math.abs(n.x-r.x)<1e-4||Math.abs(n.y-r.y)<1e-4){return[n,r]}const i=mU(nC(e.normal));const o=mU(nC(t.normal));if(i==="vertical"&&o==="vertical"){const s=(n.y+r.y)/2;return[n,{x:n.x,y:s},{x:r.x,y:s},r]}if(i==="horizontal"&&o==="horizontal"){const s=(n.x+r.x)/2;return[n,{x:s,y:n.y},{x:s,y:r.y},r]}if(i==="vertical"||o==="horizontal"){return[n,{x:n.x,y:r.y},r]}if(i==="horizontal"||o==="vertical"){return[n,{x:r.x,y:n.y},r]}const a=(n.x+r.x)/2;return[n,{x:a,y:n.y},{x:a,y:r.y},r]}function SGr(e){return{clearancePx:e?.clearancePx??T1e.clearancePx,bendPenaltyPx:e?.bendPenaltyPx??T1e.bendPenaltyPx,cornerRadiusPx:e?.cornerRadiusPx??T1e.cornerRadiusPx,maxBendsOverride:e?.maxBendsOverride,portStubPx:e?.portStubPx??T1e.portStubPx}}function AGr(e){const{fromAnchor:t,toAnchor:n,clearance:r,requestedPortStubPx:i}=e;const o=i>r?i:r+2;const a=nC(t.normal);const s=nC(n.normal);const l=mU(a);const u=mU(s);if(l==="none"||u==="none"||l!==u||!OZ(a,s)){return o}const d={x:n.point.x-t.point.x,y:n.point.y-t.point.y};const f=j$t(d,t.normal);const h=j$t({x:-d.x,y:-d.y},n.normal);const m=Math.min(f,h);if(!Number.isFinite(m)||m<=0){return o}return Math.min(o,Math.max(r,m/2))}function kGr(e){const t=e.shape?.geometry;switch(t){case 96:return"straight";case 97:case 98:case 99:case 100:return"elbow";case 101:case 102:case 103:case 104:return"curved";default:return e.connector?"elbow":"straight"}}function B$t(e,t){return e.find(n=>n.id===t)}function RGr(e,t){switch(t){case 0:return{localPoint:{x:e.width/2,y:0},normal:{x:0,y:-1}};case 1:return{localPoint:{x:0,y:e.height/2},normal:{x:-1,y:0}};case 2:return{localPoint:{x:e.width/2,y:e.height},normal:{x:0,y:1}};case 3:return{localPoint:{x:e.width,y:e.height/2},normal:{x:1,y:0}};default:return null}}function VO({element:e,siteIndex:t,pres:n,slide:r}){if(!e.shape?.geometry){throw new Error("Connected element is missing a preset geometry.")}const i=$f(e,n,r);const o=PGr(e);const a=$b(e.shape.geometry);const s=a?.cxnLst?.[t];let l;let u;if(a&&s){const m=ak(a,i.width,i.height,o);const g=R0(s.pos?.x,m);const x=R0(s.pos?.y,m);if(!Number.isFinite(g)||!Number.isFinite(x)){throw new Error(`Connection site ${t} has invalid coordinates for geometry ${e.shape.geometry}`)}l={x:g,y:x};u=IGr(s,l,i,m)}else{const m=RGr(i,t);if(!m){if(!a){throw new Error([`No preset definition found for geometry ${e.shape.geometry}.`,`Connection site ${t} cannot be resolved without preset metadata.`,"Load preset shape definitions with:"," const { installPresetShapeDefinitions } = await import('@oai/granola/plugins/preset-shape-definitions');"," installPresetShapeDefinitions();"].join("\n"))}throw new Error(`Connection site ${t} is not defined for geometry ${e.shape.geometry}`)}l=m.localPoint;u=m.normal}const{point:d,normal:f}=MGr({element:e,bbox:i,local:l,normal:u});const h={x:i.x+i.width/2,y:i.y+i.height/2};return{siteIndex:t,point:d,localPoint:l,normal:f,shapeCenter:h}}function PGr(e){const t={};const n=e.shape?.adjustmentList??[];for(const r of n){if(r?.name&&r.formula){t[r.name]=r.formula}}return t}function IGr(e,t,n,r){const i=e.ang?R0(e.ang,r):void 0;if(typeof i==="number"&&Number.isFinite(i)){const d=LGr(i);return I$e({x:Math.cos(d),y:Math.sin(d)})}const o=t.x;const a=n.width-t.x;const s=t.y;const l=n.height-t.y;const u=Math.min(o,a,s,l);if(u===o)return{x:-1,y:0};if(u===a)return{x:1,y:0};if(u===s)return{x:0,y:-1};return{x:0,y:1}}function MGr({element:e,bbox:t,local:n,normal:r}){const i=t.width/2;const o=t.height/2;let a=n.x-i;let s=n.y-o;let l=r.x;let u=r.y;const d=Boolean(e.bbox?.horizontalFlip);const f=Boolean(e.bbox?.verticalFlip);if(d){a=-a;l=-l}if(f){s=-s;u=-u}const h=Dz(e.bbox?.rotation??0);if(h!==0){({x:a,y:s}=S$e(a,s,h));({x:l,y:u}=S$e(l,u,h))}const m={x:t.x+i+a,y:t.y+o+s};const g=I$e({x:l,y:u});return{point:m,normal:g}}function S$e(e,t,n){const r=Math.cos(n);const i=Math.sin(n);return{x:e*r-t*i,y:e*i+t*r}}function I$e(e){const t=Math.hypot(e.x,e.y);if(!t)return{x:0,y:0};return{x:e.x/t,y:e.y/t}}function z$t(e,t,n){return{x:e.x+t.x*n,y:e.y+t.y*n}}function LGr(e){return e/_Gr*Math.PI/180}function DGr(e){const{elements:t,excludeIds:n,pres:r,slide:i,clearance:o}=e;const a=[];for(const s of t){if(!s||n.has(s.id)){continue}const l=FGr({el:s,pres:r,slide:i,clearance:o});if(l){a.push({...l,id:s.id})}}return a}function FGr({el:e,pres:t,slide:n,clearance:r}){if(e.type!==5||e.connector||NGr(e,t,n)){return null}return A$e({el:e,pres:t,slide:n,clearance:r})}function A$e({el:e,pres:t,slide:n,clearance:r}){const i=$f(e,t,n);if(!i.width||!i.height){return null}const o=zGr({x:i.x,y:i.y,width:i.width,height:i.height,rotation:Dz(e.bbox?.rotation??0)});return UGr(o,r)}function NGr(e,t,n){if(/^bg[._-]/i.test(e.id)){return true}const r=n.frame;if(!r){return false}const i=$f(e,t,n);const o=1;return Math.abs(i.x-r.left)<=o&&Math.abs(i.y-r.top)<=o&&Math.abs(i.width-r.width)<=o&&Math.abs(i.height-r.height)<=o}function w1e(e,t){return e.x>t.minX&&e.xt.minY&&e.yS$e(m.x,m.y,i));let u=Number.POSITIVE_INFINITY;let d=Number.NEGATIVE_INFINITY;let f=Number.POSITIVE_INFINITY;let h=Number.NEGATIVE_INFINITY;for(const m of l){const g=m.x+o;const x=m.y+a;u=Math.min(u,g);d=Math.max(d,g);f=Math.min(f,x);h=Math.max(h,x)}return{minX:u,minY:f,maxX:d,maxY:h}}function UGr(e,t){if(!t)return e;return{minX:e.minX-t,minY:e.minY-t,maxX:e.maxX+t,maxY:e.maxY+t}}function E$e(e,t){return[{cmd:"moveTo",x:e.x,y:e.y},{cmd:"lineTo",x:t.x,y:t.y}]}function A1e(e){const t=FZ(e);if(t.length<2){return[]}const n=t[0];if(!n)return[];const r=[{cmd:"moveTo",x:n.x,y:n.y}];for(let i=1;i0){return r}return t}function VGr(e){const{delta:t,distance:n,startDirection:r,endDirection:i}=e;let o=n*EGr;const a=G$t(t.x,r.x,i.x);if(a!==void 0){o=Math.min(o,a)}const s=G$t(t.y,r.y,i.y);if(s!==void 0){o=Math.min(o,s)}return o}function G$t(e,t,n){if(Math.abs(e)<=.001){return void 0}if(e*t<=0||e*n<=0){return void 0}const r=Math.abs(t)+Math.abs(n);if(r<=.001){return void 0}return Math.abs(e)/r*.9}function $Gr(e,t,n){if(n.length===0){return true}for(let r=1;rI.key===h);const x=d.findIndex(I=>I.key===m);if(g<0||x<0){throw new Error("Failed to seed orthogonal routing nodes.")}const w=d[g];const _=d[x];if(!w||!_){throw new Error("Failed to seed routing endpoints.")}const C=[];const A=new Map;const P=new Map;const L={node:g,dir:"none",bends:0,g:0,f:k$e(w,_),pathLen:0};C.push(L);P.set(C1e(L),0);while(C.length>0){C.sort((U,W)=>U.f-W.f||U.bends-W.bends||U.g-W.g||U.pathLen-W.pathLen);const I=C.shift();if(I.node===x){return eHr({nodes:d,cameFrom:A,state:I})}const N=C1e(I);const O=d[I.node];if(!O){continue}const z=f.get(O.key)??[];for(const U of z){const W=d[U.index];if(!W)continue;const H=pU(O,W);if(H==="none")continue;const $=I.dir==="none"||I.dir===H?I.bends:I.bends+1;if($>i)continue;const K=Math.hypot(W.x-O.x,W.y-O.y);const X=$>I.bends?o:0;const j=I.dir==="none"&&a!=="none"&&OZ(H,a)?o*2:0;const te=U.index===x&&s!=="none"&&OZ(H,s)?o*2:0;const J=ZGr({currentNode:O,nextNode:W,nextDir:H,currentIndex:I.node,nextIndex:U.index,startIndex:g,endIndex:x,meetingGuidance:l});const oe=I.g+K+X+j+te+J;const se={node:U.index,dir:H,bends:$,g:oe,f:oe+k$e(W,_),pathLen:I.pathLen+1};const re=C1e(se);if(oe<(P.get(re)??Number.POSITIVE_INFINITY)){A.set(re,{prevKey:N,node:I.node,dir:I.dir});P.set(re,oe);C.push(se)}}}throw new Error("Failed to compute orthogonal route.")}function YGr(e){const{start:t,end:n,obstacles:r,maxBends:i,preferredStartDir:o,preferredEndDir:a,meetingGuidance:s}=e;const l=XGr({start:t,end:n,preferredStartDir:o,preferredEndDir:a,meetingGuidance:s});if(l){const f=FZ(l);if(f.length>=2&&Y$t(f)&&q$t(f,r)){return f}}const u=[[t,n],[t,{x:n.x,y:t.y},n],[t,{x:t.x,y:n.y},n]];let d;for(const f of u){const h=FZ(f);if(h.length<2||!Y$t(h)){continue}if(!q$t(h,r)){continue}if(qGr({points:h,preferredStartDir:o,preferredEndDir:a})>i){continue}const m=KGr({points:h,preferredStartDir:o,preferredEndDir:a});if(!d||mu-d);const s=[...o].sort((u,d)=>u-d);const l=[];for(const u of a){for(const d of s){const f=X$t({x:u,y:d},e)||X$t({x:u,y:d},t);if(!f&&Q$t(u,d,n)){continue}l.push({x:u,y:d,key:NZ({x:u,y:d})})}}return l}function QGr(e,t){const n=new Map;const r=new Map;e.forEach((a,s)=>{n.set(a.key,[]);r.set(a.key,s)});const i=new Map;const o=new Map;e.forEach(a=>{if(!i.has(a.x))i.set(a.x,[]);i.get(a.x).push(a);if(!o.has(a.y))o.set(a.y,[]);o.get(a.y).push(a)});i.forEach(a=>{a.sort((s,l)=>s.y-l.y);for(let s=0;s{a.sort((s,l)=>s.x-l.x);for(let s=0;sa.index===i)){o.push({index:i})}}function Z$t(e,t,n){if(e.x!==t.x){return true}const r=Math.min(e.y,t.y);const i=Math.max(e.y,t.y);for(const o of n){if(e.x<=o.minX||e.x>=o.maxX)continue;if(i<=o.minY||r>=o.maxY)continue;return true}return false}function J$t(e,t,n){if(e.y!==t.y){return true}const r=Math.min(e.x,t.x);const i=Math.max(e.x,t.x);for(const o of n){if(e.y<=o.minY||e.y>=o.maxY)continue;if(i<=o.minX||r>=o.maxX)continue;return true}return false}function Q$t(e,t,n){return n.some(r=>e>r.minX&&er.minY&&te.y?"down":"up"}if(e.y===t.y){return t.x>e.x?"right":"left"}return"none"}function k$e(e,t){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)}function C1e(e){return`${e.node}:${e.dir}:${e.bends}`}function NZ(e){return`${e.x}|${e.y}`}function nC(e){const t=Math.abs(e.x);const n=Math.abs(e.y);if(t<1e-6&&n<1e-6){return"none"}if(t>=n){return e.x>=0?"right":"left"}return e.y>=0?"down":"up"}function R$e(e){switch(e){case"up":return"down";case"down":return"up";case"left":return"right";case"right":return"left";default:return"none"}}function OZ(e,t){return e!=="none"&&t!=="none"&&R$e(e)===t}function X$t(e,t){return Math.abs(e.x-t.x)<1e-4&&Math.abs(e.y-t.y)<1e-4}function mU(e){if(e==="left"||e==="right"){return"horizontal"}if(e==="up"||e==="down"){return"vertical"}return"none"}function j$t(e,t){return e.x*t.x+e.y*t.y}function eHr({nodes:e,cameFrom:t,state:n}){const r=[n.node];let i=C1e(n);while(t.has(i)){const o=t.get(i);r.push(o.node);if(!o.prevKey)break;i=o.prevKey}return r.reverse().map(o=>{const a=e[o];if(!a){throw new Error("Route reconstruction failed.")}return{x:a.x,y:a.y}})}function eGt(e,t,n){let r;let i;let o;let a;let s;for(const l of e){if(l.moveTo){const u=Number(l.moveTo.x??0)*ti*t;const d=Number(l.moveTo.y??0)*ti*n;s={x:u,y:d};if(!r){r={...s}}continue}if(l.lineTo&&s){const u=Number(l.lineTo.x??s.x)*ti*t;const d=Number(l.lineTo.y??s.y)*ti*n;const f=Math.atan2(d-s.y,u-s.x);if(r&&i===void 0){i=f}s={x:u,y:d};o={...s};a=f;continue}if(l.quadBezTo&&s){const u=Number(l.quadBezTo.x1??s.x)*ti*t;const d=Number(l.quadBezTo.y1??s.y)*ti*n;const f=Number(l.quadBezTo.x??s.x)*ti*t;const h=Number(l.quadBezTo.y??s.y)*ti*n;const m=Math.atan2(d-s.y,u-s.x);if(r&&i===void 0){i=m}s={x:f,y:h};o={...s};a=Math.atan2(h-d,f-u);continue}if(l.cubicBezTo&&s){const u=Number(l.cubicBezTo.x1??s.x)*ti*t;const d=Number(l.cubicBezTo.y1??s.y)*ti*n;const f=Number(l.cubicBezTo.x2??s.x)*ti*t;const h=Number(l.cubicBezTo.y2??s.y)*ti*n;const m=Number(l.cubicBezTo.x??s.x)*ti*t;const g=Number(l.cubicBezTo.y??s.y)*ti*n;const x=Math.atan2(d-s.y,u-s.x);if(r&&i===void 0){i=x}s={x:m,y:g};o={...s};a=Math.atan2(g-h,m-f)}}if(!r||!o){return void 0}if(i===void 0&&a!==void 0){i=a}if(a===void 0&&i!==void 0){a=i}return{start:{x:r.x,y:r.y,angle:i??0},end:{x:o.x,y:o.y,angle:a??0}}}function rHr(e){return e?.type===2&&e.value==="phClr"}function lGt(e){if(e.geometry===void 0){return void 0}if(e.geometry===188&&e.customPaths.length===0){return void 0}if(e.geometry!==188&&e.preset===void 0){return void 0}return{geometry:e.geometry,preset:e.preset,adjustmentList:e.adjustmentList,customPaths:e.customPaths}}function M$e(e,t){if(!rHr(e)||!t){return e}return{...t,transform:e?.transform??t.transform}}function iHr(e,t){if(!t){return e}return{...e,color:M$e(e.color,t),gradientStops:e.gradientStops.map(n=>({...n,color:M$e(n.color,t)})),pattern:e.pattern?{...e.pattern,color:M$e(e.pattern.color,t)}:e.pattern}}function cGt(e){const t=e.resolveFrame();const n=jA(t.rotation);const r={id:e.id,name:e.name,zIndex:e.zIndex,type:e.type==="shape"?5:e.type==="image"?3:e.type==="table"?9:6,bbox:{xEmu:Math.round(t.left/ti),yEmu:Math.round(t.top/ti),widthEmu:Math.round(t.width/ti),heightEmu:Math.round(t.height/ti),rotation:n,horizontalFlip:t.horizontalFlip,verticalFlip:t.verticalFlip},effects:[],children:[],levelsStyles:[],citations:[],paragraphs:[]};if(e.type==="shape"){r.shape={geometry:e.geometry??0,fill:void 0,line:void 0,adjustmentList:[...e.adjustmentList],rectFormula:void 0,customPaths:[...e.customPaths],customGeometryGuides:[]};r.connector=e.connector}return r}function oHr(e,t){if(e.fill&&("isSet"in e.fill?e.fill.isSet:true)){return e.fill}if(e.connector){return void 0}const n=e.fillReference;if(!n){return void 0}if(n.index==="0"||n.index==="1000"){return void 0}let r;if(t.fillStyleMap){r=t.fillStyleMap[n.index]}if(r){return iHr(r,n.color)}if(n.color){return{type:1,color:n.color,gradientStops:[],pictureEffects:[]}}return void 0}function aHr(e,t){if(!e){return void 0}const n=t[e.index];if(n){return n}const r=Object.entries(t);const i=r[r.length-1];if(!i){return void 0}const o=Number(e.index);const a=Number(i[0]);if(o>a){return i[1]}return void 0}function sHr(e,t){const n=aHr(e.effectReference,t.effectMap);const r=e.effects?.outerShadow??n?.outerShadow;if(!r){return void 0}const i=r.color?oo(r.color,t):"transparent";const o=r.blurRadius?r.blurRadius*ti:0;const a=r.distance?r.distance*ti:0;const s=age(r.direction,a);return{color:i??"transparent",blur:o,offsetX:s.x,offsetY:s.y}}function tGt(e,t){e.shadowColor=t.color;e.shadowBlur=t.blur;e.shadowOffsetX=t.offsetX;e.shadowOffsetY=t.offsetY}function nGt(e){e.shadowColor="transparent";e.shadowBlur=0;e.shadowOffsetX=0;e.shadowOffsetY=0}function yU(e,t,n,r,i,o={}){if(!e.shape)return;zZ({proto:e,geometry:e.shape.geometry,preset:$b(e.shape.geometry),adjustmentList:e.shape.adjustmentList,customPaths:e.shape.customPaths,fill:e.shape.fill,line:e.shape.line,connector:e.connector,effects:new EE(e.effects),effectReference:e.effectReference,fillReference:e.fillReference,lineReference:e.lineReference},t,n,r,i,o)}function BZ(e,t,n,r,i,o={}){const{source:a=e.renderStyleData,...s}=o;zZ({...a,proto:a.connector?cGt(e):void 0},t,n,r,i,s)}function uGt(e,t,{frame:n,geometry:r,adjustmentList:i,fill:o,bitmap:a}){const s=$b(r);if(!s){return false}zZ({geometry:r,preset:s,adjustmentList:i,customPaths:[]},e,void 0,void 0,t,{frame:n,pictureFillBitmap:{bitmap:a},pictureFill:o});return true}function dGt(e,t,{frame:n,source:r,fill:i,bitmap:o,contentType:a}){const s=lGt(r);if(!s){return false}zZ(s,e,void 0,void 0,t,{frame:n,pictureFillBitmap:{bitmap:o,contentType:a},pictureFill:i});return true}function fGt(e,t,{frame:n,source:r,line:i}){const o=lGt(r);if(!o){return false}zZ({...o,line:i},e,void 0,void 0,t,{frame:n});return true}function zZ(e,t,n,r,i,o={}){const a=e.proto;const{line:s,geometry:l,adjustmentList:u}=e;const d=oHr(e,i);const f=o.frame?{x:o.frame.left,y:o.frame.top,width:o.frame.width,height:o.frame.height}:a&&r?$f(a,n,r):void 0;if(!f)return;const{width:h,height:m}=f;const g=y1e(s);const x=e.lineReference?i.lineStyleMap[e.lineReference.index]:void 0;const w=b1e({line:s,themeLine:x});const _=oo(s?.fill?.color??e.lineReference?.color??x?.fill?.color,i);const C=s?s.fill:x?.fill;const A=sGt(s)??(!g?sGt(x):void 0)??1;const P=sHr(e,i);const L=Boolean(e.connector)&&kHr(l??void 0);const I=Boolean(e.connector?.fromElementId&&e.connector.toElementId);if(L&&I){const j=e.proto;if(!j||!r)return;const te=Uc(t,f,C,i,_??"transparent");uHr({el:j,ctx:t,pres:n,slide:r,routeElements:o.connectorRouteElements,strokePaint:te,strokeBBox:f,lineFill:C,themeMap:i,lineWidthPx:w,lineStyle:A});return}if(l===void 0)return;if(e.useBackgroundFill&&!o.backgroundFillPaint){throw new Error("A slide-background fill is required to render useBackgroundFill.")}t.save();t.lineWidth=w>0?w:.001;if(e.connector){const j=e.connector.lineStyle?.cap;if(j===1)t.lineCap="butt";else if(j===2)t.lineCap="round";else if(j===3)t.lineCap="square";const te=e.connector.lineStyle?.join;if(te===1)t.lineJoin="round";else if(te===2)t.lineJoin="bevel";else if(te===3)t.lineJoin="miter"}FT(t,A,t.lineWidth);if(o.frame){_E(t,o.frame)}else{const j=e.proto;if(!j||!r){t.restore();return}IFt(t,j,n,r)}const N={x:0,y:0,width:h,height:m};let O;if(e.useBackgroundFill&&o.backgroundFillPaint){O=o.backgroundFillPaint;O.setTransform(t.getTransform().inverse())}const z=(j=N)=>{if(O){return O}return Uc(t,j,d,i)};const U=(j=N)=>Uc(t,j,C,i,_);const W=z();const H=U();t.fillStyle=W;t.strokeStyle=H;const $=O?void 0:o.pictureFillBitmap;const K=o.pictureFill??d;const X=Boolean(P);t.beginPath();switch(l){case 0:case-1:{t.restore();break}case 188:{let j;(e.customPaths??[]).forEach(te=>{const J=Number(te.widthEmu)*ti;const oe=Number(te.heightEmu)*ti;const se=h/J;const re=m/oe;const ce=ue=>{t.save();if(ue.shadow){tGt(t,ue.shadow)}else{nGt(t)}t.fillStyle=z();t.strokeStyle=ue.stroke?U():"rgba(0, 0, 0, 0)";I$t(t,te.commands,{scaleX:se,scaleY:re});if($&&ue.fill){t.save();t.clip();rGt(t,K,$,N,i);t.restore()}else if(ue.fill){t.fill()}if(ue.stroke){if(e.connector&&a){const xe=vHr(te.commands,se,re);D$e(t,xe,a,w)}else{t.stroke()}}if(!j&&e.connector){j=eGt(te.commands,se,re)}t.restore()};if(P){ce({fill:true,shadow:P,stroke:false})}ce({fill:!X,stroke:w>0&&!g})});if(e.connector&&a&&r){_1e(a,t,n,r,H,w,j,L$e({bbox:N,fill:C,themeMap:i,fallbackPaint:H,metrics:j}))}t.restore();t.restore();return}default:{const j=e.preset;let te;if(j){const J=u?.reduce((re,ce)=>{re[ce.name]=ce.formula;return re},{});if(P){t.save();tGt(t,P);T$e(t,j,{w:h,h:m,x:0,y:0,adjustments:J,fill:true,stroke:false,collectMetrics:false});t.restore()}nGt(t);const oe=Boolean(e.connector)&&l===96;const se=T$e(t,j,{w:h,h:m,x:0,y:0,adjustments:J,fill:!$&&!X,stroke:w>0&&!g&&!oe,collectMetrics:Boolean(e.connector)});if($){t.save();t.clip();rGt(t,K,$,{x:0,y:0,width:h,height:m},i);t.restore()}if(e.connector&&se?.length){te=se.find(re=>re.start&&re.end)}if(oe&&te&&te.start&&te.end&&w>0&&!g&&a){const{start:re,end:ce}=te;D$e(t,[{cmd:"moveTo",x:re.x,y:re.y},{cmd:"lineTo",x:ce.x,y:ce.y}],a,w)}}if(e.connector&&a&&r){_1e(a,t,n,r,H,w,te,L$e({bbox:N,fill:C,themeMap:i,fallbackPaint:H,metrics:te}))}t.restore();t.restore();return}}t.fill();if(w>0&&!g)t.stroke();t.restore()}function lHr(e,t){const n=e?.srcRect;if(!n){return{sx:0,sy:0,sw:t.width,sh:t.height}}const r=l=>(l??0)/1e5;const i=r(n.l);const o=r(n.t);const a=r(n.r);const s=r(n.b);return{sx:i*t.width,sy:o*t.height,sw:t.width*(1-i-a),sh:t.height*(1-o-s)}}function cHr(e,t){const n=e?.stretchFillRect;if(!n){return{dx:t.x,dy:t.y,dw:t.width,dh:t.height}}const r=l=>(l??0)/1e5;const i=r(n.l);const o=r(n.t);const a=r(n.r);const s=r(n.b);return{dx:t.x+i*t.width,dy:t.y+o*t.height,dw:t.width*(1-i-a),dh:t.height*(1-o-s)}}function rGt(e,t,n,r,i){const{bitmap:o,contentType:a}=n;const{sx:s,sy:l,sw:u,sh:d}=lHr(t,o);const{dx:f,dy:h,dw:m,dh:g}=cHr(t,r);const x=t&&"pictureEffects"in t?t.pictureEffects:void 0;const w=rk(o,{pictureEffects:x,contentType:a,themeMap:i});e.save();e.globalAlpha*=w.opacity;e.drawImage(w.source,s,l,u,d,f,h,m,g);e.restore()}function uHr({el:e,ctx:t,pres:n,slide:r,routeElements:i,strokePaint:o,strokeBBox:a,lineFill:s,themeMap:l,lineWidthPx:u,lineStyle:d}){if(!e.connector)return;t.save();t.lineWidth=u>0?u:.001;t.strokeStyle=o;FT(t,d,t.lineWidth);const f=i?[...i]:r.elements.items.map(w=>cGt(w));if(e.id&&!f.some(w=>w.id===e.id)){f.push(e)}let h;try{h=S1e({connectorEl:e,elements:f,pres:n,slide:r}).commands}catch(w){console.warn("autoRouteConnectorPx failed, using fallback path",w);h=CHr(e,f,n,r)}if(!h||h.length===0){t.restore();return}const m=SHr(h);const g=fHr(h,a)??a;const x=dHr({ctx:t,bbox:g,fill:s,themeMap:l,fallbackPaint:o});t.strokeStyle=x;D$e(t,h,e,t.lineWidth);_1e(e,t,n,r,x,t.lineWidth,m,L$e({bbox:g,fill:s,themeMap:l,fallbackPaint:x,metrics:m}));t.restore()}function L$e({bbox:e,fill:t,themeMap:n,fallbackPaint:r,metrics:i}){if(!e||!t||!n||!i?.start||!i?.end||!pHr(t)){return void 0}return{head:iGt({fill:t,bbox:e,point:i.start,themeMap:n,fallbackPaint:r}),tail:iGt({fill:t,bbox:e,point:i.end,themeMap:n,fallbackPaint:r})}}function dHr({ctx:e,bbox:t,fill:n,themeMap:r,fallbackPaint:i}){if(!t||!n||!r){return i}const o=typeof i==="string"?i:"transparent";return Uc(e,t,n,r,o)}function fHr(e,t){const n=hHr(e);if(n&&(n.width>0||n.height>0)){return n}return t}function hHr(e){let t=Number.POSITIVE_INFINITY;let n=Number.POSITIVE_INFINITY;let r=Number.NEGATIVE_INFINITY;let i=Number.NEGATIVE_INFINITY;const o=a=>{t=Math.min(t,a.x);n=Math.min(n,a.y);r=Math.max(r,a.x);i=Math.max(i,a.y)};for(const a of e){if(a.cmd==="moveTo"||a.cmd==="lineTo"){o(a)}else if(a.cmd==="cubicBezTo"){o({x:a.x1,y:a.y1});o({x:a.x2,y:a.y2});o({x:a.x,y:a.y})}}if(!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(i)){return void 0}return{x:t,y:n,width:r-t,height:i-n}}function pHr(e){if(e.type!==2||(e.gradientStops?.length??0)===0){return false}const t=e.gradientKind;return t===void 0||t===null||t==="linear"||t===0||t===1}function iGt({fill:e,bbox:t,point:n,themeMap:r,fallbackPaint:i}){const o=[...e.gradientStops??[]].sort((d,f)=>(d.position??0)-(f.position??0));if(o.length===0){return i}const a=o.every(d=>Math.abs(d.position??0)<=1);const s=typeof i==="string"?i:"transparent";const l=o.map(d=>({offset:gHr(d.position??0,a),color:oo(d.color,r,s)}));const u=mHr(e,t,n);if(u<=l[0].offset){return l[0].color}for(let d=1;dh.offset){continue}const m=h.offset-f.offset;const g=m<=0?0:(u-f.offset)/m;return yHr(f.color,h.color,g)}return l[l.length-1].color}function mHr(e,t,n){const r=(e.angleDeg??0)*Math.PI/180;const{x:i,y:o,width:a,height:s}=t;const l=i+a/2;const u=o+s/2;const d=Math.sqrt(a*a+s*s)/2;if(d<=0){return 0}const f=Math.cos(r)*d;const h=Math.sin(r)*d;const m={x:l-f,y:u-h};const g={x:l+f,y:u+h};const x=g.x-m.x;const w=g.y-m.y;const _=x*x+w*w;if(_<=0){return 0}return R1e(((n.x-m.x)*x+(n.y-m.y)*w)/_)}function gHr(e,t){const n=t?e:e/1e5;return R1e(n)}function yHr(e,t,n){const r=oGt(e);const i=oGt(t);if(!r||!i){return n<.5?e:t}const o=R1e(n);const a=Math.round(k1e(r.r,i.r,o));const s=Math.round(k1e(r.g,i.g,o));const l=Math.round(k1e(r.b,i.b,o));const u=R1e(k1e(r.a,i.a,o));return`rgba(${a},${s},${l},${bHr(u)})`}function oGt(e){const t=e.trim();const n=/^rgba?\(\s*([0-9.]+)\s*,\s*([0-9.]+)\s*,\s*([0-9.]+)(?:\s*,\s*([0-9.]+))?\s*\)$/i.exec(t);if(n){return{r:Number(n[1]),g:Number(n[2]),b:Number(n[3]),a:n[4]===void 0?1:Number(n[4])}}const r=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(t);if(!r){return void 0}const i=r[1];const o=i.length===3?i.split("").map(a=>`${a}${a}`).join(""):i;return{r:Number.parseInt(o.slice(0,2),16),g:Number.parseInt(o.slice(2,4),16),b:Number.parseInt(o.slice(4,6),16),a:1}}function k1e(e,t,n){return e+(t-e)*n}function R1e(e){return Math.min(1,Math.max(0,e))}function bHr(e){return Math.round(e*1e3)/1e3}function xHr(e,t){for(const n of t){if(n.cmd==="moveTo"){e.moveTo(n.x,n.y)}else if(n.cmd==="lineTo"){e.lineTo(n.x,n.y)}else if(n.cmd==="cubicBezTo"){e.bezierCurveTo(n.x1,n.y1,n.x2,n.y2,n.x,n.y)}}}function D$e(e,t,n,r){const i=M$t(n,r);const o=_Hr(t,i);const a=e.lineCap;if(i.startPx>0||i.endPx>0){e.lineCap="butt"}e.beginPath();xHr(e,o);e.stroke();e.lineCap=a}function vHr(e,t,n){const r=[];let i={x:0,y:0};for(const o of e){if(o.moveTo){i={x:Number(o.moveTo.x??0)*ti*t,y:Number(o.moveTo.y??0)*ti*n};r.push({cmd:"moveTo",x:i.x,y:i.y})}else if(o.lineTo){i={x:Number(o.lineTo.x??i.x)*ti*t,y:Number(o.lineTo.y??i.y)*ti*n};r.push({cmd:"lineTo",x:i.x,y:i.y})}else if(o.cubicBezTo){const a=Number(o.cubicBezTo.x1??i.x)*ti*t;const s=Number(o.cubicBezTo.y1??i.y)*ti*n;const l=Number(o.cubicBezTo.x2??i.x)*ti*t;const u=Number(o.cubicBezTo.y2??i.y)*ti*n;i={x:Number(o.cubicBezTo.x??i.x)*ti*t,y:Number(o.cubicBezTo.y??i.y)*ti*n};r.push({cmd:"cubicBezTo",x1:a,y1:s,x2:l,y2:u,x:i.x,y:i.y})}}return r}function _Hr(e,t){let n=THr(e,t.startPx);n=wHr(n,t.endPx);return n}function THr(e,t){if(t<=0||e.length<2){return e}const n=e.map(o=>({...o}));const r=n[0];const i=n[1];if(!r||r.cmd!=="moveTo"||!i){return n}if(i.cmd==="lineTo"){const o=Math.hypot(i.x-r.x,i.y-r.y);if(o<=0){return n}const a=Math.min(t,o-.001);r.x+=(i.x-r.x)/o*a;r.y+=(i.y-r.y)/o*a}else if(i.cmd==="cubicBezTo"){const o={p0:{x:r.x,y:r.y},p1:{x:i.x1,y:i.y1},p2:{x:i.x2,y:i.y2},p3:{x:i.x,y:i.y}};const a=P1e(o);const s=Math.min(t,a-.001);if(s>0){const[,l]=F$e(o,hGt(o,s));const u=pGt({x:i.x1-r.x,y:i.y1-r.y});const d={x:r.x+u.x*s,y:r.y+u.y*s};const f=Math.hypot(l.p1.x-l.p0.x,l.p1.y-l.p0.y);r.x=d.x;r.y=d.y;i.x1=d.x+u.x*f;i.y1=d.y+u.y*f;i.x2=l.p2.x;i.y2=l.p2.y;i.x=l.p3.x;i.y=l.p3.y}}return n}function wHr(e,t){if(t<=0||e.length<2){return e}const n=e.map(s=>({...s}));let r;let i;let o=-1;for(let s=0;s0){const[d]=F$e(s,hGt(s,l-u));a.x1=d.p1.x;a.y1=d.p1.y;const f=pGt({x:a.x-a.x2,y:a.y-a.y2});const h={x:a.x-f.x*u,y:a.y-f.y*u};const m=Math.hypot(d.p3.x-d.p2.x,d.p3.y-d.p2.y);a.x2=h.x-f.x*m;a.y2=h.y-f.y*m;a.x=h.x;a.y=h.y}}return n}function EHr(e,t){const n=1-t;const r=n*n;const i=t*t;return{x:e.p0.x*r*n+3*e.p1.x*r*t+3*e.p2.x*n*i+e.p3.x*t*i,y:e.p0.y*r*n+3*e.p1.y*r*t+3*e.p2.y*n*i+e.p3.y*t*i}}function P1e(e){let t=0;let n=e.p0;for(let r=1;r<=24;r+=1){const i=EHr(e,r/24);t+=Math.hypot(i.x-n.x,i.y-n.y);n=i}return t}function hGt(e,t){const n=P1e(e);if(t<=0)return 0;if(t>=n)return 1;let r=0;let i=1;for(let o=0;o<16;o+=1){const a=(r+i)/2;const[s]=F$e(e,a);if(P1e(s)u.id===i.fromElementId);const a=t.find(u=>u.id===i.toElementId);if(!o||!a){return[]}try{const u=VO({element:o,siteIndex:i.fromIdx,pres:n,slide:r});const d=VO({element:a,siteIndex:i.toIdx,pres:n,slide:r});return P$e(u,d)}catch{}const s=aGt($f(o,n,r));const l=aGt($f(a,n,r));return[{cmd:"moveTo",x:s.x,y:s.y},{cmd:"lineTo",x:l.x,y:l.y}]}function aGt(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function SHr(e){let t;let n;let r;let i;let o;for(const a of e){if(a.cmd==="moveTo"){o={x:a.x,y:a.y};if(!t){t={...o}}}else if(a.cmd==="lineTo"&&o){const s=Math.atan2(a.y-o.y,a.x-o.x);if(t&&n===void 0){n=s}o={x:a.x,y:a.y};r={...o};i=s}else if(a.cmd==="cubicBezTo"&&o){const s=Math.atan2(a.y1-o.y,a.x1-o.x);if(t&&n===void 0){n=s}o={x:a.x,y:a.y};r={...o};i=Math.atan2(a.y-a.y2,a.x-a.x2)}}if(!t||!r){return void 0}if(n===void 0&&i!==void 0){n=i}if(i===void 0&&n!==void 0){i=n}return{start:{x:t.x,y:t.y,angle:n??0},end:{x:r.x,y:r.y,angle:i??0}}}var AHr=new Set([96,97,98,99,100,101,102,103,104]);function kHr(e){if(e===void 0||e===null){return false}return AHr.has(e)}function sGt(e){if(!e)return void 0;if(e instanceof eo){switch(e.style){case"dashed":return 2;case"dotted":return 3;case"dash-dot":return 4;case"dash-dot-dot":return 5;case"solid":return 1;default:return void 0}}const{style:t}=e;if(t===0){return void 0}return t}function bU(e){return{topPx:Math.max(0,e.placement?.distanceTopEmu??0)*ti,bottomPx:Math.max(0,e.placement?.distanceBottomEmu??0)*ti,leftPx:Math.max(0,e.placement?.distanceLeftEmu??0)*ti,rightPx:Math.max(0,e.placement?.distanceRightEmu??0)*ti}}function N$e(e){const t=e!==void 0?Math.floor(e):1;return t>1?t:1}function mGt(e){return e.horizontalMerge===true||e.verticalMerge===true}function RHr(e){let t=0;for(const n of e.rows){let r=0;for(const i of n.cells){if(mGt(i)){continue}r+=N$e(i.gridSpan)}t=Math.max(t,r)}return t}function I1e(e,t,n){let r=0;for(let i=0;ii>0?i:void 0).filter(i=>i!==void 0)??[];if(r.length===0){const i=n.frameWidthEmu/t;r=new Array(t).fill(i)}else if(r.lengtht){r=r.slice(0,t)}if(n.fitColumnWidthsToFrame===true){const i=I1e(r,0,r.length);if(i>0&&n.frameWidthEmu>0){const o=n.frameWidthEmu/i;r=r.map(a=>a*o)}}return r}function M1e(e,t){const n=RHr(e);if(n<=0){return{columnCount:0,columnWidthsEmu:[],rows:[],widthEmu:0}}const r=PHr(e,n,t);const i=[];const o=[];for(let a=0;a0){u+=1}const h=N$e(f.gridSpan);const m=N$e(f.rowSpan);l.push({cell:f,rowIndex:a,sourceCellIndex:d,columnIndex:u,columnSpan:h,rowSpan:m,xEmu:I1e(r,0,u),widthEmu:I1e(r,u,h)});if(m>1){for(let g=0;g0){i[d]=(i[d]??0)-1}}}return{columnCount:n,columnWidthsEmu:r,rows:o,widthEmu:I1e(r,0,r.length)}}function UZ(e){return Boolean(e?.fill?.color)}function IHr(e){const t=e.table?.rows??[];for(const n of t){for(const r of n.cells??[]){if(UZ(r.lines?.top)||UZ(r.lines?.right)||UZ(r.lines?.bottom)||UZ(r.lines?.left)){return true}}}return false}function xU(e){return Math.round(e*1e3)}function MHr(e,t,n,r){return`${e}:${xU(t)}:${xU(n)}:${xU(r)}`}function L1e(e){if(e.widthEmu===void 0){return 1}return Math.max(.25,e.widthEmu*ti)}function gGt(e){return L1e(e)*1e3+(e.style??0)+(e.compound??0)}function yGt(e,t){return gGt(t)>gGt(e)?t:e}function LHr(e){const t=[...e].sort((r,i)=>{if(r.orientation!==i.orientation){return r.orientation.localeCompare(i.orientation)}if(Math.abs(r.crossPx-i.crossPx)>.001){return r.crossPx-i.crossPx}if(Math.abs(r.startPx-i.startPx)>.001){return r.startPx-i.startPx}return r.endPx-i.endPx});const n=[];for(const r of t){const i=n[n.length-1];if(i&&i.orientation===r.orientation&&Math.abs(i.crossPx-r.crossPx)<=.001&&Math.abs(i.endPx-r.startPx)<=.001&&i.widthPx===r.widthPx&&i.line.style===r.line.style&&i.line.compound===r.line.compound&&i.line.fill?.color?.value===r.line.fill?.color?.value){i.endPx=r.endPx;continue}n.push({...r})}return n}function DHr(e){const t=new Map;for(const r of e){const i=`${r.orientation}:${xU(r.crossPx)}`;const o=t.get(i);if(o){o.push(r);continue}t.set(i,[r])}const n=[];for(const r of t.values()){const i=[...new Set(r.flatMap(o=>[xU(o.startPx),xU(o.endPx)]))].sort((o,a)=>o-a).map(o=>o/1e3);for(let o=0;od.startPx<=a+.001&&d.endPx>=s-.001);if(l.length===0){continue}let u=l[0];if(!u){continue}for(let d=1;d{if(x==="horizontal"){if(w==="top"&&Math.abs(_-d)<=.01){return _+C/2}if(w==="bottom"&&Math.abs(_-m)<=.01){return _-C/2}return _}if(w==="left"&&Math.abs(_-u)<=.01){return _+C/2}if(w==="right"&&Math.abs(_-h)<=.01){return _-C/2}return _};for(const x of a.rows){for(const w of x.cells){const _=w.cell;const C=l[w.rowIndex]??i*ti;const A=r*ti+w.xEmu*ti;const P=w.widthEmu*ti;let L=0;for(let z=0;z{if(!UZ(K)){return}const X=L1e(K);const j=g(z,$,U,X);const te=MHr(z,U,W,H);const J=s.get(te);if(!J){s.set(te,{orientation:z,crossPx:j,startPx:W,endPx:H,widthPx:X,line:K});return}const oe=yGt(J.line,K);J.line=oe;J.widthPx=L1e(oe);J.crossPx=g(z,$,U,J.widthPx)};O("horizontal",C,A,I,"top",_.lines?.top);O("vertical",I,C,N,"right",_.lines?.right);O("horizontal",N,A,I,"bottom",_.lines?.bottom);O("vertical",A,C,N,"left",_.lines?.left)}}return DHr([...s.values()])}var z$e=1/ti;var FHr=24;var NHr=24;var _Gt="#000000";var B$e=1;var OHr=600;var V$e=1;var bGt=108;var D1e={left:QA(bGt),right:QA(bGt),top:0,bottom:0};function BHr(e){if(!e||e.length===0){return e}return e.map((t,n)=>{if(n!==0&&n!==e.length-1){return t}return{...t,...n===0?{spaceBefore:0}:{},...n===e.length-1?{spaceAfter:0}:{}}})}function xGt(e,t,n={}){const r=$$e(e.anchor)??1;return{bbox:t,paragraphs:n.collapseParagraphBoundarySpacing===false?e.paragraphs??[]:BHr(e.paragraphs)??[],textStyle:{...e.textStyle??{},anchor:r},levelsStyles:e.levelsStyles??[],type:1,effects:[],children:[],id:"",citations:[]}}function $$e(e){switch(e){case"b":case"bottom":return 3;case"ctr":case"center":case"middle":return 2;case"t":case"top":return 1;default:return void 0}}function zHr(e,t,n,r,i,o,a){const s=Math.round(t)+.5;const l=Math.round(n)+.5;const u=Math.round(t+r)+.5;const d=Math.round(n+i)+.5;e.strokeStyle=_Gt;e.lineWidth=1;e.beginPath();e.moveTo(s,l);e.lineTo(u,l);e.moveTo(s,l);e.lineTo(s,d);if(o){e.moveTo(u,l);e.lineTo(u,d)}if(a){e.moveTo(s,d);e.lineTo(u,d)}e.stroke()}function UHr(e,t,n){for(const r of n){e.strokeStyle=oo(r.line.fill?.color,t,_Gt);if(r.line.compound===2){VHr(e,r);continue}e.lineWidth=r.widthPx;TGt(e,r,r.crossPx)}}function TGt(e,t,n){e.save();FT(e,t.line.style,e.lineWidth);e.beginPath();if(t.orientation==="horizontal"){e.moveTo(t.startPx,n);e.lineTo(t.endPx,n)}else{e.moveTo(n,t.startPx);e.lineTo(n,t.endPx)}e.stroke();e.restore()}function VHr(e,t){const n=Math.max(.5,t.widthPx/3);const r=Math.max(1,t.widthPx*.55);e.lineWidth=n;for(const i of[t.crossPx-r,t.crossPx+r]){TGt(e,t,i)}}function $Hr(e){return e.type===1||e.type===2}function GHr(e,t){if(!t){return e.paragraphs?.[0]?.textStyle?.alignment}const n=e.paragraphs?.find(r=>r.id===t);return n?.textStyle?.alignment}function wGt(e){if(e.placement?.type!==V$e){return void 0}switch(e.placement.horizontalAlignment?.trim().toLowerCase()){case"center":return 2;case"right":return 3;case"left":return 1;default:return void 0}}function HHr(e,t){const n=t?e.paragraphs?.find(r=>r.id===t):e.paragraphs?.[0];if(!n){return false}for(const r of n.runs??[]){if((r.text??"").trim().length>0){return false}}return true}function WHr(e,t,n,r){if(e.placement?.type!==V$e){return void 0}const i=e.bbox?.widthEmu!==void 0?e.bbox.widthEmu*ti:void 0;const o=e.bbox?.heightEmu!==void 0?e.bbox.heightEmu*ti:void 0;if(i===void 0||o===void 0||i<=0||o<=0){return void 0}const a=n.xPx+r.left;const s=n.yPx+r.top;const l=Math.max(0,n.widthPx-r.left-r.right);const u=Math.max(0,n.heightPx-r.top-r.bottom);const d=e.placement.anchorParagraphId;const f=GHr(t,d);const h=f??wGt(e);const m=$$e(t.anchor);let g=a;if(h===2){g+=Math.max(0,(l-i)/2)}else if(h===3){g+=Math.max(0,l-i)}let x=s;if(m===2){x+=Math.max(0,(u-o)/2)}else if(m===3){x+=Math.max(0,u-o)}else if(f===2&&HHr(t,d)){x+=Math.max(0,(u-o)/2)}const w=a+Math.max(0,l-i);const _=s+Math.max(0,u-o);return{xPx:Math.min(Math.max(g,a),w),yPx:Math.min(Math.max(x,s),_),widthPx:i,heightPx:o}}function YHr(e,t,n,r){const i=WHr(e,t,n,r);if(i){return i}const o=e.bbox?.widthEmu!==void 0?e.bbox.widthEmu*ti:void 0;const a=e.bbox?.heightEmu!==void 0?e.bbox.heightEmu*ti:void 0;if(o===void 0||a===void 0||o<=0||a<=0){return void 0}return{xPx:n.xPx+(e.bbox?.xEmu??0)*ti,yPx:n.yPx+(e.bbox?.yEmu??0)*ti,widthPx:o,heightPx:a}}function qHr(e,t,n,r,i){const o=ed({...e,bbox:{...e.bbox,xEmu:0,yEmu:0,widthEmu:Math.max(1,r)*z$e,heightEmu:1e5*z$e}},t,n,void 0,{mode:"layout",paddingPx:{left:0,right:0,top:0,bottom:0},paragraphSpacingUnit:i.paragraphSpacingUnit,masterDefaults:i.masterDefaults,documentGridLinePitchTwips:i.documentGridLinePitchTwips});return Math.max(0,o?.height??0)}function XHr(e){const t=e.bbox?.widthEmu!==void 0?e.bbox.widthEmu*ti:void 0;const n=e.bbox?.heightEmu!==void 0?e.bbox.heightEmu*ti:void 0;if(t===void 0||n===void 0||t<=0||n<=0){return void 0}return{widthPx:t,heightPx:n}}function EGt(e,t,n,r,i,o){const a=U$e(e,n);const s=t.xPx+a.left;const l=t.yPx+a.top;const u=Math.max(0,t.widthPx-a.left-a.right);let d=l;let f=l;const h=[];const m=[];const g=(e.paragraphs?.length??0)===0;for(const A of e.elements??[]){if($Hr(A)){if(!g){continue}const L=A.bbox?.widthEmu!==void 0&&A.bbox.widthEmu>0?Math.min(u,A.bbox.widthEmu*ti):u;const I=qHr(A,r,i,L,o);h.push({element:A,xPx:s,yPx:d,widthPx:L,heightPx:I});m.push(h.length-1);d+=I;f=Math.max(f,d);continue}if(A.placement?.type===V$e){const L=XHr(A);if(!L){continue}const I=bU(A);const N=wGt(A);let O=s;if(N===2){O+=Math.max(0,(u-L.widthPx)/2)}else if(N===3){O+=Math.max(0,u-L.widthPx)}h.push({element:A,xPx:O,yPx:d+I.topPx,widthPx:L.widthPx,heightPx:L.heightPx});m.push(h.length-1);d+=I.topPx+L.heightPx+I.bottomPx;f=Math.max(f,d);continue}const P=YHr(A,e,t,a);if(!P){continue}h.push({element:A,...P});f=Math.max(f,P.yPx+P.heightPx)}const x=Math.max(0,d-l);const w=Math.max(0,t.heightPx-a.top-a.bottom);const _=$$e(e.anchor);let C=0;if(m.length>0&&w>x&&_===2){C=(w-x)/2}else if(m.length>0&&w>x&&_===3){C=w-x}if(C>0){for(const A of m){const P=h[A];if(P){h[A]={...P,yPx:P.yPx+C}}}f=h.reduce((A,P)=>Math.max(A,P.yPx+P.heightPx),l)}return{heightPx:Math.max(0,f-t.yPx+a.bottom),frames:h}}function jHr(e,t,n,r,i,o){return EGt(e,t,i,n,r,o).heightPx}function U$e(e,t){return{left:e.marginLeft!==void 0?e.marginLeft*ti:t.left,right:e.marginRight!==void 0?e.marginRight*ti:t.right,top:e.marginTop!==void 0?e.marginTop*ti:t.top,bottom:e.marginBottom!==void 0?e.marginBottom*ti:t.bottom}}function KHr(e){const t=e.properties?.cellMargins;return{left:t?.left===void 0?D1e.left:t.left*ti,right:t?.right===void 0?D1e.right:t.right*ti,top:t?.top===void 0?D1e.top:t.top*ti,bottom:t?.bottom===void 0?D1e.bottom:t.bottom*ti}}function ZHr(e,t,n){let r=0;for(let i=0;i1){g.push({rowIndex:z,rowSpan:X.rowSpan,requiredHeightPx:ce})}else{m[z]=Math.max(m[z]??0,ce)}}let W=0;if(U.heightEmu!==void 0&&U.heightEmu>0){W=U.heightEmu*ti}const H=W>0;let $;if(!H){$=Math.max(f,m[z]??0)}else if(d==="atLeast"){$=Math.max(W,m[z]??0)}else{$=W}const K=Math.max(B$e,$);h[z]=K}for(let O=0;O=O.requiredHeightPx){continue}const U=O.requiredHeightPx-z;const W=new Array(O.rowSpan).fill(0).map(($,K)=>O.rowIndex+K).filter($=>$=O.requiredHeightPx){continue}const U=O.requiredHeightPx-z;for(let W=O.rowSpan-1;W>=0;W-=1){const H=O.rowIndex+W;const $=e.table.rows[H];if($===void 0){continue}if($.heightEmu!==void 0&&$.heightEmu>0){continue}const K=h[H];if(K===void 0){throw new Error(`Missing table row height at index ${H}.`)}h[H]=K+U;break}}}const x=O$e(e,h,{fitColumnWidthsToFrame:r.fitColumnWidthsToFrame});const w=x.length>0;const _=h.map(O=>Math.max(1,O*z$e));t.save();const C=e.table.properties?.fill??r.backgroundFill;if(C){const O=s.xEmu*ti;const z=s.yEmu*ti;const U=s.widthEmu*ti;const W=h.reduce((H,$)=>H+$,0);t.fillStyle=Uc(t,{x:O,y:z,width:U,height:W},C,n,"transparent");t.fillRect(O,z,U,W)}const A=[];let P=s.yEmu;const L=[];const I=[];const N=[];for(const O of l.rows){const z=O.rowIndex;const U=e.table.rows[z];if(!U)continue;const W=_[z]||0;const H=W;A.push(H*ti);for(const $ of O.cells){const K=$.cell;const X=$.columnIndex;const j=s.xEmu+$.xEmu;const te=$.widthEmu;const J=ZHr(_,z,$.rowSpan);const oe=U$e(K,a);const se=xGt(K,{xEmu:j,yEmu:P,widthEmu:te,heightEmu:J},{collapseParagraphBoundarySpacing:r.collapseParagraphBoundarySpacing});const re=T1(se.textStyle??{},r?.resolvedStyle);const ce=j*ti;const ue=P*ti;const xe=te*ti;const be=J*ti;t.fillStyle=Uc(t,{x:ce,y:ue,width:xe,height:be},K.fill,n,"transparent");t.fillRect(ce,ue,xe,be);const Ie=ed(se,t,n,void 0,{resolvedStyle:re,paddingPx:oe,paragraphSpacingUnit:r?.paragraphSpacingUnit,masterDefaults:r?.masterDefaults,documentGridLinePitchTwips:r?.documentGridLinePitchTwips});if(Ie){N.push({row:z,col:X,cellId:K.id,xPx:ce,yPx:ue,widthPx:xe,heightPx:be,block:Ie})}for(const he of EGt(K,{xPx:ce,yPx:ue,widthPx:xe,heightPx:be},a,t,n,r).frames){const ve=he.element;I.push({row:z,col:X,elementId:ve.id??"",xPx:he.xPx,yPx:he.yPx,widthPx:he.widthPx,heightPx:he.heightPx});r.drawCellElement?.(ve,{xPx:he.xPx,yPx:he.yPx,widthPx:he.widthPx,heightPx:he.heightPx})}if(!w&&o){zHr(t,ce,ue,xe,be,X+$.columnSpan>=u,z+$.rowSpan>=e.table.rows.length)}L.push({row:z,col:X,xPx:ce,yPx:ue,widthPx:xe,heightPx:be})}P+=H}if(w){UHr(t,n,x)}t.restore();return{cellRects:L,cellElementFrames:I,cellLayouts:N,rowHeightsPx:A,heightPx:(P-s.yEmu)*ti}}var F1e=new Map;var CGt=new WeakMap;function G$e(e){if(e.buffer instanceof ArrayBuffer){return e}const t=new Uint8Array(e.byteLength);t.set(e);return t}function JHr(e,t,n){if(/\bwidth\s*=|\bheight\s*=/.test(e)){return new Blob([e],{type:"image/svg+xml"})}const r=e.replace(/]*)>/,``);return new Blob([r],{type:"image/svg+xml"})}function QHr(){const e=globalThis.devicePixelRatio;return typeof e==="number"&&Number.isFinite(e)&&e>0?e:1}function eWr(){const e=globalThis.Image;if(e){return e}return void 0}async function tWr(e,t){const n=eWr();if(!n||typeof URL==="undefined"||typeof URL.createObjectURL!=="function"){return void 0}const r=URL.createObjectURL(e);try{const i=new n;if(typeof i.decode==="function"){i.src=r;await i.decode()}else{const o=new Promise((a,s)=>{i.onload=()=>a();i.onerror=()=>s(new Error("Failed to decode SVG image payload."))});i.src=r;await o}return await createImageBitmap(i,t)}finally{if(typeof URL.revokeObjectURL==="function"){URL.revokeObjectURL(r)}}}async function nWr(e,t){try{const n=await tWr(e,t);if(n){return n}}catch{}return createImageBitmap(e,t)}async function vU(e,t,n){const r=`${e.data.byteLength}_${e.contentType}`;if(Jv(e.contentType)){const a={targetWidth:t,targetHeight:n,devicePixelRatio:NN()};const s=`${e.contentType}_${n9(a)}`;let l=CGt.get(e.data);const u=l?.get(s);if(u)return u;const d=Dj(e.contentType,e.data,a).then(f=>{if(!f){throw new Error(`Unsupported image content type "${e.contentType}"`)}return f});l??=new Map;l.set(s,d);CGt.set(e.data,l);try{return await d}catch(f){if(l.get(s)===d){l.delete(s)}throw f}}const i=r;const o=F1e.get(i);if(o)return o;if(Oye(e.contentType)){const a=Dj(e.contentType,e.data).then(s=>{if(!s){throw new Error(`Unsupported image content type "${e.contentType}"`)}return s});F1e.set(i,a);return a}if(e.contentType==="image/svg+xml"){const a=Math.round(t??1);const s=Math.round(n??1);const l=QHr();const u=JHr(new TextDecoder().decode(e.data),a,s);const d=nWr(u,{resizeWidth:a*l,resizeHeight:s*l});F1e.set(i,d);return d}else{const a=new Blob([G$e(e.data)],{type:e.contentType});const s=createImageBitmap(a);F1e.set(i,s);return s}}function SGt(e,t,n,r){const i=Math.max(0,Math.min(r,t/2,n/2));e.beginPath();e.moveTo(i,0);e.lineTo(t-i,0);e.quadraticCurveTo(t,0,t,i);e.lineTo(t,n-i);e.quadraticCurveTo(t,n,t-i,n);e.lineTo(i,n);e.quadraticCurveTo(0,n,0,n-i);e.lineTo(0,i);e.quadraticCurveTo(0,0,i,0);e.closePath()}async function AGt(e,t,n,r,i,o){const a=n.background?.fill;const s=a?.isSet?Uc(e,{x:0,y:0,width:r,height:i},a,t,n.fallbackColor):n.fallbackColor;e.save();e.globalAlpha=1;e.globalCompositeOperation="source-over";if((o?.clipRadiusPx??0)>0){SGt(e,r,i,o?.clipRadiusPx??0);e.clip()}e.fillStyle=n.baseColor;e.fillRect(0,0,r,i);e.fillStyle=s;e.fillRect(0,0,r,i);e.restore();const l=n.backgroundImage;if(l){const{image:u}=l;const d=l.background;const f=await u.getBitmap(r,i);if(!f)return;e.save();if((o?.clipRadiusPx??0)>0){SGt(e,r,i,o?.clipRadiusPx??0);e.clip()}const h=O=>(O??0)/1e5;let m=0,g=0,x=f.width,w=f.height;const _=d?.fill?.srcRect;if(_){const O=h(_.l);const z=h(_.t);const U=h(_.r);const W=h(_.b);m+=O*f.width;g+=z*f.height;x-=(O+U)*f.width;w-=(z+W)*f.height}let C=0,A=0,P=r,L=i;const I=d?.fill?.stretchFillRect;if(I){const O=h(I.l);const z=h(I.t);const U=h(I.r);const W=h(I.b);C=O*r;A=z*i;P=r*(1-O-U);L=i*(1-z-W)}const N=rk(f,{pictureEffects:d?.fill?.pictureEffects,contentType:u.contentType,themeMap:t});e.globalAlpha*=N.opacity;e.drawImage(N.source,m,g,x,w,C,A,P,L);e.restore()}}Yl();function IGt(e,t,n,r,i,o,a,s,l,u,d,f,h,m,g){const x=t.charts.items;if(x.length===0)return;const w=iWr(n);for(const _ of x){const C=_.toDrawingProto({preferPreview:true});if(!C.chart||!C.fromAnchor)continue;rWr(C.chart,t,w);const A=_.resolveBoundsPx({columnOffsets:r,rowOffsets:i},{preferPreview:true});if(!A)continue;const P=Nl+A.x-o;const L=Ol+A.y-a;const I=P+A.width;const N=L+A.height;if(I<0||N<0||P>s||L>l)continue;const O={x:P,y:L,width:A.width,height:A.height};if(O.width<=0||O.height<=0)continue;e.save();e.beginPath();e.rect(O.x,O.y,O.width,O.height);e.clip();iM(e,C.chart,O,{themeMap:u,excelDefaults:true,textLayoutCollector:f,chartHoverTargets:h,elementId:C.chart?.id??void 0,titleBlockId:C.chart?.id?`chartTitle:${C.chart.id}`:void 0,mapCtx:m??void 0,onMapViewport:g});e.restore()}}function rWr(e,t,n){if(!e||!Array.isArray(e.series))return;for(const r of e.series){if(!r)continue;if(r.formula){const i=kGt(r.formula,n,t);if(i.length>0){r.values=i}}if(r.xFormula){const i=kGt(r.xFormula,n,t);if(i.length>0){r.xValues=i}}if(r.categoryFormula){const i=RGt(r.categoryFormula,n,t);if(i.length>0){r.categories=i}}}if(e.categories.length===0){const r=e.series.find(i=>i.categories.length>0)?.categories??(()=>{const i=e.series[0]?.categoryFormula;return i?RGt(i,n,t):[]})();if(r.length>0){e.categories=[...r]}}}function iWr(e){const t=new Map;for(const n of e.sheets){const r=MGt(n?.name);if(r){t.set(r,n)}}return t}function MGt(e){if(!e)return null;const t=e.trim();if(!t)return null;return t.toLowerCase()}function kGt(e,t,n){return LGt(e,t,n,r=>{if(!r||r.value==null||r.value==="")return Number.NaN;if(typeof r.value==="number")return r.value;if(typeof r.value==="string"){const i=r.value.trim();if(!i)return Number.NaN;const o=Number(i);return Number.isFinite(o)?o:Number.NaN}return Number.NaN})}function RGt(e,t,n){return LGt(e,t,n,r=>{if(!r||r.value==null)return"";if(typeof r.value==="string")return r.value;if(typeof r.value==="number")return String(r.value);return""})}function LGt(e,t,n,r){const i=oWr(e);if(!i)return[];const o=sWr(t,i.sheetName,n);const a=[];for(let s=i.startRow;s<=i.endRow;s++){for(let l=i.startCol;l<=i.endCol;l++){a.push(r(lWr(o,s,l)))}}return a}function oWr(e){if(!e)return null;let t=e.trim();if(!t)return null;if(t.startsWith("="))t=t.slice(1);if(!t)return null;const[n]=t.split(",");if(!n)return null;let r;let i=n;const o=n.lastIndexOf("!");if(o!==-1){r=n.slice(0,o);i=n.slice(o+1)}i=i.trim();if(!i)return null;const a=i.indexOf(":");const s=a===-1?i:i.slice(0,a);const l=a===-1?i:i.slice(a+1);const u=PGt(s);const d=PGt(l);if(!u||!d)return null;return{sheetName:aWr(r),startRow:Math.min(u.row,d.row),endRow:Math.max(u.row,d.row),startCol:Math.min(u.col,d.col),endCol:Math.max(u.col,d.col)}}function PGt(e){if(!e)return null;const t=e.replace(/\$/g,"").trim();if(!t)return null;const n=t.match(/^([A-Za-z]+)(\d+)$/);if(!n)return null;const[,r,i]=n;if(!r||!i)return null;const o=r.toUpperCase();const a=Number.parseInt(i,10);if(!Number.isFinite(a))return null;const s=ps(o);const l=a-1;if(s<0||l<0)return null;return{row:l,col:s}}function aWr(e){if(!e)return void 0;let t=e.trim();if(!t)return void 0;if(t.startsWith("'")&&t.endsWith("'")){t=t.slice(1,-1).replace(/''/g,"'")}const n=t.indexOf("[");const r=t.lastIndexOf("]");if(n!==-1&&r>n){t=t.slice(r+1)}return t}function sWr(e,t,n){if(t){const r=MGt(t);if(r){const i=e.get(r);if(i)return i}}return n}function lWr(e,t,n){return e.__getCell(t,n)}Yl();var cWr="#4f81bd";var uWr="#666666";var N1e=2;var dWr=2;var fWr=(e,t,n)=>Math.min(Math.max(e,t),n);var oM=(e,t,n)=>{if(!e)return n;try{return oo(e,t,n)}catch{return n}};function DGt(e,t,n,r,i,o,a,s,l){if(!t||t.length===0)return;for(const u of t){const d=n[u.col];const f=n[u.col+1];const h=r[u.row];const m=r[u.row+1];if(d===void 0||f===void 0||h===void 0||m===void 0){continue}const g=Nl+d-i;const x=Ol+h-o;const w=f-d;const _=m-h;const C=g+w;const A=x+_;if(C<0||A<0||g>a||x>s){continue}if(w<=0||_<=0)continue;hWr(e,u,{x:g,y:x,width:w,height:_},l)}}function hWr(e,t,n,r){const i=n.x+N1e;const o=n.y+N1e;const a=n.width-N1e*2;const s=n.height-N1e*2;if(a<=0||s<=0)return;const l=t.values;if(l.length===0)return;const u=t.domain.min;const d=t.domain.max;if(!Number.isFinite(u)||!Number.isFinite(d)){return}const f=d-u;if(!Number.isFinite(f)||f===0){return}const h=oM(t.colors.series,r,cWr);const m=oM(t.colors.negative,r,h);const g=oM(t.colors.axis,r,uWr);const x=oM(t.colors.markers,r,h);const w=oM(t.colors.first,r,x);const _=oM(t.colors.last,r,x);const C=oM(t.colors.high,r,x);const A=oM(t.colors.low,r,x);const P=I=>o+s-(I-u)/f*s;const L=fWr(P(0),o,o+s);switch(t.type){case"column":case"stacked":mWr(e,t,{plotX:i,plotY:o,plotW:a,plotH:s,baseline:L},{seriesColor:h,negativeColor:m,axisColor:g},P);break;default:pWr(e,t,{plotX:i,plotY:o,plotW:a,plotH:s,baseline:L},{seriesColor:h,negativeColor:m,axisColor:g,markersColor:x,firstMarkerColor:w,lastMarkerColor:_,highMarkerColor:C,lowMarkerColor:A},P)}}function pWr(e,t,n,r,i){const{plotX:o,plotW:a}=n;const s=t.values.length;const l=s>1?a/(s-1):a;const u=h=>{const m=t.rightToLeft?s-1-h:h;return o+m*l};e.save();e.lineWidth=t.lineWeight??1;e.strokeStyle=r.seriesColor;e.lineJoin="round";e.beginPath();let d=false;t.values.forEach((h,m)=>{if(h===null||!Number.isFinite(h)){if(!t.connectGaps&&d){e.stroke();e.beginPath();d=false}return}const g=u(m);const x=i(h);if(!d){e.moveTo(g,x);d=true}else{e.lineTo(g,x)}});if(d){e.stroke()}e.restore();if(t.showAxis){e.save();e.strokeStyle=r.axisColor;e.lineWidth=.5;e.beginPath();e.moveTo(o,n.baseline);e.lineTo(o+n.plotW,n.baseline);e.stroke();e.restore()}const f=t.markers.show||t.markers.high||t.markers.low||t.markers.first||t.markers.last||t.markers.negative;if(!f){return}t.values.forEach((h,m)=>{if(h===null||!Number.isFinite(h)){return}const g=u(m);const x=i(h);const w=gWr(m,h,t,r,t.pointMeta);if(!w)return;e.save();e.fillStyle=w;e.beginPath();e.arc(g,x,dWr,0,Math.PI*2);e.fill();e.restore()})}function mWr(e,t,n,r,i){const o=t.values.length;if(o===0)return;const a=n.plotW/Math.max(1,o);const s=Math.min(2,a*.25);const l=d=>{const f=t.rightToLeft?o-1-d:d;return n.plotX+f*a+s/2};const u=Math.max(1,a-s);t.values.forEach((d,f)=>{if(d===null||!Number.isFinite(d)){return}const h=t.type==="stacked"?Math.max(-1,Math.min(1,Math.sign(d))):d;const m=l(f);const g=i(h);const x=Math.min(g,n.baseline);const w=Math.abs(n.baseline-g);const _=h<0?r.negativeColor:r.seriesColor;e.save();e.fillStyle=_;e.fillRect(m,x,u,Math.max(1,w));e.restore()});if(t.showAxis){e.save();e.strokeStyle=r.axisColor;e.lineWidth=.5;e.beginPath();e.moveTo(n.plotX,n.baseline);e.lineTo(n.plotX+n.plotW,n.baseline);e.stroke();e.restore()}}function gWr(e,t,n,r,i){if(!Number.isFinite(t)){return null}if(n.markers.first&&i.firstIndex===e&&r.firstMarkerColor){return r.firstMarkerColor}if(n.markers.last&&i.lastIndex===e&&r.lastMarkerColor){return r.lastMarkerColor}if(n.markers.high&&i.highIndices.has(e)&&r.highMarkerColor){return r.highMarkerColor}if(n.markers.low&&i.lowIndices.has(e)&&r.lowMarkerColor){return r.lowMarkerColor}if(n.markers.negative&&i.negativeIndices.has(e)){return r.negativeColor}return r.markersColor??r.seriesColor}Yl();function yWr(e){const{worksheet:t,rowHeights:n,colWidths:r,rowIndexRemap:i}=e;const o=new Set;for(const u of t.__getRows()){const d=u.hidden===true;if(d)o.add(u.index-1)}const a=[];if(o.size>0&&n.length>1){const u=n.length;const d=new Array(u);for(let m=0;m0&&r.length>1){const u=r.length;let d=null;for(let f=0;f90){continue}t=t*26+(i-64)}return t}function xWr(e){let t=Math.max(1,e);let n="";while(t>0){const r=(t-1)%26;n=String.fromCharCode(65+r)+n;t=Math.floor((t-1)/26)}return n}function BGt(e,t,n){const r=e.startsWith("$");const i=r?1:0;let o=i;while(o{const m=d?String(d):"";const g=BGt(String(f),s,l);if(!h){return`${m}${g}`}return`${m}${g}:${BGt(String(h),s,l)}`})}function $O(e,t,n){e.save();if(n)e.strokeStyle=n;e.lineWidth=1;e.setLineDash([]);switch(t){case"thin":e.lineWidth=1;break;case"medium":e.lineWidth=2;break;case"thick":e.lineWidth=3;break;case"dashed":case"mediumDashed":e.lineWidth=t==="mediumDashed"?2:1;e.setLineDash([6,3]);break;case"dashDot":e.setLineDash([6,3,1,3]);break;case"dashDotDot":e.setLineDash([6,3,1,3,1,3]);break;case"slantDashDot":e.setLineDash([]);break;case"double":break;default:e.lineWidth=1;break}}var vWr=16;var _Wr=2;function UGt({cell:e,isCheckbox:t,x:n,y:r,w:i,h:o,zoom:a}){if(!t)return null;const s=Math.max(0,Math.min(i,o));const l=Math.min(vWr,s);if(l<=0)return null;const u=n+(i-l)/2;const d=r+(o-l)/2;const f=e.dataType===4&&(e.value==="1"||e.value==="TRUE");return{checked:f,boxRect:{x:u,y:d,size:l},cssBounds:{x:u*a,y:d*a,width:l*a,height:l*a}}}function VGt(e,t,{accentColor:n,darkMode:r}){const{x:i,y:o,size:a}=t.boxRect;const s=r?"#E5E7EB":"#6B7280";const l=r?"#0F172A":"#FFFFFF";const u=n??(r?"#93C5FD":"#2563EB");const d=Math.max(1,Math.round(a*.08));e.save();e.lineWidth=d;e.strokeStyle=s;e.fillStyle=l;e.beginPath();TWr(e,i,o,a,a,_Wr);e.fill();e.stroke();if(t.checked){e.lineWidth=Math.max(d,Math.round(a*.12));e.strokeStyle=u;e.lineCap="round";e.lineJoin="round";e.beginPath();e.moveTo(i+a*.2,o+a*.55);e.lineTo(i+a*.45,o+a*.75);e.lineTo(i+a*.8,o+a*.28);e.stroke()}e.restore()}function TWr(e,t,n,r,i,o){const a=Math.max(0,Math.min(o,Math.min(r,i)/2));e.moveTo(t+a,n);e.arcTo(t+r,n,t+r,n+i,a);e.arcTo(t+r,n+i,t,n+i,a);e.arcTo(t,n+i,t,n,a);e.arcTo(t,n,t+r,n,a);e.closePath()}var c_="#4CAF50";var rC="#2E7D32";var Jb="#F4C542";var F0="#B88700";var HGt="#F28C38";var WGt="#B85A00";var iC="#D64541";var aM="#8D2B2A";var wWr="#3F83F8";var EWr="#1D4ED8";var GO="#2F2F2F";var H$e="#FAFAFA";function YGt(e){const t=jz(e.iconSetName);if(!t){return null}const n=Math.max(0,e.width-4);const r=Math.max(0,e.height-4);if(n<=0||r<=0){return null}const i=Math.max(8,e.fontSizePx*.96);const o=Math.min(r,i);const a=Math.min(n,o*t.slotAspectRatio);if(a<=0||o<=0){return null}const s=e.showValue?Math.max(2,Math.min(6,o*.22)):0;const l=Math.max(2,Math.min(6,e.fontSizePx*.18));const u=e.showValue?e.x+l:e.x+(e.width-a)/2;const d=e.y+(e.height-o)/2;return{x:u,y:d,width:a,height:o,reservedWidth:e.showValue?l+a+s:0}}function qGt(e,t){const n=jz(t.iconSetName);if(!n){return}const r=Math.max(0,Math.min(n.iconCount-1,Math.round(t.iconIndex)));e.save();switch(n.name){case"3Arrows":case"3ArrowsGray":case"4Arrows":case"4ArrowsGray":case"5Arrows":case"5ArrowsGray":CWr(e,n.name,r,t);break;case"3Triangles":SWr(e,r,t);break;case"3TrafficLights1":case"3TrafficLights2":case"4TrafficLights":AWr(e,n.name,r,t);break;case"3Signs":kWr(e,r,t);break;case"4RedToBlack":RWr(e,r,t);break;case"3Symbols":$Gt(e,"symbols",r,t);break;case"3Symbols2":$Gt(e,"symbols2",r,t);break;case"3Flags":PWr(e,r,t);break;case"3Stars":IWr(e,r,t);break;case"5Quarters":MWr(e,r,t);break;case"5Boxes":LWr(e,r,t);break;case"4Rating":GGt(e,4,r+1,t);break;case"5Rating":GGt(e,4,r,t);break}e.restore()}function CWr(e,t,n,r){const i=t.includes("Gray");const o=i?["#D7DCE3","#B6BEC8","#8F98A3","#697380","#47505C"]:t==="5Arrows"?[iC,HGt,Jb,Jb,c_]:t==="4Arrows"?[iC,Jb,"#93C54B",c_]:[iC,Jb,c_];const a=i?["#9EA7B2","#7F8995","#5F6875","#434B57","#2F3640"]:t==="5Arrows"?[aM,WGt,F0,F0,rC]:t==="4Arrows"?[aM,F0,"#5E8D2A",rC]:[aM,F0,rC];const s=t==="4Arrows"||t==="4ArrowsGray"?["down","diagDown","diagUp","up"]:t==="5Arrows"||t==="5ArrowsGray"?["down","diagDown","right","diagUp","up"]:["down","right","up"];const l=s[n]??"right";DWr(e,r,l,o[n]??o[o.length-1]??c_,a[n]??a[a.length-1]??rC)}function SWr(e,t,n){if(t===1){const r=n.width*.72;const i=n.height*.3;const o=n.x+(n.width-r)/2;const a=n.y+(n.height-i)/2;e.fillStyle=Jb;e.fillRect(o,a,r,i);e.lineWidth=Math.max(1,Math.min(r,i)*.14);e.strokeStyle=F0;e.strokeRect(o,a,r,i);return}XGt(e,n,t===0?"down":"up",t===0?iC:c_,t===0?aM:rC)}function AWr(e,t,n,r){const i=t==="4TrafficLights"?[iC,HGt,Jb,c_]:[iC,Jb,c_];const o=i[n]??Jb;const a=t==="4TrafficLights"&&n===1?WGt:n===0?aM:n===i.length-1?rC:F0;const s=t!=="3TrafficLights1";const l=r.x+r.width/2;const u=r.y+r.height/2;const d=Math.min(r.width,r.height)*.34;if(s){e.beginPath();e.arc(l,u,d*1.18,0,Math.PI*2);e.fillStyle="rgba(17, 24, 39, 0.1)";e.fill();e.lineWidth=Math.max(1,d*.22);e.strokeStyle=GO;e.stroke()}e.beginPath();e.arc(l,u,d,0,Math.PI*2);e.fillStyle=o;e.fill();e.lineWidth=Math.max(1,d*.12);e.strokeStyle=a;e.stroke();e.beginPath();e.arc(l-d*.22,u-d*.22,d*.3,0,Math.PI*2);e.fillStyle="rgba(255,255,255,0.28)";e.fill()}function kWr(e,t,n){if(t===2){FWr(e,n,c_,rC);return}if(t===1){XGt(e,n,"up",Jb,F0);return}jGt(e,n,iC,aM)}function RWr(e,t,n){const r=["#E05555","#B91C1C","#5B4C4C",GO];const i=["#8D2B2A","#7F1D1D","#3F3A3A","#111111"];jGt(e,n,r[t]??GO,i[t]??GO)}function $Gt(e,t,n,r){const i=r.x+r.width/2;const o=r.y+r.height/2;const a=Math.min(r.width,r.height)*(t==="symbols2"?.52:.42);const s=[iC,F0,c_];if(t!=="symbols2"){const l=[iC,Jb,c_];const u=[aM,F0,rC];e.beginPath();e.arc(i,o,a,0,Math.PI*2);e.fillStyle=l[n]??Jb;e.fill();e.lineWidth=Math.max(1,a*.12);e.strokeStyle=u[n]??F0;e.stroke()}e.strokeStyle=t==="symbols2"?s[n]??F0:H$e;e.fillStyle=t==="symbols2"?s[n]??F0:H$e;e.lineWidth=Math.max(1.2,a*(t==="symbols2"?.24:.18));e.lineCap="round";e.lineJoin="round";if(n===2){e.beginPath();e.moveTo(i-a*.52,o+a*.04);e.lineTo(i-a*.16,o+a*.4);e.lineTo(i+a*.54,o-a*.36);e.stroke();return}if(n===1){e.beginPath();e.moveTo(i,o-a*.52);e.lineTo(i,o+a*.16);e.stroke();e.beginPath();e.arc(i,o+a*.42,a*.1,0,Math.PI*2);e.fill();return}if(t==="symbols2"){e.beginPath();e.moveTo(i-a*.42,o-a*.42);e.lineTo(i+a*.42,o+a*.42);e.moveTo(i+a*.42,o-a*.42);e.lineTo(i-a*.42,o+a*.42);e.stroke();return}e.beginPath();e.moveTo(i-a*.28,o-a*.28);e.lineTo(i+a*.28,o+a*.28);e.moveTo(i+a*.28,o-a*.28);e.lineTo(i-a*.28,o+a*.28);e.stroke()}function PWr(e,t,n){const r=[iC,Jb,c_];const i=[aM,F0,rC];const o=n.x+n.width*.26;const a=n.y+n.height*.14;const s=n.y+n.height*.86;e.lineWidth=Math.max(1,n.width*.07);e.strokeStyle="#4B5563";e.beginPath();e.moveTo(o,a);e.lineTo(o,s);e.stroke();e.beginPath();e.moveTo(o,a+n.height*.03);e.lineTo(n.x+n.width*.82,n.y+n.height*.24);e.lineTo(o,n.y+n.height*.46);e.closePath();e.fillStyle=r[t]??Jb;e.fill();e.lineWidth=Math.max(1,n.width*.06);e.strokeStyle=i[t]??F0;e.stroke()}function IWr(e,t,n){const r=[0,.5,1];const i=r[t]??0;z1e(e,n,()=>{B1e(e);e.fillStyle="rgba(203, 213, 225, 0.65)";e.fill();B1e(e);e.lineWidth=.08;e.strokeStyle="rgba(107, 114, 128, 0.75)";e.lineJoin="round";e.stroke();if(i>0){e.save();e.beginPath();e.rect(0,0,i,1);e.clip();B1e(e);e.fillStyle=Jb;e.fill();B1e(e);e.lineWidth=.08;e.strokeStyle=F0;e.lineJoin="round";e.stroke();e.restore()}})}function MWr(e,t,n){const r=n.x+n.width/2;const i=n.y+n.height/2;const o=Math.min(n.width,n.height)*.42;const a=[0,.25,.5,.75,1][t]??0;e.beginPath();e.arc(r,i,o,0,Math.PI*2);e.fillStyle=H$e;e.fill();if(a>=1){e.beginPath();e.arc(r,i,o,0,Math.PI*2);e.fillStyle=GO;e.fill()}else if(a>0){e.beginPath();e.moveTo(r,i);e.arc(r,i,o,-Math.PI/2,-Math.PI/2+Math.PI*2*a);e.closePath();e.fillStyle=GO;e.fill()}e.lineWidth=Math.max(1,o*.12);e.strokeStyle=GO;e.beginPath();e.arc(r,i,o,0,Math.PI*2);e.stroke()}function LWr(e,t,n){const r=[[false,false,false,false],[false,false,true,false],[false,false,true,true],[true,false,true,true],[true,true,true,true]];const i=r[t]??r[0]??[false,false,false,false];const o=1;const a=Math.min((n.width-o)/2,(n.height-o)/2);const s=a*2+o;const l=a*2+o;const u=n.x+(n.width-s)/2;const d=n.y+(n.height-l)/2;const f=[{x:u,y:d},{x:u+a+o,y:d},{x:u,y:d+a+o},{x:u+a+o,y:d+a+o}];for(let h=0;h1?2:0;const o=(r.width-i*(t-1))/t;for(let a=0;a{OWr(e,n);e.beginPath();e.moveTo(.5,.06);e.lineTo(.9,.46);e.lineTo(.68,.46);e.lineTo(.68,.94);e.lineTo(.32,.94);e.lineTo(.32,.46);e.lineTo(.1,.46);e.closePath();e.fillStyle=r;e.fill();e.lineWidth=.08;e.strokeStyle=i;e.lineJoin="round";e.stroke()})}function XGt(e,t,n,r,i){z1e(e,t,()=>{if(n==="down"){e.translate(.5,.5);e.rotate(Math.PI);e.translate(-.5,-.5)}else if(n==="right"){e.translate(.5,.5);e.rotate(Math.PI/2);e.translate(-.5,-.5)}e.beginPath();e.moveTo(.5,.08);e.lineTo(.9,.84);e.lineTo(.1,.84);e.closePath();e.fillStyle=r;e.fill();e.lineWidth=.08;e.strokeStyle=i;e.lineJoin="round";e.stroke()})}function FWr(e,t,n,r){z1e(e,t,()=>{e.beginPath();e.moveTo(.5,.05);e.lineTo(.94,.5);e.lineTo(.5,.95);e.lineTo(.06,.5);e.closePath();e.fillStyle=n;e.fill();e.lineWidth=.08;e.strokeStyle=r;e.stroke()})}function jGt(e,t,n,r){const i=t.x+t.width/2;const o=t.y+t.height/2;const a=Math.min(t.width,t.height)*.42;e.beginPath();e.arc(i,o,a,0,Math.PI*2);e.fillStyle=n;e.fill();e.lineWidth=Math.max(1,a*.12);e.strokeStyle=r;e.stroke()}function NWr(e,t,n,r,i,o){const a=Math.max(0,Math.min(o,Math.min(r,i)/2));e.beginPath();e.moveTo(t+a,n);e.arcTo(t+r,n,t+r,n+i,a);e.arcTo(t+r,n+i,t,n+i,a);e.arcTo(t,n+i,t,n,a);e.arcTo(t,n,t+r,n,a);e.closePath()}function z1e(e,t,n){e.save();e.translate(t.x,t.y);e.scale(t.width,t.height);n();e.restore()}function B1e(e){const t=5;const n=.46;const r=.2;e.beginPath();for(let i=0;i{KGt.set(r,a);return a}).catch(()=>{return void 0}).finally(()=>{W$e.delete(r)});W$e.set(r,o)}return void 0}function zWr(e){const t=atob(e);const n=new Uint8Array(t.length);for(let r=0;ro.id===t);if(!r)return null;const i=typeof r.data==="string"?zWr(r.data):r.data;return{id:r.id,contentType:r.contentType,data:i}}function QGt(e,t,n,r,i,o,a,s,l,u,d=1){const f=t.images.items;if(f.length===0)return;for(const h of f){const m=h.toDrawingProto({preferPreview:true});const g=m.imageReference?.id;if(!g)continue;const x=h.resolveBoundsPx({columnOffsets:r,rowOffsets:i},{preferPreview:true});if(!x)continue;const w=Nl+x.x-o;const _=Ol+x.y-a;let C=x.width;let A=x.height;u?.({id:h.id,logicalBounds:{x:w,y:_,width:C,height:A},cssBounds:{x:w*d,y:_*d,width:C*d,height:A*d},drawing:m,usesTwoCellAnchor:Boolean(m.toAnchor)});if(C<=0||A<=0){const N=m.fromAnchor;if(!N)continue;const O=Number(N.colId);const z=Number(N.rowId);const U=r[O]??0;const W=r[O+1]??U;const H=i[z-1]??0;const $=i[z]??H;const K=Math.max(0,W-U);const X=Math.max(0,$-H);const j=JGt(n,g);if(!j)continue;const te=Jv(j.contentType);const J=te?ZGt(j,K,X):U1e.get(j.id);if(!J){if(!te&&!V1e.has(j.id)){const xe=vU(j,s,l).then(be=>{U1e.set(j.id,be);return be});V1e.set(j.id,xe)}continue}const oe=J.width;const se=J.height;if(oe<=0||se<=0||K<=0||X<=0)continue;const re=Math.min(K/oe,X/se);C=Math.max(0,Math.floor(oe*re));A=Math.max(0,Math.floor(se*re));const ce=(K-C)/2;const ue=(X-A)/2;e.drawImage(J,0,0,oe,se,w+ce,_+ue,C,A);continue}if(w+C<0||_+A<0||w>s||_>l)continue;const P=JGt(n,g);if(!P)continue;const L=Jv(P.contentType);const I=L?ZGt(P,C,A):U1e.get(P.id);if(I){e.drawImage(I,0,0,I.width,I.height,w,_,C,A);continue}if(!L&&!V1e.has(P.id)){const N=vU(P,s,l).then(O=>{U1e.set(P.id,O);return O});V1e.set(P.id,N)}}}Yl();var $1e=e=>Math.round(e*9525);var G1e=new Map;var TU=new Map;async function eHt(e){const t=[];for(const n of e.shapes.items){const r=n.toDrawingProto();const i=r.shape?.shape?.fill?.imageReference?.id;if(!i||G1e.has(i)){continue}let o=TU.get(i);if(!o){o=n.getPictureFillBitmap().then(a=>{if(a){G1e.set(i,a)}TU.delete(i);return a});TU.set(i,o)}t.push(o)}await Promise.all(t)}function tHt(e,t,n,r,i,o,a,s,l,u,d,f,h){const m=t.shapes.items;if(m.length===0)return;const g=f??1;const x={name:"ChatGPT",colorScheme:{name:"",colors:[]},fillStyleList:[],backgroundFillStyleList:[],lineStyleList:[],effectStyleList:[]};const w=u_.load({id:void 0,slides:[],theme:x,layouts:[],charts:[],images:[],contentReferences:[],textStyles:[],fonts:[],people:[],threads:[]});const _=w.slides.add();for(const[C,A]of m.entries()){const P=A.toDrawingProto({preferPreview:true});if(!P.shape)continue;const L=A.resolveBoundsPx({columnOffsets:n,rowOffsets:r},{preferPreview:true});if(!L)continue;const I=Nl+L.x-i;const N=Ol+L.y-o;let O=L.width;let z=L.height;if(O<=0&&z<=0)continue;if(O<=0&&z>0)O=1;if(z<=0&&O>0)z=1;if(I+O<0||N+z<0||I>a||N>s)continue;u?.(I,N,O,z,"shape");const U=A.id||P.shape?.id||`shape-${C}`;if(d){d({id:U,logicalBounds:{x:I,y:N,width:O,height:z},cssBounds:{x:I*g,y:N*g,width:O*g,height:z*g},drawing:P,usesTwoCellAnchor:Boolean(P.toAnchor)})}const W={...P.shape};const H=P.shape?.bbox??{};W.bbox={...H,xEmu:$1e(I),yEmu:$1e(N),widthEmu:$1e(O),heightEmu:$1e(z)};const $=W.shape?.fill?.imageReference?.id;const K=$?G1e.get($):void 0;if($&&!K&&!TU.has($)){const X=A.getPictureFillBitmap().then(j=>{if(j){G1e.set($,j)}TU.delete($);return j});TU.set($,X)}yU(W,e,w,_,l,{pictureFillBitmap:K?{bitmap:K}:void 0,pictureFill:W.shape?.fill});if(W.paragraphs&&W.paragraphs.length>0){try{const ue=W.shape?.fill?.color??W.shape?.fill?.pattern?.color;const xe=l?oo(ue,l):void 0;if(xe&&(!W.textStyle||!W.textStyle.fill)){const be=_U(xe);if(be){const Ie=be[0]/255;const he=be[1]/255;const ve=be[2]/255;const ge=.2126*Ie+.7152*he+.0722*ve;if(ge<.45){W.textStyle=W.textStyle??{};W.textStyle.fill={color:{type:1,value:"FFFFFFFF",transform:void 0},type:1,gradientStops:[],pictureEffects:[]};if(!W.textStyle.anchor&&(W.paragraphs?.length??0)>=1){W.textStyle.anchor=3}}}}if(W.fontReference?.color&&(!W.textStyle||!W.textStyle.fill)){W.textStyle=W.textStyle??{};W.textStyle.fill={type:1,color:W.fontReference.color,gradientStops:[],pictureEffects:[]}}}catch{}const X=A0(W,w,_);let j;e.save();const te=I+O/2;const J=N+z/2;const oe=Dz(W.bbox?.rotation??0);const se=W.bbox?.horizontalFlip?-1:1;const re=W.bbox?.verticalFlip?-1:1;e.translate(te,J);if(oe!==0){e.rotate(oe)}if(se!==1||re!==1){e.scale(se,re)}e.translate(-te,-J);const ce=ed(W,e,l,void 0,{bboxPx:{x:I,y:N,width:O,height:z},resolvedStyle:X,paddingPx:j,layoutProfile:"spreadsheet"});e.restore();if(ce&&h){h.add({id:U,layout:ce,rotationDeg:u3(W.bbox?.rotation??0)??0,zIndex:C,hitBox:{x:I,y:N,width:O,height:z},getRunText:(ue,xe)=>{const be=(W.paragraphs??[])[ue];const Ie=be?.runs?.[xe];return Ie?.text??Ie?.run??""}})}}}}bs();var H1e=class{#e;constructor(t){this.#e=t}get layoutType(){return this.#e.__getLayoutType()}set layoutType(t){this.#e.__setLayoutType(t)}get fillEmptyCells(){return this.#e.__getLayoutMeta().fillEmptyCells}set fillEmptyCells(t){this.#e.__setLayoutMeta({fillEmptyCells:t})}get preserveFormatting(){return this.#e.__getLayoutMeta().preserveFormatting}set preserveFormatting(t){this.#e.__setLayoutMeta({preserveFormatting:t})}get emptyCellText(){return this.#e.__getLayoutMeta().emptyCellText}set emptyCellText(t){this.#e.__setLayoutMeta({emptyCellText:t})}getDataBodyRange(){const t=this.#e.__getLocationForLayout();if(!t.reference){throw new Error("PivotTable location reference is not set")}const n=fi(t.reference);if(!n){throw new Error(`Invalid pivot location reference: ${t.reference}`)}const r=this.#e.__getDataBodyShapeForLayout();const i=r.dataRowCount;const o=r.dataColCount;const a=n.bounds.startRow+Math.max(0,t.firstDataRow);const s=n.bounds.startCol+Math.max(0,t.firstDataColumn);const l=i>0?a+i-1:a;const u=o>0?s+o-1:s;const d={startRow:a,startCol:s,endRow:l,endCol:u};const f=Io(d);return this.#e.worksheet.getRange(f)}load(t){return this}getCellStyleType(t){const n=fi(t);if(!n)return null;const{startRow:r,startCol:i,endRow:o,endCol:a}=n.bounds;if(r!==o||i!==a){return null}return this.#e.__getPivotCellRenderHint(r,i)?.type??null}getCellIndentLevel(t){const n=fi(t);if(!n)return 0;const{startRow:r,startCol:i,endRow:o,endCol:a}=n.bounds;if(r!==o||i!==a){return 0}return this.#e.__getPivotCellRenderHint(r,i)?.indentLevel??0}};bs();function N1(e){return e.trim().replace(/[^a-z0-9]/gi,"").toLowerCase()}var UWr={[N1("None")]:"None",[N1("PercentOfColumnTotal")]:"PercentOfColumnTotal",[N1("PercentOfRowTotal")]:"PercentOfRowTotal",[N1("PercentOfGrandTotal")]:"PercentOfGrandTotal",[N1("DifferenceFrom")]:"DifferenceFrom",[N1("PercentDifferenceFrom")]:"PercentDifferenceFrom",[N1("normal")]:"None",[N1("percentOfCol")]:"PercentOfColumnTotal",[N1("percentOfRow")]:"PercentOfRowTotal",[N1("percentOfTotal")]:"PercentOfGrandTotal",[N1("difference")]:"DifferenceFrom",[N1("percentDiff")]:"PercentDifferenceFrom"};function Y1e(e){if(e==null)return"None";const t=N1(e);return UWr[t]??"None"}function nHt(e){switch(e){case"None":return void 0;case"PercentOfColumnTotal":return"percentOfCol";case"PercentOfRowTotal":return"percentOfRow";case"PercentOfGrandTotal":return"percentOfTotal";case"DifferenceFrom":return"difference";case"PercentDifferenceFrom":return"percentDiff";default:return void 0}}var W1e=class e{#e;#t;#n;constructor(t={}){this.#e=t.calculation??"None";this.#t=t.baseField;this.#n=t.baseItem}get calculation(){return this.#e}set calculation(t){this.#e=t}get baseField(){return this.#t}set baseField(t){this.#t=t}get baseItem(){return this.#n}set baseItem(t){this.#n=t}clone(){return new e({calculation:this.#e,baseField:this.#t,baseItem:this.#n})}};var Y$e=new WeakMap;var rHt=new WeakMap;var q1e=class{constructor(t,n){Y$e.set(this,t);if(n!==void 0){rHt.set(this,n)}}get name(){const t=this.#e();if(t.name&&t.name.length>0){return t.name}const n=rHt.get(this);if(n&&n.length>0){return n}if(t.index!=null){return String(t.index)}if(t.type!=null){return String(t.type)}return""}#e(){const t=Y$e.get(this);if(!t){throw new Error("PivotItem proto not found")}return t}};function q$e(e){const t=Y$e.get(e);if(!t){throw new Error("PivotItem proto not found")}return t}var oHt=new WeakMap;var X$e={["Automatic"]:1,["Sum"]:1,["Count"]:3,["Average"]:2,["Max"]:5,["Min"]:6,["Product"]:7,["CountNumbers"]:4,["StandardDeviation"]:8,["StandardDeviationP"]:9,["Variance"]:10,["VarianceP"]:11};function VWr(e){for(const[t,n]of Object.entries(X$e)){if(n===e)return t}return"Sum"}var aHt={[1]:"sum",[3]:"count",[2]:"average",[5]:"max",[6]:"min",[7]:"product",[4]:"countNums",[8]:"stdDev",[9]:"stdDevp",[10]:"var",[11]:"varp"};var $Wr=[["sum",1],["average",2],["avg",2],["count",3],["countnums",4],["countnumbers",4],["max",5],["maximum",5],["min",6],["minimum",6],["product",7],["stddev",8],["stddevp",9],["var",10],["variance",10],["varp",11],["variancep",11]];var GWr=$Wr.reduce((e,[t,n])=>{e[sHt(t)]=n;return e},{});function sHt(e){return e.replace(/\s+/g,"").toLowerCase()}function HWr(e){if(!e){return void 0}const t=e.trim();if(t.length===0){return void 0}return sHt(t)}function WWr(e){return e==="PercentOfColumnTotal"||e==="PercentOfRowTotal"||e==="PercentOfGrandTotal"||e==="PercentDifferenceFrom"}var wU=class{#e;#t;#n;constructor(t,n){this.#e=t;this.#t=n.pivotTable;oHt.set(this,t)}get name(){const t=this.#e.name;if(t&&t.length>0)return t;const n=this.#r();return n?`Sum of ${n.name}`:"Values"}set name(t){this.#e.name=t}get numberFormatId(){return this.#e.numberFormatId??void 0}set numberFormatId(t){this.#e.numberFormatId=t}get summarizeBy(){return VWr(EU(this.#e))}set summarizeBy(t){const n=X$e[t]??X$e["Sum"];X1e(this.#e,n);Gh(this.#t)}get showAs(){if(this.#n){return this.#n.clone()}const t=this.#e;const n=Y1e(t.showAs);const r=t.baseField!=null?this.#i(t.baseField):void 0;const i=r&&t.baseItem!=null?this.#a(r,t.baseItem):void 0;const o=new W1e({calculation:n,baseField:r,baseItem:i});this.#n=o.clone();return o}set showAs(t){this.#n=t;const n=this.#e;n.showAs=nHt(t.calculation);const r=this.#r()?.numberFormatId;if(WWr(t.calculation)&&(n.numberFormatId==null||n.numberFormatId===r)){n.numberFormatId=10}const i=t.baseField;if(i){const a=this.#o(i);n.baseField=a}else{n.baseField=void 0}const o=t.baseItem;if(o){const a=q$e(o);n.baseItem=a.index??void 0}else{n.baseItem=void 0}Gh(this.#t)}#r(){const t=this.#e.field;if(t==null)return void 0;const n=this.#t._getHierarchyByFieldIndex(t);const r=n?.fields.items??[];return r[0]}#i(t){const n=this.#t._getHierarchyByFieldIndex(t);const r=n?.fields.items??[];return r[0]}#a(t,n){const r=t.items;const i=r.items;return i.find(o=>(q$e(o).index??-1)===n)}#o(t){return t.__ensureIndex(this.#t.__getPivotFieldProtos())}};function Zsa(e){const t=oHt.get(e);if(!t){throw new Error("PivotDataHierarchy proto not found")}return t}function EU(e){if(e.subtotalEnum!==void 0){return e.subtotalEnum}const t=e.subtotal;if(typeof t==="number"){return iHt(e,t)}if(typeof t==="string"){const n=Number(t);if(Number.isFinite(n)){const i=iHt(e,n);if(i!==void 0){return i}}const r=HWr(t);if(r){const i=GWr[r];if(i!==void 0){X1e(e,i);return i}}}return void 0}function X1e(e,t){e.subtotalEnum=t;const n=aHt[t];e.subtotal=n??void 0}function iHt(e,t){const n=t;const r=aHt[n];if(r===void 0){return void 0}e.subtotalEnum=n;e.subtotal=r;return n}function Gh(e){e.__clearPivotCellRenderHints();const t=YWr(e);if(t.dataFields.length===0){return}const n=qWr(t);XWr(t,n)}function YWr(e){const t=Bk(e);const n=sM(e);const r=Array.isArray(t.pivotFields)?t.pivotFields:[];const i=Array.isArray(t.rowFields)?t.rowFields:[];const o=Array.isArray(t.columnFields)?t.columnFields:[];const a=Array.isArray(t.dataFields)?t.dataFields:[];const s=r.map((U,W)=>{const H=U.index??W;const $=n.fields?.[H];const K=U.name??$?.name??`Field ${W+1}`;return{pivotIndex:W,headerIndex:H,name:K}});const l=new Map;s.forEach(U=>{l.set(U.pivotIndex,U)});const u=i.map(U=>l.get(U)).filter(U=>U!=null);const d=o.map(U=>l.get(U)).filter(U=>U!=null);const f=a.map(U=>{const W=l.get(U.field??-1);if(!W)return null;return{pivotIndex:W.pivotIndex,headerIndex:W.headerIndex,name:U.name??W.name,proto:U}}).filter(U=>U!=null);const h=t.rowGrandTotals!==false;const m=t.columnGrandTotals!==false;let g=t.location?.reference;if(!g||g.length===0){g=t.location?.reference??"A1"}const x=fi(g);if(!x){throw new Error(`Invalid pivot location reference: ${g}`)}const w=x.bounds.startRow;const _=x.bounds.startCol;const C=Array.isArray(t.filters)?t.filters:[];const A=d.length>0?d.length:1;const P=A+(f.length>1&&d.length>0?1:0);const L=t.outline!==true&&t.compact!==false;const I=u.length>0?L?1:u.length:1;const N=t.location;const O=typeof N?.firstDataRow==="number"&&N.firstDataRow>0?Math.max(0,N.firstDataRow):P;const z=typeof N?.firstDataColumn==="number"&&N.firstDataColumn>0?Math.max(0,N.firstDataColumn):I;return{pivot:e,pivotProto:t,cacheProto:n,pivotFields:r,rowFields:u,columnFields:d,dataFields:f,rowGrandTotals:h,columnGrandTotals:m,startRow:w,startCol:_,headerRows:O,headerCols:z,filters:C}}function qWr(e){const{pivot:t,rowFields:n,columnFields:r,dataFields:i,rowGrandTotals:o,columnGrandTotals:a,headerRows:s,headerCols:l,filters:u}=e;const d=HO(t);const f=new Map;const h=new Map;const m=[];const g=[];const x=()=>i.map(()=>j$e());const w=X=>{const j=CU(X);let te=f.get(j);if(!te){te={key:j,values:X,columns:new Map,totals:x()};f.set(j,te);m.push(te)}return te};const _=X=>{const j=CU(X);let te=h.get(j);if(!te){te={key:j,values:X,totals:x()};h.set(j,te);g.push(te)}return te};const C=(X,j)=>{const te=X.columns.get(j.key);if(te)return te;const J=x();X.columns.set(j.key,J);return J};const A=x();const P=new Map;e.pivotFields.forEach((X,j)=>{const te=X.index??j;const J=e.cacheProto.fields?.[te];const oe=X.name??J?.name??`Field ${j+1}`;P.set(j,{pivotIndex:j,headerIndex:te,name:oe})});const L=u.map(X=>pHt(X));const I=mYr(u,L,n,r,i);const N=new Set([...n.map(X=>X.pivotIndex),...r.map(X=>X.pivotIndex),...(e.pivotProto.pageFields??[]).map(X=>X?.field).filter(X=>typeof X==="number")]);const O=aYr(e,P);for(const X of d.rows){const j=new Map;P.forEach((re,ce)=>{j.set(ce,X[re.headerIndex]??null)});if(!cYr(L,u,j)){continue}if(!sYr(O,N,j)){continue}const te=n.length?n.map(re=>X[re.headerIndex]??null):["Grand Total"];const J=r.length?r.map(re=>X[re.headerIndex]??null):["Values"];const oe=_(J);const se=[];if(n.length>0){for(let re=1;re<=te.length;re++){se.push(w(te.slice(0,re)))}}else{se.push(w(te))}i.forEach((re,ce)=>{const ue=X[re.headerIndex];const xe=ue===void 0?null:ue;const be=My(oe.totals,ce);j1e(be,xe);const Ie=My(A,ce);j1e(Ie,xe);for(const he of se){const ve=C(he,oe);const ge=My(ve,ce);j1e(ge,xe);const Ve=My(he.totals,ce);j1e(Ve,xe)}})}if(n.length>0){const X={children:new Map};const j=(oe,se)=>{const re=oe.children.get(se);if(re)return re;const ce={children:new Map};oe.children.set(se,ce);return ce};for(const oe of m){if(!Array.isArray(oe.values)||oe.values.length===0)continue;let se=X;for(const re of oe.values){se=j(se,Ok(re))}se.entry=oe}const te=[];const J=(oe,se)=>{const re=n[se];const ce=re!=null?O.get(re.pivotIndex)?.order:void 0;const ue=Array.from(oe.children.entries()).map(([xe,be],Ie)=>({label:xe,child:be,idx:Ie,orderIndex:ce&&ce.has(xe)?ce.get(xe)??Ie:void 0}));if(ce){ue.sort((xe,be)=>{const Ie=xe.orderIndex===void 0?Number.POSITIVE_INFINITY:xe.orderIndex;const he=be.orderIndex===void 0?Number.POSITIVE_INFINITY:be.orderIndex;if(Ie!==he)return Ie-he;const ve=xe.label.localeCompare(be.label);if(ve!==0)return ve;return xe.idx-be.idx})}else{ue.sort((xe,be)=>{const Ie=xe.label.localeCompare(be.label);if(Ie!==0)return Ie;return xe.idx-be.idx})}for(const{child:xe}of ue){if(xe.entry)te.push(xe.entry);J(xe,se+1)}};J(X,0);m.length=0;m.push(...te)}if(I.length>0){dHt(m,I,i,"row");dHt(g,I,i,"column")}const z=[];g.forEach(X=>{i.forEach((j,te)=>{z.push({columnEntry:X,dataFieldIndex:te,isGrandTotal:false})})});if(a&&r.length>0&&z.length>0){i.forEach((X,j)=>{z.push({columnEntry:void 0,dataFieldIndex:j,isGrandTotal:true})})}const U=m.length+(o&&m.length>0?1:0);const W=z.length;const H=s+U;const $=l+W;const K=Array.from({length:H},()=>Array.from({length:$},()=>null));iYr(K,s,l,n,r,z,i);oYr(K,s,l,m,z,i,n,r,e.pivotFields,e.cacheProto,o,A);t.__setRowItems(nYr(m,o));t.__setColumnItems(rYr(z));return{rows:m,columns:g,columnSegments:z,grandTotals:A,headerRows:s,headerCols:l,matrix:K}}function XWr(e,t){const{pivot:n,startRow:r,startCol:i}=e;const{matrix:o,headerRows:a,headerCols:s}=t;const l=o.length;const u=o[0]?.length??0;if(l===0||u===0)return;const d={startRow:r,startCol:i,endRow:r+l-1,endCol:i+u-1};const f=Io(d);n.__updateLocation({reference:f,firstHeaderRow:Math.max(0,a-1),firstDataRow:a,firstHeaderColumn:Math.max(0,s-1),firstDataColumn:s});const h=n.worksheet;const m=h.getRange(f);m.values=o;jWr(e,t,d);ZWr(e,d);eYr(e,t,d);const g=x0(d);for(let x=0;x0){const s=a+t.rows.length;for(let l=n.startCol;l<=n.endCol;l++){r.__setPivotCellRenderHint(s,l,{type:"totalRow",indentLevel:0})}}}function KWr(e){if(e<=1)return"firstSubtotalRow";if(e===2)return"secondRowSubheading";return"wholeTable"}function ZWr(e,t){const n=Array.isArray(e.pivotProto.pageFields)?e.pivotProto.pageFields:[];if(n.length===0)return;const r=e.pivot.worksheet;const i=n.length+1;const o=Math.max(0,t.startRow-i);for(let s=0;s0){return n}}return""}function QWr(e,t){for(const d of e.filters){if(d?.field!==t)continue;const f=pHt(d);if(f?.kind==="manualFilter"){const h=f.payload.selectedItems;if(Array.isArray(h)&&h.length>0){const m=h[0];if(m!=null)return String(m)}}}const n=e.pivotFields[t];if(!n)return null;const r=Array.isArray(n.items)?n.items:[];if(r.length===0)return null;const i=e.cacheProto.fields?.[n.index??t];const o=Array.isArray(i?.sharedItems?.values)?i?.sharedItems?.values:[];const a=r.filter(d=>d?.hidden!==true&&typeof d?.index==="number");if(a.length===0)return null;if(a.length>1&&n.showAll!==false)return null;const s=a[0];if(!s)return null;if(s.name!=null&&s.name!==""){return s.name}const l=s.index;const u=o[l];if(u!=null){return String(u)}return null}function eYr(e,t,n){const r=n.startRow+t.headerRows;if(r>n.endRow)return;const i=e.pivot.worksheet;for(let o=0;o({index:i,type:0 .toString(),memberPropertyIndexes:[],memberProperties:[]}));if(t&&e.length>0){n.push({type:14 .toString(),memberPropertyIndexes:[],memberProperties:[]})}return n}function rYr(e){const t=e.map((n,r)=>({index:r,type:n.isGrandTotal?14 .toString():0 .toString(),memberPropertyIndexes:[],memberProperties:[]}));return t}function iYr(e,t,n,r,i,o,a){const s=e[0]?.length??0;const l=i.length;for(let m=0;m1){d[m]=x.isGrandTotal?`Grand Total (${w.name})`:w.name}else if(x.isGrandTotal){d[m]="Grand Total"}else{d[m]=""}}const f=t-1;const h=e[f];if(h===void 0){return}if(n===1&&r.length>0){h[0]="Row Labels"}else{for(let m=0;mh.set(_.key,_));const m=new Map;for(const _ of i){const C=_.columnEntry;if(C!=null){m.set(C.key,C)}}const g=new Map;a.forEach((_,C)=>g.set(_.pivotIndex,C));const x=new Map;s.forEach((_,C)=>x.set(_.pivotIndex,C));const w=t+r.length;r.forEach((_,C)=>{const A=t+C;const P=e[A];if(P===void 0){return}lHt(e,A,n,_.values);for(let L=0;L0){const _=w;const C=e[_];if(C===void 0){return}lHt(e,_,n,["Grand Total"]);for(let A=0;A0?r[r.length-1]??"":"";i[0]=Ok(o);return}for(let o=0;o0?e.sum/e.countNumbers:null;case 5:return e.max;case 6:return e.min;case 7:return e.product;case 8:{const r=e.countNumbers;if(r<=1)return null;const i=(e.sumSquares-e.sum*e.sum/r)/(r-1);return Math.sqrt(Math.max(i,0))}case 9:{const r=e.countNumbers;if(r===0)return null;const i=(e.sumSquares-e.sum*e.sum/r)/r;return Math.sqrt(Math.max(i,0))}case 10:{const r=e.countNumbers;if(r<=1)return null;return(e.sumSquares-e.sum*e.sum/r)/(r-1)}case 11:{const r=e.countNumbers;if(r===0)return null;return(e.sumSquares-e.sum*e.sum/r)/r}default:return e.sum}}function Ok(e){if(e===null||e===void 0)return"";if(e instanceof Date)return e.toISOString();return String(e)}function aYr(e,t){const n=new Map;const r=Array.isArray(e.cacheProto.fields)?e.cacheProto.fields:[];for(const[i,o]of t.entries()){const a=e.pivotFields[i];if(!a)continue;const s=Array.isArray(a.items)?a.items:[];if(s.length===0)continue;const l=r[o.headerIndex];const u=l?.sharedItems?.values??[];if(!Array.isArray(u)||u.length===0)continue;const d=new Set;const f=new Set;const h=new Map;for(let m=0;m0&&!i.whitelist.has(s)){return false}}return true}function lYr(e){if(typeof e==="number"){return Number.isFinite(e)?e:null}if(typeof e==="string"){const t=e.trim();if(t.length===0)return null;const n=Number(t);return Number.isFinite(n)?n:null}if(e instanceof Date){return e.getTime()}return null}function CU(e){return JSON.stringify(e??[])}function pHt(e){if(!e.description)return null;try{const t=JSON.parse(e.description);if(!t||!t.kind){return null}if(t.kind==="dateFilter"||t.kind==="labelFilter"||t.kind==="manualFilter"||t.kind==="valueFilter"){return t}}catch{return null}return null}function cYr(e,t,n){if(t.length===0)return true;for(let r=0;r0){return n.includes(i)}if(r&&r.length>0){return!r.includes(i)}return true}function fYr(e,t){const n=e.condition;if(!n)return true;const r=Ok(t);const i=typeof e.substring==="string"?e.substring:"";const o=typeof e.comparator==="string"?e.comparator:"";switch(n){case"BeginsWith":case"beginsWith":return r.startsWith(i);case"EndsWith":case"endsWith":return r.endsWith(i);case"Contains":case"contains":return r.includes(i);case"NotContains":case"notContains":return!r.includes(i);case"Equals":case"equals":return r===o;case"NotEquals":case"notEquals":return r!==o;case"GreaterThan":case"greaterThan":return r>o;case"LessThan":case"lessThan":return rr.getTime();case"equals":case"Equals":return pYr(i,r);default:return true}}function cHt(e){if(e instanceof Date)return e;if(typeof e==="string"){const t=new Date(e);if(!Number.isNaN(t.getTime()))return t}return null}function pYr(e,t){return e.getUTCFullYear()===t.getUTCFullYear()&&e.getUTCMonth()===t.getUTCMonth()&&e.getUTCDate()===t.getUTCDate()}function mYr(e,t,n,r,i){const o=[];for(let a=0;ag.pivotIndex===u);const f=r.findIndex(g=>g.pivotIndex===u);if(d===-1&&f===-1)continue;const h=gYr(s.payload,i);if(h<0)continue;const m=i[h];if(!m)continue;o.push({axis:d!==-1?"row":"column",depth:d!==-1?d:f,payload:s.payload,dataFieldIndex:h,subtotal:EU(m.proto)})}return o}function gYr(e,t){if(t.length===0)return-1;const n=e.value?.trim();if(!n)return 0;const r=uHt(n);for(let i=0;iuHt(s)===r)){return i}}return 0}function uHt(e){if(!e)return"";return e.trim().replace(/\s+/g," ").toLowerCase().replace(/^(sum|count|average|max|min|product|stddev|stddevp|variance|variancep)\s+of\s+/,"")}function dHt(e,t,n,r){if(e.length===0)return;const i=t.filter(a=>a.axis===r);if(i.length===0)return;let o=[...e];for(const a of i){const s=n[a.dataFieldIndex];if(!s)continue;const l=o.filter(f=>f.values.length===a.depth+1).map(f=>({key:f.key,value:oC(My(f.totals,a.dataFieldIndex),a.subtotal)}));const u=yYr(l,a.payload);const d=xYr(u);o=o.filter(f=>vYr(f,a.depth,u,d))}e.length=0;e.push(...o)}function yYr(e,t){const n=new Set(e.map(h=>h.key));if(e.length===0)return n;const r=bYr(t.condition);const i=t.comparator;const o=new Set;const a=e.filter(h=>h.value!=null&&Number.isFinite(h.value));const s=(h,m)=>{if(m<=0||a.length===0)return;const g=[...a].sort((x,w)=>{const _=x.value;const C=w.value;return h?C-_:_-C});for(let x=0;xi;break;case"greaterthanorequalto":g=m>=i;break;case"lessthan":g=m=d&&m<=f;break;default:g=true;break}if(t.exclusive===true){g=!g}if(g){o.add(h.key)}}return o}function bYr(e){if(!e)return"";return String(e).replace(/[^a-z]/gi,"").toLowerCase()}function xYr(e){const t=new Set;for(const n of e){try{const r=JSON.parse(n);if(!Array.isArray(r))continue;for(let i=1;i<=r.length;i++){t.add(CU(r.slice(0,i)))}}catch{continue}}return t}function vYr(e,t,n,r){if(n.size===0)return false;const i=e.values.length-1;if(i>=t){const o=CU(e.values.slice(0,t+1));return n.has(o)}return r.has(e.key)}function fHt(e,t,n,r){if(e==null)return null;const i=Y1e(t.showAs);switch(i){case"PercentOfGrandTotal":{const o=n.grandTotalValue;if(!o)return null;return e/o}case"PercentOfRowTotal":{const o=n.rowTotalValue;if(!o)return null;return e/o}case"PercentOfColumnTotal":{const o=n.columnTotalValue;if(!o)return null;return e/o}case"DifferenceFrom":case"PercentDifferenceFrom":{const o=EU(t);const a=_Yr(t,o,r);if(a==null)return null;const s=e-a;if(i==="PercentDifferenceFrom"){if(a===0)return null;return s/a}return s}default:return e}}function _Yr(e,t,n){const r=e.baseField;const i=e.baseItem;if(typeof r!=="number"||typeof i!=="number"){return null}const o=TYr(r,i,n.pivotFields,n.cacheProto);if(o==null)return null;const a=n.rowFieldDepthByPivotIndex.get(r);if(a!==void 0){const l=n.rowEntry;if(!l||l.values.length<=a)return null;const u=[...l.values];u[a]=o;const d=n.rowEntriesByKey.get(CU(u));if(!d)return null;return hHt(d,n.columnEntry,n.isGrandTotalSegment,n.dataFieldIndex,t)}const s=n.columnFieldDepthByPivotIndex.get(r);if(s!==void 0){const l=n.rowEntry;const u=n.columnEntry;if(!l||!u||u.values.length<=s){return null}const d=[...u.values];d[s]=o;const f=n.columnEntriesByKey.get(CU(d));if(!f)return null;return hHt(l,f,false,n.dataFieldIndex,t)}return null}function TYr(e,t,n,r){const i=n[e];if(!i)return null;const o=Array.isArray(i.items)?i.items:[];const a=o.find(f=>f?.index===t)??o[t];if(a?.name!=null&&a.name!==""){return a.name}const s=i.index??e;const l=r.fields?.[s]?.sharedItems?.values??[];const u=a?.index;if(typeof u==="number"){const f=l[u];if(f!=null){return f}}const d=l[t];if(d!=null){return d}return null}function hHt(e,t,n,r,i){if(n||!t){return oC(My(e.totals,r),i)}const o=e.columns.get(t.key);if(!o)return null;return oC(My(o,r),i)}var WO=class{#e;#t;#n;constructor(t){this.#e=t.pivotTable;this.#t=t.kind;this.#n=t.source}add(t){if(this.#t==="all"){throw new Error("Cannot add hierarchies to the master collection")}this.#e._assignHierarchy(this.#t,t);Gh(this.#e);return t}getItem(t){const n=this.items.find(r=>r.name===t);if(!n){throw new Error(`PivotHierarchy ${t} not found`)}return n}getItemOrNullObject(t){return this.items.find(n=>n.name===t)??null}load(t){return this}get items(){if(this.#t==="all"&&this.#n){return[...this.#n]}return this.#e._getHierarchies(this.#t)}};var K1e=class{#e;constructor(t=[]){this.#e=t}getItem(t){const n=this.#e.find(r=>r.name===t);if(!n){throw new Error(`PivotField ${t} not found`)}return n}get items(){return[...this.#e]}_replace(t){this.#e=t}};var Z1e=class{#e;constructor(t=[]){this.#e=t}getItem(t){const n=this.#e.find(r=>r.name===t);if(!n){throw new Error(`PivotItem ${t} not found`)}return n}get items(){return[...this.#e]}_replace(t){this.#e=t}};var K$e=new WeakMap;var J1e=class{#e;#t;constructor(t,n={}){K$e.set(this,t);this.#e=n.pivotTable}get name(){return this.#n().name??""}get numberFormatId(){return this.#n().numberFormatId??void 0}set numberFormatId(t){this.#n().numberFormatId=t}get showAll(){return this.#n().showAll!==false}set showAll(t){this.#n().showAll=t}get items(){if(!this.#t){const t=this.#n();const n=t.index==null?[]:this.#e?.cache.fields[t.index]?.sharedItems?.values??[];const r=t.items.map(i=>new q1e(i,i.index==null?void 0:n[i.index]));this.#t=new Z1e(r)}return this.#t}get pivotTable(){return this.#e}applyFilter(t){if(!this.#e){throw new Error("PivotField is not attached to a PivotTable")}this.#e.__applyFilterForField(this,t)}clearAllFilters(){if(!this.#e)return;this.#e.__clearAllFiltersForField(this)}#n(){const t=K$e.get(this);if(!t){throw new Error("PivotField proto not found")}return t}__ensureIndex(t){const n=this.#n();if(n.index!=null){return n.index}const r=t.indexOf(n);if(r===-1){throw new Error("PivotField proto not registered with PivotTable")}n.index=r;return r}};function mHt(e){const t=K$e.get(e);if(!t){throw new Error("PivotField proto not found")}return t}var Z$e=new WeakMap;var Q1e=class{#e;constructor(t){Z$e.set(this,t);this.#e=new K1e([t])}get name(){return this.#t().name}get fields(){return this.#e}#t(){const t=Z$e.get(this);if(!t){throw new Error("PivotHierarchy field not found")}return t}};function J$e(e){const t=Z$e.get(e);if(!t){throw new Error("PivotHierarchy field not found")}return t}function Q$e(e){return mHt(J$e(e))}var eve=class{#e;#t;constructor(t){this.#e=t.pivotTable;this.#t=t.items??[]}add(t){const n=this.#e._ensureHierarchyIndex(t);const r=Q$e(t);const i={field:n,name:this.#n(t),subtotal:void 0,numberFormatId:r.numberFormatId,showAs:void 0,baseField:void 0,baseItem:void 0};X1e(i,1);this.#e.__addDataFieldProto(i);const o=new wU(i,{pivotTable:this.#e});this.#t.push(o);Gh(this.#e);return o}getItem(t){const n=this.#t.find(r=>r.name===t);if(!n){throw new Error(`PivotDataHierarchy ${t} not found`)}return n}load(t){return this}get items(){return[...this.#t]}#n(t){const n=Q$e(t);const r=n.name??"Values";return`Sum of ${r}`}};function wYr(e,t,n,r){const i=t.map(_=>_[n]);const o=new Set;let a=false;let s=false;let l=false;let u=false;let d;let f;let h;let m;for(const _ of i){if(_==null||_===""){a=true;continue}if(typeof _==="number"){s=true;d=d==null?_:Math.min(d,_);f=f==null?_:Math.max(f,_)}else if(typeof _==="string"){l=true}else if(typeof _==="boolean"){l=true}else if(_ instanceof Date){u=true;h=h==null?_:h<_?h:_;m=m==null?_:m>_?m:_}if(r.includeSharedValues){o.add(String(_))}}const g={values:[],items:[]};const x=Number(s)+Number(l)+Number(u);const w=x>1;if(s){g.containsNumeric=true;g.containsString=l;g.containsSemiMixedTypes=w;if(d!=null)g.minValue=d;if(f!=null)g.maxValue=f}else if(u){g.containsDate=true;g.containsString=l;g.containsSemiMixedTypes=w;g.containsNonDate=s||l;if(h)g.minDate=gHt(h);if(m)g.maxDate=gHt(m)}else if(r.includeSharedValues){if(a)o.add("");const _=Array.from(o);g.values=_;g.count=_.length}return{name:e,numFmtId:r.numFmtId??0,sharedItems:g,cachedUniqueNames:[]}}function gHt(e){return e.toISOString().replace(".000Z","")}var tve=class e{#e;constructor(t){this.#e=t}static createFromSource(t){const n={id:t.id,name:t.name,fields:[],cacheHierarchies:[],dimensions:[],measureGroups:[],maps:[],records:[]};eGe(n,{headers:t.headers,rows:t.rows,sharedValuesFieldIndices:new Set(t.headers.map((r,i)=>i)),numFmtIdByFieldIndex:new Map});return new e(n)}toProto(){return this.#e}};function eGe(e,t){const n=t.headers.map((r,i)=>wYr(r,t.rows,i,{includeSharedValues:t.sharedValuesFieldIndices.has(i),numFmtId:t.numFmtIdByFieldIndex.get(i)}));e.fields=n}function yHt(e){switch(e){case"BeginsWith":return"captionBeginsWith";case"EndsWith":return"captionEndsWith";case"Contains":return"captionContains";case"NotContains":return"captionNotContains";case"Equals":return"captionEqual";case"NotEquals":return"captionNotEqual";case"GreaterThan":return"captionGreaterThan";case"GreaterThanOrEqualTo":return"captionGreaterThanOrEqual";case"LessThan":return"captionLessThan";case"LessThanOrEqualTo":return"captionLessThanOrEqual";case"Between":return"captionBetween";default:return"unknown"}}function bHt(e){switch(e){case"Equals":return"valueEqual";case"NotEquals":return"valueNotEqual";case"GreaterThan":return"valueGreaterThan";case"GreaterThanOrEqualTo":return"valueGreaterThanOrEqual";case"LessThan":return"valueLessThan";case"LessThanOrEqualTo":return"valueLessThanOrEqual";case"Between":return"valueBetween";case"TopN":case"BottomN":case"TopPercent":case"BottomPercent":return"unknown";default:return"unknown"}}function xHt(e){switch(e){case"Equals":return"dateEqual";case"Before":return"dateOlderThan";case"After":return"dateNewerThan";case"Between":return"dateBetween";case"Yesterday":return"yesterday";case"Today":return"today";case"Tomorrow":return"tomorrow";case"ThisWeek":return"thisWeek";case"LastWeek":return"lastWeek";case"NextWeek":return"nextWeek";case"ThisMonth":return"thisMonth";case"LastMonth":return"lastMonth";case"NextMonth":return"nextMonth";case"ThisQuarter":return"thisQuarter";case"LastQuarter":return"lastQuarter";case"NextQuarter":return"nextQuarter";case"ThisYear":return"thisYear";case"LastYear":return"lastYear";case"NextYear":return"nextYear";case"YearToDate":return"yearToDate";case"AllDatesInPeriodJanuary":return"M1";case"AllDatesInPeriodFebruary":return"M2";case"AllDatesInPeriodMarch":return"M3";case"AllDatesInPeriodApril":return"M4";case"AllDatesInPeriodMay":return"M5";case"AllDatesInPeriodJune":return"M6";case"AllDatesInPeriodJuly":return"M7";case"AllDatesInPeriodAugust":return"M8";case"AllDatesInPeriodSeptember":return"M9";case"AllDatesInPeriodOctober":return"M10";case"AllDatesInPeriodNovember":return"M11";case"AllDatesInPeriodDecember":return"M12";default:return"unknown"}}bs();function SU(e,t){return`${e}:${t}`}function vHt(e){const t=e.indexOf(":");if(t<0)return null;const n=Number.parseInt(e.slice(0,t),10);const r=Number.parseInt(e.slice(t+1),10);if(!Number.isFinite(n)||!Number.isFinite(r))return null;return{row:n,col:r}}function tGe(e){switch(e){case"rows":return 1;case"columns":return 2;case"filters":return 3;case"values":return 4;default:return 0}}function nGe(e){switch(e){case"rows":return"axisRow";case"columns":return"axisCol";case"filters":return"axisPage";case"values":return"axisValues";default:return void 0}}var rGe=new WeakMap;var _Ht=new WeakMap;var GZ=new WeakMap;var THt=new WeakMap;var nve=new WeakMap;var lM=new WeakMap;var iGe=class{#e;#t;#n;#r;#i;#a;#o;#s;#l;#c;#u;#f;#d;#p;#m;#h;constructor(t){this.#e=t.workbook;this.#t=t.worksheet;this.#m=new Set;this.#h=new Set;rGe.set(this,t.pivot);_Ht.set(this,t.cache);GZ.set(this,t.source);nve.set(this,{fillEmptyCells:false,preserveFormatting:false,emptyCellText:""});lM.set(this,new Map);this.#n=new H1e(this);const n=this.#T();n.pivotFields??=[];this.#l=[];this.#c=[];this.#p=new Map;n.pivotFields.forEach(i=>{const o=new J1e(i,{pivotTable:this});o.__ensureIndex(n.pivotFields);const a=new Q1e(o);this.#l.push(o);this.#c.push(a);this.#p.set(i.index,a)});this.#A();this.#r=new WO({pivotTable:this,kind:"all",source:this.#c});this.#u=[];this.#f=[];this.#d=[];this.#g();this.#i=new WO({pivotTable:this,kind:"row"});this.#a=new WO({pivotTable:this,kind:"column"});this.#s=new WO({pivotTable:this,kind:"filter"});const r=(n.dataFields??[]).map(i=>new wU(i,{pivotTable:this}));this.#o=new eve({pivotTable:this,items:r});this.#w();if(t.onDelete)this.addDeleteListener(t.onDelete);if(t.onNameChange)this.addNameChangeListener(t.onNameChange);THt.set(t.pivot,this)}get workbook(){return this.#e}get worksheet(){return this.#t}get name(){return this.#T().name}set name(t){const n=this.#T();const r=n.name||void 0;n.name=t;this.#t.__queueCollaborativePublish();for(const i of this.#h){i(this,r,t)}}get layout(){return this.#n}get hierarchies(){return this.#r}get rowHierarchies(){return this.#i}get columnHierarchies(){return this.#a}get dataHierarchies(){return this.#o}get filterHierarchies(){return this.#s}_assignHierarchy(t,n){this.#b(n);const r=this.#C(t);this.#E(n);if(!r.includes(n)){r.push(n)}this.#v();this.#t.__queueCollaborativePublish()}_getHierarchies(t){if(t==="all"){return[...this.#c]}return[...this.#C(t)]}_getHierarchyByFieldIndex(t){return this.#p.get(t)}_ensureHierarchyIndex(t){this.#b(t);return this.#_(t)}delete(){for(const t of this.#m){t(this)}}get cache(){return sM(this)}toProto(){return this.#T()}rebuildCache(){const t=this.#T();const n=sM(this);const r=HO(this);n.worksheetSourceReference=r.address.length>0?r.address:void 0;n.worksheetSourceSheet=r.address.length>0?r.worksheet.name:void 0;let i;let o;if(r.address.length>0){const m=r.worksheet.getRange(r.address);const g=m.values;if(g.length===0){n.fields=[];n.recordCount=0;this.#A();Gh(this);return}const x=g[0]??[];const w=x.length;i=x.map((_,C)=>_!=null&&_!==""?String(_):`Column${C+1}`);o=[];for(let _=1;_[...m]);if(i.length===0){n.fields=[];n.recordCount=o.length;this.#A();Gh(this);return}}const a=new Set;const s=Array.isArray(t.rowFields)?t.rowFields:[];const l=Array.isArray(t.columnFields)?t.columnFields:[];const u=Array.isArray(t.pageFields)?t.pageFields:[];for(const m of s){if(typeof m==="number"&&m>=0)a.add(m)}for(const m of l){if(typeof m==="number"&&m>=0)a.add(m)}for(const m of u){const g=m?.field;if(typeof g==="number"&&g>=0)a.add(g)}const d=new Map;const f=Array.isArray(t.pivotFields)?t.pivotFields:[];for(let m=0;mthis.#_(n));t.columnFields=this.#f.map(n=>this.#_(n));t.pageFields=this.#d.map(n=>{const r=this.#_(n);const i={field:r,item:void 0,name:n.name};return i});this.#w()}#_(t){const n=this.#T();const r=J$e(t);const i=r.__ensureIndex(n.pivotFields);this.#p.set(i,t);return i}#E(t){this.#S(this.#u,t);this.#S(this.#f,t);this.#S(this.#d,t)}#S(t,n){const r=t.indexOf(n);if(r>=0){t.splice(r,1)}}#C(t){switch(t){case"row":return this.#u;case"column":return this.#f;case"filter":return this.#d;default:throw new Error(`Unknown hierarchy kind: ${t}`)}}#b(t){if(!this.#c.includes(t)){throw new Error("Hierarchy does not belong to this PivotTable")}}#T(){const t=rGe.get(this);if(!t){throw new Error("PivotTable proto not found")}return t}addDeleteListener(t){this.#m.add(t)}removeDeleteListener(t){this.#m.delete(t)}addNameChangeListener(t){this.#h.add(t)}removeNameChangeListener(t){this.#h.delete(t)}__getLayoutType(){const t=this.#T();if(t.outline)return"Outline";if(t.compact===false)return"Tabular";return"Compact"}__setLayoutType(t){const n=this.#T();switch(t){case"Compact":n.compact=true;n.outline=false;break;case"Outline":n.compact=false;n.outline=true;break;case"Tabular":default:n.compact=false;n.outline=false;break}this.#t.__queueCollaborativePublish();Gh(this)}__getLayoutMeta(){return{...nve.get(this)??this.#k()}}__setLayoutMeta(t){const n=nve.get(this)??this.#k();nve.set(this,{...n,...t});this.#t.__queueCollaborativePublish()}#k(){return{fillEmptyCells:false,preserveFormatting:false,emptyCellText:""}}__getLocationForLayout(){const t=this.#T().location;return{reference:t?.reference??"",firstHeaderRow:t?.firstHeaderRow??0,firstDataRow:t?.firstDataRow??0,firstHeaderColumn:t?.firstHeaderColumn??0,firstDataColumn:t?.firstDataColumn??0}}__getDataBodyShapeForLayout(){const t=this.#T();const n=Array.isArray(t.rowItems)?t.rowItems.length:0;const r=Array.isArray(t.columnItems)?t.columnItems.length:0;return{dataRowCount:n,dataColCount:r}}__setRowItems(t){this.#T().rowItems=t??[]}__setColumnItems(t){this.#T().columnItems=t??[]}__clearPivotCellRenderHints(){const t=lM.get(this);if(!t){lM.set(this,new Map);return}t.clear()}__setPivotCellRenderHint(t,n,r){const i=lM.get(this);const o=SU(t,n);if(!i){lM.set(this,new Map([[o,r]]));return}i.set(o,r)}__getPivotCellRenderHint(t,n){const r=lM.get(this);if(!r)return null;return r.get(SU(t,n))??null}__getPivotCellRenderHints(){const t=lM.get(this);if(!t){const n=new Map;lM.set(this,n);return n}return t}__findDataFieldProto(t){const n=this.#T();const r=Array.isArray(n.dataFields)?n.dataFields:[];return r.find(i=>i.field===t)}__addDataFieldProto(t){const n=this.#T();n.dataFields??=[];n.dataFields.push(t);this.#w();this.#t.__queueCollaborativePublish()}__getPivotFieldProtos(){const t=this.#T();t.pivotFields??=[];return t.pivotFields}__updateLocation(t){const n=this.#T();n.location??={reference:t.reference,firstHeaderRow:t.firstHeaderRow,firstDataRow:t.firstDataRow,firstHeaderColumn:t.firstHeaderColumn,firstDataColumn:t.firstDataColumn};n.location.reference=t.reference;n.location.firstHeaderRow=t.firstHeaderRow;n.location.firstDataRow=t.firstDataRow;n.location.firstHeaderColumn=t.firstHeaderColumn;n.location.firstDataColumn=t.firstDataColumn;this.#t.__queueCollaborativePublish()}__applyFilterForField(t,n){const r=this.#T();r.filters??=[];const i=t.__ensureIndex(r.pivotFields);r.filters=r.filters.filter(u=>u.field!==i);const{descriptor:o,typeToken:a,typeEnum:s}=this.#P(n);const l={field:i,type:a,typeEnum:s,name:t.name,description:JSON.stringify(o)};r.filters.push(l);this.#t.__queueCollaborativePublish();Gh(this)}__clearAllFiltersForField(t){const n=this.#T();if(!n.filters)return;const r=t.__ensureIndex(n.pivotFields);n.filters=n.filters.filter(i=>i.field!==r);this.#t.__queueCollaborativePublish();Gh(this)}#P(t){const n=[t.dateFilter?"dateFilter":null,t.labelFilter?"labelFilter":null,t.manualFilter?"manualFilter":null,t.valueFilter?"valueFilter":null].filter(i=>i!=null);if(n.length!==1){throw new Error("Exactly one filter type must be provided")}const r=n[0];switch(r){case"dateFilter":{const i=t.dateFilter;const o={kind:r,payload:i};const a=xHt(i.condition);return{descriptor:o,typeToken:a,typeEnum:0}}case"labelFilter":{const i=t.labelFilter;const o={kind:r,payload:i};const a=yHt(i.condition);return{descriptor:o,typeToken:a,typeEnum:0}}case"valueFilter":{const i=t.valueFilter;const o={kind:r,payload:i};const a=bHt(i.condition);return{descriptor:o,typeToken:a,typeEnum:0}}case"manualFilter":{const i=t.manualFilter;const o={kind:r,payload:i};return{descriptor:o,typeToken:"unknown",typeEnum:0}}default:throw new Error("Unsupported filter type")}}preview(){const t=this.#T();const n=t.location;const r=n?.reference??"";const i=r?fi(r):null;if(!i){return{grid:[],header:{headerRows:0,headerCols:0},bounds:{rowCount:0,colCount:0}}}const o=this.#t.getRange(i.ref);const a=o.values;const s=a.length;const l=a[0]?.length??0;return{grid:a,header:{headerRows:Math.max(0,n?.firstDataRow??0),headerCols:Math.max(0,n?.firstDataColumn??0)},bounds:{rowCount:s,colCount:l}}}#A(){const t=this.#T();const n=sM(this);const r=Array.isArray(n.fields)?n.fields:[];for(let i=0;i0){continue}const u=l.map((d,f)=>({name:d,index:f})).sort((d,f)=>d.name.localeCompare(f.name)).map(({index:d})=>d);o.items=u.map(d=>({index:d,memberPropertyIndexes:[],memberProperties:[]}))}}#w(){const t=this.#T();const n=t.pivotFields??[];for(const o of n){if(!o)continue;o.axis=void 0;o.axisEnum=void 0;o.dataField=false}const r=(o,a)=>{for(const s of o){const l=this.#_(s);const u=n[l];if(!u)continue;u.axisEnum=tGe(a);u.axis=nGe(a)}};r(this.#u,"rows");r(this.#f,"columns");r(this.#d,"filters");const i=Array.isArray(t.dataFields)?t.dataFields:[];for(const o of i){const a=o.field??-1;const s=n[a];if(!s)continue;s.dataField=true;s.axisEnum=tGe("values");s.axis=nGe("values")}}};function Bk(e){const t=rGe.get(e);if(!t){throw new Error("PivotTable proto not found")}return t}function sM(e){const t=_Ht.get(e);if(!t){throw new Error("PivotCache proto not found")}return t}function HO(e){const t=GZ.get(e);if(!t){throw new Error("PivotTable source not found")}if(!t.address){return t}const n=EHt(t);GZ.set(e,n);return n}function wHt(e){const t=THt.get(e.pivot);if(t){if(e.onDelete)t.addDeleteListener(e.onDelete);if(e.onNameChange)t.addNameChangeListener(e.onNameChange);const n=GZ.get(t);if(!n||EYr(n,e.source)){GZ.set(t,EHt(e.source))}return t}return new iGe(e)}function EYr(e,t){if(e.address.length===0&&t.address.length>0)return true;if(e.headers.length===0&&t.headers.length>0)return true;if(e.rows.length===0&&t.rows.length>0)return true;if(t.headers.length>e.headers.length)return true;if(t.rows.length>e.rows.length)return true;if(e.worksheet!==t.worksheet&&t.address.length>0&&t.rows.length>=e.rows.length){return true}return false}function EHt(e){if(!e.address){return{headers:[...e.headers],rows:e.rows.map(s=>[...s]),address:e.address,worksheet:e.worksheet}}const t=e.worksheet.getRange(e.address);const n=t.values;const r=n[0]??[];const i=r.length;const o=r.map((s,l)=>s!=null&&s!==""?String(s):`Column${l+1}`);const a=[];for(let s=1;s[ive(e),e]));var SYr=new Map(Object.keys(WZ).map(e=>[ive(e),e]));var AYr={type:0,color:void 0,gradientStops:[],pictureEffects:[]};var OHt=[];var BHt=[];var zHt=[];var UHt=[];var VHt=[];var $Ht=[];function ive(e){return e.replace(/[^a-z0-9]/gi,"").toLowerCase()}function ove(e){if(!e){return void 0}const t=HZ[e];if(t){return e}return CYr.get(ive(e))}function GHt(e){if(!e){return void 0}const t=WZ[e];if(t){return e}return SYr.get(ive(e))}function fGe(e){const t=OHt[e];if(t){return t}const n=RHt[e];if(!n){throw new Error(`Unknown preset color id: ${e}`)}const[r,i]=n;const o={type:2,value:`theme:${r}`,transform:i===void 0?void 0:{tint:i},lastColor:void 0};OHt[e]=o;return o}function kYr(e){if(e===YZ){return AYr}const t=BHt[e];if(t){return t}const n=IHt[e];if(n===void 0){throw new Error(`Unknown preset fill id: ${e}`)}const r={type:1,color:fGe(n),gradientStops:[],pictureEffects:[]};BHt[e]=r;return r}function RYr(e){if(e===YZ){return void 0}const t=zHt[e];if(t){return t}const n=PHt[e];if(!n){throw new Error(`Unknown preset font id: ${e}`)}const[r,i]=n;const o={};if((r&1)!==0){o.bold=true}if(i>=0){o.fill={type:1,color:fGe(i),gradientStops:[],pictureEffects:[]}}zHt[e]=o;return o}function PYr(e){const t=UHt[e];if(t){return t}const n=MHt[e];if(!n){throw new Error(`Unknown preset line id: ${e}`)}const[r,i]=n;const o=AHt[r];if(!o){throw new Error(`Unknown preset border style id: ${r}`)}const a={style:o,color:fGe(i)};UHt[e]=a;return a}function IYr(e){if(e===YZ){return void 0}const t=VHt[e];if(t){return t}const n=LHt[e];if(!n){throw new Error(`Unknown preset border id: ${e}`)}const r={};for(let i=0;ithis.#r[t])}getElement(t){const n=this.#i();const r=this.#a();for(let i=0;i0?e:null}function OYr(e,t,n){const r=e.getTransform();const i=Math.hypot(r.a,r.b);const o=Math.hypot(r.c,r.d);const a=pGe(Math.max(i,o));if(a!=null){return .5/a}const s=(pGe(n)??1)*(pGe(t)??1);return .5/s}function BYr(e){const t=e.trim();if(!t.startsWith("#")||t.length!==7)return null;const n=parseInt(t.slice(1,3),16);const r=parseInt(t.slice(3,5),16);const i=parseInt(t.slice(5,7),16);if(Number.isNaN(n)||Number.isNaN(r)||Number.isNaN(i))return null;return{r:n,g:r,b:i}}var XZ=new WeakMap;function lve(e){let t=XZ.get(e);if(!t){t={rowCellByColIdx:new Map,rowNonEmptyCols:new Map,textMetrics:new Map,cellRenderLayouts:new Map};XZ.set(e,t)}return t}function XO(e,t){return e+":"+t}function ZHt(e,t){return`${e}:${t}|`}function Ly(e){XZ.delete(e)}function mGe(e,t){const n=XZ.get(e);if(!n)return;for(const r of t){n.rowCellByColIdx.delete(r);n.rowNonEmptyCols.delete(r);for(const i of n.textMetrics.keys()){const o=i.indexOf(":");const a=Number(i.slice(0,o));if(a===r)n.textMetrics.delete(i)}for(const i of n.cellRenderLayouts.keys()){const o=i.indexOf(":");const a=Number(i.slice(0,o));if(a===r)n.cellRenderLayouts.delete(i)}}}function Rca(e,t){const n=XZ.get(e);if(!n)return;for(const r of t){const i=ps(r);const o=vl(r);n.textMetrics.delete(XO(o,i));const a=ZHt(o,i);for(const s of n.cellRenderLayouts.keys()){if(s.startsWith(a)){n.cellRenderLayouts.delete(s)}}}}function cve(e,t){let n=0,r=e.length;while(n>>1;const o=e[i];if(o!==void 0&&o>>1;const o=e[i];if(o!==void 0&&o<=t)n=i+1;else r=i}return n}var UYr={BLACK:0,WHITE:1,RED:2,GREEN:3,BLUE:4,YELLOW:5,MAGENTA:6,CYAN:7};function VYr(e){if(!e)return[];const t=[];let n="";let r=false;for(let i=0;i=3){if(t>0)return 0;if(t<0)return 1;if(Object.is(t,-0)||t===0)return 2}return 0}function GYr(e){const t=e.replace(/\s+/g,"").toUpperCase();const n=UYr[t];if(n!=null){return uz(n)??null}const r=t.match(/^COLOR(\d{1,2})$/);if(r){const i=Number(r[1]);if(!Number.isNaN(i)&&i>0){return uz(i-1)??null}}return null}function HYr(e){let t=0;while(tMath.max(0,Math.min(255,Math.round(o))).toString(16).padStart(2,"0").toUpperCase();const i=`FF${r(e)}${r(t)}${r(n)}`;return{type:1,value:i,lastColor:i,transform:void 0}}function JHt(e){const t=BYr(e);if(t){return KHt(t.r,t.g,t.b)}const n=_U(e);if(n){return KHt(n[0],n[1],n[2])}return null}function WYr(e,t){if(!t?.numberFormatCode)return null;const n=e.dataType===3||e.dataType===1||e.dataType===2;if(n)return null;const r=Number(e.value);if(Number.isNaN(r))return null;const i=VYr(t.numberFormatCode);if(i.length===0)return null;const o=$Yr(i.length,r);if(o==null)return null;const a=i[Math.min(o,i.length-1)]??"";const s=HYr(a);if(!s)return null;return JHt(s)}function qO(e,t,n,r,i){const o=e.getTransform();if(o.b===0&&o.c===0&&o.a!==0&&o.d!==0){const d=t*o.a+o.e;const f=n*o.d+o.f;const h=(t+r)*o.a+o.e;const m=(n+i)*o.d+o.f;const g=Math.round(Math.min(d,h));const x=Math.round(Math.min(f,m));const w=Math.round(Math.max(d,h));const _=Math.round(Math.max(f,m));if(w<=g||_<=x){return}const C=(g-o.e)/o.a;const A=(w-o.e)/o.a;const P=(x-o.f)/o.d;const L=(_-o.f)/o.d;const I=Math.min(C,A);const N=Math.min(P,L);e.fillRect(I,N,Math.abs(A-C),Math.abs(L-P));return}const a=Math.round(t);const s=Math.round(n);const l=Math.round(t+r);const u=Math.round(n+i);if(l<=a||u<=s){return}e.fillRect(a,s,l-a,u-s)}function cM(e,t,n,...r){const i=Array.isArray(r[0]);let o;let a;let s;let l;let u;let d;let f;let h;let m;let g;let x;let w;let _;let C;let A;let P;let L;let I;let N;let O;let z;let U;if(i){[o,a,s,l,u,d,f,h,m,g,x,w,_,C,A,P,L,I,N,O,z,U]=r}else{[s,l,u,d,f,h,m,g,x,w,_,C,A,P,L,I,N,O,z,U]=r;const ft=t.sheets.getItemOrNullObject(n);if(ft.isNullObject){return}const zt=ft.__getViewportLayout({maxCols:O?.maxCols,maxRows:O?.maxRows,showFormulas:P,colWidthOverridesPx:O?.colWidthOverridesPx,rowHeightOverridesPx:O?.rowHeightOverridesPx});o=zt.viewColWidthsPx;a=zt.rowHeightsPx}const{darkMode:W=false,accentColor:H=NYr,showHeaders:$=true,rowAutoHeight:K}=O??{};const X=$?Nl:0;const j=$?Ol:0;const te=t.sheets.getItemOrNullObject(n);if(te.isNullObject){return}const J=te;const oe=te.name;const se=te.__getRows();const re=te.__getMergedRangeIndex();const ce=te.__getSpreadsheetRenderMetadata(A);const ue=W?{background:"#202020",grid:"#4d4d4d",headerBg:"#1e1e1e",headerBorder:"#2b2b2b",headerText:"#f5f5f5",unsupportedFill:"#2b2b2b"}:{background:"#ffffff",grid:"#cccccc",headerBg:"#f5f5f5",headerBorder:"#cccccc",headerText:"#333333",unsupportedFill:"#eeeeee"};const xe=O?.backgroundColor??ue.background;const be=ue.grid;const Ie=ue.headerBg;const he=ue.headerBorder;const ve=ue.headerText;const ge=ue.unsupportedFill;const Ve=W?"FFFFFFFF":"FF000000";const Le=qHt(te,A);const $e=m||1;const Ee=s/$e;const tt=l/$e;const yt=new Set;const mt=ce.sharedFormulaMap;const ct=new Map;const Ge=new Map;const it=new Map;const bt=ft=>{if(Ge.has(ft)){return Ge.get(ft)===true}const zt=t.__isCheckboxStyleIndex(ft);Ge.set(ft,zt);return zt};const He=(ft,zt)=>{if(P){if(ft.formula){return`= ${ft.formula}`}if(typeof ft.sharedFormulaSi==="number"){const Gt=mt.get(ft.sharedFormulaSi);if(Gt){return`= ${O1e(Gt.base,Gt.anchor,ft.address)}`}}}return T3(ft,g,ct,zt)};const Je=ft=>{if(P){if(ft.formula)return false;if(typeof ft.sharedFormulaSi==="number"&&mt.has(ft.sharedFormulaSi)){return false}}const zt=Number(ft.value);return ft.dataType!==3&&!Number.isNaN(zt)};const Te=(ft,zt)=>ft.paragraphs&&ft.paragraphs.length>0?ft.paragraphs:[{runs:[{text:zt,citations:[],reviewMarkIds:[]}],inlineNodes:[]}];const we=({paragraphs:ft,resolvedTextStyle:zt,widthPx:Gt,heightPx:gn})=>({paragraphs:ft,textStyle:zt,bbox:{xEmu:0,yEmu:0,widthEmu:Math.round(Math.max(1,Gt)*9525),heightEmu:Math.round(Math.max(1,gn)*9525)},type:1,effects:[],children:[],levelsStyles:[],id:"",citations:[]});const Ze=ft=>!!ft.paragraphs?.some(zt=>zt.runs?.some(Gt=>(Gt.text??"").length>0));const Be=ft=>{if(!ft)return"";const zt=ft.transform?JSON.stringify(ft.transform):"";return`${ft.type}:${ft.value??""}:${ft.lastColor??""}:${zt}`};const qe=JSON.stringify(A.colorMap);const Qe=({element:ft,style:zt,tableCellStyle:Gt,pivotFontColor:gn,pivotBold:Fn,conditionalFormattingTextColor:Tr,numberFormatColorOverride:Jr})=>{const jr=zt.font?.color?JHt(zt.font.color):null;for(const sr of ft.paragraphs??[]){for(const bn of sr.runs??[]){bn.textStyle=bn.textStyle??{};if(typeof bn.textStyle.fontSize==="number"&&bn.textStyle.fontSize>0&&bn.textStyle.fontSize<100){bn.textStyle.fontSize=Math.round(bn.textStyle.fontSize*100)}if(!(typeof bn.textStyle.fontSize==="number"&&bn.textStyle.fontSize>0)){const Jn=zt.font?.size;const er=typeof Jn==="number"&&Jn>0?Jn*72/96:11;bn.textStyle.fontSize=Math.round(er*100)}if(bn.textStyle.italic==null&&zt.font?.italic!=null){bn.textStyle.italic=!!zt.font.italic}if(bn.textStyle.name==null){bn.textStyle.name=Xz(zt.font?.family)}if(bn.textStyle.underline==null&&zt.font?.underline!=null){bn.textStyle.underline=zt.font.underline?"single":"none"}const ir=Ige({currentTextStyle:bn.textStyle,baseStyle:zt,baseStyleFontColor:jr,tableCellStyle:Gt,pivotFontColor:gn,pivotBold:Fn,conditionalFormattingTextColor:Tr,numberFormatColorOverride:Jr});if(ir.bold!=null){bn.textStyle.bold=ir.bold}if(ir.fill){bn.textStyle.fill=ir.fill}else if(!bn.textStyle.fill){bn.textStyle.fill={color:{type:1,value:Ve,transform:void 0,lastColor:Ve},type:1,gradientStops:[],pictureEffects:[]}}}}};const ze=({cell:ft,displayText:zt,widthPx:Gt,heightPx:gn,paddingPx:Fn,wrapTextEnabled:Tr,style:Jr,tableCellStyle:jr,pivotFontColor:sr,pivotBold:bn,numberFormatColorOverride:ir})=>{const Jn=Tr?Math.max(1,Gt):DYr;const er=we({paragraphs:Te(ft,zt),resolvedTextStyle:{alignment:1},widthPx:Jn,heightPx:gn});Qe({element:er,style:Jr,tableCellStyle:jr,pivotFontColor:sr,pivotBold:bn,conditionalFormattingTextColor:null,numberFormatColorOverride:ir});const Pr=_p(er,A,{resolvedStyle:{alignment:1},bboxPx:{x:0,y:0,width:Jn,height:gn},paddingPx:Fn,textScale:sve,wrap:Tr,layoutProfile:"spreadsheet"});return{firstLineW:Pr?.lines?.[0]?.widthPx??0,contentHeight:Pr?.lines?.reduce((Vt,di)=>Vt+di.heightPx,0)??0}};const Me=({cell:ft,displayText:zt,resolvedTextStyle:Gt,widthPx:gn,heightPx:Fn,paddingPx:Tr,wrapTextEnabled:Jr,style:jr,tableCellStyle:sr,pivotFontColor:bn,pivotBold:ir,conditionalFormattingTextColor:Jn,numberFormatColorOverride:er,styleIndex:Pr,rowIdx:Vt,colIdx:di,cacheable:ln=true})=>{const yi=ln&&Pr!==void 0&&Vt!==void 0&&di!==void 0?[ZHt(Vt,di),Pr,zt,Math.round(gn*100)/100,Math.round(Fn*100)/100,Math.round(Tr.left*100)/100,Math.round(Tr.right*100)/100,Math.round(Tr.top*100)/100,Math.round(Tr.bottom*100)/100,Jr?1:0,Gt.anchor??"",Gt.alignment??"",Ve,qe,jr.font?.color??"",ir?1:0,sr?.font?.bold===true?1:0,Be(sr?.font?.color),Be(bn),Be(Jn),Be(er)].join("|"):null;if(yi){const Ms=qt.cellRenderLayouts.get(yi);if(Ms){return Ms}}const yo=we({paragraphs:Te(ft,zt),resolvedTextStyle:Gt,widthPx:gn,heightPx:Fn});Qe({element:yo,style:jr,tableCellStyle:sr,pivotFontColor:bn,pivotBold:ir,conditionalFormattingTextColor:Jn,numberFormatColorOverride:er});const Pa={element:yo,layout:_p(yo,A,{resolvedStyle:Gt,bboxPx:{x:0,y:0,width:Math.max(1,gn),height:Fn},paddingPx:Tr,textScale:sve,wrap:Jr,layoutProfile:"spreadsheet"})};if(yi&&Pa.layout){if(qt.cellRenderLayouts.size>=FYr){const Ms=qt.cellRenderLayouts.keys().next().value;if(Ms){qt.cellRenderLayouts.delete(Ms)}}qt.cellRenderLayouts.set(yi,{element:Pa.element,layout:Pa.layout})}return Pa};function ye(ft,zt){const Gt=Yr.get(ft)!=null;if(!Gt)return o[zt]??0;Xr(ft);const gn=lve(J).rowNonEmptyCols.get(ft)??[];const Fn=zYr(gn,zt);const Tr=gn[Fn]??o.length;const Jr=At[zt]??0;const jr=At[Tr]??Jr;return Math.max(0,jr-Jr)}function Ne(ft,zt){if(zt<0)return false;Xr(ft);const Gt=lve(J).rowNonEmptyCols.get(ft)??[];let gn=it.get(ft);if(!gn||gn.nonEmpty!==Gt||zt=jr}function Ae(ft,zt,Gt){const gn=ps(Gt.startAddress);const Fn=vl(Gt.startAddress);const Tr=ps(Gt.endAddress);const Jr=vl(Gt.endAddress);const jr=Math.min(Fn,Jr);const sr=Math.max(Fn,Jr);const bn=Math.min(gn,Tr);const ir=Math.max(gn,Tr);return ft>=jr&&ft<=sr&&zt>=bn&&zt<=ir}function dt(ft){if(!ft)return null;const zt=Number(ft.value);if(Number.isNaN(zt))return null;return zt}function Oe(ft){if(!ft)return null;const zt=ft.hyperlink?.uri??ft.hyperlink?.target;if(zt){return zt}for(const Gt of ft.paragraphs??[]){for(const gn of Gt.runs??[]){const Fn=gn.hyperlink?.uri??gn.hyperlink?.target;if(Fn){return Fn}}}return null}const Wt=oe.trim()!==""?t.getConditionalFormattingRenderCache(oe):null;e.save();e.scale(m,m);const kt=OYr(e,m,O?.devicePixelRatio);const qt=lve(te);function _t(ft,zt){Xr(ft);return qt.rowCellByColIdx.get(ft)?.get(zt)}const sn=(ft,zt)=>re.findBoundsForCell(ft,zt);const Jt=(ft,zt)=>re.boundaryCrossesHorizontally(ft,zt);const Sn=(ft,zt)=>re.boundaryCrossesVertically(ft,zt);const Kt={thin:1,dashed:2,dashDot:2,dashDotDot:2,medium:3,mediumDashed:3,slantDashDot:3,thick:4,double:5};const mn=ft=>ft?Kt[ft]??0:0;const At=[0];for(let ft=0;ft0&&Hr<=Mr&&on<=cr){for(const ft of re.rangesIntersecting({rowMin:Hr,rowMax:Mr,colMin:on,colMax:cr})){const zt=ft.rowMin>=Hr&&ft.rowMin<=Mr;const Gt=ft.colMin>=on&&ft.colMin<=cr;if(zt&&Gt){continue}let gn=Er.get(ft.rowMin);if(!gn){gn=new Set;Er.set(ft.rowMin,gn)}gn.add(ft.colMin)}}e.clearRect(0,0,u/m,d/m);e.fillStyle=xe;e.fillRect(0,0,u/m,d/m);const vr=new Map;for(const ft of se)vr.set(ft.index-1,ft);const Yr=new Map;if(L&&L.length>0){const ft=a.length;for(let zt=0;zt{for(const Gt of nt){for(const gn of Gt.ranges){if(Ae(ft,zt,gn))return Gt}}return null};function Xr(ft){if(qt.rowCellByColIdx.has(ft)&&qt.rowNonEmptyCols.has(ft))return;const zt=Yr.get(ft);if(!zt){qt.rowCellByColIdx.set(ft,new Map);qt.rowNonEmptyCols.set(ft,[]);return}const Gt=new Map;const gn=[];for(const Fn of zt.cells){const Tr=ps(Fn.address);Gt.set(Tr,Fn);const Jr=Fn.value!=null&&String(Fn.value)!=="";const jr=!!Fn.paragraphs?.some(sr=>sr.runs?.some(bn=>(bn.text??"").length>0));if(Jr||jr||Fn.formula||typeof Fn.sharedFormulaSi==="number")gn.push(Tr)}gn.sort((Fn,Tr)=>Fn-Tr);qt.rowCellByColIdx.set(ft,Gt);qt.rowNonEmptyCols.set(ft,gn)}const dr=ce.colStyleIndices;const rn=ce.tableResolversByRow;const St=ce.tableHorizontalBoundaries;const Ut=ft=>L&&L[ft]!=null?L[ft]:ft;const Pt=(ft,zt)=>{const Gt=rn.get(ft);if(!Gt||Gt.length===0){return void 0}return Gt.find(gn=>gn.contains(ft,zt))};const an=new Set;for(let ft=Hr;ft<=Mr;ft+=1){an.add(ft)}for(const ft of Er.keys()){an.add(ft)}const Xt=Array.from(an).filter(ft=>ft>=0&&ftft-zt);const Cn=ft=>{const zt=new Set;if(ft>=Hr&&ft<=Mr){for(let gn=on;gn<=cr;gn+=1){zt.add(gn)}}const Gt=Er.get(ft);if(Gt){for(const gn of Gt){zt.add(gn)}}return Array.from(zt).filter(gn=>gn>=0&&gngn-Fn)};for(const ft of Xt){const zt=ft>=Hr&&ft<=Mr;const Gt=Yr.get(ft);const gn=j+(lr[ft]??0)-tt;const Fn=a[ft]??0;const Tr=!!K?.hasMeasuredRow?.(ft);const Jr=zt&&!!K&&Fn>0&&K.isRowAuto(ft,Gt)&&!Tr;const jr=Jr?K.getBaselineHeight?.(ft,Gt)??Fn:0;let sr=Jr?jr:0;const bn=[];for(const ir of Cn(ft)){const Jn=X+(At[ir]??0)-Ee;let er=o[ir]??0;let Pr=Fn;const Vt=_t(ft,ir);const di=Ut(ft);const ln=Pt(di,ir);const yi=`${gf(ir)}${ft+1}`;const yo=XHt(Le,di,ir);const Pa=ln?ln.resolveCell(di,ir):void 0;const Ms=yo?.indentPx??0;const ds=nt.length>0?Rr(ft,ir):null;const st=ds!=null?eze(Pr):0;const en=ds!=null?Lge(Pr):0;const yn=Gt?.styleIndex;const jn=dr[ir];const xr=Vt?.styleIndex??yn??jn??0;const wr=g[xr]??{};const Dr=wr.wrapText===true;const Pn=wr.borders?.diagonal;const Ot=!!wr.borderDiagonalUp;const Nn=!!wr.borderDiagonalDown;const nr=wr.borderStyles?.diagonal;const Ur=Vt&&wr?WYr(Vt,wr):null;if(Vt){const fn=Oe(Vt);if(fn&&z?.addHyperlinkRect){const pi=Vt.address??`cell-${ft}-${ir}`;const Qr=`hyperlink:${pi}`;z.addHyperlinkRect({id:Qr,cssBounds:{x:Jn*m,y:gn*m,width:er*m,height:Pr*m},url:fn})}const vn=wr.font?.size??11*(96/72);const On=vn*sve;const{padLr:tr,padTb:ar}=PI(On||11);const oi=tr+Ms;const ei=tr+en;const Ar=!P&&bt(xr);if(Ar){qt.textMetrics.set(XO(ft,ir),{firstLineW:0,displayText:"",padLeft:oi,padRight:ei,padTb:ar,isNumeric:false})}else{const pi=He(Vt,xr);const Qr=Je(Vt);const wi=XO(ft,ir);const Li=!Dr&&!Jr?qt.textMetrics.get(wi):void 0;const ao=Li&&Li.padLeft===oi&&Li.padRight===ei&&Li.padTb===ar&&Li.displayText===pi&&Li.isNumeric===Qr?{firstLineW:Li.firstLineW,contentHeight:0}:Dr&&!Jr?{firstLineW:0,contentHeight:0}:!Qr?ze({cell:Vt,displayText:pi,widthPx:er,heightPx:Pr,paddingPx:{left:oi,right:ei,top:ar,bottom:ar},wrapTextEnabled:Dr,style:wr,tableCellStyle:Pa,pivotFontColor:yo?.fontColor,pivotBold:yo?.bold===true,numberFormatColorOverride:Ur}):{firstLineW:0,contentHeight:0};qt.textMetrics.set(XO(ft,ir),{firstLineW:ao.firstLineW,displayText:pi,padLeft:oi,padRight:ei,padTb:ar,isNumeric:Qr})}}let bi=false;let $i=ft;let Zi=ft;let Fo=ir;let Ao=ir;let Ho=wr.borders??null;let Ia=wr.borderStyles??null;{const fn=sn(ft,ir);if(fn){$i=fn.rowMin;Zi=fn.rowMax;Fo=fn.colMin;Ao=fn.colMax;bi=ft===$i&&ir===Fo;if(!bi){continue}er=(At[Ao+1]??0)-(At[Fo]??0);Pr=(lr[Zi+1]??0)-(lr[$i]??0);N?.(Jn,gn,er,Pr,"mergedCell");let vn=0,On=0,tr=0,ar=0;const oi={};const ei={};for(let Ar=Fo;Ar<=Ao;Ar++){const pi=_t($i,Ar);const Qr=g[pi?.styleIndex??0]??{};const wi=Qr.borderStyles?.top;const Li=mn(wi);if(Qr.borders?.top&&Li>=vn){oi.top=Qr.borders.top;ei.top=wi;vn=Li}}for(let Ar=Fo;Ar<=Ao;Ar++){const pi=_t(Zi,Ar);const Qr=g[pi?.styleIndex??0]??{};const wi=Qr.borderStyles?.bottom;const Li=mn(wi);if(Qr.borders?.bottom&&Li>=On){oi.bottom=Qr.borders.bottom;ei.bottom=wi;On=Li}}for(let Ar=$i;Ar<=Zi;Ar++){const pi=_t(Ar,Fo);const Qr=g[pi?.styleIndex??0]??{};const wi=Qr.borderStyles?.left;const Li=mn(wi);if(Qr.borders?.left&&Li>=tr){oi.left=Qr.borders.left;ei.left=wi;tr=Li}}for(let Ar=$i;Ar<=Zi;Ar++){const pi=_t(Ar,Ao);const Qr=g[pi?.styleIndex??0]??{};const wi=Qr.borderStyles?.right;const Li=mn(wi);if(Qr.borders?.right&&Li>=ar){oi.right=Qr.borders.right;ei.right=wi;ar=Li}}Ho=oi;Ia=ei}}if(ln){const fn=ln.resolveBorders(di,ir);if(Object.keys(fn).length>0){if(Ho&&Ho===wr.borders){Ho={...Ho}}if(Ia&&Ia===wr.borderStyles){Ia={...Ia}}if(!Ho)Ho={};if(!Ia)Ia={};const vn=["top","bottom","left","right"];for(const On of vn){const tr=fn[On];const ar=wr.borderSources?.[On]==="cell";if(tr&&!ar){Ho[On]=tr.colorCss;Ia[On]=tr.style}}}}if(yo&&Object.keys(yo.borders).length>0){if(Ho&&Ho===wr.borders){Ho={...Ho}}if(Ia&&Ia===wr.borderStyles){Ia={...Ia}}if(!Ho)Ho={};if(!Ia)Ia={};const fn=["top","bottom","left","right"];for(const vn of fn){const On=yo.borders[vn];if(On&&!Ho[vn]){Ho[vn]=On.colorCss;Ia[vn]=On.style}}}const ba=jHt({style:wr,cfRenderCache:Wt,rowIdx:ft,colIdx:ir,cell:Vt});if(Pa?.fillCss){N?.(Jn,gn,er,Pr,"tableFill");e.fillStyle=Pa.fillCss;qO(e,Jn,gn,er,Pr)}if(yo?.fillCss){N?.(Jn,gn,er,Pr,"pivotFill");e.fillStyle=yo.fillCss;qO(e,Jn,gn,er,Pr)}const ut=ba.baseFillCss;if(ut){N?.(Jn,gn,er,Pr,"cellFill");e.fillStyle=ut;qO(e,Jn,gn,er,Pr)}const ke=ba.conditionalFormatting.fillCss;const je=ba.conditionalFormatting.textColor;if(ke){N?.(Jn,gn,er,Pr,"cfFill");e.fillStyle=ke;qO(e,Jn,gn,er,Pr)}if(_.has(`${oe}:${yi}`)){N?.(Jn,gn,er,Pr,"unsupported");e.fillStyle=ge;qO(e,Jn,gn,er,Pr)}if(C&&f===ft&&h===ir){e.fillStyle="rgba(255,255,0,0.2)";qO(e,Jn,gn,er,Pr)}const gt=dt(Vt);const Rt=Wt&>!=null?Wt.getDataBar(ft,ir,Vt):null;if(Rt&>!=null){const fn=gt;const vn=1;const On=Math.max(0,er-vn*2);const tr=Math.max(0,Pr-vn*2);const ar=Rt.vMin;const oi=Rt.vMax;const ei=ar<0&&oi>0;if(oi!==ar&&On>0&&tr>0){let Ar=Jn+vn;let pi=0;let Qr=0;let wi=true;if(ar>=0){const Li=Math.max(0,Math.min(1,(fn-ar)/(oi-ar)));pi=Li*On;wi=true}else if(oi<=0){const Li=Math.max(0,Math.min(1,(fn-oi)/(ar-oi)));pi=Li*On;Ar=Jn+vn+(On-pi);wi=false}else{const Li=-ar/(oi-ar);Qr=On*Li;if(fn>=0){const ao=Math.max(0,Math.min(1,fn/oi));Ar=Jn+vn+Qr;pi=ao*(On-Qr);wi=true}else{const ao=Math.max(0,Math.min(1,fn/ar));Ar=Jn+vn+Qr-ao*Qr;pi=ao*Qr;wi=false}}if(pi>.5){N?.(Ar,gn+vn,pi,tr,"dataBar");e.save();const Li=fn<0?Rt.negativeColorCss??Rt.colorCss:Rt.colorCss;const ao=fn<0?Rt.negativeBorderColorCss??(Rt.negativeBorderColorSameAsPositive?Rt.borderColorCss:Rt.border?Rt.negativeColorCss??Rt.borderColorCss:null):Rt.border?Rt.borderColorCss??Rt.colorCss:null;e.globalAlpha=1;if(Rt.gradient){const Mo=e.createLinearGradient(Ar,gn+vn,Ar+pi,gn+vn);if(wi){Mo.addColorStop(0,Li);Mo.addColorStop(1,"rgba(255,255,255,0.92)")}else{Mo.addColorStop(0,"rgba(255,255,255,0.92)");Mo.addColorStop(1,Li)}e.fillStyle=Mo}else{e.fillStyle=Li}e.fillRect(Ar,gn+vn,pi,tr);if(ao){e.globalAlpha=.85;e.strokeStyle=ao;e.lineWidth=1;e.strokeRect(Math.round(Ar)+.5,Math.round(gn+vn)+.5,Math.max(0,Math.round(pi)-1),Math.max(0,Math.round(tr)-1))}e.restore()}if(ei&&Rt.axisPosition!=="none"){const Li=Jn+vn+Qr;e.save();e.strokeStyle=Rt.axisColorCss??"#000000";e.lineWidth=1;e.setLineDash([2,2]);e.beginPath();e.moveTo(Li+.5,gn+vn);e.lineTo(Li+.5,gn+vn+tr);e.stroke();e.restore()}}}if(Ho){const fn=Ho;const vn=Ia??{};if(fn.top){if(vn.top==="double"){VZ(e,"top",fn.top,Jn,gn,er,Pr)}else{if(vn.top==="slantDashDot"){$Z(e,"top",fn.top,Jn,gn,er,Pr)}else{$O(e,vn.top,fn.top);e.beginPath();e.moveTo(Jn,gn);e.lineTo(Jn+er,gn);e.stroke();e.restore()}}}if(fn.bottom){if(vn.bottom==="double"){VZ(e,"bottom",fn.bottom,Jn,gn,er,Pr)}else{if(vn.bottom==="slantDashDot"){$Z(e,"bottom",fn.bottom,Jn,gn,er,Pr)}else{$O(e,vn.bottom,fn.bottom);e.beginPath();e.moveTo(Jn,gn+Pr);e.lineTo(Jn+er,gn+Pr);e.stroke();e.restore()}}}if(fn.left){if(vn.left==="double"){VZ(e,"left",fn.left,Jn,gn,er,Pr)}else{if(vn.left==="slantDashDot"){$Z(e,"left",fn.left,Jn,gn,er,Pr)}else{$O(e,vn.left,fn.left);e.beginPath();e.moveTo(Jn,gn);e.lineTo(Jn,gn+Pr);e.stroke();e.restore()}}}if(fn.right){if(vn.right==="double"){VZ(e,"right",fn.right,Jn,gn,er,Pr)}else{if(vn.right==="slantDashDot"){$Z(e,"right",fn.right,Jn,gn,er,Pr)}else{$O(e,vn.right,fn.right);e.beginPath();e.moveTo(Jn+er,gn);e.lineTo(Jn+er,gn+Pr);e.stroke();e.restore()}}}}if(te.showGridLines!==false){const fn=ba.hasAnyFill;if(!fn){e.strokeStyle=be;e.lineWidth=kt;const vn=(()=>{const Li=_t(ft-1,ir);const ao=Li?.styleIndex??0;return g[ao]??{}})();const On=(()=>{const Li=_t(ft,ir-1);const ao=Li?.styleIndex??0;return g[ao]??{}})();const tr=!!Ho?.top;const ar=!!vn.borders?.bottom;const oi=Jt(ft,ir);const ei=St.has(`${ft}:${ir}`);if(!tr&&!ar&&!oi&&!ei){e.beginPath();e.moveTo(Jn,gn);e.lineTo(Jn+er,gn);e.stroke()}const Ar=!!Ho?.left;const pi=!!On.borders?.right;const Qr=Ne(ft,ir-1);const wi=Sn(ft,ir);if(!Ar&&!pi&&!Qr&&!wi){e.beginPath();e.moveTo(Jn,gn);e.lineTo(Jn,gn+Pr);e.stroke()}}}if(w.has(yi)){const fn=x[yi];if(fn){e.save();e.fillStyle=fn+"22";qO(e,Jn,gn,er,Pr);e.restore();const vn=(ei,Ar)=>`${gf(Ar)}${ei+1}`;e.save();e.strokeStyle=fn;e.lineWidth=2;const On=ft>0?vn(ft-1,ir):null;if(!On||!w.has(On)){e.beginPath();e.moveTo(Jn,gn);e.lineTo(Jn+er,gn);e.stroke()}const tr=vn(ft+1,ir);if(!w.has(tr)){e.beginPath();e.moveTo(Jn,gn+Pr);e.lineTo(Jn+er,gn+Pr);e.stroke()}const ar=ir>0?vn(ft,ir-1):null;if(!ar||!w.has(ar)){e.beginPath();e.moveTo(Jn,gn);e.lineTo(Jn,gn+Pr);e.stroke()}const oi=vn(ft,ir+1);if(!w.has(oi)){e.beginPath();e.moveTo(Jn+er,gn);e.lineTo(Jn+er,gn+Pr);e.stroke()}e.restore()}}if(ds){if(z?.addDataValidationTarget){const fn=oe||"sheet";z.addDataValidationTarget({id:`dv:${fn}:${yi}`,addr:yi,sheetName:fn,cssBounds:{x:(Jn+Math.max(0,er-en))*m,y:gn*m,width:en*m,height:Pr*m}})}}const Ct=!!Vt&&!ds&&!P&&bt(xr);const Mt=Vt?UGt({cell:Vt,isCheckbox:Ct,x:Jn,y:gn,w:er,h:Pr,zoom:m}):null;const Ft=wr.font?.size??10*(96/72);const Dt=Vt&&!ds&&!Mt&&Wt?Wt.getIconSet(ft,ir,Vt):null;const Qt=Dt&&Vt?YGt({x:Jn,y:gn,width:er,height:Pr,fontSizePx:Ft,iconSetName:Dt.iconSetName,showValue:Dt.showValue}):null;if(Mt){if(z?.addCheckboxTarget){z.addCheckboxTarget({id:`checkbox:${yi}`,address:yi,checked:Mt.checked,cssBounds:Mt.cssBounds})}bn.push(()=>{VGt(e,Mt,{accentColor:H,darkMode:W});if(Pn&&(Ot||Nn)){$O(e,nr,Pn);if(Nn){e.beginPath();e.moveTo(Jn,gn);e.lineTo(Jn+er,gn+Pr);e.stroke()}if(Ot){e.beginPath();e.moveTo(Jn,gn+Pr);e.lineTo(Jn+er,gn);e.stroke()}e.restore()}})}if(Vt&&!Mt){const fn=!!Dt&&!Dt.showValue;const vn=fn?"":He(Vt,xr);const On=Je(Vt);const tr={anchor:wr.verticalAlign??3,alignment:wr.align==="center"?2:wr.align==="right"?3:wr.align==="left"?1:On?3:1};const ar=yo?.fontColor;const oi=yo?.bold===true;if(typeof Vt.styleIndex==="number"&&!yt.has(Vt.styleIndex)&&yt.size<12){yt.add(Vt.styleIndex)}const ei=ye(ft,ir);const Ar=wr.font?.size??10*(96/72);const pi=Ar*sve;const{padLr:Qr,padTb:wi}=PI(pi||11);const Li=Qt?.reservedWidth??0;const ao=Qr+Ms+Li;const Mo=Qr+en;const fo=qt.textMetrics.get(XO(ft,ir))?.firstLineW??0;qt.textMetrics.set(XO(ft,ir),{firstLineW:fo,displayText:vn,padLeft:ao,padRight:Mo,padTb:wi,isNumeric:On});const fs=Math.max(0,er-(ao+Mo));const Ga=!Dr&&!On&&fo>fs;const ea=Math.max(er,fo+(ao+Mo));const ha=bi&&(Ao>Fo||Zi>$i)?er:ei;const bo=Ga?Math.min(ha,ea):er;const aa=Ga?{...tr,alignment:1}:tr;const Ts=!Ze(Vt);const{element:Xo,layout:Qa}=vn===""?{element:null,layout:null}:Me({cell:Vt,displayText:vn,resolvedTextStyle:aa,widthPx:bo,heightPx:Pr,paddingPx:{left:ao,right:Mo,top:wi,bottom:wi},wrapTextEnabled:Dr,style:wr,tableCellStyle:Pa,pivotFontColor:ar,pivotBold:oi,conditionalFormattingTextColor:je,numberFormatColorOverride:Ur,styleIndex:xr,rowIdx:ft,colIdx:ir,cacheable:Ts});if(Jr&&$i===Zi){const es=Qa?.lines?.reduce((sc,Ul)=>sc+Ul.heightPx,0)??0;if(es>sr){sr=es}}const xu=()=>{if(Qt&&Dt){qGt(e,{iconSetName:Dt.iconSetName,iconIndex:Dt.iconIndex,x:Qt.x,y:Qt.y,width:Qt.width,height:Qt.height})}if(fn&&vn===""){return}e.save();e.beginPath();e.rect(Jn,gn,bo,Pr);e.clip();if(Qa&&Xo){y3(Xo,Qa,e,void 0,{resolvedStyle:aa,bboxPx:{x:Jn,y:gn,width:bo,height:Pr},paddingPx:{left:ao,right:Mo,top:wi,bottom:wi},themeMap:A})}e.restore()};bn.push(()=>{N?.(Jn,gn,bo,Pr,`text:addr=${yi} r=${ft} c=${ir} firstLine=${Math.round(fo)} content=${Math.round(fs)} draw=${Math.round(bo)} spills=${Ga}`);xu();if(ds&&st>0){const es=Jn+er-st-Mge;const sc=gn+(Pr-st)/2;e.save();e.fillStyle="rgba(107, 114, 128, 0.9)";e.beginPath();e.moveTo(es,sc+2);e.lineTo(es+st,sc+2);e.lineTo(es+st/2,sc+st);e.closePath();e.fill();e.restore()}if(Pn&&(Ot||Nn)){$O(e,nr,Pn);if(Nn){e.beginPath();e.moveTo(Jn,gn);e.lineTo(Jn+er,gn+Pr);e.stroke()}if(Ot){e.beginPath();e.moveTo(Jn,gn+Pr);e.lineTo(Jn+er,gn);e.stroke()}e.restore()}})}}for(const ir of bn)ir();if(Jr){const ir=Fn;const Jn=Math.max(jr,sr);if(Jn>0&&Math.abs(Jn-ir)>.5){K.requestUpdate(ft,Jn)}K.markRowMeasured?.(ft)}}e.save();if(!$){e.translate(-Nl,-Ol)}QGt(e,te,t,At,lr,Ee,tt,u/m+($?0:Nl),d/m+($?0:Ol),z?.addImageTarget,m);e.restore();const rr=te.sparklineGroups.renderContext;e.save();if(!$){e.translate(-Nl,-Ol)}DGt(e,rr,At,lr,Ee,tt,u/m+($?0:Nl),d/m+($?0:Ol),A);e.restore();e.save();if(!$){e.translate(-Nl,-Ol)}tHt(e,te,At,lr,Ee,tt,u/m+($?0:Nl),d/m+($?0:Ol),A,N,z?.addShapeTarget,m,U);e.restore();const hr=z?.setChartHoverTargets?[]:null;e.save();if(!$){e.translate(-Nl,-Ol)}IGt(e,te,t,At,lr,Ee,tt,u/m+($?0:Nl),d/m+($?0:Ol),A,I,U,hr??void 0,O?.mapCtx,O?.onMapViewport);e.restore();if(hr){z?.setChartHoverTargets?.(hr)}const Et=ft=>ft/9525;const Tn=te.charts.items;if((N||z?.addChartTarget)&&Tn.length>0){for(const[ft,zt]of Tn.entries()){const Gt=zt.toDrawingProto();if(!Gt.chart||!Gt.fromAnchor)continue;const gn=Number(Gt.fromAnchor.colId);const Fn=Number(Gt.fromAnchor.rowId);const Tr=At[gn];const Jr=lr[Fn];if(Tr==null||Jr==null)continue;const jr=X+Tr+Et(Number(Gt.fromAnchor.colOffset))-Ee;const sr=j+Jr+Et(Number(Gt.fromAnchor.rowOffset))-tt;let bn=null;let ir=null;let Jn=false;if(Gt.toAnchor){Jn=true;const Pr=Number(Gt.toAnchor.colId);const Vt=Number(Gt.toAnchor.rowId);const di=At[Pr];const ln=lr[Vt];if(di==null||ln==null)continue;const yi=X+di+Et(Number(Gt.toAnchor.colOffset))-Ee;const yo=j+ln+Et(Number(Gt.toAnchor.rowOffset))-tt;bn=yi-jr;ir=yo-sr}else if(Gt.extentCx&&Gt.extentCy){bn=Et(Number(Gt.extentCx));ir=Et(Number(Gt.extentCy))}if(bn==null||ir==null||bn<=0||ir<=0)continue;N?.(jr,sr,bn,ir,"chart");const er=Gt.chart?.id||zt.id||`chart-${ft}`;if(z?.addChartTarget){z.addChartTarget({id:er,logicalBounds:{x:jr,y:sr,width:bn,height:ir},cssBounds:{x:jr*m,y:sr*m,width:bn*m,height:ir*m},drawing:Gt,usesTwoCellAnchor:Jn})}}}if($){e.textAlign="center";e.textBaseline="middle";e.font="12px sans-serif";for(let zt=on;zt<=cr;zt++){const Gt=Nl+(At[zt]??0)-Ee;const gn=o[zt]??0;e.fillStyle=Ie;e.fillRect(Gt,0,gn,Ol);e.strokeStyle=he;e.lineWidth=kt;e.strokeRect(Gt,0,gn,Ol);e.fillStyle=ve;e.fillText(gf(zt),Gt+gn/2,Ol/2)}for(let zt=Hr;zt<=Mr;zt++){const Gt=Ol+(lr[zt]??0)-tt;const gn=a[zt]??0;if(gn<=0)continue;e.fillStyle=Ie;e.fillRect(0,Gt,Nl,gn);e.strokeStyle=he;e.lineWidth=kt;e.strokeRect(0,Gt,Nl,gn);e.fillStyle=ve;e.fillText((zt+1).toString(),Nl/2,Gt+gn/2)}e.fillStyle=Ie;e.fillRect(0,0,Nl,Ol);e.strokeStyle=he;e.lineWidth=kt;e.strokeRect(0,0,Nl,Ol);const ft=NGt({worksheet:te,rowHeights:a,colWidths:o,rowIndexRemap:L});if(ft){const zt=H;const Gt=m||1;const gn=2/Gt;for(const Fn of ft.colBoundaries){if(Fn=cr)continue;const Tr=Nl+(At[Fn+1]??0)-Ee;const Jr=Tr-gn/2;if(Jr+gn<0||Jr>u/Gt)continue;e.fillStyle=zt;e.fillRect(Jr,0,gn,Ol)}for(const Fn of ft.rowBoundaries){if(Fn=Mr)continue;const Tr=Ol+(lr[Fn+1]??0)-tt;const Jr=Tr-gn/2;if(Jr+gn<0||Jr>d/Gt)continue;e.fillStyle=zt;e.fillRect(0,Jr,Nl,gn)}}}e.restore()}Yl();bs();function QHt(e,t){const n=e.resolveFrame();const r=e.workbook;const i=e.view;const o=YYr(r,i);const a=i.rangeA1??qYr(o);const s=fi(a);if(!s){throw new Error(`Embedded workbook view has invalid range: ${a}`)}const l=s.bounds;const u=jYr(o,l);const d=i.showHeaders===true?Nl:0;const f=i.showHeaders===true?Ol:0;const h=u.width+d;const m=u.height+f;const g=h>0&&m>0?Math.min(n.width/h,n.height/m):1;const x=r.getSpreadsheetRenderAssets();const w=o.showGridLines;if(i.showGridlines!==void 0){o.showGridLines=i.showGridlines}t.save();t.beginPath();t.rect(n.left,n.top,n.width,n.height);t.clip();t.translate(n.left,n.top);try{cM(t,r,o.name,u.scrollX*g,u.scrollY*g,n.width,n.height,null,null,g,x.styleInfos,{},new Set,new Set,false,x.themeMap,false,void 0,void 0,void 0,{maxCols:l.endCol+1,maxRows:l.endRow+1,showHeaders:i.showHeaders===true,backgroundColor:i.backgroundFill})}finally{if(i.showGridlines!==void 0){o.showGridLines=w}t.restore()}}function YYr(e,t){const n=t.sheetId;if(n!==void 0){const r=e.worksheets.items.find(i=>i.id===n);if(!r){throw new Error(`Worksheet artifact view sheet ${n} not found.`)}return r}return e.worksheets.getActive()}function qYr(e){const t=XYr(e);return Io(t)}function XYr(e){let t=Number.POSITIVE_INFINITY;let n=Number.POSITIVE_INFINITY;let r=0;let i=0;for(const o of e.__getRows()){const a=Math.max(0,(o.index??1)-1);for(const s of o.cells){const l=s.address;if(!l){continue}const u=ps(l);const d=s.value!==void 0||s.formula!==void 0||s.paragraphs.length>0||s.styleIndex!==void 0;if(!d){continue}t=Math.min(t,a);n=Math.min(n,u);r=Math.max(r,a);i=Math.max(i,u)}}for(const o of e.__getMergedCells()){t=Math.min(t,vl(o.startAddress));n=Math.min(n,ps(o.startAddress));r=Math.max(r,vl(o.endAddress));i=Math.max(i,ps(o.endAddress))}if(t===Number.POSITIVE_INFINITY||n===Number.POSITIVE_INFINITY){return{startRow:0,startCol:0,endRow:0,endCol:0}}return{startRow:t,startCol:n,endRow:r,endCol:i}}function jYr(e,t){const n=e.__getViewportLayout({maxCols:t.endCol+1,maxRows:t.endRow+1});const r=n.colOffsetsPx[t.startCol]??0;const i=n.colOffsetsPx[t.endCol+1]??r;const o=n.rowOffsetsPx[t.startRow]??0;const a=n.rowOffsetsPx[t.endRow+1]??o;return{width:Math.max(1,i-r),height:Math.max(1,a-o),scrollX:r,scrollY:o}}var KYr="#F7F7F7";function eWt(e){const{width:t,height:n,ctx:r}=e;if(t<=0||n<=0){return}r.save();r.fillStyle=KYr;r.fillRect(0,0,t,n);r.restore()}function ZYr(e){return e!==void 0&&e!==0&&e!==-1&&e!==5}function JYr(e){const t=e?.geometry;if(t!==void 0&&t in yf){return yf[t]}return void 0}function QYr(e){return e?.adjustmentList?.reduce((t,n)=>{t[n.name]=n.formula;return t},{})}function tWt(e){const t=JYr(e);if(!ZYr(t)){return void 0}const n=$b(t);if(!n){return void 0}return{preset:n,adjustments:QYr(e)}}function gGe(e,t,n,r){P$t(e,t.preset,{w:n,h:r,x:0,y:0,adjustments:t.adjustments})}function yGe(e,t,n,r,i,o){const a=e.line;const s=a.toProto();const l=a.width??0;if(!s||!Number.isFinite(l)||l<=0){return}const u=Uc(t,{x:0,y:0,width:i,height:o},s.fill,n);const d=s.style===void 0||s.style===0?1:s.style;t.save();t.lineWidth=l;t.strokeStyle=u;FT(t,d,l);if(r){gGe(t,r,i,o);t.stroke();t.restore();return}t.beginPath();t.rect(0,0,i,o);t.stroke();t.restore()}async function uve(e,t,n,r={}){if(!e.imageReferenceId)return;const i=e.resolveFrame();const{width:o,height:a}=i;const s=await e.getBitmap();const l=e.resolveImageFill();let u=0,d=0,f=s?.width??0,h=s?.height??0;const m=O=>(O??0)/1e5;const g=l.srcRect;if(s){if(g){const O=m(g.l);const z=m(g.t);const U=m(g.r);const W=m(g.b);u+=O*s.width;d+=z*s.height;f-=(O+U)*s.width;h-=(z+W)*s.height}}let x=0;let w=0;let _=o;let C=a;const A=l.stretchFillRect;if(A){const O=m(A.l);const z=m(A.t);const U=m(A.r);const W=m(A.b);x=O*o;w=z*a;_=o*(1-O-U);C=a*(1-z-W)}const P=e.resolveImageMask();const L=tWt(P);let I;const N=P?.geometry;if(N!==void 0){I=yf[N]}if(P&&I!==void 0&&I!==0&&I!==-1&&I!==5){if(s&&uGt(t,n,{frame:i,geometry:I,adjustmentList:P.adjustmentList,fill:l,bitmap:s})){_E(t,i);yGe(e,t,n,L,o,a);t.restore();return}}if(!P&&r.inheritedMaskSource&&s&&dGt(t,n,{frame:i,source:r.inheritedMaskSource,fill:l,bitmap:s,contentType:e.image?.contentType})){fGt(t,n,{frame:i,source:r.inheritedMaskSource,line:e.line});return}_E(t,i);if(L){t.save();gGe(t,L,o,a);t.clip()}if(s){const O=rk(s,{pictureEffects:l.pictureEffects,contentType:e.image?.contentType,themeMap:n});t.save();t.globalAlpha*=O.opacity;t.drawImage(O.source,u,d,f,h,x,w,_,C);t.restore()}else{eWt({width:o,height:a,ctx:t,themeMap:n})}if(L){t.restore()}yGe(e,t,n,L,o,a);t.restore()}function eqr(e){const t=e.bbox;if(t?.xEmu===void 0||t.yEmu===void 0||t.widthEmu===void 0||t.heightEmu===void 0){return void 0}return{x:Number(t.xEmu),y:Number(t.yEmu),width:Number(t.widthEmu),height:Number(t.heightEmu),rotation:u3(t.rotation),horizontalFlip:t.horizontalFlip,verticalFlip:t.verticalFlip}}function nWt(e,t,n,r,i){const o=e.toProto();const a=o.children??[];if(a.length===0){return}const s=e.resolveFrame();const l=Number(o.bbox?.widthEmu);const u=Number(o.bbox?.heightEmu);if(!Number.isFinite(l)||!Number.isFinite(u)||l<=0||u<=0){return}_E(t,s);for(const d of a){const f=eqr(d);if(!f){continue}const h={left:f.x/l*s.width,top:f.y/u*s.height,width:f.width/l*s.width,height:f.height/u*s.height,rotation:f.rotation,horizontalFlip:f.horizontalFlip,verticalFlip:f.verticalFlip};if(d.type===5&&d.shape){yU(d,t,n,r,i,{frame:h})}if(d.type===1||d.type===2||(d.paragraphs?.length??0)>0){_E(t,h);ed(d,t,i,void 0,{bboxPx:{x:0,y:0,width:h.width,height:h.height},resolvedStyle:A0(d,n,r),masterDefaults:ik(d,n,r)});t.restore()}}t.restore()}var tqr=8;var nqr=2;var rWt=4;var rqr="#B1B1B1";var iqr=1;var iWt=12;var oqr="rgba(37, 99, 235, 0.9)";var aqr=6;var sqr=4;var lqr=3;var cqr=1e-6;function uqr(e,t){return t?.viewport??{left:0,top:0,width:e.frame.width,height:e.frame.height}}function hve(e,t){if(t===void 0||t<=0){return e}return e/t}function dqr(e){return Math.max(hve(1,e),.25)}function oWt(e){const t=e===void 0?0:Bo(e);if(!Number.isFinite(t)||t<=0){return tqr}return Math.max(nqr,t)}function dve(e,t){if(t===void 0||t<=0){return e}const n=e*t;if(n>=rWt){return e}return e*Math.ceil(rWt/n)}function fve(e,t,n){return t+Math.ceil((e-t)/n)*n}function fqr(e,t,n){const r=Math.round((e-t)/n);return Math.abs(t+r*n-e)({...i,cells:i.cells.map(o=>({...o,elements:o.elements?.map(a=>yve(a,t))}))}))}}}const r=n.children?.map(i=>yve(i,t))??[];if(r.length===0){return n}return{...n,children:r}}function bqr(e,t){const n=e.table;if(!n){return e}const r=t.resolve(n.properties?.styleId);if(!r){return e}return{...e,table:xqr(n,r)}}function xqr(e,t){const n=e.rows.map((r,i)=>({...r,cells:r.cells.map((o,a)=>{return _qr(o,vqr(e,t,i,a),e,i,a)})}));return{...e,rows:n}}function cWt(e){if(e===void 0){return false}const t=e.tableProperties?.borders;if(t?.top!==void 0||t?.right!==void 0||t?.bottom!==void 0||t?.left!==void 0||t?.insideHorizontal!==void 0||t?.insideVertical!==void 0){return true}const n=e.cellStyle?.borders;if(n?.top!==void 0||n?.right!==void 0||n?.bottom!==void 0||n?.left!==void 0||n?.diagonalDown!==void 0||n?.diagonalUp!==void 0){return true}return gWt(e.cellStyle?.lines)}function vqr(e,t,n,r){const i=[];if(t.wholeTable){i.push({condition:1,style:t.wholeTable})}for(const o of t.conditionalStyles){if(o.style&&fWt(e,o,n,r)){i.push({condition:o.condition,style:o.style})}}return i}function fWt(e,t,n,r){const i=e.properties;const o=e.rows.length-1;const a=Math.max(0,...e.rows.map(s=>s.cells.length-1));switch(t.condition){case 1:return true;case 2:return i?.firstRow===true&&n===0;case 3:return i?.lastRow===true&&n===o;case 4:return i?.firstColumn===true&&r===0;case 5:return i?.lastColumn===true&&r===a;case 6:return uWt(e,n,0);case 7:return uWt(e,n,1);case 8:return dWt(e,r,0);case 9:return dWt(e,r,1);case 10:return n===0&&r===0;case 11:return n===0&&r===a;case 12:return n===o&&r===0;case 13:return n===o&&r===a;default:return false}}function uWt(e,t,n){const r=e.properties;if(r?.bandedRows!==true){return false}const i=r.firstRow===true?1:0;const o=r.lastRow===true?e.rows.length-2:e.rows.length-1;if(to){return false}return(t-i)%2===n}function dWt(e,t,n){const r=e.properties;if(r?.bandedColumns!==true){return false}const i=Math.max(0,...e.rows.map(s=>s.cells.length-1));const o=r.firstColumn===true?1:0;const a=r.lastColumn===true?i-1:i;if(ta){return false}return(t-o)%2===n}function _qr(e,t,n,r,i){const o=hWt(t.map(l=>l.style));if(!o){return e}const a=Sqr(t,n,r,i);const s=a===void 0?o:{...o,cellStyle:{...o.cellStyle??{},lines:a}};return Nqr(e,s)}function hWt(e){if(e.length===0){return void 0}let t={};for(const n of e){t={tableProperties:Tqr(n.tableProperties,t.tableProperties),cellStyle:wqr(n.cellStyle,t.cellStyle),textStyle:k0(n.textStyle,t.textStyle),paragraphStyle:Vb(n.paragraphStyle,t.paragraphStyle),spaceBefore:n.spaceBefore??t.spaceBefore,spaceAfter:n.spaceAfter??t.spaceAfter}}return t}function Tqr(e,t){if(!e&&!t){return void 0}return{...t??{},...e??{},borders:Eqr(e?.borders,t?.borders),cellMargins:Cqr(e?.cellMargins,t?.cellMargins),effects:e?.effects??t?.effects??[]}}function wqr(e,t){if(!e&&!t){return void 0}return{fill:e?.fill??t?.fill,lines:mWt(e?.lines,t?.lines),borders:pWt(e?.borders,t?.borders),marginLeft:e?.marginLeft??t?.marginLeft,marginRight:e?.marginRight??t?.marginRight,marginTop:e?.marginTop??t?.marginTop,marginBottom:e?.marginBottom??t?.marginBottom,anchor:e?.anchor??t?.anchor,textDirection:e?.textDirection??t?.textDirection}}function Eqr(e,t){if(!e&&!t){return void 0}return{top:e?.top??t?.top,right:e?.right??t?.right,bottom:e?.bottom??t?.bottom,left:e?.left??t?.left,insideHorizontal:e?.insideHorizontal??t?.insideHorizontal,insideVertical:e?.insideVertical??t?.insideVertical}}function pWt(e,t){if(!e&&!t){return void 0}return{top:e?.top??t?.top,right:e?.right??t?.right,bottom:e?.bottom??t?.bottom,left:e?.left??t?.left,diagonalDown:e?.diagonalDown??t?.diagonalDown,diagonalUp:e?.diagonalUp??t?.diagonalUp}}function Cqr(e,t){if(!e&&!t){return void 0}return{left:e?.left??t?.left,right:e?.right??t?.right,top:e?.top??t?.top,bottom:e?.bottom??t?.bottom}}function mWt(e,t){if(!e&&!t){return void 0}return{top:e?.top??t?.top,right:e?.right??t?.right,bottom:e?.bottom??t?.bottom,left:e?.left??t?.left,diagonalDown:e?.diagonalDown??t?.diagonalDown,diagonalUp:e?.diagonalUp??t?.diagonalUp}}function Sqr(e,t,n,r){const i={};for(const o of e){kqr(i,o.style.tableProperties?.borders,o.condition,t,n,r);Rqr(i,pWt(o.style.cellStyle?.borders,Aqr(o.style.cellStyle?.lines)))}return gWt(i)?i:void 0}function Aqr(e){if(!e){return void 0}return{top:kU(e.top),right:kU(e.right),bottom:kU(e.bottom),left:kU(e.left),diagonalDown:kU(e.diagonalDown),diagonalUp:kU(e.diagonalUp)}}function kU(e){return e?{line:e}:void 0}function kqr(e,t,n,r,i,o){if(!t){return}if(Pqr(r,n,i)){d_(e,"top",t.top)}if(Lqr(r,n,o)){d_(e,"right",t.right)}if(Iqr(r,n,i)){d_(e,"bottom",t.bottom)}if(Mqr(r,n,o)){d_(e,"left",t.left)}if(Dqr(r,n,i)){d_(e,"bottom",t.insideHorizontal)}if(Fqr(r,n,o)){d_(e,"right",t.insideVertical)}}function Rqr(e,t){if(!t){return}d_(e,"top",t.top);d_(e,"right",t.right);d_(e,"bottom",t.bottom);d_(e,"left",t.left);d_(e,"diagonalDown",t.diagonalDown);d_(e,"diagonalUp",t.diagonalUp)}function d_(e,t,n){if(!n){return}if(n.none===true){delete e[t];return}if(n.line){e[t]=n.line}}function Pqr(e,t,n){switch(t){case 1:case 4:case 5:case 8:case 9:return n===0;case 3:case 12:case 13:return n===e.rows.length-1;default:return true}}function Iqr(e,t,n){switch(t){case 1:case 4:case 5:case 8:case 9:return n===e.rows.length-1;case 2:case 10:case 11:return n===0;default:return true}}function Mqr(e,t,n){switch(t){case 1:case 2:case 3:case 6:case 7:return n===0;case 5:case 11:case 13:return n===vGe(e);default:return true}}function Lqr(e,t,n){switch(t){case 1:case 2:case 3:case 6:case 7:return n===vGe(e);case 4:case 10:case 12:return n===0;default:return true}}function Dqr(e,t,n){switch(t){case 1:case 4:case 5:case 8:case 9:return nt.cells.length-1))}function Nqr(e,t){const n=t.cellStyle;const r=n?.fill??t.tableProperties?.fill;const i={...e,fill:e.fill??r,textStyle:k0(e.textStyle,t.textStyle),paragraphs:e.paragraphs.map(o=>Oqr(o,t))};if(n){Bqr(i,e,n)}return i}function Oqr(e,t){return{...e,textStyle:k0(e.textStyle,t.textStyle),paragraphStyle:Vb(e.paragraphStyle,t.paragraphStyle),spaceBefore:e.spaceBefore??t.spaceBefore,spaceAfter:e.spaceAfter??t.spaceAfter}}function Bqr(e,t,n){e.lines=mWt(t.lines,n.lines);e.marginLeft=mve(t.marginLeft,n.marginLeft,pve.left);e.marginRight=mve(t.marginRight,n.marginRight,pve.right);e.marginTop=mve(t.marginTop,n.marginTop,pve.top);e.marginBottom=mve(t.marginBottom,n.marginBottom,pve.bottom);e.anchor=t.anchor??n.anchor;e.textDirection=t.textDirection??n.textDirection}function gWt(e){return e?.top!==void 0||e?.right!==void 0||e?.bottom!==void 0||e?.left!==void 0||e?.diagonalUp!==void 0||e?.diagonalDown!==void 0}function mve(e,t,n){if(t===void 0){return e}if(e===void 0||e===n){return t}return e}function xGe(e){return e.trim().toLowerCase()}function zqr(e,t){const n=(t.rotation??0)*Math.PI/180;const r=t.verticalFlip?-1:1;if(n===0&&r===1){return false}const i=t.left+t.width/2;const o=t.top+t.height/2;e.save();e.translate(i,o);if(n!==0){e.rotate(n)}if(r!==1){e.scale(1,r)}e.translate(-i,-o);return true}function Uqr(e){if(e===2){return 90}if(e===3){return 270}return 0}function Vqr(e){const t=e%360;if(t<0){return t+360}return t}function $qr(e,t,n){if(t===0){return false}const r=n.x+n.width/2;const i=n.y+n.height/2;e.save();e.translate(r,i);e.rotate(t*Math.PI/180);e.translate(-r,-i);return true}function Gqr(e,t){if(t===0||t%180===0){return e}const n=e.x+e.width/2;const r=e.y+e.height/2;return{x:n-e.height/2,y:r-e.width/2,width:e.height,height:e.width}}function Hqr(e,t){if(t===90){return{left:e.top,right:e.bottom,top:e.right,bottom:e.left}}if(t===270){return{left:e.bottom,right:e.top,top:e.left,bottom:e.right}}return e}function Wqr(e){const t=new Set;const n=r=>{if(r?.type===4&&r.imageReference?.id){t.add(r.imageReference.id)}};n(e.textStyle?.fill);for(const r of e.paragraphs??[]){n(r.textStyle?.fill);for(const i of r.runs??[]){n(i.textStyle?.fill)}for(const i of r.inlineNodes??[]){n(i.textRun?.textStyle?.fill)}}return[...t]}async function Yqr(e,t,n){const r=Wqr(e);if(r.length===0){return void 0}const i=await Promise.all(r.map(async a=>{const s=t.images.getById(a);const l=await s?.getBitmap(n.width,n.height);return l?[a,{bitmap:l,contentType:s?.contentType}]:void 0}));const o=new Map;for(const a of i){if(a){o.set(a[0],a[1])}}return o.size>0?o:void 0}async function yWt(e,t){const n=await e.getPictureFillBitmap();if(!n){return void 0}const r=e.fill.imageReference?.id;const i=r?t.images.getById(r):void 0;return{bitmap:n,contentType:i?.contentType}}async function bve(e,t,n,r,i,o,a,s,l,u,d){const f=e.resolveRenderContext();const{themeMap:h}=f;const m=e.frame.width;const g=e.frame.height;n.save();n.globalAlpha=1;n.globalCompositeOperation="source-over";if(d?.clearBeforeDraw!==false){n.clearRect(0,0,m,g)}let x;await AGt(n,h,f.background,m,g,{clipRadiusPx:d?.backgroundClipRadiusPx});if(f.usesBackgroundFill){const L=n.createPattern(n.canvas,"no-repeat");if(!L){throw new Error("Unable to create a slide-background fill pattern.")}x=L}const w=f.drawElements.filter(L=>L.type==="image");await Promise.all(w.map(L=>L.getBitmap())).catch(L=>{console.error("Error warming images",L)});let _;let C;const A=t.tableStyles?.definitions;let P;if(A&&A.length>0){P=new gve(A)}for(let L=0;LW.table?.rows?.[J.row]?.cells?.[J.col]?.paragraphs?.[oe]?.runs?.[se]?.text??""})}}}if(I.type==="embeddedArtifact"){QHt(I,n)}if(I.type==="smartArt"){nWt(I,n,t,e,h)}if(I.type==="shape"){let W;if(I.connector){if(f.masterElements.includes(I)){if(_===void 0&&f.masterLayout!==void 0){_=f.masterLayout.elements.map($=>$.toProto())}W=_}else if(f.layoutElements.includes(I)){if(C===void 0&&f.layout!==void 0){C=f.layout.elements.map($=>$.toProto())}W=C}}const H=f.drawElementShapeRenderSources[L];if(H){const{source:$,pictureFillSource:K}=H;U=$;let X;if(!$.useBackgroundFill){X=await yWt(K,t)}BZ(I,n,t,e,h,{frame:O,backgroundFillPaint:x,pictureFillBitmap:X,pictureFill:K.fill,source:$,connectorRouteElements:W})}else{U=I.renderStyleData;let $;if(!I.useBackgroundFill){$=await yWt(I,t)}BZ(I,n,t,e,h,{frame:O,backgroundFillPaint:x,pictureFillBitmap:$,pictureFill:I.fill,connectorRouteElements:W})}}if(I.paragraphs.length>0){const W=N;const H=Vz({element:W,bboxPx:z,source:U});const $=A0(W,t,e);const K=Uqr($?.vertical);const X=Gqr(H,K);let j;if(K!==0){j=Hqr(cj($),K)}const te=$?.wrap===1?false:true;const J=$?.autoFit?.normalAutoFit?.fontScale;const oe=typeof J==="number"?J/1e5:1;const se=await Yqr(W,t,O);const re=zqr(n,O);const ce=$qr(n,K,H);let ue=$;if(K!==0){ue={...$,vertical:1}}let xe;try{xe=ed(W,n,h,r,{resolvedStyle:ue,masterDefaults:ik(W,t,e),bboxPx:X,paddingPx:j,wrap:te,textScale:oe,pictureFillBitmaps:se})}finally{if(ce){n.restore()}if(re){n.restore()}}if(xe&&u){const be=W.id&&W.id.length?W.id:`text:${Math.round(X.x)}:${Math.round(X.y)}:${Math.round(X.width)}:${Math.round(X.height)}`;u.add({id:be,layout:xe,rotationDeg:Vqr((O.rotation??0)+K+($?.rotation??0)),zIndex:W.zIndex??0,hitBox:{x:X.x,y:X.y,width:X.width,height:X.height},getRunText:(Ie,he)=>W.paragraphs?.[Ie]?.runs?.[he]?.text??""})}}if(r&&I.hyperlink){r.push({x:z.x,y:z.y,width:z.width,height:z.height,url:I.hyperlink.uri,action:I.hyperlink.action})}}if(d?.viewOverlay){sWt(n,t,e,h,d.viewOverlay)}n.restore()}var xve=class{#e;constructor(t,n){this.#e=(n??[]).map(r=>new jZ(this.#t(),r))}get items(){return[...this.#e]}add(){const t={id:"",type:0,tetherId:"",targetId:""};const n=new jZ(this.#t(),t);this.#e.push(n);return n}replace(t){this.#e=(t??[]).map(n=>new jZ(this.#t(),n))}toProto(){return this.#e.map(t=>t.toProto())}#t(){return{stub:()=>{}}}};var jZ=class{#e;constructor(t,n){this.#e={id:n.id??"",uri:n.uri??"",title:n.title??"",type:n.type??void 0}}get id(){return this.#e.id}toProto(){return{id:this.#e.id,uri:this.#e.uri??"",title:this.#e.title??"",type:this.#e.type}}};var jO=class{#e;#t;#n;constructor(t,n){this.#e=t;this.#n=new gi({type:"proto",proto:n?.fill});this.#t={ref:n?.ref}}get isSet(){return this.#n.isSet||this.#t.ref!==void 0}get fill(){return this.#n}get ref(){return this.#t.ref}set ref(t){this.#t.ref=t;this.#r({ref:t})}set fill(t){this.#n=new gi(t);this.#r({fill:t})}toProto(){if(!this.isSet){return void 0}return{fill:this.#n.toProto(),ref:this.#t.ref}}#r(t){const n=this.#e.recordOp;const r=this.#e.getTargetRef?.();if(!n||!r){return}const i={};if(t.fill!==void 0){const o=this.#n.toConfig();if(o&&jqr(o)){i.fill=o}}if(t.ref!==void 0){const o=Xqr(t.ref);if(o!==void 0){i.ref=o}}if(i.fill===void 0&&i.ref===void 0){return}n({op:"slide.background.set",target:r,...i})}};var qqr=":";function Xqr(e){const t=Number(e.index);const n=e.schemeColor?.trim();if(Number.isFinite(t)&&n){return`${t}${qqr}${n}`}if(n){return n}if(Number.isFinite(t)){return String(t)}return void 0}function jqr(e){if(!e||typeof e!=="object"){return true}if("type"in e&&e.type==="proto"){return false}return true}var zk={left:60,top:80,width:640,height:360};function Kqr(e){if(e.bbox!==void 0||e.placeholderIndex!==void 0||e.placeholderType!==void 0){return e}return{...e,bbox:{xEmu:Qi(zk.left),yEmu:Qi(zk.top),widthEmu:Qi(zk.width),heightEmu:Qi(zk.height)}}}var Uk=class extends bm{type="chart";#e;constructor(t,n){super(t,Kqr(n));if(this.data.type===void 0||this.data.type===0){this.data.type=6}const r=n.chartReference?.id?this.context.getChartById(n.chartReference.id):void 0;if(r){this.#e=r;this.data.chartReference={id:r.id}}else if(n.chartReference?.id){this.data.chartReference={id:n.chartReference.id}}}get id(){return this.data.id}toSnapshot(){const t=this.slideId;const n=this.id;return{aid:dXr("ch",t,n),kind:"chart",id:n,slideId:t,name:this.name,title:this.title??"",chartType:this.chartType,frame:this.frame}}get chart(){return this.#e??this.#t()}get chartType(){return this.#n().type}set chartType(t){this.#n().type=t}get title(){return this.#n().title}set title(t){this.#n().title=t}get titleTextStyle(){return this.#n().titleTextStyle}get titlePlacement(){return this.#n().titlePlacement}set titlePlacement(t){this.#n().titlePlacement=t}get styleIndex(){return this.#n().styleIndex}set styleIndex(t){this.#n().styleIndex=t}get categories(){return this.#n().categories}set categories(t){this.#n().categories=t}get hasLegend(){return this.#n().hasLegend}set hasLegend(t){this.#n().hasLegend=t}get displayBlanksAs(){return this.#n().displayBlanksAs}set displayBlanksAs(t){this.#n().displayBlanksAs=t}get showDlblsOverMax(){return this.#n().showDlblsOverMax}set showDlblsOverMax(t){this.#n().showDlblsOverMax=t}get style(){return this.#n().style}get chartFill(){return this.#n().chartFill}set chartFill(t){this.#n().chartFill=t}get chartLine(){return this.#n().chartLine}get plotAreaFill(){return this.#n().plotAreaFill}set plotAreaFill(t){this.#n().plotAreaFill=t}get plotAreaManualLayout(){return this.#n().plotAreaManualLayout}set plotAreaManualLayout(t){this.#n().plotAreaManualLayout=t}get plotAreaLine(){return this.#n().plotAreaLine}get legend(){return this.#n().legend}set legend(t){const n=this.#n();if(t instanceof A3){n.legend=t;return}Zqr(n.legend,t)}get dataLabels(){return this.#n().dataLabels}set dataLabels(t){const n=this.#n();if(t instanceof S3){n.dataLabels=t;return}Jqr(n.dataLabels,t)}get dataTable(){return this.#n().dataTable}set dataTable(t){const n=this.#n();if(t instanceof Qz){n.dataTable=t;return}Qqr(n.dataTable,t)}get xAxis(){return this.#n().xAxis}set xAxis(t){const n=this.#n();if(t instanceof ME){n.xAxis=t;return}bWt(n.xAxis,t)}get yAxis(){return this.#n().yAxis}set yAxis(t){const n=this.#n();if(t instanceof ME){n.yAxis=t;return}bWt(n.yAxis,t)}get barOptions(){return this.#n().barOptions}get lineOptions(){return this.#n().lineOptions}get areaOptions(){return this.#n().areaOptions}get scatterOptions(){return this.#n().scatterOptions}get pieOptions(){return this.#n().pieOptions}set pieOptions(t){const n=this.#n();if(t instanceof t9){n.pieOptions=t;return}iXr(n.pieOptions,t)}get doughnutOptions(){return this.#n().doughnutOptions}set doughnutOptions(t){const n=this.#n();if(t instanceof e9){n.doughnutOptions=t;return}lXr(n.doughnutOptions,t)}get treemapOptions(){return this.#n().treemapOptions}get mapOptions(){return this.#n().mapOptions}get funnelOptions(){return this.#n().funnelOptions}get boxWhiskerOptions(){return this.#n().boxWhiskerOptions}get histogramOptions(){return this.#n().histogramOptions}set histogramOptions(t){const n=this.#n();vWt(n,t)}get series(){return this.#n().series}get view3d(){return this.#n().view3d}set view3d(t){this.#n().view3d=t}setChartReference(t){this.data.chartReference=t?{id:t}:void 0;this.#e=t?this.context.getChartById(t):void 0}apply(t){if(!t)return;if(!t.position&&this.frame===void 0){this.position=zk}if(t.position)this.position=t.position;if(t.title!==void 0)this.title=t.title;if(t.titlePlacement!==void 0)this.titlePlacement=t.titlePlacement;if(t.titleTextStyle)uM(this.titleTextStyle,t.titleTextStyle);if(t.styleIndex!==void 0)this.styleIndex=t.styleIndex;if(t.displayBlanksAs!==void 0)this.displayBlanksAs=t.displayBlanksAs;if(t.showDlblsOverMax!==void 0)this.showDlblsOverMax=t.showDlblsOverMax;if(t.chartFill!==void 0)this.chartFill=t.chartFill;if(t.chartLine!==void 0)xWt(this.chartLine,t.chartLine);if(t.plotAreaFill!==void 0)this.plotAreaFill=t.plotAreaFill;if(t.plotAreaLine!==void 0)xWt(this.plotAreaLine,t.plotAreaLine);if(t.plotAreaManualLayout!==void 0)this.plotAreaManualLayout=t.plotAreaManualLayout;if(t.categories)this.categories=[...t.categories];if(t.series){this.series.clear();for(const n of t.series){const r=this.series.add(n.name);if(n.values!==void 0)r.values=n.values;if(n.xValues!==void 0)r.xValues=n.xValues;if(n.bubbleSizes!==void 0)r.bubbleSizes=n.bubbleSizes;if(n.categoryPaths!==void 0)r.categoryPaths=n.categoryPaths;if(n.categories){r.categories=n.categories}else if(t.categories){r.categories=this.categories}if(n.fill!==void 0)r.fill=n.fill;if(n.line!==void 0)r.stroke=n.line;else if(n.stroke!==void 0)r.stroke=n.stroke;if(n.valuesFormatCode!==void 0)r.valuesFormatCode=n.valuesFormatCode;if(n.xValuesFormatCode!==void 0)r.xValuesFormatCode=n.xValuesFormatCode;if(n.explosion!==void 0)r.explosion=n.explosion;if(n.marker?.symbol!==void 0)r.marker.symbol=n.marker.symbol;if(n.marker?.size!==void 0)r.marker.size=n.marker.size;if(n.marker?.fill!==void 0){r.marker.fill=n.marker.fill}else if(n.marker!==void 0&&n.marker.symbol!=="none"){r.marker.fill=r.stroke.fill.toConfig()}if(n.points){for(const i of n.points){const o=r.points.add(i.idx);if(i.fill!==void 0)o.fill=i.fill;if(i.line!==void 0)o.stroke=i.line;else if(i.stroke!==void 0)o.stroke=i.stroke}}if(n.dataLabelOverrides){for(const i of n.dataLabelOverrides){const o=r.dataLabelOverrides.add(i.idx);if(i.text!==void 0)o.text=i.text;if(i.position!==void 0)o.position=i.position;if(i.fill!==void 0)o.fill=i.fill;if(i.line!==void 0)o.stroke=i.line;else if(i.stroke!==void 0)o.stroke=i.stroke;if(i.showValue!==void 0)o.showValue=i.showValue;if(i.showSeriesName!==void 0)o.showSeriesName=i.showSeriesName;if(i.showCategoryName!==void 0)o.showCategoryName=i.showCategoryName;if(i.showLegendKey!==void 0)o.showLegendKey=i.showLegendKey;if(i.showPercent!==void 0)o.showPercent=i.showPercent;if(i.showBubbleSize!==void 0)o.showBubbleSize=i.showBubbleSize;if(i.textStyle){uM(o.textStyle,i.textStyle)}}}if(n.trendlines){for(const i of n.trendlines){const o=i.type??"linear";const a=r.trendlines.add(o);if(i.name!==void 0)a.name=i.name;if(i.polynomialOrder!==void 0)a.polynomialOrder=i.polynomialOrder;if(i.movingAveragePeriod!==void 0)a.movingAveragePeriod=i.movingAveragePeriod;if(i.forecastForward!==void 0)a.forecastForward=i.forecastForward;if(i.forecastBackward!==void 0)a.forecastBackward=i.forecastBackward;if(i.intercept!==void 0)a.intercept=i.intercept;if(i.displayEquation!==void 0)a.displayEquation=i.displayEquation;if(i.displayRSquared!==void 0)a.displayRSquared=i.displayRSquared;if(i.line!==void 0)a.stroke=i.line;else if(i.stroke!==void 0)a.stroke=i.stroke;if(i.label){if(i.label.text!==void 0)a.label.text=i.label.text;if(i.label.numberFormatCode!==void 0)a.label.numberFormatCode=i.label.numberFormatCode;if(i.label.numberFormatSourceLinked!==void 0)a.label.numberFormatSourceLinked=i.label.numberFormatSourceLinked;if(i.label.manualLayout!==void 0){a.label.manualLayout={x:i.label.manualLayout.x,y:i.label.manualLayout.y,w:i.label.manualLayout.w,h:i.label.manualLayout.h}}if(i.label.textStyle){uM(a.label.textStyle,i.label.textStyle)}if(i.label.fill!==void 0)a.label.fill=i.label.fill;if(i.label.line!==void 0)a.label.stroke=i.label.line;else if(i.label.stroke!==void 0)a.label.stroke=i.label.stroke;if(i.label.textRuns!==void 0)a.label.textRuns=i.label.textRuns}}}if(n.errorBars){if(n.errorBars.type!==void 0)r.errorBars.type=n.errorBars.type;if(n.errorBars.value!==void 0)r.errorBars.value=n.errorBars.value;if(n.errorBars.endStyle!==void 0)r.errorBars.endStyle=n.errorBars.endStyle;if(n.errorBars.line!==void 0)r.errorBars.line=n.errorBars.line}}}if(t.hasLegend!==void 0){this.hasLegend=t.hasLegend}else if(t.legend){this.hasLegend=true}if(t.legend)this.legend=t.legend;if(t.dataLabels)this.dataLabels=t.dataLabels;if(t.dataTable)this.dataTable=t.dataTable;if(t.xAxis)this.xAxis=t.xAxis;if(t.yAxis)this.yAxis=t.yAxis;if(t.lineOptions)tXr(this.lineOptions,t.lineOptions);if(t.areaOptions)nXr(this.areaOptions,t.areaOptions);if(t.scatterOptions)rXr(this.scatterOptions,t.scatterOptions);if(t.pieOptions)this.pieOptions=t.pieOptions;if(t.doughnutOptions)this.doughnutOptions=t.doughnutOptions;if(t.treemapOptions)oXr(this.treemapOptions,t.treemapOptions);if(t.mapOptions)aXr(this.mapOptions,t.mapOptions);if(t.view3d)sXr(this.view3d,t.view3d);if(t.funnelOptions)cXr(this.funnelOptions,t.funnelOptions);if(t.boxWhiskerOptions)uXr(this.boxWhiskerOptions,t.boxWhiskerOptions);if(t.barOptions)eXr(this.barOptions,t.barOptions);if(t.histogramOptions)vWt(this.#n(),t.histogramOptions)}toProto(){const t=super.toProto();if(!t.bbox){t.bbox={xEmu:Qi(zk.left??0),yEmu:Qi(zk.top??0),widthEmu:Qi(zk.width??0),heightEmu:Qi(zk.height??0)}}const n=this.#e??this.#t();if(n){const r={id:n.id};t.chartReference=r;this.data.chartReference=r}return t}#t(){const t=this.data.chartReference?.id;if(!t){return void 0}const n=this.context.getChartById(t);if(n){this.#e=n;return n}return void 0}#n(){const t=this.#t();if(t){return t}const n=this.context.createChartAsset("line");this.data.chartReference={id:n.id};this.#e=n;return n}};function uM(e,t){if(!t)return;if(t.fontSize!==void 0)e.fontSize=Bb(t.fontSize);if(t.fontSizePt!==void 0)e.fontSize=t.fontSizePt*96/72;if(t.rotation!==void 0)e.rotation=t.rotation;if(t.fill!==void 0)e.fill=t.fill;if(t.color!==void 0)e.color=t.color;if(t.bold!==void 0)e.bold=t.bold;if(t.italic!==void 0)e.italic=t.italic;if(t.underline!==void 0)e.underline=t.underline;if(t.name!==void 0)e.name=t.name;if(t.typeface!==void 0)e.typeface=t.typeface;if(t.family!==void 0)e.family=t.family;if(t.alignment!==void 0)e.alignment=t.alignment}function Zqr(e,t){if(!t)return;if(t.position!==void 0)e.position=t.position;if(t.overlay!==void 0)e.overlay=t.overlay;if(t.fill!==void 0)e.fill=t.fill;if(t.line!==void 0)e.stroke=t.line;else if(t.stroke!==void 0)e.stroke=t.stroke;if(t.textStyle)uM(e.textStyle,t.textStyle)}function Jqr(e,t){if(!t)return;if(t.position!==void 0)e.position=t.position;if(t.showValue!==void 0)e.showValue=t.showValue;if(t.showSeriesName!==void 0)e.showSeriesName=t.showSeriesName;if(t.showCategoryName!==void 0)e.showCategoryName=t.showCategoryName;if(t.showPercent!==void 0)e.showPercent=t.showPercent;if(t.showLeaderLines!==void 0)e.showLeaderLines=t.showLeaderLines;if(t.fill!==void 0)e.fill=t.fill;if(t.line!==void 0)e.stroke=t.line;else if(t.stroke!==void 0)e.stroke=t.stroke;if(t.textStyle)uM(e.textStyle,t.textStyle)}function bWt(e,t){if(!t)return;const n=typeof t.deleted==="boolean"||typeof t.visible==="boolean";const r=Object.keys(t).some(i=>i!=="deleted"&&i!=="visible");if(!n&&r){e.deleted=false}if(t.axisType!==void 0)e.axisType=t.axisType;if(t.title!==void 0){if(typeof t.title==="string"){e.title.text=t.title}else{if(t.title.text!==void 0)e.title.text=t.title.text;if(t.title.textStyle)uM(e.title.textStyle,t.title.textStyle)}}if(t.numberFormatCode!==void 0)e.numberFormatCode=t.numberFormatCode;if(t.numberFormatSourceLinked!==void 0)e.numberFormatSourceLinked=t.numberFormatSourceLinked;if(t.min!==void 0)e.min=t.min;if(t.max!==void 0)e.max=t.max;if(t.logBase!==void 0)e.logBase=t.logBase;if(t.majorUnit!==void 0)e.majorUnit=t.majorUnit;if(t.minorUnit!==void 0)e.minorUnit=t.minorUnit;if(t.deleted!==void 0)e.deleted=t.deleted;if(t.position!==void 0)e.position=t.position;if(t.orientation!==void 0)e.orientation=t.orientation;if(t.majorTickMark!==void 0)e.majorTickMark=t.majorTickMark;if(t.minorTickMark!==void 0)e.minorTickMark=t.minorTickMark;if(t.tickLabelPosition!==void 0)e.tickLabelPosition=t.tickLabelPosition;if(t.tickLabelInterval!==void 0)e.tickLabelInterval=t.tickLabelInterval;if(t.tickMarkInterval!==void 0)e.tickMarkInterval=t.tickMarkInterval;if(t.tickLabelDistanceFromAxis!==void 0)e.tickLabelDistanceFromAxis=t.tickLabelDistanceFromAxis;if(t.labelOffsetPercent!==void 0)e.labelOffsetPercent=t.labelOffsetPercent;if(t.crossBetween!==void 0)e.crossBetween=t.crossBetween;if(t.crosses!==void 0)e.crosses=t.crosses;if(t.crossesAt!==void 0)e.crossesAt=t.crossesAt;if(t.line!==void 0)e.line=new eo(t.line);if(t.majorGridlines!==void 0)e.majorGridlines=t.majorGridlines===null?void 0:new eo(t.majorGridlines);if(t.minorGridlines!==void 0)e.minorGridlines=t.minorGridlines===null?void 0:new eo(t.minorGridlines);if(t.textStyle)uM(e.textStyle,t.textStyle)}function Qqr(e,t){if(!t)return;if(t.visible!==void 0)e.visible=t.visible;if(t.showLegendKey!==void 0)e.showLegendKey=t.showLegendKey;if(t.fill!==void 0)e.fill=t.fill;if(t.line!==void 0)e.stroke=t.line;else if(t.stroke!==void 0)e.stroke=t.stroke;if(t.textStyle)uM(e.textStyle,t.textStyle)}function xWt(e,t){if(!t)return;const n=new eo(t);e.width=n.width;e.fill=n.fill.toConfig();e.style=n.style}function eXr(e,t){if(t.direction!==void 0)e.direction=t.direction;if(t.grouping!==void 0)e.grouping=t.grouping;if(t.varyColors!==void 0)e.varyColors=t.varyColors;if(t.gapWidth!==void 0)e.gapWidth=t.gapWidth;if(t.gapDepth!==void 0)e.gapDepth=t.gapDepth;if(t.overlap!==void 0)e.overlap=t.overlap;if(t.bar3dShape!==void 0)e.bar3dShape=t.bar3dShape}function tXr(e,t){if(!t)return;if(t.grouping!==void 0)e.grouping=t.grouping;if(t.smooth!==void 0)e.smooth=t.smooth;if(t.varyColors!==void 0)e.varyColors=t.varyColors}function nXr(e,t){if(!t)return;if(t.grouping!==void 0)e.grouping=t.grouping;if(t.varyColors!==void 0)e.varyColors=t.varyColors}function rXr(e,t){if(!t)return;if(t.style!==void 0)e.style=t.style;if(t.varyColors!==void 0)e.varyColors=t.varyColors}function iXr(e,t){if(!t)return;if(t.firstSliceAngle!==void 0){e.firstSliceAngle=t.firstSliceAngle}}function oXr(e,t){if(!t)return;if(t.parentLabelLayout!==void 0){e.parentLabelLayout=t.parentLabelLayout}}function aXr(e,t){if(!t)return;if(t.mapArea!==void 0)e.mapArea=t.mapArea;if(t.projection!==void 0)e.projection=t.projection;if(t.labelLayout!==void 0)e.labelLayout=t.labelLayout;if(t.dataLevel!==void 0)e.dataLevel=t.dataLevel;if(t.showUnknown!==void 0)e.showUnknown=t.showUnknown;if(t.onlyRegionsWithData!==void 0)e.onlyRegionsWithData=t.onlyRegionsWithData}function sXr(e,t){if(!t)return;if(t.rotX!==void 0)e.rotX=t.rotX;if(t.rotY!==void 0)e.rotY=t.rotY;if(t.perspective!==void 0)e.perspective=t.perspective;if(t.rightAngleAxes!==void 0)e.rightAngleAxes=t.rightAngleAxes}function lXr(e,t){if(!t)return;if(t.holeSize!==void 0){e.holeSize=t.holeSize}if(t.firstSliceAngle!==void 0){e.firstSliceAngle=t.firstSliceAngle}}function cXr(e,t){if(!t)return;if(t.gapWidth!==void 0)e.gapWidth=t.gapWidth}function uXr(e,t){if(!t)return;if(t.showMeanLine!==void 0)e.showMeanLine=t.showMeanLine;if(t.showMeanMarker!==void 0)e.showMeanMarker=t.showMeanMarker;if(t.showNonOutliers!==void 0)e.showNonOutliers=t.showNonOutliers;if(t.showOutliers!==void 0)e.showOutliers=t.showOutliers;if(t.quartileMethod!==void 0)e.quartileMethod=t.quartileMethod}function vWt(e,t){if(!t)return;const n={...e.histogramOptions??{}};let r=false;if(t.binWidth!==void 0){n.binWidth=t.binWidth;r=true}if(t.binCount!==void 0){n.binCount=t.binCount;r=true}if(t.underflow!==void 0){n.underflow=t.underflow;r=true}if(t.overflow!==void 0){n.overflow=t.overflow;r=true}if(t.intervalClosed!==void 0){n.intervalClosed=t.intervalClosed;r=true}if(t.aggregated!==void 0){n.aggregated=t.aggregated;r=true}if(r){e.histogramOptions=n}}function dXr(e,t,n){return Rd(e,t,n)}var RU=class{#e;#t;constructor(t,n){this.#e=t;this.#t=[];n.forEach(r=>{this.add({proto:r})})}get items(){return[...this.#t]}getById(t){return this.#t.find(n=>n.id===t)}add(t,n){if(typeof t==="object"){const o=new Uk(this.#e,t.proto);this.#t.push(o);this.#e._register(o);return o}const r=this.#e.createChartAsset(t);r.type=t;const i=this.#n(r);i.apply(n);return i}attach(t){const n=this.#e.attachChartAsset(t);return this.#n(n)}toProto(){return this.#t.map(t=>t.toProto())}deleteById(t){const n=this.getById(t);if(!n){return}const r=this.#t.indexOf(n);if(r!==-1){this.#t.splice(r,1)}this.#e._unregister(t)}#n(t){const n={id:"",name:"",type:6,chartReference:{id:t.id}};const r=new Uk(this.#e,n);r.setChartReference(t.id);if(r.frame===void 0){r.position={left:60,top:80,width:640,height:360}}this.#t.push(r);this.#e._register(r);return r}};var fXr=e=>"prompt"in e&&typeof e.prompt==="string";var hXr=e=>{return"path"in e||"blob"in e||"dataUrl"in e||"uri"in e};var PU=class{#e;#t;constructor(t,n){this.#e=t;this.#t=[];n.forEach(r=>{this.add({proto:r})})}get items(){return[...this.#t]}add(t){if("proto"in t){const u=new ug(this.#e,t.proto);this.#t.push(u);this.#e._register(u);return u}const n={id:"",name:"",imageReference:void 0,paragraphs:[],type:0,effects:[],children:[],levelsStyles:[],citations:[]};const r=CE(t);const i=this.#e.createImageAsset(r);const o=new ug(this.#e,n);o.setImageReference(i.id);o.applyAssetPayload(r);this.#t.push(o);this.#e._register(o);const a=this.#e.getPresentation?.()?.getRecorder?.();const s=this.#e.getSlide?.();if(a&&s){const u=`im/${s.id}.${o.id}`;const d=a.assignAlias(o,u,"image");a.record({op:"image.add",slide:a.targetRefForElement(s,`sl/${s.id}`),as:d,props:hj(t)})}if(t.alt!==void 0){o.alt=t.alt??""}if(t.fit!==void 0){o.fit=t.fit;o.lockAspectRatio=true}const l=t.position??t.frame;if(l){o.position={left:l.left,top:l.top,width:l.width,height:l.height}}if(t.crop){o.crop=t.crop}if(t.geometry!==void 0){o.geometry=t.geometry}if(t.borderRadius!==void 0){o.borderRadius=t.borderRadius}if(fXr(t)){o.prompt=t.prompt;o.isPlaceholder=!hXr(t);if(o.isPlaceholder){o.lockAspectRatio=true}}return o}deleteById(t){const n=this.#t.find(i=>i.id===t);if(!n){return}const r=this.#t.indexOf(n);if(r!==-1){this.#t.splice(r,1)}this.#e._unregister(t)}toProto(){return this.#t.map(t=>t.toProto())}};var KO=class extends bm{type="embeddedArtifact";constructor(t,n){super(t,n);this.data.type=11}get id(){return this.data.id}get artifactId(){const t=this.data.embeddedArtifact?.embeddedView?.artifact?.id;if(!t){throw new Error("Embedded workbook artifact is missing an artifact id.")}return t}get workbook(){const t=this.context.getPresentation?.();if(!t){throw new Error("Embedded workbook artifact requires a presentation.")}return t.artifacts.getWorkbook(this.artifactId)}get view(){return{...this.#e().embeddedView.workbook}}set view(t){const{embeddedView:n}=this.#e();n.workbook={...t};this.recordPositionSet(this.frame)}get title(){return this.data.embeddedArtifact?.embeddedView?.artifact?.title}set title(t){const{artifact:n}=this.#e();n.title=t}get preview(){const t=this.data.embeddedArtifact?.embeddedView?.preview;return t?{...t}:void 0}set preview(t){this.#e().embeddedView.preview=t?{...t}:void 0}get previewImageReference(){const t=this.data.embeddedArtifact?.previewImageReference;return t?{...t}:void 0}set previewImageReference(t){if(!this.data.embeddedArtifact){throw new Error("Embedded workbook artifact is missing element payload data.")}this.data.embeddedArtifact.previewImageReference=t?{...t}:void 0}toSnapshot(){const t=this.slideId;const n=this.id;const r=this.view;return{aid:Rd("ea",t,n),kind:"embeddedArtifact",artifactKind:"workbook",artifactId:this.artifactId,id:n,slideId:t,title:this.title,view:{sheetId:r.sheetId,rangeA1:r.rangeA1,showGridlines:r.showGridlines,showHeaders:r.showHeaders,zoom:r.zoom,backgroundFill:r.backgroundFill},frame:this.frame}}toProto(){const t=super.toProto();t.type=11;t.embeddedArtifact=this.data.embeddedArtifact;return t}#e(){const t=this.data.embeddedArtifact?.embeddedView;if(!t?.artifact){throw new Error("Embedded workbook artifact is missing view data.")}const n=t.artifact;if(n.kind!==2){throw new Error("Embedded artifact does not reference a workbook.")}return{embeddedView:t,artifact:n}}};var vve=class{#e;#t;constructor(t,n){this.#e=t;this.#t=[];n.forEach(r=>{this.add({proto:r})})}get items(){return[...this.#t]}add(t){const n=new KO(this.#e,t.proto);this.#t.push(n);this.#e._register(n);return n}addWorkbook(t,n={}){const r=this.#e.getPresentation?.();if(!r){throw new Error("slide.artifacts.addWorkbook requires a presentation.")}const i=r.artifacts.addWorkbook(t,{title:n.title});const o=this.#n(t,n);const a={id:"",name:n.title,type:11,embeddedArtifact:{embeddedView:{artifact:{id:i.id,kind:2,title:n.title},workbook:o,preview:n.preview},previewImageReference:n.previewImageReference},paragraphs:[],effects:[],children:[],levelsStyles:[],citations:[]};const s=new KO(this.#e,a);if(n.position){s.position=n.position}this.#t.push(s);this.#e._register(s);return s}getItem(t){const n=this.#t.find(r=>r.id===t);if(!n){throw new Error(`Embedded artifact element ${t} not found.`)}return n}deleteById(t){const n=this.#t.findIndex(r=>r.id===t);if(n===-1){return}this.#t.splice(n,1);this.#e._unregister(t)}toProto(){return this.#t.map(t=>t.toProto())}#n(t,n){const r=n.view;const i=this.#r(t,r?.sheet,r?.sheetId);return{sheetId:i,rangeA1:r?.rangeA1??r?.range??"A1:D8",showGridlines:r?.showGridlines??true,showHeaders:r?.showHeaders??false,zoom:r?.zoom,backgroundFill:r?.backgroundFill}}#r(t,n,r){if(r!==void 0){return r}if(n!==void 0){if(n.id===void 0){throw new Error("Embedded workbook view sheet is missing an id.")}return n.id}const i=t.worksheets.getActive();if(i.id===void 0){throw new Error("Embedded workbook view sheet is missing an id.")}return i.id}};var ZO=class{#e;#t;constructor(t={}){this.#e=t.placeholderType;this.#t=t.placeholderIndex}get type(){return this.#e}set type(t){this.#e=t}get index(){return this.#t}set index(t){this.#t=t}isSet(){return this.#e!==void 0||this.#t!==void 0}};var $u=class e extends bm{type="shape";static#e=1;static#t=-1;#n;#r;#i;#a;#o;constructor(t,n){if(n===null||typeof n!=="object"||Array.isArray(n)){throw new Error("Shape config must be an object.")}if("proto"in n){super(t,n.proto);this.#n=new gi({type:"proto",proto:n.proto.shape?.fill});this.#r=this.#p({type:"proto",proto:n.proto.shape?.line});this.#i=new ZO({placeholderType:Ame(n.proto.placeholderType),placeholderIndex:n.proto.placeholderIndex})}else if("geometry"in n){const r=D7e(n.className);const i=F7e(r);const o=n.fill??i?.fill;const a=n.borderRadius??i?.borderRadius;const s=n.shadow??i?.shadow;if(n.geometry==="connector"){if(a!==void 0){throw new Error('Shape borderRadius is not supported for geometry "connector".')}if(s!==void 0){throw new Error('Shape shadow is not supported for geometry "connector".')}const l=pXr(n);super(t,{...l.element,name:n.name??""});this.#n=new gi(o);this.#r=this.#p(n.line);this.#i=new ZO;this.#a=r}else{const l=PXr(n);const u=n.position?.width;const d=n.position?.height;if(a!==void 0&&n.adjustmentList!==void 0){throw new Error('Shape config cannot set both "borderRadius" and "adjustmentList".')}const f=a===void 0?void 0:$z(a);let h=n.geometry;if(f!==void 0){if(n.geometry!=="rect"&&n.geometry!=="textbox"&&n.geometry!=="roundRect"){throw new Error('Shape borderRadius is only supported for geometry "rect", "textbox", or "roundRect".')}if(u===void 0||d===void 0){throw new Error("Shape borderRadius requires position.width and position.height (px).")}if(f>0){h="roundRect"}}const m=h==="roundRect"&&u!==void 0&&d!==void 0?dj({widthPx:u,heightPx:d,radiusPx:f??8}):void 0;const g=n.adjustmentList??m??[];super(t,{type:5,name:n.name??"",bbox:n.position?new KA(n.position,true).toProto():void 0,effectReference:N7e(s,t.getPresentation?.()?.theme),shape:{geometry:yf[h],fill:void 0,adjustmentList:g,rectFormula:void 0,customPaths:l,customGeometryGuides:[]}});this.#n=new gi(o);this.#r=this.#p(n.line);this.#i=new ZO;this.#a=r}}else{super(t,{type:5,bbox:void 0,shape:{geometry:5,fill:void 0,adjustmentList:[],rectFormula:void 0,customPaths:[],customGeometryGuides:[]}});this.#n=new gi;this.#r=this.#p();this.#i=new ZO}this.#l()}get placeholder(){return this.#i}get id(){return this.data.id}toSnapshot(){const t=this.slideId;const n=this.id;const r=this.#n.toConfig();const i=this.#m(this.#r);return{aid:MXr("sh",t,n),kind:"shape",id:n,slideId:t,name:this.name,text:this.text.toString(),className:this.className,textClassName:this.text.className,frame:this.frame,placeholderType:this.placeholderType,fill:r,line:i,effectReference:this.data.effectReference,adjustmentList:this.data.shape?.adjustmentList}}get fill(){return this.#n}get renderStyleData(){const t=this.geometry;return{geometry:t,preset:t===void 0?void 0:$b(t),adjustmentList:this.adjustmentList,customPaths:this.customPaths,fill:this.#n.isSet?this.#n:void 0,line:this.#r.isSet?this.#r:void 0,connector:this.connector,effects:this.effects.isSet?this.effects:void 0,useBackgroundFill:this.useBackgroundFill,effectReference:this.effectReference,fillReference:this.fillReference,lineReference:this.lineReference}}get useBackgroundFill(){return this.data.useBackgroundFill}get geometry(){return this.data.shape?.geometry}get adjustmentList(){return this.data.shape?.adjustmentList??[]}get customPaths(){return this.data.shape?.customPaths??[]}get fillReference(){return this.data.fillReference}get lineReference(){return this.data.lineReference}get effectReference(){return this.data.effectReference}set fill(t){this.#n=new gi(t);const n=this.#n.toConfig();if(n&&TWt(n)){this.recordShapeSet({fill:n})}}async getPictureFillBitmap(){const t=this.#n.imageReference;if(!t){return void 0}const n=this.context.getImageById(t.id);if(!n){return void 0}const r=this.resolveFrame();return n.getBitmap(r.width,r.height)}get line(){return this.#r}set line(t){const n=t instanceof eo?this.#d(t):this.#p(t);this.#r=n;this.recordShapeSet({line:this.#m(n)})}set borderRadius(t){if(t===void 0){return}if(!this.data.shape){throw new Error("borderRadius is only available on shape elements.")}if(this.connector){throw new Error("borderRadius is not supported on connector shapes.")}const n=$z(t);const r=this.frame;const i=r?.width;const o=r?.height;if(i===void 0||o===void 0){throw new Error("borderRadius requires shape.position width and height (px) before it can be applied.")}const a=this.data.shape.geometry;const s=a===5||a===26;if(!s){throw new Error("borderRadius is only supported for rect-like shapes.")}if(n>0){this.data.shape.geometry=26}if(this.data.shape.geometry===26){const l=dj({widthPx:i,heightPx:o,radiusPx:n});if(!l){throw new Error("Failed to apply borderRadius; shape frame is invalid.")}this.data.shape.adjustmentList=l}else{this.data.shape.adjustmentList=[]}this.recordShapeSet({borderRadius:t})}set shadow(t){if(t===void 0){return}const n=N7e(t,this.context.getPresentation?.()?.theme);this.data.effectReference=n;this.recordShapeSet({shadow:t})}get className(){return this.#a}set className(t){this.#a=D7e(t);if(!this.#a){return}const n=F7e(this.#a);if(n){if(n.fill!==void 0){this.fill=n.fill}if(n.borderRadius!==void 0){this.borderRadius=n.borderRadius}if(n.shadow!==void 0){this.shadow=n.shadow}}this.recordShapeSet({className:this.#a})}get placeholderType(){return this.#i.type}set placeholderType(t){this.#i.type=t;this.data.placeholderType=t===void 0?void 0:SFt(t);this.recordShapeSet({placeholderType:t})}get placeholderIndex(){return this.#i.index}set placeholderIndex(t){this.#i.index=t;this.data.placeholderIndex=t;this.recordShapeSet({placeholderIndex:t})}isPlaceholder(){return this.#i.isSet()||super.hasPlaceholderMetadata}get hasPlaceholderMetadata(){return this.isPlaceholder()}placeholderKey(){return Rme({rawType:this.data.placeholderType,name:this.data.name})}get pixelRect(){const{left:t,top:n,width:r,height:i}=this.frame??{};return{x:t??0,y:n??0,width:r??0,height:i??0}}bringToFront(){this.zIndex=e.#e++}sendToBack(){this.zIndex=e.#t--}delete(){const t=this.elementAnchor();const n=this.context.getPresentation?.()?.getRecorder?.();if(t&&n){n.record({op:"shape.remove",target:n.targetRefForElement(this,t)})}const r=this.context.deleteElement;if(!r){throw new Error("Shape deletion is not available in this context.")}r(this.id)}get connector(){return this.data.connector}get connectorLineStyle(){return this.data.connector?.lineStyle}get connectorHead(){return this.data.connector?.lineStyle?.head}get connectorTail(){return this.data.connector?.lineStyle?.tail}setConnectorFrom(t,n){this.#u("from",t,n)}setConnectorTo(t,n){this.#u("to",t,n)}get position(){return super.position}set position(t){super.position=t;if(!this.connector){this.#c("committed")}}get frame(){return super.frame}set frame(t){super.frame=t;if(!this.connector){this.#c("committed")}}get previewFrame(){return super.previewFrame}set previewFrame(t){super.previewFrame=t;if(!this.connector){this.#c("preview")}}clearPreviewFrame(){super.clearPreviewFrame();if(!this.connector){this.#c("committed")}}invalidateConnectorRoute(t="committed"){if(!this.data.connector||!this.data.shape){return}this.#o=t;if(t==="committed"){super.clearPreviewFrame()}}toProto(){this.#s();const t=super.toProto();if(!t.shape){return t}const n=this.#n.toProto();t.shape.fill=n??void 0;const r=this.#r.toProto();t.shape.line=r??void 0;return t}#s(){if(!this.data.connector||!this.data.shape){return}if(!this.#o&&this.position.toProto()){return}const t=this.context.getPresentation?.();const n=this.context.getSlide?.();if(!t||!n){return}const r=this.data.shape.geometry;const i=super.toProto();if(i.shape&&r!==void 0){i.shape.geometry=r}const o=n.elements.items.filter(d=>!(d instanceof e&&d.connector)).map(d=>d.toProto());let a=[];try{const d=S1e({connectorEl:i,elements:o,pres:t,slide:n});a=d.commands}catch(d){console.warn("autoRouteConnectorPx failed; using fallback line",d);a=[]}let s=ENt(a);if(s.length<2){s=TXr(i.connector,o,t,n)}if(s.length<2){return}let l=RWt(r)?wXr(s):void 0;if(!l){l=SWt(s)}if(!l){l=CXr(s,r)}if(!l&&s.length>=2){const d=O7e(s[0],s[s.length-1]);l=SWt(d)}if(!l){return}const u={left:l.bounds.minX,top:l.bounds.minY,width:l.width,height:l.height};if(l.rotation!==void 0||this.position.rotation!==void 0){u.rotation=l.rotation??0}if(l.flipH||this.position.horizontalFlip!==void 0){u.horizontalFlip=l.flipH}if(l.flipV||this.position.verticalFlip!==void 0){u.verticalFlip=l.flipV}if(this.#o==="preview"){super.previewFrame=u}else{this.position.merge(u);super.clearPreviewFrame()}this.#o=void 0;this.data.shape.geometry=l.geometry;this.data.shape.adjustmentList=l.adjustments;this.data.shape.customPaths=[]}#l(){this.position.setChangeHandler(t=>{this.recordPositionSet(t);if(!this.connector){this.#c("committed")}})}#c(t){if(this.connector||!this.id){return}const n=this.context.getSlide?.();if(!n){return}for(const r of n.shapes.items){const i=r.connector;if(!i){continue}if(i.fromElementId===this.id||i.toElementId===this.id){r.invalidateConnectorRoute(t)}}}#u(t,n,r){const i=this.data.connector;if(!i){throw new Error("Connector endpoint updates are only available on connector shapes.")}if(n===void 0&&r===void 0){return}const o=this.#f(t,n);const a=t==="from"?"fromIdx":"toIdx";const s=r===void 0?void 0:_Ge(r,a);if(t==="from"){if(o){i.fromElementId=o.localId}if(s!==void 0){i.fromIdx=s}this.invalidateConnectorRoute("committed");this.recordShapeSet({from:o?.targetRef,fromIdx:s});return}if(o){i.toElementId=o.localId}if(s!==void 0){i.toIdx=s}this.invalidateConnectorRoute("committed");this.recordShapeSet({to:o?.targetRef,toIdx:s})}#f(t,n){if(n===void 0){return void 0}const r=this.context.getSlide?.();if(!r){const s=typeof n==="string"?n:n.id;if(!s){throw new Error(`Connector ${t} endpoint id must be non-empty.`)}if(typeof n!=="string"&&n.connector){throw new Error(`Connector ${t} endpoint cannot be another connector.`)}return{localId:s,targetRef:s}}const i=typeof n==="string"?fge(n,{prefix:"sh",aliases:["shape"],slideId:r.id,localIds:r.shapes.items.map(s=>s.id)}):n.id;if(!i){throw new Error(`Connector ${t} endpoint id must be non-empty.`)}const o=typeof n==="string"?r.shapes.getById(i):n;if(!o){throw new Error(`Connector ${t} shape not found for id: ${i}`)}if(o.connector){throw new Error(`Connector ${t} endpoint cannot be another connector.`)}if(o.slideId&&o.slideId!==r.id){throw new Error(`Connector ${t} endpoint must belong to slide ${r.id}.`)}const a=o.elementAnchor();if(!a){throw new Error(`Connector ${t} endpoint shape is missing an anchor id.`)}return{localId:i,targetRef:o.recordTargetRef(a)}}#d(t){t.setChangeHandler(n=>{this.recordShapeSet({line:this.#m(n)})});return t}#p(t){return this.#d(new eo(t))}#m(t){const n={};if(t.style!==void 0){n.style=t.style}if(t.width!==void 0){n.width=t.width}const r=t.fill?.toConfig();if(r&&TWt(r)){n.fill=r}return Object.keys(n).length>0?n:void 0}};var TWt=e=>{if(!e||typeof e!=="object"){return true}if("type"in e&&e.type==="proto"){return false}return true};function pXr(e){const t=e.position?new KA(e.position,true).toProto():void 0;const n=mXr(e.kind);const r={fromElementId:wWt(e.from,"from"),fromIdx:_Ge(e.fromIdx,"fromIdx"),toElementId:wWt(e.to,"to"),toIdx:_Ge(e.toIdx,"toIdx"),lineStyle:gXr(e)};return{element:{type:5,bbox:t,connector:r,shape:{geometry:n,fill:void 0,adjustmentList:e.adjustmentList??[],rectFormula:void 0,customPaths:[],customGeometryGuides:[]}}}}function mXr(e){const t=e??"elbow";switch(t){case"straight":return 96;case"curved":return 103;case"elbow2":return 97;case"elbow3":return 98;case"elbow5":return 100;case"elbow":case"elbow4":default:return 99}}function wWt(e,t){if(typeof e==="string"){if(!e){throw new Error(`Connector ${t} endpoint id must be non-empty.`)}return e}const n=e.id;if(!n){throw new Error(`Connector ${t} endpoint shape must have an id.`)}return n}function _Ge(e,t){if(!Number.isFinite(e)){throw new Error(`Connector ${t} must be a finite number.`)}return e}function gXr(e){const t=EWt(e.head);const n=EWt(e.tail);const r=e.cap?yXr[e.cap]:void 0;const i=e.join?bXr[e.join]:void 0;if(!t&&!n&&!r&&!i){return void 0}return{head:t,tail:n,cap:r,join:i}}function EWt(e){if(!e){return void 0}const t=e.type??"none";const n=e.width??"med";const r=e.length??"med";const i=xXr[t]??0;const o=vXr[n]??2;const a=_Xr[r]??2;return{type:i,width:o,length:a}}var yXr={flat:1,round:2,square:3};var bXr={round:1,bevel:2,miter:3};var xXr={none:1,triangle:2,stealth:3,diamond:4,oval:5,arrow:6};var vXr={sm:1,med:2,lg:3};var _Xr={sm:1,med:2,lg:3};var CWt=24;function TXr(e,t,n,r){if(!e){return[]}const i=t.find(x=>x.id===e.fromElementId);const o=t.find(x=>x.id===e.toElementId);if(!i||!o){return[]}const a=$f(i,n,r);const s=$f(o,n,r);const l=vge(a);const u=vge(s);const d=B7e(a,e.fromIdx,u);const f=B7e(s,e.toIdx,l);const h=z7e(d.point,d.normal,CWt);const m=z7e(f.point,f.normal,CWt);const g=O7e(h,m);return Gz([d.point,...g,f.point])}function SWt(e){const t=Gz(e);if(t.length<2){return void 0}const n=xge(t);const r=n.maxX-n.minX;const i=n.maxY-n.minY;if(r===0&&i===0){return void 0}const o=t[0];const a=t[t.length-1];const s=r!==0&&o.x>a.x;const l=i!==0&&o.y>a.y;const u=t.length-1;if(u<=1){return{bounds:n,width:r,height:i,flipH:s,flipV:l,geometry:96,adjustments:[]}}const d=t.map(x=>{const w=x.x-n.minX;const _=x.y-n.minY;return{x:s?r-w:w,y:l?i-_:_}});if(!CNt(d)){return void 0}const f=u>0&&qv(d[0]?.x??0,d[1]?.x??0);if(u===2){if(f){return{bounds:n,width:r,height:i,flipH:s,flipV:l,geometry:98,adjustments:[{name:"adj1",formula:"val 0"}]}}return{bounds:n,width:r,height:i,flipH:s,flipV:l,geometry:97,adjustments:[]}}if(u===3){if(f){const w=wy(d[1]?.y,i);if(w===void 0)return void 0;return{bounds:n,width:r,height:i,flipH:s,flipV:l,geometry:99,adjustments:[{name:"adj1",formula:"val 0"},{name:"adj2",formula:`val ${w}`}]}}const x=wy(d[1]?.x,r);if(x===void 0)return void 0;return{bounds:n,width:r,height:i,flipH:s,flipV:l,geometry:98,adjustments:[{name:"adj1",formula:`val ${x}`}]}}if(u===4){if(f){const _=wy(d[1]?.y,i);const C=wy(d[2]?.x,r);if(_===void 0||C===void 0)return void 0;return{bounds:n,width:r,height:i,flipH:s,flipV:l,geometry:100,adjustments:[{name:"adj1",formula:"val 0"},{name:"adj2",formula:`val ${_}`},{name:"adj3",formula:`val ${C}`}]}}const x=wy(d[1]?.x,r);const w=wy(d[2]?.y,i);if(x===void 0||w===void 0)return void 0;return{bounds:n,width:r,height:i,flipH:s,flipV:l,geometry:99,adjustments:[{name:"adj1",formula:`val ${x}`},{name:"adj2",formula:`val ${w}`}]}}if(f){return void 0}const h=wy(d[1]?.x,r);const m=wy(d[2]?.y,i);const g=wy(d[3]?.x,r);if(h===void 0||m===void 0||g===void 0){return void 0}return{bounds:n,width:r,height:i,flipH:s,flipV:l,geometry:100,adjustments:[{name:"adj1",formula:`val ${h}`},{name:"adj2",formula:`val ${m}`},{name:"adj3",formula:`val ${g}`}]}}function wXr(e){const t=Gz(e);if(t.length<2){return void 0}const n=xge(t);const r=n.maxX-n.minX;const i=n.maxY-n.minY;if(r===0&&i===0){return void 0}const o=t[0];const a=t[t.length-1];const s=r!==0&&o.x>a.x;const l=i!==0&&o.y>a.y;const u=t.map(g=>{const x=g.x-n.minX;const w=g.y-n.minY;return{x:s?r-x:x,y:l?i-w:w}});const d=t.length-1;if(d<=1){if(r>0&&i>0){const g={bounds:n,width:r,height:i,flipH:s,flipV:l,geometry:102,adjustments:[{name:"adj1",formula:"val 50000"}]};if(!AWt(o,a)){return g}return kWt(g,o,a)}return{bounds:n,width:r,height:i,flipH:s,flipV:l,geometry:101,adjustments:[]}}if(!EXr(u)){return void 0}if(d===2){const g=wy(u[1]?.x,r);if(g===void 0)return void 0;const x={bounds:n,width:r,height:i,flipH:s,flipV:l,geometry:102,adjustments:[{name:"adj1",formula:`val ${g}`}]};if(r>0&&i>0&&AWt(o,a)){return kWt(x,o,a)}return x}if(d===3){const g=wy(u[1]?.x,r);const x=wy(u[2]?.y,i);if(g===void 0||x===void 0)return void 0;return{bounds:n,width:r,height:i,flipH:s,flipV:l,geometry:103,adjustments:[{name:"adj1",formula:`val ${g}`},{name:"adj2",formula:`val ${x}`}]}}const f=wy(u[1]?.x,r);const h=wy(u[2]?.y,i);const m=wy(u[3]?.x,r);if(f===void 0||h===void 0||m===void 0){return void 0}return{bounds:n,width:r,height:i,flipH:s,flipV:l,geometry:104,adjustments:[{name:"adj1",formula:`val ${f}`},{name:"adj2",formula:`val ${h}`},{name:"adj3",formula:`val ${m}`}]}}function AWt(e,t){return!qv(e.x,t.x)&&!qv(e.y,t.y)}function kWt(e,t,n){const r=e.bounds.minX+e.width/2;const i=e.bounds.minY+e.height/2;const o=e.height;const a=e.width;const s=t.x>n.x;const l=t.ys.x;const u=o!==0&&a.y>s.y;return{bounds:r,width:i,height:o,flipH:l,flipV:u,geometry:SXr(t,n.length-1),adjustments:[]}}function SXr(e,t){if(e!==void 0&&kXr(e)){return e}if(t<=1){return 96}return AXr(t)}function AXr(e){if(e<=2){return 97}if(e===3){return 98}if(e===4){return 99}return 100}function kXr(e){return e===96||RXr(e)||RWt(e)}function RXr(e){switch(e){case 97:case 98:case 99:case 100:return true;default:return false}}function RWt(e){switch(e){case 101:case 102:case 103:case 104:return true;default:return false}}function PXr(e){if(e.geometry!=="custom"){return[]}const t=e.customPaths??[];if(t.length===0){throw new Error('geometry "custom" requires at least one custom path.')}return t.map((n,r)=>{if(!n?.commands?.length){throw new Error(`Custom path ${r+1} must declare at least one command.`)}const i=Number(n.width);const o=Number(n.height);if(!Number.isFinite(i)||i<=0){throw new Error(`Custom path ${r+1} must specify a positive width (pixels).`)}if(!Number.isFinite(o)||o<=0){throw new Error(`Custom path ${r+1} must specify a positive height (pixels).`)}return{id:n.id,widthEmu:Qi(i),heightEmu:Qi(o),commands:n.commands.map(IXr)}})}function Qb(e){if(!Number.isFinite(e)){throw new Error("Custom path coordinates must be finite numbers.")}return Qi(e)}function IXr(e){if("moveTo"in e){return{moveTo:{x:Qb(e.moveTo.x),y:Qb(e.moveTo.y)}}}if("lineTo"in e){return{lineTo:{x:Qb(e.lineTo.x),y:Qb(e.lineTo.y)}}}if("quadBezTo"in e){return{quadBezTo:{x1:Qb(e.quadBezTo.x1),y1:Qb(e.quadBezTo.y1),x:Qb(e.quadBezTo.x),y:Qb(e.quadBezTo.y)}}}if("cubicBezTo"in e){return{cubicBezTo:{x1:Qb(e.cubicBezTo.x1),y1:Qb(e.cubicBezTo.y1),x2:Qb(e.cubicBezTo.x2),y2:Qb(e.cubicBezTo.y2),x:Qb(e.cubicBezTo.x),y:Qb(e.cubicBezTo.y)}}}return{close:{}}}function MXr(e,t,n){return Rd(e,t,n)}IU();var O1=()=>new Map;var wve=e=>{const t=O1();e.forEach((n,r)=>{t.set(r,n)});return t};var aC=(e,t,n)=>{let r=e.get(t);if(r===void 0){e.set(t,r=n())}return r};var FWt=(e,t)=>{for(const[n,r]of e){if(t(r,n)){return true}}return false};var JO=()=>new Set;var Eve=e=>e[e.length-1];var OWt=(e,t)=>{for(let n=0;n{for(let n=0;n{this.off(t,r);n(...i)};this.on(t,r)}off(t,n){const r=this._observers.get(t);if(r!==void 0){r.delete(n);if(r.size===0){this._observers.delete(t)}}}emit(t,n){return Vk((this._observers.get(t)||O1()).values()).forEach(r=>r(...n))}destroy(){this._observers=O1()}};var f_=Math.floor;var MU=Math.abs;var Cve=(e,t)=>ee>t?e:t;var $da=Number.isNaN;var Sve=e=>e!==0?e<0:1/e<0;var SGe=1;var AGe=2;var kve=4;var Rve=8;var LU=32;var h_=64;var Dy=128;var OXr=1<<17;var BXr=1<<18;var zXr=1<<19;var UXr=1<<20;var VXr=1<<21;var $Xr=1<<22;var GXr=1<<23;var HXr=1<<24;var WXr=1<<25;var YXr=1<<26;var qXr=1<<27;var XXr=1<<28;var jXr=1<<29;var KXr=1<<30;var Gda=1<<31;var JZ=31;var QZ=63;var Gk=127;var Hda=OXr-1;var Wda=BXr-1;var Yda=zXr-1;var qda=UXr-1;var Xda=VXr-1;var jda=$Xr-1;var Kda=GXr-1;var Zda=HXr-1;var Jda=WXr-1;var Qda=YXr-1;var efa=qXr-1;var tfa=XXr-1;var nfa=jXr-1;var rfa=KXr-1;var zWt=2147483647;var RGe=Number.MAX_SAFE_INTEGER;var ifa=Number.MIN_SAFE_INTEGER;var ofa=1<<31;var UWt=Number.isInteger||(e=>typeof e==="number"&&isFinite(e)&&f_(e)===e);var afa=Number.isNaN;var sfa=Number.parseInt;var ZXr=String.fromCharCode;var lfa=String.fromCodePoint;var cfa=ZXr(65535);var JXr=e=>e.toLowerCase();var QXr=/^\s*/g;var ejr=e=>e.replace(QXr,"");var tjr=/([A-Z])/g;var PGe=(e,t)=>ejr(e.replace(tjr,n=>`${t}${JXr(n)}`));var njr=e=>{const t=unescape(encodeURIComponent(e));const n=t.length;const r=new Uint8Array(n);for(let i=0;iFU.encode(e);var $Wt=FU?rjr:njr;var DU=typeof TextDecoder==="undefined"?null:new TextDecoder("utf-8",{fatal:true,ignoreBOM:true});if(DU&&DU.decode(new Uint8Array).length===1){DU=null}var QO=class{constructor(){this.cpos=0;this.cbuf=new Uint8Array(100);this.bufs=[]}};var tJ=()=>new QO;var ijr=e=>{let t=e.cpos;for(let n=0;n{const t=new Uint8Array(ijr(e));let n=0;for(let r=0;r{const n=e.cbuf.length;if(n-e.cpos{const n=e.cbuf.length;if(e.cpos===n){e.bufs.push(e.cbuf);e.cbuf=new Uint8Array(n*2);e.cpos=0}e.cbuf[e.cpos++]=t};var Ive=Am;var tc=(e,t)=>{while(t>Gk){Am(e,Dy|Gk&t);t=f_(t/128)}Am(e,Gk&t)};var Mve=(e,t)=>{const n=Sve(t);if(n){t=-t}Am(e,(t>QZ?Dy:0)|(n?h_:0)|QZ&t);t=f_(t/64);while(t>0){Am(e,(t>Gk?Dy:0)|Gk&t);t=f_(t/128)}};var MGe=new Uint8Array(3e4);var ajr=MGe.length/3;var sjr=(e,t)=>{if(t.length{const n=unescape(encodeURIComponent(t));const r=n.length;tc(e,r);for(let i=0;i{const n=e.cbuf.length;const r=e.cpos;const i=Cve(n-r,t.length);const o=t.length-i;e.cbuf.set(t.subarray(0,i),r);e.cpos+=i;if(o>0){e.bufs.push(e.cbuf);e.cbuf=new Uint8Array($k(n*2,o));e.cbuf.set(t.subarray(i));e.cpos=o}};var ex=(e,t)=>{tc(e,t.byteLength);nJ(e,t)};var LGe=(e,t)=>{ojr(e,t);const n=new DataView(e.cbuf.buffer,e.cpos,t);e.cpos+=t;return n};var cjr=(e,t)=>LGe(e,4).setFloat32(0,t,false);var ujr=(e,t)=>LGe(e,8).setFloat64(0,t,false);var djr=(e,t)=>LGe(e,8).setBigInt64(0,t,false);var GWt=new DataView(new ArrayBuffer(4));var fjr=e=>{GWt.setFloat32(0,e);return GWt.getFloat32(0)===e};var NU=(e,t)=>{switch(typeof t){case"string":Am(e,119);e5(e,t);break;case"number":if(UWt(t)&&MU(t)<=zWt){Am(e,125);Mve(e,t)}else if(fjr(t)){Am(e,124);cjr(e,t)}else{Am(e,123);ujr(e,t)}break;case"bigint":Am(e,122);djr(e,t);break;case"object":if(t===null){Am(e,126)}else if(KZ(t)){Am(e,117);tc(e,t.length);for(let n=0;n0){tc(this,this.count-1)}this.count=1;this.w(this,t);this.s=t}}};var HWt=e=>{if(e.count>0){Mve(e.encoder,e.count===1?e.s:-e.s);if(e.count>1){tc(e.encoder,e.count-2)}}};var t5=class{constructor(){this.encoder=new QO;this.s=0;this.count=0}write(t){if(this.s===t){this.count++}else{HWt(this);this.count=1;this.s=t}}toUint8Array(){HWt(this);return uw(this.encoder)}};var WWt=e=>{if(e.count>0){const t=e.diff*2+(e.count===1?0:1);Mve(e.encoder,t);if(e.count>1){tc(e.encoder,e.count-2)}}};var OU=class{constructor(){this.encoder=new QO;this.s=0;this.count=0;this.diff=0}write(t){if(this.diff===t-this.s){this.s=t;this.count++}else{WWt(this);this.count=1;this.diff=t-this.s;this.s=t}}toUint8Array(){WWt(this);return uw(this.encoder)}};var Pve=class{constructor(){this.sarr=[];this.s="";this.lensE=new t5}write(t){this.s+=t;if(this.s.length>19){this.sarr.push(this.s);this.s=""}this.lensE.write(t.length)}toUint8Array(){const t=new QO;this.sarr.push(this.s);this.s="";e5(t,this.sarr.join(""));nJ(t,this.lensE.toUint8Array());return uw(t)}};var sC=e=>new Error(e);var dw=()=>{throw sC("Method unimplemented")};var fw=()=>{throw sC("Unexpected case")};var qWt=sC("Unexpected end of array");var XWt=sC("Integer out of Range");var BU=class{constructor(t){this.arr=t;this.pos=0}};var dM=e=>new BU(e);var jWt=e=>e.pos!==e.arr.length;var pjr=(e,t)=>{const n=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);e.pos+=t;return n};var tx=e=>pjr(e,ml(e));var n5=e=>e.arr[e.pos++];var ml=e=>{let t=0;let n=1;const r=e.arr.length;while(e.posRGe){throw XWt}}throw qWt};var Dve=e=>{let t=e.arr[e.pos++];let n=t&QZ;let r=64;const i=(t&h_)>0?-1:1;if((t&Dy)===0){return i*n}const o=e.arr.length;while(e.posRGe){throw XWt}}throw qWt};var mjr=e=>{let t=ml(e);if(t===0){return""}else{let n=String.fromCodePoint(n5(e));if(--t<100){while(t--){n+=String.fromCodePoint(n5(e))}}else{while(t>0){const r=t<1e4?t:1e4;const i=e.arr.subarray(e.pos,e.pos+r);e.pos+=r;n+=String.fromCodePoint.apply(null,i);t-=r}}return decodeURIComponent(escape(n))}};var gjr=e=>DU.decode(tx(e));var r5=DU?gjr:mjr;var DGe=(e,t)=>{const n=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);e.pos+=t;return n};var yjr=e=>DGe(e,4).getFloat32(0,false);var bjr=e=>DGe(e,8).getFloat64(0,false);var xjr=e=>DGe(e,8).getBigInt64(0,false);var vjr=[e=>void 0,e=>null,Dve,yjr,bjr,xjr,e=>false,e=>true,r5,e=>{const t=ml(e);const n={};for(let r=0;r{const t=ml(e);const n=[];for(let r=0;rvjr[127-n5(e)](e);var rJ=class extends BU{constructor(t,n){super(t);this.reader=n;this.s=null;this.count=0}read(){if(this.count===0){this.s=this.reader(this);if(jWt(this)){this.count=ml(this)+1}else{this.count=-1}}this.count--;return this.s}};var i5=class extends BU{constructor(t){super(t);this.s=0;this.count=0}read(){if(this.count===0){this.s=Dve(this);const t=Sve(this.s);this.count=1;if(t){this.s=-this.s;this.count=ml(this)+2}}this.count--;return this.s}};var UU=class extends BU{constructor(t){super(t);this.s=0;this.count=0;this.diff=0}read(){if(this.count===0){const t=Dve(this);const n=t&1;this.diff=f_(t/2);this.count=1;if(n){this.count=ml(this)+2}}this.s+=this.diff;this.count--;return this.s}};var Lve=class{constructor(t){this.decoder=new i5(t);this.str=r5(this.decoder);this.spos=0}read(){const t=this.spos+this.decoder.read();const n=this.str.slice(this.spos,t);this.spos=t;return n}};import{webcrypto as FGe}from"node:crypto";var hfa=FGe.subtle;var KWt=FGe.getRandomValues.bind(FGe);var NGe=()=>KWt(new Uint32Array(1))[0];var Tjr="10000000-1000-4000-8000"+-1e11;var ZWt=()=>Tjr.replace(/[018]/g,e=>(e^NGe()&15>>e/4).toString(16));var Fve=Date.now;var OGe=e=>new Promise(e);var gfa=Promise.all.bind(Promise);var BGe=e=>e===void 0?null:e;var zGe=class{constructor(){this.map=new Map}setItem(t,n){this.map.set(t,n)}getItem(t){return this.map.get(t)}};var QWt=new zGe;var Sjr=true;try{if(typeof localStorage!=="undefined"&&localStorage){QWt=localStorage;Sjr=false}}catch(e){}var eYt=QWt;var kjr=Symbol("Equality");var tYt=(e,t)=>e===t||!!e?.[kjr]?.(t)||false;var rYt=Object.assign;var Pjr=Object.keys;var iYt=(e,t)=>{for(const n in e){t(e[n],n)}};var nYt=e=>Pjr(e).length;var oYt=e=>{for(const t in e){return false}return true};var Ijr=(e,t)=>{for(const n in e){if(!t(e[n],n)){return false}}return true};var Mjr=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var aYt=(e,t)=>e===t||nYt(e)===nYt(t)&&Ijr(e,(n,r)=>(n!==void 0||Mjr(t,r))&&tYt(t[r],n));var Ljr=Object.freeze;var UGe=e=>{for(const t in e){const n=e[t];if(typeof n==="object"||typeof n==="function"){UGe(e[t])}}return Ljr(e)};var iJ=(e,t,n=0)=>{try{for(;ne;var lYt=(e,t)=>t.includes(e);var oJ=typeof process!=="undefined"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process!=="undefined"?process:0)==="[object process]";var yfa=typeof navigator!=="undefined"?/Mac/.test(navigator.platform):false;var lC;var Fjr=[];var Njr=()=>{if(lC===void 0){if(oJ){lC=O1();const e=process.argv;let t=null;for(let n=0;n{if(e.length!==0){const[t,n]=e.split("=");lC.set(`--${PGe(t,"-")}`,n);lC.set(`-${PGe(t,"-")}`,n)}})}else{lC=O1()}}return lC};var VGe=e=>Njr().has(e);var aJ=e=>oJ?BGe(process.env[e.toUpperCase().replaceAll("-","_")]):BGe(eYt.getItem(e));var uYt=e=>VGe("--"+e)||aJ(e)!==null;var bfa=uYt("production");var Ojr=oJ&&lYt(process.env.FORCE_COLOR,["true","1","2"]);var dYt=Ojr||!VGe("--no-colors")&&!uYt("no-color")&&(!oJ||process.stdout.isTTY)&&(!oJ||VGe("--color")||aJ("COLORTERM")!==null||(aJ("TERM")||"").includes("color"));var Bjr=e=>new Uint8Array(e);var hYt=e=>{const t=Bjr(e.byteLength);t.set(e);return t};var cC=Symbol;var sJ=cC();var lJ=cC();var $Ge=cC();var GGe=cC();var HGe=cC();var cJ=cC();var WGe=cC();var uJ=cC();var YGe=cC();var pYt=e=>{if(e.length===1&&e[0]?.constructor===Function){e=e[0]()}const t=[];const n=[];let r=0;for(;r0){n.push(t.join(""))}for(;r{if(e.length===1&&e[0]?.constructor===Function){e=e[0]()}const t=[];const n=[];let r=0;for(;r0){t.push("\x1B[0m");n.push(t.join(""))}for(;r{console.log(...mYt(e))};var qGe=(...e)=>{console.warn(...mYt(e))};var yYt=e=>({[Symbol.iterator](){return this},next:e});var bYt=(e,t)=>yYt(()=>{let n;do{n=e.next()}while(!n.done&&!t(n.value));return n});var Nve=(e,t)=>yYt(()=>{const{done:n,value:r}=e.next();return{done:n,value:n?void 0:t(r)}});var fJ=class{constructor(t,n){this.clock=t;this.len=n}};var mM=class{constructor(){this.clients=new Map}};var $U=(e,t,n)=>t.clients.forEach((r,i)=>{const o=e.doc.store.clients.get(i);if(o!=null){const a=o[o.length-1];const s=a.id.clock+a.length;for(let l=0,u=r[l];l{let n=0;let r=e.length-1;while(n<=r){const i=f_((n+r)/2);const o=e[i];const a=o.clock;if(a<=t){if(t{const n=e.clients.get(t.client);return n!==void 0&&Yjr(n,t.clock)!==null};var pHe=e=>{e.clients.forEach(t=>{t.sort((i,o)=>i.clock-o.clock);let n,r;for(n=1,r=1;n=o.clock){i.len=$k(i.len,o.clock+o.len-i.clock)}else{if(r{const t=new mM;for(let n=0;n{if(!t.clients.has(i)){const o=r.slice();for(let a=n+1;a{aC(e.clients,t,()=>[]).push(new fJ(n,r))};var LYt=()=>new mM;var qjr=e=>{const t=LYt();e.clients.forEach((n,r)=>{const i=[];for(let o=0;o0){t.clients.set(r,i)}});return t};var jU=(e,t)=>{tc(e.restEncoder,t.clients.size);Vk(t.clients.entries()).sort((n,r)=>r[0]-n[0]).forEach(([n,r])=>{e.resetDsCurVal();tc(e.restEncoder,n);const i=r.length;tc(e.restEncoder,i);for(let o=0;o{const t=new mM;const n=ml(e.restDecoder);for(let r=0;r0){const a=aC(t.clients,i,()=>[]);for(let s=0;s{const r=new mM;const i=ml(e.restDecoder);for(let o=0;o0){const o=new Wk;tc(o.restEncoder,0);jU(o,r);return o.toUint8Array()}return null};var DYt=NGe;var uC=class e extends ZZ{constructor({guid:t=ZWt(),collectionid:n=null,gc:r=true,gcFilter:i=()=>true,meta:o=null,autoLoad:a=false,shouldLoad:s=true}={}){super();this.gc=r;this.gcFilter=i;this.clientID=DYt();this.guid=t;this.collectionid=n;this.share=new Map;this.store=new Hve;this._transaction=null;this._transactionCleanups=[];this.subdocs=new Set;this._item=null;this.shouldLoad=s;this.autoLoad=a;this.meta=o;this.isLoaded=false;this.isSynced=false;this.isDestroyed=false;this.whenLoaded=OGe(u=>{this.on("load",()=>{this.isLoaded=true;u(this)})});const l=()=>OGe(u=>{const d=f=>{if(f===void 0||f===true){this.off("sync",d);u()}};this.on("sync",d)});this.on("sync",u=>{if(u===false&&this.isSynced){this.whenSynced=l()}this.isSynced=u===void 0||u===true;if(this.isSynced&&!this.isLoaded){this.emit("load",[this])}});this.whenSynced=l()}load(){const t=this._item;if(t!==null&&!this.shouldLoad){Gu(t.parent.doc,n=>{n.subdocsLoaded.add(this)},null,true)}this.shouldLoad=true}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(Vk(this.subdocs).map(t=>t.guid))}transact(t,n=null){return Gu(this,t,n)}get(t,n=Hh){const r=aC(this.share,t,()=>{const o=new n;o._integrate(this,null);return o});const i=r.constructor;if(n!==Hh&&i!==n){if(i===Hh){const o=new n;o._map=r._map;r._map.forEach(a=>{for(;a!==null;a=a.left){a.parent=o}});o._start=r._start;for(let a=o._start;a!==null;a=a.right){a.parent=o}o._length=r._length;this.share.set(t,o);o._integrate(this,null);return o}else{throw new Error(`Type with the name ${t} has already been defined with a different constructor`)}}return r}getArray(t=""){return this.get(t,p_)}getText(t=""){return this.get(t,bJ)}getMap(t=""){return this.get(t,Ns)}getXmlElement(t=""){return this.get(t,xJ)}getXmlFragment(t=""){return this.get(t,qU)}toJSON(){const t={};this.share.forEach((n,r)=>{t[r]=n.toJSON()});return t}destroy(){this.isDestroyed=true;Vk(this.subdocs).forEach(n=>n.destroy());const t=this._item;if(t!==null){this._item=null;const n=t.content;n.doc=new e({guid:this.guid,...n.opts,shouldLoad:false});n.doc._item=t;Gu(t.parent.doc,r=>{const i=n.doc;if(!t.deleted){r.subdocsAdded.add(i)}r.subdocsRemoved.add(this)},null,true)}this.emit("destroyed",[true]);this.emit("destroy",[this]);super.destroy()}};var $ve=class{constructor(t){this.restDecoder=t}resetDsCurVal(){}readDsClock(){return ml(this.restDecoder)}readDsLen(){return ml(this.restDecoder)}};var KGe=class extends $ve{readLeftID(){return El(ml(this.restDecoder),ml(this.restDecoder))}readRightID(){return El(ml(this.restDecoder),ml(this.restDecoder))}readClient(){return ml(this.restDecoder)}readInfo(){return n5(this.restDecoder)}readString(){return r5(this.restDecoder)}readParentInfo(){return ml(this.restDecoder)===1}readTypeRef(){return ml(this.restDecoder)}readLen(){return ml(this.restDecoder)}readAny(){return zU(this.restDecoder)}readBuf(){return hYt(tx(this.restDecoder))}readJSON(){return JSON.parse(r5(this.restDecoder))}readKey(){return r5(this.restDecoder)}};var ZGe=class{constructor(t){this.dsCurrVal=0;this.restDecoder=t}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){this.dsCurrVal+=ml(this.restDecoder);return this.dsCurrVal}readDsLen(){const t=ml(this.restDecoder)+1;this.dsCurrVal+=t;return t}};var Hk=class extends ZGe{constructor(t){super(t);this.keys=[];ml(t);this.keyClockDecoder=new UU(tx(t));this.clientDecoder=new i5(tx(t));this.leftClockDecoder=new UU(tx(t));this.rightClockDecoder=new UU(tx(t));this.infoDecoder=new rJ(tx(t),n5);this.stringDecoder=new Lve(tx(t));this.parentInfoDecoder=new rJ(tx(t),n5);this.typeRefDecoder=new i5(tx(t));this.lenDecoder=new i5(tx(t))}readLeftID(){return new pM(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new pM(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return this.parentInfoDecoder.read()===1}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return zU(this.restDecoder)}readBuf(){return tx(this.restDecoder)}readJSON(){return zU(this.restDecoder)}readKey(){const t=this.keyClockDecoder.read();if(t{r=$k(r,t[0].id.clock);const i=dC(t,r);tc(e.restEncoder,t.length-i);e.writeClient(n);tc(e.restEncoder,r);const o=t[i];o.write(e,r-o.id.clock);for(let a=i+1;a{const r=new Map;n.forEach((i,o)=>{if(Sp(t,o)>i){r.set(o,i)}});gHe(t).forEach((i,o)=>{if(!n.has(o)){r.set(o,0)}});tc(e.restEncoder,r.size);Vk(r.entries()).sort((i,o)=>o[0]-i[0]).forEach(([i,o])=>{Xjr(e,t.clients.get(i),i,o)})};var jjr=(e,t)=>{const n=O1();const r=ml(e.restDecoder);for(let i=0;i{const r=[];let i=Vk(n.keys()).sort((m,g)=>m-g);if(i.length===0){return null}const o=()=>{if(i.length===0){return null}let m=n.get(i[i.length-1]);while(m.refs.length===m.i){i.pop();if(i.length>0){m=n.get(i[i.length-1])}else{return null}}return m};let a=o();if(a===null){return null}const s=new Hve;const l=new Map;const u=(m,g)=>{const x=l.get(m);if(x==null||x>g){l.set(m,g)}};let d=a.refs[a.i++];const f=new Map;const h=()=>{for(const m of r){const g=m.id.client;const x=n.get(g);if(x){x.i--;s.clients.set(g,x.refs.slice(x.i));n.delete(g);x.i=0;x.refs=[]}else{s.clients.set(g,[m])}i=i.filter(w=>w!==g)}r.length=0};while(true){if(d.constructor!==ix){const m=aC(f,d.id.client,()=>Sp(t,d.id.client));const g=m-d.id.clock;if(g<0){r.push(d);u(d.id.client,d.id.clock-1);h()}else{const x=d.getMissing(e,t);if(x!==null){r.push(d);const w=n.get(x)||{refs:[],i:0};if(w.refs.length===w.i){u(x,Sp(t,x));h()}else{d=w.refs[w.i++];continue}}else if(g===0||g0){d=r.pop()}else if(a!==null&&a.i0){const m=new Wk;mHe(m,s,new Map);tc(m.restEncoder,0);return{missing:l,update:m.toUint8Array()}}return null};var Zjr=(e,t)=>mHe(e,t.doc.store,t.beforeState);var Jjr=(e,t,n,r=new Hk(e))=>Gu(t,i=>{i.local=false;let o=false;const a=i.doc;const s=a.store;const l=jjr(r,a);const u=Kjr(i,s,l);const d=s.pendingStructs;if(d){for(const[h,m]of d.missing){if(mm){d.missing.set(h,m)}}d.update=gM([d.update,u.update])}}else{s.pendingStructs=u}const f=xYt(r,i,s);if(s.pendingDs){const h=new Hk(dM(s.pendingDs));ml(h.restDecoder);const m=xYt(h,i,s);if(f&&m){s.pendingDs=gM([f,m])}else{s.pendingDs=f||m}}else{s.pendingDs=f}if(o){const h=s.pendingStructs.update;s.pendingStructs=null;EJ(i.doc,h)}},n,false);var EJ=(e,t,n,r=Hk)=>{const i=dM(t);Jjr(i,e,n,new r(i))};var Qjr=(e,t,n=new Map)=>{mHe(e,t.store,n);jU(e,qjr(t.store))};var Kve=(e,t=new Uint8Array([0]),n=new Wk)=>{const r=FYt(t);Qjr(n,e,r);const i=[n.toUint8Array()];if(e.store.pendingDs){i.push(e.store.pendingDs)}if(e.store.pendingStructs){i.push(uKr(e.store.pendingStructs.update,t))}if(i.length>1){if(n.constructor===GU){return lKr(i.map((o,a)=>a===0?o:fKr(o)))}else if(n.constructor===Wk){return gM(i)}}return i[0]};var eKr=e=>{const t=new Map;const n=ml(e.restDecoder);for(let r=0;reKr(new $ve(dM(e)));var eHe=class{constructor(){this.l=[]}};var vYt=()=>new eHe;var _Yt=(e,t)=>e.l.push(t);var TYt=(e,t)=>{const n=e.l;const r=n.length;e.l=n.filter(i=>t!==i);if(r===e.l.length){console.error("[yjs] Tried to remove event handler that doesn't exist.")}};var NYt=(e,t,n)=>iJ(e.l,[t,n]);var pM=class{constructor(t,n){this.client=t;this.clock=n}};var Ove=(e,t)=>e===t||e!==null&&t!==null&&e.client===t.client&&e.clock===t.clock;var El=(e,t)=>new pM(e,t);var tKr=e=>{for(const[t,n]of e.doc.share.entries()){if(n===e){return t}}throw fw()};var Gve=(e,t)=>{while(t!==null){if(t.parent===e){return true}t=t.parent._item}return false};var tHe=class{constructor(t,n){this.ds=t;this.sv=n}};var nKr=(e,t)=>new tHe(e,t);var Cfa=nKr(LYt(),new Map);var VU=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&(t.sv.get(e.id.client)||0)>e.id.clock&&!wJ(t.ds,e.id);var nHe=(e,t)=>{const n=aC(e.meta,nHe,JO);const r=e.doc.store;if(!n.has(t)){t.sv.forEach((i,o)=>{if(i{});n.add(t)}};var Hve=class{constructor(){this.clients=new Map;this.pendingStructs=null;this.pendingDs=null}};var gHe=e=>{const t=new Map;e.clients.forEach((n,r)=>{const i=n[n.length-1];t.set(r,i.id.clock+i.length)});return t};var Sp=(e,t)=>{const n=e.clients.get(t);if(n===void 0){return 0}const r=n[n.length-1];return r.id.clock+r.length};var OYt=(e,t)=>{let n=e.clients.get(t.id.client);if(n===void 0){n=[];e.clients.set(t.id.client,n)}else{const r=n[n.length-1];if(r.id.clock+r.length!==t.id.clock){throw fw()}}n.push(t)};var dC=(e,t)=>{let n=0;let r=e.length-1;let i=e[r];let o=i.id.clock;if(o===t){return r}let a=f_(t/(o+i.length-1)*r);while(n<=r){i=e[a];o=i.id.clock;if(o<=t){if(t{const n=e.clients.get(t.client);return n[dC(n,t.clock)]};var Uve=rKr;var rHe=(e,t,n)=>{const r=dC(t,n);const i=t[r];if(i.id.clock{const n=e.doc.store.clients.get(t.client);return n[rHe(e,n,t.clock)]};var wYt=(e,t,n)=>{const r=t.clients.get(n.client);const i=dC(r,n.clock);const o=r[i];if(n.clock!==o.id.clock+o.length-1&&o.constructor!==rx){r.splice(i+1,0,Xve(e,o,n.clock-o.id.clock+1))}return o};var iKr=(e,t,n)=>{const r=e.clients.get(t.id.client);r[dC(r,t.id.clock)]=n};var BYt=(e,t,n,r,i)=>{if(r===0){return}const o=n+r;let a=rHe(e,t,n);let s;do{s=t[a++];if(o{if(t.deleteSet.clients.size===0&&!FWt(t.afterState,(n,r)=>t.beforeState.get(r)!==n)){return false}pHe(t.deleteSet);Zjr(e,t);jU(e,t.deleteSet);return true};var CYt=(e,t,n)=>{const r=t._item;if(r===null||r.id.clock<(e.beforeState.get(r.id.client)||0)&&!r.deleted){aC(e.changed,t,JO).add(n)}};var Vve=(e,t)=>{let n=e[t];let r=e[t-1];let i=t;for(;i>0;n=r,r=e[--i-1]){if(r.deleted===n.deleted&&r.constructor===n.constructor){if(r.mergeWith(n)){if(n instanceof Jd&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n){n.parent._map.set(n.parentSub,r)}continue}}break}const o=t-i;if(o){e.splice(t+1-o,o)}return o};var oKr=(e,t,n)=>{for(const[r,i]of e.clients.entries()){const o=t.clients.get(r);for(let a=i.length-1;a>=0;a--){const s=i[a];const l=s.clock+s.len;for(let u=dC(o,s.clock),d=o[u];u{e.clients.forEach((n,r)=>{const i=t.clients.get(r);for(let o=n.length-1;o>=0;o--){const a=n[o];const s=Cve(i.length-1,1+dC(i,a.clock+a.len-1));for(let l=s,u=i[l];l>0&&u.id.clock>=a.clock;u=i[l]){l-=1+Vve(i,l)}}})};var zYt=(e,t)=>{if(ts.push(()=>{if(u._item===null||!u._item.deleted){u._callObserver(n,l)}}));s.push(()=>{n.changedParentTypes.forEach((l,u)=>{if(u._dEH.l.length>0&&(u._item===null||!u._item.deleted)){l=l.filter(d=>d.target._item===null||!d.target._item.deleted);l.forEach(d=>{d.currentTarget=u;d._path=null});l.sort((d,f)=>d.path.length-f.path.length);NYt(u._dEH,l,n)}})});s.push(()=>r.emit("afterTransaction",[n,r]));iJ(s,[]);if(n._needFormattingCleanup){wKr(n)}}finally{if(r.gc){oKr(o,i,r.gcFilter)}aKr(o,i);n.afterState.forEach((d,f)=>{const h=n.beforeState.get(f)||0;if(h!==d){const m=i.clients.get(f);const g=$k(dC(m,h),1);for(let x=m.length-1;x>=g;){x-=1+Vve(m,x)}}});for(let d=a.length-1;d>=0;d--){const{client:f,clock:h}=a[d].id;const m=i.clients.get(f);const g=dC(m,h);if(g+11){continue}}if(g>0){Vve(m,g)}}if(!n.local&&n.afterState.get(r.clientID)!==n.beforeState.get(r.clientID)){gYt(uJ,sJ,"[yjs] ",lJ,cJ,"Changed the client-id because another client seems to be using it.");r.clientID=DYt()}r.emit("afterTransactionCleanup",[n,r]);if(r._observers.has("update")){const d=new GU;const f=EYt(d,n);if(f){r.emit("update",[d.toUint8Array(),n.origin,r,n])}}if(r._observers.has("updateV2")){const d=new Wk;const f=EYt(d,n);if(f){r.emit("updateV2",[d.toUint8Array(),n.origin,r,n])}}const{subdocsAdded:s,subdocsLoaded:l,subdocsRemoved:u}=n;if(s.size>0||u.size>0||l.size>0){s.forEach(d=>{d.clientID=r.clientID;if(d.collectionid==null){d.collectionid=r.collectionid}r.subdocs.add(d)});u.forEach(d=>r.subdocs.delete(d));r.emit("subdocs",[{loaded:l,added:s,removed:u},r,n]);u.forEach(d=>d.destroy())}if(e.length<=t+1){r._transactionCleanups=[];r.emit("afterAllTransactions",[r,e])}else{zYt(e,t+1)}}}};var Gu=(e,t,n=null,r=true)=>{const i=e._transactionCleanups;let o=false;let a=null;if(e._transaction===null){o=true;e._transaction=new iHe(e,n,r);i.push(e._transaction);if(i.length===1){e.emit("beforeAllTransactions",[e])}e.emit("beforeTransaction",[e._transaction,e])}try{a=t(e._transaction)}finally{if(o){const s=e._transaction===i[0];e._transaction=null;if(s){zYt(i,0)}}}return a};var oHe=class{constructor(t,n){this.insertions=n;this.deletions=t;this.meta=new Map}};var SYt=(e,t,n)=>{$U(e,n.deletions,r=>{if(r instanceof Jd&&t.scope.some(i=>i===e.doc||Gve(i,r))){_He(r,false)}})};var AYt=(e,t,n)=>{let r=null;const i=e.doc;const o=e.scope;Gu(i,s=>{while(t.length>0&&e.currStackItem===null){const l=i.store;const u=t.pop();const d=new Set;const f=[];let h=false;$U(s,u.insertions,m=>{if(m instanceof Jd){if(m.redone!==null){let{item:g,diff:x}=XKr(l,m.id);if(x>0){g=nx(s,El(g.id.client,g.id.clock+x))}m=g}if(!m.deleted&&o.some(g=>g===s.doc||Gve(g,m))){f.push(m)}}});$U(s,u.deletions,m=>{if(m instanceof Jd&&o.some(g=>g===s.doc||Gve(g,m))&&!wJ(u.insertions,m.id)){d.add(m)}});d.forEach(m=>{h=rqt(s,m,d,u.insertions,e.ignoreRemoteMapChanges,e)!==null||h});for(let m=f.length-1;m>=0;m--){const g=f[m];if(e.deleteFilter(g)){g.delete(s);h=true}}e.currStackItem=h?u:null}s.changed.forEach((l,u)=>{if(l.has(null)&&u._searchMarker){u._searchMarker.length=0}});r=s},e);const a=e.currStackItem;if(a!=null){const s=r.changedParentTypes;e.emit("stack-item-popped",[{stackItem:a,type:n,changedParentTypes:s,origin:e},e]);e.currStackItem=null}return a};var HU=class extends ZZ{constructor(t,{captureTimeout:n=500,captureTransaction:r=l=>true,deleteFilter:i=()=>true,trackedOrigins:o=new Set([null]),ignoreRemoteMapChanges:a=false,doc:s=KZ(t)?t[0].doc:t instanceof uC?t:t.doc}={}){super();this.scope=[];this.doc=s;this.addToScope(t);this.deleteFilter=i;o.add(this);this.trackedOrigins=o;this.captureTransaction=r;this.undoStack=[];this.redoStack=[];this.undoing=false;this.redoing=false;this.currStackItem=null;this.lastChange=0;this.ignoreRemoteMapChanges=a;this.captureTimeout=n;this.afterTransactionHandler=l=>{if(!this.captureTransaction(l)||!this.scope.some(w=>l.changedParentTypes.has(w)||w===this.doc)||!this.trackedOrigins.has(l.origin)&&(!l.origin||!this.trackedOrigins.has(l.origin.constructor))){return}const u=this.undoing;const d=this.redoing;const f=u?this.redoStack:this.undoStack;if(u){this.stopCapturing()}else if(!d){this.clear(false,true)}const h=new mM;l.afterState.forEach((w,_)=>{const C=l.beforeState.get(_)||0;const A=w-C;if(A>0){hJ(h,_,C,A)}});const m=Fve();let g=false;if(this.lastChange>0&&m-this.lastChange0&&!u&&!d){const w=f[f.length-1];w.deletions=jGe([w.deletions,l.deleteSet]);w.insertions=jGe([w.insertions,h])}else{f.push(new oHe(l.deleteSet,h));g=true}if(!u&&!d){this.lastChange=m}$U(l,l.deleteSet,w=>{if(w instanceof Jd&&this.scope.some(_=>_===l.doc||Gve(_,w))){_He(w,true)}});const x=[{stackItem:f[f.length-1],origin:l.origin,type:u?"redo":"undo",changedParentTypes:l.changedParentTypes},this];if(g){this.emit("stack-item-added",x)}else{this.emit("stack-item-updated",x)}};this.doc.on("afterTransaction",this.afterTransactionHandler);this.doc.on("destroy",()=>{this.destroy()})}addToScope(t){const n=new Set(this.scope);t=KZ(t)?t:[t];t.forEach(r=>{if(!n.has(r)){n.add(r);if(r instanceof Hh?r.doc!==this.doc:r!==this.doc)qGe("[yjs#509] Not same Y.Doc");this.scope.push(r)}})}addTrackedOrigin(t){this.trackedOrigins.add(t)}removeTrackedOrigin(t){this.trackedOrigins.delete(t)}clear(t=true,n=true){if(t&&this.canUndo()||n&&this.canRedo()){this.doc.transact(r=>{if(t){this.undoStack.forEach(i=>SYt(r,this,i));this.undoStack=[]}if(n){this.redoStack.forEach(i=>SYt(r,this,i));this.redoStack=[]}this.emit("stack-cleared",[{undoStackCleared:t,redoStackCleared:n}])})}}stopCapturing(){this.lastChange=0}undo(){this.undoing=true;let t;try{t=AYt(this,this.undoStack,"undo")}finally{this.undoing=false}return t}redo(){this.redoing=true;let t;try{t=AYt(this,this.redoStack,"redo")}finally{this.redoing=false}return t}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}destroy(){this.trackedOrigins.delete(this);this.doc.off("afterTransaction",this.afterTransactionHandler);super.destroy()}};function*sKr(e){const t=ml(e.restDecoder);for(let n=0;n{const n=[];const r=new t(dM(e));const i=new WU(r,false);for(let o=i.curr;o!==null;o=i.next()){n.push(o)}return{structs:n,ds:jve(r)}};var pJ=class{constructor(t){this.currClient=0;this.startClock=0;this.written=0;this.encoder=t;this.clientStructs=[]}};var lKr=e=>gM(e,KGe,GU);var cKr=(e,t)=>{if(e.constructor===rx){const{client:n,clock:r}=e.id;return new rx(El(n,r+t),e.length-t)}else if(e.constructor===ix){const{client:n,clock:r}=e.id;return new ix(El(n,r+t),e.length-t)}else{const n=e;const{client:r,clock:i}=n.id;return new Jd(El(r,i+t),null,El(r,i+t-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(t))}};var gM=(e,t=Hk,n=Wk)=>{if(e.length===1){return e[0]}const r=e.map(d=>new t(dM(d)));let i=r.map(d=>new WU(d,true));let o=null;const a=new n;const s=new pJ(a);while(true){i=i.filter(h=>h.curr!==null);i.sort((h,m)=>{if(h.curr.id.client===m.curr.id.client){const g=h.curr.id.clock-m.curr.id.clock;if(g===0){return h.curr.constructor===m.curr.constructor?0:h.curr.constructor===ix?1:-1}else{return g}}else{return m.curr.id.client-h.curr.id.client}});if(i.length===0){break}const d=i[0];const f=d.curr.id.client;if(o!==null){let h=d.curr;let m=false;while(h!==null&&h.id.clock+h.length<=o.struct.id.clock+o.struct.length&&h.id.client>=o.struct.id.client){h=d.next();m=true}if(h===null||h.id.client!==f||m&&h.id.clock>o.struct.id.clock+o.struct.length){continue}if(f!==o.struct.id.client){fM(s,o.struct,o.offset);o={struct:h,offset:0};d.next()}else{if(o.struct.id.clock+o.struct.length0){if(o.struct.constructor===ix){o.struct.length-=g}else{h=cKr(h,g)}}if(!o.struct.mergeWith(h)){fM(s,o.struct,o.offset);o={struct:h,offset:0};d.next()}}}}else{o={struct:d.curr,offset:0};d.next()}for(let h=d.curr;h!==null&&h.id.client===f&&h.id.clock===o.struct.id.clock+o.struct.length&&h.constructor!==ix;h=d.next()){fM(s,o.struct,o.offset);o={struct:h,offset:0}}}if(o!==null){fM(s,o.struct,o.offset);o=null}yHe(s);const l=r.map(d=>jve(d));const u=jGe(l);jU(a,u);return a.toUint8Array()};var uKr=(e,t,n=Hk,r=Wk)=>{const i=FYt(t);const o=new r;const a=new pJ(o);const s=new n(dM(e));const l=new WU(s,false);while(l.curr){const d=l.curr;const f=d.id.client;const h=i.get(f)||0;if(l.curr.constructor===ix){l.next();continue}if(d.id.clock+d.length>h){fM(a,d,$k(h-d.id.clock,0));l.next();while(l.curr&&l.curr.id.client===f){fM(a,l.curr,0);l.next()}}else{while(l.curr&&l.curr.id.client===f&&l.curr.id.clock+l.curr.length<=h){l.next()}}}yHe(a);const u=jve(s);jU(o,u);return o.toUint8Array()};var UYt=e=>{if(e.written>0){e.clientStructs.push({written:e.written,restEncoder:uw(e.encoder.restEncoder)});e.encoder.restEncoder=tJ();e.written=0}};var fM=(e,t,n)=>{if(e.written>0&&e.currClient!==t.id.client){UYt(e)}if(e.written===0){e.currClient=t.id.client;e.encoder.writeClient(t.id.client);tc(e.encoder.restEncoder,t.id.clock+n)}t.write(e.encoder,n);e.written++};var yHe=e=>{UYt(e);const t=e.encoder.restEncoder;tc(t,e.clientStructs.length);for(let n=0;n{const i=new n(dM(e));const o=new WU(i,false);const a=new r;const s=new pJ(a);for(let u=o.curr;u!==null;u=o.next()){fM(s,t(u),0)}yHe(s);const l=jve(i);jU(a,l);return a.toUint8Array()};var fKr=e=>dKr(e,sYt,Hk,GU);var kYt="You must not compute changes after the event-handler fired.";var YU=class{constructor(t,n){this.target=t;this.currentTarget=t;this.transaction=n;this._changes=null;this._keys=null;this._delta=null;this._path=null}get path(){return this._path||(this._path=hKr(this.currentTarget,this.target))}deletes(t){return wJ(this.transaction.deleteSet,t.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0){throw sC(kYt)}const t=new Map;const n=this.target;const r=this.transaction.changed.get(n);r.forEach(i=>{if(i!==null){const o=n._map.get(i);let a;let s;if(this.adds(o)){let l=o.left;while(l!==null&&this.adds(l)){l=l.left}if(this.deletes(o)){if(l!==null&&this.deletes(l)){a="delete";s=Eve(l.content.getContent())}else{return}}else{if(l!==null&&this.deletes(l)){a="update";s=Eve(l.content.getContent())}else{a="add";s=void 0}}}else{if(this.deletes(o)){a="delete";s=Eve(o.content.getContent())}else{return}}t.set(i,{action:a,oldValue:s})}});this._keys=t}return this._keys}get delta(){return this.changes.delta}adds(t){return t.id.clock>=(this.transaction.beforeState.get(t.id.client)||0)}get changes(){let t=this._changes;if(t===null){if(this.transaction.doc._transactionCleanups.length===0){throw sC(kYt)}const n=this.target;const r=JO();const i=JO();const o=[];t={added:r,deleted:i,delta:o,keys:this.keys};const a=this.transaction.changed.get(n);if(a.has(null)){let s=null;const l=()=>{if(s){o.push(s)}};for(let u=n._start;u!==null;u=u.right){if(u.deleted){if(this.deletes(u)&&!this.adds(u)){if(s===null||s.delete===void 0){l();s={delete:0}}s.delete+=u.length;i.add(u)}}else{if(this.adds(u)){if(s===null||s.insert===void 0){l();s={insert:[]}}s.insert=s.insert.concat(u.content.getContent());r.add(u)}else{if(s===null||s.retain===void 0){l();s={retain:0}}s.retain+=u.length}}}if(s!==null&&s.retain===void 0){l()}}this._changes=t}return t}};var hKr=(e,t)=>{const n=[];while(t._item!==null&&t!==e){if(t._item.parentSub!==null){n.unshift(t._item.parentSub)}else{let r=0;let i=t._item.parent._start;while(i!==t._item&&i!==null){if(!i.deleted&&i.countable){r+=i.length}i=i.right}n.unshift(r)}t=t._item.parent}return n};var Fy=()=>{qGe("Invalid access: Add Yjs type to a document before reading data.")};var VYt=80;var bHe=0;var aHe=class{constructor(t,n){t.marker=true;this.p=t;this.index=n;this.timestamp=bHe++}};var pKr=e=>{e.timestamp=bHe++};var $Yt=(e,t,n)=>{e.p.marker=false;e.p=t;t.marker=true;e.index=n;e.timestamp=bHe++};var mKr=(e,t,n)=>{if(e.length>=VYt){const r=e.reduce((i,o)=>i.timestamp{if(e._start===null||t===0||e._searchMarker===null){return null}const n=e._searchMarker.length===0?null:e._searchMarker.reduce((o,a)=>MU(t-o.index)t){r=r.left;if(!r.deleted&&r.countable){i-=r.length}}while(r.left!==null&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock){r=r.left;if(!r.deleted&&r.countable){i-=r.length}}if(n!==null&&MU(n.index-i){for(let r=e.length-1;r>=0;r--){const i=e[r];if(n>0){let o=i.p;o.marker=false;while(o&&(o.deleted||!o.countable)){o=o.left;if(o&&!o.deleted&&o.countable){i.index-=o.length}}if(o===null||o.marker===true){e.splice(r,1);continue}i.p=o;o.marker=true}if(t0&&t===i.index){i.index=$k(t,i.index+n)}}};var Qve=(e,t,n)=>{const r=e;const i=t.changedParentTypes;while(true){aC(i,e,()=>[]).push(n);if(e._item===null){break}e=e._item.parent}NYt(r._eH,n,t)};var Hh=class{constructor(){this._item=null;this._map=new Map;this._start=null;this.doc=null;this._length=0;this._eH=vYt();this._dEH=vYt();this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(t,n){this.doc=t;this._item=n}_copy(){throw dw()}clone(){throw dw()}_write(t){}get _first(){let t=this._start;while(t!==null&&t.deleted){t=t.right}return t}_callObserver(t,n){if(!t.local&&this._searchMarker){this._searchMarker.length=0}}observe(t){_Yt(this._eH,t)}observeDeep(t){_Yt(this._dEH,t)}unobserve(t){TYt(this._eH,t)}unobserveDeep(t){TYt(this._dEH,t)}toJSON(){}};var GYt=(e,t,n)=>{e.doc??Fy();if(t<0){t=e._length+t}if(n<0){n=e._length+n}let r=n-t;const i=[];let o=e._start;while(o!==null&&r>0){if(o.countable&&!o.deleted){const a=o.content.getContent();if(a.length<=t){t-=a.length}else{for(let s=t;s0;s++){i.push(a[s]);r--}t=0}}o=o.right}return i};var HYt=e=>{e.doc??Fy();const t=[];let n=e._start;while(n!==null){if(n.countable&&!n.deleted){const r=n.content.getContent();for(let i=0;i{let n=0;let r=e._start;e.doc??Fy();while(r!==null){if(r.countable&&!r.deleted){const i=r.content.getContent();for(let o=0;o{const n=[];gJ(e,(r,i)=>{n.push(t(r,i,e))});return n};var gKr=e=>{let t=e._start;let n=null;let r=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){while(t!==null&&t.deleted){t=t.right}if(t===null){return{done:true,value:void 0}}n=t.content.getContent();r=0;t=t.right}const i=n[r++];if(n.length<=r){n=null}return{done:false,value:i}}}};var YYt=(e,t)=>{e.doc??Fy();const n=Jve(e,t);let r=e._start;if(n!==null){r=n.p;t-=n.index}for(;r!==null;r=r.right){if(!r.deleted&&r.countable){if(t{let i=n;const o=e.doc;const a=o.clientID;const s=o.store;const l=n===null?t._start:n.right;let u=[];const d=()=>{if(u.length>0){i=new Jd(El(a,Sp(s,a)),i,i&&i.lastId,l,l&&l.id,t,null,new XU(u));i.integrate(e,0);u=[]}};r.forEach(f=>{if(f===null){u.push(f)}else{switch(f.constructor){case Number:case Object:case Boolean:case Array:case String:u.push(f);break;default:d();switch(f.constructor){case Uint8Array:case ArrayBuffer:i=new Jd(El(a,Sp(s,a)),i,i&&i.lastId,l,l&&l.id,t,null,new _J(new Uint8Array(f)));i.integrate(e,0);break;case uC:i=new Jd(El(a,Sp(s,a)),i,i&&i.lastId,l,l&&l.id,t,null,new TJ(f));i.integrate(e,0);break;default:if(f instanceof Hh){i=new Jd(El(a,Sp(s,a)),i,i&&i.lastId,l,l&&l.id,t,null,new qk(f));i.integrate(e,0)}else{throw new Error("Unexpected content type in insert operation")}}}}});d()};var qYt=()=>sC("Length exceeded!");var XYt=(e,t,n,r)=>{if(n>t._length){throw qYt()}if(n===0){if(t._searchMarker){mJ(t._searchMarker,n,r.length)}return Wve(e,t,null,r)}const i=n;const o=Jve(t,n);let a=t._start;if(o!==null){a=o.p;n-=o.index;if(n===0){a=a.prev;n+=a&&a.countable&&!a.deleted?a.length:0}}for(;a!==null;a=a.right){if(!a.deleted&&a.countable){if(n<=a.length){if(n{const r=(t._searchMarker||[]).reduce((o,a)=>a.index>o.index?a:o,{index:0,p:t._start});let i=r.p;if(i){while(i.right){i=i.right}}return Wve(e,t,i,n)};var jYt=(e,t,n,r)=>{if(r===0){return}const i=n;const o=r;const a=Jve(t,n);let s=t._start;if(a!==null){s=a.p;n-=a.index}for(;s!==null&&n>0;s=s.right){if(!s.deleted&&s.countable){if(n0&&s!==null){if(!s.deleted){if(r0){throw qYt()}if(t._searchMarker){mJ(t._searchMarker,i,-o+r)}};var Yve=(e,t,n)=>{const r=t._map.get(n);if(r!==void 0){r.delete(e)}};var xHe=(e,t,n,r)=>{const i=t._map.get(n)||null;const o=e.doc;const a=o.clientID;let s;if(r==null){s=new XU([r])}else{switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:s=new XU([r]);break;case Uint8Array:s=new _J(r);break;case uC:s=new TJ(r);break;default:if(r instanceof Hh){s=new qk(r)}else{throw new Error("Unexpected content type")}}}new Jd(El(a,Sp(o.store,a)),i,i&&i.lastId,null,null,t,n,s).integrate(e,0)};var vHe=(e,t)=>{e.doc??Fy();const n=e._map.get(t);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0};var KYt=e=>{const t={};e.doc??Fy();e._map.forEach((n,r)=>{if(!n.deleted){t[r]=n.content.getContent()[n.length-1]}});return t};var ZYt=(e,t)=>{e.doc??Fy();const n=e._map.get(t);return n!==void 0&&!n.deleted};var bKr=(e,t)=>{const n={};e._map.forEach((r,i)=>{let o=r;while(o!==null&&(!t.sv.has(o.id.client)||o.id.clock>=(t.sv.get(o.id.client)||0))){o=o.left}if(o!==null&&VU(o,t)){n[i]=o.content.getContent()[o.length-1]}});return n};var Bve=e=>{e.doc??Fy();return bYt(e._map.entries(),t=>!t[1].deleted)};var sHe=class extends YU{};var p_=class e extends Hh{constructor(){super();this._prelimContent=[];this._searchMarker=[]}static from(t){const n=new e;n.push(t);return n}_integrate(t,n){super._integrate(t,n);this.insert(0,this._prelimContent);this._prelimContent=null}_copy(){return new e}clone(){const t=new e;t.insert(0,this.toArray().map(n=>n instanceof Hh?n.clone():n));return t}get length(){this.doc??Fy();return this._length}_callObserver(t,n){super._callObserver(t,n);Qve(this,t,new sHe(this,t))}insert(t,n){if(this.doc!==null){Gu(this.doc,r=>{XYt(r,this,t,n)})}else{this._prelimContent.splice(t,0,...n)}}push(t){if(this.doc!==null){Gu(this.doc,n=>{yKr(n,this,t)})}else{this._prelimContent.push(...t)}}unshift(t){this.insert(0,t)}delete(t,n=1){if(this.doc!==null){Gu(this.doc,r=>{jYt(r,this,t,n)})}else{this._prelimContent.splice(t,n)}}get(t){return YYt(this,t)}toArray(){return HYt(this)}slice(t=0,n=this.length){return GYt(this,t,n)}toJSON(){return this.map(t=>t instanceof Hh?t.toJSON():t)}map(t){return WYt(this,t)}forEach(t){gJ(this,t)}[Symbol.iterator](){return gKr(this)}_write(t){t.writeTypeRef(UKr)}};var xKr=e=>new p_;var lHe=class extends YU{constructor(t,n,r){super(t,n);this.keysChanged=r}};var Ns=class e extends Hh{constructor(t){super();this._prelimContent=null;if(t===void 0){this._prelimContent=new Map}else{this._prelimContent=new Map(t)}}_integrate(t,n){super._integrate(t,n);this._prelimContent.forEach((r,i)=>{this.set(i,r)});this._prelimContent=null}_copy(){return new e}clone(){const t=new e;this.forEach((n,r)=>{t.set(r,n instanceof Hh?n.clone():n)});return t}_callObserver(t,n){Qve(this,t,new lHe(this,t,n))}toJSON(){this.doc??Fy();const t={};this._map.forEach((n,r)=>{if(!n.deleted){const i=n.content.getContent()[n.length-1];t[r]=i instanceof Hh?i.toJSON():i}});return t}get size(){return[...Bve(this)].length}keys(){return Nve(Bve(this),t=>t[0])}values(){return Nve(Bve(this),t=>t[1].content.getContent()[t[1].length-1])}entries(){return Nve(Bve(this),t=>[t[0],t[1].content.getContent()[t[1].length-1]])}forEach(t){this.doc??Fy();this._map.forEach((n,r)=>{if(!n.deleted){t(n.content.getContent()[n.length-1],r,this)}})}[Symbol.iterator](){return this.entries()}delete(t){if(this.doc!==null){Gu(this.doc,n=>{Yve(n,this,t)})}else{this._prelimContent.delete(t)}}set(t,n){if(this.doc!==null){Gu(this.doc,r=>{xHe(r,this,t,n)})}else{this._prelimContent.set(t,n)}return n}get(t){return vHe(this,t)}has(t){return ZYt(this,t)}clear(){if(this.doc!==null){Gu(this.doc,t=>{this.forEach(function(n,r,i){Yve(t,i,r)})})}else{this._prelimContent.clear()}}_write(t){t.writeTypeRef(VKr)}};var vKr=e=>new Ns;var hM=(e,t)=>e===t||typeof e==="object"&&typeof t==="object"&&e&&t&&aYt(e,t);var yJ=class{constructor(t,n,r,i){this.left=t;this.right=n;this.index=r;this.currentAttributes=i}forward(){if(this.right===null){fw()}switch(this.right.content.constructor){case Ap:if(!this.right.deleted){KU(this.currentAttributes,this.right.content)}break;default:if(!this.right.deleted){this.index+=this.right.length}break}this.left=this.right;this.right=this.right.right}};var RYt=(e,t,n)=>{while(t.right!==null&&n>0){switch(t.right.content.constructor){case Ap:if(!t.right.deleted){KU(t.currentAttributes,t.right.content)}break;default:if(!t.right.deleted){if(n{const i=new Map;const o=r?Jve(t,n):null;if(o){const a=new yJ(o.p.left,o.p,o.index,i);return RYt(e,a,n-o.index)}else{const a=new yJ(null,t._start,0,i);return RYt(e,a,n)}};var JYt=(e,t,n,r)=>{while(n.right!==null&&(n.right.deleted===true||n.right.content.constructor===Ap&&hM(r.get(n.right.content.key),n.right.content.value))){if(!n.right.deleted){r.delete(n.right.content.key)}n.forward()}const i=e.doc;const o=i.clientID;r.forEach((a,s)=>{const l=n.left;const u=n.right;const d=new Jd(El(o,Sp(i.store,o)),l,l&&l.lastId,u,u&&u.id,t,null,new Ap(s,a));d.integrate(e,0);n.right=d;n.forward()})};var KU=(e,t)=>{const{key:n,value:r}=t;if(r===null){e.delete(n)}else{e.set(n,r)}};var QYt=(e,t)=>{while(true){if(e.right===null){break}else if(e.right.deleted||e.right.content.constructor===Ap&&hM(t[e.right.content.key]??null,e.right.content.value));else{break}e.forward()}};var eqt=(e,t,n,r)=>{const i=e.doc;const o=i.clientID;const a=new Map;for(const s in r){const l=r[s];const u=n.currentAttributes.get(s)??null;if(!hM(u,l)){a.set(s,u);const{left:d,right:f}=n;n.right=new Jd(El(o,Sp(i.store,o)),d,d&&d.lastId,f,f&&f.id,t,null,new Ap(s,l));n.right.integrate(e,0);n.forward()}}return a};var XGe=(e,t,n,r,i)=>{n.currentAttributes.forEach((h,m)=>{if(i[m]===void 0){i[m]=null}});const o=e.doc;const a=o.clientID;QYt(n,i);const s=eqt(e,t,n,i);const l=r.constructor===String?new Yk(r):r instanceof Hh?new qk(r):new o5(r);let{left:u,right:d,index:f}=n;if(t._searchMarker){mJ(t._searchMarker,n.index,l.getLength())}d=new Jd(El(a,Sp(o.store,a)),u,u&&u.lastId,d,d&&d.id,t,null,l);d.integrate(e,0);n.right=d;n.index=f;n.forward();JYt(e,t,n,s)};var PYt=(e,t,n,r,i)=>{const o=e.doc;const a=o.clientID;QYt(n,i);const s=eqt(e,t,n,i);e:while(n.right!==null&&(r>0||s.size>0&&(n.right.deleted||n.right.content.constructor===Ap))){if(!n.right.deleted){switch(n.right.content.constructor){case Ap:{const{key:l,value:u}=n.right.content;const d=i[l];if(d!==void 0){if(hM(d,u)){s.delete(l)}else{if(r===0){break e}s.set(l,u)}n.right.delete(e)}else{n.currentAttributes.set(l,u)}break}default:if(r0){let l="";for(;r>0;r--){l+="\n"}n.right=new Jd(El(a,Sp(o.store,a)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,t,null,new Yk(l));n.right.integrate(e,0);n.forward()}JYt(e,t,n,s)};var tqt=(e,t,n,r,i)=>{let o=t;const a=O1();while(o&&(!o.countable||o.deleted)){if(!o.deleted&&o.content.constructor===Ap){const u=o.content;a.set(u.key,u)}o=o.right}let s=0;let l=false;while(t!==o){if(n===t){l=true}if(!t.deleted){const u=t.content;switch(u.constructor){case Ap:{const{key:d,value:f}=u;const h=r.get(d)??null;if(a.get(d)!==u||h===f){t.delete(e);s++;if(!l&&(i.get(d)??null)===f&&h!==f){if(h===null){i.delete(d)}else{i.set(d,h)}}}if(!l&&!t.deleted){KU(i,u)}break}}}t=t.right}return s};var _Kr=(e,t)=>{while(t&&t.right&&(t.right.deleted||!t.right.countable)){t=t.right}const n=new Set;while(t&&(t.deleted||!t.countable)){if(!t.deleted&&t.content.constructor===Ap){const r=t.content.key;if(n.has(r)){t.delete(e)}else{n.add(r)}}t=t.left}};var TKr=e=>{let t=0;Gu(e.doc,n=>{let r=e._start;let i=e._start;let o=O1();const a=wve(o);while(i){if(i.deleted===false){switch(i.content.constructor){case Ap:KU(a,i.content);break;default:t+=tqt(n,r,i,o,a);o=wve(a);r=i;break}}i=i.right}});return t};var wKr=e=>{const t=new Set;const n=e.doc;for(const[r,i]of e.afterState.entries()){const o=e.beforeState.get(r)||0;if(i===o){continue}BYt(e,n.store.clients.get(r),o,i,a=>{if(!a.deleted&&a.content.constructor===Ap&&a.constructor!==rx){t.add(a.parent)}})}Gu(n,r=>{$U(e,e.deleteSet,i=>{if(i instanceof rx||!i.parent._hasFormatting||t.has(i.parent)){return}const o=i.parent;if(i.content.constructor===Ap){t.add(o)}else{_Kr(r,i)}});for(const i of t){TKr(i)}})};var IYt=(e,t,n)=>{const r=n;const i=wve(t.currentAttributes);const o=t.right;while(n>0&&t.right!==null){if(t.right.deleted===false){switch(t.right.content.constructor){case qk:case o5:case Yk:if(n{if(i===null){this.childListChanged=true}else{this.keysChanged.add(i)}})}get changes(){if(this._changes===null){const t={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=t}return this._changes}get delta(){if(this._delta===null){const t=this.target.doc;const n=[];Gu(t,r=>{const i=new Map;const o=new Map;let a=this.target._start;let s=null;const l={};let u="";let d=0;let f=0;const h=()=>{if(s!==null){let m=null;switch(s){case"delete":if(f>0){m={delete:f}}f=0;break;case"insert":if(typeof u==="object"||u.length>0){m={insert:u};if(i.size>0){m.attributes={};i.forEach((g,x)=>{if(g!==null){m.attributes[x]=g}})}}u="";break;case"retain":if(d>0){m={retain:d};if(!oYt(l)){m.attributes=rYt({},l)}}d=0;break}if(m)n.push(m);s=null}};while(a!==null){switch(a.content.constructor){case qk:case o5:if(this.adds(a)){if(!this.deletes(a)){h();s="insert";u=a.content.getContent()[0];h()}}else if(this.deletes(a)){if(s!=="delete"){h();s="delete"}f+=1}else if(!a.deleted){if(s!=="retain"){h();s="retain"}d+=1}break;case Yk:if(this.adds(a)){if(!this.deletes(a)){if(s!=="insert"){h();s="insert"}u+=a.content.str}}else if(this.deletes(a)){if(s!=="delete"){h();s="delete"}f+=a.length}else if(!a.deleted){if(s!=="retain"){h();s="retain"}d+=a.length}break;case Ap:{const{key:m,value:g}=a.content;if(this.adds(a)){if(!this.deletes(a)){const x=i.get(m)??null;if(!hM(x,g)){if(s==="retain"){h()}if(hM(g,o.get(m)??null)){delete l[m]}else{l[m]=g}}else if(g!==null){a.delete(r)}}}else if(this.deletes(a)){o.set(m,g);const x=i.get(m)??null;if(!hM(x,g)){if(s==="retain"){h()}l[m]=x}}else if(!a.deleted){o.set(m,g);const x=l[m];if(x!==void 0){if(!hM(x,g)){if(s==="retain"){h()}if(g===null){delete l[m]}else{l[m]=g}}else if(x!==null){a.delete(r)}}}if(!a.deleted){if(s==="insert"){h()}KU(i,a.content)}break}}a=a.right}h();while(n.length>0){const m=n[n.length-1];if(m.retain!==void 0&&m.attributes===void 0){n.pop()}else{break}}});this._delta=n}return this._delta}};var bJ=class e extends Hh{constructor(t){super();this._pending=t!==void 0?[()=>this.insert(0,t)]:[];this._searchMarker=[];this._hasFormatting=false}get length(){this.doc??Fy();return this._length}_integrate(t,n){super._integrate(t,n);try{this._pending.forEach(r=>r())}catch(r){console.error(r)}this._pending=null}_copy(){return new e}clone(){const t=new e;t.applyDelta(this.toDelta());return t}_callObserver(t,n){super._callObserver(t,n);const r=new cHe(this,t,n);Qve(this,t,r);if(!t.local&&this._hasFormatting){t._needFormattingCleanup=true}}toString(){this.doc??Fy();let t="";let n=this._start;while(n!==null){if(!n.deleted&&n.countable&&n.content.constructor===Yk){t+=n.content.str}n=n.right}return t}toJSON(){return this.toString()}applyDelta(t,{sanitize:n=true}={}){if(this.doc!==null){Gu(this.doc,r=>{const i=new yJ(null,this._start,0,new Map);for(let o=0;o0){XGe(r,this,i,s,a.attributes||{})}}else if(a.retain!==void 0){PYt(r,this,i,a.retain,a.attributes||{})}else if(a.delete!==void 0){IYt(r,i,a.delete)}}})}else{this._pending.push(()=>this.applyDelta(t))}}toDelta(t,n,r){this.doc??Fy();const i=[];const o=new Map;const a=this.doc;let s="";let l=this._start;function u(){if(s.length>0){const f={};let h=false;o.forEach((g,x)=>{h=true;f[x]=g});const m={insert:s};if(h){m.attributes=f}i.push(m);s=""}}const d=()=>{while(l!==null){if(VU(l,t)||n!==void 0&&VU(l,n)){switch(l.content.constructor){case Yk:{const f=o.get("ychange");if(t!==void 0&&!VU(l,t)){if(f===void 0||f.user!==l.id.client||f.type!=="removed"){u();o.set("ychange",r?r("removed",l.id):{type:"removed"})}}else if(n!==void 0&&!VU(l,n)){if(f===void 0||f.user!==l.id.client||f.type!=="added"){u();o.set("ychange",r?r("added",l.id):{type:"added"})}}else if(f!==void 0){u();o.delete("ychange")}s+=l.content.str;break}case qk:case o5:{u();const f={insert:l.content.getContent()[0]};if(o.size>0){const h={};f.attributes=h;o.forEach((m,g)=>{h[g]=m})}i.push(f);break}case Ap:if(VU(l,t)){u();KU(o,l.content)}break}}l=l.right}u()};if(t||n){Gu(a,f=>{if(t){nHe(f,t)}if(n){nHe(f,n)}d()},"cleanup")}else{d()}return i}insert(t,n,r){if(n.length<=0){return}const i=this.doc;if(i!==null){Gu(i,o=>{const a=zve(o,this,t,!r);if(!r){r={};a.currentAttributes.forEach((s,l)=>{r[l]=s})}XGe(o,this,a,n,r)})}else{this._pending.push(()=>this.insert(t,n,r))}}insertEmbed(t,n,r){const i=this.doc;if(i!==null){Gu(i,o=>{const a=zve(o,this,t,!r);XGe(o,this,a,n,r||{})})}else{this._pending.push(()=>this.insertEmbed(t,n,r||{}))}}delete(t,n){if(n===0){return}const r=this.doc;if(r!==null){Gu(r,i=>{IYt(i,zve(i,this,t,true),n)})}else{this._pending.push(()=>this.delete(t,n))}}format(t,n,r){if(n===0){return}const i=this.doc;if(i!==null){Gu(i,o=>{const a=zve(o,this,t,false);if(a.right===null){return}PYt(o,this,a,n,r)})}else{this._pending.push(()=>this.format(t,n,r))}}removeAttribute(t){if(this.doc!==null){Gu(this.doc,n=>{Yve(n,this,t)})}else{this._pending.push(()=>this.removeAttribute(t))}}setAttribute(t,n){if(this.doc!==null){Gu(this.doc,r=>{xHe(r,this,t,n)})}else{this._pending.push(()=>this.setAttribute(t,n))}}getAttribute(t){return vHe(this,t)}getAttributes(){return KYt(this)}_write(t){t.writeTypeRef($Kr)}};var EKr=e=>new bJ;var dJ=class{constructor(t,n=()=>true){this._filter=n;this._root=t;this._currentNode=t._start;this._firstCall=true;t.doc??Fy()}[Symbol.iterator](){return this}next(){let t=this._currentNode;let n=t&&t.content&&t.content.type;if(t!==null&&(!this._firstCall||t.deleted||!this._filter(n))){do{n=t.content.type;if(!t.deleted&&(n.constructor===xJ||n.constructor===qU)&&n._start!==null){t=n._start}else{while(t!==null){const r=t.next;if(r!==null){t=r;break}else if(t.parent===this._root){t=null}else{t=t.parent._item}}}}while(t!==null&&(t.deleted||!this._filter(t.content.type)))}this._firstCall=false;if(t===null){return{value:void 0,done:true}}this._currentNode=t;return{value:t.content.type,done:false}}};var qU=class e extends Hh{constructor(){super();this._prelimContent=[]}get firstChild(){const t=this._first;return t?t.content.getContent()[0]:null}_integrate(t,n){super._integrate(t,n);this.insert(0,this._prelimContent);this._prelimContent=null}_copy(){return new e}clone(){const t=new e;t.insert(0,this.toArray().map(n=>n instanceof Hh?n.clone():n));return t}get length(){this.doc??Fy();return this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(t){return new dJ(this,t)}querySelector(t){t=t.toUpperCase();const n=new dJ(this,i=>i.nodeName&&i.nodeName.toUpperCase()===t);const r=n.next();if(r.done){return null}else{return r.value}}querySelectorAll(t){t=t.toUpperCase();return Vk(new dJ(this,n=>n.nodeName&&n.nodeName.toUpperCase()===t))}_callObserver(t,n){Qve(this,t,new uHe(this,n,t))}toString(){return WYt(this,t=>t.toString()).join("")}toJSON(){return this.toString()}toDOM(t=document,n={},r){const i=t.createDocumentFragment();if(r!==void 0){r._createAssociation(i,this)}gJ(this,o=>{i.insertBefore(o.toDOM(t,n,r),null)});return i}insert(t,n){if(this.doc!==null){Gu(this.doc,r=>{XYt(r,this,t,n)})}else{this._prelimContent.splice(t,0,...n)}}insertAfter(t,n){if(this.doc!==null){Gu(this.doc,r=>{const i=t&&t instanceof Hh?t._item:t;Wve(r,this,i,n)})}else{const r=this._prelimContent;const i=t===null?0:r.findIndex(o=>o===t)+1;if(i===0&&t!==null){throw sC("Reference item not found")}r.splice(i,0,...n)}}delete(t,n=1){if(this.doc!==null){Gu(this.doc,r=>{jYt(r,this,t,n)})}else{this._prelimContent.splice(t,n)}}toArray(){return HYt(this)}push(t){this.insert(this.length,t)}unshift(t){this.insert(0,t)}get(t){return YYt(this,t)}slice(t=0,n=this.length){return GYt(this,t,n)}forEach(t){gJ(this,t)}_write(t){t.writeTypeRef(HKr)}};var CKr=e=>new qU;var xJ=class e extends qU{constructor(t="UNDEFINED"){super();this.nodeName=t;this._prelimAttrs=new Map}get nextSibling(){const t=this._item?this._item.next:null;return t?t.content.type:null}get prevSibling(){const t=this._item?this._item.prev:null;return t?t.content.type:null}_integrate(t,n){super._integrate(t,n);this._prelimAttrs.forEach((r,i)=>{this.setAttribute(i,r)});this._prelimAttrs=null}_copy(){return new e(this.nodeName)}clone(){const t=new e(this.nodeName);const n=this.getAttributes();iYt(n,(r,i)=>{if(typeof r==="string"){t.setAttribute(i,r)}});t.insert(0,this.toArray().map(r=>r instanceof Hh?r.clone():r));return t}toString(){const t=this.getAttributes();const n=[];const r=[];for(const s in t){r.push(s)}r.sort();const i=r.length;for(let s=0;s0?" "+n.join(" "):"";return`<${o}${a}>${super.toString()}`}removeAttribute(t){if(this.doc!==null){Gu(this.doc,n=>{Yve(n,this,t)})}else{this._prelimAttrs.delete(t)}}setAttribute(t,n){if(this.doc!==null){Gu(this.doc,r=>{xHe(r,this,t,n)})}else{this._prelimAttrs.set(t,n)}}getAttribute(t){return vHe(this,t)}hasAttribute(t){return ZYt(this,t)}getAttributes(t){return t?bKr(this,t):KYt(this)}toDOM(t=document,n={},r){const i=t.createElement(this.nodeName);const o=this.getAttributes();for(const a in o){const s=o[a];if(typeof s==="string"){i.setAttribute(a,s)}}gJ(this,a=>{i.appendChild(a.toDOM(t,n,r))});if(r!==void 0){r._createAssociation(i,this)}return i}_write(t){t.writeTypeRef(GKr);t.writeKey(this.nodeName)}};var SKr=e=>new xJ(e.readKey());var uHe=class extends YU{constructor(t,n,r){super(t,r);this.childListChanged=false;this.attributesChanged=new Set;n.forEach(i=>{if(i===null){this.childListChanged=true}else{this.attributesChanged.add(i)}})}};var dHe=class e extends Ns{constructor(t){super();this.hookName=t}_copy(){return new e(this.hookName)}clone(){const t=new e(this.hookName);this.forEach((n,r)=>{t.set(r,n)});return t}toDOM(t=document,n={},r){const i=n[this.hookName];let o;if(i!==void 0){o=i.createDom(this)}else{o=document.createElement(this.hookName)}o.setAttribute("data-yjs-hook",this.hookName);if(r!==void 0){r._createAssociation(o,this)}return o}_write(t){t.writeTypeRef(WKr);t.writeKey(this.hookName)}};var AKr=e=>new dHe(e.readKey());var fHe=class e extends bJ{get nextSibling(){const t=this._item?this._item.next:null;return t?t.content.type:null}get prevSibling(){const t=this._item?this._item.prev:null;return t?t.content.type:null}_copy(){return new e}clone(){const t=new e;t.applyDelta(this.toDelta());return t}toDOM(t=document,n,r){const i=t.createTextNode(this.toString());if(r!==void 0){r._createAssociation(i,this)}return i}toString(){return this.toDelta().map(t=>{const n=[];for(const i in t.attributes){const o=[];for(const a in t.attributes[i]){o.push({key:a,value:t.attributes[i][a]})}o.sort((a,s)=>a.keyi.nodeName=0;i--){r+=``}return r}).join("")}toJSON(){return this.toString()}_write(t){t.writeTypeRef(YKr)}};var kKr=e=>new fHe;var vJ=class{constructor(t,n){this.id=t;this.length=n}get deleted(){throw dw()}mergeWith(t){return false}write(t,n,r){throw dw()}integrate(t,n){throw dw()}};var RKr=0;var rx=class extends vJ{get deleted(){return true}delete(){}mergeWith(t){if(this.constructor!==t.constructor){return false}this.length+=t.length;return true}integrate(t,n){if(n>0){this.id.clock+=n;this.length-=n}OYt(t.doc.store,this)}write(t,n){t.writeInfo(RKr);t.writeLen(this.length-n)}getMissing(t,n){return null}};var _J=class e{constructor(t){this.content=t}getLength(){return 1}getContent(){return[this.content]}isCountable(){return true}copy(){return new e(this.content)}splice(t){throw dw()}mergeWith(t){return false}integrate(t,n){}delete(t){}gc(t){}write(t,n){t.writeBuf(this.content)}getRef(){return 3}};var PKr=e=>new _J(e.readBuf());var qve=class e{constructor(t){this.len=t}getLength(){return this.len}getContent(){return[]}isCountable(){return false}copy(){return new e(this.len)}splice(t){const n=new e(this.len-t);this.len=t;return n}mergeWith(t){this.len+=t.len;return true}integrate(t,n){hJ(t.deleteSet,n.id.client,n.id.clock,this.len);n.markDeleted()}delete(t){}gc(t){}write(t,n){t.writeLen(this.len-n)}getRef(){return 1}};var IKr=e=>new qve(e.readLen());var nqt=(e,t)=>new uC({guid:e,...t,shouldLoad:t.shouldLoad||t.autoLoad||false});var TJ=class e{constructor(t){if(t._item){console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid.")}this.doc=t;const n={};this.opts=n;if(!t.gc){n.gc=false}if(t.autoLoad){n.autoLoad=true}if(t.meta!==null){n.meta=t.meta}}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return true}copy(){return new e(nqt(this.doc.guid,this.opts))}splice(t){throw dw()}mergeWith(t){return false}integrate(t,n){this.doc._item=n;t.subdocsAdded.add(this.doc);if(this.doc.shouldLoad){t.subdocsLoaded.add(this.doc)}}delete(t){if(t.subdocsAdded.has(this.doc)){t.subdocsAdded.delete(this.doc)}else{t.subdocsRemoved.add(this.doc)}}gc(t){}write(t,n){t.writeString(this.doc.guid);t.writeAny(this.opts)}getRef(){return 9}};var MKr=e=>new TJ(nqt(e.readString(),e.readAny()));var o5=class e{constructor(t){this.embed=t}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return true}copy(){return new e(this.embed)}splice(t){throw dw()}mergeWith(t){return false}integrate(t,n){}delete(t){}gc(t){}write(t,n){t.writeJSON(this.embed)}getRef(){return 5}};var LKr=e=>new o5(e.readJSON());var Ap=class e{constructor(t,n){this.key=t;this.value=n}getLength(){return 1}getContent(){return[]}isCountable(){return false}copy(){return new e(this.key,this.value)}splice(t){throw dw()}mergeWith(t){return false}integrate(t,n){const r=n.parent;r._searchMarker=null;r._hasFormatting=true}delete(t){}gc(t){}write(t,n){t.writeKey(this.key);t.writeJSON(this.value)}getRef(){return 6}};var DKr=e=>new Ap(e.readKey(),e.readJSON());var hHe=class e{constructor(t){this.arr=t}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return true}copy(){return new e(this.arr)}splice(t){const n=new e(this.arr.slice(t));this.arr=this.arr.slice(0,t);return n}mergeWith(t){this.arr=this.arr.concat(t.arr);return true}integrate(t,n){}delete(t){}gc(t){}write(t,n){const r=this.arr.length;t.writeLen(r-n);for(let i=n;i{const t=e.readLen();const n=[];for(let r=0;r{const t=e.readLen();const n=[];for(let r=0;r=55296&&r<=56319){this.str=this.str.slice(0,t-1)+"\uFFFD";n.str="\uFFFD"+n.str.slice(1)}return n}mergeWith(t){this.str+=t.str;return true}integrate(t,n){}delete(t){}gc(t){}write(t,n){t.writeString(n===0?this.str:this.str.slice(n))}getRef(){return 4}};var BKr=e=>new Yk(e.readString());var zKr=[xKr,vKr,EKr,SKr,CKr,AKr,kKr];var UKr=0;var VKr=1;var $Kr=2;var GKr=3;var HKr=4;var WKr=5;var YKr=6;var qk=class e{constructor(t){this.type=t}getLength(){return 1}getContent(){return[this.type]}isCountable(){return true}copy(){return new e(this.type._copy())}splice(t){throw dw()}mergeWith(t){return false}integrate(t,n){this.type._integrate(t.doc,n)}delete(t){let n=this.type._start;while(n!==null){if(!n.deleted){n.delete(t)}else if(n.id.clock<(t.beforeState.get(n.id.client)||0)){t._mergeStructs.push(n)}n=n.right}this.type._map.forEach(r=>{if(!r.deleted){r.delete(t)}else if(r.id.clock<(t.beforeState.get(r.id.client)||0)){t._mergeStructs.push(r)}});t.changed.delete(this.type)}gc(t){let n=this.type._start;while(n!==null){n.gc(t,true);n=n.right}this.type._start=null;this.type._map.forEach(r=>{while(r!==null){r.gc(t,true);r=r.left}});this.type._map=new Map}write(t,n){this.type._write(t)}getRef(){return 7}};var qKr=e=>new qk(zKr[e.readTypeRef()](e));var XKr=(e,t)=>{let n=t;let r=0;let i;do{if(r>0){n=El(n.client,n.clock+r)}i=Uve(e,n);r=n.clock-i.id.clock;n=i.redone}while(n!==null&&i instanceof Jd);return{item:i,diff:r}};var _He=(e,t)=>{while(e!==null&&e.keep!==t){e.keep=t;e=e.parent._item}};var Xve=(e,t,n)=>{const{client:r,clock:i}=t.id;const o=new Jd(El(r,i+n),t,El(r,i+n-1),t.right,t.rightOrigin,t.parent,t.parentSub,t.content.splice(n));if(t.deleted){o.markDeleted()}if(t.keep){o.keep=true}if(t.redone!==null){o.redone=El(t.redone.client,t.redone.clock+n)}t.right=o;if(o.right!==null){o.right.left=o}e._mergeStructs.push(o);if(o.parentSub!==null&&o.right===null){o.parent._map.set(o.parentSub,o)}t.length=n;return o};var MYt=(e,t)=>BWt(e,n=>wJ(n.deletions,t));var rqt=(e,t,n,r,i,o)=>{const a=e.doc;const s=a.store;const l=a.clientID;const u=t.redone;if(u!==null){return nx(e,u)}let d=t.parent._item;let f=null;let h;if(d!==null&&d.deleted===true){if(d.redone===null&&(!n.has(d)||rqt(e,d,n,r,i,o)===null)){return null}while(d.redone!==null){d=nx(e,d.redone)}}const m=d===null?t.parent:d.content.type;if(t.parentSub===null){f=t.left;h=t;while(f!==null){let _=f;while(_!==null&&_.parent._item!==d){_=_.redone===null?null:nx(e,_.redone)}if(_!==null&&_.parent._item===d){f=_;break}f=f.left}while(h!==null){let _=h;while(_!==null&&_.parent._item!==d){_=_.redone===null?null:nx(e,_.redone)}if(_!==null&&_.parent._item===d){h=_;break}h=h.right}}else{h=null;if(t.right&&!i){f=t;while(f!==null&&f.right!==null&&(f.right.redone||wJ(r,f.right.id)||MYt(o.undoStack,f.right.id)||MYt(o.redoStack,f.right.id))){f=f.right;while(f.redone)f=nx(e,f.redone)}if(f&&f.right!==null){return null}}else{f=m._map.get(t.parentSub)||null}}const g=Sp(s,l);const x=El(l,g);const w=new Jd(x,f,f&&f.lastId,h,h&&h.id,m,t.parentSub,t.content.copy());t.redone=x;_He(w,true);w.integrate(e,0);return w};var Jd=class e extends vJ{constructor(t,n,r,i,o,a,s,l){super(t,l.getLength());this.origin=r;this.left=n;this.right=i;this.rightOrigin=o;this.parent=a;this.parentSub=s;this.redone=null;this.content=l;this.info=this.content.isCountable()?AGe:0}set marker(t){if((this.info&Rve)>0!==t){this.info^=Rve}}get marker(){return(this.info&Rve)>0}get keep(){return(this.info&SGe)>0}set keep(t){if(this.keep!==t){this.info^=SGe}}get countable(){return(this.info&AGe)>0}get deleted(){return(this.info&kve)>0}set deleted(t){if(this.deleted!==t){this.info^=kve}}markDeleted(){this.info|=kve}getMissing(t,n){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=Sp(n,this.origin.client)){return this.origin.client}if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=Sp(n,this.rightOrigin.client)){return this.rightOrigin.client}if(this.parent&&this.parent.constructor===pM&&this.id.client!==this.parent.client&&this.parent.clock>=Sp(n,this.parent.client)){return this.parent.client}if(this.origin){this.left=wYt(t,n,this.origin);this.origin=this.left.lastId}if(this.rightOrigin){this.right=nx(t,this.rightOrigin);this.rightOrigin=this.right.id}if(this.left&&this.left.constructor===rx||this.right&&this.right.constructor===rx){this.parent=null}else if(!this.parent){if(this.left&&this.left.constructor===e){this.parent=this.left.parent;this.parentSub=this.left.parentSub}else if(this.right&&this.right.constructor===e){this.parent=this.right.parent;this.parentSub=this.right.parentSub}}else if(this.parent.constructor===pM){const r=Uve(n,this.parent);if(r.constructor===rx){this.parent=null}else{this.parent=r.content.type}}return null}integrate(t,n){if(n>0){this.id.clock+=n;this.left=wYt(t,t.doc.store,El(this.id.client,this.id.clock-1));this.origin=this.left.lastId;this.content=this.content.splice(n);this.length-=n}if(this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let r=this.left;let i;if(r!==null){i=r.right}else if(this.parentSub!==null){i=this.parent._map.get(this.parentSub)||null;while(i!==null&&i.left!==null){i=i.left}}else{i=this.parent._start}const o=new Set;const a=new Set;while(i!==null&&i!==this.right){a.add(i);o.add(i);if(Ove(this.origin,i.origin)){if(i.id.client{if(r.p===t){r.p=this;if(!this.deleted&&this.countable){r.index-=this.length}}})}if(t.keep){this.keep=true}this.right=t.right;if(this.right!==null){this.right.left=this}this.length+=t.length;return true}return false}delete(t){if(!this.deleted){const n=this.parent;if(this.countable&&this.parentSub===null){n._length-=this.length}this.markDeleted();hJ(t.deleteSet,this.id.client,this.id.clock,this.length);CYt(t,n,this.parentSub);this.content.delete(t)}}gc(t,n){if(!this.deleted){throw fw()}this.content.gc(t);if(n){iKr(t,this,new rx(this.id,this.length))}else{this.content=new qve(this.length)}}write(t,n){const r=n>0?El(this.id.client,this.id.clock+n-1):this.origin;const i=this.rightOrigin;const o=this.parentSub;const a=this.content.getRef()&JZ|(r===null?0:Dy)|(i===null?0:h_)|(o===null?0:LU);t.writeInfo(a);if(r!==null){t.writeLeftID(r)}if(i!==null){t.writeRightID(i)}if(r===null&&i===null){const s=this.parent;if(s._item!==void 0){const l=s._item;if(l===null){const u=tKr(s);t.writeParentInfo(true);t.writeString(u)}else{t.writeParentInfo(false);t.writeLeftID(l.id)}}else if(s.constructor===String){t.writeParentInfo(true);t.writeString(s)}else if(s.constructor===pM){t.writeParentInfo(false);t.writeLeftID(s)}else{fw()}if(o!==null){t.writeString(o)}}this.content.write(t,n)}};var iqt=(e,t)=>jKr[t&JZ](e);var jKr=[()=>{fw()},IKr,FKr,PKr,BKr,LKr,DKr,qKr,OKr,MKr,()=>{fw()}];var KKr=10;var ix=class extends vJ{get deleted(){return true}delete(){}mergeWith(t){if(this.constructor!==t.constructor){return false}this.length+=t.length;return true}integrate(t,n){fw()}write(t,n){t.writeInfo(KKr);tc(t.restEncoder,this.length-n)}getMissing(t,n){return null}};var oqt=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:{};var aqt="__ $YJS$ __";if(oqt[aqt]===true){console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438")}oqt[aqt]=true;var ZU=class{#e;#t;#n;#r;constructor(t,n=[]){this.#e=t;this.#t=[];this.#n=new Map;const r=this.#e.getSlideCollabState?.();if(r){this.#r=this.#u(r)}n.forEach(i=>{this.add({proto:i})})}get items(){return[...this.#t]}getItem(t){if(typeof t==="number"){return this.getItemAt(t)}if(typeof t==="string"){const n=this.getById(t);if(n){return n}return this.#t.find(r=>r.name===t)}return this.getById(t?.id??"")}getItemAt(t){if(!Number.isFinite(t)){return void 0}const n=Math.trunc(t);if(n<0||n>=this.#t.length){return void 0}return this.#t[n]}getById(t){const n=this.#a(t);if(!n){return void 0}return this.#n.get(n)}add(t){const n=new $u(this.#i(),t);const r=!("proto"in t)&&t.geometry==="connector";const i=this.#o(n);const o="proto"in t?t.proto.bbox:i.position.toProto();this.#m(i,o);if(!("proto"in t)){const a=this.#e.getPresentation?.()?.getRecorder?.();const s=this.#e.getSlide?.();if(a&&s){const l=Rd("sh",s.id,n.id);const u=a.assignAlias(n,l,"shape");a.record({op:"shape.add",slide:a.targetRefForElement(s,`sl/${s.id}`),as:u,props:QKr(t,s,a)})}}if(r){i.sendToBack()}return i}connect(t,n,r={}){const i=this.#h(t,"from");const o=this.#h(n,"to");const a=r.kind??"elbow";const s=this.#y(r)?this.#x(i,o,a):null;const[l,u]=this.#g(i,o);const d=this.#T(s?.fromIdx??r.fromIdx,r.fromSide,l,i,"from");const f=this.#T(s?.toIdx??r.toIdx,r.toSide,u,o,"to");const h={...r};delete h.fromIdx;delete h.toIdx;delete h.fromSide;delete h.toSide;delete h.kind;return this.add({...h,geometry:"connector",from:i,to:o,fromIdx:d,toIdx:f,kind:a})}getConnectionSiteIndex(t,n){const r=t instanceof $u?t:this.getById(t);if(!r){throw new Error(`Connector shape not found for id: ${t}`)}return this.#k(r,n)}addPlaceholder(t){const n={id:cw(),name:t,placeholderIndex:this.#c(),paragraphs:[],type:1,effects:[],children:[],levelsStyles:[],citations:[]};const r=new $u(this.#i(),{proto:n});r.placeholderIndex=n.placeholderIndex;r.text="";const i=this.#o(r);this.#m(i,n.bbox);return i}deleteById(t){const n=this.#n.get(t);if(!n){return}const r=this.#t.indexOf(n);if(r!==-1){this.#t.splice(r,1)}this.#n.delete(t);this.#r?.delete(t);this.#e._unregister(t)}deleteAll(){const t=this.#t;this.#t=[];this.#n.clear();t.forEach(n=>{if(!n.id){return}this.#r?.delete(n.id);this.#e._unregister(n.id)})}toProto(){return this.items.map(t=>t.toProto())}setPlaceholdersFromProtos(t){const n=t.map(r=>new $u(this.#i(),{proto:r}));this.#t.slice().forEach(r=>{if(r.isPlaceholder()){this.#l(r)}});n.forEach(r=>{const i=this.#o(r);this.#m(i,r.position.toProto())})}hydrateCollaborativeRefsFromProto(){const t=this.#e.getSlideCollabState?.();if(!t){return}this.#r=this.#u(t);for(const n of this.#t){this.#m(n,n.position.toProto())}}#i(){return this.#e}#a(t){const n=t.trim();if(!n){return""}const r=this.#e.getSlide?.()?.id;const i=dqt(n,r,this.#n.keys());if(!i){return""}return i}#o(t){return this.#s(t,{register:true})}#s(t,n={}){this.#t.push(t);const r=t.id;if(r){this.#n.set(r,t);if(n.register!==false){this.#e._register(t,{index:n.index})}}return t}#l(t){const n=this.#t.indexOf(t);if(n!==-1){this.#t.splice(n,1)}const r=t.id;if(r){const i=this.#n.get(r);if(i===t){this.#n.delete(r);this.#e._unregister(r)}}}#c(){const t=this.#t.map(n=>n.placeholderIndex).filter(n=>n!==void 0);if(t.length===0){return 0}return Math.max(...t)+1}#u(t){const n=t.get("shapes");if(n instanceof Ns){return n}const r=new Ns;t.set("shapes",r);return r}#f(t){if(!this.#r){return void 0}const n=this.#r.get(t);if(n instanceof Ns){return n}const r=new Ns;this.#r.set(t,r);return r}#d(t,n){const r=this.#f(t);if(!r){return void 0}const i=r.get("bbox");const o=i instanceof Ns?i:new Ns;if(!(i instanceof Ns)){r.set("bbox",o)}if(n&&o.size===0){this.#p(o,n)}return o}#p(t,n){if(!n){return}if(n.xEmu!==void 0)t.set("xEmu",n.xEmu);if(n.yEmu!==void 0)t.set("yEmu",n.yEmu);if(n.widthEmu!==void 0)t.set("widthEmu",n.widthEmu);if(n.heightEmu!==void 0)t.set("heightEmu",n.heightEmu);if(n.rotation!==void 0)t.set("rotation",n.rotation);if(n.horizontalFlip!==void 0){t.set("horizontalFlip",n.horizontalFlip)}if(n.verticalFlip!==void 0){t.set("verticalFlip",n.verticalFlip)}}#m(t,n){const r=this.#d(t.id,n);if(!r){return}t.position.bindToBboxStruct(r,n)}#h(t,n){if(t instanceof $u){return t}const r=this.getById(t);if(!r){throw new Error(`Connector ${n} shape not found for id: ${t}`)}return r}#g(t,n){const r=this.#b(t,"from");const i=this.#b(n,"to");const o=i.x-r.x;const a=i.y-r.y;if(Math.abs(o)>=Math.abs(a)){return o>=0?["right","left"]:["left","right"]}return a>=0?["bottom","top"]:["top","bottom"]}#y(t){return t.fromIdx===void 0&&t.toIdx===void 0&&t.fromSide===void 0&&t.toSide===void 0}#x(t,n,r){const i=this.#v(t);const o=this.#v(n);if(i.length===0||o.length===0){return null}let a;for(const s of i){for(const l of o){const u=this.#S(s,l,r);if(!a||u0?s:4;const u=[];for(let d=0;d0?u:this.#_(t)}#_(t){const n=[0,1,2,3].map(r=>this.#E(t,r)).filter(r=>r!==null);return n}#E(t,n){const r=t.frame;if(!r||r.left===void 0||r.top===void 0||r.width===void 0||r.height===void 0){return null}const i=r.left+r.width/2;const o=r.top+r.height/2;switch(n){case 0:return{index:n,point:{x:i,y:r.top},normal:{x:0,y:-1}};case 1:return{index:n,point:{x:r.left,y:o},normal:{x:-1,y:0}};case 2:return{index:n,point:{x:i,y:r.top+r.height},normal:{x:0,y:1}};case 3:return{index:n,point:{x:r.left+r.width,y:o},normal:{x:1,y:0}};default:return null}}#S(t,n,r){const i=n.point.x-t.point.x;const o=n.point.y-t.point.y;const a=Math.hypot(i,o);const s=Math.abs(i)+Math.abs(o);const l=r==="straight"?a:s;const u=sqt({x:i,y:o},t.normal);const d=sqt({x:-i,y:-o},n.normal);let f=l;f+=this.#C(t,n,r)*96;if(u<0){f+=220+Math.abs(u)*2}if(d<0){f+=220+Math.abs(d)*2}return f}#C(t,n,r){if(r==="straight"){return 0}const i=THe(t.normal);const o=ZKr(THe(n.normal));const a=lqt(i);const s=lqt(o);if(a==="none"||s==="none"){return 2}let l=0;if(a!==s){l=1}else if(i===o){l=JKr(t.point,n.point,a)?0:1}else{l=2}if(!cqt(t.point,n.point,i)){l+=2}if(!cqt(n.point,t.point,THe(n.normal))){l+=2}return l}#b(t,n){const r=t.frame;const i=r?.left;const o=r?.top;const a=r?.width;const s=r?.height;if(i===void 0||o===void 0||a===void 0||s===void 0){throw new Error(`Connector ${n} shape is missing frame data.`)}return{x:i+a/2,y:o+s/2}}#T(t,n,r,i,o){if(t!==void 0){return t}const a=n??r;const s=this.#k(i,a);if(Number.isFinite(s)){return s}const l=a5[a];if(!Number.isFinite(l)){throw new Error(`Failed to resolve connector ${o} index.`)}return l}#k(t,n){if(t.connector){return a5[n]}const r=t.frame;const i=r?.width;const o=r?.height;if(i===void 0||o===void 0||i<=0||o<=0){return a5[n]}const a=t.toProto();const s=a.shape?.geometry;if(s===void 0||s===-1){return a5[n]}const l=$b(s);if(!l){return a5[n]}const u=l.cxnLst??[];if(u.length===0){return a5[n]}const d={};for(const _ of a.shape?.adjustmentList??[]){if(_.name&&_.formula){d[_.name]=_.formula}}const f=ak(l,i,o,d);let h;let m=Number.POSITIVE_INFINITY;let g=Number.POSITIVE_INFINITY;const x=i/2;const w=o/2;for(const[_,C]of u.entries()){const A=R0(C.pos?.x,f);const P=R0(C.pos?.y,f);if(!Number.isFinite(A)||!Number.isFinite(P)){continue}let L;let I;switch(n){case"left":L=A;I=Math.abs(P-w);break;case"right":L=Math.abs(A-i);I=Math.abs(P-w);break;case"top":L=P;I=Math.abs(A-x);break;case"bottom":L=Math.abs(P-o);I=Math.abs(A-x);break}if(L=n){return e.x>=0?"right":"left"}return e.y>=0?"down":"up"}function ZKr(e){switch(e){case"up":return"down";case"down":return"up";case"left":return"right";case"right":return"left";default:return"none"}}function lqt(e){if(e==="left"||e==="right"){return"horizontal"}if(e==="up"||e==="down"){return"vertical"}return"none"}function JKr(e,t,n){if(n==="horizontal"){return Math.abs(e.y-t.y)<1e-6}return Math.abs(e.x-t.x)<1e-6}function cqt(e,t,n){switch(n){case"left":return t.x<=e.x;case"right":return t.x>=e.x;case"up":return t.y<=e.y;case"down":return t.y>=e.y;default:return false}}function QKr(e,t,n){if("proto"in e){throw new Error("Cannot build shape props from proto config.")}if(e.geometry==="custom"){return{geometry:"custom",position:e.position,fill:e.fill,line:e.line,adjustmentList:e.adjustmentList,borderRadius:e.borderRadius,shadow:e.shadow,className:e.className,name:e.name,customPaths:e.customPaths}}if(e.geometry==="connector"){return{geometry:"connector",position:e.position,fill:e.fill,line:e.line,adjustmentList:e.adjustmentList,className:e.className,name:e.name,from:uqt(e.from,t,n),to:uqt(e.to,t,n),fromIdx:e.fromIdx,toIdx:e.toIdx,kind:e.kind,head:e.head,tail:e.tail,cap:e.cap,join:e.join}}return{geometry:e.geometry,position:e.position,fill:e.fill,line:e.line,adjustmentList:e.adjustmentList,borderRadius:e.borderRadius,shadow:e.shadow,className:e.className,name:e.name}}function uqt(e,t,n){if(typeof e==="string"){const i=dqt(e,t.id,t.shapes.items.map(o=>o.id));if(!i){throw new Error("Connector target id must be non-empty.")}return Rd("sh",t.id,i)}const r=Rd("sh",t.id,e.id);if(!n){return r}return n.targetRefForElement(e,r)}function dqt(e,t,n){return fge(e,{prefix:"sh",aliases:["shape"],slideId:t,localIds:n})}IU();function hw(e){if(!e){return void 0}const t=new eo;if(e.width!==void 0){t.width=e.width}if(e.style!==void 0){t.style=e.style}if(e.compound!==void 0){t.compound=e.compound}if(e.fill!==void 0){t.fill=e.fill}if(e.color!==void 0){t.fill.color=e.color}return t.toProto()?t:void 0}var e_e={left:.1*96,right:.1*96,top:.05*96,bottom:.05*96};var JU=class{#e;#t;#n;#r;#i;#a;#o;#s;#l;#c;#u;#f;#d;#p;#m;#h;#g;#y;#x;#v;#_;constructor(t,n){n.fontFamilyCache?.addTextStyle(t?.textStyle);n.fontFamilyCache?.addLevelStyles(t?.levelsStyles);n.fontFamilyCache?.addElements(t?.elements);this.#e=t?.id??cw();this.#t=new Hv(n,t?.paragraphs??[]);this.#r=t?.textStyle?new ko(t.textStyle):void 0;this.#n=new Yv(this.#t,{getDefaultTextStyle:()=>this.#r,setDefaultTextStyle:r=>{this.#r=r??void 0},getVerticalAlignment:()=>eZr(this.#y),setVerticalAlignment:r=>{this.#y=wHe(r)},resolveTextStyle:r=>n.getTextStyleByName(r)});this.#i=t?.levelsStyles??[];this.#a=new gi({type:"proto",proto:t?.fill});this.#o={top:new eo({type:"proto",proto:t?.lines?.top}),right:new eo({type:"proto",proto:t?.lines?.right}),bottom:new eo({type:"proto",proto:t?.lines?.bottom}),left:new eo({type:"proto",proto:t?.lines?.left}),diagonalDown:new eo({type:"proto",proto:t?.lines?.diagonalDown}),diagonalUp:new eo({type:"proto",proto:t?.lines?.diagonalUp})};this.#s=t?.gridSpan;this.#l=t?.rowSpan;this.#c=t?.horizontalMerge;this.#u=t?.verticalMerge;this.#f=t?.textDirection;this.#d=t?.marginLeft!==void 0?Bo(t.marginLeft):void 0;this.#p=t?.marginRight!==void 0?Bo(t.marginRight):void 0;this.#m=t?.marginTop!==void 0?Bo(t.marginTop):void 0;this.#h=t?.marginBottom!==void 0?Bo(t.marginBottom):void 0;this.#g=n.getPresentation!==void 0;this.#y=wHe(t?.anchor);this.#x=t?.anchorCenter;this.#v=t?.horizontalOverflow;this.#_=structuredClone(t?.elements??[])}get id(){return this.#e}get paragraphs(){return this.#t}get text(){return this.#n}get value(){return this.#n.toString()}set value(t){if(t===void 0||t===null){this.#n.set("");return}this.#n.set(this.#E(t))}get levelsStyles(){return this.#i}get textStyle(){if(!this.#r){this.#r=new ko}return this.#r}set textStyle(t){this.#r=t}get fill(){return this.#a}set fill(t){if(t instanceof gi){const n=t.toProto();this.#a=n?new gi({type:"proto",proto:n}):new gi;return}this.#a=new gi(t)}get lines(){return this.#o}set lines(t){if(t.top){this.#o.top=new eo(t.top)}if(t.right){this.#o.right=new eo(t.right)}if(t.bottom){this.#o.bottom=new eo(t.bottom)}if(t.left){this.#o.left=new eo(t.left)}if(t.diagonalDown){this.#o.diagonalDown=new eo(t.diagonalDown)}if(t.diagonalUp){this.#o.diagonalUp=new eo(t.diagonalUp)}}get borders(){return this.#o}set borders(t){this.#k(t)}get gridSpan(){return this.#s}set gridSpan(t){this.#s=t}get rowSpan(){return this.#l}set rowSpan(t){this.#l=t}get horizontalMerge(){return this.#c}set horizontalMerge(t){this.#c=t}get verticalMerge(){return this.#u}set verticalMerge(t){this.#u=t}get textDirection(){return this.#f}set textDirection(t){this.#f=t}get margins(){if(this.#d===void 0&&this.#p===void 0&&this.#m===void 0&&this.#h===void 0){return void 0}return{left:this.#d,right:this.#p,top:this.#m,bottom:this.#h}}set margins(t){this.#d=t?.left;this.#p=t?.right;this.#m=t?.top;this.#h=t?.bottom}get anchor(){return this.#y}set anchor(t){this.#y=wHe(t)}get anchorCenter(){return this.#x}set anchorCenter(t){this.#x=t}get horizontalOverflow(){return this.#v}set horizontalOverflow(t){this.#v=t}get elements(){return structuredClone(this.#_)}set elements(t){this.#_=structuredClone(t)}#E(t){if(t instanceof Yv){return t}if(typeof t==="number"){return String(t)}if(Array.isArray(t)){const n=t.every(r=>typeof r==="string");if(n){return t}return t}return t}toProto(){const t=this.#t.toProto();return{id:this.#e,paragraphs:t,levelsStyles:this.#i,fill:this.#a.toProto(),text:this.value,textStyle:this.#r?.toProto(),lines:{left:this.#o.left?.toProto(),right:this.#o.right?.toProto(),top:this.#o.top?.toProto(),bottom:this.#o.bottom?.toProto(),diagonalDown:this.#o.diagonalDown?.toProto(),diagonalUp:this.#o.diagonalUp?.toProto()},gridSpan:this.#s,rowSpan:this.#l,horizontalMerge:this.#c,verticalMerge:this.#u,textDirection:this.#f,marginLeft:this.#S(this.#d,e_e.left),marginRight:this.#S(this.#p,e_e.right),marginTop:this.#S(this.#m,e_e.top),marginBottom:this.#S(this.#h,e_e.bottom),anchor:this.#y,anchorCenter:this.#x,horizontalOverflow:this.#v,elements:this.#C(t)}}#S(t,n){if(t!==void 0){return Qi(t)}return this.#g?Qi(n):void 0}#C(t){const n=this.#b(t);if(this.#_.length===0){return n?[n]:[]}const r=[];let i=false;for(const o of this.#_){if(this.#T(o)){if(n){if(!i){r.push(n);i=true}continue}r.push(structuredClone(o));continue}r.push(structuredClone(o))}if(!i&&n){r.unshift(n)}return r}#b(t){if(t.length===0){return void 0}return{id:`${this.#e}-text`,type:1,paragraphs:t,textStyle:this.#r?.toProto(),effects:[],children:[],levelsStyles:[],citations:[]}}#T(t){return t.type===1||t.type===2}#k(t){if(t.top){const n=hw(t.top);if(n){this.#o.top=n}}if(t.right){const n=hw(t.right);if(n){this.#o.right=n}}if(t.bottom){const n=hw(t.bottom);if(n){this.#o.bottom=n}}if(t.left){const n=hw(t.left);if(n){this.#o.left=n}}if(t.diagonalDown){const n=hw(t.diagonalDown);if(n){this.#o.diagonalDown=n}}if(t.diagonalUp){const n=hw(t.diagonalUp);if(n){this.#o.diagonalUp=n}}}};function wHe(e){switch(e){case void 0:return void 0;case"t":case"top":return"t";case"ctr":case"middle":case"center":return"ctr";case"b":case"bottom":return"b";default:throw new Error(`Unsupported table cell anchor: ${e}. Use "top", "middle", "bottom", "t", "ctr", or "b".`)}}function eZr(e){switch(e){case"t":return"top";case"ctr":return"middle";case"b":return"bottom";case void 0:return void 0}}IU();var CJ=class{#e;#t;#n;#r;constructor(t,n){this.#r=n;this.#e=t?.cells?.map(r=>new JU(r,n))??[];this.#t=t?.id??cw();this.#n=t?.heightEmu?t.heightEmu*ti:0}get cells(){return this.#e}getCell(t){if(t<0||t>=this.#e.length){return void 0}return this.#e[t]}get id(){return this.#t}get height(){return this.#n}set height(t){if(!Number.isFinite(t)||t<0){throw new Error("Row height must be a non-negative number.")}this.#n=t}get margins(){return this.#e[0]?.margins}set margins(t){for(const n of this.#e){n.margins=t}}ensureCellCount(t){if(t<=0){this.#e=[];return}while(this.#e.lengtht){this.#e.splice(t)}}toProto(){return{id:this.#t,heightEmu:Qi(this.#n),cells:this.#e.map(t=>t.toProto())}}};var QU=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(t,n){if(n.row<0||n.column<0){throw new Error("Table range indices must be non-negative.")}if(n.rowCount<=0||n.columnCount<=0){throw new Error("Table range dimensions must be positive.")}if(n.row+n.rowCount>t.rowCount){throw new Error("Table range rows exceed table bounds.")}if(n.column+n.columnCount>t.columnCount){throw new Error("Table range columns exceed table bounds.")}this.#e=t;this.#t=n.row;this.#n=n.column;this.#r=n.rowCount;this.#i=n.columnCount}get rowCount(){return this.#r}get columnCount(){return this.#i}get fill(){if(!this.#s){this.#s=new EHe(this)}return this.#s}set fill(t){this.applyFill(t)}get textStyle(){if(!this.#a){this.#a=new CHe(this)}return this.#a}get borders(){if(!this.#o){this.#o=new SHe(this)}return this.#o}set borders(t){this.applyBorders(t)}assign(t){if("fill"in t){this.applyFill(t.fill)}if("textStyle"in t&&t.textStyle!==void 0){this.applyTextStyle(t.textStyle)}if("borders"in t&&t.borders!==void 0){this.applyBorders(t.borders)}this.#c(n=>{if("margins"in t){n.margins=t.margins}if("anchor"in t){n.anchor=t.anchor}if("anchorCenter"in t){n.anchorCenter=t.anchorCenter}if("horizontalOverflow"in t){n.horizontalOverflow=t.horizontalOverflow}})}applyFill(t){this.#c(n=>{if(t instanceof gi){const r=t.toProto();n.fill=r?new gi({type:"proto",proto:r}):new gi;return}n.fill=t})}applyTextStyle(t){this.#c(n=>{Uf(n.textStyle,t);if("alignment"in t){tZr(n,t.alignment)}})}applyBorders(t){const n={};if(t.outside){n.top??=t.outside;n.bottom??=t.outside;n.left??=t.outside;n.right??=t.outside}if(t.inside){n.insideHorizontal??=t.inside;n.insideVertical??=t.inside}if(t.top)n.top=t.top;if(t.bottom)n.bottom=t.bottom;if(t.left)n.left=t.left;if(t.right)n.right=t.right;if(t.insideHorizontal)n.insideHorizontal=t.insideHorizontal;if(t.insideVertical)n.insideVertical=t.insideVertical;if(t.diagonalDown)n.diagonalDown=t.diagonalDown;if(t.diagonalUp)n.diagonalUp=t.diagonalUp;this.#c((r,i,o)=>{if(n.top&&i===0){this.#l(r,"top",n.top)}if(n.bottom&&i===this.#r-1){this.#l(r,"bottom",n.bottom)}if(n.left&&o===0){this.#l(r,"left",n.left)}if(n.right&&o===this.#i-1){this.#l(r,"right",n.right)}if(n.insideHorizontal&&it.bold)}set bold(t){this.#t(n=>{n.bold=t})}get italic(){return this.#n(t=>t.italic)}set italic(t){this.#t(n=>{n.italic=t})}get fontSize(){return this.#n(t=>t.fontSize)}set fontSize(t){this.#t(n=>{n.fontSize=t})}get underline(){return this.#n(t=>t.underline)}set underline(t){this.#t(n=>{n.underline=t})}get color(){return this.#n(t=>t.color,nZr)}set color(t){this.#t(n=>{n.color=t})}get alignment(){return this.#n(t=>t.alignment)}set alignment(t){this.#e.applyTextStyle({alignment:t})}#t(t){this.#e.forEachCell(n=>{t(n.textStyle)})}#n(t,n=Object.is){let r=false;let i;let o=false;this.#e.forEachCell(a=>{if(o){return}const s=t(a.textStyle);if(!r){r=true;i=s;return}if(!n(i,s)){i=void 0;o=true}});return o?void 0:i}};var SHe=class{#e;constructor(t){this.#e=t}assign(t){this.#e.applyBorders(t)}set top(t){if(!t){return}this.#e.applyBorders({top:t})}set bottom(t){if(!t){return}this.#e.applyBorders({bottom:t})}set left(t){if(!t){return}this.#e.applyBorders({left:t})}set right(t){if(!t){return}this.#e.applyBorders({right:t})}set inside(t){if(!t){return}this.#e.applyBorders({inside:t})}set outside(t){if(!t){return}this.#e.applyBorders({outside:t})}set insideHorizontal(t){if(!t){return}this.#e.applyBorders({insideHorizontal:t})}set insideVertical(t){if(!t){return}this.#e.applyBorders({insideVertical:t})}set diagonalDown(t){if(!t){return}this.#e.applyBorders({diagonalDown:t})}set diagonalUp(t){if(!t){return}this.#e.applyBorders({diagonalUp:t})}};function nZr(e,t){if(!e&&!t){return true}if(!e||!t){return false}const n=e.toProto();const r=t.toProto();if(!n&&!r){return true}if(!n||!r){return false}return JSON.stringify(n)===JSON.stringify(r)}var t_e=class{#e;#t;constructor(t,n){this.#e=t;this.#t=n}get width(){const t=this.#e.columnWidths;if(t.length>0){return t[this.#t]??0}const n=this.#e.columnCount;const r=this.#e.frame?.width;if(r&&n>0){return r/n}return 0}set width(t){if(!Number.isFinite(t)||t<=0){throw new Error("Column width must be a positive number.")}const n=this.#e.columnCount;const r=this.#e.columnWidths;let i=[];if(r.length>0){i=r.slice(0,n)}else{const o=this.#e.frame?.width;const a=o&&n>0?o/n:1;i=new Array(n).fill(a)}while(i.length=this.#e.columnCount){throw new Error("Column index is outside the table bounds.")}return new t_e(this.#e,t)}get items(){const t=[];for(let n=0;n({mode:"fr",value:AHe(e,"compose.fr(value)")});var yM=(e,t)=>{if(!Number.isInteger(e)||e<=0){throw new Error("compose.repeat(count, value) count must be a positive integer.")}return Array.from({length:e},()=>t)};var kHe=(e,t="compose.track")=>{if(e==="auto"){return e}if(e.mode==="fr"){return{mode:"fr",value:AHe(e.value,`${t}.fr.value`)}}if(e.mode==="fixed"){return{mode:"fixed",value:AHe(e.value,`${t}.fixed.value`)}}throw new Error(`${t} must be auto, fr(...), or fixed(...).`)};var RHe=(e,t="compose.tracks")=>{if(!Array.isArray(e)||e.length===0){throw new Error(`${t} must include at least one track.`)}return e.map((n,r)=>kHe(n,`${t}[${r}]`))};var AHe=(e,t)=>{if(!Number.isFinite(e)||e<=0){throw new Error(`${t} must be a positive number.`)}return e};var PHe=class{#e;constructor(t){this.#e=t}get(t,n){return this.#e.getCell(t,n)}set(t,n,r){this.#e.setCellValue(t,n,r)}block(t){return new QU(this.#e,t)}};var N0=class extends bm{type="table";#e;#t;#n;#r;#i;#a;#o;#s;#l;#c;#u;#f;#d;#p;#m;#h;#g;#y;#x;#v;#_;#E;constructor(t,n){const r=n?.table;super(t,n??{});const i=r?.columnWidths??[];const o=i.map(l=>Number.isFinite(l)&&l>0?Bo(l):0);this.#t=o.some(l=>l>0);this.#e=this.#t?o:[];const a=r?.rows??[];this.#r=a.map(l=>new CJ(l,t));this.#i=a.some(l=>l.heightEmu===void 0||l.heightEmu<=0);const s=r?.properties;this.#l=s?.styleId;this.#c=s?.styleId;this.#u=new gi({type:"proto",proto:s?.fill});this.#f=s?.rightToLeft;this.#h=s?.firstRow;this.#g=s?.lastRow;this.#y=s?.firstColumn;this.#x=s?.lastColumn;this.#v=s?.bandedRows;this.#_=s?.bandedColumns;this.#E=s?.keepTogether;this.#d=s?.effects?.map(l=>({...l}))??[];this.#p=s?.styleXml;this.#m=sZr(s?.cellMargins);this.data.type=9}get id(){return this.data.id}toSnapshot(){const t=this.slideId;const n=this.id;return{aid:fZr("tb",t,n),kind:"table",id:n,slideId:t,name:this.name,rows:this.rowCount,cols:this.columnCount,preview:hZr(this.#r),frame:this.frame}}get cells(){if(!this.#a){this.#a=new PHe(this)}return this.#a}get columns(){if(!this.#o){this.#o=new n_e(this)}return this.#o}get borders(){if(!this.#s){this.#s=new r_e(this)}return this.#s}set borders(t){this.borders.assign(t)}get rows(){return[...this.#r]}get rowCount(){return this.#r.length}get columnCount(){if(this.#n&&this.#n.length>0){return this.#n.length}if(this.#e.length>0){return this.#e.length}return this.#r.reduce((t,n)=>Math.max(t,n.cells.length),0)}get columnWidths(){if(this.#n){return this.#C()}return[...this.#e]}get hasExplicitColumnWidths(){return this.#t}set columnWidths(t){this.#n=void 0;if(!Array.isArray(t)||t.length===0){this.#e=[];this.#t=false;return}this.#e=t.map(n=>Number.isFinite(n)&&n>0?n:1);this.#t=true}get columnTracks(){return this.#n?this.#n.map(uZr):void 0}set columnTracks(t){if(!t||t.length===0){this.#n=void 0;return}const n=cZr(t,"table.columnTracks");const r=this.#r.reduce((i,o)=>Math.max(i,o.cells.length),0);if(r>0&&n.length!==r){throw new Error(`Expected ${r} column tracks, received ${n.length}.`)}this.#n=n;this.#e=[];this.#t=false}get style(){return this.#l}set style(t){const n=t?.trim();this.#l=n&&n.length>0?n:void 0;this.#c=this.#l}get styleId(){return this.#c}set styleId(t){const n=t?.trim();this.#c=n&&n.length>0?n:void 0;this.#l=this.#c}get styleOptions(){return{headerRow:this.#h,totalRow:this.#g,firstColumn:this.#y,lastColumn:this.#x,bandedRows:this.#v,bandedColumns:this.#_}}set styleOptions(t){if(!t){this.#h=void 0;this.#g=void 0;this.#y=void 0;this.#x=void 0;this.#v=void 0;this.#_=void 0;return}if(t.headerRow!==void 0){this.#h=t.headerRow}if(t.totalRow!==void 0){this.#g=t.totalRow}if(t.firstColumn!==void 0){this.#y=t.firstColumn}if(t.lastColumn!==void 0){this.#x=t.lastColumn}if(t.bandedRows!==void 0){this.#v=t.bandedRows}if(t.bandedColumns!==void 0){this.#_=t.bandedColumns}}get fill(){return this.#u}set fill(t){if(t instanceof gi){const n=t.toProto();this.#u=n?new gi({type:"proto",proto:n}):new gi;return}this.#u=new gi(t)}get rightToLeft(){return this.#f}set rightToLeft(t){this.#f=t}get cellMargins(){return this.#m?{...this.#m}:void 0}set cellMargins(t){this.#m=t?{...t}:void 0}get keepTogether(){return this.#E}set keepTogether(t){this.#E=t}setColumnWidths(t){if(t.length!==this.columnCount){throw new Error(`Expected ${this.columnCount} column widths, received ${t.length}.`)}this.columnWidths=t}setColumnTracks(t){if(t.length!==this.columnCount){throw new Error(`Expected ${this.columnCount} column tracks, received ${t.length}.`)}this.columnTracks=t}setValues(t){const n=t.length;const r=t.reduce((i,o)=>Math.max(i,o.length),0);this.#k(n,r);t.forEach((i,o)=>{i.forEach((a,s)=>{const l=this.#r[o]?.getCell(s);if(!l){return}l.value=a})})}setCellValue(t,n,r){const i=this.getCell(t,n);i.value=r}getCell(t,n){if(t<0||n<0){throw new Error("Table addresses must be non-negative.")}const r=this.#r[t];if(!r){throw new Error(`Row ${t} is outside the current table bounds.`)}const i=r.getCell(n);if(!i){throw new Error(`Column ${n} is outside the current table bounds.`)}return i}getCellById(t){if(!t){return void 0}for(const n of this.#r){const r=n.cells.find(i=>i.id===t);if(r){return r}}return void 0}merge(t){const{startRow:n,endRow:r,startColumn:i,endColumn:o}=t;if(n<0||i<0||ra||r>a||i>s||o>s){throw new Error("Merge range exceeds current table bounds.")}const l=r-n+1;const u=o-i+1;for(let d=n;d<=r;d+=1){for(let f=i;f<=o;f+=1){const h=this.#r[d]?.getCell(f);if(!h){continue}const m=d===n;const g=f===i;if(m&&g){h.gridSpan=u>1?u:void 0;h.rowSpan=l>1?l:void 0;h.horizontalMerge=void 0;h.verticalMerge=void 0}else{h.gridSpan=void 0;h.rowSpan=void 0;h.horizontalMerge=u>1?!g:void 0;h.verticalMerge=l>1?!m:void 0}}}}toProto(){const t=super.toProto();t.type=this.data.type;const n=this.#C();const r=this.#T();const i=this.#S();t.table={columnWidths:n.map(o=>Qi(o)),rows:this.#r.map((o,a)=>{const s=o.toProto();if(r){s.heightEmu=Qi(r[a]??0)}return s}),properties:i};return t}#S(){const t=this.#u?.toProto();const n=this.context.getPresentation?oZr(this.#l):this.#c;const r=this.#h!==void 0||this.#g!==void 0||this.#y!==void 0||this.#x!==void 0||this.#v!==void 0||this.#_!==void 0||this.#E!==void 0;const i=this.#d.length>0;const o=this.#p!==void 0;const a=this.#f!==void 0;const s=lZr(this.#m);if(!t&&!n&&!r&&!i&&!o&&!a&&!s){return void 0}return{fill:t,rightToLeft:this.#f,firstRow:this.#h,lastRow:this.#g,firstColumn:this.#y,lastColumn:this.#x,bandedRows:this.#v,bandedColumns:this.#_,styleId:n,effects:this.#d??[],styleXml:this.#p,cellMargins:s,keepTogether:this.#E}}#C(){const t=this.columnCount;if(t<=0){return[]}if(this.#n){const r=this.#b();if(r&&Number.isFinite(r)&&r>0){return dZr(this.#n,r)}return this.#n.map(i=>i.mode==="fixed"?i.value:1)}if(this.#t){const r=this.#e.map(o=>Number.isFinite(o)&&o>0?o:1);if(r.length>=t){return r.slice(0,t)}const i=r[r.length-1]??1;return r.concat(new Array(t-r.length).fill(i))}const n=this.#b();if(n&&Number.isFinite(n)&&n>0){const r=n/t;return new Array(t).fill(r)}return new Array(t).fill(1)}#b(){const t=this.position.toProto();return this.frame?.width??(t?.widthEmu!==void 0?Bo(t.widthEmu):void 0)}#T(){const t=this.rowCount;if(t<=0){return void 0}if(this.#i){return void 0}if(this.#r.some(o=>o.height>0)){return void 0}const n=this.position.toProto();const r=this.frame?.height??(n?.heightEmu!==void 0?Bo(n.heightEmu):void 0);if(!r||!Number.isFinite(r)||r<=0){return void 0}const i=r/t;if(!Number.isFinite(i)||i<=0){return void 0}return new Array(t).fill(i)}#k(t,n){if(t<0||n<0){throw new Error("Table dimensions must be non-negative.")}const r=Math.floor(t);const i=Math.floor(n);if(this.#n&&this.#n.length!==i){throw new Error(`Expected ${this.#n.length} value columns for existing column tracks, received ${i}.`)}while(this.#r.lengthr){this.#r.splice(r)}for(const o of this.#r){o.ensureCellCount(i)}if(i<=0){this.#e=[]}else if(this.#e.lengthi){this.#e=this.#e.slice(0,i)}}};var rZr={tablestylemedium2:"{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}","medium style 2 - accent 1":"{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}"};var iZr=/^\{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\}$/i;function oZr(e){if(!e){return void 0}const t=e.trim();if(!t){return void 0}if(iZr.test(t)){return t}const n=aZr(t);return rZr[n]}function aZr(e){return e.trim().toLowerCase().replace(/\s+/g," ").replace(/\s*-\s*/g," - ")}function sZr(e){if(!e){return void 0}if(e.left===void 0&&e.right===void 0&&e.top===void 0&&e.bottom===void 0){return void 0}return{left:e.left===void 0?void 0:Bo(e.left),right:e.right===void 0?void 0:Bo(e.right),top:e.top===void 0?void 0:Bo(e.top),bottom:e.bottom===void 0?void 0:Bo(e.bottom)}}function lZr(e){if(!e){return void 0}if(e.left===void 0&&e.right===void 0&&e.top===void 0&&e.bottom===void 0){return void 0}return{left:e.left===void 0?void 0:Qi(e.left),right:e.right===void 0?void 0:Qi(e.right),top:e.top===void 0?void 0:Qi(e.top),bottom:e.bottom===void 0?void 0:Qi(e.bottom)}}function cZr(e,t){if(!Array.isArray(e)||e.length===0){throw new Error(`${t} must include at least one column track.`)}return e.map((n,r)=>{const i=kHe(n,`${t}[${r}]`);if(i==="auto"){throw new Error(`${t}[${r}] must be fr(...) or fixed(...).`)}return i})}function uZr(e){return{mode:e.mode,value:e.value}}function dZr(e,t){const n=e.reduce((a,s)=>a+(s.mode==="fixed"?s.value:0),0);const r=e.reduce((a,s)=>a+(s.mode==="fr"?s.value:0),0);const i=Math.max(0,t-n);const o=r>0?i/r:0;return e.map(a=>{const s=a.mode==="fixed"?a.value:o*a.value;return Number.isFinite(s)&&s>0?s:1})}function fZr(e,t,n){return Rd(e,t,n)}function hZr(e,t=140){if(!e.length){return void 0}const n=e.find(a=>a.cells.some(s=>s.value.trim().length>0))??e[0];if(!n){return void 0}const r=n.cells.map(a=>a.value).map(a=>a.replace(/\r?\n/g," ").trim()).filter(a=>a.length>0);if(r.length===0){return void 0}const i=r.join(" | ");if(i.length<=t){return i}const o=Math.max(1,t-3);return`${i.slice(0,o)}...`}var s5=class{#e;#t;constructor(t,n){this.#e=t;this.#t=[];n.forEach(r=>{this.add({proto:r})})}get items(){return[...this.#t]}getById(t){return this.#t.find(n=>n.id===t)}add(t){if(t&&typeof t==="object"&&"proto"in t){const o=new N0(this.#i(),t.proto);if(!t.proto.table){o.setValues([[""]])}this.#t.push(o);this.#e._register(o);return o}const n=this.#n(t);const r=new N0(this.#i(),void 0);this.#t.push(r);this.#e._register(r);if(n.position){r.frame=n.position}const i=this.#r(n.rows,n.columns);if(n.values&&n.values.length>0){n.values.forEach((o,a)=>{const s=i[a];if(!s){return}o.forEach((l,u)=>{if(u>=s.length){return}s[u]=l})})}r.setValues(i);if(n.columnWidths){r.setColumnWidths(n.columnWidths)}if(n.columnTracks){r.setColumnTracks(n.columnTracks)}return r}toProto(){return this.#t.map(t=>t.toProto())}deleteById(t){const n=this.getById(t);if(!n){return}const r=this.#t.indexOf(n);if(r!==-1){this.#t.splice(r,1)}this.#e._unregister(t)}#n(t){if(!t){return{rows:1,columns:1}}if(Array.isArray(t)){const o=t.length;const a=t.reduce((s,l)=>Math.max(s,l.length),0);return{rows:Math.max(o,1),columns:Math.max(a,1),values:t}}let n=Math.floor(t.rows);let r=Math.floor(t.columns);if(!Number.isFinite(n)||n<=0){throw new Error("Table rows must be a positive integer.")}if(!Number.isFinite(r)||r<=0){throw new Error("Table columns must be a positive integer.")}if(t.columnWidths!==void 0&&t.columnTracks!==void 0){throw new Error("Pass either table columnWidths or columnTracks, not both.")}if(t.values){const o=t.values.length;const a=t.values.reduce((s,l)=>Math.max(s,l.length),0);n=Math.max(n,o);r=Math.max(r,a)}const i=t.left!==void 0||t.top!==void 0||t.width!==void 0||t.height!==void 0;return{rows:n,columns:r,values:t.values,columnWidths:t.columnWidths,columnTracks:t.columnTracks,position:i?{left:t.left,top:t.top,width:t.width,height:t.height}:void 0}}#r(t,n){const r=Math.max(0,t);const i=Math.max(0,n);if(r===0||i===0){return[]}return Array.from({length:r},()=>Array.from({length:i},()=>""))}#i(){return this.#e}};var pZr=pl;var o_e=pZr.ELEMENT_TYPE_SMART_ART??12;var tV=class extends bm{type="smartArt";constructor(t,n){super(t,n);this.data.type=o_e}get id(){return this.data.id}get smartArt(){return this.data.smartArt}toProto(){const t=super.toProto();t.type=o_e;t.smartArt=this.smartArt;return t}};var a_e=class{#e;#t;constructor(t,n){this.#e=t;this.#t=[];n.forEach(r=>{this.add({proto:r})})}get items(){return[...this.#t]}add(t){const n=new tV(this.#e,t.proto);this.#t.push(n);this.#e._register(n);return n}deleteById(t){const n=this.#t.findIndex(r=>r.id===t);if(n===-1){return}this.#t.splice(n,1);this.#e._unregister(t)}toProto(){return this.#t.map(t=>t.toProto())}};var fqt=e=>{if(!e){return void 0}const t=Number(e);if(!Number.isInteger(t)||t<=0){return void 0}return t};var mZr=e=>{if(e.length===0){return e}let t=0;for(const r of e){const i=fqt(r.id);if(i!==void 0){t=Math.max(t,i)}}const n=new Set;return e.map(r=>{const i=r.id;if(i&&fqt(i)!==void 0&&!n.has(i)){n.add(i);return r}t+=1;const o=String(t);n.add(o);return{...r,id:o}})};var jk=class{#e;#t;#n;#r;#i;#a;#o;#s;#l;#c;constructor(t,n){const r=Object.create(t);r._register=(o,a)=>this._register(o,a);r._unregister=o=>this._unregister(o);r.deleteElement=o=>this.#u(o);this.#c=r;this.#o=[];this.#s=new Map;this.#l=true;this.#e=new ZU(this.#c,[]);this.#t=new PU(this.#c,[]);this.#n=new s5(this.#c,[]);this.#r=new RU(this.#c,[]);this.#i=new vve(this.#c,[]);this.#a=new a_e(this.#c,[]);const i=mZr(n??[]);for(const o of i){const a=this.#d(o);if(!a){continue}this.#o.push(a.id)}this.#l=false}get shapes(){return this.#e}get images(){return this.#t}get tables(){return this.#n}get charts(){return this.#r}get artifacts(){return this.#i}get smartArts(){return this.#a}get items(){const t=[];for(const n of this.#o){const r=this.#s.get(n);if(r){t.push(r)}}return t}getById(t){return this.#s.get(t)}deleteById(t){this.#u(t)}bringToFront(t){this.#f(t,this.#o.length-1)}sendToBack(t){this.#f(t,0)}toProto(){return this.items.map(t=>t.toProto())}hydrateCollaborativeRefsFromProto(){this.#e.hydrateCollaborativeRefsFromProto()}_register(t,n){this.#s.set(t.id,t);if(this.#l){return}const r=this.#o.indexOf(t.id);if(r>=0){this.#o.splice(r,1)}const i=n?.index??this.#o.length;this.#o.splice(i,0,t.id);this.#c.onElementMutated?.(t.id);this.#h()}_unregister(t){this.#s.delete(t);const n=this.#o.indexOf(t);if(n>=0){this.#o.splice(n,1)}this.#c.onElementMutated?.(t);this.#h()}#u(t){const n=this.#s.get(t);if(!n){return}if(n instanceof $u){this.#e.deleteById(t);return}if(n instanceof ug){this.#t.deleteById(t);return}if(n instanceof N0){this.#n.deleteById(t);return}if(n instanceof Uk){this.#r.deleteById(t);return}if(n instanceof KO){this.#i.deleteById(t);return}if(n instanceof tV){this.#a.deleteById(t);return}throw new Error("deleteElement does not support this element type.")}#f(t,n){const r=this.#o.indexOf(t);if(r===-1){return}const i=Math.max(0,Math.min(Math.trunc(n),this.#o.length-1));this.#o.splice(r,1);this.#o.splice(i,0,t);this.#c.onElementMutated?.(t);this.#h()}#d(t){return this.#p(t)}#p(t){switch(t.type){case 5:case 1:case 2:return this.#e.add({proto:t});case 3:case 7:return this.#t.add({proto:t});case 9:return this.#n.add({proto:t});case 4:case 6:return this.#r.add({proto:t});case 11:return this.#i.add({proto:t});case o_e:return this.#a.add({proto:t});default:return this.#m(t)}}#m(t){const n=t.placeholderIndex!==void 0||t.placeholderType!==void 0;const r=t.textStyle!==void 0||(t.levelsStyles?.length??0)>0||(t.paragraphs?.length??0)>0;if(!n&&!r){return void 0}return this.#e.add({proto:{...t,type:1}})}#h(){this.#c.getPresentation?.()?.queuePresentationCollabPublish()}};var nV=class{#e;#t;#n;constructor(t,n="slide",r={}){this.#e=t;this.#t=n;this.#n=r}summary(){return this.#a().map(t=>({name:t.placeholderType??this.#c(t)??t.name,type:t.placeholderType,text:t.text?.toString()??""}))}getItem(t){const n=Sme(t);const r=this.#r().find(o=>{const a=this.#c(o);return a!==void 0&&a===n});if(r){return r}const i=this.#i().find(o=>{const a=this.#c(o);return a!==void 0&&a===n});if(i){return this.#n.materializeInheritedShape?.(i)??i}throw new Error(`Placeholder "${t}" not found on ${this.#t}.`)}getAll(){return this.#a()}add(t,n){if(typeof t==="string"){const s=this.#e.addPlaceholder(t);if(n){s.placeholderType=n}return s}const r=t;const i=r.name??`placeholder_${this.#r().length+1}`;const o=r.geometry!==void 0&&r.geometry!=="custom"&&r.geometry!=="connector"?this.#e.add({geometry:r.geometry==="textbox"?"rect":r.geometry,fill:r.fill,line:r.line,position:r.position}):this.#e.addPlaceholder(i);o.name=i;const a=r.index??o.placeholderIndex??this.#l();o.placeholderIndex=a;if(r.type){o.placeholderType=r.type}if(r.text!==void 0){o.text=r.text}return o}#r(){return this.#e.items.filter(t=>t.isPlaceholder())}#i(){return this.#n.inheritedShapes?.()??[]}#a(){const t=this.#r();const n=this.#i().filter(r=>!t.some(i=>this.#o(i,r)));return[...t,...n]}#o(t,n){return kme(this.#s(t),this.#s(n))}#s(t){let n=t.placeholderTypeCandidates;if(n.length===0){const r=this.#c(t);if(r!==void 0){n=[r]}}return{placeholderIndex:t.placeholderIndex,placeholderTypeCandidates:n}}#l(){const t=this.#r().map(n=>n.placeholderIndex).filter(n=>n!==void 0);if(t.length===0){return 0}return Math.max(...t)+1}#c(t){return t.placeholderKey()??Rme({name:t.name})??void 0}};function IHe(e){return{...e,paragraphStyle:e.paragraphStyle?{...e.paragraphStyle,tabStops:[...e.paragraphStyle.tabStops??[]]}:void 0}}var rV=class{#e;#t;#n;#r;#i;#a;constructor(t,n){this.#e=n;if("proto"in t){const r=t.proto;this.#e.fontFamilyCache?.addLevelStyles(r.bodyLevelStyles);this.#e.fontFamilyCache?.addLevelStyles(r.titleLevelStyles);this.#e.fontFamilyCache?.addLevelStyles(r.otherLevelStyles);this.#e.fontFamilyCache?.addThemeFontScheme(r.theme?.fontScheme);this.#t=r;this.#n=new jk(this.#e,r.elements??[]);this.#r=new jO(this.#o(),r.background??void 0);this.#a=r.theme?this.#e.createTheme(r.theme):void 0}else{this.#t={id:Vv(),name:t.name,type:t.type??"",bodyLevelStyles:[],titleLevelStyles:[],otherLevelStyles:[],parentLayoutId:"",colorMap:void 0,slideGuides:[]};this.#n=new jk(this.#e,[]);this.#r=new jO(this.#o(),void 0);this.#a=void 0}}get id(){return this.#t.id}get name(){return this.#t.name}rename(t){this.#t.name=t}get background(){return this.#r}get titleLevelStyles(){return this.#t.titleLevelStyles}get bodyLevelStyles(){return this.#t.bodyLevelStyles}get otherLevelStyles(){return this.#t.otherLevelStyles}get shapes(){return this.#n.shapes}get images(){return this.#n.images}get tables(){return this.#n.tables}get charts(){return this.#n.charts}get parentLayoutId(){return this.#t.parentLayoutId}setParentLayoutId(t){this.#t.parentLayoutId=t;this.#e.invalidateRenderContextCache?.()}setColorMap(t){this.#t.colorMap=t;this.#e.invalidateRenderContextCache?.()}get elements(){return this.#n.items}get type(){return this.#t.type}get colorMap(){return this.#t.colorMap}get showMasterShapes(){return this.#t.showMasterShapes}get furnitureVisibility(){return this.#t.furnitureVisibility}get slideGuides(){return this.#t.slideGuides??[]}get theme(){return this.#a}get placeholders(){if(!this.#i){this.#i=new nV(this.#n.shapes,"layout")}return this.#i}findPlaceholder(t,n,r){const i=Array.isArray(t)?t:[];const o=r?.allowIndexMatchWithoutType===true;if(i.length===0&&!o){return void 0}const a=this.#n.items;if(!a.length){return void 0}const s=f=>{const h=f.placeholderTypeCandidates;return h.some(m=>i.includes(m))};const l=i.length>0?a.find(f=>s(f)&&(f.placeholderIndex??0)===n):void 0;const u=o?a.find(f=>f.placeholderIndex===n):void 0;const d=i.length>0?a.find(f=>s(f)):void 0;return l??u??d}toProto(){return{id:this.#t.id,name:this.#t.name,elements:this.#n.toProto(),background:this.#r.toProto(),type:this.#t.type,bodyLevelStyles:this.#t.bodyLevelStyles.map(IHe),titleLevelStyles:this.#t.titleLevelStyles.map(IHe),otherLevelStyles:this.#t.otherLevelStyles.map(IHe),parentLayoutId:this.#t.parentLayoutId,colorMap:this.#t.colorMap,theme:this.#a?.toProto(),showMasterShapes:this.#t.showMasterShapes,showMasterPlaceholderAnimations:this.#t.showMasterPlaceholderAnimations,matchingName:this.#t.matchingName,preserve:this.#t.preserve,userDrawn:this.#t.userDrawn,furnitureVisibility:this.#t.furnitureVisibility,slideGuides:this.#t.slideGuides}}#o(){return{stub:()=>{}}}};var s_e=class{#e;#t;#n;constructor(t,n){this.#e=t;this.#t=(n??[]).map(r=>new rV({proto:r},this.#r()));this.#n=new Map(this.#t.filter(r=>Boolean(r.id)).map(r=>[r.id,r]))}get items(){return[...this.#t]}getById(t){if(!t){return void 0}return this.#n.get(t)}add(t,n){if(!t||t.length===0){throw new Error("Layout name is required.")}const r=new rV({name:t,...n},this.#r());this.#t.push(r);if(r.id){this.#n.set(r.id,r)}return r}replace(t){this.#t=(t??[]).map(n=>new rV({proto:n},this.#r()));this.#n=new Map(this.#t.filter(n=>Boolean(n.id)).map(n=>[n.id,n]))}getByName(t){return this.#t.find(n=>n.name===t)}getItem(t){const n=this.getByName(t);if(!n){throw new Error(`Layout "${t}" not found.`)}return n}removeByName(t){const n=this.#t.findIndex(r=>r.name===t);if(n>=0){const[r]=this.#t.splice(n,1);if(r?.id){this.#n.delete(r.id)}}}toProto(){return this.#t.map(t=>t.toProto())}#r(){return this.#e}};var l_e=class{#e;constructor(t){this.#e=t}get items(){return this.#e.items.filter(t=>t.type==="master")}getDefault(){return this.items[0]}add(t){return this.#e.add(t,{type:"master"})}toProto(){return this.items.map(t=>t.toProto())}};var SJ=class{#e;#t;#n="text";#r;#i;#a;constructor(t){this.#t=t.name;this.#r=t.isBuiltIn??false;this.#i=t.description;this.#a=t.usageHint;this.#e=new ko(t.textStyle)}get name(){return this.#t}get kind(){return this.#n}get isBuiltIn(){return this.#r}get description(){return this.#i}set description(t){this.#i=t}get usageHint(){return this.#a}set usageHint(t){this.#a=t}get bold(){return this.#e.bold}set bold(t){this.#e.bold=t}get italic(){return this.#e.italic}set italic(t){this.#e.italic=t}get fontSize(){return this.#e.fontSize}set fontSize(t){this.#e.fontSize=t}get underline(){return this.#e.underline}set underline(t){this.#e.underline=t}get alignment(){return dE(this.#e.alignment)}set alignment(t){this.#e.alignment=t?XI(t):void 0}get color(){return this.#o(this.#e.fill)}set color(t){this.#e.fill=t}get textStyle(){return this.#e}describe(){return{name:this.#t,kind:this.#n,description:this.#i,usageHint:this.#a,isBuiltIn:this.#r}}#o(t){if(!t){return void 0}const n=t.color.toProto();if(!n){return void 0}const r=new Mi({type:"proto",proto:n});return r}};var gZr=[{options:{name:"title",isBuiltIn:true,description:"Primary slide title",usageHint:"Use 'title' for the main slide heading, usually once per slide."},configure:e=>{e.bold=true;e.fontSize=36;e.alignment="center"}},{options:{name:"heading1",isBuiltIn:true,description:"Section heading inside slides",usageHint:"Use 'heading1' for major sections or standout headings."},configure:e=>{e.bold=true;e.fontSize=28;e.alignment="left"}},{options:{name:"heading2",isBuiltIn:true,description:"Sub-heading within content blocks",usageHint:"Use 'heading2' for secondary headings beneath a heading1."},configure:e=>{e.bold=true;e.fontSize=22;e.alignment="left"}},{options:{name:"body",isBuiltIn:true,description:"Default body copy",usageHint:"Use 'body' for standard paragraphs and descriptive text."},configure:e=>{e.fontSize=18;e.alignment="left"}},{options:{name:"list",isBuiltIn:true,description:"Bulleted list formatting",usageHint:"Use 'list' for bulleted bodies when enumerating items."},configure:e=>{e.fontSize=18;e.alignment="left"}},{options:{name:"numberedList",isBuiltIn:true,description:"Numbered list formatting",usageHint:"Use 'numberedList' for ordered lists or step-wise instructions."},configure:e=>{e.fontSize=18;e.alignment="left"}}];var iV=class{#e;constructor(){this.#e=new Map;this.#t()}get(t){const n=this.#e.get(t);if(!n){throw new Error(`Style '${t}' does not exist.`)}return n}add(t){const n=this.#e.get(t);if(n){return n}const r=new SJ({name:t,isBuiltIn:false});this.#e.set(t,r);return r}describe(t){if(typeof t==="string"){return this.get(t).describe()}return Array.from(this.#e.values()).map(n=>n.describe())}resolveTextStyle(t){return this.#e.get(t)?.textStyle}#t(){for(const t of gZr){const n=new SJ(t.options);t.configure?.(n);this.#e.set(n.name,n)}}};IU();var yZr=12;var bZr=24;var xZr=80;var vZr=64;var _Zr=72;var TZr=16;var mqt=8;function LHe(e,t,n={}){const r=AJ(n.columns,yZr,"columns");const i=pw(n.gutter,bZr,"gutter");const o=pw(n.marginX,xZr,"marginX");const a=pw(n.marginY,vZr,"marginY");const s=MHe(n.rowHeight,_Zr,"rowHeight");const l=pw(n.rowGap,TZr,"rowGap");const u=MHe(n.baseUnit,mqt,"baseUnit");const d=AJ(t.colStart,1,"colStart");const f=AJ(t.colSpan,1,"colSpan");if(d+f-1>r){throw new Error(`Grid area exceeds column count: colStart=${d}, colSpan=${f}, columns=${r}.`)}const h=e.width-o*2-i*Math.max(0,r-1);if(h<=0){throw new Error(`Grid width is not positive. Check marginX/gutter/columns for frame width ${e.width}.`)}const m=h/r;const g=e.left+o+(d-1)*(m+i);const x=f*m+Math.max(0,f-1)*i;const w=t.rowStart===void 0?1:AJ(t.rowStart,1,"rowStart");const _=t.rowSpan===void 0?1:AJ(t.rowSpan,1,"rowSpan");const C=t.top??e.top+a+(w-1)*(s+l);const A=t.height??_*s+Math.max(0,_-1)*l;return{left:bM(g,u),top:bM(C,u),width:Math.max(1,bM(x,u)),height:Math.max(1,bM(A,u))}}function gqt(e,t,n={}){if(t.length===0){return[]}const r=MHe(n.baseUnit,mqt,"baseUnit");const i=n.defaultAlignX??"stretch";const o=n.defaultAlignY??"stretch";return t.map(a=>{const s=wZr(a.area,n.areas);const l=LHe(e,s,n);const u=EZr(a);const d=CZr(l,u);const f=a.alignX??i;const h=a.alignY??o;const m=f==="stretch"?d.width:hqt(a.shape.position.width,"shape.position.width","alignX");const g=h==="stretch"?d.height:hqt(a.shape.position.height,"shape.position.height","alignY");const x=pqt(d.left,d.width,m,f);const w=pqt(d.top,d.height,g,h);return{shape:a.shape,frame:{left:bM(x,r),top:bM(w,r),width:Math.max(1,bM(m,r)),height:Math.max(1,bM(g,r))}}})}var AJ=(e,t,n)=>{if(e===void 0){return t}if(!Number.isFinite(e)||e<=0||!Number.isInteger(e)){throw new Error(`${n} must be a positive integer.`)}return e};var MHe=(e,t,n)=>{if(e===void 0){return t}if(!Number.isFinite(e)||e<=0){throw new Error(`${n} must be a positive number.`)}return e};var pw=(e,t,n)=>{if(e===void 0){return t}if(!Number.isFinite(e)||e<0){throw new Error(`${n} must be a non-negative number.`)}return e};var bM=(e,t)=>Math.round(e/t)*t;var wZr=(e,t)=>{if(typeof e!=="string"){return e}if(!t){throw new Error(`Named grid area "${e}" was provided, but options.areas is empty.`)}const n=t[e];if(!n){throw new Error(`Named grid area "${e}" was not found in options.areas.`)}return n};var hqt=(e,t,n)=>{if(!Number.isFinite(e)||e===void 0||e<=0){throw new Error(`${t} must be a positive number when ${n} is not "stretch".`)}return e};var pqt=(e,t,n,r)=>{if(r==="start"||r==="stretch"){return e}if(r==="center"){return e+(t-n)/2}return e+(t-n)};var EZr=e=>{const t=pw(e.inset,0,"inset");const n=pw(e.insetX,t,"insetX");const r=pw(e.insetY,t,"insetY");return{left:pw(e.insetLeft,n,"insetLeft"),right:pw(e.insetRight,n,"insetRight"),top:pw(e.insetTop,r,"insetTop"),bottom:pw(e.insetBottom,r,"insetBottom")}};var CZr=(e,t)=>{const n=e.width-t.left-t.right;const r=e.height-t.top-t.bottom;if(n<=0||r<=0){throw new Error("Grid item insets collapse the area below zero width/height.")}return{left:e.left+t.left,top:e.top+t.top,width:n,height:r}};var DHe=class{#e;#t;constructor(t,n){this.#e=t;this.#t=n}get paragraphs(){return this.#e}setText(t){this.#t.set(t)}append(t){this.#t.add(t)}clear(){this.#t.set("")}};var Kk=class{#e;#t;#n;#r;#i;#a;constructor(t,n){this.#e=t;void this.#e;this.#a=t.getSlideId?.();const r=n?.elements?.find(o=>o?.placeholderType==="body"||o?.placeholderType==="notes");const i=r?.paragraphs??[];this.#t=new Hv(this.#c(),i);this.#i=new Yv(this.#t);this.#r=new DHe(this.#t,this.#i);this.#n=true}get paragraphs(){return this.#t}get textFrame(){return this.#r}get text(){return this.#i.toString()}set text(t){this.#i.set(t);this.#u(t)}get slideId(){return this.#a}toSnapshot(t){return{aid:`nt/${t}`,kind:"notes",slideId:t,text:this.text}}setText(t){this.#r.setText(t);this.#u(t)}append(t){this.#r.append(t)}setVisible(t){this.#n=t}isVisible(){return this.#n}clear(){this.#r.clear();this.#u("")}toProto(){const t=this.text;if(!this.#n&&t.length===0){return void 0}return{id:"",elements:[this.#o(),this.#s(),this.#l()],index:0,useLayoutId:"",widthEmu:0,heightEmu:0}}#o(){return{id:"",name:"Slide Image Placeholder 1",type:0,placeholderIndex:0,placeholderType:"sldImg",zIndex:0,paragraphs:[],effects:[],children:[],levelsStyles:[],citations:[]}}#s(){const t=this.#t.toProto();return{id:"",name:"Notes Placeholder 2",type:1,placeholderIndex:1,placeholderType:"body",zIndex:0,textStyle:{},paragraphs:t.length>0?t:[{id:"",runs:[],inlineNodes:[],textStyle:{}}],effects:[],children:[],levelsStyles:[],citations:[]}}#l(){return{id:"",name:"Slide Number Placeholder 3",type:1,placeholderIndex:5,placeholderType:"sldNum",zIndex:0,textStyle:{},paragraphs:[{id:"",runs:[],inlineNodes:[],textStyle:{}}],effects:[],children:[],levelsStyles:[],citations:[]}}#c(){return{fontFamilyCache:this.#e.fontFamilyCache,stub:()=>{},attachChartAsset:t=>{throw new Error("attachChartAsset is not available in speaker notes context.")},getImageById:()=>void 0,createImageAsset:()=>{throw new Error("createImageAsset is not available in speaker notes context.")},getChartById:()=>void 0,createChartAsset:()=>{throw new Error("createChartAsset is not available in speaker notes context.")},getTextStyleByName:()=>void 0}}#u(t){const n=this.#e.recordOp;if(!n){return}const r=this.#a;if(!r){return}const i=t instanceof Yv?t.toString():t;n({op:"notes.set",target:`nt/${r}`,value:i})}};var NHe=(e,t)=>{if(t==="none"){return e}if(typeof e==="string"){return FHe(e,t)}if(Array.isArray(e)){if(e.length===0){return[]}if(MT(e)){return zHe(e,t)}if(AZr(e)){return e.map(n=>SZr(n,t))}}return yqt(e,t)};var OHe=(e,t)=>{const n=NHe(e,t);if(typeof n==="string"){const r=n.length>0?n.split(/\r?\n/):[""];return r.map(i=>({id:"",inlineNodes:[],runs:[{id:"",text:i,citations:[],reviewMarkIds:[]}]}))}return S0(n)};var BHe=(e,t)=>{const n=OHe(e,t);return n.map(r=>(r.runs??[]).map(i=>i.text??"").join("")).join("\n")};function SZr(e,t){if(Array.isArray(e)){return zHe(e,t)}return yqt(e,t)}function zHe(e,t){return(e??[]).map(n=>{if(typeof n==="string"||typeof n==="number"){return FHe(String(n),t)}if(Wv(n)){return n}return{...n,run:FHe(n.run,t)}})}function yqt(e,t){return{...e,runs:zHe(e.runs,t),paragraphStyle:e.paragraphStyle?{...e.paragraphStyle}:void 0}}function FHe(e,t){if(t==="uppercase"){return e.toUpperCase()}if(t==="lowercase"){return e.toLowerCase()}return e}function AZr(e){return e.every(t=>MT(t)||Cme(t))}var UHe=1e5;var bpa=(e,t,n={})=>{const r=Lqt(n.frame??e.frame,"slide.compose frame");const i=Mqt(n.baseUnit);const o=Iqt(e);const a={slide:e,presentation:o};const s=c5(a,t);const l=qHe(t.width,s.intrinsicWidth,r.width);const u={left:r.left,top:r.top,width:l,height:Dqt(a,s,l,r.height)};const d=[];u5(a,s,u,d,i);return d};var Sqt=(e,t,n={})=>{const r=Lqt(n.frame??e.frame,"slide.compose frame");const i=Mqt(n.baseUnit);const o=Iqt(e);const a={slide:e,presentation:o};const s=c5(a,t);const l=qHe(t.width,s.intrinsicWidth,r.width);const u={left:r.left,top:r.top,width:l,height:Dqt(a,s,l,r.height)};const d=[];u5(a,s,u,d,i);const f=[];const h=oV(a,s,u,i,"0",f);return{placements:d,materializedPaths:f,run:{frame:g_(r),baseUnit:i,root:h}}};var c5=(e,t)=>{if(t.kind==="text"){const n=$He(e,t);return{node:t,intrinsicWidth:n.width,intrinsicHeight:n.height,children:[]}}if(t.kind==="rule"){return{node:t,intrinsicWidth:l5(t.width,0),intrinsicHeight:l5(t.height,t.weight),children:[]}}if(t.kind==="shape"){return kJ(t,24,24)}if(t.kind==="connector"){return kJ(t,160,16)}if(t.kind==="image"){return kJ(t,320,180)}if(t.kind==="table"){return kJ(t,360,200)}if(t.kind==="chart"){return kJ(t,640,360)}if(t.kind==="panel"){return kZr(e,t)}if(t.kind==="layers"){return RZr(e,t)}if(t.kind==="row"){return PZr(e,t)}if(t.kind==="column"){return IZr(e,t)}return MZr(e,t)};var kJ=(e,t,n)=>({node:e,intrinsicWidth:l5(e.width,t),intrinsicHeight:l5(e.height,n),children:[]});var kZr=(e,t)=>{const n=t.child?c5(e,t.child):void 0;return{node:t,intrinsicWidth:(n?y_(n,"x"):0)+t.padding.left+t.padding.right,intrinsicHeight:(n?y_(n,"y"):0)+t.padding.top+t.padding.bottom,children:n?[n]:[]}};var RZr=(e,t)=>{const n=t.children.map(o=>c5(e,o));const r=Math.max(0,...n.map(o=>Tqt(o,"x")))+t.padding.left+t.padding.right;const i=Math.max(0,...n.map(o=>Tqt(o,"y")))+t.padding.top+t.padding.bottom;return{node:t,intrinsicWidth:r,intrinsicHeight:i,children:n}};var PZr=(e,t)=>{const n=t.children.map(a=>c5(e,a));const r=dh(n.map(a=>y_(a,"x")));const i=Math.max(0,n.length-1)*t.gap;const o=Math.max(0,...n.map(a=>y_(a,"y")));return{node:t,intrinsicWidth:r+i+t.padding.left+t.padding.right,intrinsicHeight:o+t.padding.top+t.padding.bottom,children:n}};var IZr=(e,t)=>{const n=t.children.map(a=>c5(e,a));const r=dh(n.map(a=>y_(a,"y")));const i=Math.max(0,n.length-1)*t.gap;const o=Math.max(0,...n.map(a=>y_(a,"x")));return{node:t,intrinsicWidth:o+t.padding.left+t.padding.right,intrinsicHeight:r+i+t.padding.top+t.padding.bottom,children:n}};var MZr=(e,t)=>{const n=t.children.map(f=>c5(e,f));const r=h_e(t,n);const i=Rqt(t,kqt(t,r));if(t.width.mode==="hug"&&t.columns.some(f=>wqt(f))){throw new Error(`Grid "${t.name??"(unnamed)"}" cannot use width: "hug" with fr columns.`)}if(t.height.mode==="hug"&&i.some(f=>wqt(f))){throw new Error(`Grid "${t.name??"(unnamed)"}" cannot use height: "hug" with fr rows.`)}const o=vqt(t.columns,t.columnGap,r,"x");const a=vqt(i,t.rowGap,r,"y");const s=t.columns.map((f,h)=>f==="auto"?o[h]??0:GHe(f));const l=i.map((f,h)=>f==="auto"?a[h]??0:GHe(f));const u=dh(s)+Math.max(0,t.columns.length-1)*t.columnGap+t.padding.left+t.padding.right;const d=dh(l)+Math.max(0,i.length-1)*t.rowGap+t.padding.top+t.padding.bottom;return{node:t,intrinsicWidth:u,intrinsicHeight:d,children:n}};var u5=(e,t,n,r,i)=>{if(n.width<=0||n.height<=0){return}const o=WHe(t,n,i);if(t.node.kind==="text"){r.push({kind:"text",frame:Jk(t,n,o),name:t.node.name,value:NHe(t.node.value,t.node.transform),style:t.node.style,shadow:t.node.shadow});return}if(t.node.kind==="rule"){r.push({kind:"rule",frame:Jk(t,n,o),name:t.node.name,stroke:t.node.stroke,opacity:t.node.opacity,weight:t.node.weight});return}if(t.node.kind==="shape"){r.push({kind:"shape",frame:Jk(t,n,o),name:t.node.name,geometry:t.node.geometry,customPaths:t.node.customPaths,fill:t.node.fill,line:t.node.line,borderRadius:t.node.borderRadius,shadow:t.node.shadow});return}if(t.node.kind==="connector"){r.push({kind:"connector",frame:Jk(t,n,o),name:t.node.name,connectorKind:t.node.connectorKind,orientation:t.node.orientation,from:t.node.from,to:t.node.to,fromElement:f_e(t.node.fromElement),toElement:f_e(t.node.toElement),fromSide:t.node.fromSide,toSide:t.node.toSide,fromIdx:t.node.fromIdx,toIdx:t.node.toIdx,line:t.node.line,head:t.node.head,tail:t.node.tail,cap:t.node.cap,join:t.node.join});return}if(t.node.kind==="image"){r.push({kind:"image",frame:Jk(t,n,o),name:t.node.name,source:t.node.source,contentType:t.node.contentType,fit:t.node.fit,alt:t.node.alt,geometry:t.node.geometry,borderRadius:t.node.borderRadius,crop:t.node.crop,rotation:t.node.rotation,flipHorizontal:t.node.flipHorizontal,flipVertical:t.node.flipVertical,lockAspectRatio:t.node.lockAspectRatio});return}if(t.node.kind==="table"){r.push({kind:"table",frame:Jk(t,n,o),name:t.node.name,rows:t.node.rows,columns:t.node.columns,values:t.node.values,columnWidths:t.node.columnWidths,columnTracks:t.node.columnTracks,style:t.node.style,styleOptions:t.node.styleOptions});return}if(t.node.kind==="chart"){r.push({kind:"chart",frame:Jk(t,n,o),name:t.node.name,chartType:t.node.chartType,config:t.node.config});return}if(t.node.kind==="panel"){LZr(e,t,n,r,i);return}if(t.node.kind==="layers"){FZr(e,t,n,r,i);return}if(t.node.kind==="row"){DZr(e,t,n,r,i);return}if(t.node.kind==="column"){NZr(e,t,n,r,i);return}OZr(e,t,n,r,i)};var LZr=(e,t,n,r,i)=>{const o=t.node;const a=hC(t,n,i);if(o.materialize){r.push({kind:"shape",frame:a,name:o.name,geometry:"rect",fill:o.fill,line:o.line,borderRadius:o.borderRadius,shadow:o.shadow})}const s=t.children[0];if(!s){return}const l=fC(a,o.padding);if(l.width<=0||l.height<=0){return}const u=mw(s,l.width,o.align==="stretch");const d=Qk(e,s,u,l.height,o.justify==="stretch");const f=O0(l.left,l.width,u,o.align,i,km(s,"x"));const h=O0(l.top,l.height,d,o.justify,i,km(s,"y"));u5(e,s,{left:f.start,top:h.start,width:f.size,height:h.size},r,i)};var DZr=(e,t,n,r,i)=>{const o=t.node;const a=hC(t,n,i);const s=fC(a,o.padding);if(s.width<=0||s.height<=0||t.children.length===0){return}const l=t.children.map(m=>y_(m,"x"));const u=t.children.map(m=>m.node.width.mode==="fill"?m.node.width.value:0);const d=MJ({available:s.width,baseSizes:l,gap:o.gap,fillWeights:u,kind:o.kind,name:o.name,axis:"x",warnOverflow:true,slideNumber:e.slide.index+1,slideId:e.slide.id,childNames:t.children.map(m=>m.node.name)});const f=d_e(s.width,d,o.gap,o.justify);let h=s.left+f.offset;t.children.forEach((m,g)=>{const x=d[g]??0;const w=Qk(e,m,x,s.height,o.align==="stretch");const _=O0(s.top,s.height,w,o.align,i,km(m,"y"));u5(e,m,{left:h,top:_.start,width:x,height:_.size},r,i);h+=x+f.gap})};var FZr=(e,t,n,r,i)=>{const o=t.node;const a=hC(t,n,i);const s=fC(a,o.padding);if(s.width<=0||s.height<=0||t.children.length===0){return}t.children.forEach(l=>{const u=Aqt(e,l,s,o.justifyItems,o.alignItems,i);u5(e,l,u,r,i)})};var Aqt=(e,t,n,r,i,o)=>{const a=t.node.position;if(!a){const u=mw(t,n.width,r==="stretch");const d=Qk(e,t,u,n.height,i==="stretch");const f=O0(n.left,n.width,u,r,o,km(t,"x"));const h=O0(n.top,n.height,d,i,o,km(t,"y"));return{left:f.start,top:h.start,width:f.size,height:h.size}}const s=bqt({origin:n.left,available:n.width,startOffset:a.left,endOffset:a.right,intrinsicSize:_qt(t,"x"),sizeFromAvailable:(u,d)=>mw(t,u,d),align:r,baseUnit:o,preserveSize:km(t,"x")});const l=bqt({origin:n.top,available:n.height,startOffset:a.top,endOffset:a.bottom,intrinsicSize:_qt(t,"y"),sizeFromAvailable:(u,d)=>Qk(e,t,s.size,u,d),align:i,baseUnit:o,preserveSize:km(t,"y")});return{left:s.start,top:l.start,width:s.size,height:l.size}};var bqt=e=>{const t=e.startOffset??0;const n=e.endOffset??0;const r=e.startOffset!==void 0;const i=e.endOffset!==void 0;const o=Math.max(0,e.available-t-n);if(r&&i){return{start:e.origin+t,size:o}}const a=e.sizeFromAvailable(r||i?o:e.available,e.align==="stretch");if(r){return{start:e.origin+t,size:a}}if(i){return{start:e.origin+e.available-n-a,size:a}}const s=O0(e.origin,e.available,a||e.intrinsicSize,e.align,e.baseUnit,e.preserveSize);return{start:s.start,size:s.size}};var NZr=(e,t,n,r,i)=>{const o=t.node;const a=hC(t,n,i);const s=fC(a,o.padding);if(s.width<=0||s.height<=0||t.children.length===0){return}const l=t.children.map(g=>mw(g,s.width,o.align==="stretch"));const u=t.children.map((g,x)=>aV(e,g,l[x]??0,true));const d=t.children.map(g=>g.node.height.mode==="fill"?g.node.height.value:0);const f=MJ({available:s.height,baseSizes:u,gap:o.gap,fillWeights:d,kind:o.kind,name:o.name,axis:"y",warnOverflow:true,slideNumber:e.slide.index+1,slideId:e.slide.id,childNames:t.children.map(g=>g.node.name)});const h=d_e(s.height,f,o.gap,o.justify);let m=s.top+h.offset;t.children.forEach((g,x)=>{const w=l[x]??0;const _=f[x]??0;const C=O0(s.left,s.width,w,o.align,i,km(g,"x"));u5(e,g,{left:C.start,top:m,width:C.size,height:_},r,i);m+=_+h.gap})};var OZr=(e,t,n,r,i)=>{const o=t.node;const a=hC(t,n,i);const s=fC(a,o.padding);if(s.width<=0||s.height<=0||t.children.length===0){return}const l=YHe(e,o,h_e(o,t.children),s.width,s.height,true);l.items.forEach(u=>{const d=s.left+dh(l.columnSizes.slice(0,u.column))+u.column*o.columnGap;const f=s.top+dh(l.rowSizes.slice(0,u.row))+u.row*o.rowGap;const h=dh(l.columnSizes.slice(u.column,u.column+u.columnSpan))+Math.max(0,u.columnSpan-1)*o.columnGap;const m=dh(l.rowSizes.slice(u.row,u.row+u.rowSpan))+Math.max(0,u.rowSpan-1)*o.rowGap;const g=mw(u.child,h,o.justifyItems==="stretch");const x=Qk(e,u.child,g,m,o.alignItems==="stretch");const w=O0(d,h,g,o.justifyItems,i,km(u.child,"x"));const _=O0(f,m,x,o.alignItems,i,km(u.child,"y"));u5(e,u.child,{left:w.start,top:_.start,width:w.size,height:_.size},r,i)})};var oV=(e,t,n,r,i,o)=>{if(t.node.kind==="text"){if(Zk(n)){o.push(i)}return{...m_(t,n,r,i,true),kind:"text",text:BHe(t.node.value,t.node.transform),transform:t.node.transform}}if(t.node.kind==="rule"){if(Zk(n)){o.push(i)}return{...m_(t,n,r,i,true),kind:"rule",weight:t.node.weight,opacity:t.node.opacity}}if(t.node.kind==="shape"){if(Zk(n)){o.push(i)}return{...m_(t,n,r,i,true),kind:"shape",geometry:t.node.geometry}}if(t.node.kind==="connector"){if(Zk(n)){o.push(i)}return{...m_(t,n,r,i,true),kind:"connector",connectorKind:t.node.connectorKind,orientation:t.node.orientation,from:t.node.from,to:t.node.to,fromElement:f_e(t.node.fromElement),toElement:f_e(t.node.toElement),fromSide:t.node.fromSide,toSide:t.node.toSide,fromIdx:t.node.fromIdx,toIdx:t.node.toIdx}}if(t.node.kind==="image"){if(Zk(n)){o.push(i)}return{...m_(t,n,r,i,true),kind:"image",source:YZr(t.node.source),contentType:t.node.contentType,fit:t.node.fit,alt:t.node.alt,geometry:t.node.geometry,crop:t.node.crop,rotation:t.node.rotation,flipHorizontal:t.node.flipHorizontal,flipVertical:t.node.flipVertical,lockAspectRatio:t.node.lockAspectRatio}}if(t.node.kind==="table"){if(Zk(n)){o.push(i)}return{...m_(t,n,r,i,true),kind:"table",rows:t.node.rows,columns:t.node.columns,columnWidths:t.node.columnWidths,columnTracks:t.node.columnTracks,style:t.node.style}}if(t.node.kind==="chart"){if(Zk(n)){o.push(i)}return{...m_(t,n,r,i,true),kind:"chart",chartType:t.node.chartType,title:typeof t.node.config?.title==="string"?t.node.config.title:void 0}}if(t.node.kind==="panel"){const g=t.node;if(g.materialize&&Zk(n)){o.push(i)}const x=t.children[0];const w=hC(t,n,r);const _=fC(w,g.padding);const C=[];if(x&&_.width>0&&_.height>0){const A=mw(x,_.width,g.align==="stretch");const P=Qk(e,x,A,_.height,g.justify==="stretch");const L=O0(_.left,_.width,A,g.align,r,km(x,"x"));const I=O0(_.top,_.height,P,g.justify,r,km(x,"y"));C.push(oV(e,x,{left:L.start,top:I.start,width:L.size,height:I.size},r,RJ(i,0),o))}return{...m_(t,n,r,i,g.materialize),kind:"panel",padding:PJ(g.padding),align:g.align,justify:g.justify,contentFrame:g_(_),children:C}}if(t.node.kind==="layers"){const g=t.node;const x=hC(t,n,r);const w=fC(x,g.padding);const _=[];const C=[];if(w.width>0&&w.height>0&&t.children.length>0){t.children.forEach((A,P)=>{const L=RJ(i,P);const I=Aqt(e,A,w,g.justifyItems,g.alignItems,r);C.push({path:L,frame:g_(I)});_.push(oV(e,A,I,r,L,o))})}return{...m_(t,n,r,i,false),kind:"layers",padding:PJ(g.padding),alignItems:g.alignItems,justifyItems:g.justifyItems,contentFrame:g_(w),items:C,children:_}}if(t.node.kind==="row"){const g=t.node;const x=hC(t,n,r);const w=fC(x,g.padding);const _=[];const C=[];let A=g.gap;let P=0;if(w.width>0&&w.height>0&&t.children.length>0){const L=t.children.map(U=>y_(U,"x"));const I=t.children.map(U=>U.node.width.mode==="fill"?U.node.width.value:0);const N=MJ({available:w.width,baseSizes:L,gap:g.gap,fillWeights:I,kind:g.kind,name:g.name,axis:"x",warnOverflow:false});const O=d_e(w.width,N,g.gap,g.justify);A=O.gap;P=O.offset;let z=w.left+O.offset;t.children.forEach((U,W)=>{const H=N[W]??0;const $=Qk(e,U,H,w.height,g.align==="stretch");const K=O0(w.top,w.height,$,g.align,r,km(U,"y"));const X={left:z,top:K.start,width:H,height:K.size};const j=RJ(i,W);C.push({path:j,frame:g_(X)});_.push(oV(e,U,X,r,j,o));z+=H+O.gap})}return{...m_(t,n,r,i,false),kind:"row",padding:PJ(g.padding),gap:g.gap,effectiveGap:Md(A),justifyOffset:Md(P),align:g.align,justify:g.justify,contentFrame:g_(w),items:C,children:_}}if(t.node.kind==="column"){const g=t.node;const x=hC(t,n,r);const w=fC(x,g.padding);const _=[];const C=[];let A=g.gap;let P=0;if(w.width>0&&w.height>0&&t.children.length>0){const L=t.children.map(W=>mw(W,w.width,g.align==="stretch"));const I=t.children.map((W,H)=>aV(e,W,L[H]??0,true));const N=t.children.map(W=>W.node.height.mode==="fill"?W.node.height.value:0);const O=MJ({available:w.height,baseSizes:I,gap:g.gap,fillWeights:N,kind:g.kind,name:g.name,axis:"y",warnOverflow:false});const z=d_e(w.height,O,g.gap,g.justify);A=z.gap;P=z.offset;let U=w.top+z.offset;t.children.forEach((W,H)=>{const $=L[H]??0;const K=O[H]??0;const X=O0(w.left,w.width,$,g.align,r,km(W,"x"));const j={left:X.start,top:U,width:X.size,height:K};const te=RJ(i,H);C.push({path:te,frame:g_(j)});_.push(oV(e,W,j,r,te,o));U+=K+z.gap})}return{...m_(t,n,r,i,false),kind:"column",padding:PJ(g.padding),gap:g.gap,effectiveGap:Md(A),justifyOffset:Md(P),align:g.align,justify:g.justify,contentFrame:g_(w),items:C,children:_}}const a=t.node;const s=hC(t,n,r);const l=fC(s,a.padding);const u=[];const d=[];let f=[];let h=[];let m=a.rows?c_e(a.rows):[];if(l.width>0&&l.height>0&&t.children.length>0){const g=YHe(e,a,h_e(a,t.children),l.width,l.height,true);f=g.columnSizes.map(Md);h=g.rowSizes.map(Md);m=c_e(g.rows);g.items.forEach((x,w)=>{const _=l.left+dh(g.columnSizes.slice(0,x.column))+x.column*a.columnGap;const C=l.top+dh(g.rowSizes.slice(0,x.row))+x.row*a.rowGap;const A=dh(g.columnSizes.slice(x.column,x.column+x.columnSpan))+Math.max(0,x.columnSpan-1)*a.columnGap;const P=dh(g.rowSizes.slice(x.row,x.row+x.rowSpan))+Math.max(0,x.rowSpan-1)*a.rowGap;const L=mw(x.child,A,a.justifyItems==="stretch");const I=Qk(e,x.child,L,P,a.alignItems==="stretch");const N=O0(_,A,L,a.justifyItems,r,km(x.child,"x"));const O=O0(C,P,I,a.alignItems,r,km(x.child,"y"));const z=RJ(i,w);const U={left:N.start,top:O.start,width:N.size,height:O.size};d.push({path:z,column:x.column,row:x.row,columnSpan:x.columnSpan,rowSpan:x.rowSpan,cellFrame:g_({left:_,top:C,width:A,height:P})});u.push(oV(e,x.child,U,r,z,o))})}return{...m_(t,n,r,i,false),kind:"grid",padding:PJ(a.padding),columnGap:a.columnGap,rowGap:a.rowGap,alignItems:a.alignItems,justifyItems:a.justifyItems,contentFrame:g_(l),columns:c_e(a.columns),rows:a.rows?c_e(a.rows):void 0,autoRows:Fqt(a.autoRows),resolvedRows:m,columnSizes:f,rowSizes:h,cells:d,children:u}};var m_=(e,t,n,r,i)=>{return{path:r,kind:e.node.kind,name:e.node.name,position:e.node.position?WZr(e.node.position):void 0,requestedSize:{width:Cqt(e.node.width),height:Cqt(e.node.height)},intrinsicSize:{width:Md(e.intrinsicWidth),height:Md(e.intrinsicHeight)},frame:g_(t),snappedFrame:i&&n!==void 0&&Zk(t)?g_(Jk(e,t,WHe(e,t,n))):void 0,children:[]}};var WHe=(e,t,n)=>{if(n===void 0){return void 0}if(e.node.position){return void 0}if(e.node.kind==="text"){return Math.max(1,n/4)}if(e.node.kind==="rule"){return Math.max(1,n/4)}if(e.node.kind==="shape"&&t.width<=n*2&&t.height<=n*2){return Math.max(1,n/4)}if(e.node.kind==="shape"&&t.width<=n*10&&t.height<=n*10){return Math.max(1,n/2)}if(e.node.kind==="connector"){return Math.max(1,n/4)}return e.node.kind==="shape"?n:void 0};var mw=(e,t,n)=>{const r=e.node.width;if(r.mode==="fill"){return Math.max(0,t)}if(r.mode==="fixed"){return r.value}if(r.mode==="wrap"){return Math.min(e.intrinsicWidth,r.max)}if(n){return Math.max(0,t)}return e.intrinsicWidth};var Qk=(e,t,n,r,i)=>{const o=t.node.height;if(o.mode==="fill"){return Math.max(0,r)}if(o.mode==="fixed"){return o.value}const a=u_e(e,t,n);if(o.mode==="wrap"){return Math.min(a,o.max)}if(i){return Math.max(0,r)}return a};var aV=(e,t,n,r=false)=>{const i=t.node.height;if(i.mode==="fill"){if(!r){return 0}return u_e(e,t,n,true)}if(i.mode==="fixed"){return i.value}const o=u_e(e,t,n,r);if(i.mode==="wrap"){return Math.min(o,i.max)}return o};var u_e=(e,t,n,r=false)=>{if(t.node.kind==="text"){if(r&&t.node.height.mode==="fill"){return $He(e,{...t.node,height:{mode:"hug"}},n).height}return $He(e,t.node,n).height}if(t.node.kind==="rule"||t.node.kind==="shape"||t.node.kind==="connector"||t.node.kind==="image"||t.node.kind==="table"||t.node.kind==="chart"){if(r&&t.node.height.mode==="fill"){return t.intrinsicHeight}return l5(t.node.height,t.intrinsicHeight)}if(t.node.kind==="panel"){const a=t.children[0];const s=Math.max(0,n-t.node.padding.left-t.node.padding.right);const l=a?qHe(a.node.width,a.intrinsicWidth,s):0;const u=a?aV(e,a,l,true):0;return u+t.node.padding.top+t.node.padding.bottom}if(t.node.kind==="layers"){const a=t.node;const s=Math.max(0,n-a.padding.left-a.padding.right);const l=t.children.map(u=>{const d=mw(u,s,a.justifyItems==="stretch");return aV(e,u,d,true)});return Math.max(0,...l)+a.padding.top+a.padding.bottom}if(t.node.kind==="row"){const a=Math.max(0,n-t.node.padding.left-t.node.padding.right);const s=t.children.map(f=>y_(f,"x"));const l=t.children.map(f=>f.node.width.mode==="fill"?f.node.width.value:0);const u=MJ({available:a,baseSizes:s,gap:t.node.gap,fillWeights:l,kind:t.node.kind,name:t.node.name,axis:"x",warnOverflow:false});const d=Math.max(0,...t.children.map((f,h)=>Qk(e,f,u[h]??0,0,false)));return d+t.node.padding.top+t.node.padding.bottom}if(t.node.kind==="column"){const a=Math.max(0,n-t.node.padding.left-t.node.padding.right);const s=t.node.align==="stretch";const l=t.children.map(f=>mw(f,a,s));const u=dh(t.children.map((f,h)=>aV(e,f,l[h]??0,true)));const d=Math.max(0,t.children.length-1)*t.node.gap;return u+d+t.node.padding.top+t.node.padding.bottom}const i=Math.max(0,n-t.node.padding.left-t.node.padding.right);const o=YHe(e,t.node,h_e(t.node,t.children),i,void 0,false);return dh(o.rowSizes)+Math.max(0,o.rowSizes.length-1)*t.node.rowGap+t.node.padding.top+t.node.padding.bottom};var MJ=e=>{const t=Math.max(0,e.baseSizes.length-1)*e.gap;const n=dh(e.baseSizes.filter((s,l)=>(e.fillWeights[l]??0)<=0))+t;const r=Math.max(0,n-e.available);if(e.warnOverflow&&r>.5){const s=e.slideNumber!==void 0?`slide ${e.slideNumber}`:`slide ${e.slideId??"(unknown)"}`;const l=e.childNames?.map((u,d)=>u??`(child ${d+1})`);console.warn(`Compose ${e.kind} "${e.name??"(unnamed)"}" overflowed ${s} ${e.axis==="x"?"width":"height"} by ${r.toFixed(1)}px.`,{kind:e.kind,name:e.name,slideNumber:e.slideNumber,slideId:e.slideId,axis:e.axis,overflowPx:r,childNames:l})}const i=dh(e.fillWeights);if(i<=0){return[...e.baseSizes]}const o=Math.max(0,e.available-n);const a=o/i;return e.baseSizes.map((s,l)=>{const u=e.fillWeights[l]??0;return u>0?Math.max(s,a*u):s})};var d_e=(e,t,n,r)=>{const i=dh(t)+Math.max(0,t.length-1)*n;const o=Math.max(0,e-i);let a=n;let s=0;if(r==="center"){s=o/2}else if(r==="end"){s=o}else if(r==="between"&&t.length>1&&o>0){a=n+o/(t.length-1)}return{gap:a,offset:s}};var YHe=(e,t,n,r,i,o)=>{const a=Rqt(t,kqt(t,n));const s=Array.from({length:t.columns.length},()=>0);n.forEach(f=>{VHe({tracks:t.columns,sizes:s,start:f.column,span:f.columnSpan,gap:t.columnGap,required:y_(f.child,"x")})});const l=xqt(t.columns,s,r,t.columnGap,true);const u=Array.from({length:a.length},()=>0);n.forEach(f=>{const h=dh(l.slice(f.column,f.column+f.columnSpan))+Math.max(0,f.columnSpan-1)*t.columnGap;const m=mw(f.child,h,t.justifyItems==="stretch");const g=aV(e,f.child,m,true);VHe({tracks:a,sizes:u,start:f.row,span:f.rowSpan,gap:t.rowGap,required:g})});const d=xqt(a,u,i,t.rowGap,o);return{items:n,rows:a,columnSizes:l,rowSizes:d}};var xqt=(e,t,n,r,i)=>{const o=e.map((m,g)=>{if(m==="auto"){return t[g]??0}if(m.mode==="fixed"){return m.value}return 0});const a=Math.max(0,e.length-1)*r;const s=dh(o)+a;const l=dh(e.map(m=>m!=="auto"&&m.mode==="fr"?m.value:0));const u=n===void 0?0:Math.max(0,n-s);const d=e.map((m,g)=>({track:m,index:g})).filter(({track:m})=>m==="auto").map(({index:m})=>m);const f=l>0?u/l:0;const h=i&&l===0&&d.length>0?u/d.length:0;return e.map((m,g)=>{if(m!=="auto"&&m.mode==="fr"){return f*m.value}if(m==="auto"&&h>0){return(o[g]??0)+h}return o[g]??0})};var kqt=(e,t)=>{if(e.rows){return e.rows.length}if(t.length===0){return 0}return Math.max(...t.map(n=>n.row+n.rowSpan))};var Rqt=(e,t)=>{if(e.rows){return[...e.rows]}return Array.from({length:t},()=>e.autoRows)};var h_e=(e,t)=>{const n=e.columns.length;const r=e.rows?.length;const i=new Set;const o=[];t.forEach(a=>{const s=a.node.columnSpan;const l=a.node.rowSpan;if(s>n){throw new Error(`Grid "${e.name??"(unnamed)"}" child "${a.node.name??"(unnamed)"}" cannot span ${s} columns when only ${n} exist.`)}const u=n-s;let d=false;const f=r===void 0?Number.POSITIVE_INFINITY:r-l;for(let h=0;h<=f&&!d;h+=1){for(let m=0;m<=u;m+=1){if(!BZr(i,h,m,l,s)){continue}zZr(i,h,m,l,s);o.push({child:a,column:m,row:h,columnSpan:s,rowSpan:l});d=true;break}}if(!d){throw new Error(`Grid "${e.name??"(unnamed)"}" could not place child "${a.node.name??"(unnamed)"}" within the available tracks.`)}});return o};var BZr=(e,t,n,r,i)=>{for(let o=0;o{for(let o=0;o`${e}:${t}`;var vqt=(e,t,n,r)=>{const i=Array.from({length:e.length},()=>0);n.forEach(o=>{VHe({tracks:e,sizes:i,start:r==="x"?o.column:o.row,span:r==="x"?o.columnSpan:o.rowSpan,gap:t,required:y_(o.child,r)})});return i};var VHe=e=>{const t=e.tracks.slice(e.start,e.start+e.span);const n=Math.max(0,e.span-1)*e.gap;const r=t.map((s,l)=>({track:s,index:l})).filter(({track:s})=>s==="auto").map(({index:s})=>e.start+s);if(r.length===0){return}const i=n+dh(t.map((s,l)=>s==="auto"?e.sizes[e.start+l]??0:GHe(s)));const o=Math.max(0,e.required-i);if(o<=0){return}const a=o/r.length;r.forEach(s=>{e.sizes[s]=(e.sizes[s]??0)+a})};var _qt=(e,t)=>{const n=t==="x"?e.node.width:e.node.height;const r=t==="x"?e.intrinsicWidth:e.intrinsicHeight;return l5(n,r)};var y_=(e,t)=>{const n=t==="x"?e.node.width:e.node.height;const r=t==="x"?e.intrinsicWidth:e.intrinsicHeight;return n.mode==="fill"?r:l5(n,r)};var Tqt=(e,t)=>{const n=e.node.position;const r=y_(e,t);if(!n){return r}const i=t==="x"?n.left:n.top;const o=t==="x"?n.right:n.bottom;return r+(i??0)+(o??0)};var l5=(e,t)=>{if(e.mode==="fill"){return 0}if(e.mode==="fixed"){return e.value}if(e.mode==="wrap"){return Math.min(t,e.max)}return t};var $He=(e,t,n)=>{const r=e.presentation;const i=BHe(t.value,t.transform);const o=OHe(t.value,t.transform);const a=t.width;const s=t.height;const l=n??(a.mode==="fixed"?a.value:a.mode==="wrap"?a.max:a.mode==="fill"?UHe:UHe);if(r){const{textStyleProto:u,paragraphStyle:d}=VZr(r,t.style);const f=u?.wrap===1;const h=!f&&(a.mode==="wrap"||a.mode==="fixed"||a.mode==="fill"||n!==void 0);const m=h?{...u??{},wrap:u?.wrap??2}:u;const g=UZr(o,l,UHe,m,d);const x=P7e({element:g,presentation:r,slide:e.slide,wrap:h,resolvedStyle:m});const w=a.mode==="fixed"?a.value:a.mode==="wrap"?Math.min(x.width,a.max):a.mode==="fill"?0:x.width;const _=s.mode==="fixed"?s.value:s.mode==="fill"?0:x.height;return{width:Math.max(0,w),height:Math.max(0,_)}}return $Zr(i,a,s,n)};var UZr=(e,t,n,r,i)=>{const o=Qi(Math.max(1,t));const a=Qi(Math.max(1,n));return{id:"compose-text-measure",type:1,bbox:{xEmu:0,yEmu:0,widthEmu:o??0,heightEmu:a??0},paragraphs:e.map(s=>({...s,id:"",runs:(s.runs??[]).map(l=>({...l,id:"",citations:[...l.citations??[]],reviewMarkIds:[...l.reviewMarkIds??[]]})),textStyle:r,paragraphStyle:i||s.paragraphStyle?{tabStops:[],...i??{},...s.paragraphStyle??{}}:void 0})),textStyle:r,effects:[],children:[],levelsStyles:[],citations:[]}};var VZr=(e,t)=>{const n=PX(t);const r={topInset:0,rightInset:0,bottomInset:0,leftInset:0};const i=a=>({...a??{},topInset:a?.topInset??r.topInset,rightInset:a?.rightInset??r.rightInset,bottomInset:a?.bottomInset??r.bottomInset,leftInset:a?.leftInset??r.leftInset});if(!n){return{textStyleProto:{...r},paragraphStyle:void 0}}if(typeof n==="string"){const a=e.styles.resolveTextStyle(n);return{textStyleProto:i(a?.toProto()),paragraphStyle:a?.lineSpacing!==void 0?{lineSpacingPercent:Math.round(a.lineSpacing*1e5),tabStops:[]}:void 0}}const o=new ko;Uf(o,n);return{textStyleProto:i(o.toProto()),paragraphStyle:n.lineSpacing!==void 0?{lineSpacingPercent:Math.round(n.lineSpacing*1e5),tabStops:[]}:void 0}};var $Zr=(e,t,n,r)=>{const i=8;const o=20;const a=e.length>0?e.split(/\r?\n/):[""];const s=Math.max(0,...a.map(h=>h.length));const l=s*i+4;let u=l;if(r!==void 0){u=r}else if(t.mode==="fixed"){u=t.value}else if(t.mode==="wrap"){u=Math.min(l,t.max)}else if(t.mode==="fill"){u=0}let d=Math.max(1,a.length);if(u>0&&(r!==void 0||t.mode==="wrap"||t.mode==="fixed")){d=a.reduce((h,m)=>{const g=Math.max(1,Math.floor(u/i));return h+Math.max(1,Math.ceil(m.length/g))},0)}let f=d*o;if(n.mode==="fixed"){f=n.value}else if(n.mode==="fill"){f=0}return{width:Math.max(0,u),height:Math.max(0,f)}};var Iqt=e=>{const t=e;if(typeof t.getPresentation==="function"){return t.getPresentation()}return t.presentation};var wqt=e=>e!=="auto"&&e.mode==="fr";var GHe=e=>{if(e==="auto"){return 0}if(e.mode==="fixed"){return e.value}return 0};var fC=(e,t)=>({left:e.left+t.left,top:e.top+t.top,width:Math.max(0,e.width-t.left-t.right),height:Math.max(0,e.height-t.top-t.bottom)});var Eqt=(e,t,n,r)=>{if(r==="start"||r==="stretch"){return e}if(r==="center"){return e+(t-n)/2}return e+(t-n)};var O0=(e,t,n,r,i,o=false)=>{if(i===void 0||r==="start"||r==="stretch"){return{start:Eqt(e,t,n,r),size:n}}const a=Math.max(1,i/4);const s=o?n:Math.max(1,HHe(n,Math.max(1,i/2)));if(r==="center"){const l=IJ(e+t/2,a);return{start:l-s/2,size:s}}if(r==="end"){const l=IJ(e+t,a);return{start:l-s,size:s}}return{start:IJ(Eqt(e,t,s,r),a),size:s}};var dh=e=>e.reduce((t,n)=>t+n,0);var hC=(e,t,n)=>Jk(e,t,WHe(e,t,n));var Jk=(e,t,n)=>{const r=km(e,"x");const i=km(e,"y");return GZr(t,n,{preserveWidth:r,preserveHeight:i,ceilHeight:e.node.kind==="text"})};var GZr=(e,t,n={})=>{if(t===void 0){return e}const r=Math.max(1,n.preserveWidth?e.width:HHe(e.width,t));const i=Math.max(1,n.preserveHeight?e.height:n.ceilHeight?HZr(e.height,t):HHe(e.height,t));const o=n.preserveWidth&&e.width<=t?1:t;const a=n.preserveHeight&&e.height<=t?1:t;return{left:IJ(e.left,o),top:IJ(e.top,a),width:r,height:i}};var km=(e,t)=>(t==="x"?e.node.width:e.node.height).mode==="fixed";var IJ=(e,t)=>{if(t===void 0){return e}return Math.round(e/t)*t};var HHe=(e,t)=>{if(t===void 0){return e}return Math.round(e/t)*t};var HZr=(e,t)=>{if(t===void 0){return e}return Math.ceil(e/t)*t};var Mqt=e=>{if(e===void 0){return void 0}if(!Number.isFinite(e)||e<=0){throw new Error("slide.compose baseUnit must be a positive number.")}return e};var Lqt=(e,t)=>{if(!Number.isFinite(e.left)||!Number.isFinite(e.top)||!Number.isFinite(e.width)||!Number.isFinite(e.height)){throw new Error(`${t} must include finite left/top/width/height values.`)}if(e.width<=0||e.height<=0){throw new Error(`${t} width and height must be positive.`)}return e};var qHe=(e,t,n)=>{if(e.mode==="fill"){return n}if(e.mode==="fixed"){return e.value}if(e.mode==="wrap"){return Math.min(e.max,t)}return t};var Dqt=(e,t,n,r)=>{const i=t.node.height;if(i.mode==="fill"){return r}if(i.mode==="fixed"){return i.value}const o=u_e(e,t,n);if(i.mode==="wrap"){return Math.min(o,i.max)}return o};var Zk=e=>e.width>0&&e.height>0;var RJ=(e,t)=>`${e}.${t}`;var PJ=e=>({top:Md(e.top),right:Md(e.right),bottom:Md(e.bottom),left:Md(e.left)});var WZr=e=>{const t={};if(e.left!==void 0){t.left=Md(e.left)}if(e.top!==void 0){t.top=Md(e.top)}if(e.right!==void 0){t.right=Md(e.right)}if(e.bottom!==void 0){t.bottom=Md(e.bottom)}return t};var Cqt=e=>{if(e.mode==="hug"){return{mode:"hug"}}if(e.mode==="fill"){return{mode:"fill",value:Md(e.value)}}if(e.mode==="fixed"){return{mode:"fixed",value:Md(e.value)}}return{mode:"wrap",max:Md(e.max)}};var Fqt=e=>{if(e==="auto"){return"auto"}if(e.mode==="fixed"){return{mode:"fixed",value:Md(e.value)}}return{mode:"fr",value:Md(e.value)}};var c_e=e=>e.map(t=>Fqt(t));var YZr=e=>{if("path"in e){return{kind:"path",path:e.path}}if("dataUrl"in e){return{kind:"dataUrl"}}if("blob"in e){return{kind:"blob"}}if("uri"in e){return{kind:"uri",uri:e.uri}}return{kind:"prompt",prompt:e.prompt}};var f_e=e=>{if(e===void 0){return void 0}return typeof e==="string"?e:e.name||e.id};var g_=e=>({left:Md(e.left),top:Md(e.top),width:Md(e.width),height:Md(e.height)});var Md=e=>Math.round(e*100)/100;var Spa=(e,t,n={})=>{return XHe(e,t,n).elements};var XHe=(e,t,n={})=>{const{placements:r,materializedPaths:i,run:o}=Sqt(e,t,n);const a=r.map(d=>qZr(e,d));const s=new Map;const l=new Map;const u=Math.min(i.length,a.length);for(let d=0;d{if(t.kind==="text"){const i=e.shapes.add({geometry:"textbox",position:t.frame});if(t.name){i.name=t.name}if(t.style){if(typeof t.style==="string"){i.text.style=t.style}else{i.text.style={...t.style,insets:t.style.insets??{top:0,right:0,bottom:0,left:0}}}}i.text.set(t.value);if(typeof t.style==="string"){i.text.insets={top:0,right:0,bottom:0,left:0}}else if(!t.style?.insets){i.text.insets={top:0,right:0,bottom:0,left:0}}if(t.shadow!==void 0){i.text.shadow=t.shadow}if(typeof t.value!=="string"){const o=S0(t.value);o.forEach((a,s)=>{const l=i.text.paragraphs.items[s];if(!l||!a.paragraphStyle){return}l.paragraphStyle={...l.paragraphStyle??{},...a.paragraphStyle}})}return i}if(t.kind==="shape"){const i=QZr(t.fill)??"none";const o=Uqt(t.line);const a=(()=>{if(t.geometry==="custom"){const s=t.customPaths;if(!s||s.length===0){throw new Error('compose.shape geometry "custom" requires at least one custom path.')}return e.shapes.add({geometry:"custom",position:t.frame,fill:i,line:o,customPaths:s})}return e.shapes.add({geometry:t.geometry,position:t.frame,fill:i,line:o})})();if(t.name){a.name=t.name}if(t.borderRadius!==void 0){a.borderRadius=t.borderRadius}if(t.shadow!==void 0){a.shadow=t.shadow}return a}if(t.kind==="connector"){return KZr(e,t)}if(t.kind==="image"){const i=e.images.add({...t.source,contentType:t.contentType,position:t.frame,fit:t.fit,alt:t.alt,geometry:t.geometry,borderRadius:t.borderRadius,crop:t.crop});if(t.name){i.name=t.name}if(t.lockAspectRatio!==void 0){i.lockAspectRatio=t.lockAspectRatio}if(t.rotation!==void 0){i.rotation=t.rotation}if(t.flipHorizontal!==void 0){i.flipHorizontal=t.flipHorizontal}if(t.flipVertical!==void 0){i.flipVertical=t.flipVertical}return i}if(t.kind==="table"){const i=e.tables.add({rows:t.rows,columns:t.columns,left:t.frame.left,top:t.frame.top,width:t.frame.width,height:t.frame.height,values:t.values,columnWidths:t.columnWidths,columnTracks:t.columnTracks});if(t.name){i.name=t.name}if(t.style){i.style=t.style}if(t.styleOptions){i.styleOptions=t.styleOptions}return i}if(t.kind==="chart"){const i=e.charts.add(t.chartType,t.config);i.position=t.frame;if(t.name){i.name=t.name}return i}const n=eJr(nJr(t.stroke,t.opacity));const r=e.shapes.add({geometry:"rect",position:t.frame,fill:n,line:{style:"solid",width:0,fill:n}});if(t.name){r.name=t.name}return r};var ox=1;var XZr="none";var jZr={style:"solid",width:0,fill:"none"};var KZr=(e,t)=>{const n=zqt(t,"from");const r=zqt(t,"to");const i=JZr(t,n,r);const o=Oqt(e,t.fromElement,"from");const a=Oqt(e,t.toElement,"to");const s=o?o:Nqt(e,t.name?`${t.name}:from-anchor`:void 0,n,i.from);const l=a?a:Nqt(e,t.name?`${t.name}:to-anchor`:void 0,r,i.to);const u=Bqt(e,s,t.fromIdx,t.fromSide,i.from,"from");const d=Bqt(e,l,t.toIdx,t.toSide,i.to,"to");const f=e.shapes.add({geometry:"connector",kind:t.connectorKind,from:s,fromIdx:u,to:l,toIdx:d,line:Uqt(t.line),head:t.head,tail:t.tail,cap:t.cap,join:t.join});if(t.name){f.name=t.name}return f};var Nqt=(e,t,n,r)=>{return e.shapes.add({geometry:"ellipse",name:t,position:ZZr(n,r),fill:XZr,line:jZr})};var Oqt=(e,t,n)=>{if(t===void 0){return void 0}const r=e.shapes.getById(t);if(r){return r}const i=e.elements.items.find(o=>o instanceof $u&&o.name===t);if(i){return i}throw new Error(`compose.connector ${n}Element target "${t}" was not found.`)};var Bqt=(e,t,n,r,i,o)=>{if(n!==void 0){if(!Number.isFinite(n)){throw new Error(`compose.connector ${o}Idx must be finite.`)}return n}if(r!==void 0){return e.shapes.getConnectionSiteIndex(t,r)}return i};var zqt=(e,t)=>{const n=t==="from"?e.from:e.to;if(n){return{left:e.frame.left+n.left,top:e.frame.top+n.top}}if(e.orientation==="vertical"){return t==="from"?{left:e.frame.left+e.frame.width/2,top:e.frame.top}:{left:e.frame.left+e.frame.width/2,top:e.frame.top+e.frame.height}}return t==="from"?{left:e.frame.left,top:e.frame.top+e.frame.height/2}:{left:e.frame.left+e.frame.width,top:e.frame.top+e.frame.height/2}};var ZZr=(e,t)=>{switch(t){case 0:return{left:e.left-ox/2,top:e.top,width:ox,height:ox};case 1:return{left:e.left,top:e.top-ox/2,width:ox,height:ox};case 2:return{left:e.left-ox/2,top:e.top-ox,width:ox,height:ox};case 3:return{left:e.left-ox,top:e.top-ox/2,width:ox,height:ox};default:throw new Error(`Unsupported connector anchor site index ${t}.`)}};var JZr=(e,t,n)=>{if(e.orientation==="vertical"){return n.top>=t.top?{from:2,to:0}:{from:0,to:2}}return n.left>=t.left?{from:3,to:1}:{from:1,to:3}};var QZr=e=>{if(e===void 0){return void 0}return new gi(e).toConfig({preserveProto:false})};var Uqt=e=>{if(e===void 0){return void 0}return new eo(e).toConfig({preserveProto:false})};var eJr=e=>{const t=new Mi(e).toConfig();if(t===void 0){return{type:"none"}}if(typeof t==="string"){return t}return{type:"solid",color:t}};var Vqt=(e,t)=>{const n=t.get(e.path);if(n){e.element=n}e.children.forEach(r=>Vqt(r,t))};var tJr=e=>{const t=e.toSnapshot();return{aid:t.aid,id:t.id,kind:t.kind==="image"||t.kind==="table"||t.kind==="chart"?t.kind:"shape"}};var nJr=(e,t)=>{if(t===void 0||t>=1){return e}if(t<=0){return"rgba(0, 0, 0, 0)"}if(typeof e==="string"){const n=rJr(e,t);return n??e}if(e.type==="rgb"){const n={...e.transform??{},opacity:t};return{...e,transform:n}}if(e.type==="theme"){const n={...e.transform??{},opacity:t};return{...e,transform:n}}return e};var rJr=(e,t)=>{const n=/^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(e.trim());if(n){const[i,o,a]=iJr(n[1]??"");return`rgba(${i}, ${o}, ${a}, ${t})`}const r=/^rgba?\(\s*(\d{1,3})\s*(?:,\s*|\s+)(\d{1,3})\s*(?:,\s*|\s+)(\d{1,3})(?:\s*(?:\/|,)\s*([\d.]+%?))?\s*\)$/i.exec(e.trim());if(r){const i=Number(r[1]??0);const o=Number(r[2]??0);const a=Number(r[3]??0);const s=oJr(r[4])??1;return`rgba(${i}, ${o}, ${a}, ${s*t})`}return void 0};var iJr=e=>{if(e.length===3){const t=e.split("").map(n=>`${n}${n}`).join("");return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)]}return[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]};var oJr=e=>{if(!e){return void 0}const t=e.trim();if(!t){return void 0}if(t.endsWith("%")){const r=Number(t.slice(0,-1));if(!Number.isFinite(r)){return void 0}return Math.min(1,Math.max(0,r/100))}const n=Number(t);if(!Number.isFinite(n)){return void 0}return Math.min(1,Math.max(0,n))};var p_e=class{#e;#t;#n=0;constructor(t,n){this.#e=t;this.#t=n}textStyles(t){const n=this.#e();if(!n){throw new Error("slide.theme.textStyles(...) requires a slide that belongs to a presentation.")}const r=this.#n;this.#n+=1;const i={};const o={};for(const[a,s]of Object.entries(t)){const l=["slide",$qt(this.#t),"compose",String(r),$qt(a)].join(".");i[l]=s;o[a]=l}n.theme.textStyles(i);return o}};var $qt=e=>{const t=e.trim();const n=t.replace(/[^a-zA-Z0-9]+/g,"_");return n.length>0?n:"token"};function LJ(e,t){const n=e.renderStyleData;const r=[...t,e];let i;let o;let a;let s;let l;let u;let d;let f;let h;let m;let g;let x=e;for(const w of r){const _=w.renderStyleData;if(_.geometry!==void 0&&_.geometry!==0){i=_.geometry;o=_.preset}if(_.adjustmentList.length>0){a=_.adjustmentList}if(_.customPaths.length>0){s=_.customPaths}if(_.fill!==void 0){l=_.fill;x=w}if(_.line!==void 0){u=_.line}if(_.effects!==void 0){d=_.effects}if(_.fillReference!==void 0){f=_.fillReference}if(_.lineReference!==void 0){h=_.lineReference}if(_.effectReference!==void 0){m=_.effectReference}if(_.useBackgroundFill!==void 0){g=_.useBackgroundFill}}return{source:{...n,geometry:i,preset:o,adjustmentList:a??n.adjustmentList,customPaths:s??n.customPaths,fill:l,line:u,effects:d,fillReference:f,lineReference:h,effectReference:m,useBackgroundFill:g},pictureFillSource:x}}var aJr="openai.presentation.layout/v4";var sJr="application/vnd.openai.presentation-layout+json";var lJr=Object.entries(yf).reduce((e,[t,n])=>{if(e[n]===void 0){e[n]=t}return e},{});function cJr(e,t){const n=e.getPresentation();const r=new Map;const i=uJr(e);const o=EJr(e,i);t.forEach((f,h)=>{Xqt(f.root,h+1,r)});const a=e.elements.items.map((f,h)=>jqt({scope:"slide",order:h+1,modelElement:f,slide:e,presentation:n,protoElement:i.get(f),composeSource:r.get(Kqt(f).aid),textLayout:o.get(f.id)}));YJr(a);const s=n&&e.useLayoutId?n.layouts.getById(e.useLayoutId):void 0;const l=n&&s?.parentLayoutId?n.layouts.getById(s.parentLayoutId):void 0;const u=n?pJr(n,e,s,l,i):void 0;const d=mJr(n,a,u);return{schema:aJr,unit:"px",slide:{aid:`sl/${e.id}`,id:e.id,slide:e.slideNumber,layoutId:s?.id,layoutName:nc(s?.name),layoutType:nc(s?.type),masterLayoutId:l?.id,masterLayoutName:nc(l?.name),backgroundColor:eXt(e.toProto().background),backgroundImage:tXt(e.toProto().background,n),frame:Yqt(e.frame)},theme:d,inheritedLayers:u,elements:a,composeRuns:t.map((f,h)=>({index:h+1,frame:Yqt(f.frame),baseUnit:f.baseUnit,root:f.root}))}}function qqt(e,t){const n=cJr(e,t);return new Blob([JSON.stringify(n,null,2)],{type:sJr})}function uJr(e){const t=e.resolveRenderContext();const n=new Map;t.drawElements.forEach((r,i)=>{const o=t.drawElementProtos[i];if(o){n.set(r,o)}});return n}function Xqt(e,t,n){if(e.element?.aid){n.set(e.element.aid,{run:t,path:e.path})}e.children.forEach(r=>Xqt(r,t,n))}function jqt(e){const t=Kqt(e.modelElement);const n=AJr(e);const r=e.modelElement instanceof N0?MJr(e.modelElement,e.presentation):void 0;const i=r!==void 0?LJr(r):nc(t.preview);const o=kJr(e.protoElement)??nc(t.text)??i;const a=r!==void 0?xJr(r)??Hqt(e,t.frame):Hqt(e,t.frame);return{order:e.order,kind:yJr(t.kind),scope:e.scope,aid:e.aid??t.aid,id:t.id,name:nc(t.name),bbox:a,rotation:gl(e.modelElement.rotation??t.frame?.rotation),horizontalFlip:e.modelElement.position.horizontalFlip===true||t.frame?.horizontalFlip===true?true:void 0,verticalFlip:e.modelElement.position.verticalFlip===true||t.frame?.verticalFlip===true?true:void 0,hidden:e.protoElement?.hidden===true?true:void 0,composeSource:e.composeSource,geometry:QJr(t,e.protoElement),text:o,textPreview:Zqt(o),resolvedFontSize:e.scope==="slide"?vJr(e.modelElement,e.slide,e.protoElement):void 0,resolvedTextStyle:e.scope==="slide"?_Jr(e.modelElement,e.slide,e.protoElement):Qqt(m_e(e.modelElement,e.presentation))??DJ(e.modelElement.textStyle,e.presentation),textLayout:e.textLayout,paragraphs:n,fillColor:KJr(e.protoElement),lineColor:ZJr(e.protoElement),lineWidth:JJr(e.protoElement),alt:nc(t.alt),chartType:nc(t.chartType),rows:typeof t.rows==="number"&&Number.isFinite(t.rows)?t.rows:void 0,cols:typeof t.cols==="number"&&Number.isFinite(t.cols)?t.cols:void 0,contentType:nc(t.contentType),imageCrop:dJr(e.modelElement),imageFit:fJr(e.modelElement),imageMask:hJr(e.modelElement),prompt:nc(t.prompt),isPlaceholder:t.isPlaceholder===true?true:void 0,asset:HJr(e.modelElement),fillImage:WJr(e.protoElement,e.presentation),cells:r}}function dJr(e){if(!(e instanceof ug)){return void 0}return e.crop}function fJr(e){if(!(e instanceof ug)){return void 0}return nc(e.fit)}function hJr(e){if(!(e instanceof ug)){return void 0}const t=e.resolveImageMask();if(!t){return void 0}const n=t.adjustmentList.length>0?t.adjustmentList.map(r=>({name:nc(r.name),formula:nc(r.formula)})):void 0;return{geometry:t.geometry,adjustmentList:n}}function pJr(e,t,n,r,i){const o=[];const a=(s,l)=>{if(!l){return}const u=new Map(l.toProto().elements.map(h=>[h.id??"",h]));const d=s==="master"&&t.showMasterShapes===false?l.elements.filter(h=>h.placeholderIndex!==void 0||h.placeholderType!==void 0):l.elements;const f=d.map((h,m)=>jqt({scope:s,order:m+1,modelElement:h,slide:t,presentation:e,protoElement:i.get(h)??u.get(h.id),aid:`template/${s}/${l.id}/${h.id}`}));o.push({scope:s,id:l.id,name:nc(l.name),type:nc(l.type),parentLayoutId:nc(l.parentLayoutId),backgroundColor:eXt(l.toProto().background),backgroundImage:tXt(l.toProto().background,e),elements:f})};a("layout",n);a("master",r);return o.length>0?o:void 0}function mJr(e,t,n){if(!e){return void 0}const r=new Set;const i=gJr(e.theme.fontScheme);b_(r,i?.majorFont?.latinTypeface);b_(r,i?.minorFont?.latinTypeface);const o=s=>{b_(r,s.resolvedTextStyle?.typeface);b_(r,s.resolvedTextStyle?.name);s.paragraphs?.forEach(l=>{b_(r,l.resolvedTextStyle?.typeface);b_(r,l.resolvedTextStyle?.name);l.runs.forEach(u=>b_(r,u.typeface))});s.cells?.forEach(l=>{b_(r,l.resolvedTextStyle?.typeface);b_(r,l.resolvedTextStyle?.name);l.paragraphs?.forEach(u=>{b_(r,u.resolvedTextStyle?.typeface);b_(r,u.resolvedTextStyle?.name);u.runs.forEach(d=>b_(r,d.typeface))})})};t.forEach(o);n?.forEach(s=>{s.elements.forEach(o)});const a={colorSchemeName:nc(e.theme.colorScheme.name),colors:e.theme.hexColorMap,fontScheme:i,typefaces:r.size>0?Array.from(r).sort():void 0};return Object.values(a).some(s=>s!==void 0)?a:void 0}function b_(e,t){const n=nc(t);if(n){e.add(n)}}function gJr(e){if(!e){return void 0}const t={name:nc(e.name),majorFont:Gqt(e.majorFont),minorFont:Gqt(e.minorFont)};return Object.values(t).some(n=>n!==void 0)?t:void 0}function Gqt(e){if(!e){return void 0}const t={latinTypeface:nc(e.latinTypeface),eastAsianTypeface:nc(e.eastAsianTypeface),complexScriptTypeface:nc(e.complexScriptTypeface)};return Object.values(t).some(n=>n!==void 0)?t:void 0}function Kqt(e){return e.toSnapshot()}function yJr(e){if(e==="image"||e==="table"||e==="chart"){return e}return"shape"}function jHe(e){if(!e){return void 0}const t=gl(e.left);const n=gl(e.top);const r=gl(e.width);const i=gl(e.height);if(t===void 0||n===void 0||r===void 0||i===void 0){return void 0}return[t,n,r,i]}function Hqt(e,t){const n=jHe(t);if(bJr(n)){return n}if(e.scope!=="slide"||!e.presentation||e.protoElement===void 0){return n}const r=$f(e.protoElement,e.presentation,e.slide);return jHe({left:r.x,top:r.y,width:r.width,height:r.height})}function bJr(e){const t=e?.[2];const n=e?.[3];return e!==void 0&&e.length>=4&&t!==void 0&&n!==void 0&&Number.isFinite(t)&&Number.isFinite(n)&&t>0&&n>0}function xJr(e){const t=e.map(a=>KHe(a.bbox)).filter(a=>a!==void 0);if(t.length===0){return void 0}const n=Math.min(...t.map(a=>a.left));const r=Math.min(...t.map(a=>a.top));const i=Math.max(...t.map(a=>a.right));const o=Math.max(...t.map(a=>a.bottom));return[gl(n)??n,gl(r)??r,gl(i-n)??i-n,gl(o-r)??o-r]}function Zqt(e,t=140){if(!e){return void 0}const n=e.replace(/\r?\n/g," | ").trim();if(!n){return void 0}if(n.length<=t){return n}return`${n.slice(0,Math.max(1,t-3))}...`}function vJr(e,t,n){const r=t.getPresentation();const i=m_e(e,r).map(u=>u.fontSize).filter(u=>typeof u==="number"&&Number.isFinite(u));if(i.length>0){return gl(Math.max(...i))}if(!n?.paragraphs?.length){return void 0}if(!r){return void 0}const o=A0(n,r,t);const a=o.fontSize;if(typeof a!=="number"||!Number.isFinite(a)){return void 0}const s=o.autoFit?.normalAutoFit?.fontScale;const l=typeof s==="number"&&Number.isFinite(s)?s/1e5:1;return gl(a/100*(96/72)*l)}function _Jr(e,t,n){const r=t.getPresentation();const i=m_e(e,r);const o=i.find(s=>{const l=s.fontSize;return typeof l==="number"&&Number.isFinite(l)});const a=n?.paragraphs?.length&&r?DJ(A0(n,r,t),r,{includeTextFrameDefaults:true}):void 0;if(o&&a){return TJr(o,a)}return o??a}function TJr(e,t){const n=T1(e,t);return wJr(n,t)}function wJr(e,t){const n={...e};if(t.anchor!==void 0){n.anchor=t.anchor}if(t.vertical!==void 0){n.vertical=t.vertical}if(t.rotation!==void 0){n.rotation=t.rotation}if(t.verticalAlignment!==void 0){n.verticalAlignment=t.verticalAlignment}if(t.wrap!==void 0){n.wrap=t.wrap}if(t.autoFit!==void 0){n.autoFit=t.autoFit}if(t.autoFitScale!==void 0){n.autoFitScale=t.autoFitScale}if(t.autoFitLineSpaceReduction!==void 0){n.autoFitLineSpaceReduction=t.autoFitLineSpaceReduction}if(t.insets!==void 0){n.insets=t.insets}if(t.useParagraphSpacing!==void 0){n.useParagraphSpacing=t.useParagraphSpacing}return n}function EJr(e,t){const n=e.getPresentation();if(!n){return new Map}const{themeMap:r}=e.resolveRenderContext();const i=ZA();const o=new Map;e.elements.items.forEach(a=>{const s=t.get(a);const l=s?.id;if(!l||!s.paragraphs?.length){return}const u=A0(s,n,e);const d=u?.wrap===1?false:true;const f=u?.autoFit?.normalAutoFit?.fontScale;const h=typeof f==="number"&&Number.isFinite(f)?f/1e5:1;const m=Vz({element:s,bboxPx:$f(s,n,e),source:SJr(a,e)});const g=ed(s,i,r,void 0,{mode:"layout",resolvedStyle:u,masterDefaults:ik(s,n,e),bboxPx:m,wrap:d,textScale:h});if(!g){return}o.set(l,CJr(g))});return o}function CJr(e){return{lineCount:e.lines.length,lines:e.lines.map((t,n)=>({index:n+1,text:t.segments.map(r=>r.text).join("")}))}}function SJr(e,t){if(!(e instanceof $u)){return void 0}const n=t.getInheritedPlaceholderShapes(e);if(n.length>0){return LJ(e,n).source}return e.renderStyleData}function AJr(e){const t=RJr(Jqt(e.modelElement,e.presentation),e.protoElement);if(e.scope!=="slide"||t===void 0||e.protoElement===void 0){return t}return PJr(t,e.protoElement,e.slide)}function kJr(e){if(!e?.paragraphs?.length){return void 0}return nc(e.paragraphs.map(t=>(t.runs??[]).map(n=>n.text).join("")).join("\n"))}function RJr(e,t){if(!e||!t){return e}return e.map(n=>{const r=t.paragraphs?.[n.index-1];if(!r){return n}const i=n.runs.map(a=>({...a,text:r.runs?.[a.index-1]?.text??a.text})).filter(a=>a.text.length>0);const o=nc((r.runs??[]).map(a=>a.text).join(""));return{...n,...o!==void 0?{text:o}:{},runs:i}})}function PJr(e,t,n){const r=Yme(t,n);if(r.length===0){return e}return e.map((i,o)=>{const a=t.paragraphs?.[o];if(!a){throw new Error(`missing paragraph proto at index ${o}`)}const s=qme(r,a);if(!s){return i}return{...i,bulletCharacter:i.bulletCharacter??s.paragraphStyle?.bulletCharacter,marginLeft:i.marginLeft??gl(s.paragraphStyle?.marginLeft),indent:i.indent??gl(s.paragraphStyle?.indent),lineSpacingPercent:i.lineSpacingPercent??gl(s.paragraphStyle?.lineSpacingPercent),spaceBefore:i.spaceBefore??gl(s.spaceBefore),spaceAfter:i.spaceAfter??gl(s.spaceAfter)}})}function Jqt(e,t){const n=e.paragraphs.items.map((r,i)=>{const o=r.runs.items.map((x,w)=>{const _=DJ(IJr(r,x),t);return{index:w+1,text:x.text,..._}}).filter(x=>x.text.length>0);const a=nc(r.toPlainText());if(!a&&o.length===0){return void 0}const s=DJ(r.resolvedTextStyle??r.textStyle,t);const l=r.bulletCharacter;const u=gl(r.marginLeft);const d=gl(r.indent);const f=gl(r.lineSpacingPercent);const h=gl(r.spaceBefore);const m=gl(r.spaceAfter);const g=nc(r.styleId);return{index:i+1,...a!==void 0?{text:a}:{},...l!==void 0?{bulletCharacter:l}:{},...u!==void 0?{marginLeft:u}:{},...d!==void 0?{indent:d}:{},...f!==void 0?{lineSpacingPercent:f}:{},...h!==void 0?{spaceBefore:h}:{},...m!==void 0?{spaceAfter:m}:{},...g!==void 0?{styleId:g}:{},...s!==void 0?{resolvedTextStyle:s}:{},runs:o}}).filter(r=>r!==void 0);return n.length>0?n:void 0}function m_e(e,t){return e.paragraphs.items.flatMap(n=>n.runs.items.map(r=>DJ(r.resolvedTextStyle,t)).filter(r=>r!==void 0))}function IJr(e,t){return t.resolvedTextStyle??t.textStyle??e.resolvedTextStyle??e.textStyle}function MJr(e,t){const n=e.rows;if(n.length===0){return void 0}const r=DJr(e);const i=FJr(e);const o=e.frame;const a=[];let s=o?.top??0;let l=0;n.forEach((u,d)=>{let f=o?.left??0;const h=i[d]??0;u.cells.forEach((m,g)=>{const x=Math.max(1,m.gridSpan??1);const w=Math.max(1,m.rowSpan??1);const _=Wqt(r,g,x);const C=Wqt(i,d,w);const A=Jqt(m,t);const P=m_e(m,t);const L=Qqt(P);const I=nc(m.value);const N=m.fill.color.toConfig();a.push({index:++l,row:d+1,column:g+1,rowSpan:w>1?w:void 0,colSpan:x>1?x:void 0,bbox:o!==void 0?jHe({left:f,top:s,width:_,height:C}):void 0,text:I,textPreview:Zqt(I),textDirection:nc(m.textDirection),fillColor:N,resolvedTextStyle:L,paragraphs:A});f+=r[g]??0});s+=h});return a.length>0?a:void 0}function LJr(e){if(e.length===0){return void 0}const t=new Map;e.forEach(n=>{if(!n.text){return}const r=t.get(n.row)??[];r.push(n.text);t.set(n.row,r)});if(t.size===0){return void 0}return Array.from(t.entries()).sort(([n],[r])=>n-r).map(([,n])=>n.join(" | ")).join("\n")}function DJr(e){const t=e.columnCount;if(t<=0){return[]}const n=e.columnWidths;if(e.hasExplicitColumnWidths&&n.length>0){const i=n.map(a=>Number.isFinite(a)&&a>0?a:1);if(i.length>=t){return i.slice(0,t)}const o=i[i.length-1]??1;return i.concat(new Array(t-i.length).fill(o))}const r=e.frame?.width;if(r&&Number.isFinite(r)&&r>0){const i=r/t;return new Array(t).fill(i)}return new Array(t).fill(1)}function FJr(e){const t=e.rows;const n=t.length;if(n<=0){return[]}const r=t.map(o=>o.height);if(r.some(o=>o>0)){const o=e.frame?.height;const a=r.reduce((u,d)=>u+(d>0?d:0),0);const s=r.filter(u=>u<=0).length;const l=o&&s>0&&o>a?(o-a)/s:1;return r.map(u=>u>0?u:l)}const i=e.frame?.height;if(i&&Number.isFinite(i)&&i>0){const o=i/n;return new Array(n).fill(o)}return new Array(n).fill(1)}function Wqt(e,t,n){let r=0;for(let i=t;i{const n=t.fontSize;return typeof n==="number"&&Number.isFinite(n)})??e[0]}function DJ(e,t,n){if(!e){return void 0}const r={anchor:e.anchor,vertical:e.vertical,rotation:gl(e.rotation),fontSize:eQr(e.fontSize),name:nc(e.name),family:e.family,scheme:nc(e.scheme),typeface:Bz(e.typeface,t?.theme.fontScheme),color:NJr(e),bold:e.bold===true?true:void 0,italic:e.italic===true?true:void 0,alignment:dE(e.alignment),verticalAlignment:BJr(e.anchor),lineSpacing:gl(e.lineSpacing),textTransform:OJr(e.capitalization),wrap:zJr(e.wrap),autoFit:UJr(e.autoFit),autoFitScale:VJr(e),autoFitLineSpaceReduction:$Jr(e),insets:GJr(e,n),useParagraphSpacing:e.useParagraphSpacing===true?true:void 0};return Object.values(r).some(i=>i!==void 0)?r:void 0}function NJr(e){const t=e.color?.toConfig();if(t!==void 0){return t}const n=e.fill;if(!n){return void 0}if(n instanceof gi){return n.color.toConfig()}return new gi({type:"proto",proto:n}).color.toConfig()}function OJr(e){if(e===1){return"none"}if(e===3){return"uppercase"}if(e===2){return"smallCaps"}return void 0}function BJr(e){return e===void 0?void 0:gz[e]}function zJr(e){if(e===void 0){return void 0}if(e==="square"||e==="none"){return e}return Ipe[e]}function UJr(e){if(e===void 0){return void 0}if(e==="none"||e==="shrinkText"||e==="resizeShapeToFitText"){return e}if(e.noAutofit){return"none"}if(e.normalAutoFit){return"shrinkText"}if(e.shapeAutoFit){return"resizeShapeToFitText"}return void 0}function VJr(e){if(e.autoFitScale!==void 0){return gl(e.autoFitScale)}const t=e.autoFit;if(t===void 0||t==="none"||t==="shrinkText"||t==="resizeShapeToFitText"){return void 0}const n=t.normalAutoFit?.fontScale;return n===void 0?void 0:gl(n/1e5)}function $Jr(e){if(e.autoFitLineSpaceReduction!==void 0){return gl(e.autoFitLineSpaceReduction)}const t=e.autoFit;if(t===void 0||t==="none"||t==="shrinkText"||t==="resizeShapeToFitText"){return void 0}return gl(t.normalAutoFit?.lineSpaceReduction)}function GJr(e,t){const n=t?.includeTextFrameDefaults?cg(e):nNt(e);if(!n){return void 0}return{top:gl(n.top),right:gl(n.right),bottom:gl(n.bottom),left:gl(n.left)}}function HJr(e){if(!(e instanceof ug)){return void 0}return ZHe(e.image)}function WJr(e,t){const n=e?.shape?.fill??e?.fill;const r=n?.imageReference?.id;if(!t||!r){return void 0}return ZHe(t.images.getById(r))}function eXt(e){const t=e?.fill;if(!t){return void 0}return new gi({type:"proto",proto:t}).color.toConfig()}function tXt(e,t){const n=e?.fill?.imageReference?.id;if(!t||!n){return void 0}return ZHe(t.images.getById(n))}function ZHe(e){if(!e){return void 0}const t={assetId:nc(e.id),contentType:nc(e.contentType),uri:nc(e.uri),prompt:nc(e.prompt),byteLength:e.data.byteLength>0?e.data.byteLength:void 0};return Object.values(t).some(n=>n!==void 0)?t:void 0}function YJr(e){const t=[];e.forEach(n=>{if(n.kind!=="table"){return}n.cells?.forEach(r=>{const i=KHe(r.bbox);if(!i){return}t.push({cell:r,tableAid:n.aid,bboxRect:i})})});if(t.length===0){return}e.forEach(n=>{if(n.kind==="table"){return}const r=KHe(n.bbox);if(!r){return}let i;let o=0;t.forEach(s=>{const l=XJr(r,s.bboxRect);if(l<=0){return}const u=l/jJr(r);if(u>o){o=u;i=s}});if(!i||o<.5){return}n.tableCell={tableAid:i.tableAid,cellIndex:i.cell.index,row:i.cell.row,column:i.cell.column,overlap:gl(o)??o};const a=i.cell.ownedElementAids??[];a.push(n.aid);i.cell.ownedElementAids=a})}function KHe(e){if(!qJr(e)){return void 0}const[t,n,r,i]=e;if(!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(i)){return void 0}return{left:t,top:n,right:t+r,bottom:n+i}}function qJr(e){return e!==void 0&&e.length>=4}function XJr(e,t){const n=Math.min(e.right,t.right)-Math.max(e.left,t.left);const r=Math.min(e.bottom,t.bottom)-Math.max(e.top,t.top);if(n<=0||r<=0){return 0}return n*r}function jJr(e){return Math.max(0,e.right-e.left)*Math.max(0,e.bottom-e.top)}function KJr(e){const t=e?.shape?.fill??e?.fill;if(!t){return void 0}return new gi({type:"proto",proto:t}).color.toConfig()}function ZJr(e){const t=e?.shape?.line?.fill;if(!t){return void 0}return new gi({type:"proto",proto:t}).color.toConfig()}function JJr(e){const t=e?.shape?.line;if(!t){return void 0}return gl(b1e({line:t}))}function QJr(e,t){if(typeof e.geometry==="string"&&e.geometry.trim().length>0){return e.geometry}const n=t?.shape?.geometry;if(n===void 0){return void 0}return lJr[n]}function Yqt(e){return{left:gl(e.left)??0,top:gl(e.top)??0,width:gl(e.width)??0,height:gl(e.height)??0}}function nc(e){if(typeof e!=="string"){return void 0}const t=e.trim();return t.length>0?e:void 0}function eQr(e){if(typeof e!=="number"||!Number.isFinite(e)){return void 0}if(e>200){return gl(e/100*(96/72))}return gl(e)}function gl(e){if(e===void 0||!Number.isFinite(e)){return void 0}return Math.round(e*100)/100}var nXt="hug";var rXt="fill";var B1=e=>({mode:"fixed",value:xM(e,"compose.fixed(value)")});var iXt=(e=1)=>({mode:"fill",value:xM(e,"compose.grow(value)")});var rc=e=>({mode:"wrap",max:xM(e,"compose.wrap(max)")});var Ld=(e,t="hug",n="compose.size")=>{const r=e??t;if(r==="hug"||r==="fill"){return r==="hug"?{mode:"hug"}:{mode:"fill",value:1}}if(typeof r==="number"){return{mode:"fixed",value:xM(r,`${n}.fixed.value`)}}if(typeof r==="string"){const i=tQr(r,n);if(i!==void 0){return{mode:"fixed",value:i}}throw new Error(`${n} must be hug, fill, a positive pixel number, a "[number]px" string, grow(...), fixed(...), or wrap(...).`)}if(r.mode==="fixed"){return{mode:"fixed",value:xM(r.value,`${n}.fixed.value`)}}if(r.mode==="fill"){return{mode:"fill",value:xM(r.value,`${n}.fill.value`)}}if(r.mode==="wrap"){return{mode:"wrap",max:xM(r.max,`${n}.wrap.max`)}}throw new Error(`${n} must be hug, fill, a positive pixel number, a "[number]px" string, grow(...), fixed(...), or wrap(...).`)};var xM=(e,t)=>{if(!Number.isFinite(e)||e<=0){throw new Error(`${t} must be a positive number.`)}return e};var tQr=(e,t)=>{const n=/^(\d+(?:\.\d+)?)\s*px$/i.exec(e.trim());if(!n){return void 0}return xM(Number(n[1]),t)};var nQr={top:0,right:0,bottom:0,left:0};var ro=(e,t={})=>({kind:"text",value:e,name:ax(t.name),style:t.style,shadow:t.shadow,transform:t.transform??"none",width:Ld(t.width,"hug","compose.text.width"),height:Ld(t.height,"hug","compose.text.height"),position:__(t.position),columnSpan:Qd(t.columnSpan,"compose.text.columnSpan"),rowSpan:Qd(t.rowSpan,"compose.text.rowSpan")});var eu=e=>{const t=iQr(e.weight??1,"compose.rule.weight");const n=oQr(e.opacity,"compose.rule.opacity");return{kind:"rule",name:ax(e.name),stroke:e.stroke,opacity:n,weight:t,width:Ld(e.width,"fill","compose.rule.width"),height:Ld(e.height??B1(t),"hug","compose.rule.height"),position:__(e.position),columnSpan:Qd(e.columnSpan,"compose.rule.columnSpan"),rowSpan:Qd(e.rowSpan,"compose.rule.rowSpan")}};var Wh=(e={})=>{const t=e.geometry??"rect";const n={kind:"shape",name:ax(e.name),fill:e.fill,line:e.line,borderRadius:e.borderRadius,shadow:e.shadow,width:Ld(e.width,B1(24),"compose.shape.width"),height:Ld(e.height,B1(24),"compose.shape.height"),position:__(e.position),columnSpan:Qd(e.columnSpan,"compose.shape.columnSpan"),rowSpan:Qd(e.rowSpan,"compose.shape.rowSpan")};if(t==="custom"){const r=e.customPaths;if(!r||r.length===0){throw new Error('compose.shape geometry "custom" requires at least one custom path.')}return{...n,geometry:t,customPaths:r}}if(e.customPaths!==void 0){throw new Error('compose.shape customPaths can only be used with geometry "custom".')}return{...n,geometry:t}};var oXt=(e={})=>{const t=rQr(e.from,e.to);return{kind:"connector",name:ax(e.name),connectorKind:e.kind??"straight",orientation:e.orientation??"horizontal",from:t?.from,to:t?.to,fromElement:e.fromElement,toElement:e.toElement,fromSide:e.fromSide,toSide:e.toSide,fromIdx:e.fromIdx,toIdx:e.toIdx,line:e.line,head:e.head,tail:e.tail,cap:e.cap,join:e.join,width:Ld(e.width,t?.width??B1(160),"compose.connector.width"),height:Ld(e.height,t?.height??B1(16),"compose.connector.height"),position:t?.position??__(e.position),columnSpan:Qd(e.columnSpan,"compose.connector.columnSpan"),rowSpan:Qd(e.rowSpan,"compose.connector.rowSpan")}};var v_=e=>({kind:"image",name:ax(e.name),source:sQr(e),contentType:ax(e.contentType),fit:e.fit,alt:e.alt,geometry:e.geometry,borderRadius:e.borderRadius,crop:e.crop,rotation:aQr(e.rotation,"compose.image.rotation"),flipHorizontal:JHe(e.flipHorizontal,"compose.image.flipHorizontal"),flipVertical:JHe(e.flipVertical,"compose.image.flipVertical"),lockAspectRatio:JHe(e.lockAspectRatio,"compose.image.lockAspectRatio"),width:Ld(e.width,"fill","compose.image.width"),height:Ld(e.height,"fill","compose.image.height"),position:__(e.position),columnSpan:Qd(e.columnSpan,"compose.image.columnSpan"),rowSpan:Qd(e.rowSpan,"compose.image.rowSpan")});var TM=e=>({kind:"table",name:ax(e.name),rows:QHe(e.rows,"compose.table.rows"),columns:QHe(e.columns,"compose.table.columns"),values:e.values,columnWidths:e.columnWidths,columnTracks:e.columnTracks,style:ax(e.style),styleOptions:e.styleOptions,width:Ld(e.width,"fill","compose.table.width"),height:Ld(e.height,"fill","compose.table.height"),position:__(e.position),columnSpan:Qd(e.columnSpan,"compose.table.columnSpan"),rowSpan:Qd(e.rowSpan,"compose.table.rowSpan")});var sV=e=>({kind:"chart",name:ax(e.name),chartType:e.chartType,config:e.config,width:Ld(e.width,"fill","compose.chart.width"),height:Ld(e.height,"fill","compose.chart.height"),position:__(e.position),columnSpan:Qd(e.columnSpan,"compose.chart.columnSpan"),rowSpan:Qd(e.rowSpan,"compose.chart.rowSpan")});var vs=(e={},t=[])=>({kind:"row",name:ax(e.name),width:Ld(e.width,"hug","compose.row.width"),height:Ld(e.height,"hug","compose.row.height"),gap:x_(e.gap??0,"compose.row.gap"),align:_M(e.align??"start","compose.row.align"),justify:sXt(e.justify??"start","compose.row.justify"),padding:FJ(e.padding),children:[...t],position:__(e.position),columnSpan:Qd(e.columnSpan,"compose.row.columnSpan"),rowSpan:Qd(e.rowSpan,"compose.row.rowSpan")});var _a=(e={},t=[])=>({kind:"column",name:ax(e.name),width:Ld(e.width,"hug","compose.column.width"),height:Ld(e.height,"hug","compose.column.height"),gap:x_(e.gap??0,"compose.column.gap"),align:_M(e.align??"start","compose.column.align"),justify:sXt(e.justify??"start","compose.column.justify"),padding:FJ(e.padding),children:[...t],position:__(e.position),columnSpan:Qd(e.columnSpan,"compose.column.columnSpan"),rowSpan:Qd(e.rowSpan,"compose.column.rowSpan")});var pC=(e,t=[])=>({kind:"grid",name:ax(e.name),width:Ld(e.width,"hug","compose.grid.width"),height:Ld(e.height,"hug","compose.grid.height"),columns:RHe(e.columns,"compose.grid.columns"),rows:e.rows?RHe(e.rows,"compose.grid.rows"):void 0,autoRows:e.autoRows??"auto",columnGap:x_(e.columnGap??0,"compose.grid.columnGap"),rowGap:x_(e.rowGap??0,"compose.grid.rowGap"),alignItems:_M(e.alignItems??"stretch","compose.grid.alignItems"),justifyItems:_M(e.justifyItems??"stretch","compose.grid.justifyItems"),padding:FJ(e.padding),children:[...t],position:__(e.position),columnSpan:Qd(e.columnSpan,"compose.grid.columnSpan"),rowSpan:Qd(e.rowSpan,"compose.grid.rowSpan")});var d5=(e={},t)=>{const n=e.fill!==void 0||e.line!==void 0||e.borderRadius!==void 0||e.shadow!==void 0;return{kind:"panel",name:ax(e.name),fill:e.fill,line:e.line,borderRadius:e.borderRadius,shadow:e.shadow,materialize:e.materialize??n,align:_M(e.align??"start","compose.panel.align"),justify:_M(e.justify??"start","compose.panel.justify"),width:Ld(e.width,"fill","compose.panel.width"),height:Ld(e.height,"hug","compose.panel.height"),padding:FJ(e.padding),child:t,position:__(e.position),columnSpan:Qd(e.columnSpan,"compose.panel.columnSpan"),rowSpan:Qd(e.rowSpan,"compose.panel.rowSpan")}};var g_e=d5;var aXt=(e={},t=[])=>({kind:"layers",name:ax(e.name),width:Ld(e.width,"hug","compose.layers.width"),height:Ld(e.height,"hug","compose.layers.height"),alignItems:_M(e.alignItems??"stretch","compose.layers.alignItems"),justifyItems:_M(e.justifyItems??"stretch","compose.layers.justifyItems"),padding:FJ(e.padding),children:[...t],position:__(e.position),columnSpan:Qd(e.columnSpan,"compose.layers.columnSpan"),rowSpan:Qd(e.rowSpan,"compose.layers.rowSpan")});var FJ=e=>{if(e===void 0){return{...nQr}}if(typeof e==="number"||typeof e==="string"){const s=x_(e,"compose.padding");return{top:s,right:s,bottom:s,left:s}}const t=x_(e.x??0,"compose.padding.x");const n=x_(e.y??0,"compose.padding.y");const r=x_(e.top??n,"compose.padding.top");const i=x_(e.right??t,"compose.padding.right");const o=x_(e.bottom??n,"compose.padding.bottom");const a=x_(e.left??t,"compose.padding.left");return{top:r,right:i,bottom:o,left:a}};var __=e=>{if(e===void 0){return void 0}const t={};if(e.left!==void 0){t.left=vM(e.left,"compose.position.left")}if(e.top!==void 0){t.top=vM(e.top,"compose.position.top")}if(e.right!==void 0){t.right=vM(e.right,"compose.position.right")}if(e.bottom!==void 0){t.bottom=vM(e.bottom,"compose.position.bottom")}return Object.keys(t).length>0?t:void 0};var rQr=(e,t)=>{if(e===void 0&&t===void 0){return void 0}if(e===void 0||t===void 0){throw new Error("compose.connector requires both from and to points.")}const n={left:vM(e.left,"compose.connector.from.left"),top:vM(e.top,"compose.connector.from.top")};const r={left:vM(t.left,"compose.connector.to.left"),top:vM(t.top,"compose.connector.to.top")};const i=Math.min(n.left,r.left);const o=Math.min(n.top,r.top);const a=Math.max(1,Math.abs(r.left-n.left));const s=Math.max(1,Math.abs(r.top-n.top));return{position:{left:i,top:o},width:B1(a),height:B1(s),from:{left:n.left-i,top:n.top-o},to:{left:r.left-i,top:r.top-o}}};var ax=e=>{if(e===void 0){return void 0}const t=e.trim();return t.length>0?t:void 0};var _M=(e,t)=>{if(e==="start"||e==="center"||e==="end"||e==="stretch"){return e}throw new Error(`${t} must be start, center, end, or stretch.`)};var sXt=(e,t)=>{if(e==="start"||e==="center"||e==="end"||e==="between"){return e}throw new Error(`${t} must be start, center, end, or between.`)};var x_=(e,t)=>eOt(e,{name:t});var vM=(e,t)=>{if(typeof e==="number"){if(!Number.isFinite(e)){throw new Error(`${t} must be a finite number.`)}return e}const n=e.trim().toLowerCase();const r=/^(-?\d+(?:\.\d+)?)\s*px$/i.exec(n);if(r){return Number(r[1])}return x_(e,t)};var iQr=(e,t)=>{if(!Number.isFinite(e)||e<=0){throw new Error(`${t} must be a positive number.`)}return e};var QHe=(e,t)=>{if(!Number.isFinite(e)||e<=0||!Number.isInteger(e)){throw new Error(`${t} must be a positive integer.`)}return e};var Qd=(e,t)=>{if(e===void 0){return 1}return QHe(e,t)};var oQr=(e,t)=>{if(e===void 0){return void 0}if(!Number.isFinite(e)||e<0||e>1){throw new Error(`${t} must be between 0 and 1.`)}return e};var JHe=(e,t)=>{if(e===void 0){return void 0}if(typeof e!=="boolean"){throw new Error(`${t} must be a boolean.`)}return e};var aQr=(e,t)=>{if(e===void 0){return void 0}if(!Number.isFinite(e)){throw new Error(`${t} must be a finite number.`)}return e};var sQr=e=>{if("path"in e){return{path:e.path}}if("dataUrl"in e){return{dataUrl:e.dataUrl}}if("blob"in e){return{blob:e.blob}}if("uri"in e){return{uri:e.uri}}return{prompt:e.prompt}};var eWe=Symbol.for("@oai/granola/presentation-jsx.element");var Rm=Symbol.for("@oai/granola/presentation-jsx.fragment");function Eu(e){return typeof e==="object"&&e!==null&&"$$type"in e&&e.$$type===eWe}var lXt=["div","section","article","aside","header","footer","figure","nav","stack","vstack","hstack","surface"];var cXt=["span","em","u","a","br"];var uXt=["ul","ol","li"];var dXt=["img","hr"];var lQr=new Set(lXt);var cQr=new Set(cXt);var tma=new Set(uXt);var nma=new Set(dXt);var uQr=new Set([...lXt,...cXt,...uXt,...dXt]);function fXt(e){return lQr.has(e)}function tWe(e){return cQr.has(e)}function nWe(e){return uQr.has(e)}var mXt={fontSize:14,lineSpacing:1.3};var gXt=new Set(["runs","bulletCharacter","marginLeft","indent","spaceBefore","spaceAfter","styleId","paragraphStyle"]);var dQr=new Set([...gXt,"children","className","textStyle"]);var fQr=new Set(["children","className","textStyle","href","link","underline"]);function b_e(e,t,n,r){const i=r?MX(r):null;const o=PX(n);if(typeof o==="string"){if(i){throw new Error(`${e} cannot combine a string style reference with \`className\`. Use an object style instead.`)}return o}const a=bQr(t,i??void 0,o);if(!a){return void 0}if(r){a.className=CQr(a.className,r)}return a}function hQr(e,t){const n=t?MX(t):null;const r=lV(n?vXt(n):void 0,e);return r??void 0}function yXt(e){if(e===null||e===void 0||typeof e==="boolean"||typeof e==="string"||typeof e==="number"){return true}if(!Eu(e)||typeof e.type!=="string"){return false}return e.type==="paragraph"||e.type==="run"||tWe(e.type)}function x_e(e,t,n){const r=xXt(e,t,n);return gQr(r)}function bXt(e,t,n,r){const i=NJ(t,r);const o=i.filter(l=>!r.isFormattingWhitespace(l));const a=[];const s=iWe(n);o.forEach((l,u)=>{if(!Eu(l)||l.type!=="li"){throw new Error(`<${e}> only accepts

  • children.`)}TXt("li",l.props,dQr);const d=xXt(r.toChildArray(l.props["children"]),{contextTag:"
  • "},r);const f=EQr(s,iWe(l.props));const h=l.props["bulletCharacter"]??n["bulletCharacter"]??(e==="ul"?"\u2022":void 0);const m=e==="ol"?TQr(d,u+1):d;m.forEach((g,x)=>{const w=e==="ul"?y_e(g,{...f,bulletCharacter:x===0?h:f.bulletCharacter}):y_e(g,f);a.push(w)})});return a}function xXt(e,t,n){const r=NJ(e,n);const i=r.filter(a=>Eu(a)&&a.type==="paragraph");if(i.length>0){const a=r.some(s=>!(Eu(s)&&s.type==="paragraph"||n.isFormattingWhitespace(s)));if(a){throw new Error(`${t.contextTag} cannot mix raw text or siblings with explicit children.`)}return i.map(s=>y_e(mQr(s,n),t.paragraphOptions))}const o=pQr(r,t.contextTag,n);return o.map(a=>y_e(a.runs.length>0?a.runs:[""],t.paragraphOptions))}function pQr(e,t,n){const r=[{runs:[]}];const i=()=>{const l=r[r.length-1];if(l){return l}const u={runs:[]};r.push(u);return u};const o=()=>{r.push({runs:[]})};const a=(l,u,d)=>{const f=i();const h=d?yQr(d,u):u.textStyle||u.link?{run:l,textStyle:u.textStyle,link:u.link}:l;f.runs.push(h)};const s=(l,u)=>{if(Array.isArray(l)){l.forEach(d=>s(d,u));return}if(l===null||l===void 0||typeof l==="boolean"||n.isFormattingWhitespace(l)){return}if(typeof l==="string"||typeof l==="number"){const d=typeof l==="number"?String(l):SQr(l);if(d.length>0){a(d,u)}return}if(!Eu(l)){throw new Error(`${t} contains an unsupported text child.`)}if(l.type===Rm){n.toChildArray(l.props["children"]).forEach(d=>s(d,u));return}if(typeof l.type!=="string"){throw new Error(`${t} contains an unsupported text child.`)}if(l.type==="run"){const d=n.lowerRun(l);a(d.run,u,d);return}if(l.type==="br"){o();return}if(l.type==="paragraph"){throw new Error(`${t} does not accept nested children in inline text mode.`)}if(l.type==="small"){const d=hXt(u,{textStyle:{fontSize:"11px"}});n.toChildArray(l.props["children"]).forEach(f=>s(f,d));return}if(tWe(l.type)){TXt(l.type,l.props,fQr);const d=hXt(u,xQr(l.type,l.props));n.toChildArray(l.props["children"]).forEach(f=>s(f,d));return}throw new Error(`${t} only accepts raw text, inline semantic tags, , , and fragments.`)};e.forEach(l=>s(l,{}));while(r.length>1&&AQr(r[r.length-1])){r.pop()}return r.length>0?r:[{runs:[""]}]}function mQr(e,t){const n=e.props;const r=[];const i=n["runs"];const o=NJ(t.toChildArray(n["children"]),t);o.forEach(l=>{if(l===null||l===void 0||typeof l==="boolean"||t.isFormattingWhitespace(l)){return}if(typeof l==="string"||typeof l==="number"){r.push(l);return}if(!Eu(l)||l.type!=="run"){throw new Error(" only accepts raw text, , and fragments.")}r.push(t.lowerRun(l))});const a=iWe(n);if(i!==void 0){if(!MT(i)){throw new Error(" `runs` must be a paragraph runs array.")}if(r.length>0){throw new Error(" accepts runs either as the `runs` prop or as children, not both.")}const l=i.length>0?i:[""];if(Object.keys(a).length===0){return l}return{...a,runs:l}}const s=r.length>0?r:[""];if(Object.keys(a).length===0){return s}return{...a,runs:s}}function NJ(e,t){const n=[];e.forEach(r=>{if(Array.isArray(r)){n.push(...NJ(r,t));return}if(Eu(r)&&r.type===Rm){n.push(...NJ(t.toChildArray(r.props["children"]),t));return}n.push(r)});return n}function gQr(e){if(e.length===0){return""}if(e.length===1){const t=e[0];if(t===void 0){return""}if(Array.isArray(t)&&t.every(n=>typeof n==="string")){return t.join("")}return t}return e}function hXt(e,t){return{textStyle:lV(e.textStyle,t.textStyle),link:t.link??e.link}}function yQr(e,t){return{...e,textStyle:lV(t.textStyle,e.textStyle),link:e.link??t.link}}function lV(e,t){if(!e&&!t){return void 0}return{...e??{},...t??{}}}function bQr(...e){let t;e.forEach(n=>{if(!n){return}t={...t??{},...n,insets:{...t?.insets??{},...n.insets??{}}}});return t}function xQr(e,t){const n=hQr(pXt(t["textStyle"]),rWe(t["className"],`<${e}> className`));const r=_Qr(e,t);if(e==="em"){return{textStyle:lV(n,{italic:true}),link:r}}if(e==="u"){return{textStyle:lV(n,{underline:rWe(t["underline"]," underline")??"sng"}),link:r}}if(e==="a"){return{textStyle:lV(n,{underline:rWe(t["underline"]," underline")??"sng",color:n?.color??pXt(t["textStyle"])?.color??"#2563EB"}),link:r??{uri:vQr(e,t),isExternal:true}}}return{textStyle:n,link:r}}function vQr(e,t){const n=t["href"];if(typeof n!=="string"||n.trim().length===0){throw new Error(`<${e}> requires a non-empty \`href\` string when \`link\` is not provided.`)}return n}function _Qr(e,t){const n=t["link"];if(n===void 0){return void 0}if(typeof n!=="object"||n===null){throw new Error(`<${e}> link must be a hyperlink config object.`)}return n}function pXt(e){if(e===void 0){return void 0}if(typeof e==="string"){if(!yz(e)){throw new Error("Inline textStyle strings must use declaration syntax like `color: #2563EB; weight: 700`.")}return vXt(bz(e))}if(typeof e!=="object"||e===null||Array.isArray(e)){throw new Error("Inline textStyle must be an object.")}return e}function vXt(e){if(!e){return void 0}const t={};if(e.bold!==void 0){t.bold=e.bold}if(e.italic!==void 0){t.italic=e.italic}if(e.underline!==void 0){t.underline=e.underline}if(e.fontSize!==void 0){t.fontSize=`${e.fontSize}px`}if(e.typeface!==void 0){t.typeface=e.typeface}if(e.color!==void 0){t.color=e.color}else if(e.fill!==void 0){t.color=e.fill}if(e.highlight!==void 0){t.highlight=e.highlight}if(e.outline!==void 0){t.outline=e.outline}if(e.shadow!==void 0){t.shadow=e.shadow}return Object.keys(t).length>0?t:void 0}function TQr(e,t){const n=`${t}. `;return e.map((r,i)=>i===0?wQr(r,n):r)}function wQr(e,t){if(Array.isArray(e)){if(e.length===0){return[t]}const[a,...s]=e;if(a===void 0){return[t,...s]}if(typeof a==="string"||typeof a==="number"){return[`${t}${String(a)}`,...s]}if(Wv(a)){return[t,a,...s]}return[{...a,run:`${t}${a.run}`},...s]}const n=e.runs??[];if(n.length===0){return{...e,runs:[t]}}const[r,...i]=n;if(r===void 0){return{...e,runs:[t,...i]}}const o=typeof r==="string"||typeof r==="number"?[`${t}${String(r)}`]:Wv(r)?[t,r]:[{...r,run:`${t}${r.run}`}];return{...e,runs:[...o,...i]}}function y_e(e,t){if(!t||Object.keys(t).length===0){return e}if(Array.isArray(e)){return{...t,runs:e.length>0?e:[""]}}return{...t,...e,paragraphStyle:_Xt(t.paragraphStyle,e.paragraphStyle),runs:e.runs??[""]}}function EQr(e,t){return{...e,...t,paragraphStyle:_Xt(e.paragraphStyle,t.paragraphStyle)}}function _Xt(e,t){if(e===void 0&&t===void 0){return void 0}return{...e,...t,tabStops:t?.tabStops??e?.tabStops??[]}}function iWe(e){const t={};Object.entries(e).forEach(([n,r])=>{if(n==="runs"||!gXt.has(n)||r===void 0){return}t[n]=r});return t}function TXt(e,t,n){Object.keys(t).forEach(r=>{if(!n.has(r)){throw new Error(`<${e}> does not support the \`${r}\` prop.`)}})}function rWe(e,t){if(e===void 0){return void 0}if(typeof e!=="string"){throw new Error(`${t} must be a string.`)}const n=e.trim();return n.length>0?n:void 0}function CQr(e,t){return e?`${e} ${t}`:t}function SQr(e){if(e.length===0){return e}let t=e.replace(/\r?\n[\t ]*/g," ");if(/^\s*\r?\n/.test(e)){t=t.trimStart()}if(/\r?\n[\t ]*$/.test(e)){t=t.trimEnd()}return t}function AQr(e){return!e||e.runs.length===0}var kQr=new Set(["name","id","className","children","ref","layout","display","contentLayout","surface","width","height","gap","align","justify","padding","columns","rows","autoRows","columnGap","rowGap","alignItems","justifyItems","columnSpan","rowSpan","fill","line","borderRadius","shadow"]);var RQr=new Set(["name","id","className","children","ref","width","height","columnSpan","rowSpan","style","transform","bulletCharacter","marginLeft","indent","spaceBefore","spaceAfter","styleId","paragraphStyle"]);var PQr=new Set(["name","id","className","children","ref","width","height","columnSpan","rowSpan","src","path","dataUrl","blob","uri","prompt","contentType","fit","alt","geometry","borderRadius","crop","rotation","flipHorizontal","flipVertical","lockAspectRatio"]);var IQr=new Set(["name","id","children","ref","width","height","columnSpan","rowSpan","stroke","opacity","weight"]);function wXt(e,t){if(typeof e.type!=="string"||!nWe(e.type)){throw new Error("Unsupported semantic presentation JSX tag.")}if(fXt(e.type)){return MQr(e.type,e,t)}if(e.type==="ul"||e.type==="ol"){return LQr(e.type,e,t)}if(e.type==="li"){throw new Error("
  • is only valid inside