var revico= (revico || {});
(function(revico){
var $ = null;
var _revico;
(function (_revico) {
var config;
(function (config) {
var common;
(function (common) {
common.frontUrl = "https://show.revico.jp";
common.apiUrl = "https://show.revico.jp";
common.scriptUrls = ["https://show.revico.jp/lib/jquery/dist/jquery.min.js"];
common.cssUrls = ["https://show.revico.jp/css/default.css"];
common.cssUrlDotSlider = "https://show.revico.jp/css/dot_slider.css";
common.cssUrlModal = "https://show.revico.jp/css/modal.css";
common.apiUrlLayout = "https://show.revico.jp/api/rating/layout.json";
common.apiUrlCookie = "https://show.revico.jp/api/visitorcookie/new_cookie.json";
common.apiUrlCookieReflect = "https://show.revico.jp/api/visitorcookie/reflect";
common.apiUrlConversionLogSaveAccess = "https://show.revico.jp/apigw/conversion_log/save_access";
common.apiUrlConversionLogSaveStaffReviewClick = "https://show.revico.jp/apigw/conversion_log/save_staffreview_click";
common.apiUrlPvsend = "https://show.revico.jp/api/rating/area_view";
common.apiUrlRichShippet = "https://show.revico.jp/api/rating/rich_snippet.json";
common.apiUrlAddHelpful = "https://show.revico.jp/api/rating/add_helpful";
common.apiUrlAddLike = "https://show.revico.jp/api/rating/add_like";
common.apiUrlApiToken = "https://show.revico.jp/apigw/apitoken";
common.apiUrlPurchaseComplete = "https://show.revico.jp/api/purchase/complete";
common.apiUrlConversionLogSaveConversion = "https://show.revico.jp/apigw/conversion_log/save_conversion";
common.apiUrlProductMasterRegist = "https://show.revico.jp/api/productmaster/regist";
common.apiUrlMailAddressSave = "https://mail.revico.jp/api/mail/mailaddresssave";
common.apiUrlSendRequestReviewMail = "https://show.revico.jp/api/purchase/sendmail";
common.apiUrlClickTracking = "https://show.revico.jp/api/reviewclick/add";
common.apiUrlLineLinkRegist = "https://show.revico.jp/api/linelink/regist";
common.frontUrlPutRevicoCookie = "https://show.revico.jp/putrevicocookie";
common.apiDefaultTimeout = 60 * 1000;
common.visitorCookieName = "revico-visitor-id";
common.visitorCookieExpiredays = 365 * 10;
common.visitorCookieDefaultId = "00000000-0000-0000-0000-000000000000";
common.commentAnchor = "#revico-comment";
common.commentAnchorParamStar = "revico-star-rating";
common.gaSendPrefix = "revico_";
common.productMasterCreateJsonId = "#revico-productmaster-data";
common.revicoLogoClickAreaWidth = 150;
common.revicoLogoClickUrl = 'https://www.revico.net/?from=revico_logo';
common.revicoPutCookiePrefix = "revico-putrevicocookie:";
common.reflectHistoryName = "revico_reflect_hist";
common.noImagePath = "https://show.revico.jp/img/no_image.png";
common.apiTokenName = "__RevicoApiRequestVerificationToken";
})(common = config.common || (config.common = {}));
var click;
(function (click) {
click.image = "image";
click.movie = "movie";
click.product = "product";
click.more = "more";
click.page = "page";
click.search = "search";
click.best_helpful = "best_helpful";
click.worst_helpful = "worst_helpful";
click.helpful = "helpful";
click.sort_date = "sort_date";
click.sort_helpful = "sort_helpful";
click.sort_like = "sort_like";
click.sort_rate = "sort_rate";
click.write_review = "write_review";
click.comment_more = "comment_more";
click.twitter = "twitter";
click.facebook = "facebook";
click.line = "line";
click.star_link = "star_link";
click.graph_n_star = "graph_${star}_star";
})(click = config.click || (config.click = {}));
var star;
(function (star) {
star.cssUrls = ["https://show.revico.jp/css/star.css"];
star.apiUrlStar = "https://show.revico.jp/api/rating/star.json";
star.layoutTypeStarSimple = 1;
})(star = config.star || (config.star = {}));
var picture;
(function (picture) {
picture.cssUrls = ["https://show.revico.jp/css/picture.css"];
picture.apiUrlPicture = "https://show.revico.jp/api/rating/picture.json";
picture.apiUrlReview = "https://show.revico.jp/api/rating/review.json";
})(picture = config.picture || (config.picture = {}));
var comment;
(function (comment) {
comment.cssUrls = ["https://show.revico.jp/css/comment.css"];
comment.apiUrlComment = "https://show.revico.jp/api/rating/comment.json";
comment.apiUrlFilter = "https://show.revico.jp/api/rating/comment_filter.json";
comment.apiUrlTag = "https://show.revico.jp/api/reviewword/tag.json";
comment.apiUrlProduct = "https://show.revico.jp/api/productmaster/product_detail.json";
comment.reviewUrl = "https://show.revico.jp/Review/Index";
comment.commentLimit = 5;
comment.commentLimitSp = 5;
comment.viewProductCommentReview = 'comment';
comment.viewAllCommentReview = 'commentAll';
})(comment = config.comment || (config.comment = {}));
var tagmanager;
(function (tagmanager) {
tagmanager.apiUrlTagmanager = "https://show.revico.jp/apigw/tagmanager/tagitems";
})(tagmanager = config.tagmanager || (config.tagmanager = {}));
var revisitmodal;
(function (revisitmodal) {
revisitmodal.cssUrls = ["https://show.revico.jp/css/revisit-modal.css", "https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"];
revisitmodal.apiUrlRevisitModal = "https://show.revico.jp/api/revisit/revisit_modal.json?";
revisitmodal.reviewUrl = "https://show.revico.jp/Review/Index";
revisitmodal.modalIconClicked = "revico-revisit-modal--icon-clicked";
revisitmodal.modalBodyOpen = "revico-revisit-modal--body-open";
revisitmodal.modalIconDisplayableDateName = "revico-icon-displayable-date";
revisitmodal.modalIconDefaultHiddenDays = 1;
})(revisitmodal = config.revisitmodal || (config.revisitmodal = {}));
var revisitbanner;
(function (revisitbanner) {
revisitbanner.cssUrls = ["https://show.revico.jp/css/revisit_banner.css", "https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"];
revisitbanner.apiUrlRevisitBanner = "https://show.revico.jp/api/revisit/revisit_banner.json?";
revisitbanner.reviewUrl = "https://show.revico.jp/Review/Index";
})(revisitbanner = config.revisitbanner || (config.revisitbanner = {}));
var barcodereader;
(function (barcodereader) {
barcodereader.cssUrls = ["https://show.revico.jp/css/barcode_reader.css", "https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"];
barcodereader.scriptUrls = ["https://webrtc.github.io/adapter/adapter-latest.js", "https://cdnjs.cloudflare.com/ajax/libs/quagga/0.12.1/quagga.min.js"];
barcodereader.apiUrlProduct = "https://show.revico.jp/api/productmaster/product_detail_jan.json";
barcodereader.apiUrlTenantOption = "https://show.revico.jp/api/tenantoption/tenantoption.json";
barcodereader.apiUrlBarcodeReaderHelp = "https://revico-develop-public.s3-ap-northeast-1.amazonaws.com/barcode_reader_help/barcode-reader_help.html";
barcodereader.reviewUrl = "https://show.revico.jp/Review/Index";
barcodereader.barcodeReaderOption = 5;
})(barcodereader = config.barcodereader || (config.barcodereader = {}));
var message;
(function (message) {
message.noReview = "レビューはありません。";
})(message = config.message || (config.message = {}));
(function (message) {
message.noPicture = "投稿画像はありません。";
})(message = config.message || (config.message = {}));
var multicomment;
(function (multicomment) {
multicomment.cssUrls = ["https://show.revico.jp/css/multi_comment.css", "https://show.revico.jp/css/multi_comment_sp.css"];
multicomment.filterTypeNameAccordion = "accordion";
})(multicomment = config.multicomment || (config.multicomment = {}));
var productautoregister;
(function (productautoregister) {
productautoregister.apiUrlProductAutoRegister = "https://show.revico.jp/api/productmaster/product_auto_register.json";
})(productautoregister = config.productautoregister || (config.productautoregister = {}));
var reviewranking;
(function (reviewranking) {
reviewranking.cssUrls = ["https://show.revico.jp/css/ranking.css", "https://show.revico.jp/css/ranking_sp.css"];
reviewranking.apiUrlReviewRanking = "https://show.revico.jp/api/reviewranking/ranking.json";
})(reviewranking = config.reviewranking || (config.reviewranking = {}));
var reviewpost;
(function (reviewpost) {
reviewpost.cssUrls = ["https://show.revico.jp/css/review_post.css", "https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"];
reviewpost.apiUrlReviewPost = "https://show.revico.jp/api/reviewposttag";
reviewpost.apiUrlRequiredEvaluationItems = "https://show.revico.jp/api/reviewposttag/required_evaluation_items.json";
reviewpost.apiUrlRequiredReviewerAttributes = "https://show.revico.jp/api/reviewposttag/required_reviewer_attributes.json";
var postAllowType;
(function (postAllowType) {
postAllowType.onlyECMember = 'OnlyECMember';
})(postAllowType = reviewpost.postAllowType || (reviewpost.postAllowType = {}));
var reviewformstatus;
(function (reviewformstatus) {
reviewformstatus.reviewable = "Reviewable";
reviewformstatus.notTarget = "NotTarget";
reviewformstatus.reReview = "ReReview";
reviewformstatus.complete = "Complete";
reviewformstatus.requiredLogin = "RequiredLogin";
reviewformstatus.internalError = "InternalError";
reviewformstatus.serverError = "ServerError";
})(reviewformstatus = reviewpost.reviewformstatus || (reviewpost.reviewformstatus = {}));
var reviewpoststatus;
(function (reviewpoststatus) {
reviewpoststatus.beforePost = "BeforePost";
reviewpoststatus.posting = "Posting";
reviewpoststatus.uploadingVideo = "UploadingVideo";
reviewpoststatus.validationError = "ValidationError";
})(reviewpoststatus = reviewpost.reviewpoststatus || (reviewpost.reviewpoststatus = {}));
})(reviewpost = config.reviewpost || (config.reviewpost = {}));
var movieconvert;
(function (movieconvert) {
movieconvert.apiUrlPresignedUrl = "https://show.revico.jp/apigw/movie_convert/presigned_url";
movieconvert.apiUrlExecute = "https://show.revico.jp/apigw/movie_convert/execute";
movieconvert.apiUrlResult = "https://show.revico.jp/apigw/movie_convert/result";
})(movieconvert = config.movieconvert || (config.movieconvert = {}));
})(config = _revico.config || (_revico.config = {}));
})(_revico || (_revico = {}));
var _revico;
(function (_revico) {
var util;
(function (util) {
var loader;
(function (loader) {
function loadCss(urls, callback) {
if (urls.length === 0) {
callback();
return;
}
var head = document.getElementsByTagName('head')[0];
var url = urls.shift();
if (head.querySelectorAll('link[type="text/css"][rel="stylesheet"][href="' + url + '"]').length === 0) {
var link = document.createElement('link');
link.type = 'text/css';
link.rel = 'stylesheet';
link.href = url;
link.onload = function () {
loadCss(urls, callback);
};
head.appendChild(link);
}
else {
loadCss(urls, callback);
}
}
loader.loadCss = loadCss;
function loadScript(urls, callback) {
if (urls.length === 0) {
callback();
return;
}
var head = document.getElementsByTagName('head')[0];
var script = document.createElement("script");
script.setAttribute("type", "text/javascript");
script.setAttribute("src", urls.shift());
script.onload = function () {
loadScript(urls, callback);
};
head.appendChild(script);
}
loader.loadScript = loadScript;
function load(callback, appendCss, appendScript) {
var _this = this;
var css = _revico.config.common.cssUrls.concat(appendCss || []);
var js = _revico.config.common.scriptUrls.concat(appendScript || []);
loadCss(css, function () {
_this.loadScript(js, callback);
});
}
loader.load = load;
})(loader = util.loader || (util.loader = {}));
var api;
(function (api) {
function get(url, param, timeout) {
var defer = $.Deferred();
$.ajax({
url: url,
type: 'GET',
data: param,
timeout: timeout || _revico.config.common.apiDefaultTimeout,
traditional: true,
xhrFields: {
withCredentials: true
}
}).done(function (data) {
defer.resolve(data);
}).fail(function (error) {
defer.reject(error);
});
return defer.promise();
}
api.get = get;
function post(url, param, timeout, noCredentials) {
var defer = $.Deferred();
$.ajax({
url: url,
type: 'POST',
data: param,
timeout: timeout || _revico.config.common.apiDefaultTimeout,
xhrFields: {
withCredentials: !noCredentials
}
}).done(function (data) {
defer.resolve(data);
}).fail(function (error) {
defer.reject(error);
});
return defer.promise();
}
api.post = post;
function reviewpostTagPost(param, timeout, noCredentials) {
var defer = $.Deferred();
$.ajax({
url: _revico.config.reviewpost.apiUrlReviewPost,
type: 'POST',
data: param,
timeout: timeout || _revico.config.common.apiDefaultTimeout,
processData: false,
contentType: false,
xhrFields: {
withCredentials: !noCredentials
},
}).done(function (data) {
defer.resolve(data);
}).fail(function (error) {
defer.reject(error);
});
return defer.promise();
}
api.reviewpostTagPost = reviewpostTagPost;
function getApiToken(tenantId) {
var defer = $.Deferred();
$.ajax({
url: _revico.config.common.apiUrlApiToken,
type: 'GET',
headers: { tenantId: tenantId },
timeout: _revico.config.common.apiDefaultTimeout
}).done(function (data) {
defer.resolve(data);
}).fail(function (error) {
defer.reject(error);
});
return defer.promise();
}
api.getApiToken = getApiToken;
function getMovieConvertPresignedUrl(tenantId, token, timeout) {
var _a;
var defer = $.Deferred();
$.ajax({
url: _revico.config.movieconvert.apiUrlPresignedUrl,
type: 'POST',
headers: (_a = {
tenantId: tenantId
},
_a[_revico.config.common.apiTokenName] = token,
_a),
timeout: timeout || _revico.config.common.apiDefaultTimeout,
}).done(function (data) {
defer.resolve(data);
}).fail(function (error) {
defer.reject(error);
});
return defer.promise();
}
api.getMovieConvertPresignedUrl = getMovieConvertPresignedUrl;
function uploadToS3(presignedUrl, file, contentType, timeout) {
var defer = $.Deferred();
$.ajax({
url: presignedUrl,
type: 'PUT',
data: file,
timeout: timeout || _revico.config.common.apiDefaultTimeout,
processData: false,
contentType: contentType,
}).done(function (data) {
defer.resolve(data);
}).fail(function (error) {
defer.reject(error);
});
return defer.promise();
}
api.uploadToS3 = uploadToS3;
function executeMovieConvert(tenantId, token, param, timeout) {
var _a;
var defer = $.Deferred();
$.ajax({
url: _revico.config.movieconvert.apiUrlExecute,
type: 'POST',
data: JSON.stringify(param),
headers: (_a = {
tenantId: tenantId
},
_a[_revico.config.common.apiTokenName] = token,
_a),
timeout: timeout || _revico.config.common.apiDefaultTimeout,
contentType: 'application/json',
}).done(function (data) {
defer.resolve(data);
}).fail(function (error) {
defer.reject(error);
});
return defer.promise();
}
api.executeMovieConvert = executeMovieConvert;
function getMovieConvertResult(tenantId, jobId, timeout) {
var defer = $.Deferred();
var baseUrl = _revico.config.movieconvert.apiUrlResult;
var searchParams = new URLSearchParams();
searchParams.append('jobId', jobId);
var url = "".concat(baseUrl, "?").concat(searchParams.toString());
$.ajax({
url: url,
type: 'GET',
headers: {
tenantId: tenantId,
},
timeout: timeout || _revico.config.common.apiDefaultTimeout,
}).done(function (data) {
defer.resolve(data);
}).fail(function (error) {
defer.reject(error);
});
return defer.promise();
}
api.getMovieConvertResult = getMovieConvertResult;
})(api = util.api || (util.api = {}));
var string;
(function (string) {
function htmlEscape(str) {
if (!str)
return '';
return str.replace(/[<>&"'`]/g, function (match) {
var escape = {
'<': '<',
'>': '>',
'&': '&',
'"': '"',
"'": ''',
'`': '`',
'\r': '
',
'\n': '
',
'\r\n': '
'
};
return escape[match];
});
}
string.htmlEscape = htmlEscape;
function replaceNewLine(str) {
if (!str)
return;
return str.replace(/\r\n|\r|\n/g, function (match) {
var escape = {
'\r\n': '
',
'\r': '
',
'\n': '
'
};
return escape[match];
});
}
string.replaceNewLine = replaceNewLine;
function removeNewLine(str) {
if (!str)
return;
return str.replace(/\r\n|\r|\n/g, function (match) {
var escape = {
'\r\n': '',
'\r': '',
'\n': ''
};
return escape[match];
});
}
string.removeNewLine = removeNewLine;
})(string = util.string || (util.string = {}));
var object;
(function (object) {
function values(obj) {
return Object.keys(obj).map(function (e) {
return obj[e];
});
}
object.values = values;
})(object = util.object || (util.object = {}));
var loading;
(function (loading) {
function showLoading($container) {
var $loader = $('' +
'