PageSourceSearch

https://www.brit.co/static/dist/social-ux/8945.d40eda070207ef7bf226.bundle.mjs

js brit.co collected 2026-09-24 08:28:49 UTC 5,444 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunksocialUX=self.webpackChunksocialUX||[]).push([[8945],{8945:function(n,t,o){function e(n){const t=n.querySelector(':scope > script[type="application/rmprops+json"]');return t&&t.textContent?JSON.parse(t.textContent):null}function s(n){const t=function(n){const t=n.querySelectorAll(".rm-component");return Array.from(t).filter((function(t){const o=t.parentElement.closest(".rm-component");return t.parentElement.closest(".rm-slot")===n&&(null===o||o.closest(".rm-slot")!==n)}))}(n);return{__dom__:n,name:n.dataset.slotName,loading:n.getAttribute("loading"),components:t.map(r)}}function r(n){const t=function(n){const t=n.dataset.nodeId,o=n.querySelectorAll(".rm-slot");return Array.from(o).filter((function(n){return n.dataset.componentId===t}))}(n),o=function(n){const t=n.querySelectorAll(".rm-component"),o=n.dataset.nodeId;return Array.from(t).filter((function(n){const t=n.parentElement.closest(".rm-component"),e=n.parentElement.closest(".rm-slot"),s=t&&t.dataset.nodeId===o,r=e&&e.dataset.componentId===o;return s&&!r}))}(n);return{__dom__:n,id:n.dataset.nodeId,loading:n.getAttribute("loading"),name:n.dataset.name,skin:n.dataset.skin,props:e(n),slots:t.map(s),childComponents:o.map(r)}}function c(n,t){function o(n){for(const s of n){if(s.id===t)return s;const n=e(s.slots);if(n)return n;const r=o(s.childComponents);if(r)return r}return null}function e(n){for(const t of n){const n=o(t.components);if(n)return n}return null}return o(n)}function i(n,t,o){const e=c(n,t);return e&&e.slots.find((function(n){return n.name===o}))||null}function u(n,t){function o(n,s,r,c){for(let i=0;i<n.length;i++){const u=n[i];if(u.id===t)return{parent:s,parentType:r,collection:c,index:i};const l=e(u.slots);if(l)return l;const m=o(u.childComponents,u,"childComponents",u.childComponents);if(m)return m}return null}function e(n,t){for(const t of n){const n=o(t.components,t,"slotComponents",t.components);if(n)return n}return null}return o(n,null,"root",n)}function l(n,t){const o=n.createElement("template");return o.innerHTML=t.trim(),o.content}function m(n){return Array.from(n.children)}function a(n,t){for(;n.firstChild;)n.removeChild(n.firstChild);t.forEach((function(t){n.appendChild(t)}))}o.r(t),o.d(t,{initializeChannel:function(){return _}});const p="component-dom",d={REQUEST_TREE:"request-tree",DOM_UPDATED:"dom-updated",UPDATE_COMPONENT:"update-component",UPDATE_SLOT:"update-slot",DELETE_COMPONENT:"delete-component",REPLACE_COMPONENT:"replace-component",INSERT_IN_SLOT:"insert-in-slot",OPERATION_RESULT:"operation-result"};function f(n){return Array.isArray(n)?n.map(f):null!==n&&"object"==typeof n?Object.keys(n).reduce((function(t,o){return o.startsWith("__")||(t[o]=f(n[o])),t}),{}):n}function _(n){const t=new BroadcastChannel(p);let o=null;function e(n,o){t.postMessage({type:n,payload:o})}function _(){const n=f(o);e(d.DOM_UPDATED,n)}function E(n,t){e(d.OPERATION_RESULT,{operationId:n,result:f(t)})}function C(){o=function(n){const t=function(n){const t=n.querySelectorAll(".rm-component");return Array.from(t).filter((function(n){return null===n.parentElement.closest(".rm-component")}))}(n);return t.map(r)}(n),_()}function h(t){const e=function(n,t,o,e){const s=c(t,o);if(!s)return{success:!1,error:"Component not found"};const i=m(l(n,e));a(s.__dom__,i);const u=r(s.__dom__);return s.loading=u.loading,s.name=u.name,s.skin=u.skin,s.props=u.props,s.slots=u.slots,s.childComponents=u.childComponents,{success:!0,component:s}}(n,o,t.componentId,t.htmlContent);E(t.operationId,e),e.success&&_()}function T(t){const e=function(n,t,o,e,r){const c=i(t,o,e);if(!c)return{success:!1,error:"Slot not found"};const u=m(l(n,r));a(c.__dom__,u);const p=s(c.__dom__);return c.loading=p.loading,c.components=p.components,{success:!0,slot:c}}(n,o,t.componentId,t.slotName,t.htmlContent);E(t.operationId,e),e.success&&_()}function O(n){const t=function(n,t){const o=u(n,t);if(!o)return{success:!1,error:"Component not found"};const e=o.collection[o.index];return e.__dom__.parentElement.removeChild(e.__dom__),o.collection.splice(o.index,1),{success:!0}}(o,n.componentId);E(n.operationId,t),t.success&&_()}function A(t){const e=function(n,t,o,e){const s=u(t,o);if(!s)return{success:!1,error:"Component not found"};const c=s.collection[s.index],i=m(l(n,e)),a=c.__dom__.parentElement,p=c.__dom__.nextSibling;a.removeChild(c.__dom__);const d=[];
1return i.forEach((function(n){a.insertBefore(n,p),n.classList&&n.classList.contains("rm-component")&&d.push(r(n))})),s.collection.splice(s.index,1,...d),{success:!0,newComponents:d}}(n,o,t.componentId,t.htmlContent);E(t.operationId,e),e.success&&_()}function I(t){const e=function(n,t,o,e,s,c){const u=i(t,o,e);if(!u)return{success:!1,error:"Slot not found"};const a=m(l(n,s)),p="start"===c?0:u.components.length,d="start"===c?u.__dom__.firstChild:null,f=[];return a.forEach((function(n){"start"===c?u.__dom__.insertBefore(n,d):u.__dom__.appendChild(n),n.classList&&n.classList.contains("rm-component")&&f.push(r(n))})),u.components.splice(p,0,...f),{success:!0,newComponents:f}}(n,o,t.componentId,t.slotName,t.htmlContent,t.position);E(t.operationId,e),e.success&&_()}return t.onmessage=function(n){const t=n.data.type,o=n.data.payload,e={[d.REQUEST_TREE]:C,[d.UPDATE_COMPONENT]:h,[d.UPDATE_SLOT]:T,[d.DELETE_COMPONENT]:O,[d.REPLACE_COMPONENT]:A,[d.INSERT_IN_SLOT]:I}[t];e&&e(o)},function(){t.close()}}}}]);
2//# sourceMappingURL=8945.d40eda070207ef7bf226.bundle.mjs.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.