1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8085],{91948:(e,t,o)=>{o.r(t),o.d(t,{default:()=>v});var s=o(14232);let i=/tiktok\.com\/(?:player\/v1\/|share\/video\/|@[^/]+\/video\/)([0-9]+)/,r={[-1]:"emptied",2:"pause",0:"ended",1:"play",3:"waiting"};function n(e,t={}){let o={src:a(e,t),frameborder:0,width:"100%",height:"100%",allow:"accelerometer; autoplay; fullscreen; encrypted-media; gyroscope; picture-in-picture"};return t.config&&(o["data-config"]=JSON.stringify(t.config)),` 2 <style> 3 :host { 4 display:inline-block; 5 min-width: 300px; 6 min-height: 150px; 7 position: relative; 8 } 9 iframe { 10 position:absolute; 11 top:0; 12 left:0; 13 width:100%; 14 height:100%; 15 border:0; 16 } 17 </style> 18 <iframe ${function(e){let t="";for(let o in e){let s=e[o];""===s?t+=` ${d(o)}`:t+=` ${d(o)}="${d(`${s}`)}"`}return t}(o)} title="TikTok video"></iframe> 19 `}function a(e,t={}){if(!e.src)return;let o=e.src.match(i),s=o&&o[1],r={controls:""===e.controls?null:0,autoplay:e.autoplay,muted:e.muted,loop:e.loop,rel:0,...t.config};return`https://www.tiktok.com/player/v1/${s}?${String(new URLSearchParams(function(e){let t={};for(let o in e){let s=e[o];!0===s||""===s?t[o]=1:!1===s?t[o]=0:null!=s&&(t[o]=s)}return t}(r)))}`}class l extends(globalThis.HTMLElement??class{}){static getTemplateHTML=n;static shadowRootOptions={mode:"open"};static get observedAttributes(){return["src","controls","loop","autoplay","muted"]}loadComplete=new u;#e;#t;#o=!1;#s=0;#i=!0;#r=null;#n=100;#a=0;#l;constructor(){super(),this.#u("config")}async load(){if(this.#e)return;this.shadowRoot||this.attachShadow(l.shadowRootOptions);let e=!this.#t;if(this.#t&&(this.loadComplete=new u),this.#t=!0,await (this.#e=Promise.resolve()),this.#e=null,this.#s=0,this.#o=!1,this.#i=!0,!this.src){this.shadowRoot.innerHTML="",globalThis.removeEventListener("message",this.#d);return}let t=this.shadowRoot.querySelector("iframe"),o=function(e){let t={};for(let o of e)t[o.name]=o.value;return t}(this.attributes);e&&t&&(this.#r=JSON.parse(t.getAttribute("data-config")||"{}")),(null==t?void 0:t.src)&&t.src===a(o,this)||(this.shadowRoot.innerHTML=n(o,this),t=this.shadowRoot.querySelector("iframe")),this.#l=t,globalThis.addEventListener("message",this.#d)}async attributeChangedCallback(e,t,o){if(t!==o)switch(e){case"muted":await this.loadComplete,this.muted=null!=o;break;case"autoplay":case"controls":case"loop":case"src":return void this.load()}}get config(){return this.#r}set config(e){this.#r=e}#d=e=>{var t;if(e.source!==(null==(t=this.#l)?void 0:t.contentWindow))return;let o=e.data;if(null==o?void 0:o["x-tiktok-player"])switch(o.type){case"onPlayerReady":this.loadComplete.resolve();break;case"onStateChange":{this.#i=[-1,2,0].includes(o.value);let e=r[o.value];e&&this.dispatchEvent(new Event(e));break}case"onCurrentTime":this.#s=o.value.currentTime,this.#a=o.value.duration,this.dispatchEvent(new Event("durationchange")),this.dispatchEvent(new Event("timeupdate"));break;case"onVolumeChange":this.#n=o.value,this.dispatchEvent(new Event("volumechange"));break;case"onMute":this.#o=!!o.value,this.#n=o.value?0:this.#n,this.dispatchEvent(new Event("volumechange"));break;case"onError":this.dispatchEvent(new Event("error"));break;default:console.warn("Unhandled TikTok player message:",o)}};#c(e,t){var o;if(!(null==(o=this.#l)?void 0:o.contentWindow))return;let s={"x-tiktok-player":!0,type:e,...void 0!==t?{value:t}:{}};this.#l.contentWindow.postMessage(s,"*")}async play(){await this.loadComplete,this.#c("play")}async pause(){await this.loadComplete,this.#c("pause")}async #h(e){await this.loadComplete,this.#c("seekTo",Number(e))}async #p(){await this.loadComplete,this.#c("mute")}async #m(){await this.loadComplete,this.#c("unMute")}get volume(){return this.#n/100}set volume(e){console.warn("Volume control is not supported for TikTok videos.")}get currentTime(){return this.#s}set currentTime(e){this.#h(e)}get muted(){return this.#o}set muted(e){this.#o=e,e?this.#p():this.#m()}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(e){this.toggleAttribute("muted",!!e)}get paused(){return this.#i}get duration(){return this.#a}get src(){return this.getAttribute("src")}set src(e){this.setAttribute("src",e??"")}#u(e){if(Object.prototype.hasOwnProperty.call(this,e)){let t=this[e];delete this[e],this[e]=t}}}class u extends Promise{constructor(e=()=>{}){let t,o;super((s,i)=>{e(s,i),t=s,o=i}),this.resolve=t,this.reject=o}}function d(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/`/g,"`")}globalThis.customElements&&!globalThis.customElements.get("tiktok-video")&&globalThis.customElements.define("tiktok-video",l);var c=new Set(["style","children","ref","key","suppressContentEditableWarning","suppressHydrationWarning","dangerouslySetInnerHTML"]),h={className:"class",htmlFor:"for"};function p(e){return e.toLowerCase()}function m(e){return"boolean"==typeof e?e?"":void 0:"function"==typeof e?void 0:"object"!=typeof e||null===e?e:void 0}function f(e,t,o){var s;e[t]=o,null==o&&t in((null==(s=globalThis.HTMLElement)?void 0:s.prototype)??{})&&e.removeAttribute(t)}var v=function({react:e,tagName:t,elementClass:o,events:s,displayName:i,defaultProps:r,toAttributeName:n=p,toAttributeValue:a=m}){let l=Number.parseInt(e.version)>=19,u=e.forwardRef((i,u)=>{var d,p;let v=e.useRef(null),g=e.useRef(new Map),w={},y={},b={},k={};for(let[e,t]of Object.entries(i)){if(c.has(e)){b[e]=t;continue}let s=n(h[e]??e);if(o.prototype&&e in o.prototype&&!(e in((null==(d=globalThis.HTMLElement)?void 0:d.prototype)??{}))&&!(null==(p=o.observedAttributes)?void 0:p.some(e=>e===s))){k[e]=t;continue}if(e.startsWith("on")){w[e]=t;continue}let i=a(t);s&&null!=i&&(y[s]=String(i),l||(b[s]=i)),s&&l&&(i!==m(t)?b[s]=i:b[s]=t)}if("u">typeof window){for(let t in w){let o=w[t],i=t.endsWith("Capture"),r=((null==s?void 0:s[t])??t.slice(2).toLowerCase()).slice(0,i?-7:void 0);e.useLayoutEffect(()=>{let e=null==v?void 0:v.current;if(e&&"function"==typeof o)return e.addEventListener(r,o,i),()=>{e.removeEventListener(r,o,i)}},[null==v?void 0:v.current,o])}e.useLayoutEffect(()=>{if(null===v.current)return;let e=new Map;for(let t in k)f(v.current,t,k[t]),g.current.delete(t),e.set(t,k[t]);for(let[e,t]of g.current)f(v.current,e,void 0);g.current=e})}if("u"<typeof window&&(null==o?void 0:o.getTemplateHTML)&&(null==o?void 0:o.shadowRootOptions)){let{mode:t,delegatesFocus:s}=o.shadowRootOptions;b.children=[e.createElement("template",{shadowrootmode:t,shadowrootdelegatesfocus:s,dangerouslySetInnerHTML:{__html:o.getTemplateHTML(y,i)},key:"ce-la-react-ssr-template-shadow-root"}),b.children]}return e.createElement(t,{...r,...b,ref:e.useCallback(e=>{v.current=e,"function"==typeof u?u(e):null!==u&&(u.current=e)},[u])},b.children)});return u.displayName=i??o.name,u}({react:s,tagName:"tiktok-video",elementClass:l,toAttributeName:e=>"muted"===e?"":"defaultMuted"===e?"muted":p(e)})}}]);
20//# sourceMappingURL=reactPlayerTiktok.6169f092e5522672.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.