ghost 6.19.0 → 6.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/components/tryghost-i18n-6.19.1.tgz +0 -0
  2. package/components/{tryghost-parse-email-address-6.19.0.tgz → tryghost-parse-email-address-6.19.1.tgz} +0 -0
  3. package/core/built/admin/assets/{PolarAngleAxis-CGprvq8M.js → PolarAngleAxis-BzbazaED.js} +1 -1
  4. package/core/built/admin/assets/{_baseAssignValue-Bwn07Ln5.js → _baseAssignValue-D0bBhNG1.js} +1 -1
  5. package/core/built/admin/assets/{a-large-small-p58xibEK.js → a-large-small-gBDqOWOy.js} +1 -1
  6. package/core/built/admin/assets/{at-sign-BZPuAx5m.js → at-sign-V79EBNTJ.js} +1 -1
  7. package/core/built/admin/assets/{audience-Cy9gLIa9.js → audience-DF--nR_q.js} +1 -1
  8. package/core/built/admin/assets/{avatar-flipboard-CLmWb5Xn.js → avatar-flipboard-GK39JNWl.js} +1 -1
  9. package/core/built/admin/assets/{bluesky-sharing-BHt0oiii.js → bluesky-sharing-BKRqTAow.js} +1 -1
  10. package/core/built/admin/assets/{chart--RFLGIL4.js → chart-0ezwQhyB.js} +1 -1
  11. package/core/built/admin/assets/{chunk.524.5c5c3f3273a86d1d9913.js → chunk.524.e62f8276cc561fcddb66.js} +6 -6
  12. package/core/built/admin/assets/{chunk.582.e6c787cdf7e6de7819e0.js → chunk.582.0cdc35e120cf621f18b9.js} +8 -8
  13. package/core/built/admin/assets/{code-editor-view-BW9y0JXN.js → code-editor-view-xVA7A1IE.js} +1 -1
  14. package/core/built/admin/assets/{comments-C_lilDBp.js → comments-Tt1iOjcd.js} +1 -1
  15. package/core/built/admin/assets/{content-helpers-BOnQQADZ.js → content-helpers-TSHyiXwF.js} +1 -1
  16. package/core/built/admin/assets/{copy-Bi7VpgPR.js → copy-CTHgI4YI.js} +1 -1
  17. package/core/built/admin/assets/{data-list-Bu3jzs1s.js → data-list-6rXP5AUF.js} +1 -1
  18. package/core/built/admin/assets/{deleted-feed-item-B-doIIKc.js → deleted-feed-item-CK_4qToF.js} +1 -1
  19. package/core/built/admin/assets/{edit-profile-ZBdjFfvL.js → edit-profile-B_ViIhsd.js} +1 -1
  20. package/core/built/admin/assets/{empty-indicator-C6BBh99D.js → empty-indicator-CzTRebSi.js} +1 -1
  21. package/core/built/admin/assets/{en-C7eSFQRw.js → en-D1H4BpXe.js} +1 -1
  22. package/core/built/admin/assets/{feed-CAioauwD.js → feed-0iLmr_Xb.js} +1 -1
  23. package/core/built/admin/assets/{filters-DEKF0tIB.js → filters-6zg35bLL.js} +1 -1
  24. package/core/built/admin/assets/{gh-chart-D9KI0_sO.js → gh-chart-ldqA2tQU.js} +1 -1
  25. package/core/built/admin/assets/{ghost-6bff5c535ef015b0ed9421ceb6c699a7.js → ghost-6b109ed708c502afee4ff1d9185ae40c.js} +256 -268
  26. package/core/built/admin/assets/ghost-b3dff8469d9c9af487866537210234bd.css +1 -0
  27. package/core/built/admin/assets/ghost-dark-16a7b98c352c1f70016e73af10962179.css +1 -0
  28. package/core/built/admin/assets/{growth-C6XGchvT.js → growth-BUQvBEMA.js} +1 -1
  29. package/core/built/admin/assets/{hash-DFhnGHId.js → hash-CRtHv162.js} +1 -1
  30. package/core/built/admin/assets/{inbox-p-Y5uScT.js → inbox-DWYGFLuU.js} +1 -1
  31. package/core/built/admin/assets/{index-CIZ_upe2.js → index-1J5JrBgd.js} +1 -1
  32. package/core/built/admin/assets/{index-CS4XqyC-.js → index-BFT8PQPd.js} +1 -1
  33. package/core/built/admin/assets/{index-BWnrLoWI.js → index-BeG1PnbN.js} +1 -1
  34. package/core/built/admin/assets/{index-DCTdAEHx.js → index-Bgo4hw-T.js} +3 -3
  35. package/core/built/admin/assets/{index-jAidr8jI.js → index-CCmy-hD6.js} +1 -1
  36. package/core/built/admin/assets/index-CKfif8kf.js +13 -0
  37. package/core/built/admin/assets/{index-FPf-AERu.js → index-Cc9yKRsT.js} +1 -1
  38. package/core/built/admin/assets/{index-3uU4zg_6.js → index-CvV71sVO.js} +1 -1
  39. package/core/built/admin/assets/{index-LyfDjTto.js → index-D0RISNEd.js} +1 -1
  40. package/core/built/admin/assets/{index-JmqyGBro.js → index-D1AppGlg.js} +1 -1
  41. package/core/built/admin/assets/{index-D17PEsUB.js → index-EFWmaChO.js} +1 -1
  42. package/core/built/admin/assets/{index-Wx8_AGZX.js → index-SulwGym9.js} +1 -1
  43. package/core/built/admin/assets/{index-lPLmWtv0.js → index-_dLVP2u2.js} +1 -1
  44. package/core/built/admin/assets/{index-BzU2odQq.js → index-nb8rSrz_.js} +1 -1
  45. package/core/built/admin/assets/{index--VlvGKWi.js → index-zvNmrx86.js} +1 -1
  46. package/core/built/admin/assets/{koenig-lexical-CWnkYKQt.js → koenig-lexical-D8K6acyr.js} +1 -1
  47. package/core/built/admin/assets/{kpi-card-B5UaJgOT.js → kpi-card-CaX6eHyr.js} +1 -1
  48. package/core/built/admin/assets/{kpis-Cc2RxnvZ.js → kpis-BfR_uoFr.js} +1 -1
  49. package/core/built/admin/assets/{label-CW7Kmp9w.js → label-BQ5mfFHN.js} +1 -1
  50. package/core/built/admin/assets/{links-wWNc9Uat.js → links-lZnz9cuZ.js} +1 -1
  51. package/core/built/admin/assets/{list-filter-3EF6cVg-.js → list-filter-CofVbkA4.js} +1 -1
  52. package/core/built/admin/assets/{lucide-react-DtMIZssr.js → lucide-react-7D_Tsesk.js} +1 -1
  53. package/core/built/admin/assets/{main-layout-BFYhCrLn.js → main-layout-DBVy-lM5.js} +1 -1
  54. package/core/built/admin/assets/{message-square-text-BDZtUW-2.js → message-square-text-DzuHB7uU.js} +1 -1
  55. package/core/built/admin/assets/{minus-CSphShdJ.js → minus-BIdO1CDG.js} +1 -1
  56. package/core/built/admin/assets/{modals-CDWP04Iy.js → modals-GY5yP0Bl.js} +1 -1
  57. package/core/built/admin/assets/{moderation-qcng2_lB.js → moderation-CB9TwdgZ.js} +1 -1
  58. package/core/built/admin/assets/{newsletter-R-IYcV4M.js → newsletter-Bww4nkp5.js} +1 -1
  59. package/core/built/admin/assets/{newsletters-BB4e24i1.js → newsletters-C8pT7kSQ.js} +1 -1
  60. package/core/built/admin/assets/{note-B_bpRX66.js → note-BeCIv25U.js} +1 -1
  61. package/core/built/admin/assets/{overview-Nh-IoP-v.js → overview-BCZDRsR0.js} +1 -1
  62. package/core/built/admin/assets/{pagemenu-Cd45frnF.js → pagemenu-D3ByoZIR.js} +1 -1
  63. package/core/built/admin/assets/{post-analytics-jHZOhQ8L.js → post-analytics-B4z47Loe.js} +1 -1
  64. package/core/built/admin/assets/{post-analytics-context-BST4bzps.js → post-analytics-context-BQ8IcW4n.js} +1 -1
  65. package/core/built/admin/assets/{post-analytics-header-DAZPp6M8.js → post-analytics-header-CpBVLNat.js} +1 -1
  66. package/core/built/admin/assets/{post-share-modal-D1JQfuYx.js → post-share-modal-Dz4BNSV-.js} +1 -1
  67. package/core/built/admin/assets/{posts-DFiJPOft.js → posts-C94RiQ4S.js} +1 -1
  68. package/core/built/admin/assets/{repeat-Smml9n0k.js → repeat-YTCeIlQZ.js} +1 -1
  69. package/core/built/admin/assets/{reply-CooY4lmk.js → reply-CUazFbTY.js} +1 -1
  70. package/core/built/admin/assets/{select-WwMsbBbg.js → select-MVpx-Kfp.js} +1 -1
  71. package/core/built/admin/assets/{settings-CQEhPDQU.js → settings-CEfmF6wO.js} +4 -4
  72. package/core/built/admin/assets/{settings-CxWtvcUf.js → settings-Q3y0Zw5o.js} +1 -1
  73. package/core/built/admin/assets/{sort-button-DFr8vezl.js → sort-button-CEXkgGLb.js} +1 -1
  74. package/core/built/admin/assets/{source-icon-VpYWpwYb.js → source-icon-BDparw9V.js} +1 -1
  75. package/core/built/admin/assets/{sprout-DRqlFJSK.js → sprout-CXg43Zav.js} +1 -1
  76. package/core/built/admin/assets/{square-CwHQ9sJ2.js → square-C8G-1gV_.js} +1 -1
  77. package/core/built/admin/assets/stats/{audience-Caf7BjaU.mjs → audience-DJv-je5C.mjs} +3 -3
  78. package/core/built/admin/assets/stats/{content-helpers-MbtAvUJh.mjs → content-helpers-Bq8zgCUT.mjs} +4 -4
  79. package/core/built/admin/assets/stats/{index-DMkZbbZs.mjs → index-B12PHa64.mjs} +8 -8
  80. package/core/built/admin/assets/stats/{index-wT0OIw_N.mjs → index-DRN41f8l.mjs} +5 -5
  81. package/core/built/admin/assets/stats/{index-ChjIxhHy.mjs → index-DwqY9qrn.mjs} +5 -5
  82. package/core/built/admin/assets/stats/{index-BGqKbF1D.mjs → index-GLg_cfiu.mjs} +464 -461
  83. package/core/built/admin/assets/stats/{index-BTjfXOi6.mjs → index-gS3EAScL.mjs} +5 -5
  84. package/core/built/admin/assets/stats/{sort-button-B8n8fYMi.mjs → sort-button-f_Dfri5f.mjs} +8 -8
  85. package/core/built/admin/assets/stats/{stats-CGH-0JNs.mjs → stats-CTWb7qo1.mjs} +96 -91
  86. package/core/built/admin/assets/stats/stats.js +1 -1
  87. package/core/built/admin/assets/stats/{tabs-EQCUj3Y9.mjs → tabs-DVvxZ7wa.mjs} +7 -7
  88. package/core/built/admin/assets/stats/{use-growth-stats--CIfag21.mjs → use-growth-stats-w7-2bD-r.mjs} +3 -3
  89. package/core/built/admin/assets/{stats-lnFiOQZx.js → stats-B2vPCVx7.js} +1 -1
  90. package/core/built/admin/assets/stats-view-BRy4IDHe.js +1 -0
  91. package/core/built/admin/assets/{step-1-Bx8MiQVF.js → step-1-MLqNxHrJ.js} +1 -1
  92. package/core/built/admin/assets/{step-2-CLLXppER.js → step-2-DY3jIa6G.js} +1 -1
  93. package/core/built/admin/assets/{step-3-C5WrQe8u.js → step-3-Dt6w5-MB.js} +1 -1
  94. package/core/built/admin/assets/{table-2waWpIF5.js → table-BWAnP2ln.js} +1 -1
  95. package/core/built/admin/assets/{tabs-CBD0hW8V.js → tabs-Bw13eFRh.js} +1 -1
  96. package/core/built/admin/assets/{tags-CKrBptuC.js → tags-BQz2NtFF.js} +1 -1
  97. package/core/built/admin/assets/{tags-Bgw5Hrb5.js → tags-Bj9RJW9l.js} +1 -1
  98. package/core/built/admin/assets/{tiers-CO-pz1FX.js → tiers-jCNws2RK.js} +1 -1
  99. package/core/built/admin/assets/{toggle-group-BXAZzvJ9.js → toggle-group-B0wGpmLS.js} +1 -1
  100. package/core/built/admin/assets/{topic-filter-U3qUH2P_.js → topic-filter-BPOZf5IO.js} +1 -1
  101. package/core/built/admin/assets/{trash-CJY1Wro_.js → trash-BKeiM6WP.js} +1 -1
  102. package/core/built/admin/assets/{use-growth-stats-BrLZI7da.js → use-growth-stats-C5TiRW1S.js} +1 -1
  103. package/core/built/admin/assets/{use-infinite-virtual-scroll-CiRn3kpz.js → use-infinite-virtual-scroll-CdNJ5RT5.js} +1 -1
  104. package/core/built/admin/assets/{use-simple-pagination-CskJ0MDP.js → use-simple-pagination-CCVB_aJH.js} +1 -1
  105. package/core/built/admin/assets/{user-round-check-zOuzV3OS.js → user-round-check-Df7ko4Tm.js} +1 -1
  106. package/core/built/admin/assets/{wallet-cards-ddLuIN-b.js → wallet-cards-Cl4bJBBw.js} +1 -1
  107. package/core/built/admin/assets/{web-CGbkZWn3.js → web-DxLX2yUi.js} +1 -1
  108. package/core/built/admin/index.html +5 -5
  109. package/core/frontend/helpers/get.js +51 -3
  110. package/core/server/api/endpoints/utils/serializers/input/utils/slug-filter-order.js +8 -5
  111. package/core/server/models/base/plugins/crud.js +6 -1
  112. package/core/server/services/email-suppression-list/email-suppression-list.js +1 -1
  113. package/package.json +16 -10
  114. package/yarn.lock +128 -181
  115. package/components/tryghost-i18n-6.19.0.tgz +0 -0
  116. package/core/built/admin/assets/ghost-3c48d37b32f4fcd7eb15cfd739905a03.css +0 -1
  117. package/core/built/admin/assets/ghost-dark-0100fe3ec7b4c3f6d8d043c904254a63.css +0 -1
  118. package/core/built/admin/assets/index-S62-c8TV.js +0 -13
  119. package/core/built/admin/assets/stats-view-BJVawuIv.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as r,r as D,aH as ye,e as ot,d7 as x_,av as Gg,aq as b_,ar as v_,as as Xg,aw as w_,au as el,aE as Jf,ax as y_,ay as If,az as __,aF as k_,aG as M_,d8 as nt,ad as ns,bJ as it,d9 as ao,da as On,db as mt,dc as gt,cF as Kg,cW as Vg,dd as Zg,de as uh,df as j_,dg as Xr,dh as E_,di as ts,aB as T_,dj as N_,d6 as ed,d5 as Bs,dk as Wa,ak as S_,aN as A_,dl as C_,dm as tl,dn as td,dp as fh,dq as Lt,dr as Ja,ds as Df,dt as I_,du as qs,dv as D_,dw as R_,dx as O_,dy as Wi,dz as $_,dA as P_,dB as Rf,ac as L_,dC as F_,dD as U_,dE as z_,dF as H_,dG as Cn,dH as dh,dI as ph,dJ as B_}from"./index-DCTdAEHx.js";import{H as bt,a as Kr,S as Ys,B as Ue,x as rl,K as W_,y as Xt,z as q_,A as Ot,M as vt,C as Gr,F as Y_,G as fn,J as rd,O as G_,Q as nl,U as _e,V as Ve,W as X_,X as nd,Y as Qe,Z as cn,_ as $n,$ as Et,a0 as St,a1 as ss,a2 as pr,a3 as K_,a4 as hh,a5 as et,a6 as je,a7 as mh,a8 as gh,a9 as rt,aa as Qg,ab as Jg,ac as V_,ad as Z_,ae as Q_,af as J_,ag as Xs,ah as Ks,ai as Vr,aj as dn,ak as Va,al as e2,am as t2,an as r2,ao as n2,ap as s2,aq as qi,ar as Yi,as as a2,at as xh,au as bh,av as o2,aw as Vs,ax as un,ay as ln,az as e0,aA as i2,aB as l2,aC as c2,aD as t0,aE as sd,aF as u2,aG as f2,aH as d2,aI as Gi,aJ as ad,aK as p2,aL as od,aM as h2,aN as m2,aO as r0,aP as n0,aQ as id,aR as g2,aS as x2,aT as b2,aU as s0,aV as a0,aW as v2,aX as w2,aY as vh,aZ as o0,a_ as i0,a$ as l0,b0 as Of,b1 as y2,b2 as _2,b3 as k2,b4 as c0,b5 as Hi,b6 as M2,b7 as u0,b8 as f0,b9 as j2,ba as E2,bb as wh,bc as T2,bd as ld,be as yh,bf as N2,bg as d0,bh as cd,bi as ud,bj as S2,bk as A2,bl as p0,bm as C2,bn as h0,bo as I2,bp as D2,bq as R2}from"./settings-CQEhPDQU.js";import{a as O2,u as m0,b as g0}from"./newsletters-BB4e24i1.js";import{C as $2,a as P2}from"./index-lPLmWtv0.js";import{u as x0}from"./posts-DFiJPOft.js";import{a as Zs,b as fd,c as L2,g as sl}from"./tiers-CO-pz1FX.js";import{L as F2}from"./list-filter-3EF6cVg-.js";import"./index-LyfDjTto.js";function U2(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}const b0=({children:e,...s})=>r.jsx("div",{className:"flex h-full w-full flex-col px-8",...s,children:r.jsx("div",{className:"h-full w-full overflow-hidden rounded-t-[4px] shadow-sm",children:e})}),v0=({children:e,...s})=>r.jsx("div",{className:"flex h-[775px] w-[380px] flex-col rounded-3xl bg-white p-2 shadow-xl dark:bg-grey-900",...s,children:r.jsx("div",{className:"w-100 h-100 grow overflow-auto rounded-2xl border border-grey-100 dark:border-grey-950",children:e})}),z2=({title:e,label:s,value:a,onChange:o,disabled:c,error:h,hint:y,checked:m,separator:l,testId:f})=>{const u=D.useId(),d=g=>{o(g===!0)};return r.jsxs("div",{children:[r.jsxs("div",{className:`flex flex-col gap-1 ${l&&"pb-2"}`,children:[e&&r.jsx(bt,{grey:!0,level:6,children:e}),r.jsxs("label",{className:`flex cursor-pointer items-start ${e&&"-mb-1 mt-1"}`,htmlFor:u,children:[r.jsx($2,{className:"mt-0.5 flex size-4 cursor-pointer appearance-none items-center justify-center rounded-[3px] border border-solid border-grey-500 bg-white outline-none data-[state=checked]:border-black data-[state=indeterminate]:border-black data-[state=checked]:bg-black data-[state=indeterminate]:bg-black","data-testid":f,defaultChecked:m,disabled:c,id:u,value:a,onCheckedChange:d,children:r.jsx(P2,{children:r.jsx("svg",{fill:"none",height:"11",viewBox:"0 0 10 11",width:"10",children:r.jsx("path",{d:"M1 5.88889L4.6 9L9 1",stroke:"white",strokeLinecap:"round",strokeWidth:"2"})})})}),r.jsxs("div",{className:`ml-2 flex flex-col ${y&&"mb-2"}`,children:[r.jsx("span",{className:`inline-block text-[1.425rem] dark:text-white ${y&&"-mb-1"}`,children:s}),y&&r.jsx(Kr,{color:h?"red":"",children:y})]})]})]}),(l||h)&&r.jsx(Ys,{className:h?"border-red":""})]})},$f=({title:e,checkboxes:s,hint:a,error:o})=>r.jsxs("div",{children:[e&&r.jsx(bt,{grey:!0,level:6,children:e}),r.jsx("div",{className:"mt-2 flex flex-col gap-1",children:s?.map(({key:c,...h})=>r.jsx(z2,{...h},c))}),r.jsx("div",{className:`flex flex-col ${a&&"mb-2"}`,children:a&&r.jsx(Kr,{color:o?"red":"",children:a})})]}),H2=({hex:e,value:s,title:a,size:o="md",isSelected:c,onSelect:h})=>{const y=D.useRef(null),m=u=>{u.preventDefault(),h(s!==void 0?s:e)},l=e.length===4&&e[3]==="0"||e.length===8&&e.slice(6)==="00";let f="h-5 w-5";switch(o){case"lg":f="w-6 h-6";break}return r.jsx("button",{ref:y,className:ye("relative flex shrink-0 cursor-pointer items-center rounded-full border border-grey-300 dark:border-grey-800",f,c&&"outline outline-2 outline-green"),style:{backgroundColor:e},title:a,type:"button",onClick:m,children:l&&r.jsx("div",{className:"absolute left-0 top-0 z-10 w-[136%] origin-left rotate-45 border-b border-b-red"})})},w0=({title:e,value:s,swatches:a,swatchSize:o="md",onSwatchChange:c,onTogglePicker:h,isExpanded:y,picker:m=!0,containerClassName:l})=>{const f=a.find(d=>d.value===s||d.hex===s);l=ye("flex flex-col gap-3");const u=y||!m;return r.jsxs("div",{className:l,children:[e&&r.jsx(bt,{useLabelTag:!0,children:e}),r.jsxs("div",{className:"flex gap-1",children:[u&&r.jsx("div",{className:"flex items-center gap-1",children:a.map(({customContent:d,...g})=>d?r.jsx(D.Fragment,{children:d},g.title):r.jsx(H2,{isSelected:f?.title===g.title,size:o,onSelect:c,...g},g.title))}),m&&r.jsxs("button",{"aria-label":"Pick color",className:"relative size-6 cursor-pointer rounded-full border border-grey-250 dark:border-grey-800",type:"button",onClick:h,children:[r.jsx("div",{className:"absolute inset-0 rounded-full bg-[conic-gradient(hsl(360,100%,50%),hsl(315,100%,50%),hsl(270,100%,50%),hsl(225,100%,50%),hsl(180,100%,50%),hsl(135,100%,50%),hsl(90,100%,50%),hsl(45,100%,50%),hsl(0,100%,50%))]"}),f&&r.jsx("div",{className:"absolute inset-[3px] overflow-hidden rounded-full border border-white dark:border-grey-950",style:{backgroundColor:f.hex},children:f.hex==="transparent"&&r.jsx("div",{className:"absolute left-[3px] top-[3px] z-10 w-[136%] origin-left rotate-45 border-b border-b-red"})}),!f&&s&&r.jsx("div",{className:"absolute inset-[3px] overflow-hidden rounded-full border border-white dark:border-grey-950",style:{backgroundColor:s},children:s==="transparent"&&r.jsx("div",{className:"absolute left-[3px] top-[3px] z-10 w-[136%] origin-left rotate-45 border-b border-b-red"})})]})]})]})};function Qs(){return(Qs=Object.assign||function(e){for(var s=1;s<arguments.length;s++){var a=arguments[s];for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(e[o]=a[o])}return e}).apply(this,arguments)}function al(e,s){if(e==null)return{};var a,o,c={},h=Object.keys(e);for(o=0;o<h.length;o++)s.indexOf(a=h[o])>=0||(c[a]=e[a]);return c}function eo(e){var s=D.useRef(e),a=D.useRef(function(o){s.current&&s.current(o)});return s.current=e,a.current}var to=function(e,s,a){return s===void 0&&(s=0),a===void 0&&(a=1),e>a?a:e<s?s:e},Za=function(e){return"touches"in e},Pf=function(e){return e&&e.ownerDocument.defaultView||self},_h=function(e,s,a){var o=e.getBoundingClientRect(),c=Za(s)?(function(h,y){for(var m=0;m<h.length;m++)if(h[m].identifier===y)return h[m];return h[0]})(s.touches,a):s;return{left:to((c.pageX-(o.left+Pf(e).pageXOffset))/o.width),top:to((c.pageY-(o.top+Pf(e).pageYOffset))/o.height)}},kh=function(e){!Za(e)&&e.preventDefault()},y0=ot.memo(function(e){var s=e.onMove,a=e.onKey,o=al(e,["onMove","onKey"]),c=D.useRef(null),h=eo(s),y=eo(a),m=D.useRef(null),l=D.useRef(!1),f=D.useMemo(function(){var v=function(M){kh(M),(Za(M)?M.touches.length>0:M.buttons>0)&&c.current?h(_h(c.current,M,m.current)):k(!1)},_=function(){return k(!1)};function k(M){var T=l.current,A=Pf(c.current),I=M?A.addEventListener:A.removeEventListener;I(T?"touchmove":"mousemove",v),I(T?"touchend":"mouseup",_)}return[function(M){var T=M.nativeEvent,A=c.current;if(A&&(kh(T),!(function(R,$){return $&&!Za(R)})(T,l.current)&&A)){if(Za(T)){l.current=!0;var I=T.changedTouches||[];I.length&&(m.current=I[0].identifier)}A.focus(),h(_h(A,T,m.current)),k(!0)}},function(M){var T=M.which||M.keyCode;T<37||T>40||(M.preventDefault(),y({left:T===39?.05:T===37?-.05:0,top:T===40?.05:T===38?-.05:0}))},k]},[y,h]),u=f[0],d=f[1],g=f[2];return D.useEffect(function(){return g},[g]),ot.createElement("div",Qs({},o,{onTouchStart:u,onMouseDown:u,className:"react-colorful__interactive",ref:c,onKeyDown:d,tabIndex:0,role:"slider"}))}),dd=function(e){return e.filter(Boolean).join(" ")},_0=function(e){var s=e.color,a=e.left,o=e.top,c=o===void 0?.5:o,h=dd(["react-colorful__pointer",e.className]);return ot.createElement("div",{className:h,style:{top:100*c+"%",left:100*a+"%"}},ot.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:s}}))},Gt=function(e,s,a){return s===void 0&&(s=0),a===void 0&&(a=Math.pow(10,s)),Math.round(a*e)/a},B2=function(e){return X2(Lf(e))},Lf=function(e){return e[0]==="#"&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?Gt(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?Gt(parseInt(e.substring(6,8),16)/255,2):1}},W2=function(e){return G2(Y2(e))},q2=function(e){var s=e.s,a=e.v,o=e.a,c=(200-s)*a/100;return{h:Gt(e.h),s:Gt(c>0&&c<200?s*a/100/(c<=100?c:200-c)*100:0),l:Gt(c/2),a:Gt(o,2)}},Ff=function(e){var s=q2(e);return"hsl("+s.h+", "+s.s+"%, "+s.l+"%)"},Y2=function(e){var s=e.h,a=e.s,o=e.v,c=e.a;s=s/360*6,a/=100,o/=100;var h=Math.floor(s),y=o*(1-a),m=o*(1-(s-h)*a),l=o*(1-(1-s+h)*a),f=h%6;return{r:Gt(255*[o,m,y,y,l,o][f]),g:Gt(255*[l,o,o,m,y,y][f]),b:Gt(255*[y,y,l,o,o,m][f]),a:Gt(c,2)}},Ri=function(e){var s=e.toString(16);return s.length<2?"0"+s:s},G2=function(e){var s=e.r,a=e.g,o=e.b,c=e.a,h=c<1?Ri(Gt(255*c)):"";return"#"+Ri(s)+Ri(a)+Ri(o)+h},X2=function(e){var s=e.r,a=e.g,o=e.b,c=e.a,h=Math.max(s,a,o),y=h-Math.min(s,a,o),m=y?h===s?(a-o)/y:h===a?2+(o-s)/y:4+(s-a)/y:0;return{h:Gt(60*(m<0?m+6:m)),s:Gt(h?y/h*100:0),v:Gt(h/255*100),a:c}},K2=ot.memo(function(e){var s=e.hue,a=e.onChange,o=dd(["react-colorful__hue",e.className]);return ot.createElement("div",{className:o},ot.createElement(y0,{onMove:function(c){a({h:360*c.left})},onKey:function(c){a({h:to(s+360*c.left,0,360)})},"aria-label":"Hue","aria-valuenow":Gt(s),"aria-valuemax":"360","aria-valuemin":"0"},ot.createElement(_0,{className:"react-colorful__hue-pointer",left:s/360,color:Ff({h:s,s:100,v:100,a:1})})))}),V2=ot.memo(function(e){var s=e.hsva,a=e.onChange,o={backgroundColor:Ff({h:s.h,s:100,v:100,a:1})};return ot.createElement("div",{className:"react-colorful__saturation",style:o},ot.createElement(y0,{onMove:function(c){a({s:100*c.left,v:100-100*c.top})},onKey:function(c){a({s:to(s.s+100*c.left,0,100),v:to(s.v-100*c.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+Gt(s.s)+"%, Brightness "+Gt(s.v)+"%"},ot.createElement(_0,{className:"react-colorful__saturation-pointer",top:1-s.v/100,left:s.s/100,color:Ff(s)})))}),k0=function(e,s){if(e===s)return!0;for(var a in e)if(e[a]!==s[a])return!1;return!0},Z2=function(e,s){return e.toLowerCase()===s.toLowerCase()||k0(Lf(e),Lf(s))};function Q2(e,s,a){var o=eo(a),c=D.useState(function(){return e.toHsva(s)}),h=c[0],y=c[1],m=D.useRef({color:s,hsva:h});D.useEffect(function(){if(!e.equal(s,m.current.color)){var f=e.toHsva(s);m.current={hsva:f,color:s},y(f)}},[s,e]),D.useEffect(function(){var f;k0(h,m.current.hsva)||e.equal(f=e.fromHsva(h),m.current.color)||(m.current={hsva:h,color:f},o(f))},[h,e,o]);var l=D.useCallback(function(f){y(function(u){return Object.assign({},u,f)})},[]);return[h,l]}var J2=typeof window<"u"?D.useLayoutEffect:D.useEffect,e3=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},Mh=new Map,t3=function(e){J2(function(){var s=e.current?e.current.ownerDocument:document;if(s!==void 0&&!Mh.has(s)){var a=s.createElement("style");a.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,Mh.set(s,a);var o=e3();o&&a.setAttribute("nonce",o),s.head.appendChild(a)}},[])},r3=function(e){var s=e.className,a=e.colorModel,o=e.color,c=o===void 0?a.defaultColor:o,h=e.onChange,y=al(e,["className","colorModel","color","onChange"]),m=D.useRef(null);t3(m);var l=Q2(a,c,h),f=l[0],u=l[1],d=dd(["react-colorful",s]);return ot.createElement("div",Qs({},y,{ref:m,className:d}),ot.createElement(V2,{hsva:f,onChange:u}),ot.createElement(K2,{hue:f.h,onChange:u,className:"react-colorful__last-control"}))},n3={defaultColor:"000",toHsva:B2,fromHsva:function(e){return W2({h:e.h,s:e.s,v:e.v,a:1})},equal:Z2},s3=function(e){return ot.createElement(r3,Qs({},e,{colorModel:n3}))},a3=/^#?([0-9A-F]{3,8})$/i,o3=function(e){var s=e.color,a=s===void 0?"":s,o=e.onChange,c=e.onBlur,h=e.escape,y=e.validate,m=e.format,l=e.process,f=al(e,["color","onChange","onBlur","escape","validate","format","process"]),u=D.useState(function(){return h(a)}),d=u[0],g=u[1],v=eo(o),_=eo(c),k=D.useCallback(function(T){var A=h(T.target.value);g(A),y(A)&&v(l?l(A):A)},[h,l,y,v]),M=D.useCallback(function(T){y(T.target.value)||g(h(a)),_(T)},[a,h,y,_]);return D.useEffect(function(){g(h(a))},[a,h]),ot.createElement("input",Qs({},f,{value:m?m(d):d,spellCheck:"false",onChange:k,onBlur:M}))},jh=function(e){return"#"+e},i3=function(e){var s=e.prefixed,a=e.alpha,o=al(e,["prefixed","alpha"]),c=D.useCallback(function(y){return y.replace(/([^0-9A-F]+)/gi,"").substring(0,a?8:6)},[a]),h=D.useCallback(function(y){return(function(m,l){var f=a3.exec(m),u=f?f[1].length:0;return u===3||u===6||!!l&&u===4||!!l&&u===8})(y,a)},[a]);return ot.createElement(o3,Qs({},o,{escape:c,format:s?jh:void 0,process:jh,validate:h}))};const l3=({hexValue:e,eyedropper:s,clearButtonValue:a,containerClassName:o,onChange:c})=>{const h=D.useRef(null),y=D.useCallback(g=>{var v,_,k;g.stopPropagation();const M=(v=h.current)==null?void 0:v.querySelector("input");g.target!==M&&((k=(_=h.current)==null?void 0:_.querySelector("input"))==null||k.focus(),g.preventDefault())},[]),m=D.useRef(!1),l=D.useCallback(()=>{var g,v;m.current=!1,(v=(g=h.current)==null?void 0:g.querySelector("input"))==null||v.focus(),document.removeEventListener("mouseup",l),document.removeEventListener("touchend",l)},[]),f=D.useCallback(()=>{m.current=!0,document.addEventListener("mouseup",l),document.addEventListener("touchend",l)},[l]),u=D.useCallback(g=>{if(g.preventDefault(),!window.EyeDropper)return;m.current=!0,document.body.style.setProperty("pointer-events","none"),new window.EyeDropper().open().then(_=>c?.(_.sRGBHex)).finally(()=>{var _,k;m.current=!1,document.body.style.removeProperty("pointer-events"),(k=(_=h.current)==null?void 0:_.querySelector("input"))==null||k.focus()})},[c]);D.useEffect(()=>{var g,v;(v=(g=h.current)==null?void 0:g.querySelector("input"))==null||v.focus()},[]);const d=D.useCallback(()=>{var g,v;(v=(g=h.current)==null?void 0:g.querySelector("input"))==null||v.focus()},[]);return o=ye("mt-2",o),r.jsxs("div",{className:o,onMouseDown:y,onTouchStart:y,children:[r.jsx(s3,{className:"w-full",color:e||"#ffffff",onChange:c,onMouseDown:f,onTouchStart:f}),r.jsxs("div",{className:"mt-3 flex gap-2",children:[r.jsxs("div",{ref:h,className:"peer relative order-2 flex h-10 w-full items-center",onClick:d,children:[r.jsx("span",{className:"absolute left-2 top-[9px] z-10 ml-1 mr-2 text-grey-700",children:"#"}),r.jsx(i3,{"aria-label":"Color value",className:"z-[1] w-full rounded-md border border-transparent bg-grey-150 p-2 pl-6 transition-all hover:bg-grey-100 focus:border-green focus:bg-white focus:shadow-[0_0_0_1px_rgba(48,207,67,1)] dark:bg-grey-900 dark:text-white dark:focus:bg-grey-925",color:e,onChange:c}),s&&!!window.EyeDropper&&r.jsx("button",{className:"absolute inset-y-0 right-3 z-50 my-auto h-4 w-4 p-[1px]",type:"button",onClick:u,children:r.jsx(x_,{className:"h-full w-full"})})]}),a!==void 0&&r.jsx(Ue,{color:"grey",value:"Clear",onClick:()=>c?.(a)})]})]})},c3=D.createContext({colorPickers:[]}),Eh=e=>e.length===4?e.replace(/#(.)(.)(.)/,"#$1$1$2$2$3$3"):e,Yr=({testId:e,title:s,direction:a,value:o,hint:c,error:h,eyedropper:y,clearButtonValue:m,onChange:l,swatches:f=[],alwaysOpen:u=!1,debounceMs:d})=>{const[g,v]=D.useState(!1),[_,k]=D.useState(o),M=D.useContext(c3),T=D.useId();D.useEffect(()=>{k(W=>Eh(W||"")===o?W:o)},[o]),D.useEffect(()=>(M.colorPickers.push({id:T,setExpanded:v}),()=>{M.colorPickers=M.colorPickers.filter(W=>W.id!==T)}),[M,T]),D.useEffect(()=>{if(g){M.colorPickers.filter(O=>O.id!==T).forEach(O=>O.setExpanded(!1));const W=()=>{v(!1)};return document.addEventListener("click",W),()=>{document.removeEventListener("click",W)}}},[M,T,g]);const A=D.useMemo(()=>l&&d?rl(l,d):l,[d,l]),I=W=>{k(W),A?.(W?Eh(W):null)};let R=r.jsx(w0,{isExpanded:g,swatches:f,value:_,onSwatchChange:W=>{I(W),v(!1)},onTogglePicker:()=>!u&&v(!g)});s&&(R=r.jsxs("div",{className:ye("flex w-full cursor-pointer items-start first:mt-0 dark:text-white",a==="rtl"&&"flex-row-reverse"),children:[r.jsx("div",{className:"shrink-0",children:R}),r.jsxs("div",{className:ye("flex-1",a==="rtl"?"pr-2":"pl-2",c?"mt-[-2px]":"mt-[1px]"),onClick:()=>!u&&v(!g),children:[s,c&&r.jsx("div",{className:`text-xs ${h?"text-red":"text-grey-700"}`,children:c})]})]}));const $=f.find(W=>W.value===_);return r.jsxs("div",{className:"flex-col","data-testid":e,onClick:W=>W.stopPropagation(),children:[R,(u||g)&&r.jsx(l3,{clearButtonValue:m,eyedropper:y,hexValue:$?.hex||_||void 0,onChange:I})]})},u3=({value:e,onChange:s,singleParagraph:a=!0,...o})=>{const c=D.useCallback(h=>{const m=new DOMParser().parseFromString(h,"text/html");m.querySelectorAll("*").forEach(f=>{f.style.removeProperty("white-space"),f.getAttribute("style")||f.removeAttribute("style")}),m.body.innerHTML!==e&&s?.(m.body.innerHTML)},[e,s]);return r.jsx(W_,{...o,singleParagraph:a,children:h=>r.jsx(h.HtmlOutputPlugin,{html:e,setHtml:c})})},pd=({title:e,hideTitle:s,error:a,hint:o,value:c,clearBg:h=!1,className:y="",containerClassName:m="",hintClassName:l="",unstyled:f=!1,...u})=>{const d=f?"":ye("flex min-h-[32px] items-center rounded-md border border-transparent py-1.5 md:min-h-[36px]",h?"bg-transparent":"bg-grey-150 px-3 dark:bg-grey-900",a?"border-red":"transition-all hover:bg-grey-100 has-[:focus]:border-green has-[:focus]:bg-white has-[:focus]:shadow-[0_0_0_1px_rgba(48,207,67,1)] dark:selection:bg-[rgba(88,101,116,0.99)] dark:hover:bg-grey-925 dark:has-[:focus]:bg-grey-950",e&&!s&&!h&&"mt-2",y);return r.jsxs("div",{className:`flex flex-col ${m}`,children:[e&&r.jsx(bt,{className:s?"sr-only":"",grey:!0,useLabelTag:!0,children:e}),r.jsx("div",{className:d,children:r.jsx(u3,{...u,value:c})}),o&&r.jsx(Kr,{className:l,color:a?"red":"",children:o})]})};var hd="Radio",[f3,M0]=Xg(hd),[d3,p3]=f3(hd),j0=D.forwardRef((e,s)=>{const{__scopeRadio:a,name:o,checked:c=!1,required:h,disabled:y,value:m="on",onCheck:l,form:f,...u}=e,[d,g]=D.useState(null),v=Jf(s,M=>g(M)),_=D.useRef(!1),k=d?f||!!d.closest("form"):!0;return r.jsxs(d3,{scope:a,checked:c,disabled:y,children:[r.jsx(el.button,{type:"button",role:"radio","aria-checked":c,"data-state":S0(c),"data-disabled":y?"":void 0,disabled:y,value:m,...u,ref:v,onClick:If(e.onClick,M=>{c||l?.(),k&&(_.current=M.isPropagationStopped(),_.current||M.stopPropagation())})}),k&&r.jsx(N0,{control:d,bubbles:!_.current,name:o,value:m,checked:c,required:h,disabled:y,form:f,style:{transform:"translateX(-100%)"}})]})});j0.displayName=hd;var E0="RadioIndicator",T0=D.forwardRef((e,s)=>{const{__scopeRadio:a,forceMount:o,...c}=e,h=p3(E0,a);return r.jsx(__,{present:o||h.checked,children:r.jsx(el.span,{"data-state":S0(h.checked),"data-disabled":h.disabled?"":void 0,...c,ref:s})})});T0.displayName=E0;var h3="RadioBubbleInput",N0=D.forwardRef(({__scopeRadio:e,control:s,checked:a,bubbles:o=!0,...c},h)=>{const y=D.useRef(null),m=Jf(y,h),l=k_(a),f=M_(s);return D.useEffect(()=>{const u=y.current;if(!u)return;const d=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(d,"checked").set;if(l!==a&&v){const _=new Event("click",{bubbles:o});v.call(u,a),u.dispatchEvent(_)}},[l,a,o]),r.jsx(el.input,{type:"radio","aria-hidden":!0,defaultChecked:a,...c,tabIndex:-1,ref:m,style:{...c.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});N0.displayName=h3;function S0(e){return e?"checked":"unchecked"}var m3=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ol="RadioGroup",[g3]=Xg(ol,[Gg,M0]),A0=Gg(),C0=M0(),[x3,b3]=g3(ol),I0=D.forwardRef((e,s)=>{const{__scopeRadioGroup:a,name:o,defaultValue:c,value:h,required:y=!1,disabled:m=!1,orientation:l,dir:f,loop:u=!0,onValueChange:d,...g}=e,v=A0(a),_=b_(f),[k,M]=v_({prop:h,defaultProp:c??null,onChange:d,caller:ol});return r.jsx(x3,{scope:a,name:o,required:y,disabled:m,value:k,onValueChange:M,children:r.jsx(w_,{asChild:!0,...v,orientation:l,dir:_,loop:u,children:r.jsx(el.div,{role:"radiogroup","aria-required":y,"aria-orientation":l,"data-disabled":m?"":void 0,dir:_,...g,ref:s})})})});I0.displayName=ol;var D0="RadioGroupItem",R0=D.forwardRef((e,s)=>{const{__scopeRadioGroup:a,disabled:o,...c}=e,h=b3(D0,a),y=h.disabled||o,m=A0(a),l=C0(a),f=D.useRef(null),u=Jf(s,f),d=h.value===c.value,g=D.useRef(!1);return D.useEffect(()=>{const v=k=>{m3.includes(k.key)&&(g.current=!0)},_=()=>g.current=!1;return document.addEventListener("keydown",v),document.addEventListener("keyup",_),()=>{document.removeEventListener("keydown",v),document.removeEventListener("keyup",_)}},[]),r.jsx(y_,{asChild:!0,...m,focusable:!y,active:d,children:r.jsx(j0,{disabled:y,required:h.required,checked:d,...l,...c,name:h.name,ref:u,onCheck:()=>h.onValueChange(c.value),onKeyDown:If(v=>{v.key==="Enter"&&v.preventDefault()}),onFocus:If(c.onFocus,()=>{g.current&&f.current?.click()})})})});R0.displayName=D0;var v3="RadioGroupIndicator",O0=D.forwardRef((e,s)=>{const{__scopeRadioGroup:a,...o}=e,c=C0(a);return r.jsx(T0,{...c,...o,ref:s})});O0.displayName=v3;var w3=I0,y3=R0,_3=O0;const k3=({id:e,title:s,options:a,onSelect:o,error:c,hint:h,selectedOption:y,separator:m})=>r.jsxs(w3,{defaultValue:y,name:e,onValueChange:o,children:[r.jsxs("div",{className:`flex flex-col gap-2 ${m&&"pb-2"}`,children:[s&&r.jsx(bt,{level:6,children:s}),a.map(l=>r.jsxs("label",{className:`flex cursor-pointer items-start ${s&&"-mb-1 mt-1"}`,htmlFor:l.value,children:[r.jsx(y3,{className:"relative float-left mt-[3px] size-4 min-w-[16px] appearance-none rounded-full border-2 border-solid border-grey-300 hover:cursor-pointer focus:shadow-none focus:outline-none focus:ring-0 data-[state=checked]:border-green data-[state=checked]:focus:border-green dark:border-grey-800 dark:text-white dark:data-[state=checked]:border-green dark:data-[state=checked]:focus:border-green",id:l.value,value:l.value,children:r.jsx(_3,{className:"flex size-full items-center justify-center after:block after:size-[6px] after:rounded-full after:border-green after:bg-green after:content-[''] dark:after:border-green dark:after:bg-green"})}),r.jsxs("div",{className:`ml-2 flex flex-col ${l.hint&&"mb-2"}`,children:[r.jsx("span",{className:`inline-block text-md dark:text-white ${l.hint&&"-mb-1"}`,children:l.label}),l.hint&&r.jsx(Kr,{children:l.hint})]})]},l.value)),h&&r.jsx(Kr,{color:c?"red":"",children:h})]}),(m||c)&&r.jsx(Ys,{className:c?"border-red":""})]}),Xi=({children:e,gap:s="md",className:a})=>{let o="gap-3";switch(s){case"sm":o="gap-2";break;case"md":o="gap-3";break;case"lg":o="gap-4";break}return a=ye("flex flex-col",o,a),r.jsx("div",{className:a,children:e})},md=({heading:e,children:s,className:a})=>(a=ye("w-full p-[8vmin] pt-5",a),r.jsxs("div",{className:a,children:[e&&r.jsx(bt,{className:"mb-8",children:e}),s]})),gd=({items:e,backIcon:s=!1,snapBackIcon:a=!0,onBack:o,containerClassName:c,itemClassName:h,activeItemClassName:y,separatorClassName:m})=>{const l=e.length;let f=0;return c=ye("flex items-center gap-2 text-sm",c),y=ye("font-bold",y),h=ye("text-sm",h),r.jsxs("div",{className:c,children:[s&&r.jsx(Ue,{className:a?"mr-1":"mr-6",icon:"arrow-left",iconColorClass:"dark:text-white",size:"sm",link:!0,onClick:o}),e.map(u=>{const d=f===l-1?r.jsx("span",{className:y,children:u.label}):r.jsxs(r.Fragment,{children:[r.jsx("button",{className:`${h} ${u.onClick&&"-mx-1 cursor-pointer rounded-sm px-1 py-px hover:bg-grey-100 dark:hover:bg-grey-900"}`,type:"button",onClick:u.onClick,children:u.label},`bc-${f}`),r.jsx("span",{className:m,children:"/"})]});return f=f+1,d})]})},as=({testId:e,title:s,titleHeadingLevel:a=4,size:o="full",width:c,height:h,sidebar:y="",preview:m,dirty:l=!1,cancelLabel:f="Cancel",okLabel:u="OK",okColor:d="black",previewToolbar:g=!0,leftToolbar:v=!0,rightToolbar:_=!0,deviceSelector:k=!0,siteLink:M,previewToolbarURLs:T,previewBgColor:A="grey",selectedURL:I,previewToolbarTabs:R,previewToolbarBreadcrumbs:$,buttonsDisabled:W,sidebarButtons:O,sidebarHeader:K,sidebarPadding:X=!0,sidebarContentClasses:Y,enableCMDS:P=!0,backDropClick:q,onCancel:ee,onOk:ae,afterClose:ne,onSelectURL:Q,onSelectDesktopView:te,onSelectMobileView:pe,onBreadcrumbsBack:we})=>{const H=Xt(),{setGlobalDirtyState:me}=q_();D.useEffect(()=>{me(l)},[l,me]),D.useEffect(()=>{if(ae){const J=be=>{(be.metaKey||be.ctrlKey)&&be.key==="s"&&(be.preventDefault(),ae())};if(P)return window.addEventListener("keydown",J),()=>{window.removeEventListener("keydown",J)}}});const[xe,U]=D.useState("desktop");if(xe==="mobile"&&k?m=r.jsx(v0,{"data-testid":"preview-mobile",children:m}):xe==="desktop"&&k&&(m=r.jsx(b0,{"data-testid":"preview-desktop",children:m})),g){let J=r.jsx(r.Fragment,{});T?J=r.jsx(Ot,{options:T,selectedOption:T.find(Ce=>Ce.value===I),onSelect:Ce=>Ce&&Q?.(Ce.value)}):R?J=r.jsx(fn,{border:!1,selectedTab:I,tabs:R,width:"wide",onTabChange:Q}):$&&(J=r.jsx(gd,{activeItemClassName:"hidden md:!block md:!visible",containerClassName:"whitespace-nowrap",itemClassName:"hidden md:!block md:!visible",items:$,separatorClassName:"hidden md:!block md:!visible",backIcon:!0,onBack:we}));const be="text-black dark:text-green",Ne="text-grey-500 dark:text-grey-600",De=[{icon:"laptop",label:"Desktop",hideLabel:!0,link:!0,size:"sm",iconColorClass:xe==="desktop"?be:Ne,onClick:te||(()=>{U("desktop")})},{icon:"mobile",label:"Mobile",hideLabel:!0,link:!0,size:"sm",iconColorClass:xe==="mobile"?be:Ne,onClick:pe||(()=>{U("mobile")})}],Ee=k&&r.jsx(Gr,{buttons:De});let oe="";A==="grey"?oe="bg-grey-50 dark:bg-black":A==="greygradient"&&(oe="bg-gradient-to-tr from-white to-[#f9f9fa] dark:from-grey-950 dark:to-black");const Te=ye("min-w-100 absolute inset-y-0 left-0 right-[400px] flex w-full grow flex-col overflow-y-auto",oe);let Ae;M&&(Ae=r.jsx("div",{className:"ml-3 border-l border-grey-400 dark:border-grey-800",children:r.jsxs("a",{className:"ml-3 flex items-center gap-1 text-sm",href:M,rel:"noopener noreferrer",target:"_blank",children:["View site ",r.jsx(nt,{name:"arrow-top-right",size:"xs"})]})})),m=r.jsxs("div",{className:Te,children:[g&&r.jsxs("header",{className:"relative flex h-[80px] shrink-0 items-center justify-center px-8 py-5","data-testid":"design-toolbar",children:[v&&r.jsx("div",{className:"absolute left-8 flex h-full items-center",children:J}),_&&r.jsxs("div",{className:"absolute right-8 flex h-full items-center",children:[Ee,Ae]})]}),r.jsx("div",{className:"flex grow items-center justify-center text-sm text-grey-400",children:m})]})}const L=[];return O||(L.push({key:"cancel-modal",label:f,onClick:ee||(()=>{Y_(l,()=>{H.remove(),ne?.()})}),disabled:W}),L.push({key:"ok-modal",label:u,color:d,onClick:ae,disabled:W})),r.jsx(vt,{afterClose:ne,animate:!1,backDropClick:q,dirty:l,footer:!1,height:h,padding:!1,size:o,testId:e,title:"",width:c,hideXOnMobile:!0,children:r.jsxs("div",{className:"flex h-full grow",children:[r.jsx("div",{className:`relative hidden grow flex-col [@media(min-width:801px)]:!visible [@media(min-width:801px)]:!flex ${A==="grey"?"bg-grey-50":"bg-white dark:bg-black"}`,children:m}),y&&r.jsxs("div",{className:"relative flex size-full flex-col border-l border-grey-100 dark:border-grey-900 [@media(min-width:801px)]:w-auto [@media(min-width:801px)]:basis-[400px]",children:[K||r.jsxs("div",{className:"flex max-h-[82px] items-center justify-between gap-3 px-7 py-6",children:[r.jsx(bt,{level:a,children:s}),O||r.jsx(Gr,{buttons:L})]}),r.jsx("div",{className:`${K?"":"absolute inset-x-0 bottom-0 top-[80px] grow"} ${X&&"p-7 pt-0"} flex flex-col justify-between overflow-y-auto ${Y&&Y}`,children:y})]})]})})},M3=({offset:e,onTrigger:s})=>{const a=D.useRef(null);return D.useEffect(()=>{const o=new IntersectionObserver(c=>{c[0].intersectionRatio<=0||s()});return a.current&&o.observe(a.current),()=>o.disconnect()},[s]),r.jsx("div",{ref:a,className:"absolute w-full",style:{bottom:e}})},$0=({trigger:e,triggerButtonProps:s,items:a,position:o="start",open:c,setOpen:h})=>(e||(e=r.jsx(Ue,{icon:"ellipsis",label:"Menu",hideLabel:!0,...s})),r.jsx(rd,{open:c,position:o,setOpen:h,trigger:e,closeOnItemClick:!0,children:r.jsx("div",{className:"flex min-w-[160px] flex-col justify-stretch py-1",role:"none",children:a.map(y=>r.jsx("button",{className:`mx-1 block cursor-pointer rounded-[2.5px] px-4 py-1.5 text-left text-sm hover:bg-grey-100 dark:hover:bg-grey-925 ${y.destructive&&" text-red-500"}`,type:"button",onClick:m=>{y.onClick&&y.onClick(m)},children:y.label},y.id))})}));var P0=typeof global=="object"&&global&&global.Object===Object&&global,j3=typeof self=="object"&&self&&self.Object===Object&&self,pn=P0||j3||Function("return this")(),Gs=pn.Symbol,L0=Object.prototype,E3=L0.hasOwnProperty,T3=L0.toString,qa=Gs?Gs.toStringTag:void 0;function N3(e){var s=E3.call(e,qa),a=e[qa];try{e[qa]=void 0;var o=!0}catch{}var c=T3.call(e);return o&&(s?e[qa]=a:delete e[qa]),c}var S3=Object.prototype,A3=S3.toString;function C3(e){return A3.call(e)}var I3="[object Null]",D3="[object Undefined]",Th=Gs?Gs.toStringTag:void 0;function oo(e){return e==null?e===void 0?D3:I3:Th&&Th in Object(e)?N3(e):C3(e)}function ro(e){return e!=null&&typeof e=="object"}var Ki=Array.isArray;function F0(e){var s=typeof e;return e!=null&&(s=="object"||s=="function")}var R3="[object AsyncFunction]",O3="[object Function]",$3="[object GeneratorFunction]",P3="[object Proxy]";function U0(e){if(!F0(e))return!1;var s=oo(e);return s==O3||s==$3||s==R3||s==P3}var ou=pn["__core-js_shared__"],Nh=(function(){var e=/[^.]+$/.exec(ou&&ou.keys&&ou.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function L3(e){return!!Nh&&Nh in e}var F3=Function.prototype,U3=F3.toString;function os(e){if(e!=null){try{return U3.call(e)}catch{}try{return e+""}catch{}}return""}var z3=/[\\^$.*+?()[\]{}|]/g,H3=/^\[object .+?Constructor\]$/,B3=Function.prototype,W3=Object.prototype,q3=B3.toString,Y3=W3.hasOwnProperty,G3=RegExp("^"+q3.call(Y3).replace(z3,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function X3(e){if(!F0(e)||L3(e))return!1;var s=U0(e)?G3:H3;return s.test(os(e))}function K3(e,s){return e?.[s]}function Js(e,s){var a=K3(e,s);return X3(a)?a:void 0}var Uf=Js(pn,"WeakMap"),V3=9007199254740991,Z3=/^(?:0|[1-9]\d*)$/;function Q3(e,s){var a=typeof e;return s=s??V3,!!s&&(a=="number"||a!="symbol"&&Z3.test(e))&&e>-1&&e%1==0&&e<s}function z0(e,s){return e===s||e!==e&&s!==s}var J3=9007199254740991;function H0(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=J3}function ek(e){return e!=null&&H0(e.length)&&!U0(e)}var tk=Object.prototype;function rk(e){var s=e&&e.constructor,a=typeof s=="function"&&s.prototype||tk;return e===a}function nk(e,s){for(var a=-1,o=Array(e);++a<e;)o[a]=s(a);return o}var sk="[object Arguments]";function Sh(e){return ro(e)&&oo(e)==sk}var B0=Object.prototype,ak=B0.hasOwnProperty,ok=B0.propertyIsEnumerable,ik=Sh((function(){return arguments})())?Sh:function(e){return ro(e)&&ak.call(e,"callee")&&!ok.call(e,"callee")};function lk(){return!1}var W0=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ah=W0&&typeof module=="object"&&module&&!module.nodeType&&module,ck=Ah&&Ah.exports===W0,Ch=ck?pn.Buffer:void 0,uk=Ch?Ch.isBuffer:void 0,zf=uk||lk,fk="[object Arguments]",dk="[object Array]",pk="[object Boolean]",hk="[object Date]",mk="[object Error]",gk="[object Function]",xk="[object Map]",bk="[object Number]",vk="[object Object]",wk="[object RegExp]",yk="[object Set]",_k="[object String]",kk="[object WeakMap]",Mk="[object ArrayBuffer]",jk="[object DataView]",Ek="[object Float32Array]",Tk="[object Float64Array]",Nk="[object Int8Array]",Sk="[object Int16Array]",Ak="[object Int32Array]",Ck="[object Uint8Array]",Ik="[object Uint8ClampedArray]",Dk="[object Uint16Array]",Rk="[object Uint32Array]",yt={};yt[Ek]=yt[Tk]=yt[Nk]=yt[Sk]=yt[Ak]=yt[Ck]=yt[Ik]=yt[Dk]=yt[Rk]=!0;yt[fk]=yt[dk]=yt[Mk]=yt[pk]=yt[jk]=yt[hk]=yt[mk]=yt[gk]=yt[xk]=yt[bk]=yt[vk]=yt[wk]=yt[yk]=yt[_k]=yt[kk]=!1;function Ok(e){return ro(e)&&H0(e.length)&&!!yt[oo(e)]}function $k(e){return function(s){return e(s)}}var q0=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Qa=q0&&typeof module=="object"&&module&&!module.nodeType&&module,Pk=Qa&&Qa.exports===q0,iu=Pk&&P0.process,Ih=(function(){try{var e=Qa&&Qa.require&&Qa.require("util").types;return e||iu&&iu.binding&&iu.binding("util")}catch{}})(),Dh=Ih&&Ih.isTypedArray,Y0=Dh?$k(Dh):Ok,Lk=Object.prototype,Fk=Lk.hasOwnProperty;function Uk(e,s){var a=Ki(e),o=!a&&ik(e),c=!a&&!o&&zf(e),h=!a&&!o&&!c&&Y0(e),y=a||o||c||h,m=y?nk(e.length,String):[],l=m.length;for(var f in e)Fk.call(e,f)&&!(y&&(f=="length"||c&&(f=="offset"||f=="parent")||h&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||Q3(f,l)))&&m.push(f);return m}function zk(e,s){return function(a){return e(s(a))}}var Hk=zk(Object.keys,Object),Bk=Object.prototype,Wk=Bk.hasOwnProperty;function qk(e){if(!rk(e))return Hk(e);var s=[];for(var a in Object(e))Wk.call(e,a)&&a!="constructor"&&s.push(a);return s}function Yk(e){return ek(e)?Uk(e):qk(e)}var no=Js(Object,"create");function Gk(){this.__data__=no?no(null):{},this.size=0}function Xk(e){var s=this.has(e)&&delete this.__data__[e];return this.size-=s?1:0,s}var Kk="__lodash_hash_undefined__",Vk=Object.prototype,Zk=Vk.hasOwnProperty;function Qk(e){var s=this.__data__;if(no){var a=s[e];return a===Kk?void 0:a}return Zk.call(s,e)?s[e]:void 0}var Jk=Object.prototype,e8=Jk.hasOwnProperty;function t8(e){var s=this.__data__;return no?s[e]!==void 0:e8.call(s,e)}var r8="__lodash_hash_undefined__";function n8(e,s){var a=this.__data__;return this.size+=this.has(e)?0:1,a[e]=no&&s===void 0?r8:s,this}function rs(e){var s=-1,a=e==null?0:e.length;for(this.clear();++s<a;){var o=e[s];this.set(o[0],o[1])}}rs.prototype.clear=Gk;rs.prototype.delete=Xk;rs.prototype.get=Qk;rs.prototype.has=t8;rs.prototype.set=n8;function s8(){this.__data__=[],this.size=0}function il(e,s){for(var a=e.length;a--;)if(z0(e[a][0],s))return a;return-1}var a8=Array.prototype,o8=a8.splice;function i8(e){var s=this.__data__,a=il(s,e);if(a<0)return!1;var o=s.length-1;return a==o?s.pop():o8.call(s,a,1),--this.size,!0}function l8(e){var s=this.__data__,a=il(s,e);return a<0?void 0:s[a][1]}function c8(e){return il(this.__data__,e)>-1}function u8(e,s){var a=this.__data__,o=il(a,e);return o<0?(++this.size,a.push([e,s])):a[o][1]=s,this}function hn(e){var s=-1,a=e==null?0:e.length;for(this.clear();++s<a;){var o=e[s];this.set(o[0],o[1])}}hn.prototype.clear=s8;hn.prototype.delete=i8;hn.prototype.get=l8;hn.prototype.has=c8;hn.prototype.set=u8;var so=Js(pn,"Map");function f8(){this.size=0,this.__data__={hash:new rs,map:new(so||hn),string:new rs}}function d8(e){var s=typeof e;return s=="string"||s=="number"||s=="symbol"||s=="boolean"?e!=="__proto__":e===null}function ll(e,s){var a=e.__data__;return d8(s)?a[typeof s=="string"?"string":"hash"]:a.map}function p8(e){var s=ll(this,e).delete(e);return this.size-=s?1:0,s}function h8(e){return ll(this,e).get(e)}function m8(e){return ll(this,e).has(e)}function g8(e,s){var a=ll(this,e),o=a.size;return a.set(e,s),this.size+=a.size==o?0:1,this}function is(e){var s=-1,a=e==null?0:e.length;for(this.clear();++s<a;){var o=e[s];this.set(o[0],o[1])}}is.prototype.clear=f8;is.prototype.delete=p8;is.prototype.get=h8;is.prototype.has=m8;is.prototype.set=g8;function x8(e,s){for(var a=-1,o=s.length,c=e.length;++a<o;)e[c+a]=s[a];return e}function b8(){this.__data__=new hn,this.size=0}function v8(e){var s=this.__data__,a=s.delete(e);return this.size=s.size,a}function w8(e){return this.__data__.get(e)}function y8(e){return this.__data__.has(e)}var _8=200;function k8(e,s){var a=this.__data__;if(a instanceof hn){var o=a.__data__;if(!so||o.length<_8-1)return o.push([e,s]),this.size=++a.size,this;a=this.__data__=new is(o)}return a.set(e,s),this.size=a.size,this}function Rn(e){var s=this.__data__=new hn(e);this.size=s.size}Rn.prototype.clear=b8;Rn.prototype.delete=v8;Rn.prototype.get=w8;Rn.prototype.has=y8;Rn.prototype.set=k8;function M8(e,s){for(var a=-1,o=e==null?0:e.length,c=0,h=[];++a<o;){var y=e[a];s(y,a,e)&&(h[c++]=y)}return h}function j8(){return[]}var E8=Object.prototype,T8=E8.propertyIsEnumerable,Rh=Object.getOwnPropertySymbols,N8=Rh?function(e){return e==null?[]:(e=Object(e),M8(Rh(e),function(s){return T8.call(e,s)}))}:j8;function S8(e,s,a){var o=s(e);return Ki(e)?o:x8(o,a(e))}function Oh(e){return S8(e,Yk,N8)}var Hf=Js(pn,"DataView"),Bf=Js(pn,"Promise"),Wf=Js(pn,"Set"),$h="[object Map]",A8="[object Object]",Ph="[object Promise]",Lh="[object Set]",Fh="[object WeakMap]",Uh="[object DataView]",C8=os(Hf),I8=os(so),D8=os(Bf),R8=os(Wf),O8=os(Uf),Dn=oo;(Hf&&Dn(new Hf(new ArrayBuffer(1)))!=Uh||so&&Dn(new so)!=$h||Bf&&Dn(Bf.resolve())!=Ph||Wf&&Dn(new Wf)!=Lh||Uf&&Dn(new Uf)!=Fh)&&(Dn=function(e){var s=oo(e),a=s==A8?e.constructor:void 0,o=a?os(a):"";if(o)switch(o){case C8:return Uh;case I8:return $h;case D8:return Ph;case R8:return Lh;case O8:return Fh}return s});var zh=pn.Uint8Array,$8="__lodash_hash_undefined__";function P8(e){return this.__data__.set(e,$8),this}function L8(e){return this.__data__.has(e)}function Vi(e){var s=-1,a=e==null?0:e.length;for(this.__data__=new is;++s<a;)this.add(e[s])}Vi.prototype.add=Vi.prototype.push=P8;Vi.prototype.has=L8;function F8(e,s){for(var a=-1,o=e==null?0:e.length;++a<o;)if(s(e[a],a,e))return!0;return!1}function U8(e,s){return e.has(s)}var z8=1,H8=2;function G0(e,s,a,o,c,h){var y=a&z8,m=e.length,l=s.length;if(m!=l&&!(y&&l>m))return!1;var f=h.get(e),u=h.get(s);if(f&&u)return f==s&&u==e;var d=-1,g=!0,v=a&H8?new Vi:void 0;for(h.set(e,s),h.set(s,e);++d<m;){var _=e[d],k=s[d];if(o)var M=y?o(k,_,d,s,e,h):o(_,k,d,e,s,h);if(M!==void 0){if(M)continue;g=!1;break}if(v){if(!F8(s,function(T,A){if(!U8(v,A)&&(_===T||c(_,T,a,o,h)))return v.push(A)})){g=!1;break}}else if(!(_===k||c(_,k,a,o,h))){g=!1;break}}return h.delete(e),h.delete(s),g}function B8(e){var s=-1,a=Array(e.size);return e.forEach(function(o,c){a[++s]=[c,o]}),a}function W8(e){var s=-1,a=Array(e.size);return e.forEach(function(o){a[++s]=o}),a}var q8=1,Y8=2,G8="[object Boolean]",X8="[object Date]",K8="[object Error]",V8="[object Map]",Z8="[object Number]",Q8="[object RegExp]",J8="[object Set]",eM="[object String]",tM="[object Symbol]",rM="[object ArrayBuffer]",nM="[object DataView]",Hh=Gs?Gs.prototype:void 0,lu=Hh?Hh.valueOf:void 0;function sM(e,s,a,o,c,h,y){switch(a){case nM:if(e.byteLength!=s.byteLength||e.byteOffset!=s.byteOffset)return!1;e=e.buffer,s=s.buffer;case rM:return!(e.byteLength!=s.byteLength||!h(new zh(e),new zh(s)));case G8:case X8:case Z8:return z0(+e,+s);case K8:return e.name==s.name&&e.message==s.message;case Q8:case eM:return e==s+"";case V8:var m=B8;case J8:var l=o&q8;if(m||(m=W8),e.size!=s.size&&!l)return!1;var f=y.get(e);if(f)return f==s;o|=Y8,y.set(e,s);var u=G0(m(e),m(s),o,c,h,y);return y.delete(e),u;case tM:if(lu)return lu.call(e)==lu.call(s)}return!1}var aM=1,oM=Object.prototype,iM=oM.hasOwnProperty;function lM(e,s,a,o,c,h){var y=a&aM,m=Oh(e),l=m.length,f=Oh(s),u=f.length;if(l!=u&&!y)return!1;for(var d=l;d--;){var g=m[d];if(!(y?g in s:iM.call(s,g)))return!1}var v=h.get(e),_=h.get(s);if(v&&_)return v==s&&_==e;var k=!0;h.set(e,s),h.set(s,e);for(var M=y;++d<l;){g=m[d];var T=e[g],A=s[g];if(o)var I=y?o(A,T,g,s,e,h):o(T,A,g,e,s,h);if(!(I===void 0?T===A||c(T,A,a,o,h):I)){k=!1;break}M||(M=g=="constructor")}if(k&&!M){var R=e.constructor,$=s.constructor;R!=$&&"constructor"in e&&"constructor"in s&&!(typeof R=="function"&&R instanceof R&&typeof $=="function"&&$ instanceof $)&&(k=!1)}return h.delete(e),h.delete(s),k}var cM=1,Bh="[object Arguments]",Wh="[object Array]",Oi="[object Object]",uM=Object.prototype,qh=uM.hasOwnProperty;function fM(e,s,a,o,c,h){var y=Ki(e),m=Ki(s),l=y?Wh:Dn(e),f=m?Wh:Dn(s);l=l==Bh?Oi:l,f=f==Bh?Oi:f;var u=l==Oi,d=f==Oi,g=l==f;if(g&&zf(e)){if(!zf(s))return!1;y=!0,u=!1}if(g&&!u)return h||(h=new Rn),y||Y0(e)?G0(e,s,a,o,c,h):sM(e,s,l,a,o,c,h);if(!(a&cM)){var v=u&&qh.call(e,"__wrapped__"),_=d&&qh.call(s,"__wrapped__");if(v||_){var k=v?e.value():e,M=_?s.value():s;return h||(h=new Rn),c(k,M,a,o,h)}}return g?(h||(h=new Rn),lM(e,s,a,o,c,h)):!1}function X0(e,s,a,o,c){return e===s?!0:e==null||s==null||!ro(e)&&!ro(s)?e!==e&&s!==s:fM(e,s,a,o,X0,c)}function dM(e,s){return X0(e,s)}const Yh=({className:e,children:s,colSpan:a,sticky:o=!1,...c})=>{const h=ye("!py-2 !pl-0 !pr-6 text-left align-top",o&&"sticky top-0 bg-white",c.onClick&&"hover:cursor-pointer",e);return r.jsx("th",{className:h,colSpan:a,...c,children:r.jsx(bt,{className:"whitespace-nowrap",level:6,children:s})})},K0=({left:e,center:s,right:a,sticky:o=!0,containerClassName:c,children:h})=>{const y=ye("z-50 h-22 min-h-[92px] p-8",!h&&"flex items-center justify-between gap-3",o&&"sticky top-0",c);if(!h){if(e){const m=ye("flex flex-auto items-center",a&&s&&"basis-1/3",!a&&s&&"basis-1/2");e=r.jsx("div",{className:m,children:e})}if(s){const m=ye("flex flex-auto items-center justify-center",e&&a&&"basis-1/3",(e&&!a||!e&&a)&&"basis-1/2");s=r.jsx("div",{className:m,children:s})}if(a){const m=ye("flex flex-auto items-center justify-end",e&&s&&"basis-1/3",!e&&s&&"basis-1/2");a=r.jsx("div",{className:m,children:a})}}return r.jsx("div",{className:y,children:h||r.jsxs(r.Fragment,{children:[e,s,a]})})},V0=({items:e,setItems:s,blank:a,canAddNewItem:o})=>{const[c,h]=D.useState(e.map((g,v)=>({item:g,id:v.toString()}))),[y,m]=D.useState(a);return D.useEffect(()=>{const g=c.map(({item:v})=>v);o(y)&&g.push(y),dM(JSON.parse(JSON.stringify(g)),JSON.parse(JSON.stringify(e)))||s(g)},[c,y,e,s,o]),{items:c,updateItem:(g,v)=>{const _=c.map(k=>k.id===g?{...k,item:v}:k);h(_),s(_.map(k=>k.item))},addItem:()=>{if(o(y)){const g=c.reduce((_,k)=>Math.max(_,parseInt(k.id)),0),v=c.concat({item:y,id:(g+1).toString()});h(v),s(v.map(_=>_.item)),m(a)}},removeItem:g=>{const v=c.filter(_=>_.id!==g);h(v),s(v.map(_=>_.item))},moveItem:(g,v)=>{if(g!==v){const _=c.findIndex(T=>T.id===g),k=v?c.findIndex(T=>T.id===v):0,M=G_(c,_,k);h(M),s(M.map(T=>T.item))}},newItem:y,setNewItem:m}},pM=({label:e,text:s="",hint:a,onRegenerate:o})=>{const[c,h]=D.useState(!1),y=()=>{navigator.clipboard.writeText(s),h(!0),setTimeout(()=>h(!1),2e3)},m=ye("group/api-keys relative -mt-1 mb-1 w-full overflow-hidden border-b border-transparent py-2 hover:border-grey-300 dark:hover:border-grey-600");return r.jsxs("div",{className:"mb-3 grid grid-cols-1",children:[e&&r.jsx(bt,{level:6,grey:!0,children:e}),r.jsxs("div",{className:m,children:[r.jsx("span",{children:s}),a,r.jsxs("div",{className:"visible absolute right-0 top-1/2 flex translate-y-[-50%] gap-1 bg-white pl-1 text-sm group-hover/api-keys:visible md:invisible dark:bg-black",children:[o&&r.jsx(Ue,{color:"outline",label:"Regenerate",size:"sm",onClick:o}),r.jsx(Ue,{color:"outline",label:c?"Copied":"Copy",size:"sm",onClick:y})]})]})]})},cl=({keys:e})=>r.jsx("div",{"data-testid":"api-keys",children:e.map(s=>r.jsx(pM,{...s},s.label))}),ea=({icon:e,title:s,detail:a,extra:o})=>r.jsxs("div",{className:"-mx-8 -mt-8 flex flex-col gap-4 bg-grey-75 p-8 md:flex-row dark:bg-grey-950",children:[r.jsx("div",{className:"size-14",children:e}),r.jsxs("div",{className:"mt-1.5 flex min-w-0 flex-1 flex-col",children:[r.jsx("h3",{children:s}),r.jsx("div",{children:a}),o&&r.jsx("div",{className:"mt-4",children:o})]})]}),xd=ns({method:"POST",path:({integrationId:e,apiKeyId:s})=>`/integrations/${e}/api_key/${s}/refresh/`,body:({integrationId:e})=>({integrations:[{id:e}]}),updateQueries:{emberUpdateType:"createOrUpdate",dataType:nl,update:(e,s)=>s&&{...s,integrations:s.integrations.map(a=>e.integrations.find(({id:c})=>c===a.id)||a)}}}),hM=_e.create(()=>{const e=_e.useModal(),{updateRoute:s}=Ve(),{zapierTemplates:a}=X_(),{data:{integrations:o}={integrations:[]}}=nd(),{config:c}=Qe(),{mutateAsync:h}=xd(),y=it(),[m,l]=D.useState(!1),f=c.hostSettings?.limits?.customIntegrations?.disabled,u=o.find(({slug:v})=>v==="zapier"),d=u?.api_keys?.find(v=>v.type==="admin");D.useEffect(()=>{f&&s("integrations")},[f,s]);const g=()=>{!u||!d||(l(!1),_e.show(Et,{title:"Regenerate Admin API Key",prompt:'You will need to locate the Ghost App within your Zapier account and click on "Reconnect" to enter the new Admin API Key.',okLabel:"Regenerate Admin API Key",onOk:async v=>{try{await h({integrationId:u.id,apiKeyId:d.id}),l(!0),v?.remove()}catch(_){y(_)}}}))};return r.jsxs(vt,{afterClose:()=>{s("integrations")},cancelLabel:"",footer:r.jsxs("div",{className:"mx-8 flex w-full items-center justify-between",children:[r.jsxs("a",{className:"mt-1 self-baseline text-sm font-bold",href:"https://zapier.com/apps/ghost/integrations?utm_medium=partner_api&utm_source=widget&utm_campaign=Widget",rel:"noopener noreferrer",target:"_blank",children:["View more Ghost integrations powered by ",r.jsx("span",{children:r.jsx(nt,{className:"relative top-[-2px] inline-block",name:"zapier-logo",size:24})})]}),r.jsx(Ue,{color:"black",label:"Close",onClick:()=>{e.remove()}})]}),okColor:"black",okLabel:"Close",testId:"zapier-modal",title:"",stickyFooter:!0,onOk:()=>{s("integrations"),e.remove()},children:[r.jsx(ea,{detail:"Automation for your favorite apps",extra:r.jsx("div",{className:"-mb-4 mt-1",children:r.jsx(cl,{keys:[{label:"Admin API key",text:d?.secret,hint:m?r.jsx("div",{className:"text-green",children:"Admin API Key was successfully regenerated"}):void 0,onRegenerate:g},{label:"API URL",text:window.location.origin+ao().subdir}]})}),icon:r.jsx(nt,{name:"zapier",size:56}),title:"Zapier"}),r.jsx(cn,{children:a.map(v=>r.jsx($n,{action:r.jsx(Ue,{className:"whitespace-nowrap text-sm font-semibold text-[#FF4A00]",href:v.url,label:"Use this Zap",tag:"a",target:"_blank",link:!0,unstyled:!0}),bgOnHover:!1,className:"flex items-center gap-3 py-2 pl-3",title:r.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center",children:[r.jsxs("div",{className:"flex shrink-0 flex-nowrap items-center gap-2",children:[r.jsx("img",{className:"size-8 object-contain dark:invert",role:"presentation",src:v.ghostImage}),r.jsx(nt,{name:"arrow-right",size:"xs"}),r.jsx("img",{className:"size-8 object-contain",role:"presentation",src:v.appImage})]}),r.jsx("span",{className:"text-sm",children:v.title})]}),hideActions:!0}))})]})});function Z0(e){const s="The URL must be in a format like https://www.threads.net/@yourUsername";if(!e)return"";if(e.startsWith("http")){if(!e.includes("threads.net")&&!e.includes("threads.com"))throw new Error(s);if(e=e.replace("threads.com","threads.net"),e.includes("www.")||(e=e.replace("https://","https://www.")),!St.isURL(e))throw new Error(s);if(!e.match(/^https:\/\/www\.threads\.net\/@?[a-zA-Z0-9._]+$/))throw new Error(s);return e}if(!e.includes("/")){if(e.startsWith("@")&&(e=e.slice(1)),!e.match(/^[a-zA-Z0-9._]+$/))throw new Error(s);return`https://www.threads.net/@${e}`}throw new Error(s)}const mM=e=>`https://www.threads.net/${e}`,gM=e=>{const s=e.match(/(?:https:\/\/)(?:www\.)?(?:threads\.(?:com|net))(?:\/)?(?:#!\/)?@?([^/]*)/)?.[1];return s?`@${s}`:null},Ws={INVALID_USERNAME:"Your Username is not a valid Bluesky Username",INVALID_URL:"The URL must be in a format like https://bsky.app/profile/yourUsername"};function Q0(e){return[/^did:plc:[a-z2-7]{24}$/,/^[a-zA-Z0-9._]{1,15}$/,/^(?=.{1,191}$)[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+$/].some(a=>a.test(e))}function qf(e){let s=e.trim();return s.startsWith("@")&&(s=s.slice(1)),s.startsWith("did:plc:")?s.toLowerCase():s}function J0(e){if(!e)return"";let s;if(e.startsWith("http")||e.startsWith("www.")||e.includes("bsky.app")){if(!e.includes("bsky.app"))throw new Error(Ws.INVALID_URL);const o=e.match(/bsky\.app\/profile\/@?([^/]+)/);if(!o)throw new Error(Ws.INVALID_URL);s=qf(o[1])}else s=qf(e);if(!Q0(s))throw new Error(Ws.INVALID_USERNAME);const a=`https://bsky.app/profile/${s}`;if(!St.isURL(a))throw new Error(Ws.INVALID_URL);return a}const xM=e=>{if(!e)throw new Error(Ws.INVALID_USERNAME);let s=qf(e);if(!Q0(s))throw new Error(Ws.INVALID_USERNAME);return`https://bsky.app/profile/${s}`},bM=e=>{const s=e.match(/(?:https?:\/\/)?(?:www\.)?bsky\.app\/profile\/@?([^/]*)/);return s?`${s[1]}`:null},es={INVALID_URL:"The URL must be in a format like https://www.linkedin.com/in/yourUsername",INVALID_USERNAME:"Your Username is not a valid LinkedIn Username"},vM=["in","pub","company","school"],wM=/^[a-zA-Z0-9-]{3,100}$/,yM=/^[a-zA-Z0-9-]{3,100}(?:\/[a-zA-Z0-9-]*)*$/,ex=/^(?:https?:\/\/)?(?:www\.)?(?:([a-z]{2})\.)?linkedin\.com\/(in|pub|company|school)\/([^?#]+)/i,Yf=e=>e.trim().replace(/^@/,""),tx=e=>{if(/^(https?:\/\/|www\.)/.test(e)||e.includes("linkedin.com")){const o=e.match(ex);if(!o)throw new Error(es.INVALID_URL);if(o[0].length!==e.length)throw new Error(es.INVALID_USERNAME);const[,c,h,y]=o,m=Yf(y);if(c&&!/^[A-Z]{2}$/.test(c.toUpperCase()))throw new Error(es.INVALID_URL);return{regional:c,pathType:h,username:m}}const s=Yf(e),a=s.indexOf("/");if(a!==-1){const o=s.substring(0,a);if(vM.includes(o))return{pathType:o,username:s.substring(a+1)}}return{username:s}},rx=(e,s)=>(e==="pub"?yM:wM).test(s),nx=({regional:e,pathType:s,username:a})=>{const c=`https://${e?`${e.toLowerCase()}.`:"www."}linkedin.com/${s}/${a}`;if(!St.isURL(c))throw new Error(es.INVALID_URL);return c};function sx(e){if(!e)return"";const{regional:s,pathType:a="in",username:o}=tx(e);if(!rx(a,o))throw new Error(es.INVALID_USERNAME);return nx({regional:s,pathType:a,username:o})}const _M=e=>{if(!e)throw new Error(es.INVALID_USERNAME);const{regional:s,pathType:a="in",username:o}=tx(e);if(!rx(a,o))throw new Error(es.INVALID_USERNAME);return nx({regional:s,pathType:a,username:o})},kM=e=>{const s=e.match(ex);if(!s)return null;const[,,a,o]=s,c=Yf(o);return a==="in"?c:`${a}/${c}`};function ax(e){const s="The URL must be in a format like https://www.instagram.com/yourUsername",a="Your Username is not a valid Instagram Username";if(!e)return"";let o;if(e.startsWith("http")||e.startsWith("www.")||e.includes("instagram.com")){if(!e.includes("instagram.com"))throw new Error(s);const h=e.match(/(?:https?:\/\/)?(?:www\.)?instagram\.com\/@?([^/]+)/);if(!h)throw new Error(s);o=h[1]}else o=e.startsWith("@")?e.slice(1):e;if(!o.match(/^[a-zA-Z0-9_][a-zA-Z0-9._]{0,28}[a-zA-Z0-9_]$/)||o.includes("..")||o.length>30)throw new Error(a);const c=`https://www.instagram.com/${o}`;if(!St.isURL(c))throw new Error(s);return c}const MM=e=>{const s="Your Username is not a valid Instagram Username";if(!e)throw new Error(s);let a=e;if(a.startsWith("@")&&(a=a.slice(1)),!a.match(/^[a-zA-Z0-9_][a-zA-Z0-9._]{0,28}[a-zA-Z0-9_]$/)||a.includes("..")||a.length>30)throw new Error(s);return`https://www.instagram.com/${a}`},jM=e=>{const s=e.match(/(?:https?:\/\/)?(?:www\.)?instagram\.com\/@?([^/]*)/);return s?`${s[1]}`:null};function ox(e){const s="The URL must be in a format like https://www.youtube.com/@yourUsername, https://www.youtube.com/user/yourUsername, or https://www.youtube.com/channel/yourChannelId",a="Your Username is not a valid YouTube Username";if(!e)return"";let o;if(e.startsWith("http")||e.startsWith("www.")||e.includes("youtube.com")){if(!e.includes("youtube.com"))throw new Error(s);const h=e.match(/(?:https?:\/\/)?(?:www\.)?youtube\.com\/((?:@|user\/|channel\/)[^/]+)/);if(!h)throw new Error(s);o=h[1]}else o=e;if(o.startsWith("@")){const h=o.slice(1);if(!h.match(/^[a-zA-Z0-9][a-zA-Z0-9._-]{1,28}[a-zA-Z0-9]$/)||h.includes("..")||h.length>30)throw new Error(a)}else if(o.startsWith("user/")){if(!o.slice(5).match(/^[a-zA-Z0-9._-]{1,50}$/))throw new Error(a)}else if(o.startsWith("channel/")){if(!o.slice(8).match(/^UC[a-zA-Z0-9_-]{22}$/))throw new Error(a)}else throw new Error(s);const c=`https://www.youtube.com/${o}`;if(!St.isURL(c))throw new Error(s);return c}const EM=e=>{const s="Your Username is not a valid YouTube Username";if(!e)throw new Error(s);if(e.startsWith("@")){const a=e.slice(1);if(!a.match(/^[a-zA-Z0-9][a-zA-Z0-9._-]{1,28}[a-zA-Z0-9]$/)||a.includes("..")||a.length>30)throw new Error(s)}else if(e.startsWith("user/")){if(!e.slice(5).match(/^[a-zA-Z0-9._-]{1,50}$/))throw new Error(s)}else if(e.startsWith("channel/")){if(!e.slice(8).match(/^UC[a-zA-Z0-9_-]{22}$/))throw new Error(s)}else throw new Error("The handle must be in a format like @yourUsername, user/yourUsername, or channel/yourChannelId");return`https://www.youtube.com/${e}`},TM=e=>{const s=e.match(/(?:https?:\/\/)?(?:www\.)?youtube\.com\/((?:@|user\/|channel\/)[^/]*)/);return s?s[1]:null};function ix(e){const s="The URL must be in a format like https://www.tiktok.com/@yourUsername",a="Your Username is not a valid TikTok Username";if(!e)return"";let o;if(e.startsWith("http")||e.startsWith("www.")||e.includes("tiktok.com")){if(!e.includes("tiktok.com"))throw new Error(s);const y=e.match(/(?:https?:\/\/)?(?:www\.)?tiktok\.com\/(@[^/]+)/);if(!y)throw new Error(s);o=y[1]}else o=e.startsWith("@")?e:`@${e}`;const c=o.slice(1);if(!c.match(/^[a-zA-Z0-9_][a-zA-Z0-9._]{0,22}[a-zA-Z0-9_]$/)||c.includes("..")||c.length<2||c.length>24)throw new Error(a);const h=`https://www.tiktok.com/${o}`;if(!St.isURL(h))throw new Error(s);return h}const NM=e=>{const s="Your Username is not a valid TikTok Username";if(!e)throw new Error(s);const a=e.startsWith("@")?e:`@${e}`,o=a.slice(1);if(!o.match(/^[a-zA-Z0-9_][a-zA-Z0-9._]{0,22}[a-zA-Z0-9_]$/)||o.includes("..")||o.length<2||o.length>24)throw new Error(s);return`https://www.tiktok.com/${a}`},SM=e=>{const s=e.match(/(?:https?:\/\/)?(?:www\.)?tiktok\.com\/(@[^/]*)/);return s?s[1]:null};function lx(e){const s="The URL must be in a format like @username@instance.tld or https://instance.tld/@username or https://website.com/@username@instance.tld";if(!e)return"";let a=e;if(a=a.replace(/^https?:\/\//,""),a.match(/^@[^@]+@[^/]+$/)){const[o,c]=a.split("@").slice(1);if(!St.isFQDN(c))throw new Error(s);return`https://${c}/@${o}`}if(a.match(/^[^/]+\.[^/]+\/@[^/]+(@[^/]+)?$/)){const[o,c]=a.split("/@");if(!St.isFQDN(o))throw new Error(s);if(c.includes("@")){const[,h]=c.split("@");if(!St.isFQDN(h))throw new Error(s)}return`https://${a}`}throw new Error(s)}const AM=e=>{const s="Your Username is not a valid Mastodon Username";if(!e)throw new Error(s);if(e.match(/^@[^@]+@[^/]+$/)){const[a,o]=e.split("@").slice(1);if(!St.isFQDN(o))throw new Error(s);return`https://${o}/@${a}`}if(e.match(/^[^/]+\.[^/]+\/@[^/]+(@[^/]+)?$/)){const[a,o]=e.split("/@");if(!St.isFQDN(a))throw new Error(s);if(o.includes("@")){const[,c]=o.split("@");if(!St.isFQDN(c))throw new Error(s)}return`https://${e}`}throw new Error(s)},CM=e=>e.replace(/^https?:\/\//,""),IM=({tier:e})=>{const s=e?.type==="free",{updateRoute:a}=Ve(),{mutateAsync:o}=fd(),{mutateAsync:c}=L2(),{mutateAsync:h}=On(),[y,m]=ot.useState(!!e?.trial_days),l=it(),{localSettings:f,siteData:u}=ss(),[d]=mt(f,["portal_plans"]),g=JSON.parse(d?.toString()||"[]"),v={name:()=>_.name?void 0:"Enter a name for the tier",monthly_price:()=>_.type!=="free"?hh(_.monthly_price||0,_.currency,{allowZero:!1}):void 0,yearly_price:()=>_.type!=="free"?hh(_.yearly_price||0,_.currency,{allowZero:!1}):void 0},{formState:_,saveState:k,updateForm:M,handleSave:T,errors:A,clearError:I,okProps:R}=pr({initialState:{...e||{},trial_days:e?.trial_days?.toString()||"",currency:e?.currency||K_[0].isoCode,visibility:e?.visibility||"none",welcome_page_url:e?.welcome_page_url||null},savingDelay:500,savedDelay:500,onValidate:()=>{const Y={};return Object.entries(v).forEach(([P,q])=>{Y[P]=q?.()}),Y},onSave:async()=>{const{trial_days:Y,currency:P,...q}=_,ee=q;if(ee.benefits=ee.benefits?.filter(ae=>ae),s||(ee.currency=P,ee.trial_days=parseInt(Y)),e?.id?await o({...e,...ee}):await c(ee),s){const ae=_.visibility==="public";let ne=!1;g.includes("free")&&!ae&&(g.splice(g.indexOf("free"),1),ne=!0),!g.includes("free")&&ae&&(g.push("free"),ne=!0),ne&&await h([{key:"portal_plans",value:JSON.stringify(g)}])}},onSaveError:l}),$=V0({items:_.benefits||[],setItems:Y=>M(P=>({...P,benefits:Y})),blank:"",canAddNewItem:Y=>!!Y}),W=Y=>{Y.target.checked?(m(!0),M(P=>({...P,trial_days:e?.trial_days?e?.trial_days.toString():"7"}))):(m(!1),M(P=>({...P,trial_days:"0"})))},O=D.useRef(!1);D.useEffect(()=>{O.current&&(v.monthly_price?.(),v.yearly_price?.()),O.current=!0},[_.currency]);const K=()=>{if(e){const Y=e.active?"Archive tier":"Reactivate tier",P=e.active?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"mb-6",children:["Members will no longer be able to subscribe to ",r.jsx("strong",{children:e.name})," and it will be removed from the list of available tiers in portal."]}),r.jsx("div",{children:"Existing members on this tier will remain unchanged. Offers using this tier will be disabled."})]}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"mb-6",children:["Reactivating ",r.jsx("strong",{children:e.name})," will re-enable it as an option in portal and allow new members to subscribe to this tier."]}),r.jsx("div",{children:"Existing members will remain unchanged."})]}),q=e.active?"Archive":"Reactivate";_e.show(Et,{title:Y,prompt:P,okLabel:q,cancelLabel:"Cancel",okColor:e.active?"red":"black",onOk:ee=>{o({...e,active:!e.active}),ee?.remove(),gt({type:"success",title:`Tier ${e.active?"archived":"reactivated"}`})}})}};let X={};return e&&(e.active&&e.type!=="free"?X={label:"Archive tier",color:"red",link:!0,onClick:K}:e.active||(X={label:"Reactivate tier",color:"green",link:!0,onClick:K})),r.jsx(vt,{afterClose:()=>{a("tiers")},buttonsDisabled:R.disabled,cancelLabel:"Close",dirty:k==="unsaved",leftButtonProps:X,okColor:R.color,okLabel:R.label||"Save",size:"lg",testId:"tier-detail-modal",title:e?e.active?"Edit tier":"Edit archived tier":"New tier",stickyFooter:!0,onOk:async()=>{await T({fakeWhenUnchanged:!0})},children:r.jsxs("div",{className:"-mb-8 mt-8 flex items-start gap-8",children:[r.jsxs("div",{className:"flex grow flex-col gap-8",children:[r.jsxs(et,{marginBottom:!1,title:"Basic",grouped:!0,children:[r.jsx(je,{autoComplete:"off",error:!!A.name,hint:A.name,maxLength:191,placeholder:s?"Free":"Bronze",title:"Name",value:_.name||"",autoFocus:!0,onChange:Y=>M(P=>({...P,name:Y.target.value})),onKeyDown:()=>I("name")}),r.jsx(je,{autoComplete:"off",autoFocus:s,maxLength:191,placeholder:s?"Free preview":"Full access to premium content",title:"Description",value:_.description||"",onChange:Y=>M(P=>({...P,description:Y.target.value}))}),!s&&r.jsx(r.Fragment,{children:r.jsxs("div",{className:"flex flex-col gap-10 md:flex-row",children:[r.jsxs("div",{className:"basis-1/2",children:[r.jsxs("div",{className:"mb-1 flex h-6 items-center justify-between",children:[r.jsx(bt,{level:6,children:"Prices"}),r.jsx("div",{className:"-mr-2 w-[50px]",children:r.jsx(Ot,{border:!1,containerClassName:"font-medium",controlClasses:{menu:"w-18"},options:mh(),selectedOption:mh().flatMap(Y=>Y.options).find(Y=>Y.value===_.currency),size:"xs",clearBg:!0,isSearchable:!0,onSelect:Y=>M(P=>({...P,currency:Y?.value}))})})]}),r.jsxs("div",{className:"flex flex-col gap-2",children:[r.jsx(gh,{error:!!A.monthly_price,hint:A.monthly_price,placeholder:"5",rightPlaceholder:`${_.currency}/month`,title:"Monthly price",valueInCents:_.monthly_price||"",hideTitle:!0,onBlur:Y=>Y.target.value===""?M(P=>({...P,monthly_price:0})):null,onChange:Y=>M(P=>({...P,monthly_price:Y})),onKeyDown:()=>I("monthly_price")}),r.jsx(gh,{error:!!A.yearly_price,hint:A.yearly_price,placeholder:"50",rightPlaceholder:`${_.currency}/year`,title:"Yearly price",valueInCents:_.yearly_price||"",hideTitle:!0,onBlur:Y=>Y.target.value===""?M(P=>({...P,yearly_price:0})):null,onChange:Y=>M(P=>({...P,yearly_price:Y})),onKeyDown:()=>I("yearly_price")})]})]}),r.jsxs("div",{className:"basis-1/2",children:[r.jsx("div",{className:"mb-1 flex h-6 flex-col justify-center",children:r.jsx(rt,{checked:y,label:"Add a free trial",labelStyle:"heading",onChange:W})}),r.jsx(je,{disabled:!y,hint:r.jsxs("div",{className:"mt-1",children:["Members will be subscribed at full price once the trial ends. ",r.jsx("a",{className:"text-green",href:"https://ghost.org/help/free-trials/",rel:"noreferrer",target:"_blank",children:"Learn more"})]}),placeholder:"0",rightPlaceholder:"days",title:"Trial days",value:_.trial_days,hideTitle:!0,onChange:Y=>M(P=>({...P,trial_days:Y.target.value.replace(/[^\d]/,"")}))})]})]})}),r.jsx(Qg,{baseUrl:u?.url,hint:`Redirect to this URL after signup ${s?"":" for premium membership"}`,maxLength:2e3,placeholder:u?.url,title:"Welcome page",value:_.welcome_page_url||null,nullable:!0,transformPathWithoutSlash:!0,onChange:Y=>M(P=>({...P,welcome_page_url:Y||null}))})]}),r.jsxs(et,{gap:"none",title:"Benefits",grouped:!0,children:[r.jsx("div",{className:"-mt-3",children:r.jsx(Jg,{items:$.items,itemSeparator:!1,renderItem:({id:Y,item:P})=>r.jsxs("div",{className:"relative flex w-full items-center gap-5",children:[r.jsx("div",{className:"absolute left-[-32px] top-[7px] flex size-6 items-center justify-center bg-white group-hover:hidden dark:bg-black",children:r.jsx(nt,{name:"check",size:"sm"})}),r.jsx(je,{maxLength:191,value:P,onChange:q=>$.updateItem(Y,q.target.value)}),r.jsx(Ue,{className:"absolute right-1 top-1 z-10 opacity-0 group-hover:opacity-100",color:"grey",icon:"trash",size:"sm",onClick:()=>$.removeItem(Y)})]}),onMove:$.moveItem})}),r.jsxs("div",{className:"relative mt-1 flex items-center gap-3",children:[r.jsx(nt,{className:"dark:text-white",name:"check",size:"sm"}),r.jsx(je,{className:"grow",containerClassName:"w-100",maxLength:191,placeholder:"Expert analysis",title:"New benefit",value:$.newItem,hideTitle:!0,onChange:Y=>$.setNewItem(Y.target.value),onKeyDown:Y=>{Y.key==="Enter"&&$.addItem()}}),r.jsx(Ue,{className:"absolute right-[5px] top-[5px] z-10",color:"green",icon:"add",iconColorClass:"text-white",label:"Add",size:"sm",hideLabel:!0,onClick:()=>$.addItem()})]})]})]}),r.jsx("div",{className:"sticky top-[96px] hidden shrink-0 basis-[380px] min-[920px]:!visible min-[920px]:!block",children:r.jsx(V_,{isFreeTier:s,tier:_})})]})})},DM=({params:e})=>{const{data:{tiers:s,isEnd:a}={},fetchNextPage:o}=Zs();let c;return D.useEffect(()=>{e?.id&&!c&&!a&&o()},[o,a,e?.id,c]),e?.id&&(c=s?.find(({id:h})=>h===e?.id),!c)?null:r.jsx(IM,{tier:c})},RM=_e.create(DM);var cu,Gh;function cx(){if(Gh)return cu;Gh=1;var e={};return cu=typeof process=="object"&&e&&e.NODE_DEBUG&&/\bsemver\b/i.test(e.NODE_DEBUG)?(...a)=>console.error("SEMVER",...a):()=>{},cu}var uu,Xh;function ux(){if(Xh)return uu;Xh=1;const e="2.0.0",s=256,a=Number.MAX_SAFE_INTEGER||9007199254740991,o=16,c=s-6;return uu={MAX_LENGTH:s,MAX_SAFE_COMPONENT_LENGTH:o,MAX_SAFE_BUILD_LENGTH:c,MAX_SAFE_INTEGER:a,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},uu}var $i={exports:{}},Kh;function OM(){return Kh||(Kh=1,(function(e,s){const{MAX_SAFE_COMPONENT_LENGTH:a,MAX_SAFE_BUILD_LENGTH:o,MAX_LENGTH:c}=ux(),h=cx();s=e.exports={};const y=s.re=[],m=s.safeRe=[],l=s.src=[],f=s.safeSrc=[],u=s.t={};let d=0;const g="[a-zA-Z0-9-]",v=[["\\s",1],["\\d",c],[g,o]],_=M=>{for(const[T,A]of v)M=M.split(`${T}*`).join(`${T}{0,${A}}`).split(`${T}+`).join(`${T}{1,${A}}`);return M},k=(M,T,A)=>{const I=_(T),R=d++;h(M,R,T),u[M]=R,l[R]=T,f[R]=I,y[R]=new RegExp(T,A?"g":void 0),m[R]=new RegExp(I,A?"g":void 0)};k("NUMERICIDENTIFIER","0|[1-9]\\d*"),k("NUMERICIDENTIFIERLOOSE","\\d+"),k("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${g}*`),k("MAINVERSION",`(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})`),k("MAINVERSIONLOOSE",`(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})`),k("PRERELEASEIDENTIFIER",`(?:${l[u.NONNUMERICIDENTIFIER]}|${l[u.NUMERICIDENTIFIER]})`),k("PRERELEASEIDENTIFIERLOOSE",`(?:${l[u.NONNUMERICIDENTIFIER]}|${l[u.NUMERICIDENTIFIERLOOSE]})`),k("PRERELEASE",`(?:-(${l[u.PRERELEASEIDENTIFIER]}(?:\\.${l[u.PRERELEASEIDENTIFIER]})*))`),k("PRERELEASELOOSE",`(?:-?(${l[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[u.PRERELEASEIDENTIFIERLOOSE]})*))`),k("BUILDIDENTIFIER",`${g}+`),k("BUILD",`(?:\\+(${l[u.BUILDIDENTIFIER]}(?:\\.${l[u.BUILDIDENTIFIER]})*))`),k("FULLPLAIN",`v?${l[u.MAINVERSION]}${l[u.PRERELEASE]}?${l[u.BUILD]}?`),k("FULL",`^${l[u.FULLPLAIN]}$`),k("LOOSEPLAIN",`[v=\\s]*${l[u.MAINVERSIONLOOSE]}${l[u.PRERELEASELOOSE]}?${l[u.BUILD]}?`),k("LOOSE",`^${l[u.LOOSEPLAIN]}$`),k("GTLT","((?:<|>)?=?)"),k("XRANGEIDENTIFIERLOOSE",`${l[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),k("XRANGEIDENTIFIER",`${l[u.NUMERICIDENTIFIER]}|x|X|\\*`),k("XRANGEPLAIN",`[v=\\s]*(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:${l[u.PRERELEASE]})?${l[u.BUILD]}?)?)?`),k("XRANGEPLAINLOOSE",`[v=\\s]*(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:${l[u.PRERELEASELOOSE]})?${l[u.BUILD]}?)?)?`),k("XRANGE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAIN]}$`),k("XRANGELOOSE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAINLOOSE]}$`),k("COERCEPLAIN",`(^|[^\\d])(\\d{1,${a}})(?:\\.(\\d{1,${a}}))?(?:\\.(\\d{1,${a}}))?`),k("COERCE",`${l[u.COERCEPLAIN]}(?:$|[^\\d])`),k("COERCEFULL",l[u.COERCEPLAIN]+`(?:${l[u.PRERELEASE]})?(?:${l[u.BUILD]})?(?:$|[^\\d])`),k("COERCERTL",l[u.COERCE],!0),k("COERCERTLFULL",l[u.COERCEFULL],!0),k("LONETILDE","(?:~>?)"),k("TILDETRIM",`(\\s*)${l[u.LONETILDE]}\\s+`,!0),s.tildeTrimReplace="$1~",k("TILDE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAIN]}$`),k("TILDELOOSE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAINLOOSE]}$`),k("LONECARET","(?:\\^)"),k("CARETTRIM",`(\\s*)${l[u.LONECARET]}\\s+`,!0),s.caretTrimReplace="$1^",k("CARET",`^${l[u.LONECARET]}${l[u.XRANGEPLAIN]}$`),k("CARETLOOSE",`^${l[u.LONECARET]}${l[u.XRANGEPLAINLOOSE]}$`),k("COMPARATORLOOSE",`^${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]})$|^$`),k("COMPARATOR",`^${l[u.GTLT]}\\s*(${l[u.FULLPLAIN]})$|^$`),k("COMPARATORTRIM",`(\\s*)${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]}|${l[u.XRANGEPLAIN]})`,!0),s.comparatorTrimReplace="$1$2$3",k("HYPHENRANGE",`^\\s*(${l[u.XRANGEPLAIN]})\\s+-\\s+(${l[u.XRANGEPLAIN]})\\s*$`),k("HYPHENRANGELOOSE",`^\\s*(${l[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[u.XRANGEPLAINLOOSE]})\\s*$`),k("STAR","(<|>)?=?\\s*\\*"),k("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),k("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})($i,$i.exports)),$i.exports}var fu,Vh;function $M(){if(Vh)return fu;Vh=1;const e=Object.freeze({loose:!0}),s=Object.freeze({});return fu=o=>o?typeof o!="object"?e:o:s,fu}var du,Zh;function PM(){if(Zh)return du;Zh=1;const e=/^[0-9]+$/,s=(o,c)=>{if(typeof o=="number"&&typeof c=="number")return o===c?0:o<c?-1:1;const h=e.test(o),y=e.test(c);return h&&y&&(o=+o,c=+c),o===c?0:h&&!y?-1:y&&!h?1:o<c?-1:1};return du={compareIdentifiers:s,rcompareIdentifiers:(o,c)=>s(c,o)},du}var pu,Qh;function LM(){if(Qh)return pu;Qh=1;const e=cx(),{MAX_LENGTH:s,MAX_SAFE_INTEGER:a}=ux(),{safeRe:o,t:c}=OM(),h=$M(),{compareIdentifiers:y}=PM();class m{constructor(f,u){if(u=h(u),f instanceof m){if(f.loose===!!u.loose&&f.includePrerelease===!!u.includePrerelease)return f;f=f.version}else if(typeof f!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof f}".`);if(f.length>s)throw new TypeError(`version is longer than ${s} characters`);e("SemVer",f,u),this.options=u,this.loose=!!u.loose,this.includePrerelease=!!u.includePrerelease;const d=f.trim().match(u.loose?o[c.LOOSE]:o[c.FULL]);if(!d)throw new TypeError(`Invalid Version: ${f}`);if(this.raw=f,this.major=+d[1],this.minor=+d[2],this.patch=+d[3],this.major>a||this.major<0)throw new TypeError("Invalid major version");if(this.minor>a||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>a||this.patch<0)throw new TypeError("Invalid patch version");d[4]?this.prerelease=d[4].split(".").map(g=>{if(/^[0-9]+$/.test(g)){const v=+g;if(v>=0&&v<a)return v}return g}):this.prerelease=[],this.build=d[5]?d[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(f){if(e("SemVer.compare",this.version,this.options,f),!(f instanceof m)){if(typeof f=="string"&&f===this.version)return 0;f=new m(f,this.options)}return f.version===this.version?0:this.compareMain(f)||this.comparePre(f)}compareMain(f){return f instanceof m||(f=new m(f,this.options)),this.major<f.major?-1:this.major>f.major?1:this.minor<f.minor?-1:this.minor>f.minor?1:this.patch<f.patch?-1:this.patch>f.patch?1:0}comparePre(f){if(f instanceof m||(f=new m(f,this.options)),this.prerelease.length&&!f.prerelease.length)return-1;if(!this.prerelease.length&&f.prerelease.length)return 1;if(!this.prerelease.length&&!f.prerelease.length)return 0;let u=0;do{const d=this.prerelease[u],g=f.prerelease[u];if(e("prerelease compare",u,d,g),d===void 0&&g===void 0)return 0;if(g===void 0)return 1;if(d===void 0)return-1;if(d===g)continue;return y(d,g)}while(++u)}compareBuild(f){f instanceof m||(f=new m(f,this.options));let u=0;do{const d=this.build[u],g=f.build[u];if(e("build compare",u,d,g),d===void 0&&g===void 0)return 0;if(g===void 0)return 1;if(d===void 0)return-1;if(d===g)continue;return y(d,g)}while(++u)}inc(f,u,d){if(f.startsWith("pre")){if(!u&&d===!1)throw new Error("invalid increment argument: identifier is empty");if(u){const g=`-${u}`.match(this.options.loose?o[c.PRERELEASELOOSE]:o[c.PRERELEASE]);if(!g||g[1]!==u)throw new Error(`invalid identifier: ${u}`)}}switch(f){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",u,d);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",u,d);break;case"prepatch":this.prerelease.length=0,this.inc("patch",u,d),this.inc("pre",u,d);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",u,d),this.inc("pre",u,d);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const g=Number(d)?1:0;if(this.prerelease.length===0)this.prerelease=[g];else{let v=this.prerelease.length;for(;--v>=0;)typeof this.prerelease[v]=="number"&&(this.prerelease[v]++,v=-2);if(v===-1){if(u===this.prerelease.join(".")&&d===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(g)}}if(u){let v=[u,g];d===!1&&(v=[u]),y(this.prerelease[0],u)===0?isNaN(this.prerelease[1])&&(this.prerelease=v):this.prerelease=v}break}default:throw new Error(`invalid increment argument: ${f}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return pu=m,pu}var hu,Jh;function FM(){if(Jh)return hu;Jh=1;const e=LM();return hu=(a,o,c=!1)=>{if(a instanceof e)return a;try{return new e(a,o)}catch(h){if(!c)return null;throw h}},hu}var UM=FM();const zM=Kg(UM);function em(e){if(!e)return"";const s=e.replace("+moya","");try{const o=zM(s,{includePrerelease:!0})?.prerelease;if(o&&o?.length>0){const h=String(o[0]).split("-")[1];return!h||!h.startsWith("g")?"":`https://github.com/TryGhost/Ghost/commit/${h.slice(1)}`}return`https://github.com/TryGhost/Ghost/releases/tag/v${s}`}catch{return""}}function HM(e,s){const a=!!e.match?.(/production/i);return!!(a&&s!=="mysql8"||!a&&s==="mysql5")}const BM=_e.create(({})=>{const{updateRoute:e}=Ve();let a=Qe().config;const o=Z_();function c(){return new Date().getFullYear()}function h(){return!!a.enableDeveloperExperiments}function y(){return!a.hostSettings?.siteId}return r.jsx(vt,{afterClose:()=>{e("")},cancelLabel:"",footer:r.jsx(r.Fragment,{}),topRightContent:"close",width:540,children:r.jsxs("div",{className:"flex flex-col gap-4 pb-7 text-sm",children:[r.jsx(Q_,{className:"h-auto w-[120px] dark:invert"}),r.jsxs("div",{className:"mt-3 flex flex-col gap-1.5",children:[o?.message&&r.jsxs("div",{className:"gh-prose-links mb-4 rounded-sm border border-green p-5",children:[r.jsx("strong",{children:"Update available!"}),r.jsx("div",{dangerouslySetInnerHTML:{__html:o.message}})]}),em(a.version)&&r.jsxs("div",{children:[r.jsx("strong",{children:"Version:"})," ",r.jsx("a",{className:"text-green",href:em(a.version),rel:"noopener noreferrer",target:"_blank",children:a.version})]})||r.jsxs("div",{children:[r.jsx("strong",{children:"Version:"})," ",a.version]}),y()&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{children:[r.jsx("strong",{children:"Environment:"})," ",a.environment]}),r.jsxs("div",{children:[r.jsx("strong",{children:"Database:"})," ",a.database]}),r.jsxs("div",{children:[r.jsx("strong",{children:"Mail:"})," ",a.mail?a.mail:"Native"]})]}),h()&&r.jsxs("div",{children:[r.jsx("strong",{children:"Developer experiments:"})," Enabled"]}),y()&&HM(a.environment,a.database)&&r.jsxs("div",{className:"text-red-500 dark:text-red-400",children:["You are running an unsupported database in production. Please ",r.jsx("a",{href:"https://ghost.org/docs/faq/supported-databases/",rel:"noopener noreferrer",target:"_blank",children:"upgrade to MySQL 8"}),"."]})]}),r.jsx(Ys,{}),r.jsxs("div",{className:"flex flex-col gap-1.5",children:[r.jsxs("a",{className:"flex items-center gap-2 hover:text-grey-900 dark:hover:text-grey-400",href:"https://ghost.org/docs/",rel:"noopener noreferrer",target:"_blank",children:[r.jsx(nt,{name:"book-open",size:"sm"})," User documentation"]}),r.jsxs("a",{className:"flex items-center gap-2 hover:text-grey-900 dark:hover:text-grey-400",href:"https://forum.ghost.org/",rel:"noopener noreferrer",target:"_blank",children:[r.jsx(nt,{name:"question-circle",size:"sm"})," Get help with Ghost"]}),r.jsxs("a",{className:"flex items-center gap-2 hover:text-grey-900 dark:hover:text-grey-400",href:"https://ghost.org/docs/contributing/",rel:"noopener noreferrer",target:"_blank",children:[r.jsx(nt,{name:"angle-brackets",size:"sm"})," Get involved"]})]}),r.jsx(Ys,{}),r.jsxs("p",{className:"max-w-[460px] text-xs",children:["Copyright © 2013 – ",c()," Ghost Foundation, released under the ",r.jsx("a",{className:"text-green",href:"https://github.com/TryGhost/Ghost/blob/main/LICENSE",rel:"noopener noreferrer",target:"_blank",children:"MIT license"}),". ",r.jsx("a",{className:"text-green",href:"https://ghost.org/",rel:"noopener noreferrer",target:"_blank",children:"Ghost"})," is a registered trademark of ",r.jsx("a",{className:"text-green",href:"https://ghost.org/trademark/",rel:"noopener noreferrer",target:"_blank",children:"Ghost Foundation Ltd"}),"."]})]})})}),WM=()=>{const e=Xt(),{updateRoute:s}=Ve(),[a,o]=D.useState(""),[c,h]=D.useState({name:""}),{mutateAsync:y}=J_(),m=Xs(),l=it();return D.useEffect(()=>{m?.isLimited("customIntegrations")&&m.errorIfWouldGoOverLimit("customIntegrations").catch(f=>{f instanceof Ks&&(_e.show(Vr,{prompt:f.message||"Your current plan doesn't support more custom integrations.",onOk:()=>s({route:"/pro",isExternal:!0})}),e.remove(),s("integrations"))})},[m,e,s]),r.jsx(vt,{afterClose:()=>{s("integrations")},okColor:"black",okLabel:"Add",size:"sm",testId:"add-integration-modal",title:"Add integration",onOk:async()=>{if(!a){h({name:"Name is required"});return}try{const f=await y({name:a});e.remove(),s({route:`integrations/${f.integrations[0].id}`})}catch(f){l(f)}},children:r.jsx("div",{className:"mt-5",children:r.jsx(et,{marginBottom:!1,marginTop:!1,children:r.jsx(je,{autoFocus:!0,error:!!c.name,hint:c.name,maxLength:191,placeholder:"Custom integration",title:"Name",value:a,onChange:f=>o(f.target.value),onInput:()=>{c.name&&h({name:""})}})})})})},qM=_e.create(WM),YM=()=>{const e=Xt(),{updateRoute:s}=Ve(),a=it(),[o,c]=D.useState(!0),[h,y]=D.useState(null),{data:m}=Vg({searchParams:{filter:"newsletters.status:active+email_disabled:0",limit:"1",page:"1",include:"newsletters,labels"}}),{mutateAsync:l}=O2(),{formState:f,updateForm:u,saveState:d,handleSave:g,errors:v,clearError:_}=pr({initialState:{name:"",description:"",optInExistingSubscribers:!0},onSave:async()=>{const T=await l({name:f.name,description:f.description,opt_in_existing:f.optInExistingSubscribers,feedback_enabled:!0});s({route:`newsletters/${T.newsletters[0].id}`})},onSaveError:a,onValidate:()=>{const T={};return f.name||(T.name="A name is required for your newsletter"),T}}),k=Xs();D.useEffect(()=>{if(!k){c(!1);return}k.errorIfWouldGoOverLimit("newsletters").catch(T=>{if(T instanceof Ks)y(T);else throw T}).finally(()=>{c(!1)})},[k]);const M=m?.meta?.pagination.total;return D.useEffect(()=>{h&&(_e.show(Vr,{prompt:h.message||"Your current plan doesn't support more newsletters.",onOk:()=>s({route:"/pro",isExternal:!0})}),e.remove(),s("newsletters"))},[h,e,s]),o||h?null:r.jsx(vt,{afterClose:()=>{s("newsletters")},backDropClick:!1,okColor:"black",okDisabled:d==="saving",okLabel:"Create",okLoading:d==="saving",size:"sm",testId:"add-newsletter-modal",title:"Create newsletter",onOk:async()=>{await g()&&e.remove()},children:r.jsxs(et,{marginBottom:!1,marginTop:!0,children:[r.jsx(je,{autoFocus:!0,error:!!v.name,hint:v.name,maxLength:191,placeholder:"Weekly roundup",title:"Name",value:f.name,onChange:T=>u(A=>({...A,name:T.target.value})),onKeyDown:()=>_("name")}),r.jsx(dn,{maxLength:2e3,title:"Description",value:f.description,onChange:T=>u(A=>({...A,description:T.target.value}))}),r.jsx(rt,{checked:f.optInExistingSubscribers,direction:"rtl",hint:f.optInExistingSubscribers?`This newsletter will be available to all members. Your ${M===void 0?"":Va(M)} existing subscriber${m?.meta?.pagination.total===1?"":"s"} will also be opted-in to receive it.`:"The newsletter will be available to all new members. Existing members won’t be subscribed, but may visit their account area to opt-in to future emails.",label:"Opt-in existing subscribers",labelStyle:"heading",onChange:T=>u(A=>({...A,optInExistingSubscribers:T.target.checked}))})]})})},GM=_e.create(YM),XM=({recommendation:e,animate:s})=>{const a=Xt(),{updateRoute:o,route:c}=Ve(),{mutateAsync:h}=e2(),y=it(),{formState:m,updateForm:l,handleSave:f,saveState:u,errors:d,clearError:g,setErrors:v}=pr({initialState:{...e},onSave:async T=>{await h(T),a.remove(),gt({title:"Recommendation added",type:"success"}),r2("Recommendation Added",{oneClickSubscribe:T.one_click_subscribe}),o("recommendations")},onSaveError:y,onValidate:T=>t2(T)});let _="Add",k=!1;u==="saving"?k=!0:u==="saved"&&(_="Added");let M={label:"Back",icon:"arrow-left",iconColorClass:"text-black dark:text-white",link:!0,size:"sm",onClick:()=>{u!=="saving"&&(a.remove(),_e.show(fx,{pathName:c,animate:!1,recommendation:{...m}}))}};return r.jsx(vt,{afterClose:()=>{o("recommendations")},animate:s??!0,backDropClick:!1,cancelLabel:"Cancel",dirty:!0,leftButtonProps:M,okColor:"black",okLabel:_,okLoading:k,size:"sm",testId:"add-recommendation-modal",title:"Add recommendation",stickyFooter:!0,onCancel:()=>{u!=="saving"&&(a.remove(),o("recommendations"))},onOk:async()=>{if(u!=="saving"){Zg();try{await f({force:!0})}catch{gt({type:"error",title:"Something went wrong when adding this recommendation, please try again."})}}},children:r.jsx(n2,{clearError:g,errors:d,formState:m,setErrors:v,showURL:!1,updateForm:l})})},KM=_e.create(XM),tm=e=>qi(e).save||"",VM=function(e,s){try{new URL(s).hostname.includes(".")?delete e.url:e.url="Enter a valid URL"}catch{e.url="Enter a valid URL"}return e},ZM=({searchParams:e,recommendation:s,animate:a})=>{const[o,c]=D.useState(!1),h=Xt(),{updateRoute:y}=Ve(),{mutateAsync:m}=s2(),l=s?"":e?.get("url")??"",{save:f}=l?qi(l):{save:""},u=ot.useRef(!1),[d,g]=ot.useState(!!f),{formState:v,updateForm:_,handleSave:k,errors:M,saveState:T,clearError:A}=pr({initialState:s??{title:"",url:f||"",description:"",excerpt:null,featured_image:null,favicon:null,one_click_subscribe:!1},onSave:async()=>{let R;R=new URL(v.url);const $=R.hostname.replace("www.",""),W={...v,url:R.toString()},{recommendations:O=[]}=await m(R);if(!O||O.length===0)return;const K=O[0];if(K.id)throw new uh("A recommendation with this URL already exists.");W.title=K.title??$,W.excerpt=K.excerpt??W.excerpt,W.featured_image=K.featured_image??W.featured_image??null,W.favicon=K.favicon??W.favicon??null,W.one_click_subscribe=K.one_click_subscribe??W.one_click_subscribe??!1,W.description=W.excerpt||null,h.remove(),_e.show(KM,{animate:!1,recommendation:W})},onValidate:()=>{const R={};return VM(R,v.url),d&&g(Object.keys(R).length===0),R}}),I=ot.useCallback(async()=>{if(T!=="saving"){Zg();try{if(await k({force:!0}))return}catch(R){const $=R instanceof uh?R.message:"Something went wrong while checking this URL, please try again.";gt({type:"error",title:$})}d&&g(!1)}},[k,T,d,g]);return ot.useEffect(()=>{d&&!u.current&&(u.current=!0,I())},[d,I]),D.useEffect(()=>{o&&(I(),c(!1))},[v]),d?r.jsx(vt,{afterClose:()=>{y("recommendations")},animate:a??!0,backDropClick:!1,footer:!1,header:!1,size:"sm",children:r.jsx("div",{className:"flex flex-col items-center justify-center p-8",children:r.jsx(Yi,{})})}):r.jsxs(vt,{afterClose:()=>{y("recommendations")},animate:a??!0,backDropClick:!1,okColor:"black",okLabel:"Next",okLoading:T==="saving",size:"sm",testId:"add-recommendation-modal",title:"Add recommendation",onOk:I,children:[r.jsxs("p",{className:"mt-4",children:["You can recommend ",r.jsx("strong",{children:"any site"})," your audience will find valuable, not just those published on Ghost."]}),r.jsx(et,{marginBottom:!1,marginTop:!0,children:r.jsx(je,{autoFocus:!0,error:!!M.url,hint:M.url||r.jsxs(r.Fragment,{children:["Need inspiration? ",r.jsx("a",{className:"text-green",href:"https://www.ghost.org/explore",rel:"noopener noreferrer",target:"_blank",children:"Explore thousands of sites"})," to recommend"]}),maxLength:2e3,placeholder:"https://www.example.com",title:"URL",value:v.url,onBlur:()=>{const R=tm(v.url);_($=>({...$,url:R}))},onChange:R=>{A?.("url"),_($=>({...$,url:R.target.value}))},onKeyDown:R=>{R.key==="Enter"&&(R.preventDefault(),_($=>({...$,url:tm(v.url)})),c(!0))}})})]})},fx=_e.create(ZM);function QM(e,s){let a;return function(...c){const h=()=>{clearTimeout(a),e(...c)};clearTimeout(a),a=setTimeout(h,s)}}const bd=({generateContent:e,className:s,height:a,width:o,parentClassName:c,testId:h,addDelay:y=!1})=>{const[m,l]=D.useState(0),f=[D.useRef(null),D.useRef(null)],[u,d]=D.useState(0);return D.useEffect(()=>{const g=m===0?1:0,v=f[g].current;if(v){e(v);const _=()=>{y?setTimeout(()=>{l(g)},500):l(g)};return v.addEventListener("load",_),()=>{v.removeEventListener("load",_)}}},[e]),D.useEffect(()=>{const g=f[m].current,v=QM(()=>{d(g?.contentWindow?.scrollY||0)},250);return g?.contentWindow?.addEventListener("scroll",v),()=>{g?.contentWindow?.removeEventListener("scroll",v)}},[m,f]),D.useEffect(()=>{const g=f[m].current;if(g)try{g.contentWindow?.scrollTo(0,u)}catch(v){j_(v)}},[u,m,f]),r.jsxs("div",{className:c,"data-testid":h,children:[r.jsx("iframe",{ref:f[0],className:`${s} ${m!==0?"z-10 opacity-0":"z-20 opacity-100"}`,"data-visible":m===0,frameBorder:"0",height:a,title:"Buffered Preview 1",width:o}),r.jsx("iframe",{ref:f[1],className:`${s} ${m!==1?"z-10 opacity-0":"z-20 opacity-100"}`,"data-visible":m===1,frameBorder:"0",height:a,title:"Buffered Preview 2",width:o})]})},JM=(e,s,a)=>{const o=new URLSearchParams;return o.append("announcement_bg",e||"accent"),o.append("announcement",s||""),a&&a.length>0&&o.append("announcement_vis",a?.join(",")||""),o.toString()},ej=({announcementBackgroundColor:e,announcementContent:s,url:a,visibility:o})=>{const c=D.useMemo(()=>o,[o?.join(",")]),h=D.useCallback(y=>{a&&fetch(a,{method:"POST",headers:{"Content-Type":"text/html;charset=utf-8","x-ghost-preview":JM(e,s,c),Accept:"text/plain"},mode:"cors",credentials:"include"}).then(m=>m.text()).then(m=>{const l="html { pointer-events: none; }",u=new DOMParser().parseFromString(m,"text/html"),d=u.querySelector("style"),g=d.innerHTML;d.innerHTML=`${g}
1
+ import{j as r,r as D,aH as ye,e as ot,d7 as x_,av as Gg,aq as b_,ar as v_,as as Xg,aw as w_,au as el,aE as Jf,ax as y_,ay as If,az as __,aF as k_,aG as M_,d8 as nt,ad as ns,bJ as it,d9 as ao,da as On,db as mt,dc as gt,cF as Kg,cW as Vg,dd as Zg,de as uh,df as j_,dg as Xr,dh as E_,di as ts,aB as T_,dj as N_,d6 as ed,d5 as Bs,dk as Wa,ak as S_,aN as A_,dl as C_,dm as tl,dn as td,dp as fh,dq as Lt,dr as Ja,ds as Df,dt as I_,du as qs,dv as D_,dw as R_,dx as O_,dy as Wi,dz as $_,dA as P_,dB as Rf,ac as L_,dC as F_,dD as U_,dE as z_,dF as H_,dG as Cn,dH as dh,dI as ph,dJ as B_}from"./index-Bgo4hw-T.js";import{H as bt,a as Kr,S as Ys,B as Ue,x as rl,K as W_,y as Xt,z as q_,A as Ot,M as vt,C as Gr,F as Y_,G as fn,J as rd,O as G_,Q as nl,U as _e,V as Ve,W as X_,X as nd,Y as Qe,Z as cn,_ as $n,$ as Et,a0 as St,a1 as ss,a2 as pr,a3 as K_,a4 as hh,a5 as et,a6 as je,a7 as mh,a8 as gh,a9 as rt,aa as Qg,ab as Jg,ac as V_,ad as Z_,ae as Q_,af as J_,ag as Xs,ah as Ks,ai as Vr,aj as dn,ak as Va,al as e2,am as t2,an as r2,ao as n2,ap as s2,aq as qi,ar as Yi,as as a2,at as xh,au as bh,av as o2,aw as Vs,ax as un,ay as ln,az as e0,aA as i2,aB as l2,aC as c2,aD as t0,aE as sd,aF as u2,aG as f2,aH as d2,aI as Gi,aJ as ad,aK as p2,aL as od,aM as h2,aN as m2,aO as r0,aP as n0,aQ as id,aR as g2,aS as x2,aT as b2,aU as s0,aV as a0,aW as v2,aX as w2,aY as vh,aZ as o0,a_ as i0,a$ as l0,b0 as Of,b1 as y2,b2 as _2,b3 as k2,b4 as c0,b5 as Hi,b6 as M2,b7 as u0,b8 as f0,b9 as j2,ba as E2,bb as wh,bc as T2,bd as ld,be as yh,bf as N2,bg as d0,bh as cd,bi as ud,bj as S2,bk as A2,bl as p0,bm as C2,bn as h0,bo as I2,bp as D2,bq as R2}from"./settings-CEfmF6wO.js";import{a as O2,u as m0,b as g0}from"./newsletters-C8pT7kSQ.js";import{C as $2,a as P2}from"./index-_dLVP2u2.js";import{u as x0}from"./posts-C94RiQ4S.js";import{a as Zs,b as fd,c as L2,g as sl}from"./tiers-jCNws2RK.js";import{L as F2}from"./list-filter-CofVbkA4.js";import"./index-D0RISNEd.js";function U2(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}const b0=({children:e,...s})=>r.jsx("div",{className:"flex h-full w-full flex-col px-8",...s,children:r.jsx("div",{className:"h-full w-full overflow-hidden rounded-t-[4px] shadow-sm",children:e})}),v0=({children:e,...s})=>r.jsx("div",{className:"flex h-[775px] w-[380px] flex-col rounded-3xl bg-white p-2 shadow-xl dark:bg-grey-900",...s,children:r.jsx("div",{className:"w-100 h-100 grow overflow-auto rounded-2xl border border-grey-100 dark:border-grey-950",children:e})}),z2=({title:e,label:s,value:a,onChange:o,disabled:c,error:h,hint:y,checked:m,separator:l,testId:f})=>{const u=D.useId(),d=g=>{o(g===!0)};return r.jsxs("div",{children:[r.jsxs("div",{className:`flex flex-col gap-1 ${l&&"pb-2"}`,children:[e&&r.jsx(bt,{grey:!0,level:6,children:e}),r.jsxs("label",{className:`flex cursor-pointer items-start ${e&&"-mb-1 mt-1"}`,htmlFor:u,children:[r.jsx($2,{className:"mt-0.5 flex size-4 cursor-pointer appearance-none items-center justify-center rounded-[3px] border border-solid border-grey-500 bg-white outline-none data-[state=checked]:border-black data-[state=indeterminate]:border-black data-[state=checked]:bg-black data-[state=indeterminate]:bg-black","data-testid":f,defaultChecked:m,disabled:c,id:u,value:a,onCheckedChange:d,children:r.jsx(P2,{children:r.jsx("svg",{fill:"none",height:"11",viewBox:"0 0 10 11",width:"10",children:r.jsx("path",{d:"M1 5.88889L4.6 9L9 1",stroke:"white",strokeLinecap:"round",strokeWidth:"2"})})})}),r.jsxs("div",{className:`ml-2 flex flex-col ${y&&"mb-2"}`,children:[r.jsx("span",{className:`inline-block text-[1.425rem] dark:text-white ${y&&"-mb-1"}`,children:s}),y&&r.jsx(Kr,{color:h?"red":"",children:y})]})]})]}),(l||h)&&r.jsx(Ys,{className:h?"border-red":""})]})},$f=({title:e,checkboxes:s,hint:a,error:o})=>r.jsxs("div",{children:[e&&r.jsx(bt,{grey:!0,level:6,children:e}),r.jsx("div",{className:"mt-2 flex flex-col gap-1",children:s?.map(({key:c,...h})=>r.jsx(z2,{...h},c))}),r.jsx("div",{className:`flex flex-col ${a&&"mb-2"}`,children:a&&r.jsx(Kr,{color:o?"red":"",children:a})})]}),H2=({hex:e,value:s,title:a,size:o="md",isSelected:c,onSelect:h})=>{const y=D.useRef(null),m=u=>{u.preventDefault(),h(s!==void 0?s:e)},l=e.length===4&&e[3]==="0"||e.length===8&&e.slice(6)==="00";let f="h-5 w-5";switch(o){case"lg":f="w-6 h-6";break}return r.jsx("button",{ref:y,className:ye("relative flex shrink-0 cursor-pointer items-center rounded-full border border-grey-300 dark:border-grey-800",f,c&&"outline outline-2 outline-green"),style:{backgroundColor:e},title:a,type:"button",onClick:m,children:l&&r.jsx("div",{className:"absolute left-0 top-0 z-10 w-[136%] origin-left rotate-45 border-b border-b-red"})})},w0=({title:e,value:s,swatches:a,swatchSize:o="md",onSwatchChange:c,onTogglePicker:h,isExpanded:y,picker:m=!0,containerClassName:l})=>{const f=a.find(d=>d.value===s||d.hex===s);l=ye("flex flex-col gap-3");const u=y||!m;return r.jsxs("div",{className:l,children:[e&&r.jsx(bt,{useLabelTag:!0,children:e}),r.jsxs("div",{className:"flex gap-1",children:[u&&r.jsx("div",{className:"flex items-center gap-1",children:a.map(({customContent:d,...g})=>d?r.jsx(D.Fragment,{children:d},g.title):r.jsx(H2,{isSelected:f?.title===g.title,size:o,onSelect:c,...g},g.title))}),m&&r.jsxs("button",{"aria-label":"Pick color",className:"relative size-6 cursor-pointer rounded-full border border-grey-250 dark:border-grey-800",type:"button",onClick:h,children:[r.jsx("div",{className:"absolute inset-0 rounded-full bg-[conic-gradient(hsl(360,100%,50%),hsl(315,100%,50%),hsl(270,100%,50%),hsl(225,100%,50%),hsl(180,100%,50%),hsl(135,100%,50%),hsl(90,100%,50%),hsl(45,100%,50%),hsl(0,100%,50%))]"}),f&&r.jsx("div",{className:"absolute inset-[3px] overflow-hidden rounded-full border border-white dark:border-grey-950",style:{backgroundColor:f.hex},children:f.hex==="transparent"&&r.jsx("div",{className:"absolute left-[3px] top-[3px] z-10 w-[136%] origin-left rotate-45 border-b border-b-red"})}),!f&&s&&r.jsx("div",{className:"absolute inset-[3px] overflow-hidden rounded-full border border-white dark:border-grey-950",style:{backgroundColor:s},children:s==="transparent"&&r.jsx("div",{className:"absolute left-[3px] top-[3px] z-10 w-[136%] origin-left rotate-45 border-b border-b-red"})})]})]})]})};function Qs(){return(Qs=Object.assign||function(e){for(var s=1;s<arguments.length;s++){var a=arguments[s];for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(e[o]=a[o])}return e}).apply(this,arguments)}function al(e,s){if(e==null)return{};var a,o,c={},h=Object.keys(e);for(o=0;o<h.length;o++)s.indexOf(a=h[o])>=0||(c[a]=e[a]);return c}function eo(e){var s=D.useRef(e),a=D.useRef(function(o){s.current&&s.current(o)});return s.current=e,a.current}var to=function(e,s,a){return s===void 0&&(s=0),a===void 0&&(a=1),e>a?a:e<s?s:e},Za=function(e){return"touches"in e},Pf=function(e){return e&&e.ownerDocument.defaultView||self},_h=function(e,s,a){var o=e.getBoundingClientRect(),c=Za(s)?(function(h,y){for(var m=0;m<h.length;m++)if(h[m].identifier===y)return h[m];return h[0]})(s.touches,a):s;return{left:to((c.pageX-(o.left+Pf(e).pageXOffset))/o.width),top:to((c.pageY-(o.top+Pf(e).pageYOffset))/o.height)}},kh=function(e){!Za(e)&&e.preventDefault()},y0=ot.memo(function(e){var s=e.onMove,a=e.onKey,o=al(e,["onMove","onKey"]),c=D.useRef(null),h=eo(s),y=eo(a),m=D.useRef(null),l=D.useRef(!1),f=D.useMemo(function(){var v=function(M){kh(M),(Za(M)?M.touches.length>0:M.buttons>0)&&c.current?h(_h(c.current,M,m.current)):k(!1)},_=function(){return k(!1)};function k(M){var T=l.current,A=Pf(c.current),I=M?A.addEventListener:A.removeEventListener;I(T?"touchmove":"mousemove",v),I(T?"touchend":"mouseup",_)}return[function(M){var T=M.nativeEvent,A=c.current;if(A&&(kh(T),!(function(R,$){return $&&!Za(R)})(T,l.current)&&A)){if(Za(T)){l.current=!0;var I=T.changedTouches||[];I.length&&(m.current=I[0].identifier)}A.focus(),h(_h(A,T,m.current)),k(!0)}},function(M){var T=M.which||M.keyCode;T<37||T>40||(M.preventDefault(),y({left:T===39?.05:T===37?-.05:0,top:T===40?.05:T===38?-.05:0}))},k]},[y,h]),u=f[0],d=f[1],g=f[2];return D.useEffect(function(){return g},[g]),ot.createElement("div",Qs({},o,{onTouchStart:u,onMouseDown:u,className:"react-colorful__interactive",ref:c,onKeyDown:d,tabIndex:0,role:"slider"}))}),dd=function(e){return e.filter(Boolean).join(" ")},_0=function(e){var s=e.color,a=e.left,o=e.top,c=o===void 0?.5:o,h=dd(["react-colorful__pointer",e.className]);return ot.createElement("div",{className:h,style:{top:100*c+"%",left:100*a+"%"}},ot.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:s}}))},Gt=function(e,s,a){return s===void 0&&(s=0),a===void 0&&(a=Math.pow(10,s)),Math.round(a*e)/a},B2=function(e){return X2(Lf(e))},Lf=function(e){return e[0]==="#"&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?Gt(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?Gt(parseInt(e.substring(6,8),16)/255,2):1}},W2=function(e){return G2(Y2(e))},q2=function(e){var s=e.s,a=e.v,o=e.a,c=(200-s)*a/100;return{h:Gt(e.h),s:Gt(c>0&&c<200?s*a/100/(c<=100?c:200-c)*100:0),l:Gt(c/2),a:Gt(o,2)}},Ff=function(e){var s=q2(e);return"hsl("+s.h+", "+s.s+"%, "+s.l+"%)"},Y2=function(e){var s=e.h,a=e.s,o=e.v,c=e.a;s=s/360*6,a/=100,o/=100;var h=Math.floor(s),y=o*(1-a),m=o*(1-(s-h)*a),l=o*(1-(1-s+h)*a),f=h%6;return{r:Gt(255*[o,m,y,y,l,o][f]),g:Gt(255*[l,o,o,m,y,y][f]),b:Gt(255*[y,y,l,o,o,m][f]),a:Gt(c,2)}},Ri=function(e){var s=e.toString(16);return s.length<2?"0"+s:s},G2=function(e){var s=e.r,a=e.g,o=e.b,c=e.a,h=c<1?Ri(Gt(255*c)):"";return"#"+Ri(s)+Ri(a)+Ri(o)+h},X2=function(e){var s=e.r,a=e.g,o=e.b,c=e.a,h=Math.max(s,a,o),y=h-Math.min(s,a,o),m=y?h===s?(a-o)/y:h===a?2+(o-s)/y:4+(s-a)/y:0;return{h:Gt(60*(m<0?m+6:m)),s:Gt(h?y/h*100:0),v:Gt(h/255*100),a:c}},K2=ot.memo(function(e){var s=e.hue,a=e.onChange,o=dd(["react-colorful__hue",e.className]);return ot.createElement("div",{className:o},ot.createElement(y0,{onMove:function(c){a({h:360*c.left})},onKey:function(c){a({h:to(s+360*c.left,0,360)})},"aria-label":"Hue","aria-valuenow":Gt(s),"aria-valuemax":"360","aria-valuemin":"0"},ot.createElement(_0,{className:"react-colorful__hue-pointer",left:s/360,color:Ff({h:s,s:100,v:100,a:1})})))}),V2=ot.memo(function(e){var s=e.hsva,a=e.onChange,o={backgroundColor:Ff({h:s.h,s:100,v:100,a:1})};return ot.createElement("div",{className:"react-colorful__saturation",style:o},ot.createElement(y0,{onMove:function(c){a({s:100*c.left,v:100-100*c.top})},onKey:function(c){a({s:to(s.s+100*c.left,0,100),v:to(s.v-100*c.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+Gt(s.s)+"%, Brightness "+Gt(s.v)+"%"},ot.createElement(_0,{className:"react-colorful__saturation-pointer",top:1-s.v/100,left:s.s/100,color:Ff(s)})))}),k0=function(e,s){if(e===s)return!0;for(var a in e)if(e[a]!==s[a])return!1;return!0},Z2=function(e,s){return e.toLowerCase()===s.toLowerCase()||k0(Lf(e),Lf(s))};function Q2(e,s,a){var o=eo(a),c=D.useState(function(){return e.toHsva(s)}),h=c[0],y=c[1],m=D.useRef({color:s,hsva:h});D.useEffect(function(){if(!e.equal(s,m.current.color)){var f=e.toHsva(s);m.current={hsva:f,color:s},y(f)}},[s,e]),D.useEffect(function(){var f;k0(h,m.current.hsva)||e.equal(f=e.fromHsva(h),m.current.color)||(m.current={hsva:h,color:f},o(f))},[h,e,o]);var l=D.useCallback(function(f){y(function(u){return Object.assign({},u,f)})},[]);return[h,l]}var J2=typeof window<"u"?D.useLayoutEffect:D.useEffect,e3=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},Mh=new Map,t3=function(e){J2(function(){var s=e.current?e.current.ownerDocument:document;if(s!==void 0&&!Mh.has(s)){var a=s.createElement("style");a.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,Mh.set(s,a);var o=e3();o&&a.setAttribute("nonce",o),s.head.appendChild(a)}},[])},r3=function(e){var s=e.className,a=e.colorModel,o=e.color,c=o===void 0?a.defaultColor:o,h=e.onChange,y=al(e,["className","colorModel","color","onChange"]),m=D.useRef(null);t3(m);var l=Q2(a,c,h),f=l[0],u=l[1],d=dd(["react-colorful",s]);return ot.createElement("div",Qs({},y,{ref:m,className:d}),ot.createElement(V2,{hsva:f,onChange:u}),ot.createElement(K2,{hue:f.h,onChange:u,className:"react-colorful__last-control"}))},n3={defaultColor:"000",toHsva:B2,fromHsva:function(e){return W2({h:e.h,s:e.s,v:e.v,a:1})},equal:Z2},s3=function(e){return ot.createElement(r3,Qs({},e,{colorModel:n3}))},a3=/^#?([0-9A-F]{3,8})$/i,o3=function(e){var s=e.color,a=s===void 0?"":s,o=e.onChange,c=e.onBlur,h=e.escape,y=e.validate,m=e.format,l=e.process,f=al(e,["color","onChange","onBlur","escape","validate","format","process"]),u=D.useState(function(){return h(a)}),d=u[0],g=u[1],v=eo(o),_=eo(c),k=D.useCallback(function(T){var A=h(T.target.value);g(A),y(A)&&v(l?l(A):A)},[h,l,y,v]),M=D.useCallback(function(T){y(T.target.value)||g(h(a)),_(T)},[a,h,y,_]);return D.useEffect(function(){g(h(a))},[a,h]),ot.createElement("input",Qs({},f,{value:m?m(d):d,spellCheck:"false",onChange:k,onBlur:M}))},jh=function(e){return"#"+e},i3=function(e){var s=e.prefixed,a=e.alpha,o=al(e,["prefixed","alpha"]),c=D.useCallback(function(y){return y.replace(/([^0-9A-F]+)/gi,"").substring(0,a?8:6)},[a]),h=D.useCallback(function(y){return(function(m,l){var f=a3.exec(m),u=f?f[1].length:0;return u===3||u===6||!!l&&u===4||!!l&&u===8})(y,a)},[a]);return ot.createElement(o3,Qs({},o,{escape:c,format:s?jh:void 0,process:jh,validate:h}))};const l3=({hexValue:e,eyedropper:s,clearButtonValue:a,containerClassName:o,onChange:c})=>{const h=D.useRef(null),y=D.useCallback(g=>{var v,_,k;g.stopPropagation();const M=(v=h.current)==null?void 0:v.querySelector("input");g.target!==M&&((k=(_=h.current)==null?void 0:_.querySelector("input"))==null||k.focus(),g.preventDefault())},[]),m=D.useRef(!1),l=D.useCallback(()=>{var g,v;m.current=!1,(v=(g=h.current)==null?void 0:g.querySelector("input"))==null||v.focus(),document.removeEventListener("mouseup",l),document.removeEventListener("touchend",l)},[]),f=D.useCallback(()=>{m.current=!0,document.addEventListener("mouseup",l),document.addEventListener("touchend",l)},[l]),u=D.useCallback(g=>{if(g.preventDefault(),!window.EyeDropper)return;m.current=!0,document.body.style.setProperty("pointer-events","none"),new window.EyeDropper().open().then(_=>c?.(_.sRGBHex)).finally(()=>{var _,k;m.current=!1,document.body.style.removeProperty("pointer-events"),(k=(_=h.current)==null?void 0:_.querySelector("input"))==null||k.focus()})},[c]);D.useEffect(()=>{var g,v;(v=(g=h.current)==null?void 0:g.querySelector("input"))==null||v.focus()},[]);const d=D.useCallback(()=>{var g,v;(v=(g=h.current)==null?void 0:g.querySelector("input"))==null||v.focus()},[]);return o=ye("mt-2",o),r.jsxs("div",{className:o,onMouseDown:y,onTouchStart:y,children:[r.jsx(s3,{className:"w-full",color:e||"#ffffff",onChange:c,onMouseDown:f,onTouchStart:f}),r.jsxs("div",{className:"mt-3 flex gap-2",children:[r.jsxs("div",{ref:h,className:"peer relative order-2 flex h-10 w-full items-center",onClick:d,children:[r.jsx("span",{className:"absolute left-2 top-[9px] z-10 ml-1 mr-2 text-grey-700",children:"#"}),r.jsx(i3,{"aria-label":"Color value",className:"z-[1] w-full rounded-md border border-transparent bg-grey-150 p-2 pl-6 transition-all hover:bg-grey-100 focus:border-green focus:bg-white focus:shadow-[0_0_0_1px_rgba(48,207,67,1)] dark:bg-grey-900 dark:text-white dark:focus:bg-grey-925",color:e,onChange:c}),s&&!!window.EyeDropper&&r.jsx("button",{className:"absolute inset-y-0 right-3 z-50 my-auto h-4 w-4 p-[1px]",type:"button",onClick:u,children:r.jsx(x_,{className:"h-full w-full"})})]}),a!==void 0&&r.jsx(Ue,{color:"grey",value:"Clear",onClick:()=>c?.(a)})]})]})},c3=D.createContext({colorPickers:[]}),Eh=e=>e.length===4?e.replace(/#(.)(.)(.)/,"#$1$1$2$2$3$3"):e,Yr=({testId:e,title:s,direction:a,value:o,hint:c,error:h,eyedropper:y,clearButtonValue:m,onChange:l,swatches:f=[],alwaysOpen:u=!1,debounceMs:d})=>{const[g,v]=D.useState(!1),[_,k]=D.useState(o),M=D.useContext(c3),T=D.useId();D.useEffect(()=>{k(W=>Eh(W||"")===o?W:o)},[o]),D.useEffect(()=>(M.colorPickers.push({id:T,setExpanded:v}),()=>{M.colorPickers=M.colorPickers.filter(W=>W.id!==T)}),[M,T]),D.useEffect(()=>{if(g){M.colorPickers.filter(O=>O.id!==T).forEach(O=>O.setExpanded(!1));const W=()=>{v(!1)};return document.addEventListener("click",W),()=>{document.removeEventListener("click",W)}}},[M,T,g]);const A=D.useMemo(()=>l&&d?rl(l,d):l,[d,l]),I=W=>{k(W),A?.(W?Eh(W):null)};let R=r.jsx(w0,{isExpanded:g,swatches:f,value:_,onSwatchChange:W=>{I(W),v(!1)},onTogglePicker:()=>!u&&v(!g)});s&&(R=r.jsxs("div",{className:ye("flex w-full cursor-pointer items-start first:mt-0 dark:text-white",a==="rtl"&&"flex-row-reverse"),children:[r.jsx("div",{className:"shrink-0",children:R}),r.jsxs("div",{className:ye("flex-1",a==="rtl"?"pr-2":"pl-2",c?"mt-[-2px]":"mt-[1px]"),onClick:()=>!u&&v(!g),children:[s,c&&r.jsx("div",{className:`text-xs ${h?"text-red":"text-grey-700"}`,children:c})]})]}));const $=f.find(W=>W.value===_);return r.jsxs("div",{className:"flex-col","data-testid":e,onClick:W=>W.stopPropagation(),children:[R,(u||g)&&r.jsx(l3,{clearButtonValue:m,eyedropper:y,hexValue:$?.hex||_||void 0,onChange:I})]})},u3=({value:e,onChange:s,singleParagraph:a=!0,...o})=>{const c=D.useCallback(h=>{const m=new DOMParser().parseFromString(h,"text/html");m.querySelectorAll("*").forEach(f=>{f.style.removeProperty("white-space"),f.getAttribute("style")||f.removeAttribute("style")}),m.body.innerHTML!==e&&s?.(m.body.innerHTML)},[e,s]);return r.jsx(W_,{...o,singleParagraph:a,children:h=>r.jsx(h.HtmlOutputPlugin,{html:e,setHtml:c})})},pd=({title:e,hideTitle:s,error:a,hint:o,value:c,clearBg:h=!1,className:y="",containerClassName:m="",hintClassName:l="",unstyled:f=!1,...u})=>{const d=f?"":ye("flex min-h-[32px] items-center rounded-md border border-transparent py-1.5 md:min-h-[36px]",h?"bg-transparent":"bg-grey-150 px-3 dark:bg-grey-900",a?"border-red":"transition-all hover:bg-grey-100 has-[:focus]:border-green has-[:focus]:bg-white has-[:focus]:shadow-[0_0_0_1px_rgba(48,207,67,1)] dark:selection:bg-[rgba(88,101,116,0.99)] dark:hover:bg-grey-925 dark:has-[:focus]:bg-grey-950",e&&!s&&!h&&"mt-2",y);return r.jsxs("div",{className:`flex flex-col ${m}`,children:[e&&r.jsx(bt,{className:s?"sr-only":"",grey:!0,useLabelTag:!0,children:e}),r.jsx("div",{className:d,children:r.jsx(u3,{...u,value:c})}),o&&r.jsx(Kr,{className:l,color:a?"red":"",children:o})]})};var hd="Radio",[f3,M0]=Xg(hd),[d3,p3]=f3(hd),j0=D.forwardRef((e,s)=>{const{__scopeRadio:a,name:o,checked:c=!1,required:h,disabled:y,value:m="on",onCheck:l,form:f,...u}=e,[d,g]=D.useState(null),v=Jf(s,M=>g(M)),_=D.useRef(!1),k=d?f||!!d.closest("form"):!0;return r.jsxs(d3,{scope:a,checked:c,disabled:y,children:[r.jsx(el.button,{type:"button",role:"radio","aria-checked":c,"data-state":S0(c),"data-disabled":y?"":void 0,disabled:y,value:m,...u,ref:v,onClick:If(e.onClick,M=>{c||l?.(),k&&(_.current=M.isPropagationStopped(),_.current||M.stopPropagation())})}),k&&r.jsx(N0,{control:d,bubbles:!_.current,name:o,value:m,checked:c,required:h,disabled:y,form:f,style:{transform:"translateX(-100%)"}})]})});j0.displayName=hd;var E0="RadioIndicator",T0=D.forwardRef((e,s)=>{const{__scopeRadio:a,forceMount:o,...c}=e,h=p3(E0,a);return r.jsx(__,{present:o||h.checked,children:r.jsx(el.span,{"data-state":S0(h.checked),"data-disabled":h.disabled?"":void 0,...c,ref:s})})});T0.displayName=E0;var h3="RadioBubbleInput",N0=D.forwardRef(({__scopeRadio:e,control:s,checked:a,bubbles:o=!0,...c},h)=>{const y=D.useRef(null),m=Jf(y,h),l=k_(a),f=M_(s);return D.useEffect(()=>{const u=y.current;if(!u)return;const d=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(d,"checked").set;if(l!==a&&v){const _=new Event("click",{bubbles:o});v.call(u,a),u.dispatchEvent(_)}},[l,a,o]),r.jsx(el.input,{type:"radio","aria-hidden":!0,defaultChecked:a,...c,tabIndex:-1,ref:m,style:{...c.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});N0.displayName=h3;function S0(e){return e?"checked":"unchecked"}var m3=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ol="RadioGroup",[g3]=Xg(ol,[Gg,M0]),A0=Gg(),C0=M0(),[x3,b3]=g3(ol),I0=D.forwardRef((e,s)=>{const{__scopeRadioGroup:a,name:o,defaultValue:c,value:h,required:y=!1,disabled:m=!1,orientation:l,dir:f,loop:u=!0,onValueChange:d,...g}=e,v=A0(a),_=b_(f),[k,M]=v_({prop:h,defaultProp:c??null,onChange:d,caller:ol});return r.jsx(x3,{scope:a,name:o,required:y,disabled:m,value:k,onValueChange:M,children:r.jsx(w_,{asChild:!0,...v,orientation:l,dir:_,loop:u,children:r.jsx(el.div,{role:"radiogroup","aria-required":y,"aria-orientation":l,"data-disabled":m?"":void 0,dir:_,...g,ref:s})})})});I0.displayName=ol;var D0="RadioGroupItem",R0=D.forwardRef((e,s)=>{const{__scopeRadioGroup:a,disabled:o,...c}=e,h=b3(D0,a),y=h.disabled||o,m=A0(a),l=C0(a),f=D.useRef(null),u=Jf(s,f),d=h.value===c.value,g=D.useRef(!1);return D.useEffect(()=>{const v=k=>{m3.includes(k.key)&&(g.current=!0)},_=()=>g.current=!1;return document.addEventListener("keydown",v),document.addEventListener("keyup",_),()=>{document.removeEventListener("keydown",v),document.removeEventListener("keyup",_)}},[]),r.jsx(y_,{asChild:!0,...m,focusable:!y,active:d,children:r.jsx(j0,{disabled:y,required:h.required,checked:d,...l,...c,name:h.name,ref:u,onCheck:()=>h.onValueChange(c.value),onKeyDown:If(v=>{v.key==="Enter"&&v.preventDefault()}),onFocus:If(c.onFocus,()=>{g.current&&f.current?.click()})})})});R0.displayName=D0;var v3="RadioGroupIndicator",O0=D.forwardRef((e,s)=>{const{__scopeRadioGroup:a,...o}=e,c=C0(a);return r.jsx(T0,{...c,...o,ref:s})});O0.displayName=v3;var w3=I0,y3=R0,_3=O0;const k3=({id:e,title:s,options:a,onSelect:o,error:c,hint:h,selectedOption:y,separator:m})=>r.jsxs(w3,{defaultValue:y,name:e,onValueChange:o,children:[r.jsxs("div",{className:`flex flex-col gap-2 ${m&&"pb-2"}`,children:[s&&r.jsx(bt,{level:6,children:s}),a.map(l=>r.jsxs("label",{className:`flex cursor-pointer items-start ${s&&"-mb-1 mt-1"}`,htmlFor:l.value,children:[r.jsx(y3,{className:"relative float-left mt-[3px] size-4 min-w-[16px] appearance-none rounded-full border-2 border-solid border-grey-300 hover:cursor-pointer focus:shadow-none focus:outline-none focus:ring-0 data-[state=checked]:border-green data-[state=checked]:focus:border-green dark:border-grey-800 dark:text-white dark:data-[state=checked]:border-green dark:data-[state=checked]:focus:border-green",id:l.value,value:l.value,children:r.jsx(_3,{className:"flex size-full items-center justify-center after:block after:size-[6px] after:rounded-full after:border-green after:bg-green after:content-[''] dark:after:border-green dark:after:bg-green"})}),r.jsxs("div",{className:`ml-2 flex flex-col ${l.hint&&"mb-2"}`,children:[r.jsx("span",{className:`inline-block text-md dark:text-white ${l.hint&&"-mb-1"}`,children:l.label}),l.hint&&r.jsx(Kr,{children:l.hint})]})]},l.value)),h&&r.jsx(Kr,{color:c?"red":"",children:h})]}),(m||c)&&r.jsx(Ys,{className:c?"border-red":""})]}),Xi=({children:e,gap:s="md",className:a})=>{let o="gap-3";switch(s){case"sm":o="gap-2";break;case"md":o="gap-3";break;case"lg":o="gap-4";break}return a=ye("flex flex-col",o,a),r.jsx("div",{className:a,children:e})},md=({heading:e,children:s,className:a})=>(a=ye("w-full p-[8vmin] pt-5",a),r.jsxs("div",{className:a,children:[e&&r.jsx(bt,{className:"mb-8",children:e}),s]})),gd=({items:e,backIcon:s=!1,snapBackIcon:a=!0,onBack:o,containerClassName:c,itemClassName:h,activeItemClassName:y,separatorClassName:m})=>{const l=e.length;let f=0;return c=ye("flex items-center gap-2 text-sm",c),y=ye("font-bold",y),h=ye("text-sm",h),r.jsxs("div",{className:c,children:[s&&r.jsx(Ue,{className:a?"mr-1":"mr-6",icon:"arrow-left",iconColorClass:"dark:text-white",size:"sm",link:!0,onClick:o}),e.map(u=>{const d=f===l-1?r.jsx("span",{className:y,children:u.label}):r.jsxs(r.Fragment,{children:[r.jsx("button",{className:`${h} ${u.onClick&&"-mx-1 cursor-pointer rounded-sm px-1 py-px hover:bg-grey-100 dark:hover:bg-grey-900"}`,type:"button",onClick:u.onClick,children:u.label},`bc-${f}`),r.jsx("span",{className:m,children:"/"})]});return f=f+1,d})]})},as=({testId:e,title:s,titleHeadingLevel:a=4,size:o="full",width:c,height:h,sidebar:y="",preview:m,dirty:l=!1,cancelLabel:f="Cancel",okLabel:u="OK",okColor:d="black",previewToolbar:g=!0,leftToolbar:v=!0,rightToolbar:_=!0,deviceSelector:k=!0,siteLink:M,previewToolbarURLs:T,previewBgColor:A="grey",selectedURL:I,previewToolbarTabs:R,previewToolbarBreadcrumbs:$,buttonsDisabled:W,sidebarButtons:O,sidebarHeader:K,sidebarPadding:X=!0,sidebarContentClasses:Y,enableCMDS:P=!0,backDropClick:q,onCancel:ee,onOk:ae,afterClose:ne,onSelectURL:Q,onSelectDesktopView:te,onSelectMobileView:pe,onBreadcrumbsBack:we})=>{const H=Xt(),{setGlobalDirtyState:me}=q_();D.useEffect(()=>{me(l)},[l,me]),D.useEffect(()=>{if(ae){const J=be=>{(be.metaKey||be.ctrlKey)&&be.key==="s"&&(be.preventDefault(),ae())};if(P)return window.addEventListener("keydown",J),()=>{window.removeEventListener("keydown",J)}}});const[xe,U]=D.useState("desktop");if(xe==="mobile"&&k?m=r.jsx(v0,{"data-testid":"preview-mobile",children:m}):xe==="desktop"&&k&&(m=r.jsx(b0,{"data-testid":"preview-desktop",children:m})),g){let J=r.jsx(r.Fragment,{});T?J=r.jsx(Ot,{options:T,selectedOption:T.find(Ce=>Ce.value===I),onSelect:Ce=>Ce&&Q?.(Ce.value)}):R?J=r.jsx(fn,{border:!1,selectedTab:I,tabs:R,width:"wide",onTabChange:Q}):$&&(J=r.jsx(gd,{activeItemClassName:"hidden md:!block md:!visible",containerClassName:"whitespace-nowrap",itemClassName:"hidden md:!block md:!visible",items:$,separatorClassName:"hidden md:!block md:!visible",backIcon:!0,onBack:we}));const be="text-black dark:text-green",Ne="text-grey-500 dark:text-grey-600",De=[{icon:"laptop",label:"Desktop",hideLabel:!0,link:!0,size:"sm",iconColorClass:xe==="desktop"?be:Ne,onClick:te||(()=>{U("desktop")})},{icon:"mobile",label:"Mobile",hideLabel:!0,link:!0,size:"sm",iconColorClass:xe==="mobile"?be:Ne,onClick:pe||(()=>{U("mobile")})}],Ee=k&&r.jsx(Gr,{buttons:De});let oe="";A==="grey"?oe="bg-grey-50 dark:bg-black":A==="greygradient"&&(oe="bg-gradient-to-tr from-white to-[#f9f9fa] dark:from-grey-950 dark:to-black");const Te=ye("min-w-100 absolute inset-y-0 left-0 right-[400px] flex w-full grow flex-col overflow-y-auto",oe);let Ae;M&&(Ae=r.jsx("div",{className:"ml-3 border-l border-grey-400 dark:border-grey-800",children:r.jsxs("a",{className:"ml-3 flex items-center gap-1 text-sm",href:M,rel:"noopener noreferrer",target:"_blank",children:["View site ",r.jsx(nt,{name:"arrow-top-right",size:"xs"})]})})),m=r.jsxs("div",{className:Te,children:[g&&r.jsxs("header",{className:"relative flex h-[80px] shrink-0 items-center justify-center px-8 py-5","data-testid":"design-toolbar",children:[v&&r.jsx("div",{className:"absolute left-8 flex h-full items-center",children:J}),_&&r.jsxs("div",{className:"absolute right-8 flex h-full items-center",children:[Ee,Ae]})]}),r.jsx("div",{className:"flex grow items-center justify-center text-sm text-grey-400",children:m})]})}const L=[];return O||(L.push({key:"cancel-modal",label:f,onClick:ee||(()=>{Y_(l,()=>{H.remove(),ne?.()})}),disabled:W}),L.push({key:"ok-modal",label:u,color:d,onClick:ae,disabled:W})),r.jsx(vt,{afterClose:ne,animate:!1,backDropClick:q,dirty:l,footer:!1,height:h,padding:!1,size:o,testId:e,title:"",width:c,hideXOnMobile:!0,children:r.jsxs("div",{className:"flex h-full grow",children:[r.jsx("div",{className:`relative hidden grow flex-col [@media(min-width:801px)]:!visible [@media(min-width:801px)]:!flex ${A==="grey"?"bg-grey-50":"bg-white dark:bg-black"}`,children:m}),y&&r.jsxs("div",{className:"relative flex size-full flex-col border-l border-grey-100 dark:border-grey-900 [@media(min-width:801px)]:w-auto [@media(min-width:801px)]:basis-[400px]",children:[K||r.jsxs("div",{className:"flex max-h-[82px] items-center justify-between gap-3 px-7 py-6",children:[r.jsx(bt,{level:a,children:s}),O||r.jsx(Gr,{buttons:L})]}),r.jsx("div",{className:`${K?"":"absolute inset-x-0 bottom-0 top-[80px] grow"} ${X&&"p-7 pt-0"} flex flex-col justify-between overflow-y-auto ${Y&&Y}`,children:y})]})]})})},M3=({offset:e,onTrigger:s})=>{const a=D.useRef(null);return D.useEffect(()=>{const o=new IntersectionObserver(c=>{c[0].intersectionRatio<=0||s()});return a.current&&o.observe(a.current),()=>o.disconnect()},[s]),r.jsx("div",{ref:a,className:"absolute w-full",style:{bottom:e}})},$0=({trigger:e,triggerButtonProps:s,items:a,position:o="start",open:c,setOpen:h})=>(e||(e=r.jsx(Ue,{icon:"ellipsis",label:"Menu",hideLabel:!0,...s})),r.jsx(rd,{open:c,position:o,setOpen:h,trigger:e,closeOnItemClick:!0,children:r.jsx("div",{className:"flex min-w-[160px] flex-col justify-stretch py-1",role:"none",children:a.map(y=>r.jsx("button",{className:`mx-1 block cursor-pointer rounded-[2.5px] px-4 py-1.5 text-left text-sm hover:bg-grey-100 dark:hover:bg-grey-925 ${y.destructive&&" text-red-500"}`,type:"button",onClick:m=>{y.onClick&&y.onClick(m)},children:y.label},y.id))})}));var P0=typeof global=="object"&&global&&global.Object===Object&&global,j3=typeof self=="object"&&self&&self.Object===Object&&self,pn=P0||j3||Function("return this")(),Gs=pn.Symbol,L0=Object.prototype,E3=L0.hasOwnProperty,T3=L0.toString,qa=Gs?Gs.toStringTag:void 0;function N3(e){var s=E3.call(e,qa),a=e[qa];try{e[qa]=void 0;var o=!0}catch{}var c=T3.call(e);return o&&(s?e[qa]=a:delete e[qa]),c}var S3=Object.prototype,A3=S3.toString;function C3(e){return A3.call(e)}var I3="[object Null]",D3="[object Undefined]",Th=Gs?Gs.toStringTag:void 0;function oo(e){return e==null?e===void 0?D3:I3:Th&&Th in Object(e)?N3(e):C3(e)}function ro(e){return e!=null&&typeof e=="object"}var Ki=Array.isArray;function F0(e){var s=typeof e;return e!=null&&(s=="object"||s=="function")}var R3="[object AsyncFunction]",O3="[object Function]",$3="[object GeneratorFunction]",P3="[object Proxy]";function U0(e){if(!F0(e))return!1;var s=oo(e);return s==O3||s==$3||s==R3||s==P3}var ou=pn["__core-js_shared__"],Nh=(function(){var e=/[^.]+$/.exec(ou&&ou.keys&&ou.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function L3(e){return!!Nh&&Nh in e}var F3=Function.prototype,U3=F3.toString;function os(e){if(e!=null){try{return U3.call(e)}catch{}try{return e+""}catch{}}return""}var z3=/[\\^$.*+?()[\]{}|]/g,H3=/^\[object .+?Constructor\]$/,B3=Function.prototype,W3=Object.prototype,q3=B3.toString,Y3=W3.hasOwnProperty,G3=RegExp("^"+q3.call(Y3).replace(z3,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function X3(e){if(!F0(e)||L3(e))return!1;var s=U0(e)?G3:H3;return s.test(os(e))}function K3(e,s){return e?.[s]}function Js(e,s){var a=K3(e,s);return X3(a)?a:void 0}var Uf=Js(pn,"WeakMap"),V3=9007199254740991,Z3=/^(?:0|[1-9]\d*)$/;function Q3(e,s){var a=typeof e;return s=s??V3,!!s&&(a=="number"||a!="symbol"&&Z3.test(e))&&e>-1&&e%1==0&&e<s}function z0(e,s){return e===s||e!==e&&s!==s}var J3=9007199254740991;function H0(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=J3}function ek(e){return e!=null&&H0(e.length)&&!U0(e)}var tk=Object.prototype;function rk(e){var s=e&&e.constructor,a=typeof s=="function"&&s.prototype||tk;return e===a}function nk(e,s){for(var a=-1,o=Array(e);++a<e;)o[a]=s(a);return o}var sk="[object Arguments]";function Sh(e){return ro(e)&&oo(e)==sk}var B0=Object.prototype,ak=B0.hasOwnProperty,ok=B0.propertyIsEnumerable,ik=Sh((function(){return arguments})())?Sh:function(e){return ro(e)&&ak.call(e,"callee")&&!ok.call(e,"callee")};function lk(){return!1}var W0=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ah=W0&&typeof module=="object"&&module&&!module.nodeType&&module,ck=Ah&&Ah.exports===W0,Ch=ck?pn.Buffer:void 0,uk=Ch?Ch.isBuffer:void 0,zf=uk||lk,fk="[object Arguments]",dk="[object Array]",pk="[object Boolean]",hk="[object Date]",mk="[object Error]",gk="[object Function]",xk="[object Map]",bk="[object Number]",vk="[object Object]",wk="[object RegExp]",yk="[object Set]",_k="[object String]",kk="[object WeakMap]",Mk="[object ArrayBuffer]",jk="[object DataView]",Ek="[object Float32Array]",Tk="[object Float64Array]",Nk="[object Int8Array]",Sk="[object Int16Array]",Ak="[object Int32Array]",Ck="[object Uint8Array]",Ik="[object Uint8ClampedArray]",Dk="[object Uint16Array]",Rk="[object Uint32Array]",yt={};yt[Ek]=yt[Tk]=yt[Nk]=yt[Sk]=yt[Ak]=yt[Ck]=yt[Ik]=yt[Dk]=yt[Rk]=!0;yt[fk]=yt[dk]=yt[Mk]=yt[pk]=yt[jk]=yt[hk]=yt[mk]=yt[gk]=yt[xk]=yt[bk]=yt[vk]=yt[wk]=yt[yk]=yt[_k]=yt[kk]=!1;function Ok(e){return ro(e)&&H0(e.length)&&!!yt[oo(e)]}function $k(e){return function(s){return e(s)}}var q0=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Qa=q0&&typeof module=="object"&&module&&!module.nodeType&&module,Pk=Qa&&Qa.exports===q0,iu=Pk&&P0.process,Ih=(function(){try{var e=Qa&&Qa.require&&Qa.require("util").types;return e||iu&&iu.binding&&iu.binding("util")}catch{}})(),Dh=Ih&&Ih.isTypedArray,Y0=Dh?$k(Dh):Ok,Lk=Object.prototype,Fk=Lk.hasOwnProperty;function Uk(e,s){var a=Ki(e),o=!a&&ik(e),c=!a&&!o&&zf(e),h=!a&&!o&&!c&&Y0(e),y=a||o||c||h,m=y?nk(e.length,String):[],l=m.length;for(var f in e)Fk.call(e,f)&&!(y&&(f=="length"||c&&(f=="offset"||f=="parent")||h&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||Q3(f,l)))&&m.push(f);return m}function zk(e,s){return function(a){return e(s(a))}}var Hk=zk(Object.keys,Object),Bk=Object.prototype,Wk=Bk.hasOwnProperty;function qk(e){if(!rk(e))return Hk(e);var s=[];for(var a in Object(e))Wk.call(e,a)&&a!="constructor"&&s.push(a);return s}function Yk(e){return ek(e)?Uk(e):qk(e)}var no=Js(Object,"create");function Gk(){this.__data__=no?no(null):{},this.size=0}function Xk(e){var s=this.has(e)&&delete this.__data__[e];return this.size-=s?1:0,s}var Kk="__lodash_hash_undefined__",Vk=Object.prototype,Zk=Vk.hasOwnProperty;function Qk(e){var s=this.__data__;if(no){var a=s[e];return a===Kk?void 0:a}return Zk.call(s,e)?s[e]:void 0}var Jk=Object.prototype,e8=Jk.hasOwnProperty;function t8(e){var s=this.__data__;return no?s[e]!==void 0:e8.call(s,e)}var r8="__lodash_hash_undefined__";function n8(e,s){var a=this.__data__;return this.size+=this.has(e)?0:1,a[e]=no&&s===void 0?r8:s,this}function rs(e){var s=-1,a=e==null?0:e.length;for(this.clear();++s<a;){var o=e[s];this.set(o[0],o[1])}}rs.prototype.clear=Gk;rs.prototype.delete=Xk;rs.prototype.get=Qk;rs.prototype.has=t8;rs.prototype.set=n8;function s8(){this.__data__=[],this.size=0}function il(e,s){for(var a=e.length;a--;)if(z0(e[a][0],s))return a;return-1}var a8=Array.prototype,o8=a8.splice;function i8(e){var s=this.__data__,a=il(s,e);if(a<0)return!1;var o=s.length-1;return a==o?s.pop():o8.call(s,a,1),--this.size,!0}function l8(e){var s=this.__data__,a=il(s,e);return a<0?void 0:s[a][1]}function c8(e){return il(this.__data__,e)>-1}function u8(e,s){var a=this.__data__,o=il(a,e);return o<0?(++this.size,a.push([e,s])):a[o][1]=s,this}function hn(e){var s=-1,a=e==null?0:e.length;for(this.clear();++s<a;){var o=e[s];this.set(o[0],o[1])}}hn.prototype.clear=s8;hn.prototype.delete=i8;hn.prototype.get=l8;hn.prototype.has=c8;hn.prototype.set=u8;var so=Js(pn,"Map");function f8(){this.size=0,this.__data__={hash:new rs,map:new(so||hn),string:new rs}}function d8(e){var s=typeof e;return s=="string"||s=="number"||s=="symbol"||s=="boolean"?e!=="__proto__":e===null}function ll(e,s){var a=e.__data__;return d8(s)?a[typeof s=="string"?"string":"hash"]:a.map}function p8(e){var s=ll(this,e).delete(e);return this.size-=s?1:0,s}function h8(e){return ll(this,e).get(e)}function m8(e){return ll(this,e).has(e)}function g8(e,s){var a=ll(this,e),o=a.size;return a.set(e,s),this.size+=a.size==o?0:1,this}function is(e){var s=-1,a=e==null?0:e.length;for(this.clear();++s<a;){var o=e[s];this.set(o[0],o[1])}}is.prototype.clear=f8;is.prototype.delete=p8;is.prototype.get=h8;is.prototype.has=m8;is.prototype.set=g8;function x8(e,s){for(var a=-1,o=s.length,c=e.length;++a<o;)e[c+a]=s[a];return e}function b8(){this.__data__=new hn,this.size=0}function v8(e){var s=this.__data__,a=s.delete(e);return this.size=s.size,a}function w8(e){return this.__data__.get(e)}function y8(e){return this.__data__.has(e)}var _8=200;function k8(e,s){var a=this.__data__;if(a instanceof hn){var o=a.__data__;if(!so||o.length<_8-1)return o.push([e,s]),this.size=++a.size,this;a=this.__data__=new is(o)}return a.set(e,s),this.size=a.size,this}function Rn(e){var s=this.__data__=new hn(e);this.size=s.size}Rn.prototype.clear=b8;Rn.prototype.delete=v8;Rn.prototype.get=w8;Rn.prototype.has=y8;Rn.prototype.set=k8;function M8(e,s){for(var a=-1,o=e==null?0:e.length,c=0,h=[];++a<o;){var y=e[a];s(y,a,e)&&(h[c++]=y)}return h}function j8(){return[]}var E8=Object.prototype,T8=E8.propertyIsEnumerable,Rh=Object.getOwnPropertySymbols,N8=Rh?function(e){return e==null?[]:(e=Object(e),M8(Rh(e),function(s){return T8.call(e,s)}))}:j8;function S8(e,s,a){var o=s(e);return Ki(e)?o:x8(o,a(e))}function Oh(e){return S8(e,Yk,N8)}var Hf=Js(pn,"DataView"),Bf=Js(pn,"Promise"),Wf=Js(pn,"Set"),$h="[object Map]",A8="[object Object]",Ph="[object Promise]",Lh="[object Set]",Fh="[object WeakMap]",Uh="[object DataView]",C8=os(Hf),I8=os(so),D8=os(Bf),R8=os(Wf),O8=os(Uf),Dn=oo;(Hf&&Dn(new Hf(new ArrayBuffer(1)))!=Uh||so&&Dn(new so)!=$h||Bf&&Dn(Bf.resolve())!=Ph||Wf&&Dn(new Wf)!=Lh||Uf&&Dn(new Uf)!=Fh)&&(Dn=function(e){var s=oo(e),a=s==A8?e.constructor:void 0,o=a?os(a):"";if(o)switch(o){case C8:return Uh;case I8:return $h;case D8:return Ph;case R8:return Lh;case O8:return Fh}return s});var zh=pn.Uint8Array,$8="__lodash_hash_undefined__";function P8(e){return this.__data__.set(e,$8),this}function L8(e){return this.__data__.has(e)}function Vi(e){var s=-1,a=e==null?0:e.length;for(this.__data__=new is;++s<a;)this.add(e[s])}Vi.prototype.add=Vi.prototype.push=P8;Vi.prototype.has=L8;function F8(e,s){for(var a=-1,o=e==null?0:e.length;++a<o;)if(s(e[a],a,e))return!0;return!1}function U8(e,s){return e.has(s)}var z8=1,H8=2;function G0(e,s,a,o,c,h){var y=a&z8,m=e.length,l=s.length;if(m!=l&&!(y&&l>m))return!1;var f=h.get(e),u=h.get(s);if(f&&u)return f==s&&u==e;var d=-1,g=!0,v=a&H8?new Vi:void 0;for(h.set(e,s),h.set(s,e);++d<m;){var _=e[d],k=s[d];if(o)var M=y?o(k,_,d,s,e,h):o(_,k,d,e,s,h);if(M!==void 0){if(M)continue;g=!1;break}if(v){if(!F8(s,function(T,A){if(!U8(v,A)&&(_===T||c(_,T,a,o,h)))return v.push(A)})){g=!1;break}}else if(!(_===k||c(_,k,a,o,h))){g=!1;break}}return h.delete(e),h.delete(s),g}function B8(e){var s=-1,a=Array(e.size);return e.forEach(function(o,c){a[++s]=[c,o]}),a}function W8(e){var s=-1,a=Array(e.size);return e.forEach(function(o){a[++s]=o}),a}var q8=1,Y8=2,G8="[object Boolean]",X8="[object Date]",K8="[object Error]",V8="[object Map]",Z8="[object Number]",Q8="[object RegExp]",J8="[object Set]",eM="[object String]",tM="[object Symbol]",rM="[object ArrayBuffer]",nM="[object DataView]",Hh=Gs?Gs.prototype:void 0,lu=Hh?Hh.valueOf:void 0;function sM(e,s,a,o,c,h,y){switch(a){case nM:if(e.byteLength!=s.byteLength||e.byteOffset!=s.byteOffset)return!1;e=e.buffer,s=s.buffer;case rM:return!(e.byteLength!=s.byteLength||!h(new zh(e),new zh(s)));case G8:case X8:case Z8:return z0(+e,+s);case K8:return e.name==s.name&&e.message==s.message;case Q8:case eM:return e==s+"";case V8:var m=B8;case J8:var l=o&q8;if(m||(m=W8),e.size!=s.size&&!l)return!1;var f=y.get(e);if(f)return f==s;o|=Y8,y.set(e,s);var u=G0(m(e),m(s),o,c,h,y);return y.delete(e),u;case tM:if(lu)return lu.call(e)==lu.call(s)}return!1}var aM=1,oM=Object.prototype,iM=oM.hasOwnProperty;function lM(e,s,a,o,c,h){var y=a&aM,m=Oh(e),l=m.length,f=Oh(s),u=f.length;if(l!=u&&!y)return!1;for(var d=l;d--;){var g=m[d];if(!(y?g in s:iM.call(s,g)))return!1}var v=h.get(e),_=h.get(s);if(v&&_)return v==s&&_==e;var k=!0;h.set(e,s),h.set(s,e);for(var M=y;++d<l;){g=m[d];var T=e[g],A=s[g];if(o)var I=y?o(A,T,g,s,e,h):o(T,A,g,e,s,h);if(!(I===void 0?T===A||c(T,A,a,o,h):I)){k=!1;break}M||(M=g=="constructor")}if(k&&!M){var R=e.constructor,$=s.constructor;R!=$&&"constructor"in e&&"constructor"in s&&!(typeof R=="function"&&R instanceof R&&typeof $=="function"&&$ instanceof $)&&(k=!1)}return h.delete(e),h.delete(s),k}var cM=1,Bh="[object Arguments]",Wh="[object Array]",Oi="[object Object]",uM=Object.prototype,qh=uM.hasOwnProperty;function fM(e,s,a,o,c,h){var y=Ki(e),m=Ki(s),l=y?Wh:Dn(e),f=m?Wh:Dn(s);l=l==Bh?Oi:l,f=f==Bh?Oi:f;var u=l==Oi,d=f==Oi,g=l==f;if(g&&zf(e)){if(!zf(s))return!1;y=!0,u=!1}if(g&&!u)return h||(h=new Rn),y||Y0(e)?G0(e,s,a,o,c,h):sM(e,s,l,a,o,c,h);if(!(a&cM)){var v=u&&qh.call(e,"__wrapped__"),_=d&&qh.call(s,"__wrapped__");if(v||_){var k=v?e.value():e,M=_?s.value():s;return h||(h=new Rn),c(k,M,a,o,h)}}return g?(h||(h=new Rn),lM(e,s,a,o,c,h)):!1}function X0(e,s,a,o,c){return e===s?!0:e==null||s==null||!ro(e)&&!ro(s)?e!==e&&s!==s:fM(e,s,a,o,X0,c)}function dM(e,s){return X0(e,s)}const Yh=({className:e,children:s,colSpan:a,sticky:o=!1,...c})=>{const h=ye("!py-2 !pl-0 !pr-6 text-left align-top",o&&"sticky top-0 bg-white",c.onClick&&"hover:cursor-pointer",e);return r.jsx("th",{className:h,colSpan:a,...c,children:r.jsx(bt,{className:"whitespace-nowrap",level:6,children:s})})},K0=({left:e,center:s,right:a,sticky:o=!0,containerClassName:c,children:h})=>{const y=ye("z-50 h-22 min-h-[92px] p-8",!h&&"flex items-center justify-between gap-3",o&&"sticky top-0",c);if(!h){if(e){const m=ye("flex flex-auto items-center",a&&s&&"basis-1/3",!a&&s&&"basis-1/2");e=r.jsx("div",{className:m,children:e})}if(s){const m=ye("flex flex-auto items-center justify-center",e&&a&&"basis-1/3",(e&&!a||!e&&a)&&"basis-1/2");s=r.jsx("div",{className:m,children:s})}if(a){const m=ye("flex flex-auto items-center justify-end",e&&s&&"basis-1/3",!e&&s&&"basis-1/2");a=r.jsx("div",{className:m,children:a})}}return r.jsx("div",{className:y,children:h||r.jsxs(r.Fragment,{children:[e,s,a]})})},V0=({items:e,setItems:s,blank:a,canAddNewItem:o})=>{const[c,h]=D.useState(e.map((g,v)=>({item:g,id:v.toString()}))),[y,m]=D.useState(a);return D.useEffect(()=>{const g=c.map(({item:v})=>v);o(y)&&g.push(y),dM(JSON.parse(JSON.stringify(g)),JSON.parse(JSON.stringify(e)))||s(g)},[c,y,e,s,o]),{items:c,updateItem:(g,v)=>{const _=c.map(k=>k.id===g?{...k,item:v}:k);h(_),s(_.map(k=>k.item))},addItem:()=>{if(o(y)){const g=c.reduce((_,k)=>Math.max(_,parseInt(k.id)),0),v=c.concat({item:y,id:(g+1).toString()});h(v),s(v.map(_=>_.item)),m(a)}},removeItem:g=>{const v=c.filter(_=>_.id!==g);h(v),s(v.map(_=>_.item))},moveItem:(g,v)=>{if(g!==v){const _=c.findIndex(T=>T.id===g),k=v?c.findIndex(T=>T.id===v):0,M=G_(c,_,k);h(M),s(M.map(T=>T.item))}},newItem:y,setNewItem:m}},pM=({label:e,text:s="",hint:a,onRegenerate:o})=>{const[c,h]=D.useState(!1),y=()=>{navigator.clipboard.writeText(s),h(!0),setTimeout(()=>h(!1),2e3)},m=ye("group/api-keys relative -mt-1 mb-1 w-full overflow-hidden border-b border-transparent py-2 hover:border-grey-300 dark:hover:border-grey-600");return r.jsxs("div",{className:"mb-3 grid grid-cols-1",children:[e&&r.jsx(bt,{level:6,grey:!0,children:e}),r.jsxs("div",{className:m,children:[r.jsx("span",{children:s}),a,r.jsxs("div",{className:"visible absolute right-0 top-1/2 flex translate-y-[-50%] gap-1 bg-white pl-1 text-sm group-hover/api-keys:visible md:invisible dark:bg-black",children:[o&&r.jsx(Ue,{color:"outline",label:"Regenerate",size:"sm",onClick:o}),r.jsx(Ue,{color:"outline",label:c?"Copied":"Copy",size:"sm",onClick:y})]})]})]})},cl=({keys:e})=>r.jsx("div",{"data-testid":"api-keys",children:e.map(s=>r.jsx(pM,{...s},s.label))}),ea=({icon:e,title:s,detail:a,extra:o})=>r.jsxs("div",{className:"-mx-8 -mt-8 flex flex-col gap-4 bg-grey-75 p-8 md:flex-row dark:bg-grey-950",children:[r.jsx("div",{className:"size-14",children:e}),r.jsxs("div",{className:"mt-1.5 flex min-w-0 flex-1 flex-col",children:[r.jsx("h3",{children:s}),r.jsx("div",{children:a}),o&&r.jsx("div",{className:"mt-4",children:o})]})]}),xd=ns({method:"POST",path:({integrationId:e,apiKeyId:s})=>`/integrations/${e}/api_key/${s}/refresh/`,body:({integrationId:e})=>({integrations:[{id:e}]}),updateQueries:{emberUpdateType:"createOrUpdate",dataType:nl,update:(e,s)=>s&&{...s,integrations:s.integrations.map(a=>e.integrations.find(({id:c})=>c===a.id)||a)}}}),hM=_e.create(()=>{const e=_e.useModal(),{updateRoute:s}=Ve(),{zapierTemplates:a}=X_(),{data:{integrations:o}={integrations:[]}}=nd(),{config:c}=Qe(),{mutateAsync:h}=xd(),y=it(),[m,l]=D.useState(!1),f=c.hostSettings?.limits?.customIntegrations?.disabled,u=o.find(({slug:v})=>v==="zapier"),d=u?.api_keys?.find(v=>v.type==="admin");D.useEffect(()=>{f&&s("integrations")},[f,s]);const g=()=>{!u||!d||(l(!1),_e.show(Et,{title:"Regenerate Admin API Key",prompt:'You will need to locate the Ghost App within your Zapier account and click on "Reconnect" to enter the new Admin API Key.',okLabel:"Regenerate Admin API Key",onOk:async v=>{try{await h({integrationId:u.id,apiKeyId:d.id}),l(!0),v?.remove()}catch(_){y(_)}}}))};return r.jsxs(vt,{afterClose:()=>{s("integrations")},cancelLabel:"",footer:r.jsxs("div",{className:"mx-8 flex w-full items-center justify-between",children:[r.jsxs("a",{className:"mt-1 self-baseline text-sm font-bold",href:"https://zapier.com/apps/ghost/integrations?utm_medium=partner_api&utm_source=widget&utm_campaign=Widget",rel:"noopener noreferrer",target:"_blank",children:["View more Ghost integrations powered by ",r.jsx("span",{children:r.jsx(nt,{className:"relative top-[-2px] inline-block",name:"zapier-logo",size:24})})]}),r.jsx(Ue,{color:"black",label:"Close",onClick:()=>{e.remove()}})]}),okColor:"black",okLabel:"Close",testId:"zapier-modal",title:"",stickyFooter:!0,onOk:()=>{s("integrations"),e.remove()},children:[r.jsx(ea,{detail:"Automation for your favorite apps",extra:r.jsx("div",{className:"-mb-4 mt-1",children:r.jsx(cl,{keys:[{label:"Admin API key",text:d?.secret,hint:m?r.jsx("div",{className:"text-green",children:"Admin API Key was successfully regenerated"}):void 0,onRegenerate:g},{label:"API URL",text:window.location.origin+ao().subdir}]})}),icon:r.jsx(nt,{name:"zapier",size:56}),title:"Zapier"}),r.jsx(cn,{children:a.map(v=>r.jsx($n,{action:r.jsx(Ue,{className:"whitespace-nowrap text-sm font-semibold text-[#FF4A00]",href:v.url,label:"Use this Zap",tag:"a",target:"_blank",link:!0,unstyled:!0}),bgOnHover:!1,className:"flex items-center gap-3 py-2 pl-3",title:r.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center",children:[r.jsxs("div",{className:"flex shrink-0 flex-nowrap items-center gap-2",children:[r.jsx("img",{className:"size-8 object-contain dark:invert",role:"presentation",src:v.ghostImage}),r.jsx(nt,{name:"arrow-right",size:"xs"}),r.jsx("img",{className:"size-8 object-contain",role:"presentation",src:v.appImage})]}),r.jsx("span",{className:"text-sm",children:v.title})]}),hideActions:!0}))})]})});function Z0(e){const s="The URL must be in a format like https://www.threads.net/@yourUsername";if(!e)return"";if(e.startsWith("http")){if(!e.includes("threads.net")&&!e.includes("threads.com"))throw new Error(s);if(e=e.replace("threads.com","threads.net"),e.includes("www.")||(e=e.replace("https://","https://www.")),!St.isURL(e))throw new Error(s);if(!e.match(/^https:\/\/www\.threads\.net\/@?[a-zA-Z0-9._]+$/))throw new Error(s);return e}if(!e.includes("/")){if(e.startsWith("@")&&(e=e.slice(1)),!e.match(/^[a-zA-Z0-9._]+$/))throw new Error(s);return`https://www.threads.net/@${e}`}throw new Error(s)}const mM=e=>`https://www.threads.net/${e}`,gM=e=>{const s=e.match(/(?:https:\/\/)(?:www\.)?(?:threads\.(?:com|net))(?:\/)?(?:#!\/)?@?([^/]*)/)?.[1];return s?`@${s}`:null},Ws={INVALID_USERNAME:"Your Username is not a valid Bluesky Username",INVALID_URL:"The URL must be in a format like https://bsky.app/profile/yourUsername"};function Q0(e){return[/^did:plc:[a-z2-7]{24}$/,/^[a-zA-Z0-9._]{1,15}$/,/^(?=.{1,191}$)[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+$/].some(a=>a.test(e))}function qf(e){let s=e.trim();return s.startsWith("@")&&(s=s.slice(1)),s.startsWith("did:plc:")?s.toLowerCase():s}function J0(e){if(!e)return"";let s;if(e.startsWith("http")||e.startsWith("www.")||e.includes("bsky.app")){if(!e.includes("bsky.app"))throw new Error(Ws.INVALID_URL);const o=e.match(/bsky\.app\/profile\/@?([^/]+)/);if(!o)throw new Error(Ws.INVALID_URL);s=qf(o[1])}else s=qf(e);if(!Q0(s))throw new Error(Ws.INVALID_USERNAME);const a=`https://bsky.app/profile/${s}`;if(!St.isURL(a))throw new Error(Ws.INVALID_URL);return a}const xM=e=>{if(!e)throw new Error(Ws.INVALID_USERNAME);let s=qf(e);if(!Q0(s))throw new Error(Ws.INVALID_USERNAME);return`https://bsky.app/profile/${s}`},bM=e=>{const s=e.match(/(?:https?:\/\/)?(?:www\.)?bsky\.app\/profile\/@?([^/]*)/);return s?`${s[1]}`:null},es={INVALID_URL:"The URL must be in a format like https://www.linkedin.com/in/yourUsername",INVALID_USERNAME:"Your Username is not a valid LinkedIn Username"},vM=["in","pub","company","school"],wM=/^[a-zA-Z0-9-]{3,100}$/,yM=/^[a-zA-Z0-9-]{3,100}(?:\/[a-zA-Z0-9-]*)*$/,ex=/^(?:https?:\/\/)?(?:www\.)?(?:([a-z]{2})\.)?linkedin\.com\/(in|pub|company|school)\/([^?#]+)/i,Yf=e=>e.trim().replace(/^@/,""),tx=e=>{if(/^(https?:\/\/|www\.)/.test(e)||e.includes("linkedin.com")){const o=e.match(ex);if(!o)throw new Error(es.INVALID_URL);if(o[0].length!==e.length)throw new Error(es.INVALID_USERNAME);const[,c,h,y]=o,m=Yf(y);if(c&&!/^[A-Z]{2}$/.test(c.toUpperCase()))throw new Error(es.INVALID_URL);return{regional:c,pathType:h,username:m}}const s=Yf(e),a=s.indexOf("/");if(a!==-1){const o=s.substring(0,a);if(vM.includes(o))return{pathType:o,username:s.substring(a+1)}}return{username:s}},rx=(e,s)=>(e==="pub"?yM:wM).test(s),nx=({regional:e,pathType:s,username:a})=>{const c=`https://${e?`${e.toLowerCase()}.`:"www."}linkedin.com/${s}/${a}`;if(!St.isURL(c))throw new Error(es.INVALID_URL);return c};function sx(e){if(!e)return"";const{regional:s,pathType:a="in",username:o}=tx(e);if(!rx(a,o))throw new Error(es.INVALID_USERNAME);return nx({regional:s,pathType:a,username:o})}const _M=e=>{if(!e)throw new Error(es.INVALID_USERNAME);const{regional:s,pathType:a="in",username:o}=tx(e);if(!rx(a,o))throw new Error(es.INVALID_USERNAME);return nx({regional:s,pathType:a,username:o})},kM=e=>{const s=e.match(ex);if(!s)return null;const[,,a,o]=s,c=Yf(o);return a==="in"?c:`${a}/${c}`};function ax(e){const s="The URL must be in a format like https://www.instagram.com/yourUsername",a="Your Username is not a valid Instagram Username";if(!e)return"";let o;if(e.startsWith("http")||e.startsWith("www.")||e.includes("instagram.com")){if(!e.includes("instagram.com"))throw new Error(s);const h=e.match(/(?:https?:\/\/)?(?:www\.)?instagram\.com\/@?([^/]+)/);if(!h)throw new Error(s);o=h[1]}else o=e.startsWith("@")?e.slice(1):e;if(!o.match(/^[a-zA-Z0-9_][a-zA-Z0-9._]{0,28}[a-zA-Z0-9_]$/)||o.includes("..")||o.length>30)throw new Error(a);const c=`https://www.instagram.com/${o}`;if(!St.isURL(c))throw new Error(s);return c}const MM=e=>{const s="Your Username is not a valid Instagram Username";if(!e)throw new Error(s);let a=e;if(a.startsWith("@")&&(a=a.slice(1)),!a.match(/^[a-zA-Z0-9_][a-zA-Z0-9._]{0,28}[a-zA-Z0-9_]$/)||a.includes("..")||a.length>30)throw new Error(s);return`https://www.instagram.com/${a}`},jM=e=>{const s=e.match(/(?:https?:\/\/)?(?:www\.)?instagram\.com\/@?([^/]*)/);return s?`${s[1]}`:null};function ox(e){const s="The URL must be in a format like https://www.youtube.com/@yourUsername, https://www.youtube.com/user/yourUsername, or https://www.youtube.com/channel/yourChannelId",a="Your Username is not a valid YouTube Username";if(!e)return"";let o;if(e.startsWith("http")||e.startsWith("www.")||e.includes("youtube.com")){if(!e.includes("youtube.com"))throw new Error(s);const h=e.match(/(?:https?:\/\/)?(?:www\.)?youtube\.com\/((?:@|user\/|channel\/)[^/]+)/);if(!h)throw new Error(s);o=h[1]}else o=e;if(o.startsWith("@")){const h=o.slice(1);if(!h.match(/^[a-zA-Z0-9][a-zA-Z0-9._-]{1,28}[a-zA-Z0-9]$/)||h.includes("..")||h.length>30)throw new Error(a)}else if(o.startsWith("user/")){if(!o.slice(5).match(/^[a-zA-Z0-9._-]{1,50}$/))throw new Error(a)}else if(o.startsWith("channel/")){if(!o.slice(8).match(/^UC[a-zA-Z0-9_-]{22}$/))throw new Error(a)}else throw new Error(s);const c=`https://www.youtube.com/${o}`;if(!St.isURL(c))throw new Error(s);return c}const EM=e=>{const s="Your Username is not a valid YouTube Username";if(!e)throw new Error(s);if(e.startsWith("@")){const a=e.slice(1);if(!a.match(/^[a-zA-Z0-9][a-zA-Z0-9._-]{1,28}[a-zA-Z0-9]$/)||a.includes("..")||a.length>30)throw new Error(s)}else if(e.startsWith("user/")){if(!e.slice(5).match(/^[a-zA-Z0-9._-]{1,50}$/))throw new Error(s)}else if(e.startsWith("channel/")){if(!e.slice(8).match(/^UC[a-zA-Z0-9_-]{22}$/))throw new Error(s)}else throw new Error("The handle must be in a format like @yourUsername, user/yourUsername, or channel/yourChannelId");return`https://www.youtube.com/${e}`},TM=e=>{const s=e.match(/(?:https?:\/\/)?(?:www\.)?youtube\.com\/((?:@|user\/|channel\/)[^/]*)/);return s?s[1]:null};function ix(e){const s="The URL must be in a format like https://www.tiktok.com/@yourUsername",a="Your Username is not a valid TikTok Username";if(!e)return"";let o;if(e.startsWith("http")||e.startsWith("www.")||e.includes("tiktok.com")){if(!e.includes("tiktok.com"))throw new Error(s);const y=e.match(/(?:https?:\/\/)?(?:www\.)?tiktok\.com\/(@[^/]+)/);if(!y)throw new Error(s);o=y[1]}else o=e.startsWith("@")?e:`@${e}`;const c=o.slice(1);if(!c.match(/^[a-zA-Z0-9_][a-zA-Z0-9._]{0,22}[a-zA-Z0-9_]$/)||c.includes("..")||c.length<2||c.length>24)throw new Error(a);const h=`https://www.tiktok.com/${o}`;if(!St.isURL(h))throw new Error(s);return h}const NM=e=>{const s="Your Username is not a valid TikTok Username";if(!e)throw new Error(s);const a=e.startsWith("@")?e:`@${e}`,o=a.slice(1);if(!o.match(/^[a-zA-Z0-9_][a-zA-Z0-9._]{0,22}[a-zA-Z0-9_]$/)||o.includes("..")||o.length<2||o.length>24)throw new Error(s);return`https://www.tiktok.com/${a}`},SM=e=>{const s=e.match(/(?:https?:\/\/)?(?:www\.)?tiktok\.com\/(@[^/]*)/);return s?s[1]:null};function lx(e){const s="The URL must be in a format like @username@instance.tld or https://instance.tld/@username or https://website.com/@username@instance.tld";if(!e)return"";let a=e;if(a=a.replace(/^https?:\/\//,""),a.match(/^@[^@]+@[^/]+$/)){const[o,c]=a.split("@").slice(1);if(!St.isFQDN(c))throw new Error(s);return`https://${c}/@${o}`}if(a.match(/^[^/]+\.[^/]+\/@[^/]+(@[^/]+)?$/)){const[o,c]=a.split("/@");if(!St.isFQDN(o))throw new Error(s);if(c.includes("@")){const[,h]=c.split("@");if(!St.isFQDN(h))throw new Error(s)}return`https://${a}`}throw new Error(s)}const AM=e=>{const s="Your Username is not a valid Mastodon Username";if(!e)throw new Error(s);if(e.match(/^@[^@]+@[^/]+$/)){const[a,o]=e.split("@").slice(1);if(!St.isFQDN(o))throw new Error(s);return`https://${o}/@${a}`}if(e.match(/^[^/]+\.[^/]+\/@[^/]+(@[^/]+)?$/)){const[a,o]=e.split("/@");if(!St.isFQDN(a))throw new Error(s);if(o.includes("@")){const[,c]=o.split("@");if(!St.isFQDN(c))throw new Error(s)}return`https://${e}`}throw new Error(s)},CM=e=>e.replace(/^https?:\/\//,""),IM=({tier:e})=>{const s=e?.type==="free",{updateRoute:a}=Ve(),{mutateAsync:o}=fd(),{mutateAsync:c}=L2(),{mutateAsync:h}=On(),[y,m]=ot.useState(!!e?.trial_days),l=it(),{localSettings:f,siteData:u}=ss(),[d]=mt(f,["portal_plans"]),g=JSON.parse(d?.toString()||"[]"),v={name:()=>_.name?void 0:"Enter a name for the tier",monthly_price:()=>_.type!=="free"?hh(_.monthly_price||0,_.currency,{allowZero:!1}):void 0,yearly_price:()=>_.type!=="free"?hh(_.yearly_price||0,_.currency,{allowZero:!1}):void 0},{formState:_,saveState:k,updateForm:M,handleSave:T,errors:A,clearError:I,okProps:R}=pr({initialState:{...e||{},trial_days:e?.trial_days?.toString()||"",currency:e?.currency||K_[0].isoCode,visibility:e?.visibility||"none",welcome_page_url:e?.welcome_page_url||null},savingDelay:500,savedDelay:500,onValidate:()=>{const Y={};return Object.entries(v).forEach(([P,q])=>{Y[P]=q?.()}),Y},onSave:async()=>{const{trial_days:Y,currency:P,...q}=_,ee=q;if(ee.benefits=ee.benefits?.filter(ae=>ae),s||(ee.currency=P,ee.trial_days=parseInt(Y)),e?.id?await o({...e,...ee}):await c(ee),s){const ae=_.visibility==="public";let ne=!1;g.includes("free")&&!ae&&(g.splice(g.indexOf("free"),1),ne=!0),!g.includes("free")&&ae&&(g.push("free"),ne=!0),ne&&await h([{key:"portal_plans",value:JSON.stringify(g)}])}},onSaveError:l}),$=V0({items:_.benefits||[],setItems:Y=>M(P=>({...P,benefits:Y})),blank:"",canAddNewItem:Y=>!!Y}),W=Y=>{Y.target.checked?(m(!0),M(P=>({...P,trial_days:e?.trial_days?e?.trial_days.toString():"7"}))):(m(!1),M(P=>({...P,trial_days:"0"})))},O=D.useRef(!1);D.useEffect(()=>{O.current&&(v.monthly_price?.(),v.yearly_price?.()),O.current=!0},[_.currency]);const K=()=>{if(e){const Y=e.active?"Archive tier":"Reactivate tier",P=e.active?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"mb-6",children:["Members will no longer be able to subscribe to ",r.jsx("strong",{children:e.name})," and it will be removed from the list of available tiers in portal."]}),r.jsx("div",{children:"Existing members on this tier will remain unchanged. Offers using this tier will be disabled."})]}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"mb-6",children:["Reactivating ",r.jsx("strong",{children:e.name})," will re-enable it as an option in portal and allow new members to subscribe to this tier."]}),r.jsx("div",{children:"Existing members will remain unchanged."})]}),q=e.active?"Archive":"Reactivate";_e.show(Et,{title:Y,prompt:P,okLabel:q,cancelLabel:"Cancel",okColor:e.active?"red":"black",onOk:ee=>{o({...e,active:!e.active}),ee?.remove(),gt({type:"success",title:`Tier ${e.active?"archived":"reactivated"}`})}})}};let X={};return e&&(e.active&&e.type!=="free"?X={label:"Archive tier",color:"red",link:!0,onClick:K}:e.active||(X={label:"Reactivate tier",color:"green",link:!0,onClick:K})),r.jsx(vt,{afterClose:()=>{a("tiers")},buttonsDisabled:R.disabled,cancelLabel:"Close",dirty:k==="unsaved",leftButtonProps:X,okColor:R.color,okLabel:R.label||"Save",size:"lg",testId:"tier-detail-modal",title:e?e.active?"Edit tier":"Edit archived tier":"New tier",stickyFooter:!0,onOk:async()=>{await T({fakeWhenUnchanged:!0})},children:r.jsxs("div",{className:"-mb-8 mt-8 flex items-start gap-8",children:[r.jsxs("div",{className:"flex grow flex-col gap-8",children:[r.jsxs(et,{marginBottom:!1,title:"Basic",grouped:!0,children:[r.jsx(je,{autoComplete:"off",error:!!A.name,hint:A.name,maxLength:191,placeholder:s?"Free":"Bronze",title:"Name",value:_.name||"",autoFocus:!0,onChange:Y=>M(P=>({...P,name:Y.target.value})),onKeyDown:()=>I("name")}),r.jsx(je,{autoComplete:"off",autoFocus:s,maxLength:191,placeholder:s?"Free preview":"Full access to premium content",title:"Description",value:_.description||"",onChange:Y=>M(P=>({...P,description:Y.target.value}))}),!s&&r.jsx(r.Fragment,{children:r.jsxs("div",{className:"flex flex-col gap-10 md:flex-row",children:[r.jsxs("div",{className:"basis-1/2",children:[r.jsxs("div",{className:"mb-1 flex h-6 items-center justify-between",children:[r.jsx(bt,{level:6,children:"Prices"}),r.jsx("div",{className:"-mr-2 w-[50px]",children:r.jsx(Ot,{border:!1,containerClassName:"font-medium",controlClasses:{menu:"w-18"},options:mh(),selectedOption:mh().flatMap(Y=>Y.options).find(Y=>Y.value===_.currency),size:"xs",clearBg:!0,isSearchable:!0,onSelect:Y=>M(P=>({...P,currency:Y?.value}))})})]}),r.jsxs("div",{className:"flex flex-col gap-2",children:[r.jsx(gh,{error:!!A.monthly_price,hint:A.monthly_price,placeholder:"5",rightPlaceholder:`${_.currency}/month`,title:"Monthly price",valueInCents:_.monthly_price||"",hideTitle:!0,onBlur:Y=>Y.target.value===""?M(P=>({...P,monthly_price:0})):null,onChange:Y=>M(P=>({...P,monthly_price:Y})),onKeyDown:()=>I("monthly_price")}),r.jsx(gh,{error:!!A.yearly_price,hint:A.yearly_price,placeholder:"50",rightPlaceholder:`${_.currency}/year`,title:"Yearly price",valueInCents:_.yearly_price||"",hideTitle:!0,onBlur:Y=>Y.target.value===""?M(P=>({...P,yearly_price:0})):null,onChange:Y=>M(P=>({...P,yearly_price:Y})),onKeyDown:()=>I("yearly_price")})]})]}),r.jsxs("div",{className:"basis-1/2",children:[r.jsx("div",{className:"mb-1 flex h-6 flex-col justify-center",children:r.jsx(rt,{checked:y,label:"Add a free trial",labelStyle:"heading",onChange:W})}),r.jsx(je,{disabled:!y,hint:r.jsxs("div",{className:"mt-1",children:["Members will be subscribed at full price once the trial ends. ",r.jsx("a",{className:"text-green",href:"https://ghost.org/help/free-trials/",rel:"noreferrer",target:"_blank",children:"Learn more"})]}),placeholder:"0",rightPlaceholder:"days",title:"Trial days",value:_.trial_days,hideTitle:!0,onChange:Y=>M(P=>({...P,trial_days:Y.target.value.replace(/[^\d]/,"")}))})]})]})}),r.jsx(Qg,{baseUrl:u?.url,hint:`Redirect to this URL after signup ${s?"":" for premium membership"}`,maxLength:2e3,placeholder:u?.url,title:"Welcome page",value:_.welcome_page_url||null,nullable:!0,transformPathWithoutSlash:!0,onChange:Y=>M(P=>({...P,welcome_page_url:Y||null}))})]}),r.jsxs(et,{gap:"none",title:"Benefits",grouped:!0,children:[r.jsx("div",{className:"-mt-3",children:r.jsx(Jg,{items:$.items,itemSeparator:!1,renderItem:({id:Y,item:P})=>r.jsxs("div",{className:"relative flex w-full items-center gap-5",children:[r.jsx("div",{className:"absolute left-[-32px] top-[7px] flex size-6 items-center justify-center bg-white group-hover:hidden dark:bg-black",children:r.jsx(nt,{name:"check",size:"sm"})}),r.jsx(je,{maxLength:191,value:P,onChange:q=>$.updateItem(Y,q.target.value)}),r.jsx(Ue,{className:"absolute right-1 top-1 z-10 opacity-0 group-hover:opacity-100",color:"grey",icon:"trash",size:"sm",onClick:()=>$.removeItem(Y)})]}),onMove:$.moveItem})}),r.jsxs("div",{className:"relative mt-1 flex items-center gap-3",children:[r.jsx(nt,{className:"dark:text-white",name:"check",size:"sm"}),r.jsx(je,{className:"grow",containerClassName:"w-100",maxLength:191,placeholder:"Expert analysis",title:"New benefit",value:$.newItem,hideTitle:!0,onChange:Y=>$.setNewItem(Y.target.value),onKeyDown:Y=>{Y.key==="Enter"&&$.addItem()}}),r.jsx(Ue,{className:"absolute right-[5px] top-[5px] z-10",color:"green",icon:"add",iconColorClass:"text-white",label:"Add",size:"sm",hideLabel:!0,onClick:()=>$.addItem()})]})]})]}),r.jsx("div",{className:"sticky top-[96px] hidden shrink-0 basis-[380px] min-[920px]:!visible min-[920px]:!block",children:r.jsx(V_,{isFreeTier:s,tier:_})})]})})},DM=({params:e})=>{const{data:{tiers:s,isEnd:a}={},fetchNextPage:o}=Zs();let c;return D.useEffect(()=>{e?.id&&!c&&!a&&o()},[o,a,e?.id,c]),e?.id&&(c=s?.find(({id:h})=>h===e?.id),!c)?null:r.jsx(IM,{tier:c})},RM=_e.create(DM);var cu,Gh;function cx(){if(Gh)return cu;Gh=1;var e={};return cu=typeof process=="object"&&e&&e.NODE_DEBUG&&/\bsemver\b/i.test(e.NODE_DEBUG)?(...a)=>console.error("SEMVER",...a):()=>{},cu}var uu,Xh;function ux(){if(Xh)return uu;Xh=1;const e="2.0.0",s=256,a=Number.MAX_SAFE_INTEGER||9007199254740991,o=16,c=s-6;return uu={MAX_LENGTH:s,MAX_SAFE_COMPONENT_LENGTH:o,MAX_SAFE_BUILD_LENGTH:c,MAX_SAFE_INTEGER:a,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},uu}var $i={exports:{}},Kh;function OM(){return Kh||(Kh=1,(function(e,s){const{MAX_SAFE_COMPONENT_LENGTH:a,MAX_SAFE_BUILD_LENGTH:o,MAX_LENGTH:c}=ux(),h=cx();s=e.exports={};const y=s.re=[],m=s.safeRe=[],l=s.src=[],f=s.safeSrc=[],u=s.t={};let d=0;const g="[a-zA-Z0-9-]",v=[["\\s",1],["\\d",c],[g,o]],_=M=>{for(const[T,A]of v)M=M.split(`${T}*`).join(`${T}{0,${A}}`).split(`${T}+`).join(`${T}{1,${A}}`);return M},k=(M,T,A)=>{const I=_(T),R=d++;h(M,R,T),u[M]=R,l[R]=T,f[R]=I,y[R]=new RegExp(T,A?"g":void 0),m[R]=new RegExp(I,A?"g":void 0)};k("NUMERICIDENTIFIER","0|[1-9]\\d*"),k("NUMERICIDENTIFIERLOOSE","\\d+"),k("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${g}*`),k("MAINVERSION",`(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})`),k("MAINVERSIONLOOSE",`(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})`),k("PRERELEASEIDENTIFIER",`(?:${l[u.NONNUMERICIDENTIFIER]}|${l[u.NUMERICIDENTIFIER]})`),k("PRERELEASEIDENTIFIERLOOSE",`(?:${l[u.NONNUMERICIDENTIFIER]}|${l[u.NUMERICIDENTIFIERLOOSE]})`),k("PRERELEASE",`(?:-(${l[u.PRERELEASEIDENTIFIER]}(?:\\.${l[u.PRERELEASEIDENTIFIER]})*))`),k("PRERELEASELOOSE",`(?:-?(${l[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[u.PRERELEASEIDENTIFIERLOOSE]})*))`),k("BUILDIDENTIFIER",`${g}+`),k("BUILD",`(?:\\+(${l[u.BUILDIDENTIFIER]}(?:\\.${l[u.BUILDIDENTIFIER]})*))`),k("FULLPLAIN",`v?${l[u.MAINVERSION]}${l[u.PRERELEASE]}?${l[u.BUILD]}?`),k("FULL",`^${l[u.FULLPLAIN]}$`),k("LOOSEPLAIN",`[v=\\s]*${l[u.MAINVERSIONLOOSE]}${l[u.PRERELEASELOOSE]}?${l[u.BUILD]}?`),k("LOOSE",`^${l[u.LOOSEPLAIN]}$`),k("GTLT","((?:<|>)?=?)"),k("XRANGEIDENTIFIERLOOSE",`${l[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),k("XRANGEIDENTIFIER",`${l[u.NUMERICIDENTIFIER]}|x|X|\\*`),k("XRANGEPLAIN",`[v=\\s]*(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:${l[u.PRERELEASE]})?${l[u.BUILD]}?)?)?`),k("XRANGEPLAINLOOSE",`[v=\\s]*(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:${l[u.PRERELEASELOOSE]})?${l[u.BUILD]}?)?)?`),k("XRANGE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAIN]}$`),k("XRANGELOOSE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAINLOOSE]}$`),k("COERCEPLAIN",`(^|[^\\d])(\\d{1,${a}})(?:\\.(\\d{1,${a}}))?(?:\\.(\\d{1,${a}}))?`),k("COERCE",`${l[u.COERCEPLAIN]}(?:$|[^\\d])`),k("COERCEFULL",l[u.COERCEPLAIN]+`(?:${l[u.PRERELEASE]})?(?:${l[u.BUILD]})?(?:$|[^\\d])`),k("COERCERTL",l[u.COERCE],!0),k("COERCERTLFULL",l[u.COERCEFULL],!0),k("LONETILDE","(?:~>?)"),k("TILDETRIM",`(\\s*)${l[u.LONETILDE]}\\s+`,!0),s.tildeTrimReplace="$1~",k("TILDE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAIN]}$`),k("TILDELOOSE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAINLOOSE]}$`),k("LONECARET","(?:\\^)"),k("CARETTRIM",`(\\s*)${l[u.LONECARET]}\\s+`,!0),s.caretTrimReplace="$1^",k("CARET",`^${l[u.LONECARET]}${l[u.XRANGEPLAIN]}$`),k("CARETLOOSE",`^${l[u.LONECARET]}${l[u.XRANGEPLAINLOOSE]}$`),k("COMPARATORLOOSE",`^${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]})$|^$`),k("COMPARATOR",`^${l[u.GTLT]}\\s*(${l[u.FULLPLAIN]})$|^$`),k("COMPARATORTRIM",`(\\s*)${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]}|${l[u.XRANGEPLAIN]})`,!0),s.comparatorTrimReplace="$1$2$3",k("HYPHENRANGE",`^\\s*(${l[u.XRANGEPLAIN]})\\s+-\\s+(${l[u.XRANGEPLAIN]})\\s*$`),k("HYPHENRANGELOOSE",`^\\s*(${l[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[u.XRANGEPLAINLOOSE]})\\s*$`),k("STAR","(<|>)?=?\\s*\\*"),k("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),k("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})($i,$i.exports)),$i.exports}var fu,Vh;function $M(){if(Vh)return fu;Vh=1;const e=Object.freeze({loose:!0}),s=Object.freeze({});return fu=o=>o?typeof o!="object"?e:o:s,fu}var du,Zh;function PM(){if(Zh)return du;Zh=1;const e=/^[0-9]+$/,s=(o,c)=>{if(typeof o=="number"&&typeof c=="number")return o===c?0:o<c?-1:1;const h=e.test(o),y=e.test(c);return h&&y&&(o=+o,c=+c),o===c?0:h&&!y?-1:y&&!h?1:o<c?-1:1};return du={compareIdentifiers:s,rcompareIdentifiers:(o,c)=>s(c,o)},du}var pu,Qh;function LM(){if(Qh)return pu;Qh=1;const e=cx(),{MAX_LENGTH:s,MAX_SAFE_INTEGER:a}=ux(),{safeRe:o,t:c}=OM(),h=$M(),{compareIdentifiers:y}=PM();class m{constructor(f,u){if(u=h(u),f instanceof m){if(f.loose===!!u.loose&&f.includePrerelease===!!u.includePrerelease)return f;f=f.version}else if(typeof f!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof f}".`);if(f.length>s)throw new TypeError(`version is longer than ${s} characters`);e("SemVer",f,u),this.options=u,this.loose=!!u.loose,this.includePrerelease=!!u.includePrerelease;const d=f.trim().match(u.loose?o[c.LOOSE]:o[c.FULL]);if(!d)throw new TypeError(`Invalid Version: ${f}`);if(this.raw=f,this.major=+d[1],this.minor=+d[2],this.patch=+d[3],this.major>a||this.major<0)throw new TypeError("Invalid major version");if(this.minor>a||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>a||this.patch<0)throw new TypeError("Invalid patch version");d[4]?this.prerelease=d[4].split(".").map(g=>{if(/^[0-9]+$/.test(g)){const v=+g;if(v>=0&&v<a)return v}return g}):this.prerelease=[],this.build=d[5]?d[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(f){if(e("SemVer.compare",this.version,this.options,f),!(f instanceof m)){if(typeof f=="string"&&f===this.version)return 0;f=new m(f,this.options)}return f.version===this.version?0:this.compareMain(f)||this.comparePre(f)}compareMain(f){return f instanceof m||(f=new m(f,this.options)),this.major<f.major?-1:this.major>f.major?1:this.minor<f.minor?-1:this.minor>f.minor?1:this.patch<f.patch?-1:this.patch>f.patch?1:0}comparePre(f){if(f instanceof m||(f=new m(f,this.options)),this.prerelease.length&&!f.prerelease.length)return-1;if(!this.prerelease.length&&f.prerelease.length)return 1;if(!this.prerelease.length&&!f.prerelease.length)return 0;let u=0;do{const d=this.prerelease[u],g=f.prerelease[u];if(e("prerelease compare",u,d,g),d===void 0&&g===void 0)return 0;if(g===void 0)return 1;if(d===void 0)return-1;if(d===g)continue;return y(d,g)}while(++u)}compareBuild(f){f instanceof m||(f=new m(f,this.options));let u=0;do{const d=this.build[u],g=f.build[u];if(e("build compare",u,d,g),d===void 0&&g===void 0)return 0;if(g===void 0)return 1;if(d===void 0)return-1;if(d===g)continue;return y(d,g)}while(++u)}inc(f,u,d){if(f.startsWith("pre")){if(!u&&d===!1)throw new Error("invalid increment argument: identifier is empty");if(u){const g=`-${u}`.match(this.options.loose?o[c.PRERELEASELOOSE]:o[c.PRERELEASE]);if(!g||g[1]!==u)throw new Error(`invalid identifier: ${u}`)}}switch(f){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",u,d);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",u,d);break;case"prepatch":this.prerelease.length=0,this.inc("patch",u,d),this.inc("pre",u,d);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",u,d),this.inc("pre",u,d);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const g=Number(d)?1:0;if(this.prerelease.length===0)this.prerelease=[g];else{let v=this.prerelease.length;for(;--v>=0;)typeof this.prerelease[v]=="number"&&(this.prerelease[v]++,v=-2);if(v===-1){if(u===this.prerelease.join(".")&&d===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(g)}}if(u){let v=[u,g];d===!1&&(v=[u]),y(this.prerelease[0],u)===0?isNaN(this.prerelease[1])&&(this.prerelease=v):this.prerelease=v}break}default:throw new Error(`invalid increment argument: ${f}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return pu=m,pu}var hu,Jh;function FM(){if(Jh)return hu;Jh=1;const e=LM();return hu=(a,o,c=!1)=>{if(a instanceof e)return a;try{return new e(a,o)}catch(h){if(!c)return null;throw h}},hu}var UM=FM();const zM=Kg(UM);function em(e){if(!e)return"";const s=e.replace("+moya","");try{const o=zM(s,{includePrerelease:!0})?.prerelease;if(o&&o?.length>0){const h=String(o[0]).split("-")[1];return!h||!h.startsWith("g")?"":`https://github.com/TryGhost/Ghost/commit/${h.slice(1)}`}return`https://github.com/TryGhost/Ghost/releases/tag/v${s}`}catch{return""}}function HM(e,s){const a=!!e.match?.(/production/i);return!!(a&&s!=="mysql8"||!a&&s==="mysql5")}const BM=_e.create(({})=>{const{updateRoute:e}=Ve();let a=Qe().config;const o=Z_();function c(){return new Date().getFullYear()}function h(){return!!a.enableDeveloperExperiments}function y(){return!a.hostSettings?.siteId}return r.jsx(vt,{afterClose:()=>{e("")},cancelLabel:"",footer:r.jsx(r.Fragment,{}),topRightContent:"close",width:540,children:r.jsxs("div",{className:"flex flex-col gap-4 pb-7 text-sm",children:[r.jsx(Q_,{className:"h-auto w-[120px] dark:invert"}),r.jsxs("div",{className:"mt-3 flex flex-col gap-1.5",children:[o?.message&&r.jsxs("div",{className:"gh-prose-links mb-4 rounded-sm border border-green p-5",children:[r.jsx("strong",{children:"Update available!"}),r.jsx("div",{dangerouslySetInnerHTML:{__html:o.message}})]}),em(a.version)&&r.jsxs("div",{children:[r.jsx("strong",{children:"Version:"})," ",r.jsx("a",{className:"text-green",href:em(a.version),rel:"noopener noreferrer",target:"_blank",children:a.version})]})||r.jsxs("div",{children:[r.jsx("strong",{children:"Version:"})," ",a.version]}),y()&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{children:[r.jsx("strong",{children:"Environment:"})," ",a.environment]}),r.jsxs("div",{children:[r.jsx("strong",{children:"Database:"})," ",a.database]}),r.jsxs("div",{children:[r.jsx("strong",{children:"Mail:"})," ",a.mail?a.mail:"Native"]})]}),h()&&r.jsxs("div",{children:[r.jsx("strong",{children:"Developer experiments:"})," Enabled"]}),y()&&HM(a.environment,a.database)&&r.jsxs("div",{className:"text-red-500 dark:text-red-400",children:["You are running an unsupported database in production. Please ",r.jsx("a",{href:"https://ghost.org/docs/faq/supported-databases/",rel:"noopener noreferrer",target:"_blank",children:"upgrade to MySQL 8"}),"."]})]}),r.jsx(Ys,{}),r.jsxs("div",{className:"flex flex-col gap-1.5",children:[r.jsxs("a",{className:"flex items-center gap-2 hover:text-grey-900 dark:hover:text-grey-400",href:"https://ghost.org/docs/",rel:"noopener noreferrer",target:"_blank",children:[r.jsx(nt,{name:"book-open",size:"sm"})," User documentation"]}),r.jsxs("a",{className:"flex items-center gap-2 hover:text-grey-900 dark:hover:text-grey-400",href:"https://forum.ghost.org/",rel:"noopener noreferrer",target:"_blank",children:[r.jsx(nt,{name:"question-circle",size:"sm"})," Get help with Ghost"]}),r.jsxs("a",{className:"flex items-center gap-2 hover:text-grey-900 dark:hover:text-grey-400",href:"https://ghost.org/docs/contributing/",rel:"noopener noreferrer",target:"_blank",children:[r.jsx(nt,{name:"angle-brackets",size:"sm"})," Get involved"]})]}),r.jsx(Ys,{}),r.jsxs("p",{className:"max-w-[460px] text-xs",children:["Copyright © 2013 – ",c()," Ghost Foundation, released under the ",r.jsx("a",{className:"text-green",href:"https://github.com/TryGhost/Ghost/blob/main/LICENSE",rel:"noopener noreferrer",target:"_blank",children:"MIT license"}),". ",r.jsx("a",{className:"text-green",href:"https://ghost.org/",rel:"noopener noreferrer",target:"_blank",children:"Ghost"})," is a registered trademark of ",r.jsx("a",{className:"text-green",href:"https://ghost.org/trademark/",rel:"noopener noreferrer",target:"_blank",children:"Ghost Foundation Ltd"}),"."]})]})})}),WM=()=>{const e=Xt(),{updateRoute:s}=Ve(),[a,o]=D.useState(""),[c,h]=D.useState({name:""}),{mutateAsync:y}=J_(),m=Xs(),l=it();return D.useEffect(()=>{m?.isLimited("customIntegrations")&&m.errorIfWouldGoOverLimit("customIntegrations").catch(f=>{f instanceof Ks&&(_e.show(Vr,{prompt:f.message||"Your current plan doesn't support more custom integrations.",onOk:()=>s({route:"/pro",isExternal:!0})}),e.remove(),s("integrations"))})},[m,e,s]),r.jsx(vt,{afterClose:()=>{s("integrations")},okColor:"black",okLabel:"Add",size:"sm",testId:"add-integration-modal",title:"Add integration",onOk:async()=>{if(!a){h({name:"Name is required"});return}try{const f=await y({name:a});e.remove(),s({route:`integrations/${f.integrations[0].id}`})}catch(f){l(f)}},children:r.jsx("div",{className:"mt-5",children:r.jsx(et,{marginBottom:!1,marginTop:!1,children:r.jsx(je,{autoFocus:!0,error:!!c.name,hint:c.name,maxLength:191,placeholder:"Custom integration",title:"Name",value:a,onChange:f=>o(f.target.value),onInput:()=>{c.name&&h({name:""})}})})})})},qM=_e.create(WM),YM=()=>{const e=Xt(),{updateRoute:s}=Ve(),a=it(),[o,c]=D.useState(!0),[h,y]=D.useState(null),{data:m}=Vg({searchParams:{filter:"newsletters.status:active+email_disabled:0",limit:"1",page:"1",include:"newsletters,labels"}}),{mutateAsync:l}=O2(),{formState:f,updateForm:u,saveState:d,handleSave:g,errors:v,clearError:_}=pr({initialState:{name:"",description:"",optInExistingSubscribers:!0},onSave:async()=>{const T=await l({name:f.name,description:f.description,opt_in_existing:f.optInExistingSubscribers,feedback_enabled:!0});s({route:`newsletters/${T.newsletters[0].id}`})},onSaveError:a,onValidate:()=>{const T={};return f.name||(T.name="A name is required for your newsletter"),T}}),k=Xs();D.useEffect(()=>{if(!k){c(!1);return}k.errorIfWouldGoOverLimit("newsletters").catch(T=>{if(T instanceof Ks)y(T);else throw T}).finally(()=>{c(!1)})},[k]);const M=m?.meta?.pagination.total;return D.useEffect(()=>{h&&(_e.show(Vr,{prompt:h.message||"Your current plan doesn't support more newsletters.",onOk:()=>s({route:"/pro",isExternal:!0})}),e.remove(),s("newsletters"))},[h,e,s]),o||h?null:r.jsx(vt,{afterClose:()=>{s("newsletters")},backDropClick:!1,okColor:"black",okDisabled:d==="saving",okLabel:"Create",okLoading:d==="saving",size:"sm",testId:"add-newsletter-modal",title:"Create newsletter",onOk:async()=>{await g()&&e.remove()},children:r.jsxs(et,{marginBottom:!1,marginTop:!0,children:[r.jsx(je,{autoFocus:!0,error:!!v.name,hint:v.name,maxLength:191,placeholder:"Weekly roundup",title:"Name",value:f.name,onChange:T=>u(A=>({...A,name:T.target.value})),onKeyDown:()=>_("name")}),r.jsx(dn,{maxLength:2e3,title:"Description",value:f.description,onChange:T=>u(A=>({...A,description:T.target.value}))}),r.jsx(rt,{checked:f.optInExistingSubscribers,direction:"rtl",hint:f.optInExistingSubscribers?`This newsletter will be available to all members. Your ${M===void 0?"":Va(M)} existing subscriber${m?.meta?.pagination.total===1?"":"s"} will also be opted-in to receive it.`:"The newsletter will be available to all new members. Existing members won’t be subscribed, but may visit their account area to opt-in to future emails.",label:"Opt-in existing subscribers",labelStyle:"heading",onChange:T=>u(A=>({...A,optInExistingSubscribers:T.target.checked}))})]})})},GM=_e.create(YM),XM=({recommendation:e,animate:s})=>{const a=Xt(),{updateRoute:o,route:c}=Ve(),{mutateAsync:h}=e2(),y=it(),{formState:m,updateForm:l,handleSave:f,saveState:u,errors:d,clearError:g,setErrors:v}=pr({initialState:{...e},onSave:async T=>{await h(T),a.remove(),gt({title:"Recommendation added",type:"success"}),r2("Recommendation Added",{oneClickSubscribe:T.one_click_subscribe}),o("recommendations")},onSaveError:y,onValidate:T=>t2(T)});let _="Add",k=!1;u==="saving"?k=!0:u==="saved"&&(_="Added");let M={label:"Back",icon:"arrow-left",iconColorClass:"text-black dark:text-white",link:!0,size:"sm",onClick:()=>{u!=="saving"&&(a.remove(),_e.show(fx,{pathName:c,animate:!1,recommendation:{...m}}))}};return r.jsx(vt,{afterClose:()=>{o("recommendations")},animate:s??!0,backDropClick:!1,cancelLabel:"Cancel",dirty:!0,leftButtonProps:M,okColor:"black",okLabel:_,okLoading:k,size:"sm",testId:"add-recommendation-modal",title:"Add recommendation",stickyFooter:!0,onCancel:()=>{u!=="saving"&&(a.remove(),o("recommendations"))},onOk:async()=>{if(u!=="saving"){Zg();try{await f({force:!0})}catch{gt({type:"error",title:"Something went wrong when adding this recommendation, please try again."})}}},children:r.jsx(n2,{clearError:g,errors:d,formState:m,setErrors:v,showURL:!1,updateForm:l})})},KM=_e.create(XM),tm=e=>qi(e).save||"",VM=function(e,s){try{new URL(s).hostname.includes(".")?delete e.url:e.url="Enter a valid URL"}catch{e.url="Enter a valid URL"}return e},ZM=({searchParams:e,recommendation:s,animate:a})=>{const[o,c]=D.useState(!1),h=Xt(),{updateRoute:y}=Ve(),{mutateAsync:m}=s2(),l=s?"":e?.get("url")??"",{save:f}=l?qi(l):{save:""},u=ot.useRef(!1),[d,g]=ot.useState(!!f),{formState:v,updateForm:_,handleSave:k,errors:M,saveState:T,clearError:A}=pr({initialState:s??{title:"",url:f||"",description:"",excerpt:null,featured_image:null,favicon:null,one_click_subscribe:!1},onSave:async()=>{let R;R=new URL(v.url);const $=R.hostname.replace("www.",""),W={...v,url:R.toString()},{recommendations:O=[]}=await m(R);if(!O||O.length===0)return;const K=O[0];if(K.id)throw new uh("A recommendation with this URL already exists.");W.title=K.title??$,W.excerpt=K.excerpt??W.excerpt,W.featured_image=K.featured_image??W.featured_image??null,W.favicon=K.favicon??W.favicon??null,W.one_click_subscribe=K.one_click_subscribe??W.one_click_subscribe??!1,W.description=W.excerpt||null,h.remove(),_e.show(KM,{animate:!1,recommendation:W})},onValidate:()=>{const R={};return VM(R,v.url),d&&g(Object.keys(R).length===0),R}}),I=ot.useCallback(async()=>{if(T!=="saving"){Zg();try{if(await k({force:!0}))return}catch(R){const $=R instanceof uh?R.message:"Something went wrong while checking this URL, please try again.";gt({type:"error",title:$})}d&&g(!1)}},[k,T,d,g]);return ot.useEffect(()=>{d&&!u.current&&(u.current=!0,I())},[d,I]),D.useEffect(()=>{o&&(I(),c(!1))},[v]),d?r.jsx(vt,{afterClose:()=>{y("recommendations")},animate:a??!0,backDropClick:!1,footer:!1,header:!1,size:"sm",children:r.jsx("div",{className:"flex flex-col items-center justify-center p-8",children:r.jsx(Yi,{})})}):r.jsxs(vt,{afterClose:()=>{y("recommendations")},animate:a??!0,backDropClick:!1,okColor:"black",okLabel:"Next",okLoading:T==="saving",size:"sm",testId:"add-recommendation-modal",title:"Add recommendation",onOk:I,children:[r.jsxs("p",{className:"mt-4",children:["You can recommend ",r.jsx("strong",{children:"any site"})," your audience will find valuable, not just those published on Ghost."]}),r.jsx(et,{marginBottom:!1,marginTop:!0,children:r.jsx(je,{autoFocus:!0,error:!!M.url,hint:M.url||r.jsxs(r.Fragment,{children:["Need inspiration? ",r.jsx("a",{className:"text-green",href:"https://www.ghost.org/explore",rel:"noopener noreferrer",target:"_blank",children:"Explore thousands of sites"})," to recommend"]}),maxLength:2e3,placeholder:"https://www.example.com",title:"URL",value:v.url,onBlur:()=>{const R=tm(v.url);_($=>({...$,url:R}))},onChange:R=>{A?.("url"),_($=>({...$,url:R.target.value}))},onKeyDown:R=>{R.key==="Enter"&&(R.preventDefault(),_($=>({...$,url:tm(v.url)})),c(!0))}})})]})},fx=_e.create(ZM);function QM(e,s){let a;return function(...c){const h=()=>{clearTimeout(a),e(...c)};clearTimeout(a),a=setTimeout(h,s)}}const bd=({generateContent:e,className:s,height:a,width:o,parentClassName:c,testId:h,addDelay:y=!1})=>{const[m,l]=D.useState(0),f=[D.useRef(null),D.useRef(null)],[u,d]=D.useState(0);return D.useEffect(()=>{const g=m===0?1:0,v=f[g].current;if(v){e(v);const _=()=>{y?setTimeout(()=>{l(g)},500):l(g)};return v.addEventListener("load",_),()=>{v.removeEventListener("load",_)}}},[e]),D.useEffect(()=>{const g=f[m].current,v=QM(()=>{d(g?.contentWindow?.scrollY||0)},250);return g?.contentWindow?.addEventListener("scroll",v),()=>{g?.contentWindow?.removeEventListener("scroll",v)}},[m,f]),D.useEffect(()=>{const g=f[m].current;if(g)try{g.contentWindow?.scrollTo(0,u)}catch(v){j_(v)}},[u,m,f]),r.jsxs("div",{className:c,"data-testid":h,children:[r.jsx("iframe",{ref:f[0],className:`${s} ${m!==0?"z-10 opacity-0":"z-20 opacity-100"}`,"data-visible":m===0,frameBorder:"0",height:a,title:"Buffered Preview 1",width:o}),r.jsx("iframe",{ref:f[1],className:`${s} ${m!==1?"z-10 opacity-0":"z-20 opacity-100"}`,"data-visible":m===1,frameBorder:"0",height:a,title:"Buffered Preview 2",width:o})]})},JM=(e,s,a)=>{const o=new URLSearchParams;return o.append("announcement_bg",e||"accent"),o.append("announcement",s||""),a&&a.length>0&&o.append("announcement_vis",a?.join(",")||""),o.toString()},ej=({announcementBackgroundColor:e,announcementContent:s,url:a,visibility:o})=>{const c=D.useMemo(()=>o,[o?.join(",")]),h=D.useCallback(y=>{a&&fetch(a,{method:"POST",headers:{"Content-Type":"text/html;charset=utf-8","x-ghost-preview":JM(e,s,c),Accept:"text/plain"},mode:"cors",credentials:"include"}).then(m=>m.text()).then(m=>{const l="html { pointer-events: none; }",u=new DOMParser().parseFromString(m,"text/html"),d=u.querySelector("style"),g=d.innerHTML;d.innerHTML=`${g}
2
2
 
3
3
  ${l}`;let _=(u.doctype?new XMLSerializer().serializeToString(u.doctype):"")+u.documentElement.outerHTML;y.contentDocument?.open(),y.contentDocument?.write(_),y.contentDocument?.close()}).catch(()=>{})},[e,s,a,c]);return r.jsx(bd,{addDelay:!0,className:"absolute size-[110%] origin-top-left scale-[.90909] bg-white max-[1600px]:size-[130%] max-[1600px]:scale-[.76923]",generateContent:h,height:"100%",parentClassName:"relative h-full w-full",testId:"announcement-bar-preview-iframe",width:"100%"})},tj=({announcementContent:e,announcementTextHandler:s,accentColor:a,announcementBackgroundColor:o,toggleColorSwatch:c,toggleVisibility:h,visibility:y=[],paidMembersEnabled:m,onBlur:l})=>{const f=[{label:"Public visitors",onChange:u=>{h("visitors",u)},value:"visitors",checked:y.includes("visitors")},{label:"Free members",onChange:u=>{h("free_members",u)},value:"free_members",checked:y.includes("free_members")},...m?[{label:"Paid members",onChange:u=>{h("paid_members",u)},value:"paid_members",checked:y.includes("paid_members")}]:[]];return r.jsxs(et,{children:[r.jsx(pd,{nodes:"MINIMAL_NODES",placeholder:"Highlight breaking news, offers or updates",title:"Announcement",value:e,onBlur:l,onChange:s}),r.jsx(w0,{isExpanded:!1,picker:!1,swatches:[{hex:"#08090c",title:"Dark",value:"dark"},{hex:"#ffffff",title:"Light",value:"light"},{hex:a||"#ffdd00",title:"Accent",value:"accent"}],swatchSize:"lg",title:"Background color",value:o,onSwatchChange:u=>{u!==null&&c(u)},onTogglePicker:()=>{}}),r.jsx($f,{checkboxes:f,title:"Visibility"})]})},rj=()=>{const{siteData:e}=Qe(),{localSettings:s,updateSetting:a,handleSave:o,okProps:c}=ss({savingDelay:500}),[h]=mt(s,["announcement_content"]),[y]=mt(s,["accent_color"]),[m]=mt(s,["announcement_background"]),[l]=mt(s,["announcement_visibility"]),[f]=mt(s,["paid_members_enabled"]),u=JSON.parse(l?.toString()||"[]"),{updateRoute:d}=Ve(),[g,v]=D.useState("homepage"),_=O=>{a("announcement_background",O)},k=(O,K)=>{const X=u.indexOf(O);X===-1&&K?u.push(O):u.splice(X,1),a("announcement_visibility",JSON.stringify(u))},M=D.useRef(rl(O=>{a("announcement_content",O)},500)),T=r.jsx(tj,{accentColor:y,announcementBackgroundColor:m,announcementContent:h,announcementTextHandler:O=>{M.current(O)},paidMembersEnabled:f,toggleColorSwatch:_,toggleVisibility:k,visibility:l,onBlur:()=>{}}),{data:{posts:[A]}={posts:[]}}=x0({searchParams:{filter:"status:published",order:"published_at DESC",limit:"1",fields:"id,url"}});let I=[];A&&(I=[{id:"homepage",title:"Homepage"},{id:"post",title:"Post"}]);const R=O=>{I.length&&v(O)};let $=Xr(e);switch(g){case"homepage":$=Xr(e);break;case"post":$=A.url;break}const W=r.jsx(ej,{announcementBackgroundColor:m,announcementContent:h,url:$,visibility:u});return r.jsx(as,{afterClose:()=>{d("announcement-bar")},buttonsDisabled:c.disabled,cancelLabel:"Close",deviceSelector:!0,dirty:!1,okColor:c.color,okLabel:c.label||"Save",preview:W,previewBgColor:"greygradient",previewToolbarTabs:I,selectedURL:g,sidebar:T,testId:"announcement-bar-modal",title:"Announcement",titleHeadingLevel:5,onOk:async()=>{await o({fakeWhenUnchanged:!0})||gt({type:"error",message:"An error occurred while saving your changes. Please try again."})},onSelectURL:R})},nj=_e.create(rj),Gf=[{label:"Global",options:[{value:"site.changed",label:"Site changed (rebuild)"}]},{label:"Posts",options:[{value:"post.added",label:"Post created"},{value:"post.deleted",label:"Post deleted"},{value:"post.edited",label:"Post updated"},{value:"post.published",label:"Post published"},{value:"post.published.edited",label:"Published post updated"},{value:"post.unpublished",label:"Post unpublished"},{value:"post.scheduled",label:"Post scheduled"},{value:"post.unscheduled",label:"Post unscheduled"},{value:"post.tag.attached",label:"Tag added to post"},{value:"post.tag.detached",label:"Tag removed from post"}]},{label:"Pages",options:[{value:"page.added",label:"Page created"},{value:"page.deleted",label:"Page deleted"},{value:"page.edited",label:"Page updated"},{value:"page.published",label:"Page published"},{value:"page.published.edited",label:"Published page updated"},{value:"page.unpublished",label:"Page unpublished"},{value:"page.tag.attached",label:"Tag added to page"},{value:"page.tag.detached",label:"Tag removed from page"}]},{label:"Tags",options:[{value:"tag.added",label:"Tag created"},{value:"tag.edited",label:"Tag updated"},{value:"tag.deleted",label:"Tag deleted"}]},{label:"Members",options:[{value:"member.added",label:"Member added"},{value:"member.edited",label:"Member updated"},{value:"member.deleted",label:"Member deleted"}]}],sj=e=>Gf.flatMap(({options:a})=>a).find(a=>a.value===e)?.label,aj=ns({method:"POST",path:()=>"/webhooks/",body:e=>({webhooks:[e]}),updateQueries:{dataType:nl,emberUpdateType:"createOrUpdate",update:(e,s)=>s&&{...s,integrations:s.integrations.map(a=>{const o=e.webhooks[0];return o.integration_id===a.id?{...a,webhooks:[...a.webhooks||[],o]}:a})}}}),oj=ns({method:"PUT",path:e=>`/webhooks/${e.id}/`,body:e=>({webhooks:[e]}),updateQueries:{dataType:nl,emberUpdateType:"createOrUpdate",update:(e,s)=>s&&{...s,integrations:s.integrations.map(a=>{var o;return{...a,webhooks:(o=a.webhooks)==null?void 0:o.map(c=>c.id===e.webhooks[0].id?e.webhooks[0]:c)}})}}}),ij=ns({method:"DELETE",path:e=>`/webhooks/${e}/`,updateQueries:{dataType:nl,emberUpdateType:"createOrUpdate",update:(e,s,a)=>({...s,integrations:s.integrations.map(o=>{var c;return{...o,webhooks:(c=o.webhooks)==null?void 0:c.filter(h=>h.id!==a)}})})}}),lj=({webhook:e,integrationId:s})=>{const a=Xt(),{mutateAsync:o}=aj(),{mutateAsync:c}=oj(),h=it(),{formState:y,updateForm:m,handleSave:l,errors:f,clearError:u}=pr({initialState:e||{},onSave:async()=>{y.id?await c(y):await o({...y,integration_id:s})},onSaveError:h,onValidate:()=>{const d={};return y.name||(d.name="Enter a name"),y.event||(d.event="Select an event"),y.target_url||(d.target_url="Enter a target URL"),y.target_url&&!St.isURL(y.target_url,{require_tld:!1})&&(d.target_url="Enter a valid URL"),d}});return r.jsx(vt,{okColor:"black",okLabel:e?"Update":"Add",size:"sm",testId:"webhook-modal",title:"Add webhook",formSheet:!0,onOk:async()=>{await l()&&a.remove()},children:r.jsx("div",{className:"mt-5",children:r.jsxs(et,{marginBottom:!1,marginTop:!1,children:[r.jsx(je,{error:!!f.name,hint:f.name,maxLength:191,placeholder:"Custom webhook",title:"Name",value:y.name,onChange:d=>m(g=>({...g,name:d.target.value})),onKeyDown:()=>u("name")}),r.jsx(Ot,{error:!!f.event,hint:f.event,options:Gf,prompt:"Select an event",selectedOption:Gf.flatMap(d=>d.options).find(d=>d.value===y.event),testId:"event-select",title:"Event",hideTitle:!0,onSelect:d=>{m(g=>({...g,event:d?.value})),u("event")}}),r.jsx(je,{error:!!f.target_url,hint:f.target_url,maxLength:2e3,placeholder:"https://example.com",title:"Target URL",type:"url",value:y.target_url,onChange:d=>m(g=>({...g,target_url:d.target.value})),onKeyDown:()=>u("target_url")}),r.jsx(je,{maxLength:191,placeholder:"https://example.com",title:"Secret",value:y.secret||void 0,onChange:d=>m(g=>({...g,secret:d.target.value}))})]})})})},rm=_e.create(lj),cj=({integration:e})=>{const{mutateAsync:s}=ij(),a=it(),o=c=>{_e.show(Et,{title:"Are you sure?",prompt:"Deleting this webhook may prevent the integration from functioning.",okColor:"red",okLabel:"Delete Webhook",onOk:async h=>{try{await s(c),h?.remove(),gt({message:"Webhook deleted",type:"info"})}catch(y){a(y)}}})};return r.jsxs("div",{children:[r.jsxs(a2,{children:[r.jsxs(xh,{bgOnHover:!1,children:[r.jsxs(Yh,{children:[e.webhooks?.length||0," ",e.webhooks?.length===1?"webhook":"webhooks"]}),r.jsx(Yh,{children:"Last triggered"})]}),e.webhooks?.map(c=>r.jsxs(xh,{action:r.jsx(Ue,{color:"red",label:"Delete",link:!0,onClick:h=>{h?.stopPropagation(),o(c.id)}}),bgOnHover:!1,hideActions:!0,onClick:()=>{_e.show(rm,{webhook:c,integrationId:e.id})},children:[r.jsxs(bh,{className:"w-3/4",children:[r.jsx("div",{className:"text-sm font-semibold",children:c.name}),r.jsxs("div",{className:"grid grid-cols-[max-content_1fr] gap-x-1 text-xs leading-snug",children:[r.jsx("span",{className:"text-grey-600",children:"Event:"}),r.jsx("span",{children:sj(c.event)}),r.jsx("span",{className:"text-grey-600",children:"URL:"}),r.jsx("span",{className:"line-clamp-3 break-all",title:c.target_url,children:c.target_url})]})]}),r.jsx(bh,{className:"w-1/4 text-sm",children:c.last_triggered_at&&new Date(c.last_triggered_at).toLocaleString("default",{weekday:"short",month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})})]}))]}),r.jsx("div",{className:"mt-5",children:r.jsx(Ue,{color:"green",icon:"add",iconColorClass:"text-green",label:"Add webhook",size:"sm",link:!0,onClick:()=>{_e.show(rm,{integrationId:e.id})}})})]})},uj=({integration:e})=>{const s=Xt(),{updateRoute:a}=Ve(),{mutateAsync:o}=o2(),{mutateAsync:c}=xd(),{mutateAsync:h}=Vs(),y=it(),{formState:m,updateForm:l,handleSave:f,saveState:u,errors:d,clearError:g,okProps:v}=pr({initialState:e,savingDelay:500,savedDelay:500,onSave:async()=>{await o(m)},onSavedStateReset:()=>{a("integrations")},onSaveError:y,onValidate:()=>{const $={};return m.name||($.name="Enter integration title"),$}}),_=e.api_keys?.find($=>$.type==="admin"),k=e.api_keys?.find($=>$.type==="content"),[M,T]=D.useState(!1),[A,I]=D.useState(!1);D.useEffect(()=>{e.type!=="custom"&&(s.remove(),a("integrations"))},[e.type,s,a]);const R=($,W)=>{W(!1);const O=$.type==="content"?"Content":"Admin";_e.show(Et,{title:`Regenerate ${O} API Key`,prompt:`You can regenerate ${O} API Key any time, but any scripts or applications using it will need to be updated.`,okLabel:`Regenerate ${O} API Key`,onOk:async K=>{try{await c({integrationId:e.id,apiKeyId:$.id}),W(!0),K?.remove()}catch(X){y(X)}}})};return r.jsxs(vt,{afterClose:()=>{a("integrations")},buttonsDisabled:v.disabled,cancelLabel:"Close",dirty:u==="unsaved",okColor:v.color,okLabel:v.label||"Save",size:"md",testId:"custom-integration-modal",title:m.name||"Custom integration",stickyFooter:!0,onOk:async()=>{await f({fakeWhenUnchanged:!0})},children:[r.jsxs("div",{className:"mt-7 flex w-full flex-col gap-7 md:flex-row",children:[r.jsx("div",{children:r.jsx(un,{height:"100px",id:"custom-integration-icon",imageURL:m.icon_image||void 0,width:"100px",onDelete:()=>l($=>({...$,icon_image:null})),onUpload:async $=>{try{const W=ln(await h({file:$}));l(O=>({...O,icon_image:W}))}catch(W){const O=W;O.response.status===415&&(O.message="Unsupported file type"),y(O)}},children:"Upload icon"})}),r.jsx("div",{className:"flex grow flex-col",children:r.jsxs(et,{children:[r.jsx(je,{error:!!d.name,hint:d.name,maxLength:191,title:"Title",value:m.name,onChange:$=>l(W=>({...W,name:$.target.value})),onKeyDown:()=>g("name")}),r.jsx(je,{maxLength:2e3,title:"Description",value:m.description||"",onChange:$=>l(W=>({...W,description:$.target.value}))}),r.jsx(cl,{keys:[{label:"Content API key",text:k?.secret,hint:A?r.jsx("div",{className:"text-green",children:"Content API Key was successfully regenerated"}):void 0,onRegenerate:()=>k&&R(k,I)},{label:"Admin API key",text:_?.secret,hint:M?r.jsx("div",{className:"text-green",children:"Admin API Key was successfully regenerated"}):void 0,onRegenerate:()=>_&&R(_,T)},{label:"API URL",text:window.location.origin+ao().subdir}]})]})})]}),r.jsx("div",{children:r.jsx(cj,{integration:e})})]})},fj=({params:e})=>{const{data:{integrations:s}={}}=nd(),a=s?.find(({id:o})=>o===e?.id);return a?r.jsx(uj,{integration:a}):null},dj=_e.create(fj),pj=({problem:e})=>{const[s,a]=D.useState(!1),o=()=>{a(!s)};return r.jsx($n,{title:r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`${e.level==="error"?"before:bg-red":"before:bg-yellow"} relative px-4 text-sm before:absolute before:left-0 before:top-1.5 before:block before:size-2 before:rounded-full before:content-['']`,children:[e?.fatal?r.jsx("strong",{children:"Fatal: "}):r.jsx("strong",{children:e.level==="error"?"Error: ":"Warning: "}),r.jsx("span",{dangerouslySetInnerHTML:{__html:e.rule}}),r.jsx("div",{className:"absolute -right-4 top-1",children:r.jsx(Ue,{color:"green",icon:s?"chevron-down":"chevron-right",iconColorClass:"text-grey-700",size:"sm",link:!0,onClick:()=>o()})})]}),s?r.jsxs("div",{className:"mt-2 px-4 text-[13px] leading-8",children:[r.jsx("div",{dangerouslySetInnerHTML:{__html:e.details},className:"mb-4"}),r.jsx(bt,{level:6,children:"Affected files:"}),r.jsx("ul",{className:"mt-1",children:e.failures.map(c=>r.jsxs("li",{children:[r.jsx("code",{children:c.ref}),c.message?`: ${c.message}`:""]}))})]}):null]}),hideActions:!0,separator:!0})},hj=({title:e,prompt:s,fatalErrors:a,onRetry:o})=>{let c=null;return a&&(c=r.jsx("div",{className:"mt-10",children:r.jsx(cn,{title:"Errors",children:a.map(h=>typeof h.details=="object"&&h.details.errors&&h.details.errors.length>0?h.details.errors.map(y=>r.jsx(pj,{problem:y})):typeof h.details=="string"?r.jsx($n,{title:h.details}):null)})})),r.jsx(e0,{cancelLabel:"Close",okColor:"black",okLabel:"Retry",prompt:r.jsxs(r.Fragment,{children:[s,c]}),title:e,onOk:o})},dx=_e.create(hj),vd=()=>{const e=i2(),a=!e.data?.themes[0]?.warnings?.some(c=>c.code==="GS051-CUSTOM-FONTS"),o=D.useCallback(()=>{e.refetch()},[e]);return{supportsCustomFonts:a,refreshActiveThemeData:o}};function mj(e){let s=e.package?.name||e.name;return l2(e)?s+=" (default)":c2(e)?s+=" (legacy)":e.package?.name!==e.name&&(s=r.jsxs("span",{className:"text-sm md:text-base",children:[s," ",r.jsxs("span",{className:"text-grey-600",children:["(",e.name,")"]})]})),t0(e)&&(s=r.jsxs("span",{className:"text-sm font-bold md:text-base",children:[s," — ",r.jsx("span",{className:"text-green",children:" Active"})]})),s}function gj(e){return e.package?.version||"1.0"}const xj=({theme:e})=>{const{mutateAsync:s}=sd(),{mutateAsync:a}=u2(),{refreshActiveThemeData:o}=vd(),c=it(),h=async()=>{try{await s(e.name),o(),gt({title:"Theme activated",type:"success",message:r.jsxs("div",{children:[r.jsx("span",{className:"capitalize",children:e.name})," is now your active theme"]})})}catch(d){let g=null;d instanceof ts&&d.response?.status===422&&d.data?.errors?g=d.data.errors:c(d);let v="Invalid Theme",_=r.jsx(r.Fragment,{children:"This theme is invalid and cannot be activated. Fix the following errors and re-upload the theme"});g&&_e.show(dx,{title:v,prompt:_,fatalErrors:g,onRetry:async k=>{k?.remove(),h()}})}},y=async()=>{const{apiRoot:d}=ao();E_(`${d}/themes/${e.name}/download`)},m=async()=>{_e.show(Et,{title:"Are you sure you want to delete this?",prompt:r.jsxs(r.Fragment,{children:["You are about to delete ",r.jsxs("strong",{children:['"',e.name,'".']})," This is permanent! We warned you, k? Maybe download"," ",r.jsx("span",{className:"cursor-pointer text-green-500",onClick:()=>{y()},children:"your theme before continuing"})]}),okLabel:"Delete",okRunningLabel:"Deleting",okColor:"red",onOk:async d=>{try{await a(e.name),d?.remove()}catch(g){c(g)}}})};let l=[];t0(e)||l.push(r.jsx(Ue,{className:"ml-2",color:"green",label:"Activate",link:!0,onClick:h},"activate"));let f=[{id:"download",label:"Download",onClick:y}];f2(e)&&f.push({id:"delete",label:"Delete",onClick:m});const u={iconColorClass:"text-base",size:"sm"};return r.jsxs("div",{className:"-mr-3 flex items-center gap-4",children:[l,r.jsx($0,{items:f,position:"end",triggerButtonProps:u})]})},bj=({themes:e})=>(e.sort((s,a)=>s.active&&!a.active?-1:!s.active&&a.active?1:s.package?.name&&a.package?.name?s.package.name.localeCompare(a.package.name):s.name.localeCompare(a.name)),r.jsx(cn,{pageTitle:"Installed themes",children:e.map(s=>{const a=mj(s),o=gj(s);return r.jsx($n,{action:r.jsx(xj,{theme:s}),detail:o,id:`theme-${s.name}`,separator:!1,testId:"theme-list-item",title:a},s.name)})})),vj=({themes:e})=>r.jsx(md,{children:r.jsx(bj,{themes:e})}),wj=""+new URL("footer-marketplace-bg-BpIYEF6z.png",import.meta.url).href,yj=3e3,nm=e=>e.variants&&e.variants.length>0,mu=e=>{const s=[{category:e.category,previewUrl:e.previewUrl,image:e.image}];return e.variants&&e.variants.length>0&&s.push(...e.variants),s},_j=({onSelectTheme:e})=>{const s=d2(),[a,o]=D.useState(null),[c,h]=D.useState(0),y=m=>{o(m),h(m!==null&&nm(m)&&mu(m).length>1?1:0)};return D.useEffect(()=>{if(a===null)return;const m=setInterval(()=>{h((c+1)%(mu(a).length||0))},yj);return()=>clearInterval(m)},[a,c]),r.jsxs(md,{heading:"Themes",children:[r.jsx("div",{className:"mt-[6vmin] grid grid-cols-1 gap-[6vmin] sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4",children:s.map(m=>{const l=nm(m),f=mu(m),u=a===m;return r.jsxs("button",{className:"flex cursor-pointer flex-col gap-3 text-left",type:"button",onClick:()=>{e?.(m)},children:[r.jsx("div",{className:"relative w-full bg-grey-100 shadow-md transition-all duration-500 hover:scale-[1.05]",onMouseEnter:()=>y(m),onMouseLeave:()=>y(null),children:l?r.jsx(r.Fragment,{children:f.map((d,g)=>r.jsx("img",{alt:`${m.name} Theme - ${d.category}`,className:ye("size-full object-contain opacity-0 transition-opacity duration-500",{"opacity-100":g===c&&u||!u&&g===0,relative:g===c,absolute:g!==c,"left-0":g!==c,"top-0":g!==c}),src:d.image},`theme-variant-${d.category.toLowerCase()}`))}):r.jsx("img",{alt:`${m.name} Theme`,className:"size-full object-contain",src:m.image})}),r.jsxs("div",{className:"relative mt-3",children:[r.jsx(bt,{level:4,children:m.name}),l?f.map((d,g)=>r.jsx("span",{className:ye("absolute left-0 translate-y-px text-sm text-grey-700 opacity-0",{"opacity-100":g===c&&u||!u&&g===0}),children:d.category})):r.jsx("span",{className:"text-sm text-grey-700",children:m.category})]})]},m.name)})}),r.jsxs("div",{className:"mx-[-8vmin] mb-[-8vmin] mt-[8vmin] bg-black px-[8vmin] py-16 text-center text-lg text-white",style:{background:`#15171a url(${wj}) 100% 100% / 35vw no-repeat`},children:["Find and buy third-party, premium themes from independent developers in the ",r.jsx("a",{className:"inline-block font-semibold text-lime",href:"https://ghost.org/themes/",rel:"noopener noreferrer",target:"_blank",children:"Ghost Marketplace →"})]})]})},sm=({problem:e})=>{const[s,a]=D.useState(!1);return r.jsx($n,{title:r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`${e.level==="error"?"before:bg-red":"before:bg-yellow"} relative px-4 text-sm before:absolute before:left-0 before:top-1.5 before:block before:size-2 before:rounded-full before:content-['']`,children:[r.jsx("strong",{children:e.level==="error"?"Error: ":"Warning: "}),r.jsx("span",{dangerouslySetInnerHTML:{__html:e.rule}}),r.jsx("div",{className:"absolute -right-4 top-1",children:r.jsx(Ue,{color:"green",icon:s?"chevron-down":"chevron-right",iconColorClass:"text-grey-700",size:"sm",link:!0,onClick:()=>a(!s)})})]}),s?r.jsxs("div",{className:"mt-2 px-4 text-[13px] leading-8",children:[r.jsx("div",{dangerouslySetInnerHTML:{__html:e.details},className:"mb-4"}),r.jsx(bt,{level:6,children:"Affected files:"}),r.jsx("ul",{className:"mt-1",children:e.failures.map(o=>r.jsxs("li",{children:[r.jsx("code",{children:o.ref}),o.message?`: ${o.message}`:""]},o.ref))})]}):null]}),hideActions:!0,separator:!0})},kj=({title:e,prompt:s,installedTheme:a,onActivate:o})=>{const{mutateAsync:c}=sd(),{refreshActiveThemeData:h}=vd(),y=it();let m=null;a&&a.errors&&(m=r.jsx("div",{className:"mt-6",children:r.jsx(cn,{hint:r.jsxs(r.Fragment,{children:["Highly recommended to fix, functionality ",r.jsx("strong",{children:"could"})," be restricted"]}),title:"Errors",children:a.errors?.map((u,d)=>r.jsx(sm,{problem:u},d))})}));let l=null;a&&a.warnings&&(l=r.jsx("div",{className:"mt-10",children:r.jsx(cn,{title:"Warnings",children:a.warnings?.map((u,d)=>r.jsx(sm,{problem:u},d))})}));let f=`Activate${a.errors?.length?" with errors":""}`;return a.active&&(f="OK"),r.jsx(e0,{cancelLabel:"Close",okColor:"black",okLabel:f,okRunningLabel:"Activating...",prompt:r.jsxs(r.Fragment,{children:[s,m,l]}),title:e,onOk:async u=>{if(!a.active)try{const g=(await c(a.name)).themes[0];h(),gt({title:"Theme activated",type:"success",message:r.jsxs("div",{children:[r.jsx("span",{className:"capitalize",children:g.name})," is now your active theme."]})})}catch(d){y(d)}o?.(),u?.remove()}})},px=_e.create(kj),am=e=>e.variants&&e.variants.length>0,om=e=>{const s=[{image:e.image,category:e.category,previewUrl:e.previewUrl}];return e.variants&&e.variants.length>0&&s.push(...e.variants),s},im=e=>e.category.toLowerCase(),Mj=({selectedTheme:e,isInstalling:s,installedTheme:a,onBack:o,onInstall:c})=>{const[h,y]=D.useState("desktop"),[m,l]=D.useState(void 0);if(!e)return null;let f=e.previewUrl;const u=om(e).map(k=>({label:k.category,value:im(k)}));am(e)&&(m===void 0&&l(u[0]),f=om(e).find(k=>im(k)===m?.value)?.previewUrl||f);let d=`Install ${e.name}`;s?d="Installing...":Gi(e)&&!a?.active?d=`Activate ${e.name}`:a&&(d=`Update ${e.name}`);const g=()=>{c?.()},v=r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(gd,{activeItemClassName:"hidden md:!block md:!visible",containerClassName:"whitespace-nowrap",itemClassName:"hidden md:!block md:!visible",items:[{label:"Change theme",onClick:o},{label:e.name}],separatorClassName:"hidden md:!block md:!visible",backIcon:!0,onBack:o}),am(e)?r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"hidden md:!visible md:!block",children:"–"}),r.jsx(Ot,{border:!1,containerClassName:"text-sm font-bold",controlClasses:{menu:"w-24"},fullWidth:!1,options:u,selectedOption:m,clearBg:!0,onSelect:k=>{l(k||void 0)}})]}):null]}),_=r.jsxs("div",{className:"flex justify-end gap-8",children:[r.jsx(Gr,{buttons:[{icon:"laptop",iconColorClass:h==="desktop"?"text-black dark:text-green":"text-grey-500 dark:text-grey-600",link:!0,size:"sm",onClick:()=>{y("desktop")}},{icon:"mobile",iconColorClass:h==="mobile"?"text-black dark:text-green":"text-grey-500 dark:text-grey-600",link:!0,size:"sm",onClick:()=>{y("mobile")}}]}),r.jsx(Ue,{color:"green",disabled:s,label:s?"Installing...":d,onClick:g})]});return r.jsxs("div",{className:"absolute inset-0 z-[100]",children:[r.jsx(K0,{containerClassName:"bg-grey-50 dark:bg-black z-[100]",left:v,right:_,sticky:!1}),r.jsx("div",{className:"flex h-[calc(100%-92px)] grow flex-col items-center justify-center bg-grey-50 dark:bg-black",children:h==="desktop"?r.jsx(b0,{children:r.jsx("iframe",{className:"size-full",src:f,title:"Theme preview"})}):r.jsx(v0,{children:r.jsx("iframe",{className:"size-full",src:f,title:"Theme preview"})})})]})},jj=({onUpload:e})=>{const s=Xt();return r.jsx("div",{className:"-mb-6",children:r.jsx(m2,{id:"theme-upload",onUpload:a=>{s.remove(),e(a)},children:r.jsx("div",{className:"cursor-pointer bg-grey-75 p-10 text-center dark:bg-grey-950",children:"Click to select or drag & drop zip file"})})})},Ej=({currentTab:e,setCurrentTab:s,themes:a})=>{const o=Xt(),{updateRoute:c}=Ve(),{mutateAsync:h}=h2(),{checkThemeLimitError:y,isThemeLimited:m}=od(),l=it(),[f,u]=D.useState(),[d,g]=D.useState(!1);D.useEffect(()=>{(async()=>{if(m){const R=await y(".");u({enabled:!1,error:R||"Your current plan doesn't support uploading custom themes."})}else u({enabled:!0})})()},[y,m]);const v=()=>{c("/")},_=async I=>{const R=I?.name.replace(/\.zip$/,""),$=a.map(W=>W.name);Gi({name:R})?_e.show(Et,{title:"Upload failed",cancelLabel:"Cancel",okLabel:"",prompt:r.jsxs(r.Fragment,{children:[r.jsxs("p",{children:["The default ",r.jsx("strong",{children:R})," theme cannot be overwritten."]}),r.jsx("p",{children:"Rename your zip file and try again."})]}),onOk:async W=>{W?.remove()}}):$.includes(R)?_e.show(Et,{title:"Overwrite theme",prompt:r.jsxs(r.Fragment,{children:["The theme ",r.jsx("strong",{children:R})," already exists. Do you want to overwrite it?"]}),okLabel:"Overwrite",cancelLabel:"Cancel",okRunningLabel:"Overwriting...",okColor:"red",onOk:async W=>{g(!0);const O=$.indexOf(R);a.splice(O,1),await k({file:I,onActivate:v}),g(!1),s("installed"),W?.remove()}}):(s("installed"),k({file:I,onActivate:v}))},k=async({file:I,onActivate:R})=>{let $,W=null;try{g(!0),$=await h({file:I}),g(!1)}catch(Y){g(!1),Y instanceof ts&&Y.response?.status===422&&Y.data?.errors?W=Y.data.errors:l(Y)}if(W&&!$){let Y="Invalid Theme",P=r.jsx(r.Fragment,{children:"This theme is invalid and cannot be activated. Fix the following errors and re-upload the theme"});_e.show(dx,{title:Y,prompt:P,fatalErrors:W,onRetry:async()=>{o?.remove(),T()}})}if(!$)return;const O=$.themes[0];let K="Upload successful",X=r.jsxs(r.Fragment,{children:[r.jsx("strong",{children:O.name})," uploaded"]});if(O.active||(X=r.jsxs(r.Fragment,{children:[X," ","Do you want to activate it now?"]})),O?.errors?.length||O.warnings?.length){const Y=O?.errors?.length;K=`Upload successful with ${Y?"errors":"warnings"}`,X=r.jsxs(r.Fragment,{children:["The theme ",r.jsxs("strong",{children:['"',O.name,'"']})," was installed but we detected some ",Y?"errors":"warnings","."]}),O.active||(X=r.jsxs(r.Fragment,{children:[X,"You are still able to activate and use the theme but it is recommended to fix these ",Y?"errors":"warnings"," before you do so."]}))}_e.show(px,{title:K,prompt:X,installedTheme:O,onActivate:R})},M=r.jsx("div",{className:"hidden md:!visible md:!block",children:r.jsx(fn,{border:!1,selectedTab:e,tabs:[{id:"official",title:"Official themes"},{id:"installed",title:"Installed"}],onTabChange:I=>{s(I)}})}),T=()=>{f&&(f.enabled?_e.show(Et,{title:"Upload theme",prompt:r.jsx(jj,{onUpload:_}),okLabel:"",formSheet:!1}):_e.show(Vr,{title:"Upgrade to enable custom themes",prompt:f.error||r.jsxs(r.Fragment,{children:["Your current plan only supports official themes. You can install them from the ",r.jsx("a",{href:"https://ghost.org/marketplace/",children:"Ghost theme marketplace"}),"."]}),onOk:()=>c({route:"/pro",isExternal:!0})}))},A=r.jsx("div",{className:"flex items-center gap-14",children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(Ue,{label:"Close",onClick:()=>{o.remove(),v()}}),r.jsx(Ue,{color:"black",label:"Upload theme",loading:d,onClick:T})]})});return r.jsxs(r.Fragment,{children:[r.jsx(K0,{containerClassName:"bg-white dark:bg-black",left:M,right:A}),r.jsx("div",{className:"px-[8vmin] md:hidden",children:r.jsx(fn,{border:!1,selectedTab:e,tabs:[{id:"official",title:"Official themes"},{id:"installed",title:"Installed"}],onTabChange:I=>{s(I)}})})]})},Tj=({currentTab:e,onSelectTheme:s,themes:a})=>{switch(e){case"official":return r.jsx(_j,{onSelectTheme:s});case"installed":return r.jsx(vj,{themes:a})}return null},lm=({source:e,themeRef:s})=>{const[a,o]=D.useState("official"),[c,h]=D.useState(null),[y,m]=D.useState("desktop"),[l,f]=D.useState(!1),[u,d]=D.useState(!1),[g,v]=D.useState(!1),{updateRoute:_}=Ve(),k=Xt(),{data:{themes:M}={}}=ad(),{mutateAsync:T}=p2(),{mutateAsync:A}=sd(),{checkThemeLimitError:I}=od(),R=it(),$=K=>{h(K)};if(D.useEffect(()=>{v(!0)},[]),D.useEffect(()=>{(async()=>{if(e&&s&&!u&&g){const X=s.split("/")[1];if(await I(X)){k.remove();return}let P="Install Theme";const q=M?.map(te=>te.name)||[];let ee=q.includes(X.toLowerCase());const ae=q.indexOf(X.toLowerCase()),ne=M?.[ae];let Q=r.jsxs(r.Fragment,{children:["By clicking below, ",r.jsx("strong",{children:X})," will automatically be activated as the theme for your site.",ee&&r.jsxs(r.Fragment,{children:[r.jsx("br",{}),r.jsx("br",{}),"This will overwrite your existing version of ",r.jsx("strong",{children:X}),ne?.active?" which is your active theme":"",". All custom changes will be lost."]})]});_e.show(Et,{title:P,prompt:Q,okLabel:"Install",cancelLabel:"Cancel",okRunningLabel:"Installing...",okColor:"black",onOk:async te=>{let pe;d(!0);try{ee&&M&&M.splice(ae,1),pe=await T(s),pe?.themes[0]&&(await A(pe.themes[0].name),gt({title:"Theme activated",type:"success",message:r.jsxs("div",{children:[r.jsx("span",{className:"capitalize",children:pe.themes[0].name})," is now your active theme"]})})),te?.remove(),_("")}catch(we){R(we)}}})}})()},[s,e,T,R,A,_,M,u,I,k,g]),!M)return;let W,O;if(c){W=M.find(X=>X.name.toLowerCase()===c.name.toLowerCase()),O=async()=>{const X=await I(c.name);if(X){_e.show(Vr,{prompt:X,onOk:()=>_({route:"/pro",isExternal:!0})});return}return W&&!Gi(c)?new Promise(Y=>{_e.show(Et,{title:"Overwrite theme",prompt:r.jsxs(r.Fragment,{children:["This will overwrite your existing version of ",c.name,W?.active?", which is your active theme":"",". All custom changes will be lost."]}),okLabel:"Overwrite",okRunningLabel:"Installing...",cancelLabel:"Cancel",okColor:"red",onOk:async P=>{P?.remove(),await K(),Y()}})}):K()};const K=async()=>{let X="Success",Y=r.jsx(r.Fragment,{});if(Gi(c))X="Activate theme",Y=r.jsxs(r.Fragment,{children:["By clicking below, ",r.jsx("strong",{children:c.name})," will automatically be activated as the theme for your site."]});else{f(!0);let P;try{P=await T(c.ref)}catch(ee){R(ee)}finally{f(!1)}if(!P)return;const q=P.themes[0];if(X="Success",Y=r.jsxs(r.Fragment,{children:[r.jsx("strong",{children:q.name})," has been successfully installed."]}),q.active||(Y=r.jsxs(r.Fragment,{children:[Y," ","Do you want to activate it now?"]})),q.errors?.length||q.warnings?.length){const ee=q.errors?.length;X=`Installed with ${ee?"errors":"warnings"}`,Y=r.jsxs(r.Fragment,{children:["The theme ",r.jsxs("strong",{children:['"',q.name,'"']})," was installed successfully but we detected some ",ee?"errors":"warnings","."]}),q.active||(Y=r.jsxs(r.Fragment,{children:[Y,"You are still able to activate and use the theme but it is recommended to contact the theme developer fix these ",ee?"errors":"warnings"," before you do so."]}))}W=q}_e.show(px,{title:X,prompt:Y,installedTheme:W,onActivate:()=>{_("")}})}}return r.jsx(vt,{afterClose:()=>{_("")},animate:!1,cancelLabel:"",footer:!1,padding:!1,size:"full",testId:"theme-modal",title:"",scrolling:!0,onCancel:()=>{k.remove(),_("")},children:r.jsx("div",{className:"flex h-full justify-between",children:r.jsxs("div",{className:"grow",children:[c&&r.jsx(Mj,{installedTheme:W,isInstalling:l,selectedTheme:c,onBack:()=>{h(null)},onClose:()=>{_("")},onInstall:O}),r.jsx(Ej,{currentTab:a,modal:k,previewMode:y,selectedTheme:c,setCurrentTab:o,setPreviewMode:m,setSelectedTheme:h,themes:M}),!c&&r.jsx(Tj,{currentTab:a,themes:M,onSelectTheme:$})]})})})},Nj=({children:e,to:s,classNames:a})=>{const o=s||document.body;if(!o)return r.jsx(r.Fragment,{children:e});const c=h=>{h.stopPropagation()};return T_.createPortal(r.jsx("div",{className:a,onMouseDown:c,children:r.jsx("div",{children:e})}),o)};var Sj=Object.defineProperty,Aj=(e,s,a)=>s in e?Sj(e,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[s]=a,jt=(e,s,a)=>Aj(e,typeof s!="symbol"?s+"":s,a),hx={exports:{}},Ya={};/**
4
4
  * @license React
@@ -1 +1 @@
1
- import{G as T,I as F,J as _,K as E,r as d,M as V,N as H,b as R,j as e,L as W,O as $,Q as k,R as b,T as j,P as G,U as v,h as J,A as K,S as l,B as i,V as c}from"./index-DCTdAEHx.js";import{T as O,a as Q,b as w,c as f}from"./tabs-CBD0hW8V.js";import"./index-LyfDjTto.js";import"./lucide-react-DtMIZssr.js";import"./a-large-small-p58xibEK.js";import"./wallet-cards-ddLuIN-b.js";import"./at-sign-BZPuAx5m.js";import"./message-square-text-BDZtUW-2.js";import"./copy-Bi7VpgPR.js";import"./hash-DFhnGHId.js";import"./inbox-p-Y5uScT.js";import"./list-filter-3EF6cVg-.js";import"./minus-CSphShdJ.js";import"./tags-CKrBptuC.js";import"./square-CwHQ9sJ2.js";import"./user-round-check-zOuzV3OS.js";import"./repeat-Smml9n0k.js";import"./reply-CooY4lmk.js";import"./sprout-DRqlFJSK.js";import"./trash-CJY1Wro_.js";const pe=()=>{const{data:N,isLoading:o}=T("index"),{data:g,isLoading:n}=F("index"),m=o?Array(5).fill({apId:"",name:"",handle:"",avatarUrl:""}):N?.pages.flatMap(s=>s.accounts)??[],u=n?Array(5).fill({apId:"",name:""}):g?.pages.flatMap(s=>s.domains)??[],U=_("index"),I=E("index"),[M,x]=d.useState(new Set),B=V("index"),D=H("index"),[S,h]=d.useState(new Set),[p,r]=d.useState(null),y=R(),A=s=>{x(t=>{const a=new Set([...t]);return a.add(s.apId),a}),I.mutate(s),c.success("User unblocked")},L=s=>{x(t=>{const a=new Set([...t]);return a.delete(s.apId),a}),U.mutate(s),c.success("User blocked")},C=s=>{h(t=>{const a=new Set([...t]);return a.add(s.url),a}),D.mutate({url:s.url}),c.success("Domain unblocked")},P=s=>{h(t=>{const a=new Set([...t]);return a.delete(s.url),a}),B.mutate({url:s.url}),c.success("Domain blocked")};return e.jsx(W,{children:e.jsxs("div",{className:"mx-auto max-w-[620px] py-[min(4vh,48px)]",children:[e.jsx("div",{className:"flex items-center justify-between gap-8",children:e.jsx($,{children:"Moderation"})}),e.jsx("div",{className:"mt-6",children:e.jsxs(O,{defaultValue:"blocked_users",variant:"underline",children:[e.jsxs(Q,{children:[e.jsx(w,{value:"blocked_users",children:"Blocked users"}),e.jsx(w,{value:"blocked_domains",children:"Blocked domains"})]}),e.jsx(f,{className:"mt-2",value:"blocked_users",children:!o&&m.length===0?e.jsxs(k,{children:[e.jsx(b,{children:e.jsx(j,{})}),e.jsx("div",{className:"mt-2 flex max-w-[400px] flex-col items-center gap-1 text-center",children:e.jsx("p",{children:"When you block someone, they won't be able to follow you or interact with your content on the social web."})})]}):m.map((s,t)=>e.jsx(G,{actor:s,isCurrentUser:!0,children:e.jsx("div",{children:e.jsxs(v,{onClick:o?void 0:()=>J(s.handle,y),children:[e.jsx(K,{author:{icon:{url:s.avatarUrl},name:s.name,handle:s.handle}}),e.jsxs("div",{className:"flex min-w-0 flex-col",children:[e.jsx("span",{className:"block truncate font-semibold text-black dark:text-white",children:o?e.jsx(l,{className:"w-24"}):s.name}),e.jsx("span",{className:"block truncate text-sm text-gray-600",children:o?e.jsx(l,{className:"w-40"}):s.handle})]}),M.has(s.apId)?e.jsx(i,{className:"ml-auto min-w-[90px] text-red hover:!bg-red/5 hover:text-red-400",variant:"outline",onClick:a=>{a.stopPropagation(),L(s)},children:"Block"}):o?e.jsx("div",{className:"ml-auto w-16",children:e.jsx(l,{})}):e.jsx(i,{className:"ml-auto min-w-[90px]",variant:"destructive",onClick:a=>{a.stopPropagation(),A(s)},onMouseEnter:()=>r(s.apId),onMouseLeave:()=>r(null),children:p===s.apId?"Unblock":"Blocked"})]})})},s.apId?s.apId:`loading-${t}`))}),e.jsx(f,{className:"mt-[11px]",value:"blocked_domains",children:!n&&u.length===0?e.jsxs(k,{children:[e.jsx(b,{children:e.jsx(j,{})}),e.jsx("div",{className:"mt-2 flex max-w-[400px] flex-col items-center gap-1 text-center",children:e.jsx("p",{children:"When you block a domain, all users from that domain won't be able to follow you or interact with your content."})})]}):u.map((s,t)=>e.jsxs(v,{children:[e.jsx("div",{className:"flex min-w-0 flex-col",children:e.jsx("span",{className:"block truncate font-semibold text-black dark:text-white",children:n?e.jsx(l,{className:"w-48"}):new URL(s.url).hostname})}),S.has(s.url)?e.jsx(i,{className:"ml-auto min-w-[90px] text-red hover:!bg-red/5 hover:text-red-400",variant:"outline",onClick:()=>P(s),children:"Block"}):n?e.jsx("div",{className:"ml-auto w-16",children:e.jsx(l,{})}):e.jsx(i,{className:"ml-auto min-w-[90px]",variant:"destructive",onClick:()=>C(s),onMouseEnter:()=>r(s.url),onMouseLeave:()=>r(null),children:p===s.url?"Unblock":"Blocked"})]},s.url?s.url:`loading-${t}`))})]})})]})})};export{pe as default};
1
+ import{G as T,I as F,J as _,K as E,r as d,M as V,N as H,b as R,j as e,L as W,O as $,Q as k,R as b,T as j,P as G,U as v,h as J,A as K,S as l,B as i,V as c}from"./index-Bgo4hw-T.js";import{T as O,a as Q,b as w,c as f}from"./tabs-Bw13eFRh.js";import"./index-D0RISNEd.js";import"./lucide-react-7D_Tsesk.js";import"./a-large-small-gBDqOWOy.js";import"./wallet-cards-Cl4bJBBw.js";import"./at-sign-V79EBNTJ.js";import"./message-square-text-DzuHB7uU.js";import"./copy-CTHgI4YI.js";import"./hash-CRtHv162.js";import"./inbox-DWYGFLuU.js";import"./list-filter-CofVbkA4.js";import"./minus-BIdO1CDG.js";import"./tags-BQz2NtFF.js";import"./square-C8G-1gV_.js";import"./user-round-check-Df7ko4Tm.js";import"./repeat-YTCeIlQZ.js";import"./reply-CUazFbTY.js";import"./sprout-CXg43Zav.js";import"./trash-BKeiM6WP.js";const pe=()=>{const{data:N,isLoading:o}=T("index"),{data:g,isLoading:n}=F("index"),m=o?Array(5).fill({apId:"",name:"",handle:"",avatarUrl:""}):N?.pages.flatMap(s=>s.accounts)??[],u=n?Array(5).fill({apId:"",name:""}):g?.pages.flatMap(s=>s.domains)??[],U=_("index"),I=E("index"),[M,x]=d.useState(new Set),B=V("index"),D=H("index"),[S,h]=d.useState(new Set),[p,r]=d.useState(null),y=R(),A=s=>{x(t=>{const a=new Set([...t]);return a.add(s.apId),a}),I.mutate(s),c.success("User unblocked")},L=s=>{x(t=>{const a=new Set([...t]);return a.delete(s.apId),a}),U.mutate(s),c.success("User blocked")},C=s=>{h(t=>{const a=new Set([...t]);return a.add(s.url),a}),D.mutate({url:s.url}),c.success("Domain unblocked")},P=s=>{h(t=>{const a=new Set([...t]);return a.delete(s.url),a}),B.mutate({url:s.url}),c.success("Domain blocked")};return e.jsx(W,{children:e.jsxs("div",{className:"mx-auto max-w-[620px] py-[min(4vh,48px)]",children:[e.jsx("div",{className:"flex items-center justify-between gap-8",children:e.jsx($,{children:"Moderation"})}),e.jsx("div",{className:"mt-6",children:e.jsxs(O,{defaultValue:"blocked_users",variant:"underline",children:[e.jsxs(Q,{children:[e.jsx(w,{value:"blocked_users",children:"Blocked users"}),e.jsx(w,{value:"blocked_domains",children:"Blocked domains"})]}),e.jsx(f,{className:"mt-2",value:"blocked_users",children:!o&&m.length===0?e.jsxs(k,{children:[e.jsx(b,{children:e.jsx(j,{})}),e.jsx("div",{className:"mt-2 flex max-w-[400px] flex-col items-center gap-1 text-center",children:e.jsx("p",{children:"When you block someone, they won't be able to follow you or interact with your content on the social web."})})]}):m.map((s,t)=>e.jsx(G,{actor:s,isCurrentUser:!0,children:e.jsx("div",{children:e.jsxs(v,{onClick:o?void 0:()=>J(s.handle,y),children:[e.jsx(K,{author:{icon:{url:s.avatarUrl},name:s.name,handle:s.handle}}),e.jsxs("div",{className:"flex min-w-0 flex-col",children:[e.jsx("span",{className:"block truncate font-semibold text-black dark:text-white",children:o?e.jsx(l,{className:"w-24"}):s.name}),e.jsx("span",{className:"block truncate text-sm text-gray-600",children:o?e.jsx(l,{className:"w-40"}):s.handle})]}),M.has(s.apId)?e.jsx(i,{className:"ml-auto min-w-[90px] text-red hover:!bg-red/5 hover:text-red-400",variant:"outline",onClick:a=>{a.stopPropagation(),L(s)},children:"Block"}):o?e.jsx("div",{className:"ml-auto w-16",children:e.jsx(l,{})}):e.jsx(i,{className:"ml-auto min-w-[90px]",variant:"destructive",onClick:a=>{a.stopPropagation(),A(s)},onMouseEnter:()=>r(s.apId),onMouseLeave:()=>r(null),children:p===s.apId?"Unblock":"Blocked"})]})})},s.apId?s.apId:`loading-${t}`))}),e.jsx(f,{className:"mt-[11px]",value:"blocked_domains",children:!n&&u.length===0?e.jsxs(k,{children:[e.jsx(b,{children:e.jsx(j,{})}),e.jsx("div",{className:"mt-2 flex max-w-[400px] flex-col items-center gap-1 text-center",children:e.jsx("p",{children:"When you block a domain, all users from that domain won't be able to follow you or interact with your content."})})]}):u.map((s,t)=>e.jsxs(v,{children:[e.jsx("div",{className:"flex min-w-0 flex-col",children:e.jsx("span",{className:"block truncate font-semibold text-black dark:text-white",children:n?e.jsx(l,{className:"w-48"}):new URL(s.url).hostname})}),S.has(s.url)?e.jsx(i,{className:"ml-auto min-w-[90px] text-red hover:!bg-red/5 hover:text-red-400",variant:"outline",onClick:()=>P(s),children:"Block"}):n?e.jsx("div",{className:"ml-auto w-16",children:e.jsx(l,{})}):e.jsx(i,{className:"ml-auto min-w-[90px]",variant:"destructive",onClick:()=>C(s),onMouseEnter:()=>r(s.url),onMouseLeave:()=>r(null),children:p===s.url?"Unblock":"Blocked"})]},s.url?s.url:`loading-${t}`))})]})})]})})};export{pe as default};