Plugin Directory

Changeset 3822693


Ignore:
Timestamp:
11/25/2026 11:45:08 AM (less than one hour ago)
Author:
timohubois
Message:

Update to version 1.3.1 from GitHub

Location:
meet-the-frontend-live-preview-panel
Files:
30 edited
1 copied

Legend:

Unmodified
Added
Removed
  • meet-the-frontend-live-preview-panel/tags/1.3.1/build/block-editor.asset.php

    r3820590 r3822693  
    1111                'wp-primitives'
    1212        ),
    13         'version' => '99b5df4c766150ddf1d2'
     13        'version' => '76857201684d45d9b029'
    1414);
  • meet-the-frontend-live-preview-panel/tags/1.3.1/build/block-editor.js

    r3820590 r3822693  
    1 (()=>{"use strict";const e=window.wp.element,t=window.wp.apiFetch,n=window.wp.data,o=window.wp.hooks,r="meet-the-frontend-live-preview-panel",i=/^[a-f0-9]{64}$/,a=window.wp.preferences,s=window.wp.components,l=window.wp.notices,c=window.wp.primitives,d=window.ReactJSXRuntime,u={refresh:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M12 5.5L17.7929 11.2929C18.1834 11.6834 18.1834 12.3166 17.7929 12.7071L16 14.5M16 5.5H12V9.5M12 18.5L6.20711 12.7071C5.81658 12.3166 5.81658 11.6834 6.20711 11.2929L8 9.5M8 18.5H12V14.5"})}),more:(0,d.jsxs)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,d.jsx)(c.Path,{d:"M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z",fill:"currentColor",stroke:"none"}),(0,d.jsx)(c.Path,{d:"M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z",fill:"currentColor",stroke:"none"}),(0,d.jsx)(c.Path,{d:"M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z",fill:"currentColor",stroke:"none"}),(0,d.jsx)(c.Path,{d:"M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z"}),(0,d.jsx)(c.Path,{d:"M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z"}),(0,d.jsx)(c.Path,{d:"M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z"})]}),expand:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M4.75 10V4.75H10M4.75 4.75L10 10M14 19.25H19.25V14M19.25 19.25L14 14"})}),compact:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M10 4.75V10H4.75M10 10L4.75 4.75M19.25 14H14V19.25M14 14L19.25 19.25"})}),pip:(0,d.jsxs)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,d.jsx)(c.Path,{d:"M4.75 9.25V16C4.75 16.6904 5.30964 17.25 6 17.25H8M4.75 9.25V6C4.75 5.30964 5.30964 4.75 6 4.75H16C16.6904 4.75 17.25 5.30964 17.25 6V8M4.75 9.25H8"}),(0,d.jsx)(c.Path,{d:"M10.75 11.25C10.75 10.9739 10.9739 10.75 11.25 10.75H18.75C19.0261 10.75 19.25 10.9739 19.25 11.25V18.75C19.25 19.0261 19.0261 19.25 18.75 19.25H11.25C10.9739 19.25 10.75 19.0261 10.75 18.75V11.25Z",fill:"currentColor"})]}),move:(0,d.jsxs)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,d.jsx)(c.Path,{d:"M9.25 5.75H8.75V6.25H9.25V5.75Z",fill:"currentColor",stroke:"none"}),(0,d.jsx)(c.Path,{d:"M9.25 11.75H8.75V12.25H9.25V11.75Z",fill:"currentColor",stroke:"none"}),(0,d.jsx)(c.Path,{d:"M9.25 17.75H8.75V18.25H9.25V17.75Z",fill:"currentColor",stroke:"none"}),(0,d.jsx)(c.Path,{d:"M15.25 5.75H14.75V6.25H15.25V5.75Z",fill:"currentColor",stroke:"none"}),(0,d.jsx)(c.Path,{d:"M15.25 11.75H14.75V12.25H15.25V11.75Z",fill:"currentColor",stroke:"none"}),(0,d.jsx)(c.Path,{d:"M15.25 17.75H14.75V18.25H15.25V17.75Z",fill:"currentColor",stroke:"none"}),(0,d.jsx)(c.Path,{d:"M9.25 5.75H8.75V6.25H9.25V5.75Z"}),(0,d.jsx)(c.Path,{d:"M9.25 11.75H8.75V12.25H9.25V11.75Z"}),(0,d.jsx)(c.Path,{d:"M9.25 17.75H8.75V18.25H9.25V17.75Z"}),(0,d.jsx)(c.Path,{d:"M15.25 5.75H14.75V6.25H15.25V5.75Z"}),(0,d.jsx)(c.Path,{d:"M15.25 11.75H14.75V12.25H15.25V11.75Z"}),(0,d.jsx)(c.Path,{d:"M15.25 17.75H14.75V18.25H15.25V17.75Z"})]}),warning:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M12 8L12 13M12 14.5L12 16M4.75 12C4.75 7.99593 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12Z",strokeLinejoin:"round"})}),info:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M12 16V11M12 9.5V8M19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12C4.75 7.99594 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12Z",strokeLinejoin:"round"})}),close:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M7.75 16.25L16.25 7.75M16.25 16.25L7.75 7.75"})}),check:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M7 12L10 15L17 8"})}),chevron:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M7 11L12 15L17 11"})}),desktop:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M4.75 16.75V17H3.25C3.11193 17 3 17.1119 3 17.25H21C21 17.1119 20.8881 17 20.75 17H19.25V16.75M4.75 16.75V8.5C4.75 7.80964 5.30964 7.25 6 7.25H18C18.6904 7.25 19.25 7.80964 19.25 8.5V16.75M4.75 16.75H19.25"})}),tablet:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M10 16.5H14M18.25 18V6C18.25 5.30964 17.6904 4.75 17 4.75H7C6.30964 4.75 5.75 5.30964 5.75 6L5.75 18C5.75 18.6904 6.30964 19.25 7 19.25H17C17.6904 19.25 18.25 18.6904 18.25 18Z"})}),mobile:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M11 16.5H13M16.25 18V6C16.25 5.30964 15.6904 4.75 15 4.75H9C8.30964 4.75 7.75 5.30964 7.75 6L7.75 18C7.75 18.6904 8.30964 19.25 9 19.25H15C15.6904 19.25 16.25 18.6904 16.25 18Z"})})};function f(e,t,n="right"){const o=e&&!Array.isArray(e)&&e.bounds&&["x","y","width","height"].every(t=>Number.isFinite(e.bounds[t]))&&e.bounds.width>0&&e.bounds.height>0&&[null,"left","center","right"].includes(e.dock)&&"boolean"==typeof e.expanded&&(void 0===e.anchor||["left","center","right"].includes(e.anchor));let r=!!o&&e.expanded;const i={width:480,height:393},a=o?{...e.bounds}:{x:0,y:0,...i};let s=o?e.dock:n,l=s||o&&e.anchor||"right";function c(){return"left"===l?0:"center"===l?.5:1}function d(e,n=t(!s),o=320,r=220){return e.width=Math.min(n.width,Math.max(Math.min(o,n.width),e.width)),e.height=Math.min(n.height,Math.max(Math.min(r,n.height),e.height)),e.x=Math.max(n.left,Math.min(n.right-e.width,e.x)),e.y=Math.max(n.top,Math.min(n.bottom-e.height,e.y)),e}function u(e){if(!s)return e;const n=t();return e.x="left"===s?n.left:"center"===s?n.left+(n.width-e.width)/2:n.right-e.width,e.y=n.bottom-e.height,e}return{area:t,compactRect:function(){return u(d({...a}))},launcherRect:function(e){return u(d({...e,x:a.x+(a.width-e.width)*c(),y:a.y+a.height-e.height},t(!s),1,1))},usableEdge:function(e){return!(s&&(e.includes("s")||"left"===s&&e.includes("w")||"right"===s&&e.includes("e")))},get anchor(){return l},get anchorFactor(){return c()},get dock(){return s},get expanded(){return r},get layout(){return{bounds:{...a},dock:s,anchor:l,expanded:r}},toggleExpanded(){r=!r},dockTo:function(e="right",t=!1){t&&Object.assign(a,i),r=!1,l=s=e},resize(e,n,o,r){Object.assign(a,function(e,n,o,r){const i=t(!s),a=n.includes("e")||n.includes("w"),c=n.includes("n")||n.includes("s"),d=function(e){return"center"===l?.5:e.includes("w")?1:0}(n),u=e.x+e.width*d,f=n.includes("n"),p=e.y+(f?e.height:0),m=function(e,t,n){return 0===n?e.right-t:1===n?t-e.left:2*Math.min(t-e.left,e.right-t)}(i,u,d),h=f?p-i.top:i.bottom-p,g=(n.includes("w")?-o:o)*(.5===d?2:1),w=Math.max(Math.min(320,m),Math.min(m,e.width+g)),v=Math.max(Math.min(220,h),Math.min(h,e.height+(f?-r:r))),y=a&&0!==o&&w!==e.width,b=c&&0!==r&&v!==e.height,x=f?p-v:p;return{x:y?u-w*d:e.preferredBounds.x,y:b?x:e.preferredBounds.y,width:y?w:e.preferredBounds.width,height:b?v:e.preferredBounds.height}}(e,n,o,r))},move:function(e,n,o,r=!1){const i=d({...e,x:e.x+n,y:e.y+o},t(!0),r?1:320,r?1:220);a.x=i.x+(r?(i.width-a.width)*c():0),a.y=i.y+(r?i.height-a.height:0),s=null}}}function p(t,{postTitle:o="",publicRedirect:r,inlineLauncher:i,nativeLauncher:c,canRememberVisibility:d=!0,onOpen:p,onClose:m,onRefresh:h,onRetry:g,beforeMove:w,afterMove:v,beforeViewportChange:y}){const b=window,x=document,P="meet-the-frontend-live-preview-panel",M=(0,n.select)(a.store),E=(0,n.dispatch)(a.store),k="width"===M.get(P,"fit")?"width":"automatic";E.setDefaults(P,{rememberVisibility:!0,rememberPosition:!0,panelOpen:!0,scrollToChanges:!0,viewport:"desktop",fitMode:k,customZoom:100,tabletOrientation:"portrait",mobileOrientation:"portrait"});const C=()=>!i&&(!c||c.fallbackMedia.matches);let S=!1!==M.get(P,"rememberVisibility"),L=!1!==M.get(P,"rememberPosition"),T=!1!==M.get(P,"scrollToChanges");const V=i?.parentElement??x.getElementById("mtflpp-toggle"),O=x.getElementById("mtflpp-panel");if(!V||!O)throw new Error("Preview panel markup is missing.");const j=i||function(t){let n;const{title:o,moveHelp:r}=t.dataset;return(0,e.flushSync)(()=>(0,e.createRoot)(t).render((0,e.createElement)(s.Button,{ref:e=>{n=e},variant:"secondary",label:o,title:o,description:r,"aria-controls":"mtflpp-panel","aria-expanded":!1},(0,e.createElement)("span",{className:"mtflpp-launcher-label"},o)))),n}(V),R=O.querySelector(".mtflpp-move-control"),A=O.querySelector(".mtflpp-resize"),H=O.querySelectorAll("[data-resize-edge]"),_=O.querySelector(".mtflpp-header"),F=O.querySelector(".mtflpp-caption"),N=O.querySelector(".mtflpp-viewport"),$=O.querySelector(".mtflpp-canvas"),D=O.querySelector(".mtflpp-stage"),B=O.querySelector(".mtflpp-empty"),q=O.querySelector(".mtflpp-devicebar"),W=O.querySelector(".mtflpp-dimensions"),I=O.querySelector(".mtflpp-feedback"),z=O.querySelector('[role="status"]');let Z;const J=function(e,t,n,o={},r=()=>{},i={desktop:"Desktop",tablet:"Tablet",mobile:"Phone"}){const a=e.ownerDocument.defaultView,s=e.querySelector(".mtflpp-canvas"),l=e.querySelector(".mtflpp-canvas-space"),c=n.querySelector(".mtflpp-dimensions-text"),d={desktop:[1280,800],tablet:[768,1024],mobile:[390,844]},u=Object.keys(d);let f=u.includes(o.device)?o.device:"desktop";const p=["automatic","window","width","custom"];let m=p.includes(o.fit)?o.fit:"automatic";const h=e=>Number.isInteger(e)&&e>=10&&e<=400;let g,w=h(o.customZoom)?o.customZoom:100,v=100;const y=e=>"desktop"===e?"landscape":"portrait",b=Object.fromEntries(u.map(e=>[e,"desktop"!==e&&["portrait","landscape"].includes(o[`${e}Orientation`])?o[`${e}Orientation`]:y(e)])),x=()=>b[f]===y(f)?d[f]:[...d[f]].reverse(),P=()=>"width"===m;let M,E,k;const C=a.matchMedia("(prefers-reduced-motion: no-preference)");function S(){const t=e.ownerDocument.defaultView.devicePixelRatio;return Number.isFinite(t)&&t>0?t:1}function L(e,t){if("custom"===m)return w/100/S();const n=s.clientWidth/e;if(P())return n;const o=Math.min(n,s.clientHeight/t);return"automatic"===m?Math.min(1/S(),o):o}function T(e,n){M=e;const[o,r]=x(),i=Math.max(0,(s.clientWidth-o*M)/2),a=Math.max(0,(s.clientHeight-r*M)/2);Object.assign(l.style,{width:`${Math.max(s.clientWidth,i+o*M)}px`,height:`${Math.max(s.clientHeight,a+r*M)}px`}),Object.assign(t.style,{left:`${i}px`,top:`${a}px`,transform:`scale(${M})`});const c=o*M>s.clientWidth+.01||r*M>s.clientHeight+.01,d="custom"===m||P();s.tabIndex=d&&c?0:-1,s.scrollLeft="custom"===m?n.x*M:0,s.scrollTop=d?n.y*M:0}function V(){if(!E)return;const e=E;E=null,e.window.cancelAnimationFrame(e.frame),e.resolve?.()}function O(e,t,n,o){return t<=0||o&&e<-1&&t<n?Math.max(e,t-n):e>=n||o&&e>0&&t>n+1?Math.min(e,t-n):0}function j(o=!1,a=!1){V();const[l,d]=x();if(Object.assign(t.style,{width:`${l}px`,height:`${d}px`}),!e.clientWidth||!e.clientHeight)return;const u=S(),p=`${i[f]} (${l} × ${d}) · `,h=Math.max(400,Math.ceil(e.clientWidth/l*u*100)),y=`${p}${"0".repeat(String(h).length)}%`;n.dataset.reserve!==y&&(n.dataset.reserve=y);const b=a?{x:0,y:0}:{x:(s.scrollLeft||0)/(M||1),y:(s.scrollTop||0)/(M||1)};if(s.style.overflowX="hidden",s.style.overflowY="hidden","custom"===m){const e=L(l,d);for(let t=0;t<2;t++)l*e>s.clientWidth+.01&&(s.style.overflowX="scroll"),d*e>s.clientHeight+.01&&(s.style.overflowY="scroll")}else P()&&d*L(l,d)>e.clientHeight&&(s.style.overflowY="scroll");if(!s.clientWidth||!s.clientHeight)return;const k=L(l,d),O=Math.round(k*u*100),j=O!==v||u!==g;v=O,g=u;const R=`${p}${"custom"===m?w:v}%`;c.textContent!==R&&(c.textContent=R),j&&r();const A=M??k;if(!o||!C.matches||A===k)return void T(k,b);const H={window:e.ownerDocument.defaultView,frame:null},_=H.window.performance.now();E=H;const F=e=>{T(e,b),H.scrollLeft=s.scrollLeft,H.scrollTop=s.scrollTop};F(A);const N=e=>{if(E!==H)return;const t=Math.min(1,Math.max(0,(e-_)/200));F(A+(k-A)*(1-(1-t)**3)),t<1?H.frame=H.window.requestAnimationFrame(N):V()};H.frame=H.window.requestAnimationFrame(N)}function R(){j()}function A(){k?.();const t=e.ownerDocument.defaultView.matchMedia(`(resolution: ${S()}dppx)`);t.addEventListener("change",A),k=()=>t.removeEventListener("change",A),R()}let H=new a.ResizeObserver(R);return H.observe(e),C.addEventListener("change",R),a.addEventListener("resize",A),A(),{get device(){return f},get fit(){return m},get customZoom(){return w},get zoomPercent(){return"custom"===m?w:v},get dpr(){return S()},get orientation(){return b[f]},canvasTarget:function(e,t,{fitTarget:n=!1}={}){const o=e.getBoundingClientRect(),r=s.getBoundingClientRect(),i=o.left-r.left-s.clientLeft,a=o.top-r.top-s.clientTop,l=O(i+t.left*M,i+t.right*M,s.clientWidth,n),c=O(a+t.top*M,a+t.bottom*M,s.clientHeight,n),d=Math.max(t.left,-i/M),u=Math.min(t.right,(s.clientWidth-i)/M);return{visible:!l&&!c,visibleCenterX:d<u?(d+u)/2:void 0,distance:Math.hypot(l,c),reveal(e="instant"){(l||c)&&s.scrollBy({left:l,top:c,behavior:e})}}},canvasWasPanned:function(){return!!E&&(s.scrollLeft!==E.scrollLeft||s.scrollTop!==E.scrollTop)},whenSettled:function(){if(!E)return;const e=E;return e.done??=new Promise(t=>{e.resolve=t}),e.done},finishMotion(){E&&R()},select(e,{animate:t=!1,keepPan:n=!1}={}){if(!u.includes(e))return;const o=f!==e;f=e,o?j(t,!n):E||R()},rotate({animate:e=!1,keepPan:t=!1}={}){"desktop"!==f&&(b[f]="portrait"===b[f]?"landscape":"portrait",j(e,!t))},setFit(e){p.includes(e)&&m!==e&&(m=e,j(!1,!0))},setZoom(e){if(!h(e)||"custom"===m&&w===e)return;const t="custom"!==m;w=e,m="custom",j(!1,t)},layout:R,beforeMove(){V(),H.disconnect(),k?.(),e.ownerDocument.defaultView.removeEventListener("resize",A)},afterMove(){H=new e.ownerDocument.defaultView.ResizeObserver(R),H.observe(e),e.ownerDocument.defaultView.addEventListener("resize",A),A()}}}(N,D,W,{device:M.get(P,"viewport"),fit:M.get(P,"fitMode")??k,customZoom:M.get(P,"customZoom"),tabletOrientation:M.get(P,"tabletOrientation"),mobileOrientation:M.get(P,"mobileOrientation")},()=>Ce(),t),U=x.querySelector("#wpbody-content > .wrap"),G=x.getElementById("wpadminbar");function X(e=!1){const t=Math.max(1,x.documentElement.clientWidth),n=Math.max(1,x.documentElement.clientHeight),o=x.documentElement.getBoundingClientRect().left+b.scrollX,r=!e&&U?.getBoundingClientRect(),i=r?Math.max(0,"rtl"===b.getComputedStyle(U).direction?r.left-o:o+t-r.right):20,a=e?0:i,s=Math.min(a,(t-1)/2),l=Math.min(Math.max(0,G?.getBoundingClientRect().bottom||0)+a,n-1),c=t-s,d=n-Math.min(a,n-l-1);return{left:s,top:l,right:c,bottom:d,width:c-s,height:d-l}}let Y,K=d&&(!S||!1!==M.get(P,"panelOpen"));const Q=M.get(P,"layout"),ee=M.get(P,"position")??Q?.dock??Q?.anchor;let te=["left","center","right"].includes(ee)?ee:"right";const ne=f(L?Q:void 0,X,te),{compactRect:oe,usableEdge:re}=ne;let ie,ae=!1,se="",le=!1,ce={text:t.loading,state:"loading",hasPreview:!1,canRetry:!1,reason:""},de=!1;function ue(e){const n="string"==typeof e?e.replace(/\s+/g," ").trim():"";F.textContent=n?`${t.preview} — ${n}`:t.title,F.title=F.textContent,Y&&(Y.document.title=F.textContent)}function fe(){const{text:e,state:n,hasPreview:o,reason:r}=ce;return"handover"===n?{heading:t.switchingPreview,description:e,note:t.tabEdits}:"conflict"===n?{heading:e,description:{"handed-off":t.handedOffHelp,busy:t.takeoverTimeoutHelp,manual:t.closeOtherHelp}[r]||t.conflictHelp,note:"manual"===r?t.manualSwitchHint:t.tabEdits}:"paused"===n?{heading:t.pausedTitle,description:e,note:""}:"error"===n?function(){const{text:e,hasPreview:n,canRetry:o,reason:r}=ce;if("origin-mismatch"===r)return{heading:t.originMismatchTitle,description:n?`${e} ${t.previousPreview}`:e,note:""};if("unavailable"===r||"browser"===r)return{heading:"unavailable"===r?t.unavailableTitle:t.browserTitle,description:e,note:""};if(!n){let n=e;return e===t.failed&&(n=o?t.failedHelp:""),"reload"===r&&(n+=` ${t.reviewBeforeReload}`),{heading:t.failed,description:n,note:""}}return{heading:e===t.failed?t.refreshFailed:e,description:"reload"===r?t.reviewBeforeReload:t.previousPreview,note:""}}():o?{heading:e,description:"",note:""}:{heading:t.loading,description:t.preparing,note:""}}function pe(){return ae?"handover"===ce.state?t.takingOver:t.takeOver:t.retry}function me(e){return!e||["handover","paused"].includes(ce.state)?"info":"error"!==ce.state||ce.canRetry?"warning":"error"}function he(){return ce.redirectDestination?`${t.redirected} ${ce.redirectDestination}`:ce.hasHtmlPreview&&ie?`${t.publicRedirected} ${ie}`:""}function ge(){const{state:e,hasPreview:n,canRetry:o,reason:r}=ce,i=n&&["error","conflict","handover","paused"].includes(e),a=!n||i||se?"":he();if(I.hidden=!i&&!se&&!a,I.tabIndex=I.hidden?-1:0,O.dataset.hasFeedback=String(!I.hidden),I.hidden)return null;if(a)return{heading:a,status:"info",dismissible:!1};const{heading:s,description:l}=fe();return{heading:i?s:se,description:i?l:t.windowNoticeHelp,status:me(i),dismissible:!i,retry:i&&(ae||o&&["error","conflict"].includes(e)),close:i&&"error"===e&&!o&&"reload"!==r,disabled:"handover"===e,action:pe()}}function we(e){ce.hasPreview&&["error","conflict","handover","paused"].includes(ce.state)||(se=e,Ce()),z.textContent=`${e} ${t.windowNoticeHelp}`}function ve(){se="",Ce()}function ye(e,t="loading",{canTakeOver:n=!1,hasPreview:o=!1,hasHtmlPreview:i=!1,redirectDestination:a,canRefresh:s=!1,canRetry:l=!0,reason:c=""}={}){const d=O.ownerDocument.activeElement,u=O.contains(d),f=!o&&(ce.state!==t||ce.text!==e||ce.reason!==c),p=ce.hasPreview!==o;ce={text:e,state:t,canTakeOver:n,hasPreview:o,hasHtmlPreview:i,redirectDestination:a,canRefresh:s,canRetry:l,reason:c},["error","conflict","handover","paused"].includes(t)&&(se=""),O.dataset.state=t,O.dataset.hasPreview=String(o),ae=n&&["conflict","handover"].includes(t),B.hidden=o,q.hidden=!o;const{heading:m,description:h,note:g}=fe();f&&(B.scrollTop=0);const w="ready"!==t||se?"":he();z.textContent=o?[m,h,g,w].filter(Boolean).join(" "):m,Ce(),p&&J.layout(),function(e,t){e&&t&&(!O.contains(e)||e.closest("[hidden]")||e.disabled||!ce.hasPreview&&$.contains(e))&&Z.focus(B.hidden?"actions":"empty-title")}(d,u),K&&"ready"===t&&i&&!a&&async function(){if(r&&!le){le=!0;try{const e=new URL(r.endpoint);if(e.origin!==b.location.origin)return;const t=await b.fetch(e,{credentials:"same-origin",cache:"no-store",redirect:"error",headers:{"X-WP-Nonce":r.nonce}});if(!t.ok)return;const{destination:n}=await t.json();if("string"!=typeof n||!n)return;if(ie=n,!K)return;Ce(),"ready"!==ce.state||!ce.hasHtmlPreview||ce.redirectDestination||se||(z.textContent=he())}catch{}}}()}function be(e){d&&S&&M.get(P,"panelOpen")!==e&&E.set(P,"panelOpen",e)}function xe(){L&&E.set(P,"layout",ne.layout)}function Pe(){const e=V.hidden;V.hidden=!1,V.style.maxWidth=`${X(!ne.dock).width}px`;const t={width:V.offsetWidth,height:V.offsetHeight};return V.hidden=e,ne.launcherRect(t)}function Me(){if(Y)return;if(!K&&C()){const e=Pe(),t=ne.anchorFactor;Object.assign(V.style,{left:`${e.x+e.width*t}px`,top:`${e.y+e.height}px`,transform:`translate(${-100*t}%, -100%)`})}let e=oe();if(O.dataset.anchor=ne.anchor,ne.expanded){const t=X();e={x:t.left,y:t.top,width:t.width,height:t.height}}Object.assign(O.style,{left:`${e.x}px`,top:`${e.y}px`,width:`${e.width}px`,height:`${e.height}px`,transform:""})}function Ee(e="right",t=!1){ne.dockTo(e,t),te=e,E.set(P,"position",te),Me(),xe(),Ce()}function ke(){return"function"==typeof b.documentPictureInPicture?.requestWindow}function Ce(){if(!Z)return;const e=O.ownerDocument.fullscreenElement===O,n=!Y&&!e,o=n&&!ne.expanded;O.classList.toggle("mtflpp-expanded",ne.expanded),A.hidden=!o;for(const e of H)e.hidden=!o||!re(e.dataset.resizeEdge);const r=ae||ce.canRetry&&["error","conflict"].includes(ce.state);var i;Z.update({inPage:n,inPip:!!Y,movable:o,dock:ne.dock,canRememberVisibility:d,rememberVisibility:S,rememberPosition:L,followChanges:T,device:J.device,busy:ce.hasPreview&&["stale","loading","handover"].includes(ce.state)&&ce.text!==t.saving,empty:ce.hasPreview?null:{...fe(),busy:["loading","stale","ready","handover"].includes(ce.state),icon:["paused","conflict"].includes(ce.state)||["unavailable","browser","origin-mismatch"].includes(ce.reason)?"info":"warning",retry:r,disabled:"handover"===ce.state,close:"error"===ce.state&&!r,action:pe()},notice:ge(),fit:J.fit,orientation:J.orientation,customZoom:J.customZoom,zoomPercent:J.zoomPercent,dpr:J.dpr,canRefresh:ce.canRefresh,hasPreview:ce.hasPreview,canPip:n&&ke(),canFullscreen:n&&!!x.fullscreenEnabled,mode:e||ne.expanded?"compact":"expand",modeLabel:(i=e,i?t.exitFullscreen:ne.expanded?t.compact:t.expand)})}function Se(){Z.closeMenu(),Y?Y.close():x.fullscreenElement!==O?(ne.toggleExpanded(),Me(),xe(),Ce(),Z.focus("mode")):x.exitFullscreen().then(ve,()=>we(t.fullscreenFailed))}function Le(e,n=!1,o){const r=e===j,i=e===_,a=()=>o||("left"===ne.anchor?"ne":"nw"),s=()=>Y||!r&&ne.expanded||x.fullscreenElement===O||n&&!re(a());let l,c;const d=()=>({...r?Pe():oe(),preferredBounds:ne.layout.bounds});function u(){if(c=null,l)if(n||r)Me();else{const e=oe(),t=e.x-parseFloat(O.style.left),n=e.y-parseFloat(O.style.top);Object.assign(O.style,{width:`${e.width}px`,height:`${e.height}px`,transform:`translate3d(${t}px, ${n}px, 0)`})}}function f(){if(!l)return;const{pointer:t,moved:n}=l;l=null,b.cancelAnimationFrame(c),e.hasPointerCapture(t)&&e.releasePointerCapture(t),O.classList.remove("mtflpp-dragging"),e.classList.remove("mtflpp-edge-active"),x.documentElement.classList.remove("mtflpp-window-dragging"),x.documentElement.style.removeProperty("--mtflpp-drag-cursor"),Me(),n&&(r&&(de=!0),xe(),Ce())}e.addEventListener("pointerdown",t=>{0!==t.button||s()||i&&t.target.closest('button, a, [role="button"]')||(r&&(de=!1),t.preventDefault(),r?j.focus({preventScroll:!0}):e===R&&Z.focus("move"),Z.closeMenu(),l={...d(),pointer:t.pointerId,pointerX:t.clientX,pointerY:t.clientY},e.setPointerCapture(t.pointerId))}),e.addEventListener("pointermove",t=>{if(!l||l.pointer!==t.pointerId)return;const o=t.clientX-l.pointerX,i=t.clientY-l.pointerY;!l.moved&&Math.abs(o)+Math.abs(i)<4||(l.moved=!0,O.classList.add("mtflpp-dragging"),n&&e.classList.add("mtflpp-edge-active"),x.documentElement.style.setProperty("--mtflpp-drag-cursor",n?b.getComputedStyle(e).cursor:"grabbing"),x.documentElement.classList.add("mtflpp-window-dragging"),n?ne.resize(l,a(),o,i):ne.move(l,o,i,r),c||(c=b.requestAnimationFrame(u)))});for(const t of["pointerup","pointercancel","lostpointercapture"])e.addEventListener(t,f);b.addEventListener("blur",f),i||o||e.addEventListener("keydown",e=>{const o={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[e.key];if(!o||e.altKey||e.ctrlKey||e.metaKey||s())return;e.preventDefault(),Z.closeMenu();const i=d(),l=e.shiftKey?40:10;n?ne.resize(i,a(),o[0]*l,o[1]*l):ne.move(i,o[0]*l,o[1]*l,r),Me(),xe(),Ce();const c=oe();z.textContent=n?`${t.resize}: ${Math.round(c.width)} × ${Math.round(c.height)}`:t.moved})}ue(o),_.addEventListener("dblclick",e=>{Y||e.target.closest("button, a")||Se()}),x.addEventListener("fullscreenchange",Ce),A.addEventListener("keydown",e=>{"Escape"===e.key&&A.classList.add("mtflpp-help-dismissed")}),A.addEventListener("blur",()=>A.classList.remove("mtflpp-help-dismissed")),Le(R),Le(_),i||Le(j),Le(A,!0);for(const e of H)Le(e,!0,e.dataset.resizeEdge);function Te(){O.hidden=!K,V.hidden=!i&&(K||!C()),j.setAttribute("aria-expanded",String(K))}function Ve(e=!0){K?Z.focus("actions"):(be(!0),p(),K&&e&&Z.focus("actions"))}return b.addEventListener("resize",Me),b.addEventListener("scroll",Me,{passive:!0}),c?.fallbackMedia.addEventListener("change",()=>{Me(),Te()}),j.addEventListener("click",e=>{if(de&&0!==e.detail)return de=!1,void e.preventDefault();de=!1,Ve(0===e.detail)}),Z=function(t,o,r){const i=t.querySelector(".mtflpp-controls"),a=t.querySelector(".mtflpp-refresh-control"),c=t.querySelector(".mtflpp-move-control"),d=t.querySelector(".mtflpp-device-controls"),f=t.querySelector(".mtflpp-fit-control"),p=t.querySelector(".mtflpp-pip-control"),m=t.querySelector(".mtflpp-empty"),h=t.querySelector(".mtflpp-feedback");let g,w=(0,e.createRoot)(i),v=!1,y=!1,b=!1;const x=l.InlineNotices?(0,n.dispatch)(l.store):null,P=t.ownerDocument.defaultView?.wp?.theme?.ThemeProvider,M="meet-the-frontend-live-preview-panel",E="preview-feedback";let k="";function C(){const e=g.notice,t=/[.!?…。!?]$/.test(e.heading)?e.heading:`${e.heading}.`;return{message:e.description?`${t} ${e.description}`:e.heading,status:e.status,isDismissible:e.dismissible,actions:[...e.retry?[{label:e.action,disabled:e.disabled,onClick:r.retry}]:[],...e.close?[{label:o.close,onClick:r.close}]:[]]}}function S(){x&&k&&x.removeNotice(E,M),k=""}function L(e){return()=>{O(),e()}}function T(){const{inPage:n,inPip:i,mode:w,modeLabel:E,movable:k,busy:S,canRefresh:T,hasPreview:j,canPip:R}=g;return(0,e.createElement)(s.SlotFillProvider,null,(0,e.createPortal)(k&&n&&(0,e.createElement)(s.Button,{className:"mtflpp-icon mtflpp-move",size:"compact",icon:u.move,label:o.move,showTooltip:!0,tooltipPosition:"bottom","data-action":"move"}),c),(0,e.createPortal)((0,e.createElement)(s.Button,{className:"mtflpp-icon",size:"compact",icon:S?(0,e.createElement)(s.Spinner):u.refresh,label:o.refresh,showTooltip:!0,accessibleWhenDisabled:!0,disabled:!T,onClick:r.refresh,"data-action":"refresh"}),a),(0,e.createPortal)(R&&j&&(0,e.createElement)("div",{className:"mtflpp-pip-surface"},(0,e.createElement)(s.Button,{className:"mtflpp-pip-button",icon:u.pip,label:o.popOutHelp,"aria-label":o.popOut,description:o.popOutHelp,showTooltip:!0,onClick:r.popOut,"data-action":"pop-out"})),p),function(){const{canPip:t,canFullscreen:n,inPage:i,inPip:a,dock:l,canRememberVisibility:c,rememberVisibility:d,rememberPosition:f,followChanges:p}=g;return(0,e.createElement)(s.DropdownMenu,{className:"mtflpp-actions",label:o.actions,icon:u.more,open:v,onToggle(e){v=e,e&&(y=!1),V()},toggleProps:{className:"mtflpp-icon",size:"compact","data-action":"actions"},popoverProps:{placement:"bottom-end",offset:6,shift:!0,className:"mtflpp-menu-popover"}},()=>(0,e.createElement)(e.Fragment,null,(t||n)&&(0,e.createElement)(s.MenuGroup,{label:o.display},t&&(0,e.createElement)(s.MenuItem,{label:o.popOutHelp,description:o.popOutHelp,showTooltip:!0,onClick:L(r.popOut),"data-action":"pip","aria-label":o.popOut},o.popOut),n&&(0,e.createElement)(s.MenuItem,{onClick:L(r.fullscreen),"data-action":"fullscreen"},o.fullscreen)),i&&(0,e.createElement)(s.MenuGroup,{label:o.position},(0,e.createElement)(s.MenuItemsChoice,{value:l,choices:[{value:"left",label:o.bottomLeft},{value:"center",label:o.bottomCenter},{value:"right",label:o.bottomRight}],onSelect(e){O(),r.dock(e)}})),(0,e.createElement)(s.MenuGroup,{label:o.preferences},!1!==c&&(0,e.createElement)(s.MenuItem,{role:"menuitemcheckbox",isSelected:d,icon:d?u.check:void 0,info:o.rememberVisibilityHelp,onClick:L(r.rememberVisibility),"data-action":"remember-visibility"},o.rememberVisibility),(0,e.createElement)(s.MenuItem,{role:"menuitemcheckbox",isSelected:f,icon:f?u.check:void 0,info:o.rememberPositionHelp,onClick:L(r.rememberPosition),"data-action":"remember-position"},o.rememberPosition),(0,e.createElement)(s.MenuItem,{role:"menuitemcheckbox",isSelected:p,icon:p?u.check:void 0,info:o.followHelp,onClick:L(r.follow),"data-action":"follow"},o.follow)),i&&(0,e.createElement)(s.MenuGroup,null,(0,e.createElement)(s.MenuItem,{info:o.resetHelp,onClick:L(r.reset),"data-action":"reset"},o.reset)),a&&(0,e.createElement)(s.MenuGroup,null,(0,e.createElement)(s.MenuItem,{onClick:L(r.close),"data-action":"close"},o.closeLivePreview))))}(),!i&&(0,e.createElement)(s.Button,{className:"mtflpp-icon mtflpp-mode",size:"compact",icon:u[w],label:E,showTooltip:!0,onClick:r.mode,"data-action":"mode"}),!i&&(0,e.createElement)(s.Button,{className:"mtflpp-icon",size:"compact",icon:u.close,label:o.close,showTooltip:!0,onClick:r.close,"data-action":"close"}),(0,e.createPortal)(function(){const{device:t,orientation:n}=g;return(0,e.createElement)(s.Toolbar,{className:"mtflpp-devices",label:o.viewport,variant:"unstyled"},...["desktop","tablet","mobile"].map(i=>{const a=t===i,l=a&&"desktop"!==i,c=l&&"landscape"===n,d="portrait"===n?o.rotateLandscape:o.rotatePortrait;return(0,e.createElement)(s.ToolbarButton,{key:i,icon:u[i],className:c?"mtflpp-device-rotated":void 0,label:l?`${o[i]} — ${d}`:o[i],isPressed:a,"data-viewport":i,onClick:()=>r.device(i)})}))}(),d),(0,e.createPortal)(function(){const{fit:t,customZoom:n=100,dpr:i=1}=g,a={automatic:o.automatic,window:o.fitToWindow,width:o.fitToWidth},l={automatic:o.automaticHelp,window:o.fitToWindowHelp,width:o.fitToWidthHelp},c="custom"===t?o.fixedZoom:a[t]??o.automatic;return(0,e.createElement)(s.Dropdown,{open:y,onToggle(e){y=e,e&&(v=!1,b="custom"===g.fit),V()},contentClassName:"mtflpp-zoom-popover",focusOnMount:"firstElement",popoverProps:{placement:"top-end",offset:8,shift:!0,resize:!1,role:"dialog","aria-label":o.fitting},renderToggle:({isOpen:t,onToggle:n})=>(0,e.createElement)(s.Button,{className:"mtflpp-zoom-toggle",variant:"secondary",size:"compact",label:c,showTooltip:!0,"aria-label":`${o.fitting}: ${c}`,"aria-haspopup":"dialog","aria-expanded":t,onClick:n,"data-action":"zoom"},(0,e.createElement)("span",{className:"mtflpp-zoom-value"},c),u.chevron),renderContent:()=>(0,e.createElement)("div",{className:"mtflpp-zoom-content"},(0,e.createElement)(s.RadioControl,{label:o.zoomMode,selected:t,options:[...Object.entries(a).map(([e,t])=>({value:e,label:t,description:l[e]})),{value:"custom",label:o.fixedZoom,description:o.fixedZoomHelp}],onFocus(e){if(!b)return;b=!1;const t=e.currentTarget.closest(".mtflpp-zoom-content")?.querySelector('.mtflpp-custom-zoom input[type="number"]');t?.focus({preventScroll:!0});const n=t?.closest(".components-popover__content");if(n){const e=t.getBoundingClientRect(),o=n.getBoundingClientRect();n.scrollTop+=Math.min(0,e.top-o.top)+Math.max(0,e.bottom-o.bottom)}},onChange(e){b=!1,"custom"!==e?r.fit(e):r.zoom(n)}}),"custom"===t&&(0,e.createElement)("div",{className:"mtflpp-custom-zoom",onKeyDown(e){if("Enter"!==e.key)return;e.preventDefault();const t=Number(e.target.value);!1!==e.target.validity?.valid&&Number.isInteger(t)&&t>=10&&t<=400&&O()}},(0,e.createElement)(s.RangeControl,{label:o.customZoom,min:10,max:400,step:1,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:n,help:o.customZoomHelp,withInputField:!0,onChange(e){Number.isInteger(e)&&e>=10&&e<=400&&r.zoom(e)}})),(0,e.createElement)("div",{className:"mtflpp-dpr-note",role:"group","aria-label":o.displayInformation},(0,e.createElement)("span",{className:"mtflpp-dpr-value"},`${o.displayDpr}: ${Number(i.toFixed(2))}`),(0,e.createElement)("span",{className:"mtflpp-pixel-note"},o.pixelZoomHelp)))})}(),f),(0,e.createPortal)(function(){const{empty:t}=g;return t?(0,e.createElement)(s.Placeholder,{className:"mtflpp-placeholder","data-empty-icon":t.busy?void 0:t.icon,icon:t.busy?(0,e.createElement)(s.Spinner):u[t.icon],label:(0,e.createElement)("h3",{className:"mtflpp-empty-title",tabIndex:-1,"data-action":"empty-title"},t.heading),instructions:t.description},t.retry&&(0,e.createElement)(s.Button,{key:"retry",variant:"primary",disabled:t.disabled,onClick:r.retry,"data-action":"retry"},t.action),t.close&&(0,e.createElement)(s.Button,{key:"close",variant:"secondary",onClick:r.close,"data-action":"close"},o.close),t.note&&(0,e.createElement)("p",{className:"mtflpp-empty-note"},t.note)):null}(),m),(0,e.createPortal)(function(){if(!g.notice)return null;if(x){const t=(0,e.createElement)(l.InlineNotices,{context:M,className:"mtflpp-inline-notices"});return P?(0,e.createElement)(P,{cornerRadius:"none"},t):t}const{message:t,...n}=C();return(0,e.createElement)(s.Notice,{...n,onRemove:r.dismissNotice,spokenMessage:"",politeness:"polite"},t)}(),h),n?(0,e.createPortal)((0,e.createElement)(s.Popover.Slot),t.ownerDocument.body):(0,e.createElement)(s.Popover.Slot))}function V(){g&&w&&(function(){if(!x)return;if(!g.notice)return void S();const e=JSON.stringify(g.notice);if(k===e)return;const{message:t,status:n,...o}=C();x.createNotice(n,t,{...o,id:E,context:M,speak:!1,onDismiss:r.dismissNotice}),k=e}(),(0,e.flushSync)(()=>w.render((0,e.createElement)(T))))}function O(){(v||y)&&(v=!1,y=!1,V())}function j(e){g?.inPip&&"mode"===e&&(e="actions"),t.querySelector(`[data-action="${e}"]`)?.focus({preventScroll:!0})}return{update(e){const n=y&&!e.hasPreview&&t.ownerDocument.activeElement?.closest(".mtflpp-zoom-popover");e.hasPreview||(y=!1),g=e,V(),n&&j("empty-title")},closeMenu:O,focus:j,beforeMove(){v=!1,y=!1,w?.unmount(),w=null,S()},remount(){w=(0,e.createRoot)(i),V()}}}(O,t,{refresh:()=>{ce.canRefresh&&h()},retry:()=>{"handover"!==ce.state&&(ae||ce.canRetry&&["error","conflict"].includes(ce.state))&&g(ae)},dismissNotice:()=>{ve(),z.textContent=ce.text,Z.focus("actions")},mode:Se,close:function(){Z.closeMenu(),be(!1),m(),i||C()?j.focus():c.focus()},popOut:async function(){if(Y||x.fullscreenElement===O||!ke())return;let e;Z.closeMenu();const n=()=>{Y===e&&(w(),J.beforeMove(),Z.beforeMove(),x.body.append(O),O.classList.remove("mtflpp-pip"),Y=null,Z.remount(),Me(),J.afterMove(),Ce(),v(),K&&Z.focus("mode"))};try{if(e=await b.documentPictureInPicture.requestWindow({width:640,height:440}),!K)return void e.close();const t=b.getComputedStyle(O);e.document.documentElement.lang=x.documentElement.lang,e.document.documentElement.dir=t.direction;for(const n of["--wp-admin-theme-color","--wp-admin-theme-color-darker-10","--wp-admin-border-width-focus"]){const o=t.getPropertyValue(n);o&&e.document.documentElement.style.setProperty(n,o)}const o=x.querySelectorAll(['link[rel="stylesheet"][href*="/load-styles.php"]',"#wp-theme-css","#wp-theme-inline-css","#wp-components-css","#wp-components-inline-css","style[data-emotion]","style[data-wp-hash]","#meet-the-frontend-live-preview-panel-css","#meet-the-frontend-live-preview-panel-inline-css"].join(", "));for(const t of o){const n=t.cloneNode(!0);"STYLE"===t.tagName&&t.sheet&&(n.textContent=Array.from(t.sheet.cssRules,e=>e.cssText).join("\n")),n.addEventListener("load",J.layout,{once:!0}),e.document.head.append(n)}e.document.title=F.textContent,e.document.body.className="mtflpp-pip-document",e.addEventListener("resize",J.layout),e.addEventListener("pagehide",n,{once:!0}),Y=e,w(),J.beforeMove(),Z.beforeMove(),O.classList.add("mtflpp-pip"),e.document.body.append(O),Z.remount(),J.afterMove(),Ce(),ve(),Z.focus("mode"),v()}catch{e&&(n(),e.close()),Z.focus("actions"),we(t.pipFailed)}},fullscreen:async function(){if(!Y&&x.fullscreenEnabled){Z.closeMenu();try{await O.requestFullscreen(),ve(),Z.focus("mode")}catch{Z.focus("actions"),we(t.fullscreenFailed)}}},dock:e=>Ee(e),reset:()=>Ee("right",!0),follow:function(){T=!T,E.set(P,"scrollToChanges",T),Ce(),T&&ce.canRefresh&&h(!1)},rememberVisibility:function(){S=!S,E.set(P,"rememberVisibility",S),S&&be(K),Ce()},rememberPosition:function(){L=!L,E.set(P,"rememberPosition",L),L?xe():(E.set(P,"position",te),E.set(P,"layout",void 0)),Ce()},device(e){const t=J.device;if(e===t&&"desktop"===e)return;let n=!1;if(K&&T&&y){const{fit:e,customZoom:t,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:a}=J;n=!!y({canvas:$,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:a,canFollow:()=>J.fit===e&&J.customZoom===t})}const o={animate:K&&!n,keepPan:n};e===t?(J.rotate(o),E.set(P,`${e}Orientation`,J.orientation)):(J.select(e,o),J.device!==t&&E.set(P,"viewport",J.device)),Ce()},fit(e){const t=J.fit;J.setFit(e),J.fit!==t&&E.set(P,"fitMode",J.fit),Ce()},zoom(e){const t=J.fit,n=J.customZoom;J.setZoom(e),J.customZoom!==n&&E.set(P,"customZoom",J.customZoom),J.fit!==t&&E.set(P,"fitMode",J.fit),Ce()}}),ye(t.loading,"loading",{canRetry:!1}),Me(),Te(),i&&(i.disabled=!1),{stage:D,canvasTarget:J.canvasTarget,get visible(){return K},get followChanges(){return T},openFromLauncher:Ve,setVisible(e){e||(Z.closeMenu(),se="",Ce(),J.layout()),K=e,Me(),Te()},report:ye,setTitle:ue,clearPreview(){D.replaceChildren();const e=["ready","stale","loading"].includes(ce.state);ye(e?t.loading:ce.text,e?"loading":ce.state,{...ce,hasPreview:!1,hasHtmlPreview:!1,redirectDestination:void 0,canRefresh:!1,canRetry:!e&&ce.canRetry})},returnToEditor(){Z.closeMenu(),Y?.close(),x.fullscreenElement===O&&x.exitFullscreen().catch(()=>{})}}}function m(e=[]){const t=Array.isArray(e)?[...e]:[],n=new WeakMap;return{capture(e,o){try{if(n.has(e))return;const r=function(e){try{const t=e.querySelector('meta[name="meet-the-frontend-live-preview-panel"]'),n=t?.getAttribute("data-mtflpp-source");if(!n)return null;const o=JSON.parse(n);if("string"!=typeof o)return null;const r=(new DOMParser).parseFromString(o,"text/html");return r.querySelector('meta[name="meet-the-frontend-live-preview-panel"]')?.content===t.content?r:null}catch{return null}}(e);n.set(e,{source:r?v(r,e,t):null,dom:v(e,e,t),values:o&&Object.fromEntries(Object.entries(o).map(([e,t])=>[e,{...t}]))})}catch{}},findChange(e,t){try{const o=n.get(e),r=n.get(t);if(!o||!r)return null;const i=function(e,t){if(!e||!t)return[];const n=[];for(const o of new Set([...Object.keys(e),...Object.keys(t)])){const r=Object.hasOwn(e,o)?e[o]:{type:t[o]?.type,value:""},i=Object.hasOwn(t,o)?t[o]:{type:e[o]?.type,value:""};if(r.type!==i.type||!["text","html"].includes(i.type)||"string"!=typeof r.value||"string"!=typeof i.value||r.value===i.value)continue;let a,s;try{a="html"===r.type?(new DOMParser).parseFromString(r.value,"text/html"):null,s="html"===i.type?(new DOMParser).parseFromString(i.value,"text/html"):null}catch{continue}const l=a?v(a,a,[],a.body):null,c=s?v(s,s,[],s.body):null,d=a?T(l):r.value,u=s?T(c):i.value,f=P(d),p=P(u);if(f!==p&&n.push({...V(f,p),type:"text"}),!a){const e=L(d,u);e&&n.push(e);continue}if(l&&c&&(f===p||M(d,u)))for(const e of x(l,c)){if(e.spacing){const t=S(e);t&&n.push(t);continue}if(f===p)if("attributes"===e.kind){const t=new Map(e.before.attributes),o=new Map(e.after.attributes);for(const e of new Set([...t.keys(),...o.keys()])){const r=t.get(e)??"",i=o.get(e)??"";JSON.stringify(r)!==JSON.stringify(i)&&n.push({type:"attribute",name:e,before:"string"==typeof r?r:JSON.stringify(r),after:"string"==typeof i?i:JSON.stringify(i)})}}else"content"===e.kind&&(P(T(e.before))===P(T(e.after))&&n.push({type:"markup",before:P(T(e.before)),after:P(T(e.after)),oldTag:e.before.tag,newTag:e.after.tag}),(e.before.media||[]).forEach((t,o)=>{const r=e.after.media?.[o];t&&r&&t!==r&&n.push({type:"media",before:t,after:r})}))}}return n}(o.values,r.values),a=function(e,t){if(!e||!t)return!1;const n=(e,t)=>Object.entries(e).some(([e,n])=>"order"!==n?.type&&(!Object.hasOwn(t,e)||n?.type!==t[e]?.type||n?.value!==t[e]?.value));return n(e,t)||n(t,e)}(o.values,r.values),s=!!o.source&&!!r.source,l=!!o.source!=!!r.source,c=[...s?x(o.source,r.source).map(e=>({...e,source:!0})):[],...x(o.dom,r.dom)],d=new Map,u=function(e,t){const n=new Map,o=e=>T(e,n),r=[];for(const n of e){if(n.unresolved)for(const e of h(n,t,o))r.push(e);if("insert"===n.kind&&n.added.length>1){const e=n.added.map(e=>{const r={...n,after:e,added:[e]},i=A(r,t,o);return{...r,input:i}}).filter(e=>e.input);if(e.length){r.push(...e);continue}}const e=A(n,t,o);r.push({...n,input:e})}return r}(c,i).filter(e=>(e.source||!s&&!l||e.input||a&&2===e.priority)&&(e.priority>0||e.input)&&(!e.spacing||function({before:e,after:t},n,o){const r=E(e,n,o),i=E(t,n,o);return r&&i&&r.omitted===i.omitted&&M(r.text,i.text)}(e,d,r.dom?.excluded)));return function(e,t){if(!e.length)return null;const n=e.reduce((e,t)=>Math.max(e,t.input),0),o=e.filter(e=>e.input===n),r=o.reduce((e,t)=>Math.max(e,t.priority),0),i=o.filter(e=>e.priority===r);if(i.some(e=>e.unresolved))return function(e,t){const n=e.find(e=>e.unresolved&&("replacement"===e.regionChange||"reorder"===e.regionChange&&(e.source||t))),o=n?.after.node;if(!o?.isConnected)return null;for(const t of e)if(t.unresolved){if(n.source&&!t.source&&"reorder"===t.regionChange)continue;if(!t.regionChange||t.after.node!==o)return null}else if(!("insert"===t.kind?t.added:[t.after]).every(e=>o.contains(e.node)))return null;return"contents"!==o.ownerDocument.defaultView.getComputedStyle(o).display?o:null}(i,t);const a=i.filter(e=>!e.input||e.directInput||!i.some(t=>t!==e&&e.matches?.length&&e.matches.every(e=>t.matches?.includes(e))&&H(e.after,t.after))),s=new Map,l=a.filter(e=>{const t="delete"===e.kind&&(e.following[0]||e.preceding[0])||e.after,n=t?.node;if(!n)return!0;const o="delete"!==e.kind||e.following.length?e.kind:"delete-last",r=s.get(n)||new Set;return!r.has(o)&&(r.add(o),s.set(n,r),!0)});return n&&s.size>1?null:function(e){const t=new Set,n=new Set;for(const o of e){let e,r=!1;"delete"===o.kind?(r=!o.removed.some(w),e=r?o.after:o.following.find(w)||o.preceding.find(w)||o.following.find(g)||o.preceding.find(g)||o.after):e="insert"===o.kind?o.added.find(w)||o.added.find(g):o.after;const i=g(e);if(!i)continue;const a=w(e),s=a||i;(a&&!r?t:n).add(s)}const o=t.size?t:n;return 1===o.size?o.values().next().value:null}(l)}(u,!s&&(a||function(e,t){return!!e&&!!t&&Object.entries(t).some(([t,n])=>{if("order"!==n?.type||!Object.hasOwn(e,t))return!1;const o=e[t];return"order"===o?.type&&o.members===n.members&&o.value!==n.value})}(o.values,r.values)))}catch{return null}}}}function h(e,t,n){const o=[];for(const r of t){if(!r.after||"spacing"===r.type)continue;const t=R(e.oldRange,r.before,n,r,!0),i=R(e.newRange,r.after,n,r,!1);if(!t.length)continue;const a="markup"===r.type&&r.oldTag===r.newTag;if(a||!r.before||!(t.length<=R(e.newRange,r.before,n,r,!0).length||i.length<=R(e.oldRange,r.after,n,r,!1).length))for(const n of i)a&&!t.some(e=>e.signature!==n.signature)||o.push({...e,unresolved:!1,before:null,after:n,kind:"content",input:r.before&&r.after?2:1,priority:2,matches:[r]})}return o}function g(e){if(e?.node)return e.node;for(const t of e?.children||[]){const e=g(t);if(e)return e}return null}function w(e){const t=e?.node;if(t?.getClientRects().length&&"visible"===t.ownerDocument.defaultView.getComputedStyle(t).visibility)return t;for(const t of e?.children||[]){const e=w(t);if(e)return e}return null}function v(e,t,n,o=e.querySelector('main, [role="main"]')||e.querySelector("article")||e.body){if(!o)return null;const r=n.filter(e=>{if("string"!=typeof e||!e.trim())return!1;try{return o.matches(e),!0}catch{return!1}}).join(", "),i=new Map,a=new Map;if(e!==t)for(const e of t.querySelectorAll("[data-mtflpp-node]")){const t=e.getAttribute("data-mtflpp-node");a.set(t,a.has(t)?null:e)}for(const n of[o,...o.querySelectorAll("*")]){if(r&&n.closest(r))continue;const o=[...n.childNodes].filter(e=>3===e.nodeType).map(e=>e.textContent),s=P(o.join(" ")),l=["img","source","video","audio","iframe"].includes(n.localName)?["src","srcset","poster"].map(e=>n.getAttribute(`data-${e}`)||n.getAttribute(e)||""):[],c=n.style?.backgroundImage||n.getAttribute("data-bg")||"",d=e===t?n:a.get(n.getAttribute("data-mtflpp-node"))||null,u=y(n,d,JSON.stringify([n.localName,s,l,c]));u.text=s,u.rawText=o.join(""),u.media=[...l,c],u.parent=i.get(n.parentElement),i.set(n,u),u.parent?.children.push(u)}for(const[e,t]of i)t.parts=[...e.childNodes].map(e=>3===e.nodeType?e.textContent:i.get(e)).filter(e=>void 0!==e);let s=i.get(o);if(!s)return null;const l=s.node;for(let e=o.parentElement;e;e=e.parentElement){const t=y(e,l,e.localName);t.children=[s],t.parts=[s],s=t}return s.excluded=r,s}function y(e,t,n){const o=function(e){const t=[];for(const{name:n,value:o}of e.attributes){if("data-mtflpp-node"===n||n.startsWith("on")||/(?:^|-)(nonce|token)(?:-|$)/.test(n))continue;if(/^(?:data-)?(?:src|srcset|poster|sizes|bg)$/.test(n))continue;let r=o;"class"===n&&(r=[...e.classList].sort().join(" ")),"style"===n&&(r=[...e.style].sort().map(t=>[t,e.style.getPropertyValue(t),e.style.getPropertyPriority(t)])),("class"!==n&&"style"!==n||r.length)&&t.push([n,r])}return t.sort(([e],[t])=>e.localeCompare(t))}(e);return{node:t,tag:e.localName,signature:n,attributes:o,children:[],parts:[],presentation:JSON.stringify(o.filter(([e])=>!b(e))),references:JSON.stringify(o.filter(([e])=>b(e)))}}function b(e){return["id","for","headers","aria-controls","aria-labelledby","aria-describedby","aria-owns","aria-flowto","aria-activedescendant","aria-details","aria-errormessage"].includes(e)}function x(e,t){const n=new Map,o=new Map,r=new Map,i=new Map,a=[];function s(e){const t=JSON.stringify(e);return n.has(t)||n.set(t,n.size+1),n.get(t)}function l(e){if(!e)return 0;const t=s([e.signature,e.children.map(l)]);return o.set(e,t),r.set(e,s([t,e.presentation,e.children.map(e=>r.get(e))])),i.set(e,s([t,e.presentation,e.references,e.children.map(e=>i.get(e))])),t}l(e),l(t);const c=e=>o.get(e);function d(e){const t=e.attributes.find(([e])=>"id"===e)?.[1];return t?`${e.tag} ${t}`:void 0}function u(e){if(!(e.children.length<2))return s(["collection",e.signature,e.children.map(c).sort((e,t)=>e-t)])}function f(e,t){const n=new Map;return e.forEach((e,o)=>{const r=t(e);void 0!==r&&n.set(r,n.has(r)?-1:o)}),n}return function e(t,n){t&&n&&(t.signature!==n.signature?a.push({kind:"content",before:t,after:n,priority:2}):t.rawText!==n.rawText&&a.push({kind:"content",before:t,after:n,priority:2,spacing:!0}),t.presentation===n.presentation&&t.references===n.references||a.push({kind:"attributes",before:t,after:n,priority:t.presentation!==n.presentation?1:0}),function(t,n,s,l){const p=l.parent&&s.parent&&l.tag===s.tag,m=f(t,c),h=f(n,c);let g,w,v,y;const b=new Set(t.flatMap(e=>[r.get(e),i.get(e)])),x=new Set(n.flatMap(e=>[r.get(e),i.get(e)]));function P(e,t,n){const o=n.get(e),r=n.get(t);return o===r||!x.has(o)&&!b.has(r)}function M(e,t){return o.get(e)===o.get(t)&&P(e,t,r)&&P(e,t,i)}function E(e,r,i,s,c){const d=t.slice(e,r),u=n.slice(i,s),f="replacement"===c&&p&&d.some(e=>!h.has(o.get(e)))&&u.some(e=>!m.has(o.get(e)))&&(!function(e,t){if(e.length<2||t.length<2)return!1;const n=e.filter(e=>e.children.length).length,o=t.filter(e=>e.children.length).length;if(!n&&!o||n>1&&o>1)return!0;const r=new Map;for(const{tag:e}of t)r.set(e,(r.get(e)||0)+1);let i=0;for(const{tag:t}of e){const e=r.get(t);if(e){if(2===++i)return!0;r.set(t,e-1)}}return!1}(d,u)||"form"===l.tag&&function(e,t){function n(e){const t=new Set;return e.every(function e(n){if(["input","select","textarea"].includes(n.tag)){const e=n.attributes.find(([e])=>"name"===e)?.[1],o=n.attributes.find(([e])=>"type"===e)?.[1]?.toLowerCase();return!(!e||"input"===n.tag&&"hidden"===o||(t.add(e),0))}let o=!1;for(const t of n.children)e(t)&&(o=!0);return o})?t:null}const o=n(e),r=n(t);return o&&r&&[...o].some(e=>!r.has(e))&&[...r].some(e=>!o.has(e))}(d,u)),g=p&&("reorder"===c||f)?c:void 0;a.push({kind:"region",after:l,priority:2,unresolved:!0,regionChange:g,oldRange:d,newRange:u})}function k(e,n,o,r,i,a,s){const l=[];for(let c=e;c<n;c++){const e=s(t[c]),n=a.get(e);if(!(i.get(e)!==c||void 0===n||n<o||n>=r)){if(l.length&&n<=l[l.length-1][1])return null;l.push([c,n])}}return l}!function r(i,s,b,x){for(;i<s&&b<x&&M(t[i],n[b]);)e(t[i],n[b]),i++,b++;for(;i<s&&b<x&&M(t[s-1],n[x-1]);)s--,x--,e(t[s],n[x]);if(i===s&&b===x)return;if(i===s||b===x){const e=b===x,r=e?t.slice(i,s):n.slice(b,x),c=e?[n[b-1],n[b]]:[t[i-1],t[i]];return void(r.some(e=>c.some(t=>t&&o.get(t)===o.get(e)))?E(i,s,b,x):e?a.push({kind:"delete",after:l,removed:r,priority:2,following:n.slice(b),preceding:n.slice(0,b).reverse()}):a.push({kind:"insert",after:r[0],added:r,priority:2}))}if(s-i===1&&x-b===1)return void e(t[i],n[b]);if(p&&function(e,r,i,a){const s=r-e;if(s<2||s!==a-i)return!1;const l=new Map;let c=!1;for(let r=0;r<s;r++){const a=o.get(t[e+r]),s=o.get(n[i+r]);c||=a!==s,l.set(a,(l.get(a)||0)+1),l.set(s,(l.get(s)||0)-1)}return c&&[...l.values()].every(e=>0===e)}(i,s,b,x))return void E(i,s,b,x,"reorder");let P=k(i,s,b,x,m,h,c);if(0===P?.length&&(g??=f(t,d),w??=f(n,d),P=k(i,s,b,x,g,w,d)),0===P?.length&&(v??=f(t,u),y??=f(n,u),P=k(i,s,b,x,v,y,u)),P?.length)for(const[o,a]of[...P,[s,x]])r(i,o,b,a),o<s&&e(t[o],n[a]),i=o+1,b=a+1;else E(i,s,b,x,P?"replacement":void 0)}(0,t.length,0,n.length)}(t.children,n.children,t,n))}(e,t),a}function P(e){return e.replace(/\s+/g," ").trim()}function M(e,t){return e!==t&&e.replace(/\s/g,"")===t.replace(/\s/g,"")}function E(e,t,n){for(;e.node?.isConnected&&e.parent?.node;){const{display:t}=e.node.ownerDocument.defaultView.getComputedStyle(e.node);if("inline"!==t&&"contents"!==t)break;e=e.parent}if(!t.has(e)){const{node:o}=e,r=[],i=o?.isConnected&&k(o,n,r)===C(e)&&w(e)?o.innerText:void 0;t.set(e,"string"==typeof i?{text:i,omitted:JSON.stringify(r)}:void 0)}return t.get(e)}function k(e,t,n){return t&&e.querySelector(t)?[...e.childNodes].map(e=>3===e.nodeType?e.textContent:1!==e.nodeType?"":e.matches(t)?(n.push(e.textContent),""):k(e,t,n)).join(""):e.textContent}function C(e){return e.parts.map(e=>"string"==typeof e?e:C(e)).join("")}function S({before:e,after:t}){return L(e.rawText,t.rawText)||L(C(e),C(t))}function L(e,t){if(!/\S/.test(e)||!M(e,t))return;const n=e.match(/\s+|\S+/g),o=t.match(/\s+|\S+/g);let r=0,i=0;for(;r<Math.min(n.length,o.length)&&n[r]===o[r];)r++;for(;i<Math.min(n.length,o.length)-r&&n.at(-1-i)===o.at(-1-i);)i++;const a=Math.max(0,r-1),s=Math.max(0,i-1);return{type:"spacing",before:n.slice(a,n.length-s).join(""),after:o.slice(a,o.length-s).join("")}}function T(e,t=new Map){return e?(t.has(e)||t.set(e,(e.parts||[]).map(e=>{if("string"==typeof e)return e;const n=T(e,t);return/^(?:p|div|section|article|main|aside|header|footer|nav|h[1-6]|li|[ou]l|d[ldt]|blockquote|pre|table|tr|t[dh]|caption|figure|figcaption|br|hr)$/.test(e.tag)?` ${n} `:n}).join("")),t.get(e)):""}function V(e,t){let n=0,o=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;for(;o<e.length-n&&o<t.length-n&&e[e.length-o-1]===t[t.length-o-1];)o++;let r=e.length-o,i=t.length-o;for(;n>0&&/\S/.test(e[n-1]);)n--;if(r>n&&/\S/.test(e[r-1]))for(;r<e.length&&/\S/.test(e[r]);)r++;if(i>n&&/\S/.test(t[i-1]))for(;i<t.length&&/\S/.test(t[i]);)i++;return{before:e.slice(n,r).trim(),after:t.slice(n,i).trim()}}function O(e,t){return t?j(e,t):""===P(e)}function j(e,t){if(!t)return!1;let n=(e=P(e)).indexOf(t);for(;-1!==n;){const o=n+t.length;if(!(n&&/[\p{L}\p{N}_]/u.test(e[n-1])&&/[\p{L}\p{N}_]/u.test(t[0])||o!==e.length&&/[\p{L}\p{N}_]/u.test(e[o])&&/[\p{L}\p{N}_]/u.test(t.at(-1))))return!0;n=e.indexOf(t,n+1)}return!1}function R(e=[],t,n,o,r){return e.flatMap(e=>{const i=R(e.children,t,n,o,r);let a;return a="media"===o.type?e.media?.includes(t):"attribute"===o.type?e.attributes.some(([e,n])=>e===o.name&&j("string"==typeof n?n:JSON.stringify(n),t)):("markup"!==o.type||e.tag===(r?o.oldTag:o.newTag))&&O(n(e),t),"text"===o.type&&i.length?i:[...a?[e]:[],...i]})}function A(e,t,n){if(e.unresolved)return 0;if(e.matches=[],e.spacing){const n=t.filter(e=>"spacing"===e.type),o=n.length&&S(e);return e.matches=n.filter(e=>o?.before===e.before&&o?.after===e.after),e.matches.length?2:0}let o=0;for(const r of t){if("spacing"===r.type)continue;let t=0;if("attributes"===e.kind){if(!["text","attribute"].includes(r.type))continue;const n=r,o=new Map(e.before.attributes),i=new Map(e.after.attributes);for(const e of new Set([...o.keys(),...i.keys()])){if("attribute"===r.type&&e!==r.name)continue;const a=o.get(e),s=i.get(e);if(JSON.stringify(a)===JSON.stringify(s))continue;const l="string"==typeof a?a:JSON.stringify(a)||"",c="string"==typeof s?s:JSON.stringify(s)||"";O(l,n.before)&&O(c,n.after)&&(t="attribute"===r.type||r.before&&r.after?2:1)}}else"insert"===e.kind?!r.before&&e.added.some(e=>j(n(e),r.after))&&(t=Math.max(t,1)):"delete"===e.kind?!r.after&&e.removed.some(e=>j(n(e),r.before))&&(t=Math.max(t,1)):"media"===r.type?(e.before?.media||[]).some((t,n)=>t===r.before&&e.after?.media?.[n]===r.after)&&(t=2):"attribute"!==r.type&&("markup"!==r.type||e.before?.tag===r.oldTag&&e.after?.tag===r.newTag)&&O(n(e.before),r.before)&&O(n(e.after),r.after)&&(t=r.before&&r.after?2:1,"text"===r.type&&j(e.before?.text||"",r.before)&&j(e.after?.text||"",r.after)&&(e.directInput=!0));t&&e.matches.push(r),o=Math.max(o,t)}return o}function H(e,t){return!!e?.children.some(e=>e===t||e.node&&e.node===t?.node||H(e,t))}const _=new Set(["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","PageDown","PageUp","Home","End"," "]);function F(e,t){let n;for(const o of e?.rects??[]){const e=t(o);if(e.visible)return e;(!n||e.distance<n.distance)&&(n=e)}return n}function N(e){return new Promise(t=>{const n=()=>{e.clearTimeout(o),e.cancelAnimationFrame(r),t()},o=e.setTimeout(n,100);let r=e.requestAnimationFrame(()=>{r=e.requestAnimationFrame(n)})})}function $(e,t=!1){if(!Z(e,{visibilityProperty:!0,opacityProperty:!0}))return;const{left:n,right:o,top:r,bottom:i,width:a,height:s}=e.getBoundingClientRect();if(!(t||a&&s))return;const l=e.ownerDocument,{documentElement:c,body:d,defaultView:u}=l,f={left:n,right:a?o:n+1,top:r,bottom:s?i:r+1},p={...f},m={x:f.right-f.left,y:f.bottom-f.top},h="visible"===u.getComputedStyle(c).overflow,g=u.getComputedStyle(e);for(let n=e;n&&n!==c;){const o=n===e?g:u.getComputedStyle(n),{position:r,display:i,overflowX:a,overflowY:s}=o;if(n!==e&&(n!==d||!h)&&"inline"!==i&&("visible"!==a||"visible"!==s)&&n.offsetWidth&&n.offsetHeight){const{bounds:e,scaleX:r,scaleY:i}=z(n,o);for(const[l,c,d,u,h]of[["x",a,"left","right",r],["y",s,"top","bottom",i]]){if("visible"===c)continue;const r="clip"===c?[0,0]:I(n,o,l,h),i=t&&"hidden"===c,a="y"===l==("horizontal-tb"===o.writingMode);if(i&&r.some(e=>e)&&(a||f[d]<e[d]||f[u]>e[u]||D(o,g,l)))return{boundary:n};if(!W(f,p,e,d,u,i?[0,0]:r))return{boundary:n};m[l]=Math.min(m[l],p[u]-p[d])}}n="absolute"===r||"fixed"===r?n.offsetParent:n.parentElement}return{clipped:f,extent:m}}function D(e,t,n){const o=e=>e&&"auto"!==e&&0!==parseFloat(e);return("x"===n?["Left","Right"]:["Top","Bottom"]).some(n=>o(e[`scrollPadding${n}`])||o(t[`scrollMargin${n}`]))}function B(e,t,n=!1){const o=$(e,n);if(!o?.clipped)return;const{clipped:r,extent:i}=o,{ownerDocument:a}=e,s=a.documentElement;if(r.left=Math.max(s.clientLeft,r.left),r.right=Math.min(s.clientLeft+s.clientWidth,r.right),r.top=Math.max(0,r.top),r.bottom=Math.min(s.clientHeight,r.bottom),r.right<=r.left)return{rects:[]};const l=t?.({...r,top:0,bottom:s.clientHeight}),c=l?.visibleCenterX??(r.left+r.right)/2,d=K(e,c);if(r.bottom<=r.top)return{rects:[],header:d?.bottom};const u={rects:[r],inViewport:!0,extent:i};if(!d)return u;const f={left:Math.max(r.left,d.left),right:Math.min(r.right,d.right),top:Math.max(r.top,d.top),bottom:Math.min(r.bottom,d.bottom)};if(!q(f)||!d.node.contains(a.elementFromPoint(c,(f.top+f.bottom)/2)))return u;const p=[{...r,top:f.bottom},{...r,bottom:f.top},{...f,left:r.left,right:f.left},{...f,left:f.right,right:r.right}].filter(q);return!p.length&&d.bottom>=s.clientHeight&&d.top<=0?void 0:{rects:p,inViewport:!0,extent:i,header:d.bottom}}function q({left:e,right:t,top:n,bottom:o}){return t>e&&o>n}function W(e,t,n,o,r,[i,a]){return e[o]=Math.max(e[o],n[o]),e[r]=Math.min(e[r],n[r]),t[o]=Math.max(n[o],t[o]+i),t[r]=Math.min(n[r],t[r]+a),t[r]>t[o]}function I(e,t,n,o){const r="x"===n,i=r?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight;if(i<=0)return[0,0];const a=r?e.scrollLeft:e.scrollTop,s=t.display.endsWith("flex")&&t.flexDirection===(r?"row-reverse":"column-reverse"),l=(r&&"rtl"===t.direction)!==s;let c=l?-i:0,d=l?0:i;return("horizontal-tb"!==t.writingMode||a<c||a>d)&&(c=-i,d=i),[(a-d)*o,(a-c)*o]}function z(e,t){const n=e.getBoundingClientRect(),o=n.width/e.offsetWidth,r=n.height/e.offsetHeight,i=n.left+e.clientLeft*o,a=n.top+e.clientTop*r,s={left:i,top:a,right:i+e.clientWidth*o,bottom:a+e.clientHeight*r},l=t.overflowClipMargin;if("clip"!==t.overflowX&&"clip"!==t.overflowY||!l||"0px"===l)return{bounds:s,scaleX:o,scaleY:r};const c=l.split(" ").map(parseFloat).find(Number.isFinite)??0,d=l.includes("border-box")?n:s,u=l.includes("content-box");return{scaleX:o,scaleY:r,bounds:{left:d.left+((u?parseFloat(t.paddingLeft):0)-c)*o,right:d.right-((u?parseFloat(t.paddingRight):0)-c)*o,top:d.top+((u?parseFloat(t.paddingTop):0)-c)*r,bottom:d.bottom-((u?parseFloat(t.paddingBottom):0)-c)*r}}}function Z(e,t={visibilityProperty:!0}){return!!e?.isConnected&&!!e.getClientRects().length&&(!e.checkVisibility||e.checkVisibility(t))&&"visible"===e.ownerDocument.defaultView.getComputedStyle(e).visibility}function J(e){return e.matchMedia("(prefers-reduced-motion: reduce)").matches?"instant":"smooth"}function U(e,{behavior:t,header:n=Y(e),nearest:o=!1}={}){const r=e.ownerDocument,i=r.defaultView,a=t??J(i);if(o&&!n)return void e.scrollIntoView({behavior:a,block:"nearest",inline:"nearest"});const s=i.getComputedStyle(e).scrollMarginTop,l=r.documentElement,c=l.clientHeight,d=i.getComputedStyle(l),u=X(d.scrollPaddingTop,c),f=X(d.scrollPaddingBottom,c);let p,m;try{let t=o?"nearest":"start";if(o){const e=n-parseFloat(s);null!==u&&e>u&&(p=l.getAttribute("style"),l.style.setProperty("scroll-padding-top",`${e}px`,"important"))}else{const t=n>0&&null!==u?`max(${s}, ${n-u}px)`:s;m=e.getAttribute("style"),e.style.setProperty("scroll-margin-top",`calc(${t} + 1lh)`,"important")}if(!o&&null!==u&&null!==f){const n=i.getComputedStyle(e),o=c-u-f-parseFloat(n.scrollMarginTop)-parseFloat(n.scrollMarginBottom),r=o-e.getBoundingClientRect().height;if(r>=0&&(t="center"),r>0&&"horizontal-tb"===d.writingMode){const e=Math.min(o/3,r);p=l.getAttribute("style"),l.style.setProperty("scroll-padding-bottom",`${f+e}px`,"important")}}e.scrollIntoView({behavior:a,block:t,inline:"nearest"})}finally{void 0!==p&&G(l,p),void 0!==m&&G(e,m)}}function G(e,t){e.setAttribute("style",t??""),null===t&&e.removeAttribute("style")}function X(e,t){if("auto"===e)return 0;const n=parseFloat(e);return Number.isFinite(n)?n*(e.endsWith("%")?t/100:1):null}function Y(e){const t=e.getBoundingClientRect();return K(e,t.left+t.width/2)?.bottom??0}function K(e,t){const n=e.ownerDocument;for(let o=n.elementFromPoint(t,1);o&&!o.contains(e);o=o.parentElement){const e=n.defaultView.getComputedStyle(o);if("fixed"!==e.position&&"sticky"!==e.position)continue;if("0"===e.opacity||!Z(o,{visibilityProperty:!0,opacityProperty:!0}))continue;const{left:t,right:r,top:i,bottom:a}=o.getBoundingClientRect();if("fixed"===e.position||i<=parseFloat(e.top)+1)return{node:o,left:t,right:r,top:i,bottom:a}}}function Q(e,t,n,o){const r=window.acf;r.addAction("wysiwyg_tinymce_init",n);for(const e of["append","remove","sortstop","change_field"])r.addAction(e,t);const i=t=>{t[0]===e&&o?.()};function a(e){return!!e?.closest?.(".acf-field")}return r.addAction("validation_failure",i),window.jQuery(e).on("input.mtflppAcf change.mtflppAcf sortupdate.mtflppAcf",e=>{e.originalEvent&&"sortupdate"!==e.type||!a(e.target)||t()}),{isField:a,isValidating:()=>!!e.classList?.contains("is-validating"),hasStructuralPaginationChanges:()=>!!e.querySelector('.acf-repeater[data-pagination="1"] .acf-row:is(.acf-added, .acf-inserted, .acf-reordered, .acf-deleted)'),accepts:e=>"_acf_nonce"===e||e.startsWith("acf[")||e.startsWith("_acf_fields["),destroy(){r.removeAction("wysiwyg_tinymce_init",n);for(const e of["append","remove","sortstop","change_field"])r.removeAction(e,t);r.removeAction("validation_failure",i),window.jQuery(e).off(".mtflppAcf")}}}function ee(){const e=(0,n.select)("core/edit-post")?.getActiveMetaBoxLocations?.()??["normal","side","advanced"];return[document.querySelector(".metabox-base-form"),...e.map(e=>document.querySelector(`.edit-post-meta-boxes-area.is-${e} .metabox-location-${e}`)||document.querySelector(`#metaboxes .metabox-location-${e}`))].filter(Boolean)}const te="meet-the-frontend-live-preview-panel/acf";function ne(e){if(!e.acfEnabled)return!1;if("function"!=typeof window.acf?.addAction||"function"!=typeof window.acf?.removeAction||"function"!=typeof window.jQuery)throw Object.assign(new Error(e.strings.acfUnavailable),{code:"mtflpp_integration_failed"});return!0}(0,o.addAction)("mtflpp.blockEditor.previewSetup",te,({config:e,changed:t,hooks:o,onDestroy:r})=>{if(!ne(e))return;const i=function(e){const t=new Set;let o=!1,r=[],i=new Map;const a=()=>{o||e()};function s(e){e&&!t.has(e)&&(t.add(e),e.on("input change undo redo SetContent",a))}const l=Q(document,a,s);function c(e){s(e.editor)}function d(e){l.isField(e.target)&&ee().some(t=>t.contains(e.target))&&a()}window.tinymce?.editors.forEach(s),window.tinymce?.on("AddEditor",c),document.addEventListener("input",d),document.addEventListener("change",d,!0);const u=new MutationObserver(a);return{get ready(){return r=r.filter(({field:e,rows:t})=>e.isConnected&&t.some(t=>e.contains(t))),r.length||u.disconnect(),!r.length},saved(){u.disconnect(),r=ee().flatMap(e=>[...e.querySelectorAll('.acf-repeater[data-pagination="1"]')].map(e=>({field:e,rows:[...e.querySelectorAll(":scope > table > tbody > tr.acf-row:not(.acf-clone)")]})).filter(({rows:e})=>e.length));for(const{field:e}of r)u.observe(e,{childList:!0,subtree:!0});a()},observe(){const e=(0,n.select)("acf/fields");if(!e?.getFieldValue)return;const t=new Map;for(const n of ee())for(const o of window.acf.getFields({parent:window.jQuery(n)})){const n=o.get("key");t.set(n,e.getFieldValue(n))}(t.size!==i.size||[...t].some(([e,t])=>i.get(e)!==t))&&(i=t,a())},capture(){o=!0;const e=new URLSearchParams;try{window.tinymce?.triggerSave();for(const t of ee())for(const[n,o]of new FormData(t))"string"==typeof o&&l.accepts(n)&&e.append(n,o)}finally{o=!1}return e},destroy(){u.disconnect(),l.destroy(),document.removeEventListener("input",d),document.removeEventListener("change",d,!0),window.tinymce?.off("AddEditor",c);for(const e of t)e.off("input change undo redo SetContent",a)}}}(t);r(()=>i.destroy()),o.addAction("observePreviewInputs",te,()=>i.observe()),o.addAction("nativeMetaboxSaveAcknowledged",te,()=>i.saved()),o.addFilter("previewPauseReason",te,t=>t||(i.ready?"":e.strings.acfRefreshing)),o.addFilter("previewFormBody",te,e=>{e??=new URLSearchParams;for(const[t,n]of i.capture())e.append(t,n);return e})}),(0,o.addAction)("mtflpp.classicEditor.previewSetup",te,({config:e,form:t,changed:n,watchEditor:o,cancelNativeSave:r,hooks:i,onDestroy:a})=>{if(!ne(e))return;const s=Q(t,n,o,r);a(()=>s.destroy());const l=e=>{s.isField(e.target)&&n()};t.addEventListener("input",l),t.addEventListener("change",l,!0),a(()=>{t.removeEventListener("input",l),t.removeEventListener("change",l,!0)}),i.addFilter("nativeSaveValidationPending",te,e=>e||s.isValidating()),i.addFilter("previewFormBody",te,(e,t)=>{for(const[n,o]of t)"string"==typeof o&&s.accepts(n)&&e.append(n,o);return e}),i.addFilter("nativePreviewHandoffError",te,(t,n)=>t||(n&&s.hasStructuralPaginationChanges()?Object.assign(new Error(e.strings.nativePreviewAcf),{code:"mtflpp_source_changed"}):void 0))}),(0,o.addAction)("mtflpp.blockEditor.previewSetup","meet-the-frontend-live-preview-panel/yoast",({config:e,hooks:t})=>{e.yoastPrimaryTaxonomies?.length&&t.addFilter("additionalPreviewValues","meet-the-frontend-live-preview-panel/yoast",(t,o)=>{const r=function(e,t){if(!e.yoastPrimaryTaxonomies?.length)return;const o=(0,n.select)("yoast-seo/editor");if("function"!=typeof o?.getPrimaryTaxonomyId||Number(o.getPostId?.())!==e.postId)return;const r={};for(const n of e.yoastPrimaryTaxonomies){const i=o.getPrimaryTaxonomyId(n);if(void 0===i)continue;const a=-1===Number(i)?0:Number(i),s=t.getEditedPostAttribute(e.taxonomies[n]);r[n]=Array.isArray(s)&&!s.includes(a)?0:a}return Object.keys(r).length?JSON.stringify(r):void 0}(e,o);return void 0===r?t:{...t,yoast_primary_terms:r}})});const oe=window.meetTheFrontendLivePreviewPanel;if(oe){let a;try{a=function(e){const a={ready:!1,notReady:e.strings.loading,notReadyState:"loading",saving:!1,idle:Promise.resolve(),title:e.postTitle};let s,l,c,d=!1,u=!1,f=0,p=!1;const m=function(e,t){const n=(0,o.createHooks)(),r=[];let i,a=!1;function s(e){i??="mtflpp_integration_failed"===e?.code?e:Object.assign(new Error(t.config.strings.integrationFailed),{code:"mtflpp_integration_failed",cause:e})}const l={get error(){return i},filter(e,t,...o){if(a||i)return t;try{const r=n.applyFilters(e,t,...o);if("additionalPreviewValues"===e&&("[object Object]"!==Object.prototype.toString.call(r)||Object.values(r).some(e=>!(null===e||["string","boolean"].includes(typeof e)||"number"==typeof e&&Number.isFinite(e)))))throw new TypeError("Preview values must be a plain object of scalar values.");return r}catch(e){return s(e),t}},action(e,...t){if(!a&&!i)try{n.doAction(e,...t)}catch(e){s(e)}},capture(e,t=null){a&&!i&&s(new Error("This editor session has ended."));const n=null===e?null:new URLSearchParams(e),o=l.filter("previewFormBody",e,t);if(null===o||o instanceof URLSearchParams||s(new TypeError("Preview capture must return URLSearchParams or null.")),i||null===n||null!==o&&![...n.keys()].some(e=>{const t=n.getAll(e),r=o.getAll(e);return r.length!==t.length||t.some((e,t)=>r[t]!==e)})||s(new TypeError("Preview capture must preserve the classic form body.")),i)throw i;return o},comparisonValues(e,n){const o=new Map(Object.entries(n));try{const n=t.form||document,r=new Set;for(const t of n.querySelectorAll("input[name], textarea[name], select[name]")){if(o.has(t.name)||!e?.has(t.name)||"password"===t.type)continue;if("hidden"===t.type){r.add(t.name);continue}const n="textarea"===t.localName||["text","search","email","url","tel"].includes(t.type),i=e.getAll(t.name);let a="value";n&&1===i.length&&(a=t.classList.contains("wp-editor-area")?"html":"text"),o.set(t.name,{type:a,value:1===i.length?i[0]:JSON.stringify(i)})}for(const t of r){if(o.has(t))continue;const n=e.getAll(t);n.length>1&&o.set(t,{type:"order",value:JSON.stringify(n),members:JSON.stringify(n.sort())})}}catch{}return Object.fromEntries(o)},destroy(){if(!a){a=!0;for(const e of r.reverse())try{e()}catch(e){s(e)}r.length=0}}};try{(0,o.doAction)("mtflpp.blockEditor.previewSetup",{...t,hooks:n,onDestroy(e){r.push(e)}})}catch(e){s(e),l.destroy()}return l}(0,{config:e,changed(){s?.changed(),y()}}),h=()=>(0,n.select)("core/editor"),g=()=>Number(h()?.getCurrentPostId())===e.postId&&h()?.getCurrentPostType()===e.postType,w=()=>{c=Object.assign(new Error(e.strings.nativeSaveFailed),{code:"mtflpp_source_changed"})};function v(){if(d||!s)return;const t=h(),n=!!t?.getCurrentPost()?.id,o=n&&g();o&&m.action("observePreviewInputs",t);const r=m.filter("previewPauseReason","",t),i=o&&!r&&!m.error;a.notReady=function(t,n,o){return t?n?m.error?.message||o:e.strings.postOnly:e.strings.loading}(n,o,r),a.notReadyState=n?"paused":"loading";const p=o&&(t.isSavingPost()||f>0),w=i&&!a.ready;if(a.ready=i,a.saving=p,m.error)return void s.resume(m.error);if(!i)return void s.pause(a.notReady,a.notReadyState);p&&!u&&s.pause(h().isPreviewingPost()?e.strings.nativePreview:e.strings.saving);const v=u&&!p;u=p;const y={...m.filter("additionalPreviewValues",{},t),post_title:t.getEditedPostAttribute("title")??"",excerpt:t.getEditedPostAttribute("excerpt")??"",content:t.getPostEdits().content??t.getCurrentPost().content,blocks:t.getEditedPostAttribute("blocks"),author:t.getEditedPostAttribute("author"),date:t.getEditedPostAttribute("date"),...Object.fromEntries(Object.entries(e.taxonomies||{}).map(([e,n])=>[`terms:${e}`,t.getEditedPostAttribute(n)])),featured_media:t.getEditedPostAttribute("featured_media")??0};if(m.error)return a.ready=!1,void s.resume(m.error);a.title!==y.post_title&&(a.title=y.post_title,s.setTitle(a.title)),l&&Object.keys(y).length===Object.keys(l).length&&!Object.keys(y).some(e=>y[e]!==l[e])||(l=y,s.changed()),(v||w)&&s.resume(c)}function y(){p||(p=!0,queueMicrotask(()=>{p=!1,v()}))}function b(t,n,o){t&&t.request===n&&t.before===o&&e.base===o&&"string"==typeof t.after&&i.test(t.after)&&"boolean"==typeof t.available?(e.base=t.after,e.available=t.available):w()}a.preparePreview=()=>{const n=function(){const t=h(),n=t.getEditedPostAttribute("author"),o=t.getEditedPostAttribute("date"),r={};for(const[n,o]of Object.entries(e.taxonomies||{})){const e=t.getEditedPostAttribute(o);Array.isArray(e)&&(r[n]=e)}return{...m.filter("additionalPreviewValues",{},t),...n?{author:n}:{},...void 0!==o?{date:o}:{},...Object.keys(r).length?{terms:JSON.stringify(r)}:{},post_title:t.getEditedPostAttribute("title")??"",content:t.getEditedPostContent(),excerpt:t.getEditedPostAttribute("excerpt")??"",featured_media:t.getEditedPostAttribute("featured_media")??0}}(),o=m.capture(null),r={post_title:"text",content:"html",excerpt:"html"},i=m.comparisonValues(o,Object.fromEntries(Object.entries(n).map(([e,t])=>[e,{type:Object.hasOwn(r,e)?r[e]:"value",value:t}])));let a;if(n.base=e.base,null===o)a=t({url:e.endpoint,method:"POST",data:n});else{for(const[e,t]of Object.entries(n))o.set(e,t??"");a=t({url:e.endpoint,method:"POST",body:o})}return a.then(e=>({...e,comparisonValues:i}))};const x=(0,n.subscribe)(y);return(0,o.addFilter)("editor.preSavePost",r,async function(t){if(d||!s||Number(t.id)!==e.postId||!g())return t;a.saving=!0;const n=s.pause(h().isPreviewingPost()?e.strings.nativePreview:e.strings.saving);try{await n}catch{}return t}),t.use(async function(t,n){if(d||!s||!["POST","PUT","PATCH"].includes((t.method||"GET").toUpperCase()))return n(t);const o=function(t){if("string"==typeof t.path&&t.path.startsWith("/"))return t.path.split("?")[0].replace(/\/$/,"");if("string"!=typeof t.url)return"";const n=new URL(t.url,window.location.href),o=new URL(e.restRoot,window.location.href);return n.origin!==o.origin?"":n.searchParams.has("rest_route")?n.searchParams.get("rest_route").replace(/\/$/,""):n.pathname.startsWith(o.pathname)?`/${n.pathname.slice(o.pathname.length)}`.replace(/\/$/,""):""}(t),r=o===e.postRoute||o===`${e.postRoute}/autosaves`,i=!r&&function(t){if("string"!=typeof e.postFormUrl||!(t.body instanceof FormData)||"string"!=typeof t.url)return!1;const n=new URL(t.url,window.location.href),o=new URL(e.postFormUrl,window.location.href);return n.origin===window.location.origin&&n.origin===o.origin&&n.pathname===o.pathname&&n.searchParams.has("meta-box-loader")&&t.body.get("post_ID")===String(e.postId)&&"editpost"===t.body.get("action")}(t);if(!r&&!i)return n(t);f++,a.saving=!0,y();const l=s.pause(e.strings.saving);try{await l}catch{}const u=e.base,p=Array.from(window.crypto.getRandomValues(new Uint8Array(16)),e=>e.toString(16).padStart(2,"0")).join("");let h;try{if(r){const e=await n({...t,headers:{...t.headers,"X-MTFLPP-Base":u,"X-MTFLPP-Request":p}});if(!1===t.parse){try{const t=await e.clone().json();b(t?._mtflpp_receipt,p,u)}catch{w()}return e}if(!e||"object"!=typeof e)return w(),e;const{_mtflpp_receipt:o,...r}=e;return b(o,p,u),r}const o=new FormData;for(const[e,n]of t.body)o.append(e,n);o.set("mtflpp_base",u),o.set("mtflpp_preview",p),o.set("mtflpp_metabox","1"),h=`mtflpp_preview_${p}`;const i=await n({...t,body:o}),a=document.cookie.split(";").map(e=>e.trim()).find(e=>e.startsWith(`${h}=`)),s=a?.slice(h.length+1);return b({request:p,before:u,after:s?.startsWith(`${u}.`)?s.slice(65):"",available:e.available},p,u),c||m.action("nativeMetaboxSaveAcknowledged"),i}catch(e){let t=e?._mtflpp_receipt;try{void 0!==t&&delete e._mtflpp_receipt}catch{t=void 0}const n=e?.data?.status;throw r&&"AbortError"!==e?.name&&"string"==typeof e?.code&&Number.isInteger(n)&&n>=400&&n<500&&t?.after===u?b(t,p,u):w(),e}finally{h&&(document.cookie=`${h}=; Max-Age=0; Path=${e.adminCookiePath}; SameSite=Strict`),f--,y()}}),a.connect=e=>{s=e,v()},a.destroy=()=>{d||(d=!0,x(),m.destroy(),(0,o.removeFilter)("editor.preSavePost",r))},window.addEventListener("pagehide",e=>{e.persisted||a.destroy()}),a}(oe);const s=window.wp?.editor?.PluginPreviewMenuItem,l=window.wp?.plugins?.registerPlugin,c="function"==typeof s&&"function"==typeof l,d=c?{fallbackMedia:window.matchMedia("(max-width: 782px)"),focus(){const e={preventScroll:!0},t=document.querySelector(".editor-preview-dropdown__toggle");t?.focus(e),t&&document.activeElement===t||document.querySelector('.interface-interface-skeleton__content[tabindex="-1"]')?.focus(e)}}:void 0,u=function(e,t,{inlineLauncher:n,nativeLauncher:o}={}){const r=e.strings,i=e.termId??e.postId,a=window,s=function(){let e,t=0,n=0;return{remember(e){try{e&&(t=e.defaultView.scrollY)}catch{}},async restore(e,o,r=()=>!0,i){const a=++n;try{const s=e.defaultView;let l;if(s.scrollTo({top:t,left:0,behavior:"instant"}),o?.ownerDocument===e&&r()){if(await N(s),a!==n||o.ownerDocument!==e||!r())return;if(function(e,t){const n=e.ownerDocument;for(let t=e;t;t=t.parentElement)if("until-found"!==t.getAttribute("hidden")?.toLowerCase()&&(t.hasAttribute("hidden")||"none"===n.defaultView.getComputedStyle(t).display))return!1;let o=!1;for(let r=e;r&&e.isConnected&&e.ownerDocument===n&&t();r=r.parentElement){if("until-found"===r.getAttribute("hidden")?.toLowerCase()){if(r.dispatchEvent(new n.defaultView.Event("beforematch",{bubbles:!0})),!(e.isConnected&&e.ownerDocument===n&&r.isConnected&&r.ownerDocument===n&&r.contains(e)&&t()))break;"until-found"===r.getAttribute("hidden")?.toLowerCase()&&r.removeAttribute("hidden"),o=!0}const i=r.parentElement;i instanceof n.defaultView.HTMLDetailsElement&&!i.open&&r!==Array.from(i.children).find(e=>"summary"===e.localName)&&(i.open=!0,o=!0)}return o}(o,()=>a===n&&r())&&await new Promise(e=>s.setTimeout(e,0)),a!==n||!r())return;const t=o.ownerDocument===e?function(e){if(!e?.isConnected)return null;const t=$(e,!0);if(t?.clipped)return e;if(!t?.boundary)for(const t of e.querySelectorAll("*"))if($(t,!0)?.clipped)return t;for(let n=t?.boundary||e.parentElement;n;){const e=$(n,!0);if(e?.clipped)return n;n=e?.boundary||n.parentElement}return null}(o):null;t&&(function(e,t){const n=B(e,t,!0);if(!n?.inViewport)return void U(e);const{rects:o,extent:r,header:i=0}=n,a=e.ownerDocument.documentElement,s=Math.min(r.x,a.clientWidth),l=Math.min(r.y,a.clientHeight-i);o.some(e=>e.right-e.left>=s-1&&e.bottom-e.top>=l-1)?t&&F(n,t)?.reveal(J(e.ownerDocument.defaultView)):U(e,{nearest:!0,header:i})}(t,i),o.contains(t)&&(l=t))}return t=s.scrollY,l}catch{}},keepInView(t,{canvas:n,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:a,canFollow:s}){try{const l=e?.target===t&&e.canFollow();if(e?.cancel(),!t.isConnected||!s())return;if(!l){const e=B(t,o);if(!F(e,o)?.visible)return}const c=new AbortController,d={target:t,canFollow:()=>!c.signal.aborted&&s(),cancel(){c.abort(),e===d&&(e=null)}};return e=d,function(e,t,n,o,r){const i=e=>{e.isTrusted&&("keydown"!==e.type||_.has(e.key))&&r()},a={capture:!0,passive:!0,signal:o};for(const n of[e,t])for(const e of["wheel","touchmove","pointerdown","keydown"])n?.addEventListener(e,i,a);t?.addEventListener("scroll",()=>{n?.()&&r()},a)}(t.ownerDocument.defaultView,n,a,c.signal,()=>{d.cancel(),i?.()}),async function(e,t,n,o){try{const r=e.ownerDocument.defaultView;if(await N(r),!o())return;const{scrollX:i,scrollY:a}=r,s=n();if(s&&await s,!o()||r.scrollX!==i||r.scrollY!==a)return;let l=B(e,t);l&&!l.rects.length&&(U(e,{behavior:"instant",header:l.header}),l=B(e,t)),F(l,t)?.reveal()}catch{}}(t,o,r,d.canFollow).finally(d.cancel)}catch{}}}}(),l=p(r,{postTitle:t.title??e.postTitle,publicRedirect:e.publicRedirect,inlineLauncher:n,nativeLauncher:o,onOpen:()=>R(),onClose:()=>j(),onRefresh:A,onRetry:e=>e?R(!0):A(),beforeViewportChange:e=>h.beforeViewportChange(e),beforeMove:O,afterMove:()=>{u&&A()}});let c,d,u=!1,f=0;const h=function(e,t,n,o,r=[]){const i=m(r);let a,s,l,c,d;function u(){d?.()}return{get hasPreview(){return!!a},get hasHtmlPreview(){return!!s},get redirectDestination(){return c},load:function(r,f,p=()=>!1,m){const h=new URL(r);if("https:"!==h.protocol&&"http:"!==h.protocol)throw Object.assign(new Error(n.failed),{code:"mtflpp_preview_unsupported_url"});if(h.origin!==window.location.origin){const e=n.originMismatch.replace("%s",()=>h.origin+h.pathname);throw Object.assign(new Error(e),{code:"mtflpp_preview_origin_mismatch"})}const g=h.searchParams.get("mtflpp_token");if(!g)throw new Error(n.failed);return window.crossOriginIsolated&&h.searchParams.set("mtflpp_isolated","1"),u(),h.searchParams.delete("mtflpp_source"),e.followChanges&&h.searchParams.set("mtflpp_source","1"),o(n.updating),new Promise((r,u)=>{const w=e.stage.ownerDocument.createElement("iframe");w.title=n.title,w.className="mtflpp-frame mtflpp-loading",w.setAttribute("aria-hidden","true"),w.setAttribute("tabindex","-1"),w.referrerPolicy="same-origin";let v=!1,y=!1;const b=setTimeout(()=>P(new Error(n.failed)),3e4),x=()=>{y=!0,P()};function P(e){v||(v=!0,e&&(y=!0),clearTimeout(b),d===x&&(d=null),w!==a&&(w.onload=null,w.onerror=null,w.remove()),e?u(e):r())}d=x,w.onload=async()=>{const r=w!==a;if(r||(s=null,l=null),y||!f())return void P();let d,u,v;try{const e=w.contentDocument,t=e?.querySelector('meta[name="meet-the-frontend-live-preview-panel"]');t?.content===g?d=e:r&&!t&&(u=function(e,t){if("text/html"!==e?.contentType)return;const n=e.defaultView?.performance.getEntriesByType("navigation")[0];if(!(n?.redirectCount>0))return;const o=new URL(n.name);return o.origin!==t.origin||o.pathname===t.pathname&&o.search===t.search?void 0:o.pathname}(e,h))}catch{}d&&(e.followChanges&&i.capture(d,r?m:void 0),d.documentElement.style.setProperty("overscroll-behavior","contain","important")),d&&r&&(t.remember(s),e.followChanges&&p()&&s&&(v=i.findChange(s,d))),r&&a&&(a.onload=null,a.onerror=null,a.remove()),a=w,s=d,l=null,c=u,w.classList.remove("mtflpp-loading"),w.removeAttribute("aria-hidden"),w.removeAttribute("tabindex");const b=()=>!y&&f()&&w===a&&d===s&&(!d||w.contentDocument===d);let x;if(d&&r){const n=e.canvasTarget&&(t=>e.canvasTarget(w,t,{fitTarget:!0}));x=await t.restore(d,v,()=>b()&&e.followChanges&&p(),n)}b()?(l=x,o(n.current,"ready"),P()):P()},w.onerror=()=>{w===a?(s=null,l=null,c=void 0,f()&&o(n.failed,"error")):P(new Error(n.failed))},w.src=h.href,e.stage.append(w)})},cancel:u,beforeViewportChange({canvasTarget:n,canFollow:o,...r}){const i=l,c=s,d=a;if(i&&c)return t.keepInView(i,{...r,canvasTarget:e=>n(d,e),canFollow:()=>i===l&&c===s&&d.contentDocument===c&&e.visible&&e.followChanges&&o()})},clear(){u(),t.remember(s),a&&(a.onload=null,a.onerror=null),a=null,s=null,l=null,c=void 0,e.clearPreview()}}}(l,s,r,k,e.comparisonExcludedSelectors);let g,w,v,y,b,x,P,M,E=!1;try{a.BroadcastChannel&&(M=new a.BroadcastChannel(`meet-the-frontend-live-preview-panel:${e.endpoint}:${i}:${e.userId}`),M.onmessage=e=>{"takeover"===e.data?.type&&u&&(j(!0),k(r.handedOff,"conflict",{reason:"handed-off"}))},a.addEventListener("pagehide",e=>{e.persisted||M.close()}))}catch{M?.close(),M=null}function k(e,n="loading",{canRetry:o=!0,reason:r=""}={}){"ready"===n&&(E=!1),l.report(e,n,{canTakeOver:!!M,hasPreview:h.hasPreview,canRetry:o,reason:r,hasHtmlPreview:h.hasHtmlPreview,redirectDestination:h.redirectDestination,canRefresh:u&&!t.saving&&["ready","error"].includes(n)&&("error"!==n||o)})}function C(e){const t=e?.code,n=function(e){const t=e?.code;return"mtflpp_post_locked"===t?"post-locked":["mtflpp_invalid_nonce","rest_cookie_invalid_nonce","mtflpp_preview_conflict","mtflpp_source_changed","mtflpp_acf_unavailable","mtflpp_integration_failed"].includes(t)?"reload":["mtflpp_cannot_preview","rest_forbidden","rest_cannot_edit"].includes(t)?"permission":"mtflpp_preview_origin_mismatch"===t?"origin-mismatch":"mtflpp_preview_unsupported_url"===t?"unsupported-url":""}(e);n&&(u=!1,S(),h.cancel(),b?.()),k("string"==typeof t?e.message:r.failed,"post-locked"===n?"paused":"error",{reason:n,canRetry:!n})}function S(){clearTimeout(c),d=void 0}function L(e){if(void 0===e&&void 0===d)return;const t=performance.now();void 0!==e&&(d=t+e),clearTimeout(c);const n=Math.ceil(d-t);n>0?c=setTimeout(V,n):V()}function T(){u&&(f+=1,E=!0,h.cancel(),t.saving||k(r.stale,"stale"),t.saving||t.previewing?S():L(275))}function V(){if(!u||g||!1===t.ready||t.previewing||t.saving)return;S();const n=f;k(r.updating),g=(async()=>{try{if(await t.idle,!u||!1===t.ready||t.saving)return;const o=e.base;let i,a;v=t.preparePreview();try{i=await v}catch(e){a=e}finally{v=null}if(await t.idle,!u||!1===t.ready||t.saving||o!==e.base)return;if(a)throw a;if("string"!=typeof i.url)throw Object.assign(new Error(i.message||r.failed),{code:i.code});u&&n===f&&await function(e,t,n){return h.load(e,()=>u&&t===f,()=>l.followChanges&&E,n)}(i.url,n,i.comparisonValues)}catch(e){u&&!t.saving&&C(e)}finally{g=null,L()}})()}function O(){f+=1,h.clear()}function j(e=!1){l.setVisible(e),u=!1,S(),O(),clearTimeout(P),P=null,x?.abort(),l.returnToEditor(),b?.()}async function R(n=!1){if(l.setVisible(!0),u)return;if(w)return void C(w);if(y){if(x&&!x.signal.aborted)return;const e=f;try{await y}catch{}return void(l.visible&&e===f&&R(n))}if(!1===t.ready)return void k(t.notReady,t.notReadyState??"paused",{canRetry:!1});if(!e.available)return void k(r.unavailable,"error",{canRetry:!1,reason:"unavailable"});if(!a.isSecureContext||!navigator.locks)return void k(r.browser,"error",{canRetry:!1,reason:"browser"});const o=n&&M?new AbortController:null;let s=!1;x=o,o?(k(r.waiting,"handover"),P=setTimeout(()=>{s=!0,o.abort()},15e3)):k(t.saving?r.saving:r.updating);try{const n=o?{signal:o.signal}:{ifAvailable:!0};if(y=navigator.locks.request(`meet-the-frontend-live-preview-panel:${e.endpoint}:${i}`,n,async e=>{if(clearTimeout(P),P=null,x=null,l.visible&&!o?.signal.aborted)if(e){k(t.saving?r.saving:r.updating);try{await new Promise(e=>{b=e,u=!0,f+=1,V()}),await g}finally{b=null}}else k(M?r.conflict:r.closeOther,"conflict",{reason:M?"other-tab":"manual"})}),o)try{M.postMessage({type:"takeover"})}catch(e){throw o.abort(),u&&j(!0),await y.catch(()=>{}),e}await y,l.visible&&s&&k(r.takeoverTimeout,"conflict",{reason:"busy"})}catch(e){u=!1,l.visible&&s?k(r.takeoverTimeout,"conflict",{reason:"busy"}):l.visible&&"AbortError"!==e.name&&C(e)}finally{clearTimeout(P),P=null,x=null,y=null}}function A(e=!0){t.saving||(e||(E=!1),u?(f+=1,h.cancel(),L(0)):R())}return{changed:T,pause:function(e=r.saving,t="loading"){return f+=1,S(),h.cancel(),(u||l.visible&&"paused"===t)&&k(e,t,{canRetry:!1}),v},resume:function(e){w=e,e?l.visible&&C(e):!l.visible||u||y?T():R()},setTitle:l.setTitle,openFromLauncher:l.openFromLauncher,start:()=>{l.visible&&R()},get pending(){return g}}}(oe,a,{nativeLauncher:d});a.connect(u),c&&l("meet-the-frontend-live-preview-panel",{render:()=>(0,e.createElement)(s,{role:"menuitem",icon:null,info:oe.strings.showLivePreviewHelp,onClick:()=>window.requestAnimationFrame(()=>u.openFromLauncher())},oe.strings.showLivePreview)})}catch(e){a?.destroy(),function(e,t){document.getElementById("mtflpp-panel")?.remove(),document.getElementById("mtflpp-toggle")?.remove(),document.getElementById("mtflpp-publish-preview")?.remove(),document.getElementById("mtflpp-term-preview")?.remove();const n=document.createElement("div");n.className="notice notice-error",n.setAttribute("role","alert");const o=document.createElement("p");o.textContent=e,n.append(o),(document.getElementById("wpbody-content")||document.body).prepend(n),console.error("Meet the Frontend – Live Preview Panel could not start.",t)}(oe.strings.bootFailed,e)}}})();
     1(()=>{"use strict";const e=window.wp.element,t=window.wp.apiFetch,n=window.wp.data,o=window.wp.hooks,r="meet-the-frontend-live-preview-panel",i=/^[a-f0-9]{64}$/,a=window.wp.preferences,s=window.wp.components,l=window.wp.notices,c=window.wp.primitives,d=window.ReactJSXRuntime,u={refresh:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M12 5.5L17.7929 11.2929C18.1834 11.6834 18.1834 12.3166 17.7929 12.7071L16 14.5M16 5.5H12V9.5M12 18.5L6.20711 12.7071C5.81658 12.3166 5.81658 11.6834 6.20711 11.2929L8 9.5M8 18.5H12V14.5"})}),more:(0,d.jsxs)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,d.jsx)(c.Path,{d:"M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z",fill:"currentColor",stroke:"none"}),(0,d.jsx)(c.Path,{d:"M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z",fill:"currentColor",stroke:"none"}),(0,d.jsx)(c.Path,{d:"M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z",fill:"currentColor",stroke:"none"}),(0,d.jsx)(c.Path,{d:"M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z"}),(0,d.jsx)(c.Path,{d:"M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z"}),(0,d.jsx)(c.Path,{d:"M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z"})]}),expand:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M4.75 10V4.75H10M4.75 4.75L10 10M14 19.25H19.25V14M19.25 19.25L14 14"})}),compact:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M10 4.75V10H4.75M10 10L4.75 4.75M19.25 14H14V19.25M14 14L19.25 19.25"})}),pip:(0,d.jsxs)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,d.jsx)(c.Path,{d:"M4.75 9.25V16C4.75 16.6904 5.30964 17.25 6 17.25H8M4.75 9.25V6C4.75 5.30964 5.30964 4.75 6 4.75H16C16.6904 4.75 17.25 5.30964 17.25 6V8M4.75 9.25H8"}),(0,d.jsx)(c.Path,{d:"M10.75 11.25C10.75 10.9739 10.9739 10.75 11.25 10.75H18.75C19.0261 10.75 19.25 10.9739 19.25 11.25V18.75C19.25 19.0261 19.0261 19.25 18.75 19.25H11.25C10.9739 19.25 10.75 19.0261 10.75 18.75V11.25Z",fill:"currentColor"})]}),move:(0,d.jsxs)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,d.jsx)(c.Path,{d:"M9.25 5.75H8.75V6.25H9.25V5.75Z",fill:"currentColor",stroke:"none"}),(0,d.jsx)(c.Path,{d:"M9.25 11.75H8.75V12.25H9.25V11.75Z",fill:"currentColor",stroke:"none"}),(0,d.jsx)(c.Path,{d:"M9.25 17.75H8.75V18.25H9.25V17.75Z",fill:"currentColor",stroke:"none"}),(0,d.jsx)(c.Path,{d:"M15.25 5.75H14.75V6.25H15.25V5.75Z",fill:"currentColor",stroke:"none"}),(0,d.jsx)(c.Path,{d:"M15.25 11.75H14.75V12.25H15.25V11.75Z",fill:"currentColor",stroke:"none"}),(0,d.jsx)(c.Path,{d:"M15.25 17.75H14.75V18.25H15.25V17.75Z",fill:"currentColor",stroke:"none"}),(0,d.jsx)(c.Path,{d:"M9.25 5.75H8.75V6.25H9.25V5.75Z"}),(0,d.jsx)(c.Path,{d:"M9.25 11.75H8.75V12.25H9.25V11.75Z"}),(0,d.jsx)(c.Path,{d:"M9.25 17.75H8.75V18.25H9.25V17.75Z"}),(0,d.jsx)(c.Path,{d:"M15.25 5.75H14.75V6.25H15.25V5.75Z"}),(0,d.jsx)(c.Path,{d:"M15.25 11.75H14.75V12.25H15.25V11.75Z"}),(0,d.jsx)(c.Path,{d:"M15.25 17.75H14.75V18.25H15.25V17.75Z"})]}),warning:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M12 8L12 13M12 14.5L12 16M4.75 12C4.75 7.99593 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12Z",strokeLinejoin:"round"})}),info:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M12 16V11M12 9.5V8M19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12C4.75 7.99594 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12Z",strokeLinejoin:"round"})}),close:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M7.75 16.25L16.25 7.75M16.25 16.25L7.75 7.75"})}),check:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M7 12L10 15L17 8"})}),chevron:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M7 11L12 15L17 11"})}),desktop:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M4.75 16.75V17H3.25C3.11193 17 3 17.1119 3 17.25H21C21 17.1119 20.8881 17 20.75 17H19.25V16.75M4.75 16.75V8.5C4.75 7.80964 5.30964 7.25 6 7.25H18C18.6904 7.25 19.25 7.80964 19.25 8.5V16.75M4.75 16.75H19.25"})}),tablet:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M10 16.5H14M18.25 18V6C18.25 5.30964 17.6904 4.75 17 4.75H7C6.30964 4.75 5.75 5.30964 5.75 6L5.75 18C5.75 18.6904 6.30964 19.25 7 19.25H17C17.6904 19.25 18.25 18.6904 18.25 18Z"})}),mobile:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M11 16.5H13M16.25 18V6C16.25 5.30964 15.6904 4.75 15 4.75H9C8.30964 4.75 7.75 5.30964 7.75 6L7.75 18C7.75 18.6904 8.30964 19.25 9 19.25H15C15.6904 19.25 16.25 18.6904 16.25 18Z"})})};function f(e,t,n="right"){const o=e&&!Array.isArray(e)&&e.bounds&&["x","y","width","height"].every(t=>Number.isFinite(e.bounds[t]))&&e.bounds.width>0&&e.bounds.height>0&&[null,"left","center","right"].includes(e.dock)&&"boolean"==typeof e.expanded&&(void 0===e.anchor||["left","center","right"].includes(e.anchor));let r=!!o&&e.expanded;const i={width:480,height:393},a=o?{...e.bounds}:{x:0,y:0,...i};let s=o?e.dock:n,l=s||o&&e.anchor||"right";function c(){return"left"===l?0:"center"===l?.5:1}function d(e,n=t(!s),o=320,r=220){return e.width=Math.min(n.width,Math.max(Math.min(o,n.width),e.width)),e.height=Math.min(n.height,Math.max(Math.min(r,n.height),e.height)),e.x=Math.max(n.left,Math.min(n.right-e.width,e.x)),e.y=Math.max(n.top,Math.min(n.bottom-e.height,e.y)),e}function u(e){if(!s)return e;const n=t();return e.x="left"===s?n.left:"center"===s?n.left+(n.width-e.width)/2:n.right-e.width,e.y=n.bottom-e.height,e}return{area:t,compactRect:function(){return u(d({...a}))},launcherRect:function(e){return u(d({...e,x:a.x+(a.width-e.width)*c(),y:a.y+a.height-e.height},t(!s),1,1))},usableEdge:function(e){return!(s&&(e.includes("s")||"left"===s&&e.includes("w")||"right"===s&&e.includes("e")))},get anchor(){return l},get anchorFactor(){return c()},get dock(){return s},get expanded(){return r},get layout(){return{bounds:{...a},dock:s,anchor:l,expanded:r}},toggleExpanded(){r=!r},dockTo:function(e="right",t=!1){t&&Object.assign(a,i),r=!1,l=s=e},resize(e,n,o,r){Object.assign(a,function(e,n,o,r){const i=t(!s),a=n.includes("e")||n.includes("w"),c=n.includes("n")||n.includes("s"),d=function(e){return"center"===l?.5:e.includes("w")?1:0}(n),u=e.x+e.width*d,f=n.includes("n"),p=e.y+(f?e.height:0),m=function(e,t,n){return 0===n?e.right-t:1===n?t-e.left:2*Math.min(t-e.left,e.right-t)}(i,u,d),h=f?p-i.top:i.bottom-p,g=(n.includes("w")?-o:o)*(.5===d?2:1),w=Math.max(Math.min(320,m),Math.min(m,e.width+g)),v=Math.max(Math.min(220,h),Math.min(h,e.height+(f?-r:r))),y=a&&0!==o&&w!==e.width,b=c&&0!==r&&v!==e.height,x=f?p-v:p;return{x:y?u-w*d:e.preferredBounds.x,y:b?x:e.preferredBounds.y,width:y?w:e.preferredBounds.width,height:b?v:e.preferredBounds.height}}(e,n,o,r))},move:function(e,n,o,r=!1){const i=d({...e,x:e.x+n,y:e.y+o},t(!0),r?1:320,r?1:220);a.x=i.x+(r?(i.width-a.width)*c():0),a.y=i.y+(r?i.height-a.height:0),s=null}}}function p(t,{postTitle:o="",publicRedirect:r,inlineLauncher:i,nativeLauncher:c,canRememberVisibility:d=!0,onOpen:p,onClose:m,onRefresh:h,onRetry:g,beforeMove:w,afterMove:v,beforeViewportChange:y}){const b=window,x=document,M="meet-the-frontend-live-preview-panel",P=(0,n.select)(a.store),S=(0,n.dispatch)(a.store),k="width"===P.get(M,"fit")?"width":"automatic";S.setDefaults(M,{rememberVisibility:!0,rememberPosition:!0,panelOpen:!0,scrollToChanges:!0,viewport:"desktop",fitMode:k,customZoom:100,tabletOrientation:"portrait",mobileOrientation:"portrait"});const E=()=>!i&&(!c||c.fallbackMedia.matches);let C=!1!==P.get(M,"rememberVisibility"),L=!1!==P.get(M,"rememberPosition"),O=!1!==P.get(M,"scrollToChanges");const T=i?.parentElement??x.getElementById("mtflpp-toggle"),V=x.getElementById("mtflpp-panel");if(!T||!V)throw new Error("Preview panel markup is missing.");const A=i||function(t){let n;const{title:o,moveHelp:r}=t.dataset;return(0,e.flushSync)(()=>(0,e.createRoot)(t).render((0,e.createElement)(s.Button,{ref:e=>{n=e},variant:"secondary",label:o,title:o,description:r,"aria-controls":"mtflpp-panel","aria-expanded":!1},(0,e.createElement)("span",{className:"mtflpp-launcher-label"},o)))),n}(T),j=V.querySelector(".mtflpp-move-control"),R=V.querySelector(".mtflpp-resize"),_=V.querySelectorAll("[data-resize-edge]"),H=V.querySelector(".mtflpp-header"),$=V.querySelector(".mtflpp-caption"),F=V.querySelector(".mtflpp-viewport"),N=V.querySelector(".mtflpp-canvas"),B=V.querySelector(".mtflpp-stage"),D=V.querySelector(".mtflpp-empty"),q=V.querySelector(".mtflpp-devicebar"),W=V.querySelector(".mtflpp-dimensions"),z=V.querySelector(".mtflpp-feedback"),I=V.querySelector('[role="status"]');let Z;const J=function(e,t,n,o={},r=()=>{},i={desktop:"Desktop",tablet:"Tablet",mobile:"Phone"}){const a=e.ownerDocument.defaultView,s=e.querySelector(".mtflpp-canvas"),l=e.querySelector(".mtflpp-canvas-space"),c=n.querySelector(".mtflpp-dimensions-text"),d={desktop:[1280,800],tablet:[768,1024],mobile:[390,844]},u=Object.keys(d);let f=u.includes(o.device)?o.device:"desktop";const p=["automatic","window","width","custom"];let m=p.includes(o.fit)?o.fit:"automatic";const h=e=>Number.isInteger(e)&&e>=10&&e<=400;let g,w=h(o.customZoom)?o.customZoom:100,v=100;const y=e=>"desktop"===e?"landscape":"portrait",b=Object.fromEntries(u.map(e=>[e,"desktop"!==e&&["portrait","landscape"].includes(o[`${e}Orientation`])?o[`${e}Orientation`]:y(e)])),x=()=>b[f]===y(f)?d[f]:[...d[f]].reverse(),M=()=>"width"===m;let P,S,k;const E=a.matchMedia("(prefers-reduced-motion: no-preference)");function C(){const t=e.ownerDocument.defaultView.devicePixelRatio;return Number.isFinite(t)&&t>0?t:1}function L(e,t){if("custom"===m)return w/100/C();const n=s.clientWidth/e;if(M())return n;const o=Math.min(n,s.clientHeight/t);return"automatic"===m?Math.min(1/C(),o):o}function O(e,n){P=e;const[o,r]=x(),i=Math.max(0,(s.clientWidth-o*P)/2),a=Math.max(0,(s.clientHeight-r*P)/2);Object.assign(l.style,{width:`${Math.max(s.clientWidth,i+o*P)}px`,height:`${Math.max(s.clientHeight,a+r*P)}px`}),Object.assign(t.style,{left:`${i}px`,top:`${a}px`,transform:`scale(${P})`});const c=o*P>s.clientWidth+.01||r*P>s.clientHeight+.01,d="custom"===m||M();s.tabIndex=d&&c?0:-1,s.scrollLeft="custom"===m?n.x*P:0,s.scrollTop=d?n.y*P:0}function T(){if(!S)return;const e=S;S=null,e.window.cancelAnimationFrame(e.frame),e.resolve?.()}function V(e,t,n,o){return t<=0||o&&e<-1&&t<n?Math.max(e,t-n):e>=n||o&&e>0&&t>n+1?Math.min(e,t-n):0}function A(o=!1,a=!1){T();const[l,d]=x();if(Object.assign(t.style,{width:`${l}px`,height:`${d}px`}),!e.clientWidth||!e.clientHeight)return;const u=C(),p=`${i[f]} (${l} × ${d}) · `,h=Math.max(400,Math.ceil(e.clientWidth/l*u*100)),y=`${p}${"0".repeat(String(h).length)}%`;n.dataset.reserve!==y&&(n.dataset.reserve=y);const b=a?{x:0,y:0}:{x:(s.scrollLeft||0)/(P||1),y:(s.scrollTop||0)/(P||1)};if(s.style.overflowX="hidden",s.style.overflowY="hidden","custom"===m){const e=L(l,d);for(let t=0;t<2;t++)l*e>s.clientWidth+.01&&(s.style.overflowX="scroll"),d*e>s.clientHeight+.01&&(s.style.overflowY="scroll")}else M()&&d*L(l,d)>e.clientHeight&&(s.style.overflowY="scroll");if(!s.clientWidth||!s.clientHeight)return;const k=L(l,d),V=Math.round(k*u*100),A=V!==v||u!==g;v=V,g=u;const j=`${p}${"custom"===m?w:v}%`;c.textContent!==j&&(c.textContent=j),A&&r();const R=P??k;if(!o||!E.matches||R===k)return void O(k,b);const _={window:e.ownerDocument.defaultView,frame:null},H=_.window.performance.now();S=_;const $=e=>{O(e,b),_.scrollLeft=s.scrollLeft,_.scrollTop=s.scrollTop};$(R);const F=e=>{if(S!==_)return;const t=Math.min(1,Math.max(0,(e-H)/200));$(R+(k-R)*(1-(1-t)**3)),t<1?_.frame=_.window.requestAnimationFrame(F):T()};_.frame=_.window.requestAnimationFrame(F)}function j(){A()}function R(){k?.();const t=e.ownerDocument.defaultView.matchMedia(`(resolution: ${C()}dppx)`);t.addEventListener("change",R),k=()=>t.removeEventListener("change",R),j()}let _=new a.ResizeObserver(j);return _.observe(e),E.addEventListener("change",j),a.addEventListener("resize",R),R(),{get device(){return f},get fit(){return m},get customZoom(){return w},get zoomPercent(){return"custom"===m?w:v},get dpr(){return C()},get orientation(){return b[f]},canvasTarget:function(e,t,{fitTarget:n=!1}={}){const o=e.getBoundingClientRect(),r=s.getBoundingClientRect(),i=o.left-r.left-s.clientLeft,a=o.top-r.top-s.clientTop,l=V(i+t.left*P,i+t.right*P,s.clientWidth,n),c=V(a+t.top*P,a+t.bottom*P,s.clientHeight,n),d=Math.max(t.left,-i/P),u=Math.min(t.right,(s.clientWidth-i)/P);return{visible:!l&&!c,visibleCenterX:d<u?(d+u)/2:void 0,distance:Math.hypot(l,c),reveal(e="instant"){(l||c)&&s.scrollBy({left:l,top:c,behavior:e})}}},canvasWasPanned:function(){return!!S&&(s.scrollLeft!==S.scrollLeft||s.scrollTop!==S.scrollTop)},whenSettled:function(){if(!S)return;const e=S;return e.done??=new Promise(t=>{e.resolve=t}),e.done},finishMotion(){S&&j()},select(e,{animate:t=!1,keepPan:n=!1}={}){if(!u.includes(e))return;const o=f!==e;f=e,o?A(t,!n):S||j()},rotate({animate:e=!1,keepPan:t=!1}={}){"desktop"!==f&&(b[f]="portrait"===b[f]?"landscape":"portrait",A(e,!t))},setFit(e){p.includes(e)&&m!==e&&(m=e,A(!1,!0))},setZoom(e){if(!h(e)||"custom"===m&&w===e)return;const t="custom"!==m;w=e,m="custom",A(!1,t)},layout:j,beforeMove(){T(),_.disconnect(),k?.(),e.ownerDocument.defaultView.removeEventListener("resize",R)},afterMove(){_=new e.ownerDocument.defaultView.ResizeObserver(j),_.observe(e),e.ownerDocument.defaultView.addEventListener("resize",R),R()}}}(F,B,W,{device:P.get(M,"viewport"),fit:P.get(M,"fitMode")??k,customZoom:P.get(M,"customZoom"),tabletOrientation:P.get(M,"tabletOrientation"),mobileOrientation:P.get(M,"mobileOrientation")},()=>Ce(),t),G=x.querySelector("#wpbody-content > .wrap"),U=x.getElementById("wpadminbar");function X(e=!1){const t=Math.max(1,x.documentElement.clientWidth),n=Math.max(1,x.documentElement.clientHeight),o=x.documentElement.getBoundingClientRect().left+b.scrollX,r=!e&&G?.getBoundingClientRect(),i=r?Math.max(0,"rtl"===b.getComputedStyle(G).direction?r.left-o:o+t-r.right):20,a=e?0:i,s=Math.min(a,(t-1)/2),l=Math.min(Math.max(0,U?.getBoundingClientRect().bottom||0)+a,n-1),c=t-s,d=n-Math.min(a,n-l-1);return{left:s,top:l,right:c,bottom:d,width:c-s,height:d-l}}let Y,K=d&&(!C||!1!==P.get(M,"panelOpen")),Q=!1;const ee=P.get(M,"layout"),te=P.get(M,"position")??ee?.dock??ee?.anchor;let ne=["left","center","right"].includes(te)?te:"right";const oe=f(L?ee:void 0,X,ne),{compactRect:re,usableEdge:ie}=oe;let ae,se=!1,le="",ce=!1,de={text:t.loading,state:"loading",hasPreview:!1,canRetry:!1,reason:""},ue=!1;function fe(e){const n="string"==typeof e?e.replace(/\s+/g," ").trim():"";$.textContent=n?`${t.preview} — ${n}`:t.title,$.title=$.textContent,Y&&(Y.document.title=$.textContent)}function pe(){const{text:e,state:n,hasPreview:o,reason:r}=de;return"handover"===n?{heading:t.switchingPreview,description:e,note:t.tabEdits}:"conflict"===n?{heading:e,description:{"handed-off":t.handedOffHelp,busy:t.takeoverTimeoutHelp,manual:t.closeOtherHelp}[r]||t.conflictHelp,note:"manual"===r?t.manualSwitchHint:t.tabEdits}:"paused"===n?{heading:t.pausedTitle,description:e,note:""}:"error"===n?function(){const{text:e,hasPreview:n,canRetry:o,reason:r}=de;if("origin-mismatch"===r)return{heading:t.originMismatchTitle,description:n?`${e} ${t.previousPreview}`:e,note:""};if("unavailable"===r||"browser"===r)return{heading:"unavailable"===r?t.unavailableTitle:t.browserTitle,description:e,note:""};const i={reload:t.reviewBeforeReload,"reload-before-save":t.nativePreviewAcfReload}[r];if(!n){let n=e;return e===t.failed&&(n=o?t.failedHelp:""),i&&(n+=` ${i}`),{heading:t.failed,description:n,note:""}}return{heading:e===t.failed?t.refreshFailed:e,description:i||t.previousPreview,note:""}}():o?{heading:e,description:"",note:""}:{heading:t.loading,description:t.preparing,note:""}}function me(){return se?"handover"===de.state?t.takingOver:t.takeOver:t.retry}function he(e){return!e||["handover","paused"].includes(de.state)?"info":"error"!==de.state||de.canRetry?"warning":"error"}function ge(){return de.redirectDestination?`${t.redirected} ${de.redirectDestination}`:de.hasHtmlPreview&&ae?`${t.publicRedirected} ${ae}`:""}function we(){const{state:e,hasPreview:n,canRetry:o,reason:r}=de,i=n&&["error","conflict","handover","paused"].includes(e),a=!n||i||le?"":ge();if(z.hidden=!i&&!le&&!a,z.tabIndex=z.hidden?-1:0,V.dataset.hasFeedback=String(!z.hidden),z.hidden)return null;if(a)return{heading:a,status:"info",dismissible:!1};const{heading:s,description:l}=pe();return{heading:i?s:le,description:i?l:t.windowNoticeHelp,status:he(i),dismissible:!i,retry:i&&(se||o&&["error","conflict"].includes(e)),close:i&&"error"===e&&!o&&!["reload","reload-before-save"].includes(r),disabled:"handover"===e,action:me()}}function ve(e){de.hasPreview&&["error","conflict","handover","paused"].includes(de.state)||(le=e,Ce()),I.textContent=`${e} ${t.windowNoticeHelp}`}function ye(){le="",Ce()}function be(e,t="loading",{canTakeOver:n=!1,hasPreview:o=!1,hasHtmlPreview:i=!1,redirectDestination:a,canRefresh:s=!1,canRetry:l=!0,reason:c=""}={}){const d=V.ownerDocument.activeElement,u=V.contains(d),f=!o&&(de.state!==t||de.text!==e||de.reason!==c),p=de.hasPreview!==o;de={text:e,state:t,canTakeOver:n,hasPreview:o,hasHtmlPreview:i,redirectDestination:a,canRefresh:s,canRetry:l,reason:c},["error","conflict","handover","paused"].includes(t)&&(le=""),V.dataset.state=t,V.dataset.hasPreview=String(o),se=n&&["conflict","handover"].includes(t),D.hidden=o,q.hidden=!o;const{heading:m,description:h,note:g}=pe();f&&(D.scrollTop=0);const w="ready"!==t||le?"":ge();I.textContent=o?[m,h,g,w].filter(Boolean).join(" "):m,Ce(),p&&J.layout(),function(e,t){e&&t&&(!V.contains(e)||e.closest("[hidden]")||e.disabled||!de.hasPreview&&N.contains(e))&&Z.focus(D.hidden?"actions":"empty-title")}(d,u),K&&"ready"===t&&i&&!a&&async function(){if(r&&!ce){ce=!0;try{const e=new URL(r.endpoint);if(e.origin!==b.location.origin)return;const t=await b.fetch(e,{credentials:"same-origin",cache:"no-store",redirect:"error",headers:{"X-WP-Nonce":r.nonce}});if(!t.ok)return;const{destination:n}=await t.json();if("string"!=typeof n||!n)return;if(ae=n,!K)return;Ce(),"ready"!==de.state||!de.hasHtmlPreview||de.redirectDestination||le||(I.textContent=ge())}catch{}}}()}function xe(e){d&&C&&P.get(M,"panelOpen")!==e&&S.set(M,"panelOpen",e)}function Me(){L&&S.set(M,"layout",oe.layout)}function Pe(){const e=T.hidden;T.hidden=!1,T.style.maxWidth=`${X(!oe.dock).width}px`;const t={width:T.offsetWidth,height:T.offsetHeight};return T.hidden=e,oe.launcherRect(t)}function Se(){if(Y)return;if(!K&&E()){const e=Pe(),t=oe.anchorFactor;Object.assign(T.style,{left:`${e.x+e.width*t}px`,top:`${e.y+e.height}px`,transform:`translate(${-100*t}%, -100%)`})}let e=re();if(V.dataset.anchor=oe.anchor,oe.expanded){const t=X();e={x:t.left,y:t.top,width:t.width,height:t.height}}Object.assign(V.style,{left:`${e.x}px`,top:`${e.y}px`,width:`${e.width}px`,height:`${e.height}px`,transform:""})}function ke(e="right",t=!1){oe.dockTo(e,t),ne=e,S.set(M,"position",ne),Se(),Me(),Ce()}function Ee(){return"function"==typeof b.documentPictureInPicture?.requestWindow}function Ce(){if(!Z)return;const e=V.ownerDocument.fullscreenElement===V,n=!Y&&!e,o=n&&!oe.expanded;V.classList.toggle("mtflpp-expanded",oe.expanded),R.hidden=!o;for(const e of _)e.hidden=!o||!ie(e.dataset.resizeEdge);const r=se||de.canRetry&&["error","conflict"].includes(de.state);var i;Z.update({inPage:n,inPip:!!Y,movable:o,dock:oe.dock,canRememberVisibility:d,rememberVisibility:C,rememberPosition:L,followChanges:O,device:J.device,busy:de.hasPreview&&["stale","loading","handover"].includes(de.state)&&de.text!==t.saving,empty:de.hasPreview?null:{...pe(),busy:["loading","stale","ready","handover"].includes(de.state),icon:["paused","conflict"].includes(de.state)||["unavailable","browser","origin-mismatch"].includes(de.reason)?"info":"warning",retry:r,disabled:"handover"===de.state,close:"error"===de.state&&!r,action:me()},notice:we(),fit:J.fit,orientation:J.orientation,customZoom:J.customZoom,zoomPercent:J.zoomPercent,dpr:J.dpr,canRefresh:de.canRefresh,hasPreview:de.hasPreview,canPip:n&&Ee(),canFullscreen:n&&!!x.fullscreenEnabled,mode:e||oe.expanded?"compact":"expand",modeLabel:(i=e,i?t.exitFullscreen:oe.expanded?t.compact:t.expand)})}function Le(){Z.closeMenu(),Y?Y.close():x.fullscreenElement!==V?(oe.toggleExpanded(),Se(),Me(),Ce(),Z.focus("mode")):x.exitFullscreen().then(ye,()=>ve(t.fullscreenFailed))}function Oe(e,n=!1,o){const r=e===A,i=e===H,a=()=>o||("left"===oe.anchor?"ne":"nw"),s=()=>Y||!r&&oe.expanded||x.fullscreenElement===V||n&&!ie(a());let l,c;const d=()=>({...r?Pe():re(),preferredBounds:oe.layout.bounds});function u(){if(c=null,l)if(n||r)Se();else{const e=re(),t=e.x-parseFloat(V.style.left),n=e.y-parseFloat(V.style.top);Object.assign(V.style,{width:`${e.width}px`,height:`${e.height}px`,transform:`translate3d(${t}px, ${n}px, 0)`})}}function f(){if(!l)return;const{pointer:t,moved:n}=l;l=null,b.cancelAnimationFrame(c),e.hasPointerCapture(t)&&e.releasePointerCapture(t),V.classList.remove("mtflpp-dragging"),e.classList.remove("mtflpp-edge-active"),x.documentElement.classList.remove("mtflpp-window-dragging"),x.documentElement.style.removeProperty("--mtflpp-drag-cursor"),Se(),n&&(r&&(ue=!0),Me(),Ce())}e.addEventListener("pointerdown",t=>{0!==t.button||s()||i&&t.target.closest('button, a, [role="button"]')||(r&&(ue=!1),t.preventDefault(),r?A.focus({preventScroll:!0}):e===j&&Z.focus("move"),Z.closeMenu(),l={...d(),pointer:t.pointerId,pointerX:t.clientX,pointerY:t.clientY},e.setPointerCapture(t.pointerId))}),e.addEventListener("pointermove",t=>{if(!l||l.pointer!==t.pointerId)return;const o=t.clientX-l.pointerX,i=t.clientY-l.pointerY;!l.moved&&Math.abs(o)+Math.abs(i)<4||(l.moved=!0,V.classList.add("mtflpp-dragging"),n&&e.classList.add("mtflpp-edge-active"),x.documentElement.style.setProperty("--mtflpp-drag-cursor",n?b.getComputedStyle(e).cursor:"grabbing"),x.documentElement.classList.add("mtflpp-window-dragging"),n?oe.resize(l,a(),o,i):oe.move(l,o,i,r),c||(c=b.requestAnimationFrame(u)))});for(const t of["pointerup","pointercancel","lostpointercapture"])e.addEventListener(t,f);b.addEventListener("blur",f),i||o||e.addEventListener("keydown",e=>{const o={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[e.key];if(!o||e.altKey||e.ctrlKey||e.metaKey||s())return;e.preventDefault(),Z.closeMenu();const i=d(),l=e.shiftKey?40:10;n?oe.resize(i,a(),o[0]*l,o[1]*l):oe.move(i,o[0]*l,o[1]*l,r),Se(),Me(),Ce();const c=re();I.textContent=n?`${t.resize}: ${Math.round(c.width)} × ${Math.round(c.height)}`:t.moved})}fe(o),H.addEventListener("dblclick",e=>{Y||e.target.closest("button, a")||Le()}),x.addEventListener("fullscreenchange",Ce),R.addEventListener("keydown",e=>{"Escape"===e.key&&R.classList.add("mtflpp-help-dismissed")}),R.addEventListener("blur",()=>R.classList.remove("mtflpp-help-dismissed")),Oe(j),Oe(H),i||Oe(A),Oe(R,!0);for(const e of _)Oe(e,!0,e.dataset.resizeEdge);function Te(){V.hidden=Q||!K,T.hidden=Q||!i&&(K||!E()),A.setAttribute("aria-expanded",String(!V.hidden))}function Ve(){Z.closeMenu(),Y?.close(),x.fullscreenElement===V&&x.exitFullscreen().catch(()=>{})}function Ae(e=!0){Q||(K?Z.focus("actions"):(xe(!0),p(),K&&e&&Z.focus("actions")))}return b.addEventListener("resize",Se),b.addEventListener("scroll",Se,{passive:!0}),c?.fallbackMedia.addEventListener("change",()=>{Se(),Te()}),A.addEventListener("click",e=>{if(ue&&0!==e.detail)return ue=!1,void e.preventDefault();ue=!1,Ae(0===e.detail)}),Z=function(t,o,r){const i=t.querySelector(".mtflpp-controls"),a=t.querySelector(".mtflpp-refresh-control"),c=t.querySelector(".mtflpp-move-control"),d=t.querySelector(".mtflpp-device-controls"),f=t.querySelector(".mtflpp-fit-control"),p=t.querySelector(".mtflpp-pip-control"),m=t.querySelector(".mtflpp-empty"),h=t.querySelector(".mtflpp-feedback");let g,w=(0,e.createRoot)(i),v=!1,y=!1,b=!1;const x=l.InlineNotices?(0,n.dispatch)(l.store):null,M=t.ownerDocument.defaultView?.wp?.theme?.ThemeProvider,P="meet-the-frontend-live-preview-panel",S="preview-feedback";let k="";function E(){const e=g.notice,t=/[.!?…。!?]$/.test(e.heading)?e.heading:`${e.heading}.`;return{message:e.description?`${t} ${e.description}`:e.heading,status:e.status,isDismissible:e.dismissible,actions:[...e.retry?[{label:e.action,disabled:e.disabled,onClick:r.retry}]:[],...e.close?[{label:o.close,onClick:r.close}]:[]]}}function C(){x&&k&&x.removeNotice(S,P),k=""}function L(e){return()=>{V(),e()}}function O(){const{inPage:n,inPip:i,mode:w,modeLabel:S,movable:k,busy:C,canRefresh:O,hasPreview:A,canPip:j}=g;return(0,e.createElement)(s.SlotFillProvider,null,(0,e.createPortal)(k&&n&&(0,e.createElement)(s.Button,{className:"mtflpp-icon mtflpp-move",size:"compact",icon:u.move,label:o.move,showTooltip:!0,tooltipPosition:"bottom","data-action":"move"}),c),(0,e.createPortal)((0,e.createElement)(s.Button,{className:"mtflpp-icon",size:"compact",icon:C?(0,e.createElement)(s.Spinner):u.refresh,label:o.refresh,showTooltip:!0,accessibleWhenDisabled:!0,disabled:!O,onClick:r.refresh,"data-action":"refresh"}),a),(0,e.createPortal)(j&&A&&(0,e.createElement)("div",{className:"mtflpp-pip-surface"},(0,e.createElement)(s.Button,{className:"mtflpp-pip-button",icon:u.pip,label:o.popOutHelp,"aria-label":o.popOut,description:o.popOutHelp,showTooltip:!0,onClick:r.popOut,"data-action":"pop-out"})),p),function(){const{canPip:t,canFullscreen:n,inPage:i,inPip:a,dock:l,canRememberVisibility:c,rememberVisibility:d,rememberPosition:f,followChanges:p}=g;return(0,e.createElement)(s.DropdownMenu,{className:"mtflpp-actions",label:o.actions,icon:u.more,open:v,onToggle(e){v=e,e&&(y=!1),T()},toggleProps:{className:"mtflpp-icon",size:"compact","data-action":"actions"},popoverProps:{placement:"bottom-end",offset:6,shift:!0,className:"mtflpp-menu-popover"}},()=>(0,e.createElement)(e.Fragment,null,(t||n)&&(0,e.createElement)(s.MenuGroup,{label:o.display},t&&(0,e.createElement)(s.MenuItem,{label:o.popOutHelp,description:o.popOutHelp,showTooltip:!0,onClick:L(r.popOut),"data-action":"pip","aria-label":o.popOut},o.popOut),n&&(0,e.createElement)(s.MenuItem,{onClick:L(r.fullscreen),"data-action":"fullscreen"},o.fullscreen)),i&&(0,e.createElement)(s.MenuGroup,{label:o.position},(0,e.createElement)(s.MenuItemsChoice,{value:l,choices:[{value:"left",label:o.bottomLeft},{value:"center",label:o.bottomCenter},{value:"right",label:o.bottomRight}],onSelect(e){V(),r.dock(e)}})),(0,e.createElement)(s.MenuGroup,{label:o.preferences},!1!==c&&(0,e.createElement)(s.MenuItem,{role:"menuitemcheckbox",isSelected:d,icon:d?u.check:void 0,info:o.rememberVisibilityHelp,onClick:L(r.rememberVisibility),"data-action":"remember-visibility"},o.rememberVisibility),(0,e.createElement)(s.MenuItem,{role:"menuitemcheckbox",isSelected:f,icon:f?u.check:void 0,info:o.rememberPositionHelp,onClick:L(r.rememberPosition),"data-action":"remember-position"},o.rememberPosition),(0,e.createElement)(s.MenuItem,{role:"menuitemcheckbox",isSelected:p,icon:p?u.check:void 0,info:o.followHelp,onClick:L(r.follow),"data-action":"follow"},o.follow)),i&&(0,e.createElement)(s.MenuGroup,null,(0,e.createElement)(s.MenuItem,{info:o.resetHelp,onClick:L(r.reset),"data-action":"reset"},o.reset)),a&&(0,e.createElement)(s.MenuGroup,null,(0,e.createElement)(s.MenuItem,{onClick:L(r.close),"data-action":"close"},o.closeLivePreview))))}(),!i&&(0,e.createElement)(s.Button,{className:"mtflpp-icon mtflpp-mode",size:"compact",icon:u[w],label:S,showTooltip:!0,onClick:r.mode,"data-action":"mode"}),!i&&(0,e.createElement)(s.Button,{className:"mtflpp-icon",size:"compact",icon:u.close,label:o.close,showTooltip:!0,onClick:r.close,"data-action":"close"}),(0,e.createPortal)(function(){const{device:t,orientation:n}=g;return(0,e.createElement)(s.Toolbar,{className:"mtflpp-devices",label:o.viewport,variant:"unstyled"},...["desktop","tablet","mobile"].map(i=>{const a=t===i,l=a&&"desktop"!==i,c=l&&"landscape"===n,d="portrait"===n?o.rotateLandscape:o.rotatePortrait;return(0,e.createElement)(s.ToolbarButton,{key:i,icon:u[i],className:c?"mtflpp-device-rotated":void 0,label:l?`${o[i]} — ${d}`:o[i],isPressed:a,"data-viewport":i,onClick:()=>r.device(i)})}))}(),d),(0,e.createPortal)(function(){const{fit:t,customZoom:n=100,dpr:i=1}=g,a={automatic:o.automatic,window:o.fitToWindow,width:o.fitToWidth},l={automatic:o.automaticHelp,window:o.fitToWindowHelp,width:o.fitToWidthHelp},c="custom"===t?o.fixedZoom:a[t]??o.automatic;return(0,e.createElement)(s.Dropdown,{open:y,onToggle(e){y=e,e&&(v=!1,b="custom"===g.fit),T()},contentClassName:"mtflpp-zoom-popover",focusOnMount:"firstElement",popoverProps:{placement:"top-end",offset:8,shift:!0,resize:!1,role:"dialog","aria-label":o.fitting},renderToggle:({isOpen:t,onToggle:n})=>(0,e.createElement)(s.Button,{className:"mtflpp-zoom-toggle",variant:"secondary",size:"compact",label:c,showTooltip:!0,"aria-label":`${o.fitting}: ${c}`,"aria-haspopup":"dialog","aria-expanded":t,onClick:n,"data-action":"zoom"},(0,e.createElement)("span",{className:"mtflpp-zoom-value"},c),u.chevron),renderContent:()=>(0,e.createElement)("div",{className:"mtflpp-zoom-content"},(0,e.createElement)(s.RadioControl,{label:o.zoomMode,selected:t,options:[...Object.entries(a).map(([e,t])=>({value:e,label:t,description:l[e]})),{value:"custom",label:o.fixedZoom,description:o.fixedZoomHelp}],onFocus(e){if(!b)return;b=!1;const t=e.currentTarget.closest(".mtflpp-zoom-content")?.querySelector('.mtflpp-custom-zoom input[type="number"]');t?.focus({preventScroll:!0});const n=t?.closest(".components-popover__content");if(n){const e=t.getBoundingClientRect(),o=n.getBoundingClientRect();n.scrollTop+=Math.min(0,e.top-o.top)+Math.max(0,e.bottom-o.bottom)}},onChange(e){b=!1,"custom"!==e?r.fit(e):r.zoom(n)}}),"custom"===t&&(0,e.createElement)("div",{className:"mtflpp-custom-zoom",onKeyDown(e){if("Enter"!==e.key)return;e.preventDefault();const t=Number(e.target.value);!1!==e.target.validity?.valid&&Number.isInteger(t)&&t>=10&&t<=400&&V()}},(0,e.createElement)(s.RangeControl,{label:o.customZoom,min:10,max:400,step:1,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:n,help:o.customZoomHelp,withInputField:!0,onChange(e){Number.isInteger(e)&&e>=10&&e<=400&&r.zoom(e)}})),(0,e.createElement)("div",{className:"mtflpp-dpr-note",role:"group","aria-label":o.displayInformation},(0,e.createElement)("span",{className:"mtflpp-dpr-value"},`${o.displayDpr}: ${Number(i.toFixed(2))}`),(0,e.createElement)("span",{className:"mtflpp-pixel-note"},o.pixelZoomHelp)))})}(),f),(0,e.createPortal)(function(){const{empty:t}=g;return t?(0,e.createElement)(s.Placeholder,{className:"mtflpp-placeholder","data-empty-icon":t.busy?void 0:t.icon,icon:t.busy?(0,e.createElement)(s.Spinner):u[t.icon],label:(0,e.createElement)("h3",{className:"mtflpp-empty-title",tabIndex:-1,"data-action":"empty-title"},t.heading),instructions:t.description},t.retry&&(0,e.createElement)(s.Button,{key:"retry",variant:"primary",disabled:t.disabled,onClick:r.retry,"data-action":"retry"},t.action),t.close&&(0,e.createElement)(s.Button,{key:"close",variant:"secondary",onClick:r.close,"data-action":"close"},o.close),t.note&&(0,e.createElement)("p",{className:"mtflpp-empty-note"},t.note)):null}(),m),(0,e.createPortal)(function(){if(!g.notice)return null;if(x){const t=(0,e.createElement)(l.InlineNotices,{context:P,className:"mtflpp-inline-notices"});return M?(0,e.createElement)(M,{cornerRadius:"none"},t):t}const{message:t,...n}=E();return(0,e.createElement)(s.Notice,{...n,onRemove:r.dismissNotice,spokenMessage:"",politeness:"polite"},t)}(),h),n?(0,e.createPortal)((0,e.createElement)(s.Popover.Slot),t.ownerDocument.body):(0,e.createElement)(s.Popover.Slot))}function T(){g&&w&&(function(){if(!x)return;if(!g.notice)return void C();const e=JSON.stringify(g.notice);if(k===e)return;const{message:t,status:n,...o}=E();x.createNotice(n,t,{...o,id:S,context:P,speak:!1,onDismiss:r.dismissNotice}),k=e}(),(0,e.flushSync)(()=>w.render((0,e.createElement)(O))))}function V(){(v||y)&&(v=!1,y=!1,T())}function A(e){g?.inPip&&"mode"===e&&(e="actions"),t.querySelector(`[data-action="${e}"]`)?.focus({preventScroll:!0})}return{update(e){const n=y&&!e.hasPreview&&t.ownerDocument.activeElement?.closest(".mtflpp-zoom-popover");e.hasPreview||(y=!1),g=e,T(),n&&A("empty-title")},closeMenu:V,focus:A,beforeMove(){v=!1,y=!1,w?.unmount(),w=null,C()},remount(){w=(0,e.createRoot)(i),T()}}}(V,t,{refresh:()=>{de.canRefresh&&h()},retry:()=>{"handover"!==de.state&&(se||de.canRetry&&["error","conflict"].includes(de.state))&&g(se)},dismissNotice:()=>{ye(),I.textContent=de.text,Z.focus("actions")},mode:Le,close:function(){Z.closeMenu(),xe(!1),m(),i||E()?A.focus():c.focus()},popOut:async function(){if(Q||Y||x.fullscreenElement===V||!Ee())return;let e;Z.closeMenu();const n=()=>{Y===e&&(w(),J.beforeMove(),Z.beforeMove(),x.body.append(V),V.classList.remove("mtflpp-pip"),Y=null,Z.remount(),Se(),J.afterMove(),Ce(),Q||(v(),K&&Z.focus("mode")))};try{if(e=await b.documentPictureInPicture.requestWindow({width:640,height:440}),!K||Q)return void e.close();const t=b.getComputedStyle(V);e.document.documentElement.lang=x.documentElement.lang,e.document.documentElement.dir=t.direction;for(const n of["--wp-admin-theme-color","--wp-admin-theme-color-darker-10","--wp-admin-border-width-focus"]){const o=t.getPropertyValue(n);o&&e.document.documentElement.style.setProperty(n,o)}const o=x.querySelectorAll(['link[rel="stylesheet"][href*="/load-styles.php"]',"#wp-theme-css","#wp-theme-inline-css","#wp-components-css","#wp-components-inline-css","style[data-emotion]","style[data-wp-hash]","#meet-the-frontend-live-preview-panel-css","#meet-the-frontend-live-preview-panel-inline-css"].join(", "));for(const t of o){const n=t.cloneNode(!0);"STYLE"===t.tagName&&t.sheet&&(n.textContent=Array.from(t.sheet.cssRules,e=>e.cssText).join("\n")),n.addEventListener("load",J.layout,{once:!0}),e.document.head.append(n)}e.document.title=$.textContent,e.document.body.className="mtflpp-pip-document",e.addEventListener("resize",J.layout),e.addEventListener("pagehide",n,{once:!0}),Y=e,w(),J.beforeMove(),Z.beforeMove(),V.classList.add("mtflpp-pip"),e.document.body.append(V),Z.remount(),J.afterMove(),Ce(),ye(),Z.focus("mode"),v()}catch{if(e&&(n(),e.close()),Q)return;Z.focus("actions"),ve(t.pipFailed)}},fullscreen:async function(){if(!Q&&!Y&&x.fullscreenEnabled){Z.closeMenu();try{if(await V.requestFullscreen(),Q)return void Ve();ye(),Z.focus("mode")}catch{if(Q)return;Z.focus("actions"),ve(t.fullscreenFailed)}}},dock:e=>ke(e),reset:()=>ke("right",!0),follow:function(){O=!O,S.set(M,"scrollToChanges",O),Ce(),O&&de.canRefresh&&h(!1)},rememberVisibility:function(){C=!C,S.set(M,"rememberVisibility",C),C&&xe(K),Ce()},rememberPosition:function(){L=!L,S.set(M,"rememberPosition",L),L?Me():(S.set(M,"position",ne),S.set(M,"layout",void 0)),Ce()},device(e){const t=J.device;if(e===t&&"desktop"===e)return;let n=!1;if(K&&O&&y){const{fit:e,customZoom:t,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:a}=J;n=!!y({canvas:N,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:a,canFollow:()=>J.fit===e&&J.customZoom===t})}const o={animate:K&&!n,keepPan:n};e===t?(J.rotate(o),S.set(M,`${e}Orientation`,J.orientation)):(J.select(e,o),J.device!==t&&S.set(M,"viewport",J.device)),Ce()},fit(e){const t=J.fit;J.setFit(e),J.fit!==t&&S.set(M,"fitMode",J.fit),Ce()},zoom(e){const t=J.fit,n=J.customZoom;J.setZoom(e),J.customZoom!==n&&S.set(M,"customZoom",J.customZoom),J.fit!==t&&S.set(M,"fitMode",J.fit),Ce()}}),be(t.loading,"loading",{canRetry:!1}),Se(),Te(),i&&(i.disabled=!1),{stage:B,canvasTarget:J.canvasTarget,get visible(){return K},get followChanges(){return O},openFromLauncher:Ae,setSuspended(e){Q!==e&&(Q=e,Te(),e?Ve():Se())},setVisible(e){e||(Z.closeMenu(),le="",Ce(),J.layout()),K=e,Se(),Te()},report:be,setTitle:fe,clearPreview(){B.replaceChildren();const e=["ready","stale","loading"].includes(de.state);be(e?t.loading:de.text,e?"loading":de.state,{...de,hasPreview:!1,hasHtmlPreview:!1,redirectDestination:void 0,canRefresh:!1,canRetry:!e&&de.canRetry})},returnToEditor:Ve}}function m(e=[]){const t=Array.isArray(e)?[...e]:[],n=new WeakMap;return{capture(e,o){try{if(n.has(e))return;const r=function(e){try{const t=e.querySelector('meta[name="meet-the-frontend-live-preview-panel"]'),n=t?.getAttribute("data-mtflpp-source");if(!n)return null;const o=JSON.parse(n);if("string"!=typeof o)return null;const r=(new DOMParser).parseFromString(o,"text/html");return r.querySelector('meta[name="meet-the-frontend-live-preview-panel"]')?.content===t.content?r:null}catch{return null}}(e);n.set(e,{source:r?E(r,e,t):null,dom:E(e,e,t),values:o&&structuredClone(o)})}catch{}},findChange(e,t){try{const o=n.get(e),r=n.get(t);if(!o||!r)return null;const i=function(e,t){if(!e||!t)return[];const n=[];for(const o of new Set([...Object.keys(e),...Object.keys(t)])){const r=Object.hasOwn(e,o)?e[o]:{type:t[o]?.type,value:""},i=Object.hasOwn(t,o)?t[o]:{type:e[o]?.type,value:""};if(r.type!==i.type||!["text","html"].includes(i.type)||"string"!=typeof r.value||"string"!=typeof i.value||r.value===i.value)continue;let a,s;try{a="html"===r.type?(new DOMParser).parseFromString(r.value,"text/html"):null,s="html"===i.type?(new DOMParser).parseFromString(i.value,"text/html"):null}catch{continue}const l=a?E(a,a,[],a.body):null,c=s?E(s,s,[],s.body):null,d=a?$(l):r.value,u=s?$(c):i.value,f=T(d),p=T(u);if(f!==p&&n.push({...G(f,p),type:"text",fullBefore:f,fullAfter:p}),!a){const e=H(d,u);e&&n.push(e);continue}if(l&&c&&(f===p||V(d,u)))for(const e of O(l,c)){if(e.spacing){const t=_(e);t&&n.push(t);continue}if(f===p)if("attributes"===e.kind){const t=new Map(e.before.attributes),o=new Map(e.after.attributes);for(const e of new Set([...t.keys(),...o.keys()])){const r=t.get(e)??"",i=o.get(e)??"";JSON.stringify(r)!==JSON.stringify(i)&&n.push({type:"attribute",name:e,before:"string"==typeof r?r:JSON.stringify(r),after:"string"==typeof i?i:JSON.stringify(i)})}}else if("content"===e.kind){const t=T($(e.before)),o=T($(e.after));t===o&&ee(e.before,e.after,$)&&n.push({type:"markup",before:t,after:o,oldTag:e.before.tag,newTag:e.after.tag}),(e.before.media||[]).forEach((t,o)=>{const r=e.after.media?.[o];t&&r&&t!==r&&n.push({type:"media",before:t,after:r})})}}}return n}(o.values,r.values),a=function(e,t){if(!e||!t)return!1;const n=(e,t)=>Object.entries(e).some(([e,n])=>["text","html","value","row-image"].includes(n?.type)&&(!Object.hasOwn(t,e)||n.type!==t[e]?.type||n.value!==t[e]?.value));return n(e,t)||n(t,e)}(o.values,r.values),s=!!o.source&&!!r.source,l=!!o.source!=!!r.source,c=function(e,t,n){if(!e||!t)return;const o=Object.entries(t).filter(([t,n])=>"row-order"===n?.type&&"row-order"===e[t]?.type&&e[t].value!==n.value);if(1!==o.length)return;const[[r,i]]=o,a=e[r];if(!i.moved||i.members!==a.members)return;const s=JSON.parse(a.value),l=JSON.parse(i.value),c=s.indexOf(i.moved),d=l.indexOf(i.moved);if(-1===c||-1===d||c===d||s.length!==l.length)return;if(s.splice(c,1),l.splice(d,1),!s.every((e,t)=>e===l[t]))return;const u=d-c,f={html:new Map,peerLabels:new Map},p=q(r,i.moved,s,e,t,f),m=function(e,t,n,o,r,i){if([n,...o].some(n=>!e?.[n]||!t?.[n]))return[];const a=new Set(e[n]),s=new Set,l=new Set,c=new Set;for(const[n,a]of[[e,r],[t,i]])for(const e of o.flatMap(e=>n[e])){const t=a[e];"row-image"===t?.type&&(c.add(t.value),l.add(t.alt))}for(const e of t[n]){const t=r[e],n=i[e];if(!a.has(e)||"row-image"!==t?.type||"row-image"!==n?.type||!/^[1-9]\d*$/.test(n.value)||t.value!==n.value||c.has(n.value))continue;const o=n.alt;o?.trim()&&t.alt===o&&!l.has(o)&&s.add(o)}return[...s]}(a.fieldsByRow,i.fieldsByRow,i.moved,s,e,t);let h;if(n&&!p.length&&N(a,i.moved,e,f.html)&&N(i,i.moved,t,f.html)){const n=s.slice(Math.min(c,d),Math.max(c,d));h=[];for(const o of n){const n=q(r,o,[...s.filter(e=>e!==o),i.moved],e,t,f);if(!n.length){h=void 0;break}h.push(n)}}return{offset:u,groups:p,images:m,boundaryGroups:h}}(o.values,r.values,s&&!a&&!F(o.values,r.values)),d=s?O(o.source,r.source,c,!0):[];if(c?.boundaryGroups?.length){const e=d.filter(e=>e.priority>0);if(1===e.length&&e[0].boundary)return function({before:e,after:t,index:n},o){for(const n of[e,t]){let e,t;for(const{node:r}of n){if(!r?.isConnected||e&&e.nextElementSibling!==r)return null;const{position:n,marginTop:i,marginBottom:a}=r.ownerDocument.defaultView.getComputedStyle(r);if(o&&r.closest(o)||!v(r)||!["static","relative"].includes(n)||r.closest("[hidden], details:not([open])")||!1===r.checkVisibility?.({opacityProperty:!0,contentVisibilityAuto:!0}))return null;const s=r.getBoundingClientRect();if(!s.height&&!(parseFloat(i)>0||parseFloat(a)>0))return null;if(t&&(t.bottom>s.top||Math.max(t.left,s.left)>=Math.min(t.right,s.right)))return null;e=r,t=s}}return t[n].node}(e[0].boundary,r.source?.excluded)}if(!l&&!a&&!c){const e=function(e,t){const n=function(e,t){if(!e||!t)return;const n=["row-order","gallery-order","order"],o=[...new Set([...Object.keys(e),...Object.keys(t)])].filter(o=>(n.includes(e[o]?.type)||n.includes(t[o]?.type))&&e[o]?.value!==t[o]?.value);if(1!==o.length)return;const r=e[o[0]],i=t[o[0]];if("gallery-order"!==r?.type||"gallery-order"!==i?.type)return;const a=JSON.parse(r.value),s=JSON.parse(i.value);if(new Set(a).size!==a.length||new Set(s).size!==s.length)return;const l=new Map(a.map((e,t)=>[e,t])),c=s.map(e=>l.get(e));return a.length&&s.length&&c.every(e=>void 0===e)?void 0:{oldCount:a.length,matches:c}}(e.values,t.values);if(!n)return;const o=e.source??e.dom,r=t.source??t.dom,i=function(e,t,{oldCount:n,matches:o}){const r=[];function i(e,t){return e.signature===t.signature&&e.presentation===t.presentation}function a(e,t){return i(e,t)&&e.rawText===t.rawText&&e.children.length===t.children.length&&e.children.every((e,n)=>a(e,t.children[n]))}function s(e,t){if(e.children.length!==n||t.children.length!==o.length||e.rawText!==t.rawText&&(e.text||t.text))return!1;const i=S(e),s=S(t);if(!i||!s)return!1;const l=i.map(k),c=s.map(k),d=new Set(l);return!(d.size!==l.length||new Set(c).size!==c.length||l.length===c.length&&l.every((e,t)=>e===c[t])||!o.every((n,o)=>void 0===n?!d.has(c[o]):l[n]===c[o]&&a(e.children[n],t.children[o]))||(r.push({before:e,after:t,original:i,current:s}),0))}return e&&t&&function e(t,n){return!!i(t,n)&&(!!s(t,n)||t.rawText===n.rawText&&t.children.length===n.children.length&&t.children.every((t,o)=>e(t,n.children[o])))}(e,t)?r:null}(o,r,n);if(!i?.length)return;const a=i.map(e=>e.after);let[s]=a;for(;s&&!a.every(e=>e===s||oe(s,e));)s=s.parent;const l=e=>["main","body","html"].includes(e.tag)||e.attributes.some(([e,t])=>"role"===e&&"main"===t);if(!s?.parent||l(s)||!function(e,t){if(1===t.length)return!0;const n=new Set(t);let o=0;return function e(t){return n.has(t)?(o++,!0):!!b(t)||!x(t)&&("hr"!==t.tag||0===o||o===n.size)&&t.parts.every(t=>"string"==typeof t?0===o||o===n.size||!t.trim():e(t))}(e)&&o===n.size}(s,a))return null;let c=s.node;if(!c?.isConnected||a.some(({node:e})=>!c.contains(e)||r.excluded&&e.closest(r.excluded)))return null;if(t.source&&(!P(e.dom,i,"before","original")||!P(t.dom,i,"after","current")))return null;const d=c.ownerDocument.defaultView;for(let e=s,t=e.parent;t?.parent&&!l(t)&&!t.children.some(t=>t!==e&&M(t));e=t,t=t.parent){const e=t.node;if(!e?.contains(c))continue;const{overflowX:n,overflowY:o}=d.getComputedStyle(e),r=/^(?:auto|scroll|hidden)$/;(e.scrollWidth>e.clientWidth&&r.test(n)||e.scrollHeight>e.clientHeight&&r.test(o))&&(c=e)}return!v(c)||c.closest("[hidden], details:not([open])")||r.excluded&&c.closest(r.excluded)?null:c}(o,r);if(void 0!==e)return e}const u=[...d.map(e=>({...e,source:!0})),...O(o.dom,r.dom,c)],f=new Map,p=function(e,t){const n=new Map,o=e=>$(e,n),r=[];for(const n of e){if(n.unresolved)for(const e of h(n,t,o))r.push(e);if("insert"===n.kind&&n.added.length>1){const e=n.added.map(e=>{const r={...n,after:e,added:[e]},i=ne(r,t,o);return{...r,input:i}}).filter(e=>e.input);if(e.length){r.push(...e);continue}}const e=ne(n,t,o);r.push({...n,input:e})}return r}(u,i).filter(e=>(e.priority>0||e.input)&&(!e.spacing||function({before:e,after:t},n,o){const r=A(e,n,o),i=A(t,n,o);return r&&i&&r.omitted===i.omitted&&V(r.text,i.text)}(e,f,r.dom?.excluded))),m=s&&a&&!p.some(e=>e.source);return function(e,t){if(!e.length)return null;const n=e.reduce((e,t)=>Math.max(e,t.input),0),o=e.filter(e=>e.input===n),r=o.reduce((e,t)=>Math.max(e,t.priority),0),i=o.filter(e=>e.priority===r);if(t.rowMove&&!n||i.some(e=>e.unresolved))return function(e,{rowMove:t,excluded:n,canFollowLiveReorder:o,canFollowLiveMove:r}){if(t){const t=e.find(e=>e.moved&&(e.source||r)),o=t?.moved.node;return o?.isConnected&&t.after.node?.contains(o)&&e.every(e=>e===t||t.source&&!e.source&&(e.moved||"reorder"===e.regionChange))?"contents"!==o.ownerDocument.defaultView.getComputedStyle(o).display?o:g(t.moved,e=>o.contains(e)&&(!n||!e.closest(n))&&v(e)):null}const i=e.find(e=>e.unresolved&&("replacement"===e.regionChange||"reorder"===e.regionChange&&(e.source||o))),a=i?.after.node;if(!a?.isConnected)return null;for(const t of e)if(t.unresolved){if(i.source&&!t.source&&"reorder"===t.regionChange)continue;if(!t.regionChange||t.after.node!==a)return null}else if(!("insert"===t.kind?t.added:[t.after]).every(e=>a.contains(e.node)))return null;return"contents"!==a.ownerDocument.defaultView.getComputedStyle(a).display?a:null}(i,t);const a=i.filter(e=>!e.input||e.directInput||!i.some(t=>t!==e&&e.matches?.length&&e.matches.every(e=>t.matches?.includes(e))&&oe(e.after,t.after))),s=new Map,l=a.filter(e=>{const t="delete"===e.kind&&(e.following[0]||e.preceding[0])||e.after,n=t?.node;if(!n)return!0;const o="delete"!==e.kind||e.following.length?e.kind:"delete-last",r=s.get(n)||new Set;return!r.has(o)&&(r.add(o),s.set(n,r),!0)});return n&&s.size>1?null:function(e){const t=new Set,n=new Set;for(const o of e){let e,r=!1;"delete"===o.kind?(r=!o.removed.some(y),e=r?o.after:o.following.find(y)||o.preceding.find(y)||o.following.find(w)||o.preceding.find(w)||o.after):e="insert"===o.kind?o.added.find(y)||o.added.find(w):o.after;const i=w(e);if(!i)continue;const a=y(e),s=a||i;(a&&!r?t:n).add(s)}const o=t.size?t:n;return 1===o.size?o.values().next().value:null}(l)}(p.filter(e=>e.source||e.input||!s&&!l||m&&("insert"===e.kind||"delete"===e.kind)),{rowMove:!!c,excluded:r.source?.excluded??r.dom?.excluded,canFollowLiveReorder:!s&&(a||F(o.values,r.values)),canFollowLiveMove:!s&&!l})}catch{return null}}}}function h(e,t,n){const o=[];for(const r of t){if(!r.after||"spacing"===r.type)continue;const t=te(e.oldRange,r.before,n,r,!0),i=te(e.newRange,r.after,n,r,!1);if(!t.length)continue;const a="markup"===r.type&&r.oldTag===r.newTag;if(a||!r.before||!(t.length<=te(e.newRange,r.before,n,r,!0).length||i.length<=te(e.oldRange,r.after,n,r,!1).length))for(const s of i)a&&!t.some(e=>ee(e,s,n))||o.push({...e,unresolved:!1,before:null,after:s,kind:"content",input:r.before&&r.after?2:1,priority:2,matches:[r]})}return o}function g(e,t){if(e?.node&&t(e.node))return e.node;for(const n of e?.children||[]){const e=g(n,t);if(e)return e}return null}function w(e){return g(e,()=>!0)}function v(e){return e.getClientRects().length&&"visible"===e.ownerDocument.defaultView.getComputedStyle(e).visibility}function y(e){return g(e,v)}function b(e){return/^(?:button|input|select|textarea)$/.test(e.tag)||e.attributes.some(([e,t])=>"role"===e&&"button"===t)}function x(e){return/^(?:img|video|audio|iframe|canvas|object|embed)$/.test(e.tag)||e.media?.some(Boolean)}function M(e){return!b(e)&&(e.text||x(e)||"hr"===e.tag||e.children.some(M))}function P(e,t,n,o){const r=new Map(t.map(e=>[e[n].node,e[o]]));return!(!e||r.has(null)||r.size!==t.length)&&(function e(t){const n=r.get(t.node);if(!n)return t.children.every(e);r.delete(t.node);const o=new Map,i=new Map;n.forEach((e,t)=>{e.marker&&o.set(e.marker,t),i.set(k(e),t)});const a=[],s=new Map;if(!function e(t,r=!1){if(r||=t.attributes.some(([e,t])=>"inert"===e||"aria-hidden"===e&&"true"===t),"img"!==t.tag)return t.children.every(t=>e(t,r));const l=o.get(t.marker)??i.get(k(t));return!(!n[l]||!t.media.slice(0,2).some((e,t)=>e&&e===n[l].media[t])||(a.push({index:l,cloneHidden:r}),s.set(l,(s.get(l)??0)+1),0))}(t))return!1;const l=a.filter(({index:e,cloneHidden:t})=>!t||1===s.get(e));return l.length===n.length&&l.every(({index:e},t)=>e===t)}(e)&&!r.size)}function S(e){const t=e.children.map(function e(t){return"img"===t.tag?[t]:t.children.flatMap(e)});return t.some(e=>1!==e.length||!e[0].media?.slice(0,2).some(Boolean))?null:t.map(([e])=>e)}function k(e){return JSON.stringify(e.media.slice(0,2))}function E(e,t,n,o=e.querySelector('main, [role="main"]')||e.querySelector("article")||e.body){if(!o)return null;const r=n.filter(e=>{if("string"!=typeof e||!e.trim())return!1;try{return o.matches(e),!0}catch{return!1}}).join(", "),i=new Map,a=new Map;if(e!==t)for(const e of t.querySelectorAll("[data-mtflpp-node]")){const t=e.getAttribute("data-mtflpp-node");a.set(t,a.has(t)?null:e)}for(const n of[o,...o.querySelectorAll("*")]){if(r&&n.closest(r))continue;const o=[...n.childNodes].filter(e=>3===e.nodeType).map(e=>e.textContent),s=T(o.join(" ")),l=["img","source","video","audio","iframe"].includes(n.localName)?["src","srcset","poster"].map(e=>n.getAttribute(`data-${e}`)||n.getAttribute(e)||""):[],c=n.style?.backgroundImage||n.getAttribute("data-bg")||"",d=n.getAttribute("data-mtflpp-node"),u=e===t?n:a.get(d)||null,f=C(n,u,JSON.stringify([n.localName,s,l,c]));"img"===n.localName&&(f.marker=d),f.text=s,f.rawText=o.join(""),f.media=[...l,c],f.parent=i.get(n.parentElement),i.set(n,f),f.parent?.children.push(f)}for(const[e,t]of i)t.parts=[...e.childNodes].map(e=>3===e.nodeType?e.textContent:i.get(e)).filter(e=>void 0!==e);let s=i.get(o);if(!s)return null;const l=s.node;for(let e=o.parentElement;e;e=e.parentElement){const t=C(e,l,e.localName);t.children=[s],t.parts=[s],s=t}return s.excluded=r,s}function C(e,t,n){const o=function(e){const t=[];for(const{name:n,value:o}of e.attributes){if("data-mtflpp-node"===n||n.startsWith("on")||/(?:^|-)(nonce|token)(?:-|$)/.test(n))continue;if(/^(?:data-)?(?:src|srcset|poster|sizes|bg)$/.test(n))continue;let r=o;"class"===n&&(r=[...e.classList].sort().join(" ")),"style"===n&&(r=[...e.style].sort().map(t=>[t,e.style.getPropertyValue(t),e.style.getPropertyPriority(t)])),("class"!==n&&"style"!==n||r.length)&&t.push([n,r])}return t.sort(([e],[t])=>e.localeCompare(t))}(e);return{node:t,tag:e.localName,signature:n,attributes:o,children:[],parts:[],presentation:JSON.stringify(o.filter(([e])=>!L(e))),references:JSON.stringify(o.filter(([e])=>L(e)))}}function L(e){return["id","for","headers","aria-controls","aria-labelledby","aria-describedby","aria-owns","aria-flowto","aria-activedescendant","aria-details","aria-errormessage"].includes(e)}function O(e,t,n,o=!1){const r=new Map,i=new Map,a=new Map,s=new Map,l=[];let c,d;function u(o,r,i,a=[]){const s=(e,t)=>e===t||oe(e,t);let l=!1;if(a.length){d??=[D(e,new Set(a)),D(t,new Set(a))];const n=(e,t,n)=>t.node?.isConnected&&e.node?.contains(t.node)&&"img"===t.node.localName&&(!n||!t.node.closest(n));for(const i of a){const a=d[0].get(i),c=d[1].get(i);if(a&&c){if(!s(o,a)||!s(r,c))return!1;l||=n(o,a,e.excluded)&&n(r,c,t.excluded)}}}if(!i.length)return l;if(!c){const o=new Set((n.boundaryGroups??[n.groups]).flat(2));c=[J(e,o),J(t,o)]}const[u,f]=c,p=new Map;for(const e of i.flat()){const t=u.get(e),n=f.get(e);if(t&&n){if(!s(o,t.entry)||!s(r,n.entry))return!1;p.set(e,t.substantive&&n.substantive)}}return l||i.some(e=>e.every(e=>p.has(e))&&e.some(e=>p.get(e)))}function f(e){const t=JSON.stringify(e);return r.has(t)||r.set(t,r.size+1),r.get(t)}function p(e){if(!e)return 0;const t=f([e.signature,e.children.map(p)]);return i.set(e,t),a.set(e,f([t,e.presentation,e.children.map(e=>a.get(e))])),s.set(e,f([t,e.presentation,e.references,e.children.map(e=>s.get(e))])),t}p(e),p(t);const m=e=>i.get(e);function h(e){const t=e.attributes.find(([e])=>"id"===e)?.[1];return t?`${e.tag} ${t}`:void 0}function g(e){if(!(e.children.length<2))return f(["collection",e.signature,e.children.map(m).sort((e,t)=>e-t)])}function w(e,t){const n=new Map;return e.forEach((e,o)=>{const r=t(e);void 0!==r&&n.set(r,n.has(r)?-1:o)}),n}return function e(t,r){t&&r&&(t.signature!==r.signature?l.push({kind:"content",before:t,after:r,priority:2}):t.rawText!==r.rawText&&l.push({kind:"content",before:t,after:r,priority:2,spacing:!0}),t.presentation===r.presentation&&t.references===r.references||l.push({kind:"attributes",before:t,after:r,priority:t.presentation!==r.presentation?1:0}),function(t,r,c,d){const f=d.parent&&c.parent&&d.tag===c.tag,p=w(t,m),v=w(r,m);let y,b,x,M;const P=new Set(t.flatMap(e=>[a.get(e),s.get(e)])),S=new Set(r.flatMap(e=>[a.get(e),s.get(e)]));function k(e,t,n){const o=n.get(e),r=n.get(t);return o===r||!S.has(o)&&!P.has(r)}function E(e,t){return i.get(e)===i.get(t)&&k(e,t,a)&&k(e,t,s)}function C(e,n,o,a,s,c,u){const m=t.slice(e,n),h=r.slice(o,a),g="replacement"===s&&f&&m.some(e=>!v.has(i.get(e)))&&h.some(e=>!p.has(i.get(e)))&&(!function(e,t){if(e.length<2||t.length<2)return!1;const n=e.filter(e=>e.children.length).length,o=t.filter(e=>e.children.length).length;if(!n&&!o||n>1&&o>1)return!0;const r=new Map;for(const{tag:e}of t)r.set(e,(r.get(e)||0)+1);let i=0;for(const{tag:t}of e){const e=r.get(t);if(e){if(2===++i)return!0;r.set(t,e-1)}}return!1}(m,h)||"form"===d.tag&&function(e,t){function n(e){const t=new Set;return e.every(function e(n){if(["input","select","textarea"].includes(n.tag)){const e=n.attributes.find(([e])=>"name"===e)?.[1],o=n.attributes.find(([e])=>"type"===e)?.[1]?.toLowerCase();return!(!e||"input"===n.tag&&"hidden"===o||(t.add(e),0))}let o=!1;for(const t of n.children)e(t)&&(o=!0);return o})?t:null}const o=n(e),r=n(t);return o&&r&&[...o].some(e=>!r.has(e))&&[...r].some(e=>!o.has(e))}(m,h)),w=f&&("reorder"===s||g)?s:void 0;l.push({kind:"region",after:d,priority:2,unresolved:!0,regionChange:w,oldRange:m,newRange:h,moved:c,boundary:u})}function L(e,n,o,r,i,a,s){const l=[];for(let c=e;c<n;c++){const e=s(t[c]),n=a.get(e);if(!(i.get(e)!==c||void 0===n||n<o||n>=r)){if(l.length&&n<=l[l.length-1][1])return null;l.push([c,n])}}return l}!function s(c,P,S,k){for(;c<P&&S<k&&E(t[c],r[S]);)e(t[c],r[S]),c++,S++;for(;c<P&&S<k&&E(t[P-1],r[k-1]);)P--,k--,e(t[P],r[k]);if(c===P&&S===k)return;if(c===P||S===k){const e=S===k,n=e?t.slice(c,P):r.slice(S,k),o=e?[r[S-1],r[S]]:[t[c-1],t[c]];return void(n.some(e=>o.some(t=>t&&i.get(t)===i.get(e)))?C(c,P,S,k):e?l.push({kind:"delete",after:d,removed:n,priority:2,following:r.slice(S),preceding:r.slice(0,S).reverse()}):l.push({kind:"insert",after:n[0],added:n,priority:2}))}if(P-c===1&&k-S===1)return void e(t[c],r[S]);const O=function(e,i,a,s){if(!(n?.groups.length||o&&(n?.boundaryGroups||n?.images.length)))return;const l=Math.abs(n.offset)+1;if(i-e!==l||s-a!==l)return;const c=n.offset>0,d=c?0:l-1,u=c?l-1:0,f=t.slice(e,i),p=r.slice(a,s),m=c?l-1:1,h=f.map((e,t)=>[e,p[(t+m)%l]]);return{before:f,after:p,from:d,to:u,pairs:h}}(c,P,S,k),T=O&&function(e){const t=o?n.images:[];if(!n.groups.length&&!t.length)return;const[r,i]=e.pairs[e.from],a=m(r);return-1!==p.get(a)&&-1!==v.get(a)&&e.pairs.every(([e,t])=>E(e,t))&&u(r,i,n.groups,t)?i:void 0}(O),V=O&&function(e){if(o&&n.boundaryGroups&&B(e.before[e.from])&&e.pairs.every(([e,t])=>a.get(e)===a.get(t)))return e.pairs.filter((t,n)=>n!==e.from).every(([e,t],o)=>u(e,t,n.boundaryGroups[o]))?{before:e.before,after:e.after,index:e.to||1}:void 0}(O);if(T||V||f&&function(e,n,o,a){const s=n-e;if(s<2||s!==a-o)return!1;const l=new Map;let c=!1;for(let n=0;n<s;n++){const a=i.get(t[e+n]),s=i.get(r[o+n]);c||=a!==s,l.set(a,(l.get(a)||0)+1),l.set(s,(l.get(s)||0)-1)}return c&&[...l.values()].every(e=>0===e)}(c,P,S,k)){if(V)for(const[t,n]of O.pairs)e(t,n);return void C(c,P,S,k,"reorder",T,V)}let A=L(c,P,S,k,p,v,m);if(0===A?.length&&(y??=w(t,h),b??=w(r,h),A=L(c,P,S,k,y,b,h)),0===A?.length&&(x??=w(t,g),M??=w(r,g),A=L(c,P,S,k,x,M,g)),A?.length)for(const[n,o]of[...A,[P,k]])s(c,n,S,o),n<P&&e(t[n],r[o]),c=n+1,S=o+1;else C(c,P,S,k,A?"replacement":void 0)}(0,t.length,0,r.length)}(t.children,r.children,t,r))}(e,t),l}function T(e){return e.replace(/\s+/g," ").trim()}function V(e,t){return e!==t&&e.replace(/\s/g,"")===t.replace(/\s/g,"")}function A(e,t,n){for(;e.node?.isConnected&&e.parent?.node;){const{display:t}=e.node.ownerDocument.defaultView.getComputedStyle(e.node);if("inline"!==t&&"contents"!==t)break;e=e.parent}if(!t.has(e)){const{node:o}=e,r=[],i=o?.isConnected&&j(o,n,r)===R(e)&&y(e)?o.innerText:void 0;t.set(e,"string"==typeof i?{text:i,omitted:JSON.stringify(r)}:void 0)}return t.get(e)}function j(e,t,n){return t&&e.querySelector(t)?[...e.childNodes].map(e=>3===e.nodeType?e.textContent:1!==e.nodeType?"":e.matches(t)?(n.push(e.textContent),""):j(e,t,n)).join(""):e.textContent}function R(e){return e.parts.map(e=>"string"==typeof e?e:R(e)).join("")}function _({before:e,after:t}){return H(e.rawText,t.rawText)||H(R(e),R(t))}function H(e,t){if(!/\S/.test(e)||!V(e,t))return;const n=e.match(/\s+|\S+/g),o=t.match(/\s+|\S+/g);let r=0,i=0;for(;r<Math.min(n.length,o.length)&&n[r]===o[r];)r++;for(;i<Math.min(n.length,o.length)-r&&n.at(-1-i)===o.at(-1-i);)i++;const a=Math.max(0,r-1),s=Math.max(0,i-1);return{type:"spacing",before:n.slice(a,n.length-s).join(""),after:o.slice(a,o.length-s).join("")}}function $(e,t=new Map){return e?(t.has(e)||t.set(e,(e.parts||[]).map(e=>{if("string"==typeof e)return e;const n=$(e,t);return/^(?:p|div|section|article|main|aside|header|footer|nav|h[1-6]|li|[ou]l|d[ldt]|blockquote|pre|table|tr|t[dh]|caption|figure|figcaption|br|hr)$/.test(e.tag)?` ${n} `:n}).join("")),t.get(e)):""}function F(e,t){return!!e&&!!t&&Object.entries(t).some(([t,n])=>{if(!["order","gallery-order"].includes(n?.type)||!Object.hasOwn(e,t))return!1;const o=e[t];return o?.type===n.type&&o.members===n.members&&o.value!==n.value})}function N(e,t,n,o){return e.fieldsByRow?.[t]?.every(e=>""===z(n[e],o)?.label)}function B(e){return!e.text&&!e.media?.some(Boolean)&&!/^(?:a|button|input|select|textarea|form|details|img|video|audio|iframe|canvas|svg|object|embed)$/.test(e.tag)&&e.children.every(B)}function D(e,t){const n=new Map;return e&&function e(o){if("img"===o.tag){const e=o.attributes.find(([e])=>"alt"===e)?.[1];t.has(e)&&n.set(e,n.has(e)?null:o)}o.children.forEach(e)}(e),n}function q(e,t,n,o,r,{html:i,peerLabels:a}){const{fieldsByRow:s}=r[e],l=o[e].fieldsByRow;if([t,...n].some(e=>!l?.[e]||!s?.[e]))return[];const c=[],d=new Set(l[t]);let u;function f(e,t){if(a.has(e))return a.get(e);const n=new Set;function o(e,t){n.add(T($(e,t)));for(const n of e.children)o(n,t)}for(const r of e){if("row-image"===t[r]?.type)continue;const e=W(t[r],i);if(!e.length)return null;for(const t of e)t.entry?o(t.entry,t.cache):n.add(t.label)}return a.set(e,n),n}function p(e,t){return u??=n.flatMap(e=>[f(l[e],o),f(s[e],r)]),u.some(n=>!n||n.has(e)||t.length&&t.every(e=>n.has(e)))}for(const e of s[t]){const t=r[e],n=o[e];if(d.has(e)&&t&&n?.type===t.type&&n?.value===t.value)for(const{entry:e,cache:o,label:r}of W(t,i,n.formatted===t.formatted)){if(!r)continue;if(!e){p(r,[])||c.push([r]);continue}const t=I(e,o).map(e=>T($(e,o))),n=J(e,new Set([r,...t]),o);n.get(r)?.substantive&&!p(r,t.join(" ")===r?t:[])&&c.push([r]);const i=[...new Set(t.filter(e=>n.has(e)))];i.length>1&&i.some(e=>n.get(e).substantive)&&!p(r,i)&&c.push(i)}}return c}function W(e,t,n=!0){const o=z(e,t);if(!o)return[];const r=n&&"html"===e.type&&"string"==typeof e.formatted?z({type:"html",value:e.formatted},t):null;return r?[o,r]:[o]}function z(e,t){if("string"==typeof e?.value){if("text"===e.type)return{label:T(e.value)};if("html"===e.type){if(!t.has(e.value))try{const n=(new DOMParser).parseFromString(e.value,"text/html"),o=E(n,n,[],n.body),r=new Map;t.set(e.value,{entry:o,cache:r,label:T($(o,r))})}catch{t.set(e.value,null)}return t.get(e.value)}}}function I(e,t){const n=e.children.flatMap(e=>I(e,t));return n.length||!/^(?:p|h[1-6]|li|d[dt]|blockquote|pre|figcaption)$/.test(e.tag)?n:T($(e,t))?[e]:[]}function Z(e,t,n){let o;(e.text===t||/[\p{L}\p{N}]/u.test(e.text||""))&&(o=function(e,t){let n="content";for(let o=e;o;o=o.parent){const r=o.attributes.find(([e])=>"role"===e)?.[1]??"";if("button"===o.tag||/(?:^|\s)button(?:\s|$)/.test(r))return;if("a"!==o.tag&&!/(?:^|\s)link(?:\s|$)/.test(r))continue;const i=I(o,t);if(i.length<2||!i.some(e=>/^h[1-6]$/.test(e.tag)))return;const a=i.find(t=>t===e||oe(t,e));if(!a)return;/^h[1-6]$/.test(a.tag)||(n="support")}return n}(e,n));for(const r of e.children){if("content"===o)break;o=Z(r,t,n)||o}return o}function J(e,t,n=new Map){const o=new Map;e&&function e(r){const i=T($(r,n));if(t.has(i)){const e=o.get(i);o.set(i,void 0===e||e&&oe(e,r)?r:null)}r.children.forEach(e)}(e);const r=new Map;for(const[e,t]of o){const o=t&&Z(t,e,n);o&&r.set(e,{entry:t,substantive:"content"===o})}return r}function G(e,t){let n=0,o=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;for(;o<e.length-n&&o<t.length-n&&e[e.length-o-1]===t[t.length-o-1];)o++;let r=e.length-o,i=t.length-o;for(;n>0&&/\S/.test(e[n-1]);)n--;if(r>n&&/\S/.test(e[r-1]))for(;r<e.length&&/\S/.test(e[r]);)r++;if(i>n&&/\S/.test(t[i-1]))for(;i<t.length&&/\S/.test(t[i]);)i++;return{before:e.slice(n,r).trim(),after:t.slice(n,i).trim()}}function U(e,t){return t?X(e,t):""===T(e)}function X(e,t){return Y(e,t,1)>0}function Y(e,t,n=1/0){if(!t)return 0;let o=0,r=(e=T(e)).indexOf(t);for(;-1!==r;){const i=r+t.length;if(K(e,r)&&K(e,i)&&++o===n)break;r=e.indexOf(t,r+1)}return o}function K(e,t){return!/[\p{L}\p{N}_]$/u.test(e.slice(Math.max(0,t-2),t))||!/^[\p{L}\p{N}_]/u.test(e.slice(t,t+2))}function Q(e,t,n,o=!1){const r=T(e),i=T(t);if(r===i)return!1;if(r===n.before&&i===n.after||r===n.fullBefore&&i===n.fullAfter)return!0;if(o){const e=G(r,i);if(e.before===n.before&&e.after===n.after)return!0;if(function(e,t,n,o){if(!n||!o||e.length-n.length!==t.length-o.length)return!1;for(let r=e.indexOf(n);-1!==r;r=e.indexOf(n,r+1))if(t.startsWith(o,r)&&K(e,r)&&K(t,r)&&K(e,r+n.length)&&K(t,r+o.length)&&e.slice(0,r)===t.slice(0,r)&&e.slice(r+n.length)===t.slice(r+o.length))return!0;return!1}(r,i,n.fullBefore,n.fullAfter))return!0}return(n.before?Y(r,n.before)>Y(i,n.before):!r)&&(n.after?Y(i,n.after)>Y(r,n.after):!i)}function ee(e,t,n){return e.tag!==t.tag||(e.children.length||t.children.length)&&e.text!==t.text&&T(n(e))===T(n(t))}function te(e=[],t,n,o,r){return e.flatMap(e=>{const i=te(e.children,t,n,o,r);let a;return a="media"===o.type?e.media?.includes(t):"attribute"===o.type?e.attributes.some(([e,n])=>e===o.name&&X("string"==typeof n?n:JSON.stringify(n),t)):("markup"!==o.type||e.tag===(r?o.oldTag:o.newTag))&&U(n(e),t),"text"===o.type&&i.length?i:[...a?[e]:[],...i]})}function ne(e,t,n){if(e.unresolved)return 0;if(e.matches=[],e.spacing){const n=t.filter(e=>"spacing"===e.type),o=n.length&&_(e);return e.matches=n.filter(e=>o?.before===e.before&&o?.after===e.after),e.matches.length?2:0}let o=0;for(const r of t){if("spacing"===r.type)continue;let t=0;if("attributes"===e.kind){if(!["text","attribute"].includes(r.type))continue;const n=new Map(e.before.attributes),o=new Map(e.after.attributes);for(const e of new Set([...n.keys(),...o.keys()])){if("attribute"===r.type&&e!==r.name)continue;const i=n.get(e),a=o.get(e);JSON.stringify(i)!==JSON.stringify(a)&&(Q("string"==typeof i?i:JSON.stringify(i)||"","string"==typeof a?a:JSON.stringify(a)||"",r)&&(t="attribute"===r.type||r.before&&r.after?2:1))}}else if("insert"===e.kind)!r.before&&e.added.some(e=>X(n(e),r.after))&&(t=Math.max(t,1));else if("delete"===e.kind)!r.after&&e.removed.some(e=>X(n(e),r.before))&&(t=Math.max(t,1));else if("media"===r.type)(e.before?.media||[]).some((t,n)=>t===r.before&&e.after?.media?.[n]===r.after)&&(t=2);else if("markup"===r.type)e.before?.tag===r.oldTag&&e.after?.tag===r.newTag&&ee(e.before,e.after,n)&&U(n(e.before),r.before)&&U(n(e.after),r.after)&&(t=r.before&&r.after?2:1);else if("text"===r.type){const o=!(!r.before||!r.after),i=o&&Q(e.before?.text||"",e.after?.text||"",r,!0);(i||Q(n(e.before),n(e.after),r,o))&&(t=o?2:1,i&&(e.directInput=!0))}t&&e.matches.push(r),o=Math.max(o,t)}return o}function oe(e,t){return!!e?.children.some(e=>e===t||e.node&&e.node===t?.node||oe(e,t))}const re=new Set(["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","PageDown","PageUp","Home","End"," "]);function ie(e,t){let n;for(const o of e?.rects??[]){const e=t(o);if(e.visible)return e;(!n||e.distance<n.distance)&&(n=e)}return n}function ae(e){return new Promise(t=>{const n=()=>{e.clearTimeout(o),e.cancelAnimationFrame(r),t()},o=e.setTimeout(n,100);let r=e.requestAnimationFrame(()=>{r=e.requestAnimationFrame(n)})})}function se(e,t=!1){if(!me(e,{visibilityProperty:!0,opacityProperty:!0}))return;const{left:n,right:o,top:r,bottom:i,width:a,height:s}=e.getBoundingClientRect();if(!(t||a&&s))return;const l=e.ownerDocument,{documentElement:c,body:d,defaultView:u}=l,f={left:n,right:a?o:n+1,top:r,bottom:s?i:r+1},p={...f},m={x:f.right-f.left,y:f.bottom-f.top},h="visible"===u.getComputedStyle(c).overflow,g=u.getComputedStyle(e);for(let n=e;n&&n!==c;){const o=n===e?g:u.getComputedStyle(n),{position:r,display:i,overflowX:a,overflowY:s}=o;if(n!==e&&(n!==d||!h)&&"inline"!==i&&("visible"!==a||"visible"!==s)&&n.offsetWidth&&n.offsetHeight){const{bounds:e,scaleX:r,scaleY:i}=pe(n,o);for(const[l,c,d,u,h]of[["x",a,"left","right",r],["y",s,"top","bottom",i]]){if("visible"===c)continue;const r="clip"===c?[0,0]:fe(n,o,l,h),i=t&&"hidden"===c,a="y"===l==("horizontal-tb"===o.writingMode);if(i&&r.some(e=>e)&&(a||f[d]<e[d]||f[u]>e[u]||le(o,g,l)))return{boundary:n};if(!ue(f,p,e,d,u,i?[0,0]:r))return{boundary:n};m[l]=Math.min(m[l],p[u]-p[d])}}n="absolute"===r||"fixed"===r?n.offsetParent:n.parentElement}return{clipped:f,extent:m}}function le(e,t,n){const o=e=>e&&"auto"!==e&&0!==parseFloat(e);return("x"===n?["Left","Right"]:["Top","Bottom"]).some(n=>o(e[`scrollPadding${n}`])||o(t[`scrollMargin${n}`]))}function ce(e,t,n=!1){const o=se(e,n);if(!o?.clipped)return;const{clipped:r,extent:i}=o,{ownerDocument:a}=e,s=a.documentElement;if(r.left=Math.max(s.clientLeft,r.left),r.right=Math.min(s.clientLeft+s.clientWidth,r.right),r.top=Math.max(0,r.top),r.bottom=Math.min(s.clientHeight,r.bottom),r.right<=r.left)return{rects:[]};const l=t?.({...r,top:0,bottom:s.clientHeight}),c=l?.visibleCenterX??(r.left+r.right)/2,d=be(e,c);if(r.bottom<=r.top)return{rects:[],header:d?.bottom};const u={rects:[r],inViewport:!0,extent:i};if(!d)return u;const f={left:Math.max(r.left,d.left),right:Math.min(r.right,d.right),top:Math.max(r.top,d.top),bottom:Math.min(r.bottom,d.bottom)};if(!de(f)||!d.node.contains(a.elementFromPoint(c,(f.top+f.bottom)/2)))return u;const p=[{...r,top:f.bottom},{...r,bottom:f.top},{...f,left:r.left,right:f.left},{...f,left:f.right,right:r.right}].filter(de);return!p.length&&d.bottom>=s.clientHeight&&d.top<=0?void 0:{rects:p,inViewport:!0,extent:i,header:d.bottom}}function de({left:e,right:t,top:n,bottom:o}){return t>e&&o>n}function ue(e,t,n,o,r,[i,a]){return e[o]=Math.max(e[o],n[o]),e[r]=Math.min(e[r],n[r]),t[o]=Math.max(n[o],t[o]+i),t[r]=Math.min(n[r],t[r]+a),t[r]>t[o]}function fe(e,t,n,o){const r="x"===n,i=r?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight;if(i<=0)return[0,0];const a=r?e.scrollLeft:e.scrollTop,s=t.display.endsWith("flex")&&t.flexDirection===(r?"row-reverse":"column-reverse"),l=(r&&"rtl"===t.direction)!==s;let c=l?-i:0,d=l?0:i;return("horizontal-tb"!==t.writingMode||a<c||a>d)&&(c=-i,d=i),[(a-d)*o,(a-c)*o]}function pe(e,t){const n=e.getBoundingClientRect(),o=n.width/e.offsetWidth,r=n.height/e.offsetHeight,i=n.left+e.clientLeft*o,a=n.top+e.clientTop*r,s={left:i,top:a,right:i+e.clientWidth*o,bottom:a+e.clientHeight*r},l=t.overflowClipMargin;if("clip"!==t.overflowX&&"clip"!==t.overflowY||!l||"0px"===l)return{bounds:s,scaleX:o,scaleY:r};const c=l.split(" ").map(parseFloat).find(Number.isFinite)??0,d=l.includes("border-box")?n:s,u=l.includes("content-box");return{scaleX:o,scaleY:r,bounds:{left:d.left+((u?parseFloat(t.paddingLeft):0)-c)*o,right:d.right-((u?parseFloat(t.paddingRight):0)-c)*o,top:d.top+((u?parseFloat(t.paddingTop):0)-c)*r,bottom:d.bottom-((u?parseFloat(t.paddingBottom):0)-c)*r}}}function me(e,t={visibilityProperty:!0}){return!!e?.isConnected&&!!e.getClientRects().length&&(!e.checkVisibility||e.checkVisibility(t))&&"visible"===e.ownerDocument.defaultView.getComputedStyle(e).visibility}function he(e){return e.matchMedia("(prefers-reduced-motion: reduce)").matches?"instant":"smooth"}function ge(e,{behavior:t,header:n=ye(e),nearest:o=!1}={}){const r=e.ownerDocument,i=r.defaultView,a=t??he(i);if(o&&!n)return void e.scrollIntoView({behavior:a,block:"nearest",inline:"nearest"});const s=i.getComputedStyle(e).scrollMarginTop,l=r.documentElement,c=l.clientHeight,d=i.getComputedStyle(l),u=ve(d.scrollPaddingTop,c),f=ve(d.scrollPaddingBottom,c);let p,m;try{let t=o?"nearest":"start";if(o){const e=n-parseFloat(s);null!==u&&e>u&&(p=l.getAttribute("style"),l.style.setProperty("scroll-padding-top",`${e}px`,"important"))}else{const t=n>0&&null!==u?`max(${s}, ${n-u}px)`:s;m=e.getAttribute("style"),e.style.setProperty("scroll-margin-top",`calc(${t} + 1lh)`,"important")}if(!o&&null!==u&&null!==f){const n=i.getComputedStyle(e),o=c-u-f-parseFloat(n.scrollMarginTop)-parseFloat(n.scrollMarginBottom),r=o-e.getBoundingClientRect().height;if(r>=0&&(t="center"),r>0&&"horizontal-tb"===d.writingMode){const e=Math.min(o/3,r);p=l.getAttribute("style"),l.style.setProperty("scroll-padding-bottom",`${f+e}px`,"important")}}e.scrollIntoView({behavior:a,block:t,inline:"nearest"})}finally{void 0!==p&&we(l,p),void 0!==m&&we(e,m)}}function we(e,t){e.setAttribute("style",t??""),null===t&&e.removeAttribute("style")}function ve(e,t){if("auto"===e)return 0;const n=parseFloat(e);return Number.isFinite(n)?n*(e.endsWith("%")?t/100:1):null}function ye(e){const t=e.getBoundingClientRect();return be(e,t.left+t.width/2)?.bottom??0}function be(e,t){const n=e.ownerDocument;for(let o=n.elementFromPoint(t,1);o&&!o.contains(e);o=o.parentElement){const e=n.defaultView.getComputedStyle(o);if("fixed"!==e.position&&"sticky"!==e.position)continue;if("0"===e.opacity||!me(o,{visibilityProperty:!0,opacityProperty:!0}))continue;const{left:t,right:r,top:i,bottom:a}=o.getBoundingClientRect();if("fixed"===e.position||i<=parseFloat(e.top)+1)return{node:o,left:t,right:r,top:i,bottom:a}}}function xe(e,t,n,o){const r=window.acf;r.addAction("wysiwyg_tinymce_init",n);for(const e of["append","remove","sortstop","change_field"])r.addAction(e,t);const i=t=>{t[0]===e&&o?.()};function a(e){return!!e?.closest?.(".acf-field")}let s;return r.addAction("validation_failure",i),window.jQuery(e).on("input.mtflppAcf change.mtflppAcf sortupdate.mtflppAcf",(e,n)=>{a(e.target)&&("sortupdate"===e.type&&(s=n?.item?.[0]?.querySelector(':scope > input[type="hidden"][name$="[acf_fc_layout]"]')?.name),e.originalEvent&&"sortupdate"!==e.type||t())}),{isField:a,isValidating:()=>!!e.classList?.contains("is-validating"),hasStructuralPaginationChanges:()=>!!e.querySelector('.acf-repeater[data-pagination="1"] .acf-row:is(.acf-added, .acf-inserted, .acf-reordered, .acf-deleted)'),accepts:e=>"_acf_nonce"===e||e.startsWith("acf[")||e.startsWith("_acf_fields["),layoutOrders(t,n){const o=new Map,r=new Map,i=new Set;for(const[e,t]of n){"1"===t&&e.endsWith("[acf_fc_layout_disabled]")&&i.add(e.replace(/\[acf_fc_layout_disabled\]$/,"[acf_fc_layout]"));const n=e.match(/^(acf\[.+)\[[^\]]+\]\[acf_fc_layout\]$/)?.[1];n&&(o.has(n)||o.set(n,[]),o.get(n).push(e),r.set(e,[]))}const a=e=>Array.from(e.matchAll(/\]\[/g),({index:t})=>`${e.slice(0,t+1)}[acf_fc_layout]`);function l(e){const t=a(e);if(!t.some(e=>i.has(e)))return t.findLast(e=>r.has(e))}for(const[e,n]of t){if(!e.startsWith("acf[")||!["text","html"].includes(n.type))continue;const t=a(e);if(!t.some(e=>i.has(e)))for(const n of t)r.get(n)?.push(e)}for(const o of e.querySelectorAll('.acf-field[data-type="image"] .acf-image-uploader.has-value')){const e=o.querySelector(':scope > input[type="hidden"][name]'),i=o.querySelector(':scope > .image-wrap > img[data-name="image"]'),a=e?.name;if(!a?.startsWith("acf[")||!i||e.matches(":disabled")||o.closest(".acf-clone"))continue;const s=n.getAll(a);if(1!==s.length||s[0]!==e.value||!/^[1-9]\d*$/.test(s[0]))continue;const c=l(a);c&&(r.get(c).push(a),t.set(a,{type:"row-image",value:s[0],alt:i.alt}))}for(const o of e.querySelectorAll('.acf-field[data-type="gallery"] .acf-gallery')){const e=o.querySelector(':scope > input[type="hidden"][name]'),r=e?.name;if(!r?.startsWith("acf[")||e.matches(":disabled")||o.closest(".acf-clone"))continue;const s=`${r}[]`,l=n.getAll(r),c=n.getAll(s);if(a(r).some(e=>i.has(e))||1!==l.length||""!==l[0]||c.some(e=>!/^[1-9]\d*$/.test(e)))continue;const d=[...o.querySelectorAll(':scope > .acf-gallery-main > .acf-gallery-attachments > .acf-gallery-attachment > input[type="hidden"][name]')];d.length!==c.length||d.some((e,t)=>e.name!==s||e.value!==c[t]||e.matches(":disabled"))||t.set(s,{type:"gallery-order",value:JSON.stringify(c),members:JSON.stringify([...c].sort())})}for(const[e,n]of o){const o=n.filter(e=>!i.has(e));if(o.length<2||new Set(o).size!==o.length)continue;const a=o.includes(s)?s:void 0;t.set(`acf-layout-order:${e}`,{type:"row-order",value:JSON.stringify(o),members:JSON.stringify([...o].sort()),moved:a,fieldsByRow:Object.fromEntries(o.map(e=>[e,r.get(e)]))})}return t},destroy(){r.removeAction("wysiwyg_tinymce_init",n);for(const e of["append","remove","sortstop","change_field"])r.removeAction(e,t);r.removeAction("validation_failure",i),window.jQuery(e).off(".mtflppAcf")}}}function Me(){const e=(0,n.select)("core/edit-post")?.getActiveMetaBoxLocations?.()??["normal","side","advanced"];return[document.querySelector(".metabox-base-form"),...e.map(e=>document.querySelector(`.edit-post-meta-boxes-area.is-${e} .metabox-location-${e}`)||document.querySelector(`#metaboxes .metabox-location-${e}`))].filter(Boolean)}const Pe="meet-the-frontend-live-preview-panel/acf";function Se(e){if(!e.acfEnabled)return!1;if("function"!=typeof window.acf?.addAction||"function"!=typeof window.acf?.removeAction||"function"!=typeof window.jQuery)throw Object.assign(new Error(e.strings.acfUnavailable),{code:"mtflpp_integration_failed"});return!0}(0,o.addAction)("mtflpp.blockEditor.previewSetup",Pe,({config:e,changed:t,hooks:o,onDestroy:r})=>{if(!Se(e))return;const i=function(e){const t=new Set;let o=!1,r=[],i=new Map;const a=()=>{o||e()};function s(e){e&&!t.has(e)&&(t.add(e),e.on("input change undo redo SetContent",a))}const l=xe(document,a,s);function c(e){s(e.editor)}function d(e){l.isField(e.target)&&Me().some(t=>t.contains(e.target))&&a()}window.tinymce?.editors.forEach(s),window.tinymce?.on("AddEditor",c),document.addEventListener("input",d),document.addEventListener("change",d,!0);const u=new MutationObserver(a);return{get ready(){return r=r.filter(({field:e,rows:t})=>e.isConnected&&t.some(t=>e.contains(t))),r.length||u.disconnect(),!r.length},saved(){u.disconnect(),r=Me().flatMap(e=>[...e.querySelectorAll('.acf-repeater[data-pagination="1"]')].map(e=>({field:e,rows:[...e.querySelectorAll(":scope > table > tbody > tr.acf-row:not(.acf-clone)")]})).filter(({rows:e})=>e.length));for(const{field:e}of r)u.observe(e,{childList:!0,subtree:!0});a()},observe(){const e=(0,n.select)("acf/fields");if(!e?.getFieldValue)return;const t=new Map;for(const n of Me())for(const o of window.acf.getFields({parent:window.jQuery(n)})){const n=o.get("key");t.set(n,e.getFieldValue(n))}(t.size!==i.size||[...t].some(([e,t])=>i.get(e)!==t))&&(i=t,a())},capture(){o=!0;const e=new URLSearchParams;try{window.tinymce?.triggerSave();for(const t of Me())for(const[n,o]of new FormData(t))"string"==typeof o&&l.accepts(n)&&e.append(n,o)}finally{o=!1}return e},destroy(){u.disconnect(),l.destroy(),document.removeEventListener("input",d),document.removeEventListener("change",d,!0),window.tinymce?.off("AddEditor",c);for(const e of t)e.off("input change undo redo SetContent",a)}}}(t);r(()=>i.destroy()),o.addAction("observePreviewInputs",Pe,()=>i.observe()),o.addAction("nativeMetaboxSaveAcknowledged",Pe,()=>i.saved()),o.addFilter("previewPauseReason",Pe,t=>t||(i.ready?"":e.strings.acfRefreshing)),o.addFilter("previewFormBody",Pe,e=>{e??=new URLSearchParams;for(const[t,n]of i.capture())e.append(t,n);return e})}),(0,o.addAction)("mtflpp.classicEditor.previewSetup",Pe,({config:e,form:t,changed:n,watchEditor:o,cancelNativeSave:r,hooks:i,onDestroy:a})=>{if(!Se(e))return;const s=xe(t,n,o,r);a(()=>s.destroy());const l=e=>{s.isField(e.target)&&n()};t.addEventListener("input",l),t.addEventListener("change",l,!0),a(()=>{t.removeEventListener("input",l),t.removeEventListener("change",l,!0)}),i.addFilter("nativeSaveValidationPending",Pe,e=>e||s.isValidating()),i.addFilter("previewComparisonValues",Pe,(e,t)=>s.layoutOrders(e,t)),i.addFilter("previewFormBody",Pe,(e,t)=>{for(const[n,o]of t)"string"==typeof o&&s.accepts(n)&&!n.includes("[acfcloneindex]")&&e.append(n,o);return e}),i.addFilter("nativePreviewHandoffError",Pe,(t,n)=>t||(n&&s.hasStructuralPaginationChanges()?Object.assign(new Error(e.strings.nativePreviewAcf),{code:"mtflpp_acf_rows_stale"}):void 0))}),(0,o.addAction)("mtflpp.blockEditor.previewSetup","meet-the-frontend-live-preview-panel/yoast",({config:e,hooks:t})=>{e.yoastPrimaryTaxonomies?.length&&t.addFilter("additionalPreviewValues","meet-the-frontend-live-preview-panel/yoast",(t,o)=>{const r=function(e,t){if(!e.yoastPrimaryTaxonomies?.length)return;const o=(0,n.select)("yoast-seo/editor");if("function"!=typeof o?.getPrimaryTaxonomyId||Number(o.getPostId?.())!==e.postId)return;const r={};for(const n of e.yoastPrimaryTaxonomies){const i=o.getPrimaryTaxonomyId(n);if(void 0===i)continue;const a=-1===Number(i)?0:Number(i),s=t.getEditedPostAttribute(e.taxonomies[n]);r[n]=Array.isArray(s)&&!s.includes(a)?0:a}return Object.keys(r).length?JSON.stringify(r):void 0}(e,o);return void 0===r?t:{...t,yoast_primary_terms:r}})});const ke=window.meetTheFrontendLivePreviewPanel;if(ke){let a;try{a=function(e){const a=document.getElementById("editor"),s=a?.getElementsByClassName("editor-revisions-header"),l=()=>!!s?.length;let c,d=!1,u=!1;const f={get ready(){return d&&!l()},notReady:e.strings.loading,notReadyState:"loading",saving:!1,idle:Promise.resolve(),title:e.postTitle};let p,m,h,g=!1,w=!1,v=0,y=!1;const b=function(e,t){const n=(0,o.createHooks)(),r=[];let i,a=!1;function s(e){i??="mtflpp_integration_failed"===e?.code?e:Object.assign(new Error(t.config.strings.integrationFailed),{code:"mtflpp_integration_failed",cause:e})}const l={get error(){return i},filter(e,t,...o){if(a||i)return t;try{const r=n.applyFilters(e,t,...o);if("additionalPreviewValues"===e&&("[object Object]"!==Object.prototype.toString.call(r)||Object.values(r).some(e=>!(null===e||["string","boolean"].includes(typeof e)||"number"==typeof e&&Number.isFinite(e)))))throw new TypeError("Preview values must be a plain object of scalar values.");return r}catch(e){return s(e),t}},action(e,...t){if(!a&&!i)try{n.doAction(e,...t)}catch(e){s(e)}},capture(e,t=null){a&&!i&&s(new Error("This editor session has ended."));const n=null===e?null:new URLSearchParams(e),o=l.filter("previewFormBody",e,t);if(null===o||o instanceof URLSearchParams||s(new TypeError("Preview capture must return URLSearchParams or null.")),i||null===n||null!==o&&![...n.keys()].some(e=>{const t=n.getAll(e),r=o.getAll(e);return r.length!==t.length||t.some((e,t)=>r[t]!==e)})||s(new TypeError("Preview capture must preserve the classic form body.")),i)throw i;return o},comparisonValues(e,o){const r=new Map(Object.entries(o));try{const o=t.form||document,i=new Set;for(const t of o.querySelectorAll("input[name], textarea[name], select[name]")){if(r.has(t.name)||!e?.has(t.name)||"password"===t.type)continue;if("hidden"===t.type){i.add(t.name);continue}const n="textarea"===t.localName||["text","search","email","url","tel"].includes(t.type),o=e.getAll(t.name);let a="value";n&&1===o.length&&(a=t.classList.contains("wp-editor-area")?"html":"text"),r.set(t.name,{type:a,value:1===o.length?o[0]:JSON.stringify(o)})}for(const t of i){if(r.has(t))continue;const n=e.getAll(t);n.length>1&&r.set(t,{type:"order",value:JSON.stringify(n),members:JSON.stringify(n.sort())})}return Object.fromEntries(n.applyFilters("previewComparisonValues",r,e))}catch{}return Object.fromEntries(r)},destroy(){if(!a){a=!0;for(const e of r.reverse())try{e()}catch(e){s(e)}r.length=0}}};try{(0,o.doAction)("mtflpp.blockEditor.previewSetup",{...t,hooks:n,onDestroy(e){r.push(e)}})}catch(e){s(e),l.destroy()}return l}(0,{config:e,changed(){p?.changed(),k()}}),x=()=>(0,n.select)("core/editor"),M=()=>Number(x()?.getCurrentPostId())===e.postId&&x()?.getCurrentPostType()===e.postType,P=(t=!1)=>{const n=t?e.strings.savedPostConflict:e.strings.nativeSaveFailed;h=Object.assign(new Error(n),{code:"mtflpp_source_changed"})};function S(){if(g||!p)return;const t=l();if(t!==u&&(u=t,t&&(d=!1,p.pause(e.strings.postOnly,"paused")),p.setSuspended(t)),t)return;const n=x(),o=!!n?.getCurrentPost()?.id,r=o&&M();r&&b.action("observePreviewInputs",n);const i=b.filter("previewPauseReason","",n),a=r&&!i&&!b.error;f.notReady=function(t,n,o){return t?n?b.error?.message||o:e.strings.postOnly:e.strings.loading}(o,r,i),f.notReadyState=o?"paused":"loading";const s=r&&(n.isSavingPost()||v>0),c=a&&!d;if(d=a,f.saving=s,b.error)return void p.resume(b.error);if(!d)return void p.pause(f.notReady,f.notReadyState);s&&!w&&p.pause(x().isPreviewingPost()?e.strings.nativePreview:e.strings.saving);const y=w&&!s;w=s;const P={...b.filter("additionalPreviewValues",{},n),post_title:n.getEditedPostAttribute("title")??"",excerpt:n.getEditedPostAttribute("excerpt")??"",content:n.getPostEdits().content??n.getCurrentPost().content,blocks:n.getEditedPostAttribute("blocks"),author:n.getEditedPostAttribute("author"),date:n.getEditedPostAttribute("date"),...Object.fromEntries(Object.entries(e.taxonomies||{}).map(([e,t])=>[`terms:${e}`,n.getEditedPostAttribute(t)])),featured_media:n.getEditedPostAttribute("featured_media")??0};if(b.error)return d=!1,void p.resume(b.error);f.title!==P.post_title&&(f.title=P.post_title,p.setTitle(f.title)),m&&Object.keys(P).length===Object.keys(m).length&&!Object.keys(P).some(e=>P[e]!==m[e])||(m=P,p.changed()),(y||c)&&p.resume(h)}function k(){y||(y=!0,queueMicrotask(()=>{y=!1,S()}))}function E(t,n,o){t&&t.request===n&&t.before===o&&e.base===o&&"boolean"==typeof t.available?"string"==typeof t.after&&i.test(t.after)?(e.base=t.after,e.available=t.available):P("conflict"===t.after):P()}f.preparePreview=()=>{const n=function(){const t=x(),n=t.getEditedPostAttribute("author"),o=t.getEditedPostAttribute("date"),r={};for(const[n,o]of Object.entries(e.taxonomies||{})){const e=t.getEditedPostAttribute(o);Array.isArray(e)&&(r[n]=e)}return{...b.filter("additionalPreviewValues",{},t),...n?{author:n}:{},...void 0!==o?{date:o}:{},...Object.keys(r).length?{terms:JSON.stringify(r)}:{},post_title:t.getEditedPostAttribute("title")??"",content:t.getEditedPostContent(),excerpt:t.getEditedPostAttribute("excerpt")??"",featured_media:t.getEditedPostAttribute("featured_media")??0}}(),o=b.capture(null),r={post_title:"text",content:"html",excerpt:"html"},i=b.comparisonValues(o,Object.fromEntries(Object.entries(n).map(([e,t])=>[e,{type:Object.hasOwn(r,e)?r[e]:"value",value:t}])));let a;if(n.base=e.base,null===o)a=t({url:e.endpoint,method:"POST",data:n});else{for(const[e,t]of Object.entries(n))o.set(e,t??"");a=t({url:e.endpoint,method:"POST",body:o})}return a.then(e=>({...e,comparisonValues:i}))};const C=(0,n.subscribe)(k);return(0,o.addFilter)("editor.preSavePost",r,async function(t){if(g||!p||Number(t.id)!==e.postId||!M())return t;f.saving=!0;const n=p.pause(x().isPreviewingPost()?e.strings.nativePreview:e.strings.saving);try{await n}catch{}return t}),t.use(async function(t,n){if(g||!p||!["POST","PUT","PATCH"].includes((t.method||"GET").toUpperCase()))return n(t);const o=function(t){if("string"==typeof t.path&&t.path.startsWith("/"))return t.path.split("?")[0].replace(/\/$/,"");if("string"!=typeof t.url)return"";const n=new URL(t.url,window.location.href),o=new URL(e.restRoot,window.location.href);return n.origin!==o.origin?"":n.searchParams.has("rest_route")?n.searchParams.get("rest_route").replace(/\/$/,""):n.pathname.startsWith(o.pathname)?`/${n.pathname.slice(o.pathname.length)}`.replace(/\/$/,""):""}(t),r=o===e.postRoute||o===`${e.postRoute}/autosaves`,i=!r&&function(t){if("string"!=typeof e.postFormUrl||!(t.body instanceof FormData)||"string"!=typeof t.url)return!1;const n=new URL(t.url,window.location.href),o=new URL(e.postFormUrl,window.location.href);return n.origin===window.location.origin&&n.origin===o.origin&&n.pathname===o.pathname&&n.searchParams.has("meta-box-loader")&&t.body.get("post_ID")===String(e.postId)&&"editpost"===t.body.get("action")}(t);if(!r&&!i)return n(t);v++,f.saving=!0,k();const a=p.pause(e.strings.saving);try{await a}catch{}const s=e.base,l=Array.from(window.crypto.getRandomValues(new Uint8Array(16)),e=>e.toString(16).padStart(2,"0")).join("");let c;try{if(r){const e=await n({...t,headers:{...t.headers,"X-MTFLPP-Base":s,"X-MTFLPP-Request":l}});if(!1===t.parse){try{const t=await e.clone().json();E(t?._mtflpp_receipt,l,s)}catch{P()}return e}if(!e||"object"!=typeof e)return P(),e;const{_mtflpp_receipt:o,...r}=e;return E(o,l,s),r}const o=new FormData;for(const[e,n]of t.body)o.append(e,n);o.set("mtflpp_base",s),o.set("mtflpp_preview",l),o.set("mtflpp_metabox","1"),c=`mtflpp_preview_${l}`;const i=await n({...t,body:o}),a=document.cookie.split(";").map(e=>e.trim()).find(e=>e.startsWith(`${c}=`)),d=a?.slice(c.length+1),u=d?.startsWith(`${s}.`)?d.slice(65):"";return E({request:l,before:s,after:"conflict"===d?d:u,available:e.available},l,s),h||b.action("nativeMetaboxSaveAcknowledged"),i}catch(e){let t=e?._mtflpp_receipt;try{void 0!==t&&delete e._mtflpp_receipt}catch{t=void 0}const n=e?.data?.status;throw r&&"AbortError"!==e?.name&&"string"==typeof e?.code&&Number.isInteger(n)&&n>=400&&n<500&&t?.after===s?E(t,l,s):P(),e}finally{c&&(document.cookie=`${c}=; Max-Age=0; Path=${e.adminCookiePath}; SameSite=Strict`),v--,k()}}),f.connect=e=>{p=e,a&&(c=new MutationObserver(()=>{l()!==u&&k()}),c.observe(a,{childList:!0,subtree:!0})),S()},f.destroy=()=>{g||(g=!0,c?.disconnect(),C(),b.destroy(),(0,o.removeFilter)("editor.preSavePost",r))},window.addEventListener("pagehide",e=>{e.persisted||f.destroy()}),f}(ke);const s=window.wp?.editor?.PluginPreviewMenuItem,l=window.wp?.plugins?.registerPlugin,c="function"==typeof s&&"function"==typeof l,d=c?{fallbackMedia:window.matchMedia("(max-width: 782px)"),focus(){const e={preventScroll:!0},t=document.querySelector(".editor-preview-dropdown__toggle");t?.focus(e),t&&document.activeElement===t||document.querySelector('.interface-interface-skeleton__content[tabindex="-1"]')?.focus(e)}}:void 0,u=function(e,t,{inlineLauncher:n,nativeLauncher:o}={}){const r=e.strings,i=e.termId??e.postId,a=window,s=function(){let e,t=0,n=0;return{remember(e){try{e&&(t=e.defaultView.scrollY)}catch{}},async restore(e,o,r=()=>!0,i){const a=++n;try{const s=e.defaultView;let l;if(s.scrollTo({top:t,left:0,behavior:"instant"}),o?.ownerDocument===e&&r()){if(await ae(s),a!==n||o.ownerDocument!==e||!r())return;if(function(e,t){const n=e.ownerDocument;for(let t=e;t;t=t.parentElement)if("until-found"!==t.getAttribute("hidden")?.toLowerCase()&&(t.hasAttribute("hidden")||"none"===n.defaultView.getComputedStyle(t).display))return!1;let o=!1;for(let r=e;r&&e.isConnected&&e.ownerDocument===n&&t();r=r.parentElement){if("until-found"===r.getAttribute("hidden")?.toLowerCase()){if(r.dispatchEvent(new n.defaultView.Event("beforematch",{bubbles:!0})),!(e.isConnected&&e.ownerDocument===n&&r.isConnected&&r.ownerDocument===n&&r.contains(e)&&t()))break;"until-found"===r.getAttribute("hidden")?.toLowerCase()&&r.removeAttribute("hidden"),o=!0}const i=r.parentElement;i instanceof n.defaultView.HTMLDetailsElement&&!i.open&&r!==Array.from(i.children).find(e=>"summary"===e.localName)&&(i.open=!0,o=!0)}return o}(o,()=>a===n&&r())&&await new Promise(e=>s.setTimeout(e,0)),a!==n||!r())return;const t=o.ownerDocument===e?function(e){if(!e?.isConnected)return null;const t=se(e,!0);if(t?.clipped)return e;if(!t?.boundary)for(const t of e.querySelectorAll("*"))if(se(t,!0)?.clipped)return t;for(let n=t?.boundary||e.parentElement;n;){const e=se(n,!0);if(e?.clipped)return n;n=e?.boundary||n.parentElement}return null}(o):null;t&&(function(e,t){const n=ce(e,t,!0);if(!n?.inViewport)return void ge(e);const{rects:o,extent:r,header:i=0}=n,a=e.ownerDocument.documentElement,s=Math.min(r.x,a.clientWidth),l=Math.min(r.y,a.clientHeight-i);o.some(e=>e.right-e.left>=s-1&&e.bottom-e.top>=l-1)?t&&ie(n,t)?.reveal(he(e.ownerDocument.defaultView)):ge(e,{nearest:!0,header:i})}(t,i),o.contains(t)&&(l=t))}return t=s.scrollY,l}catch{}},keepInView(t,{canvas:n,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:a,canFollow:s}){try{const l=e?.target===t&&e.canFollow();if(e?.cancel(),!t.isConnected||!s())return;if(!l){const e=ce(t,o);if(!ie(e,o)?.visible)return}const c=new AbortController,d={target:t,canFollow:()=>!c.signal.aborted&&s(),cancel(){c.abort(),e===d&&(e=null)}};return e=d,function(e,t,n,o,r){const i=e=>{e.isTrusted&&("keydown"!==e.type||re.has(e.key))&&r()},a={capture:!0,passive:!0,signal:o};for(const n of[e,t])for(const e of["wheel","touchmove","pointerdown","keydown"])n?.addEventListener(e,i,a);t?.addEventListener("scroll",()=>{n?.()&&r()},a)}(t.ownerDocument.defaultView,n,a,c.signal,()=>{d.cancel(),i?.()}),async function(e,t,n,o){try{const r=e.ownerDocument.defaultView;if(await ae(r),!o())return;const{scrollX:i,scrollY:a}=r,s=n();if(s&&await s,!o()||r.scrollX!==i||r.scrollY!==a)return;let l=ce(e,t);l&&!l.rects.length&&(ge(e,{behavior:"instant",header:l.header}),l=ce(e,t)),ie(l,t)?.reveal()}catch{}}(t,o,r,d.canFollow).finally(d.cancel)}catch{}}}}(),l=p(r,{postTitle:t.title??e.postTitle,publicRedirect:e.publicRedirect,inlineLauncher:n,nativeLauncher:o,onOpen:()=>j(),onClose:()=>A(),onRefresh:R,onRetry:e=>e?j(!0):R(),beforeViewportChange:e=>h.beforeViewportChange(e),beforeMove:V,afterMove:()=>{u&&R()}});let c,d,u=!1,f=0;const h=function(e,t,n,o,r=[]){const i=m(r);let a,s,l,c,d;function u(){d?.()}return{get hasPreview(){return!!a},get hasHtmlPreview(){return!!s},get redirectDestination(){return c},load:function(r,f,p=()=>!1,m){const h=new URL(r);if("https:"!==h.protocol&&"http:"!==h.protocol)throw Object.assign(new Error(n.failed),{code:"mtflpp_preview_unsupported_url"});if(h.origin!==window.location.origin){const e=n.originMismatch.replace("%s",()=>h.origin+h.pathname);throw Object.assign(new Error(e),{code:"mtflpp_preview_origin_mismatch"})}const g=h.searchParams.get("mtflpp_token");if(!g)throw new Error(n.failed);return window.crossOriginIsolated&&h.searchParams.set("mtflpp_isolated","1"),u(),h.searchParams.delete("mtflpp_source"),e.followChanges&&h.searchParams.set("mtflpp_source","1"),o(n.updating),new Promise((r,u)=>{const w=e.stage.ownerDocument.createElement("iframe");w.title=n.title,w.className="mtflpp-frame mtflpp-loading",w.setAttribute("aria-hidden","true"),w.setAttribute("tabindex","-1"),w.referrerPolicy="same-origin";let v=!1,y=!1;const b=setTimeout(()=>M(new Error(n.failed)),3e4),x=()=>{y=!0,M()};function M(e){v||(v=!0,e&&(y=!0),clearTimeout(b),d===x&&(d=null),w!==a&&(w.onload=null,w.onerror=null,w.remove()),e?u(e):r())}d=x,w.onload=async()=>{const r=w!==a;if(r||(s=null,l=null),y||!f())return void M();let d,u,v;try{const e=w.contentDocument,t=e?.querySelector('meta[name="meet-the-frontend-live-preview-panel"]');t?.content===g?d=e:r&&!t&&(u=function(e,t){if("text/html"!==e?.contentType)return;const n=e.defaultView?.performance.getEntriesByType("navigation")[0];if(!(n?.redirectCount>0))return;const o=new URL(n.name);return o.origin!==t.origin||o.pathname===t.pathname&&o.search===t.search?void 0:o.pathname}(e,h))}catch{}d&&(e.followChanges&&i.capture(d,r?m:void 0),d.documentElement.style.setProperty("overscroll-behavior","contain","important")),d&&r&&(t.remember(s),e.followChanges&&p()&&s&&(v=i.findChange(s,d))),r&&a&&(a.onload=null,a.onerror=null,a.remove()),a=w,s=d,l=null,c=u,w.classList.remove("mtflpp-loading"),w.removeAttribute("aria-hidden"),w.removeAttribute("tabindex");const b=()=>!y&&f()&&w===a&&d===s&&(!d||w.contentDocument===d);let x;if(d&&r){const n=e.canvasTarget&&(t=>e.canvasTarget(w,t,{fitTarget:!0}));x=await t.restore(d,v,()=>b()&&e.followChanges&&p(),n)}b()?(l=x,o(n.current,"ready"),M()):M()},w.onerror=()=>{w===a?(s=null,l=null,c=void 0,f()&&o(n.failed,"error")):M(new Error(n.failed))},w.src=h.href,e.stage.append(w)})},cancel:u,beforeViewportChange({canvasTarget:n,canFollow:o,...r}){const i=l,c=s,d=a;if(i&&c)return t.keepInView(i,{...r,canvasTarget:e=>n(d,e),canFollow:()=>i===l&&c===s&&d.contentDocument===c&&e.visible&&e.followChanges&&o()})},clear(){u(),t.remember(s),a&&(a.onload=null,a.onerror=null),a=null,s=null,l=null,c=void 0,e.clearPreview()}}}(l,s,r,k,e.comparisonExcludedSelectors);let g,w,v,y,b,x,M,P,S=!1;try{a.BroadcastChannel&&(P=new a.BroadcastChannel(`meet-the-frontend-live-preview-panel:${e.endpoint}:${i}:${e.userId}`),P.onmessage=e=>{"takeover"===e.data?.type&&u&&(A(!0),k(r.handedOff,"conflict",{reason:"handed-off"}))},a.addEventListener("pagehide",e=>{e.persisted||P.close()}))}catch{P?.close(),P=null}function k(e,n="loading",{canRetry:o=!0,reason:r=""}={}){"ready"===n&&(S=!1),l.report(e,n,{canTakeOver:!!P,hasPreview:h.hasPreview,canRetry:o,reason:r,hasHtmlPreview:h.hasHtmlPreview,redirectDestination:h.redirectDestination,canRefresh:u&&!t.saving&&["ready","error"].includes(n)&&("error"!==n||o)})}function E(e){const t=e?.code,n=function(e){const t=e?.code;return"mtflpp_post_locked"===t?"post-locked":"mtflpp_acf_rows_stale"===t?"reload-before-save":["mtflpp_invalid_nonce","rest_cookie_invalid_nonce","mtflpp_preview_conflict","mtflpp_source_changed","mtflpp_acf_unavailable","mtflpp_integration_failed"].includes(t)?"reload":["mtflpp_cannot_preview","rest_forbidden","rest_cannot_edit"].includes(t)?"permission":"mtflpp_preview_origin_mismatch"===t?"origin-mismatch":"mtflpp_preview_unsupported_url"===t?"unsupported-url":""}(e);n&&(u=!1,C(),h.cancel(),b?.()),k("string"==typeof t?e.message:r.failed,"post-locked"===n?"paused":"error",{reason:n,canRetry:!n})}function C(){clearTimeout(c),d=void 0}function L(e){if(void 0===e&&void 0===d)return;const t=performance.now();void 0!==e&&(d=t+e),clearTimeout(c);const n=Math.ceil(d-t);n>0?c=setTimeout(T,n):T()}function O(){u&&(f+=1,S=!0,h.cancel(),t.saving||k(r.stale,"stale"),t.saving||t.previewing?C():L(275))}function T(){if(!u||g||!1===t.ready||t.previewing||t.saving)return;C();const n=f;k(r.updating),g=(async()=>{try{if(await t.idle,!u||!1===t.ready||t.saving)return;const o=e.base;let i,a;v=t.preparePreview(l.followChanges);try{i=await v}catch(e){a=e}finally{v=null}if(await t.idle,!u||!1===t.ready||t.saving||o!==e.base)return;if(a)throw a;if("string"!=typeof i.url)throw Object.assign(new Error(i.message||r.failed),{code:i.code});u&&n===f&&await function(e,t,n){return h.load(e,()=>u&&t===f,()=>l.followChanges&&S,n)}(i.url,n,i.comparisonValues)}catch(e){u&&!t.saving&&E(e)}finally{g=null,L()}})()}function V(){f+=1,h.clear()}function A(e=!1){l.setVisible(e),u=!1,C(),V(),clearTimeout(M),M=null,x?.abort(),l.returnToEditor(),b?.()}async function j(n=!1){if(l.setVisible(!0),u)return;if(w)return void E(w);if(y){if(x&&!x.signal.aborted)return;const e=f;try{await y}catch{}return void(l.visible&&e===f&&j(n))}if(!1===t.ready)return void k(t.notReady,t.notReadyState??"paused",{canRetry:!1});if(!e.available)return void k(r.unavailable,"error",{canRetry:!1,reason:"unavailable"});if(!a.isSecureContext||!navigator.locks)return void k(r.browser,"error",{canRetry:!1,reason:"browser"});const o=n&&P?new AbortController:null;let s=!1;x=o,o?(k(r.waiting,"handover"),M=setTimeout(()=>{s=!0,o.abort()},15e3)):k(t.saving?r.saving:r.updating);try{const n=o?{signal:o.signal}:{ifAvailable:!0};if(y=navigator.locks.request(`meet-the-frontend-live-preview-panel:${e.endpoint}:${i}`,n,async e=>{if(clearTimeout(M),M=null,x=null,l.visible&&!o?.signal.aborted)if(e){k(t.saving?r.saving:r.updating);try{await new Promise(e=>{b=e,u=!0,f+=1,T()}),await g}finally{b=null}}else k(P?r.conflict:r.closeOther,"conflict",{reason:P?"other-tab":"manual"})}),o)try{P.postMessage({type:"takeover"})}catch(e){throw o.abort(),u&&A(!0),await y.catch(()=>{}),e}await y,l.visible&&s&&k(r.takeoverTimeout,"conflict",{reason:"busy"})}catch(e){u=!1,l.visible&&s?k(r.takeoverTimeout,"conflict",{reason:"busy"}):l.visible&&"AbortError"!==e.name&&E(e)}finally{clearTimeout(M),M=null,x=null,y=null}}function R(e=!0){t.saving||(e||(S=!1),u?(f+=1,h.cancel(),L(0)):j())}return{changed:O,pause:function(e=r.saving,t="loading"){return f+=1,C(),h.cancel(),(u||l.visible&&"paused"===t)&&k(e,t,{canRetry:!1}),v},resume:function(e){w=e,e?l.visible&&E(e):!l.visible||u||y?O():j()},setSuspended:l.setSuspended,setTitle:l.setTitle,openFromLauncher:l.openFromLauncher,start:()=>{l.visible&&j()},get pending(){return g}}}(ke,a,{nativeLauncher:d});a.connect(u),c&&l("meet-the-frontend-live-preview-panel",{render:()=>(0,e.createElement)(s,{role:"menuitem",icon:null,info:ke.strings.showLivePreviewHelp,onClick:()=>window.requestAnimationFrame(()=>u.openFromLauncher())},ke.strings.showLivePreview)})}catch(e){a?.destroy(),function(e,t){document.getElementById("mtflpp-panel")?.remove(),document.getElementById("mtflpp-toggle")?.remove(),document.getElementById("mtflpp-publish-preview")?.remove(),document.getElementById("mtflpp-term-preview")?.remove();const n=document.createElement("div");n.className="notice notice-error inline",n.setAttribute("role","alert");const o=document.createElement("p");o.textContent=e,n.append(o);const r=document.querySelector("#wpbody-content .wp-header-end")||document.querySelector("#wpbody-content .wrap h1, #wpbody-content .wrap h2");r?r.after(n):(document.getElementById("wpbody-content")||document.body).prepend(n),console.error("Meet the Frontend – Live Preview Panel could not start.",t)}(ke.strings.bootFailed,e)}}})();
  • meet-the-frontend-live-preview-panel/tags/1.3.1/build/classic-editor.asset.php

    r3820590 r3822693  
    1010                'wp-primitives'
    1111        ),
    12         'version' => '299c3b38e3acce334a1b'
     12        'version' => 'f8d9d3c4a1d18700a696'
    1313);
  • meet-the-frontend-live-preview-panel/tags/1.3.1/build/classic-editor.js

    r3820590 r3822693  
    1 (()=>{"use strict";const e=window.wp.hooks,t=window.wp.data,n=window.wp.preferences,o=window.wp.element,r=window.wp.components,i=window.wp.notices,a=window.wp.primitives,s=window.ReactJSXRuntime,l={refresh:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M12 5.5L17.7929 11.2929C18.1834 11.6834 18.1834 12.3166 17.7929 12.7071L16 14.5M16 5.5H12V9.5M12 18.5L6.20711 12.7071C5.81658 12.3166 5.81658 11.6834 6.20711 11.2929L8 9.5M8 18.5H12V14.5"})}),more:(0,s.jsxs)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,s.jsx)(a.Path,{d:"M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z",fill:"currentColor",stroke:"none"}),(0,s.jsx)(a.Path,{d:"M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z",fill:"currentColor",stroke:"none"}),(0,s.jsx)(a.Path,{d:"M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z",fill:"currentColor",stroke:"none"}),(0,s.jsx)(a.Path,{d:"M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z"}),(0,s.jsx)(a.Path,{d:"M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z"}),(0,s.jsx)(a.Path,{d:"M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z"})]}),expand:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M4.75 10V4.75H10M4.75 4.75L10 10M14 19.25H19.25V14M19.25 19.25L14 14"})}),compact:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M10 4.75V10H4.75M10 10L4.75 4.75M19.25 14H14V19.25M14 14L19.25 19.25"})}),pip:(0,s.jsxs)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,s.jsx)(a.Path,{d:"M4.75 9.25V16C4.75 16.6904 5.30964 17.25 6 17.25H8M4.75 9.25V6C4.75 5.30964 5.30964 4.75 6 4.75H16C16.6904 4.75 17.25 5.30964 17.25 6V8M4.75 9.25H8"}),(0,s.jsx)(a.Path,{d:"M10.75 11.25C10.75 10.9739 10.9739 10.75 11.25 10.75H18.75C19.0261 10.75 19.25 10.9739 19.25 11.25V18.75C19.25 19.0261 19.0261 19.25 18.75 19.25H11.25C10.9739 19.25 10.75 19.0261 10.75 18.75V11.25Z",fill:"currentColor"})]}),move:(0,s.jsxs)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,s.jsx)(a.Path,{d:"M9.25 5.75H8.75V6.25H9.25V5.75Z",fill:"currentColor",stroke:"none"}),(0,s.jsx)(a.Path,{d:"M9.25 11.75H8.75V12.25H9.25V11.75Z",fill:"currentColor",stroke:"none"}),(0,s.jsx)(a.Path,{d:"M9.25 17.75H8.75V18.25H9.25V17.75Z",fill:"currentColor",stroke:"none"}),(0,s.jsx)(a.Path,{d:"M15.25 5.75H14.75V6.25H15.25V5.75Z",fill:"currentColor",stroke:"none"}),(0,s.jsx)(a.Path,{d:"M15.25 11.75H14.75V12.25H15.25V11.75Z",fill:"currentColor",stroke:"none"}),(0,s.jsx)(a.Path,{d:"M15.25 17.75H14.75V18.25H15.25V17.75Z",fill:"currentColor",stroke:"none"}),(0,s.jsx)(a.Path,{d:"M9.25 5.75H8.75V6.25H9.25V5.75Z"}),(0,s.jsx)(a.Path,{d:"M9.25 11.75H8.75V12.25H9.25V11.75Z"}),(0,s.jsx)(a.Path,{d:"M9.25 17.75H8.75V18.25H9.25V17.75Z"}),(0,s.jsx)(a.Path,{d:"M15.25 5.75H14.75V6.25H15.25V5.75Z"}),(0,s.jsx)(a.Path,{d:"M15.25 11.75H14.75V12.25H15.25V11.75Z"}),(0,s.jsx)(a.Path,{d:"M15.25 17.75H14.75V18.25H15.25V17.75Z"})]}),warning:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M12 8L12 13M12 14.5L12 16M4.75 12C4.75 7.99593 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12Z",strokeLinejoin:"round"})}),info:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M12 16V11M12 9.5V8M19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12C4.75 7.99594 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12Z",strokeLinejoin:"round"})}),close:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M7.75 16.25L16.25 7.75M16.25 16.25L7.75 7.75"})}),check:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M7 12L10 15L17 8"})}),chevron:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M7 11L12 15L17 11"})}),desktop:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M4.75 16.75V17H3.25C3.11193 17 3 17.1119 3 17.25H21C21 17.1119 20.8881 17 20.75 17H19.25V16.75M4.75 16.75V8.5C4.75 7.80964 5.30964 7.25 6 7.25H18C18.6904 7.25 19.25 7.80964 19.25 8.5V16.75M4.75 16.75H19.25"})}),tablet:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M10 16.5H14M18.25 18V6C18.25 5.30964 17.6904 4.75 17 4.75H7C6.30964 4.75 5.75 5.30964 5.75 6L5.75 18C5.75 18.6904 6.30964 19.25 7 19.25H17C17.6904 19.25 18.25 18.6904 18.25 18Z"})}),mobile:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M11 16.5H13M16.25 18V6C16.25 5.30964 15.6904 4.75 15 4.75H9C8.30964 4.75 7.75 5.30964 7.75 6L7.75 18C7.75 18.6904 8.30964 19.25 9 19.25H15C15.6904 19.25 16.25 18.6904 16.25 18Z"})})};function c(e,t,n="right"){const o=e&&!Array.isArray(e)&&e.bounds&&["x","y","width","height"].every(t=>Number.isFinite(e.bounds[t]))&&e.bounds.width>0&&e.bounds.height>0&&[null,"left","center","right"].includes(e.dock)&&"boolean"==typeof e.expanded&&(void 0===e.anchor||["left","center","right"].includes(e.anchor));let r=!!o&&e.expanded;const i={width:480,height:393},a=o?{...e.bounds}:{x:0,y:0,...i};let s=o?e.dock:n,l=s||o&&e.anchor||"right";function c(){return"left"===l?0:"center"===l?.5:1}function d(e,n=t(!s),o=320,r=220){return e.width=Math.min(n.width,Math.max(Math.min(o,n.width),e.width)),e.height=Math.min(n.height,Math.max(Math.min(r,n.height),e.height)),e.x=Math.max(n.left,Math.min(n.right-e.width,e.x)),e.y=Math.max(n.top,Math.min(n.bottom-e.height,e.y)),e}function u(e){if(!s)return e;const n=t();return e.x="left"===s?n.left:"center"===s?n.left+(n.width-e.width)/2:n.right-e.width,e.y=n.bottom-e.height,e}return{area:t,compactRect:function(){return u(d({...a}))},launcherRect:function(e){return u(d({...e,x:a.x+(a.width-e.width)*c(),y:a.y+a.height-e.height},t(!s),1,1))},usableEdge:function(e){return!(s&&(e.includes("s")||"left"===s&&e.includes("w")||"right"===s&&e.includes("e")))},get anchor(){return l},get anchorFactor(){return c()},get dock(){return s},get expanded(){return r},get layout(){return{bounds:{...a},dock:s,anchor:l,expanded:r}},toggleExpanded(){r=!r},dockTo:function(e="right",t=!1){t&&Object.assign(a,i),r=!1,l=s=e},resize(e,n,o,r){Object.assign(a,function(e,n,o,r){const i=t(!s),a=n.includes("e")||n.includes("w"),c=n.includes("n")||n.includes("s"),d=function(e){return"center"===l?.5:e.includes("w")?1:0}(n),u=e.x+e.width*d,f=n.includes("n"),p=e.y+(f?e.height:0),m=function(e,t,n){return 0===n?e.right-t:1===n?t-e.left:2*Math.min(t-e.left,e.right-t)}(i,u,d),h=f?p-i.top:i.bottom-p,g=(n.includes("w")?-o:o)*(.5===d?2:1),w=Math.max(Math.min(320,m),Math.min(m,e.width+g)),v=Math.max(Math.min(220,h),Math.min(h,e.height+(f?-r:r))),y=a&&0!==o&&w!==e.width,b=c&&0!==r&&v!==e.height,x=f?p-v:p;return{x:y?u-w*d:e.preferredBounds.x,y:b?x:e.preferredBounds.y,width:y?w:e.preferredBounds.width,height:b?v:e.preferredBounds.height}}(e,n,o,r))},move:function(e,n,o,r=!1){const i=d({...e,x:e.x+n,y:e.y+o},t(!0),r?1:320,r?1:220);a.x=i.x+(r?(i.width-a.width)*c():0),a.y=i.y+(r?i.height-a.height:0),s=null}}}function d(e,{postTitle:a="",publicRedirect:s,inlineLauncher:d,nativeLauncher:u,canRememberVisibility:f=!0,onOpen:p,onClose:m,onRefresh:h,onRetry:g,beforeMove:w,afterMove:v,beforeViewportChange:y}){const b=window,x=document,M="meet-the-frontend-live-preview-panel",E=(0,t.select)(n.store),P=(0,t.dispatch)(n.store),k="width"===E.get(M,"fit")?"width":"automatic";P.setDefaults(M,{rememberVisibility:!0,rememberPosition:!0,panelOpen:!0,scrollToChanges:!0,viewport:"desktop",fitMode:k,customZoom:100,tabletOrientation:"portrait",mobileOrientation:"portrait"});const C=()=>!d&&(!u||u.fallbackMedia.matches);let S=!1!==E.get(M,"rememberVisibility"),L=!1!==E.get(M,"rememberPosition"),V=!1!==E.get(M,"scrollToChanges");const T=d?.parentElement??x.getElementById("mtflpp-toggle"),j=x.getElementById("mtflpp-panel");if(!T||!j)throw new Error("Preview panel markup is missing.");const O=d||function(e){let t;const{title:n,moveHelp:i}=e.dataset;return(0,o.flushSync)(()=>(0,o.createRoot)(e).render((0,o.createElement)(r.Button,{ref:e=>{t=e},variant:"secondary",label:n,title:n,description:i,"aria-controls":"mtflpp-panel","aria-expanded":!1},(0,o.createElement)("span",{className:"mtflpp-launcher-label"},n)))),t}(T),H=j.querySelector(".mtflpp-move-control"),R=j.querySelector(".mtflpp-resize"),A=j.querySelectorAll("[data-resize-edge]"),F=j.querySelector(".mtflpp-header"),N=j.querySelector(".mtflpp-caption"),$=j.querySelector(".mtflpp-viewport"),_=j.querySelector(".mtflpp-canvas"),D=j.querySelector(".mtflpp-stage"),B=j.querySelector(".mtflpp-empty"),q=j.querySelector(".mtflpp-devicebar"),W=j.querySelector(".mtflpp-dimensions"),I=j.querySelector(".mtflpp-feedback"),z=j.querySelector('[role="status"]');let Z;const J=function(e,t,n,o={},r=()=>{},i={desktop:"Desktop",tablet:"Tablet",mobile:"Phone"}){const a=e.ownerDocument.defaultView,s=e.querySelector(".mtflpp-canvas"),l=e.querySelector(".mtflpp-canvas-space"),c=n.querySelector(".mtflpp-dimensions-text"),d={desktop:[1280,800],tablet:[768,1024],mobile:[390,844]},u=Object.keys(d);let f=u.includes(o.device)?o.device:"desktop";const p=["automatic","window","width","custom"];let m=p.includes(o.fit)?o.fit:"automatic";const h=e=>Number.isInteger(e)&&e>=10&&e<=400;let g,w=h(o.customZoom)?o.customZoom:100,v=100;const y=e=>"desktop"===e?"landscape":"portrait",b=Object.fromEntries(u.map(e=>[e,"desktop"!==e&&["portrait","landscape"].includes(o[`${e}Orientation`])?o[`${e}Orientation`]:y(e)])),x=()=>b[f]===y(f)?d[f]:[...d[f]].reverse(),M=()=>"width"===m;let E,P,k;const C=a.matchMedia("(prefers-reduced-motion: no-preference)");function S(){const t=e.ownerDocument.defaultView.devicePixelRatio;return Number.isFinite(t)&&t>0?t:1}function L(e,t){if("custom"===m)return w/100/S();const n=s.clientWidth/e;if(M())return n;const o=Math.min(n,s.clientHeight/t);return"automatic"===m?Math.min(1/S(),o):o}function V(e,n){E=e;const[o,r]=x(),i=Math.max(0,(s.clientWidth-o*E)/2),a=Math.max(0,(s.clientHeight-r*E)/2);Object.assign(l.style,{width:`${Math.max(s.clientWidth,i+o*E)}px`,height:`${Math.max(s.clientHeight,a+r*E)}px`}),Object.assign(t.style,{left:`${i}px`,top:`${a}px`,transform:`scale(${E})`});const c=o*E>s.clientWidth+.01||r*E>s.clientHeight+.01,d="custom"===m||M();s.tabIndex=d&&c?0:-1,s.scrollLeft="custom"===m?n.x*E:0,s.scrollTop=d?n.y*E:0}function T(){if(!P)return;const e=P;P=null,e.window.cancelAnimationFrame(e.frame),e.resolve?.()}function j(e,t,n,o){return t<=0||o&&e<-1&&t<n?Math.max(e,t-n):e>=n||o&&e>0&&t>n+1?Math.min(e,t-n):0}function O(o=!1,a=!1){T();const[l,d]=x();if(Object.assign(t.style,{width:`${l}px`,height:`${d}px`}),!e.clientWidth||!e.clientHeight)return;const u=S(),p=`${i[f]} (${l} × ${d}) · `,h=Math.max(400,Math.ceil(e.clientWidth/l*u*100)),y=`${p}${"0".repeat(String(h).length)}%`;n.dataset.reserve!==y&&(n.dataset.reserve=y);const b=a?{x:0,y:0}:{x:(s.scrollLeft||0)/(E||1),y:(s.scrollTop||0)/(E||1)};if(s.style.overflowX="hidden",s.style.overflowY="hidden","custom"===m){const e=L(l,d);for(let t=0;t<2;t++)l*e>s.clientWidth+.01&&(s.style.overflowX="scroll"),d*e>s.clientHeight+.01&&(s.style.overflowY="scroll")}else M()&&d*L(l,d)>e.clientHeight&&(s.style.overflowY="scroll");if(!s.clientWidth||!s.clientHeight)return;const k=L(l,d),j=Math.round(k*u*100),O=j!==v||u!==g;v=j,g=u;const H=`${p}${"custom"===m?w:v}%`;c.textContent!==H&&(c.textContent=H),O&&r();const R=E??k;if(!o||!C.matches||R===k)return void V(k,b);const A={window:e.ownerDocument.defaultView,frame:null},F=A.window.performance.now();P=A;const N=e=>{V(e,b),A.scrollLeft=s.scrollLeft,A.scrollTop=s.scrollTop};N(R);const $=e=>{if(P!==A)return;const t=Math.min(1,Math.max(0,(e-F)/200));N(R+(k-R)*(1-(1-t)**3)),t<1?A.frame=A.window.requestAnimationFrame($):T()};A.frame=A.window.requestAnimationFrame($)}function H(){O()}function R(){k?.();const t=e.ownerDocument.defaultView.matchMedia(`(resolution: ${S()}dppx)`);t.addEventListener("change",R),k=()=>t.removeEventListener("change",R),H()}let A=new a.ResizeObserver(H);return A.observe(e),C.addEventListener("change",H),a.addEventListener("resize",R),R(),{get device(){return f},get fit(){return m},get customZoom(){return w},get zoomPercent(){return"custom"===m?w:v},get dpr(){return S()},get orientation(){return b[f]},canvasTarget:function(e,t,{fitTarget:n=!1}={}){const o=e.getBoundingClientRect(),r=s.getBoundingClientRect(),i=o.left-r.left-s.clientLeft,a=o.top-r.top-s.clientTop,l=j(i+t.left*E,i+t.right*E,s.clientWidth,n),c=j(a+t.top*E,a+t.bottom*E,s.clientHeight,n),d=Math.max(t.left,-i/E),u=Math.min(t.right,(s.clientWidth-i)/E);return{visible:!l&&!c,visibleCenterX:d<u?(d+u)/2:void 0,distance:Math.hypot(l,c),reveal(e="instant"){(l||c)&&s.scrollBy({left:l,top:c,behavior:e})}}},canvasWasPanned:function(){return!!P&&(s.scrollLeft!==P.scrollLeft||s.scrollTop!==P.scrollTop)},whenSettled:function(){if(!P)return;const e=P;return e.done??=new Promise(t=>{e.resolve=t}),e.done},finishMotion(){P&&H()},select(e,{animate:t=!1,keepPan:n=!1}={}){if(!u.includes(e))return;const o=f!==e;f=e,o?O(t,!n):P||H()},rotate({animate:e=!1,keepPan:t=!1}={}){"desktop"!==f&&(b[f]="portrait"===b[f]?"landscape":"portrait",O(e,!t))},setFit(e){p.includes(e)&&m!==e&&(m=e,O(!1,!0))},setZoom(e){if(!h(e)||"custom"===m&&w===e)return;const t="custom"!==m;w=e,m="custom",O(!1,t)},layout:H,beforeMove(){T(),A.disconnect(),k?.(),e.ownerDocument.defaultView.removeEventListener("resize",R)},afterMove(){A=new e.ownerDocument.defaultView.ResizeObserver(H),A.observe(e),e.ownerDocument.defaultView.addEventListener("resize",R),R()}}}($,D,W,{device:E.get(M,"viewport"),fit:E.get(M,"fitMode")??k,customZoom:E.get(M,"customZoom"),tabletOrientation:E.get(M,"tabletOrientation"),mobileOrientation:E.get(M,"mobileOrientation")},()=>Ce(),e),G=x.querySelector("#wpbody-content > .wrap"),X=x.getElementById("wpadminbar");function Y(e=!1){const t=Math.max(1,x.documentElement.clientWidth),n=Math.max(1,x.documentElement.clientHeight),o=x.documentElement.getBoundingClientRect().left+b.scrollX,r=!e&&G?.getBoundingClientRect(),i=r?Math.max(0,"rtl"===b.getComputedStyle(G).direction?r.left-o:o+t-r.right):20,a=e?0:i,s=Math.min(a,(t-1)/2),l=Math.min(Math.max(0,X?.getBoundingClientRect().bottom||0)+a,n-1),c=t-s,d=n-Math.min(a,n-l-1);return{left:s,top:l,right:c,bottom:d,width:c-s,height:d-l}}let U,Q=f&&(!S||!1!==E.get(M,"panelOpen"));const K=E.get(M,"layout"),ee=E.get(M,"position")??K?.dock??K?.anchor;let te=["left","center","right"].includes(ee)?ee:"right";const ne=c(L?K:void 0,Y,te),{compactRect:oe,usableEdge:re}=ne;let ie,ae=!1,se="",le=!1,ce={text:e.loading,state:"loading",hasPreview:!1,canRetry:!1,reason:""},de=!1;function ue(t){const n="string"==typeof t?t.replace(/\s+/g," ").trim():"";N.textContent=n?`${e.preview} — ${n}`:e.title,N.title=N.textContent,U&&(U.document.title=N.textContent)}function fe(){const{text:t,state:n,hasPreview:o,reason:r}=ce;return"handover"===n?{heading:e.switchingPreview,description:t,note:e.tabEdits}:"conflict"===n?{heading:t,description:{"handed-off":e.handedOffHelp,busy:e.takeoverTimeoutHelp,manual:e.closeOtherHelp}[r]||e.conflictHelp,note:"manual"===r?e.manualSwitchHint:e.tabEdits}:"paused"===n?{heading:e.pausedTitle,description:t,note:""}:"error"===n?function(){const{text:t,hasPreview:n,canRetry:o,reason:r}=ce;if("origin-mismatch"===r)return{heading:e.originMismatchTitle,description:n?`${t} ${e.previousPreview}`:t,note:""};if("unavailable"===r||"browser"===r)return{heading:"unavailable"===r?e.unavailableTitle:e.browserTitle,description:t,note:""};if(!n){let n=t;return t===e.failed&&(n=o?e.failedHelp:""),"reload"===r&&(n+=` ${e.reviewBeforeReload}`),{heading:e.failed,description:n,note:""}}return{heading:t===e.failed?e.refreshFailed:t,description:"reload"===r?e.reviewBeforeReload:e.previousPreview,note:""}}():o?{heading:t,description:"",note:""}:{heading:e.loading,description:e.preparing,note:""}}function pe(){return ae?"handover"===ce.state?e.takingOver:e.takeOver:e.retry}function me(e){return!e||["handover","paused"].includes(ce.state)?"info":"error"!==ce.state||ce.canRetry?"warning":"error"}function he(){return ce.redirectDestination?`${e.redirected} ${ce.redirectDestination}`:ce.hasHtmlPreview&&ie?`${e.publicRedirected} ${ie}`:""}function ge(){const{state:t,hasPreview:n,canRetry:o,reason:r}=ce,i=n&&["error","conflict","handover","paused"].includes(t),a=!n||i||se?"":he();if(I.hidden=!i&&!se&&!a,I.tabIndex=I.hidden?-1:0,j.dataset.hasFeedback=String(!I.hidden),I.hidden)return null;if(a)return{heading:a,status:"info",dismissible:!1};const{heading:s,description:l}=fe();return{heading:i?s:se,description:i?l:e.windowNoticeHelp,status:me(i),dismissible:!i,retry:i&&(ae||o&&["error","conflict"].includes(t)),close:i&&"error"===t&&!o&&"reload"!==r,disabled:"handover"===t,action:pe()}}function we(t){ce.hasPreview&&["error","conflict","handover","paused"].includes(ce.state)||(se=t,Ce()),z.textContent=`${t} ${e.windowNoticeHelp}`}function ve(){se="",Ce()}function ye(e,t="loading",{canTakeOver:n=!1,hasPreview:o=!1,hasHtmlPreview:r=!1,redirectDestination:i,canRefresh:a=!1,canRetry:l=!0,reason:c=""}={}){const d=j.ownerDocument.activeElement,u=j.contains(d),f=!o&&(ce.state!==t||ce.text!==e||ce.reason!==c),p=ce.hasPreview!==o;ce={text:e,state:t,canTakeOver:n,hasPreview:o,hasHtmlPreview:r,redirectDestination:i,canRefresh:a,canRetry:l,reason:c},["error","conflict","handover","paused"].includes(t)&&(se=""),j.dataset.state=t,j.dataset.hasPreview=String(o),ae=n&&["conflict","handover"].includes(t),B.hidden=o,q.hidden=!o;const{heading:m,description:h,note:g}=fe();f&&(B.scrollTop=0);const w="ready"!==t||se?"":he();z.textContent=o?[m,h,g,w].filter(Boolean).join(" "):m,Ce(),p&&J.layout(),function(e,t){e&&t&&(!j.contains(e)||e.closest("[hidden]")||e.disabled||!ce.hasPreview&&_.contains(e))&&Z.focus(B.hidden?"actions":"empty-title")}(d,u),Q&&"ready"===t&&r&&!i&&async function(){if(s&&!le){le=!0;try{const e=new URL(s.endpoint);if(e.origin!==b.location.origin)return;const t=await b.fetch(e,{credentials:"same-origin",cache:"no-store",redirect:"error",headers:{"X-WP-Nonce":s.nonce}});if(!t.ok)return;const{destination:n}=await t.json();if("string"!=typeof n||!n)return;if(ie=n,!Q)return;Ce(),"ready"!==ce.state||!ce.hasHtmlPreview||ce.redirectDestination||se||(z.textContent=he())}catch{}}}()}function be(e){f&&S&&E.get(M,"panelOpen")!==e&&P.set(M,"panelOpen",e)}function xe(){L&&P.set(M,"layout",ne.layout)}function Me(){const e=T.hidden;T.hidden=!1,T.style.maxWidth=`${Y(!ne.dock).width}px`;const t={width:T.offsetWidth,height:T.offsetHeight};return T.hidden=e,ne.launcherRect(t)}function Ee(){if(U)return;if(!Q&&C()){const e=Me(),t=ne.anchorFactor;Object.assign(T.style,{left:`${e.x+e.width*t}px`,top:`${e.y+e.height}px`,transform:`translate(${-100*t}%, -100%)`})}let e=oe();if(j.dataset.anchor=ne.anchor,ne.expanded){const t=Y();e={x:t.left,y:t.top,width:t.width,height:t.height}}Object.assign(j.style,{left:`${e.x}px`,top:`${e.y}px`,width:`${e.width}px`,height:`${e.height}px`,transform:""})}function Pe(e="right",t=!1){ne.dockTo(e,t),te=e,P.set(M,"position",te),Ee(),xe(),Ce()}function ke(){return"function"==typeof b.documentPictureInPicture?.requestWindow}function Ce(){if(!Z)return;const t=j.ownerDocument.fullscreenElement===j,n=!U&&!t,o=n&&!ne.expanded;j.classList.toggle("mtflpp-expanded",ne.expanded),R.hidden=!o;for(const e of A)e.hidden=!o||!re(e.dataset.resizeEdge);const r=ae||ce.canRetry&&["error","conflict"].includes(ce.state);var i;Z.update({inPage:n,inPip:!!U,movable:o,dock:ne.dock,canRememberVisibility:f,rememberVisibility:S,rememberPosition:L,followChanges:V,device:J.device,busy:ce.hasPreview&&["stale","loading","handover"].includes(ce.state)&&ce.text!==e.saving,empty:ce.hasPreview?null:{...fe(),busy:["loading","stale","ready","handover"].includes(ce.state),icon:["paused","conflict"].includes(ce.state)||["unavailable","browser","origin-mismatch"].includes(ce.reason)?"info":"warning",retry:r,disabled:"handover"===ce.state,close:"error"===ce.state&&!r,action:pe()},notice:ge(),fit:J.fit,orientation:J.orientation,customZoom:J.customZoom,zoomPercent:J.zoomPercent,dpr:J.dpr,canRefresh:ce.canRefresh,hasPreview:ce.hasPreview,canPip:n&&ke(),canFullscreen:n&&!!x.fullscreenEnabled,mode:t||ne.expanded?"compact":"expand",modeLabel:(i=t,i?e.exitFullscreen:ne.expanded?e.compact:e.expand)})}function Se(){Z.closeMenu(),U?U.close():x.fullscreenElement!==j?(ne.toggleExpanded(),Ee(),xe(),Ce(),Z.focus("mode")):x.exitFullscreen().then(ve,()=>we(e.fullscreenFailed))}function Le(t,n=!1,o){const r=t===O,i=t===F,a=()=>o||("left"===ne.anchor?"ne":"nw"),s=()=>U||!r&&ne.expanded||x.fullscreenElement===j||n&&!re(a());let l,c;const d=()=>({...r?Me():oe(),preferredBounds:ne.layout.bounds});function u(){if(c=null,l)if(n||r)Ee();else{const e=oe(),t=e.x-parseFloat(j.style.left),n=e.y-parseFloat(j.style.top);Object.assign(j.style,{width:`${e.width}px`,height:`${e.height}px`,transform:`translate3d(${t}px, ${n}px, 0)`})}}function f(){if(!l)return;const{pointer:e,moved:n}=l;l=null,b.cancelAnimationFrame(c),t.hasPointerCapture(e)&&t.releasePointerCapture(e),j.classList.remove("mtflpp-dragging"),t.classList.remove("mtflpp-edge-active"),x.documentElement.classList.remove("mtflpp-window-dragging"),x.documentElement.style.removeProperty("--mtflpp-drag-cursor"),Ee(),n&&(r&&(de=!0),xe(),Ce())}t.addEventListener("pointerdown",e=>{0!==e.button||s()||i&&e.target.closest('button, a, [role="button"]')||(r&&(de=!1),e.preventDefault(),r?O.focus({preventScroll:!0}):t===H&&Z.focus("move"),Z.closeMenu(),l={...d(),pointer:e.pointerId,pointerX:e.clientX,pointerY:e.clientY},t.setPointerCapture(e.pointerId))}),t.addEventListener("pointermove",e=>{if(!l||l.pointer!==e.pointerId)return;const o=e.clientX-l.pointerX,i=e.clientY-l.pointerY;!l.moved&&Math.abs(o)+Math.abs(i)<4||(l.moved=!0,j.classList.add("mtflpp-dragging"),n&&t.classList.add("mtflpp-edge-active"),x.documentElement.style.setProperty("--mtflpp-drag-cursor",n?b.getComputedStyle(t).cursor:"grabbing"),x.documentElement.classList.add("mtflpp-window-dragging"),n?ne.resize(l,a(),o,i):ne.move(l,o,i,r),c||(c=b.requestAnimationFrame(u)))});for(const e of["pointerup","pointercancel","lostpointercapture"])t.addEventListener(e,f);b.addEventListener("blur",f),i||o||t.addEventListener("keydown",t=>{const o={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[t.key];if(!o||t.altKey||t.ctrlKey||t.metaKey||s())return;t.preventDefault(),Z.closeMenu();const i=d(),l=t.shiftKey?40:10;n?ne.resize(i,a(),o[0]*l,o[1]*l):ne.move(i,o[0]*l,o[1]*l,r),Ee(),xe(),Ce();const c=oe();z.textContent=n?`${e.resize}: ${Math.round(c.width)} × ${Math.round(c.height)}`:e.moved})}ue(a),F.addEventListener("dblclick",e=>{U||e.target.closest("button, a")||Se()}),x.addEventListener("fullscreenchange",Ce),R.addEventListener("keydown",e=>{"Escape"===e.key&&R.classList.add("mtflpp-help-dismissed")}),R.addEventListener("blur",()=>R.classList.remove("mtflpp-help-dismissed")),Le(H),Le(F),d||Le(O),Le(R,!0);for(const e of A)Le(e,!0,e.dataset.resizeEdge);function Ve(){j.hidden=!Q,T.hidden=!d&&(Q||!C()),O.setAttribute("aria-expanded",String(Q))}function Te(e=!0){Q?Z.focus("actions"):(be(!0),p(),Q&&e&&Z.focus("actions"))}return b.addEventListener("resize",Ee),b.addEventListener("scroll",Ee,{passive:!0}),u?.fallbackMedia.addEventListener("change",()=>{Ee(),Ve()}),O.addEventListener("click",e=>{if(de&&0!==e.detail)return de=!1,void e.preventDefault();de=!1,Te(0===e.detail)}),Z=function(e,n,a){const s=e.querySelector(".mtflpp-controls"),c=e.querySelector(".mtflpp-refresh-control"),d=e.querySelector(".mtflpp-move-control"),u=e.querySelector(".mtflpp-device-controls"),f=e.querySelector(".mtflpp-fit-control"),p=e.querySelector(".mtflpp-pip-control"),m=e.querySelector(".mtflpp-empty"),h=e.querySelector(".mtflpp-feedback");let g,w=(0,o.createRoot)(s),v=!1,y=!1,b=!1;const x=i.InlineNotices?(0,t.dispatch)(i.store):null,M=e.ownerDocument.defaultView?.wp?.theme?.ThemeProvider,E="meet-the-frontend-live-preview-panel",P="preview-feedback";let k="";function C(){const e=g.notice,t=/[.!?…。!?]$/.test(e.heading)?e.heading:`${e.heading}.`;return{message:e.description?`${t} ${e.description}`:e.heading,status:e.status,isDismissible:e.dismissible,actions:[...e.retry?[{label:e.action,disabled:e.disabled,onClick:a.retry}]:[],...e.close?[{label:n.close,onClick:a.close}]:[]]}}function S(){x&&k&&x.removeNotice(P,E),k=""}function L(e){return()=>{j(),e()}}function V(){const{inPage:t,inPip:s,mode:w,modeLabel:P,movable:k,busy:S,canRefresh:V,hasPreview:O,canPip:H}=g;return(0,o.createElement)(r.SlotFillProvider,null,(0,o.createPortal)(k&&t&&(0,o.createElement)(r.Button,{className:"mtflpp-icon mtflpp-move",size:"compact",icon:l.move,label:n.move,showTooltip:!0,tooltipPosition:"bottom","data-action":"move"}),d),(0,o.createPortal)((0,o.createElement)(r.Button,{className:"mtflpp-icon",size:"compact",icon:S?(0,o.createElement)(r.Spinner):l.refresh,label:n.refresh,showTooltip:!0,accessibleWhenDisabled:!0,disabled:!V,onClick:a.refresh,"data-action":"refresh"}),c),(0,o.createPortal)(H&&O&&(0,o.createElement)("div",{className:"mtflpp-pip-surface"},(0,o.createElement)(r.Button,{className:"mtflpp-pip-button",icon:l.pip,label:n.popOutHelp,"aria-label":n.popOut,description:n.popOutHelp,showTooltip:!0,onClick:a.popOut,"data-action":"pop-out"})),p),function(){const{canPip:e,canFullscreen:t,inPage:i,inPip:s,dock:c,canRememberVisibility:d,rememberVisibility:u,rememberPosition:f,followChanges:p}=g;return(0,o.createElement)(r.DropdownMenu,{className:"mtflpp-actions",label:n.actions,icon:l.more,open:v,onToggle(e){v=e,e&&(y=!1),T()},toggleProps:{className:"mtflpp-icon",size:"compact","data-action":"actions"},popoverProps:{placement:"bottom-end",offset:6,shift:!0,className:"mtflpp-menu-popover"}},()=>(0,o.createElement)(o.Fragment,null,(e||t)&&(0,o.createElement)(r.MenuGroup,{label:n.display},e&&(0,o.createElement)(r.MenuItem,{label:n.popOutHelp,description:n.popOutHelp,showTooltip:!0,onClick:L(a.popOut),"data-action":"pip","aria-label":n.popOut},n.popOut),t&&(0,o.createElement)(r.MenuItem,{onClick:L(a.fullscreen),"data-action":"fullscreen"},n.fullscreen)),i&&(0,o.createElement)(r.MenuGroup,{label:n.position},(0,o.createElement)(r.MenuItemsChoice,{value:c,choices:[{value:"left",label:n.bottomLeft},{value:"center",label:n.bottomCenter},{value:"right",label:n.bottomRight}],onSelect(e){j(),a.dock(e)}})),(0,o.createElement)(r.MenuGroup,{label:n.preferences},!1!==d&&(0,o.createElement)(r.MenuItem,{role:"menuitemcheckbox",isSelected:u,icon:u?l.check:void 0,info:n.rememberVisibilityHelp,onClick:L(a.rememberVisibility),"data-action":"remember-visibility"},n.rememberVisibility),(0,o.createElement)(r.MenuItem,{role:"menuitemcheckbox",isSelected:f,icon:f?l.check:void 0,info:n.rememberPositionHelp,onClick:L(a.rememberPosition),"data-action":"remember-position"},n.rememberPosition),(0,o.createElement)(r.MenuItem,{role:"menuitemcheckbox",isSelected:p,icon:p?l.check:void 0,info:n.followHelp,onClick:L(a.follow),"data-action":"follow"},n.follow)),i&&(0,o.createElement)(r.MenuGroup,null,(0,o.createElement)(r.MenuItem,{info:n.resetHelp,onClick:L(a.reset),"data-action":"reset"},n.reset)),s&&(0,o.createElement)(r.MenuGroup,null,(0,o.createElement)(r.MenuItem,{onClick:L(a.close),"data-action":"close"},n.closeLivePreview))))}(),!s&&(0,o.createElement)(r.Button,{className:"mtflpp-icon mtflpp-mode",size:"compact",icon:l[w],label:P,showTooltip:!0,onClick:a.mode,"data-action":"mode"}),!s&&(0,o.createElement)(r.Button,{className:"mtflpp-icon",size:"compact",icon:l.close,label:n.close,showTooltip:!0,onClick:a.close,"data-action":"close"}),(0,o.createPortal)(function(){const{device:e,orientation:t}=g;return(0,o.createElement)(r.Toolbar,{className:"mtflpp-devices",label:n.viewport,variant:"unstyled"},...["desktop","tablet","mobile"].map(i=>{const s=e===i,c=s&&"desktop"!==i,d=c&&"landscape"===t,u="portrait"===t?n.rotateLandscape:n.rotatePortrait;return(0,o.createElement)(r.ToolbarButton,{key:i,icon:l[i],className:d?"mtflpp-device-rotated":void 0,label:c?`${n[i]} — ${u}`:n[i],isPressed:s,"data-viewport":i,onClick:()=>a.device(i)})}))}(),u),(0,o.createPortal)(function(){const{fit:e,customZoom:t=100,dpr:i=1}=g,s={automatic:n.automatic,window:n.fitToWindow,width:n.fitToWidth},c={automatic:n.automaticHelp,window:n.fitToWindowHelp,width:n.fitToWidthHelp},d="custom"===e?n.fixedZoom:s[e]??n.automatic;return(0,o.createElement)(r.Dropdown,{open:y,onToggle(e){y=e,e&&(v=!1,b="custom"===g.fit),T()},contentClassName:"mtflpp-zoom-popover",focusOnMount:"firstElement",popoverProps:{placement:"top-end",offset:8,shift:!0,resize:!1,role:"dialog","aria-label":n.fitting},renderToggle:({isOpen:e,onToggle:t})=>(0,o.createElement)(r.Button,{className:"mtflpp-zoom-toggle",variant:"secondary",size:"compact",label:d,showTooltip:!0,"aria-label":`${n.fitting}: ${d}`,"aria-haspopup":"dialog","aria-expanded":e,onClick:t,"data-action":"zoom"},(0,o.createElement)("span",{className:"mtflpp-zoom-value"},d),l.chevron),renderContent:()=>(0,o.createElement)("div",{className:"mtflpp-zoom-content"},(0,o.createElement)(r.RadioControl,{label:n.zoomMode,selected:e,options:[...Object.entries(s).map(([e,t])=>({value:e,label:t,description:c[e]})),{value:"custom",label:n.fixedZoom,description:n.fixedZoomHelp}],onFocus(e){if(!b)return;b=!1;const t=e.currentTarget.closest(".mtflpp-zoom-content")?.querySelector('.mtflpp-custom-zoom input[type="number"]');t?.focus({preventScroll:!0});const n=t?.closest(".components-popover__content");if(n){const e=t.getBoundingClientRect(),o=n.getBoundingClientRect();n.scrollTop+=Math.min(0,e.top-o.top)+Math.max(0,e.bottom-o.bottom)}},onChange(e){b=!1,"custom"!==e?a.fit(e):a.zoom(t)}}),"custom"===e&&(0,o.createElement)("div",{className:"mtflpp-custom-zoom",onKeyDown(e){if("Enter"!==e.key)return;e.preventDefault();const t=Number(e.target.value);!1!==e.target.validity?.valid&&Number.isInteger(t)&&t>=10&&t<=400&&j()}},(0,o.createElement)(r.RangeControl,{label:n.customZoom,min:10,max:400,step:1,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:t,help:n.customZoomHelp,withInputField:!0,onChange(e){Number.isInteger(e)&&e>=10&&e<=400&&a.zoom(e)}})),(0,o.createElement)("div",{className:"mtflpp-dpr-note",role:"group","aria-label":n.displayInformation},(0,o.createElement)("span",{className:"mtflpp-dpr-value"},`${n.displayDpr}: ${Number(i.toFixed(2))}`),(0,o.createElement)("span",{className:"mtflpp-pixel-note"},n.pixelZoomHelp)))})}(),f),(0,o.createPortal)(function(){const{empty:e}=g;return e?(0,o.createElement)(r.Placeholder,{className:"mtflpp-placeholder","data-empty-icon":e.busy?void 0:e.icon,icon:e.busy?(0,o.createElement)(r.Spinner):l[e.icon],label:(0,o.createElement)("h3",{className:"mtflpp-empty-title",tabIndex:-1,"data-action":"empty-title"},e.heading),instructions:e.description},e.retry&&(0,o.createElement)(r.Button,{key:"retry",variant:"primary",disabled:e.disabled,onClick:a.retry,"data-action":"retry"},e.action),e.close&&(0,o.createElement)(r.Button,{key:"close",variant:"secondary",onClick:a.close,"data-action":"close"},n.close),e.note&&(0,o.createElement)("p",{className:"mtflpp-empty-note"},e.note)):null}(),m),(0,o.createPortal)(function(){if(!g.notice)return null;if(x){const e=(0,o.createElement)(i.InlineNotices,{context:E,className:"mtflpp-inline-notices"});return M?(0,o.createElement)(M,{cornerRadius:"none"},e):e}const{message:e,...t}=C();return(0,o.createElement)(r.Notice,{...t,onRemove:a.dismissNotice,spokenMessage:"",politeness:"polite"},e)}(),h),t?(0,o.createPortal)((0,o.createElement)(r.Popover.Slot),e.ownerDocument.body):(0,o.createElement)(r.Popover.Slot))}function T(){g&&w&&(function(){if(!x)return;if(!g.notice)return void S();const e=JSON.stringify(g.notice);if(k===e)return;const{message:t,status:n,...o}=C();x.createNotice(n,t,{...o,id:P,context:E,speak:!1,onDismiss:a.dismissNotice}),k=e}(),(0,o.flushSync)(()=>w.render((0,o.createElement)(V))))}function j(){(v||y)&&(v=!1,y=!1,T())}function O(t){g?.inPip&&"mode"===t&&(t="actions"),e.querySelector(`[data-action="${t}"]`)?.focus({preventScroll:!0})}return{update(t){const n=y&&!t.hasPreview&&e.ownerDocument.activeElement?.closest(".mtflpp-zoom-popover");t.hasPreview||(y=!1),g=t,T(),n&&O("empty-title")},closeMenu:j,focus:O,beforeMove(){v=!1,y=!1,w?.unmount(),w=null,S()},remount(){w=(0,o.createRoot)(s),T()}}}(j,e,{refresh:()=>{ce.canRefresh&&h()},retry:()=>{"handover"!==ce.state&&(ae||ce.canRetry&&["error","conflict"].includes(ce.state))&&g(ae)},dismissNotice:()=>{ve(),z.textContent=ce.text,Z.focus("actions")},mode:Se,close:function(){Z.closeMenu(),be(!1),m(),d||C()?O.focus():u.focus()},popOut:async function(){if(U||x.fullscreenElement===j||!ke())return;let t;Z.closeMenu();const n=()=>{U===t&&(w(),J.beforeMove(),Z.beforeMove(),x.body.append(j),j.classList.remove("mtflpp-pip"),U=null,Z.remount(),Ee(),J.afterMove(),Ce(),v(),Q&&Z.focus("mode"))};try{if(t=await b.documentPictureInPicture.requestWindow({width:640,height:440}),!Q)return void t.close();const e=b.getComputedStyle(j);t.document.documentElement.lang=x.documentElement.lang,t.document.documentElement.dir=e.direction;for(const n of["--wp-admin-theme-color","--wp-admin-theme-color-darker-10","--wp-admin-border-width-focus"]){const o=e.getPropertyValue(n);o&&t.document.documentElement.style.setProperty(n,o)}const o=x.querySelectorAll(['link[rel="stylesheet"][href*="/load-styles.php"]',"#wp-theme-css","#wp-theme-inline-css","#wp-components-css","#wp-components-inline-css","style[data-emotion]","style[data-wp-hash]","#meet-the-frontend-live-preview-panel-css","#meet-the-frontend-live-preview-panel-inline-css"].join(", "));for(const e of o){const n=e.cloneNode(!0);"STYLE"===e.tagName&&e.sheet&&(n.textContent=Array.from(e.sheet.cssRules,e=>e.cssText).join("\n")),n.addEventListener("load",J.layout,{once:!0}),t.document.head.append(n)}t.document.title=N.textContent,t.document.body.className="mtflpp-pip-document",t.addEventListener("resize",J.layout),t.addEventListener("pagehide",n,{once:!0}),U=t,w(),J.beforeMove(),Z.beforeMove(),j.classList.add("mtflpp-pip"),t.document.body.append(j),Z.remount(),J.afterMove(),Ce(),ve(),Z.focus("mode"),v()}catch{t&&(n(),t.close()),Z.focus("actions"),we(e.pipFailed)}},fullscreen:async function(){if(!U&&x.fullscreenEnabled){Z.closeMenu();try{await j.requestFullscreen(),ve(),Z.focus("mode")}catch{Z.focus("actions"),we(e.fullscreenFailed)}}},dock:e=>Pe(e),reset:()=>Pe("right",!0),follow:function(){V=!V,P.set(M,"scrollToChanges",V),Ce(),V&&ce.canRefresh&&h(!1)},rememberVisibility:function(){S=!S,P.set(M,"rememberVisibility",S),S&&be(Q),Ce()},rememberPosition:function(){L=!L,P.set(M,"rememberPosition",L),L?xe():(P.set(M,"position",te),P.set(M,"layout",void 0)),Ce()},device(e){const t=J.device;if(e===t&&"desktop"===e)return;let n=!1;if(Q&&V&&y){const{fit:e,customZoom:t,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:a}=J;n=!!y({canvas:_,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:a,canFollow:()=>J.fit===e&&J.customZoom===t})}const o={animate:Q&&!n,keepPan:n};e===t?(J.rotate(o),P.set(M,`${e}Orientation`,J.orientation)):(J.select(e,o),J.device!==t&&P.set(M,"viewport",J.device)),Ce()},fit(e){const t=J.fit;J.setFit(e),J.fit!==t&&P.set(M,"fitMode",J.fit),Ce()},zoom(e){const t=J.fit,n=J.customZoom;J.setZoom(e),J.customZoom!==n&&P.set(M,"customZoom",J.customZoom),J.fit!==t&&P.set(M,"fitMode",J.fit),Ce()}}),ye(e.loading,"loading",{canRetry:!1}),Ee(),Ve(),d&&(d.disabled=!1),{stage:D,canvasTarget:J.canvasTarget,get visible(){return Q},get followChanges(){return V},openFromLauncher:Te,setVisible(e){e||(Z.closeMenu(),se="",Ce(),J.layout()),Q=e,Ee(),Ve()},report:ye,setTitle:ue,clearPreview(){D.replaceChildren();const t=["ready","stale","loading"].includes(ce.state);ye(t?e.loading:ce.text,t?"loading":ce.state,{...ce,hasPreview:!1,hasHtmlPreview:!1,redirectDestination:void 0,canRefresh:!1,canRetry:!t&&ce.canRetry})},returnToEditor(){Z.closeMenu(),U?.close(),x.fullscreenElement===j&&x.exitFullscreen().catch(()=>{})}}}function u(e=[]){const t=Array.isArray(e)?[...e]:[],n=new WeakMap;return{capture(e,o){try{if(n.has(e))return;const r=function(e){try{const t=e.querySelector('meta[name="meet-the-frontend-live-preview-panel"]'),n=t?.getAttribute("data-mtflpp-source");if(!n)return null;const o=JSON.parse(n);if("string"!=typeof o)return null;const r=(new DOMParser).parseFromString(o,"text/html");return r.querySelector('meta[name="meet-the-frontend-live-preview-panel"]')?.content===t.content?r:null}catch{return null}}(e);n.set(e,{source:r?h(r,e,t):null,dom:h(e,e,t),values:o&&Object.fromEntries(Object.entries(o).map(([e,t])=>[e,{...t}]))})}catch{}},findChange(e,t){try{const o=n.get(e),r=n.get(t);if(!o||!r)return null;const i=function(e,t){if(!e||!t)return[];const n=[];for(const o of new Set([...Object.keys(e),...Object.keys(t)])){const r=Object.hasOwn(e,o)?e[o]:{type:t[o]?.type,value:""},i=Object.hasOwn(t,o)?t[o]:{type:e[o]?.type,value:""};if(r.type!==i.type||!["text","html"].includes(i.type)||"string"!=typeof r.value||"string"!=typeof i.value||r.value===i.value)continue;let a,s;try{a="html"===r.type?(new DOMParser).parseFromString(r.value,"text/html"):null,s="html"===i.type?(new DOMParser).parseFromString(i.value,"text/html"):null}catch{continue}const l=a?h(a,a,[],a.body):null,c=s?h(s,s,[],s.body):null,d=a?C(l):r.value,u=s?C(c):i.value,f=y(d),p=y(u);if(f!==p&&n.push({...S(f,p),type:"text"}),!a){const e=k(d,u);e&&n.push(e);continue}if(l&&c&&(f===p||b(d,u)))for(const e of v(l,c)){if(e.spacing){const t=P(e);t&&n.push(t);continue}if(f===p)if("attributes"===e.kind){const t=new Map(e.before.attributes),o=new Map(e.after.attributes);for(const e of new Set([...t.keys(),...o.keys()])){const r=t.get(e)??"",i=o.get(e)??"";JSON.stringify(r)!==JSON.stringify(i)&&n.push({type:"attribute",name:e,before:"string"==typeof r?r:JSON.stringify(r),after:"string"==typeof i?i:JSON.stringify(i)})}}else"content"===e.kind&&(y(C(e.before))===y(C(e.after))&&n.push({type:"markup",before:y(C(e.before)),after:y(C(e.after)),oldTag:e.before.tag,newTag:e.after.tag}),(e.before.media||[]).forEach((t,o)=>{const r=e.after.media?.[o];t&&r&&t!==r&&n.push({type:"media",before:t,after:r})}))}}return n}(o.values,r.values),a=function(e,t){if(!e||!t)return!1;const n=(e,t)=>Object.entries(e).some(([e,n])=>"order"!==n?.type&&(!Object.hasOwn(t,e)||n?.type!==t[e]?.type||n?.value!==t[e]?.value));return n(e,t)||n(t,e)}(o.values,r.values),s=!!o.source&&!!r.source,l=!!o.source!=!!r.source,c=[...s?v(o.source,r.source).map(e=>({...e,source:!0})):[],...v(o.dom,r.dom)],d=new Map,u=function(e,t){const n=new Map,o=e=>C(e,n),r=[];for(const n of e){if(n.unresolved)for(const e of f(n,t,o))r.push(e);if("insert"===n.kind&&n.added.length>1){const e=n.added.map(e=>{const r={...n,after:e,added:[e]},i=j(r,t,o);return{...r,input:i}}).filter(e=>e.input);if(e.length){r.push(...e);continue}}const e=j(n,t,o);r.push({...n,input:e})}return r}(c,i).filter(e=>(e.source||!s&&!l||e.input||a&&2===e.priority)&&(e.priority>0||e.input)&&(!e.spacing||function({before:e,after:t},n,o){const r=x(e,n,o),i=x(t,n,o);return r&&i&&r.omitted===i.omitted&&b(r.text,i.text)}(e,d,r.dom?.excluded)));return function(e,t){if(!e.length)return null;const n=e.reduce((e,t)=>Math.max(e,t.input),0),o=e.filter(e=>e.input===n),r=o.reduce((e,t)=>Math.max(e,t.priority),0),i=o.filter(e=>e.priority===r);if(i.some(e=>e.unresolved))return function(e,t){const n=e.find(e=>e.unresolved&&("replacement"===e.regionChange||"reorder"===e.regionChange&&(e.source||t))),o=n?.after.node;if(!o?.isConnected)return null;for(const t of e)if(t.unresolved){if(n.source&&!t.source&&"reorder"===t.regionChange)continue;if(!t.regionChange||t.after.node!==o)return null}else if(!("insert"===t.kind?t.added:[t.after]).every(e=>o.contains(e.node)))return null;return"contents"!==o.ownerDocument.defaultView.getComputedStyle(o).display?o:null}(i,t);const a=i.filter(e=>!e.input||e.directInput||!i.some(t=>t!==e&&e.matches?.length&&e.matches.every(e=>t.matches?.includes(e))&&O(e.after,t.after))),s=new Map,l=a.filter(e=>{const t="delete"===e.kind&&(e.following[0]||e.preceding[0])||e.after,n=t?.node;if(!n)return!0;const o="delete"!==e.kind||e.following.length?e.kind:"delete-last",r=s.get(n)||new Set;return!r.has(o)&&(r.add(o),s.set(n,r),!0)});return n&&s.size>1?null:function(e){const t=new Set,n=new Set;for(const o of e){let e,r=!1;"delete"===o.kind?(r=!o.removed.some(m),e=r?o.after:o.following.find(m)||o.preceding.find(m)||o.following.find(p)||o.preceding.find(p)||o.after):e="insert"===o.kind?o.added.find(m)||o.added.find(p):o.after;const i=p(e);if(!i)continue;const a=m(e),s=a||i;(a&&!r?t:n).add(s)}const o=t.size?t:n;return 1===o.size?o.values().next().value:null}(l)}(u,!s&&(a||function(e,t){return!!e&&!!t&&Object.entries(t).some(([t,n])=>{if("order"!==n?.type||!Object.hasOwn(e,t))return!1;const o=e[t];return"order"===o?.type&&o.members===n.members&&o.value!==n.value})}(o.values,r.values)))}catch{return null}}}}function f(e,t,n){const o=[];for(const r of t){if(!r.after||"spacing"===r.type)continue;const t=T(e.oldRange,r.before,n,r,!0),i=T(e.newRange,r.after,n,r,!1);if(!t.length)continue;const a="markup"===r.type&&r.oldTag===r.newTag;if(a||!r.before||!(t.length<=T(e.newRange,r.before,n,r,!0).length||i.length<=T(e.oldRange,r.after,n,r,!1).length))for(const n of i)a&&!t.some(e=>e.signature!==n.signature)||o.push({...e,unresolved:!1,before:null,after:n,kind:"content",input:r.before&&r.after?2:1,priority:2,matches:[r]})}return o}function p(e){if(e?.node)return e.node;for(const t of e?.children||[]){const e=p(t);if(e)return e}return null}function m(e){const t=e?.node;if(t?.getClientRects().length&&"visible"===t.ownerDocument.defaultView.getComputedStyle(t).visibility)return t;for(const t of e?.children||[]){const e=m(t);if(e)return e}return null}function h(e,t,n,o=e.querySelector('main, [role="main"]')||e.querySelector("article")||e.body){if(!o)return null;const r=n.filter(e=>{if("string"!=typeof e||!e.trim())return!1;try{return o.matches(e),!0}catch{return!1}}).join(", "),i=new Map,a=new Map;if(e!==t)for(const e of t.querySelectorAll("[data-mtflpp-node]")){const t=e.getAttribute("data-mtflpp-node");a.set(t,a.has(t)?null:e)}for(const n of[o,...o.querySelectorAll("*")]){if(r&&n.closest(r))continue;const o=[...n.childNodes].filter(e=>3===e.nodeType).map(e=>e.textContent),s=y(o.join(" ")),l=["img","source","video","audio","iframe"].includes(n.localName)?["src","srcset","poster"].map(e=>n.getAttribute(`data-${e}`)||n.getAttribute(e)||""):[],c=n.style?.backgroundImage||n.getAttribute("data-bg")||"",d=e===t?n:a.get(n.getAttribute("data-mtflpp-node"))||null,u=g(n,d,JSON.stringify([n.localName,s,l,c]));u.text=s,u.rawText=o.join(""),u.media=[...l,c],u.parent=i.get(n.parentElement),i.set(n,u),u.parent?.children.push(u)}for(const[e,t]of i)t.parts=[...e.childNodes].map(e=>3===e.nodeType?e.textContent:i.get(e)).filter(e=>void 0!==e);let s=i.get(o);if(!s)return null;const l=s.node;for(let e=o.parentElement;e;e=e.parentElement){const t=g(e,l,e.localName);t.children=[s],t.parts=[s],s=t}return s.excluded=r,s}function g(e,t,n){const o=function(e){const t=[];for(const{name:n,value:o}of e.attributes){if("data-mtflpp-node"===n||n.startsWith("on")||/(?:^|-)(nonce|token)(?:-|$)/.test(n))continue;if(/^(?:data-)?(?:src|srcset|poster|sizes|bg)$/.test(n))continue;let r=o;"class"===n&&(r=[...e.classList].sort().join(" ")),"style"===n&&(r=[...e.style].sort().map(t=>[t,e.style.getPropertyValue(t),e.style.getPropertyPriority(t)])),("class"!==n&&"style"!==n||r.length)&&t.push([n,r])}return t.sort(([e],[t])=>e.localeCompare(t))}(e);return{node:t,tag:e.localName,signature:n,attributes:o,children:[],parts:[],presentation:JSON.stringify(o.filter(([e])=>!w(e))),references:JSON.stringify(o.filter(([e])=>w(e)))}}function w(e){return["id","for","headers","aria-controls","aria-labelledby","aria-describedby","aria-owns","aria-flowto","aria-activedescendant","aria-details","aria-errormessage"].includes(e)}function v(e,t){const n=new Map,o=new Map,r=new Map,i=new Map,a=[];function s(e){const t=JSON.stringify(e);return n.has(t)||n.set(t,n.size+1),n.get(t)}function l(e){if(!e)return 0;const t=s([e.signature,e.children.map(l)]);return o.set(e,t),r.set(e,s([t,e.presentation,e.children.map(e=>r.get(e))])),i.set(e,s([t,e.presentation,e.references,e.children.map(e=>i.get(e))])),t}l(e),l(t);const c=e=>o.get(e);function d(e){const t=e.attributes.find(([e])=>"id"===e)?.[1];return t?`${e.tag} ${t}`:void 0}function u(e){if(!(e.children.length<2))return s(["collection",e.signature,e.children.map(c).sort((e,t)=>e-t)])}function f(e,t){const n=new Map;return e.forEach((e,o)=>{const r=t(e);void 0!==r&&n.set(r,n.has(r)?-1:o)}),n}return function e(t,n){t&&n&&(t.signature!==n.signature?a.push({kind:"content",before:t,after:n,priority:2}):t.rawText!==n.rawText&&a.push({kind:"content",before:t,after:n,priority:2,spacing:!0}),t.presentation===n.presentation&&t.references===n.references||a.push({kind:"attributes",before:t,after:n,priority:t.presentation!==n.presentation?1:0}),function(t,n,s,l){const p=l.parent&&s.parent&&l.tag===s.tag,m=f(t,c),h=f(n,c);let g,w,v,y;const b=new Set(t.flatMap(e=>[r.get(e),i.get(e)])),x=new Set(n.flatMap(e=>[r.get(e),i.get(e)]));function M(e,t,n){const o=n.get(e),r=n.get(t);return o===r||!x.has(o)&&!b.has(r)}function E(e,t){return o.get(e)===o.get(t)&&M(e,t,r)&&M(e,t,i)}function P(e,r,i,s,c){const d=t.slice(e,r),u=n.slice(i,s),f="replacement"===c&&p&&d.some(e=>!h.has(o.get(e)))&&u.some(e=>!m.has(o.get(e)))&&(!function(e,t){if(e.length<2||t.length<2)return!1;const n=e.filter(e=>e.children.length).length,o=t.filter(e=>e.children.length).length;if(!n&&!o||n>1&&o>1)return!0;const r=new Map;for(const{tag:e}of t)r.set(e,(r.get(e)||0)+1);let i=0;for(const{tag:t}of e){const e=r.get(t);if(e){if(2===++i)return!0;r.set(t,e-1)}}return!1}(d,u)||"form"===l.tag&&function(e,t){function n(e){const t=new Set;return e.every(function e(n){if(["input","select","textarea"].includes(n.tag)){const e=n.attributes.find(([e])=>"name"===e)?.[1],o=n.attributes.find(([e])=>"type"===e)?.[1]?.toLowerCase();return!(!e||"input"===n.tag&&"hidden"===o||(t.add(e),0))}let o=!1;for(const t of n.children)e(t)&&(o=!0);return o})?t:null}const o=n(e),r=n(t);return o&&r&&[...o].some(e=>!r.has(e))&&[...r].some(e=>!o.has(e))}(d,u)),g=p&&("reorder"===c||f)?c:void 0;a.push({kind:"region",after:l,priority:2,unresolved:!0,regionChange:g,oldRange:d,newRange:u})}function k(e,n,o,r,i,a,s){const l=[];for(let c=e;c<n;c++){const e=s(t[c]),n=a.get(e);if(!(i.get(e)!==c||void 0===n||n<o||n>=r)){if(l.length&&n<=l[l.length-1][1])return null;l.push([c,n])}}return l}!function r(i,s,b,x){for(;i<s&&b<x&&E(t[i],n[b]);)e(t[i],n[b]),i++,b++;for(;i<s&&b<x&&E(t[s-1],n[x-1]);)s--,x--,e(t[s],n[x]);if(i===s&&b===x)return;if(i===s||b===x){const e=b===x,r=e?t.slice(i,s):n.slice(b,x),c=e?[n[b-1],n[b]]:[t[i-1],t[i]];return void(r.some(e=>c.some(t=>t&&o.get(t)===o.get(e)))?P(i,s,b,x):e?a.push({kind:"delete",after:l,removed:r,priority:2,following:n.slice(b),preceding:n.slice(0,b).reverse()}):a.push({kind:"insert",after:r[0],added:r,priority:2}))}if(s-i===1&&x-b===1)return void e(t[i],n[b]);if(p&&function(e,r,i,a){const s=r-e;if(s<2||s!==a-i)return!1;const l=new Map;let c=!1;for(let r=0;r<s;r++){const a=o.get(t[e+r]),s=o.get(n[i+r]);c||=a!==s,l.set(a,(l.get(a)||0)+1),l.set(s,(l.get(s)||0)-1)}return c&&[...l.values()].every(e=>0===e)}(i,s,b,x))return void P(i,s,b,x,"reorder");let M=k(i,s,b,x,m,h,c);if(0===M?.length&&(g??=f(t,d),w??=f(n,d),M=k(i,s,b,x,g,w,d)),0===M?.length&&(v??=f(t,u),y??=f(n,u),M=k(i,s,b,x,v,y,u)),M?.length)for(const[o,a]of[...M,[s,x]])r(i,o,b,a),o<s&&e(t[o],n[a]),i=o+1,b=a+1;else P(i,s,b,x,M?"replacement":void 0)}(0,t.length,0,n.length)}(t.children,n.children,t,n))}(e,t),a}function y(e){return e.replace(/\s+/g," ").trim()}function b(e,t){return e!==t&&e.replace(/\s/g,"")===t.replace(/\s/g,"")}function x(e,t,n){for(;e.node?.isConnected&&e.parent?.node;){const{display:t}=e.node.ownerDocument.defaultView.getComputedStyle(e.node);if("inline"!==t&&"contents"!==t)break;e=e.parent}if(!t.has(e)){const{node:o}=e,r=[],i=o?.isConnected&&M(o,n,r)===E(e)&&m(e)?o.innerText:void 0;t.set(e,"string"==typeof i?{text:i,omitted:JSON.stringify(r)}:void 0)}return t.get(e)}function M(e,t,n){return t&&e.querySelector(t)?[...e.childNodes].map(e=>3===e.nodeType?e.textContent:1!==e.nodeType?"":e.matches(t)?(n.push(e.textContent),""):M(e,t,n)).join(""):e.textContent}function E(e){return e.parts.map(e=>"string"==typeof e?e:E(e)).join("")}function P({before:e,after:t}){return k(e.rawText,t.rawText)||k(E(e),E(t))}function k(e,t){if(!/\S/.test(e)||!b(e,t))return;const n=e.match(/\s+|\S+/g),o=t.match(/\s+|\S+/g);let r=0,i=0;for(;r<Math.min(n.length,o.length)&&n[r]===o[r];)r++;for(;i<Math.min(n.length,o.length)-r&&n.at(-1-i)===o.at(-1-i);)i++;const a=Math.max(0,r-1),s=Math.max(0,i-1);return{type:"spacing",before:n.slice(a,n.length-s).join(""),after:o.slice(a,o.length-s).join("")}}function C(e,t=new Map){return e?(t.has(e)||t.set(e,(e.parts||[]).map(e=>{if("string"==typeof e)return e;const n=C(e,t);return/^(?:p|div|section|article|main|aside|header|footer|nav|h[1-6]|li|[ou]l|d[ldt]|blockquote|pre|table|tr|t[dh]|caption|figure|figcaption|br|hr)$/.test(e.tag)?` ${n} `:n}).join("")),t.get(e)):""}function S(e,t){let n=0,o=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;for(;o<e.length-n&&o<t.length-n&&e[e.length-o-1]===t[t.length-o-1];)o++;let r=e.length-o,i=t.length-o;for(;n>0&&/\S/.test(e[n-1]);)n--;if(r>n&&/\S/.test(e[r-1]))for(;r<e.length&&/\S/.test(e[r]);)r++;if(i>n&&/\S/.test(t[i-1]))for(;i<t.length&&/\S/.test(t[i]);)i++;return{before:e.slice(n,r).trim(),after:t.slice(n,i).trim()}}function L(e,t){return t?V(e,t):""===y(e)}function V(e,t){if(!t)return!1;let n=(e=y(e)).indexOf(t);for(;-1!==n;){const o=n+t.length;if(!(n&&/[\p{L}\p{N}_]/u.test(e[n-1])&&/[\p{L}\p{N}_]/u.test(t[0])||o!==e.length&&/[\p{L}\p{N}_]/u.test(e[o])&&/[\p{L}\p{N}_]/u.test(t.at(-1))))return!0;n=e.indexOf(t,n+1)}return!1}function T(e=[],t,n,o,r){return e.flatMap(e=>{const i=T(e.children,t,n,o,r);let a;return a="media"===o.type?e.media?.includes(t):"attribute"===o.type?e.attributes.some(([e,n])=>e===o.name&&V("string"==typeof n?n:JSON.stringify(n),t)):("markup"!==o.type||e.tag===(r?o.oldTag:o.newTag))&&L(n(e),t),"text"===o.type&&i.length?i:[...a?[e]:[],...i]})}function j(e,t,n){if(e.unresolved)return 0;if(e.matches=[],e.spacing){const n=t.filter(e=>"spacing"===e.type),o=n.length&&P(e);return e.matches=n.filter(e=>o?.before===e.before&&o?.after===e.after),e.matches.length?2:0}let o=0;for(const r of t){if("spacing"===r.type)continue;let t=0;if("attributes"===e.kind){if(!["text","attribute"].includes(r.type))continue;const n=r,o=new Map(e.before.attributes),i=new Map(e.after.attributes);for(const e of new Set([...o.keys(),...i.keys()])){if("attribute"===r.type&&e!==r.name)continue;const a=o.get(e),s=i.get(e);if(JSON.stringify(a)===JSON.stringify(s))continue;const l="string"==typeof a?a:JSON.stringify(a)||"",c="string"==typeof s?s:JSON.stringify(s)||"";L(l,n.before)&&L(c,n.after)&&(t="attribute"===r.type||r.before&&r.after?2:1)}}else"insert"===e.kind?!r.before&&e.added.some(e=>V(n(e),r.after))&&(t=Math.max(t,1)):"delete"===e.kind?!r.after&&e.removed.some(e=>V(n(e),r.before))&&(t=Math.max(t,1)):"media"===r.type?(e.before?.media||[]).some((t,n)=>t===r.before&&e.after?.media?.[n]===r.after)&&(t=2):"attribute"!==r.type&&("markup"!==r.type||e.before?.tag===r.oldTag&&e.after?.tag===r.newTag)&&L(n(e.before),r.before)&&L(n(e.after),r.after)&&(t=r.before&&r.after?2:1,"text"===r.type&&V(e.before?.text||"",r.before)&&V(e.after?.text||"",r.after)&&(e.directInput=!0));t&&e.matches.push(r),o=Math.max(o,t)}return o}function O(e,t){return!!e?.children.some(e=>e===t||e.node&&e.node===t?.node||O(e,t))}const H=new Set(["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","PageDown","PageUp","Home","End"," "]);function R(e,t){let n;for(const o of e?.rects??[]){const e=t(o);if(e.visible)return e;(!n||e.distance<n.distance)&&(n=e)}return n}function A(e){return new Promise(t=>{const n=()=>{e.clearTimeout(o),e.cancelAnimationFrame(r),t()},o=e.setTimeout(n,100);let r=e.requestAnimationFrame(()=>{r=e.requestAnimationFrame(n)})})}function F(e,t=!1){if(!W(e,{visibilityProperty:!0,opacityProperty:!0}))return;const{left:n,right:o,top:r,bottom:i,width:a,height:s}=e.getBoundingClientRect();if(!(t||a&&s))return;const l=e.ownerDocument,{documentElement:c,body:d,defaultView:u}=l,f={left:n,right:a?o:n+1,top:r,bottom:s?i:r+1},p={...f},m={x:f.right-f.left,y:f.bottom-f.top},h="visible"===u.getComputedStyle(c).overflow,g=u.getComputedStyle(e);for(let n=e;n&&n!==c;){const o=n===e?g:u.getComputedStyle(n),{position:r,display:i,overflowX:a,overflowY:s}=o;if(n!==e&&(n!==d||!h)&&"inline"!==i&&("visible"!==a||"visible"!==s)&&n.offsetWidth&&n.offsetHeight){const{bounds:e,scaleX:r,scaleY:i}=q(n,o);for(const[l,c,d,u,h]of[["x",a,"left","right",r],["y",s,"top","bottom",i]]){if("visible"===c)continue;const r="clip"===c?[0,0]:B(n,o,l,h),i=t&&"hidden"===c,a="y"===l==("horizontal-tb"===o.writingMode);if(i&&r.some(e=>e)&&(a||f[d]<e[d]||f[u]>e[u]||N(o,g,l)))return{boundary:n};if(!D(f,p,e,d,u,i?[0,0]:r))return{boundary:n};m[l]=Math.min(m[l],p[u]-p[d])}}n="absolute"===r||"fixed"===r?n.offsetParent:n.parentElement}return{clipped:f,extent:m}}function N(e,t,n){const o=e=>e&&"auto"!==e&&0!==parseFloat(e);return("x"===n?["Left","Right"]:["Top","Bottom"]).some(n=>o(e[`scrollPadding${n}`])||o(t[`scrollMargin${n}`]))}function $(e,t,n=!1){const o=F(e,n);if(!o?.clipped)return;const{clipped:r,extent:i}=o,{ownerDocument:a}=e,s=a.documentElement;if(r.left=Math.max(s.clientLeft,r.left),r.right=Math.min(s.clientLeft+s.clientWidth,r.right),r.top=Math.max(0,r.top),r.bottom=Math.min(s.clientHeight,r.bottom),r.right<=r.left)return{rects:[]};const l=t?.({...r,top:0,bottom:s.clientHeight}),c=l?.visibleCenterX??(r.left+r.right)/2,d=X(e,c);if(r.bottom<=r.top)return{rects:[],header:d?.bottom};const u={rects:[r],inViewport:!0,extent:i};if(!d)return u;const f={left:Math.max(r.left,d.left),right:Math.min(r.right,d.right),top:Math.max(r.top,d.top),bottom:Math.min(r.bottom,d.bottom)};if(!_(f)||!d.node.contains(a.elementFromPoint(c,(f.top+f.bottom)/2)))return u;const p=[{...r,top:f.bottom},{...r,bottom:f.top},{...f,left:r.left,right:f.left},{...f,left:f.right,right:r.right}].filter(_);return!p.length&&d.bottom>=s.clientHeight&&d.top<=0?void 0:{rects:p,inViewport:!0,extent:i,header:d.bottom}}function _({left:e,right:t,top:n,bottom:o}){return t>e&&o>n}function D(e,t,n,o,r,[i,a]){return e[o]=Math.max(e[o],n[o]),e[r]=Math.min(e[r],n[r]),t[o]=Math.max(n[o],t[o]+i),t[r]=Math.min(n[r],t[r]+a),t[r]>t[o]}function B(e,t,n,o){const r="x"===n,i=r?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight;if(i<=0)return[0,0];const a=r?e.scrollLeft:e.scrollTop,s=t.display.endsWith("flex")&&t.flexDirection===(r?"row-reverse":"column-reverse"),l=(r&&"rtl"===t.direction)!==s;let c=l?-i:0,d=l?0:i;return("horizontal-tb"!==t.writingMode||a<c||a>d)&&(c=-i,d=i),[(a-d)*o,(a-c)*o]}function q(e,t){const n=e.getBoundingClientRect(),o=n.width/e.offsetWidth,r=n.height/e.offsetHeight,i=n.left+e.clientLeft*o,a=n.top+e.clientTop*r,s={left:i,top:a,right:i+e.clientWidth*o,bottom:a+e.clientHeight*r},l=t.overflowClipMargin;if("clip"!==t.overflowX&&"clip"!==t.overflowY||!l||"0px"===l)return{bounds:s,scaleX:o,scaleY:r};const c=l.split(" ").map(parseFloat).find(Number.isFinite)??0,d=l.includes("border-box")?n:s,u=l.includes("content-box");return{scaleX:o,scaleY:r,bounds:{left:d.left+((u?parseFloat(t.paddingLeft):0)-c)*o,right:d.right-((u?parseFloat(t.paddingRight):0)-c)*o,top:d.top+((u?parseFloat(t.paddingTop):0)-c)*r,bottom:d.bottom-((u?parseFloat(t.paddingBottom):0)-c)*r}}}function W(e,t={visibilityProperty:!0}){return!!e?.isConnected&&!!e.getClientRects().length&&(!e.checkVisibility||e.checkVisibility(t))&&"visible"===e.ownerDocument.defaultView.getComputedStyle(e).visibility}function I(e){return e.matchMedia("(prefers-reduced-motion: reduce)").matches?"instant":"smooth"}function z(e,{behavior:t,header:n=G(e),nearest:o=!1}={}){const r=e.ownerDocument,i=r.defaultView,a=t??I(i);if(o&&!n)return void e.scrollIntoView({behavior:a,block:"nearest",inline:"nearest"});const s=i.getComputedStyle(e).scrollMarginTop,l=r.documentElement,c=l.clientHeight,d=i.getComputedStyle(l),u=J(d.scrollPaddingTop,c),f=J(d.scrollPaddingBottom,c);let p,m;try{let t=o?"nearest":"start";if(o){const e=n-parseFloat(s);null!==u&&e>u&&(p=l.getAttribute("style"),l.style.setProperty("scroll-padding-top",`${e}px`,"important"))}else{const t=n>0&&null!==u?`max(${s}, ${n-u}px)`:s;m=e.getAttribute("style"),e.style.setProperty("scroll-margin-top",`calc(${t} + 1lh)`,"important")}if(!o&&null!==u&&null!==f){const n=i.getComputedStyle(e),o=c-u-f-parseFloat(n.scrollMarginTop)-parseFloat(n.scrollMarginBottom),r=o-e.getBoundingClientRect().height;if(r>=0&&(t="center"),r>0&&"horizontal-tb"===d.writingMode){const e=Math.min(o/3,r);p=l.getAttribute("style"),l.style.setProperty("scroll-padding-bottom",`${f+e}px`,"important")}}e.scrollIntoView({behavior:a,block:t,inline:"nearest"})}finally{void 0!==p&&Z(l,p),void 0!==m&&Z(e,m)}}function Z(e,t){e.setAttribute("style",t??""),null===t&&e.removeAttribute("style")}function J(e,t){if("auto"===e)return 0;const n=parseFloat(e);return Number.isFinite(n)?n*(e.endsWith("%")?t/100:1):null}function G(e){const t=e.getBoundingClientRect();return X(e,t.left+t.width/2)?.bottom??0}function X(e,t){const n=e.ownerDocument;for(let o=n.elementFromPoint(t,1);o&&!o.contains(e);o=o.parentElement){const e=n.defaultView.getComputedStyle(o);if("fixed"!==e.position&&"sticky"!==e.position)continue;if("0"===e.opacity||!W(o,{visibilityProperty:!0,opacityProperty:!0}))continue;const{left:t,right:r,top:i,bottom:a}=o.getBoundingClientRect();if("fixed"===e.position||i<=parseFloat(e.top)+1)return{node:o,left:t,right:r,top:i,bottom:a}}}function Y(e,t,{inlineLauncher:n,nativeLauncher:o}={}){const r=e.strings,i=e.termId??e.postId,a=window,s=function(){let e,t=0,n=0;return{remember(e){try{e&&(t=e.defaultView.scrollY)}catch{}},async restore(e,o,r=()=>!0,i){const a=++n;try{const s=e.defaultView;let l;if(s.scrollTo({top:t,left:0,behavior:"instant"}),o?.ownerDocument===e&&r()){if(await A(s),a!==n||o.ownerDocument!==e||!r())return;if(function(e,t){const n=e.ownerDocument;for(let t=e;t;t=t.parentElement)if("until-found"!==t.getAttribute("hidden")?.toLowerCase()&&(t.hasAttribute("hidden")||"none"===n.defaultView.getComputedStyle(t).display))return!1;let o=!1;for(let r=e;r&&e.isConnected&&e.ownerDocument===n&&t();r=r.parentElement){if("until-found"===r.getAttribute("hidden")?.toLowerCase()){if(r.dispatchEvent(new n.defaultView.Event("beforematch",{bubbles:!0})),!(e.isConnected&&e.ownerDocument===n&&r.isConnected&&r.ownerDocument===n&&r.contains(e)&&t()))break;"until-found"===r.getAttribute("hidden")?.toLowerCase()&&r.removeAttribute("hidden"),o=!0}const i=r.parentElement;i instanceof n.defaultView.HTMLDetailsElement&&!i.open&&r!==Array.from(i.children).find(e=>"summary"===e.localName)&&(i.open=!0,o=!0)}return o}(o,()=>a===n&&r())&&await new Promise(e=>s.setTimeout(e,0)),a!==n||!r())return;const t=o.ownerDocument===e?function(e){if(!e?.isConnected)return null;const t=F(e,!0);if(t?.clipped)return e;if(!t?.boundary)for(const t of e.querySelectorAll("*"))if(F(t,!0)?.clipped)return t;for(let n=t?.boundary||e.parentElement;n;){const e=F(n,!0);if(e?.clipped)return n;n=e?.boundary||n.parentElement}return null}(o):null;t&&(function(e,t){const n=$(e,t,!0);if(!n?.inViewport)return void z(e);const{rects:o,extent:r,header:i=0}=n,a=e.ownerDocument.documentElement,s=Math.min(r.x,a.clientWidth),l=Math.min(r.y,a.clientHeight-i);o.some(e=>e.right-e.left>=s-1&&e.bottom-e.top>=l-1)?t&&R(n,t)?.reveal(I(e.ownerDocument.defaultView)):z(e,{nearest:!0,header:i})}(t,i),o.contains(t)&&(l=t))}return t=s.scrollY,l}catch{}},keepInView(t,{canvas:n,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:a,canFollow:s}){try{const l=e?.target===t&&e.canFollow();if(e?.cancel(),!t.isConnected||!s())return;if(!l){const e=$(t,o);if(!R(e,o)?.visible)return}const c=new AbortController,d={target:t,canFollow:()=>!c.signal.aborted&&s(),cancel(){c.abort(),e===d&&(e=null)}};return e=d,function(e,t,n,o,r){const i=e=>{e.isTrusted&&("keydown"!==e.type||H.has(e.key))&&r()},a={capture:!0,passive:!0,signal:o};for(const n of[e,t])for(const e of["wheel","touchmove","pointerdown","keydown"])n?.addEventListener(e,i,a);t?.addEventListener("scroll",()=>{n?.()&&r()},a)}(t.ownerDocument.defaultView,n,a,c.signal,()=>{d.cancel(),i?.()}),async function(e,t,n,o){try{const r=e.ownerDocument.defaultView;if(await A(r),!o())return;const{scrollX:i,scrollY:a}=r,s=n();if(s&&await s,!o()||r.scrollX!==i||r.scrollY!==a)return;let l=$(e,t);l&&!l.rects.length&&(z(e,{behavior:"instant",header:l.header}),l=$(e,t)),R(l,t)?.reveal()}catch{}}(t,o,r,d.canFollow).finally(d.cancel)}catch{}}}}(),l=d(r,{postTitle:t.title??e.postTitle,publicRedirect:e.publicRedirect,inlineLauncher:n,nativeLauncher:o,onOpen:()=>N(),onClose:()=>O(),onRefresh:_,onRetry:e=>e?N(!0):_(),beforeViewportChange:e=>h.beforeViewportChange(e),beforeMove:j,afterMove:()=>{p&&_()}});let c,f,p=!1,m=0;const h=function(e,t,n,o,r=[]){const i=u(r);let a,s,l,c,d;function f(){d?.()}return{get hasPreview(){return!!a},get hasHtmlPreview(){return!!s},get redirectDestination(){return c},load:function(r,u,p=()=>!1,m){const h=new URL(r);if("https:"!==h.protocol&&"http:"!==h.protocol)throw Object.assign(new Error(n.failed),{code:"mtflpp_preview_unsupported_url"});if(h.origin!==window.location.origin){const e=n.originMismatch.replace("%s",()=>h.origin+h.pathname);throw Object.assign(new Error(e),{code:"mtflpp_preview_origin_mismatch"})}const g=h.searchParams.get("mtflpp_token");if(!g)throw new Error(n.failed);return window.crossOriginIsolated&&h.searchParams.set("mtflpp_isolated","1"),f(),h.searchParams.delete("mtflpp_source"),e.followChanges&&h.searchParams.set("mtflpp_source","1"),o(n.updating),new Promise((r,f)=>{const w=e.stage.ownerDocument.createElement("iframe");w.title=n.title,w.className="mtflpp-frame mtflpp-loading",w.setAttribute("aria-hidden","true"),w.setAttribute("tabindex","-1"),w.referrerPolicy="same-origin";let v=!1,y=!1;const b=setTimeout(()=>M(new Error(n.failed)),3e4),x=()=>{y=!0,M()};function M(e){v||(v=!0,e&&(y=!0),clearTimeout(b),d===x&&(d=null),w!==a&&(w.onload=null,w.onerror=null,w.remove()),e?f(e):r())}d=x,w.onload=async()=>{const r=w!==a;if(r||(s=null,l=null),y||!u())return void M();let d,f,v;try{const e=w.contentDocument,t=e?.querySelector('meta[name="meet-the-frontend-live-preview-panel"]');t?.content===g?d=e:r&&!t&&(f=function(e,t){if("text/html"!==e?.contentType)return;const n=e.defaultView?.performance.getEntriesByType("navigation")[0];if(!(n?.redirectCount>0))return;const o=new URL(n.name);return o.origin!==t.origin||o.pathname===t.pathname&&o.search===t.search?void 0:o.pathname}(e,h))}catch{}d&&(e.followChanges&&i.capture(d,r?m:void 0),d.documentElement.style.setProperty("overscroll-behavior","contain","important")),d&&r&&(t.remember(s),e.followChanges&&p()&&s&&(v=i.findChange(s,d))),r&&a&&(a.onload=null,a.onerror=null,a.remove()),a=w,s=d,l=null,c=f,w.classList.remove("mtflpp-loading"),w.removeAttribute("aria-hidden"),w.removeAttribute("tabindex");const b=()=>!y&&u()&&w===a&&d===s&&(!d||w.contentDocument===d);let x;if(d&&r){const n=e.canvasTarget&&(t=>e.canvasTarget(w,t,{fitTarget:!0}));x=await t.restore(d,v,()=>b()&&e.followChanges&&p(),n)}b()?(l=x,o(n.current,"ready"),M()):M()},w.onerror=()=>{w===a?(s=null,l=null,c=void 0,u()&&o(n.failed,"error")):M(new Error(n.failed))},w.src=h.href,e.stage.append(w)})},cancel:f,beforeViewportChange({canvasTarget:n,canFollow:o,...r}){const i=l,c=s,d=a;if(i&&c)return t.keepInView(i,{...r,canvasTarget:e=>n(d,e),canFollow:()=>i===l&&c===s&&d.contentDocument===c&&e.visible&&e.followChanges&&o()})},clear(){f(),t.remember(s),a&&(a.onload=null,a.onerror=null),a=null,s=null,l=null,c=void 0,e.clearPreview()}}}(l,s,r,k,e.comparisonExcludedSelectors);let g,w,v,y,b,x,M,E,P=!1;try{a.BroadcastChannel&&(E=new a.BroadcastChannel(`meet-the-frontend-live-preview-panel:${e.endpoint}:${i}:${e.userId}`),E.onmessage=e=>{"takeover"===e.data?.type&&p&&(O(!0),k(r.handedOff,"conflict",{reason:"handed-off"}))},a.addEventListener("pagehide",e=>{e.persisted||E.close()}))}catch{E?.close(),E=null}function k(e,n="loading",{canRetry:o=!0,reason:r=""}={}){"ready"===n&&(P=!1),l.report(e,n,{canTakeOver:!!E,hasPreview:h.hasPreview,canRetry:o,reason:r,hasHtmlPreview:h.hasHtmlPreview,redirectDestination:h.redirectDestination,canRefresh:p&&!t.saving&&["ready","error"].includes(n)&&("error"!==n||o)})}function C(e){const t=e?.code,n=function(e){const t=e?.code;return"mtflpp_post_locked"===t?"post-locked":["mtflpp_invalid_nonce","rest_cookie_invalid_nonce","mtflpp_preview_conflict","mtflpp_source_changed","mtflpp_acf_unavailable","mtflpp_integration_failed"].includes(t)?"reload":["mtflpp_cannot_preview","rest_forbidden","rest_cannot_edit"].includes(t)?"permission":"mtflpp_preview_origin_mismatch"===t?"origin-mismatch":"mtflpp_preview_unsupported_url"===t?"unsupported-url":""}(e);n&&(p=!1,S(),h.cancel(),b?.()),k("string"==typeof t?e.message:r.failed,"post-locked"===n?"paused":"error",{reason:n,canRetry:!n})}function S(){clearTimeout(c),f=void 0}function L(e){if(void 0===e&&void 0===f)return;const t=performance.now();void 0!==e&&(f=t+e),clearTimeout(c);const n=Math.ceil(f-t);n>0?c=setTimeout(T,n):T()}function V(){p&&(m+=1,P=!0,h.cancel(),t.saving||k(r.stale,"stale"),t.saving||t.previewing?S():L(275))}function T(){if(!p||g||!1===t.ready||t.previewing||t.saving)return;S();const n=m;k(r.updating),g=(async()=>{try{if(await t.idle,!p||!1===t.ready||t.saving)return;const o=e.base;let i,a;v=t.preparePreview();try{i=await v}catch(e){a=e}finally{v=null}if(await t.idle,!p||!1===t.ready||t.saving||o!==e.base)return;if(a)throw a;if("string"!=typeof i.url)throw Object.assign(new Error(i.message||r.failed),{code:i.code});p&&n===m&&await function(e,t,n){return h.load(e,()=>p&&t===m,()=>l.followChanges&&P,n)}(i.url,n,i.comparisonValues)}catch(e){p&&!t.saving&&C(e)}finally{g=null,L()}})()}function j(){m+=1,h.clear()}function O(e=!1){l.setVisible(e),p=!1,S(),j(),clearTimeout(M),M=null,x?.abort(),l.returnToEditor(),b?.()}async function N(n=!1){if(l.setVisible(!0),p)return;if(w)return void C(w);if(y){if(x&&!x.signal.aborted)return;const e=m;try{await y}catch{}return void(l.visible&&e===m&&N(n))}if(!1===t.ready)return void k(t.notReady,t.notReadyState??"paused",{canRetry:!1});if(!e.available)return void k(r.unavailable,"error",{canRetry:!1,reason:"unavailable"});if(!a.isSecureContext||!navigator.locks)return void k(r.browser,"error",{canRetry:!1,reason:"browser"});const o=n&&E?new AbortController:null;let s=!1;x=o,o?(k(r.waiting,"handover"),M=setTimeout(()=>{s=!0,o.abort()},15e3)):k(t.saving?r.saving:r.updating);try{const n=o?{signal:o.signal}:{ifAvailable:!0};if(y=navigator.locks.request(`meet-the-frontend-live-preview-panel:${e.endpoint}:${i}`,n,async e=>{if(clearTimeout(M),M=null,x=null,l.visible&&!o?.signal.aborted)if(e){k(t.saving?r.saving:r.updating);try{await new Promise(e=>{b=e,p=!0,m+=1,T()}),await g}finally{b=null}}else k(E?r.conflict:r.closeOther,"conflict",{reason:E?"other-tab":"manual"})}),o)try{E.postMessage({type:"takeover"})}catch(e){throw o.abort(),p&&O(!0),await y.catch(()=>{}),e}await y,l.visible&&s&&k(r.takeoverTimeout,"conflict",{reason:"busy"})}catch(e){p=!1,l.visible&&s?k(r.takeoverTimeout,"conflict",{reason:"busy"}):l.visible&&"AbortError"!==e.name&&C(e)}finally{clearTimeout(M),M=null,x=null,y=null}}function _(e=!0){t.saving||(e||(P=!1),p?(m+=1,h.cancel(),L(0)):N())}return{changed:V,pause:function(e=r.saving,t="loading"){return m+=1,S(),h.cancel(),(p||l.visible&&"paused"===t)&&k(e,t,{canRetry:!1}),v},resume:function(e){w=e,e?l.visible&&C(e):!l.visible||p||y?V():N()},setTitle:l.setTitle,openFromLauncher:l.openFromLauncher,start:()=>{l.visible&&N()},get pending(){return g}}}function U(e,t,n,o){const r=window.acf;r.addAction("wysiwyg_tinymce_init",n);for(const e of["append","remove","sortstop","change_field"])r.addAction(e,t);const i=t=>{t[0]===e&&o?.()};function a(e){return!!e?.closest?.(".acf-field")}return r.addAction("validation_failure",i),window.jQuery(e).on("input.mtflppAcf change.mtflppAcf sortupdate.mtflppAcf",e=>{e.originalEvent&&"sortupdate"!==e.type||!a(e.target)||t()}),{isField:a,isValidating:()=>!!e.classList?.contains("is-validating"),hasStructuralPaginationChanges:()=>!!e.querySelector('.acf-repeater[data-pagination="1"] .acf-row:is(.acf-added, .acf-inserted, .acf-reordered, .acf-deleted)'),accepts:e=>"_acf_nonce"===e||e.startsWith("acf[")||e.startsWith("_acf_fields["),destroy(){r.removeAction("wysiwyg_tinymce_init",n);for(const e of["append","remove","sortstop","change_field"])r.removeAction(e,t);r.removeAction("validation_failure",i),window.jQuery(e).off(".mtflppAcf")}}}function Q(){const e=(0,t.select)("core/edit-post")?.getActiveMetaBoxLocations?.()??["normal","side","advanced"];return[document.querySelector(".metabox-base-form"),...e.map(e=>document.querySelector(`.edit-post-meta-boxes-area.is-${e} .metabox-location-${e}`)||document.querySelector(`#metaboxes .metabox-location-${e}`))].filter(Boolean)}const K="meet-the-frontend-live-preview-panel/acf";function ee(e){if(!e.acfEnabled)return!1;if("function"!=typeof window.acf?.addAction||"function"!=typeof window.acf?.removeAction||"function"!=typeof window.jQuery)throw Object.assign(new Error(e.strings.acfUnavailable),{code:"mtflpp_integration_failed"});return!0}(0,e.addAction)("mtflpp.blockEditor.previewSetup",K,({config:e,changed:n,hooks:o,onDestroy:r})=>{if(!ee(e))return;const i=function(e){const n=new Set;let o=!1,r=[],i=new Map;const a=()=>{o||e()};function s(e){e&&!n.has(e)&&(n.add(e),e.on("input change undo redo SetContent",a))}const l=U(document,a,s);function c(e){s(e.editor)}function d(e){l.isField(e.target)&&Q().some(t=>t.contains(e.target))&&a()}window.tinymce?.editors.forEach(s),window.tinymce?.on("AddEditor",c),document.addEventListener("input",d),document.addEventListener("change",d,!0);const u=new MutationObserver(a);return{get ready(){return r=r.filter(({field:e,rows:t})=>e.isConnected&&t.some(t=>e.contains(t))),r.length||u.disconnect(),!r.length},saved(){u.disconnect(),r=Q().flatMap(e=>[...e.querySelectorAll('.acf-repeater[data-pagination="1"]')].map(e=>({field:e,rows:[...e.querySelectorAll(":scope > table > tbody > tr.acf-row:not(.acf-clone)")]})).filter(({rows:e})=>e.length));for(const{field:e}of r)u.observe(e,{childList:!0,subtree:!0});a()},observe(){const e=(0,t.select)("acf/fields");if(!e?.getFieldValue)return;const n=new Map;for(const t of Q())for(const o of window.acf.getFields({parent:window.jQuery(t)})){const t=o.get("key");n.set(t,e.getFieldValue(t))}(n.size!==i.size||[...n].some(([e,t])=>i.get(e)!==t))&&(i=n,a())},capture(){o=!0;const e=new URLSearchParams;try{window.tinymce?.triggerSave();for(const t of Q())for(const[n,o]of new FormData(t))"string"==typeof o&&l.accepts(n)&&e.append(n,o)}finally{o=!1}return e},destroy(){u.disconnect(),l.destroy(),document.removeEventListener("input",d),document.removeEventListener("change",d,!0),window.tinymce?.off("AddEditor",c);for(const e of n)e.off("input change undo redo SetContent",a)}}}(n);r(()=>i.destroy()),o.addAction("observePreviewInputs",K,()=>i.observe()),o.addAction("nativeMetaboxSaveAcknowledged",K,()=>i.saved()),o.addFilter("previewPauseReason",K,t=>t||(i.ready?"":e.strings.acfRefreshing)),o.addFilter("previewFormBody",K,e=>{e??=new URLSearchParams;for(const[t,n]of i.capture())e.append(t,n);return e})}),(0,e.addAction)("mtflpp.classicEditor.previewSetup",K,({config:e,form:t,changed:n,watchEditor:o,cancelNativeSave:r,hooks:i,onDestroy:a})=>{if(!ee(e))return;const s=U(t,n,o,r);a(()=>s.destroy());const l=e=>{s.isField(e.target)&&n()};t.addEventListener("input",l),t.addEventListener("change",l,!0),a(()=>{t.removeEventListener("input",l),t.removeEventListener("change",l,!0)}),i.addFilter("nativeSaveValidationPending",K,e=>e||s.isValidating()),i.addFilter("previewFormBody",K,(e,t)=>{for(const[n,o]of t)"string"==typeof o&&s.accepts(n)&&e.append(n,o);return e}),i.addFilter("nativePreviewHandoffError",K,(t,n)=>t||(n&&s.hasStructuralPaginationChanges()?Object.assign(new Error(e.strings.nativePreviewAcf),{code:"mtflpp_source_changed"}):void 0))});const te=window.meetTheFrontendLivePreviewPanel,ne=document.getElementById("post");if(te&&ne){const t=function(e,t){const n={idle:Promise.resolve(),saving:!1,previewing:!1,deferredSaves:new WeakSet};let o,r,i=!1;function a(){const o=Array.from(window.crypto.getRandomValues(new Uint8Array(16)),e=>e.toString(16).padStart(2,"0")).join(""),i=e.base,a=`mtflpp_preview_${o}`,s=Object.entries({mtflpp_base:i,mtflpp_preview:o}).map(([e,n])=>{const o=document.createElement("input");return Object.assign(o,{type:"hidden",name:e,value:n}),t.append(o),o});let l,c,d=!1;const u=new Promise(e=>{c=e}),f=Date.now()+3e4,p=t=>{d=!0,clearTimeout(l),r=null,n.previewing=!1;for(const e of s)e.remove();document.cookie=`${a}=; Max-Age=0; Path=${e.adminCookiePath}; SameSite=Strict`,c(),n.onPreview?.(t,e.base!==i)},m=()=>{if(d)return;clearTimeout(l);const t=document.cookie.split(";").map(e=>e.trim()).find(e=>e.startsWith(`${a}=`)),n=t?.slice(a.length+1);n?.startsWith(`${i}.`)&&/^[a-f0-9]{64}$/.test(n.slice(65))?(e.base=n.slice(65),p()):t||Date.now()>=f?p(Object.assign(new Error(e.strings.nativePreviewFailed),{code:"mtflpp_source_changed"})):l=setTimeout(m,100)};r={done:u,check:m},n.idle=Promise.all([n.idle,u]),l=setTimeout(m,100)}const s=e=>{const t=e.target.closest("#post-preview");if(!t||t.classList.contains("disabled")||i||!window.crypto?.getRandomValues)return;if(n.previewing)return e.preventDefault(),void e.stopImmediatePropagation();n.previewing=!0;const o=n.beforePreview?.();if(!o)return void a();e.preventDefault(),e.stopImmediatePropagation(),window.open("",t.target||"wp-preview");const r=()=>{a(),i=!0;try{t.click()}finally{i=!1}};o.then(r,r)};t.addEventListener("click",s,!0),window.jQuery(document).on("heartbeat-send.mtflpp",(t,n)=>{r?.check(),n.mtflpp_base=e.base}).on("before-autosave.mtflpp",()=>{const e=new Promise(e=>{o=e});n.idle=Promise.all([e,r?.done]),n.onAutosave?.()}).on("heartbeat-tick.mtflpp heartbeat-error.mtflpp",(t,n)=>{"string"==typeof n?.mtflpp_base&&/^[a-f0-9]{64}$/.test(n.mtflpp_base)&&(e.base=n.mtflpp_base),"string"==typeof n?.rest_nonce&&(e.nonce=n.rest_nonce),o?.(),o=null}),window.jQuery(t).on("input.mtflpp change.mtflpp",e=>{!e.originalEvent&&["post_title","content","excerpt"].includes(e.target.name)&&n.onFieldChange?.(e)});const l=()=>{n.onSaveCancelled?n.onSaveCancelled():n.saving=!1};t.addEventListener("invalid",l,!0);let c=0,d=!1;function u(e){if("click"===e.type){const t=e.target.closest("#publish, #save-post");if(!t||t.disabled||t.classList.contains("disabled"))return}else if("dopreview"===t.querySelector("#wp-preview")?.value)return;const o=++c;setTimeout(()=>{const t=e.defaultPrevented||e.isDefaultPrevented?.();d||o!==c||!t||n.deferredSaves.has(e)||n.isValidating?.()||l()},0)}return t.addEventListener("click",u,!0),t.addEventListener("submit",u,!0),window.jQuery(t).on("submit.mtflpp",e=>{e.originalEvent||u(e)}),n.destroy=()=>{d=!0,n.beforePreview=null,n.onPreview=null,n.onAutosave=null,n.onFieldChange=null,n.onSaveCancelled=null,n.isValidating=null,t.removeEventListener("click",s,!0),t.removeEventListener("invalid",l,!0),t.removeEventListener("click",u,!0),t.removeEventListener("submit",u,!0),window.jQuery(document).off(".mtflpp"),window.jQuery(t).off(".mtflpp")},n}(te,ne);try{!function(t,n,o){const r=document.getElementById("post");if(!t||!r)return;let i,a=!1;const s=new Set;let l=!1;n.title=document.getElementById("title")?.value??t.postTitle,n.preparePreview=async()=>{let e;a=!0;try{window.tinymce?.triggerSave(),e=new FormData(r)}finally{a=!1}const n=new URLSearchParams;for(const[t,o]of e)"string"==typeof o&&["post_title","content","excerpt"].includes(t)&&n.append(t,o);const o=Object.fromEntries([...n].map(([e,t])=>[e,{type:"post_title"===e?"text":"html",value:t}])),s=i.capture(n,e),l=i.comparisonValues(s,o);s.set("base",t.base);const c=await fetch(t.endpoint,{method:"POST",credentials:"same-origin",headers:{"X-WP-Nonce":t.nonce},body:s}),d=await c.json();if(!c.ok)throw Object.assign(new Error(d.message||t.strings.failed),{code:d.code});return{...d,comparisonValues:l}};const c=Y(t,n,{inlineLauncher:o}),d=()=>{if(a||l)return;const e=i?.filter("previewPauseReason","")||i?.error?.message,t=!1===n.ready&&!e;n.ready=!e,n.notReady=e,n.notReadyState="paused",i?.error?c.resume(i.error):e?c.pause(e,"paused"):t?c.resume():c.changed()};function u(e){l||!e||s.has(e)||(s.add(e),e.on("input change undo redo SetContent",d))}function f(e){u(e.editor)}function p(e,t){u(t)}function m(){n.saving&&(n.saving=!1,d())}n.onAutosave=d,n.beforePreview=()=>(c.pause(t.strings.nativePreview),c.pending),n.onPreview=(e,t)=>{e=i.filter("nativePreviewHandoffError",e,t),c.resume(i.error||e)},window.tinymce&&(window.tinymce.editors.forEach(u),window.tinymce.on("AddEditor",f)),window.jQuery?.(document).on("tinymce-editor-init.mtflppClassicEditor",p),n.onSaveCancelled=m,i=function(t,n){const o=(0,e.createHooks)(),r=[];let i,a=!1;function s(e){i??="mtflpp_integration_failed"===e?.code?e:Object.assign(new Error(n.config.strings.integrationFailed),{code:"mtflpp_integration_failed",cause:e})}const l={get error(){return i},filter(e,t,...n){if(a||i)return t;try{const r=o.applyFilters(e,t,...n);if("additionalPreviewValues"===e&&("[object Object]"!==Object.prototype.toString.call(r)||Object.values(r).some(e=>!(null===e||["string","boolean"].includes(typeof e)||"number"==typeof e&&Number.isFinite(e)))))throw new TypeError("Preview values must be a plain object of scalar values.");return r}catch(e){return s(e),t}},action(e,...t){if(!a&&!i)try{o.doAction(e,...t)}catch(e){s(e)}},capture(e,t=null){a&&!i&&s(new Error("This editor session has ended."));const n=null===e?null:new URLSearchParams(e),o=l.filter("previewFormBody",e,t);if(null===o||o instanceof URLSearchParams||s(new TypeError("Preview capture must return URLSearchParams or null.")),i||null===n||null!==o&&![...n.keys()].some(e=>{const t=n.getAll(e),r=o.getAll(e);return r.length!==t.length||t.some((e,t)=>r[t]!==e)})||s(new TypeError("Preview capture must preserve the classic form body.")),i)throw i;return o},comparisonValues(e,t){const o=new Map(Object.entries(t));try{const t=n.form||document,r=new Set;for(const n of t.querySelectorAll("input[name], textarea[name], select[name]")){if(o.has(n.name)||!e?.has(n.name)||"password"===n.type)continue;if("hidden"===n.type){r.add(n.name);continue}const t="textarea"===n.localName||["text","search","email","url","tel"].includes(n.type),i=e.getAll(n.name);let a="value";t&&1===i.length&&(a=n.classList.contains("wp-editor-area")?"html":"text"),o.set(n.name,{type:a,value:1===i.length?i[0]:JSON.stringify(i)})}for(const t of r){if(o.has(t))continue;const n=e.getAll(t);n.length>1&&o.set(t,{type:"order",value:JSON.stringify(n),members:JSON.stringify(n.sort())})}}catch{}return Object.fromEntries(o)},destroy(){if(!a){a=!0;for(const e of r.reverse())try{e()}catch(e){s(e)}r.length=0}}};try{(0,e.doAction)("mtflpp.classicEditor.previewSetup",{...n,hooks:o,onDestroy(e){r.push(e)}})}catch(e){s(e),l.destroy()}return l}(0,{config:t,form:r,changed:d,watchEditor:u,cancelNativeSave:m});const h=n.destroy;function g(e){e.persisted||n.destroy()}function w(e){"post_title"===e.target.name&&c.setTitle(e.target.value),["post_title","content","excerpt"].includes(e.target.name)&&d()}n.destroy=()=>{if(!l){l=!0,i.destroy(),r.removeEventListener("input",w),r.removeEventListener("change",w,!0),r.removeEventListener("click",b,!0),r.removeEventListener("submit",x,!0),window.removeEventListener("pagehide",g),window.tinymce?.off("AddEditor",f),window.jQuery?.(document).off("tinymce-editor-init.mtflppClassicEditor",p);for(const e of s)e.off("input change undo redo SetContent",d);s.clear(),h?.()}},window.addEventListener("pagehide",g),n.isValidating=()=>i.filter("nativeSaveValidationPending",!1),n.onFieldChange=w,r.addEventListener("input",w),r.addEventListener("change",w,!0);let v=!1;function y(e,t){if(e.defaultPrevented)return;if(v)return n.deferredSaves?.add(e),e.preventDefault(),void e.stopImmediatePropagation();if(n.saving)return;n.saving=!0,c.pause();const o=c.pending||(n.previewing?n.idle:null);if(!o)return;n.deferredSaves?.add(e),e.preventDefault(),e.stopImmediatePropagation(),v=!0;const r=()=>{v=!1,!l&&n.saving&&t()};o.then(r,r)}function b(e){const t=e.target.closest("#publish, #save-post");!t||t.disabled||t.classList.contains("disabled")||y(e,()=>t.click())}function x(e){"dopreview"!==r.querySelector("#wp-preview")?.value&&y(e,()=>r.requestSubmit(e.submitter||void 0))}r.addEventListener("click",b,!0),r.addEventListener("submit",x,!0),d(),i.error||c.start()}(te,t,ne.querySelector("#mtflpp-publish-preview button"))}catch(e){t.destroy(),function(e,t){document.getElementById("mtflpp-panel")?.remove(),document.getElementById("mtflpp-toggle")?.remove(),document.getElementById("mtflpp-publish-preview")?.remove(),document.getElementById("mtflpp-term-preview")?.remove();const n=document.createElement("div");n.className="notice notice-error",n.setAttribute("role","alert");const o=document.createElement("p");o.textContent=e,n.append(o),(document.getElementById("wpbody-content")||document.body).prepend(n),console.error("Meet the Frontend – Live Preview Panel could not start.",t)}(te.strings.bootFailed,e)}}})();
     1(()=>{"use strict";const e=window.wp.hooks,t=window.wp.data,n=window.wp.preferences,o=window.wp.element,r=window.wp.components,i=window.wp.notices,a=window.wp.primitives,s=window.ReactJSXRuntime,l={refresh:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M12 5.5L17.7929 11.2929C18.1834 11.6834 18.1834 12.3166 17.7929 12.7071L16 14.5M16 5.5H12V9.5M12 18.5L6.20711 12.7071C5.81658 12.3166 5.81658 11.6834 6.20711 11.2929L8 9.5M8 18.5H12V14.5"})}),more:(0,s.jsxs)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,s.jsx)(a.Path,{d:"M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z",fill:"currentColor",stroke:"none"}),(0,s.jsx)(a.Path,{d:"M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z",fill:"currentColor",stroke:"none"}),(0,s.jsx)(a.Path,{d:"M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z",fill:"currentColor",stroke:"none"}),(0,s.jsx)(a.Path,{d:"M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z"}),(0,s.jsx)(a.Path,{d:"M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z"}),(0,s.jsx)(a.Path,{d:"M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z"})]}),expand:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M4.75 10V4.75H10M4.75 4.75L10 10M14 19.25H19.25V14M19.25 19.25L14 14"})}),compact:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M10 4.75V10H4.75M10 10L4.75 4.75M19.25 14H14V19.25M14 14L19.25 19.25"})}),pip:(0,s.jsxs)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,s.jsx)(a.Path,{d:"M4.75 9.25V16C4.75 16.6904 5.30964 17.25 6 17.25H8M4.75 9.25V6C4.75 5.30964 5.30964 4.75 6 4.75H16C16.6904 4.75 17.25 5.30964 17.25 6V8M4.75 9.25H8"}),(0,s.jsx)(a.Path,{d:"M10.75 11.25C10.75 10.9739 10.9739 10.75 11.25 10.75H18.75C19.0261 10.75 19.25 10.9739 19.25 11.25V18.75C19.25 19.0261 19.0261 19.25 18.75 19.25H11.25C10.9739 19.25 10.75 19.0261 10.75 18.75V11.25Z",fill:"currentColor"})]}),move:(0,s.jsxs)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,s.jsx)(a.Path,{d:"M9.25 5.75H8.75V6.25H9.25V5.75Z",fill:"currentColor",stroke:"none"}),(0,s.jsx)(a.Path,{d:"M9.25 11.75H8.75V12.25H9.25V11.75Z",fill:"currentColor",stroke:"none"}),(0,s.jsx)(a.Path,{d:"M9.25 17.75H8.75V18.25H9.25V17.75Z",fill:"currentColor",stroke:"none"}),(0,s.jsx)(a.Path,{d:"M15.25 5.75H14.75V6.25H15.25V5.75Z",fill:"currentColor",stroke:"none"}),(0,s.jsx)(a.Path,{d:"M15.25 11.75H14.75V12.25H15.25V11.75Z",fill:"currentColor",stroke:"none"}),(0,s.jsx)(a.Path,{d:"M15.25 17.75H14.75V18.25H15.25V17.75Z",fill:"currentColor",stroke:"none"}),(0,s.jsx)(a.Path,{d:"M9.25 5.75H8.75V6.25H9.25V5.75Z"}),(0,s.jsx)(a.Path,{d:"M9.25 11.75H8.75V12.25H9.25V11.75Z"}),(0,s.jsx)(a.Path,{d:"M9.25 17.75H8.75V18.25H9.25V17.75Z"}),(0,s.jsx)(a.Path,{d:"M15.25 5.75H14.75V6.25H15.25V5.75Z"}),(0,s.jsx)(a.Path,{d:"M15.25 11.75H14.75V12.25H15.25V11.75Z"}),(0,s.jsx)(a.Path,{d:"M15.25 17.75H14.75V18.25H15.25V17.75Z"})]}),warning:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M12 8L12 13M12 14.5L12 16M4.75 12C4.75 7.99593 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12Z",strokeLinejoin:"round"})}),info:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M12 16V11M12 9.5V8M19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12C4.75 7.99594 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12Z",strokeLinejoin:"round"})}),close:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M7.75 16.25L16.25 7.75M16.25 16.25L7.75 7.75"})}),check:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M7 12L10 15L17 8"})}),chevron:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M7 11L12 15L17 11"})}),desktop:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M4.75 16.75V17H3.25C3.11193 17 3 17.1119 3 17.25H21C21 17.1119 20.8881 17 20.75 17H19.25V16.75M4.75 16.75V8.5C4.75 7.80964 5.30964 7.25 6 7.25H18C18.6904 7.25 19.25 7.80964 19.25 8.5V16.75M4.75 16.75H19.25"})}),tablet:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M10 16.5H14M18.25 18V6C18.25 5.30964 17.6904 4.75 17 4.75H7C6.30964 4.75 5.75 5.30964 5.75 6L5.75 18C5.75 18.6904 6.30964 19.25 7 19.25H17C17.6904 19.25 18.25 18.6904 18.25 18Z"})}),mobile:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M11 16.5H13M16.25 18V6C16.25 5.30964 15.6904 4.75 15 4.75H9C8.30964 4.75 7.75 5.30964 7.75 6L7.75 18C7.75 18.6904 8.30964 19.25 9 19.25H15C15.6904 19.25 16.25 18.6904 16.25 18Z"})})};function c(e,t,n="right"){const o=e&&!Array.isArray(e)&&e.bounds&&["x","y","width","height"].every(t=>Number.isFinite(e.bounds[t]))&&e.bounds.width>0&&e.bounds.height>0&&[null,"left","center","right"].includes(e.dock)&&"boolean"==typeof e.expanded&&(void 0===e.anchor||["left","center","right"].includes(e.anchor));let r=!!o&&e.expanded;const i={width:480,height:393},a=o?{...e.bounds}:{x:0,y:0,...i};let s=o?e.dock:n,l=s||o&&e.anchor||"right";function c(){return"left"===l?0:"center"===l?.5:1}function d(e,n=t(!s),o=320,r=220){return e.width=Math.min(n.width,Math.max(Math.min(o,n.width),e.width)),e.height=Math.min(n.height,Math.max(Math.min(r,n.height),e.height)),e.x=Math.max(n.left,Math.min(n.right-e.width,e.x)),e.y=Math.max(n.top,Math.min(n.bottom-e.height,e.y)),e}function u(e){if(!s)return e;const n=t();return e.x="left"===s?n.left:"center"===s?n.left+(n.width-e.width)/2:n.right-e.width,e.y=n.bottom-e.height,e}return{area:t,compactRect:function(){return u(d({...a}))},launcherRect:function(e){return u(d({...e,x:a.x+(a.width-e.width)*c(),y:a.y+a.height-e.height},t(!s),1,1))},usableEdge:function(e){return!(s&&(e.includes("s")||"left"===s&&e.includes("w")||"right"===s&&e.includes("e")))},get anchor(){return l},get anchorFactor(){return c()},get dock(){return s},get expanded(){return r},get layout(){return{bounds:{...a},dock:s,anchor:l,expanded:r}},toggleExpanded(){r=!r},dockTo:function(e="right",t=!1){t&&Object.assign(a,i),r=!1,l=s=e},resize(e,n,o,r){Object.assign(a,function(e,n,o,r){const i=t(!s),a=n.includes("e")||n.includes("w"),c=n.includes("n")||n.includes("s"),d=function(e){return"center"===l?.5:e.includes("w")?1:0}(n),u=e.x+e.width*d,f=n.includes("n"),p=e.y+(f?e.height:0),m=function(e,t,n){return 0===n?e.right-t:1===n?t-e.left:2*Math.min(t-e.left,e.right-t)}(i,u,d),h=f?p-i.top:i.bottom-p,g=(n.includes("w")?-o:o)*(.5===d?2:1),v=Math.max(Math.min(320,m),Math.min(m,e.width+g)),w=Math.max(Math.min(220,h),Math.min(h,e.height+(f?-r:r))),y=a&&0!==o&&v!==e.width,b=c&&0!==r&&w!==e.height,x=f?p-w:p;return{x:y?u-v*d:e.preferredBounds.x,y:b?x:e.preferredBounds.y,width:y?v:e.preferredBounds.width,height:b?w:e.preferredBounds.height}}(e,n,o,r))},move:function(e,n,o,r=!1){const i=d({...e,x:e.x+n,y:e.y+o},t(!0),r?1:320,r?1:220);a.x=i.x+(r?(i.width-a.width)*c():0),a.y=i.y+(r?i.height-a.height:0),s=null}}}function d(e,{postTitle:a="",publicRedirect:s,inlineLauncher:d,nativeLauncher:u,canRememberVisibility:f=!0,onOpen:p,onClose:m,onRefresh:h,onRetry:g,beforeMove:v,afterMove:w,beforeViewportChange:y}){const b=window,x=document,M="meet-the-frontend-live-preview-panel",S=(0,t.select)(n.store),E=(0,t.dispatch)(n.store),k="width"===S.get(M,"fit")?"width":"automatic";E.setDefaults(M,{rememberVisibility:!0,rememberPosition:!0,panelOpen:!0,scrollToChanges:!0,viewport:"desktop",fitMode:k,customZoom:100,tabletOrientation:"portrait",mobileOrientation:"portrait"});const P=()=>!d&&(!u||u.fallbackMedia.matches);let C=!1!==S.get(M,"rememberVisibility"),L=!1!==S.get(M,"rememberPosition"),V=!1!==S.get(M,"scrollToChanges");const T=d?.parentElement??x.getElementById("mtflpp-toggle"),O=x.getElementById("mtflpp-panel");if(!T||!O)throw new Error("Preview panel markup is missing.");const j=d||function(e){let t;const{title:n,moveHelp:i}=e.dataset;return(0,o.flushSync)(()=>(0,o.createRoot)(e).render((0,o.createElement)(r.Button,{ref:e=>{t=e},variant:"secondary",label:n,title:n,description:i,"aria-controls":"mtflpp-panel","aria-expanded":!1},(0,o.createElement)("span",{className:"mtflpp-launcher-label"},n)))),t}(T),R=O.querySelector(".mtflpp-move-control"),H=O.querySelector(".mtflpp-resize"),A=O.querySelectorAll("[data-resize-edge]"),$=O.querySelector(".mtflpp-header"),_=O.querySelector(".mtflpp-caption"),N=O.querySelector(".mtflpp-viewport"),F=O.querySelector(".mtflpp-canvas"),B=O.querySelector(".mtflpp-stage"),D=O.querySelector(".mtflpp-empty"),q=O.querySelector(".mtflpp-devicebar"),W=O.querySelector(".mtflpp-dimensions"),z=O.querySelector(".mtflpp-feedback"),I=O.querySelector('[role="status"]');let Z;const J=function(e,t,n,o={},r=()=>{},i={desktop:"Desktop",tablet:"Tablet",mobile:"Phone"}){const a=e.ownerDocument.defaultView,s=e.querySelector(".mtflpp-canvas"),l=e.querySelector(".mtflpp-canvas-space"),c=n.querySelector(".mtflpp-dimensions-text"),d={desktop:[1280,800],tablet:[768,1024],mobile:[390,844]},u=Object.keys(d);let f=u.includes(o.device)?o.device:"desktop";const p=["automatic","window","width","custom"];let m=p.includes(o.fit)?o.fit:"automatic";const h=e=>Number.isInteger(e)&&e>=10&&e<=400;let g,v=h(o.customZoom)?o.customZoom:100,w=100;const y=e=>"desktop"===e?"landscape":"portrait",b=Object.fromEntries(u.map(e=>[e,"desktop"!==e&&["portrait","landscape"].includes(o[`${e}Orientation`])?o[`${e}Orientation`]:y(e)])),x=()=>b[f]===y(f)?d[f]:[...d[f]].reverse(),M=()=>"width"===m;let S,E,k;const P=a.matchMedia("(prefers-reduced-motion: no-preference)");function C(){const t=e.ownerDocument.defaultView.devicePixelRatio;return Number.isFinite(t)&&t>0?t:1}function L(e,t){if("custom"===m)return v/100/C();const n=s.clientWidth/e;if(M())return n;const o=Math.min(n,s.clientHeight/t);return"automatic"===m?Math.min(1/C(),o):o}function V(e,n){S=e;const[o,r]=x(),i=Math.max(0,(s.clientWidth-o*S)/2),a=Math.max(0,(s.clientHeight-r*S)/2);Object.assign(l.style,{width:`${Math.max(s.clientWidth,i+o*S)}px`,height:`${Math.max(s.clientHeight,a+r*S)}px`}),Object.assign(t.style,{left:`${i}px`,top:`${a}px`,transform:`scale(${S})`});const c=o*S>s.clientWidth+.01||r*S>s.clientHeight+.01,d="custom"===m||M();s.tabIndex=d&&c?0:-1,s.scrollLeft="custom"===m?n.x*S:0,s.scrollTop=d?n.y*S:0}function T(){if(!E)return;const e=E;E=null,e.window.cancelAnimationFrame(e.frame),e.resolve?.()}function O(e,t,n,o){return t<=0||o&&e<-1&&t<n?Math.max(e,t-n):e>=n||o&&e>0&&t>n+1?Math.min(e,t-n):0}function j(o=!1,a=!1){T();const[l,d]=x();if(Object.assign(t.style,{width:`${l}px`,height:`${d}px`}),!e.clientWidth||!e.clientHeight)return;const u=C(),p=`${i[f]} (${l} × ${d}) · `,h=Math.max(400,Math.ceil(e.clientWidth/l*u*100)),y=`${p}${"0".repeat(String(h).length)}%`;n.dataset.reserve!==y&&(n.dataset.reserve=y);const b=a?{x:0,y:0}:{x:(s.scrollLeft||0)/(S||1),y:(s.scrollTop||0)/(S||1)};if(s.style.overflowX="hidden",s.style.overflowY="hidden","custom"===m){const e=L(l,d);for(let t=0;t<2;t++)l*e>s.clientWidth+.01&&(s.style.overflowX="scroll"),d*e>s.clientHeight+.01&&(s.style.overflowY="scroll")}else M()&&d*L(l,d)>e.clientHeight&&(s.style.overflowY="scroll");if(!s.clientWidth||!s.clientHeight)return;const k=L(l,d),O=Math.round(k*u*100),j=O!==w||u!==g;w=O,g=u;const R=`${p}${"custom"===m?v:w}%`;c.textContent!==R&&(c.textContent=R),j&&r();const H=S??k;if(!o||!P.matches||H===k)return void V(k,b);const A={window:e.ownerDocument.defaultView,frame:null},$=A.window.performance.now();E=A;const _=e=>{V(e,b),A.scrollLeft=s.scrollLeft,A.scrollTop=s.scrollTop};_(H);const N=e=>{if(E!==A)return;const t=Math.min(1,Math.max(0,(e-$)/200));_(H+(k-H)*(1-(1-t)**3)),t<1?A.frame=A.window.requestAnimationFrame(N):T()};A.frame=A.window.requestAnimationFrame(N)}function R(){j()}function H(){k?.();const t=e.ownerDocument.defaultView.matchMedia(`(resolution: ${C()}dppx)`);t.addEventListener("change",H),k=()=>t.removeEventListener("change",H),R()}let A=new a.ResizeObserver(R);return A.observe(e),P.addEventListener("change",R),a.addEventListener("resize",H),H(),{get device(){return f},get fit(){return m},get customZoom(){return v},get zoomPercent(){return"custom"===m?v:w},get dpr(){return C()},get orientation(){return b[f]},canvasTarget:function(e,t,{fitTarget:n=!1}={}){const o=e.getBoundingClientRect(),r=s.getBoundingClientRect(),i=o.left-r.left-s.clientLeft,a=o.top-r.top-s.clientTop,l=O(i+t.left*S,i+t.right*S,s.clientWidth,n),c=O(a+t.top*S,a+t.bottom*S,s.clientHeight,n),d=Math.max(t.left,-i/S),u=Math.min(t.right,(s.clientWidth-i)/S);return{visible:!l&&!c,visibleCenterX:d<u?(d+u)/2:void 0,distance:Math.hypot(l,c),reveal(e="instant"){(l||c)&&s.scrollBy({left:l,top:c,behavior:e})}}},canvasWasPanned:function(){return!!E&&(s.scrollLeft!==E.scrollLeft||s.scrollTop!==E.scrollTop)},whenSettled:function(){if(!E)return;const e=E;return e.done??=new Promise(t=>{e.resolve=t}),e.done},finishMotion(){E&&R()},select(e,{animate:t=!1,keepPan:n=!1}={}){if(!u.includes(e))return;const o=f!==e;f=e,o?j(t,!n):E||R()},rotate({animate:e=!1,keepPan:t=!1}={}){"desktop"!==f&&(b[f]="portrait"===b[f]?"landscape":"portrait",j(e,!t))},setFit(e){p.includes(e)&&m!==e&&(m=e,j(!1,!0))},setZoom(e){if(!h(e)||"custom"===m&&v===e)return;const t="custom"!==m;v=e,m="custom",j(!1,t)},layout:R,beforeMove(){T(),A.disconnect(),k?.(),e.ownerDocument.defaultView.removeEventListener("resize",H)},afterMove(){A=new e.ownerDocument.defaultView.ResizeObserver(R),A.observe(e),e.ownerDocument.defaultView.addEventListener("resize",H),H()}}}(N,B,W,{device:S.get(M,"viewport"),fit:S.get(M,"fitMode")??k,customZoom:S.get(M,"customZoom"),tabletOrientation:S.get(M,"tabletOrientation"),mobileOrientation:S.get(M,"mobileOrientation")},()=>Ce(),e),G=x.querySelector("#wpbody-content > .wrap"),X=x.getElementById("wpadminbar");function Y(e=!1){const t=Math.max(1,x.documentElement.clientWidth),n=Math.max(1,x.documentElement.clientHeight),o=x.documentElement.getBoundingClientRect().left+b.scrollX,r=!e&&G?.getBoundingClientRect(),i=r?Math.max(0,"rtl"===b.getComputedStyle(G).direction?r.left-o:o+t-r.right):20,a=e?0:i,s=Math.min(a,(t-1)/2),l=Math.min(Math.max(0,X?.getBoundingClientRect().bottom||0)+a,n-1),c=t-s,d=n-Math.min(a,n-l-1);return{left:s,top:l,right:c,bottom:d,width:c-s,height:d-l}}let U,Q=f&&(!C||!1!==S.get(M,"panelOpen")),K=!1;const ee=S.get(M,"layout"),te=S.get(M,"position")??ee?.dock??ee?.anchor;let ne=["left","center","right"].includes(te)?te:"right";const oe=c(L?ee:void 0,Y,ne),{compactRect:re,usableEdge:ie}=oe;let ae,se=!1,le="",ce=!1,de={text:e.loading,state:"loading",hasPreview:!1,canRetry:!1,reason:""},ue=!1;function fe(t){const n="string"==typeof t?t.replace(/\s+/g," ").trim():"";_.textContent=n?`${e.preview} — ${n}`:e.title,_.title=_.textContent,U&&(U.document.title=_.textContent)}function pe(){const{text:t,state:n,hasPreview:o,reason:r}=de;return"handover"===n?{heading:e.switchingPreview,description:t,note:e.tabEdits}:"conflict"===n?{heading:t,description:{"handed-off":e.handedOffHelp,busy:e.takeoverTimeoutHelp,manual:e.closeOtherHelp}[r]||e.conflictHelp,note:"manual"===r?e.manualSwitchHint:e.tabEdits}:"paused"===n?{heading:e.pausedTitle,description:t,note:""}:"error"===n?function(){const{text:t,hasPreview:n,canRetry:o,reason:r}=de;if("origin-mismatch"===r)return{heading:e.originMismatchTitle,description:n?`${t} ${e.previousPreview}`:t,note:""};if("unavailable"===r||"browser"===r)return{heading:"unavailable"===r?e.unavailableTitle:e.browserTitle,description:t,note:""};const i={reload:e.reviewBeforeReload,"reload-before-save":e.nativePreviewAcfReload}[r];if(!n){let n=t;return t===e.failed&&(n=o?e.failedHelp:""),i&&(n+=` ${i}`),{heading:e.failed,description:n,note:""}}return{heading:t===e.failed?e.refreshFailed:t,description:i||e.previousPreview,note:""}}():o?{heading:t,description:"",note:""}:{heading:e.loading,description:e.preparing,note:""}}function me(){return se?"handover"===de.state?e.takingOver:e.takeOver:e.retry}function he(e){return!e||["handover","paused"].includes(de.state)?"info":"error"!==de.state||de.canRetry?"warning":"error"}function ge(){return de.redirectDestination?`${e.redirected} ${de.redirectDestination}`:de.hasHtmlPreview&&ae?`${e.publicRedirected} ${ae}`:""}function ve(){const{state:t,hasPreview:n,canRetry:o,reason:r}=de,i=n&&["error","conflict","handover","paused"].includes(t),a=!n||i||le?"":ge();if(z.hidden=!i&&!le&&!a,z.tabIndex=z.hidden?-1:0,O.dataset.hasFeedback=String(!z.hidden),z.hidden)return null;if(a)return{heading:a,status:"info",dismissible:!1};const{heading:s,description:l}=pe();return{heading:i?s:le,description:i?l:e.windowNoticeHelp,status:he(i),dismissible:!i,retry:i&&(se||o&&["error","conflict"].includes(t)),close:i&&"error"===t&&!o&&!["reload","reload-before-save"].includes(r),disabled:"handover"===t,action:me()}}function we(t){de.hasPreview&&["error","conflict","handover","paused"].includes(de.state)||(le=t,Ce()),I.textContent=`${t} ${e.windowNoticeHelp}`}function ye(){le="",Ce()}function be(e,t="loading",{canTakeOver:n=!1,hasPreview:o=!1,hasHtmlPreview:r=!1,redirectDestination:i,canRefresh:a=!1,canRetry:l=!0,reason:c=""}={}){const d=O.ownerDocument.activeElement,u=O.contains(d),f=!o&&(de.state!==t||de.text!==e||de.reason!==c),p=de.hasPreview!==o;de={text:e,state:t,canTakeOver:n,hasPreview:o,hasHtmlPreview:r,redirectDestination:i,canRefresh:a,canRetry:l,reason:c},["error","conflict","handover","paused"].includes(t)&&(le=""),O.dataset.state=t,O.dataset.hasPreview=String(o),se=n&&["conflict","handover"].includes(t),D.hidden=o,q.hidden=!o;const{heading:m,description:h,note:g}=pe();f&&(D.scrollTop=0);const v="ready"!==t||le?"":ge();I.textContent=o?[m,h,g,v].filter(Boolean).join(" "):m,Ce(),p&&J.layout(),function(e,t){e&&t&&(!O.contains(e)||e.closest("[hidden]")||e.disabled||!de.hasPreview&&F.contains(e))&&Z.focus(D.hidden?"actions":"empty-title")}(d,u),Q&&"ready"===t&&r&&!i&&async function(){if(s&&!ce){ce=!0;try{const e=new URL(s.endpoint);if(e.origin!==b.location.origin)return;const t=await b.fetch(e,{credentials:"same-origin",cache:"no-store",redirect:"error",headers:{"X-WP-Nonce":s.nonce}});if(!t.ok)return;const{destination:n}=await t.json();if("string"!=typeof n||!n)return;if(ae=n,!Q)return;Ce(),"ready"!==de.state||!de.hasHtmlPreview||de.redirectDestination||le||(I.textContent=ge())}catch{}}}()}function xe(e){f&&C&&S.get(M,"panelOpen")!==e&&E.set(M,"panelOpen",e)}function Me(){L&&E.set(M,"layout",oe.layout)}function Se(){const e=T.hidden;T.hidden=!1,T.style.maxWidth=`${Y(!oe.dock).width}px`;const t={width:T.offsetWidth,height:T.offsetHeight};return T.hidden=e,oe.launcherRect(t)}function Ee(){if(U)return;if(!Q&&P()){const e=Se(),t=oe.anchorFactor;Object.assign(T.style,{left:`${e.x+e.width*t}px`,top:`${e.y+e.height}px`,transform:`translate(${-100*t}%, -100%)`})}let e=re();if(O.dataset.anchor=oe.anchor,oe.expanded){const t=Y();e={x:t.left,y:t.top,width:t.width,height:t.height}}Object.assign(O.style,{left:`${e.x}px`,top:`${e.y}px`,width:`${e.width}px`,height:`${e.height}px`,transform:""})}function ke(e="right",t=!1){oe.dockTo(e,t),ne=e,E.set(M,"position",ne),Ee(),Me(),Ce()}function Pe(){return"function"==typeof b.documentPictureInPicture?.requestWindow}function Ce(){if(!Z)return;const t=O.ownerDocument.fullscreenElement===O,n=!U&&!t,o=n&&!oe.expanded;O.classList.toggle("mtflpp-expanded",oe.expanded),H.hidden=!o;for(const e of A)e.hidden=!o||!ie(e.dataset.resizeEdge);const r=se||de.canRetry&&["error","conflict"].includes(de.state);var i;Z.update({inPage:n,inPip:!!U,movable:o,dock:oe.dock,canRememberVisibility:f,rememberVisibility:C,rememberPosition:L,followChanges:V,device:J.device,busy:de.hasPreview&&["stale","loading","handover"].includes(de.state)&&de.text!==e.saving,empty:de.hasPreview?null:{...pe(),busy:["loading","stale","ready","handover"].includes(de.state),icon:["paused","conflict"].includes(de.state)||["unavailable","browser","origin-mismatch"].includes(de.reason)?"info":"warning",retry:r,disabled:"handover"===de.state,close:"error"===de.state&&!r,action:me()},notice:ve(),fit:J.fit,orientation:J.orientation,customZoom:J.customZoom,zoomPercent:J.zoomPercent,dpr:J.dpr,canRefresh:de.canRefresh,hasPreview:de.hasPreview,canPip:n&&Pe(),canFullscreen:n&&!!x.fullscreenEnabled,mode:t||oe.expanded?"compact":"expand",modeLabel:(i=t,i?e.exitFullscreen:oe.expanded?e.compact:e.expand)})}function Le(){Z.closeMenu(),U?U.close():x.fullscreenElement!==O?(oe.toggleExpanded(),Ee(),Me(),Ce(),Z.focus("mode")):x.exitFullscreen().then(ye,()=>we(e.fullscreenFailed))}function Ve(t,n=!1,o){const r=t===j,i=t===$,a=()=>o||("left"===oe.anchor?"ne":"nw"),s=()=>U||!r&&oe.expanded||x.fullscreenElement===O||n&&!ie(a());let l,c;const d=()=>({...r?Se():re(),preferredBounds:oe.layout.bounds});function u(){if(c=null,l)if(n||r)Ee();else{const e=re(),t=e.x-parseFloat(O.style.left),n=e.y-parseFloat(O.style.top);Object.assign(O.style,{width:`${e.width}px`,height:`${e.height}px`,transform:`translate3d(${t}px, ${n}px, 0)`})}}function f(){if(!l)return;const{pointer:e,moved:n}=l;l=null,b.cancelAnimationFrame(c),t.hasPointerCapture(e)&&t.releasePointerCapture(e),O.classList.remove("mtflpp-dragging"),t.classList.remove("mtflpp-edge-active"),x.documentElement.classList.remove("mtflpp-window-dragging"),x.documentElement.style.removeProperty("--mtflpp-drag-cursor"),Ee(),n&&(r&&(ue=!0),Me(),Ce())}t.addEventListener("pointerdown",e=>{0!==e.button||s()||i&&e.target.closest('button, a, [role="button"]')||(r&&(ue=!1),e.preventDefault(),r?j.focus({preventScroll:!0}):t===R&&Z.focus("move"),Z.closeMenu(),l={...d(),pointer:e.pointerId,pointerX:e.clientX,pointerY:e.clientY},t.setPointerCapture(e.pointerId))}),t.addEventListener("pointermove",e=>{if(!l||l.pointer!==e.pointerId)return;const o=e.clientX-l.pointerX,i=e.clientY-l.pointerY;!l.moved&&Math.abs(o)+Math.abs(i)<4||(l.moved=!0,O.classList.add("mtflpp-dragging"),n&&t.classList.add("mtflpp-edge-active"),x.documentElement.style.setProperty("--mtflpp-drag-cursor",n?b.getComputedStyle(t).cursor:"grabbing"),x.documentElement.classList.add("mtflpp-window-dragging"),n?oe.resize(l,a(),o,i):oe.move(l,o,i,r),c||(c=b.requestAnimationFrame(u)))});for(const e of["pointerup","pointercancel","lostpointercapture"])t.addEventListener(e,f);b.addEventListener("blur",f),i||o||t.addEventListener("keydown",t=>{const o={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[t.key];if(!o||t.altKey||t.ctrlKey||t.metaKey||s())return;t.preventDefault(),Z.closeMenu();const i=d(),l=t.shiftKey?40:10;n?oe.resize(i,a(),o[0]*l,o[1]*l):oe.move(i,o[0]*l,o[1]*l,r),Ee(),Me(),Ce();const c=re();I.textContent=n?`${e.resize}: ${Math.round(c.width)} × ${Math.round(c.height)}`:e.moved})}fe(a),$.addEventListener("dblclick",e=>{U||e.target.closest("button, a")||Le()}),x.addEventListener("fullscreenchange",Ce),H.addEventListener("keydown",e=>{"Escape"===e.key&&H.classList.add("mtflpp-help-dismissed")}),H.addEventListener("blur",()=>H.classList.remove("mtflpp-help-dismissed")),Ve(R),Ve($),d||Ve(j),Ve(H,!0);for(const e of A)Ve(e,!0,e.dataset.resizeEdge);function Te(){O.hidden=K||!Q,T.hidden=K||!d&&(Q||!P()),j.setAttribute("aria-expanded",String(!O.hidden))}function Oe(){Z.closeMenu(),U?.close(),x.fullscreenElement===O&&x.exitFullscreen().catch(()=>{})}function je(e=!0){K||(Q?Z.focus("actions"):(xe(!0),p(),Q&&e&&Z.focus("actions")))}return b.addEventListener("resize",Ee),b.addEventListener("scroll",Ee,{passive:!0}),u?.fallbackMedia.addEventListener("change",()=>{Ee(),Te()}),j.addEventListener("click",e=>{if(ue&&0!==e.detail)return ue=!1,void e.preventDefault();ue=!1,je(0===e.detail)}),Z=function(e,n,a){const s=e.querySelector(".mtflpp-controls"),c=e.querySelector(".mtflpp-refresh-control"),d=e.querySelector(".mtflpp-move-control"),u=e.querySelector(".mtflpp-device-controls"),f=e.querySelector(".mtflpp-fit-control"),p=e.querySelector(".mtflpp-pip-control"),m=e.querySelector(".mtflpp-empty"),h=e.querySelector(".mtflpp-feedback");let g,v=(0,o.createRoot)(s),w=!1,y=!1,b=!1;const x=i.InlineNotices?(0,t.dispatch)(i.store):null,M=e.ownerDocument.defaultView?.wp?.theme?.ThemeProvider,S="meet-the-frontend-live-preview-panel",E="preview-feedback";let k="";function P(){const e=g.notice,t=/[.!?…。!?]$/.test(e.heading)?e.heading:`${e.heading}.`;return{message:e.description?`${t} ${e.description}`:e.heading,status:e.status,isDismissible:e.dismissible,actions:[...e.retry?[{label:e.action,disabled:e.disabled,onClick:a.retry}]:[],...e.close?[{label:n.close,onClick:a.close}]:[]]}}function C(){x&&k&&x.removeNotice(E,S),k=""}function L(e){return()=>{O(),e()}}function V(){const{inPage:t,inPip:s,mode:v,modeLabel:E,movable:k,busy:C,canRefresh:V,hasPreview:j,canPip:R}=g;return(0,o.createElement)(r.SlotFillProvider,null,(0,o.createPortal)(k&&t&&(0,o.createElement)(r.Button,{className:"mtflpp-icon mtflpp-move",size:"compact",icon:l.move,label:n.move,showTooltip:!0,tooltipPosition:"bottom","data-action":"move"}),d),(0,o.createPortal)((0,o.createElement)(r.Button,{className:"mtflpp-icon",size:"compact",icon:C?(0,o.createElement)(r.Spinner):l.refresh,label:n.refresh,showTooltip:!0,accessibleWhenDisabled:!0,disabled:!V,onClick:a.refresh,"data-action":"refresh"}),c),(0,o.createPortal)(R&&j&&(0,o.createElement)("div",{className:"mtflpp-pip-surface"},(0,o.createElement)(r.Button,{className:"mtflpp-pip-button",icon:l.pip,label:n.popOutHelp,"aria-label":n.popOut,description:n.popOutHelp,showTooltip:!0,onClick:a.popOut,"data-action":"pop-out"})),p),function(){const{canPip:e,canFullscreen:t,inPage:i,inPip:s,dock:c,canRememberVisibility:d,rememberVisibility:u,rememberPosition:f,followChanges:p}=g;return(0,o.createElement)(r.DropdownMenu,{className:"mtflpp-actions",label:n.actions,icon:l.more,open:w,onToggle(e){w=e,e&&(y=!1),T()},toggleProps:{className:"mtflpp-icon",size:"compact","data-action":"actions"},popoverProps:{placement:"bottom-end",offset:6,shift:!0,className:"mtflpp-menu-popover"}},()=>(0,o.createElement)(o.Fragment,null,(e||t)&&(0,o.createElement)(r.MenuGroup,{label:n.display},e&&(0,o.createElement)(r.MenuItem,{label:n.popOutHelp,description:n.popOutHelp,showTooltip:!0,onClick:L(a.popOut),"data-action":"pip","aria-label":n.popOut},n.popOut),t&&(0,o.createElement)(r.MenuItem,{onClick:L(a.fullscreen),"data-action":"fullscreen"},n.fullscreen)),i&&(0,o.createElement)(r.MenuGroup,{label:n.position},(0,o.createElement)(r.MenuItemsChoice,{value:c,choices:[{value:"left",label:n.bottomLeft},{value:"center",label:n.bottomCenter},{value:"right",label:n.bottomRight}],onSelect(e){O(),a.dock(e)}})),(0,o.createElement)(r.MenuGroup,{label:n.preferences},!1!==d&&(0,o.createElement)(r.MenuItem,{role:"menuitemcheckbox",isSelected:u,icon:u?l.check:void 0,info:n.rememberVisibilityHelp,onClick:L(a.rememberVisibility),"data-action":"remember-visibility"},n.rememberVisibility),(0,o.createElement)(r.MenuItem,{role:"menuitemcheckbox",isSelected:f,icon:f?l.check:void 0,info:n.rememberPositionHelp,onClick:L(a.rememberPosition),"data-action":"remember-position"},n.rememberPosition),(0,o.createElement)(r.MenuItem,{role:"menuitemcheckbox",isSelected:p,icon:p?l.check:void 0,info:n.followHelp,onClick:L(a.follow),"data-action":"follow"},n.follow)),i&&(0,o.createElement)(r.MenuGroup,null,(0,o.createElement)(r.MenuItem,{info:n.resetHelp,onClick:L(a.reset),"data-action":"reset"},n.reset)),s&&(0,o.createElement)(r.MenuGroup,null,(0,o.createElement)(r.MenuItem,{onClick:L(a.close),"data-action":"close"},n.closeLivePreview))))}(),!s&&(0,o.createElement)(r.Button,{className:"mtflpp-icon mtflpp-mode",size:"compact",icon:l[v],label:E,showTooltip:!0,onClick:a.mode,"data-action":"mode"}),!s&&(0,o.createElement)(r.Button,{className:"mtflpp-icon",size:"compact",icon:l.close,label:n.close,showTooltip:!0,onClick:a.close,"data-action":"close"}),(0,o.createPortal)(function(){const{device:e,orientation:t}=g;return(0,o.createElement)(r.Toolbar,{className:"mtflpp-devices",label:n.viewport,variant:"unstyled"},...["desktop","tablet","mobile"].map(i=>{const s=e===i,c=s&&"desktop"!==i,d=c&&"landscape"===t,u="portrait"===t?n.rotateLandscape:n.rotatePortrait;return(0,o.createElement)(r.ToolbarButton,{key:i,icon:l[i],className:d?"mtflpp-device-rotated":void 0,label:c?`${n[i]} — ${u}`:n[i],isPressed:s,"data-viewport":i,onClick:()=>a.device(i)})}))}(),u),(0,o.createPortal)(function(){const{fit:e,customZoom:t=100,dpr:i=1}=g,s={automatic:n.automatic,window:n.fitToWindow,width:n.fitToWidth},c={automatic:n.automaticHelp,window:n.fitToWindowHelp,width:n.fitToWidthHelp},d="custom"===e?n.fixedZoom:s[e]??n.automatic;return(0,o.createElement)(r.Dropdown,{open:y,onToggle(e){y=e,e&&(w=!1,b="custom"===g.fit),T()},contentClassName:"mtflpp-zoom-popover",focusOnMount:"firstElement",popoverProps:{placement:"top-end",offset:8,shift:!0,resize:!1,role:"dialog","aria-label":n.fitting},renderToggle:({isOpen:e,onToggle:t})=>(0,o.createElement)(r.Button,{className:"mtflpp-zoom-toggle",variant:"secondary",size:"compact",label:d,showTooltip:!0,"aria-label":`${n.fitting}: ${d}`,"aria-haspopup":"dialog","aria-expanded":e,onClick:t,"data-action":"zoom"},(0,o.createElement)("span",{className:"mtflpp-zoom-value"},d),l.chevron),renderContent:()=>(0,o.createElement)("div",{className:"mtflpp-zoom-content"},(0,o.createElement)(r.RadioControl,{label:n.zoomMode,selected:e,options:[...Object.entries(s).map(([e,t])=>({value:e,label:t,description:c[e]})),{value:"custom",label:n.fixedZoom,description:n.fixedZoomHelp}],onFocus(e){if(!b)return;b=!1;const t=e.currentTarget.closest(".mtflpp-zoom-content")?.querySelector('.mtflpp-custom-zoom input[type="number"]');t?.focus({preventScroll:!0});const n=t?.closest(".components-popover__content");if(n){const e=t.getBoundingClientRect(),o=n.getBoundingClientRect();n.scrollTop+=Math.min(0,e.top-o.top)+Math.max(0,e.bottom-o.bottom)}},onChange(e){b=!1,"custom"!==e?a.fit(e):a.zoom(t)}}),"custom"===e&&(0,o.createElement)("div",{className:"mtflpp-custom-zoom",onKeyDown(e){if("Enter"!==e.key)return;e.preventDefault();const t=Number(e.target.value);!1!==e.target.validity?.valid&&Number.isInteger(t)&&t>=10&&t<=400&&O()}},(0,o.createElement)(r.RangeControl,{label:n.customZoom,min:10,max:400,step:1,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:t,help:n.customZoomHelp,withInputField:!0,onChange(e){Number.isInteger(e)&&e>=10&&e<=400&&a.zoom(e)}})),(0,o.createElement)("div",{className:"mtflpp-dpr-note",role:"group","aria-label":n.displayInformation},(0,o.createElement)("span",{className:"mtflpp-dpr-value"},`${n.displayDpr}: ${Number(i.toFixed(2))}`),(0,o.createElement)("span",{className:"mtflpp-pixel-note"},n.pixelZoomHelp)))})}(),f),(0,o.createPortal)(function(){const{empty:e}=g;return e?(0,o.createElement)(r.Placeholder,{className:"mtflpp-placeholder","data-empty-icon":e.busy?void 0:e.icon,icon:e.busy?(0,o.createElement)(r.Spinner):l[e.icon],label:(0,o.createElement)("h3",{className:"mtflpp-empty-title",tabIndex:-1,"data-action":"empty-title"},e.heading),instructions:e.description},e.retry&&(0,o.createElement)(r.Button,{key:"retry",variant:"primary",disabled:e.disabled,onClick:a.retry,"data-action":"retry"},e.action),e.close&&(0,o.createElement)(r.Button,{key:"close",variant:"secondary",onClick:a.close,"data-action":"close"},n.close),e.note&&(0,o.createElement)("p",{className:"mtflpp-empty-note"},e.note)):null}(),m),(0,o.createPortal)(function(){if(!g.notice)return null;if(x){const e=(0,o.createElement)(i.InlineNotices,{context:S,className:"mtflpp-inline-notices"});return M?(0,o.createElement)(M,{cornerRadius:"none"},e):e}const{message:e,...t}=P();return(0,o.createElement)(r.Notice,{...t,onRemove:a.dismissNotice,spokenMessage:"",politeness:"polite"},e)}(),h),t?(0,o.createPortal)((0,o.createElement)(r.Popover.Slot),e.ownerDocument.body):(0,o.createElement)(r.Popover.Slot))}function T(){g&&v&&(function(){if(!x)return;if(!g.notice)return void C();const e=JSON.stringify(g.notice);if(k===e)return;const{message:t,status:n,...o}=P();x.createNotice(n,t,{...o,id:E,context:S,speak:!1,onDismiss:a.dismissNotice}),k=e}(),(0,o.flushSync)(()=>v.render((0,o.createElement)(V))))}function O(){(w||y)&&(w=!1,y=!1,T())}function j(t){g?.inPip&&"mode"===t&&(t="actions"),e.querySelector(`[data-action="${t}"]`)?.focus({preventScroll:!0})}return{update(t){const n=y&&!t.hasPreview&&e.ownerDocument.activeElement?.closest(".mtflpp-zoom-popover");t.hasPreview||(y=!1),g=t,T(),n&&j("empty-title")},closeMenu:O,focus:j,beforeMove(){w=!1,y=!1,v?.unmount(),v=null,C()},remount(){v=(0,o.createRoot)(s),T()}}}(O,e,{refresh:()=>{de.canRefresh&&h()},retry:()=>{"handover"!==de.state&&(se||de.canRetry&&["error","conflict"].includes(de.state))&&g(se)},dismissNotice:()=>{ye(),I.textContent=de.text,Z.focus("actions")},mode:Le,close:function(){Z.closeMenu(),xe(!1),m(),d||P()?j.focus():u.focus()},popOut:async function(){if(K||U||x.fullscreenElement===O||!Pe())return;let t;Z.closeMenu();const n=()=>{U===t&&(v(),J.beforeMove(),Z.beforeMove(),x.body.append(O),O.classList.remove("mtflpp-pip"),U=null,Z.remount(),Ee(),J.afterMove(),Ce(),K||(w(),Q&&Z.focus("mode")))};try{if(t=await b.documentPictureInPicture.requestWindow({width:640,height:440}),!Q||K)return void t.close();const e=b.getComputedStyle(O);t.document.documentElement.lang=x.documentElement.lang,t.document.documentElement.dir=e.direction;for(const n of["--wp-admin-theme-color","--wp-admin-theme-color-darker-10","--wp-admin-border-width-focus"]){const o=e.getPropertyValue(n);o&&t.document.documentElement.style.setProperty(n,o)}const o=x.querySelectorAll(['link[rel="stylesheet"][href*="/load-styles.php"]',"#wp-theme-css","#wp-theme-inline-css","#wp-components-css","#wp-components-inline-css","style[data-emotion]","style[data-wp-hash]","#meet-the-frontend-live-preview-panel-css","#meet-the-frontend-live-preview-panel-inline-css"].join(", "));for(const e of o){const n=e.cloneNode(!0);"STYLE"===e.tagName&&e.sheet&&(n.textContent=Array.from(e.sheet.cssRules,e=>e.cssText).join("\n")),n.addEventListener("load",J.layout,{once:!0}),t.document.head.append(n)}t.document.title=_.textContent,t.document.body.className="mtflpp-pip-document",t.addEventListener("resize",J.layout),t.addEventListener("pagehide",n,{once:!0}),U=t,v(),J.beforeMove(),Z.beforeMove(),O.classList.add("mtflpp-pip"),t.document.body.append(O),Z.remount(),J.afterMove(),Ce(),ye(),Z.focus("mode"),w()}catch{if(t&&(n(),t.close()),K)return;Z.focus("actions"),we(e.pipFailed)}},fullscreen:async function(){if(!K&&!U&&x.fullscreenEnabled){Z.closeMenu();try{if(await O.requestFullscreen(),K)return void Oe();ye(),Z.focus("mode")}catch{if(K)return;Z.focus("actions"),we(e.fullscreenFailed)}}},dock:e=>ke(e),reset:()=>ke("right",!0),follow:function(){V=!V,E.set(M,"scrollToChanges",V),Ce(),V&&de.canRefresh&&h(!1)},rememberVisibility:function(){C=!C,E.set(M,"rememberVisibility",C),C&&xe(Q),Ce()},rememberPosition:function(){L=!L,E.set(M,"rememberPosition",L),L?Me():(E.set(M,"position",ne),E.set(M,"layout",void 0)),Ce()},device(e){const t=J.device;if(e===t&&"desktop"===e)return;let n=!1;if(Q&&V&&y){const{fit:e,customZoom:t,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:a}=J;n=!!y({canvas:F,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:a,canFollow:()=>J.fit===e&&J.customZoom===t})}const o={animate:Q&&!n,keepPan:n};e===t?(J.rotate(o),E.set(M,`${e}Orientation`,J.orientation)):(J.select(e,o),J.device!==t&&E.set(M,"viewport",J.device)),Ce()},fit(e){const t=J.fit;J.setFit(e),J.fit!==t&&E.set(M,"fitMode",J.fit),Ce()},zoom(e){const t=J.fit,n=J.customZoom;J.setZoom(e),J.customZoom!==n&&E.set(M,"customZoom",J.customZoom),J.fit!==t&&E.set(M,"fitMode",J.fit),Ce()}}),be(e.loading,"loading",{canRetry:!1}),Ee(),Te(),d&&(d.disabled=!1),{stage:B,canvasTarget:J.canvasTarget,get visible(){return Q},get followChanges(){return V},openFromLauncher:je,setSuspended(e){K!==e&&(K=e,Te(),e?Oe():Ee())},setVisible(e){e||(Z.closeMenu(),le="",Ce(),J.layout()),Q=e,Ee(),Te()},report:be,setTitle:fe,clearPreview(){B.replaceChildren();const t=["ready","stale","loading"].includes(de.state);be(t?e.loading:de.text,t?"loading":de.state,{...de,hasPreview:!1,hasHtmlPreview:!1,redirectDestination:void 0,canRefresh:!1,canRetry:!t&&de.canRetry})},returnToEditor:Oe}}function u(e=[]){const t=Array.isArray(e)?[...e]:[],n=new WeakMap;return{capture(e,o){try{if(n.has(e))return;const r=function(e){try{const t=e.querySelector('meta[name="meet-the-frontend-live-preview-panel"]'),n=t?.getAttribute("data-mtflpp-source");if(!n)return null;const o=JSON.parse(n);if("string"!=typeof o)return null;const r=(new DOMParser).parseFromString(o,"text/html");return r.querySelector('meta[name="meet-the-frontend-live-preview-panel"]')?.content===t.content?r:null}catch{return null}}(e);n.set(e,{source:r?S(r,e,t):null,dom:S(e,e,t),values:o&&structuredClone(o)})}catch{}},findChange(e,t){try{const o=n.get(e),r=n.get(t);if(!o||!r)return null;const i=function(e,t){if(!e||!t)return[];const n=[];for(const o of new Set([...Object.keys(e),...Object.keys(t)])){const r=Object.hasOwn(e,o)?e[o]:{type:t[o]?.type,value:""},i=Object.hasOwn(t,o)?t[o]:{type:e[o]?.type,value:""};if(r.type!==i.type||!["text","html"].includes(i.type)||"string"!=typeof r.value||"string"!=typeof i.value||r.value===i.value)continue;let a,s;try{a="html"===r.type?(new DOMParser).parseFromString(r.value,"text/html"):null,s="html"===i.type?(new DOMParser).parseFromString(i.value,"text/html"):null}catch{continue}const l=a?S(a,a,[],a.body):null,c=s?S(s,s,[],s.body):null,d=a?H(l):r.value,u=s?H(c):i.value,f=C(d),p=C(u);if(f!==p&&n.push({...I(f,p),type:"text",fullBefore:f,fullAfter:p}),!a){const e=R(d,u);e&&n.push(e);continue}if(l&&c&&(f===p||L(d,u)))for(const e of P(l,c)){if(e.spacing){const t=j(e);t&&n.push(t);continue}if(f===p)if("attributes"===e.kind){const t=new Map(e.before.attributes),o=new Map(e.after.attributes);for(const e of new Set([...t.keys(),...o.keys()])){const r=t.get(e)??"",i=o.get(e)??"";JSON.stringify(r)!==JSON.stringify(i)&&n.push({type:"attribute",name:e,before:"string"==typeof r?r:JSON.stringify(r),after:"string"==typeof i?i:JSON.stringify(i)})}}else if("content"===e.kind){const t=C(H(e.before)),o=C(H(e.after));t===o&&U(e.before,e.after,H)&&n.push({type:"markup",before:t,after:o,oldTag:e.before.tag,newTag:e.after.tag}),(e.before.media||[]).forEach((t,o)=>{const r=e.after.media?.[o];t&&r&&t!==r&&n.push({type:"media",before:t,after:r})})}}}return n}(o.values,r.values),a=function(e,t){if(!e||!t)return!1;const n=(e,t)=>Object.entries(e).some(([e,n])=>["text","html","value","row-image"].includes(n?.type)&&(!Object.hasOwn(t,e)||n.type!==t[e]?.type||n.value!==t[e]?.value));return n(e,t)||n(t,e)}(o.values,r.values),s=!!o.source&&!!r.source,l=!!o.source!=!!r.source,c=function(e,t,n){if(!e||!t)return;const o=Object.entries(t).filter(([t,n])=>"row-order"===n?.type&&"row-order"===e[t]?.type&&e[t].value!==n.value);if(1!==o.length)return;const[[r,i]]=o,a=e[r];if(!i.moved||i.members!==a.members)return;const s=JSON.parse(a.value),l=JSON.parse(i.value),c=s.indexOf(i.moved),d=l.indexOf(i.moved);if(-1===c||-1===d||c===d||s.length!==l.length)return;if(s.splice(c,1),l.splice(d,1),!s.every((e,t)=>e===l[t]))return;const u=d-c,f={html:new Map,peerLabels:new Map},p=F(r,i.moved,s,e,t,f),m=function(e,t,n,o,r,i){if([n,...o].some(n=>!e?.[n]||!t?.[n]))return[];const a=new Set(e[n]),s=new Set,l=new Set,c=new Set;for(const[n,a]of[[e,r],[t,i]])for(const e of o.flatMap(e=>n[e])){const t=a[e];"row-image"===t?.type&&(c.add(t.value),l.add(t.alt))}for(const e of t[n]){const t=r[e],n=i[e];if(!a.has(e)||"row-image"!==t?.type||"row-image"!==n?.type||!/^[1-9]\d*$/.test(n.value)||t.value!==n.value||c.has(n.value))continue;const o=n.alt;o?.trim()&&t.alt===o&&!l.has(o)&&s.add(o)}return[...s]}(a.fieldsByRow,i.fieldsByRow,i.moved,s,e,t);let h;if(n&&!p.length&&$(a,i.moved,e,f.html)&&$(i,i.moved,t,f.html)){const n=s.slice(Math.min(c,d),Math.max(c,d));h=[];for(const o of n){const n=F(r,o,[...s.filter(e=>e!==o),i.moved],e,t,f);if(!n.length){h=void 0;break}h.push(n)}}return{offset:u,groups:p,images:m,boundaryGroups:h}}(o.values,r.values,s&&!a&&!A(o.values,r.values)),d=s?P(o.source,r.source,c,!0):[];if(c?.boundaryGroups?.length){const e=d.filter(e=>e.priority>0);if(1===e.length&&e[0].boundary)return function({before:e,after:t,index:n},o){for(const n of[e,t]){let e,t;for(const{node:r}of n){if(!r?.isConnected||e&&e.nextElementSibling!==r)return null;const{position:n,marginTop:i,marginBottom:a}=r.ownerDocument.defaultView.getComputedStyle(r);if(o&&r.closest(o)||!h(r)||!["static","relative"].includes(n)||r.closest("[hidden], details:not([open])")||!1===r.checkVisibility?.({opacityProperty:!0,contentVisibilityAuto:!0}))return null;const s=r.getBoundingClientRect();if(!s.height&&!(parseFloat(i)>0||parseFloat(a)>0))return null;if(t&&(t.bottom>s.top||Math.max(t.left,s.left)>=Math.min(t.right,s.right)))return null;e=r,t=s}}return t[n].node}(e[0].boundary,r.source?.excluded)}if(!l&&!a&&!c){const e=function(e,t){const n=function(e,t){if(!e||!t)return;const n=["row-order","gallery-order","order"],o=[...new Set([...Object.keys(e),...Object.keys(t)])].filter(o=>(n.includes(e[o]?.type)||n.includes(t[o]?.type))&&e[o]?.value!==t[o]?.value);if(1!==o.length)return;const r=e[o[0]],i=t[o[0]];if("gallery-order"!==r?.type||"gallery-order"!==i?.type)return;const a=JSON.parse(r.value),s=JSON.parse(i.value);if(new Set(a).size!==a.length||new Set(s).size!==s.length)return;const l=new Map(a.map((e,t)=>[e,t])),c=s.map(e=>l.get(e));return a.length&&s.length&&c.every(e=>void 0===e)?void 0:{oldCount:a.length,matches:c}}(e.values,t.values);if(!n)return;const o=e.source??e.dom,r=t.source??t.dom,i=function(e,t,{oldCount:n,matches:o}){const r=[];function i(e,t){return e.signature===t.signature&&e.presentation===t.presentation}function a(e,t){return i(e,t)&&e.rawText===t.rawText&&e.children.length===t.children.length&&e.children.every((e,n)=>a(e,t.children[n]))}function s(e,t){if(e.children.length!==n||t.children.length!==o.length||e.rawText!==t.rawText&&(e.text||t.text))return!1;const i=x(e),s=x(t);if(!i||!s)return!1;const l=i.map(M),c=s.map(M),d=new Set(l);return!(d.size!==l.length||new Set(c).size!==c.length||l.length===c.length&&l.every((e,t)=>e===c[t])||!o.every((n,o)=>void 0===n?!d.has(c[o]):l[n]===c[o]&&a(e.children[n],t.children[o]))||(r.push({before:e,after:t,original:i,current:s}),0))}return e&&t&&function e(t,n){return!!i(t,n)&&(!!s(t,n)||t.rawText===n.rawText&&t.children.length===n.children.length&&t.children.every((t,o)=>e(t,n.children[o])))}(e,t)?r:null}(o,r,n);if(!i?.length)return;const a=i.map(e=>e.after);let[s]=a;for(;s&&!a.every(e=>e===s||ee(s,e));)s=s.parent;const l=e=>["main","body","html"].includes(e.tag)||e.attributes.some(([e,t])=>"role"===e&&"main"===t);if(!s?.parent||l(s)||!function(e,t){if(1===t.length)return!0;const n=new Set(t);let o=0;return function e(t){return n.has(t)?(o++,!0):!!v(t)||!w(t)&&("hr"!==t.tag||0===o||o===n.size)&&t.parts.every(t=>"string"==typeof t?0===o||o===n.size||!t.trim():e(t))}(e)&&o===n.size}(s,a))return null;let c=s.node;if(!c?.isConnected||a.some(({node:e})=>!c.contains(e)||r.excluded&&e.closest(r.excluded)))return null;if(t.source&&(!b(e.dom,i,"before","original")||!b(t.dom,i,"after","current")))return null;const d=c.ownerDocument.defaultView;for(let e=s,t=e.parent;t?.parent&&!l(t)&&!t.children.some(t=>t!==e&&y(t));e=t,t=t.parent){const e=t.node;if(!e?.contains(c))continue;const{overflowX:n,overflowY:o}=d.getComputedStyle(e),r=/^(?:auto|scroll|hidden)$/;(e.scrollWidth>e.clientWidth&&r.test(n)||e.scrollHeight>e.clientHeight&&r.test(o))&&(c=e)}return!h(c)||c.closest("[hidden], details:not([open])")||r.excluded&&c.closest(r.excluded)?null:c}(o,r);if(void 0!==e)return e}const u=[...d.map(e=>({...e,source:!0})),...P(o.dom,r.dom,c)],E=new Map,k=function(e,t){const n=new Map,o=e=>H(e,n),r=[];for(const n of e){if(n.unresolved)for(const e of f(n,t,o))r.push(e);if("insert"===n.kind&&n.added.length>1){const e=n.added.map(e=>{const r={...n,after:e,added:[e]},i=K(r,t,o);return{...r,input:i}}).filter(e=>e.input);if(e.length){r.push(...e);continue}}const e=K(n,t,o);r.push({...n,input:e})}return r}(u,i).filter(e=>(e.priority>0||e.input)&&(!e.spacing||function({before:e,after:t},n,o){const r=V(e,n,o),i=V(t,n,o);return r&&i&&r.omitted===i.omitted&&L(r.text,i.text)}(e,E,r.dom?.excluded))),T=s&&a&&!k.some(e=>e.source);return function(e,t){if(!e.length)return null;const n=e.reduce((e,t)=>Math.max(e,t.input),0),o=e.filter(e=>e.input===n),r=o.reduce((e,t)=>Math.max(e,t.priority),0),i=o.filter(e=>e.priority===r);if(t.rowMove&&!n||i.some(e=>e.unresolved))return function(e,{rowMove:t,excluded:n,canFollowLiveReorder:o,canFollowLiveMove:r}){if(t){const t=e.find(e=>e.moved&&(e.source||r)),o=t?.moved.node;return o?.isConnected&&t.after.node?.contains(o)&&e.every(e=>e===t||t.source&&!e.source&&(e.moved||"reorder"===e.regionChange))?"contents"!==o.ownerDocument.defaultView.getComputedStyle(o).display?o:p(t.moved,e=>o.contains(e)&&(!n||!e.closest(n))&&h(e)):null}const i=e.find(e=>e.unresolved&&("replacement"===e.regionChange||"reorder"===e.regionChange&&(e.source||o))),a=i?.after.node;if(!a?.isConnected)return null;for(const t of e)if(t.unresolved){if(i.source&&!t.source&&"reorder"===t.regionChange)continue;if(!t.regionChange||t.after.node!==a)return null}else if(!("insert"===t.kind?t.added:[t.after]).every(e=>a.contains(e.node)))return null;return"contents"!==a.ownerDocument.defaultView.getComputedStyle(a).display?a:null}(i,t);const a=i.filter(e=>!e.input||e.directInput||!i.some(t=>t!==e&&e.matches?.length&&e.matches.every(e=>t.matches?.includes(e))&&ee(e.after,t.after))),s=new Map,l=a.filter(e=>{const t="delete"===e.kind&&(e.following[0]||e.preceding[0])||e.after,n=t?.node;if(!n)return!0;const o="delete"!==e.kind||e.following.length?e.kind:"delete-last",r=s.get(n)||new Set;return!r.has(o)&&(r.add(o),s.set(n,r),!0)});return n&&s.size>1?null:function(e){const t=new Set,n=new Set;for(const o of e){let e,r=!1;"delete"===o.kind?(r=!o.removed.some(g),e=r?o.after:o.following.find(g)||o.preceding.find(g)||o.following.find(m)||o.preceding.find(m)||o.after):e="insert"===o.kind?o.added.find(g)||o.added.find(m):o.after;const i=m(e);if(!i)continue;const a=g(e),s=a||i;(a&&!r?t:n).add(s)}const o=t.size?t:n;return 1===o.size?o.values().next().value:null}(l)}(k.filter(e=>e.source||e.input||!s&&!l||T&&("insert"===e.kind||"delete"===e.kind)),{rowMove:!!c,excluded:r.source?.excluded??r.dom?.excluded,canFollowLiveReorder:!s&&(a||A(o.values,r.values)),canFollowLiveMove:!s&&!l})}catch{return null}}}}function f(e,t,n){const o=[];for(const r of t){if(!r.after||"spacing"===r.type)continue;const t=Q(e.oldRange,r.before,n,r,!0),i=Q(e.newRange,r.after,n,r,!1);if(!t.length)continue;const a="markup"===r.type&&r.oldTag===r.newTag;if(a||!r.before||!(t.length<=Q(e.newRange,r.before,n,r,!0).length||i.length<=Q(e.oldRange,r.after,n,r,!1).length))for(const s of i)a&&!t.some(e=>U(e,s,n))||o.push({...e,unresolved:!1,before:null,after:s,kind:"content",input:r.before&&r.after?2:1,priority:2,matches:[r]})}return o}function p(e,t){if(e?.node&&t(e.node))return e.node;for(const n of e?.children||[]){const e=p(n,t);if(e)return e}return null}function m(e){return p(e,()=>!0)}function h(e){return e.getClientRects().length&&"visible"===e.ownerDocument.defaultView.getComputedStyle(e).visibility}function g(e){return p(e,h)}function v(e){return/^(?:button|input|select|textarea)$/.test(e.tag)||e.attributes.some(([e,t])=>"role"===e&&"button"===t)}function w(e){return/^(?:img|video|audio|iframe|canvas|object|embed)$/.test(e.tag)||e.media?.some(Boolean)}function y(e){return!v(e)&&(e.text||w(e)||"hr"===e.tag||e.children.some(y))}function b(e,t,n,o){const r=new Map(t.map(e=>[e[n].node,e[o]]));return!(!e||r.has(null)||r.size!==t.length)&&(function e(t){const n=r.get(t.node);if(!n)return t.children.every(e);r.delete(t.node);const o=new Map,i=new Map;n.forEach((e,t)=>{e.marker&&o.set(e.marker,t),i.set(M(e),t)});const a=[],s=new Map;if(!function e(t,r=!1){if(r||=t.attributes.some(([e,t])=>"inert"===e||"aria-hidden"===e&&"true"===t),"img"!==t.tag)return t.children.every(t=>e(t,r));const l=o.get(t.marker)??i.get(M(t));return!(!n[l]||!t.media.slice(0,2).some((e,t)=>e&&e===n[l].media[t])||(a.push({index:l,cloneHidden:r}),s.set(l,(s.get(l)??0)+1),0))}(t))return!1;const l=a.filter(({index:e,cloneHidden:t})=>!t||1===s.get(e));return l.length===n.length&&l.every(({index:e},t)=>e===t)}(e)&&!r.size)}function x(e){const t=e.children.map(function e(t){return"img"===t.tag?[t]:t.children.flatMap(e)});return t.some(e=>1!==e.length||!e[0].media?.slice(0,2).some(Boolean))?null:t.map(([e])=>e)}function M(e){return JSON.stringify(e.media.slice(0,2))}function S(e,t,n,o=e.querySelector('main, [role="main"]')||e.querySelector("article")||e.body){if(!o)return null;const r=n.filter(e=>{if("string"!=typeof e||!e.trim())return!1;try{return o.matches(e),!0}catch{return!1}}).join(", "),i=new Map,a=new Map;if(e!==t)for(const e of t.querySelectorAll("[data-mtflpp-node]")){const t=e.getAttribute("data-mtflpp-node");a.set(t,a.has(t)?null:e)}for(const n of[o,...o.querySelectorAll("*")]){if(r&&n.closest(r))continue;const o=[...n.childNodes].filter(e=>3===e.nodeType).map(e=>e.textContent),s=C(o.join(" ")),l=["img","source","video","audio","iframe"].includes(n.localName)?["src","srcset","poster"].map(e=>n.getAttribute(`data-${e}`)||n.getAttribute(e)||""):[],c=n.style?.backgroundImage||n.getAttribute("data-bg")||"",d=n.getAttribute("data-mtflpp-node"),u=e===t?n:a.get(d)||null,f=E(n,u,JSON.stringify([n.localName,s,l,c]));"img"===n.localName&&(f.marker=d),f.text=s,f.rawText=o.join(""),f.media=[...l,c],f.parent=i.get(n.parentElement),i.set(n,f),f.parent?.children.push(f)}for(const[e,t]of i)t.parts=[...e.childNodes].map(e=>3===e.nodeType?e.textContent:i.get(e)).filter(e=>void 0!==e);let s=i.get(o);if(!s)return null;const l=s.node;for(let e=o.parentElement;e;e=e.parentElement){const t=E(e,l,e.localName);t.children=[s],t.parts=[s],s=t}return s.excluded=r,s}function E(e,t,n){const o=function(e){const t=[];for(const{name:n,value:o}of e.attributes){if("data-mtflpp-node"===n||n.startsWith("on")||/(?:^|-)(nonce|token)(?:-|$)/.test(n))continue;if(/^(?:data-)?(?:src|srcset|poster|sizes|bg)$/.test(n))continue;let r=o;"class"===n&&(r=[...e.classList].sort().join(" ")),"style"===n&&(r=[...e.style].sort().map(t=>[t,e.style.getPropertyValue(t),e.style.getPropertyPriority(t)])),("class"!==n&&"style"!==n||r.length)&&t.push([n,r])}return t.sort(([e],[t])=>e.localeCompare(t))}(e);return{node:t,tag:e.localName,signature:n,attributes:o,children:[],parts:[],presentation:JSON.stringify(o.filter(([e])=>!k(e))),references:JSON.stringify(o.filter(([e])=>k(e)))}}function k(e){return["id","for","headers","aria-controls","aria-labelledby","aria-describedby","aria-owns","aria-flowto","aria-activedescendant","aria-details","aria-errormessage"].includes(e)}function P(e,t,n,o=!1){const r=new Map,i=new Map,a=new Map,s=new Map,l=[];let c,d;function u(o,r,i,a=[]){const s=(e,t)=>e===t||ee(e,t);let l=!1;if(a.length){d??=[N(e,new Set(a)),N(t,new Set(a))];const n=(e,t,n)=>t.node?.isConnected&&e.node?.contains(t.node)&&"img"===t.node.localName&&(!n||!t.node.closest(n));for(const i of a){const a=d[0].get(i),c=d[1].get(i);if(a&&c){if(!s(o,a)||!s(r,c))return!1;l||=n(o,a,e.excluded)&&n(r,c,t.excluded)}}}if(!i.length)return l;if(!c){const o=new Set((n.boundaryGroups??[n.groups]).flat(2));c=[z(e,o),z(t,o)]}const[u,f]=c,p=new Map;for(const e of i.flat()){const t=u.get(e),n=f.get(e);if(t&&n){if(!s(o,t.entry)||!s(r,n.entry))return!1;p.set(e,t.substantive&&n.substantive)}}return l||i.some(e=>e.every(e=>p.has(e))&&e.some(e=>p.get(e)))}function f(e){const t=JSON.stringify(e);return r.has(t)||r.set(t,r.size+1),r.get(t)}function p(e){if(!e)return 0;const t=f([e.signature,e.children.map(p)]);return i.set(e,t),a.set(e,f([t,e.presentation,e.children.map(e=>a.get(e))])),s.set(e,f([t,e.presentation,e.references,e.children.map(e=>s.get(e))])),t}p(e),p(t);const m=e=>i.get(e);function h(e){const t=e.attributes.find(([e])=>"id"===e)?.[1];return t?`${e.tag} ${t}`:void 0}function g(e){if(!(e.children.length<2))return f(["collection",e.signature,e.children.map(m).sort((e,t)=>e-t)])}function v(e,t){const n=new Map;return e.forEach((e,o)=>{const r=t(e);void 0!==r&&n.set(r,n.has(r)?-1:o)}),n}return function e(t,r){t&&r&&(t.signature!==r.signature?l.push({kind:"content",before:t,after:r,priority:2}):t.rawText!==r.rawText&&l.push({kind:"content",before:t,after:r,priority:2,spacing:!0}),t.presentation===r.presentation&&t.references===r.references||l.push({kind:"attributes",before:t,after:r,priority:t.presentation!==r.presentation?1:0}),function(t,r,c,d){const f=d.parent&&c.parent&&d.tag===c.tag,p=v(t,m),w=v(r,m);let y,b,x,M;const S=new Set(t.flatMap(e=>[a.get(e),s.get(e)])),E=new Set(r.flatMap(e=>[a.get(e),s.get(e)]));function k(e,t,n){const o=n.get(e),r=n.get(t);return o===r||!E.has(o)&&!S.has(r)}function P(e,t){return i.get(e)===i.get(t)&&k(e,t,a)&&k(e,t,s)}function C(e,n,o,a,s,c,u){const m=t.slice(e,n),h=r.slice(o,a),g="replacement"===s&&f&&m.some(e=>!w.has(i.get(e)))&&h.some(e=>!p.has(i.get(e)))&&(!function(e,t){if(e.length<2||t.length<2)return!1;const n=e.filter(e=>e.children.length).length,o=t.filter(e=>e.children.length).length;if(!n&&!o||n>1&&o>1)return!0;const r=new Map;for(const{tag:e}of t)r.set(e,(r.get(e)||0)+1);let i=0;for(const{tag:t}of e){const e=r.get(t);if(e){if(2===++i)return!0;r.set(t,e-1)}}return!1}(m,h)||"form"===d.tag&&function(e,t){function n(e){const t=new Set;return e.every(function e(n){if(["input","select","textarea"].includes(n.tag)){const e=n.attributes.find(([e])=>"name"===e)?.[1],o=n.attributes.find(([e])=>"type"===e)?.[1]?.toLowerCase();return!(!e||"input"===n.tag&&"hidden"===o||(t.add(e),0))}let o=!1;for(const t of n.children)e(t)&&(o=!0);return o})?t:null}const o=n(e),r=n(t);return o&&r&&[...o].some(e=>!r.has(e))&&[...r].some(e=>!o.has(e))}(m,h)),v=f&&("reorder"===s||g)?s:void 0;l.push({kind:"region",after:d,priority:2,unresolved:!0,regionChange:v,oldRange:m,newRange:h,moved:c,boundary:u})}function L(e,n,o,r,i,a,s){const l=[];for(let c=e;c<n;c++){const e=s(t[c]),n=a.get(e);if(!(i.get(e)!==c||void 0===n||n<o||n>=r)){if(l.length&&n<=l[l.length-1][1])return null;l.push([c,n])}}return l}!function s(c,S,E,k){for(;c<S&&E<k&&P(t[c],r[E]);)e(t[c],r[E]),c++,E++;for(;c<S&&E<k&&P(t[S-1],r[k-1]);)S--,k--,e(t[S],r[k]);if(c===S&&E===k)return;if(c===S||E===k){const e=E===k,n=e?t.slice(c,S):r.slice(E,k),o=e?[r[E-1],r[E]]:[t[c-1],t[c]];return void(n.some(e=>o.some(t=>t&&i.get(t)===i.get(e)))?C(c,S,E,k):e?l.push({kind:"delete",after:d,removed:n,priority:2,following:r.slice(E),preceding:r.slice(0,E).reverse()}):l.push({kind:"insert",after:n[0],added:n,priority:2}))}if(S-c===1&&k-E===1)return void e(t[c],r[E]);const V=function(e,i,a,s){if(!(n?.groups.length||o&&(n?.boundaryGroups||n?.images.length)))return;const l=Math.abs(n.offset)+1;if(i-e!==l||s-a!==l)return;const c=n.offset>0,d=c?0:l-1,u=c?l-1:0,f=t.slice(e,i),p=r.slice(a,s),m=c?l-1:1,h=f.map((e,t)=>[e,p[(t+m)%l]]);return{before:f,after:p,from:d,to:u,pairs:h}}(c,S,E,k),T=V&&function(e){const t=o?n.images:[];if(!n.groups.length&&!t.length)return;const[r,i]=e.pairs[e.from],a=m(r);return-1!==p.get(a)&&-1!==w.get(a)&&e.pairs.every(([e,t])=>P(e,t))&&u(r,i,n.groups,t)?i:void 0}(V),O=V&&function(e){if(o&&n.boundaryGroups&&_(e.before[e.from])&&e.pairs.every(([e,t])=>a.get(e)===a.get(t)))return e.pairs.filter((t,n)=>n!==e.from).every(([e,t],o)=>u(e,t,n.boundaryGroups[o]))?{before:e.before,after:e.after,index:e.to||1}:void 0}(V);if(T||O||f&&function(e,n,o,a){const s=n-e;if(s<2||s!==a-o)return!1;const l=new Map;let c=!1;for(let n=0;n<s;n++){const a=i.get(t[e+n]),s=i.get(r[o+n]);c||=a!==s,l.set(a,(l.get(a)||0)+1),l.set(s,(l.get(s)||0)-1)}return c&&[...l.values()].every(e=>0===e)}(c,S,E,k)){if(O)for(const[t,n]of V.pairs)e(t,n);return void C(c,S,E,k,"reorder",T,O)}let j=L(c,S,E,k,p,w,m);if(0===j?.length&&(y??=v(t,h),b??=v(r,h),j=L(c,S,E,k,y,b,h)),0===j?.length&&(x??=v(t,g),M??=v(r,g),j=L(c,S,E,k,x,M,g)),j?.length)for(const[n,o]of[...j,[S,k]])s(c,n,E,o),n<S&&e(t[n],r[o]),c=n+1,E=o+1;else C(c,S,E,k,j?"replacement":void 0)}(0,t.length,0,r.length)}(t.children,r.children,t,r))}(e,t),l}function C(e){return e.replace(/\s+/g," ").trim()}function L(e,t){return e!==t&&e.replace(/\s/g,"")===t.replace(/\s/g,"")}function V(e,t,n){for(;e.node?.isConnected&&e.parent?.node;){const{display:t}=e.node.ownerDocument.defaultView.getComputedStyle(e.node);if("inline"!==t&&"contents"!==t)break;e=e.parent}if(!t.has(e)){const{node:o}=e,r=[],i=o?.isConnected&&T(o,n,r)===O(e)&&g(e)?o.innerText:void 0;t.set(e,"string"==typeof i?{text:i,omitted:JSON.stringify(r)}:void 0)}return t.get(e)}function T(e,t,n){return t&&e.querySelector(t)?[...e.childNodes].map(e=>3===e.nodeType?e.textContent:1!==e.nodeType?"":e.matches(t)?(n.push(e.textContent),""):T(e,t,n)).join(""):e.textContent}function O(e){return e.parts.map(e=>"string"==typeof e?e:O(e)).join("")}function j({before:e,after:t}){return R(e.rawText,t.rawText)||R(O(e),O(t))}function R(e,t){if(!/\S/.test(e)||!L(e,t))return;const n=e.match(/\s+|\S+/g),o=t.match(/\s+|\S+/g);let r=0,i=0;for(;r<Math.min(n.length,o.length)&&n[r]===o[r];)r++;for(;i<Math.min(n.length,o.length)-r&&n.at(-1-i)===o.at(-1-i);)i++;const a=Math.max(0,r-1),s=Math.max(0,i-1);return{type:"spacing",before:n.slice(a,n.length-s).join(""),after:o.slice(a,o.length-s).join("")}}function H(e,t=new Map){return e?(t.has(e)||t.set(e,(e.parts||[]).map(e=>{if("string"==typeof e)return e;const n=H(e,t);return/^(?:p|div|section|article|main|aside|header|footer|nav|h[1-6]|li|[ou]l|d[ldt]|blockquote|pre|table|tr|t[dh]|caption|figure|figcaption|br|hr)$/.test(e.tag)?` ${n} `:n}).join("")),t.get(e)):""}function A(e,t){return!!e&&!!t&&Object.entries(t).some(([t,n])=>{if(!["order","gallery-order"].includes(n?.type)||!Object.hasOwn(e,t))return!1;const o=e[t];return o?.type===n.type&&o.members===n.members&&o.value!==n.value})}function $(e,t,n,o){return e.fieldsByRow?.[t]?.every(e=>""===D(n[e],o)?.label)}function _(e){return!e.text&&!e.media?.some(Boolean)&&!/^(?:a|button|input|select|textarea|form|details|img|video|audio|iframe|canvas|svg|object|embed)$/.test(e.tag)&&e.children.every(_)}function N(e,t){const n=new Map;return e&&function e(o){if("img"===o.tag){const e=o.attributes.find(([e])=>"alt"===e)?.[1];t.has(e)&&n.set(e,n.has(e)?null:o)}o.children.forEach(e)}(e),n}function F(e,t,n,o,r,{html:i,peerLabels:a}){const{fieldsByRow:s}=r[e],l=o[e].fieldsByRow;if([t,...n].some(e=>!l?.[e]||!s?.[e]))return[];const c=[],d=new Set(l[t]);let u;function f(e,t){if(a.has(e))return a.get(e);const n=new Set;function o(e,t){n.add(C(H(e,t)));for(const n of e.children)o(n,t)}for(const r of e){if("row-image"===t[r]?.type)continue;const e=B(t[r],i);if(!e.length)return null;for(const t of e)t.entry?o(t.entry,t.cache):n.add(t.label)}return a.set(e,n),n}function p(e,t){return u??=n.flatMap(e=>[f(l[e],o),f(s[e],r)]),u.some(n=>!n||n.has(e)||t.length&&t.every(e=>n.has(e)))}for(const e of s[t]){const t=r[e],n=o[e];if(d.has(e)&&t&&n?.type===t.type&&n?.value===t.value)for(const{entry:e,cache:o,label:r}of B(t,i,n.formatted===t.formatted)){if(!r)continue;if(!e){p(r,[])||c.push([r]);continue}const t=q(e,o).map(e=>C(H(e,o))),n=z(e,new Set([r,...t]),o);n.get(r)?.substantive&&!p(r,t.join(" ")===r?t:[])&&c.push([r]);const i=[...new Set(t.filter(e=>n.has(e)))];i.length>1&&i.some(e=>n.get(e).substantive)&&!p(r,i)&&c.push(i)}}return c}function B(e,t,n=!0){const o=D(e,t);if(!o)return[];const r=n&&"html"===e.type&&"string"==typeof e.formatted?D({type:"html",value:e.formatted},t):null;return r?[o,r]:[o]}function D(e,t){if("string"==typeof e?.value){if("text"===e.type)return{label:C(e.value)};if("html"===e.type){if(!t.has(e.value))try{const n=(new DOMParser).parseFromString(e.value,"text/html"),o=S(n,n,[],n.body),r=new Map;t.set(e.value,{entry:o,cache:r,label:C(H(o,r))})}catch{t.set(e.value,null)}return t.get(e.value)}}}function q(e,t){const n=e.children.flatMap(e=>q(e,t));return n.length||!/^(?:p|h[1-6]|li|d[dt]|blockquote|pre|figcaption)$/.test(e.tag)?n:C(H(e,t))?[e]:[]}function W(e,t,n){let o;(e.text===t||/[\p{L}\p{N}]/u.test(e.text||""))&&(o=function(e,t){let n="content";for(let o=e;o;o=o.parent){const r=o.attributes.find(([e])=>"role"===e)?.[1]??"";if("button"===o.tag||/(?:^|\s)button(?:\s|$)/.test(r))return;if("a"!==o.tag&&!/(?:^|\s)link(?:\s|$)/.test(r))continue;const i=q(o,t);if(i.length<2||!i.some(e=>/^h[1-6]$/.test(e.tag)))return;const a=i.find(t=>t===e||ee(t,e));if(!a)return;/^h[1-6]$/.test(a.tag)||(n="support")}return n}(e,n));for(const r of e.children){if("content"===o)break;o=W(r,t,n)||o}return o}function z(e,t,n=new Map){const o=new Map;e&&function e(r){const i=C(H(r,n));if(t.has(i)){const e=o.get(i);o.set(i,void 0===e||e&&ee(e,r)?r:null)}r.children.forEach(e)}(e);const r=new Map;for(const[e,t]of o){const o=t&&W(t,e,n);o&&r.set(e,{entry:t,substantive:"content"===o})}return r}function I(e,t){let n=0,o=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;for(;o<e.length-n&&o<t.length-n&&e[e.length-o-1]===t[t.length-o-1];)o++;let r=e.length-o,i=t.length-o;for(;n>0&&/\S/.test(e[n-1]);)n--;if(r>n&&/\S/.test(e[r-1]))for(;r<e.length&&/\S/.test(e[r]);)r++;if(i>n&&/\S/.test(t[i-1]))for(;i<t.length&&/\S/.test(t[i]);)i++;return{before:e.slice(n,r).trim(),after:t.slice(n,i).trim()}}function Z(e,t){return t?J(e,t):""===C(e)}function J(e,t){return G(e,t,1)>0}function G(e,t,n=1/0){if(!t)return 0;let o=0,r=(e=C(e)).indexOf(t);for(;-1!==r;){const i=r+t.length;if(X(e,r)&&X(e,i)&&++o===n)break;r=e.indexOf(t,r+1)}return o}function X(e,t){return!/[\p{L}\p{N}_]$/u.test(e.slice(Math.max(0,t-2),t))||!/^[\p{L}\p{N}_]/u.test(e.slice(t,t+2))}function Y(e,t,n,o=!1){const r=C(e),i=C(t);if(r===i)return!1;if(r===n.before&&i===n.after||r===n.fullBefore&&i===n.fullAfter)return!0;if(o){const e=I(r,i);if(e.before===n.before&&e.after===n.after)return!0;if(function(e,t,n,o){if(!n||!o||e.length-n.length!==t.length-o.length)return!1;for(let r=e.indexOf(n);-1!==r;r=e.indexOf(n,r+1))if(t.startsWith(o,r)&&X(e,r)&&X(t,r)&&X(e,r+n.length)&&X(t,r+o.length)&&e.slice(0,r)===t.slice(0,r)&&e.slice(r+n.length)===t.slice(r+o.length))return!0;return!1}(r,i,n.fullBefore,n.fullAfter))return!0}return(n.before?G(r,n.before)>G(i,n.before):!r)&&(n.after?G(i,n.after)>G(r,n.after):!i)}function U(e,t,n){return e.tag!==t.tag||(e.children.length||t.children.length)&&e.text!==t.text&&C(n(e))===C(n(t))}function Q(e=[],t,n,o,r){return e.flatMap(e=>{const i=Q(e.children,t,n,o,r);let a;return a="media"===o.type?e.media?.includes(t):"attribute"===o.type?e.attributes.some(([e,n])=>e===o.name&&J("string"==typeof n?n:JSON.stringify(n),t)):("markup"!==o.type||e.tag===(r?o.oldTag:o.newTag))&&Z(n(e),t),"text"===o.type&&i.length?i:[...a?[e]:[],...i]})}function K(e,t,n){if(e.unresolved)return 0;if(e.matches=[],e.spacing){const n=t.filter(e=>"spacing"===e.type),o=n.length&&j(e);return e.matches=n.filter(e=>o?.before===e.before&&o?.after===e.after),e.matches.length?2:0}let o=0;for(const r of t){if("spacing"===r.type)continue;let t=0;if("attributes"===e.kind){if(!["text","attribute"].includes(r.type))continue;const n=new Map(e.before.attributes),o=new Map(e.after.attributes);for(const e of new Set([...n.keys(),...o.keys()])){if("attribute"===r.type&&e!==r.name)continue;const i=n.get(e),a=o.get(e);JSON.stringify(i)!==JSON.stringify(a)&&(Y("string"==typeof i?i:JSON.stringify(i)||"","string"==typeof a?a:JSON.stringify(a)||"",r)&&(t="attribute"===r.type||r.before&&r.after?2:1))}}else if("insert"===e.kind)!r.before&&e.added.some(e=>J(n(e),r.after))&&(t=Math.max(t,1));else if("delete"===e.kind)!r.after&&e.removed.some(e=>J(n(e),r.before))&&(t=Math.max(t,1));else if("media"===r.type)(e.before?.media||[]).some((t,n)=>t===r.before&&e.after?.media?.[n]===r.after)&&(t=2);else if("markup"===r.type)e.before?.tag===r.oldTag&&e.after?.tag===r.newTag&&U(e.before,e.after,n)&&Z(n(e.before),r.before)&&Z(n(e.after),r.after)&&(t=r.before&&r.after?2:1);else if("text"===r.type){const o=!(!r.before||!r.after),i=o&&Y(e.before?.text||"",e.after?.text||"",r,!0);(i||Y(n(e.before),n(e.after),r,o))&&(t=o?2:1,i&&(e.directInput=!0))}t&&e.matches.push(r),o=Math.max(o,t)}return o}function ee(e,t){return!!e?.children.some(e=>e===t||e.node&&e.node===t?.node||ee(e,t))}const te=new Set(["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","PageDown","PageUp","Home","End"," "]);function ne(e,t){let n;for(const o of e?.rects??[]){const e=t(o);if(e.visible)return e;(!n||e.distance<n.distance)&&(n=e)}return n}function oe(e){return new Promise(t=>{const n=()=>{e.clearTimeout(o),e.cancelAnimationFrame(r),t()},o=e.setTimeout(n,100);let r=e.requestAnimationFrame(()=>{r=e.requestAnimationFrame(n)})})}function re(e,t=!1){if(!ue(e,{visibilityProperty:!0,opacityProperty:!0}))return;const{left:n,right:o,top:r,bottom:i,width:a,height:s}=e.getBoundingClientRect();if(!(t||a&&s))return;const l=e.ownerDocument,{documentElement:c,body:d,defaultView:u}=l,f={left:n,right:a?o:n+1,top:r,bottom:s?i:r+1},p={...f},m={x:f.right-f.left,y:f.bottom-f.top},h="visible"===u.getComputedStyle(c).overflow,g=u.getComputedStyle(e);for(let n=e;n&&n!==c;){const o=n===e?g:u.getComputedStyle(n),{position:r,display:i,overflowX:a,overflowY:s}=o;if(n!==e&&(n!==d||!h)&&"inline"!==i&&("visible"!==a||"visible"!==s)&&n.offsetWidth&&n.offsetHeight){const{bounds:e,scaleX:r,scaleY:i}=de(n,o);for(const[l,c,d,u,h]of[["x",a,"left","right",r],["y",s,"top","bottom",i]]){if("visible"===c)continue;const r="clip"===c?[0,0]:ce(n,o,l,h),i=t&&"hidden"===c,a="y"===l==("horizontal-tb"===o.writingMode);if(i&&r.some(e=>e)&&(a||f[d]<e[d]||f[u]>e[u]||ie(o,g,l)))return{boundary:n};if(!le(f,p,e,d,u,i?[0,0]:r))return{boundary:n};m[l]=Math.min(m[l],p[u]-p[d])}}n="absolute"===r||"fixed"===r?n.offsetParent:n.parentElement}return{clipped:f,extent:m}}function ie(e,t,n){const o=e=>e&&"auto"!==e&&0!==parseFloat(e);return("x"===n?["Left","Right"]:["Top","Bottom"]).some(n=>o(e[`scrollPadding${n}`])||o(t[`scrollMargin${n}`]))}function ae(e,t,n=!1){const o=re(e,n);if(!o?.clipped)return;const{clipped:r,extent:i}=o,{ownerDocument:a}=e,s=a.documentElement;if(r.left=Math.max(s.clientLeft,r.left),r.right=Math.min(s.clientLeft+s.clientWidth,r.right),r.top=Math.max(0,r.top),r.bottom=Math.min(s.clientHeight,r.bottom),r.right<=r.left)return{rects:[]};const l=t?.({...r,top:0,bottom:s.clientHeight}),c=l?.visibleCenterX??(r.left+r.right)/2,d=ve(e,c);if(r.bottom<=r.top)return{rects:[],header:d?.bottom};const u={rects:[r],inViewport:!0,extent:i};if(!d)return u;const f={left:Math.max(r.left,d.left),right:Math.min(r.right,d.right),top:Math.max(r.top,d.top),bottom:Math.min(r.bottom,d.bottom)};if(!se(f)||!d.node.contains(a.elementFromPoint(c,(f.top+f.bottom)/2)))return u;const p=[{...r,top:f.bottom},{...r,bottom:f.top},{...f,left:r.left,right:f.left},{...f,left:f.right,right:r.right}].filter(se);return!p.length&&d.bottom>=s.clientHeight&&d.top<=0?void 0:{rects:p,inViewport:!0,extent:i,header:d.bottom}}function se({left:e,right:t,top:n,bottom:o}){return t>e&&o>n}function le(e,t,n,o,r,[i,a]){return e[o]=Math.max(e[o],n[o]),e[r]=Math.min(e[r],n[r]),t[o]=Math.max(n[o],t[o]+i),t[r]=Math.min(n[r],t[r]+a),t[r]>t[o]}function ce(e,t,n,o){const r="x"===n,i=r?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight;if(i<=0)return[0,0];const a=r?e.scrollLeft:e.scrollTop,s=t.display.endsWith("flex")&&t.flexDirection===(r?"row-reverse":"column-reverse"),l=(r&&"rtl"===t.direction)!==s;let c=l?-i:0,d=l?0:i;return("horizontal-tb"!==t.writingMode||a<c||a>d)&&(c=-i,d=i),[(a-d)*o,(a-c)*o]}function de(e,t){const n=e.getBoundingClientRect(),o=n.width/e.offsetWidth,r=n.height/e.offsetHeight,i=n.left+e.clientLeft*o,a=n.top+e.clientTop*r,s={left:i,top:a,right:i+e.clientWidth*o,bottom:a+e.clientHeight*r},l=t.overflowClipMargin;if("clip"!==t.overflowX&&"clip"!==t.overflowY||!l||"0px"===l)return{bounds:s,scaleX:o,scaleY:r};const c=l.split(" ").map(parseFloat).find(Number.isFinite)??0,d=l.includes("border-box")?n:s,u=l.includes("content-box");return{scaleX:o,scaleY:r,bounds:{left:d.left+((u?parseFloat(t.paddingLeft):0)-c)*o,right:d.right-((u?parseFloat(t.paddingRight):0)-c)*o,top:d.top+((u?parseFloat(t.paddingTop):0)-c)*r,bottom:d.bottom-((u?parseFloat(t.paddingBottom):0)-c)*r}}}function ue(e,t={visibilityProperty:!0}){return!!e?.isConnected&&!!e.getClientRects().length&&(!e.checkVisibility||e.checkVisibility(t))&&"visible"===e.ownerDocument.defaultView.getComputedStyle(e).visibility}function fe(e){return e.matchMedia("(prefers-reduced-motion: reduce)").matches?"instant":"smooth"}function pe(e,{behavior:t,header:n=ge(e),nearest:o=!1}={}){const r=e.ownerDocument,i=r.defaultView,a=t??fe(i);if(o&&!n)return void e.scrollIntoView({behavior:a,block:"nearest",inline:"nearest"});const s=i.getComputedStyle(e).scrollMarginTop,l=r.documentElement,c=l.clientHeight,d=i.getComputedStyle(l),u=he(d.scrollPaddingTop,c),f=he(d.scrollPaddingBottom,c);let p,m;try{let t=o?"nearest":"start";if(o){const e=n-parseFloat(s);null!==u&&e>u&&(p=l.getAttribute("style"),l.style.setProperty("scroll-padding-top",`${e}px`,"important"))}else{const t=n>0&&null!==u?`max(${s}, ${n-u}px)`:s;m=e.getAttribute("style"),e.style.setProperty("scroll-margin-top",`calc(${t} + 1lh)`,"important")}if(!o&&null!==u&&null!==f){const n=i.getComputedStyle(e),o=c-u-f-parseFloat(n.scrollMarginTop)-parseFloat(n.scrollMarginBottom),r=o-e.getBoundingClientRect().height;if(r>=0&&(t="center"),r>0&&"horizontal-tb"===d.writingMode){const e=Math.min(o/3,r);p=l.getAttribute("style"),l.style.setProperty("scroll-padding-bottom",`${f+e}px`,"important")}}e.scrollIntoView({behavior:a,block:t,inline:"nearest"})}finally{void 0!==p&&me(l,p),void 0!==m&&me(e,m)}}function me(e,t){e.setAttribute("style",t??""),null===t&&e.removeAttribute("style")}function he(e,t){if("auto"===e)return 0;const n=parseFloat(e);return Number.isFinite(n)?n*(e.endsWith("%")?t/100:1):null}function ge(e){const t=e.getBoundingClientRect();return ve(e,t.left+t.width/2)?.bottom??0}function ve(e,t){const n=e.ownerDocument;for(let o=n.elementFromPoint(t,1);o&&!o.contains(e);o=o.parentElement){const e=n.defaultView.getComputedStyle(o);if("fixed"!==e.position&&"sticky"!==e.position)continue;if("0"===e.opacity||!ue(o,{visibilityProperty:!0,opacityProperty:!0}))continue;const{left:t,right:r,top:i,bottom:a}=o.getBoundingClientRect();if("fixed"===e.position||i<=parseFloat(e.top)+1)return{node:o,left:t,right:r,top:i,bottom:a}}}function we(e,t,{inlineLauncher:n,nativeLauncher:o}={}){const r=e.strings,i=e.termId??e.postId,a=window,s=function(){let e,t=0,n=0;return{remember(e){try{e&&(t=e.defaultView.scrollY)}catch{}},async restore(e,o,r=()=>!0,i){const a=++n;try{const s=e.defaultView;let l;if(s.scrollTo({top:t,left:0,behavior:"instant"}),o?.ownerDocument===e&&r()){if(await oe(s),a!==n||o.ownerDocument!==e||!r())return;if(function(e,t){const n=e.ownerDocument;for(let t=e;t;t=t.parentElement)if("until-found"!==t.getAttribute("hidden")?.toLowerCase()&&(t.hasAttribute("hidden")||"none"===n.defaultView.getComputedStyle(t).display))return!1;let o=!1;for(let r=e;r&&e.isConnected&&e.ownerDocument===n&&t();r=r.parentElement){if("until-found"===r.getAttribute("hidden")?.toLowerCase()){if(r.dispatchEvent(new n.defaultView.Event("beforematch",{bubbles:!0})),!(e.isConnected&&e.ownerDocument===n&&r.isConnected&&r.ownerDocument===n&&r.contains(e)&&t()))break;"until-found"===r.getAttribute("hidden")?.toLowerCase()&&r.removeAttribute("hidden"),o=!0}const i=r.parentElement;i instanceof n.defaultView.HTMLDetailsElement&&!i.open&&r!==Array.from(i.children).find(e=>"summary"===e.localName)&&(i.open=!0,o=!0)}return o}(o,()=>a===n&&r())&&await new Promise(e=>s.setTimeout(e,0)),a!==n||!r())return;const t=o.ownerDocument===e?function(e){if(!e?.isConnected)return null;const t=re(e,!0);if(t?.clipped)return e;if(!t?.boundary)for(const t of e.querySelectorAll("*"))if(re(t,!0)?.clipped)return t;for(let n=t?.boundary||e.parentElement;n;){const e=re(n,!0);if(e?.clipped)return n;n=e?.boundary||n.parentElement}return null}(o):null;t&&(function(e,t){const n=ae(e,t,!0);if(!n?.inViewport)return void pe(e);const{rects:o,extent:r,header:i=0}=n,a=e.ownerDocument.documentElement,s=Math.min(r.x,a.clientWidth),l=Math.min(r.y,a.clientHeight-i);o.some(e=>e.right-e.left>=s-1&&e.bottom-e.top>=l-1)?t&&ne(n,t)?.reveal(fe(e.ownerDocument.defaultView)):pe(e,{nearest:!0,header:i})}(t,i),o.contains(t)&&(l=t))}return t=s.scrollY,l}catch{}},keepInView(t,{canvas:n,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:a,canFollow:s}){try{const l=e?.target===t&&e.canFollow();if(e?.cancel(),!t.isConnected||!s())return;if(!l){const e=ae(t,o);if(!ne(e,o)?.visible)return}const c=new AbortController,d={target:t,canFollow:()=>!c.signal.aborted&&s(),cancel(){c.abort(),e===d&&(e=null)}};return e=d,function(e,t,n,o,r){const i=e=>{e.isTrusted&&("keydown"!==e.type||te.has(e.key))&&r()},a={capture:!0,passive:!0,signal:o};for(const n of[e,t])for(const e of["wheel","touchmove","pointerdown","keydown"])n?.addEventListener(e,i,a);t?.addEventListener("scroll",()=>{n?.()&&r()},a)}(t.ownerDocument.defaultView,n,a,c.signal,()=>{d.cancel(),i?.()}),async function(e,t,n,o){try{const r=e.ownerDocument.defaultView;if(await oe(r),!o())return;const{scrollX:i,scrollY:a}=r,s=n();if(s&&await s,!o()||r.scrollX!==i||r.scrollY!==a)return;let l=ae(e,t);l&&!l.rects.length&&(pe(e,{behavior:"instant",header:l.header}),l=ae(e,t)),ne(l,t)?.reveal()}catch{}}(t,o,r,d.canFollow).finally(d.cancel)}catch{}}}}(),l=d(r,{postTitle:t.title??e.postTitle,publicRedirect:e.publicRedirect,inlineLauncher:n,nativeLauncher:o,onOpen:()=>R(),onClose:()=>j(),onRefresh:H,onRetry:e=>e?R(!0):H(),beforeViewportChange:e=>h.beforeViewportChange(e),beforeMove:O,afterMove:()=>{p&&H()}});let c,f,p=!1,m=0;const h=function(e,t,n,o,r=[]){const i=u(r);let a,s,l,c,d;function f(){d?.()}return{get hasPreview(){return!!a},get hasHtmlPreview(){return!!s},get redirectDestination(){return c},load:function(r,u,p=()=>!1,m){const h=new URL(r);if("https:"!==h.protocol&&"http:"!==h.protocol)throw Object.assign(new Error(n.failed),{code:"mtflpp_preview_unsupported_url"});if(h.origin!==window.location.origin){const e=n.originMismatch.replace("%s",()=>h.origin+h.pathname);throw Object.assign(new Error(e),{code:"mtflpp_preview_origin_mismatch"})}const g=h.searchParams.get("mtflpp_token");if(!g)throw new Error(n.failed);return window.crossOriginIsolated&&h.searchParams.set("mtflpp_isolated","1"),f(),h.searchParams.delete("mtflpp_source"),e.followChanges&&h.searchParams.set("mtflpp_source","1"),o(n.updating),new Promise((r,f)=>{const v=e.stage.ownerDocument.createElement("iframe");v.title=n.title,v.className="mtflpp-frame mtflpp-loading",v.setAttribute("aria-hidden","true"),v.setAttribute("tabindex","-1"),v.referrerPolicy="same-origin";let w=!1,y=!1;const b=setTimeout(()=>M(new Error(n.failed)),3e4),x=()=>{y=!0,M()};function M(e){w||(w=!0,e&&(y=!0),clearTimeout(b),d===x&&(d=null),v!==a&&(v.onload=null,v.onerror=null,v.remove()),e?f(e):r())}d=x,v.onload=async()=>{const r=v!==a;if(r||(s=null,l=null),y||!u())return void M();let d,f,w;try{const e=v.contentDocument,t=e?.querySelector('meta[name="meet-the-frontend-live-preview-panel"]');t?.content===g?d=e:r&&!t&&(f=function(e,t){if("text/html"!==e?.contentType)return;const n=e.defaultView?.performance.getEntriesByType("navigation")[0];if(!(n?.redirectCount>0))return;const o=new URL(n.name);return o.origin!==t.origin||o.pathname===t.pathname&&o.search===t.search?void 0:o.pathname}(e,h))}catch{}d&&(e.followChanges&&i.capture(d,r?m:void 0),d.documentElement.style.setProperty("overscroll-behavior","contain","important")),d&&r&&(t.remember(s),e.followChanges&&p()&&s&&(w=i.findChange(s,d))),r&&a&&(a.onload=null,a.onerror=null,a.remove()),a=v,s=d,l=null,c=f,v.classList.remove("mtflpp-loading"),v.removeAttribute("aria-hidden"),v.removeAttribute("tabindex");const b=()=>!y&&u()&&v===a&&d===s&&(!d||v.contentDocument===d);let x;if(d&&r){const n=e.canvasTarget&&(t=>e.canvasTarget(v,t,{fitTarget:!0}));x=await t.restore(d,w,()=>b()&&e.followChanges&&p(),n)}b()?(l=x,o(n.current,"ready"),M()):M()},v.onerror=()=>{v===a?(s=null,l=null,c=void 0,u()&&o(n.failed,"error")):M(new Error(n.failed))},v.src=h.href,e.stage.append(v)})},cancel:f,beforeViewportChange({canvasTarget:n,canFollow:o,...r}){const i=l,c=s,d=a;if(i&&c)return t.keepInView(i,{...r,canvasTarget:e=>n(d,e),canFollow:()=>i===l&&c===s&&d.contentDocument===c&&e.visible&&e.followChanges&&o()})},clear(){f(),t.remember(s),a&&(a.onload=null,a.onerror=null),a=null,s=null,l=null,c=void 0,e.clearPreview()}}}(l,s,r,k,e.comparisonExcludedSelectors);let g,v,w,y,b,x,M,S,E=!1;try{a.BroadcastChannel&&(S=new a.BroadcastChannel(`meet-the-frontend-live-preview-panel:${e.endpoint}:${i}:${e.userId}`),S.onmessage=e=>{"takeover"===e.data?.type&&p&&(j(!0),k(r.handedOff,"conflict",{reason:"handed-off"}))},a.addEventListener("pagehide",e=>{e.persisted||S.close()}))}catch{S?.close(),S=null}function k(e,n="loading",{canRetry:o=!0,reason:r=""}={}){"ready"===n&&(E=!1),l.report(e,n,{canTakeOver:!!S,hasPreview:h.hasPreview,canRetry:o,reason:r,hasHtmlPreview:h.hasHtmlPreview,redirectDestination:h.redirectDestination,canRefresh:p&&!t.saving&&["ready","error"].includes(n)&&("error"!==n||o)})}function P(e){const t=e?.code,n=function(e){const t=e?.code;return"mtflpp_post_locked"===t?"post-locked":"mtflpp_acf_rows_stale"===t?"reload-before-save":["mtflpp_invalid_nonce","rest_cookie_invalid_nonce","mtflpp_preview_conflict","mtflpp_source_changed","mtflpp_acf_unavailable","mtflpp_integration_failed"].includes(t)?"reload":["mtflpp_cannot_preview","rest_forbidden","rest_cannot_edit"].includes(t)?"permission":"mtflpp_preview_origin_mismatch"===t?"origin-mismatch":"mtflpp_preview_unsupported_url"===t?"unsupported-url":""}(e);n&&(p=!1,C(),h.cancel(),b?.()),k("string"==typeof t?e.message:r.failed,"post-locked"===n?"paused":"error",{reason:n,canRetry:!n})}function C(){clearTimeout(c),f=void 0}function L(e){if(void 0===e&&void 0===f)return;const t=performance.now();void 0!==e&&(f=t+e),clearTimeout(c);const n=Math.ceil(f-t);n>0?c=setTimeout(T,n):T()}function V(){p&&(m+=1,E=!0,h.cancel(),t.saving||k(r.stale,"stale"),t.saving||t.previewing?C():L(275))}function T(){if(!p||g||!1===t.ready||t.previewing||t.saving)return;C();const n=m;k(r.updating),g=(async()=>{try{if(await t.idle,!p||!1===t.ready||t.saving)return;const o=e.base;let i,a;w=t.preparePreview(l.followChanges);try{i=await w}catch(e){a=e}finally{w=null}if(await t.idle,!p||!1===t.ready||t.saving||o!==e.base)return;if(a)throw a;if("string"!=typeof i.url)throw Object.assign(new Error(i.message||r.failed),{code:i.code});p&&n===m&&await function(e,t,n){return h.load(e,()=>p&&t===m,()=>l.followChanges&&E,n)}(i.url,n,i.comparisonValues)}catch(e){p&&!t.saving&&P(e)}finally{g=null,L()}})()}function O(){m+=1,h.clear()}function j(e=!1){l.setVisible(e),p=!1,C(),O(),clearTimeout(M),M=null,x?.abort(),l.returnToEditor(),b?.()}async function R(n=!1){if(l.setVisible(!0),p)return;if(v)return void P(v);if(y){if(x&&!x.signal.aborted)return;const e=m;try{await y}catch{}return void(l.visible&&e===m&&R(n))}if(!1===t.ready)return void k(t.notReady,t.notReadyState??"paused",{canRetry:!1});if(!e.available)return void k(r.unavailable,"error",{canRetry:!1,reason:"unavailable"});if(!a.isSecureContext||!navigator.locks)return void k(r.browser,"error",{canRetry:!1,reason:"browser"});const o=n&&S?new AbortController:null;let s=!1;x=o,o?(k(r.waiting,"handover"),M=setTimeout(()=>{s=!0,o.abort()},15e3)):k(t.saving?r.saving:r.updating);try{const n=o?{signal:o.signal}:{ifAvailable:!0};if(y=navigator.locks.request(`meet-the-frontend-live-preview-panel:${e.endpoint}:${i}`,n,async e=>{if(clearTimeout(M),M=null,x=null,l.visible&&!o?.signal.aborted)if(e){k(t.saving?r.saving:r.updating);try{await new Promise(e=>{b=e,p=!0,m+=1,T()}),await g}finally{b=null}}else k(S?r.conflict:r.closeOther,"conflict",{reason:S?"other-tab":"manual"})}),o)try{S.postMessage({type:"takeover"})}catch(e){throw o.abort(),p&&j(!0),await y.catch(()=>{}),e}await y,l.visible&&s&&k(r.takeoverTimeout,"conflict",{reason:"busy"})}catch(e){p=!1,l.visible&&s?k(r.takeoverTimeout,"conflict",{reason:"busy"}):l.visible&&"AbortError"!==e.name&&P(e)}finally{clearTimeout(M),M=null,x=null,y=null}}function H(e=!0){t.saving||(e||(E=!1),p?(m+=1,h.cancel(),L(0)):R())}return{changed:V,pause:function(e=r.saving,t="loading"){return m+=1,C(),h.cancel(),(p||l.visible&&"paused"===t)&&k(e,t,{canRetry:!1}),w},resume:function(e){v=e,e?l.visible&&P(e):!l.visible||p||y?V():R()},setSuspended:l.setSuspended,setTitle:l.setTitle,openFromLauncher:l.openFromLauncher,start:()=>{l.visible&&R()},get pending(){return g}}}function ye(e,t,n,o){const r=window.acf;r.addAction("wysiwyg_tinymce_init",n);for(const e of["append","remove","sortstop","change_field"])r.addAction(e,t);const i=t=>{t[0]===e&&o?.()};function a(e){return!!e?.closest?.(".acf-field")}let s;return r.addAction("validation_failure",i),window.jQuery(e).on("input.mtflppAcf change.mtflppAcf sortupdate.mtflppAcf",(e,n)=>{a(e.target)&&("sortupdate"===e.type&&(s=n?.item?.[0]?.querySelector(':scope > input[type="hidden"][name$="[acf_fc_layout]"]')?.name),e.originalEvent&&"sortupdate"!==e.type||t())}),{isField:a,isValidating:()=>!!e.classList?.contains("is-validating"),hasStructuralPaginationChanges:()=>!!e.querySelector('.acf-repeater[data-pagination="1"] .acf-row:is(.acf-added, .acf-inserted, .acf-reordered, .acf-deleted)'),accepts:e=>"_acf_nonce"===e||e.startsWith("acf[")||e.startsWith("_acf_fields["),layoutOrders(t,n){const o=new Map,r=new Map,i=new Set;for(const[e,t]of n){"1"===t&&e.endsWith("[acf_fc_layout_disabled]")&&i.add(e.replace(/\[acf_fc_layout_disabled\]$/,"[acf_fc_layout]"));const n=e.match(/^(acf\[.+)\[[^\]]+\]\[acf_fc_layout\]$/)?.[1];n&&(o.has(n)||o.set(n,[]),o.get(n).push(e),r.set(e,[]))}const a=e=>Array.from(e.matchAll(/\]\[/g),({index:t})=>`${e.slice(0,t+1)}[acf_fc_layout]`);function l(e){const t=a(e);if(!t.some(e=>i.has(e)))return t.findLast(e=>r.has(e))}for(const[e,n]of t){if(!e.startsWith("acf[")||!["text","html"].includes(n.type))continue;const t=a(e);if(!t.some(e=>i.has(e)))for(const n of t)r.get(n)?.push(e)}for(const o of e.querySelectorAll('.acf-field[data-type="image"] .acf-image-uploader.has-value')){const e=o.querySelector(':scope > input[type="hidden"][name]'),i=o.querySelector(':scope > .image-wrap > img[data-name="image"]'),a=e?.name;if(!a?.startsWith("acf[")||!i||e.matches(":disabled")||o.closest(".acf-clone"))continue;const s=n.getAll(a);if(1!==s.length||s[0]!==e.value||!/^[1-9]\d*$/.test(s[0]))continue;const c=l(a);c&&(r.get(c).push(a),t.set(a,{type:"row-image",value:s[0],alt:i.alt}))}for(const o of e.querySelectorAll('.acf-field[data-type="gallery"] .acf-gallery')){const e=o.querySelector(':scope > input[type="hidden"][name]'),r=e?.name;if(!r?.startsWith("acf[")||e.matches(":disabled")||o.closest(".acf-clone"))continue;const s=`${r}[]`,l=n.getAll(r),c=n.getAll(s);if(a(r).some(e=>i.has(e))||1!==l.length||""!==l[0]||c.some(e=>!/^[1-9]\d*$/.test(e)))continue;const d=[...o.querySelectorAll(':scope > .acf-gallery-main > .acf-gallery-attachments > .acf-gallery-attachment > input[type="hidden"][name]')];d.length!==c.length||d.some((e,t)=>e.name!==s||e.value!==c[t]||e.matches(":disabled"))||t.set(s,{type:"gallery-order",value:JSON.stringify(c),members:JSON.stringify([...c].sort())})}for(const[e,n]of o){const o=n.filter(e=>!i.has(e));if(o.length<2||new Set(o).size!==o.length)continue;const a=o.includes(s)?s:void 0;t.set(`acf-layout-order:${e}`,{type:"row-order",value:JSON.stringify(o),members:JSON.stringify([...o].sort()),moved:a,fieldsByRow:Object.fromEntries(o.map(e=>[e,r.get(e)]))})}return t},destroy(){r.removeAction("wysiwyg_tinymce_init",n);for(const e of["append","remove","sortstop","change_field"])r.removeAction(e,t);r.removeAction("validation_failure",i),window.jQuery(e).off(".mtflppAcf")}}}function be(){const e=(0,t.select)("core/edit-post")?.getActiveMetaBoxLocations?.()??["normal","side","advanced"];return[document.querySelector(".metabox-base-form"),...e.map(e=>document.querySelector(`.edit-post-meta-boxes-area.is-${e} .metabox-location-${e}`)||document.querySelector(`#metaboxes .metabox-location-${e}`))].filter(Boolean)}const xe="meet-the-frontend-live-preview-panel/acf";function Me(e){if(!e.acfEnabled)return!1;if("function"!=typeof window.acf?.addAction||"function"!=typeof window.acf?.removeAction||"function"!=typeof window.jQuery)throw Object.assign(new Error(e.strings.acfUnavailable),{code:"mtflpp_integration_failed"});return!0}(0,e.addAction)("mtflpp.blockEditor.previewSetup",xe,({config:e,changed:n,hooks:o,onDestroy:r})=>{if(!Me(e))return;const i=function(e){const n=new Set;let o=!1,r=[],i=new Map;const a=()=>{o||e()};function s(e){e&&!n.has(e)&&(n.add(e),e.on("input change undo redo SetContent",a))}const l=ye(document,a,s);function c(e){s(e.editor)}function d(e){l.isField(e.target)&&be().some(t=>t.contains(e.target))&&a()}window.tinymce?.editors.forEach(s),window.tinymce?.on("AddEditor",c),document.addEventListener("input",d),document.addEventListener("change",d,!0);const u=new MutationObserver(a);return{get ready(){return r=r.filter(({field:e,rows:t})=>e.isConnected&&t.some(t=>e.contains(t))),r.length||u.disconnect(),!r.length},saved(){u.disconnect(),r=be().flatMap(e=>[...e.querySelectorAll('.acf-repeater[data-pagination="1"]')].map(e=>({field:e,rows:[...e.querySelectorAll(":scope > table > tbody > tr.acf-row:not(.acf-clone)")]})).filter(({rows:e})=>e.length));for(const{field:e}of r)u.observe(e,{childList:!0,subtree:!0});a()},observe(){const e=(0,t.select)("acf/fields");if(!e?.getFieldValue)return;const n=new Map;for(const t of be())for(const o of window.acf.getFields({parent:window.jQuery(t)})){const t=o.get("key");n.set(t,e.getFieldValue(t))}(n.size!==i.size||[...n].some(([e,t])=>i.get(e)!==t))&&(i=n,a())},capture(){o=!0;const e=new URLSearchParams;try{window.tinymce?.triggerSave();for(const t of be())for(const[n,o]of new FormData(t))"string"==typeof o&&l.accepts(n)&&e.append(n,o)}finally{o=!1}return e},destroy(){u.disconnect(),l.destroy(),document.removeEventListener("input",d),document.removeEventListener("change",d,!0),window.tinymce?.off("AddEditor",c);for(const e of n)e.off("input change undo redo SetContent",a)}}}(n);r(()=>i.destroy()),o.addAction("observePreviewInputs",xe,()=>i.observe()),o.addAction("nativeMetaboxSaveAcknowledged",xe,()=>i.saved()),o.addFilter("previewPauseReason",xe,t=>t||(i.ready?"":e.strings.acfRefreshing)),o.addFilter("previewFormBody",xe,e=>{e??=new URLSearchParams;for(const[t,n]of i.capture())e.append(t,n);return e})}),(0,e.addAction)("mtflpp.classicEditor.previewSetup",xe,({config:e,form:t,changed:n,watchEditor:o,cancelNativeSave:r,hooks:i,onDestroy:a})=>{if(!Me(e))return;const s=ye(t,n,o,r);a(()=>s.destroy());const l=e=>{s.isField(e.target)&&n()};t.addEventListener("input",l),t.addEventListener("change",l,!0),a(()=>{t.removeEventListener("input",l),t.removeEventListener("change",l,!0)}),i.addFilter("nativeSaveValidationPending",xe,e=>e||s.isValidating()),i.addFilter("previewComparisonValues",xe,(e,t)=>s.layoutOrders(e,t)),i.addFilter("previewFormBody",xe,(e,t)=>{for(const[n,o]of t)"string"==typeof o&&s.accepts(n)&&!n.includes("[acfcloneindex]")&&e.append(n,o);return e}),i.addFilter("nativePreviewHandoffError",xe,(t,n)=>t||(n&&s.hasStructuralPaginationChanges()?Object.assign(new Error(e.strings.nativePreviewAcf),{code:"mtflpp_acf_rows_stale"}):void 0))});const Se=window.meetTheFrontendLivePreviewPanel,Ee=document.getElementById("post");if(Se&&Ee){const t=function(e,t){const n={idle:Promise.resolve(),saving:!1,previewing:!1,deferredSaves:new WeakSet};let o,r,i=!1;function a(){const o=Array.from(window.crypto.getRandomValues(new Uint8Array(16)),e=>e.toString(16).padStart(2,"0")).join(""),i=e.base,a=`mtflpp_preview_${o}`,s=Object.entries({mtflpp_base:i,mtflpp_preview:o}).map(([e,n])=>{const o=document.createElement("input");return Object.assign(o,{type:"hidden",name:e,value:n}),t.append(o),o});let l,c,d=!1;const u=new Promise(e=>{c=e}),f=Date.now()+3e4,p=t=>{d=!0,clearTimeout(l),r=null,n.previewing=!1;for(const e of s)e.remove();document.cookie=`${a}=; Max-Age=0; Path=${e.adminCookiePath}; SameSite=Strict`,c(),n.onPreview?.(t,e.base!==i)},m=()=>{if(d)return;clearTimeout(l);const t=document.cookie.split(";").map(e=>e.trim()).find(e=>e.startsWith(`${a}=`)),n=t?.slice(a.length+1);if(n?.startsWith(`${i}.`)&&/^[a-f0-9]{64}$/.test(n.slice(65)))e.base=n.slice(65),p();else if(t||Date.now()>=f){const t="conflict"===n?e.strings.savedPostConflict:e.strings.nativePreviewFailed;p(Object.assign(new Error(t),{code:"mtflpp_source_changed"}))}else l=setTimeout(m,100)};r={done:u,check:m},n.idle=Promise.all([n.idle,u]),l=setTimeout(m,100)}const s=e=>{const t=e.target.closest("#post-preview");if(!t||t.classList.contains("disabled")||i||!window.crypto?.getRandomValues)return;if(n.previewing)return e.preventDefault(),void e.stopImmediatePropagation();n.previewing=!0;const o=n.beforePreview?.();if(!o)return void a();e.preventDefault(),e.stopImmediatePropagation(),window.open("",t.target||"wp-preview");const r=()=>{a(),i=!0;try{t.click()}finally{i=!1}};o.then(r,r)};t.addEventListener("click",s,!0),window.jQuery(document).on("heartbeat-send.mtflpp",(t,n)=>{r?.check(),n.mtflpp_base=e.base}).on("before-autosave.mtflpp",()=>{const e=new Promise(e=>{o=e});n.idle=Promise.all([e,r?.done]),n.onAutosave?.()}).on("heartbeat-tick.mtflpp heartbeat-error.mtflpp",(t,n)=>{"string"==typeof n?.mtflpp_base&&/^[a-f0-9]{64}$/.test(n.mtflpp_base)&&(e.base=n.mtflpp_base),"string"==typeof n?.rest_nonce&&(e.nonce=n.rest_nonce),o?.(),o=null}),window.jQuery(t).on("input.mtflpp change.mtflpp",e=>{!e.originalEvent&&["post_title","content","excerpt"].includes(e.target.name)&&n.onFieldChange?.(e)});const l=()=>{n.onSaveCancelled?n.onSaveCancelled():n.saving=!1};t.addEventListener("invalid",l,!0);let c=0,d=!1;function u(e){if("click"===e.type){const t=e.target.closest("#publish, #save-post");if(!t||t.disabled||t.classList.contains("disabled"))return}else if("dopreview"===t.querySelector("#wp-preview")?.value)return;const o=++c;setTimeout(()=>{const t=e.defaultPrevented||e.isDefaultPrevented?.();d||o!==c||!t||n.deferredSaves.has(e)||n.isValidating?.()||l()},0)}return t.addEventListener("click",u,!0),t.addEventListener("submit",u,!0),window.jQuery(t).on("submit.mtflpp",e=>{e.originalEvent||u(e)}),n.destroy=()=>{d=!0,n.beforePreview=null,n.onPreview=null,n.onAutosave=null,n.onFieldChange=null,n.onSaveCancelled=null,n.isValidating=null,t.removeEventListener("click",s,!0),t.removeEventListener("invalid",l,!0),t.removeEventListener("click",u,!0),t.removeEventListener("submit",u,!0),window.jQuery(document).off(".mtflpp"),window.jQuery(t).off(".mtflpp")},n}(Se,Ee);try{!function(t,n,o){const r=document.getElementById("post");if(!t||!r)return;let i,a=!1;const s=new Set;let l=!1;n.title=document.getElementById("title")?.value??t.postTitle,n.preparePreview=async e=>{let n;a=!0;try{window.tinymce?.triggerSave(),n=new FormData(r)}finally{a=!1}const o=new URLSearchParams;for(const[e,t]of n)"string"==typeof t&&["post_title","content","excerpt"].includes(e)&&o.append(e,t);const s=Object.fromEntries([...o].map(([e,t])=>[e,{type:"post_title"===e?"text":"html",value:t}])),l=i.capture(o,n),c=i.comparisonValues(l,s),d=new Set;if(e)for(const e of Object.values(c))if("row-order"===e?.type&&e.fieldsByRow)for(const t of Object.values(e.fieldsByRow).filter(Array.isArray))for(const e of t)"html"===c[e]?.type&&l.has(e)&&d.add(e);l.set("base",t.base),d.size&&l.set("mtflpp_row_text_fields",JSON.stringify([...d]));const u=await fetch(t.endpoint,{method:"POST",credentials:"same-origin",headers:{"X-WP-Nonce":t.nonce},body:l}),f=await u.json();if(!u.ok)throw Object.assign(new Error(f.message||t.strings.failed),{code:f.code});const{rowDisplayText:p,...m}=f;for(const e of d){const t=p?.[e];"string"==typeof t&&(c[e]={...c[e],formatted:t})}return{...m,comparisonValues:c}};const c=we(t,n,{inlineLauncher:o}),d=()=>{if(a||l)return;const e=i?.filter("previewPauseReason","")||i?.error?.message,t=!1===n.ready&&!e;n.ready=!e,n.notReady=e,n.notReadyState="paused",i?.error?c.resume(i.error):e?c.pause(e,"paused"):t?c.resume():c.changed()};function u(e){l||!e||s.has(e)||(s.add(e),e.on("input change undo redo SetContent",d))}function f(e){u(e.editor)}function p(e,t){u(t)}function m(){n.saving&&(n.saving=!1,d())}n.onAutosave=d,n.beforePreview=()=>(c.pause(t.strings.nativePreview),c.pending),n.onPreview=(e,t)=>{e=i.filter("nativePreviewHandoffError",e,t),c.resume(i.error||e)},window.tinymce&&(window.tinymce.editors.forEach(u),window.tinymce.on("AddEditor",f)),window.jQuery?.(document).on("tinymce-editor-init.mtflppClassicEditor",p),n.onSaveCancelled=m,i=function(t,n){const o=(0,e.createHooks)(),r=[];let i,a=!1;function s(e){i??="mtflpp_integration_failed"===e?.code?e:Object.assign(new Error(n.config.strings.integrationFailed),{code:"mtflpp_integration_failed",cause:e})}const l={get error(){return i},filter(e,t,...n){if(a||i)return t;try{const r=o.applyFilters(e,t,...n);if("additionalPreviewValues"===e&&("[object Object]"!==Object.prototype.toString.call(r)||Object.values(r).some(e=>!(null===e||["string","boolean"].includes(typeof e)||"number"==typeof e&&Number.isFinite(e)))))throw new TypeError("Preview values must be a plain object of scalar values.");return r}catch(e){return s(e),t}},action(e,...t){if(!a&&!i)try{o.doAction(e,...t)}catch(e){s(e)}},capture(e,t=null){a&&!i&&s(new Error("This editor session has ended."));const n=null===e?null:new URLSearchParams(e),o=l.filter("previewFormBody",e,t);if(null===o||o instanceof URLSearchParams||s(new TypeError("Preview capture must return URLSearchParams or null.")),i||null===n||null!==o&&![...n.keys()].some(e=>{const t=n.getAll(e),r=o.getAll(e);return r.length!==t.length||t.some((e,t)=>r[t]!==e)})||s(new TypeError("Preview capture must preserve the classic form body.")),i)throw i;return o},comparisonValues(e,t){const r=new Map(Object.entries(t));try{const t=n.form||document,i=new Set;for(const n of t.querySelectorAll("input[name], textarea[name], select[name]")){if(r.has(n.name)||!e?.has(n.name)||"password"===n.type)continue;if("hidden"===n.type){i.add(n.name);continue}const t="textarea"===n.localName||["text","search","email","url","tel"].includes(n.type),o=e.getAll(n.name);let a="value";t&&1===o.length&&(a=n.classList.contains("wp-editor-area")?"html":"text"),r.set(n.name,{type:a,value:1===o.length?o[0]:JSON.stringify(o)})}for(const t of i){if(r.has(t))continue;const n=e.getAll(t);n.length>1&&r.set(t,{type:"order",value:JSON.stringify(n),members:JSON.stringify(n.sort())})}return Object.fromEntries(o.applyFilters("previewComparisonValues",r,e))}catch{}return Object.fromEntries(r)},destroy(){if(!a){a=!0;for(const e of r.reverse())try{e()}catch(e){s(e)}r.length=0}}};try{(0,e.doAction)("mtflpp.classicEditor.previewSetup",{...n,hooks:o,onDestroy(e){r.push(e)}})}catch(e){s(e),l.destroy()}return l}(0,{config:t,form:r,changed:d,watchEditor:u,cancelNativeSave:m});const h=n.destroy;function g(e){e.persisted||n.destroy()}function v(e){"post_title"===e.target.name&&c.setTitle(e.target.value),["post_title","content","excerpt"].includes(e.target.name)&&d()}n.destroy=()=>{if(!l){l=!0,i.destroy(),r.removeEventListener("input",v),r.removeEventListener("change",v,!0),r.removeEventListener("click",b,!0),r.removeEventListener("submit",x,!0),window.removeEventListener("pagehide",g),window.tinymce?.off("AddEditor",f),window.jQuery?.(document).off("tinymce-editor-init.mtflppClassicEditor",p);for(const e of s)e.off("input change undo redo SetContent",d);s.clear(),h?.()}},window.addEventListener("pagehide",g),n.isValidating=()=>i.filter("nativeSaveValidationPending",!1),n.onFieldChange=v,r.addEventListener("input",v),r.addEventListener("change",v,!0);let w=!1;function y(e,t){if(e.defaultPrevented)return;if(w)return n.deferredSaves?.add(e),e.preventDefault(),void e.stopImmediatePropagation();if(n.saving)return;n.saving=!0,c.pause();const o=c.pending||(n.previewing?n.idle:null);if(!o)return;n.deferredSaves?.add(e),e.preventDefault(),e.stopImmediatePropagation(),w=!0;const r=()=>{w=!1,!l&&n.saving&&t()};o.then(r,r)}function b(e){const t=e.target.closest("#publish, #save-post");!t||t.disabled||t.classList.contains("disabled")||y(e,()=>t.click())}function x(e){"dopreview"!==r.querySelector("#wp-preview")?.value&&y(e,()=>r.requestSubmit(e.submitter||void 0))}r.addEventListener("click",b,!0),r.addEventListener("submit",x,!0),d(),i.error||c.start()}(Se,t,Ee.querySelector("#mtflpp-publish-preview button"))}catch(e){t.destroy(),function(e,t){document.getElementById("mtflpp-panel")?.remove(),document.getElementById("mtflpp-toggle")?.remove(),document.getElementById("mtflpp-publish-preview")?.remove(),document.getElementById("mtflpp-term-preview")?.remove();const n=document.createElement("div");n.className="notice notice-error inline",n.setAttribute("role","alert");const o=document.createElement("p");o.textContent=e,n.append(o);const r=document.querySelector("#wpbody-content .wp-header-end")||document.querySelector("#wpbody-content .wrap h1, #wpbody-content .wrap h2");r?r.after(n):(document.getElementById("wpbody-content")||document.body).prepend(n),console.error("Meet the Frontend – Live Preview Panel could not start.",t)}(Se.strings.bootFailed,e)}}})();
  • meet-the-frontend-live-preview-panel/tags/1.3.1/build/revision-browser.asset.php

    r3820590 r3822693  
    99                'wp-primitives'
    1010        ),
    11         'version' => 'af21c92ce6fe3dc311fb'
     11        'version' => '052095b6b6e41065bed3'
    1212);
  • meet-the-frontend-live-preview-panel/tags/1.3.1/build/revision-browser.js

    r3820590 r3822693  
    1 (()=>{"use strict";const e=window.wp.data,t=window.wp.preferences,n=window.wp.element,o=window.wp.components,r=window.wp.notices,i=window.wp.primitives,l=window.ReactJSXRuntime,s={refresh:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M12 5.5L17.7929 11.2929C18.1834 11.6834 18.1834 12.3166 17.7929 12.7071L16 14.5M16 5.5H12V9.5M12 18.5L6.20711 12.7071C5.81658 12.3166 5.81658 11.6834 6.20711 11.2929L8 9.5M8 18.5H12V14.5"})}),more:(0,l.jsxs)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,l.jsx)(i.Path,{d:"M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z",fill:"currentColor",stroke:"none"}),(0,l.jsx)(i.Path,{d:"M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z",fill:"currentColor",stroke:"none"}),(0,l.jsx)(i.Path,{d:"M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z",fill:"currentColor",stroke:"none"}),(0,l.jsx)(i.Path,{d:"M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z"}),(0,l.jsx)(i.Path,{d:"M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z"}),(0,l.jsx)(i.Path,{d:"M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z"})]}),expand:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M4.75 10V4.75H10M4.75 4.75L10 10M14 19.25H19.25V14M19.25 19.25L14 14"})}),compact:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M10 4.75V10H4.75M10 10L4.75 4.75M19.25 14H14V19.25M14 14L19.25 19.25"})}),pip:(0,l.jsxs)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,l.jsx)(i.Path,{d:"M4.75 9.25V16C4.75 16.6904 5.30964 17.25 6 17.25H8M4.75 9.25V6C4.75 5.30964 5.30964 4.75 6 4.75H16C16.6904 4.75 17.25 5.30964 17.25 6V8M4.75 9.25H8"}),(0,l.jsx)(i.Path,{d:"M10.75 11.25C10.75 10.9739 10.9739 10.75 11.25 10.75H18.75C19.0261 10.75 19.25 10.9739 19.25 11.25V18.75C19.25 19.0261 19.0261 19.25 18.75 19.25H11.25C10.9739 19.25 10.75 19.0261 10.75 18.75V11.25Z",fill:"currentColor"})]}),move:(0,l.jsxs)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,l.jsx)(i.Path,{d:"M9.25 5.75H8.75V6.25H9.25V5.75Z",fill:"currentColor",stroke:"none"}),(0,l.jsx)(i.Path,{d:"M9.25 11.75H8.75V12.25H9.25V11.75Z",fill:"currentColor",stroke:"none"}),(0,l.jsx)(i.Path,{d:"M9.25 17.75H8.75V18.25H9.25V17.75Z",fill:"currentColor",stroke:"none"}),(0,l.jsx)(i.Path,{d:"M15.25 5.75H14.75V6.25H15.25V5.75Z",fill:"currentColor",stroke:"none"}),(0,l.jsx)(i.Path,{d:"M15.25 11.75H14.75V12.25H15.25V11.75Z",fill:"currentColor",stroke:"none"}),(0,l.jsx)(i.Path,{d:"M15.25 17.75H14.75V18.25H15.25V17.75Z",fill:"currentColor",stroke:"none"}),(0,l.jsx)(i.Path,{d:"M9.25 5.75H8.75V6.25H9.25V5.75Z"}),(0,l.jsx)(i.Path,{d:"M9.25 11.75H8.75V12.25H9.25V11.75Z"}),(0,l.jsx)(i.Path,{d:"M9.25 17.75H8.75V18.25H9.25V17.75Z"}),(0,l.jsx)(i.Path,{d:"M15.25 5.75H14.75V6.25H15.25V5.75Z"}),(0,l.jsx)(i.Path,{d:"M15.25 11.75H14.75V12.25H15.25V11.75Z"}),(0,l.jsx)(i.Path,{d:"M15.25 17.75H14.75V18.25H15.25V17.75Z"})]}),warning:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M12 8L12 13M12 14.5L12 16M4.75 12C4.75 7.99593 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12Z",strokeLinejoin:"round"})}),info:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M12 16V11M12 9.5V8M19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12C4.75 7.99594 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12Z",strokeLinejoin:"round"})}),close:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M7.75 16.25L16.25 7.75M16.25 16.25L7.75 7.75"})}),check:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M7 12L10 15L17 8"})}),chevron:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M7 11L12 15L17 11"})}),desktop:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M4.75 16.75V17H3.25C3.11193 17 3 17.1119 3 17.25H21C21 17.1119 20.8881 17 20.75 17H19.25V16.75M4.75 16.75V8.5C4.75 7.80964 5.30964 7.25 6 7.25H18C18.6904 7.25 19.25 7.80964 19.25 8.5V16.75M4.75 16.75H19.25"})}),tablet:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M10 16.5H14M18.25 18V6C18.25 5.30964 17.6904 4.75 17 4.75H7C6.30964 4.75 5.75 5.30964 5.75 6L5.75 18C5.75 18.6904 6.30964 19.25 7 19.25H17C17.6904 19.25 18.25 18.6904 18.25 18Z"})}),mobile:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M11 16.5H13M16.25 18V6C16.25 5.30964 15.6904 4.75 15 4.75H9C8.30964 4.75 7.75 5.30964 7.75 6L7.75 18C7.75 18.6904 8.30964 19.25 9 19.25H15C15.6904 19.25 16.25 18.6904 16.25 18Z"})})};function a(e,t,n="right"){const o=e&&!Array.isArray(e)&&e.bounds&&["x","y","width","height"].every(t=>Number.isFinite(e.bounds[t]))&&e.bounds.width>0&&e.bounds.height>0&&[null,"left","center","right"].includes(e.dock)&&"boolean"==typeof e.expanded&&(void 0===e.anchor||["left","center","right"].includes(e.anchor));let r=!!o&&e.expanded;const i={width:480,height:393},l=o?{...e.bounds}:{x:0,y:0,...i};let s=o?e.dock:n,a=s||o&&e.anchor||"right";function c(){return"left"===a?0:"center"===a?.5:1}function d(e,n=t(!s),o=320,r=220){return e.width=Math.min(n.width,Math.max(Math.min(o,n.width),e.width)),e.height=Math.min(n.height,Math.max(Math.min(r,n.height),e.height)),e.x=Math.max(n.left,Math.min(n.right-e.width,e.x)),e.y=Math.max(n.top,Math.min(n.bottom-e.height,e.y)),e}function u(e){if(!s)return e;const n=t();return e.x="left"===s?n.left:"center"===s?n.left+(n.width-e.width)/2:n.right-e.width,e.y=n.bottom-e.height,e}return{area:t,compactRect:function(){return u(d({...l}))},launcherRect:function(e){return u(d({...e,x:l.x+(l.width-e.width)*c(),y:l.y+l.height-e.height},t(!s),1,1))},usableEdge:function(e){return!(s&&(e.includes("s")||"left"===s&&e.includes("w")||"right"===s&&e.includes("e")))},get anchor(){return a},get anchorFactor(){return c()},get dock(){return s},get expanded(){return r},get layout(){return{bounds:{...l},dock:s,anchor:a,expanded:r}},toggleExpanded(){r=!r},dockTo:function(e="right",t=!1){t&&Object.assign(l,i),r=!1,a=s=e},resize(e,n,o,r){Object.assign(l,function(e,n,o,r){const i=t(!s),l=n.includes("e")||n.includes("w"),c=n.includes("n")||n.includes("s"),d=function(e){return"center"===a?.5:e.includes("w")?1:0}(n),u=e.x+e.width*d,f=n.includes("n"),p=e.y+(f?e.height:0),m=function(e,t,n){return 0===n?e.right-t:1===n?t-e.left:2*Math.min(t-e.left,e.right-t)}(i,u,d),h=f?p-i.top:i.bottom-p,g=(n.includes("w")?-o:o)*(.5===d?2:1),w=Math.max(Math.min(320,m),Math.min(m,e.width+g)),v=Math.max(Math.min(220,h),Math.min(h,e.height+(f?-r:r))),b=l&&0!==o&&w!==e.width,y=c&&0!==r&&v!==e.height,x=f?p-v:p;return{x:b?u-w*d:e.preferredBounds.x,y:y?x:e.preferredBounds.y,width:b?w:e.preferredBounds.width,height:y?v:e.preferredBounds.height}}(e,n,o,r))},move:function(e,n,o,r=!1){const i=d({...e,x:e.x+n,y:e.y+o},t(!0),r?1:320,r?1:220);l.x=i.x+(r?(i.width-l.width)*c():0),l.y=i.y+(r?i.height-l.height:0),s=null}}}function c(i,{postTitle:l="",publicRedirect:c,inlineLauncher:d,nativeLauncher:u,canRememberVisibility:f=!0,onOpen:p,onClose:m,onRefresh:h,onRetry:g,beforeMove:w,afterMove:v,beforeViewportChange:b}){const y=window,x=document,M="meet-the-frontend-live-preview-panel",C=(0,e.select)(t.store),P=(0,e.dispatch)(t.store),k="width"===C.get(M,"fit")?"width":"automatic";P.setDefaults(M,{rememberVisibility:!0,rememberPosition:!0,panelOpen:!0,scrollToChanges:!0,viewport:"desktop",fitMode:k,customZoom:100,tabletOrientation:"portrait",mobileOrientation:"portrait"});const E=()=>!d&&(!u||u.fallbackMedia.matches);let S=!1!==C.get(M,"rememberVisibility"),L=!1!==C.get(M,"rememberPosition"),V=!1!==C.get(M,"scrollToChanges");const T=d?.parentElement??x.getElementById("mtflpp-toggle"),H=x.getElementById("mtflpp-panel");if(!T||!H)throw new Error("Preview panel markup is missing.");const j=d||function(e){let t;const{title:r,moveHelp:i}=e.dataset;return(0,n.flushSync)(()=>(0,n.createRoot)(e).render((0,n.createElement)(o.Button,{ref:e=>{t=e},variant:"secondary",label:r,title:r,description:i,"aria-controls":"mtflpp-panel","aria-expanded":!1},(0,n.createElement)("span",{className:"mtflpp-launcher-label"},r)))),t}(T),O=H.querySelector(".mtflpp-move-control"),R=H.querySelector(".mtflpp-resize"),N=H.querySelectorAll("[data-resize-edge]"),$=H.querySelector(".mtflpp-header"),D=H.querySelector(".mtflpp-caption"),F=H.querySelector(".mtflpp-viewport"),B=H.querySelector(".mtflpp-canvas"),A=H.querySelector(".mtflpp-stage"),W=H.querySelector(".mtflpp-empty"),q=H.querySelector(".mtflpp-devicebar"),z=H.querySelector(".mtflpp-dimensions"),Z=H.querySelector(".mtflpp-feedback"),I=H.querySelector('[role="status"]');let _;const G=function(e,t,n,o={},r=()=>{},i={desktop:"Desktop",tablet:"Tablet",mobile:"Phone"}){const l=e.ownerDocument.defaultView,s=e.querySelector(".mtflpp-canvas"),a=e.querySelector(".mtflpp-canvas-space"),c=n.querySelector(".mtflpp-dimensions-text"),d={desktop:[1280,800],tablet:[768,1024],mobile:[390,844]},u=Object.keys(d);let f=u.includes(o.device)?o.device:"desktop";const p=["automatic","window","width","custom"];let m=p.includes(o.fit)?o.fit:"automatic";const h=e=>Number.isInteger(e)&&e>=10&&e<=400;let g,w=h(o.customZoom)?o.customZoom:100,v=100;const b=e=>"desktop"===e?"landscape":"portrait",y=Object.fromEntries(u.map(e=>[e,"desktop"!==e&&["portrait","landscape"].includes(o[`${e}Orientation`])?o[`${e}Orientation`]:b(e)])),x=()=>y[f]===b(f)?d[f]:[...d[f]].reverse(),M=()=>"width"===m;let C,P,k;const E=l.matchMedia("(prefers-reduced-motion: no-preference)");function S(){const t=e.ownerDocument.defaultView.devicePixelRatio;return Number.isFinite(t)&&t>0?t:1}function L(e,t){if("custom"===m)return w/100/S();const n=s.clientWidth/e;if(M())return n;const o=Math.min(n,s.clientHeight/t);return"automatic"===m?Math.min(1/S(),o):o}function V(e,n){C=e;const[o,r]=x(),i=Math.max(0,(s.clientWidth-o*C)/2),l=Math.max(0,(s.clientHeight-r*C)/2);Object.assign(a.style,{width:`${Math.max(s.clientWidth,i+o*C)}px`,height:`${Math.max(s.clientHeight,l+r*C)}px`}),Object.assign(t.style,{left:`${i}px`,top:`${l}px`,transform:`scale(${C})`});const c=o*C>s.clientWidth+.01||r*C>s.clientHeight+.01,d="custom"===m||M();s.tabIndex=d&&c?0:-1,s.scrollLeft="custom"===m?n.x*C:0,s.scrollTop=d?n.y*C:0}function T(){if(!P)return;const e=P;P=null,e.window.cancelAnimationFrame(e.frame),e.resolve?.()}function H(e,t,n,o){return t<=0||o&&e<-1&&t<n?Math.max(e,t-n):e>=n||o&&e>0&&t>n+1?Math.min(e,t-n):0}function j(o=!1,l=!1){T();const[a,d]=x();if(Object.assign(t.style,{width:`${a}px`,height:`${d}px`}),!e.clientWidth||!e.clientHeight)return;const u=S(),p=`${i[f]} (${a} × ${d}) · `,h=Math.max(400,Math.ceil(e.clientWidth/a*u*100)),b=`${p}${"0".repeat(String(h).length)}%`;n.dataset.reserve!==b&&(n.dataset.reserve=b);const y=l?{x:0,y:0}:{x:(s.scrollLeft||0)/(C||1),y:(s.scrollTop||0)/(C||1)};if(s.style.overflowX="hidden",s.style.overflowY="hidden","custom"===m){const e=L(a,d);for(let t=0;t<2;t++)a*e>s.clientWidth+.01&&(s.style.overflowX="scroll"),d*e>s.clientHeight+.01&&(s.style.overflowY="scroll")}else M()&&d*L(a,d)>e.clientHeight&&(s.style.overflowY="scroll");if(!s.clientWidth||!s.clientHeight)return;const k=L(a,d),H=Math.round(k*u*100),j=H!==v||u!==g;v=H,g=u;const O=`${p}${"custom"===m?w:v}%`;c.textContent!==O&&(c.textContent=O),j&&r();const R=C??k;if(!o||!E.matches||R===k)return void V(k,y);const N={window:e.ownerDocument.defaultView,frame:null},$=N.window.performance.now();P=N;const D=e=>{V(e,y),N.scrollLeft=s.scrollLeft,N.scrollTop=s.scrollTop};D(R);const F=e=>{if(P!==N)return;const t=Math.min(1,Math.max(0,(e-$)/200));D(R+(k-R)*(1-(1-t)**3)),t<1?N.frame=N.window.requestAnimationFrame(F):T()};N.frame=N.window.requestAnimationFrame(F)}function O(){j()}function R(){k?.();const t=e.ownerDocument.defaultView.matchMedia(`(resolution: ${S()}dppx)`);t.addEventListener("change",R),k=()=>t.removeEventListener("change",R),O()}let N=new l.ResizeObserver(O);return N.observe(e),E.addEventListener("change",O),l.addEventListener("resize",R),R(),{get device(){return f},get fit(){return m},get customZoom(){return w},get zoomPercent(){return"custom"===m?w:v},get dpr(){return S()},get orientation(){return y[f]},canvasTarget:function(e,t,{fitTarget:n=!1}={}){const o=e.getBoundingClientRect(),r=s.getBoundingClientRect(),i=o.left-r.left-s.clientLeft,l=o.top-r.top-s.clientTop,a=H(i+t.left*C,i+t.right*C,s.clientWidth,n),c=H(l+t.top*C,l+t.bottom*C,s.clientHeight,n),d=Math.max(t.left,-i/C),u=Math.min(t.right,(s.clientWidth-i)/C);return{visible:!a&&!c,visibleCenterX:d<u?(d+u)/2:void 0,distance:Math.hypot(a,c),reveal(e="instant"){(a||c)&&s.scrollBy({left:a,top:c,behavior:e})}}},canvasWasPanned:function(){return!!P&&(s.scrollLeft!==P.scrollLeft||s.scrollTop!==P.scrollTop)},whenSettled:function(){if(!P)return;const e=P;return e.done??=new Promise(t=>{e.resolve=t}),e.done},finishMotion(){P&&O()},select(e,{animate:t=!1,keepPan:n=!1}={}){if(!u.includes(e))return;const o=f!==e;f=e,o?j(t,!n):P||O()},rotate({animate:e=!1,keepPan:t=!1}={}){"desktop"!==f&&(y[f]="portrait"===y[f]?"landscape":"portrait",j(e,!t))},setFit(e){p.includes(e)&&m!==e&&(m=e,j(!1,!0))},setZoom(e){if(!h(e)||"custom"===m&&w===e)return;const t="custom"!==m;w=e,m="custom",j(!1,t)},layout:O,beforeMove(){T(),N.disconnect(),k?.(),e.ownerDocument.defaultView.removeEventListener("resize",R)},afterMove(){N=new e.ownerDocument.defaultView.ResizeObserver(O),N.observe(e),e.ownerDocument.defaultView.addEventListener("resize",R),R()}}}(F,A,z,{device:C.get(M,"viewport"),fit:C.get(M,"fitMode")??k,customZoom:C.get(M,"customZoom"),tabletOrientation:C.get(M,"tabletOrientation"),mobileOrientation:C.get(M,"mobileOrientation")},()=>Ee(),i),X=x.querySelector("#wpbody-content > .wrap"),J=x.getElementById("wpadminbar");function Y(e=!1){const t=Math.max(1,x.documentElement.clientWidth),n=Math.max(1,x.documentElement.clientHeight),o=x.documentElement.getBoundingClientRect().left+y.scrollX,r=!e&&X?.getBoundingClientRect(),i=r?Math.max(0,"rtl"===y.getComputedStyle(X).direction?r.left-o:o+t-r.right):20,l=e?0:i,s=Math.min(l,(t-1)/2),a=Math.min(Math.max(0,J?.getBoundingClientRect().bottom||0)+l,n-1),c=t-s,d=n-Math.min(l,n-a-1);return{left:s,top:a,right:c,bottom:d,width:c-s,height:d-a}}let U,K=f&&(!S||!1!==C.get(M,"panelOpen"));const Q=C.get(M,"layout"),ee=C.get(M,"position")??Q?.dock??Q?.anchor;let te=["left","center","right"].includes(ee)?ee:"right";const ne=a(L?Q:void 0,Y,te),{compactRect:oe,usableEdge:re}=ne;let ie,le=!1,se="",ae=!1,ce={text:i.loading,state:"loading",hasPreview:!1,canRetry:!1,reason:""},de=!1;function ue(e){const t="string"==typeof e?e.replace(/\s+/g," ").trim():"";D.textContent=t?`${i.preview} — ${t}`:i.title,D.title=D.textContent,U&&(U.document.title=D.textContent)}function fe(){const{text:e,state:t,hasPreview:n,reason:o}=ce;return"handover"===t?{heading:i.switchingPreview,description:e,note:i.tabEdits}:"conflict"===t?{heading:e,description:{"handed-off":i.handedOffHelp,busy:i.takeoverTimeoutHelp,manual:i.closeOtherHelp}[o]||i.conflictHelp,note:"manual"===o?i.manualSwitchHint:i.tabEdits}:"paused"===t?{heading:i.pausedTitle,description:e,note:""}:"error"===t?function(){const{text:e,hasPreview:t,canRetry:n,reason:o}=ce;if("origin-mismatch"===o)return{heading:i.originMismatchTitle,description:t?`${e} ${i.previousPreview}`:e,note:""};if("unavailable"===o||"browser"===o)return{heading:"unavailable"===o?i.unavailableTitle:i.browserTitle,description:e,note:""};if(!t){let t=e;return e===i.failed&&(t=n?i.failedHelp:""),"reload"===o&&(t+=` ${i.reviewBeforeReload}`),{heading:i.failed,description:t,note:""}}return{heading:e===i.failed?i.refreshFailed:e,description:"reload"===o?i.reviewBeforeReload:i.previousPreview,note:""}}():n?{heading:e,description:"",note:""}:{heading:i.loading,description:i.preparing,note:""}}function pe(){return le?"handover"===ce.state?i.takingOver:i.takeOver:i.retry}function me(e){return!e||["handover","paused"].includes(ce.state)?"info":"error"!==ce.state||ce.canRetry?"warning":"error"}function he(){return ce.redirectDestination?`${i.redirected} ${ce.redirectDestination}`:ce.hasHtmlPreview&&ie?`${i.publicRedirected} ${ie}`:""}function ge(){const{state:e,hasPreview:t,canRetry:n,reason:o}=ce,r=t&&["error","conflict","handover","paused"].includes(e),l=!t||r||se?"":he();if(Z.hidden=!r&&!se&&!l,Z.tabIndex=Z.hidden?-1:0,H.dataset.hasFeedback=String(!Z.hidden),Z.hidden)return null;if(l)return{heading:l,status:"info",dismissible:!1};const{heading:s,description:a}=fe();return{heading:r?s:se,description:r?a:i.windowNoticeHelp,status:me(r),dismissible:!r,retry:r&&(le||n&&["error","conflict"].includes(e)),close:r&&"error"===e&&!n&&"reload"!==o,disabled:"handover"===e,action:pe()}}function we(e){ce.hasPreview&&["error","conflict","handover","paused"].includes(ce.state)||(se=e,Ee()),I.textContent=`${e} ${i.windowNoticeHelp}`}function ve(){se="",Ee()}function be(e,t="loading",{canTakeOver:n=!1,hasPreview:o=!1,hasHtmlPreview:r=!1,redirectDestination:i,canRefresh:l=!1,canRetry:s=!0,reason:a=""}={}){const d=H.ownerDocument.activeElement,u=H.contains(d),f=!o&&(ce.state!==t||ce.text!==e||ce.reason!==a),p=ce.hasPreview!==o;ce={text:e,state:t,canTakeOver:n,hasPreview:o,hasHtmlPreview:r,redirectDestination:i,canRefresh:l,canRetry:s,reason:a},["error","conflict","handover","paused"].includes(t)&&(se=""),H.dataset.state=t,H.dataset.hasPreview=String(o),le=n&&["conflict","handover"].includes(t),W.hidden=o,q.hidden=!o;const{heading:m,description:h,note:g}=fe();f&&(W.scrollTop=0);const w="ready"!==t||se?"":he();I.textContent=o?[m,h,g,w].filter(Boolean).join(" "):m,Ee(),p&&G.layout(),function(e,t){e&&t&&(!H.contains(e)||e.closest("[hidden]")||e.disabled||!ce.hasPreview&&B.contains(e))&&_.focus(W.hidden?"actions":"empty-title")}(d,u),K&&"ready"===t&&r&&!i&&async function(){if(c&&!ae){ae=!0;try{const e=new URL(c.endpoint);if(e.origin!==y.location.origin)return;const t=await y.fetch(e,{credentials:"same-origin",cache:"no-store",redirect:"error",headers:{"X-WP-Nonce":c.nonce}});if(!t.ok)return;const{destination:n}=await t.json();if("string"!=typeof n||!n)return;if(ie=n,!K)return;Ee(),"ready"!==ce.state||!ce.hasHtmlPreview||ce.redirectDestination||se||(I.textContent=he())}catch{}}}()}function ye(e){f&&S&&C.get(M,"panelOpen")!==e&&P.set(M,"panelOpen",e)}function xe(){L&&P.set(M,"layout",ne.layout)}function Me(){const e=T.hidden;T.hidden=!1,T.style.maxWidth=`${Y(!ne.dock).width}px`;const t={width:T.offsetWidth,height:T.offsetHeight};return T.hidden=e,ne.launcherRect(t)}function Ce(){if(U)return;if(!K&&E()){const e=Me(),t=ne.anchorFactor;Object.assign(T.style,{left:`${e.x+e.width*t}px`,top:`${e.y+e.height}px`,transform:`translate(${-100*t}%, -100%)`})}let e=oe();if(H.dataset.anchor=ne.anchor,ne.expanded){const t=Y();e={x:t.left,y:t.top,width:t.width,height:t.height}}Object.assign(H.style,{left:`${e.x}px`,top:`${e.y}px`,width:`${e.width}px`,height:`${e.height}px`,transform:""})}function Pe(e="right",t=!1){ne.dockTo(e,t),te=e,P.set(M,"position",te),Ce(),xe(),Ee()}function ke(){return"function"==typeof y.documentPictureInPicture?.requestWindow}function Ee(){if(!_)return;const e=H.ownerDocument.fullscreenElement===H,t=!U&&!e,n=t&&!ne.expanded;H.classList.toggle("mtflpp-expanded",ne.expanded),R.hidden=!n;for(const e of N)e.hidden=!n||!re(e.dataset.resizeEdge);const o=le||ce.canRetry&&["error","conflict"].includes(ce.state);var r;_.update({inPage:t,inPip:!!U,movable:n,dock:ne.dock,canRememberVisibility:f,rememberVisibility:S,rememberPosition:L,followChanges:V,device:G.device,busy:ce.hasPreview&&["stale","loading","handover"].includes(ce.state)&&ce.text!==i.saving,empty:ce.hasPreview?null:{...fe(),busy:["loading","stale","ready","handover"].includes(ce.state),icon:["paused","conflict"].includes(ce.state)||["unavailable","browser","origin-mismatch"].includes(ce.reason)?"info":"warning",retry:o,disabled:"handover"===ce.state,close:"error"===ce.state&&!o,action:pe()},notice:ge(),fit:G.fit,orientation:G.orientation,customZoom:G.customZoom,zoomPercent:G.zoomPercent,dpr:G.dpr,canRefresh:ce.canRefresh,hasPreview:ce.hasPreview,canPip:t&&ke(),canFullscreen:t&&!!x.fullscreenEnabled,mode:e||ne.expanded?"compact":"expand",modeLabel:(r=e,r?i.exitFullscreen:ne.expanded?i.compact:i.expand)})}function Se(){_.closeMenu(),U?U.close():x.fullscreenElement!==H?(ne.toggleExpanded(),Ce(),xe(),Ee(),_.focus("mode")):x.exitFullscreen().then(ve,()=>we(i.fullscreenFailed))}function Le(e,t=!1,n){const o=e===j,r=e===$,l=()=>n||("left"===ne.anchor?"ne":"nw"),s=()=>U||!o&&ne.expanded||x.fullscreenElement===H||t&&!re(l());let a,c;const d=()=>({...o?Me():oe(),preferredBounds:ne.layout.bounds});function u(){if(c=null,a)if(t||o)Ce();else{const e=oe(),t=e.x-parseFloat(H.style.left),n=e.y-parseFloat(H.style.top);Object.assign(H.style,{width:`${e.width}px`,height:`${e.height}px`,transform:`translate3d(${t}px, ${n}px, 0)`})}}function f(){if(!a)return;const{pointer:t,moved:n}=a;a=null,y.cancelAnimationFrame(c),e.hasPointerCapture(t)&&e.releasePointerCapture(t),H.classList.remove("mtflpp-dragging"),e.classList.remove("mtflpp-edge-active"),x.documentElement.classList.remove("mtflpp-window-dragging"),x.documentElement.style.removeProperty("--mtflpp-drag-cursor"),Ce(),n&&(o&&(de=!0),xe(),Ee())}e.addEventListener("pointerdown",t=>{0!==t.button||s()||r&&t.target.closest('button, a, [role="button"]')||(o&&(de=!1),t.preventDefault(),o?j.focus({preventScroll:!0}):e===O&&_.focus("move"),_.closeMenu(),a={...d(),pointer:t.pointerId,pointerX:t.clientX,pointerY:t.clientY},e.setPointerCapture(t.pointerId))}),e.addEventListener("pointermove",n=>{if(!a||a.pointer!==n.pointerId)return;const r=n.clientX-a.pointerX,i=n.clientY-a.pointerY;!a.moved&&Math.abs(r)+Math.abs(i)<4||(a.moved=!0,H.classList.add("mtflpp-dragging"),t&&e.classList.add("mtflpp-edge-active"),x.documentElement.style.setProperty("--mtflpp-drag-cursor",t?y.getComputedStyle(e).cursor:"grabbing"),x.documentElement.classList.add("mtflpp-window-dragging"),t?ne.resize(a,l(),r,i):ne.move(a,r,i,o),c||(c=y.requestAnimationFrame(u)))});for(const t of["pointerup","pointercancel","lostpointercapture"])e.addEventListener(t,f);y.addEventListener("blur",f),r||n||e.addEventListener("keydown",e=>{const n={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[e.key];if(!n||e.altKey||e.ctrlKey||e.metaKey||s())return;e.preventDefault(),_.closeMenu();const r=d(),a=e.shiftKey?40:10;t?ne.resize(r,l(),n[0]*a,n[1]*a):ne.move(r,n[0]*a,n[1]*a,o),Ce(),xe(),Ee();const c=oe();I.textContent=t?`${i.resize}: ${Math.round(c.width)} × ${Math.round(c.height)}`:i.moved})}ue(l),$.addEventListener("dblclick",e=>{U||e.target.closest("button, a")||Se()}),x.addEventListener("fullscreenchange",Ee),R.addEventListener("keydown",e=>{"Escape"===e.key&&R.classList.add("mtflpp-help-dismissed")}),R.addEventListener("blur",()=>R.classList.remove("mtflpp-help-dismissed")),Le(O),Le($),d||Le(j),Le(R,!0);for(const e of N)Le(e,!0,e.dataset.resizeEdge);function Ve(){H.hidden=!K,T.hidden=!d&&(K||!E()),j.setAttribute("aria-expanded",String(K))}function Te(e=!0){K?_.focus("actions"):(ye(!0),p(),K&&e&&_.focus("actions"))}return y.addEventListener("resize",Ce),y.addEventListener("scroll",Ce,{passive:!0}),u?.fallbackMedia.addEventListener("change",()=>{Ce(),Ve()}),j.addEventListener("click",e=>{if(de&&0!==e.detail)return de=!1,void e.preventDefault();de=!1,Te(0===e.detail)}),_=function(t,i,l){const a=t.querySelector(".mtflpp-controls"),c=t.querySelector(".mtflpp-refresh-control"),d=t.querySelector(".mtflpp-move-control"),u=t.querySelector(".mtflpp-device-controls"),f=t.querySelector(".mtflpp-fit-control"),p=t.querySelector(".mtflpp-pip-control"),m=t.querySelector(".mtflpp-empty"),h=t.querySelector(".mtflpp-feedback");let g,w=(0,n.createRoot)(a),v=!1,b=!1,y=!1;const x=r.InlineNotices?(0,e.dispatch)(r.store):null,M=t.ownerDocument.defaultView?.wp?.theme?.ThemeProvider,C="meet-the-frontend-live-preview-panel",P="preview-feedback";let k="";function E(){const e=g.notice,t=/[.!?…。!?]$/.test(e.heading)?e.heading:`${e.heading}.`;return{message:e.description?`${t} ${e.description}`:e.heading,status:e.status,isDismissible:e.dismissible,actions:[...e.retry?[{label:e.action,disabled:e.disabled,onClick:l.retry}]:[],...e.close?[{label:i.close,onClick:l.close}]:[]]}}function S(){x&&k&&x.removeNotice(P,C),k=""}function L(e){return()=>{H(),e()}}function V(){const{inPage:e,inPip:a,mode:w,modeLabel:P,movable:k,busy:S,canRefresh:V,hasPreview:j,canPip:O}=g;return(0,n.createElement)(o.SlotFillProvider,null,(0,n.createPortal)(k&&e&&(0,n.createElement)(o.Button,{className:"mtflpp-icon mtflpp-move",size:"compact",icon:s.move,label:i.move,showTooltip:!0,tooltipPosition:"bottom","data-action":"move"}),d),(0,n.createPortal)((0,n.createElement)(o.Button,{className:"mtflpp-icon",size:"compact",icon:S?(0,n.createElement)(o.Spinner):s.refresh,label:i.refresh,showTooltip:!0,accessibleWhenDisabled:!0,disabled:!V,onClick:l.refresh,"data-action":"refresh"}),c),(0,n.createPortal)(O&&j&&(0,n.createElement)("div",{className:"mtflpp-pip-surface"},(0,n.createElement)(o.Button,{className:"mtflpp-pip-button",icon:s.pip,label:i.popOutHelp,"aria-label":i.popOut,description:i.popOutHelp,showTooltip:!0,onClick:l.popOut,"data-action":"pop-out"})),p),function(){const{canPip:e,canFullscreen:t,inPage:r,inPip:a,dock:c,canRememberVisibility:d,rememberVisibility:u,rememberPosition:f,followChanges:p}=g;return(0,n.createElement)(o.DropdownMenu,{className:"mtflpp-actions",label:i.actions,icon:s.more,open:v,onToggle(e){v=e,e&&(b=!1),T()},toggleProps:{className:"mtflpp-icon",size:"compact","data-action":"actions"},popoverProps:{placement:"bottom-end",offset:6,shift:!0,className:"mtflpp-menu-popover"}},()=>(0,n.createElement)(n.Fragment,null,(e||t)&&(0,n.createElement)(o.MenuGroup,{label:i.display},e&&(0,n.createElement)(o.MenuItem,{label:i.popOutHelp,description:i.popOutHelp,showTooltip:!0,onClick:L(l.popOut),"data-action":"pip","aria-label":i.popOut},i.popOut),t&&(0,n.createElement)(o.MenuItem,{onClick:L(l.fullscreen),"data-action":"fullscreen"},i.fullscreen)),r&&(0,n.createElement)(o.MenuGroup,{label:i.position},(0,n.createElement)(o.MenuItemsChoice,{value:c,choices:[{value:"left",label:i.bottomLeft},{value:"center",label:i.bottomCenter},{value:"right",label:i.bottomRight}],onSelect(e){H(),l.dock(e)}})),(0,n.createElement)(o.MenuGroup,{label:i.preferences},!1!==d&&(0,n.createElement)(o.MenuItem,{role:"menuitemcheckbox",isSelected:u,icon:u?s.check:void 0,info:i.rememberVisibilityHelp,onClick:L(l.rememberVisibility),"data-action":"remember-visibility"},i.rememberVisibility),(0,n.createElement)(o.MenuItem,{role:"menuitemcheckbox",isSelected:f,icon:f?s.check:void 0,info:i.rememberPositionHelp,onClick:L(l.rememberPosition),"data-action":"remember-position"},i.rememberPosition),(0,n.createElement)(o.MenuItem,{role:"menuitemcheckbox",isSelected:p,icon:p?s.check:void 0,info:i.followHelp,onClick:L(l.follow),"data-action":"follow"},i.follow)),r&&(0,n.createElement)(o.MenuGroup,null,(0,n.createElement)(o.MenuItem,{info:i.resetHelp,onClick:L(l.reset),"data-action":"reset"},i.reset)),a&&(0,n.createElement)(o.MenuGroup,null,(0,n.createElement)(o.MenuItem,{onClick:L(l.close),"data-action":"close"},i.closeLivePreview))))}(),!a&&(0,n.createElement)(o.Button,{className:"mtflpp-icon mtflpp-mode",size:"compact",icon:s[w],label:P,showTooltip:!0,onClick:l.mode,"data-action":"mode"}),!a&&(0,n.createElement)(o.Button,{className:"mtflpp-icon",size:"compact",icon:s.close,label:i.close,showTooltip:!0,onClick:l.close,"data-action":"close"}),(0,n.createPortal)(function(){const{device:e,orientation:t}=g;return(0,n.createElement)(o.Toolbar,{className:"mtflpp-devices",label:i.viewport,variant:"unstyled"},...["desktop","tablet","mobile"].map(r=>{const a=e===r,c=a&&"desktop"!==r,d=c&&"landscape"===t,u="portrait"===t?i.rotateLandscape:i.rotatePortrait;return(0,n.createElement)(o.ToolbarButton,{key:r,icon:s[r],className:d?"mtflpp-device-rotated":void 0,label:c?`${i[r]} — ${u}`:i[r],isPressed:a,"data-viewport":r,onClick:()=>l.device(r)})}))}(),u),(0,n.createPortal)(function(){const{fit:e,customZoom:t=100,dpr:r=1}=g,a={automatic:i.automatic,window:i.fitToWindow,width:i.fitToWidth},c={automatic:i.automaticHelp,window:i.fitToWindowHelp,width:i.fitToWidthHelp},d="custom"===e?i.fixedZoom:a[e]??i.automatic;return(0,n.createElement)(o.Dropdown,{open:b,onToggle(e){b=e,e&&(v=!1,y="custom"===g.fit),T()},contentClassName:"mtflpp-zoom-popover",focusOnMount:"firstElement",popoverProps:{placement:"top-end",offset:8,shift:!0,resize:!1,role:"dialog","aria-label":i.fitting},renderToggle:({isOpen:e,onToggle:t})=>(0,n.createElement)(o.Button,{className:"mtflpp-zoom-toggle",variant:"secondary",size:"compact",label:d,showTooltip:!0,"aria-label":`${i.fitting}: ${d}`,"aria-haspopup":"dialog","aria-expanded":e,onClick:t,"data-action":"zoom"},(0,n.createElement)("span",{className:"mtflpp-zoom-value"},d),s.chevron),renderContent:()=>(0,n.createElement)("div",{className:"mtflpp-zoom-content"},(0,n.createElement)(o.RadioControl,{label:i.zoomMode,selected:e,options:[...Object.entries(a).map(([e,t])=>({value:e,label:t,description:c[e]})),{value:"custom",label:i.fixedZoom,description:i.fixedZoomHelp}],onFocus(e){if(!y)return;y=!1;const t=e.currentTarget.closest(".mtflpp-zoom-content")?.querySelector('.mtflpp-custom-zoom input[type="number"]');t?.focus({preventScroll:!0});const n=t?.closest(".components-popover__content");if(n){const e=t.getBoundingClientRect(),o=n.getBoundingClientRect();n.scrollTop+=Math.min(0,e.top-o.top)+Math.max(0,e.bottom-o.bottom)}},onChange(e){y=!1,"custom"!==e?l.fit(e):l.zoom(t)}}),"custom"===e&&(0,n.createElement)("div",{className:"mtflpp-custom-zoom",onKeyDown(e){if("Enter"!==e.key)return;e.preventDefault();const t=Number(e.target.value);!1!==e.target.validity?.valid&&Number.isInteger(t)&&t>=10&&t<=400&&H()}},(0,n.createElement)(o.RangeControl,{label:i.customZoom,min:10,max:400,step:1,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:t,help:i.customZoomHelp,withInputField:!0,onChange(e){Number.isInteger(e)&&e>=10&&e<=400&&l.zoom(e)}})),(0,n.createElement)("div",{className:"mtflpp-dpr-note",role:"group","aria-label":i.displayInformation},(0,n.createElement)("span",{className:"mtflpp-dpr-value"},`${i.displayDpr}: ${Number(r.toFixed(2))}`),(0,n.createElement)("span",{className:"mtflpp-pixel-note"},i.pixelZoomHelp)))})}(),f),(0,n.createPortal)(function(){const{empty:e}=g;return e?(0,n.createElement)(o.Placeholder,{className:"mtflpp-placeholder","data-empty-icon":e.busy?void 0:e.icon,icon:e.busy?(0,n.createElement)(o.Spinner):s[e.icon],label:(0,n.createElement)("h3",{className:"mtflpp-empty-title",tabIndex:-1,"data-action":"empty-title"},e.heading),instructions:e.description},e.retry&&(0,n.createElement)(o.Button,{key:"retry",variant:"primary",disabled:e.disabled,onClick:l.retry,"data-action":"retry"},e.action),e.close&&(0,n.createElement)(o.Button,{key:"close",variant:"secondary",onClick:l.close,"data-action":"close"},i.close),e.note&&(0,n.createElement)("p",{className:"mtflpp-empty-note"},e.note)):null}(),m),(0,n.createPortal)(function(){if(!g.notice)return null;if(x){const e=(0,n.createElement)(r.InlineNotices,{context:C,className:"mtflpp-inline-notices"});return M?(0,n.createElement)(M,{cornerRadius:"none"},e):e}const{message:e,...t}=E();return(0,n.createElement)(o.Notice,{...t,onRemove:l.dismissNotice,spokenMessage:"",politeness:"polite"},e)}(),h),e?(0,n.createPortal)((0,n.createElement)(o.Popover.Slot),t.ownerDocument.body):(0,n.createElement)(o.Popover.Slot))}function T(){g&&w&&(function(){if(!x)return;if(!g.notice)return void S();const e=JSON.stringify(g.notice);if(k===e)return;const{message:t,status:n,...o}=E();x.createNotice(n,t,{...o,id:P,context:C,speak:!1,onDismiss:l.dismissNotice}),k=e}(),(0,n.flushSync)(()=>w.render((0,n.createElement)(V))))}function H(){(v||b)&&(v=!1,b=!1,T())}function j(e){g?.inPip&&"mode"===e&&(e="actions"),t.querySelector(`[data-action="${e}"]`)?.focus({preventScroll:!0})}return{update(e){const n=b&&!e.hasPreview&&t.ownerDocument.activeElement?.closest(".mtflpp-zoom-popover");e.hasPreview||(b=!1),g=e,T(),n&&j("empty-title")},closeMenu:H,focus:j,beforeMove(){v=!1,b=!1,w?.unmount(),w=null,S()},remount(){w=(0,n.createRoot)(a),T()}}}(H,i,{refresh:()=>{ce.canRefresh&&h()},retry:()=>{"handover"!==ce.state&&(le||ce.canRetry&&["error","conflict"].includes(ce.state))&&g(le)},dismissNotice:()=>{ve(),I.textContent=ce.text,_.focus("actions")},mode:Se,close:function(){_.closeMenu(),ye(!1),m(),d||E()?j.focus():u.focus()},popOut:async function(){if(U||x.fullscreenElement===H||!ke())return;let e;_.closeMenu();const t=()=>{U===e&&(w(),G.beforeMove(),_.beforeMove(),x.body.append(H),H.classList.remove("mtflpp-pip"),U=null,_.remount(),Ce(),G.afterMove(),Ee(),v(),K&&_.focus("mode"))};try{if(e=await y.documentPictureInPicture.requestWindow({width:640,height:440}),!K)return void e.close();const n=y.getComputedStyle(H);e.document.documentElement.lang=x.documentElement.lang,e.document.documentElement.dir=n.direction;for(const t of["--wp-admin-theme-color","--wp-admin-theme-color-darker-10","--wp-admin-border-width-focus"]){const o=n.getPropertyValue(t);o&&e.document.documentElement.style.setProperty(t,o)}const o=x.querySelectorAll(['link[rel="stylesheet"][href*="/load-styles.php"]',"#wp-theme-css","#wp-theme-inline-css","#wp-components-css","#wp-components-inline-css","style[data-emotion]","style[data-wp-hash]","#meet-the-frontend-live-preview-panel-css","#meet-the-frontend-live-preview-panel-inline-css"].join(", "));for(const t of o){const n=t.cloneNode(!0);"STYLE"===t.tagName&&t.sheet&&(n.textContent=Array.from(t.sheet.cssRules,e=>e.cssText).join("\n")),n.addEventListener("load",G.layout,{once:!0}),e.document.head.append(n)}e.document.title=D.textContent,e.document.body.className="mtflpp-pip-document",e.addEventListener("resize",G.layout),e.addEventListener("pagehide",t,{once:!0}),U=e,w(),G.beforeMove(),_.beforeMove(),H.classList.add("mtflpp-pip"),e.document.body.append(H),_.remount(),G.afterMove(),Ee(),ve(),_.focus("mode"),v()}catch{e&&(t(),e.close()),_.focus("actions"),we(i.pipFailed)}},fullscreen:async function(){if(!U&&x.fullscreenEnabled){_.closeMenu();try{await H.requestFullscreen(),ve(),_.focus("mode")}catch{_.focus("actions"),we(i.fullscreenFailed)}}},dock:e=>Pe(e),reset:()=>Pe("right",!0),follow:function(){V=!V,P.set(M,"scrollToChanges",V),Ee(),V&&ce.canRefresh&&h(!1)},rememberVisibility:function(){S=!S,P.set(M,"rememberVisibility",S),S&&ye(K),Ee()},rememberPosition:function(){L=!L,P.set(M,"rememberPosition",L),L?xe():(P.set(M,"position",te),P.set(M,"layout",void 0)),Ee()},device(e){const t=G.device;if(e===t&&"desktop"===e)return;let n=!1;if(K&&V&&b){const{fit:e,customZoom:t,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:l}=G;n=!!b({canvas:B,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:l,canFollow:()=>G.fit===e&&G.customZoom===t})}const o={animate:K&&!n,keepPan:n};e===t?(G.rotate(o),P.set(M,`${e}Orientation`,G.orientation)):(G.select(e,o),G.device!==t&&P.set(M,"viewport",G.device)),Ee()},fit(e){const t=G.fit;G.setFit(e),G.fit!==t&&P.set(M,"fitMode",G.fit),Ee()},zoom(e){const t=G.fit,n=G.customZoom;G.setZoom(e),G.customZoom!==n&&P.set(M,"customZoom",G.customZoom),G.fit!==t&&P.set(M,"fitMode",G.fit),Ee()}}),be(i.loading,"loading",{canRetry:!1}),Ce(),Ve(),d&&(d.disabled=!1),{stage:A,canvasTarget:G.canvasTarget,get visible(){return K},get followChanges(){return V},openFromLauncher:Te,setVisible(e){e||(_.closeMenu(),se="",Ee(),G.layout()),K=e,Ce(),Ve()},report:be,setTitle:ue,clearPreview(){A.replaceChildren();const e=["ready","stale","loading"].includes(ce.state);be(e?i.loading:ce.text,e?"loading":ce.state,{...ce,hasPreview:!1,hasHtmlPreview:!1,redirectDestination:void 0,canRefresh:!1,canRetry:!e&&ce.canRetry})},returnToEditor(){_.closeMenu(),U?.close(),x.fullscreenElement===H&&x.exitFullscreen().catch(()=>{})}}}function d(e=[]){const t=Array.isArray(e)?[...e]:[],n=new WeakMap;return{capture(e,o){try{if(n.has(e))return;const r=function(e){try{const t=e.querySelector('meta[name="meet-the-frontend-live-preview-panel"]'),n=t?.getAttribute("data-mtflpp-source");if(!n)return null;const o=JSON.parse(n);if("string"!=typeof o)return null;const r=(new DOMParser).parseFromString(o,"text/html");return r.querySelector('meta[name="meet-the-frontend-live-preview-panel"]')?.content===t.content?r:null}catch{return null}}(e);n.set(e,{source:r?m(r,e,t):null,dom:m(e,e,t),values:o&&Object.fromEntries(Object.entries(o).map(([e,t])=>[e,{...t}]))})}catch{}},findChange(e,t){try{const o=n.get(e),r=n.get(t);if(!o||!r)return null;const i=function(e,t){if(!e||!t)return[];const n=[];for(const o of new Set([...Object.keys(e),...Object.keys(t)])){const r=Object.hasOwn(e,o)?e[o]:{type:t[o]?.type,value:""},i=Object.hasOwn(t,o)?t[o]:{type:e[o]?.type,value:""};if(r.type!==i.type||!["text","html"].includes(i.type)||"string"!=typeof r.value||"string"!=typeof i.value||r.value===i.value)continue;let l,s;try{l="html"===r.type?(new DOMParser).parseFromString(r.value,"text/html"):null,s="html"===i.type?(new DOMParser).parseFromString(i.value,"text/html"):null}catch{continue}const a=l?m(l,l,[],l.body):null,c=s?m(s,s,[],s.body):null,d=l?k(a):r.value,u=s?k(c):i.value,f=v(d),p=v(u);if(f!==p&&n.push({...E(f,p),type:"text"}),!l){const e=P(d,u);e&&n.push(e);continue}if(a&&c&&(f===p||b(d,u)))for(const e of w(a,c)){if(e.spacing){const t=C(e);t&&n.push(t);continue}if(f===p)if("attributes"===e.kind){const t=new Map(e.before.attributes),o=new Map(e.after.attributes);for(const e of new Set([...t.keys(),...o.keys()])){const r=t.get(e)??"",i=o.get(e)??"";JSON.stringify(r)!==JSON.stringify(i)&&n.push({type:"attribute",name:e,before:"string"==typeof r?r:JSON.stringify(r),after:"string"==typeof i?i:JSON.stringify(i)})}}else"content"===e.kind&&(v(k(e.before))===v(k(e.after))&&n.push({type:"markup",before:v(k(e.before)),after:v(k(e.after)),oldTag:e.before.tag,newTag:e.after.tag}),(e.before.media||[]).forEach((t,o)=>{const r=e.after.media?.[o];t&&r&&t!==r&&n.push({type:"media",before:t,after:r})}))}}return n}(o.values,r.values),l=function(e,t){if(!e||!t)return!1;const n=(e,t)=>Object.entries(e).some(([e,n])=>"order"!==n?.type&&(!Object.hasOwn(t,e)||n?.type!==t[e]?.type||n?.value!==t[e]?.value));return n(e,t)||n(t,e)}(o.values,r.values),s=!!o.source&&!!r.source,a=!!o.source!=!!r.source,c=[...s?w(o.source,r.source).map(e=>({...e,source:!0})):[],...w(o.dom,r.dom)],d=new Map,h=function(e,t){const n=new Map,o=e=>k(e,n),r=[];for(const n of e){if(n.unresolved)for(const e of u(n,t,o))r.push(e);if("insert"===n.kind&&n.added.length>1){const e=n.added.map(e=>{const r={...n,after:e,added:[e]},i=T(r,t,o);return{...r,input:i}}).filter(e=>e.input);if(e.length){r.push(...e);continue}}const e=T(n,t,o);r.push({...n,input:e})}return r}(c,i).filter(e=>(e.source||!s&&!a||e.input||l&&2===e.priority)&&(e.priority>0||e.input)&&(!e.spacing||function({before:e,after:t},n,o){const r=y(e,n,o),i=y(t,n,o);return r&&i&&r.omitted===i.omitted&&b(r.text,i.text)}(e,d,r.dom?.excluded)));return function(e,t){if(!e.length)return null;const n=e.reduce((e,t)=>Math.max(e,t.input),0),o=e.filter(e=>e.input===n),r=o.reduce((e,t)=>Math.max(e,t.priority),0),i=o.filter(e=>e.priority===r);if(i.some(e=>e.unresolved))return function(e,t){const n=e.find(e=>e.unresolved&&("replacement"===e.regionChange||"reorder"===e.regionChange&&(e.source||t))),o=n?.after.node;if(!o?.isConnected)return null;for(const t of e)if(t.unresolved){if(n.source&&!t.source&&"reorder"===t.regionChange)continue;if(!t.regionChange||t.after.node!==o)return null}else if(!("insert"===t.kind?t.added:[t.after]).every(e=>o.contains(e.node)))return null;return"contents"!==o.ownerDocument.defaultView.getComputedStyle(o).display?o:null}(i,t);const l=i.filter(e=>!e.input||e.directInput||!i.some(t=>t!==e&&e.matches?.length&&e.matches.every(e=>t.matches?.includes(e))&&H(e.after,t.after))),s=new Map,a=l.filter(e=>{const t="delete"===e.kind&&(e.following[0]||e.preceding[0])||e.after,n=t?.node;if(!n)return!0;const o="delete"!==e.kind||e.following.length?e.kind:"delete-last",r=s.get(n)||new Set;return!r.has(o)&&(r.add(o),s.set(n,r),!0)});return n&&s.size>1?null:function(e){const t=new Set,n=new Set;for(const o of e){let e,r=!1;"delete"===o.kind?(r=!o.removed.some(p),e=r?o.after:o.following.find(p)||o.preceding.find(p)||o.following.find(f)||o.preceding.find(f)||o.after):e="insert"===o.kind?o.added.find(p)||o.added.find(f):o.after;const i=f(e);if(!i)continue;const l=p(e),s=l||i;(l&&!r?t:n).add(s)}const o=t.size?t:n;return 1===o.size?o.values().next().value:null}(a)}(h,!s&&(l||function(e,t){return!!e&&!!t&&Object.entries(t).some(([t,n])=>{if("order"!==n?.type||!Object.hasOwn(e,t))return!1;const o=e[t];return"order"===o?.type&&o.members===n.members&&o.value!==n.value})}(o.values,r.values)))}catch{return null}}}}function u(e,t,n){const o=[];for(const r of t){if(!r.after||"spacing"===r.type)continue;const t=V(e.oldRange,r.before,n,r,!0),i=V(e.newRange,r.after,n,r,!1);if(!t.length)continue;const l="markup"===r.type&&r.oldTag===r.newTag;if(l||!r.before||!(t.length<=V(e.newRange,r.before,n,r,!0).length||i.length<=V(e.oldRange,r.after,n,r,!1).length))for(const n of i)l&&!t.some(e=>e.signature!==n.signature)||o.push({...e,unresolved:!1,before:null,after:n,kind:"content",input:r.before&&r.after?2:1,priority:2,matches:[r]})}return o}function f(e){if(e?.node)return e.node;for(const t of e?.children||[]){const e=f(t);if(e)return e}return null}function p(e){const t=e?.node;if(t?.getClientRects().length&&"visible"===t.ownerDocument.defaultView.getComputedStyle(t).visibility)return t;for(const t of e?.children||[]){const e=p(t);if(e)return e}return null}function m(e,t,n,o=e.querySelector('main, [role="main"]')||e.querySelector("article")||e.body){if(!o)return null;const r=n.filter(e=>{if("string"!=typeof e||!e.trim())return!1;try{return o.matches(e),!0}catch{return!1}}).join(", "),i=new Map,l=new Map;if(e!==t)for(const e of t.querySelectorAll("[data-mtflpp-node]")){const t=e.getAttribute("data-mtflpp-node");l.set(t,l.has(t)?null:e)}for(const n of[o,...o.querySelectorAll("*")]){if(r&&n.closest(r))continue;const o=[...n.childNodes].filter(e=>3===e.nodeType).map(e=>e.textContent),s=v(o.join(" ")),a=["img","source","video","audio","iframe"].includes(n.localName)?["src","srcset","poster"].map(e=>n.getAttribute(`data-${e}`)||n.getAttribute(e)||""):[],c=n.style?.backgroundImage||n.getAttribute("data-bg")||"",d=e===t?n:l.get(n.getAttribute("data-mtflpp-node"))||null,u=h(n,d,JSON.stringify([n.localName,s,a,c]));u.text=s,u.rawText=o.join(""),u.media=[...a,c],u.parent=i.get(n.parentElement),i.set(n,u),u.parent?.children.push(u)}for(const[e,t]of i)t.parts=[...e.childNodes].map(e=>3===e.nodeType?e.textContent:i.get(e)).filter(e=>void 0!==e);let s=i.get(o);if(!s)return null;const a=s.node;for(let e=o.parentElement;e;e=e.parentElement){const t=h(e,a,e.localName);t.children=[s],t.parts=[s],s=t}return s.excluded=r,s}function h(e,t,n){const o=function(e){const t=[];for(const{name:n,value:o}of e.attributes){if("data-mtflpp-node"===n||n.startsWith("on")||/(?:^|-)(nonce|token)(?:-|$)/.test(n))continue;if(/^(?:data-)?(?:src|srcset|poster|sizes|bg)$/.test(n))continue;let r=o;"class"===n&&(r=[...e.classList].sort().join(" ")),"style"===n&&(r=[...e.style].sort().map(t=>[t,e.style.getPropertyValue(t),e.style.getPropertyPriority(t)])),("class"!==n&&"style"!==n||r.length)&&t.push([n,r])}return t.sort(([e],[t])=>e.localeCompare(t))}(e);return{node:t,tag:e.localName,signature:n,attributes:o,children:[],parts:[],presentation:JSON.stringify(o.filter(([e])=>!g(e))),references:JSON.stringify(o.filter(([e])=>g(e)))}}function g(e){return["id","for","headers","aria-controls","aria-labelledby","aria-describedby","aria-owns","aria-flowto","aria-activedescendant","aria-details","aria-errormessage"].includes(e)}function w(e,t){const n=new Map,o=new Map,r=new Map,i=new Map,l=[];function s(e){const t=JSON.stringify(e);return n.has(t)||n.set(t,n.size+1),n.get(t)}function a(e){if(!e)return 0;const t=s([e.signature,e.children.map(a)]);return o.set(e,t),r.set(e,s([t,e.presentation,e.children.map(e=>r.get(e))])),i.set(e,s([t,e.presentation,e.references,e.children.map(e=>i.get(e))])),t}a(e),a(t);const c=e=>o.get(e);function d(e){const t=e.attributes.find(([e])=>"id"===e)?.[1];return t?`${e.tag} ${t}`:void 0}function u(e){if(!(e.children.length<2))return s(["collection",e.signature,e.children.map(c).sort((e,t)=>e-t)])}function f(e,t){const n=new Map;return e.forEach((e,o)=>{const r=t(e);void 0!==r&&n.set(r,n.has(r)?-1:o)}),n}return function e(t,n){t&&n&&(t.signature!==n.signature?l.push({kind:"content",before:t,after:n,priority:2}):t.rawText!==n.rawText&&l.push({kind:"content",before:t,after:n,priority:2,spacing:!0}),t.presentation===n.presentation&&t.references===n.references||l.push({kind:"attributes",before:t,after:n,priority:t.presentation!==n.presentation?1:0}),function(t,n,s,a){const p=a.parent&&s.parent&&a.tag===s.tag,m=f(t,c),h=f(n,c);let g,w,v,b;const y=new Set(t.flatMap(e=>[r.get(e),i.get(e)])),x=new Set(n.flatMap(e=>[r.get(e),i.get(e)]));function M(e,t,n){const o=n.get(e),r=n.get(t);return o===r||!x.has(o)&&!y.has(r)}function C(e,t){return o.get(e)===o.get(t)&&M(e,t,r)&&M(e,t,i)}function P(e,r,i,s,c){const d=t.slice(e,r),u=n.slice(i,s),f="replacement"===c&&p&&d.some(e=>!h.has(o.get(e)))&&u.some(e=>!m.has(o.get(e)))&&(!function(e,t){if(e.length<2||t.length<2)return!1;const n=e.filter(e=>e.children.length).length,o=t.filter(e=>e.children.length).length;if(!n&&!o||n>1&&o>1)return!0;const r=new Map;for(const{tag:e}of t)r.set(e,(r.get(e)||0)+1);let i=0;for(const{tag:t}of e){const e=r.get(t);if(e){if(2===++i)return!0;r.set(t,e-1)}}return!1}(d,u)||"form"===a.tag&&function(e,t){function n(e){const t=new Set;return e.every(function e(n){if(["input","select","textarea"].includes(n.tag)){const e=n.attributes.find(([e])=>"name"===e)?.[1],o=n.attributes.find(([e])=>"type"===e)?.[1]?.toLowerCase();return!(!e||"input"===n.tag&&"hidden"===o||(t.add(e),0))}let o=!1;for(const t of n.children)e(t)&&(o=!0);return o})?t:null}const o=n(e),r=n(t);return o&&r&&[...o].some(e=>!r.has(e))&&[...r].some(e=>!o.has(e))}(d,u)),g=p&&("reorder"===c||f)?c:void 0;l.push({kind:"region",after:a,priority:2,unresolved:!0,regionChange:g,oldRange:d,newRange:u})}function k(e,n,o,r,i,l,s){const a=[];for(let c=e;c<n;c++){const e=s(t[c]),n=l.get(e);if(!(i.get(e)!==c||void 0===n||n<o||n>=r)){if(a.length&&n<=a[a.length-1][1])return null;a.push([c,n])}}return a}!function r(i,s,y,x){for(;i<s&&y<x&&C(t[i],n[y]);)e(t[i],n[y]),i++,y++;for(;i<s&&y<x&&C(t[s-1],n[x-1]);)s--,x--,e(t[s],n[x]);if(i===s&&y===x)return;if(i===s||y===x){const e=y===x,r=e?t.slice(i,s):n.slice(y,x),c=e?[n[y-1],n[y]]:[t[i-1],t[i]];return void(r.some(e=>c.some(t=>t&&o.get(t)===o.get(e)))?P(i,s,y,x):e?l.push({kind:"delete",after:a,removed:r,priority:2,following:n.slice(y),preceding:n.slice(0,y).reverse()}):l.push({kind:"insert",after:r[0],added:r,priority:2}))}if(s-i===1&&x-y===1)return void e(t[i],n[y]);if(p&&function(e,r,i,l){const s=r-e;if(s<2||s!==l-i)return!1;const a=new Map;let c=!1;for(let r=0;r<s;r++){const l=o.get(t[e+r]),s=o.get(n[i+r]);c||=l!==s,a.set(l,(a.get(l)||0)+1),a.set(s,(a.get(s)||0)-1)}return c&&[...a.values()].every(e=>0===e)}(i,s,y,x))return void P(i,s,y,x,"reorder");let M=k(i,s,y,x,m,h,c);if(0===M?.length&&(g??=f(t,d),w??=f(n,d),M=k(i,s,y,x,g,w,d)),0===M?.length&&(v??=f(t,u),b??=f(n,u),M=k(i,s,y,x,v,b,u)),M?.length)for(const[o,l]of[...M,[s,x]])r(i,o,y,l),o<s&&e(t[o],n[l]),i=o+1,y=l+1;else P(i,s,y,x,M?"replacement":void 0)}(0,t.length,0,n.length)}(t.children,n.children,t,n))}(e,t),l}function v(e){return e.replace(/\s+/g," ").trim()}function b(e,t){return e!==t&&e.replace(/\s/g,"")===t.replace(/\s/g,"")}function y(e,t,n){for(;e.node?.isConnected&&e.parent?.node;){const{display:t}=e.node.ownerDocument.defaultView.getComputedStyle(e.node);if("inline"!==t&&"contents"!==t)break;e=e.parent}if(!t.has(e)){const{node:o}=e,r=[],i=o?.isConnected&&x(o,n,r)===M(e)&&p(e)?o.innerText:void 0;t.set(e,"string"==typeof i?{text:i,omitted:JSON.stringify(r)}:void 0)}return t.get(e)}function x(e,t,n){return t&&e.querySelector(t)?[...e.childNodes].map(e=>3===e.nodeType?e.textContent:1!==e.nodeType?"":e.matches(t)?(n.push(e.textContent),""):x(e,t,n)).join(""):e.textContent}function M(e){return e.parts.map(e=>"string"==typeof e?e:M(e)).join("")}function C({before:e,after:t}){return P(e.rawText,t.rawText)||P(M(e),M(t))}function P(e,t){if(!/\S/.test(e)||!b(e,t))return;const n=e.match(/\s+|\S+/g),o=t.match(/\s+|\S+/g);let r=0,i=0;for(;r<Math.min(n.length,o.length)&&n[r]===o[r];)r++;for(;i<Math.min(n.length,o.length)-r&&n.at(-1-i)===o.at(-1-i);)i++;const l=Math.max(0,r-1),s=Math.max(0,i-1);return{type:"spacing",before:n.slice(l,n.length-s).join(""),after:o.slice(l,o.length-s).join("")}}function k(e,t=new Map){return e?(t.has(e)||t.set(e,(e.parts||[]).map(e=>{if("string"==typeof e)return e;const n=k(e,t);return/^(?:p|div|section|article|main|aside|header|footer|nav|h[1-6]|li|[ou]l|d[ldt]|blockquote|pre|table|tr|t[dh]|caption|figure|figcaption|br|hr)$/.test(e.tag)?` ${n} `:n}).join("")),t.get(e)):""}function E(e,t){let n=0,o=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;for(;o<e.length-n&&o<t.length-n&&e[e.length-o-1]===t[t.length-o-1];)o++;let r=e.length-o,i=t.length-o;for(;n>0&&/\S/.test(e[n-1]);)n--;if(r>n&&/\S/.test(e[r-1]))for(;r<e.length&&/\S/.test(e[r]);)r++;if(i>n&&/\S/.test(t[i-1]))for(;i<t.length&&/\S/.test(t[i]);)i++;return{before:e.slice(n,r).trim(),after:t.slice(n,i).trim()}}function S(e,t){return t?L(e,t):""===v(e)}function L(e,t){if(!t)return!1;let n=(e=v(e)).indexOf(t);for(;-1!==n;){const o=n+t.length;if(!(n&&/[\p{L}\p{N}_]/u.test(e[n-1])&&/[\p{L}\p{N}_]/u.test(t[0])||o!==e.length&&/[\p{L}\p{N}_]/u.test(e[o])&&/[\p{L}\p{N}_]/u.test(t.at(-1))))return!0;n=e.indexOf(t,n+1)}return!1}function V(e=[],t,n,o,r){return e.flatMap(e=>{const i=V(e.children,t,n,o,r);let l;return l="media"===o.type?e.media?.includes(t):"attribute"===o.type?e.attributes.some(([e,n])=>e===o.name&&L("string"==typeof n?n:JSON.stringify(n),t)):("markup"!==o.type||e.tag===(r?o.oldTag:o.newTag))&&S(n(e),t),"text"===o.type&&i.length?i:[...l?[e]:[],...i]})}function T(e,t,n){if(e.unresolved)return 0;if(e.matches=[],e.spacing){const n=t.filter(e=>"spacing"===e.type),o=n.length&&C(e);return e.matches=n.filter(e=>o?.before===e.before&&o?.after===e.after),e.matches.length?2:0}let o=0;for(const r of t){if("spacing"===r.type)continue;let t=0;if("attributes"===e.kind){if(!["text","attribute"].includes(r.type))continue;const n=r,o=new Map(e.before.attributes),i=new Map(e.after.attributes);for(const e of new Set([...o.keys(),...i.keys()])){if("attribute"===r.type&&e!==r.name)continue;const l=o.get(e),s=i.get(e);if(JSON.stringify(l)===JSON.stringify(s))continue;const a="string"==typeof l?l:JSON.stringify(l)||"",c="string"==typeof s?s:JSON.stringify(s)||"";S(a,n.before)&&S(c,n.after)&&(t="attribute"===r.type||r.before&&r.after?2:1)}}else"insert"===e.kind?!r.before&&e.added.some(e=>L(n(e),r.after))&&(t=Math.max(t,1)):"delete"===e.kind?!r.after&&e.removed.some(e=>L(n(e),r.before))&&(t=Math.max(t,1)):"media"===r.type?(e.before?.media||[]).some((t,n)=>t===r.before&&e.after?.media?.[n]===r.after)&&(t=2):"attribute"!==r.type&&("markup"!==r.type||e.before?.tag===r.oldTag&&e.after?.tag===r.newTag)&&S(n(e.before),r.before)&&S(n(e.after),r.after)&&(t=r.before&&r.after?2:1,"text"===r.type&&L(e.before?.text||"",r.before)&&L(e.after?.text||"",r.after)&&(e.directInput=!0));t&&e.matches.push(r),o=Math.max(o,t)}return o}function H(e,t){return!!e?.children.some(e=>e===t||e.node&&e.node===t?.node||H(e,t))}const j=new Set(["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","PageDown","PageUp","Home","End"," "]);function O(e,t){let n;for(const o of e?.rects??[]){const e=t(o);if(e.visible)return e;(!n||e.distance<n.distance)&&(n=e)}return n}function R(e){return new Promise(t=>{const n=()=>{e.clearTimeout(o),e.cancelAnimationFrame(r),t()},o=e.setTimeout(n,100);let r=e.requestAnimationFrame(()=>{r=e.requestAnimationFrame(n)})})}function N(e,t=!1){if(!q(e,{visibilityProperty:!0,opacityProperty:!0}))return;const{left:n,right:o,top:r,bottom:i,width:l,height:s}=e.getBoundingClientRect();if(!(t||l&&s))return;const a=e.ownerDocument,{documentElement:c,body:d,defaultView:u}=a,f={left:n,right:l?o:n+1,top:r,bottom:s?i:r+1},p={...f},m={x:f.right-f.left,y:f.bottom-f.top},h="visible"===u.getComputedStyle(c).overflow,g=u.getComputedStyle(e);for(let n=e;n&&n!==c;){const o=n===e?g:u.getComputedStyle(n),{position:r,display:i,overflowX:l,overflowY:s}=o;if(n!==e&&(n!==d||!h)&&"inline"!==i&&("visible"!==l||"visible"!==s)&&n.offsetWidth&&n.offsetHeight){const{bounds:e,scaleX:r,scaleY:i}=W(n,o);for(const[a,c,d,u,h]of[["x",l,"left","right",r],["y",s,"top","bottom",i]]){if("visible"===c)continue;const r="clip"===c?[0,0]:A(n,o,a,h),i=t&&"hidden"===c,l="y"===a==("horizontal-tb"===o.writingMode);if(i&&r.some(e=>e)&&(l||f[d]<e[d]||f[u]>e[u]||$(o,g,a)))return{boundary:n};if(!B(f,p,e,d,u,i?[0,0]:r))return{boundary:n};m[a]=Math.min(m[a],p[u]-p[d])}}n="absolute"===r||"fixed"===r?n.offsetParent:n.parentElement}return{clipped:f,extent:m}}function $(e,t,n){const o=e=>e&&"auto"!==e&&0!==parseFloat(e);return("x"===n?["Left","Right"]:["Top","Bottom"]).some(n=>o(e[`scrollPadding${n}`])||o(t[`scrollMargin${n}`]))}function D(e,t,n=!1){const o=N(e,n);if(!o?.clipped)return;const{clipped:r,extent:i}=o,{ownerDocument:l}=e,s=l.documentElement;if(r.left=Math.max(s.clientLeft,r.left),r.right=Math.min(s.clientLeft+s.clientWidth,r.right),r.top=Math.max(0,r.top),r.bottom=Math.min(s.clientHeight,r.bottom),r.right<=r.left)return{rects:[]};const a=t?.({...r,top:0,bottom:s.clientHeight}),c=a?.visibleCenterX??(r.left+r.right)/2,d=X(e,c);if(r.bottom<=r.top)return{rects:[],header:d?.bottom};const u={rects:[r],inViewport:!0,extent:i};if(!d)return u;const f={left:Math.max(r.left,d.left),right:Math.min(r.right,d.right),top:Math.max(r.top,d.top),bottom:Math.min(r.bottom,d.bottom)};if(!F(f)||!d.node.contains(l.elementFromPoint(c,(f.top+f.bottom)/2)))return u;const p=[{...r,top:f.bottom},{...r,bottom:f.top},{...f,left:r.left,right:f.left},{...f,left:f.right,right:r.right}].filter(F);return!p.length&&d.bottom>=s.clientHeight&&d.top<=0?void 0:{rects:p,inViewport:!0,extent:i,header:d.bottom}}function F({left:e,right:t,top:n,bottom:o}){return t>e&&o>n}function B(e,t,n,o,r,[i,l]){return e[o]=Math.max(e[o],n[o]),e[r]=Math.min(e[r],n[r]),t[o]=Math.max(n[o],t[o]+i),t[r]=Math.min(n[r],t[r]+l),t[r]>t[o]}function A(e,t,n,o){const r="x"===n,i=r?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight;if(i<=0)return[0,0];const l=r?e.scrollLeft:e.scrollTop,s=t.display.endsWith("flex")&&t.flexDirection===(r?"row-reverse":"column-reverse"),a=(r&&"rtl"===t.direction)!==s;let c=a?-i:0,d=a?0:i;return("horizontal-tb"!==t.writingMode||l<c||l>d)&&(c=-i,d=i),[(l-d)*o,(l-c)*o]}function W(e,t){const n=e.getBoundingClientRect(),o=n.width/e.offsetWidth,r=n.height/e.offsetHeight,i=n.left+e.clientLeft*o,l=n.top+e.clientTop*r,s={left:i,top:l,right:i+e.clientWidth*o,bottom:l+e.clientHeight*r},a=t.overflowClipMargin;if("clip"!==t.overflowX&&"clip"!==t.overflowY||!a||"0px"===a)return{bounds:s,scaleX:o,scaleY:r};const c=a.split(" ").map(parseFloat).find(Number.isFinite)??0,d=a.includes("border-box")?n:s,u=a.includes("content-box");return{scaleX:o,scaleY:r,bounds:{left:d.left+((u?parseFloat(t.paddingLeft):0)-c)*o,right:d.right-((u?parseFloat(t.paddingRight):0)-c)*o,top:d.top+((u?parseFloat(t.paddingTop):0)-c)*r,bottom:d.bottom-((u?parseFloat(t.paddingBottom):0)-c)*r}}}function q(e,t={visibilityProperty:!0}){return!!e?.isConnected&&!!e.getClientRects().length&&(!e.checkVisibility||e.checkVisibility(t))&&"visible"===e.ownerDocument.defaultView.getComputedStyle(e).visibility}function z(e){return e.matchMedia("(prefers-reduced-motion: reduce)").matches?"instant":"smooth"}function Z(e,{behavior:t,header:n=G(e),nearest:o=!1}={}){const r=e.ownerDocument,i=r.defaultView,l=t??z(i);if(o&&!n)return void e.scrollIntoView({behavior:l,block:"nearest",inline:"nearest"});const s=i.getComputedStyle(e).scrollMarginTop,a=r.documentElement,c=a.clientHeight,d=i.getComputedStyle(a),u=_(d.scrollPaddingTop,c),f=_(d.scrollPaddingBottom,c);let p,m;try{let t=o?"nearest":"start";if(o){const e=n-parseFloat(s);null!==u&&e>u&&(p=a.getAttribute("style"),a.style.setProperty("scroll-padding-top",`${e}px`,"important"))}else{const t=n>0&&null!==u?`max(${s}, ${n-u}px)`:s;m=e.getAttribute("style"),e.style.setProperty("scroll-margin-top",`calc(${t} + 1lh)`,"important")}if(!o&&null!==u&&null!==f){const n=i.getComputedStyle(e),o=c-u-f-parseFloat(n.scrollMarginTop)-parseFloat(n.scrollMarginBottom),r=o-e.getBoundingClientRect().height;if(r>=0&&(t="center"),r>0&&"horizontal-tb"===d.writingMode){const e=Math.min(o/3,r);p=a.getAttribute("style"),a.style.setProperty("scroll-padding-bottom",`${f+e}px`,"important")}}e.scrollIntoView({behavior:l,block:t,inline:"nearest"})}finally{void 0!==p&&I(a,p),void 0!==m&&I(e,m)}}function I(e,t){e.setAttribute("style",t??""),null===t&&e.removeAttribute("style")}function _(e,t){if("auto"===e)return 0;const n=parseFloat(e);return Number.isFinite(n)?n*(e.endsWith("%")?t/100:1):null}function G(e){const t=e.getBoundingClientRect();return X(e,t.left+t.width/2)?.bottom??0}function X(e,t){const n=e.ownerDocument;for(let o=n.elementFromPoint(t,1);o&&!o.contains(e);o=o.parentElement){const e=n.defaultView.getComputedStyle(o);if("fixed"!==e.position&&"sticky"!==e.position)continue;if("0"===e.opacity||!q(o,{visibilityProperty:!0,opacityProperty:!0}))continue;const{left:t,right:r,top:i,bottom:l}=o.getBoundingClientRect();if("fixed"===e.position||i<=parseFloat(e.top)+1)return{node:o,left:t,right:r,top:i,bottom:l}}}window.jQuery(()=>{const e=window.meetTheFrontendLivePreviewPanel;if(e)try{const t=window.wp?.revisions?.view?.frame?.model;if(!t||"function"!=typeof t.get||"function"!=typeof t.on||"function"!=typeof t.off)throw new Error("The native revision selection is unavailable.");const n=document.querySelector("#wpbody-content > .wrap > h1.long-header + a");if(!n)throw new Error("The native revision header is unavailable.");!function(e,t,n){const{strings:o}=e;let r,i=t.get("to"),l=0;const s=n.ownerDocument,a=s.getElementById("mtflpp-toggle");a.classList.replace("mtflpp-launcher","mtflpp-inline-launcher");const u=s.createElement("button");u.type="button",u.className="button-link",u.textContent=o.previewRevision,u.setAttribute("aria-controls","mtflpp-panel"),a.append(u),n.after(a);const f=c(o,{postTitle:m(i),publicRedirect:e.publicRedirect,inlineLauncher:u,canRememberVisibility:!1,onOpen(){f.setVisible(!0),g()},onClose:v,onRefresh:g,onRetry:()=>g(),beforeViewportChange:e=>p.beforeViewportChange(e),beforeMove(){l++,p.clear()},afterMove(){f.visible&&g()}}),p=function(e,t,n,o,r=[]){const i=d(r);let l,s,a,c,u;function f(){u?.()}return{get hasPreview(){return!!l},get hasHtmlPreview(){return!!s},get redirectDestination(){return c},load:function(r,d,p=()=>!1,m){const h=new URL(r);if("https:"!==h.protocol&&"http:"!==h.protocol)throw Object.assign(new Error(n.failed),{code:"mtflpp_preview_unsupported_url"});if(h.origin!==window.location.origin){const e=n.originMismatch.replace("%s",()=>h.origin+h.pathname);throw Object.assign(new Error(e),{code:"mtflpp_preview_origin_mismatch"})}const g=h.searchParams.get("mtflpp_token");if(!g)throw new Error(n.failed);return window.crossOriginIsolated&&h.searchParams.set("mtflpp_isolated","1"),f(),h.searchParams.delete("mtflpp_source"),e.followChanges&&h.searchParams.set("mtflpp_source","1"),o(n.updating),new Promise((r,f)=>{const w=e.stage.ownerDocument.createElement("iframe");w.title=n.title,w.className="mtflpp-frame mtflpp-loading",w.setAttribute("aria-hidden","true"),w.setAttribute("tabindex","-1"),w.referrerPolicy="same-origin";let v=!1,b=!1;const y=setTimeout(()=>M(new Error(n.failed)),3e4),x=()=>{b=!0,M()};function M(e){v||(v=!0,e&&(b=!0),clearTimeout(y),u===x&&(u=null),w!==l&&(w.onload=null,w.onerror=null,w.remove()),e?f(e):r())}u=x,w.onload=async()=>{const r=w!==l;if(r||(s=null,a=null),b||!d())return void M();let u,f,v;try{const e=w.contentDocument,t=e?.querySelector('meta[name="meet-the-frontend-live-preview-panel"]');t?.content===g?u=e:r&&!t&&(f=function(e,t){if("text/html"!==e?.contentType)return;const n=e.defaultView?.performance.getEntriesByType("navigation")[0];if(!(n?.redirectCount>0))return;const o=new URL(n.name);return o.origin!==t.origin||o.pathname===t.pathname&&o.search===t.search?void 0:o.pathname}(e,h))}catch{}u&&(e.followChanges&&i.capture(u,r?m:void 0),u.documentElement.style.setProperty("overscroll-behavior","contain","important")),u&&r&&(t.remember(s),e.followChanges&&p()&&s&&(v=i.findChange(s,u))),r&&l&&(l.onload=null,l.onerror=null,l.remove()),l=w,s=u,a=null,c=f,w.classList.remove("mtflpp-loading"),w.removeAttribute("aria-hidden"),w.removeAttribute("tabindex");const y=()=>!b&&d()&&w===l&&u===s&&(!u||w.contentDocument===u);let x;if(u&&r){const n=e.canvasTarget&&(t=>e.canvasTarget(w,t,{fitTarget:!0}));x=await t.restore(u,v,()=>y()&&e.followChanges&&p(),n)}y()?(a=x,o(n.current,"ready"),M()):M()},w.onerror=()=>{w===l?(s=null,a=null,c=void 0,d()&&o(n.failed,"error")):M(new Error(n.failed))},w.src=h.href,e.stage.append(w)})},cancel:f,beforeViewportChange({canvasTarget:n,canFollow:o,...r}){const i=a,c=s,d=l;if(i&&c)return t.keepInView(i,{...r,canvasTarget:e=>n(d,e),canFollow:()=>i===a&&c===s&&d.contentDocument===c&&e.visible&&e.followChanges&&o()})},clear(){f(),t.remember(s),l&&(l.onload=null,l.onerror=null),l=null,s=null,a=null,c=void 0,e.clearPreview()}}}(f,function(){let e,t=0,n=0;return{remember(e){try{e&&(t=e.defaultView.scrollY)}catch{}},async restore(e,o,r=()=>!0,i){const l=++n;try{const s=e.defaultView;let a;if(s.scrollTo({top:t,left:0,behavior:"instant"}),o?.ownerDocument===e&&r()){if(await R(s),l!==n||o.ownerDocument!==e||!r())return;if(function(e,t){const n=e.ownerDocument;for(let t=e;t;t=t.parentElement)if("until-found"!==t.getAttribute("hidden")?.toLowerCase()&&(t.hasAttribute("hidden")||"none"===n.defaultView.getComputedStyle(t).display))return!1;let o=!1;for(let r=e;r&&e.isConnected&&e.ownerDocument===n&&t();r=r.parentElement){if("until-found"===r.getAttribute("hidden")?.toLowerCase()){if(r.dispatchEvent(new n.defaultView.Event("beforematch",{bubbles:!0})),!(e.isConnected&&e.ownerDocument===n&&r.isConnected&&r.ownerDocument===n&&r.contains(e)&&t()))break;"until-found"===r.getAttribute("hidden")?.toLowerCase()&&r.removeAttribute("hidden"),o=!0}const i=r.parentElement;i instanceof n.defaultView.HTMLDetailsElement&&!i.open&&r!==Array.from(i.children).find(e=>"summary"===e.localName)&&(i.open=!0,o=!0)}return o}(o,()=>l===n&&r())&&await new Promise(e=>s.setTimeout(e,0)),l!==n||!r())return;const t=o.ownerDocument===e?function(e){if(!e?.isConnected)return null;const t=N(e,!0);if(t?.clipped)return e;if(!t?.boundary)for(const t of e.querySelectorAll("*"))if(N(t,!0)?.clipped)return t;for(let n=t?.boundary||e.parentElement;n;){const e=N(n,!0);if(e?.clipped)return n;n=e?.boundary||n.parentElement}return null}(o):null;t&&(function(e,t){const n=D(e,t,!0);if(!n?.inViewport)return void Z(e);const{rects:o,extent:r,header:i=0}=n,l=e.ownerDocument.documentElement,s=Math.min(r.x,l.clientWidth),a=Math.min(r.y,l.clientHeight-i);o.some(e=>e.right-e.left>=s-1&&e.bottom-e.top>=a-1)?t&&O(n,t)?.reveal(z(e.ownerDocument.defaultView)):Z(e,{nearest:!0,header:i})}(t,i),o.contains(t)&&(a=t))}return t=s.scrollY,a}catch{}},keepInView(t,{canvas:n,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:l,canFollow:s}){try{const a=e?.target===t&&e.canFollow();if(e?.cancel(),!t.isConnected||!s())return;if(!a){const e=D(t,o);if(!O(e,o)?.visible)return}const c=new AbortController,d={target:t,canFollow:()=>!c.signal.aborted&&s(),cancel(){c.abort(),e===d&&(e=null)}};return e=d,function(e,t,n,o,r){const i=e=>{e.isTrusted&&("keydown"!==e.type||j.has(e.key))&&r()},l={capture:!0,passive:!0,signal:o};for(const n of[e,t])for(const e of["wheel","touchmove","pointerdown","keydown"])n?.addEventListener(e,i,l);t?.addEventListener("scroll",()=>{n?.()&&r()},l)}(t.ownerDocument.defaultView,n,l,c.signal,()=>{d.cancel(),i?.()}),async function(e,t,n,o){try{const r=e.ownerDocument.defaultView;if(await R(r),!o())return;const{scrollX:i,scrollY:l}=r,s=n();if(s&&await s,!o()||r.scrollX!==i||r.scrollY!==l)return;let a=D(e,t);a&&!a.rects.length&&(Z(e,{behavior:"instant",header:a.header}),a=D(e,t)),O(a,t)?.reveal()}catch{}}(t,o,r,d.canFollow).finally(d.cancel)}catch{}}}}(),o,h,e.comparisonExcludedSelectors);function m(t){if(!t)return"";const n=t.get("dateShort")||t.get("date")||"",r=t.get("author")?.name||"",i=o.revisionLabel.replace("%1$s",()=>n).replace("%2$s",()=>r);return t.id===e.postId?`${o.currentVersion} — ${i}`:i}function h(e,t="loading",n={}){"ready"!==t&&p.hasPreview||f.setTitle(m(i)),f.report(e,t,{hasPreview:p.hasPreview,hasHtmlPreview:p.hasHtmlPreview,redirectDestination:p.redirectDestination,canRefresh:f.visible&&["ready","error"].includes(t),...n})}async function g(t=!0){clearTimeout(r),p.cancel();const n=++l;if(!f.visible)return;const s=i?.id===e.postId?e.currentPreviewUrl:i?.get("mtflppPreviewUrl");if("string"!=typeof s||!s)return p.clear(),void h(o.unavailable,"error",{canRetry:!1,canRefresh:!1,reason:"unavailable"});try{await p.load(s,()=>f.visible&&n===l,()=>f.followChanges&&t,{revision:{type:"value",value:i.id}})}catch(e){if(f.visible&&n===l){const t={mtflpp_preview_origin_mismatch:"origin-mismatch",mtflpp_preview_unsupported_url:"unsupported-url"}[e?.code]||"";h("origin-mismatch"===t?e.message:o.failed,"error",{canRetry:!t,canRefresh:!t,reason:t})}}}function w(){const e=t.get("to");e?.id!==i?.id&&(i=e,l++,p.cancel(),clearTimeout(r),f.visible&&(h(o.stale,"stale"),r=setTimeout(g,250)))}function v(){l++,clearTimeout(r),f.setVisible(!1),p.clear(),f.returnToEditor()}t.on("update:revisions",w),window.addEventListener("pagehide",e=>{e.persisted||(t.off("update:revisions",w),v())}),f.visible&&g()}(e,t,n)}catch(t){!function(e,t){document.getElementById("mtflpp-panel")?.remove(),document.getElementById("mtflpp-toggle")?.remove(),document.getElementById("mtflpp-publish-preview")?.remove(),document.getElementById("mtflpp-term-preview")?.remove();const n=document.createElement("div");n.className="notice notice-error",n.setAttribute("role","alert");const o=document.createElement("p");o.textContent=e,n.append(o),(document.getElementById("wpbody-content")||document.body).prepend(n),console.error("Meet the Frontend – Live Preview Panel could not start.",t)}(e.strings.bootFailed,t)}})})();
     1(()=>{"use strict";const e=window.wp.data,t=window.wp.preferences,n=window.wp.element,o=window.wp.components,r=window.wp.notices,i=window.wp.primitives,l=window.ReactJSXRuntime,s={refresh:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M12 5.5L17.7929 11.2929C18.1834 11.6834 18.1834 12.3166 17.7929 12.7071L16 14.5M16 5.5H12V9.5M12 18.5L6.20711 12.7071C5.81658 12.3166 5.81658 11.6834 6.20711 11.2929L8 9.5M8 18.5H12V14.5"})}),more:(0,l.jsxs)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,l.jsx)(i.Path,{d:"M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z",fill:"currentColor",stroke:"none"}),(0,l.jsx)(i.Path,{d:"M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z",fill:"currentColor",stroke:"none"}),(0,l.jsx)(i.Path,{d:"M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z",fill:"currentColor",stroke:"none"}),(0,l.jsx)(i.Path,{d:"M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z"}),(0,l.jsx)(i.Path,{d:"M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z"}),(0,l.jsx)(i.Path,{d:"M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z"})]}),expand:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M4.75 10V4.75H10M4.75 4.75L10 10M14 19.25H19.25V14M19.25 19.25L14 14"})}),compact:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M10 4.75V10H4.75M10 10L4.75 4.75M19.25 14H14V19.25M14 14L19.25 19.25"})}),pip:(0,l.jsxs)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,l.jsx)(i.Path,{d:"M4.75 9.25V16C4.75 16.6904 5.30964 17.25 6 17.25H8M4.75 9.25V6C4.75 5.30964 5.30964 4.75 6 4.75H16C16.6904 4.75 17.25 5.30964 17.25 6V8M4.75 9.25H8"}),(0,l.jsx)(i.Path,{d:"M10.75 11.25C10.75 10.9739 10.9739 10.75 11.25 10.75H18.75C19.0261 10.75 19.25 10.9739 19.25 11.25V18.75C19.25 19.0261 19.0261 19.25 18.75 19.25H11.25C10.9739 19.25 10.75 19.0261 10.75 18.75V11.25Z",fill:"currentColor"})]}),move:(0,l.jsxs)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,l.jsx)(i.Path,{d:"M9.25 5.75H8.75V6.25H9.25V5.75Z",fill:"currentColor",stroke:"none"}),(0,l.jsx)(i.Path,{d:"M9.25 11.75H8.75V12.25H9.25V11.75Z",fill:"currentColor",stroke:"none"}),(0,l.jsx)(i.Path,{d:"M9.25 17.75H8.75V18.25H9.25V17.75Z",fill:"currentColor",stroke:"none"}),(0,l.jsx)(i.Path,{d:"M15.25 5.75H14.75V6.25H15.25V5.75Z",fill:"currentColor",stroke:"none"}),(0,l.jsx)(i.Path,{d:"M15.25 11.75H14.75V12.25H15.25V11.75Z",fill:"currentColor",stroke:"none"}),(0,l.jsx)(i.Path,{d:"M15.25 17.75H14.75V18.25H15.25V17.75Z",fill:"currentColor",stroke:"none"}),(0,l.jsx)(i.Path,{d:"M9.25 5.75H8.75V6.25H9.25V5.75Z"}),(0,l.jsx)(i.Path,{d:"M9.25 11.75H8.75V12.25H9.25V11.75Z"}),(0,l.jsx)(i.Path,{d:"M9.25 17.75H8.75V18.25H9.25V17.75Z"}),(0,l.jsx)(i.Path,{d:"M15.25 5.75H14.75V6.25H15.25V5.75Z"}),(0,l.jsx)(i.Path,{d:"M15.25 11.75H14.75V12.25H15.25V11.75Z"}),(0,l.jsx)(i.Path,{d:"M15.25 17.75H14.75V18.25H15.25V17.75Z"})]}),warning:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M12 8L12 13M12 14.5L12 16M4.75 12C4.75 7.99593 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12Z",strokeLinejoin:"round"})}),info:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M12 16V11M12 9.5V8M19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12C4.75 7.99594 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12Z",strokeLinejoin:"round"})}),close:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M7.75 16.25L16.25 7.75M16.25 16.25L7.75 7.75"})}),check:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M7 12L10 15L17 8"})}),chevron:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M7 11L12 15L17 11"})}),desktop:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M4.75 16.75V17H3.25C3.11193 17 3 17.1119 3 17.25H21C21 17.1119 20.8881 17 20.75 17H19.25V16.75M4.75 16.75V8.5C4.75 7.80964 5.30964 7.25 6 7.25H18C18.6904 7.25 19.25 7.80964 19.25 8.5V16.75M4.75 16.75H19.25"})}),tablet:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M10 16.5H14M18.25 18V6C18.25 5.30964 17.6904 4.75 17 4.75H7C6.30964 4.75 5.75 5.30964 5.75 6L5.75 18C5.75 18.6904 6.30964 19.25 7 19.25H17C17.6904 19.25 18.25 18.6904 18.25 18Z"})}),mobile:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M11 16.5H13M16.25 18V6C16.25 5.30964 15.6904 4.75 15 4.75H9C8.30964 4.75 7.75 5.30964 7.75 6L7.75 18C7.75 18.6904 8.30964 19.25 9 19.25H15C15.6904 19.25 16.25 18.6904 16.25 18Z"})})};function a(e,t,n="right"){const o=e&&!Array.isArray(e)&&e.bounds&&["x","y","width","height"].every(t=>Number.isFinite(e.bounds[t]))&&e.bounds.width>0&&e.bounds.height>0&&[null,"left","center","right"].includes(e.dock)&&"boolean"==typeof e.expanded&&(void 0===e.anchor||["left","center","right"].includes(e.anchor));let r=!!o&&e.expanded;const i={width:480,height:393},l=o?{...e.bounds}:{x:0,y:0,...i};let s=o?e.dock:n,a=s||o&&e.anchor||"right";function c(){return"left"===a?0:"center"===a?.5:1}function u(e,n=t(!s),o=320,r=220){return e.width=Math.min(n.width,Math.max(Math.min(o,n.width),e.width)),e.height=Math.min(n.height,Math.max(Math.min(r,n.height),e.height)),e.x=Math.max(n.left,Math.min(n.right-e.width,e.x)),e.y=Math.max(n.top,Math.min(n.bottom-e.height,e.y)),e}function d(e){if(!s)return e;const n=t();return e.x="left"===s?n.left:"center"===s?n.left+(n.width-e.width)/2:n.right-e.width,e.y=n.bottom-e.height,e}return{area:t,compactRect:function(){return d(u({...l}))},launcherRect:function(e){return d(u({...e,x:l.x+(l.width-e.width)*c(),y:l.y+l.height-e.height},t(!s),1,1))},usableEdge:function(e){return!(s&&(e.includes("s")||"left"===s&&e.includes("w")||"right"===s&&e.includes("e")))},get anchor(){return a},get anchorFactor(){return c()},get dock(){return s},get expanded(){return r},get layout(){return{bounds:{...l},dock:s,anchor:a,expanded:r}},toggleExpanded(){r=!r},dockTo:function(e="right",t=!1){t&&Object.assign(l,i),r=!1,a=s=e},resize(e,n,o,r){Object.assign(l,function(e,n,o,r){const i=t(!s),l=n.includes("e")||n.includes("w"),c=n.includes("n")||n.includes("s"),u=function(e){return"center"===a?.5:e.includes("w")?1:0}(n),d=e.x+e.width*u,f=n.includes("n"),p=e.y+(f?e.height:0),m=function(e,t,n){return 0===n?e.right-t:1===n?t-e.left:2*Math.min(t-e.left,e.right-t)}(i,d,u),h=f?p-i.top:i.bottom-p,g=(n.includes("w")?-o:o)*(.5===u?2:1),w=Math.max(Math.min(320,m),Math.min(m,e.width+g)),v=Math.max(Math.min(220,h),Math.min(h,e.height+(f?-r:r))),y=l&&0!==o&&w!==e.width,b=c&&0!==r&&v!==e.height,x=f?p-v:p;return{x:y?d-w*u:e.preferredBounds.x,y:b?x:e.preferredBounds.y,width:y?w:e.preferredBounds.width,height:b?v:e.preferredBounds.height}}(e,n,o,r))},move:function(e,n,o,r=!1){const i=u({...e,x:e.x+n,y:e.y+o},t(!0),r?1:320,r?1:220);l.x=i.x+(r?(i.width-l.width)*c():0),l.y=i.y+(r?i.height-l.height:0),s=null}}}function c(i,{postTitle:l="",publicRedirect:c,inlineLauncher:u,nativeLauncher:d,canRememberVisibility:f=!0,onOpen:p,onClose:m,onRefresh:h,onRetry:g,beforeMove:w,afterMove:v,beforeViewportChange:y}){const b=window,x=document,M="meet-the-frontend-live-preview-panel",C=(0,e.select)(t.store),k=(0,e.dispatch)(t.store),P="width"===C.get(M,"fit")?"width":"automatic";k.setDefaults(M,{rememberVisibility:!0,rememberPosition:!0,panelOpen:!0,scrollToChanges:!0,viewport:"desktop",fitMode:P,customZoom:100,tabletOrientation:"portrait",mobileOrientation:"portrait"});const S=()=>!u&&(!d||d.fallbackMedia.matches);let E=!1!==C.get(M,"rememberVisibility"),L=!1!==C.get(M,"rememberPosition"),V=!1!==C.get(M,"scrollToChanges");const T=u?.parentElement??x.getElementById("mtflpp-toggle"),H=x.getElementById("mtflpp-panel");if(!T||!H)throw new Error("Preview panel markup is missing.");const O=u||function(e){let t;const{title:r,moveHelp:i}=e.dataset;return(0,n.flushSync)(()=>(0,n.createRoot)(e).render((0,n.createElement)(o.Button,{ref:e=>{t=e},variant:"secondary",label:r,title:r,description:i,"aria-controls":"mtflpp-panel","aria-expanded":!1},(0,n.createElement)("span",{className:"mtflpp-launcher-label"},r)))),t}(T),R=H.querySelector(".mtflpp-move-control"),j=H.querySelector(".mtflpp-resize"),N=H.querySelectorAll("[data-resize-edge]"),$=H.querySelector(".mtflpp-header"),B=H.querySelector(".mtflpp-caption"),D=H.querySelector(".mtflpp-viewport"),F=H.querySelector(".mtflpp-canvas"),z=H.querySelector(".mtflpp-stage"),A=H.querySelector(".mtflpp-empty"),W=H.querySelector(".mtflpp-devicebar"),q=H.querySelector(".mtflpp-dimensions"),Z=H.querySelector(".mtflpp-feedback"),I=H.querySelector('[role="status"]');let G;const _=function(e,t,n,o={},r=()=>{},i={desktop:"Desktop",tablet:"Tablet",mobile:"Phone"}){const l=e.ownerDocument.defaultView,s=e.querySelector(".mtflpp-canvas"),a=e.querySelector(".mtflpp-canvas-space"),c=n.querySelector(".mtflpp-dimensions-text"),u={desktop:[1280,800],tablet:[768,1024],mobile:[390,844]},d=Object.keys(u);let f=d.includes(o.device)?o.device:"desktop";const p=["automatic","window","width","custom"];let m=p.includes(o.fit)?o.fit:"automatic";const h=e=>Number.isInteger(e)&&e>=10&&e<=400;let g,w=h(o.customZoom)?o.customZoom:100,v=100;const y=e=>"desktop"===e?"landscape":"portrait",b=Object.fromEntries(d.map(e=>[e,"desktop"!==e&&["portrait","landscape"].includes(o[`${e}Orientation`])?o[`${e}Orientation`]:y(e)])),x=()=>b[f]===y(f)?u[f]:[...u[f]].reverse(),M=()=>"width"===m;let C,k,P;const S=l.matchMedia("(prefers-reduced-motion: no-preference)");function E(){const t=e.ownerDocument.defaultView.devicePixelRatio;return Number.isFinite(t)&&t>0?t:1}function L(e,t){if("custom"===m)return w/100/E();const n=s.clientWidth/e;if(M())return n;const o=Math.min(n,s.clientHeight/t);return"automatic"===m?Math.min(1/E(),o):o}function V(e,n){C=e;const[o,r]=x(),i=Math.max(0,(s.clientWidth-o*C)/2),l=Math.max(0,(s.clientHeight-r*C)/2);Object.assign(a.style,{width:`${Math.max(s.clientWidth,i+o*C)}px`,height:`${Math.max(s.clientHeight,l+r*C)}px`}),Object.assign(t.style,{left:`${i}px`,top:`${l}px`,transform:`scale(${C})`});const c=o*C>s.clientWidth+.01||r*C>s.clientHeight+.01,u="custom"===m||M();s.tabIndex=u&&c?0:-1,s.scrollLeft="custom"===m?n.x*C:0,s.scrollTop=u?n.y*C:0}function T(){if(!k)return;const e=k;k=null,e.window.cancelAnimationFrame(e.frame),e.resolve?.()}function H(e,t,n,o){return t<=0||o&&e<-1&&t<n?Math.max(e,t-n):e>=n||o&&e>0&&t>n+1?Math.min(e,t-n):0}function O(o=!1,l=!1){T();const[a,u]=x();if(Object.assign(t.style,{width:`${a}px`,height:`${u}px`}),!e.clientWidth||!e.clientHeight)return;const d=E(),p=`${i[f]} (${a} × ${u}) · `,h=Math.max(400,Math.ceil(e.clientWidth/a*d*100)),y=`${p}${"0".repeat(String(h).length)}%`;n.dataset.reserve!==y&&(n.dataset.reserve=y);const b=l?{x:0,y:0}:{x:(s.scrollLeft||0)/(C||1),y:(s.scrollTop||0)/(C||1)};if(s.style.overflowX="hidden",s.style.overflowY="hidden","custom"===m){const e=L(a,u);for(let t=0;t<2;t++)a*e>s.clientWidth+.01&&(s.style.overflowX="scroll"),u*e>s.clientHeight+.01&&(s.style.overflowY="scroll")}else M()&&u*L(a,u)>e.clientHeight&&(s.style.overflowY="scroll");if(!s.clientWidth||!s.clientHeight)return;const P=L(a,u),H=Math.round(P*d*100),O=H!==v||d!==g;v=H,g=d;const R=`${p}${"custom"===m?w:v}%`;c.textContent!==R&&(c.textContent=R),O&&r();const j=C??P;if(!o||!S.matches||j===P)return void V(P,b);const N={window:e.ownerDocument.defaultView,frame:null},$=N.window.performance.now();k=N;const B=e=>{V(e,b),N.scrollLeft=s.scrollLeft,N.scrollTop=s.scrollTop};B(j);const D=e=>{if(k!==N)return;const t=Math.min(1,Math.max(0,(e-$)/200));B(j+(P-j)*(1-(1-t)**3)),t<1?N.frame=N.window.requestAnimationFrame(D):T()};N.frame=N.window.requestAnimationFrame(D)}function R(){O()}function j(){P?.();const t=e.ownerDocument.defaultView.matchMedia(`(resolution: ${E()}dppx)`);t.addEventListener("change",j),P=()=>t.removeEventListener("change",j),R()}let N=new l.ResizeObserver(R);return N.observe(e),S.addEventListener("change",R),l.addEventListener("resize",j),j(),{get device(){return f},get fit(){return m},get customZoom(){return w},get zoomPercent(){return"custom"===m?w:v},get dpr(){return E()},get orientation(){return b[f]},canvasTarget:function(e,t,{fitTarget:n=!1}={}){const o=e.getBoundingClientRect(),r=s.getBoundingClientRect(),i=o.left-r.left-s.clientLeft,l=o.top-r.top-s.clientTop,a=H(i+t.left*C,i+t.right*C,s.clientWidth,n),c=H(l+t.top*C,l+t.bottom*C,s.clientHeight,n),u=Math.max(t.left,-i/C),d=Math.min(t.right,(s.clientWidth-i)/C);return{visible:!a&&!c,visibleCenterX:u<d?(u+d)/2:void 0,distance:Math.hypot(a,c),reveal(e="instant"){(a||c)&&s.scrollBy({left:a,top:c,behavior:e})}}},canvasWasPanned:function(){return!!k&&(s.scrollLeft!==k.scrollLeft||s.scrollTop!==k.scrollTop)},whenSettled:function(){if(!k)return;const e=k;return e.done??=new Promise(t=>{e.resolve=t}),e.done},finishMotion(){k&&R()},select(e,{animate:t=!1,keepPan:n=!1}={}){if(!d.includes(e))return;const o=f!==e;f=e,o?O(t,!n):k||R()},rotate({animate:e=!1,keepPan:t=!1}={}){"desktop"!==f&&(b[f]="portrait"===b[f]?"landscape":"portrait",O(e,!t))},setFit(e){p.includes(e)&&m!==e&&(m=e,O(!1,!0))},setZoom(e){if(!h(e)||"custom"===m&&w===e)return;const t="custom"!==m;w=e,m="custom",O(!1,t)},layout:R,beforeMove(){T(),N.disconnect(),P?.(),e.ownerDocument.defaultView.removeEventListener("resize",j)},afterMove(){N=new e.ownerDocument.defaultView.ResizeObserver(R),N.observe(e),e.ownerDocument.defaultView.addEventListener("resize",j),j()}}}(D,z,q,{device:C.get(M,"viewport"),fit:C.get(M,"fitMode")??P,customZoom:C.get(M,"customZoom"),tabletOrientation:C.get(M,"tabletOrientation"),mobileOrientation:C.get(M,"mobileOrientation")},()=>Ee(),i),J=x.querySelector("#wpbody-content > .wrap"),X=x.getElementById("wpadminbar");function Y(e=!1){const t=Math.max(1,x.documentElement.clientWidth),n=Math.max(1,x.documentElement.clientHeight),o=x.documentElement.getBoundingClientRect().left+b.scrollX,r=!e&&J?.getBoundingClientRect(),i=r?Math.max(0,"rtl"===b.getComputedStyle(J).direction?r.left-o:o+t-r.right):20,l=e?0:i,s=Math.min(l,(t-1)/2),a=Math.min(Math.max(0,X?.getBoundingClientRect().bottom||0)+l,n-1),c=t-s,u=n-Math.min(l,n-a-1);return{left:s,top:a,right:c,bottom:u,width:c-s,height:u-a}}let U,K=f&&(!E||!1!==C.get(M,"panelOpen")),Q=!1;const ee=C.get(M,"layout"),te=C.get(M,"position")??ee?.dock??ee?.anchor;let ne=["left","center","right"].includes(te)?te:"right";const oe=a(L?ee:void 0,Y,ne),{compactRect:re,usableEdge:ie}=oe;let le,se=!1,ae="",ce=!1,ue={text:i.loading,state:"loading",hasPreview:!1,canRetry:!1,reason:""},de=!1;function fe(e){const t="string"==typeof e?e.replace(/\s+/g," ").trim():"";B.textContent=t?`${i.preview} — ${t}`:i.title,B.title=B.textContent,U&&(U.document.title=B.textContent)}function pe(){const{text:e,state:t,hasPreview:n,reason:o}=ue;return"handover"===t?{heading:i.switchingPreview,description:e,note:i.tabEdits}:"conflict"===t?{heading:e,description:{"handed-off":i.handedOffHelp,busy:i.takeoverTimeoutHelp,manual:i.closeOtherHelp}[o]||i.conflictHelp,note:"manual"===o?i.manualSwitchHint:i.tabEdits}:"paused"===t?{heading:i.pausedTitle,description:e,note:""}:"error"===t?function(){const{text:e,hasPreview:t,canRetry:n,reason:o}=ue;if("origin-mismatch"===o)return{heading:i.originMismatchTitle,description:t?`${e} ${i.previousPreview}`:e,note:""};if("unavailable"===o||"browser"===o)return{heading:"unavailable"===o?i.unavailableTitle:i.browserTitle,description:e,note:""};const r={reload:i.reviewBeforeReload,"reload-before-save":i.nativePreviewAcfReload}[o];if(!t){let t=e;return e===i.failed&&(t=n?i.failedHelp:""),r&&(t+=` ${r}`),{heading:i.failed,description:t,note:""}}return{heading:e===i.failed?i.refreshFailed:e,description:r||i.previousPreview,note:""}}():n?{heading:e,description:"",note:""}:{heading:i.loading,description:i.preparing,note:""}}function me(){return se?"handover"===ue.state?i.takingOver:i.takeOver:i.retry}function he(e){return!e||["handover","paused"].includes(ue.state)?"info":"error"!==ue.state||ue.canRetry?"warning":"error"}function ge(){return ue.redirectDestination?`${i.redirected} ${ue.redirectDestination}`:ue.hasHtmlPreview&&le?`${i.publicRedirected} ${le}`:""}function we(){const{state:e,hasPreview:t,canRetry:n,reason:o}=ue,r=t&&["error","conflict","handover","paused"].includes(e),l=!t||r||ae?"":ge();if(Z.hidden=!r&&!ae&&!l,Z.tabIndex=Z.hidden?-1:0,H.dataset.hasFeedback=String(!Z.hidden),Z.hidden)return null;if(l)return{heading:l,status:"info",dismissible:!1};const{heading:s,description:a}=pe();return{heading:r?s:ae,description:r?a:i.windowNoticeHelp,status:he(r),dismissible:!r,retry:r&&(se||n&&["error","conflict"].includes(e)),close:r&&"error"===e&&!n&&!["reload","reload-before-save"].includes(o),disabled:"handover"===e,action:me()}}function ve(e){ue.hasPreview&&["error","conflict","handover","paused"].includes(ue.state)||(ae=e,Ee()),I.textContent=`${e} ${i.windowNoticeHelp}`}function ye(){ae="",Ee()}function be(e,t="loading",{canTakeOver:n=!1,hasPreview:o=!1,hasHtmlPreview:r=!1,redirectDestination:i,canRefresh:l=!1,canRetry:s=!0,reason:a=""}={}){const u=H.ownerDocument.activeElement,d=H.contains(u),f=!o&&(ue.state!==t||ue.text!==e||ue.reason!==a),p=ue.hasPreview!==o;ue={text:e,state:t,canTakeOver:n,hasPreview:o,hasHtmlPreview:r,redirectDestination:i,canRefresh:l,canRetry:s,reason:a},["error","conflict","handover","paused"].includes(t)&&(ae=""),H.dataset.state=t,H.dataset.hasPreview=String(o),se=n&&["conflict","handover"].includes(t),A.hidden=o,W.hidden=!o;const{heading:m,description:h,note:g}=pe();f&&(A.scrollTop=0);const w="ready"!==t||ae?"":ge();I.textContent=o?[m,h,g,w].filter(Boolean).join(" "):m,Ee(),p&&_.layout(),function(e,t){e&&t&&(!H.contains(e)||e.closest("[hidden]")||e.disabled||!ue.hasPreview&&F.contains(e))&&G.focus(A.hidden?"actions":"empty-title")}(u,d),K&&"ready"===t&&r&&!i&&async function(){if(c&&!ce){ce=!0;try{const e=new URL(c.endpoint);if(e.origin!==b.location.origin)return;const t=await b.fetch(e,{credentials:"same-origin",cache:"no-store",redirect:"error",headers:{"X-WP-Nonce":c.nonce}});if(!t.ok)return;const{destination:n}=await t.json();if("string"!=typeof n||!n)return;if(le=n,!K)return;Ee(),"ready"!==ue.state||!ue.hasHtmlPreview||ue.redirectDestination||ae||(I.textContent=ge())}catch{}}}()}function xe(e){f&&E&&C.get(M,"panelOpen")!==e&&k.set(M,"panelOpen",e)}function Me(){L&&k.set(M,"layout",oe.layout)}function Ce(){const e=T.hidden;T.hidden=!1,T.style.maxWidth=`${Y(!oe.dock).width}px`;const t={width:T.offsetWidth,height:T.offsetHeight};return T.hidden=e,oe.launcherRect(t)}function ke(){if(U)return;if(!K&&S()){const e=Ce(),t=oe.anchorFactor;Object.assign(T.style,{left:`${e.x+e.width*t}px`,top:`${e.y+e.height}px`,transform:`translate(${-100*t}%, -100%)`})}let e=re();if(H.dataset.anchor=oe.anchor,oe.expanded){const t=Y();e={x:t.left,y:t.top,width:t.width,height:t.height}}Object.assign(H.style,{left:`${e.x}px`,top:`${e.y}px`,width:`${e.width}px`,height:`${e.height}px`,transform:""})}function Pe(e="right",t=!1){oe.dockTo(e,t),ne=e,k.set(M,"position",ne),ke(),Me(),Ee()}function Se(){return"function"==typeof b.documentPictureInPicture?.requestWindow}function Ee(){if(!G)return;const e=H.ownerDocument.fullscreenElement===H,t=!U&&!e,n=t&&!oe.expanded;H.classList.toggle("mtflpp-expanded",oe.expanded),j.hidden=!n;for(const e of N)e.hidden=!n||!ie(e.dataset.resizeEdge);const o=se||ue.canRetry&&["error","conflict"].includes(ue.state);var r;G.update({inPage:t,inPip:!!U,movable:n,dock:oe.dock,canRememberVisibility:f,rememberVisibility:E,rememberPosition:L,followChanges:V,device:_.device,busy:ue.hasPreview&&["stale","loading","handover"].includes(ue.state)&&ue.text!==i.saving,empty:ue.hasPreview?null:{...pe(),busy:["loading","stale","ready","handover"].includes(ue.state),icon:["paused","conflict"].includes(ue.state)||["unavailable","browser","origin-mismatch"].includes(ue.reason)?"info":"warning",retry:o,disabled:"handover"===ue.state,close:"error"===ue.state&&!o,action:me()},notice:we(),fit:_.fit,orientation:_.orientation,customZoom:_.customZoom,zoomPercent:_.zoomPercent,dpr:_.dpr,canRefresh:ue.canRefresh,hasPreview:ue.hasPreview,canPip:t&&Se(),canFullscreen:t&&!!x.fullscreenEnabled,mode:e||oe.expanded?"compact":"expand",modeLabel:(r=e,r?i.exitFullscreen:oe.expanded?i.compact:i.expand)})}function Le(){G.closeMenu(),U?U.close():x.fullscreenElement!==H?(oe.toggleExpanded(),ke(),Me(),Ee(),G.focus("mode")):x.exitFullscreen().then(ye,()=>ve(i.fullscreenFailed))}function Ve(e,t=!1,n){const o=e===O,r=e===$,l=()=>n||("left"===oe.anchor?"ne":"nw"),s=()=>U||!o&&oe.expanded||x.fullscreenElement===H||t&&!ie(l());let a,c;const u=()=>({...o?Ce():re(),preferredBounds:oe.layout.bounds});function d(){if(c=null,a)if(t||o)ke();else{const e=re(),t=e.x-parseFloat(H.style.left),n=e.y-parseFloat(H.style.top);Object.assign(H.style,{width:`${e.width}px`,height:`${e.height}px`,transform:`translate3d(${t}px, ${n}px, 0)`})}}function f(){if(!a)return;const{pointer:t,moved:n}=a;a=null,b.cancelAnimationFrame(c),e.hasPointerCapture(t)&&e.releasePointerCapture(t),H.classList.remove("mtflpp-dragging"),e.classList.remove("mtflpp-edge-active"),x.documentElement.classList.remove("mtflpp-window-dragging"),x.documentElement.style.removeProperty("--mtflpp-drag-cursor"),ke(),n&&(o&&(de=!0),Me(),Ee())}e.addEventListener("pointerdown",t=>{0!==t.button||s()||r&&t.target.closest('button, a, [role="button"]')||(o&&(de=!1),t.preventDefault(),o?O.focus({preventScroll:!0}):e===R&&G.focus("move"),G.closeMenu(),a={...u(),pointer:t.pointerId,pointerX:t.clientX,pointerY:t.clientY},e.setPointerCapture(t.pointerId))}),e.addEventListener("pointermove",n=>{if(!a||a.pointer!==n.pointerId)return;const r=n.clientX-a.pointerX,i=n.clientY-a.pointerY;!a.moved&&Math.abs(r)+Math.abs(i)<4||(a.moved=!0,H.classList.add("mtflpp-dragging"),t&&e.classList.add("mtflpp-edge-active"),x.documentElement.style.setProperty("--mtflpp-drag-cursor",t?b.getComputedStyle(e).cursor:"grabbing"),x.documentElement.classList.add("mtflpp-window-dragging"),t?oe.resize(a,l(),r,i):oe.move(a,r,i,o),c||(c=b.requestAnimationFrame(d)))});for(const t of["pointerup","pointercancel","lostpointercapture"])e.addEventListener(t,f);b.addEventListener("blur",f),r||n||e.addEventListener("keydown",e=>{const n={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[e.key];if(!n||e.altKey||e.ctrlKey||e.metaKey||s())return;e.preventDefault(),G.closeMenu();const r=u(),a=e.shiftKey?40:10;t?oe.resize(r,l(),n[0]*a,n[1]*a):oe.move(r,n[0]*a,n[1]*a,o),ke(),Me(),Ee();const c=re();I.textContent=t?`${i.resize}: ${Math.round(c.width)} × ${Math.round(c.height)}`:i.moved})}fe(l),$.addEventListener("dblclick",e=>{U||e.target.closest("button, a")||Le()}),x.addEventListener("fullscreenchange",Ee),j.addEventListener("keydown",e=>{"Escape"===e.key&&j.classList.add("mtflpp-help-dismissed")}),j.addEventListener("blur",()=>j.classList.remove("mtflpp-help-dismissed")),Ve(R),Ve($),u||Ve(O),Ve(j,!0);for(const e of N)Ve(e,!0,e.dataset.resizeEdge);function Te(){H.hidden=Q||!K,T.hidden=Q||!u&&(K||!S()),O.setAttribute("aria-expanded",String(!H.hidden))}function He(){G.closeMenu(),U?.close(),x.fullscreenElement===H&&x.exitFullscreen().catch(()=>{})}function Oe(e=!0){Q||(K?G.focus("actions"):(xe(!0),p(),K&&e&&G.focus("actions")))}return b.addEventListener("resize",ke),b.addEventListener("scroll",ke,{passive:!0}),d?.fallbackMedia.addEventListener("change",()=>{ke(),Te()}),O.addEventListener("click",e=>{if(de&&0!==e.detail)return de=!1,void e.preventDefault();de=!1,Oe(0===e.detail)}),G=function(t,i,l){const a=t.querySelector(".mtflpp-controls"),c=t.querySelector(".mtflpp-refresh-control"),u=t.querySelector(".mtflpp-move-control"),d=t.querySelector(".mtflpp-device-controls"),f=t.querySelector(".mtflpp-fit-control"),p=t.querySelector(".mtflpp-pip-control"),m=t.querySelector(".mtflpp-empty"),h=t.querySelector(".mtflpp-feedback");let g,w=(0,n.createRoot)(a),v=!1,y=!1,b=!1;const x=r.InlineNotices?(0,e.dispatch)(r.store):null,M=t.ownerDocument.defaultView?.wp?.theme?.ThemeProvider,C="meet-the-frontend-live-preview-panel",k="preview-feedback";let P="";function S(){const e=g.notice,t=/[.!?…。!?]$/.test(e.heading)?e.heading:`${e.heading}.`;return{message:e.description?`${t} ${e.description}`:e.heading,status:e.status,isDismissible:e.dismissible,actions:[...e.retry?[{label:e.action,disabled:e.disabled,onClick:l.retry}]:[],...e.close?[{label:i.close,onClick:l.close}]:[]]}}function E(){x&&P&&x.removeNotice(k,C),P=""}function L(e){return()=>{H(),e()}}function V(){const{inPage:e,inPip:a,mode:w,modeLabel:k,movable:P,busy:E,canRefresh:V,hasPreview:O,canPip:R}=g;return(0,n.createElement)(o.SlotFillProvider,null,(0,n.createPortal)(P&&e&&(0,n.createElement)(o.Button,{className:"mtflpp-icon mtflpp-move",size:"compact",icon:s.move,label:i.move,showTooltip:!0,tooltipPosition:"bottom","data-action":"move"}),u),(0,n.createPortal)((0,n.createElement)(o.Button,{className:"mtflpp-icon",size:"compact",icon:E?(0,n.createElement)(o.Spinner):s.refresh,label:i.refresh,showTooltip:!0,accessibleWhenDisabled:!0,disabled:!V,onClick:l.refresh,"data-action":"refresh"}),c),(0,n.createPortal)(R&&O&&(0,n.createElement)("div",{className:"mtflpp-pip-surface"},(0,n.createElement)(o.Button,{className:"mtflpp-pip-button",icon:s.pip,label:i.popOutHelp,"aria-label":i.popOut,description:i.popOutHelp,showTooltip:!0,onClick:l.popOut,"data-action":"pop-out"})),p),function(){const{canPip:e,canFullscreen:t,inPage:r,inPip:a,dock:c,canRememberVisibility:u,rememberVisibility:d,rememberPosition:f,followChanges:p}=g;return(0,n.createElement)(o.DropdownMenu,{className:"mtflpp-actions",label:i.actions,icon:s.more,open:v,onToggle(e){v=e,e&&(y=!1),T()},toggleProps:{className:"mtflpp-icon",size:"compact","data-action":"actions"},popoverProps:{placement:"bottom-end",offset:6,shift:!0,className:"mtflpp-menu-popover"}},()=>(0,n.createElement)(n.Fragment,null,(e||t)&&(0,n.createElement)(o.MenuGroup,{label:i.display},e&&(0,n.createElement)(o.MenuItem,{label:i.popOutHelp,description:i.popOutHelp,showTooltip:!0,onClick:L(l.popOut),"data-action":"pip","aria-label":i.popOut},i.popOut),t&&(0,n.createElement)(o.MenuItem,{onClick:L(l.fullscreen),"data-action":"fullscreen"},i.fullscreen)),r&&(0,n.createElement)(o.MenuGroup,{label:i.position},(0,n.createElement)(o.MenuItemsChoice,{value:c,choices:[{value:"left",label:i.bottomLeft},{value:"center",label:i.bottomCenter},{value:"right",label:i.bottomRight}],onSelect(e){H(),l.dock(e)}})),(0,n.createElement)(o.MenuGroup,{label:i.preferences},!1!==u&&(0,n.createElement)(o.MenuItem,{role:"menuitemcheckbox",isSelected:d,icon:d?s.check:void 0,info:i.rememberVisibilityHelp,onClick:L(l.rememberVisibility),"data-action":"remember-visibility"},i.rememberVisibility),(0,n.createElement)(o.MenuItem,{role:"menuitemcheckbox",isSelected:f,icon:f?s.check:void 0,info:i.rememberPositionHelp,onClick:L(l.rememberPosition),"data-action":"remember-position"},i.rememberPosition),(0,n.createElement)(o.MenuItem,{role:"menuitemcheckbox",isSelected:p,icon:p?s.check:void 0,info:i.followHelp,onClick:L(l.follow),"data-action":"follow"},i.follow)),r&&(0,n.createElement)(o.MenuGroup,null,(0,n.createElement)(o.MenuItem,{info:i.resetHelp,onClick:L(l.reset),"data-action":"reset"},i.reset)),a&&(0,n.createElement)(o.MenuGroup,null,(0,n.createElement)(o.MenuItem,{onClick:L(l.close),"data-action":"close"},i.closeLivePreview))))}(),!a&&(0,n.createElement)(o.Button,{className:"mtflpp-icon mtflpp-mode",size:"compact",icon:s[w],label:k,showTooltip:!0,onClick:l.mode,"data-action":"mode"}),!a&&(0,n.createElement)(o.Button,{className:"mtflpp-icon",size:"compact",icon:s.close,label:i.close,showTooltip:!0,onClick:l.close,"data-action":"close"}),(0,n.createPortal)(function(){const{device:e,orientation:t}=g;return(0,n.createElement)(o.Toolbar,{className:"mtflpp-devices",label:i.viewport,variant:"unstyled"},...["desktop","tablet","mobile"].map(r=>{const a=e===r,c=a&&"desktop"!==r,u=c&&"landscape"===t,d="portrait"===t?i.rotateLandscape:i.rotatePortrait;return(0,n.createElement)(o.ToolbarButton,{key:r,icon:s[r],className:u?"mtflpp-device-rotated":void 0,label:c?`${i[r]} — ${d}`:i[r],isPressed:a,"data-viewport":r,onClick:()=>l.device(r)})}))}(),d),(0,n.createPortal)(function(){const{fit:e,customZoom:t=100,dpr:r=1}=g,a={automatic:i.automatic,window:i.fitToWindow,width:i.fitToWidth},c={automatic:i.automaticHelp,window:i.fitToWindowHelp,width:i.fitToWidthHelp},u="custom"===e?i.fixedZoom:a[e]??i.automatic;return(0,n.createElement)(o.Dropdown,{open:y,onToggle(e){y=e,e&&(v=!1,b="custom"===g.fit),T()},contentClassName:"mtflpp-zoom-popover",focusOnMount:"firstElement",popoverProps:{placement:"top-end",offset:8,shift:!0,resize:!1,role:"dialog","aria-label":i.fitting},renderToggle:({isOpen:e,onToggle:t})=>(0,n.createElement)(o.Button,{className:"mtflpp-zoom-toggle",variant:"secondary",size:"compact",label:u,showTooltip:!0,"aria-label":`${i.fitting}: ${u}`,"aria-haspopup":"dialog","aria-expanded":e,onClick:t,"data-action":"zoom"},(0,n.createElement)("span",{className:"mtflpp-zoom-value"},u),s.chevron),renderContent:()=>(0,n.createElement)("div",{className:"mtflpp-zoom-content"},(0,n.createElement)(o.RadioControl,{label:i.zoomMode,selected:e,options:[...Object.entries(a).map(([e,t])=>({value:e,label:t,description:c[e]})),{value:"custom",label:i.fixedZoom,description:i.fixedZoomHelp}],onFocus(e){if(!b)return;b=!1;const t=e.currentTarget.closest(".mtflpp-zoom-content")?.querySelector('.mtflpp-custom-zoom input[type="number"]');t?.focus({preventScroll:!0});const n=t?.closest(".components-popover__content");if(n){const e=t.getBoundingClientRect(),o=n.getBoundingClientRect();n.scrollTop+=Math.min(0,e.top-o.top)+Math.max(0,e.bottom-o.bottom)}},onChange(e){b=!1,"custom"!==e?l.fit(e):l.zoom(t)}}),"custom"===e&&(0,n.createElement)("div",{className:"mtflpp-custom-zoom",onKeyDown(e){if("Enter"!==e.key)return;e.preventDefault();const t=Number(e.target.value);!1!==e.target.validity?.valid&&Number.isInteger(t)&&t>=10&&t<=400&&H()}},(0,n.createElement)(o.RangeControl,{label:i.customZoom,min:10,max:400,step:1,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:t,help:i.customZoomHelp,withInputField:!0,onChange(e){Number.isInteger(e)&&e>=10&&e<=400&&l.zoom(e)}})),(0,n.createElement)("div",{className:"mtflpp-dpr-note",role:"group","aria-label":i.displayInformation},(0,n.createElement)("span",{className:"mtflpp-dpr-value"},`${i.displayDpr}: ${Number(r.toFixed(2))}`),(0,n.createElement)("span",{className:"mtflpp-pixel-note"},i.pixelZoomHelp)))})}(),f),(0,n.createPortal)(function(){const{empty:e}=g;return e?(0,n.createElement)(o.Placeholder,{className:"mtflpp-placeholder","data-empty-icon":e.busy?void 0:e.icon,icon:e.busy?(0,n.createElement)(o.Spinner):s[e.icon],label:(0,n.createElement)("h3",{className:"mtflpp-empty-title",tabIndex:-1,"data-action":"empty-title"},e.heading),instructions:e.description},e.retry&&(0,n.createElement)(o.Button,{key:"retry",variant:"primary",disabled:e.disabled,onClick:l.retry,"data-action":"retry"},e.action),e.close&&(0,n.createElement)(o.Button,{key:"close",variant:"secondary",onClick:l.close,"data-action":"close"},i.close),e.note&&(0,n.createElement)("p",{className:"mtflpp-empty-note"},e.note)):null}(),m),(0,n.createPortal)(function(){if(!g.notice)return null;if(x){const e=(0,n.createElement)(r.InlineNotices,{context:C,className:"mtflpp-inline-notices"});return M?(0,n.createElement)(M,{cornerRadius:"none"},e):e}const{message:e,...t}=S();return(0,n.createElement)(o.Notice,{...t,onRemove:l.dismissNotice,spokenMessage:"",politeness:"polite"},e)}(),h),e?(0,n.createPortal)((0,n.createElement)(o.Popover.Slot),t.ownerDocument.body):(0,n.createElement)(o.Popover.Slot))}function T(){g&&w&&(function(){if(!x)return;if(!g.notice)return void E();const e=JSON.stringify(g.notice);if(P===e)return;const{message:t,status:n,...o}=S();x.createNotice(n,t,{...o,id:k,context:C,speak:!1,onDismiss:l.dismissNotice}),P=e}(),(0,n.flushSync)(()=>w.render((0,n.createElement)(V))))}function H(){(v||y)&&(v=!1,y=!1,T())}function O(e){g?.inPip&&"mode"===e&&(e="actions"),t.querySelector(`[data-action="${e}"]`)?.focus({preventScroll:!0})}return{update(e){const n=y&&!e.hasPreview&&t.ownerDocument.activeElement?.closest(".mtflpp-zoom-popover");e.hasPreview||(y=!1),g=e,T(),n&&O("empty-title")},closeMenu:H,focus:O,beforeMove(){v=!1,y=!1,w?.unmount(),w=null,E()},remount(){w=(0,n.createRoot)(a),T()}}}(H,i,{refresh:()=>{ue.canRefresh&&h()},retry:()=>{"handover"!==ue.state&&(se||ue.canRetry&&["error","conflict"].includes(ue.state))&&g(se)},dismissNotice:()=>{ye(),I.textContent=ue.text,G.focus("actions")},mode:Le,close:function(){G.closeMenu(),xe(!1),m(),u||S()?O.focus():d.focus()},popOut:async function(){if(Q||U||x.fullscreenElement===H||!Se())return;let e;G.closeMenu();const t=()=>{U===e&&(w(),_.beforeMove(),G.beforeMove(),x.body.append(H),H.classList.remove("mtflpp-pip"),U=null,G.remount(),ke(),_.afterMove(),Ee(),Q||(v(),K&&G.focus("mode")))};try{if(e=await b.documentPictureInPicture.requestWindow({width:640,height:440}),!K||Q)return void e.close();const n=b.getComputedStyle(H);e.document.documentElement.lang=x.documentElement.lang,e.document.documentElement.dir=n.direction;for(const t of["--wp-admin-theme-color","--wp-admin-theme-color-darker-10","--wp-admin-border-width-focus"]){const o=n.getPropertyValue(t);o&&e.document.documentElement.style.setProperty(t,o)}const o=x.querySelectorAll(['link[rel="stylesheet"][href*="/load-styles.php"]',"#wp-theme-css","#wp-theme-inline-css","#wp-components-css","#wp-components-inline-css","style[data-emotion]","style[data-wp-hash]","#meet-the-frontend-live-preview-panel-css","#meet-the-frontend-live-preview-panel-inline-css"].join(", "));for(const t of o){const n=t.cloneNode(!0);"STYLE"===t.tagName&&t.sheet&&(n.textContent=Array.from(t.sheet.cssRules,e=>e.cssText).join("\n")),n.addEventListener("load",_.layout,{once:!0}),e.document.head.append(n)}e.document.title=B.textContent,e.document.body.className="mtflpp-pip-document",e.addEventListener("resize",_.layout),e.addEventListener("pagehide",t,{once:!0}),U=e,w(),_.beforeMove(),G.beforeMove(),H.classList.add("mtflpp-pip"),e.document.body.append(H),G.remount(),_.afterMove(),Ee(),ye(),G.focus("mode"),v()}catch{if(e&&(t(),e.close()),Q)return;G.focus("actions"),ve(i.pipFailed)}},fullscreen:async function(){if(!Q&&!U&&x.fullscreenEnabled){G.closeMenu();try{if(await H.requestFullscreen(),Q)return void He();ye(),G.focus("mode")}catch{if(Q)return;G.focus("actions"),ve(i.fullscreenFailed)}}},dock:e=>Pe(e),reset:()=>Pe("right",!0),follow:function(){V=!V,k.set(M,"scrollToChanges",V),Ee(),V&&ue.canRefresh&&h(!1)},rememberVisibility:function(){E=!E,k.set(M,"rememberVisibility",E),E&&xe(K),Ee()},rememberPosition:function(){L=!L,k.set(M,"rememberPosition",L),L?Me():(k.set(M,"position",ne),k.set(M,"layout",void 0)),Ee()},device(e){const t=_.device;if(e===t&&"desktop"===e)return;let n=!1;if(K&&V&&y){const{fit:e,customZoom:t,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:l}=_;n=!!y({canvas:F,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:l,canFollow:()=>_.fit===e&&_.customZoom===t})}const o={animate:K&&!n,keepPan:n};e===t?(_.rotate(o),k.set(M,`${e}Orientation`,_.orientation)):(_.select(e,o),_.device!==t&&k.set(M,"viewport",_.device)),Ee()},fit(e){const t=_.fit;_.setFit(e),_.fit!==t&&k.set(M,"fitMode",_.fit),Ee()},zoom(e){const t=_.fit,n=_.customZoom;_.setZoom(e),_.customZoom!==n&&k.set(M,"customZoom",_.customZoom),_.fit!==t&&k.set(M,"fitMode",_.fit),Ee()}}),be(i.loading,"loading",{canRetry:!1}),ke(),Te(),u&&(u.disabled=!1),{stage:z,canvasTarget:_.canvasTarget,get visible(){return K},get followChanges(){return V},openFromLauncher:Oe,setSuspended(e){Q!==e&&(Q=e,Te(),e?He():ke())},setVisible(e){e||(G.closeMenu(),ae="",Ee(),_.layout()),K=e,ke(),Te()},report:be,setTitle:fe,clearPreview(){z.replaceChildren();const e=["ready","stale","loading"].includes(ue.state);be(e?i.loading:ue.text,e?"loading":ue.state,{...ue,hasPreview:!1,hasHtmlPreview:!1,redirectDestination:void 0,canRefresh:!1,canRetry:!e&&ue.canRetry})},returnToEditor:He}}function u(e=[]){const t=Array.isArray(e)?[...e]:[],n=new WeakMap;return{capture(e,o){try{if(n.has(e))return;const r=function(e){try{const t=e.querySelector('meta[name="meet-the-frontend-live-preview-panel"]'),n=t?.getAttribute("data-mtflpp-source");if(!n)return null;const o=JSON.parse(n);if("string"!=typeof o)return null;const r=(new DOMParser).parseFromString(o,"text/html");return r.querySelector('meta[name="meet-the-frontend-live-preview-panel"]')?.content===t.content?r:null}catch{return null}}(e);n.set(e,{source:r?M(r,e,t):null,dom:M(e,e,t),values:o&&structuredClone(o)})}catch{}},findChange(e,t){try{const o=n.get(e),r=n.get(t);if(!o||!r)return null;const i=function(e,t){if(!e||!t)return[];const n=[];for(const o of new Set([...Object.keys(e),...Object.keys(t)])){const r=Object.hasOwn(e,o)?e[o]:{type:t[o]?.type,value:""},i=Object.hasOwn(t,o)?t[o]:{type:e[o]?.type,value:""};if(r.type!==i.type||!["text","html"].includes(i.type)||"string"!=typeof r.value||"string"!=typeof i.value||r.value===i.value)continue;let l,s;try{l="html"===r.type?(new DOMParser).parseFromString(r.value,"text/html"):null,s="html"===i.type?(new DOMParser).parseFromString(i.value,"text/html"):null}catch{continue}const a=l?M(l,l,[],l.body):null,c=s?M(s,s,[],s.body):null,u=l?R(a):r.value,d=s?R(c):i.value,f=S(u),p=S(d);if(f!==p&&n.push({...Z(f,p),type:"text",fullBefore:f,fullAfter:p}),!l){const e=O(u,d);e&&n.push(e);continue}if(a&&c&&(f===p||E(u,d)))for(const e of P(a,c)){if(e.spacing){const t=H(e);t&&n.push(t);continue}if(f===p)if("attributes"===e.kind){const t=new Map(e.before.attributes),o=new Map(e.after.attributes);for(const e of new Set([...t.keys(),...o.keys()])){const r=t.get(e)??"",i=o.get(e)??"";JSON.stringify(r)!==JSON.stringify(i)&&n.push({type:"attribute",name:e,before:"string"==typeof r?r:JSON.stringify(r),after:"string"==typeof i?i:JSON.stringify(i)})}}else if("content"===e.kind){const t=S(R(e.before)),o=S(R(e.after));t===o&&Y(e.before,e.after,R)&&n.push({type:"markup",before:t,after:o,oldTag:e.before.tag,newTag:e.after.tag}),(e.before.media||[]).forEach((t,o)=>{const r=e.after.media?.[o];t&&r&&t!==r&&n.push({type:"media",before:t,after:r})})}}}return n}(o.values,r.values),l=function(e,t){if(!e||!t)return!1;const n=(e,t)=>Object.entries(e).some(([e,n])=>["text","html","value","row-image"].includes(n?.type)&&(!Object.hasOwn(t,e)||n.type!==t[e]?.type||n.value!==t[e]?.value));return n(e,t)||n(t,e)}(o.values,r.values),s=!!o.source&&!!r.source,a=!!o.source!=!!r.source,c=function(e,t,n){if(!e||!t)return;const o=Object.entries(t).filter(([t,n])=>"row-order"===n?.type&&"row-order"===e[t]?.type&&e[t].value!==n.value);if(1!==o.length)return;const[[r,i]]=o,l=e[r];if(!i.moved||i.members!==l.members)return;const s=JSON.parse(l.value),a=JSON.parse(i.value),c=s.indexOf(i.moved),u=a.indexOf(i.moved);if(-1===c||-1===u||c===u||s.length!==a.length)return;if(s.splice(c,1),a.splice(u,1),!s.every((e,t)=>e===a[t]))return;const d=u-c,f={html:new Map,peerLabels:new Map},p=D(r,i.moved,s,e,t,f),m=function(e,t,n,o,r,i){if([n,...o].some(n=>!e?.[n]||!t?.[n]))return[];const l=new Set(e[n]),s=new Set,a=new Set,c=new Set;for(const[n,l]of[[e,r],[t,i]])for(const e of o.flatMap(e=>n[e])){const t=l[e];"row-image"===t?.type&&(c.add(t.value),a.add(t.alt))}for(const e of t[n]){const t=r[e],n=i[e];if(!l.has(e)||"row-image"!==t?.type||"row-image"!==n?.type||!/^[1-9]\d*$/.test(n.value)||t.value!==n.value||c.has(n.value))continue;const o=n.alt;o?.trim()&&t.alt===o&&!a.has(o)&&s.add(o)}return[...s]}(l.fieldsByRow,i.fieldsByRow,i.moved,s,e,t);let h;if(n&&!p.length&&N(l,i.moved,e,f.html)&&N(i,i.moved,t,f.html)){const n=s.slice(Math.min(c,u),Math.max(c,u));h=[];for(const o of n){const n=D(r,o,[...s.filter(e=>e!==o),i.moved],e,t,f);if(!n.length){h=void 0;break}h.push(n)}}return{offset:d,groups:p,images:m,boundaryGroups:h}}(o.values,r.values,s&&!l&&!j(o.values,r.values)),u=s?P(o.source,r.source,c,!0):[];if(c?.boundaryGroups?.length){const e=u.filter(e=>e.priority>0);if(1===e.length&&e[0].boundary)return function({before:e,after:t,index:n},o){for(const n of[e,t]){let e,t;for(const{node:r}of n){if(!r?.isConnected||e&&e.nextElementSibling!==r)return null;const{position:n,marginTop:i,marginBottom:l}=r.ownerDocument.defaultView.getComputedStyle(r);if(o&&r.closest(o)||!m(r)||!["static","relative"].includes(n)||r.closest("[hidden], details:not([open])")||!1===r.checkVisibility?.({opacityProperty:!0,contentVisibilityAuto:!0}))return null;const s=r.getBoundingClientRect();if(!s.height&&!(parseFloat(i)>0||parseFloat(l)>0))return null;if(t&&(t.bottom>s.top||Math.max(t.left,s.left)>=Math.min(t.right,s.right)))return null;e=r,t=s}}return t[n].node}(e[0].boundary,r.source?.excluded)}if(!a&&!l&&!c){const e=function(e,t){const n=function(e,t){if(!e||!t)return;const n=["row-order","gallery-order","order"],o=[...new Set([...Object.keys(e),...Object.keys(t)])].filter(o=>(n.includes(e[o]?.type)||n.includes(t[o]?.type))&&e[o]?.value!==t[o]?.value);if(1!==o.length)return;const r=e[o[0]],i=t[o[0]];if("gallery-order"!==r?.type||"gallery-order"!==i?.type)return;const l=JSON.parse(r.value),s=JSON.parse(i.value);if(new Set(l).size!==l.length||new Set(s).size!==s.length)return;const a=new Map(l.map((e,t)=>[e,t])),c=s.map(e=>a.get(e));return l.length&&s.length&&c.every(e=>void 0===e)?void 0:{oldCount:l.length,matches:c}}(e.values,t.values);if(!n)return;const o=e.source??e.dom,r=t.source??t.dom,i=function(e,t,{oldCount:n,matches:o}){const r=[];function i(e,t){return e.signature===t.signature&&e.presentation===t.presentation}function l(e,t){return i(e,t)&&e.rawText===t.rawText&&e.children.length===t.children.length&&e.children.every((e,n)=>l(e,t.children[n]))}function s(e,t){if(e.children.length!==n||t.children.length!==o.length||e.rawText!==t.rawText&&(e.text||t.text))return!1;const i=b(e),s=b(t);if(!i||!s)return!1;const a=i.map(x),c=s.map(x),u=new Set(a);return!(u.size!==a.length||new Set(c).size!==c.length||a.length===c.length&&a.every((e,t)=>e===c[t])||!o.every((n,o)=>void 0===n?!u.has(c[o]):a[n]===c[o]&&l(e.children[n],t.children[o]))||(r.push({before:e,after:t,original:i,current:s}),0))}return e&&t&&function e(t,n){return!!i(t,n)&&(!!s(t,n)||t.rawText===n.rawText&&t.children.length===n.children.length&&t.children.every((t,o)=>e(t,n.children[o])))}(e,t)?r:null}(o,r,n);if(!i?.length)return;const l=i.map(e=>e.after);let[s]=l;for(;s&&!l.every(e=>e===s||Q(s,e));)s=s.parent;const a=e=>["main","body","html"].includes(e.tag)||e.attributes.some(([e,t])=>"role"===e&&"main"===t);if(!s?.parent||a(s)||!function(e,t){if(1===t.length)return!0;const n=new Set(t);let o=0;return function e(t){return n.has(t)?(o++,!0):!!g(t)||!w(t)&&("hr"!==t.tag||0===o||o===n.size)&&t.parts.every(t=>"string"==typeof t?0===o||o===n.size||!t.trim():e(t))}(e)&&o===n.size}(s,l))return null;let c=s.node;if(!c?.isConnected||l.some(({node:e})=>!c.contains(e)||r.excluded&&e.closest(r.excluded)))return null;if(t.source&&(!y(e.dom,i,"before","original")||!y(t.dom,i,"after","current")))return null;const u=c.ownerDocument.defaultView;for(let e=s,t=e.parent;t?.parent&&!a(t)&&!t.children.some(t=>t!==e&&v(t));e=t,t=t.parent){const e=t.node;if(!e?.contains(c))continue;const{overflowX:n,overflowY:o}=u.getComputedStyle(e),r=/^(?:auto|scroll|hidden)$/;(e.scrollWidth>e.clientWidth&&r.test(n)||e.scrollHeight>e.clientHeight&&r.test(o))&&(c=e)}return!m(c)||c.closest("[hidden], details:not([open])")||r.excluded&&c.closest(r.excluded)?null:c}(o,r);if(void 0!==e)return e}const C=[...u.map(e=>({...e,source:!0})),...P(o.dom,r.dom,c)],k=new Map,V=function(e,t){const n=new Map,o=e=>R(e,n),r=[];for(const n of e){if(n.unresolved)for(const e of d(n,t,o))r.push(e);if("insert"===n.kind&&n.added.length>1){const e=n.added.map(e=>{const r={...n,after:e,added:[e]},i=K(r,t,o);return{...r,input:i}}).filter(e=>e.input);if(e.length){r.push(...e);continue}}const e=K(n,t,o);r.push({...n,input:e})}return r}(C,i).filter(e=>(e.priority>0||e.input)&&(!e.spacing||function({before:e,after:t},n,o){const r=L(e,n,o),i=L(t,n,o);return r&&i&&r.omitted===i.omitted&&E(r.text,i.text)}(e,k,r.dom?.excluded))),T=s&&l&&!V.some(e=>e.source);return function(e,t){if(!e.length)return null;const n=e.reduce((e,t)=>Math.max(e,t.input),0),o=e.filter(e=>e.input===n),r=o.reduce((e,t)=>Math.max(e,t.priority),0),i=o.filter(e=>e.priority===r);if(t.rowMove&&!n||i.some(e=>e.unresolved))return function(e,{rowMove:t,excluded:n,canFollowLiveReorder:o,canFollowLiveMove:r}){if(t){const t=e.find(e=>e.moved&&(e.source||r)),o=t?.moved.node;return o?.isConnected&&t.after.node?.contains(o)&&e.every(e=>e===t||t.source&&!e.source&&(e.moved||"reorder"===e.regionChange))?"contents"!==o.ownerDocument.defaultView.getComputedStyle(o).display?o:f(t.moved,e=>o.contains(e)&&(!n||!e.closest(n))&&m(e)):null}const i=e.find(e=>e.unresolved&&("replacement"===e.regionChange||"reorder"===e.regionChange&&(e.source||o))),l=i?.after.node;if(!l?.isConnected)return null;for(const t of e)if(t.unresolved){if(i.source&&!t.source&&"reorder"===t.regionChange)continue;if(!t.regionChange||t.after.node!==l)return null}else if(!("insert"===t.kind?t.added:[t.after]).every(e=>l.contains(e.node)))return null;return"contents"!==l.ownerDocument.defaultView.getComputedStyle(l).display?l:null}(i,t);const l=i.filter(e=>!e.input||e.directInput||!i.some(t=>t!==e&&e.matches?.length&&e.matches.every(e=>t.matches?.includes(e))&&Q(e.after,t.after))),s=new Map,a=l.filter(e=>{const t="delete"===e.kind&&(e.following[0]||e.preceding[0])||e.after,n=t?.node;if(!n)return!0;const o="delete"!==e.kind||e.following.length?e.kind:"delete-last",r=s.get(n)||new Set;return!r.has(o)&&(r.add(o),s.set(n,r),!0)});return n&&s.size>1?null:function(e){const t=new Set,n=new Set;for(const o of e){let e,r=!1;"delete"===o.kind?(r=!o.removed.some(h),e=r?o.after:o.following.find(h)||o.preceding.find(h)||o.following.find(p)||o.preceding.find(p)||o.after):e="insert"===o.kind?o.added.find(h)||o.added.find(p):o.after;const i=p(e);if(!i)continue;const l=h(e),s=l||i;(l&&!r?t:n).add(s)}const o=t.size?t:n;return 1===o.size?o.values().next().value:null}(a)}(V.filter(e=>e.source||e.input||!s&&!a||T&&("insert"===e.kind||"delete"===e.kind)),{rowMove:!!c,excluded:r.source?.excluded??r.dom?.excluded,canFollowLiveReorder:!s&&(l||j(o.values,r.values)),canFollowLiveMove:!s&&!a})}catch{return null}}}}function d(e,t,n){const o=[];for(const r of t){if(!r.after||"spacing"===r.type)continue;const t=U(e.oldRange,r.before,n,r,!0),i=U(e.newRange,r.after,n,r,!1);if(!t.length)continue;const l="markup"===r.type&&r.oldTag===r.newTag;if(l||!r.before||!(t.length<=U(e.newRange,r.before,n,r,!0).length||i.length<=U(e.oldRange,r.after,n,r,!1).length))for(const s of i)l&&!t.some(e=>Y(e,s,n))||o.push({...e,unresolved:!1,before:null,after:s,kind:"content",input:r.before&&r.after?2:1,priority:2,matches:[r]})}return o}function f(e,t){if(e?.node&&t(e.node))return e.node;for(const n of e?.children||[]){const e=f(n,t);if(e)return e}return null}function p(e){return f(e,()=>!0)}function m(e){return e.getClientRects().length&&"visible"===e.ownerDocument.defaultView.getComputedStyle(e).visibility}function h(e){return f(e,m)}function g(e){return/^(?:button|input|select|textarea)$/.test(e.tag)||e.attributes.some(([e,t])=>"role"===e&&"button"===t)}function w(e){return/^(?:img|video|audio|iframe|canvas|object|embed)$/.test(e.tag)||e.media?.some(Boolean)}function v(e){return!g(e)&&(e.text||w(e)||"hr"===e.tag||e.children.some(v))}function y(e,t,n,o){const r=new Map(t.map(e=>[e[n].node,e[o]]));return!(!e||r.has(null)||r.size!==t.length)&&(function e(t){const n=r.get(t.node);if(!n)return t.children.every(e);r.delete(t.node);const o=new Map,i=new Map;n.forEach((e,t)=>{e.marker&&o.set(e.marker,t),i.set(x(e),t)});const l=[],s=new Map;if(!function e(t,r=!1){if(r||=t.attributes.some(([e,t])=>"inert"===e||"aria-hidden"===e&&"true"===t),"img"!==t.tag)return t.children.every(t=>e(t,r));const a=o.get(t.marker)??i.get(x(t));return!(!n[a]||!t.media.slice(0,2).some((e,t)=>e&&e===n[a].media[t])||(l.push({index:a,cloneHidden:r}),s.set(a,(s.get(a)??0)+1),0))}(t))return!1;const a=l.filter(({index:e,cloneHidden:t})=>!t||1===s.get(e));return a.length===n.length&&a.every(({index:e},t)=>e===t)}(e)&&!r.size)}function b(e){const t=e.children.map(function e(t){return"img"===t.tag?[t]:t.children.flatMap(e)});return t.some(e=>1!==e.length||!e[0].media?.slice(0,2).some(Boolean))?null:t.map(([e])=>e)}function x(e){return JSON.stringify(e.media.slice(0,2))}function M(e,t,n,o=e.querySelector('main, [role="main"]')||e.querySelector("article")||e.body){if(!o)return null;const r=n.filter(e=>{if("string"!=typeof e||!e.trim())return!1;try{return o.matches(e),!0}catch{return!1}}).join(", "),i=new Map,l=new Map;if(e!==t)for(const e of t.querySelectorAll("[data-mtflpp-node]")){const t=e.getAttribute("data-mtflpp-node");l.set(t,l.has(t)?null:e)}for(const n of[o,...o.querySelectorAll("*")]){if(r&&n.closest(r))continue;const o=[...n.childNodes].filter(e=>3===e.nodeType).map(e=>e.textContent),s=S(o.join(" ")),a=["img","source","video","audio","iframe"].includes(n.localName)?["src","srcset","poster"].map(e=>n.getAttribute(`data-${e}`)||n.getAttribute(e)||""):[],c=n.style?.backgroundImage||n.getAttribute("data-bg")||"",u=n.getAttribute("data-mtflpp-node"),d=e===t?n:l.get(u)||null,f=C(n,d,JSON.stringify([n.localName,s,a,c]));"img"===n.localName&&(f.marker=u),f.text=s,f.rawText=o.join(""),f.media=[...a,c],f.parent=i.get(n.parentElement),i.set(n,f),f.parent?.children.push(f)}for(const[e,t]of i)t.parts=[...e.childNodes].map(e=>3===e.nodeType?e.textContent:i.get(e)).filter(e=>void 0!==e);let s=i.get(o);if(!s)return null;const a=s.node;for(let e=o.parentElement;e;e=e.parentElement){const t=C(e,a,e.localName);t.children=[s],t.parts=[s],s=t}return s.excluded=r,s}function C(e,t,n){const o=function(e){const t=[];for(const{name:n,value:o}of e.attributes){if("data-mtflpp-node"===n||n.startsWith("on")||/(?:^|-)(nonce|token)(?:-|$)/.test(n))continue;if(/^(?:data-)?(?:src|srcset|poster|sizes|bg)$/.test(n))continue;let r=o;"class"===n&&(r=[...e.classList].sort().join(" ")),"style"===n&&(r=[...e.style].sort().map(t=>[t,e.style.getPropertyValue(t),e.style.getPropertyPriority(t)])),("class"!==n&&"style"!==n||r.length)&&t.push([n,r])}return t.sort(([e],[t])=>e.localeCompare(t))}(e);return{node:t,tag:e.localName,signature:n,attributes:o,children:[],parts:[],presentation:JSON.stringify(o.filter(([e])=>!k(e))),references:JSON.stringify(o.filter(([e])=>k(e)))}}function k(e){return["id","for","headers","aria-controls","aria-labelledby","aria-describedby","aria-owns","aria-flowto","aria-activedescendant","aria-details","aria-errormessage"].includes(e)}function P(e,t,n,o=!1){const r=new Map,i=new Map,l=new Map,s=new Map,a=[];let c,u;function d(o,r,i,l=[]){const s=(e,t)=>e===t||Q(e,t);let a=!1;if(l.length){u??=[B(e,new Set(l)),B(t,new Set(l))];const n=(e,t,n)=>t.node?.isConnected&&e.node?.contains(t.node)&&"img"===t.node.localName&&(!n||!t.node.closest(n));for(const i of l){const l=u[0].get(i),c=u[1].get(i);if(l&&c){if(!s(o,l)||!s(r,c))return!1;a||=n(o,l,e.excluded)&&n(r,c,t.excluded)}}}if(!i.length)return a;if(!c){const o=new Set((n.boundaryGroups??[n.groups]).flat(2));c=[q(e,o),q(t,o)]}const[d,f]=c,p=new Map;for(const e of i.flat()){const t=d.get(e),n=f.get(e);if(t&&n){if(!s(o,t.entry)||!s(r,n.entry))return!1;p.set(e,t.substantive&&n.substantive)}}return a||i.some(e=>e.every(e=>p.has(e))&&e.some(e=>p.get(e)))}function f(e){const t=JSON.stringify(e);return r.has(t)||r.set(t,r.size+1),r.get(t)}function p(e){if(!e)return 0;const t=f([e.signature,e.children.map(p)]);return i.set(e,t),l.set(e,f([t,e.presentation,e.children.map(e=>l.get(e))])),s.set(e,f([t,e.presentation,e.references,e.children.map(e=>s.get(e))])),t}p(e),p(t);const m=e=>i.get(e);function h(e){const t=e.attributes.find(([e])=>"id"===e)?.[1];return t?`${e.tag} ${t}`:void 0}function g(e){if(!(e.children.length<2))return f(["collection",e.signature,e.children.map(m).sort((e,t)=>e-t)])}function w(e,t){const n=new Map;return e.forEach((e,o)=>{const r=t(e);void 0!==r&&n.set(r,n.has(r)?-1:o)}),n}return function e(t,r){t&&r&&(t.signature!==r.signature?a.push({kind:"content",before:t,after:r,priority:2}):t.rawText!==r.rawText&&a.push({kind:"content",before:t,after:r,priority:2,spacing:!0}),t.presentation===r.presentation&&t.references===r.references||a.push({kind:"attributes",before:t,after:r,priority:t.presentation!==r.presentation?1:0}),function(t,r,c,u){const f=u.parent&&c.parent&&u.tag===c.tag,p=w(t,m),v=w(r,m);let y,b,x,M;const C=new Set(t.flatMap(e=>[l.get(e),s.get(e)])),k=new Set(r.flatMap(e=>[l.get(e),s.get(e)]));function P(e,t,n){const o=n.get(e),r=n.get(t);return o===r||!k.has(o)&&!C.has(r)}function S(e,t){return i.get(e)===i.get(t)&&P(e,t,l)&&P(e,t,s)}function E(e,n,o,l,s,c,d){const m=t.slice(e,n),h=r.slice(o,l),g="replacement"===s&&f&&m.some(e=>!v.has(i.get(e)))&&h.some(e=>!p.has(i.get(e)))&&(!function(e,t){if(e.length<2||t.length<2)return!1;const n=e.filter(e=>e.children.length).length,o=t.filter(e=>e.children.length).length;if(!n&&!o||n>1&&o>1)return!0;const r=new Map;for(const{tag:e}of t)r.set(e,(r.get(e)||0)+1);let i=0;for(const{tag:t}of e){const e=r.get(t);if(e){if(2===++i)return!0;r.set(t,e-1)}}return!1}(m,h)||"form"===u.tag&&function(e,t){function n(e){const t=new Set;return e.every(function e(n){if(["input","select","textarea"].includes(n.tag)){const e=n.attributes.find(([e])=>"name"===e)?.[1],o=n.attributes.find(([e])=>"type"===e)?.[1]?.toLowerCase();return!(!e||"input"===n.tag&&"hidden"===o||(t.add(e),0))}let o=!1;for(const t of n.children)e(t)&&(o=!0);return o})?t:null}const o=n(e),r=n(t);return o&&r&&[...o].some(e=>!r.has(e))&&[...r].some(e=>!o.has(e))}(m,h)),w=f&&("reorder"===s||g)?s:void 0;a.push({kind:"region",after:u,priority:2,unresolved:!0,regionChange:w,oldRange:m,newRange:h,moved:c,boundary:d})}function L(e,n,o,r,i,l,s){const a=[];for(let c=e;c<n;c++){const e=s(t[c]),n=l.get(e);if(!(i.get(e)!==c||void 0===n||n<o||n>=r)){if(a.length&&n<=a[a.length-1][1])return null;a.push([c,n])}}return a}!function s(c,C,k,P){for(;c<C&&k<P&&S(t[c],r[k]);)e(t[c],r[k]),c++,k++;for(;c<C&&k<P&&S(t[C-1],r[P-1]);)C--,P--,e(t[C],r[P]);if(c===C&&k===P)return;if(c===C||k===P){const e=k===P,n=e?t.slice(c,C):r.slice(k,P),o=e?[r[k-1],r[k]]:[t[c-1],t[c]];return void(n.some(e=>o.some(t=>t&&i.get(t)===i.get(e)))?E(c,C,k,P):e?a.push({kind:"delete",after:u,removed:n,priority:2,following:r.slice(k),preceding:r.slice(0,k).reverse()}):a.push({kind:"insert",after:n[0],added:n,priority:2}))}if(C-c===1&&P-k===1)return void e(t[c],r[k]);const V=function(e,i,l,s){if(!(n?.groups.length||o&&(n?.boundaryGroups||n?.images.length)))return;const a=Math.abs(n.offset)+1;if(i-e!==a||s-l!==a)return;const c=n.offset>0,u=c?0:a-1,d=c?a-1:0,f=t.slice(e,i),p=r.slice(l,s),m=c?a-1:1,h=f.map((e,t)=>[e,p[(t+m)%a]]);return{before:f,after:p,from:u,to:d,pairs:h}}(c,C,k,P),T=V&&function(e){const t=o?n.images:[];if(!n.groups.length&&!t.length)return;const[r,i]=e.pairs[e.from],l=m(r);return-1!==p.get(l)&&-1!==v.get(l)&&e.pairs.every(([e,t])=>S(e,t))&&d(r,i,n.groups,t)?i:void 0}(V),H=V&&function(e){if(o&&n.boundaryGroups&&$(e.before[e.from])&&e.pairs.every(([e,t])=>l.get(e)===l.get(t)))return e.pairs.filter((t,n)=>n!==e.from).every(([e,t],o)=>d(e,t,n.boundaryGroups[o]))?{before:e.before,after:e.after,index:e.to||1}:void 0}(V);if(T||H||f&&function(e,n,o,l){const s=n-e;if(s<2||s!==l-o)return!1;const a=new Map;let c=!1;for(let n=0;n<s;n++){const l=i.get(t[e+n]),s=i.get(r[o+n]);c||=l!==s,a.set(l,(a.get(l)||0)+1),a.set(s,(a.get(s)||0)-1)}return c&&[...a.values()].every(e=>0===e)}(c,C,k,P)){if(H)for(const[t,n]of V.pairs)e(t,n);return void E(c,C,k,P,"reorder",T,H)}let O=L(c,C,k,P,p,v,m);if(0===O?.length&&(y??=w(t,h),b??=w(r,h),O=L(c,C,k,P,y,b,h)),0===O?.length&&(x??=w(t,g),M??=w(r,g),O=L(c,C,k,P,x,M,g)),O?.length)for(const[n,o]of[...O,[C,P]])s(c,n,k,o),n<C&&e(t[n],r[o]),c=n+1,k=o+1;else E(c,C,k,P,O?"replacement":void 0)}(0,t.length,0,r.length)}(t.children,r.children,t,r))}(e,t),a}function S(e){return e.replace(/\s+/g," ").trim()}function E(e,t){return e!==t&&e.replace(/\s/g,"")===t.replace(/\s/g,"")}function L(e,t,n){for(;e.node?.isConnected&&e.parent?.node;){const{display:t}=e.node.ownerDocument.defaultView.getComputedStyle(e.node);if("inline"!==t&&"contents"!==t)break;e=e.parent}if(!t.has(e)){const{node:o}=e,r=[],i=o?.isConnected&&V(o,n,r)===T(e)&&h(e)?o.innerText:void 0;t.set(e,"string"==typeof i?{text:i,omitted:JSON.stringify(r)}:void 0)}return t.get(e)}function V(e,t,n){return t&&e.querySelector(t)?[...e.childNodes].map(e=>3===e.nodeType?e.textContent:1!==e.nodeType?"":e.matches(t)?(n.push(e.textContent),""):V(e,t,n)).join(""):e.textContent}function T(e){return e.parts.map(e=>"string"==typeof e?e:T(e)).join("")}function H({before:e,after:t}){return O(e.rawText,t.rawText)||O(T(e),T(t))}function O(e,t){if(!/\S/.test(e)||!E(e,t))return;const n=e.match(/\s+|\S+/g),o=t.match(/\s+|\S+/g);let r=0,i=0;for(;r<Math.min(n.length,o.length)&&n[r]===o[r];)r++;for(;i<Math.min(n.length,o.length)-r&&n.at(-1-i)===o.at(-1-i);)i++;const l=Math.max(0,r-1),s=Math.max(0,i-1);return{type:"spacing",before:n.slice(l,n.length-s).join(""),after:o.slice(l,o.length-s).join("")}}function R(e,t=new Map){return e?(t.has(e)||t.set(e,(e.parts||[]).map(e=>{if("string"==typeof e)return e;const n=R(e,t);return/^(?:p|div|section|article|main|aside|header|footer|nav|h[1-6]|li|[ou]l|d[ldt]|blockquote|pre|table|tr|t[dh]|caption|figure|figcaption|br|hr)$/.test(e.tag)?` ${n} `:n}).join("")),t.get(e)):""}function j(e,t){return!!e&&!!t&&Object.entries(t).some(([t,n])=>{if(!["order","gallery-order"].includes(n?.type)||!Object.hasOwn(e,t))return!1;const o=e[t];return o?.type===n.type&&o.members===n.members&&o.value!==n.value})}function N(e,t,n,o){return e.fieldsByRow?.[t]?.every(e=>""===z(n[e],o)?.label)}function $(e){return!e.text&&!e.media?.some(Boolean)&&!/^(?:a|button|input|select|textarea|form|details|img|video|audio|iframe|canvas|svg|object|embed)$/.test(e.tag)&&e.children.every($)}function B(e,t){const n=new Map;return e&&function e(o){if("img"===o.tag){const e=o.attributes.find(([e])=>"alt"===e)?.[1];t.has(e)&&n.set(e,n.has(e)?null:o)}o.children.forEach(e)}(e),n}function D(e,t,n,o,r,{html:i,peerLabels:l}){const{fieldsByRow:s}=r[e],a=o[e].fieldsByRow;if([t,...n].some(e=>!a?.[e]||!s?.[e]))return[];const c=[],u=new Set(a[t]);let d;function f(e,t){if(l.has(e))return l.get(e);const n=new Set;function o(e,t){n.add(S(R(e,t)));for(const n of e.children)o(n,t)}for(const r of e){if("row-image"===t[r]?.type)continue;const e=F(t[r],i);if(!e.length)return null;for(const t of e)t.entry?o(t.entry,t.cache):n.add(t.label)}return l.set(e,n),n}function p(e,t){return d??=n.flatMap(e=>[f(a[e],o),f(s[e],r)]),d.some(n=>!n||n.has(e)||t.length&&t.every(e=>n.has(e)))}for(const e of s[t]){const t=r[e],n=o[e];if(u.has(e)&&t&&n?.type===t.type&&n?.value===t.value)for(const{entry:e,cache:o,label:r}of F(t,i,n.formatted===t.formatted)){if(!r)continue;if(!e){p(r,[])||c.push([r]);continue}const t=A(e,o).map(e=>S(R(e,o))),n=q(e,new Set([r,...t]),o);n.get(r)?.substantive&&!p(r,t.join(" ")===r?t:[])&&c.push([r]);const i=[...new Set(t.filter(e=>n.has(e)))];i.length>1&&i.some(e=>n.get(e).substantive)&&!p(r,i)&&c.push(i)}}return c}function F(e,t,n=!0){const o=z(e,t);if(!o)return[];const r=n&&"html"===e.type&&"string"==typeof e.formatted?z({type:"html",value:e.formatted},t):null;return r?[o,r]:[o]}function z(e,t){if("string"==typeof e?.value){if("text"===e.type)return{label:S(e.value)};if("html"===e.type){if(!t.has(e.value))try{const n=(new DOMParser).parseFromString(e.value,"text/html"),o=M(n,n,[],n.body),r=new Map;t.set(e.value,{entry:o,cache:r,label:S(R(o,r))})}catch{t.set(e.value,null)}return t.get(e.value)}}}function A(e,t){const n=e.children.flatMap(e=>A(e,t));return n.length||!/^(?:p|h[1-6]|li|d[dt]|blockquote|pre|figcaption)$/.test(e.tag)?n:S(R(e,t))?[e]:[]}function W(e,t,n){let o;(e.text===t||/[\p{L}\p{N}]/u.test(e.text||""))&&(o=function(e,t){let n="content";for(let o=e;o;o=o.parent){const r=o.attributes.find(([e])=>"role"===e)?.[1]??"";if("button"===o.tag||/(?:^|\s)button(?:\s|$)/.test(r))return;if("a"!==o.tag&&!/(?:^|\s)link(?:\s|$)/.test(r))continue;const i=A(o,t);if(i.length<2||!i.some(e=>/^h[1-6]$/.test(e.tag)))return;const l=i.find(t=>t===e||Q(t,e));if(!l)return;/^h[1-6]$/.test(l.tag)||(n="support")}return n}(e,n));for(const r of e.children){if("content"===o)break;o=W(r,t,n)||o}return o}function q(e,t,n=new Map){const o=new Map;e&&function e(r){const i=S(R(r,n));if(t.has(i)){const e=o.get(i);o.set(i,void 0===e||e&&Q(e,r)?r:null)}r.children.forEach(e)}(e);const r=new Map;for(const[e,t]of o){const o=t&&W(t,e,n);o&&r.set(e,{entry:t,substantive:"content"===o})}return r}function Z(e,t){let n=0,o=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;for(;o<e.length-n&&o<t.length-n&&e[e.length-o-1]===t[t.length-o-1];)o++;let r=e.length-o,i=t.length-o;for(;n>0&&/\S/.test(e[n-1]);)n--;if(r>n&&/\S/.test(e[r-1]))for(;r<e.length&&/\S/.test(e[r]);)r++;if(i>n&&/\S/.test(t[i-1]))for(;i<t.length&&/\S/.test(t[i]);)i++;return{before:e.slice(n,r).trim(),after:t.slice(n,i).trim()}}function I(e,t){return t?G(e,t):""===S(e)}function G(e,t){return _(e,t,1)>0}function _(e,t,n=1/0){if(!t)return 0;let o=0,r=(e=S(e)).indexOf(t);for(;-1!==r;){const i=r+t.length;if(J(e,r)&&J(e,i)&&++o===n)break;r=e.indexOf(t,r+1)}return o}function J(e,t){return!/[\p{L}\p{N}_]$/u.test(e.slice(Math.max(0,t-2),t))||!/^[\p{L}\p{N}_]/u.test(e.slice(t,t+2))}function X(e,t,n,o=!1){const r=S(e),i=S(t);if(r===i)return!1;if(r===n.before&&i===n.after||r===n.fullBefore&&i===n.fullAfter)return!0;if(o){const e=Z(r,i);if(e.before===n.before&&e.after===n.after)return!0;if(function(e,t,n,o){if(!n||!o||e.length-n.length!==t.length-o.length)return!1;for(let r=e.indexOf(n);-1!==r;r=e.indexOf(n,r+1))if(t.startsWith(o,r)&&J(e,r)&&J(t,r)&&J(e,r+n.length)&&J(t,r+o.length)&&e.slice(0,r)===t.slice(0,r)&&e.slice(r+n.length)===t.slice(r+o.length))return!0;return!1}(r,i,n.fullBefore,n.fullAfter))return!0}return(n.before?_(r,n.before)>_(i,n.before):!r)&&(n.after?_(i,n.after)>_(r,n.after):!i)}function Y(e,t,n){return e.tag!==t.tag||(e.children.length||t.children.length)&&e.text!==t.text&&S(n(e))===S(n(t))}function U(e=[],t,n,o,r){return e.flatMap(e=>{const i=U(e.children,t,n,o,r);let l;return l="media"===o.type?e.media?.includes(t):"attribute"===o.type?e.attributes.some(([e,n])=>e===o.name&&G("string"==typeof n?n:JSON.stringify(n),t)):("markup"!==o.type||e.tag===(r?o.oldTag:o.newTag))&&I(n(e),t),"text"===o.type&&i.length?i:[...l?[e]:[],...i]})}function K(e,t,n){if(e.unresolved)return 0;if(e.matches=[],e.spacing){const n=t.filter(e=>"spacing"===e.type),o=n.length&&H(e);return e.matches=n.filter(e=>o?.before===e.before&&o?.after===e.after),e.matches.length?2:0}let o=0;for(const r of t){if("spacing"===r.type)continue;let t=0;if("attributes"===e.kind){if(!["text","attribute"].includes(r.type))continue;const n=new Map(e.before.attributes),o=new Map(e.after.attributes);for(const e of new Set([...n.keys(),...o.keys()])){if("attribute"===r.type&&e!==r.name)continue;const i=n.get(e),l=o.get(e);JSON.stringify(i)!==JSON.stringify(l)&&(X("string"==typeof i?i:JSON.stringify(i)||"","string"==typeof l?l:JSON.stringify(l)||"",r)&&(t="attribute"===r.type||r.before&&r.after?2:1))}}else if("insert"===e.kind)!r.before&&e.added.some(e=>G(n(e),r.after))&&(t=Math.max(t,1));else if("delete"===e.kind)!r.after&&e.removed.some(e=>G(n(e),r.before))&&(t=Math.max(t,1));else if("media"===r.type)(e.before?.media||[]).some((t,n)=>t===r.before&&e.after?.media?.[n]===r.after)&&(t=2);else if("markup"===r.type)e.before?.tag===r.oldTag&&e.after?.tag===r.newTag&&Y(e.before,e.after,n)&&I(n(e.before),r.before)&&I(n(e.after),r.after)&&(t=r.before&&r.after?2:1);else if("text"===r.type){const o=!(!r.before||!r.after),i=o&&X(e.before?.text||"",e.after?.text||"",r,!0);(i||X(n(e.before),n(e.after),r,o))&&(t=o?2:1,i&&(e.directInput=!0))}t&&e.matches.push(r),o=Math.max(o,t)}return o}function Q(e,t){return!!e?.children.some(e=>e===t||e.node&&e.node===t?.node||Q(e,t))}const ee=new Set(["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","PageDown","PageUp","Home","End"," "]);function te(e,t){let n;for(const o of e?.rects??[]){const e=t(o);if(e.visible)return e;(!n||e.distance<n.distance)&&(n=e)}return n}function ne(e){return new Promise(t=>{const n=()=>{e.clearTimeout(o),e.cancelAnimationFrame(r),t()},o=e.setTimeout(n,100);let r=e.requestAnimationFrame(()=>{r=e.requestAnimationFrame(n)})})}function oe(e,t=!1){if(!ue(e,{visibilityProperty:!0,opacityProperty:!0}))return;const{left:n,right:o,top:r,bottom:i,width:l,height:s}=e.getBoundingClientRect();if(!(t||l&&s))return;const a=e.ownerDocument,{documentElement:c,body:u,defaultView:d}=a,f={left:n,right:l?o:n+1,top:r,bottom:s?i:r+1},p={...f},m={x:f.right-f.left,y:f.bottom-f.top},h="visible"===d.getComputedStyle(c).overflow,g=d.getComputedStyle(e);for(let n=e;n&&n!==c;){const o=n===e?g:d.getComputedStyle(n),{position:r,display:i,overflowX:l,overflowY:s}=o;if(n!==e&&(n!==u||!h)&&"inline"!==i&&("visible"!==l||"visible"!==s)&&n.offsetWidth&&n.offsetHeight){const{bounds:e,scaleX:r,scaleY:i}=ce(n,o);for(const[a,c,u,d,h]of[["x",l,"left","right",r],["y",s,"top","bottom",i]]){if("visible"===c)continue;const r="clip"===c?[0,0]:ae(n,o,a,h),i=t&&"hidden"===c,l="y"===a==("horizontal-tb"===o.writingMode);if(i&&r.some(e=>e)&&(l||f[u]<e[u]||f[d]>e[d]||re(o,g,a)))return{boundary:n};if(!se(f,p,e,u,d,i?[0,0]:r))return{boundary:n};m[a]=Math.min(m[a],p[d]-p[u])}}n="absolute"===r||"fixed"===r?n.offsetParent:n.parentElement}return{clipped:f,extent:m}}function re(e,t,n){const o=e=>e&&"auto"!==e&&0!==parseFloat(e);return("x"===n?["Left","Right"]:["Top","Bottom"]).some(n=>o(e[`scrollPadding${n}`])||o(t[`scrollMargin${n}`]))}function ie(e,t,n=!1){const o=oe(e,n);if(!o?.clipped)return;const{clipped:r,extent:i}=o,{ownerDocument:l}=e,s=l.documentElement;if(r.left=Math.max(s.clientLeft,r.left),r.right=Math.min(s.clientLeft+s.clientWidth,r.right),r.top=Math.max(0,r.top),r.bottom=Math.min(s.clientHeight,r.bottom),r.right<=r.left)return{rects:[]};const a=t?.({...r,top:0,bottom:s.clientHeight}),c=a?.visibleCenterX??(r.left+r.right)/2,u=ge(e,c);if(r.bottom<=r.top)return{rects:[],header:u?.bottom};const d={rects:[r],inViewport:!0,extent:i};if(!u)return d;const f={left:Math.max(r.left,u.left),right:Math.min(r.right,u.right),top:Math.max(r.top,u.top),bottom:Math.min(r.bottom,u.bottom)};if(!le(f)||!u.node.contains(l.elementFromPoint(c,(f.top+f.bottom)/2)))return d;const p=[{...r,top:f.bottom},{...r,bottom:f.top},{...f,left:r.left,right:f.left},{...f,left:f.right,right:r.right}].filter(le);return!p.length&&u.bottom>=s.clientHeight&&u.top<=0?void 0:{rects:p,inViewport:!0,extent:i,header:u.bottom}}function le({left:e,right:t,top:n,bottom:o}){return t>e&&o>n}function se(e,t,n,o,r,[i,l]){return e[o]=Math.max(e[o],n[o]),e[r]=Math.min(e[r],n[r]),t[o]=Math.max(n[o],t[o]+i),t[r]=Math.min(n[r],t[r]+l),t[r]>t[o]}function ae(e,t,n,o){const r="x"===n,i=r?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight;if(i<=0)return[0,0];const l=r?e.scrollLeft:e.scrollTop,s=t.display.endsWith("flex")&&t.flexDirection===(r?"row-reverse":"column-reverse"),a=(r&&"rtl"===t.direction)!==s;let c=a?-i:0,u=a?0:i;return("horizontal-tb"!==t.writingMode||l<c||l>u)&&(c=-i,u=i),[(l-u)*o,(l-c)*o]}function ce(e,t){const n=e.getBoundingClientRect(),o=n.width/e.offsetWidth,r=n.height/e.offsetHeight,i=n.left+e.clientLeft*o,l=n.top+e.clientTop*r,s={left:i,top:l,right:i+e.clientWidth*o,bottom:l+e.clientHeight*r},a=t.overflowClipMargin;if("clip"!==t.overflowX&&"clip"!==t.overflowY||!a||"0px"===a)return{bounds:s,scaleX:o,scaleY:r};const c=a.split(" ").map(parseFloat).find(Number.isFinite)??0,u=a.includes("border-box")?n:s,d=a.includes("content-box");return{scaleX:o,scaleY:r,bounds:{left:u.left+((d?parseFloat(t.paddingLeft):0)-c)*o,right:u.right-((d?parseFloat(t.paddingRight):0)-c)*o,top:u.top+((d?parseFloat(t.paddingTop):0)-c)*r,bottom:u.bottom-((d?parseFloat(t.paddingBottom):0)-c)*r}}}function ue(e,t={visibilityProperty:!0}){return!!e?.isConnected&&!!e.getClientRects().length&&(!e.checkVisibility||e.checkVisibility(t))&&"visible"===e.ownerDocument.defaultView.getComputedStyle(e).visibility}function de(e){return e.matchMedia("(prefers-reduced-motion: reduce)").matches?"instant":"smooth"}function fe(e,{behavior:t,header:n=he(e),nearest:o=!1}={}){const r=e.ownerDocument,i=r.defaultView,l=t??de(i);if(o&&!n)return void e.scrollIntoView({behavior:l,block:"nearest",inline:"nearest"});const s=i.getComputedStyle(e).scrollMarginTop,a=r.documentElement,c=a.clientHeight,u=i.getComputedStyle(a),d=me(u.scrollPaddingTop,c),f=me(u.scrollPaddingBottom,c);let p,m;try{let t=o?"nearest":"start";if(o){const e=n-parseFloat(s);null!==d&&e>d&&(p=a.getAttribute("style"),a.style.setProperty("scroll-padding-top",`${e}px`,"important"))}else{const t=n>0&&null!==d?`max(${s}, ${n-d}px)`:s;m=e.getAttribute("style"),e.style.setProperty("scroll-margin-top",`calc(${t} + 1lh)`,"important")}if(!o&&null!==d&&null!==f){const n=i.getComputedStyle(e),o=c-d-f-parseFloat(n.scrollMarginTop)-parseFloat(n.scrollMarginBottom),r=o-e.getBoundingClientRect().height;if(r>=0&&(t="center"),r>0&&"horizontal-tb"===u.writingMode){const e=Math.min(o/3,r);p=a.getAttribute("style"),a.style.setProperty("scroll-padding-bottom",`${f+e}px`,"important")}}e.scrollIntoView({behavior:l,block:t,inline:"nearest"})}finally{void 0!==p&&pe(a,p),void 0!==m&&pe(e,m)}}function pe(e,t){e.setAttribute("style",t??""),null===t&&e.removeAttribute("style")}function me(e,t){if("auto"===e)return 0;const n=parseFloat(e);return Number.isFinite(n)?n*(e.endsWith("%")?t/100:1):null}function he(e){const t=e.getBoundingClientRect();return ge(e,t.left+t.width/2)?.bottom??0}function ge(e,t){const n=e.ownerDocument;for(let o=n.elementFromPoint(t,1);o&&!o.contains(e);o=o.parentElement){const e=n.defaultView.getComputedStyle(o);if("fixed"!==e.position&&"sticky"!==e.position)continue;if("0"===e.opacity||!ue(o,{visibilityProperty:!0,opacityProperty:!0}))continue;const{left:t,right:r,top:i,bottom:l}=o.getBoundingClientRect();if("fixed"===e.position||i<=parseFloat(e.top)+1)return{node:o,left:t,right:r,top:i,bottom:l}}}window.jQuery(()=>{const e=window.meetTheFrontendLivePreviewPanel;if(!e)return;const t=document.querySelector("#wpbody-content > .wrap > h1.long-header ~ a");try{const n=window.wp?.revisions?.view?.frame?.model;if(!n||"function"!=typeof n.get||"function"!=typeof n.on||"function"!=typeof n.off)throw new Error("The native revision selection is unavailable.");if(!t)throw new Error("The native revision header is unavailable.");!function(e,t,n){const{strings:o}=e;let r,i=t.get("to"),l=0;const s=n.ownerDocument,a=s.getElementById("mtflpp-toggle");a.classList.replace("mtflpp-launcher","mtflpp-inline-launcher");const d=s.createElement("button");d.type="button",d.className="button-link",d.textContent=o.previewRevision,d.setAttribute("aria-controls","mtflpp-panel"),a.append(d),n.after(a);const f=c(o,{postTitle:m(i),publicRedirect:e.publicRedirect,inlineLauncher:d,canRememberVisibility:!1,onOpen(){f.setVisible(!0),g()},onClose:v,onRefresh:g,onRetry:()=>g(),beforeViewportChange:e=>p.beforeViewportChange(e),beforeMove(){l++,p.clear()},afterMove(){f.visible&&g()}}),p=function(e,t,n,o,r=[]){const i=u(r);let l,s,a,c,d;function f(){d?.()}return{get hasPreview(){return!!l},get hasHtmlPreview(){return!!s},get redirectDestination(){return c},load:function(r,u,p=()=>!1,m){const h=new URL(r);if("https:"!==h.protocol&&"http:"!==h.protocol)throw Object.assign(new Error(n.failed),{code:"mtflpp_preview_unsupported_url"});if(h.origin!==window.location.origin){const e=n.originMismatch.replace("%s",()=>h.origin+h.pathname);throw Object.assign(new Error(e),{code:"mtflpp_preview_origin_mismatch"})}const g=h.searchParams.get("mtflpp_token");if(!g)throw new Error(n.failed);return window.crossOriginIsolated&&h.searchParams.set("mtflpp_isolated","1"),f(),h.searchParams.delete("mtflpp_source"),e.followChanges&&h.searchParams.set("mtflpp_source","1"),o(n.updating),new Promise((r,f)=>{const w=e.stage.ownerDocument.createElement("iframe");w.title=n.title,w.className="mtflpp-frame mtflpp-loading",w.setAttribute("aria-hidden","true"),w.setAttribute("tabindex","-1"),w.referrerPolicy="same-origin";let v=!1,y=!1;const b=setTimeout(()=>M(new Error(n.failed)),3e4),x=()=>{y=!0,M()};function M(e){v||(v=!0,e&&(y=!0),clearTimeout(b),d===x&&(d=null),w!==l&&(w.onload=null,w.onerror=null,w.remove()),e?f(e):r())}d=x,w.onload=async()=>{const r=w!==l;if(r||(s=null,a=null),y||!u())return void M();let d,f,v;try{const e=w.contentDocument,t=e?.querySelector('meta[name="meet-the-frontend-live-preview-panel"]');t?.content===g?d=e:r&&!t&&(f=function(e,t){if("text/html"!==e?.contentType)return;const n=e.defaultView?.performance.getEntriesByType("navigation")[0];if(!(n?.redirectCount>0))return;const o=new URL(n.name);return o.origin!==t.origin||o.pathname===t.pathname&&o.search===t.search?void 0:o.pathname}(e,h))}catch{}d&&(e.followChanges&&i.capture(d,r?m:void 0),d.documentElement.style.setProperty("overscroll-behavior","contain","important")),d&&r&&(t.remember(s),e.followChanges&&p()&&s&&(v=i.findChange(s,d))),r&&l&&(l.onload=null,l.onerror=null,l.remove()),l=w,s=d,a=null,c=f,w.classList.remove("mtflpp-loading"),w.removeAttribute("aria-hidden"),w.removeAttribute("tabindex");const b=()=>!y&&u()&&w===l&&d===s&&(!d||w.contentDocument===d);let x;if(d&&r){const n=e.canvasTarget&&(t=>e.canvasTarget(w,t,{fitTarget:!0}));x=await t.restore(d,v,()=>b()&&e.followChanges&&p(),n)}b()?(a=x,o(n.current,"ready"),M()):M()},w.onerror=()=>{w===l?(s=null,a=null,c=void 0,u()&&o(n.failed,"error")):M(new Error(n.failed))},w.src=h.href,e.stage.append(w)})},cancel:f,beforeViewportChange({canvasTarget:n,canFollow:o,...r}){const i=a,c=s,u=l;if(i&&c)return t.keepInView(i,{...r,canvasTarget:e=>n(u,e),canFollow:()=>i===a&&c===s&&u.contentDocument===c&&e.visible&&e.followChanges&&o()})},clear(){f(),t.remember(s),l&&(l.onload=null,l.onerror=null),l=null,s=null,a=null,c=void 0,e.clearPreview()}}}(f,function(){let e,t=0,n=0;return{remember(e){try{e&&(t=e.defaultView.scrollY)}catch{}},async restore(e,o,r=()=>!0,i){const l=++n;try{const s=e.defaultView;let a;if(s.scrollTo({top:t,left:0,behavior:"instant"}),o?.ownerDocument===e&&r()){if(await ne(s),l!==n||o.ownerDocument!==e||!r())return;if(function(e,t){const n=e.ownerDocument;for(let t=e;t;t=t.parentElement)if("until-found"!==t.getAttribute("hidden")?.toLowerCase()&&(t.hasAttribute("hidden")||"none"===n.defaultView.getComputedStyle(t).display))return!1;let o=!1;for(let r=e;r&&e.isConnected&&e.ownerDocument===n&&t();r=r.parentElement){if("until-found"===r.getAttribute("hidden")?.toLowerCase()){if(r.dispatchEvent(new n.defaultView.Event("beforematch",{bubbles:!0})),!(e.isConnected&&e.ownerDocument===n&&r.isConnected&&r.ownerDocument===n&&r.contains(e)&&t()))break;"until-found"===r.getAttribute("hidden")?.toLowerCase()&&r.removeAttribute("hidden"),o=!0}const i=r.parentElement;i instanceof n.defaultView.HTMLDetailsElement&&!i.open&&r!==Array.from(i.children).find(e=>"summary"===e.localName)&&(i.open=!0,o=!0)}return o}(o,()=>l===n&&r())&&await new Promise(e=>s.setTimeout(e,0)),l!==n||!r())return;const t=o.ownerDocument===e?function(e){if(!e?.isConnected)return null;const t=oe(e,!0);if(t?.clipped)return e;if(!t?.boundary)for(const t of e.querySelectorAll("*"))if(oe(t,!0)?.clipped)return t;for(let n=t?.boundary||e.parentElement;n;){const e=oe(n,!0);if(e?.clipped)return n;n=e?.boundary||n.parentElement}return null}(o):null;t&&(function(e,t){const n=ie(e,t,!0);if(!n?.inViewport)return void fe(e);const{rects:o,extent:r,header:i=0}=n,l=e.ownerDocument.documentElement,s=Math.min(r.x,l.clientWidth),a=Math.min(r.y,l.clientHeight-i);o.some(e=>e.right-e.left>=s-1&&e.bottom-e.top>=a-1)?t&&te(n,t)?.reveal(de(e.ownerDocument.defaultView)):fe(e,{nearest:!0,header:i})}(t,i),o.contains(t)&&(a=t))}return t=s.scrollY,a}catch{}},keepInView(t,{canvas:n,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:l,canFollow:s}){try{const a=e?.target===t&&e.canFollow();if(e?.cancel(),!t.isConnected||!s())return;if(!a){const e=ie(t,o);if(!te(e,o)?.visible)return}const c=new AbortController,u={target:t,canFollow:()=>!c.signal.aborted&&s(),cancel(){c.abort(),e===u&&(e=null)}};return e=u,function(e,t,n,o,r){const i=e=>{e.isTrusted&&("keydown"!==e.type||ee.has(e.key))&&r()},l={capture:!0,passive:!0,signal:o};for(const n of[e,t])for(const e of["wheel","touchmove","pointerdown","keydown"])n?.addEventListener(e,i,l);t?.addEventListener("scroll",()=>{n?.()&&r()},l)}(t.ownerDocument.defaultView,n,l,c.signal,()=>{u.cancel(),i?.()}),async function(e,t,n,o){try{const r=e.ownerDocument.defaultView;if(await ne(r),!o())return;const{scrollX:i,scrollY:l}=r,s=n();if(s&&await s,!o()||r.scrollX!==i||r.scrollY!==l)return;let a=ie(e,t);a&&!a.rects.length&&(fe(e,{behavior:"instant",header:a.header}),a=ie(e,t)),te(a,t)?.reveal()}catch{}}(t,o,r,u.canFollow).finally(u.cancel)}catch{}}}}(),o,h,e.comparisonExcludedSelectors);function m(t){if(!t)return"";const n=t.get("dateShort")||t.get("date")||"",r=t.get("author")?.name||"",i=o.revisionLabel.replace("%1$s",()=>n).replace("%2$s",()=>r);return t.id===e.postId?`${o.currentVersion} — ${i}`:i}function h(e,t="loading",n={}){"ready"!==t&&p.hasPreview||f.setTitle(m(i)),f.report(e,t,{hasPreview:p.hasPreview,hasHtmlPreview:p.hasHtmlPreview,redirectDestination:p.redirectDestination,canRefresh:f.visible&&["ready","error"].includes(t),...n})}async function g(t=!0){clearTimeout(r),p.cancel();const n=++l;if(!f.visible)return;const s=i?.id===e.postId?e.currentPreviewUrl:i?.get("mtflppPreviewUrl");if("string"!=typeof s||!s)return p.clear(),void h(o.unavailable,"error",{canRetry:!1,canRefresh:!1,reason:"unavailable"});try{await p.load(s,()=>f.visible&&n===l,()=>f.followChanges&&t,{revision:{type:"selection",value:i.id}})}catch(e){if(f.visible&&n===l){const t={mtflpp_preview_origin_mismatch:"origin-mismatch",mtflpp_preview_unsupported_url:"unsupported-url"}[e?.code]||"";h("origin-mismatch"===t?e.message:o.failed,"error",{canRetry:!t,canRefresh:!t,reason:t})}}}function w(){const e=t.get("to");e?.id!==i?.id&&(i=e,l++,p.cancel(),clearTimeout(r),f.visible&&(h(o.stale,"stale"),r=setTimeout(g,250)))}function v(){l++,clearTimeout(r),f.setVisible(!1),p.clear(),f.returnToEditor()}t.on("update:revisions",w),window.addEventListener("pagehide",e=>{e.persisted||(t.off("update:revisions",w),v())}),f.visible&&g()}(e,n,t)}catch(n){!function(e,t,n){document.getElementById("mtflpp-panel")?.remove(),document.getElementById("mtflpp-toggle")?.remove(),document.getElementById("mtflpp-publish-preview")?.remove(),document.getElementById("mtflpp-term-preview")?.remove();const o=document.createElement("div");o.className="notice notice-error inline",o.setAttribute("role","alert");const r=document.createElement("p");r.textContent=e,o.append(r);const i=n||document.querySelector("#wpbody-content .wp-header-end")||document.querySelector("#wpbody-content .wrap h1, #wpbody-content .wrap h2");i?i.after(o):(document.getElementById("wpbody-content")||document.body).prepend(o),console.error("Meet the Frontend – Live Preview Panel could not start.",t)}(e.strings.bootFailed,n,t)}})})();
  • meet-the-frontend-live-preview-panel/tags/1.3.1/build/term-editor.asset.php

    r3820590 r3822693  
    99                'wp-primitives'
    1010        ),
    11         'version' => '6dfda17ecee9014448db'
     11        'version' => '17fe6b87b747b814253d'
    1212);
  • meet-the-frontend-live-preview-panel/tags/1.3.1/build/term-editor.js

    r3820590 r3822693  
    1 (()=>{"use strict";const e=window.wp.data,t=window.wp.preferences,n=window.wp.element,o=window.wp.components,r=window.wp.notices,i=window.wp.primitives,a=window.ReactJSXRuntime,s={refresh:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M12 5.5L17.7929 11.2929C18.1834 11.6834 18.1834 12.3166 17.7929 12.7071L16 14.5M16 5.5H12V9.5M12 18.5L6.20711 12.7071C5.81658 12.3166 5.81658 11.6834 6.20711 11.2929L8 9.5M8 18.5H12V14.5"})}),more:(0,a.jsxs)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,a.jsx)(i.Path,{d:"M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z",fill:"currentColor",stroke:"none"}),(0,a.jsx)(i.Path,{d:"M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z",fill:"currentColor",stroke:"none"}),(0,a.jsx)(i.Path,{d:"M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z",fill:"currentColor",stroke:"none"}),(0,a.jsx)(i.Path,{d:"M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z"}),(0,a.jsx)(i.Path,{d:"M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z"}),(0,a.jsx)(i.Path,{d:"M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z"})]}),expand:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M4.75 10V4.75H10M4.75 4.75L10 10M14 19.25H19.25V14M19.25 19.25L14 14"})}),compact:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M10 4.75V10H4.75M10 10L4.75 4.75M19.25 14H14V19.25M14 14L19.25 19.25"})}),pip:(0,a.jsxs)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,a.jsx)(i.Path,{d:"M4.75 9.25V16C4.75 16.6904 5.30964 17.25 6 17.25H8M4.75 9.25V6C4.75 5.30964 5.30964 4.75 6 4.75H16C16.6904 4.75 17.25 5.30964 17.25 6V8M4.75 9.25H8"}),(0,a.jsx)(i.Path,{d:"M10.75 11.25C10.75 10.9739 10.9739 10.75 11.25 10.75H18.75C19.0261 10.75 19.25 10.9739 19.25 11.25V18.75C19.25 19.0261 19.0261 19.25 18.75 19.25H11.25C10.9739 19.25 10.75 19.0261 10.75 18.75V11.25Z",fill:"currentColor"})]}),move:(0,a.jsxs)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,a.jsx)(i.Path,{d:"M9.25 5.75H8.75V6.25H9.25V5.75Z",fill:"currentColor",stroke:"none"}),(0,a.jsx)(i.Path,{d:"M9.25 11.75H8.75V12.25H9.25V11.75Z",fill:"currentColor",stroke:"none"}),(0,a.jsx)(i.Path,{d:"M9.25 17.75H8.75V18.25H9.25V17.75Z",fill:"currentColor",stroke:"none"}),(0,a.jsx)(i.Path,{d:"M15.25 5.75H14.75V6.25H15.25V5.75Z",fill:"currentColor",stroke:"none"}),(0,a.jsx)(i.Path,{d:"M15.25 11.75H14.75V12.25H15.25V11.75Z",fill:"currentColor",stroke:"none"}),(0,a.jsx)(i.Path,{d:"M15.25 17.75H14.75V18.25H15.25V17.75Z",fill:"currentColor",stroke:"none"}),(0,a.jsx)(i.Path,{d:"M9.25 5.75H8.75V6.25H9.25V5.75Z"}),(0,a.jsx)(i.Path,{d:"M9.25 11.75H8.75V12.25H9.25V11.75Z"}),(0,a.jsx)(i.Path,{d:"M9.25 17.75H8.75V18.25H9.25V17.75Z"}),(0,a.jsx)(i.Path,{d:"M15.25 5.75H14.75V6.25H15.25V5.75Z"}),(0,a.jsx)(i.Path,{d:"M15.25 11.75H14.75V12.25H15.25V11.75Z"}),(0,a.jsx)(i.Path,{d:"M15.25 17.75H14.75V18.25H15.25V17.75Z"})]}),warning:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M12 8L12 13M12 14.5L12 16M4.75 12C4.75 7.99593 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12Z",strokeLinejoin:"round"})}),info:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M12 16V11M12 9.5V8M19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12C4.75 7.99594 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12Z",strokeLinejoin:"round"})}),close:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M7.75 16.25L16.25 7.75M16.25 16.25L7.75 7.75"})}),check:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M7 12L10 15L17 8"})}),chevron:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M7 11L12 15L17 11"})}),desktop:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M4.75 16.75V17H3.25C3.11193 17 3 17.1119 3 17.25H21C21 17.1119 20.8881 17 20.75 17H19.25V16.75M4.75 16.75V8.5C4.75 7.80964 5.30964 7.25 6 7.25H18C18.6904 7.25 19.25 7.80964 19.25 8.5V16.75M4.75 16.75H19.25"})}),tablet:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M10 16.5H14M18.25 18V6C18.25 5.30964 17.6904 4.75 17 4.75H7C6.30964 4.75 5.75 5.30964 5.75 6L5.75 18C5.75 18.6904 6.30964 19.25 7 19.25H17C17.6904 19.25 18.25 18.6904 18.25 18Z"})}),mobile:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M11 16.5H13M16.25 18V6C16.25 5.30964 15.6904 4.75 15 4.75H9C8.30964 4.75 7.75 5.30964 7.75 6L7.75 18C7.75 18.6904 8.30964 19.25 9 19.25H15C15.6904 19.25 16.25 18.6904 16.25 18Z"})})};function l(e,t,n="right"){const o=e&&!Array.isArray(e)&&e.bounds&&["x","y","width","height"].every(t=>Number.isFinite(e.bounds[t]))&&e.bounds.width>0&&e.bounds.height>0&&[null,"left","center","right"].includes(e.dock)&&"boolean"==typeof e.expanded&&(void 0===e.anchor||["left","center","right"].includes(e.anchor));let r=!!o&&e.expanded;const i={width:480,height:393},a=o?{...e.bounds}:{x:0,y:0,...i};let s=o?e.dock:n,l=s||o&&e.anchor||"right";function c(){return"left"===l?0:"center"===l?.5:1}function d(e,n=t(!s),o=320,r=220){return e.width=Math.min(n.width,Math.max(Math.min(o,n.width),e.width)),e.height=Math.min(n.height,Math.max(Math.min(r,n.height),e.height)),e.x=Math.max(n.left,Math.min(n.right-e.width,e.x)),e.y=Math.max(n.top,Math.min(n.bottom-e.height,e.y)),e}function u(e){if(!s)return e;const n=t();return e.x="left"===s?n.left:"center"===s?n.left+(n.width-e.width)/2:n.right-e.width,e.y=n.bottom-e.height,e}return{area:t,compactRect:function(){return u(d({...a}))},launcherRect:function(e){return u(d({...e,x:a.x+(a.width-e.width)*c(),y:a.y+a.height-e.height},t(!s),1,1))},usableEdge:function(e){return!(s&&(e.includes("s")||"left"===s&&e.includes("w")||"right"===s&&e.includes("e")))},get anchor(){return l},get anchorFactor(){return c()},get dock(){return s},get expanded(){return r},get layout(){return{bounds:{...a},dock:s,anchor:l,expanded:r}},toggleExpanded(){r=!r},dockTo:function(e="right",t=!1){t&&Object.assign(a,i),r=!1,l=s=e},resize(e,n,o,r){Object.assign(a,function(e,n,o,r){const i=t(!s),a=n.includes("e")||n.includes("w"),c=n.includes("n")||n.includes("s"),d=function(e){return"center"===l?.5:e.includes("w")?1:0}(n),u=e.x+e.width*d,f=n.includes("n"),p=e.y+(f?e.height:0),m=function(e,t,n){return 0===n?e.right-t:1===n?t-e.left:2*Math.min(t-e.left,e.right-t)}(i,u,d),h=f?p-i.top:i.bottom-p,g=(n.includes("w")?-o:o)*(.5===d?2:1),w=Math.max(Math.min(320,m),Math.min(m,e.width+g)),v=Math.max(Math.min(220,h),Math.min(h,e.height+(f?-r:r))),y=a&&0!==o&&w!==e.width,b=c&&0!==r&&v!==e.height,x=f?p-v:p;return{x:y?u-w*d:e.preferredBounds.x,y:b?x:e.preferredBounds.y,width:y?w:e.preferredBounds.width,height:b?v:e.preferredBounds.height}}(e,n,o,r))},move:function(e,n,o,r=!1){const i=d({...e,x:e.x+n,y:e.y+o},t(!0),r?1:320,r?1:220);a.x=i.x+(r?(i.width-a.width)*c():0),a.y=i.y+(r?i.height-a.height:0),s=null}}}function c(i,{postTitle:a="",publicRedirect:c,inlineLauncher:d,nativeLauncher:u,canRememberVisibility:f=!0,onOpen:p,onClose:m,onRefresh:h,onRetry:g,beforeMove:w,afterMove:v,beforeViewportChange:y}){const b=window,x=document,M="meet-the-frontend-live-preview-panel",C=(0,e.select)(t.store),k=(0,e.dispatch)(t.store),E="width"===C.get(M,"fit")?"width":"automatic";k.setDefaults(M,{rememberVisibility:!0,rememberPosition:!0,panelOpen:!0,scrollToChanges:!0,viewport:"desktop",fitMode:E,customZoom:100,tabletOrientation:"portrait",mobileOrientation:"portrait"});const P=()=>!d&&(!u||u.fallbackMedia.matches);let S=!1!==C.get(M,"rememberVisibility"),L=!1!==C.get(M,"rememberPosition"),T=!1!==C.get(M,"scrollToChanges");const V=d?.parentElement??x.getElementById("mtflpp-toggle"),H=x.getElementById("mtflpp-panel");if(!V||!H)throw new Error("Preview panel markup is missing.");const j=d||function(e){let t;const{title:r,moveHelp:i}=e.dataset;return(0,n.flushSync)(()=>(0,n.createRoot)(e).render((0,n.createElement)(o.Button,{ref:e=>{t=e},variant:"secondary",label:r,title:r,description:i,"aria-controls":"mtflpp-panel","aria-expanded":!1},(0,n.createElement)("span",{className:"mtflpp-launcher-label"},r)))),t}(V),O=H.querySelector(".mtflpp-move-control"),R=H.querySelector(".mtflpp-resize"),N=H.querySelectorAll("[data-resize-edge]"),$=H.querySelector(".mtflpp-header"),_=H.querySelector(".mtflpp-caption"),D=H.querySelector(".mtflpp-viewport"),A=H.querySelector(".mtflpp-canvas"),F=H.querySelector(".mtflpp-stage"),B=H.querySelector(".mtflpp-empty"),W=H.querySelector(".mtflpp-devicebar"),q=H.querySelector(".mtflpp-dimensions"),z=H.querySelector(".mtflpp-feedback"),Z=H.querySelector('[role="status"]');let I;const G=function(e,t,n,o={},r=()=>{},i={desktop:"Desktop",tablet:"Tablet",mobile:"Phone"}){const a=e.ownerDocument.defaultView,s=e.querySelector(".mtflpp-canvas"),l=e.querySelector(".mtflpp-canvas-space"),c=n.querySelector(".mtflpp-dimensions-text"),d={desktop:[1280,800],tablet:[768,1024],mobile:[390,844]},u=Object.keys(d);let f=u.includes(o.device)?o.device:"desktop";const p=["automatic","window","width","custom"];let m=p.includes(o.fit)?o.fit:"automatic";const h=e=>Number.isInteger(e)&&e>=10&&e<=400;let g,w=h(o.customZoom)?o.customZoom:100,v=100;const y=e=>"desktop"===e?"landscape":"portrait",b=Object.fromEntries(u.map(e=>[e,"desktop"!==e&&["portrait","landscape"].includes(o[`${e}Orientation`])?o[`${e}Orientation`]:y(e)])),x=()=>b[f]===y(f)?d[f]:[...d[f]].reverse(),M=()=>"width"===m;let C,k,E;const P=a.matchMedia("(prefers-reduced-motion: no-preference)");function S(){const t=e.ownerDocument.defaultView.devicePixelRatio;return Number.isFinite(t)&&t>0?t:1}function L(e,t){if("custom"===m)return w/100/S();const n=s.clientWidth/e;if(M())return n;const o=Math.min(n,s.clientHeight/t);return"automatic"===m?Math.min(1/S(),o):o}function T(e,n){C=e;const[o,r]=x(),i=Math.max(0,(s.clientWidth-o*C)/2),a=Math.max(0,(s.clientHeight-r*C)/2);Object.assign(l.style,{width:`${Math.max(s.clientWidth,i+o*C)}px`,height:`${Math.max(s.clientHeight,a+r*C)}px`}),Object.assign(t.style,{left:`${i}px`,top:`${a}px`,transform:`scale(${C})`});const c=o*C>s.clientWidth+.01||r*C>s.clientHeight+.01,d="custom"===m||M();s.tabIndex=d&&c?0:-1,s.scrollLeft="custom"===m?n.x*C:0,s.scrollTop=d?n.y*C:0}function V(){if(!k)return;const e=k;k=null,e.window.cancelAnimationFrame(e.frame),e.resolve?.()}function H(e,t,n,o){return t<=0||o&&e<-1&&t<n?Math.max(e,t-n):e>=n||o&&e>0&&t>n+1?Math.min(e,t-n):0}function j(o=!1,a=!1){V();const[l,d]=x();if(Object.assign(t.style,{width:`${l}px`,height:`${d}px`}),!e.clientWidth||!e.clientHeight)return;const u=S(),p=`${i[f]} (${l} × ${d}) · `,h=Math.max(400,Math.ceil(e.clientWidth/l*u*100)),y=`${p}${"0".repeat(String(h).length)}%`;n.dataset.reserve!==y&&(n.dataset.reserve=y);const b=a?{x:0,y:0}:{x:(s.scrollLeft||0)/(C||1),y:(s.scrollTop||0)/(C||1)};if(s.style.overflowX="hidden",s.style.overflowY="hidden","custom"===m){const e=L(l,d);for(let t=0;t<2;t++)l*e>s.clientWidth+.01&&(s.style.overflowX="scroll"),d*e>s.clientHeight+.01&&(s.style.overflowY="scroll")}else M()&&d*L(l,d)>e.clientHeight&&(s.style.overflowY="scroll");if(!s.clientWidth||!s.clientHeight)return;const E=L(l,d),H=Math.round(E*u*100),j=H!==v||u!==g;v=H,g=u;const O=`${p}${"custom"===m?w:v}%`;c.textContent!==O&&(c.textContent=O),j&&r();const R=C??E;if(!o||!P.matches||R===E)return void T(E,b);const N={window:e.ownerDocument.defaultView,frame:null},$=N.window.performance.now();k=N;const _=e=>{T(e,b),N.scrollLeft=s.scrollLeft,N.scrollTop=s.scrollTop};_(R);const D=e=>{if(k!==N)return;const t=Math.min(1,Math.max(0,(e-$)/200));_(R+(E-R)*(1-(1-t)**3)),t<1?N.frame=N.window.requestAnimationFrame(D):V()};N.frame=N.window.requestAnimationFrame(D)}function O(){j()}function R(){E?.();const t=e.ownerDocument.defaultView.matchMedia(`(resolution: ${S()}dppx)`);t.addEventListener("change",R),E=()=>t.removeEventListener("change",R),O()}let N=new a.ResizeObserver(O);return N.observe(e),P.addEventListener("change",O),a.addEventListener("resize",R),R(),{get device(){return f},get fit(){return m},get customZoom(){return w},get zoomPercent(){return"custom"===m?w:v},get dpr(){return S()},get orientation(){return b[f]},canvasTarget:function(e,t,{fitTarget:n=!1}={}){const o=e.getBoundingClientRect(),r=s.getBoundingClientRect(),i=o.left-r.left-s.clientLeft,a=o.top-r.top-s.clientTop,l=H(i+t.left*C,i+t.right*C,s.clientWidth,n),c=H(a+t.top*C,a+t.bottom*C,s.clientHeight,n),d=Math.max(t.left,-i/C),u=Math.min(t.right,(s.clientWidth-i)/C);return{visible:!l&&!c,visibleCenterX:d<u?(d+u)/2:void 0,distance:Math.hypot(l,c),reveal(e="instant"){(l||c)&&s.scrollBy({left:l,top:c,behavior:e})}}},canvasWasPanned:function(){return!!k&&(s.scrollLeft!==k.scrollLeft||s.scrollTop!==k.scrollTop)},whenSettled:function(){if(!k)return;const e=k;return e.done??=new Promise(t=>{e.resolve=t}),e.done},finishMotion(){k&&O()},select(e,{animate:t=!1,keepPan:n=!1}={}){if(!u.includes(e))return;const o=f!==e;f=e,o?j(t,!n):k||O()},rotate({animate:e=!1,keepPan:t=!1}={}){"desktop"!==f&&(b[f]="portrait"===b[f]?"landscape":"portrait",j(e,!t))},setFit(e){p.includes(e)&&m!==e&&(m=e,j(!1,!0))},setZoom(e){if(!h(e)||"custom"===m&&w===e)return;const t="custom"!==m;w=e,m="custom",j(!1,t)},layout:O,beforeMove(){V(),N.disconnect(),E?.(),e.ownerDocument.defaultView.removeEventListener("resize",R)},afterMove(){N=new e.ownerDocument.defaultView.ResizeObserver(O),N.observe(e),e.ownerDocument.defaultView.addEventListener("resize",R),R()}}}(D,F,q,{device:C.get(M,"viewport"),fit:C.get(M,"fitMode")??E,customZoom:C.get(M,"customZoom"),tabletOrientation:C.get(M,"tabletOrientation"),mobileOrientation:C.get(M,"mobileOrientation")},()=>Pe(),i),X=x.querySelector("#wpbody-content > .wrap"),J=x.getElementById("wpadminbar");function Y(e=!1){const t=Math.max(1,x.documentElement.clientWidth),n=Math.max(1,x.documentElement.clientHeight),o=x.documentElement.getBoundingClientRect().left+b.scrollX,r=!e&&X?.getBoundingClientRect(),i=r?Math.max(0,"rtl"===b.getComputedStyle(X).direction?r.left-o:o+t-r.right):20,a=e?0:i,s=Math.min(a,(t-1)/2),l=Math.min(Math.max(0,J?.getBoundingClientRect().bottom||0)+a,n-1),c=t-s,d=n-Math.min(a,n-l-1);return{left:s,top:l,right:c,bottom:d,width:c-s,height:d-l}}let U,K=f&&(!S||!1!==C.get(M,"panelOpen"));const Q=C.get(M,"layout"),ee=C.get(M,"position")??Q?.dock??Q?.anchor;let te=["left","center","right"].includes(ee)?ee:"right";const ne=l(L?Q:void 0,Y,te),{compactRect:oe,usableEdge:re}=ne;let ie,ae=!1,se="",le=!1,ce={text:i.loading,state:"loading",hasPreview:!1,canRetry:!1,reason:""},de=!1;function ue(e){const t="string"==typeof e?e.replace(/\s+/g," ").trim():"";_.textContent=t?`${i.preview} — ${t}`:i.title,_.title=_.textContent,U&&(U.document.title=_.textContent)}function fe(){const{text:e,state:t,hasPreview:n,reason:o}=ce;return"handover"===t?{heading:i.switchingPreview,description:e,note:i.tabEdits}:"conflict"===t?{heading:e,description:{"handed-off":i.handedOffHelp,busy:i.takeoverTimeoutHelp,manual:i.closeOtherHelp}[o]||i.conflictHelp,note:"manual"===o?i.manualSwitchHint:i.tabEdits}:"paused"===t?{heading:i.pausedTitle,description:e,note:""}:"error"===t?function(){const{text:e,hasPreview:t,canRetry:n,reason:o}=ce;if("origin-mismatch"===o)return{heading:i.originMismatchTitle,description:t?`${e} ${i.previousPreview}`:e,note:""};if("unavailable"===o||"browser"===o)return{heading:"unavailable"===o?i.unavailableTitle:i.browserTitle,description:e,note:""};if(!t){let t=e;return e===i.failed&&(t=n?i.failedHelp:""),"reload"===o&&(t+=` ${i.reviewBeforeReload}`),{heading:i.failed,description:t,note:""}}return{heading:e===i.failed?i.refreshFailed:e,description:"reload"===o?i.reviewBeforeReload:i.previousPreview,note:""}}():n?{heading:e,description:"",note:""}:{heading:i.loading,description:i.preparing,note:""}}function pe(){return ae?"handover"===ce.state?i.takingOver:i.takeOver:i.retry}function me(e){return!e||["handover","paused"].includes(ce.state)?"info":"error"!==ce.state||ce.canRetry?"warning":"error"}function he(){return ce.redirectDestination?`${i.redirected} ${ce.redirectDestination}`:ce.hasHtmlPreview&&ie?`${i.publicRedirected} ${ie}`:""}function ge(){const{state:e,hasPreview:t,canRetry:n,reason:o}=ce,r=t&&["error","conflict","handover","paused"].includes(e),a=!t||r||se?"":he();if(z.hidden=!r&&!se&&!a,z.tabIndex=z.hidden?-1:0,H.dataset.hasFeedback=String(!z.hidden),z.hidden)return null;if(a)return{heading:a,status:"info",dismissible:!1};const{heading:s,description:l}=fe();return{heading:r?s:se,description:r?l:i.windowNoticeHelp,status:me(r),dismissible:!r,retry:r&&(ae||n&&["error","conflict"].includes(e)),close:r&&"error"===e&&!n&&"reload"!==o,disabled:"handover"===e,action:pe()}}function we(e){ce.hasPreview&&["error","conflict","handover","paused"].includes(ce.state)||(se=e,Pe()),Z.textContent=`${e} ${i.windowNoticeHelp}`}function ve(){se="",Pe()}function ye(e,t="loading",{canTakeOver:n=!1,hasPreview:o=!1,hasHtmlPreview:r=!1,redirectDestination:i,canRefresh:a=!1,canRetry:s=!0,reason:l=""}={}){const d=H.ownerDocument.activeElement,u=H.contains(d),f=!o&&(ce.state!==t||ce.text!==e||ce.reason!==l),p=ce.hasPreview!==o;ce={text:e,state:t,canTakeOver:n,hasPreview:o,hasHtmlPreview:r,redirectDestination:i,canRefresh:a,canRetry:s,reason:l},["error","conflict","handover","paused"].includes(t)&&(se=""),H.dataset.state=t,H.dataset.hasPreview=String(o),ae=n&&["conflict","handover"].includes(t),B.hidden=o,W.hidden=!o;const{heading:m,description:h,note:g}=fe();f&&(B.scrollTop=0);const w="ready"!==t||se?"":he();Z.textContent=o?[m,h,g,w].filter(Boolean).join(" "):m,Pe(),p&&G.layout(),function(e,t){e&&t&&(!H.contains(e)||e.closest("[hidden]")||e.disabled||!ce.hasPreview&&A.contains(e))&&I.focus(B.hidden?"actions":"empty-title")}(d,u),K&&"ready"===t&&r&&!i&&async function(){if(c&&!le){le=!0;try{const e=new URL(c.endpoint);if(e.origin!==b.location.origin)return;const t=await b.fetch(e,{credentials:"same-origin",cache:"no-store",redirect:"error",headers:{"X-WP-Nonce":c.nonce}});if(!t.ok)return;const{destination:n}=await t.json();if("string"!=typeof n||!n)return;if(ie=n,!K)return;Pe(),"ready"!==ce.state||!ce.hasHtmlPreview||ce.redirectDestination||se||(Z.textContent=he())}catch{}}}()}function be(e){f&&S&&C.get(M,"panelOpen")!==e&&k.set(M,"panelOpen",e)}function xe(){L&&k.set(M,"layout",ne.layout)}function Me(){const e=V.hidden;V.hidden=!1,V.style.maxWidth=`${Y(!ne.dock).width}px`;const t={width:V.offsetWidth,height:V.offsetHeight};return V.hidden=e,ne.launcherRect(t)}function Ce(){if(U)return;if(!K&&P()){const e=Me(),t=ne.anchorFactor;Object.assign(V.style,{left:`${e.x+e.width*t}px`,top:`${e.y+e.height}px`,transform:`translate(${-100*t}%, -100%)`})}let e=oe();if(H.dataset.anchor=ne.anchor,ne.expanded){const t=Y();e={x:t.left,y:t.top,width:t.width,height:t.height}}Object.assign(H.style,{left:`${e.x}px`,top:`${e.y}px`,width:`${e.width}px`,height:`${e.height}px`,transform:""})}function ke(e="right",t=!1){ne.dockTo(e,t),te=e,k.set(M,"position",te),Ce(),xe(),Pe()}function Ee(){return"function"==typeof b.documentPictureInPicture?.requestWindow}function Pe(){if(!I)return;const e=H.ownerDocument.fullscreenElement===H,t=!U&&!e,n=t&&!ne.expanded;H.classList.toggle("mtflpp-expanded",ne.expanded),R.hidden=!n;for(const e of N)e.hidden=!n||!re(e.dataset.resizeEdge);const o=ae||ce.canRetry&&["error","conflict"].includes(ce.state);var r;I.update({inPage:t,inPip:!!U,movable:n,dock:ne.dock,canRememberVisibility:f,rememberVisibility:S,rememberPosition:L,followChanges:T,device:G.device,busy:ce.hasPreview&&["stale","loading","handover"].includes(ce.state)&&ce.text!==i.saving,empty:ce.hasPreview?null:{...fe(),busy:["loading","stale","ready","handover"].includes(ce.state),icon:["paused","conflict"].includes(ce.state)||["unavailable","browser","origin-mismatch"].includes(ce.reason)?"info":"warning",retry:o,disabled:"handover"===ce.state,close:"error"===ce.state&&!o,action:pe()},notice:ge(),fit:G.fit,orientation:G.orientation,customZoom:G.customZoom,zoomPercent:G.zoomPercent,dpr:G.dpr,canRefresh:ce.canRefresh,hasPreview:ce.hasPreview,canPip:t&&Ee(),canFullscreen:t&&!!x.fullscreenEnabled,mode:e||ne.expanded?"compact":"expand",modeLabel:(r=e,r?i.exitFullscreen:ne.expanded?i.compact:i.expand)})}function Se(){I.closeMenu(),U?U.close():x.fullscreenElement!==H?(ne.toggleExpanded(),Ce(),xe(),Pe(),I.focus("mode")):x.exitFullscreen().then(ve,()=>we(i.fullscreenFailed))}function Le(e,t=!1,n){const o=e===j,r=e===$,a=()=>n||("left"===ne.anchor?"ne":"nw"),s=()=>U||!o&&ne.expanded||x.fullscreenElement===H||t&&!re(a());let l,c;const d=()=>({...o?Me():oe(),preferredBounds:ne.layout.bounds});function u(){if(c=null,l)if(t||o)Ce();else{const e=oe(),t=e.x-parseFloat(H.style.left),n=e.y-parseFloat(H.style.top);Object.assign(H.style,{width:`${e.width}px`,height:`${e.height}px`,transform:`translate3d(${t}px, ${n}px, 0)`})}}function f(){if(!l)return;const{pointer:t,moved:n}=l;l=null,b.cancelAnimationFrame(c),e.hasPointerCapture(t)&&e.releasePointerCapture(t),H.classList.remove("mtflpp-dragging"),e.classList.remove("mtflpp-edge-active"),x.documentElement.classList.remove("mtflpp-window-dragging"),x.documentElement.style.removeProperty("--mtflpp-drag-cursor"),Ce(),n&&(o&&(de=!0),xe(),Pe())}e.addEventListener("pointerdown",t=>{0!==t.button||s()||r&&t.target.closest('button, a, [role="button"]')||(o&&(de=!1),t.preventDefault(),o?j.focus({preventScroll:!0}):e===O&&I.focus("move"),I.closeMenu(),l={...d(),pointer:t.pointerId,pointerX:t.clientX,pointerY:t.clientY},e.setPointerCapture(t.pointerId))}),e.addEventListener("pointermove",n=>{if(!l||l.pointer!==n.pointerId)return;const r=n.clientX-l.pointerX,i=n.clientY-l.pointerY;!l.moved&&Math.abs(r)+Math.abs(i)<4||(l.moved=!0,H.classList.add("mtflpp-dragging"),t&&e.classList.add("mtflpp-edge-active"),x.documentElement.style.setProperty("--mtflpp-drag-cursor",t?b.getComputedStyle(e).cursor:"grabbing"),x.documentElement.classList.add("mtflpp-window-dragging"),t?ne.resize(l,a(),r,i):ne.move(l,r,i,o),c||(c=b.requestAnimationFrame(u)))});for(const t of["pointerup","pointercancel","lostpointercapture"])e.addEventListener(t,f);b.addEventListener("blur",f),r||n||e.addEventListener("keydown",e=>{const n={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[e.key];if(!n||e.altKey||e.ctrlKey||e.metaKey||s())return;e.preventDefault(),I.closeMenu();const r=d(),l=e.shiftKey?40:10;t?ne.resize(r,a(),n[0]*l,n[1]*l):ne.move(r,n[0]*l,n[1]*l,o),Ce(),xe(),Pe();const c=oe();Z.textContent=t?`${i.resize}: ${Math.round(c.width)} × ${Math.round(c.height)}`:i.moved})}ue(a),$.addEventListener("dblclick",e=>{U||e.target.closest("button, a")||Se()}),x.addEventListener("fullscreenchange",Pe),R.addEventListener("keydown",e=>{"Escape"===e.key&&R.classList.add("mtflpp-help-dismissed")}),R.addEventListener("blur",()=>R.classList.remove("mtflpp-help-dismissed")),Le(O),Le($),d||Le(j),Le(R,!0);for(const e of N)Le(e,!0,e.dataset.resizeEdge);function Te(){H.hidden=!K,V.hidden=!d&&(K||!P()),j.setAttribute("aria-expanded",String(K))}function Ve(e=!0){K?I.focus("actions"):(be(!0),p(),K&&e&&I.focus("actions"))}return b.addEventListener("resize",Ce),b.addEventListener("scroll",Ce,{passive:!0}),u?.fallbackMedia.addEventListener("change",()=>{Ce(),Te()}),j.addEventListener("click",e=>{if(de&&0!==e.detail)return de=!1,void e.preventDefault();de=!1,Ve(0===e.detail)}),I=function(t,i,a){const l=t.querySelector(".mtflpp-controls"),c=t.querySelector(".mtflpp-refresh-control"),d=t.querySelector(".mtflpp-move-control"),u=t.querySelector(".mtflpp-device-controls"),f=t.querySelector(".mtflpp-fit-control"),p=t.querySelector(".mtflpp-pip-control"),m=t.querySelector(".mtflpp-empty"),h=t.querySelector(".mtflpp-feedback");let g,w=(0,n.createRoot)(l),v=!1,y=!1,b=!1;const x=r.InlineNotices?(0,e.dispatch)(r.store):null,M=t.ownerDocument.defaultView?.wp?.theme?.ThemeProvider,C="meet-the-frontend-live-preview-panel",k="preview-feedback";let E="";function P(){const e=g.notice,t=/[.!?…。!?]$/.test(e.heading)?e.heading:`${e.heading}.`;return{message:e.description?`${t} ${e.description}`:e.heading,status:e.status,isDismissible:e.dismissible,actions:[...e.retry?[{label:e.action,disabled:e.disabled,onClick:a.retry}]:[],...e.close?[{label:i.close,onClick:a.close}]:[]]}}function S(){x&&E&&x.removeNotice(k,C),E=""}function L(e){return()=>{H(),e()}}function T(){const{inPage:e,inPip:l,mode:w,modeLabel:k,movable:E,busy:S,canRefresh:T,hasPreview:j,canPip:O}=g;return(0,n.createElement)(o.SlotFillProvider,null,(0,n.createPortal)(E&&e&&(0,n.createElement)(o.Button,{className:"mtflpp-icon mtflpp-move",size:"compact",icon:s.move,label:i.move,showTooltip:!0,tooltipPosition:"bottom","data-action":"move"}),d),(0,n.createPortal)((0,n.createElement)(o.Button,{className:"mtflpp-icon",size:"compact",icon:S?(0,n.createElement)(o.Spinner):s.refresh,label:i.refresh,showTooltip:!0,accessibleWhenDisabled:!0,disabled:!T,onClick:a.refresh,"data-action":"refresh"}),c),(0,n.createPortal)(O&&j&&(0,n.createElement)("div",{className:"mtflpp-pip-surface"},(0,n.createElement)(o.Button,{className:"mtflpp-pip-button",icon:s.pip,label:i.popOutHelp,"aria-label":i.popOut,description:i.popOutHelp,showTooltip:!0,onClick:a.popOut,"data-action":"pop-out"})),p),function(){const{canPip:e,canFullscreen:t,inPage:r,inPip:l,dock:c,canRememberVisibility:d,rememberVisibility:u,rememberPosition:f,followChanges:p}=g;return(0,n.createElement)(o.DropdownMenu,{className:"mtflpp-actions",label:i.actions,icon:s.more,open:v,onToggle(e){v=e,e&&(y=!1),V()},toggleProps:{className:"mtflpp-icon",size:"compact","data-action":"actions"},popoverProps:{placement:"bottom-end",offset:6,shift:!0,className:"mtflpp-menu-popover"}},()=>(0,n.createElement)(n.Fragment,null,(e||t)&&(0,n.createElement)(o.MenuGroup,{label:i.display},e&&(0,n.createElement)(o.MenuItem,{label:i.popOutHelp,description:i.popOutHelp,showTooltip:!0,onClick:L(a.popOut),"data-action":"pip","aria-label":i.popOut},i.popOut),t&&(0,n.createElement)(o.MenuItem,{onClick:L(a.fullscreen),"data-action":"fullscreen"},i.fullscreen)),r&&(0,n.createElement)(o.MenuGroup,{label:i.position},(0,n.createElement)(o.MenuItemsChoice,{value:c,choices:[{value:"left",label:i.bottomLeft},{value:"center",label:i.bottomCenter},{value:"right",label:i.bottomRight}],onSelect(e){H(),a.dock(e)}})),(0,n.createElement)(o.MenuGroup,{label:i.preferences},!1!==d&&(0,n.createElement)(o.MenuItem,{role:"menuitemcheckbox",isSelected:u,icon:u?s.check:void 0,info:i.rememberVisibilityHelp,onClick:L(a.rememberVisibility),"data-action":"remember-visibility"},i.rememberVisibility),(0,n.createElement)(o.MenuItem,{role:"menuitemcheckbox",isSelected:f,icon:f?s.check:void 0,info:i.rememberPositionHelp,onClick:L(a.rememberPosition),"data-action":"remember-position"},i.rememberPosition),(0,n.createElement)(o.MenuItem,{role:"menuitemcheckbox",isSelected:p,icon:p?s.check:void 0,info:i.followHelp,onClick:L(a.follow),"data-action":"follow"},i.follow)),r&&(0,n.createElement)(o.MenuGroup,null,(0,n.createElement)(o.MenuItem,{info:i.resetHelp,onClick:L(a.reset),"data-action":"reset"},i.reset)),l&&(0,n.createElement)(o.MenuGroup,null,(0,n.createElement)(o.MenuItem,{onClick:L(a.close),"data-action":"close"},i.closeLivePreview))))}(),!l&&(0,n.createElement)(o.Button,{className:"mtflpp-icon mtflpp-mode",size:"compact",icon:s[w],label:k,showTooltip:!0,onClick:a.mode,"data-action":"mode"}),!l&&(0,n.createElement)(o.Button,{className:"mtflpp-icon",size:"compact",icon:s.close,label:i.close,showTooltip:!0,onClick:a.close,"data-action":"close"}),(0,n.createPortal)(function(){const{device:e,orientation:t}=g;return(0,n.createElement)(o.Toolbar,{className:"mtflpp-devices",label:i.viewport,variant:"unstyled"},...["desktop","tablet","mobile"].map(r=>{const l=e===r,c=l&&"desktop"!==r,d=c&&"landscape"===t,u="portrait"===t?i.rotateLandscape:i.rotatePortrait;return(0,n.createElement)(o.ToolbarButton,{key:r,icon:s[r],className:d?"mtflpp-device-rotated":void 0,label:c?`${i[r]} — ${u}`:i[r],isPressed:l,"data-viewport":r,onClick:()=>a.device(r)})}))}(),u),(0,n.createPortal)(function(){const{fit:e,customZoom:t=100,dpr:r=1}=g,l={automatic:i.automatic,window:i.fitToWindow,width:i.fitToWidth},c={automatic:i.automaticHelp,window:i.fitToWindowHelp,width:i.fitToWidthHelp},d="custom"===e?i.fixedZoom:l[e]??i.automatic;return(0,n.createElement)(o.Dropdown,{open:y,onToggle(e){y=e,e&&(v=!1,b="custom"===g.fit),V()},contentClassName:"mtflpp-zoom-popover",focusOnMount:"firstElement",popoverProps:{placement:"top-end",offset:8,shift:!0,resize:!1,role:"dialog","aria-label":i.fitting},renderToggle:({isOpen:e,onToggle:t})=>(0,n.createElement)(o.Button,{className:"mtflpp-zoom-toggle",variant:"secondary",size:"compact",label:d,showTooltip:!0,"aria-label":`${i.fitting}: ${d}`,"aria-haspopup":"dialog","aria-expanded":e,onClick:t,"data-action":"zoom"},(0,n.createElement)("span",{className:"mtflpp-zoom-value"},d),s.chevron),renderContent:()=>(0,n.createElement)("div",{className:"mtflpp-zoom-content"},(0,n.createElement)(o.RadioControl,{label:i.zoomMode,selected:e,options:[...Object.entries(l).map(([e,t])=>({value:e,label:t,description:c[e]})),{value:"custom",label:i.fixedZoom,description:i.fixedZoomHelp}],onFocus(e){if(!b)return;b=!1;const t=e.currentTarget.closest(".mtflpp-zoom-content")?.querySelector('.mtflpp-custom-zoom input[type="number"]');t?.focus({preventScroll:!0});const n=t?.closest(".components-popover__content");if(n){const e=t.getBoundingClientRect(),o=n.getBoundingClientRect();n.scrollTop+=Math.min(0,e.top-o.top)+Math.max(0,e.bottom-o.bottom)}},onChange(e){b=!1,"custom"!==e?a.fit(e):a.zoom(t)}}),"custom"===e&&(0,n.createElement)("div",{className:"mtflpp-custom-zoom",onKeyDown(e){if("Enter"!==e.key)return;e.preventDefault();const t=Number(e.target.value);!1!==e.target.validity?.valid&&Number.isInteger(t)&&t>=10&&t<=400&&H()}},(0,n.createElement)(o.RangeControl,{label:i.customZoom,min:10,max:400,step:1,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:t,help:i.customZoomHelp,withInputField:!0,onChange(e){Number.isInteger(e)&&e>=10&&e<=400&&a.zoom(e)}})),(0,n.createElement)("div",{className:"mtflpp-dpr-note",role:"group","aria-label":i.displayInformation},(0,n.createElement)("span",{className:"mtflpp-dpr-value"},`${i.displayDpr}: ${Number(r.toFixed(2))}`),(0,n.createElement)("span",{className:"mtflpp-pixel-note"},i.pixelZoomHelp)))})}(),f),(0,n.createPortal)(function(){const{empty:e}=g;return e?(0,n.createElement)(o.Placeholder,{className:"mtflpp-placeholder","data-empty-icon":e.busy?void 0:e.icon,icon:e.busy?(0,n.createElement)(o.Spinner):s[e.icon],label:(0,n.createElement)("h3",{className:"mtflpp-empty-title",tabIndex:-1,"data-action":"empty-title"},e.heading),instructions:e.description},e.retry&&(0,n.createElement)(o.Button,{key:"retry",variant:"primary",disabled:e.disabled,onClick:a.retry,"data-action":"retry"},e.action),e.close&&(0,n.createElement)(o.Button,{key:"close",variant:"secondary",onClick:a.close,"data-action":"close"},i.close),e.note&&(0,n.createElement)("p",{className:"mtflpp-empty-note"},e.note)):null}(),m),(0,n.createPortal)(function(){if(!g.notice)return null;if(x){const e=(0,n.createElement)(r.InlineNotices,{context:C,className:"mtflpp-inline-notices"});return M?(0,n.createElement)(M,{cornerRadius:"none"},e):e}const{message:e,...t}=P();return(0,n.createElement)(o.Notice,{...t,onRemove:a.dismissNotice,spokenMessage:"",politeness:"polite"},e)}(),h),e?(0,n.createPortal)((0,n.createElement)(o.Popover.Slot),t.ownerDocument.body):(0,n.createElement)(o.Popover.Slot))}function V(){g&&w&&(function(){if(!x)return;if(!g.notice)return void S();const e=JSON.stringify(g.notice);if(E===e)return;const{message:t,status:n,...o}=P();x.createNotice(n,t,{...o,id:k,context:C,speak:!1,onDismiss:a.dismissNotice}),E=e}(),(0,n.flushSync)(()=>w.render((0,n.createElement)(T))))}function H(){(v||y)&&(v=!1,y=!1,V())}function j(e){g?.inPip&&"mode"===e&&(e="actions"),t.querySelector(`[data-action="${e}"]`)?.focus({preventScroll:!0})}return{update(e){const n=y&&!e.hasPreview&&t.ownerDocument.activeElement?.closest(".mtflpp-zoom-popover");e.hasPreview||(y=!1),g=e,V(),n&&j("empty-title")},closeMenu:H,focus:j,beforeMove(){v=!1,y=!1,w?.unmount(),w=null,S()},remount(){w=(0,n.createRoot)(l),V()}}}(H,i,{refresh:()=>{ce.canRefresh&&h()},retry:()=>{"handover"!==ce.state&&(ae||ce.canRetry&&["error","conflict"].includes(ce.state))&&g(ae)},dismissNotice:()=>{ve(),Z.textContent=ce.text,I.focus("actions")},mode:Se,close:function(){I.closeMenu(),be(!1),m(),d||P()?j.focus():u.focus()},popOut:async function(){if(U||x.fullscreenElement===H||!Ee())return;let e;I.closeMenu();const t=()=>{U===e&&(w(),G.beforeMove(),I.beforeMove(),x.body.append(H),H.classList.remove("mtflpp-pip"),U=null,I.remount(),Ce(),G.afterMove(),Pe(),v(),K&&I.focus("mode"))};try{if(e=await b.documentPictureInPicture.requestWindow({width:640,height:440}),!K)return void e.close();const n=b.getComputedStyle(H);e.document.documentElement.lang=x.documentElement.lang,e.document.documentElement.dir=n.direction;for(const t of["--wp-admin-theme-color","--wp-admin-theme-color-darker-10","--wp-admin-border-width-focus"]){const o=n.getPropertyValue(t);o&&e.document.documentElement.style.setProperty(t,o)}const o=x.querySelectorAll(['link[rel="stylesheet"][href*="/load-styles.php"]',"#wp-theme-css","#wp-theme-inline-css","#wp-components-css","#wp-components-inline-css","style[data-emotion]","style[data-wp-hash]","#meet-the-frontend-live-preview-panel-css","#meet-the-frontend-live-preview-panel-inline-css"].join(", "));for(const t of o){const n=t.cloneNode(!0);"STYLE"===t.tagName&&t.sheet&&(n.textContent=Array.from(t.sheet.cssRules,e=>e.cssText).join("\n")),n.addEventListener("load",G.layout,{once:!0}),e.document.head.append(n)}e.document.title=_.textContent,e.document.body.className="mtflpp-pip-document",e.addEventListener("resize",G.layout),e.addEventListener("pagehide",t,{once:!0}),U=e,w(),G.beforeMove(),I.beforeMove(),H.classList.add("mtflpp-pip"),e.document.body.append(H),I.remount(),G.afterMove(),Pe(),ve(),I.focus("mode"),v()}catch{e&&(t(),e.close()),I.focus("actions"),we(i.pipFailed)}},fullscreen:async function(){if(!U&&x.fullscreenEnabled){I.closeMenu();try{await H.requestFullscreen(),ve(),I.focus("mode")}catch{I.focus("actions"),we(i.fullscreenFailed)}}},dock:e=>ke(e),reset:()=>ke("right",!0),follow:function(){T=!T,k.set(M,"scrollToChanges",T),Pe(),T&&ce.canRefresh&&h(!1)},rememberVisibility:function(){S=!S,k.set(M,"rememberVisibility",S),S&&be(K),Pe()},rememberPosition:function(){L=!L,k.set(M,"rememberPosition",L),L?xe():(k.set(M,"position",te),k.set(M,"layout",void 0)),Pe()},device(e){const t=G.device;if(e===t&&"desktop"===e)return;let n=!1;if(K&&T&&y){const{fit:e,customZoom:t,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:a}=G;n=!!y({canvas:A,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:a,canFollow:()=>G.fit===e&&G.customZoom===t})}const o={animate:K&&!n,keepPan:n};e===t?(G.rotate(o),k.set(M,`${e}Orientation`,G.orientation)):(G.select(e,o),G.device!==t&&k.set(M,"viewport",G.device)),Pe()},fit(e){const t=G.fit;G.setFit(e),G.fit!==t&&k.set(M,"fitMode",G.fit),Pe()},zoom(e){const t=G.fit,n=G.customZoom;G.setZoom(e),G.customZoom!==n&&k.set(M,"customZoom",G.customZoom),G.fit!==t&&k.set(M,"fitMode",G.fit),Pe()}}),ye(i.loading,"loading",{canRetry:!1}),Ce(),Te(),d&&(d.disabled=!1),{stage:F,canvasTarget:G.canvasTarget,get visible(){return K},get followChanges(){return T},openFromLauncher:Ve,setVisible(e){e||(I.closeMenu(),se="",Pe(),G.layout()),K=e,Ce(),Te()},report:ye,setTitle:ue,clearPreview(){F.replaceChildren();const e=["ready","stale","loading"].includes(ce.state);ye(e?i.loading:ce.text,e?"loading":ce.state,{...ce,hasPreview:!1,hasHtmlPreview:!1,redirectDestination:void 0,canRefresh:!1,canRetry:!e&&ce.canRetry})},returnToEditor(){I.closeMenu(),U?.close(),x.fullscreenElement===H&&x.exitFullscreen().catch(()=>{})}}}function d(e=[]){const t=Array.isArray(e)?[...e]:[],n=new WeakMap;return{capture(e,o){try{if(n.has(e))return;const r=function(e){try{const t=e.querySelector('meta[name="meet-the-frontend-live-preview-panel"]'),n=t?.getAttribute("data-mtflpp-source");if(!n)return null;const o=JSON.parse(n);if("string"!=typeof o)return null;const r=(new DOMParser).parseFromString(o,"text/html");return r.querySelector('meta[name="meet-the-frontend-live-preview-panel"]')?.content===t.content?r:null}catch{return null}}(e);n.set(e,{source:r?m(r,e,t):null,dom:m(e,e,t),values:o&&Object.fromEntries(Object.entries(o).map(([e,t])=>[e,{...t}]))})}catch{}},findChange(e,t){try{const o=n.get(e),r=n.get(t);if(!o||!r)return null;const i=function(e,t){if(!e||!t)return[];const n=[];for(const o of new Set([...Object.keys(e),...Object.keys(t)])){const r=Object.hasOwn(e,o)?e[o]:{type:t[o]?.type,value:""},i=Object.hasOwn(t,o)?t[o]:{type:e[o]?.type,value:""};if(r.type!==i.type||!["text","html"].includes(i.type)||"string"!=typeof r.value||"string"!=typeof i.value||r.value===i.value)continue;let a,s;try{a="html"===r.type?(new DOMParser).parseFromString(r.value,"text/html"):null,s="html"===i.type?(new DOMParser).parseFromString(i.value,"text/html"):null}catch{continue}const l=a?m(a,a,[],a.body):null,c=s?m(s,s,[],s.body):null,d=a?E(l):r.value,u=s?E(c):i.value,f=v(d),p=v(u);if(f!==p&&n.push({...P(f,p),type:"text"}),!a){const e=k(d,u);e&&n.push(e);continue}if(l&&c&&(f===p||y(d,u)))for(const e of w(l,c)){if(e.spacing){const t=C(e);t&&n.push(t);continue}if(f===p)if("attributes"===e.kind){const t=new Map(e.before.attributes),o=new Map(e.after.attributes);for(const e of new Set([...t.keys(),...o.keys()])){const r=t.get(e)??"",i=o.get(e)??"";JSON.stringify(r)!==JSON.stringify(i)&&n.push({type:"attribute",name:e,before:"string"==typeof r?r:JSON.stringify(r),after:"string"==typeof i?i:JSON.stringify(i)})}}else"content"===e.kind&&(v(E(e.before))===v(E(e.after))&&n.push({type:"markup",before:v(E(e.before)),after:v(E(e.after)),oldTag:e.before.tag,newTag:e.after.tag}),(e.before.media||[]).forEach((t,o)=>{const r=e.after.media?.[o];t&&r&&t!==r&&n.push({type:"media",before:t,after:r})}))}}return n}(o.values,r.values),a=function(e,t){if(!e||!t)return!1;const n=(e,t)=>Object.entries(e).some(([e,n])=>"order"!==n?.type&&(!Object.hasOwn(t,e)||n?.type!==t[e]?.type||n?.value!==t[e]?.value));return n(e,t)||n(t,e)}(o.values,r.values),s=!!o.source&&!!r.source,l=!!o.source!=!!r.source,c=[...s?w(o.source,r.source).map(e=>({...e,source:!0})):[],...w(o.dom,r.dom)],d=new Map,h=function(e,t){const n=new Map,o=e=>E(e,n),r=[];for(const n of e){if(n.unresolved)for(const e of u(n,t,o))r.push(e);if("insert"===n.kind&&n.added.length>1){const e=n.added.map(e=>{const r={...n,after:e,added:[e]},i=V(r,t,o);return{...r,input:i}}).filter(e=>e.input);if(e.length){r.push(...e);continue}}const e=V(n,t,o);r.push({...n,input:e})}return r}(c,i).filter(e=>(e.source||!s&&!l||e.input||a&&2===e.priority)&&(e.priority>0||e.input)&&(!e.spacing||function({before:e,after:t},n,o){const r=b(e,n,o),i=b(t,n,o);return r&&i&&r.omitted===i.omitted&&y(r.text,i.text)}(e,d,r.dom?.excluded)));return function(e,t){if(!e.length)return null;const n=e.reduce((e,t)=>Math.max(e,t.input),0),o=e.filter(e=>e.input===n),r=o.reduce((e,t)=>Math.max(e,t.priority),0),i=o.filter(e=>e.priority===r);if(i.some(e=>e.unresolved))return function(e,t){const n=e.find(e=>e.unresolved&&("replacement"===e.regionChange||"reorder"===e.regionChange&&(e.source||t))),o=n?.after.node;if(!o?.isConnected)return null;for(const t of e)if(t.unresolved){if(n.source&&!t.source&&"reorder"===t.regionChange)continue;if(!t.regionChange||t.after.node!==o)return null}else if(!("insert"===t.kind?t.added:[t.after]).every(e=>o.contains(e.node)))return null;return"contents"!==o.ownerDocument.defaultView.getComputedStyle(o).display?o:null}(i,t);const a=i.filter(e=>!e.input||e.directInput||!i.some(t=>t!==e&&e.matches?.length&&e.matches.every(e=>t.matches?.includes(e))&&H(e.after,t.after))),s=new Map,l=a.filter(e=>{const t="delete"===e.kind&&(e.following[0]||e.preceding[0])||e.after,n=t?.node;if(!n)return!0;const o="delete"!==e.kind||e.following.length?e.kind:"delete-last",r=s.get(n)||new Set;return!r.has(o)&&(r.add(o),s.set(n,r),!0)});return n&&s.size>1?null:function(e){const t=new Set,n=new Set;for(const o of e){let e,r=!1;"delete"===o.kind?(r=!o.removed.some(p),e=r?o.after:o.following.find(p)||o.preceding.find(p)||o.following.find(f)||o.preceding.find(f)||o.after):e="insert"===o.kind?o.added.find(p)||o.added.find(f):o.after;const i=f(e);if(!i)continue;const a=p(e),s=a||i;(a&&!r?t:n).add(s)}const o=t.size?t:n;return 1===o.size?o.values().next().value:null}(l)}(h,!s&&(a||function(e,t){return!!e&&!!t&&Object.entries(t).some(([t,n])=>{if("order"!==n?.type||!Object.hasOwn(e,t))return!1;const o=e[t];return"order"===o?.type&&o.members===n.members&&o.value!==n.value})}(o.values,r.values)))}catch{return null}}}}function u(e,t,n){const o=[];for(const r of t){if(!r.after||"spacing"===r.type)continue;const t=T(e.oldRange,r.before,n,r,!0),i=T(e.newRange,r.after,n,r,!1);if(!t.length)continue;const a="markup"===r.type&&r.oldTag===r.newTag;if(a||!r.before||!(t.length<=T(e.newRange,r.before,n,r,!0).length||i.length<=T(e.oldRange,r.after,n,r,!1).length))for(const n of i)a&&!t.some(e=>e.signature!==n.signature)||o.push({...e,unresolved:!1,before:null,after:n,kind:"content",input:r.before&&r.after?2:1,priority:2,matches:[r]})}return o}function f(e){if(e?.node)return e.node;for(const t of e?.children||[]){const e=f(t);if(e)return e}return null}function p(e){const t=e?.node;if(t?.getClientRects().length&&"visible"===t.ownerDocument.defaultView.getComputedStyle(t).visibility)return t;for(const t of e?.children||[]){const e=p(t);if(e)return e}return null}function m(e,t,n,o=e.querySelector('main, [role="main"]')||e.querySelector("article")||e.body){if(!o)return null;const r=n.filter(e=>{if("string"!=typeof e||!e.trim())return!1;try{return o.matches(e),!0}catch{return!1}}).join(", "),i=new Map,a=new Map;if(e!==t)for(const e of t.querySelectorAll("[data-mtflpp-node]")){const t=e.getAttribute("data-mtflpp-node");a.set(t,a.has(t)?null:e)}for(const n of[o,...o.querySelectorAll("*")]){if(r&&n.closest(r))continue;const o=[...n.childNodes].filter(e=>3===e.nodeType).map(e=>e.textContent),s=v(o.join(" ")),l=["img","source","video","audio","iframe"].includes(n.localName)?["src","srcset","poster"].map(e=>n.getAttribute(`data-${e}`)||n.getAttribute(e)||""):[],c=n.style?.backgroundImage||n.getAttribute("data-bg")||"",d=e===t?n:a.get(n.getAttribute("data-mtflpp-node"))||null,u=h(n,d,JSON.stringify([n.localName,s,l,c]));u.text=s,u.rawText=o.join(""),u.media=[...l,c],u.parent=i.get(n.parentElement),i.set(n,u),u.parent?.children.push(u)}for(const[e,t]of i)t.parts=[...e.childNodes].map(e=>3===e.nodeType?e.textContent:i.get(e)).filter(e=>void 0!==e);let s=i.get(o);if(!s)return null;const l=s.node;for(let e=o.parentElement;e;e=e.parentElement){const t=h(e,l,e.localName);t.children=[s],t.parts=[s],s=t}return s.excluded=r,s}function h(e,t,n){const o=function(e){const t=[];for(const{name:n,value:o}of e.attributes){if("data-mtflpp-node"===n||n.startsWith("on")||/(?:^|-)(nonce|token)(?:-|$)/.test(n))continue;if(/^(?:data-)?(?:src|srcset|poster|sizes|bg)$/.test(n))continue;let r=o;"class"===n&&(r=[...e.classList].sort().join(" ")),"style"===n&&(r=[...e.style].sort().map(t=>[t,e.style.getPropertyValue(t),e.style.getPropertyPriority(t)])),("class"!==n&&"style"!==n||r.length)&&t.push([n,r])}return t.sort(([e],[t])=>e.localeCompare(t))}(e);return{node:t,tag:e.localName,signature:n,attributes:o,children:[],parts:[],presentation:JSON.stringify(o.filter(([e])=>!g(e))),references:JSON.stringify(o.filter(([e])=>g(e)))}}function g(e){return["id","for","headers","aria-controls","aria-labelledby","aria-describedby","aria-owns","aria-flowto","aria-activedescendant","aria-details","aria-errormessage"].includes(e)}function w(e,t){const n=new Map,o=new Map,r=new Map,i=new Map,a=[];function s(e){const t=JSON.stringify(e);return n.has(t)||n.set(t,n.size+1),n.get(t)}function l(e){if(!e)return 0;const t=s([e.signature,e.children.map(l)]);return o.set(e,t),r.set(e,s([t,e.presentation,e.children.map(e=>r.get(e))])),i.set(e,s([t,e.presentation,e.references,e.children.map(e=>i.get(e))])),t}l(e),l(t);const c=e=>o.get(e);function d(e){const t=e.attributes.find(([e])=>"id"===e)?.[1];return t?`${e.tag} ${t}`:void 0}function u(e){if(!(e.children.length<2))return s(["collection",e.signature,e.children.map(c).sort((e,t)=>e-t)])}function f(e,t){const n=new Map;return e.forEach((e,o)=>{const r=t(e);void 0!==r&&n.set(r,n.has(r)?-1:o)}),n}return function e(t,n){t&&n&&(t.signature!==n.signature?a.push({kind:"content",before:t,after:n,priority:2}):t.rawText!==n.rawText&&a.push({kind:"content",before:t,after:n,priority:2,spacing:!0}),t.presentation===n.presentation&&t.references===n.references||a.push({kind:"attributes",before:t,after:n,priority:t.presentation!==n.presentation?1:0}),function(t,n,s,l){const p=l.parent&&s.parent&&l.tag===s.tag,m=f(t,c),h=f(n,c);let g,w,v,y;const b=new Set(t.flatMap(e=>[r.get(e),i.get(e)])),x=new Set(n.flatMap(e=>[r.get(e),i.get(e)]));function M(e,t,n){const o=n.get(e),r=n.get(t);return o===r||!x.has(o)&&!b.has(r)}function C(e,t){return o.get(e)===o.get(t)&&M(e,t,r)&&M(e,t,i)}function k(e,r,i,s,c){const d=t.slice(e,r),u=n.slice(i,s),f="replacement"===c&&p&&d.some(e=>!h.has(o.get(e)))&&u.some(e=>!m.has(o.get(e)))&&(!function(e,t){if(e.length<2||t.length<2)return!1;const n=e.filter(e=>e.children.length).length,o=t.filter(e=>e.children.length).length;if(!n&&!o||n>1&&o>1)return!0;const r=new Map;for(const{tag:e}of t)r.set(e,(r.get(e)||0)+1);let i=0;for(const{tag:t}of e){const e=r.get(t);if(e){if(2===++i)return!0;r.set(t,e-1)}}return!1}(d,u)||"form"===l.tag&&function(e,t){function n(e){const t=new Set;return e.every(function e(n){if(["input","select","textarea"].includes(n.tag)){const e=n.attributes.find(([e])=>"name"===e)?.[1],o=n.attributes.find(([e])=>"type"===e)?.[1]?.toLowerCase();return!(!e||"input"===n.tag&&"hidden"===o||(t.add(e),0))}let o=!1;for(const t of n.children)e(t)&&(o=!0);return o})?t:null}const o=n(e),r=n(t);return o&&r&&[...o].some(e=>!r.has(e))&&[...r].some(e=>!o.has(e))}(d,u)),g=p&&("reorder"===c||f)?c:void 0;a.push({kind:"region",after:l,priority:2,unresolved:!0,regionChange:g,oldRange:d,newRange:u})}function E(e,n,o,r,i,a,s){const l=[];for(let c=e;c<n;c++){const e=s(t[c]),n=a.get(e);if(!(i.get(e)!==c||void 0===n||n<o||n>=r)){if(l.length&&n<=l[l.length-1][1])return null;l.push([c,n])}}return l}!function r(i,s,b,x){for(;i<s&&b<x&&C(t[i],n[b]);)e(t[i],n[b]),i++,b++;for(;i<s&&b<x&&C(t[s-1],n[x-1]);)s--,x--,e(t[s],n[x]);if(i===s&&b===x)return;if(i===s||b===x){const e=b===x,r=e?t.slice(i,s):n.slice(b,x),c=e?[n[b-1],n[b]]:[t[i-1],t[i]];return void(r.some(e=>c.some(t=>t&&o.get(t)===o.get(e)))?k(i,s,b,x):e?a.push({kind:"delete",after:l,removed:r,priority:2,following:n.slice(b),preceding:n.slice(0,b).reverse()}):a.push({kind:"insert",after:r[0],added:r,priority:2}))}if(s-i===1&&x-b===1)return void e(t[i],n[b]);if(p&&function(e,r,i,a){const s=r-e;if(s<2||s!==a-i)return!1;const l=new Map;let c=!1;for(let r=0;r<s;r++){const a=o.get(t[e+r]),s=o.get(n[i+r]);c||=a!==s,l.set(a,(l.get(a)||0)+1),l.set(s,(l.get(s)||0)-1)}return c&&[...l.values()].every(e=>0===e)}(i,s,b,x))return void k(i,s,b,x,"reorder");let M=E(i,s,b,x,m,h,c);if(0===M?.length&&(g??=f(t,d),w??=f(n,d),M=E(i,s,b,x,g,w,d)),0===M?.length&&(v??=f(t,u),y??=f(n,u),M=E(i,s,b,x,v,y,u)),M?.length)for(const[o,a]of[...M,[s,x]])r(i,o,b,a),o<s&&e(t[o],n[a]),i=o+1,b=a+1;else k(i,s,b,x,M?"replacement":void 0)}(0,t.length,0,n.length)}(t.children,n.children,t,n))}(e,t),a}function v(e){return e.replace(/\s+/g," ").trim()}function y(e,t){return e!==t&&e.replace(/\s/g,"")===t.replace(/\s/g,"")}function b(e,t,n){for(;e.node?.isConnected&&e.parent?.node;){const{display:t}=e.node.ownerDocument.defaultView.getComputedStyle(e.node);if("inline"!==t&&"contents"!==t)break;e=e.parent}if(!t.has(e)){const{node:o}=e,r=[],i=o?.isConnected&&x(o,n,r)===M(e)&&p(e)?o.innerText:void 0;t.set(e,"string"==typeof i?{text:i,omitted:JSON.stringify(r)}:void 0)}return t.get(e)}function x(e,t,n){return t&&e.querySelector(t)?[...e.childNodes].map(e=>3===e.nodeType?e.textContent:1!==e.nodeType?"":e.matches(t)?(n.push(e.textContent),""):x(e,t,n)).join(""):e.textContent}function M(e){return e.parts.map(e=>"string"==typeof e?e:M(e)).join("")}function C({before:e,after:t}){return k(e.rawText,t.rawText)||k(M(e),M(t))}function k(e,t){if(!/\S/.test(e)||!y(e,t))return;const n=e.match(/\s+|\S+/g),o=t.match(/\s+|\S+/g);let r=0,i=0;for(;r<Math.min(n.length,o.length)&&n[r]===o[r];)r++;for(;i<Math.min(n.length,o.length)-r&&n.at(-1-i)===o.at(-1-i);)i++;const a=Math.max(0,r-1),s=Math.max(0,i-1);return{type:"spacing",before:n.slice(a,n.length-s).join(""),after:o.slice(a,o.length-s).join("")}}function E(e,t=new Map){return e?(t.has(e)||t.set(e,(e.parts||[]).map(e=>{if("string"==typeof e)return e;const n=E(e,t);return/^(?:p|div|section|article|main|aside|header|footer|nav|h[1-6]|li|[ou]l|d[ldt]|blockquote|pre|table|tr|t[dh]|caption|figure|figcaption|br|hr)$/.test(e.tag)?` ${n} `:n}).join("")),t.get(e)):""}function P(e,t){let n=0,o=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;for(;o<e.length-n&&o<t.length-n&&e[e.length-o-1]===t[t.length-o-1];)o++;let r=e.length-o,i=t.length-o;for(;n>0&&/\S/.test(e[n-1]);)n--;if(r>n&&/\S/.test(e[r-1]))for(;r<e.length&&/\S/.test(e[r]);)r++;if(i>n&&/\S/.test(t[i-1]))for(;i<t.length&&/\S/.test(t[i]);)i++;return{before:e.slice(n,r).trim(),after:t.slice(n,i).trim()}}function S(e,t){return t?L(e,t):""===v(e)}function L(e,t){if(!t)return!1;let n=(e=v(e)).indexOf(t);for(;-1!==n;){const o=n+t.length;if(!(n&&/[\p{L}\p{N}_]/u.test(e[n-1])&&/[\p{L}\p{N}_]/u.test(t[0])||o!==e.length&&/[\p{L}\p{N}_]/u.test(e[o])&&/[\p{L}\p{N}_]/u.test(t.at(-1))))return!0;n=e.indexOf(t,n+1)}return!1}function T(e=[],t,n,o,r){return e.flatMap(e=>{const i=T(e.children,t,n,o,r);let a;return a="media"===o.type?e.media?.includes(t):"attribute"===o.type?e.attributes.some(([e,n])=>e===o.name&&L("string"==typeof n?n:JSON.stringify(n),t)):("markup"!==o.type||e.tag===(r?o.oldTag:o.newTag))&&S(n(e),t),"text"===o.type&&i.length?i:[...a?[e]:[],...i]})}function V(e,t,n){if(e.unresolved)return 0;if(e.matches=[],e.spacing){const n=t.filter(e=>"spacing"===e.type),o=n.length&&C(e);return e.matches=n.filter(e=>o?.before===e.before&&o?.after===e.after),e.matches.length?2:0}let o=0;for(const r of t){if("spacing"===r.type)continue;let t=0;if("attributes"===e.kind){if(!["text","attribute"].includes(r.type))continue;const n=r,o=new Map(e.before.attributes),i=new Map(e.after.attributes);for(const e of new Set([...o.keys(),...i.keys()])){if("attribute"===r.type&&e!==r.name)continue;const a=o.get(e),s=i.get(e);if(JSON.stringify(a)===JSON.stringify(s))continue;const l="string"==typeof a?a:JSON.stringify(a)||"",c="string"==typeof s?s:JSON.stringify(s)||"";S(l,n.before)&&S(c,n.after)&&(t="attribute"===r.type||r.before&&r.after?2:1)}}else"insert"===e.kind?!r.before&&e.added.some(e=>L(n(e),r.after))&&(t=Math.max(t,1)):"delete"===e.kind?!r.after&&e.removed.some(e=>L(n(e),r.before))&&(t=Math.max(t,1)):"media"===r.type?(e.before?.media||[]).some((t,n)=>t===r.before&&e.after?.media?.[n]===r.after)&&(t=2):"attribute"!==r.type&&("markup"!==r.type||e.before?.tag===r.oldTag&&e.after?.tag===r.newTag)&&S(n(e.before),r.before)&&S(n(e.after),r.after)&&(t=r.before&&r.after?2:1,"text"===r.type&&L(e.before?.text||"",r.before)&&L(e.after?.text||"",r.after)&&(e.directInput=!0));t&&e.matches.push(r),o=Math.max(o,t)}return o}function H(e,t){return!!e?.children.some(e=>e===t||e.node&&e.node===t?.node||H(e,t))}const j=new Set(["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","PageDown","PageUp","Home","End"," "]);function O(e,t){let n;for(const o of e?.rects??[]){const e=t(o);if(e.visible)return e;(!n||e.distance<n.distance)&&(n=e)}return n}function R(e){return new Promise(t=>{const n=()=>{e.clearTimeout(o),e.cancelAnimationFrame(r),t()},o=e.setTimeout(n,100);let r=e.requestAnimationFrame(()=>{r=e.requestAnimationFrame(n)})})}function N(e,t=!1){if(!W(e,{visibilityProperty:!0,opacityProperty:!0}))return;const{left:n,right:o,top:r,bottom:i,width:a,height:s}=e.getBoundingClientRect();if(!(t||a&&s))return;const l=e.ownerDocument,{documentElement:c,body:d,defaultView:u}=l,f={left:n,right:a?o:n+1,top:r,bottom:s?i:r+1},p={...f},m={x:f.right-f.left,y:f.bottom-f.top},h="visible"===u.getComputedStyle(c).overflow,g=u.getComputedStyle(e);for(let n=e;n&&n!==c;){const o=n===e?g:u.getComputedStyle(n),{position:r,display:i,overflowX:a,overflowY:s}=o;if(n!==e&&(n!==d||!h)&&"inline"!==i&&("visible"!==a||"visible"!==s)&&n.offsetWidth&&n.offsetHeight){const{bounds:e,scaleX:r,scaleY:i}=B(n,o);for(const[l,c,d,u,h]of[["x",a,"left","right",r],["y",s,"top","bottom",i]]){if("visible"===c)continue;const r="clip"===c?[0,0]:F(n,o,l,h),i=t&&"hidden"===c,a="y"===l==("horizontal-tb"===o.writingMode);if(i&&r.some(e=>e)&&(a||f[d]<e[d]||f[u]>e[u]||$(o,g,l)))return{boundary:n};if(!A(f,p,e,d,u,i?[0,0]:r))return{boundary:n};m[l]=Math.min(m[l],p[u]-p[d])}}n="absolute"===r||"fixed"===r?n.offsetParent:n.parentElement}return{clipped:f,extent:m}}function $(e,t,n){const o=e=>e&&"auto"!==e&&0!==parseFloat(e);return("x"===n?["Left","Right"]:["Top","Bottom"]).some(n=>o(e[`scrollPadding${n}`])||o(t[`scrollMargin${n}`]))}function _(e,t,n=!1){const o=N(e,n);if(!o?.clipped)return;const{clipped:r,extent:i}=o,{ownerDocument:a}=e,s=a.documentElement;if(r.left=Math.max(s.clientLeft,r.left),r.right=Math.min(s.clientLeft+s.clientWidth,r.right),r.top=Math.max(0,r.top),r.bottom=Math.min(s.clientHeight,r.bottom),r.right<=r.left)return{rects:[]};const l=t?.({...r,top:0,bottom:s.clientHeight}),c=l?.visibleCenterX??(r.left+r.right)/2,d=X(e,c);if(r.bottom<=r.top)return{rects:[],header:d?.bottom};const u={rects:[r],inViewport:!0,extent:i};if(!d)return u;const f={left:Math.max(r.left,d.left),right:Math.min(r.right,d.right),top:Math.max(r.top,d.top),bottom:Math.min(r.bottom,d.bottom)};if(!D(f)||!d.node.contains(a.elementFromPoint(c,(f.top+f.bottom)/2)))return u;const p=[{...r,top:f.bottom},{...r,bottom:f.top},{...f,left:r.left,right:f.left},{...f,left:f.right,right:r.right}].filter(D);return!p.length&&d.bottom>=s.clientHeight&&d.top<=0?void 0:{rects:p,inViewport:!0,extent:i,header:d.bottom}}function D({left:e,right:t,top:n,bottom:o}){return t>e&&o>n}function A(e,t,n,o,r,[i,a]){return e[o]=Math.max(e[o],n[o]),e[r]=Math.min(e[r],n[r]),t[o]=Math.max(n[o],t[o]+i),t[r]=Math.min(n[r],t[r]+a),t[r]>t[o]}function F(e,t,n,o){const r="x"===n,i=r?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight;if(i<=0)return[0,0];const a=r?e.scrollLeft:e.scrollTop,s=t.display.endsWith("flex")&&t.flexDirection===(r?"row-reverse":"column-reverse"),l=(r&&"rtl"===t.direction)!==s;let c=l?-i:0,d=l?0:i;return("horizontal-tb"!==t.writingMode||a<c||a>d)&&(c=-i,d=i),[(a-d)*o,(a-c)*o]}function B(e,t){const n=e.getBoundingClientRect(),o=n.width/e.offsetWidth,r=n.height/e.offsetHeight,i=n.left+e.clientLeft*o,a=n.top+e.clientTop*r,s={left:i,top:a,right:i+e.clientWidth*o,bottom:a+e.clientHeight*r},l=t.overflowClipMargin;if("clip"!==t.overflowX&&"clip"!==t.overflowY||!l||"0px"===l)return{bounds:s,scaleX:o,scaleY:r};const c=l.split(" ").map(parseFloat).find(Number.isFinite)??0,d=l.includes("border-box")?n:s,u=l.includes("content-box");return{scaleX:o,scaleY:r,bounds:{left:d.left+((u?parseFloat(t.paddingLeft):0)-c)*o,right:d.right-((u?parseFloat(t.paddingRight):0)-c)*o,top:d.top+((u?parseFloat(t.paddingTop):0)-c)*r,bottom:d.bottom-((u?parseFloat(t.paddingBottom):0)-c)*r}}}function W(e,t={visibilityProperty:!0}){return!!e?.isConnected&&!!e.getClientRects().length&&(!e.checkVisibility||e.checkVisibility(t))&&"visible"===e.ownerDocument.defaultView.getComputedStyle(e).visibility}function q(e){return e.matchMedia("(prefers-reduced-motion: reduce)").matches?"instant":"smooth"}function z(e,{behavior:t,header:n=G(e),nearest:o=!1}={}){const r=e.ownerDocument,i=r.defaultView,a=t??q(i);if(o&&!n)return void e.scrollIntoView({behavior:a,block:"nearest",inline:"nearest"});const s=i.getComputedStyle(e).scrollMarginTop,l=r.documentElement,c=l.clientHeight,d=i.getComputedStyle(l),u=I(d.scrollPaddingTop,c),f=I(d.scrollPaddingBottom,c);let p,m;try{let t=o?"nearest":"start";if(o){const e=n-parseFloat(s);null!==u&&e>u&&(p=l.getAttribute("style"),l.style.setProperty("scroll-padding-top",`${e}px`,"important"))}else{const t=n>0&&null!==u?`max(${s}, ${n-u}px)`:s;m=e.getAttribute("style"),e.style.setProperty("scroll-margin-top",`calc(${t} + 1lh)`,"important")}if(!o&&null!==u&&null!==f){const n=i.getComputedStyle(e),o=c-u-f-parseFloat(n.scrollMarginTop)-parseFloat(n.scrollMarginBottom),r=o-e.getBoundingClientRect().height;if(r>=0&&(t="center"),r>0&&"horizontal-tb"===d.writingMode){const e=Math.min(o/3,r);p=l.getAttribute("style"),l.style.setProperty("scroll-padding-bottom",`${f+e}px`,"important")}}e.scrollIntoView({behavior:a,block:t,inline:"nearest"})}finally{void 0!==p&&Z(l,p),void 0!==m&&Z(e,m)}}function Z(e,t){e.setAttribute("style",t??""),null===t&&e.removeAttribute("style")}function I(e,t){if("auto"===e)return 0;const n=parseFloat(e);return Number.isFinite(n)?n*(e.endsWith("%")?t/100:1):null}function G(e){const t=e.getBoundingClientRect();return X(e,t.left+t.width/2)?.bottom??0}function X(e,t){const n=e.ownerDocument;for(let o=n.elementFromPoint(t,1);o&&!o.contains(e);o=o.parentElement){const e=n.defaultView.getComputedStyle(o);if("fixed"!==e.position&&"sticky"!==e.position)continue;if("0"===e.opacity||!W(o,{visibilityProperty:!0,opacityProperty:!0}))continue;const{left:t,right:r,top:i,bottom:a}=o.getBoundingClientRect();if("fixed"===e.position||i<=parseFloat(e.top)+1)return{node:o,left:t,right:r,top:i,bottom:a}}}function J(e,t,{inlineLauncher:n,nativeLauncher:o}={}){const r=e.strings,i=e.termId??e.postId,a=window,s=function(){let e,t=0,n=0;return{remember(e){try{e&&(t=e.defaultView.scrollY)}catch{}},async restore(e,o,r=()=>!0,i){const a=++n;try{const s=e.defaultView;let l;if(s.scrollTo({top:t,left:0,behavior:"instant"}),o?.ownerDocument===e&&r()){if(await R(s),a!==n||o.ownerDocument!==e||!r())return;if(function(e,t){const n=e.ownerDocument;for(let t=e;t;t=t.parentElement)if("until-found"!==t.getAttribute("hidden")?.toLowerCase()&&(t.hasAttribute("hidden")||"none"===n.defaultView.getComputedStyle(t).display))return!1;let o=!1;for(let r=e;r&&e.isConnected&&e.ownerDocument===n&&t();r=r.parentElement){if("until-found"===r.getAttribute("hidden")?.toLowerCase()){if(r.dispatchEvent(new n.defaultView.Event("beforematch",{bubbles:!0})),!(e.isConnected&&e.ownerDocument===n&&r.isConnected&&r.ownerDocument===n&&r.contains(e)&&t()))break;"until-found"===r.getAttribute("hidden")?.toLowerCase()&&r.removeAttribute("hidden"),o=!0}const i=r.parentElement;i instanceof n.defaultView.HTMLDetailsElement&&!i.open&&r!==Array.from(i.children).find(e=>"summary"===e.localName)&&(i.open=!0,o=!0)}return o}(o,()=>a===n&&r())&&await new Promise(e=>s.setTimeout(e,0)),a!==n||!r())return;const t=o.ownerDocument===e?function(e){if(!e?.isConnected)return null;const t=N(e,!0);if(t?.clipped)return e;if(!t?.boundary)for(const t of e.querySelectorAll("*"))if(N(t,!0)?.clipped)return t;for(let n=t?.boundary||e.parentElement;n;){const e=N(n,!0);if(e?.clipped)return n;n=e?.boundary||n.parentElement}return null}(o):null;t&&(function(e,t){const n=_(e,t,!0);if(!n?.inViewport)return void z(e);const{rects:o,extent:r,header:i=0}=n,a=e.ownerDocument.documentElement,s=Math.min(r.x,a.clientWidth),l=Math.min(r.y,a.clientHeight-i);o.some(e=>e.right-e.left>=s-1&&e.bottom-e.top>=l-1)?t&&O(n,t)?.reveal(q(e.ownerDocument.defaultView)):z(e,{nearest:!0,header:i})}(t,i),o.contains(t)&&(l=t))}return t=s.scrollY,l}catch{}},keepInView(t,{canvas:n,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:a,canFollow:s}){try{const l=e?.target===t&&e.canFollow();if(e?.cancel(),!t.isConnected||!s())return;if(!l){const e=_(t,o);if(!O(e,o)?.visible)return}const c=new AbortController,d={target:t,canFollow:()=>!c.signal.aborted&&s(),cancel(){c.abort(),e===d&&(e=null)}};return e=d,function(e,t,n,o,r){const i=e=>{e.isTrusted&&("keydown"!==e.type||j.has(e.key))&&r()},a={capture:!0,passive:!0,signal:o};for(const n of[e,t])for(const e of["wheel","touchmove","pointerdown","keydown"])n?.addEventListener(e,i,a);t?.addEventListener("scroll",()=>{n?.()&&r()},a)}(t.ownerDocument.defaultView,n,a,c.signal,()=>{d.cancel(),i?.()}),async function(e,t,n,o){try{const r=e.ownerDocument.defaultView;if(await R(r),!o())return;const{scrollX:i,scrollY:a}=r,s=n();if(s&&await s,!o()||r.scrollX!==i||r.scrollY!==a)return;let l=_(e,t);l&&!l.rects.length&&(z(e,{behavior:"instant",header:l.header}),l=_(e,t)),O(l,t)?.reveal()}catch{}}(t,o,r,d.canFollow).finally(d.cancel)}catch{}}}}(),l=c(r,{postTitle:t.title??e.postTitle,publicRedirect:e.publicRedirect,inlineLauncher:n,nativeLauncher:o,onOpen:()=>D(),onClose:()=>$(),onRefresh:A,onRetry:e=>e?D(!0):A(),beforeViewportChange:e=>h.beforeViewportChange(e),beforeMove:H,afterMove:()=>{p&&A()}});let u,f,p=!1,m=0;const h=function(e,t,n,o,r=[]){const i=d(r);let a,s,l,c,u;function f(){u?.()}return{get hasPreview(){return!!a},get hasHtmlPreview(){return!!s},get redirectDestination(){return c},load:function(r,d,p=()=>!1,m){const h=new URL(r);if("https:"!==h.protocol&&"http:"!==h.protocol)throw Object.assign(new Error(n.failed),{code:"mtflpp_preview_unsupported_url"});if(h.origin!==window.location.origin){const e=n.originMismatch.replace("%s",()=>h.origin+h.pathname);throw Object.assign(new Error(e),{code:"mtflpp_preview_origin_mismatch"})}const g=h.searchParams.get("mtflpp_token");if(!g)throw new Error(n.failed);return window.crossOriginIsolated&&h.searchParams.set("mtflpp_isolated","1"),f(),h.searchParams.delete("mtflpp_source"),e.followChanges&&h.searchParams.set("mtflpp_source","1"),o(n.updating),new Promise((r,f)=>{const w=e.stage.ownerDocument.createElement("iframe");w.title=n.title,w.className="mtflpp-frame mtflpp-loading",w.setAttribute("aria-hidden","true"),w.setAttribute("tabindex","-1"),w.referrerPolicy="same-origin";let v=!1,y=!1;const b=setTimeout(()=>M(new Error(n.failed)),3e4),x=()=>{y=!0,M()};function M(e){v||(v=!0,e&&(y=!0),clearTimeout(b),u===x&&(u=null),w!==a&&(w.onload=null,w.onerror=null,w.remove()),e?f(e):r())}u=x,w.onload=async()=>{const r=w!==a;if(r||(s=null,l=null),y||!d())return void M();let u,f,v;try{const e=w.contentDocument,t=e?.querySelector('meta[name="meet-the-frontend-live-preview-panel"]');t?.content===g?u=e:r&&!t&&(f=function(e,t){if("text/html"!==e?.contentType)return;const n=e.defaultView?.performance.getEntriesByType("navigation")[0];if(!(n?.redirectCount>0))return;const o=new URL(n.name);return o.origin!==t.origin||o.pathname===t.pathname&&o.search===t.search?void 0:o.pathname}(e,h))}catch{}u&&(e.followChanges&&i.capture(u,r?m:void 0),u.documentElement.style.setProperty("overscroll-behavior","contain","important")),u&&r&&(t.remember(s),e.followChanges&&p()&&s&&(v=i.findChange(s,u))),r&&a&&(a.onload=null,a.onerror=null,a.remove()),a=w,s=u,l=null,c=f,w.classList.remove("mtflpp-loading"),w.removeAttribute("aria-hidden"),w.removeAttribute("tabindex");const b=()=>!y&&d()&&w===a&&u===s&&(!u||w.contentDocument===u);let x;if(u&&r){const n=e.canvasTarget&&(t=>e.canvasTarget(w,t,{fitTarget:!0}));x=await t.restore(u,v,()=>b()&&e.followChanges&&p(),n)}b()?(l=x,o(n.current,"ready"),M()):M()},w.onerror=()=>{w===a?(s=null,l=null,c=void 0,d()&&o(n.failed,"error")):M(new Error(n.failed))},w.src=h.href,e.stage.append(w)})},cancel:f,beforeViewportChange({canvasTarget:n,canFollow:o,...r}){const i=l,c=s,d=a;if(i&&c)return t.keepInView(i,{...r,canvasTarget:e=>n(d,e),canFollow:()=>i===l&&c===s&&d.contentDocument===c&&e.visible&&e.followChanges&&o()})},clear(){f(),t.remember(s),a&&(a.onload=null,a.onerror=null),a=null,s=null,l=null,c=void 0,e.clearPreview()}}}(l,s,r,E,e.comparisonExcludedSelectors);let g,w,v,y,b,x,M,C,k=!1;try{a.BroadcastChannel&&(C=new a.BroadcastChannel(`meet-the-frontend-live-preview-panel:${e.endpoint}:${i}:${e.userId}`),C.onmessage=e=>{"takeover"===e.data?.type&&p&&($(!0),E(r.handedOff,"conflict",{reason:"handed-off"}))},a.addEventListener("pagehide",e=>{e.persisted||C.close()}))}catch{C?.close(),C=null}function E(e,n="loading",{canRetry:o=!0,reason:r=""}={}){"ready"===n&&(k=!1),l.report(e,n,{canTakeOver:!!C,hasPreview:h.hasPreview,canRetry:o,reason:r,hasHtmlPreview:h.hasHtmlPreview,redirectDestination:h.redirectDestination,canRefresh:p&&!t.saving&&["ready","error"].includes(n)&&("error"!==n||o)})}function P(e){const t=e?.code,n=function(e){const t=e?.code;return"mtflpp_post_locked"===t?"post-locked":["mtflpp_invalid_nonce","rest_cookie_invalid_nonce","mtflpp_preview_conflict","mtflpp_source_changed","mtflpp_acf_unavailable","mtflpp_integration_failed"].includes(t)?"reload":["mtflpp_cannot_preview","rest_forbidden","rest_cannot_edit"].includes(t)?"permission":"mtflpp_preview_origin_mismatch"===t?"origin-mismatch":"mtflpp_preview_unsupported_url"===t?"unsupported-url":""}(e);n&&(p=!1,S(),h.cancel(),b?.()),E("string"==typeof t?e.message:r.failed,"post-locked"===n?"paused":"error",{reason:n,canRetry:!n})}function S(){clearTimeout(u),f=void 0}function L(e){if(void 0===e&&void 0===f)return;const t=performance.now();void 0!==e&&(f=t+e),clearTimeout(u);const n=Math.ceil(f-t);n>0?u=setTimeout(V,n):V()}function T(){p&&(m+=1,k=!0,h.cancel(),t.saving||E(r.stale,"stale"),t.saving||t.previewing?S():L(275))}function V(){if(!p||g||!1===t.ready||t.previewing||t.saving)return;S();const n=m;E(r.updating),g=(async()=>{try{if(await t.idle,!p||!1===t.ready||t.saving)return;const o=e.base;let i,a;v=t.preparePreview();try{i=await v}catch(e){a=e}finally{v=null}if(await t.idle,!p||!1===t.ready||t.saving||o!==e.base)return;if(a)throw a;if("string"!=typeof i.url)throw Object.assign(new Error(i.message||r.failed),{code:i.code});p&&n===m&&await function(e,t,n){return h.load(e,()=>p&&t===m,()=>l.followChanges&&k,n)}(i.url,n,i.comparisonValues)}catch(e){p&&!t.saving&&P(e)}finally{g=null,L()}})()}function H(){m+=1,h.clear()}function $(e=!1){l.setVisible(e),p=!1,S(),H(),clearTimeout(M),M=null,x?.abort(),l.returnToEditor(),b?.()}async function D(n=!1){if(l.setVisible(!0),p)return;if(w)return void P(w);if(y){if(x&&!x.signal.aborted)return;const e=m;try{await y}catch{}return void(l.visible&&e===m&&D(n))}if(!1===t.ready)return void E(t.notReady,t.notReadyState??"paused",{canRetry:!1});if(!e.available)return void E(r.unavailable,"error",{canRetry:!1,reason:"unavailable"});if(!a.isSecureContext||!navigator.locks)return void E(r.browser,"error",{canRetry:!1,reason:"browser"});const o=n&&C?new AbortController:null;let s=!1;x=o,o?(E(r.waiting,"handover"),M=setTimeout(()=>{s=!0,o.abort()},15e3)):E(t.saving?r.saving:r.updating);try{const n=o?{signal:o.signal}:{ifAvailable:!0};if(y=navigator.locks.request(`meet-the-frontend-live-preview-panel:${e.endpoint}:${i}`,n,async e=>{if(clearTimeout(M),M=null,x=null,l.visible&&!o?.signal.aborted)if(e){E(t.saving?r.saving:r.updating);try{await new Promise(e=>{b=e,p=!0,m+=1,V()}),await g}finally{b=null}}else E(C?r.conflict:r.closeOther,"conflict",{reason:C?"other-tab":"manual"})}),o)try{C.postMessage({type:"takeover"})}catch(e){throw o.abort(),p&&$(!0),await y.catch(()=>{}),e}await y,l.visible&&s&&E(r.takeoverTimeout,"conflict",{reason:"busy"})}catch(e){p=!1,l.visible&&s?E(r.takeoverTimeout,"conflict",{reason:"busy"}):l.visible&&"AbortError"!==e.name&&P(e)}finally{clearTimeout(M),M=null,x=null,y=null}}function A(e=!0){t.saving||(e||(k=!1),p?(m+=1,h.cancel(),L(0)):D())}return{changed:T,pause:function(e=r.saving,t="loading"){return m+=1,S(),h.cancel(),(p||l.visible&&"paused"===t)&&E(e,t,{canRetry:!1}),v},resume:function(e){w=e,e?l.visible&&P(e):!l.visible||p||y?T():D()},setTitle:l.setTitle,openFromLauncher:l.openFromLauncher,start:()=>{l.visible&&D()},get pending(){return g}}}const Y=window.meetTheFrontendLivePreviewPanel,U=document.getElementById("edittag");if(Y&&U)try{!function(e,t,n,o){const r='.term-name-wrap input[name="name"]',i='.term-description-wrap textarea[name="description"]',a="input change undo redo SetContent";let s,l;function c(){const n=t.querySelector(r)?.value,o=t.querySelector(i),a=s&&s.getElement()===o&&s.getBody()&&!s.isHidden()?s.getContent():o?.value;if("string"!=typeof n||"string"!=typeof a)throw new Error(e.strings.bootFailed);return{name:n,description:a}}const d=J(e,{title:c().name,async preparePreview(){const t=c(),n=l?.capture(),o={"X-WP-Nonce":e.nonce};n&&(o["Content-Type"]="application/json");const r=await fetch(e.endpoint,{method:"POST",credentials:"same-origin",headers:o,body:n?JSON.stringify({...n,...t}):new URLSearchParams(t)}),i=await r.json();if(!r.ok)throw Object.assign(new Error(i.message||e.strings.failed),{code:i.code});return{...i,comparisonValues:{name:{type:"text",value:t.name},description:{type:"html",value:t.description}}}}},{inlineLauncher:o});function u(e){if(e.target.matches(r))d.setTitle(e.target.value);else if(!e.target.matches(i))return;d.changed()}function f(){d.changed()}function p(e){"description"===e?.id&&e!==s&&t.contains(e.getElement())&&(s?.off(a,f),s=e,s.on(a,f),f())}l=function(e,t,n){if(!e.acfTermEnabled||!t.querySelector('[name="_acf_nonce"]'))return;const{acf:o,jQuery:r,tinymce:i}=window,a=()=>Object.assign(new Error(e.strings.acfUnavailable),{code:"mtflpp_acf_unavailable"});if("function"!=typeof o?.serialize||"function"!=typeof o.addAction||"function"!=typeof o.removeAction||"function"!=typeof r)throw a();const s=new Set,l="input change undo redo SetContent";function c(e){const o=e?.getElement?.();o?.name?.startsWith("acf[")&&t.contains(o)&&!s.has(e)&&(s.add(e),e.on(l,n),e.on("remove",()=>{s.delete(e),e.off(l,n)}))}const d=function(e,t,n,o){const r=window.acf;r.addAction("wysiwyg_tinymce_init",n);for(const e of["append","remove","sortstop","change_field"])r.addAction(e,t);const i=t=>{t[0]===e&&o?.()};function a(e){return!!e?.closest?.(".acf-field")}return r.addAction("validation_failure",i),window.jQuery(e).on("input.mtflppAcf change.mtflppAcf sortupdate.mtflppAcf",e=>{e.originalEvent&&"sortupdate"!==e.type||!a(e.target)||t()}),{isField:a,isValidating:()=>!!e.classList?.contains("is-validating"),hasStructuralPaginationChanges:()=>!!e.querySelector('.acf-repeater[data-pagination="1"] .acf-row:is(.acf-added, .acf-inserted, .acf-reordered, .acf-deleted)'),accepts:e=>"_acf_nonce"===e||e.startsWith("acf[")||e.startsWith("_acf_fields["),destroy(){r.removeAction("wysiwyg_tinymce_init",n);for(const e of["append","remove","sortstop","change_field"])r.removeAction(e,t);r.removeAction("validation_failure",i),window.jQuery(e).off(".mtflppAcf")}}}(t,n,c);for(const e of i?.editors??[])c(e);const u=r(t.ownerDocument),f="tinymce-editor-init.mtflppAcfTerm";u.on(f,(e,t)=>c(t));const p=e=>{d.isField(e.target)&&n()};return t.addEventListener("input",p),t.addEventListener("change",p,!0),{capture(){const e=[];try{for(const n of s){const o=n.getElement();o&&t.contains(o)&&n.getBody()&&!n.isHidden()&&(e.push([o,o.value]),o.value=n.getContent())}const{acf:n,_acf_nonce:i,_acf_fields:l}=o.serialize(r(t));if(!n)return{};if(!i)throw a();return{acf:n,_acf_nonce:i,_acf_fields:l}}finally{for(const[t,n]of e)t.value=n}},destroy(){d.destroy(),u.off(f),t.removeEventListener("input",p),t.removeEventListener("change",p,!0);for(const e of s)e.off(l,n);s.clear()}}}?.(e,t,d.changed);const m=window.jQuery?.(t.ownerDocument);m?.on("tinymce-editor-init.mtflppTermEditor",(e,t)=>p(t)),p(window.tinymce?.get("description")),window.addEventListener("pagehide",e=>{e.persisted||(s?.off(a,f),m?.off("tinymce-editor-init.mtflppTermEditor"),l?.destroy())}),t.addEventListener("input",u),t.addEventListener("change",u,!0),d.start()}(Y,U,0,U.querySelector("#mtflpp-term-preview button"))}catch(e){!function(e,t){document.getElementById("mtflpp-panel")?.remove(),document.getElementById("mtflpp-toggle")?.remove(),document.getElementById("mtflpp-publish-preview")?.remove(),document.getElementById("mtflpp-term-preview")?.remove();const n=document.createElement("div");n.className="notice notice-error",n.setAttribute("role","alert");const o=document.createElement("p");o.textContent=e,n.append(o),(document.getElementById("wpbody-content")||document.body).prepend(n),console.error("Meet the Frontend – Live Preview Panel could not start.",t)}(Y.strings.bootFailed,e)}})();
     1(()=>{"use strict";const e=window.wp.data,t=window.wp.preferences,n=window.wp.element,o=window.wp.components,r=window.wp.notices,i=window.wp.primitives,a=window.ReactJSXRuntime,s={refresh:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M12 5.5L17.7929 11.2929C18.1834 11.6834 18.1834 12.3166 17.7929 12.7071L16 14.5M16 5.5H12V9.5M12 18.5L6.20711 12.7071C5.81658 12.3166 5.81658 11.6834 6.20711 11.2929L8 9.5M8 18.5H12V14.5"})}),more:(0,a.jsxs)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,a.jsx)(i.Path,{d:"M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z",fill:"currentColor",stroke:"none"}),(0,a.jsx)(i.Path,{d:"M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z",fill:"currentColor",stroke:"none"}),(0,a.jsx)(i.Path,{d:"M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z",fill:"currentColor",stroke:"none"}),(0,a.jsx)(i.Path,{d:"M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z"}),(0,a.jsx)(i.Path,{d:"M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z"}),(0,a.jsx)(i.Path,{d:"M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z"})]}),expand:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M4.75 10V4.75H10M4.75 4.75L10 10M14 19.25H19.25V14M19.25 19.25L14 14"})}),compact:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M10 4.75V10H4.75M10 10L4.75 4.75M19.25 14H14V19.25M14 14L19.25 19.25"})}),pip:(0,a.jsxs)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,a.jsx)(i.Path,{d:"M4.75 9.25V16C4.75 16.6904 5.30964 17.25 6 17.25H8M4.75 9.25V6C4.75 5.30964 5.30964 4.75 6 4.75H16C16.6904 4.75 17.25 5.30964 17.25 6V8M4.75 9.25H8"}),(0,a.jsx)(i.Path,{d:"M10.75 11.25C10.75 10.9739 10.9739 10.75 11.25 10.75H18.75C19.0261 10.75 19.25 10.9739 19.25 11.25V18.75C19.25 19.0261 19.0261 19.25 18.75 19.25H11.25C10.9739 19.25 10.75 19.0261 10.75 18.75V11.25Z",fill:"currentColor"})]}),move:(0,a.jsxs)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,a.jsx)(i.Path,{d:"M9.25 5.75H8.75V6.25H9.25V5.75Z",fill:"currentColor",stroke:"none"}),(0,a.jsx)(i.Path,{d:"M9.25 11.75H8.75V12.25H9.25V11.75Z",fill:"currentColor",stroke:"none"}),(0,a.jsx)(i.Path,{d:"M9.25 17.75H8.75V18.25H9.25V17.75Z",fill:"currentColor",stroke:"none"}),(0,a.jsx)(i.Path,{d:"M15.25 5.75H14.75V6.25H15.25V5.75Z",fill:"currentColor",stroke:"none"}),(0,a.jsx)(i.Path,{d:"M15.25 11.75H14.75V12.25H15.25V11.75Z",fill:"currentColor",stroke:"none"}),(0,a.jsx)(i.Path,{d:"M15.25 17.75H14.75V18.25H15.25V17.75Z",fill:"currentColor",stroke:"none"}),(0,a.jsx)(i.Path,{d:"M9.25 5.75H8.75V6.25H9.25V5.75Z"}),(0,a.jsx)(i.Path,{d:"M9.25 11.75H8.75V12.25H9.25V11.75Z"}),(0,a.jsx)(i.Path,{d:"M9.25 17.75H8.75V18.25H9.25V17.75Z"}),(0,a.jsx)(i.Path,{d:"M15.25 5.75H14.75V6.25H15.25V5.75Z"}),(0,a.jsx)(i.Path,{d:"M15.25 11.75H14.75V12.25H15.25V11.75Z"}),(0,a.jsx)(i.Path,{d:"M15.25 17.75H14.75V18.25H15.25V17.75Z"})]}),warning:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M12 8L12 13M12 14.5L12 16M4.75 12C4.75 7.99593 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12Z",strokeLinejoin:"round"})}),info:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M12 16V11M12 9.5V8M19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12C4.75 7.99594 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12Z",strokeLinejoin:"round"})}),close:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M7.75 16.25L16.25 7.75M16.25 16.25L7.75 7.75"})}),check:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M7 12L10 15L17 8"})}),chevron:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M7 11L12 15L17 11"})}),desktop:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M4.75 16.75V17H3.25C3.11193 17 3 17.1119 3 17.25H21C21 17.1119 20.8881 17 20.75 17H19.25V16.75M4.75 16.75V8.5C4.75 7.80964 5.30964 7.25 6 7.25H18C18.6904 7.25 19.25 7.80964 19.25 8.5V16.75M4.75 16.75H19.25"})}),tablet:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M10 16.5H14M18.25 18V6C18.25 5.30964 17.6904 4.75 17 4.75H7C6.30964 4.75 5.75 5.30964 5.75 6L5.75 18C5.75 18.6904 6.30964 19.25 7 19.25H17C17.6904 19.25 18.25 18.6904 18.25 18Z"})}),mobile:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M11 16.5H13M16.25 18V6C16.25 5.30964 15.6904 4.75 15 4.75H9C8.30964 4.75 7.75 5.30964 7.75 6L7.75 18C7.75 18.6904 8.30964 19.25 9 19.25H15C15.6904 19.25 16.25 18.6904 16.25 18Z"})})};function l(e,t,n="right"){const o=e&&!Array.isArray(e)&&e.bounds&&["x","y","width","height"].every(t=>Number.isFinite(e.bounds[t]))&&e.bounds.width>0&&e.bounds.height>0&&[null,"left","center","right"].includes(e.dock)&&"boolean"==typeof e.expanded&&(void 0===e.anchor||["left","center","right"].includes(e.anchor));let r=!!o&&e.expanded;const i={width:480,height:393},a=o?{...e.bounds}:{x:0,y:0,...i};let s=o?e.dock:n,l=s||o&&e.anchor||"right";function c(){return"left"===l?0:"center"===l?.5:1}function u(e,n=t(!s),o=320,r=220){return e.width=Math.min(n.width,Math.max(Math.min(o,n.width),e.width)),e.height=Math.min(n.height,Math.max(Math.min(r,n.height),e.height)),e.x=Math.max(n.left,Math.min(n.right-e.width,e.x)),e.y=Math.max(n.top,Math.min(n.bottom-e.height,e.y)),e}function d(e){if(!s)return e;const n=t();return e.x="left"===s?n.left:"center"===s?n.left+(n.width-e.width)/2:n.right-e.width,e.y=n.bottom-e.height,e}return{area:t,compactRect:function(){return d(u({...a}))},launcherRect:function(e){return d(u({...e,x:a.x+(a.width-e.width)*c(),y:a.y+a.height-e.height},t(!s),1,1))},usableEdge:function(e){return!(s&&(e.includes("s")||"left"===s&&e.includes("w")||"right"===s&&e.includes("e")))},get anchor(){return l},get anchorFactor(){return c()},get dock(){return s},get expanded(){return r},get layout(){return{bounds:{...a},dock:s,anchor:l,expanded:r}},toggleExpanded(){r=!r},dockTo:function(e="right",t=!1){t&&Object.assign(a,i),r=!1,l=s=e},resize(e,n,o,r){Object.assign(a,function(e,n,o,r){const i=t(!s),a=n.includes("e")||n.includes("w"),c=n.includes("n")||n.includes("s"),u=function(e){return"center"===l?.5:e.includes("w")?1:0}(n),d=e.x+e.width*u,f=n.includes("n"),p=e.y+(f?e.height:0),m=function(e,t,n){return 0===n?e.right-t:1===n?t-e.left:2*Math.min(t-e.left,e.right-t)}(i,d,u),h=f?p-i.top:i.bottom-p,g=(n.includes("w")?-o:o)*(.5===u?2:1),w=Math.max(Math.min(320,m),Math.min(m,e.width+g)),v=Math.max(Math.min(220,h),Math.min(h,e.height+(f?-r:r))),y=a&&0!==o&&w!==e.width,b=c&&0!==r&&v!==e.height,x=f?p-v:p;return{x:y?d-w*u:e.preferredBounds.x,y:b?x:e.preferredBounds.y,width:y?w:e.preferredBounds.width,height:b?v:e.preferredBounds.height}}(e,n,o,r))},move:function(e,n,o,r=!1){const i=u({...e,x:e.x+n,y:e.y+o},t(!0),r?1:320,r?1:220);a.x=i.x+(r?(i.width-a.width)*c():0),a.y=i.y+(r?i.height-a.height:0),s=null}}}function c(i,{postTitle:a="",publicRedirect:c,inlineLauncher:u,nativeLauncher:d,canRememberVisibility:f=!0,onOpen:p,onClose:m,onRefresh:h,onRetry:g,beforeMove:w,afterMove:v,beforeViewportChange:y}){const b=window,x=document,M="meet-the-frontend-live-preview-panel",C=(0,e.select)(t.store),k=(0,e.dispatch)(t.store),S="width"===C.get(M,"fit")?"width":"automatic";k.setDefaults(M,{rememberVisibility:!0,rememberPosition:!0,panelOpen:!0,scrollToChanges:!0,viewport:"desktop",fitMode:S,customZoom:100,tabletOrientation:"portrait",mobileOrientation:"portrait"});const E=()=>!u&&(!d||d.fallbackMedia.matches);let P=!1!==C.get(M,"rememberVisibility"),L=!1!==C.get(M,"rememberPosition"),T=!1!==C.get(M,"scrollToChanges");const V=u?.parentElement??x.getElementById("mtflpp-toggle"),O=x.getElementById("mtflpp-panel");if(!V||!O)throw new Error("Preview panel markup is missing.");const H=u||function(e){let t;const{title:r,moveHelp:i}=e.dataset;return(0,n.flushSync)(()=>(0,n.createRoot)(e).render((0,n.createElement)(o.Button,{ref:e=>{t=e},variant:"secondary",label:r,title:r,description:i,"aria-controls":"mtflpp-panel","aria-expanded":!1},(0,n.createElement)("span",{className:"mtflpp-launcher-label"},r)))),t}(V),j=O.querySelector(".mtflpp-move-control"),R=O.querySelector(".mtflpp-resize"),$=O.querySelectorAll("[data-resize-edge]"),N=O.querySelector(".mtflpp-header"),_=O.querySelector(".mtflpp-caption"),A=O.querySelector(".mtflpp-viewport"),B=O.querySelector(".mtflpp-canvas"),F=O.querySelector(".mtflpp-stage"),D=O.querySelector(".mtflpp-empty"),q=O.querySelector(".mtflpp-devicebar"),W=O.querySelector(".mtflpp-dimensions"),z=O.querySelector(".mtflpp-feedback"),Z=O.querySelector('[role="status"]');let I;const J=function(e,t,n,o={},r=()=>{},i={desktop:"Desktop",tablet:"Tablet",mobile:"Phone"}){const a=e.ownerDocument.defaultView,s=e.querySelector(".mtflpp-canvas"),l=e.querySelector(".mtflpp-canvas-space"),c=n.querySelector(".mtflpp-dimensions-text"),u={desktop:[1280,800],tablet:[768,1024],mobile:[390,844]},d=Object.keys(u);let f=d.includes(o.device)?o.device:"desktop";const p=["automatic","window","width","custom"];let m=p.includes(o.fit)?o.fit:"automatic";const h=e=>Number.isInteger(e)&&e>=10&&e<=400;let g,w=h(o.customZoom)?o.customZoom:100,v=100;const y=e=>"desktop"===e?"landscape":"portrait",b=Object.fromEntries(d.map(e=>[e,"desktop"!==e&&["portrait","landscape"].includes(o[`${e}Orientation`])?o[`${e}Orientation`]:y(e)])),x=()=>b[f]===y(f)?u[f]:[...u[f]].reverse(),M=()=>"width"===m;let C,k,S;const E=a.matchMedia("(prefers-reduced-motion: no-preference)");function P(){const t=e.ownerDocument.defaultView.devicePixelRatio;return Number.isFinite(t)&&t>0?t:1}function L(e,t){if("custom"===m)return w/100/P();const n=s.clientWidth/e;if(M())return n;const o=Math.min(n,s.clientHeight/t);return"automatic"===m?Math.min(1/P(),o):o}function T(e,n){C=e;const[o,r]=x(),i=Math.max(0,(s.clientWidth-o*C)/2),a=Math.max(0,(s.clientHeight-r*C)/2);Object.assign(l.style,{width:`${Math.max(s.clientWidth,i+o*C)}px`,height:`${Math.max(s.clientHeight,a+r*C)}px`}),Object.assign(t.style,{left:`${i}px`,top:`${a}px`,transform:`scale(${C})`});const c=o*C>s.clientWidth+.01||r*C>s.clientHeight+.01,u="custom"===m||M();s.tabIndex=u&&c?0:-1,s.scrollLeft="custom"===m?n.x*C:0,s.scrollTop=u?n.y*C:0}function V(){if(!k)return;const e=k;k=null,e.window.cancelAnimationFrame(e.frame),e.resolve?.()}function O(e,t,n,o){return t<=0||o&&e<-1&&t<n?Math.max(e,t-n):e>=n||o&&e>0&&t>n+1?Math.min(e,t-n):0}function H(o=!1,a=!1){V();const[l,u]=x();if(Object.assign(t.style,{width:`${l}px`,height:`${u}px`}),!e.clientWidth||!e.clientHeight)return;const d=P(),p=`${i[f]} (${l} × ${u}) · `,h=Math.max(400,Math.ceil(e.clientWidth/l*d*100)),y=`${p}${"0".repeat(String(h).length)}%`;n.dataset.reserve!==y&&(n.dataset.reserve=y);const b=a?{x:0,y:0}:{x:(s.scrollLeft||0)/(C||1),y:(s.scrollTop||0)/(C||1)};if(s.style.overflowX="hidden",s.style.overflowY="hidden","custom"===m){const e=L(l,u);for(let t=0;t<2;t++)l*e>s.clientWidth+.01&&(s.style.overflowX="scroll"),u*e>s.clientHeight+.01&&(s.style.overflowY="scroll")}else M()&&u*L(l,u)>e.clientHeight&&(s.style.overflowY="scroll");if(!s.clientWidth||!s.clientHeight)return;const S=L(l,u),O=Math.round(S*d*100),H=O!==v||d!==g;v=O,g=d;const j=`${p}${"custom"===m?w:v}%`;c.textContent!==j&&(c.textContent=j),H&&r();const R=C??S;if(!o||!E.matches||R===S)return void T(S,b);const $={window:e.ownerDocument.defaultView,frame:null},N=$.window.performance.now();k=$;const _=e=>{T(e,b),$.scrollLeft=s.scrollLeft,$.scrollTop=s.scrollTop};_(R);const A=e=>{if(k!==$)return;const t=Math.min(1,Math.max(0,(e-N)/200));_(R+(S-R)*(1-(1-t)**3)),t<1?$.frame=$.window.requestAnimationFrame(A):V()};$.frame=$.window.requestAnimationFrame(A)}function j(){H()}function R(){S?.();const t=e.ownerDocument.defaultView.matchMedia(`(resolution: ${P()}dppx)`);t.addEventListener("change",R),S=()=>t.removeEventListener("change",R),j()}let $=new a.ResizeObserver(j);return $.observe(e),E.addEventListener("change",j),a.addEventListener("resize",R),R(),{get device(){return f},get fit(){return m},get customZoom(){return w},get zoomPercent(){return"custom"===m?w:v},get dpr(){return P()},get orientation(){return b[f]},canvasTarget:function(e,t,{fitTarget:n=!1}={}){const o=e.getBoundingClientRect(),r=s.getBoundingClientRect(),i=o.left-r.left-s.clientLeft,a=o.top-r.top-s.clientTop,l=O(i+t.left*C,i+t.right*C,s.clientWidth,n),c=O(a+t.top*C,a+t.bottom*C,s.clientHeight,n),u=Math.max(t.left,-i/C),d=Math.min(t.right,(s.clientWidth-i)/C);return{visible:!l&&!c,visibleCenterX:u<d?(u+d)/2:void 0,distance:Math.hypot(l,c),reveal(e="instant"){(l||c)&&s.scrollBy({left:l,top:c,behavior:e})}}},canvasWasPanned:function(){return!!k&&(s.scrollLeft!==k.scrollLeft||s.scrollTop!==k.scrollTop)},whenSettled:function(){if(!k)return;const e=k;return e.done??=new Promise(t=>{e.resolve=t}),e.done},finishMotion(){k&&j()},select(e,{animate:t=!1,keepPan:n=!1}={}){if(!d.includes(e))return;const o=f!==e;f=e,o?H(t,!n):k||j()},rotate({animate:e=!1,keepPan:t=!1}={}){"desktop"!==f&&(b[f]="portrait"===b[f]?"landscape":"portrait",H(e,!t))},setFit(e){p.includes(e)&&m!==e&&(m=e,H(!1,!0))},setZoom(e){if(!h(e)||"custom"===m&&w===e)return;const t="custom"!==m;w=e,m="custom",H(!1,t)},layout:j,beforeMove(){V(),$.disconnect(),S?.(),e.ownerDocument.defaultView.removeEventListener("resize",R)},afterMove(){$=new e.ownerDocument.defaultView.ResizeObserver(j),$.observe(e),e.ownerDocument.defaultView.addEventListener("resize",R),R()}}}(A,F,W,{device:C.get(M,"viewport"),fit:C.get(M,"fitMode")??S,customZoom:C.get(M,"customZoom"),tabletOrientation:C.get(M,"tabletOrientation"),mobileOrientation:C.get(M,"mobileOrientation")},()=>Pe(),i),G=x.querySelector("#wpbody-content > .wrap"),X=x.getElementById("wpadminbar");function Y(e=!1){const t=Math.max(1,x.documentElement.clientWidth),n=Math.max(1,x.documentElement.clientHeight),o=x.documentElement.getBoundingClientRect().left+b.scrollX,r=!e&&G?.getBoundingClientRect(),i=r?Math.max(0,"rtl"===b.getComputedStyle(G).direction?r.left-o:o+t-r.right):20,a=e?0:i,s=Math.min(a,(t-1)/2),l=Math.min(Math.max(0,X?.getBoundingClientRect().bottom||0)+a,n-1),c=t-s,u=n-Math.min(a,n-l-1);return{left:s,top:l,right:c,bottom:u,width:c-s,height:u-l}}let U,K=f&&(!P||!1!==C.get(M,"panelOpen")),Q=!1;const ee=C.get(M,"layout"),te=C.get(M,"position")??ee?.dock??ee?.anchor;let ne=["left","center","right"].includes(te)?te:"right";const oe=l(L?ee:void 0,Y,ne),{compactRect:re,usableEdge:ie}=oe;let ae,se=!1,le="",ce=!1,ue={text:i.loading,state:"loading",hasPreview:!1,canRetry:!1,reason:""},de=!1;function fe(e){const t="string"==typeof e?e.replace(/\s+/g," ").trim():"";_.textContent=t?`${i.preview} — ${t}`:i.title,_.title=_.textContent,U&&(U.document.title=_.textContent)}function pe(){const{text:e,state:t,hasPreview:n,reason:o}=ue;return"handover"===t?{heading:i.switchingPreview,description:e,note:i.tabEdits}:"conflict"===t?{heading:e,description:{"handed-off":i.handedOffHelp,busy:i.takeoverTimeoutHelp,manual:i.closeOtherHelp}[o]||i.conflictHelp,note:"manual"===o?i.manualSwitchHint:i.tabEdits}:"paused"===t?{heading:i.pausedTitle,description:e,note:""}:"error"===t?function(){const{text:e,hasPreview:t,canRetry:n,reason:o}=ue;if("origin-mismatch"===o)return{heading:i.originMismatchTitle,description:t?`${e} ${i.previousPreview}`:e,note:""};if("unavailable"===o||"browser"===o)return{heading:"unavailable"===o?i.unavailableTitle:i.browserTitle,description:e,note:""};const r={reload:i.reviewBeforeReload,"reload-before-save":i.nativePreviewAcfReload}[o];if(!t){let t=e;return e===i.failed&&(t=n?i.failedHelp:""),r&&(t+=` ${r}`),{heading:i.failed,description:t,note:""}}return{heading:e===i.failed?i.refreshFailed:e,description:r||i.previousPreview,note:""}}():n?{heading:e,description:"",note:""}:{heading:i.loading,description:i.preparing,note:""}}function me(){return se?"handover"===ue.state?i.takingOver:i.takeOver:i.retry}function he(e){return!e||["handover","paused"].includes(ue.state)?"info":"error"!==ue.state||ue.canRetry?"warning":"error"}function ge(){return ue.redirectDestination?`${i.redirected} ${ue.redirectDestination}`:ue.hasHtmlPreview&&ae?`${i.publicRedirected} ${ae}`:""}function we(){const{state:e,hasPreview:t,canRetry:n,reason:o}=ue,r=t&&["error","conflict","handover","paused"].includes(e),a=!t||r||le?"":ge();if(z.hidden=!r&&!le&&!a,z.tabIndex=z.hidden?-1:0,O.dataset.hasFeedback=String(!z.hidden),z.hidden)return null;if(a)return{heading:a,status:"info",dismissible:!1};const{heading:s,description:l}=pe();return{heading:r?s:le,description:r?l:i.windowNoticeHelp,status:he(r),dismissible:!r,retry:r&&(se||n&&["error","conflict"].includes(e)),close:r&&"error"===e&&!n&&!["reload","reload-before-save"].includes(o),disabled:"handover"===e,action:me()}}function ve(e){ue.hasPreview&&["error","conflict","handover","paused"].includes(ue.state)||(le=e,Pe()),Z.textContent=`${e} ${i.windowNoticeHelp}`}function ye(){le="",Pe()}function be(e,t="loading",{canTakeOver:n=!1,hasPreview:o=!1,hasHtmlPreview:r=!1,redirectDestination:i,canRefresh:a=!1,canRetry:s=!0,reason:l=""}={}){const u=O.ownerDocument.activeElement,d=O.contains(u),f=!o&&(ue.state!==t||ue.text!==e||ue.reason!==l),p=ue.hasPreview!==o;ue={text:e,state:t,canTakeOver:n,hasPreview:o,hasHtmlPreview:r,redirectDestination:i,canRefresh:a,canRetry:s,reason:l},["error","conflict","handover","paused"].includes(t)&&(le=""),O.dataset.state=t,O.dataset.hasPreview=String(o),se=n&&["conflict","handover"].includes(t),D.hidden=o,q.hidden=!o;const{heading:m,description:h,note:g}=pe();f&&(D.scrollTop=0);const w="ready"!==t||le?"":ge();Z.textContent=o?[m,h,g,w].filter(Boolean).join(" "):m,Pe(),p&&J.layout(),function(e,t){e&&t&&(!O.contains(e)||e.closest("[hidden]")||e.disabled||!ue.hasPreview&&B.contains(e))&&I.focus(D.hidden?"actions":"empty-title")}(u,d),K&&"ready"===t&&r&&!i&&async function(){if(c&&!ce){ce=!0;try{const e=new URL(c.endpoint);if(e.origin!==b.location.origin)return;const t=await b.fetch(e,{credentials:"same-origin",cache:"no-store",redirect:"error",headers:{"X-WP-Nonce":c.nonce}});if(!t.ok)return;const{destination:n}=await t.json();if("string"!=typeof n||!n)return;if(ae=n,!K)return;Pe(),"ready"!==ue.state||!ue.hasHtmlPreview||ue.redirectDestination||le||(Z.textContent=ge())}catch{}}}()}function xe(e){f&&P&&C.get(M,"panelOpen")!==e&&k.set(M,"panelOpen",e)}function Me(){L&&k.set(M,"layout",oe.layout)}function Ce(){const e=V.hidden;V.hidden=!1,V.style.maxWidth=`${Y(!oe.dock).width}px`;const t={width:V.offsetWidth,height:V.offsetHeight};return V.hidden=e,oe.launcherRect(t)}function ke(){if(U)return;if(!K&&E()){const e=Ce(),t=oe.anchorFactor;Object.assign(V.style,{left:`${e.x+e.width*t}px`,top:`${e.y+e.height}px`,transform:`translate(${-100*t}%, -100%)`})}let e=re();if(O.dataset.anchor=oe.anchor,oe.expanded){const t=Y();e={x:t.left,y:t.top,width:t.width,height:t.height}}Object.assign(O.style,{left:`${e.x}px`,top:`${e.y}px`,width:`${e.width}px`,height:`${e.height}px`,transform:""})}function Se(e="right",t=!1){oe.dockTo(e,t),ne=e,k.set(M,"position",ne),ke(),Me(),Pe()}function Ee(){return"function"==typeof b.documentPictureInPicture?.requestWindow}function Pe(){if(!I)return;const e=O.ownerDocument.fullscreenElement===O,t=!U&&!e,n=t&&!oe.expanded;O.classList.toggle("mtflpp-expanded",oe.expanded),R.hidden=!n;for(const e of $)e.hidden=!n||!ie(e.dataset.resizeEdge);const o=se||ue.canRetry&&["error","conflict"].includes(ue.state);var r;I.update({inPage:t,inPip:!!U,movable:n,dock:oe.dock,canRememberVisibility:f,rememberVisibility:P,rememberPosition:L,followChanges:T,device:J.device,busy:ue.hasPreview&&["stale","loading","handover"].includes(ue.state)&&ue.text!==i.saving,empty:ue.hasPreview?null:{...pe(),busy:["loading","stale","ready","handover"].includes(ue.state),icon:["paused","conflict"].includes(ue.state)||["unavailable","browser","origin-mismatch"].includes(ue.reason)?"info":"warning",retry:o,disabled:"handover"===ue.state,close:"error"===ue.state&&!o,action:me()},notice:we(),fit:J.fit,orientation:J.orientation,customZoom:J.customZoom,zoomPercent:J.zoomPercent,dpr:J.dpr,canRefresh:ue.canRefresh,hasPreview:ue.hasPreview,canPip:t&&Ee(),canFullscreen:t&&!!x.fullscreenEnabled,mode:e||oe.expanded?"compact":"expand",modeLabel:(r=e,r?i.exitFullscreen:oe.expanded?i.compact:i.expand)})}function Le(){I.closeMenu(),U?U.close():x.fullscreenElement!==O?(oe.toggleExpanded(),ke(),Me(),Pe(),I.focus("mode")):x.exitFullscreen().then(ye,()=>ve(i.fullscreenFailed))}function Te(e,t=!1,n){const o=e===H,r=e===N,a=()=>n||("left"===oe.anchor?"ne":"nw"),s=()=>U||!o&&oe.expanded||x.fullscreenElement===O||t&&!ie(a());let l,c;const u=()=>({...o?Ce():re(),preferredBounds:oe.layout.bounds});function d(){if(c=null,l)if(t||o)ke();else{const e=re(),t=e.x-parseFloat(O.style.left),n=e.y-parseFloat(O.style.top);Object.assign(O.style,{width:`${e.width}px`,height:`${e.height}px`,transform:`translate3d(${t}px, ${n}px, 0)`})}}function f(){if(!l)return;const{pointer:t,moved:n}=l;l=null,b.cancelAnimationFrame(c),e.hasPointerCapture(t)&&e.releasePointerCapture(t),O.classList.remove("mtflpp-dragging"),e.classList.remove("mtflpp-edge-active"),x.documentElement.classList.remove("mtflpp-window-dragging"),x.documentElement.style.removeProperty("--mtflpp-drag-cursor"),ke(),n&&(o&&(de=!0),Me(),Pe())}e.addEventListener("pointerdown",t=>{0!==t.button||s()||r&&t.target.closest('button, a, [role="button"]')||(o&&(de=!1),t.preventDefault(),o?H.focus({preventScroll:!0}):e===j&&I.focus("move"),I.closeMenu(),l={...u(),pointer:t.pointerId,pointerX:t.clientX,pointerY:t.clientY},e.setPointerCapture(t.pointerId))}),e.addEventListener("pointermove",n=>{if(!l||l.pointer!==n.pointerId)return;const r=n.clientX-l.pointerX,i=n.clientY-l.pointerY;!l.moved&&Math.abs(r)+Math.abs(i)<4||(l.moved=!0,O.classList.add("mtflpp-dragging"),t&&e.classList.add("mtflpp-edge-active"),x.documentElement.style.setProperty("--mtflpp-drag-cursor",t?b.getComputedStyle(e).cursor:"grabbing"),x.documentElement.classList.add("mtflpp-window-dragging"),t?oe.resize(l,a(),r,i):oe.move(l,r,i,o),c||(c=b.requestAnimationFrame(d)))});for(const t of["pointerup","pointercancel","lostpointercapture"])e.addEventListener(t,f);b.addEventListener("blur",f),r||n||e.addEventListener("keydown",e=>{const n={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[e.key];if(!n||e.altKey||e.ctrlKey||e.metaKey||s())return;e.preventDefault(),I.closeMenu();const r=u(),l=e.shiftKey?40:10;t?oe.resize(r,a(),n[0]*l,n[1]*l):oe.move(r,n[0]*l,n[1]*l,o),ke(),Me(),Pe();const c=re();Z.textContent=t?`${i.resize}: ${Math.round(c.width)} × ${Math.round(c.height)}`:i.moved})}fe(a),N.addEventListener("dblclick",e=>{U||e.target.closest("button, a")||Le()}),x.addEventListener("fullscreenchange",Pe),R.addEventListener("keydown",e=>{"Escape"===e.key&&R.classList.add("mtflpp-help-dismissed")}),R.addEventListener("blur",()=>R.classList.remove("mtflpp-help-dismissed")),Te(j),Te(N),u||Te(H),Te(R,!0);for(const e of $)Te(e,!0,e.dataset.resizeEdge);function Ve(){O.hidden=Q||!K,V.hidden=Q||!u&&(K||!E()),H.setAttribute("aria-expanded",String(!O.hidden))}function Oe(){I.closeMenu(),U?.close(),x.fullscreenElement===O&&x.exitFullscreen().catch(()=>{})}function He(e=!0){Q||(K?I.focus("actions"):(xe(!0),p(),K&&e&&I.focus("actions")))}return b.addEventListener("resize",ke),b.addEventListener("scroll",ke,{passive:!0}),d?.fallbackMedia.addEventListener("change",()=>{ke(),Ve()}),H.addEventListener("click",e=>{if(de&&0!==e.detail)return de=!1,void e.preventDefault();de=!1,He(0===e.detail)}),I=function(t,i,a){const l=t.querySelector(".mtflpp-controls"),c=t.querySelector(".mtflpp-refresh-control"),u=t.querySelector(".mtflpp-move-control"),d=t.querySelector(".mtflpp-device-controls"),f=t.querySelector(".mtflpp-fit-control"),p=t.querySelector(".mtflpp-pip-control"),m=t.querySelector(".mtflpp-empty"),h=t.querySelector(".mtflpp-feedback");let g,w=(0,n.createRoot)(l),v=!1,y=!1,b=!1;const x=r.InlineNotices?(0,e.dispatch)(r.store):null,M=t.ownerDocument.defaultView?.wp?.theme?.ThemeProvider,C="meet-the-frontend-live-preview-panel",k="preview-feedback";let S="";function E(){const e=g.notice,t=/[.!?…。!?]$/.test(e.heading)?e.heading:`${e.heading}.`;return{message:e.description?`${t} ${e.description}`:e.heading,status:e.status,isDismissible:e.dismissible,actions:[...e.retry?[{label:e.action,disabled:e.disabled,onClick:a.retry}]:[],...e.close?[{label:i.close,onClick:a.close}]:[]]}}function P(){x&&S&&x.removeNotice(k,C),S=""}function L(e){return()=>{O(),e()}}function T(){const{inPage:e,inPip:l,mode:w,modeLabel:k,movable:S,busy:P,canRefresh:T,hasPreview:H,canPip:j}=g;return(0,n.createElement)(o.SlotFillProvider,null,(0,n.createPortal)(S&&e&&(0,n.createElement)(o.Button,{className:"mtflpp-icon mtflpp-move",size:"compact",icon:s.move,label:i.move,showTooltip:!0,tooltipPosition:"bottom","data-action":"move"}),u),(0,n.createPortal)((0,n.createElement)(o.Button,{className:"mtflpp-icon",size:"compact",icon:P?(0,n.createElement)(o.Spinner):s.refresh,label:i.refresh,showTooltip:!0,accessibleWhenDisabled:!0,disabled:!T,onClick:a.refresh,"data-action":"refresh"}),c),(0,n.createPortal)(j&&H&&(0,n.createElement)("div",{className:"mtflpp-pip-surface"},(0,n.createElement)(o.Button,{className:"mtflpp-pip-button",icon:s.pip,label:i.popOutHelp,"aria-label":i.popOut,description:i.popOutHelp,showTooltip:!0,onClick:a.popOut,"data-action":"pop-out"})),p),function(){const{canPip:e,canFullscreen:t,inPage:r,inPip:l,dock:c,canRememberVisibility:u,rememberVisibility:d,rememberPosition:f,followChanges:p}=g;return(0,n.createElement)(o.DropdownMenu,{className:"mtflpp-actions",label:i.actions,icon:s.more,open:v,onToggle(e){v=e,e&&(y=!1),V()},toggleProps:{className:"mtflpp-icon",size:"compact","data-action":"actions"},popoverProps:{placement:"bottom-end",offset:6,shift:!0,className:"mtflpp-menu-popover"}},()=>(0,n.createElement)(n.Fragment,null,(e||t)&&(0,n.createElement)(o.MenuGroup,{label:i.display},e&&(0,n.createElement)(o.MenuItem,{label:i.popOutHelp,description:i.popOutHelp,showTooltip:!0,onClick:L(a.popOut),"data-action":"pip","aria-label":i.popOut},i.popOut),t&&(0,n.createElement)(o.MenuItem,{onClick:L(a.fullscreen),"data-action":"fullscreen"},i.fullscreen)),r&&(0,n.createElement)(o.MenuGroup,{label:i.position},(0,n.createElement)(o.MenuItemsChoice,{value:c,choices:[{value:"left",label:i.bottomLeft},{value:"center",label:i.bottomCenter},{value:"right",label:i.bottomRight}],onSelect(e){O(),a.dock(e)}})),(0,n.createElement)(o.MenuGroup,{label:i.preferences},!1!==u&&(0,n.createElement)(o.MenuItem,{role:"menuitemcheckbox",isSelected:d,icon:d?s.check:void 0,info:i.rememberVisibilityHelp,onClick:L(a.rememberVisibility),"data-action":"remember-visibility"},i.rememberVisibility),(0,n.createElement)(o.MenuItem,{role:"menuitemcheckbox",isSelected:f,icon:f?s.check:void 0,info:i.rememberPositionHelp,onClick:L(a.rememberPosition),"data-action":"remember-position"},i.rememberPosition),(0,n.createElement)(o.MenuItem,{role:"menuitemcheckbox",isSelected:p,icon:p?s.check:void 0,info:i.followHelp,onClick:L(a.follow),"data-action":"follow"},i.follow)),r&&(0,n.createElement)(o.MenuGroup,null,(0,n.createElement)(o.MenuItem,{info:i.resetHelp,onClick:L(a.reset),"data-action":"reset"},i.reset)),l&&(0,n.createElement)(o.MenuGroup,null,(0,n.createElement)(o.MenuItem,{onClick:L(a.close),"data-action":"close"},i.closeLivePreview))))}(),!l&&(0,n.createElement)(o.Button,{className:"mtflpp-icon mtflpp-mode",size:"compact",icon:s[w],label:k,showTooltip:!0,onClick:a.mode,"data-action":"mode"}),!l&&(0,n.createElement)(o.Button,{className:"mtflpp-icon",size:"compact",icon:s.close,label:i.close,showTooltip:!0,onClick:a.close,"data-action":"close"}),(0,n.createPortal)(function(){const{device:e,orientation:t}=g;return(0,n.createElement)(o.Toolbar,{className:"mtflpp-devices",label:i.viewport,variant:"unstyled"},...["desktop","tablet","mobile"].map(r=>{const l=e===r,c=l&&"desktop"!==r,u=c&&"landscape"===t,d="portrait"===t?i.rotateLandscape:i.rotatePortrait;return(0,n.createElement)(o.ToolbarButton,{key:r,icon:s[r],className:u?"mtflpp-device-rotated":void 0,label:c?`${i[r]} — ${d}`:i[r],isPressed:l,"data-viewport":r,onClick:()=>a.device(r)})}))}(),d),(0,n.createPortal)(function(){const{fit:e,customZoom:t=100,dpr:r=1}=g,l={automatic:i.automatic,window:i.fitToWindow,width:i.fitToWidth},c={automatic:i.automaticHelp,window:i.fitToWindowHelp,width:i.fitToWidthHelp},u="custom"===e?i.fixedZoom:l[e]??i.automatic;return(0,n.createElement)(o.Dropdown,{open:y,onToggle(e){y=e,e&&(v=!1,b="custom"===g.fit),V()},contentClassName:"mtflpp-zoom-popover",focusOnMount:"firstElement",popoverProps:{placement:"top-end",offset:8,shift:!0,resize:!1,role:"dialog","aria-label":i.fitting},renderToggle:({isOpen:e,onToggle:t})=>(0,n.createElement)(o.Button,{className:"mtflpp-zoom-toggle",variant:"secondary",size:"compact",label:u,showTooltip:!0,"aria-label":`${i.fitting}: ${u}`,"aria-haspopup":"dialog","aria-expanded":e,onClick:t,"data-action":"zoom"},(0,n.createElement)("span",{className:"mtflpp-zoom-value"},u),s.chevron),renderContent:()=>(0,n.createElement)("div",{className:"mtflpp-zoom-content"},(0,n.createElement)(o.RadioControl,{label:i.zoomMode,selected:e,options:[...Object.entries(l).map(([e,t])=>({value:e,label:t,description:c[e]})),{value:"custom",label:i.fixedZoom,description:i.fixedZoomHelp}],onFocus(e){if(!b)return;b=!1;const t=e.currentTarget.closest(".mtflpp-zoom-content")?.querySelector('.mtflpp-custom-zoom input[type="number"]');t?.focus({preventScroll:!0});const n=t?.closest(".components-popover__content");if(n){const e=t.getBoundingClientRect(),o=n.getBoundingClientRect();n.scrollTop+=Math.min(0,e.top-o.top)+Math.max(0,e.bottom-o.bottom)}},onChange(e){b=!1,"custom"!==e?a.fit(e):a.zoom(t)}}),"custom"===e&&(0,n.createElement)("div",{className:"mtflpp-custom-zoom",onKeyDown(e){if("Enter"!==e.key)return;e.preventDefault();const t=Number(e.target.value);!1!==e.target.validity?.valid&&Number.isInteger(t)&&t>=10&&t<=400&&O()}},(0,n.createElement)(o.RangeControl,{label:i.customZoom,min:10,max:400,step:1,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:t,help:i.customZoomHelp,withInputField:!0,onChange(e){Number.isInteger(e)&&e>=10&&e<=400&&a.zoom(e)}})),(0,n.createElement)("div",{className:"mtflpp-dpr-note",role:"group","aria-label":i.displayInformation},(0,n.createElement)("span",{className:"mtflpp-dpr-value"},`${i.displayDpr}: ${Number(r.toFixed(2))}`),(0,n.createElement)("span",{className:"mtflpp-pixel-note"},i.pixelZoomHelp)))})}(),f),(0,n.createPortal)(function(){const{empty:e}=g;return e?(0,n.createElement)(o.Placeholder,{className:"mtflpp-placeholder","data-empty-icon":e.busy?void 0:e.icon,icon:e.busy?(0,n.createElement)(o.Spinner):s[e.icon],label:(0,n.createElement)("h3",{className:"mtflpp-empty-title",tabIndex:-1,"data-action":"empty-title"},e.heading),instructions:e.description},e.retry&&(0,n.createElement)(o.Button,{key:"retry",variant:"primary",disabled:e.disabled,onClick:a.retry,"data-action":"retry"},e.action),e.close&&(0,n.createElement)(o.Button,{key:"close",variant:"secondary",onClick:a.close,"data-action":"close"},i.close),e.note&&(0,n.createElement)("p",{className:"mtflpp-empty-note"},e.note)):null}(),m),(0,n.createPortal)(function(){if(!g.notice)return null;if(x){const e=(0,n.createElement)(r.InlineNotices,{context:C,className:"mtflpp-inline-notices"});return M?(0,n.createElement)(M,{cornerRadius:"none"},e):e}const{message:e,...t}=E();return(0,n.createElement)(o.Notice,{...t,onRemove:a.dismissNotice,spokenMessage:"",politeness:"polite"},e)}(),h),e?(0,n.createPortal)((0,n.createElement)(o.Popover.Slot),t.ownerDocument.body):(0,n.createElement)(o.Popover.Slot))}function V(){g&&w&&(function(){if(!x)return;if(!g.notice)return void P();const e=JSON.stringify(g.notice);if(S===e)return;const{message:t,status:n,...o}=E();x.createNotice(n,t,{...o,id:k,context:C,speak:!1,onDismiss:a.dismissNotice}),S=e}(),(0,n.flushSync)(()=>w.render((0,n.createElement)(T))))}function O(){(v||y)&&(v=!1,y=!1,V())}function H(e){g?.inPip&&"mode"===e&&(e="actions"),t.querySelector(`[data-action="${e}"]`)?.focus({preventScroll:!0})}return{update(e){const n=y&&!e.hasPreview&&t.ownerDocument.activeElement?.closest(".mtflpp-zoom-popover");e.hasPreview||(y=!1),g=e,V(),n&&H("empty-title")},closeMenu:O,focus:H,beforeMove(){v=!1,y=!1,w?.unmount(),w=null,P()},remount(){w=(0,n.createRoot)(l),V()}}}(O,i,{refresh:()=>{ue.canRefresh&&h()},retry:()=>{"handover"!==ue.state&&(se||ue.canRetry&&["error","conflict"].includes(ue.state))&&g(se)},dismissNotice:()=>{ye(),Z.textContent=ue.text,I.focus("actions")},mode:Le,close:function(){I.closeMenu(),xe(!1),m(),u||E()?H.focus():d.focus()},popOut:async function(){if(Q||U||x.fullscreenElement===O||!Ee())return;let e;I.closeMenu();const t=()=>{U===e&&(w(),J.beforeMove(),I.beforeMove(),x.body.append(O),O.classList.remove("mtflpp-pip"),U=null,I.remount(),ke(),J.afterMove(),Pe(),Q||(v(),K&&I.focus("mode")))};try{if(e=await b.documentPictureInPicture.requestWindow({width:640,height:440}),!K||Q)return void e.close();const n=b.getComputedStyle(O);e.document.documentElement.lang=x.documentElement.lang,e.document.documentElement.dir=n.direction;for(const t of["--wp-admin-theme-color","--wp-admin-theme-color-darker-10","--wp-admin-border-width-focus"]){const o=n.getPropertyValue(t);o&&e.document.documentElement.style.setProperty(t,o)}const o=x.querySelectorAll(['link[rel="stylesheet"][href*="/load-styles.php"]',"#wp-theme-css","#wp-theme-inline-css","#wp-components-css","#wp-components-inline-css","style[data-emotion]","style[data-wp-hash]","#meet-the-frontend-live-preview-panel-css","#meet-the-frontend-live-preview-panel-inline-css"].join(", "));for(const t of o){const n=t.cloneNode(!0);"STYLE"===t.tagName&&t.sheet&&(n.textContent=Array.from(t.sheet.cssRules,e=>e.cssText).join("\n")),n.addEventListener("load",J.layout,{once:!0}),e.document.head.append(n)}e.document.title=_.textContent,e.document.body.className="mtflpp-pip-document",e.addEventListener("resize",J.layout),e.addEventListener("pagehide",t,{once:!0}),U=e,w(),J.beforeMove(),I.beforeMove(),O.classList.add("mtflpp-pip"),e.document.body.append(O),I.remount(),J.afterMove(),Pe(),ye(),I.focus("mode"),v()}catch{if(e&&(t(),e.close()),Q)return;I.focus("actions"),ve(i.pipFailed)}},fullscreen:async function(){if(!Q&&!U&&x.fullscreenEnabled){I.closeMenu();try{if(await O.requestFullscreen(),Q)return void Oe();ye(),I.focus("mode")}catch{if(Q)return;I.focus("actions"),ve(i.fullscreenFailed)}}},dock:e=>Se(e),reset:()=>Se("right",!0),follow:function(){T=!T,k.set(M,"scrollToChanges",T),Pe(),T&&ue.canRefresh&&h(!1)},rememberVisibility:function(){P=!P,k.set(M,"rememberVisibility",P),P&&xe(K),Pe()},rememberPosition:function(){L=!L,k.set(M,"rememberPosition",L),L?Me():(k.set(M,"position",ne),k.set(M,"layout",void 0)),Pe()},device(e){const t=J.device;if(e===t&&"desktop"===e)return;let n=!1;if(K&&T&&y){const{fit:e,customZoom:t,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:a}=J;n=!!y({canvas:B,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:a,canFollow:()=>J.fit===e&&J.customZoom===t})}const o={animate:K&&!n,keepPan:n};e===t?(J.rotate(o),k.set(M,`${e}Orientation`,J.orientation)):(J.select(e,o),J.device!==t&&k.set(M,"viewport",J.device)),Pe()},fit(e){const t=J.fit;J.setFit(e),J.fit!==t&&k.set(M,"fitMode",J.fit),Pe()},zoom(e){const t=J.fit,n=J.customZoom;J.setZoom(e),J.customZoom!==n&&k.set(M,"customZoom",J.customZoom),J.fit!==t&&k.set(M,"fitMode",J.fit),Pe()}}),be(i.loading,"loading",{canRetry:!1}),ke(),Ve(),u&&(u.disabled=!1),{stage:F,canvasTarget:J.canvasTarget,get visible(){return K},get followChanges(){return T},openFromLauncher:He,setSuspended(e){Q!==e&&(Q=e,Ve(),e?Oe():ke())},setVisible(e){e||(I.closeMenu(),le="",Pe(),J.layout()),K=e,ke(),Ve()},report:be,setTitle:fe,clearPreview(){F.replaceChildren();const e=["ready","stale","loading"].includes(ue.state);be(e?i.loading:ue.text,e?"loading":ue.state,{...ue,hasPreview:!1,hasHtmlPreview:!1,redirectDestination:void 0,canRefresh:!1,canRetry:!e&&ue.canRetry})},returnToEditor:Oe}}function u(e=[]){const t=Array.isArray(e)?[...e]:[],n=new WeakMap;return{capture(e,o){try{if(n.has(e))return;const r=function(e){try{const t=e.querySelector('meta[name="meet-the-frontend-live-preview-panel"]'),n=t?.getAttribute("data-mtflpp-source");if(!n)return null;const o=JSON.parse(n);if("string"!=typeof o)return null;const r=(new DOMParser).parseFromString(o,"text/html");return r.querySelector('meta[name="meet-the-frontend-live-preview-panel"]')?.content===t.content?r:null}catch{return null}}(e);n.set(e,{source:r?M(r,e,t):null,dom:M(e,e,t),values:o&&structuredClone(o)})}catch{}},findChange(e,t){try{const o=n.get(e),r=n.get(t);if(!o||!r)return null;const i=function(e,t){if(!e||!t)return[];const n=[];for(const o of new Set([...Object.keys(e),...Object.keys(t)])){const r=Object.hasOwn(e,o)?e[o]:{type:t[o]?.type,value:""},i=Object.hasOwn(t,o)?t[o]:{type:e[o]?.type,value:""};if(r.type!==i.type||!["text","html"].includes(i.type)||"string"!=typeof r.value||"string"!=typeof i.value||r.value===i.value)continue;let a,s;try{a="html"===r.type?(new DOMParser).parseFromString(r.value,"text/html"):null,s="html"===i.type?(new DOMParser).parseFromString(i.value,"text/html"):null}catch{continue}const l=a?M(a,a,[],a.body):null,c=s?M(s,s,[],s.body):null,u=a?j(l):r.value,d=s?j(c):i.value,f=E(u),p=E(d);if(f!==p&&n.push({...z(f,p),type:"text",fullBefore:f,fullAfter:p}),!a){const e=H(u,d);e&&n.push(e);continue}if(l&&c&&(f===p||P(u,d)))for(const e of S(l,c)){if(e.spacing){const t=O(e);t&&n.push(t);continue}if(f===p)if("attributes"===e.kind){const t=new Map(e.before.attributes),o=new Map(e.after.attributes);for(const e of new Set([...t.keys(),...o.keys()])){const r=t.get(e)??"",i=o.get(e)??"";JSON.stringify(r)!==JSON.stringify(i)&&n.push({type:"attribute",name:e,before:"string"==typeof r?r:JSON.stringify(r),after:"string"==typeof i?i:JSON.stringify(i)})}}else if("content"===e.kind){const t=E(j(e.before)),o=E(j(e.after));t===o&&Y(e.before,e.after,j)&&n.push({type:"markup",before:t,after:o,oldTag:e.before.tag,newTag:e.after.tag}),(e.before.media||[]).forEach((t,o)=>{const r=e.after.media?.[o];t&&r&&t!==r&&n.push({type:"media",before:t,after:r})})}}}return n}(o.values,r.values),a=function(e,t){if(!e||!t)return!1;const n=(e,t)=>Object.entries(e).some(([e,n])=>["text","html","value","row-image"].includes(n?.type)&&(!Object.hasOwn(t,e)||n.type!==t[e]?.type||n.value!==t[e]?.value));return n(e,t)||n(t,e)}(o.values,r.values),s=!!o.source&&!!r.source,l=!!o.source!=!!r.source,c=function(e,t,n){if(!e||!t)return;const o=Object.entries(t).filter(([t,n])=>"row-order"===n?.type&&"row-order"===e[t]?.type&&e[t].value!==n.value);if(1!==o.length)return;const[[r,i]]=o,a=e[r];if(!i.moved||i.members!==a.members)return;const s=JSON.parse(a.value),l=JSON.parse(i.value),c=s.indexOf(i.moved),u=l.indexOf(i.moved);if(-1===c||-1===u||c===u||s.length!==l.length)return;if(s.splice(c,1),l.splice(u,1),!s.every((e,t)=>e===l[t]))return;const d=u-c,f={html:new Map,peerLabels:new Map},p=A(r,i.moved,s,e,t,f),m=function(e,t,n,o,r,i){if([n,...o].some(n=>!e?.[n]||!t?.[n]))return[];const a=new Set(e[n]),s=new Set,l=new Set,c=new Set;for(const[n,a]of[[e,r],[t,i]])for(const e of o.flatMap(e=>n[e])){const t=a[e];"row-image"===t?.type&&(c.add(t.value),l.add(t.alt))}for(const e of t[n]){const t=r[e],n=i[e];if(!a.has(e)||"row-image"!==t?.type||"row-image"!==n?.type||!/^[1-9]\d*$/.test(n.value)||t.value!==n.value||c.has(n.value))continue;const o=n.alt;o?.trim()&&t.alt===o&&!l.has(o)&&s.add(o)}return[...s]}(a.fieldsByRow,i.fieldsByRow,i.moved,s,e,t);let h;if(n&&!p.length&&$(a,i.moved,e,f.html)&&$(i,i.moved,t,f.html)){const n=s.slice(Math.min(c,u),Math.max(c,u));h=[];for(const o of n){const n=A(r,o,[...s.filter(e=>e!==o),i.moved],e,t,f);if(!n.length){h=void 0;break}h.push(n)}}return{offset:d,groups:p,images:m,boundaryGroups:h}}(o.values,r.values,s&&!a&&!R(o.values,r.values)),u=s?S(o.source,r.source,c,!0):[];if(c?.boundaryGroups?.length){const e=u.filter(e=>e.priority>0);if(1===e.length&&e[0].boundary)return function({before:e,after:t,index:n},o){for(const n of[e,t]){let e,t;for(const{node:r}of n){if(!r?.isConnected||e&&e.nextElementSibling!==r)return null;const{position:n,marginTop:i,marginBottom:a}=r.ownerDocument.defaultView.getComputedStyle(r);if(o&&r.closest(o)||!m(r)||!["static","relative"].includes(n)||r.closest("[hidden], details:not([open])")||!1===r.checkVisibility?.({opacityProperty:!0,contentVisibilityAuto:!0}))return null;const s=r.getBoundingClientRect();if(!s.height&&!(parseFloat(i)>0||parseFloat(a)>0))return null;if(t&&(t.bottom>s.top||Math.max(t.left,s.left)>=Math.min(t.right,s.right)))return null;e=r,t=s}}return t[n].node}(e[0].boundary,r.source?.excluded)}if(!l&&!a&&!c){const e=function(e,t){const n=function(e,t){if(!e||!t)return;const n=["row-order","gallery-order","order"],o=[...new Set([...Object.keys(e),...Object.keys(t)])].filter(o=>(n.includes(e[o]?.type)||n.includes(t[o]?.type))&&e[o]?.value!==t[o]?.value);if(1!==o.length)return;const r=e[o[0]],i=t[o[0]];if("gallery-order"!==r?.type||"gallery-order"!==i?.type)return;const a=JSON.parse(r.value),s=JSON.parse(i.value);if(new Set(a).size!==a.length||new Set(s).size!==s.length)return;const l=new Map(a.map((e,t)=>[e,t])),c=s.map(e=>l.get(e));return a.length&&s.length&&c.every(e=>void 0===e)?void 0:{oldCount:a.length,matches:c}}(e.values,t.values);if(!n)return;const o=e.source??e.dom,r=t.source??t.dom,i=function(e,t,{oldCount:n,matches:o}){const r=[];function i(e,t){return e.signature===t.signature&&e.presentation===t.presentation}function a(e,t){return i(e,t)&&e.rawText===t.rawText&&e.children.length===t.children.length&&e.children.every((e,n)=>a(e,t.children[n]))}function s(e,t){if(e.children.length!==n||t.children.length!==o.length||e.rawText!==t.rawText&&(e.text||t.text))return!1;const i=b(e),s=b(t);if(!i||!s)return!1;const l=i.map(x),c=s.map(x),u=new Set(l);return!(u.size!==l.length||new Set(c).size!==c.length||l.length===c.length&&l.every((e,t)=>e===c[t])||!o.every((n,o)=>void 0===n?!u.has(c[o]):l[n]===c[o]&&a(e.children[n],t.children[o]))||(r.push({before:e,after:t,original:i,current:s}),0))}return e&&t&&function e(t,n){return!!i(t,n)&&(!!s(t,n)||t.rawText===n.rawText&&t.children.length===n.children.length&&t.children.every((t,o)=>e(t,n.children[o])))}(e,t)?r:null}(o,r,n);if(!i?.length)return;const a=i.map(e=>e.after);let[s]=a;for(;s&&!a.every(e=>e===s||Q(s,e));)s=s.parent;const l=e=>["main","body","html"].includes(e.tag)||e.attributes.some(([e,t])=>"role"===e&&"main"===t);if(!s?.parent||l(s)||!function(e,t){if(1===t.length)return!0;const n=new Set(t);let o=0;return function e(t){return n.has(t)?(o++,!0):!!g(t)||!w(t)&&("hr"!==t.tag||0===o||o===n.size)&&t.parts.every(t=>"string"==typeof t?0===o||o===n.size||!t.trim():e(t))}(e)&&o===n.size}(s,a))return null;let c=s.node;if(!c?.isConnected||a.some(({node:e})=>!c.contains(e)||r.excluded&&e.closest(r.excluded)))return null;if(t.source&&(!y(e.dom,i,"before","original")||!y(t.dom,i,"after","current")))return null;const u=c.ownerDocument.defaultView;for(let e=s,t=e.parent;t?.parent&&!l(t)&&!t.children.some(t=>t!==e&&v(t));e=t,t=t.parent){const e=t.node;if(!e?.contains(c))continue;const{overflowX:n,overflowY:o}=u.getComputedStyle(e),r=/^(?:auto|scroll|hidden)$/;(e.scrollWidth>e.clientWidth&&r.test(n)||e.scrollHeight>e.clientHeight&&r.test(o))&&(c=e)}return!m(c)||c.closest("[hidden], details:not([open])")||r.excluded&&c.closest(r.excluded)?null:c}(o,r);if(void 0!==e)return e}const C=[...u.map(e=>({...e,source:!0})),...S(o.dom,r.dom,c)],k=new Map,T=function(e,t){const n=new Map,o=e=>j(e,n),r=[];for(const n of e){if(n.unresolved)for(const e of d(n,t,o))r.push(e);if("insert"===n.kind&&n.added.length>1){const e=n.added.map(e=>{const r={...n,after:e,added:[e]},i=K(r,t,o);return{...r,input:i}}).filter(e=>e.input);if(e.length){r.push(...e);continue}}const e=K(n,t,o);r.push({...n,input:e})}return r}(C,i).filter(e=>(e.priority>0||e.input)&&(!e.spacing||function({before:e,after:t},n,o){const r=L(e,n,o),i=L(t,n,o);return r&&i&&r.omitted===i.omitted&&P(r.text,i.text)}(e,k,r.dom?.excluded))),V=s&&a&&!T.some(e=>e.source);return function(e,t){if(!e.length)return null;const n=e.reduce((e,t)=>Math.max(e,t.input),0),o=e.filter(e=>e.input===n),r=o.reduce((e,t)=>Math.max(e,t.priority),0),i=o.filter(e=>e.priority===r);if(t.rowMove&&!n||i.some(e=>e.unresolved))return function(e,{rowMove:t,excluded:n,canFollowLiveReorder:o,canFollowLiveMove:r}){if(t){const t=e.find(e=>e.moved&&(e.source||r)),o=t?.moved.node;return o?.isConnected&&t.after.node?.contains(o)&&e.every(e=>e===t||t.source&&!e.source&&(e.moved||"reorder"===e.regionChange))?"contents"!==o.ownerDocument.defaultView.getComputedStyle(o).display?o:f(t.moved,e=>o.contains(e)&&(!n||!e.closest(n))&&m(e)):null}const i=e.find(e=>e.unresolved&&("replacement"===e.regionChange||"reorder"===e.regionChange&&(e.source||o))),a=i?.after.node;if(!a?.isConnected)return null;for(const t of e)if(t.unresolved){if(i.source&&!t.source&&"reorder"===t.regionChange)continue;if(!t.regionChange||t.after.node!==a)return null}else if(!("insert"===t.kind?t.added:[t.after]).every(e=>a.contains(e.node)))return null;return"contents"!==a.ownerDocument.defaultView.getComputedStyle(a).display?a:null}(i,t);const a=i.filter(e=>!e.input||e.directInput||!i.some(t=>t!==e&&e.matches?.length&&e.matches.every(e=>t.matches?.includes(e))&&Q(e.after,t.after))),s=new Map,l=a.filter(e=>{const t="delete"===e.kind&&(e.following[0]||e.preceding[0])||e.after,n=t?.node;if(!n)return!0;const o="delete"!==e.kind||e.following.length?e.kind:"delete-last",r=s.get(n)||new Set;return!r.has(o)&&(r.add(o),s.set(n,r),!0)});return n&&s.size>1?null:function(e){const t=new Set,n=new Set;for(const o of e){let e,r=!1;"delete"===o.kind?(r=!o.removed.some(h),e=r?o.after:o.following.find(h)||o.preceding.find(h)||o.following.find(p)||o.preceding.find(p)||o.after):e="insert"===o.kind?o.added.find(h)||o.added.find(p):o.after;const i=p(e);if(!i)continue;const a=h(e),s=a||i;(a&&!r?t:n).add(s)}const o=t.size?t:n;return 1===o.size?o.values().next().value:null}(l)}(T.filter(e=>e.source||e.input||!s&&!l||V&&("insert"===e.kind||"delete"===e.kind)),{rowMove:!!c,excluded:r.source?.excluded??r.dom?.excluded,canFollowLiveReorder:!s&&(a||R(o.values,r.values)),canFollowLiveMove:!s&&!l})}catch{return null}}}}function d(e,t,n){const o=[];for(const r of t){if(!r.after||"spacing"===r.type)continue;const t=U(e.oldRange,r.before,n,r,!0),i=U(e.newRange,r.after,n,r,!1);if(!t.length)continue;const a="markup"===r.type&&r.oldTag===r.newTag;if(a||!r.before||!(t.length<=U(e.newRange,r.before,n,r,!0).length||i.length<=U(e.oldRange,r.after,n,r,!1).length))for(const s of i)a&&!t.some(e=>Y(e,s,n))||o.push({...e,unresolved:!1,before:null,after:s,kind:"content",input:r.before&&r.after?2:1,priority:2,matches:[r]})}return o}function f(e,t){if(e?.node&&t(e.node))return e.node;for(const n of e?.children||[]){const e=f(n,t);if(e)return e}return null}function p(e){return f(e,()=>!0)}function m(e){return e.getClientRects().length&&"visible"===e.ownerDocument.defaultView.getComputedStyle(e).visibility}function h(e){return f(e,m)}function g(e){return/^(?:button|input|select|textarea)$/.test(e.tag)||e.attributes.some(([e,t])=>"role"===e&&"button"===t)}function w(e){return/^(?:img|video|audio|iframe|canvas|object|embed)$/.test(e.tag)||e.media?.some(Boolean)}function v(e){return!g(e)&&(e.text||w(e)||"hr"===e.tag||e.children.some(v))}function y(e,t,n,o){const r=new Map(t.map(e=>[e[n].node,e[o]]));return!(!e||r.has(null)||r.size!==t.length)&&(function e(t){const n=r.get(t.node);if(!n)return t.children.every(e);r.delete(t.node);const o=new Map,i=new Map;n.forEach((e,t)=>{e.marker&&o.set(e.marker,t),i.set(x(e),t)});const a=[],s=new Map;if(!function e(t,r=!1){if(r||=t.attributes.some(([e,t])=>"inert"===e||"aria-hidden"===e&&"true"===t),"img"!==t.tag)return t.children.every(t=>e(t,r));const l=o.get(t.marker)??i.get(x(t));return!(!n[l]||!t.media.slice(0,2).some((e,t)=>e&&e===n[l].media[t])||(a.push({index:l,cloneHidden:r}),s.set(l,(s.get(l)??0)+1),0))}(t))return!1;const l=a.filter(({index:e,cloneHidden:t})=>!t||1===s.get(e));return l.length===n.length&&l.every(({index:e},t)=>e===t)}(e)&&!r.size)}function b(e){const t=e.children.map(function e(t){return"img"===t.tag?[t]:t.children.flatMap(e)});return t.some(e=>1!==e.length||!e[0].media?.slice(0,2).some(Boolean))?null:t.map(([e])=>e)}function x(e){return JSON.stringify(e.media.slice(0,2))}function M(e,t,n,o=e.querySelector('main, [role="main"]')||e.querySelector("article")||e.body){if(!o)return null;const r=n.filter(e=>{if("string"!=typeof e||!e.trim())return!1;try{return o.matches(e),!0}catch{return!1}}).join(", "),i=new Map,a=new Map;if(e!==t)for(const e of t.querySelectorAll("[data-mtflpp-node]")){const t=e.getAttribute("data-mtflpp-node");a.set(t,a.has(t)?null:e)}for(const n of[o,...o.querySelectorAll("*")]){if(r&&n.closest(r))continue;const o=[...n.childNodes].filter(e=>3===e.nodeType).map(e=>e.textContent),s=E(o.join(" ")),l=["img","source","video","audio","iframe"].includes(n.localName)?["src","srcset","poster"].map(e=>n.getAttribute(`data-${e}`)||n.getAttribute(e)||""):[],c=n.style?.backgroundImage||n.getAttribute("data-bg")||"",u=n.getAttribute("data-mtflpp-node"),d=e===t?n:a.get(u)||null,f=C(n,d,JSON.stringify([n.localName,s,l,c]));"img"===n.localName&&(f.marker=u),f.text=s,f.rawText=o.join(""),f.media=[...l,c],f.parent=i.get(n.parentElement),i.set(n,f),f.parent?.children.push(f)}for(const[e,t]of i)t.parts=[...e.childNodes].map(e=>3===e.nodeType?e.textContent:i.get(e)).filter(e=>void 0!==e);let s=i.get(o);if(!s)return null;const l=s.node;for(let e=o.parentElement;e;e=e.parentElement){const t=C(e,l,e.localName);t.children=[s],t.parts=[s],s=t}return s.excluded=r,s}function C(e,t,n){const o=function(e){const t=[];for(const{name:n,value:o}of e.attributes){if("data-mtflpp-node"===n||n.startsWith("on")||/(?:^|-)(nonce|token)(?:-|$)/.test(n))continue;if(/^(?:data-)?(?:src|srcset|poster|sizes|bg)$/.test(n))continue;let r=o;"class"===n&&(r=[...e.classList].sort().join(" ")),"style"===n&&(r=[...e.style].sort().map(t=>[t,e.style.getPropertyValue(t),e.style.getPropertyPriority(t)])),("class"!==n&&"style"!==n||r.length)&&t.push([n,r])}return t.sort(([e],[t])=>e.localeCompare(t))}(e);return{node:t,tag:e.localName,signature:n,attributes:o,children:[],parts:[],presentation:JSON.stringify(o.filter(([e])=>!k(e))),references:JSON.stringify(o.filter(([e])=>k(e)))}}function k(e){return["id","for","headers","aria-controls","aria-labelledby","aria-describedby","aria-owns","aria-flowto","aria-activedescendant","aria-details","aria-errormessage"].includes(e)}function S(e,t,n,o=!1){const r=new Map,i=new Map,a=new Map,s=new Map,l=[];let c,u;function d(o,r,i,a=[]){const s=(e,t)=>e===t||Q(e,t);let l=!1;if(a.length){u??=[_(e,new Set(a)),_(t,new Set(a))];const n=(e,t,n)=>t.node?.isConnected&&e.node?.contains(t.node)&&"img"===t.node.localName&&(!n||!t.node.closest(n));for(const i of a){const a=u[0].get(i),c=u[1].get(i);if(a&&c){if(!s(o,a)||!s(r,c))return!1;l||=n(o,a,e.excluded)&&n(r,c,t.excluded)}}}if(!i.length)return l;if(!c){const o=new Set((n.boundaryGroups??[n.groups]).flat(2));c=[W(e,o),W(t,o)]}const[d,f]=c,p=new Map;for(const e of i.flat()){const t=d.get(e),n=f.get(e);if(t&&n){if(!s(o,t.entry)||!s(r,n.entry))return!1;p.set(e,t.substantive&&n.substantive)}}return l||i.some(e=>e.every(e=>p.has(e))&&e.some(e=>p.get(e)))}function f(e){const t=JSON.stringify(e);return r.has(t)||r.set(t,r.size+1),r.get(t)}function p(e){if(!e)return 0;const t=f([e.signature,e.children.map(p)]);return i.set(e,t),a.set(e,f([t,e.presentation,e.children.map(e=>a.get(e))])),s.set(e,f([t,e.presentation,e.references,e.children.map(e=>s.get(e))])),t}p(e),p(t);const m=e=>i.get(e);function h(e){const t=e.attributes.find(([e])=>"id"===e)?.[1];return t?`${e.tag} ${t}`:void 0}function g(e){if(!(e.children.length<2))return f(["collection",e.signature,e.children.map(m).sort((e,t)=>e-t)])}function w(e,t){const n=new Map;return e.forEach((e,o)=>{const r=t(e);void 0!==r&&n.set(r,n.has(r)?-1:o)}),n}return function e(t,r){t&&r&&(t.signature!==r.signature?l.push({kind:"content",before:t,after:r,priority:2}):t.rawText!==r.rawText&&l.push({kind:"content",before:t,after:r,priority:2,spacing:!0}),t.presentation===r.presentation&&t.references===r.references||l.push({kind:"attributes",before:t,after:r,priority:t.presentation!==r.presentation?1:0}),function(t,r,c,u){const f=u.parent&&c.parent&&u.tag===c.tag,p=w(t,m),v=w(r,m);let y,b,x,M;const C=new Set(t.flatMap(e=>[a.get(e),s.get(e)])),k=new Set(r.flatMap(e=>[a.get(e),s.get(e)]));function S(e,t,n){const o=n.get(e),r=n.get(t);return o===r||!k.has(o)&&!C.has(r)}function E(e,t){return i.get(e)===i.get(t)&&S(e,t,a)&&S(e,t,s)}function P(e,n,o,a,s,c,d){const m=t.slice(e,n),h=r.slice(o,a),g="replacement"===s&&f&&m.some(e=>!v.has(i.get(e)))&&h.some(e=>!p.has(i.get(e)))&&(!function(e,t){if(e.length<2||t.length<2)return!1;const n=e.filter(e=>e.children.length).length,o=t.filter(e=>e.children.length).length;if(!n&&!o||n>1&&o>1)return!0;const r=new Map;for(const{tag:e}of t)r.set(e,(r.get(e)||0)+1);let i=0;for(const{tag:t}of e){const e=r.get(t);if(e){if(2===++i)return!0;r.set(t,e-1)}}return!1}(m,h)||"form"===u.tag&&function(e,t){function n(e){const t=new Set;return e.every(function e(n){if(["input","select","textarea"].includes(n.tag)){const e=n.attributes.find(([e])=>"name"===e)?.[1],o=n.attributes.find(([e])=>"type"===e)?.[1]?.toLowerCase();return!(!e||"input"===n.tag&&"hidden"===o||(t.add(e),0))}let o=!1;for(const t of n.children)e(t)&&(o=!0);return o})?t:null}const o=n(e),r=n(t);return o&&r&&[...o].some(e=>!r.has(e))&&[...r].some(e=>!o.has(e))}(m,h)),w=f&&("reorder"===s||g)?s:void 0;l.push({kind:"region",after:u,priority:2,unresolved:!0,regionChange:w,oldRange:m,newRange:h,moved:c,boundary:d})}function L(e,n,o,r,i,a,s){const l=[];for(let c=e;c<n;c++){const e=s(t[c]),n=a.get(e);if(!(i.get(e)!==c||void 0===n||n<o||n>=r)){if(l.length&&n<=l[l.length-1][1])return null;l.push([c,n])}}return l}!function s(c,C,k,S){for(;c<C&&k<S&&E(t[c],r[k]);)e(t[c],r[k]),c++,k++;for(;c<C&&k<S&&E(t[C-1],r[S-1]);)C--,S--,e(t[C],r[S]);if(c===C&&k===S)return;if(c===C||k===S){const e=k===S,n=e?t.slice(c,C):r.slice(k,S),o=e?[r[k-1],r[k]]:[t[c-1],t[c]];return void(n.some(e=>o.some(t=>t&&i.get(t)===i.get(e)))?P(c,C,k,S):e?l.push({kind:"delete",after:u,removed:n,priority:2,following:r.slice(k),preceding:r.slice(0,k).reverse()}):l.push({kind:"insert",after:n[0],added:n,priority:2}))}if(C-c===1&&S-k===1)return void e(t[c],r[k]);const T=function(e,i,a,s){if(!(n?.groups.length||o&&(n?.boundaryGroups||n?.images.length)))return;const l=Math.abs(n.offset)+1;if(i-e!==l||s-a!==l)return;const c=n.offset>0,u=c?0:l-1,d=c?l-1:0,f=t.slice(e,i),p=r.slice(a,s),m=c?l-1:1,h=f.map((e,t)=>[e,p[(t+m)%l]]);return{before:f,after:p,from:u,to:d,pairs:h}}(c,C,k,S),V=T&&function(e){const t=o?n.images:[];if(!n.groups.length&&!t.length)return;const[r,i]=e.pairs[e.from],a=m(r);return-1!==p.get(a)&&-1!==v.get(a)&&e.pairs.every(([e,t])=>E(e,t))&&d(r,i,n.groups,t)?i:void 0}(T),O=T&&function(e){if(o&&n.boundaryGroups&&N(e.before[e.from])&&e.pairs.every(([e,t])=>a.get(e)===a.get(t)))return e.pairs.filter((t,n)=>n!==e.from).every(([e,t],o)=>d(e,t,n.boundaryGroups[o]))?{before:e.before,after:e.after,index:e.to||1}:void 0}(T);if(V||O||f&&function(e,n,o,a){const s=n-e;if(s<2||s!==a-o)return!1;const l=new Map;let c=!1;for(let n=0;n<s;n++){const a=i.get(t[e+n]),s=i.get(r[o+n]);c||=a!==s,l.set(a,(l.get(a)||0)+1),l.set(s,(l.get(s)||0)-1)}return c&&[...l.values()].every(e=>0===e)}(c,C,k,S)){if(O)for(const[t,n]of T.pairs)e(t,n);return void P(c,C,k,S,"reorder",V,O)}let H=L(c,C,k,S,p,v,m);if(0===H?.length&&(y??=w(t,h),b??=w(r,h),H=L(c,C,k,S,y,b,h)),0===H?.length&&(x??=w(t,g),M??=w(r,g),H=L(c,C,k,S,x,M,g)),H?.length)for(const[n,o]of[...H,[C,S]])s(c,n,k,o),n<C&&e(t[n],r[o]),c=n+1,k=o+1;else P(c,C,k,S,H?"replacement":void 0)}(0,t.length,0,r.length)}(t.children,r.children,t,r))}(e,t),l}function E(e){return e.replace(/\s+/g," ").trim()}function P(e,t){return e!==t&&e.replace(/\s/g,"")===t.replace(/\s/g,"")}function L(e,t,n){for(;e.node?.isConnected&&e.parent?.node;){const{display:t}=e.node.ownerDocument.defaultView.getComputedStyle(e.node);if("inline"!==t&&"contents"!==t)break;e=e.parent}if(!t.has(e)){const{node:o}=e,r=[],i=o?.isConnected&&T(o,n,r)===V(e)&&h(e)?o.innerText:void 0;t.set(e,"string"==typeof i?{text:i,omitted:JSON.stringify(r)}:void 0)}return t.get(e)}function T(e,t,n){return t&&e.querySelector(t)?[...e.childNodes].map(e=>3===e.nodeType?e.textContent:1!==e.nodeType?"":e.matches(t)?(n.push(e.textContent),""):T(e,t,n)).join(""):e.textContent}function V(e){return e.parts.map(e=>"string"==typeof e?e:V(e)).join("")}function O({before:e,after:t}){return H(e.rawText,t.rawText)||H(V(e),V(t))}function H(e,t){if(!/\S/.test(e)||!P(e,t))return;const n=e.match(/\s+|\S+/g),o=t.match(/\s+|\S+/g);let r=0,i=0;for(;r<Math.min(n.length,o.length)&&n[r]===o[r];)r++;for(;i<Math.min(n.length,o.length)-r&&n.at(-1-i)===o.at(-1-i);)i++;const a=Math.max(0,r-1),s=Math.max(0,i-1);return{type:"spacing",before:n.slice(a,n.length-s).join(""),after:o.slice(a,o.length-s).join("")}}function j(e,t=new Map){return e?(t.has(e)||t.set(e,(e.parts||[]).map(e=>{if("string"==typeof e)return e;const n=j(e,t);return/^(?:p|div|section|article|main|aside|header|footer|nav|h[1-6]|li|[ou]l|d[ldt]|blockquote|pre|table|tr|t[dh]|caption|figure|figcaption|br|hr)$/.test(e.tag)?` ${n} `:n}).join("")),t.get(e)):""}function R(e,t){return!!e&&!!t&&Object.entries(t).some(([t,n])=>{if(!["order","gallery-order"].includes(n?.type)||!Object.hasOwn(e,t))return!1;const o=e[t];return o?.type===n.type&&o.members===n.members&&o.value!==n.value})}function $(e,t,n,o){return e.fieldsByRow?.[t]?.every(e=>""===F(n[e],o)?.label)}function N(e){return!e.text&&!e.media?.some(Boolean)&&!/^(?:a|button|input|select|textarea|form|details|img|video|audio|iframe|canvas|svg|object|embed)$/.test(e.tag)&&e.children.every(N)}function _(e,t){const n=new Map;return e&&function e(o){if("img"===o.tag){const e=o.attributes.find(([e])=>"alt"===e)?.[1];t.has(e)&&n.set(e,n.has(e)?null:o)}o.children.forEach(e)}(e),n}function A(e,t,n,o,r,{html:i,peerLabels:a}){const{fieldsByRow:s}=r[e],l=o[e].fieldsByRow;if([t,...n].some(e=>!l?.[e]||!s?.[e]))return[];const c=[],u=new Set(l[t]);let d;function f(e,t){if(a.has(e))return a.get(e);const n=new Set;function o(e,t){n.add(E(j(e,t)));for(const n of e.children)o(n,t)}for(const r of e){if("row-image"===t[r]?.type)continue;const e=B(t[r],i);if(!e.length)return null;for(const t of e)t.entry?o(t.entry,t.cache):n.add(t.label)}return a.set(e,n),n}function p(e,t){return d??=n.flatMap(e=>[f(l[e],o),f(s[e],r)]),d.some(n=>!n||n.has(e)||t.length&&t.every(e=>n.has(e)))}for(const e of s[t]){const t=r[e],n=o[e];if(u.has(e)&&t&&n?.type===t.type&&n?.value===t.value)for(const{entry:e,cache:o,label:r}of B(t,i,n.formatted===t.formatted)){if(!r)continue;if(!e){p(r,[])||c.push([r]);continue}const t=D(e,o).map(e=>E(j(e,o))),n=W(e,new Set([r,...t]),o);n.get(r)?.substantive&&!p(r,t.join(" ")===r?t:[])&&c.push([r]);const i=[...new Set(t.filter(e=>n.has(e)))];i.length>1&&i.some(e=>n.get(e).substantive)&&!p(r,i)&&c.push(i)}}return c}function B(e,t,n=!0){const o=F(e,t);if(!o)return[];const r=n&&"html"===e.type&&"string"==typeof e.formatted?F({type:"html",value:e.formatted},t):null;return r?[o,r]:[o]}function F(e,t){if("string"==typeof e?.value){if("text"===e.type)return{label:E(e.value)};if("html"===e.type){if(!t.has(e.value))try{const n=(new DOMParser).parseFromString(e.value,"text/html"),o=M(n,n,[],n.body),r=new Map;t.set(e.value,{entry:o,cache:r,label:E(j(o,r))})}catch{t.set(e.value,null)}return t.get(e.value)}}}function D(e,t){const n=e.children.flatMap(e=>D(e,t));return n.length||!/^(?:p|h[1-6]|li|d[dt]|blockquote|pre|figcaption)$/.test(e.tag)?n:E(j(e,t))?[e]:[]}function q(e,t,n){let o;(e.text===t||/[\p{L}\p{N}]/u.test(e.text||""))&&(o=function(e,t){let n="content";for(let o=e;o;o=o.parent){const r=o.attributes.find(([e])=>"role"===e)?.[1]??"";if("button"===o.tag||/(?:^|\s)button(?:\s|$)/.test(r))return;if("a"!==o.tag&&!/(?:^|\s)link(?:\s|$)/.test(r))continue;const i=D(o,t);if(i.length<2||!i.some(e=>/^h[1-6]$/.test(e.tag)))return;const a=i.find(t=>t===e||Q(t,e));if(!a)return;/^h[1-6]$/.test(a.tag)||(n="support")}return n}(e,n));for(const r of e.children){if("content"===o)break;o=q(r,t,n)||o}return o}function W(e,t,n=new Map){const o=new Map;e&&function e(r){const i=E(j(r,n));if(t.has(i)){const e=o.get(i);o.set(i,void 0===e||e&&Q(e,r)?r:null)}r.children.forEach(e)}(e);const r=new Map;for(const[e,t]of o){const o=t&&q(t,e,n);o&&r.set(e,{entry:t,substantive:"content"===o})}return r}function z(e,t){let n=0,o=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;for(;o<e.length-n&&o<t.length-n&&e[e.length-o-1]===t[t.length-o-1];)o++;let r=e.length-o,i=t.length-o;for(;n>0&&/\S/.test(e[n-1]);)n--;if(r>n&&/\S/.test(e[r-1]))for(;r<e.length&&/\S/.test(e[r]);)r++;if(i>n&&/\S/.test(t[i-1]))for(;i<t.length&&/\S/.test(t[i]);)i++;return{before:e.slice(n,r).trim(),after:t.slice(n,i).trim()}}function Z(e,t){return t?I(e,t):""===E(e)}function I(e,t){return J(e,t,1)>0}function J(e,t,n=1/0){if(!t)return 0;let o=0,r=(e=E(e)).indexOf(t);for(;-1!==r;){const i=r+t.length;if(G(e,r)&&G(e,i)&&++o===n)break;r=e.indexOf(t,r+1)}return o}function G(e,t){return!/[\p{L}\p{N}_]$/u.test(e.slice(Math.max(0,t-2),t))||!/^[\p{L}\p{N}_]/u.test(e.slice(t,t+2))}function X(e,t,n,o=!1){const r=E(e),i=E(t);if(r===i)return!1;if(r===n.before&&i===n.after||r===n.fullBefore&&i===n.fullAfter)return!0;if(o){const e=z(r,i);if(e.before===n.before&&e.after===n.after)return!0;if(function(e,t,n,o){if(!n||!o||e.length-n.length!==t.length-o.length)return!1;for(let r=e.indexOf(n);-1!==r;r=e.indexOf(n,r+1))if(t.startsWith(o,r)&&G(e,r)&&G(t,r)&&G(e,r+n.length)&&G(t,r+o.length)&&e.slice(0,r)===t.slice(0,r)&&e.slice(r+n.length)===t.slice(r+o.length))return!0;return!1}(r,i,n.fullBefore,n.fullAfter))return!0}return(n.before?J(r,n.before)>J(i,n.before):!r)&&(n.after?J(i,n.after)>J(r,n.after):!i)}function Y(e,t,n){return e.tag!==t.tag||(e.children.length||t.children.length)&&e.text!==t.text&&E(n(e))===E(n(t))}function U(e=[],t,n,o,r){return e.flatMap(e=>{const i=U(e.children,t,n,o,r);let a;return a="media"===o.type?e.media?.includes(t):"attribute"===o.type?e.attributes.some(([e,n])=>e===o.name&&I("string"==typeof n?n:JSON.stringify(n),t)):("markup"!==o.type||e.tag===(r?o.oldTag:o.newTag))&&Z(n(e),t),"text"===o.type&&i.length?i:[...a?[e]:[],...i]})}function K(e,t,n){if(e.unresolved)return 0;if(e.matches=[],e.spacing){const n=t.filter(e=>"spacing"===e.type),o=n.length&&O(e);return e.matches=n.filter(e=>o?.before===e.before&&o?.after===e.after),e.matches.length?2:0}let o=0;for(const r of t){if("spacing"===r.type)continue;let t=0;if("attributes"===e.kind){if(!["text","attribute"].includes(r.type))continue;const n=new Map(e.before.attributes),o=new Map(e.after.attributes);for(const e of new Set([...n.keys(),...o.keys()])){if("attribute"===r.type&&e!==r.name)continue;const i=n.get(e),a=o.get(e);JSON.stringify(i)!==JSON.stringify(a)&&(X("string"==typeof i?i:JSON.stringify(i)||"","string"==typeof a?a:JSON.stringify(a)||"",r)&&(t="attribute"===r.type||r.before&&r.after?2:1))}}else if("insert"===e.kind)!r.before&&e.added.some(e=>I(n(e),r.after))&&(t=Math.max(t,1));else if("delete"===e.kind)!r.after&&e.removed.some(e=>I(n(e),r.before))&&(t=Math.max(t,1));else if("media"===r.type)(e.before?.media||[]).some((t,n)=>t===r.before&&e.after?.media?.[n]===r.after)&&(t=2);else if("markup"===r.type)e.before?.tag===r.oldTag&&e.after?.tag===r.newTag&&Y(e.before,e.after,n)&&Z(n(e.before),r.before)&&Z(n(e.after),r.after)&&(t=r.before&&r.after?2:1);else if("text"===r.type){const o=!(!r.before||!r.after),i=o&&X(e.before?.text||"",e.after?.text||"",r,!0);(i||X(n(e.before),n(e.after),r,o))&&(t=o?2:1,i&&(e.directInput=!0))}t&&e.matches.push(r),o=Math.max(o,t)}return o}function Q(e,t){return!!e?.children.some(e=>e===t||e.node&&e.node===t?.node||Q(e,t))}const ee=new Set(["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","PageDown","PageUp","Home","End"," "]);function te(e,t){let n;for(const o of e?.rects??[]){const e=t(o);if(e.visible)return e;(!n||e.distance<n.distance)&&(n=e)}return n}function ne(e){return new Promise(t=>{const n=()=>{e.clearTimeout(o),e.cancelAnimationFrame(r),t()},o=e.setTimeout(n,100);let r=e.requestAnimationFrame(()=>{r=e.requestAnimationFrame(n)})})}function oe(e,t=!1){if(!ue(e,{visibilityProperty:!0,opacityProperty:!0}))return;const{left:n,right:o,top:r,bottom:i,width:a,height:s}=e.getBoundingClientRect();if(!(t||a&&s))return;const l=e.ownerDocument,{documentElement:c,body:u,defaultView:d}=l,f={left:n,right:a?o:n+1,top:r,bottom:s?i:r+1},p={...f},m={x:f.right-f.left,y:f.bottom-f.top},h="visible"===d.getComputedStyle(c).overflow,g=d.getComputedStyle(e);for(let n=e;n&&n!==c;){const o=n===e?g:d.getComputedStyle(n),{position:r,display:i,overflowX:a,overflowY:s}=o;if(n!==e&&(n!==u||!h)&&"inline"!==i&&("visible"!==a||"visible"!==s)&&n.offsetWidth&&n.offsetHeight){const{bounds:e,scaleX:r,scaleY:i}=ce(n,o);for(const[l,c,u,d,h]of[["x",a,"left","right",r],["y",s,"top","bottom",i]]){if("visible"===c)continue;const r="clip"===c?[0,0]:le(n,o,l,h),i=t&&"hidden"===c,a="y"===l==("horizontal-tb"===o.writingMode);if(i&&r.some(e=>e)&&(a||f[u]<e[u]||f[d]>e[d]||re(o,g,l)))return{boundary:n};if(!se(f,p,e,u,d,i?[0,0]:r))return{boundary:n};m[l]=Math.min(m[l],p[d]-p[u])}}n="absolute"===r||"fixed"===r?n.offsetParent:n.parentElement}return{clipped:f,extent:m}}function re(e,t,n){const o=e=>e&&"auto"!==e&&0!==parseFloat(e);return("x"===n?["Left","Right"]:["Top","Bottom"]).some(n=>o(e[`scrollPadding${n}`])||o(t[`scrollMargin${n}`]))}function ie(e,t,n=!1){const o=oe(e,n);if(!o?.clipped)return;const{clipped:r,extent:i}=o,{ownerDocument:a}=e,s=a.documentElement;if(r.left=Math.max(s.clientLeft,r.left),r.right=Math.min(s.clientLeft+s.clientWidth,r.right),r.top=Math.max(0,r.top),r.bottom=Math.min(s.clientHeight,r.bottom),r.right<=r.left)return{rects:[]};const l=t?.({...r,top:0,bottom:s.clientHeight}),c=l?.visibleCenterX??(r.left+r.right)/2,u=ge(e,c);if(r.bottom<=r.top)return{rects:[],header:u?.bottom};const d={rects:[r],inViewport:!0,extent:i};if(!u)return d;const f={left:Math.max(r.left,u.left),right:Math.min(r.right,u.right),top:Math.max(r.top,u.top),bottom:Math.min(r.bottom,u.bottom)};if(!ae(f)||!u.node.contains(a.elementFromPoint(c,(f.top+f.bottom)/2)))return d;const p=[{...r,top:f.bottom},{...r,bottom:f.top},{...f,left:r.left,right:f.left},{...f,left:f.right,right:r.right}].filter(ae);return!p.length&&u.bottom>=s.clientHeight&&u.top<=0?void 0:{rects:p,inViewport:!0,extent:i,header:u.bottom}}function ae({left:e,right:t,top:n,bottom:o}){return t>e&&o>n}function se(e,t,n,o,r,[i,a]){return e[o]=Math.max(e[o],n[o]),e[r]=Math.min(e[r],n[r]),t[o]=Math.max(n[o],t[o]+i),t[r]=Math.min(n[r],t[r]+a),t[r]>t[o]}function le(e,t,n,o){const r="x"===n,i=r?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight;if(i<=0)return[0,0];const a=r?e.scrollLeft:e.scrollTop,s=t.display.endsWith("flex")&&t.flexDirection===(r?"row-reverse":"column-reverse"),l=(r&&"rtl"===t.direction)!==s;let c=l?-i:0,u=l?0:i;return("horizontal-tb"!==t.writingMode||a<c||a>u)&&(c=-i,u=i),[(a-u)*o,(a-c)*o]}function ce(e,t){const n=e.getBoundingClientRect(),o=n.width/e.offsetWidth,r=n.height/e.offsetHeight,i=n.left+e.clientLeft*o,a=n.top+e.clientTop*r,s={left:i,top:a,right:i+e.clientWidth*o,bottom:a+e.clientHeight*r},l=t.overflowClipMargin;if("clip"!==t.overflowX&&"clip"!==t.overflowY||!l||"0px"===l)return{bounds:s,scaleX:o,scaleY:r};const c=l.split(" ").map(parseFloat).find(Number.isFinite)??0,u=l.includes("border-box")?n:s,d=l.includes("content-box");return{scaleX:o,scaleY:r,bounds:{left:u.left+((d?parseFloat(t.paddingLeft):0)-c)*o,right:u.right-((d?parseFloat(t.paddingRight):0)-c)*o,top:u.top+((d?parseFloat(t.paddingTop):0)-c)*r,bottom:u.bottom-((d?parseFloat(t.paddingBottom):0)-c)*r}}}function ue(e,t={visibilityProperty:!0}){return!!e?.isConnected&&!!e.getClientRects().length&&(!e.checkVisibility||e.checkVisibility(t))&&"visible"===e.ownerDocument.defaultView.getComputedStyle(e).visibility}function de(e){return e.matchMedia("(prefers-reduced-motion: reduce)").matches?"instant":"smooth"}function fe(e,{behavior:t,header:n=he(e),nearest:o=!1}={}){const r=e.ownerDocument,i=r.defaultView,a=t??de(i);if(o&&!n)return void e.scrollIntoView({behavior:a,block:"nearest",inline:"nearest"});const s=i.getComputedStyle(e).scrollMarginTop,l=r.documentElement,c=l.clientHeight,u=i.getComputedStyle(l),d=me(u.scrollPaddingTop,c),f=me(u.scrollPaddingBottom,c);let p,m;try{let t=o?"nearest":"start";if(o){const e=n-parseFloat(s);null!==d&&e>d&&(p=l.getAttribute("style"),l.style.setProperty("scroll-padding-top",`${e}px`,"important"))}else{const t=n>0&&null!==d?`max(${s}, ${n-d}px)`:s;m=e.getAttribute("style"),e.style.setProperty("scroll-margin-top",`calc(${t} + 1lh)`,"important")}if(!o&&null!==d&&null!==f){const n=i.getComputedStyle(e),o=c-d-f-parseFloat(n.scrollMarginTop)-parseFloat(n.scrollMarginBottom),r=o-e.getBoundingClientRect().height;if(r>=0&&(t="center"),r>0&&"horizontal-tb"===u.writingMode){const e=Math.min(o/3,r);p=l.getAttribute("style"),l.style.setProperty("scroll-padding-bottom",`${f+e}px`,"important")}}e.scrollIntoView({behavior:a,block:t,inline:"nearest"})}finally{void 0!==p&&pe(l,p),void 0!==m&&pe(e,m)}}function pe(e,t){e.setAttribute("style",t??""),null===t&&e.removeAttribute("style")}function me(e,t){if("auto"===e)return 0;const n=parseFloat(e);return Number.isFinite(n)?n*(e.endsWith("%")?t/100:1):null}function he(e){const t=e.getBoundingClientRect();return ge(e,t.left+t.width/2)?.bottom??0}function ge(e,t){const n=e.ownerDocument;for(let o=n.elementFromPoint(t,1);o&&!o.contains(e);o=o.parentElement){const e=n.defaultView.getComputedStyle(o);if("fixed"!==e.position&&"sticky"!==e.position)continue;if("0"===e.opacity||!ue(o,{visibilityProperty:!0,opacityProperty:!0}))continue;const{left:t,right:r,top:i,bottom:a}=o.getBoundingClientRect();if("fixed"===e.position||i<=parseFloat(e.top)+1)return{node:o,left:t,right:r,top:i,bottom:a}}}function we(e,t,{inlineLauncher:n,nativeLauncher:o}={}){const r=e.strings,i=e.termId??e.postId,a=window,s=function(){let e,t=0,n=0;return{remember(e){try{e&&(t=e.defaultView.scrollY)}catch{}},async restore(e,o,r=()=>!0,i){const a=++n;try{const s=e.defaultView;let l;if(s.scrollTo({top:t,left:0,behavior:"instant"}),o?.ownerDocument===e&&r()){if(await ne(s),a!==n||o.ownerDocument!==e||!r())return;if(function(e,t){const n=e.ownerDocument;for(let t=e;t;t=t.parentElement)if("until-found"!==t.getAttribute("hidden")?.toLowerCase()&&(t.hasAttribute("hidden")||"none"===n.defaultView.getComputedStyle(t).display))return!1;let o=!1;for(let r=e;r&&e.isConnected&&e.ownerDocument===n&&t();r=r.parentElement){if("until-found"===r.getAttribute("hidden")?.toLowerCase()){if(r.dispatchEvent(new n.defaultView.Event("beforematch",{bubbles:!0})),!(e.isConnected&&e.ownerDocument===n&&r.isConnected&&r.ownerDocument===n&&r.contains(e)&&t()))break;"until-found"===r.getAttribute("hidden")?.toLowerCase()&&r.removeAttribute("hidden"),o=!0}const i=r.parentElement;i instanceof n.defaultView.HTMLDetailsElement&&!i.open&&r!==Array.from(i.children).find(e=>"summary"===e.localName)&&(i.open=!0,o=!0)}return o}(o,()=>a===n&&r())&&await new Promise(e=>s.setTimeout(e,0)),a!==n||!r())return;const t=o.ownerDocument===e?function(e){if(!e?.isConnected)return null;const t=oe(e,!0);if(t?.clipped)return e;if(!t?.boundary)for(const t of e.querySelectorAll("*"))if(oe(t,!0)?.clipped)return t;for(let n=t?.boundary||e.parentElement;n;){const e=oe(n,!0);if(e?.clipped)return n;n=e?.boundary||n.parentElement}return null}(o):null;t&&(function(e,t){const n=ie(e,t,!0);if(!n?.inViewport)return void fe(e);const{rects:o,extent:r,header:i=0}=n,a=e.ownerDocument.documentElement,s=Math.min(r.x,a.clientWidth),l=Math.min(r.y,a.clientHeight-i);o.some(e=>e.right-e.left>=s-1&&e.bottom-e.top>=l-1)?t&&te(n,t)?.reveal(de(e.ownerDocument.defaultView)):fe(e,{nearest:!0,header:i})}(t,i),o.contains(t)&&(l=t))}return t=s.scrollY,l}catch{}},keepInView(t,{canvas:n,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:a,canFollow:s}){try{const l=e?.target===t&&e.canFollow();if(e?.cancel(),!t.isConnected||!s())return;if(!l){const e=ie(t,o);if(!te(e,o)?.visible)return}const c=new AbortController,u={target:t,canFollow:()=>!c.signal.aborted&&s(),cancel(){c.abort(),e===u&&(e=null)}};return e=u,function(e,t,n,o,r){const i=e=>{e.isTrusted&&("keydown"!==e.type||ee.has(e.key))&&r()},a={capture:!0,passive:!0,signal:o};for(const n of[e,t])for(const e of["wheel","touchmove","pointerdown","keydown"])n?.addEventListener(e,i,a);t?.addEventListener("scroll",()=>{n?.()&&r()},a)}(t.ownerDocument.defaultView,n,a,c.signal,()=>{u.cancel(),i?.()}),async function(e,t,n,o){try{const r=e.ownerDocument.defaultView;if(await ne(r),!o())return;const{scrollX:i,scrollY:a}=r,s=n();if(s&&await s,!o()||r.scrollX!==i||r.scrollY!==a)return;let l=ie(e,t);l&&!l.rects.length&&(fe(e,{behavior:"instant",header:l.header}),l=ie(e,t)),te(l,t)?.reveal()}catch{}}(t,o,r,u.canFollow).finally(u.cancel)}catch{}}}}(),l=c(r,{postTitle:t.title??e.postTitle,publicRedirect:e.publicRedirect,inlineLauncher:n,nativeLauncher:o,onOpen:()=>j(),onClose:()=>H(),onRefresh:R,onRetry:e=>e?j(!0):R(),beforeViewportChange:e=>h.beforeViewportChange(e),beforeMove:O,afterMove:()=>{p&&R()}});let d,f,p=!1,m=0;const h=function(e,t,n,o,r=[]){const i=u(r);let a,s,l,c,d;function f(){d?.()}return{get hasPreview(){return!!a},get hasHtmlPreview(){return!!s},get redirectDestination(){return c},load:function(r,u,p=()=>!1,m){const h=new URL(r);if("https:"!==h.protocol&&"http:"!==h.protocol)throw Object.assign(new Error(n.failed),{code:"mtflpp_preview_unsupported_url"});if(h.origin!==window.location.origin){const e=n.originMismatch.replace("%s",()=>h.origin+h.pathname);throw Object.assign(new Error(e),{code:"mtflpp_preview_origin_mismatch"})}const g=h.searchParams.get("mtflpp_token");if(!g)throw new Error(n.failed);return window.crossOriginIsolated&&h.searchParams.set("mtflpp_isolated","1"),f(),h.searchParams.delete("mtflpp_source"),e.followChanges&&h.searchParams.set("mtflpp_source","1"),o(n.updating),new Promise((r,f)=>{const w=e.stage.ownerDocument.createElement("iframe");w.title=n.title,w.className="mtflpp-frame mtflpp-loading",w.setAttribute("aria-hidden","true"),w.setAttribute("tabindex","-1"),w.referrerPolicy="same-origin";let v=!1,y=!1;const b=setTimeout(()=>M(new Error(n.failed)),3e4),x=()=>{y=!0,M()};function M(e){v||(v=!0,e&&(y=!0),clearTimeout(b),d===x&&(d=null),w!==a&&(w.onload=null,w.onerror=null,w.remove()),e?f(e):r())}d=x,w.onload=async()=>{const r=w!==a;if(r||(s=null,l=null),y||!u())return void M();let d,f,v;try{const e=w.contentDocument,t=e?.querySelector('meta[name="meet-the-frontend-live-preview-panel"]');t?.content===g?d=e:r&&!t&&(f=function(e,t){if("text/html"!==e?.contentType)return;const n=e.defaultView?.performance.getEntriesByType("navigation")[0];if(!(n?.redirectCount>0))return;const o=new URL(n.name);return o.origin!==t.origin||o.pathname===t.pathname&&o.search===t.search?void 0:o.pathname}(e,h))}catch{}d&&(e.followChanges&&i.capture(d,r?m:void 0),d.documentElement.style.setProperty("overscroll-behavior","contain","important")),d&&r&&(t.remember(s),e.followChanges&&p()&&s&&(v=i.findChange(s,d))),r&&a&&(a.onload=null,a.onerror=null,a.remove()),a=w,s=d,l=null,c=f,w.classList.remove("mtflpp-loading"),w.removeAttribute("aria-hidden"),w.removeAttribute("tabindex");const b=()=>!y&&u()&&w===a&&d===s&&(!d||w.contentDocument===d);let x;if(d&&r){const n=e.canvasTarget&&(t=>e.canvasTarget(w,t,{fitTarget:!0}));x=await t.restore(d,v,()=>b()&&e.followChanges&&p(),n)}b()?(l=x,o(n.current,"ready"),M()):M()},w.onerror=()=>{w===a?(s=null,l=null,c=void 0,u()&&o(n.failed,"error")):M(new Error(n.failed))},w.src=h.href,e.stage.append(w)})},cancel:f,beforeViewportChange({canvasTarget:n,canFollow:o,...r}){const i=l,c=s,u=a;if(i&&c)return t.keepInView(i,{...r,canvasTarget:e=>n(u,e),canFollow:()=>i===l&&c===s&&u.contentDocument===c&&e.visible&&e.followChanges&&o()})},clear(){f(),t.remember(s),a&&(a.onload=null,a.onerror=null),a=null,s=null,l=null,c=void 0,e.clearPreview()}}}(l,s,r,S,e.comparisonExcludedSelectors);let g,w,v,y,b,x,M,C,k=!1;try{a.BroadcastChannel&&(C=new a.BroadcastChannel(`meet-the-frontend-live-preview-panel:${e.endpoint}:${i}:${e.userId}`),C.onmessage=e=>{"takeover"===e.data?.type&&p&&(H(!0),S(r.handedOff,"conflict",{reason:"handed-off"}))},a.addEventListener("pagehide",e=>{e.persisted||C.close()}))}catch{C?.close(),C=null}function S(e,n="loading",{canRetry:o=!0,reason:r=""}={}){"ready"===n&&(k=!1),l.report(e,n,{canTakeOver:!!C,hasPreview:h.hasPreview,canRetry:o,reason:r,hasHtmlPreview:h.hasHtmlPreview,redirectDestination:h.redirectDestination,canRefresh:p&&!t.saving&&["ready","error"].includes(n)&&("error"!==n||o)})}function E(e){const t=e?.code,n=function(e){const t=e?.code;return"mtflpp_post_locked"===t?"post-locked":"mtflpp_acf_rows_stale"===t?"reload-before-save":["mtflpp_invalid_nonce","rest_cookie_invalid_nonce","mtflpp_preview_conflict","mtflpp_source_changed","mtflpp_acf_unavailable","mtflpp_integration_failed"].includes(t)?"reload":["mtflpp_cannot_preview","rest_forbidden","rest_cannot_edit"].includes(t)?"permission":"mtflpp_preview_origin_mismatch"===t?"origin-mismatch":"mtflpp_preview_unsupported_url"===t?"unsupported-url":""}(e);n&&(p=!1,P(),h.cancel(),b?.()),S("string"==typeof t?e.message:r.failed,"post-locked"===n?"paused":"error",{reason:n,canRetry:!n})}function P(){clearTimeout(d),f=void 0}function L(e){if(void 0===e&&void 0===f)return;const t=performance.now();void 0!==e&&(f=t+e),clearTimeout(d);const n=Math.ceil(f-t);n>0?d=setTimeout(V,n):V()}function T(){p&&(m+=1,k=!0,h.cancel(),t.saving||S(r.stale,"stale"),t.saving||t.previewing?P():L(275))}function V(){if(!p||g||!1===t.ready||t.previewing||t.saving)return;P();const n=m;S(r.updating),g=(async()=>{try{if(await t.idle,!p||!1===t.ready||t.saving)return;const o=e.base;let i,a;v=t.preparePreview(l.followChanges);try{i=await v}catch(e){a=e}finally{v=null}if(await t.idle,!p||!1===t.ready||t.saving||o!==e.base)return;if(a)throw a;if("string"!=typeof i.url)throw Object.assign(new Error(i.message||r.failed),{code:i.code});p&&n===m&&await function(e,t,n){return h.load(e,()=>p&&t===m,()=>l.followChanges&&k,n)}(i.url,n,i.comparisonValues)}catch(e){p&&!t.saving&&E(e)}finally{g=null,L()}})()}function O(){m+=1,h.clear()}function H(e=!1){l.setVisible(e),p=!1,P(),O(),clearTimeout(M),M=null,x?.abort(),l.returnToEditor(),b?.()}async function j(n=!1){if(l.setVisible(!0),p)return;if(w)return void E(w);if(y){if(x&&!x.signal.aborted)return;const e=m;try{await y}catch{}return void(l.visible&&e===m&&j(n))}if(!1===t.ready)return void S(t.notReady,t.notReadyState??"paused",{canRetry:!1});if(!e.available)return void S(r.unavailable,"error",{canRetry:!1,reason:"unavailable"});if(!a.isSecureContext||!navigator.locks)return void S(r.browser,"error",{canRetry:!1,reason:"browser"});const o=n&&C?new AbortController:null;let s=!1;x=o,o?(S(r.waiting,"handover"),M=setTimeout(()=>{s=!0,o.abort()},15e3)):S(t.saving?r.saving:r.updating);try{const n=o?{signal:o.signal}:{ifAvailable:!0};if(y=navigator.locks.request(`meet-the-frontend-live-preview-panel:${e.endpoint}:${i}`,n,async e=>{if(clearTimeout(M),M=null,x=null,l.visible&&!o?.signal.aborted)if(e){S(t.saving?r.saving:r.updating);try{await new Promise(e=>{b=e,p=!0,m+=1,V()}),await g}finally{b=null}}else S(C?r.conflict:r.closeOther,"conflict",{reason:C?"other-tab":"manual"})}),o)try{C.postMessage({type:"takeover"})}catch(e){throw o.abort(),p&&H(!0),await y.catch(()=>{}),e}await y,l.visible&&s&&S(r.takeoverTimeout,"conflict",{reason:"busy"})}catch(e){p=!1,l.visible&&s?S(r.takeoverTimeout,"conflict",{reason:"busy"}):l.visible&&"AbortError"!==e.name&&E(e)}finally{clearTimeout(M),M=null,x=null,y=null}}function R(e=!0){t.saving||(e||(k=!1),p?(m+=1,h.cancel(),L(0)):j())}return{changed:T,pause:function(e=r.saving,t="loading"){return m+=1,P(),h.cancel(),(p||l.visible&&"paused"===t)&&S(e,t,{canRetry:!1}),v},resume:function(e){w=e,e?l.visible&&E(e):!l.visible||p||y?T():j()},setSuspended:l.setSuspended,setTitle:l.setTitle,openFromLauncher:l.openFromLauncher,start:()=>{l.visible&&j()},get pending(){return g}}}const ve=window.meetTheFrontendLivePreviewPanel,ye=document.getElementById("edittag");if(ve&&ye)try{!function(e,t,n,o){const r='.term-name-wrap input[name="name"]',i='.term-description-wrap textarea[name="description"]',a="input change undo redo SetContent";let s,l;function c(){const n=t.querySelector(r)?.value,o=t.querySelector(i),a=s&&s.getElement()===o&&s.getBody()&&!s.isHidden()?s.getContent():o?.value;if("string"!=typeof n||"string"!=typeof a)throw new Error(e.strings.bootFailed);return{name:n,description:a}}const u=we(e,{title:c().name,async preparePreview(){const t=c(),n=l?.capture(),o={"X-WP-Nonce":e.nonce};n&&(o["Content-Type"]="application/json");const r=await fetch(e.endpoint,{method:"POST",credentials:"same-origin",headers:o,body:n?JSON.stringify({...n,...t}):new URLSearchParams(t)}),i=await r.json();if(!r.ok)throw Object.assign(new Error(i.message||e.strings.failed),{code:i.code});return{...i,comparisonValues:{name:{type:"text",value:t.name},description:{type:"html",value:t.description}}}}},{inlineLauncher:o});function d(e){if(e.target.matches(r))u.setTitle(e.target.value);else if(!e.target.matches(i))return;u.changed()}function f(){u.changed()}function p(e){"description"===e?.id&&e!==s&&t.contains(e.getElement())&&(s?.off(a,f),s=e,s.on(a,f),f())}l=function(e,t,n){if(!e.acfTermEnabled||!t.querySelector('[name="_acf_nonce"]'))return;const{acf:o,jQuery:r,tinymce:i}=window,a=()=>Object.assign(new Error(e.strings.acfUnavailable),{code:"mtflpp_acf_unavailable"});if("function"!=typeof o?.serialize||"function"!=typeof o.addAction||"function"!=typeof o.removeAction||"function"!=typeof r)throw a();const s=new Set,l="input change undo redo SetContent";function c(e){const o=e?.getElement?.();o?.name?.startsWith("acf[")&&t.contains(o)&&!s.has(e)&&(s.add(e),e.on(l,n),e.on("remove",()=>{s.delete(e),e.off(l,n)}))}const u=function(e,t,n,o){const r=window.acf;r.addAction("wysiwyg_tinymce_init",n);for(const e of["append","remove","sortstop","change_field"])r.addAction(e,t);const i=t=>{t[0]===e&&o?.()};function a(e){return!!e?.closest?.(".acf-field")}let s;return r.addAction("validation_failure",i),window.jQuery(e).on("input.mtflppAcf change.mtflppAcf sortupdate.mtflppAcf",(e,n)=>{a(e.target)&&("sortupdate"===e.type&&(s=n?.item?.[0]?.querySelector(':scope > input[type="hidden"][name$="[acf_fc_layout]"]')?.name),e.originalEvent&&"sortupdate"!==e.type||t())}),{isField:a,isValidating:()=>!!e.classList?.contains("is-validating"),hasStructuralPaginationChanges:()=>!!e.querySelector('.acf-repeater[data-pagination="1"] .acf-row:is(.acf-added, .acf-inserted, .acf-reordered, .acf-deleted)'),accepts:e=>"_acf_nonce"===e||e.startsWith("acf[")||e.startsWith("_acf_fields["),layoutOrders(t,n){const o=new Map,r=new Map,i=new Set;for(const[e,t]of n){"1"===t&&e.endsWith("[acf_fc_layout_disabled]")&&i.add(e.replace(/\[acf_fc_layout_disabled\]$/,"[acf_fc_layout]"));const n=e.match(/^(acf\[.+)\[[^\]]+\]\[acf_fc_layout\]$/)?.[1];n&&(o.has(n)||o.set(n,[]),o.get(n).push(e),r.set(e,[]))}const a=e=>Array.from(e.matchAll(/\]\[/g),({index:t})=>`${e.slice(0,t+1)}[acf_fc_layout]`);function l(e){const t=a(e);if(!t.some(e=>i.has(e)))return t.findLast(e=>r.has(e))}for(const[e,n]of t){if(!e.startsWith("acf[")||!["text","html"].includes(n.type))continue;const t=a(e);if(!t.some(e=>i.has(e)))for(const n of t)r.get(n)?.push(e)}for(const o of e.querySelectorAll('.acf-field[data-type="image"] .acf-image-uploader.has-value')){const e=o.querySelector(':scope > input[type="hidden"][name]'),i=o.querySelector(':scope > .image-wrap > img[data-name="image"]'),a=e?.name;if(!a?.startsWith("acf[")||!i||e.matches(":disabled")||o.closest(".acf-clone"))continue;const s=n.getAll(a);if(1!==s.length||s[0]!==e.value||!/^[1-9]\d*$/.test(s[0]))continue;const c=l(a);c&&(r.get(c).push(a),t.set(a,{type:"row-image",value:s[0],alt:i.alt}))}for(const o of e.querySelectorAll('.acf-field[data-type="gallery"] .acf-gallery')){const e=o.querySelector(':scope > input[type="hidden"][name]'),r=e?.name;if(!r?.startsWith("acf[")||e.matches(":disabled")||o.closest(".acf-clone"))continue;const s=`${r}[]`,l=n.getAll(r),c=n.getAll(s);if(a(r).some(e=>i.has(e))||1!==l.length||""!==l[0]||c.some(e=>!/^[1-9]\d*$/.test(e)))continue;const u=[...o.querySelectorAll(':scope > .acf-gallery-main > .acf-gallery-attachments > .acf-gallery-attachment > input[type="hidden"][name]')];u.length!==c.length||u.some((e,t)=>e.name!==s||e.value!==c[t]||e.matches(":disabled"))||t.set(s,{type:"gallery-order",value:JSON.stringify(c),members:JSON.stringify([...c].sort())})}for(const[e,n]of o){const o=n.filter(e=>!i.has(e));if(o.length<2||new Set(o).size!==o.length)continue;const a=o.includes(s)?s:void 0;t.set(`acf-layout-order:${e}`,{type:"row-order",value:JSON.stringify(o),members:JSON.stringify([...o].sort()),moved:a,fieldsByRow:Object.fromEntries(o.map(e=>[e,r.get(e)]))})}return t},destroy(){r.removeAction("wysiwyg_tinymce_init",n);for(const e of["append","remove","sortstop","change_field"])r.removeAction(e,t);r.removeAction("validation_failure",i),window.jQuery(e).off(".mtflppAcf")}}}(t,n,c);for(const e of i?.editors??[])c(e);const d=r(t.ownerDocument),f="tinymce-editor-init.mtflppAcfTerm";d.on(f,(e,t)=>c(t));const p=e=>{u.isField(e.target)&&n()};return t.addEventListener("input",p),t.addEventListener("change",p,!0),{capture(){const e=[];try{for(const n of s){const o=n.getElement();o&&t.contains(o)&&n.getBody()&&!n.isHidden()&&(e.push([o,o.value]),o.value=n.getContent())}const{acf:n,_acf_nonce:i,_acf_fields:l}=o.serialize(r(t));if(!n)return{};if(!i)throw a();return{acf:n,_acf_nonce:i,_acf_fields:l}}finally{for(const[t,n]of e)t.value=n}},destroy(){u.destroy(),d.off(f),t.removeEventListener("input",p),t.removeEventListener("change",p,!0);for(const e of s)e.off(l,n);s.clear()}}}?.(e,t,u.changed);const m=window.jQuery?.(t.ownerDocument);m?.on("tinymce-editor-init.mtflppTermEditor",(e,t)=>p(t)),p(window.tinymce?.get("description")),window.addEventListener("pagehide",e=>{e.persisted||(s?.off(a,f),m?.off("tinymce-editor-init.mtflppTermEditor"),l?.destroy())}),t.addEventListener("input",d),t.addEventListener("change",d,!0),u.start()}(ve,ye,0,ye.querySelector("#mtflpp-term-preview button"))}catch(e){!function(e,t){document.getElementById("mtflpp-panel")?.remove(),document.getElementById("mtflpp-toggle")?.remove(),document.getElementById("mtflpp-publish-preview")?.remove(),document.getElementById("mtflpp-term-preview")?.remove();const n=document.createElement("div");n.className="notice notice-error inline",n.setAttribute("role","alert");const o=document.createElement("p");o.textContent=e,n.append(o);const r=document.querySelector("#wpbody-content .wp-header-end")||document.querySelector("#wpbody-content .wrap h1, #wpbody-content .wrap h2");r?r.after(n):(document.getElementById("wpbody-content")||document.body).prepend(n),console.error("Meet the Frontend – Live Preview Panel could not start.",t)}(ve.strings.bootFailed,e)}})();
  • meet-the-frontend-live-preview-panel/tags/1.3.1/classes/Compatibility/Acf.php

    r3819155 r3822693  
    5858        );
    5959        $config['strings']['nativePreviewAcf'] = __(
    60             'WordPress Preview saved changes in your repeating fields to the post.',
     60            'WordPress Preview saved repeating field changes, but the rows in this editor are still out of date.',
     61            'meet-the-frontend-live-preview-panel'
     62        );
     63        $config['strings']['nativePreviewAcfReload'] = __(
     64            'Copy any unsaved changes you want to keep, then reload the editor before saving again.',
    6165            'meet-the-frontend-live-preview-panel'
    6266        );
    … …  
    8286    {
    8387        return function_exists('acf');
     88    }
     89
     90    /** Saved inputs to ACF's position-based paginated merges, including nested storage paths. */
     91    public static function paginatedRowState(array $meta): array
     92    {
     93        if (!function_exists('acf_get_field_type') || !acf_get_field_type('repeater')) {
     94            return [];
     95        }
     96        $repeaters = [];
     97        // ACF saves _<storage path> => field key, even when a repeater sits inside another field.
     98        foreach ($meta as $key => $values) {
     99            $reference = $values[0] ?? null;
     100            if (
     101                !str_starts_with((string) $key, '_') || !is_string($reference) || !str_starts_with($reference, 'field_')
     102            ) {
     103                continue;
     104            }
     105            $field = acf_get_field($reference);
     106            if (($field['type'] ?? '') === 'repeater' && !empty($field['pagination']) && !empty($field['sub_fields'])) {
     107                $repeaters[substr($key, 1)] = true;
     108            }
     109        }
     110        if (!$repeaters) {
     111            return [];
     112        }
     113        $rows = [];
     114        foreach ($meta as $key => $values) {
     115            $name = str_starts_with((string) $key, '_') ? substr($key, 1) : (string) $key;
     116            if (isset($repeaters[$name])) {
     117                $rows[$key] = $values;
     118                continue;
     119            }
     120            // Match only indexed descendants of a paginated field, not every ACF value on the post.
     121            preg_match_all('/_[0-9]+(?=_)/', $name, $indices, PREG_OFFSET_CAPTURE);
     122            foreach ($indices[0] as [, $offset]) {
     123                if (isset($repeaters[substr($name, 0, $offset)])) {
     124                    $rows[$key] = $values;
     125                    break;
     126                }
     127            }
     128        }
     129        ksort($rows);
     130        return $rows;
    84131    }
    85132
  • meet-the-frontend-live-preview-panel/tags/1.3.1/classes/Compatibility/Timber.php

    r3819155 r3822693  
    44
    55use MeetTheFrontendLivePreviewPanel\LivePreview;
     6use WeakMap;
    67use WP_Post;
    78use WP_Term;
    … …  
    1516    private array $fields = [];
    1617    private array $terms = [];
     18    private ?WeakMap $legacyEmptyQueries = null;
    1719
    1820    public function __construct()
    … …  
    2729            true
    2830        ));
    29         add_action('mtflpp_frontend_term_preview_source_selected', fn (array $context) => $this->bindTermPreview(
     31        add_action('mtflpp_frontend_term_preview_source_selected', fn (array $context) => $this->bindTimber2TermPreview(
    3032            $context['term'],
    3133            $context['saved']
    … …  
    3335    }
    3436
    35     private function bindTermPreview(WP_Term $term, WP_Term $saved): void
    36     {
    37         if (!class_exists(\Timber\Term::class)) {
     37    private function bindTimber2TermPreview(WP_Term $term, WP_Term $saved): void
     38    {
     39        // Timber 1 lacks the class hook and its Term::init() has a different signature.
     40        // Leave its archive on the native WordPress preview path.
     41        if (!method_exists(\Timber\Term::class, 'wp_object')) {
    3842            return;
    3943        }
    … …  
    7074        $terms = $saved ? [] : get_post_meta($sourceId, LivePreview::TERMS_META, true);
    7175        $this->terms = is_array($terms) ? $terms : [];
    72         if ($this->terms) {
    73             add_filter('timber/post/class', [$this, 'postClass'], PHP_INT_MAX, 2);
    74         }
    75         // Timber can reload the parent by ID instead of using WordPress's filtered preview object.
    76         add_filter('timber/post/import_data', [$this, 'readPost'], PHP_INT_MAX, 2);
     76        // Timber 1 has the eager import_custom() API; Timber 2 uses import and class hooks instead.
     77        $isTimber1 = method_exists(\Timber\Post::class, 'import_custom');
     78        if (!$isTimber1) {
     79            $this->bindTimber2PostReads();
     80        } elseif (!$saved) {
     81            $this->bindTimber1PostReads();
     82        }
    7783        add_action('shutdown', [$this, 'unbindPreview'], PHP_INT_MAX);
    7884    }
    … …  
    8288    {
    8389        remove_filter('timber/post/import_data', [$this, 'readPost'], PHP_INT_MAX);
     90        remove_filter('timber_post_get_meta_pre', [$this, 'readLegacyPostMeta'], PHP_INT_MAX);
     91        remove_filter('timber_post_get_meta_field_pre', [$this, 'readLegacyPostMetaField'], PHP_INT_MAX);
    8492        remove_filter('timber/post/class', [$this, 'postClass'], PHP_INT_MAX);
     93        remove_action('pre_get_terms', [$this, 'readLegacyTermQuery'], PHP_INT_MIN);
     94        remove_filter('terms_pre_query', [$this, 'emptyLegacyTermQuery'], PHP_INT_MIN);
     95        $this->legacyEmptyQueries = null;
    8596        remove_action('shutdown', [$this, 'unbindPreview'], PHP_INT_MAX);
    8697        $this->previewPostId = 0;
    … …  
    90101    }
    91102
     103    private function bindTimber1PostReads(): void
     104    {
     105        add_filter('timber_post_get_meta_pre', [$this, 'readLegacyPostMeta'], PHP_INT_MAX, 2);
     106        add_filter('timber_post_get_meta_field_pre', [$this, 'readLegacyPostMetaField'], PHP_INT_MAX, 3);
     107        if ($this->terms) {
     108            $this->legacyEmptyQueries = new WeakMap();
     109            add_action('pre_get_terms', [$this, 'readLegacyTermQuery'], PHP_INT_MIN);
     110            add_filter('terms_pre_query', [$this, 'emptyLegacyTermQuery'], PHP_INT_MIN, 2);
     111        }
     112    }
     113
     114    public function readLegacyPostMeta(mixed $meta, mixed $postId): mixed
     115    {
     116        $sourceId = $this->legacyMetaSourceId($postId);
     117        if ($meta === false || !empty($meta) || !$sourceId) {
     118            return $meta;
     119        }
     120        // Give Timber the same raw shape as get_post_meta($id), without preview bookkeeping.
     121        $meta = array_filter(
     122            get_post_meta($sourceId),
     123            static fn ($key): bool => !str_starts_with((string) $key, '_mtflpp_'),
     124            ARRAY_FILTER_USE_KEY
     125        );
     126        // Timber treats an empty array as a request to load the saved post's metadata.
     127        return $meta ?: false;
     128    }
     129
     130    public function readLegacyPostMetaField(mixed $value, mixed $postId, mixed $key): mixed
     131    {
     132        $sourceId = $this->legacyMetaSourceId($postId);
     133        if ($value !== null || !is_string($key) || $key === '' || !$sourceId) {
     134            return $value;
     135        }
     136        // A missing imported property can fall through to Timber's single-field read on the parent.
     137        // Compare the bulk snapshots so virtual per-key metadata and later formatting filters stay native.
     138        return !array_key_exists($key, get_post_meta($sourceId))
     139            && array_key_exists($key, get_post_meta($this->previewPostId)) ? false : $value;
     140    }
     141
     142    private function legacyMetaSourceId(mixed $postId): int
     143    {
     144        return $this->source && is_numeric($postId) && (int) $postId === $this->previewPostId
     145            && $this->source->ID !== $this->previewPostId ? $this->source->ID : 0;
     146    }
     147
     148    public function readLegacyTermQuery(WP_Term_Query $query): void
     149    {
     150        if (!$this->legacyEmptyQueries || !$this->isPreviewTermQuery($query)) {
     151            return;
     152        }
     153        // Timber 1 has no post class hook. Match only its direct relationship query, not a
     154        // native query nested inside it. Otherwise core could cache unsaved terms on the parent.
     155        // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_debug_backtrace -- Identify the legacy caller without reading its arguments.
     156        $stack = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 14);
     157        foreach ($stack as $index => $frame) {
     158            if (isset($frame['class']) || $frame['function'] !== 'get_terms') {
     159                continue;
     160            }
     161            $index++;
     162            while (($stack[$index]['function'] ?? '') === 'wp_get_object_terms' && !isset($stack[$index]['class'])) {
     163                $index++;
     164            }
     165            if (
     166                ($stack[$index]['function'] ?? '') === 'wp_get_post_terms' && !isset($stack[$index]['class'])
     167                && ($stack[$index + 1]['class'] ?? '') === \Timber\Post::class
     168                && $stack[$index + 1]['function'] === 'terms'
     169            ) {
     170                $this->adaptTermQuery($query, $this->legacyEmptyQueries);
     171            }
     172            return;
     173        }
     174    }
     175
     176    public function emptyLegacyTermQuery($terms, WP_Term_Query $query)
     177    {
     178        return $this->legacyEmptyQueries ? $this->emptyTermQuery($terms, $query, $this->legacyEmptyQueries) : $terms;
     179    }
     180
     181    private function bindTimber2PostReads(): void
     182    {
     183        // Timber can reload the parent by ID instead of using WordPress's filtered preview object.
     184        add_filter('timber/post/import_data', [$this, 'readPost'], PHP_INT_MAX, 2);
     185        if ($this->terms) {
     186            add_filter('timber/post/class', [$this, 'postClass'], PHP_INT_MAX, 2);
     187        }
     188    }
     189
     190    public function readPost(array $data, object $post): array
     191    {
     192        if ($this->source && (int) $post->ID === $this->previewPostId) {
     193            foreach (['post_title', 'post_content', 'post_excerpt'] as $field) {
     194                $data[$field] = $this->source->$field;
     195            }
     196            foreach ($this->fields as $field => $value) {
     197                $data[$field] = $value;
     198            }
     199            if ($post instanceof TimberPost) {
     200                $post->setPreviewTerms($this->readTerms(...));
     201            }
     202        }
     203        return $data;
     204    }
     205
    92206    /** Use Timber's public class hook without replacing theme-specific Post subclasses. */
    93207    public function postClass(string $class, WP_Post $post): string
    … …  
    109223        // WordPress hooks inside those reads (including our own fallback reads) stay native.
    110224        $queryDepth = count($GLOBALS['wp_current_filter']) + 1;
    111         $emptyQueries = new \WeakMap();
     225        $emptyQueries = new WeakMap();
    112226        $adapt = function (WP_Term_Query $query) use ($queryDepth, $emptyQueries): void {
    113             if (
    114                 count($GLOBALS['wp_current_filter']) !== $queryDepth
    115                 || wp_parse_id_list($query->query_vars['object_ids'] ?? []) !== [$this->previewPostId]
    116             ) {
    117                 return;
    118             }
    119             $args = &$query->query_vars;
    120             // These modes depend on real relationship rows, not just a selection of terms.
    121             if (
    122                 $args['fields'] === 'all_with_object_id' || $args['orderby'] === 'term_order' || $args['exclude_tree']
    123             ) {
    124                 return;
    125             }
    126             $ids = [];
    127             foreach ((array) $args['taxonomy'] as $taxonomy) {
    128                 $selected = $this->terms[$taxonomy] ?? wp_get_object_terms(
    129                     $this->previewPostId,
    130                     $taxonomy,
    131                     ['fields' => 'ids']
    132                 );
    133                 if (!is_array($selected)) {
    134                     return;
    135                 }
    136                 $ids = array_merge($ids, $selected);
    137             }
    138             $include = wp_parse_id_list($args['include']);
    139             $ids = $include ? array_intersect($include, $ids)
    140                 : array_diff($ids, wp_parse_id_list($args['exclude']));
    141             $args['object_ids'] = [];
    142             $args['include'] = array_values(array_unique($ids));
    143             if (!$ids) {
    144                 $emptyQueries[$query] = true;
    145             }
    146             // Native object_ids queries include assigned terms even when their count is zero.
    147             $args['hide_empty'] = false;
     227            if (count($GLOBALS['wp_current_filter']) === $queryDepth) {
     228                $this->adaptTermQuery($query, $emptyQueries);
     229            }
    148230        };
    149         // Empty include lists (and even [0] on older core) otherwise query every term.
    150         $empty = static function ($terms, WP_Term_Query $query) use ($emptyQueries) {
    151             return isset($emptyQueries[$query]) ? ($query->query_vars['fields'] === 'count' ? '0' : []) : $terms;
    152         };
     231        $empty = fn ($terms, WP_Term_Query $query) => $this->emptyTermQuery($terms, $query, $emptyQueries);
    153232        add_action('pre_get_terms', $adapt, PHP_INT_MIN);
    154233        add_filter('terms_pre_query', $empty, PHP_INT_MIN, 2);
    … …  
    161240    }
    162241
    163     public function readPost(array $data, object $post): array
    164     {
    165         if ($this->source && (int) $post->ID === $this->previewPostId) {
    166             foreach (['post_title', 'post_content', 'post_excerpt'] as $field) {
    167                 $data[$field] = $this->source->$field;
    168             }
    169             foreach ($this->fields as $field => $value) {
    170                 $data[$field] = $value;
    171             }
    172             if ($post instanceof TimberPost) {
    173                 $post->setPreviewTerms($this->readTerms(...));
    174             }
    175         }
    176         return $data;
     242    private function isPreviewTermQuery(WP_Term_Query $query): bool
     243    {
     244        return wp_parse_id_list($query->query_vars['object_ids'] ?? []) === [$this->previewPostId];
     245    }
     246
     247    private function adaptTermQuery(WP_Term_Query $query, WeakMap $emptyQueries): void
     248    {
     249        if (!$this->isPreviewTermQuery($query)) {
     250            return;
     251        }
     252        $args = &$query->query_vars;
     253        // These modes depend on real relationship rows, not just a selection of terms.
     254        if ($args['fields'] === 'all_with_object_id' || $args['orderby'] === 'term_order' || $args['exclude_tree']) {
     255            return;
     256        }
     257        $ids = [];
     258        foreach ((array) $args['taxonomy'] as $taxonomy) {
     259            $selected = $this->terms[$taxonomy] ?? wp_get_object_terms(
     260                $this->previewPostId,
     261                $taxonomy,
     262                ['fields' => 'ids']
     263            );
     264            if (!is_array($selected)) {
     265                return;
     266            }
     267            $ids = array_merge($ids, $selected);
     268        }
     269        $include = wp_parse_id_list($args['include']);
     270        $ids = $include ? array_intersect($include, $ids) : array_diff($ids, wp_parse_id_list($args['exclude']));
     271        $args['object_ids'] = [];
     272        $args['include'] = array_values(array_unique($ids));
     273        if (!$ids) {
     274            $emptyQueries[$query] = true;
     275        }
     276        // Native object_ids queries include assigned terms even when their count is zero.
     277        $args['hide_empty'] = false;
     278    }
     279
     280    private function emptyTermQuery($terms, WP_Term_Query $query, WeakMap $emptyQueries)
     281    {
     282        // Empty include lists (and even [0] on older core) otherwise query every term.
     283        return isset($emptyQueries[$query]) ? ($query->query_vars['fields'] === 'count' ? '0' : []) : $terms;
    177284    }
    178285}
  • meet-the-frontend-live-preview-panel/tags/1.3.1/classes/FrontendPreview.php

    r3819374 r3822693  
    1414    private bool $saved = false;
    1515    private bool $sourceRequested = false;
     16    private bool $postsPage = false;
    1617
    1718    public function __construct(
    … …  
    5455            return null;
    5556        }
    56         return get_preview_post_link($post, [
     57        return self::previewUrl($post, [
    5758            'mtflpp_post' => $post->ID,
    5859            'mtflpp_revision' => $sourceId,
    … …  
    6061            'mtflpp_token' => wp_create_nonce($this->savedAction($post->ID, $sourceId)),
    6162        ]);
     63    }
     64
     65    private static function isConfiguredPostsPage(?WP_Post $post): bool
     66    {
     67        return $post?->post_type === 'page' && get_option('show_on_front') === 'page'
     68            && $post->ID === (int) get_option('page_for_posts');
     69    }
     70
     71    public static function previewUrl(WP_Post $post, array $args): ?string
     72    {
     73        if (self::isConfiguredPostsPage($post)) {
     74            // Core's preview=true can turn the posts index into a query for the static front page.
     75            return add_query_arg($args, set_url_scheme(get_permalink($post)));
     76        }
     77        return get_preview_post_link($post, $args);
    6278    }
    6379
    … …  
    101117        $this->saved = $saved;
    102118        $this->sourceRequested = isset($_GET['mtflpp_source']) && $_GET['mtflpp_source'] === '1';
    103         // Bind core and compatibility reads to the authorized source, not the latest revision.
    104         remove_filter('the_preview', '_set_preview');
    105         add_filter('the_preview', [$this, 'readPost']);
     119        $this->postsPage = self::isConfiguredPostsPage(get_post($postId));
     120        add_action('template_redirect', [$this, 'checkPreviewTarget'], -1);
     121        if (!$this->postsPage) {
     122            // Ordinary previews use core's singular-query overlay, not the latest autosave.
     123            remove_filter('the_preview', '_set_preview');
     124            add_filter('the_preview', [$this, 'readPost']);
     125            $this->bindSource();
     126        }
     127    }
     128
     129    private function bindSource(): void
     130    {
    106131        add_filter('get_post_metadata', [$this, 'readRevisionMeta'], 10, 4);
    107132        add_filter('get_the_terms', [$this, 'readTerms'], 10, 3);
    108         add_action('template_redirect', [$this, 'checkPreviewTarget'], -1);
    109133
    110134        /**
    … …  
    116140         */
    117141        // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound -- Both names are prefixed.
    118         do_action($saved
     142        do_action($this->saved
    119143            ? 'mtflpp_frontend_saved_preview_source_selected'
    120144            : 'mtflpp_frontend_live_preview_source_selected', [
    121                 'post' => ['id' => $postId],
     145                'post' => ['id' => $this->previewPostId],
    122146                'source' => ['id' => $this->source->ID],
    123147            ]);
    … …  
    182206    }
    183207
     208    private function bindPostsPage(): bool
     209    {
     210        global $wp_query;
     211
     212        if (
     213            !$wp_query->is_posts_page || !is_home()
     214            || is_feed() || is_embed() || is_search() || is_trackback() || is_404()
     215        ) {
     216            return false;
     217        }
     218        $page = get_queried_object();
     219        if (!$page instanceof WP_Post || $page->ID !== $this->previewPostId) {
     220            return false;
     221        }
     222
     223        // The queried page is separate from the posts loop. Don't swap the global post or change saved reads.
     224        $preview = $this->readPost(clone $page);
     225        $wp_query->queried_object = $preview;
     226        if ($page->post_title !== $preview->post_title) {
     227            // Support get_the_title($id) without replacing titles already formatted by core or other code.
     228            add_filter('the_title', static function ($title, $id) use ($page, $preview) {
     229                return $id === $page->ID && $title === $page->post_title ? $preview->post_title : $title;
     230            }, PHP_INT_MIN, 2);
     231        }
     232        $this->bindSource();
     233        return true;
     234    }
     235
    184236    public function checkPreviewTarget(): void
    185237    {
    186         if (!is_preview() || !is_singular() || get_queried_object_id() !== $this->previewPostId) {
     238        if ($this->postsPage) {
     239            if (!$this->bindPostsPage()) {
     240                return;
     241            }
     242        } elseif (is_preview() && is_singular() && get_queried_object_id() === $this->previewPostId) {
     243            // Core drops preview=true without native autosave parameters, losing the singular overlay.
     244            remove_action('template_redirect', 'redirect_canonical');
     245        } else {
    187246            // Native routing owns other destinations, including archives, redirects and error pages.
    188             // The authorized source remains bound only to its original post; do not label other output verified.
    189247            return;
    190248        }
     249        // This panel document must not claim the window name WordPress uses for its native Preview tab.
     250        remove_action('wp_head', 'wp_post_preview_js', 1);
     251
    191252        // Editors have already authorized this preview. Leave other posts and later site policies alone.
    192253        $postId = $this->previewPostId;
    … …  
    198259        }, 0, 2);
    199260
    200         // Core canonical redirects drop preview=true without native autosave parameters, losing our core-field overlay.
    201         remove_action('template_redirect', 'redirect_canonical');
    202261        (new PreviewDocument($this->file, $this->previewToken))->enhance($this->isolated, $this->sourceRequested);
    203262    }
  • meet-the-frontend-live-preview-panel/tags/1.3.1/classes/LivePreview.php

    r3820037 r3822693  
    33namespace MeetTheFrontendLivePreviewPanel;
    44
     5use MeetTheFrontendLivePreviewPanel\Compatibility\Acf;
    56use WP_Error;
    67use WP_Post;
    … …  
    102103    }
    103104
    104     /** Saved fields, metadata and terms; editor locks and asynchronous queue flags are not content. */
     105    public static function conflictMessage(): string
     106    {
     107        return __(
     108            'The saved post has changed or is no longer available for live preview.',
     109            'meet-the-frontend-live-preview-panel'
     110        );
     111    }
     112
     113    /** Saved post inputs for editor merges and native-save coordination. */
    105114    public function fingerprint(int $postId): string
    106115    {
     116        return $this->parentFingerprint($postId, includeAcf: true);
     117    }
     118
     119    private function parentFingerprint(int $postId, bool $includeAcf = false): string
     120    {
    107121        $meta = get_post_meta($postId);
    108         // Editor preferences and core queue flags can change independently of saved content.
    109         unset(
    110             $meta['_edit_lock'],
    111             $meta['_edit_last'],
    112             $meta['_encloseme'],
    113             $meta['_pingme'],
    114             $meta['classic-editor-remember']
    115         );
     122        // Native Custom Fields and arbitrary REST registrations don't describe a shared set of editor inputs.
     123        $state = [$meta['_thumbnail_id'] ?? [], $meta['_wp_page_template'] ?? []];
     124        // ACF field settings can differ on the frontend. Only editor requests merge saved rows.
     125        if ($includeAcf) {
     126            $state[] = Acf::paginatedRowState($meta);
     127        }
     128        return $this->stateHash($postId, $state);
     129    }
     130
     131    /** A full check of owned snapshot data, or of writes during one potentially partial native save. */
     132    public function snapshotFingerprint(int $postId): string
     133    {
     134        $meta = get_post_meta($postId);
    116135        ksort($meta);
    117 
     136        return $this->stateHash($postId, $meta);
     137    }
     138
     139    private function stateHash(int $postId, array $meta): string
     140    {
    118141        $taxonomies = get_object_taxonomies(get_post_type($postId));
    119142        $terms = $taxonomies ? wp_get_object_terms($postId, $taxonomies, [
    … …  
    122145        // WP_Post::to_array() also reads filtered term lists; fingerprint stored fields instead.
    123146        $post = get_post($postId);
    124         return hash('sha256', (string) wp_json_encode([$post ? get_object_vars($post) : null, $meta, $terms]));
     147        $fields = $post ? get_object_vars($post) : null;
     148        // Moderating comments updates this derived count without saving the post.
     149        unset($fields['comment_count']);
     150        return hash('sha256', (string) wp_json_encode([$fields, $meta, $terms]));
    125151    }
    126152
    … …  
    168194            return $response;
    169195        }
     196        $matches = hash_equals($this->fingerprint($postId), $base);
    170197        $this->restSaves[$request] = [
    171198            'postId' => $postId, 'base' => $base, 'request' => $token,
    172             'matches' => hash_equals($this->fingerprint($postId), $base),
     199            'beforeWrite' => $matches ? $this->snapshotFingerprint($postId) : null,
    173200        ];
    174201        return $response;
    … …  
    192219        }
    193220        $post = get_post($save['postId']);
    194         $after = $save['matches'] && $post ? $this->fingerprint($post->ID) : 'conflict';
    195         // A client error can happen after the post was updated, for example while saving metadata.
    196         // Only unchanged failures are safe to retry with the editor's existing baseline.
    197         if ($status >= 400 && $after !== $save['base']) {
     221        $after = $save['beforeWrite'] !== null && $post ? $this->fingerprint($post->ID) : 'conflict';
     222        // A 4xx may follow a partial write, even to metadata outside the editor's conflict scope.
     223        if (
     224            $status >= 400 && (
     225                !$post || $after !== $save['base'] || $this->snapshotFingerprint($post->ID) !== $save['beforeWrite']
     226            )
     227        ) {
    198228            return $response;
    199229        }
    … …  
    253283    }
    254284
    255     private function stateAction(int $postId, int $revisionId): string
    256     {
    257         return 'mtflpp_read_' . $postId . '_' . $revisionId . '_' . $this->fingerprint($postId)
    258             . ($revisionId ? $this->fingerprint($revisionId) : '');
     285    private function sourceAction(int $postId, int $revisionId, string $parentState): string
     286    {
     287        return 'mtflpp_read_' . $postId . '_' . $revisionId . '_' . $parentState
     288            . '_' . $this->snapshotFingerprint($revisionId);
    259289    }
    260290
    … …  
    436466            );
    437467        }
    438         if (!$this->isAvailable($post) || !hash_equals($this->fingerprint($postId), $input['base'])) {
     468        $base = $input['base'];
     469        if (!$post || !$this->isAvailable($post) || !hash_equals($base, $this->fingerprint($postId))) {
    439470            return new WP_Error(
    440471                'mtflpp_preview_conflict',
    441                 __(
    442                     'The saved post has changed or is no longer available for live preview.',
    443                     'meet-the-frontend-live-preview-panel'
    444                 ),
     472                self::conflictMessage(),
    445473                ['status' => 409]
    446474            );
    447475        }
    448         $base = $this->fingerprint($postId);
    449476        $fields = $this->previewFields($post, $input);
    450477        if (is_wp_error($fields)) {
    … …  
    471498            );
    472499        }
     500        $parentState = $this->parentFingerprint($postId);
    473501        if (!hash_equals($base, $this->fingerprint($postId))) {
    474502            return new WP_Error(
    … …  
    478506            );
    479507        }
    480         $action = $this->stateAction($postId, $revisionId);
    481         return new WP_REST_Response([
     508        $action = $this->sourceAction($postId, $revisionId, $parentState);
     509        $result = [
    482510            // Our state token authorizes this revision; native autosave parameters would select recovery data.
    483             'url' => get_preview_post_link($post, [
     511            'url' => FrontendPreview::previewUrl($post, [
    484512                'mtflpp_post' => $postId,
    485513                'mtflpp_revision' => $revisionId,
    486514                'mtflpp_token' => wp_create_nonce($action),
    487515            ]),
    488         ]);
     516        ];
     517        $rowText = $this->rowDisplayText($request);
     518        if ($rowText) {
     519            $result['rowDisplayText'] = $rowText;
     520        }
     521        return new WP_REST_Response($result);
     522    }
     523
     524    /** Use only submitted body values and the native, non-shortcode WYSIWYG formatting steps. */
     525    private function rowDisplayText(WP_REST_Request $request): array
     526    {
     527        $body = $request->get_body_params();
     528        $requested = $body['mtflpp_row_text_fields'] ?? null;
     529        $names = is_string($requested) ? json_decode($requested, true, 4) : null;
     530        if (!is_array($names) || !array_is_list($names)) {
     531            return [];
     532        }
     533        $result = [];
     534        $seen = [];
     535        foreach ($names as $name) {
     536            if (!is_string($name) || isset($seen[$name]) || !preg_match('/^[\w-]+(?:\[[\w-]+\])+$/D', $name)) {
     537                continue;
     538            }
     539            $seen[$name] = true;
     540            $value = $body;
     541            foreach (explode('[', str_replace(']', '', $name)) as $part) {
     542                $value = is_array($value) ? ($value[$part] ?? null) : null;
     543            }
     544            if (!is_string($value) || $value === '') {
     545                continue;
     546            }
     547            try {
     548                $formatted = wpautop(wptexturize($value));
     549                if (trim($formatted) !== trim($value)) {
     550                    $result[$name] = $formatted;
     551                }
     552            } catch (\Throwable) {
     553                // Formatting evidence is optional; a formatter must not fail a prepared preview.
     554            }
     555        }
     556        return $result;
    489557    }
    490558
    … …  
    793861            || !current_user_can('edit_post', $postId) || !$revisionId
    794862            || !$this->ownsRevision($postId, $revisionId)
    795             || !wp_verify_nonce($token, $this->stateAction($postId, $revisionId))
    796863        ) {
    797864            return null;
    798865        }
    799         return get_post($revisionId);
     866        $action = $this->sourceAction($postId, $revisionId, $this->parentFingerprint($postId));
     867        return wp_verify_nonce($token, $action) ? get_post($revisionId) : null;
    800868    }
    801869}
  • meet-the-frontend-live-preview-panel/tags/1.3.1/classes/Panel.php

    r3820037 r3822693  
    170170                'meet-the-frontend-live-preview-panel'
    171171            ),
     172            'savedPostConflict' => LivePreview::conflictMessage(),
    172173            'reviewBeforeReload' => __(
    173                 'Copy any changes you want to keep. Then reload the editor before saving again.',
     174                'Copy any unsaved changes you want to keep, then reload the editor to resume live preview.',
    174175                'meet-the-frontend-live-preview-panel'
    175176            ),
  • meet-the-frontend-live-preview-panel/tags/1.3.1/meet-the-frontend-live-preview-panel.php

    r3820590 r3822693  
    55 * Plugin URI:        https://github.com/timohubois/meet-the-frontend-live-preview-panel/
    66 * Description:       See your changes in a floating preview while you edit posts, pages and taxonomy terms.
    7  * Version:           1.3.0
     7 * Version:           1.3.1
    88 * Requires at least: 6.9
    99 * Requires PHP:      8.3
  • meet-the-frontend-live-preview-panel/tags/1.3.1/readme.txt

    r3820590 r3822693  
    44Requires at least: 6.9
    55Tested up to: 7.1
    6 Stable tag: 1.3.0
     6Stable tag: 1.3.1
    77Requires PHP: 8.3
    88License: GPLv3 or later
    … …  
    5555= Can I preview older revisions? =
    5656
    57 Yes. **Preview revision**, next to **Go to editor**, opens a floating window without narrowing the diff. It follows the right-hand **To** selection without restoring it or changing your saved post.
     57Yes, on the classic Revisions screen. If you’re in Visual Revisions in the Block Editor, choose **Open classic revisions screen** in the Settings sidebar first. Then click **Preview revision** next to **Go to editor**. The floating window follows the right-hand **To** selection without narrowing the diff, restoring the revision or changing your saved post.
    5858
    5959Historical content and supported stored fields use your current theme and settings. The post's author, publication date, categories and tags remain current. Not every field has a historical value. Some values remain current, while missing historical values may be empty. This is a content preview, not a snapshot of the whole site.
    … …  
    114114== Changelog ==
    115115
     116= 1.3.1 =
     117* Keep WordPress's native Preview in a separate tab in both the Classic and Block Editors.
     118* Follow more changes in the live preview, including ACF Flexible Content row moves and gallery edits.
     119* Preview the page assigned to display your latest posts, including from its revision history.
     120* Fix Classic revision preview startup and pause live updates while browsing Visual Revisions.
     121* Avoid false preview conflicts after comment moderation, embed cache updates, or unrelated metadata changes.
     122* Improve Timber 1 and 2 compatibility for post and term previews.
     123
    116124= 1.3.0 =
    117125* Open the floating live preview from the Block Editor's View menu. On narrow screens, use the floating launcher.
  • meet-the-frontend-live-preview-panel/trunk/build/block-editor.asset.php

    r3820590 r3822693  
    1111                'wp-primitives'
    1212        ),
    13         'version' => '99b5df4c766150ddf1d2'
     13        'version' => '76857201684d45d9b029'
    1414);
  • meet-the-frontend-live-preview-panel/trunk/build/block-editor.js

    r3820590 r3822693  
    1 (()=>{"use strict";const e=window.wp.element,t=window.wp.apiFetch,n=window.wp.data,o=window.wp.hooks,r="meet-the-frontend-live-preview-panel",i=/^[a-f0-9]{64}$/,a=window.wp.preferences,s=window.wp.components,l=window.wp.notices,c=window.wp.primitives,d=window.ReactJSXRuntime,u={refresh:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M12 5.5L17.7929 11.2929C18.1834 11.6834 18.1834 12.3166 17.7929 12.7071L16 14.5M16 5.5H12V9.5M12 18.5L6.20711 12.7071C5.81658 12.3166 5.81658 11.6834 6.20711 11.2929L8 9.5M8 18.5H12V14.5"})}),more:(0,d.jsxs)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,d.jsx)(c.Path,{d:"M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z",fill:"currentColor",stroke:"none"}),(0,d.jsx)(c.Path,{d:"M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z",fill:"currentColor",stroke:"none"}),(0,d.jsx)(c.Path,{d:"M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z",fill:"currentColor",stroke:"none"}),(0,d.jsx)(c.Path,{d:"M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z"}),(0,d.jsx)(c.Path,{d:"M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z"}),(0,d.jsx)(c.Path,{d:"M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z"})]}),expand:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M4.75 10V4.75H10M4.75 4.75L10 10M14 19.25H19.25V14M19.25 19.25L14 14"})}),compact:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M10 4.75V10H4.75M10 10L4.75 4.75M19.25 14H14V19.25M14 14L19.25 19.25"})}),pip:(0,d.jsxs)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,d.jsx)(c.Path,{d:"M4.75 9.25V16C4.75 16.6904 5.30964 17.25 6 17.25H8M4.75 9.25V6C4.75 5.30964 5.30964 4.75 6 4.75H16C16.6904 4.75 17.25 5.30964 17.25 6V8M4.75 9.25H8"}),(0,d.jsx)(c.Path,{d:"M10.75 11.25C10.75 10.9739 10.9739 10.75 11.25 10.75H18.75C19.0261 10.75 19.25 10.9739 19.25 11.25V18.75C19.25 19.0261 19.0261 19.25 18.75 19.25H11.25C10.9739 19.25 10.75 19.0261 10.75 18.75V11.25Z",fill:"currentColor"})]}),move:(0,d.jsxs)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,d.jsx)(c.Path,{d:"M9.25 5.75H8.75V6.25H9.25V5.75Z",fill:"currentColor",stroke:"none"}),(0,d.jsx)(c.Path,{d:"M9.25 11.75H8.75V12.25H9.25V11.75Z",fill:"currentColor",stroke:"none"}),(0,d.jsx)(c.Path,{d:"M9.25 17.75H8.75V18.25H9.25V17.75Z",fill:"currentColor",stroke:"none"}),(0,d.jsx)(c.Path,{d:"M15.25 5.75H14.75V6.25H15.25V5.75Z",fill:"currentColor",stroke:"none"}),(0,d.jsx)(c.Path,{d:"M15.25 11.75H14.75V12.25H15.25V11.75Z",fill:"currentColor",stroke:"none"}),(0,d.jsx)(c.Path,{d:"M15.25 17.75H14.75V18.25H15.25V17.75Z",fill:"currentColor",stroke:"none"}),(0,d.jsx)(c.Path,{d:"M9.25 5.75H8.75V6.25H9.25V5.75Z"}),(0,d.jsx)(c.Path,{d:"M9.25 11.75H8.75V12.25H9.25V11.75Z"}),(0,d.jsx)(c.Path,{d:"M9.25 17.75H8.75V18.25H9.25V17.75Z"}),(0,d.jsx)(c.Path,{d:"M15.25 5.75H14.75V6.25H15.25V5.75Z"}),(0,d.jsx)(c.Path,{d:"M15.25 11.75H14.75V12.25H15.25V11.75Z"}),(0,d.jsx)(c.Path,{d:"M15.25 17.75H14.75V18.25H15.25V17.75Z"})]}),warning:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M12 8L12 13M12 14.5L12 16M4.75 12C4.75 7.99593 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12Z",strokeLinejoin:"round"})}),info:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M12 16V11M12 9.5V8M19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12C4.75 7.99594 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12Z",strokeLinejoin:"round"})}),close:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M7.75 16.25L16.25 7.75M16.25 16.25L7.75 7.75"})}),check:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M7 12L10 15L17 8"})}),chevron:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M7 11L12 15L17 11"})}),desktop:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M4.75 16.75V17H3.25C3.11193 17 3 17.1119 3 17.25H21C21 17.1119 20.8881 17 20.75 17H19.25V16.75M4.75 16.75V8.5C4.75 7.80964 5.30964 7.25 6 7.25H18C18.6904 7.25 19.25 7.80964 19.25 8.5V16.75M4.75 16.75H19.25"})}),tablet:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M10 16.5H14M18.25 18V6C18.25 5.30964 17.6904 4.75 17 4.75H7C6.30964 4.75 5.75 5.30964 5.75 6L5.75 18C5.75 18.6904 6.30964 19.25 7 19.25H17C17.6904 19.25 18.25 18.6904 18.25 18Z"})}),mobile:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M11 16.5H13M16.25 18V6C16.25 5.30964 15.6904 4.75 15 4.75H9C8.30964 4.75 7.75 5.30964 7.75 6L7.75 18C7.75 18.6904 8.30964 19.25 9 19.25H15C15.6904 19.25 16.25 18.6904 16.25 18Z"})})};function f(e,t,n="right"){const o=e&&!Array.isArray(e)&&e.bounds&&["x","y","width","height"].every(t=>Number.isFinite(e.bounds[t]))&&e.bounds.width>0&&e.bounds.height>0&&[null,"left","center","right"].includes(e.dock)&&"boolean"==typeof e.expanded&&(void 0===e.anchor||["left","center","right"].includes(e.anchor));let r=!!o&&e.expanded;const i={width:480,height:393},a=o?{...e.bounds}:{x:0,y:0,...i};let s=o?e.dock:n,l=s||o&&e.anchor||"right";function c(){return"left"===l?0:"center"===l?.5:1}function d(e,n=t(!s),o=320,r=220){return e.width=Math.min(n.width,Math.max(Math.min(o,n.width),e.width)),e.height=Math.min(n.height,Math.max(Math.min(r,n.height),e.height)),e.x=Math.max(n.left,Math.min(n.right-e.width,e.x)),e.y=Math.max(n.top,Math.min(n.bottom-e.height,e.y)),e}function u(e){if(!s)return e;const n=t();return e.x="left"===s?n.left:"center"===s?n.left+(n.width-e.width)/2:n.right-e.width,e.y=n.bottom-e.height,e}return{area:t,compactRect:function(){return u(d({...a}))},launcherRect:function(e){return u(d({...e,x:a.x+(a.width-e.width)*c(),y:a.y+a.height-e.height},t(!s),1,1))},usableEdge:function(e){return!(s&&(e.includes("s")||"left"===s&&e.includes("w")||"right"===s&&e.includes("e")))},get anchor(){return l},get anchorFactor(){return c()},get dock(){return s},get expanded(){return r},get layout(){return{bounds:{...a},dock:s,anchor:l,expanded:r}},toggleExpanded(){r=!r},dockTo:function(e="right",t=!1){t&&Object.assign(a,i),r=!1,l=s=e},resize(e,n,o,r){Object.assign(a,function(e,n,o,r){const i=t(!s),a=n.includes("e")||n.includes("w"),c=n.includes("n")||n.includes("s"),d=function(e){return"center"===l?.5:e.includes("w")?1:0}(n),u=e.x+e.width*d,f=n.includes("n"),p=e.y+(f?e.height:0),m=function(e,t,n){return 0===n?e.right-t:1===n?t-e.left:2*Math.min(t-e.left,e.right-t)}(i,u,d),h=f?p-i.top:i.bottom-p,g=(n.includes("w")?-o:o)*(.5===d?2:1),w=Math.max(Math.min(320,m),Math.min(m,e.width+g)),v=Math.max(Math.min(220,h),Math.min(h,e.height+(f?-r:r))),y=a&&0!==o&&w!==e.width,b=c&&0!==r&&v!==e.height,x=f?p-v:p;return{x:y?u-w*d:e.preferredBounds.x,y:b?x:e.preferredBounds.y,width:y?w:e.preferredBounds.width,height:b?v:e.preferredBounds.height}}(e,n,o,r))},move:function(e,n,o,r=!1){const i=d({...e,x:e.x+n,y:e.y+o},t(!0),r?1:320,r?1:220);a.x=i.x+(r?(i.width-a.width)*c():0),a.y=i.y+(r?i.height-a.height:0),s=null}}}function p(t,{postTitle:o="",publicRedirect:r,inlineLauncher:i,nativeLauncher:c,canRememberVisibility:d=!0,onOpen:p,onClose:m,onRefresh:h,onRetry:g,beforeMove:w,afterMove:v,beforeViewportChange:y}){const b=window,x=document,P="meet-the-frontend-live-preview-panel",M=(0,n.select)(a.store),E=(0,n.dispatch)(a.store),k="width"===M.get(P,"fit")?"width":"automatic";E.setDefaults(P,{rememberVisibility:!0,rememberPosition:!0,panelOpen:!0,scrollToChanges:!0,viewport:"desktop",fitMode:k,customZoom:100,tabletOrientation:"portrait",mobileOrientation:"portrait"});const C=()=>!i&&(!c||c.fallbackMedia.matches);let S=!1!==M.get(P,"rememberVisibility"),L=!1!==M.get(P,"rememberPosition"),T=!1!==M.get(P,"scrollToChanges");const V=i?.parentElement??x.getElementById("mtflpp-toggle"),O=x.getElementById("mtflpp-panel");if(!V||!O)throw new Error("Preview panel markup is missing.");const j=i||function(t){let n;const{title:o,moveHelp:r}=t.dataset;return(0,e.flushSync)(()=>(0,e.createRoot)(t).render((0,e.createElement)(s.Button,{ref:e=>{n=e},variant:"secondary",label:o,title:o,description:r,"aria-controls":"mtflpp-panel","aria-expanded":!1},(0,e.createElement)("span",{className:"mtflpp-launcher-label"},o)))),n}(V),R=O.querySelector(".mtflpp-move-control"),A=O.querySelector(".mtflpp-resize"),H=O.querySelectorAll("[data-resize-edge]"),_=O.querySelector(".mtflpp-header"),F=O.querySelector(".mtflpp-caption"),N=O.querySelector(".mtflpp-viewport"),$=O.querySelector(".mtflpp-canvas"),D=O.querySelector(".mtflpp-stage"),B=O.querySelector(".mtflpp-empty"),q=O.querySelector(".mtflpp-devicebar"),W=O.querySelector(".mtflpp-dimensions"),I=O.querySelector(".mtflpp-feedback"),z=O.querySelector('[role="status"]');let Z;const J=function(e,t,n,o={},r=()=>{},i={desktop:"Desktop",tablet:"Tablet",mobile:"Phone"}){const a=e.ownerDocument.defaultView,s=e.querySelector(".mtflpp-canvas"),l=e.querySelector(".mtflpp-canvas-space"),c=n.querySelector(".mtflpp-dimensions-text"),d={desktop:[1280,800],tablet:[768,1024],mobile:[390,844]},u=Object.keys(d);let f=u.includes(o.device)?o.device:"desktop";const p=["automatic","window","width","custom"];let m=p.includes(o.fit)?o.fit:"automatic";const h=e=>Number.isInteger(e)&&e>=10&&e<=400;let g,w=h(o.customZoom)?o.customZoom:100,v=100;const y=e=>"desktop"===e?"landscape":"portrait",b=Object.fromEntries(u.map(e=>[e,"desktop"!==e&&["portrait","landscape"].includes(o[`${e}Orientation`])?o[`${e}Orientation`]:y(e)])),x=()=>b[f]===y(f)?d[f]:[...d[f]].reverse(),P=()=>"width"===m;let M,E,k;const C=a.matchMedia("(prefers-reduced-motion: no-preference)");function S(){const t=e.ownerDocument.defaultView.devicePixelRatio;return Number.isFinite(t)&&t>0?t:1}function L(e,t){if("custom"===m)return w/100/S();const n=s.clientWidth/e;if(P())return n;const o=Math.min(n,s.clientHeight/t);return"automatic"===m?Math.min(1/S(),o):o}function T(e,n){M=e;const[o,r]=x(),i=Math.max(0,(s.clientWidth-o*M)/2),a=Math.max(0,(s.clientHeight-r*M)/2);Object.assign(l.style,{width:`${Math.max(s.clientWidth,i+o*M)}px`,height:`${Math.max(s.clientHeight,a+r*M)}px`}),Object.assign(t.style,{left:`${i}px`,top:`${a}px`,transform:`scale(${M})`});const c=o*M>s.clientWidth+.01||r*M>s.clientHeight+.01,d="custom"===m||P();s.tabIndex=d&&c?0:-1,s.scrollLeft="custom"===m?n.x*M:0,s.scrollTop=d?n.y*M:0}function V(){if(!E)return;const e=E;E=null,e.window.cancelAnimationFrame(e.frame),e.resolve?.()}function O(e,t,n,o){return t<=0||o&&e<-1&&t<n?Math.max(e,t-n):e>=n||o&&e>0&&t>n+1?Math.min(e,t-n):0}function j(o=!1,a=!1){V();const[l,d]=x();if(Object.assign(t.style,{width:`${l}px`,height:`${d}px`}),!e.clientWidth||!e.clientHeight)return;const u=S(),p=`${i[f]} (${l} × ${d}) · `,h=Math.max(400,Math.ceil(e.clientWidth/l*u*100)),y=`${p}${"0".repeat(String(h).length)}%`;n.dataset.reserve!==y&&(n.dataset.reserve=y);const b=a?{x:0,y:0}:{x:(s.scrollLeft||0)/(M||1),y:(s.scrollTop||0)/(M||1)};if(s.style.overflowX="hidden",s.style.overflowY="hidden","custom"===m){const e=L(l,d);for(let t=0;t<2;t++)l*e>s.clientWidth+.01&&(s.style.overflowX="scroll"),d*e>s.clientHeight+.01&&(s.style.overflowY="scroll")}else P()&&d*L(l,d)>e.clientHeight&&(s.style.overflowY="scroll");if(!s.clientWidth||!s.clientHeight)return;const k=L(l,d),O=Math.round(k*u*100),j=O!==v||u!==g;v=O,g=u;const R=`${p}${"custom"===m?w:v}%`;c.textContent!==R&&(c.textContent=R),j&&r();const A=M??k;if(!o||!C.matches||A===k)return void T(k,b);const H={window:e.ownerDocument.defaultView,frame:null},_=H.window.performance.now();E=H;const F=e=>{T(e,b),H.scrollLeft=s.scrollLeft,H.scrollTop=s.scrollTop};F(A);const N=e=>{if(E!==H)return;const t=Math.min(1,Math.max(0,(e-_)/200));F(A+(k-A)*(1-(1-t)**3)),t<1?H.frame=H.window.requestAnimationFrame(N):V()};H.frame=H.window.requestAnimationFrame(N)}function R(){j()}function A(){k?.();const t=e.ownerDocument.defaultView.matchMedia(`(resolution: ${S()}dppx)`);t.addEventListener("change",A),k=()=>t.removeEventListener("change",A),R()}let H=new a.ResizeObserver(R);return H.observe(e),C.addEventListener("change",R),a.addEventListener("resize",A),A(),{get device(){return f},get fit(){return m},get customZoom(){return w},get zoomPercent(){return"custom"===m?w:v},get dpr(){return S()},get orientation(){return b[f]},canvasTarget:function(e,t,{fitTarget:n=!1}={}){const o=e.getBoundingClientRect(),r=s.getBoundingClientRect(),i=o.left-r.left-s.clientLeft,a=o.top-r.top-s.clientTop,l=O(i+t.left*M,i+t.right*M,s.clientWidth,n),c=O(a+t.top*M,a+t.bottom*M,s.clientHeight,n),d=Math.max(t.left,-i/M),u=Math.min(t.right,(s.clientWidth-i)/M);return{visible:!l&&!c,visibleCenterX:d<u?(d+u)/2:void 0,distance:Math.hypot(l,c),reveal(e="instant"){(l||c)&&s.scrollBy({left:l,top:c,behavior:e})}}},canvasWasPanned:function(){return!!E&&(s.scrollLeft!==E.scrollLeft||s.scrollTop!==E.scrollTop)},whenSettled:function(){if(!E)return;const e=E;return e.done??=new Promise(t=>{e.resolve=t}),e.done},finishMotion(){E&&R()},select(e,{animate:t=!1,keepPan:n=!1}={}){if(!u.includes(e))return;const o=f!==e;f=e,o?j(t,!n):E||R()},rotate({animate:e=!1,keepPan:t=!1}={}){"desktop"!==f&&(b[f]="portrait"===b[f]?"landscape":"portrait",j(e,!t))},setFit(e){p.includes(e)&&m!==e&&(m=e,j(!1,!0))},setZoom(e){if(!h(e)||"custom"===m&&w===e)return;const t="custom"!==m;w=e,m="custom",j(!1,t)},layout:R,beforeMove(){V(),H.disconnect(),k?.(),e.ownerDocument.defaultView.removeEventListener("resize",A)},afterMove(){H=new e.ownerDocument.defaultView.ResizeObserver(R),H.observe(e),e.ownerDocument.defaultView.addEventListener("resize",A),A()}}}(N,D,W,{device:M.get(P,"viewport"),fit:M.get(P,"fitMode")??k,customZoom:M.get(P,"customZoom"),tabletOrientation:M.get(P,"tabletOrientation"),mobileOrientation:M.get(P,"mobileOrientation")},()=>Ce(),t),U=x.querySelector("#wpbody-content > .wrap"),G=x.getElementById("wpadminbar");function X(e=!1){const t=Math.max(1,x.documentElement.clientWidth),n=Math.max(1,x.documentElement.clientHeight),o=x.documentElement.getBoundingClientRect().left+b.scrollX,r=!e&&U?.getBoundingClientRect(),i=r?Math.max(0,"rtl"===b.getComputedStyle(U).direction?r.left-o:o+t-r.right):20,a=e?0:i,s=Math.min(a,(t-1)/2),l=Math.min(Math.max(0,G?.getBoundingClientRect().bottom||0)+a,n-1),c=t-s,d=n-Math.min(a,n-l-1);return{left:s,top:l,right:c,bottom:d,width:c-s,height:d-l}}let Y,K=d&&(!S||!1!==M.get(P,"panelOpen"));const Q=M.get(P,"layout"),ee=M.get(P,"position")??Q?.dock??Q?.anchor;let te=["left","center","right"].includes(ee)?ee:"right";const ne=f(L?Q:void 0,X,te),{compactRect:oe,usableEdge:re}=ne;let ie,ae=!1,se="",le=!1,ce={text:t.loading,state:"loading",hasPreview:!1,canRetry:!1,reason:""},de=!1;function ue(e){const n="string"==typeof e?e.replace(/\s+/g," ").trim():"";F.textContent=n?`${t.preview} — ${n}`:t.title,F.title=F.textContent,Y&&(Y.document.title=F.textContent)}function fe(){const{text:e,state:n,hasPreview:o,reason:r}=ce;return"handover"===n?{heading:t.switchingPreview,description:e,note:t.tabEdits}:"conflict"===n?{heading:e,description:{"handed-off":t.handedOffHelp,busy:t.takeoverTimeoutHelp,manual:t.closeOtherHelp}[r]||t.conflictHelp,note:"manual"===r?t.manualSwitchHint:t.tabEdits}:"paused"===n?{heading:t.pausedTitle,description:e,note:""}:"error"===n?function(){const{text:e,hasPreview:n,canRetry:o,reason:r}=ce;if("origin-mismatch"===r)return{heading:t.originMismatchTitle,description:n?`${e} ${t.previousPreview}`:e,note:""};if("unavailable"===r||"browser"===r)return{heading:"unavailable"===r?t.unavailableTitle:t.browserTitle,description:e,note:""};if(!n){let n=e;return e===t.failed&&(n=o?t.failedHelp:""),"reload"===r&&(n+=` ${t.reviewBeforeReload}`),{heading:t.failed,description:n,note:""}}return{heading:e===t.failed?t.refreshFailed:e,description:"reload"===r?t.reviewBeforeReload:t.previousPreview,note:""}}():o?{heading:e,description:"",note:""}:{heading:t.loading,description:t.preparing,note:""}}function pe(){return ae?"handover"===ce.state?t.takingOver:t.takeOver:t.retry}function me(e){return!e||["handover","paused"].includes(ce.state)?"info":"error"!==ce.state||ce.canRetry?"warning":"error"}function he(){return ce.redirectDestination?`${t.redirected} ${ce.redirectDestination}`:ce.hasHtmlPreview&&ie?`${t.publicRedirected} ${ie}`:""}function ge(){const{state:e,hasPreview:n,canRetry:o,reason:r}=ce,i=n&&["error","conflict","handover","paused"].includes(e),a=!n||i||se?"":he();if(I.hidden=!i&&!se&&!a,I.tabIndex=I.hidden?-1:0,O.dataset.hasFeedback=String(!I.hidden),I.hidden)return null;if(a)return{heading:a,status:"info",dismissible:!1};const{heading:s,description:l}=fe();return{heading:i?s:se,description:i?l:t.windowNoticeHelp,status:me(i),dismissible:!i,retry:i&&(ae||o&&["error","conflict"].includes(e)),close:i&&"error"===e&&!o&&"reload"!==r,disabled:"handover"===e,action:pe()}}function we(e){ce.hasPreview&&["error","conflict","handover","paused"].includes(ce.state)||(se=e,Ce()),z.textContent=`${e} ${t.windowNoticeHelp}`}function ve(){se="",Ce()}function ye(e,t="loading",{canTakeOver:n=!1,hasPreview:o=!1,hasHtmlPreview:i=!1,redirectDestination:a,canRefresh:s=!1,canRetry:l=!0,reason:c=""}={}){const d=O.ownerDocument.activeElement,u=O.contains(d),f=!o&&(ce.state!==t||ce.text!==e||ce.reason!==c),p=ce.hasPreview!==o;ce={text:e,state:t,canTakeOver:n,hasPreview:o,hasHtmlPreview:i,redirectDestination:a,canRefresh:s,canRetry:l,reason:c},["error","conflict","handover","paused"].includes(t)&&(se=""),O.dataset.state=t,O.dataset.hasPreview=String(o),ae=n&&["conflict","handover"].includes(t),B.hidden=o,q.hidden=!o;const{heading:m,description:h,note:g}=fe();f&&(B.scrollTop=0);const w="ready"!==t||se?"":he();z.textContent=o?[m,h,g,w].filter(Boolean).join(" "):m,Ce(),p&&J.layout(),function(e,t){e&&t&&(!O.contains(e)||e.closest("[hidden]")||e.disabled||!ce.hasPreview&&$.contains(e))&&Z.focus(B.hidden?"actions":"empty-title")}(d,u),K&&"ready"===t&&i&&!a&&async function(){if(r&&!le){le=!0;try{const e=new URL(r.endpoint);if(e.origin!==b.location.origin)return;const t=await b.fetch(e,{credentials:"same-origin",cache:"no-store",redirect:"error",headers:{"X-WP-Nonce":r.nonce}});if(!t.ok)return;const{destination:n}=await t.json();if("string"!=typeof n||!n)return;if(ie=n,!K)return;Ce(),"ready"!==ce.state||!ce.hasHtmlPreview||ce.redirectDestination||se||(z.textContent=he())}catch{}}}()}function be(e){d&&S&&M.get(P,"panelOpen")!==e&&E.set(P,"panelOpen",e)}function xe(){L&&E.set(P,"layout",ne.layout)}function Pe(){const e=V.hidden;V.hidden=!1,V.style.maxWidth=`${X(!ne.dock).width}px`;const t={width:V.offsetWidth,height:V.offsetHeight};return V.hidden=e,ne.launcherRect(t)}function Me(){if(Y)return;if(!K&&C()){const e=Pe(),t=ne.anchorFactor;Object.assign(V.style,{left:`${e.x+e.width*t}px`,top:`${e.y+e.height}px`,transform:`translate(${-100*t}%, -100%)`})}let e=oe();if(O.dataset.anchor=ne.anchor,ne.expanded){const t=X();e={x:t.left,y:t.top,width:t.width,height:t.height}}Object.assign(O.style,{left:`${e.x}px`,top:`${e.y}px`,width:`${e.width}px`,height:`${e.height}px`,transform:""})}function Ee(e="right",t=!1){ne.dockTo(e,t),te=e,E.set(P,"position",te),Me(),xe(),Ce()}function ke(){return"function"==typeof b.documentPictureInPicture?.requestWindow}function Ce(){if(!Z)return;const e=O.ownerDocument.fullscreenElement===O,n=!Y&&!e,o=n&&!ne.expanded;O.classList.toggle("mtflpp-expanded",ne.expanded),A.hidden=!o;for(const e of H)e.hidden=!o||!re(e.dataset.resizeEdge);const r=ae||ce.canRetry&&["error","conflict"].includes(ce.state);var i;Z.update({inPage:n,inPip:!!Y,movable:o,dock:ne.dock,canRememberVisibility:d,rememberVisibility:S,rememberPosition:L,followChanges:T,device:J.device,busy:ce.hasPreview&&["stale","loading","handover"].includes(ce.state)&&ce.text!==t.saving,empty:ce.hasPreview?null:{...fe(),busy:["loading","stale","ready","handover"].includes(ce.state),icon:["paused","conflict"].includes(ce.state)||["unavailable","browser","origin-mismatch"].includes(ce.reason)?"info":"warning",retry:r,disabled:"handover"===ce.state,close:"error"===ce.state&&!r,action:pe()},notice:ge(),fit:J.fit,orientation:J.orientation,customZoom:J.customZoom,zoomPercent:J.zoomPercent,dpr:J.dpr,canRefresh:ce.canRefresh,hasPreview:ce.hasPreview,canPip:n&&ke(),canFullscreen:n&&!!x.fullscreenEnabled,mode:e||ne.expanded?"compact":"expand",modeLabel:(i=e,i?t.exitFullscreen:ne.expanded?t.compact:t.expand)})}function Se(){Z.closeMenu(),Y?Y.close():x.fullscreenElement!==O?(ne.toggleExpanded(),Me(),xe(),Ce(),Z.focus("mode")):x.exitFullscreen().then(ve,()=>we(t.fullscreenFailed))}function Le(e,n=!1,o){const r=e===j,i=e===_,a=()=>o||("left"===ne.anchor?"ne":"nw"),s=()=>Y||!r&&ne.expanded||x.fullscreenElement===O||n&&!re(a());let l,c;const d=()=>({...r?Pe():oe(),preferredBounds:ne.layout.bounds});function u(){if(c=null,l)if(n||r)Me();else{const e=oe(),t=e.x-parseFloat(O.style.left),n=e.y-parseFloat(O.style.top);Object.assign(O.style,{width:`${e.width}px`,height:`${e.height}px`,transform:`translate3d(${t}px, ${n}px, 0)`})}}function f(){if(!l)return;const{pointer:t,moved:n}=l;l=null,b.cancelAnimationFrame(c),e.hasPointerCapture(t)&&e.releasePointerCapture(t),O.classList.remove("mtflpp-dragging"),e.classList.remove("mtflpp-edge-active"),x.documentElement.classList.remove("mtflpp-window-dragging"),x.documentElement.style.removeProperty("--mtflpp-drag-cursor"),Me(),n&&(r&&(de=!0),xe(),Ce())}e.addEventListener("pointerdown",t=>{0!==t.button||s()||i&&t.target.closest('button, a, [role="button"]')||(r&&(de=!1),t.preventDefault(),r?j.focus({preventScroll:!0}):e===R&&Z.focus("move"),Z.closeMenu(),l={...d(),pointer:t.pointerId,pointerX:t.clientX,pointerY:t.clientY},e.setPointerCapture(t.pointerId))}),e.addEventListener("pointermove",t=>{if(!l||l.pointer!==t.pointerId)return;const o=t.clientX-l.pointerX,i=t.clientY-l.pointerY;!l.moved&&Math.abs(o)+Math.abs(i)<4||(l.moved=!0,O.classList.add("mtflpp-dragging"),n&&e.classList.add("mtflpp-edge-active"),x.documentElement.style.setProperty("--mtflpp-drag-cursor",n?b.getComputedStyle(e).cursor:"grabbing"),x.documentElement.classList.add("mtflpp-window-dragging"),n?ne.resize(l,a(),o,i):ne.move(l,o,i,r),c||(c=b.requestAnimationFrame(u)))});for(const t of["pointerup","pointercancel","lostpointercapture"])e.addEventListener(t,f);b.addEventListener("blur",f),i||o||e.addEventListener("keydown",e=>{const o={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[e.key];if(!o||e.altKey||e.ctrlKey||e.metaKey||s())return;e.preventDefault(),Z.closeMenu();const i=d(),l=e.shiftKey?40:10;n?ne.resize(i,a(),o[0]*l,o[1]*l):ne.move(i,o[0]*l,o[1]*l,r),Me(),xe(),Ce();const c=oe();z.textContent=n?`${t.resize}: ${Math.round(c.width)} × ${Math.round(c.height)}`:t.moved})}ue(o),_.addEventListener("dblclick",e=>{Y||e.target.closest("button, a")||Se()}),x.addEventListener("fullscreenchange",Ce),A.addEventListener("keydown",e=>{"Escape"===e.key&&A.classList.add("mtflpp-help-dismissed")}),A.addEventListener("blur",()=>A.classList.remove("mtflpp-help-dismissed")),Le(R),Le(_),i||Le(j),Le(A,!0);for(const e of H)Le(e,!0,e.dataset.resizeEdge);function Te(){O.hidden=!K,V.hidden=!i&&(K||!C()),j.setAttribute("aria-expanded",String(K))}function Ve(e=!0){K?Z.focus("actions"):(be(!0),p(),K&&e&&Z.focus("actions"))}return b.addEventListener("resize",Me),b.addEventListener("scroll",Me,{passive:!0}),c?.fallbackMedia.addEventListener("change",()=>{Me(),Te()}),j.addEventListener("click",e=>{if(de&&0!==e.detail)return de=!1,void e.preventDefault();de=!1,Ve(0===e.detail)}),Z=function(t,o,r){const i=t.querySelector(".mtflpp-controls"),a=t.querySelector(".mtflpp-refresh-control"),c=t.querySelector(".mtflpp-move-control"),d=t.querySelector(".mtflpp-device-controls"),f=t.querySelector(".mtflpp-fit-control"),p=t.querySelector(".mtflpp-pip-control"),m=t.querySelector(".mtflpp-empty"),h=t.querySelector(".mtflpp-feedback");let g,w=(0,e.createRoot)(i),v=!1,y=!1,b=!1;const x=l.InlineNotices?(0,n.dispatch)(l.store):null,P=t.ownerDocument.defaultView?.wp?.theme?.ThemeProvider,M="meet-the-frontend-live-preview-panel",E="preview-feedback";let k="";function C(){const e=g.notice,t=/[.!?…。!?]$/.test(e.heading)?e.heading:`${e.heading}.`;return{message:e.description?`${t} ${e.description}`:e.heading,status:e.status,isDismissible:e.dismissible,actions:[...e.retry?[{label:e.action,disabled:e.disabled,onClick:r.retry}]:[],...e.close?[{label:o.close,onClick:r.close}]:[]]}}function S(){x&&k&&x.removeNotice(E,M),k=""}function L(e){return()=>{O(),e()}}function T(){const{inPage:n,inPip:i,mode:w,modeLabel:E,movable:k,busy:S,canRefresh:T,hasPreview:j,canPip:R}=g;return(0,e.createElement)(s.SlotFillProvider,null,(0,e.createPortal)(k&&n&&(0,e.createElement)(s.Button,{className:"mtflpp-icon mtflpp-move",size:"compact",icon:u.move,label:o.move,showTooltip:!0,tooltipPosition:"bottom","data-action":"move"}),c),(0,e.createPortal)((0,e.createElement)(s.Button,{className:"mtflpp-icon",size:"compact",icon:S?(0,e.createElement)(s.Spinner):u.refresh,label:o.refresh,showTooltip:!0,accessibleWhenDisabled:!0,disabled:!T,onClick:r.refresh,"data-action":"refresh"}),a),(0,e.createPortal)(R&&j&&(0,e.createElement)("div",{className:"mtflpp-pip-surface"},(0,e.createElement)(s.Button,{className:"mtflpp-pip-button",icon:u.pip,label:o.popOutHelp,"aria-label":o.popOut,description:o.popOutHelp,showTooltip:!0,onClick:r.popOut,"data-action":"pop-out"})),p),function(){const{canPip:t,canFullscreen:n,inPage:i,inPip:a,dock:l,canRememberVisibility:c,rememberVisibility:d,rememberPosition:f,followChanges:p}=g;return(0,e.createElement)(s.DropdownMenu,{className:"mtflpp-actions",label:o.actions,icon:u.more,open:v,onToggle(e){v=e,e&&(y=!1),V()},toggleProps:{className:"mtflpp-icon",size:"compact","data-action":"actions"},popoverProps:{placement:"bottom-end",offset:6,shift:!0,className:"mtflpp-menu-popover"}},()=>(0,e.createElement)(e.Fragment,null,(t||n)&&(0,e.createElement)(s.MenuGroup,{label:o.display},t&&(0,e.createElement)(s.MenuItem,{label:o.popOutHelp,description:o.popOutHelp,showTooltip:!0,onClick:L(r.popOut),"data-action":"pip","aria-label":o.popOut},o.popOut),n&&(0,e.createElement)(s.MenuItem,{onClick:L(r.fullscreen),"data-action":"fullscreen"},o.fullscreen)),i&&(0,e.createElement)(s.MenuGroup,{label:o.position},(0,e.createElement)(s.MenuItemsChoice,{value:l,choices:[{value:"left",label:o.bottomLeft},{value:"center",label:o.bottomCenter},{value:"right",label:o.bottomRight}],onSelect(e){O(),r.dock(e)}})),(0,e.createElement)(s.MenuGroup,{label:o.preferences},!1!==c&&(0,e.createElement)(s.MenuItem,{role:"menuitemcheckbox",isSelected:d,icon:d?u.check:void 0,info:o.rememberVisibilityHelp,onClick:L(r.rememberVisibility),"data-action":"remember-visibility"},o.rememberVisibility),(0,e.createElement)(s.MenuItem,{role:"menuitemcheckbox",isSelected:f,icon:f?u.check:void 0,info:o.rememberPositionHelp,onClick:L(r.rememberPosition),"data-action":"remember-position"},o.rememberPosition),(0,e.createElement)(s.MenuItem,{role:"menuitemcheckbox",isSelected:p,icon:p?u.check:void 0,info:o.followHelp,onClick:L(r.follow),"data-action":"follow"},o.follow)),i&&(0,e.createElement)(s.MenuGroup,null,(0,e.createElement)(s.MenuItem,{info:o.resetHelp,onClick:L(r.reset),"data-action":"reset"},o.reset)),a&&(0,e.createElement)(s.MenuGroup,null,(0,e.createElement)(s.MenuItem,{onClick:L(r.close),"data-action":"close"},o.closeLivePreview))))}(),!i&&(0,e.createElement)(s.Button,{className:"mtflpp-icon mtflpp-mode",size:"compact",icon:u[w],label:E,showTooltip:!0,onClick:r.mode,"data-action":"mode"}),!i&&(0,e.createElement)(s.Button,{className:"mtflpp-icon",size:"compact",icon:u.close,label:o.close,showTooltip:!0,onClick:r.close,"data-action":"close"}),(0,e.createPortal)(function(){const{device:t,orientation:n}=g;return(0,e.createElement)(s.Toolbar,{className:"mtflpp-devices",label:o.viewport,variant:"unstyled"},...["desktop","tablet","mobile"].map(i=>{const a=t===i,l=a&&"desktop"!==i,c=l&&"landscape"===n,d="portrait"===n?o.rotateLandscape:o.rotatePortrait;return(0,e.createElement)(s.ToolbarButton,{key:i,icon:u[i],className:c?"mtflpp-device-rotated":void 0,label:l?`${o[i]} — ${d}`:o[i],isPressed:a,"data-viewport":i,onClick:()=>r.device(i)})}))}(),d),(0,e.createPortal)(function(){const{fit:t,customZoom:n=100,dpr:i=1}=g,a={automatic:o.automatic,window:o.fitToWindow,width:o.fitToWidth},l={automatic:o.automaticHelp,window:o.fitToWindowHelp,width:o.fitToWidthHelp},c="custom"===t?o.fixedZoom:a[t]??o.automatic;return(0,e.createElement)(s.Dropdown,{open:y,onToggle(e){y=e,e&&(v=!1,b="custom"===g.fit),V()},contentClassName:"mtflpp-zoom-popover",focusOnMount:"firstElement",popoverProps:{placement:"top-end",offset:8,shift:!0,resize:!1,role:"dialog","aria-label":o.fitting},renderToggle:({isOpen:t,onToggle:n})=>(0,e.createElement)(s.Button,{className:"mtflpp-zoom-toggle",variant:"secondary",size:"compact",label:c,showTooltip:!0,"aria-label":`${o.fitting}: ${c}`,"aria-haspopup":"dialog","aria-expanded":t,onClick:n,"data-action":"zoom"},(0,e.createElement)("span",{className:"mtflpp-zoom-value"},c),u.chevron),renderContent:()=>(0,e.createElement)("div",{className:"mtflpp-zoom-content"},(0,e.createElement)(s.RadioControl,{label:o.zoomMode,selected:t,options:[...Object.entries(a).map(([e,t])=>({value:e,label:t,description:l[e]})),{value:"custom",label:o.fixedZoom,description:o.fixedZoomHelp}],onFocus(e){if(!b)return;b=!1;const t=e.currentTarget.closest(".mtflpp-zoom-content")?.querySelector('.mtflpp-custom-zoom input[type="number"]');t?.focus({preventScroll:!0});const n=t?.closest(".components-popover__content");if(n){const e=t.getBoundingClientRect(),o=n.getBoundingClientRect();n.scrollTop+=Math.min(0,e.top-o.top)+Math.max(0,e.bottom-o.bottom)}},onChange(e){b=!1,"custom"!==e?r.fit(e):r.zoom(n)}}),"custom"===t&&(0,e.createElement)("div",{className:"mtflpp-custom-zoom",onKeyDown(e){if("Enter"!==e.key)return;e.preventDefault();const t=Number(e.target.value);!1!==e.target.validity?.valid&&Number.isInteger(t)&&t>=10&&t<=400&&O()}},(0,e.createElement)(s.RangeControl,{label:o.customZoom,min:10,max:400,step:1,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:n,help:o.customZoomHelp,withInputField:!0,onChange(e){Number.isInteger(e)&&e>=10&&e<=400&&r.zoom(e)}})),(0,e.createElement)("div",{className:"mtflpp-dpr-note",role:"group","aria-label":o.displayInformation},(0,e.createElement)("span",{className:"mtflpp-dpr-value"},`${o.displayDpr}: ${Number(i.toFixed(2))}`),(0,e.createElement)("span",{className:"mtflpp-pixel-note"},o.pixelZoomHelp)))})}(),f),(0,e.createPortal)(function(){const{empty:t}=g;return t?(0,e.createElement)(s.Placeholder,{className:"mtflpp-placeholder","data-empty-icon":t.busy?void 0:t.icon,icon:t.busy?(0,e.createElement)(s.Spinner):u[t.icon],label:(0,e.createElement)("h3",{className:"mtflpp-empty-title",tabIndex:-1,"data-action":"empty-title"},t.heading),instructions:t.description},t.retry&&(0,e.createElement)(s.Button,{key:"retry",variant:"primary",disabled:t.disabled,onClick:r.retry,"data-action":"retry"},t.action),t.close&&(0,e.createElement)(s.Button,{key:"close",variant:"secondary",onClick:r.close,"data-action":"close"},o.close),t.note&&(0,e.createElement)("p",{className:"mtflpp-empty-note"},t.note)):null}(),m),(0,e.createPortal)(function(){if(!g.notice)return null;if(x){const t=(0,e.createElement)(l.InlineNotices,{context:M,className:"mtflpp-inline-notices"});return P?(0,e.createElement)(P,{cornerRadius:"none"},t):t}const{message:t,...n}=C();return(0,e.createElement)(s.Notice,{...n,onRemove:r.dismissNotice,spokenMessage:"",politeness:"polite"},t)}(),h),n?(0,e.createPortal)((0,e.createElement)(s.Popover.Slot),t.ownerDocument.body):(0,e.createElement)(s.Popover.Slot))}function V(){g&&w&&(function(){if(!x)return;if(!g.notice)return void S();const e=JSON.stringify(g.notice);if(k===e)return;const{message:t,status:n,...o}=C();x.createNotice(n,t,{...o,id:E,context:M,speak:!1,onDismiss:r.dismissNotice}),k=e}(),(0,e.flushSync)(()=>w.render((0,e.createElement)(T))))}function O(){(v||y)&&(v=!1,y=!1,V())}function j(e){g?.inPip&&"mode"===e&&(e="actions"),t.querySelector(`[data-action="${e}"]`)?.focus({preventScroll:!0})}return{update(e){const n=y&&!e.hasPreview&&t.ownerDocument.activeElement?.closest(".mtflpp-zoom-popover");e.hasPreview||(y=!1),g=e,V(),n&&j("empty-title")},closeMenu:O,focus:j,beforeMove(){v=!1,y=!1,w?.unmount(),w=null,S()},remount(){w=(0,e.createRoot)(i),V()}}}(O,t,{refresh:()=>{ce.canRefresh&&h()},retry:()=>{"handover"!==ce.state&&(ae||ce.canRetry&&["error","conflict"].includes(ce.state))&&g(ae)},dismissNotice:()=>{ve(),z.textContent=ce.text,Z.focus("actions")},mode:Se,close:function(){Z.closeMenu(),be(!1),m(),i||C()?j.focus():c.focus()},popOut:async function(){if(Y||x.fullscreenElement===O||!ke())return;let e;Z.closeMenu();const n=()=>{Y===e&&(w(),J.beforeMove(),Z.beforeMove(),x.body.append(O),O.classList.remove("mtflpp-pip"),Y=null,Z.remount(),Me(),J.afterMove(),Ce(),v(),K&&Z.focus("mode"))};try{if(e=await b.documentPictureInPicture.requestWindow({width:640,height:440}),!K)return void e.close();const t=b.getComputedStyle(O);e.document.documentElement.lang=x.documentElement.lang,e.document.documentElement.dir=t.direction;for(const n of["--wp-admin-theme-color","--wp-admin-theme-color-darker-10","--wp-admin-border-width-focus"]){const o=t.getPropertyValue(n);o&&e.document.documentElement.style.setProperty(n,o)}const o=x.querySelectorAll(['link[rel="stylesheet"][href*="/load-styles.php"]',"#wp-theme-css","#wp-theme-inline-css","#wp-components-css","#wp-components-inline-css","style[data-emotion]","style[data-wp-hash]","#meet-the-frontend-live-preview-panel-css","#meet-the-frontend-live-preview-panel-inline-css"].join(", "));for(const t of o){const n=t.cloneNode(!0);"STYLE"===t.tagName&&t.sheet&&(n.textContent=Array.from(t.sheet.cssRules,e=>e.cssText).join("\n")),n.addEventListener("load",J.layout,{once:!0}),e.document.head.append(n)}e.document.title=F.textContent,e.document.body.className="mtflpp-pip-document",e.addEventListener("resize",J.layout),e.addEventListener("pagehide",n,{once:!0}),Y=e,w(),J.beforeMove(),Z.beforeMove(),O.classList.add("mtflpp-pip"),e.document.body.append(O),Z.remount(),J.afterMove(),Ce(),ve(),Z.focus("mode"),v()}catch{e&&(n(),e.close()),Z.focus("actions"),we(t.pipFailed)}},fullscreen:async function(){if(!Y&&x.fullscreenEnabled){Z.closeMenu();try{await O.requestFullscreen(),ve(),Z.focus("mode")}catch{Z.focus("actions"),we(t.fullscreenFailed)}}},dock:e=>Ee(e),reset:()=>Ee("right",!0),follow:function(){T=!T,E.set(P,"scrollToChanges",T),Ce(),T&&ce.canRefresh&&h(!1)},rememberVisibility:function(){S=!S,E.set(P,"rememberVisibility",S),S&&be(K),Ce()},rememberPosition:function(){L=!L,E.set(P,"rememberPosition",L),L?xe():(E.set(P,"position",te),E.set(P,"layout",void 0)),Ce()},device(e){const t=J.device;if(e===t&&"desktop"===e)return;let n=!1;if(K&&T&&y){const{fit:e,customZoom:t,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:a}=J;n=!!y({canvas:$,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:a,canFollow:()=>J.fit===e&&J.customZoom===t})}const o={animate:K&&!n,keepPan:n};e===t?(J.rotate(o),E.set(P,`${e}Orientation`,J.orientation)):(J.select(e,o),J.device!==t&&E.set(P,"viewport",J.device)),Ce()},fit(e){const t=J.fit;J.setFit(e),J.fit!==t&&E.set(P,"fitMode",J.fit),Ce()},zoom(e){const t=J.fit,n=J.customZoom;J.setZoom(e),J.customZoom!==n&&E.set(P,"customZoom",J.customZoom),J.fit!==t&&E.set(P,"fitMode",J.fit),Ce()}}),ye(t.loading,"loading",{canRetry:!1}),Me(),Te(),i&&(i.disabled=!1),{stage:D,canvasTarget:J.canvasTarget,get visible(){return K},get followChanges(){return T},openFromLauncher:Ve,setVisible(e){e||(Z.closeMenu(),se="",Ce(),J.layout()),K=e,Me(),Te()},report:ye,setTitle:ue,clearPreview(){D.replaceChildren();const e=["ready","stale","loading"].includes(ce.state);ye(e?t.loading:ce.text,e?"loading":ce.state,{...ce,hasPreview:!1,hasHtmlPreview:!1,redirectDestination:void 0,canRefresh:!1,canRetry:!e&&ce.canRetry})},returnToEditor(){Z.closeMenu(),Y?.close(),x.fullscreenElement===O&&x.exitFullscreen().catch(()=>{})}}}function m(e=[]){const t=Array.isArray(e)?[...e]:[],n=new WeakMap;return{capture(e,o){try{if(n.has(e))return;const r=function(e){try{const t=e.querySelector('meta[name="meet-the-frontend-live-preview-panel"]'),n=t?.getAttribute("data-mtflpp-source");if(!n)return null;const o=JSON.parse(n);if("string"!=typeof o)return null;const r=(new DOMParser).parseFromString(o,"text/html");return r.querySelector('meta[name="meet-the-frontend-live-preview-panel"]')?.content===t.content?r:null}catch{return null}}(e);n.set(e,{source:r?v(r,e,t):null,dom:v(e,e,t),values:o&&Object.fromEntries(Object.entries(o).map(([e,t])=>[e,{...t}]))})}catch{}},findChange(e,t){try{const o=n.get(e),r=n.get(t);if(!o||!r)return null;const i=function(e,t){if(!e||!t)return[];const n=[];for(const o of new Set([...Object.keys(e),...Object.keys(t)])){const r=Object.hasOwn(e,o)?e[o]:{type:t[o]?.type,value:""},i=Object.hasOwn(t,o)?t[o]:{type:e[o]?.type,value:""};if(r.type!==i.type||!["text","html"].includes(i.type)||"string"!=typeof r.value||"string"!=typeof i.value||r.value===i.value)continue;let a,s;try{a="html"===r.type?(new DOMParser).parseFromString(r.value,"text/html"):null,s="html"===i.type?(new DOMParser).parseFromString(i.value,"text/html"):null}catch{continue}const l=a?v(a,a,[],a.body):null,c=s?v(s,s,[],s.body):null,d=a?T(l):r.value,u=s?T(c):i.value,f=P(d),p=P(u);if(f!==p&&n.push({...V(f,p),type:"text"}),!a){const e=L(d,u);e&&n.push(e);continue}if(l&&c&&(f===p||M(d,u)))for(const e of x(l,c)){if(e.spacing){const t=S(e);t&&n.push(t);continue}if(f===p)if("attributes"===e.kind){const t=new Map(e.before.attributes),o=new Map(e.after.attributes);for(const e of new Set([...t.keys(),...o.keys()])){const r=t.get(e)??"",i=o.get(e)??"";JSON.stringify(r)!==JSON.stringify(i)&&n.push({type:"attribute",name:e,before:"string"==typeof r?r:JSON.stringify(r),after:"string"==typeof i?i:JSON.stringify(i)})}}else"content"===e.kind&&(P(T(e.before))===P(T(e.after))&&n.push({type:"markup",before:P(T(e.before)),after:P(T(e.after)),oldTag:e.before.tag,newTag:e.after.tag}),(e.before.media||[]).forEach((t,o)=>{const r=e.after.media?.[o];t&&r&&t!==r&&n.push({type:"media",before:t,after:r})}))}}return n}(o.values,r.values),a=function(e,t){if(!e||!t)return!1;const n=(e,t)=>Object.entries(e).some(([e,n])=>"order"!==n?.type&&(!Object.hasOwn(t,e)||n?.type!==t[e]?.type||n?.value!==t[e]?.value));return n(e,t)||n(t,e)}(o.values,r.values),s=!!o.source&&!!r.source,l=!!o.source!=!!r.source,c=[...s?x(o.source,r.source).map(e=>({...e,source:!0})):[],...x(o.dom,r.dom)],d=new Map,u=function(e,t){const n=new Map,o=e=>T(e,n),r=[];for(const n of e){if(n.unresolved)for(const e of h(n,t,o))r.push(e);if("insert"===n.kind&&n.added.length>1){const e=n.added.map(e=>{const r={...n,after:e,added:[e]},i=A(r,t,o);return{...r,input:i}}).filter(e=>e.input);if(e.length){r.push(...e);continue}}const e=A(n,t,o);r.push({...n,input:e})}return r}(c,i).filter(e=>(e.source||!s&&!l||e.input||a&&2===e.priority)&&(e.priority>0||e.input)&&(!e.spacing||function({before:e,after:t},n,o){const r=E(e,n,o),i=E(t,n,o);return r&&i&&r.omitted===i.omitted&&M(r.text,i.text)}(e,d,r.dom?.excluded)));return function(e,t){if(!e.length)return null;const n=e.reduce((e,t)=>Math.max(e,t.input),0),o=e.filter(e=>e.input===n),r=o.reduce((e,t)=>Math.max(e,t.priority),0),i=o.filter(e=>e.priority===r);if(i.some(e=>e.unresolved))return function(e,t){const n=e.find(e=>e.unresolved&&("replacement"===e.regionChange||"reorder"===e.regionChange&&(e.source||t))),o=n?.after.node;if(!o?.isConnected)return null;for(const t of e)if(t.unresolved){if(n.source&&!t.source&&"reorder"===t.regionChange)continue;if(!t.regionChange||t.after.node!==o)return null}else if(!("insert"===t.kind?t.added:[t.after]).every(e=>o.contains(e.node)))return null;return"contents"!==o.ownerDocument.defaultView.getComputedStyle(o).display?o:null}(i,t);const a=i.filter(e=>!e.input||e.directInput||!i.some(t=>t!==e&&e.matches?.length&&e.matches.every(e=>t.matches?.includes(e))&&H(e.after,t.after))),s=new Map,l=a.filter(e=>{const t="delete"===e.kind&&(e.following[0]||e.preceding[0])||e.after,n=t?.node;if(!n)return!0;const o="delete"!==e.kind||e.following.length?e.kind:"delete-last",r=s.get(n)||new Set;return!r.has(o)&&(r.add(o),s.set(n,r),!0)});return n&&s.size>1?null:function(e){const t=new Set,n=new Set;for(const o of e){let e,r=!1;"delete"===o.kind?(r=!o.removed.some(w),e=r?o.after:o.following.find(w)||o.preceding.find(w)||o.following.find(g)||o.preceding.find(g)||o.after):e="insert"===o.kind?o.added.find(w)||o.added.find(g):o.after;const i=g(e);if(!i)continue;const a=w(e),s=a||i;(a&&!r?t:n).add(s)}const o=t.size?t:n;return 1===o.size?o.values().next().value:null}(l)}(u,!s&&(a||function(e,t){return!!e&&!!t&&Object.entries(t).some(([t,n])=>{if("order"!==n?.type||!Object.hasOwn(e,t))return!1;const o=e[t];return"order"===o?.type&&o.members===n.members&&o.value!==n.value})}(o.values,r.values)))}catch{return null}}}}function h(e,t,n){const o=[];for(const r of t){if(!r.after||"spacing"===r.type)continue;const t=R(e.oldRange,r.before,n,r,!0),i=R(e.newRange,r.after,n,r,!1);if(!t.length)continue;const a="markup"===r.type&&r.oldTag===r.newTag;if(a||!r.before||!(t.length<=R(e.newRange,r.before,n,r,!0).length||i.length<=R(e.oldRange,r.after,n,r,!1).length))for(const n of i)a&&!t.some(e=>e.signature!==n.signature)||o.push({...e,unresolved:!1,before:null,after:n,kind:"content",input:r.before&&r.after?2:1,priority:2,matches:[r]})}return o}function g(e){if(e?.node)return e.node;for(const t of e?.children||[]){const e=g(t);if(e)return e}return null}function w(e){const t=e?.node;if(t?.getClientRects().length&&"visible"===t.ownerDocument.defaultView.getComputedStyle(t).visibility)return t;for(const t of e?.children||[]){const e=w(t);if(e)return e}return null}function v(e,t,n,o=e.querySelector('main, [role="main"]')||e.querySelector("article")||e.body){if(!o)return null;const r=n.filter(e=>{if("string"!=typeof e||!e.trim())return!1;try{return o.matches(e),!0}catch{return!1}}).join(", "),i=new Map,a=new Map;if(e!==t)for(const e of t.querySelectorAll("[data-mtflpp-node]")){const t=e.getAttribute("data-mtflpp-node");a.set(t,a.has(t)?null:e)}for(const n of[o,...o.querySelectorAll("*")]){if(r&&n.closest(r))continue;const o=[...n.childNodes].filter(e=>3===e.nodeType).map(e=>e.textContent),s=P(o.join(" ")),l=["img","source","video","audio","iframe"].includes(n.localName)?["src","srcset","poster"].map(e=>n.getAttribute(`data-${e}`)||n.getAttribute(e)||""):[],c=n.style?.backgroundImage||n.getAttribute("data-bg")||"",d=e===t?n:a.get(n.getAttribute("data-mtflpp-node"))||null,u=y(n,d,JSON.stringify([n.localName,s,l,c]));u.text=s,u.rawText=o.join(""),u.media=[...l,c],u.parent=i.get(n.parentElement),i.set(n,u),u.parent?.children.push(u)}for(const[e,t]of i)t.parts=[...e.childNodes].map(e=>3===e.nodeType?e.textContent:i.get(e)).filter(e=>void 0!==e);let s=i.get(o);if(!s)return null;const l=s.node;for(let e=o.parentElement;e;e=e.parentElement){const t=y(e,l,e.localName);t.children=[s],t.parts=[s],s=t}return s.excluded=r,s}function y(e,t,n){const o=function(e){const t=[];for(const{name:n,value:o}of e.attributes){if("data-mtflpp-node"===n||n.startsWith("on")||/(?:^|-)(nonce|token)(?:-|$)/.test(n))continue;if(/^(?:data-)?(?:src|srcset|poster|sizes|bg)$/.test(n))continue;let r=o;"class"===n&&(r=[...e.classList].sort().join(" ")),"style"===n&&(r=[...e.style].sort().map(t=>[t,e.style.getPropertyValue(t),e.style.getPropertyPriority(t)])),("class"!==n&&"style"!==n||r.length)&&t.push([n,r])}return t.sort(([e],[t])=>e.localeCompare(t))}(e);return{node:t,tag:e.localName,signature:n,attributes:o,children:[],parts:[],presentation:JSON.stringify(o.filter(([e])=>!b(e))),references:JSON.stringify(o.filter(([e])=>b(e)))}}function b(e){return["id","for","headers","aria-controls","aria-labelledby","aria-describedby","aria-owns","aria-flowto","aria-activedescendant","aria-details","aria-errormessage"].includes(e)}function x(e,t){const n=new Map,o=new Map,r=new Map,i=new Map,a=[];function s(e){const t=JSON.stringify(e);return n.has(t)||n.set(t,n.size+1),n.get(t)}function l(e){if(!e)return 0;const t=s([e.signature,e.children.map(l)]);return o.set(e,t),r.set(e,s([t,e.presentation,e.children.map(e=>r.get(e))])),i.set(e,s([t,e.presentation,e.references,e.children.map(e=>i.get(e))])),t}l(e),l(t);const c=e=>o.get(e);function d(e){const t=e.attributes.find(([e])=>"id"===e)?.[1];return t?`${e.tag} ${t}`:void 0}function u(e){if(!(e.children.length<2))return s(["collection",e.signature,e.children.map(c).sort((e,t)=>e-t)])}function f(e,t){const n=new Map;return e.forEach((e,o)=>{const r=t(e);void 0!==r&&n.set(r,n.has(r)?-1:o)}),n}return function e(t,n){t&&n&&(t.signature!==n.signature?a.push({kind:"content",before:t,after:n,priority:2}):t.rawText!==n.rawText&&a.push({kind:"content",before:t,after:n,priority:2,spacing:!0}),t.presentation===n.presentation&&t.references===n.references||a.push({kind:"attributes",before:t,after:n,priority:t.presentation!==n.presentation?1:0}),function(t,n,s,l){const p=l.parent&&s.parent&&l.tag===s.tag,m=f(t,c),h=f(n,c);let g,w,v,y;const b=new Set(t.flatMap(e=>[r.get(e),i.get(e)])),x=new Set(n.flatMap(e=>[r.get(e),i.get(e)]));function P(e,t,n){const o=n.get(e),r=n.get(t);return o===r||!x.has(o)&&!b.has(r)}function M(e,t){return o.get(e)===o.get(t)&&P(e,t,r)&&P(e,t,i)}function E(e,r,i,s,c){const d=t.slice(e,r),u=n.slice(i,s),f="replacement"===c&&p&&d.some(e=>!h.has(o.get(e)))&&u.some(e=>!m.has(o.get(e)))&&(!function(e,t){if(e.length<2||t.length<2)return!1;const n=e.filter(e=>e.children.length).length,o=t.filter(e=>e.children.length).length;if(!n&&!o||n>1&&o>1)return!0;const r=new Map;for(const{tag:e}of t)r.set(e,(r.get(e)||0)+1);let i=0;for(const{tag:t}of e){const e=r.get(t);if(e){if(2===++i)return!0;r.set(t,e-1)}}return!1}(d,u)||"form"===l.tag&&function(e,t){function n(e){const t=new Set;return e.every(function e(n){if(["input","select","textarea"].includes(n.tag)){const e=n.attributes.find(([e])=>"name"===e)?.[1],o=n.attributes.find(([e])=>"type"===e)?.[1]?.toLowerCase();return!(!e||"input"===n.tag&&"hidden"===o||(t.add(e),0))}let o=!1;for(const t of n.children)e(t)&&(o=!0);return o})?t:null}const o=n(e),r=n(t);return o&&r&&[...o].some(e=>!r.has(e))&&[...r].some(e=>!o.has(e))}(d,u)),g=p&&("reorder"===c||f)?c:void 0;a.push({kind:"region",after:l,priority:2,unresolved:!0,regionChange:g,oldRange:d,newRange:u})}function k(e,n,o,r,i,a,s){const l=[];for(let c=e;c<n;c++){const e=s(t[c]),n=a.get(e);if(!(i.get(e)!==c||void 0===n||n<o||n>=r)){if(l.length&&n<=l[l.length-1][1])return null;l.push([c,n])}}return l}!function r(i,s,b,x){for(;i<s&&b<x&&M(t[i],n[b]);)e(t[i],n[b]),i++,b++;for(;i<s&&b<x&&M(t[s-1],n[x-1]);)s--,x--,e(t[s],n[x]);if(i===s&&b===x)return;if(i===s||b===x){const e=b===x,r=e?t.slice(i,s):n.slice(b,x),c=e?[n[b-1],n[b]]:[t[i-1],t[i]];return void(r.some(e=>c.some(t=>t&&o.get(t)===o.get(e)))?E(i,s,b,x):e?a.push({kind:"delete",after:l,removed:r,priority:2,following:n.slice(b),preceding:n.slice(0,b).reverse()}):a.push({kind:"insert",after:r[0],added:r,priority:2}))}if(s-i===1&&x-b===1)return void e(t[i],n[b]);if(p&&function(e,r,i,a){const s=r-e;if(s<2||s!==a-i)return!1;const l=new Map;let c=!1;for(let r=0;r<s;r++){const a=o.get(t[e+r]),s=o.get(n[i+r]);c||=a!==s,l.set(a,(l.get(a)||0)+1),l.set(s,(l.get(s)||0)-1)}return c&&[...l.values()].every(e=>0===e)}(i,s,b,x))return void E(i,s,b,x,"reorder");let P=k(i,s,b,x,m,h,c);if(0===P?.length&&(g??=f(t,d),w??=f(n,d),P=k(i,s,b,x,g,w,d)),0===P?.length&&(v??=f(t,u),y??=f(n,u),P=k(i,s,b,x,v,y,u)),P?.length)for(const[o,a]of[...P,[s,x]])r(i,o,b,a),o<s&&e(t[o],n[a]),i=o+1,b=a+1;else E(i,s,b,x,P?"replacement":void 0)}(0,t.length,0,n.length)}(t.children,n.children,t,n))}(e,t),a}function P(e){return e.replace(/\s+/g," ").trim()}function M(e,t){return e!==t&&e.replace(/\s/g,"")===t.replace(/\s/g,"")}function E(e,t,n){for(;e.node?.isConnected&&e.parent?.node;){const{display:t}=e.node.ownerDocument.defaultView.getComputedStyle(e.node);if("inline"!==t&&"contents"!==t)break;e=e.parent}if(!t.has(e)){const{node:o}=e,r=[],i=o?.isConnected&&k(o,n,r)===C(e)&&w(e)?o.innerText:void 0;t.set(e,"string"==typeof i?{text:i,omitted:JSON.stringify(r)}:void 0)}return t.get(e)}function k(e,t,n){return t&&e.querySelector(t)?[...e.childNodes].map(e=>3===e.nodeType?e.textContent:1!==e.nodeType?"":e.matches(t)?(n.push(e.textContent),""):k(e,t,n)).join(""):e.textContent}function C(e){return e.parts.map(e=>"string"==typeof e?e:C(e)).join("")}function S({before:e,after:t}){return L(e.rawText,t.rawText)||L(C(e),C(t))}function L(e,t){if(!/\S/.test(e)||!M(e,t))return;const n=e.match(/\s+|\S+/g),o=t.match(/\s+|\S+/g);let r=0,i=0;for(;r<Math.min(n.length,o.length)&&n[r]===o[r];)r++;for(;i<Math.min(n.length,o.length)-r&&n.at(-1-i)===o.at(-1-i);)i++;const a=Math.max(0,r-1),s=Math.max(0,i-1);return{type:"spacing",before:n.slice(a,n.length-s).join(""),after:o.slice(a,o.length-s).join("")}}function T(e,t=new Map){return e?(t.has(e)||t.set(e,(e.parts||[]).map(e=>{if("string"==typeof e)return e;const n=T(e,t);return/^(?:p|div|section|article|main|aside|header|footer|nav|h[1-6]|li|[ou]l|d[ldt]|blockquote|pre|table|tr|t[dh]|caption|figure|figcaption|br|hr)$/.test(e.tag)?` ${n} `:n}).join("")),t.get(e)):""}function V(e,t){let n=0,o=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;for(;o<e.length-n&&o<t.length-n&&e[e.length-o-1]===t[t.length-o-1];)o++;let r=e.length-o,i=t.length-o;for(;n>0&&/\S/.test(e[n-1]);)n--;if(r>n&&/\S/.test(e[r-1]))for(;r<e.length&&/\S/.test(e[r]);)r++;if(i>n&&/\S/.test(t[i-1]))for(;i<t.length&&/\S/.test(t[i]);)i++;return{before:e.slice(n,r).trim(),after:t.slice(n,i).trim()}}function O(e,t){return t?j(e,t):""===P(e)}function j(e,t){if(!t)return!1;let n=(e=P(e)).indexOf(t);for(;-1!==n;){const o=n+t.length;if(!(n&&/[\p{L}\p{N}_]/u.test(e[n-1])&&/[\p{L}\p{N}_]/u.test(t[0])||o!==e.length&&/[\p{L}\p{N}_]/u.test(e[o])&&/[\p{L}\p{N}_]/u.test(t.at(-1))))return!0;n=e.indexOf(t,n+1)}return!1}function R(e=[],t,n,o,r){return e.flatMap(e=>{const i=R(e.children,t,n,o,r);let a;return a="media"===o.type?e.media?.includes(t):"attribute"===o.type?e.attributes.some(([e,n])=>e===o.name&&j("string"==typeof n?n:JSON.stringify(n),t)):("markup"!==o.type||e.tag===(r?o.oldTag:o.newTag))&&O(n(e),t),"text"===o.type&&i.length?i:[...a?[e]:[],...i]})}function A(e,t,n){if(e.unresolved)return 0;if(e.matches=[],e.spacing){const n=t.filter(e=>"spacing"===e.type),o=n.length&&S(e);return e.matches=n.filter(e=>o?.before===e.before&&o?.after===e.after),e.matches.length?2:0}let o=0;for(const r of t){if("spacing"===r.type)continue;let t=0;if("attributes"===e.kind){if(!["text","attribute"].includes(r.type))continue;const n=r,o=new Map(e.before.attributes),i=new Map(e.after.attributes);for(const e of new Set([...o.keys(),...i.keys()])){if("attribute"===r.type&&e!==r.name)continue;const a=o.get(e),s=i.get(e);if(JSON.stringify(a)===JSON.stringify(s))continue;const l="string"==typeof a?a:JSON.stringify(a)||"",c="string"==typeof s?s:JSON.stringify(s)||"";O(l,n.before)&&O(c,n.after)&&(t="attribute"===r.type||r.before&&r.after?2:1)}}else"insert"===e.kind?!r.before&&e.added.some(e=>j(n(e),r.after))&&(t=Math.max(t,1)):"delete"===e.kind?!r.after&&e.removed.some(e=>j(n(e),r.before))&&(t=Math.max(t,1)):"media"===r.type?(e.before?.media||[]).some((t,n)=>t===r.before&&e.after?.media?.[n]===r.after)&&(t=2):"attribute"!==r.type&&("markup"!==r.type||e.before?.tag===r.oldTag&&e.after?.tag===r.newTag)&&O(n(e.before),r.before)&&O(n(e.after),r.after)&&(t=r.before&&r.after?2:1,"text"===r.type&&j(e.before?.text||"",r.before)&&j(e.after?.text||"",r.after)&&(e.directInput=!0));t&&e.matches.push(r),o=Math.max(o,t)}return o}function H(e,t){return!!e?.children.some(e=>e===t||e.node&&e.node===t?.node||H(e,t))}const _=new Set(["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","PageDown","PageUp","Home","End"," "]);function F(e,t){let n;for(const o of e?.rects??[]){const e=t(o);if(e.visible)return e;(!n||e.distance<n.distance)&&(n=e)}return n}function N(e){return new Promise(t=>{const n=()=>{e.clearTimeout(o),e.cancelAnimationFrame(r),t()},o=e.setTimeout(n,100);let r=e.requestAnimationFrame(()=>{r=e.requestAnimationFrame(n)})})}function $(e,t=!1){if(!Z(e,{visibilityProperty:!0,opacityProperty:!0}))return;const{left:n,right:o,top:r,bottom:i,width:a,height:s}=e.getBoundingClientRect();if(!(t||a&&s))return;const l=e.ownerDocument,{documentElement:c,body:d,defaultView:u}=l,f={left:n,right:a?o:n+1,top:r,bottom:s?i:r+1},p={...f},m={x:f.right-f.left,y:f.bottom-f.top},h="visible"===u.getComputedStyle(c).overflow,g=u.getComputedStyle(e);for(let n=e;n&&n!==c;){const o=n===e?g:u.getComputedStyle(n),{position:r,display:i,overflowX:a,overflowY:s}=o;if(n!==e&&(n!==d||!h)&&"inline"!==i&&("visible"!==a||"visible"!==s)&&n.offsetWidth&&n.offsetHeight){const{bounds:e,scaleX:r,scaleY:i}=z(n,o);for(const[l,c,d,u,h]of[["x",a,"left","right",r],["y",s,"top","bottom",i]]){if("visible"===c)continue;const r="clip"===c?[0,0]:I(n,o,l,h),i=t&&"hidden"===c,a="y"===l==("horizontal-tb"===o.writingMode);if(i&&r.some(e=>e)&&(a||f[d]<e[d]||f[u]>e[u]||D(o,g,l)))return{boundary:n};if(!W(f,p,e,d,u,i?[0,0]:r))return{boundary:n};m[l]=Math.min(m[l],p[u]-p[d])}}n="absolute"===r||"fixed"===r?n.offsetParent:n.parentElement}return{clipped:f,extent:m}}function D(e,t,n){const o=e=>e&&"auto"!==e&&0!==parseFloat(e);return("x"===n?["Left","Right"]:["Top","Bottom"]).some(n=>o(e[`scrollPadding${n}`])||o(t[`scrollMargin${n}`]))}function B(e,t,n=!1){const o=$(e,n);if(!o?.clipped)return;const{clipped:r,extent:i}=o,{ownerDocument:a}=e,s=a.documentElement;if(r.left=Math.max(s.clientLeft,r.left),r.right=Math.min(s.clientLeft+s.clientWidth,r.right),r.top=Math.max(0,r.top),r.bottom=Math.min(s.clientHeight,r.bottom),r.right<=r.left)return{rects:[]};const l=t?.({...r,top:0,bottom:s.clientHeight}),c=l?.visibleCenterX??(r.left+r.right)/2,d=K(e,c);if(r.bottom<=r.top)return{rects:[],header:d?.bottom};const u={rects:[r],inViewport:!0,extent:i};if(!d)return u;const f={left:Math.max(r.left,d.left),right:Math.min(r.right,d.right),top:Math.max(r.top,d.top),bottom:Math.min(r.bottom,d.bottom)};if(!q(f)||!d.node.contains(a.elementFromPoint(c,(f.top+f.bottom)/2)))return u;const p=[{...r,top:f.bottom},{...r,bottom:f.top},{...f,left:r.left,right:f.left},{...f,left:f.right,right:r.right}].filter(q);return!p.length&&d.bottom>=s.clientHeight&&d.top<=0?void 0:{rects:p,inViewport:!0,extent:i,header:d.bottom}}function q({left:e,right:t,top:n,bottom:o}){return t>e&&o>n}function W(e,t,n,o,r,[i,a]){return e[o]=Math.max(e[o],n[o]),e[r]=Math.min(e[r],n[r]),t[o]=Math.max(n[o],t[o]+i),t[r]=Math.min(n[r],t[r]+a),t[r]>t[o]}function I(e,t,n,o){const r="x"===n,i=r?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight;if(i<=0)return[0,0];const a=r?e.scrollLeft:e.scrollTop,s=t.display.endsWith("flex")&&t.flexDirection===(r?"row-reverse":"column-reverse"),l=(r&&"rtl"===t.direction)!==s;let c=l?-i:0,d=l?0:i;return("horizontal-tb"!==t.writingMode||a<c||a>d)&&(c=-i,d=i),[(a-d)*o,(a-c)*o]}function z(e,t){const n=e.getBoundingClientRect(),o=n.width/e.offsetWidth,r=n.height/e.offsetHeight,i=n.left+e.clientLeft*o,a=n.top+e.clientTop*r,s={left:i,top:a,right:i+e.clientWidth*o,bottom:a+e.clientHeight*r},l=t.overflowClipMargin;if("clip"!==t.overflowX&&"clip"!==t.overflowY||!l||"0px"===l)return{bounds:s,scaleX:o,scaleY:r};const c=l.split(" ").map(parseFloat).find(Number.isFinite)??0,d=l.includes("border-box")?n:s,u=l.includes("content-box");return{scaleX:o,scaleY:r,bounds:{left:d.left+((u?parseFloat(t.paddingLeft):0)-c)*o,right:d.right-((u?parseFloat(t.paddingRight):0)-c)*o,top:d.top+((u?parseFloat(t.paddingTop):0)-c)*r,bottom:d.bottom-((u?parseFloat(t.paddingBottom):0)-c)*r}}}function Z(e,t={visibilityProperty:!0}){return!!e?.isConnected&&!!e.getClientRects().length&&(!e.checkVisibility||e.checkVisibility(t))&&"visible"===e.ownerDocument.defaultView.getComputedStyle(e).visibility}function J(e){return e.matchMedia("(prefers-reduced-motion: reduce)").matches?"instant":"smooth"}function U(e,{behavior:t,header:n=Y(e),nearest:o=!1}={}){const r=e.ownerDocument,i=r.defaultView,a=t??J(i);if(o&&!n)return void e.scrollIntoView({behavior:a,block:"nearest",inline:"nearest"});const s=i.getComputedStyle(e).scrollMarginTop,l=r.documentElement,c=l.clientHeight,d=i.getComputedStyle(l),u=X(d.scrollPaddingTop,c),f=X(d.scrollPaddingBottom,c);let p,m;try{let t=o?"nearest":"start";if(o){const e=n-parseFloat(s);null!==u&&e>u&&(p=l.getAttribute("style"),l.style.setProperty("scroll-padding-top",`${e}px`,"important"))}else{const t=n>0&&null!==u?`max(${s}, ${n-u}px)`:s;m=e.getAttribute("style"),e.style.setProperty("scroll-margin-top",`calc(${t} + 1lh)`,"important")}if(!o&&null!==u&&null!==f){const n=i.getComputedStyle(e),o=c-u-f-parseFloat(n.scrollMarginTop)-parseFloat(n.scrollMarginBottom),r=o-e.getBoundingClientRect().height;if(r>=0&&(t="center"),r>0&&"horizontal-tb"===d.writingMode){const e=Math.min(o/3,r);p=l.getAttribute("style"),l.style.setProperty("scroll-padding-bottom",`${f+e}px`,"important")}}e.scrollIntoView({behavior:a,block:t,inline:"nearest"})}finally{void 0!==p&&G(l,p),void 0!==m&&G(e,m)}}function G(e,t){e.setAttribute("style",t??""),null===t&&e.removeAttribute("style")}function X(e,t){if("auto"===e)return 0;const n=parseFloat(e);return Number.isFinite(n)?n*(e.endsWith("%")?t/100:1):null}function Y(e){const t=e.getBoundingClientRect();return K(e,t.left+t.width/2)?.bottom??0}function K(e,t){const n=e.ownerDocument;for(let o=n.elementFromPoint(t,1);o&&!o.contains(e);o=o.parentElement){const e=n.defaultView.getComputedStyle(o);if("fixed"!==e.position&&"sticky"!==e.position)continue;if("0"===e.opacity||!Z(o,{visibilityProperty:!0,opacityProperty:!0}))continue;const{left:t,right:r,top:i,bottom:a}=o.getBoundingClientRect();if("fixed"===e.position||i<=parseFloat(e.top)+1)return{node:o,left:t,right:r,top:i,bottom:a}}}function Q(e,t,n,o){const r=window.acf;r.addAction("wysiwyg_tinymce_init",n);for(const e of["append","remove","sortstop","change_field"])r.addAction(e,t);const i=t=>{t[0]===e&&o?.()};function a(e){return!!e?.closest?.(".acf-field")}return r.addAction("validation_failure",i),window.jQuery(e).on("input.mtflppAcf change.mtflppAcf sortupdate.mtflppAcf",e=>{e.originalEvent&&"sortupdate"!==e.type||!a(e.target)||t()}),{isField:a,isValidating:()=>!!e.classList?.contains("is-validating"),hasStructuralPaginationChanges:()=>!!e.querySelector('.acf-repeater[data-pagination="1"] .acf-row:is(.acf-added, .acf-inserted, .acf-reordered, .acf-deleted)'),accepts:e=>"_acf_nonce"===e||e.startsWith("acf[")||e.startsWith("_acf_fields["),destroy(){r.removeAction("wysiwyg_tinymce_init",n);for(const e of["append","remove","sortstop","change_field"])r.removeAction(e,t);r.removeAction("validation_failure",i),window.jQuery(e).off(".mtflppAcf")}}}function ee(){const e=(0,n.select)("core/edit-post")?.getActiveMetaBoxLocations?.()??["normal","side","advanced"];return[document.querySelector(".metabox-base-form"),...e.map(e=>document.querySelector(`.edit-post-meta-boxes-area.is-${e} .metabox-location-${e}`)||document.querySelector(`#metaboxes .metabox-location-${e}`))].filter(Boolean)}const te="meet-the-frontend-live-preview-panel/acf";function ne(e){if(!e.acfEnabled)return!1;if("function"!=typeof window.acf?.addAction||"function"!=typeof window.acf?.removeAction||"function"!=typeof window.jQuery)throw Object.assign(new Error(e.strings.acfUnavailable),{code:"mtflpp_integration_failed"});return!0}(0,o.addAction)("mtflpp.blockEditor.previewSetup",te,({config:e,changed:t,hooks:o,onDestroy:r})=>{if(!ne(e))return;const i=function(e){const t=new Set;let o=!1,r=[],i=new Map;const a=()=>{o||e()};function s(e){e&&!t.has(e)&&(t.add(e),e.on("input change undo redo SetContent",a))}const l=Q(document,a,s);function c(e){s(e.editor)}function d(e){l.isField(e.target)&&ee().some(t=>t.contains(e.target))&&a()}window.tinymce?.editors.forEach(s),window.tinymce?.on("AddEditor",c),document.addEventListener("input",d),document.addEventListener("change",d,!0);const u=new MutationObserver(a);return{get ready(){return r=r.filter(({field:e,rows:t})=>e.isConnected&&t.some(t=>e.contains(t))),r.length||u.disconnect(),!r.length},saved(){u.disconnect(),r=ee().flatMap(e=>[...e.querySelectorAll('.acf-repeater[data-pagination="1"]')].map(e=>({field:e,rows:[...e.querySelectorAll(":scope > table > tbody > tr.acf-row:not(.acf-clone)")]})).filter(({rows:e})=>e.length));for(const{field:e}of r)u.observe(e,{childList:!0,subtree:!0});a()},observe(){const e=(0,n.select)("acf/fields");if(!e?.getFieldValue)return;const t=new Map;for(const n of ee())for(const o of window.acf.getFields({parent:window.jQuery(n)})){const n=o.get("key");t.set(n,e.getFieldValue(n))}(t.size!==i.size||[...t].some(([e,t])=>i.get(e)!==t))&&(i=t,a())},capture(){o=!0;const e=new URLSearchParams;try{window.tinymce?.triggerSave();for(const t of ee())for(const[n,o]of new FormData(t))"string"==typeof o&&l.accepts(n)&&e.append(n,o)}finally{o=!1}return e},destroy(){u.disconnect(),l.destroy(),document.removeEventListener("input",d),document.removeEventListener("change",d,!0),window.tinymce?.off("AddEditor",c);for(const e of t)e.off("input change undo redo SetContent",a)}}}(t);r(()=>i.destroy()),o.addAction("observePreviewInputs",te,()=>i.observe()),o.addAction("nativeMetaboxSaveAcknowledged",te,()=>i.saved()),o.addFilter("previewPauseReason",te,t=>t||(i.ready?"":e.strings.acfRefreshing)),o.addFilter("previewFormBody",te,e=>{e??=new URLSearchParams;for(const[t,n]of i.capture())e.append(t,n);return e})}),(0,o.addAction)("mtflpp.classicEditor.previewSetup",te,({config:e,form:t,changed:n,watchEditor:o,cancelNativeSave:r,hooks:i,onDestroy:a})=>{if(!ne(e))return;const s=Q(t,n,o,r);a(()=>s.destroy());const l=e=>{s.isField(e.target)&&n()};t.addEventListener("input",l),t.addEventListener("change",l,!0),a(()=>{t.removeEventListener("input",l),t.removeEventListener("change",l,!0)}),i.addFilter("nativeSaveValidationPending",te,e=>e||s.isValidating()),i.addFilter("previewFormBody",te,(e,t)=>{for(const[n,o]of t)"string"==typeof o&&s.accepts(n)&&e.append(n,o);return e}),i.addFilter("nativePreviewHandoffError",te,(t,n)=>t||(n&&s.hasStructuralPaginationChanges()?Object.assign(new Error(e.strings.nativePreviewAcf),{code:"mtflpp_source_changed"}):void 0))}),(0,o.addAction)("mtflpp.blockEditor.previewSetup","meet-the-frontend-live-preview-panel/yoast",({config:e,hooks:t})=>{e.yoastPrimaryTaxonomies?.length&&t.addFilter("additionalPreviewValues","meet-the-frontend-live-preview-panel/yoast",(t,o)=>{const r=function(e,t){if(!e.yoastPrimaryTaxonomies?.length)return;const o=(0,n.select)("yoast-seo/editor");if("function"!=typeof o?.getPrimaryTaxonomyId||Number(o.getPostId?.())!==e.postId)return;const r={};for(const n of e.yoastPrimaryTaxonomies){const i=o.getPrimaryTaxonomyId(n);if(void 0===i)continue;const a=-1===Number(i)?0:Number(i),s=t.getEditedPostAttribute(e.taxonomies[n]);r[n]=Array.isArray(s)&&!s.includes(a)?0:a}return Object.keys(r).length?JSON.stringify(r):void 0}(e,o);return void 0===r?t:{...t,yoast_primary_terms:r}})});const oe=window.meetTheFrontendLivePreviewPanel;if(oe){let a;try{a=function(e){const a={ready:!1,notReady:e.strings.loading,notReadyState:"loading",saving:!1,idle:Promise.resolve(),title:e.postTitle};let s,l,c,d=!1,u=!1,f=0,p=!1;const m=function(e,t){const n=(0,o.createHooks)(),r=[];let i,a=!1;function s(e){i??="mtflpp_integration_failed"===e?.code?e:Object.assign(new Error(t.config.strings.integrationFailed),{code:"mtflpp_integration_failed",cause:e})}const l={get error(){return i},filter(e,t,...o){if(a||i)return t;try{const r=n.applyFilters(e,t,...o);if("additionalPreviewValues"===e&&("[object Object]"!==Object.prototype.toString.call(r)||Object.values(r).some(e=>!(null===e||["string","boolean"].includes(typeof e)||"number"==typeof e&&Number.isFinite(e)))))throw new TypeError("Preview values must be a plain object of scalar values.");return r}catch(e){return s(e),t}},action(e,...t){if(!a&&!i)try{n.doAction(e,...t)}catch(e){s(e)}},capture(e,t=null){a&&!i&&s(new Error("This editor session has ended."));const n=null===e?null:new URLSearchParams(e),o=l.filter("previewFormBody",e,t);if(null===o||o instanceof URLSearchParams||s(new TypeError("Preview capture must return URLSearchParams or null.")),i||null===n||null!==o&&![...n.keys()].some(e=>{const t=n.getAll(e),r=o.getAll(e);return r.length!==t.length||t.some((e,t)=>r[t]!==e)})||s(new TypeError("Preview capture must preserve the classic form body.")),i)throw i;return o},comparisonValues(e,n){const o=new Map(Object.entries(n));try{const n=t.form||document,r=new Set;for(const t of n.querySelectorAll("input[name], textarea[name], select[name]")){if(o.has(t.name)||!e?.has(t.name)||"password"===t.type)continue;if("hidden"===t.type){r.add(t.name);continue}const n="textarea"===t.localName||["text","search","email","url","tel"].includes(t.type),i=e.getAll(t.name);let a="value";n&&1===i.length&&(a=t.classList.contains("wp-editor-area")?"html":"text"),o.set(t.name,{type:a,value:1===i.length?i[0]:JSON.stringify(i)})}for(const t of r){if(o.has(t))continue;const n=e.getAll(t);n.length>1&&o.set(t,{type:"order",value:JSON.stringify(n),members:JSON.stringify(n.sort())})}}catch{}return Object.fromEntries(o)},destroy(){if(!a){a=!0;for(const e of r.reverse())try{e()}catch(e){s(e)}r.length=0}}};try{(0,o.doAction)("mtflpp.blockEditor.previewSetup",{...t,hooks:n,onDestroy(e){r.push(e)}})}catch(e){s(e),l.destroy()}return l}(0,{config:e,changed(){s?.changed(),y()}}),h=()=>(0,n.select)("core/editor"),g=()=>Number(h()?.getCurrentPostId())===e.postId&&h()?.getCurrentPostType()===e.postType,w=()=>{c=Object.assign(new Error(e.strings.nativeSaveFailed),{code:"mtflpp_source_changed"})};function v(){if(d||!s)return;const t=h(),n=!!t?.getCurrentPost()?.id,o=n&&g();o&&m.action("observePreviewInputs",t);const r=m.filter("previewPauseReason","",t),i=o&&!r&&!m.error;a.notReady=function(t,n,o){return t?n?m.error?.message||o:e.strings.postOnly:e.strings.loading}(n,o,r),a.notReadyState=n?"paused":"loading";const p=o&&(t.isSavingPost()||f>0),w=i&&!a.ready;if(a.ready=i,a.saving=p,m.error)return void s.resume(m.error);if(!i)return void s.pause(a.notReady,a.notReadyState);p&&!u&&s.pause(h().isPreviewingPost()?e.strings.nativePreview:e.strings.saving);const v=u&&!p;u=p;const y={...m.filter("additionalPreviewValues",{},t),post_title:t.getEditedPostAttribute("title")??"",excerpt:t.getEditedPostAttribute("excerpt")??"",content:t.getPostEdits().content??t.getCurrentPost().content,blocks:t.getEditedPostAttribute("blocks"),author:t.getEditedPostAttribute("author"),date:t.getEditedPostAttribute("date"),...Object.fromEntries(Object.entries(e.taxonomies||{}).map(([e,n])=>[`terms:${e}`,t.getEditedPostAttribute(n)])),featured_media:t.getEditedPostAttribute("featured_media")??0};if(m.error)return a.ready=!1,void s.resume(m.error);a.title!==y.post_title&&(a.title=y.post_title,s.setTitle(a.title)),l&&Object.keys(y).length===Object.keys(l).length&&!Object.keys(y).some(e=>y[e]!==l[e])||(l=y,s.changed()),(v||w)&&s.resume(c)}function y(){p||(p=!0,queueMicrotask(()=>{p=!1,v()}))}function b(t,n,o){t&&t.request===n&&t.before===o&&e.base===o&&"string"==typeof t.after&&i.test(t.after)&&"boolean"==typeof t.available?(e.base=t.after,e.available=t.available):w()}a.preparePreview=()=>{const n=function(){const t=h(),n=t.getEditedPostAttribute("author"),o=t.getEditedPostAttribute("date"),r={};for(const[n,o]of Object.entries(e.taxonomies||{})){const e=t.getEditedPostAttribute(o);Array.isArray(e)&&(r[n]=e)}return{...m.filter("additionalPreviewValues",{},t),...n?{author:n}:{},...void 0!==o?{date:o}:{},...Object.keys(r).length?{terms:JSON.stringify(r)}:{},post_title:t.getEditedPostAttribute("title")??"",content:t.getEditedPostContent(),excerpt:t.getEditedPostAttribute("excerpt")??"",featured_media:t.getEditedPostAttribute("featured_media")??0}}(),o=m.capture(null),r={post_title:"text",content:"html",excerpt:"html"},i=m.comparisonValues(o,Object.fromEntries(Object.entries(n).map(([e,t])=>[e,{type:Object.hasOwn(r,e)?r[e]:"value",value:t}])));let a;if(n.base=e.base,null===o)a=t({url:e.endpoint,method:"POST",data:n});else{for(const[e,t]of Object.entries(n))o.set(e,t??"");a=t({url:e.endpoint,method:"POST",body:o})}return a.then(e=>({...e,comparisonValues:i}))};const x=(0,n.subscribe)(y);return(0,o.addFilter)("editor.preSavePost",r,async function(t){if(d||!s||Number(t.id)!==e.postId||!g())return t;a.saving=!0;const n=s.pause(h().isPreviewingPost()?e.strings.nativePreview:e.strings.saving);try{await n}catch{}return t}),t.use(async function(t,n){if(d||!s||!["POST","PUT","PATCH"].includes((t.method||"GET").toUpperCase()))return n(t);const o=function(t){if("string"==typeof t.path&&t.path.startsWith("/"))return t.path.split("?")[0].replace(/\/$/,"");if("string"!=typeof t.url)return"";const n=new URL(t.url,window.location.href),o=new URL(e.restRoot,window.location.href);return n.origin!==o.origin?"":n.searchParams.has("rest_route")?n.searchParams.get("rest_route").replace(/\/$/,""):n.pathname.startsWith(o.pathname)?`/${n.pathname.slice(o.pathname.length)}`.replace(/\/$/,""):""}(t),r=o===e.postRoute||o===`${e.postRoute}/autosaves`,i=!r&&function(t){if("string"!=typeof e.postFormUrl||!(t.body instanceof FormData)||"string"!=typeof t.url)return!1;const n=new URL(t.url,window.location.href),o=new URL(e.postFormUrl,window.location.href);return n.origin===window.location.origin&&n.origin===o.origin&&n.pathname===o.pathname&&n.searchParams.has("meta-box-loader")&&t.body.get("post_ID")===String(e.postId)&&"editpost"===t.body.get("action")}(t);if(!r&&!i)return n(t);f++,a.saving=!0,y();const l=s.pause(e.strings.saving);try{await l}catch{}const u=e.base,p=Array.from(window.crypto.getRandomValues(new Uint8Array(16)),e=>e.toString(16).padStart(2,"0")).join("");let h;try{if(r){const e=await n({...t,headers:{...t.headers,"X-MTFLPP-Base":u,"X-MTFLPP-Request":p}});if(!1===t.parse){try{const t=await e.clone().json();b(t?._mtflpp_receipt,p,u)}catch{w()}return e}if(!e||"object"!=typeof e)return w(),e;const{_mtflpp_receipt:o,...r}=e;return b(o,p,u),r}const o=new FormData;for(const[e,n]of t.body)o.append(e,n);o.set("mtflpp_base",u),o.set("mtflpp_preview",p),o.set("mtflpp_metabox","1"),h=`mtflpp_preview_${p}`;const i=await n({...t,body:o}),a=document.cookie.split(";").map(e=>e.trim()).find(e=>e.startsWith(`${h}=`)),s=a?.slice(h.length+1);return b({request:p,before:u,after:s?.startsWith(`${u}.`)?s.slice(65):"",available:e.available},p,u),c||m.action("nativeMetaboxSaveAcknowledged"),i}catch(e){let t=e?._mtflpp_receipt;try{void 0!==t&&delete e._mtflpp_receipt}catch{t=void 0}const n=e?.data?.status;throw r&&"AbortError"!==e?.name&&"string"==typeof e?.code&&Number.isInteger(n)&&n>=400&&n<500&&t?.after===u?b(t,p,u):w(),e}finally{h&&(document.cookie=`${h}=; Max-Age=0; Path=${e.adminCookiePath}; SameSite=Strict`),f--,y()}}),a.connect=e=>{s=e,v()},a.destroy=()=>{d||(d=!0,x(),m.destroy(),(0,o.removeFilter)("editor.preSavePost",r))},window.addEventListener("pagehide",e=>{e.persisted||a.destroy()}),a}(oe);const s=window.wp?.editor?.PluginPreviewMenuItem,l=window.wp?.plugins?.registerPlugin,c="function"==typeof s&&"function"==typeof l,d=c?{fallbackMedia:window.matchMedia("(max-width: 782px)"),focus(){const e={preventScroll:!0},t=document.querySelector(".editor-preview-dropdown__toggle");t?.focus(e),t&&document.activeElement===t||document.querySelector('.interface-interface-skeleton__content[tabindex="-1"]')?.focus(e)}}:void 0,u=function(e,t,{inlineLauncher:n,nativeLauncher:o}={}){const r=e.strings,i=e.termId??e.postId,a=window,s=function(){let e,t=0,n=0;return{remember(e){try{e&&(t=e.defaultView.scrollY)}catch{}},async restore(e,o,r=()=>!0,i){const a=++n;try{const s=e.defaultView;let l;if(s.scrollTo({top:t,left:0,behavior:"instant"}),o?.ownerDocument===e&&r()){if(await N(s),a!==n||o.ownerDocument!==e||!r())return;if(function(e,t){const n=e.ownerDocument;for(let t=e;t;t=t.parentElement)if("until-found"!==t.getAttribute("hidden")?.toLowerCase()&&(t.hasAttribute("hidden")||"none"===n.defaultView.getComputedStyle(t).display))return!1;let o=!1;for(let r=e;r&&e.isConnected&&e.ownerDocument===n&&t();r=r.parentElement){if("until-found"===r.getAttribute("hidden")?.toLowerCase()){if(r.dispatchEvent(new n.defaultView.Event("beforematch",{bubbles:!0})),!(e.isConnected&&e.ownerDocument===n&&r.isConnected&&r.ownerDocument===n&&r.contains(e)&&t()))break;"until-found"===r.getAttribute("hidden")?.toLowerCase()&&r.removeAttribute("hidden"),o=!0}const i=r.parentElement;i instanceof n.defaultView.HTMLDetailsElement&&!i.open&&r!==Array.from(i.children).find(e=>"summary"===e.localName)&&(i.open=!0,o=!0)}return o}(o,()=>a===n&&r())&&await new Promise(e=>s.setTimeout(e,0)),a!==n||!r())return;const t=o.ownerDocument===e?function(e){if(!e?.isConnected)return null;const t=$(e,!0);if(t?.clipped)return e;if(!t?.boundary)for(const t of e.querySelectorAll("*"))if($(t,!0)?.clipped)return t;for(let n=t?.boundary||e.parentElement;n;){const e=$(n,!0);if(e?.clipped)return n;n=e?.boundary||n.parentElement}return null}(o):null;t&&(function(e,t){const n=B(e,t,!0);if(!n?.inViewport)return void U(e);const{rects:o,extent:r,header:i=0}=n,a=e.ownerDocument.documentElement,s=Math.min(r.x,a.clientWidth),l=Math.min(r.y,a.clientHeight-i);o.some(e=>e.right-e.left>=s-1&&e.bottom-e.top>=l-1)?t&&F(n,t)?.reveal(J(e.ownerDocument.defaultView)):U(e,{nearest:!0,header:i})}(t,i),o.contains(t)&&(l=t))}return t=s.scrollY,l}catch{}},keepInView(t,{canvas:n,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:a,canFollow:s}){try{const l=e?.target===t&&e.canFollow();if(e?.cancel(),!t.isConnected||!s())return;if(!l){const e=B(t,o);if(!F(e,o)?.visible)return}const c=new AbortController,d={target:t,canFollow:()=>!c.signal.aborted&&s(),cancel(){c.abort(),e===d&&(e=null)}};return e=d,function(e,t,n,o,r){const i=e=>{e.isTrusted&&("keydown"!==e.type||_.has(e.key))&&r()},a={capture:!0,passive:!0,signal:o};for(const n of[e,t])for(const e of["wheel","touchmove","pointerdown","keydown"])n?.addEventListener(e,i,a);t?.addEventListener("scroll",()=>{n?.()&&r()},a)}(t.ownerDocument.defaultView,n,a,c.signal,()=>{d.cancel(),i?.()}),async function(e,t,n,o){try{const r=e.ownerDocument.defaultView;if(await N(r),!o())return;const{scrollX:i,scrollY:a}=r,s=n();if(s&&await s,!o()||r.scrollX!==i||r.scrollY!==a)return;let l=B(e,t);l&&!l.rects.length&&(U(e,{behavior:"instant",header:l.header}),l=B(e,t)),F(l,t)?.reveal()}catch{}}(t,o,r,d.canFollow).finally(d.cancel)}catch{}}}}(),l=p(r,{postTitle:t.title??e.postTitle,publicRedirect:e.publicRedirect,inlineLauncher:n,nativeLauncher:o,onOpen:()=>R(),onClose:()=>j(),onRefresh:A,onRetry:e=>e?R(!0):A(),beforeViewportChange:e=>h.beforeViewportChange(e),beforeMove:O,afterMove:()=>{u&&A()}});let c,d,u=!1,f=0;const h=function(e,t,n,o,r=[]){const i=m(r);let a,s,l,c,d;function u(){d?.()}return{get hasPreview(){return!!a},get hasHtmlPreview(){return!!s},get redirectDestination(){return c},load:function(r,f,p=()=>!1,m){const h=new URL(r);if("https:"!==h.protocol&&"http:"!==h.protocol)throw Object.assign(new Error(n.failed),{code:"mtflpp_preview_unsupported_url"});if(h.origin!==window.location.origin){const e=n.originMismatch.replace("%s",()=>h.origin+h.pathname);throw Object.assign(new Error(e),{code:"mtflpp_preview_origin_mismatch"})}const g=h.searchParams.get("mtflpp_token");if(!g)throw new Error(n.failed);return window.crossOriginIsolated&&h.searchParams.set("mtflpp_isolated","1"),u(),h.searchParams.delete("mtflpp_source"),e.followChanges&&h.searchParams.set("mtflpp_source","1"),o(n.updating),new Promise((r,u)=>{const w=e.stage.ownerDocument.createElement("iframe");w.title=n.title,w.className="mtflpp-frame mtflpp-loading",w.setAttribute("aria-hidden","true"),w.setAttribute("tabindex","-1"),w.referrerPolicy="same-origin";let v=!1,y=!1;const b=setTimeout(()=>P(new Error(n.failed)),3e4),x=()=>{y=!0,P()};function P(e){v||(v=!0,e&&(y=!0),clearTimeout(b),d===x&&(d=null),w!==a&&(w.onload=null,w.onerror=null,w.remove()),e?u(e):r())}d=x,w.onload=async()=>{const r=w!==a;if(r||(s=null,l=null),y||!f())return void P();let d,u,v;try{const e=w.contentDocument,t=e?.querySelector('meta[name="meet-the-frontend-live-preview-panel"]');t?.content===g?d=e:r&&!t&&(u=function(e,t){if("text/html"!==e?.contentType)return;const n=e.defaultView?.performance.getEntriesByType("navigation")[0];if(!(n?.redirectCount>0))return;const o=new URL(n.name);return o.origin!==t.origin||o.pathname===t.pathname&&o.search===t.search?void 0:o.pathname}(e,h))}catch{}d&&(e.followChanges&&i.capture(d,r?m:void 0),d.documentElement.style.setProperty("overscroll-behavior","contain","important")),d&&r&&(t.remember(s),e.followChanges&&p()&&s&&(v=i.findChange(s,d))),r&&a&&(a.onload=null,a.onerror=null,a.remove()),a=w,s=d,l=null,c=u,w.classList.remove("mtflpp-loading"),w.removeAttribute("aria-hidden"),w.removeAttribute("tabindex");const b=()=>!y&&f()&&w===a&&d===s&&(!d||w.contentDocument===d);let x;if(d&&r){const n=e.canvasTarget&&(t=>e.canvasTarget(w,t,{fitTarget:!0}));x=await t.restore(d,v,()=>b()&&e.followChanges&&p(),n)}b()?(l=x,o(n.current,"ready"),P()):P()},w.onerror=()=>{w===a?(s=null,l=null,c=void 0,f()&&o(n.failed,"error")):P(new Error(n.failed))},w.src=h.href,e.stage.append(w)})},cancel:u,beforeViewportChange({canvasTarget:n,canFollow:o,...r}){const i=l,c=s,d=a;if(i&&c)return t.keepInView(i,{...r,canvasTarget:e=>n(d,e),canFollow:()=>i===l&&c===s&&d.contentDocument===c&&e.visible&&e.followChanges&&o()})},clear(){u(),t.remember(s),a&&(a.onload=null,a.onerror=null),a=null,s=null,l=null,c=void 0,e.clearPreview()}}}(l,s,r,k,e.comparisonExcludedSelectors);let g,w,v,y,b,x,P,M,E=!1;try{a.BroadcastChannel&&(M=new a.BroadcastChannel(`meet-the-frontend-live-preview-panel:${e.endpoint}:${i}:${e.userId}`),M.onmessage=e=>{"takeover"===e.data?.type&&u&&(j(!0),k(r.handedOff,"conflict",{reason:"handed-off"}))},a.addEventListener("pagehide",e=>{e.persisted||M.close()}))}catch{M?.close(),M=null}function k(e,n="loading",{canRetry:o=!0,reason:r=""}={}){"ready"===n&&(E=!1),l.report(e,n,{canTakeOver:!!M,hasPreview:h.hasPreview,canRetry:o,reason:r,hasHtmlPreview:h.hasHtmlPreview,redirectDestination:h.redirectDestination,canRefresh:u&&!t.saving&&["ready","error"].includes(n)&&("error"!==n||o)})}function C(e){const t=e?.code,n=function(e){const t=e?.code;return"mtflpp_post_locked"===t?"post-locked":["mtflpp_invalid_nonce","rest_cookie_invalid_nonce","mtflpp_preview_conflict","mtflpp_source_changed","mtflpp_acf_unavailable","mtflpp_integration_failed"].includes(t)?"reload":["mtflpp_cannot_preview","rest_forbidden","rest_cannot_edit"].includes(t)?"permission":"mtflpp_preview_origin_mismatch"===t?"origin-mismatch":"mtflpp_preview_unsupported_url"===t?"unsupported-url":""}(e);n&&(u=!1,S(),h.cancel(),b?.()),k("string"==typeof t?e.message:r.failed,"post-locked"===n?"paused":"error",{reason:n,canRetry:!n})}function S(){clearTimeout(c),d=void 0}function L(e){if(void 0===e&&void 0===d)return;const t=performance.now();void 0!==e&&(d=t+e),clearTimeout(c);const n=Math.ceil(d-t);n>0?c=setTimeout(V,n):V()}function T(){u&&(f+=1,E=!0,h.cancel(),t.saving||k(r.stale,"stale"),t.saving||t.previewing?S():L(275))}function V(){if(!u||g||!1===t.ready||t.previewing||t.saving)return;S();const n=f;k(r.updating),g=(async()=>{try{if(await t.idle,!u||!1===t.ready||t.saving)return;const o=e.base;let i,a;v=t.preparePreview();try{i=await v}catch(e){a=e}finally{v=null}if(await t.idle,!u||!1===t.ready||t.saving||o!==e.base)return;if(a)throw a;if("string"!=typeof i.url)throw Object.assign(new Error(i.message||r.failed),{code:i.code});u&&n===f&&await function(e,t,n){return h.load(e,()=>u&&t===f,()=>l.followChanges&&E,n)}(i.url,n,i.comparisonValues)}catch(e){u&&!t.saving&&C(e)}finally{g=null,L()}})()}function O(){f+=1,h.clear()}function j(e=!1){l.setVisible(e),u=!1,S(),O(),clearTimeout(P),P=null,x?.abort(),l.returnToEditor(),b?.()}async function R(n=!1){if(l.setVisible(!0),u)return;if(w)return void C(w);if(y){if(x&&!x.signal.aborted)return;const e=f;try{await y}catch{}return void(l.visible&&e===f&&R(n))}if(!1===t.ready)return void k(t.notReady,t.notReadyState??"paused",{canRetry:!1});if(!e.available)return void k(r.unavailable,"error",{canRetry:!1,reason:"unavailable"});if(!a.isSecureContext||!navigator.locks)return void k(r.browser,"error",{canRetry:!1,reason:"browser"});const o=n&&M?new AbortController:null;let s=!1;x=o,o?(k(r.waiting,"handover"),P=setTimeout(()=>{s=!0,o.abort()},15e3)):k(t.saving?r.saving:r.updating);try{const n=o?{signal:o.signal}:{ifAvailable:!0};if(y=navigator.locks.request(`meet-the-frontend-live-preview-panel:${e.endpoint}:${i}`,n,async e=>{if(clearTimeout(P),P=null,x=null,l.visible&&!o?.signal.aborted)if(e){k(t.saving?r.saving:r.updating);try{await new Promise(e=>{b=e,u=!0,f+=1,V()}),await g}finally{b=null}}else k(M?r.conflict:r.closeOther,"conflict",{reason:M?"other-tab":"manual"})}),o)try{M.postMessage({type:"takeover"})}catch(e){throw o.abort(),u&&j(!0),await y.catch(()=>{}),e}await y,l.visible&&s&&k(r.takeoverTimeout,"conflict",{reason:"busy"})}catch(e){u=!1,l.visible&&s?k(r.takeoverTimeout,"conflict",{reason:"busy"}):l.visible&&"AbortError"!==e.name&&C(e)}finally{clearTimeout(P),P=null,x=null,y=null}}function A(e=!0){t.saving||(e||(E=!1),u?(f+=1,h.cancel(),L(0)):R())}return{changed:T,pause:function(e=r.saving,t="loading"){return f+=1,S(),h.cancel(),(u||l.visible&&"paused"===t)&&k(e,t,{canRetry:!1}),v},resume:function(e){w=e,e?l.visible&&C(e):!l.visible||u||y?T():R()},setTitle:l.setTitle,openFromLauncher:l.openFromLauncher,start:()=>{l.visible&&R()},get pending(){return g}}}(oe,a,{nativeLauncher:d});a.connect(u),c&&l("meet-the-frontend-live-preview-panel",{render:()=>(0,e.createElement)(s,{role:"menuitem",icon:null,info:oe.strings.showLivePreviewHelp,onClick:()=>window.requestAnimationFrame(()=>u.openFromLauncher())},oe.strings.showLivePreview)})}catch(e){a?.destroy(),function(e,t){document.getElementById("mtflpp-panel")?.remove(),document.getElementById("mtflpp-toggle")?.remove(),document.getElementById("mtflpp-publish-preview")?.remove(),document.getElementById("mtflpp-term-preview")?.remove();const n=document.createElement("div");n.className="notice notice-error",n.setAttribute("role","alert");const o=document.createElement("p");o.textContent=e,n.append(o),(document.getElementById("wpbody-content")||document.body).prepend(n),console.error("Meet the Frontend – Live Preview Panel could not start.",t)}(oe.strings.bootFailed,e)}}})();
     1(()=>{"use strict";const e=window.wp.element,t=window.wp.apiFetch,n=window.wp.data,o=window.wp.hooks,r="meet-the-frontend-live-preview-panel",i=/^[a-f0-9]{64}$/,a=window.wp.preferences,s=window.wp.components,l=window.wp.notices,c=window.wp.primitives,d=window.ReactJSXRuntime,u={refresh:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M12 5.5L17.7929 11.2929C18.1834 11.6834 18.1834 12.3166 17.7929 12.7071L16 14.5M16 5.5H12V9.5M12 18.5L6.20711 12.7071C5.81658 12.3166 5.81658 11.6834 6.20711 11.2929L8 9.5M8 18.5H12V14.5"})}),more:(0,d.jsxs)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,d.jsx)(c.Path,{d:"M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z",fill:"currentColor",stroke:"none"}),(0,d.jsx)(c.Path,{d:"M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z",fill:"currentColor",stroke:"none"}),(0,d.jsx)(c.Path,{d:"M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z",fill:"currentColor",stroke:"none"}),(0,d.jsx)(c.Path,{d:"M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z"}),(0,d.jsx)(c.Path,{d:"M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z"}),(0,d.jsx)(c.Path,{d:"M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z"})]}),expand:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M4.75 10V4.75H10M4.75 4.75L10 10M14 19.25H19.25V14M19.25 19.25L14 14"})}),compact:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M10 4.75V10H4.75M10 10L4.75 4.75M19.25 14H14V19.25M14 14L19.25 19.25"})}),pip:(0,d.jsxs)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,d.jsx)(c.Path,{d:"M4.75 9.25V16C4.75 16.6904 5.30964 17.25 6 17.25H8M4.75 9.25V6C4.75 5.30964 5.30964 4.75 6 4.75H16C16.6904 4.75 17.25 5.30964 17.25 6V8M4.75 9.25H8"}),(0,d.jsx)(c.Path,{d:"M10.75 11.25C10.75 10.9739 10.9739 10.75 11.25 10.75H18.75C19.0261 10.75 19.25 10.9739 19.25 11.25V18.75C19.25 19.0261 19.0261 19.25 18.75 19.25H11.25C10.9739 19.25 10.75 19.0261 10.75 18.75V11.25Z",fill:"currentColor"})]}),move:(0,d.jsxs)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,d.jsx)(c.Path,{d:"M9.25 5.75H8.75V6.25H9.25V5.75Z",fill:"currentColor",stroke:"none"}),(0,d.jsx)(c.Path,{d:"M9.25 11.75H8.75V12.25H9.25V11.75Z",fill:"currentColor",stroke:"none"}),(0,d.jsx)(c.Path,{d:"M9.25 17.75H8.75V18.25H9.25V17.75Z",fill:"currentColor",stroke:"none"}),(0,d.jsx)(c.Path,{d:"M15.25 5.75H14.75V6.25H15.25V5.75Z",fill:"currentColor",stroke:"none"}),(0,d.jsx)(c.Path,{d:"M15.25 11.75H14.75V12.25H15.25V11.75Z",fill:"currentColor",stroke:"none"}),(0,d.jsx)(c.Path,{d:"M15.25 17.75H14.75V18.25H15.25V17.75Z",fill:"currentColor",stroke:"none"}),(0,d.jsx)(c.Path,{d:"M9.25 5.75H8.75V6.25H9.25V5.75Z"}),(0,d.jsx)(c.Path,{d:"M9.25 11.75H8.75V12.25H9.25V11.75Z"}),(0,d.jsx)(c.Path,{d:"M9.25 17.75H8.75V18.25H9.25V17.75Z"}),(0,d.jsx)(c.Path,{d:"M15.25 5.75H14.75V6.25H15.25V5.75Z"}),(0,d.jsx)(c.Path,{d:"M15.25 11.75H14.75V12.25H15.25V11.75Z"}),(0,d.jsx)(c.Path,{d:"M15.25 17.75H14.75V18.25H15.25V17.75Z"})]}),warning:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M12 8L12 13M12 14.5L12 16M4.75 12C4.75 7.99593 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12Z",strokeLinejoin:"round"})}),info:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M12 16V11M12 9.5V8M19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12C4.75 7.99594 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12Z",strokeLinejoin:"round"})}),close:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M7.75 16.25L16.25 7.75M16.25 16.25L7.75 7.75"})}),check:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M7 12L10 15L17 8"})}),chevron:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M7 11L12 15L17 11"})}),desktop:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M4.75 16.75V17H3.25C3.11193 17 3 17.1119 3 17.25H21C21 17.1119 20.8881 17 20.75 17H19.25V16.75M4.75 16.75V8.5C4.75 7.80964 5.30964 7.25 6 7.25H18C18.6904 7.25 19.25 7.80964 19.25 8.5V16.75M4.75 16.75H19.25"})}),tablet:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M10 16.5H14M18.25 18V6C18.25 5.30964 17.6904 4.75 17 4.75H7C6.30964 4.75 5.75 5.30964 5.75 6L5.75 18C5.75 18.6904 6.30964 19.25 7 19.25H17C17.6904 19.25 18.25 18.6904 18.25 18Z"})}),mobile:(0,d.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,d.jsx)(c.Path,{d:"M11 16.5H13M16.25 18V6C16.25 5.30964 15.6904 4.75 15 4.75H9C8.30964 4.75 7.75 5.30964 7.75 6L7.75 18C7.75 18.6904 8.30964 19.25 9 19.25H15C15.6904 19.25 16.25 18.6904 16.25 18Z"})})};function f(e,t,n="right"){const o=e&&!Array.isArray(e)&&e.bounds&&["x","y","width","height"].every(t=>Number.isFinite(e.bounds[t]))&&e.bounds.width>0&&e.bounds.height>0&&[null,"left","center","right"].includes(e.dock)&&"boolean"==typeof e.expanded&&(void 0===e.anchor||["left","center","right"].includes(e.anchor));let r=!!o&&e.expanded;const i={width:480,height:393},a=o?{...e.bounds}:{x:0,y:0,...i};let s=o?e.dock:n,l=s||o&&e.anchor||"right";function c(){return"left"===l?0:"center"===l?.5:1}function d(e,n=t(!s),o=320,r=220){return e.width=Math.min(n.width,Math.max(Math.min(o,n.width),e.width)),e.height=Math.min(n.height,Math.max(Math.min(r,n.height),e.height)),e.x=Math.max(n.left,Math.min(n.right-e.width,e.x)),e.y=Math.max(n.top,Math.min(n.bottom-e.height,e.y)),e}function u(e){if(!s)return e;const n=t();return e.x="left"===s?n.left:"center"===s?n.left+(n.width-e.width)/2:n.right-e.width,e.y=n.bottom-e.height,e}return{area:t,compactRect:function(){return u(d({...a}))},launcherRect:function(e){return u(d({...e,x:a.x+(a.width-e.width)*c(),y:a.y+a.height-e.height},t(!s),1,1))},usableEdge:function(e){return!(s&&(e.includes("s")||"left"===s&&e.includes("w")||"right"===s&&e.includes("e")))},get anchor(){return l},get anchorFactor(){return c()},get dock(){return s},get expanded(){return r},get layout(){return{bounds:{...a},dock:s,anchor:l,expanded:r}},toggleExpanded(){r=!r},dockTo:function(e="right",t=!1){t&&Object.assign(a,i),r=!1,l=s=e},resize(e,n,o,r){Object.assign(a,function(e,n,o,r){const i=t(!s),a=n.includes("e")||n.includes("w"),c=n.includes("n")||n.includes("s"),d=function(e){return"center"===l?.5:e.includes("w")?1:0}(n),u=e.x+e.width*d,f=n.includes("n"),p=e.y+(f?e.height:0),m=function(e,t,n){return 0===n?e.right-t:1===n?t-e.left:2*Math.min(t-e.left,e.right-t)}(i,u,d),h=f?p-i.top:i.bottom-p,g=(n.includes("w")?-o:o)*(.5===d?2:1),w=Math.max(Math.min(320,m),Math.min(m,e.width+g)),v=Math.max(Math.min(220,h),Math.min(h,e.height+(f?-r:r))),y=a&&0!==o&&w!==e.width,b=c&&0!==r&&v!==e.height,x=f?p-v:p;return{x:y?u-w*d:e.preferredBounds.x,y:b?x:e.preferredBounds.y,width:y?w:e.preferredBounds.width,height:b?v:e.preferredBounds.height}}(e,n,o,r))},move:function(e,n,o,r=!1){const i=d({...e,x:e.x+n,y:e.y+o},t(!0),r?1:320,r?1:220);a.x=i.x+(r?(i.width-a.width)*c():0),a.y=i.y+(r?i.height-a.height:0),s=null}}}function p(t,{postTitle:o="",publicRedirect:r,inlineLauncher:i,nativeLauncher:c,canRememberVisibility:d=!0,onOpen:p,onClose:m,onRefresh:h,onRetry:g,beforeMove:w,afterMove:v,beforeViewportChange:y}){const b=window,x=document,M="meet-the-frontend-live-preview-panel",P=(0,n.select)(a.store),S=(0,n.dispatch)(a.store),k="width"===P.get(M,"fit")?"width":"automatic";S.setDefaults(M,{rememberVisibility:!0,rememberPosition:!0,panelOpen:!0,scrollToChanges:!0,viewport:"desktop",fitMode:k,customZoom:100,tabletOrientation:"portrait",mobileOrientation:"portrait"});const E=()=>!i&&(!c||c.fallbackMedia.matches);let C=!1!==P.get(M,"rememberVisibility"),L=!1!==P.get(M,"rememberPosition"),O=!1!==P.get(M,"scrollToChanges");const T=i?.parentElement??x.getElementById("mtflpp-toggle"),V=x.getElementById("mtflpp-panel");if(!T||!V)throw new Error("Preview panel markup is missing.");const A=i||function(t){let n;const{title:o,moveHelp:r}=t.dataset;return(0,e.flushSync)(()=>(0,e.createRoot)(t).render((0,e.createElement)(s.Button,{ref:e=>{n=e},variant:"secondary",label:o,title:o,description:r,"aria-controls":"mtflpp-panel","aria-expanded":!1},(0,e.createElement)("span",{className:"mtflpp-launcher-label"},o)))),n}(T),j=V.querySelector(".mtflpp-move-control"),R=V.querySelector(".mtflpp-resize"),_=V.querySelectorAll("[data-resize-edge]"),H=V.querySelector(".mtflpp-header"),$=V.querySelector(".mtflpp-caption"),F=V.querySelector(".mtflpp-viewport"),N=V.querySelector(".mtflpp-canvas"),B=V.querySelector(".mtflpp-stage"),D=V.querySelector(".mtflpp-empty"),q=V.querySelector(".mtflpp-devicebar"),W=V.querySelector(".mtflpp-dimensions"),z=V.querySelector(".mtflpp-feedback"),I=V.querySelector('[role="status"]');let Z;const J=function(e,t,n,o={},r=()=>{},i={desktop:"Desktop",tablet:"Tablet",mobile:"Phone"}){const a=e.ownerDocument.defaultView,s=e.querySelector(".mtflpp-canvas"),l=e.querySelector(".mtflpp-canvas-space"),c=n.querySelector(".mtflpp-dimensions-text"),d={desktop:[1280,800],tablet:[768,1024],mobile:[390,844]},u=Object.keys(d);let f=u.includes(o.device)?o.device:"desktop";const p=["automatic","window","width","custom"];let m=p.includes(o.fit)?o.fit:"automatic";const h=e=>Number.isInteger(e)&&e>=10&&e<=400;let g,w=h(o.customZoom)?o.customZoom:100,v=100;const y=e=>"desktop"===e?"landscape":"portrait",b=Object.fromEntries(u.map(e=>[e,"desktop"!==e&&["portrait","landscape"].includes(o[`${e}Orientation`])?o[`${e}Orientation`]:y(e)])),x=()=>b[f]===y(f)?d[f]:[...d[f]].reverse(),M=()=>"width"===m;let P,S,k;const E=a.matchMedia("(prefers-reduced-motion: no-preference)");function C(){const t=e.ownerDocument.defaultView.devicePixelRatio;return Number.isFinite(t)&&t>0?t:1}function L(e,t){if("custom"===m)return w/100/C();const n=s.clientWidth/e;if(M())return n;const o=Math.min(n,s.clientHeight/t);return"automatic"===m?Math.min(1/C(),o):o}function O(e,n){P=e;const[o,r]=x(),i=Math.max(0,(s.clientWidth-o*P)/2),a=Math.max(0,(s.clientHeight-r*P)/2);Object.assign(l.style,{width:`${Math.max(s.clientWidth,i+o*P)}px`,height:`${Math.max(s.clientHeight,a+r*P)}px`}),Object.assign(t.style,{left:`${i}px`,top:`${a}px`,transform:`scale(${P})`});const c=o*P>s.clientWidth+.01||r*P>s.clientHeight+.01,d="custom"===m||M();s.tabIndex=d&&c?0:-1,s.scrollLeft="custom"===m?n.x*P:0,s.scrollTop=d?n.y*P:0}function T(){if(!S)return;const e=S;S=null,e.window.cancelAnimationFrame(e.frame),e.resolve?.()}function V(e,t,n,o){return t<=0||o&&e<-1&&t<n?Math.max(e,t-n):e>=n||o&&e>0&&t>n+1?Math.min(e,t-n):0}function A(o=!1,a=!1){T();const[l,d]=x();if(Object.assign(t.style,{width:`${l}px`,height:`${d}px`}),!e.clientWidth||!e.clientHeight)return;const u=C(),p=`${i[f]} (${l} × ${d}) · `,h=Math.max(400,Math.ceil(e.clientWidth/l*u*100)),y=`${p}${"0".repeat(String(h).length)}%`;n.dataset.reserve!==y&&(n.dataset.reserve=y);const b=a?{x:0,y:0}:{x:(s.scrollLeft||0)/(P||1),y:(s.scrollTop||0)/(P||1)};if(s.style.overflowX="hidden",s.style.overflowY="hidden","custom"===m){const e=L(l,d);for(let t=0;t<2;t++)l*e>s.clientWidth+.01&&(s.style.overflowX="scroll"),d*e>s.clientHeight+.01&&(s.style.overflowY="scroll")}else M()&&d*L(l,d)>e.clientHeight&&(s.style.overflowY="scroll");if(!s.clientWidth||!s.clientHeight)return;const k=L(l,d),V=Math.round(k*u*100),A=V!==v||u!==g;v=V,g=u;const j=`${p}${"custom"===m?w:v}%`;c.textContent!==j&&(c.textContent=j),A&&r();const R=P??k;if(!o||!E.matches||R===k)return void O(k,b);const _={window:e.ownerDocument.defaultView,frame:null},H=_.window.performance.now();S=_;const $=e=>{O(e,b),_.scrollLeft=s.scrollLeft,_.scrollTop=s.scrollTop};$(R);const F=e=>{if(S!==_)return;const t=Math.min(1,Math.max(0,(e-H)/200));$(R+(k-R)*(1-(1-t)**3)),t<1?_.frame=_.window.requestAnimationFrame(F):T()};_.frame=_.window.requestAnimationFrame(F)}function j(){A()}function R(){k?.();const t=e.ownerDocument.defaultView.matchMedia(`(resolution: ${C()}dppx)`);t.addEventListener("change",R),k=()=>t.removeEventListener("change",R),j()}let _=new a.ResizeObserver(j);return _.observe(e),E.addEventListener("change",j),a.addEventListener("resize",R),R(),{get device(){return f},get fit(){return m},get customZoom(){return w},get zoomPercent(){return"custom"===m?w:v},get dpr(){return C()},get orientation(){return b[f]},canvasTarget:function(e,t,{fitTarget:n=!1}={}){const o=e.getBoundingClientRect(),r=s.getBoundingClientRect(),i=o.left-r.left-s.clientLeft,a=o.top-r.top-s.clientTop,l=V(i+t.left*P,i+t.right*P,s.clientWidth,n),c=V(a+t.top*P,a+t.bottom*P,s.clientHeight,n),d=Math.max(t.left,-i/P),u=Math.min(t.right,(s.clientWidth-i)/P);return{visible:!l&&!c,visibleCenterX:d<u?(d+u)/2:void 0,distance:Math.hypot(l,c),reveal(e="instant"){(l||c)&&s.scrollBy({left:l,top:c,behavior:e})}}},canvasWasPanned:function(){return!!S&&(s.scrollLeft!==S.scrollLeft||s.scrollTop!==S.scrollTop)},whenSettled:function(){if(!S)return;const e=S;return e.done??=new Promise(t=>{e.resolve=t}),e.done},finishMotion(){S&&j()},select(e,{animate:t=!1,keepPan:n=!1}={}){if(!u.includes(e))return;const o=f!==e;f=e,o?A(t,!n):S||j()},rotate({animate:e=!1,keepPan:t=!1}={}){"desktop"!==f&&(b[f]="portrait"===b[f]?"landscape":"portrait",A(e,!t))},setFit(e){p.includes(e)&&m!==e&&(m=e,A(!1,!0))},setZoom(e){if(!h(e)||"custom"===m&&w===e)return;const t="custom"!==m;w=e,m="custom",A(!1,t)},layout:j,beforeMove(){T(),_.disconnect(),k?.(),e.ownerDocument.defaultView.removeEventListener("resize",R)},afterMove(){_=new e.ownerDocument.defaultView.ResizeObserver(j),_.observe(e),e.ownerDocument.defaultView.addEventListener("resize",R),R()}}}(F,B,W,{device:P.get(M,"viewport"),fit:P.get(M,"fitMode")??k,customZoom:P.get(M,"customZoom"),tabletOrientation:P.get(M,"tabletOrientation"),mobileOrientation:P.get(M,"mobileOrientation")},()=>Ce(),t),G=x.querySelector("#wpbody-content > .wrap"),U=x.getElementById("wpadminbar");function X(e=!1){const t=Math.max(1,x.documentElement.clientWidth),n=Math.max(1,x.documentElement.clientHeight),o=x.documentElement.getBoundingClientRect().left+b.scrollX,r=!e&&G?.getBoundingClientRect(),i=r?Math.max(0,"rtl"===b.getComputedStyle(G).direction?r.left-o:o+t-r.right):20,a=e?0:i,s=Math.min(a,(t-1)/2),l=Math.min(Math.max(0,U?.getBoundingClientRect().bottom||0)+a,n-1),c=t-s,d=n-Math.min(a,n-l-1);return{left:s,top:l,right:c,bottom:d,width:c-s,height:d-l}}let Y,K=d&&(!C||!1!==P.get(M,"panelOpen")),Q=!1;const ee=P.get(M,"layout"),te=P.get(M,"position")??ee?.dock??ee?.anchor;let ne=["left","center","right"].includes(te)?te:"right";const oe=f(L?ee:void 0,X,ne),{compactRect:re,usableEdge:ie}=oe;let ae,se=!1,le="",ce=!1,de={text:t.loading,state:"loading",hasPreview:!1,canRetry:!1,reason:""},ue=!1;function fe(e){const n="string"==typeof e?e.replace(/\s+/g," ").trim():"";$.textContent=n?`${t.preview} — ${n}`:t.title,$.title=$.textContent,Y&&(Y.document.title=$.textContent)}function pe(){const{text:e,state:n,hasPreview:o,reason:r}=de;return"handover"===n?{heading:t.switchingPreview,description:e,note:t.tabEdits}:"conflict"===n?{heading:e,description:{"handed-off":t.handedOffHelp,busy:t.takeoverTimeoutHelp,manual:t.closeOtherHelp}[r]||t.conflictHelp,note:"manual"===r?t.manualSwitchHint:t.tabEdits}:"paused"===n?{heading:t.pausedTitle,description:e,note:""}:"error"===n?function(){const{text:e,hasPreview:n,canRetry:o,reason:r}=de;if("origin-mismatch"===r)return{heading:t.originMismatchTitle,description:n?`${e} ${t.previousPreview}`:e,note:""};if("unavailable"===r||"browser"===r)return{heading:"unavailable"===r?t.unavailableTitle:t.browserTitle,description:e,note:""};const i={reload:t.reviewBeforeReload,"reload-before-save":t.nativePreviewAcfReload}[r];if(!n){let n=e;return e===t.failed&&(n=o?t.failedHelp:""),i&&(n+=` ${i}`),{heading:t.failed,description:n,note:""}}return{heading:e===t.failed?t.refreshFailed:e,description:i||t.previousPreview,note:""}}():o?{heading:e,description:"",note:""}:{heading:t.loading,description:t.preparing,note:""}}function me(){return se?"handover"===de.state?t.takingOver:t.takeOver:t.retry}function he(e){return!e||["handover","paused"].includes(de.state)?"info":"error"!==de.state||de.canRetry?"warning":"error"}function ge(){return de.redirectDestination?`${t.redirected} ${de.redirectDestination}`:de.hasHtmlPreview&&ae?`${t.publicRedirected} ${ae}`:""}function we(){const{state:e,hasPreview:n,canRetry:o,reason:r}=de,i=n&&["error","conflict","handover","paused"].includes(e),a=!n||i||le?"":ge();if(z.hidden=!i&&!le&&!a,z.tabIndex=z.hidden?-1:0,V.dataset.hasFeedback=String(!z.hidden),z.hidden)return null;if(a)return{heading:a,status:"info",dismissible:!1};const{heading:s,description:l}=pe();return{heading:i?s:le,description:i?l:t.windowNoticeHelp,status:he(i),dismissible:!i,retry:i&&(se||o&&["error","conflict"].includes(e)),close:i&&"error"===e&&!o&&!["reload","reload-before-save"].includes(r),disabled:"handover"===e,action:me()}}function ve(e){de.hasPreview&&["error","conflict","handover","paused"].includes(de.state)||(le=e,Ce()),I.textContent=`${e} ${t.windowNoticeHelp}`}function ye(){le="",Ce()}function be(e,t="loading",{canTakeOver:n=!1,hasPreview:o=!1,hasHtmlPreview:i=!1,redirectDestination:a,canRefresh:s=!1,canRetry:l=!0,reason:c=""}={}){const d=V.ownerDocument.activeElement,u=V.contains(d),f=!o&&(de.state!==t||de.text!==e||de.reason!==c),p=de.hasPreview!==o;de={text:e,state:t,canTakeOver:n,hasPreview:o,hasHtmlPreview:i,redirectDestination:a,canRefresh:s,canRetry:l,reason:c},["error","conflict","handover","paused"].includes(t)&&(le=""),V.dataset.state=t,V.dataset.hasPreview=String(o),se=n&&["conflict","handover"].includes(t),D.hidden=o,q.hidden=!o;const{heading:m,description:h,note:g}=pe();f&&(D.scrollTop=0);const w="ready"!==t||le?"":ge();I.textContent=o?[m,h,g,w].filter(Boolean).join(" "):m,Ce(),p&&J.layout(),function(e,t){e&&t&&(!V.contains(e)||e.closest("[hidden]")||e.disabled||!de.hasPreview&&N.contains(e))&&Z.focus(D.hidden?"actions":"empty-title")}(d,u),K&&"ready"===t&&i&&!a&&async function(){if(r&&!ce){ce=!0;try{const e=new URL(r.endpoint);if(e.origin!==b.location.origin)return;const t=await b.fetch(e,{credentials:"same-origin",cache:"no-store",redirect:"error",headers:{"X-WP-Nonce":r.nonce}});if(!t.ok)return;const{destination:n}=await t.json();if("string"!=typeof n||!n)return;if(ae=n,!K)return;Ce(),"ready"!==de.state||!de.hasHtmlPreview||de.redirectDestination||le||(I.textContent=ge())}catch{}}}()}function xe(e){d&&C&&P.get(M,"panelOpen")!==e&&S.set(M,"panelOpen",e)}function Me(){L&&S.set(M,"layout",oe.layout)}function Pe(){const e=T.hidden;T.hidden=!1,T.style.maxWidth=`${X(!oe.dock).width}px`;const t={width:T.offsetWidth,height:T.offsetHeight};return T.hidden=e,oe.launcherRect(t)}function Se(){if(Y)return;if(!K&&E()){const e=Pe(),t=oe.anchorFactor;Object.assign(T.style,{left:`${e.x+e.width*t}px`,top:`${e.y+e.height}px`,transform:`translate(${-100*t}%, -100%)`})}let e=re();if(V.dataset.anchor=oe.anchor,oe.expanded){const t=X();e={x:t.left,y:t.top,width:t.width,height:t.height}}Object.assign(V.style,{left:`${e.x}px`,top:`${e.y}px`,width:`${e.width}px`,height:`${e.height}px`,transform:""})}function ke(e="right",t=!1){oe.dockTo(e,t),ne=e,S.set(M,"position",ne),Se(),Me(),Ce()}function Ee(){return"function"==typeof b.documentPictureInPicture?.requestWindow}function Ce(){if(!Z)return;const e=V.ownerDocument.fullscreenElement===V,n=!Y&&!e,o=n&&!oe.expanded;V.classList.toggle("mtflpp-expanded",oe.expanded),R.hidden=!o;for(const e of _)e.hidden=!o||!ie(e.dataset.resizeEdge);const r=se||de.canRetry&&["error","conflict"].includes(de.state);var i;Z.update({inPage:n,inPip:!!Y,movable:o,dock:oe.dock,canRememberVisibility:d,rememberVisibility:C,rememberPosition:L,followChanges:O,device:J.device,busy:de.hasPreview&&["stale","loading","handover"].includes(de.state)&&de.text!==t.saving,empty:de.hasPreview?null:{...pe(),busy:["loading","stale","ready","handover"].includes(de.state),icon:["paused","conflict"].includes(de.state)||["unavailable","browser","origin-mismatch"].includes(de.reason)?"info":"warning",retry:r,disabled:"handover"===de.state,close:"error"===de.state&&!r,action:me()},notice:we(),fit:J.fit,orientation:J.orientation,customZoom:J.customZoom,zoomPercent:J.zoomPercent,dpr:J.dpr,canRefresh:de.canRefresh,hasPreview:de.hasPreview,canPip:n&&Ee(),canFullscreen:n&&!!x.fullscreenEnabled,mode:e||oe.expanded?"compact":"expand",modeLabel:(i=e,i?t.exitFullscreen:oe.expanded?t.compact:t.expand)})}function Le(){Z.closeMenu(),Y?Y.close():x.fullscreenElement!==V?(oe.toggleExpanded(),Se(),Me(),Ce(),Z.focus("mode")):x.exitFullscreen().then(ye,()=>ve(t.fullscreenFailed))}function Oe(e,n=!1,o){const r=e===A,i=e===H,a=()=>o||("left"===oe.anchor?"ne":"nw"),s=()=>Y||!r&&oe.expanded||x.fullscreenElement===V||n&&!ie(a());let l,c;const d=()=>({...r?Pe():re(),preferredBounds:oe.layout.bounds});function u(){if(c=null,l)if(n||r)Se();else{const e=re(),t=e.x-parseFloat(V.style.left),n=e.y-parseFloat(V.style.top);Object.assign(V.style,{width:`${e.width}px`,height:`${e.height}px`,transform:`translate3d(${t}px, ${n}px, 0)`})}}function f(){if(!l)return;const{pointer:t,moved:n}=l;l=null,b.cancelAnimationFrame(c),e.hasPointerCapture(t)&&e.releasePointerCapture(t),V.classList.remove("mtflpp-dragging"),e.classList.remove("mtflpp-edge-active"),x.documentElement.classList.remove("mtflpp-window-dragging"),x.documentElement.style.removeProperty("--mtflpp-drag-cursor"),Se(),n&&(r&&(ue=!0),Me(),Ce())}e.addEventListener("pointerdown",t=>{0!==t.button||s()||i&&t.target.closest('button, a, [role="button"]')||(r&&(ue=!1),t.preventDefault(),r?A.focus({preventScroll:!0}):e===j&&Z.focus("move"),Z.closeMenu(),l={...d(),pointer:t.pointerId,pointerX:t.clientX,pointerY:t.clientY},e.setPointerCapture(t.pointerId))}),e.addEventListener("pointermove",t=>{if(!l||l.pointer!==t.pointerId)return;const o=t.clientX-l.pointerX,i=t.clientY-l.pointerY;!l.moved&&Math.abs(o)+Math.abs(i)<4||(l.moved=!0,V.classList.add("mtflpp-dragging"),n&&e.classList.add("mtflpp-edge-active"),x.documentElement.style.setProperty("--mtflpp-drag-cursor",n?b.getComputedStyle(e).cursor:"grabbing"),x.documentElement.classList.add("mtflpp-window-dragging"),n?oe.resize(l,a(),o,i):oe.move(l,o,i,r),c||(c=b.requestAnimationFrame(u)))});for(const t of["pointerup","pointercancel","lostpointercapture"])e.addEventListener(t,f);b.addEventListener("blur",f),i||o||e.addEventListener("keydown",e=>{const o={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[e.key];if(!o||e.altKey||e.ctrlKey||e.metaKey||s())return;e.preventDefault(),Z.closeMenu();const i=d(),l=e.shiftKey?40:10;n?oe.resize(i,a(),o[0]*l,o[1]*l):oe.move(i,o[0]*l,o[1]*l,r),Se(),Me(),Ce();const c=re();I.textContent=n?`${t.resize}: ${Math.round(c.width)} × ${Math.round(c.height)}`:t.moved})}fe(o),H.addEventListener("dblclick",e=>{Y||e.target.closest("button, a")||Le()}),x.addEventListener("fullscreenchange",Ce),R.addEventListener("keydown",e=>{"Escape"===e.key&&R.classList.add("mtflpp-help-dismissed")}),R.addEventListener("blur",()=>R.classList.remove("mtflpp-help-dismissed")),Oe(j),Oe(H),i||Oe(A),Oe(R,!0);for(const e of _)Oe(e,!0,e.dataset.resizeEdge);function Te(){V.hidden=Q||!K,T.hidden=Q||!i&&(K||!E()),A.setAttribute("aria-expanded",String(!V.hidden))}function Ve(){Z.closeMenu(),Y?.close(),x.fullscreenElement===V&&x.exitFullscreen().catch(()=>{})}function Ae(e=!0){Q||(K?Z.focus("actions"):(xe(!0),p(),K&&e&&Z.focus("actions")))}return b.addEventListener("resize",Se),b.addEventListener("scroll",Se,{passive:!0}),c?.fallbackMedia.addEventListener("change",()=>{Se(),Te()}),A.addEventListener("click",e=>{if(ue&&0!==e.detail)return ue=!1,void e.preventDefault();ue=!1,Ae(0===e.detail)}),Z=function(t,o,r){const i=t.querySelector(".mtflpp-controls"),a=t.querySelector(".mtflpp-refresh-control"),c=t.querySelector(".mtflpp-move-control"),d=t.querySelector(".mtflpp-device-controls"),f=t.querySelector(".mtflpp-fit-control"),p=t.querySelector(".mtflpp-pip-control"),m=t.querySelector(".mtflpp-empty"),h=t.querySelector(".mtflpp-feedback");let g,w=(0,e.createRoot)(i),v=!1,y=!1,b=!1;const x=l.InlineNotices?(0,n.dispatch)(l.store):null,M=t.ownerDocument.defaultView?.wp?.theme?.ThemeProvider,P="meet-the-frontend-live-preview-panel",S="preview-feedback";let k="";function E(){const e=g.notice,t=/[.!?…。!?]$/.test(e.heading)?e.heading:`${e.heading}.`;return{message:e.description?`${t} ${e.description}`:e.heading,status:e.status,isDismissible:e.dismissible,actions:[...e.retry?[{label:e.action,disabled:e.disabled,onClick:r.retry}]:[],...e.close?[{label:o.close,onClick:r.close}]:[]]}}function C(){x&&k&&x.removeNotice(S,P),k=""}function L(e){return()=>{V(),e()}}function O(){const{inPage:n,inPip:i,mode:w,modeLabel:S,movable:k,busy:C,canRefresh:O,hasPreview:A,canPip:j}=g;return(0,e.createElement)(s.SlotFillProvider,null,(0,e.createPortal)(k&&n&&(0,e.createElement)(s.Button,{className:"mtflpp-icon mtflpp-move",size:"compact",icon:u.move,label:o.move,showTooltip:!0,tooltipPosition:"bottom","data-action":"move"}),c),(0,e.createPortal)((0,e.createElement)(s.Button,{className:"mtflpp-icon",size:"compact",icon:C?(0,e.createElement)(s.Spinner):u.refresh,label:o.refresh,showTooltip:!0,accessibleWhenDisabled:!0,disabled:!O,onClick:r.refresh,"data-action":"refresh"}),a),(0,e.createPortal)(j&&A&&(0,e.createElement)("div",{className:"mtflpp-pip-surface"},(0,e.createElement)(s.Button,{className:"mtflpp-pip-button",icon:u.pip,label:o.popOutHelp,"aria-label":o.popOut,description:o.popOutHelp,showTooltip:!0,onClick:r.popOut,"data-action":"pop-out"})),p),function(){const{canPip:t,canFullscreen:n,inPage:i,inPip:a,dock:l,canRememberVisibility:c,rememberVisibility:d,rememberPosition:f,followChanges:p}=g;return(0,e.createElement)(s.DropdownMenu,{className:"mtflpp-actions",label:o.actions,icon:u.more,open:v,onToggle(e){v=e,e&&(y=!1),T()},toggleProps:{className:"mtflpp-icon",size:"compact","data-action":"actions"},popoverProps:{placement:"bottom-end",offset:6,shift:!0,className:"mtflpp-menu-popover"}},()=>(0,e.createElement)(e.Fragment,null,(t||n)&&(0,e.createElement)(s.MenuGroup,{label:o.display},t&&(0,e.createElement)(s.MenuItem,{label:o.popOutHelp,description:o.popOutHelp,showTooltip:!0,onClick:L(r.popOut),"data-action":"pip","aria-label":o.popOut},o.popOut),n&&(0,e.createElement)(s.MenuItem,{onClick:L(r.fullscreen),"data-action":"fullscreen"},o.fullscreen)),i&&(0,e.createElement)(s.MenuGroup,{label:o.position},(0,e.createElement)(s.MenuItemsChoice,{value:l,choices:[{value:"left",label:o.bottomLeft},{value:"center",label:o.bottomCenter},{value:"right",label:o.bottomRight}],onSelect(e){V(),r.dock(e)}})),(0,e.createElement)(s.MenuGroup,{label:o.preferences},!1!==c&&(0,e.createElement)(s.MenuItem,{role:"menuitemcheckbox",isSelected:d,icon:d?u.check:void 0,info:o.rememberVisibilityHelp,onClick:L(r.rememberVisibility),"data-action":"remember-visibility"},o.rememberVisibility),(0,e.createElement)(s.MenuItem,{role:"menuitemcheckbox",isSelected:f,icon:f?u.check:void 0,info:o.rememberPositionHelp,onClick:L(r.rememberPosition),"data-action":"remember-position"},o.rememberPosition),(0,e.createElement)(s.MenuItem,{role:"menuitemcheckbox",isSelected:p,icon:p?u.check:void 0,info:o.followHelp,onClick:L(r.follow),"data-action":"follow"},o.follow)),i&&(0,e.createElement)(s.MenuGroup,null,(0,e.createElement)(s.MenuItem,{info:o.resetHelp,onClick:L(r.reset),"data-action":"reset"},o.reset)),a&&(0,e.createElement)(s.MenuGroup,null,(0,e.createElement)(s.MenuItem,{onClick:L(r.close),"data-action":"close"},o.closeLivePreview))))}(),!i&&(0,e.createElement)(s.Button,{className:"mtflpp-icon mtflpp-mode",size:"compact",icon:u[w],label:S,showTooltip:!0,onClick:r.mode,"data-action":"mode"}),!i&&(0,e.createElement)(s.Button,{className:"mtflpp-icon",size:"compact",icon:u.close,label:o.close,showTooltip:!0,onClick:r.close,"data-action":"close"}),(0,e.createPortal)(function(){const{device:t,orientation:n}=g;return(0,e.createElement)(s.Toolbar,{className:"mtflpp-devices",label:o.viewport,variant:"unstyled"},...["desktop","tablet","mobile"].map(i=>{const a=t===i,l=a&&"desktop"!==i,c=l&&"landscape"===n,d="portrait"===n?o.rotateLandscape:o.rotatePortrait;return(0,e.createElement)(s.ToolbarButton,{key:i,icon:u[i],className:c?"mtflpp-device-rotated":void 0,label:l?`${o[i]} — ${d}`:o[i],isPressed:a,"data-viewport":i,onClick:()=>r.device(i)})}))}(),d),(0,e.createPortal)(function(){const{fit:t,customZoom:n=100,dpr:i=1}=g,a={automatic:o.automatic,window:o.fitToWindow,width:o.fitToWidth},l={automatic:o.automaticHelp,window:o.fitToWindowHelp,width:o.fitToWidthHelp},c="custom"===t?o.fixedZoom:a[t]??o.automatic;return(0,e.createElement)(s.Dropdown,{open:y,onToggle(e){y=e,e&&(v=!1,b="custom"===g.fit),T()},contentClassName:"mtflpp-zoom-popover",focusOnMount:"firstElement",popoverProps:{placement:"top-end",offset:8,shift:!0,resize:!1,role:"dialog","aria-label":o.fitting},renderToggle:({isOpen:t,onToggle:n})=>(0,e.createElement)(s.Button,{className:"mtflpp-zoom-toggle",variant:"secondary",size:"compact",label:c,showTooltip:!0,"aria-label":`${o.fitting}: ${c}`,"aria-haspopup":"dialog","aria-expanded":t,onClick:n,"data-action":"zoom"},(0,e.createElement)("span",{className:"mtflpp-zoom-value"},c),u.chevron),renderContent:()=>(0,e.createElement)("div",{className:"mtflpp-zoom-content"},(0,e.createElement)(s.RadioControl,{label:o.zoomMode,selected:t,options:[...Object.entries(a).map(([e,t])=>({value:e,label:t,description:l[e]})),{value:"custom",label:o.fixedZoom,description:o.fixedZoomHelp}],onFocus(e){if(!b)return;b=!1;const t=e.currentTarget.closest(".mtflpp-zoom-content")?.querySelector('.mtflpp-custom-zoom input[type="number"]');t?.focus({preventScroll:!0});const n=t?.closest(".components-popover__content");if(n){const e=t.getBoundingClientRect(),o=n.getBoundingClientRect();n.scrollTop+=Math.min(0,e.top-o.top)+Math.max(0,e.bottom-o.bottom)}},onChange(e){b=!1,"custom"!==e?r.fit(e):r.zoom(n)}}),"custom"===t&&(0,e.createElement)("div",{className:"mtflpp-custom-zoom",onKeyDown(e){if("Enter"!==e.key)return;e.preventDefault();const t=Number(e.target.value);!1!==e.target.validity?.valid&&Number.isInteger(t)&&t>=10&&t<=400&&V()}},(0,e.createElement)(s.RangeControl,{label:o.customZoom,min:10,max:400,step:1,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:n,help:o.customZoomHelp,withInputField:!0,onChange(e){Number.isInteger(e)&&e>=10&&e<=400&&r.zoom(e)}})),(0,e.createElement)("div",{className:"mtflpp-dpr-note",role:"group","aria-label":o.displayInformation},(0,e.createElement)("span",{className:"mtflpp-dpr-value"},`${o.displayDpr}: ${Number(i.toFixed(2))}`),(0,e.createElement)("span",{className:"mtflpp-pixel-note"},o.pixelZoomHelp)))})}(),f),(0,e.createPortal)(function(){const{empty:t}=g;return t?(0,e.createElement)(s.Placeholder,{className:"mtflpp-placeholder","data-empty-icon":t.busy?void 0:t.icon,icon:t.busy?(0,e.createElement)(s.Spinner):u[t.icon],label:(0,e.createElement)("h3",{className:"mtflpp-empty-title",tabIndex:-1,"data-action":"empty-title"},t.heading),instructions:t.description},t.retry&&(0,e.createElement)(s.Button,{key:"retry",variant:"primary",disabled:t.disabled,onClick:r.retry,"data-action":"retry"},t.action),t.close&&(0,e.createElement)(s.Button,{key:"close",variant:"secondary",onClick:r.close,"data-action":"close"},o.close),t.note&&(0,e.createElement)("p",{className:"mtflpp-empty-note"},t.note)):null}(),m),(0,e.createPortal)(function(){if(!g.notice)return null;if(x){const t=(0,e.createElement)(l.InlineNotices,{context:P,className:"mtflpp-inline-notices"});return M?(0,e.createElement)(M,{cornerRadius:"none"},t):t}const{message:t,...n}=E();return(0,e.createElement)(s.Notice,{...n,onRemove:r.dismissNotice,spokenMessage:"",politeness:"polite"},t)}(),h),n?(0,e.createPortal)((0,e.createElement)(s.Popover.Slot),t.ownerDocument.body):(0,e.createElement)(s.Popover.Slot))}function T(){g&&w&&(function(){if(!x)return;if(!g.notice)return void C();const e=JSON.stringify(g.notice);if(k===e)return;const{message:t,status:n,...o}=E();x.createNotice(n,t,{...o,id:S,context:P,speak:!1,onDismiss:r.dismissNotice}),k=e}(),(0,e.flushSync)(()=>w.render((0,e.createElement)(O))))}function V(){(v||y)&&(v=!1,y=!1,T())}function A(e){g?.inPip&&"mode"===e&&(e="actions"),t.querySelector(`[data-action="${e}"]`)?.focus({preventScroll:!0})}return{update(e){const n=y&&!e.hasPreview&&t.ownerDocument.activeElement?.closest(".mtflpp-zoom-popover");e.hasPreview||(y=!1),g=e,T(),n&&A("empty-title")},closeMenu:V,focus:A,beforeMove(){v=!1,y=!1,w?.unmount(),w=null,C()},remount(){w=(0,e.createRoot)(i),T()}}}(V,t,{refresh:()=>{de.canRefresh&&h()},retry:()=>{"handover"!==de.state&&(se||de.canRetry&&["error","conflict"].includes(de.state))&&g(se)},dismissNotice:()=>{ye(),I.textContent=de.text,Z.focus("actions")},mode:Le,close:function(){Z.closeMenu(),xe(!1),m(),i||E()?A.focus():c.focus()},popOut:async function(){if(Q||Y||x.fullscreenElement===V||!Ee())return;let e;Z.closeMenu();const n=()=>{Y===e&&(w(),J.beforeMove(),Z.beforeMove(),x.body.append(V),V.classList.remove("mtflpp-pip"),Y=null,Z.remount(),Se(),J.afterMove(),Ce(),Q||(v(),K&&Z.focus("mode")))};try{if(e=await b.documentPictureInPicture.requestWindow({width:640,height:440}),!K||Q)return void e.close();const t=b.getComputedStyle(V);e.document.documentElement.lang=x.documentElement.lang,e.document.documentElement.dir=t.direction;for(const n of["--wp-admin-theme-color","--wp-admin-theme-color-darker-10","--wp-admin-border-width-focus"]){const o=t.getPropertyValue(n);o&&e.document.documentElement.style.setProperty(n,o)}const o=x.querySelectorAll(['link[rel="stylesheet"][href*="/load-styles.php"]',"#wp-theme-css","#wp-theme-inline-css","#wp-components-css","#wp-components-inline-css","style[data-emotion]","style[data-wp-hash]","#meet-the-frontend-live-preview-panel-css","#meet-the-frontend-live-preview-panel-inline-css"].join(", "));for(const t of o){const n=t.cloneNode(!0);"STYLE"===t.tagName&&t.sheet&&(n.textContent=Array.from(t.sheet.cssRules,e=>e.cssText).join("\n")),n.addEventListener("load",J.layout,{once:!0}),e.document.head.append(n)}e.document.title=$.textContent,e.document.body.className="mtflpp-pip-document",e.addEventListener("resize",J.layout),e.addEventListener("pagehide",n,{once:!0}),Y=e,w(),J.beforeMove(),Z.beforeMove(),V.classList.add("mtflpp-pip"),e.document.body.append(V),Z.remount(),J.afterMove(),Ce(),ye(),Z.focus("mode"),v()}catch{if(e&&(n(),e.close()),Q)return;Z.focus("actions"),ve(t.pipFailed)}},fullscreen:async function(){if(!Q&&!Y&&x.fullscreenEnabled){Z.closeMenu();try{if(await V.requestFullscreen(),Q)return void Ve();ye(),Z.focus("mode")}catch{if(Q)return;Z.focus("actions"),ve(t.fullscreenFailed)}}},dock:e=>ke(e),reset:()=>ke("right",!0),follow:function(){O=!O,S.set(M,"scrollToChanges",O),Ce(),O&&de.canRefresh&&h(!1)},rememberVisibility:function(){C=!C,S.set(M,"rememberVisibility",C),C&&xe(K),Ce()},rememberPosition:function(){L=!L,S.set(M,"rememberPosition",L),L?Me():(S.set(M,"position",ne),S.set(M,"layout",void 0)),Ce()},device(e){const t=J.device;if(e===t&&"desktop"===e)return;let n=!1;if(K&&O&&y){const{fit:e,customZoom:t,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:a}=J;n=!!y({canvas:N,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:a,canFollow:()=>J.fit===e&&J.customZoom===t})}const o={animate:K&&!n,keepPan:n};e===t?(J.rotate(o),S.set(M,`${e}Orientation`,J.orientation)):(J.select(e,o),J.device!==t&&S.set(M,"viewport",J.device)),Ce()},fit(e){const t=J.fit;J.setFit(e),J.fit!==t&&S.set(M,"fitMode",J.fit),Ce()},zoom(e){const t=J.fit,n=J.customZoom;J.setZoom(e),J.customZoom!==n&&S.set(M,"customZoom",J.customZoom),J.fit!==t&&S.set(M,"fitMode",J.fit),Ce()}}),be(t.loading,"loading",{canRetry:!1}),Se(),Te(),i&&(i.disabled=!1),{stage:B,canvasTarget:J.canvasTarget,get visible(){return K},get followChanges(){return O},openFromLauncher:Ae,setSuspended(e){Q!==e&&(Q=e,Te(),e?Ve():Se())},setVisible(e){e||(Z.closeMenu(),le="",Ce(),J.layout()),K=e,Se(),Te()},report:be,setTitle:fe,clearPreview(){B.replaceChildren();const e=["ready","stale","loading"].includes(de.state);be(e?t.loading:de.text,e?"loading":de.state,{...de,hasPreview:!1,hasHtmlPreview:!1,redirectDestination:void 0,canRefresh:!1,canRetry:!e&&de.canRetry})},returnToEditor:Ve}}function m(e=[]){const t=Array.isArray(e)?[...e]:[],n=new WeakMap;return{capture(e,o){try{if(n.has(e))return;const r=function(e){try{const t=e.querySelector('meta[name="meet-the-frontend-live-preview-panel"]'),n=t?.getAttribute("data-mtflpp-source");if(!n)return null;const o=JSON.parse(n);if("string"!=typeof o)return null;const r=(new DOMParser).parseFromString(o,"text/html");return r.querySelector('meta[name="meet-the-frontend-live-preview-panel"]')?.content===t.content?r:null}catch{return null}}(e);n.set(e,{source:r?E(r,e,t):null,dom:E(e,e,t),values:o&&structuredClone(o)})}catch{}},findChange(e,t){try{const o=n.get(e),r=n.get(t);if(!o||!r)return null;const i=function(e,t){if(!e||!t)return[];const n=[];for(const o of new Set([...Object.keys(e),...Object.keys(t)])){const r=Object.hasOwn(e,o)?e[o]:{type:t[o]?.type,value:""},i=Object.hasOwn(t,o)?t[o]:{type:e[o]?.type,value:""};if(r.type!==i.type||!["text","html"].includes(i.type)||"string"!=typeof r.value||"string"!=typeof i.value||r.value===i.value)continue;let a,s;try{a="html"===r.type?(new DOMParser).parseFromString(r.value,"text/html"):null,s="html"===i.type?(new DOMParser).parseFromString(i.value,"text/html"):null}catch{continue}const l=a?E(a,a,[],a.body):null,c=s?E(s,s,[],s.body):null,d=a?$(l):r.value,u=s?$(c):i.value,f=T(d),p=T(u);if(f!==p&&n.push({...G(f,p),type:"text",fullBefore:f,fullAfter:p}),!a){const e=H(d,u);e&&n.push(e);continue}if(l&&c&&(f===p||V(d,u)))for(const e of O(l,c)){if(e.spacing){const t=_(e);t&&n.push(t);continue}if(f===p)if("attributes"===e.kind){const t=new Map(e.before.attributes),o=new Map(e.after.attributes);for(const e of new Set([...t.keys(),...o.keys()])){const r=t.get(e)??"",i=o.get(e)??"";JSON.stringify(r)!==JSON.stringify(i)&&n.push({type:"attribute",name:e,before:"string"==typeof r?r:JSON.stringify(r),after:"string"==typeof i?i:JSON.stringify(i)})}}else if("content"===e.kind){const t=T($(e.before)),o=T($(e.after));t===o&&ee(e.before,e.after,$)&&n.push({type:"markup",before:t,after:o,oldTag:e.before.tag,newTag:e.after.tag}),(e.before.media||[]).forEach((t,o)=>{const r=e.after.media?.[o];t&&r&&t!==r&&n.push({type:"media",before:t,after:r})})}}}return n}(o.values,r.values),a=function(e,t){if(!e||!t)return!1;const n=(e,t)=>Object.entries(e).some(([e,n])=>["text","html","value","row-image"].includes(n?.type)&&(!Object.hasOwn(t,e)||n.type!==t[e]?.type||n.value!==t[e]?.value));return n(e,t)||n(t,e)}(o.values,r.values),s=!!o.source&&!!r.source,l=!!o.source!=!!r.source,c=function(e,t,n){if(!e||!t)return;const o=Object.entries(t).filter(([t,n])=>"row-order"===n?.type&&"row-order"===e[t]?.type&&e[t].value!==n.value);if(1!==o.length)return;const[[r,i]]=o,a=e[r];if(!i.moved||i.members!==a.members)return;const s=JSON.parse(a.value),l=JSON.parse(i.value),c=s.indexOf(i.moved),d=l.indexOf(i.moved);if(-1===c||-1===d||c===d||s.length!==l.length)return;if(s.splice(c,1),l.splice(d,1),!s.every((e,t)=>e===l[t]))return;const u=d-c,f={html:new Map,peerLabels:new Map},p=q(r,i.moved,s,e,t,f),m=function(e,t,n,o,r,i){if([n,...o].some(n=>!e?.[n]||!t?.[n]))return[];const a=new Set(e[n]),s=new Set,l=new Set,c=new Set;for(const[n,a]of[[e,r],[t,i]])for(const e of o.flatMap(e=>n[e])){const t=a[e];"row-image"===t?.type&&(c.add(t.value),l.add(t.alt))}for(const e of t[n]){const t=r[e],n=i[e];if(!a.has(e)||"row-image"!==t?.type||"row-image"!==n?.type||!/^[1-9]\d*$/.test(n.value)||t.value!==n.value||c.has(n.value))continue;const o=n.alt;o?.trim()&&t.alt===o&&!l.has(o)&&s.add(o)}return[...s]}(a.fieldsByRow,i.fieldsByRow,i.moved,s,e,t);let h;if(n&&!p.length&&N(a,i.moved,e,f.html)&&N(i,i.moved,t,f.html)){const n=s.slice(Math.min(c,d),Math.max(c,d));h=[];for(const o of n){const n=q(r,o,[...s.filter(e=>e!==o),i.moved],e,t,f);if(!n.length){h=void 0;break}h.push(n)}}return{offset:u,groups:p,images:m,boundaryGroups:h}}(o.values,r.values,s&&!a&&!F(o.values,r.values)),d=s?O(o.source,r.source,c,!0):[];if(c?.boundaryGroups?.length){const e=d.filter(e=>e.priority>0);if(1===e.length&&e[0].boundary)return function({before:e,after:t,index:n},o){for(const n of[e,t]){let e,t;for(const{node:r}of n){if(!r?.isConnected||e&&e.nextElementSibling!==r)return null;const{position:n,marginTop:i,marginBottom:a}=r.ownerDocument.defaultView.getComputedStyle(r);if(o&&r.closest(o)||!v(r)||!["static","relative"].includes(n)||r.closest("[hidden], details:not([open])")||!1===r.checkVisibility?.({opacityProperty:!0,contentVisibilityAuto:!0}))return null;const s=r.getBoundingClientRect();if(!s.height&&!(parseFloat(i)>0||parseFloat(a)>0))return null;if(t&&(t.bottom>s.top||Math.max(t.left,s.left)>=Math.min(t.right,s.right)))return null;e=r,t=s}}return t[n].node}(e[0].boundary,r.source?.excluded)}if(!l&&!a&&!c){const e=function(e,t){const n=function(e,t){if(!e||!t)return;const n=["row-order","gallery-order","order"],o=[...new Set([...Object.keys(e),...Object.keys(t)])].filter(o=>(n.includes(e[o]?.type)||n.includes(t[o]?.type))&&e[o]?.value!==t[o]?.value);if(1!==o.length)return;const r=e[o[0]],i=t[o[0]];if("gallery-order"!==r?.type||"gallery-order"!==i?.type)return;const a=JSON.parse(r.value),s=JSON.parse(i.value);if(new Set(a).size!==a.length||new Set(s).size!==s.length)return;const l=new Map(a.map((e,t)=>[e,t])),c=s.map(e=>l.get(e));return a.length&&s.length&&c.every(e=>void 0===e)?void 0:{oldCount:a.length,matches:c}}(e.values,t.values);if(!n)return;const o=e.source??e.dom,r=t.source??t.dom,i=function(e,t,{oldCount:n,matches:o}){const r=[];function i(e,t){return e.signature===t.signature&&e.presentation===t.presentation}function a(e,t){return i(e,t)&&e.rawText===t.rawText&&e.children.length===t.children.length&&e.children.every((e,n)=>a(e,t.children[n]))}function s(e,t){if(e.children.length!==n||t.children.length!==o.length||e.rawText!==t.rawText&&(e.text||t.text))return!1;const i=S(e),s=S(t);if(!i||!s)return!1;const l=i.map(k),c=s.map(k),d=new Set(l);return!(d.size!==l.length||new Set(c).size!==c.length||l.length===c.length&&l.every((e,t)=>e===c[t])||!o.every((n,o)=>void 0===n?!d.has(c[o]):l[n]===c[o]&&a(e.children[n],t.children[o]))||(r.push({before:e,after:t,original:i,current:s}),0))}return e&&t&&function e(t,n){return!!i(t,n)&&(!!s(t,n)||t.rawText===n.rawText&&t.children.length===n.children.length&&t.children.every((t,o)=>e(t,n.children[o])))}(e,t)?r:null}(o,r,n);if(!i?.length)return;const a=i.map(e=>e.after);let[s]=a;for(;s&&!a.every(e=>e===s||oe(s,e));)s=s.parent;const l=e=>["main","body","html"].includes(e.tag)||e.attributes.some(([e,t])=>"role"===e&&"main"===t);if(!s?.parent||l(s)||!function(e,t){if(1===t.length)return!0;const n=new Set(t);let o=0;return function e(t){return n.has(t)?(o++,!0):!!b(t)||!x(t)&&("hr"!==t.tag||0===o||o===n.size)&&t.parts.every(t=>"string"==typeof t?0===o||o===n.size||!t.trim():e(t))}(e)&&o===n.size}(s,a))return null;let c=s.node;if(!c?.isConnected||a.some(({node:e})=>!c.contains(e)||r.excluded&&e.closest(r.excluded)))return null;if(t.source&&(!P(e.dom,i,"before","original")||!P(t.dom,i,"after","current")))return null;const d=c.ownerDocument.defaultView;for(let e=s,t=e.parent;t?.parent&&!l(t)&&!t.children.some(t=>t!==e&&M(t));e=t,t=t.parent){const e=t.node;if(!e?.contains(c))continue;const{overflowX:n,overflowY:o}=d.getComputedStyle(e),r=/^(?:auto|scroll|hidden)$/;(e.scrollWidth>e.clientWidth&&r.test(n)||e.scrollHeight>e.clientHeight&&r.test(o))&&(c=e)}return!v(c)||c.closest("[hidden], details:not([open])")||r.excluded&&c.closest(r.excluded)?null:c}(o,r);if(void 0!==e)return e}const u=[...d.map(e=>({...e,source:!0})),...O(o.dom,r.dom,c)],f=new Map,p=function(e,t){const n=new Map,o=e=>$(e,n),r=[];for(const n of e){if(n.unresolved)for(const e of h(n,t,o))r.push(e);if("insert"===n.kind&&n.added.length>1){const e=n.added.map(e=>{const r={...n,after:e,added:[e]},i=ne(r,t,o);return{...r,input:i}}).filter(e=>e.input);if(e.length){r.push(...e);continue}}const e=ne(n,t,o);r.push({...n,input:e})}return r}(u,i).filter(e=>(e.priority>0||e.input)&&(!e.spacing||function({before:e,after:t},n,o){const r=A(e,n,o),i=A(t,n,o);return r&&i&&r.omitted===i.omitted&&V(r.text,i.text)}(e,f,r.dom?.excluded))),m=s&&a&&!p.some(e=>e.source);return function(e,t){if(!e.length)return null;const n=e.reduce((e,t)=>Math.max(e,t.input),0),o=e.filter(e=>e.input===n),r=o.reduce((e,t)=>Math.max(e,t.priority),0),i=o.filter(e=>e.priority===r);if(t.rowMove&&!n||i.some(e=>e.unresolved))return function(e,{rowMove:t,excluded:n,canFollowLiveReorder:o,canFollowLiveMove:r}){if(t){const t=e.find(e=>e.moved&&(e.source||r)),o=t?.moved.node;return o?.isConnected&&t.after.node?.contains(o)&&e.every(e=>e===t||t.source&&!e.source&&(e.moved||"reorder"===e.regionChange))?"contents"!==o.ownerDocument.defaultView.getComputedStyle(o).display?o:g(t.moved,e=>o.contains(e)&&(!n||!e.closest(n))&&v(e)):null}const i=e.find(e=>e.unresolved&&("replacement"===e.regionChange||"reorder"===e.regionChange&&(e.source||o))),a=i?.after.node;if(!a?.isConnected)return null;for(const t of e)if(t.unresolved){if(i.source&&!t.source&&"reorder"===t.regionChange)continue;if(!t.regionChange||t.after.node!==a)return null}else if(!("insert"===t.kind?t.added:[t.after]).every(e=>a.contains(e.node)))return null;return"contents"!==a.ownerDocument.defaultView.getComputedStyle(a).display?a:null}(i,t);const a=i.filter(e=>!e.input||e.directInput||!i.some(t=>t!==e&&e.matches?.length&&e.matches.every(e=>t.matches?.includes(e))&&oe(e.after,t.after))),s=new Map,l=a.filter(e=>{const t="delete"===e.kind&&(e.following[0]||e.preceding[0])||e.after,n=t?.node;if(!n)return!0;const o="delete"!==e.kind||e.following.length?e.kind:"delete-last",r=s.get(n)||new Set;return!r.has(o)&&(r.add(o),s.set(n,r),!0)});return n&&s.size>1?null:function(e){const t=new Set,n=new Set;for(const o of e){let e,r=!1;"delete"===o.kind?(r=!o.removed.some(y),e=r?o.after:o.following.find(y)||o.preceding.find(y)||o.following.find(w)||o.preceding.find(w)||o.after):e="insert"===o.kind?o.added.find(y)||o.added.find(w):o.after;const i=w(e);if(!i)continue;const a=y(e),s=a||i;(a&&!r?t:n).add(s)}const o=t.size?t:n;return 1===o.size?o.values().next().value:null}(l)}(p.filter(e=>e.source||e.input||!s&&!l||m&&("insert"===e.kind||"delete"===e.kind)),{rowMove:!!c,excluded:r.source?.excluded??r.dom?.excluded,canFollowLiveReorder:!s&&(a||F(o.values,r.values)),canFollowLiveMove:!s&&!l})}catch{return null}}}}function h(e,t,n){const o=[];for(const r of t){if(!r.after||"spacing"===r.type)continue;const t=te(e.oldRange,r.before,n,r,!0),i=te(e.newRange,r.after,n,r,!1);if(!t.length)continue;const a="markup"===r.type&&r.oldTag===r.newTag;if(a||!r.before||!(t.length<=te(e.newRange,r.before,n,r,!0).length||i.length<=te(e.oldRange,r.after,n,r,!1).length))for(const s of i)a&&!t.some(e=>ee(e,s,n))||o.push({...e,unresolved:!1,before:null,after:s,kind:"content",input:r.before&&r.after?2:1,priority:2,matches:[r]})}return o}function g(e,t){if(e?.node&&t(e.node))return e.node;for(const n of e?.children||[]){const e=g(n,t);if(e)return e}return null}function w(e){return g(e,()=>!0)}function v(e){return e.getClientRects().length&&"visible"===e.ownerDocument.defaultView.getComputedStyle(e).visibility}function y(e){return g(e,v)}function b(e){return/^(?:button|input|select|textarea)$/.test(e.tag)||e.attributes.some(([e,t])=>"role"===e&&"button"===t)}function x(e){return/^(?:img|video|audio|iframe|canvas|object|embed)$/.test(e.tag)||e.media?.some(Boolean)}function M(e){return!b(e)&&(e.text||x(e)||"hr"===e.tag||e.children.some(M))}function P(e,t,n,o){const r=new Map(t.map(e=>[e[n].node,e[o]]));return!(!e||r.has(null)||r.size!==t.length)&&(function e(t){const n=r.get(t.node);if(!n)return t.children.every(e);r.delete(t.node);const o=new Map,i=new Map;n.forEach((e,t)=>{e.marker&&o.set(e.marker,t),i.set(k(e),t)});const a=[],s=new Map;if(!function e(t,r=!1){if(r||=t.attributes.some(([e,t])=>"inert"===e||"aria-hidden"===e&&"true"===t),"img"!==t.tag)return t.children.every(t=>e(t,r));const l=o.get(t.marker)??i.get(k(t));return!(!n[l]||!t.media.slice(0,2).some((e,t)=>e&&e===n[l].media[t])||(a.push({index:l,cloneHidden:r}),s.set(l,(s.get(l)??0)+1),0))}(t))return!1;const l=a.filter(({index:e,cloneHidden:t})=>!t||1===s.get(e));return l.length===n.length&&l.every(({index:e},t)=>e===t)}(e)&&!r.size)}function S(e){const t=e.children.map(function e(t){return"img"===t.tag?[t]:t.children.flatMap(e)});return t.some(e=>1!==e.length||!e[0].media?.slice(0,2).some(Boolean))?null:t.map(([e])=>e)}function k(e){return JSON.stringify(e.media.slice(0,2))}function E(e,t,n,o=e.querySelector('main, [role="main"]')||e.querySelector("article")||e.body){if(!o)return null;const r=n.filter(e=>{if("string"!=typeof e||!e.trim())return!1;try{return o.matches(e),!0}catch{return!1}}).join(", "),i=new Map,a=new Map;if(e!==t)for(const e of t.querySelectorAll("[data-mtflpp-node]")){const t=e.getAttribute("data-mtflpp-node");a.set(t,a.has(t)?null:e)}for(const n of[o,...o.querySelectorAll("*")]){if(r&&n.closest(r))continue;const o=[...n.childNodes].filter(e=>3===e.nodeType).map(e=>e.textContent),s=T(o.join(" ")),l=["img","source","video","audio","iframe"].includes(n.localName)?["src","srcset","poster"].map(e=>n.getAttribute(`data-${e}`)||n.getAttribute(e)||""):[],c=n.style?.backgroundImage||n.getAttribute("data-bg")||"",d=n.getAttribute("data-mtflpp-node"),u=e===t?n:a.get(d)||null,f=C(n,u,JSON.stringify([n.localName,s,l,c]));"img"===n.localName&&(f.marker=d),f.text=s,f.rawText=o.join(""),f.media=[...l,c],f.parent=i.get(n.parentElement),i.set(n,f),f.parent?.children.push(f)}for(const[e,t]of i)t.parts=[...e.childNodes].map(e=>3===e.nodeType?e.textContent:i.get(e)).filter(e=>void 0!==e);let s=i.get(o);if(!s)return null;const l=s.node;for(let e=o.parentElement;e;e=e.parentElement){const t=C(e,l,e.localName);t.children=[s],t.parts=[s],s=t}return s.excluded=r,s}function C(e,t,n){const o=function(e){const t=[];for(const{name:n,value:o}of e.attributes){if("data-mtflpp-node"===n||n.startsWith("on")||/(?:^|-)(nonce|token)(?:-|$)/.test(n))continue;if(/^(?:data-)?(?:src|srcset|poster|sizes|bg)$/.test(n))continue;let r=o;"class"===n&&(r=[...e.classList].sort().join(" ")),"style"===n&&(r=[...e.style].sort().map(t=>[t,e.style.getPropertyValue(t),e.style.getPropertyPriority(t)])),("class"!==n&&"style"!==n||r.length)&&t.push([n,r])}return t.sort(([e],[t])=>e.localeCompare(t))}(e);return{node:t,tag:e.localName,signature:n,attributes:o,children:[],parts:[],presentation:JSON.stringify(o.filter(([e])=>!L(e))),references:JSON.stringify(o.filter(([e])=>L(e)))}}function L(e){return["id","for","headers","aria-controls","aria-labelledby","aria-describedby","aria-owns","aria-flowto","aria-activedescendant","aria-details","aria-errormessage"].includes(e)}function O(e,t,n,o=!1){const r=new Map,i=new Map,a=new Map,s=new Map,l=[];let c,d;function u(o,r,i,a=[]){const s=(e,t)=>e===t||oe(e,t);let l=!1;if(a.length){d??=[D(e,new Set(a)),D(t,new Set(a))];const n=(e,t,n)=>t.node?.isConnected&&e.node?.contains(t.node)&&"img"===t.node.localName&&(!n||!t.node.closest(n));for(const i of a){const a=d[0].get(i),c=d[1].get(i);if(a&&c){if(!s(o,a)||!s(r,c))return!1;l||=n(o,a,e.excluded)&&n(r,c,t.excluded)}}}if(!i.length)return l;if(!c){const o=new Set((n.boundaryGroups??[n.groups]).flat(2));c=[J(e,o),J(t,o)]}const[u,f]=c,p=new Map;for(const e of i.flat()){const t=u.get(e),n=f.get(e);if(t&&n){if(!s(o,t.entry)||!s(r,n.entry))return!1;p.set(e,t.substantive&&n.substantive)}}return l||i.some(e=>e.every(e=>p.has(e))&&e.some(e=>p.get(e)))}function f(e){const t=JSON.stringify(e);return r.has(t)||r.set(t,r.size+1),r.get(t)}function p(e){if(!e)return 0;const t=f([e.signature,e.children.map(p)]);return i.set(e,t),a.set(e,f([t,e.presentation,e.children.map(e=>a.get(e))])),s.set(e,f([t,e.presentation,e.references,e.children.map(e=>s.get(e))])),t}p(e),p(t);const m=e=>i.get(e);function h(e){const t=e.attributes.find(([e])=>"id"===e)?.[1];return t?`${e.tag} ${t}`:void 0}function g(e){if(!(e.children.length<2))return f(["collection",e.signature,e.children.map(m).sort((e,t)=>e-t)])}function w(e,t){const n=new Map;return e.forEach((e,o)=>{const r=t(e);void 0!==r&&n.set(r,n.has(r)?-1:o)}),n}return function e(t,r){t&&r&&(t.signature!==r.signature?l.push({kind:"content",before:t,after:r,priority:2}):t.rawText!==r.rawText&&l.push({kind:"content",before:t,after:r,priority:2,spacing:!0}),t.presentation===r.presentation&&t.references===r.references||l.push({kind:"attributes",before:t,after:r,priority:t.presentation!==r.presentation?1:0}),function(t,r,c,d){const f=d.parent&&c.parent&&d.tag===c.tag,p=w(t,m),v=w(r,m);let y,b,x,M;const P=new Set(t.flatMap(e=>[a.get(e),s.get(e)])),S=new Set(r.flatMap(e=>[a.get(e),s.get(e)]));function k(e,t,n){const o=n.get(e),r=n.get(t);return o===r||!S.has(o)&&!P.has(r)}function E(e,t){return i.get(e)===i.get(t)&&k(e,t,a)&&k(e,t,s)}function C(e,n,o,a,s,c,u){const m=t.slice(e,n),h=r.slice(o,a),g="replacement"===s&&f&&m.some(e=>!v.has(i.get(e)))&&h.some(e=>!p.has(i.get(e)))&&(!function(e,t){if(e.length<2||t.length<2)return!1;const n=e.filter(e=>e.children.length).length,o=t.filter(e=>e.children.length).length;if(!n&&!o||n>1&&o>1)return!0;const r=new Map;for(const{tag:e}of t)r.set(e,(r.get(e)||0)+1);let i=0;for(const{tag:t}of e){const e=r.get(t);if(e){if(2===++i)return!0;r.set(t,e-1)}}return!1}(m,h)||"form"===d.tag&&function(e,t){function n(e){const t=new Set;return e.every(function e(n){if(["input","select","textarea"].includes(n.tag)){const e=n.attributes.find(([e])=>"name"===e)?.[1],o=n.attributes.find(([e])=>"type"===e)?.[1]?.toLowerCase();return!(!e||"input"===n.tag&&"hidden"===o||(t.add(e),0))}let o=!1;for(const t of n.children)e(t)&&(o=!0);return o})?t:null}const o=n(e),r=n(t);return o&&r&&[...o].some(e=>!r.has(e))&&[...r].some(e=>!o.has(e))}(m,h)),w=f&&("reorder"===s||g)?s:void 0;l.push({kind:"region",after:d,priority:2,unresolved:!0,regionChange:w,oldRange:m,newRange:h,moved:c,boundary:u})}function L(e,n,o,r,i,a,s){const l=[];for(let c=e;c<n;c++){const e=s(t[c]),n=a.get(e);if(!(i.get(e)!==c||void 0===n||n<o||n>=r)){if(l.length&&n<=l[l.length-1][1])return null;l.push([c,n])}}return l}!function s(c,P,S,k){for(;c<P&&S<k&&E(t[c],r[S]);)e(t[c],r[S]),c++,S++;for(;c<P&&S<k&&E(t[P-1],r[k-1]);)P--,k--,e(t[P],r[k]);if(c===P&&S===k)return;if(c===P||S===k){const e=S===k,n=e?t.slice(c,P):r.slice(S,k),o=e?[r[S-1],r[S]]:[t[c-1],t[c]];return void(n.some(e=>o.some(t=>t&&i.get(t)===i.get(e)))?C(c,P,S,k):e?l.push({kind:"delete",after:d,removed:n,priority:2,following:r.slice(S),preceding:r.slice(0,S).reverse()}):l.push({kind:"insert",after:n[0],added:n,priority:2}))}if(P-c===1&&k-S===1)return void e(t[c],r[S]);const O=function(e,i,a,s){if(!(n?.groups.length||o&&(n?.boundaryGroups||n?.images.length)))return;const l=Math.abs(n.offset)+1;if(i-e!==l||s-a!==l)return;const c=n.offset>0,d=c?0:l-1,u=c?l-1:0,f=t.slice(e,i),p=r.slice(a,s),m=c?l-1:1,h=f.map((e,t)=>[e,p[(t+m)%l]]);return{before:f,after:p,from:d,to:u,pairs:h}}(c,P,S,k),T=O&&function(e){const t=o?n.images:[];if(!n.groups.length&&!t.length)return;const[r,i]=e.pairs[e.from],a=m(r);return-1!==p.get(a)&&-1!==v.get(a)&&e.pairs.every(([e,t])=>E(e,t))&&u(r,i,n.groups,t)?i:void 0}(O),V=O&&function(e){if(o&&n.boundaryGroups&&B(e.before[e.from])&&e.pairs.every(([e,t])=>a.get(e)===a.get(t)))return e.pairs.filter((t,n)=>n!==e.from).every(([e,t],o)=>u(e,t,n.boundaryGroups[o]))?{before:e.before,after:e.after,index:e.to||1}:void 0}(O);if(T||V||f&&function(e,n,o,a){const s=n-e;if(s<2||s!==a-o)return!1;const l=new Map;let c=!1;for(let n=0;n<s;n++){const a=i.get(t[e+n]),s=i.get(r[o+n]);c||=a!==s,l.set(a,(l.get(a)||0)+1),l.set(s,(l.get(s)||0)-1)}return c&&[...l.values()].every(e=>0===e)}(c,P,S,k)){if(V)for(const[t,n]of O.pairs)e(t,n);return void C(c,P,S,k,"reorder",T,V)}let A=L(c,P,S,k,p,v,m);if(0===A?.length&&(y??=w(t,h),b??=w(r,h),A=L(c,P,S,k,y,b,h)),0===A?.length&&(x??=w(t,g),M??=w(r,g),A=L(c,P,S,k,x,M,g)),A?.length)for(const[n,o]of[...A,[P,k]])s(c,n,S,o),n<P&&e(t[n],r[o]),c=n+1,S=o+1;else C(c,P,S,k,A?"replacement":void 0)}(0,t.length,0,r.length)}(t.children,r.children,t,r))}(e,t),l}function T(e){return e.replace(/\s+/g," ").trim()}function V(e,t){return e!==t&&e.replace(/\s/g,"")===t.replace(/\s/g,"")}function A(e,t,n){for(;e.node?.isConnected&&e.parent?.node;){const{display:t}=e.node.ownerDocument.defaultView.getComputedStyle(e.node);if("inline"!==t&&"contents"!==t)break;e=e.parent}if(!t.has(e)){const{node:o}=e,r=[],i=o?.isConnected&&j(o,n,r)===R(e)&&y(e)?o.innerText:void 0;t.set(e,"string"==typeof i?{text:i,omitted:JSON.stringify(r)}:void 0)}return t.get(e)}function j(e,t,n){return t&&e.querySelector(t)?[...e.childNodes].map(e=>3===e.nodeType?e.textContent:1!==e.nodeType?"":e.matches(t)?(n.push(e.textContent),""):j(e,t,n)).join(""):e.textContent}function R(e){return e.parts.map(e=>"string"==typeof e?e:R(e)).join("")}function _({before:e,after:t}){return H(e.rawText,t.rawText)||H(R(e),R(t))}function H(e,t){if(!/\S/.test(e)||!V(e,t))return;const n=e.match(/\s+|\S+/g),o=t.match(/\s+|\S+/g);let r=0,i=0;for(;r<Math.min(n.length,o.length)&&n[r]===o[r];)r++;for(;i<Math.min(n.length,o.length)-r&&n.at(-1-i)===o.at(-1-i);)i++;const a=Math.max(0,r-1),s=Math.max(0,i-1);return{type:"spacing",before:n.slice(a,n.length-s).join(""),after:o.slice(a,o.length-s).join("")}}function $(e,t=new Map){return e?(t.has(e)||t.set(e,(e.parts||[]).map(e=>{if("string"==typeof e)return e;const n=$(e,t);return/^(?:p|div|section|article|main|aside|header|footer|nav|h[1-6]|li|[ou]l|d[ldt]|blockquote|pre|table|tr|t[dh]|caption|figure|figcaption|br|hr)$/.test(e.tag)?` ${n} `:n}).join("")),t.get(e)):""}function F(e,t){return!!e&&!!t&&Object.entries(t).some(([t,n])=>{if(!["order","gallery-order"].includes(n?.type)||!Object.hasOwn(e,t))return!1;const o=e[t];return o?.type===n.type&&o.members===n.members&&o.value!==n.value})}function N(e,t,n,o){return e.fieldsByRow?.[t]?.every(e=>""===z(n[e],o)?.label)}function B(e){return!e.text&&!e.media?.some(Boolean)&&!/^(?:a|button|input|select|textarea|form|details|img|video|audio|iframe|canvas|svg|object|embed)$/.test(e.tag)&&e.children.every(B)}function D(e,t){const n=new Map;return e&&function e(o){if("img"===o.tag){const e=o.attributes.find(([e])=>"alt"===e)?.[1];t.has(e)&&n.set(e,n.has(e)?null:o)}o.children.forEach(e)}(e),n}function q(e,t,n,o,r,{html:i,peerLabels:a}){const{fieldsByRow:s}=r[e],l=o[e].fieldsByRow;if([t,...n].some(e=>!l?.[e]||!s?.[e]))return[];const c=[],d=new Set(l[t]);let u;function f(e,t){if(a.has(e))return a.get(e);const n=new Set;function o(e,t){n.add(T($(e,t)));for(const n of e.children)o(n,t)}for(const r of e){if("row-image"===t[r]?.type)continue;const e=W(t[r],i);if(!e.length)return null;for(const t of e)t.entry?o(t.entry,t.cache):n.add(t.label)}return a.set(e,n),n}function p(e,t){return u??=n.flatMap(e=>[f(l[e],o),f(s[e],r)]),u.some(n=>!n||n.has(e)||t.length&&t.every(e=>n.has(e)))}for(const e of s[t]){const t=r[e],n=o[e];if(d.has(e)&&t&&n?.type===t.type&&n?.value===t.value)for(const{entry:e,cache:o,label:r}of W(t,i,n.formatted===t.formatted)){if(!r)continue;if(!e){p(r,[])||c.push([r]);continue}const t=I(e,o).map(e=>T($(e,o))),n=J(e,new Set([r,...t]),o);n.get(r)?.substantive&&!p(r,t.join(" ")===r?t:[])&&c.push([r]);const i=[...new Set(t.filter(e=>n.has(e)))];i.length>1&&i.some(e=>n.get(e).substantive)&&!p(r,i)&&c.push(i)}}return c}function W(e,t,n=!0){const o=z(e,t);if(!o)return[];const r=n&&"html"===e.type&&"string"==typeof e.formatted?z({type:"html",value:e.formatted},t):null;return r?[o,r]:[o]}function z(e,t){if("string"==typeof e?.value){if("text"===e.type)return{label:T(e.value)};if("html"===e.type){if(!t.has(e.value))try{const n=(new DOMParser).parseFromString(e.value,"text/html"),o=E(n,n,[],n.body),r=new Map;t.set(e.value,{entry:o,cache:r,label:T($(o,r))})}catch{t.set(e.value,null)}return t.get(e.value)}}}function I(e,t){const n=e.children.flatMap(e=>I(e,t));return n.length||!/^(?:p|h[1-6]|li|d[dt]|blockquote|pre|figcaption)$/.test(e.tag)?n:T($(e,t))?[e]:[]}function Z(e,t,n){let o;(e.text===t||/[\p{L}\p{N}]/u.test(e.text||""))&&(o=function(e,t){let n="content";for(let o=e;o;o=o.parent){const r=o.attributes.find(([e])=>"role"===e)?.[1]??"";if("button"===o.tag||/(?:^|\s)button(?:\s|$)/.test(r))return;if("a"!==o.tag&&!/(?:^|\s)link(?:\s|$)/.test(r))continue;const i=I(o,t);if(i.length<2||!i.some(e=>/^h[1-6]$/.test(e.tag)))return;const a=i.find(t=>t===e||oe(t,e));if(!a)return;/^h[1-6]$/.test(a.tag)||(n="support")}return n}(e,n));for(const r of e.children){if("content"===o)break;o=Z(r,t,n)||o}return o}function J(e,t,n=new Map){const o=new Map;e&&function e(r){const i=T($(r,n));if(t.has(i)){const e=o.get(i);o.set(i,void 0===e||e&&oe(e,r)?r:null)}r.children.forEach(e)}(e);const r=new Map;for(const[e,t]of o){const o=t&&Z(t,e,n);o&&r.set(e,{entry:t,substantive:"content"===o})}return r}function G(e,t){let n=0,o=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;for(;o<e.length-n&&o<t.length-n&&e[e.length-o-1]===t[t.length-o-1];)o++;let r=e.length-o,i=t.length-o;for(;n>0&&/\S/.test(e[n-1]);)n--;if(r>n&&/\S/.test(e[r-1]))for(;r<e.length&&/\S/.test(e[r]);)r++;if(i>n&&/\S/.test(t[i-1]))for(;i<t.length&&/\S/.test(t[i]);)i++;return{before:e.slice(n,r).trim(),after:t.slice(n,i).trim()}}function U(e,t){return t?X(e,t):""===T(e)}function X(e,t){return Y(e,t,1)>0}function Y(e,t,n=1/0){if(!t)return 0;let o=0,r=(e=T(e)).indexOf(t);for(;-1!==r;){const i=r+t.length;if(K(e,r)&&K(e,i)&&++o===n)break;r=e.indexOf(t,r+1)}return o}function K(e,t){return!/[\p{L}\p{N}_]$/u.test(e.slice(Math.max(0,t-2),t))||!/^[\p{L}\p{N}_]/u.test(e.slice(t,t+2))}function Q(e,t,n,o=!1){const r=T(e),i=T(t);if(r===i)return!1;if(r===n.before&&i===n.after||r===n.fullBefore&&i===n.fullAfter)return!0;if(o){const e=G(r,i);if(e.before===n.before&&e.after===n.after)return!0;if(function(e,t,n,o){if(!n||!o||e.length-n.length!==t.length-o.length)return!1;for(let r=e.indexOf(n);-1!==r;r=e.indexOf(n,r+1))if(t.startsWith(o,r)&&K(e,r)&&K(t,r)&&K(e,r+n.length)&&K(t,r+o.length)&&e.slice(0,r)===t.slice(0,r)&&e.slice(r+n.length)===t.slice(r+o.length))return!0;return!1}(r,i,n.fullBefore,n.fullAfter))return!0}return(n.before?Y(r,n.before)>Y(i,n.before):!r)&&(n.after?Y(i,n.after)>Y(r,n.after):!i)}function ee(e,t,n){return e.tag!==t.tag||(e.children.length||t.children.length)&&e.text!==t.text&&T(n(e))===T(n(t))}function te(e=[],t,n,o,r){return e.flatMap(e=>{const i=te(e.children,t,n,o,r);let a;return a="media"===o.type?e.media?.includes(t):"attribute"===o.type?e.attributes.some(([e,n])=>e===o.name&&X("string"==typeof n?n:JSON.stringify(n),t)):("markup"!==o.type||e.tag===(r?o.oldTag:o.newTag))&&U(n(e),t),"text"===o.type&&i.length?i:[...a?[e]:[],...i]})}function ne(e,t,n){if(e.unresolved)return 0;if(e.matches=[],e.spacing){const n=t.filter(e=>"spacing"===e.type),o=n.length&&_(e);return e.matches=n.filter(e=>o?.before===e.before&&o?.after===e.after),e.matches.length?2:0}let o=0;for(const r of t){if("spacing"===r.type)continue;let t=0;if("attributes"===e.kind){if(!["text","attribute"].includes(r.type))continue;const n=new Map(e.before.attributes),o=new Map(e.after.attributes);for(const e of new Set([...n.keys(),...o.keys()])){if("attribute"===r.type&&e!==r.name)continue;const i=n.get(e),a=o.get(e);JSON.stringify(i)!==JSON.stringify(a)&&(Q("string"==typeof i?i:JSON.stringify(i)||"","string"==typeof a?a:JSON.stringify(a)||"",r)&&(t="attribute"===r.type||r.before&&r.after?2:1))}}else if("insert"===e.kind)!r.before&&e.added.some(e=>X(n(e),r.after))&&(t=Math.max(t,1));else if("delete"===e.kind)!r.after&&e.removed.some(e=>X(n(e),r.before))&&(t=Math.max(t,1));else if("media"===r.type)(e.before?.media||[]).some((t,n)=>t===r.before&&e.after?.media?.[n]===r.after)&&(t=2);else if("markup"===r.type)e.before?.tag===r.oldTag&&e.after?.tag===r.newTag&&ee(e.before,e.after,n)&&U(n(e.before),r.before)&&U(n(e.after),r.after)&&(t=r.before&&r.after?2:1);else if("text"===r.type){const o=!(!r.before||!r.after),i=o&&Q(e.before?.text||"",e.after?.text||"",r,!0);(i||Q(n(e.before),n(e.after),r,o))&&(t=o?2:1,i&&(e.directInput=!0))}t&&e.matches.push(r),o=Math.max(o,t)}return o}function oe(e,t){return!!e?.children.some(e=>e===t||e.node&&e.node===t?.node||oe(e,t))}const re=new Set(["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","PageDown","PageUp","Home","End"," "]);function ie(e,t){let n;for(const o of e?.rects??[]){const e=t(o);if(e.visible)return e;(!n||e.distance<n.distance)&&(n=e)}return n}function ae(e){return new Promise(t=>{const n=()=>{e.clearTimeout(o),e.cancelAnimationFrame(r),t()},o=e.setTimeout(n,100);let r=e.requestAnimationFrame(()=>{r=e.requestAnimationFrame(n)})})}function se(e,t=!1){if(!me(e,{visibilityProperty:!0,opacityProperty:!0}))return;const{left:n,right:o,top:r,bottom:i,width:a,height:s}=e.getBoundingClientRect();if(!(t||a&&s))return;const l=e.ownerDocument,{documentElement:c,body:d,defaultView:u}=l,f={left:n,right:a?o:n+1,top:r,bottom:s?i:r+1},p={...f},m={x:f.right-f.left,y:f.bottom-f.top},h="visible"===u.getComputedStyle(c).overflow,g=u.getComputedStyle(e);for(let n=e;n&&n!==c;){const o=n===e?g:u.getComputedStyle(n),{position:r,display:i,overflowX:a,overflowY:s}=o;if(n!==e&&(n!==d||!h)&&"inline"!==i&&("visible"!==a||"visible"!==s)&&n.offsetWidth&&n.offsetHeight){const{bounds:e,scaleX:r,scaleY:i}=pe(n,o);for(const[l,c,d,u,h]of[["x",a,"left","right",r],["y",s,"top","bottom",i]]){if("visible"===c)continue;const r="clip"===c?[0,0]:fe(n,o,l,h),i=t&&"hidden"===c,a="y"===l==("horizontal-tb"===o.writingMode);if(i&&r.some(e=>e)&&(a||f[d]<e[d]||f[u]>e[u]||le(o,g,l)))return{boundary:n};if(!ue(f,p,e,d,u,i?[0,0]:r))return{boundary:n};m[l]=Math.min(m[l],p[u]-p[d])}}n="absolute"===r||"fixed"===r?n.offsetParent:n.parentElement}return{clipped:f,extent:m}}function le(e,t,n){const o=e=>e&&"auto"!==e&&0!==parseFloat(e);return("x"===n?["Left","Right"]:["Top","Bottom"]).some(n=>o(e[`scrollPadding${n}`])||o(t[`scrollMargin${n}`]))}function ce(e,t,n=!1){const o=se(e,n);if(!o?.clipped)return;const{clipped:r,extent:i}=o,{ownerDocument:a}=e,s=a.documentElement;if(r.left=Math.max(s.clientLeft,r.left),r.right=Math.min(s.clientLeft+s.clientWidth,r.right),r.top=Math.max(0,r.top),r.bottom=Math.min(s.clientHeight,r.bottom),r.right<=r.left)return{rects:[]};const l=t?.({...r,top:0,bottom:s.clientHeight}),c=l?.visibleCenterX??(r.left+r.right)/2,d=be(e,c);if(r.bottom<=r.top)return{rects:[],header:d?.bottom};const u={rects:[r],inViewport:!0,extent:i};if(!d)return u;const f={left:Math.max(r.left,d.left),right:Math.min(r.right,d.right),top:Math.max(r.top,d.top),bottom:Math.min(r.bottom,d.bottom)};if(!de(f)||!d.node.contains(a.elementFromPoint(c,(f.top+f.bottom)/2)))return u;const p=[{...r,top:f.bottom},{...r,bottom:f.top},{...f,left:r.left,right:f.left},{...f,left:f.right,right:r.right}].filter(de);return!p.length&&d.bottom>=s.clientHeight&&d.top<=0?void 0:{rects:p,inViewport:!0,extent:i,header:d.bottom}}function de({left:e,right:t,top:n,bottom:o}){return t>e&&o>n}function ue(e,t,n,o,r,[i,a]){return e[o]=Math.max(e[o],n[o]),e[r]=Math.min(e[r],n[r]),t[o]=Math.max(n[o],t[o]+i),t[r]=Math.min(n[r],t[r]+a),t[r]>t[o]}function fe(e,t,n,o){const r="x"===n,i=r?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight;if(i<=0)return[0,0];const a=r?e.scrollLeft:e.scrollTop,s=t.display.endsWith("flex")&&t.flexDirection===(r?"row-reverse":"column-reverse"),l=(r&&"rtl"===t.direction)!==s;let c=l?-i:0,d=l?0:i;return("horizontal-tb"!==t.writingMode||a<c||a>d)&&(c=-i,d=i),[(a-d)*o,(a-c)*o]}function pe(e,t){const n=e.getBoundingClientRect(),o=n.width/e.offsetWidth,r=n.height/e.offsetHeight,i=n.left+e.clientLeft*o,a=n.top+e.clientTop*r,s={left:i,top:a,right:i+e.clientWidth*o,bottom:a+e.clientHeight*r},l=t.overflowClipMargin;if("clip"!==t.overflowX&&"clip"!==t.overflowY||!l||"0px"===l)return{bounds:s,scaleX:o,scaleY:r};const c=l.split(" ").map(parseFloat).find(Number.isFinite)??0,d=l.includes("border-box")?n:s,u=l.includes("content-box");return{scaleX:o,scaleY:r,bounds:{left:d.left+((u?parseFloat(t.paddingLeft):0)-c)*o,right:d.right-((u?parseFloat(t.paddingRight):0)-c)*o,top:d.top+((u?parseFloat(t.paddingTop):0)-c)*r,bottom:d.bottom-((u?parseFloat(t.paddingBottom):0)-c)*r}}}function me(e,t={visibilityProperty:!0}){return!!e?.isConnected&&!!e.getClientRects().length&&(!e.checkVisibility||e.checkVisibility(t))&&"visible"===e.ownerDocument.defaultView.getComputedStyle(e).visibility}function he(e){return e.matchMedia("(prefers-reduced-motion: reduce)").matches?"instant":"smooth"}function ge(e,{behavior:t,header:n=ye(e),nearest:o=!1}={}){const r=e.ownerDocument,i=r.defaultView,a=t??he(i);if(o&&!n)return void e.scrollIntoView({behavior:a,block:"nearest",inline:"nearest"});const s=i.getComputedStyle(e).scrollMarginTop,l=r.documentElement,c=l.clientHeight,d=i.getComputedStyle(l),u=ve(d.scrollPaddingTop,c),f=ve(d.scrollPaddingBottom,c);let p,m;try{let t=o?"nearest":"start";if(o){const e=n-parseFloat(s);null!==u&&e>u&&(p=l.getAttribute("style"),l.style.setProperty("scroll-padding-top",`${e}px`,"important"))}else{const t=n>0&&null!==u?`max(${s}, ${n-u}px)`:s;m=e.getAttribute("style"),e.style.setProperty("scroll-margin-top",`calc(${t} + 1lh)`,"important")}if(!o&&null!==u&&null!==f){const n=i.getComputedStyle(e),o=c-u-f-parseFloat(n.scrollMarginTop)-parseFloat(n.scrollMarginBottom),r=o-e.getBoundingClientRect().height;if(r>=0&&(t="center"),r>0&&"horizontal-tb"===d.writingMode){const e=Math.min(o/3,r);p=l.getAttribute("style"),l.style.setProperty("scroll-padding-bottom",`${f+e}px`,"important")}}e.scrollIntoView({behavior:a,block:t,inline:"nearest"})}finally{void 0!==p&&we(l,p),void 0!==m&&we(e,m)}}function we(e,t){e.setAttribute("style",t??""),null===t&&e.removeAttribute("style")}function ve(e,t){if("auto"===e)return 0;const n=parseFloat(e);return Number.isFinite(n)?n*(e.endsWith("%")?t/100:1):null}function ye(e){const t=e.getBoundingClientRect();return be(e,t.left+t.width/2)?.bottom??0}function be(e,t){const n=e.ownerDocument;for(let o=n.elementFromPoint(t,1);o&&!o.contains(e);o=o.parentElement){const e=n.defaultView.getComputedStyle(o);if("fixed"!==e.position&&"sticky"!==e.position)continue;if("0"===e.opacity||!me(o,{visibilityProperty:!0,opacityProperty:!0}))continue;const{left:t,right:r,top:i,bottom:a}=o.getBoundingClientRect();if("fixed"===e.position||i<=parseFloat(e.top)+1)return{node:o,left:t,right:r,top:i,bottom:a}}}function xe(e,t,n,o){const r=window.acf;r.addAction("wysiwyg_tinymce_init",n);for(const e of["append","remove","sortstop","change_field"])r.addAction(e,t);const i=t=>{t[0]===e&&o?.()};function a(e){return!!e?.closest?.(".acf-field")}let s;return r.addAction("validation_failure",i),window.jQuery(e).on("input.mtflppAcf change.mtflppAcf sortupdate.mtflppAcf",(e,n)=>{a(e.target)&&("sortupdate"===e.type&&(s=n?.item?.[0]?.querySelector(':scope > input[type="hidden"][name$="[acf_fc_layout]"]')?.name),e.originalEvent&&"sortupdate"!==e.type||t())}),{isField:a,isValidating:()=>!!e.classList?.contains("is-validating"),hasStructuralPaginationChanges:()=>!!e.querySelector('.acf-repeater[data-pagination="1"] .acf-row:is(.acf-added, .acf-inserted, .acf-reordered, .acf-deleted)'),accepts:e=>"_acf_nonce"===e||e.startsWith("acf[")||e.startsWith("_acf_fields["),layoutOrders(t,n){const o=new Map,r=new Map,i=new Set;for(const[e,t]of n){"1"===t&&e.endsWith("[acf_fc_layout_disabled]")&&i.add(e.replace(/\[acf_fc_layout_disabled\]$/,"[acf_fc_layout]"));const n=e.match(/^(acf\[.+)\[[^\]]+\]\[acf_fc_layout\]$/)?.[1];n&&(o.has(n)||o.set(n,[]),o.get(n).push(e),r.set(e,[]))}const a=e=>Array.from(e.matchAll(/\]\[/g),({index:t})=>`${e.slice(0,t+1)}[acf_fc_layout]`);function l(e){const t=a(e);if(!t.some(e=>i.has(e)))return t.findLast(e=>r.has(e))}for(const[e,n]of t){if(!e.startsWith("acf[")||!["text","html"].includes(n.type))continue;const t=a(e);if(!t.some(e=>i.has(e)))for(const n of t)r.get(n)?.push(e)}for(const o of e.querySelectorAll('.acf-field[data-type="image"] .acf-image-uploader.has-value')){const e=o.querySelector(':scope > input[type="hidden"][name]'),i=o.querySelector(':scope > .image-wrap > img[data-name="image"]'),a=e?.name;if(!a?.startsWith("acf[")||!i||e.matches(":disabled")||o.closest(".acf-clone"))continue;const s=n.getAll(a);if(1!==s.length||s[0]!==e.value||!/^[1-9]\d*$/.test(s[0]))continue;const c=l(a);c&&(r.get(c).push(a),t.set(a,{type:"row-image",value:s[0],alt:i.alt}))}for(const o of e.querySelectorAll('.acf-field[data-type="gallery"] .acf-gallery')){const e=o.querySelector(':scope > input[type="hidden"][name]'),r=e?.name;if(!r?.startsWith("acf[")||e.matches(":disabled")||o.closest(".acf-clone"))continue;const s=`${r}[]`,l=n.getAll(r),c=n.getAll(s);if(a(r).some(e=>i.has(e))||1!==l.length||""!==l[0]||c.some(e=>!/^[1-9]\d*$/.test(e)))continue;const d=[...o.querySelectorAll(':scope > .acf-gallery-main > .acf-gallery-attachments > .acf-gallery-attachment > input[type="hidden"][name]')];d.length!==c.length||d.some((e,t)=>e.name!==s||e.value!==c[t]||e.matches(":disabled"))||t.set(s,{type:"gallery-order",value:JSON.stringify(c),members:JSON.stringify([...c].sort())})}for(const[e,n]of o){const o=n.filter(e=>!i.has(e));if(o.length<2||new Set(o).size!==o.length)continue;const a=o.includes(s)?s:void 0;t.set(`acf-layout-order:${e}`,{type:"row-order",value:JSON.stringify(o),members:JSON.stringify([...o].sort()),moved:a,fieldsByRow:Object.fromEntries(o.map(e=>[e,r.get(e)]))})}return t},destroy(){r.removeAction("wysiwyg_tinymce_init",n);for(const e of["append","remove","sortstop","change_field"])r.removeAction(e,t);r.removeAction("validation_failure",i),window.jQuery(e).off(".mtflppAcf")}}}function Me(){const e=(0,n.select)("core/edit-post")?.getActiveMetaBoxLocations?.()??["normal","side","advanced"];return[document.querySelector(".metabox-base-form"),...e.map(e=>document.querySelector(`.edit-post-meta-boxes-area.is-${e} .metabox-location-${e}`)||document.querySelector(`#metaboxes .metabox-location-${e}`))].filter(Boolean)}const Pe="meet-the-frontend-live-preview-panel/acf";function Se(e){if(!e.acfEnabled)return!1;if("function"!=typeof window.acf?.addAction||"function"!=typeof window.acf?.removeAction||"function"!=typeof window.jQuery)throw Object.assign(new Error(e.strings.acfUnavailable),{code:"mtflpp_integration_failed"});return!0}(0,o.addAction)("mtflpp.blockEditor.previewSetup",Pe,({config:e,changed:t,hooks:o,onDestroy:r})=>{if(!Se(e))return;const i=function(e){const t=new Set;let o=!1,r=[],i=new Map;const a=()=>{o||e()};function s(e){e&&!t.has(e)&&(t.add(e),e.on("input change undo redo SetContent",a))}const l=xe(document,a,s);function c(e){s(e.editor)}function d(e){l.isField(e.target)&&Me().some(t=>t.contains(e.target))&&a()}window.tinymce?.editors.forEach(s),window.tinymce?.on("AddEditor",c),document.addEventListener("input",d),document.addEventListener("change",d,!0);const u=new MutationObserver(a);return{get ready(){return r=r.filter(({field:e,rows:t})=>e.isConnected&&t.some(t=>e.contains(t))),r.length||u.disconnect(),!r.length},saved(){u.disconnect(),r=Me().flatMap(e=>[...e.querySelectorAll('.acf-repeater[data-pagination="1"]')].map(e=>({field:e,rows:[...e.querySelectorAll(":scope > table > tbody > tr.acf-row:not(.acf-clone)")]})).filter(({rows:e})=>e.length));for(const{field:e}of r)u.observe(e,{childList:!0,subtree:!0});a()},observe(){const e=(0,n.select)("acf/fields");if(!e?.getFieldValue)return;const t=new Map;for(const n of Me())for(const o of window.acf.getFields({parent:window.jQuery(n)})){const n=o.get("key");t.set(n,e.getFieldValue(n))}(t.size!==i.size||[...t].some(([e,t])=>i.get(e)!==t))&&(i=t,a())},capture(){o=!0;const e=new URLSearchParams;try{window.tinymce?.triggerSave();for(const t of Me())for(const[n,o]of new FormData(t))"string"==typeof o&&l.accepts(n)&&e.append(n,o)}finally{o=!1}return e},destroy(){u.disconnect(),l.destroy(),document.removeEventListener("input",d),document.removeEventListener("change",d,!0),window.tinymce?.off("AddEditor",c);for(const e of t)e.off("input change undo redo SetContent",a)}}}(t);r(()=>i.destroy()),o.addAction("observePreviewInputs",Pe,()=>i.observe()),o.addAction("nativeMetaboxSaveAcknowledged",Pe,()=>i.saved()),o.addFilter("previewPauseReason",Pe,t=>t||(i.ready?"":e.strings.acfRefreshing)),o.addFilter("previewFormBody",Pe,e=>{e??=new URLSearchParams;for(const[t,n]of i.capture())e.append(t,n);return e})}),(0,o.addAction)("mtflpp.classicEditor.previewSetup",Pe,({config:e,form:t,changed:n,watchEditor:o,cancelNativeSave:r,hooks:i,onDestroy:a})=>{if(!Se(e))return;const s=xe(t,n,o,r);a(()=>s.destroy());const l=e=>{s.isField(e.target)&&n()};t.addEventListener("input",l),t.addEventListener("change",l,!0),a(()=>{t.removeEventListener("input",l),t.removeEventListener("change",l,!0)}),i.addFilter("nativeSaveValidationPending",Pe,e=>e||s.isValidating()),i.addFilter("previewComparisonValues",Pe,(e,t)=>s.layoutOrders(e,t)),i.addFilter("previewFormBody",Pe,(e,t)=>{for(const[n,o]of t)"string"==typeof o&&s.accepts(n)&&!n.includes("[acfcloneindex]")&&e.append(n,o);return e}),i.addFilter("nativePreviewHandoffError",Pe,(t,n)=>t||(n&&s.hasStructuralPaginationChanges()?Object.assign(new Error(e.strings.nativePreviewAcf),{code:"mtflpp_acf_rows_stale"}):void 0))}),(0,o.addAction)("mtflpp.blockEditor.previewSetup","meet-the-frontend-live-preview-panel/yoast",({config:e,hooks:t})=>{e.yoastPrimaryTaxonomies?.length&&t.addFilter("additionalPreviewValues","meet-the-frontend-live-preview-panel/yoast",(t,o)=>{const r=function(e,t){if(!e.yoastPrimaryTaxonomies?.length)return;const o=(0,n.select)("yoast-seo/editor");if("function"!=typeof o?.getPrimaryTaxonomyId||Number(o.getPostId?.())!==e.postId)return;const r={};for(const n of e.yoastPrimaryTaxonomies){const i=o.getPrimaryTaxonomyId(n);if(void 0===i)continue;const a=-1===Number(i)?0:Number(i),s=t.getEditedPostAttribute(e.taxonomies[n]);r[n]=Array.isArray(s)&&!s.includes(a)?0:a}return Object.keys(r).length?JSON.stringify(r):void 0}(e,o);return void 0===r?t:{...t,yoast_primary_terms:r}})});const ke=window.meetTheFrontendLivePreviewPanel;if(ke){let a;try{a=function(e){const a=document.getElementById("editor"),s=a?.getElementsByClassName("editor-revisions-header"),l=()=>!!s?.length;let c,d=!1,u=!1;const f={get ready(){return d&&!l()},notReady:e.strings.loading,notReadyState:"loading",saving:!1,idle:Promise.resolve(),title:e.postTitle};let p,m,h,g=!1,w=!1,v=0,y=!1;const b=function(e,t){const n=(0,o.createHooks)(),r=[];let i,a=!1;function s(e){i??="mtflpp_integration_failed"===e?.code?e:Object.assign(new Error(t.config.strings.integrationFailed),{code:"mtflpp_integration_failed",cause:e})}const l={get error(){return i},filter(e,t,...o){if(a||i)return t;try{const r=n.applyFilters(e,t,...o);if("additionalPreviewValues"===e&&("[object Object]"!==Object.prototype.toString.call(r)||Object.values(r).some(e=>!(null===e||["string","boolean"].includes(typeof e)||"number"==typeof e&&Number.isFinite(e)))))throw new TypeError("Preview values must be a plain object of scalar values.");return r}catch(e){return s(e),t}},action(e,...t){if(!a&&!i)try{n.doAction(e,...t)}catch(e){s(e)}},capture(e,t=null){a&&!i&&s(new Error("This editor session has ended."));const n=null===e?null:new URLSearchParams(e),o=l.filter("previewFormBody",e,t);if(null===o||o instanceof URLSearchParams||s(new TypeError("Preview capture must return URLSearchParams or null.")),i||null===n||null!==o&&![...n.keys()].some(e=>{const t=n.getAll(e),r=o.getAll(e);return r.length!==t.length||t.some((e,t)=>r[t]!==e)})||s(new TypeError("Preview capture must preserve the classic form body.")),i)throw i;return o},comparisonValues(e,o){const r=new Map(Object.entries(o));try{const o=t.form||document,i=new Set;for(const t of o.querySelectorAll("input[name], textarea[name], select[name]")){if(r.has(t.name)||!e?.has(t.name)||"password"===t.type)continue;if("hidden"===t.type){i.add(t.name);continue}const n="textarea"===t.localName||["text","search","email","url","tel"].includes(t.type),o=e.getAll(t.name);let a="value";n&&1===o.length&&(a=t.classList.contains("wp-editor-area")?"html":"text"),r.set(t.name,{type:a,value:1===o.length?o[0]:JSON.stringify(o)})}for(const t of i){if(r.has(t))continue;const n=e.getAll(t);n.length>1&&r.set(t,{type:"order",value:JSON.stringify(n),members:JSON.stringify(n.sort())})}return Object.fromEntries(n.applyFilters("previewComparisonValues",r,e))}catch{}return Object.fromEntries(r)},destroy(){if(!a){a=!0;for(const e of r.reverse())try{e()}catch(e){s(e)}r.length=0}}};try{(0,o.doAction)("mtflpp.blockEditor.previewSetup",{...t,hooks:n,onDestroy(e){r.push(e)}})}catch(e){s(e),l.destroy()}return l}(0,{config:e,changed(){p?.changed(),k()}}),x=()=>(0,n.select)("core/editor"),M=()=>Number(x()?.getCurrentPostId())===e.postId&&x()?.getCurrentPostType()===e.postType,P=(t=!1)=>{const n=t?e.strings.savedPostConflict:e.strings.nativeSaveFailed;h=Object.assign(new Error(n),{code:"mtflpp_source_changed"})};function S(){if(g||!p)return;const t=l();if(t!==u&&(u=t,t&&(d=!1,p.pause(e.strings.postOnly,"paused")),p.setSuspended(t)),t)return;const n=x(),o=!!n?.getCurrentPost()?.id,r=o&&M();r&&b.action("observePreviewInputs",n);const i=b.filter("previewPauseReason","",n),a=r&&!i&&!b.error;f.notReady=function(t,n,o){return t?n?b.error?.message||o:e.strings.postOnly:e.strings.loading}(o,r,i),f.notReadyState=o?"paused":"loading";const s=r&&(n.isSavingPost()||v>0),c=a&&!d;if(d=a,f.saving=s,b.error)return void p.resume(b.error);if(!d)return void p.pause(f.notReady,f.notReadyState);s&&!w&&p.pause(x().isPreviewingPost()?e.strings.nativePreview:e.strings.saving);const y=w&&!s;w=s;const P={...b.filter("additionalPreviewValues",{},n),post_title:n.getEditedPostAttribute("title")??"",excerpt:n.getEditedPostAttribute("excerpt")??"",content:n.getPostEdits().content??n.getCurrentPost().content,blocks:n.getEditedPostAttribute("blocks"),author:n.getEditedPostAttribute("author"),date:n.getEditedPostAttribute("date"),...Object.fromEntries(Object.entries(e.taxonomies||{}).map(([e,t])=>[`terms:${e}`,n.getEditedPostAttribute(t)])),featured_media:n.getEditedPostAttribute("featured_media")??0};if(b.error)return d=!1,void p.resume(b.error);f.title!==P.post_title&&(f.title=P.post_title,p.setTitle(f.title)),m&&Object.keys(P).length===Object.keys(m).length&&!Object.keys(P).some(e=>P[e]!==m[e])||(m=P,p.changed()),(y||c)&&p.resume(h)}function k(){y||(y=!0,queueMicrotask(()=>{y=!1,S()}))}function E(t,n,o){t&&t.request===n&&t.before===o&&e.base===o&&"boolean"==typeof t.available?"string"==typeof t.after&&i.test(t.after)?(e.base=t.after,e.available=t.available):P("conflict"===t.after):P()}f.preparePreview=()=>{const n=function(){const t=x(),n=t.getEditedPostAttribute("author"),o=t.getEditedPostAttribute("date"),r={};for(const[n,o]of Object.entries(e.taxonomies||{})){const e=t.getEditedPostAttribute(o);Array.isArray(e)&&(r[n]=e)}return{...b.filter("additionalPreviewValues",{},t),...n?{author:n}:{},...void 0!==o?{date:o}:{},...Object.keys(r).length?{terms:JSON.stringify(r)}:{},post_title:t.getEditedPostAttribute("title")??"",content:t.getEditedPostContent(),excerpt:t.getEditedPostAttribute("excerpt")??"",featured_media:t.getEditedPostAttribute("featured_media")??0}}(),o=b.capture(null),r={post_title:"text",content:"html",excerpt:"html"},i=b.comparisonValues(o,Object.fromEntries(Object.entries(n).map(([e,t])=>[e,{type:Object.hasOwn(r,e)?r[e]:"value",value:t}])));let a;if(n.base=e.base,null===o)a=t({url:e.endpoint,method:"POST",data:n});else{for(const[e,t]of Object.entries(n))o.set(e,t??"");a=t({url:e.endpoint,method:"POST",body:o})}return a.then(e=>({...e,comparisonValues:i}))};const C=(0,n.subscribe)(k);return(0,o.addFilter)("editor.preSavePost",r,async function(t){if(g||!p||Number(t.id)!==e.postId||!M())return t;f.saving=!0;const n=p.pause(x().isPreviewingPost()?e.strings.nativePreview:e.strings.saving);try{await n}catch{}return t}),t.use(async function(t,n){if(g||!p||!["POST","PUT","PATCH"].includes((t.method||"GET").toUpperCase()))return n(t);const o=function(t){if("string"==typeof t.path&&t.path.startsWith("/"))return t.path.split("?")[0].replace(/\/$/,"");if("string"!=typeof t.url)return"";const n=new URL(t.url,window.location.href),o=new URL(e.restRoot,window.location.href);return n.origin!==o.origin?"":n.searchParams.has("rest_route")?n.searchParams.get("rest_route").replace(/\/$/,""):n.pathname.startsWith(o.pathname)?`/${n.pathname.slice(o.pathname.length)}`.replace(/\/$/,""):""}(t),r=o===e.postRoute||o===`${e.postRoute}/autosaves`,i=!r&&function(t){if("string"!=typeof e.postFormUrl||!(t.body instanceof FormData)||"string"!=typeof t.url)return!1;const n=new URL(t.url,window.location.href),o=new URL(e.postFormUrl,window.location.href);return n.origin===window.location.origin&&n.origin===o.origin&&n.pathname===o.pathname&&n.searchParams.has("meta-box-loader")&&t.body.get("post_ID")===String(e.postId)&&"editpost"===t.body.get("action")}(t);if(!r&&!i)return n(t);v++,f.saving=!0,k();const a=p.pause(e.strings.saving);try{await a}catch{}const s=e.base,l=Array.from(window.crypto.getRandomValues(new Uint8Array(16)),e=>e.toString(16).padStart(2,"0")).join("");let c;try{if(r){const e=await n({...t,headers:{...t.headers,"X-MTFLPP-Base":s,"X-MTFLPP-Request":l}});if(!1===t.parse){try{const t=await e.clone().json();E(t?._mtflpp_receipt,l,s)}catch{P()}return e}if(!e||"object"!=typeof e)return P(),e;const{_mtflpp_receipt:o,...r}=e;return E(o,l,s),r}const o=new FormData;for(const[e,n]of t.body)o.append(e,n);o.set("mtflpp_base",s),o.set("mtflpp_preview",l),o.set("mtflpp_metabox","1"),c=`mtflpp_preview_${l}`;const i=await n({...t,body:o}),a=document.cookie.split(";").map(e=>e.trim()).find(e=>e.startsWith(`${c}=`)),d=a?.slice(c.length+1),u=d?.startsWith(`${s}.`)?d.slice(65):"";return E({request:l,before:s,after:"conflict"===d?d:u,available:e.available},l,s),h||b.action("nativeMetaboxSaveAcknowledged"),i}catch(e){let t=e?._mtflpp_receipt;try{void 0!==t&&delete e._mtflpp_receipt}catch{t=void 0}const n=e?.data?.status;throw r&&"AbortError"!==e?.name&&"string"==typeof e?.code&&Number.isInteger(n)&&n>=400&&n<500&&t?.after===s?E(t,l,s):P(),e}finally{c&&(document.cookie=`${c}=; Max-Age=0; Path=${e.adminCookiePath}; SameSite=Strict`),v--,k()}}),f.connect=e=>{p=e,a&&(c=new MutationObserver(()=>{l()!==u&&k()}),c.observe(a,{childList:!0,subtree:!0})),S()},f.destroy=()=>{g||(g=!0,c?.disconnect(),C(),b.destroy(),(0,o.removeFilter)("editor.preSavePost",r))},window.addEventListener("pagehide",e=>{e.persisted||f.destroy()}),f}(ke);const s=window.wp?.editor?.PluginPreviewMenuItem,l=window.wp?.plugins?.registerPlugin,c="function"==typeof s&&"function"==typeof l,d=c?{fallbackMedia:window.matchMedia("(max-width: 782px)"),focus(){const e={preventScroll:!0},t=document.querySelector(".editor-preview-dropdown__toggle");t?.focus(e),t&&document.activeElement===t||document.querySelector('.interface-interface-skeleton__content[tabindex="-1"]')?.focus(e)}}:void 0,u=function(e,t,{inlineLauncher:n,nativeLauncher:o}={}){const r=e.strings,i=e.termId??e.postId,a=window,s=function(){let e,t=0,n=0;return{remember(e){try{e&&(t=e.defaultView.scrollY)}catch{}},async restore(e,o,r=()=>!0,i){const a=++n;try{const s=e.defaultView;let l;if(s.scrollTo({top:t,left:0,behavior:"instant"}),o?.ownerDocument===e&&r()){if(await ae(s),a!==n||o.ownerDocument!==e||!r())return;if(function(e,t){const n=e.ownerDocument;for(let t=e;t;t=t.parentElement)if("until-found"!==t.getAttribute("hidden")?.toLowerCase()&&(t.hasAttribute("hidden")||"none"===n.defaultView.getComputedStyle(t).display))return!1;let o=!1;for(let r=e;r&&e.isConnected&&e.ownerDocument===n&&t();r=r.parentElement){if("until-found"===r.getAttribute("hidden")?.toLowerCase()){if(r.dispatchEvent(new n.defaultView.Event("beforematch",{bubbles:!0})),!(e.isConnected&&e.ownerDocument===n&&r.isConnected&&r.ownerDocument===n&&r.contains(e)&&t()))break;"until-found"===r.getAttribute("hidden")?.toLowerCase()&&r.removeAttribute("hidden"),o=!0}const i=r.parentElement;i instanceof n.defaultView.HTMLDetailsElement&&!i.open&&r!==Array.from(i.children).find(e=>"summary"===e.localName)&&(i.open=!0,o=!0)}return o}(o,()=>a===n&&r())&&await new Promise(e=>s.setTimeout(e,0)),a!==n||!r())return;const t=o.ownerDocument===e?function(e){if(!e?.isConnected)return null;const t=se(e,!0);if(t?.clipped)return e;if(!t?.boundary)for(const t of e.querySelectorAll("*"))if(se(t,!0)?.clipped)return t;for(let n=t?.boundary||e.parentElement;n;){const e=se(n,!0);if(e?.clipped)return n;n=e?.boundary||n.parentElement}return null}(o):null;t&&(function(e,t){const n=ce(e,t,!0);if(!n?.inViewport)return void ge(e);const{rects:o,extent:r,header:i=0}=n,a=e.ownerDocument.documentElement,s=Math.min(r.x,a.clientWidth),l=Math.min(r.y,a.clientHeight-i);o.some(e=>e.right-e.left>=s-1&&e.bottom-e.top>=l-1)?t&&ie(n,t)?.reveal(he(e.ownerDocument.defaultView)):ge(e,{nearest:!0,header:i})}(t,i),o.contains(t)&&(l=t))}return t=s.scrollY,l}catch{}},keepInView(t,{canvas:n,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:a,canFollow:s}){try{const l=e?.target===t&&e.canFollow();if(e?.cancel(),!t.isConnected||!s())return;if(!l){const e=ce(t,o);if(!ie(e,o)?.visible)return}const c=new AbortController,d={target:t,canFollow:()=>!c.signal.aborted&&s(),cancel(){c.abort(),e===d&&(e=null)}};return e=d,function(e,t,n,o,r){const i=e=>{e.isTrusted&&("keydown"!==e.type||re.has(e.key))&&r()},a={capture:!0,passive:!0,signal:o};for(const n of[e,t])for(const e of["wheel","touchmove","pointerdown","keydown"])n?.addEventListener(e,i,a);t?.addEventListener("scroll",()=>{n?.()&&r()},a)}(t.ownerDocument.defaultView,n,a,c.signal,()=>{d.cancel(),i?.()}),async function(e,t,n,o){try{const r=e.ownerDocument.defaultView;if(await ae(r),!o())return;const{scrollX:i,scrollY:a}=r,s=n();if(s&&await s,!o()||r.scrollX!==i||r.scrollY!==a)return;let l=ce(e,t);l&&!l.rects.length&&(ge(e,{behavior:"instant",header:l.header}),l=ce(e,t)),ie(l,t)?.reveal()}catch{}}(t,o,r,d.canFollow).finally(d.cancel)}catch{}}}}(),l=p(r,{postTitle:t.title??e.postTitle,publicRedirect:e.publicRedirect,inlineLauncher:n,nativeLauncher:o,onOpen:()=>j(),onClose:()=>A(),onRefresh:R,onRetry:e=>e?j(!0):R(),beforeViewportChange:e=>h.beforeViewportChange(e),beforeMove:V,afterMove:()=>{u&&R()}});let c,d,u=!1,f=0;const h=function(e,t,n,o,r=[]){const i=m(r);let a,s,l,c,d;function u(){d?.()}return{get hasPreview(){return!!a},get hasHtmlPreview(){return!!s},get redirectDestination(){return c},load:function(r,f,p=()=>!1,m){const h=new URL(r);if("https:"!==h.protocol&&"http:"!==h.protocol)throw Object.assign(new Error(n.failed),{code:"mtflpp_preview_unsupported_url"});if(h.origin!==window.location.origin){const e=n.originMismatch.replace("%s",()=>h.origin+h.pathname);throw Object.assign(new Error(e),{code:"mtflpp_preview_origin_mismatch"})}const g=h.searchParams.get("mtflpp_token");if(!g)throw new Error(n.failed);return window.crossOriginIsolated&&h.searchParams.set("mtflpp_isolated","1"),u(),h.searchParams.delete("mtflpp_source"),e.followChanges&&h.searchParams.set("mtflpp_source","1"),o(n.updating),new Promise((r,u)=>{const w=e.stage.ownerDocument.createElement("iframe");w.title=n.title,w.className="mtflpp-frame mtflpp-loading",w.setAttribute("aria-hidden","true"),w.setAttribute("tabindex","-1"),w.referrerPolicy="same-origin";let v=!1,y=!1;const b=setTimeout(()=>M(new Error(n.failed)),3e4),x=()=>{y=!0,M()};function M(e){v||(v=!0,e&&(y=!0),clearTimeout(b),d===x&&(d=null),w!==a&&(w.onload=null,w.onerror=null,w.remove()),e?u(e):r())}d=x,w.onload=async()=>{const r=w!==a;if(r||(s=null,l=null),y||!f())return void M();let d,u,v;try{const e=w.contentDocument,t=e?.querySelector('meta[name="meet-the-frontend-live-preview-panel"]');t?.content===g?d=e:r&&!t&&(u=function(e,t){if("text/html"!==e?.contentType)return;const n=e.defaultView?.performance.getEntriesByType("navigation")[0];if(!(n?.redirectCount>0))return;const o=new URL(n.name);return o.origin!==t.origin||o.pathname===t.pathname&&o.search===t.search?void 0:o.pathname}(e,h))}catch{}d&&(e.followChanges&&i.capture(d,r?m:void 0),d.documentElement.style.setProperty("overscroll-behavior","contain","important")),d&&r&&(t.remember(s),e.followChanges&&p()&&s&&(v=i.findChange(s,d))),r&&a&&(a.onload=null,a.onerror=null,a.remove()),a=w,s=d,l=null,c=u,w.classList.remove("mtflpp-loading"),w.removeAttribute("aria-hidden"),w.removeAttribute("tabindex");const b=()=>!y&&f()&&w===a&&d===s&&(!d||w.contentDocument===d);let x;if(d&&r){const n=e.canvasTarget&&(t=>e.canvasTarget(w,t,{fitTarget:!0}));x=await t.restore(d,v,()=>b()&&e.followChanges&&p(),n)}b()?(l=x,o(n.current,"ready"),M()):M()},w.onerror=()=>{w===a?(s=null,l=null,c=void 0,f()&&o(n.failed,"error")):M(new Error(n.failed))},w.src=h.href,e.stage.append(w)})},cancel:u,beforeViewportChange({canvasTarget:n,canFollow:o,...r}){const i=l,c=s,d=a;if(i&&c)return t.keepInView(i,{...r,canvasTarget:e=>n(d,e),canFollow:()=>i===l&&c===s&&d.contentDocument===c&&e.visible&&e.followChanges&&o()})},clear(){u(),t.remember(s),a&&(a.onload=null,a.onerror=null),a=null,s=null,l=null,c=void 0,e.clearPreview()}}}(l,s,r,k,e.comparisonExcludedSelectors);let g,w,v,y,b,x,M,P,S=!1;try{a.BroadcastChannel&&(P=new a.BroadcastChannel(`meet-the-frontend-live-preview-panel:${e.endpoint}:${i}:${e.userId}`),P.onmessage=e=>{"takeover"===e.data?.type&&u&&(A(!0),k(r.handedOff,"conflict",{reason:"handed-off"}))},a.addEventListener("pagehide",e=>{e.persisted||P.close()}))}catch{P?.close(),P=null}function k(e,n="loading",{canRetry:o=!0,reason:r=""}={}){"ready"===n&&(S=!1),l.report(e,n,{canTakeOver:!!P,hasPreview:h.hasPreview,canRetry:o,reason:r,hasHtmlPreview:h.hasHtmlPreview,redirectDestination:h.redirectDestination,canRefresh:u&&!t.saving&&["ready","error"].includes(n)&&("error"!==n||o)})}function E(e){const t=e?.code,n=function(e){const t=e?.code;return"mtflpp_post_locked"===t?"post-locked":"mtflpp_acf_rows_stale"===t?"reload-before-save":["mtflpp_invalid_nonce","rest_cookie_invalid_nonce","mtflpp_preview_conflict","mtflpp_source_changed","mtflpp_acf_unavailable","mtflpp_integration_failed"].includes(t)?"reload":["mtflpp_cannot_preview","rest_forbidden","rest_cannot_edit"].includes(t)?"permission":"mtflpp_preview_origin_mismatch"===t?"origin-mismatch":"mtflpp_preview_unsupported_url"===t?"unsupported-url":""}(e);n&&(u=!1,C(),h.cancel(),b?.()),k("string"==typeof t?e.message:r.failed,"post-locked"===n?"paused":"error",{reason:n,canRetry:!n})}function C(){clearTimeout(c),d=void 0}function L(e){if(void 0===e&&void 0===d)return;const t=performance.now();void 0!==e&&(d=t+e),clearTimeout(c);const n=Math.ceil(d-t);n>0?c=setTimeout(T,n):T()}function O(){u&&(f+=1,S=!0,h.cancel(),t.saving||k(r.stale,"stale"),t.saving||t.previewing?C():L(275))}function T(){if(!u||g||!1===t.ready||t.previewing||t.saving)return;C();const n=f;k(r.updating),g=(async()=>{try{if(await t.idle,!u||!1===t.ready||t.saving)return;const o=e.base;let i,a;v=t.preparePreview(l.followChanges);try{i=await v}catch(e){a=e}finally{v=null}if(await t.idle,!u||!1===t.ready||t.saving||o!==e.base)return;if(a)throw a;if("string"!=typeof i.url)throw Object.assign(new Error(i.message||r.failed),{code:i.code});u&&n===f&&await function(e,t,n){return h.load(e,()=>u&&t===f,()=>l.followChanges&&S,n)}(i.url,n,i.comparisonValues)}catch(e){u&&!t.saving&&E(e)}finally{g=null,L()}})()}function V(){f+=1,h.clear()}function A(e=!1){l.setVisible(e),u=!1,C(),V(),clearTimeout(M),M=null,x?.abort(),l.returnToEditor(),b?.()}async function j(n=!1){if(l.setVisible(!0),u)return;if(w)return void E(w);if(y){if(x&&!x.signal.aborted)return;const e=f;try{await y}catch{}return void(l.visible&&e===f&&j(n))}if(!1===t.ready)return void k(t.notReady,t.notReadyState??"paused",{canRetry:!1});if(!e.available)return void k(r.unavailable,"error",{canRetry:!1,reason:"unavailable"});if(!a.isSecureContext||!navigator.locks)return void k(r.browser,"error",{canRetry:!1,reason:"browser"});const o=n&&P?new AbortController:null;let s=!1;x=o,o?(k(r.waiting,"handover"),M=setTimeout(()=>{s=!0,o.abort()},15e3)):k(t.saving?r.saving:r.updating);try{const n=o?{signal:o.signal}:{ifAvailable:!0};if(y=navigator.locks.request(`meet-the-frontend-live-preview-panel:${e.endpoint}:${i}`,n,async e=>{if(clearTimeout(M),M=null,x=null,l.visible&&!o?.signal.aborted)if(e){k(t.saving?r.saving:r.updating);try{await new Promise(e=>{b=e,u=!0,f+=1,T()}),await g}finally{b=null}}else k(P?r.conflict:r.closeOther,"conflict",{reason:P?"other-tab":"manual"})}),o)try{P.postMessage({type:"takeover"})}catch(e){throw o.abort(),u&&A(!0),await y.catch(()=>{}),e}await y,l.visible&&s&&k(r.takeoverTimeout,"conflict",{reason:"busy"})}catch(e){u=!1,l.visible&&s?k(r.takeoverTimeout,"conflict",{reason:"busy"}):l.visible&&"AbortError"!==e.name&&E(e)}finally{clearTimeout(M),M=null,x=null,y=null}}function R(e=!0){t.saving||(e||(S=!1),u?(f+=1,h.cancel(),L(0)):j())}return{changed:O,pause:function(e=r.saving,t="loading"){return f+=1,C(),h.cancel(),(u||l.visible&&"paused"===t)&&k(e,t,{canRetry:!1}),v},resume:function(e){w=e,e?l.visible&&E(e):!l.visible||u||y?O():j()},setSuspended:l.setSuspended,setTitle:l.setTitle,openFromLauncher:l.openFromLauncher,start:()=>{l.visible&&j()},get pending(){return g}}}(ke,a,{nativeLauncher:d});a.connect(u),c&&l("meet-the-frontend-live-preview-panel",{render:()=>(0,e.createElement)(s,{role:"menuitem",icon:null,info:ke.strings.showLivePreviewHelp,onClick:()=>window.requestAnimationFrame(()=>u.openFromLauncher())},ke.strings.showLivePreview)})}catch(e){a?.destroy(),function(e,t){document.getElementById("mtflpp-panel")?.remove(),document.getElementById("mtflpp-toggle")?.remove(),document.getElementById("mtflpp-publish-preview")?.remove(),document.getElementById("mtflpp-term-preview")?.remove();const n=document.createElement("div");n.className="notice notice-error inline",n.setAttribute("role","alert");const o=document.createElement("p");o.textContent=e,n.append(o);const r=document.querySelector("#wpbody-content .wp-header-end")||document.querySelector("#wpbody-content .wrap h1, #wpbody-content .wrap h2");r?r.after(n):(document.getElementById("wpbody-content")||document.body).prepend(n),console.error("Meet the Frontend – Live Preview Panel could not start.",t)}(ke.strings.bootFailed,e)}}})();
  • meet-the-frontend-live-preview-panel/trunk/build/classic-editor.asset.php

    r3820590 r3822693  
    1010                'wp-primitives'
    1111        ),
    12         'version' => '299c3b38e3acce334a1b'
     12        'version' => 'f8d9d3c4a1d18700a696'
    1313);
  • meet-the-frontend-live-preview-panel/trunk/build/classic-editor.js

    r3820590 r3822693  
    1 (()=>{"use strict";const e=window.wp.hooks,t=window.wp.data,n=window.wp.preferences,o=window.wp.element,r=window.wp.components,i=window.wp.notices,a=window.wp.primitives,s=window.ReactJSXRuntime,l={refresh:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M12 5.5L17.7929 11.2929C18.1834 11.6834 18.1834 12.3166 17.7929 12.7071L16 14.5M16 5.5H12V9.5M12 18.5L6.20711 12.7071C5.81658 12.3166 5.81658 11.6834 6.20711 11.2929L8 9.5M8 18.5H12V14.5"})}),more:(0,s.jsxs)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,s.jsx)(a.Path,{d:"M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z",fill:"currentColor",stroke:"none"}),(0,s.jsx)(a.Path,{d:"M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z",fill:"currentColor",stroke:"none"}),(0,s.jsx)(a.Path,{d:"M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z",fill:"currentColor",stroke:"none"}),(0,s.jsx)(a.Path,{d:"M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z"}),(0,s.jsx)(a.Path,{d:"M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z"}),(0,s.jsx)(a.Path,{d:"M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z"})]}),expand:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M4.75 10V4.75H10M4.75 4.75L10 10M14 19.25H19.25V14M19.25 19.25L14 14"})}),compact:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M10 4.75V10H4.75M10 10L4.75 4.75M19.25 14H14V19.25M14 14L19.25 19.25"})}),pip:(0,s.jsxs)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,s.jsx)(a.Path,{d:"M4.75 9.25V16C4.75 16.6904 5.30964 17.25 6 17.25H8M4.75 9.25V6C4.75 5.30964 5.30964 4.75 6 4.75H16C16.6904 4.75 17.25 5.30964 17.25 6V8M4.75 9.25H8"}),(0,s.jsx)(a.Path,{d:"M10.75 11.25C10.75 10.9739 10.9739 10.75 11.25 10.75H18.75C19.0261 10.75 19.25 10.9739 19.25 11.25V18.75C19.25 19.0261 19.0261 19.25 18.75 19.25H11.25C10.9739 19.25 10.75 19.0261 10.75 18.75V11.25Z",fill:"currentColor"})]}),move:(0,s.jsxs)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,s.jsx)(a.Path,{d:"M9.25 5.75H8.75V6.25H9.25V5.75Z",fill:"currentColor",stroke:"none"}),(0,s.jsx)(a.Path,{d:"M9.25 11.75H8.75V12.25H9.25V11.75Z",fill:"currentColor",stroke:"none"}),(0,s.jsx)(a.Path,{d:"M9.25 17.75H8.75V18.25H9.25V17.75Z",fill:"currentColor",stroke:"none"}),(0,s.jsx)(a.Path,{d:"M15.25 5.75H14.75V6.25H15.25V5.75Z",fill:"currentColor",stroke:"none"}),(0,s.jsx)(a.Path,{d:"M15.25 11.75H14.75V12.25H15.25V11.75Z",fill:"currentColor",stroke:"none"}),(0,s.jsx)(a.Path,{d:"M15.25 17.75H14.75V18.25H15.25V17.75Z",fill:"currentColor",stroke:"none"}),(0,s.jsx)(a.Path,{d:"M9.25 5.75H8.75V6.25H9.25V5.75Z"}),(0,s.jsx)(a.Path,{d:"M9.25 11.75H8.75V12.25H9.25V11.75Z"}),(0,s.jsx)(a.Path,{d:"M9.25 17.75H8.75V18.25H9.25V17.75Z"}),(0,s.jsx)(a.Path,{d:"M15.25 5.75H14.75V6.25H15.25V5.75Z"}),(0,s.jsx)(a.Path,{d:"M15.25 11.75H14.75V12.25H15.25V11.75Z"}),(0,s.jsx)(a.Path,{d:"M15.25 17.75H14.75V18.25H15.25V17.75Z"})]}),warning:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M12 8L12 13M12 14.5L12 16M4.75 12C4.75 7.99593 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12Z",strokeLinejoin:"round"})}),info:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M12 16V11M12 9.5V8M19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12C4.75 7.99594 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12Z",strokeLinejoin:"round"})}),close:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M7.75 16.25L16.25 7.75M16.25 16.25L7.75 7.75"})}),check:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M7 12L10 15L17 8"})}),chevron:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M7 11L12 15L17 11"})}),desktop:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M4.75 16.75V17H3.25C3.11193 17 3 17.1119 3 17.25H21C21 17.1119 20.8881 17 20.75 17H19.25V16.75M4.75 16.75V8.5C4.75 7.80964 5.30964 7.25 6 7.25H18C18.6904 7.25 19.25 7.80964 19.25 8.5V16.75M4.75 16.75H19.25"})}),tablet:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M10 16.5H14M18.25 18V6C18.25 5.30964 17.6904 4.75 17 4.75H7C6.30964 4.75 5.75 5.30964 5.75 6L5.75 18C5.75 18.6904 6.30964 19.25 7 19.25H17C17.6904 19.25 18.25 18.6904 18.25 18Z"})}),mobile:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M11 16.5H13M16.25 18V6C16.25 5.30964 15.6904 4.75 15 4.75H9C8.30964 4.75 7.75 5.30964 7.75 6L7.75 18C7.75 18.6904 8.30964 19.25 9 19.25H15C15.6904 19.25 16.25 18.6904 16.25 18Z"})})};function c(e,t,n="right"){const o=e&&!Array.isArray(e)&&e.bounds&&["x","y","width","height"].every(t=>Number.isFinite(e.bounds[t]))&&e.bounds.width>0&&e.bounds.height>0&&[null,"left","center","right"].includes(e.dock)&&"boolean"==typeof e.expanded&&(void 0===e.anchor||["left","center","right"].includes(e.anchor));let r=!!o&&e.expanded;const i={width:480,height:393},a=o?{...e.bounds}:{x:0,y:0,...i};let s=o?e.dock:n,l=s||o&&e.anchor||"right";function c(){return"left"===l?0:"center"===l?.5:1}function d(e,n=t(!s),o=320,r=220){return e.width=Math.min(n.width,Math.max(Math.min(o,n.width),e.width)),e.height=Math.min(n.height,Math.max(Math.min(r,n.height),e.height)),e.x=Math.max(n.left,Math.min(n.right-e.width,e.x)),e.y=Math.max(n.top,Math.min(n.bottom-e.height,e.y)),e}function u(e){if(!s)return e;const n=t();return e.x="left"===s?n.left:"center"===s?n.left+(n.width-e.width)/2:n.right-e.width,e.y=n.bottom-e.height,e}return{area:t,compactRect:function(){return u(d({...a}))},launcherRect:function(e){return u(d({...e,x:a.x+(a.width-e.width)*c(),y:a.y+a.height-e.height},t(!s),1,1))},usableEdge:function(e){return!(s&&(e.includes("s")||"left"===s&&e.includes("w")||"right"===s&&e.includes("e")))},get anchor(){return l},get anchorFactor(){return c()},get dock(){return s},get expanded(){return r},get layout(){return{bounds:{...a},dock:s,anchor:l,expanded:r}},toggleExpanded(){r=!r},dockTo:function(e="right",t=!1){t&&Object.assign(a,i),r=!1,l=s=e},resize(e,n,o,r){Object.assign(a,function(e,n,o,r){const i=t(!s),a=n.includes("e")||n.includes("w"),c=n.includes("n")||n.includes("s"),d=function(e){return"center"===l?.5:e.includes("w")?1:0}(n),u=e.x+e.width*d,f=n.includes("n"),p=e.y+(f?e.height:0),m=function(e,t,n){return 0===n?e.right-t:1===n?t-e.left:2*Math.min(t-e.left,e.right-t)}(i,u,d),h=f?p-i.top:i.bottom-p,g=(n.includes("w")?-o:o)*(.5===d?2:1),w=Math.max(Math.min(320,m),Math.min(m,e.width+g)),v=Math.max(Math.min(220,h),Math.min(h,e.height+(f?-r:r))),y=a&&0!==o&&w!==e.width,b=c&&0!==r&&v!==e.height,x=f?p-v:p;return{x:y?u-w*d:e.preferredBounds.x,y:b?x:e.preferredBounds.y,width:y?w:e.preferredBounds.width,height:b?v:e.preferredBounds.height}}(e,n,o,r))},move:function(e,n,o,r=!1){const i=d({...e,x:e.x+n,y:e.y+o},t(!0),r?1:320,r?1:220);a.x=i.x+(r?(i.width-a.width)*c():0),a.y=i.y+(r?i.height-a.height:0),s=null}}}function d(e,{postTitle:a="",publicRedirect:s,inlineLauncher:d,nativeLauncher:u,canRememberVisibility:f=!0,onOpen:p,onClose:m,onRefresh:h,onRetry:g,beforeMove:w,afterMove:v,beforeViewportChange:y}){const b=window,x=document,M="meet-the-frontend-live-preview-panel",E=(0,t.select)(n.store),P=(0,t.dispatch)(n.store),k="width"===E.get(M,"fit")?"width":"automatic";P.setDefaults(M,{rememberVisibility:!0,rememberPosition:!0,panelOpen:!0,scrollToChanges:!0,viewport:"desktop",fitMode:k,customZoom:100,tabletOrientation:"portrait",mobileOrientation:"portrait"});const C=()=>!d&&(!u||u.fallbackMedia.matches);let S=!1!==E.get(M,"rememberVisibility"),L=!1!==E.get(M,"rememberPosition"),V=!1!==E.get(M,"scrollToChanges");const T=d?.parentElement??x.getElementById("mtflpp-toggle"),j=x.getElementById("mtflpp-panel");if(!T||!j)throw new Error("Preview panel markup is missing.");const O=d||function(e){let t;const{title:n,moveHelp:i}=e.dataset;return(0,o.flushSync)(()=>(0,o.createRoot)(e).render((0,o.createElement)(r.Button,{ref:e=>{t=e},variant:"secondary",label:n,title:n,description:i,"aria-controls":"mtflpp-panel","aria-expanded":!1},(0,o.createElement)("span",{className:"mtflpp-launcher-label"},n)))),t}(T),H=j.querySelector(".mtflpp-move-control"),R=j.querySelector(".mtflpp-resize"),A=j.querySelectorAll("[data-resize-edge]"),F=j.querySelector(".mtflpp-header"),N=j.querySelector(".mtflpp-caption"),$=j.querySelector(".mtflpp-viewport"),_=j.querySelector(".mtflpp-canvas"),D=j.querySelector(".mtflpp-stage"),B=j.querySelector(".mtflpp-empty"),q=j.querySelector(".mtflpp-devicebar"),W=j.querySelector(".mtflpp-dimensions"),I=j.querySelector(".mtflpp-feedback"),z=j.querySelector('[role="status"]');let Z;const J=function(e,t,n,o={},r=()=>{},i={desktop:"Desktop",tablet:"Tablet",mobile:"Phone"}){const a=e.ownerDocument.defaultView,s=e.querySelector(".mtflpp-canvas"),l=e.querySelector(".mtflpp-canvas-space"),c=n.querySelector(".mtflpp-dimensions-text"),d={desktop:[1280,800],tablet:[768,1024],mobile:[390,844]},u=Object.keys(d);let f=u.includes(o.device)?o.device:"desktop";const p=["automatic","window","width","custom"];let m=p.includes(o.fit)?o.fit:"automatic";const h=e=>Number.isInteger(e)&&e>=10&&e<=400;let g,w=h(o.customZoom)?o.customZoom:100,v=100;const y=e=>"desktop"===e?"landscape":"portrait",b=Object.fromEntries(u.map(e=>[e,"desktop"!==e&&["portrait","landscape"].includes(o[`${e}Orientation`])?o[`${e}Orientation`]:y(e)])),x=()=>b[f]===y(f)?d[f]:[...d[f]].reverse(),M=()=>"width"===m;let E,P,k;const C=a.matchMedia("(prefers-reduced-motion: no-preference)");function S(){const t=e.ownerDocument.defaultView.devicePixelRatio;return Number.isFinite(t)&&t>0?t:1}function L(e,t){if("custom"===m)return w/100/S();const n=s.clientWidth/e;if(M())return n;const o=Math.min(n,s.clientHeight/t);return"automatic"===m?Math.min(1/S(),o):o}function V(e,n){E=e;const[o,r]=x(),i=Math.max(0,(s.clientWidth-o*E)/2),a=Math.max(0,(s.clientHeight-r*E)/2);Object.assign(l.style,{width:`${Math.max(s.clientWidth,i+o*E)}px`,height:`${Math.max(s.clientHeight,a+r*E)}px`}),Object.assign(t.style,{left:`${i}px`,top:`${a}px`,transform:`scale(${E})`});const c=o*E>s.clientWidth+.01||r*E>s.clientHeight+.01,d="custom"===m||M();s.tabIndex=d&&c?0:-1,s.scrollLeft="custom"===m?n.x*E:0,s.scrollTop=d?n.y*E:0}function T(){if(!P)return;const e=P;P=null,e.window.cancelAnimationFrame(e.frame),e.resolve?.()}function j(e,t,n,o){return t<=0||o&&e<-1&&t<n?Math.max(e,t-n):e>=n||o&&e>0&&t>n+1?Math.min(e,t-n):0}function O(o=!1,a=!1){T();const[l,d]=x();if(Object.assign(t.style,{width:`${l}px`,height:`${d}px`}),!e.clientWidth||!e.clientHeight)return;const u=S(),p=`${i[f]} (${l} × ${d}) · `,h=Math.max(400,Math.ceil(e.clientWidth/l*u*100)),y=`${p}${"0".repeat(String(h).length)}%`;n.dataset.reserve!==y&&(n.dataset.reserve=y);const b=a?{x:0,y:0}:{x:(s.scrollLeft||0)/(E||1),y:(s.scrollTop||0)/(E||1)};if(s.style.overflowX="hidden",s.style.overflowY="hidden","custom"===m){const e=L(l,d);for(let t=0;t<2;t++)l*e>s.clientWidth+.01&&(s.style.overflowX="scroll"),d*e>s.clientHeight+.01&&(s.style.overflowY="scroll")}else M()&&d*L(l,d)>e.clientHeight&&(s.style.overflowY="scroll");if(!s.clientWidth||!s.clientHeight)return;const k=L(l,d),j=Math.round(k*u*100),O=j!==v||u!==g;v=j,g=u;const H=`${p}${"custom"===m?w:v}%`;c.textContent!==H&&(c.textContent=H),O&&r();const R=E??k;if(!o||!C.matches||R===k)return void V(k,b);const A={window:e.ownerDocument.defaultView,frame:null},F=A.window.performance.now();P=A;const N=e=>{V(e,b),A.scrollLeft=s.scrollLeft,A.scrollTop=s.scrollTop};N(R);const $=e=>{if(P!==A)return;const t=Math.min(1,Math.max(0,(e-F)/200));N(R+(k-R)*(1-(1-t)**3)),t<1?A.frame=A.window.requestAnimationFrame($):T()};A.frame=A.window.requestAnimationFrame($)}function H(){O()}function R(){k?.();const t=e.ownerDocument.defaultView.matchMedia(`(resolution: ${S()}dppx)`);t.addEventListener("change",R),k=()=>t.removeEventListener("change",R),H()}let A=new a.ResizeObserver(H);return A.observe(e),C.addEventListener("change",H),a.addEventListener("resize",R),R(),{get device(){return f},get fit(){return m},get customZoom(){return w},get zoomPercent(){return"custom"===m?w:v},get dpr(){return S()},get orientation(){return b[f]},canvasTarget:function(e,t,{fitTarget:n=!1}={}){const o=e.getBoundingClientRect(),r=s.getBoundingClientRect(),i=o.left-r.left-s.clientLeft,a=o.top-r.top-s.clientTop,l=j(i+t.left*E,i+t.right*E,s.clientWidth,n),c=j(a+t.top*E,a+t.bottom*E,s.clientHeight,n),d=Math.max(t.left,-i/E),u=Math.min(t.right,(s.clientWidth-i)/E);return{visible:!l&&!c,visibleCenterX:d<u?(d+u)/2:void 0,distance:Math.hypot(l,c),reveal(e="instant"){(l||c)&&s.scrollBy({left:l,top:c,behavior:e})}}},canvasWasPanned:function(){return!!P&&(s.scrollLeft!==P.scrollLeft||s.scrollTop!==P.scrollTop)},whenSettled:function(){if(!P)return;const e=P;return e.done??=new Promise(t=>{e.resolve=t}),e.done},finishMotion(){P&&H()},select(e,{animate:t=!1,keepPan:n=!1}={}){if(!u.includes(e))return;const o=f!==e;f=e,o?O(t,!n):P||H()},rotate({animate:e=!1,keepPan:t=!1}={}){"desktop"!==f&&(b[f]="portrait"===b[f]?"landscape":"portrait",O(e,!t))},setFit(e){p.includes(e)&&m!==e&&(m=e,O(!1,!0))},setZoom(e){if(!h(e)||"custom"===m&&w===e)return;const t="custom"!==m;w=e,m="custom",O(!1,t)},layout:H,beforeMove(){T(),A.disconnect(),k?.(),e.ownerDocument.defaultView.removeEventListener("resize",R)},afterMove(){A=new e.ownerDocument.defaultView.ResizeObserver(H),A.observe(e),e.ownerDocument.defaultView.addEventListener("resize",R),R()}}}($,D,W,{device:E.get(M,"viewport"),fit:E.get(M,"fitMode")??k,customZoom:E.get(M,"customZoom"),tabletOrientation:E.get(M,"tabletOrientation"),mobileOrientation:E.get(M,"mobileOrientation")},()=>Ce(),e),G=x.querySelector("#wpbody-content > .wrap"),X=x.getElementById("wpadminbar");function Y(e=!1){const t=Math.max(1,x.documentElement.clientWidth),n=Math.max(1,x.documentElement.clientHeight),o=x.documentElement.getBoundingClientRect().left+b.scrollX,r=!e&&G?.getBoundingClientRect(),i=r?Math.max(0,"rtl"===b.getComputedStyle(G).direction?r.left-o:o+t-r.right):20,a=e?0:i,s=Math.min(a,(t-1)/2),l=Math.min(Math.max(0,X?.getBoundingClientRect().bottom||0)+a,n-1),c=t-s,d=n-Math.min(a,n-l-1);return{left:s,top:l,right:c,bottom:d,width:c-s,height:d-l}}let U,Q=f&&(!S||!1!==E.get(M,"panelOpen"));const K=E.get(M,"layout"),ee=E.get(M,"position")??K?.dock??K?.anchor;let te=["left","center","right"].includes(ee)?ee:"right";const ne=c(L?K:void 0,Y,te),{compactRect:oe,usableEdge:re}=ne;let ie,ae=!1,se="",le=!1,ce={text:e.loading,state:"loading",hasPreview:!1,canRetry:!1,reason:""},de=!1;function ue(t){const n="string"==typeof t?t.replace(/\s+/g," ").trim():"";N.textContent=n?`${e.preview} — ${n}`:e.title,N.title=N.textContent,U&&(U.document.title=N.textContent)}function fe(){const{text:t,state:n,hasPreview:o,reason:r}=ce;return"handover"===n?{heading:e.switchingPreview,description:t,note:e.tabEdits}:"conflict"===n?{heading:t,description:{"handed-off":e.handedOffHelp,busy:e.takeoverTimeoutHelp,manual:e.closeOtherHelp}[r]||e.conflictHelp,note:"manual"===r?e.manualSwitchHint:e.tabEdits}:"paused"===n?{heading:e.pausedTitle,description:t,note:""}:"error"===n?function(){const{text:t,hasPreview:n,canRetry:o,reason:r}=ce;if("origin-mismatch"===r)return{heading:e.originMismatchTitle,description:n?`${t} ${e.previousPreview}`:t,note:""};if("unavailable"===r||"browser"===r)return{heading:"unavailable"===r?e.unavailableTitle:e.browserTitle,description:t,note:""};if(!n){let n=t;return t===e.failed&&(n=o?e.failedHelp:""),"reload"===r&&(n+=` ${e.reviewBeforeReload}`),{heading:e.failed,description:n,note:""}}return{heading:t===e.failed?e.refreshFailed:t,description:"reload"===r?e.reviewBeforeReload:e.previousPreview,note:""}}():o?{heading:t,description:"",note:""}:{heading:e.loading,description:e.preparing,note:""}}function pe(){return ae?"handover"===ce.state?e.takingOver:e.takeOver:e.retry}function me(e){return!e||["handover","paused"].includes(ce.state)?"info":"error"!==ce.state||ce.canRetry?"warning":"error"}function he(){return ce.redirectDestination?`${e.redirected} ${ce.redirectDestination}`:ce.hasHtmlPreview&&ie?`${e.publicRedirected} ${ie}`:""}function ge(){const{state:t,hasPreview:n,canRetry:o,reason:r}=ce,i=n&&["error","conflict","handover","paused"].includes(t),a=!n||i||se?"":he();if(I.hidden=!i&&!se&&!a,I.tabIndex=I.hidden?-1:0,j.dataset.hasFeedback=String(!I.hidden),I.hidden)return null;if(a)return{heading:a,status:"info",dismissible:!1};const{heading:s,description:l}=fe();return{heading:i?s:se,description:i?l:e.windowNoticeHelp,status:me(i),dismissible:!i,retry:i&&(ae||o&&["error","conflict"].includes(t)),close:i&&"error"===t&&!o&&"reload"!==r,disabled:"handover"===t,action:pe()}}function we(t){ce.hasPreview&&["error","conflict","handover","paused"].includes(ce.state)||(se=t,Ce()),z.textContent=`${t} ${e.windowNoticeHelp}`}function ve(){se="",Ce()}function ye(e,t="loading",{canTakeOver:n=!1,hasPreview:o=!1,hasHtmlPreview:r=!1,redirectDestination:i,canRefresh:a=!1,canRetry:l=!0,reason:c=""}={}){const d=j.ownerDocument.activeElement,u=j.contains(d),f=!o&&(ce.state!==t||ce.text!==e||ce.reason!==c),p=ce.hasPreview!==o;ce={text:e,state:t,canTakeOver:n,hasPreview:o,hasHtmlPreview:r,redirectDestination:i,canRefresh:a,canRetry:l,reason:c},["error","conflict","handover","paused"].includes(t)&&(se=""),j.dataset.state=t,j.dataset.hasPreview=String(o),ae=n&&["conflict","handover"].includes(t),B.hidden=o,q.hidden=!o;const{heading:m,description:h,note:g}=fe();f&&(B.scrollTop=0);const w="ready"!==t||se?"":he();z.textContent=o?[m,h,g,w].filter(Boolean).join(" "):m,Ce(),p&&J.layout(),function(e,t){e&&t&&(!j.contains(e)||e.closest("[hidden]")||e.disabled||!ce.hasPreview&&_.contains(e))&&Z.focus(B.hidden?"actions":"empty-title")}(d,u),Q&&"ready"===t&&r&&!i&&async function(){if(s&&!le){le=!0;try{const e=new URL(s.endpoint);if(e.origin!==b.location.origin)return;const t=await b.fetch(e,{credentials:"same-origin",cache:"no-store",redirect:"error",headers:{"X-WP-Nonce":s.nonce}});if(!t.ok)return;const{destination:n}=await t.json();if("string"!=typeof n||!n)return;if(ie=n,!Q)return;Ce(),"ready"!==ce.state||!ce.hasHtmlPreview||ce.redirectDestination||se||(z.textContent=he())}catch{}}}()}function be(e){f&&S&&E.get(M,"panelOpen")!==e&&P.set(M,"panelOpen",e)}function xe(){L&&P.set(M,"layout",ne.layout)}function Me(){const e=T.hidden;T.hidden=!1,T.style.maxWidth=`${Y(!ne.dock).width}px`;const t={width:T.offsetWidth,height:T.offsetHeight};return T.hidden=e,ne.launcherRect(t)}function Ee(){if(U)return;if(!Q&&C()){const e=Me(),t=ne.anchorFactor;Object.assign(T.style,{left:`${e.x+e.width*t}px`,top:`${e.y+e.height}px`,transform:`translate(${-100*t}%, -100%)`})}let e=oe();if(j.dataset.anchor=ne.anchor,ne.expanded){const t=Y();e={x:t.left,y:t.top,width:t.width,height:t.height}}Object.assign(j.style,{left:`${e.x}px`,top:`${e.y}px`,width:`${e.width}px`,height:`${e.height}px`,transform:""})}function Pe(e="right",t=!1){ne.dockTo(e,t),te=e,P.set(M,"position",te),Ee(),xe(),Ce()}function ke(){return"function"==typeof b.documentPictureInPicture?.requestWindow}function Ce(){if(!Z)return;const t=j.ownerDocument.fullscreenElement===j,n=!U&&!t,o=n&&!ne.expanded;j.classList.toggle("mtflpp-expanded",ne.expanded),R.hidden=!o;for(const e of A)e.hidden=!o||!re(e.dataset.resizeEdge);const r=ae||ce.canRetry&&["error","conflict"].includes(ce.state);var i;Z.update({inPage:n,inPip:!!U,movable:o,dock:ne.dock,canRememberVisibility:f,rememberVisibility:S,rememberPosition:L,followChanges:V,device:J.device,busy:ce.hasPreview&&["stale","loading","handover"].includes(ce.state)&&ce.text!==e.saving,empty:ce.hasPreview?null:{...fe(),busy:["loading","stale","ready","handover"].includes(ce.state),icon:["paused","conflict"].includes(ce.state)||["unavailable","browser","origin-mismatch"].includes(ce.reason)?"info":"warning",retry:r,disabled:"handover"===ce.state,close:"error"===ce.state&&!r,action:pe()},notice:ge(),fit:J.fit,orientation:J.orientation,customZoom:J.customZoom,zoomPercent:J.zoomPercent,dpr:J.dpr,canRefresh:ce.canRefresh,hasPreview:ce.hasPreview,canPip:n&&ke(),canFullscreen:n&&!!x.fullscreenEnabled,mode:t||ne.expanded?"compact":"expand",modeLabel:(i=t,i?e.exitFullscreen:ne.expanded?e.compact:e.expand)})}function Se(){Z.closeMenu(),U?U.close():x.fullscreenElement!==j?(ne.toggleExpanded(),Ee(),xe(),Ce(),Z.focus("mode")):x.exitFullscreen().then(ve,()=>we(e.fullscreenFailed))}function Le(t,n=!1,o){const r=t===O,i=t===F,a=()=>o||("left"===ne.anchor?"ne":"nw"),s=()=>U||!r&&ne.expanded||x.fullscreenElement===j||n&&!re(a());let l,c;const d=()=>({...r?Me():oe(),preferredBounds:ne.layout.bounds});function u(){if(c=null,l)if(n||r)Ee();else{const e=oe(),t=e.x-parseFloat(j.style.left),n=e.y-parseFloat(j.style.top);Object.assign(j.style,{width:`${e.width}px`,height:`${e.height}px`,transform:`translate3d(${t}px, ${n}px, 0)`})}}function f(){if(!l)return;const{pointer:e,moved:n}=l;l=null,b.cancelAnimationFrame(c),t.hasPointerCapture(e)&&t.releasePointerCapture(e),j.classList.remove("mtflpp-dragging"),t.classList.remove("mtflpp-edge-active"),x.documentElement.classList.remove("mtflpp-window-dragging"),x.documentElement.style.removeProperty("--mtflpp-drag-cursor"),Ee(),n&&(r&&(de=!0),xe(),Ce())}t.addEventListener("pointerdown",e=>{0!==e.button||s()||i&&e.target.closest('button, a, [role="button"]')||(r&&(de=!1),e.preventDefault(),r?O.focus({preventScroll:!0}):t===H&&Z.focus("move"),Z.closeMenu(),l={...d(),pointer:e.pointerId,pointerX:e.clientX,pointerY:e.clientY},t.setPointerCapture(e.pointerId))}),t.addEventListener("pointermove",e=>{if(!l||l.pointer!==e.pointerId)return;const o=e.clientX-l.pointerX,i=e.clientY-l.pointerY;!l.moved&&Math.abs(o)+Math.abs(i)<4||(l.moved=!0,j.classList.add("mtflpp-dragging"),n&&t.classList.add("mtflpp-edge-active"),x.documentElement.style.setProperty("--mtflpp-drag-cursor",n?b.getComputedStyle(t).cursor:"grabbing"),x.documentElement.classList.add("mtflpp-window-dragging"),n?ne.resize(l,a(),o,i):ne.move(l,o,i,r),c||(c=b.requestAnimationFrame(u)))});for(const e of["pointerup","pointercancel","lostpointercapture"])t.addEventListener(e,f);b.addEventListener("blur",f),i||o||t.addEventListener("keydown",t=>{const o={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[t.key];if(!o||t.altKey||t.ctrlKey||t.metaKey||s())return;t.preventDefault(),Z.closeMenu();const i=d(),l=t.shiftKey?40:10;n?ne.resize(i,a(),o[0]*l,o[1]*l):ne.move(i,o[0]*l,o[1]*l,r),Ee(),xe(),Ce();const c=oe();z.textContent=n?`${e.resize}: ${Math.round(c.width)} × ${Math.round(c.height)}`:e.moved})}ue(a),F.addEventListener("dblclick",e=>{U||e.target.closest("button, a")||Se()}),x.addEventListener("fullscreenchange",Ce),R.addEventListener("keydown",e=>{"Escape"===e.key&&R.classList.add("mtflpp-help-dismissed")}),R.addEventListener("blur",()=>R.classList.remove("mtflpp-help-dismissed")),Le(H),Le(F),d||Le(O),Le(R,!0);for(const e of A)Le(e,!0,e.dataset.resizeEdge);function Ve(){j.hidden=!Q,T.hidden=!d&&(Q||!C()),O.setAttribute("aria-expanded",String(Q))}function Te(e=!0){Q?Z.focus("actions"):(be(!0),p(),Q&&e&&Z.focus("actions"))}return b.addEventListener("resize",Ee),b.addEventListener("scroll",Ee,{passive:!0}),u?.fallbackMedia.addEventListener("change",()=>{Ee(),Ve()}),O.addEventListener("click",e=>{if(de&&0!==e.detail)return de=!1,void e.preventDefault();de=!1,Te(0===e.detail)}),Z=function(e,n,a){const s=e.querySelector(".mtflpp-controls"),c=e.querySelector(".mtflpp-refresh-control"),d=e.querySelector(".mtflpp-move-control"),u=e.querySelector(".mtflpp-device-controls"),f=e.querySelector(".mtflpp-fit-control"),p=e.querySelector(".mtflpp-pip-control"),m=e.querySelector(".mtflpp-empty"),h=e.querySelector(".mtflpp-feedback");let g,w=(0,o.createRoot)(s),v=!1,y=!1,b=!1;const x=i.InlineNotices?(0,t.dispatch)(i.store):null,M=e.ownerDocument.defaultView?.wp?.theme?.ThemeProvider,E="meet-the-frontend-live-preview-panel",P="preview-feedback";let k="";function C(){const e=g.notice,t=/[.!?…。!?]$/.test(e.heading)?e.heading:`${e.heading}.`;return{message:e.description?`${t} ${e.description}`:e.heading,status:e.status,isDismissible:e.dismissible,actions:[...e.retry?[{label:e.action,disabled:e.disabled,onClick:a.retry}]:[],...e.close?[{label:n.close,onClick:a.close}]:[]]}}function S(){x&&k&&x.removeNotice(P,E),k=""}function L(e){return()=>{j(),e()}}function V(){const{inPage:t,inPip:s,mode:w,modeLabel:P,movable:k,busy:S,canRefresh:V,hasPreview:O,canPip:H}=g;return(0,o.createElement)(r.SlotFillProvider,null,(0,o.createPortal)(k&&t&&(0,o.createElement)(r.Button,{className:"mtflpp-icon mtflpp-move",size:"compact",icon:l.move,label:n.move,showTooltip:!0,tooltipPosition:"bottom","data-action":"move"}),d),(0,o.createPortal)((0,o.createElement)(r.Button,{className:"mtflpp-icon",size:"compact",icon:S?(0,o.createElement)(r.Spinner):l.refresh,label:n.refresh,showTooltip:!0,accessibleWhenDisabled:!0,disabled:!V,onClick:a.refresh,"data-action":"refresh"}),c),(0,o.createPortal)(H&&O&&(0,o.createElement)("div",{className:"mtflpp-pip-surface"},(0,o.createElement)(r.Button,{className:"mtflpp-pip-button",icon:l.pip,label:n.popOutHelp,"aria-label":n.popOut,description:n.popOutHelp,showTooltip:!0,onClick:a.popOut,"data-action":"pop-out"})),p),function(){const{canPip:e,canFullscreen:t,inPage:i,inPip:s,dock:c,canRememberVisibility:d,rememberVisibility:u,rememberPosition:f,followChanges:p}=g;return(0,o.createElement)(r.DropdownMenu,{className:"mtflpp-actions",label:n.actions,icon:l.more,open:v,onToggle(e){v=e,e&&(y=!1),T()},toggleProps:{className:"mtflpp-icon",size:"compact","data-action":"actions"},popoverProps:{placement:"bottom-end",offset:6,shift:!0,className:"mtflpp-menu-popover"}},()=>(0,o.createElement)(o.Fragment,null,(e||t)&&(0,o.createElement)(r.MenuGroup,{label:n.display},e&&(0,o.createElement)(r.MenuItem,{label:n.popOutHelp,description:n.popOutHelp,showTooltip:!0,onClick:L(a.popOut),"data-action":"pip","aria-label":n.popOut},n.popOut),t&&(0,o.createElement)(r.MenuItem,{onClick:L(a.fullscreen),"data-action":"fullscreen"},n.fullscreen)),i&&(0,o.createElement)(r.MenuGroup,{label:n.position},(0,o.createElement)(r.MenuItemsChoice,{value:c,choices:[{value:"left",label:n.bottomLeft},{value:"center",label:n.bottomCenter},{value:"right",label:n.bottomRight}],onSelect(e){j(),a.dock(e)}})),(0,o.createElement)(r.MenuGroup,{label:n.preferences},!1!==d&&(0,o.createElement)(r.MenuItem,{role:"menuitemcheckbox",isSelected:u,icon:u?l.check:void 0,info:n.rememberVisibilityHelp,onClick:L(a.rememberVisibility),"data-action":"remember-visibility"},n.rememberVisibility),(0,o.createElement)(r.MenuItem,{role:"menuitemcheckbox",isSelected:f,icon:f?l.check:void 0,info:n.rememberPositionHelp,onClick:L(a.rememberPosition),"data-action":"remember-position"},n.rememberPosition),(0,o.createElement)(r.MenuItem,{role:"menuitemcheckbox",isSelected:p,icon:p?l.check:void 0,info:n.followHelp,onClick:L(a.follow),"data-action":"follow"},n.follow)),i&&(0,o.createElement)(r.MenuGroup,null,(0,o.createElement)(r.MenuItem,{info:n.resetHelp,onClick:L(a.reset),"data-action":"reset"},n.reset)),s&&(0,o.createElement)(r.MenuGroup,null,(0,o.createElement)(r.MenuItem,{onClick:L(a.close),"data-action":"close"},n.closeLivePreview))))}(),!s&&(0,o.createElement)(r.Button,{className:"mtflpp-icon mtflpp-mode",size:"compact",icon:l[w],label:P,showTooltip:!0,onClick:a.mode,"data-action":"mode"}),!s&&(0,o.createElement)(r.Button,{className:"mtflpp-icon",size:"compact",icon:l.close,label:n.close,showTooltip:!0,onClick:a.close,"data-action":"close"}),(0,o.createPortal)(function(){const{device:e,orientation:t}=g;return(0,o.createElement)(r.Toolbar,{className:"mtflpp-devices",label:n.viewport,variant:"unstyled"},...["desktop","tablet","mobile"].map(i=>{const s=e===i,c=s&&"desktop"!==i,d=c&&"landscape"===t,u="portrait"===t?n.rotateLandscape:n.rotatePortrait;return(0,o.createElement)(r.ToolbarButton,{key:i,icon:l[i],className:d?"mtflpp-device-rotated":void 0,label:c?`${n[i]} — ${u}`:n[i],isPressed:s,"data-viewport":i,onClick:()=>a.device(i)})}))}(),u),(0,o.createPortal)(function(){const{fit:e,customZoom:t=100,dpr:i=1}=g,s={automatic:n.automatic,window:n.fitToWindow,width:n.fitToWidth},c={automatic:n.automaticHelp,window:n.fitToWindowHelp,width:n.fitToWidthHelp},d="custom"===e?n.fixedZoom:s[e]??n.automatic;return(0,o.createElement)(r.Dropdown,{open:y,onToggle(e){y=e,e&&(v=!1,b="custom"===g.fit),T()},contentClassName:"mtflpp-zoom-popover",focusOnMount:"firstElement",popoverProps:{placement:"top-end",offset:8,shift:!0,resize:!1,role:"dialog","aria-label":n.fitting},renderToggle:({isOpen:e,onToggle:t})=>(0,o.createElement)(r.Button,{className:"mtflpp-zoom-toggle",variant:"secondary",size:"compact",label:d,showTooltip:!0,"aria-label":`${n.fitting}: ${d}`,"aria-haspopup":"dialog","aria-expanded":e,onClick:t,"data-action":"zoom"},(0,o.createElement)("span",{className:"mtflpp-zoom-value"},d),l.chevron),renderContent:()=>(0,o.createElement)("div",{className:"mtflpp-zoom-content"},(0,o.createElement)(r.RadioControl,{label:n.zoomMode,selected:e,options:[...Object.entries(s).map(([e,t])=>({value:e,label:t,description:c[e]})),{value:"custom",label:n.fixedZoom,description:n.fixedZoomHelp}],onFocus(e){if(!b)return;b=!1;const t=e.currentTarget.closest(".mtflpp-zoom-content")?.querySelector('.mtflpp-custom-zoom input[type="number"]');t?.focus({preventScroll:!0});const n=t?.closest(".components-popover__content");if(n){const e=t.getBoundingClientRect(),o=n.getBoundingClientRect();n.scrollTop+=Math.min(0,e.top-o.top)+Math.max(0,e.bottom-o.bottom)}},onChange(e){b=!1,"custom"!==e?a.fit(e):a.zoom(t)}}),"custom"===e&&(0,o.createElement)("div",{className:"mtflpp-custom-zoom",onKeyDown(e){if("Enter"!==e.key)return;e.preventDefault();const t=Number(e.target.value);!1!==e.target.validity?.valid&&Number.isInteger(t)&&t>=10&&t<=400&&j()}},(0,o.createElement)(r.RangeControl,{label:n.customZoom,min:10,max:400,step:1,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:t,help:n.customZoomHelp,withInputField:!0,onChange(e){Number.isInteger(e)&&e>=10&&e<=400&&a.zoom(e)}})),(0,o.createElement)("div",{className:"mtflpp-dpr-note",role:"group","aria-label":n.displayInformation},(0,o.createElement)("span",{className:"mtflpp-dpr-value"},`${n.displayDpr}: ${Number(i.toFixed(2))}`),(0,o.createElement)("span",{className:"mtflpp-pixel-note"},n.pixelZoomHelp)))})}(),f),(0,o.createPortal)(function(){const{empty:e}=g;return e?(0,o.createElement)(r.Placeholder,{className:"mtflpp-placeholder","data-empty-icon":e.busy?void 0:e.icon,icon:e.busy?(0,o.createElement)(r.Spinner):l[e.icon],label:(0,o.createElement)("h3",{className:"mtflpp-empty-title",tabIndex:-1,"data-action":"empty-title"},e.heading),instructions:e.description},e.retry&&(0,o.createElement)(r.Button,{key:"retry",variant:"primary",disabled:e.disabled,onClick:a.retry,"data-action":"retry"},e.action),e.close&&(0,o.createElement)(r.Button,{key:"close",variant:"secondary",onClick:a.close,"data-action":"close"},n.close),e.note&&(0,o.createElement)("p",{className:"mtflpp-empty-note"},e.note)):null}(),m),(0,o.createPortal)(function(){if(!g.notice)return null;if(x){const e=(0,o.createElement)(i.InlineNotices,{context:E,className:"mtflpp-inline-notices"});return M?(0,o.createElement)(M,{cornerRadius:"none"},e):e}const{message:e,...t}=C();return(0,o.createElement)(r.Notice,{...t,onRemove:a.dismissNotice,spokenMessage:"",politeness:"polite"},e)}(),h),t?(0,o.createPortal)((0,o.createElement)(r.Popover.Slot),e.ownerDocument.body):(0,o.createElement)(r.Popover.Slot))}function T(){g&&w&&(function(){if(!x)return;if(!g.notice)return void S();const e=JSON.stringify(g.notice);if(k===e)return;const{message:t,status:n,...o}=C();x.createNotice(n,t,{...o,id:P,context:E,speak:!1,onDismiss:a.dismissNotice}),k=e}(),(0,o.flushSync)(()=>w.render((0,o.createElement)(V))))}function j(){(v||y)&&(v=!1,y=!1,T())}function O(t){g?.inPip&&"mode"===t&&(t="actions"),e.querySelector(`[data-action="${t}"]`)?.focus({preventScroll:!0})}return{update(t){const n=y&&!t.hasPreview&&e.ownerDocument.activeElement?.closest(".mtflpp-zoom-popover");t.hasPreview||(y=!1),g=t,T(),n&&O("empty-title")},closeMenu:j,focus:O,beforeMove(){v=!1,y=!1,w?.unmount(),w=null,S()},remount(){w=(0,o.createRoot)(s),T()}}}(j,e,{refresh:()=>{ce.canRefresh&&h()},retry:()=>{"handover"!==ce.state&&(ae||ce.canRetry&&["error","conflict"].includes(ce.state))&&g(ae)},dismissNotice:()=>{ve(),z.textContent=ce.text,Z.focus("actions")},mode:Se,close:function(){Z.closeMenu(),be(!1),m(),d||C()?O.focus():u.focus()},popOut:async function(){if(U||x.fullscreenElement===j||!ke())return;let t;Z.closeMenu();const n=()=>{U===t&&(w(),J.beforeMove(),Z.beforeMove(),x.body.append(j),j.classList.remove("mtflpp-pip"),U=null,Z.remount(),Ee(),J.afterMove(),Ce(),v(),Q&&Z.focus("mode"))};try{if(t=await b.documentPictureInPicture.requestWindow({width:640,height:440}),!Q)return void t.close();const e=b.getComputedStyle(j);t.document.documentElement.lang=x.documentElement.lang,t.document.documentElement.dir=e.direction;for(const n of["--wp-admin-theme-color","--wp-admin-theme-color-darker-10","--wp-admin-border-width-focus"]){const o=e.getPropertyValue(n);o&&t.document.documentElement.style.setProperty(n,o)}const o=x.querySelectorAll(['link[rel="stylesheet"][href*="/load-styles.php"]',"#wp-theme-css","#wp-theme-inline-css","#wp-components-css","#wp-components-inline-css","style[data-emotion]","style[data-wp-hash]","#meet-the-frontend-live-preview-panel-css","#meet-the-frontend-live-preview-panel-inline-css"].join(", "));for(const e of o){const n=e.cloneNode(!0);"STYLE"===e.tagName&&e.sheet&&(n.textContent=Array.from(e.sheet.cssRules,e=>e.cssText).join("\n")),n.addEventListener("load",J.layout,{once:!0}),t.document.head.append(n)}t.document.title=N.textContent,t.document.body.className="mtflpp-pip-document",t.addEventListener("resize",J.layout),t.addEventListener("pagehide",n,{once:!0}),U=t,w(),J.beforeMove(),Z.beforeMove(),j.classList.add("mtflpp-pip"),t.document.body.append(j),Z.remount(),J.afterMove(),Ce(),ve(),Z.focus("mode"),v()}catch{t&&(n(),t.close()),Z.focus("actions"),we(e.pipFailed)}},fullscreen:async function(){if(!U&&x.fullscreenEnabled){Z.closeMenu();try{await j.requestFullscreen(),ve(),Z.focus("mode")}catch{Z.focus("actions"),we(e.fullscreenFailed)}}},dock:e=>Pe(e),reset:()=>Pe("right",!0),follow:function(){V=!V,P.set(M,"scrollToChanges",V),Ce(),V&&ce.canRefresh&&h(!1)},rememberVisibility:function(){S=!S,P.set(M,"rememberVisibility",S),S&&be(Q),Ce()},rememberPosition:function(){L=!L,P.set(M,"rememberPosition",L),L?xe():(P.set(M,"position",te),P.set(M,"layout",void 0)),Ce()},device(e){const t=J.device;if(e===t&&"desktop"===e)return;let n=!1;if(Q&&V&&y){const{fit:e,customZoom:t,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:a}=J;n=!!y({canvas:_,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:a,canFollow:()=>J.fit===e&&J.customZoom===t})}const o={animate:Q&&!n,keepPan:n};e===t?(J.rotate(o),P.set(M,`${e}Orientation`,J.orientation)):(J.select(e,o),J.device!==t&&P.set(M,"viewport",J.device)),Ce()},fit(e){const t=J.fit;J.setFit(e),J.fit!==t&&P.set(M,"fitMode",J.fit),Ce()},zoom(e){const t=J.fit,n=J.customZoom;J.setZoom(e),J.customZoom!==n&&P.set(M,"customZoom",J.customZoom),J.fit!==t&&P.set(M,"fitMode",J.fit),Ce()}}),ye(e.loading,"loading",{canRetry:!1}),Ee(),Ve(),d&&(d.disabled=!1),{stage:D,canvasTarget:J.canvasTarget,get visible(){return Q},get followChanges(){return V},openFromLauncher:Te,setVisible(e){e||(Z.closeMenu(),se="",Ce(),J.layout()),Q=e,Ee(),Ve()},report:ye,setTitle:ue,clearPreview(){D.replaceChildren();const t=["ready","stale","loading"].includes(ce.state);ye(t?e.loading:ce.text,t?"loading":ce.state,{...ce,hasPreview:!1,hasHtmlPreview:!1,redirectDestination:void 0,canRefresh:!1,canRetry:!t&&ce.canRetry})},returnToEditor(){Z.closeMenu(),U?.close(),x.fullscreenElement===j&&x.exitFullscreen().catch(()=>{})}}}function u(e=[]){const t=Array.isArray(e)?[...e]:[],n=new WeakMap;return{capture(e,o){try{if(n.has(e))return;const r=function(e){try{const t=e.querySelector('meta[name="meet-the-frontend-live-preview-panel"]'),n=t?.getAttribute("data-mtflpp-source");if(!n)return null;const o=JSON.parse(n);if("string"!=typeof o)return null;const r=(new DOMParser).parseFromString(o,"text/html");return r.querySelector('meta[name="meet-the-frontend-live-preview-panel"]')?.content===t.content?r:null}catch{return null}}(e);n.set(e,{source:r?h(r,e,t):null,dom:h(e,e,t),values:o&&Object.fromEntries(Object.entries(o).map(([e,t])=>[e,{...t}]))})}catch{}},findChange(e,t){try{const o=n.get(e),r=n.get(t);if(!o||!r)return null;const i=function(e,t){if(!e||!t)return[];const n=[];for(const o of new Set([...Object.keys(e),...Object.keys(t)])){const r=Object.hasOwn(e,o)?e[o]:{type:t[o]?.type,value:""},i=Object.hasOwn(t,o)?t[o]:{type:e[o]?.type,value:""};if(r.type!==i.type||!["text","html"].includes(i.type)||"string"!=typeof r.value||"string"!=typeof i.value||r.value===i.value)continue;let a,s;try{a="html"===r.type?(new DOMParser).parseFromString(r.value,"text/html"):null,s="html"===i.type?(new DOMParser).parseFromString(i.value,"text/html"):null}catch{continue}const l=a?h(a,a,[],a.body):null,c=s?h(s,s,[],s.body):null,d=a?C(l):r.value,u=s?C(c):i.value,f=y(d),p=y(u);if(f!==p&&n.push({...S(f,p),type:"text"}),!a){const e=k(d,u);e&&n.push(e);continue}if(l&&c&&(f===p||b(d,u)))for(const e of v(l,c)){if(e.spacing){const t=P(e);t&&n.push(t);continue}if(f===p)if("attributes"===e.kind){const t=new Map(e.before.attributes),o=new Map(e.after.attributes);for(const e of new Set([...t.keys(),...o.keys()])){const r=t.get(e)??"",i=o.get(e)??"";JSON.stringify(r)!==JSON.stringify(i)&&n.push({type:"attribute",name:e,before:"string"==typeof r?r:JSON.stringify(r),after:"string"==typeof i?i:JSON.stringify(i)})}}else"content"===e.kind&&(y(C(e.before))===y(C(e.after))&&n.push({type:"markup",before:y(C(e.before)),after:y(C(e.after)),oldTag:e.before.tag,newTag:e.after.tag}),(e.before.media||[]).forEach((t,o)=>{const r=e.after.media?.[o];t&&r&&t!==r&&n.push({type:"media",before:t,after:r})}))}}return n}(o.values,r.values),a=function(e,t){if(!e||!t)return!1;const n=(e,t)=>Object.entries(e).some(([e,n])=>"order"!==n?.type&&(!Object.hasOwn(t,e)||n?.type!==t[e]?.type||n?.value!==t[e]?.value));return n(e,t)||n(t,e)}(o.values,r.values),s=!!o.source&&!!r.source,l=!!o.source!=!!r.source,c=[...s?v(o.source,r.source).map(e=>({...e,source:!0})):[],...v(o.dom,r.dom)],d=new Map,u=function(e,t){const n=new Map,o=e=>C(e,n),r=[];for(const n of e){if(n.unresolved)for(const e of f(n,t,o))r.push(e);if("insert"===n.kind&&n.added.length>1){const e=n.added.map(e=>{const r={...n,after:e,added:[e]},i=j(r,t,o);return{...r,input:i}}).filter(e=>e.input);if(e.length){r.push(...e);continue}}const e=j(n,t,o);r.push({...n,input:e})}return r}(c,i).filter(e=>(e.source||!s&&!l||e.input||a&&2===e.priority)&&(e.priority>0||e.input)&&(!e.spacing||function({before:e,after:t},n,o){const r=x(e,n,o),i=x(t,n,o);return r&&i&&r.omitted===i.omitted&&b(r.text,i.text)}(e,d,r.dom?.excluded)));return function(e,t){if(!e.length)return null;const n=e.reduce((e,t)=>Math.max(e,t.input),0),o=e.filter(e=>e.input===n),r=o.reduce((e,t)=>Math.max(e,t.priority),0),i=o.filter(e=>e.priority===r);if(i.some(e=>e.unresolved))return function(e,t){const n=e.find(e=>e.unresolved&&("replacement"===e.regionChange||"reorder"===e.regionChange&&(e.source||t))),o=n?.after.node;if(!o?.isConnected)return null;for(const t of e)if(t.unresolved){if(n.source&&!t.source&&"reorder"===t.regionChange)continue;if(!t.regionChange||t.after.node!==o)return null}else if(!("insert"===t.kind?t.added:[t.after]).every(e=>o.contains(e.node)))return null;return"contents"!==o.ownerDocument.defaultView.getComputedStyle(o).display?o:null}(i,t);const a=i.filter(e=>!e.input||e.directInput||!i.some(t=>t!==e&&e.matches?.length&&e.matches.every(e=>t.matches?.includes(e))&&O(e.after,t.after))),s=new Map,l=a.filter(e=>{const t="delete"===e.kind&&(e.following[0]||e.preceding[0])||e.after,n=t?.node;if(!n)return!0;const o="delete"!==e.kind||e.following.length?e.kind:"delete-last",r=s.get(n)||new Set;return!r.has(o)&&(r.add(o),s.set(n,r),!0)});return n&&s.size>1?null:function(e){const t=new Set,n=new Set;for(const o of e){let e,r=!1;"delete"===o.kind?(r=!o.removed.some(m),e=r?o.after:o.following.find(m)||o.preceding.find(m)||o.following.find(p)||o.preceding.find(p)||o.after):e="insert"===o.kind?o.added.find(m)||o.added.find(p):o.after;const i=p(e);if(!i)continue;const a=m(e),s=a||i;(a&&!r?t:n).add(s)}const o=t.size?t:n;return 1===o.size?o.values().next().value:null}(l)}(u,!s&&(a||function(e,t){return!!e&&!!t&&Object.entries(t).some(([t,n])=>{if("order"!==n?.type||!Object.hasOwn(e,t))return!1;const o=e[t];return"order"===o?.type&&o.members===n.members&&o.value!==n.value})}(o.values,r.values)))}catch{return null}}}}function f(e,t,n){const o=[];for(const r of t){if(!r.after||"spacing"===r.type)continue;const t=T(e.oldRange,r.before,n,r,!0),i=T(e.newRange,r.after,n,r,!1);if(!t.length)continue;const a="markup"===r.type&&r.oldTag===r.newTag;if(a||!r.before||!(t.length<=T(e.newRange,r.before,n,r,!0).length||i.length<=T(e.oldRange,r.after,n,r,!1).length))for(const n of i)a&&!t.some(e=>e.signature!==n.signature)||o.push({...e,unresolved:!1,before:null,after:n,kind:"content",input:r.before&&r.after?2:1,priority:2,matches:[r]})}return o}function p(e){if(e?.node)return e.node;for(const t of e?.children||[]){const e=p(t);if(e)return e}return null}function m(e){const t=e?.node;if(t?.getClientRects().length&&"visible"===t.ownerDocument.defaultView.getComputedStyle(t).visibility)return t;for(const t of e?.children||[]){const e=m(t);if(e)return e}return null}function h(e,t,n,o=e.querySelector('main, [role="main"]')||e.querySelector("article")||e.body){if(!o)return null;const r=n.filter(e=>{if("string"!=typeof e||!e.trim())return!1;try{return o.matches(e),!0}catch{return!1}}).join(", "),i=new Map,a=new Map;if(e!==t)for(const e of t.querySelectorAll("[data-mtflpp-node]")){const t=e.getAttribute("data-mtflpp-node");a.set(t,a.has(t)?null:e)}for(const n of[o,...o.querySelectorAll("*")]){if(r&&n.closest(r))continue;const o=[...n.childNodes].filter(e=>3===e.nodeType).map(e=>e.textContent),s=y(o.join(" ")),l=["img","source","video","audio","iframe"].includes(n.localName)?["src","srcset","poster"].map(e=>n.getAttribute(`data-${e}`)||n.getAttribute(e)||""):[],c=n.style?.backgroundImage||n.getAttribute("data-bg")||"",d=e===t?n:a.get(n.getAttribute("data-mtflpp-node"))||null,u=g(n,d,JSON.stringify([n.localName,s,l,c]));u.text=s,u.rawText=o.join(""),u.media=[...l,c],u.parent=i.get(n.parentElement),i.set(n,u),u.parent?.children.push(u)}for(const[e,t]of i)t.parts=[...e.childNodes].map(e=>3===e.nodeType?e.textContent:i.get(e)).filter(e=>void 0!==e);let s=i.get(o);if(!s)return null;const l=s.node;for(let e=o.parentElement;e;e=e.parentElement){const t=g(e,l,e.localName);t.children=[s],t.parts=[s],s=t}return s.excluded=r,s}function g(e,t,n){const o=function(e){const t=[];for(const{name:n,value:o}of e.attributes){if("data-mtflpp-node"===n||n.startsWith("on")||/(?:^|-)(nonce|token)(?:-|$)/.test(n))continue;if(/^(?:data-)?(?:src|srcset|poster|sizes|bg)$/.test(n))continue;let r=o;"class"===n&&(r=[...e.classList].sort().join(" ")),"style"===n&&(r=[...e.style].sort().map(t=>[t,e.style.getPropertyValue(t),e.style.getPropertyPriority(t)])),("class"!==n&&"style"!==n||r.length)&&t.push([n,r])}return t.sort(([e],[t])=>e.localeCompare(t))}(e);return{node:t,tag:e.localName,signature:n,attributes:o,children:[],parts:[],presentation:JSON.stringify(o.filter(([e])=>!w(e))),references:JSON.stringify(o.filter(([e])=>w(e)))}}function w(e){return["id","for","headers","aria-controls","aria-labelledby","aria-describedby","aria-owns","aria-flowto","aria-activedescendant","aria-details","aria-errormessage"].includes(e)}function v(e,t){const n=new Map,o=new Map,r=new Map,i=new Map,a=[];function s(e){const t=JSON.stringify(e);return n.has(t)||n.set(t,n.size+1),n.get(t)}function l(e){if(!e)return 0;const t=s([e.signature,e.children.map(l)]);return o.set(e,t),r.set(e,s([t,e.presentation,e.children.map(e=>r.get(e))])),i.set(e,s([t,e.presentation,e.references,e.children.map(e=>i.get(e))])),t}l(e),l(t);const c=e=>o.get(e);function d(e){const t=e.attributes.find(([e])=>"id"===e)?.[1];return t?`${e.tag} ${t}`:void 0}function u(e){if(!(e.children.length<2))return s(["collection",e.signature,e.children.map(c).sort((e,t)=>e-t)])}function f(e,t){const n=new Map;return e.forEach((e,o)=>{const r=t(e);void 0!==r&&n.set(r,n.has(r)?-1:o)}),n}return function e(t,n){t&&n&&(t.signature!==n.signature?a.push({kind:"content",before:t,after:n,priority:2}):t.rawText!==n.rawText&&a.push({kind:"content",before:t,after:n,priority:2,spacing:!0}),t.presentation===n.presentation&&t.references===n.references||a.push({kind:"attributes",before:t,after:n,priority:t.presentation!==n.presentation?1:0}),function(t,n,s,l){const p=l.parent&&s.parent&&l.tag===s.tag,m=f(t,c),h=f(n,c);let g,w,v,y;const b=new Set(t.flatMap(e=>[r.get(e),i.get(e)])),x=new Set(n.flatMap(e=>[r.get(e),i.get(e)]));function M(e,t,n){const o=n.get(e),r=n.get(t);return o===r||!x.has(o)&&!b.has(r)}function E(e,t){return o.get(e)===o.get(t)&&M(e,t,r)&&M(e,t,i)}function P(e,r,i,s,c){const d=t.slice(e,r),u=n.slice(i,s),f="replacement"===c&&p&&d.some(e=>!h.has(o.get(e)))&&u.some(e=>!m.has(o.get(e)))&&(!function(e,t){if(e.length<2||t.length<2)return!1;const n=e.filter(e=>e.children.length).length,o=t.filter(e=>e.children.length).length;if(!n&&!o||n>1&&o>1)return!0;const r=new Map;for(const{tag:e}of t)r.set(e,(r.get(e)||0)+1);let i=0;for(const{tag:t}of e){const e=r.get(t);if(e){if(2===++i)return!0;r.set(t,e-1)}}return!1}(d,u)||"form"===l.tag&&function(e,t){function n(e){const t=new Set;return e.every(function e(n){if(["input","select","textarea"].includes(n.tag)){const e=n.attributes.find(([e])=>"name"===e)?.[1],o=n.attributes.find(([e])=>"type"===e)?.[1]?.toLowerCase();return!(!e||"input"===n.tag&&"hidden"===o||(t.add(e),0))}let o=!1;for(const t of n.children)e(t)&&(o=!0);return o})?t:null}const o=n(e),r=n(t);return o&&r&&[...o].some(e=>!r.has(e))&&[...r].some(e=>!o.has(e))}(d,u)),g=p&&("reorder"===c||f)?c:void 0;a.push({kind:"region",after:l,priority:2,unresolved:!0,regionChange:g,oldRange:d,newRange:u})}function k(e,n,o,r,i,a,s){const l=[];for(let c=e;c<n;c++){const e=s(t[c]),n=a.get(e);if(!(i.get(e)!==c||void 0===n||n<o||n>=r)){if(l.length&&n<=l[l.length-1][1])return null;l.push([c,n])}}return l}!function r(i,s,b,x){for(;i<s&&b<x&&E(t[i],n[b]);)e(t[i],n[b]),i++,b++;for(;i<s&&b<x&&E(t[s-1],n[x-1]);)s--,x--,e(t[s],n[x]);if(i===s&&b===x)return;if(i===s||b===x){const e=b===x,r=e?t.slice(i,s):n.slice(b,x),c=e?[n[b-1],n[b]]:[t[i-1],t[i]];return void(r.some(e=>c.some(t=>t&&o.get(t)===o.get(e)))?P(i,s,b,x):e?a.push({kind:"delete",after:l,removed:r,priority:2,following:n.slice(b),preceding:n.slice(0,b).reverse()}):a.push({kind:"insert",after:r[0],added:r,priority:2}))}if(s-i===1&&x-b===1)return void e(t[i],n[b]);if(p&&function(e,r,i,a){const s=r-e;if(s<2||s!==a-i)return!1;const l=new Map;let c=!1;for(let r=0;r<s;r++){const a=o.get(t[e+r]),s=o.get(n[i+r]);c||=a!==s,l.set(a,(l.get(a)||0)+1),l.set(s,(l.get(s)||0)-1)}return c&&[...l.values()].every(e=>0===e)}(i,s,b,x))return void P(i,s,b,x,"reorder");let M=k(i,s,b,x,m,h,c);if(0===M?.length&&(g??=f(t,d),w??=f(n,d),M=k(i,s,b,x,g,w,d)),0===M?.length&&(v??=f(t,u),y??=f(n,u),M=k(i,s,b,x,v,y,u)),M?.length)for(const[o,a]of[...M,[s,x]])r(i,o,b,a),o<s&&e(t[o],n[a]),i=o+1,b=a+1;else P(i,s,b,x,M?"replacement":void 0)}(0,t.length,0,n.length)}(t.children,n.children,t,n))}(e,t),a}function y(e){return e.replace(/\s+/g," ").trim()}function b(e,t){return e!==t&&e.replace(/\s/g,"")===t.replace(/\s/g,"")}function x(e,t,n){for(;e.node?.isConnected&&e.parent?.node;){const{display:t}=e.node.ownerDocument.defaultView.getComputedStyle(e.node);if("inline"!==t&&"contents"!==t)break;e=e.parent}if(!t.has(e)){const{node:o}=e,r=[],i=o?.isConnected&&M(o,n,r)===E(e)&&m(e)?o.innerText:void 0;t.set(e,"string"==typeof i?{text:i,omitted:JSON.stringify(r)}:void 0)}return t.get(e)}function M(e,t,n){return t&&e.querySelector(t)?[...e.childNodes].map(e=>3===e.nodeType?e.textContent:1!==e.nodeType?"":e.matches(t)?(n.push(e.textContent),""):M(e,t,n)).join(""):e.textContent}function E(e){return e.parts.map(e=>"string"==typeof e?e:E(e)).join("")}function P({before:e,after:t}){return k(e.rawText,t.rawText)||k(E(e),E(t))}function k(e,t){if(!/\S/.test(e)||!b(e,t))return;const n=e.match(/\s+|\S+/g),o=t.match(/\s+|\S+/g);let r=0,i=0;for(;r<Math.min(n.length,o.length)&&n[r]===o[r];)r++;for(;i<Math.min(n.length,o.length)-r&&n.at(-1-i)===o.at(-1-i);)i++;const a=Math.max(0,r-1),s=Math.max(0,i-1);return{type:"spacing",before:n.slice(a,n.length-s).join(""),after:o.slice(a,o.length-s).join("")}}function C(e,t=new Map){return e?(t.has(e)||t.set(e,(e.parts||[]).map(e=>{if("string"==typeof e)return e;const n=C(e,t);return/^(?:p|div|section|article|main|aside|header|footer|nav|h[1-6]|li|[ou]l|d[ldt]|blockquote|pre|table|tr|t[dh]|caption|figure|figcaption|br|hr)$/.test(e.tag)?` ${n} `:n}).join("")),t.get(e)):""}function S(e,t){let n=0,o=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;for(;o<e.length-n&&o<t.length-n&&e[e.length-o-1]===t[t.length-o-1];)o++;let r=e.length-o,i=t.length-o;for(;n>0&&/\S/.test(e[n-1]);)n--;if(r>n&&/\S/.test(e[r-1]))for(;r<e.length&&/\S/.test(e[r]);)r++;if(i>n&&/\S/.test(t[i-1]))for(;i<t.length&&/\S/.test(t[i]);)i++;return{before:e.slice(n,r).trim(),after:t.slice(n,i).trim()}}function L(e,t){return t?V(e,t):""===y(e)}function V(e,t){if(!t)return!1;let n=(e=y(e)).indexOf(t);for(;-1!==n;){const o=n+t.length;if(!(n&&/[\p{L}\p{N}_]/u.test(e[n-1])&&/[\p{L}\p{N}_]/u.test(t[0])||o!==e.length&&/[\p{L}\p{N}_]/u.test(e[o])&&/[\p{L}\p{N}_]/u.test(t.at(-1))))return!0;n=e.indexOf(t,n+1)}return!1}function T(e=[],t,n,o,r){return e.flatMap(e=>{const i=T(e.children,t,n,o,r);let a;return a="media"===o.type?e.media?.includes(t):"attribute"===o.type?e.attributes.some(([e,n])=>e===o.name&&V("string"==typeof n?n:JSON.stringify(n),t)):("markup"!==o.type||e.tag===(r?o.oldTag:o.newTag))&&L(n(e),t),"text"===o.type&&i.length?i:[...a?[e]:[],...i]})}function j(e,t,n){if(e.unresolved)return 0;if(e.matches=[],e.spacing){const n=t.filter(e=>"spacing"===e.type),o=n.length&&P(e);return e.matches=n.filter(e=>o?.before===e.before&&o?.after===e.after),e.matches.length?2:0}let o=0;for(const r of t){if("spacing"===r.type)continue;let t=0;if("attributes"===e.kind){if(!["text","attribute"].includes(r.type))continue;const n=r,o=new Map(e.before.attributes),i=new Map(e.after.attributes);for(const e of new Set([...o.keys(),...i.keys()])){if("attribute"===r.type&&e!==r.name)continue;const a=o.get(e),s=i.get(e);if(JSON.stringify(a)===JSON.stringify(s))continue;const l="string"==typeof a?a:JSON.stringify(a)||"",c="string"==typeof s?s:JSON.stringify(s)||"";L(l,n.before)&&L(c,n.after)&&(t="attribute"===r.type||r.before&&r.after?2:1)}}else"insert"===e.kind?!r.before&&e.added.some(e=>V(n(e),r.after))&&(t=Math.max(t,1)):"delete"===e.kind?!r.after&&e.removed.some(e=>V(n(e),r.before))&&(t=Math.max(t,1)):"media"===r.type?(e.before?.media||[]).some((t,n)=>t===r.before&&e.after?.media?.[n]===r.after)&&(t=2):"attribute"!==r.type&&("markup"!==r.type||e.before?.tag===r.oldTag&&e.after?.tag===r.newTag)&&L(n(e.before),r.before)&&L(n(e.after),r.after)&&(t=r.before&&r.after?2:1,"text"===r.type&&V(e.before?.text||"",r.before)&&V(e.after?.text||"",r.after)&&(e.directInput=!0));t&&e.matches.push(r),o=Math.max(o,t)}return o}function O(e,t){return!!e?.children.some(e=>e===t||e.node&&e.node===t?.node||O(e,t))}const H=new Set(["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","PageDown","PageUp","Home","End"," "]);function R(e,t){let n;for(const o of e?.rects??[]){const e=t(o);if(e.visible)return e;(!n||e.distance<n.distance)&&(n=e)}return n}function A(e){return new Promise(t=>{const n=()=>{e.clearTimeout(o),e.cancelAnimationFrame(r),t()},o=e.setTimeout(n,100);let r=e.requestAnimationFrame(()=>{r=e.requestAnimationFrame(n)})})}function F(e,t=!1){if(!W(e,{visibilityProperty:!0,opacityProperty:!0}))return;const{left:n,right:o,top:r,bottom:i,width:a,height:s}=e.getBoundingClientRect();if(!(t||a&&s))return;const l=e.ownerDocument,{documentElement:c,body:d,defaultView:u}=l,f={left:n,right:a?o:n+1,top:r,bottom:s?i:r+1},p={...f},m={x:f.right-f.left,y:f.bottom-f.top},h="visible"===u.getComputedStyle(c).overflow,g=u.getComputedStyle(e);for(let n=e;n&&n!==c;){const o=n===e?g:u.getComputedStyle(n),{position:r,display:i,overflowX:a,overflowY:s}=o;if(n!==e&&(n!==d||!h)&&"inline"!==i&&("visible"!==a||"visible"!==s)&&n.offsetWidth&&n.offsetHeight){const{bounds:e,scaleX:r,scaleY:i}=q(n,o);for(const[l,c,d,u,h]of[["x",a,"left","right",r],["y",s,"top","bottom",i]]){if("visible"===c)continue;const r="clip"===c?[0,0]:B(n,o,l,h),i=t&&"hidden"===c,a="y"===l==("horizontal-tb"===o.writingMode);if(i&&r.some(e=>e)&&(a||f[d]<e[d]||f[u]>e[u]||N(o,g,l)))return{boundary:n};if(!D(f,p,e,d,u,i?[0,0]:r))return{boundary:n};m[l]=Math.min(m[l],p[u]-p[d])}}n="absolute"===r||"fixed"===r?n.offsetParent:n.parentElement}return{clipped:f,extent:m}}function N(e,t,n){const o=e=>e&&"auto"!==e&&0!==parseFloat(e);return("x"===n?["Left","Right"]:["Top","Bottom"]).some(n=>o(e[`scrollPadding${n}`])||o(t[`scrollMargin${n}`]))}function $(e,t,n=!1){const o=F(e,n);if(!o?.clipped)return;const{clipped:r,extent:i}=o,{ownerDocument:a}=e,s=a.documentElement;if(r.left=Math.max(s.clientLeft,r.left),r.right=Math.min(s.clientLeft+s.clientWidth,r.right),r.top=Math.max(0,r.top),r.bottom=Math.min(s.clientHeight,r.bottom),r.right<=r.left)return{rects:[]};const l=t?.({...r,top:0,bottom:s.clientHeight}),c=l?.visibleCenterX??(r.left+r.right)/2,d=X(e,c);if(r.bottom<=r.top)return{rects:[],header:d?.bottom};const u={rects:[r],inViewport:!0,extent:i};if(!d)return u;const f={left:Math.max(r.left,d.left),right:Math.min(r.right,d.right),top:Math.max(r.top,d.top),bottom:Math.min(r.bottom,d.bottom)};if(!_(f)||!d.node.contains(a.elementFromPoint(c,(f.top+f.bottom)/2)))return u;const p=[{...r,top:f.bottom},{...r,bottom:f.top},{...f,left:r.left,right:f.left},{...f,left:f.right,right:r.right}].filter(_);return!p.length&&d.bottom>=s.clientHeight&&d.top<=0?void 0:{rects:p,inViewport:!0,extent:i,header:d.bottom}}function _({left:e,right:t,top:n,bottom:o}){return t>e&&o>n}function D(e,t,n,o,r,[i,a]){return e[o]=Math.max(e[o],n[o]),e[r]=Math.min(e[r],n[r]),t[o]=Math.max(n[o],t[o]+i),t[r]=Math.min(n[r],t[r]+a),t[r]>t[o]}function B(e,t,n,o){const r="x"===n,i=r?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight;if(i<=0)return[0,0];const a=r?e.scrollLeft:e.scrollTop,s=t.display.endsWith("flex")&&t.flexDirection===(r?"row-reverse":"column-reverse"),l=(r&&"rtl"===t.direction)!==s;let c=l?-i:0,d=l?0:i;return("horizontal-tb"!==t.writingMode||a<c||a>d)&&(c=-i,d=i),[(a-d)*o,(a-c)*o]}function q(e,t){const n=e.getBoundingClientRect(),o=n.width/e.offsetWidth,r=n.height/e.offsetHeight,i=n.left+e.clientLeft*o,a=n.top+e.clientTop*r,s={left:i,top:a,right:i+e.clientWidth*o,bottom:a+e.clientHeight*r},l=t.overflowClipMargin;if("clip"!==t.overflowX&&"clip"!==t.overflowY||!l||"0px"===l)return{bounds:s,scaleX:o,scaleY:r};const c=l.split(" ").map(parseFloat).find(Number.isFinite)??0,d=l.includes("border-box")?n:s,u=l.includes("content-box");return{scaleX:o,scaleY:r,bounds:{left:d.left+((u?parseFloat(t.paddingLeft):0)-c)*o,right:d.right-((u?parseFloat(t.paddingRight):0)-c)*o,top:d.top+((u?parseFloat(t.paddingTop):0)-c)*r,bottom:d.bottom-((u?parseFloat(t.paddingBottom):0)-c)*r}}}function W(e,t={visibilityProperty:!0}){return!!e?.isConnected&&!!e.getClientRects().length&&(!e.checkVisibility||e.checkVisibility(t))&&"visible"===e.ownerDocument.defaultView.getComputedStyle(e).visibility}function I(e){return e.matchMedia("(prefers-reduced-motion: reduce)").matches?"instant":"smooth"}function z(e,{behavior:t,header:n=G(e),nearest:o=!1}={}){const r=e.ownerDocument,i=r.defaultView,a=t??I(i);if(o&&!n)return void e.scrollIntoView({behavior:a,block:"nearest",inline:"nearest"});const s=i.getComputedStyle(e).scrollMarginTop,l=r.documentElement,c=l.clientHeight,d=i.getComputedStyle(l),u=J(d.scrollPaddingTop,c),f=J(d.scrollPaddingBottom,c);let p,m;try{let t=o?"nearest":"start";if(o){const e=n-parseFloat(s);null!==u&&e>u&&(p=l.getAttribute("style"),l.style.setProperty("scroll-padding-top",`${e}px`,"important"))}else{const t=n>0&&null!==u?`max(${s}, ${n-u}px)`:s;m=e.getAttribute("style"),e.style.setProperty("scroll-margin-top",`calc(${t} + 1lh)`,"important")}if(!o&&null!==u&&null!==f){const n=i.getComputedStyle(e),o=c-u-f-parseFloat(n.scrollMarginTop)-parseFloat(n.scrollMarginBottom),r=o-e.getBoundingClientRect().height;if(r>=0&&(t="center"),r>0&&"horizontal-tb"===d.writingMode){const e=Math.min(o/3,r);p=l.getAttribute("style"),l.style.setProperty("scroll-padding-bottom",`${f+e}px`,"important")}}e.scrollIntoView({behavior:a,block:t,inline:"nearest"})}finally{void 0!==p&&Z(l,p),void 0!==m&&Z(e,m)}}function Z(e,t){e.setAttribute("style",t??""),null===t&&e.removeAttribute("style")}function J(e,t){if("auto"===e)return 0;const n=parseFloat(e);return Number.isFinite(n)?n*(e.endsWith("%")?t/100:1):null}function G(e){const t=e.getBoundingClientRect();return X(e,t.left+t.width/2)?.bottom??0}function X(e,t){const n=e.ownerDocument;for(let o=n.elementFromPoint(t,1);o&&!o.contains(e);o=o.parentElement){const e=n.defaultView.getComputedStyle(o);if("fixed"!==e.position&&"sticky"!==e.position)continue;if("0"===e.opacity||!W(o,{visibilityProperty:!0,opacityProperty:!0}))continue;const{left:t,right:r,top:i,bottom:a}=o.getBoundingClientRect();if("fixed"===e.position||i<=parseFloat(e.top)+1)return{node:o,left:t,right:r,top:i,bottom:a}}}function Y(e,t,{inlineLauncher:n,nativeLauncher:o}={}){const r=e.strings,i=e.termId??e.postId,a=window,s=function(){let e,t=0,n=0;return{remember(e){try{e&&(t=e.defaultView.scrollY)}catch{}},async restore(e,o,r=()=>!0,i){const a=++n;try{const s=e.defaultView;let l;if(s.scrollTo({top:t,left:0,behavior:"instant"}),o?.ownerDocument===e&&r()){if(await A(s),a!==n||o.ownerDocument!==e||!r())return;if(function(e,t){const n=e.ownerDocument;for(let t=e;t;t=t.parentElement)if("until-found"!==t.getAttribute("hidden")?.toLowerCase()&&(t.hasAttribute("hidden")||"none"===n.defaultView.getComputedStyle(t).display))return!1;let o=!1;for(let r=e;r&&e.isConnected&&e.ownerDocument===n&&t();r=r.parentElement){if("until-found"===r.getAttribute("hidden")?.toLowerCase()){if(r.dispatchEvent(new n.defaultView.Event("beforematch",{bubbles:!0})),!(e.isConnected&&e.ownerDocument===n&&r.isConnected&&r.ownerDocument===n&&r.contains(e)&&t()))break;"until-found"===r.getAttribute("hidden")?.toLowerCase()&&r.removeAttribute("hidden"),o=!0}const i=r.parentElement;i instanceof n.defaultView.HTMLDetailsElement&&!i.open&&r!==Array.from(i.children).find(e=>"summary"===e.localName)&&(i.open=!0,o=!0)}return o}(o,()=>a===n&&r())&&await new Promise(e=>s.setTimeout(e,0)),a!==n||!r())return;const t=o.ownerDocument===e?function(e){if(!e?.isConnected)return null;const t=F(e,!0);if(t?.clipped)return e;if(!t?.boundary)for(const t of e.querySelectorAll("*"))if(F(t,!0)?.clipped)return t;for(let n=t?.boundary||e.parentElement;n;){const e=F(n,!0);if(e?.clipped)return n;n=e?.boundary||n.parentElement}return null}(o):null;t&&(function(e,t){const n=$(e,t,!0);if(!n?.inViewport)return void z(e);const{rects:o,extent:r,header:i=0}=n,a=e.ownerDocument.documentElement,s=Math.min(r.x,a.clientWidth),l=Math.min(r.y,a.clientHeight-i);o.some(e=>e.right-e.left>=s-1&&e.bottom-e.top>=l-1)?t&&R(n,t)?.reveal(I(e.ownerDocument.defaultView)):z(e,{nearest:!0,header:i})}(t,i),o.contains(t)&&(l=t))}return t=s.scrollY,l}catch{}},keepInView(t,{canvas:n,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:a,canFollow:s}){try{const l=e?.target===t&&e.canFollow();if(e?.cancel(),!t.isConnected||!s())return;if(!l){const e=$(t,o);if(!R(e,o)?.visible)return}const c=new AbortController,d={target:t,canFollow:()=>!c.signal.aborted&&s(),cancel(){c.abort(),e===d&&(e=null)}};return e=d,function(e,t,n,o,r){const i=e=>{e.isTrusted&&("keydown"!==e.type||H.has(e.key))&&r()},a={capture:!0,passive:!0,signal:o};for(const n of[e,t])for(const e of["wheel","touchmove","pointerdown","keydown"])n?.addEventListener(e,i,a);t?.addEventListener("scroll",()=>{n?.()&&r()},a)}(t.ownerDocument.defaultView,n,a,c.signal,()=>{d.cancel(),i?.()}),async function(e,t,n,o){try{const r=e.ownerDocument.defaultView;if(await A(r),!o())return;const{scrollX:i,scrollY:a}=r,s=n();if(s&&await s,!o()||r.scrollX!==i||r.scrollY!==a)return;let l=$(e,t);l&&!l.rects.length&&(z(e,{behavior:"instant",header:l.header}),l=$(e,t)),R(l,t)?.reveal()}catch{}}(t,o,r,d.canFollow).finally(d.cancel)}catch{}}}}(),l=d(r,{postTitle:t.title??e.postTitle,publicRedirect:e.publicRedirect,inlineLauncher:n,nativeLauncher:o,onOpen:()=>N(),onClose:()=>O(),onRefresh:_,onRetry:e=>e?N(!0):_(),beforeViewportChange:e=>h.beforeViewportChange(e),beforeMove:j,afterMove:()=>{p&&_()}});let c,f,p=!1,m=0;const h=function(e,t,n,o,r=[]){const i=u(r);let a,s,l,c,d;function f(){d?.()}return{get hasPreview(){return!!a},get hasHtmlPreview(){return!!s},get redirectDestination(){return c},load:function(r,u,p=()=>!1,m){const h=new URL(r);if("https:"!==h.protocol&&"http:"!==h.protocol)throw Object.assign(new Error(n.failed),{code:"mtflpp_preview_unsupported_url"});if(h.origin!==window.location.origin){const e=n.originMismatch.replace("%s",()=>h.origin+h.pathname);throw Object.assign(new Error(e),{code:"mtflpp_preview_origin_mismatch"})}const g=h.searchParams.get("mtflpp_token");if(!g)throw new Error(n.failed);return window.crossOriginIsolated&&h.searchParams.set("mtflpp_isolated","1"),f(),h.searchParams.delete("mtflpp_source"),e.followChanges&&h.searchParams.set("mtflpp_source","1"),o(n.updating),new Promise((r,f)=>{const w=e.stage.ownerDocument.createElement("iframe");w.title=n.title,w.className="mtflpp-frame mtflpp-loading",w.setAttribute("aria-hidden","true"),w.setAttribute("tabindex","-1"),w.referrerPolicy="same-origin";let v=!1,y=!1;const b=setTimeout(()=>M(new Error(n.failed)),3e4),x=()=>{y=!0,M()};function M(e){v||(v=!0,e&&(y=!0),clearTimeout(b),d===x&&(d=null),w!==a&&(w.onload=null,w.onerror=null,w.remove()),e?f(e):r())}d=x,w.onload=async()=>{const r=w!==a;if(r||(s=null,l=null),y||!u())return void M();let d,f,v;try{const e=w.contentDocument,t=e?.querySelector('meta[name="meet-the-frontend-live-preview-panel"]');t?.content===g?d=e:r&&!t&&(f=function(e,t){if("text/html"!==e?.contentType)return;const n=e.defaultView?.performance.getEntriesByType("navigation")[0];if(!(n?.redirectCount>0))return;const o=new URL(n.name);return o.origin!==t.origin||o.pathname===t.pathname&&o.search===t.search?void 0:o.pathname}(e,h))}catch{}d&&(e.followChanges&&i.capture(d,r?m:void 0),d.documentElement.style.setProperty("overscroll-behavior","contain","important")),d&&r&&(t.remember(s),e.followChanges&&p()&&s&&(v=i.findChange(s,d))),r&&a&&(a.onload=null,a.onerror=null,a.remove()),a=w,s=d,l=null,c=f,w.classList.remove("mtflpp-loading"),w.removeAttribute("aria-hidden"),w.removeAttribute("tabindex");const b=()=>!y&&u()&&w===a&&d===s&&(!d||w.contentDocument===d);let x;if(d&&r){const n=e.canvasTarget&&(t=>e.canvasTarget(w,t,{fitTarget:!0}));x=await t.restore(d,v,()=>b()&&e.followChanges&&p(),n)}b()?(l=x,o(n.current,"ready"),M()):M()},w.onerror=()=>{w===a?(s=null,l=null,c=void 0,u()&&o(n.failed,"error")):M(new Error(n.failed))},w.src=h.href,e.stage.append(w)})},cancel:f,beforeViewportChange({canvasTarget:n,canFollow:o,...r}){const i=l,c=s,d=a;if(i&&c)return t.keepInView(i,{...r,canvasTarget:e=>n(d,e),canFollow:()=>i===l&&c===s&&d.contentDocument===c&&e.visible&&e.followChanges&&o()})},clear(){f(),t.remember(s),a&&(a.onload=null,a.onerror=null),a=null,s=null,l=null,c=void 0,e.clearPreview()}}}(l,s,r,k,e.comparisonExcludedSelectors);let g,w,v,y,b,x,M,E,P=!1;try{a.BroadcastChannel&&(E=new a.BroadcastChannel(`meet-the-frontend-live-preview-panel:${e.endpoint}:${i}:${e.userId}`),E.onmessage=e=>{"takeover"===e.data?.type&&p&&(O(!0),k(r.handedOff,"conflict",{reason:"handed-off"}))},a.addEventListener("pagehide",e=>{e.persisted||E.close()}))}catch{E?.close(),E=null}function k(e,n="loading",{canRetry:o=!0,reason:r=""}={}){"ready"===n&&(P=!1),l.report(e,n,{canTakeOver:!!E,hasPreview:h.hasPreview,canRetry:o,reason:r,hasHtmlPreview:h.hasHtmlPreview,redirectDestination:h.redirectDestination,canRefresh:p&&!t.saving&&["ready","error"].includes(n)&&("error"!==n||o)})}function C(e){const t=e?.code,n=function(e){const t=e?.code;return"mtflpp_post_locked"===t?"post-locked":["mtflpp_invalid_nonce","rest_cookie_invalid_nonce","mtflpp_preview_conflict","mtflpp_source_changed","mtflpp_acf_unavailable","mtflpp_integration_failed"].includes(t)?"reload":["mtflpp_cannot_preview","rest_forbidden","rest_cannot_edit"].includes(t)?"permission":"mtflpp_preview_origin_mismatch"===t?"origin-mismatch":"mtflpp_preview_unsupported_url"===t?"unsupported-url":""}(e);n&&(p=!1,S(),h.cancel(),b?.()),k("string"==typeof t?e.message:r.failed,"post-locked"===n?"paused":"error",{reason:n,canRetry:!n})}function S(){clearTimeout(c),f=void 0}function L(e){if(void 0===e&&void 0===f)return;const t=performance.now();void 0!==e&&(f=t+e),clearTimeout(c);const n=Math.ceil(f-t);n>0?c=setTimeout(T,n):T()}function V(){p&&(m+=1,P=!0,h.cancel(),t.saving||k(r.stale,"stale"),t.saving||t.previewing?S():L(275))}function T(){if(!p||g||!1===t.ready||t.previewing||t.saving)return;S();const n=m;k(r.updating),g=(async()=>{try{if(await t.idle,!p||!1===t.ready||t.saving)return;const o=e.base;let i,a;v=t.preparePreview();try{i=await v}catch(e){a=e}finally{v=null}if(await t.idle,!p||!1===t.ready||t.saving||o!==e.base)return;if(a)throw a;if("string"!=typeof i.url)throw Object.assign(new Error(i.message||r.failed),{code:i.code});p&&n===m&&await function(e,t,n){return h.load(e,()=>p&&t===m,()=>l.followChanges&&P,n)}(i.url,n,i.comparisonValues)}catch(e){p&&!t.saving&&C(e)}finally{g=null,L()}})()}function j(){m+=1,h.clear()}function O(e=!1){l.setVisible(e),p=!1,S(),j(),clearTimeout(M),M=null,x?.abort(),l.returnToEditor(),b?.()}async function N(n=!1){if(l.setVisible(!0),p)return;if(w)return void C(w);if(y){if(x&&!x.signal.aborted)return;const e=m;try{await y}catch{}return void(l.visible&&e===m&&N(n))}if(!1===t.ready)return void k(t.notReady,t.notReadyState??"paused",{canRetry:!1});if(!e.available)return void k(r.unavailable,"error",{canRetry:!1,reason:"unavailable"});if(!a.isSecureContext||!navigator.locks)return void k(r.browser,"error",{canRetry:!1,reason:"browser"});const o=n&&E?new AbortController:null;let s=!1;x=o,o?(k(r.waiting,"handover"),M=setTimeout(()=>{s=!0,o.abort()},15e3)):k(t.saving?r.saving:r.updating);try{const n=o?{signal:o.signal}:{ifAvailable:!0};if(y=navigator.locks.request(`meet-the-frontend-live-preview-panel:${e.endpoint}:${i}`,n,async e=>{if(clearTimeout(M),M=null,x=null,l.visible&&!o?.signal.aborted)if(e){k(t.saving?r.saving:r.updating);try{await new Promise(e=>{b=e,p=!0,m+=1,T()}),await g}finally{b=null}}else k(E?r.conflict:r.closeOther,"conflict",{reason:E?"other-tab":"manual"})}),o)try{E.postMessage({type:"takeover"})}catch(e){throw o.abort(),p&&O(!0),await y.catch(()=>{}),e}await y,l.visible&&s&&k(r.takeoverTimeout,"conflict",{reason:"busy"})}catch(e){p=!1,l.visible&&s?k(r.takeoverTimeout,"conflict",{reason:"busy"}):l.visible&&"AbortError"!==e.name&&C(e)}finally{clearTimeout(M),M=null,x=null,y=null}}function _(e=!0){t.saving||(e||(P=!1),p?(m+=1,h.cancel(),L(0)):N())}return{changed:V,pause:function(e=r.saving,t="loading"){return m+=1,S(),h.cancel(),(p||l.visible&&"paused"===t)&&k(e,t,{canRetry:!1}),v},resume:function(e){w=e,e?l.visible&&C(e):!l.visible||p||y?V():N()},setTitle:l.setTitle,openFromLauncher:l.openFromLauncher,start:()=>{l.visible&&N()},get pending(){return g}}}function U(e,t,n,o){const r=window.acf;r.addAction("wysiwyg_tinymce_init",n);for(const e of["append","remove","sortstop","change_field"])r.addAction(e,t);const i=t=>{t[0]===e&&o?.()};function a(e){return!!e?.closest?.(".acf-field")}return r.addAction("validation_failure",i),window.jQuery(e).on("input.mtflppAcf change.mtflppAcf sortupdate.mtflppAcf",e=>{e.originalEvent&&"sortupdate"!==e.type||!a(e.target)||t()}),{isField:a,isValidating:()=>!!e.classList?.contains("is-validating"),hasStructuralPaginationChanges:()=>!!e.querySelector('.acf-repeater[data-pagination="1"] .acf-row:is(.acf-added, .acf-inserted, .acf-reordered, .acf-deleted)'),accepts:e=>"_acf_nonce"===e||e.startsWith("acf[")||e.startsWith("_acf_fields["),destroy(){r.removeAction("wysiwyg_tinymce_init",n);for(const e of["append","remove","sortstop","change_field"])r.removeAction(e,t);r.removeAction("validation_failure",i),window.jQuery(e).off(".mtflppAcf")}}}function Q(){const e=(0,t.select)("core/edit-post")?.getActiveMetaBoxLocations?.()??["normal","side","advanced"];return[document.querySelector(".metabox-base-form"),...e.map(e=>document.querySelector(`.edit-post-meta-boxes-area.is-${e} .metabox-location-${e}`)||document.querySelector(`#metaboxes .metabox-location-${e}`))].filter(Boolean)}const K="meet-the-frontend-live-preview-panel/acf";function ee(e){if(!e.acfEnabled)return!1;if("function"!=typeof window.acf?.addAction||"function"!=typeof window.acf?.removeAction||"function"!=typeof window.jQuery)throw Object.assign(new Error(e.strings.acfUnavailable),{code:"mtflpp_integration_failed"});return!0}(0,e.addAction)("mtflpp.blockEditor.previewSetup",K,({config:e,changed:n,hooks:o,onDestroy:r})=>{if(!ee(e))return;const i=function(e){const n=new Set;let o=!1,r=[],i=new Map;const a=()=>{o||e()};function s(e){e&&!n.has(e)&&(n.add(e),e.on("input change undo redo SetContent",a))}const l=U(document,a,s);function c(e){s(e.editor)}function d(e){l.isField(e.target)&&Q().some(t=>t.contains(e.target))&&a()}window.tinymce?.editors.forEach(s),window.tinymce?.on("AddEditor",c),document.addEventListener("input",d),document.addEventListener("change",d,!0);const u=new MutationObserver(a);return{get ready(){return r=r.filter(({field:e,rows:t})=>e.isConnected&&t.some(t=>e.contains(t))),r.length||u.disconnect(),!r.length},saved(){u.disconnect(),r=Q().flatMap(e=>[...e.querySelectorAll('.acf-repeater[data-pagination="1"]')].map(e=>({field:e,rows:[...e.querySelectorAll(":scope > table > tbody > tr.acf-row:not(.acf-clone)")]})).filter(({rows:e})=>e.length));for(const{field:e}of r)u.observe(e,{childList:!0,subtree:!0});a()},observe(){const e=(0,t.select)("acf/fields");if(!e?.getFieldValue)return;const n=new Map;for(const t of Q())for(const o of window.acf.getFields({parent:window.jQuery(t)})){const t=o.get("key");n.set(t,e.getFieldValue(t))}(n.size!==i.size||[...n].some(([e,t])=>i.get(e)!==t))&&(i=n,a())},capture(){o=!0;const e=new URLSearchParams;try{window.tinymce?.triggerSave();for(const t of Q())for(const[n,o]of new FormData(t))"string"==typeof o&&l.accepts(n)&&e.append(n,o)}finally{o=!1}return e},destroy(){u.disconnect(),l.destroy(),document.removeEventListener("input",d),document.removeEventListener("change",d,!0),window.tinymce?.off("AddEditor",c);for(const e of n)e.off("input change undo redo SetContent",a)}}}(n);r(()=>i.destroy()),o.addAction("observePreviewInputs",K,()=>i.observe()),o.addAction("nativeMetaboxSaveAcknowledged",K,()=>i.saved()),o.addFilter("previewPauseReason",K,t=>t||(i.ready?"":e.strings.acfRefreshing)),o.addFilter("previewFormBody",K,e=>{e??=new URLSearchParams;for(const[t,n]of i.capture())e.append(t,n);return e})}),(0,e.addAction)("mtflpp.classicEditor.previewSetup",K,({config:e,form:t,changed:n,watchEditor:o,cancelNativeSave:r,hooks:i,onDestroy:a})=>{if(!ee(e))return;const s=U(t,n,o,r);a(()=>s.destroy());const l=e=>{s.isField(e.target)&&n()};t.addEventListener("input",l),t.addEventListener("change",l,!0),a(()=>{t.removeEventListener("input",l),t.removeEventListener("change",l,!0)}),i.addFilter("nativeSaveValidationPending",K,e=>e||s.isValidating()),i.addFilter("previewFormBody",K,(e,t)=>{for(const[n,o]of t)"string"==typeof o&&s.accepts(n)&&e.append(n,o);return e}),i.addFilter("nativePreviewHandoffError",K,(t,n)=>t||(n&&s.hasStructuralPaginationChanges()?Object.assign(new Error(e.strings.nativePreviewAcf),{code:"mtflpp_source_changed"}):void 0))});const te=window.meetTheFrontendLivePreviewPanel,ne=document.getElementById("post");if(te&&ne){const t=function(e,t){const n={idle:Promise.resolve(),saving:!1,previewing:!1,deferredSaves:new WeakSet};let o,r,i=!1;function a(){const o=Array.from(window.crypto.getRandomValues(new Uint8Array(16)),e=>e.toString(16).padStart(2,"0")).join(""),i=e.base,a=`mtflpp_preview_${o}`,s=Object.entries({mtflpp_base:i,mtflpp_preview:o}).map(([e,n])=>{const o=document.createElement("input");return Object.assign(o,{type:"hidden",name:e,value:n}),t.append(o),o});let l,c,d=!1;const u=new Promise(e=>{c=e}),f=Date.now()+3e4,p=t=>{d=!0,clearTimeout(l),r=null,n.previewing=!1;for(const e of s)e.remove();document.cookie=`${a}=; Max-Age=0; Path=${e.adminCookiePath}; SameSite=Strict`,c(),n.onPreview?.(t,e.base!==i)},m=()=>{if(d)return;clearTimeout(l);const t=document.cookie.split(";").map(e=>e.trim()).find(e=>e.startsWith(`${a}=`)),n=t?.slice(a.length+1);n?.startsWith(`${i}.`)&&/^[a-f0-9]{64}$/.test(n.slice(65))?(e.base=n.slice(65),p()):t||Date.now()>=f?p(Object.assign(new Error(e.strings.nativePreviewFailed),{code:"mtflpp_source_changed"})):l=setTimeout(m,100)};r={done:u,check:m},n.idle=Promise.all([n.idle,u]),l=setTimeout(m,100)}const s=e=>{const t=e.target.closest("#post-preview");if(!t||t.classList.contains("disabled")||i||!window.crypto?.getRandomValues)return;if(n.previewing)return e.preventDefault(),void e.stopImmediatePropagation();n.previewing=!0;const o=n.beforePreview?.();if(!o)return void a();e.preventDefault(),e.stopImmediatePropagation(),window.open("",t.target||"wp-preview");const r=()=>{a(),i=!0;try{t.click()}finally{i=!1}};o.then(r,r)};t.addEventListener("click",s,!0),window.jQuery(document).on("heartbeat-send.mtflpp",(t,n)=>{r?.check(),n.mtflpp_base=e.base}).on("before-autosave.mtflpp",()=>{const e=new Promise(e=>{o=e});n.idle=Promise.all([e,r?.done]),n.onAutosave?.()}).on("heartbeat-tick.mtflpp heartbeat-error.mtflpp",(t,n)=>{"string"==typeof n?.mtflpp_base&&/^[a-f0-9]{64}$/.test(n.mtflpp_base)&&(e.base=n.mtflpp_base),"string"==typeof n?.rest_nonce&&(e.nonce=n.rest_nonce),o?.(),o=null}),window.jQuery(t).on("input.mtflpp change.mtflpp",e=>{!e.originalEvent&&["post_title","content","excerpt"].includes(e.target.name)&&n.onFieldChange?.(e)});const l=()=>{n.onSaveCancelled?n.onSaveCancelled():n.saving=!1};t.addEventListener("invalid",l,!0);let c=0,d=!1;function u(e){if("click"===e.type){const t=e.target.closest("#publish, #save-post");if(!t||t.disabled||t.classList.contains("disabled"))return}else if("dopreview"===t.querySelector("#wp-preview")?.value)return;const o=++c;setTimeout(()=>{const t=e.defaultPrevented||e.isDefaultPrevented?.();d||o!==c||!t||n.deferredSaves.has(e)||n.isValidating?.()||l()},0)}return t.addEventListener("click",u,!0),t.addEventListener("submit",u,!0),window.jQuery(t).on("submit.mtflpp",e=>{e.originalEvent||u(e)}),n.destroy=()=>{d=!0,n.beforePreview=null,n.onPreview=null,n.onAutosave=null,n.onFieldChange=null,n.onSaveCancelled=null,n.isValidating=null,t.removeEventListener("click",s,!0),t.removeEventListener("invalid",l,!0),t.removeEventListener("click",u,!0),t.removeEventListener("submit",u,!0),window.jQuery(document).off(".mtflpp"),window.jQuery(t).off(".mtflpp")},n}(te,ne);try{!function(t,n,o){const r=document.getElementById("post");if(!t||!r)return;let i,a=!1;const s=new Set;let l=!1;n.title=document.getElementById("title")?.value??t.postTitle,n.preparePreview=async()=>{let e;a=!0;try{window.tinymce?.triggerSave(),e=new FormData(r)}finally{a=!1}const n=new URLSearchParams;for(const[t,o]of e)"string"==typeof o&&["post_title","content","excerpt"].includes(t)&&n.append(t,o);const o=Object.fromEntries([...n].map(([e,t])=>[e,{type:"post_title"===e?"text":"html",value:t}])),s=i.capture(n,e),l=i.comparisonValues(s,o);s.set("base",t.base);const c=await fetch(t.endpoint,{method:"POST",credentials:"same-origin",headers:{"X-WP-Nonce":t.nonce},body:s}),d=await c.json();if(!c.ok)throw Object.assign(new Error(d.message||t.strings.failed),{code:d.code});return{...d,comparisonValues:l}};const c=Y(t,n,{inlineLauncher:o}),d=()=>{if(a||l)return;const e=i?.filter("previewPauseReason","")||i?.error?.message,t=!1===n.ready&&!e;n.ready=!e,n.notReady=e,n.notReadyState="paused",i?.error?c.resume(i.error):e?c.pause(e,"paused"):t?c.resume():c.changed()};function u(e){l||!e||s.has(e)||(s.add(e),e.on("input change undo redo SetContent",d))}function f(e){u(e.editor)}function p(e,t){u(t)}function m(){n.saving&&(n.saving=!1,d())}n.onAutosave=d,n.beforePreview=()=>(c.pause(t.strings.nativePreview),c.pending),n.onPreview=(e,t)=>{e=i.filter("nativePreviewHandoffError",e,t),c.resume(i.error||e)},window.tinymce&&(window.tinymce.editors.forEach(u),window.tinymce.on("AddEditor",f)),window.jQuery?.(document).on("tinymce-editor-init.mtflppClassicEditor",p),n.onSaveCancelled=m,i=function(t,n){const o=(0,e.createHooks)(),r=[];let i,a=!1;function s(e){i??="mtflpp_integration_failed"===e?.code?e:Object.assign(new Error(n.config.strings.integrationFailed),{code:"mtflpp_integration_failed",cause:e})}const l={get error(){return i},filter(e,t,...n){if(a||i)return t;try{const r=o.applyFilters(e,t,...n);if("additionalPreviewValues"===e&&("[object Object]"!==Object.prototype.toString.call(r)||Object.values(r).some(e=>!(null===e||["string","boolean"].includes(typeof e)||"number"==typeof e&&Number.isFinite(e)))))throw new TypeError("Preview values must be a plain object of scalar values.");return r}catch(e){return s(e),t}},action(e,...t){if(!a&&!i)try{o.doAction(e,...t)}catch(e){s(e)}},capture(e,t=null){a&&!i&&s(new Error("This editor session has ended."));const n=null===e?null:new URLSearchParams(e),o=l.filter("previewFormBody",e,t);if(null===o||o instanceof URLSearchParams||s(new TypeError("Preview capture must return URLSearchParams or null.")),i||null===n||null!==o&&![...n.keys()].some(e=>{const t=n.getAll(e),r=o.getAll(e);return r.length!==t.length||t.some((e,t)=>r[t]!==e)})||s(new TypeError("Preview capture must preserve the classic form body.")),i)throw i;return o},comparisonValues(e,t){const o=new Map(Object.entries(t));try{const t=n.form||document,r=new Set;for(const n of t.querySelectorAll("input[name], textarea[name], select[name]")){if(o.has(n.name)||!e?.has(n.name)||"password"===n.type)continue;if("hidden"===n.type){r.add(n.name);continue}const t="textarea"===n.localName||["text","search","email","url","tel"].includes(n.type),i=e.getAll(n.name);let a="value";t&&1===i.length&&(a=n.classList.contains("wp-editor-area")?"html":"text"),o.set(n.name,{type:a,value:1===i.length?i[0]:JSON.stringify(i)})}for(const t of r){if(o.has(t))continue;const n=e.getAll(t);n.length>1&&o.set(t,{type:"order",value:JSON.stringify(n),members:JSON.stringify(n.sort())})}}catch{}return Object.fromEntries(o)},destroy(){if(!a){a=!0;for(const e of r.reverse())try{e()}catch(e){s(e)}r.length=0}}};try{(0,e.doAction)("mtflpp.classicEditor.previewSetup",{...n,hooks:o,onDestroy(e){r.push(e)}})}catch(e){s(e),l.destroy()}return l}(0,{config:t,form:r,changed:d,watchEditor:u,cancelNativeSave:m});const h=n.destroy;function g(e){e.persisted||n.destroy()}function w(e){"post_title"===e.target.name&&c.setTitle(e.target.value),["post_title","content","excerpt"].includes(e.target.name)&&d()}n.destroy=()=>{if(!l){l=!0,i.destroy(),r.removeEventListener("input",w),r.removeEventListener("change",w,!0),r.removeEventListener("click",b,!0),r.removeEventListener("submit",x,!0),window.removeEventListener("pagehide",g),window.tinymce?.off("AddEditor",f),window.jQuery?.(document).off("tinymce-editor-init.mtflppClassicEditor",p);for(const e of s)e.off("input change undo redo SetContent",d);s.clear(),h?.()}},window.addEventListener("pagehide",g),n.isValidating=()=>i.filter("nativeSaveValidationPending",!1),n.onFieldChange=w,r.addEventListener("input",w),r.addEventListener("change",w,!0);let v=!1;function y(e,t){if(e.defaultPrevented)return;if(v)return n.deferredSaves?.add(e),e.preventDefault(),void e.stopImmediatePropagation();if(n.saving)return;n.saving=!0,c.pause();const o=c.pending||(n.previewing?n.idle:null);if(!o)return;n.deferredSaves?.add(e),e.preventDefault(),e.stopImmediatePropagation(),v=!0;const r=()=>{v=!1,!l&&n.saving&&t()};o.then(r,r)}function b(e){const t=e.target.closest("#publish, #save-post");!t||t.disabled||t.classList.contains("disabled")||y(e,()=>t.click())}function x(e){"dopreview"!==r.querySelector("#wp-preview")?.value&&y(e,()=>r.requestSubmit(e.submitter||void 0))}r.addEventListener("click",b,!0),r.addEventListener("submit",x,!0),d(),i.error||c.start()}(te,t,ne.querySelector("#mtflpp-publish-preview button"))}catch(e){t.destroy(),function(e,t){document.getElementById("mtflpp-panel")?.remove(),document.getElementById("mtflpp-toggle")?.remove(),document.getElementById("mtflpp-publish-preview")?.remove(),document.getElementById("mtflpp-term-preview")?.remove();const n=document.createElement("div");n.className="notice notice-error",n.setAttribute("role","alert");const o=document.createElement("p");o.textContent=e,n.append(o),(document.getElementById("wpbody-content")||document.body).prepend(n),console.error("Meet the Frontend – Live Preview Panel could not start.",t)}(te.strings.bootFailed,e)}}})();
     1(()=>{"use strict";const e=window.wp.hooks,t=window.wp.data,n=window.wp.preferences,o=window.wp.element,r=window.wp.components,i=window.wp.notices,a=window.wp.primitives,s=window.ReactJSXRuntime,l={refresh:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M12 5.5L17.7929 11.2929C18.1834 11.6834 18.1834 12.3166 17.7929 12.7071L16 14.5M16 5.5H12V9.5M12 18.5L6.20711 12.7071C5.81658 12.3166 5.81658 11.6834 6.20711 11.2929L8 9.5M8 18.5H12V14.5"})}),more:(0,s.jsxs)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,s.jsx)(a.Path,{d:"M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z",fill:"currentColor",stroke:"none"}),(0,s.jsx)(a.Path,{d:"M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z",fill:"currentColor",stroke:"none"}),(0,s.jsx)(a.Path,{d:"M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z",fill:"currentColor",stroke:"none"}),(0,s.jsx)(a.Path,{d:"M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z"}),(0,s.jsx)(a.Path,{d:"M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z"}),(0,s.jsx)(a.Path,{d:"M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z"})]}),expand:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M4.75 10V4.75H10M4.75 4.75L10 10M14 19.25H19.25V14M19.25 19.25L14 14"})}),compact:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M10 4.75V10H4.75M10 10L4.75 4.75M19.25 14H14V19.25M14 14L19.25 19.25"})}),pip:(0,s.jsxs)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,s.jsx)(a.Path,{d:"M4.75 9.25V16C4.75 16.6904 5.30964 17.25 6 17.25H8M4.75 9.25V6C4.75 5.30964 5.30964 4.75 6 4.75H16C16.6904 4.75 17.25 5.30964 17.25 6V8M4.75 9.25H8"}),(0,s.jsx)(a.Path,{d:"M10.75 11.25C10.75 10.9739 10.9739 10.75 11.25 10.75H18.75C19.0261 10.75 19.25 10.9739 19.25 11.25V18.75C19.25 19.0261 19.0261 19.25 18.75 19.25H11.25C10.9739 19.25 10.75 19.0261 10.75 18.75V11.25Z",fill:"currentColor"})]}),move:(0,s.jsxs)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,s.jsx)(a.Path,{d:"M9.25 5.75H8.75V6.25H9.25V5.75Z",fill:"currentColor",stroke:"none"}),(0,s.jsx)(a.Path,{d:"M9.25 11.75H8.75V12.25H9.25V11.75Z",fill:"currentColor",stroke:"none"}),(0,s.jsx)(a.Path,{d:"M9.25 17.75H8.75V18.25H9.25V17.75Z",fill:"currentColor",stroke:"none"}),(0,s.jsx)(a.Path,{d:"M15.25 5.75H14.75V6.25H15.25V5.75Z",fill:"currentColor",stroke:"none"}),(0,s.jsx)(a.Path,{d:"M15.25 11.75H14.75V12.25H15.25V11.75Z",fill:"currentColor",stroke:"none"}),(0,s.jsx)(a.Path,{d:"M15.25 17.75H14.75V18.25H15.25V17.75Z",fill:"currentColor",stroke:"none"}),(0,s.jsx)(a.Path,{d:"M9.25 5.75H8.75V6.25H9.25V5.75Z"}),(0,s.jsx)(a.Path,{d:"M9.25 11.75H8.75V12.25H9.25V11.75Z"}),(0,s.jsx)(a.Path,{d:"M9.25 17.75H8.75V18.25H9.25V17.75Z"}),(0,s.jsx)(a.Path,{d:"M15.25 5.75H14.75V6.25H15.25V5.75Z"}),(0,s.jsx)(a.Path,{d:"M15.25 11.75H14.75V12.25H15.25V11.75Z"}),(0,s.jsx)(a.Path,{d:"M15.25 17.75H14.75V18.25H15.25V17.75Z"})]}),warning:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M12 8L12 13M12 14.5L12 16M4.75 12C4.75 7.99593 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12Z",strokeLinejoin:"round"})}),info:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M12 16V11M12 9.5V8M19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12C4.75 7.99594 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12Z",strokeLinejoin:"round"})}),close:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M7.75 16.25L16.25 7.75M16.25 16.25L7.75 7.75"})}),check:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M7 12L10 15L17 8"})}),chevron:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M7 11L12 15L17 11"})}),desktop:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M4.75 16.75V17H3.25C3.11193 17 3 17.1119 3 17.25H21C21 17.1119 20.8881 17 20.75 17H19.25V16.75M4.75 16.75V8.5C4.75 7.80964 5.30964 7.25 6 7.25H18C18.6904 7.25 19.25 7.80964 19.25 8.5V16.75M4.75 16.75H19.25"})}),tablet:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M10 16.5H14M18.25 18V6C18.25 5.30964 17.6904 4.75 17 4.75H7C6.30964 4.75 5.75 5.30964 5.75 6L5.75 18C5.75 18.6904 6.30964 19.25 7 19.25H17C17.6904 19.25 18.25 18.6904 18.25 18Z"})}),mobile:(0,s.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)(a.Path,{d:"M11 16.5H13M16.25 18V6C16.25 5.30964 15.6904 4.75 15 4.75H9C8.30964 4.75 7.75 5.30964 7.75 6L7.75 18C7.75 18.6904 8.30964 19.25 9 19.25H15C15.6904 19.25 16.25 18.6904 16.25 18Z"})})};function c(e,t,n="right"){const o=e&&!Array.isArray(e)&&e.bounds&&["x","y","width","height"].every(t=>Number.isFinite(e.bounds[t]))&&e.bounds.width>0&&e.bounds.height>0&&[null,"left","center","right"].includes(e.dock)&&"boolean"==typeof e.expanded&&(void 0===e.anchor||["left","center","right"].includes(e.anchor));let r=!!o&&e.expanded;const i={width:480,height:393},a=o?{...e.bounds}:{x:0,y:0,...i};let s=o?e.dock:n,l=s||o&&e.anchor||"right";function c(){return"left"===l?0:"center"===l?.5:1}function d(e,n=t(!s),o=320,r=220){return e.width=Math.min(n.width,Math.max(Math.min(o,n.width),e.width)),e.height=Math.min(n.height,Math.max(Math.min(r,n.height),e.height)),e.x=Math.max(n.left,Math.min(n.right-e.width,e.x)),e.y=Math.max(n.top,Math.min(n.bottom-e.height,e.y)),e}function u(e){if(!s)return e;const n=t();return e.x="left"===s?n.left:"center"===s?n.left+(n.width-e.width)/2:n.right-e.width,e.y=n.bottom-e.height,e}return{area:t,compactRect:function(){return u(d({...a}))},launcherRect:function(e){return u(d({...e,x:a.x+(a.width-e.width)*c(),y:a.y+a.height-e.height},t(!s),1,1))},usableEdge:function(e){return!(s&&(e.includes("s")||"left"===s&&e.includes("w")||"right"===s&&e.includes("e")))},get anchor(){return l},get anchorFactor(){return c()},get dock(){return s},get expanded(){return r},get layout(){return{bounds:{...a},dock:s,anchor:l,expanded:r}},toggleExpanded(){r=!r},dockTo:function(e="right",t=!1){t&&Object.assign(a,i),r=!1,l=s=e},resize(e,n,o,r){Object.assign(a,function(e,n,o,r){const i=t(!s),a=n.includes("e")||n.includes("w"),c=n.includes("n")||n.includes("s"),d=function(e){return"center"===l?.5:e.includes("w")?1:0}(n),u=e.x+e.width*d,f=n.includes("n"),p=e.y+(f?e.height:0),m=function(e,t,n){return 0===n?e.right-t:1===n?t-e.left:2*Math.min(t-e.left,e.right-t)}(i,u,d),h=f?p-i.top:i.bottom-p,g=(n.includes("w")?-o:o)*(.5===d?2:1),v=Math.max(Math.min(320,m),Math.min(m,e.width+g)),w=Math.max(Math.min(220,h),Math.min(h,e.height+(f?-r:r))),y=a&&0!==o&&v!==e.width,b=c&&0!==r&&w!==e.height,x=f?p-w:p;return{x:y?u-v*d:e.preferredBounds.x,y:b?x:e.preferredBounds.y,width:y?v:e.preferredBounds.width,height:b?w:e.preferredBounds.height}}(e,n,o,r))},move:function(e,n,o,r=!1){const i=d({...e,x:e.x+n,y:e.y+o},t(!0),r?1:320,r?1:220);a.x=i.x+(r?(i.width-a.width)*c():0),a.y=i.y+(r?i.height-a.height:0),s=null}}}function d(e,{postTitle:a="",publicRedirect:s,inlineLauncher:d,nativeLauncher:u,canRememberVisibility:f=!0,onOpen:p,onClose:m,onRefresh:h,onRetry:g,beforeMove:v,afterMove:w,beforeViewportChange:y}){const b=window,x=document,M="meet-the-frontend-live-preview-panel",S=(0,t.select)(n.store),E=(0,t.dispatch)(n.store),k="width"===S.get(M,"fit")?"width":"automatic";E.setDefaults(M,{rememberVisibility:!0,rememberPosition:!0,panelOpen:!0,scrollToChanges:!0,viewport:"desktop",fitMode:k,customZoom:100,tabletOrientation:"portrait",mobileOrientation:"portrait"});const P=()=>!d&&(!u||u.fallbackMedia.matches);let C=!1!==S.get(M,"rememberVisibility"),L=!1!==S.get(M,"rememberPosition"),V=!1!==S.get(M,"scrollToChanges");const T=d?.parentElement??x.getElementById("mtflpp-toggle"),O=x.getElementById("mtflpp-panel");if(!T||!O)throw new Error("Preview panel markup is missing.");const j=d||function(e){let t;const{title:n,moveHelp:i}=e.dataset;return(0,o.flushSync)(()=>(0,o.createRoot)(e).render((0,o.createElement)(r.Button,{ref:e=>{t=e},variant:"secondary",label:n,title:n,description:i,"aria-controls":"mtflpp-panel","aria-expanded":!1},(0,o.createElement)("span",{className:"mtflpp-launcher-label"},n)))),t}(T),R=O.querySelector(".mtflpp-move-control"),H=O.querySelector(".mtflpp-resize"),A=O.querySelectorAll("[data-resize-edge]"),$=O.querySelector(".mtflpp-header"),_=O.querySelector(".mtflpp-caption"),N=O.querySelector(".mtflpp-viewport"),F=O.querySelector(".mtflpp-canvas"),B=O.querySelector(".mtflpp-stage"),D=O.querySelector(".mtflpp-empty"),q=O.querySelector(".mtflpp-devicebar"),W=O.querySelector(".mtflpp-dimensions"),z=O.querySelector(".mtflpp-feedback"),I=O.querySelector('[role="status"]');let Z;const J=function(e,t,n,o={},r=()=>{},i={desktop:"Desktop",tablet:"Tablet",mobile:"Phone"}){const a=e.ownerDocument.defaultView,s=e.querySelector(".mtflpp-canvas"),l=e.querySelector(".mtflpp-canvas-space"),c=n.querySelector(".mtflpp-dimensions-text"),d={desktop:[1280,800],tablet:[768,1024],mobile:[390,844]},u=Object.keys(d);let f=u.includes(o.device)?o.device:"desktop";const p=["automatic","window","width","custom"];let m=p.includes(o.fit)?o.fit:"automatic";const h=e=>Number.isInteger(e)&&e>=10&&e<=400;let g,v=h(o.customZoom)?o.customZoom:100,w=100;const y=e=>"desktop"===e?"landscape":"portrait",b=Object.fromEntries(u.map(e=>[e,"desktop"!==e&&["portrait","landscape"].includes(o[`${e}Orientation`])?o[`${e}Orientation`]:y(e)])),x=()=>b[f]===y(f)?d[f]:[...d[f]].reverse(),M=()=>"width"===m;let S,E,k;const P=a.matchMedia("(prefers-reduced-motion: no-preference)");function C(){const t=e.ownerDocument.defaultView.devicePixelRatio;return Number.isFinite(t)&&t>0?t:1}function L(e,t){if("custom"===m)return v/100/C();const n=s.clientWidth/e;if(M())return n;const o=Math.min(n,s.clientHeight/t);return"automatic"===m?Math.min(1/C(),o):o}function V(e,n){S=e;const[o,r]=x(),i=Math.max(0,(s.clientWidth-o*S)/2),a=Math.max(0,(s.clientHeight-r*S)/2);Object.assign(l.style,{width:`${Math.max(s.clientWidth,i+o*S)}px`,height:`${Math.max(s.clientHeight,a+r*S)}px`}),Object.assign(t.style,{left:`${i}px`,top:`${a}px`,transform:`scale(${S})`});const c=o*S>s.clientWidth+.01||r*S>s.clientHeight+.01,d="custom"===m||M();s.tabIndex=d&&c?0:-1,s.scrollLeft="custom"===m?n.x*S:0,s.scrollTop=d?n.y*S:0}function T(){if(!E)return;const e=E;E=null,e.window.cancelAnimationFrame(e.frame),e.resolve?.()}function O(e,t,n,o){return t<=0||o&&e<-1&&t<n?Math.max(e,t-n):e>=n||o&&e>0&&t>n+1?Math.min(e,t-n):0}function j(o=!1,a=!1){T();const[l,d]=x();if(Object.assign(t.style,{width:`${l}px`,height:`${d}px`}),!e.clientWidth||!e.clientHeight)return;const u=C(),p=`${i[f]} (${l} × ${d}) · `,h=Math.max(400,Math.ceil(e.clientWidth/l*u*100)),y=`${p}${"0".repeat(String(h).length)}%`;n.dataset.reserve!==y&&(n.dataset.reserve=y);const b=a?{x:0,y:0}:{x:(s.scrollLeft||0)/(S||1),y:(s.scrollTop||0)/(S||1)};if(s.style.overflowX="hidden",s.style.overflowY="hidden","custom"===m){const e=L(l,d);for(let t=0;t<2;t++)l*e>s.clientWidth+.01&&(s.style.overflowX="scroll"),d*e>s.clientHeight+.01&&(s.style.overflowY="scroll")}else M()&&d*L(l,d)>e.clientHeight&&(s.style.overflowY="scroll");if(!s.clientWidth||!s.clientHeight)return;const k=L(l,d),O=Math.round(k*u*100),j=O!==w||u!==g;w=O,g=u;const R=`${p}${"custom"===m?v:w}%`;c.textContent!==R&&(c.textContent=R),j&&r();const H=S??k;if(!o||!P.matches||H===k)return void V(k,b);const A={window:e.ownerDocument.defaultView,frame:null},$=A.window.performance.now();E=A;const _=e=>{V(e,b),A.scrollLeft=s.scrollLeft,A.scrollTop=s.scrollTop};_(H);const N=e=>{if(E!==A)return;const t=Math.min(1,Math.max(0,(e-$)/200));_(H+(k-H)*(1-(1-t)**3)),t<1?A.frame=A.window.requestAnimationFrame(N):T()};A.frame=A.window.requestAnimationFrame(N)}function R(){j()}function H(){k?.();const t=e.ownerDocument.defaultView.matchMedia(`(resolution: ${C()}dppx)`);t.addEventListener("change",H),k=()=>t.removeEventListener("change",H),R()}let A=new a.ResizeObserver(R);return A.observe(e),P.addEventListener("change",R),a.addEventListener("resize",H),H(),{get device(){return f},get fit(){return m},get customZoom(){return v},get zoomPercent(){return"custom"===m?v:w},get dpr(){return C()},get orientation(){return b[f]},canvasTarget:function(e,t,{fitTarget:n=!1}={}){const o=e.getBoundingClientRect(),r=s.getBoundingClientRect(),i=o.left-r.left-s.clientLeft,a=o.top-r.top-s.clientTop,l=O(i+t.left*S,i+t.right*S,s.clientWidth,n),c=O(a+t.top*S,a+t.bottom*S,s.clientHeight,n),d=Math.max(t.left,-i/S),u=Math.min(t.right,(s.clientWidth-i)/S);return{visible:!l&&!c,visibleCenterX:d<u?(d+u)/2:void 0,distance:Math.hypot(l,c),reveal(e="instant"){(l||c)&&s.scrollBy({left:l,top:c,behavior:e})}}},canvasWasPanned:function(){return!!E&&(s.scrollLeft!==E.scrollLeft||s.scrollTop!==E.scrollTop)},whenSettled:function(){if(!E)return;const e=E;return e.done??=new Promise(t=>{e.resolve=t}),e.done},finishMotion(){E&&R()},select(e,{animate:t=!1,keepPan:n=!1}={}){if(!u.includes(e))return;const o=f!==e;f=e,o?j(t,!n):E||R()},rotate({animate:e=!1,keepPan:t=!1}={}){"desktop"!==f&&(b[f]="portrait"===b[f]?"landscape":"portrait",j(e,!t))},setFit(e){p.includes(e)&&m!==e&&(m=e,j(!1,!0))},setZoom(e){if(!h(e)||"custom"===m&&v===e)return;const t="custom"!==m;v=e,m="custom",j(!1,t)},layout:R,beforeMove(){T(),A.disconnect(),k?.(),e.ownerDocument.defaultView.removeEventListener("resize",H)},afterMove(){A=new e.ownerDocument.defaultView.ResizeObserver(R),A.observe(e),e.ownerDocument.defaultView.addEventListener("resize",H),H()}}}(N,B,W,{device:S.get(M,"viewport"),fit:S.get(M,"fitMode")??k,customZoom:S.get(M,"customZoom"),tabletOrientation:S.get(M,"tabletOrientation"),mobileOrientation:S.get(M,"mobileOrientation")},()=>Ce(),e),G=x.querySelector("#wpbody-content > .wrap"),X=x.getElementById("wpadminbar");function Y(e=!1){const t=Math.max(1,x.documentElement.clientWidth),n=Math.max(1,x.documentElement.clientHeight),o=x.documentElement.getBoundingClientRect().left+b.scrollX,r=!e&&G?.getBoundingClientRect(),i=r?Math.max(0,"rtl"===b.getComputedStyle(G).direction?r.left-o:o+t-r.right):20,a=e?0:i,s=Math.min(a,(t-1)/2),l=Math.min(Math.max(0,X?.getBoundingClientRect().bottom||0)+a,n-1),c=t-s,d=n-Math.min(a,n-l-1);return{left:s,top:l,right:c,bottom:d,width:c-s,height:d-l}}let U,Q=f&&(!C||!1!==S.get(M,"panelOpen")),K=!1;const ee=S.get(M,"layout"),te=S.get(M,"position")??ee?.dock??ee?.anchor;let ne=["left","center","right"].includes(te)?te:"right";const oe=c(L?ee:void 0,Y,ne),{compactRect:re,usableEdge:ie}=oe;let ae,se=!1,le="",ce=!1,de={text:e.loading,state:"loading",hasPreview:!1,canRetry:!1,reason:""},ue=!1;function fe(t){const n="string"==typeof t?t.replace(/\s+/g," ").trim():"";_.textContent=n?`${e.preview} — ${n}`:e.title,_.title=_.textContent,U&&(U.document.title=_.textContent)}function pe(){const{text:t,state:n,hasPreview:o,reason:r}=de;return"handover"===n?{heading:e.switchingPreview,description:t,note:e.tabEdits}:"conflict"===n?{heading:t,description:{"handed-off":e.handedOffHelp,busy:e.takeoverTimeoutHelp,manual:e.closeOtherHelp}[r]||e.conflictHelp,note:"manual"===r?e.manualSwitchHint:e.tabEdits}:"paused"===n?{heading:e.pausedTitle,description:t,note:""}:"error"===n?function(){const{text:t,hasPreview:n,canRetry:o,reason:r}=de;if("origin-mismatch"===r)return{heading:e.originMismatchTitle,description:n?`${t} ${e.previousPreview}`:t,note:""};if("unavailable"===r||"browser"===r)return{heading:"unavailable"===r?e.unavailableTitle:e.browserTitle,description:t,note:""};const i={reload:e.reviewBeforeReload,"reload-before-save":e.nativePreviewAcfReload}[r];if(!n){let n=t;return t===e.failed&&(n=o?e.failedHelp:""),i&&(n+=` ${i}`),{heading:e.failed,description:n,note:""}}return{heading:t===e.failed?e.refreshFailed:t,description:i||e.previousPreview,note:""}}():o?{heading:t,description:"",note:""}:{heading:e.loading,description:e.preparing,note:""}}function me(){return se?"handover"===de.state?e.takingOver:e.takeOver:e.retry}function he(e){return!e||["handover","paused"].includes(de.state)?"info":"error"!==de.state||de.canRetry?"warning":"error"}function ge(){return de.redirectDestination?`${e.redirected} ${de.redirectDestination}`:de.hasHtmlPreview&&ae?`${e.publicRedirected} ${ae}`:""}function ve(){const{state:t,hasPreview:n,canRetry:o,reason:r}=de,i=n&&["error","conflict","handover","paused"].includes(t),a=!n||i||le?"":ge();if(z.hidden=!i&&!le&&!a,z.tabIndex=z.hidden?-1:0,O.dataset.hasFeedback=String(!z.hidden),z.hidden)return null;if(a)return{heading:a,status:"info",dismissible:!1};const{heading:s,description:l}=pe();return{heading:i?s:le,description:i?l:e.windowNoticeHelp,status:he(i),dismissible:!i,retry:i&&(se||o&&["error","conflict"].includes(t)),close:i&&"error"===t&&!o&&!["reload","reload-before-save"].includes(r),disabled:"handover"===t,action:me()}}function we(t){de.hasPreview&&["error","conflict","handover","paused"].includes(de.state)||(le=t,Ce()),I.textContent=`${t} ${e.windowNoticeHelp}`}function ye(){le="",Ce()}function be(e,t="loading",{canTakeOver:n=!1,hasPreview:o=!1,hasHtmlPreview:r=!1,redirectDestination:i,canRefresh:a=!1,canRetry:l=!0,reason:c=""}={}){const d=O.ownerDocument.activeElement,u=O.contains(d),f=!o&&(de.state!==t||de.text!==e||de.reason!==c),p=de.hasPreview!==o;de={text:e,state:t,canTakeOver:n,hasPreview:o,hasHtmlPreview:r,redirectDestination:i,canRefresh:a,canRetry:l,reason:c},["error","conflict","handover","paused"].includes(t)&&(le=""),O.dataset.state=t,O.dataset.hasPreview=String(o),se=n&&["conflict","handover"].includes(t),D.hidden=o,q.hidden=!o;const{heading:m,description:h,note:g}=pe();f&&(D.scrollTop=0);const v="ready"!==t||le?"":ge();I.textContent=o?[m,h,g,v].filter(Boolean).join(" "):m,Ce(),p&&J.layout(),function(e,t){e&&t&&(!O.contains(e)||e.closest("[hidden]")||e.disabled||!de.hasPreview&&F.contains(e))&&Z.focus(D.hidden?"actions":"empty-title")}(d,u),Q&&"ready"===t&&r&&!i&&async function(){if(s&&!ce){ce=!0;try{const e=new URL(s.endpoint);if(e.origin!==b.location.origin)return;const t=await b.fetch(e,{credentials:"same-origin",cache:"no-store",redirect:"error",headers:{"X-WP-Nonce":s.nonce}});if(!t.ok)return;const{destination:n}=await t.json();if("string"!=typeof n||!n)return;if(ae=n,!Q)return;Ce(),"ready"!==de.state||!de.hasHtmlPreview||de.redirectDestination||le||(I.textContent=ge())}catch{}}}()}function xe(e){f&&C&&S.get(M,"panelOpen")!==e&&E.set(M,"panelOpen",e)}function Me(){L&&E.set(M,"layout",oe.layout)}function Se(){const e=T.hidden;T.hidden=!1,T.style.maxWidth=`${Y(!oe.dock).width}px`;const t={width:T.offsetWidth,height:T.offsetHeight};return T.hidden=e,oe.launcherRect(t)}function Ee(){if(U)return;if(!Q&&P()){const e=Se(),t=oe.anchorFactor;Object.assign(T.style,{left:`${e.x+e.width*t}px`,top:`${e.y+e.height}px`,transform:`translate(${-100*t}%, -100%)`})}let e=re();if(O.dataset.anchor=oe.anchor,oe.expanded){const t=Y();e={x:t.left,y:t.top,width:t.width,height:t.height}}Object.assign(O.style,{left:`${e.x}px`,top:`${e.y}px`,width:`${e.width}px`,height:`${e.height}px`,transform:""})}function ke(e="right",t=!1){oe.dockTo(e,t),ne=e,E.set(M,"position",ne),Ee(),Me(),Ce()}function Pe(){return"function"==typeof b.documentPictureInPicture?.requestWindow}function Ce(){if(!Z)return;const t=O.ownerDocument.fullscreenElement===O,n=!U&&!t,o=n&&!oe.expanded;O.classList.toggle("mtflpp-expanded",oe.expanded),H.hidden=!o;for(const e of A)e.hidden=!o||!ie(e.dataset.resizeEdge);const r=se||de.canRetry&&["error","conflict"].includes(de.state);var i;Z.update({inPage:n,inPip:!!U,movable:o,dock:oe.dock,canRememberVisibility:f,rememberVisibility:C,rememberPosition:L,followChanges:V,device:J.device,busy:de.hasPreview&&["stale","loading","handover"].includes(de.state)&&de.text!==e.saving,empty:de.hasPreview?null:{...pe(),busy:["loading","stale","ready","handover"].includes(de.state),icon:["paused","conflict"].includes(de.state)||["unavailable","browser","origin-mismatch"].includes(de.reason)?"info":"warning",retry:r,disabled:"handover"===de.state,close:"error"===de.state&&!r,action:me()},notice:ve(),fit:J.fit,orientation:J.orientation,customZoom:J.customZoom,zoomPercent:J.zoomPercent,dpr:J.dpr,canRefresh:de.canRefresh,hasPreview:de.hasPreview,canPip:n&&Pe(),canFullscreen:n&&!!x.fullscreenEnabled,mode:t||oe.expanded?"compact":"expand",modeLabel:(i=t,i?e.exitFullscreen:oe.expanded?e.compact:e.expand)})}function Le(){Z.closeMenu(),U?U.close():x.fullscreenElement!==O?(oe.toggleExpanded(),Ee(),Me(),Ce(),Z.focus("mode")):x.exitFullscreen().then(ye,()=>we(e.fullscreenFailed))}function Ve(t,n=!1,o){const r=t===j,i=t===$,a=()=>o||("left"===oe.anchor?"ne":"nw"),s=()=>U||!r&&oe.expanded||x.fullscreenElement===O||n&&!ie(a());let l,c;const d=()=>({...r?Se():re(),preferredBounds:oe.layout.bounds});function u(){if(c=null,l)if(n||r)Ee();else{const e=re(),t=e.x-parseFloat(O.style.left),n=e.y-parseFloat(O.style.top);Object.assign(O.style,{width:`${e.width}px`,height:`${e.height}px`,transform:`translate3d(${t}px, ${n}px, 0)`})}}function f(){if(!l)return;const{pointer:e,moved:n}=l;l=null,b.cancelAnimationFrame(c),t.hasPointerCapture(e)&&t.releasePointerCapture(e),O.classList.remove("mtflpp-dragging"),t.classList.remove("mtflpp-edge-active"),x.documentElement.classList.remove("mtflpp-window-dragging"),x.documentElement.style.removeProperty("--mtflpp-drag-cursor"),Ee(),n&&(r&&(ue=!0),Me(),Ce())}t.addEventListener("pointerdown",e=>{0!==e.button||s()||i&&e.target.closest('button, a, [role="button"]')||(r&&(ue=!1),e.preventDefault(),r?j.focus({preventScroll:!0}):t===R&&Z.focus("move"),Z.closeMenu(),l={...d(),pointer:e.pointerId,pointerX:e.clientX,pointerY:e.clientY},t.setPointerCapture(e.pointerId))}),t.addEventListener("pointermove",e=>{if(!l||l.pointer!==e.pointerId)return;const o=e.clientX-l.pointerX,i=e.clientY-l.pointerY;!l.moved&&Math.abs(o)+Math.abs(i)<4||(l.moved=!0,O.classList.add("mtflpp-dragging"),n&&t.classList.add("mtflpp-edge-active"),x.documentElement.style.setProperty("--mtflpp-drag-cursor",n?b.getComputedStyle(t).cursor:"grabbing"),x.documentElement.classList.add("mtflpp-window-dragging"),n?oe.resize(l,a(),o,i):oe.move(l,o,i,r),c||(c=b.requestAnimationFrame(u)))});for(const e of["pointerup","pointercancel","lostpointercapture"])t.addEventListener(e,f);b.addEventListener("blur",f),i||o||t.addEventListener("keydown",t=>{const o={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[t.key];if(!o||t.altKey||t.ctrlKey||t.metaKey||s())return;t.preventDefault(),Z.closeMenu();const i=d(),l=t.shiftKey?40:10;n?oe.resize(i,a(),o[0]*l,o[1]*l):oe.move(i,o[0]*l,o[1]*l,r),Ee(),Me(),Ce();const c=re();I.textContent=n?`${e.resize}: ${Math.round(c.width)} × ${Math.round(c.height)}`:e.moved})}fe(a),$.addEventListener("dblclick",e=>{U||e.target.closest("button, a")||Le()}),x.addEventListener("fullscreenchange",Ce),H.addEventListener("keydown",e=>{"Escape"===e.key&&H.classList.add("mtflpp-help-dismissed")}),H.addEventListener("blur",()=>H.classList.remove("mtflpp-help-dismissed")),Ve(R),Ve($),d||Ve(j),Ve(H,!0);for(const e of A)Ve(e,!0,e.dataset.resizeEdge);function Te(){O.hidden=K||!Q,T.hidden=K||!d&&(Q||!P()),j.setAttribute("aria-expanded",String(!O.hidden))}function Oe(){Z.closeMenu(),U?.close(),x.fullscreenElement===O&&x.exitFullscreen().catch(()=>{})}function je(e=!0){K||(Q?Z.focus("actions"):(xe(!0),p(),Q&&e&&Z.focus("actions")))}return b.addEventListener("resize",Ee),b.addEventListener("scroll",Ee,{passive:!0}),u?.fallbackMedia.addEventListener("change",()=>{Ee(),Te()}),j.addEventListener("click",e=>{if(ue&&0!==e.detail)return ue=!1,void e.preventDefault();ue=!1,je(0===e.detail)}),Z=function(e,n,a){const s=e.querySelector(".mtflpp-controls"),c=e.querySelector(".mtflpp-refresh-control"),d=e.querySelector(".mtflpp-move-control"),u=e.querySelector(".mtflpp-device-controls"),f=e.querySelector(".mtflpp-fit-control"),p=e.querySelector(".mtflpp-pip-control"),m=e.querySelector(".mtflpp-empty"),h=e.querySelector(".mtflpp-feedback");let g,v=(0,o.createRoot)(s),w=!1,y=!1,b=!1;const x=i.InlineNotices?(0,t.dispatch)(i.store):null,M=e.ownerDocument.defaultView?.wp?.theme?.ThemeProvider,S="meet-the-frontend-live-preview-panel",E="preview-feedback";let k="";function P(){const e=g.notice,t=/[.!?…。!?]$/.test(e.heading)?e.heading:`${e.heading}.`;return{message:e.description?`${t} ${e.description}`:e.heading,status:e.status,isDismissible:e.dismissible,actions:[...e.retry?[{label:e.action,disabled:e.disabled,onClick:a.retry}]:[],...e.close?[{label:n.close,onClick:a.close}]:[]]}}function C(){x&&k&&x.removeNotice(E,S),k=""}function L(e){return()=>{O(),e()}}function V(){const{inPage:t,inPip:s,mode:v,modeLabel:E,movable:k,busy:C,canRefresh:V,hasPreview:j,canPip:R}=g;return(0,o.createElement)(r.SlotFillProvider,null,(0,o.createPortal)(k&&t&&(0,o.createElement)(r.Button,{className:"mtflpp-icon mtflpp-move",size:"compact",icon:l.move,label:n.move,showTooltip:!0,tooltipPosition:"bottom","data-action":"move"}),d),(0,o.createPortal)((0,o.createElement)(r.Button,{className:"mtflpp-icon",size:"compact",icon:C?(0,o.createElement)(r.Spinner):l.refresh,label:n.refresh,showTooltip:!0,accessibleWhenDisabled:!0,disabled:!V,onClick:a.refresh,"data-action":"refresh"}),c),(0,o.createPortal)(R&&j&&(0,o.createElement)("div",{className:"mtflpp-pip-surface"},(0,o.createElement)(r.Button,{className:"mtflpp-pip-button",icon:l.pip,label:n.popOutHelp,"aria-label":n.popOut,description:n.popOutHelp,showTooltip:!0,onClick:a.popOut,"data-action":"pop-out"})),p),function(){const{canPip:e,canFullscreen:t,inPage:i,inPip:s,dock:c,canRememberVisibility:d,rememberVisibility:u,rememberPosition:f,followChanges:p}=g;return(0,o.createElement)(r.DropdownMenu,{className:"mtflpp-actions",label:n.actions,icon:l.more,open:w,onToggle(e){w=e,e&&(y=!1),T()},toggleProps:{className:"mtflpp-icon",size:"compact","data-action":"actions"},popoverProps:{placement:"bottom-end",offset:6,shift:!0,className:"mtflpp-menu-popover"}},()=>(0,o.createElement)(o.Fragment,null,(e||t)&&(0,o.createElement)(r.MenuGroup,{label:n.display},e&&(0,o.createElement)(r.MenuItem,{label:n.popOutHelp,description:n.popOutHelp,showTooltip:!0,onClick:L(a.popOut),"data-action":"pip","aria-label":n.popOut},n.popOut),t&&(0,o.createElement)(r.MenuItem,{onClick:L(a.fullscreen),"data-action":"fullscreen"},n.fullscreen)),i&&(0,o.createElement)(r.MenuGroup,{label:n.position},(0,o.createElement)(r.MenuItemsChoice,{value:c,choices:[{value:"left",label:n.bottomLeft},{value:"center",label:n.bottomCenter},{value:"right",label:n.bottomRight}],onSelect(e){O(),a.dock(e)}})),(0,o.createElement)(r.MenuGroup,{label:n.preferences},!1!==d&&(0,o.createElement)(r.MenuItem,{role:"menuitemcheckbox",isSelected:u,icon:u?l.check:void 0,info:n.rememberVisibilityHelp,onClick:L(a.rememberVisibility),"data-action":"remember-visibility"},n.rememberVisibility),(0,o.createElement)(r.MenuItem,{role:"menuitemcheckbox",isSelected:f,icon:f?l.check:void 0,info:n.rememberPositionHelp,onClick:L(a.rememberPosition),"data-action":"remember-position"},n.rememberPosition),(0,o.createElement)(r.MenuItem,{role:"menuitemcheckbox",isSelected:p,icon:p?l.check:void 0,info:n.followHelp,onClick:L(a.follow),"data-action":"follow"},n.follow)),i&&(0,o.createElement)(r.MenuGroup,null,(0,o.createElement)(r.MenuItem,{info:n.resetHelp,onClick:L(a.reset),"data-action":"reset"},n.reset)),s&&(0,o.createElement)(r.MenuGroup,null,(0,o.createElement)(r.MenuItem,{onClick:L(a.close),"data-action":"close"},n.closeLivePreview))))}(),!s&&(0,o.createElement)(r.Button,{className:"mtflpp-icon mtflpp-mode",size:"compact",icon:l[v],label:E,showTooltip:!0,onClick:a.mode,"data-action":"mode"}),!s&&(0,o.createElement)(r.Button,{className:"mtflpp-icon",size:"compact",icon:l.close,label:n.close,showTooltip:!0,onClick:a.close,"data-action":"close"}),(0,o.createPortal)(function(){const{device:e,orientation:t}=g;return(0,o.createElement)(r.Toolbar,{className:"mtflpp-devices",label:n.viewport,variant:"unstyled"},...["desktop","tablet","mobile"].map(i=>{const s=e===i,c=s&&"desktop"!==i,d=c&&"landscape"===t,u="portrait"===t?n.rotateLandscape:n.rotatePortrait;return(0,o.createElement)(r.ToolbarButton,{key:i,icon:l[i],className:d?"mtflpp-device-rotated":void 0,label:c?`${n[i]} — ${u}`:n[i],isPressed:s,"data-viewport":i,onClick:()=>a.device(i)})}))}(),u),(0,o.createPortal)(function(){const{fit:e,customZoom:t=100,dpr:i=1}=g,s={automatic:n.automatic,window:n.fitToWindow,width:n.fitToWidth},c={automatic:n.automaticHelp,window:n.fitToWindowHelp,width:n.fitToWidthHelp},d="custom"===e?n.fixedZoom:s[e]??n.automatic;return(0,o.createElement)(r.Dropdown,{open:y,onToggle(e){y=e,e&&(w=!1,b="custom"===g.fit),T()},contentClassName:"mtflpp-zoom-popover",focusOnMount:"firstElement",popoverProps:{placement:"top-end",offset:8,shift:!0,resize:!1,role:"dialog","aria-label":n.fitting},renderToggle:({isOpen:e,onToggle:t})=>(0,o.createElement)(r.Button,{className:"mtflpp-zoom-toggle",variant:"secondary",size:"compact",label:d,showTooltip:!0,"aria-label":`${n.fitting}: ${d}`,"aria-haspopup":"dialog","aria-expanded":e,onClick:t,"data-action":"zoom"},(0,o.createElement)("span",{className:"mtflpp-zoom-value"},d),l.chevron),renderContent:()=>(0,o.createElement)("div",{className:"mtflpp-zoom-content"},(0,o.createElement)(r.RadioControl,{label:n.zoomMode,selected:e,options:[...Object.entries(s).map(([e,t])=>({value:e,label:t,description:c[e]})),{value:"custom",label:n.fixedZoom,description:n.fixedZoomHelp}],onFocus(e){if(!b)return;b=!1;const t=e.currentTarget.closest(".mtflpp-zoom-content")?.querySelector('.mtflpp-custom-zoom input[type="number"]');t?.focus({preventScroll:!0});const n=t?.closest(".components-popover__content");if(n){const e=t.getBoundingClientRect(),o=n.getBoundingClientRect();n.scrollTop+=Math.min(0,e.top-o.top)+Math.max(0,e.bottom-o.bottom)}},onChange(e){b=!1,"custom"!==e?a.fit(e):a.zoom(t)}}),"custom"===e&&(0,o.createElement)("div",{className:"mtflpp-custom-zoom",onKeyDown(e){if("Enter"!==e.key)return;e.preventDefault();const t=Number(e.target.value);!1!==e.target.validity?.valid&&Number.isInteger(t)&&t>=10&&t<=400&&O()}},(0,o.createElement)(r.RangeControl,{label:n.customZoom,min:10,max:400,step:1,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:t,help:n.customZoomHelp,withInputField:!0,onChange(e){Number.isInteger(e)&&e>=10&&e<=400&&a.zoom(e)}})),(0,o.createElement)("div",{className:"mtflpp-dpr-note",role:"group","aria-label":n.displayInformation},(0,o.createElement)("span",{className:"mtflpp-dpr-value"},`${n.displayDpr}: ${Number(i.toFixed(2))}`),(0,o.createElement)("span",{className:"mtflpp-pixel-note"},n.pixelZoomHelp)))})}(),f),(0,o.createPortal)(function(){const{empty:e}=g;return e?(0,o.createElement)(r.Placeholder,{className:"mtflpp-placeholder","data-empty-icon":e.busy?void 0:e.icon,icon:e.busy?(0,o.createElement)(r.Spinner):l[e.icon],label:(0,o.createElement)("h3",{className:"mtflpp-empty-title",tabIndex:-1,"data-action":"empty-title"},e.heading),instructions:e.description},e.retry&&(0,o.createElement)(r.Button,{key:"retry",variant:"primary",disabled:e.disabled,onClick:a.retry,"data-action":"retry"},e.action),e.close&&(0,o.createElement)(r.Button,{key:"close",variant:"secondary",onClick:a.close,"data-action":"close"},n.close),e.note&&(0,o.createElement)("p",{className:"mtflpp-empty-note"},e.note)):null}(),m),(0,o.createPortal)(function(){if(!g.notice)return null;if(x){const e=(0,o.createElement)(i.InlineNotices,{context:S,className:"mtflpp-inline-notices"});return M?(0,o.createElement)(M,{cornerRadius:"none"},e):e}const{message:e,...t}=P();return(0,o.createElement)(r.Notice,{...t,onRemove:a.dismissNotice,spokenMessage:"",politeness:"polite"},e)}(),h),t?(0,o.createPortal)((0,o.createElement)(r.Popover.Slot),e.ownerDocument.body):(0,o.createElement)(r.Popover.Slot))}function T(){g&&v&&(function(){if(!x)return;if(!g.notice)return void C();const e=JSON.stringify(g.notice);if(k===e)return;const{message:t,status:n,...o}=P();x.createNotice(n,t,{...o,id:E,context:S,speak:!1,onDismiss:a.dismissNotice}),k=e}(),(0,o.flushSync)(()=>v.render((0,o.createElement)(V))))}function O(){(w||y)&&(w=!1,y=!1,T())}function j(t){g?.inPip&&"mode"===t&&(t="actions"),e.querySelector(`[data-action="${t}"]`)?.focus({preventScroll:!0})}return{update(t){const n=y&&!t.hasPreview&&e.ownerDocument.activeElement?.closest(".mtflpp-zoom-popover");t.hasPreview||(y=!1),g=t,T(),n&&j("empty-title")},closeMenu:O,focus:j,beforeMove(){w=!1,y=!1,v?.unmount(),v=null,C()},remount(){v=(0,o.createRoot)(s),T()}}}(O,e,{refresh:()=>{de.canRefresh&&h()},retry:()=>{"handover"!==de.state&&(se||de.canRetry&&["error","conflict"].includes(de.state))&&g(se)},dismissNotice:()=>{ye(),I.textContent=de.text,Z.focus("actions")},mode:Le,close:function(){Z.closeMenu(),xe(!1),m(),d||P()?j.focus():u.focus()},popOut:async function(){if(K||U||x.fullscreenElement===O||!Pe())return;let t;Z.closeMenu();const n=()=>{U===t&&(v(),J.beforeMove(),Z.beforeMove(),x.body.append(O),O.classList.remove("mtflpp-pip"),U=null,Z.remount(),Ee(),J.afterMove(),Ce(),K||(w(),Q&&Z.focus("mode")))};try{if(t=await b.documentPictureInPicture.requestWindow({width:640,height:440}),!Q||K)return void t.close();const e=b.getComputedStyle(O);t.document.documentElement.lang=x.documentElement.lang,t.document.documentElement.dir=e.direction;for(const n of["--wp-admin-theme-color","--wp-admin-theme-color-darker-10","--wp-admin-border-width-focus"]){const o=e.getPropertyValue(n);o&&t.document.documentElement.style.setProperty(n,o)}const o=x.querySelectorAll(['link[rel="stylesheet"][href*="/load-styles.php"]',"#wp-theme-css","#wp-theme-inline-css","#wp-components-css","#wp-components-inline-css","style[data-emotion]","style[data-wp-hash]","#meet-the-frontend-live-preview-panel-css","#meet-the-frontend-live-preview-panel-inline-css"].join(", "));for(const e of o){const n=e.cloneNode(!0);"STYLE"===e.tagName&&e.sheet&&(n.textContent=Array.from(e.sheet.cssRules,e=>e.cssText).join("\n")),n.addEventListener("load",J.layout,{once:!0}),t.document.head.append(n)}t.document.title=_.textContent,t.document.body.className="mtflpp-pip-document",t.addEventListener("resize",J.layout),t.addEventListener("pagehide",n,{once:!0}),U=t,v(),J.beforeMove(),Z.beforeMove(),O.classList.add("mtflpp-pip"),t.document.body.append(O),Z.remount(),J.afterMove(),Ce(),ye(),Z.focus("mode"),w()}catch{if(t&&(n(),t.close()),K)return;Z.focus("actions"),we(e.pipFailed)}},fullscreen:async function(){if(!K&&!U&&x.fullscreenEnabled){Z.closeMenu();try{if(await O.requestFullscreen(),K)return void Oe();ye(),Z.focus("mode")}catch{if(K)return;Z.focus("actions"),we(e.fullscreenFailed)}}},dock:e=>ke(e),reset:()=>ke("right",!0),follow:function(){V=!V,E.set(M,"scrollToChanges",V),Ce(),V&&de.canRefresh&&h(!1)},rememberVisibility:function(){C=!C,E.set(M,"rememberVisibility",C),C&&xe(Q),Ce()},rememberPosition:function(){L=!L,E.set(M,"rememberPosition",L),L?Me():(E.set(M,"position",ne),E.set(M,"layout",void 0)),Ce()},device(e){const t=J.device;if(e===t&&"desktop"===e)return;let n=!1;if(Q&&V&&y){const{fit:e,customZoom:t,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:a}=J;n=!!y({canvas:F,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:a,canFollow:()=>J.fit===e&&J.customZoom===t})}const o={animate:Q&&!n,keepPan:n};e===t?(J.rotate(o),E.set(M,`${e}Orientation`,J.orientation)):(J.select(e,o),J.device!==t&&E.set(M,"viewport",J.device)),Ce()},fit(e){const t=J.fit;J.setFit(e),J.fit!==t&&E.set(M,"fitMode",J.fit),Ce()},zoom(e){const t=J.fit,n=J.customZoom;J.setZoom(e),J.customZoom!==n&&E.set(M,"customZoom",J.customZoom),J.fit!==t&&E.set(M,"fitMode",J.fit),Ce()}}),be(e.loading,"loading",{canRetry:!1}),Ee(),Te(),d&&(d.disabled=!1),{stage:B,canvasTarget:J.canvasTarget,get visible(){return Q},get followChanges(){return V},openFromLauncher:je,setSuspended(e){K!==e&&(K=e,Te(),e?Oe():Ee())},setVisible(e){e||(Z.closeMenu(),le="",Ce(),J.layout()),Q=e,Ee(),Te()},report:be,setTitle:fe,clearPreview(){B.replaceChildren();const t=["ready","stale","loading"].includes(de.state);be(t?e.loading:de.text,t?"loading":de.state,{...de,hasPreview:!1,hasHtmlPreview:!1,redirectDestination:void 0,canRefresh:!1,canRetry:!t&&de.canRetry})},returnToEditor:Oe}}function u(e=[]){const t=Array.isArray(e)?[...e]:[],n=new WeakMap;return{capture(e,o){try{if(n.has(e))return;const r=function(e){try{const t=e.querySelector('meta[name="meet-the-frontend-live-preview-panel"]'),n=t?.getAttribute("data-mtflpp-source");if(!n)return null;const o=JSON.parse(n);if("string"!=typeof o)return null;const r=(new DOMParser).parseFromString(o,"text/html");return r.querySelector('meta[name="meet-the-frontend-live-preview-panel"]')?.content===t.content?r:null}catch{return null}}(e);n.set(e,{source:r?S(r,e,t):null,dom:S(e,e,t),values:o&&structuredClone(o)})}catch{}},findChange(e,t){try{const o=n.get(e),r=n.get(t);if(!o||!r)return null;const i=function(e,t){if(!e||!t)return[];const n=[];for(const o of new Set([...Object.keys(e),...Object.keys(t)])){const r=Object.hasOwn(e,o)?e[o]:{type:t[o]?.type,value:""},i=Object.hasOwn(t,o)?t[o]:{type:e[o]?.type,value:""};if(r.type!==i.type||!["text","html"].includes(i.type)||"string"!=typeof r.value||"string"!=typeof i.value||r.value===i.value)continue;let a,s;try{a="html"===r.type?(new DOMParser).parseFromString(r.value,"text/html"):null,s="html"===i.type?(new DOMParser).parseFromString(i.value,"text/html"):null}catch{continue}const l=a?S(a,a,[],a.body):null,c=s?S(s,s,[],s.body):null,d=a?H(l):r.value,u=s?H(c):i.value,f=C(d),p=C(u);if(f!==p&&n.push({...I(f,p),type:"text",fullBefore:f,fullAfter:p}),!a){const e=R(d,u);e&&n.push(e);continue}if(l&&c&&(f===p||L(d,u)))for(const e of P(l,c)){if(e.spacing){const t=j(e);t&&n.push(t);continue}if(f===p)if("attributes"===e.kind){const t=new Map(e.before.attributes),o=new Map(e.after.attributes);for(const e of new Set([...t.keys(),...o.keys()])){const r=t.get(e)??"",i=o.get(e)??"";JSON.stringify(r)!==JSON.stringify(i)&&n.push({type:"attribute",name:e,before:"string"==typeof r?r:JSON.stringify(r),after:"string"==typeof i?i:JSON.stringify(i)})}}else if("content"===e.kind){const t=C(H(e.before)),o=C(H(e.after));t===o&&U(e.before,e.after,H)&&n.push({type:"markup",before:t,after:o,oldTag:e.before.tag,newTag:e.after.tag}),(e.before.media||[]).forEach((t,o)=>{const r=e.after.media?.[o];t&&r&&t!==r&&n.push({type:"media",before:t,after:r})})}}}return n}(o.values,r.values),a=function(e,t){if(!e||!t)return!1;const n=(e,t)=>Object.entries(e).some(([e,n])=>["text","html","value","row-image"].includes(n?.type)&&(!Object.hasOwn(t,e)||n.type!==t[e]?.type||n.value!==t[e]?.value));return n(e,t)||n(t,e)}(o.values,r.values),s=!!o.source&&!!r.source,l=!!o.source!=!!r.source,c=function(e,t,n){if(!e||!t)return;const o=Object.entries(t).filter(([t,n])=>"row-order"===n?.type&&"row-order"===e[t]?.type&&e[t].value!==n.value);if(1!==o.length)return;const[[r,i]]=o,a=e[r];if(!i.moved||i.members!==a.members)return;const s=JSON.parse(a.value),l=JSON.parse(i.value),c=s.indexOf(i.moved),d=l.indexOf(i.moved);if(-1===c||-1===d||c===d||s.length!==l.length)return;if(s.splice(c,1),l.splice(d,1),!s.every((e,t)=>e===l[t]))return;const u=d-c,f={html:new Map,peerLabels:new Map},p=F(r,i.moved,s,e,t,f),m=function(e,t,n,o,r,i){if([n,...o].some(n=>!e?.[n]||!t?.[n]))return[];const a=new Set(e[n]),s=new Set,l=new Set,c=new Set;for(const[n,a]of[[e,r],[t,i]])for(const e of o.flatMap(e=>n[e])){const t=a[e];"row-image"===t?.type&&(c.add(t.value),l.add(t.alt))}for(const e of t[n]){const t=r[e],n=i[e];if(!a.has(e)||"row-image"!==t?.type||"row-image"!==n?.type||!/^[1-9]\d*$/.test(n.value)||t.value!==n.value||c.has(n.value))continue;const o=n.alt;o?.trim()&&t.alt===o&&!l.has(o)&&s.add(o)}return[...s]}(a.fieldsByRow,i.fieldsByRow,i.moved,s,e,t);let h;if(n&&!p.length&&$(a,i.moved,e,f.html)&&$(i,i.moved,t,f.html)){const n=s.slice(Math.min(c,d),Math.max(c,d));h=[];for(const o of n){const n=F(r,o,[...s.filter(e=>e!==o),i.moved],e,t,f);if(!n.length){h=void 0;break}h.push(n)}}return{offset:u,groups:p,images:m,boundaryGroups:h}}(o.values,r.values,s&&!a&&!A(o.values,r.values)),d=s?P(o.source,r.source,c,!0):[];if(c?.boundaryGroups?.length){const e=d.filter(e=>e.priority>0);if(1===e.length&&e[0].boundary)return function({before:e,after:t,index:n},o){for(const n of[e,t]){let e,t;for(const{node:r}of n){if(!r?.isConnected||e&&e.nextElementSibling!==r)return null;const{position:n,marginTop:i,marginBottom:a}=r.ownerDocument.defaultView.getComputedStyle(r);if(o&&r.closest(o)||!h(r)||!["static","relative"].includes(n)||r.closest("[hidden], details:not([open])")||!1===r.checkVisibility?.({opacityProperty:!0,contentVisibilityAuto:!0}))return null;const s=r.getBoundingClientRect();if(!s.height&&!(parseFloat(i)>0||parseFloat(a)>0))return null;if(t&&(t.bottom>s.top||Math.max(t.left,s.left)>=Math.min(t.right,s.right)))return null;e=r,t=s}}return t[n].node}(e[0].boundary,r.source?.excluded)}if(!l&&!a&&!c){const e=function(e,t){const n=function(e,t){if(!e||!t)return;const n=["row-order","gallery-order","order"],o=[...new Set([...Object.keys(e),...Object.keys(t)])].filter(o=>(n.includes(e[o]?.type)||n.includes(t[o]?.type))&&e[o]?.value!==t[o]?.value);if(1!==o.length)return;const r=e[o[0]],i=t[o[0]];if("gallery-order"!==r?.type||"gallery-order"!==i?.type)return;const a=JSON.parse(r.value),s=JSON.parse(i.value);if(new Set(a).size!==a.length||new Set(s).size!==s.length)return;const l=new Map(a.map((e,t)=>[e,t])),c=s.map(e=>l.get(e));return a.length&&s.length&&c.every(e=>void 0===e)?void 0:{oldCount:a.length,matches:c}}(e.values,t.values);if(!n)return;const o=e.source??e.dom,r=t.source??t.dom,i=function(e,t,{oldCount:n,matches:o}){const r=[];function i(e,t){return e.signature===t.signature&&e.presentation===t.presentation}function a(e,t){return i(e,t)&&e.rawText===t.rawText&&e.children.length===t.children.length&&e.children.every((e,n)=>a(e,t.children[n]))}function s(e,t){if(e.children.length!==n||t.children.length!==o.length||e.rawText!==t.rawText&&(e.text||t.text))return!1;const i=x(e),s=x(t);if(!i||!s)return!1;const l=i.map(M),c=s.map(M),d=new Set(l);return!(d.size!==l.length||new Set(c).size!==c.length||l.length===c.length&&l.every((e,t)=>e===c[t])||!o.every((n,o)=>void 0===n?!d.has(c[o]):l[n]===c[o]&&a(e.children[n],t.children[o]))||(r.push({before:e,after:t,original:i,current:s}),0))}return e&&t&&function e(t,n){return!!i(t,n)&&(!!s(t,n)||t.rawText===n.rawText&&t.children.length===n.children.length&&t.children.every((t,o)=>e(t,n.children[o])))}(e,t)?r:null}(o,r,n);if(!i?.length)return;const a=i.map(e=>e.after);let[s]=a;for(;s&&!a.every(e=>e===s||ee(s,e));)s=s.parent;const l=e=>["main","body","html"].includes(e.tag)||e.attributes.some(([e,t])=>"role"===e&&"main"===t);if(!s?.parent||l(s)||!function(e,t){if(1===t.length)return!0;const n=new Set(t);let o=0;return function e(t){return n.has(t)?(o++,!0):!!v(t)||!w(t)&&("hr"!==t.tag||0===o||o===n.size)&&t.parts.every(t=>"string"==typeof t?0===o||o===n.size||!t.trim():e(t))}(e)&&o===n.size}(s,a))return null;let c=s.node;if(!c?.isConnected||a.some(({node:e})=>!c.contains(e)||r.excluded&&e.closest(r.excluded)))return null;if(t.source&&(!b(e.dom,i,"before","original")||!b(t.dom,i,"after","current")))return null;const d=c.ownerDocument.defaultView;for(let e=s,t=e.parent;t?.parent&&!l(t)&&!t.children.some(t=>t!==e&&y(t));e=t,t=t.parent){const e=t.node;if(!e?.contains(c))continue;const{overflowX:n,overflowY:o}=d.getComputedStyle(e),r=/^(?:auto|scroll|hidden)$/;(e.scrollWidth>e.clientWidth&&r.test(n)||e.scrollHeight>e.clientHeight&&r.test(o))&&(c=e)}return!h(c)||c.closest("[hidden], details:not([open])")||r.excluded&&c.closest(r.excluded)?null:c}(o,r);if(void 0!==e)return e}const u=[...d.map(e=>({...e,source:!0})),...P(o.dom,r.dom,c)],E=new Map,k=function(e,t){const n=new Map,o=e=>H(e,n),r=[];for(const n of e){if(n.unresolved)for(const e of f(n,t,o))r.push(e);if("insert"===n.kind&&n.added.length>1){const e=n.added.map(e=>{const r={...n,after:e,added:[e]},i=K(r,t,o);return{...r,input:i}}).filter(e=>e.input);if(e.length){r.push(...e);continue}}const e=K(n,t,o);r.push({...n,input:e})}return r}(u,i).filter(e=>(e.priority>0||e.input)&&(!e.spacing||function({before:e,after:t},n,o){const r=V(e,n,o),i=V(t,n,o);return r&&i&&r.omitted===i.omitted&&L(r.text,i.text)}(e,E,r.dom?.excluded))),T=s&&a&&!k.some(e=>e.source);return function(e,t){if(!e.length)return null;const n=e.reduce((e,t)=>Math.max(e,t.input),0),o=e.filter(e=>e.input===n),r=o.reduce((e,t)=>Math.max(e,t.priority),0),i=o.filter(e=>e.priority===r);if(t.rowMove&&!n||i.some(e=>e.unresolved))return function(e,{rowMove:t,excluded:n,canFollowLiveReorder:o,canFollowLiveMove:r}){if(t){const t=e.find(e=>e.moved&&(e.source||r)),o=t?.moved.node;return o?.isConnected&&t.after.node?.contains(o)&&e.every(e=>e===t||t.source&&!e.source&&(e.moved||"reorder"===e.regionChange))?"contents"!==o.ownerDocument.defaultView.getComputedStyle(o).display?o:p(t.moved,e=>o.contains(e)&&(!n||!e.closest(n))&&h(e)):null}const i=e.find(e=>e.unresolved&&("replacement"===e.regionChange||"reorder"===e.regionChange&&(e.source||o))),a=i?.after.node;if(!a?.isConnected)return null;for(const t of e)if(t.unresolved){if(i.source&&!t.source&&"reorder"===t.regionChange)continue;if(!t.regionChange||t.after.node!==a)return null}else if(!("insert"===t.kind?t.added:[t.after]).every(e=>a.contains(e.node)))return null;return"contents"!==a.ownerDocument.defaultView.getComputedStyle(a).display?a:null}(i,t);const a=i.filter(e=>!e.input||e.directInput||!i.some(t=>t!==e&&e.matches?.length&&e.matches.every(e=>t.matches?.includes(e))&&ee(e.after,t.after))),s=new Map,l=a.filter(e=>{const t="delete"===e.kind&&(e.following[0]||e.preceding[0])||e.after,n=t?.node;if(!n)return!0;const o="delete"!==e.kind||e.following.length?e.kind:"delete-last",r=s.get(n)||new Set;return!r.has(o)&&(r.add(o),s.set(n,r),!0)});return n&&s.size>1?null:function(e){const t=new Set,n=new Set;for(const o of e){let e,r=!1;"delete"===o.kind?(r=!o.removed.some(g),e=r?o.after:o.following.find(g)||o.preceding.find(g)||o.following.find(m)||o.preceding.find(m)||o.after):e="insert"===o.kind?o.added.find(g)||o.added.find(m):o.after;const i=m(e);if(!i)continue;const a=g(e),s=a||i;(a&&!r?t:n).add(s)}const o=t.size?t:n;return 1===o.size?o.values().next().value:null}(l)}(k.filter(e=>e.source||e.input||!s&&!l||T&&("insert"===e.kind||"delete"===e.kind)),{rowMove:!!c,excluded:r.source?.excluded??r.dom?.excluded,canFollowLiveReorder:!s&&(a||A(o.values,r.values)),canFollowLiveMove:!s&&!l})}catch{return null}}}}function f(e,t,n){const o=[];for(const r of t){if(!r.after||"spacing"===r.type)continue;const t=Q(e.oldRange,r.before,n,r,!0),i=Q(e.newRange,r.after,n,r,!1);if(!t.length)continue;const a="markup"===r.type&&r.oldTag===r.newTag;if(a||!r.before||!(t.length<=Q(e.newRange,r.before,n,r,!0).length||i.length<=Q(e.oldRange,r.after,n,r,!1).length))for(const s of i)a&&!t.some(e=>U(e,s,n))||o.push({...e,unresolved:!1,before:null,after:s,kind:"content",input:r.before&&r.after?2:1,priority:2,matches:[r]})}return o}function p(e,t){if(e?.node&&t(e.node))return e.node;for(const n of e?.children||[]){const e=p(n,t);if(e)return e}return null}function m(e){return p(e,()=>!0)}function h(e){return e.getClientRects().length&&"visible"===e.ownerDocument.defaultView.getComputedStyle(e).visibility}function g(e){return p(e,h)}function v(e){return/^(?:button|input|select|textarea)$/.test(e.tag)||e.attributes.some(([e,t])=>"role"===e&&"button"===t)}function w(e){return/^(?:img|video|audio|iframe|canvas|object|embed)$/.test(e.tag)||e.media?.some(Boolean)}function y(e){return!v(e)&&(e.text||w(e)||"hr"===e.tag||e.children.some(y))}function b(e,t,n,o){const r=new Map(t.map(e=>[e[n].node,e[o]]));return!(!e||r.has(null)||r.size!==t.length)&&(function e(t){const n=r.get(t.node);if(!n)return t.children.every(e);r.delete(t.node);const o=new Map,i=new Map;n.forEach((e,t)=>{e.marker&&o.set(e.marker,t),i.set(M(e),t)});const a=[],s=new Map;if(!function e(t,r=!1){if(r||=t.attributes.some(([e,t])=>"inert"===e||"aria-hidden"===e&&"true"===t),"img"!==t.tag)return t.children.every(t=>e(t,r));const l=o.get(t.marker)??i.get(M(t));return!(!n[l]||!t.media.slice(0,2).some((e,t)=>e&&e===n[l].media[t])||(a.push({index:l,cloneHidden:r}),s.set(l,(s.get(l)??0)+1),0))}(t))return!1;const l=a.filter(({index:e,cloneHidden:t})=>!t||1===s.get(e));return l.length===n.length&&l.every(({index:e},t)=>e===t)}(e)&&!r.size)}function x(e){const t=e.children.map(function e(t){return"img"===t.tag?[t]:t.children.flatMap(e)});return t.some(e=>1!==e.length||!e[0].media?.slice(0,2).some(Boolean))?null:t.map(([e])=>e)}function M(e){return JSON.stringify(e.media.slice(0,2))}function S(e,t,n,o=e.querySelector('main, [role="main"]')||e.querySelector("article")||e.body){if(!o)return null;const r=n.filter(e=>{if("string"!=typeof e||!e.trim())return!1;try{return o.matches(e),!0}catch{return!1}}).join(", "),i=new Map,a=new Map;if(e!==t)for(const e of t.querySelectorAll("[data-mtflpp-node]")){const t=e.getAttribute("data-mtflpp-node");a.set(t,a.has(t)?null:e)}for(const n of[o,...o.querySelectorAll("*")]){if(r&&n.closest(r))continue;const o=[...n.childNodes].filter(e=>3===e.nodeType).map(e=>e.textContent),s=C(o.join(" ")),l=["img","source","video","audio","iframe"].includes(n.localName)?["src","srcset","poster"].map(e=>n.getAttribute(`data-${e}`)||n.getAttribute(e)||""):[],c=n.style?.backgroundImage||n.getAttribute("data-bg")||"",d=n.getAttribute("data-mtflpp-node"),u=e===t?n:a.get(d)||null,f=E(n,u,JSON.stringify([n.localName,s,l,c]));"img"===n.localName&&(f.marker=d),f.text=s,f.rawText=o.join(""),f.media=[...l,c],f.parent=i.get(n.parentElement),i.set(n,f),f.parent?.children.push(f)}for(const[e,t]of i)t.parts=[...e.childNodes].map(e=>3===e.nodeType?e.textContent:i.get(e)).filter(e=>void 0!==e);let s=i.get(o);if(!s)return null;const l=s.node;for(let e=o.parentElement;e;e=e.parentElement){const t=E(e,l,e.localName);t.children=[s],t.parts=[s],s=t}return s.excluded=r,s}function E(e,t,n){const o=function(e){const t=[];for(const{name:n,value:o}of e.attributes){if("data-mtflpp-node"===n||n.startsWith("on")||/(?:^|-)(nonce|token)(?:-|$)/.test(n))continue;if(/^(?:data-)?(?:src|srcset|poster|sizes|bg)$/.test(n))continue;let r=o;"class"===n&&(r=[...e.classList].sort().join(" ")),"style"===n&&(r=[...e.style].sort().map(t=>[t,e.style.getPropertyValue(t),e.style.getPropertyPriority(t)])),("class"!==n&&"style"!==n||r.length)&&t.push([n,r])}return t.sort(([e],[t])=>e.localeCompare(t))}(e);return{node:t,tag:e.localName,signature:n,attributes:o,children:[],parts:[],presentation:JSON.stringify(o.filter(([e])=>!k(e))),references:JSON.stringify(o.filter(([e])=>k(e)))}}function k(e){return["id","for","headers","aria-controls","aria-labelledby","aria-describedby","aria-owns","aria-flowto","aria-activedescendant","aria-details","aria-errormessage"].includes(e)}function P(e,t,n,o=!1){const r=new Map,i=new Map,a=new Map,s=new Map,l=[];let c,d;function u(o,r,i,a=[]){const s=(e,t)=>e===t||ee(e,t);let l=!1;if(a.length){d??=[N(e,new Set(a)),N(t,new Set(a))];const n=(e,t,n)=>t.node?.isConnected&&e.node?.contains(t.node)&&"img"===t.node.localName&&(!n||!t.node.closest(n));for(const i of a){const a=d[0].get(i),c=d[1].get(i);if(a&&c){if(!s(o,a)||!s(r,c))return!1;l||=n(o,a,e.excluded)&&n(r,c,t.excluded)}}}if(!i.length)return l;if(!c){const o=new Set((n.boundaryGroups??[n.groups]).flat(2));c=[z(e,o),z(t,o)]}const[u,f]=c,p=new Map;for(const e of i.flat()){const t=u.get(e),n=f.get(e);if(t&&n){if(!s(o,t.entry)||!s(r,n.entry))return!1;p.set(e,t.substantive&&n.substantive)}}return l||i.some(e=>e.every(e=>p.has(e))&&e.some(e=>p.get(e)))}function f(e){const t=JSON.stringify(e);return r.has(t)||r.set(t,r.size+1),r.get(t)}function p(e){if(!e)return 0;const t=f([e.signature,e.children.map(p)]);return i.set(e,t),a.set(e,f([t,e.presentation,e.children.map(e=>a.get(e))])),s.set(e,f([t,e.presentation,e.references,e.children.map(e=>s.get(e))])),t}p(e),p(t);const m=e=>i.get(e);function h(e){const t=e.attributes.find(([e])=>"id"===e)?.[1];return t?`${e.tag} ${t}`:void 0}function g(e){if(!(e.children.length<2))return f(["collection",e.signature,e.children.map(m).sort((e,t)=>e-t)])}function v(e,t){const n=new Map;return e.forEach((e,o)=>{const r=t(e);void 0!==r&&n.set(r,n.has(r)?-1:o)}),n}return function e(t,r){t&&r&&(t.signature!==r.signature?l.push({kind:"content",before:t,after:r,priority:2}):t.rawText!==r.rawText&&l.push({kind:"content",before:t,after:r,priority:2,spacing:!0}),t.presentation===r.presentation&&t.references===r.references||l.push({kind:"attributes",before:t,after:r,priority:t.presentation!==r.presentation?1:0}),function(t,r,c,d){const f=d.parent&&c.parent&&d.tag===c.tag,p=v(t,m),w=v(r,m);let y,b,x,M;const S=new Set(t.flatMap(e=>[a.get(e),s.get(e)])),E=new Set(r.flatMap(e=>[a.get(e),s.get(e)]));function k(e,t,n){const o=n.get(e),r=n.get(t);return o===r||!E.has(o)&&!S.has(r)}function P(e,t){return i.get(e)===i.get(t)&&k(e,t,a)&&k(e,t,s)}function C(e,n,o,a,s,c,u){const m=t.slice(e,n),h=r.slice(o,a),g="replacement"===s&&f&&m.some(e=>!w.has(i.get(e)))&&h.some(e=>!p.has(i.get(e)))&&(!function(e,t){if(e.length<2||t.length<2)return!1;const n=e.filter(e=>e.children.length).length,o=t.filter(e=>e.children.length).length;if(!n&&!o||n>1&&o>1)return!0;const r=new Map;for(const{tag:e}of t)r.set(e,(r.get(e)||0)+1);let i=0;for(const{tag:t}of e){const e=r.get(t);if(e){if(2===++i)return!0;r.set(t,e-1)}}return!1}(m,h)||"form"===d.tag&&function(e,t){function n(e){const t=new Set;return e.every(function e(n){if(["input","select","textarea"].includes(n.tag)){const e=n.attributes.find(([e])=>"name"===e)?.[1],o=n.attributes.find(([e])=>"type"===e)?.[1]?.toLowerCase();return!(!e||"input"===n.tag&&"hidden"===o||(t.add(e),0))}let o=!1;for(const t of n.children)e(t)&&(o=!0);return o})?t:null}const o=n(e),r=n(t);return o&&r&&[...o].some(e=>!r.has(e))&&[...r].some(e=>!o.has(e))}(m,h)),v=f&&("reorder"===s||g)?s:void 0;l.push({kind:"region",after:d,priority:2,unresolved:!0,regionChange:v,oldRange:m,newRange:h,moved:c,boundary:u})}function L(e,n,o,r,i,a,s){const l=[];for(let c=e;c<n;c++){const e=s(t[c]),n=a.get(e);if(!(i.get(e)!==c||void 0===n||n<o||n>=r)){if(l.length&&n<=l[l.length-1][1])return null;l.push([c,n])}}return l}!function s(c,S,E,k){for(;c<S&&E<k&&P(t[c],r[E]);)e(t[c],r[E]),c++,E++;for(;c<S&&E<k&&P(t[S-1],r[k-1]);)S--,k--,e(t[S],r[k]);if(c===S&&E===k)return;if(c===S||E===k){const e=E===k,n=e?t.slice(c,S):r.slice(E,k),o=e?[r[E-1],r[E]]:[t[c-1],t[c]];return void(n.some(e=>o.some(t=>t&&i.get(t)===i.get(e)))?C(c,S,E,k):e?l.push({kind:"delete",after:d,removed:n,priority:2,following:r.slice(E),preceding:r.slice(0,E).reverse()}):l.push({kind:"insert",after:n[0],added:n,priority:2}))}if(S-c===1&&k-E===1)return void e(t[c],r[E]);const V=function(e,i,a,s){if(!(n?.groups.length||o&&(n?.boundaryGroups||n?.images.length)))return;const l=Math.abs(n.offset)+1;if(i-e!==l||s-a!==l)return;const c=n.offset>0,d=c?0:l-1,u=c?l-1:0,f=t.slice(e,i),p=r.slice(a,s),m=c?l-1:1,h=f.map((e,t)=>[e,p[(t+m)%l]]);return{before:f,after:p,from:d,to:u,pairs:h}}(c,S,E,k),T=V&&function(e){const t=o?n.images:[];if(!n.groups.length&&!t.length)return;const[r,i]=e.pairs[e.from],a=m(r);return-1!==p.get(a)&&-1!==w.get(a)&&e.pairs.every(([e,t])=>P(e,t))&&u(r,i,n.groups,t)?i:void 0}(V),O=V&&function(e){if(o&&n.boundaryGroups&&_(e.before[e.from])&&e.pairs.every(([e,t])=>a.get(e)===a.get(t)))return e.pairs.filter((t,n)=>n!==e.from).every(([e,t],o)=>u(e,t,n.boundaryGroups[o]))?{before:e.before,after:e.after,index:e.to||1}:void 0}(V);if(T||O||f&&function(e,n,o,a){const s=n-e;if(s<2||s!==a-o)return!1;const l=new Map;let c=!1;for(let n=0;n<s;n++){const a=i.get(t[e+n]),s=i.get(r[o+n]);c||=a!==s,l.set(a,(l.get(a)||0)+1),l.set(s,(l.get(s)||0)-1)}return c&&[...l.values()].every(e=>0===e)}(c,S,E,k)){if(O)for(const[t,n]of V.pairs)e(t,n);return void C(c,S,E,k,"reorder",T,O)}let j=L(c,S,E,k,p,w,m);if(0===j?.length&&(y??=v(t,h),b??=v(r,h),j=L(c,S,E,k,y,b,h)),0===j?.length&&(x??=v(t,g),M??=v(r,g),j=L(c,S,E,k,x,M,g)),j?.length)for(const[n,o]of[...j,[S,k]])s(c,n,E,o),n<S&&e(t[n],r[o]),c=n+1,E=o+1;else C(c,S,E,k,j?"replacement":void 0)}(0,t.length,0,r.length)}(t.children,r.children,t,r))}(e,t),l}function C(e){return e.replace(/\s+/g," ").trim()}function L(e,t){return e!==t&&e.replace(/\s/g,"")===t.replace(/\s/g,"")}function V(e,t,n){for(;e.node?.isConnected&&e.parent?.node;){const{display:t}=e.node.ownerDocument.defaultView.getComputedStyle(e.node);if("inline"!==t&&"contents"!==t)break;e=e.parent}if(!t.has(e)){const{node:o}=e,r=[],i=o?.isConnected&&T(o,n,r)===O(e)&&g(e)?o.innerText:void 0;t.set(e,"string"==typeof i?{text:i,omitted:JSON.stringify(r)}:void 0)}return t.get(e)}function T(e,t,n){return t&&e.querySelector(t)?[...e.childNodes].map(e=>3===e.nodeType?e.textContent:1!==e.nodeType?"":e.matches(t)?(n.push(e.textContent),""):T(e,t,n)).join(""):e.textContent}function O(e){return e.parts.map(e=>"string"==typeof e?e:O(e)).join("")}function j({before:e,after:t}){return R(e.rawText,t.rawText)||R(O(e),O(t))}function R(e,t){if(!/\S/.test(e)||!L(e,t))return;const n=e.match(/\s+|\S+/g),o=t.match(/\s+|\S+/g);let r=0,i=0;for(;r<Math.min(n.length,o.length)&&n[r]===o[r];)r++;for(;i<Math.min(n.length,o.length)-r&&n.at(-1-i)===o.at(-1-i);)i++;const a=Math.max(0,r-1),s=Math.max(0,i-1);return{type:"spacing",before:n.slice(a,n.length-s).join(""),after:o.slice(a,o.length-s).join("")}}function H(e,t=new Map){return e?(t.has(e)||t.set(e,(e.parts||[]).map(e=>{if("string"==typeof e)return e;const n=H(e,t);return/^(?:p|div|section|article|main|aside|header|footer|nav|h[1-6]|li|[ou]l|d[ldt]|blockquote|pre|table|tr|t[dh]|caption|figure|figcaption|br|hr)$/.test(e.tag)?` ${n} `:n}).join("")),t.get(e)):""}function A(e,t){return!!e&&!!t&&Object.entries(t).some(([t,n])=>{if(!["order","gallery-order"].includes(n?.type)||!Object.hasOwn(e,t))return!1;const o=e[t];return o?.type===n.type&&o.members===n.members&&o.value!==n.value})}function $(e,t,n,o){return e.fieldsByRow?.[t]?.every(e=>""===D(n[e],o)?.label)}function _(e){return!e.text&&!e.media?.some(Boolean)&&!/^(?:a|button|input|select|textarea|form|details|img|video|audio|iframe|canvas|svg|object|embed)$/.test(e.tag)&&e.children.every(_)}function N(e,t){const n=new Map;return e&&function e(o){if("img"===o.tag){const e=o.attributes.find(([e])=>"alt"===e)?.[1];t.has(e)&&n.set(e,n.has(e)?null:o)}o.children.forEach(e)}(e),n}function F(e,t,n,o,r,{html:i,peerLabels:a}){const{fieldsByRow:s}=r[e],l=o[e].fieldsByRow;if([t,...n].some(e=>!l?.[e]||!s?.[e]))return[];const c=[],d=new Set(l[t]);let u;function f(e,t){if(a.has(e))return a.get(e);const n=new Set;function o(e,t){n.add(C(H(e,t)));for(const n of e.children)o(n,t)}for(const r of e){if("row-image"===t[r]?.type)continue;const e=B(t[r],i);if(!e.length)return null;for(const t of e)t.entry?o(t.entry,t.cache):n.add(t.label)}return a.set(e,n),n}function p(e,t){return u??=n.flatMap(e=>[f(l[e],o),f(s[e],r)]),u.some(n=>!n||n.has(e)||t.length&&t.every(e=>n.has(e)))}for(const e of s[t]){const t=r[e],n=o[e];if(d.has(e)&&t&&n?.type===t.type&&n?.value===t.value)for(const{entry:e,cache:o,label:r}of B(t,i,n.formatted===t.formatted)){if(!r)continue;if(!e){p(r,[])||c.push([r]);continue}const t=q(e,o).map(e=>C(H(e,o))),n=z(e,new Set([r,...t]),o);n.get(r)?.substantive&&!p(r,t.join(" ")===r?t:[])&&c.push([r]);const i=[...new Set(t.filter(e=>n.has(e)))];i.length>1&&i.some(e=>n.get(e).substantive)&&!p(r,i)&&c.push(i)}}return c}function B(e,t,n=!0){const o=D(e,t);if(!o)return[];const r=n&&"html"===e.type&&"string"==typeof e.formatted?D({type:"html",value:e.formatted},t):null;return r?[o,r]:[o]}function D(e,t){if("string"==typeof e?.value){if("text"===e.type)return{label:C(e.value)};if("html"===e.type){if(!t.has(e.value))try{const n=(new DOMParser).parseFromString(e.value,"text/html"),o=S(n,n,[],n.body),r=new Map;t.set(e.value,{entry:o,cache:r,label:C(H(o,r))})}catch{t.set(e.value,null)}return t.get(e.value)}}}function q(e,t){const n=e.children.flatMap(e=>q(e,t));return n.length||!/^(?:p|h[1-6]|li|d[dt]|blockquote|pre|figcaption)$/.test(e.tag)?n:C(H(e,t))?[e]:[]}function W(e,t,n){let o;(e.text===t||/[\p{L}\p{N}]/u.test(e.text||""))&&(o=function(e,t){let n="content";for(let o=e;o;o=o.parent){const r=o.attributes.find(([e])=>"role"===e)?.[1]??"";if("button"===o.tag||/(?:^|\s)button(?:\s|$)/.test(r))return;if("a"!==o.tag&&!/(?:^|\s)link(?:\s|$)/.test(r))continue;const i=q(o,t);if(i.length<2||!i.some(e=>/^h[1-6]$/.test(e.tag)))return;const a=i.find(t=>t===e||ee(t,e));if(!a)return;/^h[1-6]$/.test(a.tag)||(n="support")}return n}(e,n));for(const r of e.children){if("content"===o)break;o=W(r,t,n)||o}return o}function z(e,t,n=new Map){const o=new Map;e&&function e(r){const i=C(H(r,n));if(t.has(i)){const e=o.get(i);o.set(i,void 0===e||e&&ee(e,r)?r:null)}r.children.forEach(e)}(e);const r=new Map;for(const[e,t]of o){const o=t&&W(t,e,n);o&&r.set(e,{entry:t,substantive:"content"===o})}return r}function I(e,t){let n=0,o=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;for(;o<e.length-n&&o<t.length-n&&e[e.length-o-1]===t[t.length-o-1];)o++;let r=e.length-o,i=t.length-o;for(;n>0&&/\S/.test(e[n-1]);)n--;if(r>n&&/\S/.test(e[r-1]))for(;r<e.length&&/\S/.test(e[r]);)r++;if(i>n&&/\S/.test(t[i-1]))for(;i<t.length&&/\S/.test(t[i]);)i++;return{before:e.slice(n,r).trim(),after:t.slice(n,i).trim()}}function Z(e,t){return t?J(e,t):""===C(e)}function J(e,t){return G(e,t,1)>0}function G(e,t,n=1/0){if(!t)return 0;let o=0,r=(e=C(e)).indexOf(t);for(;-1!==r;){const i=r+t.length;if(X(e,r)&&X(e,i)&&++o===n)break;r=e.indexOf(t,r+1)}return o}function X(e,t){return!/[\p{L}\p{N}_]$/u.test(e.slice(Math.max(0,t-2),t))||!/^[\p{L}\p{N}_]/u.test(e.slice(t,t+2))}function Y(e,t,n,o=!1){const r=C(e),i=C(t);if(r===i)return!1;if(r===n.before&&i===n.after||r===n.fullBefore&&i===n.fullAfter)return!0;if(o){const e=I(r,i);if(e.before===n.before&&e.after===n.after)return!0;if(function(e,t,n,o){if(!n||!o||e.length-n.length!==t.length-o.length)return!1;for(let r=e.indexOf(n);-1!==r;r=e.indexOf(n,r+1))if(t.startsWith(o,r)&&X(e,r)&&X(t,r)&&X(e,r+n.length)&&X(t,r+o.length)&&e.slice(0,r)===t.slice(0,r)&&e.slice(r+n.length)===t.slice(r+o.length))return!0;return!1}(r,i,n.fullBefore,n.fullAfter))return!0}return(n.before?G(r,n.before)>G(i,n.before):!r)&&(n.after?G(i,n.after)>G(r,n.after):!i)}function U(e,t,n){return e.tag!==t.tag||(e.children.length||t.children.length)&&e.text!==t.text&&C(n(e))===C(n(t))}function Q(e=[],t,n,o,r){return e.flatMap(e=>{const i=Q(e.children,t,n,o,r);let a;return a="media"===o.type?e.media?.includes(t):"attribute"===o.type?e.attributes.some(([e,n])=>e===o.name&&J("string"==typeof n?n:JSON.stringify(n),t)):("markup"!==o.type||e.tag===(r?o.oldTag:o.newTag))&&Z(n(e),t),"text"===o.type&&i.length?i:[...a?[e]:[],...i]})}function K(e,t,n){if(e.unresolved)return 0;if(e.matches=[],e.spacing){const n=t.filter(e=>"spacing"===e.type),o=n.length&&j(e);return e.matches=n.filter(e=>o?.before===e.before&&o?.after===e.after),e.matches.length?2:0}let o=0;for(const r of t){if("spacing"===r.type)continue;let t=0;if("attributes"===e.kind){if(!["text","attribute"].includes(r.type))continue;const n=new Map(e.before.attributes),o=new Map(e.after.attributes);for(const e of new Set([...n.keys(),...o.keys()])){if("attribute"===r.type&&e!==r.name)continue;const i=n.get(e),a=o.get(e);JSON.stringify(i)!==JSON.stringify(a)&&(Y("string"==typeof i?i:JSON.stringify(i)||"","string"==typeof a?a:JSON.stringify(a)||"",r)&&(t="attribute"===r.type||r.before&&r.after?2:1))}}else if("insert"===e.kind)!r.before&&e.added.some(e=>J(n(e),r.after))&&(t=Math.max(t,1));else if("delete"===e.kind)!r.after&&e.removed.some(e=>J(n(e),r.before))&&(t=Math.max(t,1));else if("media"===r.type)(e.before?.media||[]).some((t,n)=>t===r.before&&e.after?.media?.[n]===r.after)&&(t=2);else if("markup"===r.type)e.before?.tag===r.oldTag&&e.after?.tag===r.newTag&&U(e.before,e.after,n)&&Z(n(e.before),r.before)&&Z(n(e.after),r.after)&&(t=r.before&&r.after?2:1);else if("text"===r.type){const o=!(!r.before||!r.after),i=o&&Y(e.before?.text||"",e.after?.text||"",r,!0);(i||Y(n(e.before),n(e.after),r,o))&&(t=o?2:1,i&&(e.directInput=!0))}t&&e.matches.push(r),o=Math.max(o,t)}return o}function ee(e,t){return!!e?.children.some(e=>e===t||e.node&&e.node===t?.node||ee(e,t))}const te=new Set(["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","PageDown","PageUp","Home","End"," "]);function ne(e,t){let n;for(const o of e?.rects??[]){const e=t(o);if(e.visible)return e;(!n||e.distance<n.distance)&&(n=e)}return n}function oe(e){return new Promise(t=>{const n=()=>{e.clearTimeout(o),e.cancelAnimationFrame(r),t()},o=e.setTimeout(n,100);let r=e.requestAnimationFrame(()=>{r=e.requestAnimationFrame(n)})})}function re(e,t=!1){if(!ue(e,{visibilityProperty:!0,opacityProperty:!0}))return;const{left:n,right:o,top:r,bottom:i,width:a,height:s}=e.getBoundingClientRect();if(!(t||a&&s))return;const l=e.ownerDocument,{documentElement:c,body:d,defaultView:u}=l,f={left:n,right:a?o:n+1,top:r,bottom:s?i:r+1},p={...f},m={x:f.right-f.left,y:f.bottom-f.top},h="visible"===u.getComputedStyle(c).overflow,g=u.getComputedStyle(e);for(let n=e;n&&n!==c;){const o=n===e?g:u.getComputedStyle(n),{position:r,display:i,overflowX:a,overflowY:s}=o;if(n!==e&&(n!==d||!h)&&"inline"!==i&&("visible"!==a||"visible"!==s)&&n.offsetWidth&&n.offsetHeight){const{bounds:e,scaleX:r,scaleY:i}=de(n,o);for(const[l,c,d,u,h]of[["x",a,"left","right",r],["y",s,"top","bottom",i]]){if("visible"===c)continue;const r="clip"===c?[0,0]:ce(n,o,l,h),i=t&&"hidden"===c,a="y"===l==("horizontal-tb"===o.writingMode);if(i&&r.some(e=>e)&&(a||f[d]<e[d]||f[u]>e[u]||ie(o,g,l)))return{boundary:n};if(!le(f,p,e,d,u,i?[0,0]:r))return{boundary:n};m[l]=Math.min(m[l],p[u]-p[d])}}n="absolute"===r||"fixed"===r?n.offsetParent:n.parentElement}return{clipped:f,extent:m}}function ie(e,t,n){const o=e=>e&&"auto"!==e&&0!==parseFloat(e);return("x"===n?["Left","Right"]:["Top","Bottom"]).some(n=>o(e[`scrollPadding${n}`])||o(t[`scrollMargin${n}`]))}function ae(e,t,n=!1){const o=re(e,n);if(!o?.clipped)return;const{clipped:r,extent:i}=o,{ownerDocument:a}=e,s=a.documentElement;if(r.left=Math.max(s.clientLeft,r.left),r.right=Math.min(s.clientLeft+s.clientWidth,r.right),r.top=Math.max(0,r.top),r.bottom=Math.min(s.clientHeight,r.bottom),r.right<=r.left)return{rects:[]};const l=t?.({...r,top:0,bottom:s.clientHeight}),c=l?.visibleCenterX??(r.left+r.right)/2,d=ve(e,c);if(r.bottom<=r.top)return{rects:[],header:d?.bottom};const u={rects:[r],inViewport:!0,extent:i};if(!d)return u;const f={left:Math.max(r.left,d.left),right:Math.min(r.right,d.right),top:Math.max(r.top,d.top),bottom:Math.min(r.bottom,d.bottom)};if(!se(f)||!d.node.contains(a.elementFromPoint(c,(f.top+f.bottom)/2)))return u;const p=[{...r,top:f.bottom},{...r,bottom:f.top},{...f,left:r.left,right:f.left},{...f,left:f.right,right:r.right}].filter(se);return!p.length&&d.bottom>=s.clientHeight&&d.top<=0?void 0:{rects:p,inViewport:!0,extent:i,header:d.bottom}}function se({left:e,right:t,top:n,bottom:o}){return t>e&&o>n}function le(e,t,n,o,r,[i,a]){return e[o]=Math.max(e[o],n[o]),e[r]=Math.min(e[r],n[r]),t[o]=Math.max(n[o],t[o]+i),t[r]=Math.min(n[r],t[r]+a),t[r]>t[o]}function ce(e,t,n,o){const r="x"===n,i=r?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight;if(i<=0)return[0,0];const a=r?e.scrollLeft:e.scrollTop,s=t.display.endsWith("flex")&&t.flexDirection===(r?"row-reverse":"column-reverse"),l=(r&&"rtl"===t.direction)!==s;let c=l?-i:0,d=l?0:i;return("horizontal-tb"!==t.writingMode||a<c||a>d)&&(c=-i,d=i),[(a-d)*o,(a-c)*o]}function de(e,t){const n=e.getBoundingClientRect(),o=n.width/e.offsetWidth,r=n.height/e.offsetHeight,i=n.left+e.clientLeft*o,a=n.top+e.clientTop*r,s={left:i,top:a,right:i+e.clientWidth*o,bottom:a+e.clientHeight*r},l=t.overflowClipMargin;if("clip"!==t.overflowX&&"clip"!==t.overflowY||!l||"0px"===l)return{bounds:s,scaleX:o,scaleY:r};const c=l.split(" ").map(parseFloat).find(Number.isFinite)??0,d=l.includes("border-box")?n:s,u=l.includes("content-box");return{scaleX:o,scaleY:r,bounds:{left:d.left+((u?parseFloat(t.paddingLeft):0)-c)*o,right:d.right-((u?parseFloat(t.paddingRight):0)-c)*o,top:d.top+((u?parseFloat(t.paddingTop):0)-c)*r,bottom:d.bottom-((u?parseFloat(t.paddingBottom):0)-c)*r}}}function ue(e,t={visibilityProperty:!0}){return!!e?.isConnected&&!!e.getClientRects().length&&(!e.checkVisibility||e.checkVisibility(t))&&"visible"===e.ownerDocument.defaultView.getComputedStyle(e).visibility}function fe(e){return e.matchMedia("(prefers-reduced-motion: reduce)").matches?"instant":"smooth"}function pe(e,{behavior:t,header:n=ge(e),nearest:o=!1}={}){const r=e.ownerDocument,i=r.defaultView,a=t??fe(i);if(o&&!n)return void e.scrollIntoView({behavior:a,block:"nearest",inline:"nearest"});const s=i.getComputedStyle(e).scrollMarginTop,l=r.documentElement,c=l.clientHeight,d=i.getComputedStyle(l),u=he(d.scrollPaddingTop,c),f=he(d.scrollPaddingBottom,c);let p,m;try{let t=o?"nearest":"start";if(o){const e=n-parseFloat(s);null!==u&&e>u&&(p=l.getAttribute("style"),l.style.setProperty("scroll-padding-top",`${e}px`,"important"))}else{const t=n>0&&null!==u?`max(${s}, ${n-u}px)`:s;m=e.getAttribute("style"),e.style.setProperty("scroll-margin-top",`calc(${t} + 1lh)`,"important")}if(!o&&null!==u&&null!==f){const n=i.getComputedStyle(e),o=c-u-f-parseFloat(n.scrollMarginTop)-parseFloat(n.scrollMarginBottom),r=o-e.getBoundingClientRect().height;if(r>=0&&(t="center"),r>0&&"horizontal-tb"===d.writingMode){const e=Math.min(o/3,r);p=l.getAttribute("style"),l.style.setProperty("scroll-padding-bottom",`${f+e}px`,"important")}}e.scrollIntoView({behavior:a,block:t,inline:"nearest"})}finally{void 0!==p&&me(l,p),void 0!==m&&me(e,m)}}function me(e,t){e.setAttribute("style",t??""),null===t&&e.removeAttribute("style")}function he(e,t){if("auto"===e)return 0;const n=parseFloat(e);return Number.isFinite(n)?n*(e.endsWith("%")?t/100:1):null}function ge(e){const t=e.getBoundingClientRect();return ve(e,t.left+t.width/2)?.bottom??0}function ve(e,t){const n=e.ownerDocument;for(let o=n.elementFromPoint(t,1);o&&!o.contains(e);o=o.parentElement){const e=n.defaultView.getComputedStyle(o);if("fixed"!==e.position&&"sticky"!==e.position)continue;if("0"===e.opacity||!ue(o,{visibilityProperty:!0,opacityProperty:!0}))continue;const{left:t,right:r,top:i,bottom:a}=o.getBoundingClientRect();if("fixed"===e.position||i<=parseFloat(e.top)+1)return{node:o,left:t,right:r,top:i,bottom:a}}}function we(e,t,{inlineLauncher:n,nativeLauncher:o}={}){const r=e.strings,i=e.termId??e.postId,a=window,s=function(){let e,t=0,n=0;return{remember(e){try{e&&(t=e.defaultView.scrollY)}catch{}},async restore(e,o,r=()=>!0,i){const a=++n;try{const s=e.defaultView;let l;if(s.scrollTo({top:t,left:0,behavior:"instant"}),o?.ownerDocument===e&&r()){if(await oe(s),a!==n||o.ownerDocument!==e||!r())return;if(function(e,t){const n=e.ownerDocument;for(let t=e;t;t=t.parentElement)if("until-found"!==t.getAttribute("hidden")?.toLowerCase()&&(t.hasAttribute("hidden")||"none"===n.defaultView.getComputedStyle(t).display))return!1;let o=!1;for(let r=e;r&&e.isConnected&&e.ownerDocument===n&&t();r=r.parentElement){if("until-found"===r.getAttribute("hidden")?.toLowerCase()){if(r.dispatchEvent(new n.defaultView.Event("beforematch",{bubbles:!0})),!(e.isConnected&&e.ownerDocument===n&&r.isConnected&&r.ownerDocument===n&&r.contains(e)&&t()))break;"until-found"===r.getAttribute("hidden")?.toLowerCase()&&r.removeAttribute("hidden"),o=!0}const i=r.parentElement;i instanceof n.defaultView.HTMLDetailsElement&&!i.open&&r!==Array.from(i.children).find(e=>"summary"===e.localName)&&(i.open=!0,o=!0)}return o}(o,()=>a===n&&r())&&await new Promise(e=>s.setTimeout(e,0)),a!==n||!r())return;const t=o.ownerDocument===e?function(e){if(!e?.isConnected)return null;const t=re(e,!0);if(t?.clipped)return e;if(!t?.boundary)for(const t of e.querySelectorAll("*"))if(re(t,!0)?.clipped)return t;for(let n=t?.boundary||e.parentElement;n;){const e=re(n,!0);if(e?.clipped)return n;n=e?.boundary||n.parentElement}return null}(o):null;t&&(function(e,t){const n=ae(e,t,!0);if(!n?.inViewport)return void pe(e);const{rects:o,extent:r,header:i=0}=n,a=e.ownerDocument.documentElement,s=Math.min(r.x,a.clientWidth),l=Math.min(r.y,a.clientHeight-i);o.some(e=>e.right-e.left>=s-1&&e.bottom-e.top>=l-1)?t&&ne(n,t)?.reveal(fe(e.ownerDocument.defaultView)):pe(e,{nearest:!0,header:i})}(t,i),o.contains(t)&&(l=t))}return t=s.scrollY,l}catch{}},keepInView(t,{canvas:n,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:a,canFollow:s}){try{const l=e?.target===t&&e.canFollow();if(e?.cancel(),!t.isConnected||!s())return;if(!l){const e=ae(t,o);if(!ne(e,o)?.visible)return}const c=new AbortController,d={target:t,canFollow:()=>!c.signal.aborted&&s(),cancel(){c.abort(),e===d&&(e=null)}};return e=d,function(e,t,n,o,r){const i=e=>{e.isTrusted&&("keydown"!==e.type||te.has(e.key))&&r()},a={capture:!0,passive:!0,signal:o};for(const n of[e,t])for(const e of["wheel","touchmove","pointerdown","keydown"])n?.addEventListener(e,i,a);t?.addEventListener("scroll",()=>{n?.()&&r()},a)}(t.ownerDocument.defaultView,n,a,c.signal,()=>{d.cancel(),i?.()}),async function(e,t,n,o){try{const r=e.ownerDocument.defaultView;if(await oe(r),!o())return;const{scrollX:i,scrollY:a}=r,s=n();if(s&&await s,!o()||r.scrollX!==i||r.scrollY!==a)return;let l=ae(e,t);l&&!l.rects.length&&(pe(e,{behavior:"instant",header:l.header}),l=ae(e,t)),ne(l,t)?.reveal()}catch{}}(t,o,r,d.canFollow).finally(d.cancel)}catch{}}}}(),l=d(r,{postTitle:t.title??e.postTitle,publicRedirect:e.publicRedirect,inlineLauncher:n,nativeLauncher:o,onOpen:()=>R(),onClose:()=>j(),onRefresh:H,onRetry:e=>e?R(!0):H(),beforeViewportChange:e=>h.beforeViewportChange(e),beforeMove:O,afterMove:()=>{p&&H()}});let c,f,p=!1,m=0;const h=function(e,t,n,o,r=[]){const i=u(r);let a,s,l,c,d;function f(){d?.()}return{get hasPreview(){return!!a},get hasHtmlPreview(){return!!s},get redirectDestination(){return c},load:function(r,u,p=()=>!1,m){const h=new URL(r);if("https:"!==h.protocol&&"http:"!==h.protocol)throw Object.assign(new Error(n.failed),{code:"mtflpp_preview_unsupported_url"});if(h.origin!==window.location.origin){const e=n.originMismatch.replace("%s",()=>h.origin+h.pathname);throw Object.assign(new Error(e),{code:"mtflpp_preview_origin_mismatch"})}const g=h.searchParams.get("mtflpp_token");if(!g)throw new Error(n.failed);return window.crossOriginIsolated&&h.searchParams.set("mtflpp_isolated","1"),f(),h.searchParams.delete("mtflpp_source"),e.followChanges&&h.searchParams.set("mtflpp_source","1"),o(n.updating),new Promise((r,f)=>{const v=e.stage.ownerDocument.createElement("iframe");v.title=n.title,v.className="mtflpp-frame mtflpp-loading",v.setAttribute("aria-hidden","true"),v.setAttribute("tabindex","-1"),v.referrerPolicy="same-origin";let w=!1,y=!1;const b=setTimeout(()=>M(new Error(n.failed)),3e4),x=()=>{y=!0,M()};function M(e){w||(w=!0,e&&(y=!0),clearTimeout(b),d===x&&(d=null),v!==a&&(v.onload=null,v.onerror=null,v.remove()),e?f(e):r())}d=x,v.onload=async()=>{const r=v!==a;if(r||(s=null,l=null),y||!u())return void M();let d,f,w;try{const e=v.contentDocument,t=e?.querySelector('meta[name="meet-the-frontend-live-preview-panel"]');t?.content===g?d=e:r&&!t&&(f=function(e,t){if("text/html"!==e?.contentType)return;const n=e.defaultView?.performance.getEntriesByType("navigation")[0];if(!(n?.redirectCount>0))return;const o=new URL(n.name);return o.origin!==t.origin||o.pathname===t.pathname&&o.search===t.search?void 0:o.pathname}(e,h))}catch{}d&&(e.followChanges&&i.capture(d,r?m:void 0),d.documentElement.style.setProperty("overscroll-behavior","contain","important")),d&&r&&(t.remember(s),e.followChanges&&p()&&s&&(w=i.findChange(s,d))),r&&a&&(a.onload=null,a.onerror=null,a.remove()),a=v,s=d,l=null,c=f,v.classList.remove("mtflpp-loading"),v.removeAttribute("aria-hidden"),v.removeAttribute("tabindex");const b=()=>!y&&u()&&v===a&&d===s&&(!d||v.contentDocument===d);let x;if(d&&r){const n=e.canvasTarget&&(t=>e.canvasTarget(v,t,{fitTarget:!0}));x=await t.restore(d,w,()=>b()&&e.followChanges&&p(),n)}b()?(l=x,o(n.current,"ready"),M()):M()},v.onerror=()=>{v===a?(s=null,l=null,c=void 0,u()&&o(n.failed,"error")):M(new Error(n.failed))},v.src=h.href,e.stage.append(v)})},cancel:f,beforeViewportChange({canvasTarget:n,canFollow:o,...r}){const i=l,c=s,d=a;if(i&&c)return t.keepInView(i,{...r,canvasTarget:e=>n(d,e),canFollow:()=>i===l&&c===s&&d.contentDocument===c&&e.visible&&e.followChanges&&o()})},clear(){f(),t.remember(s),a&&(a.onload=null,a.onerror=null),a=null,s=null,l=null,c=void 0,e.clearPreview()}}}(l,s,r,k,e.comparisonExcludedSelectors);let g,v,w,y,b,x,M,S,E=!1;try{a.BroadcastChannel&&(S=new a.BroadcastChannel(`meet-the-frontend-live-preview-panel:${e.endpoint}:${i}:${e.userId}`),S.onmessage=e=>{"takeover"===e.data?.type&&p&&(j(!0),k(r.handedOff,"conflict",{reason:"handed-off"}))},a.addEventListener("pagehide",e=>{e.persisted||S.close()}))}catch{S?.close(),S=null}function k(e,n="loading",{canRetry:o=!0,reason:r=""}={}){"ready"===n&&(E=!1),l.report(e,n,{canTakeOver:!!S,hasPreview:h.hasPreview,canRetry:o,reason:r,hasHtmlPreview:h.hasHtmlPreview,redirectDestination:h.redirectDestination,canRefresh:p&&!t.saving&&["ready","error"].includes(n)&&("error"!==n||o)})}function P(e){const t=e?.code,n=function(e){const t=e?.code;return"mtflpp_post_locked"===t?"post-locked":"mtflpp_acf_rows_stale"===t?"reload-before-save":["mtflpp_invalid_nonce","rest_cookie_invalid_nonce","mtflpp_preview_conflict","mtflpp_source_changed","mtflpp_acf_unavailable","mtflpp_integration_failed"].includes(t)?"reload":["mtflpp_cannot_preview","rest_forbidden","rest_cannot_edit"].includes(t)?"permission":"mtflpp_preview_origin_mismatch"===t?"origin-mismatch":"mtflpp_preview_unsupported_url"===t?"unsupported-url":""}(e);n&&(p=!1,C(),h.cancel(),b?.()),k("string"==typeof t?e.message:r.failed,"post-locked"===n?"paused":"error",{reason:n,canRetry:!n})}function C(){clearTimeout(c),f=void 0}function L(e){if(void 0===e&&void 0===f)return;const t=performance.now();void 0!==e&&(f=t+e),clearTimeout(c);const n=Math.ceil(f-t);n>0?c=setTimeout(T,n):T()}function V(){p&&(m+=1,E=!0,h.cancel(),t.saving||k(r.stale,"stale"),t.saving||t.previewing?C():L(275))}function T(){if(!p||g||!1===t.ready||t.previewing||t.saving)return;C();const n=m;k(r.updating),g=(async()=>{try{if(await t.idle,!p||!1===t.ready||t.saving)return;const o=e.base;let i,a;w=t.preparePreview(l.followChanges);try{i=await w}catch(e){a=e}finally{w=null}if(await t.idle,!p||!1===t.ready||t.saving||o!==e.base)return;if(a)throw a;if("string"!=typeof i.url)throw Object.assign(new Error(i.message||r.failed),{code:i.code});p&&n===m&&await function(e,t,n){return h.load(e,()=>p&&t===m,()=>l.followChanges&&E,n)}(i.url,n,i.comparisonValues)}catch(e){p&&!t.saving&&P(e)}finally{g=null,L()}})()}function O(){m+=1,h.clear()}function j(e=!1){l.setVisible(e),p=!1,C(),O(),clearTimeout(M),M=null,x?.abort(),l.returnToEditor(),b?.()}async function R(n=!1){if(l.setVisible(!0),p)return;if(v)return void P(v);if(y){if(x&&!x.signal.aborted)return;const e=m;try{await y}catch{}return void(l.visible&&e===m&&R(n))}if(!1===t.ready)return void k(t.notReady,t.notReadyState??"paused",{canRetry:!1});if(!e.available)return void k(r.unavailable,"error",{canRetry:!1,reason:"unavailable"});if(!a.isSecureContext||!navigator.locks)return void k(r.browser,"error",{canRetry:!1,reason:"browser"});const o=n&&S?new AbortController:null;let s=!1;x=o,o?(k(r.waiting,"handover"),M=setTimeout(()=>{s=!0,o.abort()},15e3)):k(t.saving?r.saving:r.updating);try{const n=o?{signal:o.signal}:{ifAvailable:!0};if(y=navigator.locks.request(`meet-the-frontend-live-preview-panel:${e.endpoint}:${i}`,n,async e=>{if(clearTimeout(M),M=null,x=null,l.visible&&!o?.signal.aborted)if(e){k(t.saving?r.saving:r.updating);try{await new Promise(e=>{b=e,p=!0,m+=1,T()}),await g}finally{b=null}}else k(S?r.conflict:r.closeOther,"conflict",{reason:S?"other-tab":"manual"})}),o)try{S.postMessage({type:"takeover"})}catch(e){throw o.abort(),p&&j(!0),await y.catch(()=>{}),e}await y,l.visible&&s&&k(r.takeoverTimeout,"conflict",{reason:"busy"})}catch(e){p=!1,l.visible&&s?k(r.takeoverTimeout,"conflict",{reason:"busy"}):l.visible&&"AbortError"!==e.name&&P(e)}finally{clearTimeout(M),M=null,x=null,y=null}}function H(e=!0){t.saving||(e||(E=!1),p?(m+=1,h.cancel(),L(0)):R())}return{changed:V,pause:function(e=r.saving,t="loading"){return m+=1,C(),h.cancel(),(p||l.visible&&"paused"===t)&&k(e,t,{canRetry:!1}),w},resume:function(e){v=e,e?l.visible&&P(e):!l.visible||p||y?V():R()},setSuspended:l.setSuspended,setTitle:l.setTitle,openFromLauncher:l.openFromLauncher,start:()=>{l.visible&&R()},get pending(){return g}}}function ye(e,t,n,o){const r=window.acf;r.addAction("wysiwyg_tinymce_init",n);for(const e of["append","remove","sortstop","change_field"])r.addAction(e,t);const i=t=>{t[0]===e&&o?.()};function a(e){return!!e?.closest?.(".acf-field")}let s;return r.addAction("validation_failure",i),window.jQuery(e).on("input.mtflppAcf change.mtflppAcf sortupdate.mtflppAcf",(e,n)=>{a(e.target)&&("sortupdate"===e.type&&(s=n?.item?.[0]?.querySelector(':scope > input[type="hidden"][name$="[acf_fc_layout]"]')?.name),e.originalEvent&&"sortupdate"!==e.type||t())}),{isField:a,isValidating:()=>!!e.classList?.contains("is-validating"),hasStructuralPaginationChanges:()=>!!e.querySelector('.acf-repeater[data-pagination="1"] .acf-row:is(.acf-added, .acf-inserted, .acf-reordered, .acf-deleted)'),accepts:e=>"_acf_nonce"===e||e.startsWith("acf[")||e.startsWith("_acf_fields["),layoutOrders(t,n){const o=new Map,r=new Map,i=new Set;for(const[e,t]of n){"1"===t&&e.endsWith("[acf_fc_layout_disabled]")&&i.add(e.replace(/\[acf_fc_layout_disabled\]$/,"[acf_fc_layout]"));const n=e.match(/^(acf\[.+)\[[^\]]+\]\[acf_fc_layout\]$/)?.[1];n&&(o.has(n)||o.set(n,[]),o.get(n).push(e),r.set(e,[]))}const a=e=>Array.from(e.matchAll(/\]\[/g),({index:t})=>`${e.slice(0,t+1)}[acf_fc_layout]`);function l(e){const t=a(e);if(!t.some(e=>i.has(e)))return t.findLast(e=>r.has(e))}for(const[e,n]of t){if(!e.startsWith("acf[")||!["text","html"].includes(n.type))continue;const t=a(e);if(!t.some(e=>i.has(e)))for(const n of t)r.get(n)?.push(e)}for(const o of e.querySelectorAll('.acf-field[data-type="image"] .acf-image-uploader.has-value')){const e=o.querySelector(':scope > input[type="hidden"][name]'),i=o.querySelector(':scope > .image-wrap > img[data-name="image"]'),a=e?.name;if(!a?.startsWith("acf[")||!i||e.matches(":disabled")||o.closest(".acf-clone"))continue;const s=n.getAll(a);if(1!==s.length||s[0]!==e.value||!/^[1-9]\d*$/.test(s[0]))continue;const c=l(a);c&&(r.get(c).push(a),t.set(a,{type:"row-image",value:s[0],alt:i.alt}))}for(const o of e.querySelectorAll('.acf-field[data-type="gallery"] .acf-gallery')){const e=o.querySelector(':scope > input[type="hidden"][name]'),r=e?.name;if(!r?.startsWith("acf[")||e.matches(":disabled")||o.closest(".acf-clone"))continue;const s=`${r}[]`,l=n.getAll(r),c=n.getAll(s);if(a(r).some(e=>i.has(e))||1!==l.length||""!==l[0]||c.some(e=>!/^[1-9]\d*$/.test(e)))continue;const d=[...o.querySelectorAll(':scope > .acf-gallery-main > .acf-gallery-attachments > .acf-gallery-attachment > input[type="hidden"][name]')];d.length!==c.length||d.some((e,t)=>e.name!==s||e.value!==c[t]||e.matches(":disabled"))||t.set(s,{type:"gallery-order",value:JSON.stringify(c),members:JSON.stringify([...c].sort())})}for(const[e,n]of o){const o=n.filter(e=>!i.has(e));if(o.length<2||new Set(o).size!==o.length)continue;const a=o.includes(s)?s:void 0;t.set(`acf-layout-order:${e}`,{type:"row-order",value:JSON.stringify(o),members:JSON.stringify([...o].sort()),moved:a,fieldsByRow:Object.fromEntries(o.map(e=>[e,r.get(e)]))})}return t},destroy(){r.removeAction("wysiwyg_tinymce_init",n);for(const e of["append","remove","sortstop","change_field"])r.removeAction(e,t);r.removeAction("validation_failure",i),window.jQuery(e).off(".mtflppAcf")}}}function be(){const e=(0,t.select)("core/edit-post")?.getActiveMetaBoxLocations?.()??["normal","side","advanced"];return[document.querySelector(".metabox-base-form"),...e.map(e=>document.querySelector(`.edit-post-meta-boxes-area.is-${e} .metabox-location-${e}`)||document.querySelector(`#metaboxes .metabox-location-${e}`))].filter(Boolean)}const xe="meet-the-frontend-live-preview-panel/acf";function Me(e){if(!e.acfEnabled)return!1;if("function"!=typeof window.acf?.addAction||"function"!=typeof window.acf?.removeAction||"function"!=typeof window.jQuery)throw Object.assign(new Error(e.strings.acfUnavailable),{code:"mtflpp_integration_failed"});return!0}(0,e.addAction)("mtflpp.blockEditor.previewSetup",xe,({config:e,changed:n,hooks:o,onDestroy:r})=>{if(!Me(e))return;const i=function(e){const n=new Set;let o=!1,r=[],i=new Map;const a=()=>{o||e()};function s(e){e&&!n.has(e)&&(n.add(e),e.on("input change undo redo SetContent",a))}const l=ye(document,a,s);function c(e){s(e.editor)}function d(e){l.isField(e.target)&&be().some(t=>t.contains(e.target))&&a()}window.tinymce?.editors.forEach(s),window.tinymce?.on("AddEditor",c),document.addEventListener("input",d),document.addEventListener("change",d,!0);const u=new MutationObserver(a);return{get ready(){return r=r.filter(({field:e,rows:t})=>e.isConnected&&t.some(t=>e.contains(t))),r.length||u.disconnect(),!r.length},saved(){u.disconnect(),r=be().flatMap(e=>[...e.querySelectorAll('.acf-repeater[data-pagination="1"]')].map(e=>({field:e,rows:[...e.querySelectorAll(":scope > table > tbody > tr.acf-row:not(.acf-clone)")]})).filter(({rows:e})=>e.length));for(const{field:e}of r)u.observe(e,{childList:!0,subtree:!0});a()},observe(){const e=(0,t.select)("acf/fields");if(!e?.getFieldValue)return;const n=new Map;for(const t of be())for(const o of window.acf.getFields({parent:window.jQuery(t)})){const t=o.get("key");n.set(t,e.getFieldValue(t))}(n.size!==i.size||[...n].some(([e,t])=>i.get(e)!==t))&&(i=n,a())},capture(){o=!0;const e=new URLSearchParams;try{window.tinymce?.triggerSave();for(const t of be())for(const[n,o]of new FormData(t))"string"==typeof o&&l.accepts(n)&&e.append(n,o)}finally{o=!1}return e},destroy(){u.disconnect(),l.destroy(),document.removeEventListener("input",d),document.removeEventListener("change",d,!0),window.tinymce?.off("AddEditor",c);for(const e of n)e.off("input change undo redo SetContent",a)}}}(n);r(()=>i.destroy()),o.addAction("observePreviewInputs",xe,()=>i.observe()),o.addAction("nativeMetaboxSaveAcknowledged",xe,()=>i.saved()),o.addFilter("previewPauseReason",xe,t=>t||(i.ready?"":e.strings.acfRefreshing)),o.addFilter("previewFormBody",xe,e=>{e??=new URLSearchParams;for(const[t,n]of i.capture())e.append(t,n);return e})}),(0,e.addAction)("mtflpp.classicEditor.previewSetup",xe,({config:e,form:t,changed:n,watchEditor:o,cancelNativeSave:r,hooks:i,onDestroy:a})=>{if(!Me(e))return;const s=ye(t,n,o,r);a(()=>s.destroy());const l=e=>{s.isField(e.target)&&n()};t.addEventListener("input",l),t.addEventListener("change",l,!0),a(()=>{t.removeEventListener("input",l),t.removeEventListener("change",l,!0)}),i.addFilter("nativeSaveValidationPending",xe,e=>e||s.isValidating()),i.addFilter("previewComparisonValues",xe,(e,t)=>s.layoutOrders(e,t)),i.addFilter("previewFormBody",xe,(e,t)=>{for(const[n,o]of t)"string"==typeof o&&s.accepts(n)&&!n.includes("[acfcloneindex]")&&e.append(n,o);return e}),i.addFilter("nativePreviewHandoffError",xe,(t,n)=>t||(n&&s.hasStructuralPaginationChanges()?Object.assign(new Error(e.strings.nativePreviewAcf),{code:"mtflpp_acf_rows_stale"}):void 0))});const Se=window.meetTheFrontendLivePreviewPanel,Ee=document.getElementById("post");if(Se&&Ee){const t=function(e,t){const n={idle:Promise.resolve(),saving:!1,previewing:!1,deferredSaves:new WeakSet};let o,r,i=!1;function a(){const o=Array.from(window.crypto.getRandomValues(new Uint8Array(16)),e=>e.toString(16).padStart(2,"0")).join(""),i=e.base,a=`mtflpp_preview_${o}`,s=Object.entries({mtflpp_base:i,mtflpp_preview:o}).map(([e,n])=>{const o=document.createElement("input");return Object.assign(o,{type:"hidden",name:e,value:n}),t.append(o),o});let l,c,d=!1;const u=new Promise(e=>{c=e}),f=Date.now()+3e4,p=t=>{d=!0,clearTimeout(l),r=null,n.previewing=!1;for(const e of s)e.remove();document.cookie=`${a}=; Max-Age=0; Path=${e.adminCookiePath}; SameSite=Strict`,c(),n.onPreview?.(t,e.base!==i)},m=()=>{if(d)return;clearTimeout(l);const t=document.cookie.split(";").map(e=>e.trim()).find(e=>e.startsWith(`${a}=`)),n=t?.slice(a.length+1);if(n?.startsWith(`${i}.`)&&/^[a-f0-9]{64}$/.test(n.slice(65)))e.base=n.slice(65),p();else if(t||Date.now()>=f){const t="conflict"===n?e.strings.savedPostConflict:e.strings.nativePreviewFailed;p(Object.assign(new Error(t),{code:"mtflpp_source_changed"}))}else l=setTimeout(m,100)};r={done:u,check:m},n.idle=Promise.all([n.idle,u]),l=setTimeout(m,100)}const s=e=>{const t=e.target.closest("#post-preview");if(!t||t.classList.contains("disabled")||i||!window.crypto?.getRandomValues)return;if(n.previewing)return e.preventDefault(),void e.stopImmediatePropagation();n.previewing=!0;const o=n.beforePreview?.();if(!o)return void a();e.preventDefault(),e.stopImmediatePropagation(),window.open("",t.target||"wp-preview");const r=()=>{a(),i=!0;try{t.click()}finally{i=!1}};o.then(r,r)};t.addEventListener("click",s,!0),window.jQuery(document).on("heartbeat-send.mtflpp",(t,n)=>{r?.check(),n.mtflpp_base=e.base}).on("before-autosave.mtflpp",()=>{const e=new Promise(e=>{o=e});n.idle=Promise.all([e,r?.done]),n.onAutosave?.()}).on("heartbeat-tick.mtflpp heartbeat-error.mtflpp",(t,n)=>{"string"==typeof n?.mtflpp_base&&/^[a-f0-9]{64}$/.test(n.mtflpp_base)&&(e.base=n.mtflpp_base),"string"==typeof n?.rest_nonce&&(e.nonce=n.rest_nonce),o?.(),o=null}),window.jQuery(t).on("input.mtflpp change.mtflpp",e=>{!e.originalEvent&&["post_title","content","excerpt"].includes(e.target.name)&&n.onFieldChange?.(e)});const l=()=>{n.onSaveCancelled?n.onSaveCancelled():n.saving=!1};t.addEventListener("invalid",l,!0);let c=0,d=!1;function u(e){if("click"===e.type){const t=e.target.closest("#publish, #save-post");if(!t||t.disabled||t.classList.contains("disabled"))return}else if("dopreview"===t.querySelector("#wp-preview")?.value)return;const o=++c;setTimeout(()=>{const t=e.defaultPrevented||e.isDefaultPrevented?.();d||o!==c||!t||n.deferredSaves.has(e)||n.isValidating?.()||l()},0)}return t.addEventListener("click",u,!0),t.addEventListener("submit",u,!0),window.jQuery(t).on("submit.mtflpp",e=>{e.originalEvent||u(e)}),n.destroy=()=>{d=!0,n.beforePreview=null,n.onPreview=null,n.onAutosave=null,n.onFieldChange=null,n.onSaveCancelled=null,n.isValidating=null,t.removeEventListener("click",s,!0),t.removeEventListener("invalid",l,!0),t.removeEventListener("click",u,!0),t.removeEventListener("submit",u,!0),window.jQuery(document).off(".mtflpp"),window.jQuery(t).off(".mtflpp")},n}(Se,Ee);try{!function(t,n,o){const r=document.getElementById("post");if(!t||!r)return;let i,a=!1;const s=new Set;let l=!1;n.title=document.getElementById("title")?.value??t.postTitle,n.preparePreview=async e=>{let n;a=!0;try{window.tinymce?.triggerSave(),n=new FormData(r)}finally{a=!1}const o=new URLSearchParams;for(const[e,t]of n)"string"==typeof t&&["post_title","content","excerpt"].includes(e)&&o.append(e,t);const s=Object.fromEntries([...o].map(([e,t])=>[e,{type:"post_title"===e?"text":"html",value:t}])),l=i.capture(o,n),c=i.comparisonValues(l,s),d=new Set;if(e)for(const e of Object.values(c))if("row-order"===e?.type&&e.fieldsByRow)for(const t of Object.values(e.fieldsByRow).filter(Array.isArray))for(const e of t)"html"===c[e]?.type&&l.has(e)&&d.add(e);l.set("base",t.base),d.size&&l.set("mtflpp_row_text_fields",JSON.stringify([...d]));const u=await fetch(t.endpoint,{method:"POST",credentials:"same-origin",headers:{"X-WP-Nonce":t.nonce},body:l}),f=await u.json();if(!u.ok)throw Object.assign(new Error(f.message||t.strings.failed),{code:f.code});const{rowDisplayText:p,...m}=f;for(const e of d){const t=p?.[e];"string"==typeof t&&(c[e]={...c[e],formatted:t})}return{...m,comparisonValues:c}};const c=we(t,n,{inlineLauncher:o}),d=()=>{if(a||l)return;const e=i?.filter("previewPauseReason","")||i?.error?.message,t=!1===n.ready&&!e;n.ready=!e,n.notReady=e,n.notReadyState="paused",i?.error?c.resume(i.error):e?c.pause(e,"paused"):t?c.resume():c.changed()};function u(e){l||!e||s.has(e)||(s.add(e),e.on("input change undo redo SetContent",d))}function f(e){u(e.editor)}function p(e,t){u(t)}function m(){n.saving&&(n.saving=!1,d())}n.onAutosave=d,n.beforePreview=()=>(c.pause(t.strings.nativePreview),c.pending),n.onPreview=(e,t)=>{e=i.filter("nativePreviewHandoffError",e,t),c.resume(i.error||e)},window.tinymce&&(window.tinymce.editors.forEach(u),window.tinymce.on("AddEditor",f)),window.jQuery?.(document).on("tinymce-editor-init.mtflppClassicEditor",p),n.onSaveCancelled=m,i=function(t,n){const o=(0,e.createHooks)(),r=[];let i,a=!1;function s(e){i??="mtflpp_integration_failed"===e?.code?e:Object.assign(new Error(n.config.strings.integrationFailed),{code:"mtflpp_integration_failed",cause:e})}const l={get error(){return i},filter(e,t,...n){if(a||i)return t;try{const r=o.applyFilters(e,t,...n);if("additionalPreviewValues"===e&&("[object Object]"!==Object.prototype.toString.call(r)||Object.values(r).some(e=>!(null===e||["string","boolean"].includes(typeof e)||"number"==typeof e&&Number.isFinite(e)))))throw new TypeError("Preview values must be a plain object of scalar values.");return r}catch(e){return s(e),t}},action(e,...t){if(!a&&!i)try{o.doAction(e,...t)}catch(e){s(e)}},capture(e,t=null){a&&!i&&s(new Error("This editor session has ended."));const n=null===e?null:new URLSearchParams(e),o=l.filter("previewFormBody",e,t);if(null===o||o instanceof URLSearchParams||s(new TypeError("Preview capture must return URLSearchParams or null.")),i||null===n||null!==o&&![...n.keys()].some(e=>{const t=n.getAll(e),r=o.getAll(e);return r.length!==t.length||t.some((e,t)=>r[t]!==e)})||s(new TypeError("Preview capture must preserve the classic form body.")),i)throw i;return o},comparisonValues(e,t){const r=new Map(Object.entries(t));try{const t=n.form||document,i=new Set;for(const n of t.querySelectorAll("input[name], textarea[name], select[name]")){if(r.has(n.name)||!e?.has(n.name)||"password"===n.type)continue;if("hidden"===n.type){i.add(n.name);continue}const t="textarea"===n.localName||["text","search","email","url","tel"].includes(n.type),o=e.getAll(n.name);let a="value";t&&1===o.length&&(a=n.classList.contains("wp-editor-area")?"html":"text"),r.set(n.name,{type:a,value:1===o.length?o[0]:JSON.stringify(o)})}for(const t of i){if(r.has(t))continue;const n=e.getAll(t);n.length>1&&r.set(t,{type:"order",value:JSON.stringify(n),members:JSON.stringify(n.sort())})}return Object.fromEntries(o.applyFilters("previewComparisonValues",r,e))}catch{}return Object.fromEntries(r)},destroy(){if(!a){a=!0;for(const e of r.reverse())try{e()}catch(e){s(e)}r.length=0}}};try{(0,e.doAction)("mtflpp.classicEditor.previewSetup",{...n,hooks:o,onDestroy(e){r.push(e)}})}catch(e){s(e),l.destroy()}return l}(0,{config:t,form:r,changed:d,watchEditor:u,cancelNativeSave:m});const h=n.destroy;function g(e){e.persisted||n.destroy()}function v(e){"post_title"===e.target.name&&c.setTitle(e.target.value),["post_title","content","excerpt"].includes(e.target.name)&&d()}n.destroy=()=>{if(!l){l=!0,i.destroy(),r.removeEventListener("input",v),r.removeEventListener("change",v,!0),r.removeEventListener("click",b,!0),r.removeEventListener("submit",x,!0),window.removeEventListener("pagehide",g),window.tinymce?.off("AddEditor",f),window.jQuery?.(document).off("tinymce-editor-init.mtflppClassicEditor",p);for(const e of s)e.off("input change undo redo SetContent",d);s.clear(),h?.()}},window.addEventListener("pagehide",g),n.isValidating=()=>i.filter("nativeSaveValidationPending",!1),n.onFieldChange=v,r.addEventListener("input",v),r.addEventListener("change",v,!0);let w=!1;function y(e,t){if(e.defaultPrevented)return;if(w)return n.deferredSaves?.add(e),e.preventDefault(),void e.stopImmediatePropagation();if(n.saving)return;n.saving=!0,c.pause();const o=c.pending||(n.previewing?n.idle:null);if(!o)return;n.deferredSaves?.add(e),e.preventDefault(),e.stopImmediatePropagation(),w=!0;const r=()=>{w=!1,!l&&n.saving&&t()};o.then(r,r)}function b(e){const t=e.target.closest("#publish, #save-post");!t||t.disabled||t.classList.contains("disabled")||y(e,()=>t.click())}function x(e){"dopreview"!==r.querySelector("#wp-preview")?.value&&y(e,()=>r.requestSubmit(e.submitter||void 0))}r.addEventListener("click",b,!0),r.addEventListener("submit",x,!0),d(),i.error||c.start()}(Se,t,Ee.querySelector("#mtflpp-publish-preview button"))}catch(e){t.destroy(),function(e,t){document.getElementById("mtflpp-panel")?.remove(),document.getElementById("mtflpp-toggle")?.remove(),document.getElementById("mtflpp-publish-preview")?.remove(),document.getElementById("mtflpp-term-preview")?.remove();const n=document.createElement("div");n.className="notice notice-error inline",n.setAttribute("role","alert");const o=document.createElement("p");o.textContent=e,n.append(o);const r=document.querySelector("#wpbody-content .wp-header-end")||document.querySelector("#wpbody-content .wrap h1, #wpbody-content .wrap h2");r?r.after(n):(document.getElementById("wpbody-content")||document.body).prepend(n),console.error("Meet the Frontend – Live Preview Panel could not start.",t)}(Se.strings.bootFailed,e)}}})();
  • meet-the-frontend-live-preview-panel/trunk/build/revision-browser.asset.php

    r3820590 r3822693  
    99                'wp-primitives'
    1010        ),
    11         'version' => 'af21c92ce6fe3dc311fb'
     11        'version' => '052095b6b6e41065bed3'
    1212);
  • meet-the-frontend-live-preview-panel/trunk/build/revision-browser.js

    r3820590 r3822693  
    1 (()=>{"use strict";const e=window.wp.data,t=window.wp.preferences,n=window.wp.element,o=window.wp.components,r=window.wp.notices,i=window.wp.primitives,l=window.ReactJSXRuntime,s={refresh:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M12 5.5L17.7929 11.2929C18.1834 11.6834 18.1834 12.3166 17.7929 12.7071L16 14.5M16 5.5H12V9.5M12 18.5L6.20711 12.7071C5.81658 12.3166 5.81658 11.6834 6.20711 11.2929L8 9.5M8 18.5H12V14.5"})}),more:(0,l.jsxs)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,l.jsx)(i.Path,{d:"M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z",fill:"currentColor",stroke:"none"}),(0,l.jsx)(i.Path,{d:"M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z",fill:"currentColor",stroke:"none"}),(0,l.jsx)(i.Path,{d:"M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z",fill:"currentColor",stroke:"none"}),(0,l.jsx)(i.Path,{d:"M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z"}),(0,l.jsx)(i.Path,{d:"M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z"}),(0,l.jsx)(i.Path,{d:"M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z"})]}),expand:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M4.75 10V4.75H10M4.75 4.75L10 10M14 19.25H19.25V14M19.25 19.25L14 14"})}),compact:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M10 4.75V10H4.75M10 10L4.75 4.75M19.25 14H14V19.25M14 14L19.25 19.25"})}),pip:(0,l.jsxs)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,l.jsx)(i.Path,{d:"M4.75 9.25V16C4.75 16.6904 5.30964 17.25 6 17.25H8M4.75 9.25V6C4.75 5.30964 5.30964 4.75 6 4.75H16C16.6904 4.75 17.25 5.30964 17.25 6V8M4.75 9.25H8"}),(0,l.jsx)(i.Path,{d:"M10.75 11.25C10.75 10.9739 10.9739 10.75 11.25 10.75H18.75C19.0261 10.75 19.25 10.9739 19.25 11.25V18.75C19.25 19.0261 19.0261 19.25 18.75 19.25H11.25C10.9739 19.25 10.75 19.0261 10.75 18.75V11.25Z",fill:"currentColor"})]}),move:(0,l.jsxs)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,l.jsx)(i.Path,{d:"M9.25 5.75H8.75V6.25H9.25V5.75Z",fill:"currentColor",stroke:"none"}),(0,l.jsx)(i.Path,{d:"M9.25 11.75H8.75V12.25H9.25V11.75Z",fill:"currentColor",stroke:"none"}),(0,l.jsx)(i.Path,{d:"M9.25 17.75H8.75V18.25H9.25V17.75Z",fill:"currentColor",stroke:"none"}),(0,l.jsx)(i.Path,{d:"M15.25 5.75H14.75V6.25H15.25V5.75Z",fill:"currentColor",stroke:"none"}),(0,l.jsx)(i.Path,{d:"M15.25 11.75H14.75V12.25H15.25V11.75Z",fill:"currentColor",stroke:"none"}),(0,l.jsx)(i.Path,{d:"M15.25 17.75H14.75V18.25H15.25V17.75Z",fill:"currentColor",stroke:"none"}),(0,l.jsx)(i.Path,{d:"M9.25 5.75H8.75V6.25H9.25V5.75Z"}),(0,l.jsx)(i.Path,{d:"M9.25 11.75H8.75V12.25H9.25V11.75Z"}),(0,l.jsx)(i.Path,{d:"M9.25 17.75H8.75V18.25H9.25V17.75Z"}),(0,l.jsx)(i.Path,{d:"M15.25 5.75H14.75V6.25H15.25V5.75Z"}),(0,l.jsx)(i.Path,{d:"M15.25 11.75H14.75V12.25H15.25V11.75Z"}),(0,l.jsx)(i.Path,{d:"M15.25 17.75H14.75V18.25H15.25V17.75Z"})]}),warning:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M12 8L12 13M12 14.5L12 16M4.75 12C4.75 7.99593 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12Z",strokeLinejoin:"round"})}),info:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M12 16V11M12 9.5V8M19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12C4.75 7.99594 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12Z",strokeLinejoin:"round"})}),close:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M7.75 16.25L16.25 7.75M16.25 16.25L7.75 7.75"})}),check:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M7 12L10 15L17 8"})}),chevron:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M7 11L12 15L17 11"})}),desktop:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M4.75 16.75V17H3.25C3.11193 17 3 17.1119 3 17.25H21C21 17.1119 20.8881 17 20.75 17H19.25V16.75M4.75 16.75V8.5C4.75 7.80964 5.30964 7.25 6 7.25H18C18.6904 7.25 19.25 7.80964 19.25 8.5V16.75M4.75 16.75H19.25"})}),tablet:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M10 16.5H14M18.25 18V6C18.25 5.30964 17.6904 4.75 17 4.75H7C6.30964 4.75 5.75 5.30964 5.75 6L5.75 18C5.75 18.6904 6.30964 19.25 7 19.25H17C17.6904 19.25 18.25 18.6904 18.25 18Z"})}),mobile:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M11 16.5H13M16.25 18V6C16.25 5.30964 15.6904 4.75 15 4.75H9C8.30964 4.75 7.75 5.30964 7.75 6L7.75 18C7.75 18.6904 8.30964 19.25 9 19.25H15C15.6904 19.25 16.25 18.6904 16.25 18Z"})})};function a(e,t,n="right"){const o=e&&!Array.isArray(e)&&e.bounds&&["x","y","width","height"].every(t=>Number.isFinite(e.bounds[t]))&&e.bounds.width>0&&e.bounds.height>0&&[null,"left","center","right"].includes(e.dock)&&"boolean"==typeof e.expanded&&(void 0===e.anchor||["left","center","right"].includes(e.anchor));let r=!!o&&e.expanded;const i={width:480,height:393},l=o?{...e.bounds}:{x:0,y:0,...i};let s=o?e.dock:n,a=s||o&&e.anchor||"right";function c(){return"left"===a?0:"center"===a?.5:1}function d(e,n=t(!s),o=320,r=220){return e.width=Math.min(n.width,Math.max(Math.min(o,n.width),e.width)),e.height=Math.min(n.height,Math.max(Math.min(r,n.height),e.height)),e.x=Math.max(n.left,Math.min(n.right-e.width,e.x)),e.y=Math.max(n.top,Math.min(n.bottom-e.height,e.y)),e}function u(e){if(!s)return e;const n=t();return e.x="left"===s?n.left:"center"===s?n.left+(n.width-e.width)/2:n.right-e.width,e.y=n.bottom-e.height,e}return{area:t,compactRect:function(){return u(d({...l}))},launcherRect:function(e){return u(d({...e,x:l.x+(l.width-e.width)*c(),y:l.y+l.height-e.height},t(!s),1,1))},usableEdge:function(e){return!(s&&(e.includes("s")||"left"===s&&e.includes("w")||"right"===s&&e.includes("e")))},get anchor(){return a},get anchorFactor(){return c()},get dock(){return s},get expanded(){return r},get layout(){return{bounds:{...l},dock:s,anchor:a,expanded:r}},toggleExpanded(){r=!r},dockTo:function(e="right",t=!1){t&&Object.assign(l,i),r=!1,a=s=e},resize(e,n,o,r){Object.assign(l,function(e,n,o,r){const i=t(!s),l=n.includes("e")||n.includes("w"),c=n.includes("n")||n.includes("s"),d=function(e){return"center"===a?.5:e.includes("w")?1:0}(n),u=e.x+e.width*d,f=n.includes("n"),p=e.y+(f?e.height:0),m=function(e,t,n){return 0===n?e.right-t:1===n?t-e.left:2*Math.min(t-e.left,e.right-t)}(i,u,d),h=f?p-i.top:i.bottom-p,g=(n.includes("w")?-o:o)*(.5===d?2:1),w=Math.max(Math.min(320,m),Math.min(m,e.width+g)),v=Math.max(Math.min(220,h),Math.min(h,e.height+(f?-r:r))),b=l&&0!==o&&w!==e.width,y=c&&0!==r&&v!==e.height,x=f?p-v:p;return{x:b?u-w*d:e.preferredBounds.x,y:y?x:e.preferredBounds.y,width:b?w:e.preferredBounds.width,height:y?v:e.preferredBounds.height}}(e,n,o,r))},move:function(e,n,o,r=!1){const i=d({...e,x:e.x+n,y:e.y+o},t(!0),r?1:320,r?1:220);l.x=i.x+(r?(i.width-l.width)*c():0),l.y=i.y+(r?i.height-l.height:0),s=null}}}function c(i,{postTitle:l="",publicRedirect:c,inlineLauncher:d,nativeLauncher:u,canRememberVisibility:f=!0,onOpen:p,onClose:m,onRefresh:h,onRetry:g,beforeMove:w,afterMove:v,beforeViewportChange:b}){const y=window,x=document,M="meet-the-frontend-live-preview-panel",C=(0,e.select)(t.store),P=(0,e.dispatch)(t.store),k="width"===C.get(M,"fit")?"width":"automatic";P.setDefaults(M,{rememberVisibility:!0,rememberPosition:!0,panelOpen:!0,scrollToChanges:!0,viewport:"desktop",fitMode:k,customZoom:100,tabletOrientation:"portrait",mobileOrientation:"portrait"});const E=()=>!d&&(!u||u.fallbackMedia.matches);let S=!1!==C.get(M,"rememberVisibility"),L=!1!==C.get(M,"rememberPosition"),V=!1!==C.get(M,"scrollToChanges");const T=d?.parentElement??x.getElementById("mtflpp-toggle"),H=x.getElementById("mtflpp-panel");if(!T||!H)throw new Error("Preview panel markup is missing.");const j=d||function(e){let t;const{title:r,moveHelp:i}=e.dataset;return(0,n.flushSync)(()=>(0,n.createRoot)(e).render((0,n.createElement)(o.Button,{ref:e=>{t=e},variant:"secondary",label:r,title:r,description:i,"aria-controls":"mtflpp-panel","aria-expanded":!1},(0,n.createElement)("span",{className:"mtflpp-launcher-label"},r)))),t}(T),O=H.querySelector(".mtflpp-move-control"),R=H.querySelector(".mtflpp-resize"),N=H.querySelectorAll("[data-resize-edge]"),$=H.querySelector(".mtflpp-header"),D=H.querySelector(".mtflpp-caption"),F=H.querySelector(".mtflpp-viewport"),B=H.querySelector(".mtflpp-canvas"),A=H.querySelector(".mtflpp-stage"),W=H.querySelector(".mtflpp-empty"),q=H.querySelector(".mtflpp-devicebar"),z=H.querySelector(".mtflpp-dimensions"),Z=H.querySelector(".mtflpp-feedback"),I=H.querySelector('[role="status"]');let _;const G=function(e,t,n,o={},r=()=>{},i={desktop:"Desktop",tablet:"Tablet",mobile:"Phone"}){const l=e.ownerDocument.defaultView,s=e.querySelector(".mtflpp-canvas"),a=e.querySelector(".mtflpp-canvas-space"),c=n.querySelector(".mtflpp-dimensions-text"),d={desktop:[1280,800],tablet:[768,1024],mobile:[390,844]},u=Object.keys(d);let f=u.includes(o.device)?o.device:"desktop";const p=["automatic","window","width","custom"];let m=p.includes(o.fit)?o.fit:"automatic";const h=e=>Number.isInteger(e)&&e>=10&&e<=400;let g,w=h(o.customZoom)?o.customZoom:100,v=100;const b=e=>"desktop"===e?"landscape":"portrait",y=Object.fromEntries(u.map(e=>[e,"desktop"!==e&&["portrait","landscape"].includes(o[`${e}Orientation`])?o[`${e}Orientation`]:b(e)])),x=()=>y[f]===b(f)?d[f]:[...d[f]].reverse(),M=()=>"width"===m;let C,P,k;const E=l.matchMedia("(prefers-reduced-motion: no-preference)");function S(){const t=e.ownerDocument.defaultView.devicePixelRatio;return Number.isFinite(t)&&t>0?t:1}function L(e,t){if("custom"===m)return w/100/S();const n=s.clientWidth/e;if(M())return n;const o=Math.min(n,s.clientHeight/t);return"automatic"===m?Math.min(1/S(),o):o}function V(e,n){C=e;const[o,r]=x(),i=Math.max(0,(s.clientWidth-o*C)/2),l=Math.max(0,(s.clientHeight-r*C)/2);Object.assign(a.style,{width:`${Math.max(s.clientWidth,i+o*C)}px`,height:`${Math.max(s.clientHeight,l+r*C)}px`}),Object.assign(t.style,{left:`${i}px`,top:`${l}px`,transform:`scale(${C})`});const c=o*C>s.clientWidth+.01||r*C>s.clientHeight+.01,d="custom"===m||M();s.tabIndex=d&&c?0:-1,s.scrollLeft="custom"===m?n.x*C:0,s.scrollTop=d?n.y*C:0}function T(){if(!P)return;const e=P;P=null,e.window.cancelAnimationFrame(e.frame),e.resolve?.()}function H(e,t,n,o){return t<=0||o&&e<-1&&t<n?Math.max(e,t-n):e>=n||o&&e>0&&t>n+1?Math.min(e,t-n):0}function j(o=!1,l=!1){T();const[a,d]=x();if(Object.assign(t.style,{width:`${a}px`,height:`${d}px`}),!e.clientWidth||!e.clientHeight)return;const u=S(),p=`${i[f]} (${a} × ${d}) · `,h=Math.max(400,Math.ceil(e.clientWidth/a*u*100)),b=`${p}${"0".repeat(String(h).length)}%`;n.dataset.reserve!==b&&(n.dataset.reserve=b);const y=l?{x:0,y:0}:{x:(s.scrollLeft||0)/(C||1),y:(s.scrollTop||0)/(C||1)};if(s.style.overflowX="hidden",s.style.overflowY="hidden","custom"===m){const e=L(a,d);for(let t=0;t<2;t++)a*e>s.clientWidth+.01&&(s.style.overflowX="scroll"),d*e>s.clientHeight+.01&&(s.style.overflowY="scroll")}else M()&&d*L(a,d)>e.clientHeight&&(s.style.overflowY="scroll");if(!s.clientWidth||!s.clientHeight)return;const k=L(a,d),H=Math.round(k*u*100),j=H!==v||u!==g;v=H,g=u;const O=`${p}${"custom"===m?w:v}%`;c.textContent!==O&&(c.textContent=O),j&&r();const R=C??k;if(!o||!E.matches||R===k)return void V(k,y);const N={window:e.ownerDocument.defaultView,frame:null},$=N.window.performance.now();P=N;const D=e=>{V(e,y),N.scrollLeft=s.scrollLeft,N.scrollTop=s.scrollTop};D(R);const F=e=>{if(P!==N)return;const t=Math.min(1,Math.max(0,(e-$)/200));D(R+(k-R)*(1-(1-t)**3)),t<1?N.frame=N.window.requestAnimationFrame(F):T()};N.frame=N.window.requestAnimationFrame(F)}function O(){j()}function R(){k?.();const t=e.ownerDocument.defaultView.matchMedia(`(resolution: ${S()}dppx)`);t.addEventListener("change",R),k=()=>t.removeEventListener("change",R),O()}let N=new l.ResizeObserver(O);return N.observe(e),E.addEventListener("change",O),l.addEventListener("resize",R),R(),{get device(){return f},get fit(){return m},get customZoom(){return w},get zoomPercent(){return"custom"===m?w:v},get dpr(){return S()},get orientation(){return y[f]},canvasTarget:function(e,t,{fitTarget:n=!1}={}){const o=e.getBoundingClientRect(),r=s.getBoundingClientRect(),i=o.left-r.left-s.clientLeft,l=o.top-r.top-s.clientTop,a=H(i+t.left*C,i+t.right*C,s.clientWidth,n),c=H(l+t.top*C,l+t.bottom*C,s.clientHeight,n),d=Math.max(t.left,-i/C),u=Math.min(t.right,(s.clientWidth-i)/C);return{visible:!a&&!c,visibleCenterX:d<u?(d+u)/2:void 0,distance:Math.hypot(a,c),reveal(e="instant"){(a||c)&&s.scrollBy({left:a,top:c,behavior:e})}}},canvasWasPanned:function(){return!!P&&(s.scrollLeft!==P.scrollLeft||s.scrollTop!==P.scrollTop)},whenSettled:function(){if(!P)return;const e=P;return e.done??=new Promise(t=>{e.resolve=t}),e.done},finishMotion(){P&&O()},select(e,{animate:t=!1,keepPan:n=!1}={}){if(!u.includes(e))return;const o=f!==e;f=e,o?j(t,!n):P||O()},rotate({animate:e=!1,keepPan:t=!1}={}){"desktop"!==f&&(y[f]="portrait"===y[f]?"landscape":"portrait",j(e,!t))},setFit(e){p.includes(e)&&m!==e&&(m=e,j(!1,!0))},setZoom(e){if(!h(e)||"custom"===m&&w===e)return;const t="custom"!==m;w=e,m="custom",j(!1,t)},layout:O,beforeMove(){T(),N.disconnect(),k?.(),e.ownerDocument.defaultView.removeEventListener("resize",R)},afterMove(){N=new e.ownerDocument.defaultView.ResizeObserver(O),N.observe(e),e.ownerDocument.defaultView.addEventListener("resize",R),R()}}}(F,A,z,{device:C.get(M,"viewport"),fit:C.get(M,"fitMode")??k,customZoom:C.get(M,"customZoom"),tabletOrientation:C.get(M,"tabletOrientation"),mobileOrientation:C.get(M,"mobileOrientation")},()=>Ee(),i),X=x.querySelector("#wpbody-content > .wrap"),J=x.getElementById("wpadminbar");function Y(e=!1){const t=Math.max(1,x.documentElement.clientWidth),n=Math.max(1,x.documentElement.clientHeight),o=x.documentElement.getBoundingClientRect().left+y.scrollX,r=!e&&X?.getBoundingClientRect(),i=r?Math.max(0,"rtl"===y.getComputedStyle(X).direction?r.left-o:o+t-r.right):20,l=e?0:i,s=Math.min(l,(t-1)/2),a=Math.min(Math.max(0,J?.getBoundingClientRect().bottom||0)+l,n-1),c=t-s,d=n-Math.min(l,n-a-1);return{left:s,top:a,right:c,bottom:d,width:c-s,height:d-a}}let U,K=f&&(!S||!1!==C.get(M,"panelOpen"));const Q=C.get(M,"layout"),ee=C.get(M,"position")??Q?.dock??Q?.anchor;let te=["left","center","right"].includes(ee)?ee:"right";const ne=a(L?Q:void 0,Y,te),{compactRect:oe,usableEdge:re}=ne;let ie,le=!1,se="",ae=!1,ce={text:i.loading,state:"loading",hasPreview:!1,canRetry:!1,reason:""},de=!1;function ue(e){const t="string"==typeof e?e.replace(/\s+/g," ").trim():"";D.textContent=t?`${i.preview} — ${t}`:i.title,D.title=D.textContent,U&&(U.document.title=D.textContent)}function fe(){const{text:e,state:t,hasPreview:n,reason:o}=ce;return"handover"===t?{heading:i.switchingPreview,description:e,note:i.tabEdits}:"conflict"===t?{heading:e,description:{"handed-off":i.handedOffHelp,busy:i.takeoverTimeoutHelp,manual:i.closeOtherHelp}[o]||i.conflictHelp,note:"manual"===o?i.manualSwitchHint:i.tabEdits}:"paused"===t?{heading:i.pausedTitle,description:e,note:""}:"error"===t?function(){const{text:e,hasPreview:t,canRetry:n,reason:o}=ce;if("origin-mismatch"===o)return{heading:i.originMismatchTitle,description:t?`${e} ${i.previousPreview}`:e,note:""};if("unavailable"===o||"browser"===o)return{heading:"unavailable"===o?i.unavailableTitle:i.browserTitle,description:e,note:""};if(!t){let t=e;return e===i.failed&&(t=n?i.failedHelp:""),"reload"===o&&(t+=` ${i.reviewBeforeReload}`),{heading:i.failed,description:t,note:""}}return{heading:e===i.failed?i.refreshFailed:e,description:"reload"===o?i.reviewBeforeReload:i.previousPreview,note:""}}():n?{heading:e,description:"",note:""}:{heading:i.loading,description:i.preparing,note:""}}function pe(){return le?"handover"===ce.state?i.takingOver:i.takeOver:i.retry}function me(e){return!e||["handover","paused"].includes(ce.state)?"info":"error"!==ce.state||ce.canRetry?"warning":"error"}function he(){return ce.redirectDestination?`${i.redirected} ${ce.redirectDestination}`:ce.hasHtmlPreview&&ie?`${i.publicRedirected} ${ie}`:""}function ge(){const{state:e,hasPreview:t,canRetry:n,reason:o}=ce,r=t&&["error","conflict","handover","paused"].includes(e),l=!t||r||se?"":he();if(Z.hidden=!r&&!se&&!l,Z.tabIndex=Z.hidden?-1:0,H.dataset.hasFeedback=String(!Z.hidden),Z.hidden)return null;if(l)return{heading:l,status:"info",dismissible:!1};const{heading:s,description:a}=fe();return{heading:r?s:se,description:r?a:i.windowNoticeHelp,status:me(r),dismissible:!r,retry:r&&(le||n&&["error","conflict"].includes(e)),close:r&&"error"===e&&!n&&"reload"!==o,disabled:"handover"===e,action:pe()}}function we(e){ce.hasPreview&&["error","conflict","handover","paused"].includes(ce.state)||(se=e,Ee()),I.textContent=`${e} ${i.windowNoticeHelp}`}function ve(){se="",Ee()}function be(e,t="loading",{canTakeOver:n=!1,hasPreview:o=!1,hasHtmlPreview:r=!1,redirectDestination:i,canRefresh:l=!1,canRetry:s=!0,reason:a=""}={}){const d=H.ownerDocument.activeElement,u=H.contains(d),f=!o&&(ce.state!==t||ce.text!==e||ce.reason!==a),p=ce.hasPreview!==o;ce={text:e,state:t,canTakeOver:n,hasPreview:o,hasHtmlPreview:r,redirectDestination:i,canRefresh:l,canRetry:s,reason:a},["error","conflict","handover","paused"].includes(t)&&(se=""),H.dataset.state=t,H.dataset.hasPreview=String(o),le=n&&["conflict","handover"].includes(t),W.hidden=o,q.hidden=!o;const{heading:m,description:h,note:g}=fe();f&&(W.scrollTop=0);const w="ready"!==t||se?"":he();I.textContent=o?[m,h,g,w].filter(Boolean).join(" "):m,Ee(),p&&G.layout(),function(e,t){e&&t&&(!H.contains(e)||e.closest("[hidden]")||e.disabled||!ce.hasPreview&&B.contains(e))&&_.focus(W.hidden?"actions":"empty-title")}(d,u),K&&"ready"===t&&r&&!i&&async function(){if(c&&!ae){ae=!0;try{const e=new URL(c.endpoint);if(e.origin!==y.location.origin)return;const t=await y.fetch(e,{credentials:"same-origin",cache:"no-store",redirect:"error",headers:{"X-WP-Nonce":c.nonce}});if(!t.ok)return;const{destination:n}=await t.json();if("string"!=typeof n||!n)return;if(ie=n,!K)return;Ee(),"ready"!==ce.state||!ce.hasHtmlPreview||ce.redirectDestination||se||(I.textContent=he())}catch{}}}()}function ye(e){f&&S&&C.get(M,"panelOpen")!==e&&P.set(M,"panelOpen",e)}function xe(){L&&P.set(M,"layout",ne.layout)}function Me(){const e=T.hidden;T.hidden=!1,T.style.maxWidth=`${Y(!ne.dock).width}px`;const t={width:T.offsetWidth,height:T.offsetHeight};return T.hidden=e,ne.launcherRect(t)}function Ce(){if(U)return;if(!K&&E()){const e=Me(),t=ne.anchorFactor;Object.assign(T.style,{left:`${e.x+e.width*t}px`,top:`${e.y+e.height}px`,transform:`translate(${-100*t}%, -100%)`})}let e=oe();if(H.dataset.anchor=ne.anchor,ne.expanded){const t=Y();e={x:t.left,y:t.top,width:t.width,height:t.height}}Object.assign(H.style,{left:`${e.x}px`,top:`${e.y}px`,width:`${e.width}px`,height:`${e.height}px`,transform:""})}function Pe(e="right",t=!1){ne.dockTo(e,t),te=e,P.set(M,"position",te),Ce(),xe(),Ee()}function ke(){return"function"==typeof y.documentPictureInPicture?.requestWindow}function Ee(){if(!_)return;const e=H.ownerDocument.fullscreenElement===H,t=!U&&!e,n=t&&!ne.expanded;H.classList.toggle("mtflpp-expanded",ne.expanded),R.hidden=!n;for(const e of N)e.hidden=!n||!re(e.dataset.resizeEdge);const o=le||ce.canRetry&&["error","conflict"].includes(ce.state);var r;_.update({inPage:t,inPip:!!U,movable:n,dock:ne.dock,canRememberVisibility:f,rememberVisibility:S,rememberPosition:L,followChanges:V,device:G.device,busy:ce.hasPreview&&["stale","loading","handover"].includes(ce.state)&&ce.text!==i.saving,empty:ce.hasPreview?null:{...fe(),busy:["loading","stale","ready","handover"].includes(ce.state),icon:["paused","conflict"].includes(ce.state)||["unavailable","browser","origin-mismatch"].includes(ce.reason)?"info":"warning",retry:o,disabled:"handover"===ce.state,close:"error"===ce.state&&!o,action:pe()},notice:ge(),fit:G.fit,orientation:G.orientation,customZoom:G.customZoom,zoomPercent:G.zoomPercent,dpr:G.dpr,canRefresh:ce.canRefresh,hasPreview:ce.hasPreview,canPip:t&&ke(),canFullscreen:t&&!!x.fullscreenEnabled,mode:e||ne.expanded?"compact":"expand",modeLabel:(r=e,r?i.exitFullscreen:ne.expanded?i.compact:i.expand)})}function Se(){_.closeMenu(),U?U.close():x.fullscreenElement!==H?(ne.toggleExpanded(),Ce(),xe(),Ee(),_.focus("mode")):x.exitFullscreen().then(ve,()=>we(i.fullscreenFailed))}function Le(e,t=!1,n){const o=e===j,r=e===$,l=()=>n||("left"===ne.anchor?"ne":"nw"),s=()=>U||!o&&ne.expanded||x.fullscreenElement===H||t&&!re(l());let a,c;const d=()=>({...o?Me():oe(),preferredBounds:ne.layout.bounds});function u(){if(c=null,a)if(t||o)Ce();else{const e=oe(),t=e.x-parseFloat(H.style.left),n=e.y-parseFloat(H.style.top);Object.assign(H.style,{width:`${e.width}px`,height:`${e.height}px`,transform:`translate3d(${t}px, ${n}px, 0)`})}}function f(){if(!a)return;const{pointer:t,moved:n}=a;a=null,y.cancelAnimationFrame(c),e.hasPointerCapture(t)&&e.releasePointerCapture(t),H.classList.remove("mtflpp-dragging"),e.classList.remove("mtflpp-edge-active"),x.documentElement.classList.remove("mtflpp-window-dragging"),x.documentElement.style.removeProperty("--mtflpp-drag-cursor"),Ce(),n&&(o&&(de=!0),xe(),Ee())}e.addEventListener("pointerdown",t=>{0!==t.button||s()||r&&t.target.closest('button, a, [role="button"]')||(o&&(de=!1),t.preventDefault(),o?j.focus({preventScroll:!0}):e===O&&_.focus("move"),_.closeMenu(),a={...d(),pointer:t.pointerId,pointerX:t.clientX,pointerY:t.clientY},e.setPointerCapture(t.pointerId))}),e.addEventListener("pointermove",n=>{if(!a||a.pointer!==n.pointerId)return;const r=n.clientX-a.pointerX,i=n.clientY-a.pointerY;!a.moved&&Math.abs(r)+Math.abs(i)<4||(a.moved=!0,H.classList.add("mtflpp-dragging"),t&&e.classList.add("mtflpp-edge-active"),x.documentElement.style.setProperty("--mtflpp-drag-cursor",t?y.getComputedStyle(e).cursor:"grabbing"),x.documentElement.classList.add("mtflpp-window-dragging"),t?ne.resize(a,l(),r,i):ne.move(a,r,i,o),c||(c=y.requestAnimationFrame(u)))});for(const t of["pointerup","pointercancel","lostpointercapture"])e.addEventListener(t,f);y.addEventListener("blur",f),r||n||e.addEventListener("keydown",e=>{const n={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[e.key];if(!n||e.altKey||e.ctrlKey||e.metaKey||s())return;e.preventDefault(),_.closeMenu();const r=d(),a=e.shiftKey?40:10;t?ne.resize(r,l(),n[0]*a,n[1]*a):ne.move(r,n[0]*a,n[1]*a,o),Ce(),xe(),Ee();const c=oe();I.textContent=t?`${i.resize}: ${Math.round(c.width)} × ${Math.round(c.height)}`:i.moved})}ue(l),$.addEventListener("dblclick",e=>{U||e.target.closest("button, a")||Se()}),x.addEventListener("fullscreenchange",Ee),R.addEventListener("keydown",e=>{"Escape"===e.key&&R.classList.add("mtflpp-help-dismissed")}),R.addEventListener("blur",()=>R.classList.remove("mtflpp-help-dismissed")),Le(O),Le($),d||Le(j),Le(R,!0);for(const e of N)Le(e,!0,e.dataset.resizeEdge);function Ve(){H.hidden=!K,T.hidden=!d&&(K||!E()),j.setAttribute("aria-expanded",String(K))}function Te(e=!0){K?_.focus("actions"):(ye(!0),p(),K&&e&&_.focus("actions"))}return y.addEventListener("resize",Ce),y.addEventListener("scroll",Ce,{passive:!0}),u?.fallbackMedia.addEventListener("change",()=>{Ce(),Ve()}),j.addEventListener("click",e=>{if(de&&0!==e.detail)return de=!1,void e.preventDefault();de=!1,Te(0===e.detail)}),_=function(t,i,l){const a=t.querySelector(".mtflpp-controls"),c=t.querySelector(".mtflpp-refresh-control"),d=t.querySelector(".mtflpp-move-control"),u=t.querySelector(".mtflpp-device-controls"),f=t.querySelector(".mtflpp-fit-control"),p=t.querySelector(".mtflpp-pip-control"),m=t.querySelector(".mtflpp-empty"),h=t.querySelector(".mtflpp-feedback");let g,w=(0,n.createRoot)(a),v=!1,b=!1,y=!1;const x=r.InlineNotices?(0,e.dispatch)(r.store):null,M=t.ownerDocument.defaultView?.wp?.theme?.ThemeProvider,C="meet-the-frontend-live-preview-panel",P="preview-feedback";let k="";function E(){const e=g.notice,t=/[.!?…。!?]$/.test(e.heading)?e.heading:`${e.heading}.`;return{message:e.description?`${t} ${e.description}`:e.heading,status:e.status,isDismissible:e.dismissible,actions:[...e.retry?[{label:e.action,disabled:e.disabled,onClick:l.retry}]:[],...e.close?[{label:i.close,onClick:l.close}]:[]]}}function S(){x&&k&&x.removeNotice(P,C),k=""}function L(e){return()=>{H(),e()}}function V(){const{inPage:e,inPip:a,mode:w,modeLabel:P,movable:k,busy:S,canRefresh:V,hasPreview:j,canPip:O}=g;return(0,n.createElement)(o.SlotFillProvider,null,(0,n.createPortal)(k&&e&&(0,n.createElement)(o.Button,{className:"mtflpp-icon mtflpp-move",size:"compact",icon:s.move,label:i.move,showTooltip:!0,tooltipPosition:"bottom","data-action":"move"}),d),(0,n.createPortal)((0,n.createElement)(o.Button,{className:"mtflpp-icon",size:"compact",icon:S?(0,n.createElement)(o.Spinner):s.refresh,label:i.refresh,showTooltip:!0,accessibleWhenDisabled:!0,disabled:!V,onClick:l.refresh,"data-action":"refresh"}),c),(0,n.createPortal)(O&&j&&(0,n.createElement)("div",{className:"mtflpp-pip-surface"},(0,n.createElement)(o.Button,{className:"mtflpp-pip-button",icon:s.pip,label:i.popOutHelp,"aria-label":i.popOut,description:i.popOutHelp,showTooltip:!0,onClick:l.popOut,"data-action":"pop-out"})),p),function(){const{canPip:e,canFullscreen:t,inPage:r,inPip:a,dock:c,canRememberVisibility:d,rememberVisibility:u,rememberPosition:f,followChanges:p}=g;return(0,n.createElement)(o.DropdownMenu,{className:"mtflpp-actions",label:i.actions,icon:s.more,open:v,onToggle(e){v=e,e&&(b=!1),T()},toggleProps:{className:"mtflpp-icon",size:"compact","data-action":"actions"},popoverProps:{placement:"bottom-end",offset:6,shift:!0,className:"mtflpp-menu-popover"}},()=>(0,n.createElement)(n.Fragment,null,(e||t)&&(0,n.createElement)(o.MenuGroup,{label:i.display},e&&(0,n.createElement)(o.MenuItem,{label:i.popOutHelp,description:i.popOutHelp,showTooltip:!0,onClick:L(l.popOut),"data-action":"pip","aria-label":i.popOut},i.popOut),t&&(0,n.createElement)(o.MenuItem,{onClick:L(l.fullscreen),"data-action":"fullscreen"},i.fullscreen)),r&&(0,n.createElement)(o.MenuGroup,{label:i.position},(0,n.createElement)(o.MenuItemsChoice,{value:c,choices:[{value:"left",label:i.bottomLeft},{value:"center",label:i.bottomCenter},{value:"right",label:i.bottomRight}],onSelect(e){H(),l.dock(e)}})),(0,n.createElement)(o.MenuGroup,{label:i.preferences},!1!==d&&(0,n.createElement)(o.MenuItem,{role:"menuitemcheckbox",isSelected:u,icon:u?s.check:void 0,info:i.rememberVisibilityHelp,onClick:L(l.rememberVisibility),"data-action":"remember-visibility"},i.rememberVisibility),(0,n.createElement)(o.MenuItem,{role:"menuitemcheckbox",isSelected:f,icon:f?s.check:void 0,info:i.rememberPositionHelp,onClick:L(l.rememberPosition),"data-action":"remember-position"},i.rememberPosition),(0,n.createElement)(o.MenuItem,{role:"menuitemcheckbox",isSelected:p,icon:p?s.check:void 0,info:i.followHelp,onClick:L(l.follow),"data-action":"follow"},i.follow)),r&&(0,n.createElement)(o.MenuGroup,null,(0,n.createElement)(o.MenuItem,{info:i.resetHelp,onClick:L(l.reset),"data-action":"reset"},i.reset)),a&&(0,n.createElement)(o.MenuGroup,null,(0,n.createElement)(o.MenuItem,{onClick:L(l.close),"data-action":"close"},i.closeLivePreview))))}(),!a&&(0,n.createElement)(o.Button,{className:"mtflpp-icon mtflpp-mode",size:"compact",icon:s[w],label:P,showTooltip:!0,onClick:l.mode,"data-action":"mode"}),!a&&(0,n.createElement)(o.Button,{className:"mtflpp-icon",size:"compact",icon:s.close,label:i.close,showTooltip:!0,onClick:l.close,"data-action":"close"}),(0,n.createPortal)(function(){const{device:e,orientation:t}=g;return(0,n.createElement)(o.Toolbar,{className:"mtflpp-devices",label:i.viewport,variant:"unstyled"},...["desktop","tablet","mobile"].map(r=>{const a=e===r,c=a&&"desktop"!==r,d=c&&"landscape"===t,u="portrait"===t?i.rotateLandscape:i.rotatePortrait;return(0,n.createElement)(o.ToolbarButton,{key:r,icon:s[r],className:d?"mtflpp-device-rotated":void 0,label:c?`${i[r]} — ${u}`:i[r],isPressed:a,"data-viewport":r,onClick:()=>l.device(r)})}))}(),u),(0,n.createPortal)(function(){const{fit:e,customZoom:t=100,dpr:r=1}=g,a={automatic:i.automatic,window:i.fitToWindow,width:i.fitToWidth},c={automatic:i.automaticHelp,window:i.fitToWindowHelp,width:i.fitToWidthHelp},d="custom"===e?i.fixedZoom:a[e]??i.automatic;return(0,n.createElement)(o.Dropdown,{open:b,onToggle(e){b=e,e&&(v=!1,y="custom"===g.fit),T()},contentClassName:"mtflpp-zoom-popover",focusOnMount:"firstElement",popoverProps:{placement:"top-end",offset:8,shift:!0,resize:!1,role:"dialog","aria-label":i.fitting},renderToggle:({isOpen:e,onToggle:t})=>(0,n.createElement)(o.Button,{className:"mtflpp-zoom-toggle",variant:"secondary",size:"compact",label:d,showTooltip:!0,"aria-label":`${i.fitting}: ${d}`,"aria-haspopup":"dialog","aria-expanded":e,onClick:t,"data-action":"zoom"},(0,n.createElement)("span",{className:"mtflpp-zoom-value"},d),s.chevron),renderContent:()=>(0,n.createElement)("div",{className:"mtflpp-zoom-content"},(0,n.createElement)(o.RadioControl,{label:i.zoomMode,selected:e,options:[...Object.entries(a).map(([e,t])=>({value:e,label:t,description:c[e]})),{value:"custom",label:i.fixedZoom,description:i.fixedZoomHelp}],onFocus(e){if(!y)return;y=!1;const t=e.currentTarget.closest(".mtflpp-zoom-content")?.querySelector('.mtflpp-custom-zoom input[type="number"]');t?.focus({preventScroll:!0});const n=t?.closest(".components-popover__content");if(n){const e=t.getBoundingClientRect(),o=n.getBoundingClientRect();n.scrollTop+=Math.min(0,e.top-o.top)+Math.max(0,e.bottom-o.bottom)}},onChange(e){y=!1,"custom"!==e?l.fit(e):l.zoom(t)}}),"custom"===e&&(0,n.createElement)("div",{className:"mtflpp-custom-zoom",onKeyDown(e){if("Enter"!==e.key)return;e.preventDefault();const t=Number(e.target.value);!1!==e.target.validity?.valid&&Number.isInteger(t)&&t>=10&&t<=400&&H()}},(0,n.createElement)(o.RangeControl,{label:i.customZoom,min:10,max:400,step:1,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:t,help:i.customZoomHelp,withInputField:!0,onChange(e){Number.isInteger(e)&&e>=10&&e<=400&&l.zoom(e)}})),(0,n.createElement)("div",{className:"mtflpp-dpr-note",role:"group","aria-label":i.displayInformation},(0,n.createElement)("span",{className:"mtflpp-dpr-value"},`${i.displayDpr}: ${Number(r.toFixed(2))}`),(0,n.createElement)("span",{className:"mtflpp-pixel-note"},i.pixelZoomHelp)))})}(),f),(0,n.createPortal)(function(){const{empty:e}=g;return e?(0,n.createElement)(o.Placeholder,{className:"mtflpp-placeholder","data-empty-icon":e.busy?void 0:e.icon,icon:e.busy?(0,n.createElement)(o.Spinner):s[e.icon],label:(0,n.createElement)("h3",{className:"mtflpp-empty-title",tabIndex:-1,"data-action":"empty-title"},e.heading),instructions:e.description},e.retry&&(0,n.createElement)(o.Button,{key:"retry",variant:"primary",disabled:e.disabled,onClick:l.retry,"data-action":"retry"},e.action),e.close&&(0,n.createElement)(o.Button,{key:"close",variant:"secondary",onClick:l.close,"data-action":"close"},i.close),e.note&&(0,n.createElement)("p",{className:"mtflpp-empty-note"},e.note)):null}(),m),(0,n.createPortal)(function(){if(!g.notice)return null;if(x){const e=(0,n.createElement)(r.InlineNotices,{context:C,className:"mtflpp-inline-notices"});return M?(0,n.createElement)(M,{cornerRadius:"none"},e):e}const{message:e,...t}=E();return(0,n.createElement)(o.Notice,{...t,onRemove:l.dismissNotice,spokenMessage:"",politeness:"polite"},e)}(),h),e?(0,n.createPortal)((0,n.createElement)(o.Popover.Slot),t.ownerDocument.body):(0,n.createElement)(o.Popover.Slot))}function T(){g&&w&&(function(){if(!x)return;if(!g.notice)return void S();const e=JSON.stringify(g.notice);if(k===e)return;const{message:t,status:n,...o}=E();x.createNotice(n,t,{...o,id:P,context:C,speak:!1,onDismiss:l.dismissNotice}),k=e}(),(0,n.flushSync)(()=>w.render((0,n.createElement)(V))))}function H(){(v||b)&&(v=!1,b=!1,T())}function j(e){g?.inPip&&"mode"===e&&(e="actions"),t.querySelector(`[data-action="${e}"]`)?.focus({preventScroll:!0})}return{update(e){const n=b&&!e.hasPreview&&t.ownerDocument.activeElement?.closest(".mtflpp-zoom-popover");e.hasPreview||(b=!1),g=e,T(),n&&j("empty-title")},closeMenu:H,focus:j,beforeMove(){v=!1,b=!1,w?.unmount(),w=null,S()},remount(){w=(0,n.createRoot)(a),T()}}}(H,i,{refresh:()=>{ce.canRefresh&&h()},retry:()=>{"handover"!==ce.state&&(le||ce.canRetry&&["error","conflict"].includes(ce.state))&&g(le)},dismissNotice:()=>{ve(),I.textContent=ce.text,_.focus("actions")},mode:Se,close:function(){_.closeMenu(),ye(!1),m(),d||E()?j.focus():u.focus()},popOut:async function(){if(U||x.fullscreenElement===H||!ke())return;let e;_.closeMenu();const t=()=>{U===e&&(w(),G.beforeMove(),_.beforeMove(),x.body.append(H),H.classList.remove("mtflpp-pip"),U=null,_.remount(),Ce(),G.afterMove(),Ee(),v(),K&&_.focus("mode"))};try{if(e=await y.documentPictureInPicture.requestWindow({width:640,height:440}),!K)return void e.close();const n=y.getComputedStyle(H);e.document.documentElement.lang=x.documentElement.lang,e.document.documentElement.dir=n.direction;for(const t of["--wp-admin-theme-color","--wp-admin-theme-color-darker-10","--wp-admin-border-width-focus"]){const o=n.getPropertyValue(t);o&&e.document.documentElement.style.setProperty(t,o)}const o=x.querySelectorAll(['link[rel="stylesheet"][href*="/load-styles.php"]',"#wp-theme-css","#wp-theme-inline-css","#wp-components-css","#wp-components-inline-css","style[data-emotion]","style[data-wp-hash]","#meet-the-frontend-live-preview-panel-css","#meet-the-frontend-live-preview-panel-inline-css"].join(", "));for(const t of o){const n=t.cloneNode(!0);"STYLE"===t.tagName&&t.sheet&&(n.textContent=Array.from(t.sheet.cssRules,e=>e.cssText).join("\n")),n.addEventListener("load",G.layout,{once:!0}),e.document.head.append(n)}e.document.title=D.textContent,e.document.body.className="mtflpp-pip-document",e.addEventListener("resize",G.layout),e.addEventListener("pagehide",t,{once:!0}),U=e,w(),G.beforeMove(),_.beforeMove(),H.classList.add("mtflpp-pip"),e.document.body.append(H),_.remount(),G.afterMove(),Ee(),ve(),_.focus("mode"),v()}catch{e&&(t(),e.close()),_.focus("actions"),we(i.pipFailed)}},fullscreen:async function(){if(!U&&x.fullscreenEnabled){_.closeMenu();try{await H.requestFullscreen(),ve(),_.focus("mode")}catch{_.focus("actions"),we(i.fullscreenFailed)}}},dock:e=>Pe(e),reset:()=>Pe("right",!0),follow:function(){V=!V,P.set(M,"scrollToChanges",V),Ee(),V&&ce.canRefresh&&h(!1)},rememberVisibility:function(){S=!S,P.set(M,"rememberVisibility",S),S&&ye(K),Ee()},rememberPosition:function(){L=!L,P.set(M,"rememberPosition",L),L?xe():(P.set(M,"position",te),P.set(M,"layout",void 0)),Ee()},device(e){const t=G.device;if(e===t&&"desktop"===e)return;let n=!1;if(K&&V&&b){const{fit:e,customZoom:t,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:l}=G;n=!!b({canvas:B,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:l,canFollow:()=>G.fit===e&&G.customZoom===t})}const o={animate:K&&!n,keepPan:n};e===t?(G.rotate(o),P.set(M,`${e}Orientation`,G.orientation)):(G.select(e,o),G.device!==t&&P.set(M,"viewport",G.device)),Ee()},fit(e){const t=G.fit;G.setFit(e),G.fit!==t&&P.set(M,"fitMode",G.fit),Ee()},zoom(e){const t=G.fit,n=G.customZoom;G.setZoom(e),G.customZoom!==n&&P.set(M,"customZoom",G.customZoom),G.fit!==t&&P.set(M,"fitMode",G.fit),Ee()}}),be(i.loading,"loading",{canRetry:!1}),Ce(),Ve(),d&&(d.disabled=!1),{stage:A,canvasTarget:G.canvasTarget,get visible(){return K},get followChanges(){return V},openFromLauncher:Te,setVisible(e){e||(_.closeMenu(),se="",Ee(),G.layout()),K=e,Ce(),Ve()},report:be,setTitle:ue,clearPreview(){A.replaceChildren();const e=["ready","stale","loading"].includes(ce.state);be(e?i.loading:ce.text,e?"loading":ce.state,{...ce,hasPreview:!1,hasHtmlPreview:!1,redirectDestination:void 0,canRefresh:!1,canRetry:!e&&ce.canRetry})},returnToEditor(){_.closeMenu(),U?.close(),x.fullscreenElement===H&&x.exitFullscreen().catch(()=>{})}}}function d(e=[]){const t=Array.isArray(e)?[...e]:[],n=new WeakMap;return{capture(e,o){try{if(n.has(e))return;const r=function(e){try{const t=e.querySelector('meta[name="meet-the-frontend-live-preview-panel"]'),n=t?.getAttribute("data-mtflpp-source");if(!n)return null;const o=JSON.parse(n);if("string"!=typeof o)return null;const r=(new DOMParser).parseFromString(o,"text/html");return r.querySelector('meta[name="meet-the-frontend-live-preview-panel"]')?.content===t.content?r:null}catch{return null}}(e);n.set(e,{source:r?m(r,e,t):null,dom:m(e,e,t),values:o&&Object.fromEntries(Object.entries(o).map(([e,t])=>[e,{...t}]))})}catch{}},findChange(e,t){try{const o=n.get(e),r=n.get(t);if(!o||!r)return null;const i=function(e,t){if(!e||!t)return[];const n=[];for(const o of new Set([...Object.keys(e),...Object.keys(t)])){const r=Object.hasOwn(e,o)?e[o]:{type:t[o]?.type,value:""},i=Object.hasOwn(t,o)?t[o]:{type:e[o]?.type,value:""};if(r.type!==i.type||!["text","html"].includes(i.type)||"string"!=typeof r.value||"string"!=typeof i.value||r.value===i.value)continue;let l,s;try{l="html"===r.type?(new DOMParser).parseFromString(r.value,"text/html"):null,s="html"===i.type?(new DOMParser).parseFromString(i.value,"text/html"):null}catch{continue}const a=l?m(l,l,[],l.body):null,c=s?m(s,s,[],s.body):null,d=l?k(a):r.value,u=s?k(c):i.value,f=v(d),p=v(u);if(f!==p&&n.push({...E(f,p),type:"text"}),!l){const e=P(d,u);e&&n.push(e);continue}if(a&&c&&(f===p||b(d,u)))for(const e of w(a,c)){if(e.spacing){const t=C(e);t&&n.push(t);continue}if(f===p)if("attributes"===e.kind){const t=new Map(e.before.attributes),o=new Map(e.after.attributes);for(const e of new Set([...t.keys(),...o.keys()])){const r=t.get(e)??"",i=o.get(e)??"";JSON.stringify(r)!==JSON.stringify(i)&&n.push({type:"attribute",name:e,before:"string"==typeof r?r:JSON.stringify(r),after:"string"==typeof i?i:JSON.stringify(i)})}}else"content"===e.kind&&(v(k(e.before))===v(k(e.after))&&n.push({type:"markup",before:v(k(e.before)),after:v(k(e.after)),oldTag:e.before.tag,newTag:e.after.tag}),(e.before.media||[]).forEach((t,o)=>{const r=e.after.media?.[o];t&&r&&t!==r&&n.push({type:"media",before:t,after:r})}))}}return n}(o.values,r.values),l=function(e,t){if(!e||!t)return!1;const n=(e,t)=>Object.entries(e).some(([e,n])=>"order"!==n?.type&&(!Object.hasOwn(t,e)||n?.type!==t[e]?.type||n?.value!==t[e]?.value));return n(e,t)||n(t,e)}(o.values,r.values),s=!!o.source&&!!r.source,a=!!o.source!=!!r.source,c=[...s?w(o.source,r.source).map(e=>({...e,source:!0})):[],...w(o.dom,r.dom)],d=new Map,h=function(e,t){const n=new Map,o=e=>k(e,n),r=[];for(const n of e){if(n.unresolved)for(const e of u(n,t,o))r.push(e);if("insert"===n.kind&&n.added.length>1){const e=n.added.map(e=>{const r={...n,after:e,added:[e]},i=T(r,t,o);return{...r,input:i}}).filter(e=>e.input);if(e.length){r.push(...e);continue}}const e=T(n,t,o);r.push({...n,input:e})}return r}(c,i).filter(e=>(e.source||!s&&!a||e.input||l&&2===e.priority)&&(e.priority>0||e.input)&&(!e.spacing||function({before:e,after:t},n,o){const r=y(e,n,o),i=y(t,n,o);return r&&i&&r.omitted===i.omitted&&b(r.text,i.text)}(e,d,r.dom?.excluded)));return function(e,t){if(!e.length)return null;const n=e.reduce((e,t)=>Math.max(e,t.input),0),o=e.filter(e=>e.input===n),r=o.reduce((e,t)=>Math.max(e,t.priority),0),i=o.filter(e=>e.priority===r);if(i.some(e=>e.unresolved))return function(e,t){const n=e.find(e=>e.unresolved&&("replacement"===e.regionChange||"reorder"===e.regionChange&&(e.source||t))),o=n?.after.node;if(!o?.isConnected)return null;for(const t of e)if(t.unresolved){if(n.source&&!t.source&&"reorder"===t.regionChange)continue;if(!t.regionChange||t.after.node!==o)return null}else if(!("insert"===t.kind?t.added:[t.after]).every(e=>o.contains(e.node)))return null;return"contents"!==o.ownerDocument.defaultView.getComputedStyle(o).display?o:null}(i,t);const l=i.filter(e=>!e.input||e.directInput||!i.some(t=>t!==e&&e.matches?.length&&e.matches.every(e=>t.matches?.includes(e))&&H(e.after,t.after))),s=new Map,a=l.filter(e=>{const t="delete"===e.kind&&(e.following[0]||e.preceding[0])||e.after,n=t?.node;if(!n)return!0;const o="delete"!==e.kind||e.following.length?e.kind:"delete-last",r=s.get(n)||new Set;return!r.has(o)&&(r.add(o),s.set(n,r),!0)});return n&&s.size>1?null:function(e){const t=new Set,n=new Set;for(const o of e){let e,r=!1;"delete"===o.kind?(r=!o.removed.some(p),e=r?o.after:o.following.find(p)||o.preceding.find(p)||o.following.find(f)||o.preceding.find(f)||o.after):e="insert"===o.kind?o.added.find(p)||o.added.find(f):o.after;const i=f(e);if(!i)continue;const l=p(e),s=l||i;(l&&!r?t:n).add(s)}const o=t.size?t:n;return 1===o.size?o.values().next().value:null}(a)}(h,!s&&(l||function(e,t){return!!e&&!!t&&Object.entries(t).some(([t,n])=>{if("order"!==n?.type||!Object.hasOwn(e,t))return!1;const o=e[t];return"order"===o?.type&&o.members===n.members&&o.value!==n.value})}(o.values,r.values)))}catch{return null}}}}function u(e,t,n){const o=[];for(const r of t){if(!r.after||"spacing"===r.type)continue;const t=V(e.oldRange,r.before,n,r,!0),i=V(e.newRange,r.after,n,r,!1);if(!t.length)continue;const l="markup"===r.type&&r.oldTag===r.newTag;if(l||!r.before||!(t.length<=V(e.newRange,r.before,n,r,!0).length||i.length<=V(e.oldRange,r.after,n,r,!1).length))for(const n of i)l&&!t.some(e=>e.signature!==n.signature)||o.push({...e,unresolved:!1,before:null,after:n,kind:"content",input:r.before&&r.after?2:1,priority:2,matches:[r]})}return o}function f(e){if(e?.node)return e.node;for(const t of e?.children||[]){const e=f(t);if(e)return e}return null}function p(e){const t=e?.node;if(t?.getClientRects().length&&"visible"===t.ownerDocument.defaultView.getComputedStyle(t).visibility)return t;for(const t of e?.children||[]){const e=p(t);if(e)return e}return null}function m(e,t,n,o=e.querySelector('main, [role="main"]')||e.querySelector("article")||e.body){if(!o)return null;const r=n.filter(e=>{if("string"!=typeof e||!e.trim())return!1;try{return o.matches(e),!0}catch{return!1}}).join(", "),i=new Map,l=new Map;if(e!==t)for(const e of t.querySelectorAll("[data-mtflpp-node]")){const t=e.getAttribute("data-mtflpp-node");l.set(t,l.has(t)?null:e)}for(const n of[o,...o.querySelectorAll("*")]){if(r&&n.closest(r))continue;const o=[...n.childNodes].filter(e=>3===e.nodeType).map(e=>e.textContent),s=v(o.join(" ")),a=["img","source","video","audio","iframe"].includes(n.localName)?["src","srcset","poster"].map(e=>n.getAttribute(`data-${e}`)||n.getAttribute(e)||""):[],c=n.style?.backgroundImage||n.getAttribute("data-bg")||"",d=e===t?n:l.get(n.getAttribute("data-mtflpp-node"))||null,u=h(n,d,JSON.stringify([n.localName,s,a,c]));u.text=s,u.rawText=o.join(""),u.media=[...a,c],u.parent=i.get(n.parentElement),i.set(n,u),u.parent?.children.push(u)}for(const[e,t]of i)t.parts=[...e.childNodes].map(e=>3===e.nodeType?e.textContent:i.get(e)).filter(e=>void 0!==e);let s=i.get(o);if(!s)return null;const a=s.node;for(let e=o.parentElement;e;e=e.parentElement){const t=h(e,a,e.localName);t.children=[s],t.parts=[s],s=t}return s.excluded=r,s}function h(e,t,n){const o=function(e){const t=[];for(const{name:n,value:o}of e.attributes){if("data-mtflpp-node"===n||n.startsWith("on")||/(?:^|-)(nonce|token)(?:-|$)/.test(n))continue;if(/^(?:data-)?(?:src|srcset|poster|sizes|bg)$/.test(n))continue;let r=o;"class"===n&&(r=[...e.classList].sort().join(" ")),"style"===n&&(r=[...e.style].sort().map(t=>[t,e.style.getPropertyValue(t),e.style.getPropertyPriority(t)])),("class"!==n&&"style"!==n||r.length)&&t.push([n,r])}return t.sort(([e],[t])=>e.localeCompare(t))}(e);return{node:t,tag:e.localName,signature:n,attributes:o,children:[],parts:[],presentation:JSON.stringify(o.filter(([e])=>!g(e))),references:JSON.stringify(o.filter(([e])=>g(e)))}}function g(e){return["id","for","headers","aria-controls","aria-labelledby","aria-describedby","aria-owns","aria-flowto","aria-activedescendant","aria-details","aria-errormessage"].includes(e)}function w(e,t){const n=new Map,o=new Map,r=new Map,i=new Map,l=[];function s(e){const t=JSON.stringify(e);return n.has(t)||n.set(t,n.size+1),n.get(t)}function a(e){if(!e)return 0;const t=s([e.signature,e.children.map(a)]);return o.set(e,t),r.set(e,s([t,e.presentation,e.children.map(e=>r.get(e))])),i.set(e,s([t,e.presentation,e.references,e.children.map(e=>i.get(e))])),t}a(e),a(t);const c=e=>o.get(e);function d(e){const t=e.attributes.find(([e])=>"id"===e)?.[1];return t?`${e.tag} ${t}`:void 0}function u(e){if(!(e.children.length<2))return s(["collection",e.signature,e.children.map(c).sort((e,t)=>e-t)])}function f(e,t){const n=new Map;return e.forEach((e,o)=>{const r=t(e);void 0!==r&&n.set(r,n.has(r)?-1:o)}),n}return function e(t,n){t&&n&&(t.signature!==n.signature?l.push({kind:"content",before:t,after:n,priority:2}):t.rawText!==n.rawText&&l.push({kind:"content",before:t,after:n,priority:2,spacing:!0}),t.presentation===n.presentation&&t.references===n.references||l.push({kind:"attributes",before:t,after:n,priority:t.presentation!==n.presentation?1:0}),function(t,n,s,a){const p=a.parent&&s.parent&&a.tag===s.tag,m=f(t,c),h=f(n,c);let g,w,v,b;const y=new Set(t.flatMap(e=>[r.get(e),i.get(e)])),x=new Set(n.flatMap(e=>[r.get(e),i.get(e)]));function M(e,t,n){const o=n.get(e),r=n.get(t);return o===r||!x.has(o)&&!y.has(r)}function C(e,t){return o.get(e)===o.get(t)&&M(e,t,r)&&M(e,t,i)}function P(e,r,i,s,c){const d=t.slice(e,r),u=n.slice(i,s),f="replacement"===c&&p&&d.some(e=>!h.has(o.get(e)))&&u.some(e=>!m.has(o.get(e)))&&(!function(e,t){if(e.length<2||t.length<2)return!1;const n=e.filter(e=>e.children.length).length,o=t.filter(e=>e.children.length).length;if(!n&&!o||n>1&&o>1)return!0;const r=new Map;for(const{tag:e}of t)r.set(e,(r.get(e)||0)+1);let i=0;for(const{tag:t}of e){const e=r.get(t);if(e){if(2===++i)return!0;r.set(t,e-1)}}return!1}(d,u)||"form"===a.tag&&function(e,t){function n(e){const t=new Set;return e.every(function e(n){if(["input","select","textarea"].includes(n.tag)){const e=n.attributes.find(([e])=>"name"===e)?.[1],o=n.attributes.find(([e])=>"type"===e)?.[1]?.toLowerCase();return!(!e||"input"===n.tag&&"hidden"===o||(t.add(e),0))}let o=!1;for(const t of n.children)e(t)&&(o=!0);return o})?t:null}const o=n(e),r=n(t);return o&&r&&[...o].some(e=>!r.has(e))&&[...r].some(e=>!o.has(e))}(d,u)),g=p&&("reorder"===c||f)?c:void 0;l.push({kind:"region",after:a,priority:2,unresolved:!0,regionChange:g,oldRange:d,newRange:u})}function k(e,n,o,r,i,l,s){const a=[];for(let c=e;c<n;c++){const e=s(t[c]),n=l.get(e);if(!(i.get(e)!==c||void 0===n||n<o||n>=r)){if(a.length&&n<=a[a.length-1][1])return null;a.push([c,n])}}return a}!function r(i,s,y,x){for(;i<s&&y<x&&C(t[i],n[y]);)e(t[i],n[y]),i++,y++;for(;i<s&&y<x&&C(t[s-1],n[x-1]);)s--,x--,e(t[s],n[x]);if(i===s&&y===x)return;if(i===s||y===x){const e=y===x,r=e?t.slice(i,s):n.slice(y,x),c=e?[n[y-1],n[y]]:[t[i-1],t[i]];return void(r.some(e=>c.some(t=>t&&o.get(t)===o.get(e)))?P(i,s,y,x):e?l.push({kind:"delete",after:a,removed:r,priority:2,following:n.slice(y),preceding:n.slice(0,y).reverse()}):l.push({kind:"insert",after:r[0],added:r,priority:2}))}if(s-i===1&&x-y===1)return void e(t[i],n[y]);if(p&&function(e,r,i,l){const s=r-e;if(s<2||s!==l-i)return!1;const a=new Map;let c=!1;for(let r=0;r<s;r++){const l=o.get(t[e+r]),s=o.get(n[i+r]);c||=l!==s,a.set(l,(a.get(l)||0)+1),a.set(s,(a.get(s)||0)-1)}return c&&[...a.values()].every(e=>0===e)}(i,s,y,x))return void P(i,s,y,x,"reorder");let M=k(i,s,y,x,m,h,c);if(0===M?.length&&(g??=f(t,d),w??=f(n,d),M=k(i,s,y,x,g,w,d)),0===M?.length&&(v??=f(t,u),b??=f(n,u),M=k(i,s,y,x,v,b,u)),M?.length)for(const[o,l]of[...M,[s,x]])r(i,o,y,l),o<s&&e(t[o],n[l]),i=o+1,y=l+1;else P(i,s,y,x,M?"replacement":void 0)}(0,t.length,0,n.length)}(t.children,n.children,t,n))}(e,t),l}function v(e){return e.replace(/\s+/g," ").trim()}function b(e,t){return e!==t&&e.replace(/\s/g,"")===t.replace(/\s/g,"")}function y(e,t,n){for(;e.node?.isConnected&&e.parent?.node;){const{display:t}=e.node.ownerDocument.defaultView.getComputedStyle(e.node);if("inline"!==t&&"contents"!==t)break;e=e.parent}if(!t.has(e)){const{node:o}=e,r=[],i=o?.isConnected&&x(o,n,r)===M(e)&&p(e)?o.innerText:void 0;t.set(e,"string"==typeof i?{text:i,omitted:JSON.stringify(r)}:void 0)}return t.get(e)}function x(e,t,n){return t&&e.querySelector(t)?[...e.childNodes].map(e=>3===e.nodeType?e.textContent:1!==e.nodeType?"":e.matches(t)?(n.push(e.textContent),""):x(e,t,n)).join(""):e.textContent}function M(e){return e.parts.map(e=>"string"==typeof e?e:M(e)).join("")}function C({before:e,after:t}){return P(e.rawText,t.rawText)||P(M(e),M(t))}function P(e,t){if(!/\S/.test(e)||!b(e,t))return;const n=e.match(/\s+|\S+/g),o=t.match(/\s+|\S+/g);let r=0,i=0;for(;r<Math.min(n.length,o.length)&&n[r]===o[r];)r++;for(;i<Math.min(n.length,o.length)-r&&n.at(-1-i)===o.at(-1-i);)i++;const l=Math.max(0,r-1),s=Math.max(0,i-1);return{type:"spacing",before:n.slice(l,n.length-s).join(""),after:o.slice(l,o.length-s).join("")}}function k(e,t=new Map){return e?(t.has(e)||t.set(e,(e.parts||[]).map(e=>{if("string"==typeof e)return e;const n=k(e,t);return/^(?:p|div|section|article|main|aside|header|footer|nav|h[1-6]|li|[ou]l|d[ldt]|blockquote|pre|table|tr|t[dh]|caption|figure|figcaption|br|hr)$/.test(e.tag)?` ${n} `:n}).join("")),t.get(e)):""}function E(e,t){let n=0,o=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;for(;o<e.length-n&&o<t.length-n&&e[e.length-o-1]===t[t.length-o-1];)o++;let r=e.length-o,i=t.length-o;for(;n>0&&/\S/.test(e[n-1]);)n--;if(r>n&&/\S/.test(e[r-1]))for(;r<e.length&&/\S/.test(e[r]);)r++;if(i>n&&/\S/.test(t[i-1]))for(;i<t.length&&/\S/.test(t[i]);)i++;return{before:e.slice(n,r).trim(),after:t.slice(n,i).trim()}}function S(e,t){return t?L(e,t):""===v(e)}function L(e,t){if(!t)return!1;let n=(e=v(e)).indexOf(t);for(;-1!==n;){const o=n+t.length;if(!(n&&/[\p{L}\p{N}_]/u.test(e[n-1])&&/[\p{L}\p{N}_]/u.test(t[0])||o!==e.length&&/[\p{L}\p{N}_]/u.test(e[o])&&/[\p{L}\p{N}_]/u.test(t.at(-1))))return!0;n=e.indexOf(t,n+1)}return!1}function V(e=[],t,n,o,r){return e.flatMap(e=>{const i=V(e.children,t,n,o,r);let l;return l="media"===o.type?e.media?.includes(t):"attribute"===o.type?e.attributes.some(([e,n])=>e===o.name&&L("string"==typeof n?n:JSON.stringify(n),t)):("markup"!==o.type||e.tag===(r?o.oldTag:o.newTag))&&S(n(e),t),"text"===o.type&&i.length?i:[...l?[e]:[],...i]})}function T(e,t,n){if(e.unresolved)return 0;if(e.matches=[],e.spacing){const n=t.filter(e=>"spacing"===e.type),o=n.length&&C(e);return e.matches=n.filter(e=>o?.before===e.before&&o?.after===e.after),e.matches.length?2:0}let o=0;for(const r of t){if("spacing"===r.type)continue;let t=0;if("attributes"===e.kind){if(!["text","attribute"].includes(r.type))continue;const n=r,o=new Map(e.before.attributes),i=new Map(e.after.attributes);for(const e of new Set([...o.keys(),...i.keys()])){if("attribute"===r.type&&e!==r.name)continue;const l=o.get(e),s=i.get(e);if(JSON.stringify(l)===JSON.stringify(s))continue;const a="string"==typeof l?l:JSON.stringify(l)||"",c="string"==typeof s?s:JSON.stringify(s)||"";S(a,n.before)&&S(c,n.after)&&(t="attribute"===r.type||r.before&&r.after?2:1)}}else"insert"===e.kind?!r.before&&e.added.some(e=>L(n(e),r.after))&&(t=Math.max(t,1)):"delete"===e.kind?!r.after&&e.removed.some(e=>L(n(e),r.before))&&(t=Math.max(t,1)):"media"===r.type?(e.before?.media||[]).some((t,n)=>t===r.before&&e.after?.media?.[n]===r.after)&&(t=2):"attribute"!==r.type&&("markup"!==r.type||e.before?.tag===r.oldTag&&e.after?.tag===r.newTag)&&S(n(e.before),r.before)&&S(n(e.after),r.after)&&(t=r.before&&r.after?2:1,"text"===r.type&&L(e.before?.text||"",r.before)&&L(e.after?.text||"",r.after)&&(e.directInput=!0));t&&e.matches.push(r),o=Math.max(o,t)}return o}function H(e,t){return!!e?.children.some(e=>e===t||e.node&&e.node===t?.node||H(e,t))}const j=new Set(["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","PageDown","PageUp","Home","End"," "]);function O(e,t){let n;for(const o of e?.rects??[]){const e=t(o);if(e.visible)return e;(!n||e.distance<n.distance)&&(n=e)}return n}function R(e){return new Promise(t=>{const n=()=>{e.clearTimeout(o),e.cancelAnimationFrame(r),t()},o=e.setTimeout(n,100);let r=e.requestAnimationFrame(()=>{r=e.requestAnimationFrame(n)})})}function N(e,t=!1){if(!q(e,{visibilityProperty:!0,opacityProperty:!0}))return;const{left:n,right:o,top:r,bottom:i,width:l,height:s}=e.getBoundingClientRect();if(!(t||l&&s))return;const a=e.ownerDocument,{documentElement:c,body:d,defaultView:u}=a,f={left:n,right:l?o:n+1,top:r,bottom:s?i:r+1},p={...f},m={x:f.right-f.left,y:f.bottom-f.top},h="visible"===u.getComputedStyle(c).overflow,g=u.getComputedStyle(e);for(let n=e;n&&n!==c;){const o=n===e?g:u.getComputedStyle(n),{position:r,display:i,overflowX:l,overflowY:s}=o;if(n!==e&&(n!==d||!h)&&"inline"!==i&&("visible"!==l||"visible"!==s)&&n.offsetWidth&&n.offsetHeight){const{bounds:e,scaleX:r,scaleY:i}=W(n,o);for(const[a,c,d,u,h]of[["x",l,"left","right",r],["y",s,"top","bottom",i]]){if("visible"===c)continue;const r="clip"===c?[0,0]:A(n,o,a,h),i=t&&"hidden"===c,l="y"===a==("horizontal-tb"===o.writingMode);if(i&&r.some(e=>e)&&(l||f[d]<e[d]||f[u]>e[u]||$(o,g,a)))return{boundary:n};if(!B(f,p,e,d,u,i?[0,0]:r))return{boundary:n};m[a]=Math.min(m[a],p[u]-p[d])}}n="absolute"===r||"fixed"===r?n.offsetParent:n.parentElement}return{clipped:f,extent:m}}function $(e,t,n){const o=e=>e&&"auto"!==e&&0!==parseFloat(e);return("x"===n?["Left","Right"]:["Top","Bottom"]).some(n=>o(e[`scrollPadding${n}`])||o(t[`scrollMargin${n}`]))}function D(e,t,n=!1){const o=N(e,n);if(!o?.clipped)return;const{clipped:r,extent:i}=o,{ownerDocument:l}=e,s=l.documentElement;if(r.left=Math.max(s.clientLeft,r.left),r.right=Math.min(s.clientLeft+s.clientWidth,r.right),r.top=Math.max(0,r.top),r.bottom=Math.min(s.clientHeight,r.bottom),r.right<=r.left)return{rects:[]};const a=t?.({...r,top:0,bottom:s.clientHeight}),c=a?.visibleCenterX??(r.left+r.right)/2,d=X(e,c);if(r.bottom<=r.top)return{rects:[],header:d?.bottom};const u={rects:[r],inViewport:!0,extent:i};if(!d)return u;const f={left:Math.max(r.left,d.left),right:Math.min(r.right,d.right),top:Math.max(r.top,d.top),bottom:Math.min(r.bottom,d.bottom)};if(!F(f)||!d.node.contains(l.elementFromPoint(c,(f.top+f.bottom)/2)))return u;const p=[{...r,top:f.bottom},{...r,bottom:f.top},{...f,left:r.left,right:f.left},{...f,left:f.right,right:r.right}].filter(F);return!p.length&&d.bottom>=s.clientHeight&&d.top<=0?void 0:{rects:p,inViewport:!0,extent:i,header:d.bottom}}function F({left:e,right:t,top:n,bottom:o}){return t>e&&o>n}function B(e,t,n,o,r,[i,l]){return e[o]=Math.max(e[o],n[o]),e[r]=Math.min(e[r],n[r]),t[o]=Math.max(n[o],t[o]+i),t[r]=Math.min(n[r],t[r]+l),t[r]>t[o]}function A(e,t,n,o){const r="x"===n,i=r?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight;if(i<=0)return[0,0];const l=r?e.scrollLeft:e.scrollTop,s=t.display.endsWith("flex")&&t.flexDirection===(r?"row-reverse":"column-reverse"),a=(r&&"rtl"===t.direction)!==s;let c=a?-i:0,d=a?0:i;return("horizontal-tb"!==t.writingMode||l<c||l>d)&&(c=-i,d=i),[(l-d)*o,(l-c)*o]}function W(e,t){const n=e.getBoundingClientRect(),o=n.width/e.offsetWidth,r=n.height/e.offsetHeight,i=n.left+e.clientLeft*o,l=n.top+e.clientTop*r,s={left:i,top:l,right:i+e.clientWidth*o,bottom:l+e.clientHeight*r},a=t.overflowClipMargin;if("clip"!==t.overflowX&&"clip"!==t.overflowY||!a||"0px"===a)return{bounds:s,scaleX:o,scaleY:r};const c=a.split(" ").map(parseFloat).find(Number.isFinite)??0,d=a.includes("border-box")?n:s,u=a.includes("content-box");return{scaleX:o,scaleY:r,bounds:{left:d.left+((u?parseFloat(t.paddingLeft):0)-c)*o,right:d.right-((u?parseFloat(t.paddingRight):0)-c)*o,top:d.top+((u?parseFloat(t.paddingTop):0)-c)*r,bottom:d.bottom-((u?parseFloat(t.paddingBottom):0)-c)*r}}}function q(e,t={visibilityProperty:!0}){return!!e?.isConnected&&!!e.getClientRects().length&&(!e.checkVisibility||e.checkVisibility(t))&&"visible"===e.ownerDocument.defaultView.getComputedStyle(e).visibility}function z(e){return e.matchMedia("(prefers-reduced-motion: reduce)").matches?"instant":"smooth"}function Z(e,{behavior:t,header:n=G(e),nearest:o=!1}={}){const r=e.ownerDocument,i=r.defaultView,l=t??z(i);if(o&&!n)return void e.scrollIntoView({behavior:l,block:"nearest",inline:"nearest"});const s=i.getComputedStyle(e).scrollMarginTop,a=r.documentElement,c=a.clientHeight,d=i.getComputedStyle(a),u=_(d.scrollPaddingTop,c),f=_(d.scrollPaddingBottom,c);let p,m;try{let t=o?"nearest":"start";if(o){const e=n-parseFloat(s);null!==u&&e>u&&(p=a.getAttribute("style"),a.style.setProperty("scroll-padding-top",`${e}px`,"important"))}else{const t=n>0&&null!==u?`max(${s}, ${n-u}px)`:s;m=e.getAttribute("style"),e.style.setProperty("scroll-margin-top",`calc(${t} + 1lh)`,"important")}if(!o&&null!==u&&null!==f){const n=i.getComputedStyle(e),o=c-u-f-parseFloat(n.scrollMarginTop)-parseFloat(n.scrollMarginBottom),r=o-e.getBoundingClientRect().height;if(r>=0&&(t="center"),r>0&&"horizontal-tb"===d.writingMode){const e=Math.min(o/3,r);p=a.getAttribute("style"),a.style.setProperty("scroll-padding-bottom",`${f+e}px`,"important")}}e.scrollIntoView({behavior:l,block:t,inline:"nearest"})}finally{void 0!==p&&I(a,p),void 0!==m&&I(e,m)}}function I(e,t){e.setAttribute("style",t??""),null===t&&e.removeAttribute("style")}function _(e,t){if("auto"===e)return 0;const n=parseFloat(e);return Number.isFinite(n)?n*(e.endsWith("%")?t/100:1):null}function G(e){const t=e.getBoundingClientRect();return X(e,t.left+t.width/2)?.bottom??0}function X(e,t){const n=e.ownerDocument;for(let o=n.elementFromPoint(t,1);o&&!o.contains(e);o=o.parentElement){const e=n.defaultView.getComputedStyle(o);if("fixed"!==e.position&&"sticky"!==e.position)continue;if("0"===e.opacity||!q(o,{visibilityProperty:!0,opacityProperty:!0}))continue;const{left:t,right:r,top:i,bottom:l}=o.getBoundingClientRect();if("fixed"===e.position||i<=parseFloat(e.top)+1)return{node:o,left:t,right:r,top:i,bottom:l}}}window.jQuery(()=>{const e=window.meetTheFrontendLivePreviewPanel;if(e)try{const t=window.wp?.revisions?.view?.frame?.model;if(!t||"function"!=typeof t.get||"function"!=typeof t.on||"function"!=typeof t.off)throw new Error("The native revision selection is unavailable.");const n=document.querySelector("#wpbody-content > .wrap > h1.long-header + a");if(!n)throw new Error("The native revision header is unavailable.");!function(e,t,n){const{strings:o}=e;let r,i=t.get("to"),l=0;const s=n.ownerDocument,a=s.getElementById("mtflpp-toggle");a.classList.replace("mtflpp-launcher","mtflpp-inline-launcher");const u=s.createElement("button");u.type="button",u.className="button-link",u.textContent=o.previewRevision,u.setAttribute("aria-controls","mtflpp-panel"),a.append(u),n.after(a);const f=c(o,{postTitle:m(i),publicRedirect:e.publicRedirect,inlineLauncher:u,canRememberVisibility:!1,onOpen(){f.setVisible(!0),g()},onClose:v,onRefresh:g,onRetry:()=>g(),beforeViewportChange:e=>p.beforeViewportChange(e),beforeMove(){l++,p.clear()},afterMove(){f.visible&&g()}}),p=function(e,t,n,o,r=[]){const i=d(r);let l,s,a,c,u;function f(){u?.()}return{get hasPreview(){return!!l},get hasHtmlPreview(){return!!s},get redirectDestination(){return c},load:function(r,d,p=()=>!1,m){const h=new URL(r);if("https:"!==h.protocol&&"http:"!==h.protocol)throw Object.assign(new Error(n.failed),{code:"mtflpp_preview_unsupported_url"});if(h.origin!==window.location.origin){const e=n.originMismatch.replace("%s",()=>h.origin+h.pathname);throw Object.assign(new Error(e),{code:"mtflpp_preview_origin_mismatch"})}const g=h.searchParams.get("mtflpp_token");if(!g)throw new Error(n.failed);return window.crossOriginIsolated&&h.searchParams.set("mtflpp_isolated","1"),f(),h.searchParams.delete("mtflpp_source"),e.followChanges&&h.searchParams.set("mtflpp_source","1"),o(n.updating),new Promise((r,f)=>{const w=e.stage.ownerDocument.createElement("iframe");w.title=n.title,w.className="mtflpp-frame mtflpp-loading",w.setAttribute("aria-hidden","true"),w.setAttribute("tabindex","-1"),w.referrerPolicy="same-origin";let v=!1,b=!1;const y=setTimeout(()=>M(new Error(n.failed)),3e4),x=()=>{b=!0,M()};function M(e){v||(v=!0,e&&(b=!0),clearTimeout(y),u===x&&(u=null),w!==l&&(w.onload=null,w.onerror=null,w.remove()),e?f(e):r())}u=x,w.onload=async()=>{const r=w!==l;if(r||(s=null,a=null),b||!d())return void M();let u,f,v;try{const e=w.contentDocument,t=e?.querySelector('meta[name="meet-the-frontend-live-preview-panel"]');t?.content===g?u=e:r&&!t&&(f=function(e,t){if("text/html"!==e?.contentType)return;const n=e.defaultView?.performance.getEntriesByType("navigation")[0];if(!(n?.redirectCount>0))return;const o=new URL(n.name);return o.origin!==t.origin||o.pathname===t.pathname&&o.search===t.search?void 0:o.pathname}(e,h))}catch{}u&&(e.followChanges&&i.capture(u,r?m:void 0),u.documentElement.style.setProperty("overscroll-behavior","contain","important")),u&&r&&(t.remember(s),e.followChanges&&p()&&s&&(v=i.findChange(s,u))),r&&l&&(l.onload=null,l.onerror=null,l.remove()),l=w,s=u,a=null,c=f,w.classList.remove("mtflpp-loading"),w.removeAttribute("aria-hidden"),w.removeAttribute("tabindex");const y=()=>!b&&d()&&w===l&&u===s&&(!u||w.contentDocument===u);let x;if(u&&r){const n=e.canvasTarget&&(t=>e.canvasTarget(w,t,{fitTarget:!0}));x=await t.restore(u,v,()=>y()&&e.followChanges&&p(),n)}y()?(a=x,o(n.current,"ready"),M()):M()},w.onerror=()=>{w===l?(s=null,a=null,c=void 0,d()&&o(n.failed,"error")):M(new Error(n.failed))},w.src=h.href,e.stage.append(w)})},cancel:f,beforeViewportChange({canvasTarget:n,canFollow:o,...r}){const i=a,c=s,d=l;if(i&&c)return t.keepInView(i,{...r,canvasTarget:e=>n(d,e),canFollow:()=>i===a&&c===s&&d.contentDocument===c&&e.visible&&e.followChanges&&o()})},clear(){f(),t.remember(s),l&&(l.onload=null,l.onerror=null),l=null,s=null,a=null,c=void 0,e.clearPreview()}}}(f,function(){let e,t=0,n=0;return{remember(e){try{e&&(t=e.defaultView.scrollY)}catch{}},async restore(e,o,r=()=>!0,i){const l=++n;try{const s=e.defaultView;let a;if(s.scrollTo({top:t,left:0,behavior:"instant"}),o?.ownerDocument===e&&r()){if(await R(s),l!==n||o.ownerDocument!==e||!r())return;if(function(e,t){const n=e.ownerDocument;for(let t=e;t;t=t.parentElement)if("until-found"!==t.getAttribute("hidden")?.toLowerCase()&&(t.hasAttribute("hidden")||"none"===n.defaultView.getComputedStyle(t).display))return!1;let o=!1;for(let r=e;r&&e.isConnected&&e.ownerDocument===n&&t();r=r.parentElement){if("until-found"===r.getAttribute("hidden")?.toLowerCase()){if(r.dispatchEvent(new n.defaultView.Event("beforematch",{bubbles:!0})),!(e.isConnected&&e.ownerDocument===n&&r.isConnected&&r.ownerDocument===n&&r.contains(e)&&t()))break;"until-found"===r.getAttribute("hidden")?.toLowerCase()&&r.removeAttribute("hidden"),o=!0}const i=r.parentElement;i instanceof n.defaultView.HTMLDetailsElement&&!i.open&&r!==Array.from(i.children).find(e=>"summary"===e.localName)&&(i.open=!0,o=!0)}return o}(o,()=>l===n&&r())&&await new Promise(e=>s.setTimeout(e,0)),l!==n||!r())return;const t=o.ownerDocument===e?function(e){if(!e?.isConnected)return null;const t=N(e,!0);if(t?.clipped)return e;if(!t?.boundary)for(const t of e.querySelectorAll("*"))if(N(t,!0)?.clipped)return t;for(let n=t?.boundary||e.parentElement;n;){const e=N(n,!0);if(e?.clipped)return n;n=e?.boundary||n.parentElement}return null}(o):null;t&&(function(e,t){const n=D(e,t,!0);if(!n?.inViewport)return void Z(e);const{rects:o,extent:r,header:i=0}=n,l=e.ownerDocument.documentElement,s=Math.min(r.x,l.clientWidth),a=Math.min(r.y,l.clientHeight-i);o.some(e=>e.right-e.left>=s-1&&e.bottom-e.top>=a-1)?t&&O(n,t)?.reveal(z(e.ownerDocument.defaultView)):Z(e,{nearest:!0,header:i})}(t,i),o.contains(t)&&(a=t))}return t=s.scrollY,a}catch{}},keepInView(t,{canvas:n,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:l,canFollow:s}){try{const a=e?.target===t&&e.canFollow();if(e?.cancel(),!t.isConnected||!s())return;if(!a){const e=D(t,o);if(!O(e,o)?.visible)return}const c=new AbortController,d={target:t,canFollow:()=>!c.signal.aborted&&s(),cancel(){c.abort(),e===d&&(e=null)}};return e=d,function(e,t,n,o,r){const i=e=>{e.isTrusted&&("keydown"!==e.type||j.has(e.key))&&r()},l={capture:!0,passive:!0,signal:o};for(const n of[e,t])for(const e of["wheel","touchmove","pointerdown","keydown"])n?.addEventListener(e,i,l);t?.addEventListener("scroll",()=>{n?.()&&r()},l)}(t.ownerDocument.defaultView,n,l,c.signal,()=>{d.cancel(),i?.()}),async function(e,t,n,o){try{const r=e.ownerDocument.defaultView;if(await R(r),!o())return;const{scrollX:i,scrollY:l}=r,s=n();if(s&&await s,!o()||r.scrollX!==i||r.scrollY!==l)return;let a=D(e,t);a&&!a.rects.length&&(Z(e,{behavior:"instant",header:a.header}),a=D(e,t)),O(a,t)?.reveal()}catch{}}(t,o,r,d.canFollow).finally(d.cancel)}catch{}}}}(),o,h,e.comparisonExcludedSelectors);function m(t){if(!t)return"";const n=t.get("dateShort")||t.get("date")||"",r=t.get("author")?.name||"",i=o.revisionLabel.replace("%1$s",()=>n).replace("%2$s",()=>r);return t.id===e.postId?`${o.currentVersion} — ${i}`:i}function h(e,t="loading",n={}){"ready"!==t&&p.hasPreview||f.setTitle(m(i)),f.report(e,t,{hasPreview:p.hasPreview,hasHtmlPreview:p.hasHtmlPreview,redirectDestination:p.redirectDestination,canRefresh:f.visible&&["ready","error"].includes(t),...n})}async function g(t=!0){clearTimeout(r),p.cancel();const n=++l;if(!f.visible)return;const s=i?.id===e.postId?e.currentPreviewUrl:i?.get("mtflppPreviewUrl");if("string"!=typeof s||!s)return p.clear(),void h(o.unavailable,"error",{canRetry:!1,canRefresh:!1,reason:"unavailable"});try{await p.load(s,()=>f.visible&&n===l,()=>f.followChanges&&t,{revision:{type:"value",value:i.id}})}catch(e){if(f.visible&&n===l){const t={mtflpp_preview_origin_mismatch:"origin-mismatch",mtflpp_preview_unsupported_url:"unsupported-url"}[e?.code]||"";h("origin-mismatch"===t?e.message:o.failed,"error",{canRetry:!t,canRefresh:!t,reason:t})}}}function w(){const e=t.get("to");e?.id!==i?.id&&(i=e,l++,p.cancel(),clearTimeout(r),f.visible&&(h(o.stale,"stale"),r=setTimeout(g,250)))}function v(){l++,clearTimeout(r),f.setVisible(!1),p.clear(),f.returnToEditor()}t.on("update:revisions",w),window.addEventListener("pagehide",e=>{e.persisted||(t.off("update:revisions",w),v())}),f.visible&&g()}(e,t,n)}catch(t){!function(e,t){document.getElementById("mtflpp-panel")?.remove(),document.getElementById("mtflpp-toggle")?.remove(),document.getElementById("mtflpp-publish-preview")?.remove(),document.getElementById("mtflpp-term-preview")?.remove();const n=document.createElement("div");n.className="notice notice-error",n.setAttribute("role","alert");const o=document.createElement("p");o.textContent=e,n.append(o),(document.getElementById("wpbody-content")||document.body).prepend(n),console.error("Meet the Frontend – Live Preview Panel could not start.",t)}(e.strings.bootFailed,t)}})})();
     1(()=>{"use strict";const e=window.wp.data,t=window.wp.preferences,n=window.wp.element,o=window.wp.components,r=window.wp.notices,i=window.wp.primitives,l=window.ReactJSXRuntime,s={refresh:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M12 5.5L17.7929 11.2929C18.1834 11.6834 18.1834 12.3166 17.7929 12.7071L16 14.5M16 5.5H12V9.5M12 18.5L6.20711 12.7071C5.81658 12.3166 5.81658 11.6834 6.20711 11.2929L8 9.5M8 18.5H12V14.5"})}),more:(0,l.jsxs)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,l.jsx)(i.Path,{d:"M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z",fill:"currentColor",stroke:"none"}),(0,l.jsx)(i.Path,{d:"M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z",fill:"currentColor",stroke:"none"}),(0,l.jsx)(i.Path,{d:"M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z",fill:"currentColor",stroke:"none"}),(0,l.jsx)(i.Path,{d:"M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z"}),(0,l.jsx)(i.Path,{d:"M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z"}),(0,l.jsx)(i.Path,{d:"M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z"})]}),expand:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M4.75 10V4.75H10M4.75 4.75L10 10M14 19.25H19.25V14M19.25 19.25L14 14"})}),compact:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M10 4.75V10H4.75M10 10L4.75 4.75M19.25 14H14V19.25M14 14L19.25 19.25"})}),pip:(0,l.jsxs)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,l.jsx)(i.Path,{d:"M4.75 9.25V16C4.75 16.6904 5.30964 17.25 6 17.25H8M4.75 9.25V6C4.75 5.30964 5.30964 4.75 6 4.75H16C16.6904 4.75 17.25 5.30964 17.25 6V8M4.75 9.25H8"}),(0,l.jsx)(i.Path,{d:"M10.75 11.25C10.75 10.9739 10.9739 10.75 11.25 10.75H18.75C19.0261 10.75 19.25 10.9739 19.25 11.25V18.75C19.25 19.0261 19.0261 19.25 18.75 19.25H11.25C10.9739 19.25 10.75 19.0261 10.75 18.75V11.25Z",fill:"currentColor"})]}),move:(0,l.jsxs)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,l.jsx)(i.Path,{d:"M9.25 5.75H8.75V6.25H9.25V5.75Z",fill:"currentColor",stroke:"none"}),(0,l.jsx)(i.Path,{d:"M9.25 11.75H8.75V12.25H9.25V11.75Z",fill:"currentColor",stroke:"none"}),(0,l.jsx)(i.Path,{d:"M9.25 17.75H8.75V18.25H9.25V17.75Z",fill:"currentColor",stroke:"none"}),(0,l.jsx)(i.Path,{d:"M15.25 5.75H14.75V6.25H15.25V5.75Z",fill:"currentColor",stroke:"none"}),(0,l.jsx)(i.Path,{d:"M15.25 11.75H14.75V12.25H15.25V11.75Z",fill:"currentColor",stroke:"none"}),(0,l.jsx)(i.Path,{d:"M15.25 17.75H14.75V18.25H15.25V17.75Z",fill:"currentColor",stroke:"none"}),(0,l.jsx)(i.Path,{d:"M9.25 5.75H8.75V6.25H9.25V5.75Z"}),(0,l.jsx)(i.Path,{d:"M9.25 11.75H8.75V12.25H9.25V11.75Z"}),(0,l.jsx)(i.Path,{d:"M9.25 17.75H8.75V18.25H9.25V17.75Z"}),(0,l.jsx)(i.Path,{d:"M15.25 5.75H14.75V6.25H15.25V5.75Z"}),(0,l.jsx)(i.Path,{d:"M15.25 11.75H14.75V12.25H15.25V11.75Z"}),(0,l.jsx)(i.Path,{d:"M15.25 17.75H14.75V18.25H15.25V17.75Z"})]}),warning:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M12 8L12 13M12 14.5L12 16M4.75 12C4.75 7.99593 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12Z",strokeLinejoin:"round"})}),info:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M12 16V11M12 9.5V8M19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12C4.75 7.99594 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12Z",strokeLinejoin:"round"})}),close:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M7.75 16.25L16.25 7.75M16.25 16.25L7.75 7.75"})}),check:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M7 12L10 15L17 8"})}),chevron:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M7 11L12 15L17 11"})}),desktop:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M4.75 16.75V17H3.25C3.11193 17 3 17.1119 3 17.25H21C21 17.1119 20.8881 17 20.75 17H19.25V16.75M4.75 16.75V8.5C4.75 7.80964 5.30964 7.25 6 7.25H18C18.6904 7.25 19.25 7.80964 19.25 8.5V16.75M4.75 16.75H19.25"})}),tablet:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M10 16.5H14M18.25 18V6C18.25 5.30964 17.6904 4.75 17 4.75H7C6.30964 4.75 5.75 5.30964 5.75 6L5.75 18C5.75 18.6904 6.30964 19.25 7 19.25H17C17.6904 19.25 18.25 18.6904 18.25 18Z"})}),mobile:(0,l.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,l.jsx)(i.Path,{d:"M11 16.5H13M16.25 18V6C16.25 5.30964 15.6904 4.75 15 4.75H9C8.30964 4.75 7.75 5.30964 7.75 6L7.75 18C7.75 18.6904 8.30964 19.25 9 19.25H15C15.6904 19.25 16.25 18.6904 16.25 18Z"})})};function a(e,t,n="right"){const o=e&&!Array.isArray(e)&&e.bounds&&["x","y","width","height"].every(t=>Number.isFinite(e.bounds[t]))&&e.bounds.width>0&&e.bounds.height>0&&[null,"left","center","right"].includes(e.dock)&&"boolean"==typeof e.expanded&&(void 0===e.anchor||["left","center","right"].includes(e.anchor));let r=!!o&&e.expanded;const i={width:480,height:393},l=o?{...e.bounds}:{x:0,y:0,...i};let s=o?e.dock:n,a=s||o&&e.anchor||"right";function c(){return"left"===a?0:"center"===a?.5:1}function u(e,n=t(!s),o=320,r=220){return e.width=Math.min(n.width,Math.max(Math.min(o,n.width),e.width)),e.height=Math.min(n.height,Math.max(Math.min(r,n.height),e.height)),e.x=Math.max(n.left,Math.min(n.right-e.width,e.x)),e.y=Math.max(n.top,Math.min(n.bottom-e.height,e.y)),e}function d(e){if(!s)return e;const n=t();return e.x="left"===s?n.left:"center"===s?n.left+(n.width-e.width)/2:n.right-e.width,e.y=n.bottom-e.height,e}return{area:t,compactRect:function(){return d(u({...l}))},launcherRect:function(e){return d(u({...e,x:l.x+(l.width-e.width)*c(),y:l.y+l.height-e.height},t(!s),1,1))},usableEdge:function(e){return!(s&&(e.includes("s")||"left"===s&&e.includes("w")||"right"===s&&e.includes("e")))},get anchor(){return a},get anchorFactor(){return c()},get dock(){return s},get expanded(){return r},get layout(){return{bounds:{...l},dock:s,anchor:a,expanded:r}},toggleExpanded(){r=!r},dockTo:function(e="right",t=!1){t&&Object.assign(l,i),r=!1,a=s=e},resize(e,n,o,r){Object.assign(l,function(e,n,o,r){const i=t(!s),l=n.includes("e")||n.includes("w"),c=n.includes("n")||n.includes("s"),u=function(e){return"center"===a?.5:e.includes("w")?1:0}(n),d=e.x+e.width*u,f=n.includes("n"),p=e.y+(f?e.height:0),m=function(e,t,n){return 0===n?e.right-t:1===n?t-e.left:2*Math.min(t-e.left,e.right-t)}(i,d,u),h=f?p-i.top:i.bottom-p,g=(n.includes("w")?-o:o)*(.5===u?2:1),w=Math.max(Math.min(320,m),Math.min(m,e.width+g)),v=Math.max(Math.min(220,h),Math.min(h,e.height+(f?-r:r))),y=l&&0!==o&&w!==e.width,b=c&&0!==r&&v!==e.height,x=f?p-v:p;return{x:y?d-w*u:e.preferredBounds.x,y:b?x:e.preferredBounds.y,width:y?w:e.preferredBounds.width,height:b?v:e.preferredBounds.height}}(e,n,o,r))},move:function(e,n,o,r=!1){const i=u({...e,x:e.x+n,y:e.y+o},t(!0),r?1:320,r?1:220);l.x=i.x+(r?(i.width-l.width)*c():0),l.y=i.y+(r?i.height-l.height:0),s=null}}}function c(i,{postTitle:l="",publicRedirect:c,inlineLauncher:u,nativeLauncher:d,canRememberVisibility:f=!0,onOpen:p,onClose:m,onRefresh:h,onRetry:g,beforeMove:w,afterMove:v,beforeViewportChange:y}){const b=window,x=document,M="meet-the-frontend-live-preview-panel",C=(0,e.select)(t.store),k=(0,e.dispatch)(t.store),P="width"===C.get(M,"fit")?"width":"automatic";k.setDefaults(M,{rememberVisibility:!0,rememberPosition:!0,panelOpen:!0,scrollToChanges:!0,viewport:"desktop",fitMode:P,customZoom:100,tabletOrientation:"portrait",mobileOrientation:"portrait"});const S=()=>!u&&(!d||d.fallbackMedia.matches);let E=!1!==C.get(M,"rememberVisibility"),L=!1!==C.get(M,"rememberPosition"),V=!1!==C.get(M,"scrollToChanges");const T=u?.parentElement??x.getElementById("mtflpp-toggle"),H=x.getElementById("mtflpp-panel");if(!T||!H)throw new Error("Preview panel markup is missing.");const O=u||function(e){let t;const{title:r,moveHelp:i}=e.dataset;return(0,n.flushSync)(()=>(0,n.createRoot)(e).render((0,n.createElement)(o.Button,{ref:e=>{t=e},variant:"secondary",label:r,title:r,description:i,"aria-controls":"mtflpp-panel","aria-expanded":!1},(0,n.createElement)("span",{className:"mtflpp-launcher-label"},r)))),t}(T),R=H.querySelector(".mtflpp-move-control"),j=H.querySelector(".mtflpp-resize"),N=H.querySelectorAll("[data-resize-edge]"),$=H.querySelector(".mtflpp-header"),B=H.querySelector(".mtflpp-caption"),D=H.querySelector(".mtflpp-viewport"),F=H.querySelector(".mtflpp-canvas"),z=H.querySelector(".mtflpp-stage"),A=H.querySelector(".mtflpp-empty"),W=H.querySelector(".mtflpp-devicebar"),q=H.querySelector(".mtflpp-dimensions"),Z=H.querySelector(".mtflpp-feedback"),I=H.querySelector('[role="status"]');let G;const _=function(e,t,n,o={},r=()=>{},i={desktop:"Desktop",tablet:"Tablet",mobile:"Phone"}){const l=e.ownerDocument.defaultView,s=e.querySelector(".mtflpp-canvas"),a=e.querySelector(".mtflpp-canvas-space"),c=n.querySelector(".mtflpp-dimensions-text"),u={desktop:[1280,800],tablet:[768,1024],mobile:[390,844]},d=Object.keys(u);let f=d.includes(o.device)?o.device:"desktop";const p=["automatic","window","width","custom"];let m=p.includes(o.fit)?o.fit:"automatic";const h=e=>Number.isInteger(e)&&e>=10&&e<=400;let g,w=h(o.customZoom)?o.customZoom:100,v=100;const y=e=>"desktop"===e?"landscape":"portrait",b=Object.fromEntries(d.map(e=>[e,"desktop"!==e&&["portrait","landscape"].includes(o[`${e}Orientation`])?o[`${e}Orientation`]:y(e)])),x=()=>b[f]===y(f)?u[f]:[...u[f]].reverse(),M=()=>"width"===m;let C,k,P;const S=l.matchMedia("(prefers-reduced-motion: no-preference)");function E(){const t=e.ownerDocument.defaultView.devicePixelRatio;return Number.isFinite(t)&&t>0?t:1}function L(e,t){if("custom"===m)return w/100/E();const n=s.clientWidth/e;if(M())return n;const o=Math.min(n,s.clientHeight/t);return"automatic"===m?Math.min(1/E(),o):o}function V(e,n){C=e;const[o,r]=x(),i=Math.max(0,(s.clientWidth-o*C)/2),l=Math.max(0,(s.clientHeight-r*C)/2);Object.assign(a.style,{width:`${Math.max(s.clientWidth,i+o*C)}px`,height:`${Math.max(s.clientHeight,l+r*C)}px`}),Object.assign(t.style,{left:`${i}px`,top:`${l}px`,transform:`scale(${C})`});const c=o*C>s.clientWidth+.01||r*C>s.clientHeight+.01,u="custom"===m||M();s.tabIndex=u&&c?0:-1,s.scrollLeft="custom"===m?n.x*C:0,s.scrollTop=u?n.y*C:0}function T(){if(!k)return;const e=k;k=null,e.window.cancelAnimationFrame(e.frame),e.resolve?.()}function H(e,t,n,o){return t<=0||o&&e<-1&&t<n?Math.max(e,t-n):e>=n||o&&e>0&&t>n+1?Math.min(e,t-n):0}function O(o=!1,l=!1){T();const[a,u]=x();if(Object.assign(t.style,{width:`${a}px`,height:`${u}px`}),!e.clientWidth||!e.clientHeight)return;const d=E(),p=`${i[f]} (${a} × ${u}) · `,h=Math.max(400,Math.ceil(e.clientWidth/a*d*100)),y=`${p}${"0".repeat(String(h).length)}%`;n.dataset.reserve!==y&&(n.dataset.reserve=y);const b=l?{x:0,y:0}:{x:(s.scrollLeft||0)/(C||1),y:(s.scrollTop||0)/(C||1)};if(s.style.overflowX="hidden",s.style.overflowY="hidden","custom"===m){const e=L(a,u);for(let t=0;t<2;t++)a*e>s.clientWidth+.01&&(s.style.overflowX="scroll"),u*e>s.clientHeight+.01&&(s.style.overflowY="scroll")}else M()&&u*L(a,u)>e.clientHeight&&(s.style.overflowY="scroll");if(!s.clientWidth||!s.clientHeight)return;const P=L(a,u),H=Math.round(P*d*100),O=H!==v||d!==g;v=H,g=d;const R=`${p}${"custom"===m?w:v}%`;c.textContent!==R&&(c.textContent=R),O&&r();const j=C??P;if(!o||!S.matches||j===P)return void V(P,b);const N={window:e.ownerDocument.defaultView,frame:null},$=N.window.performance.now();k=N;const B=e=>{V(e,b),N.scrollLeft=s.scrollLeft,N.scrollTop=s.scrollTop};B(j);const D=e=>{if(k!==N)return;const t=Math.min(1,Math.max(0,(e-$)/200));B(j+(P-j)*(1-(1-t)**3)),t<1?N.frame=N.window.requestAnimationFrame(D):T()};N.frame=N.window.requestAnimationFrame(D)}function R(){O()}function j(){P?.();const t=e.ownerDocument.defaultView.matchMedia(`(resolution: ${E()}dppx)`);t.addEventListener("change",j),P=()=>t.removeEventListener("change",j),R()}let N=new l.ResizeObserver(R);return N.observe(e),S.addEventListener("change",R),l.addEventListener("resize",j),j(),{get device(){return f},get fit(){return m},get customZoom(){return w},get zoomPercent(){return"custom"===m?w:v},get dpr(){return E()},get orientation(){return b[f]},canvasTarget:function(e,t,{fitTarget:n=!1}={}){const o=e.getBoundingClientRect(),r=s.getBoundingClientRect(),i=o.left-r.left-s.clientLeft,l=o.top-r.top-s.clientTop,a=H(i+t.left*C,i+t.right*C,s.clientWidth,n),c=H(l+t.top*C,l+t.bottom*C,s.clientHeight,n),u=Math.max(t.left,-i/C),d=Math.min(t.right,(s.clientWidth-i)/C);return{visible:!a&&!c,visibleCenterX:u<d?(u+d)/2:void 0,distance:Math.hypot(a,c),reveal(e="instant"){(a||c)&&s.scrollBy({left:a,top:c,behavior:e})}}},canvasWasPanned:function(){return!!k&&(s.scrollLeft!==k.scrollLeft||s.scrollTop!==k.scrollTop)},whenSettled:function(){if(!k)return;const e=k;return e.done??=new Promise(t=>{e.resolve=t}),e.done},finishMotion(){k&&R()},select(e,{animate:t=!1,keepPan:n=!1}={}){if(!d.includes(e))return;const o=f!==e;f=e,o?O(t,!n):k||R()},rotate({animate:e=!1,keepPan:t=!1}={}){"desktop"!==f&&(b[f]="portrait"===b[f]?"landscape":"portrait",O(e,!t))},setFit(e){p.includes(e)&&m!==e&&(m=e,O(!1,!0))},setZoom(e){if(!h(e)||"custom"===m&&w===e)return;const t="custom"!==m;w=e,m="custom",O(!1,t)},layout:R,beforeMove(){T(),N.disconnect(),P?.(),e.ownerDocument.defaultView.removeEventListener("resize",j)},afterMove(){N=new e.ownerDocument.defaultView.ResizeObserver(R),N.observe(e),e.ownerDocument.defaultView.addEventListener("resize",j),j()}}}(D,z,q,{device:C.get(M,"viewport"),fit:C.get(M,"fitMode")??P,customZoom:C.get(M,"customZoom"),tabletOrientation:C.get(M,"tabletOrientation"),mobileOrientation:C.get(M,"mobileOrientation")},()=>Ee(),i),J=x.querySelector("#wpbody-content > .wrap"),X=x.getElementById("wpadminbar");function Y(e=!1){const t=Math.max(1,x.documentElement.clientWidth),n=Math.max(1,x.documentElement.clientHeight),o=x.documentElement.getBoundingClientRect().left+b.scrollX,r=!e&&J?.getBoundingClientRect(),i=r?Math.max(0,"rtl"===b.getComputedStyle(J).direction?r.left-o:o+t-r.right):20,l=e?0:i,s=Math.min(l,(t-1)/2),a=Math.min(Math.max(0,X?.getBoundingClientRect().bottom||0)+l,n-1),c=t-s,u=n-Math.min(l,n-a-1);return{left:s,top:a,right:c,bottom:u,width:c-s,height:u-a}}let U,K=f&&(!E||!1!==C.get(M,"panelOpen")),Q=!1;const ee=C.get(M,"layout"),te=C.get(M,"position")??ee?.dock??ee?.anchor;let ne=["left","center","right"].includes(te)?te:"right";const oe=a(L?ee:void 0,Y,ne),{compactRect:re,usableEdge:ie}=oe;let le,se=!1,ae="",ce=!1,ue={text:i.loading,state:"loading",hasPreview:!1,canRetry:!1,reason:""},de=!1;function fe(e){const t="string"==typeof e?e.replace(/\s+/g," ").trim():"";B.textContent=t?`${i.preview} — ${t}`:i.title,B.title=B.textContent,U&&(U.document.title=B.textContent)}function pe(){const{text:e,state:t,hasPreview:n,reason:o}=ue;return"handover"===t?{heading:i.switchingPreview,description:e,note:i.tabEdits}:"conflict"===t?{heading:e,description:{"handed-off":i.handedOffHelp,busy:i.takeoverTimeoutHelp,manual:i.closeOtherHelp}[o]||i.conflictHelp,note:"manual"===o?i.manualSwitchHint:i.tabEdits}:"paused"===t?{heading:i.pausedTitle,description:e,note:""}:"error"===t?function(){const{text:e,hasPreview:t,canRetry:n,reason:o}=ue;if("origin-mismatch"===o)return{heading:i.originMismatchTitle,description:t?`${e} ${i.previousPreview}`:e,note:""};if("unavailable"===o||"browser"===o)return{heading:"unavailable"===o?i.unavailableTitle:i.browserTitle,description:e,note:""};const r={reload:i.reviewBeforeReload,"reload-before-save":i.nativePreviewAcfReload}[o];if(!t){let t=e;return e===i.failed&&(t=n?i.failedHelp:""),r&&(t+=` ${r}`),{heading:i.failed,description:t,note:""}}return{heading:e===i.failed?i.refreshFailed:e,description:r||i.previousPreview,note:""}}():n?{heading:e,description:"",note:""}:{heading:i.loading,description:i.preparing,note:""}}function me(){return se?"handover"===ue.state?i.takingOver:i.takeOver:i.retry}function he(e){return!e||["handover","paused"].includes(ue.state)?"info":"error"!==ue.state||ue.canRetry?"warning":"error"}function ge(){return ue.redirectDestination?`${i.redirected} ${ue.redirectDestination}`:ue.hasHtmlPreview&&le?`${i.publicRedirected} ${le}`:""}function we(){const{state:e,hasPreview:t,canRetry:n,reason:o}=ue,r=t&&["error","conflict","handover","paused"].includes(e),l=!t||r||ae?"":ge();if(Z.hidden=!r&&!ae&&!l,Z.tabIndex=Z.hidden?-1:0,H.dataset.hasFeedback=String(!Z.hidden),Z.hidden)return null;if(l)return{heading:l,status:"info",dismissible:!1};const{heading:s,description:a}=pe();return{heading:r?s:ae,description:r?a:i.windowNoticeHelp,status:he(r),dismissible:!r,retry:r&&(se||n&&["error","conflict"].includes(e)),close:r&&"error"===e&&!n&&!["reload","reload-before-save"].includes(o),disabled:"handover"===e,action:me()}}function ve(e){ue.hasPreview&&["error","conflict","handover","paused"].includes(ue.state)||(ae=e,Ee()),I.textContent=`${e} ${i.windowNoticeHelp}`}function ye(){ae="",Ee()}function be(e,t="loading",{canTakeOver:n=!1,hasPreview:o=!1,hasHtmlPreview:r=!1,redirectDestination:i,canRefresh:l=!1,canRetry:s=!0,reason:a=""}={}){const u=H.ownerDocument.activeElement,d=H.contains(u),f=!o&&(ue.state!==t||ue.text!==e||ue.reason!==a),p=ue.hasPreview!==o;ue={text:e,state:t,canTakeOver:n,hasPreview:o,hasHtmlPreview:r,redirectDestination:i,canRefresh:l,canRetry:s,reason:a},["error","conflict","handover","paused"].includes(t)&&(ae=""),H.dataset.state=t,H.dataset.hasPreview=String(o),se=n&&["conflict","handover"].includes(t),A.hidden=o,W.hidden=!o;const{heading:m,description:h,note:g}=pe();f&&(A.scrollTop=0);const w="ready"!==t||ae?"":ge();I.textContent=o?[m,h,g,w].filter(Boolean).join(" "):m,Ee(),p&&_.layout(),function(e,t){e&&t&&(!H.contains(e)||e.closest("[hidden]")||e.disabled||!ue.hasPreview&&F.contains(e))&&G.focus(A.hidden?"actions":"empty-title")}(u,d),K&&"ready"===t&&r&&!i&&async function(){if(c&&!ce){ce=!0;try{const e=new URL(c.endpoint);if(e.origin!==b.location.origin)return;const t=await b.fetch(e,{credentials:"same-origin",cache:"no-store",redirect:"error",headers:{"X-WP-Nonce":c.nonce}});if(!t.ok)return;const{destination:n}=await t.json();if("string"!=typeof n||!n)return;if(le=n,!K)return;Ee(),"ready"!==ue.state||!ue.hasHtmlPreview||ue.redirectDestination||ae||(I.textContent=ge())}catch{}}}()}function xe(e){f&&E&&C.get(M,"panelOpen")!==e&&k.set(M,"panelOpen",e)}function Me(){L&&k.set(M,"layout",oe.layout)}function Ce(){const e=T.hidden;T.hidden=!1,T.style.maxWidth=`${Y(!oe.dock).width}px`;const t={width:T.offsetWidth,height:T.offsetHeight};return T.hidden=e,oe.launcherRect(t)}function ke(){if(U)return;if(!K&&S()){const e=Ce(),t=oe.anchorFactor;Object.assign(T.style,{left:`${e.x+e.width*t}px`,top:`${e.y+e.height}px`,transform:`translate(${-100*t}%, -100%)`})}let e=re();if(H.dataset.anchor=oe.anchor,oe.expanded){const t=Y();e={x:t.left,y:t.top,width:t.width,height:t.height}}Object.assign(H.style,{left:`${e.x}px`,top:`${e.y}px`,width:`${e.width}px`,height:`${e.height}px`,transform:""})}function Pe(e="right",t=!1){oe.dockTo(e,t),ne=e,k.set(M,"position",ne),ke(),Me(),Ee()}function Se(){return"function"==typeof b.documentPictureInPicture?.requestWindow}function Ee(){if(!G)return;const e=H.ownerDocument.fullscreenElement===H,t=!U&&!e,n=t&&!oe.expanded;H.classList.toggle("mtflpp-expanded",oe.expanded),j.hidden=!n;for(const e of N)e.hidden=!n||!ie(e.dataset.resizeEdge);const o=se||ue.canRetry&&["error","conflict"].includes(ue.state);var r;G.update({inPage:t,inPip:!!U,movable:n,dock:oe.dock,canRememberVisibility:f,rememberVisibility:E,rememberPosition:L,followChanges:V,device:_.device,busy:ue.hasPreview&&["stale","loading","handover"].includes(ue.state)&&ue.text!==i.saving,empty:ue.hasPreview?null:{...pe(),busy:["loading","stale","ready","handover"].includes(ue.state),icon:["paused","conflict"].includes(ue.state)||["unavailable","browser","origin-mismatch"].includes(ue.reason)?"info":"warning",retry:o,disabled:"handover"===ue.state,close:"error"===ue.state&&!o,action:me()},notice:we(),fit:_.fit,orientation:_.orientation,customZoom:_.customZoom,zoomPercent:_.zoomPercent,dpr:_.dpr,canRefresh:ue.canRefresh,hasPreview:ue.hasPreview,canPip:t&&Se(),canFullscreen:t&&!!x.fullscreenEnabled,mode:e||oe.expanded?"compact":"expand",modeLabel:(r=e,r?i.exitFullscreen:oe.expanded?i.compact:i.expand)})}function Le(){G.closeMenu(),U?U.close():x.fullscreenElement!==H?(oe.toggleExpanded(),ke(),Me(),Ee(),G.focus("mode")):x.exitFullscreen().then(ye,()=>ve(i.fullscreenFailed))}function Ve(e,t=!1,n){const o=e===O,r=e===$,l=()=>n||("left"===oe.anchor?"ne":"nw"),s=()=>U||!o&&oe.expanded||x.fullscreenElement===H||t&&!ie(l());let a,c;const u=()=>({...o?Ce():re(),preferredBounds:oe.layout.bounds});function d(){if(c=null,a)if(t||o)ke();else{const e=re(),t=e.x-parseFloat(H.style.left),n=e.y-parseFloat(H.style.top);Object.assign(H.style,{width:`${e.width}px`,height:`${e.height}px`,transform:`translate3d(${t}px, ${n}px, 0)`})}}function f(){if(!a)return;const{pointer:t,moved:n}=a;a=null,b.cancelAnimationFrame(c),e.hasPointerCapture(t)&&e.releasePointerCapture(t),H.classList.remove("mtflpp-dragging"),e.classList.remove("mtflpp-edge-active"),x.documentElement.classList.remove("mtflpp-window-dragging"),x.documentElement.style.removeProperty("--mtflpp-drag-cursor"),ke(),n&&(o&&(de=!0),Me(),Ee())}e.addEventListener("pointerdown",t=>{0!==t.button||s()||r&&t.target.closest('button, a, [role="button"]')||(o&&(de=!1),t.preventDefault(),o?O.focus({preventScroll:!0}):e===R&&G.focus("move"),G.closeMenu(),a={...u(),pointer:t.pointerId,pointerX:t.clientX,pointerY:t.clientY},e.setPointerCapture(t.pointerId))}),e.addEventListener("pointermove",n=>{if(!a||a.pointer!==n.pointerId)return;const r=n.clientX-a.pointerX,i=n.clientY-a.pointerY;!a.moved&&Math.abs(r)+Math.abs(i)<4||(a.moved=!0,H.classList.add("mtflpp-dragging"),t&&e.classList.add("mtflpp-edge-active"),x.documentElement.style.setProperty("--mtflpp-drag-cursor",t?b.getComputedStyle(e).cursor:"grabbing"),x.documentElement.classList.add("mtflpp-window-dragging"),t?oe.resize(a,l(),r,i):oe.move(a,r,i,o),c||(c=b.requestAnimationFrame(d)))});for(const t of["pointerup","pointercancel","lostpointercapture"])e.addEventListener(t,f);b.addEventListener("blur",f),r||n||e.addEventListener("keydown",e=>{const n={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[e.key];if(!n||e.altKey||e.ctrlKey||e.metaKey||s())return;e.preventDefault(),G.closeMenu();const r=u(),a=e.shiftKey?40:10;t?oe.resize(r,l(),n[0]*a,n[1]*a):oe.move(r,n[0]*a,n[1]*a,o),ke(),Me(),Ee();const c=re();I.textContent=t?`${i.resize}: ${Math.round(c.width)} × ${Math.round(c.height)}`:i.moved})}fe(l),$.addEventListener("dblclick",e=>{U||e.target.closest("button, a")||Le()}),x.addEventListener("fullscreenchange",Ee),j.addEventListener("keydown",e=>{"Escape"===e.key&&j.classList.add("mtflpp-help-dismissed")}),j.addEventListener("blur",()=>j.classList.remove("mtflpp-help-dismissed")),Ve(R),Ve($),u||Ve(O),Ve(j,!0);for(const e of N)Ve(e,!0,e.dataset.resizeEdge);function Te(){H.hidden=Q||!K,T.hidden=Q||!u&&(K||!S()),O.setAttribute("aria-expanded",String(!H.hidden))}function He(){G.closeMenu(),U?.close(),x.fullscreenElement===H&&x.exitFullscreen().catch(()=>{})}function Oe(e=!0){Q||(K?G.focus("actions"):(xe(!0),p(),K&&e&&G.focus("actions")))}return b.addEventListener("resize",ke),b.addEventListener("scroll",ke,{passive:!0}),d?.fallbackMedia.addEventListener("change",()=>{ke(),Te()}),O.addEventListener("click",e=>{if(de&&0!==e.detail)return de=!1,void e.preventDefault();de=!1,Oe(0===e.detail)}),G=function(t,i,l){const a=t.querySelector(".mtflpp-controls"),c=t.querySelector(".mtflpp-refresh-control"),u=t.querySelector(".mtflpp-move-control"),d=t.querySelector(".mtflpp-device-controls"),f=t.querySelector(".mtflpp-fit-control"),p=t.querySelector(".mtflpp-pip-control"),m=t.querySelector(".mtflpp-empty"),h=t.querySelector(".mtflpp-feedback");let g,w=(0,n.createRoot)(a),v=!1,y=!1,b=!1;const x=r.InlineNotices?(0,e.dispatch)(r.store):null,M=t.ownerDocument.defaultView?.wp?.theme?.ThemeProvider,C="meet-the-frontend-live-preview-panel",k="preview-feedback";let P="";function S(){const e=g.notice,t=/[.!?…。!?]$/.test(e.heading)?e.heading:`${e.heading}.`;return{message:e.description?`${t} ${e.description}`:e.heading,status:e.status,isDismissible:e.dismissible,actions:[...e.retry?[{label:e.action,disabled:e.disabled,onClick:l.retry}]:[],...e.close?[{label:i.close,onClick:l.close}]:[]]}}function E(){x&&P&&x.removeNotice(k,C),P=""}function L(e){return()=>{H(),e()}}function V(){const{inPage:e,inPip:a,mode:w,modeLabel:k,movable:P,busy:E,canRefresh:V,hasPreview:O,canPip:R}=g;return(0,n.createElement)(o.SlotFillProvider,null,(0,n.createPortal)(P&&e&&(0,n.createElement)(o.Button,{className:"mtflpp-icon mtflpp-move",size:"compact",icon:s.move,label:i.move,showTooltip:!0,tooltipPosition:"bottom","data-action":"move"}),u),(0,n.createPortal)((0,n.createElement)(o.Button,{className:"mtflpp-icon",size:"compact",icon:E?(0,n.createElement)(o.Spinner):s.refresh,label:i.refresh,showTooltip:!0,accessibleWhenDisabled:!0,disabled:!V,onClick:l.refresh,"data-action":"refresh"}),c),(0,n.createPortal)(R&&O&&(0,n.createElement)("div",{className:"mtflpp-pip-surface"},(0,n.createElement)(o.Button,{className:"mtflpp-pip-button",icon:s.pip,label:i.popOutHelp,"aria-label":i.popOut,description:i.popOutHelp,showTooltip:!0,onClick:l.popOut,"data-action":"pop-out"})),p),function(){const{canPip:e,canFullscreen:t,inPage:r,inPip:a,dock:c,canRememberVisibility:u,rememberVisibility:d,rememberPosition:f,followChanges:p}=g;return(0,n.createElement)(o.DropdownMenu,{className:"mtflpp-actions",label:i.actions,icon:s.more,open:v,onToggle(e){v=e,e&&(y=!1),T()},toggleProps:{className:"mtflpp-icon",size:"compact","data-action":"actions"},popoverProps:{placement:"bottom-end",offset:6,shift:!0,className:"mtflpp-menu-popover"}},()=>(0,n.createElement)(n.Fragment,null,(e||t)&&(0,n.createElement)(o.MenuGroup,{label:i.display},e&&(0,n.createElement)(o.MenuItem,{label:i.popOutHelp,description:i.popOutHelp,showTooltip:!0,onClick:L(l.popOut),"data-action":"pip","aria-label":i.popOut},i.popOut),t&&(0,n.createElement)(o.MenuItem,{onClick:L(l.fullscreen),"data-action":"fullscreen"},i.fullscreen)),r&&(0,n.createElement)(o.MenuGroup,{label:i.position},(0,n.createElement)(o.MenuItemsChoice,{value:c,choices:[{value:"left",label:i.bottomLeft},{value:"center",label:i.bottomCenter},{value:"right",label:i.bottomRight}],onSelect(e){H(),l.dock(e)}})),(0,n.createElement)(o.MenuGroup,{label:i.preferences},!1!==u&&(0,n.createElement)(o.MenuItem,{role:"menuitemcheckbox",isSelected:d,icon:d?s.check:void 0,info:i.rememberVisibilityHelp,onClick:L(l.rememberVisibility),"data-action":"remember-visibility"},i.rememberVisibility),(0,n.createElement)(o.MenuItem,{role:"menuitemcheckbox",isSelected:f,icon:f?s.check:void 0,info:i.rememberPositionHelp,onClick:L(l.rememberPosition),"data-action":"remember-position"},i.rememberPosition),(0,n.createElement)(o.MenuItem,{role:"menuitemcheckbox",isSelected:p,icon:p?s.check:void 0,info:i.followHelp,onClick:L(l.follow),"data-action":"follow"},i.follow)),r&&(0,n.createElement)(o.MenuGroup,null,(0,n.createElement)(o.MenuItem,{info:i.resetHelp,onClick:L(l.reset),"data-action":"reset"},i.reset)),a&&(0,n.createElement)(o.MenuGroup,null,(0,n.createElement)(o.MenuItem,{onClick:L(l.close),"data-action":"close"},i.closeLivePreview))))}(),!a&&(0,n.createElement)(o.Button,{className:"mtflpp-icon mtflpp-mode",size:"compact",icon:s[w],label:k,showTooltip:!0,onClick:l.mode,"data-action":"mode"}),!a&&(0,n.createElement)(o.Button,{className:"mtflpp-icon",size:"compact",icon:s.close,label:i.close,showTooltip:!0,onClick:l.close,"data-action":"close"}),(0,n.createPortal)(function(){const{device:e,orientation:t}=g;return(0,n.createElement)(o.Toolbar,{className:"mtflpp-devices",label:i.viewport,variant:"unstyled"},...["desktop","tablet","mobile"].map(r=>{const a=e===r,c=a&&"desktop"!==r,u=c&&"landscape"===t,d="portrait"===t?i.rotateLandscape:i.rotatePortrait;return(0,n.createElement)(o.ToolbarButton,{key:r,icon:s[r],className:u?"mtflpp-device-rotated":void 0,label:c?`${i[r]} — ${d}`:i[r],isPressed:a,"data-viewport":r,onClick:()=>l.device(r)})}))}(),d),(0,n.createPortal)(function(){const{fit:e,customZoom:t=100,dpr:r=1}=g,a={automatic:i.automatic,window:i.fitToWindow,width:i.fitToWidth},c={automatic:i.automaticHelp,window:i.fitToWindowHelp,width:i.fitToWidthHelp},u="custom"===e?i.fixedZoom:a[e]??i.automatic;return(0,n.createElement)(o.Dropdown,{open:y,onToggle(e){y=e,e&&(v=!1,b="custom"===g.fit),T()},contentClassName:"mtflpp-zoom-popover",focusOnMount:"firstElement",popoverProps:{placement:"top-end",offset:8,shift:!0,resize:!1,role:"dialog","aria-label":i.fitting},renderToggle:({isOpen:e,onToggle:t})=>(0,n.createElement)(o.Button,{className:"mtflpp-zoom-toggle",variant:"secondary",size:"compact",label:u,showTooltip:!0,"aria-label":`${i.fitting}: ${u}`,"aria-haspopup":"dialog","aria-expanded":e,onClick:t,"data-action":"zoom"},(0,n.createElement)("span",{className:"mtflpp-zoom-value"},u),s.chevron),renderContent:()=>(0,n.createElement)("div",{className:"mtflpp-zoom-content"},(0,n.createElement)(o.RadioControl,{label:i.zoomMode,selected:e,options:[...Object.entries(a).map(([e,t])=>({value:e,label:t,description:c[e]})),{value:"custom",label:i.fixedZoom,description:i.fixedZoomHelp}],onFocus(e){if(!b)return;b=!1;const t=e.currentTarget.closest(".mtflpp-zoom-content")?.querySelector('.mtflpp-custom-zoom input[type="number"]');t?.focus({preventScroll:!0});const n=t?.closest(".components-popover__content");if(n){const e=t.getBoundingClientRect(),o=n.getBoundingClientRect();n.scrollTop+=Math.min(0,e.top-o.top)+Math.max(0,e.bottom-o.bottom)}},onChange(e){b=!1,"custom"!==e?l.fit(e):l.zoom(t)}}),"custom"===e&&(0,n.createElement)("div",{className:"mtflpp-custom-zoom",onKeyDown(e){if("Enter"!==e.key)return;e.preventDefault();const t=Number(e.target.value);!1!==e.target.validity?.valid&&Number.isInteger(t)&&t>=10&&t<=400&&H()}},(0,n.createElement)(o.RangeControl,{label:i.customZoom,min:10,max:400,step:1,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:t,help:i.customZoomHelp,withInputField:!0,onChange(e){Number.isInteger(e)&&e>=10&&e<=400&&l.zoom(e)}})),(0,n.createElement)("div",{className:"mtflpp-dpr-note",role:"group","aria-label":i.displayInformation},(0,n.createElement)("span",{className:"mtflpp-dpr-value"},`${i.displayDpr}: ${Number(r.toFixed(2))}`),(0,n.createElement)("span",{className:"mtflpp-pixel-note"},i.pixelZoomHelp)))})}(),f),(0,n.createPortal)(function(){const{empty:e}=g;return e?(0,n.createElement)(o.Placeholder,{className:"mtflpp-placeholder","data-empty-icon":e.busy?void 0:e.icon,icon:e.busy?(0,n.createElement)(o.Spinner):s[e.icon],label:(0,n.createElement)("h3",{className:"mtflpp-empty-title",tabIndex:-1,"data-action":"empty-title"},e.heading),instructions:e.description},e.retry&&(0,n.createElement)(o.Button,{key:"retry",variant:"primary",disabled:e.disabled,onClick:l.retry,"data-action":"retry"},e.action),e.close&&(0,n.createElement)(o.Button,{key:"close",variant:"secondary",onClick:l.close,"data-action":"close"},i.close),e.note&&(0,n.createElement)("p",{className:"mtflpp-empty-note"},e.note)):null}(),m),(0,n.createPortal)(function(){if(!g.notice)return null;if(x){const e=(0,n.createElement)(r.InlineNotices,{context:C,className:"mtflpp-inline-notices"});return M?(0,n.createElement)(M,{cornerRadius:"none"},e):e}const{message:e,...t}=S();return(0,n.createElement)(o.Notice,{...t,onRemove:l.dismissNotice,spokenMessage:"",politeness:"polite"},e)}(),h),e?(0,n.createPortal)((0,n.createElement)(o.Popover.Slot),t.ownerDocument.body):(0,n.createElement)(o.Popover.Slot))}function T(){g&&w&&(function(){if(!x)return;if(!g.notice)return void E();const e=JSON.stringify(g.notice);if(P===e)return;const{message:t,status:n,...o}=S();x.createNotice(n,t,{...o,id:k,context:C,speak:!1,onDismiss:l.dismissNotice}),P=e}(),(0,n.flushSync)(()=>w.render((0,n.createElement)(V))))}function H(){(v||y)&&(v=!1,y=!1,T())}function O(e){g?.inPip&&"mode"===e&&(e="actions"),t.querySelector(`[data-action="${e}"]`)?.focus({preventScroll:!0})}return{update(e){const n=y&&!e.hasPreview&&t.ownerDocument.activeElement?.closest(".mtflpp-zoom-popover");e.hasPreview||(y=!1),g=e,T(),n&&O("empty-title")},closeMenu:H,focus:O,beforeMove(){v=!1,y=!1,w?.unmount(),w=null,E()},remount(){w=(0,n.createRoot)(a),T()}}}(H,i,{refresh:()=>{ue.canRefresh&&h()},retry:()=>{"handover"!==ue.state&&(se||ue.canRetry&&["error","conflict"].includes(ue.state))&&g(se)},dismissNotice:()=>{ye(),I.textContent=ue.text,G.focus("actions")},mode:Le,close:function(){G.closeMenu(),xe(!1),m(),u||S()?O.focus():d.focus()},popOut:async function(){if(Q||U||x.fullscreenElement===H||!Se())return;let e;G.closeMenu();const t=()=>{U===e&&(w(),_.beforeMove(),G.beforeMove(),x.body.append(H),H.classList.remove("mtflpp-pip"),U=null,G.remount(),ke(),_.afterMove(),Ee(),Q||(v(),K&&G.focus("mode")))};try{if(e=await b.documentPictureInPicture.requestWindow({width:640,height:440}),!K||Q)return void e.close();const n=b.getComputedStyle(H);e.document.documentElement.lang=x.documentElement.lang,e.document.documentElement.dir=n.direction;for(const t of["--wp-admin-theme-color","--wp-admin-theme-color-darker-10","--wp-admin-border-width-focus"]){const o=n.getPropertyValue(t);o&&e.document.documentElement.style.setProperty(t,o)}const o=x.querySelectorAll(['link[rel="stylesheet"][href*="/load-styles.php"]',"#wp-theme-css","#wp-theme-inline-css","#wp-components-css","#wp-components-inline-css","style[data-emotion]","style[data-wp-hash]","#meet-the-frontend-live-preview-panel-css","#meet-the-frontend-live-preview-panel-inline-css"].join(", "));for(const t of o){const n=t.cloneNode(!0);"STYLE"===t.tagName&&t.sheet&&(n.textContent=Array.from(t.sheet.cssRules,e=>e.cssText).join("\n")),n.addEventListener("load",_.layout,{once:!0}),e.document.head.append(n)}e.document.title=B.textContent,e.document.body.className="mtflpp-pip-document",e.addEventListener("resize",_.layout),e.addEventListener("pagehide",t,{once:!0}),U=e,w(),_.beforeMove(),G.beforeMove(),H.classList.add("mtflpp-pip"),e.document.body.append(H),G.remount(),_.afterMove(),Ee(),ye(),G.focus("mode"),v()}catch{if(e&&(t(),e.close()),Q)return;G.focus("actions"),ve(i.pipFailed)}},fullscreen:async function(){if(!Q&&!U&&x.fullscreenEnabled){G.closeMenu();try{if(await H.requestFullscreen(),Q)return void He();ye(),G.focus("mode")}catch{if(Q)return;G.focus("actions"),ve(i.fullscreenFailed)}}},dock:e=>Pe(e),reset:()=>Pe("right",!0),follow:function(){V=!V,k.set(M,"scrollToChanges",V),Ee(),V&&ue.canRefresh&&h(!1)},rememberVisibility:function(){E=!E,k.set(M,"rememberVisibility",E),E&&xe(K),Ee()},rememberPosition:function(){L=!L,k.set(M,"rememberPosition",L),L?Me():(k.set(M,"position",ne),k.set(M,"layout",void 0)),Ee()},device(e){const t=_.device;if(e===t&&"desktop"===e)return;let n=!1;if(K&&V&&y){const{fit:e,customZoom:t,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:l}=_;n=!!y({canvas:F,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:l,canFollow:()=>_.fit===e&&_.customZoom===t})}const o={animate:K&&!n,keepPan:n};e===t?(_.rotate(o),k.set(M,`${e}Orientation`,_.orientation)):(_.select(e,o),_.device!==t&&k.set(M,"viewport",_.device)),Ee()},fit(e){const t=_.fit;_.setFit(e),_.fit!==t&&k.set(M,"fitMode",_.fit),Ee()},zoom(e){const t=_.fit,n=_.customZoom;_.setZoom(e),_.customZoom!==n&&k.set(M,"customZoom",_.customZoom),_.fit!==t&&k.set(M,"fitMode",_.fit),Ee()}}),be(i.loading,"loading",{canRetry:!1}),ke(),Te(),u&&(u.disabled=!1),{stage:z,canvasTarget:_.canvasTarget,get visible(){return K},get followChanges(){return V},openFromLauncher:Oe,setSuspended(e){Q!==e&&(Q=e,Te(),e?He():ke())},setVisible(e){e||(G.closeMenu(),ae="",Ee(),_.layout()),K=e,ke(),Te()},report:be,setTitle:fe,clearPreview(){z.replaceChildren();const e=["ready","stale","loading"].includes(ue.state);be(e?i.loading:ue.text,e?"loading":ue.state,{...ue,hasPreview:!1,hasHtmlPreview:!1,redirectDestination:void 0,canRefresh:!1,canRetry:!e&&ue.canRetry})},returnToEditor:He}}function u(e=[]){const t=Array.isArray(e)?[...e]:[],n=new WeakMap;return{capture(e,o){try{if(n.has(e))return;const r=function(e){try{const t=e.querySelector('meta[name="meet-the-frontend-live-preview-panel"]'),n=t?.getAttribute("data-mtflpp-source");if(!n)return null;const o=JSON.parse(n);if("string"!=typeof o)return null;const r=(new DOMParser).parseFromString(o,"text/html");return r.querySelector('meta[name="meet-the-frontend-live-preview-panel"]')?.content===t.content?r:null}catch{return null}}(e);n.set(e,{source:r?M(r,e,t):null,dom:M(e,e,t),values:o&&structuredClone(o)})}catch{}},findChange(e,t){try{const o=n.get(e),r=n.get(t);if(!o||!r)return null;const i=function(e,t){if(!e||!t)return[];const n=[];for(const o of new Set([...Object.keys(e),...Object.keys(t)])){const r=Object.hasOwn(e,o)?e[o]:{type:t[o]?.type,value:""},i=Object.hasOwn(t,o)?t[o]:{type:e[o]?.type,value:""};if(r.type!==i.type||!["text","html"].includes(i.type)||"string"!=typeof r.value||"string"!=typeof i.value||r.value===i.value)continue;let l,s;try{l="html"===r.type?(new DOMParser).parseFromString(r.value,"text/html"):null,s="html"===i.type?(new DOMParser).parseFromString(i.value,"text/html"):null}catch{continue}const a=l?M(l,l,[],l.body):null,c=s?M(s,s,[],s.body):null,u=l?R(a):r.value,d=s?R(c):i.value,f=S(u),p=S(d);if(f!==p&&n.push({...Z(f,p),type:"text",fullBefore:f,fullAfter:p}),!l){const e=O(u,d);e&&n.push(e);continue}if(a&&c&&(f===p||E(u,d)))for(const e of P(a,c)){if(e.spacing){const t=H(e);t&&n.push(t);continue}if(f===p)if("attributes"===e.kind){const t=new Map(e.before.attributes),o=new Map(e.after.attributes);for(const e of new Set([...t.keys(),...o.keys()])){const r=t.get(e)??"",i=o.get(e)??"";JSON.stringify(r)!==JSON.stringify(i)&&n.push({type:"attribute",name:e,before:"string"==typeof r?r:JSON.stringify(r),after:"string"==typeof i?i:JSON.stringify(i)})}}else if("content"===e.kind){const t=S(R(e.before)),o=S(R(e.after));t===o&&Y(e.before,e.after,R)&&n.push({type:"markup",before:t,after:o,oldTag:e.before.tag,newTag:e.after.tag}),(e.before.media||[]).forEach((t,o)=>{const r=e.after.media?.[o];t&&r&&t!==r&&n.push({type:"media",before:t,after:r})})}}}return n}(o.values,r.values),l=function(e,t){if(!e||!t)return!1;const n=(e,t)=>Object.entries(e).some(([e,n])=>["text","html","value","row-image"].includes(n?.type)&&(!Object.hasOwn(t,e)||n.type!==t[e]?.type||n.value!==t[e]?.value));return n(e,t)||n(t,e)}(o.values,r.values),s=!!o.source&&!!r.source,a=!!o.source!=!!r.source,c=function(e,t,n){if(!e||!t)return;const o=Object.entries(t).filter(([t,n])=>"row-order"===n?.type&&"row-order"===e[t]?.type&&e[t].value!==n.value);if(1!==o.length)return;const[[r,i]]=o,l=e[r];if(!i.moved||i.members!==l.members)return;const s=JSON.parse(l.value),a=JSON.parse(i.value),c=s.indexOf(i.moved),u=a.indexOf(i.moved);if(-1===c||-1===u||c===u||s.length!==a.length)return;if(s.splice(c,1),a.splice(u,1),!s.every((e,t)=>e===a[t]))return;const d=u-c,f={html:new Map,peerLabels:new Map},p=D(r,i.moved,s,e,t,f),m=function(e,t,n,o,r,i){if([n,...o].some(n=>!e?.[n]||!t?.[n]))return[];const l=new Set(e[n]),s=new Set,a=new Set,c=new Set;for(const[n,l]of[[e,r],[t,i]])for(const e of o.flatMap(e=>n[e])){const t=l[e];"row-image"===t?.type&&(c.add(t.value),a.add(t.alt))}for(const e of t[n]){const t=r[e],n=i[e];if(!l.has(e)||"row-image"!==t?.type||"row-image"!==n?.type||!/^[1-9]\d*$/.test(n.value)||t.value!==n.value||c.has(n.value))continue;const o=n.alt;o?.trim()&&t.alt===o&&!a.has(o)&&s.add(o)}return[...s]}(l.fieldsByRow,i.fieldsByRow,i.moved,s,e,t);let h;if(n&&!p.length&&N(l,i.moved,e,f.html)&&N(i,i.moved,t,f.html)){const n=s.slice(Math.min(c,u),Math.max(c,u));h=[];for(const o of n){const n=D(r,o,[...s.filter(e=>e!==o),i.moved],e,t,f);if(!n.length){h=void 0;break}h.push(n)}}return{offset:d,groups:p,images:m,boundaryGroups:h}}(o.values,r.values,s&&!l&&!j(o.values,r.values)),u=s?P(o.source,r.source,c,!0):[];if(c?.boundaryGroups?.length){const e=u.filter(e=>e.priority>0);if(1===e.length&&e[0].boundary)return function({before:e,after:t,index:n},o){for(const n of[e,t]){let e,t;for(const{node:r}of n){if(!r?.isConnected||e&&e.nextElementSibling!==r)return null;const{position:n,marginTop:i,marginBottom:l}=r.ownerDocument.defaultView.getComputedStyle(r);if(o&&r.closest(o)||!m(r)||!["static","relative"].includes(n)||r.closest("[hidden], details:not([open])")||!1===r.checkVisibility?.({opacityProperty:!0,contentVisibilityAuto:!0}))return null;const s=r.getBoundingClientRect();if(!s.height&&!(parseFloat(i)>0||parseFloat(l)>0))return null;if(t&&(t.bottom>s.top||Math.max(t.left,s.left)>=Math.min(t.right,s.right)))return null;e=r,t=s}}return t[n].node}(e[0].boundary,r.source?.excluded)}if(!a&&!l&&!c){const e=function(e,t){const n=function(e,t){if(!e||!t)return;const n=["row-order","gallery-order","order"],o=[...new Set([...Object.keys(e),...Object.keys(t)])].filter(o=>(n.includes(e[o]?.type)||n.includes(t[o]?.type))&&e[o]?.value!==t[o]?.value);if(1!==o.length)return;const r=e[o[0]],i=t[o[0]];if("gallery-order"!==r?.type||"gallery-order"!==i?.type)return;const l=JSON.parse(r.value),s=JSON.parse(i.value);if(new Set(l).size!==l.length||new Set(s).size!==s.length)return;const a=new Map(l.map((e,t)=>[e,t])),c=s.map(e=>a.get(e));return l.length&&s.length&&c.every(e=>void 0===e)?void 0:{oldCount:l.length,matches:c}}(e.values,t.values);if(!n)return;const o=e.source??e.dom,r=t.source??t.dom,i=function(e,t,{oldCount:n,matches:o}){const r=[];function i(e,t){return e.signature===t.signature&&e.presentation===t.presentation}function l(e,t){return i(e,t)&&e.rawText===t.rawText&&e.children.length===t.children.length&&e.children.every((e,n)=>l(e,t.children[n]))}function s(e,t){if(e.children.length!==n||t.children.length!==o.length||e.rawText!==t.rawText&&(e.text||t.text))return!1;const i=b(e),s=b(t);if(!i||!s)return!1;const a=i.map(x),c=s.map(x),u=new Set(a);return!(u.size!==a.length||new Set(c).size!==c.length||a.length===c.length&&a.every((e,t)=>e===c[t])||!o.every((n,o)=>void 0===n?!u.has(c[o]):a[n]===c[o]&&l(e.children[n],t.children[o]))||(r.push({before:e,after:t,original:i,current:s}),0))}return e&&t&&function e(t,n){return!!i(t,n)&&(!!s(t,n)||t.rawText===n.rawText&&t.children.length===n.children.length&&t.children.every((t,o)=>e(t,n.children[o])))}(e,t)?r:null}(o,r,n);if(!i?.length)return;const l=i.map(e=>e.after);let[s]=l;for(;s&&!l.every(e=>e===s||Q(s,e));)s=s.parent;const a=e=>["main","body","html"].includes(e.tag)||e.attributes.some(([e,t])=>"role"===e&&"main"===t);if(!s?.parent||a(s)||!function(e,t){if(1===t.length)return!0;const n=new Set(t);let o=0;return function e(t){return n.has(t)?(o++,!0):!!g(t)||!w(t)&&("hr"!==t.tag||0===o||o===n.size)&&t.parts.every(t=>"string"==typeof t?0===o||o===n.size||!t.trim():e(t))}(e)&&o===n.size}(s,l))return null;let c=s.node;if(!c?.isConnected||l.some(({node:e})=>!c.contains(e)||r.excluded&&e.closest(r.excluded)))return null;if(t.source&&(!y(e.dom,i,"before","original")||!y(t.dom,i,"after","current")))return null;const u=c.ownerDocument.defaultView;for(let e=s,t=e.parent;t?.parent&&!a(t)&&!t.children.some(t=>t!==e&&v(t));e=t,t=t.parent){const e=t.node;if(!e?.contains(c))continue;const{overflowX:n,overflowY:o}=u.getComputedStyle(e),r=/^(?:auto|scroll|hidden)$/;(e.scrollWidth>e.clientWidth&&r.test(n)||e.scrollHeight>e.clientHeight&&r.test(o))&&(c=e)}return!m(c)||c.closest("[hidden], details:not([open])")||r.excluded&&c.closest(r.excluded)?null:c}(o,r);if(void 0!==e)return e}const C=[...u.map(e=>({...e,source:!0})),...P(o.dom,r.dom,c)],k=new Map,V=function(e,t){const n=new Map,o=e=>R(e,n),r=[];for(const n of e){if(n.unresolved)for(const e of d(n,t,o))r.push(e);if("insert"===n.kind&&n.added.length>1){const e=n.added.map(e=>{const r={...n,after:e,added:[e]},i=K(r,t,o);return{...r,input:i}}).filter(e=>e.input);if(e.length){r.push(...e);continue}}const e=K(n,t,o);r.push({...n,input:e})}return r}(C,i).filter(e=>(e.priority>0||e.input)&&(!e.spacing||function({before:e,after:t},n,o){const r=L(e,n,o),i=L(t,n,o);return r&&i&&r.omitted===i.omitted&&E(r.text,i.text)}(e,k,r.dom?.excluded))),T=s&&l&&!V.some(e=>e.source);return function(e,t){if(!e.length)return null;const n=e.reduce((e,t)=>Math.max(e,t.input),0),o=e.filter(e=>e.input===n),r=o.reduce((e,t)=>Math.max(e,t.priority),0),i=o.filter(e=>e.priority===r);if(t.rowMove&&!n||i.some(e=>e.unresolved))return function(e,{rowMove:t,excluded:n,canFollowLiveReorder:o,canFollowLiveMove:r}){if(t){const t=e.find(e=>e.moved&&(e.source||r)),o=t?.moved.node;return o?.isConnected&&t.after.node?.contains(o)&&e.every(e=>e===t||t.source&&!e.source&&(e.moved||"reorder"===e.regionChange))?"contents"!==o.ownerDocument.defaultView.getComputedStyle(o).display?o:f(t.moved,e=>o.contains(e)&&(!n||!e.closest(n))&&m(e)):null}const i=e.find(e=>e.unresolved&&("replacement"===e.regionChange||"reorder"===e.regionChange&&(e.source||o))),l=i?.after.node;if(!l?.isConnected)return null;for(const t of e)if(t.unresolved){if(i.source&&!t.source&&"reorder"===t.regionChange)continue;if(!t.regionChange||t.after.node!==l)return null}else if(!("insert"===t.kind?t.added:[t.after]).every(e=>l.contains(e.node)))return null;return"contents"!==l.ownerDocument.defaultView.getComputedStyle(l).display?l:null}(i,t);const l=i.filter(e=>!e.input||e.directInput||!i.some(t=>t!==e&&e.matches?.length&&e.matches.every(e=>t.matches?.includes(e))&&Q(e.after,t.after))),s=new Map,a=l.filter(e=>{const t="delete"===e.kind&&(e.following[0]||e.preceding[0])||e.after,n=t?.node;if(!n)return!0;const o="delete"!==e.kind||e.following.length?e.kind:"delete-last",r=s.get(n)||new Set;return!r.has(o)&&(r.add(o),s.set(n,r),!0)});return n&&s.size>1?null:function(e){const t=new Set,n=new Set;for(const o of e){let e,r=!1;"delete"===o.kind?(r=!o.removed.some(h),e=r?o.after:o.following.find(h)||o.preceding.find(h)||o.following.find(p)||o.preceding.find(p)||o.after):e="insert"===o.kind?o.added.find(h)||o.added.find(p):o.after;const i=p(e);if(!i)continue;const l=h(e),s=l||i;(l&&!r?t:n).add(s)}const o=t.size?t:n;return 1===o.size?o.values().next().value:null}(a)}(V.filter(e=>e.source||e.input||!s&&!a||T&&("insert"===e.kind||"delete"===e.kind)),{rowMove:!!c,excluded:r.source?.excluded??r.dom?.excluded,canFollowLiveReorder:!s&&(l||j(o.values,r.values)),canFollowLiveMove:!s&&!a})}catch{return null}}}}function d(e,t,n){const o=[];for(const r of t){if(!r.after||"spacing"===r.type)continue;const t=U(e.oldRange,r.before,n,r,!0),i=U(e.newRange,r.after,n,r,!1);if(!t.length)continue;const l="markup"===r.type&&r.oldTag===r.newTag;if(l||!r.before||!(t.length<=U(e.newRange,r.before,n,r,!0).length||i.length<=U(e.oldRange,r.after,n,r,!1).length))for(const s of i)l&&!t.some(e=>Y(e,s,n))||o.push({...e,unresolved:!1,before:null,after:s,kind:"content",input:r.before&&r.after?2:1,priority:2,matches:[r]})}return o}function f(e,t){if(e?.node&&t(e.node))return e.node;for(const n of e?.children||[]){const e=f(n,t);if(e)return e}return null}function p(e){return f(e,()=>!0)}function m(e){return e.getClientRects().length&&"visible"===e.ownerDocument.defaultView.getComputedStyle(e).visibility}function h(e){return f(e,m)}function g(e){return/^(?:button|input|select|textarea)$/.test(e.tag)||e.attributes.some(([e,t])=>"role"===e&&"button"===t)}function w(e){return/^(?:img|video|audio|iframe|canvas|object|embed)$/.test(e.tag)||e.media?.some(Boolean)}function v(e){return!g(e)&&(e.text||w(e)||"hr"===e.tag||e.children.some(v))}function y(e,t,n,o){const r=new Map(t.map(e=>[e[n].node,e[o]]));return!(!e||r.has(null)||r.size!==t.length)&&(function e(t){const n=r.get(t.node);if(!n)return t.children.every(e);r.delete(t.node);const o=new Map,i=new Map;n.forEach((e,t)=>{e.marker&&o.set(e.marker,t),i.set(x(e),t)});const l=[],s=new Map;if(!function e(t,r=!1){if(r||=t.attributes.some(([e,t])=>"inert"===e||"aria-hidden"===e&&"true"===t),"img"!==t.tag)return t.children.every(t=>e(t,r));const a=o.get(t.marker)??i.get(x(t));return!(!n[a]||!t.media.slice(0,2).some((e,t)=>e&&e===n[a].media[t])||(l.push({index:a,cloneHidden:r}),s.set(a,(s.get(a)??0)+1),0))}(t))return!1;const a=l.filter(({index:e,cloneHidden:t})=>!t||1===s.get(e));return a.length===n.length&&a.every(({index:e},t)=>e===t)}(e)&&!r.size)}function b(e){const t=e.children.map(function e(t){return"img"===t.tag?[t]:t.children.flatMap(e)});return t.some(e=>1!==e.length||!e[0].media?.slice(0,2).some(Boolean))?null:t.map(([e])=>e)}function x(e){return JSON.stringify(e.media.slice(0,2))}function M(e,t,n,o=e.querySelector('main, [role="main"]')||e.querySelector("article")||e.body){if(!o)return null;const r=n.filter(e=>{if("string"!=typeof e||!e.trim())return!1;try{return o.matches(e),!0}catch{return!1}}).join(", "),i=new Map,l=new Map;if(e!==t)for(const e of t.querySelectorAll("[data-mtflpp-node]")){const t=e.getAttribute("data-mtflpp-node");l.set(t,l.has(t)?null:e)}for(const n of[o,...o.querySelectorAll("*")]){if(r&&n.closest(r))continue;const o=[...n.childNodes].filter(e=>3===e.nodeType).map(e=>e.textContent),s=S(o.join(" ")),a=["img","source","video","audio","iframe"].includes(n.localName)?["src","srcset","poster"].map(e=>n.getAttribute(`data-${e}`)||n.getAttribute(e)||""):[],c=n.style?.backgroundImage||n.getAttribute("data-bg")||"",u=n.getAttribute("data-mtflpp-node"),d=e===t?n:l.get(u)||null,f=C(n,d,JSON.stringify([n.localName,s,a,c]));"img"===n.localName&&(f.marker=u),f.text=s,f.rawText=o.join(""),f.media=[...a,c],f.parent=i.get(n.parentElement),i.set(n,f),f.parent?.children.push(f)}for(const[e,t]of i)t.parts=[...e.childNodes].map(e=>3===e.nodeType?e.textContent:i.get(e)).filter(e=>void 0!==e);let s=i.get(o);if(!s)return null;const a=s.node;for(let e=o.parentElement;e;e=e.parentElement){const t=C(e,a,e.localName);t.children=[s],t.parts=[s],s=t}return s.excluded=r,s}function C(e,t,n){const o=function(e){const t=[];for(const{name:n,value:o}of e.attributes){if("data-mtflpp-node"===n||n.startsWith("on")||/(?:^|-)(nonce|token)(?:-|$)/.test(n))continue;if(/^(?:data-)?(?:src|srcset|poster|sizes|bg)$/.test(n))continue;let r=o;"class"===n&&(r=[...e.classList].sort().join(" ")),"style"===n&&(r=[...e.style].sort().map(t=>[t,e.style.getPropertyValue(t),e.style.getPropertyPriority(t)])),("class"!==n&&"style"!==n||r.length)&&t.push([n,r])}return t.sort(([e],[t])=>e.localeCompare(t))}(e);return{node:t,tag:e.localName,signature:n,attributes:o,children:[],parts:[],presentation:JSON.stringify(o.filter(([e])=>!k(e))),references:JSON.stringify(o.filter(([e])=>k(e)))}}function k(e){return["id","for","headers","aria-controls","aria-labelledby","aria-describedby","aria-owns","aria-flowto","aria-activedescendant","aria-details","aria-errormessage"].includes(e)}function P(e,t,n,o=!1){const r=new Map,i=new Map,l=new Map,s=new Map,a=[];let c,u;function d(o,r,i,l=[]){const s=(e,t)=>e===t||Q(e,t);let a=!1;if(l.length){u??=[B(e,new Set(l)),B(t,new Set(l))];const n=(e,t,n)=>t.node?.isConnected&&e.node?.contains(t.node)&&"img"===t.node.localName&&(!n||!t.node.closest(n));for(const i of l){const l=u[0].get(i),c=u[1].get(i);if(l&&c){if(!s(o,l)||!s(r,c))return!1;a||=n(o,l,e.excluded)&&n(r,c,t.excluded)}}}if(!i.length)return a;if(!c){const o=new Set((n.boundaryGroups??[n.groups]).flat(2));c=[q(e,o),q(t,o)]}const[d,f]=c,p=new Map;for(const e of i.flat()){const t=d.get(e),n=f.get(e);if(t&&n){if(!s(o,t.entry)||!s(r,n.entry))return!1;p.set(e,t.substantive&&n.substantive)}}return a||i.some(e=>e.every(e=>p.has(e))&&e.some(e=>p.get(e)))}function f(e){const t=JSON.stringify(e);return r.has(t)||r.set(t,r.size+1),r.get(t)}function p(e){if(!e)return 0;const t=f([e.signature,e.children.map(p)]);return i.set(e,t),l.set(e,f([t,e.presentation,e.children.map(e=>l.get(e))])),s.set(e,f([t,e.presentation,e.references,e.children.map(e=>s.get(e))])),t}p(e),p(t);const m=e=>i.get(e);function h(e){const t=e.attributes.find(([e])=>"id"===e)?.[1];return t?`${e.tag} ${t}`:void 0}function g(e){if(!(e.children.length<2))return f(["collection",e.signature,e.children.map(m).sort((e,t)=>e-t)])}function w(e,t){const n=new Map;return e.forEach((e,o)=>{const r=t(e);void 0!==r&&n.set(r,n.has(r)?-1:o)}),n}return function e(t,r){t&&r&&(t.signature!==r.signature?a.push({kind:"content",before:t,after:r,priority:2}):t.rawText!==r.rawText&&a.push({kind:"content",before:t,after:r,priority:2,spacing:!0}),t.presentation===r.presentation&&t.references===r.references||a.push({kind:"attributes",before:t,after:r,priority:t.presentation!==r.presentation?1:0}),function(t,r,c,u){const f=u.parent&&c.parent&&u.tag===c.tag,p=w(t,m),v=w(r,m);let y,b,x,M;const C=new Set(t.flatMap(e=>[l.get(e),s.get(e)])),k=new Set(r.flatMap(e=>[l.get(e),s.get(e)]));function P(e,t,n){const o=n.get(e),r=n.get(t);return o===r||!k.has(o)&&!C.has(r)}function S(e,t){return i.get(e)===i.get(t)&&P(e,t,l)&&P(e,t,s)}function E(e,n,o,l,s,c,d){const m=t.slice(e,n),h=r.slice(o,l),g="replacement"===s&&f&&m.some(e=>!v.has(i.get(e)))&&h.some(e=>!p.has(i.get(e)))&&(!function(e,t){if(e.length<2||t.length<2)return!1;const n=e.filter(e=>e.children.length).length,o=t.filter(e=>e.children.length).length;if(!n&&!o||n>1&&o>1)return!0;const r=new Map;for(const{tag:e}of t)r.set(e,(r.get(e)||0)+1);let i=0;for(const{tag:t}of e){const e=r.get(t);if(e){if(2===++i)return!0;r.set(t,e-1)}}return!1}(m,h)||"form"===u.tag&&function(e,t){function n(e){const t=new Set;return e.every(function e(n){if(["input","select","textarea"].includes(n.tag)){const e=n.attributes.find(([e])=>"name"===e)?.[1],o=n.attributes.find(([e])=>"type"===e)?.[1]?.toLowerCase();return!(!e||"input"===n.tag&&"hidden"===o||(t.add(e),0))}let o=!1;for(const t of n.children)e(t)&&(o=!0);return o})?t:null}const o=n(e),r=n(t);return o&&r&&[...o].some(e=>!r.has(e))&&[...r].some(e=>!o.has(e))}(m,h)),w=f&&("reorder"===s||g)?s:void 0;a.push({kind:"region",after:u,priority:2,unresolved:!0,regionChange:w,oldRange:m,newRange:h,moved:c,boundary:d})}function L(e,n,o,r,i,l,s){const a=[];for(let c=e;c<n;c++){const e=s(t[c]),n=l.get(e);if(!(i.get(e)!==c||void 0===n||n<o||n>=r)){if(a.length&&n<=a[a.length-1][1])return null;a.push([c,n])}}return a}!function s(c,C,k,P){for(;c<C&&k<P&&S(t[c],r[k]);)e(t[c],r[k]),c++,k++;for(;c<C&&k<P&&S(t[C-1],r[P-1]);)C--,P--,e(t[C],r[P]);if(c===C&&k===P)return;if(c===C||k===P){const e=k===P,n=e?t.slice(c,C):r.slice(k,P),o=e?[r[k-1],r[k]]:[t[c-1],t[c]];return void(n.some(e=>o.some(t=>t&&i.get(t)===i.get(e)))?E(c,C,k,P):e?a.push({kind:"delete",after:u,removed:n,priority:2,following:r.slice(k),preceding:r.slice(0,k).reverse()}):a.push({kind:"insert",after:n[0],added:n,priority:2}))}if(C-c===1&&P-k===1)return void e(t[c],r[k]);const V=function(e,i,l,s){if(!(n?.groups.length||o&&(n?.boundaryGroups||n?.images.length)))return;const a=Math.abs(n.offset)+1;if(i-e!==a||s-l!==a)return;const c=n.offset>0,u=c?0:a-1,d=c?a-1:0,f=t.slice(e,i),p=r.slice(l,s),m=c?a-1:1,h=f.map((e,t)=>[e,p[(t+m)%a]]);return{before:f,after:p,from:u,to:d,pairs:h}}(c,C,k,P),T=V&&function(e){const t=o?n.images:[];if(!n.groups.length&&!t.length)return;const[r,i]=e.pairs[e.from],l=m(r);return-1!==p.get(l)&&-1!==v.get(l)&&e.pairs.every(([e,t])=>S(e,t))&&d(r,i,n.groups,t)?i:void 0}(V),H=V&&function(e){if(o&&n.boundaryGroups&&$(e.before[e.from])&&e.pairs.every(([e,t])=>l.get(e)===l.get(t)))return e.pairs.filter((t,n)=>n!==e.from).every(([e,t],o)=>d(e,t,n.boundaryGroups[o]))?{before:e.before,after:e.after,index:e.to||1}:void 0}(V);if(T||H||f&&function(e,n,o,l){const s=n-e;if(s<2||s!==l-o)return!1;const a=new Map;let c=!1;for(let n=0;n<s;n++){const l=i.get(t[e+n]),s=i.get(r[o+n]);c||=l!==s,a.set(l,(a.get(l)||0)+1),a.set(s,(a.get(s)||0)-1)}return c&&[...a.values()].every(e=>0===e)}(c,C,k,P)){if(H)for(const[t,n]of V.pairs)e(t,n);return void E(c,C,k,P,"reorder",T,H)}let O=L(c,C,k,P,p,v,m);if(0===O?.length&&(y??=w(t,h),b??=w(r,h),O=L(c,C,k,P,y,b,h)),0===O?.length&&(x??=w(t,g),M??=w(r,g),O=L(c,C,k,P,x,M,g)),O?.length)for(const[n,o]of[...O,[C,P]])s(c,n,k,o),n<C&&e(t[n],r[o]),c=n+1,k=o+1;else E(c,C,k,P,O?"replacement":void 0)}(0,t.length,0,r.length)}(t.children,r.children,t,r))}(e,t),a}function S(e){return e.replace(/\s+/g," ").trim()}function E(e,t){return e!==t&&e.replace(/\s/g,"")===t.replace(/\s/g,"")}function L(e,t,n){for(;e.node?.isConnected&&e.parent?.node;){const{display:t}=e.node.ownerDocument.defaultView.getComputedStyle(e.node);if("inline"!==t&&"contents"!==t)break;e=e.parent}if(!t.has(e)){const{node:o}=e,r=[],i=o?.isConnected&&V(o,n,r)===T(e)&&h(e)?o.innerText:void 0;t.set(e,"string"==typeof i?{text:i,omitted:JSON.stringify(r)}:void 0)}return t.get(e)}function V(e,t,n){return t&&e.querySelector(t)?[...e.childNodes].map(e=>3===e.nodeType?e.textContent:1!==e.nodeType?"":e.matches(t)?(n.push(e.textContent),""):V(e,t,n)).join(""):e.textContent}function T(e){return e.parts.map(e=>"string"==typeof e?e:T(e)).join("")}function H({before:e,after:t}){return O(e.rawText,t.rawText)||O(T(e),T(t))}function O(e,t){if(!/\S/.test(e)||!E(e,t))return;const n=e.match(/\s+|\S+/g),o=t.match(/\s+|\S+/g);let r=0,i=0;for(;r<Math.min(n.length,o.length)&&n[r]===o[r];)r++;for(;i<Math.min(n.length,o.length)-r&&n.at(-1-i)===o.at(-1-i);)i++;const l=Math.max(0,r-1),s=Math.max(0,i-1);return{type:"spacing",before:n.slice(l,n.length-s).join(""),after:o.slice(l,o.length-s).join("")}}function R(e,t=new Map){return e?(t.has(e)||t.set(e,(e.parts||[]).map(e=>{if("string"==typeof e)return e;const n=R(e,t);return/^(?:p|div|section|article|main|aside|header|footer|nav|h[1-6]|li|[ou]l|d[ldt]|blockquote|pre|table|tr|t[dh]|caption|figure|figcaption|br|hr)$/.test(e.tag)?` ${n} `:n}).join("")),t.get(e)):""}function j(e,t){return!!e&&!!t&&Object.entries(t).some(([t,n])=>{if(!["order","gallery-order"].includes(n?.type)||!Object.hasOwn(e,t))return!1;const o=e[t];return o?.type===n.type&&o.members===n.members&&o.value!==n.value})}function N(e,t,n,o){return e.fieldsByRow?.[t]?.every(e=>""===z(n[e],o)?.label)}function $(e){return!e.text&&!e.media?.some(Boolean)&&!/^(?:a|button|input|select|textarea|form|details|img|video|audio|iframe|canvas|svg|object|embed)$/.test(e.tag)&&e.children.every($)}function B(e,t){const n=new Map;return e&&function e(o){if("img"===o.tag){const e=o.attributes.find(([e])=>"alt"===e)?.[1];t.has(e)&&n.set(e,n.has(e)?null:o)}o.children.forEach(e)}(e),n}function D(e,t,n,o,r,{html:i,peerLabels:l}){const{fieldsByRow:s}=r[e],a=o[e].fieldsByRow;if([t,...n].some(e=>!a?.[e]||!s?.[e]))return[];const c=[],u=new Set(a[t]);let d;function f(e,t){if(l.has(e))return l.get(e);const n=new Set;function o(e,t){n.add(S(R(e,t)));for(const n of e.children)o(n,t)}for(const r of e){if("row-image"===t[r]?.type)continue;const e=F(t[r],i);if(!e.length)return null;for(const t of e)t.entry?o(t.entry,t.cache):n.add(t.label)}return l.set(e,n),n}function p(e,t){return d??=n.flatMap(e=>[f(a[e],o),f(s[e],r)]),d.some(n=>!n||n.has(e)||t.length&&t.every(e=>n.has(e)))}for(const e of s[t]){const t=r[e],n=o[e];if(u.has(e)&&t&&n?.type===t.type&&n?.value===t.value)for(const{entry:e,cache:o,label:r}of F(t,i,n.formatted===t.formatted)){if(!r)continue;if(!e){p(r,[])||c.push([r]);continue}const t=A(e,o).map(e=>S(R(e,o))),n=q(e,new Set([r,...t]),o);n.get(r)?.substantive&&!p(r,t.join(" ")===r?t:[])&&c.push([r]);const i=[...new Set(t.filter(e=>n.has(e)))];i.length>1&&i.some(e=>n.get(e).substantive)&&!p(r,i)&&c.push(i)}}return c}function F(e,t,n=!0){const o=z(e,t);if(!o)return[];const r=n&&"html"===e.type&&"string"==typeof e.formatted?z({type:"html",value:e.formatted},t):null;return r?[o,r]:[o]}function z(e,t){if("string"==typeof e?.value){if("text"===e.type)return{label:S(e.value)};if("html"===e.type){if(!t.has(e.value))try{const n=(new DOMParser).parseFromString(e.value,"text/html"),o=M(n,n,[],n.body),r=new Map;t.set(e.value,{entry:o,cache:r,label:S(R(o,r))})}catch{t.set(e.value,null)}return t.get(e.value)}}}function A(e,t){const n=e.children.flatMap(e=>A(e,t));return n.length||!/^(?:p|h[1-6]|li|d[dt]|blockquote|pre|figcaption)$/.test(e.tag)?n:S(R(e,t))?[e]:[]}function W(e,t,n){let o;(e.text===t||/[\p{L}\p{N}]/u.test(e.text||""))&&(o=function(e,t){let n="content";for(let o=e;o;o=o.parent){const r=o.attributes.find(([e])=>"role"===e)?.[1]??"";if("button"===o.tag||/(?:^|\s)button(?:\s|$)/.test(r))return;if("a"!==o.tag&&!/(?:^|\s)link(?:\s|$)/.test(r))continue;const i=A(o,t);if(i.length<2||!i.some(e=>/^h[1-6]$/.test(e.tag)))return;const l=i.find(t=>t===e||Q(t,e));if(!l)return;/^h[1-6]$/.test(l.tag)||(n="support")}return n}(e,n));for(const r of e.children){if("content"===o)break;o=W(r,t,n)||o}return o}function q(e,t,n=new Map){const o=new Map;e&&function e(r){const i=S(R(r,n));if(t.has(i)){const e=o.get(i);o.set(i,void 0===e||e&&Q(e,r)?r:null)}r.children.forEach(e)}(e);const r=new Map;for(const[e,t]of o){const o=t&&W(t,e,n);o&&r.set(e,{entry:t,substantive:"content"===o})}return r}function Z(e,t){let n=0,o=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;for(;o<e.length-n&&o<t.length-n&&e[e.length-o-1]===t[t.length-o-1];)o++;let r=e.length-o,i=t.length-o;for(;n>0&&/\S/.test(e[n-1]);)n--;if(r>n&&/\S/.test(e[r-1]))for(;r<e.length&&/\S/.test(e[r]);)r++;if(i>n&&/\S/.test(t[i-1]))for(;i<t.length&&/\S/.test(t[i]);)i++;return{before:e.slice(n,r).trim(),after:t.slice(n,i).trim()}}function I(e,t){return t?G(e,t):""===S(e)}function G(e,t){return _(e,t,1)>0}function _(e,t,n=1/0){if(!t)return 0;let o=0,r=(e=S(e)).indexOf(t);for(;-1!==r;){const i=r+t.length;if(J(e,r)&&J(e,i)&&++o===n)break;r=e.indexOf(t,r+1)}return o}function J(e,t){return!/[\p{L}\p{N}_]$/u.test(e.slice(Math.max(0,t-2),t))||!/^[\p{L}\p{N}_]/u.test(e.slice(t,t+2))}function X(e,t,n,o=!1){const r=S(e),i=S(t);if(r===i)return!1;if(r===n.before&&i===n.after||r===n.fullBefore&&i===n.fullAfter)return!0;if(o){const e=Z(r,i);if(e.before===n.before&&e.after===n.after)return!0;if(function(e,t,n,o){if(!n||!o||e.length-n.length!==t.length-o.length)return!1;for(let r=e.indexOf(n);-1!==r;r=e.indexOf(n,r+1))if(t.startsWith(o,r)&&J(e,r)&&J(t,r)&&J(e,r+n.length)&&J(t,r+o.length)&&e.slice(0,r)===t.slice(0,r)&&e.slice(r+n.length)===t.slice(r+o.length))return!0;return!1}(r,i,n.fullBefore,n.fullAfter))return!0}return(n.before?_(r,n.before)>_(i,n.before):!r)&&(n.after?_(i,n.after)>_(r,n.after):!i)}function Y(e,t,n){return e.tag!==t.tag||(e.children.length||t.children.length)&&e.text!==t.text&&S(n(e))===S(n(t))}function U(e=[],t,n,o,r){return e.flatMap(e=>{const i=U(e.children,t,n,o,r);let l;return l="media"===o.type?e.media?.includes(t):"attribute"===o.type?e.attributes.some(([e,n])=>e===o.name&&G("string"==typeof n?n:JSON.stringify(n),t)):("markup"!==o.type||e.tag===(r?o.oldTag:o.newTag))&&I(n(e),t),"text"===o.type&&i.length?i:[...l?[e]:[],...i]})}function K(e,t,n){if(e.unresolved)return 0;if(e.matches=[],e.spacing){const n=t.filter(e=>"spacing"===e.type),o=n.length&&H(e);return e.matches=n.filter(e=>o?.before===e.before&&o?.after===e.after),e.matches.length?2:0}let o=0;for(const r of t){if("spacing"===r.type)continue;let t=0;if("attributes"===e.kind){if(!["text","attribute"].includes(r.type))continue;const n=new Map(e.before.attributes),o=new Map(e.after.attributes);for(const e of new Set([...n.keys(),...o.keys()])){if("attribute"===r.type&&e!==r.name)continue;const i=n.get(e),l=o.get(e);JSON.stringify(i)!==JSON.stringify(l)&&(X("string"==typeof i?i:JSON.stringify(i)||"","string"==typeof l?l:JSON.stringify(l)||"",r)&&(t="attribute"===r.type||r.before&&r.after?2:1))}}else if("insert"===e.kind)!r.before&&e.added.some(e=>G(n(e),r.after))&&(t=Math.max(t,1));else if("delete"===e.kind)!r.after&&e.removed.some(e=>G(n(e),r.before))&&(t=Math.max(t,1));else if("media"===r.type)(e.before?.media||[]).some((t,n)=>t===r.before&&e.after?.media?.[n]===r.after)&&(t=2);else if("markup"===r.type)e.before?.tag===r.oldTag&&e.after?.tag===r.newTag&&Y(e.before,e.after,n)&&I(n(e.before),r.before)&&I(n(e.after),r.after)&&(t=r.before&&r.after?2:1);else if("text"===r.type){const o=!(!r.before||!r.after),i=o&&X(e.before?.text||"",e.after?.text||"",r,!0);(i||X(n(e.before),n(e.after),r,o))&&(t=o?2:1,i&&(e.directInput=!0))}t&&e.matches.push(r),o=Math.max(o,t)}return o}function Q(e,t){return!!e?.children.some(e=>e===t||e.node&&e.node===t?.node||Q(e,t))}const ee=new Set(["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","PageDown","PageUp","Home","End"," "]);function te(e,t){let n;for(const o of e?.rects??[]){const e=t(o);if(e.visible)return e;(!n||e.distance<n.distance)&&(n=e)}return n}function ne(e){return new Promise(t=>{const n=()=>{e.clearTimeout(o),e.cancelAnimationFrame(r),t()},o=e.setTimeout(n,100);let r=e.requestAnimationFrame(()=>{r=e.requestAnimationFrame(n)})})}function oe(e,t=!1){if(!ue(e,{visibilityProperty:!0,opacityProperty:!0}))return;const{left:n,right:o,top:r,bottom:i,width:l,height:s}=e.getBoundingClientRect();if(!(t||l&&s))return;const a=e.ownerDocument,{documentElement:c,body:u,defaultView:d}=a,f={left:n,right:l?o:n+1,top:r,bottom:s?i:r+1},p={...f},m={x:f.right-f.left,y:f.bottom-f.top},h="visible"===d.getComputedStyle(c).overflow,g=d.getComputedStyle(e);for(let n=e;n&&n!==c;){const o=n===e?g:d.getComputedStyle(n),{position:r,display:i,overflowX:l,overflowY:s}=o;if(n!==e&&(n!==u||!h)&&"inline"!==i&&("visible"!==l||"visible"!==s)&&n.offsetWidth&&n.offsetHeight){const{bounds:e,scaleX:r,scaleY:i}=ce(n,o);for(const[a,c,u,d,h]of[["x",l,"left","right",r],["y",s,"top","bottom",i]]){if("visible"===c)continue;const r="clip"===c?[0,0]:ae(n,o,a,h),i=t&&"hidden"===c,l="y"===a==("horizontal-tb"===o.writingMode);if(i&&r.some(e=>e)&&(l||f[u]<e[u]||f[d]>e[d]||re(o,g,a)))return{boundary:n};if(!se(f,p,e,u,d,i?[0,0]:r))return{boundary:n};m[a]=Math.min(m[a],p[d]-p[u])}}n="absolute"===r||"fixed"===r?n.offsetParent:n.parentElement}return{clipped:f,extent:m}}function re(e,t,n){const o=e=>e&&"auto"!==e&&0!==parseFloat(e);return("x"===n?["Left","Right"]:["Top","Bottom"]).some(n=>o(e[`scrollPadding${n}`])||o(t[`scrollMargin${n}`]))}function ie(e,t,n=!1){const o=oe(e,n);if(!o?.clipped)return;const{clipped:r,extent:i}=o,{ownerDocument:l}=e,s=l.documentElement;if(r.left=Math.max(s.clientLeft,r.left),r.right=Math.min(s.clientLeft+s.clientWidth,r.right),r.top=Math.max(0,r.top),r.bottom=Math.min(s.clientHeight,r.bottom),r.right<=r.left)return{rects:[]};const a=t?.({...r,top:0,bottom:s.clientHeight}),c=a?.visibleCenterX??(r.left+r.right)/2,u=ge(e,c);if(r.bottom<=r.top)return{rects:[],header:u?.bottom};const d={rects:[r],inViewport:!0,extent:i};if(!u)return d;const f={left:Math.max(r.left,u.left),right:Math.min(r.right,u.right),top:Math.max(r.top,u.top),bottom:Math.min(r.bottom,u.bottom)};if(!le(f)||!u.node.contains(l.elementFromPoint(c,(f.top+f.bottom)/2)))return d;const p=[{...r,top:f.bottom},{...r,bottom:f.top},{...f,left:r.left,right:f.left},{...f,left:f.right,right:r.right}].filter(le);return!p.length&&u.bottom>=s.clientHeight&&u.top<=0?void 0:{rects:p,inViewport:!0,extent:i,header:u.bottom}}function le({left:e,right:t,top:n,bottom:o}){return t>e&&o>n}function se(e,t,n,o,r,[i,l]){return e[o]=Math.max(e[o],n[o]),e[r]=Math.min(e[r],n[r]),t[o]=Math.max(n[o],t[o]+i),t[r]=Math.min(n[r],t[r]+l),t[r]>t[o]}function ae(e,t,n,o){const r="x"===n,i=r?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight;if(i<=0)return[0,0];const l=r?e.scrollLeft:e.scrollTop,s=t.display.endsWith("flex")&&t.flexDirection===(r?"row-reverse":"column-reverse"),a=(r&&"rtl"===t.direction)!==s;let c=a?-i:0,u=a?0:i;return("horizontal-tb"!==t.writingMode||l<c||l>u)&&(c=-i,u=i),[(l-u)*o,(l-c)*o]}function ce(e,t){const n=e.getBoundingClientRect(),o=n.width/e.offsetWidth,r=n.height/e.offsetHeight,i=n.left+e.clientLeft*o,l=n.top+e.clientTop*r,s={left:i,top:l,right:i+e.clientWidth*o,bottom:l+e.clientHeight*r},a=t.overflowClipMargin;if("clip"!==t.overflowX&&"clip"!==t.overflowY||!a||"0px"===a)return{bounds:s,scaleX:o,scaleY:r};const c=a.split(" ").map(parseFloat).find(Number.isFinite)??0,u=a.includes("border-box")?n:s,d=a.includes("content-box");return{scaleX:o,scaleY:r,bounds:{left:u.left+((d?parseFloat(t.paddingLeft):0)-c)*o,right:u.right-((d?parseFloat(t.paddingRight):0)-c)*o,top:u.top+((d?parseFloat(t.paddingTop):0)-c)*r,bottom:u.bottom-((d?parseFloat(t.paddingBottom):0)-c)*r}}}function ue(e,t={visibilityProperty:!0}){return!!e?.isConnected&&!!e.getClientRects().length&&(!e.checkVisibility||e.checkVisibility(t))&&"visible"===e.ownerDocument.defaultView.getComputedStyle(e).visibility}function de(e){return e.matchMedia("(prefers-reduced-motion: reduce)").matches?"instant":"smooth"}function fe(e,{behavior:t,header:n=he(e),nearest:o=!1}={}){const r=e.ownerDocument,i=r.defaultView,l=t??de(i);if(o&&!n)return void e.scrollIntoView({behavior:l,block:"nearest",inline:"nearest"});const s=i.getComputedStyle(e).scrollMarginTop,a=r.documentElement,c=a.clientHeight,u=i.getComputedStyle(a),d=me(u.scrollPaddingTop,c),f=me(u.scrollPaddingBottom,c);let p,m;try{let t=o?"nearest":"start";if(o){const e=n-parseFloat(s);null!==d&&e>d&&(p=a.getAttribute("style"),a.style.setProperty("scroll-padding-top",`${e}px`,"important"))}else{const t=n>0&&null!==d?`max(${s}, ${n-d}px)`:s;m=e.getAttribute("style"),e.style.setProperty("scroll-margin-top",`calc(${t} + 1lh)`,"important")}if(!o&&null!==d&&null!==f){const n=i.getComputedStyle(e),o=c-d-f-parseFloat(n.scrollMarginTop)-parseFloat(n.scrollMarginBottom),r=o-e.getBoundingClientRect().height;if(r>=0&&(t="center"),r>0&&"horizontal-tb"===u.writingMode){const e=Math.min(o/3,r);p=a.getAttribute("style"),a.style.setProperty("scroll-padding-bottom",`${f+e}px`,"important")}}e.scrollIntoView({behavior:l,block:t,inline:"nearest"})}finally{void 0!==p&&pe(a,p),void 0!==m&&pe(e,m)}}function pe(e,t){e.setAttribute("style",t??""),null===t&&e.removeAttribute("style")}function me(e,t){if("auto"===e)return 0;const n=parseFloat(e);return Number.isFinite(n)?n*(e.endsWith("%")?t/100:1):null}function he(e){const t=e.getBoundingClientRect();return ge(e,t.left+t.width/2)?.bottom??0}function ge(e,t){const n=e.ownerDocument;for(let o=n.elementFromPoint(t,1);o&&!o.contains(e);o=o.parentElement){const e=n.defaultView.getComputedStyle(o);if("fixed"!==e.position&&"sticky"!==e.position)continue;if("0"===e.opacity||!ue(o,{visibilityProperty:!0,opacityProperty:!0}))continue;const{left:t,right:r,top:i,bottom:l}=o.getBoundingClientRect();if("fixed"===e.position||i<=parseFloat(e.top)+1)return{node:o,left:t,right:r,top:i,bottom:l}}}window.jQuery(()=>{const e=window.meetTheFrontendLivePreviewPanel;if(!e)return;const t=document.querySelector("#wpbody-content > .wrap > h1.long-header ~ a");try{const n=window.wp?.revisions?.view?.frame?.model;if(!n||"function"!=typeof n.get||"function"!=typeof n.on||"function"!=typeof n.off)throw new Error("The native revision selection is unavailable.");if(!t)throw new Error("The native revision header is unavailable.");!function(e,t,n){const{strings:o}=e;let r,i=t.get("to"),l=0;const s=n.ownerDocument,a=s.getElementById("mtflpp-toggle");a.classList.replace("mtflpp-launcher","mtflpp-inline-launcher");const d=s.createElement("button");d.type="button",d.className="button-link",d.textContent=o.previewRevision,d.setAttribute("aria-controls","mtflpp-panel"),a.append(d),n.after(a);const f=c(o,{postTitle:m(i),publicRedirect:e.publicRedirect,inlineLauncher:d,canRememberVisibility:!1,onOpen(){f.setVisible(!0),g()},onClose:v,onRefresh:g,onRetry:()=>g(),beforeViewportChange:e=>p.beforeViewportChange(e),beforeMove(){l++,p.clear()},afterMove(){f.visible&&g()}}),p=function(e,t,n,o,r=[]){const i=u(r);let l,s,a,c,d;function f(){d?.()}return{get hasPreview(){return!!l},get hasHtmlPreview(){return!!s},get redirectDestination(){return c},load:function(r,u,p=()=>!1,m){const h=new URL(r);if("https:"!==h.protocol&&"http:"!==h.protocol)throw Object.assign(new Error(n.failed),{code:"mtflpp_preview_unsupported_url"});if(h.origin!==window.location.origin){const e=n.originMismatch.replace("%s",()=>h.origin+h.pathname);throw Object.assign(new Error(e),{code:"mtflpp_preview_origin_mismatch"})}const g=h.searchParams.get("mtflpp_token");if(!g)throw new Error(n.failed);return window.crossOriginIsolated&&h.searchParams.set("mtflpp_isolated","1"),f(),h.searchParams.delete("mtflpp_source"),e.followChanges&&h.searchParams.set("mtflpp_source","1"),o(n.updating),new Promise((r,f)=>{const w=e.stage.ownerDocument.createElement("iframe");w.title=n.title,w.className="mtflpp-frame mtflpp-loading",w.setAttribute("aria-hidden","true"),w.setAttribute("tabindex","-1"),w.referrerPolicy="same-origin";let v=!1,y=!1;const b=setTimeout(()=>M(new Error(n.failed)),3e4),x=()=>{y=!0,M()};function M(e){v||(v=!0,e&&(y=!0),clearTimeout(b),d===x&&(d=null),w!==l&&(w.onload=null,w.onerror=null,w.remove()),e?f(e):r())}d=x,w.onload=async()=>{const r=w!==l;if(r||(s=null,a=null),y||!u())return void M();let d,f,v;try{const e=w.contentDocument,t=e?.querySelector('meta[name="meet-the-frontend-live-preview-panel"]');t?.content===g?d=e:r&&!t&&(f=function(e,t){if("text/html"!==e?.contentType)return;const n=e.defaultView?.performance.getEntriesByType("navigation")[0];if(!(n?.redirectCount>0))return;const o=new URL(n.name);return o.origin!==t.origin||o.pathname===t.pathname&&o.search===t.search?void 0:o.pathname}(e,h))}catch{}d&&(e.followChanges&&i.capture(d,r?m:void 0),d.documentElement.style.setProperty("overscroll-behavior","contain","important")),d&&r&&(t.remember(s),e.followChanges&&p()&&s&&(v=i.findChange(s,d))),r&&l&&(l.onload=null,l.onerror=null,l.remove()),l=w,s=d,a=null,c=f,w.classList.remove("mtflpp-loading"),w.removeAttribute("aria-hidden"),w.removeAttribute("tabindex");const b=()=>!y&&u()&&w===l&&d===s&&(!d||w.contentDocument===d);let x;if(d&&r){const n=e.canvasTarget&&(t=>e.canvasTarget(w,t,{fitTarget:!0}));x=await t.restore(d,v,()=>b()&&e.followChanges&&p(),n)}b()?(a=x,o(n.current,"ready"),M()):M()},w.onerror=()=>{w===l?(s=null,a=null,c=void 0,u()&&o(n.failed,"error")):M(new Error(n.failed))},w.src=h.href,e.stage.append(w)})},cancel:f,beforeViewportChange({canvasTarget:n,canFollow:o,...r}){const i=a,c=s,u=l;if(i&&c)return t.keepInView(i,{...r,canvasTarget:e=>n(u,e),canFollow:()=>i===a&&c===s&&u.contentDocument===c&&e.visible&&e.followChanges&&o()})},clear(){f(),t.remember(s),l&&(l.onload=null,l.onerror=null),l=null,s=null,a=null,c=void 0,e.clearPreview()}}}(f,function(){let e,t=0,n=0;return{remember(e){try{e&&(t=e.defaultView.scrollY)}catch{}},async restore(e,o,r=()=>!0,i){const l=++n;try{const s=e.defaultView;let a;if(s.scrollTo({top:t,left:0,behavior:"instant"}),o?.ownerDocument===e&&r()){if(await ne(s),l!==n||o.ownerDocument!==e||!r())return;if(function(e,t){const n=e.ownerDocument;for(let t=e;t;t=t.parentElement)if("until-found"!==t.getAttribute("hidden")?.toLowerCase()&&(t.hasAttribute("hidden")||"none"===n.defaultView.getComputedStyle(t).display))return!1;let o=!1;for(let r=e;r&&e.isConnected&&e.ownerDocument===n&&t();r=r.parentElement){if("until-found"===r.getAttribute("hidden")?.toLowerCase()){if(r.dispatchEvent(new n.defaultView.Event("beforematch",{bubbles:!0})),!(e.isConnected&&e.ownerDocument===n&&r.isConnected&&r.ownerDocument===n&&r.contains(e)&&t()))break;"until-found"===r.getAttribute("hidden")?.toLowerCase()&&r.removeAttribute("hidden"),o=!0}const i=r.parentElement;i instanceof n.defaultView.HTMLDetailsElement&&!i.open&&r!==Array.from(i.children).find(e=>"summary"===e.localName)&&(i.open=!0,o=!0)}return o}(o,()=>l===n&&r())&&await new Promise(e=>s.setTimeout(e,0)),l!==n||!r())return;const t=o.ownerDocument===e?function(e){if(!e?.isConnected)return null;const t=oe(e,!0);if(t?.clipped)return e;if(!t?.boundary)for(const t of e.querySelectorAll("*"))if(oe(t,!0)?.clipped)return t;for(let n=t?.boundary||e.parentElement;n;){const e=oe(n,!0);if(e?.clipped)return n;n=e?.boundary||n.parentElement}return null}(o):null;t&&(function(e,t){const n=ie(e,t,!0);if(!n?.inViewport)return void fe(e);const{rects:o,extent:r,header:i=0}=n,l=e.ownerDocument.documentElement,s=Math.min(r.x,l.clientWidth),a=Math.min(r.y,l.clientHeight-i);o.some(e=>e.right-e.left>=s-1&&e.bottom-e.top>=a-1)?t&&te(n,t)?.reveal(de(e.ownerDocument.defaultView)):fe(e,{nearest:!0,header:i})}(t,i),o.contains(t)&&(a=t))}return t=s.scrollY,a}catch{}},keepInView(t,{canvas:n,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:l,canFollow:s}){try{const a=e?.target===t&&e.canFollow();if(e?.cancel(),!t.isConnected||!s())return;if(!a){const e=ie(t,o);if(!te(e,o)?.visible)return}const c=new AbortController,u={target:t,canFollow:()=>!c.signal.aborted&&s(),cancel(){c.abort(),e===u&&(e=null)}};return e=u,function(e,t,n,o,r){const i=e=>{e.isTrusted&&("keydown"!==e.type||ee.has(e.key))&&r()},l={capture:!0,passive:!0,signal:o};for(const n of[e,t])for(const e of["wheel","touchmove","pointerdown","keydown"])n?.addEventListener(e,i,l);t?.addEventListener("scroll",()=>{n?.()&&r()},l)}(t.ownerDocument.defaultView,n,l,c.signal,()=>{u.cancel(),i?.()}),async function(e,t,n,o){try{const r=e.ownerDocument.defaultView;if(await ne(r),!o())return;const{scrollX:i,scrollY:l}=r,s=n();if(s&&await s,!o()||r.scrollX!==i||r.scrollY!==l)return;let a=ie(e,t);a&&!a.rects.length&&(fe(e,{behavior:"instant",header:a.header}),a=ie(e,t)),te(a,t)?.reveal()}catch{}}(t,o,r,u.canFollow).finally(u.cancel)}catch{}}}}(),o,h,e.comparisonExcludedSelectors);function m(t){if(!t)return"";const n=t.get("dateShort")||t.get("date")||"",r=t.get("author")?.name||"",i=o.revisionLabel.replace("%1$s",()=>n).replace("%2$s",()=>r);return t.id===e.postId?`${o.currentVersion} — ${i}`:i}function h(e,t="loading",n={}){"ready"!==t&&p.hasPreview||f.setTitle(m(i)),f.report(e,t,{hasPreview:p.hasPreview,hasHtmlPreview:p.hasHtmlPreview,redirectDestination:p.redirectDestination,canRefresh:f.visible&&["ready","error"].includes(t),...n})}async function g(t=!0){clearTimeout(r),p.cancel();const n=++l;if(!f.visible)return;const s=i?.id===e.postId?e.currentPreviewUrl:i?.get("mtflppPreviewUrl");if("string"!=typeof s||!s)return p.clear(),void h(o.unavailable,"error",{canRetry:!1,canRefresh:!1,reason:"unavailable"});try{await p.load(s,()=>f.visible&&n===l,()=>f.followChanges&&t,{revision:{type:"selection",value:i.id}})}catch(e){if(f.visible&&n===l){const t={mtflpp_preview_origin_mismatch:"origin-mismatch",mtflpp_preview_unsupported_url:"unsupported-url"}[e?.code]||"";h("origin-mismatch"===t?e.message:o.failed,"error",{canRetry:!t,canRefresh:!t,reason:t})}}}function w(){const e=t.get("to");e?.id!==i?.id&&(i=e,l++,p.cancel(),clearTimeout(r),f.visible&&(h(o.stale,"stale"),r=setTimeout(g,250)))}function v(){l++,clearTimeout(r),f.setVisible(!1),p.clear(),f.returnToEditor()}t.on("update:revisions",w),window.addEventListener("pagehide",e=>{e.persisted||(t.off("update:revisions",w),v())}),f.visible&&g()}(e,n,t)}catch(n){!function(e,t,n){document.getElementById("mtflpp-panel")?.remove(),document.getElementById("mtflpp-toggle")?.remove(),document.getElementById("mtflpp-publish-preview")?.remove(),document.getElementById("mtflpp-term-preview")?.remove();const o=document.createElement("div");o.className="notice notice-error inline",o.setAttribute("role","alert");const r=document.createElement("p");r.textContent=e,o.append(r);const i=n||document.querySelector("#wpbody-content .wp-header-end")||document.querySelector("#wpbody-content .wrap h1, #wpbody-content .wrap h2");i?i.after(o):(document.getElementById("wpbody-content")||document.body).prepend(o),console.error("Meet the Frontend – Live Preview Panel could not start.",t)}(e.strings.bootFailed,n,t)}})})();
  • meet-the-frontend-live-preview-panel/trunk/build/term-editor.asset.php

    r3820590 r3822693  
    99                'wp-primitives'
    1010        ),
    11         'version' => '6dfda17ecee9014448db'
     11        'version' => '17fe6b87b747b814253d'
    1212);
  • meet-the-frontend-live-preview-panel/trunk/build/term-editor.js

    r3820590 r3822693  
    1 (()=>{"use strict";const e=window.wp.data,t=window.wp.preferences,n=window.wp.element,o=window.wp.components,r=window.wp.notices,i=window.wp.primitives,a=window.ReactJSXRuntime,s={refresh:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M12 5.5L17.7929 11.2929C18.1834 11.6834 18.1834 12.3166 17.7929 12.7071L16 14.5M16 5.5H12V9.5M12 18.5L6.20711 12.7071C5.81658 12.3166 5.81658 11.6834 6.20711 11.2929L8 9.5M8 18.5H12V14.5"})}),more:(0,a.jsxs)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,a.jsx)(i.Path,{d:"M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z",fill:"currentColor",stroke:"none"}),(0,a.jsx)(i.Path,{d:"M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z",fill:"currentColor",stroke:"none"}),(0,a.jsx)(i.Path,{d:"M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z",fill:"currentColor",stroke:"none"}),(0,a.jsx)(i.Path,{d:"M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z"}),(0,a.jsx)(i.Path,{d:"M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z"}),(0,a.jsx)(i.Path,{d:"M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z"})]}),expand:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M4.75 10V4.75H10M4.75 4.75L10 10M14 19.25H19.25V14M19.25 19.25L14 14"})}),compact:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M10 4.75V10H4.75M10 10L4.75 4.75M19.25 14H14V19.25M14 14L19.25 19.25"})}),pip:(0,a.jsxs)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,a.jsx)(i.Path,{d:"M4.75 9.25V16C4.75 16.6904 5.30964 17.25 6 17.25H8M4.75 9.25V6C4.75 5.30964 5.30964 4.75 6 4.75H16C16.6904 4.75 17.25 5.30964 17.25 6V8M4.75 9.25H8"}),(0,a.jsx)(i.Path,{d:"M10.75 11.25C10.75 10.9739 10.9739 10.75 11.25 10.75H18.75C19.0261 10.75 19.25 10.9739 19.25 11.25V18.75C19.25 19.0261 19.0261 19.25 18.75 19.25H11.25C10.9739 19.25 10.75 19.0261 10.75 18.75V11.25Z",fill:"currentColor"})]}),move:(0,a.jsxs)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,a.jsx)(i.Path,{d:"M9.25 5.75H8.75V6.25H9.25V5.75Z",fill:"currentColor",stroke:"none"}),(0,a.jsx)(i.Path,{d:"M9.25 11.75H8.75V12.25H9.25V11.75Z",fill:"currentColor",stroke:"none"}),(0,a.jsx)(i.Path,{d:"M9.25 17.75H8.75V18.25H9.25V17.75Z",fill:"currentColor",stroke:"none"}),(0,a.jsx)(i.Path,{d:"M15.25 5.75H14.75V6.25H15.25V5.75Z",fill:"currentColor",stroke:"none"}),(0,a.jsx)(i.Path,{d:"M15.25 11.75H14.75V12.25H15.25V11.75Z",fill:"currentColor",stroke:"none"}),(0,a.jsx)(i.Path,{d:"M15.25 17.75H14.75V18.25H15.25V17.75Z",fill:"currentColor",stroke:"none"}),(0,a.jsx)(i.Path,{d:"M9.25 5.75H8.75V6.25H9.25V5.75Z"}),(0,a.jsx)(i.Path,{d:"M9.25 11.75H8.75V12.25H9.25V11.75Z"}),(0,a.jsx)(i.Path,{d:"M9.25 17.75H8.75V18.25H9.25V17.75Z"}),(0,a.jsx)(i.Path,{d:"M15.25 5.75H14.75V6.25H15.25V5.75Z"}),(0,a.jsx)(i.Path,{d:"M15.25 11.75H14.75V12.25H15.25V11.75Z"}),(0,a.jsx)(i.Path,{d:"M15.25 17.75H14.75V18.25H15.25V17.75Z"})]}),warning:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M12 8L12 13M12 14.5L12 16M4.75 12C4.75 7.99593 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12Z",strokeLinejoin:"round"})}),info:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M12 16V11M12 9.5V8M19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12C4.75 7.99594 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12Z",strokeLinejoin:"round"})}),close:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M7.75 16.25L16.25 7.75M16.25 16.25L7.75 7.75"})}),check:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M7 12L10 15L17 8"})}),chevron:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M7 11L12 15L17 11"})}),desktop:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M4.75 16.75V17H3.25C3.11193 17 3 17.1119 3 17.25H21C21 17.1119 20.8881 17 20.75 17H19.25V16.75M4.75 16.75V8.5C4.75 7.80964 5.30964 7.25 6 7.25H18C18.6904 7.25 19.25 7.80964 19.25 8.5V16.75M4.75 16.75H19.25"})}),tablet:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M10 16.5H14M18.25 18V6C18.25 5.30964 17.6904 4.75 17 4.75H7C6.30964 4.75 5.75 5.30964 5.75 6L5.75 18C5.75 18.6904 6.30964 19.25 7 19.25H17C17.6904 19.25 18.25 18.6904 18.25 18Z"})}),mobile:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M11 16.5H13M16.25 18V6C16.25 5.30964 15.6904 4.75 15 4.75H9C8.30964 4.75 7.75 5.30964 7.75 6L7.75 18C7.75 18.6904 8.30964 19.25 9 19.25H15C15.6904 19.25 16.25 18.6904 16.25 18Z"})})};function l(e,t,n="right"){const o=e&&!Array.isArray(e)&&e.bounds&&["x","y","width","height"].every(t=>Number.isFinite(e.bounds[t]))&&e.bounds.width>0&&e.bounds.height>0&&[null,"left","center","right"].includes(e.dock)&&"boolean"==typeof e.expanded&&(void 0===e.anchor||["left","center","right"].includes(e.anchor));let r=!!o&&e.expanded;const i={width:480,height:393},a=o?{...e.bounds}:{x:0,y:0,...i};let s=o?e.dock:n,l=s||o&&e.anchor||"right";function c(){return"left"===l?0:"center"===l?.5:1}function d(e,n=t(!s),o=320,r=220){return e.width=Math.min(n.width,Math.max(Math.min(o,n.width),e.width)),e.height=Math.min(n.height,Math.max(Math.min(r,n.height),e.height)),e.x=Math.max(n.left,Math.min(n.right-e.width,e.x)),e.y=Math.max(n.top,Math.min(n.bottom-e.height,e.y)),e}function u(e){if(!s)return e;const n=t();return e.x="left"===s?n.left:"center"===s?n.left+(n.width-e.width)/2:n.right-e.width,e.y=n.bottom-e.height,e}return{area:t,compactRect:function(){return u(d({...a}))},launcherRect:function(e){return u(d({...e,x:a.x+(a.width-e.width)*c(),y:a.y+a.height-e.height},t(!s),1,1))},usableEdge:function(e){return!(s&&(e.includes("s")||"left"===s&&e.includes("w")||"right"===s&&e.includes("e")))},get anchor(){return l},get anchorFactor(){return c()},get dock(){return s},get expanded(){return r},get layout(){return{bounds:{...a},dock:s,anchor:l,expanded:r}},toggleExpanded(){r=!r},dockTo:function(e="right",t=!1){t&&Object.assign(a,i),r=!1,l=s=e},resize(e,n,o,r){Object.assign(a,function(e,n,o,r){const i=t(!s),a=n.includes("e")||n.includes("w"),c=n.includes("n")||n.includes("s"),d=function(e){return"center"===l?.5:e.includes("w")?1:0}(n),u=e.x+e.width*d,f=n.includes("n"),p=e.y+(f?e.height:0),m=function(e,t,n){return 0===n?e.right-t:1===n?t-e.left:2*Math.min(t-e.left,e.right-t)}(i,u,d),h=f?p-i.top:i.bottom-p,g=(n.includes("w")?-o:o)*(.5===d?2:1),w=Math.max(Math.min(320,m),Math.min(m,e.width+g)),v=Math.max(Math.min(220,h),Math.min(h,e.height+(f?-r:r))),y=a&&0!==o&&w!==e.width,b=c&&0!==r&&v!==e.height,x=f?p-v:p;return{x:y?u-w*d:e.preferredBounds.x,y:b?x:e.preferredBounds.y,width:y?w:e.preferredBounds.width,height:b?v:e.preferredBounds.height}}(e,n,o,r))},move:function(e,n,o,r=!1){const i=d({...e,x:e.x+n,y:e.y+o},t(!0),r?1:320,r?1:220);a.x=i.x+(r?(i.width-a.width)*c():0),a.y=i.y+(r?i.height-a.height:0),s=null}}}function c(i,{postTitle:a="",publicRedirect:c,inlineLauncher:d,nativeLauncher:u,canRememberVisibility:f=!0,onOpen:p,onClose:m,onRefresh:h,onRetry:g,beforeMove:w,afterMove:v,beforeViewportChange:y}){const b=window,x=document,M="meet-the-frontend-live-preview-panel",C=(0,e.select)(t.store),k=(0,e.dispatch)(t.store),E="width"===C.get(M,"fit")?"width":"automatic";k.setDefaults(M,{rememberVisibility:!0,rememberPosition:!0,panelOpen:!0,scrollToChanges:!0,viewport:"desktop",fitMode:E,customZoom:100,tabletOrientation:"portrait",mobileOrientation:"portrait"});const P=()=>!d&&(!u||u.fallbackMedia.matches);let S=!1!==C.get(M,"rememberVisibility"),L=!1!==C.get(M,"rememberPosition"),T=!1!==C.get(M,"scrollToChanges");const V=d?.parentElement??x.getElementById("mtflpp-toggle"),H=x.getElementById("mtflpp-panel");if(!V||!H)throw new Error("Preview panel markup is missing.");const j=d||function(e){let t;const{title:r,moveHelp:i}=e.dataset;return(0,n.flushSync)(()=>(0,n.createRoot)(e).render((0,n.createElement)(o.Button,{ref:e=>{t=e},variant:"secondary",label:r,title:r,description:i,"aria-controls":"mtflpp-panel","aria-expanded":!1},(0,n.createElement)("span",{className:"mtflpp-launcher-label"},r)))),t}(V),O=H.querySelector(".mtflpp-move-control"),R=H.querySelector(".mtflpp-resize"),N=H.querySelectorAll("[data-resize-edge]"),$=H.querySelector(".mtflpp-header"),_=H.querySelector(".mtflpp-caption"),D=H.querySelector(".mtflpp-viewport"),A=H.querySelector(".mtflpp-canvas"),F=H.querySelector(".mtflpp-stage"),B=H.querySelector(".mtflpp-empty"),W=H.querySelector(".mtflpp-devicebar"),q=H.querySelector(".mtflpp-dimensions"),z=H.querySelector(".mtflpp-feedback"),Z=H.querySelector('[role="status"]');let I;const G=function(e,t,n,o={},r=()=>{},i={desktop:"Desktop",tablet:"Tablet",mobile:"Phone"}){const a=e.ownerDocument.defaultView,s=e.querySelector(".mtflpp-canvas"),l=e.querySelector(".mtflpp-canvas-space"),c=n.querySelector(".mtflpp-dimensions-text"),d={desktop:[1280,800],tablet:[768,1024],mobile:[390,844]},u=Object.keys(d);let f=u.includes(o.device)?o.device:"desktop";const p=["automatic","window","width","custom"];let m=p.includes(o.fit)?o.fit:"automatic";const h=e=>Number.isInteger(e)&&e>=10&&e<=400;let g,w=h(o.customZoom)?o.customZoom:100,v=100;const y=e=>"desktop"===e?"landscape":"portrait",b=Object.fromEntries(u.map(e=>[e,"desktop"!==e&&["portrait","landscape"].includes(o[`${e}Orientation`])?o[`${e}Orientation`]:y(e)])),x=()=>b[f]===y(f)?d[f]:[...d[f]].reverse(),M=()=>"width"===m;let C,k,E;const P=a.matchMedia("(prefers-reduced-motion: no-preference)");function S(){const t=e.ownerDocument.defaultView.devicePixelRatio;return Number.isFinite(t)&&t>0?t:1}function L(e,t){if("custom"===m)return w/100/S();const n=s.clientWidth/e;if(M())return n;const o=Math.min(n,s.clientHeight/t);return"automatic"===m?Math.min(1/S(),o):o}function T(e,n){C=e;const[o,r]=x(),i=Math.max(0,(s.clientWidth-o*C)/2),a=Math.max(0,(s.clientHeight-r*C)/2);Object.assign(l.style,{width:`${Math.max(s.clientWidth,i+o*C)}px`,height:`${Math.max(s.clientHeight,a+r*C)}px`}),Object.assign(t.style,{left:`${i}px`,top:`${a}px`,transform:`scale(${C})`});const c=o*C>s.clientWidth+.01||r*C>s.clientHeight+.01,d="custom"===m||M();s.tabIndex=d&&c?0:-1,s.scrollLeft="custom"===m?n.x*C:0,s.scrollTop=d?n.y*C:0}function V(){if(!k)return;const e=k;k=null,e.window.cancelAnimationFrame(e.frame),e.resolve?.()}function H(e,t,n,o){return t<=0||o&&e<-1&&t<n?Math.max(e,t-n):e>=n||o&&e>0&&t>n+1?Math.min(e,t-n):0}function j(o=!1,a=!1){V();const[l,d]=x();if(Object.assign(t.style,{width:`${l}px`,height:`${d}px`}),!e.clientWidth||!e.clientHeight)return;const u=S(),p=`${i[f]} (${l} × ${d}) · `,h=Math.max(400,Math.ceil(e.clientWidth/l*u*100)),y=`${p}${"0".repeat(String(h).length)}%`;n.dataset.reserve!==y&&(n.dataset.reserve=y);const b=a?{x:0,y:0}:{x:(s.scrollLeft||0)/(C||1),y:(s.scrollTop||0)/(C||1)};if(s.style.overflowX="hidden",s.style.overflowY="hidden","custom"===m){const e=L(l,d);for(let t=0;t<2;t++)l*e>s.clientWidth+.01&&(s.style.overflowX="scroll"),d*e>s.clientHeight+.01&&(s.style.overflowY="scroll")}else M()&&d*L(l,d)>e.clientHeight&&(s.style.overflowY="scroll");if(!s.clientWidth||!s.clientHeight)return;const E=L(l,d),H=Math.round(E*u*100),j=H!==v||u!==g;v=H,g=u;const O=`${p}${"custom"===m?w:v}%`;c.textContent!==O&&(c.textContent=O),j&&r();const R=C??E;if(!o||!P.matches||R===E)return void T(E,b);const N={window:e.ownerDocument.defaultView,frame:null},$=N.window.performance.now();k=N;const _=e=>{T(e,b),N.scrollLeft=s.scrollLeft,N.scrollTop=s.scrollTop};_(R);const D=e=>{if(k!==N)return;const t=Math.min(1,Math.max(0,(e-$)/200));_(R+(E-R)*(1-(1-t)**3)),t<1?N.frame=N.window.requestAnimationFrame(D):V()};N.frame=N.window.requestAnimationFrame(D)}function O(){j()}function R(){E?.();const t=e.ownerDocument.defaultView.matchMedia(`(resolution: ${S()}dppx)`);t.addEventListener("change",R),E=()=>t.removeEventListener("change",R),O()}let N=new a.ResizeObserver(O);return N.observe(e),P.addEventListener("change",O),a.addEventListener("resize",R),R(),{get device(){return f},get fit(){return m},get customZoom(){return w},get zoomPercent(){return"custom"===m?w:v},get dpr(){return S()},get orientation(){return b[f]},canvasTarget:function(e,t,{fitTarget:n=!1}={}){const o=e.getBoundingClientRect(),r=s.getBoundingClientRect(),i=o.left-r.left-s.clientLeft,a=o.top-r.top-s.clientTop,l=H(i+t.left*C,i+t.right*C,s.clientWidth,n),c=H(a+t.top*C,a+t.bottom*C,s.clientHeight,n),d=Math.max(t.left,-i/C),u=Math.min(t.right,(s.clientWidth-i)/C);return{visible:!l&&!c,visibleCenterX:d<u?(d+u)/2:void 0,distance:Math.hypot(l,c),reveal(e="instant"){(l||c)&&s.scrollBy({left:l,top:c,behavior:e})}}},canvasWasPanned:function(){return!!k&&(s.scrollLeft!==k.scrollLeft||s.scrollTop!==k.scrollTop)},whenSettled:function(){if(!k)return;const e=k;return e.done??=new Promise(t=>{e.resolve=t}),e.done},finishMotion(){k&&O()},select(e,{animate:t=!1,keepPan:n=!1}={}){if(!u.includes(e))return;const o=f!==e;f=e,o?j(t,!n):k||O()},rotate({animate:e=!1,keepPan:t=!1}={}){"desktop"!==f&&(b[f]="portrait"===b[f]?"landscape":"portrait",j(e,!t))},setFit(e){p.includes(e)&&m!==e&&(m=e,j(!1,!0))},setZoom(e){if(!h(e)||"custom"===m&&w===e)return;const t="custom"!==m;w=e,m="custom",j(!1,t)},layout:O,beforeMove(){V(),N.disconnect(),E?.(),e.ownerDocument.defaultView.removeEventListener("resize",R)},afterMove(){N=new e.ownerDocument.defaultView.ResizeObserver(O),N.observe(e),e.ownerDocument.defaultView.addEventListener("resize",R),R()}}}(D,F,q,{device:C.get(M,"viewport"),fit:C.get(M,"fitMode")??E,customZoom:C.get(M,"customZoom"),tabletOrientation:C.get(M,"tabletOrientation"),mobileOrientation:C.get(M,"mobileOrientation")},()=>Pe(),i),X=x.querySelector("#wpbody-content > .wrap"),J=x.getElementById("wpadminbar");function Y(e=!1){const t=Math.max(1,x.documentElement.clientWidth),n=Math.max(1,x.documentElement.clientHeight),o=x.documentElement.getBoundingClientRect().left+b.scrollX,r=!e&&X?.getBoundingClientRect(),i=r?Math.max(0,"rtl"===b.getComputedStyle(X).direction?r.left-o:o+t-r.right):20,a=e?0:i,s=Math.min(a,(t-1)/2),l=Math.min(Math.max(0,J?.getBoundingClientRect().bottom||0)+a,n-1),c=t-s,d=n-Math.min(a,n-l-1);return{left:s,top:l,right:c,bottom:d,width:c-s,height:d-l}}let U,K=f&&(!S||!1!==C.get(M,"panelOpen"));const Q=C.get(M,"layout"),ee=C.get(M,"position")??Q?.dock??Q?.anchor;let te=["left","center","right"].includes(ee)?ee:"right";const ne=l(L?Q:void 0,Y,te),{compactRect:oe,usableEdge:re}=ne;let ie,ae=!1,se="",le=!1,ce={text:i.loading,state:"loading",hasPreview:!1,canRetry:!1,reason:""},de=!1;function ue(e){const t="string"==typeof e?e.replace(/\s+/g," ").trim():"";_.textContent=t?`${i.preview} — ${t}`:i.title,_.title=_.textContent,U&&(U.document.title=_.textContent)}function fe(){const{text:e,state:t,hasPreview:n,reason:o}=ce;return"handover"===t?{heading:i.switchingPreview,description:e,note:i.tabEdits}:"conflict"===t?{heading:e,description:{"handed-off":i.handedOffHelp,busy:i.takeoverTimeoutHelp,manual:i.closeOtherHelp}[o]||i.conflictHelp,note:"manual"===o?i.manualSwitchHint:i.tabEdits}:"paused"===t?{heading:i.pausedTitle,description:e,note:""}:"error"===t?function(){const{text:e,hasPreview:t,canRetry:n,reason:o}=ce;if("origin-mismatch"===o)return{heading:i.originMismatchTitle,description:t?`${e} ${i.previousPreview}`:e,note:""};if("unavailable"===o||"browser"===o)return{heading:"unavailable"===o?i.unavailableTitle:i.browserTitle,description:e,note:""};if(!t){let t=e;return e===i.failed&&(t=n?i.failedHelp:""),"reload"===o&&(t+=` ${i.reviewBeforeReload}`),{heading:i.failed,description:t,note:""}}return{heading:e===i.failed?i.refreshFailed:e,description:"reload"===o?i.reviewBeforeReload:i.previousPreview,note:""}}():n?{heading:e,description:"",note:""}:{heading:i.loading,description:i.preparing,note:""}}function pe(){return ae?"handover"===ce.state?i.takingOver:i.takeOver:i.retry}function me(e){return!e||["handover","paused"].includes(ce.state)?"info":"error"!==ce.state||ce.canRetry?"warning":"error"}function he(){return ce.redirectDestination?`${i.redirected} ${ce.redirectDestination}`:ce.hasHtmlPreview&&ie?`${i.publicRedirected} ${ie}`:""}function ge(){const{state:e,hasPreview:t,canRetry:n,reason:o}=ce,r=t&&["error","conflict","handover","paused"].includes(e),a=!t||r||se?"":he();if(z.hidden=!r&&!se&&!a,z.tabIndex=z.hidden?-1:0,H.dataset.hasFeedback=String(!z.hidden),z.hidden)return null;if(a)return{heading:a,status:"info",dismissible:!1};const{heading:s,description:l}=fe();return{heading:r?s:se,description:r?l:i.windowNoticeHelp,status:me(r),dismissible:!r,retry:r&&(ae||n&&["error","conflict"].includes(e)),close:r&&"error"===e&&!n&&"reload"!==o,disabled:"handover"===e,action:pe()}}function we(e){ce.hasPreview&&["error","conflict","handover","paused"].includes(ce.state)||(se=e,Pe()),Z.textContent=`${e} ${i.windowNoticeHelp}`}function ve(){se="",Pe()}function ye(e,t="loading",{canTakeOver:n=!1,hasPreview:o=!1,hasHtmlPreview:r=!1,redirectDestination:i,canRefresh:a=!1,canRetry:s=!0,reason:l=""}={}){const d=H.ownerDocument.activeElement,u=H.contains(d),f=!o&&(ce.state!==t||ce.text!==e||ce.reason!==l),p=ce.hasPreview!==o;ce={text:e,state:t,canTakeOver:n,hasPreview:o,hasHtmlPreview:r,redirectDestination:i,canRefresh:a,canRetry:s,reason:l},["error","conflict","handover","paused"].includes(t)&&(se=""),H.dataset.state=t,H.dataset.hasPreview=String(o),ae=n&&["conflict","handover"].includes(t),B.hidden=o,W.hidden=!o;const{heading:m,description:h,note:g}=fe();f&&(B.scrollTop=0);const w="ready"!==t||se?"":he();Z.textContent=o?[m,h,g,w].filter(Boolean).join(" "):m,Pe(),p&&G.layout(),function(e,t){e&&t&&(!H.contains(e)||e.closest("[hidden]")||e.disabled||!ce.hasPreview&&A.contains(e))&&I.focus(B.hidden?"actions":"empty-title")}(d,u),K&&"ready"===t&&r&&!i&&async function(){if(c&&!le){le=!0;try{const e=new URL(c.endpoint);if(e.origin!==b.location.origin)return;const t=await b.fetch(e,{credentials:"same-origin",cache:"no-store",redirect:"error",headers:{"X-WP-Nonce":c.nonce}});if(!t.ok)return;const{destination:n}=await t.json();if("string"!=typeof n||!n)return;if(ie=n,!K)return;Pe(),"ready"!==ce.state||!ce.hasHtmlPreview||ce.redirectDestination||se||(Z.textContent=he())}catch{}}}()}function be(e){f&&S&&C.get(M,"panelOpen")!==e&&k.set(M,"panelOpen",e)}function xe(){L&&k.set(M,"layout",ne.layout)}function Me(){const e=V.hidden;V.hidden=!1,V.style.maxWidth=`${Y(!ne.dock).width}px`;const t={width:V.offsetWidth,height:V.offsetHeight};return V.hidden=e,ne.launcherRect(t)}function Ce(){if(U)return;if(!K&&P()){const e=Me(),t=ne.anchorFactor;Object.assign(V.style,{left:`${e.x+e.width*t}px`,top:`${e.y+e.height}px`,transform:`translate(${-100*t}%, -100%)`})}let e=oe();if(H.dataset.anchor=ne.anchor,ne.expanded){const t=Y();e={x:t.left,y:t.top,width:t.width,height:t.height}}Object.assign(H.style,{left:`${e.x}px`,top:`${e.y}px`,width:`${e.width}px`,height:`${e.height}px`,transform:""})}function ke(e="right",t=!1){ne.dockTo(e,t),te=e,k.set(M,"position",te),Ce(),xe(),Pe()}function Ee(){return"function"==typeof b.documentPictureInPicture?.requestWindow}function Pe(){if(!I)return;const e=H.ownerDocument.fullscreenElement===H,t=!U&&!e,n=t&&!ne.expanded;H.classList.toggle("mtflpp-expanded",ne.expanded),R.hidden=!n;for(const e of N)e.hidden=!n||!re(e.dataset.resizeEdge);const o=ae||ce.canRetry&&["error","conflict"].includes(ce.state);var r;I.update({inPage:t,inPip:!!U,movable:n,dock:ne.dock,canRememberVisibility:f,rememberVisibility:S,rememberPosition:L,followChanges:T,device:G.device,busy:ce.hasPreview&&["stale","loading","handover"].includes(ce.state)&&ce.text!==i.saving,empty:ce.hasPreview?null:{...fe(),busy:["loading","stale","ready","handover"].includes(ce.state),icon:["paused","conflict"].includes(ce.state)||["unavailable","browser","origin-mismatch"].includes(ce.reason)?"info":"warning",retry:o,disabled:"handover"===ce.state,close:"error"===ce.state&&!o,action:pe()},notice:ge(),fit:G.fit,orientation:G.orientation,customZoom:G.customZoom,zoomPercent:G.zoomPercent,dpr:G.dpr,canRefresh:ce.canRefresh,hasPreview:ce.hasPreview,canPip:t&&Ee(),canFullscreen:t&&!!x.fullscreenEnabled,mode:e||ne.expanded?"compact":"expand",modeLabel:(r=e,r?i.exitFullscreen:ne.expanded?i.compact:i.expand)})}function Se(){I.closeMenu(),U?U.close():x.fullscreenElement!==H?(ne.toggleExpanded(),Ce(),xe(),Pe(),I.focus("mode")):x.exitFullscreen().then(ve,()=>we(i.fullscreenFailed))}function Le(e,t=!1,n){const o=e===j,r=e===$,a=()=>n||("left"===ne.anchor?"ne":"nw"),s=()=>U||!o&&ne.expanded||x.fullscreenElement===H||t&&!re(a());let l,c;const d=()=>({...o?Me():oe(),preferredBounds:ne.layout.bounds});function u(){if(c=null,l)if(t||o)Ce();else{const e=oe(),t=e.x-parseFloat(H.style.left),n=e.y-parseFloat(H.style.top);Object.assign(H.style,{width:`${e.width}px`,height:`${e.height}px`,transform:`translate3d(${t}px, ${n}px, 0)`})}}function f(){if(!l)return;const{pointer:t,moved:n}=l;l=null,b.cancelAnimationFrame(c),e.hasPointerCapture(t)&&e.releasePointerCapture(t),H.classList.remove("mtflpp-dragging"),e.classList.remove("mtflpp-edge-active"),x.documentElement.classList.remove("mtflpp-window-dragging"),x.documentElement.style.removeProperty("--mtflpp-drag-cursor"),Ce(),n&&(o&&(de=!0),xe(),Pe())}e.addEventListener("pointerdown",t=>{0!==t.button||s()||r&&t.target.closest('button, a, [role="button"]')||(o&&(de=!1),t.preventDefault(),o?j.focus({preventScroll:!0}):e===O&&I.focus("move"),I.closeMenu(),l={...d(),pointer:t.pointerId,pointerX:t.clientX,pointerY:t.clientY},e.setPointerCapture(t.pointerId))}),e.addEventListener("pointermove",n=>{if(!l||l.pointer!==n.pointerId)return;const r=n.clientX-l.pointerX,i=n.clientY-l.pointerY;!l.moved&&Math.abs(r)+Math.abs(i)<4||(l.moved=!0,H.classList.add("mtflpp-dragging"),t&&e.classList.add("mtflpp-edge-active"),x.documentElement.style.setProperty("--mtflpp-drag-cursor",t?b.getComputedStyle(e).cursor:"grabbing"),x.documentElement.classList.add("mtflpp-window-dragging"),t?ne.resize(l,a(),r,i):ne.move(l,r,i,o),c||(c=b.requestAnimationFrame(u)))});for(const t of["pointerup","pointercancel","lostpointercapture"])e.addEventListener(t,f);b.addEventListener("blur",f),r||n||e.addEventListener("keydown",e=>{const n={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[e.key];if(!n||e.altKey||e.ctrlKey||e.metaKey||s())return;e.preventDefault(),I.closeMenu();const r=d(),l=e.shiftKey?40:10;t?ne.resize(r,a(),n[0]*l,n[1]*l):ne.move(r,n[0]*l,n[1]*l,o),Ce(),xe(),Pe();const c=oe();Z.textContent=t?`${i.resize}: ${Math.round(c.width)} × ${Math.round(c.height)}`:i.moved})}ue(a),$.addEventListener("dblclick",e=>{U||e.target.closest("button, a")||Se()}),x.addEventListener("fullscreenchange",Pe),R.addEventListener("keydown",e=>{"Escape"===e.key&&R.classList.add("mtflpp-help-dismissed")}),R.addEventListener("blur",()=>R.classList.remove("mtflpp-help-dismissed")),Le(O),Le($),d||Le(j),Le(R,!0);for(const e of N)Le(e,!0,e.dataset.resizeEdge);function Te(){H.hidden=!K,V.hidden=!d&&(K||!P()),j.setAttribute("aria-expanded",String(K))}function Ve(e=!0){K?I.focus("actions"):(be(!0),p(),K&&e&&I.focus("actions"))}return b.addEventListener("resize",Ce),b.addEventListener("scroll",Ce,{passive:!0}),u?.fallbackMedia.addEventListener("change",()=>{Ce(),Te()}),j.addEventListener("click",e=>{if(de&&0!==e.detail)return de=!1,void e.preventDefault();de=!1,Ve(0===e.detail)}),I=function(t,i,a){const l=t.querySelector(".mtflpp-controls"),c=t.querySelector(".mtflpp-refresh-control"),d=t.querySelector(".mtflpp-move-control"),u=t.querySelector(".mtflpp-device-controls"),f=t.querySelector(".mtflpp-fit-control"),p=t.querySelector(".mtflpp-pip-control"),m=t.querySelector(".mtflpp-empty"),h=t.querySelector(".mtflpp-feedback");let g,w=(0,n.createRoot)(l),v=!1,y=!1,b=!1;const x=r.InlineNotices?(0,e.dispatch)(r.store):null,M=t.ownerDocument.defaultView?.wp?.theme?.ThemeProvider,C="meet-the-frontend-live-preview-panel",k="preview-feedback";let E="";function P(){const e=g.notice,t=/[.!?…。!?]$/.test(e.heading)?e.heading:`${e.heading}.`;return{message:e.description?`${t} ${e.description}`:e.heading,status:e.status,isDismissible:e.dismissible,actions:[...e.retry?[{label:e.action,disabled:e.disabled,onClick:a.retry}]:[],...e.close?[{label:i.close,onClick:a.close}]:[]]}}function S(){x&&E&&x.removeNotice(k,C),E=""}function L(e){return()=>{H(),e()}}function T(){const{inPage:e,inPip:l,mode:w,modeLabel:k,movable:E,busy:S,canRefresh:T,hasPreview:j,canPip:O}=g;return(0,n.createElement)(o.SlotFillProvider,null,(0,n.createPortal)(E&&e&&(0,n.createElement)(o.Button,{className:"mtflpp-icon mtflpp-move",size:"compact",icon:s.move,label:i.move,showTooltip:!0,tooltipPosition:"bottom","data-action":"move"}),d),(0,n.createPortal)((0,n.createElement)(o.Button,{className:"mtflpp-icon",size:"compact",icon:S?(0,n.createElement)(o.Spinner):s.refresh,label:i.refresh,showTooltip:!0,accessibleWhenDisabled:!0,disabled:!T,onClick:a.refresh,"data-action":"refresh"}),c),(0,n.createPortal)(O&&j&&(0,n.createElement)("div",{className:"mtflpp-pip-surface"},(0,n.createElement)(o.Button,{className:"mtflpp-pip-button",icon:s.pip,label:i.popOutHelp,"aria-label":i.popOut,description:i.popOutHelp,showTooltip:!0,onClick:a.popOut,"data-action":"pop-out"})),p),function(){const{canPip:e,canFullscreen:t,inPage:r,inPip:l,dock:c,canRememberVisibility:d,rememberVisibility:u,rememberPosition:f,followChanges:p}=g;return(0,n.createElement)(o.DropdownMenu,{className:"mtflpp-actions",label:i.actions,icon:s.more,open:v,onToggle(e){v=e,e&&(y=!1),V()},toggleProps:{className:"mtflpp-icon",size:"compact","data-action":"actions"},popoverProps:{placement:"bottom-end",offset:6,shift:!0,className:"mtflpp-menu-popover"}},()=>(0,n.createElement)(n.Fragment,null,(e||t)&&(0,n.createElement)(o.MenuGroup,{label:i.display},e&&(0,n.createElement)(o.MenuItem,{label:i.popOutHelp,description:i.popOutHelp,showTooltip:!0,onClick:L(a.popOut),"data-action":"pip","aria-label":i.popOut},i.popOut),t&&(0,n.createElement)(o.MenuItem,{onClick:L(a.fullscreen),"data-action":"fullscreen"},i.fullscreen)),r&&(0,n.createElement)(o.MenuGroup,{label:i.position},(0,n.createElement)(o.MenuItemsChoice,{value:c,choices:[{value:"left",label:i.bottomLeft},{value:"center",label:i.bottomCenter},{value:"right",label:i.bottomRight}],onSelect(e){H(),a.dock(e)}})),(0,n.createElement)(o.MenuGroup,{label:i.preferences},!1!==d&&(0,n.createElement)(o.MenuItem,{role:"menuitemcheckbox",isSelected:u,icon:u?s.check:void 0,info:i.rememberVisibilityHelp,onClick:L(a.rememberVisibility),"data-action":"remember-visibility"},i.rememberVisibility),(0,n.createElement)(o.MenuItem,{role:"menuitemcheckbox",isSelected:f,icon:f?s.check:void 0,info:i.rememberPositionHelp,onClick:L(a.rememberPosition),"data-action":"remember-position"},i.rememberPosition),(0,n.createElement)(o.MenuItem,{role:"menuitemcheckbox",isSelected:p,icon:p?s.check:void 0,info:i.followHelp,onClick:L(a.follow),"data-action":"follow"},i.follow)),r&&(0,n.createElement)(o.MenuGroup,null,(0,n.createElement)(o.MenuItem,{info:i.resetHelp,onClick:L(a.reset),"data-action":"reset"},i.reset)),l&&(0,n.createElement)(o.MenuGroup,null,(0,n.createElement)(o.MenuItem,{onClick:L(a.close),"data-action":"close"},i.closeLivePreview))))}(),!l&&(0,n.createElement)(o.Button,{className:"mtflpp-icon mtflpp-mode",size:"compact",icon:s[w],label:k,showTooltip:!0,onClick:a.mode,"data-action":"mode"}),!l&&(0,n.createElement)(o.Button,{className:"mtflpp-icon",size:"compact",icon:s.close,label:i.close,showTooltip:!0,onClick:a.close,"data-action":"close"}),(0,n.createPortal)(function(){const{device:e,orientation:t}=g;return(0,n.createElement)(o.Toolbar,{className:"mtflpp-devices",label:i.viewport,variant:"unstyled"},...["desktop","tablet","mobile"].map(r=>{const l=e===r,c=l&&"desktop"!==r,d=c&&"landscape"===t,u="portrait"===t?i.rotateLandscape:i.rotatePortrait;return(0,n.createElement)(o.ToolbarButton,{key:r,icon:s[r],className:d?"mtflpp-device-rotated":void 0,label:c?`${i[r]} — ${u}`:i[r],isPressed:l,"data-viewport":r,onClick:()=>a.device(r)})}))}(),u),(0,n.createPortal)(function(){const{fit:e,customZoom:t=100,dpr:r=1}=g,l={automatic:i.automatic,window:i.fitToWindow,width:i.fitToWidth},c={automatic:i.automaticHelp,window:i.fitToWindowHelp,width:i.fitToWidthHelp},d="custom"===e?i.fixedZoom:l[e]??i.automatic;return(0,n.createElement)(o.Dropdown,{open:y,onToggle(e){y=e,e&&(v=!1,b="custom"===g.fit),V()},contentClassName:"mtflpp-zoom-popover",focusOnMount:"firstElement",popoverProps:{placement:"top-end",offset:8,shift:!0,resize:!1,role:"dialog","aria-label":i.fitting},renderToggle:({isOpen:e,onToggle:t})=>(0,n.createElement)(o.Button,{className:"mtflpp-zoom-toggle",variant:"secondary",size:"compact",label:d,showTooltip:!0,"aria-label":`${i.fitting}: ${d}`,"aria-haspopup":"dialog","aria-expanded":e,onClick:t,"data-action":"zoom"},(0,n.createElement)("span",{className:"mtflpp-zoom-value"},d),s.chevron),renderContent:()=>(0,n.createElement)("div",{className:"mtflpp-zoom-content"},(0,n.createElement)(o.RadioControl,{label:i.zoomMode,selected:e,options:[...Object.entries(l).map(([e,t])=>({value:e,label:t,description:c[e]})),{value:"custom",label:i.fixedZoom,description:i.fixedZoomHelp}],onFocus(e){if(!b)return;b=!1;const t=e.currentTarget.closest(".mtflpp-zoom-content")?.querySelector('.mtflpp-custom-zoom input[type="number"]');t?.focus({preventScroll:!0});const n=t?.closest(".components-popover__content");if(n){const e=t.getBoundingClientRect(),o=n.getBoundingClientRect();n.scrollTop+=Math.min(0,e.top-o.top)+Math.max(0,e.bottom-o.bottom)}},onChange(e){b=!1,"custom"!==e?a.fit(e):a.zoom(t)}}),"custom"===e&&(0,n.createElement)("div",{className:"mtflpp-custom-zoom",onKeyDown(e){if("Enter"!==e.key)return;e.preventDefault();const t=Number(e.target.value);!1!==e.target.validity?.valid&&Number.isInteger(t)&&t>=10&&t<=400&&H()}},(0,n.createElement)(o.RangeControl,{label:i.customZoom,min:10,max:400,step:1,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:t,help:i.customZoomHelp,withInputField:!0,onChange(e){Number.isInteger(e)&&e>=10&&e<=400&&a.zoom(e)}})),(0,n.createElement)("div",{className:"mtflpp-dpr-note",role:"group","aria-label":i.displayInformation},(0,n.createElement)("span",{className:"mtflpp-dpr-value"},`${i.displayDpr}: ${Number(r.toFixed(2))}`),(0,n.createElement)("span",{className:"mtflpp-pixel-note"},i.pixelZoomHelp)))})}(),f),(0,n.createPortal)(function(){const{empty:e}=g;return e?(0,n.createElement)(o.Placeholder,{className:"mtflpp-placeholder","data-empty-icon":e.busy?void 0:e.icon,icon:e.busy?(0,n.createElement)(o.Spinner):s[e.icon],label:(0,n.createElement)("h3",{className:"mtflpp-empty-title",tabIndex:-1,"data-action":"empty-title"},e.heading),instructions:e.description},e.retry&&(0,n.createElement)(o.Button,{key:"retry",variant:"primary",disabled:e.disabled,onClick:a.retry,"data-action":"retry"},e.action),e.close&&(0,n.createElement)(o.Button,{key:"close",variant:"secondary",onClick:a.close,"data-action":"close"},i.close),e.note&&(0,n.createElement)("p",{className:"mtflpp-empty-note"},e.note)):null}(),m),(0,n.createPortal)(function(){if(!g.notice)return null;if(x){const e=(0,n.createElement)(r.InlineNotices,{context:C,className:"mtflpp-inline-notices"});return M?(0,n.createElement)(M,{cornerRadius:"none"},e):e}const{message:e,...t}=P();return(0,n.createElement)(o.Notice,{...t,onRemove:a.dismissNotice,spokenMessage:"",politeness:"polite"},e)}(),h),e?(0,n.createPortal)((0,n.createElement)(o.Popover.Slot),t.ownerDocument.body):(0,n.createElement)(o.Popover.Slot))}function V(){g&&w&&(function(){if(!x)return;if(!g.notice)return void S();const e=JSON.stringify(g.notice);if(E===e)return;const{message:t,status:n,...o}=P();x.createNotice(n,t,{...o,id:k,context:C,speak:!1,onDismiss:a.dismissNotice}),E=e}(),(0,n.flushSync)(()=>w.render((0,n.createElement)(T))))}function H(){(v||y)&&(v=!1,y=!1,V())}function j(e){g?.inPip&&"mode"===e&&(e="actions"),t.querySelector(`[data-action="${e}"]`)?.focus({preventScroll:!0})}return{update(e){const n=y&&!e.hasPreview&&t.ownerDocument.activeElement?.closest(".mtflpp-zoom-popover");e.hasPreview||(y=!1),g=e,V(),n&&j("empty-title")},closeMenu:H,focus:j,beforeMove(){v=!1,y=!1,w?.unmount(),w=null,S()},remount(){w=(0,n.createRoot)(l),V()}}}(H,i,{refresh:()=>{ce.canRefresh&&h()},retry:()=>{"handover"!==ce.state&&(ae||ce.canRetry&&["error","conflict"].includes(ce.state))&&g(ae)},dismissNotice:()=>{ve(),Z.textContent=ce.text,I.focus("actions")},mode:Se,close:function(){I.closeMenu(),be(!1),m(),d||P()?j.focus():u.focus()},popOut:async function(){if(U||x.fullscreenElement===H||!Ee())return;let e;I.closeMenu();const t=()=>{U===e&&(w(),G.beforeMove(),I.beforeMove(),x.body.append(H),H.classList.remove("mtflpp-pip"),U=null,I.remount(),Ce(),G.afterMove(),Pe(),v(),K&&I.focus("mode"))};try{if(e=await b.documentPictureInPicture.requestWindow({width:640,height:440}),!K)return void e.close();const n=b.getComputedStyle(H);e.document.documentElement.lang=x.documentElement.lang,e.document.documentElement.dir=n.direction;for(const t of["--wp-admin-theme-color","--wp-admin-theme-color-darker-10","--wp-admin-border-width-focus"]){const o=n.getPropertyValue(t);o&&e.document.documentElement.style.setProperty(t,o)}const o=x.querySelectorAll(['link[rel="stylesheet"][href*="/load-styles.php"]',"#wp-theme-css","#wp-theme-inline-css","#wp-components-css","#wp-components-inline-css","style[data-emotion]","style[data-wp-hash]","#meet-the-frontend-live-preview-panel-css","#meet-the-frontend-live-preview-panel-inline-css"].join(", "));for(const t of o){const n=t.cloneNode(!0);"STYLE"===t.tagName&&t.sheet&&(n.textContent=Array.from(t.sheet.cssRules,e=>e.cssText).join("\n")),n.addEventListener("load",G.layout,{once:!0}),e.document.head.append(n)}e.document.title=_.textContent,e.document.body.className="mtflpp-pip-document",e.addEventListener("resize",G.layout),e.addEventListener("pagehide",t,{once:!0}),U=e,w(),G.beforeMove(),I.beforeMove(),H.classList.add("mtflpp-pip"),e.document.body.append(H),I.remount(),G.afterMove(),Pe(),ve(),I.focus("mode"),v()}catch{e&&(t(),e.close()),I.focus("actions"),we(i.pipFailed)}},fullscreen:async function(){if(!U&&x.fullscreenEnabled){I.closeMenu();try{await H.requestFullscreen(),ve(),I.focus("mode")}catch{I.focus("actions"),we(i.fullscreenFailed)}}},dock:e=>ke(e),reset:()=>ke("right",!0),follow:function(){T=!T,k.set(M,"scrollToChanges",T),Pe(),T&&ce.canRefresh&&h(!1)},rememberVisibility:function(){S=!S,k.set(M,"rememberVisibility",S),S&&be(K),Pe()},rememberPosition:function(){L=!L,k.set(M,"rememberPosition",L),L?xe():(k.set(M,"position",te),k.set(M,"layout",void 0)),Pe()},device(e){const t=G.device;if(e===t&&"desktop"===e)return;let n=!1;if(K&&T&&y){const{fit:e,customZoom:t,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:a}=G;n=!!y({canvas:A,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:a,canFollow:()=>G.fit===e&&G.customZoom===t})}const o={animate:K&&!n,keepPan:n};e===t?(G.rotate(o),k.set(M,`${e}Orientation`,G.orientation)):(G.select(e,o),G.device!==t&&k.set(M,"viewport",G.device)),Pe()},fit(e){const t=G.fit;G.setFit(e),G.fit!==t&&k.set(M,"fitMode",G.fit),Pe()},zoom(e){const t=G.fit,n=G.customZoom;G.setZoom(e),G.customZoom!==n&&k.set(M,"customZoom",G.customZoom),G.fit!==t&&k.set(M,"fitMode",G.fit),Pe()}}),ye(i.loading,"loading",{canRetry:!1}),Ce(),Te(),d&&(d.disabled=!1),{stage:F,canvasTarget:G.canvasTarget,get visible(){return K},get followChanges(){return T},openFromLauncher:Ve,setVisible(e){e||(I.closeMenu(),se="",Pe(),G.layout()),K=e,Ce(),Te()},report:ye,setTitle:ue,clearPreview(){F.replaceChildren();const e=["ready","stale","loading"].includes(ce.state);ye(e?i.loading:ce.text,e?"loading":ce.state,{...ce,hasPreview:!1,hasHtmlPreview:!1,redirectDestination:void 0,canRefresh:!1,canRetry:!e&&ce.canRetry})},returnToEditor(){I.closeMenu(),U?.close(),x.fullscreenElement===H&&x.exitFullscreen().catch(()=>{})}}}function d(e=[]){const t=Array.isArray(e)?[...e]:[],n=new WeakMap;return{capture(e,o){try{if(n.has(e))return;const r=function(e){try{const t=e.querySelector('meta[name="meet-the-frontend-live-preview-panel"]'),n=t?.getAttribute("data-mtflpp-source");if(!n)return null;const o=JSON.parse(n);if("string"!=typeof o)return null;const r=(new DOMParser).parseFromString(o,"text/html");return r.querySelector('meta[name="meet-the-frontend-live-preview-panel"]')?.content===t.content?r:null}catch{return null}}(e);n.set(e,{source:r?m(r,e,t):null,dom:m(e,e,t),values:o&&Object.fromEntries(Object.entries(o).map(([e,t])=>[e,{...t}]))})}catch{}},findChange(e,t){try{const o=n.get(e),r=n.get(t);if(!o||!r)return null;const i=function(e,t){if(!e||!t)return[];const n=[];for(const o of new Set([...Object.keys(e),...Object.keys(t)])){const r=Object.hasOwn(e,o)?e[o]:{type:t[o]?.type,value:""},i=Object.hasOwn(t,o)?t[o]:{type:e[o]?.type,value:""};if(r.type!==i.type||!["text","html"].includes(i.type)||"string"!=typeof r.value||"string"!=typeof i.value||r.value===i.value)continue;let a,s;try{a="html"===r.type?(new DOMParser).parseFromString(r.value,"text/html"):null,s="html"===i.type?(new DOMParser).parseFromString(i.value,"text/html"):null}catch{continue}const l=a?m(a,a,[],a.body):null,c=s?m(s,s,[],s.body):null,d=a?E(l):r.value,u=s?E(c):i.value,f=v(d),p=v(u);if(f!==p&&n.push({...P(f,p),type:"text"}),!a){const e=k(d,u);e&&n.push(e);continue}if(l&&c&&(f===p||y(d,u)))for(const e of w(l,c)){if(e.spacing){const t=C(e);t&&n.push(t);continue}if(f===p)if("attributes"===e.kind){const t=new Map(e.before.attributes),o=new Map(e.after.attributes);for(const e of new Set([...t.keys(),...o.keys()])){const r=t.get(e)??"",i=o.get(e)??"";JSON.stringify(r)!==JSON.stringify(i)&&n.push({type:"attribute",name:e,before:"string"==typeof r?r:JSON.stringify(r),after:"string"==typeof i?i:JSON.stringify(i)})}}else"content"===e.kind&&(v(E(e.before))===v(E(e.after))&&n.push({type:"markup",before:v(E(e.before)),after:v(E(e.after)),oldTag:e.before.tag,newTag:e.after.tag}),(e.before.media||[]).forEach((t,o)=>{const r=e.after.media?.[o];t&&r&&t!==r&&n.push({type:"media",before:t,after:r})}))}}return n}(o.values,r.values),a=function(e,t){if(!e||!t)return!1;const n=(e,t)=>Object.entries(e).some(([e,n])=>"order"!==n?.type&&(!Object.hasOwn(t,e)||n?.type!==t[e]?.type||n?.value!==t[e]?.value));return n(e,t)||n(t,e)}(o.values,r.values),s=!!o.source&&!!r.source,l=!!o.source!=!!r.source,c=[...s?w(o.source,r.source).map(e=>({...e,source:!0})):[],...w(o.dom,r.dom)],d=new Map,h=function(e,t){const n=new Map,o=e=>E(e,n),r=[];for(const n of e){if(n.unresolved)for(const e of u(n,t,o))r.push(e);if("insert"===n.kind&&n.added.length>1){const e=n.added.map(e=>{const r={...n,after:e,added:[e]},i=V(r,t,o);return{...r,input:i}}).filter(e=>e.input);if(e.length){r.push(...e);continue}}const e=V(n,t,o);r.push({...n,input:e})}return r}(c,i).filter(e=>(e.source||!s&&!l||e.input||a&&2===e.priority)&&(e.priority>0||e.input)&&(!e.spacing||function({before:e,after:t},n,o){const r=b(e,n,o),i=b(t,n,o);return r&&i&&r.omitted===i.omitted&&y(r.text,i.text)}(e,d,r.dom?.excluded)));return function(e,t){if(!e.length)return null;const n=e.reduce((e,t)=>Math.max(e,t.input),0),o=e.filter(e=>e.input===n),r=o.reduce((e,t)=>Math.max(e,t.priority),0),i=o.filter(e=>e.priority===r);if(i.some(e=>e.unresolved))return function(e,t){const n=e.find(e=>e.unresolved&&("replacement"===e.regionChange||"reorder"===e.regionChange&&(e.source||t))),o=n?.after.node;if(!o?.isConnected)return null;for(const t of e)if(t.unresolved){if(n.source&&!t.source&&"reorder"===t.regionChange)continue;if(!t.regionChange||t.after.node!==o)return null}else if(!("insert"===t.kind?t.added:[t.after]).every(e=>o.contains(e.node)))return null;return"contents"!==o.ownerDocument.defaultView.getComputedStyle(o).display?o:null}(i,t);const a=i.filter(e=>!e.input||e.directInput||!i.some(t=>t!==e&&e.matches?.length&&e.matches.every(e=>t.matches?.includes(e))&&H(e.after,t.after))),s=new Map,l=a.filter(e=>{const t="delete"===e.kind&&(e.following[0]||e.preceding[0])||e.after,n=t?.node;if(!n)return!0;const o="delete"!==e.kind||e.following.length?e.kind:"delete-last",r=s.get(n)||new Set;return!r.has(o)&&(r.add(o),s.set(n,r),!0)});return n&&s.size>1?null:function(e){const t=new Set,n=new Set;for(const o of e){let e,r=!1;"delete"===o.kind?(r=!o.removed.some(p),e=r?o.after:o.following.find(p)||o.preceding.find(p)||o.following.find(f)||o.preceding.find(f)||o.after):e="insert"===o.kind?o.added.find(p)||o.added.find(f):o.after;const i=f(e);if(!i)continue;const a=p(e),s=a||i;(a&&!r?t:n).add(s)}const o=t.size?t:n;return 1===o.size?o.values().next().value:null}(l)}(h,!s&&(a||function(e,t){return!!e&&!!t&&Object.entries(t).some(([t,n])=>{if("order"!==n?.type||!Object.hasOwn(e,t))return!1;const o=e[t];return"order"===o?.type&&o.members===n.members&&o.value!==n.value})}(o.values,r.values)))}catch{return null}}}}function u(e,t,n){const o=[];for(const r of t){if(!r.after||"spacing"===r.type)continue;const t=T(e.oldRange,r.before,n,r,!0),i=T(e.newRange,r.after,n,r,!1);if(!t.length)continue;const a="markup"===r.type&&r.oldTag===r.newTag;if(a||!r.before||!(t.length<=T(e.newRange,r.before,n,r,!0).length||i.length<=T(e.oldRange,r.after,n,r,!1).length))for(const n of i)a&&!t.some(e=>e.signature!==n.signature)||o.push({...e,unresolved:!1,before:null,after:n,kind:"content",input:r.before&&r.after?2:1,priority:2,matches:[r]})}return o}function f(e){if(e?.node)return e.node;for(const t of e?.children||[]){const e=f(t);if(e)return e}return null}function p(e){const t=e?.node;if(t?.getClientRects().length&&"visible"===t.ownerDocument.defaultView.getComputedStyle(t).visibility)return t;for(const t of e?.children||[]){const e=p(t);if(e)return e}return null}function m(e,t,n,o=e.querySelector('main, [role="main"]')||e.querySelector("article")||e.body){if(!o)return null;const r=n.filter(e=>{if("string"!=typeof e||!e.trim())return!1;try{return o.matches(e),!0}catch{return!1}}).join(", "),i=new Map,a=new Map;if(e!==t)for(const e of t.querySelectorAll("[data-mtflpp-node]")){const t=e.getAttribute("data-mtflpp-node");a.set(t,a.has(t)?null:e)}for(const n of[o,...o.querySelectorAll("*")]){if(r&&n.closest(r))continue;const o=[...n.childNodes].filter(e=>3===e.nodeType).map(e=>e.textContent),s=v(o.join(" ")),l=["img","source","video","audio","iframe"].includes(n.localName)?["src","srcset","poster"].map(e=>n.getAttribute(`data-${e}`)||n.getAttribute(e)||""):[],c=n.style?.backgroundImage||n.getAttribute("data-bg")||"",d=e===t?n:a.get(n.getAttribute("data-mtflpp-node"))||null,u=h(n,d,JSON.stringify([n.localName,s,l,c]));u.text=s,u.rawText=o.join(""),u.media=[...l,c],u.parent=i.get(n.parentElement),i.set(n,u),u.parent?.children.push(u)}for(const[e,t]of i)t.parts=[...e.childNodes].map(e=>3===e.nodeType?e.textContent:i.get(e)).filter(e=>void 0!==e);let s=i.get(o);if(!s)return null;const l=s.node;for(let e=o.parentElement;e;e=e.parentElement){const t=h(e,l,e.localName);t.children=[s],t.parts=[s],s=t}return s.excluded=r,s}function h(e,t,n){const o=function(e){const t=[];for(const{name:n,value:o}of e.attributes){if("data-mtflpp-node"===n||n.startsWith("on")||/(?:^|-)(nonce|token)(?:-|$)/.test(n))continue;if(/^(?:data-)?(?:src|srcset|poster|sizes|bg)$/.test(n))continue;let r=o;"class"===n&&(r=[...e.classList].sort().join(" ")),"style"===n&&(r=[...e.style].sort().map(t=>[t,e.style.getPropertyValue(t),e.style.getPropertyPriority(t)])),("class"!==n&&"style"!==n||r.length)&&t.push([n,r])}return t.sort(([e],[t])=>e.localeCompare(t))}(e);return{node:t,tag:e.localName,signature:n,attributes:o,children:[],parts:[],presentation:JSON.stringify(o.filter(([e])=>!g(e))),references:JSON.stringify(o.filter(([e])=>g(e)))}}function g(e){return["id","for","headers","aria-controls","aria-labelledby","aria-describedby","aria-owns","aria-flowto","aria-activedescendant","aria-details","aria-errormessage"].includes(e)}function w(e,t){const n=new Map,o=new Map,r=new Map,i=new Map,a=[];function s(e){const t=JSON.stringify(e);return n.has(t)||n.set(t,n.size+1),n.get(t)}function l(e){if(!e)return 0;const t=s([e.signature,e.children.map(l)]);return o.set(e,t),r.set(e,s([t,e.presentation,e.children.map(e=>r.get(e))])),i.set(e,s([t,e.presentation,e.references,e.children.map(e=>i.get(e))])),t}l(e),l(t);const c=e=>o.get(e);function d(e){const t=e.attributes.find(([e])=>"id"===e)?.[1];return t?`${e.tag} ${t}`:void 0}function u(e){if(!(e.children.length<2))return s(["collection",e.signature,e.children.map(c).sort((e,t)=>e-t)])}function f(e,t){const n=new Map;return e.forEach((e,o)=>{const r=t(e);void 0!==r&&n.set(r,n.has(r)?-1:o)}),n}return function e(t,n){t&&n&&(t.signature!==n.signature?a.push({kind:"content",before:t,after:n,priority:2}):t.rawText!==n.rawText&&a.push({kind:"content",before:t,after:n,priority:2,spacing:!0}),t.presentation===n.presentation&&t.references===n.references||a.push({kind:"attributes",before:t,after:n,priority:t.presentation!==n.presentation?1:0}),function(t,n,s,l){const p=l.parent&&s.parent&&l.tag===s.tag,m=f(t,c),h=f(n,c);let g,w,v,y;const b=new Set(t.flatMap(e=>[r.get(e),i.get(e)])),x=new Set(n.flatMap(e=>[r.get(e),i.get(e)]));function M(e,t,n){const o=n.get(e),r=n.get(t);return o===r||!x.has(o)&&!b.has(r)}function C(e,t){return o.get(e)===o.get(t)&&M(e,t,r)&&M(e,t,i)}function k(e,r,i,s,c){const d=t.slice(e,r),u=n.slice(i,s),f="replacement"===c&&p&&d.some(e=>!h.has(o.get(e)))&&u.some(e=>!m.has(o.get(e)))&&(!function(e,t){if(e.length<2||t.length<2)return!1;const n=e.filter(e=>e.children.length).length,o=t.filter(e=>e.children.length).length;if(!n&&!o||n>1&&o>1)return!0;const r=new Map;for(const{tag:e}of t)r.set(e,(r.get(e)||0)+1);let i=0;for(const{tag:t}of e){const e=r.get(t);if(e){if(2===++i)return!0;r.set(t,e-1)}}return!1}(d,u)||"form"===l.tag&&function(e,t){function n(e){const t=new Set;return e.every(function e(n){if(["input","select","textarea"].includes(n.tag)){const e=n.attributes.find(([e])=>"name"===e)?.[1],o=n.attributes.find(([e])=>"type"===e)?.[1]?.toLowerCase();return!(!e||"input"===n.tag&&"hidden"===o||(t.add(e),0))}let o=!1;for(const t of n.children)e(t)&&(o=!0);return o})?t:null}const o=n(e),r=n(t);return o&&r&&[...o].some(e=>!r.has(e))&&[...r].some(e=>!o.has(e))}(d,u)),g=p&&("reorder"===c||f)?c:void 0;a.push({kind:"region",after:l,priority:2,unresolved:!0,regionChange:g,oldRange:d,newRange:u})}function E(e,n,o,r,i,a,s){const l=[];for(let c=e;c<n;c++){const e=s(t[c]),n=a.get(e);if(!(i.get(e)!==c||void 0===n||n<o||n>=r)){if(l.length&&n<=l[l.length-1][1])return null;l.push([c,n])}}return l}!function r(i,s,b,x){for(;i<s&&b<x&&C(t[i],n[b]);)e(t[i],n[b]),i++,b++;for(;i<s&&b<x&&C(t[s-1],n[x-1]);)s--,x--,e(t[s],n[x]);if(i===s&&b===x)return;if(i===s||b===x){const e=b===x,r=e?t.slice(i,s):n.slice(b,x),c=e?[n[b-1],n[b]]:[t[i-1],t[i]];return void(r.some(e=>c.some(t=>t&&o.get(t)===o.get(e)))?k(i,s,b,x):e?a.push({kind:"delete",after:l,removed:r,priority:2,following:n.slice(b),preceding:n.slice(0,b).reverse()}):a.push({kind:"insert",after:r[0],added:r,priority:2}))}if(s-i===1&&x-b===1)return void e(t[i],n[b]);if(p&&function(e,r,i,a){const s=r-e;if(s<2||s!==a-i)return!1;const l=new Map;let c=!1;for(let r=0;r<s;r++){const a=o.get(t[e+r]),s=o.get(n[i+r]);c||=a!==s,l.set(a,(l.get(a)||0)+1),l.set(s,(l.get(s)||0)-1)}return c&&[...l.values()].every(e=>0===e)}(i,s,b,x))return void k(i,s,b,x,"reorder");let M=E(i,s,b,x,m,h,c);if(0===M?.length&&(g??=f(t,d),w??=f(n,d),M=E(i,s,b,x,g,w,d)),0===M?.length&&(v??=f(t,u),y??=f(n,u),M=E(i,s,b,x,v,y,u)),M?.length)for(const[o,a]of[...M,[s,x]])r(i,o,b,a),o<s&&e(t[o],n[a]),i=o+1,b=a+1;else k(i,s,b,x,M?"replacement":void 0)}(0,t.length,0,n.length)}(t.children,n.children,t,n))}(e,t),a}function v(e){return e.replace(/\s+/g," ").trim()}function y(e,t){return e!==t&&e.replace(/\s/g,"")===t.replace(/\s/g,"")}function b(e,t,n){for(;e.node?.isConnected&&e.parent?.node;){const{display:t}=e.node.ownerDocument.defaultView.getComputedStyle(e.node);if("inline"!==t&&"contents"!==t)break;e=e.parent}if(!t.has(e)){const{node:o}=e,r=[],i=o?.isConnected&&x(o,n,r)===M(e)&&p(e)?o.innerText:void 0;t.set(e,"string"==typeof i?{text:i,omitted:JSON.stringify(r)}:void 0)}return t.get(e)}function x(e,t,n){return t&&e.querySelector(t)?[...e.childNodes].map(e=>3===e.nodeType?e.textContent:1!==e.nodeType?"":e.matches(t)?(n.push(e.textContent),""):x(e,t,n)).join(""):e.textContent}function M(e){return e.parts.map(e=>"string"==typeof e?e:M(e)).join("")}function C({before:e,after:t}){return k(e.rawText,t.rawText)||k(M(e),M(t))}function k(e,t){if(!/\S/.test(e)||!y(e,t))return;const n=e.match(/\s+|\S+/g),o=t.match(/\s+|\S+/g);let r=0,i=0;for(;r<Math.min(n.length,o.length)&&n[r]===o[r];)r++;for(;i<Math.min(n.length,o.length)-r&&n.at(-1-i)===o.at(-1-i);)i++;const a=Math.max(0,r-1),s=Math.max(0,i-1);return{type:"spacing",before:n.slice(a,n.length-s).join(""),after:o.slice(a,o.length-s).join("")}}function E(e,t=new Map){return e?(t.has(e)||t.set(e,(e.parts||[]).map(e=>{if("string"==typeof e)return e;const n=E(e,t);return/^(?:p|div|section|article|main|aside|header|footer|nav|h[1-6]|li|[ou]l|d[ldt]|blockquote|pre|table|tr|t[dh]|caption|figure|figcaption|br|hr)$/.test(e.tag)?` ${n} `:n}).join("")),t.get(e)):""}function P(e,t){let n=0,o=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;for(;o<e.length-n&&o<t.length-n&&e[e.length-o-1]===t[t.length-o-1];)o++;let r=e.length-o,i=t.length-o;for(;n>0&&/\S/.test(e[n-1]);)n--;if(r>n&&/\S/.test(e[r-1]))for(;r<e.length&&/\S/.test(e[r]);)r++;if(i>n&&/\S/.test(t[i-1]))for(;i<t.length&&/\S/.test(t[i]);)i++;return{before:e.slice(n,r).trim(),after:t.slice(n,i).trim()}}function S(e,t){return t?L(e,t):""===v(e)}function L(e,t){if(!t)return!1;let n=(e=v(e)).indexOf(t);for(;-1!==n;){const o=n+t.length;if(!(n&&/[\p{L}\p{N}_]/u.test(e[n-1])&&/[\p{L}\p{N}_]/u.test(t[0])||o!==e.length&&/[\p{L}\p{N}_]/u.test(e[o])&&/[\p{L}\p{N}_]/u.test(t.at(-1))))return!0;n=e.indexOf(t,n+1)}return!1}function T(e=[],t,n,o,r){return e.flatMap(e=>{const i=T(e.children,t,n,o,r);let a;return a="media"===o.type?e.media?.includes(t):"attribute"===o.type?e.attributes.some(([e,n])=>e===o.name&&L("string"==typeof n?n:JSON.stringify(n),t)):("markup"!==o.type||e.tag===(r?o.oldTag:o.newTag))&&S(n(e),t),"text"===o.type&&i.length?i:[...a?[e]:[],...i]})}function V(e,t,n){if(e.unresolved)return 0;if(e.matches=[],e.spacing){const n=t.filter(e=>"spacing"===e.type),o=n.length&&C(e);return e.matches=n.filter(e=>o?.before===e.before&&o?.after===e.after),e.matches.length?2:0}let o=0;for(const r of t){if("spacing"===r.type)continue;let t=0;if("attributes"===e.kind){if(!["text","attribute"].includes(r.type))continue;const n=r,o=new Map(e.before.attributes),i=new Map(e.after.attributes);for(const e of new Set([...o.keys(),...i.keys()])){if("attribute"===r.type&&e!==r.name)continue;const a=o.get(e),s=i.get(e);if(JSON.stringify(a)===JSON.stringify(s))continue;const l="string"==typeof a?a:JSON.stringify(a)||"",c="string"==typeof s?s:JSON.stringify(s)||"";S(l,n.before)&&S(c,n.after)&&(t="attribute"===r.type||r.before&&r.after?2:1)}}else"insert"===e.kind?!r.before&&e.added.some(e=>L(n(e),r.after))&&(t=Math.max(t,1)):"delete"===e.kind?!r.after&&e.removed.some(e=>L(n(e),r.before))&&(t=Math.max(t,1)):"media"===r.type?(e.before?.media||[]).some((t,n)=>t===r.before&&e.after?.media?.[n]===r.after)&&(t=2):"attribute"!==r.type&&("markup"!==r.type||e.before?.tag===r.oldTag&&e.after?.tag===r.newTag)&&S(n(e.before),r.before)&&S(n(e.after),r.after)&&(t=r.before&&r.after?2:1,"text"===r.type&&L(e.before?.text||"",r.before)&&L(e.after?.text||"",r.after)&&(e.directInput=!0));t&&e.matches.push(r),o=Math.max(o,t)}return o}function H(e,t){return!!e?.children.some(e=>e===t||e.node&&e.node===t?.node||H(e,t))}const j=new Set(["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","PageDown","PageUp","Home","End"," "]);function O(e,t){let n;for(const o of e?.rects??[]){const e=t(o);if(e.visible)return e;(!n||e.distance<n.distance)&&(n=e)}return n}function R(e){return new Promise(t=>{const n=()=>{e.clearTimeout(o),e.cancelAnimationFrame(r),t()},o=e.setTimeout(n,100);let r=e.requestAnimationFrame(()=>{r=e.requestAnimationFrame(n)})})}function N(e,t=!1){if(!W(e,{visibilityProperty:!0,opacityProperty:!0}))return;const{left:n,right:o,top:r,bottom:i,width:a,height:s}=e.getBoundingClientRect();if(!(t||a&&s))return;const l=e.ownerDocument,{documentElement:c,body:d,defaultView:u}=l,f={left:n,right:a?o:n+1,top:r,bottom:s?i:r+1},p={...f},m={x:f.right-f.left,y:f.bottom-f.top},h="visible"===u.getComputedStyle(c).overflow,g=u.getComputedStyle(e);for(let n=e;n&&n!==c;){const o=n===e?g:u.getComputedStyle(n),{position:r,display:i,overflowX:a,overflowY:s}=o;if(n!==e&&(n!==d||!h)&&"inline"!==i&&("visible"!==a||"visible"!==s)&&n.offsetWidth&&n.offsetHeight){const{bounds:e,scaleX:r,scaleY:i}=B(n,o);for(const[l,c,d,u,h]of[["x",a,"left","right",r],["y",s,"top","bottom",i]]){if("visible"===c)continue;const r="clip"===c?[0,0]:F(n,o,l,h),i=t&&"hidden"===c,a="y"===l==("horizontal-tb"===o.writingMode);if(i&&r.some(e=>e)&&(a||f[d]<e[d]||f[u]>e[u]||$(o,g,l)))return{boundary:n};if(!A(f,p,e,d,u,i?[0,0]:r))return{boundary:n};m[l]=Math.min(m[l],p[u]-p[d])}}n="absolute"===r||"fixed"===r?n.offsetParent:n.parentElement}return{clipped:f,extent:m}}function $(e,t,n){const o=e=>e&&"auto"!==e&&0!==parseFloat(e);return("x"===n?["Left","Right"]:["Top","Bottom"]).some(n=>o(e[`scrollPadding${n}`])||o(t[`scrollMargin${n}`]))}function _(e,t,n=!1){const o=N(e,n);if(!o?.clipped)return;const{clipped:r,extent:i}=o,{ownerDocument:a}=e,s=a.documentElement;if(r.left=Math.max(s.clientLeft,r.left),r.right=Math.min(s.clientLeft+s.clientWidth,r.right),r.top=Math.max(0,r.top),r.bottom=Math.min(s.clientHeight,r.bottom),r.right<=r.left)return{rects:[]};const l=t?.({...r,top:0,bottom:s.clientHeight}),c=l?.visibleCenterX??(r.left+r.right)/2,d=X(e,c);if(r.bottom<=r.top)return{rects:[],header:d?.bottom};const u={rects:[r],inViewport:!0,extent:i};if(!d)return u;const f={left:Math.max(r.left,d.left),right:Math.min(r.right,d.right),top:Math.max(r.top,d.top),bottom:Math.min(r.bottom,d.bottom)};if(!D(f)||!d.node.contains(a.elementFromPoint(c,(f.top+f.bottom)/2)))return u;const p=[{...r,top:f.bottom},{...r,bottom:f.top},{...f,left:r.left,right:f.left},{...f,left:f.right,right:r.right}].filter(D);return!p.length&&d.bottom>=s.clientHeight&&d.top<=0?void 0:{rects:p,inViewport:!0,extent:i,header:d.bottom}}function D({left:e,right:t,top:n,bottom:o}){return t>e&&o>n}function A(e,t,n,o,r,[i,a]){return e[o]=Math.max(e[o],n[o]),e[r]=Math.min(e[r],n[r]),t[o]=Math.max(n[o],t[o]+i),t[r]=Math.min(n[r],t[r]+a),t[r]>t[o]}function F(e,t,n,o){const r="x"===n,i=r?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight;if(i<=0)return[0,0];const a=r?e.scrollLeft:e.scrollTop,s=t.display.endsWith("flex")&&t.flexDirection===(r?"row-reverse":"column-reverse"),l=(r&&"rtl"===t.direction)!==s;let c=l?-i:0,d=l?0:i;return("horizontal-tb"!==t.writingMode||a<c||a>d)&&(c=-i,d=i),[(a-d)*o,(a-c)*o]}function B(e,t){const n=e.getBoundingClientRect(),o=n.width/e.offsetWidth,r=n.height/e.offsetHeight,i=n.left+e.clientLeft*o,a=n.top+e.clientTop*r,s={left:i,top:a,right:i+e.clientWidth*o,bottom:a+e.clientHeight*r},l=t.overflowClipMargin;if("clip"!==t.overflowX&&"clip"!==t.overflowY||!l||"0px"===l)return{bounds:s,scaleX:o,scaleY:r};const c=l.split(" ").map(parseFloat).find(Number.isFinite)??0,d=l.includes("border-box")?n:s,u=l.includes("content-box");return{scaleX:o,scaleY:r,bounds:{left:d.left+((u?parseFloat(t.paddingLeft):0)-c)*o,right:d.right-((u?parseFloat(t.paddingRight):0)-c)*o,top:d.top+((u?parseFloat(t.paddingTop):0)-c)*r,bottom:d.bottom-((u?parseFloat(t.paddingBottom):0)-c)*r}}}function W(e,t={visibilityProperty:!0}){return!!e?.isConnected&&!!e.getClientRects().length&&(!e.checkVisibility||e.checkVisibility(t))&&"visible"===e.ownerDocument.defaultView.getComputedStyle(e).visibility}function q(e){return e.matchMedia("(prefers-reduced-motion: reduce)").matches?"instant":"smooth"}function z(e,{behavior:t,header:n=G(e),nearest:o=!1}={}){const r=e.ownerDocument,i=r.defaultView,a=t??q(i);if(o&&!n)return void e.scrollIntoView({behavior:a,block:"nearest",inline:"nearest"});const s=i.getComputedStyle(e).scrollMarginTop,l=r.documentElement,c=l.clientHeight,d=i.getComputedStyle(l),u=I(d.scrollPaddingTop,c),f=I(d.scrollPaddingBottom,c);let p,m;try{let t=o?"nearest":"start";if(o){const e=n-parseFloat(s);null!==u&&e>u&&(p=l.getAttribute("style"),l.style.setProperty("scroll-padding-top",`${e}px`,"important"))}else{const t=n>0&&null!==u?`max(${s}, ${n-u}px)`:s;m=e.getAttribute("style"),e.style.setProperty("scroll-margin-top",`calc(${t} + 1lh)`,"important")}if(!o&&null!==u&&null!==f){const n=i.getComputedStyle(e),o=c-u-f-parseFloat(n.scrollMarginTop)-parseFloat(n.scrollMarginBottom),r=o-e.getBoundingClientRect().height;if(r>=0&&(t="center"),r>0&&"horizontal-tb"===d.writingMode){const e=Math.min(o/3,r);p=l.getAttribute("style"),l.style.setProperty("scroll-padding-bottom",`${f+e}px`,"important")}}e.scrollIntoView({behavior:a,block:t,inline:"nearest"})}finally{void 0!==p&&Z(l,p),void 0!==m&&Z(e,m)}}function Z(e,t){e.setAttribute("style",t??""),null===t&&e.removeAttribute("style")}function I(e,t){if("auto"===e)return 0;const n=parseFloat(e);return Number.isFinite(n)?n*(e.endsWith("%")?t/100:1):null}function G(e){const t=e.getBoundingClientRect();return X(e,t.left+t.width/2)?.bottom??0}function X(e,t){const n=e.ownerDocument;for(let o=n.elementFromPoint(t,1);o&&!o.contains(e);o=o.parentElement){const e=n.defaultView.getComputedStyle(o);if("fixed"!==e.position&&"sticky"!==e.position)continue;if("0"===e.opacity||!W(o,{visibilityProperty:!0,opacityProperty:!0}))continue;const{left:t,right:r,top:i,bottom:a}=o.getBoundingClientRect();if("fixed"===e.position||i<=parseFloat(e.top)+1)return{node:o,left:t,right:r,top:i,bottom:a}}}function J(e,t,{inlineLauncher:n,nativeLauncher:o}={}){const r=e.strings,i=e.termId??e.postId,a=window,s=function(){let e,t=0,n=0;return{remember(e){try{e&&(t=e.defaultView.scrollY)}catch{}},async restore(e,o,r=()=>!0,i){const a=++n;try{const s=e.defaultView;let l;if(s.scrollTo({top:t,left:0,behavior:"instant"}),o?.ownerDocument===e&&r()){if(await R(s),a!==n||o.ownerDocument!==e||!r())return;if(function(e,t){const n=e.ownerDocument;for(let t=e;t;t=t.parentElement)if("until-found"!==t.getAttribute("hidden")?.toLowerCase()&&(t.hasAttribute("hidden")||"none"===n.defaultView.getComputedStyle(t).display))return!1;let o=!1;for(let r=e;r&&e.isConnected&&e.ownerDocument===n&&t();r=r.parentElement){if("until-found"===r.getAttribute("hidden")?.toLowerCase()){if(r.dispatchEvent(new n.defaultView.Event("beforematch",{bubbles:!0})),!(e.isConnected&&e.ownerDocument===n&&r.isConnected&&r.ownerDocument===n&&r.contains(e)&&t()))break;"until-found"===r.getAttribute("hidden")?.toLowerCase()&&r.removeAttribute("hidden"),o=!0}const i=r.parentElement;i instanceof n.defaultView.HTMLDetailsElement&&!i.open&&r!==Array.from(i.children).find(e=>"summary"===e.localName)&&(i.open=!0,o=!0)}return o}(o,()=>a===n&&r())&&await new Promise(e=>s.setTimeout(e,0)),a!==n||!r())return;const t=o.ownerDocument===e?function(e){if(!e?.isConnected)return null;const t=N(e,!0);if(t?.clipped)return e;if(!t?.boundary)for(const t of e.querySelectorAll("*"))if(N(t,!0)?.clipped)return t;for(let n=t?.boundary||e.parentElement;n;){const e=N(n,!0);if(e?.clipped)return n;n=e?.boundary||n.parentElement}return null}(o):null;t&&(function(e,t){const n=_(e,t,!0);if(!n?.inViewport)return void z(e);const{rects:o,extent:r,header:i=0}=n,a=e.ownerDocument.documentElement,s=Math.min(r.x,a.clientWidth),l=Math.min(r.y,a.clientHeight-i);o.some(e=>e.right-e.left>=s-1&&e.bottom-e.top>=l-1)?t&&O(n,t)?.reveal(q(e.ownerDocument.defaultView)):z(e,{nearest:!0,header:i})}(t,i),o.contains(t)&&(l=t))}return t=s.scrollY,l}catch{}},keepInView(t,{canvas:n,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:a,canFollow:s}){try{const l=e?.target===t&&e.canFollow();if(e?.cancel(),!t.isConnected||!s())return;if(!l){const e=_(t,o);if(!O(e,o)?.visible)return}const c=new AbortController,d={target:t,canFollow:()=>!c.signal.aborted&&s(),cancel(){c.abort(),e===d&&(e=null)}};return e=d,function(e,t,n,o,r){const i=e=>{e.isTrusted&&("keydown"!==e.type||j.has(e.key))&&r()},a={capture:!0,passive:!0,signal:o};for(const n of[e,t])for(const e of["wheel","touchmove","pointerdown","keydown"])n?.addEventListener(e,i,a);t?.addEventListener("scroll",()=>{n?.()&&r()},a)}(t.ownerDocument.defaultView,n,a,c.signal,()=>{d.cancel(),i?.()}),async function(e,t,n,o){try{const r=e.ownerDocument.defaultView;if(await R(r),!o())return;const{scrollX:i,scrollY:a}=r,s=n();if(s&&await s,!o()||r.scrollX!==i||r.scrollY!==a)return;let l=_(e,t);l&&!l.rects.length&&(z(e,{behavior:"instant",header:l.header}),l=_(e,t)),O(l,t)?.reveal()}catch{}}(t,o,r,d.canFollow).finally(d.cancel)}catch{}}}}(),l=c(r,{postTitle:t.title??e.postTitle,publicRedirect:e.publicRedirect,inlineLauncher:n,nativeLauncher:o,onOpen:()=>D(),onClose:()=>$(),onRefresh:A,onRetry:e=>e?D(!0):A(),beforeViewportChange:e=>h.beforeViewportChange(e),beforeMove:H,afterMove:()=>{p&&A()}});let u,f,p=!1,m=0;const h=function(e,t,n,o,r=[]){const i=d(r);let a,s,l,c,u;function f(){u?.()}return{get hasPreview(){return!!a},get hasHtmlPreview(){return!!s},get redirectDestination(){return c},load:function(r,d,p=()=>!1,m){const h=new URL(r);if("https:"!==h.protocol&&"http:"!==h.protocol)throw Object.assign(new Error(n.failed),{code:"mtflpp_preview_unsupported_url"});if(h.origin!==window.location.origin){const e=n.originMismatch.replace("%s",()=>h.origin+h.pathname);throw Object.assign(new Error(e),{code:"mtflpp_preview_origin_mismatch"})}const g=h.searchParams.get("mtflpp_token");if(!g)throw new Error(n.failed);return window.crossOriginIsolated&&h.searchParams.set("mtflpp_isolated","1"),f(),h.searchParams.delete("mtflpp_source"),e.followChanges&&h.searchParams.set("mtflpp_source","1"),o(n.updating),new Promise((r,f)=>{const w=e.stage.ownerDocument.createElement("iframe");w.title=n.title,w.className="mtflpp-frame mtflpp-loading",w.setAttribute("aria-hidden","true"),w.setAttribute("tabindex","-1"),w.referrerPolicy="same-origin";let v=!1,y=!1;const b=setTimeout(()=>M(new Error(n.failed)),3e4),x=()=>{y=!0,M()};function M(e){v||(v=!0,e&&(y=!0),clearTimeout(b),u===x&&(u=null),w!==a&&(w.onload=null,w.onerror=null,w.remove()),e?f(e):r())}u=x,w.onload=async()=>{const r=w!==a;if(r||(s=null,l=null),y||!d())return void M();let u,f,v;try{const e=w.contentDocument,t=e?.querySelector('meta[name="meet-the-frontend-live-preview-panel"]');t?.content===g?u=e:r&&!t&&(f=function(e,t){if("text/html"!==e?.contentType)return;const n=e.defaultView?.performance.getEntriesByType("navigation")[0];if(!(n?.redirectCount>0))return;const o=new URL(n.name);return o.origin!==t.origin||o.pathname===t.pathname&&o.search===t.search?void 0:o.pathname}(e,h))}catch{}u&&(e.followChanges&&i.capture(u,r?m:void 0),u.documentElement.style.setProperty("overscroll-behavior","contain","important")),u&&r&&(t.remember(s),e.followChanges&&p()&&s&&(v=i.findChange(s,u))),r&&a&&(a.onload=null,a.onerror=null,a.remove()),a=w,s=u,l=null,c=f,w.classList.remove("mtflpp-loading"),w.removeAttribute("aria-hidden"),w.removeAttribute("tabindex");const b=()=>!y&&d()&&w===a&&u===s&&(!u||w.contentDocument===u);let x;if(u&&r){const n=e.canvasTarget&&(t=>e.canvasTarget(w,t,{fitTarget:!0}));x=await t.restore(u,v,()=>b()&&e.followChanges&&p(),n)}b()?(l=x,o(n.current,"ready"),M()):M()},w.onerror=()=>{w===a?(s=null,l=null,c=void 0,d()&&o(n.failed,"error")):M(new Error(n.failed))},w.src=h.href,e.stage.append(w)})},cancel:f,beforeViewportChange({canvasTarget:n,canFollow:o,...r}){const i=l,c=s,d=a;if(i&&c)return t.keepInView(i,{...r,canvasTarget:e=>n(d,e),canFollow:()=>i===l&&c===s&&d.contentDocument===c&&e.visible&&e.followChanges&&o()})},clear(){f(),t.remember(s),a&&(a.onload=null,a.onerror=null),a=null,s=null,l=null,c=void 0,e.clearPreview()}}}(l,s,r,E,e.comparisonExcludedSelectors);let g,w,v,y,b,x,M,C,k=!1;try{a.BroadcastChannel&&(C=new a.BroadcastChannel(`meet-the-frontend-live-preview-panel:${e.endpoint}:${i}:${e.userId}`),C.onmessage=e=>{"takeover"===e.data?.type&&p&&($(!0),E(r.handedOff,"conflict",{reason:"handed-off"}))},a.addEventListener("pagehide",e=>{e.persisted||C.close()}))}catch{C?.close(),C=null}function E(e,n="loading",{canRetry:o=!0,reason:r=""}={}){"ready"===n&&(k=!1),l.report(e,n,{canTakeOver:!!C,hasPreview:h.hasPreview,canRetry:o,reason:r,hasHtmlPreview:h.hasHtmlPreview,redirectDestination:h.redirectDestination,canRefresh:p&&!t.saving&&["ready","error"].includes(n)&&("error"!==n||o)})}function P(e){const t=e?.code,n=function(e){const t=e?.code;return"mtflpp_post_locked"===t?"post-locked":["mtflpp_invalid_nonce","rest_cookie_invalid_nonce","mtflpp_preview_conflict","mtflpp_source_changed","mtflpp_acf_unavailable","mtflpp_integration_failed"].includes(t)?"reload":["mtflpp_cannot_preview","rest_forbidden","rest_cannot_edit"].includes(t)?"permission":"mtflpp_preview_origin_mismatch"===t?"origin-mismatch":"mtflpp_preview_unsupported_url"===t?"unsupported-url":""}(e);n&&(p=!1,S(),h.cancel(),b?.()),E("string"==typeof t?e.message:r.failed,"post-locked"===n?"paused":"error",{reason:n,canRetry:!n})}function S(){clearTimeout(u),f=void 0}function L(e){if(void 0===e&&void 0===f)return;const t=performance.now();void 0!==e&&(f=t+e),clearTimeout(u);const n=Math.ceil(f-t);n>0?u=setTimeout(V,n):V()}function T(){p&&(m+=1,k=!0,h.cancel(),t.saving||E(r.stale,"stale"),t.saving||t.previewing?S():L(275))}function V(){if(!p||g||!1===t.ready||t.previewing||t.saving)return;S();const n=m;E(r.updating),g=(async()=>{try{if(await t.idle,!p||!1===t.ready||t.saving)return;const o=e.base;let i,a;v=t.preparePreview();try{i=await v}catch(e){a=e}finally{v=null}if(await t.idle,!p||!1===t.ready||t.saving||o!==e.base)return;if(a)throw a;if("string"!=typeof i.url)throw Object.assign(new Error(i.message||r.failed),{code:i.code});p&&n===m&&await function(e,t,n){return h.load(e,()=>p&&t===m,()=>l.followChanges&&k,n)}(i.url,n,i.comparisonValues)}catch(e){p&&!t.saving&&P(e)}finally{g=null,L()}})()}function H(){m+=1,h.clear()}function $(e=!1){l.setVisible(e),p=!1,S(),H(),clearTimeout(M),M=null,x?.abort(),l.returnToEditor(),b?.()}async function D(n=!1){if(l.setVisible(!0),p)return;if(w)return void P(w);if(y){if(x&&!x.signal.aborted)return;const e=m;try{await y}catch{}return void(l.visible&&e===m&&D(n))}if(!1===t.ready)return void E(t.notReady,t.notReadyState??"paused",{canRetry:!1});if(!e.available)return void E(r.unavailable,"error",{canRetry:!1,reason:"unavailable"});if(!a.isSecureContext||!navigator.locks)return void E(r.browser,"error",{canRetry:!1,reason:"browser"});const o=n&&C?new AbortController:null;let s=!1;x=o,o?(E(r.waiting,"handover"),M=setTimeout(()=>{s=!0,o.abort()},15e3)):E(t.saving?r.saving:r.updating);try{const n=o?{signal:o.signal}:{ifAvailable:!0};if(y=navigator.locks.request(`meet-the-frontend-live-preview-panel:${e.endpoint}:${i}`,n,async e=>{if(clearTimeout(M),M=null,x=null,l.visible&&!o?.signal.aborted)if(e){E(t.saving?r.saving:r.updating);try{await new Promise(e=>{b=e,p=!0,m+=1,V()}),await g}finally{b=null}}else E(C?r.conflict:r.closeOther,"conflict",{reason:C?"other-tab":"manual"})}),o)try{C.postMessage({type:"takeover"})}catch(e){throw o.abort(),p&&$(!0),await y.catch(()=>{}),e}await y,l.visible&&s&&E(r.takeoverTimeout,"conflict",{reason:"busy"})}catch(e){p=!1,l.visible&&s?E(r.takeoverTimeout,"conflict",{reason:"busy"}):l.visible&&"AbortError"!==e.name&&P(e)}finally{clearTimeout(M),M=null,x=null,y=null}}function A(e=!0){t.saving||(e||(k=!1),p?(m+=1,h.cancel(),L(0)):D())}return{changed:T,pause:function(e=r.saving,t="loading"){return m+=1,S(),h.cancel(),(p||l.visible&&"paused"===t)&&E(e,t,{canRetry:!1}),v},resume:function(e){w=e,e?l.visible&&P(e):!l.visible||p||y?T():D()},setTitle:l.setTitle,openFromLauncher:l.openFromLauncher,start:()=>{l.visible&&D()},get pending(){return g}}}const Y=window.meetTheFrontendLivePreviewPanel,U=document.getElementById("edittag");if(Y&&U)try{!function(e,t,n,o){const r='.term-name-wrap input[name="name"]',i='.term-description-wrap textarea[name="description"]',a="input change undo redo SetContent";let s,l;function c(){const n=t.querySelector(r)?.value,o=t.querySelector(i),a=s&&s.getElement()===o&&s.getBody()&&!s.isHidden()?s.getContent():o?.value;if("string"!=typeof n||"string"!=typeof a)throw new Error(e.strings.bootFailed);return{name:n,description:a}}const d=J(e,{title:c().name,async preparePreview(){const t=c(),n=l?.capture(),o={"X-WP-Nonce":e.nonce};n&&(o["Content-Type"]="application/json");const r=await fetch(e.endpoint,{method:"POST",credentials:"same-origin",headers:o,body:n?JSON.stringify({...n,...t}):new URLSearchParams(t)}),i=await r.json();if(!r.ok)throw Object.assign(new Error(i.message||e.strings.failed),{code:i.code});return{...i,comparisonValues:{name:{type:"text",value:t.name},description:{type:"html",value:t.description}}}}},{inlineLauncher:o});function u(e){if(e.target.matches(r))d.setTitle(e.target.value);else if(!e.target.matches(i))return;d.changed()}function f(){d.changed()}function p(e){"description"===e?.id&&e!==s&&t.contains(e.getElement())&&(s?.off(a,f),s=e,s.on(a,f),f())}l=function(e,t,n){if(!e.acfTermEnabled||!t.querySelector('[name="_acf_nonce"]'))return;const{acf:o,jQuery:r,tinymce:i}=window,a=()=>Object.assign(new Error(e.strings.acfUnavailable),{code:"mtflpp_acf_unavailable"});if("function"!=typeof o?.serialize||"function"!=typeof o.addAction||"function"!=typeof o.removeAction||"function"!=typeof r)throw a();const s=new Set,l="input change undo redo SetContent";function c(e){const o=e?.getElement?.();o?.name?.startsWith("acf[")&&t.contains(o)&&!s.has(e)&&(s.add(e),e.on(l,n),e.on("remove",()=>{s.delete(e),e.off(l,n)}))}const d=function(e,t,n,o){const r=window.acf;r.addAction("wysiwyg_tinymce_init",n);for(const e of["append","remove","sortstop","change_field"])r.addAction(e,t);const i=t=>{t[0]===e&&o?.()};function a(e){return!!e?.closest?.(".acf-field")}return r.addAction("validation_failure",i),window.jQuery(e).on("input.mtflppAcf change.mtflppAcf sortupdate.mtflppAcf",e=>{e.originalEvent&&"sortupdate"!==e.type||!a(e.target)||t()}),{isField:a,isValidating:()=>!!e.classList?.contains("is-validating"),hasStructuralPaginationChanges:()=>!!e.querySelector('.acf-repeater[data-pagination="1"] .acf-row:is(.acf-added, .acf-inserted, .acf-reordered, .acf-deleted)'),accepts:e=>"_acf_nonce"===e||e.startsWith("acf[")||e.startsWith("_acf_fields["),destroy(){r.removeAction("wysiwyg_tinymce_init",n);for(const e of["append","remove","sortstop","change_field"])r.removeAction(e,t);r.removeAction("validation_failure",i),window.jQuery(e).off(".mtflppAcf")}}}(t,n,c);for(const e of i?.editors??[])c(e);const u=r(t.ownerDocument),f="tinymce-editor-init.mtflppAcfTerm";u.on(f,(e,t)=>c(t));const p=e=>{d.isField(e.target)&&n()};return t.addEventListener("input",p),t.addEventListener("change",p,!0),{capture(){const e=[];try{for(const n of s){const o=n.getElement();o&&t.contains(o)&&n.getBody()&&!n.isHidden()&&(e.push([o,o.value]),o.value=n.getContent())}const{acf:n,_acf_nonce:i,_acf_fields:l}=o.serialize(r(t));if(!n)return{};if(!i)throw a();return{acf:n,_acf_nonce:i,_acf_fields:l}}finally{for(const[t,n]of e)t.value=n}},destroy(){d.destroy(),u.off(f),t.removeEventListener("input",p),t.removeEventListener("change",p,!0);for(const e of s)e.off(l,n);s.clear()}}}?.(e,t,d.changed);const m=window.jQuery?.(t.ownerDocument);m?.on("tinymce-editor-init.mtflppTermEditor",(e,t)=>p(t)),p(window.tinymce?.get("description")),window.addEventListener("pagehide",e=>{e.persisted||(s?.off(a,f),m?.off("tinymce-editor-init.mtflppTermEditor"),l?.destroy())}),t.addEventListener("input",u),t.addEventListener("change",u,!0),d.start()}(Y,U,0,U.querySelector("#mtflpp-term-preview button"))}catch(e){!function(e,t){document.getElementById("mtflpp-panel")?.remove(),document.getElementById("mtflpp-toggle")?.remove(),document.getElementById("mtflpp-publish-preview")?.remove(),document.getElementById("mtflpp-term-preview")?.remove();const n=document.createElement("div");n.className="notice notice-error",n.setAttribute("role","alert");const o=document.createElement("p");o.textContent=e,n.append(o),(document.getElementById("wpbody-content")||document.body).prepend(n),console.error("Meet the Frontend – Live Preview Panel could not start.",t)}(Y.strings.bootFailed,e)}})();
     1(()=>{"use strict";const e=window.wp.data,t=window.wp.preferences,n=window.wp.element,o=window.wp.components,r=window.wp.notices,i=window.wp.primitives,a=window.ReactJSXRuntime,s={refresh:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M12 5.5L17.7929 11.2929C18.1834 11.6834 18.1834 12.3166 17.7929 12.7071L16 14.5M16 5.5H12V9.5M12 18.5L6.20711 12.7071C5.81658 12.3166 5.81658 11.6834 6.20711 11.2929L8 9.5M8 18.5H12V14.5"})}),more:(0,a.jsxs)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,a.jsx)(i.Path,{d:"M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z",fill:"currentColor",stroke:"none"}),(0,a.jsx)(i.Path,{d:"M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z",fill:"currentColor",stroke:"none"}),(0,a.jsx)(i.Path,{d:"M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z",fill:"currentColor",stroke:"none"}),(0,a.jsx)(i.Path,{d:"M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z"}),(0,a.jsx)(i.Path,{d:"M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z"}),(0,a.jsx)(i.Path,{d:"M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z"})]}),expand:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M4.75 10V4.75H10M4.75 4.75L10 10M14 19.25H19.25V14M19.25 19.25L14 14"})}),compact:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M10 4.75V10H4.75M10 10L4.75 4.75M19.25 14H14V19.25M14 14L19.25 19.25"})}),pip:(0,a.jsxs)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,a.jsx)(i.Path,{d:"M4.75 9.25V16C4.75 16.6904 5.30964 17.25 6 17.25H8M4.75 9.25V6C4.75 5.30964 5.30964 4.75 6 4.75H16C16.6904 4.75 17.25 5.30964 17.25 6V8M4.75 9.25H8"}),(0,a.jsx)(i.Path,{d:"M10.75 11.25C10.75 10.9739 10.9739 10.75 11.25 10.75H18.75C19.0261 10.75 19.25 10.9739 19.25 11.25V18.75C19.25 19.0261 19.0261 19.25 18.75 19.25H11.25C10.9739 19.25 10.75 19.0261 10.75 18.75V11.25Z",fill:"currentColor"})]}),move:(0,a.jsxs)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,a.jsx)(i.Path,{d:"M9.25 5.75H8.75V6.25H9.25V5.75Z",fill:"currentColor",stroke:"none"}),(0,a.jsx)(i.Path,{d:"M9.25 11.75H8.75V12.25H9.25V11.75Z",fill:"currentColor",stroke:"none"}),(0,a.jsx)(i.Path,{d:"M9.25 17.75H8.75V18.25H9.25V17.75Z",fill:"currentColor",stroke:"none"}),(0,a.jsx)(i.Path,{d:"M15.25 5.75H14.75V6.25H15.25V5.75Z",fill:"currentColor",stroke:"none"}),(0,a.jsx)(i.Path,{d:"M15.25 11.75H14.75V12.25H15.25V11.75Z",fill:"currentColor",stroke:"none"}),(0,a.jsx)(i.Path,{d:"M15.25 17.75H14.75V18.25H15.25V17.75Z",fill:"currentColor",stroke:"none"}),(0,a.jsx)(i.Path,{d:"M9.25 5.75H8.75V6.25H9.25V5.75Z"}),(0,a.jsx)(i.Path,{d:"M9.25 11.75H8.75V12.25H9.25V11.75Z"}),(0,a.jsx)(i.Path,{d:"M9.25 17.75H8.75V18.25H9.25V17.75Z"}),(0,a.jsx)(i.Path,{d:"M15.25 5.75H14.75V6.25H15.25V5.75Z"}),(0,a.jsx)(i.Path,{d:"M15.25 11.75H14.75V12.25H15.25V11.75Z"}),(0,a.jsx)(i.Path,{d:"M15.25 17.75H14.75V18.25H15.25V17.75Z"})]}),warning:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M12 8L12 13M12 14.5L12 16M4.75 12C4.75 7.99593 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12Z",strokeLinejoin:"round"})}),info:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M12 16V11M12 9.5V8M19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12C4.75 7.99594 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12Z",strokeLinejoin:"round"})}),close:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M7.75 16.25L16.25 7.75M16.25 16.25L7.75 7.75"})}),check:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M7 12L10 15L17 8"})}),chevron:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M7 11L12 15L17 11"})}),desktop:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M4.75 16.75V17H3.25C3.11193 17 3 17.1119 3 17.25H21C21 17.1119 20.8881 17 20.75 17H19.25V16.75M4.75 16.75V8.5C4.75 7.80964 5.30964 7.25 6 7.25H18C18.6904 7.25 19.25 7.80964 19.25 8.5V16.75M4.75 16.75H19.25"})}),tablet:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M10 16.5H14M18.25 18V6C18.25 5.30964 17.6904 4.75 17 4.75H7C6.30964 4.75 5.75 5.30964 5.75 6L5.75 18C5.75 18.6904 6.30964 19.25 7 19.25H17C17.6904 19.25 18.25 18.6904 18.25 18Z"})}),mobile:(0,a.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,a.jsx)(i.Path,{d:"M11 16.5H13M16.25 18V6C16.25 5.30964 15.6904 4.75 15 4.75H9C8.30964 4.75 7.75 5.30964 7.75 6L7.75 18C7.75 18.6904 8.30964 19.25 9 19.25H15C15.6904 19.25 16.25 18.6904 16.25 18Z"})})};function l(e,t,n="right"){const o=e&&!Array.isArray(e)&&e.bounds&&["x","y","width","height"].every(t=>Number.isFinite(e.bounds[t]))&&e.bounds.width>0&&e.bounds.height>0&&[null,"left","center","right"].includes(e.dock)&&"boolean"==typeof e.expanded&&(void 0===e.anchor||["left","center","right"].includes(e.anchor));let r=!!o&&e.expanded;const i={width:480,height:393},a=o?{...e.bounds}:{x:0,y:0,...i};let s=o?e.dock:n,l=s||o&&e.anchor||"right";function c(){return"left"===l?0:"center"===l?.5:1}function u(e,n=t(!s),o=320,r=220){return e.width=Math.min(n.width,Math.max(Math.min(o,n.width),e.width)),e.height=Math.min(n.height,Math.max(Math.min(r,n.height),e.height)),e.x=Math.max(n.left,Math.min(n.right-e.width,e.x)),e.y=Math.max(n.top,Math.min(n.bottom-e.height,e.y)),e}function d(e){if(!s)return e;const n=t();return e.x="left"===s?n.left:"center"===s?n.left+(n.width-e.width)/2:n.right-e.width,e.y=n.bottom-e.height,e}return{area:t,compactRect:function(){return d(u({...a}))},launcherRect:function(e){return d(u({...e,x:a.x+(a.width-e.width)*c(),y:a.y+a.height-e.height},t(!s),1,1))},usableEdge:function(e){return!(s&&(e.includes("s")||"left"===s&&e.includes("w")||"right"===s&&e.includes("e")))},get anchor(){return l},get anchorFactor(){return c()},get dock(){return s},get expanded(){return r},get layout(){return{bounds:{...a},dock:s,anchor:l,expanded:r}},toggleExpanded(){r=!r},dockTo:function(e="right",t=!1){t&&Object.assign(a,i),r=!1,l=s=e},resize(e,n,o,r){Object.assign(a,function(e,n,o,r){const i=t(!s),a=n.includes("e")||n.includes("w"),c=n.includes("n")||n.includes("s"),u=function(e){return"center"===l?.5:e.includes("w")?1:0}(n),d=e.x+e.width*u,f=n.includes("n"),p=e.y+(f?e.height:0),m=function(e,t,n){return 0===n?e.right-t:1===n?t-e.left:2*Math.min(t-e.left,e.right-t)}(i,d,u),h=f?p-i.top:i.bottom-p,g=(n.includes("w")?-o:o)*(.5===u?2:1),w=Math.max(Math.min(320,m),Math.min(m,e.width+g)),v=Math.max(Math.min(220,h),Math.min(h,e.height+(f?-r:r))),y=a&&0!==o&&w!==e.width,b=c&&0!==r&&v!==e.height,x=f?p-v:p;return{x:y?d-w*u:e.preferredBounds.x,y:b?x:e.preferredBounds.y,width:y?w:e.preferredBounds.width,height:b?v:e.preferredBounds.height}}(e,n,o,r))},move:function(e,n,o,r=!1){const i=u({...e,x:e.x+n,y:e.y+o},t(!0),r?1:320,r?1:220);a.x=i.x+(r?(i.width-a.width)*c():0),a.y=i.y+(r?i.height-a.height:0),s=null}}}function c(i,{postTitle:a="",publicRedirect:c,inlineLauncher:u,nativeLauncher:d,canRememberVisibility:f=!0,onOpen:p,onClose:m,onRefresh:h,onRetry:g,beforeMove:w,afterMove:v,beforeViewportChange:y}){const b=window,x=document,M="meet-the-frontend-live-preview-panel",C=(0,e.select)(t.store),k=(0,e.dispatch)(t.store),S="width"===C.get(M,"fit")?"width":"automatic";k.setDefaults(M,{rememberVisibility:!0,rememberPosition:!0,panelOpen:!0,scrollToChanges:!0,viewport:"desktop",fitMode:S,customZoom:100,tabletOrientation:"portrait",mobileOrientation:"portrait"});const E=()=>!u&&(!d||d.fallbackMedia.matches);let P=!1!==C.get(M,"rememberVisibility"),L=!1!==C.get(M,"rememberPosition"),T=!1!==C.get(M,"scrollToChanges");const V=u?.parentElement??x.getElementById("mtflpp-toggle"),O=x.getElementById("mtflpp-panel");if(!V||!O)throw new Error("Preview panel markup is missing.");const H=u||function(e){let t;const{title:r,moveHelp:i}=e.dataset;return(0,n.flushSync)(()=>(0,n.createRoot)(e).render((0,n.createElement)(o.Button,{ref:e=>{t=e},variant:"secondary",label:r,title:r,description:i,"aria-controls":"mtflpp-panel","aria-expanded":!1},(0,n.createElement)("span",{className:"mtflpp-launcher-label"},r)))),t}(V),j=O.querySelector(".mtflpp-move-control"),R=O.querySelector(".mtflpp-resize"),$=O.querySelectorAll("[data-resize-edge]"),N=O.querySelector(".mtflpp-header"),_=O.querySelector(".mtflpp-caption"),A=O.querySelector(".mtflpp-viewport"),B=O.querySelector(".mtflpp-canvas"),F=O.querySelector(".mtflpp-stage"),D=O.querySelector(".mtflpp-empty"),q=O.querySelector(".mtflpp-devicebar"),W=O.querySelector(".mtflpp-dimensions"),z=O.querySelector(".mtflpp-feedback"),Z=O.querySelector('[role="status"]');let I;const J=function(e,t,n,o={},r=()=>{},i={desktop:"Desktop",tablet:"Tablet",mobile:"Phone"}){const a=e.ownerDocument.defaultView,s=e.querySelector(".mtflpp-canvas"),l=e.querySelector(".mtflpp-canvas-space"),c=n.querySelector(".mtflpp-dimensions-text"),u={desktop:[1280,800],tablet:[768,1024],mobile:[390,844]},d=Object.keys(u);let f=d.includes(o.device)?o.device:"desktop";const p=["automatic","window","width","custom"];let m=p.includes(o.fit)?o.fit:"automatic";const h=e=>Number.isInteger(e)&&e>=10&&e<=400;let g,w=h(o.customZoom)?o.customZoom:100,v=100;const y=e=>"desktop"===e?"landscape":"portrait",b=Object.fromEntries(d.map(e=>[e,"desktop"!==e&&["portrait","landscape"].includes(o[`${e}Orientation`])?o[`${e}Orientation`]:y(e)])),x=()=>b[f]===y(f)?u[f]:[...u[f]].reverse(),M=()=>"width"===m;let C,k,S;const E=a.matchMedia("(prefers-reduced-motion: no-preference)");function P(){const t=e.ownerDocument.defaultView.devicePixelRatio;return Number.isFinite(t)&&t>0?t:1}function L(e,t){if("custom"===m)return w/100/P();const n=s.clientWidth/e;if(M())return n;const o=Math.min(n,s.clientHeight/t);return"automatic"===m?Math.min(1/P(),o):o}function T(e,n){C=e;const[o,r]=x(),i=Math.max(0,(s.clientWidth-o*C)/2),a=Math.max(0,(s.clientHeight-r*C)/2);Object.assign(l.style,{width:`${Math.max(s.clientWidth,i+o*C)}px`,height:`${Math.max(s.clientHeight,a+r*C)}px`}),Object.assign(t.style,{left:`${i}px`,top:`${a}px`,transform:`scale(${C})`});const c=o*C>s.clientWidth+.01||r*C>s.clientHeight+.01,u="custom"===m||M();s.tabIndex=u&&c?0:-1,s.scrollLeft="custom"===m?n.x*C:0,s.scrollTop=u?n.y*C:0}function V(){if(!k)return;const e=k;k=null,e.window.cancelAnimationFrame(e.frame),e.resolve?.()}function O(e,t,n,o){return t<=0||o&&e<-1&&t<n?Math.max(e,t-n):e>=n||o&&e>0&&t>n+1?Math.min(e,t-n):0}function H(o=!1,a=!1){V();const[l,u]=x();if(Object.assign(t.style,{width:`${l}px`,height:`${u}px`}),!e.clientWidth||!e.clientHeight)return;const d=P(),p=`${i[f]} (${l} × ${u}) · `,h=Math.max(400,Math.ceil(e.clientWidth/l*d*100)),y=`${p}${"0".repeat(String(h).length)}%`;n.dataset.reserve!==y&&(n.dataset.reserve=y);const b=a?{x:0,y:0}:{x:(s.scrollLeft||0)/(C||1),y:(s.scrollTop||0)/(C||1)};if(s.style.overflowX="hidden",s.style.overflowY="hidden","custom"===m){const e=L(l,u);for(let t=0;t<2;t++)l*e>s.clientWidth+.01&&(s.style.overflowX="scroll"),u*e>s.clientHeight+.01&&(s.style.overflowY="scroll")}else M()&&u*L(l,u)>e.clientHeight&&(s.style.overflowY="scroll");if(!s.clientWidth||!s.clientHeight)return;const S=L(l,u),O=Math.round(S*d*100),H=O!==v||d!==g;v=O,g=d;const j=`${p}${"custom"===m?w:v}%`;c.textContent!==j&&(c.textContent=j),H&&r();const R=C??S;if(!o||!E.matches||R===S)return void T(S,b);const $={window:e.ownerDocument.defaultView,frame:null},N=$.window.performance.now();k=$;const _=e=>{T(e,b),$.scrollLeft=s.scrollLeft,$.scrollTop=s.scrollTop};_(R);const A=e=>{if(k!==$)return;const t=Math.min(1,Math.max(0,(e-N)/200));_(R+(S-R)*(1-(1-t)**3)),t<1?$.frame=$.window.requestAnimationFrame(A):V()};$.frame=$.window.requestAnimationFrame(A)}function j(){H()}function R(){S?.();const t=e.ownerDocument.defaultView.matchMedia(`(resolution: ${P()}dppx)`);t.addEventListener("change",R),S=()=>t.removeEventListener("change",R),j()}let $=new a.ResizeObserver(j);return $.observe(e),E.addEventListener("change",j),a.addEventListener("resize",R),R(),{get device(){return f},get fit(){return m},get customZoom(){return w},get zoomPercent(){return"custom"===m?w:v},get dpr(){return P()},get orientation(){return b[f]},canvasTarget:function(e,t,{fitTarget:n=!1}={}){const o=e.getBoundingClientRect(),r=s.getBoundingClientRect(),i=o.left-r.left-s.clientLeft,a=o.top-r.top-s.clientTop,l=O(i+t.left*C,i+t.right*C,s.clientWidth,n),c=O(a+t.top*C,a+t.bottom*C,s.clientHeight,n),u=Math.max(t.left,-i/C),d=Math.min(t.right,(s.clientWidth-i)/C);return{visible:!l&&!c,visibleCenterX:u<d?(u+d)/2:void 0,distance:Math.hypot(l,c),reveal(e="instant"){(l||c)&&s.scrollBy({left:l,top:c,behavior:e})}}},canvasWasPanned:function(){return!!k&&(s.scrollLeft!==k.scrollLeft||s.scrollTop!==k.scrollTop)},whenSettled:function(){if(!k)return;const e=k;return e.done??=new Promise(t=>{e.resolve=t}),e.done},finishMotion(){k&&j()},select(e,{animate:t=!1,keepPan:n=!1}={}){if(!d.includes(e))return;const o=f!==e;f=e,o?H(t,!n):k||j()},rotate({animate:e=!1,keepPan:t=!1}={}){"desktop"!==f&&(b[f]="portrait"===b[f]?"landscape":"portrait",H(e,!t))},setFit(e){p.includes(e)&&m!==e&&(m=e,H(!1,!0))},setZoom(e){if(!h(e)||"custom"===m&&w===e)return;const t="custom"!==m;w=e,m="custom",H(!1,t)},layout:j,beforeMove(){V(),$.disconnect(),S?.(),e.ownerDocument.defaultView.removeEventListener("resize",R)},afterMove(){$=new e.ownerDocument.defaultView.ResizeObserver(j),$.observe(e),e.ownerDocument.defaultView.addEventListener("resize",R),R()}}}(A,F,W,{device:C.get(M,"viewport"),fit:C.get(M,"fitMode")??S,customZoom:C.get(M,"customZoom"),tabletOrientation:C.get(M,"tabletOrientation"),mobileOrientation:C.get(M,"mobileOrientation")},()=>Pe(),i),G=x.querySelector("#wpbody-content > .wrap"),X=x.getElementById("wpadminbar");function Y(e=!1){const t=Math.max(1,x.documentElement.clientWidth),n=Math.max(1,x.documentElement.clientHeight),o=x.documentElement.getBoundingClientRect().left+b.scrollX,r=!e&&G?.getBoundingClientRect(),i=r?Math.max(0,"rtl"===b.getComputedStyle(G).direction?r.left-o:o+t-r.right):20,a=e?0:i,s=Math.min(a,(t-1)/2),l=Math.min(Math.max(0,X?.getBoundingClientRect().bottom||0)+a,n-1),c=t-s,u=n-Math.min(a,n-l-1);return{left:s,top:l,right:c,bottom:u,width:c-s,height:u-l}}let U,K=f&&(!P||!1!==C.get(M,"panelOpen")),Q=!1;const ee=C.get(M,"layout"),te=C.get(M,"position")??ee?.dock??ee?.anchor;let ne=["left","center","right"].includes(te)?te:"right";const oe=l(L?ee:void 0,Y,ne),{compactRect:re,usableEdge:ie}=oe;let ae,se=!1,le="",ce=!1,ue={text:i.loading,state:"loading",hasPreview:!1,canRetry:!1,reason:""},de=!1;function fe(e){const t="string"==typeof e?e.replace(/\s+/g," ").trim():"";_.textContent=t?`${i.preview} — ${t}`:i.title,_.title=_.textContent,U&&(U.document.title=_.textContent)}function pe(){const{text:e,state:t,hasPreview:n,reason:o}=ue;return"handover"===t?{heading:i.switchingPreview,description:e,note:i.tabEdits}:"conflict"===t?{heading:e,description:{"handed-off":i.handedOffHelp,busy:i.takeoverTimeoutHelp,manual:i.closeOtherHelp}[o]||i.conflictHelp,note:"manual"===o?i.manualSwitchHint:i.tabEdits}:"paused"===t?{heading:i.pausedTitle,description:e,note:""}:"error"===t?function(){const{text:e,hasPreview:t,canRetry:n,reason:o}=ue;if("origin-mismatch"===o)return{heading:i.originMismatchTitle,description:t?`${e} ${i.previousPreview}`:e,note:""};if("unavailable"===o||"browser"===o)return{heading:"unavailable"===o?i.unavailableTitle:i.browserTitle,description:e,note:""};const r={reload:i.reviewBeforeReload,"reload-before-save":i.nativePreviewAcfReload}[o];if(!t){let t=e;return e===i.failed&&(t=n?i.failedHelp:""),r&&(t+=` ${r}`),{heading:i.failed,description:t,note:""}}return{heading:e===i.failed?i.refreshFailed:e,description:r||i.previousPreview,note:""}}():n?{heading:e,description:"",note:""}:{heading:i.loading,description:i.preparing,note:""}}function me(){return se?"handover"===ue.state?i.takingOver:i.takeOver:i.retry}function he(e){return!e||["handover","paused"].includes(ue.state)?"info":"error"!==ue.state||ue.canRetry?"warning":"error"}function ge(){return ue.redirectDestination?`${i.redirected} ${ue.redirectDestination}`:ue.hasHtmlPreview&&ae?`${i.publicRedirected} ${ae}`:""}function we(){const{state:e,hasPreview:t,canRetry:n,reason:o}=ue,r=t&&["error","conflict","handover","paused"].includes(e),a=!t||r||le?"":ge();if(z.hidden=!r&&!le&&!a,z.tabIndex=z.hidden?-1:0,O.dataset.hasFeedback=String(!z.hidden),z.hidden)return null;if(a)return{heading:a,status:"info",dismissible:!1};const{heading:s,description:l}=pe();return{heading:r?s:le,description:r?l:i.windowNoticeHelp,status:he(r),dismissible:!r,retry:r&&(se||n&&["error","conflict"].includes(e)),close:r&&"error"===e&&!n&&!["reload","reload-before-save"].includes(o),disabled:"handover"===e,action:me()}}function ve(e){ue.hasPreview&&["error","conflict","handover","paused"].includes(ue.state)||(le=e,Pe()),Z.textContent=`${e} ${i.windowNoticeHelp}`}function ye(){le="",Pe()}function be(e,t="loading",{canTakeOver:n=!1,hasPreview:o=!1,hasHtmlPreview:r=!1,redirectDestination:i,canRefresh:a=!1,canRetry:s=!0,reason:l=""}={}){const u=O.ownerDocument.activeElement,d=O.contains(u),f=!o&&(ue.state!==t||ue.text!==e||ue.reason!==l),p=ue.hasPreview!==o;ue={text:e,state:t,canTakeOver:n,hasPreview:o,hasHtmlPreview:r,redirectDestination:i,canRefresh:a,canRetry:s,reason:l},["error","conflict","handover","paused"].includes(t)&&(le=""),O.dataset.state=t,O.dataset.hasPreview=String(o),se=n&&["conflict","handover"].includes(t),D.hidden=o,q.hidden=!o;const{heading:m,description:h,note:g}=pe();f&&(D.scrollTop=0);const w="ready"!==t||le?"":ge();Z.textContent=o?[m,h,g,w].filter(Boolean).join(" "):m,Pe(),p&&J.layout(),function(e,t){e&&t&&(!O.contains(e)||e.closest("[hidden]")||e.disabled||!ue.hasPreview&&B.contains(e))&&I.focus(D.hidden?"actions":"empty-title")}(u,d),K&&"ready"===t&&r&&!i&&async function(){if(c&&!ce){ce=!0;try{const e=new URL(c.endpoint);if(e.origin!==b.location.origin)return;const t=await b.fetch(e,{credentials:"same-origin",cache:"no-store",redirect:"error",headers:{"X-WP-Nonce":c.nonce}});if(!t.ok)return;const{destination:n}=await t.json();if("string"!=typeof n||!n)return;if(ae=n,!K)return;Pe(),"ready"!==ue.state||!ue.hasHtmlPreview||ue.redirectDestination||le||(Z.textContent=ge())}catch{}}}()}function xe(e){f&&P&&C.get(M,"panelOpen")!==e&&k.set(M,"panelOpen",e)}function Me(){L&&k.set(M,"layout",oe.layout)}function Ce(){const e=V.hidden;V.hidden=!1,V.style.maxWidth=`${Y(!oe.dock).width}px`;const t={width:V.offsetWidth,height:V.offsetHeight};return V.hidden=e,oe.launcherRect(t)}function ke(){if(U)return;if(!K&&E()){const e=Ce(),t=oe.anchorFactor;Object.assign(V.style,{left:`${e.x+e.width*t}px`,top:`${e.y+e.height}px`,transform:`translate(${-100*t}%, -100%)`})}let e=re();if(O.dataset.anchor=oe.anchor,oe.expanded){const t=Y();e={x:t.left,y:t.top,width:t.width,height:t.height}}Object.assign(O.style,{left:`${e.x}px`,top:`${e.y}px`,width:`${e.width}px`,height:`${e.height}px`,transform:""})}function Se(e="right",t=!1){oe.dockTo(e,t),ne=e,k.set(M,"position",ne),ke(),Me(),Pe()}function Ee(){return"function"==typeof b.documentPictureInPicture?.requestWindow}function Pe(){if(!I)return;const e=O.ownerDocument.fullscreenElement===O,t=!U&&!e,n=t&&!oe.expanded;O.classList.toggle("mtflpp-expanded",oe.expanded),R.hidden=!n;for(const e of $)e.hidden=!n||!ie(e.dataset.resizeEdge);const o=se||ue.canRetry&&["error","conflict"].includes(ue.state);var r;I.update({inPage:t,inPip:!!U,movable:n,dock:oe.dock,canRememberVisibility:f,rememberVisibility:P,rememberPosition:L,followChanges:T,device:J.device,busy:ue.hasPreview&&["stale","loading","handover"].includes(ue.state)&&ue.text!==i.saving,empty:ue.hasPreview?null:{...pe(),busy:["loading","stale","ready","handover"].includes(ue.state),icon:["paused","conflict"].includes(ue.state)||["unavailable","browser","origin-mismatch"].includes(ue.reason)?"info":"warning",retry:o,disabled:"handover"===ue.state,close:"error"===ue.state&&!o,action:me()},notice:we(),fit:J.fit,orientation:J.orientation,customZoom:J.customZoom,zoomPercent:J.zoomPercent,dpr:J.dpr,canRefresh:ue.canRefresh,hasPreview:ue.hasPreview,canPip:t&&Ee(),canFullscreen:t&&!!x.fullscreenEnabled,mode:e||oe.expanded?"compact":"expand",modeLabel:(r=e,r?i.exitFullscreen:oe.expanded?i.compact:i.expand)})}function Le(){I.closeMenu(),U?U.close():x.fullscreenElement!==O?(oe.toggleExpanded(),ke(),Me(),Pe(),I.focus("mode")):x.exitFullscreen().then(ye,()=>ve(i.fullscreenFailed))}function Te(e,t=!1,n){const o=e===H,r=e===N,a=()=>n||("left"===oe.anchor?"ne":"nw"),s=()=>U||!o&&oe.expanded||x.fullscreenElement===O||t&&!ie(a());let l,c;const u=()=>({...o?Ce():re(),preferredBounds:oe.layout.bounds});function d(){if(c=null,l)if(t||o)ke();else{const e=re(),t=e.x-parseFloat(O.style.left),n=e.y-parseFloat(O.style.top);Object.assign(O.style,{width:`${e.width}px`,height:`${e.height}px`,transform:`translate3d(${t}px, ${n}px, 0)`})}}function f(){if(!l)return;const{pointer:t,moved:n}=l;l=null,b.cancelAnimationFrame(c),e.hasPointerCapture(t)&&e.releasePointerCapture(t),O.classList.remove("mtflpp-dragging"),e.classList.remove("mtflpp-edge-active"),x.documentElement.classList.remove("mtflpp-window-dragging"),x.documentElement.style.removeProperty("--mtflpp-drag-cursor"),ke(),n&&(o&&(de=!0),Me(),Pe())}e.addEventListener("pointerdown",t=>{0!==t.button||s()||r&&t.target.closest('button, a, [role="button"]')||(o&&(de=!1),t.preventDefault(),o?H.focus({preventScroll:!0}):e===j&&I.focus("move"),I.closeMenu(),l={...u(),pointer:t.pointerId,pointerX:t.clientX,pointerY:t.clientY},e.setPointerCapture(t.pointerId))}),e.addEventListener("pointermove",n=>{if(!l||l.pointer!==n.pointerId)return;const r=n.clientX-l.pointerX,i=n.clientY-l.pointerY;!l.moved&&Math.abs(r)+Math.abs(i)<4||(l.moved=!0,O.classList.add("mtflpp-dragging"),t&&e.classList.add("mtflpp-edge-active"),x.documentElement.style.setProperty("--mtflpp-drag-cursor",t?b.getComputedStyle(e).cursor:"grabbing"),x.documentElement.classList.add("mtflpp-window-dragging"),t?oe.resize(l,a(),r,i):oe.move(l,r,i,o),c||(c=b.requestAnimationFrame(d)))});for(const t of["pointerup","pointercancel","lostpointercapture"])e.addEventListener(t,f);b.addEventListener("blur",f),r||n||e.addEventListener("keydown",e=>{const n={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[e.key];if(!n||e.altKey||e.ctrlKey||e.metaKey||s())return;e.preventDefault(),I.closeMenu();const r=u(),l=e.shiftKey?40:10;t?oe.resize(r,a(),n[0]*l,n[1]*l):oe.move(r,n[0]*l,n[1]*l,o),ke(),Me(),Pe();const c=re();Z.textContent=t?`${i.resize}: ${Math.round(c.width)} × ${Math.round(c.height)}`:i.moved})}fe(a),N.addEventListener("dblclick",e=>{U||e.target.closest("button, a")||Le()}),x.addEventListener("fullscreenchange",Pe),R.addEventListener("keydown",e=>{"Escape"===e.key&&R.classList.add("mtflpp-help-dismissed")}),R.addEventListener("blur",()=>R.classList.remove("mtflpp-help-dismissed")),Te(j),Te(N),u||Te(H),Te(R,!0);for(const e of $)Te(e,!0,e.dataset.resizeEdge);function Ve(){O.hidden=Q||!K,V.hidden=Q||!u&&(K||!E()),H.setAttribute("aria-expanded",String(!O.hidden))}function Oe(){I.closeMenu(),U?.close(),x.fullscreenElement===O&&x.exitFullscreen().catch(()=>{})}function He(e=!0){Q||(K?I.focus("actions"):(xe(!0),p(),K&&e&&I.focus("actions")))}return b.addEventListener("resize",ke),b.addEventListener("scroll",ke,{passive:!0}),d?.fallbackMedia.addEventListener("change",()=>{ke(),Ve()}),H.addEventListener("click",e=>{if(de&&0!==e.detail)return de=!1,void e.preventDefault();de=!1,He(0===e.detail)}),I=function(t,i,a){const l=t.querySelector(".mtflpp-controls"),c=t.querySelector(".mtflpp-refresh-control"),u=t.querySelector(".mtflpp-move-control"),d=t.querySelector(".mtflpp-device-controls"),f=t.querySelector(".mtflpp-fit-control"),p=t.querySelector(".mtflpp-pip-control"),m=t.querySelector(".mtflpp-empty"),h=t.querySelector(".mtflpp-feedback");let g,w=(0,n.createRoot)(l),v=!1,y=!1,b=!1;const x=r.InlineNotices?(0,e.dispatch)(r.store):null,M=t.ownerDocument.defaultView?.wp?.theme?.ThemeProvider,C="meet-the-frontend-live-preview-panel",k="preview-feedback";let S="";function E(){const e=g.notice,t=/[.!?…。!?]$/.test(e.heading)?e.heading:`${e.heading}.`;return{message:e.description?`${t} ${e.description}`:e.heading,status:e.status,isDismissible:e.dismissible,actions:[...e.retry?[{label:e.action,disabled:e.disabled,onClick:a.retry}]:[],...e.close?[{label:i.close,onClick:a.close}]:[]]}}function P(){x&&S&&x.removeNotice(k,C),S=""}function L(e){return()=>{O(),e()}}function T(){const{inPage:e,inPip:l,mode:w,modeLabel:k,movable:S,busy:P,canRefresh:T,hasPreview:H,canPip:j}=g;return(0,n.createElement)(o.SlotFillProvider,null,(0,n.createPortal)(S&&e&&(0,n.createElement)(o.Button,{className:"mtflpp-icon mtflpp-move",size:"compact",icon:s.move,label:i.move,showTooltip:!0,tooltipPosition:"bottom","data-action":"move"}),u),(0,n.createPortal)((0,n.createElement)(o.Button,{className:"mtflpp-icon",size:"compact",icon:P?(0,n.createElement)(o.Spinner):s.refresh,label:i.refresh,showTooltip:!0,accessibleWhenDisabled:!0,disabled:!T,onClick:a.refresh,"data-action":"refresh"}),c),(0,n.createPortal)(j&&H&&(0,n.createElement)("div",{className:"mtflpp-pip-surface"},(0,n.createElement)(o.Button,{className:"mtflpp-pip-button",icon:s.pip,label:i.popOutHelp,"aria-label":i.popOut,description:i.popOutHelp,showTooltip:!0,onClick:a.popOut,"data-action":"pop-out"})),p),function(){const{canPip:e,canFullscreen:t,inPage:r,inPip:l,dock:c,canRememberVisibility:u,rememberVisibility:d,rememberPosition:f,followChanges:p}=g;return(0,n.createElement)(o.DropdownMenu,{className:"mtflpp-actions",label:i.actions,icon:s.more,open:v,onToggle(e){v=e,e&&(y=!1),V()},toggleProps:{className:"mtflpp-icon",size:"compact","data-action":"actions"},popoverProps:{placement:"bottom-end",offset:6,shift:!0,className:"mtflpp-menu-popover"}},()=>(0,n.createElement)(n.Fragment,null,(e||t)&&(0,n.createElement)(o.MenuGroup,{label:i.display},e&&(0,n.createElement)(o.MenuItem,{label:i.popOutHelp,description:i.popOutHelp,showTooltip:!0,onClick:L(a.popOut),"data-action":"pip","aria-label":i.popOut},i.popOut),t&&(0,n.createElement)(o.MenuItem,{onClick:L(a.fullscreen),"data-action":"fullscreen"},i.fullscreen)),r&&(0,n.createElement)(o.MenuGroup,{label:i.position},(0,n.createElement)(o.MenuItemsChoice,{value:c,choices:[{value:"left",label:i.bottomLeft},{value:"center",label:i.bottomCenter},{value:"right",label:i.bottomRight}],onSelect(e){O(),a.dock(e)}})),(0,n.createElement)(o.MenuGroup,{label:i.preferences},!1!==u&&(0,n.createElement)(o.MenuItem,{role:"menuitemcheckbox",isSelected:d,icon:d?s.check:void 0,info:i.rememberVisibilityHelp,onClick:L(a.rememberVisibility),"data-action":"remember-visibility"},i.rememberVisibility),(0,n.createElement)(o.MenuItem,{role:"menuitemcheckbox",isSelected:f,icon:f?s.check:void 0,info:i.rememberPositionHelp,onClick:L(a.rememberPosition),"data-action":"remember-position"},i.rememberPosition),(0,n.createElement)(o.MenuItem,{role:"menuitemcheckbox",isSelected:p,icon:p?s.check:void 0,info:i.followHelp,onClick:L(a.follow),"data-action":"follow"},i.follow)),r&&(0,n.createElement)(o.MenuGroup,null,(0,n.createElement)(o.MenuItem,{info:i.resetHelp,onClick:L(a.reset),"data-action":"reset"},i.reset)),l&&(0,n.createElement)(o.MenuGroup,null,(0,n.createElement)(o.MenuItem,{onClick:L(a.close),"data-action":"close"},i.closeLivePreview))))}(),!l&&(0,n.createElement)(o.Button,{className:"mtflpp-icon mtflpp-mode",size:"compact",icon:s[w],label:k,showTooltip:!0,onClick:a.mode,"data-action":"mode"}),!l&&(0,n.createElement)(o.Button,{className:"mtflpp-icon",size:"compact",icon:s.close,label:i.close,showTooltip:!0,onClick:a.close,"data-action":"close"}),(0,n.createPortal)(function(){const{device:e,orientation:t}=g;return(0,n.createElement)(o.Toolbar,{className:"mtflpp-devices",label:i.viewport,variant:"unstyled"},...["desktop","tablet","mobile"].map(r=>{const l=e===r,c=l&&"desktop"!==r,u=c&&"landscape"===t,d="portrait"===t?i.rotateLandscape:i.rotatePortrait;return(0,n.createElement)(o.ToolbarButton,{key:r,icon:s[r],className:u?"mtflpp-device-rotated":void 0,label:c?`${i[r]} — ${d}`:i[r],isPressed:l,"data-viewport":r,onClick:()=>a.device(r)})}))}(),d),(0,n.createPortal)(function(){const{fit:e,customZoom:t=100,dpr:r=1}=g,l={automatic:i.automatic,window:i.fitToWindow,width:i.fitToWidth},c={automatic:i.automaticHelp,window:i.fitToWindowHelp,width:i.fitToWidthHelp},u="custom"===e?i.fixedZoom:l[e]??i.automatic;return(0,n.createElement)(o.Dropdown,{open:y,onToggle(e){y=e,e&&(v=!1,b="custom"===g.fit),V()},contentClassName:"mtflpp-zoom-popover",focusOnMount:"firstElement",popoverProps:{placement:"top-end",offset:8,shift:!0,resize:!1,role:"dialog","aria-label":i.fitting},renderToggle:({isOpen:e,onToggle:t})=>(0,n.createElement)(o.Button,{className:"mtflpp-zoom-toggle",variant:"secondary",size:"compact",label:u,showTooltip:!0,"aria-label":`${i.fitting}: ${u}`,"aria-haspopup":"dialog","aria-expanded":e,onClick:t,"data-action":"zoom"},(0,n.createElement)("span",{className:"mtflpp-zoom-value"},u),s.chevron),renderContent:()=>(0,n.createElement)("div",{className:"mtflpp-zoom-content"},(0,n.createElement)(o.RadioControl,{label:i.zoomMode,selected:e,options:[...Object.entries(l).map(([e,t])=>({value:e,label:t,description:c[e]})),{value:"custom",label:i.fixedZoom,description:i.fixedZoomHelp}],onFocus(e){if(!b)return;b=!1;const t=e.currentTarget.closest(".mtflpp-zoom-content")?.querySelector('.mtflpp-custom-zoom input[type="number"]');t?.focus({preventScroll:!0});const n=t?.closest(".components-popover__content");if(n){const e=t.getBoundingClientRect(),o=n.getBoundingClientRect();n.scrollTop+=Math.min(0,e.top-o.top)+Math.max(0,e.bottom-o.bottom)}},onChange(e){b=!1,"custom"!==e?a.fit(e):a.zoom(t)}}),"custom"===e&&(0,n.createElement)("div",{className:"mtflpp-custom-zoom",onKeyDown(e){if("Enter"!==e.key)return;e.preventDefault();const t=Number(e.target.value);!1!==e.target.validity?.valid&&Number.isInteger(t)&&t>=10&&t<=400&&O()}},(0,n.createElement)(o.RangeControl,{label:i.customZoom,min:10,max:400,step:1,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:t,help:i.customZoomHelp,withInputField:!0,onChange(e){Number.isInteger(e)&&e>=10&&e<=400&&a.zoom(e)}})),(0,n.createElement)("div",{className:"mtflpp-dpr-note",role:"group","aria-label":i.displayInformation},(0,n.createElement)("span",{className:"mtflpp-dpr-value"},`${i.displayDpr}: ${Number(r.toFixed(2))}`),(0,n.createElement)("span",{className:"mtflpp-pixel-note"},i.pixelZoomHelp)))})}(),f),(0,n.createPortal)(function(){const{empty:e}=g;return e?(0,n.createElement)(o.Placeholder,{className:"mtflpp-placeholder","data-empty-icon":e.busy?void 0:e.icon,icon:e.busy?(0,n.createElement)(o.Spinner):s[e.icon],label:(0,n.createElement)("h3",{className:"mtflpp-empty-title",tabIndex:-1,"data-action":"empty-title"},e.heading),instructions:e.description},e.retry&&(0,n.createElement)(o.Button,{key:"retry",variant:"primary",disabled:e.disabled,onClick:a.retry,"data-action":"retry"},e.action),e.close&&(0,n.createElement)(o.Button,{key:"close",variant:"secondary",onClick:a.close,"data-action":"close"},i.close),e.note&&(0,n.createElement)("p",{className:"mtflpp-empty-note"},e.note)):null}(),m),(0,n.createPortal)(function(){if(!g.notice)return null;if(x){const e=(0,n.createElement)(r.InlineNotices,{context:C,className:"mtflpp-inline-notices"});return M?(0,n.createElement)(M,{cornerRadius:"none"},e):e}const{message:e,...t}=E();return(0,n.createElement)(o.Notice,{...t,onRemove:a.dismissNotice,spokenMessage:"",politeness:"polite"},e)}(),h),e?(0,n.createPortal)((0,n.createElement)(o.Popover.Slot),t.ownerDocument.body):(0,n.createElement)(o.Popover.Slot))}function V(){g&&w&&(function(){if(!x)return;if(!g.notice)return void P();const e=JSON.stringify(g.notice);if(S===e)return;const{message:t,status:n,...o}=E();x.createNotice(n,t,{...o,id:k,context:C,speak:!1,onDismiss:a.dismissNotice}),S=e}(),(0,n.flushSync)(()=>w.render((0,n.createElement)(T))))}function O(){(v||y)&&(v=!1,y=!1,V())}function H(e){g?.inPip&&"mode"===e&&(e="actions"),t.querySelector(`[data-action="${e}"]`)?.focus({preventScroll:!0})}return{update(e){const n=y&&!e.hasPreview&&t.ownerDocument.activeElement?.closest(".mtflpp-zoom-popover");e.hasPreview||(y=!1),g=e,V(),n&&H("empty-title")},closeMenu:O,focus:H,beforeMove(){v=!1,y=!1,w?.unmount(),w=null,P()},remount(){w=(0,n.createRoot)(l),V()}}}(O,i,{refresh:()=>{ue.canRefresh&&h()},retry:()=>{"handover"!==ue.state&&(se||ue.canRetry&&["error","conflict"].includes(ue.state))&&g(se)},dismissNotice:()=>{ye(),Z.textContent=ue.text,I.focus("actions")},mode:Le,close:function(){I.closeMenu(),xe(!1),m(),u||E()?H.focus():d.focus()},popOut:async function(){if(Q||U||x.fullscreenElement===O||!Ee())return;let e;I.closeMenu();const t=()=>{U===e&&(w(),J.beforeMove(),I.beforeMove(),x.body.append(O),O.classList.remove("mtflpp-pip"),U=null,I.remount(),ke(),J.afterMove(),Pe(),Q||(v(),K&&I.focus("mode")))};try{if(e=await b.documentPictureInPicture.requestWindow({width:640,height:440}),!K||Q)return void e.close();const n=b.getComputedStyle(O);e.document.documentElement.lang=x.documentElement.lang,e.document.documentElement.dir=n.direction;for(const t of["--wp-admin-theme-color","--wp-admin-theme-color-darker-10","--wp-admin-border-width-focus"]){const o=n.getPropertyValue(t);o&&e.document.documentElement.style.setProperty(t,o)}const o=x.querySelectorAll(['link[rel="stylesheet"][href*="/load-styles.php"]',"#wp-theme-css","#wp-theme-inline-css","#wp-components-css","#wp-components-inline-css","style[data-emotion]","style[data-wp-hash]","#meet-the-frontend-live-preview-panel-css","#meet-the-frontend-live-preview-panel-inline-css"].join(", "));for(const t of o){const n=t.cloneNode(!0);"STYLE"===t.tagName&&t.sheet&&(n.textContent=Array.from(t.sheet.cssRules,e=>e.cssText).join("\n")),n.addEventListener("load",J.layout,{once:!0}),e.document.head.append(n)}e.document.title=_.textContent,e.document.body.className="mtflpp-pip-document",e.addEventListener("resize",J.layout),e.addEventListener("pagehide",t,{once:!0}),U=e,w(),J.beforeMove(),I.beforeMove(),O.classList.add("mtflpp-pip"),e.document.body.append(O),I.remount(),J.afterMove(),Pe(),ye(),I.focus("mode"),v()}catch{if(e&&(t(),e.close()),Q)return;I.focus("actions"),ve(i.pipFailed)}},fullscreen:async function(){if(!Q&&!U&&x.fullscreenEnabled){I.closeMenu();try{if(await O.requestFullscreen(),Q)return void Oe();ye(),I.focus("mode")}catch{if(Q)return;I.focus("actions"),ve(i.fullscreenFailed)}}},dock:e=>Se(e),reset:()=>Se("right",!0),follow:function(){T=!T,k.set(M,"scrollToChanges",T),Pe(),T&&ue.canRefresh&&h(!1)},rememberVisibility:function(){P=!P,k.set(M,"rememberVisibility",P),P&&xe(K),Pe()},rememberPosition:function(){L=!L,k.set(M,"rememberPosition",L),L?Me():(k.set(M,"position",ne),k.set(M,"layout",void 0)),Pe()},device(e){const t=J.device;if(e===t&&"desktop"===e)return;let n=!1;if(K&&T&&y){const{fit:e,customZoom:t,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:a}=J;n=!!y({canvas:B,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:a,canFollow:()=>J.fit===e&&J.customZoom===t})}const o={animate:K&&!n,keepPan:n};e===t?(J.rotate(o),k.set(M,`${e}Orientation`,J.orientation)):(J.select(e,o),J.device!==t&&k.set(M,"viewport",J.device)),Pe()},fit(e){const t=J.fit;J.setFit(e),J.fit!==t&&k.set(M,"fitMode",J.fit),Pe()},zoom(e){const t=J.fit,n=J.customZoom;J.setZoom(e),J.customZoom!==n&&k.set(M,"customZoom",J.customZoom),J.fit!==t&&k.set(M,"fitMode",J.fit),Pe()}}),be(i.loading,"loading",{canRetry:!1}),ke(),Ve(),u&&(u.disabled=!1),{stage:F,canvasTarget:J.canvasTarget,get visible(){return K},get followChanges(){return T},openFromLauncher:He,setSuspended(e){Q!==e&&(Q=e,Ve(),e?Oe():ke())},setVisible(e){e||(I.closeMenu(),le="",Pe(),J.layout()),K=e,ke(),Ve()},report:be,setTitle:fe,clearPreview(){F.replaceChildren();const e=["ready","stale","loading"].includes(ue.state);be(e?i.loading:ue.text,e?"loading":ue.state,{...ue,hasPreview:!1,hasHtmlPreview:!1,redirectDestination:void 0,canRefresh:!1,canRetry:!e&&ue.canRetry})},returnToEditor:Oe}}function u(e=[]){const t=Array.isArray(e)?[...e]:[],n=new WeakMap;return{capture(e,o){try{if(n.has(e))return;const r=function(e){try{const t=e.querySelector('meta[name="meet-the-frontend-live-preview-panel"]'),n=t?.getAttribute("data-mtflpp-source");if(!n)return null;const o=JSON.parse(n);if("string"!=typeof o)return null;const r=(new DOMParser).parseFromString(o,"text/html");return r.querySelector('meta[name="meet-the-frontend-live-preview-panel"]')?.content===t.content?r:null}catch{return null}}(e);n.set(e,{source:r?M(r,e,t):null,dom:M(e,e,t),values:o&&structuredClone(o)})}catch{}},findChange(e,t){try{const o=n.get(e),r=n.get(t);if(!o||!r)return null;const i=function(e,t){if(!e||!t)return[];const n=[];for(const o of new Set([...Object.keys(e),...Object.keys(t)])){const r=Object.hasOwn(e,o)?e[o]:{type:t[o]?.type,value:""},i=Object.hasOwn(t,o)?t[o]:{type:e[o]?.type,value:""};if(r.type!==i.type||!["text","html"].includes(i.type)||"string"!=typeof r.value||"string"!=typeof i.value||r.value===i.value)continue;let a,s;try{a="html"===r.type?(new DOMParser).parseFromString(r.value,"text/html"):null,s="html"===i.type?(new DOMParser).parseFromString(i.value,"text/html"):null}catch{continue}const l=a?M(a,a,[],a.body):null,c=s?M(s,s,[],s.body):null,u=a?j(l):r.value,d=s?j(c):i.value,f=E(u),p=E(d);if(f!==p&&n.push({...z(f,p),type:"text",fullBefore:f,fullAfter:p}),!a){const e=H(u,d);e&&n.push(e);continue}if(l&&c&&(f===p||P(u,d)))for(const e of S(l,c)){if(e.spacing){const t=O(e);t&&n.push(t);continue}if(f===p)if("attributes"===e.kind){const t=new Map(e.before.attributes),o=new Map(e.after.attributes);for(const e of new Set([...t.keys(),...o.keys()])){const r=t.get(e)??"",i=o.get(e)??"";JSON.stringify(r)!==JSON.stringify(i)&&n.push({type:"attribute",name:e,before:"string"==typeof r?r:JSON.stringify(r),after:"string"==typeof i?i:JSON.stringify(i)})}}else if("content"===e.kind){const t=E(j(e.before)),o=E(j(e.after));t===o&&Y(e.before,e.after,j)&&n.push({type:"markup",before:t,after:o,oldTag:e.before.tag,newTag:e.after.tag}),(e.before.media||[]).forEach((t,o)=>{const r=e.after.media?.[o];t&&r&&t!==r&&n.push({type:"media",before:t,after:r})})}}}return n}(o.values,r.values),a=function(e,t){if(!e||!t)return!1;const n=(e,t)=>Object.entries(e).some(([e,n])=>["text","html","value","row-image"].includes(n?.type)&&(!Object.hasOwn(t,e)||n.type!==t[e]?.type||n.value!==t[e]?.value));return n(e,t)||n(t,e)}(o.values,r.values),s=!!o.source&&!!r.source,l=!!o.source!=!!r.source,c=function(e,t,n){if(!e||!t)return;const o=Object.entries(t).filter(([t,n])=>"row-order"===n?.type&&"row-order"===e[t]?.type&&e[t].value!==n.value);if(1!==o.length)return;const[[r,i]]=o,a=e[r];if(!i.moved||i.members!==a.members)return;const s=JSON.parse(a.value),l=JSON.parse(i.value),c=s.indexOf(i.moved),u=l.indexOf(i.moved);if(-1===c||-1===u||c===u||s.length!==l.length)return;if(s.splice(c,1),l.splice(u,1),!s.every((e,t)=>e===l[t]))return;const d=u-c,f={html:new Map,peerLabels:new Map},p=A(r,i.moved,s,e,t,f),m=function(e,t,n,o,r,i){if([n,...o].some(n=>!e?.[n]||!t?.[n]))return[];const a=new Set(e[n]),s=new Set,l=new Set,c=new Set;for(const[n,a]of[[e,r],[t,i]])for(const e of o.flatMap(e=>n[e])){const t=a[e];"row-image"===t?.type&&(c.add(t.value),l.add(t.alt))}for(const e of t[n]){const t=r[e],n=i[e];if(!a.has(e)||"row-image"!==t?.type||"row-image"!==n?.type||!/^[1-9]\d*$/.test(n.value)||t.value!==n.value||c.has(n.value))continue;const o=n.alt;o?.trim()&&t.alt===o&&!l.has(o)&&s.add(o)}return[...s]}(a.fieldsByRow,i.fieldsByRow,i.moved,s,e,t);let h;if(n&&!p.length&&$(a,i.moved,e,f.html)&&$(i,i.moved,t,f.html)){const n=s.slice(Math.min(c,u),Math.max(c,u));h=[];for(const o of n){const n=A(r,o,[...s.filter(e=>e!==o),i.moved],e,t,f);if(!n.length){h=void 0;break}h.push(n)}}return{offset:d,groups:p,images:m,boundaryGroups:h}}(o.values,r.values,s&&!a&&!R(o.values,r.values)),u=s?S(o.source,r.source,c,!0):[];if(c?.boundaryGroups?.length){const e=u.filter(e=>e.priority>0);if(1===e.length&&e[0].boundary)return function({before:e,after:t,index:n},o){for(const n of[e,t]){let e,t;for(const{node:r}of n){if(!r?.isConnected||e&&e.nextElementSibling!==r)return null;const{position:n,marginTop:i,marginBottom:a}=r.ownerDocument.defaultView.getComputedStyle(r);if(o&&r.closest(o)||!m(r)||!["static","relative"].includes(n)||r.closest("[hidden], details:not([open])")||!1===r.checkVisibility?.({opacityProperty:!0,contentVisibilityAuto:!0}))return null;const s=r.getBoundingClientRect();if(!s.height&&!(parseFloat(i)>0||parseFloat(a)>0))return null;if(t&&(t.bottom>s.top||Math.max(t.left,s.left)>=Math.min(t.right,s.right)))return null;e=r,t=s}}return t[n].node}(e[0].boundary,r.source?.excluded)}if(!l&&!a&&!c){const e=function(e,t){const n=function(e,t){if(!e||!t)return;const n=["row-order","gallery-order","order"],o=[...new Set([...Object.keys(e),...Object.keys(t)])].filter(o=>(n.includes(e[o]?.type)||n.includes(t[o]?.type))&&e[o]?.value!==t[o]?.value);if(1!==o.length)return;const r=e[o[0]],i=t[o[0]];if("gallery-order"!==r?.type||"gallery-order"!==i?.type)return;const a=JSON.parse(r.value),s=JSON.parse(i.value);if(new Set(a).size!==a.length||new Set(s).size!==s.length)return;const l=new Map(a.map((e,t)=>[e,t])),c=s.map(e=>l.get(e));return a.length&&s.length&&c.every(e=>void 0===e)?void 0:{oldCount:a.length,matches:c}}(e.values,t.values);if(!n)return;const o=e.source??e.dom,r=t.source??t.dom,i=function(e,t,{oldCount:n,matches:o}){const r=[];function i(e,t){return e.signature===t.signature&&e.presentation===t.presentation}function a(e,t){return i(e,t)&&e.rawText===t.rawText&&e.children.length===t.children.length&&e.children.every((e,n)=>a(e,t.children[n]))}function s(e,t){if(e.children.length!==n||t.children.length!==o.length||e.rawText!==t.rawText&&(e.text||t.text))return!1;const i=b(e),s=b(t);if(!i||!s)return!1;const l=i.map(x),c=s.map(x),u=new Set(l);return!(u.size!==l.length||new Set(c).size!==c.length||l.length===c.length&&l.every((e,t)=>e===c[t])||!o.every((n,o)=>void 0===n?!u.has(c[o]):l[n]===c[o]&&a(e.children[n],t.children[o]))||(r.push({before:e,after:t,original:i,current:s}),0))}return e&&t&&function e(t,n){return!!i(t,n)&&(!!s(t,n)||t.rawText===n.rawText&&t.children.length===n.children.length&&t.children.every((t,o)=>e(t,n.children[o])))}(e,t)?r:null}(o,r,n);if(!i?.length)return;const a=i.map(e=>e.after);let[s]=a;for(;s&&!a.every(e=>e===s||Q(s,e));)s=s.parent;const l=e=>["main","body","html"].includes(e.tag)||e.attributes.some(([e,t])=>"role"===e&&"main"===t);if(!s?.parent||l(s)||!function(e,t){if(1===t.length)return!0;const n=new Set(t);let o=0;return function e(t){return n.has(t)?(o++,!0):!!g(t)||!w(t)&&("hr"!==t.tag||0===o||o===n.size)&&t.parts.every(t=>"string"==typeof t?0===o||o===n.size||!t.trim():e(t))}(e)&&o===n.size}(s,a))return null;let c=s.node;if(!c?.isConnected||a.some(({node:e})=>!c.contains(e)||r.excluded&&e.closest(r.excluded)))return null;if(t.source&&(!y(e.dom,i,"before","original")||!y(t.dom,i,"after","current")))return null;const u=c.ownerDocument.defaultView;for(let e=s,t=e.parent;t?.parent&&!l(t)&&!t.children.some(t=>t!==e&&v(t));e=t,t=t.parent){const e=t.node;if(!e?.contains(c))continue;const{overflowX:n,overflowY:o}=u.getComputedStyle(e),r=/^(?:auto|scroll|hidden)$/;(e.scrollWidth>e.clientWidth&&r.test(n)||e.scrollHeight>e.clientHeight&&r.test(o))&&(c=e)}return!m(c)||c.closest("[hidden], details:not([open])")||r.excluded&&c.closest(r.excluded)?null:c}(o,r);if(void 0!==e)return e}const C=[...u.map(e=>({...e,source:!0})),...S(o.dom,r.dom,c)],k=new Map,T=function(e,t){const n=new Map,o=e=>j(e,n),r=[];for(const n of e){if(n.unresolved)for(const e of d(n,t,o))r.push(e);if("insert"===n.kind&&n.added.length>1){const e=n.added.map(e=>{const r={...n,after:e,added:[e]},i=K(r,t,o);return{...r,input:i}}).filter(e=>e.input);if(e.length){r.push(...e);continue}}const e=K(n,t,o);r.push({...n,input:e})}return r}(C,i).filter(e=>(e.priority>0||e.input)&&(!e.spacing||function({before:e,after:t},n,o){const r=L(e,n,o),i=L(t,n,o);return r&&i&&r.omitted===i.omitted&&P(r.text,i.text)}(e,k,r.dom?.excluded))),V=s&&a&&!T.some(e=>e.source);return function(e,t){if(!e.length)return null;const n=e.reduce((e,t)=>Math.max(e,t.input),0),o=e.filter(e=>e.input===n),r=o.reduce((e,t)=>Math.max(e,t.priority),0),i=o.filter(e=>e.priority===r);if(t.rowMove&&!n||i.some(e=>e.unresolved))return function(e,{rowMove:t,excluded:n,canFollowLiveReorder:o,canFollowLiveMove:r}){if(t){const t=e.find(e=>e.moved&&(e.source||r)),o=t?.moved.node;return o?.isConnected&&t.after.node?.contains(o)&&e.every(e=>e===t||t.source&&!e.source&&(e.moved||"reorder"===e.regionChange))?"contents"!==o.ownerDocument.defaultView.getComputedStyle(o).display?o:f(t.moved,e=>o.contains(e)&&(!n||!e.closest(n))&&m(e)):null}const i=e.find(e=>e.unresolved&&("replacement"===e.regionChange||"reorder"===e.regionChange&&(e.source||o))),a=i?.after.node;if(!a?.isConnected)return null;for(const t of e)if(t.unresolved){if(i.source&&!t.source&&"reorder"===t.regionChange)continue;if(!t.regionChange||t.after.node!==a)return null}else if(!("insert"===t.kind?t.added:[t.after]).every(e=>a.contains(e.node)))return null;return"contents"!==a.ownerDocument.defaultView.getComputedStyle(a).display?a:null}(i,t);const a=i.filter(e=>!e.input||e.directInput||!i.some(t=>t!==e&&e.matches?.length&&e.matches.every(e=>t.matches?.includes(e))&&Q(e.after,t.after))),s=new Map,l=a.filter(e=>{const t="delete"===e.kind&&(e.following[0]||e.preceding[0])||e.after,n=t?.node;if(!n)return!0;const o="delete"!==e.kind||e.following.length?e.kind:"delete-last",r=s.get(n)||new Set;return!r.has(o)&&(r.add(o),s.set(n,r),!0)});return n&&s.size>1?null:function(e){const t=new Set,n=new Set;for(const o of e){let e,r=!1;"delete"===o.kind?(r=!o.removed.some(h),e=r?o.after:o.following.find(h)||o.preceding.find(h)||o.following.find(p)||o.preceding.find(p)||o.after):e="insert"===o.kind?o.added.find(h)||o.added.find(p):o.after;const i=p(e);if(!i)continue;const a=h(e),s=a||i;(a&&!r?t:n).add(s)}const o=t.size?t:n;return 1===o.size?o.values().next().value:null}(l)}(T.filter(e=>e.source||e.input||!s&&!l||V&&("insert"===e.kind||"delete"===e.kind)),{rowMove:!!c,excluded:r.source?.excluded??r.dom?.excluded,canFollowLiveReorder:!s&&(a||R(o.values,r.values)),canFollowLiveMove:!s&&!l})}catch{return null}}}}function d(e,t,n){const o=[];for(const r of t){if(!r.after||"spacing"===r.type)continue;const t=U(e.oldRange,r.before,n,r,!0),i=U(e.newRange,r.after,n,r,!1);if(!t.length)continue;const a="markup"===r.type&&r.oldTag===r.newTag;if(a||!r.before||!(t.length<=U(e.newRange,r.before,n,r,!0).length||i.length<=U(e.oldRange,r.after,n,r,!1).length))for(const s of i)a&&!t.some(e=>Y(e,s,n))||o.push({...e,unresolved:!1,before:null,after:s,kind:"content",input:r.before&&r.after?2:1,priority:2,matches:[r]})}return o}function f(e,t){if(e?.node&&t(e.node))return e.node;for(const n of e?.children||[]){const e=f(n,t);if(e)return e}return null}function p(e){return f(e,()=>!0)}function m(e){return e.getClientRects().length&&"visible"===e.ownerDocument.defaultView.getComputedStyle(e).visibility}function h(e){return f(e,m)}function g(e){return/^(?:button|input|select|textarea)$/.test(e.tag)||e.attributes.some(([e,t])=>"role"===e&&"button"===t)}function w(e){return/^(?:img|video|audio|iframe|canvas|object|embed)$/.test(e.tag)||e.media?.some(Boolean)}function v(e){return!g(e)&&(e.text||w(e)||"hr"===e.tag||e.children.some(v))}function y(e,t,n,o){const r=new Map(t.map(e=>[e[n].node,e[o]]));return!(!e||r.has(null)||r.size!==t.length)&&(function e(t){const n=r.get(t.node);if(!n)return t.children.every(e);r.delete(t.node);const o=new Map,i=new Map;n.forEach((e,t)=>{e.marker&&o.set(e.marker,t),i.set(x(e),t)});const a=[],s=new Map;if(!function e(t,r=!1){if(r||=t.attributes.some(([e,t])=>"inert"===e||"aria-hidden"===e&&"true"===t),"img"!==t.tag)return t.children.every(t=>e(t,r));const l=o.get(t.marker)??i.get(x(t));return!(!n[l]||!t.media.slice(0,2).some((e,t)=>e&&e===n[l].media[t])||(a.push({index:l,cloneHidden:r}),s.set(l,(s.get(l)??0)+1),0))}(t))return!1;const l=a.filter(({index:e,cloneHidden:t})=>!t||1===s.get(e));return l.length===n.length&&l.every(({index:e},t)=>e===t)}(e)&&!r.size)}function b(e){const t=e.children.map(function e(t){return"img"===t.tag?[t]:t.children.flatMap(e)});return t.some(e=>1!==e.length||!e[0].media?.slice(0,2).some(Boolean))?null:t.map(([e])=>e)}function x(e){return JSON.stringify(e.media.slice(0,2))}function M(e,t,n,o=e.querySelector('main, [role="main"]')||e.querySelector("article")||e.body){if(!o)return null;const r=n.filter(e=>{if("string"!=typeof e||!e.trim())return!1;try{return o.matches(e),!0}catch{return!1}}).join(", "),i=new Map,a=new Map;if(e!==t)for(const e of t.querySelectorAll("[data-mtflpp-node]")){const t=e.getAttribute("data-mtflpp-node");a.set(t,a.has(t)?null:e)}for(const n of[o,...o.querySelectorAll("*")]){if(r&&n.closest(r))continue;const o=[...n.childNodes].filter(e=>3===e.nodeType).map(e=>e.textContent),s=E(o.join(" ")),l=["img","source","video","audio","iframe"].includes(n.localName)?["src","srcset","poster"].map(e=>n.getAttribute(`data-${e}`)||n.getAttribute(e)||""):[],c=n.style?.backgroundImage||n.getAttribute("data-bg")||"",u=n.getAttribute("data-mtflpp-node"),d=e===t?n:a.get(u)||null,f=C(n,d,JSON.stringify([n.localName,s,l,c]));"img"===n.localName&&(f.marker=u),f.text=s,f.rawText=o.join(""),f.media=[...l,c],f.parent=i.get(n.parentElement),i.set(n,f),f.parent?.children.push(f)}for(const[e,t]of i)t.parts=[...e.childNodes].map(e=>3===e.nodeType?e.textContent:i.get(e)).filter(e=>void 0!==e);let s=i.get(o);if(!s)return null;const l=s.node;for(let e=o.parentElement;e;e=e.parentElement){const t=C(e,l,e.localName);t.children=[s],t.parts=[s],s=t}return s.excluded=r,s}function C(e,t,n){const o=function(e){const t=[];for(const{name:n,value:o}of e.attributes){if("data-mtflpp-node"===n||n.startsWith("on")||/(?:^|-)(nonce|token)(?:-|$)/.test(n))continue;if(/^(?:data-)?(?:src|srcset|poster|sizes|bg)$/.test(n))continue;let r=o;"class"===n&&(r=[...e.classList].sort().join(" ")),"style"===n&&(r=[...e.style].sort().map(t=>[t,e.style.getPropertyValue(t),e.style.getPropertyPriority(t)])),("class"!==n&&"style"!==n||r.length)&&t.push([n,r])}return t.sort(([e],[t])=>e.localeCompare(t))}(e);return{node:t,tag:e.localName,signature:n,attributes:o,children:[],parts:[],presentation:JSON.stringify(o.filter(([e])=>!k(e))),references:JSON.stringify(o.filter(([e])=>k(e)))}}function k(e){return["id","for","headers","aria-controls","aria-labelledby","aria-describedby","aria-owns","aria-flowto","aria-activedescendant","aria-details","aria-errormessage"].includes(e)}function S(e,t,n,o=!1){const r=new Map,i=new Map,a=new Map,s=new Map,l=[];let c,u;function d(o,r,i,a=[]){const s=(e,t)=>e===t||Q(e,t);let l=!1;if(a.length){u??=[_(e,new Set(a)),_(t,new Set(a))];const n=(e,t,n)=>t.node?.isConnected&&e.node?.contains(t.node)&&"img"===t.node.localName&&(!n||!t.node.closest(n));for(const i of a){const a=u[0].get(i),c=u[1].get(i);if(a&&c){if(!s(o,a)||!s(r,c))return!1;l||=n(o,a,e.excluded)&&n(r,c,t.excluded)}}}if(!i.length)return l;if(!c){const o=new Set((n.boundaryGroups??[n.groups]).flat(2));c=[W(e,o),W(t,o)]}const[d,f]=c,p=new Map;for(const e of i.flat()){const t=d.get(e),n=f.get(e);if(t&&n){if(!s(o,t.entry)||!s(r,n.entry))return!1;p.set(e,t.substantive&&n.substantive)}}return l||i.some(e=>e.every(e=>p.has(e))&&e.some(e=>p.get(e)))}function f(e){const t=JSON.stringify(e);return r.has(t)||r.set(t,r.size+1),r.get(t)}function p(e){if(!e)return 0;const t=f([e.signature,e.children.map(p)]);return i.set(e,t),a.set(e,f([t,e.presentation,e.children.map(e=>a.get(e))])),s.set(e,f([t,e.presentation,e.references,e.children.map(e=>s.get(e))])),t}p(e),p(t);const m=e=>i.get(e);function h(e){const t=e.attributes.find(([e])=>"id"===e)?.[1];return t?`${e.tag} ${t}`:void 0}function g(e){if(!(e.children.length<2))return f(["collection",e.signature,e.children.map(m).sort((e,t)=>e-t)])}function w(e,t){const n=new Map;return e.forEach((e,o)=>{const r=t(e);void 0!==r&&n.set(r,n.has(r)?-1:o)}),n}return function e(t,r){t&&r&&(t.signature!==r.signature?l.push({kind:"content",before:t,after:r,priority:2}):t.rawText!==r.rawText&&l.push({kind:"content",before:t,after:r,priority:2,spacing:!0}),t.presentation===r.presentation&&t.references===r.references||l.push({kind:"attributes",before:t,after:r,priority:t.presentation!==r.presentation?1:0}),function(t,r,c,u){const f=u.parent&&c.parent&&u.tag===c.tag,p=w(t,m),v=w(r,m);let y,b,x,M;const C=new Set(t.flatMap(e=>[a.get(e),s.get(e)])),k=new Set(r.flatMap(e=>[a.get(e),s.get(e)]));function S(e,t,n){const o=n.get(e),r=n.get(t);return o===r||!k.has(o)&&!C.has(r)}function E(e,t){return i.get(e)===i.get(t)&&S(e,t,a)&&S(e,t,s)}function P(e,n,o,a,s,c,d){const m=t.slice(e,n),h=r.slice(o,a),g="replacement"===s&&f&&m.some(e=>!v.has(i.get(e)))&&h.some(e=>!p.has(i.get(e)))&&(!function(e,t){if(e.length<2||t.length<2)return!1;const n=e.filter(e=>e.children.length).length,o=t.filter(e=>e.children.length).length;if(!n&&!o||n>1&&o>1)return!0;const r=new Map;for(const{tag:e}of t)r.set(e,(r.get(e)||0)+1);let i=0;for(const{tag:t}of e){const e=r.get(t);if(e){if(2===++i)return!0;r.set(t,e-1)}}return!1}(m,h)||"form"===u.tag&&function(e,t){function n(e){const t=new Set;return e.every(function e(n){if(["input","select","textarea"].includes(n.tag)){const e=n.attributes.find(([e])=>"name"===e)?.[1],o=n.attributes.find(([e])=>"type"===e)?.[1]?.toLowerCase();return!(!e||"input"===n.tag&&"hidden"===o||(t.add(e),0))}let o=!1;for(const t of n.children)e(t)&&(o=!0);return o})?t:null}const o=n(e),r=n(t);return o&&r&&[...o].some(e=>!r.has(e))&&[...r].some(e=>!o.has(e))}(m,h)),w=f&&("reorder"===s||g)?s:void 0;l.push({kind:"region",after:u,priority:2,unresolved:!0,regionChange:w,oldRange:m,newRange:h,moved:c,boundary:d})}function L(e,n,o,r,i,a,s){const l=[];for(let c=e;c<n;c++){const e=s(t[c]),n=a.get(e);if(!(i.get(e)!==c||void 0===n||n<o||n>=r)){if(l.length&&n<=l[l.length-1][1])return null;l.push([c,n])}}return l}!function s(c,C,k,S){for(;c<C&&k<S&&E(t[c],r[k]);)e(t[c],r[k]),c++,k++;for(;c<C&&k<S&&E(t[C-1],r[S-1]);)C--,S--,e(t[C],r[S]);if(c===C&&k===S)return;if(c===C||k===S){const e=k===S,n=e?t.slice(c,C):r.slice(k,S),o=e?[r[k-1],r[k]]:[t[c-1],t[c]];return void(n.some(e=>o.some(t=>t&&i.get(t)===i.get(e)))?P(c,C,k,S):e?l.push({kind:"delete",after:u,removed:n,priority:2,following:r.slice(k),preceding:r.slice(0,k).reverse()}):l.push({kind:"insert",after:n[0],added:n,priority:2}))}if(C-c===1&&S-k===1)return void e(t[c],r[k]);const T=function(e,i,a,s){if(!(n?.groups.length||o&&(n?.boundaryGroups||n?.images.length)))return;const l=Math.abs(n.offset)+1;if(i-e!==l||s-a!==l)return;const c=n.offset>0,u=c?0:l-1,d=c?l-1:0,f=t.slice(e,i),p=r.slice(a,s),m=c?l-1:1,h=f.map((e,t)=>[e,p[(t+m)%l]]);return{before:f,after:p,from:u,to:d,pairs:h}}(c,C,k,S),V=T&&function(e){const t=o?n.images:[];if(!n.groups.length&&!t.length)return;const[r,i]=e.pairs[e.from],a=m(r);return-1!==p.get(a)&&-1!==v.get(a)&&e.pairs.every(([e,t])=>E(e,t))&&d(r,i,n.groups,t)?i:void 0}(T),O=T&&function(e){if(o&&n.boundaryGroups&&N(e.before[e.from])&&e.pairs.every(([e,t])=>a.get(e)===a.get(t)))return e.pairs.filter((t,n)=>n!==e.from).every(([e,t],o)=>d(e,t,n.boundaryGroups[o]))?{before:e.before,after:e.after,index:e.to||1}:void 0}(T);if(V||O||f&&function(e,n,o,a){const s=n-e;if(s<2||s!==a-o)return!1;const l=new Map;let c=!1;for(let n=0;n<s;n++){const a=i.get(t[e+n]),s=i.get(r[o+n]);c||=a!==s,l.set(a,(l.get(a)||0)+1),l.set(s,(l.get(s)||0)-1)}return c&&[...l.values()].every(e=>0===e)}(c,C,k,S)){if(O)for(const[t,n]of T.pairs)e(t,n);return void P(c,C,k,S,"reorder",V,O)}let H=L(c,C,k,S,p,v,m);if(0===H?.length&&(y??=w(t,h),b??=w(r,h),H=L(c,C,k,S,y,b,h)),0===H?.length&&(x??=w(t,g),M??=w(r,g),H=L(c,C,k,S,x,M,g)),H?.length)for(const[n,o]of[...H,[C,S]])s(c,n,k,o),n<C&&e(t[n],r[o]),c=n+1,k=o+1;else P(c,C,k,S,H?"replacement":void 0)}(0,t.length,0,r.length)}(t.children,r.children,t,r))}(e,t),l}function E(e){return e.replace(/\s+/g," ").trim()}function P(e,t){return e!==t&&e.replace(/\s/g,"")===t.replace(/\s/g,"")}function L(e,t,n){for(;e.node?.isConnected&&e.parent?.node;){const{display:t}=e.node.ownerDocument.defaultView.getComputedStyle(e.node);if("inline"!==t&&"contents"!==t)break;e=e.parent}if(!t.has(e)){const{node:o}=e,r=[],i=o?.isConnected&&T(o,n,r)===V(e)&&h(e)?o.innerText:void 0;t.set(e,"string"==typeof i?{text:i,omitted:JSON.stringify(r)}:void 0)}return t.get(e)}function T(e,t,n){return t&&e.querySelector(t)?[...e.childNodes].map(e=>3===e.nodeType?e.textContent:1!==e.nodeType?"":e.matches(t)?(n.push(e.textContent),""):T(e,t,n)).join(""):e.textContent}function V(e){return e.parts.map(e=>"string"==typeof e?e:V(e)).join("")}function O({before:e,after:t}){return H(e.rawText,t.rawText)||H(V(e),V(t))}function H(e,t){if(!/\S/.test(e)||!P(e,t))return;const n=e.match(/\s+|\S+/g),o=t.match(/\s+|\S+/g);let r=0,i=0;for(;r<Math.min(n.length,o.length)&&n[r]===o[r];)r++;for(;i<Math.min(n.length,o.length)-r&&n.at(-1-i)===o.at(-1-i);)i++;const a=Math.max(0,r-1),s=Math.max(0,i-1);return{type:"spacing",before:n.slice(a,n.length-s).join(""),after:o.slice(a,o.length-s).join("")}}function j(e,t=new Map){return e?(t.has(e)||t.set(e,(e.parts||[]).map(e=>{if("string"==typeof e)return e;const n=j(e,t);return/^(?:p|div|section|article|main|aside|header|footer|nav|h[1-6]|li|[ou]l|d[ldt]|blockquote|pre|table|tr|t[dh]|caption|figure|figcaption|br|hr)$/.test(e.tag)?` ${n} `:n}).join("")),t.get(e)):""}function R(e,t){return!!e&&!!t&&Object.entries(t).some(([t,n])=>{if(!["order","gallery-order"].includes(n?.type)||!Object.hasOwn(e,t))return!1;const o=e[t];return o?.type===n.type&&o.members===n.members&&o.value!==n.value})}function $(e,t,n,o){return e.fieldsByRow?.[t]?.every(e=>""===F(n[e],o)?.label)}function N(e){return!e.text&&!e.media?.some(Boolean)&&!/^(?:a|button|input|select|textarea|form|details|img|video|audio|iframe|canvas|svg|object|embed)$/.test(e.tag)&&e.children.every(N)}function _(e,t){const n=new Map;return e&&function e(o){if("img"===o.tag){const e=o.attributes.find(([e])=>"alt"===e)?.[1];t.has(e)&&n.set(e,n.has(e)?null:o)}o.children.forEach(e)}(e),n}function A(e,t,n,o,r,{html:i,peerLabels:a}){const{fieldsByRow:s}=r[e],l=o[e].fieldsByRow;if([t,...n].some(e=>!l?.[e]||!s?.[e]))return[];const c=[],u=new Set(l[t]);let d;function f(e,t){if(a.has(e))return a.get(e);const n=new Set;function o(e,t){n.add(E(j(e,t)));for(const n of e.children)o(n,t)}for(const r of e){if("row-image"===t[r]?.type)continue;const e=B(t[r],i);if(!e.length)return null;for(const t of e)t.entry?o(t.entry,t.cache):n.add(t.label)}return a.set(e,n),n}function p(e,t){return d??=n.flatMap(e=>[f(l[e],o),f(s[e],r)]),d.some(n=>!n||n.has(e)||t.length&&t.every(e=>n.has(e)))}for(const e of s[t]){const t=r[e],n=o[e];if(u.has(e)&&t&&n?.type===t.type&&n?.value===t.value)for(const{entry:e,cache:o,label:r}of B(t,i,n.formatted===t.formatted)){if(!r)continue;if(!e){p(r,[])||c.push([r]);continue}const t=D(e,o).map(e=>E(j(e,o))),n=W(e,new Set([r,...t]),o);n.get(r)?.substantive&&!p(r,t.join(" ")===r?t:[])&&c.push([r]);const i=[...new Set(t.filter(e=>n.has(e)))];i.length>1&&i.some(e=>n.get(e).substantive)&&!p(r,i)&&c.push(i)}}return c}function B(e,t,n=!0){const o=F(e,t);if(!o)return[];const r=n&&"html"===e.type&&"string"==typeof e.formatted?F({type:"html",value:e.formatted},t):null;return r?[o,r]:[o]}function F(e,t){if("string"==typeof e?.value){if("text"===e.type)return{label:E(e.value)};if("html"===e.type){if(!t.has(e.value))try{const n=(new DOMParser).parseFromString(e.value,"text/html"),o=M(n,n,[],n.body),r=new Map;t.set(e.value,{entry:o,cache:r,label:E(j(o,r))})}catch{t.set(e.value,null)}return t.get(e.value)}}}function D(e,t){const n=e.children.flatMap(e=>D(e,t));return n.length||!/^(?:p|h[1-6]|li|d[dt]|blockquote|pre|figcaption)$/.test(e.tag)?n:E(j(e,t))?[e]:[]}function q(e,t,n){let o;(e.text===t||/[\p{L}\p{N}]/u.test(e.text||""))&&(o=function(e,t){let n="content";for(let o=e;o;o=o.parent){const r=o.attributes.find(([e])=>"role"===e)?.[1]??"";if("button"===o.tag||/(?:^|\s)button(?:\s|$)/.test(r))return;if("a"!==o.tag&&!/(?:^|\s)link(?:\s|$)/.test(r))continue;const i=D(o,t);if(i.length<2||!i.some(e=>/^h[1-6]$/.test(e.tag)))return;const a=i.find(t=>t===e||Q(t,e));if(!a)return;/^h[1-6]$/.test(a.tag)||(n="support")}return n}(e,n));for(const r of e.children){if("content"===o)break;o=q(r,t,n)||o}return o}function W(e,t,n=new Map){const o=new Map;e&&function e(r){const i=E(j(r,n));if(t.has(i)){const e=o.get(i);o.set(i,void 0===e||e&&Q(e,r)?r:null)}r.children.forEach(e)}(e);const r=new Map;for(const[e,t]of o){const o=t&&q(t,e,n);o&&r.set(e,{entry:t,substantive:"content"===o})}return r}function z(e,t){let n=0,o=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;for(;o<e.length-n&&o<t.length-n&&e[e.length-o-1]===t[t.length-o-1];)o++;let r=e.length-o,i=t.length-o;for(;n>0&&/\S/.test(e[n-1]);)n--;if(r>n&&/\S/.test(e[r-1]))for(;r<e.length&&/\S/.test(e[r]);)r++;if(i>n&&/\S/.test(t[i-1]))for(;i<t.length&&/\S/.test(t[i]);)i++;return{before:e.slice(n,r).trim(),after:t.slice(n,i).trim()}}function Z(e,t){return t?I(e,t):""===E(e)}function I(e,t){return J(e,t,1)>0}function J(e,t,n=1/0){if(!t)return 0;let o=0,r=(e=E(e)).indexOf(t);for(;-1!==r;){const i=r+t.length;if(G(e,r)&&G(e,i)&&++o===n)break;r=e.indexOf(t,r+1)}return o}function G(e,t){return!/[\p{L}\p{N}_]$/u.test(e.slice(Math.max(0,t-2),t))||!/^[\p{L}\p{N}_]/u.test(e.slice(t,t+2))}function X(e,t,n,o=!1){const r=E(e),i=E(t);if(r===i)return!1;if(r===n.before&&i===n.after||r===n.fullBefore&&i===n.fullAfter)return!0;if(o){const e=z(r,i);if(e.before===n.before&&e.after===n.after)return!0;if(function(e,t,n,o){if(!n||!o||e.length-n.length!==t.length-o.length)return!1;for(let r=e.indexOf(n);-1!==r;r=e.indexOf(n,r+1))if(t.startsWith(o,r)&&G(e,r)&&G(t,r)&&G(e,r+n.length)&&G(t,r+o.length)&&e.slice(0,r)===t.slice(0,r)&&e.slice(r+n.length)===t.slice(r+o.length))return!0;return!1}(r,i,n.fullBefore,n.fullAfter))return!0}return(n.before?J(r,n.before)>J(i,n.before):!r)&&(n.after?J(i,n.after)>J(r,n.after):!i)}function Y(e,t,n){return e.tag!==t.tag||(e.children.length||t.children.length)&&e.text!==t.text&&E(n(e))===E(n(t))}function U(e=[],t,n,o,r){return e.flatMap(e=>{const i=U(e.children,t,n,o,r);let a;return a="media"===o.type?e.media?.includes(t):"attribute"===o.type?e.attributes.some(([e,n])=>e===o.name&&I("string"==typeof n?n:JSON.stringify(n),t)):("markup"!==o.type||e.tag===(r?o.oldTag:o.newTag))&&Z(n(e),t),"text"===o.type&&i.length?i:[...a?[e]:[],...i]})}function K(e,t,n){if(e.unresolved)return 0;if(e.matches=[],e.spacing){const n=t.filter(e=>"spacing"===e.type),o=n.length&&O(e);return e.matches=n.filter(e=>o?.before===e.before&&o?.after===e.after),e.matches.length?2:0}let o=0;for(const r of t){if("spacing"===r.type)continue;let t=0;if("attributes"===e.kind){if(!["text","attribute"].includes(r.type))continue;const n=new Map(e.before.attributes),o=new Map(e.after.attributes);for(const e of new Set([...n.keys(),...o.keys()])){if("attribute"===r.type&&e!==r.name)continue;const i=n.get(e),a=o.get(e);JSON.stringify(i)!==JSON.stringify(a)&&(X("string"==typeof i?i:JSON.stringify(i)||"","string"==typeof a?a:JSON.stringify(a)||"",r)&&(t="attribute"===r.type||r.before&&r.after?2:1))}}else if("insert"===e.kind)!r.before&&e.added.some(e=>I(n(e),r.after))&&(t=Math.max(t,1));else if("delete"===e.kind)!r.after&&e.removed.some(e=>I(n(e),r.before))&&(t=Math.max(t,1));else if("media"===r.type)(e.before?.media||[]).some((t,n)=>t===r.before&&e.after?.media?.[n]===r.after)&&(t=2);else if("markup"===r.type)e.before?.tag===r.oldTag&&e.after?.tag===r.newTag&&Y(e.before,e.after,n)&&Z(n(e.before),r.before)&&Z(n(e.after),r.after)&&(t=r.before&&r.after?2:1);else if("text"===r.type){const o=!(!r.before||!r.after),i=o&&X(e.before?.text||"",e.after?.text||"",r,!0);(i||X(n(e.before),n(e.after),r,o))&&(t=o?2:1,i&&(e.directInput=!0))}t&&e.matches.push(r),o=Math.max(o,t)}return o}function Q(e,t){return!!e?.children.some(e=>e===t||e.node&&e.node===t?.node||Q(e,t))}const ee=new Set(["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","PageDown","PageUp","Home","End"," "]);function te(e,t){let n;for(const o of e?.rects??[]){const e=t(o);if(e.visible)return e;(!n||e.distance<n.distance)&&(n=e)}return n}function ne(e){return new Promise(t=>{const n=()=>{e.clearTimeout(o),e.cancelAnimationFrame(r),t()},o=e.setTimeout(n,100);let r=e.requestAnimationFrame(()=>{r=e.requestAnimationFrame(n)})})}function oe(e,t=!1){if(!ue(e,{visibilityProperty:!0,opacityProperty:!0}))return;const{left:n,right:o,top:r,bottom:i,width:a,height:s}=e.getBoundingClientRect();if(!(t||a&&s))return;const l=e.ownerDocument,{documentElement:c,body:u,defaultView:d}=l,f={left:n,right:a?o:n+1,top:r,bottom:s?i:r+1},p={...f},m={x:f.right-f.left,y:f.bottom-f.top},h="visible"===d.getComputedStyle(c).overflow,g=d.getComputedStyle(e);for(let n=e;n&&n!==c;){const o=n===e?g:d.getComputedStyle(n),{position:r,display:i,overflowX:a,overflowY:s}=o;if(n!==e&&(n!==u||!h)&&"inline"!==i&&("visible"!==a||"visible"!==s)&&n.offsetWidth&&n.offsetHeight){const{bounds:e,scaleX:r,scaleY:i}=ce(n,o);for(const[l,c,u,d,h]of[["x",a,"left","right",r],["y",s,"top","bottom",i]]){if("visible"===c)continue;const r="clip"===c?[0,0]:le(n,o,l,h),i=t&&"hidden"===c,a="y"===l==("horizontal-tb"===o.writingMode);if(i&&r.some(e=>e)&&(a||f[u]<e[u]||f[d]>e[d]||re(o,g,l)))return{boundary:n};if(!se(f,p,e,u,d,i?[0,0]:r))return{boundary:n};m[l]=Math.min(m[l],p[d]-p[u])}}n="absolute"===r||"fixed"===r?n.offsetParent:n.parentElement}return{clipped:f,extent:m}}function re(e,t,n){const o=e=>e&&"auto"!==e&&0!==parseFloat(e);return("x"===n?["Left","Right"]:["Top","Bottom"]).some(n=>o(e[`scrollPadding${n}`])||o(t[`scrollMargin${n}`]))}function ie(e,t,n=!1){const o=oe(e,n);if(!o?.clipped)return;const{clipped:r,extent:i}=o,{ownerDocument:a}=e,s=a.documentElement;if(r.left=Math.max(s.clientLeft,r.left),r.right=Math.min(s.clientLeft+s.clientWidth,r.right),r.top=Math.max(0,r.top),r.bottom=Math.min(s.clientHeight,r.bottom),r.right<=r.left)return{rects:[]};const l=t?.({...r,top:0,bottom:s.clientHeight}),c=l?.visibleCenterX??(r.left+r.right)/2,u=ge(e,c);if(r.bottom<=r.top)return{rects:[],header:u?.bottom};const d={rects:[r],inViewport:!0,extent:i};if(!u)return d;const f={left:Math.max(r.left,u.left),right:Math.min(r.right,u.right),top:Math.max(r.top,u.top),bottom:Math.min(r.bottom,u.bottom)};if(!ae(f)||!u.node.contains(a.elementFromPoint(c,(f.top+f.bottom)/2)))return d;const p=[{...r,top:f.bottom},{...r,bottom:f.top},{...f,left:r.left,right:f.left},{...f,left:f.right,right:r.right}].filter(ae);return!p.length&&u.bottom>=s.clientHeight&&u.top<=0?void 0:{rects:p,inViewport:!0,extent:i,header:u.bottom}}function ae({left:e,right:t,top:n,bottom:o}){return t>e&&o>n}function se(e,t,n,o,r,[i,a]){return e[o]=Math.max(e[o],n[o]),e[r]=Math.min(e[r],n[r]),t[o]=Math.max(n[o],t[o]+i),t[r]=Math.min(n[r],t[r]+a),t[r]>t[o]}function le(e,t,n,o){const r="x"===n,i=r?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight;if(i<=0)return[0,0];const a=r?e.scrollLeft:e.scrollTop,s=t.display.endsWith("flex")&&t.flexDirection===(r?"row-reverse":"column-reverse"),l=(r&&"rtl"===t.direction)!==s;let c=l?-i:0,u=l?0:i;return("horizontal-tb"!==t.writingMode||a<c||a>u)&&(c=-i,u=i),[(a-u)*o,(a-c)*o]}function ce(e,t){const n=e.getBoundingClientRect(),o=n.width/e.offsetWidth,r=n.height/e.offsetHeight,i=n.left+e.clientLeft*o,a=n.top+e.clientTop*r,s={left:i,top:a,right:i+e.clientWidth*o,bottom:a+e.clientHeight*r},l=t.overflowClipMargin;if("clip"!==t.overflowX&&"clip"!==t.overflowY||!l||"0px"===l)return{bounds:s,scaleX:o,scaleY:r};const c=l.split(" ").map(parseFloat).find(Number.isFinite)??0,u=l.includes("border-box")?n:s,d=l.includes("content-box");return{scaleX:o,scaleY:r,bounds:{left:u.left+((d?parseFloat(t.paddingLeft):0)-c)*o,right:u.right-((d?parseFloat(t.paddingRight):0)-c)*o,top:u.top+((d?parseFloat(t.paddingTop):0)-c)*r,bottom:u.bottom-((d?parseFloat(t.paddingBottom):0)-c)*r}}}function ue(e,t={visibilityProperty:!0}){return!!e?.isConnected&&!!e.getClientRects().length&&(!e.checkVisibility||e.checkVisibility(t))&&"visible"===e.ownerDocument.defaultView.getComputedStyle(e).visibility}function de(e){return e.matchMedia("(prefers-reduced-motion: reduce)").matches?"instant":"smooth"}function fe(e,{behavior:t,header:n=he(e),nearest:o=!1}={}){const r=e.ownerDocument,i=r.defaultView,a=t??de(i);if(o&&!n)return void e.scrollIntoView({behavior:a,block:"nearest",inline:"nearest"});const s=i.getComputedStyle(e).scrollMarginTop,l=r.documentElement,c=l.clientHeight,u=i.getComputedStyle(l),d=me(u.scrollPaddingTop,c),f=me(u.scrollPaddingBottom,c);let p,m;try{let t=o?"nearest":"start";if(o){const e=n-parseFloat(s);null!==d&&e>d&&(p=l.getAttribute("style"),l.style.setProperty("scroll-padding-top",`${e}px`,"important"))}else{const t=n>0&&null!==d?`max(${s}, ${n-d}px)`:s;m=e.getAttribute("style"),e.style.setProperty("scroll-margin-top",`calc(${t} + 1lh)`,"important")}if(!o&&null!==d&&null!==f){const n=i.getComputedStyle(e),o=c-d-f-parseFloat(n.scrollMarginTop)-parseFloat(n.scrollMarginBottom),r=o-e.getBoundingClientRect().height;if(r>=0&&(t="center"),r>0&&"horizontal-tb"===u.writingMode){const e=Math.min(o/3,r);p=l.getAttribute("style"),l.style.setProperty("scroll-padding-bottom",`${f+e}px`,"important")}}e.scrollIntoView({behavior:a,block:t,inline:"nearest"})}finally{void 0!==p&&pe(l,p),void 0!==m&&pe(e,m)}}function pe(e,t){e.setAttribute("style",t??""),null===t&&e.removeAttribute("style")}function me(e,t){if("auto"===e)return 0;const n=parseFloat(e);return Number.isFinite(n)?n*(e.endsWith("%")?t/100:1):null}function he(e){const t=e.getBoundingClientRect();return ge(e,t.left+t.width/2)?.bottom??0}function ge(e,t){const n=e.ownerDocument;for(let o=n.elementFromPoint(t,1);o&&!o.contains(e);o=o.parentElement){const e=n.defaultView.getComputedStyle(o);if("fixed"!==e.position&&"sticky"!==e.position)continue;if("0"===e.opacity||!ue(o,{visibilityProperty:!0,opacityProperty:!0}))continue;const{left:t,right:r,top:i,bottom:a}=o.getBoundingClientRect();if("fixed"===e.position||i<=parseFloat(e.top)+1)return{node:o,left:t,right:r,top:i,bottom:a}}}function we(e,t,{inlineLauncher:n,nativeLauncher:o}={}){const r=e.strings,i=e.termId??e.postId,a=window,s=function(){let e,t=0,n=0;return{remember(e){try{e&&(t=e.defaultView.scrollY)}catch{}},async restore(e,o,r=()=>!0,i){const a=++n;try{const s=e.defaultView;let l;if(s.scrollTo({top:t,left:0,behavior:"instant"}),o?.ownerDocument===e&&r()){if(await ne(s),a!==n||o.ownerDocument!==e||!r())return;if(function(e,t){const n=e.ownerDocument;for(let t=e;t;t=t.parentElement)if("until-found"!==t.getAttribute("hidden")?.toLowerCase()&&(t.hasAttribute("hidden")||"none"===n.defaultView.getComputedStyle(t).display))return!1;let o=!1;for(let r=e;r&&e.isConnected&&e.ownerDocument===n&&t();r=r.parentElement){if("until-found"===r.getAttribute("hidden")?.toLowerCase()){if(r.dispatchEvent(new n.defaultView.Event("beforematch",{bubbles:!0})),!(e.isConnected&&e.ownerDocument===n&&r.isConnected&&r.ownerDocument===n&&r.contains(e)&&t()))break;"until-found"===r.getAttribute("hidden")?.toLowerCase()&&r.removeAttribute("hidden"),o=!0}const i=r.parentElement;i instanceof n.defaultView.HTMLDetailsElement&&!i.open&&r!==Array.from(i.children).find(e=>"summary"===e.localName)&&(i.open=!0,o=!0)}return o}(o,()=>a===n&&r())&&await new Promise(e=>s.setTimeout(e,0)),a!==n||!r())return;const t=o.ownerDocument===e?function(e){if(!e?.isConnected)return null;const t=oe(e,!0);if(t?.clipped)return e;if(!t?.boundary)for(const t of e.querySelectorAll("*"))if(oe(t,!0)?.clipped)return t;for(let n=t?.boundary||e.parentElement;n;){const e=oe(n,!0);if(e?.clipped)return n;n=e?.boundary||n.parentElement}return null}(o):null;t&&(function(e,t){const n=ie(e,t,!0);if(!n?.inViewport)return void fe(e);const{rects:o,extent:r,header:i=0}=n,a=e.ownerDocument.documentElement,s=Math.min(r.x,a.clientWidth),l=Math.min(r.y,a.clientHeight-i);o.some(e=>e.right-e.left>=s-1&&e.bottom-e.top>=l-1)?t&&te(n,t)?.reveal(de(e.ownerDocument.defaultView)):fe(e,{nearest:!0,header:i})}(t,i),o.contains(t)&&(l=t))}return t=s.scrollY,l}catch{}},keepInView(t,{canvas:n,canvasTarget:o,whenSettled:r,finishMotion:i,canvasWasPanned:a,canFollow:s}){try{const l=e?.target===t&&e.canFollow();if(e?.cancel(),!t.isConnected||!s())return;if(!l){const e=ie(t,o);if(!te(e,o)?.visible)return}const c=new AbortController,u={target:t,canFollow:()=>!c.signal.aborted&&s(),cancel(){c.abort(),e===u&&(e=null)}};return e=u,function(e,t,n,o,r){const i=e=>{e.isTrusted&&("keydown"!==e.type||ee.has(e.key))&&r()},a={capture:!0,passive:!0,signal:o};for(const n of[e,t])for(const e of["wheel","touchmove","pointerdown","keydown"])n?.addEventListener(e,i,a);t?.addEventListener("scroll",()=>{n?.()&&r()},a)}(t.ownerDocument.defaultView,n,a,c.signal,()=>{u.cancel(),i?.()}),async function(e,t,n,o){try{const r=e.ownerDocument.defaultView;if(await ne(r),!o())return;const{scrollX:i,scrollY:a}=r,s=n();if(s&&await s,!o()||r.scrollX!==i||r.scrollY!==a)return;let l=ie(e,t);l&&!l.rects.length&&(fe(e,{behavior:"instant",header:l.header}),l=ie(e,t)),te(l,t)?.reveal()}catch{}}(t,o,r,u.canFollow).finally(u.cancel)}catch{}}}}(),l=c(r,{postTitle:t.title??e.postTitle,publicRedirect:e.publicRedirect,inlineLauncher:n,nativeLauncher:o,onOpen:()=>j(),onClose:()=>H(),onRefresh:R,onRetry:e=>e?j(!0):R(),beforeViewportChange:e=>h.beforeViewportChange(e),beforeMove:O,afterMove:()=>{p&&R()}});let d,f,p=!1,m=0;const h=function(e,t,n,o,r=[]){const i=u(r);let a,s,l,c,d;function f(){d?.()}return{get hasPreview(){return!!a},get hasHtmlPreview(){return!!s},get redirectDestination(){return c},load:function(r,u,p=()=>!1,m){const h=new URL(r);if("https:"!==h.protocol&&"http:"!==h.protocol)throw Object.assign(new Error(n.failed),{code:"mtflpp_preview_unsupported_url"});if(h.origin!==window.location.origin){const e=n.originMismatch.replace("%s",()=>h.origin+h.pathname);throw Object.assign(new Error(e),{code:"mtflpp_preview_origin_mismatch"})}const g=h.searchParams.get("mtflpp_token");if(!g)throw new Error(n.failed);return window.crossOriginIsolated&&h.searchParams.set("mtflpp_isolated","1"),f(),h.searchParams.delete("mtflpp_source"),e.followChanges&&h.searchParams.set("mtflpp_source","1"),o(n.updating),new Promise((r,f)=>{const w=e.stage.ownerDocument.createElement("iframe");w.title=n.title,w.className="mtflpp-frame mtflpp-loading",w.setAttribute("aria-hidden","true"),w.setAttribute("tabindex","-1"),w.referrerPolicy="same-origin";let v=!1,y=!1;const b=setTimeout(()=>M(new Error(n.failed)),3e4),x=()=>{y=!0,M()};function M(e){v||(v=!0,e&&(y=!0),clearTimeout(b),d===x&&(d=null),w!==a&&(w.onload=null,w.onerror=null,w.remove()),e?f(e):r())}d=x,w.onload=async()=>{const r=w!==a;if(r||(s=null,l=null),y||!u())return void M();let d,f,v;try{const e=w.contentDocument,t=e?.querySelector('meta[name="meet-the-frontend-live-preview-panel"]');t?.content===g?d=e:r&&!t&&(f=function(e,t){if("text/html"!==e?.contentType)return;const n=e.defaultView?.performance.getEntriesByType("navigation")[0];if(!(n?.redirectCount>0))return;const o=new URL(n.name);return o.origin!==t.origin||o.pathname===t.pathname&&o.search===t.search?void 0:o.pathname}(e,h))}catch{}d&&(e.followChanges&&i.capture(d,r?m:void 0),d.documentElement.style.setProperty("overscroll-behavior","contain","important")),d&&r&&(t.remember(s),e.followChanges&&p()&&s&&(v=i.findChange(s,d))),r&&a&&(a.onload=null,a.onerror=null,a.remove()),a=w,s=d,l=null,c=f,w.classList.remove("mtflpp-loading"),w.removeAttribute("aria-hidden"),w.removeAttribute("tabindex");const b=()=>!y&&u()&&w===a&&d===s&&(!d||w.contentDocument===d);let x;if(d&&r){const n=e.canvasTarget&&(t=>e.canvasTarget(w,t,{fitTarget:!0}));x=await t.restore(d,v,()=>b()&&e.followChanges&&p(),n)}b()?(l=x,o(n.current,"ready"),M()):M()},w.onerror=()=>{w===a?(s=null,l=null,c=void 0,u()&&o(n.failed,"error")):M(new Error(n.failed))},w.src=h.href,e.stage.append(w)})},cancel:f,beforeViewportChange({canvasTarget:n,canFollow:o,...r}){const i=l,c=s,u=a;if(i&&c)return t.keepInView(i,{...r,canvasTarget:e=>n(u,e),canFollow:()=>i===l&&c===s&&u.contentDocument===c&&e.visible&&e.followChanges&&o()})},clear(){f(),t.remember(s),a&&(a.onload=null,a.onerror=null),a=null,s=null,l=null,c=void 0,e.clearPreview()}}}(l,s,r,S,e.comparisonExcludedSelectors);let g,w,v,y,b,x,M,C,k=!1;try{a.BroadcastChannel&&(C=new a.BroadcastChannel(`meet-the-frontend-live-preview-panel:${e.endpoint}:${i}:${e.userId}`),C.onmessage=e=>{"takeover"===e.data?.type&&p&&(H(!0),S(r.handedOff,"conflict",{reason:"handed-off"}))},a.addEventListener("pagehide",e=>{e.persisted||C.close()}))}catch{C?.close(),C=null}function S(e,n="loading",{canRetry:o=!0,reason:r=""}={}){"ready"===n&&(k=!1),l.report(e,n,{canTakeOver:!!C,hasPreview:h.hasPreview,canRetry:o,reason:r,hasHtmlPreview:h.hasHtmlPreview,redirectDestination:h.redirectDestination,canRefresh:p&&!t.saving&&["ready","error"].includes(n)&&("error"!==n||o)})}function E(e){const t=e?.code,n=function(e){const t=e?.code;return"mtflpp_post_locked"===t?"post-locked":"mtflpp_acf_rows_stale"===t?"reload-before-save":["mtflpp_invalid_nonce","rest_cookie_invalid_nonce","mtflpp_preview_conflict","mtflpp_source_changed","mtflpp_acf_unavailable","mtflpp_integration_failed"].includes(t)?"reload":["mtflpp_cannot_preview","rest_forbidden","rest_cannot_edit"].includes(t)?"permission":"mtflpp_preview_origin_mismatch"===t?"origin-mismatch":"mtflpp_preview_unsupported_url"===t?"unsupported-url":""}(e);n&&(p=!1,P(),h.cancel(),b?.()),S("string"==typeof t?e.message:r.failed,"post-locked"===n?"paused":"error",{reason:n,canRetry:!n})}function P(){clearTimeout(d),f=void 0}function L(e){if(void 0===e&&void 0===f)return;const t=performance.now();void 0!==e&&(f=t+e),clearTimeout(d);const n=Math.ceil(f-t);n>0?d=setTimeout(V,n):V()}function T(){p&&(m+=1,k=!0,h.cancel(),t.saving||S(r.stale,"stale"),t.saving||t.previewing?P():L(275))}function V(){if(!p||g||!1===t.ready||t.previewing||t.saving)return;P();const n=m;S(r.updating),g=(async()=>{try{if(await t.idle,!p||!1===t.ready||t.saving)return;const o=e.base;let i,a;v=t.preparePreview(l.followChanges);try{i=await v}catch(e){a=e}finally{v=null}if(await t.idle,!p||!1===t.ready||t.saving||o!==e.base)return;if(a)throw a;if("string"!=typeof i.url)throw Object.assign(new Error(i.message||r.failed),{code:i.code});p&&n===m&&await function(e,t,n){return h.load(e,()=>p&&t===m,()=>l.followChanges&&k,n)}(i.url,n,i.comparisonValues)}catch(e){p&&!t.saving&&E(e)}finally{g=null,L()}})()}function O(){m+=1,h.clear()}function H(e=!1){l.setVisible(e),p=!1,P(),O(),clearTimeout(M),M=null,x?.abort(),l.returnToEditor(),b?.()}async function j(n=!1){if(l.setVisible(!0),p)return;if(w)return void E(w);if(y){if(x&&!x.signal.aborted)return;const e=m;try{await y}catch{}return void(l.visible&&e===m&&j(n))}if(!1===t.ready)return void S(t.notReady,t.notReadyState??"paused",{canRetry:!1});if(!e.available)return void S(r.unavailable,"error",{canRetry:!1,reason:"unavailable"});if(!a.isSecureContext||!navigator.locks)return void S(r.browser,"error",{canRetry:!1,reason:"browser"});const o=n&&C?new AbortController:null;let s=!1;x=o,o?(S(r.waiting,"handover"),M=setTimeout(()=>{s=!0,o.abort()},15e3)):S(t.saving?r.saving:r.updating);try{const n=o?{signal:o.signal}:{ifAvailable:!0};if(y=navigator.locks.request(`meet-the-frontend-live-preview-panel:${e.endpoint}:${i}`,n,async e=>{if(clearTimeout(M),M=null,x=null,l.visible&&!o?.signal.aborted)if(e){S(t.saving?r.saving:r.updating);try{await new Promise(e=>{b=e,p=!0,m+=1,V()}),await g}finally{b=null}}else S(C?r.conflict:r.closeOther,"conflict",{reason:C?"other-tab":"manual"})}),o)try{C.postMessage({type:"takeover"})}catch(e){throw o.abort(),p&&H(!0),await y.catch(()=>{}),e}await y,l.visible&&s&&S(r.takeoverTimeout,"conflict",{reason:"busy"})}catch(e){p=!1,l.visible&&s?S(r.takeoverTimeout,"conflict",{reason:"busy"}):l.visible&&"AbortError"!==e.name&&E(e)}finally{clearTimeout(M),M=null,x=null,y=null}}function R(e=!0){t.saving||(e||(k=!1),p?(m+=1,h.cancel(),L(0)):j())}return{changed:T,pause:function(e=r.saving,t="loading"){return m+=1,P(),h.cancel(),(p||l.visible&&"paused"===t)&&S(e,t,{canRetry:!1}),v},resume:function(e){w=e,e?l.visible&&E(e):!l.visible||p||y?T():j()},setSuspended:l.setSuspended,setTitle:l.setTitle,openFromLauncher:l.openFromLauncher,start:()=>{l.visible&&j()},get pending(){return g}}}const ve=window.meetTheFrontendLivePreviewPanel,ye=document.getElementById("edittag");if(ve&&ye)try{!function(e,t,n,o){const r='.term-name-wrap input[name="name"]',i='.term-description-wrap textarea[name="description"]',a="input change undo redo SetContent";let s,l;function c(){const n=t.querySelector(r)?.value,o=t.querySelector(i),a=s&&s.getElement()===o&&s.getBody()&&!s.isHidden()?s.getContent():o?.value;if("string"!=typeof n||"string"!=typeof a)throw new Error(e.strings.bootFailed);return{name:n,description:a}}const u=we(e,{title:c().name,async preparePreview(){const t=c(),n=l?.capture(),o={"X-WP-Nonce":e.nonce};n&&(o["Content-Type"]="application/json");const r=await fetch(e.endpoint,{method:"POST",credentials:"same-origin",headers:o,body:n?JSON.stringify({...n,...t}):new URLSearchParams(t)}),i=await r.json();if(!r.ok)throw Object.assign(new Error(i.message||e.strings.failed),{code:i.code});return{...i,comparisonValues:{name:{type:"text",value:t.name},description:{type:"html",value:t.description}}}}},{inlineLauncher:o});function d(e){if(e.target.matches(r))u.setTitle(e.target.value);else if(!e.target.matches(i))return;u.changed()}function f(){u.changed()}function p(e){"description"===e?.id&&e!==s&&t.contains(e.getElement())&&(s?.off(a,f),s=e,s.on(a,f),f())}l=function(e,t,n){if(!e.acfTermEnabled||!t.querySelector('[name="_acf_nonce"]'))return;const{acf:o,jQuery:r,tinymce:i}=window,a=()=>Object.assign(new Error(e.strings.acfUnavailable),{code:"mtflpp_acf_unavailable"});if("function"!=typeof o?.serialize||"function"!=typeof o.addAction||"function"!=typeof o.removeAction||"function"!=typeof r)throw a();const s=new Set,l="input change undo redo SetContent";function c(e){const o=e?.getElement?.();o?.name?.startsWith("acf[")&&t.contains(o)&&!s.has(e)&&(s.add(e),e.on(l,n),e.on("remove",()=>{s.delete(e),e.off(l,n)}))}const u=function(e,t,n,o){const r=window.acf;r.addAction("wysiwyg_tinymce_init",n);for(const e of["append","remove","sortstop","change_field"])r.addAction(e,t);const i=t=>{t[0]===e&&o?.()};function a(e){return!!e?.closest?.(".acf-field")}let s;return r.addAction("validation_failure",i),window.jQuery(e).on("input.mtflppAcf change.mtflppAcf sortupdate.mtflppAcf",(e,n)=>{a(e.target)&&("sortupdate"===e.type&&(s=n?.item?.[0]?.querySelector(':scope > input[type="hidden"][name$="[acf_fc_layout]"]')?.name),e.originalEvent&&"sortupdate"!==e.type||t())}),{isField:a,isValidating:()=>!!e.classList?.contains("is-validating"),hasStructuralPaginationChanges:()=>!!e.querySelector('.acf-repeater[data-pagination="1"] .acf-row:is(.acf-added, .acf-inserted, .acf-reordered, .acf-deleted)'),accepts:e=>"_acf_nonce"===e||e.startsWith("acf[")||e.startsWith("_acf_fields["),layoutOrders(t,n){const o=new Map,r=new Map,i=new Set;for(const[e,t]of n){"1"===t&&e.endsWith("[acf_fc_layout_disabled]")&&i.add(e.replace(/\[acf_fc_layout_disabled\]$/,"[acf_fc_layout]"));const n=e.match(/^(acf\[.+)\[[^\]]+\]\[acf_fc_layout\]$/)?.[1];n&&(o.has(n)||o.set(n,[]),o.get(n).push(e),r.set(e,[]))}const a=e=>Array.from(e.matchAll(/\]\[/g),({index:t})=>`${e.slice(0,t+1)}[acf_fc_layout]`);function l(e){const t=a(e);if(!t.some(e=>i.has(e)))return t.findLast(e=>r.has(e))}for(const[e,n]of t){if(!e.startsWith("acf[")||!["text","html"].includes(n.type))continue;const t=a(e);if(!t.some(e=>i.has(e)))for(const n of t)r.get(n)?.push(e)}for(const o of e.querySelectorAll('.acf-field[data-type="image"] .acf-image-uploader.has-value')){const e=o.querySelector(':scope > input[type="hidden"][name]'),i=o.querySelector(':scope > .image-wrap > img[data-name="image"]'),a=e?.name;if(!a?.startsWith("acf[")||!i||e.matches(":disabled")||o.closest(".acf-clone"))continue;const s=n.getAll(a);if(1!==s.length||s[0]!==e.value||!/^[1-9]\d*$/.test(s[0]))continue;const c=l(a);c&&(r.get(c).push(a),t.set(a,{type:"row-image",value:s[0],alt:i.alt}))}for(const o of e.querySelectorAll('.acf-field[data-type="gallery"] .acf-gallery')){const e=o.querySelector(':scope > input[type="hidden"][name]'),r=e?.name;if(!r?.startsWith("acf[")||e.matches(":disabled")||o.closest(".acf-clone"))continue;const s=`${r}[]`,l=n.getAll(r),c=n.getAll(s);if(a(r).some(e=>i.has(e))||1!==l.length||""!==l[0]||c.some(e=>!/^[1-9]\d*$/.test(e)))continue;const u=[...o.querySelectorAll(':scope > .acf-gallery-main > .acf-gallery-attachments > .acf-gallery-attachment > input[type="hidden"][name]')];u.length!==c.length||u.some((e,t)=>e.name!==s||e.value!==c[t]||e.matches(":disabled"))||t.set(s,{type:"gallery-order",value:JSON.stringify(c),members:JSON.stringify([...c].sort())})}for(const[e,n]of o){const o=n.filter(e=>!i.has(e));if(o.length<2||new Set(o).size!==o.length)continue;const a=o.includes(s)?s:void 0;t.set(`acf-layout-order:${e}`,{type:"row-order",value:JSON.stringify(o),members:JSON.stringify([...o].sort()),moved:a,fieldsByRow:Object.fromEntries(o.map(e=>[e,r.get(e)]))})}return t},destroy(){r.removeAction("wysiwyg_tinymce_init",n);for(const e of["append","remove","sortstop","change_field"])r.removeAction(e,t);r.removeAction("validation_failure",i),window.jQuery(e).off(".mtflppAcf")}}}(t,n,c);for(const e of i?.editors??[])c(e);const d=r(t.ownerDocument),f="tinymce-editor-init.mtflppAcfTerm";d.on(f,(e,t)=>c(t));const p=e=>{u.isField(e.target)&&n()};return t.addEventListener("input",p),t.addEventListener("change",p,!0),{capture(){const e=[];try{for(const n of s){const o=n.getElement();o&&t.contains(o)&&n.getBody()&&!n.isHidden()&&(e.push([o,o.value]),o.value=n.getContent())}const{acf:n,_acf_nonce:i,_acf_fields:l}=o.serialize(r(t));if(!n)return{};if(!i)throw a();return{acf:n,_acf_nonce:i,_acf_fields:l}}finally{for(const[t,n]of e)t.value=n}},destroy(){u.destroy(),d.off(f),t.removeEventListener("input",p),t.removeEventListener("change",p,!0);for(const e of s)e.off(l,n);s.clear()}}}?.(e,t,u.changed);const m=window.jQuery?.(t.ownerDocument);m?.on("tinymce-editor-init.mtflppTermEditor",(e,t)=>p(t)),p(window.tinymce?.get("description")),window.addEventListener("pagehide",e=>{e.persisted||(s?.off(a,f),m?.off("tinymce-editor-init.mtflppTermEditor"),l?.destroy())}),t.addEventListener("input",d),t.addEventListener("change",d,!0),u.start()}(ve,ye,0,ye.querySelector("#mtflpp-term-preview button"))}catch(e){!function(e,t){document.getElementById("mtflpp-panel")?.remove(),document.getElementById("mtflpp-toggle")?.remove(),document.getElementById("mtflpp-publish-preview")?.remove(),document.getElementById("mtflpp-term-preview")?.remove();const n=document.createElement("div");n.className="notice notice-error inline",n.setAttribute("role","alert");const o=document.createElement("p");o.textContent=e,n.append(o);const r=document.querySelector("#wpbody-content .wp-header-end")||document.querySelector("#wpbody-content .wrap h1, #wpbody-content .wrap h2");r?r.after(n):(document.getElementById("wpbody-content")||document.body).prepend(n),console.error("Meet the Frontend – Live Preview Panel could not start.",t)}(ve.strings.bootFailed,e)}})();
  • meet-the-frontend-live-preview-panel/trunk/classes/Compatibility/Acf.php

    r3819155 r3822693  
    5858        );
    5959        $config['strings']['nativePreviewAcf'] = __(
    60             'WordPress Preview saved changes in your repeating fields to the post.',
     60            'WordPress Preview saved repeating field changes, but the rows in this editor are still out of date.',
     61            'meet-the-frontend-live-preview-panel'
     62        );
     63        $config['strings']['nativePreviewAcfReload'] = __(
     64            'Copy any unsaved changes you want to keep, then reload the editor before saving again.',
    6165            'meet-the-frontend-live-preview-panel'
    6266        );
    … …  
    8286    {
    8387        return function_exists('acf');
     88    }
     89
     90    /** Saved inputs to ACF's position-based paginated merges, including nested storage paths. */
     91    public static function paginatedRowState(array $meta): array
     92    {
     93        if (!function_exists('acf_get_field_type') || !acf_get_field_type('repeater')) {
     94            return [];
     95        }
     96        $repeaters = [];
     97        // ACF saves _<storage path> => field key, even when a repeater sits inside another field.
     98        foreach ($meta as $key => $values) {
     99            $reference = $values[0] ?? null;
     100            if (
     101                !str_starts_with((string) $key, '_') || !is_string($reference) || !str_starts_with($reference, 'field_')
     102            ) {
     103                continue;
     104            }
     105            $field = acf_get_field($reference);
     106            if (($field['type'] ?? '') === 'repeater' && !empty($field['pagination']) && !empty($field['sub_fields'])) {
     107                $repeaters[substr($key, 1)] = true;
     108            }
     109        }
     110        if (!$repeaters) {
     111            return [];
     112        }
     113        $rows = [];
     114        foreach ($meta as $key => $values) {
     115            $name = str_starts_with((string) $key, '_') ? substr($key, 1) : (string) $key;
     116            if (isset($repeaters[$name])) {
     117                $rows[$key] = $values;
     118                continue;
     119            }
     120            // Match only indexed descendants of a paginated field, not every ACF value on the post.
     121            preg_match_all('/_[0-9]+(?=_)/', $name, $indices, PREG_OFFSET_CAPTURE);
     122            foreach ($indices[0] as [, $offset]) {
     123                if (isset($repeaters[substr($name, 0, $offset)])) {
     124                    $rows[$key] = $values;
     125                    break;
     126                }
     127            }
     128        }
     129        ksort($rows);
     130        return $rows;
    84131    }
    85132
  • meet-the-frontend-live-preview-panel/trunk/classes/Compatibility/Timber.php

    r3819155 r3822693  
    44
    55use MeetTheFrontendLivePreviewPanel\LivePreview;
     6use WeakMap;
    67use WP_Post;
    78use WP_Term;
    … …  
    1516    private array $fields = [];
    1617    private array $terms = [];
     18    private ?WeakMap $legacyEmptyQueries = null;
    1719
    1820    public function __construct()
    … …  
    2729            true
    2830        ));
    29         add_action('mtflpp_frontend_term_preview_source_selected', fn (array $context) => $this->bindTermPreview(
     31        add_action('mtflpp_frontend_term_preview_source_selected', fn (array $context) => $this->bindTimber2TermPreview(
    3032            $context['term'],
    3133            $context['saved']
    … …  
    3335    }
    3436
    35     private function bindTermPreview(WP_Term $term, WP_Term $saved): void
    36     {
    37         if (!class_exists(\Timber\Term::class)) {
     37    private function bindTimber2TermPreview(WP_Term $term, WP_Term $saved): void
     38    {
     39        // Timber 1 lacks the class hook and its Term::init() has a different signature.
     40        // Leave its archive on the native WordPress preview path.
     41        if (!method_exists(\Timber\Term::class, 'wp_object')) {
    3842            return;
    3943        }
    … …  
    7074        $terms = $saved ? [] : get_post_meta($sourceId, LivePreview::TERMS_META, true);
    7175        $this->terms = is_array($terms) ? $terms : [];
    72         if ($this->terms) {
    73             add_filter('timber/post/class', [$this, 'postClass'], PHP_INT_MAX, 2);
    74         }
    75         // Timber can reload the parent by ID instead of using WordPress's filtered preview object.
    76         add_filter('timber/post/import_data', [$this, 'readPost'], PHP_INT_MAX, 2);
     76        // Timber 1 has the eager import_custom() API; Timber 2 uses import and class hooks instead.
     77        $isTimber1 = method_exists(\Timber\Post::class, 'import_custom');
     78        if (!$isTimber1) {
     79            $this->bindTimber2PostReads();
     80        } elseif (!$saved) {
     81            $this->bindTimber1PostReads();
     82        }
    7783        add_action('shutdown', [$this, 'unbindPreview'], PHP_INT_MAX);
    7884    }
    … …  
    8288    {
    8389        remove_filter('timber/post/import_data', [$this, 'readPost'], PHP_INT_MAX);
     90        remove_filter('timber_post_get_meta_pre', [$this, 'readLegacyPostMeta'], PHP_INT_MAX);
     91        remove_filter('timber_post_get_meta_field_pre', [$this, 'readLegacyPostMetaField'], PHP_INT_MAX);
    8492        remove_filter('timber/post/class', [$this, 'postClass'], PHP_INT_MAX);
     93        remove_action('pre_get_terms', [$this, 'readLegacyTermQuery'], PHP_INT_MIN);
     94        remove_filter('terms_pre_query', [$this, 'emptyLegacyTermQuery'], PHP_INT_MIN);
     95        $this->legacyEmptyQueries = null;
    8596        remove_action('shutdown', [$this, 'unbindPreview'], PHP_INT_MAX);
    8697        $this->previewPostId = 0;
    … …  
    90101    }
    91102
     103    private function bindTimber1PostReads(): void
     104    {
     105        add_filter('timber_post_get_meta_pre', [$this, 'readLegacyPostMeta'], PHP_INT_MAX, 2);
     106        add_filter('timber_post_get_meta_field_pre', [$this, 'readLegacyPostMetaField'], PHP_INT_MAX, 3);
     107        if ($this->terms) {
     108            $this->legacyEmptyQueries = new WeakMap();
     109            add_action('pre_get_terms', [$this, 'readLegacyTermQuery'], PHP_INT_MIN);
     110            add_filter('terms_pre_query', [$this, 'emptyLegacyTermQuery'], PHP_INT_MIN, 2);
     111        }
     112    }
     113
     114    public function readLegacyPostMeta(mixed $meta, mixed $postId): mixed
     115    {
     116        $sourceId = $this->legacyMetaSourceId($postId);
     117        if ($meta === false || !empty($meta) || !$sourceId) {
     118            return $meta;
     119        }
     120        // Give Timber the same raw shape as get_post_meta($id), without preview bookkeeping.
     121        $meta = array_filter(
     122            get_post_meta($sourceId),
     123            static fn ($key): bool => !str_starts_with((string) $key, '_mtflpp_'),
     124            ARRAY_FILTER_USE_KEY
     125        );
     126        // Timber treats an empty array as a request to load the saved post's metadata.
     127        return $meta ?: false;
     128    }
     129
     130    public function readLegacyPostMetaField(mixed $value, mixed $postId, mixed $key): mixed
     131    {
     132        $sourceId = $this->legacyMetaSourceId($postId);
     133        if ($value !== null || !is_string($key) || $key === '' || !$sourceId) {
     134            return $value;
     135        }
     136        // A missing imported property can fall through to Timber's single-field read on the parent.
     137        // Compare the bulk snapshots so virtual per-key metadata and later formatting filters stay native.
     138        return !array_key_exists($key, get_post_meta($sourceId))
     139            && array_key_exists($key, get_post_meta($this->previewPostId)) ? false : $value;
     140    }
     141
     142    private function legacyMetaSourceId(mixed $postId): int
     143    {
     144        return $this->source && is_numeric($postId) && (int) $postId === $this->previewPostId
     145            && $this->source->ID !== $this->previewPostId ? $this->source->ID : 0;
     146    }
     147
     148    public function readLegacyTermQuery(WP_Term_Query $query): void
     149    {
     150        if (!$this->legacyEmptyQueries || !$this->isPreviewTermQuery($query)) {
     151            return;
     152        }
     153        // Timber 1 has no post class hook. Match only its direct relationship query, not a
     154        // native query nested inside it. Otherwise core could cache unsaved terms on the parent.
     155        // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_debug_backtrace -- Identify the legacy caller without reading its arguments.
     156        $stack = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 14);
     157        foreach ($stack as $index => $frame) {
     158            if (isset($frame['class']) || $frame['function'] !== 'get_terms') {
     159                continue;
     160            }
     161            $index++;
     162            while (($stack[$index]['function'] ?? '') === 'wp_get_object_terms' && !isset($stack[$index]['class'])) {
     163                $index++;
     164            }
     165            if (
     166                ($stack[$index]['function'] ?? '') === 'wp_get_post_terms' && !isset($stack[$index]['class'])
     167                && ($stack[$index + 1]['class'] ?? '') === \Timber\Post::class
     168                && $stack[$index + 1]['function'] === 'terms'
     169            ) {
     170                $this->adaptTermQuery($query, $this->legacyEmptyQueries);
     171            }
     172            return;
     173        }
     174    }
     175
     176    public function emptyLegacyTermQuery($terms, WP_Term_Query $query)
     177    {
     178        return $this->legacyEmptyQueries ? $this->emptyTermQuery($terms, $query, $this->legacyEmptyQueries) : $terms;
     179    }
     180
     181    private function bindTimber2PostReads(): void
     182    {
     183        // Timber can reload the parent by ID instead of using WordPress's filtered preview object.
     184        add_filter('timber/post/import_data', [$this, 'readPost'], PHP_INT_MAX, 2);
     185        if ($this->terms) {
     186            add_filter('timber/post/class', [$this, 'postClass'], PHP_INT_MAX, 2);
     187        }
     188    }
     189
     190    public function readPost(array $data, object $post): array
     191    {
     192        if ($this->source && (int) $post->ID === $this->previewPostId) {
     193            foreach (['post_title', 'post_content', 'post_excerpt'] as $field) {
     194                $data[$field] = $this->source->$field;
     195            }
     196            foreach ($this->fields as $field => $value) {
     197                $data[$field] = $value;
     198            }
     199            if ($post instanceof TimberPost) {
     200                $post->setPreviewTerms($this->readTerms(...));
     201            }
     202        }
     203        return $data;
     204    }
     205
    92206    /** Use Timber's public class hook without replacing theme-specific Post subclasses. */
    93207    public function postClass(string $class, WP_Post $post): string
    … …  
    109223        // WordPress hooks inside those reads (including our own fallback reads) stay native.
    110224        $queryDepth = count($GLOBALS['wp_current_filter']) + 1;
    111         $emptyQueries = new \WeakMap();
     225        $emptyQueries = new WeakMap();
    112226        $adapt = function (WP_Term_Query $query) use ($queryDepth, $emptyQueries): void {
    113             if (
    114                 count($GLOBALS['wp_current_filter']) !== $queryDepth
    115                 || wp_parse_id_list($query->query_vars['object_ids'] ?? []) !== [$this->previewPostId]
    116             ) {
    117                 return;
    118             }
    119             $args = &$query->query_vars;
    120             // These modes depend on real relationship rows, not just a selection of terms.
    121             if (
    122                 $args['fields'] === 'all_with_object_id' || $args['orderby'] === 'term_order' || $args['exclude_tree']
    123             ) {
    124                 return;
    125             }
    126             $ids = [];
    127             foreach ((array) $args['taxonomy'] as $taxonomy) {
    128                 $selected = $this->terms[$taxonomy] ?? wp_get_object_terms(
    129                     $this->previewPostId,
    130                     $taxonomy,
    131                     ['fields' => 'ids']
    132                 );
    133                 if (!is_array($selected)) {
    134                     return;
    135                 }
    136                 $ids = array_merge($ids, $selected);
    137             }
    138             $include = wp_parse_id_list($args['include']);
    139             $ids = $include ? array_intersect($include, $ids)
    140                 : array_diff($ids, wp_parse_id_list($args['exclude']));
    141             $args['object_ids'] = [];
    142             $args['include'] = array_values(array_unique($ids));
    143             if (!$ids) {
    144                 $emptyQueries[$query] = true;
    145             }
    146             // Native object_ids queries include assigned terms even when their count is zero.
    147             $args['hide_empty'] = false;
     227            if (count($GLOBALS['wp_current_filter']) === $queryDepth) {
     228                $this->adaptTermQuery($query, $emptyQueries);
     229            }
    148230        };
    149         // Empty include lists (and even [0] on older core) otherwise query every term.
    150         $empty = static function ($terms, WP_Term_Query $query) use ($emptyQueries) {
    151             return isset($emptyQueries[$query]) ? ($query->query_vars['fields'] === 'count' ? '0' : []) : $terms;
    152         };
     231        $empty = fn ($terms, WP_Term_Query $query) => $this->emptyTermQuery($terms, $query, $emptyQueries);
    153232        add_action('pre_get_terms', $adapt, PHP_INT_MIN);
    154233        add_filter('terms_pre_query', $empty, PHP_INT_MIN, 2);
    … …  
    161240    }
    162241
    163     public function readPost(array $data, object $post): array
    164     {
    165         if ($this->source && (int) $post->ID === $this->previewPostId) {
    166             foreach (['post_title', 'post_content', 'post_excerpt'] as $field) {
    167                 $data[$field] = $this->source->$field;
    168             }
    169             foreach ($this->fields as $field => $value) {
    170                 $data[$field] = $value;
    171             }
    172             if ($post instanceof TimberPost) {
    173                 $post->setPreviewTerms($this->readTerms(...));
    174             }
    175         }
    176         return $data;
     242    private function isPreviewTermQuery(WP_Term_Query $query): bool
     243    {
     244        return wp_parse_id_list($query->query_vars['object_ids'] ?? []) === [$this->previewPostId];
     245    }
     246
     247    private function adaptTermQuery(WP_Term_Query $query, WeakMap $emptyQueries): void
     248    {
     249        if (!$this->isPreviewTermQuery($query)) {
     250            return;
     251        }
     252        $args = &$query->query_vars;
     253        // These modes depend on real relationship rows, not just a selection of terms.
     254        if ($args['fields'] === 'all_with_object_id' || $args['orderby'] === 'term_order' || $args['exclude_tree']) {
     255            return;
     256        }
     257        $ids = [];
     258        foreach ((array) $args['taxonomy'] as $taxonomy) {
     259            $selected = $this->terms[$taxonomy] ?? wp_get_object_terms(
     260                $this->previewPostId,
     261                $taxonomy,
     262                ['fields' => 'ids']
     263            );
     264            if (!is_array($selected)) {
     265                return;
     266            }
     267            $ids = array_merge($ids, $selected);
     268        }
     269        $include = wp_parse_id_list($args['include']);
     270        $ids = $include ? array_intersect($include, $ids) : array_diff($ids, wp_parse_id_list($args['exclude']));
     271        $args['object_ids'] = [];
     272        $args['include'] = array_values(array_unique($ids));
     273        if (!$ids) {
     274            $emptyQueries[$query] = true;
     275        }
     276        // Native object_ids queries include assigned terms even when their count is zero.
     277        $args['hide_empty'] = false;
     278    }
     279
     280    private function emptyTermQuery($terms, WP_Term_Query $query, WeakMap $emptyQueries)
     281    {
     282        // Empty include lists (and even [0] on older core) otherwise query every term.
     283        return isset($emptyQueries[$query]) ? ($query->query_vars['fields'] === 'count' ? '0' : []) : $terms;
    177284    }
    178285}
  • meet-the-frontend-live-preview-panel/trunk/classes/FrontendPreview.php

    r3819374 r3822693  
    1414    private bool $saved = false;
    1515    private bool $sourceRequested = false;
     16    private bool $postsPage = false;
    1617
    1718    public function __construct(
    … …  
    5455            return null;
    5556        }
    56         return get_preview_post_link($post, [
     57        return self::previewUrl($post, [
    5758            'mtflpp_post' => $post->ID,
    5859            'mtflpp_revision' => $sourceId,
    … …  
    6061            'mtflpp_token' => wp_create_nonce($this->savedAction($post->ID, $sourceId)),
    6162        ]);
     63    }
     64
     65    private static function isConfiguredPostsPage(?WP_Post $post): bool
     66    {
     67        return $post?->post_type === 'page' && get_option('show_on_front') === 'page'
     68            && $post->ID === (int) get_option('page_for_posts');
     69    }
     70
     71    public static function previewUrl(WP_Post $post, array $args): ?string
     72    {
     73        if (self::isConfiguredPostsPage($post)) {
     74            // Core's preview=true can turn the posts index into a query for the static front page.
     75            return add_query_arg($args, set_url_scheme(get_permalink($post)));
     76        }
     77        return get_preview_post_link($post, $args);
    6278    }
    6379
    … …  
    101117        $this->saved = $saved;
    102118        $this->sourceRequested = isset($_GET['mtflpp_source']) && $_GET['mtflpp_source'] === '1';
    103         // Bind core and compatibility reads to the authorized source, not the latest revision.
    104         remove_filter('the_preview', '_set_preview');
    105         add_filter('the_preview', [$this, 'readPost']);
     119        $this->postsPage = self::isConfiguredPostsPage(get_post($postId));
     120        add_action('template_redirect', [$this, 'checkPreviewTarget'], -1);
     121        if (!$this->postsPage) {
     122            // Ordinary previews use core's singular-query overlay, not the latest autosave.
     123            remove_filter('the_preview', '_set_preview');
     124            add_filter('the_preview', [$this, 'readPost']);
     125            $this->bindSource();
     126        }
     127    }
     128
     129    private function bindSource(): void
     130    {
    106131        add_filter('get_post_metadata', [$this, 'readRevisionMeta'], 10, 4);
    107132        add_filter('get_the_terms', [$this, 'readTerms'], 10, 3);
    108         add_action('template_redirect', [$this, 'checkPreviewTarget'], -1);
    109133
    110134        /**
    … …  
    116140         */
    117141        // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound -- Both names are prefixed.
    118         do_action($saved
     142        do_action($this->saved
    119143            ? 'mtflpp_frontend_saved_preview_source_selected'
    120144            : 'mtflpp_frontend_live_preview_source_selected', [
    121                 'post' => ['id' => $postId],
     145                'post' => ['id' => $this->previewPostId],
    122146                'source' => ['id' => $this->source->ID],
    123147            ]);
    … …  
    182206    }
    183207
     208    private function bindPostsPage(): bool
     209    {
     210        global $wp_query;
     211
     212        if (
     213            !$wp_query->is_posts_page || !is_home()
     214            || is_feed() || is_embed() || is_search() || is_trackback() || is_404()
     215        ) {
     216            return false;
     217        }
     218        $page = get_queried_object();
     219        if (!$page instanceof WP_Post || $page->ID !== $this->previewPostId) {
     220            return false;
     221        }
     222
     223        // The queried page is separate from the posts loop. Don't swap the global post or change saved reads.
     224        $preview = $this->readPost(clone $page);
     225        $wp_query->queried_object = $preview;
     226        if ($page->post_title !== $preview->post_title) {
     227            // Support get_the_title($id) without replacing titles already formatted by core or other code.
     228            add_filter('the_title', static function ($title, $id) use ($page, $preview) {
     229                return $id === $page->ID && $title === $page->post_title ? $preview->post_title : $title;
     230            }, PHP_INT_MIN, 2);
     231        }
     232        $this->bindSource();
     233        return true;
     234    }
     235
    184236    public function checkPreviewTarget(): void
    185237    {
    186         if (!is_preview() || !is_singular() || get_queried_object_id() !== $this->previewPostId) {
     238        if ($this->postsPage) {
     239            if (!$this->bindPostsPage()) {
     240                return;
     241            }
     242        } elseif (is_preview() && is_singular() && get_queried_object_id() === $this->previewPostId) {
     243            // Core drops preview=true without native autosave parameters, losing the singular overlay.
     244            remove_action('template_redirect', 'redirect_canonical');
     245        } else {
    187246            // Native routing owns other destinations, including archives, redirects and error pages.
    188             // The authorized source remains bound only to its original post; do not label other output verified.
    189247            return;
    190248        }
     249        // This panel document must not claim the window name WordPress uses for its native Preview tab.
     250        remove_action('wp_head', 'wp_post_preview_js', 1);
     251
    191252        // Editors have already authorized this preview. Leave other posts and later site policies alone.
    192253        $postId = $this->previewPostId;
    … …  
    198259        }, 0, 2);
    199260
    200         // Core canonical redirects drop preview=true without native autosave parameters, losing our core-field overlay.
    201         remove_action('template_redirect', 'redirect_canonical');
    202261        (new PreviewDocument($this->file, $this->previewToken))->enhance($this->isolated, $this->sourceRequested);
    203262    }
  • meet-the-frontend-live-preview-panel/trunk/classes/LivePreview.php

    r3820037 r3822693  
    33namespace MeetTheFrontendLivePreviewPanel;
    44
     5use MeetTheFrontendLivePreviewPanel\Compatibility\Acf;
    56use WP_Error;
    67use WP_Post;
    … …  
    102103    }
    103104
    104     /** Saved fields, metadata and terms; editor locks and asynchronous queue flags are not content. */
     105    public static function conflictMessage(): string
     106    {
     107        return __(
     108            'The saved post has changed or is no longer available for live preview.',
     109            'meet-the-frontend-live-preview-panel'
     110        );
     111    }
     112
     113    /** Saved post inputs for editor merges and native-save coordination. */
    105114    public function fingerprint(int $postId): string
    106115    {
     116        return $this->parentFingerprint($postId, includeAcf: true);
     117    }
     118
     119    private function parentFingerprint(int $postId, bool $includeAcf = false): string
     120    {
    107121        $meta = get_post_meta($postId);
    108         // Editor preferences and core queue flags can change independently of saved content.
    109         unset(
    110             $meta['_edit_lock'],
    111             $meta['_edit_last'],
    112             $meta['_encloseme'],
    113             $meta['_pingme'],
    114             $meta['classic-editor-remember']
    115         );
     122        // Native Custom Fields and arbitrary REST registrations don't describe a shared set of editor inputs.
     123        $state = [$meta['_thumbnail_id'] ?? [], $meta['_wp_page_template'] ?? []];
     124        // ACF field settings can differ on the frontend. Only editor requests merge saved rows.
     125        if ($includeAcf) {
     126            $state[] = Acf::paginatedRowState($meta);
     127        }
     128        return $this->stateHash($postId, $state);
     129    }
     130
     131    /** A full check of owned snapshot data, or of writes during one potentially partial native save. */
     132    public function snapshotFingerprint(int $postId): string
     133    {
     134        $meta = get_post_meta($postId);
    116135        ksort($meta);
    117 
     136        return $this->stateHash($postId, $meta);
     137    }
     138
     139    private function stateHash(int $postId, array $meta): string
     140    {
    118141        $taxonomies = get_object_taxonomies(get_post_type($postId));
    119142        $terms = $taxonomies ? wp_get_object_terms($postId, $taxonomies, [
    … …  
    122145        // WP_Post::to_array() also reads filtered term lists; fingerprint stored fields instead.
    123146        $post = get_post($postId);
    124         return hash('sha256', (string) wp_json_encode([$post ? get_object_vars($post) : null, $meta, $terms]));
     147        $fields = $post ? get_object_vars($post) : null;
     148        // Moderating comments updates this derived count without saving the post.
     149        unset($fields['comment_count']);
     150        return hash('sha256', (string) wp_json_encode([$fields, $meta, $terms]));
    125151    }
    126152
    … …  
    168194            return $response;
    169195        }
     196        $matches = hash_equals($this->fingerprint($postId), $base);
    170197        $this->restSaves[$request] = [
    171198            'postId' => $postId, 'base' => $base, 'request' => $token,
    172             'matches' => hash_equals($this->fingerprint($postId), $base),
     199            'beforeWrite' => $matches ? $this->snapshotFingerprint($postId) : null,
    173200        ];
    174201        return $response;
    … …  
    192219        }
    193220        $post = get_post($save['postId']);
    194         $after = $save['matches'] && $post ? $this->fingerprint($post->ID) : 'conflict';
    195         // A client error can happen after the post was updated, for example while saving metadata.
    196         // Only unchanged failures are safe to retry with the editor's existing baseline.
    197         if ($status >= 400 && $after !== $save['base']) {
     221        $after = $save['beforeWrite'] !== null && $post ? $this->fingerprint($post->ID) : 'conflict';
     222        // A 4xx may follow a partial write, even to metadata outside the editor's conflict scope.
     223        if (
     224            $status >= 400 && (
     225                !$post || $after !== $save['base'] || $this->snapshotFingerprint($post->ID) !== $save['beforeWrite']
     226            )
     227        ) {
    198228            return $response;
    199229        }
    … …  
    253283    }
    254284
    255     private function stateAction(int $postId, int $revisionId): string
    256     {
    257         return 'mtflpp_read_' . $postId . '_' . $revisionId . '_' . $this->fingerprint($postId)
    258             . ($revisionId ? $this->fingerprint($revisionId) : '');
     285    private function sourceAction(int $postId, int $revisionId, string $parentState): string
     286    {
     287        return 'mtflpp_read_' . $postId . '_' . $revisionId . '_' . $parentState
     288            . '_' . $this->snapshotFingerprint($revisionId);
    259289    }
    260290
    … …  
    436466            );
    437467        }
    438         if (!$this->isAvailable($post) || !hash_equals($this->fingerprint($postId), $input['base'])) {
     468        $base = $input['base'];
     469        if (!$post || !$this->isAvailable($post) || !hash_equals($base, $this->fingerprint($postId))) {
    439470            return new WP_Error(
    440471                'mtflpp_preview_conflict',
    441                 __(
    442                     'The saved post has changed or is no longer available for live preview.',
    443                     'meet-the-frontend-live-preview-panel'
    444                 ),
     472                self::conflictMessage(),
    445473                ['status' => 409]
    446474            );
    447475        }
    448         $base = $this->fingerprint($postId);
    449476        $fields = $this->previewFields($post, $input);
    450477        if (is_wp_error($fields)) {
    … …  
    471498            );
    472499        }
     500        $parentState = $this->parentFingerprint($postId);
    473501        if (!hash_equals($base, $this->fingerprint($postId))) {
    474502            return new WP_Error(
    … …  
    478506            );
    479507        }
    480         $action = $this->stateAction($postId, $revisionId);
    481         return new WP_REST_Response([
     508        $action = $this->sourceAction($postId, $revisionId, $parentState);
     509        $result = [
    482510            // Our state token authorizes this revision; native autosave parameters would select recovery data.
    483             'url' => get_preview_post_link($post, [
     511            'url' => FrontendPreview::previewUrl($post, [
    484512                'mtflpp_post' => $postId,
    485513                'mtflpp_revision' => $revisionId,
    486514                'mtflpp_token' => wp_create_nonce($action),
    487515            ]),
    488         ]);
     516        ];
     517        $rowText = $this->rowDisplayText($request);
     518        if ($rowText) {
     519            $result['rowDisplayText'] = $rowText;
     520        }
     521        return new WP_REST_Response($result);
     522    }
     523
     524    /** Use only submitted body values and the native, non-shortcode WYSIWYG formatting steps. */
     525    private function rowDisplayText(WP_REST_Request $request): array
     526    {
     527        $body = $request->get_body_params();
     528        $requested = $body['mtflpp_row_text_fields'] ?? null;
     529        $names = is_string($requested) ? json_decode($requested, true, 4) : null;
     530        if (!is_array($names) || !array_is_list($names)) {
     531            return [];
     532        }
     533        $result = [];
     534        $seen = [];
     535        foreach ($names as $name) {
     536            if (!is_string($name) || isset($seen[$name]) || !preg_match('/^[\w-]+(?:\[[\w-]+\])+$/D', $name)) {
     537                continue;
     538            }
     539            $seen[$name] = true;
     540            $value = $body;
     541            foreach (explode('[', str_replace(']', '', $name)) as $part) {
     542                $value = is_array($value) ? ($value[$part] ?? null) : null;
     543            }
     544            if (!is_string($value) || $value === '') {
     545                continue;
     546            }
     547            try {
     548                $formatted = wpautop(wptexturize($value));
     549                if (trim($formatted) !== trim($value)) {
     550                    $result[$name] = $formatted;
     551                }
     552            } catch (\Throwable) {
     553                // Formatting evidence is optional; a formatter must not fail a prepared preview.
     554            }
     555        }
     556        return $result;
    489557    }
    490558
    … …  
    793861            || !current_user_can('edit_post', $postId) || !$revisionId
    794862            || !$this->ownsRevision($postId, $revisionId)
    795             || !wp_verify_nonce($token, $this->stateAction($postId, $revisionId))
    796863        ) {
    797864            return null;
    798865        }
    799         return get_post($revisionId);
     866        $action = $this->sourceAction($postId, $revisionId, $this->parentFingerprint($postId));
     867        return wp_verify_nonce($token, $action) ? get_post($revisionId) : null;
    800868    }
    801869}
  • meet-the-frontend-live-preview-panel/trunk/classes/Panel.php

    r3820037 r3822693  
    170170                'meet-the-frontend-live-preview-panel'
    171171            ),
     172            'savedPostConflict' => LivePreview::conflictMessage(),
    172173            'reviewBeforeReload' => __(
    173                 'Copy any changes you want to keep. Then reload the editor before saving again.',
     174                'Copy any unsaved changes you want to keep, then reload the editor to resume live preview.',
    174175                'meet-the-frontend-live-preview-panel'
    175176            ),
  • meet-the-frontend-live-preview-panel/trunk/meet-the-frontend-live-preview-panel.php

    r3820590 r3822693  
    55 * Plugin URI:        https://github.com/timohubois/meet-the-frontend-live-preview-panel/
    66 * Description:       See your changes in a floating preview while you edit posts, pages and taxonomy terms.
    7  * Version:           1.3.0
     7 * Version:           1.3.1
    88 * Requires at least: 6.9
    99 * Requires PHP:      8.3
  • meet-the-frontend-live-preview-panel/trunk/readme.txt

    r3820590 r3822693  
    44Requires at least: 6.9
    55Tested up to: 7.1
    6 Stable tag: 1.3.0
     6Stable tag: 1.3.1
    77Requires PHP: 8.3
    88License: GPLv3 or later
    … …  
    5555= Can I preview older revisions? =
    5656
    57 Yes. **Preview revision**, next to **Go to editor**, opens a floating window without narrowing the diff. It follows the right-hand **To** selection without restoring it or changing your saved post.
     57Yes, on the classic Revisions screen. If you’re in Visual Revisions in the Block Editor, choose **Open classic revisions screen** in the Settings sidebar first. Then click **Preview revision** next to **Go to editor**. The floating window follows the right-hand **To** selection without narrowing the diff, restoring the revision or changing your saved post.
    5858
    5959Historical content and supported stored fields use your current theme and settings. The post's author, publication date, categories and tags remain current. Not every field has a historical value. Some values remain current, while missing historical values may be empty. This is a content preview, not a snapshot of the whole site.
    … …  
    114114== Changelog ==
    115115
     116= 1.3.1 =
     117* Keep WordPress's native Preview in a separate tab in both the Classic and Block Editors.
     118* Follow more changes in the live preview, including ACF Flexible Content row moves and gallery edits.
     119* Preview the page assigned to display your latest posts, including from its revision history.
     120* Fix Classic revision preview startup and pause live updates while browsing Visual Revisions.
     121* Avoid false preview conflicts after comment moderation, embed cache updates, or unrelated metadata changes.
     122* Improve Timber 1 and 2 compatibility for post and term previews.
     123
    116124= 1.3.0 =
    117125* Open the floating live preview from the Block Editor's View menu. On narrow screens, use the floating launcher.
Note: See TracChangeset for help on using the changeset viewer.