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B/B,EAAAA,gBAAmBiD,MAAQA,EAC3BjD,EAAAA,gBAAmB4D,MAAQA,EAC3B5D,EAAAA,gBAAmBmF,WAAaA,EAChCnF,EAAAA,gBAAmB0E,aAAeA,CqB6BlC,GAEA,CAAAlF,IAAA,cAAAC,MAKA,WACE,IAAMqE,EAAO,IAAIxE,EACjBW,KAAK89B,SAASsB,OAAOv7B,GACrBA,EAAKu7B,QACP,GAEA,CAAA7/B,IAAA,qBAAAC,MAeA,WAGES,EAAO,gDAAgDwP,WACvDxP,EAAO,kDAAkDo/B,YACzDp/B,EAAO,gDAAgDia,SAAS,CAC9DolB,YAAa,KAIfr/B,EAAO,mDAAmDia,SAAS,CACjEolB,YAAa,KAMfr/B,EAAO,+CAA+C0D,MAAM,CAC1DqH,SAAU,aACV9G,MAAO,CACLC,KAAM,KAERnD,UAAW,UAEbf,EAAO,8BAA8BqJ,MAKd,IAAIi2B,EACzB,kDAGFt/B,EAAO,kDAAkD0D,MAAM,CAC7D0H,GAAI,QACJpH,WAAW,EACXgH,QAAS,YAKPjL,KAAKoD,OAAOo8B,mBACdv/B,EAAO,6CAA6Ck/B,UAClDn/B,KAAKoD,OAAOq8B,kBACZz/B,KAAKoD,OAAOtD,MAGlB,M,gFAAC+9B,CAAA,CA1IqB,GCtBxB59B,EAAOQ,UAAUi/B,MAAM,YACT,IAAI7B,IACZ8B,KACN,E","sources":["webpack://readthedocsext-theme/external var \"moment\"","webpack://readthedocsext-theme/./src/js/application/views.js","webpack://readthedocsext-theme/./src/js/application/globals.js","webpack://readthedocsext-theme/./src/js/application/plugins.js","webpack://readthedocsext-theme/./src/js/application/registry.js","webpack://readthedocsext-theme/./src/js/account/index.js","webpack://readthedocsext-theme/./src/js/build/detail.js","webpack://readthedocsext-theme/./src/js/core/views.js","webpack://readthedocsext-theme/./src/js/gold/index.js","webpack://readthedocsext-theme/./src/js/application/elements.js","webpack://readthedocsext-theme/./src/js/modules/avatar.js","webpack://readthedocsext-theme/./src/js/modules/header.js","webpack://readthedocsext-theme/./src/js/modules/filter.js","webpack://readthedocsext-theme/./src/js/modules/forms.js","webpack://readthedocsext-theme/./src/js/modules/menus.js","webpack://readthedocsext-theme/./node_modules/dompurify/dist/purify.es.mjs","webpack://readthedocsext-theme/./src/js/modules/notifications.js","webpack://readthedocsext-theme/./src/js/modules/popupcards.js","webpack://readthedocsext-theme/./src/js/organization/index.js","webpack://readthedocsext-theme/./src/js/project/admin.js","webpack://readthedocsext-theme/./src/js/tasks/index.js","webpack://readthedocsext-theme/./src/js/project/create.js","webpack://readthedocsext-theme/./src/js/project/index.js","webpack://readthedocsext-theme/./src/js/profile/index.js","webpack://readthedocsext-theme/./src/js/application/index.js","webpack://readthedocsext-theme/./src/js/site.js"],"sourcesContent":["if(typeof moment === 'undefined') { var e = new Error(\"Cannot find module 'moment'\"); e.code = 'MODULE_NOT_FOUND'; throw e; }\n\nmodule.exports = moment;","import ko from \"knockout\";\n// Note: if debugging is needed, you can try this import instead.\n//import ko from \"knockout/build/output/knockout-latest.debug.js\";\nimport jquery from \"jquery\";\n\n/**\n * ``ApplicationView`` is the top-level view that is bound to ``<body>``, and is\n * what surfaces all registered view to templates. Registered views will be\n * available as attributes on this instance, and can be referenced directly, or\n * if the context is already in one of the views, can be referenced using\n * ``$root``:\n *\n * .. code:: html\n *\n *    <body>\n *      <!-- The context is bound to ApplicationView() -->\n *      <div data-bind=\"using: ProjectCreateView()\">\n *       <!-- The context is now bound to ProjectCreateView() -->\n *       <div data-bind=\"using $root.DocEmbedView()\">\n *         <!-- The context is bound to DocEmbedView() -->\n *       </div>\n *      </div>\n *    </body>\n *\n * This view also has a few utility methods that templates use directly. This is\n * for a few quirks where Knockout or HTML required for SemanticUI need some\n * additional code.\n */\nexport class ApplicationView {\n  /**\n   * Attach application main view\n   *\n   * @param {string} selector - Selector string to use for view attachment\n   */\n  attach(selector = \"body\") {\n    console.debug(\"Attaching application to selector:\", selector);\n    ko.applyBindings(this, jquery(selector)[0]);\n  }\n\n  /**\n   * Show a modal using an event callback. This is set up on\n   * :class:`ApplicationView` so that this method is available as\n   * ``$root.show_modal(123);``. This is required because the modal plugin ends\n   * up altering ``<body>``, and this causes some havoc on the already attached\n   * view on ``<body>``.\n   *\n   * This should be used from an element data-bind, such as:\n   *\n   * .. code:: html\n   *\n   *     <button data-bind=\"click: $root.show_modal('delete')\"></button>\n   *     <div class=\"ui modal\" data-modal-id=\"delete\"></div>\n   *\n   * This method is executed when the view is attached and returns a callback.\n   * The callback is finally executed from the ``click`` binding.\n   *\n   * @param {string} modal_id - Modal id, references `data-modal-id` attribute\n   * @returns {knockout_click}\n   */\n  show_modal(modal_id) {\n    return (data, event) => {\n      const selector = \"[data-modal-id=\" + modal_id + \"]\";\n      console.debug(\"Showing modal:\", selector);\n      const found_modal = jquery(selector).modal(\"show\");\n      if (found_modal.length === 0) {\n        console.debug(\"Modal not found:\", selector);\n      }\n\n      // Remove \"visible\" variation property to remove \"Last used\" tooltip\n      const buttons = document.querySelectorAll(\".button.ui\");\n      for (const button of buttons) {\n        if (button.dataset.variation) {\n          const variation = button.dataset.variation.split(\" \");\n          variation.pop(\"visible\");\n          button.dataset.variation = variation.join(\" \");\n        }\n      }\n    };\n  }\n\n  /**\n   * Submit a child form, useful for triggering a form POST with a link\n   *\n   * This could be used like:\n   *\n   * .. code:: html\n   *\n   *     <button data-bind=\"click: $root.post_child_form\">\n   *       Log out\n   *       <form method=\"post\" action=\"...\">\n   *         ...\n   *       </form>\n   *     </button>\n   *\n   * @param {Object} data - Context data\n   * @param {Event} event - Click event\n   * @returns {knockout_click}\n   */\n  post_child_form(data, event) {\n    const elem = event.currentTarget;\n    const form = elem.querySelector(\":scope > form\");\n    if (form) {\n      form.submit();\n    }\n    return false;\n  }\n}\n","/**\n * Global imports workaround\n *\n * This import is used mostly during testing and for jQuery dependencies.\n * Because jQuery plugins and downstream libraries use jQuery as a\n * global/window object, we need to surface the library in the same way during\n * testing. In normal usage, jQuery is in our vendor library and Webpack knows\n * how to treat reference the external vendor library for instances of a\n * global/window jQuery variable.\n *\n * In testing, this accomplishes the same thing. It's defined in a separate\n * import as the import will be evaluated first, giving a chance to attach\n * `window.jQuery` before the other dependencies, like jQuery plugins and all\n * of FomanticUI's component, are imported.\n */\n\nimport jquery from \"jquery\";\nglobalThis.jQuery = jquery;\n","import jquery from \"jquery\";\nimport ko from \"knockout\";\n\n// TODO this is only really needed while testing, it could be behind a\n// conditional\nimport \"./globals\";\n\nimport Plausible from \"plausible-tracker\";\n\n// Required for FUI tab module\nimport * as jqueryAddress from \"jquery-address\";\n\n/* CommonJS require instead of import syntax on purpose */\nimport * as fomanticVisibility from \"fomantic-ui-less/definitions/behaviors/visibility.js\";\nimport * as fomaticForm from \"fomantic-ui-less/definitions/behaviors/form.js\";\nimport * as fomaticState from \"fomantic-ui-less/definitions/behaviors/state.js\";\nimport * as fomaticAPI from \"fomantic-ui-less/definitions/behaviors/api.js\";\nimport * as fomaticTransition from \"fomantic-ui-less/definitions/modules/transition.js\";\nimport * as fomaticTab from \"fomantic-ui-less/definitions/modules/tab.js\";\nimport * as fomaticDropdown from \"fomantic-ui-less/definitions/modules/dropdown.js\";\nimport * as fomaticModal from \"fomantic-ui-less/definitions/modules/modal.js\";\nimport * as fomaticSearch from \"fomantic-ui-less/definitions/modules/search.js\";\nimport * as fomaticSticky from \"fomantic-ui-less/definitions/modules/sticky.js\";\nimport * as fomaticShape from \"fomantic-ui-less/definitions/modules/shape.js\";\nimport * as fomaticAccordian from \"fomantic-ui-less/definitions/modules/accordion.js\";\nimport * as fomaticSidebar from \"fomantic-ui-less/definitions/modules/sidebar.js\";\nimport * as fomaticDimmer from \"fomantic-ui-less/definitions/modules/dimmer.js\";\nimport * as fomaticCheckbox from \"fomantic-ui-less/definitions/modules/checkbox.js\";\nimport * as fomaticSlider from \"fomantic-ui-less/definitions/modules/slider.js\";\nimport * as fomaticPopup from \"fomantic-ui-less/definitions/modules/popup.js\";\nimport * as fomaticEmbed from \"fomantic-ui-less/definitions/modules/embed.js\";\nimport * as fomaticProgress from \"fomantic-ui-less/definitions/modules/progress.js\";\nimport * as fomaticToast from \"fomantic-ui-less/definitions/modules/toast.js\";\nimport * as fomaticSite from \"fomantic-ui-less/definitions/globals/site.js\";\n\n/**\n * Set up jQuery plugins. SemanticUI jQuery plugins are brought in piecemeal,\n * through separate dependencies. This allows for a smaller footprint.\n */\nexport function configure_jquery_plugins() {\n  jquery.fn.site(\"normalize\");\n  jquery.fn.tabs = jquery_tabmenu;\n  // ``tabmenu`` was ported from our website, but ``tabs`` is nicer\n  jquery.fn.tabmenu = jquery_tabmenu;\n  jquery.fn.plausible = jqueryPlausible;\n}\n\n/**\n * Set up Knockout plugins for interacting with HTML templates\n */\nexport function configure_knockout_plugins() {\n  ko.bindingHandlers.htmlInit = htmlInit;\n  ko.bindingHandlers.textInit = textInit;\n  ko.bindingHandlers.jsonInit = jsonInit;\n  ko.bindingHandlers.valueInit = valueInit;\n  ko.bindingHandlers.element = element;\n  ko.bindingHandlers.chart = chart;\n  ko.bindingHandlers.popup = popup;\n  ko.bindingHandlers.semanticui = semanticui;\n  ko.bindingHandlers.webcomponent = webcomponent;\n}\n\n/**\n * Binding for initializing an observable using the inner HTML of an element.\n */\nexport const htmlInit = add_init_handler(\n  (element) => {\n    return element.innerHTML;\n  },\n  (property) => {\n    return { html: property };\n  },\n);\n\n/**\n * Binding for initializing an observable using the inner text (the child text\n * nodes) of an element.\n */\nexport const textInit = add_init_handler(\n  (element) => {\n    return element.innerText;\n  },\n  (property) => {\n    return { text: property };\n  },\n);\n\n/**\n * Binding for initializing an observable from the ``value`` attribute of an\n * element -- for example a form ``<input>`` element.\n */\nexport const valueInit = add_init_handler(\n  (element) => {\n    return element.value;\n  },\n  (property) => {\n    return { value: property };\n  },\n);\n\n/**\n * JSON binding for writing JSON configuration objects in HTML and initializing\n * the value in a Knockout observable. This is used to transfer configuration\n * from Django and Django template tags, into our front end code.\n *\n * This binding does not set anything, it is only used to initialize an\n * observable on page load.\n *\n * Usage:\n *\n * .. code:: html\n *\n *     <script type=\"application/json\" data-bind=\"jsonInit: config\">\n *     {\"url\": \"https://example.com/api/v3/projects/1234\"}\n *     </script>\n *\n * In turn, there should be a Knockout observable ``config`` in the view:\n *\n * .. code:: javascript\n *\n *     self.config = ko.observable()\n *     self.url = ko.computed(() => {\n *       return self.config().url;\n *     })\n */\nexport const jsonInit = add_init_handler((element) => {\n  try {\n    return JSON.parse(element.innerHTML);\n  } catch (err) {\n    console.error(err);\n    return {};\n  }\n});\n\nfunction add_init_handler(getter, setter) {\n  return {\n    init: function (element, valueAccessor, allBindingsAccessor, data) {\n      const property = valueAccessor();\n      const value = getter(element);\n\n      // Create the observable, if it doesn't exist\n      if (!ko.isWriteableObservable(property)) {\n        throw new Error(\"Property not found:\", property);\n      }\n\n      property(value);\n\n      if (setter) {\n        ko.applyBindingsToNode(element, setter(property));\n      }\n    },\n  };\n}\n\nexport const element = {\n  init: function (element, value_accessor) {\n    var property = value_accessor();\n    property(element);\n  },\n};\n\n/**\n * Chart binding used in a couple views to instantiate chartjs on a ``<canvas>``.\n * This plugin loads chartjs, which is rather large, via an async import in\n * Webpack. This will load the chartjs and dependencies separately from the rest\n * of our application code.\n *\n * Usage:\n *\n * .. code:: html\n *\n *    <canvas width=\"400\" height=\"150\" data-bind=\"chart: config\"></canvas>\n *    <script type=\"application/json\" data-bind=\"jsonInit: config\">\n *    {...}\n *    </script>\n */\nexport const chart = {\n  init: function (element, value_accessor) {\n    var property = value_accessor();\n\n    // Dynamic webpack import of library. This will trigger a new request.\n    import(\n      /* webpackChunkName: \"chartjs\" */\n      \"chart.js\"\n    ).then(({ default: chartjs }) => {\n      let config = property();\n\n      const datasets = config.data.datasets.map((value) => {\n        value.backgroundColor = \"rgb(65, 131, 196, 0.8)\";\n        value.borderColor = \"rgb(65, 131, 196, 1)\";\n        value.pointBorderColor = \"rgb(65, 131, 196, 1)\";\n        value.borderWidth = \"1px\";\n        return value;\n      });\n\n      config.data.datasets = datasets;\n      const chart = new chartjs(element, config);\n    });\n  },\n};\n\n/**\n * Popup plugin for configuring SUI popups. This can be replaced by\n * :func:`semanticui`.\n */\nexport const popup = {\n  init: (element, value_accessor, bindings, view, context) => {\n    const config = Object.assign(\n      {\n        hoverable: true,\n        delay: {\n          show: 300,\n          hide: 100,\n        },\n        exclusive: true,\n        onHide: () => {\n          context.$rawData.hide();\n        },\n      },\n      value_accessor(),\n    );\n    const jq_element = jquery(element);\n    jq_element.popup(config).hover(() => {\n      context.$rawData.show();\n    });\n  },\n};\n\n/**\n * Web component bridge binding\n *\n * This binding is used to help bridge Knockout views and web components, but\n * allowing observables to set web component attributes when updated.\n *\n * It's important to note that there is likely a bit of extra overhead here as\n * both Knockout and Lit have differing patterns for property/observable\n * lifecycles. That is, Knockout will process the observable change with\n * multiple calls, and then pass the value off to the LitElement, which will do\n * its own round of internal calls to update the property value.\n *\n * Either way, this binding can help with the transition to web components.\n *\n * With an underlying Knockout view, a web component property can be updated\n * with this data binding like so:\n *\n * .. code:: html\n *\n *     <readthedocs-foo data-bind=\"webcomponent: {someProperty: someObservable}\">\n *\n * In the above example here, the web component property ``someProperty`` is\n * updated by the Knockout view observable ``someObservable``. When there is an\n * update to the observable in the Knockout view, this property will then be\n * updated on the web component. This can be a full object, this pattern is not\n * limited to data primitives, like when using web components from HTML.\n */\nexport const webcomponent = {\n  update: (element, value_accessor, all_bindings) => {\n    const binding_value = ko.unwrap(value_accessor());\n    for (const [key, value] of Object.entries(binding_value)) {\n      if (value !== undefined) {\n        if (typeof value === \"function\") {\n          console.error(\"Unsupported function in data binding\");\n        } else {\n          element[key] = value;\n        }\n      }\n    }\n  },\n};\n\n/**\n * Knockout binding for calling SemanticUI jQuery plugins on individual elements\n *\n * This binding provides direct access to all of the SemanticUI jQuery plugins\n * provided by each of the SemanticUI module units.\n *\n * Each key passed into the ``semanticui`` binding represents a module plugin\n * that will be called by the data binding. For example, a data binding that\n * initializes ``popup()`` and ``modal()`` module plugins is:\n *\n * .. code:: html\n *\n *     <div data-bind=\"semanticui: { popup: {'on': 'click'}, modal: {'closable': false}}\">\n *\n * Which would be the following if using the standard jQuery initialization\n * pattern described by SUI guides:\n *\n * .. code:: js\n *\n *     $(element).popup({\"on\": \"click\"});\n *     $(element).modal({\"closable\": false});\n *\n * Passing arguments\n * -----------------\n *\n * There are three available patterns you can use for passing arguments into the\n * plugin methods:\n *\n * A literal value inside the data binding attribute in template code\n *   The simplest option, useful if arguments are fairly basic.\n *\n * An observable in the data binding attribute\n *   This is useful when the arguments passed into the plugin method are\n *   complex or conditional.\n *\n * An anonymous function through an observable\n *   This is for advanced cases and the best pattern for using SUI module\n *   behaviors.\n *\n * Literal value\n * ~~~~~~~~~~~~~\n *\n * If you only need to pass basic arguments into the plugin, you can do so in\n * template code without any further JS:\n *\n * .. code:: html\n *\n *     <a class=\"ui item\" data-bind=\"semanticui: {popup: {on: 'click'}}\">\n *\n * To compare this to the standard initialization pattern described by the SUI\n * documentation, which relies on jQuery for targeting:\n *\n * .. code:: js\n *\n *     $(element).popup({on: \"click\"});\n *\n * Observable value\n * ~~~~~~~~~~~~~~~~\n *\n * For complex and conditional arguments, it's usually better to pass an\n * observable to the binding for the module plugin. Because we will be creating\n * observables, this requires a view class. Inside the view class, an\n * observable can be declared:\n *\n * .. code:: js\n *\n *     this.popup_config = ko.computed(() => {\n *       return {\n *         label: this.example_observable(),\n *         on: \"click\",\n *       }\n *     });\n *\n * Our template code would reference the observable instead of a literal:\n *\n * .. code:: html\n *\n *     <a class=\"ui item\" data-bind=\"semanticui: {popup: popup_config()}\">\n *\n * .. seealso::\n *     :func:`BuildDetailView.progress_config`\n *       An example of an observable passing arguments to the ``progress()``\n *       module jQuery plugin.\n *\n * Anonymous function\n * ~~~~~~~~~~~~~~~~~~\n *\n * For deep usage of the SUI module jQuery plugins, you can also set an\n * observable to an anonymous function value to use the plugin method directly\n * on an individual element. This binding will call into that function with the\n * jQuery plugin method exposed as a function as the only argument.\n *\n * With the template code still using an observable in the data binding on the\n * view layer, an observable using an anonymous function instead would be:\n *\n * .. code:: js\n *\n *     this.popup_config = ko.observable((popup) => {\n *       popup({\n *         label: \"Test\",\n *         on: \"click\",\n *       });\n *     });\n *\n * This is most helpful for utilizing SUI module *behaviors*. Behaviors are\n * listed on most SUI modules, such as:\n * https://fomantic-ui.com/modules/popup.html#behavior\n *\n * To now call module behaviors from this observable:\n *\n * .. code:: js\n *\n *     this.popup_config((popup) => popup(\"show\"));\n *\n * It's also possible to mix these patterns and call behaviors more than once.\n * For example a progress bar that progressively updates can mix both plugin\n * initialization and subsequent behavior calls after initialization:\n *\n * .. code:: js\n *\n *     this.progress_config = ko.computed(() => {\n *       if (ko.computedContext.isInitial()) {\n *         // First call, initialize the module\n *         return {\n *           total: 10,\n *         }\n *       } else {\n *         return (progress) => {\n *           progress(\"set progress\", self.value());\n *         }\n *       }\n *     });\n *\n */\nexport const semanticui = {\n  update: (element, value_accessor, all_bindings) => {\n    const binding_value = ko.unwrap(value_accessor());\n    const jq_element = jquery(element);\n    for (const [key, value] of Object.entries(binding_value)) {\n      if (value !== undefined) {\n        if (typeof value === \"function\") {\n          const callback = (behavior, ...args) => {\n            console.debug(\n              \"Calling SemanticUI component behavior:\",\n              key,\n              element,\n              behavior,\n              ...args,\n            );\n            jq_element[key](behavior, ...args);\n          };\n          value(callback);\n        } else {\n          if (key === \"modal\") {\n            // We do something fun here and move the element into ``body``\n            // before the SUI initialization. The reason for this is that SUI\n            // will move the element automatically already, however when it\n            // does the KO bindings are all re-evaluated. This will cause\n            // exceptions to be thrown around duplicate binding definitions. To\n            // make the ``modal`` module play with KO nicely, we mark the modal\n            // as _not detachable_, meaning SUI won't move the element when\n            // initializing, and move the element manually so that the\n            // positioning is relative to ``body`` instead of being relative to\n            // the modal element's parent element. If detachable is manually\n            // configured, throw an error.\n            if (value.detachable == true) {\n              throw new Error(\n                \"Setting a modal as detachable is not supported by the semanticui binding.\",\n              );\n            }\n            value.detachable = false;\n            document.body.prepend(element);\n          }\n          // The value is probably an object, and is almost certainly a module\n          // configuration for initializing the module\n          console.debug(\n            \"Setting up SemanticUI component:\",\n            key,\n            value,\n            element,\n          );\n          jq_element[key](value);\n        }\n\n        // Set attribute for CSS selector on element. This is used to avoid\n        // initializing SUI jQuery plugins twice on elements.\n        jq_element.attr(\"data-semanticui-\" + key, true);\n      }\n    }\n  },\n};\n\n/**\n * Plausible tracking module\n *\n * This reuses jQuery to provide explicit tracking of events at Plausible. To\n * use events, add the ``data-analytics-events`` attribute to an element. In most\n * cases, this should be a link element, however in the case of other UI\n * components, it may be a ``<div>`` or ``<button>``\n *\n * You may also define custom event properties with\n * ``data-analytics-property-*`` attributes, the attribute value is passed to\n * Plausible.\n *\n *     <button class=\"ui button\"\n *            data-analytics-events=\"some-event-id,another-id\"\n *            data-analytics-property-foo=\"bar\">\n *       Something\n *     </button>\n *\n * In the case of a link with a ``href`` attribute, the link click event will\n * continue after all events have been tracked at Plausible, or after a 1s\n * timeout passes.\n */\nfunction jqueryPlausible(domain, debug = false) {\n  let plausibleSettings = { domain: domain };\n  if (debug === true) {\n    plausibleSettings.trackLocalhost = true;\n  }\n  const { trackEvent } = Plausible(plausibleSettings);\n  const { trackPageview } = Plausible(plausibleSettings);\n\n  // Track pageview for all pages\n  trackPageview();\n\n  return this.each((index, elem) => {\n    // ``data-analytics`` is used on the website, but we added some more\n    // functionality here so ``data-analytics-events`` is preferred.\n    const data = jquery(elem).data();\n    const eventNames =\n      data.analyticsEvents?.split(/,/) || data.analytics?.split(/,/) || [];\n    const eventProperties = {};\n\n    // ``data-analytics-property-*`` attributes are used to populate properties.\n    Object.keys(data).forEach((key) => {\n      const match = key.match(/analyticsProperty(.*)/);\n      if (match) {\n        const [_, property] = match;\n        eventProperties[property.toLowerCase()] = data[key];\n      }\n    });\n\n    function handleAnalyticsEvent(event) {\n      const isLink =\n        elem.tagName != undefined && elem.tagName.toLowerCase() == \"a\";\n      const isMiddleClick = event.type == \"auxclick\" && event.which == 2;\n      const isClick = event.type == \"click\";\n      const isLinkClick =\n        isLink &&\n        isClick &&\n        !elem.target &&\n        !(event.ctrlKey || event.metaKey || event.shiftKey);\n\n      if (isMiddleClick || isClick) {\n        Promise.all(\n          eventNames.map((eventName) => {\n            return new Promise((resolve, reject) => {\n              const options = { callback: resolve, props: eventProperties };\n              trackEvent(eventName, options);\n              // Fallback timeout\n              setTimeout(() => {\n                reject();\n              }, 1000);\n            });\n          }),\n        )\n          .catch((e) => {\n            console.debug(\n              \"Plausible didn't receive a response for one or more event\",\n            );\n          })\n          .finally(() => {\n            console.debug(\n              \"Plausible tracked events:\",\n              eventNames,\n              eventProperties,\n            );\n            if (isLinkClick && elem.href && elem.href != \"#\") {\n              console.debug(\"Plausible replaying click event\", elem.href);\n              window.location = elem.href;\n            }\n          });\n      }\n\n      // If this is a normal click of an anchor element, prevent the default\n      // event from propagating and instead wait until the callback\n      // returns/expires to redirect the current page URL. If the user held\n      // control/shift/meta while clicking, we're assuming the browser is doing\n      // something special instead and will not block the default event.\n      if (isLinkClick) {\n        event.preventDefault();\n        return false;\n      }\n    }\n\n    // TODO support other methods than click\n    elem.addEventListener(\"click\", handleAnalyticsEvent);\n    elem.addEventListener(\"auxclick\", handleAnalyticsEvent);\n  });\n}\n\n/**\n * Tab group SUI module helper\n *\n * The tab module is instantiated in a unique way that conflicts with the normal\n * patterns used for instantiating FUI modules here. Instead of being called on\n * a singular element, the tab module is called on child elements of a menu.\n * That is, the tab module would normally be set up on multiple modules at a\n * time with ``$(\".ui.menu > .item\").tab({...})``.\n *\n * Calling the module on multiple ``.item`` elements in a query is important,\n * or we end up instantiating a tab menu for each menu item and the tab menu\n * does not work correctly.\n *\n * In short, this consolidates the tab module instantiation onto a query\n * instead of a singular element like the ``semanticui`` data binding normal\n * would.\n */\nfunction jquery_tabmenu(settings) {\n  return this.each((index, elem) => {\n    $(elem).find(\".item\").tab(settings);\n  });\n}\n","import ko from \"knockout\";\n\n/**\n * Registry pattern for views, to accumulate public views for templates\n *\n * To avoid using a routing library, or treating this JS as a single page\n * application on top of a Django backend, we simply will make all views\n * available to all templates. This registry ultimately attaches to the\n * main :class:`ApplicationView` instance, and all views will be available in\n * that bound context.\n *\n * See :class:`ApplicationView` here for examples and more information\n */\nexport class Registry {\n  static views = {};\n\n  /**\n   * Add view to registry. View should have ``view_name`` proprety defined.\n   *\n   * A ``view_name`` attribute is required as the class name will change when\n   * the sources are minified.\n   *\n   * @param {class} view - Knockout view to expose to the application\n   */\n  static add_view(view) {\n    if (view.name === undefined) {\n      console.error(\"View view_name is unspecified\", view);\n      return;\n    }\n    this.views[view.view_name] = (...params) => {\n      console.debug(\"Loading view with parameters:\", view.view_name, params);\n      // ignoreDependencies is needed here or the context used by the subview\n      // is incorrect\n      return ko.ignoreDependencies(() => {\n        return new view(...params);\n      }, this);\n    };\n  }\n\n  /**\n   * Attach all of the registered views to a view, almost always, the root\n   * application view.\n   *\n   * @param {ApplicationView} view - View to attach to\n   */\n  attach(view) {\n    for (const [view_name, view_class] of Object.entries(\n      this.constructor.views,\n    )) {\n      view[view_name] = view_class;\n    }\n  }\n}\n","import ko from \"knockout\";\nimport { msg } from \"@lit/localize\";\n\nimport { Registry } from \"../application/registry\";\n\n/**\n * Listing view for social account connections.\n *\n * This view is subclassed by the :js:cls:`LoginView`, as the templates that\n * use this code are shared between the social account connection listing view\n * and the login view. On the social account listing we don't want the same\n * features for last login method etc so this view overloads the functions\n * used.\n */\nexport class SocialAccountView {\n  static view_name = \"SocialAccountView\";\n\n  constructor(options) {\n    this.github_modal_config = ko.observable();\n  }\n\n  show_github_modal() {\n    this.github_modal_config((modal) => modal(\"show\"));\n  }\n\n  // No-op to skip popup setup\n  popup_login_method() {}\n\n  save_login_method() {\n    return true;\n  }\n}\n\n/**\n * LoginView saves a cookie for the last login method.\n *\n * Usage:\n *\n * .. code:: html\n *\n *   <div data-bind=\"using: LoginView()\">\n *     <form method=\"post\" action=\"...\">\n *       <button data-bind=\"click: save_login_method.bind($data, 'email'), semanticui: { popup: popup_login_method('email') }\">\n *         Log in using GitHub\n *       </button>\n *     </form>\n *   </div>\n */\nexport class LoginView extends SocialAccountView {\n  static view_name = \"LoginView\";\n\n  constructor(options) {\n    super(options);\n\n    /** @observable {string} Last tab to be selected. Comes from view */\n    this.last_tab = ko.observable(options?.last_tab || \"vcs\");\n    /** @observable {string} Last method to be used. Comes from view */\n    this.last_method = ko.observable(options?.last_method);\n\n    // This is an named lookup for observables, one for each method. It is\n    // populated by the template code as each popup is configured.\n    this.popups = {};\n  }\n\n  /**\n   * Add popup for login method\n   *\n   * This adds an observable using by the semanticui binding to add and\n   * manipulate a popup module on the element.\n   *\n   * Accepts multiple method ids just because we have a GitHub sub-modal right\n   * now. This can be removed eventually.\n   *\n   * @param {string|Array.<string>} method - Method id or list of method ids\n   * @param {string} position - Position to pass to SUI popup position attribute\n   * @param {string} method - Method id\n   */\n  popup_login_method(method, position = \"top center\") {\n    this.popups[method] = ko.observable((popup) => {\n      // First set up the element as a manual popup, then manually show it.\n      // This is using the anonymous function pattern for passing arguments to\n      // the ``popup()`` jQuery plugin binding, via :func:`application.plugins.semanticui`\n      popup({\n        content: msg(`Last used`),\n        position: position,\n        variation: \"mini teal\",\n        closable: true,\n        preserve: true,\n        on: \"manual\",\n      });\n      if (!Array.isArray(method) && this.last_method() == method) {\n        popup(\"show\");\n      } else if (Array.isArray(method) && method.includes(this.last_method())) {\n        popup(\"show\");\n      }\n    });\n    return this.popups[method]();\n  }\n\n  /**\n   * Save a cookie to track last login method.\n   *\n   * This could be used like:\n   *\n   * .. code:: html\n   *\n   *     <form method=\"post\" action=\"...\">\n   *       <button data-bind=\"click: save_login_method.bind($data, 'email')\">\n   *         Log in using GitHub\n   *       </button>\n   *     </form>\n   *\n   * @param {string} method - Method id\n   * @returns {knockout_click}\n   */\n  save_login_method(method) {\n    console.debug(\"Saving last login method:\", method);\n    let cookie = `last-login-method=${method}`;\n    if (window.isSecureContext) {\n      cookie = cookie + `; Secure`;\n    }\n    document.cookie = cookie;\n    return true;\n  }\n\n  // On top of showing the GitHub modal, show any popups for GitHub providers as\n  // well. This avoids requiring the popups to always be visible and avoids\n  // manual removal of the popups.\n  show_github_modal() {\n    super.show_github_modal();\n    const last_method = this.last_method();\n    if ([\"github\", \"githubapp\"].includes(last_method)) {\n      this.popups[last_method]((popup) => popup(\"show\"));\n    }\n  }\n}\n\nRegistry.add_view(SocialAccountView);\nRegistry.add_view(LoginView);\n","// Build - detail view\n\nimport jquery from \"jquery\";\nimport ko from \"knockout\";\nimport dayjs from \"dayjs\";\nimport RelativeTime from \"dayjs/plugin/relativeTime\";\nimport Duration from \"dayjs/plugin/duration\";\nimport LocalizedFormat from \"dayjs/plugin/localizedFormat\";\n\nimport { Registry } from \"../application/registry\";\n\ndayjs.extend(RelativeTime);\ndayjs.extend(Duration);\ndayjs.extend(LocalizedFormat);\n\n/** Build command output subview, represented in :class:`BuildCommand` as an\n * array of output lines.\n *\n * @param {Object} build_command_output - BuildCommand APIv2 data\n */\nclass BuildCommandOutput {\n  constructor(build_command_output) {\n    /** The command that was executed\n     * @type {string} */\n    this.command = build_command_output.command;\n    /** @observable {string} Build command output line */\n    this.output = ko.observable(build_command_output.output);\n    /** Command output line number provided by :class:`BuildCommand`.\n     * @observable {number} Command output line number */\n    this.line_number = ko.observable(build_command_output.line_number);\n    /** Computed observable for the achor id, the linkable element in the UI.\n     * The anchor matches the syntax ``12--123``, which is the command index in\n     * the array of commands, and the command output line number index in the\n     * array of command output lines.\n     * @computed {string} Anchor id in the syntax ``12--123`` */\n    this.anchor_id = ko.computed(() => {\n      return this.command.id() + \"--\" + this.line_number();\n    });\n\n    /** @observable {Boolean} Is the line selected/highlighted. Selected lines\n     * are lines that are linked to via URL hash */\n    this.is_selected = ko.observable(false);\n  }\n}\n\n/**\n * Build command subview. :class:`BuildDetailView` retains an array of\n * :class:`BuildCommand` objects for display. This class uses an array of\n * :class:`BuildCommandOutput` objects to display individual lines of output.\n *\n * @param {Object} build_command - APIv2 build command data\n */\nclass BuildCommand {\n  constructor(build_command) {\n    // Remove the full path from build command display, and hack debug flag\n    // TODO rely on debug flag from build model when it's added\n    const re_command_trim =\n      /(\\/usr\\/src\\/app|\\/home\\/docs)\\/checkouts\\/readthedocs.org\\/user_builds\\/[^\\/]+\\/[^\\/]+\\/[^\\/]+\\//g;\n    let command = build_command.command.replace(re_command_trim, \"\");\n    let looks_like_debug = false;\n    if (build_command.is_debug === undefined) {\n      const re_commands = /^(pip freeze|cat .*conf.py)$/;\n      looks_like_debug = command.match(re_commands);\n    }\n    const is_debug = build_command.is_debug || looks_like_debug;\n\n    /** @observable {number} Build command id */\n    this.id = ko.observable(build_command.id);\n    /** @observable {string} Build command executed */\n    this.command = ko.observable(command);\n    /** @observable {number} Build command posix exit code */\n    this.exit_code = ko.observable(build_command.exit_code || 0);\n    /** @computed {Boolean} Was :func:`exit_code` successful? */\n    this.is_successful = ko.computed(() => {\n      return this.exit_code() === 0;\n    });\n    /** @computed {Boolean} Did command emit exit code 183? */\n    this.is_cancelled = ko.computed(() => {\n      return this.exit_code() === 183;\n    });\n    /** @observable {number} Command run time in seconds */\n    this.run_time = ko.observable(build_command.run_time);\n    /** @observable {number} Command end time in seconds */\n    this.end_time = ko.observable(build_command.end_time);\n    /** @computed {Boolean} Command is finished running? */\n    this.finished = ko.computed(() => {\n      return this.end_time() !== null;\n    });\n    /** @computed {Boolean} This command is a debug class command */\n    this.is_debug = ko.observable(is_debug);\n    /** @computed {Boolean} Hide debug commands until debug mode is enabled */\n    this.is_visible = ko.computed(\n      () => {\n        if (this.is_debug()) {\n          return false;\n        } else {\n          return true;\n        }\n      },\n      null,\n      { deferEvaluation: true },\n    );\n    /** @computed {string} Command text class */\n    this.command_class = ko.computed(() => {\n      if (this.is_debug()) {\n        return \"grey\";\n      } else if (this.is_cancelled()) {\n        return \"yellow\";\n      } else {\n        return this.is_successful() ? \"olive\" : \"red\";\n      }\n    });\n\n    /** @observable {Boolean} Is this command expanded? Failed commands are\n     * expanded by default. */\n    this.is_expanded = ko.observable((build_command.exit_code || 0) > 0);\n    this.exit_code.subscribe((exit_code) => {\n      if (exit_code !== undefined && exit_code > 0) {\n        this.is_expanded(true);\n      }\n    });\n\n    /** @observable {string} Raw command output */\n    this.output = ko.observable();\n    /** @computed {Array.<BuildCommandOutput>} Split output lines */\n    this.output_lines = ko.computed(\n      () => {\n        const output_lines = this.output().split(/\\n/);\n\n        return output_lines.map((line, index) => {\n          return new BuildCommandOutput({\n            command: this,\n            output: line,\n            line_number: index + 1,\n          });\n        });\n      },\n      null,\n      { deferEvaluation: true },\n    );\n\n    this.output(build_command.output);\n    // TODO color output is disabled for now. This needs to be async due to the\n    // extra libraries loaded, and should block page load, polling, and updating\n    // the selected line. This also requires an application change.\n    // this.color_output(build_command.output);\n  }\n\n  /**\n   * Add ANSI coloring and other fun to output string. Modules used here are\n   * dynamically loaded separate from the normal vendor bundle. This is to\n   * reduce the size of the standard vendor bundle.\n   *\n   * @param {string} output - The output string to colorize\n   * @returns {Promise}\n   */\n  color_output(output) {\n    // Dynamically load expensive chunks. These will be kept out of the normal\n    // vendor bundle.\n    return import(\n      /* webpackChunkName: 'ansi_up' */\n      \"ansi_up\"\n    ).then(({ default: AnsiUp }) => {\n      // Build output lines\n      let ansi_up = new AnsiUp();\n      ansi_up.use_classes = true;\n      output = ansi_up.ansi_to_html(output);\n      // TODO use dompurify here\n      //output = DOMPurify.sanitize_html(output);\n      return output;\n    });\n  }\n\n  /**\n   * Toggle :func:`is_expanded`, used to expand command output\n   *\n   * This is triggered by a click event, so ``false`` is returned to avoid\n   * default behavior and event propagation.\n   */\n  toggle_expanded() {\n    this.is_expanded(!this.is_expanded());\n    return false;\n  }\n}\n\n/**\n * Build detail view shows build metadata, build commands, and build command\n * output. In most cases you are only passing in the build pk, and relying on\n * the API to fill in the rest of the build data.\n *\n * Usage from a Django template:\n *\n * .. code:: html\n *\n *     <div data-bind=\"using: BuildDetailView({id: {{ build.pk }}}, '{% url ... %}', '{% url ... %}')\"></div>\n *\n * @param {Object} build - API data for a build.\n */\nexport class BuildDetailView {\n  static view_name = \"BuildDetailView\";\n\n  constructor(build = {}, url_api_build, url_api_notifications) {\n    /** @type {number} The build pk/id to fetch */\n    this.id = build.id;\n    /** @type {string} APIv2 build detail API URL */\n    this.url_api_build = url_api_build;\n    /** @type {string} APIv3 build notification API URL */\n    this.url_api_notifications = url_api_notifications;\n\n    /** @observable {Boolean} Was for successful build or not */\n    this.success = ko.observable(build.success);\n    /** @observable {string} Build error message */\n    this.error = ko.observable(build.error);\n    /** @observableArray {Object} List of notifications from API */\n    this.notifications = ko.observableArray();\n    /** @computed {Boolean} Has notifications? */\n    this.has_notifications = ko.computed(() => {\n      return this.notifications().length > 0;\n    });\n\n    /** @obsevable {string} Build state */\n    this.state = ko.observable(build.state);\n    /** @observable {string} Build state as a display string */\n    this.state_display = ko.observable(build.state_display);\n\n    // State helpers that are not modeled from the backend API\n    /** @observable {Boolean} Is the build in a finished state? */\n    this.is_finished = ko.observable(false);\n    /** @observable {Boolean} Have we received data from the API yet? */\n    this.is_loading = ko.observable(true);\n    /** @observable {Boolean} Build can be cancelled */\n    this.can_cancel = ko.observable(false);\n    /** @observable {Boolean} Build can be retried */\n    this.can_retry = ko.observable(false);\n    /** @observable {Boolean} There was doc output in the build */\n    this.can_view_docs = ko.observable(false);\n\n    /** @observable {Boolean} Is the command output wrapped? */\n    this.is_wrapped = ko.observable(true);\n\n    // Consolidate all of the observable updates that depend on build state\n    this.state.subscribe((state) => {\n      this.update_state(state);\n    });\n\n    /** SUI progress module config/behavior\n     * @computed {Object or Function} the parameters to pass to the module call\n     *\n     * See the `semanticui` Knockout plugin for more information */\n    this.progress_config = ko\n      .computed(() => {\n        const state = this.state();\n        const states = [\n          \"triggered\",\n          \"queued\",\n          \"cloning\",\n          \"installing\",\n          \"building\",\n          \"uploading\",\n          \"finished\",\n        ];\n        // If this is the first update, configure the module. If this is an\n        // update, then send progress updates using module behaviors instead.\n        if (ko.computedContext.isInitial()) {\n          return {\n            autoSuccess: false,\n            value: states.indexOf(state),\n            total: states.length - 1,\n            label: this.state_display(),\n          };\n        } else {\n          if (this.is_finished()) {\n            const is_cancelled = state === \"cancelled\";\n            const is_failed = this.error() || this.success() === false;\n            if (is_cancelled) {\n              return (progress) => {\n                progress(\"set warning\", \"Build cancelled\");\n              };\n            } else if (is_failed) {\n              return (progress) => {\n                // TODO translate this in the application or templates\n                progress(\"set error\", \"Build failed\");\n              };\n            } else {\n              return (progress) => {\n                // TODO translate this in the application or templates\n                progress(\"set success\", \"Build succeeded\");\n              };\n            }\n          } else {\n            return (progress) => {\n              progress(\"set progress\", states.indexOf(state));\n              progress(\"set label\", this.state_display());\n            };\n          }\n        }\n      })\n      .extend({\n        // Debounce API updates, so we aren't triggering this once for each\n        // observable update -- from the API response for example.\n        deferred: true,\n      });\n\n    // Date and time manipulation\n    /* @observable {number} Build date ... as integer? TBD */\n    this.date = ko.observable(build.date);\n    /* @observable {number} Build length in seconds */\n    this.length = ko.observable(build.length);\n    /* @observable {string} Build date display in a localized format */\n    this.date_display = ko.observable();\n    /* @observable {string} Build date as a relative format */\n    this.date_display_since = ko.observable();\n    /* @observable {string} Build length in a human readable format */\n    this.length_display = ko.observable();\n\n    this.date.subscribe((date) => {\n      const date_readable = dayjs(date);\n      this.date_display(date_readable.format(\"llll\"));\n      this.date_display_since(date_readable.fromNow());\n    });\n    this.length.subscribe((length) => {\n      let duration;\n      if (length) {\n        duration = dayjs.duration(length, \"seconds\");\n      } else {\n        // Infer length from build start time\n        const dateNow = dayjs();\n        const dateStart = dayjs(this.date());\n        duration = dayjs.duration(dateNow.diff(dateStart));\n      }\n      let formatParts = [\"s[s]\"];\n      if (duration.minutes()) {\n        formatParts.unshift(\"m[m]\");\n      }\n      if (duration.hours()) {\n        formatParts.unshift(\"H[h]\");\n      }\n      this.length_display(duration.format(formatParts.join(\" \")));\n    });\n\n    /* Output */\n    /** @observable {Object} Build configuration used for the build */\n    this.config = ko.observable();\n    /** @observable {string} The build instance to process the build */\n    this.builder = ko.observable(build.builder);\n    /** @observable {Array.<Object>} Build command objects as an array */\n    this.commands = ko.observableArray(build.commands);\n\n    /** @observable {string} Repository commit for the build */\n    this.commit = ko.observable(build.commit);\n    /** @computed {string} A truncated version of the build commit */\n    this.commit_short = ko.computed(() => {\n      let commit = this.commit();\n      if (commit) {\n        return commit.substring(0, 8);\n      }\n    });\n    /** @observable {string} URL for build's documentation */\n    this.docs_url = ko.observable(build.docs_url);\n    /** @observable {string} URL for build commit */\n    this.commit_url = ko.observable(build.commit_url);\n\n    /* Others */\n    /** This is old old build output, before we were separating commands by\n     * build command and just lumping evertying by STDOUT/STDERR. Oooof. We\n     * don't want to show these, and probably just want to show a \"Sorry, this\n     * is too old\" error.\n     * @observable {Boolean} Build output doesn't have build commands */\n    this.legacy_output = ko.observable(false);\n\n    // Selected line handling\n    /** The selected command and command line are updated when the window hash\n     * (anchor) changes. The hash is meant to be in the format of ``12--123``,\n     * which is the command id and the command id output line number.\n     * @observable {string} The window hash/anchor */\n    this.selected_hash = ko.observable(jquery(location).attr(\"hash\"));\n    this.selected_hash.subscribe((selected_hash) => {\n      jquery(location).attr(\"hash\", selected_hash);\n    });\n    /** @observable {BuildCommandOutput} The command line found from the selected hash*/\n    this.selected_line = ko.observable();\n    // Remove the selected state on the current/old selected line\n    this.selected_line.subscribe(\n      (selected_line_prev) => {\n        if (selected_line_prev) {\n          selected_line_prev.is_selected(false);\n        }\n      },\n      this,\n      \"beforeChange\",\n    );\n    // Update the new selected line\n    this.selected_line.subscribe((selected_line) => {\n      if (selected_line.command.is_debug()) {\n        this.show_debug(true);\n      }\n      selected_line.command.is_expanded(true);\n      selected_line.is_selected(true);\n      this.selected_hash(selected_line.anchor_id());\n    });\n\n    /* Debug */\n    /** @observable {Boolean} Show debug/info commands */\n    this.show_debug = ko.observable(false);\n\n    /** @observable {Boolean} Are we still polling the API? */\n    this.is_polling = ko.observable(true);\n    this.is_polling.subscribe((is_polling) => {\n      if (!is_polling) {\n        this.set_selected_line_from_hash(this.selected_hash());\n      }\n    });\n\n    if (this.url_api_build) {\n      this.poll_api_build();\n    }\n    if (this.url_api_notifications) {\n      this.poll_api_notifications();\n    }\n  }\n\n  /**\n   * Continually poll our APIv2 for build object and update Build, BuildCommand,\n   * and BuildCommandOutput states. When the API return indicates the build is\n   * finished, we stop recursive polling.\n   */\n  poll_api_build() {\n    jquery\n      .getJSON(this.url_api_build)\n      .then((data) => {\n        this.date(data.date);\n        this.success(data.success);\n        this.error(data.error);\n        this.length(data.length);\n        this.commit(data.commit);\n        this.docs_url(data.docs_url);\n        this.commit_url(data.commit_url);\n        this.builder(data.builder);\n        this.config(data.config);\n        this.state(data.state);\n        this.state_display(data.state_display);\n\n        // Always update date and length, as these should update as the build progresses\n        this.date.valueHasMutated();\n        this.length.valueHasMutated();\n\n        // This is a mock command used to preview the command output.\n        // TODO probably do this in the application instead\n        this.add_command({\n          id: 0,\n          command: \"readthedocs-build --show-config\",\n          output: JSON.stringify(data.config, null, \"  \"),\n          exit_code: 0,\n          run_time: 0,\n          is_debug: true,\n        });\n        for (const command of data.commands) {\n          this.add_command(command);\n        }\n\n        // We've completed a request to the API. From here, we are not loading\n        // from the API, but we'll be polling until the build is finished.\n        this.is_loading(false);\n      })\n      .then(() => {\n        // Continually poll API while build is not finished. If it is in a finished\n        // state, this method will return without setting another timer. We do not\n        // updated :attr:`is_polling` by computed/subscription as we want to ensure\n        // this update happens at the very end of API updates instead.\n        if (this.is_finished()) {\n          this.is_polling(false);\n        } else {\n          setTimeout(() => {\n            this.poll_api_build();\n            this.poll_api_notifications();\n          }, 2000);\n        }\n      });\n  }\n\n  /** Poll APIv3 build notification API directly\n   *\n   * We have to do this because we rely on the build APIv2 for everything else\n   * and the APIv3 build endpoints don't have the data required yet.\n   *\n   * TODO this should all happen under a single build API v3 poll instead, and\n   * this method should go away.\n   *\n   * @param {str} url - APIv3 build notification endpoint\n   */\n  poll_api_notifications() {\n    const params = {\n      state__in: \"read,unread\",\n    };\n    jquery.getJSON(this.url_api_notifications, params).then((data) => {\n      if (data.results) {\n        this.notifications(data.results);\n      }\n    });\n  }\n\n  /** Add a command to :attr:`commands` if it doesn't already exist\n   *\n   * @param {Object} command - Build command API data structure\n   */\n  add_command(command) {\n    const command_found = ko.utils.arrayFirst(\n      this.commands(),\n      (command_search) => {\n        return command_search.id() === command.id;\n      },\n    );\n    if (command_found) {\n      command_found.output(command.output);\n      command_found.exit_code(command.exit_code || 0);\n      command_found.run_time(command.run_time);\n      command_found.end_time(command.end_time);\n    } else {\n      this.commands.push(new BuildCommand(command));\n    }\n  }\n\n  /**\n   * Set the selected line and focus on the new selected element\n   *\n   * This is called from :meth:`set_selected_line_from_hash`, but also from the\n   * line number link click event. We return ``false`` at the end to avoid the\n   * default behavior and event propagation.\n   *\n   * @param {BuildCommandOutput} selected_line - Command output line to target\n   */\n  set_selected_line(selected_line) {\n    this.selected_line(selected_line);\n    // The attribute ``data-selected`` is set in the templates. This isn't\n    // ideal, but easier than a custom KO plugin.\n    const elem = document.querySelector(\"[data-selected=true]\");\n    if (elem) {\n      if (elem.scrollIntoView) {\n        // Try modern centered focus on element, instead of focus at the top of\n        // the viewport.\n        elem.scrollIntoView({\n          behavior: \"auto\",\n          block: \"center\",\n          inline: \"center\",\n        });\n      } else {\n        // Back up to the default focus for old browsers\n        jquery(elem).focus();\n      }\n    }\n    return false;\n  }\n\n  /**\n   * Set the selected line by looking up the line that corresponds to the\n   * selected anchor hash.\n   *\n   * This loops over the commands and lines to reduce the number of operations.\n   * Normally, :attr:`BuildCommandOutput.is_selected` might be a computed\n   * observable, but then updates to the selected line are always O(n), for\n   * every line of output, across all commands. We can reduce this greatly by\n   * iterating over commands, then command lines.\n   *\n   * @param {string} selected_hash - Hash to lookup\n   */\n  set_selected_line_from_hash(selected_hash) {\n    const re_hash = /^#(\\d+)--(\\d+)$/; // (?:$|(\\d+)$)/; // multiple lines!\n\n    if (selected_hash) {\n      let found = selected_hash.match(re_hash);\n\n      if (!found) {\n        return;\n      }\n\n      const selected_command = ko.utils.arrayFirst(\n        this.commands(),\n        (command_search) => {\n          return command_search.id() == found[1];\n        },\n      );\n      if (selected_command) {\n        const selected_line = ko.utils.arrayFirst(\n          selected_command.output_lines(),\n          (output_line) => {\n            return output_line.line_number() == found[2];\n          },\n        );\n\n        if (selected_line) {\n          this.set_selected_line(selected_line);\n        }\n      }\n    }\n  }\n\n  // TODO is this needed? This is likely old view cruft\n  show_legacy_output() {\n    this.legacy_output(true);\n  }\n\n  /** Helper for toggling debug mode on the view. This hides some informational\n   * commands and the configuration file output step */\n  toggle_debug() {\n    const show_debug = this.show_debug();\n    this.show_debug(!show_debug);\n  }\n\n  /** Update all attributes and observables that depend on build state */\n  update_state(state) {\n    // Is build in one of the finished states?\n    if ([\"finished\", \"cancelled\"].includes(state)) {\n      this.is_finished(true);\n      this.can_cancel(false);\n      // TODO there is more logic on whether a build can retry in the\n      // application, but this is not surfaced in the API response.\n      this.can_retry(true);\n\n      if (this.success()) {\n        this.can_view_docs(true);\n      }\n    } else {\n      // We use any other status here to finally update ``can_cancel`` from\n      // it's default of ``false``. The default ensure we don't flash the\n      // button if the API response ends up showing that the build finished.\n      this.can_cancel(true);\n    }\n  }\n}\n\nRegistry.add_view(BuildDetailView);\n","import ko from \"knockout\";\nimport jquery from \"jquery\";\n\nimport { Registry } from \"../application/registry\";\n\n// Constants, pulled from SUI:\n// https://semantic-ui.com/elements/container.html\nconst breakpoints = {\n  mobile: 0,\n  tablet: 768,\n  computer: 992,\n  large_screen: 1200,\n};\n\n/**\n * :class:`ResponsiveView` is used to create bindings that alter elements on\n * changes to the viewport width. This can be used to add an SUI class when the\n * viewport width changes.\n *\n * Usage in a binding context:\n *\n * .. code:: html\n *\n *   <div class=\"ui menu\" data-bind=\"css: {vertical: device.mobile()}\">\n *   <div class=\"ui menu\" data-bind=\"css: {vertical: device.tablet()}\">\n *   <div class=\"ui menu\" data-bind=\"css: {vertical: device.computer()}\">\n *   <div class=\"ui menu\" data-bind=\"css: {vertical: device.large_screen()}\">\n */\nexport class ResponsiveView {\n  constructor() {\n    this.viewport_width = ko.observable();\n    this.device = {\n      mobile: ko.observable(true),\n      tablet: ko.observable(false),\n      computer: ko.observable(false),\n      large_screen: ko.observable(false),\n    };\n\n    // Don't send too many events to listeners\n    this.viewport_width.extend({ ratelimit: 500 });\n    this.viewport_width.subscribe((width) => {\n      for (const device_name of Object.keys(this.device)) {\n        const is_device = width >= breakpoints[device_name];\n        this.device[device_name](is_device);\n      }\n    });\n\n    // Update window width. This will trigger changes to this.device\n    const jq_window = jquery(window);\n    const fn_update = () => {\n      this.viewport_width(jq_window.width());\n    };\n    jq_window.on(\"resize\", fn_update);\n    fn_update();\n  }\n}\n\n/**\n * Base class for API listing views. Provides a foundation for waiting to load\n * data from an API, loading data from an API request, and handling the data.\n *\n * ``data`` parameter needs an ``id`` and ``url`` property.\n *\n */\nexport class APIListItemView {\n  constructor(data) {\n    this.id = data.id;\n    this.url = data.url;\n    /** @observable {Boolean} Is the API request started loading? */\n    this.loaded = ko.observable(false);\n    /** @observable {Boolean} Is the API request done loading? */\n    this.loading = ko.observable(false);\n    /** The central promise for the request.\n     * @type {Promise} */\n    this.promise = null;\n    /** @observable {Object} The data returned from the API */\n    this.data = ko.observable();\n  }\n\n  /**\n   * Using the supplied configuration, perform an API request. Sets up\n   * :attr:`promise` so that the child class can manage promise resolve and\n   * reject\n   */\n  fetch() {\n    if (this.promise) {\n      return this.promise;\n    }\n    this.promise = new Promise((resolve, reject) => {\n      if (this.loaded()) {\n        return resolve(this.data());\n      }\n      this.loading(true);\n      jquery.getJSON(this.url).then((data) => {\n        this.data(data);\n        this.loaded(true);\n        this.loading(false);\n        return resolve(data);\n      });\n    });\n  }\n}\n\n// And some partial views for base template components\n\n/**\n * HeaderView\n */\nexport class HeaderView {\n  static view_name = \"HeaderView\";\n\n  constructor() {\n    /** Configuration passed in via :func:`~application.plugins.jsonInit`\n     * @observable {Object} Header configuration, mostly for search */\n    this.config = ko.observable();\n    /** SUI search configuration object, used from templates\n     * @observable {Object} Search configuration */\n    this.search_project_config = ko.observable();\n\n    // Wait for :func:`config` to change before we init search\n    this.config.subscribe((config) => {\n      if (config === undefined) {\n        return;\n      }\n      // The URL from the config object is a relative URL, we'll use the\n      // window URL origin as the full URL\n      const url = new URL(config.api_projects_list_url, window.location.origin);\n      url.search = \"?name={query}\";\n      this.search_project_config({\n        type: \"category\",\n        apiSettings: {\n          url: url.href,\n          onResponse: (resp) => {\n            const projects = resp.results.map((elem, index) => {\n              // TODO description might be better off in the application model\n              let description = elem.slug;\n              if (elem.subproject_of) {\n                // TODO localize this\n                description = \"Subproject of \" + elem.subproject_of.name;\n              } else if (elem.translation_of) {\n                // TODO localize this\n                description =\n                  elem.language.name +\n                  \" translation of \" +\n                  elem.translation_of.name;\n              }\n\n              // Normalize URL for use in non-standard domain names\n              // TODO this is a hack to support alternative domains, like our\n              // beta/staging instance. This can be removed when there is only\n              // one dashboard subdomain.\n              let url_project = new URL(elem.urls.home);\n              let url_window = new URL(window.location.href);\n              if (url_project.hostname != url_window.hostname) {\n                url_project.hostname = url_window.hostname;\n              }\n\n              return {\n                title: elem.name,\n                description: description,\n                url: url_project.toString(),\n              };\n            });\n            const results = {\n              results: {\n                \"category-projects\": {\n                  name: \"Projects\",\n                  results: projects,\n                },\n              },\n            };\n            return results;\n          },\n        },\n        minCharacters: 2,\n      });\n    });\n  }\n}\nRegistry.add_view(HeaderView);\n","import jquery from \"jquery\";\nimport ko from \"knockout\";\nimport { loadStripe } from \"@stripe/stripe-js/dist/pure.esm.js\";\n\nimport { Registry } from \"../application/registry\";\n\nclass StripeCheckoutView {\n  static view_name = \"StripeCheckoutView\";\n\n  constructor(config) {\n    this.stripeKey = config.stripeKey || \"\";\n    this.checkoutSessionUrl = config.checkoutSessionUrl || \"\";\n    this.csrfToken = config.csrfToken || \"\";\n\n    this.stripe = ko.observable();\n    this.stripeLoading = ko.observable(true);\n\n    this.priceId = ko.observable();\n\n    this.initializeStripe();\n  }\n\n  /**\n   * Load Stripe JS client dynamically\n   *\n   * The package installed through NPM is just a wrapper for the Stripe hosted\n   * JS, which is required for PCI compliance. We treat this similar to a Webpack\n   * dynamic import and wait to load the library until doing anything with it.\n   * The form element will appear disabled while the library is loading.\n   */\n  initializeStripe() {\n    return loadStripe(this.stripeKey).then((stripe) => {\n      this.stripe(stripe);\n      this.stripeLoading(false);\n    });\n  }\n\n  /**\n   * Click event handler for the Gold subscription form\n   *\n   * This posts to an internal URL to generate the Stripe checkout session and\n   * then redirects the user\n   */\n  createCheckoutSession() {\n    this.stripeLoading(true);\n\n    fetch(this.checkoutSessionUrl, {\n      method: \"POST\",\n      headers: {\n        \"Content-Type\": \"application/json\",\n        \"X-CSRFToken\": this.csrfToken,\n      },\n      body: JSON.stringify({\n        priceId: this.priceId(),\n      }),\n    })\n      .then((result) => {\n        this.stripeLoading(false);\n        result.json().then((data) => {\n          this.stripe().redirectToCheckout({ sessionId: data.session_id });\n        });\n      })\n      .catch((err) => {\n        this.stripeLoading(false);\n      });\n  }\n}\n\nRegistry.add_view(StripeCheckoutView);\n","import { LitElement } from \"lit\";\n\n/**\n * LightDOMElement\n *\n * This is a helper class for using a light DOM with LitElement\n * instead of a shadow DOM. Light DOM is what allows FUI styles\n * to be used inside the element.\n *\n * Also adds some debugger helpers.\n **/\nexport class LightDOMElement extends LitElement {\n  // Use light DOM with inherited styles instead of shadow DOM\n  createRenderRoot() {\n    return this;\n  }\n\n  // And some debugging calls\n  connectedCallback() {\n    super.connectedCallback();\n\n    console.debug(\"Setting up web component instance:\", this.constructor.name);\n  }\n\n  disconnectedCallback() {\n    super.disconnectedCallback();\n\n    console.debug(\n      \"Disconnecting web component instance:\",\n      this.constructor.name,\n    );\n  }\n}\n","import { LitElement, css, html, nothing, unsafeCSS } from \"lit\";\nimport pureRand from \"pure-rand\";\n\nimport { LightDOMElement } from \"../application/elements\";\n\n// This image lives alongside our CSS sources, and bundling outputs this image\n// to the application static path. From here, Django ``static`` template tag is\n// used to reference the file through storage. So, this import is not directly\n// needed here, and this might be a pattern to redo eventually.\nimport avatarImage from \"../../css/images/avatar-1.png\";\n\nexport class AvatarElement extends LitElement {\n  static properties = {\n    seed: { type: String },\n    url: { type: String },\n  };\n\n  static styles = css`\n    :host {\n      --avatar-x: 0;\n      --avatar-y: 0;\n      --avatar-scale: -10px;\n      --avatar-background-image: none;\n    }\n\n    :host > div {\n      background-image: var(--avatar-background-image);\n      background-repeat: no-repeat;\n      background-size: calc(100 * -1 * var(--avatar-scale))\n        calc(100 * -1 * var(--avatar-scale));\n      background-position-x: calc(var(--avatar-x) * var(--avatar-scale));\n      background-position-y: calc(var(--avatar-y) * var(--avatar-scale));\n      image-rendering: pixelated;\n      width: calc(var(--avatar-scale) * -4);\n      height: calc(var(--avatar-scale) * -4);\n    }\n  `;\n\n  render() {\n    return html`<div></div>`;\n  }\n\n  updated(changed) {\n    // Dynamically update background position through CSS variables. The\n    // ``styles`` attribute does not work with dynamic rules, but we can do the\n    // same after an updated event on the web component.\n    if (changed.has(\"seed\") && this.seed) {\n      const rng = pureRand.xoroshiro128plus(this.seed);\n      const posX = pureRand.unsafeUniformIntDistribution(0, 99, rng);\n      const posY = pureRand.unsafeUniformIntDistribution(0, 99, rng);\n      this.style.setProperty(\"--avatar-x\", posX);\n      this.style.setProperty(\"--avatar-y\", posY);\n    }\n    // Similarly, load the image through the avatar URL attribute, as we want\n    // the fully resolved storage URL from Django staticfiles.\n    if (changed.has(\"url\") && this.url) {\n      this.style.setProperty(\"--avatar-background-image\", `url(\"${this.url}\")`);\n    }\n  }\n}\n\ncustomElements.define(\"readthedocs-avatar\", AvatarElement);\n","import ko from \"knockout\";\nimport jquery from \"jquery\";\n\nimport { Registry } from \"../application/registry\";\n\n/**\n * Collapsing header view, for project and organization detail pages\n *\n * @class\n * @constructor\n * @public\n */\nexport class CollapsingHeaderView {\n  static view_name = \"CollapsingHeaderView\";\n\n  constructor(collapsed = true) {\n    /** @observable {Object} Whether the header view is collapsed by default */\n    this.is_collapsed = ko.observable(collapsed);\n\n    /** Computed observable for the dropdown link class, so it swaps\n     *\n     * @computed {Object} CSS class for dropdown link\n     */\n    this.dropdown_class = ko.computed(() => {\n      return this.is_collapsed() ? \"fa-caret-down\" : \"fa-caret-up\";\n    });\n  }\n\n  toggle_collapsed() {\n    const value = this.is_collapsed();\n    this.is_collapsed(!value);\n  }\n}\nRegistry.add_view(CollapsingHeaderView);\n","import ko from \"knockout\";\nimport jquery from \"jquery\";\n\nimport { Registry } from \"../application/registry\";\n\n/**\n * Base view for configuring a view filter.\n *\n * Filters fields are all individually configured with the ``filter_config``\n * property as the configuration for the FUI dropdown element. This\n * configuration converts an ``onchange`` event into a form submission\n * automatically.\n *\n * This configuration is used directly in the ``includes/filter/form.html``\n * include, once per filter field.\n *\n * @class\n * @constructor\n * @public\n */\nexport class FilterView {\n  static view_name = \"FilterView\";\n\n  constructor() {\n    this.filter_config = {\n      action: \"activate\",\n      onChange: (value, label, $elem) => {\n        // Note: limit use of jQuery selector aid. It's confusing to mix Django\n        // templates, knockout, and random jQuery selections in the page. Most\n        // of the time, you should be able to use a knockout binding, but this\n        // was rather trivial and resulted in no additional observables on the\n        // view.\n        const form = $elem.closest(\"form\");\n        form.submit();\n      },\n    };\n  }\n}\nRegistry.add_view(FilterView);\n","import jquery from \"jquery\";\n\nimport { html } from \"lit\";\nimport { when } from \"lit/directives/when.js\";\nimport { ref, createRef } from \"lit/directives/ref.js\";\n\nimport { LightDOMElement } from \"../application/elements\";\n\n/**\n * Field element web component base class\n *\n * This element wraps fields from Crispy/Django. These elements follow a progressive enhancement, rely on direct DOM manipulation instead of\n * rendering the full element from a Lit template. This helps keeps parent web components purely rendered.\n *\n * These elements will be most helpful used from parent web components:\n *\n * .. code:: javascript\n *\n *     render() {\n *       return html`\n *         <readthedocs-input-field\n *             .value=\"${this.value}\"\n *             .disabled=\"${this.disabled}\"\n *             @change=\"${this.handler}\">\n *           <input type=\"text\" name=\"foo\" />\n *         </readthedocs-input-field>\n *       `;\n *\n * @property {String} value - Input field value for the form\n * @property {Boolean} disabled - Is the field in a disabled state? Controls tab index\n * @property {String} selector - CSS selector used to find the input in the light DOM\n * @property {Boolean} hasError - Are there errors in the field\n * @fires change - Event fired on attribute and error state changes\n */\nexport class FieldElement extends LightDOMElement {\n  static properties = {\n    value: { type: String },\n    disabled: { type: Boolean },\n    selector: { type: String },\n    hasError: { type: Boolean },\n  };\n\n  /** @attr {Ref} refInput - Reference to the input element */\n  refInput = createRef();\n  /** @attr {Ref} refErrors - Reference to the errors list element */\n  refErrors = createRef();\n\n  constructor() {\n    super();\n    this.selector = \"input[name]\";\n    this.hasError = false;\n  }\n\n  /**\n   * Manually configure element references, we can't use a render template to\n   * establish element references via ``ref()``.\n   */\n  connectedCallback() {\n    super.connectedCallback();\n    this.refInput.value = this.querySelector(this.selector);\n    this.refErrors.value = this.querySelector(\".ui.negative.label\");\n    this.hasError = Boolean(this.refErrors.value);\n  }\n\n  /**\n   * Set tab index on field to protect disabled fields from keyboard focus.\n   *\n   * Field types have differing elements that will need to alter tab index, so\n   * this can be overridden for any inherited classes.\n   */\n  set tabIndex(tabIndex) {\n    const elemInput = this.refInput.value;\n    elemInput.setAttribute(\"tabIndex\", tabIndex);\n  }\n\n  /**\n   * Setter for input field value, this can vary by subclass.\n   */\n  set inputValue(value) {\n    const elemInput = this.refInput.value;\n    elemInput.value = this.value;\n  }\n\n  /**\n   * Lit updated properties from Lit property lifecycle.\n   *\n   * This is finally called for any properties , reflect these in the already\n   * rendered child elements.\n   *\n   * @param {Map} changed - properties that have changed on first update\n   */\n  updated(changed) {\n    if (changed.has(\"value\")) {\n      this.inputValue = this.value;\n    }\n    if (changed.has(\"disabled\")) {\n      this.tabIndex = this.disabled ? -1 : 0;\n    }\n    if (changed.has(\"hasError\") && this.hasError) {\n      this.dispatchChangeEvent();\n    }\n  }\n\n  /**\n   * Emit change event from this event\n   *\n   * In a Lit template, subscribe to this event in a render template with:\n   * ``<readthedocs-field @change=\"${this.someEventHandler}\">``.\n   *\n   * @fires change - Change event fired on property changes and error state\n   */\n  dispatchChangeEvent() {\n    this.dispatchEvent(\n      new CustomEvent(\"change\", {\n        bubbles: false,\n        composed: false,\n      }),\n    );\n  }\n\n  /**\n   * Clear error state and Crispy error elements\n   */\n  clearErrors() {\n    if (this.hasError) {\n      const elemErrors = this.refErrors.value;\n      elemErrors.remove();\n      this.hasError = false;\n    }\n  }\n}\n\n/**\n * Field element for InputElement driven form fields\n *\n * Update events on the input element trigger changes here and emit events for\n * changes in the parent element.\n */\nclass InputFieldElement extends FieldElement {\n  connectedCallback() {\n    super.connectedCallback();\n    const elemInput = this.refInput.value;\n    if (elemInput) {\n      this.value = elemInput.value;\n      elemInput.addEventListener(\"change\", (event) => {\n        this.dispatchChangeEvent();\n        event.stopPropagation();\n      });\n    }\n  }\n}\ncustomElements.define(\"readthedocs-input-field\", InputFieldElement);\n\n/**\n * Field element for SUI dropdown driven form fields\n *\n * This relies on the SUI dropdown module and module behaviors to drive all of\n * the element properties and dropdown UI manipulation.\n *\n * @property {String} description - Rich select field choice description data\n * @fires change - On dropdown select and initial element set up, fires event\n */\nexport class RichSelectFieldElement extends FieldElement {\n  static get properties() {\n    const properties = FieldElement.properties;\n    properties.description = { type: String };\n    return properties;\n  }\n\n  constructor() {\n    super();\n    this.selector = \".ui.dropdown\";\n  }\n\n  connectedCallback() {\n    super.connectedCallback();\n    if (this.refInput.value) {\n      this.dropdown({\n        fireOnInit: true,\n        onChange: (value, text, $selected) => {\n          // $selected is a jQuery element\n          const selected = $selected[0];\n          this.value = selected.dataset.value;\n          this.description = selected.dataset.description;\n          this.dispatchChangeEvent();\n        },\n      });\n    }\n  }\n\n  /**\n   * Call SUI dropdown module\n   *\n   * This calls into the SUI jQuery ``dropdown`` module and can be used for\n   * both configuring the module or calling any of the behaviors the module\n   * provides (see https://fomantic-ui.com/modules/dropdown.html#behavior)\n   *\n   * @param {...*} args - All arguments to this functionm pass through\n   */\n  dropdown(...args) {\n    return jquery(this.refInput.value).dropdown(...args);\n  }\n\n  set inputValue(value) {\n    // Call ``set selected`` behavior with ``value`` and ``preventChangeTrigger=true``\n    // to avoid retriggering the ``onChange`` callback.\n    this.dropdown(\"set selected\", value, true);\n  }\n\n  set tabIndex(tabIndex) {\n    // The module behavior ``set tabbable`` does not seem to work like we want,\n    // don't use it here and instead alter the input manually.\n    this.refInput.value\n      .querySelector(\"input.search\")\n      .setAttribute(\"tabIndex\", tabIndex);\n  }\n}\ncustomElements.define(\"readthedocs-richselect-field\", RichSelectFieldElement);\n","import jquery from \"jquery\";\nimport { LitElement, css, html, nothing } from \"lit\";\nimport { ContextProvider, ContextConsumer, createContext } from \"@lit/context\";\nimport { msg } from \"@lit/localize\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { when } from \"lit/directives/when.js\";\n\nimport { LightDOMElement } from \"../application/elements\";\n\n/**\n * API event wrapper\n *\n * Generic button/link wrapper to POST to a URL on an event like \"click\".\n * Handles error feedback via toast message and redirection on success.\n *\n * @param {string} csrfToken - CSRF token from Django, attribute ``csrf-token``\n * @param {string} url - API URL for request\n *\n * TODO Deprecate this in favor of APIProviderElement\n **/\nexport class APIEventWrapper extends LightDOMElement {\n  static properties = {\n    csrfToken: { type: String, attribute: \"csrf-token\" },\n    url: { type: String },\n\n    // For API response\n    data: { state: true },\n  };\n\n  static method = \"POST\";\n  static event = \"click\";\n  static errorMessage = \"There was a problem with your request\";\n\n  // This is just a wrapper, so we rely on the inner HTML for all of the\n  // display and instead just wrap the outer with a clickable element.\n  constructor() {\n    super();\n    this.addEventListener(this.constructor.event, () => {\n      this.onEvent();\n    });\n  }\n\n  getHeaders() {\n    let headers = {\n      Accept: \"application/json\",\n      \"Content-Type\": \"application/json\",\n    };\n    if (this.csrfToken) {\n      headers[\"X-CSRFToken\"] = this.csrfToken;\n    }\n    return headers;\n  }\n\n  getUrl() {\n    return this.url;\n  }\n\n  onEvent() {\n    if (this.request == undefined) {\n      const classes = this.classList;\n      classes.add(\"loading\");\n      this.sendRequest().finally(() => {\n        classes.remove(\"loading\");\n      });\n    }\n  }\n\n  sendRequest() {\n    const options = {\n      method: this.constructor.method,\n      headers: this.getHeaders(),\n    };\n\n    this.request = fetch(this.getUrl(), options)\n      .then((response) => {\n        if (!response.ok) {\n          throw new Error(\"Request failed\");\n        }\n        return response.json();\n      })\n      .then((data) => {\n        console.debug(\"Received API reponse:\", data);\n        return this.onResponse(data);\n      })\n      .catch((err) => {\n        this.onError(err);\n      });\n\n    return this.request;\n  }\n\n  onResponse(data) {\n    this.data = data;\n    const urlSuccess = this.getSuccessURL();\n    if (urlSuccess) {\n      window.location.href = urlSuccess;\n    }\n  }\n\n  /** Return URL to redirect to on success\n   *\n   * Can use ``this.data`` to get API return from ``_link`` and other fields.\n   *\n   * @returns {string} - URL\n   **/\n  getSuccessURL() {\n    return;\n  }\n\n  /** Display error toast message on request error\n   *\n   * @param {Error} err - Exception raised during request\n   **/\n  onError(err) {\n    jquery.toast({\n      class: \"error\",\n      message: this.constructor.errorMessage,\n    });\n  }\n}\n\n/**\n * Menu item for rebuilding a version\n *\n * Uploaded versions are never rebuilt by Read the Docs. With the ``uploaded``\n * attribute the element renders disabled, ignores clicks, and shows a tooltip\n * explaining why.\n **/\nclass MenuBuildRebuildElement extends APIEventWrapper {\n  static properties = {\n    uploaded: { type: Boolean },\n  };\n\n  // TODO translate this here or use a different pattern\n  static errorMessage =\n    \"There was an error starting a new build for this version\";\n  static uploadedMessage =\n    \"This version is updated by direct upload. Rebuild it from your own pipeline.\";\n\n  firstUpdated() {\n    if (this.uploaded) {\n      this.classList.add(\"disabled\");\n      this.setAttribute(\"aria-disabled\", \"true\");\n      jquery(this).popup({ content: this.constructor.uploadedMessage });\n    }\n  }\n\n  onEvent() {\n    if (this.uploaded) {\n      return;\n    }\n    super.onEvent();\n  }\n\n  getSuccessURL() {\n    return this?.data?.build?.urls?.build;\n  }\n}\n\ncustomElements.define(\n  \"readthedocs-menu-build-rebuild\",\n  MenuBuildRebuildElement,\n);\n\n/** Button for resyncing all versions **/\nclass ButtonSyncAllVersionsElement extends APIEventWrapper {\n  // TODO translate this here or use a different pattern\n  static errorMessage = \"There was an error syncing versions.\";\n\n  getSuccessURL() {\n    console.log(\"Successfully synced versions\");\n  }\n\n  // Override the base class to delay the loading state removal\n  onEvent() {\n    if (this.request == undefined) {\n      const classes = this.classList;\n      classes.add(\"loading\");\n      this.sendRequest().finally(() => {\n        setTimeout(() => {\n          classes.remove(\"loading\");\n        }, 2000);\n      });\n    }\n  }\n}\n\ncustomElements.define(\n  \"readthedocs-button-sync-versions\",\n  ButtonSyncAllVersionsElement,\n);\n\n/**\n * Lit data contexts for elements with API interactions\n *\n * These data contexts are provided by :js:class:`APIProviderElement` and\n * consumed by :js:class:`APIConsumerElement`. This allows a central element to\n * execute an API request (table row, or a group of buttons) and for sub elements\n * at any point in the nested DOM to use this response (a button nested in the\n * table row, a submenu in the group of buttons).\n **/\nconst contextData = createContext(Symbol(\"data\"));\nconst contextState = createContext(Symbol(\"state\"));\n\n/**\n * API response states enum\n *\n * These are used by API response provider/consumer\n **/\nconst States = Object.freeze({\n  WAITING: Symbol(\"waiting\"),\n  LOADING: Symbol(\"loading\"),\n  DONE: Symbol(\"done\"),\n});\n\n/**\n * Context provider element for API response\n *\n * On an event (mouseover by default), this element starts an API request to the\n * URL specified. It eventually stores the response data in a data context for\n * nested consumer elements.\n *\n * Handles error feedback via toast message and redirection on success.\n *\n * @extends APIEventWrapper\n *\n * TODO This can replace the parent APIEventWrapper element above\n **/\nexport class APIProviderElement extends APIEventWrapper {\n  static method = \"GET\";\n  static event = \"mouseover\";\n\n  /** @type {ContextProvider} Reactive data context for API response data **/\n  _providerData = new ContextProvider(this, {\n    context: contextData,\n  });\n\n  set data(value) {\n    this._providerData.setValue(value);\n  }\n\n  /** @type {ContextProvider} Reactive data context for API response state **/\n  _providerState = new ContextProvider(this, {\n    context: contextState,\n  });\n\n  set state(value) {\n    this._providerState.setValue(value);\n  }\n\n  constructor() {\n    super();\n    this.state = States.WAITING;\n  }\n\n  onEvent() {\n    if (this.request == undefined) {\n      this.state = States.LOADING;\n      this.sendRequest().finally(() => {\n        this.state = States.DONE;\n      });\n    }\n  }\n\n  onResponse(data) {\n    this.data = data;\n  }\n}\n\ncustomElements.define(\"readthedocs-api\", APIProviderElement);\n\n/**\n * Context consumer element for API response\n *\n * This element waits for a parent anywhere up the DOM tree to emit a data\n * context element. There are two data contexts: the response state and the\n * response data.\n *\n * @extends LightDOMElement\n *\n * @property {Boolean} disabled - Render the element in a disabled state\n * @property {String} label - Label for the element and ARIA\n **/\nexport class APIConsumerElement extends LightDOMElement {\n  static properties = {\n    disabled: {\n      type: Boolean,\n    },\n    label: {\n      type: String,\n    },\n  };\n\n  /** @type {ContextConsumer} Reactive consumer for API response context data **/\n  _consumerData = new ContextConsumer(this, {\n    context: contextData,\n    subscribe: true,\n  });\n\n  get data() {\n    return this._consumerData.value;\n  }\n\n  /** @type {ContextConsumer} Reactive consumer for API request state context data **/\n  _consumerState = new ContextConsumer(this, {\n    context: contextState,\n    subscribe: true,\n  });\n\n  /** @type {State} Reactive context data for API request state **/\n  get state() {\n    return this._consumerState.value;\n  }\n\n  constructor() {\n    super();\n    this.disabled = false;\n  }\n\n  /**\n   * Queue event for late loading links\n   *\n   * Wait until the request promise resolves and then reemit the event to\n   * finally follow the link. This is useful for links that have a late-loaded\n   * ``href``.\n   *\n   * Use it in templates with ``html`<div @click=\"${this.queueEvent}\">``\n   *\n   * @param event {Event} - Click or other event\n   **/\n  queueEvent(event) {\n    if (this.state !== States.DONE) {\n      console.debug(\"Queueing click event:\", event);\n      event.preventDefault();\n      event.stopPropagation();\n\n      this._consumerState.callback = (value) => {\n        if (value === States.DONE) {\n          console.debug(\"Replaying click event:\", event);\n          // dispatchEvent doesn't seem to work here, so we just create a brand\n          // new event here instead.\n          event.target.click();\n        }\n      };\n    }\n  }\n}\n\n// Menu items\nexport class ItemDocsElement extends APIConsumerElement {\n  render() {\n    let label = this.label || msg(`View documentation`);\n    return html`\n      <a\n        class=\"ui button ${classMap({\n          disabled: this.disabled,\n          loading: !this.disabled && this.state === States.LOADING,\n        })}\"\n        href=${this.data?.urls?.documentation || `#`}\n        @click=${this.queueEvent}\n        data-content=\"${label}\"\n        aria-label=\"${label}\"\n        target=\"_blank\"\n        tabindex=\"${when(\n          !this.disabled,\n          () => html`0`,\n          () => html`-1`,\n        )}\"\n      >\n        <i class=\"fa-duotone fa-book icon\"></i>\n      </a>\n    `;\n  }\n}\ncustomElements.define(\"readthedocs-item-docs\", ItemDocsElement);\n\nexport class ItemDownloadsElement extends APIConsumerElement {\n  render() {\n    let label = this.label || msg(`Offline formats`);\n    return html`\n      <button\n        class=\"ui ${classMap({ disabled: this.disabled })} dropdown button\"\n        data-content=\"${label}\"\n        aria-label=\"${label}\"\n        tabindex=\"${when(\n          this.disabled,\n          () => html`0`,\n          () => html`-1`,\n        )}\"\n      >\n        <i class=\"fa-solid fa-download icon\"></i>\n        <div class=\"menu\">\n          <div class=\"header\">${msg(`Offline formats`)}</div>\n          <a\n            href=\"${this.data?.downloads?.pdf}\"\n            class=\"${classMap({ disabled: !this.data?.downloads?.pdf })} item\"\n          >\n            <i class=\"fa-duotone fa-file icon\"></i>\n            ${msg(`PDF file`)}\n          </a>\n          <a\n            href=\"${this.data?.downloads?.epub}\"\n            class=\"${classMap({ disabled: !this.data?.downloads?.epub })} item\"\n          >\n            <i class=\"fa-duotone fa-file icon\"></i>\n            ${msg(`ePUB file`)}\n          </a>\n          <a\n            href=\"${this.data?.downloads?.htmlzip}\"\n            class=\"${classMap({\n              disabled: !this.data?.downloads?.htmlzip,\n            })} item\"\n          >\n            <i class=\"fa-duotone fa-file-zipper icon\"></i>\n            ${msg(`HTML archive`)}\n          </a>\n        </div>\n      </button>\n    `;\n  }\n}\ncustomElements.define(\"readthedocs-item-downloads\", ItemDownloadsElement);\n\nclass MenuProjectAdminElement extends APIConsumerElement {\n  static get properties() {\n    // TODO `urlSettings` should be part of APIv3 response\n    let _properties = APIConsumerElement.properties;\n    _properties[\"urlSettings\"] = { type: String, attribute: \"url-settings\" };\n    return _properties;\n  }\n\n  render() {\n    const isAdmin = this.data?.permissions?.admin;\n    // This preemptively supports a settings URL, which can be passed in as an\n    // attribute in the meantime. The `urlSettings` property can go away with this.\n    const urlSettings = this.data?.urls?.settings || this.urlSettings;\n    return html`\n      <div class=\"header\">${msg(`Admin`)}</div>\n      <a class=\"${classMap({ disabled: !isAdmin })} item\" href=\"${urlSettings}\">\n        <i class=\"fa-duotone fa-wrench icon\"></i>\n        ${msg(`Configure project`)}\n      </a>\n    `;\n  }\n}\ncustomElements.define(\n  \"readthedocs-menu-project-admin\",\n  MenuProjectAdminElement,\n);\n","/*! @license DOMPurify 3.2.2 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.2/LICENSE */\n\nconst {\n  entries,\n  setPrototypeOf,\n  isFrozen,\n  getPrototypeOf,\n  getOwnPropertyDescriptor\n} = Object;\nlet {\n  freeze,\n  seal,\n  create\n} = Object; // eslint-disable-line import/no-mutable-exports\nlet {\n  apply,\n  construct\n} = typeof Reflect !== 'undefined' && Reflect;\nif (!freeze) {\n  freeze = function freeze(x) {\n    return x;\n  };\n}\nif (!seal) {\n  seal = function seal(x) {\n    return x;\n  };\n}\nif (!apply) {\n  apply = function apply(fun, thisValue, args) {\n    return fun.apply(thisValue, args);\n  };\n}\nif (!construct) {\n  construct = function construct(Func, args) {\n    return new Func(...args);\n  };\n}\nconst arrayForEach = unapply(Array.prototype.forEach);\nconst arrayPop = unapply(Array.prototype.pop);\nconst arrayPush = unapply(Array.prototype.push);\nconst stringToLowerCase = unapply(String.prototype.toLowerCase);\nconst stringToString = unapply(String.prototype.toString);\nconst stringMatch = unapply(String.prototype.match);\nconst stringReplace = unapply(String.prototype.replace);\nconst stringIndexOf = unapply(String.prototype.indexOf);\nconst stringTrim = unapply(String.prototype.trim);\nconst objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);\nconst regExpTest = unapply(RegExp.prototype.test);\nconst typeErrorCreate = unconstruct(TypeError);\n/**\n * Creates a new function that calls the given function with a specified thisArg and arguments.\n *\n * @param func - The function to be wrapped and called.\n * @returns A new function that calls the given function with a specified thisArg and arguments.\n */\nfunction unapply(func) {\n  return function (thisArg) {\n    for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n      args[_key - 1] = arguments[_key];\n    }\n    return apply(func, thisArg, args);\n  };\n}\n/**\n * Creates a new function that constructs an instance of the given constructor function with the provided arguments.\n *\n * @param func - The constructor function to be wrapped and called.\n * @returns A new function that constructs an instance of the given constructor function with the provided arguments.\n */\nfunction unconstruct(func) {\n  return function () {\n    for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n      args[_key2] = arguments[_key2];\n    }\n    return construct(func, args);\n  };\n}\n/**\n * Add properties to a lookup table\n *\n * @param set - The set to which elements will be added.\n * @param array - The array containing elements to be added to the set.\n * @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.\n * @returns The modified set with added elements.\n */\nfunction addToSet(set, array) {\n  let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;\n  if (setPrototypeOf) {\n    // Make 'in' and truthy checks like Boolean(set.constructor)\n    // independent of any properties defined on Object.prototype.\n    // Prevent prototype setters from intercepting set as a this value.\n    setPrototypeOf(set, null);\n  }\n  let l = array.length;\n  while (l--) {\n    let element = array[l];\n    if (typeof element === 'string') {\n      const lcElement = transformCaseFunc(element);\n      if (lcElement !== element) {\n        // Config presets (e.g. tags.js, attrs.js) are immutable.\n        if (!isFrozen(array)) {\n          array[l] = lcElement;\n        }\n        element = lcElement;\n      }\n    }\n    set[element] = true;\n  }\n  return set;\n}\n/**\n * Clean up an array to harden against CSPP\n *\n * @param array - The array to be cleaned.\n * @returns The cleaned version of the array\n */\nfunction cleanArray(array) {\n  for (let index = 0; index < array.length; index++) {\n    const isPropertyExist = objectHasOwnProperty(array, index);\n    if (!isPropertyExist) {\n      array[index] = null;\n    }\n  }\n  return array;\n}\n/**\n * Shallow clone an object\n *\n * @param object - The object to be cloned.\n * @returns A new object that copies the original.\n */\nfunction clone(object) {\n  const newObject = create(null);\n  for (const [property, value] of entries(object)) {\n    const isPropertyExist = objectHasOwnProperty(object, property);\n    if (isPropertyExist) {\n      if (Array.isArray(value)) {\n        newObject[property] = cleanArray(value);\n      } else if (value && typeof value === 'object' && value.constructor === Object) {\n        newObject[property] = clone(value);\n      } else {\n        newObject[property] = value;\n      }\n    }\n  }\n  return newObject;\n}\n/**\n * This method automatically checks if the prop is function or getter and behaves accordingly.\n *\n * @param object - The object to look up the getter function in its prototype chain.\n * @param prop - The property name for which to find the getter function.\n * @returns The getter function found in the prototype chain or a fallback function.\n */\nfunction lookupGetter(object, prop) {\n  while (object !== null) {\n    const desc = getOwnPropertyDescriptor(object, prop);\n    if (desc) {\n      if (desc.get) {\n        return unapply(desc.get);\n      }\n      if (typeof desc.value === 'function') {\n        return unapply(desc.value);\n      }\n    }\n    object = getPrototypeOf(object);\n  }\n  function fallbackValue() {\n    return null;\n  }\n  return fallbackValue;\n}\n\nconst html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);\n// SVG\nconst svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);\nconst svgFilters = freeze(['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']);\n// List of SVG elements that are disallowed by default.\n// We still need to know them so that we can do namespace\n// checks properly in case one wants to add them to\n// allow-list.\nconst svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);\nconst mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']);\n// Similarly to SVG, we want to know all MathML elements,\n// even those that we disallow by default.\nconst mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);\nconst text = freeze(['#text']);\n\nconst html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']);\nconst svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'exponent', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'slope', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);\nconst mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);\nconst xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);\n\n// eslint-disable-next-line unicorn/better-regex\nconst MUSTACHE_EXPR = seal(/\\{\\{[\\w\\W]*|[\\w\\W]*\\}\\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode\nconst ERB_EXPR = seal(/<%[\\w\\W]*|[\\w\\W]*%>/gm);\nconst TMPLIT_EXPR = seal(/\\${[\\w\\W]*}/gm);\nconst DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]/); // eslint-disable-line no-useless-escape\nconst ARIA_ATTR = seal(/^aria-[\\-\\w]+$/); // eslint-disable-line no-useless-escape\nconst IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i // eslint-disable-line no-useless-escape\n);\nconst IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\nconst ATTR_WHITESPACE = seal(/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g // eslint-disable-line no-control-regex\n);\nconst DOCTYPE_NAME = seal(/^html$/i);\nconst CUSTOM_ELEMENT = seal(/^[a-z][.\\w]*(-[.\\w]+)+$/i);\n\nvar EXPRESSIONS = /*#__PURE__*/Object.freeze({\n  __proto__: null,\n  ARIA_ATTR: ARIA_ATTR,\n  ATTR_WHITESPACE: ATTR_WHITESPACE,\n  CUSTOM_ELEMENT: CUSTOM_ELEMENT,\n  DATA_ATTR: DATA_ATTR,\n  DOCTYPE_NAME: DOCTYPE_NAME,\n  ERB_EXPR: ERB_EXPR,\n  IS_ALLOWED_URI: IS_ALLOWED_URI,\n  IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,\n  MUSTACHE_EXPR: MUSTACHE_EXPR,\n  TMPLIT_EXPR: TMPLIT_EXPR\n});\n\n/* eslint-disable @typescript-eslint/indent */\n// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType\nconst NODE_TYPE = {\n  element: 1,\n  attribute: 2,\n  text: 3,\n  cdataSection: 4,\n  entityReference: 5,\n  // Deprecated\n  entityNode: 6,\n  // Deprecated\n  progressingInstruction: 7,\n  comment: 8,\n  document: 9,\n  documentType: 10,\n  documentFragment: 11,\n  notation: 12 // Deprecated\n};\nconst getGlobal = function getGlobal() {\n  return typeof window === 'undefined' ? null : window;\n};\n/**\n * Creates a no-op policy for internal use only.\n * Don't export this function outside this module!\n * @param trustedTypes The policy factory.\n * @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).\n * @return The policy created (or null, if Trusted Types\n * are not supported or creating the policy failed).\n */\nconst _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {\n  if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {\n    return null;\n  }\n  // Allow the callers to control the unique policy name\n  // by adding a data-tt-policy-suffix to the script element with the DOMPurify.\n  // Policy creation with duplicate names throws in Trusted Types.\n  let suffix = null;\n  const ATTR_NAME = 'data-tt-policy-suffix';\n  if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {\n    suffix = purifyHostElement.getAttribute(ATTR_NAME);\n  }\n  const policyName = 'dompurify' + (suffix ? '#' + suffix : '');\n  try {\n    return trustedTypes.createPolicy(policyName, {\n      createHTML(html) {\n        return html;\n      },\n      createScriptURL(scriptUrl) {\n        return scriptUrl;\n      }\n    });\n  } catch (_) {\n    // Policy creation failed (most likely another DOMPurify script has\n    // already run). Skip creating the policy, as this will only cause errors\n    // if TT are enforced.\n    console.warn('TrustedTypes policy ' + policyName + ' could not be created.');\n    return null;\n  }\n};\nconst _createHooksMap = function _createHooksMap() {\n  return {\n    afterSanitizeAttributes: [],\n    afterSanitizeElements: [],\n    afterSanitizeShadowDOM: [],\n    beforeSanitizeAttributes: [],\n    beforeSanitizeElements: [],\n    beforeSanitizeShadowDOM: [],\n    uponSanitizeAttribute: [],\n    uponSanitizeElement: [],\n    uponSanitizeShadowNode: []\n  };\n};\nfunction createDOMPurify() {\n  let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();\n  const DOMPurify = root => createDOMPurify(root);\n  DOMPurify.version = '3.2.2';\n  DOMPurify.removed = [];\n  if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document) {\n    // Not running in a browser, provide a factory function\n    // so that you can pass your own Window\n    DOMPurify.isSupported = false;\n    return DOMPurify;\n  }\n  let {\n    document\n  } = window;\n  const originalDocument = document;\n  const currentScript = originalDocument.currentScript;\n  const {\n    DocumentFragment,\n    HTMLTemplateElement,\n    Node,\n    Element,\n    NodeFilter,\n    NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,\n    HTMLFormElement,\n    DOMParser,\n    trustedTypes\n  } = window;\n  const ElementPrototype = Element.prototype;\n  const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');\n  const remove = lookupGetter(ElementPrototype, 'remove');\n  const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');\n  const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');\n  const getParentNode = lookupGetter(ElementPrototype, 'parentNode');\n  // As per issue #47, the web-components registry is inherited by a\n  // new document created via createHTMLDocument. As per the spec\n  // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)\n  // a new empty registry is used when creating a template contents owner\n  // document, so we use that as our parent document to ensure nothing\n  // is inherited.\n  if (typeof HTMLTemplateElement === 'function') {\n    const template = document.createElement('template');\n    if (template.content && template.content.ownerDocument) {\n      document = template.content.ownerDocument;\n    }\n  }\n  let trustedTypesPolicy;\n  let emptyHTML = '';\n  const {\n    implementation,\n    createNodeIterator,\n    createDocumentFragment,\n    getElementsByTagName\n  } = document;\n  const {\n    importNode\n  } = originalDocument;\n  let hooks = _createHooksMap();\n  /**\n   * Expose whether this browser supports running the full DOMPurify.\n   */\n  DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;\n  const {\n    MUSTACHE_EXPR,\n    ERB_EXPR,\n    TMPLIT_EXPR,\n    DATA_ATTR,\n    ARIA_ATTR,\n    IS_SCRIPT_OR_DATA,\n    ATTR_WHITESPACE,\n    CUSTOM_ELEMENT\n  } = EXPRESSIONS;\n  let {\n    IS_ALLOWED_URI: IS_ALLOWED_URI$1\n  } = EXPRESSIONS;\n  /**\n   * We consider the elements and attributes below to be safe. Ideally\n   * don't add any new ones but feel free to remove unwanted ones.\n   */\n  /* allowed element names */\n  let ALLOWED_TAGS = null;\n  const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);\n  /* Allowed attribute names */\n  let ALLOWED_ATTR = null;\n  const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);\n  /*\n   * Configure how DOMPurify should handle custom elements and their attributes as well as customized built-in elements.\n   * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)\n   * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)\n   * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.\n   */\n  let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {\n    tagNameCheck: {\n      writable: true,\n      configurable: false,\n      enumerable: true,\n      value: null\n    },\n    attributeNameCheck: {\n      writable: true,\n      configurable: false,\n      enumerable: true,\n      value: null\n    },\n    allowCustomizedBuiltInElements: {\n      writable: true,\n      configurable: false,\n      enumerable: true,\n      value: false\n    }\n  }));\n  /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */\n  let FORBID_TAGS = null;\n  /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */\n  let FORBID_ATTR = null;\n  /* Decide if ARIA attributes are okay */\n  let ALLOW_ARIA_ATTR = true;\n  /* Decide if custom data attributes are okay */\n  let ALLOW_DATA_ATTR = true;\n  /* Decide if unknown protocols are okay */\n  let ALLOW_UNKNOWN_PROTOCOLS = false;\n  /* Decide if self-closing tags in attributes are allowed.\n   * Usually removed due to a mXSS issue in jQuery 3.0 */\n  let ALLOW_SELF_CLOSE_IN_ATTR = true;\n  /* Output should be safe for common template engines.\n   * This means, DOMPurify removes data attributes, mustaches and ERB\n   */\n  let SAFE_FOR_TEMPLATES = false;\n  /* Output should be safe even for XML used within HTML and alike.\n   * This means, DOMPurify removes comments when containing risky content.\n   */\n  let SAFE_FOR_XML = true;\n  /* Decide if document with <html>... should be returned */\n  let WHOLE_DOCUMENT = false;\n  /* Track whether config is already set on this instance of DOMPurify. */\n  let SET_CONFIG = false;\n  /* Decide if all elements (e.g. style, script) must be children of\n   * document.body. By default, browsers might move them to document.head */\n  let FORCE_BODY = false;\n  /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html\n   * string (or a TrustedHTML object if Trusted Types are supported).\n   * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead\n   */\n  let RETURN_DOM = false;\n  /* Decide if a DOM `DocumentFragment` should be returned, instead of a html\n   * string  (or a TrustedHTML object if Trusted Types are supported) */\n  let RETURN_DOM_FRAGMENT = false;\n  /* Try to return a Trusted Type object instead of a string, return a string in\n   * case Trusted Types are not supported  */\n  let RETURN_TRUSTED_TYPE = false;\n  /* Output should be free from DOM clobbering attacks?\n   * This sanitizes markups named with colliding, clobberable built-in DOM APIs.\n   */\n  let SANITIZE_DOM = true;\n  /* Achieve full DOM Clobbering protection by isolating the namespace of named\n   * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.\n   *\n   * HTML/DOM spec rules that enable DOM Clobbering:\n   *   - Named Access on Window (§7.3.3)\n   *   - DOM Tree Accessors (§3.1.5)\n   *   - Form Element Parent-Child Relations (§4.10.3)\n   *   - Iframe srcdoc / Nested WindowProxies (§4.8.5)\n   *   - HTMLCollection (§4.2.10.2)\n   *\n   * Namespace isolation is implemented by prefixing `id` and `name` attributes\n   * with a constant string, i.e., `user-content-`\n   */\n  let SANITIZE_NAMED_PROPS = false;\n  const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';\n  /* Keep element content when removing element? */\n  let KEEP_CONTENT = true;\n  /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead\n   * of importing it into a new Document and returning a sanitized copy */\n  let IN_PLACE = false;\n  /* Allow usage of profiles like html, svg and mathMl */\n  let USE_PROFILES = {};\n  /* Tags to ignore content of when KEEP_CONTENT is true */\n  let FORBID_CONTENTS = null;\n  const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);\n  /* Tags that are safe for data: URIs */\n  let DATA_URI_TAGS = null;\n  const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);\n  /* Attributes safe for values like \"javascript:\" */\n  let URI_SAFE_ATTRIBUTES = null;\n  const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);\n  const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n  const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n  const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\n  /* Document namespace */\n  let NAMESPACE = HTML_NAMESPACE;\n  let IS_EMPTY_INPUT = false;\n  /* Allowed XHTML+XML namespaces */\n  let ALLOWED_NAMESPACES = null;\n  const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);\n  let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);\n  let HTML_INTEGRATION_POINTS = addToSet({}, ['annotation-xml']);\n  // Certain elements are allowed in both SVG and HTML\n  // namespace. We need to specify them explicitly\n  // so that they don't get erroneously deleted from\n  // HTML namespace.\n  const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);\n  /* Parsing of strict XHTML documents */\n  let PARSER_MEDIA_TYPE = null;\n  const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];\n  const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';\n  let transformCaseFunc = null;\n  /* Keep a reference to config to pass to hooks */\n  let CONFIG = null;\n  /* Ideally, do not touch anything below this line */\n  /* ______________________________________________ */\n  const formElement = document.createElement('form');\n  const isRegexOrFunction = function isRegexOrFunction(testValue) {\n    return testValue instanceof RegExp || testValue instanceof Function;\n  };\n  /**\n   * _parseConfig\n   *\n   * @param cfg optional config literal\n   */\n  // eslint-disable-next-line complexity\n  const _parseConfig = function _parseConfig() {\n    let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n    if (CONFIG && CONFIG === cfg) {\n      return;\n    }\n    /* Shield configuration object from tampering */\n    if (!cfg || typeof cfg !== 'object') {\n      cfg = {};\n    }\n    /* Shield configuration object from prototype pollution */\n    cfg = clone(cfg);\n    PARSER_MEDIA_TYPE =\n    // eslint-disable-next-line unicorn/prefer-includes\n    SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;\n    // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.\n    transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;\n    /* Set configuration parameters */\n    ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS') ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;\n    ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR') ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;\n    ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES') ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;\n    URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR, transformCaseFunc) : DEFAULT_URI_SAFE_ATTRIBUTES;\n    DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS') ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS, transformCaseFunc) : DEFAULT_DATA_URI_TAGS;\n    FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS') ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;\n    FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};\n    FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};\n    USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES : false;\n    ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true\n    ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true\n    ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false\n    ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true\n    SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false\n    SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true\n    WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false\n    RETURN_DOM = cfg.RETURN_DOM || false; // Default false\n    RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false\n    RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false\n    FORCE_BODY = cfg.FORCE_BODY || false; // Default false\n    SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true\n    SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false\n    KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true\n    IN_PLACE = cfg.IN_PLACE || false; // Default false\n    IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;\n    NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;\n    MATHML_TEXT_INTEGRATION_POINTS = cfg.MATHML_TEXT_INTEGRATION_POINTS || MATHML_TEXT_INTEGRATION_POINTS;\n    HTML_INTEGRATION_POINTS = cfg.HTML_INTEGRATION_POINTS || HTML_INTEGRATION_POINTS;\n    CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};\n    if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {\n      CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;\n    }\n    if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {\n      CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;\n    }\n    if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') {\n      CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;\n    }\n    if (SAFE_FOR_TEMPLATES) {\n      ALLOW_DATA_ATTR = false;\n    }\n    if (RETURN_DOM_FRAGMENT) {\n      RETURN_DOM = true;\n    }\n    /* Parse profile info */\n    if (USE_PROFILES) {\n      ALLOWED_TAGS = addToSet({}, text);\n      ALLOWED_ATTR = [];\n      if (USE_PROFILES.html === true) {\n        addToSet(ALLOWED_TAGS, html$1);\n        addToSet(ALLOWED_ATTR, html);\n      }\n      if (USE_PROFILES.svg === true) {\n        addToSet(ALLOWED_TAGS, svg$1);\n        addToSet(ALLOWED_ATTR, svg);\n        addToSet(ALLOWED_ATTR, xml);\n      }\n      if (USE_PROFILES.svgFilters === true) {\n        addToSet(ALLOWED_TAGS, svgFilters);\n        addToSet(ALLOWED_ATTR, svg);\n        addToSet(ALLOWED_ATTR, xml);\n      }\n      if (USE_PROFILES.mathMl === true) {\n        addToSet(ALLOWED_TAGS, mathMl$1);\n        addToSet(ALLOWED_ATTR, mathMl);\n        addToSet(ALLOWED_ATTR, xml);\n      }\n    }\n    /* Merge configuration parameters */\n    if (cfg.ADD_TAGS) {\n      if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {\n        ALLOWED_TAGS = clone(ALLOWED_TAGS);\n      }\n      addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);\n    }\n    if (cfg.ADD_ATTR) {\n      if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {\n        ALLOWED_ATTR = clone(ALLOWED_ATTR);\n      }\n      addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);\n    }\n    if (cfg.ADD_URI_SAFE_ATTR) {\n      addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);\n    }\n    if (cfg.FORBID_CONTENTS) {\n      if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {\n        FORBID_CONTENTS = clone(FORBID_CONTENTS);\n      }\n      addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);\n    }\n    /* Add #text in case KEEP_CONTENT is set to true */\n    if (KEEP_CONTENT) {\n      ALLOWED_TAGS['#text'] = true;\n    }\n    /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */\n    if (WHOLE_DOCUMENT) {\n      addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);\n    }\n    /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */\n    if (ALLOWED_TAGS.table) {\n      addToSet(ALLOWED_TAGS, ['tbody']);\n      delete FORBID_TAGS.tbody;\n    }\n    if (cfg.TRUSTED_TYPES_POLICY) {\n      if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {\n        throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.');\n      }\n      if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {\n        throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.');\n      }\n      // Overwrite existing TrustedTypes policy.\n      trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;\n      // Sign local variables required by `sanitize`.\n      emptyHTML = trustedTypesPolicy.createHTML('');\n    } else {\n      // Uninitialized policy, attempt to initialize the internal dompurify policy.\n      if (trustedTypesPolicy === undefined) {\n        trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);\n      }\n      // If creating the internal policy succeeded sign internal variables.\n      if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {\n        emptyHTML = trustedTypesPolicy.createHTML('');\n      }\n    }\n    // Prevent further manipulation of configuration.\n    // Not available in IE8, Safari 5, etc.\n    if (freeze) {\n      freeze(cfg);\n    }\n    CONFIG = cfg;\n  };\n  /* Keep track of all possible SVG and MathML tags\n   * so that we can perform the namespace checks\n   * correctly. */\n  const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);\n  const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);\n  /**\n   * @param element a DOM element whose namespace is being checked\n   * @returns Return false if the element has a\n   *  namespace that a spec-compliant parser would never\n   *  return. Return true otherwise.\n   */\n  const _checkValidNamespace = function _checkValidNamespace(element) {\n    let parent = getParentNode(element);\n    // In JSDOM, if we're inside shadow DOM, then parentNode\n    // can be null. We just simulate parent in this case.\n    if (!parent || !parent.tagName) {\n      parent = {\n        namespaceURI: NAMESPACE,\n        tagName: 'template'\n      };\n    }\n    const tagName = stringToLowerCase(element.tagName);\n    const parentTagName = stringToLowerCase(parent.tagName);\n    if (!ALLOWED_NAMESPACES[element.namespaceURI]) {\n      return false;\n    }\n    if (element.namespaceURI === SVG_NAMESPACE) {\n      // The only way to switch from HTML namespace to SVG\n      // is via <svg>. If it happens via any other tag, then\n      // it should be killed.\n      if (parent.namespaceURI === HTML_NAMESPACE) {\n        return tagName === 'svg';\n      }\n      // The only way to switch from MathML to SVG is via`\n      // svg if parent is either <annotation-xml> or MathML\n      // text integration points.\n      if (parent.namespaceURI === MATHML_NAMESPACE) {\n        return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);\n      }\n      // We only allow elements that are defined in SVG\n      // spec. All others are disallowed in SVG namespace.\n      return Boolean(ALL_SVG_TAGS[tagName]);\n    }\n    if (element.namespaceURI === MATHML_NAMESPACE) {\n      // The only way to switch from HTML namespace to MathML\n      // is via <math>. If it happens via any other tag, then\n      // it should be killed.\n      if (parent.namespaceURI === HTML_NAMESPACE) {\n        return tagName === 'math';\n      }\n      // The only way to switch from SVG to MathML is via\n      // <math> and HTML integration points\n      if (parent.namespaceURI === SVG_NAMESPACE) {\n        return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];\n      }\n      // We only allow elements that are defined in MathML\n      // spec. All others are disallowed in MathML namespace.\n      return Boolean(ALL_MATHML_TAGS[tagName]);\n    }\n    if (element.namespaceURI === HTML_NAMESPACE) {\n      // The only way to switch from SVG to HTML is via\n      // HTML integration points, and from MathML to HTML\n      // is via MathML text integration points\n      if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {\n        return false;\n      }\n      if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {\n        return false;\n      }\n      // We disallow tags that are specific for MathML\n      // or SVG and should never appear in HTML namespace\n      return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);\n    }\n    // For XHTML and XML documents that support custom namespaces\n    if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {\n      return true;\n    }\n    // The code should never reach this place (this means\n    // that the element somehow got namespace that is not\n    // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).\n    // Return false just in case.\n    return false;\n  };\n  /**\n   * _forceRemove\n   *\n   * @param node a DOM node\n   */\n  const _forceRemove = function _forceRemove(node) {\n    arrayPush(DOMPurify.removed, {\n      element: node\n    });\n    try {\n      // eslint-disable-next-line unicorn/prefer-dom-node-remove\n      getParentNode(node).removeChild(node);\n    } catch (_) {\n      remove(node);\n    }\n  };\n  /**\n   * _removeAttribute\n   *\n   * @param name an Attribute name\n   * @param element a DOM node\n   */\n  const _removeAttribute = function _removeAttribute(name, element) {\n    try {\n      arrayPush(DOMPurify.removed, {\n        attribute: element.getAttributeNode(name),\n        from: element\n      });\n    } catch (_) {\n      arrayPush(DOMPurify.removed, {\n        attribute: null,\n        from: element\n      });\n    }\n    element.removeAttribute(name);\n    // We void attribute values for unremovable \"is\" attributes\n    if (name === 'is') {\n      if (RETURN_DOM || RETURN_DOM_FRAGMENT) {\n        try {\n          _forceRemove(element);\n        } catch (_) {}\n      } else {\n        try {\n          element.setAttribute(name, '');\n        } catch (_) {}\n      }\n    }\n  };\n  /**\n   * _initDocument\n   *\n   * @param dirty - a string of dirty markup\n   * @return a DOM, filled with the dirty markup\n   */\n  const _initDocument = function _initDocument(dirty) {\n    /* Create a HTML document */\n    let doc = null;\n    let leadingWhitespace = null;\n    if (FORCE_BODY) {\n      dirty = '<remove></remove>' + dirty;\n    } else {\n      /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */\n      const matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n      leadingWhitespace = matches && matches[0];\n    }\n    if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {\n      // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)\n      dirty = '<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>' + dirty + '</body></html>';\n    }\n    const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;\n    /*\n     * Use the DOMParser API by default, fallback later if needs be\n     * DOMParser not work for svg when has multiple root element.\n     */\n    if (NAMESPACE === HTML_NAMESPACE) {\n      try {\n        doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);\n      } catch (_) {}\n    }\n    /* Use createHTMLDocument in case DOMParser is not available */\n    if (!doc || !doc.documentElement) {\n      doc = implementation.createDocument(NAMESPACE, 'template', null);\n      try {\n        doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;\n      } catch (_) {\n        // Syntax error if dirtyPayload is invalid xml\n      }\n    }\n    const body = doc.body || doc.documentElement;\n    if (dirty && leadingWhitespace) {\n      body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);\n    }\n    /* Work on whole document or just its body */\n    if (NAMESPACE === HTML_NAMESPACE) {\n      return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];\n    }\n    return WHOLE_DOCUMENT ? doc.documentElement : body;\n  };\n  /**\n   * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\n   *\n   * @param root The root element or node to start traversing on.\n   * @return The created NodeIterator\n   */\n  const _createNodeIterator = function _createNodeIterator(root) {\n    return createNodeIterator.call(root.ownerDocument || root, root,\n    // eslint-disable-next-line no-bitwise\n    NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);\n  };\n  /**\n   * _isClobbered\n   *\n   * @param element element to check for clobbering attacks\n   * @return true if clobbered, false if safe\n   */\n  const _isClobbered = function _isClobbered(element) {\n    return element instanceof HTMLFormElement && (typeof element.nodeName !== 'string' || typeof element.textContent !== 'string' || typeof element.removeChild !== 'function' || !(element.attributes instanceof NamedNodeMap) || typeof element.removeAttribute !== 'function' || typeof element.setAttribute !== 'function' || typeof element.namespaceURI !== 'string' || typeof element.insertBefore !== 'function' || typeof element.hasChildNodes !== 'function');\n  };\n  /**\n   * Checks whether the given object is a DOM node.\n   *\n   * @param value object to check whether it's a DOM node\n   * @return true is object is a DOM node\n   */\n  const _isNode = function _isNode(value) {\n    return typeof Node === 'function' && value instanceof Node;\n  };\n  function _executeHooks(hooks, currentNode, data) {\n    arrayForEach(hooks, hook => {\n      hook.call(DOMPurify, currentNode, data, CONFIG);\n    });\n  }\n  /**\n   * _sanitizeElements\n   *\n   * @protect nodeName\n   * @protect textContent\n   * @protect removeChild\n   * @param currentNode to check for permission to exist\n   * @return true if node was killed, false if left alive\n   */\n  const _sanitizeElements = function _sanitizeElements(currentNode) {\n    let content = null;\n    /* Execute a hook if present */\n    _executeHooks(hooks.beforeSanitizeElements, currentNode, null);\n    /* Check if element is clobbered or can clobber */\n    if (_isClobbered(currentNode)) {\n      _forceRemove(currentNode);\n      return true;\n    }\n    /* Now let's check the element's type and name */\n    const tagName = transformCaseFunc(currentNode.nodeName);\n    /* Execute a hook if present */\n    _executeHooks(hooks.uponSanitizeElement, currentNode, {\n      tagName,\n      allowedTags: ALLOWED_TAGS\n    });\n    /* Detect mXSS attempts abusing namespace confusion */\n    if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\\w]/g, currentNode.innerHTML) && regExpTest(/<[/\\w]/g, currentNode.textContent)) {\n      _forceRemove(currentNode);\n      return true;\n    }\n    /* Remove any occurrence of processing instructions */\n    if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {\n      _forceRemove(currentNode);\n      return true;\n    }\n    /* Remove any kind of possibly harmful comments */\n    if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\\w]/g, currentNode.data)) {\n      _forceRemove(currentNode);\n      return true;\n    }\n    /* Remove element if anything forbids its presence */\n    if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n      /* Check if we have a custom element to handle */\n      if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {\n        if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {\n          return false;\n        }\n        if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {\n          return false;\n        }\n      }\n      /* Keep content except for bad-listed elements */\n      if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {\n        const parentNode = getParentNode(currentNode) || currentNode.parentNode;\n        const childNodes = getChildNodes(currentNode) || currentNode.childNodes;\n        if (childNodes && parentNode) {\n          const childCount = childNodes.length;\n          for (let i = childCount - 1; i >= 0; --i) {\n            const childClone = cloneNode(childNodes[i], true);\n            childClone.__removalCount = (currentNode.__removalCount || 0) + 1;\n            parentNode.insertBefore(childClone, getNextSibling(currentNode));\n          }\n        }\n      }\n      _forceRemove(currentNode);\n      return true;\n    }\n    /* Check whether element has a valid namespace */\n    if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {\n      _forceRemove(currentNode);\n      return true;\n    }\n    /* Make sure that older browsers don't get fallback-tag mXSS */\n    if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\\/no(script|embed|frames)/i, currentNode.innerHTML)) {\n      _forceRemove(currentNode);\n      return true;\n    }\n    /* Sanitize element content to be template-safe */\n    if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {\n      /* Get the element's text content */\n      content = currentNode.textContent;\n      arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n        content = stringReplace(content, expr, ' ');\n      });\n      if (currentNode.textContent !== content) {\n        arrayPush(DOMPurify.removed, {\n          element: currentNode.cloneNode()\n        });\n        currentNode.textContent = content;\n      }\n    }\n    /* Execute a hook if present */\n    _executeHooks(hooks.afterSanitizeElements, currentNode, null);\n    return false;\n  };\n  /**\n   * _isValidAttribute\n   *\n   * @param lcTag Lowercase tag name of containing element.\n   * @param lcName Lowercase attribute name.\n   * @param value Attribute value.\n   * @return Returns true if `value` is valid, otherwise false.\n   */\n  // eslint-disable-next-line complexity\n  const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {\n    /* Make sure attribute cannot clobber */\n    if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {\n      return false;\n    }\n    /* Allow valid data-* attributes: At least one character after \"-\"\n        (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)\n        XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)\n        We don't need to check the value; it's always URI safe. */\n    if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {\n      if (\n      // First condition does a very basic check if a) it's basically a valid custom element tagname AND\n      // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n      // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck\n      _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) ||\n      // Alternative, second condition checks if it's an `is`-attribute, AND\n      // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n      lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ; else {\n        return false;\n      }\n      /* Check value is safe. First, is attr inert? If so, is safe */\n    } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (value) {\n      return false;\n    } else ;\n    return true;\n  };\n  /**\n   * _isBasicCustomElement\n   * checks if at least one dash is included in tagName, and it's not the first char\n   * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name\n   *\n   * @param tagName name of the tag of the node to sanitize\n   * @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.\n   */\n  const _isBasicCustomElement = function _isBasicCustomElement(tagName) {\n    return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT);\n  };\n  /**\n   * _sanitizeAttributes\n   *\n   * @protect attributes\n   * @protect nodeName\n   * @protect removeAttribute\n   * @protect setAttribute\n   *\n   * @param currentNode to sanitize\n   */\n  const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {\n    /* Execute a hook if present */\n    _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);\n    const {\n      attributes\n    } = currentNode;\n    /* Check if we have attributes; if not we might have a text node */\n    if (!attributes) {\n      return;\n    }\n    const hookEvent = {\n      attrName: '',\n      attrValue: '',\n      keepAttr: true,\n      allowedAttributes: ALLOWED_ATTR,\n      forceKeepAttr: undefined\n    };\n    let l = attributes.length;\n    /* Go backwards over all attributes; safely remove bad ones */\n    while (l--) {\n      const attr = attributes[l];\n      const {\n        name,\n        namespaceURI,\n        value: attrValue\n      } = attr;\n      const lcName = transformCaseFunc(name);\n      let value = name === 'value' ? attrValue : stringTrim(attrValue);\n      /* Execute a hook if present */\n      hookEvent.attrName = lcName;\n      hookEvent.attrValue = value;\n      hookEvent.keepAttr = true;\n      hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set\n      _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);\n      value = hookEvent.attrValue;\n      /* Full DOM Clobbering protection via namespace isolation,\n       * Prefix id and name attributes with `user-content-`\n       */\n      if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {\n        // Remove the attribute with this value\n        _removeAttribute(name, currentNode);\n        // Prefix the value and later re-create the attribute with the sanitized value\n        value = SANITIZE_NAMED_PROPS_PREFIX + value;\n      }\n      /* Work around a security issue with comments inside attributes */\n      if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\\/(style|title)/i, value)) {\n        _removeAttribute(name, currentNode);\n        continue;\n      }\n      /* Did the hooks approve of the attribute? */\n      if (hookEvent.forceKeepAttr) {\n        continue;\n      }\n      /* Remove attribute */\n      _removeAttribute(name, currentNode);\n      /* Did the hooks approve of the attribute? */\n      if (!hookEvent.keepAttr) {\n        continue;\n      }\n      /* Work around a security issue in jQuery 3.0 */\n      if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\\/>/i, value)) {\n        _removeAttribute(name, currentNode);\n        continue;\n      }\n      /* Sanitize attribute content to be template-safe */\n      if (SAFE_FOR_TEMPLATES) {\n        arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n          value = stringReplace(value, expr, ' ');\n        });\n      }\n      /* Is `value` valid for this attribute? */\n      const lcTag = transformCaseFunc(currentNode.nodeName);\n      if (!_isValidAttribute(lcTag, lcName, value)) {\n        continue;\n      }\n      /* Handle attributes that require Trusted Types */\n      if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') {\n        if (namespaceURI) ; else {\n          switch (trustedTypes.getAttributeType(lcTag, lcName)) {\n            case 'TrustedHTML':\n              {\n                value = trustedTypesPolicy.createHTML(value);\n                break;\n              }\n            case 'TrustedScriptURL':\n              {\n                value = trustedTypesPolicy.createScriptURL(value);\n                break;\n              }\n          }\n        }\n      }\n      /* Handle invalid data-* attribute set by try-catching it */\n      try {\n        if (namespaceURI) {\n          currentNode.setAttributeNS(namespaceURI, name, value);\n        } else {\n          /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. \"x-schema\". */\n          currentNode.setAttribute(name, value);\n        }\n        if (_isClobbered(currentNode)) {\n          _forceRemove(currentNode);\n        } else {\n          arrayPop(DOMPurify.removed);\n        }\n      } catch (_) {}\n    }\n    /* Execute a hook if present */\n    _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);\n  };\n  /**\n   * _sanitizeShadowDOM\n   *\n   * @param fragment to iterate over recursively\n   */\n  const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {\n    let shadowNode = null;\n    const shadowIterator = _createNodeIterator(fragment);\n    /* Execute a hook if present */\n    _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);\n    while (shadowNode = shadowIterator.nextNode()) {\n      /* Execute a hook if present */\n      _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);\n      /* Sanitize tags and elements */\n      if (_sanitizeElements(shadowNode)) {\n        continue;\n      }\n      /* Deep shadow DOM detected */\n      if (shadowNode.content instanceof DocumentFragment) {\n        _sanitizeShadowDOM(shadowNode.content);\n      }\n      /* Check attributes, sanitize if necessary */\n      _sanitizeAttributes(shadowNode);\n    }\n    /* Execute a hook if present */\n    _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);\n  };\n  // eslint-disable-next-line complexity\n  DOMPurify.sanitize = function (dirty) {\n    let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n    let body = null;\n    let importedNode = null;\n    let currentNode = null;\n    let returnNode = null;\n    /* Make sure we have a string to sanitize.\n      DO NOT return early, as this will return the wrong type if\n      the user has requested a DOM object rather than a string */\n    IS_EMPTY_INPUT = !dirty;\n    if (IS_EMPTY_INPUT) {\n      dirty = '<!-->';\n    }\n    /* Stringify, in case dirty is an object */\n    if (typeof dirty !== 'string' && !_isNode(dirty)) {\n      if (typeof dirty.toString === 'function') {\n        dirty = dirty.toString();\n        if (typeof dirty !== 'string') {\n          throw typeErrorCreate('dirty is not a string, aborting');\n        }\n      } else {\n        throw typeErrorCreate('toString is not a function');\n      }\n    }\n    /* Return dirty HTML if DOMPurify cannot run */\n    if (!DOMPurify.isSupported) {\n      return dirty;\n    }\n    /* Assign config vars */\n    if (!SET_CONFIG) {\n      _parseConfig(cfg);\n    }\n    /* Clean up removed elements */\n    DOMPurify.removed = [];\n    /* Check if dirty is correctly typed for IN_PLACE */\n    if (typeof dirty === 'string') {\n      IN_PLACE = false;\n    }\n    if (IN_PLACE) {\n      /* Do some early pre-sanitization to avoid unsafe root nodes */\n      if (dirty.nodeName) {\n        const tagName = transformCaseFunc(dirty.nodeName);\n        if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n          throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');\n        }\n      }\n    } else if (dirty instanceof Node) {\n      /* If dirty is a DOM element, append to an empty document to avoid\n         elements being stripped by the parser */\n      body = _initDocument('<!---->');\n      importedNode = body.ownerDocument.importNode(dirty, true);\n      if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === 'BODY') {\n        /* Node is already a body, use as is */\n        body = importedNode;\n      } else if (importedNode.nodeName === 'HTML') {\n        body = importedNode;\n      } else {\n        // eslint-disable-next-line unicorn/prefer-dom-node-append\n        body.appendChild(importedNode);\n      }\n    } else {\n      /* Exit directly if we have nothing to do */\n      if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&\n      // eslint-disable-next-line unicorn/prefer-includes\n      dirty.indexOf('<') === -1) {\n        return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;\n      }\n      /* Initialize the document to work on */\n      body = _initDocument(dirty);\n      /* Check we have a DOM node from the data */\n      if (!body) {\n        return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';\n      }\n    }\n    /* Remove first element node (ours) if FORCE_BODY is set */\n    if (body && FORCE_BODY) {\n      _forceRemove(body.firstChild);\n    }\n    /* Get node iterator */\n    const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);\n    /* Now start iterating over the created document */\n    while (currentNode = nodeIterator.nextNode()) {\n      /* Sanitize tags and elements */\n      if (_sanitizeElements(currentNode)) {\n        continue;\n      }\n      /* Shadow DOM detected, sanitize it */\n      if (currentNode.content instanceof DocumentFragment) {\n        _sanitizeShadowDOM(currentNode.content);\n      }\n      /* Check attributes, sanitize if necessary */\n      _sanitizeAttributes(currentNode);\n    }\n    /* If we sanitized `dirty` in-place, return it. */\n    if (IN_PLACE) {\n      return dirty;\n    }\n    /* Return sanitized string or DOM */\n    if (RETURN_DOM) {\n      if (RETURN_DOM_FRAGMENT) {\n        returnNode = createDocumentFragment.call(body.ownerDocument);\n        while (body.firstChild) {\n          // eslint-disable-next-line unicorn/prefer-dom-node-append\n          returnNode.appendChild(body.firstChild);\n        }\n      } else {\n        returnNode = body;\n      }\n      if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {\n        /*\n          AdoptNode() is not used because internal state is not reset\n          (e.g. the past names map of a HTMLFormElement), this is safe\n          in theory but we would rather not risk another attack vector.\n          The state that is cloned by importNode() is explicitly defined\n          by the specs.\n        */\n        returnNode = importNode.call(originalDocument, returnNode, true);\n      }\n      return returnNode;\n    }\n    let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n    /* Serialize doctype if allowed */\n    if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {\n      serializedHTML = '<!DOCTYPE ' + body.ownerDocument.doctype.name + '>\\n' + serializedHTML;\n    }\n    /* Sanitize final string template-safe */\n    if (SAFE_FOR_TEMPLATES) {\n      arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n        serializedHTML = stringReplace(serializedHTML, expr, ' ');\n      });\n    }\n    return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;\n  };\n  DOMPurify.setConfig = function () {\n    let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n    _parseConfig(cfg);\n    SET_CONFIG = true;\n  };\n  DOMPurify.clearConfig = function () {\n    CONFIG = null;\n    SET_CONFIG = false;\n  };\n  DOMPurify.isValidAttribute = function (tag, attr, value) {\n    /* Initialize shared config vars if necessary. */\n    if (!CONFIG) {\n      _parseConfig({});\n    }\n    const lcTag = transformCaseFunc(tag);\n    const lcName = transformCaseFunc(attr);\n    return _isValidAttribute(lcTag, lcName, value);\n  };\n  DOMPurify.addHook = function (entryPoint, hookFunction) {\n    if (typeof hookFunction !== 'function') {\n      return;\n    }\n    arrayPush(hooks[entryPoint], hookFunction);\n  };\n  DOMPurify.removeHook = function (entryPoint) {\n    return arrayPop(hooks[entryPoint]);\n  };\n  DOMPurify.removeHooks = function (entryPoint) {\n    hooks[entryPoint] = [];\n  };\n  DOMPurify.removeAllHooks = function () {\n    hooks = _createHooksMap();\n  };\n  return DOMPurify;\n}\nvar purify = createDOMPurify();\n\nexport { purify as default };\n//# sourceMappingURL=purify.es.mjs.map\n","import jquery from \"jquery\";\nimport { LitElement, css, html, nothing } from \"lit\";\nimport { repeat } from \"lit/directives/repeat.js\";\nimport { when } from \"lit/directives/when.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { unsafeHTML } from \"lit/directives/unsafe-html.js\";\nimport DOMPurify from \"dompurify\";\n\nimport { LightDOMElement } from \"../application/elements\";\n\n/**\n * Notification\n *\n * Used internally and directly to render a notification API response. This\n * element is not rendered using element attributes, but it is possible to\n * pass in a full notification API response item via the ``notification``\n * object attribute.\n *\n * @param {Object} notification - Single item from notification API response\n * @param {string} csrfToken - CSRF token from Django, attribute ``csrf-token``\n * @param {Boolean} inverted - Whether the message is ``inverted`` variant\n **/\nexport class NotificationElement extends LightDOMElement {\n  static properties = {\n    csrfToken: { type: String, attribute: \"csrf-token\" },\n    notification: { state: true },\n    inverted: { type: Boolean },\n  };\n\n  render() {\n    if (this.notification === undefined || this.notification.message === null) {\n      return nothing;\n    }\n\n    // classMap can't be mixed with any other template logic inside ``class=``\n    // so we include all conditional logic outside.\n    const classes = {\n      // Explicitly always invert high level messages to make sure these are\n      // more visible than tip/note messages.\n      inverted:\n        this.inverted ||\n        [\"error\", \"warning\", \"info\"].includes(this.notification.message.type),\n    };\n    classes[this.notification.message.type] = true;\n\n    return html`\n      <div class=\"ui ${classMap(classes)} notification message\">\n        ${when(\n          this.notification.dismissable,\n          () => html`\n            <i\n              class=\"fas fa-xmark close inline icon\"\n              @click=${this.dismiss}\n            ></i>\n          `,\n        )}\n        <h5 class=\"header\">\n          <i class=\"fad ${this.notification.message.icon_classes} icon\"></i>\n          ${unsafeHTML(this.notification.message.header)}\n        </h5>\n        <p>${unsafeHTML(this.notification.message.body)}</p>\n      </div>\n    `;\n  }\n\n  dismiss() {\n    console.debug(\"Dismissing notification:\", this.notification.id);\n    const options = {\n      method: \"PATCH\",\n      headers: {\n        \"Content-Type\": \"application/json\",\n        \"X-CSRFToken\": this.csrfToken,\n      },\n      body: JSON.stringify({\n        state: \"dismissed\",\n      }),\n    };\n    fetch(this.notification._links._self, options)\n      .then((response) => {\n        if (!response.ok) {\n          throw new Error(\"Invalid API request\");\n        }\n        // Use FUI transition module to fade out and remove the notification\n        jquery(this).transition({\n          animation: \"fade\",\n          onComplete: () => {\n            this.parentElement.removeChild(this);\n          },\n        });\n      })\n      .catch((err) => {\n        console.error(\"Error dismissing notification\", err);\n      });\n  }\n}\n\n/**\n * NotificationListElement\n *\n * This is the wrapper to :js:class:`NotificationElement`, and provides the initial\n * API interaction to populate all of the notification element instances with\n * data.\n *\n * @param {string} url - APIv3 notification URL to use\n * @param {string} csrfToken - Django CSRF token\n * @param {string} state - Notification states to filter for\n * @param {Boolean} inverted - Whether inverted variant should be forced\n **/\nexport class NotificationListElement extends LightDOMElement {\n  static properties = {\n    url: { type: String },\n    csrfToken: { type: String, attribute: \"csrf-token\" },\n    state: { type: String },\n    inverted: { type: Boolean },\n\n    notifications: { state: true },\n    request: { state: true },\n  };\n\n  constructor() {\n    super();\n    this.state = \"read,unread\";\n  }\n\n  fetchNotifications() {\n    if (!this.url || this.request !== undefined) {\n      return;\n    }\n    const params = new URLSearchParams({\n      state__in: this.state,\n    });\n    this.request = fetch(`${this.url}?${params}`)\n      .then((response) => {\n        if (!response.ok) {\n          throw new Error(\"Request failed\");\n        }\n        return response.json();\n      })\n      .then((data) => {\n        if (data?.results === undefined) {\n          throw new Error(\"Invalid notification API response\");\n        }\n        return data.results;\n      })\n      .then((notifications) => {\n        if (notifications) {\n          this.notifications = notifications.map((notification) => {\n            notification.message.header = DOMPurify.sanitize(\n              notification.message.header,\n            );\n            notification.message.body = DOMPurify.sanitize(\n              notification.message.body,\n            );\n            return notification;\n          });\n        }\n      })\n      .catch((err) => {\n        console.error(`Error fetching notifications from ${this.url}`, err);\n      });\n  }\n\n  render() {\n    // Trigger async notification fetch\n    this.fetchNotifications();\n\n    if (this.notifications && this.notifications.length > 0) {\n      return repeat(\n        this.notifications,\n        (notification) => notification.id,\n        (notification, index) => {\n          const elem = document.createElement(\"readthedocs-notification\");\n          elem.notification = notification;\n          elem.csrfToken = this.csrfToken;\n          elem.inverted = this.inverted;\n\n          // For FUI .ui.list.item\n          elem.className = \"item\";\n          return elem;\n        },\n      );\n    } else {\n      return nothing;\n    }\n  }\n}\n\ncustomElements.define(\"readthedocs-notification\", NotificationElement);\ncustomElements.define(\"readthedocs-notification-list\", NotificationListElement);\n","import ko from \"knockout\";\nimport jquery from \"jquery\";\n\nimport { Registry } from \"../application/registry\";\n\nexport class PopupcardView {\n  static view_name = \"PopupcardView\";\n\n  constructor(url, url_notifications) {\n    this.url = url;\n    this.url_notifications = url_notifications;\n\n    /** @observable {Boolean} Is the popup showing currently? */\n    this.is_showing = ko.observable(false);\n    this.is_showing.subscribe((is_showing) => {\n      if (is_showing) {\n        this.fetch();\n      }\n    });\n    /** @observable {Boolean} Is the popup loading from the API? */\n    this.is_loading = ko.observable(false);\n    /** @observable {Boolean} Is the popup loading from the API? */\n    this.is_loaded = ko.observable(false);\n\n    /** @computed */\n    this.popup = ko.observable();\n    /** @computed */\n    this.popup_config = ko.computed(() => {\n      const popup = this.popup();\n      if (ko.computedContext.isInitial()) {\n        return {\n          hoverable: true,\n          delay: {\n            show: 200,\n            hide: 200,\n          },\n          onShow: () => {\n            this.is_showing(true);\n          },\n          onHide: () => {\n            this.is_showing(false);\n          },\n        };\n      } else {\n        return popup;\n      }\n    });\n\n    /** @observable {Object} The response object from the API */\n    this.data = ko.observable();\n    /** @observableArray {Object} Notifications from the API, if ``url_notifications`` was given */\n    this.notifications = ko.observableArray();\n\n    this.promise = null;\n    this.promise_notifications = null;\n  }\n\n  fetch() {\n    this.fetch_notifications();\n    if (!this.url) {\n      // This popupcard is for a local only request, there might not be an API\n      // to request from.\n      this.data({});\n      this.is_loaded(true);\n      this.is_loading(false);\n      return;\n    }\n    if (this.promise) {\n      return this.promise;\n    }\n    this.promise = new Promise((resolve, reject) => {\n      if (this.is_loaded()) {\n        return resolve(data);\n      }\n      this.is_loading(true);\n      jquery\n        .getJSON(this.url)\n        .then((data) => {\n          this.data(data);\n          this.is_loaded(true);\n          this.is_loading(false);\n          return resolve(data);\n        })\n        .catch((err) => {\n          reject(err);\n        });\n    }).catch((err) => {\n      console.debug(\"Error fetching from API:\", err.responseJSON);\n      this.is_loading(false);\n      this.is_loaded(false);\n    });\n  }\n\n  /** Fetch non-dismissed notifications, only once and only if a URL was given */\n  fetch_notifications() {\n    if (!this.url_notifications || this.promise_notifications) {\n      return;\n    }\n    this.promise_notifications = jquery\n      .getJSON(this.url_notifications, { state__in: \"read,unread\" })\n      .then((data) => {\n        this.notifications(data.results || []);\n      })\n      .catch((err) => {\n        console.debug(\n          \"Error fetching notifications from API:\",\n          err.responseJSON,\n        );\n      });\n  }\n\n  show() {\n    this.is_showing(true);\n  }\n\n  hide() {\n    this.is_showing(false);\n  }\n}\nRegistry.add_view(PopupcardView);\n","import ko from \"knockout\";\nimport jquery from \"jquery\";\n\nimport { Registry } from \"../application/registry\";\n\n/**\n * Organization authorization settings\n */\nexport class OrganizationSettingsAuthorizationView {\n  static view_name = \"OrganizationSettingsAuthorizationView\";\n\n  constructor() {\n    this.provider_original = undefined;\n    this.provider = ko.observable();\n\n    this.show_warning = ko.observable(false);\n    this.provider.subscribe(\n      (value) => {\n        if (this.provider_original === undefined) {\n          this.provider_original = value;\n        }\n      },\n      this,\n      \"beforeChange\",\n    );\n    this.provider.subscribe((value) => {\n      if (\n        this.provider_original !== undefined &&\n        value !== this.provider_original\n      ) {\n        this.show_warning(true);\n      } else {\n        this.show_warning(false);\n      }\n    });\n    this.use_domain = ko.computed(() => {\n      return this.provider() === \"email\";\n    });\n  }\n}\nRegistry.add_view(OrganizationSettingsAuthorizationView);\n\n/**\n * Organization creation\n */\nexport class OrganizationCreateView {\n  static view_name = \"OrganizationCreateView\";\n\n  constructor() {\n    this.name = ko.observable();\n    this.slug = ko.observable();\n    this.name.subscribe((name) => {\n      const slugified = this.slugify(name);\n      this.slug(slugified);\n    });\n    this.example = ko.computed(() => {\n      const slug = this.slug() || \"organization\";\n      const example = \"https://\" + slug + \"-project.readthedocs-hosted.com\";\n      return example;\n    });\n  }\n\n  slugify(val) {\n    if (!val) return \"\";\n    return (\n      val\n        .toString()\n        .toLowerCase()\n        .trim()\n        // Replace spaces, non-word chars, underscores and dashes with a single '-'\n        // Copied from Django, which is what we are using under the hood\n        // https://github.com/django/django/blob/1e9db35/django/utils/text.py#L469-L470\n        .replace(/[^\\w\\s-_]+/g, \"-\")\n        .replace(/[-\\s]+/g, \"-\")\n        // And then also replicate our dns_safe slugging from\n        // :py:method:`readthedocs.core.utils.sluggify`\n        .replace(/[\\-\\_]+/g, \"-\")\n        .replace(/^\\-+/, \"\")\n        .replace(/\\-+$/, \"\")\n    );\n  }\n}\nRegistry.add_view(OrganizationCreateView);\n","import jquery from \"jquery\";\nimport ko from \"knockout\";\n\nimport { Registry } from \"../application/registry\";\n\nimport { html, nothing, render } from \"lit\";\nimport { when } from \"lit/directives/when.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { ref, createRef } from \"lit/directives/ref.js\";\nimport { map } from \"lit/directives/map.js\";\nimport { msg } from \"@lit/localize\";\n\nimport { LightDOMElement } from \"../application/elements\";\n\n/**\n * Combination field for project repository\n *\n * This element uses progressive enhancement of the existing form fields from\n * Django/Crispy. This web component adds dynamic interaction between the\n * fields and some additional UI elements to help describe what the user is\n * changing about the project.\n *\n * This uses :js:class:`InputFieldElement` and :js:class:`RichSelectFieldElement`\n * to isolate direct DOM manipulation from template driven web component logic.\n *\n * @property {String} label - Combination field label text\n *\n * @property {String} repoValue - Value for the repo field\n * @property {Boolean} repoError - Error state for the repo field\n * @property {String} remoteRepositoryValue - Value for the remote repository field\n * @property {String} remoteRepositoryUrl - URL for the remote repository field\n * @property {Boolean} remoteRepositoryError - Error state for the remote repository field\n *\n * @property {Boolean} useManual - Switch field to use manual repository URL\n * @property {String} previousChoice - Store previous value for remote repository\n *\n * @property {Boolean} dontSync - Don't update the repo field, project is flagged with DONT_SYNC_REMOTE_REPO\n * @property {String} showConnectedServiceWarning - Show a warning about missing connected services?\n * @property {String} showManualUrlWarning - Show a warning about switching to manual URL?\n * @property {String} urlDocsManual - URL for manual warning\n * @property {String} urlConnectedServices - URL for connected services warning\n */\nexport class ProjectRepositoryMultifieldElement extends LightDOMElement {\n  static properties = {\n    label: { type: String },\n\n    repoValue: { type: String },\n    repoError: { state: true },\n    remoteRepositoryValue: { type: String },\n    remoteRepositoryUrl: { type: String },\n    remoteRepositoryError: { state: true },\n\n    useManual: { state: true },\n    previousChoice: { state: true },\n\n    dontSync: {\n      type: Boolean,\n      attribute: \"dont-sync\",\n    },\n    showConnectedServiceWarning: {\n      type: Boolean,\n      attribute: \"show-connected-service-warning\",\n    },\n    showManualUrlWarning: {\n      type: Boolean,\n      attribute: \"show-manual-url-warning\",\n    },\n    urlConnectedServices: {\n      type: String,\n      attribute: \"url-connected-services\",\n    },\n    urlDocsManual: {\n      type: String,\n      attribute: \"url-docs-manual\",\n    },\n  };\n\n  /** @attr {Ref} refRemoteRepository - Reference to the field web component for\n   * remote repository field */\n  refRemoteRepository = createRef();\n  /** @attr {Ref} refRepo - Reference to the field web component for repo field */\n  refRepo = createRef();\n\n  constructor() {\n    super();\n    this.remoteRepositoryValue = \"\";\n    this.useManual = true;\n  }\n\n  /**\n   * Pick up elements for enhancement\n   *\n   * This is like fake slotting, something we can't use because we're not using\n   * shadow DOM. The targeted elements are used in :js:class:`render`, which is\n   * how these elements are moved into this light DOM.\n   *\n   * Children are manipulated slightly, we don't use all the child elements and\n   * work with the output DOM that Crispy gives for now.\n   */\n  connectedCallback() {\n    super.connectedCallback();\n    this.slotRemoteRepository = Array.from(\n      this.querySelector(\"#div_id_remote_repository\").children,\n    );\n    this.slotRepo = Array.from(this.querySelector(\"#div_id_repo\").children);\n\n    // Mimic shadow DOM default slot behavior. All children are moved into a\n    // disconnected element, so after slotted children are placed in the DOM the\n    // leftover element aren't displayed.\n    this.slotDefault = document.createElement(\"div\");\n    this.slotDefault.replaceChildren(...this.children);\n  }\n\n  listenerRemoteRepository(event) {\n    if (\n      event.type == \"change\" &&\n      event.target === this.refRemoteRepository.value\n    ) {\n      this.remoteRepositoryValue = event.target.value;\n      this.remoteRepositoryUrl = event.target.description;\n      this.remoteRepositoryError = event.target.hasError;\n    }\n  }\n\n  listenerRepo(event) {\n    if (event.type == \"change\" && event.target === this.refRepo.value) {\n      this.repoValue = event.target.value;\n      this.repoError = event.target.hasError;\n    }\n  }\n\n  toggleManual(event) {\n    this.useManual = Boolean(event.target.checked);\n    this.showManualUrlWarning = this.useManual;\n  }\n\n  render() {\n    const classesRemoteRepositoryField = {\n      disabled: this.useManual,\n      error: Boolean(this.remoteRepositoryError),\n    };\n    const classesRepoField = {\n      disabled: !this.useManual,\n      error: Boolean(this.repoError),\n    };\n\n    return html`\n      <div class=\"ui required field\">\n        <label> ${this.label} </label>\n\n        <div class=\"ui field segment\">\n          <readthedocs-richselect-field\n            .value=\"${this.remoteRepositoryValue}\"\n            .disabled=\"${this.useManual}\"\n            @change=\"${this.listenerRemoteRepository}\"\n            ${ref(this.refRemoteRepository)}\n          >\n            ${when(\n              this.showConnectedServiceWarning && !this.useManual,\n              () => html`\n                <div class=\"ui message\">\n                  <div class=\"header\">\n                    <i class=\"fas fa-circle-info icon\"></i>\n                    ${msg(\n                      `No connected services are configured for your account`,\n                    )}\n                  </div>\n                  ${msg(\n                    html`You must\n                      <a href=\"${this.urlConnectedServices}\"\n                        >add a connected service</a\n                      >\n                      in order to modify a project's connected repository.`,\n                  )}\n                </div>\n              `,\n            )}\n            <div\n              class=\"ui basic fitted segment ${classMap(\n                classesRemoteRepositoryField,\n              )} field\"\n            >\n              ${this.slotRemoteRepository}\n\n              <div class=\"ui divider\"></div>\n            </div>\n          </readthedocs-richselect-field>\n\n          <div class=\"ui basic fitted segment field\">\n            <div class=\"ui checkbox\">\n              <input\n                type=\"checkbox\"\n                ?checked=\"${this.useManual}\"\n                @change=\"${this.toggleManual}\"\n              />\n              <label> Use manually configured repository URL </label>\n            </div>\n          </div>\n\n          <readthedocs-input-field\n            .value=\"${this.repoValue}\"\n            .disabled=\"${!this.useManual}\"\n            @change=\"${this.listenerRepo}\"\n            ${ref(this.refRepo)}\n          >\n            ${when(\n              this.showManualUrlWarning,\n              () => html`\n                <div class=\"ui message\">\n                  <div class=\"header\">\n                    <i class=\"fas fa-circle-info icon\"></i>\n                    ${msg(`Additional setup steps are required`)}\n                  </div>\n                  ${msg(html`\n                    To learn how to set up a project with a manually configured\n                    repository URL,\n                    <a href=\"${this.urlDocsManual}\" target=\"_blank\">\n                      see our guide on configuring manual Git integrations </a\n                    >.\n                  `)}\n                </div>\n              `,\n            )}\n            <div class=\"ui ${classMap(classesRepoField)} last field\">\n              ${this.slotRepo}\n            </div>\n          </readthedocs-input-field>\n        </div>\n      </div>\n    `;\n  }\n\n  willUpdate(changed) {\n    if (changed.has(\"remoteRepositoryValue\")) {\n      if (this.remoteRepositoryValue !== \"\" && !changed.has(\"useManual\")) {\n        this.useManual = false;\n        // Project is flagged to not sync the repo field, we'll do the same in\n        // our UX in this form for now.\n        if (!this.dontSync) {\n          this.repoValue = this.remoteRepositoryUrl;\n        }\n        // Reset errors on the repo field\n        if (this.repoError) {\n          this.repoError = false;\n          this.refRepo.value.clearErrors();\n        }\n      }\n    } else if (changed.has(\"useManual\")) {\n      // Store default so we can restore it if the user unchecks useManual\n      if (this.useManual) {\n        this.previousChoice = this.remoteRepositoryValue;\n        this.remoteRepositoryValue = \"\";\n      } else {\n        this.remoteRepositoryValue = this.previousChoice;\n      }\n    }\n  }\n}\ncustomElements.define(\n  \"readthedocs-project-repository-multifield\",\n  ProjectRepositoryMultifieldElement,\n);\n\n/**\n * Project automation rule form view\n *\n * @param {Object} automation_rule - Initial instance data, optional\n */\nexport class ProjectAutomationRuleView {\n  static view_name = \"ProjectAutomationRuleView\";\n\n  constructor(automation_rule) {\n    this.version_predefined_match_pattern = ko.observable();\n    this.is_version_match_pattern_visible = ko.computed(() => {\n      const version_predefined_match_pattern =\n        this.version_predefined_match_pattern();\n      return version_predefined_match_pattern === \"custom-match\";\n    });\n    this.is_all_versions = ko.computed(() => {\n      return this.version_predefined_match_pattern() === \"all-versions\";\n    });\n    this.is_semver_versions = ko.computed(() => {\n      return this.version_predefined_match_pattern() === \"semver-versions\";\n    });\n    this.is_custom = ko.computed(() => {\n      return this.version_predefined_match_pattern() === \"custom-match\";\n    });\n  }\n}\nRegistry.add_view(ProjectAutomationRuleView);\n\n/**\n * Project redirect rule form view\n *\n * @param {Object} redirect - Initial instance data, optional\n */\nexport class ProjectRedirectView {\n  static view_name = \"ProjectRedirectView\";\n\n  constructor(redirect) {\n    this.redirect_type = ko.observable();\n    this.from_url = ko.observable(\"\");\n    this.to_url = ko.observable(\"\");\n\n    this.is_example_disabled = ko.observable(false);\n    this.is_from_url_visible = ko.observable();\n    this.is_to_url_visible = ko.observable();\n\n    // HTML prefix content for from field, don't use user input here\n    this.redirect_from_prefix = ko.computed(() => {\n      const redirect_type = this.redirect_type();\n      const lang_part = `/<span class=\"ui violet text\">$lang</span>`;\n      const version_part = `/<span class=\"ui violet text\">$version</span>`;\n\n      if (redirect_type === \"page\") {\n        return `${lang_part}${version_part}/`;\n      } else if (redirect_type === \"clean_url_to_html\") {\n        return `${lang_part}${version_part}/<span class=\"ui violet text\">$file</span>/`;\n      } else if (redirect_type === \"clean_url_without_trailing_slash_to_html\") {\n        return `${lang_part}${version_part}/<span class=\"ui violet text\">$file</span>`;\n      } else if (redirect_type === \"html_to_clean_url\") {\n        return `${lang_part}${version_part}/<span class=\"ui violet text\">$file</span>.html`;\n      }\n      return \"\";\n    });\n    // User input for from field as text, no HTML allowed\n    this.redirect_from = ko.computed(() => {\n      const from_url = this.from_url();\n      const redirect_type = this.redirect_type();\n      if (redirect_type === \"prefix\") {\n        return from_url + \"faq.html\";\n      } else if (redirect_type === \"page\") {\n        return from_url.replace(/^\\/+/, \"\");\n      } else if (redirect_type === \"exact\") {\n        return from_url;\n      }\n      return \"\";\n    });\n    // HTML prefix content for to field, don't use user input here.\n    this.redirect_to_prefix = ko.computed(() => {\n      const redirect_type = this.redirect_type();\n      const lang_part = `/<span class=\"ui violet text\">$lang</span>`;\n      const version_part = `/<span class=\"ui violet text\">$version</span>`;\n\n      if (redirect_type === \"prefix\") {\n        return `${lang_part}${version_part}/faq.html`;\n      } else if (redirect_type === \"page\") {\n        return `${lang_part}${version_part}/`;\n      } else if (redirect_type === \"clean_url_to_html\") {\n        return `${lang_part}${version_part}/<span class=\"ui violet text\">$file</span>.html`;\n      } else if (redirect_type === \"clean_url_without_trailing_slash_to_html\") {\n        return `${lang_part}${version_part}/<span class=\"ui violet text\">$file</span>.html`;\n      } else if (redirect_type === \"html_to_clean_url\") {\n        return `${lang_part}${version_part}/<span class=\"ui violet text\">$file</span>/`;\n      }\n      return \"\";\n    });\n    // User input for to field as text, no HTML allowed\n    this.redirect_to = ko.computed(() => {\n      const to_url = this.to_url();\n      const redirect_type = this.redirect_type();\n      if (redirect_type === \"page\") {\n        return to_url.replace(/^\\/+/, \"\");\n      } else if (redirect_type === \"exact\") {\n        return to_url;\n      }\n      return \"\";\n    });\n\n    this.redirect_type.subscribe((redirect_type) => {\n      if ([\"prefix\", \"page\", \"exact\"].includes(redirect_type)) {\n        this.is_example_disabled(false);\n        let is_to_url_visible = true;\n\n        // Update visibility\n        if (redirect_type == \"prefix\") {\n          is_to_url_visible = false;\n        }\n        this.is_from_url_visible(true);\n        this.is_to_url_visible(is_to_url_visible);\n      } else if (\n        [\n          \"clean_url_to_html\",\n          \"clean_url_without_trailing_slash_to_html\",\n          \"html_to_clean_url\",\n        ].includes(redirect_type)\n      ) {\n        this.is_example_disabled(false);\n        this.is_from_url_visible(false);\n        this.is_to_url_visible(false);\n      } else {\n        this.is_example_disabled(true);\n        this.is_from_url_visible(false);\n        this.is_to_url_visible(false);\n      }\n    });\n  }\n}\nRegistry.add_view(ProjectRedirectView);\n\n/**\n * Project sharing form view\n *\n * @param {Object} share - Initial instance data, optional\n */\nexport class ProjectTemporaryAccessView {\n  static view_name = \"ProjectTemporaryAccessView\";\n\n  constructor(share) {\n    this.access_type = ko.observable();\n    this.show_password_field = ko.computed(() => {\n      return this.access_type() == \"password\";\n    });\n\n    this.allow_all = ko.observable(share.allow_all);\n    this.show_versions_list = ko.computed(() => {\n      return this.allow_all() === false;\n    });\n  }\n}\nRegistry.add_view(ProjectTemporaryAccessView);\n\n/**\n * Project search analytics view\n *\n * Search analytics chart data and config is loaded from an inline\n * application/json script block, so that data, labels, and localized strings\n * can be handled from the templates.\n *\n * @param {Element} elem - Element that view is attached to\n */\nexport class ProjectSearchAnalyticsView {\n  static view_name = \"ProjectSearchAnalyticsView\";\n\n  constructor() {\n    this.config = ko.observable();\n    this.is_loading = ko.observable(true);\n    this.config.subscribe((config) => {\n      this.is_loading(false);\n    });\n  }\n}\nRegistry.add_view(ProjectSearchAnalyticsView);\n\n/**\n * Project traffic analytics view\n *\n * This is identical to search analytics currently\n */\nexport class ProjectTrafficAnalyticsView extends ProjectSearchAnalyticsView {\n  static view_name = \"ProjectTrafficAnalyticsView\";\n}\nRegistry.add_view(ProjectTrafficAnalyticsView);\n","/* Public task tracking */\n\nimport jquery from \"jquery\";\n\nexport function poll_task(data) {\n  var defer = jquery.Deferred();\n  var tries = 5;\n\n  function poll_task_loop() {\n    jquery\n      .getJSON(data.url)\n      .done(function (task) {\n        if (task.finished) {\n          if (task.success) {\n            defer.resolve();\n          } else {\n            defer.reject({ message: task.error });\n          }\n        } else {\n          setTimeout(poll_task_loop, 2000);\n        }\n      })\n      .fail(function (error) {\n        console.error(\"Error polling task\");\n        tries -= 1;\n        if (tries > 0) {\n          setTimeout(poll_task_loop, 2000);\n        } else {\n          let error_msg = error.statusText;\n          if (error.responseJSON) {\n            error_msg = error.responseJSON.detail;\n          }\n          defer.reject({ message: error_msg });\n        }\n      });\n  }\n\n  setTimeout(poll_task_loop, 2000);\n\n  return defer;\n}\n\nexport function trigger_task(config) {\n  var defer = jquery.Deferred();\n  var url = config.url;\n  var token = config.token;\n  var data = { csrfmiddlewaretoken: token };\n\n  jquery.ajax({\n    method: \"POST\",\n    url: url,\n    data: data,\n    success: function (data) {\n      poll_task(data)\n        .then(function () {\n          defer.resolve();\n        })\n        .fail(function (error) {\n          // The poll_task function defer will only reject with\n          // normalized error objects\n          defer.reject(error);\n        });\n    },\n    error: function (error) {\n      var error_msg = error.responseJSON.detail || error.statusText;\n      defer.reject({ message: error_msg });\n    },\n  });\n\n  return defer;\n}\n","import jquery from \"jquery\";\nimport ko from \"knockout\";\n\nimport * as tasks from \"../tasks\";\nimport * as utils from \"../core/utils\";\nimport { ResponsiveView } from \"../core/views\";\nimport { Registry } from \"../application/registry\";\n\n/**\n * Remote repository instance for remote repository listing.\n *\n * @param {Object} remote_repo - Remote repository API data\n */\nclass RemoteRepository {\n  constructor(remote_repo) {\n    // Just copy attributes over instead of prototyping. KO observables make a\n    // prototype change more awkward. Note, ``projects`` now comes directly from\n    // the API response, there is no need to parse this data from the v2\n    // ``matches`` response.\n    for (const key of Object.keys(remote_repo)) {\n      this[key] = remote_repo[key];\n    }\n\n    /** @observable {Boolean} Is this repository private? */\n    this.is_private = ko.observable(this.private);\n    /** @observable {Booleean} Is this repository active? */\n    this.is_active = ko.observable(this.active);\n    /** @observable {Boolean} Does user have admin privilege on the repo? */\n    this.has_admin = ko.observable(this.admin);\n    /** @computed {Boolean} Can user import this repository? */\n    this.is_locked = ko.computed(() => {\n      // TODO take platform private repo setting into consideration\n      return this.is_private() && !this.has_admin();\n    });\n    /** @observable {Boolean} Was the repository already imported? */\n    this.has_project = ko.computed(() => {\n      return this.projects.length > 0;\n    });\n  }\n}\n\n/**\n * Project creation view, for setting up a new project or linking an existing\n * repository to a new project.\n *\n * @extends {ResposiveView}\n */\nexport class ProjectCreateView extends ResponsiveView {\n  static view_name = \"ProjectCreateView\";\n\n  constructor() {\n    super();\n\n    /** Configuration passed in via :func:`~application.plugins.jsonInit`\n     * @observable {Object} View configuration */\n    this.config = ko.observable();\n    /** Configuration passed in via :func:`~application.plugins.jsonInit`\n     * @observable {Object} Search configuration */\n    this.search_config = ko.observable();\n    /** @observable {Object} Search popup module configuration */\n    this.search_popup_config = ko.observable();\n    /** @observable {Object} Search modal module configuration */\n    this.search_modal_config = ko.observable(undefined);\n    /** @observable {Object} The selected repository */\n    this.selected = ko.observable();\n    /** @observable {Boolean} Is UI loading from the API currently? */\n    this.is_loading = ko.observable(false);\n    /** @observable {Boolean} Are remote repositories current resyncing? */\n    this.is_syncing = ko.observable(false);\n    /** @observable {Boolean} Are remote repositories done resyncing? */\n    this.is_synced = ko.observable(false);\n    /** @computed {Boolean} Is there a selected repository? */\n    this.is_selected = ko.computed(() => {\n      return this.selected() !== undefined;\n    });\n    /** @observable {Boolean} Can private repositories be imported */\n    this.allow_private_repos = ko.observable(false);\n    /** @observable {string} The error message to show the user */\n    this.error = ko.observable();\n\n    // Wait for config to be loaded to init search\n    this.config.subscribe((config) => {\n      if (config !== undefined) {\n        this.allow_private_repos(config.allow_private_repos);\n        this.init_search();\n      }\n    });\n  }\n\n  /**\n   * Sync remote repository objects using a call to our API. This sets the UI to\n   * a loading state so that user interaction can be limited. Configuration is\n   * loaded using :func:`config` and :func:`application.plugins.jsonInit`.\n   */\n  sync_remote_repos() {\n    const config = this.config();\n\n    const params = {\n      url: config.urls.api_sync_remote_repositories,\n      token: config.csrf_token,\n    };\n\n    this.is_synced(false);\n    this.is_syncing(true);\n    this.is_loading(true);\n\n    let promise = tasks\n      .trigger_task(params)\n      .fail((error) => {\n        console.error(\"Error syncing remote repositories:\", error.message);\n        this.error(error.message);\n      })\n      .always(() => {\n        this.is_syncing(false);\n        this.is_loading(false);\n        this.is_synced(true);\n      });\n\n    return promise;\n  }\n\n  /**\n   * Set up SUI search once :func:`config` is fully loaded.\n   *\n   * This uses a Knockout template to make it easier to display the individual\n   * elements in the list. The template is loaded from the element\n   * ``remote-repo-results``.\n   *\n   * Ultimately, this sets :func:`search_config`, which is the configuration\n   * object that will be eventually be used by SUI search jQuery plugin.\n   *\n   * .. seealso::\n   *     https://knockoutjs.com/documentation/template-binding.html\n   */\n  init_search() {\n    const config = this.config();\n    const url = config.urls.remoterepository_list + \"?full_name={query}\";\n\n    // Configuration for the trigger of the popup element. We manually show the\n    // popup in the case that the user has tried searching multiple times\n    // unsuccessfully, or has a query with no results.\n    let attemptsRemaining = 3;\n    this.search_popup_config({\n      on: \"manual\",\n      position: \"top right\",\n      hoverable: true,\n      closable: true,\n      preserve: true,\n      onHidden: () => {\n        // If the user did something to hide the popup, like click outside the\n        // popup, reset the attempts so that the popup can show again.\n        attemptsRemaining = 3;\n      },\n      // Add a long delay so that hover doesn't accidentally dismiss the popup\n      delay: {\n        hide: 5000,\n      },\n    });\n\n    // Show repair modal immediately on view load if the URL contains `#repair` hash.\n    // Use this for linking users in support directly to this modal.\n    const show_modal = jquery(location).attr(\"hash\") == \"#repair\";\n    this.search_modal_config({\n      autoShow: show_modal,\n      centered: false,\n    });\n\n    this.search_config({\n      // We use a Knockout template here, embedded in the template as a script\n      // element. This avoids string interpolation in JS and keeps HTML in one\n      // place, along with HTML translations.\n      type: \"knockout\",\n      templates: {\n        knockout: (response) => {\n          let node_temp = jquery(\"<div>\");\n\n          ko.applyBindingsToNode(node_temp[0], {\n            template: {\n              name: \"remote-repo-results\",\n              data: {\n                remote_repos: response.results.map((repo) => {\n                  return new RemoteRepository(repo);\n                }),\n              },\n            },\n          });\n\n          const output = node_temp.html();\n          node_temp.remove();\n          return output;\n        },\n      },\n      error: {\n        noResultsHeader: \"No matching repositories found\",\n      },\n      apiSettings: {\n        url: url,\n      },\n      selector: {\n        // Required because the default of ``prompt`` is a rounded input\n        prompt: \".ui.text\",\n        // Required as we use `.title` to style a complex result title. SUI uses\n        // the `text()` of this element to look up the result\n        title: \".title .text\",\n      },\n      fullTextSearch: true,\n      onSelect: (result, response) => {\n        this.selected(new RemoteRepository(result));\n      },\n      // Listen for results and decide to show the resync popup based on what\n      // the user's interaction with search results.\n      onResults: (response, fromCache) => {\n        if ((response && response.count == 0) || attemptsRemaining <= 0) {\n          // Search results are empty or user tried searching multiple times\n          // unsuccessfully so far. Calls with the behavior style call supported by\n          // :js:func:`application.plugins.semanticui`.\n          this.search_popup_config((popup) => popup(\"show\"));\n        }\n        attemptsRemaining--;\n      },\n    });\n  }\n\n  /** {Boolean} Is repository supported, based on permissions? */\n  is_repository_supported(repo) {\n    if (repo.is_private()) {\n      return this.allow_private_repos();\n    }\n    return true;\n  }\n\n  /** Show search modal */\n  show_modal() {\n    this.search_popup_config((popup) => popup(\"hide\"));\n    this.search_modal_config((modal) => modal(\"show\"));\n  }\n}\nRegistry.add_view(ProjectCreateView);\n","import ko from \"knockout\";\nimport jquery from \"jquery\";\nimport { html, render } from \"lit\";\nimport { map } from \"lit/directives/map.js\";\nimport { when } from \"lit/directives/when.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\n\nimport * as admin from \"./admin\";\nimport * as create from \"./create\";\n\nimport { APIListItemView } from \"../core/views\";\nimport { Registry } from \"../application/registry\";\n\nexport { admin, create };\n\n/**\n * Project item view object used for displaying individual projects in the project\n * listing.\n *\n * @param {Object} project - Project API data\n * @extends {APIListItemView}\n */\nexport class ProjectListItemView extends APIListItemView {\n  static view_name = \"ProjectListItemView\";\n\n  constructor(project) {\n    super(project);\n\n    // Add expansion to API URL\n    this.url = this.url + \"?expand=permissions\";\n\n    /** Asynchronously load documentation URL as rendering this URL for each\n     * project slows the dashboard down considerably. Instead, this is only\n     * fetched when it is needed.\n     * @observable {string} Documentation URL for the project */\n    this.url_docs = ko.observable();\n    /* @observable {Boolean} Does the user have admin permissions on this? */\n    this.is_admin = ko.observable(false);\n\n    // Subscribe to the data loaded via :class:`APIListItemView`\n    this.data.subscribe((data) => {\n      this.url_docs(data.urls.documentation);\n      this.is_admin(data.permissions.admin);\n    });\n  }\n}\nRegistry.add_view(ProjectListItemView);\n\n/**\n * View for project version creation and version activation.\n *\n * @class\n * @construtor\n * @public\n */\nexport class ProjectVersionCreateView {\n  static view_name = \"ProjectVersionCreateView\";\n\n  constructor() {\n    /** Configuration passed in via :func:`~application.plugins.jsonInit`\n     * @observable {Object} Search configuration */\n    this.config = ko.observable();\n\n    /** @observable {Boolean} Is search data loading? */\n    this.is_loading = ko.observable(false);\n\n    /** Computed observable for rendering the final search configuration. This\n     * is used to initialize search as soon as the :func:`config` observable is\n     * finalized.\n     * @computed {Object} Search configuration object */\n    this.search_config = ko.computed(() => {\n      const config = this.config();\n      if (config !== undefined) {\n        return this.init_search(config);\n      }\n    });\n  }\n\n  /**\n   * Initialize the SUI search element using the configuration loaded in\n   * :func:`search_config`.\n   *\n   * This sets up various configuration for the search SUI element, but also\n   * sets up functions like `onSelect`, for performing actions on events.\n   *\n   * @param {object} config - configuration for search element\n   */\n  init_search(config) {\n    const maxResults = 100;\n    // String interpolation over URLSearchParams here as FUI uses basic string\n    // replacement for `{query}`, but this is encoded for URLSearchParams.\n    const url = config.api_url + `?limit=${maxResults}&verbose_name={query}`;\n    const errors = config.errors || {};\n    return {\n      apiSettings: {\n        url: url,\n      },\n      error: errors,\n      fullTextSearch: true,\n      maxResults: maxResults,\n      onSelect: (result, response) => {\n        window.location.href = result.urls.dashboard.edit;\n      },\n      selector: {\n        // Required because this uses ``.ui.text`` instead of ``.ui.prompt``\n        // because prompt uses a rounded input style\n        prompt: \".ui.text\",\n        // Required as ``.title`` is a complex element in our use, not a simple\n        // string like normal. The inner ``.title .text`` sets the field result\n        // to just the string value.\n        title: \".title .text\",\n      },\n      // Show results immediately on focus\n      minCharacters: 0,\n      searchOnFocus: true,\n      // Use custom template for rich result display\n      type: \"versions\",\n      templates: {\n        versions: (response) => {\n          // Using Lit here as this will likely very soon just be a web component\n          // anyways. The project create form references a Knockout observable\n          // and a template in HTML. This uses a temporary element to render down\n          // to HTML, then removes the element from ``document`` immediately.\n          const container = document.createElement(\"div\");\n          const results = html`\n            <div class=\"results\">\n              ${map(\n                response.results,\n                (version) => html`\n                  <a class=\"result\">\n                    <div class=\"image\"></div>\n                    <div class=\"content\">\n                      <div class=\"title\">\n                        <span class=\"text\">${version.verbose_name}</span>\n                        <i\n                          class=\"fas ${classMap({\n                            \"fa-code-branch\": version.type === \"branch\",\n                            \"fa-tag\": version.type === \"tag\",\n                          })} small icon\"\n                        ></i>\n                        ${when(\n                          version.active,\n                          () => html`\n                            <span class=\"ui horizontal label\">\n                              <i class=\"fas fa-check icon\"></i>\n                              Active\n                            </span>\n                          `,\n                        )}\n                      </div>\n                      <div class=\"description\">\n                        <code>${version.identifier}</code>\n                      </div>\n                    </div>\n                  </a>\n                `,\n              )}\n            </div>\n          `;\n\n          // Lit renders on an element, but FUI search templates expect HTML return\n          render(results, container);\n          const htmlResults = container.innerHTML;\n          container.remove();\n          return htmlResults;\n        },\n      },\n    };\n  }\n}\nRegistry.add_view(ProjectVersionCreateView);\n\n/** Version list item subview\n *\n * This mutates project version API return data for use in the Knockout view.\n *\n * URLs for documentation output are lazy loaded when they are requested. We\n * don't do an API call until the user interacts with the version object. This\n * way we don't have to render all of the documentation artifact URLs at once\n * through the resolver. This can cause 10s dashboard load times with a lot of\n * versions.\n *\n * @param {Object} version - Version object data from API\n * @extends {APIListItemView}\n */\nexport class VersionListItemView extends APIListItemView {\n  static view_name = \"VersionListItemView\";\n\n  constructor(version) {\n    super(version);\n\n    /** @observable {string} Async loaded URL for version PDF */\n    this.url_pdf = ko.observable();\n    /** @observable {string} Async loaded URL for version EPUB */\n    this.url_epub = ko.observable();\n    /** @observable {string} Async loaded URL for version HTMLzip */\n    this.url_html = ko.observable();\n    /** @observable {string} Async loaded URL for version docs */\n    this.url_docs = ko.observable();\n    /** @observable {Boolean} is version successfully built? */\n    this.is_built = ko.observable(true);\n\n    // On resolving the data from the API, fill out these observables.\n    this.data.subscribe((data) => {\n      this.url_pdf(data.downloads.pdf);\n      this.url_epub(data.downloads.epub);\n      this.url_html(data.downloads.htmlzip);\n      this.url_docs(data.urls.documentation);\n      this.is_built(data.built);\n    });\n  }\n\n  /**\n   * Trigger a build task for a specific version. This replaces the build\n   * dropdown form and instead provides a link on each version admin menu, which\n   * is far more intuitive.\n   *\n   * @param {string} url - URL to post to, this is a project form view, so comes\n   * from the Django template\n   * @param {string} csrf_token - Also from the Django form, the CSRF token\n   * @returns {function} Callback function\n   */\n  trigger_build(url, csrf_token) {\n    return (context, ev) => {\n      jquery\n        .ajax({\n          type: \"POST\",\n          url: url,\n          data: {\n            csrfmiddlewaretoken: csrf_token,\n          },\n        })\n        .then((data) => {\n          if (data.build.urls.build) {\n            window.location.href = data.build.urls.build;\n          } else {\n            console.debug(\"Redirect to new build failed\");\n          }\n        })\n        .catch((err) => {\n          console.error(err);\n        });\n    };\n  }\n}\nRegistry.add_view(VersionListItemView);\n\nexport class ProjectAnnouncementView {\n  static view_name = \"ProjectAnnouncementView\";\n\n  constructor(cache_key) {\n    this.cache_key = cache_key;\n    this.prefix_key = \"announcements\";\n    this.storage_key = `${this.prefix_key}.${this.cache_key}`;\n    this.closed = ko.observable();\n    const cached_value = localStorage.getItem(this.storage_key);\n    if (cached_value) {\n      this.closed(true);\n    } else {\n      this.closed(false);\n    }\n  }\n\n  close_announcement() {\n    this.closed(true);\n    localStorage.setItem(this.storage_key, true);\n  }\n}\nRegistry.add_view(ProjectAnnouncementView);\n","import { Registry } from \"../application/registry\";\n\n/*\n * View for tracking opened links, and reloading the page when they are closed.\n *\n * Useful when we depend on changes done outside of the app,\n * but we don't want to have users manually reload the page,\n * or constantly poll the server.\n */\nexport class MigrateGitHubAppView {\n  static view_name = \"MigrateGitHubAppView\";\n  constructor() {\n    this.openedWindows = [];\n    this.trackClosedWindows();\n  }\n\n  trackClosedWindows() {\n    setInterval(() => {\n      let originalLength = this.openedWindows.length;\n      this.openedWindows = this.openedWindows.filter((win) => !win.closed);\n      if (this.openedWindows.length < originalLength) {\n        // Wait some seconds before reloading the page,\n        // so our app has time to update the status.\n        setTimeout(() => {\n          window.location.reload();\n        }, 500);\n      }\n    }, 250);\n  }\n\n  /*\n   * Click event handler for tracking opened links.\n   */\n  trackLinkClick(data, event) {\n    event.preventDefault();\n    const newWindow = window.open(event.target.href, \"_blank\");\n    if (newWindow) {\n      this.openedWindows.push(newWindow);\n    }\n  }\n}\n\nRegistry.add_view(MigrateGitHubAppView);\n","import jquery from \"jquery\";\nimport ko from \"knockout\";\nimport clipboard from \"clipboard\";\nimport * as Sentry from \"@sentry/browser\";\n\nimport { ApplicationView } from \"./views\";\nimport * as plugins from \"./plugins\";\nimport { Registry } from \"./registry\";\n\n// Application views\nimport * as account_views from \"../account\";\nimport * as build_views from \"../build\";\nimport * as core_views from \"../core\";\nimport * as gold_views from \"../gold\";\nimport * as module_views from \"../modules\";\nimport * as organization_views from \"../organization\";\nimport * as project_views from \"../project\";\nimport * as profile_views from \"../profile\";\n\n/**\n * This is the main entry point for the front end code and is used to set up and\n * instantiate Webpack, Knockout, and SemanticUI. This class is used to set up\n * and instantiate all of the front end functionality. The main entry point is\n * :meth:`Application.run`.\n */\nexport class Application {\n  constructor(config) {\n    this.config = config;\n    this.registry = new Registry();\n  }\n\n  /**\n   * This is the first method to be executed after instantiation. It handles\n   * all of the set up and instantiation.\n   *\n   * - :meth:`Application.load_config` loads the site configuration\n   * - :meth:`Application.configure_plugins` loads plugins\n   * - :meth:`Application.attach_view` does view routing and attaches the view\n   * - :meth:`Application.start_plugins` sets up jQuery plugins on some elements\n   */\n  run() {\n    this.load_config();\n    this.configure_plugins();\n    this.attach_view();\n    this.add_jquery_plugins();\n  }\n\n  /**\n   * Load site configuration from a special ``application/json`` script element.\n   * This configures paths for Webpack async imports, console debugging.\n   *\n   * .. seealso::\n   *     Convention on :ref:`js-json-config`\n   */\n  load_config() {\n    if (this.config === undefined) {\n      console.debug(\"Loading site front end configuration from script tag\");\n      const site_config_src = jquery(\"script#site-config\").text() || \"{}\";\n      this.config = JSON.parse(site_config_src);\n    }\n    if (this.config?.webpack_public_path) {\n      __webpack_public_path__ = this.config.webpack_public_path;\n      globalThis.__webpack_public_path__ = this.config.webpack_public_path;\n    }\n    // Null route debug logging, don't do output anything that was debug\n    if (!this.config?.debug) {\n      console.debug = () => {};\n    }\n    // Load Sentry\n    if (this.config?.sentry?.dsn) {\n      Sentry.init({\n        dsn: this.config.sentry.dsn,\n        environment: this.config.sentry?.environment,\n        integrations: [],\n      });\n    }\n\n    return this.config;\n  }\n\n  /**\n   * Add jQuery and Knockout plugins so that HTML and JS can use these plugins.\n   * This is mainly just the various import logic and configuration, not where\n   * we would run something like ``$('.ui.modal').modal()``.\n   */\n  configure_plugins() {\n    plugins.configure_jquery_plugins();\n    plugins.configure_knockout_plugins();\n  }\n\n  /**\n   * Attach the :class:`ApplicationView` view router, which gives templates\n   * access to all views that we have available. This is how we are able to\n   * reference a view in a Knockout data binding.\n   */\n  attach_view() {\n    const view = new ApplicationView();\n    this.registry.attach(view);\n    view.attach();\n  }\n\n  /**\n   * Set up jQuery and SUI jQuery plugins that were not explicitly set up in\n   * templates. Elements that are configured inside templates use the Knockout\n   * plugin :func:`~application.plugins.semanticui`. This allows for explicit\n   * set up of an element's plugin, and should be the standard way to attach a\n   * jQuery plugin to an element.\n   *\n   * We don't do generic targeting of elements when setting up jQuery plugins as\n   * there are a number of places where an element needs to be initialized with\n   * specific plugin configuration. It's easiest to define in HTML what plugin\n   * and plugin configuration the element needs.\n   *\n   * .. warning::\n   *     Generic targeting use should be avoided and it's use deprecated.\n   */\n  add_jquery_plugins() {\n    // TODO remove instances of these in code and replace with the explicit\n    // semanticui KO plugin.\n    jquery(\".ui.progress:not([data-semanticui-progress])\").progress();\n    jquery(\".ui.accordion:not([data-semanticui-accordion])\").accordion();\n    jquery(\".ui.dropdown:not([data-semanticui-dropdown])\").dropdown({\n      placeholder: \"\",\n    });\n    // Automatically convert ``<select>`` in a nested dropdown element. This is\n    // used with Crispy form fields and other Django form fields mostly.\n    jquery(\".ui.dropdown[data-semanticui-dropdown] > select\").dropdown({\n      placeholder: \"\",\n    });\n\n    // Enable popup functionality with a broad CSS selector here because\n    // `data-content` is very basic usage of a popup. Anything more complicated\n    // should use the semanticui KO plugin.\n    jquery(\"[data-content]:not([data-semanticui-popup])\").popup({\n      position: \"top center\",\n      delay: {\n        show: 500,\n      },\n      variation: \"small\",\n    });\n    jquery(\".ui.menu > .item[data-tab]\").tab();\n\n    /* Initialize clipboard.js using a few selectors that we are using. This\n     * isn't a great fit for Knockout custom data binding or plugin, as the\n     * library uses some builtin/hardcoded selectors. */\n    var clipboard_global = new clipboard(\n      \"[data-clipboard-text], [data-clipboard-target]\",\n    );\n    // Provide the user with some visual feedback using FUI popups\n    jquery(\"[data-clipboard-text], [data-clipboard-target]\").popup({\n      on: \"click\",\n      hoverable: false,\n      content: \"Copied!\",\n    });\n\n    // Plausible. Only logged in users are tracked, the flag is set by the\n    // ``settings_dashboard`` template tag.\n    if (this.config.analytics_enabled) {\n      jquery(\"[data-analytics], [data-analytics-events]\").plausible(\n        this.config.production_domain,\n        this.config.debug,\n      );\n    }\n  }\n}\n","import jquery from \"jquery\";\nimport { Application } from \"./application\";\n\njquery(document).ready(() => {\n  const app = new Application();\n  app.run();\n});\n"],"names":["moment","e","Error","code","module","exports","ApplicationView","_classCallCheck","key","value","selector","arguments","length","undefined","console","debug","ko","this","jquery","modal_id","data","event","modal","_step","_iterator","_createForOfIteratorHelper","document","querySelectorAll","s","n","done","button","dataset","variation","split","pop","join","err","f","form","currentTarget","querySelector","submit","globalThis","jQuery","htmlInit","add_init_handler","element","innerHTML","property","html","textInit","innerText","text","valueInit","jsonInit","JSON","parse","error","getter","setter","init","valueAccessor","allBindingsAccessor","value_accessor","chart","then","_ref","chartjs","config","datasets","map","backgroundColor","borderColor","pointBorderColor","borderWidth","popup","bindings","view","context","Object","assign","hoverable","delay","show","hide","exclusive","onHide","$rawData","hover","webcomponent","update","all_bindings","binding_value","_i","_Object$entries","entries","_Object$entries$_i","_slicedToArray","semanticui","jq_element","_loop","_Object$entries2$_i","_Object$entries2","_i2","behavior","_console","_len","args","Array","_key","apply","concat","detachable","body","prepend","attr","jqueryPlausible","domain","plausibleSettings","trackLocalhost","trackEvent","Plausible","trackPageview","each","index","elem","_data$analyticsEvents","_data$analytics","eventNames","analyticsEvents","analytics","eventProperties","handleAnalyticsEvent","isLink","tagName","toLowerCase","isMiddleClick","type","which","isClick","isLinkClick","target","ctrlKey","metaKey","shiftKey","Promise","all","eventName","resolve","reject","callback","props","setTimeout","href","window","location","preventDefault","keys","forEach","match","_match","addEventListener","jquery_tabmenu","settings","$","find","tab","Registry","_this","name","views","view_name","params","_construct","constructor","view_class","SocialAccountView","options","github_modal_config","_createClass","_defineProperty","LoginView","_SocialAccountView","_inherits","_super","_createSuper","call","last_tab","last_method","popups","method","_this2","position","content","msg","closable","preserve","on","isArray","includes","cookie","isSecureContext","_get","_getPrototypeOf","prototype","add_view","dayjs","RelativeTime","Duration","LocalizedFormat","BuildCommandOutput","build_command_output","command","output","line_number","anchor_id","id","is_selected","BuildCommand","build_command","replace","looks_like_debug","is_debug","exit_code","is_successful","is_cancelled","run_time","end_time","finished","is_visible","deferEvaluation","command_class","is_expanded","subscribe","output_lines","line","ansi_up","AnsiUp","use_classes","ansi_to_html","BuildDetailView","_this3","build","url_api_build","url_api_notifications","success","notifications","has_notifications","state","state_display","is_finished","is_loading","can_cancel","can_retry","can_view_docs","is_wrapped","update_state","progress_config","states","isInitial","autoSuccess","indexOf","total","label","is_failed","progress","extend","deferred","date","date_display","date_display_since","length_display","date_readable","format","fromNow","duration","dateNow","dateStart","diff","formatParts","minutes","unshift","hours","builder","commands","commit","commit_short","substring","docs_url","commit_url","legacy_output","selected_hash","selected_line","selected_line_prev","show_debug","is_polling","set_selected_line_from_hash","poll_api_build","poll_api_notifications","_this4","valueHasMutated","add_command","stringify","_this5","getJSON","state__in","results","command_found","arrayFirst","command_search","push","scrollIntoView","block","inline","focus","found","selected_command","output_line","set_selected_line","breakpoints","mobile","tablet","computer","large_screen","ResponsiveView","viewport_width","device","ratelimit","width","_Object$keys","device_name","is_device","jq_window","fn_update","APIListItemView","url","loaded","loading","promise","HeaderView","search_project_config","URL","api_projects_list_url","origin","search","apiSettings","onResponse","resp","description","slug","subproject_of","translation_of","language","url_project","urls","home","url_window","hostname","title","toString","minCharacters","StripeCheckoutView","stripeKey","checkoutSessionUrl","csrfToken","stripe","stripeLoading","priceId","initializeStripe","loadStripe","fetch","headers","result","json","redirectToCheckout","sessionId","session_id","LightDOMElement","_LitElement","LitElement","AvatarElement","_templateObject","_taggedTemplateLiteral","changed","has","seed","rng","pureRand","posX","posY","style","setProperty","String","css","_templateObject2","customElements","define","CollapsingHeaderView","collapsed","is_collapsed","dropdown_class","FilterView","filter_config","action","onChange","$elem","closest","FieldElement","_LightDOMElement","_assertThisInitialized","createRef","hasError","refInput","refErrors","Boolean","set","tabIndex","setAttribute","inputValue","disabled","dispatchChangeEvent","dispatchEvent","CustomEvent","bubbles","composed","remove","InputFieldElement","_FieldElement","_super2","elemInput","stopPropagation","RichSelectFieldElement","_FieldElement2","_super3","dropdown","fireOnInit","$selected","selected","_jquery","get","properties","APIEventWrapper","onEvent","Accept","request","classes","classList","add","sendRequest","getHeaders","getUrl","response","ok","onError","urlSuccess","getSuccessURL","toast","class","message","errorMessage","attribute","MenuBuildRebuildElement","_APIEventWrapper","uploaded","uploadedMessage","_this$data","ButtonSyncAllVersionsElement","_APIEventWrapper2","log","contextData","createContext","Symbol","contextState","States","freeze","WAITING","LOADING","DONE","APIProviderElement","_APIEventWrapper3","_super4","ContextProvider","_providerData","setValue","_providerState","APIConsumerElement","_LightDOMElement2","_super5","ContextConsumer","_consumerData","_consumerState","click","ItemDocsElement","_APIConsumerElement","_super6","_this$data2","classMap","documentation","queueEvent","when","_templateObject3","ItemDownloadsElement","_APIConsumerElement2","_super7","_this$data3","_this$data4","_this$data5","_this$data6","_this$data7","_this$data8","_templateObject4","_templateObject5","_templateObject6","downloads","pdf","epub","htmlzip","MenuProjectAdminElement","_APIConsumerElement3","_super8","_this$data9","_this$data10","isAdmin","permissions","admin","urlSettings","_templateObject7","_properties","setPrototypeOf","isFrozen","getPrototypeOf","getOwnPropertyDescriptor","seal","create","construct","Reflect","x","fun","thisValue","Func","arrayForEach","unapply","arrayPop","arrayPush","stringToLowerCase","stringToString","stringMatch","stringReplace","stringIndexOf","stringTrim","trim","objectHasOwnProperty","hasOwnProperty","regExpTest","RegExp","test","typeErrorCreate","func","TypeError","_len2","_key2","thisArg","addToSet","array","transformCaseFunc","l","lcElement","cleanArray","clone","object","newObject","lookupGetter","prop","desc","html$1","svg$1","svgFilters","svgDisallowed","mathMl$1","mathMlDisallowed","svg","mathMl","xml","MUSTACHE_EXPR","ERB_EXPR","TMPLIT_EXPR","DATA_ATTR","ARIA_ATTR","IS_ALLOWED_URI","IS_SCRIPT_OR_DATA","ATTR_WHITESPACE","DOCTYPE_NAME","CUSTOM_ELEMENT","EXPRESSIONS","__proto__","NODE_TYPE","getGlobal","purify","createDOMPurify","DOMPurify","root","version","removed","nodeType","isSupported","originalDocument","currentScript","DocumentFragment","HTMLTemplateElement","Node","Element","NodeFilter","NamedNodeMap","MozNamedAttrMap","HTMLFormElement","DOMParser","trustedTypes","ElementPrototype","cloneNode","getNextSibling","getChildNodes","getParentNode","template","createElement","ownerDocument","trustedTypesPolicy","emptyHTML","implementation","createNodeIterator","createDocumentFragment","getElementsByTagName","importNode","hooks","afterSanitizeAttributes","afterSanitizeElements","afterSanitizeShadowDOM","beforeSanitizeAttributes","beforeSanitizeElements","beforeSanitizeShadowDOM","uponSanitizeAttribute","uponSanitizeElement","uponSanitizeShadowNode","createHTMLDocument","IS_ALLOWED_URI$1","ALLOWED_TAGS","DEFAULT_ALLOWED_TAGS","ALLOWED_ATTR","DEFAULT_ALLOWED_ATTR","CUSTOM_ELEMENT_HANDLING","tagNameCheck","writable","configurable","enumerable","attributeNameCheck","allowCustomizedBuiltInElements","FORBID_TAGS","FORBID_ATTR","ALLOW_ARIA_ATTR","ALLOW_DATA_ATTR","ALLOW_UNKNOWN_PROTOCOLS","ALLOW_SELF_CLOSE_IN_ATTR","SAFE_FOR_TEMPLATES","SAFE_FOR_XML","WHOLE_DOCUMENT","SET_CONFIG","FORCE_BODY","RETURN_DOM","RETURN_DOM_FRAGMENT","RETURN_TRUSTED_TYPE","SANITIZE_DOM","SANITIZE_NAMED_PROPS","KEEP_CONTENT","IN_PLACE","USE_PROFILES","FORBID_CONTENTS","DEFAULT_FORBID_CONTENTS","DATA_URI_TAGS","DEFAULT_DATA_URI_TAGS","URI_SAFE_ATTRIBUTES","DEFAULT_URI_SAFE_ATTRIBUTES","MATHML_NAMESPACE","SVG_NAMESPACE","HTML_NAMESPACE","NAMESPACE","IS_EMPTY_INPUT","ALLOWED_NAMESPACES","DEFAULT_ALLOWED_NAMESPACES","MATHML_TEXT_INTEGRATION_POINTS","HTML_INTEGRATION_POINTS","COMMON_SVG_AND_HTML_ELEMENTS","PARSER_MEDIA_TYPE","SUPPORTED_PARSER_MEDIA_TYPES","CONFIG","formElement","isRegexOrFunction","testValue","Function","_parseConfig","cfg","ADD_URI_SAFE_ATTR","ADD_DATA_URI_TAGS","ALLOWED_URI_REGEXP","ADD_TAGS","ADD_ATTR","table","tbody","TRUSTED_TYPES_POLICY","createHTML","createScriptURL","purifyHostElement","createPolicy","suffix","ATTR_NAME","hasAttribute","getAttribute","policyName","scriptUrl","_","warn","_createTrustedTypesPolicy","ALL_SVG_TAGS","ALL_MATHML_TAGS","_forceRemove","node","removeChild","_removeAttribute","getAttributeNode","from","removeAttribute","_initDocument","dirty","doc","leadingWhitespace","matches","dirtyPayload","parseFromString","documentElement","createDocument","insertBefore","createTextNode","childNodes","_createNodeIterator","SHOW_ELEMENT","SHOW_COMMENT","SHOW_TEXT","SHOW_PROCESSING_INSTRUCTION","SHOW_CDATA_SECTION","_isClobbered","nodeName","textContent","attributes","namespaceURI","hasChildNodes","_isNode","_executeHooks","currentNode","hook","_sanitizeElements","allowedTags","firstElementChild","_isBasicCustomElement","parentNode","i","childClone","__removalCount","parent","parentTagName","_checkValidNamespace","expr","_isValidAttribute","lcTag","lcName","_sanitizeAttributes","hookEvent","attrName","attrValue","keepAttr","allowedAttributes","forceKeepAttr","getAttributeType","setAttributeNS","_sanitizeShadowDOM","fragment","shadowNode","shadowIterator","nextNode","sanitize","importedNode","returnNode","appendChild","firstChild","nodeIterator","shadowroot","shadowrootmode","serializedHTML","outerHTML","doctype","setConfig","clearConfig","isValidAttribute","tag","addHook","entryPoint","hookFunction","removeHook","removeHooks","removeAllHooks","NotificationElement","notification","nothing","inverted","dismissable","dismiss","icon_classes","unsafeHTML","header","_links","_self","transition","animation","onComplete","parentElement","NotificationListElement","URLSearchParams","fetchNotifications","repeat","className","PopupcardView","url_notifications","is_showing","is_loaded","popup_config","onShow","promise_notifications","fetch_notifications","responseJSON","OrganizationSettingsAuthorizationView","provider_original","provider","show_warning","use_domain","OrganizationCreateView","slugified","slugify","example","val","ProjectRepositoryMultifieldElement","remoteRepositoryValue","useManual","_this$slotDefault","slotRemoteRepository","children","slotRepo","slotDefault","replaceChildren","_toConsumableArray","refRemoteRepository","remoteRepositoryUrl","remoteRepositoryError","refRepo","repoValue","repoError","checked","showManualUrlWarning","classesRemoteRepositoryField","classesRepoField","listenerRemoteRepository","ref","showConnectedServiceWarning","urlConnectedServices","toggleManual","listenerRepo","urlDocsManual","dontSync","clearErrors","previousChoice","ProjectAutomationRuleView","automation_rule","version_predefined_match_pattern","is_version_match_pattern_visible","is_all_versions","is_semver_versions","is_custom","ProjectRedirectView","redirect","redirect_type","from_url","to_url","is_example_disabled","is_from_url_visible","is_to_url_visible","redirect_from_prefix","lang_part","version_part","redirect_from","redirect_to_prefix","redirect_to","ProjectTemporaryAccessView","share","access_type","show_password_field","allow_all","show_versions_list","ProjectSearchAnalyticsView","_this6","ProjectTrafficAnalyticsView","_ProjectSearchAnalyti","trigger_task","defer","Deferred","csrfmiddlewaretoken","token","ajax","tries","poll_task_loop","task","fail","error_msg","statusText","detail","poll_task","RemoteRepository","remote_repo","is_private","is_active","active","has_admin","is_locked","has_project","projects","ProjectCreateView","_ResponsiveView","search_config","search_popup_config","search_modal_config","is_syncing","is_synced","allow_private_repos","init_search","api_sync_remote_repositories","csrf_token","tasks","always","remoterepository_list","attemptsRemaining","onHidden","show_modal","autoShow","centered","templates","knockout","node_temp","remote_repos","repo","noResultsHeader","prompt","fullTextSearch","onSelect","onResults","fromCache","count","ProjectListItemView","_APIListItemView","project","url_docs","is_admin","ProjectVersionCreateView","api_url","errors","maxResults","dashboard","edit","searchOnFocus","versions","container","verbose_name","identifier","render","htmlResults","VersionListItemView","_APIListItemView2","url_pdf","url_epub","url_html","is_built","built","ev","ProjectAnnouncementView","cache_key","prefix_key","storage_key","closed","localStorage","getItem","setItem","MigrateGitHubAppView","openedWindows","trackClosedWindows","setInterval","originalLength","filter","win","reload","newWindow","open","Application","registry","load_config","configure_plugins","attach_view","add_jquery_plugins","_this$config","_this$config2","_this$config3","_this$config$sentry","site_config_src","webpack_public_path","__webpack_public_path__","sentry","dsn","Sentry","environment","integrations","fn","site","tabs","tabmenu","plausible","attach","accordion","placeholder","clipboard","analytics_enabled","production_domain","ready","run"],"sourceRoot":""}