{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./app/javascript/util/logger.js","webpack:///./app/javascript/mirador-host/extension/annotation-editor.js","webpack:///./app/javascript/mirador-host/extension/dams-endpoint.js","webpack:///./app/javascript/mirador-host/extension/ext-annotationTooltip.js","webpack:///./app/javascript/mirador-host/util.js","webpack:///./app/javascript/mirador-host/extension/main.js","webpack:///./app/javascript/widgets/side-column.js","webpack:///./app/javascript/mirador-controller.js","webpack:///./app/javascript/app.js","webpack:///./app/javascript/packs/main.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","instances","Logger","logLevel","console","log","length","this","DEBUG","INFO","WARNING","ERROR","_logLevel","args","concat","Array","slice","arguments","error","apply","warn","info","getLogger","push","logger","template","Handlebars","compile","selectorTemplate","AnnotationEditor","options","debug","_windowId","windowId","_anno","annotation","_mode","_miradorProxy","window","DAMS","app","miradorProxy","_element","_createElement","_retrieveSongInstances","done","songInstances","_loadSelector","selector","jQuery","prepend","show","motivation","resource","format","chars","metadata","songInstanceId","_getSelectedSongInstanceId","sequence","find","val","parseInt","manifestUri","getWindowProxyById","getManifestUri","url","encodeURIComponent","ajax","type","dataType","contentType","$selector","preSelected","replaceWith","each","index","option","$option","attr","idStr","$","viewerTemplate","_addViewerEvents","DamsEndpoint","join","dfd","annotationsList","_state","state","uri","success","data","textStatus","jqXHR","item","_toMiradorAnnotation","successCallback","resolve","errorThrown","msg","status","errorCallback","request","_toBackendAnnotation","JSON","stringify","newAnnotation","_this","annotationId","action","isAdmin","prop","parent","assign","endpoint","util","annotationTooltipTextTemplate","truncate","html","maxLen","text","replace","Mirador","AnnotationTooltip","addViewerEvents","getViewerContent","annotations","annotationParams","showUpdate","showDelete","annoText","userAuthorize","id","api","viewerParams","on","event","preventDefault","annoId","closest","location","SideColumn","_notifyWitnessSelect","onWitnessSelect","click","$link","MiradorController","_miradorSettings","miradorSettings","_miradorProxyManager","_isAdmin","_createMirador","_witnessLinksPresent","_songInstanceSideColumn","_setupSideColumn","settings","mirador","MiradorProxy","getMiradorProxyManager","addMirador","manifestId","canvasId","addWindow","size","App","_miradorController","document","ready"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,qBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,kBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EA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B,WACE,OAAOjF,KAAK+J,mBAAmB7H,kB,gCCRnCH,OAAOC,KAAO,CACZkD,MAAO,IAGT,SAACR,GACChC,OAAOsH,UAAUC,OAAM,WACrBvF,EAAEzC,IAAM,IAAI6H,EAAI,CACd5E,MAAOnD,OAAOC,KAAKkD,WAHzB,CAMGnD,OAAOC","file":"js/main-29330a96ccee62f18a1c.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/packs/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 11);\n","let instances = [];\n\nclass Logger {\n constructor(logLevel) {\n console.log('Creating Logger instance #' + (instances.length + 1));\n this.DEBUG = 0;\n this.INFO = 1;\n this.WARNING = 2;\n this.ERROR = 3;\n\n this._logLevel = logLevel || this.DEBUG;\n }\n\n setLogLevel(logLevel) {\n this._logLevel = logLevel;\n }\n\n error() {\n const args = ['ERROR'].concat(Array.prototype.slice.call(arguments));\n console.error.apply(console, args);\n }\n\n warn() {\n const args = ['WARNING'].concat(Array.prototype.slice.call(arguments));\n if (this._logLevel <= this.WARNING) {\n console.warn.apply(console, args);\n }\n }\n\n info() {\n const args = ['INFO'].concat(Array.prototype.slice.call(arguments));\n if (this._logLevel <= this.INFO) {\n console.info.apply(console, args);\n }\n }\n\n debug() {\n const args = ['DEBUG'].concat(Array.prototype.slice.call(arguments));\n if (this._logLevel <= this.DEBUG) {\n console.log.apply(console, args);\n }\n }\n}\n\nconst getLogger = () => {\n if (instances.length === 0) {\n instances.push(new Logger());\n }\n return instances[0];\n};\n\nexport { getLogger, Logger };\n","import { getLogger } from 'util/logger';\n\nconst logger = getLogger();\n\nconst template = Handlebars.compile(`
\n
\n
Song instance
\n
\n \n
\n
\n
\n
\n Sequnece #\n \n
\n
\n
`);\n\nconst selectorTemplate = Handlebars.compile(``);\n\nexport default class AnnotationEditor {\n constructor(options) {\n logger.debug('AnnotationEditor#constructor options:', options);\n this._windowId = options.windowId;\n this._anno = options.annotation;\n this._mode = options.mode; // \"create\" or \"update\"\n this._miradorProxy = window.DAMS.app.miradorProxy;\n this._element = this._createElement(this._anno);\n\n // Async call to update the song instance selector\n this._retrieveSongInstances().done(songInstances => {\n this._loadSelector(songInstances);\n });\n }\n\n // Called by Mirador core\n show(selector) {\n logger.debug('AnnotationEditor#show', selector);\n if (selector) {\n const parent = jQuery(selector);\n parent.prepend(this._element);\n }\n this._element.show();\n }\n\n // Called by Mirador core\n getMode() {\n return this._mode;\n }\n\n // Called by Mirador core\n createAnnotation() {\n const motivation = ['describing'];\n const songInstanceId = this._getSelectedSongInstanceId();\n const sequence = this._element.find('.sequence').val();\n const resource = [{\n '@type': 'dctypes:Text',\n format: 'text/html',\n // XXX As of 2/5/18 annotation text is not being used in the backend,\n // so no need to update chars here.\n // For display on Mirador, SongInstance.label will be used to populate chars.\n chars: '',\n metadata: {\n songInstanceId: songInstanceId,\n sequence: sequence\n }\n }];\n\n var annotation = {\n '@context': 'http://iiif.io/api/presentation/2/context.json',\n '@type': 'Annotation',\n motivation: motivation,\n resource: resource\n };\n\n logger.debug('AnnotationEditor#createAnnotation creating annotation:', annotation);\n return annotation;\n }\n\n // Called by Mirador core\n updateAnnotation(annotation) {\n logger.debug('AnnotationEditor#updateAnnotation annotation:', annotation);\n const songInstanceId = this._getSelectedSongInstanceId();\n const sequence = this._element.find('.sequence').val();\n const text = this._element.find('.text').val();\n const resource = annotation.resource[0];\n const metadata = resource.metadata;\n\n resource.chars = '';\n metadata.songInstanceId = parseInt(songInstanceId, 10);\n metadata.sequence = parseInt(sequence, 10);\n\n return annotation;\n }\n\n isDirty() {\n // TODO: If idDirty is ever true, a confirmation dialog should pop up\n // saying \"Do you want to cancel this annotation?\", but somehow\n // the \"fade\" class of the \".boobox.modal\" element gets toggled incorrectly\n // so the dialog is not shown.\n return false;\n }\n\n _createElement(annotation) {\n logger.debug('AnnotationEditor#_createElement annotation:', annotation);\n let sequence = '';\n\n if (annotation && annotation.resource) {\n const metadata = annotation.resource[0].metadata;\n sequence = metadata.sequence;\n }\n return jQuery(template({ sequence }));\n }\n\n _retrieveSongInstances() {\n const windowProxy = this._miradorProxy.getWindowProxyById(this._windowId);\n const manifestUri = windowProxy.getManifestUri();\n const url = '/song_instances.json?manifest_uri=' + encodeURIComponent(manifestUri);\n\n return jQuery.ajax({\n url: url,\n type: 'GET',\n dataType: 'json',\n contentType: 'application/json; charset=utf-8'\n });\n }\n\n /**\n * @param {[object]} songInstances - List of Song Instance objects with keys \"id\" and \"label\"\n */\n _loadSelector(songInstances) {\n logger.debug('AnnotationEditor#_loadSelector songInstances:', songInstances);\n const $selector = jQuery(selectorTemplate({ songInstances }));\n const annotation = this._anno;\n let preSelected = false;\n this._element.find('.song-instance-selector').replaceWith($selector);\n\n if (annotation && annotation.resource) {\n const metadata = annotation.resource[0].metadata;\n const songInstanceId = metadata.songInstanceId;\n\n $selector.find('option').each((index, option) => {\n const $option = jQuery(option);\n if (parseInt($option.val(), 10) === songInstanceId) {\n preSelected = true;\n $option.attr('selected', 'selected');\n }\n });\n }\n\n if (!preSelected) {\n // If none is selected, select the first option.\n jQuery($selector.find('option')[0]).attr('selected', 'selected');\n }\n }\n\n _getSelectedSongInstanceId() {\n const idStr = this._element.find('.song-instance-selector').val();\n console.log(idStr, typeof idStr);\n return parseInt(idStr, 10);\n }\n}\n","import { getLogger } from 'util/logger';\n\nconst logger = getLogger();\nconst instances = [];\nconst textTemplate = Handlebars.compile([\n '

',\n '{{content}}',\n '

'\n].join(''));\n\nexport default class DamsEndpoint {\n\n constructor(options) {\n this.dfd = options.dfd; // set also by Mirador using set(), so cannot change name\n this.annotationsList = []; // used by Mirador, thus public\n this._state = window.DAMS.state;\n instances.push(this);\n }\n\n search(options) {\n logger.debug('DamsEndpoint#search options:', options);\n const url = '/data/annotations.json/?canvas_id=' + encodeURIComponent(options.uri);\n logger.debug('DamsEndpoint#search url:', url);\n\n jQuery.ajax({\n url: url,\n type: 'GET',\n dataType: 'json',\n contentType: 'application/json; charset=utf-8',\n success: (data, textStatus, jqXHR) => {\n logger.debug('DamsEndpoint#search success data:', data);\n this.annotationsList = [];\n for (let item of data) {\n this.annotationsList.push(this._toMiradorAnnotation(item));\n }\n logger.debug('DamsEndpoint#search success annotations:', this.annotationsList);\n if (typeof successCallback === 'function') {\n successCallback(this.annotationsList);\n } else {\n this.dfd.resolve(true);\n }\n },\n error: function (jqXHR, textStatus, errorThrown) {\n const msg = 'DamsEndpoint#search error status code: ' +\n jqXHR.status + ', textStatus: ' + textStatus +\n ', errorThrown: ' + errorThrown + ', URL: ' + url;\n\n logger.error(msg);\n if (typeof errorCallback === 'function') {\n errorCallback();\n }\n }\n });\n }\n\n create(annotation, successCallback, errorCallback) {\n logger.debug('DamsEndpoint#create annotation:', annotation);\n const url = '/data/annotations'\n const request = {\n annotation: this._toBackendAnnotation(annotation)\n };\n\n jQuery.ajax({\n url: url,\n type: 'POST',\n dataType: 'json',\n data: JSON.stringify(request),\n contentType: 'application/json; charset=utf-8',\n success: data => {\n logger.debug('DamsEndpoint#create success data:', data);\n const newAnnotation = this._toMiradorAnnotation(data);\n if (typeof successCallback === 'function') {\n successCallback(newAnnotation);\n }\n },\n error: function (jqXHR, textStatus, errorThrown) {\n logger.error('DamsEndpoint#create failed textStatus:', textStatus, 'jqXHR.status:', jqXHR.status, 'errorThrown:', errorThrown, 'annotation:', annotation);\n if (typeof errorCallback === 'function') {\n errorCallback();\n }\n }\n });\n }\n\n update(annotation, successCallback, errorCallback) {\n logger.debug('DamsEndpoint#create annotation:', annotation);\n const _this = this;\n const url = '/data/annotations/update'\n const request = {\n songInstanceId: annotation.songInstanceId,\n sequence: annotation.sequence,\n annotation: this._toBackendAnnotation(annotation)\n };\n\n jQuery.ajax({\n url: url,\n type: 'PATCH',\n dataType: 'json',\n data: JSON.stringify(request),\n contentType: 'application/json; charset=utf-8',\n success: function (data) {\n logger.debug('DamsEndpoint#create success data:', data);\n const newAnnotation = _this._toMiradorAnnotation(data);\n if (typeof successCallback === 'function') {\n successCallback(newAnnotation);\n }\n },\n error: function (jqXHR, textStatus, errorThrown) {\n logger.error('DamsEndpoint#create failed textStatus:', textStatus, 'jqXHR.status:', jqXHR.status, 'errorThrown:', errorThrown, 'annotation:', annotation);\n if (typeof errorCallback === 'function') {\n errorCallback();\n }\n }\n });\n }\n\n deleteAnnotation(annotationId, successCallback, errorCallback) {\n const _this = this;\n const url = '/data/annotations/' + parseInt(annotationId, 10);\n logger.debug('DamsEndpoint#deleteAnnotation, annotationId:', annotationId, 'url:', url);\n\n jQuery.ajax({\n url: url,\n type: 'DELETE',\n dataType: 'json',\n contentType: 'application/json; charset=utf-8',\n success: function (data) {\n logger.debug('DamsEndpoint#deleteAnnotation success data:', data);\n if (typeof successCallback === 'function') {\n successCallback();\n }\n },\n error: function (jqXHR, textStatus, errorThrown) {\n logger.error('DamsEndpoint#deleteAnnotation failed textStatus:', textStatus, 'jqXHR.status:', jqXHR.status, 'errorThrown:', errorThrown, 'annotationId:', annotationId);\n if (typeof errorCallback === 'function') {\n errorCallback();\n }\n }\n });\n }\n\n userAuthorize(action, annotation) {\n logger.debug('DamsEndpoint#userAuthorize');\n\n if (action === 'create' || action === 'update' || action === 'delete') {\n return this._state.isAdmin;\n }\n return true;\n }\n\n set(prop, value, options) {\n logger.debug('DamsEndpoint#set prop:', prop, ', value:', value, ', options:', options);\n if (options) {\n this[options.parent][prop] = value;\n } else {\n this[prop] = value;\n }\n }\n\n _toMiradorAnnotation(data) {\n return Object.assign(data, {\n endpoint: this\n });\n }\n\n _toBackendAnnotation(annotation) {\n const data = Object.assign({}, annotation);\n delete data.endpoint;\n return data;\n }\n}\n","import { getLogger } from 'util/logger';\nimport util from 'mirador-host/util';\n\n(function ($) {\n\n const viewerTemplate = $.Handlebars.compile(`\n
\n {{#each annotations}}\n
\n
\n {{#if showUpdate}}{{t \"edit\"}}{{/if}}\n {{#if showDelete}}{{t \"delete\"}}{{/if}}\n
\n
\n

{{{annoText}}}

\n
\n
\n {{/each}}\n
`)\n\n const _addViewerEvents = $.AnnotationTooltip.prototype.addViewerEvents;\n\n $.AnnotationTooltip.prototype.getViewerContent = function (annotations) {\n const annotationParams = [];\n let showUpdate = false;\n let showDelete = false;\n\n for (let annotation of annotations) {\n const annoText = util.truncate(annotation.resource[0].chars, 25);\n\n if (annotation.endpoint !== 'manifest') {\n showUpdate = annotation.endpoint.userAuthorize('update', annotation);\n showDelete = annotation.endpoint.userAuthorize('delete', annotation);\n }\n\n annotationParams.push({\n id : annotation['@id'],\n annoText: annoText,\n showUpdate: showUpdate,\n showDelete: showDelete\n });\n }\n\n const template = viewerTemplate({\n annotations: annotationParams,\n windowId: this.windowId\n });\n return template;\n };\n\n $.AnnotationTooltip.prototype.addViewerEvents = function (api, viewerParams) {\n _addViewerEvents.call(this, api, viewerParams);\n const _this = this;\n const selector = '#annotation-viewer-' + this.windowId;\n const $tooltip = jQuery(selector);\n\n $tooltip.find('.text-viewer p').on('click', function (event) {\n event.preventDefault();\n const $elem = jQuery(this);\n const annoId = $elem.closest('.annotation-display').data('anno-id');\n\n window.location = `/annotations/${annoId}`\n });\n };\n\n})(Mirador);","const util = {\n annotationTooltipTextTemplate: Handlebars.compile(\n '

{{content}}

'),\n\n truncate: function (html, maxLen) {\n var text = html.replace(/<(?:.|\\n)*?>/gm, ''); // remove tags\n text = text.replace(/&.*?;/gm, ''); // remove HTML escapes\n\n if (text.length > maxLen) {\n return text.slice(0, maxLen-3) + '...';\n } else {\n return text;\n }\n }\n};\n\nexport default util;\n","import AnnotationEditor from './annotation-editor';\nimport DamsEndpoint from './dams-endpoint';\nimport './ext-annotationTooltip';\n\nMirador.AnnotationEditor = AnnotationEditor;\nMirador.DamsEndpoint = DamsEndpoint;\n","/**\n * Code for the column on the right side of Mirador in a \"Song Instance\" view.\n */\nexport default class SideColumn {\n constructor(options) {\n const _this = this;\n this._notifyWitnessSelect = options.onWitnessSelect;\n\n const links = jQuery('a.dams-song-instance-link');\n\n links.click(function (event) {\n event.preventDefault();\n const $link = jQuery(this);\n _this._notifyWitnessSelect($link.data('manifest-id'), $link.data('canvas-id'));\n });\n }\n}\n","window.DAMS = {};\n\nimport 'mirador-host/extension/main';\nimport SideColumn from 'widgets/side-column';\n\n/**\n * Deals with all the events related to the Mirador instance.\n */\nexport default class MiradorController {\n constructor(options) {\n this._state = options.state;\n this._miradorSettings = this._state.miradorSettings;\n this._miradorProxyManager =\n this._isAdmin = this._state.isAdmin;\n\n if (this._miradorSettings) {\n this._miradorProxy = this._createMirador(this._miradorSettings);\n if (this._witnessLinksPresent()) {\n this._songInstanceSideColumn = this._setupSideColumn();\n }\n }\n }\n\n get miradorProxy() {\n console.log('GET ', this._miradorProxy);\n return this._miradorProxy;\n }\n\n _createMirador(settings) {\n const mirador = Mirador(settings);\n const miradorProxy = window.MiradorProxy.getMiradorProxyManager().addMirador(1, mirador);\n return miradorProxy;\n }\n\n _setupSideColumn() {\n const col = new SideColumn({ onWitnessSelect: (manifestId, canvasId) => {\n this._miradorProxy.addWindow({ manifestId, canvasId });\n }});\n }\n\n _witnessLinksPresent() {\n return jQuery('a.dams-song-instance-link').size() > 0;\n }\n}\n","import MiradorController from './mirador-controller';\nexport default class App {\n constructor(options) {\n this._state = options.state;\n this._miradorController = new MiradorController({\n state: this._state\n });\n }\n\n get miradorProxy() {\n return this._miradorController.miradorProxy;\n }\n}","import App from 'app';\n\nwindow.DAMS = {\n state: {}\n};\n\n($ => {\n jQuery(document).ready(() => {\n $.app = new App({\n state: window.DAMS.state\n });\n });\n})(window.DAMS);\n"],"sourceRoot":""}