<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">/*
 *   Copyright (c) 2022 Esri
 *   All rights reserved.

 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at

 *   http://www.apache.org/licenses/LICENSE-2.0

 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */
var __decorate = (this &amp;&amp; this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c &lt; 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" &amp;&amp; typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i &gt;= 0; i--) if (d = decorators[i]) r = (c &lt; 3 ? d(r) : c &gt; 3 ? d(target, key, r) : d(target, key)) || r;
    return c &gt; 3 &amp;&amp; r &amp;&amp; Object.defineProperty(target, key, r), r;
};
var __importDefault = (this &amp;&amp; this.__importDefault) || function (mod) {
    return (mod &amp;&amp; mod.__esModule) ? mod : { "default": mod };
};
define(["require", "exports", "esri/core/accessorSupport/decorators", "esri/widgets/Widget", "esri/widgets/support/widget", "ArcGISHTMLSanitizer", "TemplatesCommonLib/functionality/securityUtils", "../utilites/utils"], function (require, exports, decorators_1, Widget_1, widget_1, ArcGISHTMLSanitizer_1, securityUtils_1, utils_1) {
    "use strict";
    Widget_1 = __importDefault(Widget_1);
    ArcGISHTMLSanitizer_1 = __importDefault(ArcGISHTMLSanitizer_1);
    let Notification = class Notification extends Widget_1.default {
        constructor(params) {
            super(params);
            this.bundle = null;
            this.rootNode = null;
        }
        postInitialize() {
            this._sanitizer = (0, securityUtils_1.createSanitizerInstance)(ArcGISHTMLSanitizer_1.default);
        }
        render() {
            const { noResultsMessage } = this.config;
            const message = noResultsMessage &amp;&amp; noResultsMessage !== "" ? noResultsMessage : this.bundle.noFeatures;
            const defaultMessage = noResultsMessage === this?.bundle?.noFeatures ? true : false;
            const link = this.renderLink();
            const updatedMessage = (0, utils_1.substituteLinkPlaceholders)(message, this.view);
            const customHeader = defaultMessage ? ((0, widget_1.tsx)("div", { slot: "header-content" },
                (0, widget_1.tsx)("div", { class: "notifcation-header", style: "display:flex;" },
                    (0, widget_1.tsx)("calcite-icon", { scale: "s", class: "warning-icon", icon: "exclamation-mark-triangle-f" }),
                    (0, widget_1.tsx)("span", { class: "inline-no-results-message" }, updatedMessage)))) : null;
            const card = !defaultMessage ? ((0, widget_1.tsx)("calcite-card", null,
                (0, widget_1.tsx)("div", { slot: "description", class: "esri-nearby-app__tip-message", innerHTML: this._sanitizer.sanitize(updatedMessage) }))) : null;
            return ((0, widget_1.tsx)("div", null,
                (0, widget_1.tsx)("calcite-panel", { bind: this, class: "esri-nearby-app__tip", afterCreate: widget_1.storeNode, "data-node-ref": "rootNode", closable: true, closed: true },
                    customHeader,
                    card,
                    link)));
        }
        renderLink() {
            const { noResultsLink, noResultsLinkText, noResultsLinkAppendFind, noResultsLinkAppendCenter } = this.config;
            let messageURL = null;
            if (noResultsLink !== null) {
                // create a link and add below message
                messageURL = new URL(noResultsLink);
                if (noResultsLinkAppendFind) {
                    const findParam = (0, utils_1.getUrlParam)("find");
                    if (findParam)
                        messageURL.searchParams.append("find", findParam);
                }
                if (noResultsLinkAppendCenter) {
                    let centerParam = `${this?.view?.extent?.center?.longitude},${this?.view?.extent?.center?.latitude}`;
                    if (noResultsLink?.includes("survey123.arcgis.com")) {
                        centerParam = `${this?.view?.extent?.center?.latitude},${this?.view?.extent?.center?.longitude}`;
                    }
                    if (centerParam)
                        messageURL.searchParams.append("center", centerParam);
                }
            }
            return messageURL !== null ? ((0, widget_1.tsx)("calcite-link", { class: "esri-nearby-app__tip-link", href: messageURL }, noResultsLinkText || noResultsLink)) : null;
        }
        dismissNotice() {
            if (this?.rootNode) {
                this.rootNode.closed = true;
                document?.body?.classList?.remove("map-alert");
            }
        }
        showNotice() {
            if (this?.rootNode) {
                this.rootNode.closed = false;
            }
        }
    };
    __decorate([
        (0, decorators_1.property)()
    ], Notification.prototype, "config", void 0);
    __decorate([
        (0, decorators_1.property)()
    ], Notification.prototype, "view", void 0);
    __decorate([
        (0, decorators_1.property)(),
        (0, widget_1.messageBundle)("lookup/app/t9n/common")
    ], Notification.prototype, "bundle", void 0);
    __decorate([
        (0, decorators_1.property)()
    ], Notification.prototype, "rootNode", void 0);
    Notification = __decorate([
        (0, decorators_1.subclass)("Notification")
    ], Notification);
    return Notification;
});
</pre></body></html>