"use strict";
// Copyright (c) Rotorz Limited and portions by original markdown-it-video authors
// Licensed under the MIT license. See LICENSE file in the project root.
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const VideoServiceBase_1 = __importDefault(require("./VideoServiceBase"));
class VineService extends VideoServiceBase_1.default {
    getDefaultOptions() {
        return { width: 600, height: 600, embed: "simple" };
    }
    extractVideoID(reference) {
        let match = reference.match(/^http(?:s?):\/\/(?:www\.)?vine\.co\/v\/([a-zA-Z0-9]{1,13}).*/);
        return match && match[1].length === 11 ? match[1] : reference;
    }
    getVideoUrl(videoID) {
        let escapedVideoID = this.env.md.utils.escapeHtml(videoID);
        let escapedEmbed = this.env.md.utils.escapeHtml(this.options.embed);
        return `//vine.co/v/${escapedVideoID}/embed/${escapedEmbed}`;
    }
}
exports.default = VineService;
module.exports = VineService;
//# sourceMappingURL=VineService.js.map