"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 VimeoService extends VideoServiceBase_1.default {
    getDefaultOptions() {
        return { width: 500, height: 281 };
    }
    extractVideoID(reference) {
        let match = reference.match(/https?:\/\/(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|)(\d+)(?:$|\/|\?)/);
        return match && typeof match[3] === "string" ? match[3] : reference;
    }
    getVideoUrl(videoID) {
        let escapedVideoID = this.env.md.utils.escapeHtml(videoID);
        return `//player.vimeo.com/video/${escapedVideoID}`;
    }
}
exports.default = VimeoService;
//# sourceMappingURL=VimeoService.js.map