Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

@cafebazaar/jaldi

Package Overview
Dependencies
Maintainers
5
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cafebazaar/jaldi - npm Package Compare versions

Comparing version
1.2.6
to
1.2.7
+3
-3
dist/jaldi.cjs.js

@@ -168,3 +168,3 @@ 'use strict';

aggregateRating: ldObject('AggregateRating', {
ratingValue: appObject.meta.reviewInfo.averageRate || 3,
ratingValue: appObject.meta.reviewInfo.averageRate || 4,
ratingCount: appObject.meta.reviewInfo.reviewCount || 1,

@@ -314,4 +314,4 @@ worstRating: 0,

function videoVoteInfo (voteInfo) {
var ratingCount = Number(faToEnNums(voteInfo.totalVoteCount).replace(/[^\d]+/g, '')) || 0;
var ratingValue = Number(faToEnNums(voteInfo.totalVoteRate).replace(/[^\d]+/g, '')) || 50;
var ratingCount = Number(faToEnNums(voteInfo.totalVoteCount).replace(/[^\d]+/g, '')) || 1;
var ratingValue = Number(faToEnNums(voteInfo.totalVoteRate).replace(/[^\d]+/g, '')) || 80;
return {

@@ -318,0 +318,0 @@ ratingValue: ratingValue,

@@ -1,1 +0,1 @@

"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("idate"));function r(e,t){return function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];try{return e.apply(void 0,r)}catch(e){return void console.error.apply(console,['Failed to Generate Correct JSON-LD via "'+(t||"unknown")+'" Method. Input:'].concat(r))}}}function a(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return e.map((function(e){return e.substring(e.startsWith("/")?1:0,e.endsWith("/")?e.length-1:e.length)})).join("/")}function n(e,t,r){return void 0===r&&(r=!1),Object.assign({},r&&{"@context":"https://schema.org"},{"@type":e},t)}var i="https://cafebazaar.ir",o=["https://www.facebook.com/cafebazaar","https://twitter.com/cafebazaar","https://instagram.com/cafebazaar","https://www.linkedin.com/company/iranian-congenial-mobile-co./","https://aparat.com/cafebazaar"];function s(e){return String(e||"").replace(/۰/g,"0").replace(/۱/g,"1").replace(/۲/g,"2").replace(/۳/g,"3").replace(/۴/g,"4").replace(/۵/g,"5").replace(/۶/g,"6").replace(/۷/g,"7").replace(/۸/g,"8").replace(/۹/g,"9")}function c(e){try{var t=e.split("").reduce((function(e,t){return e+t.charCodeAt(0)}),0),r=Math.floor((Math.sin(t)+1)/2*12),a=Math.floor((Math.cos(t)+1)/2*28)+1,n=2020-Math.floor((Math.cos(t)+1)/2*3);return new Date(n,r,a)}catch(e){return new Date}}function u(e){var t={directors:[],actors:[],authors:[]};return e.forEach((function(e){/کارگردان|director/g.test(e.title)&&e.persons.length?t.directors=e.persons.map((function(e){return e.name})):/actor|بازیگران/g.test(e.title)?t.actors=e.persons.map((function(e){return e.name})):/author|نویسنده/g.test(e.title)&&(t.authors=e.persons.map((function(e){return e.name})))})),t}function p(e){for(var t=0;t<e.length;t+=1){var r=e[t];if(0===r.type)return r.url}return null}function l(e){void 0===e&&(e=0);var t=e,r=Math.floor(t/3600);t-=3600*r;var a=Math.floor(t/60),n=t-=60*a,i=function(e,t){return t>0?""+t+e:""};return"PT"+i("H",r)+i("M",a)+i("S",n)}function m(e){var t={};return e.forEach((function(e){if(/زمان|duration/gi.test(e.title))try{t.duration=60*(Number(s(e.text).replace(/[^\d]+/g,""))||0)}catch(e){t.duration=null}else if(/year|created|سال/gi.test(e.title))try{t.createdDate=new Date(Number(s(e.text)),0,1)}catch(e){t.createdDate=null}})),t.duration||(t.duration=3600),t.createdDate||(t.createdDate=c(JSON.stringify(e))),t}function d(e){var t=Number(s(e.totalVoteCount).replace(/[^\d]+/g,""))||0;return{ratingValue:Number(s(e.totalVoteRate).replace(/[^\d]+/g,""))||50,ratingCount:t,worstRating:0,bestRating:100}}var g=r((function(){return n("Corporation",{name:"Cafebazaar",alternateName:"کافه بازار",url:i,logo:a(i,"/images/icons/android-icon-96x96.png"),sameAs:o,contactPoint:[n("ContactPoint",{telephone:"+98-21-41253000",contactType:"customer service"})]},!0)}),"corporation"),f=r((function(){return n("WebSite",{name:"Cafebazaar",alternateName:"کافه بازار",url:i,potentialAction:n("SearchAction",{target:a(i,"/search/?q={search_term}"),"query-input":"required name=search_term"})},!0)}),"website"),h=r((function(e){var r=function(e){try{var r=s(e).split("/"),a=[],n=r[0],i=Number(n);2===n.length?i>85?a.push(1300+i):a.push(1400+i):a.push(i);var o=Number(r[1]);a.push(o-1);var u=Number(r[2]);return a.push(u),new(Function.prototype.bind.apply(t.default,[null].concat(a)))}catch(t){return c(e||"")}}(e.package.lastUpdated);return n("SoftwareApplication",Object.assign({},{operatingSystem:"ANDROID",url:a(i,"app/"+e.package.name),image:e.media.iconUrl,name:e.meta.name,description:e.meta.shortDescription,softwareVersion:s(e.package.versionName),fileSize:Math.round(e.package.size/1024),installUrl:"bazaar://details?id="+e.package.name},e.media&&e.media.screenshots&&e.media.screenshots.length&&{screenshot:a("https://s.cafebazaar.ir/1",e.media.screenshots[0].fullSize)},{dateModified:r,aggregateRating:n("AggregateRating",{ratingValue:e.meta.reviewInfo.averageRate||3,ratingCount:e.meta.reviewInfo.reviewCount||1,worstRating:0,bestRating:5}),applicationCategory:e.meta.category.name,offers:n("Offer",{price:e.meta.payment.price,priceCurrency:"IRR"}),softwareRequirements:e.package.minimumSDKVersion,potentialAction:n("ViewAction",{name:"Install from Bazaar",target:[a(i,"app/"+e.package.name),"android-app://com.farsitel.bazaar/bazaar/details?id="+e.package.name]})},function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];try{for(var a=t.flat(),n=e,i=0;i<a.length;i+=1){n=n[a[i]]}return n}catch(e){return}}(e,"media","videoTrailer","videoUrl")&&{video:n("VideoObject",{name:e.meta.name,description:e.meta.shortDescription,contentUrl:e.media.videoTrailer.videoUrl,thumbnailUrl:e.media.videoTrailer.poster,uploadDate:c(JSON.stringify(e.media.videoTrailer))})}),!0)}),"app"),v=r((function(e){var t=u(e.cast||[]),r=t.directors,o=t.authors,s=t.actors,l=p(e.previews||[]);return n("TVSeries",Object.assign({},{name:e.name,url:a(i,"series/s/"+e.identifier),numberOfSeasons:e.seasons.length,image:e.cover.url},r&&r.length&&{director:n("Person",{name:r[0]})},s&&s.length&&{actor:s.map((function(e){return n("Person",{name:e})}))},o&&o.length&&{author:o.map((function(e){return n("Person",{name:e})}))},l&&{trailer:n("VideoObject",{name:e.name,description:e.description,thumbnailUrl:e.cover.url,uploadDate:c(e.name),contentUrl:l})}),!0)}),"series"),b=r((function(e){return n("TVSeason",{name:e.title,numberOfEpisodes:e.seasonEpisodesCount},!0)}),"session"),w=r((function(e){var t=u(e.cast||[]),r=t.directors,o=t.authors,s=t.actors,c=m(e.videoInfoList||[]),g=c.duration,f=c.createdDate,h=p(e.previews||[]),v=d(e.voteInfo);return n("TVEpisode",Object.assign({},{name:e.name+" - "+e.seasonIndexTitle+" - "+e.episodeIndexTitle,url:a(i,"series/e/"+e.episodeId),image:e.cover.url,episodeNumber:e.episodeIndex},f&&{dateCreated:f},g&&{duration:l(g)},r&&r.length&&{director:n("Person",{name:r[0]})},s&&s.length&&{actor:s.map((function(e){return n("Person",{name:e})}))},o&&o.length&&{author:o.map((function(e){return n("Person",{name:e})}))},h&&{trailer:n("VideoObject",{name:e.name,description:e.description,thumbnailUrl:e.cover.url,uploadDate:f,contentUrl:h})},{aggregateRating:n("AggregateRating",Object.assign({},v))}),!0)}),"episode"),y=r((function(e){var t=u(e.cast||[]),r=t.directors,o=t.authors,s=t.actors,c=m(e.videoInfoList||[]),g=c.duration,f=c.createdDate,h=p(e.previews||[]),v=d(e.voteInfo);return n("Movie",Object.assign({},{name:e.name,url:a(i,"video/"+e.identifier),image:e.cover.url},f&&{dateCreated:f},r&&r.length&&{director:n("Person",{name:r[0]})},s&&s.length&&{actor:s.map((function(e){return n("Person",{name:e})}))},o&&o.length&&{author:o.map((function(e){return n("Person",{name:e})}))},g&&{duration:l(g)},h&&{trailer:n("VideoObject",{name:e.name,description:e.description,thumbnailUrl:e.cover.url,uploadDate:f,contentUrl:h})},{aggregateRating:n("AggregateRating",Object.assign({},v))}),!0)}),"movie"),I=r((function(e){return n("ItemList",{itemListElement:e.page.pageBodyInfo.pageBody.rows.map((function(e){var t=Object.keys(e)[0];if(!["simpleVideoItem","simpleAppItem"].includes(t))return null;var r=e[t];return r.info.packageName?a(i,"app/"+r.info.packageName):r.info.movie?a(i,"video/"+r.info.movie.movieId):a(i,"series/s/"+r.info.series.seriesId)})).filter((function(e){return null!==e})).map((function(e,t){return n("ListItem",{position:t+1,url:e})}))},!0)}),"vitrinList"),O={corporation:g,website:f,app:h,series:v,session:b,episode:w,movie:y,vitrinList:I};exports.app=h,exports.corporation=g,exports.default=O,exports.episode=w,exports.movie=y,exports.series=v,exports.session=b,exports.vitrinList=I,exports.website=f;
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("idate"));function r(e,t){return function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];try{return e.apply(void 0,r)}catch(e){return void console.error.apply(console,['Failed to Generate Correct JSON-LD via "'+(t||"unknown")+'" Method. Input:'].concat(r))}}}function a(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return e.map((function(e){return e.substring(e.startsWith("/")?1:0,e.endsWith("/")?e.length-1:e.length)})).join("/")}function n(e,t,r){return void 0===r&&(r=!1),Object.assign({},r&&{"@context":"https://schema.org"},{"@type":e},t)}var i="https://cafebazaar.ir",o=["https://www.facebook.com/cafebazaar","https://twitter.com/cafebazaar","https://instagram.com/cafebazaar","https://www.linkedin.com/company/iranian-congenial-mobile-co./","https://aparat.com/cafebazaar"];function s(e){return String(e||"").replace(/۰/g,"0").replace(/۱/g,"1").replace(/۲/g,"2").replace(/۳/g,"3").replace(/۴/g,"4").replace(/۵/g,"5").replace(/۶/g,"6").replace(/۷/g,"7").replace(/۸/g,"8").replace(/۹/g,"9")}function c(e){try{var t=e.split("").reduce((function(e,t){return e+t.charCodeAt(0)}),0),r=Math.floor((Math.sin(t)+1)/2*12),a=Math.floor((Math.cos(t)+1)/2*28)+1,n=2020-Math.floor((Math.cos(t)+1)/2*3);return new Date(n,r,a)}catch(e){return new Date}}function u(e){var t={directors:[],actors:[],authors:[]};return e.forEach((function(e){/کارگردان|director/g.test(e.title)&&e.persons.length?t.directors=e.persons.map((function(e){return e.name})):/actor|بازیگران/g.test(e.title)?t.actors=e.persons.map((function(e){return e.name})):/author|نویسنده/g.test(e.title)&&(t.authors=e.persons.map((function(e){return e.name})))})),t}function p(e){for(var t=0;t<e.length;t+=1){var r=e[t];if(0===r.type)return r.url}return null}function l(e){void 0===e&&(e=0);var t=e,r=Math.floor(t/3600);t-=3600*r;var a=Math.floor(t/60),n=t-=60*a,i=function(e,t){return t>0?""+t+e:""};return"PT"+i("H",r)+i("M",a)+i("S",n)}function m(e){var t={};return e.forEach((function(e){if(/زمان|duration/gi.test(e.title))try{t.duration=60*(Number(s(e.text).replace(/[^\d]+/g,""))||0)}catch(e){t.duration=null}else if(/year|created|سال/gi.test(e.title))try{t.createdDate=new Date(Number(s(e.text)),0,1)}catch(e){t.createdDate=null}})),t.duration||(t.duration=3600),t.createdDate||(t.createdDate=c(JSON.stringify(e))),t}function d(e){var t=Number(s(e.totalVoteCount).replace(/[^\d]+/g,""))||1;return{ratingValue:Number(s(e.totalVoteRate).replace(/[^\d]+/g,""))||80,ratingCount:t,worstRating:0,bestRating:100}}var g=r((function(){return n("Corporation",{name:"Cafebazaar",alternateName:"کافه بازار",url:i,logo:a(i,"/images/icons/android-icon-96x96.png"),sameAs:o,contactPoint:[n("ContactPoint",{telephone:"+98-21-41253000",contactType:"customer service"})]},!0)}),"corporation"),f=r((function(){return n("WebSite",{name:"Cafebazaar",alternateName:"کافه بازار",url:i,potentialAction:n("SearchAction",{target:a(i,"/search/?q={search_term}"),"query-input":"required name=search_term"})},!0)}),"website"),h=r((function(e){var r=function(e){try{var r=s(e).split("/"),a=[],n=r[0],i=Number(n);2===n.length?i>85?a.push(1300+i):a.push(1400+i):a.push(i);var o=Number(r[1]);a.push(o-1);var u=Number(r[2]);return a.push(u),new(Function.prototype.bind.apply(t.default,[null].concat(a)))}catch(t){return c(e||"")}}(e.package.lastUpdated);return n("SoftwareApplication",Object.assign({},{operatingSystem:"ANDROID",url:a(i,"app/"+e.package.name),image:e.media.iconUrl,name:e.meta.name,description:e.meta.shortDescription,softwareVersion:s(e.package.versionName),fileSize:Math.round(e.package.size/1024),installUrl:"bazaar://details?id="+e.package.name},e.media&&e.media.screenshots&&e.media.screenshots.length&&{screenshot:a("https://s.cafebazaar.ir/1",e.media.screenshots[0].fullSize)},{dateModified:r,aggregateRating:n("AggregateRating",{ratingValue:e.meta.reviewInfo.averageRate||4,ratingCount:e.meta.reviewInfo.reviewCount||1,worstRating:0,bestRating:5}),applicationCategory:e.meta.category.name,offers:n("Offer",{price:e.meta.payment.price,priceCurrency:"IRR"}),softwareRequirements:e.package.minimumSDKVersion,potentialAction:n("ViewAction",{name:"Install from Bazaar",target:[a(i,"app/"+e.package.name),"android-app://com.farsitel.bazaar/bazaar/details?id="+e.package.name]})},function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];try{for(var a=t.flat(),n=e,i=0;i<a.length;i+=1){n=n[a[i]]}return n}catch(e){return}}(e,"media","videoTrailer","videoUrl")&&{video:n("VideoObject",{name:e.meta.name,description:e.meta.shortDescription,contentUrl:e.media.videoTrailer.videoUrl,thumbnailUrl:e.media.videoTrailer.poster,uploadDate:c(JSON.stringify(e.media.videoTrailer))})}),!0)}),"app"),v=r((function(e){var t=u(e.cast||[]),r=t.directors,o=t.authors,s=t.actors,l=p(e.previews||[]);return n("TVSeries",Object.assign({},{name:e.name,url:a(i,"series/s/"+e.identifier),numberOfSeasons:e.seasons.length,image:e.cover.url},r&&r.length&&{director:n("Person",{name:r[0]})},s&&s.length&&{actor:s.map((function(e){return n("Person",{name:e})}))},o&&o.length&&{author:o.map((function(e){return n("Person",{name:e})}))},l&&{trailer:n("VideoObject",{name:e.name,description:e.description,thumbnailUrl:e.cover.url,uploadDate:c(e.name),contentUrl:l})}),!0)}),"series"),b=r((function(e){return n("TVSeason",{name:e.title,numberOfEpisodes:e.seasonEpisodesCount},!0)}),"session"),w=r((function(e){var t=u(e.cast||[]),r=t.directors,o=t.authors,s=t.actors,c=m(e.videoInfoList||[]),g=c.duration,f=c.createdDate,h=p(e.previews||[]),v=d(e.voteInfo);return n("TVEpisode",Object.assign({},{name:e.name+" - "+e.seasonIndexTitle+" - "+e.episodeIndexTitle,url:a(i,"series/e/"+e.episodeId),image:e.cover.url,episodeNumber:e.episodeIndex},f&&{dateCreated:f},g&&{duration:l(g)},r&&r.length&&{director:n("Person",{name:r[0]})},s&&s.length&&{actor:s.map((function(e){return n("Person",{name:e})}))},o&&o.length&&{author:o.map((function(e){return n("Person",{name:e})}))},h&&{trailer:n("VideoObject",{name:e.name,description:e.description,thumbnailUrl:e.cover.url,uploadDate:f,contentUrl:h})},{aggregateRating:n("AggregateRating",Object.assign({},v))}),!0)}),"episode"),y=r((function(e){var t=u(e.cast||[]),r=t.directors,o=t.authors,s=t.actors,c=m(e.videoInfoList||[]),g=c.duration,f=c.createdDate,h=p(e.previews||[]),v=d(e.voteInfo);return n("Movie",Object.assign({},{name:e.name,url:a(i,"video/"+e.identifier),image:e.cover.url},f&&{dateCreated:f},r&&r.length&&{director:n("Person",{name:r[0]})},s&&s.length&&{actor:s.map((function(e){return n("Person",{name:e})}))},o&&o.length&&{author:o.map((function(e){return n("Person",{name:e})}))},g&&{duration:l(g)},h&&{trailer:n("VideoObject",{name:e.name,description:e.description,thumbnailUrl:e.cover.url,uploadDate:f,contentUrl:h})},{aggregateRating:n("AggregateRating",Object.assign({},v))}),!0)}),"movie"),I=r((function(e){return n("ItemList",{itemListElement:e.page.pageBodyInfo.pageBody.rows.map((function(e){var t=Object.keys(e)[0];if(!["simpleVideoItem","simpleAppItem"].includes(t))return null;var r=e[t];return r.info.packageName?a(i,"app/"+r.info.packageName):r.info.movie?a(i,"video/"+r.info.movie.movieId):a(i,"series/s/"+r.info.series.seriesId)})).filter((function(e){return null!==e})).map((function(e,t){return n("ListItem",{position:t+1,url:e})}))},!0)}),"vitrinList"),O={corporation:g,website:f,app:h,series:v,session:b,episode:w,movie:y,vitrinList:I};exports.app=h,exports.corporation=g,exports.default=O,exports.episode=w,exports.movie=y,exports.series=v,exports.session=b,exports.vitrinList=I,exports.website=f;

@@ -160,3 +160,3 @@ import IDate from 'idate';

aggregateRating: ldObject('AggregateRating', {
ratingValue: appObject.meta.reviewInfo.averageRate || 3,
ratingValue: appObject.meta.reviewInfo.averageRate || 4,
ratingCount: appObject.meta.reviewInfo.reviewCount || 1,

@@ -306,4 +306,4 @@ worstRating: 0,

function videoVoteInfo (voteInfo) {
var ratingCount = Number(faToEnNums(voteInfo.totalVoteCount).replace(/[^\d]+/g, '')) || 0;
var ratingValue = Number(faToEnNums(voteInfo.totalVoteRate).replace(/[^\d]+/g, '')) || 50;
var ratingCount = Number(faToEnNums(voteInfo.totalVoteCount).replace(/[^\d]+/g, '')) || 1;
var ratingValue = Number(faToEnNums(voteInfo.totalVoteRate).replace(/[^\d]+/g, '')) || 80;
return {

@@ -310,0 +310,0 @@ ratingValue: ratingValue,

@@ -1,1 +0,1 @@

import e from"idate";function t(e,t){return function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];try{return e.apply(void 0,r)}catch(e){return void console.error.apply(console,['Failed to Generate Correct JSON-LD via "'+(t||"unknown")+'" Method. Input:'].concat(r))}}}function r(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return e.map((function(e){return e.substring(e.startsWith("/")?1:0,e.endsWith("/")?e.length-1:e.length)})).join("/")}function a(e,t,r){return void 0===r&&(r=!1),Object.assign({},r&&{"@context":"https://schema.org"},{"@type":e},t)}var n="https://cafebazaar.ir",i=["https://www.facebook.com/cafebazaar","https://twitter.com/cafebazaar","https://instagram.com/cafebazaar","https://www.linkedin.com/company/iranian-congenial-mobile-co./","https://aparat.com/cafebazaar"];function o(e){return String(e||"").replace(/۰/g,"0").replace(/۱/g,"1").replace(/۲/g,"2").replace(/۳/g,"3").replace(/۴/g,"4").replace(/۵/g,"5").replace(/۶/g,"6").replace(/۷/g,"7").replace(/۸/g,"8").replace(/۹/g,"9")}function s(e){try{var t=e.split("").reduce((function(e,t){return e+t.charCodeAt(0)}),0),r=Math.floor((Math.sin(t)+1)/2*12),a=Math.floor((Math.cos(t)+1)/2*28)+1,n=2020-Math.floor((Math.cos(t)+1)/2*3);return new Date(n,r,a)}catch(e){return new Date}}function c(e){var t={directors:[],actors:[],authors:[]};return e.forEach((function(e){/کارگردان|director/g.test(e.title)&&e.persons.length?t.directors=e.persons.map((function(e){return e.name})):/actor|بازیگران/g.test(e.title)?t.actors=e.persons.map((function(e){return e.name})):/author|نویسنده/g.test(e.title)&&(t.authors=e.persons.map((function(e){return e.name})))})),t}function u(e){for(var t=0;t<e.length;t+=1){var r=e[t];if(0===r.type)return r.url}return null}function l(e){void 0===e&&(e=0);var t=e,r=Math.floor(t/3600);t-=3600*r;var a=Math.floor(t/60),n=t-=60*a,i=function(e,t){return t>0?""+t+e:""};return"PT"+i("H",r)+i("M",a)+i("S",n)}function p(e){var t={};return e.forEach((function(e){if(/زمان|duration/gi.test(e.title))try{t.duration=60*(Number(o(e.text).replace(/[^\d]+/g,""))||0)}catch(e){t.duration=null}else if(/year|created|سال/gi.test(e.title))try{t.createdDate=new Date(Number(o(e.text)),0,1)}catch(e){t.createdDate=null}})),t.duration||(t.duration=3600),t.createdDate||(t.createdDate=s(JSON.stringify(e))),t}function m(e){var t=Number(o(e.totalVoteCount).replace(/[^\d]+/g,""))||0;return{ratingValue:Number(o(e.totalVoteRate).replace(/[^\d]+/g,""))||50,ratingCount:t,worstRating:0,bestRating:100}}var d=t((function(){return a("Corporation",{name:"Cafebazaar",alternateName:"کافه بازار",url:n,logo:r(n,"/images/icons/android-icon-96x96.png"),sameAs:i,contactPoint:[a("ContactPoint",{telephone:"+98-21-41253000",contactType:"customer service"})]},!0)}),"corporation"),g=t((function(){return a("WebSite",{name:"Cafebazaar",alternateName:"کافه بازار",url:n,potentialAction:a("SearchAction",{target:r(n,"/search/?q={search_term}"),"query-input":"required name=search_term"})},!0)}),"website"),f=t((function(t){var i=function(t){try{var r=o(t).split("/"),a=[],n=r[0],i=Number(n);2===n.length?i>85?a.push(1300+i):a.push(1400+i):a.push(i);var c=Number(r[1]);a.push(c-1);var u=Number(r[2]);return a.push(u),new(Function.prototype.bind.apply(e,[null].concat(a)))}catch(e){return s(t||"")}}(t.package.lastUpdated);return a("SoftwareApplication",Object.assign({},{operatingSystem:"ANDROID",url:r(n,"app/"+t.package.name),image:t.media.iconUrl,name:t.meta.name,description:t.meta.shortDescription,softwareVersion:o(t.package.versionName),fileSize:Math.round(t.package.size/1024),installUrl:"bazaar://details?id="+t.package.name},t.media&&t.media.screenshots&&t.media.screenshots.length&&{screenshot:r("https://s.cafebazaar.ir/1",t.media.screenshots[0].fullSize)},{dateModified:i,aggregateRating:a("AggregateRating",{ratingValue:t.meta.reviewInfo.averageRate||3,ratingCount:t.meta.reviewInfo.reviewCount||1,worstRating:0,bestRating:5}),applicationCategory:t.meta.category.name,offers:a("Offer",{price:t.meta.payment.price,priceCurrency:"IRR"}),softwareRequirements:t.package.minimumSDKVersion,potentialAction:a("ViewAction",{name:"Install from Bazaar",target:[r(n,"app/"+t.package.name),"android-app://com.farsitel.bazaar/bazaar/details?id="+t.package.name]})},function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];try{for(var a=t.flat(),n=e,i=0;i<a.length;i+=1){n=n[a[i]]}return n}catch(e){return}}(t,"media","videoTrailer","videoUrl")&&{video:a("VideoObject",{name:t.meta.name,description:t.meta.shortDescription,contentUrl:t.media.videoTrailer.videoUrl,thumbnailUrl:t.media.videoTrailer.poster,uploadDate:s(JSON.stringify(t.media.videoTrailer))})}),!0)}),"app"),h=t((function(e){var t=c(e.cast||[]),i=t.directors,o=t.authors,l=t.actors,p=u(e.previews||[]);return a("TVSeries",Object.assign({},{name:e.name,url:r(n,"series/s/"+e.identifier),numberOfSeasons:e.seasons.length,image:e.cover.url},i&&i.length&&{director:a("Person",{name:i[0]})},l&&l.length&&{actor:l.map((function(e){return a("Person",{name:e})}))},o&&o.length&&{author:o.map((function(e){return a("Person",{name:e})}))},p&&{trailer:a("VideoObject",{name:e.name,description:e.description,thumbnailUrl:e.cover.url,uploadDate:s(e.name),contentUrl:p})}),!0)}),"series"),v=t((function(e){return a("TVSeason",{name:e.title,numberOfEpisodes:e.seasonEpisodesCount},!0)}),"session"),b=t((function(e){var t=c(e.cast||[]),i=t.directors,o=t.authors,s=t.actors,d=p(e.videoInfoList||[]),g=d.duration,f=d.createdDate,h=u(e.previews||[]),v=m(e.voteInfo);return a("TVEpisode",Object.assign({},{name:e.name+" - "+e.seasonIndexTitle+" - "+e.episodeIndexTitle,url:r(n,"series/e/"+e.episodeId),image:e.cover.url,episodeNumber:e.episodeIndex},f&&{dateCreated:f},g&&{duration:l(g)},i&&i.length&&{director:a("Person",{name:i[0]})},s&&s.length&&{actor:s.map((function(e){return a("Person",{name:e})}))},o&&o.length&&{author:o.map((function(e){return a("Person",{name:e})}))},h&&{trailer:a("VideoObject",{name:e.name,description:e.description,thumbnailUrl:e.cover.url,uploadDate:f,contentUrl:h})},{aggregateRating:a("AggregateRating",Object.assign({},v))}),!0)}),"episode"),w=t((function(e){var t=c(e.cast||[]),i=t.directors,o=t.authors,s=t.actors,d=p(e.videoInfoList||[]),g=d.duration,f=d.createdDate,h=u(e.previews||[]),v=m(e.voteInfo);return a("Movie",Object.assign({},{name:e.name,url:r(n,"video/"+e.identifier),image:e.cover.url},f&&{dateCreated:f},i&&i.length&&{director:a("Person",{name:i[0]})},s&&s.length&&{actor:s.map((function(e){return a("Person",{name:e})}))},o&&o.length&&{author:o.map((function(e){return a("Person",{name:e})}))},g&&{duration:l(g)},h&&{trailer:a("VideoObject",{name:e.name,description:e.description,thumbnailUrl:e.cover.url,uploadDate:f,contentUrl:h})},{aggregateRating:a("AggregateRating",Object.assign({},v))}),!0)}),"movie"),y=t((function(e){return a("ItemList",{itemListElement:e.page.pageBodyInfo.pageBody.rows.map((function(e){var t=Object.keys(e)[0];if(!["simpleVideoItem","simpleAppItem"].includes(t))return null;var a=e[t];return a.info.packageName?r(n,"app/"+a.info.packageName):a.info.movie?r(n,"video/"+a.info.movie.movieId):r(n,"series/s/"+a.info.series.seriesId)})).filter((function(e){return null!==e})).map((function(e,t){return a("ListItem",{position:t+1,url:e})}))},!0)}),"vitrinList"),I={corporation:d,website:g,app:f,series:h,session:v,episode:b,movie:w,vitrinList:y};export default I;export{f as app,d as corporation,b as episode,w as movie,h as series,v as session,y as vitrinList,g as website};
import e from"idate";function t(e,t){return function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];try{return e.apply(void 0,r)}catch(e){return void console.error.apply(console,['Failed to Generate Correct JSON-LD via "'+(t||"unknown")+'" Method. Input:'].concat(r))}}}function r(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return e.map((function(e){return e.substring(e.startsWith("/")?1:0,e.endsWith("/")?e.length-1:e.length)})).join("/")}function a(e,t,r){return void 0===r&&(r=!1),Object.assign({},r&&{"@context":"https://schema.org"},{"@type":e},t)}var n="https://cafebazaar.ir",i=["https://www.facebook.com/cafebazaar","https://twitter.com/cafebazaar","https://instagram.com/cafebazaar","https://www.linkedin.com/company/iranian-congenial-mobile-co./","https://aparat.com/cafebazaar"];function o(e){return String(e||"").replace(/۰/g,"0").replace(/۱/g,"1").replace(/۲/g,"2").replace(/۳/g,"3").replace(/۴/g,"4").replace(/۵/g,"5").replace(/۶/g,"6").replace(/۷/g,"7").replace(/۸/g,"8").replace(/۹/g,"9")}function s(e){try{var t=e.split("").reduce((function(e,t){return e+t.charCodeAt(0)}),0),r=Math.floor((Math.sin(t)+1)/2*12),a=Math.floor((Math.cos(t)+1)/2*28)+1,n=2020-Math.floor((Math.cos(t)+1)/2*3);return new Date(n,r,a)}catch(e){return new Date}}function c(e){var t={directors:[],actors:[],authors:[]};return e.forEach((function(e){/کارگردان|director/g.test(e.title)&&e.persons.length?t.directors=e.persons.map((function(e){return e.name})):/actor|بازیگران/g.test(e.title)?t.actors=e.persons.map((function(e){return e.name})):/author|نویسنده/g.test(e.title)&&(t.authors=e.persons.map((function(e){return e.name})))})),t}function u(e){for(var t=0;t<e.length;t+=1){var r=e[t];if(0===r.type)return r.url}return null}function l(e){void 0===e&&(e=0);var t=e,r=Math.floor(t/3600);t-=3600*r;var a=Math.floor(t/60),n=t-=60*a,i=function(e,t){return t>0?""+t+e:""};return"PT"+i("H",r)+i("M",a)+i("S",n)}function p(e){var t={};return e.forEach((function(e){if(/زمان|duration/gi.test(e.title))try{t.duration=60*(Number(o(e.text).replace(/[^\d]+/g,""))||0)}catch(e){t.duration=null}else if(/year|created|سال/gi.test(e.title))try{t.createdDate=new Date(Number(o(e.text)),0,1)}catch(e){t.createdDate=null}})),t.duration||(t.duration=3600),t.createdDate||(t.createdDate=s(JSON.stringify(e))),t}function m(e){var t=Number(o(e.totalVoteCount).replace(/[^\d]+/g,""))||1;return{ratingValue:Number(o(e.totalVoteRate).replace(/[^\d]+/g,""))||80,ratingCount:t,worstRating:0,bestRating:100}}var d=t((function(){return a("Corporation",{name:"Cafebazaar",alternateName:"کافه بازار",url:n,logo:r(n,"/images/icons/android-icon-96x96.png"),sameAs:i,contactPoint:[a("ContactPoint",{telephone:"+98-21-41253000",contactType:"customer service"})]},!0)}),"corporation"),g=t((function(){return a("WebSite",{name:"Cafebazaar",alternateName:"کافه بازار",url:n,potentialAction:a("SearchAction",{target:r(n,"/search/?q={search_term}"),"query-input":"required name=search_term"})},!0)}),"website"),f=t((function(t){var i=function(t){try{var r=o(t).split("/"),a=[],n=r[0],i=Number(n);2===n.length?i>85?a.push(1300+i):a.push(1400+i):a.push(i);var c=Number(r[1]);a.push(c-1);var u=Number(r[2]);return a.push(u),new(Function.prototype.bind.apply(e,[null].concat(a)))}catch(e){return s(t||"")}}(t.package.lastUpdated);return a("SoftwareApplication",Object.assign({},{operatingSystem:"ANDROID",url:r(n,"app/"+t.package.name),image:t.media.iconUrl,name:t.meta.name,description:t.meta.shortDescription,softwareVersion:o(t.package.versionName),fileSize:Math.round(t.package.size/1024),installUrl:"bazaar://details?id="+t.package.name},t.media&&t.media.screenshots&&t.media.screenshots.length&&{screenshot:r("https://s.cafebazaar.ir/1",t.media.screenshots[0].fullSize)},{dateModified:i,aggregateRating:a("AggregateRating",{ratingValue:t.meta.reviewInfo.averageRate||4,ratingCount:t.meta.reviewInfo.reviewCount||1,worstRating:0,bestRating:5}),applicationCategory:t.meta.category.name,offers:a("Offer",{price:t.meta.payment.price,priceCurrency:"IRR"}),softwareRequirements:t.package.minimumSDKVersion,potentialAction:a("ViewAction",{name:"Install from Bazaar",target:[r(n,"app/"+t.package.name),"android-app://com.farsitel.bazaar/bazaar/details?id="+t.package.name]})},function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];try{for(var a=t.flat(),n=e,i=0;i<a.length;i+=1){n=n[a[i]]}return n}catch(e){return}}(t,"media","videoTrailer","videoUrl")&&{video:a("VideoObject",{name:t.meta.name,description:t.meta.shortDescription,contentUrl:t.media.videoTrailer.videoUrl,thumbnailUrl:t.media.videoTrailer.poster,uploadDate:s(JSON.stringify(t.media.videoTrailer))})}),!0)}),"app"),h=t((function(e){var t=c(e.cast||[]),i=t.directors,o=t.authors,l=t.actors,p=u(e.previews||[]);return a("TVSeries",Object.assign({},{name:e.name,url:r(n,"series/s/"+e.identifier),numberOfSeasons:e.seasons.length,image:e.cover.url},i&&i.length&&{director:a("Person",{name:i[0]})},l&&l.length&&{actor:l.map((function(e){return a("Person",{name:e})}))},o&&o.length&&{author:o.map((function(e){return a("Person",{name:e})}))},p&&{trailer:a("VideoObject",{name:e.name,description:e.description,thumbnailUrl:e.cover.url,uploadDate:s(e.name),contentUrl:p})}),!0)}),"series"),v=t((function(e){return a("TVSeason",{name:e.title,numberOfEpisodes:e.seasonEpisodesCount},!0)}),"session"),b=t((function(e){var t=c(e.cast||[]),i=t.directors,o=t.authors,s=t.actors,d=p(e.videoInfoList||[]),g=d.duration,f=d.createdDate,h=u(e.previews||[]),v=m(e.voteInfo);return a("TVEpisode",Object.assign({},{name:e.name+" - "+e.seasonIndexTitle+" - "+e.episodeIndexTitle,url:r(n,"series/e/"+e.episodeId),image:e.cover.url,episodeNumber:e.episodeIndex},f&&{dateCreated:f},g&&{duration:l(g)},i&&i.length&&{director:a("Person",{name:i[0]})},s&&s.length&&{actor:s.map((function(e){return a("Person",{name:e})}))},o&&o.length&&{author:o.map((function(e){return a("Person",{name:e})}))},h&&{trailer:a("VideoObject",{name:e.name,description:e.description,thumbnailUrl:e.cover.url,uploadDate:f,contentUrl:h})},{aggregateRating:a("AggregateRating",Object.assign({},v))}),!0)}),"episode"),w=t((function(e){var t=c(e.cast||[]),i=t.directors,o=t.authors,s=t.actors,d=p(e.videoInfoList||[]),g=d.duration,f=d.createdDate,h=u(e.previews||[]),v=m(e.voteInfo);return a("Movie",Object.assign({},{name:e.name,url:r(n,"video/"+e.identifier),image:e.cover.url},f&&{dateCreated:f},i&&i.length&&{director:a("Person",{name:i[0]})},s&&s.length&&{actor:s.map((function(e){return a("Person",{name:e})}))},o&&o.length&&{author:o.map((function(e){return a("Person",{name:e})}))},g&&{duration:l(g)},h&&{trailer:a("VideoObject",{name:e.name,description:e.description,thumbnailUrl:e.cover.url,uploadDate:f,contentUrl:h})},{aggregateRating:a("AggregateRating",Object.assign({},v))}),!0)}),"movie"),y=t((function(e){return a("ItemList",{itemListElement:e.page.pageBodyInfo.pageBody.rows.map((function(e){var t=Object.keys(e)[0];if(!["simpleVideoItem","simpleAppItem"].includes(t))return null;var a=e[t];return a.info.packageName?r(n,"app/"+a.info.packageName):a.info.movie?r(n,"video/"+a.info.movie.movieId):r(n,"series/s/"+a.info.series.seriesId)})).filter((function(e){return null!==e})).map((function(e,t){return a("ListItem",{position:t+1,url:e})}))},!0)}),"vitrinList"),I={corporation:d,website:g,app:f,series:h,session:v,episode:b,movie:w,vitrinList:y};export default I;export{f as app,d as corporation,b as episode,w as movie,h as series,v as session,y as vitrinList,g as website};

@@ -165,3 +165,3 @@ var jaldi = (function (exports, IDate) {

aggregateRating: ldObject('AggregateRating', {
ratingValue: appObject.meta.reviewInfo.averageRate || 3,
ratingValue: appObject.meta.reviewInfo.averageRate || 4,
ratingCount: appObject.meta.reviewInfo.reviewCount || 1,

@@ -311,4 +311,4 @@ worstRating: 0,

function videoVoteInfo (voteInfo) {
var ratingCount = Number(faToEnNums(voteInfo.totalVoteCount).replace(/[^\d]+/g, '')) || 0;
var ratingValue = Number(faToEnNums(voteInfo.totalVoteRate).replace(/[^\d]+/g, '')) || 50;
var ratingCount = Number(faToEnNums(voteInfo.totalVoteCount).replace(/[^\d]+/g, '')) || 1;
var ratingValue = Number(faToEnNums(voteInfo.totalVoteRate).replace(/[^\d]+/g, '')) || 80;
return {

@@ -315,0 +315,0 @@ ratingValue: ratingValue,

@@ -1,1 +0,1 @@

var jaldi=function(e,t){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=r(t);function n(e,t){return function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];try{return e.apply(void 0,r)}catch(e){return void console.error.apply(console,['Failed to Generate Correct JSON-LD via "'+(t||"unknown")+'" Method. Input:'].concat(r))}}}function i(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return e.map((function(e){return e.substring(e.startsWith("/")?1:0,e.endsWith("/")?e.length-1:e.length)})).join("/")}function o(e,t,r){return void 0===r&&(r=!1),Object.assign({},r&&{"@context":"https://schema.org"},{"@type":e},t)}var s="https://cafebazaar.ir",c="Cafebazaar",u="کافه بازار",l=["https://www.facebook.com/cafebazaar","https://twitter.com/cafebazaar","https://instagram.com/cafebazaar","https://www.linkedin.com/company/iranian-congenial-mobile-co./","https://aparat.com/cafebazaar"];function p(e){return String(e||"").replace(/۰/g,"0").replace(/۱/g,"1").replace(/۲/g,"2").replace(/۳/g,"3").replace(/۴/g,"4").replace(/۵/g,"5").replace(/۶/g,"6").replace(/۷/g,"7").replace(/۸/g,"8").replace(/۹/g,"9")}function m(e){try{var t=e.split("").reduce((function(e,t){return e+t.charCodeAt(0)}),0),r=Math.floor((Math.sin(t)+1)/2*12),a=Math.floor((Math.cos(t)+1)/2*28)+1,n=2020-Math.floor((Math.cos(t)+1)/2*3);return new Date(n,r,a)}catch(e){return new Date}}function d(e){var t={directors:[],actors:[],authors:[]};return e.forEach((function(e){/کارگردان|director/g.test(e.title)&&e.persons.length?t.directors=e.persons.map((function(e){return e.name})):/actor|بازیگران/g.test(e.title)?t.actors=e.persons.map((function(e){return e.name})):/author|نویسنده/g.test(e.title)&&(t.authors=e.persons.map((function(e){return e.name})))})),t}function g(e){for(var t=0;t<e.length;t+=1){var r=e[t];if(0===r.type)return r.url}return null}function f(e){void 0===e&&(e=0);var t=e,r=Math.floor(t/3600);t-=3600*r;var a=Math.floor(t/60),n=t-=60*a,i=function(e,t){return t>0?""+t+e:""};return"PT"+i("H",r)+i("M",a)+i("S",n)}function h(e){var t={};return e.forEach((function(e){if(/زمان|duration/gi.test(e.title))try{t.duration=60*(Number(p(e.text).replace(/[^\d]+/g,""))||0)}catch(e){t.duration=null}else if(/year|created|سال/gi.test(e.title))try{t.createdDate=new Date(Number(p(e.text)),0,1)}catch(e){t.createdDate=null}})),t.duration||(t.duration=3600),t.createdDate||(t.createdDate=m(JSON.stringify(e))),t}function v(e){var t=Number(p(e.totalVoteCount).replace(/[^\d]+/g,""))||0;return{ratingValue:Number(p(e.totalVoteRate).replace(/[^\d]+/g,""))||50,ratingCount:t,worstRating:0,bestRating:100}}var b=n((function(){return o("Corporation",{name:c,alternateName:u,url:s,logo:i(s,"/images/icons/android-icon-96x96.png"),sameAs:l,contactPoint:[o("ContactPoint",{telephone:"+98-21-41253000",contactType:"customer service"})]},!0)}),"corporation"),w=n((function(){return o("WebSite",{name:c,alternateName:u,url:s,potentialAction:o("SearchAction",{target:i(s,"/search/?q={search_term}"),"query-input":"required name=search_term"})},!0)}),"website"),y=n((function(e){var t=function(e){try{var t=p(e).split("/"),r=[],n=t[0],i=Number(n);2===n.length?i>85?r.push(1300+i):r.push(1400+i):r.push(i);var o=Number(t[1]);r.push(o-1);var s=Number(t[2]);return r.push(s),new(Function.prototype.bind.apply(a.default,[null].concat(r)))}catch(t){return m(e||"")}}(e.package.lastUpdated);return o("SoftwareApplication",Object.assign({},{operatingSystem:"ANDROID",url:i(s,"app/"+e.package.name),image:e.media.iconUrl,name:e.meta.name,description:e.meta.shortDescription,softwareVersion:p(e.package.versionName),fileSize:Math.round(e.package.size/1024),installUrl:"bazaar://details?id="+e.package.name},e.media&&e.media.screenshots&&e.media.screenshots.length&&{screenshot:i("https://s.cafebazaar.ir/1",e.media.screenshots[0].fullSize)},{dateModified:t,aggregateRating:o("AggregateRating",{ratingValue:e.meta.reviewInfo.averageRate||3,ratingCount:e.meta.reviewInfo.reviewCount||1,worstRating:0,bestRating:5}),applicationCategory:e.meta.category.name,offers:o("Offer",{price:e.meta.payment.price,priceCurrency:"IRR"}),softwareRequirements:e.package.minimumSDKVersion,potentialAction:o("ViewAction",{name:"Install from Bazaar",target:[i(s,"app/"+e.package.name),"android-app://com.farsitel.bazaar/bazaar/details?id="+e.package.name]})},function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];try{for(var a=t.flat(),n=e,i=0;i<a.length;i+=1){n=n[a[i]]}return n}catch(e){return}}(e,"media","videoTrailer","videoUrl")&&{video:o("VideoObject",{name:e.meta.name,description:e.meta.shortDescription,contentUrl:e.media.videoTrailer.videoUrl,thumbnailUrl:e.media.videoTrailer.poster,uploadDate:m(JSON.stringify(e.media.videoTrailer))})}),!0)}),"app"),I=n((function(e){var t=d(e.cast||[]),r=t.directors,a=t.authors,n=t.actors,c=g(e.previews||[]);return o("TVSeries",Object.assign({},{name:e.name,url:i(s,"series/s/"+e.identifier),numberOfSeasons:e.seasons.length,image:e.cover.url},r&&r.length&&{director:o("Person",{name:r[0]})},n&&n.length&&{actor:n.map((function(e){return o("Person",{name:e})}))},a&&a.length&&{author:a.map((function(e){return o("Person",{name:e})}))},c&&{trailer:o("VideoObject",{name:e.name,description:e.description,thumbnailUrl:e.cover.url,uploadDate:m(e.name),contentUrl:c})}),!0)}),"series"),D=n((function(e){return o("TVSeason",{name:e.title,numberOfEpisodes:e.seasonEpisodesCount},!0)}),"session"),O=n((function(e){var t=d(e.cast||[]),r=t.directors,a=t.authors,n=t.actors,c=h(e.videoInfoList||[]),u=c.duration,l=c.createdDate,p=g(e.previews||[]),m=v(e.voteInfo);return o("TVEpisode",Object.assign({},{name:e.name+" - "+e.seasonIndexTitle+" - "+e.episodeIndexTitle,url:i(s,"series/e/"+e.episodeId),image:e.cover.url,episodeNumber:e.episodeIndex},l&&{dateCreated:l},u&&{duration:f(u)},r&&r.length&&{director:o("Person",{name:r[0]})},n&&n.length&&{actor:n.map((function(e){return o("Person",{name:e})}))},a&&a.length&&{author:a.map((function(e){return o("Person",{name:e})}))},p&&{trailer:o("VideoObject",{name:e.name,description:e.description,thumbnailUrl:e.cover.url,uploadDate:l,contentUrl:p})},{aggregateRating:o("AggregateRating",Object.assign({},m))}),!0)}),"episode"),N=n((function(e){var t=d(e.cast||[]),r=t.directors,a=t.authors,n=t.actors,c=h(e.videoInfoList||[]),u=c.duration,l=c.createdDate,p=g(e.previews||[]),m=v(e.voteInfo);return o("Movie",Object.assign({},{name:e.name,url:i(s,"video/"+e.identifier),image:e.cover.url},l&&{dateCreated:l},r&&r.length&&{director:o("Person",{name:r[0]})},n&&n.length&&{actor:n.map((function(e){return o("Person",{name:e})}))},a&&a.length&&{author:a.map((function(e){return o("Person",{name:e})}))},u&&{duration:f(u)},p&&{trailer:o("VideoObject",{name:e.name,description:e.description,thumbnailUrl:e.cover.url,uploadDate:l,contentUrl:p})},{aggregateRating:o("AggregateRating",Object.assign({},m))}),!0)}),"movie"),j=n((function(e){return o("ItemList",{itemListElement:e.page.pageBodyInfo.pageBody.rows.map((function(e){var t=Object.keys(e)[0];if(!["simpleVideoItem","simpleAppItem"].includes(t))return null;var r=e[t];return r.info.packageName?i(s,"app/"+r.info.packageName):r.info.movie?i(s,"video/"+r.info.movie.movieId):i(s,"series/s/"+r.info.series.seriesId)})).filter((function(e){return null!==e})).map((function(e,t){return o("ListItem",{position:t+1,url:e})}))},!0)}),"vitrinList"),R={corporation:b,website:w,app:y,series:I,session:D,episode:O,movie:N,vitrinList:j};return e.app=y,e.corporation=b,e.default=R,e.episode=O,e.movie=N,e.series=I,e.session=D,e.vitrinList=j,e.website=w,Object.defineProperty(e,"__esModule",{value:!0}),e}({},IDate);
var jaldi=function(e,t){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=r(t);function n(e,t){return function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];try{return e.apply(void 0,r)}catch(e){return void console.error.apply(console,['Failed to Generate Correct JSON-LD via "'+(t||"unknown")+'" Method. Input:'].concat(r))}}}function i(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return e.map((function(e){return e.substring(e.startsWith("/")?1:0,e.endsWith("/")?e.length-1:e.length)})).join("/")}function o(e,t,r){return void 0===r&&(r=!1),Object.assign({},r&&{"@context":"https://schema.org"},{"@type":e},t)}var s="https://cafebazaar.ir",c="Cafebazaar",u="کافه بازار",l=["https://www.facebook.com/cafebazaar","https://twitter.com/cafebazaar","https://instagram.com/cafebazaar","https://www.linkedin.com/company/iranian-congenial-mobile-co./","https://aparat.com/cafebazaar"];function p(e){return String(e||"").replace(/۰/g,"0").replace(/۱/g,"1").replace(/۲/g,"2").replace(/۳/g,"3").replace(/۴/g,"4").replace(/۵/g,"5").replace(/۶/g,"6").replace(/۷/g,"7").replace(/۸/g,"8").replace(/۹/g,"9")}function m(e){try{var t=e.split("").reduce((function(e,t){return e+t.charCodeAt(0)}),0),r=Math.floor((Math.sin(t)+1)/2*12),a=Math.floor((Math.cos(t)+1)/2*28)+1,n=2020-Math.floor((Math.cos(t)+1)/2*3);return new Date(n,r,a)}catch(e){return new Date}}function d(e){var t={directors:[],actors:[],authors:[]};return e.forEach((function(e){/کارگردان|director/g.test(e.title)&&e.persons.length?t.directors=e.persons.map((function(e){return e.name})):/actor|بازیگران/g.test(e.title)?t.actors=e.persons.map((function(e){return e.name})):/author|نویسنده/g.test(e.title)&&(t.authors=e.persons.map((function(e){return e.name})))})),t}function g(e){for(var t=0;t<e.length;t+=1){var r=e[t];if(0===r.type)return r.url}return null}function f(e){void 0===e&&(e=0);var t=e,r=Math.floor(t/3600);t-=3600*r;var a=Math.floor(t/60),n=t-=60*a,i=function(e,t){return t>0?""+t+e:""};return"PT"+i("H",r)+i("M",a)+i("S",n)}function h(e){var t={};return e.forEach((function(e){if(/زمان|duration/gi.test(e.title))try{t.duration=60*(Number(p(e.text).replace(/[^\d]+/g,""))||0)}catch(e){t.duration=null}else if(/year|created|سال/gi.test(e.title))try{t.createdDate=new Date(Number(p(e.text)),0,1)}catch(e){t.createdDate=null}})),t.duration||(t.duration=3600),t.createdDate||(t.createdDate=m(JSON.stringify(e))),t}function v(e){var t=Number(p(e.totalVoteCount).replace(/[^\d]+/g,""))||1;return{ratingValue:Number(p(e.totalVoteRate).replace(/[^\d]+/g,""))||80,ratingCount:t,worstRating:0,bestRating:100}}var b=n((function(){return o("Corporation",{name:c,alternateName:u,url:s,logo:i(s,"/images/icons/android-icon-96x96.png"),sameAs:l,contactPoint:[o("ContactPoint",{telephone:"+98-21-41253000",contactType:"customer service"})]},!0)}),"corporation"),w=n((function(){return o("WebSite",{name:c,alternateName:u,url:s,potentialAction:o("SearchAction",{target:i(s,"/search/?q={search_term}"),"query-input":"required name=search_term"})},!0)}),"website"),y=n((function(e){var t=function(e){try{var t=p(e).split("/"),r=[],n=t[0],i=Number(n);2===n.length?i>85?r.push(1300+i):r.push(1400+i):r.push(i);var o=Number(t[1]);r.push(o-1);var s=Number(t[2]);return r.push(s),new(Function.prototype.bind.apply(a.default,[null].concat(r)))}catch(t){return m(e||"")}}(e.package.lastUpdated);return o("SoftwareApplication",Object.assign({},{operatingSystem:"ANDROID",url:i(s,"app/"+e.package.name),image:e.media.iconUrl,name:e.meta.name,description:e.meta.shortDescription,softwareVersion:p(e.package.versionName),fileSize:Math.round(e.package.size/1024),installUrl:"bazaar://details?id="+e.package.name},e.media&&e.media.screenshots&&e.media.screenshots.length&&{screenshot:i("https://s.cafebazaar.ir/1",e.media.screenshots[0].fullSize)},{dateModified:t,aggregateRating:o("AggregateRating",{ratingValue:e.meta.reviewInfo.averageRate||4,ratingCount:e.meta.reviewInfo.reviewCount||1,worstRating:0,bestRating:5}),applicationCategory:e.meta.category.name,offers:o("Offer",{price:e.meta.payment.price,priceCurrency:"IRR"}),softwareRequirements:e.package.minimumSDKVersion,potentialAction:o("ViewAction",{name:"Install from Bazaar",target:[i(s,"app/"+e.package.name),"android-app://com.farsitel.bazaar/bazaar/details?id="+e.package.name]})},function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];try{for(var a=t.flat(),n=e,i=0;i<a.length;i+=1){n=n[a[i]]}return n}catch(e){return}}(e,"media","videoTrailer","videoUrl")&&{video:o("VideoObject",{name:e.meta.name,description:e.meta.shortDescription,contentUrl:e.media.videoTrailer.videoUrl,thumbnailUrl:e.media.videoTrailer.poster,uploadDate:m(JSON.stringify(e.media.videoTrailer))})}),!0)}),"app"),I=n((function(e){var t=d(e.cast||[]),r=t.directors,a=t.authors,n=t.actors,c=g(e.previews||[]);return o("TVSeries",Object.assign({},{name:e.name,url:i(s,"series/s/"+e.identifier),numberOfSeasons:e.seasons.length,image:e.cover.url},r&&r.length&&{director:o("Person",{name:r[0]})},n&&n.length&&{actor:n.map((function(e){return o("Person",{name:e})}))},a&&a.length&&{author:a.map((function(e){return o("Person",{name:e})}))},c&&{trailer:o("VideoObject",{name:e.name,description:e.description,thumbnailUrl:e.cover.url,uploadDate:m(e.name),contentUrl:c})}),!0)}),"series"),D=n((function(e){return o("TVSeason",{name:e.title,numberOfEpisodes:e.seasonEpisodesCount},!0)}),"session"),O=n((function(e){var t=d(e.cast||[]),r=t.directors,a=t.authors,n=t.actors,c=h(e.videoInfoList||[]),u=c.duration,l=c.createdDate,p=g(e.previews||[]),m=v(e.voteInfo);return o("TVEpisode",Object.assign({},{name:e.name+" - "+e.seasonIndexTitle+" - "+e.episodeIndexTitle,url:i(s,"series/e/"+e.episodeId),image:e.cover.url,episodeNumber:e.episodeIndex},l&&{dateCreated:l},u&&{duration:f(u)},r&&r.length&&{director:o("Person",{name:r[0]})},n&&n.length&&{actor:n.map((function(e){return o("Person",{name:e})}))},a&&a.length&&{author:a.map((function(e){return o("Person",{name:e})}))},p&&{trailer:o("VideoObject",{name:e.name,description:e.description,thumbnailUrl:e.cover.url,uploadDate:l,contentUrl:p})},{aggregateRating:o("AggregateRating",Object.assign({},m))}),!0)}),"episode"),N=n((function(e){var t=d(e.cast||[]),r=t.directors,a=t.authors,n=t.actors,c=h(e.videoInfoList||[]),u=c.duration,l=c.createdDate,p=g(e.previews||[]),m=v(e.voteInfo);return o("Movie",Object.assign({},{name:e.name,url:i(s,"video/"+e.identifier),image:e.cover.url},l&&{dateCreated:l},r&&r.length&&{director:o("Person",{name:r[0]})},n&&n.length&&{actor:n.map((function(e){return o("Person",{name:e})}))},a&&a.length&&{author:a.map((function(e){return o("Person",{name:e})}))},u&&{duration:f(u)},p&&{trailer:o("VideoObject",{name:e.name,description:e.description,thumbnailUrl:e.cover.url,uploadDate:l,contentUrl:p})},{aggregateRating:o("AggregateRating",Object.assign({},m))}),!0)}),"movie"),j=n((function(e){return o("ItemList",{itemListElement:e.page.pageBodyInfo.pageBody.rows.map((function(e){var t=Object.keys(e)[0];if(!["simpleVideoItem","simpleAppItem"].includes(t))return null;var r=e[t];return r.info.packageName?i(s,"app/"+r.info.packageName):r.info.movie?i(s,"video/"+r.info.movie.movieId):i(s,"series/s/"+r.info.series.seriesId)})).filter((function(e){return null!==e})).map((function(e,t){return o("ListItem",{position:t+1,url:e})}))},!0)}),"vitrinList"),R={corporation:b,website:w,app:y,series:I,session:D,episode:O,movie:N,vitrinList:j};return e.app=y,e.corporation=b,e.default=R,e.episode=O,e.movie=N,e.series=I,e.session=D,e.vitrinList=j,e.website=w,Object.defineProperty(e,"__esModule",{value:!0}),e}({},IDate);
{
"name": "@cafebazaar/jaldi",
"version": "1.2.6",
"version": "1.2.7",
"description": "Create json-ld to used in Cafebazaar pages",

@@ -5,0 +5,0 @@ "main": "dist/jaldi.cjs.min.js",