lf16-tiktok-web.ttwstatic.com
Open in
urlscan Pro
2.16.91.17
Public Scan
URL:
https://lf16-tiktok-web.ttwstatic.com/obj/tiktok-web/tiktok/falcon/embed/embed_lib_v1.0.11.js
Submission: On November 30 via manual from IN — Scanned from DE
Submission: On November 30 via manual from IN — Scanned from DE
Form analysis
0 forms found in the DOMText Content
(function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:false,exports:{}};e[r].call(o.exports,o,o.exports,n);o.l=true;return o.exports}n.m=e;n.c=t;n.d=function(e,t,r){if(!n.o(e,t))Object.defineProperty(e,t,{enumerable:true,get:r})};n.r=function(e){if("undefined"!==typeof Symbol&&Symbol.toStringTag)Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});Object.defineProperty(e,"__esModule",{value:true})};n.t=function(e,t){if(1&t)e=n(e);if(8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);n.r(r);Object.defineProperty(r,"default",{enumerable:true,value:e});if(2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r};n.n=function(e){var t=e&&e.__esModule?function t(){return e["default"]}:function t(){return e};n.d(t,"a",t);return t};n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};n.p="/";return n(n.s=1)})({1:function(e,t,n){e.exports=n("da0115c7dd1b08601d31")},"23617503340803072f22":function(e,t,n){"use strict";n.d(t,"b",(function(){return a}));n.d(t,"d",(function(){return c}));n.d(t,"a",(function(){return d}));n.d(t,"c",(function(){return v}));function r(e,t,n,r,o,i,a){try{var c=e[i](a);var u=c.value}catch(s){n(s);return}if(c.done)t(u);else Promise.resolve(u).then(r,o)}function o(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var a=e.apply(t,n);function c(e){r(a,o,i,c,u,"next",e)}function u(e){r(a,o,i,c,u,"throw",e)}c(void 0)}))}}function i(e){"@babel/helpers - typeof";return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(){return Math.round(1e17*Math.random())}function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];var t=arguments.length>1?arguments[1]:void 0;var n=arguments.length>2?arguments[2]:void 0;if(!e.length||!t)return[];return e.reduce((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];var r=arguments.length>1?arguments[1]:void 0;var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;var i=Math.floor(o/t);if(!e[i])e[i]=[];if(n)e[i].push(r[n]);else e[i].push(r);return e}),[])}function u(e,t){var n=t.type||"GET";var r=t.data;var o=t.success,a=void 0===o?function e(t,n){console.log(t)}:o,c=t.fail,u=void 0===c?function e(t,n){console.log("Request was unsuccessful: ".concat(n.status))}:c;var s=new XMLHttpRequest;s.onreadystatechange=function(){if(4===Number(s.readyState))if(s.status>=200&&s.status<300||304===s.status)a(s.responseText,s);else u(s.responseText,s)};function l(e){var t=e;var n=[];if("string"===typeof t)t=encodeURI(t);else if("object"===i(t)){Object.keys(t).forEach((function(e){n.push("".concat(e,"=").concat(encodeURIComponent(t[e].toString())))}));t=n.join("&")}return t}if("GET"===n.toUpperCase()){var f="".concat(e,"?").concat(l(r||""));s.open("get",f,true);s.send(null)}else if("POST"===n.toUpperCase()){s.open("post",e,true);s.setRequestHeader("Content-Type","application/x-www-form-urlencoded");s.send(l(r||""))}}function s(e,t){return l.apply(this,arguments)}function l(){l=o(regeneratorRuntime.mark((function e(t,n){return regeneratorRuntime.wrap((function e(r){while(1)switch(r.prev=r.next){case 0:return r.abrupt("return",new Promise((function(e,r){var o={data:n,success:e,fail:r};u(t,o)})).then((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"{}";var t={};try{t=JSON.parse(e)}catch(n){t={}}return t})));case 1:case"end":return r.stop()}}),e)})));return l.apply(this,arguments)}function f(){var e="TikTok";var t={};var n=function t(n){return"[".concat(e,"] ").concat(n.toString())};["error","log","info"].forEach((function(e){t[e]=function(t){if("info"===e)console[e]("%c".concat(n(t)),"color: #fe2c55");else console[e](n(t))}}));return t}var d=f();function v(e){var t=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var n=new RegExp("[\\?&]".concat(t,"=([^&#]*)"));var r=n.exec(location.search);return null===r?"":decodeURIComponent(r[1].replace(/\+/g," "))}function m(){return false||"production"==="dev"}},"40b8419e3e2132ef0a63":function(e){e.exports={name:"tiktok_embed",version:"1.0.11",embedVersion:"1.0.11",description:"TikTok Embed SDK",main:"index.js",scripts:{test:"jest --forceExit",dev:"eden start",build:"eden build","build:gcp":"NODE_REGION=GCP eden build","build:dev":"eden build -a",commit:"eden push",feature:"eden feature",mr:"eden release -m",lint:"eden-lint ./src --fix"},keywords:["tiktok","embed"],author:"yangminghui.jasmine, chloe.chao",license:"ISC",devDependencies:{"@ies/create-eden-config":"^1.0.2","@ies/eden-lint":"^2.15.4","@testing-library/dom":"^8.17.1","@testing-library/jest-dom":"^5.16.5",jest:"^28.1.3",jsdom:"^20.0.0"},dependencies:{"core-js":"2.5.7",promise:"^8.0.3","regenerator-runtime":"^0.13.3"},husky:{hooks:{"commit-msg":"commitlint .commitlintrc.js -E HUSKY_GIT_PARAMS","pre-commit":"lint-staged"}},"lint-staged":{"*":["eden lint format","git add"]}}},be8a10cc439bb053807d:function(e,t,n){},da0115c7dd1b08601d31:function(e,t,n){"use strict";n.r(t);var r=n("be8a10cc439bb053807d");var o=n.n(r);var i=n("e0b8897ffbf48a102fbb");var a=n("23617503340803072f22");function c(e,t){return d(e)||f(e,t)||s(e,t)||u()}function u(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function s(e,t){if(!e)return;if("string"===typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor)n=e.constructor.name;if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(e,t)}function l(e,t){if(null==t||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function f(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r=[];var o=true;var i=false;var a,c;try{for(n=n.call(e);!(o=(a=n.next()).done);o=true){r.push(a.value);if(t&&r.length===t)break}}catch(u){i=true;c=u}finally{try{if(!o&&null!=n["return"])n["return"]()}finally{if(i)throw c}}return r}function d(e){if(Array.isArray(e))return e}function v(e,t,n,r,o,i,a){try{var c=e[i](a);var u=c.value}catch(s){n(s);return}if(c.done)t(u);else Promise.resolve(u).then(r,o)}function m(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){v(i,r,o,a,c,"next",e)}function c(e){v(i,r,o,a,c,"throw",e)}a(void 0)}))}}function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||false;r.configurable=true;if("value"in r)r.writable=true;Object.defineProperty(e,r.key,r)}}function b(e,t,n){if(t)h(e.prototype,t);if(n)h(e,n);Object.defineProperty(e,"prototype",{writable:false});return e}(function e(t){var n=t;var r=3;var o=function(){function e(){p(this,e)}b(e,[{key:"init",value:function(){var e=m(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function e(r){while(1)switch(r.prev=r.next){case 0:n[i["j"]].isEventsInit=true;this.receiveMessage=this.receiveMessage.bind(this);t.addEventListener(i["m"],this.receiveMessage);a["a"].info("\n\nWe're hiring!\nAre you ready to make a change?\nCheck out some of our available positions at https://careers.tiktok.com/");case 4:case"end":return r.stop()}}),e,this)})));return function t(){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=m(regeneratorRuntime.mark((function e(t){var n=this;var o,c,u,s,l,f,d,v,p,h,b,g,y,k;return regeneratorRuntime.wrap((function e(w){while(1)switch(w.prev=w.next){case 0:if(t.length){w.next=2;break}return w.abrupt("return");case 2:o="SG"||false;c=true;u=false;s=void 0;w.prev=6;for(l=i["n"][o][Symbol.iterator]();!(c=(f=l.next()).done);c=true){d=f.value;this.addPreConnectInstruction(d)}w.next=14;break;case 10:w.prev=10;w.t0=w["catch"](6);u=true;s=w.t0;case 14:w.prev=14;w.prev=15;if(!c&&null!=l.return)l.return();case 17:w.prev=17;if(!u){w.next=20;break}throw s;case 20:return w.finish(17);case 21:return w.finish(14);case 22:v=Object(a["d"])(t,r);p=true;h=false;b=void 0;w.prev=26;g=v[Symbol.iterator]();case 28:if(p=(y=g.next()).done){w.next=35;break}k=y.value;w.next=32;return Promise.all(k.map(function(){var e=m(regeneratorRuntime.mark((function e(t){var r,o,i,c,u,s,l,f,d,v,m,p,h,b,g,y;return regeneratorRuntime.wrap((function e(k){while(1)switch(k.prev=k.next){case 0:r=t.dataset,o=r.videoId,i=void 0===o?null:o,c=r.uniqueId,u=void 0===c?null:c,s=r.musicId,l=void 0===s?null:s,f=r.tagId,d=void 0===f?null:f,v=r.embedType,m=void 0===v?null:v,p=r.embedFrom,h=void 0===p?null:p,b=r.videoIdList,g=void 0===b?null:b;y="v".concat(Object(a["b"])());t.id=y;k.next=5;return n.setDOM({domId:y,videoId:i,uniqueId:u,musicId:l,tagId:d,embedType:m,embedFrom:h,videoIdList:g});case 5:case"end":return k.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 32:p=true;w.next=28;break;case 35:w.next=41;break;case 37:w.prev=37;w.t1=w["catch"](26);h=true;b=w.t1;case 41:w.prev=41;w.prev=42;if(!p&&null!=g.return)g.return();case 44:w.prev=44;if(!h){w.next=47;break}throw b;case 47:return w.finish(44);case 48:return w.finish(41);case 49:case"end":return w.stop()}}),e,this,[[6,10,14,22],[15,,17,21],[26,37,41,49],[42,,44,48]])})));return function t(n){return e.apply(this,arguments)}}()},{key:"setDOM",value:function(){var e=m(regeneratorRuntime.mark((function e(t){var n=this;var r,o,i,a,c,u,s,l;return regeneratorRuntime.wrap((function e(f){while(1)switch(f.prev=f.next){case 0:r=t.domId,o=t.videoId,i=t.uniqueId,a=t.musicId,c=t.tagId,u=t.embedType,s=t.embedFrom,l=t.videoIdList;return f.abrupt("return",new Promise((function(e){var t=document.getElementById(r);var f=document.createDocumentFragment();var d=document.createElement("iframe");d.style.width=0;d.style.height=0;d.style.display="none";d.style.visibility="hidden";d.name=n.genSignalSource(r);d.sandbox="allow-popups allow-popups-to-escape-sandbox allow-scripts allow-top-navigation allow-same-origin";var v=n.getEmbedUrl(u,i,o,a,c);var m=n.getQueryStr(n.lang,s,u,l);d.src="".concat(v).concat(m);d.onload=function(){n.renderIframe(d);e(r)};f.appendChild(d);t.appendChild(f)})));case 2:case"end":return f.stop()}}),e)})));return function t(n){return e.apply(this,arguments)}}()},{key:"getEmbedUrl",value:function e(t,n,r,o,a){var c="";if(t===i["a"].CREATOR&&n)c="".concat(i["o"],"/embed/@").concat(n);else if(t===i["a"].TAG&&a)c="".concat(i["o"],"/embed/tag/").concat(a);else if(t===i["a"].MUSIC&&o)c="".concat(i["o"],"/embed/music/").concat(o);else if(t===i["a"].TRENDING)c="".concat(i["o"],"/embed/trending");else if(t===i["a"].CURATED)c="".concat(i["o"],"/embed/curated");else if(t===i["a"].VIDEO||null===t)c="".concat(i["o"],"/embed/v2/").concat(r);return c}},{key:"getQueryStr",value:function e(n,r,o,a){var c="";if(n)c="?lang=".concat(n);var u;try{u=t.top.location.href}catch(l){u=t.location.href}u=encodeURIComponent(u);if(u)c=c.length?"".concat(c,"&referrer=").concat(u):"?referrer=".concat(u);if(r)c=c.length?"".concat(c,"&embedFrom=").concat(r):"?embedFrom=".concat(r);if(o===i["a"].CURATED&&""!==a){var s=new URLSearchParams;s.append("videoIds",a);c=c.length?"".concat(c,"&").concat(s.toString()):"?".concat(s.toString())}return c}},{key:"genSignalSource",value:function e(t){return"".concat(i["k"]).concat(t)}},{key:"getSignalId",value:function e(t){var n=new RegExp("".concat(i["k"],"(\\w+)"));var r=n.exec(t)||[],o=c(r,2),a=o[0],u=o[1];return u}},{key:"renderIframe",value:function e(t){var n=t.parentNode.firstElementChild;t.parentNode.removeChild(n);t.style.width="100%";t.style.height="100%";t.style.display="block";t.style.visibility="unset"}},{key:"resizeIframeHeight",value:function e(t,n){if(!t||!n)return false;var r=document.documentElement.clientHeight;var o=n>r;if(o){t.style.height="".concat(n,"px");t.style.maxHeight=""}else{t.style.height="".concat(n,"px");t.style.maxHeight="".concat(n,"px")}}},{key:"receiveMessage",value:function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var r=n.origin,o=void 0===r?"":r,a=n.data,c=void 0===a?"{}":a;var u=o===i["o"];if(!u)return false;var s={};try{s=JSON.parse(c)}catch(w){s={}}var l=s,f=l.signalSource,d=void 0===f?"":f,v=l.height,m=l.link;var p=-1!==d.indexOf(i["k"]);if(!p)return false;if(v){var h=this.getSignalId(d);var b=document.querySelector("#".concat(h," > iframe"));this.resizeIframeHeight(b,v)}else if(m){var g=function e(){try{return t.self!==t.top}catch(n){return true}};var y=document.createElement("a");y.href=m;var k=0===String(m).toLowerCase().indexOf("http");y.target=g()&&k?"_blank":"_top";y.click()}}},{key:"addPreConnectInstruction",value:function e(t){var n=document.createElement("link");n.rel="preconnect";n.href=t;n.crossOrigin="";document.head.appendChild(n)}},{key:"lang",get:function e(){var t=Object(a["c"])("hl")||Object(a["c"])("lang");var n="";try{n=navigator.language||navigator.userLanguage}catch(r){n=""}return t||n}}]);return e}();var u=new o;n[i["j"]]={lib:u,isEventsInit:false};u.init()})(window)},e0b8897ffbf48a102fbb:function(e,t,n){"use strict";n.d(t,"b",(function(){return u}));n.d(t,"c",(function(){return s}));n.d(t,"d",(function(){return l}));n.d(t,"f",(function(){return f}));n.d(t,"e",(function(){return d}));n.d(t,"o",(function(){return v}));n.d(t,"l",(function(){return m}));n.d(t,"j",(function(){return p}));n.d(t,"i",(function(){return h}));n.d(t,"m",(function(){return b}));n.d(t,"k",(function(){return g}));n.d(t,"g",(function(){return y}));n.d(t,"h",(function(){return k}));n.d(t,"a",(function(){return w}));n.d(t,"n",(function(){return S}));var r="production"!=="production";var o="SG"==="TTP";var i="SG"==="VA";var a=o?"https://lf16-tiktok-web.tiktokcdn-us.com":"https://lf16-tiktok-web.ttwstatic.com";var c=o?"/obj/tiktok-web-tx/tiktok/falcon/embed":i?"/obj/tiktok-web-us/tiktok/falcon/embed":"/obj/tiktok-web/tiktok/falcon/embed";var u=r?"http://127.0.0.1:4000":"".concat(a).concat(c);var s="ttEmbedLibCSS";var l="ttEmbedLibScript";var f="embed_lib_v";var d=n("40b8419e3e2132ef0a63").version;var v="https://www.tiktok.com";var m="blockquote";var p="tiktokEmbed";var h="tiktok-embed";var b="message";var g="__tt_embed__";var y="mounting";var k="newmount";var w=Object.freeze({CREATOR:"creator",VIDEO:"video",TAG:"tag",MUSIC:"music",TRENDING:"trending",CURATED:"curated"});var S={TTP:["https://www.tiktok.com","https://lf16-tiktok-common.tiktokcdn-us.com","https://vmweb.us.tiktok.com"],VA:["https://www.tiktok.com","https://lf16-tiktok-common.ttwstatic.com","https://vmweb-va.byteoversea.com"],SG:["https://www.tiktok.com","https://lf16-tiktok-common.ttwstatic.com","https://vmweb-sg.byteoversea.com"],Default:["https://www.tiktok.com","https://lf16-tiktok-common.tiktokcdn-us.com","https://vmweb.us.tiktok.com"]}}});