{"version":3,"sources":["jsdelivr-header.js","/npm/place-plugin@0.0.1/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACCA,aAEA,IAAI,WAAa,QAAQ,eAMzB,SAAS,WAAW,GAChB,MAAoB,iBAAN,GACS,mBAAZ,EAAG,KAClB,CAWA,OAAO,QAAU,SAAgC,GAM7C,IAAI,EAAO,CAAC,EAQZ,KAAK,MAAQ,SAAe,EAAM,GAC9B,IAAI,EAAK,GAGL,MAAM,IAAI,MAAM,EAAO,mCAAqC,GAF5D,EAAK,GAAM,MAAM,EAIzB,EAQA,KAAK,IAAM,SAAa,EAAM,GAC1B,QAAmB,iBAAR,IAAoB,WAAW,MACtC,EAAK,GAAQ,GACN,EAIf,EAUA,KAAK,OAAS,SAAgB,GAC1B,WAAW,GAAK,SAAU,EAAI,GAC1B,KAAK,IAAI,EAAM,EACnB,GAAG,KACP,EAOA,KAAK,IAAM,SAAa,GACpB,OAAO,EAAK,EAChB,EAEI,GACA,KAAK,OAAO,EAGpB","file":"/npm/place-plugin@0.0.1/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/place-plugin@0.0.1/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/**\n* @license place-plugin https://github.com/flams/place-plugin\n*\n* The MIT License (MIT)\n*\n* Copyright (c) 2014 Olivier Scherrer <pode.fr@gmail.com>\n*/\n\"use strict\";\n\nvar simpleLoop = require(\"simple-loop\");\n\n/**\n* @class\n* Place plugin places SeamViews in the DOM.\n*/\nfunction isSeamView(ui) {\n    return typeof ui == \"object\" &&\n        typeof ui.place == \"function\";\n}\n\n/**\n * Intilialize a Place.plugin with a list of SeamViews\n * @param {Object} $uis a list of SeamViews such as:\n *   {\n *      \"header\": new SeamView(),\n *      \"list\": new SeamView()\n *   }\n * @Constructor\n */\nmodule.exports = function PlacePluginConstructor($uis) {\n\n    /**\n     * The list of uis currently set in this place plugin\n     * @private\n     */\n    var _uis = {};\n\n    /**\n     * Attach a SeamView to this DOM element\n     * @param {HTML|SVGElement} node the dom node where to attach the SeamView\n     * @param {String} the name of the SeamView to attach\n     * @throws {NoSuchSeamView} an error if there's no SeamView for the given name\n     */\n    this.place = function place(node, name) {\n        if (_uis[name]) {\n            _uis[name].place(node);\n        } else {\n            throw new Error(name + \" is not a SeamView UI in place: \" + name);\n        }\n    };\n\n    /**\n     * Add an SeamView that can be attached to a dom element\n     * @param {String} the name of the SeamView to add to the list\n     * @param {SeamView} ui the SeamView to add the list\n     * @returns {Boolean} true if the SeamView was added\n     */\n    this.set = function set(name, ui) {\n        if (typeof name == \"string\" && isSeamView(ui)) {\n            _uis[name] = ui;\n            return true;\n        } else {\n            return false;\n        }\n    };\n\n    /**\n     * Add multiple dom elements at once\n     * @param {Object} $uis a list of SeamViews such as:\n     *   {\n     *      \"header\": new SeamView(),\n     *      \"list\": new SeamView()\n     *   }\n     */\n    this.setAll = function setAll(uis) {\n        simpleLoop(uis, function (ui, name) {\n            this.set(name, ui);\n        }, this);\n    };\n\n    /**\n     * Returns a SeamView from the list given its name\n     * @param {String} the name of the SeamView to get\n     * @returns {SeamView} SeamView for the given name\n     */\n    this.get = function get(name) {\n        return _uis[name];\n    };\n\n    if ($uis) {\n        this.setAll($uis);\n    }\n\n};\n"]}