ghost 6.18.1 → 6.18.2
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.
- package/components/tryghost-i18n-6.18.2.tgz +0 -0
- package/components/{tryghost-parse-email-address-6.18.1.tgz → tryghost-parse-email-address-6.18.2.tgz} +0 -0
- package/content/themes/source/package.json +1 -1
- package/core/built/admin/assets/{PolarAngleAxis-Dod0DwfL.js → PolarAngleAxis-DALH8FDm.js} +1 -1
- package/core/built/admin/assets/{_baseAssignValue-DnkbkowM.js → _baseAssignValue-D_UsvJRN.js} +1 -1
- package/core/built/admin/assets/{a-large-small-C5mgFBRg.js → a-large-small-DVyx4GMu.js} +1 -1
- package/core/built/admin/assets/admin-x-settings/admin-x-settings.js +2 -2
- package/core/built/admin/assets/admin-x-settings/{code-editor-view-BWi3-ftq.mjs → code-editor-view-DBrulgE8.mjs} +12 -12
- package/core/built/admin/assets/admin-x-settings/{index-B3PtvbUw.mjs → index-CsGHbqSU.mjs} +2 -2
- package/core/built/admin/assets/admin-x-settings/{index-Did70N9h.mjs → index-Cypgljb3.mjs} +2 -2
- package/core/built/admin/assets/admin-x-settings/{index-JaMlaX9G.mjs → index-DgGwb1L-.mjs} +1390 -1381
- package/core/built/admin/assets/admin-x-settings/{modals-Bwrf9ptQ.mjs → modals-rdo7i0D3.mjs} +9320 -8655
- package/core/built/admin/assets/{at-sign-Bz-SU-S_.js → at-sign-CGNkBrZS.js} +1 -1
- package/core/built/admin/assets/{audience-DmVdEmIe.js → audience-CJHVR7kD.js} +1 -1
- package/core/built/admin/assets/{avatar-flipboard-C7sxDVEM.js → avatar-flipboard-jqr9Aapd.js} +1 -1
- package/core/built/admin/assets/{bluesky-sharing-DJniSF6N.js → bluesky-sharing-C2749SVt.js} +1 -1
- package/core/built/admin/assets/{chart-mYz3IJwm.js → chart-BAQCVPCH.js} +1 -1
- package/core/built/admin/assets/{chunk.524.9d300778a63b42b0de62.js → chunk.524.428356d01feabbc7b932.js} +7 -7
- package/core/built/admin/assets/{chunk.582.2e363cd976d9bba998b9.js → chunk.582.b8b41ba720f49d724992.js} +9 -9
- package/core/built/admin/assets/{code-editor-view-BIQWFJ01.js → code-editor-view-YNhJ1w71.js} +1 -1
- package/core/built/admin/assets/{comments-B_-hdjc6.js → comments-CPd_iCc3.js} +1 -1
- package/core/built/admin/assets/{copy-Bpq3uhnh.js → copy-CNsHZEFR.js} +1 -1
- package/core/built/admin/assets/{data-list-BYNMbRIq.js → data-list-Dn5MkmyD.js} +1 -1
- package/core/built/admin/assets/{deleted-feed-item-B_AwUKZy.js → deleted-feed-item-Dmm_clMl.js} +1 -1
- package/core/built/admin/assets/{edit-profile-DZo2ZcOu.js → edit-profile-BLSdtROQ.js} +1 -1
- package/core/built/admin/assets/{empty-indicator-Bn5wG9-T.js → empty-indicator-C2Z0dddU.js} +1 -1
- package/core/built/admin/assets/{en-D4zIrMLN.js → en-DuTkaMAI.js} +1 -1
- package/core/built/admin/assets/{feed-Bgq4RarU.js → feed-B4Xp4C2J.js} +1 -1
- package/core/built/admin/assets/{filters-CpVwu1Gk.js → filters-gnOx5Z45.js} +1 -1
- package/core/built/admin/assets/{gh-chart-Br7NXn_b.js → gh-chart-B2aWYkGg.js} +1 -1
- package/core/built/admin/assets/{ghost-98a3c5fd6235ebd344594f491cb6d17b.js → ghost-29f8f3c80e41126ba5e3c52ad5727e8a.js} +176 -176
- package/core/built/admin/assets/ghost-transistor-BXCFhTPG.png +0 -0
- package/core/built/admin/assets/{growth-CiPDnWxJ.js → growth-BysawIWe.js} +1 -1
- package/core/built/admin/assets/{hash-Bc1e38oH.js → hash-j3sh-UI3.js} +1 -1
- package/core/built/admin/assets/{inbox-BcZNBNhk.js → inbox-1cUdr8Mm.js} +1 -1
- package/core/built/admin/assets/index-B2yksBz4.js +13 -0
- package/core/built/admin/assets/{index-CMTzNTew.js → index-B8G0f0hb.js} +3 -3
- package/core/built/admin/assets/{index-DU3bv9jz.js → index-BVoBTlp_.js} +1 -1
- package/core/built/admin/assets/{index-ETsoQLbU.js → index-BgrwCpgw.js} +1 -1
- package/core/built/admin/assets/{index-Bm5ZeLtt.js → index-BhY_SbGB.js} +1 -1
- package/core/built/admin/assets/index-CkAUXgAi.js +1 -0
- package/core/built/admin/assets/index-Cl_EPbQ2.js +1 -0
- package/core/built/admin/assets/{index-B_7QsC5T.js → index-D8CXbJm4.js} +1 -1
- package/core/built/admin/assets/index-DGBK5k9H.js +1 -0
- package/core/built/admin/assets/{index-D212VvOz.js → index-DKAlEWM4.js} +1 -1
- package/core/built/admin/assets/index-D_sGUCda.css +1 -0
- package/core/built/admin/assets/{index-BFEx_ouC.js → index-DarAAzVH.js} +1 -1
- package/core/built/admin/assets/{index-Brg4tecQ.js → index-Dz8eTtOq.js} +1 -1
- package/core/built/admin/assets/{index-Cn32t_gv.js → index-I9n711UW.js} +1 -1
- package/core/built/admin/assets/{index-CsidX7Si.js → index-WjY3mGep.js} +2 -2
- package/core/built/admin/assets/{index-Dv13wKfX.js → index-mhojl7aD.js} +1 -1
- package/core/built/admin/assets/{koenig-lexical-DZUWzN0P.js → koenig-lexical-coiS9dIC.js} +1 -1
- package/core/built/admin/assets/{kpi-card-DENsK2xK.js → kpi-card-BEFHo2gr.js} +1 -1
- package/core/built/admin/assets/{kpis-CDrs2iS1.js → kpis-D-gz-lUk.js} +1 -1
- package/core/built/admin/assets/{label-BznQtEEo.js → label-BvlHzzcJ.js} +1 -1
- package/core/built/admin/assets/{links-lpAC3T1p.js → links-tdJvBrsT.js} +1 -1
- package/core/built/admin/assets/list-filter-DPE4Xj2T.js +6 -0
- package/core/built/admin/assets/{lucide-react-CBigk-fq.js → lucide-react-ClQ3Iy7l.js} +1448 -1453
- package/core/built/admin/assets/{main-layout-_SYQRjIl.js → main-layout-DY96wK-_.js} +1 -1
- package/core/built/admin/assets/{message-square-text-cV8O_qKq.js → message-square-text-Dd1XS5-H.js} +1 -1
- package/core/built/admin/assets/{minus-NvnQTlW7.js → minus-CyEc3BE5.js} +1 -1
- package/core/built/admin/assets/modals-C06GcVIm.js +77 -0
- package/core/built/admin/assets/moderation-B0fdmlig.js +1 -0
- package/core/built/admin/assets/newsletter-Byg3ARa5.js +1 -0
- package/core/built/admin/assets/{newsletters-BexdXUhn.js → newsletters-DbH39vgA.js} +1 -1
- package/core/built/admin/assets/{note-DuaUGOeZ.js → note-Cwy-rIAF.js} +1 -1
- package/core/built/admin/assets/overview-CVMLGrVt.js +1 -0
- package/core/built/admin/assets/{pagemenu-CZyroidv.js → pagemenu-CkzsZrHC.js} +1 -1
- package/core/built/admin/assets/{post-analytics-DLK2SOSQ.js → post-analytics-aA-nG9Fq.js} +1 -1
- package/core/built/admin/assets/{post-analytics-context-CF7C67-0.js → post-analytics-context-BLkup0Xh.js} +1 -1
- package/core/built/admin/assets/{post-analytics-header-7GtJCx0W.js → post-analytics-header-D9srAPT5.js} +1 -1
- package/core/built/admin/assets/{post-share-modal-D8R7DUZP.js → post-share-modal-CkvJtrRw.js} +1 -1
- package/core/built/admin/assets/{posts-CL9UDYoW.js → posts-DDkuYoN7.js} +1 -1
- package/core/built/admin/assets/{repeat-DgH39UKE.js → repeat-B-SL0yPM.js} +1 -1
- package/core/built/admin/assets/{reply-DAaNxiy8.js → reply-BdCPoUQ9.js} +1 -1
- package/core/built/admin/assets/{select-Cor2wFXT.js → select-C7aNW8QS.js} +1 -1
- package/core/built/admin/assets/{settings-xRx917Gj.js → settings-Bzy1GNfD.js} +1 -1
- package/core/built/admin/assets/{settings-BeumESEN.js → settings-D-dhma2e.js} +23 -23
- package/core/built/admin/assets/{sort-button-BNW3i4Lb.js → sort-button-Dv8vjh13.js} +1 -1
- package/core/built/admin/assets/{source-icon-DvDuzw73.js → source-icon-DTz4isLK.js} +1 -1
- package/core/built/admin/assets/{sprout-C3cc0c-K.js → sprout-BwLQTzMf.js} +1 -1
- package/core/built/admin/assets/{square-tZp0_n7e.js → square-YF1YE9ex.js} +1 -1
- package/core/built/admin/assets/{stats-2Jelnn-Q.js → stats-C5ad0fgQ.js} +1 -1
- package/core/built/admin/assets/{stats-view-CESy8ELH.js → stats-view-BvkxPYNX.js} +1 -1
- package/core/built/admin/assets/{step-1-DrqdolAh.js → step-1-D7_s-D99.js} +1 -1
- package/core/built/admin/assets/{step-2-DmEpKck5.js → step-2-B94Yf7FF.js} +1 -1
- package/core/built/admin/assets/{step-3-Bus-0o0n.js → step-3-DswXYYf4.js} +1 -1
- package/core/built/admin/assets/{table-BQUcKHfm.js → table-D30IXfUP.js} +1 -1
- package/core/built/admin/assets/{tabs-BmdL0X4U.js → tabs-CjNdfW0y.js} +1 -1
- package/core/built/admin/assets/{tags-EchqlZUJ.js → tags-B0ux9_dT.js} +1 -1
- package/core/built/admin/assets/{tags-CLxXZlOO.js → tags-PGeGAafJ.js} +1 -1
- package/core/built/admin/assets/{tiers-nCGyTly9.js → tiers-BaXK0JoI.js} +1 -1
- package/core/built/admin/assets/{toggle-group-CM5uf7J1.js → toggle-group-DdY8HF3Y.js} +1 -1
- package/core/built/admin/assets/{topic-filter-LTRvZ8aU.js → topic-filter-Boh22uGD.js} +1 -1
- package/core/built/admin/assets/{trash-u5BxolyH.js → trash-D7ZWrnDq.js} +1 -1
- package/core/built/admin/assets/{url-helpers-D41fEt51.js → url-helpers-mt6MBIi0.js} +1 -1
- package/core/built/admin/assets/{use-growth-stats-BJ0O9ewi.js → use-growth-stats-Bg0nE0WG.js} +1 -1
- package/core/built/admin/assets/{use-infinite-virtual-scroll-APZWciOk.js → use-infinite-virtual-scroll-DoeI5IY-.js} +1 -1
- package/core/built/admin/assets/{use-simple-pagination-DVRHeaAR.js → use-simple-pagination-BJzBULR3.js} +1 -1
- package/core/built/admin/assets/{user-round-check-B6j98D6d.js → user-round-check-BLc3L-ei.js} +1 -1
- package/core/built/admin/assets/{wallet-cards-KmOh29LP.js → wallet-cards-xX4QZik7.js} +1 -1
- package/core/built/admin/assets/web-DQ2qBymm.js +1 -0
- package/core/built/admin/index.html +5 -5
- package/core/server/lib/image/cached-image-size-from-url.js +37 -25
- package/core/server/lib/lexical.js +1 -0
- package/core/server/lib/mobiledoc.js +1 -0
- package/core/server/services/email-service/email-renderer.js +6 -2
- package/core/server/services/email-service/email-service-wrapper.js +2 -2
- package/core/server/services/koenig/node-renderers/call-to-action-renderer.js +2 -2
- package/core/server/services/koenig/node-renderers/gallery-renderer.js +3 -3
- package/core/server/services/koenig/node-renderers/image-renderer.js +3 -3
- package/core/server/services/koenig/render-utils/is-content-image.js +18 -0
- package/core/server/services/koenig/render-utils/srcset-attribute.js +4 -4
- package/core/server/services/members/members-api/controllers/router-controller.js +21 -36
- package/core/server/services/members/members-api/repositories/member-repository.js +8 -1
- package/core/server/services/offers/offer-bookshelf-repository.js +3 -3
- package/core/shared/config/defaults.json +1 -1
- package/core/shared/labs.js +2 -1
- package/package.json +5 -5
- package/components/tryghost-i18n-6.18.1.tgz +0 -0
- package/core/built/admin/assets/index-BBrewxpF.css +0 -1
- package/core/built/admin/assets/index-BpcL7RmI.js +0 -13
- package/core/built/admin/assets/index-CTfJflJ2.js +0 -1
- package/core/built/admin/assets/index-D67LJ_H4.js +0 -1
- package/core/built/admin/assets/index-ZYDRMgcT.js +0 -1
- package/core/built/admin/assets/modals-XRSkribf.js +0 -77
- package/core/built/admin/assets/moderation-BQp1GEWG.js +0 -1
- package/core/built/admin/assets/newsletter-foM6KNNV.js +0 -1
- package/core/built/admin/assets/overview-DgKBNqyc.js +0 -1
- package/core/built/admin/assets/web-Cclotbnz.js +0 -1
- package/core/server/services/koenig/render-utils/is-local-content-image.js +0 -9
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import{j as s,r as D,aH as we,e as at,d7 as i_,av as $g,aq as l_,ar as c_,as as Lg,aw as u_,au as Vi,aE as Kf,ax as f_,ay as Sf,az as d_,aF as p_,aG as h_,d8 as ut,ad as ns,bM as ot,d9 as no,da as Rn,db as gt,dc as xt,cF as Pg,cW as Fg,dd as Ug,de as ah,df as m_,dg as ln,dh as g_,di as ts,aB as x_,dj as b_,d6 as Zf,d5 as Hs,dk as Ha,ak as v_,aN as w_,dl as y_,dm as Qi,dn as Vf,dp as oh,dq as dr,dr as Za,ds as Nf,dt as __,du as Ws,dv as k_,dw as M_,dx as j_,dy as Hi,dz as E_,dA as T_,dB as Af,ac as S_,dC as N_,dD as A_,dE as I_,dF as C_,dG as Nn,dH as ih,dI as lh,dJ as D_}from"./index-CMTzNTew.js";import{H as bt,a as Gr,S as Va,B as Ue,x as Ji,K as R_,y as Zt,z as O_,A as Lt,M as yt,C as an,F as $_,G as Dn,J as zg,O as L_,Q as el,U as ye,V as Qe,W as P_,X as Qf,Y as Je,Z as cn,_ as On,$ as Et,a0 as Nt,a1 as ss,a2 as kr,a3 as F_,a4 as ch,a5 as tt,a6 as Ae,a7 as uh,a8 as fh,a9 as st,aa as Hg,ab as Bg,ac as U_,ad as z_,ae as H_,af as B_,ag as Ys,ah as Gs,ai as Xr,aj as $n,ak as Wg,al as W_,am as q_,an as Y_,ao as G_,ap as X_,aq as Bi,ar as Wi,as as K_,at as dh,au as ph,av as Z_,aw as Xs,ax as un,ay as on,az as qg,aA as V_,aB as Q_,aC as J_,aD as Yg,aE as Jf,aF as e2,aG as t2,aH as r2,aI as qi,aJ as ed,aK as n2,aL as td,aM as s2,aN as a2,aO as Gg,aP as Xg,aQ as rd,aR as o2,aS as i2,aT as l2,aU as Kg,aV as Zg,aW as c2,aX as u2,aY as hh,aZ as Vg,a_ as Qg,a$ as Jg,b0 as If,b1 as f2,b2 as d2,b3 as p2,b4 as e0,b5 as h2,b6 as m2,b7 as g2,b8 as t0,b9 as x2,ba as b2,bb as v2,bc as r0,bd as nd,be as w2,bf as sd,bg as y2,bh as _2,bi as n0,bj as k2,bk as s0,bl as M2,bm as j2,bn as E2}from"./settings-BeumESEN.js";import{a as T2,u as a0,b as o0}from"./newsletters-BexdXUhn.js";import{C as S2,a as N2}from"./index-Brg4tecQ.js";import{u as i0}from"./posts-CL9UDYoW.js";import{a as so,b as ad,c as A2,g as od}from"./tiers-nCGyTly9.js";import"./index-D212VvOz.js";function I2(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 l0=({children:e,...n})=>s.jsx("div",{className:"flex h-full w-full flex-col px-8",...n,children:s.jsx("div",{className:"h-full w-full overflow-hidden rounded-t-[4px] shadow-sm",children:e})}),c0=({children:e,...n})=>s.jsx("div",{className:"flex h-[775px] w-[380px] flex-col rounded-3xl bg-white p-2 shadow-xl dark:bg-grey-900",...n,children:s.jsx("div",{className:"w-100 h-100 grow overflow-auto rounded-2xl border border-grey-100 dark:border-grey-950",children:e})}),C2=({title:e,label:n,value:a,onChange:o,disabled:c,error:m,hint:y,checked:h,separator:l,testId:f})=>{const u=D.useId(),p=x=>{o(x===!0)};return s.jsxs("div",{children:[s.jsxs("div",{className:`flex flex-col gap-1 ${l&&"pb-2"}`,children:[e&&s.jsx(bt,{grey:!0,level:6,children:e}),s.jsxs("label",{className:`flex cursor-pointer items-start ${e&&"-mb-1 mt-1"}`,htmlFor:u,children:[s.jsx(S2,{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:h,disabled:c,id:u,value:a,onCheckedChange:p,children:s.jsx(N2,{children:s.jsx("svg",{fill:"none",height:"11",viewBox:"0 0 10 11",width:"10",children:s.jsx("path",{d:"M1 5.88889L4.6 9L9 1",stroke:"white",strokeLinecap:"round",strokeWidth:"2"})})})}),s.jsxs("div",{className:`ml-2 flex flex-col ${y&&"mb-2"}`,children:[s.jsx("span",{className:`inline-block text-[1.425rem] dark:text-white ${y&&"-mb-1"}`,children:n}),y&&s.jsx(Gr,{color:m?"red":"",children:y})]})]})]}),(l||m)&&s.jsx(Va,{className:m?"border-red":""})]})},Cf=({title:e,checkboxes:n,hint:a,error:o})=>s.jsxs("div",{children:[e&&s.jsx(bt,{grey:!0,level:6,children:e}),s.jsx("div",{className:"mt-2 flex flex-col gap-1",children:n?.map(({key:c,...m})=>s.jsx(C2,{...m},c))}),s.jsx("div",{className:`flex flex-col ${a&&"mb-2"}`,children:a&&s.jsx(Gr,{color:o?"red":"",children:a})})]}),D2=({hex:e,value:n,title:a,size:o="md",isSelected:c,onSelect:m})=>{const y=D.useRef(null),h=u=>{u.preventDefault(),m(n!==void 0?n: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 s.jsx("button",{ref:y,className:we("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:h,children:l&&s.jsx("div",{className:"absolute left-0 top-0 z-10 w-[136%] origin-left rotate-45 border-b border-b-red"})})},u0=({title:e,value:n,swatches:a,swatchSize:o="md",onSwatchChange:c,onTogglePicker:m,isExpanded:y,picker:h=!0,containerClassName:l})=>{const f=a.find(p=>p.value===n||p.hex===n);l=we("flex flex-col gap-3");const u=y||!h;return s.jsxs("div",{className:l,children:[e&&s.jsx(bt,{useLabelTag:!0,children:e}),s.jsxs("div",{className:"flex gap-1",children:[u&&s.jsx("div",{className:"flex items-center gap-1",children:a.map(({customContent:p,...x})=>p?s.jsx(D.Fragment,{children:p},x.title):s.jsx(D2,{isSelected:f?.title===x.title,size:o,onSelect:c,...x},x.title))}),h&&s.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:m,children:[s.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&&s.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"&&s.jsx("div",{className:"absolute left-[3px] top-[3px] z-10 w-[136%] origin-left rotate-45 border-b border-b-red"})}),!f&&n&&s.jsx("div",{className:"absolute inset-[3px] overflow-hidden rounded-full border border-white dark:border-grey-950",style:{backgroundColor:n},children:n==="transparent"&&s.jsx("div",{className:"absolute left-[3px] top-[3px] z-10 w-[136%] origin-left rotate-45 border-b border-b-red"})})]})]})]})};function Ks(){return(Ks=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(e[o]=a[o])}return e}).apply(this,arguments)}function tl(e,n){if(e==null)return{};var a,o,c={},m=Object.keys(e);for(o=0;o<m.length;o++)n.indexOf(a=m[o])>=0||(c[a]=e[a]);return c}function Qa(e){var n=D.useRef(e),a=D.useRef(function(o){n.current&&n.current(o)});return n.current=e,a.current}var Ja=function(e,n,a){return n===void 0&&(n=0),a===void 0&&(a=1),e>a?a:e<n?n:e},Xa=function(e){return"touches"in e},Df=function(e){return e&&e.ownerDocument.defaultView||self},mh=function(e,n,a){var o=e.getBoundingClientRect(),c=Xa(n)?(function(m,y){for(var h=0;h<m.length;h++)if(m[h].identifier===y)return m[h];return m[0]})(n.touches,a):n;return{left:Ja((c.pageX-(o.left+Df(e).pageXOffset))/o.width),top:Ja((c.pageY-(o.top+Df(e).pageYOffset))/o.height)}},gh=function(e){!Xa(e)&&e.preventDefault()},f0=at.memo(function(e){var n=e.onMove,a=e.onKey,o=tl(e,["onMove","onKey"]),c=D.useRef(null),m=Qa(n),y=Qa(a),h=D.useRef(null),l=D.useRef(!1),f=D.useMemo(function(){var v=function(M){gh(M),(Xa(M)?M.touches.length>0:M.buttons>0)&&c.current?m(mh(c.current,M,h.current)):k(!1)},_=function(){return k(!1)};function k(M){var T=l.current,A=Df(c.current),C=M?A.addEventListener:A.removeEventListener;C(T?"touchmove":"mousemove",v),C(T?"touchend":"mouseup",_)}return[function(M){var T=M.nativeEvent,A=c.current;if(A&&(gh(T),!(function(O,$){return $&&!Xa(O)})(T,l.current)&&A)){if(Xa(T)){l.current=!0;var C=T.changedTouches||[];C.length&&(h.current=C[0].identifier)}A.focus(),m(mh(A,T,h.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,m]),u=f[0],p=f[1],x=f[2];return D.useEffect(function(){return x},[x]),at.createElement("div",Ks({},o,{onTouchStart:u,onMouseDown:u,className:"react-colorful__interactive",ref:c,onKeyDown:p,tabIndex:0,role:"slider"}))}),id=function(e){return e.filter(Boolean).join(" ")},d0=function(e){var n=e.color,a=e.left,o=e.top,c=o===void 0?.5:o,m=id(["react-colorful__pointer",e.className]);return at.createElement("div",{className:m,style:{top:100*c+"%",left:100*a+"%"}},at.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:n}}))},Yt=function(e,n,a){return n===void 0&&(n=0),a===void 0&&(a=Math.pow(10,n)),Math.round(a*e)/a},R2=function(e){return F2(Rf(e))},Rf=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?Yt(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?Yt(parseInt(e.substring(6,8),16)/255,2):1}},O2=function(e){return P2(L2(e))},$2=function(e){var n=e.s,a=e.v,o=e.a,c=(200-n)*a/100;return{h:Yt(e.h),s:Yt(c>0&&c<200?n*a/100/(c<=100?c:200-c)*100:0),l:Yt(c/2),a:Yt(o,2)}},Of=function(e){var n=$2(e);return"hsl("+n.h+", "+n.s+"%, "+n.l+"%)"},L2=function(e){var n=e.h,a=e.s,o=e.v,c=e.a;n=n/360*6,a/=100,o/=100;var m=Math.floor(n),y=o*(1-a),h=o*(1-(n-m)*a),l=o*(1-(1-n+m)*a),f=m%6;return{r:Yt(255*[o,h,y,y,l,o][f]),g:Yt(255*[l,o,o,h,y,y][f]),b:Yt(255*[y,y,l,o,o,h][f]),a:Yt(c,2)}},Di=function(e){var n=e.toString(16);return n.length<2?"0"+n:n},P2=function(e){var n=e.r,a=e.g,o=e.b,c=e.a,m=c<1?Di(Yt(255*c)):"";return"#"+Di(n)+Di(a)+Di(o)+m},F2=function(e){var n=e.r,a=e.g,o=e.b,c=e.a,m=Math.max(n,a,o),y=m-Math.min(n,a,o),h=y?m===n?(a-o)/y:m===a?2+(o-n)/y:4+(n-a)/y:0;return{h:Yt(60*(h<0?h+6:h)),s:Yt(m?y/m*100:0),v:Yt(m/255*100),a:c}},U2=at.memo(function(e){var n=e.hue,a=e.onChange,o=id(["react-colorful__hue",e.className]);return at.createElement("div",{className:o},at.createElement(f0,{onMove:function(c){a({h:360*c.left})},onKey:function(c){a({h:Ja(n+360*c.left,0,360)})},"aria-label":"Hue","aria-valuenow":Yt(n),"aria-valuemax":"360","aria-valuemin":"0"},at.createElement(d0,{className:"react-colorful__hue-pointer",left:n/360,color:Of({h:n,s:100,v:100,a:1})})))}),z2=at.memo(function(e){var n=e.hsva,a=e.onChange,o={backgroundColor:Of({h:n.h,s:100,v:100,a:1})};return at.createElement("div",{className:"react-colorful__saturation",style:o},at.createElement(f0,{onMove:function(c){a({s:100*c.left,v:100-100*c.top})},onKey:function(c){a({s:Ja(n.s+100*c.left,0,100),v:Ja(n.v-100*c.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+Yt(n.s)+"%, Brightness "+Yt(n.v)+"%"},at.createElement(d0,{className:"react-colorful__saturation-pointer",top:1-n.v/100,left:n.s/100,color:Of(n)})))}),p0=function(e,n){if(e===n)return!0;for(var a in e)if(e[a]!==n[a])return!1;return!0},H2=function(e,n){return e.toLowerCase()===n.toLowerCase()||p0(Rf(e),Rf(n))};function B2(e,n,a){var o=Qa(a),c=D.useState(function(){return e.toHsva(n)}),m=c[0],y=c[1],h=D.useRef({color:n,hsva:m});D.useEffect(function(){if(!e.equal(n,h.current.color)){var f=e.toHsva(n);h.current={hsva:f,color:n},y(f)}},[n,e]),D.useEffect(function(){var f;p0(m,h.current.hsva)||e.equal(f=e.fromHsva(m),h.current.color)||(h.current={hsva:m,color:f},o(f))},[m,e,o]);var l=D.useCallback(function(f){y(function(u){return Object.assign({},u,f)})},[]);return[m,l]}var W2=typeof window<"u"?D.useLayoutEffect:D.useEffect,q2=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},xh=new Map,Y2=function(e){W2(function(){var n=e.current?e.current.ownerDocument:document;if(n!==void 0&&!xh.has(n)){var a=n.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}`,xh.set(n,a);var o=q2();o&&a.setAttribute("nonce",o),n.head.appendChild(a)}},[])},G2=function(e){var n=e.className,a=e.colorModel,o=e.color,c=o===void 0?a.defaultColor:o,m=e.onChange,y=tl(e,["className","colorModel","color","onChange"]),h=D.useRef(null);Y2(h);var l=B2(a,c,m),f=l[0],u=l[1],p=id(["react-colorful",n]);return at.createElement("div",Ks({},y,{ref:h,className:p}),at.createElement(z2,{hsva:f,onChange:u}),at.createElement(U2,{hue:f.h,onChange:u,className:"react-colorful__last-control"}))},X2={defaultColor:"000",toHsva:R2,fromHsva:function(e){return O2({h:e.h,s:e.s,v:e.v,a:1})},equal:H2},K2=function(e){return at.createElement(G2,Ks({},e,{colorModel:X2}))},Z2=/^#?([0-9A-F]{3,8})$/i,V2=function(e){var n=e.color,a=n===void 0?"":n,o=e.onChange,c=e.onBlur,m=e.escape,y=e.validate,h=e.format,l=e.process,f=tl(e,["color","onChange","onBlur","escape","validate","format","process"]),u=D.useState(function(){return m(a)}),p=u[0],x=u[1],v=Qa(o),_=Qa(c),k=D.useCallback(function(T){var A=m(T.target.value);x(A),y(A)&&v(l?l(A):A)},[m,l,y,v]),M=D.useCallback(function(T){y(T.target.value)||x(m(a)),_(T)},[a,m,y,_]);return D.useEffect(function(){x(m(a))},[a,m]),at.createElement("input",Ks({},f,{value:h?h(p):p,spellCheck:"false",onChange:k,onBlur:M}))},bh=function(e){return"#"+e},Q2=function(e){var n=e.prefixed,a=e.alpha,o=tl(e,["prefixed","alpha"]),c=D.useCallback(function(y){return y.replace(/([^0-9A-F]+)/gi,"").substring(0,a?8:6)},[a]),m=D.useCallback(function(y){return(function(h,l){var f=Z2.exec(h),u=f?f[1].length:0;return u===3||u===6||!!l&&u===4||!!l&&u===8})(y,a)},[a]);return at.createElement(V2,Ks({},o,{escape:c,format:n?bh:void 0,process:bh,validate:m}))};const J2=({hexValue:e,eyedropper:n,clearButtonValue:a,containerClassName:o,onChange:c})=>{const m=D.useRef(null),y=D.useCallback(x=>{var v,_,k;x.stopPropagation();const M=(v=m.current)==null?void 0:v.querySelector("input");x.target!==M&&((k=(_=m.current)==null?void 0:_.querySelector("input"))==null||k.focus(),x.preventDefault())},[]),h=D.useRef(!1),l=D.useCallback(()=>{var x,v;h.current=!1,(v=(x=m.current)==null?void 0:x.querySelector("input"))==null||v.focus(),document.removeEventListener("mouseup",l),document.removeEventListener("touchend",l)},[]),f=D.useCallback(()=>{h.current=!0,document.addEventListener("mouseup",l),document.addEventListener("touchend",l)},[l]),u=D.useCallback(x=>{if(x.preventDefault(),!window.EyeDropper)return;h.current=!0,document.body.style.setProperty("pointer-events","none"),new window.EyeDropper().open().then(_=>c?.(_.sRGBHex)).finally(()=>{var _,k;h.current=!1,document.body.style.removeProperty("pointer-events"),(k=(_=m.current)==null?void 0:_.querySelector("input"))==null||k.focus()})},[c]);D.useEffect(()=>{var x,v;(v=(x=m.current)==null?void 0:x.querySelector("input"))==null||v.focus()},[]);const p=D.useCallback(()=>{var x,v;(v=(x=m.current)==null?void 0:x.querySelector("input"))==null||v.focus()},[]);return o=we("mt-2",o),s.jsxs("div",{className:o,onMouseDown:y,onTouchStart:y,children:[s.jsx(K2,{className:"w-full",color:e||"#ffffff",onChange:c,onMouseDown:f,onTouchStart:f}),s.jsxs("div",{className:"mt-3 flex gap-2",children:[s.jsxs("div",{ref:m,className:"peer relative order-2 flex h-10 w-full items-center",onClick:p,children:[s.jsx("span",{className:"absolute left-2 top-[9px] z-10 ml-1 mr-2 text-grey-700",children:"#"}),s.jsx(Q2,{"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}),n&&!!window.EyeDropper&&s.jsx("button",{className:"absolute inset-y-0 right-3 z-50 my-auto h-4 w-4 p-[1px]",type:"button",onClick:u,children:s.jsx(i_,{className:"h-full w-full"})})]}),a!==void 0&&s.jsx(Ue,{color:"grey",value:"Clear",onClick:()=>c?.(a)})]})]})},e3=D.createContext({colorPickers:[]}),vh=e=>e.length===4?e.replace(/#(.)(.)(.)/,"#$1$1$2$2$3$3"):e,Yr=({testId:e,title:n,direction:a,value:o,hint:c,error:m,eyedropper:y,clearButtonValue:h,onChange:l,swatches:f=[],alwaysOpen:u=!1,debounceMs:p})=>{const[x,v]=D.useState(!1),[_,k]=D.useState(o),M=D.useContext(e3),T=D.useId();D.useEffect(()=>{k(W=>vh(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(x){M.colorPickers.filter(R=>R.id!==T).forEach(R=>R.setExpanded(!1));const W=()=>{v(!1)};return document.addEventListener("click",W),()=>{document.removeEventListener("click",W)}}},[M,T,x]);const A=D.useMemo(()=>l&&p?Ji(l,p):l,[p,l]),C=W=>{k(W),A?.(W?vh(W):null)};let O=s.jsx(u0,{isExpanded:x,swatches:f,value:_,onSwatchChange:W=>{C(W),v(!1)},onTogglePicker:()=>!u&&v(!x)});n&&(O=s.jsxs("div",{className:we("flex w-full cursor-pointer items-start first:mt-0 dark:text-white",a==="rtl"&&"flex-row-reverse"),children:[s.jsx("div",{className:"shrink-0",children:O}),s.jsxs("div",{className:we("flex-1",a==="rtl"?"pr-2":"pl-2",c?"mt-[-2px]":"mt-[1px]"),onClick:()=>!u&&v(!x),children:[n,c&&s.jsx("div",{className:`text-xs ${m?"text-red":"text-grey-700"}`,children:c})]})]}));const $=f.find(W=>W.value===_);return s.jsxs("div",{className:"flex-col","data-testid":e,onClick:W=>W.stopPropagation(),children:[O,(u||x)&&s.jsx(J2,{clearButtonValue:h,eyedropper:y,hexValue:$?.hex||_||void 0,onChange:C})]})},t3=({value:e,onChange:n,singleParagraph:a=!0,...o})=>{const c=D.useCallback(m=>{const h=new DOMParser().parseFromString(m,"text/html");h.querySelectorAll("*").forEach(f=>{f.style.removeProperty("white-space"),f.getAttribute("style")||f.removeAttribute("style")}),h.body.innerHTML!==e&&n?.(h.body.innerHTML)},[e,n]);return s.jsx(R_,{...o,singleParagraph:a,children:m=>s.jsx(m.HtmlOutputPlugin,{html:e,setHtml:c})})},ld=({title:e,hideTitle:n,error:a,hint:o,value:c,clearBg:m=!1,className:y="",containerClassName:h="",hintClassName:l="",unstyled:f=!1,...u})=>{const p=f?"":we("flex min-h-[32px] items-center rounded-md border border-transparent py-1.5 md:min-h-[36px]",m?"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&&!n&&!m&&"mt-2",y);return s.jsxs("div",{className:`flex flex-col ${h}`,children:[e&&s.jsx(bt,{className:n?"sr-only":"",grey:!0,useLabelTag:!0,children:e}),s.jsx("div",{className:p,children:s.jsx(t3,{...u,value:c})}),o&&s.jsx(Gr,{className:l,color:a?"red":"",children:o})]})};var cd="Radio",[r3,h0]=Lg(cd),[n3,s3]=r3(cd),m0=D.forwardRef((e,n)=>{const{__scopeRadio:a,name:o,checked:c=!1,required:m,disabled:y,value:h="on",onCheck:l,form:f,...u}=e,[p,x]=D.useState(null),v=Kf(n,M=>x(M)),_=D.useRef(!1),k=p?f||!!p.closest("form"):!0;return s.jsxs(n3,{scope:a,checked:c,disabled:y,children:[s.jsx(Vi.button,{type:"button",role:"radio","aria-checked":c,"data-state":v0(c),"data-disabled":y?"":void 0,disabled:y,value:h,...u,ref:v,onClick:Sf(e.onClick,M=>{c||l?.(),k&&(_.current=M.isPropagationStopped(),_.current||M.stopPropagation())})}),k&&s.jsx(b0,{control:p,bubbles:!_.current,name:o,value:h,checked:c,required:m,disabled:y,form:f,style:{transform:"translateX(-100%)"}})]})});m0.displayName=cd;var g0="RadioIndicator",x0=D.forwardRef((e,n)=>{const{__scopeRadio:a,forceMount:o,...c}=e,m=s3(g0,a);return s.jsx(d_,{present:o||m.checked,children:s.jsx(Vi.span,{"data-state":v0(m.checked),"data-disabled":m.disabled?"":void 0,...c,ref:n})})});x0.displayName=g0;var a3="RadioBubbleInput",b0=D.forwardRef(({__scopeRadio:e,control:n,checked:a,bubbles:o=!0,...c},m)=>{const y=D.useRef(null),h=Kf(y,m),l=p_(a),f=h_(n);return D.useEffect(()=>{const u=y.current;if(!u)return;const p=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(p,"checked").set;if(l!==a&&v){const _=new Event("click",{bubbles:o});v.call(u,a),u.dispatchEvent(_)}},[l,a,o]),s.jsx(Vi.input,{type:"radio","aria-hidden":!0,defaultChecked:a,...c,tabIndex:-1,ref:h,style:{...c.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});b0.displayName=a3;function v0(e){return e?"checked":"unchecked"}var o3=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],rl="RadioGroup",[i3]=Lg(rl,[$g,h0]),w0=$g(),y0=h0(),[l3,c3]=i3(rl),_0=D.forwardRef((e,n)=>{const{__scopeRadioGroup:a,name:o,defaultValue:c,value:m,required:y=!1,disabled:h=!1,orientation:l,dir:f,loop:u=!0,onValueChange:p,...x}=e,v=w0(a),_=l_(f),[k,M]=c_({prop:m,defaultProp:c??null,onChange:p,caller:rl});return s.jsx(l3,{scope:a,name:o,required:y,disabled:h,value:k,onValueChange:M,children:s.jsx(u_,{asChild:!0,...v,orientation:l,dir:_,loop:u,children:s.jsx(Vi.div,{role:"radiogroup","aria-required":y,"aria-orientation":l,"data-disabled":h?"":void 0,dir:_,...x,ref:n})})})});_0.displayName=rl;var k0="RadioGroupItem",M0=D.forwardRef((e,n)=>{const{__scopeRadioGroup:a,disabled:o,...c}=e,m=c3(k0,a),y=m.disabled||o,h=w0(a),l=y0(a),f=D.useRef(null),u=Kf(n,f),p=m.value===c.value,x=D.useRef(!1);return D.useEffect(()=>{const v=k=>{o3.includes(k.key)&&(x.current=!0)},_=()=>x.current=!1;return document.addEventListener("keydown",v),document.addEventListener("keyup",_),()=>{document.removeEventListener("keydown",v),document.removeEventListener("keyup",_)}},[]),s.jsx(f_,{asChild:!0,...h,focusable:!y,active:p,children:s.jsx(m0,{disabled:y,required:m.required,checked:p,...l,...c,name:m.name,ref:u,onCheck:()=>m.onValueChange(c.value),onKeyDown:Sf(v=>{v.key==="Enter"&&v.preventDefault()}),onFocus:Sf(c.onFocus,()=>{x.current&&f.current?.click()})})})});M0.displayName=k0;var u3="RadioGroupIndicator",j0=D.forwardRef((e,n)=>{const{__scopeRadioGroup:a,...o}=e,c=y0(a);return s.jsx(x0,{...c,...o,ref:n})});j0.displayName=u3;var f3=_0,d3=M0,p3=j0;const h3=({id:e,title:n,options:a,onSelect:o,error:c,hint:m,selectedOption:y,separator:h})=>s.jsxs(f3,{defaultValue:y,name:e,onValueChange:o,children:[s.jsxs("div",{className:`flex flex-col gap-2 ${h&&"pb-2"}`,children:[n&&s.jsx(bt,{level:6,children:n}),a.map(l=>s.jsxs("label",{className:`flex cursor-pointer items-start ${n&&"-mb-1 mt-1"}`,htmlFor:l.value,children:[s.jsx(d3,{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:s.jsx(p3,{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"})}),s.jsxs("div",{className:`ml-2 flex flex-col ${l.hint&&"mb-2"}`,children:[s.jsx("span",{className:`inline-block text-md dark:text-white ${l.hint&&"-mb-1"}`,children:l.label}),l.hint&&s.jsx(Gr,{children:l.hint})]})]},l.value)),m&&s.jsx(Gr,{color:c?"red":"",children:m})]}),(h||c)&&s.jsx(Va,{className:c?"border-red":""})]}),Yi=({children:e,gap:n="md",className:a})=>{let o="gap-3";switch(n){case"sm":o="gap-2";break;case"md":o="gap-3";break;case"lg":o="gap-4";break}return a=we("flex flex-col",o,a),s.jsx("div",{className:a,children:e})},ud=({heading:e,children:n,className:a})=>(a=we("w-full p-[8vmin] pt-5",a),s.jsxs("div",{className:a,children:[e&&s.jsx(bt,{className:"mb-8",children:e}),n]})),fd=({items:e,backIcon:n=!1,snapBackIcon:a=!0,onBack:o,containerClassName:c,itemClassName:m,activeItemClassName:y,separatorClassName:h})=>{const l=e.length;let f=0;return c=we("flex items-center gap-2 text-sm",c),y=we("font-bold",y),m=we("text-sm",m),s.jsxs("div",{className:c,children:[n&&s.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 p=f===l-1?s.jsx("span",{className:y,children:u.label}):s.jsxs(s.Fragment,{children:[s.jsx("button",{className:`${m} ${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}`),s.jsx("span",{className:h,children:"/"})]});return f=f+1,p})]})},Zs=({testId:e,title:n,titleHeadingLevel:a=4,size:o="full",width:c,height:m,sidebar:y="",preview:h,dirty:l=!1,cancelLabel:f="Cancel",okLabel:u="OK",okColor:p="black",previewToolbar:x=!0,leftToolbar:v=!0,rightToolbar:_=!0,deviceSelector:k=!0,siteLink:M,previewToolbarURLs:T,previewBgColor:A="grey",selectedURL:C,previewToolbarTabs:O,previewToolbarBreadcrumbs:$,buttonsDisabled:W,sidebarButtons:R,sidebarHeader:Z,sidebarPadding:X=!0,sidebarContentClasses:q,enableCMDS:B=!0,backDropClick:Y,onCancel:ae,onOk:ee,afterClose:re,onSelectURL:Q,onSelectDesktopView:ne,onSelectMobileView:be,onBreadcrumbsBack:je})=>{const H=Zt(),{setGlobalDirtyState:he}=O_();D.useEffect(()=>{he(l)},[l,he]),D.useEffect(()=>{if(ee){const J=xe=>{(xe.metaKey||xe.ctrlKey)&&xe.key==="s"&&(xe.preventDefault(),ee())};if(B)return window.addEventListener("keydown",J),()=>{window.removeEventListener("keydown",J)}}});const[ge,F]=D.useState("desktop");if(ge==="mobile"&&k?h=s.jsx(c0,{"data-testid":"preview-mobile",children:h}):ge==="desktop"&&k&&(h=s.jsx(l0,{"data-testid":"preview-desktop",children:h})),x){let J=s.jsx(s.Fragment,{});T?J=s.jsx(Lt,{options:T,selectedOption:T.find(Ie=>Ie.value===C),onSelect:Ie=>Ie&&Q?.(Ie.value)}):O?J=s.jsx(Dn,{border:!1,selectedTab:C,tabs:O,width:"wide",onTabChange:Q}):$&&(J=s.jsx(fd,{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:je}));const xe="text-black dark:text-green",Te="text-grey-500 dark:text-grey-600",De=[{icon:"laptop",label:"Desktop",hideLabel:!0,link:!0,size:"sm",iconColorClass:ge==="desktop"?xe:Te,onClick:ne||(()=>{F("desktop")})},{icon:"mobile",label:"Mobile",hideLabel:!0,link:!0,size:"sm",iconColorClass:ge==="mobile"?xe:Te,onClick:be||(()=>{F("mobile")})}],Me=k&&s.jsx(an,{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 Ee=we("min-w-100 absolute inset-y-0 left-0 right-[400px] flex w-full grow flex-col overflow-y-auto",oe);let Ne;M&&(Ne=s.jsx("div",{className:"ml-3 border-l border-grey-400 dark:border-grey-800",children:s.jsxs("a",{className:"ml-3 flex items-center gap-1 text-sm",href:M,rel:"noopener noreferrer",target:"_blank",children:["View site ",s.jsx(ut,{name:"arrow-top-right",size:"xs"})]})})),h=s.jsxs("div",{className:Ee,children:[x&&s.jsxs("header",{className:"relative flex h-[80px] shrink-0 items-center justify-center px-8 py-5","data-testid":"design-toolbar",children:[v&&s.jsx("div",{className:"absolute left-8 flex h-full items-center",children:J}),_&&s.jsxs("div",{className:"absolute right-8 flex h-full items-center",children:[Me,Ne]})]}),s.jsx("div",{className:"flex grow items-center justify-center text-sm text-grey-400",children:h})]})}const L=[];return R||(L.push({key:"cancel-modal",label:f,onClick:ae||(()=>{$_(l,()=>{H.remove(),re?.()})}),disabled:W}),L.push({key:"ok-modal",label:u,color:p,onClick:ee,disabled:W})),s.jsx(yt,{afterClose:re,animate:!1,backDropClick:Y,dirty:l,footer:!1,height:m,padding:!1,size:o,testId:e,title:"",width:c,hideXOnMobile:!0,children:s.jsxs("div",{className:"flex h-full grow",children:[s.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:h}),y&&s.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:[Z||s.jsxs("div",{className:"flex max-h-[82px] items-center justify-between gap-3 px-7 py-6",children:[s.jsx(bt,{level:a,children:n}),R||s.jsx(an,{buttons:L})]}),s.jsx("div",{className:`${Z?"":"absolute inset-x-0 bottom-0 top-[80px] grow"} ${X&&"p-7 pt-0"} flex flex-col justify-between overflow-y-auto ${q&&q}`,children:y})]})]})})},m3=({offset:e,onTrigger:n})=>{const a=D.useRef(null);return D.useEffect(()=>{const o=new IntersectionObserver(c=>{c[0].intersectionRatio<=0||n()});return a.current&&o.observe(a.current),()=>o.disconnect()},[n]),s.jsx("div",{ref:a,className:"absolute w-full",style:{bottom:e}})},E0=({trigger:e,triggerButtonProps:n,items:a,position:o="start",open:c,setOpen:m})=>(e||(e=s.jsx(Ue,{icon:"ellipsis",label:"Menu",hideLabel:!0,...n})),s.jsx(zg,{open:c,position:o,setOpen:m,trigger:e,closeOnItemClick:!0,children:s.jsx("div",{className:"flex min-w-[160px] flex-col justify-stretch py-1",role:"none",children:a.map(y=>s.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:h=>{y.onClick&&y.onClick(h)},children:y.label},y.id))})}));var T0=typeof global=="object"&&global&&global.Object===Object&&global,g3=typeof self=="object"&&self&&self.Object===Object&&self,fn=T0||g3||Function("return this")(),qs=fn.Symbol,S0=Object.prototype,x3=S0.hasOwnProperty,b3=S0.toString,Ba=qs?qs.toStringTag:void 0;function v3(e){var n=x3.call(e,Ba),a=e[Ba];try{e[Ba]=void 0;var o=!0}catch{}var c=b3.call(e);return o&&(n?e[Ba]=a:delete e[Ba]),c}var w3=Object.prototype,y3=w3.toString;function _3(e){return y3.call(e)}var k3="[object Null]",M3="[object Undefined]",wh=qs?qs.toStringTag:void 0;function ao(e){return e==null?e===void 0?M3:k3:wh&&wh in Object(e)?v3(e):_3(e)}function eo(e){return e!=null&&typeof e=="object"}var Gi=Array.isArray;function N0(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}var j3="[object AsyncFunction]",E3="[object Function]",T3="[object GeneratorFunction]",S3="[object Proxy]";function A0(e){if(!N0(e))return!1;var n=ao(e);return n==E3||n==T3||n==j3||n==S3}var ru=fn["__core-js_shared__"],yh=(function(){var e=/[^.]+$/.exec(ru&&ru.keys&&ru.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function N3(e){return!!yh&&yh in e}var A3=Function.prototype,I3=A3.toString;function as(e){if(e!=null){try{return I3.call(e)}catch{}try{return e+""}catch{}}return""}var C3=/[\\^$.*+?()[\]{}|]/g,D3=/^\[object .+?Constructor\]$/,R3=Function.prototype,O3=Object.prototype,$3=R3.toString,L3=O3.hasOwnProperty,P3=RegExp("^"+$3.call(L3).replace(C3,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function F3(e){if(!N0(e)||N3(e))return!1;var n=A0(e)?P3:D3;return n.test(as(e))}function U3(e,n){return e?.[n]}function Vs(e,n){var a=U3(e,n);return F3(a)?a:void 0}var $f=Vs(fn,"WeakMap"),z3=9007199254740991,H3=/^(?:0|[1-9]\d*)$/;function B3(e,n){var a=typeof e;return n=n??z3,!!n&&(a=="number"||a!="symbol"&&H3.test(e))&&e>-1&&e%1==0&&e<n}function I0(e,n){return e===n||e!==e&&n!==n}var W3=9007199254740991;function C0(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=W3}function q3(e){return e!=null&&C0(e.length)&&!A0(e)}var Y3=Object.prototype;function G3(e){var n=e&&e.constructor,a=typeof n=="function"&&n.prototype||Y3;return e===a}function X3(e,n){for(var a=-1,o=Array(e);++a<e;)o[a]=n(a);return o}var K3="[object Arguments]";function _h(e){return eo(e)&&ao(e)==K3}var D0=Object.prototype,Z3=D0.hasOwnProperty,V3=D0.propertyIsEnumerable,Q3=_h((function(){return arguments})())?_h:function(e){return eo(e)&&Z3.call(e,"callee")&&!V3.call(e,"callee")};function J3(){return!1}var R0=typeof exports=="object"&&exports&&!exports.nodeType&&exports,kh=R0&&typeof module=="object"&&module&&!module.nodeType&&module,e8=kh&&kh.exports===R0,Mh=e8?fn.Buffer:void 0,t8=Mh?Mh.isBuffer:void 0,Lf=t8||J3,r8="[object Arguments]",n8="[object Array]",s8="[object Boolean]",a8="[object Date]",o8="[object Error]",i8="[object Function]",l8="[object Map]",c8="[object Number]",u8="[object Object]",f8="[object RegExp]",d8="[object Set]",p8="[object String]",h8="[object WeakMap]",m8="[object ArrayBuffer]",g8="[object DataView]",x8="[object Float32Array]",b8="[object Float64Array]",v8="[object Int8Array]",w8="[object Int16Array]",y8="[object Int32Array]",_8="[object Uint8Array]",k8="[object Uint8ClampedArray]",M8="[object Uint16Array]",j8="[object Uint32Array]",wt={};wt[x8]=wt[b8]=wt[v8]=wt[w8]=wt[y8]=wt[_8]=wt[k8]=wt[M8]=wt[j8]=!0;wt[r8]=wt[n8]=wt[m8]=wt[s8]=wt[g8]=wt[a8]=wt[o8]=wt[i8]=wt[l8]=wt[c8]=wt[u8]=wt[f8]=wt[d8]=wt[p8]=wt[h8]=!1;function E8(e){return eo(e)&&C0(e.length)&&!!wt[ao(e)]}function T8(e){return function(n){return e(n)}}var O0=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ka=O0&&typeof module=="object"&&module&&!module.nodeType&&module,S8=Ka&&Ka.exports===O0,nu=S8&&T0.process,jh=(function(){try{var e=Ka&&Ka.require&&Ka.require("util").types;return e||nu&&nu.binding&&nu.binding("util")}catch{}})(),Eh=jh&&jh.isTypedArray,$0=Eh?T8(Eh):E8,N8=Object.prototype,A8=N8.hasOwnProperty;function I8(e,n){var a=Gi(e),o=!a&&Q3(e),c=!a&&!o&&Lf(e),m=!a&&!o&&!c&&$0(e),y=a||o||c||m,h=y?X3(e.length,String):[],l=h.length;for(var f in e)A8.call(e,f)&&!(y&&(f=="length"||c&&(f=="offset"||f=="parent")||m&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||B3(f,l)))&&h.push(f);return h}function C8(e,n){return function(a){return e(n(a))}}var D8=C8(Object.keys,Object),R8=Object.prototype,O8=R8.hasOwnProperty;function $8(e){if(!G3(e))return D8(e);var n=[];for(var a in Object(e))O8.call(e,a)&&a!="constructor"&&n.push(a);return n}function L8(e){return q3(e)?I8(e):$8(e)}var to=Vs(Object,"create");function P8(){this.__data__=to?to(null):{},this.size=0}function F8(e){var n=this.has(e)&&delete this.__data__[e];return this.size-=n?1:0,n}var U8="__lodash_hash_undefined__",z8=Object.prototype,H8=z8.hasOwnProperty;function B8(e){var n=this.__data__;if(to){var a=n[e];return a===U8?void 0:a}return H8.call(n,e)?n[e]:void 0}var W8=Object.prototype,q8=W8.hasOwnProperty;function Y8(e){var n=this.__data__;return to?n[e]!==void 0:q8.call(n,e)}var G8="__lodash_hash_undefined__";function X8(e,n){var a=this.__data__;return this.size+=this.has(e)?0:1,a[e]=to&&n===void 0?G8:n,this}function rs(e){var n=-1,a=e==null?0:e.length;for(this.clear();++n<a;){var o=e[n];this.set(o[0],o[1])}}rs.prototype.clear=P8;rs.prototype.delete=F8;rs.prototype.get=B8;rs.prototype.has=Y8;rs.prototype.set=X8;function K8(){this.__data__=[],this.size=0}function nl(e,n){for(var a=e.length;a--;)if(I0(e[a][0],n))return a;return-1}var Z8=Array.prototype,V8=Z8.splice;function Q8(e){var n=this.__data__,a=nl(n,e);if(a<0)return!1;var o=n.length-1;return a==o?n.pop():V8.call(n,a,1),--this.size,!0}function J8(e){var n=this.__data__,a=nl(n,e);return a<0?void 0:n[a][1]}function ek(e){return nl(this.__data__,e)>-1}function tk(e,n){var a=this.__data__,o=nl(a,e);return o<0?(++this.size,a.push([e,n])):a[o][1]=n,this}function dn(e){var n=-1,a=e==null?0:e.length;for(this.clear();++n<a;){var o=e[n];this.set(o[0],o[1])}}dn.prototype.clear=K8;dn.prototype.delete=Q8;dn.prototype.get=J8;dn.prototype.has=ek;dn.prototype.set=tk;var ro=Vs(fn,"Map");function rk(){this.size=0,this.__data__={hash:new rs,map:new(ro||dn),string:new rs}}function nk(e){var n=typeof e;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?e!=="__proto__":e===null}function sl(e,n){var a=e.__data__;return nk(n)?a[typeof n=="string"?"string":"hash"]:a.map}function sk(e){var n=sl(this,e).delete(e);return this.size-=n?1:0,n}function ak(e){return sl(this,e).get(e)}function ok(e){return sl(this,e).has(e)}function ik(e,n){var a=sl(this,e),o=a.size;return a.set(e,n),this.size+=a.size==o?0:1,this}function os(e){var n=-1,a=e==null?0:e.length;for(this.clear();++n<a;){var o=e[n];this.set(o[0],o[1])}}os.prototype.clear=rk;os.prototype.delete=sk;os.prototype.get=ak;os.prototype.has=ok;os.prototype.set=ik;function lk(e,n){for(var a=-1,o=n.length,c=e.length;++a<o;)e[c+a]=n[a];return e}function ck(){this.__data__=new dn,this.size=0}function uk(e){var n=this.__data__,a=n.delete(e);return this.size=n.size,a}function fk(e){return this.__data__.get(e)}function dk(e){return this.__data__.has(e)}var pk=200;function hk(e,n){var a=this.__data__;if(a instanceof dn){var o=a.__data__;if(!ro||o.length<pk-1)return o.push([e,n]),this.size=++a.size,this;a=this.__data__=new os(o)}return a.set(e,n),this.size=a.size,this}function Cn(e){var n=this.__data__=new dn(e);this.size=n.size}Cn.prototype.clear=ck;Cn.prototype.delete=uk;Cn.prototype.get=fk;Cn.prototype.has=dk;Cn.prototype.set=hk;function mk(e,n){for(var a=-1,o=e==null?0:e.length,c=0,m=[];++a<o;){var y=e[a];n(y,a,e)&&(m[c++]=y)}return m}function gk(){return[]}var xk=Object.prototype,bk=xk.propertyIsEnumerable,Th=Object.getOwnPropertySymbols,vk=Th?function(e){return e==null?[]:(e=Object(e),mk(Th(e),function(n){return bk.call(e,n)}))}:gk;function wk(e,n,a){var o=n(e);return Gi(e)?o:lk(o,a(e))}function Sh(e){return wk(e,L8,vk)}var Pf=Vs(fn,"DataView"),Ff=Vs(fn,"Promise"),Uf=Vs(fn,"Set"),Nh="[object Map]",yk="[object Object]",Ah="[object Promise]",Ih="[object Set]",Ch="[object WeakMap]",Dh="[object DataView]",_k=as(Pf),kk=as(ro),Mk=as(Ff),jk=as(Uf),Ek=as($f),In=ao;(Pf&&In(new Pf(new ArrayBuffer(1)))!=Dh||ro&&In(new ro)!=Nh||Ff&&In(Ff.resolve())!=Ah||Uf&&In(new Uf)!=Ih||$f&&In(new $f)!=Ch)&&(In=function(e){var n=ao(e),a=n==yk?e.constructor:void 0,o=a?as(a):"";if(o)switch(o){case _k:return Dh;case kk:return Nh;case Mk:return Ah;case jk:return Ih;case Ek:return Ch}return n});var Rh=fn.Uint8Array,Tk="__lodash_hash_undefined__";function Sk(e){return this.__data__.set(e,Tk),this}function Nk(e){return this.__data__.has(e)}function Xi(e){var n=-1,a=e==null?0:e.length;for(this.__data__=new os;++n<a;)this.add(e[n])}Xi.prototype.add=Xi.prototype.push=Sk;Xi.prototype.has=Nk;function Ak(e,n){for(var a=-1,o=e==null?0:e.length;++a<o;)if(n(e[a],a,e))return!0;return!1}function Ik(e,n){return e.has(n)}var Ck=1,Dk=2;function L0(e,n,a,o,c,m){var y=a&Ck,h=e.length,l=n.length;if(h!=l&&!(y&&l>h))return!1;var f=m.get(e),u=m.get(n);if(f&&u)return f==n&&u==e;var p=-1,x=!0,v=a&Dk?new Xi:void 0;for(m.set(e,n),m.set(n,e);++p<h;){var _=e[p],k=n[p];if(o)var M=y?o(k,_,p,n,e,m):o(_,k,p,e,n,m);if(M!==void 0){if(M)continue;x=!1;break}if(v){if(!Ak(n,function(T,A){if(!Ik(v,A)&&(_===T||c(_,T,a,o,m)))return v.push(A)})){x=!1;break}}else if(!(_===k||c(_,k,a,o,m))){x=!1;break}}return m.delete(e),m.delete(n),x}function Rk(e){var n=-1,a=Array(e.size);return e.forEach(function(o,c){a[++n]=[c,o]}),a}function Ok(e){var n=-1,a=Array(e.size);return e.forEach(function(o){a[++n]=o}),a}var $k=1,Lk=2,Pk="[object Boolean]",Fk="[object Date]",Uk="[object Error]",zk="[object Map]",Hk="[object Number]",Bk="[object RegExp]",Wk="[object Set]",qk="[object String]",Yk="[object Symbol]",Gk="[object ArrayBuffer]",Xk="[object DataView]",Oh=qs?qs.prototype:void 0,su=Oh?Oh.valueOf:void 0;function Kk(e,n,a,o,c,m,y){switch(a){case Xk:if(e.byteLength!=n.byteLength||e.byteOffset!=n.byteOffset)return!1;e=e.buffer,n=n.buffer;case Gk:return!(e.byteLength!=n.byteLength||!m(new Rh(e),new Rh(n)));case Pk:case Fk:case Hk:return I0(+e,+n);case Uk:return e.name==n.name&&e.message==n.message;case Bk:case qk:return e==n+"";case zk:var h=Rk;case Wk:var l=o&$k;if(h||(h=Ok),e.size!=n.size&&!l)return!1;var f=y.get(e);if(f)return f==n;o|=Lk,y.set(e,n);var u=L0(h(e),h(n),o,c,m,y);return y.delete(e),u;case Yk:if(su)return su.call(e)==su.call(n)}return!1}var Zk=1,Vk=Object.prototype,Qk=Vk.hasOwnProperty;function Jk(e,n,a,o,c,m){var y=a&Zk,h=Sh(e),l=h.length,f=Sh(n),u=f.length;if(l!=u&&!y)return!1;for(var p=l;p--;){var x=h[p];if(!(y?x in n:Qk.call(n,x)))return!1}var v=m.get(e),_=m.get(n);if(v&&_)return v==n&&_==e;var k=!0;m.set(e,n),m.set(n,e);for(var M=y;++p<l;){x=h[p];var T=e[x],A=n[x];if(o)var C=y?o(A,T,x,n,e,m):o(T,A,x,e,n,m);if(!(C===void 0?T===A||c(T,A,a,o,m):C)){k=!1;break}M||(M=x=="constructor")}if(k&&!M){var O=e.constructor,$=n.constructor;O!=$&&"constructor"in e&&"constructor"in n&&!(typeof O=="function"&&O instanceof O&&typeof $=="function"&&$ instanceof $)&&(k=!1)}return m.delete(e),m.delete(n),k}var eM=1,$h="[object Arguments]",Lh="[object Array]",Ri="[object Object]",tM=Object.prototype,Ph=tM.hasOwnProperty;function rM(e,n,a,o,c,m){var y=Gi(e),h=Gi(n),l=y?Lh:In(e),f=h?Lh:In(n);l=l==$h?Ri:l,f=f==$h?Ri:f;var u=l==Ri,p=f==Ri,x=l==f;if(x&&Lf(e)){if(!Lf(n))return!1;y=!0,u=!1}if(x&&!u)return m||(m=new Cn),y||$0(e)?L0(e,n,a,o,c,m):Kk(e,n,l,a,o,c,m);if(!(a&eM)){var v=u&&Ph.call(e,"__wrapped__"),_=p&&Ph.call(n,"__wrapped__");if(v||_){var k=v?e.value():e,M=_?n.value():n;return m||(m=new Cn),c(k,M,a,o,m)}}return x?(m||(m=new Cn),Jk(e,n,a,o,c,m)):!1}function P0(e,n,a,o,c){return e===n?!0:e==null||n==null||!eo(e)&&!eo(n)?e!==e&&n!==n:rM(e,n,a,o,P0,c)}function nM(e,n){return P0(e,n)}const Fh=({className:e,children:n,colSpan:a,sticky:o=!1,...c})=>{const m=we("!py-2 !pl-0 !pr-6 text-left align-top",o&&"sticky top-0 bg-white",c.onClick&&"hover:cursor-pointer",e);return s.jsx("th",{className:m,colSpan:a,...c,children:s.jsx(bt,{className:"whitespace-nowrap",level:6,children:n})})},F0=({left:e,center:n,right:a,sticky:o=!0,containerClassName:c,children:m})=>{const y=we("z-50 h-22 min-h-[92px] p-8",!m&&"flex items-center justify-between gap-3",o&&"sticky top-0",c);if(!m){if(e){const h=we("flex flex-auto items-center",a&&n&&"basis-1/3",!a&&n&&"basis-1/2");e=s.jsx("div",{className:h,children:e})}if(n){const h=we("flex flex-auto items-center justify-center",e&&a&&"basis-1/3",(e&&!a||!e&&a)&&"basis-1/2");n=s.jsx("div",{className:h,children:n})}if(a){const h=we("flex flex-auto items-center justify-end",e&&n&&"basis-1/3",!e&&n&&"basis-1/2");a=s.jsx("div",{className:h,children:a})}}return s.jsx("div",{className:y,children:m||s.jsxs(s.Fragment,{children:[e,n,a]})})},U0=({items:e,setItems:n,blank:a,canAddNewItem:o})=>{const[c,m]=D.useState(e.map((x,v)=>({item:x,id:v.toString()}))),[y,h]=D.useState(a);return D.useEffect(()=>{const x=c.map(({item:v})=>v);o(y)&&x.push(y),nM(JSON.parse(JSON.stringify(x)),JSON.parse(JSON.stringify(e)))||n(x)},[c,y,e,n,o]),{items:c,updateItem:(x,v)=>{const _=c.map(k=>k.id===x?{...k,item:v}:k);m(_),n(_.map(k=>k.item))},addItem:()=>{if(o(y)){const x=c.reduce((_,k)=>Math.max(_,parseInt(k.id)),0),v=c.concat({item:y,id:(x+1).toString()});m(v),n(v.map(_=>_.item)),h(a)}},removeItem:x=>{const v=c.filter(_=>_.id!==x);m(v),n(v.map(_=>_.item))},moveItem:(x,v)=>{if(x!==v){const _=c.findIndex(T=>T.id===x),k=v?c.findIndex(T=>T.id===v):0,M=L_(c,_,k);m(M),n(M.map(T=>T.item))}},newItem:y,setNewItem:h}},sM=({label:e,text:n="",hint:a,onRegenerate:o})=>{const[c,m]=D.useState(!1),y=()=>{navigator.clipboard.writeText(n),m(!0),setTimeout(()=>m(!1),2e3)},h=we("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 s.jsxs("div",{className:"mb-3 grid grid-cols-1",children:[e&&s.jsx(bt,{level:6,grey:!0,children:e}),s.jsxs("div",{className:h,children:[s.jsx("span",{children:n}),a,s.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&&s.jsx(Ue,{color:"outline",label:"Regenerate",size:"sm",onClick:o}),s.jsx(Ue,{color:"outline",label:c?"Copied":"Copy",size:"sm",onClick:y})]})]})]})},al=({keys:e})=>s.jsx("div",{"data-testid":"api-keys",children:e.map(n=>s.jsx(sM,{...n},n.label))}),Qs=({icon:e,title:n,detail:a,extra:o})=>s.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:[s.jsx("div",{className:"size-14",children:e}),s.jsxs("div",{className:"mt-1.5 flex min-w-0 flex-1 flex-col",children:[s.jsx("h3",{children:n}),s.jsx("div",{children:a}),o&&s.jsx("div",{className:"mt-4",children:o})]})]}),dd=ns({method:"POST",path:({integrationId:e,apiKeyId:n})=>`/integrations/${e}/api_key/${n}/refresh/`,body:({integrationId:e})=>({integrations:[{id:e}]}),updateQueries:{emberUpdateType:"createOrUpdate",dataType:el,update:(e,n)=>n&&{...n,integrations:n.integrations.map(a=>e.integrations.find(({id:c})=>c===a.id)||a)}}}),aM=ye.create(()=>{const e=ye.useModal(),{updateRoute:n}=Qe(),{zapierTemplates:a}=P_(),{data:{integrations:o}={integrations:[]}}=Qf(),{config:c}=Je(),{mutateAsync:m}=dd(),y=ot(),[h,l]=D.useState(!1),f=c.hostSettings?.limits?.customIntegrations?.disabled,u=o.find(({slug:v})=>v==="zapier"),p=u?.api_keys?.find(v=>v.type==="admin");D.useEffect(()=>{f&&n("integrations")},[f,n]);const x=()=>{!u||!p||(l(!1),ye.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 m({integrationId:u.id,apiKeyId:p.id}),l(!0),v?.remove()}catch(_){y(_)}}}))};return s.jsxs(yt,{afterClose:()=>{n("integrations")},cancelLabel:"",footer:s.jsxs("div",{className:"mx-8 flex w-full items-center justify-between",children:[s.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 ",s.jsx("span",{children:s.jsx(ut,{className:"relative top-[-2px] inline-block",name:"zapier-logo",size:24})})]}),s.jsx(Ue,{color:"black",label:"Close",onClick:()=>{e.remove()}})]}),okColor:"black",okLabel:"Close",testId:"zapier-modal",title:"",stickyFooter:!0,onOk:()=>{n("integrations"),e.remove()},children:[s.jsx(Qs,{detail:"Automation for your favorite apps",extra:s.jsx("div",{className:"-mb-4 mt-1",children:s.jsx(al,{keys:[{label:"Admin API key",text:p?.secret,hint:h?s.jsx("div",{className:"text-green",children:"Admin API Key was successfully regenerated"}):void 0,onRegenerate:x},{label:"API URL",text:window.location.origin+no().subdir}]})}),icon:s.jsx(ut,{name:"zapier",size:56}),title:"Zapier"}),s.jsx(cn,{children:a.map(v=>s.jsx(On,{action:s.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:s.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center",children:[s.jsxs("div",{className:"flex shrink-0 flex-nowrap items-center gap-2",children:[s.jsx("img",{className:"size-8 object-contain dark:invert",role:"presentation",src:v.ghostImage}),s.jsx(ut,{name:"arrow-right",size:"xs"}),s.jsx("img",{className:"size-8 object-contain",role:"presentation",src:v.appImage})]}),s.jsx("span",{className:"text-sm",children:v.title})]}),hideActions:!0}))})]})});function z0(e){const n="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(n);if(e=e.replace("threads.com","threads.net"),e.includes("www.")||(e=e.replace("https://","https://www.")),!Nt.isURL(e))throw new Error(n);if(!e.match(/^https:\/\/www\.threads\.net\/@?[a-zA-Z0-9._]+$/))throw new Error(n);return e}if(!e.includes("/")){if(e.startsWith("@")&&(e=e.slice(1)),!e.match(/^[a-zA-Z0-9._]+$/))throw new Error(n);return`https://www.threads.net/@${e}`}throw new Error(n)}const oM=e=>`https://www.threads.net/${e}`,iM=e=>{const n=e.match(/(?:https:\/\/)(?:www\.)?(?:threads\.(?:com|net))(?:\/)?(?:#!\/)?@?([^/]*)/)?.[1];return n?`@${n}`:null},Bs={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 H0(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 zf(e){let n=e.trim();return n.startsWith("@")&&(n=n.slice(1)),n.startsWith("did:plc:")?n.toLowerCase():n}function B0(e){if(!e)return"";let n;if(e.startsWith("http")||e.startsWith("www.")||e.includes("bsky.app")){if(!e.includes("bsky.app"))throw new Error(Bs.INVALID_URL);const o=e.match(/bsky\.app\/profile\/@?([^/]+)/);if(!o)throw new Error(Bs.INVALID_URL);n=zf(o[1])}else n=zf(e);if(!H0(n))throw new Error(Bs.INVALID_USERNAME);const a=`https://bsky.app/profile/${n}`;if(!Nt.isURL(a))throw new Error(Bs.INVALID_URL);return a}const lM=e=>{if(!e)throw new Error(Bs.INVALID_USERNAME);let n=zf(e);if(!H0(n))throw new Error(Bs.INVALID_USERNAME);return`https://bsky.app/profile/${n}`},cM=e=>{const n=e.match(/(?:https?:\/\/)?(?:www\.)?bsky\.app\/profile\/@?([^/]*)/);return n?`${n[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"},uM=["in","pub","company","school"],fM=/^[a-zA-Z0-9-]{3,100}$/,dM=/^[a-zA-Z0-9-]{3,100}(?:\/[a-zA-Z0-9-]*)*$/,W0=/^(?:https?:\/\/)?(?:www\.)?(?:([a-z]{2})\.)?linkedin\.com\/(in|pub|company|school)\/([^?#]+)/i,Hf=e=>e.trim().replace(/^@/,""),q0=e=>{if(/^(https?:\/\/|www\.)/.test(e)||e.includes("linkedin.com")){const o=e.match(W0);if(!o)throw new Error(es.INVALID_URL);if(o[0].length!==e.length)throw new Error(es.INVALID_USERNAME);const[,c,m,y]=o,h=Hf(y);if(c&&!/^[A-Z]{2}$/.test(c.toUpperCase()))throw new Error(es.INVALID_URL);return{regional:c,pathType:m,username:h}}const n=Hf(e),a=n.indexOf("/");if(a!==-1){const o=n.substring(0,a);if(uM.includes(o))return{pathType:o,username:n.substring(a+1)}}return{username:n}},Y0=(e,n)=>(e==="pub"?dM:fM).test(n),G0=({regional:e,pathType:n,username:a})=>{const c=`https://${e?`${e.toLowerCase()}.`:"www."}linkedin.com/${n}/${a}`;if(!Nt.isURL(c))throw new Error(es.INVALID_URL);return c};function X0(e){if(!e)return"";const{regional:n,pathType:a="in",username:o}=q0(e);if(!Y0(a,o))throw new Error(es.INVALID_USERNAME);return G0({regional:n,pathType:a,username:o})}const pM=e=>{if(!e)throw new Error(es.INVALID_USERNAME);const{regional:n,pathType:a="in",username:o}=q0(e);if(!Y0(a,o))throw new Error(es.INVALID_USERNAME);return G0({regional:n,pathType:a,username:o})},hM=e=>{const n=e.match(W0);if(!n)return null;const[,,a,o]=n,c=Hf(o);return a==="in"?c:`${a}/${c}`};function K0(e){const n="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(n);const m=e.match(/(?:https?:\/\/)?(?:www\.)?instagram\.com\/@?([^/]+)/);if(!m)throw new Error(n);o=m[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(!Nt.isURL(c))throw new Error(n);return c}const mM=e=>{const n="Your Username is not a valid Instagram Username";if(!e)throw new Error(n);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(n);return`https://www.instagram.com/${a}`},gM=e=>{const n=e.match(/(?:https?:\/\/)?(?:www\.)?instagram\.com\/@?([^/]*)/);return n?`${n[1]}`:null};function Z0(e){const n="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(n);const m=e.match(/(?:https?:\/\/)?(?:www\.)?youtube\.com\/((?:@|user\/|channel\/)[^/]+)/);if(!m)throw new Error(n);o=m[1]}else o=e;if(o.startsWith("@")){const m=o.slice(1);if(!m.match(/^[a-zA-Z0-9][a-zA-Z0-9._-]{1,28}[a-zA-Z0-9]$/)||m.includes("..")||m.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(n);const c=`https://www.youtube.com/${o}`;if(!Nt.isURL(c))throw new Error(n);return c}const xM=e=>{const n="Your Username is not a valid YouTube Username";if(!e)throw new Error(n);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(n)}else if(e.startsWith("user/")){if(!e.slice(5).match(/^[a-zA-Z0-9._-]{1,50}$/))throw new Error(n)}else if(e.startsWith("channel/")){if(!e.slice(8).match(/^UC[a-zA-Z0-9_-]{22}$/))throw new Error(n)}else throw new Error("The handle must be in a format like @yourUsername, user/yourUsername, or channel/yourChannelId");return`https://www.youtube.com/${e}`},bM=e=>{const n=e.match(/(?:https?:\/\/)?(?:www\.)?youtube\.com\/((?:@|user\/|channel\/)[^/]*)/);return n?n[1]:null};function V0(e){const n="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(n);const y=e.match(/(?:https?:\/\/)?(?:www\.)?tiktok\.com\/(@[^/]+)/);if(!y)throw new Error(n);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 m=`https://www.tiktok.com/${o}`;if(!Nt.isURL(m))throw new Error(n);return m}const vM=e=>{const n="Your Username is not a valid TikTok Username";if(!e)throw new Error(n);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(n);return`https://www.tiktok.com/${a}`},wM=e=>{const n=e.match(/(?:https?:\/\/)?(?:www\.)?tiktok\.com\/(@[^/]*)/);return n?n[1]:null};function Q0(e){const n="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(!Nt.isFQDN(c))throw new Error(n);return`https://${c}/@${o}`}if(a.match(/^[^/]+\.[^/]+\/@[^/]+(@[^/]+)?$/)){const[o,c]=a.split("/@");if(!Nt.isFQDN(o))throw new Error(n);if(c.includes("@")){const[,m]=c.split("@");if(!Nt.isFQDN(m))throw new Error(n)}return`https://${a}`}throw new Error(n)}const yM=e=>{const n="Your Username is not a valid Mastodon Username";if(!e)throw new Error(n);if(e.match(/^@[^@]+@[^/]+$/)){const[a,o]=e.split("@").slice(1);if(!Nt.isFQDN(o))throw new Error(n);return`https://${o}/@${a}`}if(e.match(/^[^/]+\.[^/]+\/@[^/]+(@[^/]+)?$/)){const[a,o]=e.split("/@");if(!Nt.isFQDN(a))throw new Error(n);if(o.includes("@")){const[,c]=o.split("@");if(!Nt.isFQDN(c))throw new Error(n)}return`https://${e}`}throw new Error(n)},_M=e=>e.replace(/^https?:\/\//,""),kM=({tier:e})=>{const n=e?.type==="free",{updateRoute:a}=Qe(),{mutateAsync:o}=ad(),{mutateAsync:c}=A2(),{mutateAsync:m}=Rn(),[y,h]=at.useState(!!e?.trial_days),l=ot(),{localSettings:f,siteData:u}=ss(),[p]=gt(f,["portal_plans"]),x=JSON.parse(p?.toString()||"[]"),v={name:()=>_.name?void 0:"Enter a name for the tier",monthly_price:()=>_.type!=="free"?ch(_.monthly_price||0,_.currency,{allowZero:!1}):void 0,yearly_price:()=>_.type!=="free"?ch(_.yearly_price||0,_.currency,{allowZero:!1}):void 0},{formState:_,saveState:k,updateForm:M,handleSave:T,errors:A,clearError:C,okProps:O}=kr({initialState:{...e||{},trial_days:e?.trial_days?.toString()||"",currency:e?.currency||F_[0].isoCode,visibility:e?.visibility||"none",welcome_page_url:e?.welcome_page_url||null},savingDelay:500,savedDelay:500,onValidate:()=>{const q={};return Object.entries(v).forEach(([B,Y])=>{q[B]=Y?.()}),q},onSave:async()=>{const{trial_days:q,currency:B,...Y}=_,ae=Y;if(ae.benefits=ae.benefits?.filter(ee=>ee),n||(ae.currency=B,ae.trial_days=parseInt(q)),e?.id?await o({...e,...ae}):await c(ae),n){const ee=_.visibility==="public";let re=!1;x.includes("free")&&!ee&&(x.splice(x.indexOf("free"),1),re=!0),!x.includes("free")&&ee&&(x.push("free"),re=!0),re&&await m([{key:"portal_plans",value:JSON.stringify(x)}])}},onSaveError:l}),$=U0({items:_.benefits||[],setItems:q=>M(B=>({...B,benefits:q})),blank:"",canAddNewItem:q=>!!q}),W=q=>{q.target.checked?(h(!0),M(B=>({...B,trial_days:e?.trial_days?e?.trial_days.toString():"7"}))):(h(!1),M(B=>({...B,trial_days:"0"})))},R=D.useRef(!1);D.useEffect(()=>{R.current&&(v.monthly_price?.(),v.yearly_price?.()),R.current=!0},[_.currency]);const Z=()=>{if(e){const q=e.active?"Archive tier":"Reactivate tier",B=e.active?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"mb-6",children:["Members will no longer be able to subscribe to ",s.jsx("strong",{children:e.name})," and it will be removed from the list of available tiers in portal."]}),s.jsx("div",{children:"Existing members on this tier will remain unchanged. Offers using this tier will be disabled."})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"mb-6",children:["Reactivating ",s.jsx("strong",{children:e.name})," will re-enable it as an option in portal and allow new members to subscribe to this tier."]}),s.jsx("div",{children:"Existing members will remain unchanged."})]}),Y=e.active?"Archive":"Reactivate";ye.show(Et,{title:q,prompt:B,okLabel:Y,cancelLabel:"Cancel",okColor:e.active?"red":"black",onOk:ae=>{o({...e,active:!e.active}),ae?.remove(),xt({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:Z}:e.active||(X={label:"Reactivate tier",color:"green",link:!0,onClick:Z})),s.jsx(yt,{afterClose:()=>{a("tiers")},buttonsDisabled:O.disabled,cancelLabel:"Close",dirty:k==="unsaved",leftButtonProps:X,okColor:O.color,okLabel:O.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:s.jsxs("div",{className:"-mb-8 mt-8 flex items-start gap-8",children:[s.jsxs("div",{className:"flex grow flex-col gap-8",children:[s.jsxs(tt,{marginBottom:!1,title:"Basic",grouped:!0,children:[s.jsx(Ae,{autoComplete:"off",error:!!A.name,hint:A.name,maxLength:191,placeholder:n?"Free":"Bronze",title:"Name",value:_.name||"",autoFocus:!0,onChange:q=>M(B=>({...B,name:q.target.value})),onKeyDown:()=>C("name")}),s.jsx(Ae,{autoComplete:"off",autoFocus:n,maxLength:191,placeholder:n?"Free preview":"Full access to premium content",title:"Description",value:_.description||"",onChange:q=>M(B=>({...B,description:q.target.value}))}),!n&&s.jsx(s.Fragment,{children:s.jsxs("div",{className:"flex flex-col gap-10 md:flex-row",children:[s.jsxs("div",{className:"basis-1/2",children:[s.jsxs("div",{className:"mb-1 flex h-6 items-center justify-between",children:[s.jsx(bt,{level:6,children:"Prices"}),s.jsx("div",{className:"-mr-2 w-[50px]",children:s.jsx(Lt,{border:!1,containerClassName:"font-medium",controlClasses:{menu:"w-18"},options:uh(),selectedOption:uh().flatMap(q=>q.options).find(q=>q.value===_.currency),size:"xs",clearBg:!0,isSearchable:!0,onSelect:q=>M(B=>({...B,currency:q?.value}))})})]}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx(fh,{error:!!A.monthly_price,hint:A.monthly_price,placeholder:"5",rightPlaceholder:`${_.currency}/month`,title:"Monthly price",valueInCents:_.monthly_price||"",hideTitle:!0,onBlur:q=>q.target.value===""?M(B=>({...B,monthly_price:0})):null,onChange:q=>M(B=>({...B,monthly_price:q})),onKeyDown:()=>C("monthly_price")}),s.jsx(fh,{error:!!A.yearly_price,hint:A.yearly_price,placeholder:"50",rightPlaceholder:`${_.currency}/year`,title:"Yearly price",valueInCents:_.yearly_price||"",hideTitle:!0,onBlur:q=>q.target.value===""?M(B=>({...B,yearly_price:0})):null,onChange:q=>M(B=>({...B,yearly_price:q})),onKeyDown:()=>C("yearly_price")})]})]}),s.jsxs("div",{className:"basis-1/2",children:[s.jsx("div",{className:"mb-1 flex h-6 flex-col justify-center",children:s.jsx(st,{checked:y,label:"Add a free trial",labelStyle:"heading",onChange:W})}),s.jsx(Ae,{disabled:!y,hint:s.jsxs("div",{className:"mt-1",children:["Members will be subscribed at full price once the trial ends. ",s.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:q=>M(B=>({...B,trial_days:q.target.value.replace(/[^\d]/,"")}))})]})]})}),s.jsx(Hg,{baseUrl:u?.url,hint:`Redirect to this URL after signup ${n?"":" for premium membership"}`,maxLength:2e3,placeholder:u?.url,title:"Welcome page",value:_.welcome_page_url||null,nullable:!0,transformPathWithoutSlash:!0,onChange:q=>M(B=>({...B,welcome_page_url:q||null}))})]}),s.jsxs(tt,{gap:"none",title:"Benefits",grouped:!0,children:[s.jsx("div",{className:"-mt-3",children:s.jsx(Bg,{items:$.items,itemSeparator:!1,renderItem:({id:q,item:B})=>s.jsxs("div",{className:"relative flex w-full items-center gap-5",children:[s.jsx("div",{className:"absolute left-[-32px] top-[7px] flex size-6 items-center justify-center bg-white group-hover:hidden dark:bg-black",children:s.jsx(ut,{name:"check",size:"sm"})}),s.jsx(Ae,{maxLength:191,value:B,onChange:Y=>$.updateItem(q,Y.target.value)}),s.jsx(Ue,{className:"absolute right-1 top-1 z-10 opacity-0 group-hover:opacity-100",color:"grey",icon:"trash",size:"sm",onClick:()=>$.removeItem(q)})]}),onMove:$.moveItem})}),s.jsxs("div",{className:"relative mt-1 flex items-center gap-3",children:[s.jsx(ut,{className:"dark:text-white",name:"check",size:"sm"}),s.jsx(Ae,{className:"grow",containerClassName:"w-100",maxLength:191,placeholder:"Expert analysis",title:"New benefit",value:$.newItem,hideTitle:!0,onChange:q=>$.setNewItem(q.target.value),onKeyDown:q=>{q.key==="Enter"&&$.addItem()}}),s.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()})]})]})]}),s.jsx("div",{className:"sticky top-[96px] hidden shrink-0 basis-[380px] min-[920px]:!visible min-[920px]:!block",children:s.jsx(U_,{isFreeTier:n,tier:_})})]})})},MM=({params:e})=>{const{data:{tiers:n,isEnd:a}={},fetchNextPage:o}=so();let c;return D.useEffect(()=>{e?.id&&!c&&!a&&o()},[o,a,e?.id,c]),e?.id&&(c=n?.find(({id:m})=>m===e?.id),!c)?null:s.jsx(kM,{tier:c})},jM=ye.create(MM);var au,Uh;function J0(){if(Uh)return au;Uh=1;var e={};return au=typeof process=="object"&&e&&e.NODE_DEBUG&&/\bsemver\b/i.test(e.NODE_DEBUG)?(...a)=>console.error("SEMVER",...a):()=>{},au}var ou,zh;function ex(){if(zh)return ou;zh=1;const e="2.0.0",n=256,a=Number.MAX_SAFE_INTEGER||9007199254740991,o=16,c=n-6;return ou={MAX_LENGTH:n,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},ou}var Oi={exports:{}},Hh;function EM(){return Hh||(Hh=1,(function(e,n){const{MAX_SAFE_COMPONENT_LENGTH:a,MAX_SAFE_BUILD_LENGTH:o,MAX_LENGTH:c}=ex(),m=J0();n=e.exports={};const y=n.re=[],h=n.safeRe=[],l=n.src=[],f=n.safeSrc=[],u=n.t={};let p=0;const x="[a-zA-Z0-9-]",v=[["\\s",1],["\\d",c],[x,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 C=_(T),O=p++;m(M,O,T),u[M]=O,l[O]=T,f[O]=C,y[O]=new RegExp(T,A?"g":void 0),h[O]=new RegExp(C,A?"g":void 0)};k("NUMERICIDENTIFIER","0|[1-9]\\d*"),k("NUMERICIDENTIFIERLOOSE","\\d+"),k("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${x}*`),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",`${x}+`),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),n.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),n.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),n.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*$")})(Oi,Oi.exports)),Oi.exports}var iu,Bh;function TM(){if(Bh)return iu;Bh=1;const e=Object.freeze({loose:!0}),n=Object.freeze({});return iu=o=>o?typeof o!="object"?e:o:n,iu}var lu,Wh;function SM(){if(Wh)return lu;Wh=1;const e=/^[0-9]+$/,n=(o,c)=>{if(typeof o=="number"&&typeof c=="number")return o===c?0:o<c?-1:1;const m=e.test(o),y=e.test(c);return m&&y&&(o=+o,c=+c),o===c?0:m&&!y?-1:y&&!m?1:o<c?-1:1};return lu={compareIdentifiers:n,rcompareIdentifiers:(o,c)=>n(c,o)},lu}var cu,qh;function NM(){if(qh)return cu;qh=1;const e=J0(),{MAX_LENGTH:n,MAX_SAFE_INTEGER:a}=ex(),{safeRe:o,t:c}=EM(),m=TM(),{compareIdentifiers:y}=SM();class h{constructor(f,u){if(u=m(u),f instanceof h){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>n)throw new TypeError(`version is longer than ${n} characters`);e("SemVer",f,u),this.options=u,this.loose=!!u.loose,this.includePrerelease=!!u.includePrerelease;const p=f.trim().match(u.loose?o[c.LOOSE]:o[c.FULL]);if(!p)throw new TypeError(`Invalid Version: ${f}`);if(this.raw=f,this.major=+p[1],this.minor=+p[2],this.patch=+p[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");p[4]?this.prerelease=p[4].split(".").map(x=>{if(/^[0-9]+$/.test(x)){const v=+x;if(v>=0&&v<a)return v}return x}):this.prerelease=[],this.build=p[5]?p[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 h)){if(typeof f=="string"&&f===this.version)return 0;f=new h(f,this.options)}return f.version===this.version?0:this.compareMain(f)||this.comparePre(f)}compareMain(f){return f instanceof h||(f=new h(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 h||(f=new h(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 p=this.prerelease[u],x=f.prerelease[u];if(e("prerelease compare",u,p,x),p===void 0&&x===void 0)return 0;if(x===void 0)return 1;if(p===void 0)return-1;if(p===x)continue;return y(p,x)}while(++u)}compareBuild(f){f instanceof h||(f=new h(f,this.options));let u=0;do{const p=this.build[u],x=f.build[u];if(e("build compare",u,p,x),p===void 0&&x===void 0)return 0;if(x===void 0)return 1;if(p===void 0)return-1;if(p===x)continue;return y(p,x)}while(++u)}inc(f,u,p){if(f.startsWith("pre")){if(!u&&p===!1)throw new Error("invalid increment argument: identifier is empty");if(u){const x=`-${u}`.match(this.options.loose?o[c.PRERELEASELOOSE]:o[c.PRERELEASE]);if(!x||x[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,p);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",u,p);break;case"prepatch":this.prerelease.length=0,this.inc("patch",u,p),this.inc("pre",u,p);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",u,p),this.inc("pre",u,p);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 x=Number(p)?1:0;if(this.prerelease.length===0)this.prerelease=[x];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(".")&&p===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(x)}}if(u){let v=[u,x];p===!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 cu=h,cu}var uu,Yh;function AM(){if(Yh)return uu;Yh=1;const e=NM();return uu=(a,o,c=!1)=>{if(a instanceof e)return a;try{return new e(a,o)}catch(m){if(!c)return null;throw m}},uu}var IM=AM();const CM=Pg(IM);function Gh(e){if(!e)return"";const n=e.replace("+moya","");try{const o=CM(n,{includePrerelease:!0})?.prerelease;if(o&&o?.length>0){const m=String(o[0]).split("-")[1];return!m||!m.startsWith("g")?"":`https://github.com/TryGhost/Ghost/commit/${m.slice(1)}`}return`https://github.com/TryGhost/Ghost/releases/tag/v${n}`}catch{return""}}function DM(e,n){const a=!!e.match?.(/production/i);return!!(a&&n!=="mysql8"||!a&&n==="mysql5")}const RM=ye.create(({})=>{const{updateRoute:e}=Qe();let a=Je().config;const o=z_();function c(){return new Date().getFullYear()}function m(){return!!a.enableDeveloperExperiments}function y(){return!a.hostSettings?.siteId}return s.jsx(yt,{afterClose:()=>{e("")},cancelLabel:"",footer:s.jsx(s.Fragment,{}),topRightContent:"close",width:540,children:s.jsxs("div",{className:"flex flex-col gap-4 pb-7 text-sm",children:[s.jsx(H_,{className:"h-auto w-[120px] dark:invert"}),s.jsxs("div",{className:"mt-3 flex flex-col gap-1.5",children:[o?.message&&s.jsxs("div",{className:"gh-prose-links mb-4 rounded-sm border border-green p-5",children:[s.jsx("strong",{children:"Update available!"}),s.jsx("div",{dangerouslySetInnerHTML:{__html:o.message}})]}),Gh(a.version)&&s.jsxs("div",{children:[s.jsx("strong",{children:"Version:"})," ",s.jsx("a",{className:"text-green",href:Gh(a.version),rel:"noopener noreferrer",target:"_blank",children:a.version})]})||s.jsxs("div",{children:[s.jsx("strong",{children:"Version:"})," ",a.version]}),y()&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Environment:"})," ",a.environment]}),s.jsxs("div",{children:[s.jsx("strong",{children:"Database:"})," ",a.database]}),s.jsxs("div",{children:[s.jsx("strong",{children:"Mail:"})," ",a.mail?a.mail:"Native"]})]}),m()&&s.jsxs("div",{children:[s.jsx("strong",{children:"Developer experiments:"})," Enabled"]}),y()&&DM(a.environment,a.database)&&s.jsxs("div",{className:"text-red-500 dark:text-red-400",children:["You are running an unsupported database in production. Please ",s.jsx("a",{href:"https://ghost.org/docs/faq/supported-databases/",rel:"noopener noreferrer",target:"_blank",children:"upgrade to MySQL 8"}),"."]})]}),s.jsx(Va,{}),s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.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:[s.jsx(ut,{name:"book-open",size:"sm"})," User documentation"]}),s.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:[s.jsx(ut,{name:"question-circle",size:"sm"})," Get help with Ghost"]}),s.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:[s.jsx(ut,{name:"angle-brackets",size:"sm"})," Get involved"]})]}),s.jsx(Va,{}),s.jsxs("p",{className:"max-w-[460px] text-xs",children:["Copyright © 2013 – ",c()," Ghost Foundation, released under the ",s.jsx("a",{className:"text-green",href:"https://github.com/TryGhost/Ghost/blob/main/LICENSE",rel:"noopener noreferrer",target:"_blank",children:"MIT license"}),". ",s.jsx("a",{className:"text-green",href:"https://ghost.org/",rel:"noopener noreferrer",target:"_blank",children:"Ghost"})," is a registered trademark of ",s.jsx("a",{className:"text-green",href:"https://ghost.org/trademark/",rel:"noopener noreferrer",target:"_blank",children:"Ghost Foundation Ltd"}),"."]})]})})}),OM=()=>{const e=Zt(),{updateRoute:n}=Qe(),[a,o]=D.useState(""),[c,m]=D.useState({name:""}),{mutateAsync:y}=B_(),h=Ys(),l=ot();return D.useEffect(()=>{h?.isLimited("customIntegrations")&&h.errorIfWouldGoOverLimit("customIntegrations").catch(f=>{f instanceof Gs&&(ye.show(Xr,{prompt:f.message||"Your current plan doesn't support more custom integrations.",onOk:()=>n({route:"/pro",isExternal:!0})}),e.remove(),n("integrations"))})},[h,e,n]),s.jsx(yt,{afterClose:()=>{n("integrations")},okColor:"black",okLabel:"Add",size:"sm",testId:"add-integration-modal",title:"Add integration",onOk:async()=>{if(!a){m({name:"Name is required"});return}try{const f=await y({name:a});e.remove(),n({route:`integrations/${f.integrations[0].id}`})}catch(f){l(f)}},children:s.jsx("div",{className:"mt-5",children:s.jsx(tt,{marginBottom:!1,marginTop:!1,children:s.jsx(Ae,{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&&m({name:""})}})})})})},$M=ye.create(OM),LM=()=>{const e=Zt(),{updateRoute:n}=Qe(),a=ot(),[o,c]=D.useState(!0),[m,y]=D.useState(null),{data:h}=Fg({searchParams:{filter:"newsletters.status:active+email_disabled:0",limit:"1",page:"1",include:"newsletters,labels"}}),{mutateAsync:l}=T2(),{formState:f,updateForm:u,saveState:p,handleSave:x,errors:v,clearError:_}=kr({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});n({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=Ys();D.useEffect(()=>{if(!k){c(!1);return}k.errorIfWouldGoOverLimit("newsletters").catch(T=>{if(T instanceof Gs)y(T);else throw T}).finally(()=>{c(!1)})},[k]);const M=h?.meta?.pagination.total;return D.useEffect(()=>{m&&(ye.show(Xr,{prompt:m.message||"Your current plan doesn't support more newsletters.",onOk:()=>n({route:"/pro",isExternal:!0})}),e.remove(),n("newsletters"))},[m,e,n]),o||m?null:s.jsx(yt,{afterClose:()=>{n("newsletters")},backDropClick:!1,okColor:"black",okDisabled:p==="saving",okLabel:"Create",okLoading:p==="saving",size:"sm",testId:"add-newsletter-modal",title:"Create newsletter",onOk:async()=>{await x()&&e.remove()},children:s.jsxs(tt,{marginBottom:!1,marginTop:!0,children:[s.jsx(Ae,{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")}),s.jsx($n,{maxLength:2e3,title:"Description",value:f.description,onChange:T=>u(A=>({...A,description:T.target.value}))}),s.jsx(st,{checked:f.optInExistingSubscribers,direction:"rtl",hint:f.optInExistingSubscribers?`This newsletter will be available to all members. Your ${M===void 0?"":Wg(M)} existing subscriber${h?.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}))})]})})},PM=ye.create(LM),FM=({recommendation:e,animate:n})=>{const a=Zt(),{updateRoute:o,route:c}=Qe(),{mutateAsync:m}=W_(),y=ot(),{formState:h,updateForm:l,handleSave:f,saveState:u,errors:p,clearError:x,setErrors:v}=kr({initialState:{...e},onSave:async T=>{await m(T),a.remove(),xt({title:"Recommendation added",type:"success"}),Y_("Recommendation Added",{oneClickSubscribe:T.one_click_subscribe}),o("recommendations")},onSaveError:y,onValidate:T=>q_(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(),ye.show(tx,{pathName:c,animate:!1,recommendation:{...h}}))}};return s.jsx(yt,{afterClose:()=>{o("recommendations")},animate:n??!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"){Ug();try{await f({force:!0})}catch{xt({type:"error",title:"Something went wrong when adding this recommendation, please try again."})}}},children:s.jsx(G_,{clearError:x,errors:p,formState:h,setErrors:v,showURL:!1,updateForm:l})})},UM=ye.create(FM),Xh=e=>Bi(e).save||"",zM=function(e,n){try{new URL(n).hostname.includes(".")?delete e.url:e.url="Enter a valid URL"}catch{e.url="Enter a valid URL"}return e},HM=({searchParams:e,recommendation:n,animate:a})=>{const[o,c]=D.useState(!1),m=Zt(),{updateRoute:y}=Qe(),{mutateAsync:h}=X_(),l=n?"":e?.get("url")??"",{save:f}=l?Bi(l):{save:""},u=at.useRef(!1),[p,x]=at.useState(!!f),{formState:v,updateForm:_,handleSave:k,errors:M,saveState:T,clearError:A}=kr({initialState:n??{title:"",url:f||"",description:"",excerpt:null,featured_image:null,favicon:null,one_click_subscribe:!1},onSave:async()=>{let O;O=new URL(v.url);const $=O.hostname.replace("www.",""),W={...v,url:O.toString()},{recommendations:R=[]}=await h(O);if(!R||R.length===0)return;const Z=R[0];if(Z.id)throw new ah("A recommendation with this URL already exists.");W.title=Z.title??$,W.excerpt=Z.excerpt??W.excerpt,W.featured_image=Z.featured_image??W.featured_image??null,W.favicon=Z.favicon??W.favicon??null,W.one_click_subscribe=Z.one_click_subscribe??W.one_click_subscribe??!1,W.description=W.excerpt||null,m.remove(),ye.show(UM,{animate:!1,recommendation:W})},onValidate:()=>{const O={};return zM(O,v.url),p&&x(Object.keys(O).length===0),O}}),C=at.useCallback(async()=>{if(T!=="saving"){Ug();try{if(await k({force:!0}))return}catch(O){const $=O instanceof ah?O.message:"Something went wrong while checking this URL, please try again.";xt({type:"error",title:$})}p&&x(!1)}},[k,T,p,x]);return at.useEffect(()=>{p&&!u.current&&(u.current=!0,C())},[p,C]),D.useEffect(()=>{o&&(C(),c(!1))},[v]),p?s.jsx(yt,{afterClose:()=>{y("recommendations")},animate:a??!0,backDropClick:!1,footer:!1,header:!1,size:"sm",children:s.jsx("div",{className:"flex flex-col items-center justify-center p-8",children:s.jsx(Wi,{})})}):s.jsxs(yt,{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:C,children:[s.jsxs("p",{className:"mt-4",children:["You can recommend ",s.jsx("strong",{children:"any site"})," your audience will find valuable, not just those published on Ghost."]}),s.jsx(tt,{marginBottom:!1,marginTop:!0,children:s.jsx(Ae,{autoFocus:!0,error:!!M.url,hint:M.url||s.jsxs(s.Fragment,{children:["Need inspiration? ",s.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 O=Xh(v.url);_($=>({...$,url:O}))},onChange:O=>{A?.("url"),_($=>({...$,url:O.target.value}))},onKeyDown:O=>{O.key==="Enter"&&(O.preventDefault(),_($=>({...$,url:Xh(v.url)})),c(!0))}})})]})},tx=ye.create(HM);function BM(e,n){let a;return function(...c){const m=()=>{clearTimeout(a),e(...c)};clearTimeout(a),a=setTimeout(m,n)}}const pd=({generateContent:e,className:n,height:a,width:o,parentClassName:c,testId:m,addDelay:y=!1})=>{const[h,l]=D.useState(0),f=[D.useRef(null),D.useRef(null)],[u,p]=D.useState(0);return D.useEffect(()=>{const x=h===0?1:0,v=f[x].current;if(v){e(v);const _=()=>{y?setTimeout(()=>{l(x)},500):l(x)};return v.addEventListener("load",_),()=>{v.removeEventListener("load",_)}}},[e]),D.useEffect(()=>{const x=f[h].current,v=BM(()=>{p(x?.contentWindow?.scrollY||0)},250);return x?.contentWindow?.addEventListener("scroll",v),()=>{x?.contentWindow?.removeEventListener("scroll",v)}},[h,f]),D.useEffect(()=>{const x=f[h].current;if(x)try{x.contentWindow?.scrollTo(0,u)}catch(v){m_(v)}},[u,h,f]),s.jsxs("div",{className:c,"data-testid":m,children:[s.jsx("iframe",{ref:f[0],className:`${n} ${h!==0?"z-10 opacity-0":"z-20 opacity-100"}`,"data-visible":h===0,frameBorder:"0",height:a,title:"Buffered Preview 1",width:o}),s.jsx("iframe",{ref:f[1],className:`${n} ${h!==1?"z-10 opacity-0":"z-20 opacity-100"}`,"data-visible":h===1,frameBorder:"0",height:a,title:"Buffered Preview 2",width:o})]})},WM=(e,n,a)=>{const o=new URLSearchParams;return o.append("announcement_bg",e||"accent"),o.append("announcement",n||""),a&&a.length>0&&o.append("announcement_vis",a?.join(",")||""),o.toString()},qM=({announcementBackgroundColor:e,announcementContent:n,url:a,visibility:o})=>{const c=D.useMemo(()=>o,[o?.join(",")]),m=D.useCallback(y=>{a&&fetch(a,{method:"POST",headers:{"Content-Type":"text/html;charset=utf-8","x-ghost-preview":WM(e,n,c),Accept:"text/plain"},mode:"cors",credentials:"include"}).then(h=>h.text()).then(h=>{const l="html { pointer-events: none; }",u=new DOMParser().parseFromString(h,"text/html"),p=u.querySelector("style"),x=p.innerHTML;p.innerHTML=`${x}
|
|
2
|
-
|
|
3
|
-
${l}`;let _=(u.doctype?new XMLSerializer().serializeToString(u.doctype):"")+u.documentElement.outerHTML;y.contentDocument?.open(),y.contentDocument?.write(_),y.contentDocument?.close()}).catch(()=>{})},[e,n,a,c]);return s.jsx(pd,{addDelay:!0,className:"absolute size-[110%] origin-top-left scale-[.90909] bg-white max-[1600px]:size-[130%] max-[1600px]:scale-[.76923]",generateContent:m,height:"100%",parentClassName:"relative h-full w-full",testId:"announcement-bar-preview-iframe",width:"100%"})},YM=({announcementContent:e,announcementTextHandler:n,accentColor:a,announcementBackgroundColor:o,toggleColorSwatch:c,toggleVisibility:m,visibility:y=[],paidMembersEnabled:h,onBlur:l})=>{const f=[{label:"Public visitors",onChange:u=>{m("visitors",u)},value:"visitors",checked:y.includes("visitors")},{label:"Free members",onChange:u=>{m("free_members",u)},value:"free_members",checked:y.includes("free_members")},...h?[{label:"Paid members",onChange:u=>{m("paid_members",u)},value:"paid_members",checked:y.includes("paid_members")}]:[]];return s.jsxs(tt,{children:[s.jsx(ld,{nodes:"MINIMAL_NODES",placeholder:"Highlight breaking news, offers or updates",title:"Announcement",value:e,onBlur:l,onChange:n}),s.jsx(u0,{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:()=>{}}),s.jsx(Cf,{checkboxes:f,title:"Visibility"})]})},GM=()=>{const{siteData:e}=Je(),{localSettings:n,updateSetting:a,handleSave:o,okProps:c}=ss({savingDelay:500}),[m]=gt(n,["announcement_content"]),[y]=gt(n,["accent_color"]),[h]=gt(n,["announcement_background"]),[l]=gt(n,["announcement_visibility"]),[f]=gt(n,["paid_members_enabled"]),u=JSON.parse(l?.toString()||"[]"),{updateRoute:p}=Qe(),[x,v]=D.useState("homepage"),_=R=>{a("announcement_background",R)},k=(R,Z)=>{const X=u.indexOf(R);X===-1&&Z?u.push(R):u.splice(X,1),a("announcement_visibility",JSON.stringify(u))},M=D.useRef(Ji(R=>{a("announcement_content",R)},500)),T=s.jsx(YM,{accentColor:y,announcementBackgroundColor:h,announcementContent:m,announcementTextHandler:R=>{M.current(R)},paidMembersEnabled:f,toggleColorSwatch:_,toggleVisibility:k,visibility:l,onBlur:()=>{}}),{data:{posts:[A]}={posts:[]}}=i0({searchParams:{filter:"status:published",order:"published_at DESC",limit:"1",fields:"id,url"}});let C=[];A&&(C=[{id:"homepage",title:"Homepage"},{id:"post",title:"Post"}]);const O=R=>{C.length&&v(R)};let $=ln(e);switch(x){case"homepage":$=ln(e);break;case"post":$=A.url;break}const W=s.jsx(qM,{announcementBackgroundColor:h,announcementContent:m,url:$,visibility:u});return s.jsx(Zs,{afterClose:()=>{p("announcement-bar")},buttonsDisabled:c.disabled,cancelLabel:"Close",deviceSelector:!0,dirty:!1,okColor:c.color,okLabel:c.label||"Save",preview:W,previewBgColor:"greygradient",previewToolbarTabs:C,selectedURL:x,sidebar:T,testId:"announcement-bar-modal",title:"Announcement",titleHeadingLevel:5,onOk:async()=>{await o({fakeWhenUnchanged:!0})||xt({type:"error",message:"An error occurred while saving your changes. Please try again."})},onSelectURL:O})},XM=ye.create(GM),Bf=[{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"}]}],KM=e=>Bf.flatMap(({options:a})=>a).find(a=>a.value===e)?.label,ZM=ns({method:"POST",path:()=>"/webhooks/",body:e=>({webhooks:[e]}),updateQueries:{dataType:el,emberUpdateType:"createOrUpdate",update:(e,n)=>n&&{...n,integrations:n.integrations.map(a=>{const o=e.webhooks[0];return o.integration_id===a.id?{...a,webhooks:[...a.webhooks||[],o]}:a})}}}),VM=ns({method:"PUT",path:e=>`/webhooks/${e.id}/`,body:e=>({webhooks:[e]}),updateQueries:{dataType:el,emberUpdateType:"createOrUpdate",update:(e,n)=>n&&{...n,integrations:n.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)}})}}}),QM=ns({method:"DELETE",path:e=>`/webhooks/${e}/`,updateQueries:{dataType:el,emberUpdateType:"createOrUpdate",update:(e,n,a)=>({...n,integrations:n.integrations.map(o=>{var c;return{...o,webhooks:(c=o.webhooks)==null?void 0:c.filter(m=>m.id!==a)}})})}}),JM=({webhook:e,integrationId:n})=>{const a=Zt(),{mutateAsync:o}=ZM(),{mutateAsync:c}=VM(),m=ot(),{formState:y,updateForm:h,handleSave:l,errors:f,clearError:u}=kr({initialState:e||{},onSave:async()=>{y.id?await c(y):await o({...y,integration_id:n})},onSaveError:m,onValidate:()=>{const p={};return y.name||(p.name="Enter a name"),y.event||(p.event="Select an event"),y.target_url||(p.target_url="Enter a target URL"),y.target_url&&!Nt.isURL(y.target_url,{require_tld:!1})&&(p.target_url="Enter a valid URL"),p}});return s.jsx(yt,{okColor:"black",okLabel:e?"Update":"Add",size:"sm",testId:"webhook-modal",title:"Add webhook",formSheet:!0,onOk:async()=>{await l()&&a.remove()},children:s.jsx("div",{className:"mt-5",children:s.jsxs(tt,{marginBottom:!1,marginTop:!1,children:[s.jsx(Ae,{error:!!f.name,hint:f.name,maxLength:191,placeholder:"Custom webhook",title:"Name",value:y.name,onChange:p=>h(x=>({...x,name:p.target.value})),onKeyDown:()=>u("name")}),s.jsx(Lt,{error:!!f.event,hint:f.event,options:Bf,prompt:"Select an event",selectedOption:Bf.flatMap(p=>p.options).find(p=>p.value===y.event),testId:"event-select",title:"Event",hideTitle:!0,onSelect:p=>{h(x=>({...x,event:p?.value})),u("event")}}),s.jsx(Ae,{error:!!f.target_url,hint:f.target_url,maxLength:2e3,placeholder:"https://example.com",title:"Target URL",type:"url",value:y.target_url,onChange:p=>h(x=>({...x,target_url:p.target.value})),onKeyDown:()=>u("target_url")}),s.jsx(Ae,{maxLength:191,placeholder:"https://example.com",title:"Secret",value:y.secret||void 0,onChange:p=>h(x=>({...x,secret:p.target.value}))})]})})})},Kh=ye.create(JM),ej=({integration:e})=>{const{mutateAsync:n}=QM(),a=ot(),o=c=>{ye.show(Et,{title:"Are you sure?",prompt:"Deleting this webhook may prevent the integration from functioning.",okColor:"red",okLabel:"Delete Webhook",onOk:async m=>{try{await n(c),m?.remove(),xt({message:"Webhook deleted",type:"info"})}catch(y){a(y)}}})};return s.jsxs("div",{children:[s.jsxs(K_,{children:[s.jsxs(dh,{bgOnHover:!1,children:[s.jsxs(Fh,{children:[e.webhooks?.length||0," ",e.webhooks?.length===1?"webhook":"webhooks"]}),s.jsx(Fh,{children:"Last triggered"})]}),e.webhooks?.map(c=>s.jsxs(dh,{action:s.jsx(Ue,{color:"red",label:"Delete",link:!0,onClick:m=>{m?.stopPropagation(),o(c.id)}}),bgOnHover:!1,hideActions:!0,onClick:()=>{ye.show(Kh,{webhook:c,integrationId:e.id})},children:[s.jsxs(ph,{className:"w-3/4",children:[s.jsx("div",{className:"text-sm font-semibold",children:c.name}),s.jsxs("div",{className:"grid grid-cols-[max-content_1fr] gap-x-1 text-xs leading-snug",children:[s.jsx("span",{className:"text-grey-600",children:"Event:"}),s.jsx("span",{children:KM(c.event)}),s.jsx("span",{className:"text-grey-600",children:"URL:"}),s.jsx("span",{className:"line-clamp-3 break-all",title:c.target_url,children:c.target_url})]})]}),s.jsx(ph,{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"})})]}))]}),s.jsx("div",{className:"mt-5",children:s.jsx(Ue,{color:"green",icon:"add",iconColorClass:"text-green",label:"Add webhook",size:"sm",link:!0,onClick:()=>{ye.show(Kh,{integrationId:e.id})}})})]})},tj=({integration:e})=>{const n=Zt(),{updateRoute:a}=Qe(),{mutateAsync:o}=Z_(),{mutateAsync:c}=dd(),{mutateAsync:m}=Xs(),y=ot(),{formState:h,updateForm:l,handleSave:f,saveState:u,errors:p,clearError:x,okProps:v}=kr({initialState:e,savingDelay:500,savedDelay:500,onSave:async()=>{await o(h)},onSavedStateReset:()=>{a("integrations")},onSaveError:y,onValidate:()=>{const $={};return h.name||($.name="Enter integration title"),$}}),_=e.api_keys?.find($=>$.type==="admin"),k=e.api_keys?.find($=>$.type==="content"),[M,T]=D.useState(!1),[A,C]=D.useState(!1);D.useEffect(()=>{e.type!=="custom"&&(n.remove(),a("integrations"))},[e.type,n,a]);const O=($,W)=>{W(!1);const R=$.type==="content"?"Content":"Admin";ye.show(Et,{title:`Regenerate ${R} API Key`,prompt:`You can regenerate ${R} API Key any time, but any scripts or applications using it will need to be updated.`,okLabel:`Regenerate ${R} API Key`,onOk:async Z=>{try{await c({integrationId:e.id,apiKeyId:$.id}),W(!0),Z?.remove()}catch(X){y(X)}}})};return s.jsxs(yt,{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:h.name||"Custom integration",stickyFooter:!0,onOk:async()=>{await f({fakeWhenUnchanged:!0})},children:[s.jsxs("div",{className:"mt-7 flex w-full flex-col gap-7 md:flex-row",children:[s.jsx("div",{children:s.jsx(un,{height:"100px",id:"custom-integration-icon",imageURL:h.icon_image||void 0,width:"100px",onDelete:()=>l($=>({...$,icon_image:null})),onUpload:async $=>{try{const W=on(await m({file:$}));l(R=>({...R,icon_image:W}))}catch(W){const R=W;R.response.status===415&&(R.message="Unsupported file type"),y(R)}},children:"Upload icon"})}),s.jsx("div",{className:"flex grow flex-col",children:s.jsxs(tt,{children:[s.jsx(Ae,{error:!!p.name,hint:p.name,maxLength:191,title:"Title",value:h.name,onChange:$=>l(W=>({...W,name:$.target.value})),onKeyDown:()=>x("name")}),s.jsx(Ae,{maxLength:2e3,title:"Description",value:h.description||"",onChange:$=>l(W=>({...W,description:$.target.value}))}),s.jsx(al,{keys:[{label:"Content API key",text:k?.secret,hint:A?s.jsx("div",{className:"text-green",children:"Content API Key was successfully regenerated"}):void 0,onRegenerate:()=>k&&O(k,C)},{label:"Admin API key",text:_?.secret,hint:M?s.jsx("div",{className:"text-green",children:"Admin API Key was successfully regenerated"}):void 0,onRegenerate:()=>_&&O(_,T)},{label:"API URL",text:window.location.origin+no().subdir}]})]})})]}),s.jsx("div",{children:s.jsx(ej,{integration:e})})]})},rj=({params:e})=>{const{data:{integrations:n}={}}=Qf(),a=n?.find(({id:o})=>o===e?.id);return a?s.jsx(tj,{integration:a}):null},nj=ye.create(rj),sj=({problem:e})=>{const[n,a]=D.useState(!1),o=()=>{a(!n)};return s.jsx(On,{title:s.jsxs(s.Fragment,{children:[s.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?s.jsx("strong",{children:"Fatal: "}):s.jsx("strong",{children:e.level==="error"?"Error: ":"Warning: "}),s.jsx("span",{dangerouslySetInnerHTML:{__html:e.rule}}),s.jsx("div",{className:"absolute -right-4 top-1",children:s.jsx(Ue,{color:"green",icon:n?"chevron-down":"chevron-right",iconColorClass:"text-grey-700",size:"sm",link:!0,onClick:()=>o()})})]}),n?s.jsxs("div",{className:"mt-2 px-4 text-[13px] leading-8",children:[s.jsx("div",{dangerouslySetInnerHTML:{__html:e.details},className:"mb-4"}),s.jsx(bt,{level:6,children:"Affected files:"}),s.jsx("ul",{className:"mt-1",children:e.failures.map(c=>s.jsxs("li",{children:[s.jsx("code",{children:c.ref}),c.message?`: ${c.message}`:""]}))})]}):null]}),hideActions:!0,separator:!0})},aj=({title:e,prompt:n,fatalErrors:a,onRetry:o})=>{let c=null;return a&&(c=s.jsx("div",{className:"mt-10",children:s.jsx(cn,{title:"Errors",children:a.map(m=>typeof m.details=="object"&&m.details.errors&&m.details.errors.length>0?m.details.errors.map(y=>s.jsx(sj,{problem:y})):typeof m.details=="string"?s.jsx(On,{title:m.details}):null)})})),s.jsx(qg,{cancelLabel:"Close",okColor:"black",okLabel:"Retry",prompt:s.jsxs(s.Fragment,{children:[n,c]}),title:e,onOk:o})},rx=ye.create(aj),hd=()=>{const e=V_(),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 oj(e){let n=e.package?.name||e.name;return Q_(e)?n+=" (default)":J_(e)?n+=" (legacy)":e.package?.name!==e.name&&(n=s.jsxs("span",{className:"text-sm md:text-base",children:[n," ",s.jsxs("span",{className:"text-grey-600",children:["(",e.name,")"]})]})),Yg(e)&&(n=s.jsxs("span",{className:"text-sm font-bold md:text-base",children:[n," — ",s.jsx("span",{className:"text-green",children:" Active"})]})),n}function ij(e){return e.package?.version||"1.0"}const lj=({theme:e})=>{const{mutateAsync:n}=Jf(),{mutateAsync:a}=e2(),{refreshActiveThemeData:o}=hd(),c=ot(),m=async()=>{try{await n(e.name),o(),xt({title:"Theme activated",type:"success",message:s.jsxs("div",{children:[s.jsx("span",{className:"capitalize",children:e.name})," is now your active theme"]})})}catch(p){let x=null;p instanceof ts&&p.response?.status===422&&p.data?.errors?x=p.data.errors:c(p);let v="Invalid Theme",_=s.jsx(s.Fragment,{children:"This theme is invalid and cannot be activated. Fix the following errors and re-upload the theme"});x&&ye.show(rx,{title:v,prompt:_,fatalErrors:x,onRetry:async k=>{k?.remove(),m()}})}},y=async()=>{const{apiRoot:p}=no();g_(`${p}/themes/${e.name}/download`)},h=async()=>{ye.show(Et,{title:"Are you sure you want to delete this?",prompt:s.jsxs(s.Fragment,{children:["You are about to delete ",s.jsxs("strong",{children:['"',e.name,'".']})," This is permanent! We warned you, k? Maybe download"," ",s.jsx("span",{className:"cursor-pointer text-green-500",onClick:()=>{y()},children:"your theme before continuing"})]}),okLabel:"Delete",okRunningLabel:"Deleting",okColor:"red",onOk:async p=>{try{await a(e.name),p?.remove()}catch(x){c(x)}}})};let l=[];Yg(e)||l.push(s.jsx(Ue,{className:"ml-2",color:"green",label:"Activate",link:!0,onClick:m},"activate"));let f=[{id:"download",label:"Download",onClick:y}];t2(e)&&f.push({id:"delete",label:"Delete",onClick:h});const u={iconColorClass:"text-base",size:"sm"};return s.jsxs("div",{className:"-mr-3 flex items-center gap-4",children:[l,s.jsx(E0,{items:f,position:"end",triggerButtonProps:u})]})},cj=({themes:e})=>(e.sort((n,a)=>n.active&&!a.active?-1:!n.active&&a.active?1:n.package?.name&&a.package?.name?n.package.name.localeCompare(a.package.name):n.name.localeCompare(a.name)),s.jsx(cn,{pageTitle:"Installed themes",children:e.map(n=>{const a=oj(n),o=ij(n);return s.jsx(On,{action:s.jsx(lj,{theme:n}),detail:o,id:`theme-${n.name}`,separator:!1,testId:"theme-list-item",title:a},n.name)})})),uj=({themes:e})=>s.jsx(ud,{children:s.jsx(cj,{themes:e})}),fj=""+new URL("footer-marketplace-bg-BpIYEF6z.png",import.meta.url).href,dj=3e3,Zh=e=>e.variants&&e.variants.length>0,fu=e=>{const n=[{category:e.category,previewUrl:e.previewUrl,image:e.image}];return e.variants&&e.variants.length>0&&n.push(...e.variants),n},pj=({onSelectTheme:e})=>{const n=r2(),[a,o]=D.useState(null),[c,m]=D.useState(0),y=h=>{o(h),m(h!==null&&Zh(h)&&fu(h).length>1?1:0)};return D.useEffect(()=>{if(a===null)return;const h=setInterval(()=>{m((c+1)%(fu(a).length||0))},dj);return()=>clearInterval(h)},[a,c]),s.jsxs(ud,{heading:"Themes",children:[s.jsx("div",{className:"mt-[6vmin] grid grid-cols-1 gap-[6vmin] sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4",children:n.map(h=>{const l=Zh(h),f=fu(h),u=a===h;return s.jsxs("button",{className:"flex cursor-pointer flex-col gap-3 text-left",type:"button",onClick:()=>{e?.(h)},children:[s.jsx("div",{className:"relative w-full bg-grey-100 shadow-md transition-all duration-500 hover:scale-[1.05]",onMouseEnter:()=>y(h),onMouseLeave:()=>y(null),children:l?s.jsx(s.Fragment,{children:f.map((p,x)=>s.jsx("img",{alt:`${h.name} Theme - ${p.category}`,className:we("size-full object-contain opacity-0 transition-opacity duration-500",{"opacity-100":x===c&&u||!u&&x===0,relative:x===c,absolute:x!==c,"left-0":x!==c,"top-0":x!==c}),src:p.image},`theme-variant-${p.category.toLowerCase()}`))}):s.jsx("img",{alt:`${h.name} Theme`,className:"size-full object-contain",src:h.image})}),s.jsxs("div",{className:"relative mt-3",children:[s.jsx(bt,{level:4,children:h.name}),l?f.map((p,x)=>s.jsx("span",{className:we("absolute left-0 translate-y-px text-sm text-grey-700 opacity-0",{"opacity-100":x===c&&u||!u&&x===0}),children:p.category})):s.jsx("span",{className:"text-sm text-grey-700",children:h.category})]})]},h.name)})}),s.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(${fj}) 100% 100% / 35vw no-repeat`},children:["Find and buy third-party, premium themes from independent developers in the ",s.jsx("a",{className:"inline-block font-semibold text-lime",href:"https://ghost.org/themes/",rel:"noopener noreferrer",target:"_blank",children:"Ghost Marketplace →"})]})]})},Vh=({problem:e})=>{const[n,a]=D.useState(!1);return s.jsx(On,{title:s.jsxs(s.Fragment,{children:[s.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:[s.jsx("strong",{children:e.level==="error"?"Error: ":"Warning: "}),s.jsx("span",{dangerouslySetInnerHTML:{__html:e.rule}}),s.jsx("div",{className:"absolute -right-4 top-1",children:s.jsx(Ue,{color:"green",icon:n?"chevron-down":"chevron-right",iconColorClass:"text-grey-700",size:"sm",link:!0,onClick:()=>a(!n)})})]}),n?s.jsxs("div",{className:"mt-2 px-4 text-[13px] leading-8",children:[s.jsx("div",{dangerouslySetInnerHTML:{__html:e.details},className:"mb-4"}),s.jsx(bt,{level:6,children:"Affected files:"}),s.jsx("ul",{className:"mt-1",children:e.failures.map(o=>s.jsxs("li",{children:[s.jsx("code",{children:o.ref}),o.message?`: ${o.message}`:""]},o.ref))})]}):null]}),hideActions:!0,separator:!0})},hj=({title:e,prompt:n,installedTheme:a,onActivate:o})=>{const{mutateAsync:c}=Jf(),{refreshActiveThemeData:m}=hd(),y=ot();let h=null;a&&a.errors&&(h=s.jsx("div",{className:"mt-6",children:s.jsx(cn,{hint:s.jsxs(s.Fragment,{children:["Highly recommended to fix, functionality ",s.jsx("strong",{children:"could"})," be restricted"]}),title:"Errors",children:a.errors?.map((u,p)=>s.jsx(Vh,{problem:u},p))})}));let l=null;a&&a.warnings&&(l=s.jsx("div",{className:"mt-10",children:s.jsx(cn,{title:"Warnings",children:a.warnings?.map((u,p)=>s.jsx(Vh,{problem:u},p))})}));let f=`Activate${a.errors?.length?" with errors":""}`;return a.active&&(f="OK"),s.jsx(qg,{cancelLabel:"Close",okColor:"black",okLabel:f,okRunningLabel:"Activating...",prompt:s.jsxs(s.Fragment,{children:[n,h,l]}),title:e,onOk:async u=>{if(!a.active)try{const x=(await c(a.name)).themes[0];m(),xt({title:"Theme activated",type:"success",message:s.jsxs("div",{children:[s.jsx("span",{className:"capitalize",children:x.name})," is now your active theme."]})})}catch(p){y(p)}o?.(),u?.remove()}})},nx=ye.create(hj),Qh=e=>e.variants&&e.variants.length>0,Jh=e=>{const n=[{image:e.image,category:e.category,previewUrl:e.previewUrl}];return e.variants&&e.variants.length>0&&n.push(...e.variants),n},em=e=>e.category.toLowerCase(),mj=({selectedTheme:e,isInstalling:n,installedTheme:a,onBack:o,onInstall:c})=>{const[m,y]=D.useState("desktop"),[h,l]=D.useState(void 0);if(!e)return null;let f=e.previewUrl;const u=Jh(e).map(k=>({label:k.category,value:em(k)}));Qh(e)&&(h===void 0&&l(u[0]),f=Jh(e).find(k=>em(k)===h?.value)?.previewUrl||f);let p=`Install ${e.name}`;n?p="Installing...":qi(e)&&!a?.active?p=`Activate ${e.name}`:a&&(p=`Update ${e.name}`);const x=()=>{c?.()},v=s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(fd,{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}),Qh(e)?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"hidden md:!visible md:!block",children:"–"}),s.jsx(Lt,{border:!1,containerClassName:"text-sm font-bold",controlClasses:{menu:"w-24"},fullWidth:!1,options:u,selectedOption:h,clearBg:!0,onSelect:k=>{l(k||void 0)}})]}):null]}),_=s.jsxs("div",{className:"flex justify-end gap-8",children:[s.jsx(an,{buttons:[{icon:"laptop",iconColorClass:m==="desktop"?"text-black dark:text-green":"text-grey-500 dark:text-grey-600",link:!0,size:"sm",onClick:()=>{y("desktop")}},{icon:"mobile",iconColorClass:m==="mobile"?"text-black dark:text-green":"text-grey-500 dark:text-grey-600",link:!0,size:"sm",onClick:()=>{y("mobile")}}]}),s.jsx(Ue,{color:"green",disabled:n,label:n?"Installing...":p,onClick:x})]});return s.jsxs("div",{className:"absolute inset-0 z-[100]",children:[s.jsx(F0,{containerClassName:"bg-grey-50 dark:bg-black z-[100]",left:v,right:_,sticky:!1}),s.jsx("div",{className:"flex h-[calc(100%-92px)] grow flex-col items-center justify-center bg-grey-50 dark:bg-black",children:m==="desktop"?s.jsx(l0,{children:s.jsx("iframe",{className:"size-full",src:f,title:"Theme preview"})}):s.jsx(c0,{children:s.jsx("iframe",{className:"size-full",src:f,title:"Theme preview"})})})]})},gj=({onUpload:e})=>{const n=Zt();return s.jsx("div",{className:"-mb-6",children:s.jsx(a2,{id:"theme-upload",onUpload:a=>{n.remove(),e(a)},children:s.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"})})})},xj=({currentTab:e,setCurrentTab:n,themes:a})=>{const o=Zt(),{updateRoute:c}=Qe(),{mutateAsync:m}=s2(),{checkThemeLimitError:y,isThemeLimited:h}=td(),l=ot(),[f,u]=D.useState(),[p,x]=D.useState(!1);D.useEffect(()=>{(async()=>{if(h){const O=await y(".");u({enabled:!1,error:O||"Your current plan doesn't support uploading custom themes."})}else u({enabled:!0})})()},[y,h]);const v=()=>{c("/")},_=async C=>{const O=C?.name.replace(/\.zip$/,""),$=a.map(W=>W.name);qi({name:O})?ye.show(Et,{title:"Upload failed",cancelLabel:"Cancel",okLabel:"",prompt:s.jsxs(s.Fragment,{children:[s.jsxs("p",{children:["The default ",s.jsx("strong",{children:O})," theme cannot be overwritten."]}),s.jsx("p",{children:"Rename your zip file and try again."})]}),onOk:async W=>{W?.remove()}}):$.includes(O)?ye.show(Et,{title:"Overwrite theme",prompt:s.jsxs(s.Fragment,{children:["The theme ",s.jsx("strong",{children:O})," already exists. Do you want to overwrite it?"]}),okLabel:"Overwrite",cancelLabel:"Cancel",okRunningLabel:"Overwriting...",okColor:"red",onOk:async W=>{x(!0);const R=$.indexOf(O);a.splice(R,1),await k({file:C,onActivate:v}),x(!1),n("installed"),W?.remove()}}):(n("installed"),k({file:C,onActivate:v}))},k=async({file:C,onActivate:O})=>{let $,W=null;try{x(!0),$=await m({file:C}),x(!1)}catch(q){x(!1),q instanceof ts&&q.response?.status===422&&q.data?.errors?W=q.data.errors:l(q)}if(W&&!$){let q="Invalid Theme",B=s.jsx(s.Fragment,{children:"This theme is invalid and cannot be activated. Fix the following errors and re-upload the theme"});ye.show(rx,{title:q,prompt:B,fatalErrors:W,onRetry:async()=>{o?.remove(),T()}})}if(!$)return;const R=$.themes[0];let Z="Upload successful",X=s.jsxs(s.Fragment,{children:[s.jsx("strong",{children:R.name})," uploaded"]});if(R.active||(X=s.jsxs(s.Fragment,{children:[X," ","Do you want to activate it now?"]})),R?.errors?.length||R.warnings?.length){const q=R?.errors?.length;Z=`Upload successful with ${q?"errors":"warnings"}`,X=s.jsxs(s.Fragment,{children:["The theme ",s.jsxs("strong",{children:['"',R.name,'"']})," was installed but we detected some ",q?"errors":"warnings","."]}),R.active||(X=s.jsxs(s.Fragment,{children:[X,"You are still able to activate and use the theme but it is recommended to fix these ",q?"errors":"warnings"," before you do so."]}))}ye.show(nx,{title:Z,prompt:X,installedTheme:R,onActivate:O})},M=s.jsx("div",{className:"hidden md:!visible md:!block",children:s.jsx(Dn,{border:!1,selectedTab:e,tabs:[{id:"official",title:"Official themes"},{id:"installed",title:"Installed"}],onTabChange:C=>{n(C)}})}),T=()=>{f&&(f.enabled?ye.show(Et,{title:"Upload theme",prompt:s.jsx(gj,{onUpload:_}),okLabel:"",formSheet:!1}):ye.show(Xr,{title:"Upgrade to enable custom themes",prompt:f.error||s.jsxs(s.Fragment,{children:["Your current plan only supports official themes. You can install them from the ",s.jsx("a",{href:"https://ghost.org/marketplace/",children:"Ghost theme marketplace"}),"."]}),onOk:()=>c({route:"/pro",isExternal:!0})}))},A=s.jsx("div",{className:"flex items-center gap-14",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Ue,{label:"Close",onClick:()=>{o.remove(),v()}}),s.jsx(Ue,{color:"black",label:"Upload theme",loading:p,onClick:T})]})});return s.jsxs(s.Fragment,{children:[s.jsx(F0,{containerClassName:"bg-white dark:bg-black",left:M,right:A}),s.jsx("div",{className:"px-[8vmin] md:hidden",children:s.jsx(Dn,{border:!1,selectedTab:e,tabs:[{id:"official",title:"Official themes"},{id:"installed",title:"Installed"}],onTabChange:C=>{n(C)}})})]})},bj=({currentTab:e,onSelectTheme:n,themes:a})=>{switch(e){case"official":return s.jsx(pj,{onSelectTheme:n});case"installed":return s.jsx(uj,{themes:a})}return null},tm=({source:e,themeRef:n})=>{const[a,o]=D.useState("official"),[c,m]=D.useState(null),[y,h]=D.useState("desktop"),[l,f]=D.useState(!1),[u,p]=D.useState(!1),[x,v]=D.useState(!1),{updateRoute:_}=Qe(),k=Zt(),{data:{themes:M}={}}=ed(),{mutateAsync:T}=n2(),{mutateAsync:A}=Jf(),{checkThemeLimitError:C}=td(),O=ot(),$=Z=>{m(Z)};if(D.useEffect(()=>{v(!0)},[]),D.useEffect(()=>{(async()=>{if(e&&n&&!u&&x){const X=n.split("/")[1];if(await C(X)){k.remove();return}let B="Install Theme";const Y=M?.map(ne=>ne.name)||[];let ae=Y.includes(X.toLowerCase());const ee=Y.indexOf(X.toLowerCase()),re=M?.[ee];let Q=s.jsxs(s.Fragment,{children:["By clicking below, ",s.jsx("strong",{children:X})," will automatically be activated as the theme for your site.",ae&&s.jsxs(s.Fragment,{children:[s.jsx("br",{}),s.jsx("br",{}),"This will overwrite your existing version of ",s.jsx("strong",{children:X}),re?.active?" which is your active theme":"",". All custom changes will be lost."]})]});ye.show(Et,{title:B,prompt:Q,okLabel:"Install",cancelLabel:"Cancel",okRunningLabel:"Installing...",okColor:"black",onOk:async ne=>{let be;p(!0);try{ae&&M&&M.splice(ee,1),be=await T(n),be?.themes[0]&&(await A(be.themes[0].name),xt({title:"Theme activated",type:"success",message:s.jsxs("div",{children:[s.jsx("span",{className:"capitalize",children:be.themes[0].name})," is now your active theme"]})})),ne?.remove(),_("")}catch(je){O(je)}}})}})()},[n,e,T,O,A,_,M,u,C,k,x]),!M)return;let W,R;if(c){W=M.find(X=>X.name.toLowerCase()===c.name.toLowerCase()),R=async()=>{const X=await C(c.name);if(X){ye.show(Xr,{prompt:X,onOk:()=>_({route:"/pro",isExternal:!0})});return}return W&&!qi(c)?new Promise(q=>{ye.show(Et,{title:"Overwrite theme",prompt:s.jsxs(s.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 B=>{B?.remove(),await Z(),q()}})}):Z()};const Z=async()=>{let X="Success",q=s.jsx(s.Fragment,{});if(qi(c))X="Activate theme",q=s.jsxs(s.Fragment,{children:["By clicking below, ",s.jsx("strong",{children:c.name})," will automatically be activated as the theme for your site."]});else{f(!0);let B;try{B=await T(c.ref)}catch(ae){O(ae)}finally{f(!1)}if(!B)return;const Y=B.themes[0];if(X="Success",q=s.jsxs(s.Fragment,{children:[s.jsx("strong",{children:Y.name})," has been successfully installed."]}),Y.active||(q=s.jsxs(s.Fragment,{children:[q," ","Do you want to activate it now?"]})),Y.errors?.length||Y.warnings?.length){const ae=Y.errors?.length;X=`Installed with ${ae?"errors":"warnings"}`,q=s.jsxs(s.Fragment,{children:["The theme ",s.jsxs("strong",{children:['"',Y.name,'"']})," was installed successfully but we detected some ",ae?"errors":"warnings","."]}),Y.active||(q=s.jsxs(s.Fragment,{children:[q,"You are still able to activate and use the theme but it is recommended to contact the theme developer fix these ",ae?"errors":"warnings"," before you do so."]}))}W=Y}ye.show(nx,{title:X,prompt:q,installedTheme:W,onActivate:()=>{_("")}})}}return s.jsx(yt,{afterClose:()=>{_("")},animate:!1,cancelLabel:"",footer:!1,padding:!1,size:"full",testId:"theme-modal",title:"",scrolling:!0,onCancel:()=>{k.remove(),_("")},children:s.jsx("div",{className:"flex h-full justify-between",children:s.jsxs("div",{className:"grow",children:[c&&s.jsx(mj,{installedTheme:W,isInstalling:l,selectedTheme:c,onBack:()=>{m(null)},onClose:()=>{_("")},onInstall:R}),s.jsx(xj,{currentTab:a,modal:k,previewMode:y,selectedTheme:c,setCurrentTab:o,setPreviewMode:h,setSelectedTheme:m,themes:M}),!c&&s.jsx(bj,{currentTab:a,themes:M,onSelectTheme:$})]})})})},vj=({children:e,to:n,classNames:a})=>{const o=n||document.body;if(!o)return s.jsx(s.Fragment,{children:e});const c=m=>{m.stopPropagation()};return x_.createPortal(s.jsx("div",{className:a,onMouseDown:c,children:s.jsx("div",{children:e})}),o)};var wj=Object.defineProperty,yj=(e,n,a)=>n in e?wj(e,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[n]=a,jt=(e,n,a)=>yj(e,typeof n!="symbol"?n+"":n,a),sx={exports:{}},Wa={};/**
|
|
4
|
-
* @license React
|
|
5
|
-
* react-jsx-runtime.production.min.js
|
|
6
|
-
*
|
|
7
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the MIT license found in the
|
|
10
|
-
* LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/var rm;function _j(){if(rm)return Wa;rm=1;var e=at,n=Symbol.for("react.element"),a=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,c=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,m={key:!0,ref:!0,__self:!0,__source:!0};function y(h,l,f){var u,p={},x=null,v=null;f!==void 0&&(x=""+f),l.key!==void 0&&(x=""+l.key),l.ref!==void 0&&(v=l.ref);for(u in l)o.call(l,u)&&!m.hasOwnProperty(u)&&(p[u]=l[u]);if(h&&h.defaultProps)for(u in l=h.defaultProps,l)p[u]===void 0&&(p[u]=l[u]);return{$$typeof:n,type:h,key:x,ref:v,props:p,_owner:c.current}}return Wa.Fragment=a,Wa.jsx=y,Wa.jsxs=y,Wa}sx.exports=_j();var Fe=sx.exports;class kj{constructor(n=3){jt(this,"columnCount"),jt(this,"columns",[]),jt(this,"columnHeights"),this.columnCount=n,this.columns=[[]],this.columnHeights=null}reset(){let n=[],a=[];for(let o=0;o<this.columnCount;o+=1)n[o]=[],a[o]=0;this.columns=n,this.columnHeights=a}addColumns(){for(let n=0;n<this.columnCount;n++)this.columns.push([]),this.columnHeights.push(0)}addPhotoToColumns(n){this.columns||this.reset();let a=Math.min(...this.columnHeights),o=this.columnHeights.indexOf(a);this.columnHeights[o]+=300*n.ratio,this.columns[o].push(n)}getColumns(){return this.columns}changeColumnCount(n){n!==this.columnCount&&(this.columnCount=n,this.reset())}}const Mj=e=>D.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",...e},D.createElement("path",{d:"M20 5.5l-8 8-8-8m-3.5 13h23",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10,fill:"none"})),jj=e=>D.createElement("svg",{viewBox:"0 0 32 32",...e},D.createElement("path",{d:"M17.4 29c-.8.8-2 .8-2.8 0L2.3 16.2C-.8 13.1-.8 8 2.3 4.8c3.1-3.1 8.2-3.1 11.3 0L16 7.6l2.3-2.8c3.1-3.1 8.2-3.1 11.3 0 3.1 3.1 3.1 8.2 0 11.4L17.4 29z"})),Ej={heart:jj,download:Mj},du=({icon:e,label:n,...a})=>{let o=null;return e&&(o=Ej[e]),Fe.jsxs("a",{className:"text-grey-700 flex h-8 shrink-0 cursor-pointer items-center rounded-md bg-white px-3 py-2 font-sans text-sm font-medium leading-6 opacity-90 transition-all ease-in-out hover:opacity-100",onClick:c=>c.stopPropagation(),...a,children:[e&&o&&Fe.jsx(o,{className:`size-4 ${e==="heart"?"fill-red":""} stroke-[3px] ${n&&"mr-1"}`}),n&&Fe.jsx("span",{children:n})]})},ax=({payload:e,srcUrl:n,links:a,likes:o,user:c,alt:m,urls:y,height:h,width:l,zoomed:f,insertImage:u,selectImg:p})=>{const x=v=>{v.stopPropagation(),p(f?null:e)};return Fe.jsxs("div",{className:`relative mb-6 block ${f?"h-full w-[max-content] cursor-zoom-out":"w-full cursor-zoom-in"}`,style:{backgroundColor:e.color||"transparent"},"data-kg-unsplash-gallery-item":!0,onClick:x,children:[Fe.jsx("img",{alt:m,className:`${f?"h-full w-auto object-contain":"block h-auto"}`,height:h,loading:"lazy",src:n,width:l,"data-kg-unsplash-gallery-img":!0}),Fe.jsxs("div",{className:"absolute inset-0 flex flex-col justify-between bg-gradient-to-b from-black/5 via-black/5 to-black/30 p-5 opacity-0 transition-all ease-in-out hover:opacity-100",children:[Fe.jsxs("div",{className:"flex items-center justify-end gap-3",children:[Fe.jsx(du,{"data-kg-button":"unsplash-like",href:`${a.html}/?utm_source=ghost&utm_medium=referral&utm_campaign=api-credit`,icon:"heart",label:o.toString(),rel:"noopener noreferrer",target:"_blank"}),Fe.jsx(du,{"data-kg-button":"unsplash-download",href:`${a.download}/?utm_source=ghost&utm_medium=referral&utm_campaign=api-credit&force=true`,icon:"download"})]}),Fe.jsxs("div",{className:"flex items-center justify-between",children:[Fe.jsxs("div",{className:"flex items-center",children:[Fe.jsx("img",{alt:"author",className:"mr-2 size-8 rounded-full",src:c.profile_image.medium}),Fe.jsx("div",{className:"mr-2 truncate font-sans text-sm font-medium text-white",children:c.name})]}),Fe.jsx(du,{label:"Insert image","data-kg-unsplash-insert-button":!0,onClick:v=>{v.stopPropagation(),u({src:y.regular.replace(/&w=1080/,"&w=2000"),caption:`<span>Photo by <a href="${c.links.html}">${c.name}</a> / <a href="https://unsplash.com/?utm_source=ghost&utm_medium=referral&utm_campaign=api-credit">Unsplash</a></span>`,height:h,width:l,alt:m,links:a})}})]})]})]})},Tj=({payload:e,insertImage:n,selectImg:a,zoomed:o})=>Fe.jsx("div",{className:"flex h-full grow basis-0 justify-center","data-kg-unsplash-zoomed":!0,onClick:()=>a(null),children:Fe.jsx(ax,{alt:e.alt_description,height:e.height,insertImage:n,likes:e.likes,links:e.links,payload:e,selectImg:a,srcUrl:e.urls.regular,urls:e.urls,user:e.user,width:e.width,zoomed:o})}),Sj=()=>Fe.jsx("div",{className:"absolute inset-y-0 left-0 flex w-full items-center justify-center overflow-hidden pb-[8vh]","data-kg-loader":!0,children:Fe.jsx("div",{className:"animate-spin before:bg-grey-800 relative inline-block size-[50px] rounded-full border border-black/10 before:z-10 before:mt-[7px] before:block before:size-[7px] before:rounded-full"})}),Nj=e=>Fe.jsx("div",{className:"mr-6 flex grow basis-0 flex-col justify-start last-of-type:mr-0",children:e.children}),Aj=e=>e!=null&&e.columns?e?.columns.map((n,a)=>Fe.jsx(Nj,{children:n.map(o=>Fe.jsx(ax,{alt:o.alt_description,height:o.height,insertImage:e?.insertImage,likes:o.likes,links:o.links,payload:o,selectImg:e?.selectImg,srcUrl:o.urls.regular,urls:o.urls,user:o.user,width:o.width,zoomed:e?.zoomed||null},o.id))},a)):null,pu=e=>Fe.jsx("div",{className:"relative h-full overflow-hidden","data-kg-unsplash-gallery":!0,children:Fe.jsxs("div",{ref:e.galleryRef,className:`flex size-full justify-center overflow-auto px-20 ${e!=null&&e.zoomed?"pb-10":""}`,"data-kg-unsplash-gallery-scrollref":!0,children:[e.children,e?.isLoading&&Fe.jsx(Sj,{})]})}),Ij=({zoomed:e,error:n,galleryRef:a,isLoading:o,dataset:c,selectImg:m,insertImage:y})=>e?Fe.jsx(pu,{galleryRef:a,zoomed:e,children:Fe.jsx(Tj,{alt:e.alt_description,height:e.height,insertImage:y,likes:e.likes,links:e.links,payload:e,selectImg:m,srcUrl:e.urls.regular,urls:e.urls,user:e.user,width:e.width,zoomed:e})}):n?Fe.jsx(pu,{galleryRef:a,zoomed:e,children:Fe.jsxs("div",{className:"flex h-full flex-col items-center justify-center",children:[Fe.jsx("h1",{className:"mb-4 text-2xl font-bold",children:"Error"}),Fe.jsx("p",{className:"text-lg font-medium",children:n})]})}):Fe.jsx(pu,{galleryRef:a,isLoading:o,zoomed:e,children:Fe.jsx(Aj,{columns:c,insertImage:y,selectImg:m,zoomed:e})}),Cj=e=>D.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",strokeWidth:1.5,viewBox:"0 0 24 24",...e},D.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M.75 23.249l22.5-22.5M23.25 23.249L.75.749"})),Dj=e=>D.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",strokeWidth:1.5,viewBox:"0 0 24 24",...e},D.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M1.472 13.357a9.063 9.063 0 1 0 16.682-7.09 9.063 9.063 0 1 0-16.682 7.09Zm14.749 2.863 7.029 7.03"})),Rj=e=>D.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 122.43 122.41",...e},D.createElement("path",{d:"M83.86 54.15v34.13H38.57V54.15H0v68.26h122.43V54.15H83.86zM38.57 0h45.3v34.13h-45.3z"})),Oj=({closeModal:e,handleSearch:n,children:a})=>Fe.jsxs(Fe.Fragment,{children:[Fe.jsx("div",{className:"fixed inset-0 z-40 h-[100vh] bg-black opacity-60"}),Fe.jsxs("div",{className:"not-kg-prose fixed inset-8 z-50 overflow-hidden rounded bg-white shadow-xl","data-kg-modal":"unsplash",children:[Fe.jsx("button",{className:"absolute right-6 top-6 cursor-pointer",type:"button",children:Fe.jsx(Cj,{className:"text-grey-400 size-4 stroke-2","data-kg-modal-close-button":!0,onClick:()=>e()})}),Fe.jsxs("div",{className:"flex h-full flex-col",children:[Fe.jsxs("header",{className:"flex shrink-0 items-center justify-between px-20 py-10",children:[Fe.jsxs("h1",{className:"flex items-center gap-2 font-sans text-3xl font-bold text-black",children:[Fe.jsx(Rj,{className:"mb-1"}),"Unsplash"]}),Fe.jsxs("div",{className:"relative w-full max-w-sm",children:[Fe.jsx(Dj,{className:"text-grey-700 absolute left-4 top-1/2 size-4 -translate-y-2"}),Fe.jsx("input",{className:"border-grey-300 focus:border-grey-400 h-10 w-full rounded-full border border-solid pl-10 pr-8 font-sans text-md font-normal text-black focus-visible:outline-none",placeholder:"Search free high-resolution photos",autoFocus:!0,"data-kg-unsplash-search":!0,onChange:n})]})]}),a]})]})]}),$j=[{id:"TA5hw14Coh4",slug:"a-person-standing-on-a-sand-dune-in-the-desert-TA5hw14Coh4",alternative_slugs:{en:"a-person-standing-on-a-sand-dune-in-the-desert-TA5hw14Coh4"},created_at:"2024-02-07T22:39:36Z",updated_at:"2024-03-07T23:46:14Z",promoted_at:null,width:8640,height:5760,color:"#8c5940",blur_hash:"LKD]brE2IUr?Lgwci_NaDjR*ofoe",description:"NEOM will be home to one of the world’s largest nature reserves: a 25,000 sq km stretch of wilderness, encompassing two deserts divided by a mountain range. | NEOM, Saudi Arabia",alt_description:"a person standing on a sand dune in the desert",breadcrumbs:[],urls:{raw:"https://images.unsplash.com/photo-1707345512638-997d31a10eaa?ixid=M3wxMTc3M3wxfDF8YWxsfDF8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3",full:"https://images.unsplash.com/photo-1707345512638-997d31a10eaa?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDF8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=85",regular:"https://images.unsplash.com/photo-1707345512638-997d31a10eaa?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDF8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=1080",small:"https://images.unsplash.com/photo-1707345512638-997d31a10eaa?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDF8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=400",thumb:"https://images.unsplash.com/photo-1707345512638-997d31a10eaa?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDF8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1707345512638-997d31a10eaa"},links:{self:"https://api.unsplash.com/photos/a-person-standing-on-a-sand-dune-in-the-desert-TA5hw14Coh4",html:"https://unsplash.com/photos/a-person-standing-on-a-sand-dune-in-the-desert-TA5hw14Coh4",download:"https://unsplash.com/photos/TA5hw14Coh4/download?ixid=M3wxMTc3M3wxfDF8YWxsfDF8fHx8fHwyfHwxNzEwMTUzMjA1fA",download_location:"https://api.unsplash.com/photos/TA5hw14Coh4/download?ixid=M3wxMTc3M3wxfDF8YWxsfDF8fHx8fHwyfHwxNzEwMTUzMjA1fA"},likes:226,liked_by_user:!1,current_user_collections:[],sponsorship:{impression_urls:[],tagline:"Made to Change",tagline_url:"https://www.neom.com/en-us?utm_source=unsplash&utm_medium=referral",sponsor:{id:"mYizSrdJkkU",updated_at:"2024-03-11T08:54:08Z",username:"neom",name:"NEOM",first_name:"NEOM",last_name:null,twitter_username:"neom",portfolio_url:"http://www.neom.com",bio:"Located in the northwest of Saudi Arabia, NEOM’s diverse climate offers both sun-soaked beaches and snow-capped mountains. NEOM’s unique location will provide residents with enhanced livability while protecting 95% of the natural landscape.",location:"NEOM, Saudi Arabia",links:{self:"https://api.unsplash.com/users/neom",html:"https://unsplash.com/@neom",photos:"https://api.unsplash.com/users/neom/photos",likes:"https://api.unsplash.com/users/neom/likes",portfolio:"https://api.unsplash.com/users/neom/portfolio",following:"https://api.unsplash.com/users/neom/following",followers:"https://api.unsplash.com/users/neom/followers"},profile_image:{small:"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32",medium:"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64",large:"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},instagram_username:"discoverneom",total_collections:7,total_likes:1,total_photos:222,total_promoted_photos:72,accepted_tos:!0,for_hire:!1,social:{instagram_username:"discoverneom",portfolio_url:"http://www.neom.com",twitter_username:"neom",paypal_email:null}}},topic_submissions:{},user:{id:"mYizSrdJkkU",updated_at:"2024-03-11T08:54:08Z",username:"neom",name:"NEOM",first_name:"NEOM",last_name:null,twitter_username:"neom",portfolio_url:"http://www.neom.com",bio:"Located in the northwest of Saudi Arabia, NEOM’s diverse climate offers both sun-soaked beaches and snow-capped mountains. NEOM’s unique location will provide residents with enhanced livability while protecting 95% of the natural landscape.",location:"NEOM, Saudi Arabia",links:{self:"https://api.unsplash.com/users/neom",html:"https://unsplash.com/@neom",photos:"https://api.unsplash.com/users/neom/photos",likes:"https://api.unsplash.com/users/neom/likes",portfolio:"https://api.unsplash.com/users/neom/portfolio",following:"https://api.unsplash.com/users/neom/following",followers:"https://api.unsplash.com/users/neom/followers"},profile_image:{small:"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32",medium:"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64",large:"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},instagram_username:"discoverneom",total_collections:7,total_likes:1,total_photos:222,total_promoted_photos:72,accepted_tos:!0,for_hire:!1,social:{instagram_username:"discoverneom",portfolio_url:"http://www.neom.com",twitter_username:"neom",paypal_email:null}}},{id:"UArA9A02Kvk",slug:"a-black-and-white-photo-of-a-man-with-his-head-in-his-hands-UArA9A02Kvk",alternative_slugs:{en:"a-black-and-white-photo-of-a-man-with-his-head-in-his-hands-UArA9A02Kvk"},created_at:"2024-03-05T15:48:31Z",updated_at:"2024-03-11T06:59:25Z",promoted_at:"2024-03-11T06:59:25Z",width:2160,height:2700,color:"#262626",blur_hash:"L78;S$~p00oLD%D%IVay9F9ZIUay",description:null,alt_description:"a black and white photo of a man with his head in his hands",breadcrumbs:[],urls:{raw:"https://images.unsplash.com/photo-1709653688483-fc2b356c1f36?ixid=M3wxMTc3M3wwfDF8YWxsfDJ8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3",full:"https://images.unsplash.com/photo-1709653688483-fc2b356c1f36?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDJ8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=85",regular:"https://images.unsplash.com/photo-1709653688483-fc2b356c1f36?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDJ8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=1080",small:"https://images.unsplash.com/photo-1709653688483-fc2b356c1f36?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDJ8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=400",thumb:"https://images.unsplash.com/photo-1709653688483-fc2b356c1f36?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDJ8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1709653688483-fc2b356c1f36"},links:{self:"https://api.unsplash.com/photos/a-black-and-white-photo-of-a-man-with-his-head-in-his-hands-UArA9A02Kvk",html:"https://unsplash.com/photos/a-black-and-white-photo-of-a-man-with-his-head-in-his-hands-UArA9A02Kvk",download:"https://unsplash.com/photos/UArA9A02Kvk/download?ixid=M3wxMTc3M3wwfDF8YWxsfDJ8fHx8fHwyfHwxNzEwMTUzMjA1fA",download_location:"https://api.unsplash.com/photos/UArA9A02Kvk/download?ixid=M3wxMTc3M3wwfDF8YWxsfDJ8fHx8fHwyfHwxNzEwMTUzMjA1fA"},likes:20,liked_by_user:!1,current_user_collections:[],sponsorship:null,topic_submissions:{},user:{id:"gwWL9kMcm2g",updated_at:"2024-03-11T10:14:07Z",username:"nickandreka",name:"Nick Andréka",first_name:"Nick",last_name:"Andréka",twitter_username:null,portfolio_url:null,bio:null,location:null,links:{self:"https://api.unsplash.com/users/nickandreka",html:"https://unsplash.com/@nickandreka",photos:"https://api.unsplash.com/users/nickandreka/photos",likes:"https://api.unsplash.com/users/nickandreka/likes",portfolio:"https://api.unsplash.com/users/nickandreka/portfolio",following:"https://api.unsplash.com/users/nickandreka/following",followers:"https://api.unsplash.com/users/nickandreka/followers"},profile_image:{small:"https://images.unsplash.com/profile-1698854198608-989031a5ccdeimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32",medium:"https://images.unsplash.com/profile-1698854198608-989031a5ccdeimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64",large:"https://images.unsplash.com/profile-1698854198608-989031a5ccdeimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},instagram_username:"andreka.art",total_collections:0,total_likes:8,total_photos:35,total_promoted_photos:19,accepted_tos:!0,for_hire:!0,social:{instagram_username:"andreka.art",portfolio_url:null,twitter_username:null,paypal_email:null}}},{id:"QX_7m4Lh2qg",slug:"a-black-and-white-photo-of-a-lighthouse-QX_7m4Lh2qg",alternative_slugs:{en:"a-black-and-white-photo-of-a-lighthouse-QX_7m4Lh2qg"},created_at:"2024-03-10T16:46:33Z",updated_at:"2024-03-11T06:59:11Z",promoted_at:"2024-03-11T06:59:11Z",width:4e3,height:5751,color:"#f3f3f3",blur_hash:"LAQJiu~X-;9G-:?cIURj~qD%00xt",description:null,alt_description:"a black and white photo of a lighthouse",breadcrumbs:[],urls:{raw:"https://images.unsplash.com/photo-1710088912041-34d1767d376a?ixid=M3wxMTc3M3wwfDF8YWxsfDN8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3",full:"https://images.unsplash.com/photo-1710088912041-34d1767d376a?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDN8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=85",regular:"https://images.unsplash.com/photo-1710088912041-34d1767d376a?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDN8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=1080",small:"https://images.unsplash.com/photo-1710088912041-34d1767d376a?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDN8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=400",thumb:"https://images.unsplash.com/photo-1710088912041-34d1767d376a?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDN8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1710088912041-34d1767d376a"},links:{self:"https://api.unsplash.com/photos/a-black-and-white-photo-of-a-lighthouse-QX_7m4Lh2qg",html:"https://unsplash.com/photos/a-black-and-white-photo-of-a-lighthouse-QX_7m4Lh2qg",download:"https://unsplash.com/photos/QX_7m4Lh2qg/download?ixid=M3wxMTc3M3wwfDF8YWxsfDN8fHx8fHwyfHwxNzEwMTUzMjA1fA",download_location:"https://api.unsplash.com/photos/QX_7m4Lh2qg/download?ixid=M3wxMTc3M3wwfDF8YWxsfDN8fHx8fHwyfHwxNzEwMTUzMjA1fA"},likes:21,liked_by_user:!1,current_user_collections:[],sponsorship:null,topic_submissions:{},user:{id:"ue6QWAAHoIQ",updated_at:"2024-03-11T08:53:54Z",username:"huzhewseh",name:"Volodymyr M",first_name:"Volodymyr",last_name:"M",twitter_username:"huzhewseh",portfolio_url:null,bio:null,location:null,links:{self:"https://api.unsplash.com/users/huzhewseh",html:"https://unsplash.com/@huzhewseh",photos:"https://api.unsplash.com/users/huzhewseh/photos",likes:"https://api.unsplash.com/users/huzhewseh/likes",portfolio:"https://api.unsplash.com/users/huzhewseh/portfolio",following:"https://api.unsplash.com/users/huzhewseh/following",followers:"https://api.unsplash.com/users/huzhewseh/followers"},profile_image:{small:"https://images.unsplash.com/profile-1663221970918-58b1620c49c9image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32",medium:"https://images.unsplash.com/profile-1663221970918-58b1620c49c9image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64",large:"https://images.unsplash.com/profile-1663221970918-58b1620c49c9image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},instagram_username:"huzhewseh",total_collections:0,total_likes:0,total_photos:18,total_promoted_photos:3,accepted_tos:!0,for_hire:!0,social:{instagram_username:"huzhewseh",portfolio_url:null,twitter_username:"huzhewseh",paypal_email:null}}},{id:"fMNP7XVcct0",slug:"a-woman-standing-in-a-dark-room-with-her-eyes-closed-fMNP7XVcct0",alternative_slugs:{en:"a-woman-standing-in-a-dark-room-with-her-eyes-closed-fMNP7XVcct0"},created_at:"2024-03-09T08:40:07Z",updated_at:"2024-03-11T06:58:58Z",promoted_at:"2024-03-11T06:58:58Z",width:3264,height:4928,color:"#262626",blur_hash:"L35hY|xu00D%-;xuIUD%00j[?bWB",description:null,alt_description:"a woman standing in a dark room with her eyes closed",breadcrumbs:[],urls:{raw:"https://images.unsplash.com/photo-1709973540503-77d699279634?ixid=M3wxMTc3M3wwfDF8YWxsfDR8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3",full:"https://images.unsplash.com/photo-1709973540503-77d699279634?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDR8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=85",regular:"https://images.unsplash.com/photo-1709973540503-77d699279634?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDR8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=1080",small:"https://images.unsplash.com/photo-1709973540503-77d699279634?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDR8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=400",thumb:"https://images.unsplash.com/photo-1709973540503-77d699279634?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDR8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1709973540503-77d699279634"},links:{self:"https://api.unsplash.com/photos/a-woman-standing-in-a-dark-room-with-her-eyes-closed-fMNP7XVcct0",html:"https://unsplash.com/photos/a-woman-standing-in-a-dark-room-with-her-eyes-closed-fMNP7XVcct0",download:"https://unsplash.com/photos/fMNP7XVcct0/download?ixid=M3wxMTc3M3wwfDF8YWxsfDR8fHx8fHwyfHwxNzEwMTUzMjA1fA",download_location:"https://api.unsplash.com/photos/fMNP7XVcct0/download?ixid=M3wxMTc3M3wwfDF8YWxsfDR8fHx8fHwyfHwxNzEwMTUzMjA1fA"},likes:7,liked_by_user:!1,current_user_collections:[],sponsorship:null,topic_submissions:{},user:{id:"lSlibqdw_c8",updated_at:"2024-03-11T08:54:13Z",username:"vitaliyshev89",name:"Vitaliy Shevchenko",first_name:"Vitaliy",last_name:"Shevchenko",twitter_username:null,portfolio_url:null,bio:null,location:"Kharkiv, Ukraine",links:{self:"https://api.unsplash.com/users/vitaliyshev89",html:"https://unsplash.com/@vitaliyshev89",photos:"https://api.unsplash.com/users/vitaliyshev89/photos",likes:"https://api.unsplash.com/users/vitaliyshev89/likes",portfolio:"https://api.unsplash.com/users/vitaliyshev89/portfolio",following:"https://api.unsplash.com/users/vitaliyshev89/following",followers:"https://api.unsplash.com/users/vitaliyshev89/followers"},profile_image:{small:"https://images.unsplash.com/profile-1652271342920-31eebbc2c3d0image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32",medium:"https://images.unsplash.com/profile-1652271342920-31eebbc2c3d0image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64",large:"https://images.unsplash.com/profile-1652271342920-31eebbc2c3d0image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},instagram_username:null,total_collections:0,total_likes:1,total_photos:205,total_promoted_photos:29,accepted_tos:!0,for_hire:!1,social:{instagram_username:null,portfolio_url:null,twitter_username:null,paypal_email:null}}},{id:"b4kKyX0BQvc",slug:"a-train-station-with-a-train-on-the-tracks-b4kKyX0BQvc",alternative_slugs:{en:"a-train-station-with-a-train-on-the-tracks-b4kKyX0BQvc"},created_at:"2024-03-08T21:58:28Z",updated_at:"2024-03-11T06:57:35Z",promoted_at:"2024-03-11T06:57:27Z",width:6e3,height:4e3,color:"#0c2626",blur_hash:"LSDJS6kD9Zxu~qkDM|xaS%j]xaV@",description:'Stunning metro train station "Elbbrücken" in Hamburg, Germany during sunset',alt_description:"a train station with a train on the tracks",breadcrumbs:[],urls:{raw:"https://images.unsplash.com/photo-1709934645859-f1ed8d3a4954?ixid=M3wxMTc3M3wwfDF8YWxsfDV8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3",full:"https://images.unsplash.com/photo-1709934645859-f1ed8d3a4954?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDV8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=85",regular:"https://images.unsplash.com/photo-1709934645859-f1ed8d3a4954?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDV8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=1080",small:"https://images.unsplash.com/photo-1709934645859-f1ed8d3a4954?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDV8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=400",thumb:"https://images.unsplash.com/photo-1709934645859-f1ed8d3a4954?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDV8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1709934645859-f1ed8d3a4954"},links:{self:"https://api.unsplash.com/photos/a-train-station-with-a-train-on-the-tracks-b4kKyX0BQvc",html:"https://unsplash.com/photos/a-train-station-with-a-train-on-the-tracks-b4kKyX0BQvc",download:"https://unsplash.com/photos/b4kKyX0BQvc/download?ixid=M3wxMTc3M3wwfDF8YWxsfDV8fHx8fHwyfHwxNzEwMTUzMjA1fA",download_location:"https://api.unsplash.com/photos/b4kKyX0BQvc/download?ixid=M3wxMTc3M3wwfDF8YWxsfDV8fHx8fHwyfHwxNzEwMTUzMjA1fA"},likes:8,liked_by_user:!1,current_user_collections:[],sponsorship:null,topic_submissions:{"street-photography":{status:"approved",approved_on:"2024-03-11T06:57:35Z"}},user:{id:"TffftDPlBPk",updated_at:"2024-03-11T06:59:04Z",username:"christianlue",name:"Christian Lue",first_name:"Christian",last_name:"Lue",twitter_username:"chrrischii",portfolio_url:null,bio:null,location:"Frankfurt / Berlin",links:{self:"https://api.unsplash.com/users/christianlue",html:"https://unsplash.com/@christianlue",photos:"https://api.unsplash.com/users/christianlue/photos",likes:"https://api.unsplash.com/users/christianlue/likes",portfolio:"https://api.unsplash.com/users/christianlue/portfolio",following:"https://api.unsplash.com/users/christianlue/following",followers:"https://api.unsplash.com/users/christianlue/followers"},profile_image:{small:"https://images.unsplash.com/profile-1581889127238-ea4aa40e8cb4image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32",medium:"https://images.unsplash.com/profile-1581889127238-ea4aa40e8cb4image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64",large:"https://images.unsplash.com/profile-1581889127238-ea4aa40e8cb4image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},instagram_username:null,total_collections:7,total_likes:15,total_photos:571,total_promoted_photos:103,accepted_tos:!0,for_hire:!0,social:{instagram_username:null,portfolio_url:null,twitter_username:"chrrischii",paypal_email:null}}},{id:"9633dHhioC8",slug:"a-person-walking-through-a-canyon-in-the-desert-9633dHhioC8",alternative_slugs:{en:"a-person-walking-through-a-canyon-in-the-desert-9633dHhioC8"},created_at:"2023-04-28T15:30:26Z",updated_at:"2024-03-10T10:46:58Z",promoted_at:"2023-05-13T12:02:35Z",width:8316,height:5544,color:"#734026",blur_hash:"LVHdd89G57-o.9IBsSR-~pD*M{xt",description:"Amongst expansive red sands and spectacular sandstone rock formations, Hisma Desert – NEOM, Saudi Arabia | The NEOM Nature Reserve region is being designed to deliver protection and restoration of biodiversity across 95% of NEOM.",alt_description:"a person walking through a canyon in the desert",breadcrumbs:[],urls:{raw:"https://images.unsplash.com/photo-1682695795255-b236b1f1267d?ixid=M3wxMTc3M3wxfDF8YWxsfDZ8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3",full:"https://images.unsplash.com/photo-1682695795255-b236b1f1267d?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDZ8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=85",regular:"https://images.unsplash.com/photo-1682695795255-b236b1f1267d?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDZ8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=1080",small:"https://images.unsplash.com/photo-1682695795255-b236b1f1267d?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDZ8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=400",thumb:"https://images.unsplash.com/photo-1682695795255-b236b1f1267d?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDZ8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1682695795255-b236b1f1267d"},links:{self:"https://api.unsplash.com/photos/a-person-walking-through-a-canyon-in-the-desert-9633dHhioC8",html:"https://unsplash.com/photos/a-person-walking-through-a-canyon-in-the-desert-9633dHhioC8",download:"https://unsplash.com/photos/9633dHhioC8/download?ixid=M3wxMTc3M3wxfDF8YWxsfDZ8fHx8fHwyfHwxNzEwMTUzMjA1fA",download_location:"https://api.unsplash.com/photos/9633dHhioC8/download?ixid=M3wxMTc3M3wxfDF8YWxsfDZ8fHx8fHwyfHwxNzEwMTUzMjA1fA"},likes:631,liked_by_user:!1,current_user_collections:[],sponsorship:{impression_urls:["https://secure.insightexpressai.com/adServer/adServerESI.aspx?script=false&bannerID=11515595&rnd=[timestamp]&redir=https://secure.insightexpressai.com/adserver/1pixel.gif","https://secure.insightexpressai.com/adServer/adServerESI.aspx?script=false&bannerID=11515798&rnd=[timestamp]&redir=https://secure.insightexpressai.com/adserver/1pixel.gif"],tagline:"Made to Change",tagline_url:"https://www.neom.com/en-us?utm_source=unsplash&utm_medium=referral",sponsor:{id:"mYizSrdJkkU",updated_at:"2024-03-11T08:54:08Z",username:"neom",name:"NEOM",first_name:"NEOM",last_name:null,twitter_username:"neom",portfolio_url:"http://www.neom.com",bio:"Located in the northwest of Saudi Arabia, NEOM’s diverse climate offers both sun-soaked beaches and snow-capped mountains. NEOM’s unique location will provide residents with enhanced livability while protecting 95% of the natural landscape.",location:"NEOM, Saudi Arabia",links:{self:"https://api.unsplash.com/users/neom",html:"https://unsplash.com/@neom",photos:"https://api.unsplash.com/users/neom/photos",likes:"https://api.unsplash.com/users/neom/likes",portfolio:"https://api.unsplash.com/users/neom/portfolio",following:"https://api.unsplash.com/users/neom/following",followers:"https://api.unsplash.com/users/neom/followers"},profile_image:{small:"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32",medium:"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64",large:"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},instagram_username:"discoverneom",total_collections:7,total_likes:1,total_photos:222,total_promoted_photos:72,accepted_tos:!0,for_hire:!1,social:{instagram_username:"discoverneom",portfolio_url:"http://www.neom.com",twitter_username:"neom",paypal_email:null}}},topic_submissions:{},user:{id:"mYizSrdJkkU",updated_at:"2024-03-11T08:54:08Z",username:"neom",name:"NEOM",first_name:"NEOM",last_name:null,twitter_username:"neom",portfolio_url:"http://www.neom.com",bio:"Located in the northwest of Saudi Arabia, NEOM’s diverse climate offers both sun-soaked beaches and snow-capped mountains. NEOM’s unique location will provide residents with enhanced livability while protecting 95% of the natural landscape.",location:"NEOM, Saudi Arabia",links:{self:"https://api.unsplash.com/users/neom",html:"https://unsplash.com/@neom",photos:"https://api.unsplash.com/users/neom/photos",likes:"https://api.unsplash.com/users/neom/likes",portfolio:"https://api.unsplash.com/users/neom/portfolio",following:"https://api.unsplash.com/users/neom/following",followers:"https://api.unsplash.com/users/neom/followers"},profile_image:{small:"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32",medium:"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64",large:"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},instagram_username:"discoverneom",total_collections:7,total_likes:1,total_photos:222,total_promoted_photos:72,accepted_tos:!0,for_hire:!1,social:{instagram_username:"discoverneom",portfolio_url:"http://www.neom.com",twitter_username:"neom",paypal_email:null}}},{id:"4PmYYBFhwFM",slug:"a-close-up-of-a-car-door-with-the-word-budder-on-it-4PmYYBFhwFM",alternative_slugs:{en:"a-close-up-of-a-car-door-with-the-word-budder-on-it-4PmYYBFhwFM"},created_at:"2024-03-09T18:40:37Z",updated_at:"2024-03-11T06:57:23Z",promoted_at:"2024-03-11T06:57:23Z",width:5248,height:7872,color:"#a6a6a6",blur_hash:"LHDA40%MbGxu%L?bt7of_N%gIBRj",description:null,alt_description:"a close up of a car door with the word budder on it",breadcrumbs:[],urls:{raw:"https://images.unsplash.com/photo-1710009439657-c0dfdc051a28?ixid=M3wxMTc3M3wwfDF8YWxsfDd8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3",full:"https://images.unsplash.com/photo-1710009439657-c0dfdc051a28?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDd8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=85",regular:"https://images.unsplash.com/photo-1710009439657-c0dfdc051a28?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDd8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=1080",small:"https://images.unsplash.com/photo-1710009439657-c0dfdc051a28?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDd8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=400",thumb:"https://images.unsplash.com/photo-1710009439657-c0dfdc051a28?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDd8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1710009439657-c0dfdc051a28"},links:{self:"https://api.unsplash.com/photos/a-close-up-of-a-car-door-with-the-word-budder-on-it-4PmYYBFhwFM",html:"https://unsplash.com/photos/a-close-up-of-a-car-door-with-the-word-budder-on-it-4PmYYBFhwFM",download:"https://unsplash.com/photos/4PmYYBFhwFM/download?ixid=M3wxMTc3M3wwfDF8YWxsfDd8fHx8fHwyfHwxNzEwMTUzMjA1fA",download_location:"https://api.unsplash.com/photos/4PmYYBFhwFM/download?ixid=M3wxMTc3M3wwfDF8YWxsfDd8fHx8fHwyfHwxNzEwMTUzMjA1fA"},likes:5,liked_by_user:!1,current_user_collections:[],sponsorship:null,topic_submissions:{},user:{id:"Xz7_QPPM2So",updated_at:"2024-03-11T08:27:09Z",username:"tiago_f_ferreira",name:"Tiago Ferreira",first_name:"Tiago",last_name:"Ferreira",twitter_username:null,portfolio_url:"https://tiagoferreira765.wixsite.com/photographyandmusic",bio:`Photography - a hobby, a passion.\r
|
|
12
|
-
Planet earth 🌎, a creative space to enjoy.`,location:"Lisboa, Portugal",links:{self:"https://api.unsplash.com/users/tiago_f_ferreira",html:"https://unsplash.com/@tiago_f_ferreira",photos:"https://api.unsplash.com/users/tiago_f_ferreira/photos",likes:"https://api.unsplash.com/users/tiago_f_ferreira/likes",portfolio:"https://api.unsplash.com/users/tiago_f_ferreira/portfolio",following:"https://api.unsplash.com/users/tiago_f_ferreira/following",followers:"https://api.unsplash.com/users/tiago_f_ferreira/followers"},profile_image:{small:"https://images.unsplash.com/profile-1595844391672-cdf854039843image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32",medium:"https://images.unsplash.com/profile-1595844391672-cdf854039843image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64",large:"https://images.unsplash.com/profile-1595844391672-cdf854039843image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},instagram_username:"tiago_f_ferreira",total_collections:1,total_likes:144,total_photos:205,total_promoted_photos:8,accepted_tos:!0,for_hire:!1,social:{instagram_username:"tiago_f_ferreira",portfolio_url:"https://tiagoferreira765.wixsite.com/photographyandmusic",twitter_username:null,paypal_email:null}}},{id:"BUhVFtY-890",slug:"a-close-up-of-a-bird-with-a-red-head-BUhVFtY-890",alternative_slugs:{en:"a-close-up-of-a-bird-with-a-red-head-BUhVFtY-890"},created_at:"2024-03-09T10:03:28Z",updated_at:"2024-03-11T06:57:20Z",promoted_at:"2024-03-11T06:57:20Z",width:3511,height:2231,color:"#262626",blur_hash:"L24epEWB0eMx$*t8OEV@RPj]baay",description:null,alt_description:"a close up of a bird with a red head",breadcrumbs:[],urls:{raw:"https://images.unsplash.com/photo-1709978601970-036e92662b46?ixid=M3wxMTc3M3wwfDF8YWxsfDh8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3",full:"https://images.unsplash.com/photo-1709978601970-036e92662b46?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDh8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=85",regular:"https://images.unsplash.com/photo-1709978601970-036e92662b46?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDh8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=1080",small:"https://images.unsplash.com/photo-1709978601970-036e92662b46?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDh8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=400",thumb:"https://images.unsplash.com/photo-1709978601970-036e92662b46?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDh8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1709978601970-036e92662b46"},links:{self:"https://api.unsplash.com/photos/a-close-up-of-a-bird-with-a-red-head-BUhVFtY-890",html:"https://unsplash.com/photos/a-close-up-of-a-bird-with-a-red-head-BUhVFtY-890",download:"https://unsplash.com/photos/BUhVFtY-890/download?ixid=M3wxMTc3M3wwfDF8YWxsfDh8fHx8fHwyfHwxNzEwMTUzMjA1fA",download_location:"https://api.unsplash.com/photos/BUhVFtY-890/download?ixid=M3wxMTc3M3wwfDF8YWxsfDh8fHx8fHwyfHwxNzEwMTUzMjA1fA"},likes:8,liked_by_user:!1,current_user_collections:[],sponsorship:null,topic_submissions:{"textures-patterns":{status:"rejected"},spring:{status:"rejected"},"earth-hour":{status:"approved",approved_on:"2024-03-10T12:31:10Z"},health:{status:"unevaluated"},animals:{status:"unevaluated"},film:{status:"unevaluated"},travel:{status:"unevaluated"},nature:{status:"unevaluated"},wallpapers:{status:"unevaluated"}},user:{id:"3SCC0WcF-wA",updated_at:"2024-03-11T09:44:02Z",username:"refargotohp",name:"refargotohp",first_name:"refargotohp",last_name:null,twitter_username:null,portfolio_url:null,bio:"Hello 👋🏼 My name is Pavel, and I am a photographer. I enjoy the photo in any of its manifestations. Sequential shooting, street, studio, portraiture - it's all me. Waiting for you on my social networks - @refargotohp",location:null,links:{self:"https://api.unsplash.com/users/refargotohp",html:"https://unsplash.com/@refargotohp",photos:"https://api.unsplash.com/users/refargotohp/photos",likes:"https://api.unsplash.com/users/refargotohp/likes",portfolio:"https://api.unsplash.com/users/refargotohp/portfolio",following:"https://api.unsplash.com/users/refargotohp/following",followers:"https://api.unsplash.com/users/refargotohp/followers"},profile_image:{small:"https://images.unsplash.com/profile-1653036388874-dab6bdb375bcimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32",medium:"https://images.unsplash.com/profile-1653036388874-dab6bdb375bcimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64",large:"https://images.unsplash.com/profile-1653036388874-dab6bdb375bcimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},instagram_username:"refargotohp",total_collections:1,total_likes:86,total_photos:132,total_promoted_photos:61,accepted_tos:!0,for_hire:!0,social:{instagram_username:"refargotohp",portfolio_url:null,twitter_username:null,paypal_email:null}}},{id:"99clkpyauJI",slug:"there-are-bottles-of-beer-on-a-shelf-in-front-of-a-window-99clkpyauJI",alternative_slugs:{en:"there-are-bottles-of-beer-on-a-shelf-in-front-of-a-window-99clkpyauJI"},created_at:"2024-03-10T00:15:28Z",updated_at:"2024-03-11T06:56:32Z",promoted_at:"2024-03-11T06:56:32Z",width:4299,height:3448,color:"#f3f3f3",blur_hash:"LjJuGn?bM{xu~qoKRPM{9FM{t6M_",description:null,alt_description:"there are bottles of beer on a shelf in front of a window",breadcrumbs:[],urls:{raw:"https://images.unsplash.com/photo-1710029721414-9e2125e155c3?ixid=M3wxMTc3M3wwfDF8YWxsfDl8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3",full:"https://images.unsplash.com/photo-1710029721414-9e2125e155c3?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDl8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=85",regular:"https://images.unsplash.com/photo-1710029721414-9e2125e155c3?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDl8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=1080",small:"https://images.unsplash.com/photo-1710029721414-9e2125e155c3?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDl8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=400",thumb:"https://images.unsplash.com/photo-1710029721414-9e2125e155c3?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDl8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1710029721414-9e2125e155c3"},links:{self:"https://api.unsplash.com/photos/there-are-bottles-of-beer-on-a-shelf-in-front-of-a-window-99clkpyauJI",html:"https://unsplash.com/photos/there-are-bottles-of-beer-on-a-shelf-in-front-of-a-window-99clkpyauJI",download:"https://unsplash.com/photos/99clkpyauJI/download?ixid=M3wxMTc3M3wwfDF8YWxsfDl8fHx8fHwyfHwxNzEwMTUzMjA1fA",download_location:"https://api.unsplash.com/photos/99clkpyauJI/download?ixid=M3wxMTc3M3wwfDF8YWxsfDl8fHx8fHwyfHwxNzEwMTUzMjA1fA"},likes:2,liked_by_user:!1,current_user_collections:[],sponsorship:null,topic_submissions:{film:{status:"approved",approved_on:"2024-03-10T16:39:06Z"}},user:{id:"TPCcwPbQzmY",updated_at:"2024-03-11T06:59:01Z",username:"suzm4film",name:"szm 4",first_name:"szm",last_name:"4",twitter_username:null,portfolio_url:null,bio:null,location:"Japan",links:{self:"https://api.unsplash.com/users/suzm4film",html:"https://unsplash.com/@suzm4film",photos:"https://api.unsplash.com/users/suzm4film/photos",likes:"https://api.unsplash.com/users/suzm4film/likes",portfolio:"https://api.unsplash.com/users/suzm4film/portfolio",following:"https://api.unsplash.com/users/suzm4film/following",followers:"https://api.unsplash.com/users/suzm4film/followers"},profile_image:{small:"https://images.unsplash.com/profile-1632890829763-5c518f873dee?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32",medium:"https://images.unsplash.com/profile-1632890829763-5c518f873dee?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64",large:"https://images.unsplash.com/profile-1632890829763-5c518f873dee?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},instagram_username:null,total_collections:0,total_likes:0,total_photos:189,total_promoted_photos:19,accepted_tos:!0,for_hire:!1,social:{instagram_username:null,portfolio_url:null,twitter_username:null,paypal_email:null}}},{id:"Lbt-cZyOUM4",slug:"an-old-fashioned-typewriter-sitting-on-a-table-in-front-of-a-window-Lbt-cZyOUM4",alternative_slugs:{en:"an-old-fashioned-typewriter-sitting-on-a-table-in-front-of-a-window-Lbt-cZyOUM4"},created_at:"2024-03-09T16:58:57Z",updated_at:"2024-03-11T06:57:06Z",promoted_at:"2024-03-11T06:55:38Z",width:5783,height:3848,color:"#0c2626",blur_hash:"LkG[.y01Ri-:?bM{RjofM{xuRkWB",description:null,alt_description:"an old fashioned typewriter sitting on a table in front of a window",breadcrumbs:[],urls:{raw:"https://images.unsplash.com/photo-1710003364549-de37d4ed3413?ixid=M3wxMTc3M3wwfDF8YWxsfDEwfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3",full:"https://images.unsplash.com/photo-1710003364549-de37d4ed3413?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDEwfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85",regular:"https://images.unsplash.com/photo-1710003364549-de37d4ed3413?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDEwfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080",small:"https://images.unsplash.com/photo-1710003364549-de37d4ed3413?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDEwfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400",thumb:"https://images.unsplash.com/photo-1710003364549-de37d4ed3413?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDEwfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1710003364549-de37d4ed3413"},links:{self:"https://api.unsplash.com/photos/an-old-fashioned-typewriter-sitting-on-a-table-in-front-of-a-window-Lbt-cZyOUM4",html:"https://unsplash.com/photos/an-old-fashioned-typewriter-sitting-on-a-table-in-front-of-a-window-Lbt-cZyOUM4",download:"https://unsplash.com/photos/Lbt-cZyOUM4/download?ixid=M3wxMTc3M3wwfDF8YWxsfDEwfHx8fHx8Mnx8MTcxMDE1MzIwNXw",download_location:"https://api.unsplash.com/photos/Lbt-cZyOUM4/download?ixid=M3wxMTc3M3wwfDF8YWxsfDEwfHx8fHx8Mnx8MTcxMDE1MzIwNXw"},likes:3,liked_by_user:!1,current_user_collections:[],sponsorship:null,topic_submissions:{},user:{id:"8D4VFtkiIuw",updated_at:"2024-03-11T07:28:57Z",username:"tama66",name:"Peter Herrmann",first_name:"Peter",last_name:"Herrmann",twitter_username:null,portfolio_url:null,bio:"Everything... but not boring! Instagram@Tiefstapler66",location:"Leverkusen/Germany",links:{self:"https://api.unsplash.com/users/tama66",html:"https://unsplash.com/@tama66",photos:"https://api.unsplash.com/users/tama66/photos",likes:"https://api.unsplash.com/users/tama66/likes",portfolio:"https://api.unsplash.com/users/tama66/portfolio",following:"https://api.unsplash.com/users/tama66/following",followers:"https://api.unsplash.com/users/tama66/followers"},profile_image:{small:"https://images.unsplash.com/profile-1611475141936-383e23c6cc6dimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32",medium:"https://images.unsplash.com/profile-1611475141936-383e23c6cc6dimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64",large:"https://images.unsplash.com/profile-1611475141936-383e23c6cc6dimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},instagram_username:"tiefstapler66",total_collections:1,total_likes:149,total_photos:363,total_promoted_photos:152,accepted_tos:!0,for_hire:!0,social:{instagram_username:"tiefstapler66",portfolio_url:null,twitter_username:null,paypal_email:null}}},{id:"D1jr0Mevs-c",slug:"an-aerial-view-of-a-body-of-water-D1jr0Mevs-c",alternative_slugs:{en:"an-aerial-view-of-a-body-of-water-D1jr0Mevs-c"},created_at:"2024-02-07T22:34:15Z",updated_at:"2024-03-10T10:54:36Z",promoted_at:null,width:5280,height:2970,color:"#0c2626",blur_hash:"LH9[JL0i+HM{^}Ezw#R.b@n$nhbb",description:"The Islands of NEOM are home to kaleidoscopic-coloured coral reefs and an abundance of diverse marine life | Islands of NEOM – NEOM, Saudi Arabia",alt_description:"an aerial view of a body of water",breadcrumbs:[],urls:{raw:"https://images.unsplash.com/photo-1707343843982-f8275f3994c5?ixid=M3wxMTc3M3wxfDF8YWxsfDExfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3",full:"https://images.unsplash.com/photo-1707343843982-f8275f3994c5?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDExfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85",regular:"https://images.unsplash.com/photo-1707343843982-f8275f3994c5?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDExfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080",small:"https://images.unsplash.com/photo-1707343843982-f8275f3994c5?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDExfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400",thumb:"https://images.unsplash.com/photo-1707343843982-f8275f3994c5?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDExfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1707343843982-f8275f3994c5"},links:{self:"https://api.unsplash.com/photos/an-aerial-view-of-a-body-of-water-D1jr0Mevs-c",html:"https://unsplash.com/photos/an-aerial-view-of-a-body-of-water-D1jr0Mevs-c",download:"https://unsplash.com/photos/D1jr0Mevs-c/download?ixid=M3wxMTc3M3wxfDF8YWxsfDExfHx8fHx8Mnx8MTcxMDE1MzIwNXw",download_location:"https://api.unsplash.com/photos/D1jr0Mevs-c/download?ixid=M3wxMTc3M3wxfDF8YWxsfDExfHx8fHx8Mnx8MTcxMDE1MzIwNXw"},likes:308,liked_by_user:!1,current_user_collections:[],sponsorship:{impression_urls:[],tagline:"Made to Change",tagline_url:"https://www.neom.com/en-us?utm_source=unsplash&utm_medium=referral",sponsor:{id:"mYizSrdJkkU",updated_at:"2024-03-11T08:54:08Z",username:"neom",name:"NEOM",first_name:"NEOM",last_name:null,twitter_username:"neom",portfolio_url:"http://www.neom.com",bio:"Located in the northwest of Saudi Arabia, NEOM’s diverse climate offers both sun-soaked beaches and snow-capped mountains. NEOM’s unique location will provide residents with enhanced livability while protecting 95% of the natural landscape.",location:"NEOM, Saudi Arabia",links:{self:"https://api.unsplash.com/users/neom",html:"https://unsplash.com/@neom",photos:"https://api.unsplash.com/users/neom/photos",likes:"https://api.unsplash.com/users/neom/likes",portfolio:"https://api.unsplash.com/users/neom/portfolio",following:"https://api.unsplash.com/users/neom/following",followers:"https://api.unsplash.com/users/neom/followers"},profile_image:{small:"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32",medium:"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64",large:"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},instagram_username:"discoverneom",total_collections:7,total_likes:1,total_photos:222,total_promoted_photos:72,accepted_tos:!0,for_hire:!1,social:{instagram_username:"discoverneom",portfolio_url:"http://www.neom.com",twitter_username:"neom",paypal_email:null}}},topic_submissions:{},user:{id:"mYizSrdJkkU",updated_at:"2024-03-11T08:54:08Z",username:"neom",name:"NEOM",first_name:"NEOM",last_name:null,twitter_username:"neom",portfolio_url:"http://www.neom.com",bio:"Located in the northwest of Saudi Arabia, NEOM’s diverse climate offers both sun-soaked beaches and snow-capped mountains. NEOM’s unique location will provide residents with enhanced livability while protecting 95% of the natural landscape.",location:"NEOM, Saudi Arabia",links:{self:"https://api.unsplash.com/users/neom",html:"https://unsplash.com/@neom",photos:"https://api.unsplash.com/users/neom/photos",likes:"https://api.unsplash.com/users/neom/likes",portfolio:"https://api.unsplash.com/users/neom/portfolio",following:"https://api.unsplash.com/users/neom/following",followers:"https://api.unsplash.com/users/neom/followers"},profile_image:{small:"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32",medium:"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64",large:"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},instagram_username:"discoverneom",total_collections:7,total_likes:1,total_photos:222,total_promoted_photos:72,accepted_tos:!0,for_hire:!1,social:{instagram_username:"discoverneom",portfolio_url:"http://www.neom.com",twitter_username:"neom",paypal_email:null}}},{id:"0RBEUjWQBBA",slug:"a-woman-standing-under-a-cherry-blossom-tree-0RBEUjWQBBA",alternative_slugs:{en:"a-woman-standing-under-a-cherry-blossom-tree-0RBEUjWQBBA"},created_at:"2024-03-10T10:15:48Z",updated_at:"2024-03-11T06:55:22Z",promoted_at:"2024-03-11T06:55:22Z",width:4672,height:7008,color:"#262626",blur_hash:"LOG8o{t7WBWB~DofR*j@D%NGR%WB",description:null,alt_description:"a woman standing under a cherry blossom tree",breadcrumbs:[],urls:{raw:"https://images.unsplash.com/photo-1710065574765-a685385c6d9a?ixid=M3wxMTc3M3wwfDF8YWxsfDEyfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3",full:"https://images.unsplash.com/photo-1710065574765-a685385c6d9a?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDEyfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85",regular:"https://images.unsplash.com/photo-1710065574765-a685385c6d9a?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDEyfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080",small:"https://images.unsplash.com/photo-1710065574765-a685385c6d9a?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDEyfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400",thumb:"https://images.unsplash.com/photo-1710065574765-a685385c6d9a?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDEyfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1710065574765-a685385c6d9a"},links:{self:"https://api.unsplash.com/photos/a-woman-standing-under-a-cherry-blossom-tree-0RBEUjWQBBA",html:"https://unsplash.com/photos/a-woman-standing-under-a-cherry-blossom-tree-0RBEUjWQBBA",download:"https://unsplash.com/photos/0RBEUjWQBBA/download?ixid=M3wxMTc3M3wwfDF8YWxsfDEyfHx8fHx8Mnx8MTcxMDE1MzIwNXw",download_location:"https://api.unsplash.com/photos/0RBEUjWQBBA/download?ixid=M3wxMTc3M3wwfDF8YWxsfDEyfHx8fHx8Mnx8MTcxMDE1MzIwNXw"},likes:11,liked_by_user:!1,current_user_collections:[],sponsorship:null,topic_submissions:{},user:{id:"ePlndXHeIiM",updated_at:"2024-03-11T09:04:03Z",username:"lwdzl",name:"Jack Dong",first_name:"Jack",last_name:"Dong",twitter_username:null,portfolio_url:"https://www.xiaohongshu.com/user/profile/5f11b998000000000101d8d2?xhsshare=CopyLink&appuid=5f11b998000000000101d8d2&apptime=1696562673",bio:null,location:null,links:{self:"https://api.unsplash.com/users/lwdzl",html:"https://unsplash.com/@lwdzl",photos:"https://api.unsplash.com/users/lwdzl/photos",likes:"https://api.unsplash.com/users/lwdzl/likes",portfolio:"https://api.unsplash.com/users/lwdzl/portfolio",following:"https://api.unsplash.com/users/lwdzl/following",followers:"https://api.unsplash.com/users/lwdzl/followers"},profile_image:{small:"https://images.unsplash.com/profile-1696563144074-80a8da44bcd4?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32",medium:"https://images.unsplash.com/profile-1696563144074-80a8da44bcd4?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64",large:"https://images.unsplash.com/profile-1696563144074-80a8da44bcd4?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},instagram_username:null,total_collections:0,total_likes:101,total_photos:640,total_promoted_photos:112,accepted_tos:!0,for_hire:!0,social:{instagram_username:null,portfolio_url:"https://www.xiaohongshu.com/user/profile/5f11b998000000000101d8d2?xhsshare=CopyLink&appuid=5f11b998000000000101d8d2&apptime=1696562673",twitter_username:null,paypal_email:null}}},{id:"2IGDvJa2Bd0",slug:"a-path-in-the-middle-of-a-foggy-forest-2IGDvJa2Bd0",alternative_slugs:{en:"a-path-in-the-middle-of-a-foggy-forest-2IGDvJa2Bd0"},created_at:"2024-02-21T14:32:53Z",updated_at:"2024-03-11T06:54:06Z",promoted_at:"2024-03-11T06:54:06Z",width:4672,height:5840,color:"#f3f3f3",blur_hash:"L#Gv00ofD%ay~qoeM_ay%NafWVj[",description:null,alt_description:"a path in the middle of a foggy forest",breadcrumbs:[],urls:{raw:"https://images.unsplash.com/photo-1708525736169-534ee3e24e99?ixid=M3wxMTc3M3wwfDF8YWxsfDEzfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3",full:"https://images.unsplash.com/photo-1708525736169-534ee3e24e99?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDEzfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85",regular:"https://images.unsplash.com/photo-1708525736169-534ee3e24e99?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDEzfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080",small:"https://images.unsplash.com/photo-1708525736169-534ee3e24e99?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDEzfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400",thumb:"https://images.unsplash.com/photo-1708525736169-534ee3e24e99?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDEzfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1708525736169-534ee3e24e99"},links:{self:"https://api.unsplash.com/photos/a-path-in-the-middle-of-a-foggy-forest-2IGDvJa2Bd0",html:"https://unsplash.com/photos/a-path-in-the-middle-of-a-foggy-forest-2IGDvJa2Bd0",download:"https://unsplash.com/photos/2IGDvJa2Bd0/download?ixid=M3wxMTc3M3wwfDF8YWxsfDEzfHx8fHx8Mnx8MTcxMDE1MzIwNXw",download_location:"https://api.unsplash.com/photos/2IGDvJa2Bd0/download?ixid=M3wxMTc3M3wwfDF8YWxsfDEzfHx8fHx8Mnx8MTcxMDE1MzIwNXw"},likes:11,liked_by_user:!1,current_user_collections:[],sponsorship:null,topic_submissions:{},user:{id:"zL5HAN1fnJw",updated_at:"2024-03-11T06:58:57Z",username:"viklukphotography",name:"Viktor Mischke",first_name:"Viktor",last_name:"Mischke",twitter_username:null,portfolio_url:"https://www.istockphoto.com/de/portfolio/snoviktor",bio:null,location:"Schloss Holte-Stukenbrock",links:{self:"https://api.unsplash.com/users/viklukphotography",html:"https://unsplash.com/@viklukphotography",photos:"https://api.unsplash.com/users/viklukphotography/photos",likes:"https://api.unsplash.com/users/viklukphotography/likes",portfolio:"https://api.unsplash.com/users/viklukphotography/portfolio",following:"https://api.unsplash.com/users/viklukphotography/following",followers:"https://api.unsplash.com/users/viklukphotography/followers"},profile_image:{small:"https://images.unsplash.com/profile-1646051425690-ed09fae6858fimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32",medium:"https://images.unsplash.com/profile-1646051425690-ed09fae6858fimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64",large:"https://images.unsplash.com/profile-1646051425690-ed09fae6858fimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},instagram_username:"viktormischke",total_collections:0,total_likes:141,total_photos:38,total_promoted_photos:8,accepted_tos:!0,for_hire:!1,social:{instagram_username:"viktormischke",portfolio_url:"https://www.istockphoto.com/de/portfolio/snoviktor",twitter_username:null,paypal_email:null}}},{id:"PZfeP0uwBpQ",slug:"a-person-with-a-hat-on-their-head-in-a-field-PZfeP0uwBpQ",alternative_slugs:{en:"a-person-with-a-hat-on-their-head-in-a-field-PZfeP0uwBpQ"},created_at:"2024-02-24T10:57:49Z",updated_at:"2024-03-11T06:53:56Z",promoted_at:"2024-03-11T06:53:56Z",width:2720,height:4080,color:"#404026",blur_hash:"LIB:Tx%K56NGORbYxas:0KRj-poe",description:"A woman wearing a traditional coolie hat kneels in a field of green vegetables, carefully harvesting the crops.",alt_description:"a person with a hat on their head in a field",breadcrumbs:[],urls:{raw:"https://images.unsplash.com/photo-1708771641703-0df3d179cec3?ixid=M3wxMTc3M3wwfDF8YWxsfDE0fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3",full:"https://images.unsplash.com/photo-1708771641703-0df3d179cec3?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE0fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85",regular:"https://images.unsplash.com/photo-1708771641703-0df3d179cec3?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE0fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080",small:"https://images.unsplash.com/photo-1708771641703-0df3d179cec3?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE0fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400",thumb:"https://images.unsplash.com/photo-1708771641703-0df3d179cec3?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE0fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1708771641703-0df3d179cec3"},links:{self:"https://api.unsplash.com/photos/a-person-with-a-hat-on-their-head-in-a-field-PZfeP0uwBpQ",html:"https://unsplash.com/photos/a-person-with-a-hat-on-their-head-in-a-field-PZfeP0uwBpQ",download:"https://unsplash.com/photos/PZfeP0uwBpQ/download?ixid=M3wxMTc3M3wwfDF8YWxsfDE0fHx8fHx8Mnx8MTcxMDE1MzIwNXw",download_location:"https://api.unsplash.com/photos/PZfeP0uwBpQ/download?ixid=M3wxMTc3M3wwfDF8YWxsfDE0fHx8fHx8Mnx8MTcxMDE1MzIwNXw"},likes:2,liked_by_user:!1,current_user_collections:[],sponsorship:null,topic_submissions:{people:{status:"rejected"},experimental:{status:"rejected"}},user:{id:"mWjiXj5vQuQ",updated_at:"2024-03-11T06:58:57Z",username:"chanwei_snap",name:"Chanwei",first_name:"Chanwei",last_name:null,twitter_username:null,portfolio_url:null,bio:`👋 Just a snap-happy amateur sharing my photos with you!\r
|
|
13
|
-
📍Instagram: @chanwei.snap\r
|
|
14
|
-
`,location:"Taipei, Taiwan",links:{self:"https://api.unsplash.com/users/chanwei_snap",html:"https://unsplash.com/@chanwei_snap",photos:"https://api.unsplash.com/users/chanwei_snap/photos",likes:"https://api.unsplash.com/users/chanwei_snap/likes",portfolio:"https://api.unsplash.com/users/chanwei_snap/portfolio",following:"https://api.unsplash.com/users/chanwei_snap/following",followers:"https://api.unsplash.com/users/chanwei_snap/followers"},profile_image:{small:"https://images.unsplash.com/profile-1705518610211-a929b876f4d5image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32",medium:"https://images.unsplash.com/profile-1705518610211-a929b876f4d5image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64",large:"https://images.unsplash.com/profile-1705518610211-a929b876f4d5image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},instagram_username:"chanwei.snap",total_collections:15,total_likes:63,total_photos:150,total_promoted_photos:2,accepted_tos:!0,for_hire:!1,social:{instagram_username:"chanwei.snap",portfolio_url:null,twitter_username:null,paypal_email:null}}},{id:"1JwHaWeSK9s",slug:"a-picture-of-some-white-flowers-on-a-white-background-1JwHaWeSK9s",alternative_slugs:{en:"a-picture-of-some-white-flowers-on-a-white-background-1JwHaWeSK9s"},created_at:"2024-03-10T11:33:51Z",updated_at:"2024-03-11T06:57:09Z",promoted_at:"2024-03-11T06:53:39Z",width:3586,height:3917,color:"#f3f3d9",blur_hash:"LIQ0T^j=_4%M%MxbM{M{_4jZITbH",description:"Title: Christmas eve Artist: Callowhill, James Publisher: L. Prang & Co. Name on Item: JC Date: [ca. 1861–1897] https://www.digitalcommonwealth.org/search/commonwealth:7w62f880r",alt_description:"a picture of some white flowers on a white background",breadcrumbs:[],urls:{raw:"https://images.unsplash.com/photo-1710069455079-2059d3cefe91?ixid=M3wxMTc3M3wwfDF8YWxsfDE1fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3",full:"https://images.unsplash.com/photo-1710069455079-2059d3cefe91?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE1fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85",regular:"https://images.unsplash.com/photo-1710069455079-2059d3cefe91?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE1fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080",small:"https://images.unsplash.com/photo-1710069455079-2059d3cefe91?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE1fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400",thumb:"https://images.unsplash.com/photo-1710069455079-2059d3cefe91?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE1fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1710069455079-2059d3cefe91"},links:{self:"https://api.unsplash.com/photos/a-picture-of-some-white-flowers-on-a-white-background-1JwHaWeSK9s",html:"https://unsplash.com/photos/a-picture-of-some-white-flowers-on-a-white-background-1JwHaWeSK9s",download:"https://unsplash.com/photos/1JwHaWeSK9s/download?ixid=M3wxMTc3M3wwfDF8YWxsfDE1fHx8fHx8Mnx8MTcxMDE1MzIwNXw",download_location:"https://api.unsplash.com/photos/1JwHaWeSK9s/download?ixid=M3wxMTc3M3wwfDF8YWxsfDE1fHx8fHx8Mnx8MTcxMDE1MzIwNXw"},likes:7,liked_by_user:!1,current_user_collections:[],sponsorship:null,topic_submissions:{},user:{id:"piFVWeoWxU8",updated_at:"2024-03-11T07:28:12Z",username:"bostonpubliclibrary",name:"Boston Public Library",first_name:"Boston",last_name:"Public Library",twitter_username:null,portfolio_url:"https://www.bpl.org/",bio:"Considered a pioneer of public library service in the United States, the Boston Public Library is among the three largest collections in the country and is committed to be ‘Free for All’.",location:"Boston, USA",links:{self:"https://api.unsplash.com/users/bostonpubliclibrary",html:"https://unsplash.com/@bostonpubliclibrary",photos:"https://api.unsplash.com/users/bostonpubliclibrary/photos",likes:"https://api.unsplash.com/users/bostonpubliclibrary/likes",portfolio:"https://api.unsplash.com/users/bostonpubliclibrary/portfolio",following:"https://api.unsplash.com/users/bostonpubliclibrary/following",followers:"https://api.unsplash.com/users/bostonpubliclibrary/followers"},profile_image:{small:"https://images.unsplash.com/profile-1579171056760-0293bb679901image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32",medium:"https://images.unsplash.com/profile-1579171056760-0293bb679901image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64",large:"https://images.unsplash.com/profile-1579171056760-0293bb679901image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},instagram_username:null,total_collections:6,total_likes:0,total_photos:510,total_promoted_photos:62,accepted_tos:!0,for_hire:!1,social:{instagram_username:null,portfolio_url:"https://www.bpl.org/",twitter_username:null,paypal_email:null}}},{id:"efzvMAIpfWY",slug:"a-couple-of-people-that-are-standing-in-the-dirt-efzvMAIpfWY",alternative_slugs:{en:"a-couple-of-people-that-are-standing-in-the-dirt-efzvMAIpfWY"},created_at:"2023-04-28T12:46:16Z",updated_at:"2024-03-11T09:48:19Z",promoted_at:null,width:9504,height:6336,color:"#c07359",blur_hash:"LELo7xNHxa~Bz:s9S4nO~VbwoLS~",description:"Amongst expansive red sands and spectacular sandstone rock formations, Hisma Desert – NEOM, Saudi Arabia | The NEOM Nature Reserve region is being designed to deliver protection and restoration of biodiversity across 95% of NEOM.",alt_description:"a couple of people that are standing in the dirt",breadcrumbs:[],urls:{raw:"https://images.unsplash.com/photo-1682685797742-42c9987a2c34?ixid=M3wxMTc3M3wxfDF8YWxsfDE2fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3",full:"https://images.unsplash.com/photo-1682685797742-42c9987a2c34?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDE2fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85",regular:"https://images.unsplash.com/photo-1682685797742-42c9987a2c34?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDE2fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080",small:"https://images.unsplash.com/photo-1682685797742-42c9987a2c34?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDE2fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400",thumb:"https://images.unsplash.com/photo-1682685797742-42c9987a2c34?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDE2fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1682685797742-42c9987a2c34"},links:{self:"https://api.unsplash.com/photos/a-couple-of-people-that-are-standing-in-the-dirt-efzvMAIpfWY",html:"https://unsplash.com/photos/a-couple-of-people-that-are-standing-in-the-dirt-efzvMAIpfWY",download:"https://unsplash.com/photos/efzvMAIpfWY/download?ixid=M3wxMTc3M3wxfDF8YWxsfDE2fHx8fHx8Mnx8MTcxMDE1MzIwNXw",download_location:"https://api.unsplash.com/photos/efzvMAIpfWY/download?ixid=M3wxMTc3M3wxfDF8YWxsfDE2fHx8fHx8Mnx8MTcxMDE1MzIwNXw"},likes:211,liked_by_user:!1,current_user_collections:[],sponsorship:{impression_urls:["https://secure.insightexpressai.com/adServer/adServerESI.aspx?script=false&bannerID=11515544&rnd=[timestamp]&redir=https://secure.insightexpressai.com/adserver/1pixel.gif","https://secure.insightexpressai.com/adServer/adServerESI.aspx?script=false&bannerID=11515747&rnd=[timestamp]&redir=https://secure.insightexpressai.com/adserver/1pixel.gif"],tagline:"Made to Change",tagline_url:"https://www.neom.com/en-us?utm_source=unsplash&utm_medium=referral",sponsor:{id:"mYizSrdJkkU",updated_at:"2024-03-11T08:54:08Z",username:"neom",name:"NEOM",first_name:"NEOM",last_name:null,twitter_username:"neom",portfolio_url:"http://www.neom.com",bio:"Located in the northwest of Saudi Arabia, NEOM’s diverse climate offers both sun-soaked beaches and snow-capped mountains. NEOM’s unique location will provide residents with enhanced livability while protecting 95% of the natural landscape.",location:"NEOM, Saudi Arabia",links:{self:"https://api.unsplash.com/users/neom",html:"https://unsplash.com/@neom",photos:"https://api.unsplash.com/users/neom/photos",likes:"https://api.unsplash.com/users/neom/likes",portfolio:"https://api.unsplash.com/users/neom/portfolio",following:"https://api.unsplash.com/users/neom/following",followers:"https://api.unsplash.com/users/neom/followers"},profile_image:{small:"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32",medium:"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64",large:"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},instagram_username:"discoverneom",total_collections:7,total_likes:1,total_photos:222,total_promoted_photos:72,accepted_tos:!0,for_hire:!1,social:{instagram_username:"discoverneom",portfolio_url:"http://www.neom.com",twitter_username:"neom",paypal_email:null}}},topic_submissions:{},user:{id:"mYizSrdJkkU",updated_at:"2024-03-11T08:54:08Z",username:"neom",name:"NEOM",first_name:"NEOM",last_name:null,twitter_username:"neom",portfolio_url:"http://www.neom.com",bio:"Located in the northwest of Saudi Arabia, NEOM’s diverse climate offers both sun-soaked beaches and snow-capped mountains. NEOM’s unique location will provide residents with enhanced livability while protecting 95% of the natural landscape.",location:"NEOM, Saudi Arabia",links:{self:"https://api.unsplash.com/users/neom",html:"https://unsplash.com/@neom",photos:"https://api.unsplash.com/users/neom/photos",likes:"https://api.unsplash.com/users/neom/likes",portfolio:"https://api.unsplash.com/users/neom/portfolio",following:"https://api.unsplash.com/users/neom/following",followers:"https://api.unsplash.com/users/neom/followers"},profile_image:{small:"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32",medium:"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64",large:"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},instagram_username:"discoverneom",total_collections:7,total_likes:1,total_photos:222,total_promoted_photos:72,accepted_tos:!0,for_hire:!1,social:{instagram_username:"discoverneom",portfolio_url:"http://www.neom.com",twitter_username:"neom",paypal_email:null}}},{id:"j39-6Uto9QQ",slug:"a-forest-filled-with-lots-of-tall-trees-j39-6Uto9QQ",alternative_slugs:{en:"a-forest-filled-with-lots-of-tall-trees-j39-6Uto9QQ"},created_at:"2024-03-09T22:12:40Z",updated_at:"2024-03-11T07:57:13Z",promoted_at:"2024-03-11T06:51:56Z",width:3759,height:5639,color:"#26260c",blur_hash:"L79tDG?H4;IURu%MM{RP~oohIoIo",description:null,alt_description:"a forest filled with lots of tall trees",breadcrumbs:[],urls:{raw:"https://images.unsplash.com/photo-1710020339360-ce951881b835?ixid=M3wxMTc3M3wwfDF8YWxsfDE3fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3",full:"https://images.unsplash.com/photo-1710020339360-ce951881b835?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE3fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85",regular:"https://images.unsplash.com/photo-1710020339360-ce951881b835?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE3fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080",small:"https://images.unsplash.com/photo-1710020339360-ce951881b835?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE3fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400",thumb:"https://images.unsplash.com/photo-1710020339360-ce951881b835?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE3fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1710020339360-ce951881b835"},links:{self:"https://api.unsplash.com/photos/a-forest-filled-with-lots-of-tall-trees-j39-6Uto9QQ",html:"https://unsplash.com/photos/a-forest-filled-with-lots-of-tall-trees-j39-6Uto9QQ",download:"https://unsplash.com/photos/j39-6Uto9QQ/download?ixid=M3wxMTc3M3wwfDF8YWxsfDE3fHx8fHx8Mnx8MTcxMDE1MzIwNXw",download_location:"https://api.unsplash.com/photos/j39-6Uto9QQ/download?ixid=M3wxMTc3M3wwfDF8YWxsfDE3fHx8fHx8Mnx8MTcxMDE1MzIwNXw"},likes:1,liked_by_user:!1,current_user_collections:[],sponsorship:null,topic_submissions:{},user:{id:"MarIhx6ztc0",updated_at:"2024-03-11T06:51:56Z",username:"brice_cooper18",name:"Brice Cooper",first_name:"Brice",last_name:"Cooper",twitter_username:null,portfolio_url:null,bio:"Always down for an adventure, capturing those adventures one photo at a time. Never stop exploring!",location:"Florida",links:{self:"https://api.unsplash.com/users/brice_cooper18",html:"https://unsplash.com/@brice_cooper18",photos:"https://api.unsplash.com/users/brice_cooper18/photos",likes:"https://api.unsplash.com/users/brice_cooper18/likes",portfolio:"https://api.unsplash.com/users/brice_cooper18/portfolio",following:"https://api.unsplash.com/users/brice_cooper18/following",followers:"https://api.unsplash.com/users/brice_cooper18/followers"},profile_image:{small:"https://images.unsplash.com/profile-1673045276376-91bb892b6e94image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32",medium:"https://images.unsplash.com/profile-1673045276376-91bb892b6e94image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64",large:"https://images.unsplash.com/profile-1673045276376-91bb892b6e94image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},instagram_username:"brice_cooper18",total_collections:14,total_likes:0,total_photos:1467,total_promoted_photos:51,accepted_tos:!0,for_hire:!0,social:{instagram_username:"brice_cooper18",portfolio_url:null,twitter_username:null,paypal_email:null}}},{id:"oTE1p2Awp3I",slug:"a-couple-of-people-standing-on-top-of-a-cliff-next-to-the-ocean-oTE1p2Awp3I",alternative_slugs:{en:"a-couple-of-people-standing-on-top-of-a-cliff-next-to-the-ocean-oTE1p2Awp3I"},created_at:"2024-02-27T22:15:01Z",updated_at:"2024-03-11T06:51:52Z",promoted_at:"2024-03-11T06:51:52Z",width:4e3,height:5333,color:"#c0c0c0",blur_hash:"LLE:C[u5IooJ_N%gE1ax~ps8Vsoe",description:null,alt_description:"a couple of people standing on top of a cliff next to the ocean",breadcrumbs:[],urls:{raw:"https://images.unsplash.com/photo-1709071784840-cf3ecc434749?ixid=M3wxMTc3M3wwfDF8YWxsfDE4fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3",full:"https://images.unsplash.com/photo-1709071784840-cf3ecc434749?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE4fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85",regular:"https://images.unsplash.com/photo-1709071784840-cf3ecc434749?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE4fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080",small:"https://images.unsplash.com/photo-1709071784840-cf3ecc434749?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE4fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400",thumb:"https://images.unsplash.com/photo-1709071784840-cf3ecc434749?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE4fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1709071784840-cf3ecc434749"},links:{self:"https://api.unsplash.com/photos/a-couple-of-people-standing-on-top-of-a-cliff-next-to-the-ocean-oTE1p2Awp3I",html:"https://unsplash.com/photos/a-couple-of-people-standing-on-top-of-a-cliff-next-to-the-ocean-oTE1p2Awp3I",download:"https://unsplash.com/photos/oTE1p2Awp3I/download?ixid=M3wxMTc3M3wwfDF8YWxsfDE4fHx8fHx8Mnx8MTcxMDE1MzIwNXw",download_location:"https://api.unsplash.com/photos/oTE1p2Awp3I/download?ixid=M3wxMTc3M3wwfDF8YWxsfDE4fHx8fHx8Mnx8MTcxMDE1MzIwNXw"},likes:8,liked_by_user:!1,current_user_collections:[],sponsorship:null,topic_submissions:{},user:{id:"khtnjqjzcq0",updated_at:"2024-03-11T06:51:53Z",username:"mitchorr",name:"Mitchell Orr",first_name:"Mitchell",last_name:"Orr",twitter_username:null,portfolio_url:"https://mitchorr.darkroom.tech/",bio:`If you feel you would like to support my work, any donations no matter how small, would be extremely helpful. \r
|
|
15
|
-
Thanks for looking!`,location:"Wirral",links:{self:"https://api.unsplash.com/users/mitchorr",html:"https://unsplash.com/@mitchorr",photos:"https://api.unsplash.com/users/mitchorr/photos",likes:"https://api.unsplash.com/users/mitchorr/likes",portfolio:"https://api.unsplash.com/users/mitchorr/portfolio",following:"https://api.unsplash.com/users/mitchorr/following",followers:"https://api.unsplash.com/users/mitchorr/followers"},profile_image:{small:"https://images.unsplash.com/profile-1687891061126-8858e815018fimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32",medium:"https://images.unsplash.com/profile-1687891061126-8858e815018fimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64",large:"https://images.unsplash.com/profile-1687891061126-8858e815018fimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},instagram_username:"mitchorr1",total_collections:0,total_likes:41,total_photos:358,total_promoted_photos:118,accepted_tos:!0,for_hire:!0,social:{instagram_username:"mitchorr1",portfolio_url:"https://mitchorr.darkroom.tech/",twitter_username:null,paypal_email:null}}},{id:"ihmo0uRQ3jA",slug:"a-bed-sitting-in-a-bedroom-next-to-a-window-ihmo0uRQ3jA",alternative_slugs:{en:"a-bed-sitting-in-a-bedroom-next-to-a-window-ihmo0uRQ3jA"},created_at:"2024-02-24T20:00:04Z",updated_at:"2024-03-11T06:51:48Z",promoted_at:"2024-03-11T06:51:48Z",width:4e3,height:6e3,color:"#260c0c",blur_hash:"L78;b;?I4Xx?tcIUD+xt03oy-.M|",description:null,alt_description:"a bed sitting in a bedroom next to a window",breadcrumbs:[],urls:{raw:"https://images.unsplash.com/photo-1708804309492-5ef3f3458c33?ixid=M3wxMTc3M3wwfDF8YWxsfDE5fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3",full:"https://images.unsplash.com/photo-1708804309492-5ef3f3458c33?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE5fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85",regular:"https://images.unsplash.com/photo-1708804309492-5ef3f3458c33?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE5fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080",small:"https://images.unsplash.com/photo-1708804309492-5ef3f3458c33?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE5fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400",thumb:"https://images.unsplash.com/photo-1708804309492-5ef3f3458c33?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE5fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1708804309492-5ef3f3458c33"},links:{self:"https://api.unsplash.com/photos/a-bed-sitting-in-a-bedroom-next-to-a-window-ihmo0uRQ3jA",html:"https://unsplash.com/photos/a-bed-sitting-in-a-bedroom-next-to-a-window-ihmo0uRQ3jA",download:"https://unsplash.com/photos/ihmo0uRQ3jA/download?ixid=M3wxMTc3M3wwfDF8YWxsfDE5fHx8fHx8Mnx8MTcxMDE1MzIwNXw",download_location:"https://api.unsplash.com/photos/ihmo0uRQ3jA/download?ixid=M3wxMTc3M3wwfDF8YWxsfDE5fHx8fHx8Mnx8MTcxMDE1MzIwNXw"},likes:20,liked_by_user:!1,current_user_collections:[],sponsorship:null,topic_submissions:{},user:{id:"Og5qBrDjufI",updated_at:"2024-03-11T06:51:49Z",username:"mariailves",name:"Maria Ilves",first_name:"Maria",last_name:"Ilves",twitter_username:null,portfolio_url:"http://www.mariailves.com",bio:null,location:"Ambleside",links:{self:"https://api.unsplash.com/users/mariailves",html:"https://unsplash.com/@mariailves",photos:"https://api.unsplash.com/users/mariailves/photos",likes:"https://api.unsplash.com/users/mariailves/likes",portfolio:"https://api.unsplash.com/users/mariailves/portfolio",following:"https://api.unsplash.com/users/mariailves/following",followers:"https://api.unsplash.com/users/mariailves/followers"},profile_image:{small:"https://images.unsplash.com/profile-1708802611867-ab4ff1564c8cimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32",medium:"https://images.unsplash.com/profile-1708802611867-ab4ff1564c8cimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64",large:"https://images.unsplash.com/profile-1708802611867-ab4ff1564c8cimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},instagram_username:"mariailves_",total_collections:0,total_likes:0,total_photos:38,total_promoted_photos:4,accepted_tos:!0,for_hire:!0,social:{instagram_username:"mariailves_",portfolio_url:"http://www.mariailves.com",twitter_username:null,paypal_email:null}}},{id:"UvQtTVdFi9I",slug:"UvQtTVdFi9I",alternative_slugs:{en:"UvQtTVdFi9I"},created_at:"2016-08-12T16:12:25Z",updated_at:"2024-03-11T06:50:27Z",promoted_at:"2024-03-11T06:50:27Z",width:3648,height:5472,color:"#8ca673",blur_hash:"LGG9g4IAVax[.Zxus=kB9HtQ%LRj",description:null,alt_description:null,breadcrumbs:[],urls:{raw:"https://images.unsplash.com/photo-1471018289981-5d9f06e2bf45?ixid=M3wxMTc3M3wwfDF8YWxsfDIwfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3",full:"https://images.unsplash.com/photo-1471018289981-5d9f06e2bf45?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDIwfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85",regular:"https://images.unsplash.com/photo-1471018289981-5d9f06e2bf45?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDIwfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080",small:"https://images.unsplash.com/photo-1471018289981-5d9f06e2bf45?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDIwfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400",thumb:"https://images.unsplash.com/photo-1471018289981-5d9f06e2bf45?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDIwfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1471018289981-5d9f06e2bf45"},links:{self:"https://api.unsplash.com/photos/UvQtTVdFi9I",html:"https://unsplash.com/photos/UvQtTVdFi9I",download:"https://unsplash.com/photos/UvQtTVdFi9I/download?ixid=M3wxMTc3M3wwfDF8YWxsfDIwfHx8fHx8Mnx8MTcxMDE1MzIwNXw",download_location:"https://api.unsplash.com/photos/UvQtTVdFi9I/download?ixid=M3wxMTc3M3wwfDF8YWxsfDIwfHx8fHx8Mnx8MTcxMDE1MzIwNXw"},likes:60,liked_by_user:!1,current_user_collections:[],sponsorship:null,topic_submissions:{},user:{id:"dhG1THiRwtA",updated_at:"2024-03-11T06:50:28Z",username:"clarissemeyer",name:"Clarisse Meyer",first_name:"Clarisse",last_name:"Meyer",twitter_username:"claireymeyer",portfolio_url:"https://www.clarisserae.com",bio:`Photo | Video | Design - Southern California & Beyond\r
|
|
16
|
-
Instagram: @clarisse.rae`,location:"Orange County, CA",links:{self:"https://api.unsplash.com/users/clarissemeyer",html:"https://unsplash.com/@clarissemeyer",photos:"https://api.unsplash.com/users/clarissemeyer/photos",likes:"https://api.unsplash.com/users/clarissemeyer/likes",portfolio:"https://api.unsplash.com/users/clarissemeyer/portfolio",following:"https://api.unsplash.com/users/clarissemeyer/following",followers:"https://api.unsplash.com/users/clarissemeyer/followers"},profile_image:{small:"https://images.unsplash.com/profile-1470948329031-558b487bdf37?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32",medium:"https://images.unsplash.com/profile-1470948329031-558b487bdf37?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64",large:"https://images.unsplash.com/profile-1470948329031-558b487bdf37?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},instagram_username:"clarisse.rae",total_collections:2,total_likes:139,total_photos:99,total_promoted_photos:58,accepted_tos:!1,for_hire:!1,social:{instagram_username:"clarisse.rae",portfolio_url:"https://www.clarisserae.com",twitter_username:"claireymeyer",paypal_email:null}}},{id:"iswshBYbTBk",slug:"a-woman-riding-an-escalator-down-an-escalator-iswshBYbTBk",alternative_slugs:{en:"a-woman-riding-an-escalator-down-an-escalator-iswshBYbTBk"},created_at:"2024-02-27T19:26:10Z",updated_at:"2024-03-11T06:48:50Z",promoted_at:"2024-03-11T06:48:50Z",width:3940,height:2634,color:"#73a673",blur_hash:"LEDn~t%{y:WXDPVtH[jt8{o|VGk9",description:null,alt_description:"a woman riding an escalator down an escalator",breadcrumbs:[],urls:{raw:"https://images.unsplash.com/photo-1709061965707-9a89ffb23103?ixid=M3wxMTc3M3wwfDF8YWxsfDIyfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3",full:"https://images.unsplash.com/photo-1709061965707-9a89ffb23103?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDIyfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85",regular:"https://images.unsplash.com/photo-1709061965707-9a89ffb23103?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDIyfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080",small:"https://images.unsplash.com/photo-1709061965707-9a89ffb23103?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDIyfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400",thumb:"https://images.unsplash.com/photo-1709061965707-9a89ffb23103?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDIyfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1709061965707-9a89ffb23103"},links:{self:"https://api.unsplash.com/photos/a-woman-riding-an-escalator-down-an-escalator-iswshBYbTBk",html:"https://unsplash.com/photos/a-woman-riding-an-escalator-down-an-escalator-iswshBYbTBk",download:"https://unsplash.com/photos/iswshBYbTBk/download?ixid=M3wxMTc3M3wwfDF8YWxsfDIyfHx8fHx8Mnx8MTcxMDE1MzIwNXw",download_location:"https://api.unsplash.com/photos/iswshBYbTBk/download?ixid=M3wxMTc3M3wwfDF8YWxsfDIyfHx8fHx8Mnx8MTcxMDE1MzIwNXw"},likes:4,liked_by_user:!1,current_user_collections:[],sponsorship:null,topic_submissions:{people:{status:"rejected"}},user:{id:"d-2o2yQwtxY",updated_at:"2024-03-11T06:48:59Z",username:"vitalymazur",name:"Vitalii Mazur",first_name:"Vitalii",last_name:"Mazur",twitter_username:"@madebyvitalii",portfolio_url:"https://www.behance.net/vitaliimazur",bio:`Life through photography 🌿 \r
|
|
17
|
-
Feel free to support me via PayPal (vitaly.mazur@icloud.com) if you like to use my shots. Also I'm available for a photoshoot in Toronto 📸🇨🇦`,location:"Toronto, Canada",links:{self:"https://api.unsplash.com/users/vitalymazur",html:"https://unsplash.com/@vitalymazur",photos:"https://api.unsplash.com/users/vitalymazur/photos",likes:"https://api.unsplash.com/users/vitalymazur/likes",portfolio:"https://api.unsplash.com/users/vitalymazur/portfolio",following:"https://api.unsplash.com/users/vitalymazur/following",followers:"https://api.unsplash.com/users/vitalymazur/followers"},profile_image:{small:"https://images.unsplash.com/profile-1708119387274-fad12c7d293b?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32",medium:"https://images.unsplash.com/profile-1708119387274-fad12c7d293b?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64",large:"https://images.unsplash.com/profile-1708119387274-fad12c7d293b?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},instagram_username:"vitalymazur ",total_collections:14,total_likes:773,total_photos:263,total_promoted_photos:15,accepted_tos:!0,for_hire:!0,social:{instagram_username:"vitalymazur ",portfolio_url:"https://www.behance.net/vitaliimazur",twitter_username:"@madebyvitalii",paypal_email:null}}},{id:"uSNuKKh7wpA",slug:"a-picture-of-a-green-object-with-a-white-background-uSNuKKh7wpA",alternative_slugs:{en:"a-picture-of-a-green-object-with-a-white-background-uSNuKKh7wpA"},created_at:"2024-03-01T10:58:28Z",updated_at:"2024-03-11T06:48:07Z",promoted_at:"2024-03-11T06:48:07Z",width:9600,height:5400,color:"#d9d9d9",blur_hash:"LJLq]_WI_3%eo$xa?cRi~qobITM|",description:"Made in blender 4.0",alt_description:"a picture of a green object with a white background",breadcrumbs:[],urls:{raw:"https://images.unsplash.com/photo-1709290649154-54c725bd4484?ixid=M3wxMTc3M3wwfDF8YWxsfDIzfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3",full:"https://images.unsplash.com/photo-1709290649154-54c725bd4484?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDIzfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85",regular:"https://images.unsplash.com/photo-1709290649154-54c725bd4484?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDIzfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080",small:"https://images.unsplash.com/photo-1709290649154-54c725bd4484?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDIzfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400",thumb:"https://images.unsplash.com/photo-1709290649154-54c725bd4484?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDIzfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1709290649154-54c725bd4484"},links:{self:"https://api.unsplash.com/photos/a-picture-of-a-green-object-with-a-white-background-uSNuKKh7wpA",html:"https://unsplash.com/photos/a-picture-of-a-green-object-with-a-white-background-uSNuKKh7wpA",download:"https://unsplash.com/photos/uSNuKKh7wpA/download?ixid=M3wxMTc3M3wwfDF8YWxsfDIzfHx8fHx8Mnx8MTcxMDE1MzIwNXw",download_location:"https://api.unsplash.com/photos/uSNuKKh7wpA/download?ixid=M3wxMTc3M3wwfDF8YWxsfDIzfHx8fHx8Mnx8MTcxMDE1MzIwNXw"},likes:42,liked_by_user:!1,current_user_collections:[],sponsorship:null,topic_submissions:{"3d-renders":{status:"approved",approved_on:"2024-03-06T08:20:20Z"},experimental:{status:"approved",approved_on:"2024-03-06T07:38:30Z"}},user:{id:"5TCQxdaW0wE",updated_at:"2024-03-11T10:04:04Z",username:"theshubhamdhage",name:"Shubham Dhage",first_name:"Shubham",last_name:"Dhage",twitter_username:"theshubhamdhage",portfolio_url:"https://theshubhamdhage.com/",bio:"Creating things is my passion.",location:"Pune, India",links:{self:"https://api.unsplash.com/users/theshubhamdhage",html:"https://unsplash.com/@theshubhamdhage",photos:"https://api.unsplash.com/users/theshubhamdhage/photos",likes:"https://api.unsplash.com/users/theshubhamdhage/likes",portfolio:"https://api.unsplash.com/users/theshubhamdhage/portfolio",following:"https://api.unsplash.com/users/theshubhamdhage/following",followers:"https://api.unsplash.com/users/theshubhamdhage/followers"},profile_image:{small:"https://images.unsplash.com/profile-1702918491890-622aa47079a5image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32",medium:"https://images.unsplash.com/profile-1702918491890-622aa47079a5image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64",large:"https://images.unsplash.com/profile-1702918491890-622aa47079a5image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},instagram_username:"theshubhamdhage",total_collections:2,total_likes:296,total_photos:734,total_promoted_photos:147,accepted_tos:!0,for_hire:!0,social:{instagram_username:"theshubhamdhage",portfolio_url:"https://theshubhamdhage.com/",twitter_username:"theshubhamdhage",paypal_email:null}}},{id:"7lN8MJPnlXs",slug:"a-close-up-of-a-pine-tree-with-lots-of-needles-7lN8MJPnlXs",alternative_slugs:{en:"a-close-up-of-a-pine-tree-with-lots-of-needles-7lN8MJPnlXs"},created_at:"2024-03-06T19:31:23Z",updated_at:"2024-03-11T06:47:23Z",promoted_at:"2024-03-11T06:47:23Z",width:6720,height:4480,color:"#26260c",blur_hash:"L05OKD},~lR7TJRj%d^$_0E49Is:",description:null,alt_description:"a close up of a pine tree with lots of needles",breadcrumbs:[],urls:{raw:"https://images.unsplash.com/photo-1709753422610-39ed7ddf9e08?ixid=M3wxMTc3M3wwfDF8YWxsfDI0fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3",full:"https://images.unsplash.com/photo-1709753422610-39ed7ddf9e08?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI0fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85",regular:"https://images.unsplash.com/photo-1709753422610-39ed7ddf9e08?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI0fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080",small:"https://images.unsplash.com/photo-1709753422610-39ed7ddf9e08?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI0fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400",thumb:"https://images.unsplash.com/photo-1709753422610-39ed7ddf9e08?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI0fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1709753422610-39ed7ddf9e08"},links:{self:"https://api.unsplash.com/photos/a-close-up-of-a-pine-tree-with-lots-of-needles-7lN8MJPnlXs",html:"https://unsplash.com/photos/a-close-up-of-a-pine-tree-with-lots-of-needles-7lN8MJPnlXs",download:"https://unsplash.com/photos/7lN8MJPnlXs/download?ixid=M3wxMTc3M3wwfDF8YWxsfDI0fHx8fHx8Mnx8MTcxMDE1MzIwNXw",download_location:"https://api.unsplash.com/photos/7lN8MJPnlXs/download?ixid=M3wxMTc3M3wwfDF8YWxsfDI0fHx8fHx8Mnx8MTcxMDE1MzIwNXw"},likes:5,liked_by_user:!1,current_user_collections:[],sponsorship:null,topic_submissions:{"textures-patterns":{status:"approved",approved_on:"2024-03-11T06:47:18Z"}},user:{id:"gMFqynHNocY",updated_at:"2024-03-11T06:48:57Z",username:"blakecheekk",name:"Blake Cheek",first_name:"Blake",last_name:"Cheek",twitter_username:"blakecheekk",portfolio_url:"http://blakecheek.com",bio:"Photographer and Videographer. Lover of coffee and Jesus. ",location:"Atlanta, Ga",links:{self:"https://api.unsplash.com/users/blakecheekk",html:"https://unsplash.com/@blakecheekk",photos:"https://api.unsplash.com/users/blakecheekk/photos",likes:"https://api.unsplash.com/users/blakecheekk/likes",portfolio:"https://api.unsplash.com/users/blakecheekk/portfolio",following:"https://api.unsplash.com/users/blakecheekk/following",followers:"https://api.unsplash.com/users/blakecheekk/followers"},profile_image:{small:"https://images.unsplash.com/profile-1709746841716-156061dd4fe9image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32",medium:"https://images.unsplash.com/profile-1709746841716-156061dd4fe9image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64",large:"https://images.unsplash.com/profile-1709746841716-156061dd4fe9image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},instagram_username:"blakecheekk",total_collections:4,total_likes:0,total_photos:423,total_promoted_photos:165,accepted_tos:!0,for_hire:!0,social:{instagram_username:"blakecheekk",portfolio_url:"http://blakecheek.com",twitter_username:"blakecheekk",paypal_email:null}}},{id:"Fw8vp9G6FtE",slug:"the-contents-of-a-backpack-laid-out-on-a-table-Fw8vp9G6FtE",alternative_slugs:{en:"the-contents-of-a-backpack-laid-out-on-a-table-Fw8vp9G6FtE"},created_at:"2024-03-10T00:43:31Z",updated_at:"2024-03-11T06:46:50Z",promoted_at:"2024-03-11T06:46:50Z",width:6240,height:4160,color:"#262626",blur_hash:"LIINNov{ae}=56I]eToaEmWC^iI;",description:null,alt_description:"the contents of a backpack laid out on a table",breadcrumbs:[],urls:{raw:"https://images.unsplash.com/photo-1710031407576-135a680d6e10?ixid=M3wxMTc3M3wwfDF8YWxsfDI1fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3",full:"https://images.unsplash.com/photo-1710031407576-135a680d6e10?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI1fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85",regular:"https://images.unsplash.com/photo-1710031407576-135a680d6e10?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI1fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080",small:"https://images.unsplash.com/photo-1710031407576-135a680d6e10?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI1fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400",thumb:"https://images.unsplash.com/photo-1710031407576-135a680d6e10?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI1fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1710031407576-135a680d6e10"},links:{self:"https://api.unsplash.com/photos/the-contents-of-a-backpack-laid-out-on-a-table-Fw8vp9G6FtE",html:"https://unsplash.com/photos/the-contents-of-a-backpack-laid-out-on-a-table-Fw8vp9G6FtE",download:"https://unsplash.com/photos/Fw8vp9G6FtE/download?ixid=M3wxMTc3M3wwfDF8YWxsfDI1fHx8fHx8Mnx8MTcxMDE1MzIwNXw",download_location:"https://api.unsplash.com/photos/Fw8vp9G6FtE/download?ixid=M3wxMTc3M3wwfDF8YWxsfDI1fHx8fHx8Mnx8MTcxMDE1MzIwNXw"},likes:4,liked_by_user:!1,current_user_collections:[],sponsorship:null,topic_submissions:{},user:{id:"UmKpkFAcSDE",updated_at:"2024-03-11T06:46:50Z",username:"taylorheeryphoto",name:"Taylor Heery",first_name:"Taylor",last_name:"Heery",twitter_username:"tahegri",portfolio_url:"http://www.taylorheery.com",bio:`VENMO: @taylorheeryphoto\r
|
|
18
|
-
Fujifilm fanatic.`,location:"Hendersonville, NC",links:{self:"https://api.unsplash.com/users/taylorheeryphoto",html:"https://unsplash.com/@taylorheeryphoto",photos:"https://api.unsplash.com/users/taylorheeryphoto/photos",likes:"https://api.unsplash.com/users/taylorheeryphoto/likes",portfolio:"https://api.unsplash.com/users/taylorheeryphoto/portfolio",following:"https://api.unsplash.com/users/taylorheeryphoto/following",followers:"https://api.unsplash.com/users/taylorheeryphoto/followers"},profile_image:{small:"https://images.unsplash.com/profile-1710031596049-549d947d2a3a?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32",medium:"https://images.unsplash.com/profile-1710031596049-549d947d2a3a?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64",large:"https://images.unsplash.com/profile-1710031596049-549d947d2a3a?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},instagram_username:"taylorheeryphoto",total_collections:0,total_likes:107,total_photos:520,total_promoted_photos:209,accepted_tos:!0,for_hire:!0,social:{instagram_username:"taylorheeryphoto",portfolio_url:"http://www.taylorheery.com",twitter_username:"tahegri",paypal_email:null}}},{id:"e75CfMG0Sgo",slug:"a-person-with-a-backpack-looking-at-mountains-e75CfMG0Sgo",alternative_slugs:{en:"a-person-with-a-backpack-looking-at-mountains-e75CfMG0Sgo"},created_at:"2023-04-28T12:46:16Z",updated_at:"2024-03-10T11:50:20Z",promoted_at:null,width:5429,height:3619,color:"#a6c0d9",blur_hash:"LnHLYm%0IAi_?wn$ngj[OtRjs:f6",description:"Nature Reserve – NEOM, Saudi Arabia | The NEOM Nature Reserve region is being designed to deliver protection and restoration of biodiversity across 95% of NEOM.",alt_description:"a person with a backpack looking at mountains",breadcrumbs:[],urls:{raw:"https://images.unsplash.com/photo-1682685796002-e05458d61f07?ixid=M3wxMTc3M3wxfDF8YWxsfDI2fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3",full:"https://images.unsplash.com/photo-1682685796002-e05458d61f07?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDI2fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85",regular:"https://images.unsplash.com/photo-1682685796002-e05458d61f07?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDI2fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080",small:"https://images.unsplash.com/photo-1682685796002-e05458d61f07?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDI2fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400",thumb:"https://images.unsplash.com/photo-1682685796002-e05458d61f07?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDI2fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1682685796002-e05458d61f07"},links:{self:"https://api.unsplash.com/photos/a-person-with-a-backpack-looking-at-mountains-e75CfMG0Sgo",html:"https://unsplash.com/photos/a-person-with-a-backpack-looking-at-mountains-e75CfMG0Sgo",download:"https://unsplash.com/photos/e75CfMG0Sgo/download?ixid=M3wxMTc3M3wxfDF8YWxsfDI2fHx8fHx8Mnx8MTcxMDE1MzIwNXw",download_location:"https://api.unsplash.com/photos/e75CfMG0Sgo/download?ixid=M3wxMTc3M3wxfDF8YWxsfDI2fHx8fHx8Mnx8MTcxMDE1MzIwNXw"},likes:174,liked_by_user:!1,current_user_collections:[],sponsorship:{impression_urls:["https://secure.insightexpressai.com/adServer/adServerESI.aspx?script=false&bannerID=11515577&rnd=[timestamp]&redir=https://secure.insightexpressai.com/adserver/1pixel.gif","https://secure.insightexpressai.com/adServer/adServerESI.aspx?script=false&bannerID=11515780&rnd=[timestamp]&redir=https://secure.insightexpressai.com/adserver/1pixel.gif"],tagline:"Made to Change",tagline_url:"https://www.neom.com/en-us?utm_source=unsplash&utm_medium=referral",sponsor:{id:"mYizSrdJkkU",updated_at:"2024-03-11T08:54:08Z",username:"neom",name:"NEOM",first_name:"NEOM",last_name:null,twitter_username:"neom",portfolio_url:"http://www.neom.com",bio:"Located in the northwest of Saudi Arabia, NEOM’s diverse climate offers both sun-soaked beaches and snow-capped mountains. NEOM’s unique location will provide residents with enhanced livability while protecting 95% of the natural landscape.",location:"NEOM, Saudi Arabia",links:{self:"https://api.unsplash.com/users/neom",html:"https://unsplash.com/@neom",photos:"https://api.unsplash.com/users/neom/photos",likes:"https://api.unsplash.com/users/neom/likes",portfolio:"https://api.unsplash.com/users/neom/portfolio",following:"https://api.unsplash.com/users/neom/following",followers:"https://api.unsplash.com/users/neom/followers"},profile_image:{small:"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32",medium:"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64",large:"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},instagram_username:"discoverneom",total_collections:7,total_likes:1,total_photos:222,total_promoted_photos:72,accepted_tos:!0,for_hire:!1,social:{instagram_username:"discoverneom",portfolio_url:"http://www.neom.com",twitter_username:"neom",paypal_email:null}}},topic_submissions:{},user:{id:"mYizSrdJkkU",updated_at:"2024-03-11T08:54:08Z",username:"neom",name:"NEOM",first_name:"NEOM",last_name:null,twitter_username:"neom",portfolio_url:"http://www.neom.com",bio:"Located in the northwest of Saudi Arabia, NEOM’s diverse climate offers both sun-soaked beaches and snow-capped mountains. NEOM’s unique location will provide residents with enhanced livability while protecting 95% of the natural landscape.",location:"NEOM, Saudi Arabia",links:{self:"https://api.unsplash.com/users/neom",html:"https://unsplash.com/@neom",photos:"https://api.unsplash.com/users/neom/photos",likes:"https://api.unsplash.com/users/neom/likes",portfolio:"https://api.unsplash.com/users/neom/portfolio",following:"https://api.unsplash.com/users/neom/following",followers:"https://api.unsplash.com/users/neom/followers"},profile_image:{small:"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32",medium:"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64",large:"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},instagram_username:"discoverneom",total_collections:7,total_likes:1,total_photos:222,total_promoted_photos:72,accepted_tos:!0,for_hire:!1,social:{instagram_username:"discoverneom",portfolio_url:"http://www.neom.com",twitter_username:"neom",paypal_email:null}}},{id:"jSjHcyHFOdQ",slug:"a-picture-of-a-green-plant-in-a-dark-room-jSjHcyHFOdQ",alternative_slugs:{en:"a-picture-of-a-green-plant-in-a-dark-room-jSjHcyHFOdQ"},created_at:"2024-02-08T15:36:25Z",updated_at:"2024-03-11T06:46:46Z",promoted_at:"2024-03-11T06:46:46Z",width:8400,height:5600,color:"#0c260c",blur_hash:"L44CLsVuD7pF.Po2R7R*-.oyX5My",description:null,alt_description:"a picture of a green plant in a dark room",breadcrumbs:[],urls:{raw:"https://images.unsplash.com/photo-1707406543260-ed14bbd0d086?ixid=M3wxMTc3M3wwfDF8YWxsfDI3fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3",full:"https://images.unsplash.com/photo-1707406543260-ed14bbd0d086?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI3fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85",regular:"https://images.unsplash.com/photo-1707406543260-ed14bbd0d086?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI3fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080",small:"https://images.unsplash.com/photo-1707406543260-ed14bbd0d086?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI3fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400",thumb:"https://images.unsplash.com/photo-1707406543260-ed14bbd0d086?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI3fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1707406543260-ed14bbd0d086"},links:{self:"https://api.unsplash.com/photos/a-picture-of-a-green-plant-in-a-dark-room-jSjHcyHFOdQ",html:"https://unsplash.com/photos/a-picture-of-a-green-plant-in-a-dark-room-jSjHcyHFOdQ",download:"https://unsplash.com/photos/jSjHcyHFOdQ/download?ixid=M3wxMTc3M3wwfDF8YWxsfDI3fHx8fHx8Mnx8MTcxMDE1MzIwNXw",download_location:"https://api.unsplash.com/photos/jSjHcyHFOdQ/download?ixid=M3wxMTc3M3wwfDF8YWxsfDI3fHx8fHx8Mnx8MTcxMDE1MzIwNXw"},likes:14,liked_by_user:!1,current_user_collections:[],sponsorship:null,topic_submissions:{},user:{id:"ogQykx6hk_c",updated_at:"2024-03-11T06:46:46Z",username:"pawel_czerwinski",name:"Pawel Czerwinski",first_name:"Pawel",last_name:"Czerwinski",twitter_username:"pm_cze",portfolio_url:"http://paypal.me/pmcze",bio:"Questions about how you can use the photos? help.unsplash.com/en/collections/1463188-unsplash-license 👍",location:"Poland",links:{self:"https://api.unsplash.com/users/pawel_czerwinski",html:"https://unsplash.com/@pawel_czerwinski",photos:"https://api.unsplash.com/users/pawel_czerwinski/photos",likes:"https://api.unsplash.com/users/pawel_czerwinski/likes",portfolio:"https://api.unsplash.com/users/pawel_czerwinski/portfolio",following:"https://api.unsplash.com/users/pawel_czerwinski/following",followers:"https://api.unsplash.com/users/pawel_czerwinski/followers"},profile_image:{small:"https://images.unsplash.com/profile-1592328433409-d9ce8a5333eaimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32",medium:"https://images.unsplash.com/profile-1592328433409-d9ce8a5333eaimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64",large:"https://images.unsplash.com/profile-1592328433409-d9ce8a5333eaimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},instagram_username:"pmcze",total_collections:7,total_likes:39154,total_photos:2137,total_promoted_photos:1760,accepted_tos:!0,for_hire:!1,social:{instagram_username:"pmcze",portfolio_url:"http://paypal.me/pmcze",twitter_username:"pm_cze",paypal_email:null}}},{id:"OfGHUYX0CCg",slug:"a-body-of-water-that-has-some-waves-on-it-OfGHUYX0CCg",alternative_slugs:{en:"a-body-of-water-that-has-some-waves-on-it-OfGHUYX0CCg"},created_at:"2024-03-06T14:06:51Z",updated_at:"2024-03-11T08:56:52Z",promoted_at:"2024-03-11T06:45:54Z",width:8192,height:5460,color:"#260c0c",blur_hash:"LUF{kg=cj@fQ}XxFS3azxFfjS2WW",description:null,alt_description:"a body of water that has some waves on it",breadcrumbs:[],urls:{raw:"https://images.unsplash.com/photo-1709733167477-25398ca709c0?ixid=M3wxMTc3M3wwfDF8YWxsfDI4fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3",full:"https://images.unsplash.com/photo-1709733167477-25398ca709c0?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI4fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85",regular:"https://images.unsplash.com/photo-1709733167477-25398ca709c0?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI4fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080",small:"https://images.unsplash.com/photo-1709733167477-25398ca709c0?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI4fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400",thumb:"https://images.unsplash.com/photo-1709733167477-25398ca709c0?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI4fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1709733167477-25398ca709c0"},links:{self:"https://api.unsplash.com/photos/a-body-of-water-that-has-some-waves-on-it-OfGHUYX0CCg",html:"https://unsplash.com/photos/a-body-of-water-that-has-some-waves-on-it-OfGHUYX0CCg",download:"https://unsplash.com/photos/OfGHUYX0CCg/download?ixid=M3wxMTc3M3wwfDF8YWxsfDI4fHx8fHx8Mnx8MTcxMDE1MzIwNXw",download_location:"https://api.unsplash.com/photos/OfGHUYX0CCg/download?ixid=M3wxMTc3M3wwfDF8YWxsfDI4fHx8fHx8Mnx8MTcxMDE1MzIwNXw"},likes:16,liked_by_user:!1,current_user_collections:[],sponsorship:null,topic_submissions:{"earth-hour":{status:"approved",approved_on:"2024-03-07T09:43:45Z"}},user:{id:"uFFemR6e1vs",updated_at:"2024-03-11T06:48:56Z",username:"marcospradobr",name:"Marcos Paulo Prado",first_name:"Marcos Paulo",last_name:"Prado",twitter_username:null,portfolio_url:"https://www.instagram.com/eusoumarcosprado",bio:"People and commercial photographer based in Rio de Janeiro, Brasil",location:"Rio de Janeiro, Brazil",links:{self:"https://api.unsplash.com/users/marcospradobr",html:"https://unsplash.com/@marcospradobr",photos:"https://api.unsplash.com/users/marcospradobr/photos",likes:"https://api.unsplash.com/users/marcospradobr/likes",portfolio:"https://api.unsplash.com/users/marcospradobr/portfolio",following:"https://api.unsplash.com/users/marcospradobr/following",followers:"https://api.unsplash.com/users/marcospradobr/followers"},profile_image:{small:"https://images.unsplash.com/profile-1572910425876-25d44d080554image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32",medium:"https://images.unsplash.com/profile-1572910425876-25d44d080554image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64",large:"https://images.unsplash.com/profile-1572910425876-25d44d080554image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},instagram_username:"eusoumarcosprado",total_collections:0,total_likes:306,total_photos:413,total_promoted_photos:139,accepted_tos:!0,for_hire:!0,social:{instagram_username:"eusoumarcosprado",portfolio_url:"https://www.instagram.com/eusoumarcosprado",twitter_username:null,paypal_email:null}}},{id:"VKQpbzeWbrk",slug:"a-bouquet-of-orange-and-white-tulips-on-a-red-door-VKQpbzeWbrk",alternative_slugs:{en:"a-bouquet-of-orange-and-white-tulips-on-a-red-door-VKQpbzeWbrk"},created_at:"2024-03-09T21:24:04Z",updated_at:"2024-03-11T06:45:51Z",promoted_at:"2024-03-11T06:45:51Z",width:2592,height:3872,color:"#8c2626",blur_hash:"LFI2{Exr0gE}Dlo|=_W-5RE3O=xH",description:null,alt_description:"a bouquet of orange and white tulips on a red door",breadcrumbs:[],urls:{raw:"https://images.unsplash.com/photo-1710018337941-58197591d55a?ixid=M3wxMTc3M3wwfDF8YWxsfDI5fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3",full:"https://images.unsplash.com/photo-1710018337941-58197591d55a?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI5fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85",regular:"https://images.unsplash.com/photo-1710018337941-58197591d55a?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI5fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080",small:"https://images.unsplash.com/photo-1710018337941-58197591d55a?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI5fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400",thumb:"https://images.unsplash.com/photo-1710018337941-58197591d55a?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI5fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1710018337941-58197591d55a"},links:{self:"https://api.unsplash.com/photos/a-bouquet-of-orange-and-white-tulips-on-a-red-door-VKQpbzeWbrk",html:"https://unsplash.com/photos/a-bouquet-of-orange-and-white-tulips-on-a-red-door-VKQpbzeWbrk",download:"https://unsplash.com/photos/VKQpbzeWbrk/download?ixid=M3wxMTc3M3wwfDF8YWxsfDI5fHx8fHx8Mnx8MTcxMDE1MzIwNXw",download_location:"https://api.unsplash.com/photos/VKQpbzeWbrk/download?ixid=M3wxMTc3M3wwfDF8YWxsfDI5fHx8fHx8Mnx8MTcxMDE1MzIwNXw"},likes:3,liked_by_user:!1,current_user_collections:[],sponsorship:null,topic_submissions:{},user:{id:"H8-Yyg-eX4A",updated_at:"2024-03-11T06:48:56Z",username:"jaelphotos",name:"Jael Coon",first_name:"Jael",last_name:"Coon",twitter_username:null,portfolio_url:"https://linktr.ee/jaelcoon",bio:"Coffee drinker, photographer, artist and chef/baker",location:"USA",links:{self:"https://api.unsplash.com/users/jaelphotos",html:"https://unsplash.com/@jaelphotos",photos:"https://api.unsplash.com/users/jaelphotos/photos",likes:"https://api.unsplash.com/users/jaelphotos/likes",portfolio:"https://api.unsplash.com/users/jaelphotos/portfolio",following:"https://api.unsplash.com/users/jaelphotos/following",followers:"https://api.unsplash.com/users/jaelphotos/followers"},profile_image:{small:"https://images.unsplash.com/profile-1693432710439-47b22b3f6a9eimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32",medium:"https://images.unsplash.com/profile-1693432710439-47b22b3f6a9eimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64",large:"https://images.unsplash.com/profile-1693432710439-47b22b3f6a9eimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},instagram_username:"jaelcoon",total_collections:51,total_likes:0,total_photos:230,total_promoted_photos:3,accepted_tos:!0,for_hire:!1,social:{instagram_username:"jaelcoon",portfolio_url:"https://linktr.ee/jaelcoon",twitter_username:null,paypal_email:null}}},{id:"W6AqsLH6HOg",slug:"a-license-plate-on-the-back-of-a-car-W6AqsLH6HOg",alternative_slugs:{en:"a-license-plate-on-the-back-of-a-car-W6AqsLH6HOg"},created_at:"2024-03-06T06:59:15Z",updated_at:"2024-03-11T06:45:45Z",promoted_at:"2024-03-11T06:45:45Z",width:6e3,height:4e3,color:"#595959",blur_hash:"LYE_]gO?}qOsW--Ux]$%RPoeX9oz",description:null,alt_description:"a license plate on the back of a car",breadcrumbs:[],urls:{raw:"https://images.unsplash.com/photo-1709708210553-490ba885fcf6?ixid=M3wxMTc3M3wwfDF8YWxsfDMwfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3",full:"https://images.unsplash.com/photo-1709708210553-490ba885fcf6?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDMwfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85",regular:"https://images.unsplash.com/photo-1709708210553-490ba885fcf6?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDMwfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080",small:"https://images.unsplash.com/photo-1709708210553-490ba885fcf6?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDMwfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400",thumb:"https://images.unsplash.com/photo-1709708210553-490ba885fcf6?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDMwfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200",small_s3:"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1709708210553-490ba885fcf6"},links:{self:"https://api.unsplash.com/photos/a-license-plate-on-the-back-of-a-car-W6AqsLH6HOg",html:"https://unsplash.com/photos/a-license-plate-on-the-back-of-a-car-W6AqsLH6HOg",download:"https://unsplash.com/photos/W6AqsLH6HOg/download?ixid=M3wxMTc3M3wwfDF8YWxsfDMwfHx8fHx8Mnx8MTcxMDE1MzIwNXw",download_location:"https://api.unsplash.com/photos/W6AqsLH6HOg/download?ixid=M3wxMTc3M3wwfDF8YWxsfDMwfHx8fHx8Mnx8MTcxMDE1MzIwNXw"},likes:3,liked_by_user:!1,current_user_collections:[],sponsorship:null,topic_submissions:{},user:{id:"VNV70zPYNto",updated_at:"2024-03-11T06:48:56Z",username:"venajeborec",name:"Václav Pechar",first_name:"Václav",last_name:"Pechar",twitter_username:null,portfolio_url:null,bio:`Photographer from South Bohemia ✌🏻\r
|
|
19
|
-
Be free to contact me to book a shoot 🙏🏻`,location:"Czech Republic - Písek",links:{self:"https://api.unsplash.com/users/venajeborec",html:"https://unsplash.com/@venajeborec",photos:"https://api.unsplash.com/users/venajeborec/photos",likes:"https://api.unsplash.com/users/venajeborec/likes",portfolio:"https://api.unsplash.com/users/venajeborec/portfolio",following:"https://api.unsplash.com/users/venajeborec/following",followers:"https://api.unsplash.com/users/venajeborec/followers"},profile_image:{small:"https://images.unsplash.com/profile-1687031143105-2420498da92eimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32",medium:"https://images.unsplash.com/profile-1687031143105-2420498da92eimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64",large:"https://images.unsplash.com/profile-1687031143105-2420498da92eimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},instagram_username:"amazingvena",total_collections:0,total_likes:7,total_photos:324,total_promoted_photos:30,accepted_tos:!0,for_hire:!0,social:{instagram_username:"amazingvena",portfolio_url:null,twitter_username:null,paypal_email:null}}}],Lj=$j;class Pj{constructor(){jt(this,"photos",Lj),jt(this,"PAGINATION",{}),jt(this,"REQUEST_IS_RUNNING",!1),jt(this,"SEARCH_IS_RUNNING",!1),jt(this,"LAST_REQUEST_URL",""),jt(this,"ERROR",null),jt(this,"IS_LOADING",!1),jt(this,"currentPage",1)}async fetchPhotos(){this.IS_LOADING=!0;const n=(this.currentPage-1)*30,a=this.currentPage*30;return this.currentPage+=1,this.IS_LOADING=!1,this.photos.slice(n,a)}async fetchNextPage(){if(this.REQUEST_IS_RUNNING||this.SEARCH_IS_RUNNING)return null;const n=await this.fetchPhotos();return n.length>0?n:null}async searchPhotos(n){this.SEARCH_IS_RUNNING=!0;const a=this.photos.filter(o=>o.description&&o.description.toLowerCase().includes(n.toLowerCase())||o.alt_description&&o.alt_description.toLowerCase().includes(n.toLowerCase()));return this.SEARCH_IS_RUNNING=!1,a}searchIsRunning(){return this.SEARCH_IS_RUNNING}triggerDownload(n){}}class Fj{constructor(n){jt(this,"_provider"),this._provider=n}async fetchPhotos(){return await this._provider.fetchPhotos()}async searchPhotos(n){return await this._provider.searchPhotos(n)}async triggerDownload(n){this._provider.triggerDownload(n)}async fetchNextPage(){return await this._provider.fetchNextPage()||null}searchIsRunning(){return this._provider.searchIsRunning()}}class Uj{constructor(n){jt(this,"API_URL","https://api.unsplash.com"),jt(this,"HEADERS"),jt(this,"ERROR",null),jt(this,"PAGINATION",{}),jt(this,"REQUEST_IS_RUNNING",!1),jt(this,"SEARCH_IS_RUNNING",!1),jt(this,"LAST_REQUEST_URL",""),jt(this,"IS_LOADING",!1),this.HEADERS=n}async makeRequest(n){if(this.REQUEST_IS_RUNNING)return null;this.LAST_REQUEST_URL=n;const a={method:"GET",headers:this.HEADERS};try{this.REQUEST_IS_RUNNING=!0,this.IS_LOADING=!0;const o=await fetch(n,a),c=await this.checkStatus(o);this.extractPagination(c);const m=await c.json();return"results"in m?m.results:m}catch(o){return this.ERROR=o,null}finally{this.REQUEST_IS_RUNNING=!1,this.IS_LOADING=!1}}extractPagination(n){let a=new RegExp('<(.*)>; rel="(.*)"'),o=[],c={};for(let m of n.headers.entries())m[0]==="link"&&o.push(m[1]);return o&&o.toString().split(",").forEach(m=>{if(m){let y=a.exec(m);y&&(c[y[2]]=y[1])}}),this.PAGINATION=c,n}async fetchPhotos(){const n=`${this.API_URL}/photos?per_page=30`;return await this.makeRequest(n)}async fetchNextPage(){if(this.REQUEST_IS_RUNNING||this.SEARCH_IS_RUNNING)return null;if(this.PAGINATION.next){const n=`${this.PAGINATION.next}`,a=await this.makeRequest(n);if(a)return a}return null}async searchPhotos(n){const a=`${this.API_URL}/search/photos?query=${n}&per_page=30`;return await this.makeRequest(a)||[]}async triggerDownload(n){n.links.download_location&&await this.makeRequest(n.links.download_location)}async checkStatus(n){if(n.status>=200&&n.status<300)return n;let a="",o;const c=n.headers.get("content-type");if(c==="application/json")o=n.json().then(m=>m.errors[0]);else if(c==="text/xml")o=n.text();else throw new Error("Unsupported content type");return o.then(m=>{throw n.status===403&&n.headers.get("x-ratelimit-remaining")==="0"&&(a="Unsplash API rate limit reached, please try again later."),a=a||m||`Error ${n.status}: Uh-oh! Trouble reaching the Unsplash API`,this.ERROR=a,new Error(a)})}searchIsRunning(){return this.SEARCH_IS_RUNNING}}class zj{constructor(n,a){jt(this,"photoUseCases"),jt(this,"masonryService"),jt(this,"photos",[]),this.photoUseCases=n,this.masonryService=a}async loadNew(){let n=await this.photoUseCases.fetchPhotos();this.photos=n,await this.layoutPhotos()}async layoutPhotos(){this.masonryService.reset(),this.photos&&this.photos.forEach(n=>{n.ratio=n.height/n.width,this.masonryService.addPhotoToColumns(n)})}getColumns(){return this.masonryService.getColumns()}async updateSearch(n){let a=await this.photoUseCases.searchPhotos(n);this.photos=a,this.layoutPhotos()}async loadNextPage(){const n=await this.photoUseCases.fetchNextPage()||[];this.photos=[...this.photos,...n],this.layoutPhotos()}clearPhotos(){this.photos=[]}triggerDownload(n){this.photoUseCases.triggerDownload(n)}searchIsRunning(){return this.photoUseCases.searchIsRunning()}}const Hj=({onClose:e,onImageInsert:n,unsplashProviderConfig:a})=>{const o=D.useMemo(()=>a?new Uj(a):new Pj,[a]),c=D.useMemo(()=>new Fj(o),[o]),m=D.useMemo(()=>new kj(3),[]),y=D.useMemo(()=>new zj(c,m),[c,m]),h=D.useRef(null),[l,f]=D.useState(0),[u,p]=D.useState(0),[x,v]=D.useState(y.searchIsRunning()||!0),_=D.useRef(!1),[k,M]=D.useState(""),[T,A]=D.useState(null),[C,O]=D.useState([]);at.useEffect(()=>{h.current&&T===null&&u!==0&&(h.current.scrollTop=u,p(0))},[T,l,u]),at.useEffect(()=>{const B=Y=>{Y.key==="Escape"&&e()};return window.addEventListener("keydown",B),()=>{window.removeEventListener("keydown",B)}},[e]),at.useEffect(()=>{const B=h.current;if(!T)return B&&B.addEventListener("scroll",()=>{f(B.scrollTop)}),()=>{B&&B.removeEventListener("scroll",()=>{f(B.scrollTop)})}},[h,T]);const $=at.useCallback(async()=>{if(_.current===!1||k.length===0){O([]),y.clearPhotos(),await y.loadNew();const B=y.getColumns();O(B||[]),h.current&&h.current.scrollTop!==0&&(h.current.scrollTop=0),v(!1)}},[y,k]),W=async B=>{const Y=B.target.value;Y.length>2&&(A(null),M(Y)),Y.length===0&&(M(""),_.current=!1,await $())},R=at.useCallback(async()=>{if(k){v(!0),O([]),y.clearPhotos(),await y.updateSearch(k);const B=y.getColumns();B&&O(B),h.current&&h.current.scrollTop!==0&&(h.current.scrollTop=0),v(!1)}},[k,y]);at.useEffect(()=>{const B=setTimeout(async()=>{k.length>2?await R():await $()},300);return()=>{_.current=!0,clearTimeout(B)}},[k,R,$]);const Z=at.useCallback(async()=>{v(!0),await y.loadNextPage();const B=y.getColumns();O(B||[]),v(!1)},[y]);at.useEffect(()=>{const B=h.current;if(B){const Y=async()=>{T===null&&B.scrollTop+B.clientHeight>=B.scrollHeight-1e3&&await Z()};return B.addEventListener("scroll",Y),()=>{B.removeEventListener("scroll",Y)}}},[h,Z,T]);const X=B=>{B&&(A(B),p(l)),B===null&&(A(null),h.current&&(h.current.scrollTop=u))};async function q(B){B.src&&(y.triggerDownload(B),n(B))}return Fe.jsx(Oj,{closeModal:e,handleSearch:W,children:Fe.jsx(Ij,{dataset:C,error:null,galleryRef:h,insertImage:q,isLoading:x,selectImg:X,zoomed:T})})},Bj=({unsplashProviderConfig:e,onClose:n,onImageInsert:a})=>s.jsx(vj,{classNames:"admin-x-settings",children:s.jsx(Hj,{unsplashProviderConfig:e,onClose:n,onImageInsert:a})}),Us={heading:[{name:"Cardo",creator:"David Perry"},{name:"Chakra Petch",creator:"Cadson Demak"},{name:"Fira Mono",creator:"Carrois Apostrophe"},{name:"Fira Sans",creator:"Carrois Apostrophe"},{name:"IBM Plex Serif",creator:"Mike Abbink"},{name:"Inter",creator:"Rasmus Andersson"},{name:"JetBrains Mono",creator:"JetBrains"},{name:"Libre Baskerville",creator:"Impallari Type"},{name:"Lora",creator:"Cyreal"},{name:"Manrope",creator:"Mikhail Sharanda"},{name:"Merriweather",creator:"Sorkin Type"},{name:"Noto Sans",creator:"Google"},{name:"Noto Serif",creator:"Google"},{name:"Nunito",creator:"Vernon Adams"},{name:"Old Standard TT",creator:"Alexey Kryukov"},{name:"Poppins",creator:"Indian Type Foundry"},{name:"Roboto",creator:"Christian Robertson"},{name:"Rufina",creator:"Martin Sommaruga"},{name:"Space Grotesk",creator:"Florian Karsten"},{name:"Space Mono",creator:"Colophon Foundry"},{name:"Tenor Sans",creator:"Denis Masharov"}],body:[{name:"Fira Mono",creator:"Carrois Apostrophe"},{name:"Fira Sans",creator:"Carrois Apostrophe"},{name:"IBM Plex Serif",creator:"Mike Abbink"},{name:"Inter",creator:"Rasmus Andersson"},{name:"JetBrains Mono",creator:"JetBrains"},{name:"Lora",creator:"Cyreal"},{name:"Manrope",creator:"Mikhail Sharanda"},{name:"Merriweather",creator:"Sorkin Type"},{name:"Noto Sans",creator:"Google"},{name:"Noto Serif",creator:"Google"},{name:"Nunito",creator:"Vernon Adams"},{name:"Poppins",creator:"Indian Type Foundry"},{name:"Roboto",creator:"Christian Robertson"},{name:"Space Mono",creator:"Colophon Foundry"}]},$r="Theme default",nm=({children:e,...n})=>s.jsx(Xg.SingleValue,{...n,children:s.jsx("div",{className:"group","data-testid":"select-current-option","data-value":n.data.value,children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"flex size-12 items-center justify-center rounded-md bg-white text-2xl font-bold dark:bg-black",children:"Aa"}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{className:"text-md",children:e}),s.jsx("span",{className:"font-sans text-xs font-normal text-grey-700 dark:text-grey-600",children:n.data.creator})]})]})})}),sm=({children:e,...n})=>s.jsx(Xg.Option,{...n,children:s.jsxs("div",{className:n.isSelected?"relative flex w-full items-center justify-between gap-2":"group","data-testid":"select-option","data-value":n.data.value,children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"dark:group-hover:bg-grey-800 flex size-12 items-center justify-center rounded-md bg-grey-150 text-2xl font-bold group-hover:bg-grey-250 dark:bg-grey-900",children:"Aa"}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{className:"text-md",children:e}),s.jsx("span",{className:"font-sans text-xs font-normal text-grey-700 dark:text-grey-600",children:n.data.creator})]})]}),n.isSelected&&s.jsx("span",{children:s.jsx(ut,{name:"check",size:14})})]})}),Wj=e=>e.split(" ").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" "),am=({values:e,updateSetting:n})=>{const{mutateAsync:a}=Xs(),{settings:o}=Je(),[c]=gt(o,["unsplash"]),[m,y]=D.useState(!1),{unsplashConfig:h}=b_(),l=ot(),f=Gg(),{data:u}=ed(),p=u?.themes.find(R=>R.active),x=p?`${Wj(p.name)} (v${p.package?.version||"1.0"})`:"Loading...",[v,_]=D.useState(Us.heading.find(R=>R.name===e.headingFont)||{name:$r,creator:x}),[k,M]=D.useState(Us.heading.find(R=>R.name===e.bodyFont)||{name:$r,creator:x}),T=(R,Z=!0)=>{let X="";return R==="Cardo"?X=we("font-cardo",Z&&"font-bold"):R==="Manrope"?X=we("font-manrope",Z&&"font-bold"):R==="Merriweather"?X=we("font-merriweather",Z&&"font-bold"):R==="Nunito"?X=we("font-nunito",Z&&"font-semibold"):R==="Old Standard TT"?X=we("font-old-standard-tt",Z&&"font-bold"):R==="Prata"?X=we("font-prata",Z&&"font-normal"):R==="Roboto"?X=we("font-roboto",Z&&"font-bold"):R==="Rufina"?X=we("font-rufina",Z&&"font-bold"):R==="Tenor Sans"?X=we("font-tenor-sans",Z&&"font-normal"):R==="Chakra Petch"?X=we("font-chakra-petch",Z&&"font-normal"):R==="Fira Mono"?X=we("font-fira-mono",Z&&"font-bold"):R==="Fira Sans"?X=we("font-fira-sans",Z&&"font-bold"):R==="IBM Plex Serif"?X=we("font-ibm-plex-serif",Z&&"font-bold"):R==="Inter"?X=we("font-inter",Z&&"font-bold"):R==="JetBrains Mono"?X=we("font-jetbrains-mono",Z&&"font-bold"):R==="Lora"?X=we("font-lora",Z&&"font-bold"):R==="Noto Sans"?X=we("font-noto-sans",Z&&"font-bold"):R==="Noto Serif"?X=we("font-noto-serif",Z&&"font-bold"):R==="Poppins"?X=we("font-poppins",Z&&"font-bold"):R==="Space Grotesk"?X=we("font-space-grotesk",Z&&"font-bold"):R==="Space Mono"&&(X=we("font-space-mono",Z&&"font-bold")),X},A=Us.heading.map(R=>{let Z=T(R.name,!0);return{label:R.name,value:R.name,creator:R.creator,className:Z}});A.unshift({label:$r,value:$r,creator:x,className:"font-sans font-normal"});const C=Us.body.map(R=>{let Z=T(R.name,!1);return{label:R.name,value:R.name,creator:R.creator,className:Z}});C.unshift({label:$r,value:$r,creator:x,className:"font-sans font-normal"});const O=(R,Z)=>R===$r?"":T(R,Z),$={label:v.name,value:v.name,creator:v.creator},W={label:k.name,value:k.name,creator:k.creator};return s.jsxs(s.Fragment,{children:[s.jsxs(tt,{className:"mt-6",gap:"sm",margins:"lg",title:"",children:[s.jsx(Yr,{debounceMs:200,direction:"rtl",testId:"accent-color-picker",title:s.jsx("div",{children:"Accent color"}),value:e.accentColor,onChange:R=>n("accent_color",R)}),s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{children:[s.jsx("div",{children:"Publication icon"}),s.jsx(Gr,{className:"!mt-0 mr-5 max-w-[160px]",children:"A square, social icon, at least 60x60px"})]}),s.jsx("div",{className:"flex gap-3",children:s.jsx(un,{deleteButtonClassName:"!top-1 !right-1",editButtonClassName:"!top-1 !right-1",height:e.icon?"66px":"36px",id:"logo",imageBWCheckedBg:!0,imageURL:e.icon||"",width:e.icon?"66px":"160px",onDelete:()=>n("icon",null),onUpload:async R=>{try{n("icon",on(await a({file:R})))}catch(Z){const X=Z;X.response.status===415&&(X.message="Unsupported file type"),l(X)}},children:"Upload icon"})})]}),s.jsxs("div",{className:`flex items-start justify-between ${e.icon&&"mt-2"}`,children:[s.jsxs("div",{children:[s.jsx("div",{children:"Publication logo"}),s.jsx(Gr,{className:"!mt-0 mr-5 max-w-[160px]",children:"Appears usually in the main header of your theme"})]}),s.jsx("div",{children:s.jsx(un,{deleteButtonClassName:"!top-1 !right-1",height:"60px",id:"site-logo",imageBWCheckedBg:!0,imageFit:"contain",imageURL:e.logo||"",width:"160px",onDelete:()=>n("logo",null),onUpload:async R=>{try{n("logo",on(await a({file:R})))}catch(Z){const X=Z;X.response.status===415&&(X.message="Unsupported file type"),l(X)}},children:"Upload logo"})})]}),s.jsxs("div",{className:"mt-2 flex items-start justify-between","data-testid":"publication-cover",children:[s.jsxs("div",{children:[s.jsx("div",{children:"Publication cover"}),s.jsx(Gr,{className:"!mt-0 mr-5 max-w-[160px]",children:"Usually as a large banner image on your index pages"})]}),s.jsx(un,{deleteButtonClassName:"!top-1 !right-1",editButtonClassName:"!top-1 !right-10",height:"95px",id:"cover",imageURL:e.coverImage||"",openUnsplash:()=>y(!0),pintura:{isEnabled:f.isEnabled,openEditor:async()=>f.openEditor({image:e.coverImage||"",handleSave:async R=>{try{n("cover_image",on(await a({file:R})))}catch(Z){l(Z)}}})},unsplashButtonClassName:"!bg-transparent !h-6 !top-1.5 !w-6 !right-1.5 z-50",unsplashEnabled:c,width:"160px",onDelete:()=>n("cover_image",null),onUpload:async R=>{try{n("cover_image",on(await a({file:R})))}catch(Z){const X=Z;X.response.status===415&&(X.message="Unsupported file type"),l(X)}},children:"Upload cover"}),m&&h&&c&&s.jsx(Bj,{unsplashProviderConfig:h,onClose:()=>{y(!1)},onImageInsert:R=>{R.src&&n("cover_image",R.src),y(!1)}})]})]}),s.jsxs(tt,{className:"-mt-4",gap:"sm",margins:"lg",title:"Typography",children:[s.jsx(Lt,{className:O($.label,!0),components:{Option:sm,SingleValue:nm},controlClasses:{control:"!min-h-16 !pl-2",option:"!pl-2"},hint:"",menuShouldScrollIntoView:!0,options:A,selectedOption:$,testId:"heading-font-select",title:"Heading font",onSelect:R=>{R?.value===$r?(_({name:$r,creator:x}),n("heading_font","")):(_({name:R?.value||"",creator:Us.heading.find(Z=>Z.name===R?.value)?.creator||""}),n("heading_font",R?.value||""))}}),s.jsx(Lt,{className:O(W.label,!1),components:{Option:sm,SingleValue:nm},controlClasses:{control:"!min-h-16 !pl-2",option:"!pl-2"},hint:"",maxMenuHeight:200,menuPosition:"fixed",menuShouldScrollIntoView:!0,options:C,selectedOption:W,testId:"body-font-select",title:"Body font",onSelect:R=>{R?.value===$r?(M({name:$r,creator:x}),n("body_font","")):(M({name:R?.value||"",creator:Us.body.find(Z=>Z.name===R?.value)?.creator||""}),n("body_font",R?.value||""))}})]})]})};var $i={exports:{}},zi={exports:{}},qj=zi.exports,om;function Yj(){return om||(om=1,(function(e,n){//! mingo.js 2.5.3
|
|
20
|
-
//! Copyright (c) 2020 Francis Asante
|
|
21
|
-
//! MIT
|
|
22
|
-
(function(a,o){e.exports=o()})(qj,(function(){function a(d){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?a=function(g){return typeof g}:a=function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g},a(d)}function o(d,g){if(!(d instanceof g))throw new TypeError("Cannot call a class as a function")}function c(d,g){for(var b=0;b<g.length;b++){var j=g[b];j.enumerable=j.enumerable||!1,j.configurable=!0,"value"in j&&(j.writable=!0),Object.defineProperty(d,j.key,j)}}function m(d,g,b){return g&&c(d.prototype,g),d}function y(d,g){return h(d)||l(d,g)||f(d,g)||p()}function h(d){if(Array.isArray(d))return d}function l(d,g){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(d)))){var b=[],j=!0,I=!1,U=void 0;try{for(var V=d[Symbol.iterator](),te;!(j=(te=V.next()).done)&&(b.push(te.value),!(g&&b.length===g));j=!0);}catch(me){I=!0,U=me}finally{try{!j&&V.return!=null&&V.return()}finally{if(I)throw U}}return b}}function f(d,g){if(d){if(typeof d=="string")return u(d,g);var b=Object.prototype.toString.call(d).slice(8,-1);if(b==="Object"&&d.constructor&&(b=d.constructor.name),b==="Map"||b==="Set")return Array.from(b);if(b==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(b))return u(d,g)}}function u(d,g){(g==null||g>d.length)&&(g=d.length);for(var b=0,j=new Array(g);b<g;b++)j[b]=d[b];return j}function p(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
23
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var x="null",v="undefined",_="bool",k="boolean",M="number",T="string",A="date",C="regex",O="regexp",$="array",W="object",R="function",Z=[x,v,k,M,T,A,O],X="expression",q="group",B="pipeline",Y="projection",ae="query",ee=function(){};Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(g,b){if(this==null)throw new TypeError('"this" is null or not defined');var j=Object(this),I=j.length>>>0;if(I===0)return!1;var U=b|0,V=Math.max(U>=0?U:I-Math.abs(U),0);function te(me,fe){return me===fe||typeof me=="number"&&typeof fe=="number"&&isNaN(me)&&isNaN(fe)}for(;V<I;){if(te(j[V],g))return!0;V++}return!1}});var re=Array.prototype.push;function Q(d,g){d||le(g)}function ne(d){switch(H(d)){case $:return d.map(ne);case W:return pr(d,ne);default:return d}}function be(d){switch(H(d)){case $:return Gt([],d);case W:return Object.assign({},d);default:return d}}function je(d){return d===null?"Null":d===void 0?"Undefined":d.constructor.name}function H(d){return je(d).toLowerCase()}function he(d){return H(d)===k}function ge(d){return H(d)===T}function F(d){return H(d)===M}var L=Array.isArray||function(d){return!!d&&d.constructor===Array};function J(d){return!!d&&d.constructor===Object}function xe(d){return d===Object(d)}function Te(d){return H(d)===A}function De(d){return H(d)===O}function Me(d){return H(d)===R}function oe(d){return d==null}function Ee(d){return d===null}function Ne(d){return d===void 0}function Ie(d,g){return d.includes(g)}function qe(d,g){return!Ie(d,g)}function nt(d){return!!d}function ze(d){return oe(d)||L(d)&&d.length===0||J(d)&&Be(d).length===0||!d}function vt(d){return L(d)?d:[d]}function lt(d,g){return d.hasOwnProperty(g)}function le(d){throw new Error(d)}var Be=Object.keys;function Re(d,g,b){if(g=g.bind(b),L(d))for(var j=0,I=d.length;j<I&&g(d[j],j,d)!==!1;j++);else for(var U in d)if(d.hasOwnProperty(U)&&g(d[U],U,d)===!1)break}function pr(d,g,b){g=g.bind(b);for(var j={},I=Be(d),U=0;U<I.length;U++){var V=I[U];j[V]=g(d[V],V)}return j}function hr(d,g){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(d===ee)return g;if(g===ee)return d;var j=[d,g];if(!(j.every(J)||j.every(L)))throw Error("mismatched types. must both be array or object");if(b.flatten=b.flatten||!1,L(d))if(b.flatten){for(var I=0,U=0;I<d.length&&U<g.length;)d[I]=hr(d[I++],g[U++],b);for(;U<g.length;)d.push(g[U++])}else re.apply(d,g);else Object.keys(g).forEach(function(V){d.hasOwnProperty(V)?d[V]=hr(d[V],g[V],b):d[V]=g[V]});return d}function kt(d,g,b){return L(d)?d.reduce(g,b):(Re(d,function(j,I){return b=g(b,j,I,d)}),b)}function Ar(d,g){var b=g.map(Mr);return d.filter(function(j){return Ie(b,Mr(j))})}function ul(d,g){return Gt(Gt([],d),g.filter(qe.bind(null,d)))}function pn(d){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1,b=[];function j(I,U){for(var V=0,te=I.length;V<te;V++)L(I[V])&&(U>0||U<0)?j(I[V],Math.max(-1,U-1)):b.push(I[V])}return j(d,g),b}function hn(d,g){if(g<1)return d;for(;g--&&L(d)&&d.length===1;)d=d[0];return d}function Pr(d,g){for(var b=[d],j=[g];b.length>0;)if(d=b.pop(),g=j.pop(),d!==g){var I=H(d);if(I!==H(g)||I===R)return!1;switch(I){case $:if(d.length!==g.length)return!1;Gt(b,d),Gt(j,g);break;case W:var U=Be(d),V=Be(g);if(U.length!==V.length)return!1;U.sort(),V.sort();for(var te=0,me=U.length;te<me;te++){var fe=U[te];if(fe!==V[te])return!1;b.push(d[fe]),j.push(g[fe])}break;default:if(Fr(d)!==Fr(g))return!1}}return b.length===0}function Ln(d){var g={},b=[];return Re(d,function(j){var I=Mr(j);lt(g,I)||(b.push(j),g[I]=0)}),b}function Fr(d){var g=H(d);switch(g){case k:case M:case O:return d.toString();case T:return JSON.stringify(d);case A:return d.toISOString();case x:case v:return g;case $:return"["+d.map(Fr)+"]";default:var b=g===W?"":"".concat(je(d)),j=Be(d);return j.sort(),"".concat(b,"{")+j.map(function(I){return"".concat(Fr(I),":").concat(Fr(d[I]))})+"}"}}function Mr(d){if(oe(d))return null;for(var g=0,b=Fr(d),j=b.length;j;)g=(g<<5)-g^b.charCodeAt(--j);return g>>>0}function Pn(d,g){return d<g?-1:d>g?1:0}function ls(d,g,b){var j=[],I=[],U={};if(b=b||Pn,ze(d))return d;for(var V=0;V<d.length;V++){var te=d[V],me=g(te,V);oe(me)?I.push(te):(U[me]?U[me].push(te):U[me]=[te],j.push(me))}j.sort(b);for(var fe=0;fe<j.length;fe++)Gt(I,U[j[fe]]);return I}function cs(d,g){var b={keys:[],groups:[]},j={};return Re(d,function(I){var U=g(I),V=Mr(U),te=-1;j[V]===void 0&&(te=b.keys.length,j[V]=te,b.keys.push(U),b.groups.push([])),te=j[V],b.groups[te].push(I)}),b}function Gt(d,g){return re.apply(d,g),d}function ea(d,g){for(var b=0,j=d.length-1;b<=j;){var I=Math.round(b+(j-b)/2);if(g<d[I])j=I-1;else if(g>d[I])b=I+1;else return I}return b}function fl(d){var g=this;return(function(b){return function(){for(var j=arguments.length,I=new Array(j),U=0;U<j;U++)I[U]=arguments[U];var V=Mr(I);return lt(b,V)||(b[V]=d.apply(g,I)),b[V]}})({})}function ta(d,g){return xe(d)?d[g]:void 0}function mr(d,g){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},j=0;b.meta=b.meta||!1;function I(U,V){for(var te=U,me=0;me<V.length;me++){var fe=V[me],Ce=fe.match(/^\d+$/)===null;if(Ce&&L(te)){if(me===0&&j>0)break;j+=1,V=V.slice(me),te=kt(te,function(_e,rt){var Xe=I(rt,V);return Xe!==void 0&&_e.push(Xe),_e},[]);break}else te=ta(te,fe);if(te===void 0)break}return te}return d=Ie(Z,H(d))?d:I(d,g.split(".")),b.meta?{result:d,depth:j}:d}function mn(d,g){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};b.preserveMissingValues=b.preserveMissingValues||!1;var j=g.split("."),I=j[0],U=j.length===1||j.slice(1).join("."),V=I.match(/^\d+$/)!==null,te=j.length>1,me,fe;try{L(d)?V?(me=ta(d,Number(I)),te&&(me=mn(me,U,b)),me=[me]):(me=[],Re(d,function(Ce){fe=mn(Ce,g,b),b.preserveMissingValues?(fe===void 0&&(fe=ee),me.push(fe)):fe!==void 0&&me.push(fe)})):(fe=ta(d,I),te&&(fe=mn(fe,U,b)),Q(fe!==void 0),me={},me[I]=fe)}catch{me=void 0}return me}function us(d){if(L(d))for(var g=d.length-1;g>=0;g--)d[g]===ee?d.splice(g,1):us(d[g]);else if(J(d))for(var b in d)d.hasOwnProperty(b)&&us(d[b]);return d}function ra(d,g,b){var j=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,I=g.split("."),U=I[0],V=I.length===1||I.slice(1).join(".");I.length===1?b(d,U):(j===!0&&oe(d[U])&&(d[U]={}),ra(d[U],V,b,j))}function na(d,g,b){ra(d,g,function(j,I){j[I]=b},!0)}function sa(d,g){ra(d,g,function(b,j){L(b)&&/^\d+$/.test(j)?b.splice(parseInt(j),1):J(b)&&delete b[j]})}function aa(d){return!!d&&d[0]==="$"}function oa(d){if(Ie(Z,H(d)))return De(d)?{$regex:d}:{$eq:d};if(xe(d)){var g=Be(d);if(!g.some(aa))return{$eq:d};if(Ie(g,"$regex")){var b=d.$regex,j=d.$options||"",I="";ge(b)&&(I+=b.ignoreCase||j.indexOf("i")>=0?"i":"",I+=b.multiline||j.indexOf("m")>=0?"m":"",I+=b.global||j.indexOf("g")>=0?"g":"",b=new RegExp(b,I)),d.$regex=b,delete d.$options}}return d}function ia(d,g){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;return oe(b)?g<0?(g=Math.max(0,d.length+g),b=d.length-g+1):(b=g,g=0):(g<0&&(g=Math.max(0,d.length+g)),Q(b>0,"Invalid argument value for $slice operator. Limit must be a positive number"),b+=g),d.slice(g,b)}function lo(d,g){var b=kt(d,function(V,te){return V+te},0),j=d.length||1,I=g&&1||0,U=b/j;return Math.sqrt(kt(d,function(V,te){return V+Math.pow(te-U,2)},0)/(j-I))}function dl(){return{assert:Q,clone:be,cloneDeep:ne,each:Re,err:le,hashCode:Mr,getType:je,has:lt,includes:Ie.bind(null),isArray:L,isBoolean:he,isDate:Te,isEmpty:ze,isEqual:Pr,isFunction:Me,isNil:oe,isNull:Ee,isNumber:F,isObject:J,isRegExp:De,isString:ge,isUndefined:Ne,keys:Be,reduce:kt,resolve:mr,resolveObj:mn}}var fs=function(){return Object.assign({computeValue:pe,ops:ca},dl())},co={key:"_id"};function la(d){Object.assign(co,d||{})}var uo={$$ROOT:function(g,b,j){return j.root},$$CURRENT:function(g,b,j){return g},$$REMOVE:function(g,b,j){}},fo={$$KEEP:function(g){return g},$$PRUNE:function(){},$$DESCEND:function(g,b,j){if(!lt(b,"$cond"))return g;var I;return Re(g,function(U,V){xe(U)&&(L(U)?(I=[],Re(U,function(te){J(te)&&(te=ps(te,b,j)),oe(te)||I.push(te)})):I=ps(U,b,j),oe(I)?delete g[V]:g[V]=I)}),g}},po=Be(uo),ho=Be(fo);function gn(){return co.key}function ca(){var d=Array.prototype.slice.call(arguments);return kt(d,function(g,b){return Gt(g,Be(_t[b]))},[])}function ds(d,g,b){if(lt(_t[q],g))return _t[q][g](d,b);if(J(b)){var j={};return Re(b,function(I,U){if(j[U]=ds(d,U,b[U]),lt(_t[q],U))return j=j[U],Q(Be(b).length===1,"Invalid $group expression '"+JSON.stringify(b)+"'"),!1}),j}}function pe(d,g){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,j=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};if(j.root=j.root||d,lt(_t[X],b))return _t[X][b](d,g,j);if(lt(_t[q],b))return d=pe(d,g,null,j),Q(L(d),b+" expression must resolve to an array"),_t[q][b](d,null,j);if(ge(g)&&g.length>0&&g[0]==="$"){if(Ie(po,g))return uo[g](d,null,j);if(Ie(ho,g))return g;var I=po.filter(function(V){return g.indexOf(V+".")===0});return I.length===1&&(I=I[0],I==="$$ROOT"&&(d=j.root),g=g.substr(I.length)),mr(d,g.slice(1))}switch(H(g)){case $:return g.map(function(V){return pe(d,V)});case W:var U={};return Re(g,function(V,te){if(U[te]=pe(d,V,te,j),[X,q].some(function(me){return lt(_t[me],te)}))return Q(Be(g).length===1,"Invalid aggregation expression '"+JSON.stringify(g)+"'"),U=U[te],!1}),U;default:return g}}function ps(d,g){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};b.root=b.root||d;var j=pe(d,g,null,b);return Ie(ho,j)?fo[j](d,g,b):j}function pl(d,g){var b=pe(d,g);return b==null?null:Math.abs(b)}function hl(d,g){var b=pe(d,g),j=!1,I=kt(b,function(U,V){return Te(V)&&(Q(!j,"'$add' can only have one date value"),j=!0,V=V.getTime()),U+=V,U},0);return j?new Date(I):I}function ml(d,g){var b=pe(d,g);return oe(b)?null:(Q(F(b)||isNaN(b),"$ceil expression must resolve to a number."),Math.ceil(b))}function gl(d,g){var b=pe(d,g);return b[0]/b[1]}function xl(d,g){var b=pe(d,g);return oe(b)?null:(Q(F(b)||isNaN(b),"$exp expression must resolve to a number."),Math.exp(b))}function bl(d,g){var b=pe(d,g);return oe(b)?null:(Q(F(b)||isNaN(b),"$floor expression must resolve to a number."),Math.floor(b))}function hs(d,g){var b=pe(d,g);return oe(b)?null:(Q(F(b)||isNaN(b),"$ln expression must resolve to a number."),Math.log(b))}function vl(d,g){var b=pe(d,g),j="$log expression must resolve to array(2) of numbers";return Q(L(b)&&b.length===2,j),b.some(oe)?null:(Q(b.some(isNaN)||b.every(F),j),Math.log10(b[0])/Math.log10(b[1]))}function ms(d,g){var b=pe(d,g);return oe(b)?null:(Q(F(b)||isNaN(b),"$log10 expression must resolve to a number."),Math.log10(b))}function wl(d,g){var b=pe(d,g);return b[0]%b[1]}function yl(d,g){var b=pe(d,g);return kt(b,function(j,I){return j*I},1)}function _l(d,g){var b=pe(d,g);return Q(L(b)&&b.length===2&&b.every(F),"$pow expression must resolve to array(2) of numbers"),Q(!(b[0]===0&&b[1]<0),"$pow cannot raise 0 to a negative exponent"),Math.pow(b[0],b[1])}function mo(d,g){var b=pe(d,g),j=b[0],I=b[1];return oe(j)||isNaN(j)||Math.abs(j)===1/0?j:(Q(F(j),"$round expression must resolve to a number."),bo(j,I,!0))}function go(d,g){var b=pe(d,g);return oe(b)?null:(Q(F(b)&&b>0||isNaN(b),"$sqrt expression must resolve to non-negative number."),Math.sqrt(b))}function xo(d,g){var b=pe(d,g);return b[0]-b[1]}function kl(d,g){var b=pe(d,g),j=b[0],I=b[1];return oe(j)||isNaN(j)||Math.abs(j)===1/0?j:(Q(F(j),"$trunc expression must resolve to a number."),Q(oe(I)||F(I)&&I>-20&&I<100,"$trunc expression has invalid place"),bo(j,I,!1))}function bo(d,g,b){g=g||0;var j=Math.abs(d)===d?1:-1;d=Math.abs(d);var I=Math.trunc(d),U=d-I;if(g===0){var V=Math.trunc(10*U);b&&(I&1)===1&&V>=5&&I++}else if(g>0){var te=Math.pow(10,g),me=Math.trunc(U*te),fe=Math.trunc(U*te*10)%10;b&&fe>5&&(me+=1),I+=me/te}else if(g<0){var Ce=Math.pow(10,-1*g),_e=I%Ce;if(I=Math.max(0,I-_e),b&&j===-1){for(;_e>10;)_e-=_e%10;I>0&&_e>=5&&(I+=Ce)}}return I*j}function Ml(d,g){var b=pe(d,g);Q(L(b)&&b.length===2,"$arrayElemAt expression must resolve to array(2)"),Q(L(b[0]),"First operand to $arrayElemAt must resolve to an array"),Q(F(b[1]),"Second operand to $arrayElemAt must resolve to an integer");var j=b[1];if(b=b[0],j<0&&Math.abs(j)<=b.length)return b[j+b.length];if(j>=0&&j<b.length)return b[j]}function jl(d,g){var b=pe(d,g);return Q(L(b),"$arrayToObject expression must resolve to an array"),kt(b,function(j,I){return L(I)&&I.length==2?j[I[0]]=I[1]:(Q(J(I)&<(I,"k")&<(I,"v"),"$arrayToObject expression is invalid."),j[I.k]=I.v),j},{})}function vo(d,g){var b=pe(d,g,null);return Q(L(b),"$concatArrays must resolve to an array"),b.some(oe)?null:b.reduce(function(j,I){return Gt(j,I)},[])}function wo(d,g){var b=pe(d,g.input),j=g.as,I=g.cond;return Q(L(b),"$filter 'input' expression must resolve to an array"),b.filter(function(U){var V={};return V["$"+j]=U,pe(V,I)===!0})}function yo(d,g){var b=pe(d,g[0]),j=pe(d,g[1]);return Q(L(j),"$in second argument must be an array"),j.some(Pr.bind(null,b))}function ua(d,g){var b=pe(d,g);if(oe(b))return null;var j=b[0],I=b[1];if(oe(j))return null;Q(L(j),"$indexOfArray expression must resolve to an array.");var U=b[2]||0,V=b[3];return oe(V)&&(V=j.length),U>V?-1:(Q(U>=0&&V>=0,"$indexOfArray expression is invalid"),(U>0||V<j.length)&&(j=j.slice(U,V)),j.findIndex(Pr.bind(null,I))+U)}function El(d,g){return L(pe(d,g[0]))}function _o(d,g){var b=pe(d,g.input);Q(L(b),"$map 'input' expression must resolve to an array");var j=g.as,I=g.in,U="$"+j;return b.map(function(V){return d[U]=V,pe(d,I)})}function gs(d,g){var b=pe(d,g);Q(J(b),"$objectToArray expression must resolve to an object");var j=[];return Re(b,function(I,U){return j.push({k:U,v:I})}),j}function ko(d,g){for(var b=pe(d,g),j=b[0],I=b[1],U=b[2]||1,V=[];j<I&&U>0||j>I&&U<0;)V.push(j),j+=U;return V}function Tl(d,g){var b=pe(d,g.input),j=pe(d,g.initialValue),I=g.in;return oe(b)?null:(Q(L(b),"$reduce 'input' expression must resolve to an array"),kt(b,function(U,V){return pe({$value:U,$this:V},I)},j))}function Mo(d,g){var b=pe(d,g);if(oe(b))return null;Q(L(b),"$reverseArray expression must resolve to an array");var j=[];return Gt(j,b),j.reverse(),j}function jo(d,g){var b=pe(d,g);return L(b)?b.length:void 0}function fa(d,g){var b=pe(d,g);return ia(b[0],b[1],b[2])}function Sl(d,g){var b=pe(d,g.inputs),j=g.useLongestLength||!1;Q(L(b),"'inputs' expression must resolve to an array"),Q(he(j),"'useLongestLength' must be a boolean"),L(g.defaults)&&Q(nt(j),"'useLongestLength' must be set to true to use 'defaults'");for(var I=0,U=0,V=b.length;U<V;U++){var te=b[U];if(oe(te))return null;Q(L(te),"'inputs' expression values must resolve to an array or null"),I=j?Math.max(I,te.length):Math.min(I||te.length,te.length)}for(var me=[],fe=g.defaults||[],Ce=function(Xe){var pt=b.map(function(Ot,ir){return oe(Ot[Xe])?fe[ir]||null:Ot[Xe]});me.push(pt)},_e=0;_e<I;_e++)Ce(_e);return me}function Eo(d,g){var b=pe(d,g);return L(b)?kt(b,function(j,I){return Object.assign(j,I)},{}):{}}function da(d,g){var b=pe(d,g);return nt(b)&&b.every(nt)}function pa(d,g){var b=pe(d,g);return nt(b)&&b.some(nt)}function xn(d,g){return!pe(d,g[0])}function Vt(d){return d instanceof bs?d:new bs(d)}Vt.isIterator=ha;function ha(d){return!!d&&a(d)==="object"&&ma(d.next)}function ma(d){return!!d&&typeof d=="function"}function To(d,g){var b=d.slice(g+1);d.splice(g),Array.prototype.push.apply(d,b)}var xs=new Error,ga=1,xa=2,So=3,No=4;function Nl(d,g,b){var j=!1,I=-1,U=0;return function(V){V=V===b;try{e:for(;!j;){var te=d();I++;for(var me=-1,fe=g.length,Ce=!1;++me<fe;){var _e=g[me],rt=_e.func,Xe=_e.type;switch(Xe){case ga:te=rt(te,I);break;case xa:if(!rt(te,I))continue e;break;case So:--_e.func,_e.func||(Ce=!0);break;case No:--_e.func,_e.func||To(g,me);continue e;default:break e}}if(j=Ce,V)b[U++]=te;else return{value:te,done:!1}}}catch(pt){if(pt!==xs)throw pt}return j=!0,{done:!0}}}var bs=(function(){function d(g){if(o(this,d),this.__iteratees=[],this.__first=!1,this.__done=!1,this.__buf=[],ma(g)&&(g={next:g}),ha(g)){var b=g;g=function(){var te=b.next();if(te.done)throw xs;return te.value}}else if(Array.isArray(g)){var j=g,I=j.length,U=0;g=function(){if(U<I)return j[U++];throw xs}}else if(!ma(g))throw new Error("Source is not iterable. Must be Array, Function or Object{next:Function}");this.next=Nl(g,this.__iteratees,this.__buf)}return m(d,[{key:"_validate",value:function(){if(this.__first)throw new Error("Cannot add iteratee/transform after `first()`")}},{key:"_push",value:function(b){return this._validate(),this.__iteratees.push(b),this}},{key:"map",value:function(b){return this._push({type:ga,func:b})}},{key:"filter",value:function(b){return this._push({type:xa,func:b})}},{key:"take",value:function(b){return b>0?this._push({type:So,func:b}):this}},{key:"drop",value:function(b){return b>0?this._push({type:No,func:b}):this}},{key:"transform",value:function(b){this._validate();var j=this,I;return Vt(function(){return I||(I=Vt(b(j.value()))),I.next()})}},{key:"first",value:function(){return this.take(1),this.__first=!0,this}},{key:"value",value:function(){return this.__done||(this.__done=this.next(this.__buf).done),this.__first?this.__buf[0]:this.__buf}},{key:"each",value:function(b){for(;;){var j=this.next();if(j.done)break;if(b(j.value)===!1)return!1}return!0}},{key:"reduce",value:function(b,j){var I=this.next(),U=0;for(j===void 0&&!I.done&&(j=I.value,I=this.next(),U++);!I.done;)j=b(j,I.value,U++),I=this.next();return j}},{key:"size",value:function(){return this.reduce(function(b,j){return++b},0)}}]),d})();typeof Symbol=="function"&&(bs.prototype[Symbol.iterator]=function(){return this});var vs=(function(){function d(g,b){o(this,d),this.__operators=g,this.__options=b}return m(d,[{key:"stream",value:function(b,j){var I=this;b=Vt(b);var U=_t[B];return ze(this.__operators)||Re(this.__operators,function(V){var te=Be(V);Q(te.length===1&&Ie(ca(B),te[0]),"invalid aggregation operator ".concat(te)),te=te[0],j&&j instanceof gr?b=U[te].call(j,b,V[te],I.__options):b=U[te](b,V[te],I.__options)}),b}},{key:"run",value:function(b,j){return this.stream(b,j).value()}}]),d})();function Ao(d,g,b){return Q(L(g),"Aggregation pipeline must be an array"),new vs(g,b).run(d)}var ba=(function(){function d(g,b,j){o(this,d),this.__filterFn=b.test.bind(b),this.__query=b,this.__source=g,this.__projection=j||b.__projection,this.__operators=[],this.__result=null,this.__stack=[],this.__options={}}return m(d,[{key:"_fetch",value:function(){return this.__result?this.__result:(J(this.__projection)&&this.__operators.push({$project:this.__projection}),this.__result=Vt(this.__source).filter(this.__filterFn),this.__operators.length>0&&(this.__result=new vs(this.__operators,this.__options).stream(this.__result,this.__query)),this.__result)}},{key:"all",value:function(){return this._fetch().value()}},{key:"count",value:function(){return this.all().length}},{key:"skip",value:function(b){return this.__operators.push({$skip:b}),this}},{key:"limit",value:function(b){return this.__operators.push({$limit:b}),this}},{key:"sort",value:function(b){return this.__operators.push({$sort:b}),this}},{key:"collation",value:function(b){return this.__options.collation=b,this}},{key:"next",value:function(){if(this.__stack){if(this.__stack.length>0)return this.__stack.pop();var b=this._fetch().next();if(!b.done)return b.value;this.__stack=null}}},{key:"hasNext",value:function(){if(!this.__stack)return!1;if(this.__stack.length>0)return!0;var b=this._fetch().next();return b.done?this.__stack=null:this.__stack.push(b.value),!!this.__stack}},{key:"map",value:function(b){return this._fetch().map(b).value()}},{key:"forEach",value:function(b){this._fetch().each(b)}}]),d})();typeof Symbol=="function"&&(ba.prototype[Symbol.iterator]=function(){return this._fetch()});var gr=(function(){function d(g,b){o(this,d),this.__criteria=g,this.__projection=b||{},this.__compiled=[],this._compile()}return m(d,[{key:"_compile",value:function(){var b=this;Q(J(this.__criteria),"query criteria must be an object");var j;Re(this.__criteria,function(I,U){U==="$where"?j={field:U,expr:I}:U==="$expr"||Ie(["$and","$or","$nor"],U)?b._processOperator(U,U,I):(Q(!aa(U),"unknown top level operator: ".concat(U)),I=oa(I),Re(I,function(V,te){b._processOperator(U,te,V)})),J(j)&&b._processOperator(j.field,j.field,j.expr)})}},{key:"_processOperator",value:function(b,j,I){Q(lt(_t[ae],j),"invalid query operator ".concat(j," detected")),this.__compiled.push(_t[ae][j](b,I))}},{key:"test",value:function(b){for(var j=0,I=this.__compiled.length;j<I;j++)if(!this.__compiled[j](b))return!1;return!0}},{key:"find",value:function(b,j){return new ba(b,this,j)}},{key:"remove",value:function(b){var j=this;return kt(b,function(I,U){return j.test(U)||I.push(U),I},[])}}]),d})();function va(d,g,b){return new gr(g).find(d,b)}function Al(d,g){return new gr(g).remove(d)}function wa(d,g){if(Pr(d,g)||oe(d)&&oe(g))return!0;if(L(d)){var b=Pr.bind(null,g);return d.some(b)||pn(d,1).some(b)}return!1}function Io(d,g){return!wa(d,g)}function Co(d,g){return oe(d)?g.some(Ee):Ar(vt(d),g).length>0}function Do(d,g){return!Co(d,g)}function ht(d,g){return bn(d,g,function(b,j){return b<j})}function ft(d,g){return bn(d,g,function(b,j){return b<=j})}function Ro(d,g){return bn(d,g,function(b,j){return b>j})}function Oo(d,g){return bn(d,g,function(b,j){return b>=j})}function Il(d,g){return vt(d).some(function(b){return F(b)&&L(g)&&g.length===2&&b%g[0]===g[1]})}function Cl(d,g){d=vt(d);var b=function(I){return ge(I)&&!!I.match(g)};return d.some(b)||pn(d,1).some(b)}function Dl(d,g){return(g===!1||g===0)&&d===void 0||(g===!0||g===1)&&d!==void 0}function Rl(d,g){var b=!1;if(L(d)&&L(g))for(var j=0,I=g.length;j<I;j++)if(J(g[j])&&Ie(Be(g[j]),"$elemMatch"))b=b||Lo(d,g[j].$elemMatch);else return Ar(g,d).length===I;return b}function $o(d,g){return L(d)&&F(g)&&d.length===g}function Lo(d,g){if(L(d)&&!ze(d)){var b=function(me){return me},j=g;Be(g).every(aa)&&(j={temp:g},b=function(me){return{temp:me}});for(var I=new gr(j),U=0,V=d.length;U<V;U++)if(I.test(b(d[U])))return!0}return!1}function Pt(d,g){switch(g){case 1:case"double":return F(d)&&(d+"").indexOf(".")!==-1;case 2:case T:return ge(d);case 3:case W:return J(d);case 4:case $:return L(d);case 6:case v:return oe(d);case 8:case _:return he(d);case 9:case A:return Te(d);case 10:case x:return Ee(d);case 11:case C:return De(d);case 16:case"int":return F(d)&&d<=2147483647&&(d+"").indexOf(".")===-1;case 18:case"long":return F(d)&&d>2147483647&&d<=9223372036854776e3&&(d+"").indexOf(".")===-1;case 19:case"decimal":return F(d);default:return!1}}function bn(d,g,b){return vt(d).some(function(j){return je(j)===je(g)&&b(j,g)})}function Qt(d){return function(g,b){var j=pe(g,b);return d(j[0],j[1])}}var Po=Qt(wa),ya=Qt(Io),ar=Qt(Ro),Fo=Qt(ht),Uo=Qt(Oo),zo=Qt(ft),Ho=Qt(Do);function Bo(d,g){var b=pe(d,g);return b[0]>b[1]?1:b[0]<b[1]?-1:0}function Wo(d,g){var b,j,I,U="$cond: invalid arguments";L(g)?(Q(g.length===3,U),b=g[0],j=g[1],I=g[2]):(Q(J(g),U),b=g.if,j=g.then,I=g.else);var V=pe(d,b);return V?pe(d,j):pe(d,I)}function Jt(d,g){var b="Invalid arguments for $switch operator";Q(g.branches,b);var j=g.branches.find(function(I){return Q(I.case&&I.then,b),pe(d,I.case)});return j?pe(d,j.then):(Q(g.default,b),pe(d,g.default))}function Ol(d,g){Q(L(g)&&g.length===2,"$ifNull expression must resolve to array(2)");var b=pe(d,g);return oe(b[0])?b[1]:b[0]}function er(d,g){var b=pe(d,g),j=new Date(b.getFullYear(),0,0),I=b-j,U=1e3*60*60*24;return Math.round(I/U)}function qo(d,g){var b=pe(d,g);return b.getDate()}function _a(d,g){var b=pe(d,g);return b.getDay()+1}function Ir(d,g){var b=pe(d,g);return b.getFullYear()}function Fn(d,g){var b=pe(d,g);return b.getMonth()+1}function ws(d,g){var b=pe(d,g);b=new Date(+b),b.setHours(0,0,0),b.setDate(b.getDate()+4-(b.getDay()||7));var j=new Date(b.getFullYear(),0,1);return Math.floor(((b-j)/864e5+1)/7)}function mt(d,g){var b=pe(d,g);return b.getUTCHours()}function Cr(d,g){var b=pe(d,g);return b.getMinutes()}function ys(d,g){var b=pe(d,g);return b.getSeconds()}function Yo(d,g){var b=pe(d,g);return b.getMilliseconds()}var ka={"%Y":[Ir,4],"%m":[Fn,2],"%d":[qo,2],"%H":[mt,2],"%M":[Cr,2],"%S":[ys,2],"%L":[Yo,3],"%j":[er,3],"%w":[_a,1],"%U":[ws,2],"%%":"%"};function $l(d,g){for(var b=g.format,j=pe(d,g.date),I=b.match(/(%%|%Y|%m|%d|%H|%M|%S|%L|%j|%w|%U)/g),U=0,V=I.length;U<V;U++){var te=ka[I[U]],me=te;if(L(te)){var fe=te[0],Ce=te[1];me=Ll(fe(d,j),Ce)}b=b.replace(I[U],me)}return b}function Ll(d,g){return new Array(Math.max(g-String(d).length+1,0)).join("0")+d}function Pl(d,g){return g}function Go(d,g){var b=pe(d,g),j=Ln(b[0]),I=Ln(b[1]);return j.length===I.length&&j.length===Ar(j,I).length}function _s(d,g){var b=pe(d,g);return Ar(b[0],b[1])}function vn(d,g){var b=pe(d,g);return b[0].filter(qe.bind(null,b[1]))}function Fl(d,g){var b=pe(d,g);return ul(b[0],b[1])}function Xo(d,g){var b=pe(d,g);return Ar(b[0],b[1]).length===b[0].length}function Ko(d,g){var b=pe(d,g)[0];return b.some(nt)}function Ma(d,g){var b=pe(d,g)[0];return b.every(nt)}function ja(d,g){var b=pe(d,g);return[null,void 0].some(Ie.bind(null,b))?null:b.join("")}function Zo(d,g){var b=pe(d,g),j="$indexOfBytes expression resolves to invalid an argument";if(oe(b[0]))return null;Q(ge(b[0])&&ge(b[1]),j);var I=b[0],U=b[1],V=b[2],te=b[3],me=oe(V)||F(V)&&V>=0&&Math.round(V)===V;if(me=me&&(oe(te)||F(te)&&te>=0&&Math.round(te)===te),Q(me,j),V=V||0,te=te||I.length,V>te)return-1;var fe=I.substring(V,te).indexOf(U);return fe>-1?fe+V:fe}function Ul(d,g){var b=pe(d,g);return oe(b[0])?null:(Q(b.every(ge),"$split expression must result to array(2) of strings"),b[0].split(b[1]))}function Ea(d,g){return~-encodeURI(pe(d,g)).split(/%..|./).length}function Ta(d,g){return pe(d,g).length}function zl(d,g){var b=pe(d,g),j=b[0],I=b[1];return Pr(j,I)||b.every(oe)?0:(Q(b.every(ge),"$strcasecmp must resolve to array(2) of strings"),j=j.toUpperCase(),I=I.toUpperCase(),j>I&&1||j<I&&-1||0)}function Vo(d,g){var b=pe(d,g),j=b[0],I=b[1],U=b[2];Q(ge(j)&&F(I)&&I>=0&&F(U)&&U>=0,"$substrBytes: invalid arguments");for(var V=Bl(j),te=[],me=0,fe=0;fe<V.length;fe++)te.push(me),me+=V[fe].length;var Ce=te.indexOf(I),_e=te.indexOf(I+U);return Q(Ce>-1&&_e>-1,"$substrBytes: invalid range, start or end index is a UTF-8 continuation byte."),j.substring(Ce,_e)}function Xt(d,g){var b=pe(d,g),j=b[0],I=b[1],U=b[2];return ge(j)?I<0?"":U<0?j.substr(I):j.substr(I,U):""}function Sa(d,g){return Xt(d,g)}function Un(d,g){var b=pe(d,g);return ze(b)?"":b.toLowerCase()}function Qo(d,g){var b=pe(d,g);return ze(b)?"":b.toUpperCase()}var Jo=[192,224,240];function Hl(d){if(d<128)return[d];for(var g=d<2048&&1||d<65536&&2||3,b=Jo[g-1],j=[(d>>6*g)+b];g>0;)j.push(128|d>>6*--g&63);return j}function Bl(d){for(var g=[],b=0,j=d.length;b<j;b++)g.push(Hl(d.codePointAt(b)));return g}function Wl(d,g){var b=g.vars,j=g.in,I=Be(b);return Re(I,function(U){var V=pe(d,b[U]),te="$"+U;d[te]=V}),pe(d,j)}var ql=Object.freeze({__proto__:null,$abs:pl,$add:hl,$ceil:ml,$divide:gl,$exp:xl,$floor:bl,$ln:hs,$log:vl,$log10:ms,$mod:wl,$multiply:yl,$pow:_l,$round:mo,$sqrt:go,$subtract:xo,$trunc:kl,$arrayElemAt:Ml,$arrayToObject:jl,$concatArrays:vo,$filter:wo,$in:yo,$indexOfArray:ua,$isArray:El,$map:_o,$objectToArray:gs,$range:ko,$reduce:Tl,$reverseArray:Mo,$size:jo,$slice:fa,$zip:Sl,$mergeObjects:Eo,$and:da,$or:pa,$not:xn,$eq:Po,$ne:ya,$gt:ar,$lt:Fo,$gte:Uo,$lte:zo,$nin:Ho,$cmp:Bo,$cond:Wo,$switch:Jt,$ifNull:Ol,$dayOfYear:er,$dayOfMonth:qo,$dayOfWeek:_a,$year:Ir,$month:Fn,$week:ws,$hour:mt,$minute:Cr,$second:ys,$millisecond:Yo,$dateToString:$l,$literal:Pl,$setEquals:Go,$setIntersection:_s,$setDifference:vn,$setUnion:Fl,$setIsSubset:Xo,$anyElementTrue:Ko,$allElementsTrue:Ma,$concat:ja,$indexOfBytes:Zo,$split:Ul,$strLenBytes:Ea,$strLenCP:Ta,$strcasecmp:zl,$substrBytes:Vo,$substr:Xt,$substrCP:Sa,$toLower:Un,$toUpper:Qo,$let:Wl});function Ur(d,g){return oe(g)?d:d.map(function(b){return pe(b,g)})}function wn(d,g){return Ln(Ur(d,g))}function Yl(d,g){var b=Ur(d,g).filter(F),j=kt(b,function(I,U){return I+U},0);return j/(b.length||1)}function Gl(d,g){return d.length>0?pe(d[0],g):void 0}function Na(d,g){return d.length>0?pe(d[d.length-1],g):void 0}function ei(d,g){return kt(Ur(d,g),function(b,j){return oe(b)||j>b?j:b},void 0)}function zr(d,g){return kt(d,function(b,j){return Object.assign(b,pe(j,g))},{})}function ks(d,g){return kt(Ur(d,g),function(b,j){return oe(b)||j<b?j:b},void 0)}function Xl(d,g){return lo(Ur(d,g).filter(F),!1)}function Kl(d,g){return lo(Ur(d,g).filter(F),!0)}function Zl(d,g){return L(d)?F(g)?d.length*g:kt(Ur(d,g).filter(F),function(b,j){return b+j},0):0}var yn=Object.freeze({__proto__:null,$addToSet:wn,$avg:Yl,$first:Gl,$last:Na,$max:ei,$mergeObjects:zr,$min:ks,$push:Ur,$stdDevPop:Xl,$stdDevSamp:Kl,$sum:Zl});function or(d,g,b){var j=Be(g);return j.length===0?d:d.map(function(I){var U=ne(I);return Re(j,function(V){var te=pe(I,g[V]);na(U,V,te)}),U})}var ti=or;function Vl(d,g,b){var j=g.boundaries,I=g.default,U=j[0],V=j[j.length-1],te=g.output||{count:{$sum:1}};Q(j.length>2,"$bucket 'boundaries' expression must have at least 3 elements");for(var me=je(U),fe=0,Ce=j.length-1;fe<Ce;fe++)Q(me===je(j[fe+1]),"$bucket 'boundaries' must all be of the same type"),Q(j[fe]<j[fe+1],"$bucket 'boundaries' must be sorted in ascending order");!oe(I)&&je(g.default)===je(U)&&Q(U>g.default||V<g.default,"$bucket 'default' expression must be out of boundaries range");var _e={};Re(j,function(Xe){return _e[Xe]=[]}),oe(I)||(_e[I]=[]);var rt=!1;return Vt(function(){return rt||(d.each(function(Xe){var pt=pe(Xe,g.groupBy);if(oe(pt)||pt<U||pt>=V)Q(!oe(I),"$bucket require a default for out of range values"),_e[I].push(Xe);else{Q(pt>=U&&pt<V,"$bucket 'groupBy' expression must resolve to a value in range of boundaries");var Ot=ea(j,pt),ir=j[Math.max(0,Ot-1)];_e[ir].push(Xe)}}),j.pop(),oe(I)||j.push(I),rt=Vt(j).map(function(Xe){var pt=ds(_e[Xe],null,te);return Object.assign(pt,{_id:Xe})})),rt.next()})}function Ql(d,g,b){var j=g.output||{count:{$sum:1}},I=g.groupBy,U=g.buckets;return Q(U>0,"The $bucketAuto 'buckets' field must be greater than 0, but found: "+U),d.transform(function(V){for(var te=Math.max(1,Math.round(V.length/U)),me=fl(pe),fe={},Ce=[],_e=ls(V,function(Ca){var Bn=me(Ca,I);return oe(Bn)?Ce.push(Ca):(fe[Bn]||(fe[Bn]=[]),fe[Bn].push(Ca)),Bn}),rt=gn(),Xe=[],pt=0,Ot=0,ir=_e.length;Ot<U&&pt<ir;Ot++){for(var S={},xr=[],Hn=0;Hn<te&&pt<ir;Hn++){var $t=me(_e[pt],I);if(oe($t)&&($t=null),Gt(xr,oe($t)?Ce:fe[$t]),pt+=oe($t)?Ce.length:fe[$t].length,lt(S,"min")||(S.min=$t),Xe.length>0){var Ke=Xe[Xe.length-1];Ke[rt].max=S.min}}Ot==U-1&&Gt(xr,_e.slice(pt)),Xe.push(Object.assign(ds(xr,null,j),{_id:S}))}return Xe.length>0&&(Xe[Xe.length-1][rt].max=me(_e[_e.length-1],I)),Xe})}function Jl(d,g,b){return Q(ge(g)&&g.trim()!==""&&g.indexOf(".")===-1&&g.trim()[0]!=="$","Invalid expression value for $count"),Vt(function(){var j={};return j[g]=d.size(),{value:j,done:!1}}).first()}function ec(d,g,b){return d.transform(function(j){return[pr(g,function(I){return Ao(j,I)})]})}function ri(d,g,b){var j=gn(),I=g[j];return d.transform(function(U){var V=cs(U,function(fe){return pe(fe,I,I)});g=be(g),delete g[j];var te=-1,me=V.keys.length;return function(){if(++te===me)return{done:!0};var fe=V.keys[te],Ce={};return fe!==void 0&&(Ce[j]=fe),Re(g,function(_e,rt){Ce[rt]=ds(V.groups[te],rt,_e)}),{value:Ce,done:!1}}})}function _n(d,g,b){return d.take(g)}function G(d,g,b){var j=g.from,I=g.localField,U=g.foreignField,V=g.as;Q(L(j)&&ge(U)&&ge(I)&&ge(V),"$lookup: invalid argument");var te={};return Re(j,function(me){var fe=Mr(mr(me,U));te[fe]=te[fe]||[],te[fe].push(me)}),d.map(function(me){var fe=Mr(mr(me,I)),Ce=be(me);return Ce[V]=te[fe]||[],Ce})}function ie(d,g,b){var j=new gr(g);return d.filter(function(I){return j.test(I)})}function se(d,g,b){return Q(L(g),"$out expression must be an array"),d.map(function(j){return g.push(j),j})}function ke(d,g,b){if(ze(g))return d;var j=Be(g),I=!1,U=gn();if(et(g),Ie(j,U)){var V=g[U];(V===0||V===!1)&&(j=j.filter(qe.bind(null,[U])),Q(qe(j,U),"Must not contain collections id key"),I=ze(j))}else j.push(U);return d.map(function(te){return Pe(te,g,j,I)})}function Pe(d,g,b,j){var I=gn(),U={},V=!1,te=!1,me=[];return j&&me.push(I),b.forEach(function(fe){var Ce,_e=g[fe];if(fe!==I&&Ie([0,!1],_e)&&(te=!0),fe===I&&ze(_e))Ce=d[fe];else if(ge(_e))Ce=pe(d,_e,fe);else if(!Ie([1,!0],_e))if(L(_e))Ce=_e.map(function(S){var xr=pe(d,S);return oe(xr)?null:xr});else if(J(_e)){var rt=Be(_e),Xe=rt.length>1?!1:rt[0];if(Ie(ca(Y),Xe)){var pt=_t[Y];Xe==="$slice"?vt(_e[Xe]).every(F)?(Ce=pt[Xe](d,_e[Xe],fe),V=!0):Ce=pe(d,_e,fe):Ce=pt[Xe](d,_e[Xe],fe)}else if(lt(d,fe)){et(_e);var Ot=d[fe];Ce=L(Ot)?Ot.map(function(S){return Pe(S,_e,rt,!1)}):Pe(Ot,_e,rt,!1)}else Ce=pe(d,_e,fe)}else{me.push(fe);return}var ir=mn(d,fe,{preserveMissingValues:!0});ir!==void 0&&hr(U,ir,{flatten:!0}),qe([0,1,!1,!0],_e)&&(Ce===void 0?sa(U,fe):na(U,fe,Ce))}),us(U),(V||te||j)&&(U=Object.assign({},d,U),me.length>0&&(U=ne(U),Re(me,function(fe){return sa(U,fe)}))),U}function et(d){var g=gn(),b=[!1,!1];Re(d,function(j,I){I!==g&&(j===0||j===!1?b[0]=!0:(j===1||j===!0)&&(b[1]=!0),Q(!(b[0]&&b[1]),"Projection cannot have a mix of inclusion and exclusion."))})}function It(d,g,b){return d.map(function(j){return ps(ne(j),g)})}function dt(d,g,b){return d.map(function(j){return j=pe(j,g.newRoot),Q(J(j),"$replaceRoot expression must return an object"),j})}function Aa(d,g,b){var j=g.size;return Q(F(j),"$sample size must be a positive integer"),d.transform(function(I){var U=I.length,V=-1;return function(){if(++V===j)return{done:!0};var te=Math.floor(Math.random()*U);return{value:I[te],done:!1}}})}function tc(d,g,b){return d.drop(g)}function tr(d,g,b){if(ze(g)||!J(g))return d;b=b||{};var j=Pn,I=b.collation;return J(I)&&ge(I.locale)&&(j=rc(I)),d.transform(function(U){var V=Be(g);return Re(V.reverse(),function(te){var me=cs(U,function(_e){return mr(_e,te)}),fe={},Ce=ls(me.keys,function(_e,rt){return fe[_e]=rt,_e},j);g[te]===-1&&Ce.reverse(),U=[],Re(Ce,function(_e){return Gt(U,me.groups[fe[_e]])})}),U})}var Ms={1:"base",2:"accent",3:"variant"};function rc(d){var g={sensitivity:Ms[d.strength||3],caseFirst:d.caseFirst==="off"?"false":d.caseFirst||"false",numeric:d.numericOrdering||!1,ignorePunctuation:d.alternate==="shifted"};(d.caseLevel||!1)===!0&&(g.sensitivity==="base"&&(g.sensitivity="case"),g.sensitivity==="accent"&&(g.sensitivity="variant"));var b=new Intl.Collator(d.locale,g);return function(j,I){if(!ge(j)||!ge(I))return Pn(j,I);var U=b.compare(j,I);return U<0?-1:U>0?1:0}}function kn(d,g,b){var j={count:{$sum:1}};return j[gn()]=g,tr(ri(d,j),{count:-1},b)}function js(d,g,b){ge(g)&&(g={path:g});var j=g.path.substr(1),I=g.includeArrayIndex||!1,U=g.preserveNullAndEmptyArrays||!1,V=function(fe,Ce){return I!==!1&&(fe[I]=Ce),fe},te;return Vt(function(){for(var me=function(){if(Vt.isIterator(te)){var _e=te.next();if(!_e.done)return{v:_e}}var rt=d.next();if(rt.done)return{v:rt};if(rt=rt.value,te=mr(rt,j),L(te))if(te.length===0&&U===!0){te=null;var Xe=ne(rt);return sa(Xe,j),{v:{value:V(Xe,null),done:!1}}}else te=Vt(te).map(function(Ot,ir){var S=ne(rt);return na(S,j,Ot),V(S,ir)});else if(!ze(te)||U===!0){var pt=ne(rt);return{v:{value:V(pt,null),done:!1}}}};;){var fe=me();if(a(fe)==="object")return fe.v}})}var Es=Object.freeze({__proto__:null,$addFields:or,$set:ti,$bucket:Vl,$bucketAuto:Ql,$count:Jl,$facet:ec,$group:ri,$limit:_n,$lookup:G,$match:ie,$out:se,$project:ke,$redact:It,$replaceRoot:dt,$sample:Aa,$skip:tc,$sort:tr,$sortByCount:kn,$unwind:js});function it(d,g,b){le("$ not implemented")}function nc(d,g,b){var j=mr(d,b),I=new gr(g);Q(L(j),"$elemMatch: invalid argument");for(var U=0;U<j.length;U++)if(I.test(j[U]))return[j[U]]}function ni(d,g,b){var j=mr(d,b);return L(j)?L(g)?ia(j,g[0],g[1]):(Q(F(g),"$slice: invalid arguments for projection"),ia(j,g)):j}var Ts=Object.freeze({__proto__:null,$:it,$elemMatch:nc,$slice:ni});function Bt(d){return function(g,b){return function(j){var I=mr(j,g,{meta:!0});return I=hn(I.result,I.depth),d(I,b)}}}var sc=Bt(Rl),ac=Bt(Lo),Ss=Bt(wa),Hr=Bt(Dl),Ns=Bt(Ro),si=Bt(Oo),As=Bt(Co),ai=Bt(ht),oi=Bt(ft),Is=Bt(Il),ii=Bt(Io),zn=Bt(Do),Kr=Bt(Cl),Cs=Bt($o),oc=Bt(Pt);function ic(d,g){Q(L(g),"Invalid expression: $and expects value to be an Array");var b=[];return Re(g,function(j){return b.push(new gr(j))}),function(j){for(var I=0;I<b.length;I++)if(!b[I].test(j))return!1;return!0}}function li(d,g){Q(L(g),"Invalid expression. $or expects value to be an Array");var b=[];return Re(g,function(j){return b.push(new gr(j))}),function(j){for(var I=0;I<b.length;I++)if(b[I].test(j))return!0;return!1}}function Ds(d,g){Q(L(g),"Invalid expression. $nor expects value to be an Array");var b=li("$or",g);return function(j){return!b(j)}}function Rs(d,g){var b={};b[d]=oa(g);var j=new gr(b);return function(I){return!j.test(I)}}function Ia(d,g){return Me(g)||(g=new Function("return "+g+";")),function(b){return g.call(b)===!0}}function lc(d,g){return function(b){return pe(b,g)}}var ci=Object.freeze({__proto__:null,$all:sc,$elemMatch:ac,$eq:Ss,$exists:Hr,$gt:Ns,$gte:si,$in:As,$lt:ai,$lte:oi,$mod:Is,$ne:ii,$nin:zn,$regex:Kr,$size:Cs,$type:oc,$and:ic,$or:li,$nor:Ds,$not:Rs,$where:Ia,$expr:lc}),_t={};_t[X]={},_t[q]={},_t[B]={},_t[Y]={},_t[ae]={};var cc=[[X,ql],[q,yn],[B,Es],[Y,Ts],[ae,ci]];function Ct(){Re(cc,function(d){var g=y(d,2),b=g[0],j=g[1];Object.assign(_t[b],j)})}function Ut(d,g){var b=g(fs());Q(lt(_t,d),"Invalid operator class ".concat(d));var j=_t[d];Re(b,function(U,V){Q(/^\$[a-zA-Z0-9_]*$/.test(V),"Invalid operator name ".concat(V)),Q(!lt(j,V),"".concat(V," already exists for '").concat(d,"' operators"))});var I={};switch(d){case ae:Re(b,function(U,V){U=U.bind(b),I[V]=function(te,me){return function(fe){var Ce=mr(fe,te),_e=U(te,Ce,me);return Q(he(_e),"".concat(V," must return a boolean")),_e}}});break;case Y:Re(b,function(U,V){U=U.bind(b),I[V]=function(te,me,fe){var Ce=mr(te,fe);return U(fe,Ce,me)}});break;default:Re(b,function(U,V){I[V]=function(){for(var te=arguments.length,me=new Array(te),fe=0;fe<te;fe++)me[fe]=arguments[fe];return U.apply(b,me)}})}Object.assign(_t[d],I)}var uc={query:function(g,b){return new gr(g).find(this.toJSON(),b)},aggregate:function(g){return new vs(g).run(this.toJSON())}};Ct();var fc="2.5.3",ui={_internal:fs,Aggregator:vs,CollectionMixin:uc,Cursor:ba,Lazy:Vt,OP_EXPRESSION:X,OP_GROUP:q,OP_PIPELINE:B,OP_PROJECTION:Y,OP_QUERY:ae,Query:gr,VERSION:fc,addOperators:Ut,aggregate:Ao,find:va,remove:Al,setup:la};return ui}))})(zi)),zi.exports}var Li={},Pi={exports:{}};const Gj={},Xj=Object.freeze(Object.defineProperty({__proto__:null,default:Gj},Symbol.toStringTag,{value:"Module"})),im=Zf(Xj);var lm;function Kj(){return lm||(lm=1,(function(e,n){var a=(function(){var o=function(B,Y,ae,ee){for(ae=ae||{},ee=B.length;ee--;ae[B[ee]]=Y);return ae},c=[1,5],m=[1,7],y=[1,8],h=[1,6,10],l=[1,9],f=[1,6,8,10],u=[1,24],p=[1,25],x=[1,26],v=[1,27],_=[1,28],k=[1,29],M=[1,30],T=[1,17],A=[1,18],C=[1,19],O=[21,22,23,24,25,29,30],$=[1,6,8,10,18],W=[1,47],R=[6,18],Z={trace:function(){},yy:{},symbols_:{error:2,expressions:3,expression:4,andCondition:5,OR:6,filterExpr:7,AND:8,LPAREN:9,RPAREN:10,propExpr:11,valueExpr:12,PROP:13,NOT:14,REGEXPOP:15,LBRACKET:16,inExpr:17,RBRACKET:18,OP:19,VALUE:20,NULL:21,TRUE:22,FALSE:23,NUMBER:24,NOW:25,DATEOP:26,AMOUNT:27,INTERVAL:28,LITERAL:29,STRING:30,ADD:31,SUB:32,CONTAINS:33,STARTSWITH:34,ENDSWITH:35,GT:36,LT:37,GTE:38,LTE:39,$accept:0,$end:1},terminals_:{2:"error",6:"OR",8:"AND",9:"LPAREN",10:"RPAREN",13:"PROP",14:"NOT",16:"LBRACKET",18:"RBRACKET",21:"NULL",22:"TRUE",23:"FALSE",24:"NUMBER",25:"NOW",27:"AMOUNT",28:"INTERVAL",29:"LITERAL",30:"STRING",31:"ADD",32:"SUB",33:"CONTAINS",34:"STARTSWITH",35:"ENDSWITH",36:"GT",37:"LT",38:"GTE",39:"LTE"},productions_:[0,[3,1],[4,1],[4,3],[5,1],[5,3],[7,3],[7,2],[11,1],[12,2],[12,1],[12,4],[12,3],[12,2],[12,1],[17,3],[17,1],[20,1],[20,1],[20,1],[20,1],[20,4],[20,1],[20,1],[26,1],[26,1],[15,2],[15,2],[15,2],[19,1],[19,1],[19,1],[19,1],[19,1]],performAction:function(Y,ae,ee,re,Q,ne,be,je){var H=ne.length-1;switch(Q){case 1:return re.debug("expression",ne[H]),re.debug("opt",je),ne[H]&&ne[H].yg?ne[H].yg:ne[H];case 2:re.debug("andCondition",ne[H]),this.$=ne[H];break;case 3:re.debug("expression OR andCondition",ne[H-2],ne[H]),ne[H-2]=ne[H-2].$or?ne[H-2]:{$or:[re.ungroup(ne[H-2])]},ne[H-2].$or.push(re.ungroup(ne[H])),this.$=ne[H-2];break;case 4:re.debug("filterExpr",ne[H]),this.$=ne[H];break;case 5:re.debug("andCondition AND filterExpr",ne[H-2],ne[H]),ne[H-2]=ne[H-2].$and?ne[H-2]:{$and:[re.ungroup(ne[H-2])]},ne[H-2].$and.push(re.ungroup(ne[H])),this.$=ne[H-2];break;case 6:re.debug("LPAREN expression RPAREN",ne[H-1]),this.$={yg:ne[H-1]};break;case 7:this.$={[ne[H-1]]:ne[H]};break;case 8:ne[H]=ne[H].replace(/:$/,""),ne[H]=je.aliases&&je.aliases[ne[H]]?je.aliases[ne[H]]:ne[H],this.$=ne[H];break;case 9:this.$={$not:ne[H]};break;case 10:this.$={$regex:ne[H]};break;case 11:this.$={$nin:ne[H-1]};break;case 12:this.$={$in:ne[H-1]};break;case 13:this.$={},this.$[ne[H-1]]=ne[H];break;case 14:this.$=ne[H];break;case 15:this.$.push(ne[H]);break;case 16:this.$=[ne[H]];break;case 17:this.$=null;break;case 18:this.$=!0;break;case 19:this.$=!1;break;case 20:this.$=parseInt(Y);break;case 21:this.$=re.relDateToAbsolute(ne[H-2],ne[H-1],ne[H]);break;case 22:this.$=re.unescape(ne[H]);break;case 23:ne[H]=ne[H].replace(/^'|'$/g,""),this.$=re.unescape(ne[H]);break;case 24:this.$="add";break;case 25:this.$="sub";break;case 26:ne[H]=ne[H].replace(/^'|'$/g,""),ne[H]=re.unescape(ne[H]),this.$=re.stringToRegExp(ne[H]);break;case 27:ne[H]=ne[H].replace(/^'|'$/g,""),ne[H]=re.unescape(ne[H]),this.$=re.stringToRegExp(ne[H],"^");break;case 28:ne[H]=ne[H].replace(/^'|'$/g,""),ne[H]=re.unescape(ne[H]),this.$=re.stringToRegExp(ne[H],"$");break;case 29:this.$="$ne";break;case 30:this.$="$gt";break;case 31:this.$="$lt";break;case 32:this.$="$gte";break;case 33:this.$="$lte";break}},table:[{3:1,4:2,5:3,7:4,9:c,11:6,13:m},{1:[3]},{1:[2,1],6:y},o(h,[2,2],{8:l}),o(f,[2,4]),{4:10,5:3,7:4,9:c,11:6,13:m},{12:11,14:[1,12],15:13,16:[1,14],19:15,20:16,21:u,22:p,23:x,24:v,25:_,29:k,30:M,33:T,34:A,35:C,36:[1,20],37:[1,21],38:[1,22],39:[1,23]},o([14,16,21,22,23,24,25,29,30,33,34,35,36,37,38,39],[2,8]),{5:31,7:4,9:c,11:6,13:m},{7:32,9:c,11:6,13:m},{6:y,10:[1,33]},o(f,[2,7]),o(O,[2,29],{15:34,16:[1,35],33:T,34:A,35:C}),o(f,[2,10]),{17:36,20:37,21:u,22:p,23:x,24:v,25:_,29:k,30:M},{20:38,21:u,22:p,23:x,24:v,25:_,29:k,30:M},o(f,[2,14]),{30:[1,39]},{30:[1,40]},{30:[1,41]},o(O,[2,30]),o(O,[2,31]),o(O,[2,32]),o(O,[2,33]),o($,[2,17]),o($,[2,18]),o($,[2,19]),o($,[2,20]),{26:42,31:[1,43],32:[1,44]},o($,[2,22]),o($,[2,23]),o(h,[2,3],{8:l}),o(f,[2,5]),o(f,[2,6]),o(f,[2,9]),{17:45,20:37,21:u,22:p,23:x,24:v,25:_,29:k,30:M},{6:W,18:[1,46]},o(R,[2,16]),o(f,[2,13]),o(f,[2,26]),o(f,[2,27]),o(f,[2,28]),{27:[1,48]},{27:[2,24]},{27:[2,25]},{6:W,18:[1,49]},o(f,[2,12]),{20:50,21:u,22:p,23:x,24:v,25:_,29:k,30:M},{28:[1,51]},o(f,[2,11]),o(R,[2,15]),o($,[2,21])],defaultActions:{43:[2,24],44:[2,25]},parseError:function(Y,ae){if(ae.recoverable)this.trace(Y);else{var ee=new Error(Y);throw ee.hash=ae,ee}},parse:function(Y){var ae=this,ee=[0],re=[null],Q=[],ne=this.table,be="",je=0,H=0,he=2,ge=1,F=Q.slice.call(arguments,1),L=Object.create(this.lexer),J={yy:{}};for(var xe in this.yy)Object.prototype.hasOwnProperty.call(this.yy,xe)&&(J.yy[xe]=this.yy[xe]);L.setInput(Y,J.yy),J.yy.lexer=L,J.yy.parser=this,typeof L.yylloc>"u"&&(L.yylloc={});var Te=L.yylloc;Q.push(Te);var De=L.options&&L.options.ranges;typeof J.yy.parseError=="function"?this.parseError=J.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var Me=function(){var Be;return Be=L.lex()||ge,typeof Be!="number"&&(Be=ae.symbols_[Be]||Be),Be},oe,Ee,Ne,Ie,qe={},nt,ze,vt,lt;;){if(Ee=ee[ee.length-1],this.defaultActions[Ee]?Ne=this.defaultActions[Ee]:((oe===null||typeof oe>"u")&&(oe=Me()),Ne=ne[Ee]&&ne[Ee][oe]),typeof Ne>"u"||!Ne.length||!Ne[0]){var le="";lt=[];for(nt in ne[Ee])this.terminals_[nt]&&nt>he&<.push("'"+this.terminals_[nt]+"'");L.showPosition?le="Parse error on line "+(je+1)+`:
|
|
24
|
-
`+L.showPosition()+`
|
|
25
|
-
Expecting `+lt.join(", ")+", got '"+(this.terminals_[oe]||oe)+"'":le="Parse error on line "+(je+1)+": Unexpected "+(oe==ge?"end of input":"'"+(this.terminals_[oe]||oe)+"'"),this.parseError(le,{text:L.match,token:this.terminals_[oe]||oe,line:L.yylineno,loc:Te,expected:lt})}if(Ne[0]instanceof Array&&Ne.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Ee+", token: "+oe);switch(Ne[0]){case 1:ee.push(oe),re.push(L.yytext),Q.push(L.yylloc),ee.push(Ne[1]),oe=null,H=L.yyleng,be=L.yytext,je=L.yylineno,Te=L.yylloc;break;case 2:if(ze=this.productions_[Ne[1]][1],qe.$=re[re.length-ze],qe._$={first_line:Q[Q.length-(ze||1)].first_line,last_line:Q[Q.length-1].last_line,first_column:Q[Q.length-(ze||1)].first_column,last_column:Q[Q.length-1].last_column},De&&(qe._$.range=[Q[Q.length-(ze||1)].range[0],Q[Q.length-1].range[1]]),Ie=this.performAction.apply(qe,[be,H,je,J.yy,Ne[1],re,Q].concat(F)),typeof Ie<"u")return Ie;ze&&(ee=ee.slice(0,-1*ze*2),re=re.slice(0,-1*ze),Q=Q.slice(0,-1*ze)),ee.push(this.productions_[Ne[1]][0]),re.push(qe.$),Q.push(qe._$),vt=ne[ee[ee.length-2]][ee[ee.length-1]],ee.push(vt);break;case 3:return!0}}return!0}};Z.parseError=function(B,Y){var ae=B.split(`
|
|
26
|
-
`);throw ae[0]="Query Error: unexpected character in filter at char "+(Y.loc.first_column+1),new Error(ae.join(`
|
|
27
|
-
`))};var X=(function(){var B={EOF:1,parseError:function(ae,ee){if(this.yy.parser)this.yy.parser.parseError(ae,ee);else throw new Error(ae)},setInput:function(Y,ae){return this.yy=ae||this.yy||{},this._input=Y,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var Y=this._input[0];this.yytext+=Y,this.yyleng++,this.offset++,this.match+=Y,this.matched+=Y;var ae=Y.match(/(?:\r\n?|\n).*/g);return ae?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Y},unput:function(Y){var ae=Y.length,ee=Y.split(/(?:\r\n?|\n)/g);this._input=Y+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-ae),this.offset-=ae;var re=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),ee.length-1&&(this.yylineno-=ee.length-1);var Q=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:ee?(ee.length===re.length?this.yylloc.first_column:0)+re[re.length-ee.length].length-ee[0].length:this.yylloc.first_column-ae},this.options.ranges&&(this.yylloc.range=[Q[0],Q[0]+this.yyleng-ae]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
28
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(Y){this.unput(this.match.slice(Y))},pastInput:function(){var Y=this.matched.substr(0,this.matched.length-this.match.length);return(Y.length>20?"...":"")+Y.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var Y=this.match;return Y.length<20&&(Y+=this._input.substr(0,20-Y.length)),(Y.substr(0,20)+(Y.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var Y=this.pastInput(),ae=new Array(Y.length+1).join("-");return Y+this.upcomingInput()+`
|
|
29
|
-
`+ae+"^"},test_match:function(Y,ae){var ee,re,Q;if(this.options.backtrack_lexer&&(Q={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(Q.yylloc.range=this.yylloc.range.slice(0))),re=Y[0].match(/(?:\r\n?|\n).*/g),re&&(this.yylineno+=re.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:re?re[re.length-1].length-re[re.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Y[0].length},this.yytext+=Y[0],this.match+=Y[0],this.matches=Y,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(Y[0].length),this.matched+=Y[0],ee=this.performAction.call(this,this.yy,this,ae,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),ee)return ee;if(this._backtrack){for(var ne in Q)this[ne]=Q[ne];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Y,ae,ee,re;this._more||(this.yytext="",this.match="");for(var Q=this._currentRules(),ne=0;ne<Q.length;ne++)if(ee=this._input.match(this.rules[Q[ne]]),ee&&(!ae||ee[0].length>ae[0].length)){if(ae=ee,re=ne,this.options.backtrack_lexer){if(Y=this.test_match(ee,Q[ne]),Y!==!1)return Y;if(this._backtrack){ae=!1;continue}else return!1}else if(!this.options.flex)break}return ae?(Y=this.test_match(ae,Q[re]),Y!==!1?Y:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
30
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var ae=this.next();return ae||this.lex()},begin:function(ae){this.conditionStack.push(ae)},popState:function(){var ae=this.conditionStack.length-1;return ae>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(ae){return ae=this.conditionStack.length-1-Math.abs(ae||0),ae>=0?this.conditionStack[ae]:"INITIAL"},pushState:function(ae){this.begin(ae)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(ae,ee,re,Q){switch(re){case 0:break;case 1:return 21;case 2:return 22;case 3:return 23;case 4:return 13;case 5:return 24;case 6:return 16;case 7:return 18;case 8:return this.pushState("reldate"),25;case 9:return 32;case 10:return 31;case 11:return 27;case 12:return this.popState(),28;case 13:return 29;case 14:return 30;case 15:return 9;case 16:return 10;case 17:return 6;case 18:return 8;case 19:return 14;case 20:return 38;case 21:return 39;case 22:return 36;case 23:return 37;case 24:return 34;case 25:return 35;case 26:return 33;case 27:return 29}},rules:[/^(?:\s+)/,/^(?:(?:null|NULL|Null)(?!(\\(['"\+\,\(\)\>\<=\[\]\~\^\$])|([^\s'"\+\,\(\)\>\<=\[\]\~]))+))/,/^(?:(?:true|TRUE|True)(?!(\\(['"\+\,\(\)\>\<=\[\]\~\^\$])|([^\s'"\+\,\(\)\>\<=\[\]\~]))+))/,/^(?:(?:false|FALSE|False)(?!(\\(['"\+\,\(\)\>\<=\[\]\~\^\$])|([^\s'"\+\,\(\)\>\<=\[\]\~]))+))/,/^(?:[a-zA-Z_][a-zA-Z0-9_\.]*[:])/,/^(?:[0-9]+(\.[0-9]+)?\b(?![\-]))/,/^(?:\[)/,/^(?:\])/,/^(?:now(?=[-+]\d+[dwMyhms](?:([\+\,\(\)\[\]])|$)))/,/^(?:-)/,/^(?:\+)/,/^(?:\d+)/,/^(?:[dwMyhms])/,/^(?:([^\s'"\+\,\(\)\>\<=\[\]\~\-])(\\(['"\+\,\(\)\>\<=\[\]\~\^\$])|([^\s'"\+\,\(\)\>\<=\[\]\~]))+)/,/^(?:['](\\['"]|[^'"])+?['])/,/^(?:\()/,/^(?:\))/,/^(?:,)/,/^(?:\+)/,/^(?:-)/,/^(?:>=)/,/^(?:<=)/,/^(?:>)/,/^(?:<)/,/^(?:~\^)/,/^(?:~\$)/,/^(?:~)/,/^(?:([a-zA-Z])(?![a-zA-Z'"\,\(\)\>\<=\[\]\~]))/],conditions:{reldate:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27],inclusive:!0},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27],inclusive:!0}}};return B.parseError=function(Y,ae){var ee=Y.split(`
|
|
31
|
-
`),re,Q;throw re=ee[2].indexOf("^"),Q=ee[1].charAt(re),ee[0]='Query Error: unrecognized text "'+Q+'" in filter at char '+(re+1),Error(ee.join(`
|
|
32
|
-
`))},B})();Z.lexer=X;function q(){this.yy={}}return q.prototype=Z,Z.Parser=q,new q})();typeof I2<"u"&&(n.parser=a,n.Parser=a.Parser,n.parse=function(){return a.parse.apply(a,arguments)},n.main=function(c){c[1]||(console.log("Usage: "+c[0]+" FILE"),process.exit(1));var m=im.readFileSync(im.normalize(c[1]),"utf8");return n.parser.parse(m)},require.main===e&&n.main(process.argv.slice(1)))})(Pi,Pi.exports)),Pi.exports}var hu={},mu={},gu,cm;function ox(){return cm||(cm=1,gu=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var n={},a=Symbol("test"),o=Object(a);if(typeof a=="string"||Object.prototype.toString.call(a)!=="[object Symbol]"||Object.prototype.toString.call(o)!=="[object Symbol]")return!1;var c=42;n[a]=c;for(var m in n)return!1;if(typeof Object.keys=="function"&&Object.keys(n).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(n).length!==0)return!1;var y=Object.getOwnPropertySymbols(n);if(y.length!==1||y[0]!==a||!Object.prototype.propertyIsEnumerable.call(n,a))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var h=Object.getOwnPropertyDescriptor(n,a);if(h.value!==c||h.enumerable!==!0)return!1}return!0}),gu}var xu,um;function ol(){if(um)return xu;um=1;var e=ox();return xu=function(){return e()&&!!Symbol.toStringTag},xu}var bu,fm;function ix(){return fm||(fm=1,bu=Object),bu}var vu,dm;function Zj(){return dm||(dm=1,vu=Error),vu}var wu,pm;function Vj(){return pm||(pm=1,wu=EvalError),wu}var yu,hm;function Qj(){return hm||(hm=1,yu=RangeError),yu}var _u,mm;function Jj(){return mm||(mm=1,_u=ReferenceError),_u}var ku,gm;function lx(){return gm||(gm=1,ku=SyntaxError),ku}var Mu,xm;function oo(){return xm||(xm=1,Mu=TypeError),Mu}var ju,bm;function e5(){return bm||(bm=1,ju=URIError),ju}var Eu,vm;function t5(){return vm||(vm=1,Eu=Math.abs),Eu}var Tu,wm;function r5(){return wm||(wm=1,Tu=Math.floor),Tu}var Su,ym;function n5(){return ym||(ym=1,Su=Math.max),Su}var Nu,_m;function s5(){return _m||(_m=1,Nu=Math.min),Nu}var Au,km;function a5(){return km||(km=1,Au=Math.pow),Au}var Iu,Mm;function o5(){return Mm||(Mm=1,Iu=Math.round),Iu}var Cu,jm;function i5(){return jm||(jm=1,Cu=Number.isNaN||function(n){return n!==n}),Cu}var Du,Em;function l5(){if(Em)return Du;Em=1;var e=i5();return Du=function(a){return e(a)||a===0?a:a<0?-1:1},Du}var Ru,Tm;function c5(){return Tm||(Tm=1,Ru=Object.getOwnPropertyDescriptor),Ru}var Ou,Sm;function Js(){if(Sm)return Ou;Sm=1;var e=c5();if(e)try{e([],"length")}catch{e=null}return Ou=e,Ou}var $u,Nm;function il(){if(Nm)return $u;Nm=1;var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return $u=e,$u}var Lu,Am;function u5(){if(Am)return Lu;Am=1;var e=typeof Symbol<"u"&&Symbol,n=ox();return Lu=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:n()},Lu}var Pu,Im;function cx(){return Im||(Im=1,Pu=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Pu}var Fu,Cm;function ux(){if(Cm)return Fu;Cm=1;var e=ix();return Fu=e.getPrototypeOf||null,Fu}var Uu,Dm;function f5(){if(Dm)return Uu;Dm=1;var e="Function.prototype.bind called on incompatible ",n=Object.prototype.toString,a=Math.max,o="[object Function]",c=function(l,f){for(var u=[],p=0;p<l.length;p+=1)u[p]=l[p];for(var x=0;x<f.length;x+=1)u[x+l.length]=f[x];return u},m=function(l,f){for(var u=[],p=f,x=0;p<l.length;p+=1,x+=1)u[x]=l[p];return u},y=function(h,l){for(var f="",u=0;u<h.length;u+=1)f+=h[u],u+1<h.length&&(f+=l);return f};return Uu=function(l){var f=this;if(typeof f!="function"||n.apply(f)!==o)throw new TypeError(e+f);for(var u=m(arguments,1),p,x=function(){if(this instanceof p){var T=f.apply(this,c(u,arguments));return Object(T)===T?T:this}return f.apply(l,c(u,arguments))},v=a(0,f.length-u.length),_=[],k=0;k<v;k++)_[k]="$"+k;if(p=Function("binder","return function ("+y(_,",")+"){ return binder.apply(this,arguments); }")(x),f.prototype){var M=function(){};M.prototype=f.prototype,p.prototype=new M,M.prototype=null}return p},Uu}var zu,Rm;function io(){if(Rm)return zu;Rm=1;var e=f5();return zu=Function.prototype.bind||e,zu}var Hu,Om;function md(){return Om||(Om=1,Hu=Function.prototype.call),Hu}var Bu,$m;function gd(){return $m||($m=1,Bu=Function.prototype.apply),Bu}var Wu,Lm;function d5(){return Lm||(Lm=1,Wu=typeof Reflect<"u"&&Reflect&&Reflect.apply),Wu}var qu,Pm;function fx(){if(Pm)return qu;Pm=1;var e=io(),n=gd(),a=md(),o=d5();return qu=o||e.call(a,n),qu}var Yu,Fm;function xd(){if(Fm)return Yu;Fm=1;var e=io(),n=oo(),a=md(),o=fx();return Yu=function(m){if(m.length<1||typeof m[0]!="function")throw new n("a function is required");return o(e,a,m)},Yu}var Gu,Um;function p5(){if(Um)return Gu;Um=1;var e=xd(),n=Js(),a;try{a=[].__proto__===Array.prototype}catch(y){if(!y||typeof y!="object"||!("code"in y)||y.code!=="ERR_PROTO_ACCESS")throw y}var o=!!a&&n&&n(Object.prototype,"__proto__"),c=Object,m=c.getPrototypeOf;return Gu=o&&typeof o.get=="function"?e([o.get]):typeof m=="function"?function(h){return m(h==null?h:c(h))}:!1,Gu}var Xu,zm;function bd(){if(zm)return Xu;zm=1;var e=cx(),n=ux(),a=p5();return Xu=e?function(c){return e(c)}:n?function(c){if(!c||typeof c!="object"&&typeof c!="function")throw new TypeError("getProto: not an object");return n(c)}:a?function(c){return a(c)}:null,Xu}var Ku,Hm;function dx(){if(Hm)return Ku;Hm=1;var e=Function.prototype.call,n=Object.prototype.hasOwnProperty,a=io();return Ku=a.call(e,n),Ku}var Zu,Bm;function vd(){if(Bm)return Zu;Bm=1;var e,n=ix(),a=Zj(),o=Vj(),c=Qj(),m=Jj(),y=lx(),h=oo(),l=e5(),f=t5(),u=r5(),p=n5(),x=s5(),v=a5(),_=o5(),k=l5(),M=Function,T=function(Me){try{return M('"use strict"; return ('+Me+").constructor;")()}catch{}},A=Js(),C=il(),O=function(){throw new h},$=A?(function(){try{return arguments.callee,O}catch{try{return A(arguments,"callee").get}catch{return O}}})():O,W=u5()(),R=bd(),Z=ux(),X=cx(),q=gd(),B=md(),Y={},ae=typeof Uint8Array>"u"||!R?e:R(Uint8Array),ee={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":W&&R?R([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":Y,"%AsyncGenerator%":Y,"%AsyncGeneratorFunction%":Y,"%AsyncIteratorPrototype%":Y,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":a,"%eval%":eval,"%EvalError%":o,"%Float16Array%":typeof Float16Array>"u"?e:Float16Array,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":M,"%GeneratorFunction%":Y,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":W&&R?R(R([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!W||!R?e:R(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":n,"%Object.getOwnPropertyDescriptor%":A,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":c,"%ReferenceError%":m,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!W||!R?e:R(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":W&&R?R(""[Symbol.iterator]()):e,"%Symbol%":W?Symbol:e,"%SyntaxError%":y,"%ThrowTypeError%":$,"%TypedArray%":ae,"%TypeError%":h,"%Uint8Array%":typeof Uint8Array>"u"?e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?e:Uint32Array,"%URIError%":l,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet,"%Function.prototype.call%":B,"%Function.prototype.apply%":q,"%Object.defineProperty%":C,"%Object.getPrototypeOf%":Z,"%Math.abs%":f,"%Math.floor%":u,"%Math.max%":p,"%Math.min%":x,"%Math.pow%":v,"%Math.round%":_,"%Math.sign%":k,"%Reflect.getPrototypeOf%":X};if(R)try{null.error}catch(Me){var re=R(R(Me));ee["%Error.prototype%"]=re}var Q=function Me(oe){var Ee;if(oe==="%AsyncFunction%")Ee=T("async function () {}");else if(oe==="%GeneratorFunction%")Ee=T("function* () {}");else if(oe==="%AsyncGeneratorFunction%")Ee=T("async function* () {}");else if(oe==="%AsyncGenerator%"){var Ne=Me("%AsyncGeneratorFunction%");Ne&&(Ee=Ne.prototype)}else if(oe==="%AsyncIteratorPrototype%"){var Ie=Me("%AsyncGenerator%");Ie&&R&&(Ee=R(Ie.prototype))}return ee[oe]=Ee,Ee},ne={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},be=io(),je=dx(),H=be.call(B,Array.prototype.concat),he=be.call(q,Array.prototype.splice),ge=be.call(B,String.prototype.replace),F=be.call(B,String.prototype.slice),L=be.call(B,RegExp.prototype.exec),J=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,xe=/\\(\\)?/g,Te=function(oe){var Ee=F(oe,0,1),Ne=F(oe,-1);if(Ee==="%"&&Ne!=="%")throw new y("invalid intrinsic syntax, expected closing `%`");if(Ne==="%"&&Ee!=="%")throw new y("invalid intrinsic syntax, expected opening `%`");var Ie=[];return ge(oe,J,function(qe,nt,ze,vt){Ie[Ie.length]=ze?ge(vt,xe,"$1"):nt||qe}),Ie},De=function(oe,Ee){var Ne=oe,Ie;if(je(ne,Ne)&&(Ie=ne[Ne],Ne="%"+Ie[0]+"%"),je(ee,Ne)){var qe=ee[Ne];if(qe===Y&&(qe=Q(Ne)),typeof qe>"u"&&!Ee)throw new h("intrinsic "+oe+" exists, but is not available. Please file an issue!");return{alias:Ie,name:Ne,value:qe}}throw new y("intrinsic "+oe+" does not exist!")};return Zu=function(oe,Ee){if(typeof oe!="string"||oe.length===0)throw new h("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof Ee!="boolean")throw new h('"allowMissing" argument must be a boolean');if(L(/^%?[^%]*%?$/,oe)===null)throw new y("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var Ne=Te(oe),Ie=Ne.length>0?Ne[0]:"",qe=De("%"+Ie+"%",Ee),nt=qe.name,ze=qe.value,vt=!1,lt=qe.alias;lt&&(Ie=lt[0],he(Ne,H([0,1],lt)));for(var le=1,Be=!0;le<Ne.length;le+=1){var Re=Ne[le],pr=F(Re,0,1),hr=F(Re,-1);if((pr==='"'||pr==="'"||pr==="`"||hr==='"'||hr==="'"||hr==="`")&&pr!==hr)throw new y("property names with quotes must have matching quotes");if((Re==="constructor"||!Be)&&(vt=!0),Ie+="."+Re,nt="%"+Ie+"%",je(ee,nt))ze=ee[nt];else if(ze!=null){if(!(Re in ze)){if(!Ee)throw new h("base intrinsic for "+oe+" exists, but the property is not available.");return}if(A&&le+1>=Ne.length){var kt=A(ze,Re);Be=!!kt,Be&&"get"in kt&&!("originalValue"in kt.get)?ze=kt.get:ze=ze[Re]}else Be=je(ze,Re),ze=ze[Re];Be&&!vt&&(ee[nt]=ze)}}return ze},Zu}var Vu={exports:{}},Qu,Wm;function h5(){if(Wm)return Qu;Wm=1;var e=il(),n=lx(),a=oo(),o=Js();return Qu=function(m,y,h){if(!m||typeof m!="object"&&typeof m!="function")throw new a("`obj` must be an object or a function`");if(typeof y!="string"&&typeof y!="symbol")throw new a("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new a("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new a("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new a("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new a("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,f=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,p=arguments.length>6?arguments[6]:!1,x=!!o&&o(m,y);if(e)e(m,y,{configurable:u===null&&x?x.configurable:!u,enumerable:l===null&&x?x.enumerable:!l,value:h,writable:f===null&&x?x.writable:!f});else if(p||!l&&!f&&!u)m[y]=h;else throw new n("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Qu}var Ju,qm;function m5(){if(qm)return Ju;qm=1;var e=il(),n=function(){return!!e};return n.hasArrayLengthDefineBug=function(){if(!e)return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},Ju=n,Ju}var ef,Ym;function g5(){if(Ym)return ef;Ym=1;var e=vd(),n=h5(),a=m5()(),o=Js(),c=oo(),m=e("%Math.floor%");return ef=function(h,l){if(typeof h!="function")throw new c("`fn` is not a function");if(typeof l!="number"||l<0||l>4294967295||m(l)!==l)throw new c("`length` must be a positive 32-bit integer");var f=arguments.length>2&&!!arguments[2],u=!0,p=!0;if("length"in h&&o){var x=o(h,"length");x&&!x.configurable&&(u=!1),x&&!x.writable&&(p=!1)}return(u||p||!f)&&(a?n(h,"length",l,!0,!0):n(h,"length",l)),h},ef}var tf,Gm;function x5(){if(Gm)return tf;Gm=1;var e=io(),n=gd(),a=fx();return tf=function(){return a(e,n,arguments)},tf}var Xm;function px(){return Xm||(Xm=1,(function(e){var n=g5(),a=il(),o=xd(),c=x5();e.exports=function(y){var h=o(arguments),l=y.length-(arguments.length-1);return n(h,1+(l>0?l:0),!0)},a?a(e.exports,"apply",{value:c}):e.exports.apply=c})(Vu)),Vu.exports}var rf,Km;function b5(){if(Km)return rf;Km=1;var e=vd(),n=px(),a=n(e("String.prototype.indexOf"));return rf=function(c,m){var y=e(c,!!m);return typeof y=="function"&&a(c,".prototype.")>-1?n(y):y},rf}var nf,Zm;function v5(){if(Zm)return nf;Zm=1;var e=ol()(),n=b5(),a=n("Object.prototype.toString"),o=function(h){return e&&h&&typeof h=="object"&&Symbol.toStringTag in h?!1:a(h)==="[object Arguments]"},c=function(h){return o(h)?!0:h!==null&&typeof h=="object"&&typeof h.length=="number"&&h.length>=0&&a(h)!=="[object Array]"&&a(h.callee)==="[object Function]"},m=(function(){return o(arguments)})();return o.isLegacyArguments=c,nf=m?o:c,nf}var sf,Vm;function ll(){if(Vm)return sf;Vm=1;var e=vd(),n=xd(),a=n([e("%String.prototype.indexOf%")]);return sf=function(c,m){var y=e(c,!!m);return typeof y=="function"&&a(c,".prototype.")>-1?n([y]):y},sf}var af,Qm;function w5(){if(Qm)return af;Qm=1;var e=ll(),n=ol()(),a=dx(),o=Js(),c;if(n){var m=e("RegExp.prototype.exec"),y={},h=function(){throw y},l={toString:h,valueOf:h};typeof Symbol.toPrimitive=="symbol"&&(l[Symbol.toPrimitive]=h),c=function(x){if(!x||typeof x!="object")return!1;var v=o(x,"lastIndex"),_=v&&a(v,"value");if(!_)return!1;try{m(x,l)}catch(k){return k===y}}}else{var f=e("Object.prototype.toString"),u="[object RegExp]";c=function(x){return!x||typeof x!="object"&&typeof x!="function"?!1:f(x)===u}}return af=c,af}var of,Jm;function y5(){if(Jm)return of;Jm=1;var e=ll(),n=w5(),a=e("RegExp.prototype.exec"),o=oo();return of=function(m){if(!n(m))throw new o("`regex` must be a RegExp");return function(h){return a(m,h)!==null}},of}var lf,eg;function _5(){if(eg)return lf;eg=1;var e=ll(),n=y5(),a=n(/^\s*(?:function)?\*/),o=ol()(),c=bd(),m=e("Object.prototype.toString"),y=e("Function.prototype.toString"),h=function(){if(!o)return!1;try{return Function("return function*() {}")()}catch{}},l;return lf=function(u){if(typeof u!="function")return!1;if(a(y(u)))return!0;if(!o){var p=m(u);return p==="[object GeneratorFunction]"}if(!c)return!1;if(typeof l>"u"){var x=h();l=x?c(x):!1}return c(u)===l},lf}var cf,tg;function k5(){if(tg)return cf;tg=1;var e=Function.prototype.toString,n=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,a,o;if(typeof n=="function"&&typeof Object.defineProperty=="function")try{a=Object.defineProperty({},"length",{get:function(){throw o}}),o={},n(function(){throw 42},null,a)}catch(A){A!==o&&(n=null)}else n=null;var c=/^\s*class\b/,m=function(C){try{var O=e.call(C);return c.test(O)}catch{return!1}},y=function(C){try{return m(C)?!1:(e.call(C),!0)}catch{return!1}},h=Object.prototype.toString,l="[object Object]",f="[object Function]",u="[object GeneratorFunction]",p="[object HTMLAllCollection]",x="[object HTML document.all class]",v="[object HTMLCollection]",_=typeof Symbol=="function"&&!!Symbol.toStringTag,k=!(0 in[,]),M=function(){return!1};if(typeof document=="object"){var T=document.all;h.call(T)===h.call(document.all)&&(M=function(C){if((k||!C)&&(typeof C>"u"||typeof C=="object"))try{var O=h.call(C);return(O===p||O===x||O===v||O===l)&&C("")==null}catch{}return!1})}return cf=n?function(C){if(M(C))return!0;if(!C||typeof C!="function"&&typeof C!="object")return!1;try{n(C,null,a)}catch(O){if(O!==o)return!1}return!m(C)&&y(C)}:function(C){if(M(C))return!0;if(!C||typeof C!="function"&&typeof C!="object")return!1;if(_)return y(C);if(m(C))return!1;var O=h.call(C);return O!==f&&O!==u&&!/^\[object HTML/.test(O)?!1:y(C)},cf}var uf,rg;function M5(){if(rg)return uf;rg=1;var e=k5(),n=Object.prototype.toString,a=Object.prototype.hasOwnProperty,o=function(l,f,u){for(var p=0,x=l.length;p<x;p++)a.call(l,p)&&(u==null?f(l[p],p,l):f.call(u,l[p],p,l))},c=function(l,f,u){for(var p=0,x=l.length;p<x;p++)u==null?f(l.charAt(p),p,l):f.call(u,l.charAt(p),p,l)},m=function(l,f,u){for(var p in l)a.call(l,p)&&(u==null?f(l[p],p,l):f.call(u,l[p],p,l))};function y(h){return n.call(h)==="[object Array]"}return uf=function(l,f,u){if(!e(f))throw new TypeError("iterator must be a function");var p;arguments.length>=3&&(p=u),y(l)?o(l,f,p):typeof l=="string"?c(l,f,p):m(l,f,p)},uf}var ff,ng;function j5(){return ng||(ng=1,ff=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),ff}var df,sg;function E5(){if(sg)return df;sg=1;var e=j5(),n=typeof globalThis>"u"?Hs:globalThis;return df=function(){for(var o=[],c=0;c<e.length;c++)typeof n[e[c]]=="function"&&(o[o.length]=e[c]);return o},df}var pf,ag;function hx(){if(ag)return pf;ag=1;var e=M5(),n=E5(),a=px(),o=ll(),c=Js(),m=bd(),y=o("Object.prototype.toString"),h=ol()(),l=typeof globalThis>"u"?Hs:globalThis,f=n(),u=o("String.prototype.slice"),p=o("Array.prototype.indexOf",!0)||function(M,T){for(var A=0;A<M.length;A+=1)if(M[A]===T)return A;return-1},x={__proto__:null};h&&c&&m?e(f,function(k){var M=new l[k];if(Symbol.toStringTag in M&&m){var T=m(M),A=c(T,Symbol.toStringTag);if(!A&&T){var C=m(T);A=c(C,Symbol.toStringTag)}x["$"+k]=a(A.get)}}):e(f,function(k){var M=new l[k],T=M.slice||M.set;T&&(x["$"+k]=a(T))});var v=function(M){var T=!1;return e(x,function(A,C){if(!T)try{"$"+A(M)===C&&(T=u(C,1))}catch{}}),T},_=function(M){var T=!1;return e(x,function(A,C){if(!T)try{A(M),T=u(C,1)}catch{}}),T};return pf=function(M){if(!M||typeof M!="object")return!1;if(!h){var T=u(y(M),8,-1);return p(f,T)>-1?T:T!=="Object"?!1:_(M)}return c?v(M):null},pf}var hf,og;function T5(){if(og)return hf;og=1;var e=hx();return hf=function(a){return!!e(a)},hf}var ig;function S5(){return ig||(ig=1,(function(e){var n=v5(),a=_5(),o=hx(),c=T5();function m(le){return le.call.bind(le)}var y=typeof BigInt<"u",h=typeof Symbol<"u",l=m(Object.prototype.toString),f=m(Number.prototype.valueOf),u=m(String.prototype.valueOf),p=m(Boolean.prototype.valueOf);if(y)var x=m(BigInt.prototype.valueOf);if(h)var v=m(Symbol.prototype.valueOf);function _(le,Be){if(typeof le!="object")return!1;try{return Be(le),!0}catch{return!1}}e.isArgumentsObject=n,e.isGeneratorFunction=a,e.isTypedArray=c;function k(le){return typeof Promise<"u"&&le instanceof Promise||le!==null&&typeof le=="object"&&typeof le.then=="function"&&typeof le.catch=="function"}e.isPromise=k;function M(le){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(le):c(le)||F(le)}e.isArrayBufferView=M;function T(le){return o(le)==="Uint8Array"}e.isUint8Array=T;function A(le){return o(le)==="Uint8ClampedArray"}e.isUint8ClampedArray=A;function C(le){return o(le)==="Uint16Array"}e.isUint16Array=C;function O(le){return o(le)==="Uint32Array"}e.isUint32Array=O;function $(le){return o(le)==="Int8Array"}e.isInt8Array=$;function W(le){return o(le)==="Int16Array"}e.isInt16Array=W;function R(le){return o(le)==="Int32Array"}e.isInt32Array=R;function Z(le){return o(le)==="Float32Array"}e.isFloat32Array=Z;function X(le){return o(le)==="Float64Array"}e.isFloat64Array=X;function q(le){return o(le)==="BigInt64Array"}e.isBigInt64Array=q;function B(le){return o(le)==="BigUint64Array"}e.isBigUint64Array=B;function Y(le){return l(le)==="[object Map]"}Y.working=typeof Map<"u"&&Y(new Map);function ae(le){return typeof Map>"u"?!1:Y.working?Y(le):le instanceof Map}e.isMap=ae;function ee(le){return l(le)==="[object Set]"}ee.working=typeof Set<"u"&&ee(new Set);function re(le){return typeof Set>"u"?!1:ee.working?ee(le):le instanceof Set}e.isSet=re;function Q(le){return l(le)==="[object WeakMap]"}Q.working=typeof WeakMap<"u"&&Q(new WeakMap);function ne(le){return typeof WeakMap>"u"?!1:Q.working?Q(le):le instanceof WeakMap}e.isWeakMap=ne;function be(le){return l(le)==="[object WeakSet]"}be.working=typeof WeakSet<"u"&&be(new WeakSet);function je(le){return be(le)}e.isWeakSet=je;function H(le){return l(le)==="[object ArrayBuffer]"}H.working=typeof ArrayBuffer<"u"&&H(new ArrayBuffer);function he(le){return typeof ArrayBuffer>"u"?!1:H.working?H(le):le instanceof ArrayBuffer}e.isArrayBuffer=he;function ge(le){return l(le)==="[object DataView]"}ge.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&ge(new DataView(new ArrayBuffer(1),0,1));function F(le){return typeof DataView>"u"?!1:ge.working?ge(le):le instanceof DataView}e.isDataView=F;var L=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function J(le){return l(le)==="[object SharedArrayBuffer]"}function xe(le){return typeof L>"u"?!1:(typeof J.working>"u"&&(J.working=J(new L)),J.working?J(le):le instanceof L)}e.isSharedArrayBuffer=xe;function Te(le){return l(le)==="[object AsyncFunction]"}e.isAsyncFunction=Te;function De(le){return l(le)==="[object Map Iterator]"}e.isMapIterator=De;function Me(le){return l(le)==="[object Set Iterator]"}e.isSetIterator=Me;function oe(le){return l(le)==="[object Generator]"}e.isGeneratorObject=oe;function Ee(le){return l(le)==="[object WebAssembly.Module]"}e.isWebAssemblyCompiledModule=Ee;function Ne(le){return _(le,f)}e.isNumberObject=Ne;function Ie(le){return _(le,u)}e.isStringObject=Ie;function qe(le){return _(le,p)}e.isBooleanObject=qe;function nt(le){return y&&_(le,x)}e.isBigIntObject=nt;function ze(le){return h&&_(le,v)}e.isSymbolObject=ze;function vt(le){return Ne(le)||Ie(le)||qe(le)||nt(le)||ze(le)}e.isBoxedPrimitive=vt;function lt(le){return typeof Uint8Array<"u"&&(he(le)||xe(le))}e.isAnyArrayBuffer=lt,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(le){Object.defineProperty(e,le,{enumerable:!1,value:function(){throw new Error(le+" is not supported in userland")}})})})(mu)),mu}var mf,lg;function N5(){return lg||(lg=1,mf=function(n){return n&&typeof n=="object"&&typeof n.copy=="function"&&typeof n.fill=="function"&&typeof n.readUInt8=="function"}),mf}var Fi={exports:{}},cg;function A5(){return cg||(cg=1,typeof Object.create=="function"?Fi.exports=function(n,a){a&&(n.super_=a,n.prototype=Object.create(a.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}))}:Fi.exports=function(n,a){if(a){n.super_=a;var o=function(){};o.prototype=a.prototype,n.prototype=new o,n.prototype.constructor=n}}),Fi.exports}var ug;function I5(){return ug||(ug=1,(function(e){var n={},a=Object.getOwnPropertyDescriptors||function(L){for(var J=Object.keys(L),xe={},Te=0;Te<J.length;Te++)xe[J[Te]]=Object.getOwnPropertyDescriptor(L,J[Te]);return xe},o=/%[sdj%]/g;e.format=function(F){if(!W(F)){for(var L=[],J=0;J<arguments.length;J++)L.push(h(arguments[J]));return L.join(" ")}for(var J=1,xe=arguments,Te=xe.length,De=String(F).replace(o,function(oe){if(oe==="%%")return"%";if(J>=Te)return oe;switch(oe){case"%s":return String(xe[J++]);case"%d":return Number(xe[J++]);case"%j":try{return JSON.stringify(xe[J++])}catch{return"[Circular]"}default:return oe}}),Me=xe[J];J<Te;Me=xe[++J])C(Me)||!q(Me)?De+=" "+Me:De+=" "+h(Me);return De},e.deprecate=function(F,L){if(typeof process<"u"&&process.noDeprecation===!0)return F;if(typeof process>"u")return function(){return e.deprecate(F,L).apply(this,arguments)};var J=!1;function xe(){if(!J){if(process.throwDeprecation)throw new Error(L);process.traceDeprecation?console.trace(L):console.error(L),J=!0}return F.apply(this,arguments)}return xe};var c={},m=/^$/;if(n.NODE_DEBUG){var y=n.NODE_DEBUG;y=y.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),m=new RegExp("^"+y+"$","i")}e.debuglog=function(F){if(F=F.toUpperCase(),!c[F])if(m.test(F)){var L=process.pid;c[F]=function(){var J=e.format.apply(e,arguments);console.error("%s %d: %s",F,L,J)}}else c[F]=function(){};return c[F]};function h(F,L){var J={seen:[],stylize:f};return arguments.length>=3&&(J.depth=arguments[2]),arguments.length>=4&&(J.colors=arguments[3]),A(L)?J.showHidden=L:L&&e._extend(J,L),Z(J.showHidden)&&(J.showHidden=!1),Z(J.depth)&&(J.depth=2),Z(J.colors)&&(J.colors=!1),Z(J.customInspect)&&(J.customInspect=!0),J.colors&&(J.stylize=l),p(J,F,J.depth)}e.inspect=h,h.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},h.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function l(F,L){var J=h.styles[L];return J?"\x1B["+h.colors[J][0]+"m"+F+"\x1B["+h.colors[J][1]+"m":F}function f(F,L){return F}function u(F){var L={};return F.forEach(function(J,xe){L[J]=!0}),L}function p(F,L,J){if(F.customInspect&&L&&ae(L.inspect)&&L.inspect!==e.inspect&&!(L.constructor&&L.constructor.prototype===L)){var xe=L.inspect(J,F);return W(xe)||(xe=p(F,xe,J)),xe}var Te=x(F,L);if(Te)return Te;var De=Object.keys(L),Me=u(De);if(F.showHidden&&(De=Object.getOwnPropertyNames(L)),Y(L)&&(De.indexOf("message")>=0||De.indexOf("description")>=0))return v(L);if(De.length===0){if(ae(L)){var oe=L.name?": "+L.name:"";return F.stylize("[Function"+oe+"]","special")}if(X(L))return F.stylize(RegExp.prototype.toString.call(L),"regexp");if(B(L))return F.stylize(Date.prototype.toString.call(L),"date");if(Y(L))return v(L)}var Ee="",Ne=!1,Ie=["{","}"];if(T(L)&&(Ne=!0,Ie=["[","]"]),ae(L)){var qe=L.name?": "+L.name:"";Ee=" [Function"+qe+"]"}if(X(L)&&(Ee=" "+RegExp.prototype.toString.call(L)),B(L)&&(Ee=" "+Date.prototype.toUTCString.call(L)),Y(L)&&(Ee=" "+v(L)),De.length===0&&(!Ne||L.length==0))return Ie[0]+Ee+Ie[1];if(J<0)return X(L)?F.stylize(RegExp.prototype.toString.call(L),"regexp"):F.stylize("[Object]","special");F.seen.push(L);var nt;return Ne?nt=_(F,L,J,Me,De):nt=De.map(function(ze){return k(F,L,J,Me,ze,Ne)}),F.seen.pop(),M(nt,Ee,Ie)}function x(F,L){if(Z(L))return F.stylize("undefined","undefined");if(W(L)){var J="'"+JSON.stringify(L).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return F.stylize(J,"string")}if($(L))return F.stylize(""+L,"number");if(A(L))return F.stylize(""+L,"boolean");if(C(L))return F.stylize("null","null")}function v(F){return"["+Error.prototype.toString.call(F)+"]"}function _(F,L,J,xe,Te){for(var De=[],Me=0,oe=L.length;Me<oe;++Me)je(L,String(Me))?De.push(k(F,L,J,xe,String(Me),!0)):De.push("");return Te.forEach(function(Ee){Ee.match(/^\d+$/)||De.push(k(F,L,J,xe,Ee,!0))}),De}function k(F,L,J,xe,Te,De){var Me,oe,Ee;if(Ee=Object.getOwnPropertyDescriptor(L,Te)||{value:L[Te]},Ee.get?Ee.set?oe=F.stylize("[Getter/Setter]","special"):oe=F.stylize("[Getter]","special"):Ee.set&&(oe=F.stylize("[Setter]","special")),je(xe,Te)||(Me="["+Te+"]"),oe||(F.seen.indexOf(Ee.value)<0?(C(J)?oe=p(F,Ee.value,null):oe=p(F,Ee.value,J-1),oe.indexOf(`
|
|
33
|
-
`)>-1&&(De?oe=oe.split(`
|
|
34
|
-
`).map(function(Ne){return" "+Ne}).join(`
|
|
35
|
-
`).slice(2):oe=`
|
|
36
|
-
`+oe.split(`
|
|
37
|
-
`).map(function(Ne){return" "+Ne}).join(`
|
|
38
|
-
`))):oe=F.stylize("[Circular]","special")),Z(Me)){if(De&&Te.match(/^\d+$/))return oe;Me=JSON.stringify(""+Te),Me.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(Me=Me.slice(1,-1),Me=F.stylize(Me,"name")):(Me=Me.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),Me=F.stylize(Me,"string"))}return Me+": "+oe}function M(F,L,J){var xe=F.reduce(function(Te,De){return De.indexOf(`
|
|
39
|
-
`)>=0,Te+De.replace(/\u001b\[\d\d?m/g,"").length+1},0);return xe>60?J[0]+(L===""?"":L+`
|
|
40
|
-
`)+" "+F.join(`,
|
|
41
|
-
`)+" "+J[1]:J[0]+L+" "+F.join(", ")+" "+J[1]}e.types=S5();function T(F){return Array.isArray(F)}e.isArray=T;function A(F){return typeof F=="boolean"}e.isBoolean=A;function C(F){return F===null}e.isNull=C;function O(F){return F==null}e.isNullOrUndefined=O;function $(F){return typeof F=="number"}e.isNumber=$;function W(F){return typeof F=="string"}e.isString=W;function R(F){return typeof F=="symbol"}e.isSymbol=R;function Z(F){return F===void 0}e.isUndefined=Z;function X(F){return q(F)&&re(F)==="[object RegExp]"}e.isRegExp=X,e.types.isRegExp=X;function q(F){return typeof F=="object"&&F!==null}e.isObject=q;function B(F){return q(F)&&re(F)==="[object Date]"}e.isDate=B,e.types.isDate=B;function Y(F){return q(F)&&(re(F)==="[object Error]"||F instanceof Error)}e.isError=Y,e.types.isNativeError=Y;function ae(F){return typeof F=="function"}e.isFunction=ae;function ee(F){return F===null||typeof F=="boolean"||typeof F=="number"||typeof F=="string"||typeof F=="symbol"||typeof F>"u"}e.isPrimitive=ee,e.isBuffer=N5();function re(F){return Object.prototype.toString.call(F)}function Q(F){return F<10?"0"+F.toString(10):F.toString(10)}var ne=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function be(){var F=new Date,L=[Q(F.getHours()),Q(F.getMinutes()),Q(F.getSeconds())].join(":");return[F.getDate(),ne[F.getMonth()],L].join(" ")}e.log=function(){console.log("%s - %s",be(),e.format.apply(e,arguments))},e.inherits=A5(),e._extend=function(F,L){if(!L||!q(L))return F;for(var J=Object.keys(L),xe=J.length;xe--;)F[J[xe]]=L[J[xe]];return F};function je(F,L){return Object.prototype.hasOwnProperty.call(F,L)}var H=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;e.promisify=function(L){if(typeof L!="function")throw new TypeError('The "original" argument must be of type Function');if(H&&L[H]){var J=L[H];if(typeof J!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(J,H,{value:J,enumerable:!1,writable:!1,configurable:!0}),J}function J(){for(var xe,Te,De=new Promise(function(Ee,Ne){xe=Ee,Te=Ne}),Me=[],oe=0;oe<arguments.length;oe++)Me.push(arguments[oe]);Me.push(function(Ee,Ne){Ee?Te(Ee):xe(Ne)});try{L.apply(this,Me)}catch(Ee){Te(Ee)}return De}return Object.setPrototypeOf(J,Object.getPrototypeOf(L)),H&&Object.defineProperty(J,H,{value:J,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(J,a(L))},e.promisify.custom=H;function he(F,L){if(!F){var J=new Error("Promise was rejected with a falsy value");J.reason=F,F=J}return L(F)}function ge(F){if(typeof F!="function")throw new TypeError('The "original" argument must be of type Function');function L(){for(var J=[],xe=0;xe<arguments.length;xe++)J.push(arguments[xe]);var Te=J.pop();if(typeof Te!="function")throw new TypeError("The last argument must be of type Function");var De=this,Me=function(){return Te.apply(De,arguments)};F.apply(this,J).then(function(oe){process.nextTick(Me.bind(null,null,oe))},function(oe){process.nextTick(he.bind(null,oe,Me))})}return Object.setPrototypeOf(L,Object.getPrototypeOf(F)),Object.defineProperties(L,a(F)),L}e.callbackify=ge})(hu)),hu}function Ht(e){if(e===null||e===!0||e===!1)return NaN;var n=Number(e);return isNaN(n)?n:n<0?Math.ceil(n):Math.floor(n)}function is(e,n){if(n.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+n.length+" present")}function wd(e){is(1,arguments);var n=Object.prototype.toString.call(e);return e instanceof Date||rd(e)==="object"&&n==="[object Date]"?new Date(e.getTime()):typeof e=="number"||n==="[object Number]"?new Date(e):((typeof e=="string"||n==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function mx(e,n){is(2,arguments);var a=wd(e),o=Ht(n);return isNaN(o)?new Date(NaN):(o&&a.setDate(a.getDate()+o),a)}function gx(e,n){is(2,arguments);var a=wd(e),o=Ht(n);if(isNaN(o))return new Date(NaN);if(!o)return a;var c=a.getDate(),m=new Date(a.getTime());m.setMonth(a.getMonth()+o+1,0);var y=m.getDate();return c>=y?m:(a.setFullYear(m.getFullYear(),m.getMonth(),c),a)}function C5(e,n){if(is(2,arguments),!n||rd(n)!=="object")return new Date(NaN);var a=n.years?Ht(n.years):0,o=n.months?Ht(n.months):0,c=n.weeks?Ht(n.weeks):0,m=n.days?Ht(n.days):0,y=n.hours?Ht(n.hours):0,h=n.minutes?Ht(n.minutes):0,l=n.seconds?Ht(n.seconds):0,f=wd(e),u=o||a?gx(f,o+a*12):f,p=m||c?mx(u,m+c*7):u,x=h+y*60,v=l+x*60,_=v*1e3,k=new Date(p.getTime()+_);return k}const D5=Object.freeze(Object.defineProperty({__proto__:null,default:C5},Symbol.toStringTag,{value:"Module"})),R5=Zf(D5);function O5(e,n){is(2,arguments);var a=Ht(n);return mx(e,-a)}function $5(e,n){is(2,arguments);var a=Ht(n);return gx(e,-a)}function L5(e,n){if(is(2,arguments),!n||rd(n)!=="object")return new Date(NaN);var a=n.years?Ht(n.years):0,o=n.months?Ht(n.months):0,c=n.weeks?Ht(n.weeks):0,m=n.days?Ht(n.days):0,y=n.hours?Ht(n.hours):0,h=n.minutes?Ht(n.minutes):0,l=n.seconds?Ht(n.seconds):0,f=$5(e,o+a*12),u=O5(f,m+c*7),p=h+y*60,x=l+p*60,v=x*1e3,_=new Date(u.getTime()-v);return _}const P5=Object.freeze(Object.defineProperty({__proto__:null,default:L5},Symbol.toStringTag,{value:"Module"})),F5=Zf(P5);var gf,fg;function U5(){if(fg)return gf;fg=1,I5();const a={add:R5,sub:F5},o={d:"days",w:"weeks",M:"months",y:"years",h:"hours",m:"minutes",s:"seconds"},c=m=>m.toISOString().replace("T"," ").replace(/\.[0-9]{3}Z/,"");return gf={ungroup(m){return m.yg?m.yg:m},unescape(m){const y=new RegExp(`\\\\(['"])`,"g");return m.replace(y,"$1")},stringToRegExp(m,y){let h=m.replace(/[.*+?^$(){}|[\]\\]/g,"\\$&");return y==="^"?h="^"+h:y==="$"&&(h=h+"$"),new RegExp(h,"i")},relDateToAbsolute(m,y,h){const l=new Date,f=a[m](l,{[o[h]]:y});return c(f)},debug(){}},gf}var dg;function z5(){if(dg)return Li;dg=1;const e=Kj().parser;return e.yy=U5(),Li.lex=n=>{e.lexer.setInput(n);let a=e.lexer.lex();const o=[];for(;a!==e.lexer.EOF;)o.push({token:e.terminals_[a],matched:e.lexer.match}),a=e.lexer.lex();return o},Li.parse=(n,a)=>e.parse(n,a||{}),Li}var xf,pg;function xx(){return pg||(pg=1,xf=z5()),xf}var Ga={exports:{}};/**
|
|
42
|
-
* @license
|
|
43
|
-
* Lodash <https://lodash.com/>
|
|
44
|
-
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
45
|
-
* Released under MIT license <https://lodash.com/license>
|
|
46
|
-
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
47
|
-
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
48
|
-
*/var H5=Ga.exports,hg;function yd(){return hg||(hg=1,(function(e,n){(function(){var a,o="4.17.21",c=200,m="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",y="Expected a function",h="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",f=500,u="__lodash_placeholder__",p=1,x=2,v=4,_=1,k=2,M=1,T=2,A=4,C=8,O=16,$=32,W=64,R=128,Z=256,X=512,q=30,B="...",Y=800,ae=16,ee=1,re=2,Q=3,ne=1/0,be=9007199254740991,je=17976931348623157e292,H=NaN,he=4294967295,ge=he-1,F=he>>>1,L=[["ary",R],["bind",M],["bindKey",T],["curry",C],["curryRight",O],["flip",X],["partial",$],["partialRight",W],["rearg",Z]],J="[object Arguments]",xe="[object Array]",Te="[object AsyncFunction]",De="[object Boolean]",Me="[object Date]",oe="[object DOMException]",Ee="[object Error]",Ne="[object Function]",Ie="[object GeneratorFunction]",qe="[object Map]",nt="[object Number]",ze="[object Null]",vt="[object Object]",lt="[object Promise]",le="[object Proxy]",Be="[object RegExp]",Re="[object Set]",pr="[object String]",hr="[object Symbol]",kt="[object Undefined]",Ar="[object WeakMap]",ul="[object WeakSet]",pn="[object ArrayBuffer]",hn="[object DataView]",Pr="[object Float32Array]",Ln="[object Float64Array]",Fr="[object Int8Array]",Mr="[object Int16Array]",Pn="[object Int32Array]",ls="[object Uint8Array]",cs="[object Uint8ClampedArray]",Gt="[object Uint16Array]",ea="[object Uint32Array]",fl=/\b__p \+= '';/g,ta=/\b(__p \+=) '' \+/g,mr=/(__e\(.*?\)|\b__t\)) \+\n'';/g,mn=/&(?:amp|lt|gt|quot|#39);/g,us=/[&<>"']/g,ra=RegExp(mn.source),na=RegExp(us.source),sa=/<%-([\s\S]+?)%>/g,aa=/<%([\s\S]+?)%>/g,oa=/<%=([\s\S]+?)%>/g,ia=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,lo=/^\w*$/,dl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,fs=/[\\^$.*+?()[\]{}|]/g,co=RegExp(fs.source),la=/^\s+/,uo=/\s/,fo=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,po=/\{\n\/\* \[wrapped with (.+)\] \*/,ho=/,? & /,gn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ca=/[()=,{}\[\]\/\s]/,ds=/\\(\\)?/g,pe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ps=/\w*$/,pl=/^[-+]0x[0-9a-f]+$/i,hl=/^0b[01]+$/i,ml=/^\[object .+?Constructor\]$/,gl=/^0o[0-7]+$/i,xl=/^(?:0|[1-9]\d*)$/,bl=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,hs=/($^)/,vl=/['\n\r\u2028\u2029\\]/g,ms="\\ud800-\\udfff",wl="\\u0300-\\u036f",yl="\\ufe20-\\ufe2f",_l="\\u20d0-\\u20ff",mo=wl+yl+_l,go="\\u2700-\\u27bf",xo="a-z\\xdf-\\xf6\\xf8-\\xff",kl="\\xac\\xb1\\xd7\\xf7",bo="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ml="\\u2000-\\u206f",jl=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",vo="A-Z\\xc0-\\xd6\\xd8-\\xde",wo="\\ufe0e\\ufe0f",yo=kl+bo+Ml+jl,ua="['’]",El="["+ms+"]",_o="["+yo+"]",gs="["+mo+"]",ko="\\d+",Tl="["+go+"]",Mo="["+xo+"]",jo="[^"+ms+yo+ko+go+xo+vo+"]",fa="\\ud83c[\\udffb-\\udfff]",Sl="(?:"+gs+"|"+fa+")",Eo="[^"+ms+"]",da="(?:\\ud83c[\\udde6-\\uddff]){2}",pa="[\\ud800-\\udbff][\\udc00-\\udfff]",xn="["+vo+"]",Vt="\\u200d",ha="(?:"+Mo+"|"+jo+")",ma="(?:"+xn+"|"+jo+")",To="(?:"+ua+"(?:d|ll|m|re|s|t|ve))?",xs="(?:"+ua+"(?:D|LL|M|RE|S|T|VE))?",ga=Sl+"?",xa="["+wo+"]?",So="(?:"+Vt+"(?:"+[Eo,da,pa].join("|")+")"+xa+ga+")*",No="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Nl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",bs=xa+ga+So,vs="(?:"+[Tl,da,pa].join("|")+")"+bs,Ao="(?:"+[Eo+gs+"?",gs,da,pa,El].join("|")+")",ba=RegExp(ua,"g"),gr=RegExp(gs,"g"),va=RegExp(fa+"(?="+fa+")|"+Ao+bs,"g"),Al=RegExp([xn+"?"+Mo+"+"+To+"(?="+[_o,xn,"$"].join("|")+")",ma+"+"+xs+"(?="+[_o,xn+ha,"$"].join("|")+")",xn+"?"+ha+"+"+To,xn+"+"+xs,Nl,No,ko,vs].join("|"),"g"),wa=RegExp("["+Vt+ms+mo+wo+"]"),Io=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Co=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Do=-1,ht={};ht[Pr]=ht[Ln]=ht[Fr]=ht[Mr]=ht[Pn]=ht[ls]=ht[cs]=ht[Gt]=ht[ea]=!0,ht[J]=ht[xe]=ht[pn]=ht[De]=ht[hn]=ht[Me]=ht[Ee]=ht[Ne]=ht[qe]=ht[nt]=ht[vt]=ht[Be]=ht[Re]=ht[pr]=ht[Ar]=!1;var ft={};ft[J]=ft[xe]=ft[pn]=ft[hn]=ft[De]=ft[Me]=ft[Pr]=ft[Ln]=ft[Fr]=ft[Mr]=ft[Pn]=ft[qe]=ft[nt]=ft[vt]=ft[Be]=ft[Re]=ft[pr]=ft[hr]=ft[ls]=ft[cs]=ft[Gt]=ft[ea]=!0,ft[Ee]=ft[Ne]=ft[Ar]=!1;var Ro={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Oo={"&":"&","<":"<",">":">",'"':""","'":"'"},Il={"&":"&","<":"<",">":">",""":'"',"'":"'"},Cl={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Dl=parseFloat,Rl=parseInt,$o=typeof Hs=="object"&&Hs&&Hs.Object===Object&&Hs,Lo=typeof self=="object"&&self&&self.Object===Object&&self,Pt=$o||Lo||Function("return this")(),bn=n&&!n.nodeType&&n,Qt=bn&&!0&&e&&!e.nodeType&&e,Po=Qt&&Qt.exports===bn,ya=Po&&$o.process,ar=(function(){try{var G=Qt&&Qt.require&&Qt.require("util").types;return G||ya&&ya.binding&&ya.binding("util")}catch{}})(),Fo=ar&&ar.isArrayBuffer,Uo=ar&&ar.isDate,zo=ar&&ar.isMap,Ho=ar&&ar.isRegExp,Bo=ar&&ar.isSet,Wo=ar&&ar.isTypedArray;function Jt(G,ie,se){switch(se.length){case 0:return G.call(ie);case 1:return G.call(ie,se[0]);case 2:return G.call(ie,se[0],se[1]);case 3:return G.call(ie,se[0],se[1],se[2])}return G.apply(ie,se)}function Ol(G,ie,se,ke){for(var Pe=-1,et=G==null?0:G.length;++Pe<et;){var It=G[Pe];ie(ke,It,se(It),G)}return ke}function er(G,ie){for(var se=-1,ke=G==null?0:G.length;++se<ke&&ie(G[se],se,G)!==!1;);return G}function qo(G,ie){for(var se=G==null?0:G.length;se--&&ie(G[se],se,G)!==!1;);return G}function _a(G,ie){for(var se=-1,ke=G==null?0:G.length;++se<ke;)if(!ie(G[se],se,G))return!1;return!0}function Ir(G,ie){for(var se=-1,ke=G==null?0:G.length,Pe=0,et=[];++se<ke;){var It=G[se];ie(It,se,G)&&(et[Pe++]=It)}return et}function Fn(G,ie){var se=G==null?0:G.length;return!!se&&vn(G,ie,0)>-1}function ws(G,ie,se){for(var ke=-1,Pe=G==null?0:G.length;++ke<Pe;)if(se(ie,G[ke]))return!0;return!1}function mt(G,ie){for(var se=-1,ke=G==null?0:G.length,Pe=Array(ke);++se<ke;)Pe[se]=ie(G[se],se,G);return Pe}function Cr(G,ie){for(var se=-1,ke=ie.length,Pe=G.length;++se<ke;)G[Pe+se]=ie[se];return G}function ys(G,ie,se,ke){var Pe=-1,et=G==null?0:G.length;for(ke&&et&&(se=G[++Pe]);++Pe<et;)se=ie(se,G[Pe],Pe,G);return se}function Yo(G,ie,se,ke){var Pe=G==null?0:G.length;for(ke&&Pe&&(se=G[--Pe]);Pe--;)se=ie(se,G[Pe],Pe,G);return se}function ka(G,ie){for(var se=-1,ke=G==null?0:G.length;++se<ke;)if(ie(G[se],se,G))return!0;return!1}var $l=Ma("length");function Ll(G){return G.split("")}function Pl(G){return G.match(gn)||[]}function Go(G,ie,se){var ke;return se(G,function(Pe,et,It){if(ie(Pe,et,It))return ke=et,!1}),ke}function _s(G,ie,se,ke){for(var Pe=G.length,et=se+(ke?1:-1);ke?et--:++et<Pe;)if(ie(G[et],et,G))return et;return-1}function vn(G,ie,se){return ie===ie?Kl(G,ie,se):_s(G,Xo,se)}function Fl(G,ie,se,ke){for(var Pe=se-1,et=G.length;++Pe<et;)if(ke(G[Pe],ie))return Pe;return-1}function Xo(G){return G!==G}function Ko(G,ie){var se=G==null?0:G.length;return se?Ea(G,ie)/se:H}function Ma(G){return function(ie){return ie==null?a:ie[G]}}function ja(G){return function(ie){return G==null?a:G[ie]}}function Zo(G,ie,se,ke,Pe){return Pe(G,function(et,It,dt){se=ke?(ke=!1,et):ie(se,et,It,dt)}),se}function Ul(G,ie){var se=G.length;for(G.sort(ie);se--;)G[se]=G[se].value;return G}function Ea(G,ie){for(var se,ke=-1,Pe=G.length;++ke<Pe;){var et=ie(G[ke]);et!==a&&(se=se===a?et:se+et)}return se}function Ta(G,ie){for(var se=-1,ke=Array(G);++se<G;)ke[se]=ie(se);return ke}function zl(G,ie){return mt(ie,function(se){return[se,G[se]]})}function Vo(G){return G&&G.slice(0,ti(G)+1).replace(la,"")}function Xt(G){return function(ie){return G(ie)}}function Sa(G,ie){return mt(ie,function(se){return G[se]})}function Un(G,ie){return G.has(ie)}function Qo(G,ie){for(var se=-1,ke=G.length;++se<ke&&vn(ie,G[se],0)>-1;);return se}function Jo(G,ie){for(var se=G.length;se--&&vn(ie,G[se],0)>-1;);return se}function Hl(G,ie){for(var se=G.length,ke=0;se--;)G[se]===ie&&++ke;return ke}var Bl=ja(Ro),Wl=ja(Oo);function ql(G){return"\\"+Cl[G]}function Ur(G,ie){return G==null?a:G[ie]}function wn(G){return wa.test(G)}function Yl(G){return Io.test(G)}function Gl(G){for(var ie,se=[];!(ie=G.next()).done;)se.push(ie.value);return se}function Na(G){var ie=-1,se=Array(G.size);return G.forEach(function(ke,Pe){se[++ie]=[Pe,ke]}),se}function ei(G,ie){return function(se){return G(ie(se))}}function zr(G,ie){for(var se=-1,ke=G.length,Pe=0,et=[];++se<ke;){var It=G[se];(It===ie||It===u)&&(G[se]=u,et[Pe++]=se)}return et}function ks(G){var ie=-1,se=Array(G.size);return G.forEach(function(ke){se[++ie]=ke}),se}function Xl(G){var ie=-1,se=Array(G.size);return G.forEach(function(ke){se[++ie]=[ke,ke]}),se}function Kl(G,ie,se){for(var ke=se-1,Pe=G.length;++ke<Pe;)if(G[ke]===ie)return ke;return-1}function Zl(G,ie,se){for(var ke=se+1;ke--;)if(G[ke]===ie)return ke;return ke}function yn(G){return wn(G)?Ql(G):$l(G)}function or(G){return wn(G)?Jl(G):Ll(G)}function ti(G){for(var ie=G.length;ie--&&uo.test(G.charAt(ie)););return ie}var Vl=ja(Il);function Ql(G){for(var ie=va.lastIndex=0;va.test(G);)++ie;return ie}function Jl(G){return G.match(va)||[]}function ec(G){return G.match(Al)||[]}var ri=(function G(ie){ie=ie==null?Pt:_n.defaults(Pt.Object(),ie,_n.pick(Pt,Co));var se=ie.Array,ke=ie.Date,Pe=ie.Error,et=ie.Function,It=ie.Math,dt=ie.Object,Aa=ie.RegExp,tc=ie.String,tr=ie.TypeError,Ms=se.prototype,rc=et.prototype,kn=dt.prototype,js=ie["__core-js_shared__"],Es=rc.toString,it=kn.hasOwnProperty,nc=0,ni=(function(){var t=/[^.]+$/.exec(js&&js.keys&&js.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})(),Ts=kn.toString,Bt=Es.call(dt),sc=Pt._,ac=Aa("^"+Es.call(it).replace(fs,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ss=Po?ie.Buffer:a,Hr=ie.Symbol,Ns=ie.Uint8Array,si=Ss?Ss.allocUnsafe:a,As=ei(dt.getPrototypeOf,dt),ai=dt.create,oi=kn.propertyIsEnumerable,Is=Ms.splice,ii=Hr?Hr.isConcatSpreadable:a,zn=Hr?Hr.iterator:a,Kr=Hr?Hr.toStringTag:a,Cs=(function(){try{var t=Xn(dt,"defineProperty");return t({},"",{}),t}catch{}})(),oc=ie.clearTimeout!==Pt.clearTimeout&&ie.clearTimeout,ic=ke&&ke.now!==Pt.Date.now&&ke.now,li=ie.setTimeout!==Pt.setTimeout&&ie.setTimeout,Ds=It.ceil,Rs=It.floor,Ia=dt.getOwnPropertySymbols,lc=Ss?Ss.isBuffer:a,ci=ie.isFinite,_t=Ms.join,cc=ei(dt.keys,dt),Ct=It.max,Ut=It.min,uc=ke.now,fc=ie.parseInt,ui=It.random,d=Ms.reverse,g=Xn(ie,"DataView"),b=Xn(ie,"Map"),j=Xn(ie,"Promise"),I=Xn(ie,"Set"),U=Xn(ie,"WeakMap"),V=Xn(dt,"create"),te=U&&new U,me={},fe=Kn(g),Ce=Kn(b),_e=Kn(j),rt=Kn(I),Xe=Kn(U),pt=Hr?Hr.prototype:a,Ot=pt?pt.valueOf:a,ir=pt?pt.toString:a;function S(t){if(Tt(t)&&!He(t)&&!(t instanceof Ke)){if(t instanceof $t)return t;if(it.call(t,"__wrapped__"))return Mp(t)}return new $t(t)}var xr=(function(){function t(){}return function(r){if(!Mt(r))return{};if(ai)return ai(r);t.prototype=r;var i=new t;return t.prototype=a,i}})();function Hn(){}function $t(t,r){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!r,this.__index__=0,this.__values__=a}S.templateSettings={escape:sa,evaluate:aa,interpolate:oa,variable:"",imports:{_:S}},S.prototype=Hn.prototype,S.prototype.constructor=S,$t.prototype=xr(Hn.prototype),$t.prototype.constructor=$t;function Ke(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=he,this.__views__=[]}function Ca(){var t=new Ke(this.__wrapped__);return t.__actions__=lr(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=lr(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=lr(this.__views__),t}function Bn(){if(this.__filtered__){var t=new Ke(this);t.__dir__=-1,t.__filtered__=!0}else t=this.clone(),t.__dir__*=-1;return t}function _x(){var t=this.__wrapped__.value(),r=this.__dir__,i=He(t),w=r<0,E=i?t.length:0,N=Rb(0,E,this.__views__),P=N.start,z=N.end,K=z-P,ce=w?z:P-1,ue=this.__iteratees__,de=ue.length,ve=0,Se=Ut(K,this.__takeCount__);if(!i||!w&&E==K&&Se==K)return Gd(t,this.__actions__);var $e=[];e:for(;K--&&ve<Se;){ce+=r;for(var Ye=-1,Le=t[ce];++Ye<de;){var Ze=ue[Ye],Ve=Ze.iteratee,wr=Ze.type,sr=Ve(Le);if(wr==re)Le=sr;else if(!sr){if(wr==ee)continue e;break e}}$e[ve++]=Le}return $e}Ke.prototype=xr(Hn.prototype),Ke.prototype.constructor=Ke;function Wn(t){var r=-1,i=t==null?0:t.length;for(this.clear();++r<i;){var w=t[r];this.set(w[0],w[1])}}function kx(){this.__data__=V?V(null):{},this.size=0}function Mx(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}function jx(t){var r=this.__data__;if(V){var i=r[t];return i===l?a:i}return it.call(r,t)?r[t]:a}function Ex(t){var r=this.__data__;return V?r[t]!==a:it.call(r,t)}function Tx(t,r){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=V&&r===a?l:r,this}Wn.prototype.clear=kx,Wn.prototype.delete=Mx,Wn.prototype.get=jx,Wn.prototype.has=Ex,Wn.prototype.set=Tx;function Zr(t){var r=-1,i=t==null?0:t.length;for(this.clear();++r<i;){var w=t[r];this.set(w[0],w[1])}}function Sx(){this.__data__=[],this.size=0}function Nx(t){var r=this.__data__,i=fi(r,t);if(i<0)return!1;var w=r.length-1;return i==w?r.pop():Is.call(r,i,1),--this.size,!0}function Ax(t){var r=this.__data__,i=fi(r,t);return i<0?a:r[i][1]}function Ix(t){return fi(this.__data__,t)>-1}function Cx(t,r){var i=this.__data__,w=fi(i,t);return w<0?(++this.size,i.push([t,r])):i[w][1]=r,this}Zr.prototype.clear=Sx,Zr.prototype.delete=Nx,Zr.prototype.get=Ax,Zr.prototype.has=Ix,Zr.prototype.set=Cx;function Vr(t){var r=-1,i=t==null?0:t.length;for(this.clear();++r<i;){var w=t[r];this.set(w[0],w[1])}}function Dx(){this.size=0,this.__data__={hash:new Wn,map:new(b||Zr),string:new Wn}}function Rx(t){var r=ki(this,t).delete(t);return this.size-=r?1:0,r}function Ox(t){return ki(this,t).get(t)}function $x(t){return ki(this,t).has(t)}function Lx(t,r){var i=ki(this,t),w=i.size;return i.set(t,r),this.size+=i.size==w?0:1,this}Vr.prototype.clear=Dx,Vr.prototype.delete=Rx,Vr.prototype.get=Ox,Vr.prototype.has=$x,Vr.prototype.set=Lx;function qn(t){var r=-1,i=t==null?0:t.length;for(this.__data__=new Vr;++r<i;)this.add(t[r])}function Px(t){return this.__data__.set(t,l),this}function Fx(t){return this.__data__.has(t)}qn.prototype.add=qn.prototype.push=Px,qn.prototype.has=Fx;function Dr(t){var r=this.__data__=new Zr(t);this.size=r.size}function Ux(){this.__data__=new Zr,this.size=0}function zx(t){var r=this.__data__,i=r.delete(t);return this.size=r.size,i}function Hx(t){return this.__data__.get(t)}function Bx(t){return this.__data__.has(t)}function Wx(t,r){var i=this.__data__;if(i instanceof Zr){var w=i.__data__;if(!b||w.length<c-1)return w.push([t,r]),this.size=++i.size,this;i=this.__data__=new Vr(w)}return i.set(t,r),this.size=i.size,this}Dr.prototype.clear=Ux,Dr.prototype.delete=zx,Dr.prototype.get=Hx,Dr.prototype.has=Bx,Dr.prototype.set=Wx;function Md(t,r){var i=He(t),w=!i&&Zn(t),E=!i&&!w&&Sn(t),N=!i&&!w&&!E&&Ps(t),P=i||w||E||N,z=P?Ta(t.length,tc):[],K=z.length;for(var ce in t)(r||it.call(t,ce))&&!(P&&(ce=="length"||E&&(ce=="offset"||ce=="parent")||N&&(ce=="buffer"||ce=="byteLength"||ce=="byteOffset")||tn(ce,K)))&&z.push(ce);return z}function jd(t){var r=t.length;return r?t[_c(0,r-1)]:a}function qx(t,r){return Mi(lr(t),Yn(r,0,t.length))}function Yx(t){return Mi(lr(t))}function dc(t,r,i){(i!==a&&!Rr(t[r],i)||i===a&&!(r in t))&&Qr(t,r,i)}function Da(t,r,i){var w=t[r];(!(it.call(t,r)&&Rr(w,i))||i===a&&!(r in t))&&Qr(t,r,i)}function fi(t,r){for(var i=t.length;i--;)if(Rr(t[i][0],r))return i;return-1}function Gx(t,r,i,w){return Mn(t,function(E,N,P){r(w,E,i(E),P)}),w}function Ed(t,r){return t&&Wr(r,zt(r),t)}function Xx(t,r){return t&&Wr(r,ur(r),t)}function Qr(t,r,i){r=="__proto__"&&Cs?Cs(t,r,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[r]=i}function pc(t,r){for(var i=-1,w=r.length,E=se(w),N=t==null;++i<w;)E[i]=N?a:Gc(t,r[i]);return E}function Yn(t,r,i){return t===t&&(i!==a&&(t=t<=i?t:i),r!==a&&(t=t>=r?t:r)),t}function jr(t,r,i,w,E,N){var P,z=r&p,K=r&x,ce=r&v;if(i&&(P=E?i(t,w,E,N):i(t)),P!==a)return P;if(!Mt(t))return t;var ue=He(t);if(ue){if(P=$b(t),!z)return lr(t,P)}else{var de=Kt(t),ve=de==Ne||de==Ie;if(Sn(t))return Zd(t,z);if(de==vt||de==J||ve&&!E){if(P=K||ve?{}:mp(t),!z)return K?jb(t,Xx(P,t)):Mb(t,Ed(P,t))}else{if(!ft[de])return E?t:{};P=Lb(t,de,z)}}N||(N=new Dr);var Se=N.get(t);if(Se)return Se;N.set(t,P),Wp(t)?t.forEach(function(Le){P.add(jr(Le,r,i,Le,t,N))}):Hp(t)&&t.forEach(function(Le,Ze){P.set(Ze,jr(Le,r,i,Ze,t,N))});var $e=ce?K?Dc:Cc:K?ur:zt,Ye=ue?a:$e(t);return er(Ye||t,function(Le,Ze){Ye&&(Ze=Le,Le=t[Ze]),Da(P,Ze,jr(Le,r,i,Ze,t,N))}),P}function Kx(t){var r=zt(t);return function(i){return Td(i,t,r)}}function Td(t,r,i){var w=i.length;if(t==null)return!w;for(t=dt(t);w--;){var E=i[w],N=r[E],P=t[E];if(P===a&&!(E in t)||!N(P))return!1}return!0}function Sd(t,r,i){if(typeof t!="function")throw new tr(y);return Ua(function(){t.apply(a,i)},r)}function Ra(t,r,i,w){var E=-1,N=Fn,P=!0,z=t.length,K=[],ce=r.length;if(!z)return K;i&&(r=mt(r,Xt(i))),w?(N=ws,P=!1):r.length>=c&&(N=Un,P=!1,r=new qn(r));e:for(;++E<z;){var ue=t[E],de=i==null?ue:i(ue);if(ue=w||ue!==0?ue:0,P&&de===de){for(var ve=ce;ve--;)if(r[ve]===de)continue e;K.push(ue)}else N(r,de,w)||K.push(ue)}return K}var Mn=tp(Br),Nd=tp(mc,!0);function Zx(t,r){var i=!0;return Mn(t,function(w,E,N){return i=!!r(w,E,N),i}),i}function di(t,r,i){for(var w=-1,E=t.length;++w<E;){var N=t[w],P=r(N);if(P!=null&&(z===a?P===P&&!vr(P):i(P,z)))var z=P,K=N}return K}function Vx(t,r,i,w){var E=t.length;for(i=We(i),i<0&&(i=-i>E?0:E+i),w=w===a||w>E?E:We(w),w<0&&(w+=E),w=i>w?0:Yp(w);i<w;)t[i++]=r;return t}function Ad(t,r){var i=[];return Mn(t,function(w,E,N){r(w,E,N)&&i.push(w)}),i}function Wt(t,r,i,w,E){var N=-1,P=t.length;for(i||(i=Fb),E||(E=[]);++N<P;){var z=t[N];r>0&&i(z)?r>1?Wt(z,r-1,i,w,E):Cr(E,z):w||(E[E.length]=z)}return E}var hc=rp(),Id=rp(!0);function Br(t,r){return t&&hc(t,r,zt)}function mc(t,r){return t&&Id(t,r,zt)}function pi(t,r){return Ir(r,function(i){return rn(t[i])})}function Gn(t,r){r=En(r,t);for(var i=0,w=r.length;t!=null&&i<w;)t=t[qr(r[i++])];return i&&i==w?t:a}function Cd(t,r,i){var w=r(t);return He(t)?w:Cr(w,i(t))}function rr(t){return t==null?t===a?kt:ze:Kr&&Kr in dt(t)?Db(t):Yb(t)}function gc(t,r){return t>r}function Qx(t,r){return t!=null&&it.call(t,r)}function Jx(t,r){return t!=null&&r in dt(t)}function eb(t,r,i){return t>=Ut(r,i)&&t<Ct(r,i)}function xc(t,r,i){for(var w=i?ws:Fn,E=t[0].length,N=t.length,P=N,z=se(N),K=1/0,ce=[];P--;){var ue=t[P];P&&r&&(ue=mt(ue,Xt(r))),K=Ut(ue.length,K),z[P]=!i&&(r||E>=120&&ue.length>=120)?new qn(P&&ue):a}ue=t[0];var de=-1,ve=z[0];e:for(;++de<E&&ce.length<K;){var Se=ue[de],$e=r?r(Se):Se;if(Se=i||Se!==0?Se:0,!(ve?Un(ve,$e):w(ce,$e,i))){for(P=N;--P;){var Ye=z[P];if(!(Ye?Un(Ye,$e):w(t[P],$e,i)))continue e}ve&&ve.push($e),ce.push(Se)}}return ce}function tb(t,r,i,w){return Br(t,function(E,N,P){r(w,i(E),N,P)}),w}function Oa(t,r,i){r=En(r,t),t=vp(t,r);var w=t==null?t:t[qr(Tr(r))];return w==null?a:Jt(w,t,i)}function Dd(t){return Tt(t)&&rr(t)==J}function rb(t){return Tt(t)&&rr(t)==pn}function nb(t){return Tt(t)&&rr(t)==Me}function $a(t,r,i,w,E){return t===r?!0:t==null||r==null||!Tt(t)&&!Tt(r)?t!==t&&r!==r:sb(t,r,i,w,$a,E)}function sb(t,r,i,w,E,N){var P=He(t),z=He(r),K=P?xe:Kt(t),ce=z?xe:Kt(r);K=K==J?vt:K,ce=ce==J?vt:ce;var ue=K==vt,de=ce==vt,ve=K==ce;if(ve&&Sn(t)){if(!Sn(r))return!1;P=!0,ue=!1}if(ve&&!ue)return N||(N=new Dr),P||Ps(t)?dp(t,r,i,w,E,N):Ib(t,r,K,i,w,E,N);if(!(i&_)){var Se=ue&&it.call(t,"__wrapped__"),$e=de&&it.call(r,"__wrapped__");if(Se||$e){var Ye=Se?t.value():t,Le=$e?r.value():r;return N||(N=new Dr),E(Ye,Le,i,w,N)}}return ve?(N||(N=new Dr),Cb(t,r,i,w,E,N)):!1}function ab(t){return Tt(t)&&Kt(t)==qe}function bc(t,r,i,w){var E=i.length,N=E,P=!w;if(t==null)return!N;for(t=dt(t);E--;){var z=i[E];if(P&&z[2]?z[1]!==t[z[0]]:!(z[0]in t))return!1}for(;++E<N;){z=i[E];var K=z[0],ce=t[K],ue=z[1];if(P&&z[2]){if(ce===a&&!(K in t))return!1}else{var de=new Dr;if(w)var ve=w(ce,ue,K,t,r,de);if(!(ve===a?$a(ue,ce,_|k,w,de):ve))return!1}}return!0}function Rd(t){if(!Mt(t)||zb(t))return!1;var r=rn(t)?ac:ml;return r.test(Kn(t))}function ob(t){return Tt(t)&&rr(t)==Be}function ib(t){return Tt(t)&&Kt(t)==Re}function lb(t){return Tt(t)&&Ai(t.length)&&!!ht[rr(t)]}function Od(t){return typeof t=="function"?t:t==null?fr:typeof t=="object"?He(t)?Pd(t[0],t[1]):Ld(t):nh(t)}function vc(t){if(!Fa(t))return cc(t);var r=[];for(var i in dt(t))it.call(t,i)&&i!="constructor"&&r.push(i);return r}function cb(t){if(!Mt(t))return qb(t);var r=Fa(t),i=[];for(var w in t)w=="constructor"&&(r||!it.call(t,w))||i.push(w);return i}function wc(t,r){return t<r}function $d(t,r){var i=-1,w=cr(t)?se(t.length):[];return Mn(t,function(E,N,P){w[++i]=r(E,N,P)}),w}function Ld(t){var r=Oc(t);return r.length==1&&r[0][2]?xp(r[0][0],r[0][1]):function(i){return i===t||bc(i,t,r)}}function Pd(t,r){return Lc(t)&&gp(r)?xp(qr(t),r):function(i){var w=Gc(i,t);return w===a&&w===r?Xc(i,t):$a(r,w,_|k)}}function hi(t,r,i,w,E){t!==r&&hc(r,function(N,P){if(E||(E=new Dr),Mt(N))ub(t,r,P,i,hi,w,E);else{var z=w?w(Fc(t,P),N,P+"",t,r,E):a;z===a&&(z=N),dc(t,P,z)}},ur)}function ub(t,r,i,w,E,N,P){var z=Fc(t,i),K=Fc(r,i),ce=P.get(K);if(ce){dc(t,i,ce);return}var ue=N?N(z,K,i+"",t,r,P):a,de=ue===a;if(de){var ve=He(K),Se=!ve&&Sn(K),$e=!ve&&!Se&&Ps(K);ue=K,ve||Se||$e?He(z)?ue=z:Dt(z)?ue=lr(z):Se?(de=!1,ue=Zd(K,!0)):$e?(de=!1,ue=Vd(K,!0)):ue=[]:za(K)||Zn(K)?(ue=z,Zn(z)?ue=Gp(z):(!Mt(z)||rn(z))&&(ue=mp(K))):de=!1}de&&(P.set(K,ue),E(ue,K,w,N,P),P.delete(K)),dc(t,i,ue)}function Fd(t,r){var i=t.length;if(i)return r+=r<0?i:0,tn(r,i)?t[r]:a}function Ud(t,r,i){r.length?r=mt(r,function(N){return He(N)?function(P){return Gn(P,N.length===1?N[0]:N)}:N}):r=[fr];var w=-1;r=mt(r,Xt(Oe()));var E=$d(t,function(N,P,z){var K=mt(r,function(ce){return ce(N)});return{criteria:K,index:++w,value:N}});return Ul(E,function(N,P){return kb(N,P,i)})}function fb(t,r){return zd(t,r,function(i,w){return Xc(t,w)})}function zd(t,r,i){for(var w=-1,E=r.length,N={};++w<E;){var P=r[w],z=Gn(t,P);i(z,P)&&La(N,En(P,t),z)}return N}function db(t){return function(r){return Gn(r,t)}}function yc(t,r,i,w){var E=w?Fl:vn,N=-1,P=r.length,z=t;for(t===r&&(r=lr(r)),i&&(z=mt(t,Xt(i)));++N<P;)for(var K=0,ce=r[N],ue=i?i(ce):ce;(K=E(z,ue,K,w))>-1;)z!==t&&Is.call(z,K,1),Is.call(t,K,1);return t}function Hd(t,r){for(var i=t?r.length:0,w=i-1;i--;){var E=r[i];if(i==w||E!==N){var N=E;tn(E)?Is.call(t,E,1):jc(t,E)}}return t}function _c(t,r){return t+Rs(ui()*(r-t+1))}function pb(t,r,i,w){for(var E=-1,N=Ct(Ds((r-t)/(i||1)),0),P=se(N);N--;)P[w?N:++E]=t,t+=i;return P}function kc(t,r){var i="";if(!t||r<1||r>be)return i;do r%2&&(i+=t),r=Rs(r/2),r&&(t+=t);while(r);return i}function Ge(t,r){return Uc(bp(t,r,fr),t+"")}function hb(t){return jd(Fs(t))}function mb(t,r){var i=Fs(t);return Mi(i,Yn(r,0,i.length))}function La(t,r,i,w){if(!Mt(t))return t;r=En(r,t);for(var E=-1,N=r.length,P=N-1,z=t;z!=null&&++E<N;){var K=qr(r[E]),ce=i;if(K==="__proto__"||K==="constructor"||K==="prototype")return t;if(E!=P){var ue=z[K];ce=w?w(ue,K,z):a,ce===a&&(ce=Mt(ue)?ue:tn(r[E+1])?[]:{})}Da(z,K,ce),z=z[K]}return t}var Bd=te?function(t,r){return te.set(t,r),t}:fr,gb=Cs?function(t,r){return Cs(t,"toString",{configurable:!0,enumerable:!1,value:Zc(r),writable:!0})}:fr;function xb(t){return Mi(Fs(t))}function Er(t,r,i){var w=-1,E=t.length;r<0&&(r=-r>E?0:E+r),i=i>E?E:i,i<0&&(i+=E),E=r>i?0:i-r>>>0,r>>>=0;for(var N=se(E);++w<E;)N[w]=t[w+r];return N}function bb(t,r){var i;return Mn(t,function(w,E,N){return i=r(w,E,N),!i}),!!i}function mi(t,r,i){var w=0,E=t==null?w:t.length;if(typeof r=="number"&&r===r&&E<=F){for(;w<E;){var N=w+E>>>1,P=t[N];P!==null&&!vr(P)&&(i?P<=r:P<r)?w=N+1:E=N}return E}return Mc(t,r,fr,i)}function Mc(t,r,i,w){var E=0,N=t==null?0:t.length;if(N===0)return 0;r=i(r);for(var P=r!==r,z=r===null,K=vr(r),ce=r===a;E<N;){var ue=Rs((E+N)/2),de=i(t[ue]),ve=de!==a,Se=de===null,$e=de===de,Ye=vr(de);if(P)var Le=w||$e;else ce?Le=$e&&(w||ve):z?Le=$e&&ve&&(w||!Se):K?Le=$e&&ve&&!Se&&(w||!Ye):Se||Ye?Le=!1:Le=w?de<=r:de<r;Le?E=ue+1:N=ue}return Ut(N,ge)}function Wd(t,r){for(var i=-1,w=t.length,E=0,N=[];++i<w;){var P=t[i],z=r?r(P):P;if(!i||!Rr(z,K)){var K=z;N[E++]=P===0?0:P}}return N}function qd(t){return typeof t=="number"?t:vr(t)?H:+t}function br(t){if(typeof t=="string")return t;if(He(t))return mt(t,br)+"";if(vr(t))return ir?ir.call(t):"";var r=t+"";return r=="0"&&1/t==-ne?"-0":r}function jn(t,r,i){var w=-1,E=Fn,N=t.length,P=!0,z=[],K=z;if(i)P=!1,E=ws;else if(N>=c){var ce=r?null:Nb(t);if(ce)return ks(ce);P=!1,E=Un,K=new qn}else K=r?[]:z;e:for(;++w<N;){var ue=t[w],de=r?r(ue):ue;if(ue=i||ue!==0?ue:0,P&&de===de){for(var ve=K.length;ve--;)if(K[ve]===de)continue e;r&&K.push(de),z.push(ue)}else E(K,de,i)||(K!==z&&K.push(de),z.push(ue))}return z}function jc(t,r){return r=En(r,t),t=vp(t,r),t==null||delete t[qr(Tr(r))]}function Yd(t,r,i,w){return La(t,r,i(Gn(t,r)),w)}function gi(t,r,i,w){for(var E=t.length,N=w?E:-1;(w?N--:++N<E)&&r(t[N],N,t););return i?Er(t,w?0:N,w?N+1:E):Er(t,w?N+1:0,w?E:N)}function Gd(t,r){var i=t;return i instanceof Ke&&(i=i.value()),ys(r,function(w,E){return E.func.apply(E.thisArg,Cr([w],E.args))},i)}function Ec(t,r,i){var w=t.length;if(w<2)return w?jn(t[0]):[];for(var E=-1,N=se(w);++E<w;)for(var P=t[E],z=-1;++z<w;)z!=E&&(N[E]=Ra(N[E]||P,t[z],r,i));return jn(Wt(N,1),r,i)}function Xd(t,r,i){for(var w=-1,E=t.length,N=r.length,P={};++w<E;){var z=w<N?r[w]:a;i(P,t[w],z)}return P}function Tc(t){return Dt(t)?t:[]}function Sc(t){return typeof t=="function"?t:fr}function En(t,r){return He(t)?t:Lc(t,r)?[t]:kp(ct(t))}var vb=Ge;function Tn(t,r,i){var w=t.length;return i=i===a?w:i,!r&&i>=w?t:Er(t,r,i)}var Kd=oc||function(t){return Pt.clearTimeout(t)};function Zd(t,r){if(r)return t.slice();var i=t.length,w=si?si(i):new t.constructor(i);return t.copy(w),w}function Nc(t){var r=new t.constructor(t.byteLength);return new Ns(r).set(new Ns(t)),r}function wb(t,r){var i=r?Nc(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.byteLength)}function yb(t){var r=new t.constructor(t.source,ps.exec(t));return r.lastIndex=t.lastIndex,r}function _b(t){return Ot?dt(Ot.call(t)):{}}function Vd(t,r){var i=r?Nc(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.length)}function Qd(t,r){if(t!==r){var i=t!==a,w=t===null,E=t===t,N=vr(t),P=r!==a,z=r===null,K=r===r,ce=vr(r);if(!z&&!ce&&!N&&t>r||N&&P&&K&&!z&&!ce||w&&P&&K||!i&&K||!E)return 1;if(!w&&!N&&!ce&&t<r||ce&&i&&E&&!w&&!N||z&&i&&E||!P&&E||!K)return-1}return 0}function kb(t,r,i){for(var w=-1,E=t.criteria,N=r.criteria,P=E.length,z=i.length;++w<P;){var K=Qd(E[w],N[w]);if(K){if(w>=z)return K;var ce=i[w];return K*(ce=="desc"?-1:1)}}return t.index-r.index}function Jd(t,r,i,w){for(var E=-1,N=t.length,P=i.length,z=-1,K=r.length,ce=Ct(N-P,0),ue=se(K+ce),de=!w;++z<K;)ue[z]=r[z];for(;++E<P;)(de||E<N)&&(ue[i[E]]=t[E]);for(;ce--;)ue[z++]=t[E++];return ue}function ep(t,r,i,w){for(var E=-1,N=t.length,P=-1,z=i.length,K=-1,ce=r.length,ue=Ct(N-z,0),de=se(ue+ce),ve=!w;++E<ue;)de[E]=t[E];for(var Se=E;++K<ce;)de[Se+K]=r[K];for(;++P<z;)(ve||E<N)&&(de[Se+i[P]]=t[E++]);return de}function lr(t,r){var i=-1,w=t.length;for(r||(r=se(w));++i<w;)r[i]=t[i];return r}function Wr(t,r,i,w){var E=!i;i||(i={});for(var N=-1,P=r.length;++N<P;){var z=r[N],K=w?w(i[z],t[z],z,i,t):a;K===a&&(K=t[z]),E?Qr(i,z,K):Da(i,z,K)}return i}function Mb(t,r){return Wr(t,$c(t),r)}function jb(t,r){return Wr(t,pp(t),r)}function xi(t,r){return function(i,w){var E=He(i)?Ol:Gx,N=r?r():{};return E(i,t,Oe(w,2),N)}}function Os(t){return Ge(function(r,i){var w=-1,E=i.length,N=E>1?i[E-1]:a,P=E>2?i[2]:a;for(N=t.length>3&&typeof N=="function"?(E--,N):a,P&&nr(i[0],i[1],P)&&(N=E<3?a:N,E=1),r=dt(r);++w<E;){var z=i[w];z&&t(r,z,w,N)}return r})}function tp(t,r){return function(i,w){if(i==null)return i;if(!cr(i))return t(i,w);for(var E=i.length,N=r?E:-1,P=dt(i);(r?N--:++N<E)&&w(P[N],N,P)!==!1;);return i}}function rp(t){return function(r,i,w){for(var E=-1,N=dt(r),P=w(r),z=P.length;z--;){var K=P[t?z:++E];if(i(N[K],K,N)===!1)break}return r}}function Eb(t,r,i){var w=r&M,E=Pa(t);function N(){var P=this&&this!==Pt&&this instanceof N?E:t;return P.apply(w?i:this,arguments)}return N}function np(t){return function(r){r=ct(r);var i=wn(r)?or(r):a,w=i?i[0]:r.charAt(0),E=i?Tn(i,1).join(""):r.slice(1);return w[t]()+E}}function $s(t){return function(r){return ys(th(eh(r).replace(ba,"")),t,"")}}function Pa(t){return function(){var r=arguments;switch(r.length){case 0:return new t;case 1:return new t(r[0]);case 2:return new t(r[0],r[1]);case 3:return new t(r[0],r[1],r[2]);case 4:return new t(r[0],r[1],r[2],r[3]);case 5:return new t(r[0],r[1],r[2],r[3],r[4]);case 6:return new t(r[0],r[1],r[2],r[3],r[4],r[5]);case 7:return new t(r[0],r[1],r[2],r[3],r[4],r[5],r[6])}var i=xr(t.prototype),w=t.apply(i,r);return Mt(w)?w:i}}function Tb(t,r,i){var w=Pa(t);function E(){for(var N=arguments.length,P=se(N),z=N,K=Ls(E);z--;)P[z]=arguments[z];var ce=N<3&&P[0]!==K&&P[N-1]!==K?[]:zr(P,K);if(N-=ce.length,N<i)return lp(t,r,bi,E.placeholder,a,P,ce,a,a,i-N);var ue=this&&this!==Pt&&this instanceof E?w:t;return Jt(ue,this,P)}return E}function sp(t){return function(r,i,w){var E=dt(r);if(!cr(r)){var N=Oe(i,3);r=zt(r),i=function(z){return N(E[z],z,E)}}var P=t(r,i,w);return P>-1?E[N?r[P]:P]:a}}function ap(t){return en(function(r){var i=r.length,w=i,E=$t.prototype.thru;for(t&&r.reverse();w--;){var N=r[w];if(typeof N!="function")throw new tr(y);if(E&&!P&&_i(N)=="wrapper")var P=new $t([],!0)}for(w=P?w:i;++w<i;){N=r[w];var z=_i(N),K=z=="wrapper"?Rc(N):a;K&&Pc(K[0])&&K[1]==(R|C|$|Z)&&!K[4].length&&K[9]==1?P=P[_i(K[0])].apply(P,K[3]):P=N.length==1&&Pc(N)?P[z]():P.thru(N)}return function(){var ce=arguments,ue=ce[0];if(P&&ce.length==1&&He(ue))return P.plant(ue).value();for(var de=0,ve=i?r[de].apply(this,ce):ue;++de<i;)ve=r[de].call(this,ve);return ve}})}function bi(t,r,i,w,E,N,P,z,K,ce){var ue=r&R,de=r&M,ve=r&T,Se=r&(C|O),$e=r&X,Ye=ve?a:Pa(t);function Le(){for(var Ze=arguments.length,Ve=se(Ze),wr=Ze;wr--;)Ve[wr]=arguments[wr];if(Se)var sr=Ls(Le),yr=Hl(Ve,sr);if(w&&(Ve=Jd(Ve,w,E,Se)),N&&(Ve=ep(Ve,N,P,Se)),Ze-=yr,Se&&Ze<ce){var Rt=zr(Ve,sr);return lp(t,r,bi,Le.placeholder,i,Ve,Rt,z,K,ce-Ze)}var Or=de?i:this,sn=ve?Or[t]:t;return Ze=Ve.length,z?Ve=Gb(Ve,z):$e&&Ze>1&&Ve.reverse(),ue&&K<Ze&&(Ve.length=K),this&&this!==Pt&&this instanceof Le&&(sn=Ye||Pa(sn)),sn.apply(Or,Ve)}return Le}function op(t,r){return function(i,w){return tb(i,t,r(w),{})}}function vi(t,r){return function(i,w){var E;if(i===a&&w===a)return r;if(i!==a&&(E=i),w!==a){if(E===a)return w;typeof i=="string"||typeof w=="string"?(i=br(i),w=br(w)):(i=qd(i),w=qd(w)),E=t(i,w)}return E}}function Ac(t){return en(function(r){return r=mt(r,Xt(Oe())),Ge(function(i){var w=this;return t(r,function(E){return Jt(E,w,i)})})})}function wi(t,r){r=r===a?" ":br(r);var i=r.length;if(i<2)return i?kc(r,t):r;var w=kc(r,Ds(t/yn(r)));return wn(r)?Tn(or(w),0,t).join(""):w.slice(0,t)}function Sb(t,r,i,w){var E=r&M,N=Pa(t);function P(){for(var z=-1,K=arguments.length,ce=-1,ue=w.length,de=se(ue+K),ve=this&&this!==Pt&&this instanceof P?N:t;++ce<ue;)de[ce]=w[ce];for(;K--;)de[ce++]=arguments[++z];return Jt(ve,E?i:this,de)}return P}function ip(t){return function(r,i,w){return w&&typeof w!="number"&&nr(r,i,w)&&(i=w=a),r=nn(r),i===a?(i=r,r=0):i=nn(i),w=w===a?r<i?1:-1:nn(w),pb(r,i,w,t)}}function yi(t){return function(r,i){return typeof r=="string"&&typeof i=="string"||(r=Sr(r),i=Sr(i)),t(r,i)}}function lp(t,r,i,w,E,N,P,z,K,ce){var ue=r&C,de=ue?P:a,ve=ue?a:P,Se=ue?N:a,$e=ue?a:N;r|=ue?$:W,r&=~(ue?W:$),r&A||(r&=-4);var Ye=[t,r,E,Se,de,$e,ve,z,K,ce],Le=i.apply(a,Ye);return Pc(t)&&wp(Le,Ye),Le.placeholder=w,yp(Le,t,r)}function Ic(t){var r=It[t];return function(i,w){if(i=Sr(i),w=w==null?0:Ut(We(w),292),w&&ci(i)){var E=(ct(i)+"e").split("e"),N=r(E[0]+"e"+(+E[1]+w));return E=(ct(N)+"e").split("e"),+(E[0]+"e"+(+E[1]-w))}return r(i)}}var Nb=I&&1/ks(new I([,-0]))[1]==ne?function(t){return new I(t)}:Jc;function cp(t){return function(r){var i=Kt(r);return i==qe?Na(r):i==Re?Xl(r):zl(r,t(r))}}function Jr(t,r,i,w,E,N,P,z){var K=r&T;if(!K&&typeof t!="function")throw new tr(y);var ce=w?w.length:0;if(ce||(r&=-97,w=E=a),P=P===a?P:Ct(We(P),0),z=z===a?z:We(z),ce-=E?E.length:0,r&W){var ue=w,de=E;w=E=a}var ve=K?a:Rc(t),Se=[t,r,i,w,E,ue,de,N,P,z];if(ve&&Wb(Se,ve),t=Se[0],r=Se[1],i=Se[2],w=Se[3],E=Se[4],z=Se[9]=Se[9]===a?K?0:t.length:Ct(Se[9]-ce,0),!z&&r&(C|O)&&(r&=-25),!r||r==M)var $e=Eb(t,r,i);else r==C||r==O?$e=Tb(t,r,z):(r==$||r==(M|$))&&!E.length?$e=Sb(t,r,i,w):$e=bi.apply(a,Se);var Ye=ve?Bd:wp;return yp(Ye($e,Se),t,r)}function up(t,r,i,w){return t===a||Rr(t,kn[i])&&!it.call(w,i)?r:t}function fp(t,r,i,w,E,N){return Mt(t)&&Mt(r)&&(N.set(r,t),hi(t,r,a,fp,N),N.delete(r)),t}function Ab(t){return za(t)?a:t}function dp(t,r,i,w,E,N){var P=i&_,z=t.length,K=r.length;if(z!=K&&!(P&&K>z))return!1;var ce=N.get(t),ue=N.get(r);if(ce&&ue)return ce==r&&ue==t;var de=-1,ve=!0,Se=i&k?new qn:a;for(N.set(t,r),N.set(r,t);++de<z;){var $e=t[de],Ye=r[de];if(w)var Le=P?w(Ye,$e,de,r,t,N):w($e,Ye,de,t,r,N);if(Le!==a){if(Le)continue;ve=!1;break}if(Se){if(!ka(r,function(Ze,Ve){if(!Un(Se,Ve)&&($e===Ze||E($e,Ze,i,w,N)))return Se.push(Ve)})){ve=!1;break}}else if(!($e===Ye||E($e,Ye,i,w,N))){ve=!1;break}}return N.delete(t),N.delete(r),ve}function Ib(t,r,i,w,E,N,P){switch(i){case hn:if(t.byteLength!=r.byteLength||t.byteOffset!=r.byteOffset)return!1;t=t.buffer,r=r.buffer;case pn:return!(t.byteLength!=r.byteLength||!N(new Ns(t),new Ns(r)));case De:case Me:case nt:return Rr(+t,+r);case Ee:return t.name==r.name&&t.message==r.message;case Be:case pr:return t==r+"";case qe:var z=Na;case Re:var K=w&_;if(z||(z=ks),t.size!=r.size&&!K)return!1;var ce=P.get(t);if(ce)return ce==r;w|=k,P.set(t,r);var ue=dp(z(t),z(r),w,E,N,P);return P.delete(t),ue;case hr:if(Ot)return Ot.call(t)==Ot.call(r)}return!1}function Cb(t,r,i,w,E,N){var P=i&_,z=Cc(t),K=z.length,ce=Cc(r),ue=ce.length;if(K!=ue&&!P)return!1;for(var de=K;de--;){var ve=z[de];if(!(P?ve in r:it.call(r,ve)))return!1}var Se=N.get(t),$e=N.get(r);if(Se&&$e)return Se==r&&$e==t;var Ye=!0;N.set(t,r),N.set(r,t);for(var Le=P;++de<K;){ve=z[de];var Ze=t[ve],Ve=r[ve];if(w)var wr=P?w(Ve,Ze,ve,r,t,N):w(Ze,Ve,ve,t,r,N);if(!(wr===a?Ze===Ve||E(Ze,Ve,i,w,N):wr)){Ye=!1;break}Le||(Le=ve=="constructor")}if(Ye&&!Le){var sr=t.constructor,yr=r.constructor;sr!=yr&&"constructor"in t&&"constructor"in r&&!(typeof sr=="function"&&sr instanceof sr&&typeof yr=="function"&&yr instanceof yr)&&(Ye=!1)}return N.delete(t),N.delete(r),Ye}function en(t){return Uc(bp(t,a,Tp),t+"")}function Cc(t){return Cd(t,zt,$c)}function Dc(t){return Cd(t,ur,pp)}var Rc=te?function(t){return te.get(t)}:Jc;function _i(t){for(var r=t.name+"",i=me[r],w=it.call(me,r)?i.length:0;w--;){var E=i[w],N=E.func;if(N==null||N==t)return E.name}return r}function Ls(t){var r=it.call(S,"placeholder")?S:t;return r.placeholder}function Oe(){var t=S.iteratee||Vc;return t=t===Vc?Od:t,arguments.length?t(arguments[0],arguments[1]):t}function ki(t,r){var i=t.__data__;return Ub(r)?i[typeof r=="string"?"string":"hash"]:i.map}function Oc(t){for(var r=zt(t),i=r.length;i--;){var w=r[i],E=t[w];r[i]=[w,E,gp(E)]}return r}function Xn(t,r){var i=Ur(t,r);return Rd(i)?i:a}function Db(t){var r=it.call(t,Kr),i=t[Kr];try{t[Kr]=a;var w=!0}catch{}var E=Ts.call(t);return w&&(r?t[Kr]=i:delete t[Kr]),E}var $c=Ia?function(t){return t==null?[]:(t=dt(t),Ir(Ia(t),function(r){return oi.call(t,r)}))}:eu,pp=Ia?function(t){for(var r=[];t;)Cr(r,$c(t)),t=As(t);return r}:eu,Kt=rr;(g&&Kt(new g(new ArrayBuffer(1)))!=hn||b&&Kt(new b)!=qe||j&&Kt(j.resolve())!=lt||I&&Kt(new I)!=Re||U&&Kt(new U)!=Ar)&&(Kt=function(t){var r=rr(t),i=r==vt?t.constructor:a,w=i?Kn(i):"";if(w)switch(w){case fe:return hn;case Ce:return qe;case _e:return lt;case rt:return Re;case Xe:return Ar}return r});function Rb(t,r,i){for(var w=-1,E=i.length;++w<E;){var N=i[w],P=N.size;switch(N.type){case"drop":t+=P;break;case"dropRight":r-=P;break;case"take":r=Ut(r,t+P);break;case"takeRight":t=Ct(t,r-P);break}}return{start:t,end:r}}function Ob(t){var r=t.match(po);return r?r[1].split(ho):[]}function hp(t,r,i){r=En(r,t);for(var w=-1,E=r.length,N=!1;++w<E;){var P=qr(r[w]);if(!(N=t!=null&&i(t,P)))break;t=t[P]}return N||++w!=E?N:(E=t==null?0:t.length,!!E&&Ai(E)&&tn(P,E)&&(He(t)||Zn(t)))}function $b(t){var r=t.length,i=new t.constructor(r);return r&&typeof t[0]=="string"&&it.call(t,"index")&&(i.index=t.index,i.input=t.input),i}function mp(t){return typeof t.constructor=="function"&&!Fa(t)?xr(As(t)):{}}function Lb(t,r,i){var w=t.constructor;switch(r){case pn:return Nc(t);case De:case Me:return new w(+t);case hn:return wb(t,i);case Pr:case Ln:case Fr:case Mr:case Pn:case ls:case cs:case Gt:case ea:return Vd(t,i);case qe:return new w;case nt:case pr:return new w(t);case Be:return yb(t);case Re:return new w;case hr:return _b(t)}}function Pb(t,r){var i=r.length;if(!i)return t;var w=i-1;return r[w]=(i>1?"& ":"")+r[w],r=r.join(i>2?", ":" "),t.replace(fo,`{
|
|
49
|
-
/* [wrapped with `+r+`] */
|
|
50
|
-
`)}function Fb(t){return He(t)||Zn(t)||!!(ii&&t&&t[ii])}function tn(t,r){var i=typeof t;return r=r??be,!!r&&(i=="number"||i!="symbol"&&xl.test(t))&&t>-1&&t%1==0&&t<r}function nr(t,r,i){if(!Mt(i))return!1;var w=typeof r;return(w=="number"?cr(i)&&tn(r,i.length):w=="string"&&r in i)?Rr(i[r],t):!1}function Lc(t,r){if(He(t))return!1;var i=typeof t;return i=="number"||i=="symbol"||i=="boolean"||t==null||vr(t)?!0:lo.test(t)||!ia.test(t)||r!=null&&t in dt(r)}function Ub(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}function Pc(t){var r=_i(t),i=S[r];if(typeof i!="function"||!(r in Ke.prototype))return!1;if(t===i)return!0;var w=Rc(i);return!!w&&t===w[0]}function zb(t){return!!ni&&ni in t}var Hb=js?rn:tu;function Fa(t){var r=t&&t.constructor,i=typeof r=="function"&&r.prototype||kn;return t===i}function gp(t){return t===t&&!Mt(t)}function xp(t,r){return function(i){return i==null?!1:i[t]===r&&(r!==a||t in dt(i))}}function Bb(t){var r=Si(t,function(w){return i.size===f&&i.clear(),w}),i=r.cache;return r}function Wb(t,r){var i=t[1],w=r[1],E=i|w,N=E<(M|T|R),P=w==R&&i==C||w==R&&i==Z&&t[7].length<=r[8]||w==(R|Z)&&r[7].length<=r[8]&&i==C;if(!(N||P))return t;w&M&&(t[2]=r[2],E|=i&M?0:A);var z=r[3];if(z){var K=t[3];t[3]=K?Jd(K,z,r[4]):z,t[4]=K?zr(t[3],u):r[4]}return z=r[5],z&&(K=t[5],t[5]=K?ep(K,z,r[6]):z,t[6]=K?zr(t[5],u):r[6]),z=r[7],z&&(t[7]=z),w&R&&(t[8]=t[8]==null?r[8]:Ut(t[8],r[8])),t[9]==null&&(t[9]=r[9]),t[0]=r[0],t[1]=E,t}function qb(t){var r=[];if(t!=null)for(var i in dt(t))r.push(i);return r}function Yb(t){return Ts.call(t)}function bp(t,r,i){return r=Ct(r===a?t.length-1:r,0),function(){for(var w=arguments,E=-1,N=Ct(w.length-r,0),P=se(N);++E<N;)P[E]=w[r+E];E=-1;for(var z=se(r+1);++E<r;)z[E]=w[E];return z[r]=i(P),Jt(t,this,z)}}function vp(t,r){return r.length<2?t:Gn(t,Er(r,0,-1))}function Gb(t,r){for(var i=t.length,w=Ut(r.length,i),E=lr(t);w--;){var N=r[w];t[w]=tn(N,i)?E[N]:a}return t}function Fc(t,r){if(!(r==="constructor"&&typeof t[r]=="function")&&r!="__proto__")return t[r]}var wp=_p(Bd),Ua=li||function(t,r){return Pt.setTimeout(t,r)},Uc=_p(gb);function yp(t,r,i){var w=r+"";return Uc(t,Pb(w,Xb(Ob(w),i)))}function _p(t){var r=0,i=0;return function(){var w=uc(),E=ae-(w-i);if(i=w,E>0){if(++r>=Y)return arguments[0]}else r=0;return t.apply(a,arguments)}}function Mi(t,r){var i=-1,w=t.length,E=w-1;for(r=r===a?w:r;++i<r;){var N=_c(i,E),P=t[N];t[N]=t[i],t[i]=P}return t.length=r,t}var kp=Bb(function(t){var r=[];return t.charCodeAt(0)===46&&r.push(""),t.replace(dl,function(i,w,E,N){r.push(E?N.replace(ds,"$1"):w||i)}),r});function qr(t){if(typeof t=="string"||vr(t))return t;var r=t+"";return r=="0"&&1/t==-ne?"-0":r}function Kn(t){if(t!=null){try{return Es.call(t)}catch{}try{return t+""}catch{}}return""}function Xb(t,r){return er(L,function(i){var w="_."+i[0];r&i[1]&&!Fn(t,w)&&t.push(w)}),t.sort()}function Mp(t){if(t instanceof Ke)return t.clone();var r=new $t(t.__wrapped__,t.__chain__);return r.__actions__=lr(t.__actions__),r.__index__=t.__index__,r.__values__=t.__values__,r}function Kb(t,r,i){(i?nr(t,r,i):r===a)?r=1:r=Ct(We(r),0);var w=t==null?0:t.length;if(!w||r<1)return[];for(var E=0,N=0,P=se(Ds(w/r));E<w;)P[N++]=Er(t,E,E+=r);return P}function Zb(t){for(var r=-1,i=t==null?0:t.length,w=0,E=[];++r<i;){var N=t[r];N&&(E[w++]=N)}return E}function Vb(){var t=arguments.length;if(!t)return[];for(var r=se(t-1),i=arguments[0],w=t;w--;)r[w-1]=arguments[w];return Cr(He(i)?lr(i):[i],Wt(r,1))}var Qb=Ge(function(t,r){return Dt(t)?Ra(t,Wt(r,1,Dt,!0)):[]}),Jb=Ge(function(t,r){var i=Tr(r);return Dt(i)&&(i=a),Dt(t)?Ra(t,Wt(r,1,Dt,!0),Oe(i,2)):[]}),ev=Ge(function(t,r){var i=Tr(r);return Dt(i)&&(i=a),Dt(t)?Ra(t,Wt(r,1,Dt,!0),a,i):[]});function tv(t,r,i){var w=t==null?0:t.length;return w?(r=i||r===a?1:We(r),Er(t,r<0?0:r,w)):[]}function rv(t,r,i){var w=t==null?0:t.length;return w?(r=i||r===a?1:We(r),r=w-r,Er(t,0,r<0?0:r)):[]}function nv(t,r){return t&&t.length?gi(t,Oe(r,3),!0,!0):[]}function sv(t,r){return t&&t.length?gi(t,Oe(r,3),!0):[]}function av(t,r,i,w){var E=t==null?0:t.length;return E?(i&&typeof i!="number"&&nr(t,r,i)&&(i=0,w=E),Vx(t,r,i,w)):[]}function jp(t,r,i){var w=t==null?0:t.length;if(!w)return-1;var E=i==null?0:We(i);return E<0&&(E=Ct(w+E,0)),_s(t,Oe(r,3),E)}function Ep(t,r,i){var w=t==null?0:t.length;if(!w)return-1;var E=w-1;return i!==a&&(E=We(i),E=i<0?Ct(w+E,0):Ut(E,w-1)),_s(t,Oe(r,3),E,!0)}function Tp(t){var r=t==null?0:t.length;return r?Wt(t,1):[]}function ov(t){var r=t==null?0:t.length;return r?Wt(t,ne):[]}function iv(t,r){var i=t==null?0:t.length;return i?(r=r===a?1:We(r),Wt(t,r)):[]}function lv(t){for(var r=-1,i=t==null?0:t.length,w={};++r<i;){var E=t[r];w[E[0]]=E[1]}return w}function Sp(t){return t&&t.length?t[0]:a}function cv(t,r,i){var w=t==null?0:t.length;if(!w)return-1;var E=i==null?0:We(i);return E<0&&(E=Ct(w+E,0)),vn(t,r,E)}function uv(t){var r=t==null?0:t.length;return r?Er(t,0,-1):[]}var fv=Ge(function(t){var r=mt(t,Tc);return r.length&&r[0]===t[0]?xc(r):[]}),dv=Ge(function(t){var r=Tr(t),i=mt(t,Tc);return r===Tr(i)?r=a:i.pop(),i.length&&i[0]===t[0]?xc(i,Oe(r,2)):[]}),pv=Ge(function(t){var r=Tr(t),i=mt(t,Tc);return r=typeof r=="function"?r:a,r&&i.pop(),i.length&&i[0]===t[0]?xc(i,a,r):[]});function hv(t,r){return t==null?"":_t.call(t,r)}function Tr(t){var r=t==null?0:t.length;return r?t[r-1]:a}function mv(t,r,i){var w=t==null?0:t.length;if(!w)return-1;var E=w;return i!==a&&(E=We(i),E=E<0?Ct(w+E,0):Ut(E,w-1)),r===r?Zl(t,r,E):_s(t,Xo,E,!0)}function gv(t,r){return t&&t.length?Fd(t,We(r)):a}var xv=Ge(Np);function Np(t,r){return t&&t.length&&r&&r.length?yc(t,r):t}function bv(t,r,i){return t&&t.length&&r&&r.length?yc(t,r,Oe(i,2)):t}function vv(t,r,i){return t&&t.length&&r&&r.length?yc(t,r,a,i):t}var wv=en(function(t,r){var i=t==null?0:t.length,w=pc(t,r);return Hd(t,mt(r,function(E){return tn(E,i)?+E:E}).sort(Qd)),w});function yv(t,r){var i=[];if(!(t&&t.length))return i;var w=-1,E=[],N=t.length;for(r=Oe(r,3);++w<N;){var P=t[w];r(P,w,t)&&(i.push(P),E.push(w))}return Hd(t,E),i}function zc(t){return t==null?t:d.call(t)}function _v(t,r,i){var w=t==null?0:t.length;return w?(i&&typeof i!="number"&&nr(t,r,i)?(r=0,i=w):(r=r==null?0:We(r),i=i===a?w:We(i)),Er(t,r,i)):[]}function kv(t,r){return mi(t,r)}function Mv(t,r,i){return Mc(t,r,Oe(i,2))}function jv(t,r){var i=t==null?0:t.length;if(i){var w=mi(t,r);if(w<i&&Rr(t[w],r))return w}return-1}function Ev(t,r){return mi(t,r,!0)}function Tv(t,r,i){return Mc(t,r,Oe(i,2),!0)}function Sv(t,r){var i=t==null?0:t.length;if(i){var w=mi(t,r,!0)-1;if(Rr(t[w],r))return w}return-1}function Nv(t){return t&&t.length?Wd(t):[]}function Av(t,r){return t&&t.length?Wd(t,Oe(r,2)):[]}function Iv(t){var r=t==null?0:t.length;return r?Er(t,1,r):[]}function Cv(t,r,i){return t&&t.length?(r=i||r===a?1:We(r),Er(t,0,r<0?0:r)):[]}function Dv(t,r,i){var w=t==null?0:t.length;return w?(r=i||r===a?1:We(r),r=w-r,Er(t,r<0?0:r,w)):[]}function Rv(t,r){return t&&t.length?gi(t,Oe(r,3),!1,!0):[]}function Ov(t,r){return t&&t.length?gi(t,Oe(r,3)):[]}var $v=Ge(function(t){return jn(Wt(t,1,Dt,!0))}),Lv=Ge(function(t){var r=Tr(t);return Dt(r)&&(r=a),jn(Wt(t,1,Dt,!0),Oe(r,2))}),Pv=Ge(function(t){var r=Tr(t);return r=typeof r=="function"?r:a,jn(Wt(t,1,Dt,!0),a,r)});function Fv(t){return t&&t.length?jn(t):[]}function Uv(t,r){return t&&t.length?jn(t,Oe(r,2)):[]}function zv(t,r){return r=typeof r=="function"?r:a,t&&t.length?jn(t,a,r):[]}function Hc(t){if(!(t&&t.length))return[];var r=0;return t=Ir(t,function(i){if(Dt(i))return r=Ct(i.length,r),!0}),Ta(r,function(i){return mt(t,Ma(i))})}function Ap(t,r){if(!(t&&t.length))return[];var i=Hc(t);return r==null?i:mt(i,function(w){return Jt(r,a,w)})}var Hv=Ge(function(t,r){return Dt(t)?Ra(t,r):[]}),Bv=Ge(function(t){return Ec(Ir(t,Dt))}),Wv=Ge(function(t){var r=Tr(t);return Dt(r)&&(r=a),Ec(Ir(t,Dt),Oe(r,2))}),qv=Ge(function(t){var r=Tr(t);return r=typeof r=="function"?r:a,Ec(Ir(t,Dt),a,r)}),Yv=Ge(Hc);function Gv(t,r){return Xd(t||[],r||[],Da)}function Xv(t,r){return Xd(t||[],r||[],La)}var Kv=Ge(function(t){var r=t.length,i=r>1?t[r-1]:a;return i=typeof i=="function"?(t.pop(),i):a,Ap(t,i)});function Ip(t){var r=S(t);return r.__chain__=!0,r}function Zv(t,r){return r(t),t}function ji(t,r){return r(t)}var Vv=en(function(t){var r=t.length,i=r?t[0]:0,w=this.__wrapped__,E=function(N){return pc(N,t)};return r>1||this.__actions__.length||!(w instanceof Ke)||!tn(i)?this.thru(E):(w=w.slice(i,+i+(r?1:0)),w.__actions__.push({func:ji,args:[E],thisArg:a}),new $t(w,this.__chain__).thru(function(N){return r&&!N.length&&N.push(a),N}))});function Qv(){return Ip(this)}function Jv(){return new $t(this.value(),this.__chain__)}function ew(){this.__values__===a&&(this.__values__=qp(this.value()));var t=this.__index__>=this.__values__.length,r=t?a:this.__values__[this.__index__++];return{done:t,value:r}}function tw(){return this}function rw(t){for(var r,i=this;i instanceof Hn;){var w=Mp(i);w.__index__=0,w.__values__=a,r?E.__wrapped__=w:r=w;var E=w;i=i.__wrapped__}return E.__wrapped__=t,r}function nw(){var t=this.__wrapped__;if(t instanceof Ke){var r=t;return this.__actions__.length&&(r=new Ke(this)),r=r.reverse(),r.__actions__.push({func:ji,args:[zc],thisArg:a}),new $t(r,this.__chain__)}return this.thru(zc)}function sw(){return Gd(this.__wrapped__,this.__actions__)}var aw=xi(function(t,r,i){it.call(t,i)?++t[i]:Qr(t,i,1)});function ow(t,r,i){var w=He(t)?_a:Zx;return i&&nr(t,r,i)&&(r=a),w(t,Oe(r,3))}function iw(t,r){var i=He(t)?Ir:Ad;return i(t,Oe(r,3))}var lw=sp(jp),cw=sp(Ep);function uw(t,r){return Wt(Ei(t,r),1)}function fw(t,r){return Wt(Ei(t,r),ne)}function dw(t,r,i){return i=i===a?1:We(i),Wt(Ei(t,r),i)}function Cp(t,r){var i=He(t)?er:Mn;return i(t,Oe(r,3))}function Dp(t,r){var i=He(t)?qo:Nd;return i(t,Oe(r,3))}var pw=xi(function(t,r,i){it.call(t,i)?t[i].push(r):Qr(t,i,[r])});function hw(t,r,i,w){t=cr(t)?t:Fs(t),i=i&&!w?We(i):0;var E=t.length;return i<0&&(i=Ct(E+i,0)),Ii(t)?i<=E&&t.indexOf(r,i)>-1:!!E&&vn(t,r,i)>-1}var mw=Ge(function(t,r,i){var w=-1,E=typeof r=="function",N=cr(t)?se(t.length):[];return Mn(t,function(P){N[++w]=E?Jt(r,P,i):Oa(P,r,i)}),N}),gw=xi(function(t,r,i){Qr(t,i,r)});function Ei(t,r){var i=He(t)?mt:$d;return i(t,Oe(r,3))}function xw(t,r,i,w){return t==null?[]:(He(r)||(r=r==null?[]:[r]),i=w?a:i,He(i)||(i=i==null?[]:[i]),Ud(t,r,i))}var bw=xi(function(t,r,i){t[i?0:1].push(r)},function(){return[[],[]]});function vw(t,r,i){var w=He(t)?ys:Zo,E=arguments.length<3;return w(t,Oe(r,4),i,E,Mn)}function ww(t,r,i){var w=He(t)?Yo:Zo,E=arguments.length<3;return w(t,Oe(r,4),i,E,Nd)}function yw(t,r){var i=He(t)?Ir:Ad;return i(t,Ni(Oe(r,3)))}function _w(t){var r=He(t)?jd:hb;return r(t)}function kw(t,r,i){(i?nr(t,r,i):r===a)?r=1:r=We(r);var w=He(t)?qx:mb;return w(t,r)}function Mw(t){var r=He(t)?Yx:xb;return r(t)}function jw(t){if(t==null)return 0;if(cr(t))return Ii(t)?yn(t):t.length;var r=Kt(t);return r==qe||r==Re?t.size:vc(t).length}function Ew(t,r,i){var w=He(t)?ka:bb;return i&&nr(t,r,i)&&(r=a),w(t,Oe(r,3))}var Tw=Ge(function(t,r){if(t==null)return[];var i=r.length;return i>1&&nr(t,r[0],r[1])?r=[]:i>2&&nr(r[0],r[1],r[2])&&(r=[r[0]]),Ud(t,Wt(r,1),[])}),Ti=ic||function(){return Pt.Date.now()};function Sw(t,r){if(typeof r!="function")throw new tr(y);return t=We(t),function(){if(--t<1)return r.apply(this,arguments)}}function Rp(t,r,i){return r=i?a:r,r=t&&r==null?t.length:r,Jr(t,R,a,a,a,a,r)}function Op(t,r){var i;if(typeof r!="function")throw new tr(y);return t=We(t),function(){return--t>0&&(i=r.apply(this,arguments)),t<=1&&(r=a),i}}var Bc=Ge(function(t,r,i){var w=M;if(i.length){var E=zr(i,Ls(Bc));w|=$}return Jr(t,w,r,i,E)}),$p=Ge(function(t,r,i){var w=M|T;if(i.length){var E=zr(i,Ls($p));w|=$}return Jr(r,w,t,i,E)});function Lp(t,r,i){r=i?a:r;var w=Jr(t,C,a,a,a,a,a,r);return w.placeholder=Lp.placeholder,w}function Pp(t,r,i){r=i?a:r;var w=Jr(t,O,a,a,a,a,a,r);return w.placeholder=Pp.placeholder,w}function Fp(t,r,i){var w,E,N,P,z,K,ce=0,ue=!1,de=!1,ve=!0;if(typeof t!="function")throw new tr(y);r=Sr(r)||0,Mt(i)&&(ue=!!i.leading,de="maxWait"in i,N=de?Ct(Sr(i.maxWait)||0,r):N,ve="trailing"in i?!!i.trailing:ve);function Se(Rt){var Or=w,sn=E;return w=E=a,ce=Rt,P=t.apply(sn,Or),P}function $e(Rt){return ce=Rt,z=Ua(Ze,r),ue?Se(Rt):P}function Ye(Rt){var Or=Rt-K,sn=Rt-ce,sh=r-Or;return de?Ut(sh,N-sn):sh}function Le(Rt){var Or=Rt-K,sn=Rt-ce;return K===a||Or>=r||Or<0||de&&sn>=N}function Ze(){var Rt=Ti();if(Le(Rt))return Ve(Rt);z=Ua(Ze,Ye(Rt))}function Ve(Rt){return z=a,ve&&w?Se(Rt):(w=E=a,P)}function wr(){z!==a&&Kd(z),ce=0,w=K=E=z=a}function sr(){return z===a?P:Ve(Ti())}function yr(){var Rt=Ti(),Or=Le(Rt);if(w=arguments,E=this,K=Rt,Or){if(z===a)return $e(K);if(de)return Kd(z),z=Ua(Ze,r),Se(K)}return z===a&&(z=Ua(Ze,r)),P}return yr.cancel=wr,yr.flush=sr,yr}var Nw=Ge(function(t,r){return Sd(t,1,r)}),Aw=Ge(function(t,r,i){return Sd(t,Sr(r)||0,i)});function Iw(t){return Jr(t,X)}function Si(t,r){if(typeof t!="function"||r!=null&&typeof r!="function")throw new tr(y);var i=function(){var w=arguments,E=r?r.apply(this,w):w[0],N=i.cache;if(N.has(E))return N.get(E);var P=t.apply(this,w);return i.cache=N.set(E,P)||N,P};return i.cache=new(Si.Cache||Vr),i}Si.Cache=Vr;function Ni(t){if(typeof t!="function")throw new tr(y);return function(){var r=arguments;switch(r.length){case 0:return!t.call(this);case 1:return!t.call(this,r[0]);case 2:return!t.call(this,r[0],r[1]);case 3:return!t.call(this,r[0],r[1],r[2])}return!t.apply(this,r)}}function Cw(t){return Op(2,t)}var Dw=vb(function(t,r){r=r.length==1&&He(r[0])?mt(r[0],Xt(Oe())):mt(Wt(r,1),Xt(Oe()));var i=r.length;return Ge(function(w){for(var E=-1,N=Ut(w.length,i);++E<N;)w[E]=r[E].call(this,w[E]);return Jt(t,this,w)})}),Wc=Ge(function(t,r){var i=zr(r,Ls(Wc));return Jr(t,$,a,r,i)}),Up=Ge(function(t,r){var i=zr(r,Ls(Up));return Jr(t,W,a,r,i)}),Rw=en(function(t,r){return Jr(t,Z,a,a,a,r)});function Ow(t,r){if(typeof t!="function")throw new tr(y);return r=r===a?r:We(r),Ge(t,r)}function $w(t,r){if(typeof t!="function")throw new tr(y);return r=r==null?0:Ct(We(r),0),Ge(function(i){var w=i[r],E=Tn(i,0,r);return w&&Cr(E,w),Jt(t,this,E)})}function Lw(t,r,i){var w=!0,E=!0;if(typeof t!="function")throw new tr(y);return Mt(i)&&(w="leading"in i?!!i.leading:w,E="trailing"in i?!!i.trailing:E),Fp(t,r,{leading:w,maxWait:r,trailing:E})}function Pw(t){return Rp(t,1)}function Fw(t,r){return Wc(Sc(r),t)}function Uw(){if(!arguments.length)return[];var t=arguments[0];return He(t)?t:[t]}function zw(t){return jr(t,v)}function Hw(t,r){return r=typeof r=="function"?r:a,jr(t,v,r)}function Bw(t){return jr(t,p|v)}function Ww(t,r){return r=typeof r=="function"?r:a,jr(t,p|v,r)}function qw(t,r){return r==null||Td(t,r,zt(r))}function Rr(t,r){return t===r||t!==t&&r!==r}var Yw=yi(gc),Gw=yi(function(t,r){return t>=r}),Zn=Dd((function(){return arguments})())?Dd:function(t){return Tt(t)&&it.call(t,"callee")&&!oi.call(t,"callee")},He=se.isArray,Xw=Fo?Xt(Fo):rb;function cr(t){return t!=null&&Ai(t.length)&&!rn(t)}function Dt(t){return Tt(t)&&cr(t)}function Kw(t){return t===!0||t===!1||Tt(t)&&rr(t)==De}var Sn=lc||tu,Zw=Uo?Xt(Uo):nb;function Vw(t){return Tt(t)&&t.nodeType===1&&!za(t)}function Qw(t){if(t==null)return!0;if(cr(t)&&(He(t)||typeof t=="string"||typeof t.splice=="function"||Sn(t)||Ps(t)||Zn(t)))return!t.length;var r=Kt(t);if(r==qe||r==Re)return!t.size;if(Fa(t))return!vc(t).length;for(var i in t)if(it.call(t,i))return!1;return!0}function Jw(t,r){return $a(t,r)}function e1(t,r,i){i=typeof i=="function"?i:a;var w=i?i(t,r):a;return w===a?$a(t,r,a,i):!!w}function qc(t){if(!Tt(t))return!1;var r=rr(t);return r==Ee||r==oe||typeof t.message=="string"&&typeof t.name=="string"&&!za(t)}function t1(t){return typeof t=="number"&&ci(t)}function rn(t){if(!Mt(t))return!1;var r=rr(t);return r==Ne||r==Ie||r==Te||r==le}function zp(t){return typeof t=="number"&&t==We(t)}function Ai(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=be}function Mt(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}function Tt(t){return t!=null&&typeof t=="object"}var Hp=zo?Xt(zo):ab;function r1(t,r){return t===r||bc(t,r,Oc(r))}function n1(t,r,i){return i=typeof i=="function"?i:a,bc(t,r,Oc(r),i)}function s1(t){return Bp(t)&&t!=+t}function a1(t){if(Hb(t))throw new Pe(m);return Rd(t)}function o1(t){return t===null}function i1(t){return t==null}function Bp(t){return typeof t=="number"||Tt(t)&&rr(t)==nt}function za(t){if(!Tt(t)||rr(t)!=vt)return!1;var r=As(t);if(r===null)return!0;var i=it.call(r,"constructor")&&r.constructor;return typeof i=="function"&&i instanceof i&&Es.call(i)==Bt}var Yc=Ho?Xt(Ho):ob;function l1(t){return zp(t)&&t>=-be&&t<=be}var Wp=Bo?Xt(Bo):ib;function Ii(t){return typeof t=="string"||!He(t)&&Tt(t)&&rr(t)==pr}function vr(t){return typeof t=="symbol"||Tt(t)&&rr(t)==hr}var Ps=Wo?Xt(Wo):lb;function c1(t){return t===a}function u1(t){return Tt(t)&&Kt(t)==Ar}function f1(t){return Tt(t)&&rr(t)==ul}var d1=yi(wc),p1=yi(function(t,r){return t<=r});function qp(t){if(!t)return[];if(cr(t))return Ii(t)?or(t):lr(t);if(zn&&t[zn])return Gl(t[zn]());var r=Kt(t),i=r==qe?Na:r==Re?ks:Fs;return i(t)}function nn(t){if(!t)return t===0?t:0;if(t=Sr(t),t===ne||t===-ne){var r=t<0?-1:1;return r*je}return t===t?t:0}function We(t){var r=nn(t),i=r%1;return r===r?i?r-i:r:0}function Yp(t){return t?Yn(We(t),0,he):0}function Sr(t){if(typeof t=="number")return t;if(vr(t))return H;if(Mt(t)){var r=typeof t.valueOf=="function"?t.valueOf():t;t=Mt(r)?r+"":r}if(typeof t!="string")return t===0?t:+t;t=Vo(t);var i=hl.test(t);return i||gl.test(t)?Rl(t.slice(2),i?2:8):pl.test(t)?H:+t}function Gp(t){return Wr(t,ur(t))}function h1(t){return t?Yn(We(t),-be,be):t===0?t:0}function ct(t){return t==null?"":br(t)}var m1=Os(function(t,r){if(Fa(r)||cr(r)){Wr(r,zt(r),t);return}for(var i in r)it.call(r,i)&&Da(t,i,r[i])}),Xp=Os(function(t,r){Wr(r,ur(r),t)}),Ci=Os(function(t,r,i,w){Wr(r,ur(r),t,w)}),g1=Os(function(t,r,i,w){Wr(r,zt(r),t,w)}),x1=en(pc);function b1(t,r){var i=xr(t);return r==null?i:Ed(i,r)}var v1=Ge(function(t,r){t=dt(t);var i=-1,w=r.length,E=w>2?r[2]:a;for(E&&nr(r[0],r[1],E)&&(w=1);++i<w;)for(var N=r[i],P=ur(N),z=-1,K=P.length;++z<K;){var ce=P[z],ue=t[ce];(ue===a||Rr(ue,kn[ce])&&!it.call(t,ce))&&(t[ce]=N[ce])}return t}),w1=Ge(function(t){return t.push(a,fp),Jt(Kp,a,t)});function y1(t,r){return Go(t,Oe(r,3),Br)}function _1(t,r){return Go(t,Oe(r,3),mc)}function k1(t,r){return t==null?t:hc(t,Oe(r,3),ur)}function M1(t,r){return t==null?t:Id(t,Oe(r,3),ur)}function j1(t,r){return t&&Br(t,Oe(r,3))}function E1(t,r){return t&&mc(t,Oe(r,3))}function T1(t){return t==null?[]:pi(t,zt(t))}function S1(t){return t==null?[]:pi(t,ur(t))}function Gc(t,r,i){var w=t==null?a:Gn(t,r);return w===a?i:w}function N1(t,r){return t!=null&&hp(t,r,Qx)}function Xc(t,r){return t!=null&&hp(t,r,Jx)}var A1=op(function(t,r,i){r!=null&&typeof r.toString!="function"&&(r=Ts.call(r)),t[r]=i},Zc(fr)),I1=op(function(t,r,i){r!=null&&typeof r.toString!="function"&&(r=Ts.call(r)),it.call(t,r)?t[r].push(i):t[r]=[i]},Oe),C1=Ge(Oa);function zt(t){return cr(t)?Md(t):vc(t)}function ur(t){return cr(t)?Md(t,!0):cb(t)}function D1(t,r){var i={};return r=Oe(r,3),Br(t,function(w,E,N){Qr(i,r(w,E,N),w)}),i}function R1(t,r){var i={};return r=Oe(r,3),Br(t,function(w,E,N){Qr(i,E,r(w,E,N))}),i}var O1=Os(function(t,r,i){hi(t,r,i)}),Kp=Os(function(t,r,i,w){hi(t,r,i,w)}),$1=en(function(t,r){var i={};if(t==null)return i;var w=!1;r=mt(r,function(N){return N=En(N,t),w||(w=N.length>1),N}),Wr(t,Dc(t),i),w&&(i=jr(i,p|x|v,Ab));for(var E=r.length;E--;)jc(i,r[E]);return i});function L1(t,r){return Zp(t,Ni(Oe(r)))}var P1=en(function(t,r){return t==null?{}:fb(t,r)});function Zp(t,r){if(t==null)return{};var i=mt(Dc(t),function(w){return[w]});return r=Oe(r),zd(t,i,function(w,E){return r(w,E[0])})}function F1(t,r,i){r=En(r,t);var w=-1,E=r.length;for(E||(E=1,t=a);++w<E;){var N=t==null?a:t[qr(r[w])];N===a&&(w=E,N=i),t=rn(N)?N.call(t):N}return t}function U1(t,r,i){return t==null?t:La(t,r,i)}function z1(t,r,i,w){return w=typeof w=="function"?w:a,t==null?t:La(t,r,i,w)}var Vp=cp(zt),Qp=cp(ur);function H1(t,r,i){var w=He(t),E=w||Sn(t)||Ps(t);if(r=Oe(r,4),i==null){var N=t&&t.constructor;E?i=w?new N:[]:Mt(t)?i=rn(N)?xr(As(t)):{}:i={}}return(E?er:Br)(t,function(P,z,K){return r(i,P,z,K)}),i}function B1(t,r){return t==null?!0:jc(t,r)}function W1(t,r,i){return t==null?t:Yd(t,r,Sc(i))}function q1(t,r,i,w){return w=typeof w=="function"?w:a,t==null?t:Yd(t,r,Sc(i),w)}function Fs(t){return t==null?[]:Sa(t,zt(t))}function Y1(t){return t==null?[]:Sa(t,ur(t))}function G1(t,r,i){return i===a&&(i=r,r=a),i!==a&&(i=Sr(i),i=i===i?i:0),r!==a&&(r=Sr(r),r=r===r?r:0),Yn(Sr(t),r,i)}function X1(t,r,i){return r=nn(r),i===a?(i=r,r=0):i=nn(i),t=Sr(t),eb(t,r,i)}function K1(t,r,i){if(i&&typeof i!="boolean"&&nr(t,r,i)&&(r=i=a),i===a&&(typeof r=="boolean"?(i=r,r=a):typeof t=="boolean"&&(i=t,t=a)),t===a&&r===a?(t=0,r=1):(t=nn(t),r===a?(r=t,t=0):r=nn(r)),t>r){var w=t;t=r,r=w}if(i||t%1||r%1){var E=ui();return Ut(t+E*(r-t+Dl("1e-"+((E+"").length-1))),r)}return _c(t,r)}var Z1=$s(function(t,r,i){return r=r.toLowerCase(),t+(i?Jp(r):r)});function Jp(t){return Kc(ct(t).toLowerCase())}function eh(t){return t=ct(t),t&&t.replace(bl,Bl).replace(gr,"")}function V1(t,r,i){t=ct(t),r=br(r);var w=t.length;i=i===a?w:Yn(We(i),0,w);var E=i;return i-=r.length,i>=0&&t.slice(i,E)==r}function Q1(t){return t=ct(t),t&&na.test(t)?t.replace(us,Wl):t}function J1(t){return t=ct(t),t&&co.test(t)?t.replace(fs,"\\$&"):t}var ey=$s(function(t,r,i){return t+(i?"-":"")+r.toLowerCase()}),ty=$s(function(t,r,i){return t+(i?" ":"")+r.toLowerCase()}),ry=np("toLowerCase");function ny(t,r,i){t=ct(t),r=We(r);var w=r?yn(t):0;if(!r||w>=r)return t;var E=(r-w)/2;return wi(Rs(E),i)+t+wi(Ds(E),i)}function sy(t,r,i){t=ct(t),r=We(r);var w=r?yn(t):0;return r&&w<r?t+wi(r-w,i):t}function ay(t,r,i){t=ct(t),r=We(r);var w=r?yn(t):0;return r&&w<r?wi(r-w,i)+t:t}function oy(t,r,i){return i||r==null?r=0:r&&(r=+r),fc(ct(t).replace(la,""),r||0)}function iy(t,r,i){return(i?nr(t,r,i):r===a)?r=1:r=We(r),kc(ct(t),r)}function ly(){var t=arguments,r=ct(t[0]);return t.length<3?r:r.replace(t[1],t[2])}var cy=$s(function(t,r,i){return t+(i?"_":"")+r.toLowerCase()});function uy(t,r,i){return i&&typeof i!="number"&&nr(t,r,i)&&(r=i=a),i=i===a?he:i>>>0,i?(t=ct(t),t&&(typeof r=="string"||r!=null&&!Yc(r))&&(r=br(r),!r&&wn(t))?Tn(or(t),0,i):t.split(r,i)):[]}var fy=$s(function(t,r,i){return t+(i?" ":"")+Kc(r)});function dy(t,r,i){return t=ct(t),i=i==null?0:Yn(We(i),0,t.length),r=br(r),t.slice(i,i+r.length)==r}function py(t,r,i){var w=S.templateSettings;i&&nr(t,r,i)&&(r=a),t=ct(t),r=Ci({},r,w,up);var E=Ci({},r.imports,w.imports,up),N=zt(E),P=Sa(E,N),z,K,ce=0,ue=r.interpolate||hs,de="__p += '",ve=Aa((r.escape||hs).source+"|"+ue.source+"|"+(ue===oa?pe:hs).source+"|"+(r.evaluate||hs).source+"|$","g"),Se="//# sourceURL="+(it.call(r,"sourceURL")?(r.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Do+"]")+`
|
|
51
|
-
`;t.replace(ve,function(Le,Ze,Ve,wr,sr,yr){return Ve||(Ve=wr),de+=t.slice(ce,yr).replace(vl,ql),Ze&&(z=!0,de+=`' +
|
|
52
|
-
__e(`+Ze+`) +
|
|
53
|
-
'`),sr&&(K=!0,de+=`';
|
|
54
|
-
`+sr+`;
|
|
55
|
-
__p += '`),Ve&&(de+=`' +
|
|
56
|
-
((__t = (`+Ve+`)) == null ? '' : __t) +
|
|
57
|
-
'`),ce=yr+Le.length,Le}),de+=`';
|
|
58
|
-
`;var $e=it.call(r,"variable")&&r.variable;if(!$e)de=`with (obj) {
|
|
59
|
-
`+de+`
|
|
60
|
-
}
|
|
61
|
-
`;else if(ca.test($e))throw new Pe(h);de=(K?de.replace(fl,""):de).replace(ta,"$1").replace(mr,"$1;"),de="function("+($e||"obj")+`) {
|
|
62
|
-
`+($e?"":`obj || (obj = {});
|
|
63
|
-
`)+"var __t, __p = ''"+(z?", __e = _.escape":"")+(K?`, __j = Array.prototype.join;
|
|
64
|
-
function print() { __p += __j.call(arguments, '') }
|
|
65
|
-
`:`;
|
|
66
|
-
`)+de+`return __p
|
|
67
|
-
}`;var Ye=rh(function(){return et(N,Se+"return "+de).apply(a,P)});if(Ye.source=de,qc(Ye))throw Ye;return Ye}function hy(t){return ct(t).toLowerCase()}function my(t){return ct(t).toUpperCase()}function gy(t,r,i){if(t=ct(t),t&&(i||r===a))return Vo(t);if(!t||!(r=br(r)))return t;var w=or(t),E=or(r),N=Qo(w,E),P=Jo(w,E)+1;return Tn(w,N,P).join("")}function xy(t,r,i){if(t=ct(t),t&&(i||r===a))return t.slice(0,ti(t)+1);if(!t||!(r=br(r)))return t;var w=or(t),E=Jo(w,or(r))+1;return Tn(w,0,E).join("")}function by(t,r,i){if(t=ct(t),t&&(i||r===a))return t.replace(la,"");if(!t||!(r=br(r)))return t;var w=or(t),E=Qo(w,or(r));return Tn(w,E).join("")}function vy(t,r){var i=q,w=B;if(Mt(r)){var E="separator"in r?r.separator:E;i="length"in r?We(r.length):i,w="omission"in r?br(r.omission):w}t=ct(t);var N=t.length;if(wn(t)){var P=or(t);N=P.length}if(i>=N)return t;var z=i-yn(w);if(z<1)return w;var K=P?Tn(P,0,z).join(""):t.slice(0,z);if(E===a)return K+w;if(P&&(z+=K.length-z),Yc(E)){if(t.slice(z).search(E)){var ce,ue=K;for(E.global||(E=Aa(E.source,ct(ps.exec(E))+"g")),E.lastIndex=0;ce=E.exec(ue);)var de=ce.index;K=K.slice(0,de===a?z:de)}}else if(t.indexOf(br(E),z)!=z){var ve=K.lastIndexOf(E);ve>-1&&(K=K.slice(0,ve))}return K+w}function wy(t){return t=ct(t),t&&ra.test(t)?t.replace(mn,Vl):t}var yy=$s(function(t,r,i){return t+(i?" ":"")+r.toUpperCase()}),Kc=np("toUpperCase");function th(t,r,i){return t=ct(t),r=i?a:r,r===a?Yl(t)?ec(t):Pl(t):t.match(r)||[]}var rh=Ge(function(t,r){try{return Jt(t,a,r)}catch(i){return qc(i)?i:new Pe(i)}}),_y=en(function(t,r){return er(r,function(i){i=qr(i),Qr(t,i,Bc(t[i],t))}),t});function ky(t){var r=t==null?0:t.length,i=Oe();return t=r?mt(t,function(w){if(typeof w[1]!="function")throw new tr(y);return[i(w[0]),w[1]]}):[],Ge(function(w){for(var E=-1;++E<r;){var N=t[E];if(Jt(N[0],this,w))return Jt(N[1],this,w)}})}function My(t){return Kx(jr(t,p))}function Zc(t){return function(){return t}}function jy(t,r){return t==null||t!==t?r:t}var Ey=ap(),Ty=ap(!0);function fr(t){return t}function Vc(t){return Od(typeof t=="function"?t:jr(t,p))}function Sy(t){return Ld(jr(t,p))}function Ny(t,r){return Pd(t,jr(r,p))}var Ay=Ge(function(t,r){return function(i){return Oa(i,t,r)}}),Iy=Ge(function(t,r){return function(i){return Oa(t,i,r)}});function Qc(t,r,i){var w=zt(r),E=pi(r,w);i==null&&!(Mt(r)&&(E.length||!w.length))&&(i=r,r=t,t=this,E=pi(r,zt(r)));var N=!(Mt(i)&&"chain"in i)||!!i.chain,P=rn(t);return er(E,function(z){var K=r[z];t[z]=K,P&&(t.prototype[z]=function(){var ce=this.__chain__;if(N||ce){var ue=t(this.__wrapped__),de=ue.__actions__=lr(this.__actions__);return de.push({func:K,args:arguments,thisArg:t}),ue.__chain__=ce,ue}return K.apply(t,Cr([this.value()],arguments))})}),t}function Cy(){return Pt._===this&&(Pt._=sc),this}function Jc(){}function Dy(t){return t=We(t),Ge(function(r){return Fd(r,t)})}var Ry=Ac(mt),Oy=Ac(_a),$y=Ac(ka);function nh(t){return Lc(t)?Ma(qr(t)):db(t)}function Ly(t){return function(r){return t==null?a:Gn(t,r)}}var Py=ip(),Fy=ip(!0);function eu(){return[]}function tu(){return!1}function Uy(){return{}}function zy(){return""}function Hy(){return!0}function By(t,r){if(t=We(t),t<1||t>be)return[];var i=he,w=Ut(t,he);r=Oe(r),t-=he;for(var E=Ta(w,r);++i<t;)r(i);return E}function Wy(t){return He(t)?mt(t,qr):vr(t)?[t]:lr(kp(ct(t)))}function qy(t){var r=++nc;return ct(t)+r}var Yy=vi(function(t,r){return t+r},0),Gy=Ic("ceil"),Xy=vi(function(t,r){return t/r},1),Ky=Ic("floor");function Zy(t){return t&&t.length?di(t,fr,gc):a}function Vy(t,r){return t&&t.length?di(t,Oe(r,2),gc):a}function Qy(t){return Ko(t,fr)}function Jy(t,r){return Ko(t,Oe(r,2))}function e_(t){return t&&t.length?di(t,fr,wc):a}function t_(t,r){return t&&t.length?di(t,Oe(r,2),wc):a}var r_=vi(function(t,r){return t*r},1),n_=Ic("round"),s_=vi(function(t,r){return t-r},0);function a_(t){return t&&t.length?Ea(t,fr):0}function o_(t,r){return t&&t.length?Ea(t,Oe(r,2)):0}return S.after=Sw,S.ary=Rp,S.assign=m1,S.assignIn=Xp,S.assignInWith=Ci,S.assignWith=g1,S.at=x1,S.before=Op,S.bind=Bc,S.bindAll=_y,S.bindKey=$p,S.castArray=Uw,S.chain=Ip,S.chunk=Kb,S.compact=Zb,S.concat=Vb,S.cond=ky,S.conforms=My,S.constant=Zc,S.countBy=aw,S.create=b1,S.curry=Lp,S.curryRight=Pp,S.debounce=Fp,S.defaults=v1,S.defaultsDeep=w1,S.defer=Nw,S.delay=Aw,S.difference=Qb,S.differenceBy=Jb,S.differenceWith=ev,S.drop=tv,S.dropRight=rv,S.dropRightWhile=nv,S.dropWhile=sv,S.fill=av,S.filter=iw,S.flatMap=uw,S.flatMapDeep=fw,S.flatMapDepth=dw,S.flatten=Tp,S.flattenDeep=ov,S.flattenDepth=iv,S.flip=Iw,S.flow=Ey,S.flowRight=Ty,S.fromPairs=lv,S.functions=T1,S.functionsIn=S1,S.groupBy=pw,S.initial=uv,S.intersection=fv,S.intersectionBy=dv,S.intersectionWith=pv,S.invert=A1,S.invertBy=I1,S.invokeMap=mw,S.iteratee=Vc,S.keyBy=gw,S.keys=zt,S.keysIn=ur,S.map=Ei,S.mapKeys=D1,S.mapValues=R1,S.matches=Sy,S.matchesProperty=Ny,S.memoize=Si,S.merge=O1,S.mergeWith=Kp,S.method=Ay,S.methodOf=Iy,S.mixin=Qc,S.negate=Ni,S.nthArg=Dy,S.omit=$1,S.omitBy=L1,S.once=Cw,S.orderBy=xw,S.over=Ry,S.overArgs=Dw,S.overEvery=Oy,S.overSome=$y,S.partial=Wc,S.partialRight=Up,S.partition=bw,S.pick=P1,S.pickBy=Zp,S.property=nh,S.propertyOf=Ly,S.pull=xv,S.pullAll=Np,S.pullAllBy=bv,S.pullAllWith=vv,S.pullAt=wv,S.range=Py,S.rangeRight=Fy,S.rearg=Rw,S.reject=yw,S.remove=yv,S.rest=Ow,S.reverse=zc,S.sampleSize=kw,S.set=U1,S.setWith=z1,S.shuffle=Mw,S.slice=_v,S.sortBy=Tw,S.sortedUniq=Nv,S.sortedUniqBy=Av,S.split=uy,S.spread=$w,S.tail=Iv,S.take=Cv,S.takeRight=Dv,S.takeRightWhile=Rv,S.takeWhile=Ov,S.tap=Zv,S.throttle=Lw,S.thru=ji,S.toArray=qp,S.toPairs=Vp,S.toPairsIn=Qp,S.toPath=Wy,S.toPlainObject=Gp,S.transform=H1,S.unary=Pw,S.union=$v,S.unionBy=Lv,S.unionWith=Pv,S.uniq=Fv,S.uniqBy=Uv,S.uniqWith=zv,S.unset=B1,S.unzip=Hc,S.unzipWith=Ap,S.update=W1,S.updateWith=q1,S.values=Fs,S.valuesIn=Y1,S.without=Hv,S.words=th,S.wrap=Fw,S.xor=Bv,S.xorBy=Wv,S.xorWith=qv,S.zip=Yv,S.zipObject=Gv,S.zipObjectDeep=Xv,S.zipWith=Kv,S.entries=Vp,S.entriesIn=Qp,S.extend=Xp,S.extendWith=Ci,Qc(S,S),S.add=Yy,S.attempt=rh,S.camelCase=Z1,S.capitalize=Jp,S.ceil=Gy,S.clamp=G1,S.clone=zw,S.cloneDeep=Bw,S.cloneDeepWith=Ww,S.cloneWith=Hw,S.conformsTo=qw,S.deburr=eh,S.defaultTo=jy,S.divide=Xy,S.endsWith=V1,S.eq=Rr,S.escape=Q1,S.escapeRegExp=J1,S.every=ow,S.find=lw,S.findIndex=jp,S.findKey=y1,S.findLast=cw,S.findLastIndex=Ep,S.findLastKey=_1,S.floor=Ky,S.forEach=Cp,S.forEachRight=Dp,S.forIn=k1,S.forInRight=M1,S.forOwn=j1,S.forOwnRight=E1,S.get=Gc,S.gt=Yw,S.gte=Gw,S.has=N1,S.hasIn=Xc,S.head=Sp,S.identity=fr,S.includes=hw,S.indexOf=cv,S.inRange=X1,S.invoke=C1,S.isArguments=Zn,S.isArray=He,S.isArrayBuffer=Xw,S.isArrayLike=cr,S.isArrayLikeObject=Dt,S.isBoolean=Kw,S.isBuffer=Sn,S.isDate=Zw,S.isElement=Vw,S.isEmpty=Qw,S.isEqual=Jw,S.isEqualWith=e1,S.isError=qc,S.isFinite=t1,S.isFunction=rn,S.isInteger=zp,S.isLength=Ai,S.isMap=Hp,S.isMatch=r1,S.isMatchWith=n1,S.isNaN=s1,S.isNative=a1,S.isNil=i1,S.isNull=o1,S.isNumber=Bp,S.isObject=Mt,S.isObjectLike=Tt,S.isPlainObject=za,S.isRegExp=Yc,S.isSafeInteger=l1,S.isSet=Wp,S.isString=Ii,S.isSymbol=vr,S.isTypedArray=Ps,S.isUndefined=c1,S.isWeakMap=u1,S.isWeakSet=f1,S.join=hv,S.kebabCase=ey,S.last=Tr,S.lastIndexOf=mv,S.lowerCase=ty,S.lowerFirst=ry,S.lt=d1,S.lte=p1,S.max=Zy,S.maxBy=Vy,S.mean=Qy,S.meanBy=Jy,S.min=e_,S.minBy=t_,S.stubArray=eu,S.stubFalse=tu,S.stubObject=Uy,S.stubString=zy,S.stubTrue=Hy,S.multiply=r_,S.nth=gv,S.noConflict=Cy,S.noop=Jc,S.now=Ti,S.pad=ny,S.padEnd=sy,S.padStart=ay,S.parseInt=oy,S.random=K1,S.reduce=vw,S.reduceRight=ww,S.repeat=iy,S.replace=ly,S.result=F1,S.round=n_,S.runInContext=G,S.sample=_w,S.size=jw,S.snakeCase=cy,S.some=Ew,S.sortedIndex=kv,S.sortedIndexBy=Mv,S.sortedIndexOf=jv,S.sortedLastIndex=Ev,S.sortedLastIndexBy=Tv,S.sortedLastIndexOf=Sv,S.startCase=fy,S.startsWith=dy,S.subtract=s_,S.sum=a_,S.sumBy=o_,S.template=py,S.times=By,S.toFinite=nn,S.toInteger=We,S.toLength=Yp,S.toLower=hy,S.toNumber=Sr,S.toSafeInteger=h1,S.toString=ct,S.toUpper=my,S.trim=gy,S.trimEnd=xy,S.trimStart=by,S.truncate=vy,S.unescape=wy,S.uniqueId=qy,S.upperCase=yy,S.upperFirst=Kc,S.each=Cp,S.eachRight=Dp,S.first=Sp,Qc(S,(function(){var t={};return Br(S,function(r,i){it.call(S.prototype,i)||(t[i]=r)}),t})(),{chain:!1}),S.VERSION=o,er(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){S[t].placeholder=S}),er(["drop","take"],function(t,r){Ke.prototype[t]=function(i){i=i===a?1:Ct(We(i),0);var w=this.__filtered__&&!r?new Ke(this):this.clone();return w.__filtered__?w.__takeCount__=Ut(i,w.__takeCount__):w.__views__.push({size:Ut(i,he),type:t+(w.__dir__<0?"Right":"")}),w},Ke.prototype[t+"Right"]=function(i){return this.reverse()[t](i).reverse()}}),er(["filter","map","takeWhile"],function(t,r){var i=r+1,w=i==ee||i==Q;Ke.prototype[t]=function(E){var N=this.clone();return N.__iteratees__.push({iteratee:Oe(E,3),type:i}),N.__filtered__=N.__filtered__||w,N}}),er(["head","last"],function(t,r){var i="take"+(r?"Right":"");Ke.prototype[t]=function(){return this[i](1).value()[0]}}),er(["initial","tail"],function(t,r){var i="drop"+(r?"":"Right");Ke.prototype[t]=function(){return this.__filtered__?new Ke(this):this[i](1)}}),Ke.prototype.compact=function(){return this.filter(fr)},Ke.prototype.find=function(t){return this.filter(t).head()},Ke.prototype.findLast=function(t){return this.reverse().find(t)},Ke.prototype.invokeMap=Ge(function(t,r){return typeof t=="function"?new Ke(this):this.map(function(i){return Oa(i,t,r)})}),Ke.prototype.reject=function(t){return this.filter(Ni(Oe(t)))},Ke.prototype.slice=function(t,r){t=We(t);var i=this;return i.__filtered__&&(t>0||r<0)?new Ke(i):(t<0?i=i.takeRight(-t):t&&(i=i.drop(t)),r!==a&&(r=We(r),i=r<0?i.dropRight(-r):i.take(r-t)),i)},Ke.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Ke.prototype.toArray=function(){return this.take(he)},Br(Ke.prototype,function(t,r){var i=/^(?:filter|find|map|reject)|While$/.test(r),w=/^(?:head|last)$/.test(r),E=S[w?"take"+(r=="last"?"Right":""):r],N=w||/^find/.test(r);E&&(S.prototype[r]=function(){var P=this.__wrapped__,z=w?[1]:arguments,K=P instanceof Ke,ce=z[0],ue=K||He(P),de=function(Ze){var Ve=E.apply(S,Cr([Ze],z));return w&&ve?Ve[0]:Ve};ue&&i&&typeof ce=="function"&&ce.length!=1&&(K=ue=!1);var ve=this.__chain__,Se=!!this.__actions__.length,$e=N&&!ve,Ye=K&&!Se;if(!N&&ue){P=Ye?P:new Ke(this);var Le=t.apply(P,z);return Le.__actions__.push({func:ji,args:[de],thisArg:a}),new $t(Le,ve)}return $e&&Ye?t.apply(this,z):(Le=this.thru(de),$e?w?Le.value()[0]:Le.value():Le)})}),er(["pop","push","shift","sort","splice","unshift"],function(t){var r=Ms[t],i=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",w=/^(?:pop|shift)$/.test(t);S.prototype[t]=function(){var E=arguments;if(w&&!this.__chain__){var N=this.value();return r.apply(He(N)?N:[],E)}return this[i](function(P){return r.apply(He(P)?P:[],E)})}}),Br(Ke.prototype,function(t,r){var i=S[r];if(i){var w=i.name+"";it.call(me,w)||(me[w]=[]),me[w].push({name:r,func:i})}}),me[bi(a,T).name]=[{name:"wrapper",func:a}],Ke.prototype.clone=Ca,Ke.prototype.reverse=Bn,Ke.prototype.value=_x,S.prototype.at=Vv,S.prototype.chain=Qv,S.prototype.commit=Jv,S.prototype.next=ew,S.prototype.plant=rw,S.prototype.reverse=nw,S.prototype.toJSON=S.prototype.valueOf=S.prototype.value=sw,S.prototype.first=S.prototype.head,zn&&(S.prototype[zn]=tw),S}),_n=ri();Qt?((Qt.exports=_n)._=_n,bn._=_n):Pt._=_n}).call(H5)})(Ga,Ga.exports)),Ga.exports}var Ui={exports:{}},bf,mg;function B5(){if(mg)return bf;mg=1;var e=1e3,n=e*60,a=n*60,o=a*24,c=o*7,m=o*365.25;bf=function(u,p){p=p||{};var x=typeof u;if(x==="string"&&u.length>0)return y(u);if(x==="number"&&isFinite(u))return p.long?l(u):h(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function y(u){if(u=String(u),!(u.length>100)){var p=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(u);if(p){var x=parseFloat(p[1]),v=(p[2]||"ms").toLowerCase();switch(v){case"years":case"year":case"yrs":case"yr":case"y":return x*m;case"weeks":case"week":case"w":return x*c;case"days":case"day":case"d":return x*o;case"hours":case"hour":case"hrs":case"hr":case"h":return x*a;case"minutes":case"minute":case"mins":case"min":case"m":return x*n;case"seconds":case"second":case"secs":case"sec":case"s":return x*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return x;default:return}}}}function h(u){var p=Math.abs(u);return p>=o?Math.round(u/o)+"d":p>=a?Math.round(u/a)+"h":p>=n?Math.round(u/n)+"m":p>=e?Math.round(u/e)+"s":u+"ms"}function l(u){var p=Math.abs(u);return p>=o?f(u,p,o,"day"):p>=a?f(u,p,a,"hour"):p>=n?f(u,p,n,"minute"):p>=e?f(u,p,e,"second"):u+" ms"}function f(u,p,x,v){var _=p>=x*1.5;return Math.round(u/x)+" "+v+(_?"s":"")}return bf}var vf,gg;function W5(){if(gg)return vf;gg=1;function e(n){o.debug=o,o.default=o,o.coerce=f,o.disable=h,o.enable=m,o.enabled=l,o.humanize=B5(),o.destroy=u,Object.keys(n).forEach(p=>{o[p]=n[p]}),o.names=[],o.skips=[],o.formatters={};function a(p){let x=0;for(let v=0;v<p.length;v++)x=(x<<5)-x+p.charCodeAt(v),x|=0;return o.colors[Math.abs(x)%o.colors.length]}o.selectColor=a;function o(p){let x,v=null,_,k;function M(...T){if(!M.enabled)return;const A=M,C=Number(new Date),O=C-(x||C);A.diff=O,A.prev=x,A.curr=C,x=C,T[0]=o.coerce(T[0]),typeof T[0]!="string"&&T.unshift("%O");let $=0;T[0]=T[0].replace(/%([a-zA-Z%])/g,(R,Z)=>{if(R==="%%")return"%";$++;const X=o.formatters[Z];if(typeof X=="function"){const q=T[$];R=X.call(A,q),T.splice($,1),$--}return R}),o.formatArgs.call(A,T),(A.log||o.log).apply(A,T)}return M.namespace=p,M.useColors=o.useColors(),M.color=o.selectColor(p),M.extend=c,M.destroy=o.destroy,Object.defineProperty(M,"enabled",{enumerable:!0,configurable:!1,get:()=>v!==null?v:(_!==o.namespaces&&(_=o.namespaces,k=o.enabled(p)),k),set:T=>{v=T}}),typeof o.init=="function"&&o.init(M),M}function c(p,x){const v=o(this.namespace+(typeof x>"u"?":":x)+p);return v.log=this.log,v}function m(p){o.save(p),o.namespaces=p,o.names=[],o.skips=[];const x=(typeof p=="string"?p:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const v of x)v[0]==="-"?o.skips.push(v.slice(1)):o.names.push(v)}function y(p,x){let v=0,_=0,k=-1,M=0;for(;v<p.length;)if(_<x.length&&(x[_]===p[v]||x[_]==="*"))x[_]==="*"?(k=_,M=v,_++):(v++,_++);else if(k!==-1)_=k+1,M++,v=M;else return!1;for(;_<x.length&&x[_]==="*";)_++;return _===x.length}function h(){const p=[...o.names,...o.skips.map(x=>"-"+x)].join(",");return o.enable(""),p}function l(p){for(const x of o.skips)if(y(p,x))return!1;for(const x of o.names)if(y(p,x))return!0;return!1}function f(p){return p instanceof Error?p.stack||p.message:p}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return o.enable(o.load()),o}return vf=e,vf}var xg;function bg(){return xg||(xg=1,(function(e,n){n.formatArgs=o,n.save=c,n.load=m,n.useColors=a,n.storage=y(),n.destroy=(()=>{let l=!1;return()=>{l||(l=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),n.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function a(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let l;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(l=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(l[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function o(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const f="color: "+this.color;l.splice(1,0,f,"color: inherit");let u=0,p=0;l[0].replace(/%[a-zA-Z%]/g,x=>{x!=="%%"&&(u++,x==="%c"&&(p=u))}),l.splice(p,0,f)}n.log=console.debug||console.log||(()=>{});function c(l){try{l?n.storage.setItem("debug",l):n.storage.removeItem("debug")}catch{}}function m(){let l;try{l=n.storage.getItem("debug")||n.storage.getItem("DEBUG")}catch{}return!l&&typeof process<"u"&&"env"in process&&(l=!1),l}function y(){try{return localStorage}catch{}}e.exports=W5()(n);const{formatters:h}=e.exports;h.j=function(l){try{return JSON.stringify(l)}catch(f){return"[UnexpectedJSONParseError]: "+f.message}}})(Ui,Ui.exports)),Ui.exports}var wf,vg;function q5(){if(vg)return wf;vg=1;const e=yd(),n=bg()("mongo-knex:converter"),a=bg()("mongo-knex:converter-extended"),o=["$and","$or"],c={$eq:"=",$ne:"!=",$gt:">",$gte:">=",$lt:"<",$lte:"<=",$in:"in",$nin:"not in",$regex:"like",$not:"not like"},m="*",y=_=>_.charAt(0)==="$",h=_=>y(_)&&e.includes(o,_),l=_=>y(_)&&e.includes(e.keys(c),_),f=_=>y(_)&&e.includes(["$ne","$nin"],_),u=_=>e.includes([c.$in,c.$nin],_),p=_=>JSON.stringify(_,function(k,M){return M instanceof RegExp?M.toString():M}),x=({source:_,ignoreCase:k})=>(_=_.replace(/\\([.*+?^${}()|[\]\\/])/g,"$1"),k&&(_=_.toLowerCase()),_=_.replace(new RegExp(e.escapeRegExp(m),"g"),m+m),_=_.replace(/%/g,m+"%"),_=_.replace(/_/g,m+"_"),_.startsWith("^")?_=_.substring(1)+"%":_.endsWith("$")?_="%"+_.substring(0,_.length-1):_="%"+_+"%",{source:_,ignoreCase:k});class v{constructor(k={},M={}){this.tableName=k.tableName,this.cte=M.cte,this.config={},Object.assign(this.config,{relations:{}},M)}processWhereType(k,M,T){return T===null?(k==="$or"?"orWhere":"where")+(M==="$ne"?"NotNull":"Null"):k==="$or"?"orWhere":"andWhere"}processStatement(k,M,T){const[A,C]=k.split(".");if(C){n(A,C);const O=A;let $=this.config.relations[O];return $?{table:A,column:C,operator:M,value:T,config:$,isRelation:!0}:($=e.find(this.config.relations,W=>W.joinTable===O),$?{joinTable:$.joinTable,table:$.tableName,column:C,operator:M,value:T,config:$,isRelation:!0}:{column:k,operator:M,value:T,isRelation:!1})}return{column:this.cte&&this.cte===!0?`${k}`:`${this.tableName}.${k}`,operator:M,value:T,isRelation:!1}}groupRelationStatements(k,M){const T={},A=M==="$and"?k.filter(C=>!C.joinTable):k;if(e.each(A,(C,O)=>{let $=f(C.operator);!$&&T[C.table]&&($=e.find(T[C.table].innerWhereStatements,R=>{if(R.column===C.column)return!0}));let W=C.table;if($&&(W=`${C.table}_${O})}`,T[W]))throw new Error("Key collision detected");T[W]||(T[W]={},T[W].innerWhereStatements=[]),T[W].innerWhereStatements.push(C)}),M==="$and"){const C=k.filter(O=>O.joinTable);e.each(Object.keys(T),O=>{T[O].joinFilterStatements=C})}return T}buildRelationQuery(k,M,T){n("(buildRelationQuery)"),a.enabled&&a(`(buildRelationQuery) ${p(M)}`);const A=this.groupRelationStatements(M,T);a.enabled&&a(`(buildRelationQuery) grouped: ${p(A)}`),e.each(Object.keys(A),C=>{n(`(buildRelationQuery) build relation for ${C}`);const O=A[C].innerWhereStatements,$=O[0];if($.config.type==="manyToMany")if(e.every(O.map(W=>W.operator),l)){const W=e.every(O.map(X=>X.operator),X=>f(X)),R=W?c.$nin:c.$in,Z=["whereNull","whereNotNull"].includes($.whereType)?"andWhere":["orWhereNull","orWhereNotNull"].includes($.whereType)?"orWhere":$.whereType;k[Z](`${this.tableName}.id`,R,function(){const X=A[C].joinFilterStatements;let q=$.config.tableName,B=`${$.config.tableName}.${$.config.joinToForeign||"id"}`;$.config.tableNameAs&&(q=`${$.config.tableName} as ${$.config.tableNameAs}`,B=`${$.config.tableNameAs}.${$.config.joinToForeign||"id"}`);const Y=$.config.joinType||"innerJoin",ae=this.select(`${$.config.joinTable}.${$.config.joinFrom}`).from(`${$.config.joinTable}`)[Y](q,function(){this.on(B,"=",`${$.config.joinTable}.${$.config.joinTo}`),e.each(X,ee=>{this.andOn(`${ee.joinTable}.${ee.column}`,c[ee.operator],ee.value)})});return a.enabled&&n(`(buildRelationQuery) innerQB sql-pre: ${ae.toSQL().sql}`),e.each(O,(ee,re)=>{n(`(buildRelationQuery) build relation where statements for ${re}`);const Q=`${ee.joinTable||ee.table}.${ee.column}`;let ne;W?ne=c.$in:f(ee.operator)?ne=c.$nin:ne=c[ee.operator];let be=ee.value;u(ne)&&(be=e.isArray(ee.value)?ee.value:[ee.value]),ae[ee.whereType](Q,ne,be)}),a.enabled&&n(`(buildRelationQuery) innerQB sql-post: ${ae.toSQL().sql}`),ae})}else n(`one of ${C} group statements contains unknown operator`);else if($.config.type==="oneToOne")if(e.every(O.map(W=>W.operator),l)){const W=e.every(O.map(q=>q.operator),q=>f(q)),R=W?c.$nin:c.$in,Z=this.tableName,X=$.whereType==="orWhere"?"orWhere":"where";k[X](`${this.tableName}.id`,R,function(){const q=A[C].joinFilterStatements;let B=$.config.tableName,Y=`${$.config.tableName}.${$.config.joinFrom}`;$.config.tableNameAs&&(B=`${$.config.tableName} as ${$.config.tableNameAs}`,Y=`${$.config.tableNameAs}.${$.config.joinFrom}`);const ae=this.select(`${Z}.id`).from(`${Z}`).leftJoin(B,function(){this.on(Y,"=",`${Z}.id`),e.each(q,ee=>{this.andOn(`${ee.joinTable}.${ee.column}`,c[ee.operator],ee.value)})});return e.each(O,(ee,re)=>{n(`(buildRelationQuery) build relation where statements for ${re}`);const Q=`${ee.table}.${ee.column}`;let ne;W?(ne=c.$in,ee.value===null&&(ee.whereType=ee.whereType==="whereNotNull"?"whereNull":"whereNotNull")):f(ee.operator)?ne=c.$nin:ne=c[ee.operator];let be=ee.value;u(ne)&&(be=e.isArray(ee.value)?ee.value:[ee.value]),ae[ee.whereType](Q,ne,be)}),a.enabled&&n(`(buildRelationQuery) innerQB sql-pre: ${ae.toSQL().sql}`),ae})}else n(`one of ${C} group statements contains unknown operator`)})}buildComparison(k,M,T,A,C,O){const $=c[A]||"=",W=this.processStatement(T,A,C);let R=this.processWhereType(M,A,C);if(n(`(buildComparison) mode: ${M}, op: ${A}, isRelation: ${W.isRelation}, group: ${O}`),W.isRelation){if(W.whereType=R,!O){this.buildRelationQuery(k,[W],M);return}Object.prototype.hasOwnProperty.call(k,"relations")||(k.relations=[]),k.relations.push(W);return}const Z=W.column;if(A=W.operator,C=W.value,A==="$regex"||A==="$not"){const{source:X,ignoreCase:q}=x(C);if(C=X,q){R+="Raw",n(`(buildComparison) whereType: ${R}, statement: ${T}, op: ${A}, comp: ${$}, value: ${C} (REGEX/i)`),k[R](`lower(??) ${$} ? ESCAPE ?`,[Z,C,m]);return}R+="Raw",n(`(buildComparison) whereType: ${R}, statement: ${T}, op: ${A}, comp: ${$}, value: ${C} (REGEX)`),k[R](`?? ${$} ? ESCAPE ?`,[Z,C,m]);return}n(`(buildComparison) whereType: ${R}, statement: ${T}, op: ${A}, comp: ${$}, value: ${C}`),k[R](Z,$,C)}buildWhereClause(k,M,T,A,C){if(n(`(buildWhereClause) mode: ${M}, statement: ${T}`),a.enabled&&a(`(buildWhereClause) ${p(A)}`),!e.isObject(A))return this.buildComparison(k,M,T,"$eq",A,C);e.forIn(A,(O,$)=>{l($)?this.buildComparison(k,M,T,$,O,C):n("unknown operator")})}buildWhereGroup(k,M,T,A){const C=this.processWhereType(M);n(`(buildWhereGroup) mode: ${T}, whereType: ${C}`),a.enabled&&a(`(buildWhereGroup) ${p(A)}`),k[C](O=>{e.isArray(A)?A.forEach($=>this.buildQuery(O,T,$,!0)):e.isObject(A)&&this.buildQuery(O,T,A,!0),Object.prototype.hasOwnProperty.call(O,"relations")&&(this.buildRelationQuery(O,O.relations,T),delete O.relations)})}buildQuery(k,M,T,A){n(`(buildQuery) mode: ${M}`),a.enabled&&a(`(buildQuery) ${p(T)}`),e.forIn(T,(C,O)=>{n(`(buildQuery) key: ${O}`),h(O)?this.buildWhereGroup(k,M,O,C):this.buildWhereClause(k,M,O,C,A)})}processJSON(k,M){n("(processJSON)"),a.enabled&&a(`(processJSON) ${p(M)}`),this.buildQuery(k,"$and",M)}}return wf=function(k,M,T){return new v({tableName:k._single.table},T).processJSON(k,M),k},wf}var yf,wg;function Y5(){return wg||(wg=1,yf=q5()),yf}var _f,yg;function G5(){if(yg)return _f;yg=1;const e=yd(),n=["$and","$or"],a=(M,T)=>Array.isArray(M)?M.map(A=>a(A,T)).filter(A=>!e.isEmpty(A)):e.reduce(M,(A,C,O)=>{let $;if(n.includes(O)){const W=a(C,T);$=e.isEmpty(W)?null:{[O]:W}}else O==="yg"?$={[O]:a(C,T)}:$=T(C,O);return e.assign({},A,$)},{}),o=(M,T)=>e.isEmpty(M)?T:e.isEmpty(T)?M:{$and:[M,T]},c=(M,T)=>e.some(M,(A,C,O)=>C==="$and"?c(O.$and,T):C==="$or"?c(O.$or,T):C!==T&&e.isObject(A)?c(A,T):C===T),m=(M,T)=>M&&a(M,function(A,C){if(!T(C))return{[C]:A}}),y=(...M)=>{let T={};return M.filter(A=>!!A).forEach(A=>{A&&Object.keys(A).length>0&&(A=m(A,C=>c(T,C)),A&&(T=Object.keys(T).length>0?o(T,A):A))}),T},h=(M,T)=>{const A=(C,O)=>O.$and?{$and:[C,...O.$and]}:{$and:[C,O]};return a(M,function(C,O){const $=e.find(T,{key:O});if(!$)return{[O]:C};let W={[$.replacement]:C};return $.expansion?A(W,$.expansion):W})};function l(M,T){const A=T.find(({from:C})=>C===M);return A?A.to:M}function f(M,T){return Array.isArray(M)?M.map(T):T(M)}function u(M){return function(A){return a(A,function(C,O){return O!==M.key.from?{[O]:C}:typeof C!="object"?{[M.key.to]:l(C,M.values)}:{[M.key.to]:e.reduce(C,($,W,R)=>Object.assign($,{[R]:f(W,Z=>l(Z,M.values))}),{})}})}}const p=(M,T)=>a(M,function(A,C){return Object.keys(T).includes(C)?T[C]??{}:{[C]:A}});function x(...M){return function(T){for(const A of M)T=A(T);return T}}function v(M){if(!M)return[];const T=[];if(M.$and)for(const A of M.$and)for(const C of v(A))T.includes(C)||T.push(C);else if(M.$or)for(const A of M.$or)for(const C of v(A))T.includes(C)||T.push(C);else M.yg?T.push(...v(M.yg)):T.push(...Object.keys(M));return T}function _(M,T){let A,C;if(typeof M!="object")return[A,C];if(M.$and){for(const O of M.$and){const $=v(O);let W=!1;for(const R of $)if(T.includes(R))W=!0;else if(W)throw new Error(`This filter is not supported because you cannot combine ${T.join(", ")} filters with other filters except at the root level in an AND.`);W?A?A.$and.push(O):A={$and:[O]}:C?C.$and.push(O):C={$and:[O]}}A&&A.$and.length===1&&(A=A.$and[0]),C&&C.$and.length===1&&(C=C.$and[0])}else if(M.$or){let O=!1;for(const $ of M.$or){const W=v($);for(const R of W)if(T.includes(R)){O=!0;continue}else if(O)throw new Error(`This filter is not supported because you cannot combine ${T.join(", ")} filters with other filters in an OR.`)}O?A=M:C=M}else{if(M.yg)return this.splitFilter(M.yg,T);{const O=Object.keys(M);for(const $ of O)T.includes($)?A?A[$]=M[$]:A={[$]:M[$]}:C?C[$]=M[$]:C={[$]:M[$]}}}return[A,C]}function k(M){const T=[];for(const A of Object.keys(M))M[A]&&T.push({key:{from:A,to:M[A]},values:[]});return T.map(A=>u(A))}return _f={mapKeyValues:u,combineFilters:o,findStatement:c,rejectStatements:m,mergeFilters:y,expandFilters:h,mapQuery:a,replaceFilters:p,chainTransformers:x,getUsedKeys:v,splitFilter:_,mapKeys:k},_f}var kf,_g;function Wf(){return _g||(_g=1,kf=G5()),kf}var Mf,kg;function X5(){if(kg)return Mf;kg=1;const e=Wf(),n=xx(),a=yd(),o=y=>!y||Object.keys(y).length===0?y:y.map(h=>{const l=Object.assign({},h);return l.expansion&&(l.expansion=n.parse(h.expansion)),l}),c=(y,h)=>{const l=o(h);return e.expandFilters(y,l)},m=y=>{if(!y.$and||!e.findStatement(y,"$ne"))return y;const h=y.$and,l=h.filter(p=>e.findStatement(p,"$ne")),f=a.groupBy(l,p=>Object.keys(p)[0]);Object.keys(f).filter(p=>f[p].length>1).forEach(p=>{const x=f[p].map(v=>v[p].$ne).filter(v=>v!==void 0);x.length!==0&&(y[p]={$nin:x},f[p].forEach(v=>{const _=h.indexOf(v);_>-1&&h.splice(_,1)}))}),h.length===0&&delete y.$and;for(const p in y)p==="$and"&&(y[p]=y[p].map(m));return y};return Mf={mergeFilters:e.mergeFilters,parseExpansions:o,expandFilters:c,combineNeFilters:m},Mf}var Mg;function K5(){if(Mg)return $i.exports;Mg=1;const e=Yj(),n=xx(),a=Y5(),o=X5();return $i.exports=(c,m={})=>{const y={};return y.lex=()=>n.lex(c),y.parse=function(){!this.filter&&c&&(this.filter=n.parse(c),m.transformer&&(this.filter=m.transformer(this.filter)));let h,l;m.overrides&&(h=n.parse(m.overrides)),m.defaults&&(l=n.parse(m.defaults));let f=o.mergeFilters(h,this.filter,l);return f=o.combineNeFilters(f),m.expansions&&(f=o.expandFilters(f,m.expansions)),f},y.queryJSON=function(h){return this.query=this.query||new e.Query(y.parse()),this.query.test(h)},y.querySQL=h=>a(h,y.parse(),m),y.toString=()=>c,y.toJSON=y.parse,y},$i.exports.utils={mapQuery:Wf().mapQuery,mapKeyValues:Wf().mapKeyValues},$i.exports}var jf,jg;function Z5(){return jg||(jg=1,jf=K5()),jf}var V5=Z5();const Q5=Pg(V5);function bx(e,n){return e.visibility?Q5(e.visibility).queryJSON(n):!0}function J5({description:e,accentColor:n,icon:a,logo:o,coverImage:c,themeSettings:m,bodyFont:y,headingFont:h}){if(!m)return;const l=m.reduce((p,{key:x,value:v})=>({...p,[x]:v}),{}),f=new URLSearchParams;f.append("c",n),f.append("d",e),f.append("icon",a),f.append("logo",o),f.append("cover",c),f.append("bf",y),f.append("hf",h);const u={};return m.forEach(p=>{u[p.key]=bx(p,l)?p.value:o2}),f.append("custom",JSON.stringify(u)),f.toString()}const eE=({settings:e,url:n})=>{const a=J5({...e}),o=D.useCallback(c=>{!n||!a||fetch(n,{method:"POST",headers:{"Content-Type":"text/html;charset=utf-8","x-ghost-preview":a,Accept:"text/plain"},mode:"cors",credentials:"include"}).then(m=>m.text()).then(m=>{const y="html { pointer-events: none; }",l=new DOMParser().parseFromString(m,"text/html"),f=l.querySelector("style"),u=f?.innerHTML;u?f.innerHTML=`${u}
|
|
68
|
-
|
|
69
|
-
${y}`:l.head.innerHTML+=`<style>${y}</style>`;let x=(l.doctype?new XMLSerializer().serializeToString(l.doctype):"")+l.documentElement.outerHTML;c.contentDocument?.open(),c.contentDocument?.write(x),c.contentDocument?.close()})},[a,n]);return s.jsx(pd,{addDelay:!1,className:"absolute size-[110%] origin-top-left scale-[.90909] bg-white max-[1600px]:size-[130%] max-[1600px]:scale-[.76923]",generateContent:o,height:"100%",parentClassName:"relative h-full w-full",testId:"theme-preview",width:"100%"})},tE=({setting:e,setSetting:n})=>{const[a,o]=D.useState({});D.useEffect(()=>{const f=e.value===null?"":String(e.value);o(u=>({...u,[e.key]:f}))},[e]);const c=f=>{a[f]!==void 0&&n(a[f])},m=(f,u)=>{o(p=>({...p,[f]:u}))},{mutateAsync:y}=Xs(),h=ot(),l=async f=>{try{const u=on(await y({file:f}));n(u)}catch(u){h(u)}};switch(e.type){case"text":return s.jsx(Ae,{hint:e.description,title:Ha(e.key),value:a[e.key]||"",onBlur:()=>c(e.key),onChange:f=>m(e.key,f.target.value)});case"boolean":return s.jsx(st,{checked:e.value,direction:"rtl",hint:e.description,label:Ha(e.key),onChange:f=>n(f.target.checked)});case"select":return s.jsx(Lt,{hint:e.description,options:e.options.map(f=>({label:f,value:f})),selectedOption:{label:e.value,value:e.value},testId:`setting-select-${e.key}`,title:Ha(e.key),onSelect:f=>n(f?.value||null)});case"color":return s.jsx(Yr,{debounceMs:200,direction:"rtl",hint:e.description,title:Ha(e.key),value:e.value||"",onChange:f=>n(f)});case"image":return s.jsxs(s.Fragment,{children:[s.jsx(bt,{useLabelTag:!0,children:Ha(e.key)}),s.jsx(un,{height:e.value?"100px":"32px",id:`custom-${e.key}`,imageURL:e.value||"",onDelete:()=>n(null),onUpload:f=>l(f),children:"Upload image"}),e.description&&s.jsx(Gr,{children:e.description})]})}},rE={source:["title_font","body_font"],casper:["title_font","body_font"],alto:["title_font","body_font"],bulletin:["title_font","body_font"],dawn:["title_font","body_font"],digest:["title_font","body_font"],dope:["title_font","body_font"],ease:["title_font","body_font"],edge:["title_font","body_font"],edition:["title_font","body_font"],episode:["typography"],headline:["title_font","body_font"],journal:["title_font","body_font"],london:["title_font","body_font"],ruby:["title_font","body_font"],solo:["typography"],taste:["style"],wave:["title_font","body_font"]},nE=({sections:e,updateSetting:n})=>{const{data:a}=ed(),o=a?.themes.find(h=>h.active),c=o?.package.name?.toLowerCase()||"",m=o?.package.author?.name||"",{supportsCustomFonts:y}=hd();return s.jsx(s.Fragment,{children:e.map(h=>{const l=h.settings.filter(u=>bx(u,h.settings.reduce((p,{key:x,value:v})=>({...p,[x]:v}),{})));let f;return s.jsx(tt,{className:"first-of-type:mt-6",gap:"xs",margins:"lg",title:h.title,children:l.map(u=>{let p="";u.type==="boolean"&&f!=="boolean"&&f!==void 0&&(p="mt-3"),(u.type==="text"||u.type==="select")&&(f==="text"||f==="select")&&(p="mt-2");const x=rE[c];return x&&x.includes(u.key)&&m==="Ghost Foundation"&&y&&(p+=" hidden"),f=u.type,s.jsx("div",{className:p,children:s.jsx(tE,{setSetting:v=>n({...u,value:v}),setting:u},u.key)},u.key)})},h.id)})})},sE=({globalSettings:e,themeSettingSections:n,updateGlobalSetting:a,updateThemeSetting:o,onTabChange:c})=>{const[m,y]=D.useState("global"),h=[{id:"global",title:"Brand",contents:s.jsx(am,{updateSetting:a,values:e})}];n.length>0&&h.push({id:"theme-settings",title:"Theme",contents:s.jsx(nE,{sections:n,updateSetting:o})});const l=f=>{y(f),c(f)};return s.jsx("div",{className:"flex h-full flex-col justify-between",children:s.jsx("div",{className:"grow p-7 pt-0","data-testid":"design-setting-tabs",children:h.length>1?s.jsx(Dn,{selectedTab:m,stickyHeader:!0,tabs:h,onTabChange:l}):s.jsx(am,{updateSetting:a,values:e})})})},aE=()=>{const{settings:e,siteData:n}=Je(),{mutateAsync:a}=Rn(),{data:{posts:[o]}={posts:[]}}=i0({searchParams:{filter:"status:published",order:"published_at DESC",limit:"1",fields:"id,url"}}),{data:c}=i2(),{mutateAsync:m}=l2(),y=ot(),[h,l]=D.useState("homepage"),{updateRoute:f}=Qe(),u=Kg().getParam("ref"),{formState:p,saveState:x,handleSave:v,updateForm:_,setFormState:k,okProps:M}=kr({initialState:{settings:e,themeSettings:c?c.custom_theme_settings:void 0},savingDelay:500,onSave:async()=>{if(p.themeSettings?.some(be=>be.dirty)){const be=await m(p.themeSettings);k(je=>({...je,themeSettings:be.custom_theme_settings}))}if(p.settings.some(be=>be.dirty)){const{settings:be}=await a(p.settings.filter(je=>je.dirty));k(je=>({...je,settings:be}))}},onSaveError:y});D.useEffect(()=>{c&&k(be=>({...be,themeSettings:c.custom_theme_settings}))},[k,c]);const T=(be,je)=>{_(H=>({...H,settings:H.settings.map(he=>he.key===be?{...he,value:je,dirty:!0}:he)}))},A=be=>{_(je=>({...je,themeSettings:je.themeSettings?.map(H=>H.key===be.key?{...be,dirty:!0}:H)}))},[C,O,$,W,R,Z,X]=gt(p.settings,["description","accent_color","icon","logo","cover_image","heading_font","body_font"]),q=(p.themeSettings||[]).reduce((be,je)=>{const H=je.group==="homepage"||je.group==="post"?je.group:"site-wide";return{...be,[H]:(be[H]||[]).concat(je)}},{}),B=Object.entries(q).map(([be,je])=>({id:be,settings:je||[],title:be==="site-wide"?"Site wide":be==="homepage"?"Homepage":"Post"}));let Y=[];o&&(Y=[{id:"homepage",title:"Homepage"},{id:"post",title:"Post"}]);const ae=be=>{Y.length&&l(be)},ee=be=>{l(be==="post"&&o?"post":"homepage")};let re=ln(n);switch(h){case"homepage":re=ln(n);break;case"post":re=o.url;break}const Q=s.jsx(eE,{settings:{description:C,accentColor:O,icon:$,logo:W,coverImage:R,themeSettings:p.themeSettings,headingFont:Z,bodyFont:X},url:re}),ne=s.jsx(sE,{globalSettings:{description:C,accentColor:O,icon:$,logo:W,coverImage:R,headingFont:Z,bodyFont:X},handleSave:v,themeSettingSections:B,updateGlobalSetting:T,updateThemeSetting:A,onTabChange:ee});return s.jsx(Zs,{afterClose:()=>{f(u==="setup"?{isExternal:!0,route:"analytics"}:"design")},buttonsDisabled:M.disabled,cancelLabel:"Close",defaultTab:"homepage",dirty:x==="unsaved",okColor:M.color,okLabel:M.label||"Save",preview:Q,previewToolbarTabs:Y,selectedURL:h,sidebar:ne,sidebarPadding:!1,siteLink:ln(n),size:"full",testId:"design-modal",title:"Design",onOk:async()=>{await v({fakeWhenUnchanged:!0})},onSelectURL:ae})},oE=({pathName:e})=>{const n=Zt(),{updateRoute:a}=Qe(),[o,c]=D.useState(null),[m,y]=D.useState(!1),[h,l]=D.useState(!1),{checkThemeLimitError:f,isThemeLimitCheckReady:u,noThemeChangesAllowed:p,isThemeLimited:x}=td(),[v,_]=D.useState(null),[k,M]=D.useState(!1);if(D.useEffect(()=>{e==="design/change-theme"&&u?(async()=>{if(!p){y(!1),c(null);return}y(!0);const A=await f();c(A),y(!1),A&&(ye.show(Xr,{prompt:A,onOk:()=>a({route:"/pro",isExternal:!0})}),n.remove())})():(c(null),y(!1))},[f,u,e,n,a,p]),D.useEffect(()=>{e!=="theme/install"&&(M(!1),_(null),l(!1))},[e]),D.useEffect(()=>{const T=()=>{const W=window.location.href.split("#")[1]?.split("?")[1];return W?new URLSearchParams(W).get("ref"):null},A=O=>{_(!1);const $={prompt:O,onOk:()=>a({route:"/pro",isExternal:!0})};p?(ye.show(Xr,$),window.history.replaceState({},"",window.location.pathname+window.location.hash.split("?")[0]),n.remove(),a("theme")):(ye.show(Xr,$),n.remove(),a("theme"))};(async()=>{if(e!=="theme/install"){l(!1);return}if(M(!0),!u){l(!0);return}if(!x){_(!0),l(!1);return}l(!0);const O=T();if(!O){_(!1),l(!1);return}const $=O.split("/")[1]?.toLowerCase(),W=await f($);if(e!=="theme/install"){l(!1);return}if(W){_(!1),l(!1),A(W);return}_(!0),l(!1)})()},[e,u,f,p,x,n,a]),e==="design/edit")return s.jsx(aE,{});if(e==="design/change-theme")return m||o?null:s.jsx(tm,{});if(e==="theme/install"){if(!k||!u||h||v===null||!v)return null;const C=window.location.href.split("#")[1]?.split("?")[1];let O=null,$=null;if(C){const W=new URLSearchParams(C);O=W.get("ref"),$=W.get("source")}return s.jsx(tm,{source:$,themeRef:O})}else n.remove()},iE=ye.create(oE),lE=({html:e,style:n})=>{const a=o=>{const c=o.contentDocument||o.contentWindow?.document;if(!c)return;const m=`
|
|
70
|
-
<html>
|
|
71
|
-
<head>
|
|
72
|
-
<style>body, html {padding: 0; margin: 0; overflow: hidden;}</style>
|
|
73
|
-
<style>${n}</style>
|
|
74
|
-
</head>
|
|
75
|
-
<body>${e}</body>
|
|
76
|
-
</html>
|
|
77
|
-
`;c.open(),c.write(m),c.close()};return s.jsx(pd,{className:"absolute size-full overflow-hidden transition-opacity duration-500",generateContent:a,height:"100%",parentClassName:"relative h-full w-full",width:"100%"})},cE=({selectedLayout:e,accentColor:n,handleColorToggle:a,selectedColor:o,selectedLabels:c,handleLabelClick:m,embedScript:y,handleLayoutSelect:h,handleCopyClick:l,isCopied:f})=>{const{loadData:u}=Zg({path:"/labels/",filterKey:"name",responseKey:"labels"}),p=async(x,v)=>{const _=await u(x);v(_.map(k=>({label:k.name,value:k.name})))};return s.jsxs("div",{className:"flex h-[calc(100vh-16vmin)] max-h-[645px] flex-col justify-between overflow-y-scroll border-l border-grey-200 p-6 pb-0 dark:border-grey-900",children:[s.jsxs("div",{children:[s.jsx(bt,{className:"mb-8",level:4,children:"Embed signup form"}),s.jsxs(tt,{gap:"sm",children:[s.jsxs("div",{className:"flex w-full items-center justify-between",children:[s.jsx("div",{children:"Layout"}),s.jsx(an,{activeKey:e,buttons:[{key:"all-in-one",label:"Branded",size:"md",className:"w-auto !px-3",onClick:()=>h("all-in-one")},{key:"minimal",label:"Minimal",size:"md",className:"w-auto !px-3",onClick:()=>h("minimal")}],clearBg:!1})]}),e==="all-in-one"&&s.jsx(Yr,{direction:"rtl",eyedropper:!0,swatches:[{hex:"#08090c",title:"Dark",value:"#08090c"},{hex:"#ffffff",title:"Light",value:"#ffffff"},{hex:n||"#d74780",title:"Accent",value:n||"#d74780"}],title:"Background color",value:o,onChange:x=>{x&&a(x)}}),s.jsx(c2,{hint:"Will be applied to all members signing up via this form",loadOptions:Ji(p,500),placeholder:"Pick one or more labels (optional)",title:"Labels at signup",values:c||[],async:!0,canCreate:!0,defaultOptions:!0,onChange:m}),s.jsx($n,{className:"text-grey-800",fontStyle:"mono",hint:"Paste this code onto any website where you'd like your signup to appear.",title:"Embed code",value:`${y}`,onChange:()=>{}})]})]}),s.jsx(u2,{height:74,children:s.jsx("div",{className:"flex w-full justify-end",children:s.jsx(Ue,{color:f?"green":"black",label:f?"Copied!":"Copy code",onClick:l})})})]})};function Eg(e){return e?e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):""}function _d(e,n){return n={exports:{}},e(n,n.exports),n.exports}var qa={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},uE=function(n){return!n||typeof n=="string"?!1:n instanceof Array||Array.isArray(n)||n.length>=0&&(n.splice instanceof Function||Object.getOwnPropertyDescriptor(n,n.length-1)&&n.constructor.name!=="String")},Ya=_d(function(e){var n=Array.prototype.concat,a=Array.prototype.slice,o=e.exports=function(m){for(var y=[],h=0,l=m.length;h<l;h++){var f=m[h];uE(f)?y=n.call(y,a.call(f)):y.push(f)}return y};o.wrap=function(c){return function(){return c(o(arguments))}}}),Jn=_d(function(e){var n=Object.hasOwnProperty,a=Object.create(null);for(var o in qa)n.call(qa,o)&&(a[qa[o]]=o);var c=e.exports={to:{},get:{}};c.get=function(h){var l=h.substring(0,3).toLowerCase(),f,u;switch(l){case"hsl":f=c.get.hsl(h),u="hsl";break;case"hwb":f=c.get.hwb(h),u="hwb";break;default:f=c.get.rgb(h),u="rgb";break}return f?{model:u,value:f}:null},c.get.rgb=function(h){if(!h)return null;var l=/^#([a-f0-9]{3,4})$/i,f=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,u=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,p=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,x=/^(\w+)$/,v=[0,0,0,1],_,k,M;if(_=h.match(f)){for(M=_[2],_=_[1],k=0;k<3;k++){var T=k*2;v[k]=parseInt(_.slice(T,T+2),16)}M&&(v[3]=parseInt(M,16)/255)}else if(_=h.match(l)){for(_=_[1],M=_[3],k=0;k<3;k++)v[k]=parseInt(_[k]+_[k],16);M&&(v[3]=parseInt(M+M,16)/255)}else if(_=h.match(u)){for(k=0;k<3;k++)v[k]=parseInt(_[k+1],0);_[4]&&(_[5]?v[3]=parseFloat(_[4])*.01:v[3]=parseFloat(_[4]))}else if(_=h.match(p)){for(k=0;k<3;k++)v[k]=Math.round(parseFloat(_[k+1])*2.55);_[4]&&(_[5]?v[3]=parseFloat(_[4])*.01:v[3]=parseFloat(_[4]))}else return(_=h.match(x))?_[1]==="transparent"?[0,0,0,0]:n.call(qa,_[1])?(v=qa[_[1]],v[3]=1,v):null:null;for(k=0;k<3;k++)v[k]=m(v[k],0,255);return v[3]=m(v[3],0,1),v},c.get.hsl=function(h){if(!h)return null;var l=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,f=h.match(l);if(f){var u=parseFloat(f[4]),p=(parseFloat(f[1])%360+360)%360,x=m(parseFloat(f[2]),0,100),v=m(parseFloat(f[3]),0,100),_=m(isNaN(u)?1:u,0,1);return[p,x,v,_]}return null},c.get.hwb=function(h){if(!h)return null;var l=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,f=h.match(l);if(f){var u=parseFloat(f[4]),p=(parseFloat(f[1])%360+360)%360,x=m(parseFloat(f[2]),0,100),v=m(parseFloat(f[3]),0,100),_=m(isNaN(u)?1:u,0,1);return[p,x,v,_]}return null},c.to.hex=function(){var h=Ya(arguments);return"#"+y(h[0])+y(h[1])+y(h[2])+(h[3]<1?y(Math.round(h[3]*255)):"")},c.to.rgb=function(){var h=Ya(arguments);return h.length<4||h[3]===1?"rgb("+Math.round(h[0])+", "+Math.round(h[1])+", "+Math.round(h[2])+")":"rgba("+Math.round(h[0])+", "+Math.round(h[1])+", "+Math.round(h[2])+", "+h[3]+")"},c.to.rgb.percent=function(){var h=Ya(arguments),l=Math.round(h[0]/255*100),f=Math.round(h[1]/255*100),u=Math.round(h[2]/255*100);return h.length<4||h[3]===1?"rgb("+l+"%, "+f+"%, "+u+"%)":"rgba("+l+"%, "+f+"%, "+u+"%, "+h[3]+")"},c.to.hsl=function(){var h=Ya(arguments);return h.length<4||h[3]===1?"hsl("+h[0]+", "+h[1]+"%, "+h[2]+"%)":"hsla("+h[0]+", "+h[1]+"%, "+h[2]+"%, "+h[3]+")"},c.to.hwb=function(){var h=Ya(arguments),l="";return h.length>=4&&h[3]!==1&&(l=", "+h[3]),"hwb("+h[0]+", "+h[1]+"%, "+h[2]+"%"+l+")"},c.to.keyword=function(h){return a[h.slice(0,3)]};function m(h,l,f){return Math.min(Math.max(l,h),f)}function y(h){var l=Math.round(h).toString(16).toUpperCase();return l.length<2?"0"+l:l}});Jn.to;Jn.get;var Vn={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},At=_d(function(e){var n={};for(var a in Vn)Vn.hasOwnProperty(a)&&(n[Vn[a]]=a);var o=e.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var c in o)if(o.hasOwnProperty(c)){if(!("channels"in o[c]))throw new Error("missing channels property: "+c);if(!("labels"in o[c]))throw new Error("missing channel labels property: "+c);if(o[c].labels.length!==o[c].channels)throw new Error("channel and label counts mismatch: "+c);var m=o[c].channels,y=o[c].labels;delete o[c].channels,delete o[c].labels,Object.defineProperty(o[c],"channels",{value:m}),Object.defineProperty(o[c],"labels",{value:y})}o.rgb.hsl=function(l){var f=l[0]/255,u=l[1]/255,p=l[2]/255,x=Math.min(f,u,p),v=Math.max(f,u,p),_=v-x,k,M,T;return v===x?k=0:f===v?k=(u-p)/_:u===v?k=2+(p-f)/_:p===v&&(k=4+(f-u)/_),k=Math.min(k*60,360),k<0&&(k+=360),T=(x+v)/2,v===x?M=0:T<=.5?M=_/(v+x):M=_/(2-v-x),[k,M*100,T*100]},o.rgb.hsv=function(l){var f,u,p,x,v,_=l[0]/255,k=l[1]/255,M=l[2]/255,T=Math.max(_,k,M),A=T-Math.min(_,k,M),C=function(O){return(T-O)/6/A+1/2};return A===0?x=v=0:(v=A/T,f=C(_),u=C(k),p=C(M),_===T?x=p-u:k===T?x=1/3+f-p:M===T&&(x=2/3+u-f),x<0?x+=1:x>1&&(x-=1)),[x*360,v*100,T*100]},o.rgb.hwb=function(l){var f=l[0],u=l[1],p=l[2],x=o.rgb.hsl(l)[0],v=1/255*Math.min(f,Math.min(u,p));return p=1-1/255*Math.max(f,Math.max(u,p)),[x,v*100,p*100]},o.rgb.cmyk=function(l){var f=l[0]/255,u=l[1]/255,p=l[2]/255,x,v,_,k;return k=Math.min(1-f,1-u,1-p),x=(1-f-k)/(1-k)||0,v=(1-u-k)/(1-k)||0,_=(1-p-k)/(1-k)||0,[x*100,v*100,_*100,k*100]};function h(l,f){return Math.pow(l[0]-f[0],2)+Math.pow(l[1]-f[1],2)+Math.pow(l[2]-f[2],2)}o.rgb.keyword=function(l){var f=n[l];if(f)return f;var u=1/0,p;for(var x in Vn)if(Vn.hasOwnProperty(x)){var v=Vn[x],_=h(l,v);_<u&&(u=_,p=x)}return p},o.keyword.rgb=function(l){return Vn[l]},o.rgb.xyz=function(l){var f=l[0]/255,u=l[1]/255,p=l[2]/255;f=f>.04045?Math.pow((f+.055)/1.055,2.4):f/12.92,u=u>.04045?Math.pow((u+.055)/1.055,2.4):u/12.92,p=p>.04045?Math.pow((p+.055)/1.055,2.4):p/12.92;var x=f*.4124+u*.3576+p*.1805,v=f*.2126+u*.7152+p*.0722,_=f*.0193+u*.1192+p*.9505;return[x*100,v*100,_*100]},o.rgb.lab=function(l){var f=o.rgb.xyz(l),u=f[0],p=f[1],x=f[2],v,_,k;return u/=95.047,p/=100,x/=108.883,u=u>.008856?Math.pow(u,1/3):7.787*u+16/116,p=p>.008856?Math.pow(p,1/3):7.787*p+16/116,x=x>.008856?Math.pow(x,1/3):7.787*x+16/116,v=116*p-16,_=500*(u-p),k=200*(p-x),[v,_,k]},o.hsl.rgb=function(l){var f=l[0]/360,u=l[1]/100,p=l[2]/100,x,v,_,k,M;if(u===0)return M=p*255,[M,M,M];p<.5?v=p*(1+u):v=p+u-p*u,x=2*p-v,k=[0,0,0];for(var T=0;T<3;T++)_=f+1/3*-(T-1),_<0&&_++,_>1&&_--,6*_<1?M=x+(v-x)*6*_:2*_<1?M=v:3*_<2?M=x+(v-x)*(2/3-_)*6:M=x,k[T]=M*255;return k},o.hsl.hsv=function(l){var f=l[0],u=l[1]/100,p=l[2]/100,x=u,v=Math.max(p,.01),_,k;return p*=2,u*=p<=1?p:2-p,x*=v<=1?v:2-v,k=(p+u)/2,_=p===0?2*x/(v+x):2*u/(p+u),[f,_*100,k*100]},o.hsv.rgb=function(l){var f=l[0]/60,u=l[1]/100,p=l[2]/100,x=Math.floor(f)%6,v=f-Math.floor(f),_=255*p*(1-u),k=255*p*(1-u*v),M=255*p*(1-u*(1-v));switch(p*=255,x){case 0:return[p,M,_];case 1:return[k,p,_];case 2:return[_,p,M];case 3:return[_,k,p];case 4:return[M,_,p];case 5:return[p,_,k]}},o.hsv.hsl=function(l){var f=l[0],u=l[1]/100,p=l[2]/100,x=Math.max(p,.01),v,_,k;return k=(2-u)*p,v=(2-u)*x,_=u*x,_/=v<=1?v:2-v,_=_||0,k/=2,[f,_*100,k*100]},o.hwb.rgb=function(l){var f=l[0]/360,u=l[1]/100,p=l[2]/100,x=u+p,v,_,k,M;x>1&&(u/=x,p/=x),v=Math.floor(6*f),_=1-p,k=6*f-v,(v&1)!==0&&(k=1-k),M=u+k*(_-u);var T,A,C;switch(v){default:case 6:case 0:T=_,A=M,C=u;break;case 1:T=M,A=_,C=u;break;case 2:T=u,A=_,C=M;break;case 3:T=u,A=M,C=_;break;case 4:T=M,A=u,C=_;break;case 5:T=_,A=u,C=M;break}return[T*255,A*255,C*255]},o.cmyk.rgb=function(l){var f=l[0]/100,u=l[1]/100,p=l[2]/100,x=l[3]/100,v,_,k;return v=1-Math.min(1,f*(1-x)+x),_=1-Math.min(1,u*(1-x)+x),k=1-Math.min(1,p*(1-x)+x),[v*255,_*255,k*255]},o.xyz.rgb=function(l){var f=l[0]/100,u=l[1]/100,p=l[2]/100,x,v,_;return x=f*3.2406+u*-1.5372+p*-.4986,v=f*-.9689+u*1.8758+p*.0415,_=f*.0557+u*-.204+p*1.057,x=x>.0031308?1.055*Math.pow(x,1/2.4)-.055:x*12.92,v=v>.0031308?1.055*Math.pow(v,1/2.4)-.055:v*12.92,_=_>.0031308?1.055*Math.pow(_,1/2.4)-.055:_*12.92,x=Math.min(Math.max(0,x),1),v=Math.min(Math.max(0,v),1),_=Math.min(Math.max(0,_),1),[x*255,v*255,_*255]},o.xyz.lab=function(l){var f=l[0],u=l[1],p=l[2],x,v,_;return f/=95.047,u/=100,p/=108.883,f=f>.008856?Math.pow(f,1/3):7.787*f+16/116,u=u>.008856?Math.pow(u,1/3):7.787*u+16/116,p=p>.008856?Math.pow(p,1/3):7.787*p+16/116,x=116*u-16,v=500*(f-u),_=200*(u-p),[x,v,_]},o.lab.xyz=function(l){var f=l[0],u=l[1],p=l[2],x,v,_;v=(f+16)/116,x=u/500+v,_=v-p/200;var k=Math.pow(v,3),M=Math.pow(x,3),T=Math.pow(_,3);return v=k>.008856?k:(v-16/116)/7.787,x=M>.008856?M:(x-16/116)/7.787,_=T>.008856?T:(_-16/116)/7.787,x*=95.047,v*=100,_*=108.883,[x,v,_]},o.lab.lch=function(l){var f=l[0],u=l[1],p=l[2],x,v,_;return x=Math.atan2(p,u),v=x*360/2/Math.PI,v<0&&(v+=360),_=Math.sqrt(u*u+p*p),[f,_,v]},o.lch.lab=function(l){var f=l[0],u=l[1],p=l[2],x,v,_;return _=p/360*2*Math.PI,x=u*Math.cos(_),v=u*Math.sin(_),[f,x,v]},o.rgb.ansi16=function(l){var f=l[0],u=l[1],p=l[2],x=1 in arguments?arguments[1]:o.rgb.hsv(l)[2];if(x=Math.round(x/50),x===0)return 30;var v=30+(Math.round(p/255)<<2|Math.round(u/255)<<1|Math.round(f/255));return x===2&&(v+=60),v},o.hsv.ansi16=function(l){return o.rgb.ansi16(o.hsv.rgb(l),l[2])},o.rgb.ansi256=function(l){var f=l[0],u=l[1],p=l[2];if(f===u&&u===p)return f<8?16:f>248?231:Math.round((f-8)/247*24)+232;var x=16+36*Math.round(f/255*5)+6*Math.round(u/255*5)+Math.round(p/255*5);return x},o.ansi16.rgb=function(l){var f=l%10;if(f===0||f===7)return l>50&&(f+=3.5),f=f/10.5*255,[f,f,f];var u=(~~(l>50)+1)*.5,p=(f&1)*u*255,x=(f>>1&1)*u*255,v=(f>>2&1)*u*255;return[p,x,v]},o.ansi256.rgb=function(l){if(l>=232){var f=(l-232)*10+8;return[f,f,f]}l-=16;var u,p=Math.floor(l/36)/5*255,x=Math.floor((u=l%36)/6)/5*255,v=u%6/5*255;return[p,x,v]},o.rgb.hex=function(l){var f=((Math.round(l[0])&255)<<16)+((Math.round(l[1])&255)<<8)+(Math.round(l[2])&255),u=f.toString(16).toUpperCase();return"000000".substring(u.length)+u},o.hex.rgb=function(l){var f=l.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!f)return[0,0,0];var u=f[0];f[0].length===3&&(u=u.split("").map(function(k){return k+k}).join(""));var p=parseInt(u,16),x=p>>16&255,v=p>>8&255,_=p&255;return[x,v,_]},o.rgb.hcg=function(l){var f=l[0]/255,u=l[1]/255,p=l[2]/255,x=Math.max(Math.max(f,u),p),v=Math.min(Math.min(f,u),p),_=x-v,k,M;return _<1?k=v/(1-_):k=0,_<=0?M=0:x===f?M=(u-p)/_%6:x===u?M=2+(p-f)/_:M=4+(f-u)/_+4,M/=6,M%=1,[M*360,_*100,k*100]},o.hsl.hcg=function(l){var f=l[1]/100,u=l[2]/100,p=1,x=0;return u<.5?p=2*f*u:p=2*f*(1-u),p<1&&(x=(u-.5*p)/(1-p)),[l[0],p*100,x*100]},o.hsv.hcg=function(l){var f=l[1]/100,u=l[2]/100,p=f*u,x=0;return p<1&&(x=(u-p)/(1-p)),[l[0],p*100,x*100]},o.hcg.rgb=function(l){var f=l[0]/360,u=l[1]/100,p=l[2]/100;if(u===0)return[p*255,p*255,p*255];var x=[0,0,0],v=f%1*6,_=v%1,k=1-_,M=0;switch(Math.floor(v)){case 0:x[0]=1,x[1]=_,x[2]=0;break;case 1:x[0]=k,x[1]=1,x[2]=0;break;case 2:x[0]=0,x[1]=1,x[2]=_;break;case 3:x[0]=0,x[1]=k,x[2]=1;break;case 4:x[0]=_,x[1]=0,x[2]=1;break;default:x[0]=1,x[1]=0,x[2]=k}return M=(1-u)*p,[(u*x[0]+M)*255,(u*x[1]+M)*255,(u*x[2]+M)*255]},o.hcg.hsv=function(l){var f=l[1]/100,u=l[2]/100,p=f+u*(1-f),x=0;return p>0&&(x=f/p),[l[0],x*100,p*100]},o.hcg.hsl=function(l){var f=l[1]/100,u=l[2]/100,p=u*(1-f)+.5*f,x=0;return p>0&&p<.5?x=f/(2*p):p>=.5&&p<1&&(x=f/(2*(1-p))),[l[0],x*100,p*100]},o.hcg.hwb=function(l){var f=l[1]/100,u=l[2]/100,p=f+u*(1-f);return[l[0],(p-f)*100,(1-p)*100]},o.hwb.hcg=function(l){var f=l[1]/100,u=l[2]/100,p=1-u,x=p-f,v=0;return x<1&&(v=(p-x)/(1-x)),[l[0],x*100,v*100]},o.apple.rgb=function(l){return[l[0]/65535*255,l[1]/65535*255,l[2]/65535*255]},o.rgb.apple=function(l){return[l[0]/255*65535,l[1]/255*65535,l[2]/255*65535]},o.gray.rgb=function(l){return[l[0]/100*255,l[0]/100*255,l[0]/100*255]},o.gray.hsl=o.gray.hsv=function(l){return[0,0,l[0]]},o.gray.hwb=function(l){return[0,100,l[0]]},o.gray.cmyk=function(l){return[0,0,0,l[0]]},o.gray.lab=function(l){return[l[0],0,0]},o.gray.hex=function(l){var f=Math.round(l[0]/100*255)&255,u=(f<<16)+(f<<8)+f,p=u.toString(16).toUpperCase();return"000000".substring(p.length)+p},o.rgb.gray=function(l){var f=(l[0]+l[1]+l[2])/3;return[f/255*100]}});At.rgb;At.hsl;At.hsv;At.hwb;At.cmyk;At.xyz;At.lab;At.lch;At.hex;At.keyword;At.ansi16;At.ansi256;At.hcg;At.apple;At.gray;function fE(){for(var e={},n=Object.keys(At),a=n.length,o=0;o<a;o++)e[n[o]]={distance:-1,parent:null};return e}function dE(e){var n=fE(),a=[e];for(n[e].distance=0;a.length;)for(var o=a.pop(),c=Object.keys(At[o]),m=c.length,y=0;y<m;y++){var h=c[y],l=n[h];l.distance===-1&&(l.distance=n[o].distance+1,l.parent=o,a.unshift(h))}return n}function pE(e,n){return function(a){return n(e(a))}}function hE(e,n){for(var a=[n[e].parent,e],o=At[n[e].parent][e],c=n[e].parent;n[c].parent;)a.unshift(n[c].parent),o=pE(At[n[c].parent][c],o),c=n[c].parent;return o.conversion=a,o}var mE=function(e){for(var n=dE(e),a={},o=Object.keys(n),c=o.length,m=0;m<c;m++){var y=o[m],h=n[y];h.parent!==null&&(a[y]=hE(y,n))}return a},zs={},gE=Object.keys(At);function xE(e){var n=function(a){return a==null?a:(arguments.length>1&&(a=Array.prototype.slice.call(arguments)),e(a))};return"conversion"in e&&(n.conversion=e.conversion),n}function bE(e){var n=function(a){if(a==null)return a;arguments.length>1&&(a=Array.prototype.slice.call(arguments));var o=e(a);if(typeof o=="object")for(var c=o.length,m=0;m<c;m++)o[m]=Math.round(o[m]);return o};return"conversion"in e&&(n.conversion=e.conversion),n}gE.forEach(function(e){zs[e]={},Object.defineProperty(zs[e],"channels",{value:At[e].channels}),Object.defineProperty(zs[e],"labels",{value:At[e].labels});var n=mE(e),a=Object.keys(n);a.forEach(function(o){var c=n[o];zs[e][o]=bE(c),zs[e][o].raw=xE(c)})});var _r=zs,kd=[].slice,vx=["keyword","gray","hex"],qf={};Object.keys(_r).forEach(function(e){qf[kd.call(_r[e].labels).sort().join("")]=e});var Ki={};function qt(e,n){if(!(this instanceof qt))return new qt(e,n);if(n&&n in vx&&(n=null),n&&!(n in _r))throw new Error("Unknown model: "+n);var a,o;if(e==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof qt)this.model=e.model,this.color=e.color.slice(),this.valpha=e.valpha;else if(typeof e=="string"){var c=Jn.get(e);if(c===null)throw new Error("Unable to parse color from string: "+e);this.model=c.model,o=_r[this.model].channels,this.color=c.value.slice(0,o),this.valpha=typeof c.value[o]=="number"?c.value[o]:1}else if(e.length){this.model=n||"rgb",o=_r[this.model].channels;var m=kd.call(e,0,o);this.color=Yf(m,o),this.valpha=typeof e[o]=="number"?e[o]:1}else if(typeof e=="number")e&=16777215,this.model="rgb",this.color=[e>>16&255,e>>8&255,e&255],this.valpha=1;else{this.valpha=1;var y=Object.keys(e);"alpha"in e&&(y.splice(y.indexOf("alpha"),1),this.valpha=typeof e.alpha=="number"?e.alpha:0);var h=y.sort().join("");if(!(h in qf))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=qf[h];var l=_r[this.model].labels,f=[];for(a=0;a<l.length;a++)f.push(e[l[a]]);this.color=Yf(f)}if(Ki[this.model])for(o=_r[this.model].channels,a=0;a<o;a++){var u=Ki[this.model][a];u&&(this.color[a]=u(this.color[a]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}qt.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(e){var n=this.model in Jn.to?this:this.rgb();n=n.round(typeof e=="number"?e:1);var a=n.valpha===1?n.color:n.color.concat(this.valpha);return Jn.to[n.model](a)},percentString:function(e){var n=this.rgb().round(typeof e=="number"?e:1),a=n.valpha===1?n.color:n.color.concat(this.valpha);return Jn.to.rgb.percent(a)},array:function(){return this.valpha===1?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var e={},n=_r[this.model].channels,a=_r[this.model].labels,o=0;o<n;o++)e[a[o]]=this.color[o];return this.valpha!==1&&(e.alpha=this.valpha),e},unitArray:function(){var e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,this.valpha!==1&&e.push(this.valpha),e},unitObject:function(){var e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,this.valpha!==1&&(e.alpha=this.valpha),e},round:function(e){return e=Math.max(e||0,0),new qt(this.color.map(wE(e)).concat(this.valpha),this.model)},alpha:function(e){return arguments.length?new qt(this.color.concat(Math.max(0,Math.min(1,e))),this.model):this.valpha},red:St("rgb",0,Ft(255)),green:St("rgb",1,Ft(255)),blue:St("rgb",2,Ft(255)),hue:St(["hsl","hsv","hsl","hwb","hcg"],0,function(e){return(e%360+360)%360}),saturationl:St("hsl",1,Ft(100)),lightness:St("hsl",2,Ft(100)),saturationv:St("hsv",1,Ft(100)),value:St("hsv",2,Ft(100)),chroma:St("hcg",1,Ft(100)),gray:St("hcg",2,Ft(100)),white:St("hwb",1,Ft(100)),wblack:St("hwb",2,Ft(100)),cyan:St("cmyk",0,Ft(100)),magenta:St("cmyk",1,Ft(100)),yellow:St("cmyk",2,Ft(100)),black:St("cmyk",3,Ft(100)),x:St("xyz",0,Ft(100)),y:St("xyz",1,Ft(100)),z:St("xyz",2,Ft(100)),l:St("lab",0,Ft(100)),a:St("lab",1),b:St("lab",2),keyword:function(e){return arguments.length?new qt(e):_r[this.model].keyword(this.color)},hex:function(e){return arguments.length?new qt(e):Jn.to.hex(this.rgb().round().color)},rgbNumber:function(){var e=this.rgb().color;return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255},luminosity:function(){for(var e=this.rgb().color,n=[],a=0;a<e.length;a++){var o=e[a]/255;n[a]=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4)}return .2126*n[0]+.7152*n[1]+.0722*n[2]},contrast:function(e){var n=this.luminosity(),a=e.luminosity();return n>a?(n+.05)/(a+.05):(a+.05)/(n+.05)},level:function(e){var n=this.contrast(e);return n>=7.1?"AAA":n>=4.5?"AA":""},isDark:function(){var e=this.rgb().color,n=(e[0]*299+e[1]*587+e[2]*114)/1e3;return n<128},isLight:function(){return!this.isDark()},negate:function(){for(var e=this.rgb(),n=0;n<3;n++)e.color[n]=255-e.color[n];return e},lighten:function(e){var n=this.hsl();return n.color[2]+=n.color[2]*e,n},darken:function(e){var n=this.hsl();return n.color[2]-=n.color[2]*e,n},saturate:function(e){var n=this.hsl();return n.color[1]+=n.color[1]*e,n},desaturate:function(e){var n=this.hsl();return n.color[1]-=n.color[1]*e,n},whiten:function(e){var n=this.hwb();return n.color[1]+=n.color[1]*e,n},blacken:function(e){var n=this.hwb();return n.color[2]+=n.color[2]*e,n},grayscale:function(){var e=this.rgb().color,n=e[0]*.3+e[1]*.59+e[2]*.11;return qt.rgb(n,n,n)},fade:function(e){return this.alpha(this.valpha-this.valpha*e)},opaquer:function(e){return this.alpha(this.valpha+this.valpha*e)},rotate:function(e){var n=this.hsl(),a=n.color[0];return a=(a+e)%360,a=a<0?360+a:a,n.color[0]=a,n},mix:function(e,n){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);var a=e.rgb(),o=this.rgb(),c=n===void 0?.5:n,m=2*c-1,y=a.alpha()-o.alpha(),h=((m*y===-1?m:(m+y)/(1+m*y))+1)/2,l=1-h;return qt.rgb(h*a.red()+l*o.red(),h*a.green()+l*o.green(),h*a.blue()+l*o.blue(),a.alpha()*c+o.alpha()*(1-c))}};Object.keys(_r).forEach(function(e){if(vx.indexOf(e)===-1){var n=_r[e].channels;qt.prototype[e]=function(){if(this.model===e)return new qt(this);if(arguments.length)return new qt(arguments,e);var a=typeof arguments[n]=="number"?n:this.valpha;return new qt(yE(_r[this.model][e].raw(this.color)).concat(a),e)},qt[e]=function(a){return typeof a=="number"&&(a=Yf(kd.call(arguments),n)),new qt(a,e)}}});function vE(e,n){return Number(e.toFixed(n))}function wE(e){return function(n){return vE(n,e)}}function St(e,n,a){return e=Array.isArray(e)?e:[e],e.forEach(function(o){(Ki[o]||(Ki[o]=[]))[n]=a}),e=e[0],function(o){var c;return arguments.length?(a&&(o=a(o)),c=this[e](),c.color[n]=o,c):(c=this[e]().color[n],a&&(c=a(c)),c)}}function Ft(e){return function(n){return Math.max(0,Math.min(e,n))}}function yE(e){return Array.isArray(e)?e:[e]}function Yf(e,n){for(var a=0;a<n;a++)typeof e[a]!="number"&&(e[a]=0);return e}var Ef=qt;function Nr(e){const n=Ef(e),a=Ef({r:255,g:255,b:255}),o=Ef({r:0,g:0,b:0});return n.red()*.299+n.green()*.587+n.b()*.114>=186?o:a}const Tg=({preview:e,config:n,settings:a,labels:o,backgroundColor:c,layout:m})=>{const y=n.blogUrl,h=n.signupForm.url.replace("{version}",n.signupForm.version);let l={site:y,locale:a.locale,"button-color":a.accentColor,"button-text-color":Nr(a.accentColor).hex()};for(const[_,k]of o.entries())l[`label-${_+1}`]=k.name;let f="min-height: 58px;max-width: 440px;margin: 0 auto;width: 100%";m==="all-in-one"&&(a.icon&&a.icon!==""&&(l.icon=a.icon.replace(/\/content\/images\//,"/content/images/size/w192h192/")),l.title=a.title,l.description=a.description,l["background-color"]=c,l["text-color"]=Nr(c).hex(),f="height: 40vmin;min-height: 360px"),e&&(m==="minimal"?f="min-height: 58px; max-width: 440px;width: 100%;position: absolute; left: 50%; top:50%; transform: translate(-50%, -50%);":f="height: 100vh");let u="";const p=["background-color","text-color","button-color","button-text-color","title","description","icon","site","locale"],x=Object.keys(l).sort((_,k)=>p.indexOf(_)-p.indexOf(k));for(const _ of x){const k=l[_];u+=` data-${_}="${Eg(k)}"`}const v=`<div style="${Eg(f)}"><script src="${encodeURI(h)}"${u} async><\/script></div>`;return e&&m==="minimal"?`<div style="position: absolute; z-index: -1; top: 0; left: 0; width: 100%; height: 100%; background-image: linear-gradient(45deg, #eee 25%, transparent 25%, transparent 75%, #eee 75%), linear-gradient(45deg, #eee 25%, transparent 25%, transparent 75%, #eee 75%);background-size: 16px 16px;background-position: 0 0, 8px 8px;;"></div>${v}`:v},_E=ye.create(()=>{const[e,n]=D.useState("#08090c"),[a,o]=D.useState([]),[c,m]=D.useState("all-in-one"),[y,h]=D.useState(""),[l,f]=D.useState(""),[u,p]=D.useState(!1),{updateRoute:x}=Qe(),{config:v}=Je(),{localSettings:_,siteData:k}=ss(),[M,T,A,C,O]=gt(_,["accent_color","title","description","locale","icon"]),[$,W]=D.useState({active:!1});D.useEffect(()=>{if(!k)return;const q={config:{blogUrl:k.url,signupForm:{url:v?.signupForm?.url,version:v?.signupForm?.version}},settings:{accentColor:M||"#d74780",title:T||"",locale:C||"en",icon:O||"",description:A||""},labels:a.map(({label:ae})=>({name:ae})),backgroundColor:e||"#08090c",layout:c},B=Tg({preview:!0,...q});h(B);const Y=Tg({preview:!1,...q});f(Y)},[k,M,a,v,T,e,c,C,O,A]);const R=async()=>{try{await navigator.clipboard.writeText(l),p(!0),setTimeout(()=>p(!1),2e3)}catch(q){console.error("Failed to copy text: ",q)}},Z=q=>{n(q)},X=q=>{if(q?.length){const B=q?.map(({value:Y})=>({label:Y,value:Y}));o(B)}else o([])};return s.jsx(yt,{afterClose:()=>{x("embed-signup-form")},cancelLabel:"",footer:!1,height:645,padding:!1,testId:"embed-signup-form",title:"",topRightContent:"close",width:1120,children:s.jsxs("div",{className:"grid grid-cols-[5.2fr_2.8fr]",children:[s.jsx(lE,{html:y,style:c}),s.jsx(cE,{accentColor:M,customColor:$,embedScript:l,handleColorToggle:Z,handleCopyClick:R,handleLabelClick:X,handleLayoutSelect:m,isCopied:u,selectedColor:e,selectedLabels:a,selectedLayout:c,setCustomColor:W})]})})}),kE=ye.create(()=>{const{updateRoute:e}=Qe(),{settings:n}=Je(),{mutateAsync:a}=Rn(),o=ot(),[c,m]=D.useState(""),[y]=gt(n,["firstpromoter"]),[h]=gt(n,["firstpromoter_id"]),[l,f]=D.useState("Save"),[u,p]=D.useState(!!y);D.useEffect(()=>{p(y||!1),m(h||null)},[y,h]);const x=async()=>{const v=[{key:"firstpromoter",value:u},{key:"firstpromoter_id",value:c}];try{f("Saving..."),await Promise.all([a(v),new Promise(_=>{setTimeout(_,1e3)})]),f("Saved")}catch(_){o(_)}finally{setTimeout(()=>f("Save"),1e3)}};return s.jsxs(yt,{afterClose:()=>{e("integrations")},cancelLabel:"Close",dirty:u!==y||c!==h,okColor:l==="Saved"?"green":"black",okLabel:l,testId:"firstpromoter-modal",title:"",onOk:async()=>{try{await x()}catch(v){o(v)}},children:[s.jsx(Qs,{detail:"Launch your own member referral program",icon:s.jsx(ut,{className:"-mt-2",name:"firstpromoter",size:56}),title:"FirstPromoter"}),s.jsx("div",{className:"mt-7",children:s.jsxs(tt,{marginBottom:!1,title:"FirstPromoter configuration",grouped:!0,children:[s.jsx(st,{checked:u,direction:"rtl",hint:s.jsxs(s.Fragment,{children:["Enable ",s.jsx("a",{className:"text-green",href:"https://firstpromoter.com/?fpr=ghost&fp_sid=admin",rel:"noopener noreferrer",target:"_blank",children:"FirstPromoter"})," for tracking referrals"]}),label:"Enable FirstPromoter",onChange:v=>{p(v.target.checked)}}),u&&s.jsx(Ae,{hint:s.jsxs(s.Fragment,{children:["Affiliate and referral tracking, find your ID ",s.jsx("a",{className:"text-green",href:"https://ghost.org/help/firstpromoter-id/",rel:"noopener noreferrer",target:"_blank",children:"here"})]}),placeholder:"XXXXXXXX",title:"FirstPromoter account ID",value:c||"",onChange:v=>{m(v.target.value)}})]})})]})}),ME="ActionsResponseType",jE=v_({dataType:ME,path:"/actions/",returnData:e=>{const{pages:n}=e;let a=n.flatMap(m=>m.actions.map(({context:y,...h})=>({...h,context:JSON.parse(y)})));a=a.reverse();let o=1;a.forEach((m,y)=>{const h=a[y+1];h&&m.resource_id===h.resource_id&&m.event===h.event?(m.skip=!0,o+=1):o>1&&(m.count=o,o=1)});const c=n[n.length-1].meta;return{actions:a.reverse(),meta:c,isEnd:c?c.pagination.pages===c.pagination.page:!0}}}),EE=e=>{var n,a;let o=e.resource_type;if(e.event!=="deleted")switch(e.resource_type){case"page":case"post":return!e.resource||!e.resource.id?void 0:(o==="post"&&(n=e.context)!=null&&n.type&&(o=(a=e.context)==null?void 0:a.type),{isExternal:!0,route:`editor/${o}/${e.resource.id}`,models:[o,e.resource.id]});case"integration":return!e.resource||!e.resource.id?void 0:{route:`integrations/${e.resource.id}`};case"offer":return!e.resource||!e.resource.id?void 0:{isExternal:!0,route:`offers/${e.resource.id}`,models:[e.resource.id]};case"tag":return!e.resource||!e.resource.slug?void 0:{isExternal:!0,route:"tag",models:[e.resource.slug]};case"product":return{route:"tiers"};case"user":return!e.resource||!e.resource.slug?void 0:{route:`staff/${e.resource.slug}`}}},TE=e=>{var n,a,o,c,m,y,h;let l=e.resource_type;l==="api_key"?l="API key":l==="setting"?l="settings":l==="product"&&(l="tier"),l==="post"&&(n=e.context)!=null&&n.type&&(l=(a=e.context)==null?void 0:a.type);let f=e.event;return e.event==="edited"&&(o=e.context)!=null&&o.action_name&&(f=(c=e.context)==null?void 0:c.action_name),(m=e.context)!=null&&m.count&&((y=e.context)==null?void 0:y.count)>1?`${(h=e.context)==null?void 0:h.count} ${l}s ${f}`:`${l.slice(0,1).toUpperCase()}${l.slice(1)} ${f}`},SE=e=>{var n,a,o,c;if(e.resource_type==="setting"&&(n=e.context)!=null&&n.group&&(a=e.context)!=null&&a.key)return{group:(o=e.context)==null?void 0:o.group,key:(c=e.context)==null?void 0:c.key}},Sg=e=>{var n,a;return typeof((n=e.context)==null?void 0:n.count)=="number"&&((a=e.context)==null?void 0:a.count)>1},NE=({action:e})=>{let n="pen";switch(e.event){case"added":n="add";break;case"deleted":n="trash";break}return s.jsx(ut,{name:n,size:"xs"})},AE=({action:e})=>s.jsxs("div",{className:"relative shrink-0",children:[s.jsx(Vg,{bgColor:Jg(e.actor?.name||e.actor?.slug||""),image:e.actor?.image??void 0,label:Qg(e.actor?.name||e.actor?.slug),labelColor:"white",size:"md"}),s.jsx("div",{className:"absolute -bottom-1 -right-1 z-30 flex items-center justify-center rounded-full border border-grey-100 bg-white p-1 shadow-sm dark:border-grey-900 dark:bg-black",children:s.jsx(NE,{action:e})})]}),An=({label:e,item:n,excludedItems:a,toggleItem:o})=>s.jsx(st,{checked:!a.includes(n),direction:"rtl",label:e,labelClasses:"text-sm",onChange:c=>o(n,c.target.checked)}),IE=({excludedEvents:e,excludedResources:n,toggleEventType:a,toggleResourceType:o})=>{const{updateRoute:c}=Qe(),m=Zg({path:"/users/",filterKey:"name",responseKey:"users"}),y=async(u,p)=>{const x=await m.loadData(u);p(x.map(v=>({label:v.name,value:v.id})))},[h,l]=D.useState(),f=()=>{l(null)};return s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx(zg,{position:"end",trigger:s.jsx(Ue,{color:"outline",label:"Filter"}),children:s.jsxs("div",{className:"flex w-[220px] flex-col gap-8 p-5",children:[s.jsxs(Yi,{children:[s.jsx(An,{excludedItems:e,item:"added",label:"Added",toggleItem:a}),s.jsx(An,{excludedItems:e,item:"edited",label:"Edited",toggleItem:a}),s.jsx(An,{excludedItems:e,item:"deleted",label:"Deleted",toggleItem:a})]}),s.jsxs(Yi,{children:[s.jsx(An,{excludedItems:n,item:"post",label:"Posts",toggleItem:o}),s.jsx(An,{excludedItems:n,item:"page",label:"Pages",toggleItem:o}),s.jsx(An,{excludedItems:n,item:"tag",label:"Tags",toggleItem:o}),s.jsx(An,{excludedItems:n,item:"offer,product",label:"Tiers & offers",toggleItem:o}),s.jsx(An,{excludedItems:n,item:"api_key,integration,setting,user,webhook",label:"Settings & staff",toggleItem:o})]})]})}),s.jsx("div",{className:"w-[200px]",children:s.jsx(Lt,{loadOptions:Ji(y,500),placeholder:"Search staff",value:h,async:!0,defaultOptions:!0,isClearable:!0,onSelect:u=>{u?(l(u),c(`history/view/${u.value}`)):(f(),c("history/view"))}})})]})},CE=({action:e})=>{const{updateRoute:n}=Qe(),a=SE(e);if(a){const{group:o,key:c}=a;return s.jsxs(s.Fragment,{children:[o.slice(0,1).toUpperCase(),o.slice(1),o!==c&&s.jsxs("span",{className:"text-xs",children:[" ",s.jsxs("code",{className:"mb-1 bg-white text-grey-800 dark:bg-grey-900 dark:text-white",children:["(",c,")"]})]})]})}else if(e.resource?.title||e.resource?.name||e.context?.primary_name){const o=EE(e);return o?s.jsx("a",{className:"cursor-pointer font-bold",onClick:c=>{c.preventDefault(),n(o)},children:e.resource?.title||e.resource?.name}):s.jsx(s.Fragment,{children:e.resource?.title||e.resource?.name||e.context?.primary_name})}else return s.jsx("span",{className:"text-grey-500",children:"(unknown)"})},DE=e=>{const a=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).formatToParts(e).reduce((o,{type:c,value:m})=>({...o,[c]:m}),{});return`${a.year}-${a.month}-${a.day} ${a.hour}:${a.minute}:${a.second}`},RE=200,OE=ye.create(({params:e})=>{const n=Zt(),{updateRoute:a}=Qe(),[o,c]=D.useState([]),[m,y]=D.useState(["label"]),{data:h,fetchNextPage:l,isFetchingNextPage:f}=jE({searchParams:{include:"actor,resource",limit:RE.toString(),filter:[o.length&&`event:-[${o.join(",")}]`,m.length&&`resource_type:-[${m.join(",")}]`,e?.user&&`actor_id:'${e.user}'`].filter(Boolean).join("+")},getNextPageParams:(v,_)=>({..._,filter:[_.filter,v.actions.length&&`created_at:<'${DE(new Date(v.actions[v.actions.length-1].created_at))}'`].join("+")}),keepPreviousData:!0}),u=D.useCallback(()=>{h?.isEnd||l()},[h?.isEnd,l]),p=(v,_,k)=>{v(M=>k?M.concat(_):M.filter(T=>T!==_))},x=o.length>0||m.length>0||e?.user;return s.jsx(yt,{afterClose:()=>{a("history")},cancelLabel:"",okLabel:"Close",scrolling:!0,size:"md",stickyFooter:!0,stickyHeader:!0,testId:"history-modal",title:"History",topRightContent:s.jsx(IE,{excludedEvents:o,excludedResources:m,toggleEventType:(v,_)=>p(c,v,!_),toggleResourceType:(v,_)=>p(y,v,!_),userId:e?.user}),onOk:()=>{n.remove(),a("history")},children:s.jsx("div",{className:"relative mt-6",children:s.jsx(cn,{hint:h?.isEnd&&h.actions.length>0?"End of history log":void 0,children:h?.actions?h.actions.length>0?s.jsxs(s.Fragment,{children:[s.jsx(m3,{offset:250,onTrigger:u}),h.actions.map(v=>!v.skip&&s.jsx(On,{avatar:s.jsx(AE,{action:v}),detail:[new Date(v.created_at).toLocaleDateString("default",{year:"numeric",month:"short",day:"2-digit"}),new Date(v.created_at).toLocaleTimeString("default",{hour:"2-digit",minute:"2-digit",second:"2-digit"})].join(" | "),title:s.jsxs("div",{className:"text-sm",children:[TE(v),Sg(v)?"":": ",!Sg(v)&&s.jsx(CE,{action:v}),v.count?s.jsxs(s.Fragment,{children:[" ",v.count," times"]}):null,s.jsxs("span",{children:[" — by ",v.actor?.name||v.actor?.slug]})]}),separator:!0})),f&&s.jsx("div",{className:"flex items-center justify-center p-5",children:s.jsx(Wi,{size:"md"})})]}):s.jsx(hh,{icon:"time-back",children:x?"No entries match your current filters.":"No history entries found."}):h===void 0?s.jsx("div",{className:"flex items-center justify-center px-5 pb-10 pt-12",children:s.jsx(Wi,{})}):s.jsx(hh,{children:"No entries found."})})})})}),$E=ye.create(()=>{const e=ye.useModal(),n=If(),a=If({searchParams:{limit:"100",permissions:"assign"}}),o=Ys(),{updateRoute:c}=Qe(),{config:m}=Je(),y=m.labs.superEditors,h=D.useRef(null),[l,f]=D.useState(""),[u,p]=D.useState(""),[x,v]=D.useState("contributor"),[_,k]=D.useState({}),{data:{users:M}={}}=w_(),{data:{invites:T}={}}=f2(),{mutateAsync:A}=d2(),C=ot();if(D.useEffect(()=>{h.current&&h.current.focus()},[]),D.useEffect(()=>{u==="saved"&&setTimeout(()=>{p("")},2e3)},[u]),D.useEffect(()=>{x!=="contributor"&&o?.isLimited("staff")?o.errorIfWouldGoOverLimit("staff").then(()=>{k(q=>({...q,role:void 0}))}).catch(q=>{if(q instanceof Gs){k(B=>({...B,role:q.message}));return}else throw q}):k(q=>({...q,role:void 0}))},[o,x]),!n.data?.roles||!a.data?.roles)return null;const O=n.data.roles,$=a.data.roles;let W="Send invitation";u==="saving"?W="Sending...":u==="saved"?W="Invite sent!":u==="error"&&(W="Retry");const R=async()=>{if(u!=="saving"){if(!Nt.isEmail(l)){k({email:"Please enter a valid email address."});return}if(M?.some(({email:q})=>q===l)){k({email:"A user with that email address already exists."});return}if(T?.some(({email:q})=>q===l)){k({email:"A user with that email address was already invited."});return}if(!_.role){p("saving");try{await A({email:l,roleId:O.find(({name:q})=>q.toLowerCase()===x.toLowerCase()).id}),p("saved"),xt({title:"Invitation sent",message:`${l}`,type:"success"}),e.remove(),c("staff?tab=invited")}catch(q){p("error");let B="Failed to send invitation",Y=s.jsxs("span",{children:["If the problem persists, ",s.jsxs("a",{href:"https://ghost.org/contact",children:[s.jsx("u",{children:"contact support"}),"."]}),"."]});q instanceof y_&&q.data?.errors?.[0]?.type==="EmailError"&&(Y=s.jsx("span",{children:"Check your Mailgun configuration."})),xt({title:B,message:Y,type:"error"}),C(q,{withToast:!1});return}}}},Z=[{hint:"Can create and edit their own posts, but cannot publish. An Editor needs to approve and publish for them.",label:"Contributor",value:"contributor"},{hint:"A trusted user who can create, edit and publish their own posts, but can’t modify others.",label:"Author",value:"author"},{hint:"Can invite and manage other Authors and Contributors, as well as edit and publish any posts on the site.",label:"Editor",value:"editor"},{hint:"Trusted staff user who should be able to manage all content and users, as well as site settings and options.",label:"Administrator",value:"administrator"}];y&&(Z[2]={hint:"Can invite and manage other Authors and Contributors, as well as edit and publish any posts on the site. Can manage members and moderate comments.",label:"Editor (beta mode)",value:"super editor"});const X=Z.filter(q=>$.some(B=>B.name===q.label||B.name==="Super Editor"&&q.label==="Editor (beta mode)"));return _.email&&(W="Retry"),s.jsx(yt,{afterClose:()=>{c("staff")},cancelLabel:"",okColor:u==="error"||_.email?"red":"black",okLabel:W,testId:"invite-user-modal",title:"Invite a new staff user",width:540,onOk:R,children:s.jsxs("div",{className:"flex flex-col gap-6 py-4",children:[s.jsx("p",{children:"Send an invitation for a new person to create a staff account on your site, and select a role that matches what you’d like them to be able to do."}),s.jsx(Ae,{error:!!_.email,hint:_.email,inputRef:h,placeholder:"jamie@example.com",title:"Email address",value:l,onChange:q=>{f(q.target.value)},onKeyDown:()=>k(q=>({...q,email:void 0}))}),s.jsx("div",{children:s.jsx(h3,{error:!!_.role,hint:_.role,id:"role",options:X,selectedOption:x,separator:!0,title:"Role",onSelect:q=>{v(q)}})})]})})}),Ng=({items:e,setItems:n})=>{const a=x=>!!(x.label&&!x.label.match(/^\s*$/)||x.url!=="/"),o=U0({items:e.map(x=>({...x,errors:{}})),setItems:x=>n(x.map(({url:v,label:_})=>({url:v,label:_}))),blank:{url:"/",label:"",errors:{}},canAddNewItem:a}),c=new RegExp(/^(\/|#|[a-zA-Z0-9-]+:)/),m=x=>{const v={};return(!x.label||x.label.match(/^\s*$/))&&(v.label="You must specify a label"),(!x.url||x.url.match(/\s/)||!Nt.isURL(x.url,{require_protocol:!0})&&!x.url.match(c))&&(v.url="You must specify a valid URL or relative path"),v},y=(x,v)=>{const _=o.items.find(k=>k.id===x);o.updateItem(x,{..._.item,...v})},h=()=>{const x=m(o.newItem);Object.values(x).some(v=>v)?o.setNewItem({...o.newItem,errors:x}):o.addItem()},l=x=>{o.removeItem(x)},f=(x,v)=>{o.moveItem(x,v)},u="new",p=(x,v)=>{if(x===u)o.setNewItem({...o.newItem,errors:{...o.newItem.errors,[v]:void 0}});else{const _=o.items.find(k=>k.id===x).item;o.updateItem(x,{..._,errors:{..._.errors,[v]:void 0}})}};return{items:o.items.map(({item:x,id:v})=>({...x,id:v})),updateItem:y,addItem:h,removeItem:l,moveItem:f,newItem:{...o.newItem,id:u},setNewItem:x=>o.setNewItem({...o.newItem,...x}),clearError:p,validate:()=>{let x=!0;if(o.items.forEach(({item:v,id:_})=>{let k=m(v);Object.values(k).some(M=>M)&&(x=!1,o.updateItem(_,{...v,errors:k}))}),a(o.newItem)){const v=m(o.newItem);Object.values(v).some(_=>_)&&(x=!1,o.setNewItem({...o.newItem,errors:v}))}return x}}},Ag=({baseUrl:e,item:n,updateItem:a,addItem:o,clearError:c,labelPlaceholder:m,unstyled:y,textFieldClasses:h,action:l,className:f,...u})=>s.jsxs("div",{className:we("flex w-full items-start gap-3",f),"data-testid":"navigation-item-editor",...u,children:[s.jsx("div",{className:"flex flex-1 pt-1",children:s.jsx(Ae,{className:h,containerClassName:"grow",error:!!n.errors.label,hint:n.errors.label,placeholder:m,title:"Label",unstyled:y,value:n.label,hideTitle:!0,onChange:p=>a?.({label:p.target.value}),onKeyDown:p=>{a?.({label:p.target.value}),p.key==="Enter"&&(p.preventDefault(),o?.()),n.errors.label&&c?.("label")}})}),s.jsx("div",{className:"flex flex-1 pt-1",children:s.jsx(Hg,{baseUrl:e,className:h,containerClassName:"grow",error:!!n.errors.url,hint:n.errors.url,title:"URL",unstyled:y,value:n.url,hideTitle:!0,onChange:p=>a?.({url:p||""}),onKeyDown:p=>{const x=Bi(p.target.value,e,!0);a?.({url:x.save||""})},onKeyUp:p=>{if(p.key==="Enter"){p.preventDefault();const x=Bi(p.target.value,e,!0);a?.({url:x.save||""}),o?.()}n.errors.url&&c?.("url")}})}),l]}),Ig=({baseUrl:e,navigation:n})=>s.jsxs("div",{className:"w-full pt-2",children:[s.jsx(Bg,{items:n.items,itemSeparator:!1,renderItem:a=>s.jsx(Ag,{action:s.jsx(Ue,{className:"mt-1 self-center",icon:"trash",iconColorClass:"dark:text-white",size:"sm",onClick:()=>n.removeItem(a.id)}),baseUrl:e,clearError:o=>n.clearError(a.id,o),item:a,updateItem:o=>n.updateItem(a.id,o)}),onMove:n.moveItem}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(ut,{colorClass:"text-grey-300 dark:text-grey-900 mt-1",name:"add",size:"sm"}),s.jsx(Ag,{action:s.jsx(Ue,{className:"mx-2 mt-1 self-center rounded bg-green p-1","data-testid":"add-button",icon:"add",iconColorClass:"text-white",size:"sm",unstyled:!0,onClick:n.addItem}),addItem:n.addItem,baseUrl:e,className:"mt-1",clearError:a=>n.clearError(n.newItem.id,a),"data-testid":"new-navigation-item",item:n.newItem,labelPlaceholder:"New item label",updateItem:n.setNewItem})]})]}),LE=ye.create(()=>{const e=Zt(),{updateRoute:n}=Qe(),{localSettings:a,updateSetting:o,saveState:c,handleSave:m,siteData:y}=ss(),[h,l]=gt(a,["navigation","secondary_navigation"]).map(v=>JSON.parse(v||"[]")),f=Ng({items:h,setItems:v=>{o("navigation",JSON.stringify(v))}}),u=Ng({items:l,setItems:v=>o("secondary_navigation",JSON.stringify(v))}),[p,x]=D.useState("primary-nav");return s.jsx(yt,{afterClose:()=>{n("navigation")},buttonsDisabled:c==="saving",cancelLabel:"Close",dirty:a.some(v=>v.dirty),okLabel:c==="saving"?"Saving...":"Save",scrolling:!0,size:"lg",stickyFooter:!0,testId:"navigation-modal",title:"Navigation",onOk:async()=>{f.validate()&&u.validate()&&(await m(),e.remove(),n("navigation"))},children:s.jsx("div",{className:"mb-1 mt-6",children:s.jsx(Dn,{selectedTab:p,tabs:[{id:"primary-nav",title:"Primary",contents:s.jsx(Ig,{baseUrl:y.url,navigation:f})},{id:"secondary-nav",title:"Secondary",contents:s.jsx(Ig,{baseUrl:y.url,navigation:u})}],onTabChange:x})})})}),PE=""+new URL("user-cover-yM4cP_Mo.jpg",import.meta.url).href,FE=""+new URL("latest-posts-1-D7-ilqhR.jpg",import.meta.url).href,UE=""+new URL("latest-posts-2-BPfbGB8B.jpg",import.meta.url).href,zE=""+new URL("latest-posts-3-D72O3dn8.jpg",import.meta.url).href,HE=({senderName:e,senderEmail:n,senderReplyTo:a,headerImage:o,headerIcon:c,headerTitle:m,headerSubtitle:y,showPostTitleSection:h,showExcerpt:l,titleAlignment:f,titleFontCategory:u,titleFontWeight:p,bodyFontCategory:x,authorPlaceholder:v,showCommentCta:_,showFeatureImage:k,showFeedback:M,showLatestPosts:T,showSubscriptionDetails:A,siteTitle:C,footerContent:O,showBadge:$,backgroundColor:W,headerBackgroundColor:R,accentColor:Z,textColor:X,secondaryTextColor:q,headerTextColor:B,secondaryHeaderTextColor:Y,postTitleColor:ae,sectionTitleColor:ee,dividerColor:re,buttonColor:Q,buttonTextColor:ne,linkColor:be,buttonCorners:je,buttonStyle:H,imageCorners:he,linkStyle:ge,dividerStyle:F})=>{const L=c||m,{config:J}=Je(),xe=new Date().toLocaleDateString("default",{year:"numeric",month:"short",day:"numeric"}),Te=new Date().getFullYear(),De=O?O.replace(/<a/g,'<a target="_blank" rel="noopener noreferrer"'):"";let Me;Qi(J)?Me=s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"leading-normal",children:[s.jsx("span",{className:"font-semibold text-grey-900",children:"From: "}),s.jsxs("span",{children:[e," (",n,")"]})]}),s.jsxs("p",{className:"leading-normal",children:[s.jsx("span",{className:"font-semibold text-grey-900",children:"Reply-to: "}),a||n]})]}):Me=s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"leading-normal",children:[s.jsx("span",{className:"font-semibold text-grey-900",children:e}),s.jsxs("span",{children:[" ",n]})]}),s.jsxs("p",{className:"leading-normal",children:[s.jsx("span",{className:"font-semibold text-grey-900",children:"To:"})," Jamie Larson jamie@example.com"]})]});let oe="mb-5 text-pretty leading-[1.7] text-black";return u==="serif"&&x==="serif"?oe=we(oe,"mb-8 font-serif text-[2.0rem] leading-tight"):u!=="serif"&&x==="serif"?oe=we(oe,"mb-8 text-[1.7rem] leading-tight tracking-tight"):u==="serif"&&x!=="serif"?oe=we(oe,"mb-8 font-serif text-[2.0rem] leading-tight"):oe=we(oe,"mb-8 text-[1.9rem] leading-tight tracking-tight"),f==="center"&&(oe=we(oe,"text-center")),s.jsx("div",{className:"relative flex grow flex-col",children:s.jsx("div",{className:"absolute inset-0 m-5 flex items-center justify-center",children:s.jsxs("div",{className:"mx-auto my-0 flex max-h-full w-full max-w-[700px] flex-col overflow-hidden rounded-[4px] text-black shadow-sm",children:[s.jsx("div",{className:"flex-column flex min-h-[77px] justify-center rounded-t-sm border-b border-grey-200 bg-white px-6 text-sm text-grey-700",children:Me}),s.jsxs("div",{className:"overflow-y-auto text-sm",style:{backgroundColor:W},children:[s.jsxs("div",{className:"px-[7rem]",style:{backgroundColor:R},children:[o&&s.jsx("div",{children:s.jsx("img",{alt:"",className:"mb-4 block pt-6",src:o})}),L&&s.jsxs("div",{className:"py-3",children:[c&&s.jsx("img",{alt:"",className:"mx-auto mb-2 size-10",role:"presentation",src:c}),m&&s.jsx("h4",{className:"mb-1 text-center text-[1.6rem] font-bold uppercase leading-tight tracking-tight text-grey-900",style:{color:B},children:m}),y&&s.jsx("h5",{className:"mb-1 text-center text-[1.3rem] font-normal text-grey-700",style:{color:Y},children:y})]}),h&&s.jsxs("div",{className:we("flex flex-col py-8",f==="center"?"items-center":"items-start"),children:[s.jsx("h2",{className:we("text-4xl font-bold leading-supertight text-black",u==="serif"&&"font-serif",p==="normal"&&"font-normal",p==="medium"&&"font-medium",p==="semibold"&&"font-semibold",p==="bold"&&"font-bold",f==="center"?"text-center":"text-left",l?"mb-2":"mb-8"),style:{color:ae},children:"Your email newsletter"}),l&&s.jsx("p",{className:oe,style:{color:B},children:"A subtitle to highlight key points and engage your readers."}),s.jsxs("div",{className:we("flex w-full justify-between text-center text-md leading-none text-grey-700",f==="center"?"flex-col gap-1":"flex-row"),children:[s.jsxs("p",{className:"pb-1 text-[1.3rem]",style:{color:Y},children:["By ",v,s.jsx("span",{className:"before:pl-0.5 before:pr-1 before:content-['•']",children:xe})]}),s.jsx("p",{className:"pb-1 text-[1.3rem] underline",style:{color:Y},children:s.jsx("span",{children:"View in browser"})})]})]}),k&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:we("h-[unset] w-full max-w-[600px] bg-cover bg-no-repeat",h?"":"pt-6"),children:s.jsx("img",{alt:"Feature",className:we("min-h-full min-w-full shrink-0",he==="square"&&"rounded-none",he==="rounded"&&"rounded-md"),src:PE})}),s.jsx("div",{className:"mt-1 w-full max-w-[600px] pb-8 text-center text-[1.3rem] text-grey-700",style:{color:Y},children:"Feature image caption"})]})]}),s.jsxs("div",{className:we("px-[7rem]",R!=="transparent"&&"pt-10"),children:[s.jsxs("div",{className:we("max-w-[600px] border-b border-grey-200 pb-[52px] leading-[27.2px] text-black",F==="dashed"&&"border-dashed",F==="dotted"&&"border-b-2 border-dotted",x==="serif"?"font-serif text-[1.8rem]":"text-[1.7rem] tracking-tight",k||h?"":"pt-8"),style:{borderColor:re},children:[s.jsx("p",{className:"mb-6",style:{color:X},children:"This is what your content will look like when you send one of your posts as an email newsletter to your subscribers."}),s.jsx("p",{className:"mb-6",style:{color:X},children:"Over there on the right you'll see some settings that allow you to customize the look and feel of this template – from colors and typography to layout and buttons – to make it perfectly suited to your brand."}),s.jsx("p",{className:"mb-[52px]",style:{color:X},children:"Email templates are exceptionally finnicky to make, but we've spent a long time optimising this one to make it work beautifully across devices, email clients and content types. So, you can trust that every email you send with Ghost will look great and work well. Just like the rest of your site."}),s.jsx("hr",{className:we("my-[52px] border-[#e0e7eb]",F==="dashed"&&"border-dashed",F==="dotted"&&"border-b-2 border-t-0 border-dotted"),style:{borderColor:re}}),s.jsx("h3",{className:we("mb-[13px] text-[2.6rem] leading-supertight",u==="serif"&&"font-serif",u==="sans_serif"&&"font-sans",p==="normal"&&"font-normal",p==="medium"&&"font-medium",p==="semibold"&&"font-semibold",p==="bold"&&"font-bold"),style:{color:ee},children:"Need inspiration?"}),s.jsxs("p",{className:"mb-[27px]",style:{color:X},children:["We've put together a ",s.jsx("a",{className:we(ge==="underline"&&"underline",ge==="bold"&&"font-bold"),href:"https://ghost.org/help/email-design/",rel:"noopener noreferrer",style:{color:be||Z},target:"_blank",children:"quick guide"})," that walks through all of the available settings, along with a few examples of what's possible."]}),s.jsx("a",{className:we("inline-block border px-[18px] py-2 font-sans text-[15px]",je==="rounded"&&"rounded-[6px]",je==="pill"&&"rounded-full",je==="square"&&"rounded-none",H==="outline"?"bg-transparent":"border-transparent text-white",ge==="bold"?"font-bold":"font-semibold"),href:"https://ghost.org/help/email-design/",rel:"noopener noreferrer",style:H==="outline"?{borderColor:Q||Z,color:Q||Z}:{backgroundColor:Q||Z,color:ne},target:"_blank",children:"Learn more"})]}),(M||_)&&s.jsx("div",{className:we("grid gap-5 border-b border-grey-200 px-6 py-5",F==="dashed"&&"border-dashed",F==="dotted"&&"border-b-2 border-dotted"),style:{borderColor:re},children:s.jsxs("div",{className:"flex justify-center gap-3",children:[M&&s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"pointer-events-none cursor-default whitespace-nowrap rounded-[2.2rem] bg-transparent font-semibold",type:"button",children:s.jsxs("span",{className:"inline-flex items-center gap-2 px-[18px] py-[7px]",style:{color:X},children:[s.jsx(ut,{colorClass:"",name:"thumbs-up",size:"md"}),s.jsx("span",{children:"More like this"})]})}),s.jsx("button",{className:"pointer-events-none cursor-default whitespace-nowrap rounded-[2.2rem] bg-transparent font-semibold",type:"button",children:s.jsxs("span",{className:"inline-flex items-center gap-2 px-[18px] py-[7px]",style:{color:X},children:[s.jsx(ut,{colorClass:"",name:"thumbs-down"}),s.jsx("span",{children:"Less like this"})]})})]}),_&&s.jsx("button",{className:"pointer-events-none cursor-default whitespace-nowrap rounded-[2.2rem] bg-transparent font-semibold",type:"button",children:s.jsxs("span",{className:"inline-flex items-center gap-2 px-[18px] py-[7px]",style:{color:X},children:[s.jsx(ut,{colorClass:"",name:"comment"}),s.jsx("span",{children:"Comment"})]})})]})}),T&&s.jsxs("div",{className:we("border-b border-grey-200 py-6",F==="dashed"&&"border-dashed",F==="dotted"&&"border-b-2 border-dotted"),style:{borderColor:re},children:[s.jsx("h3",{className:"mb-4 mt-2 pb-1 text-[1.2rem] font-semibold uppercase tracking-wide text-black",style:{color:X},children:"Keep reading"}),s.jsxs("div",{className:"flex justify-between gap-4 py-2",children:[s.jsxs("div",{children:[s.jsx("h4",{className:we("mt-0.5 text-[1.9rem] text-black",u==="serif"&&"font-serif",p==="normal"&&"font-normal",p==="medium"&&"font-medium",p==="semibold"&&"font-semibold",p==="bold"&&"font-bold"),style:{color:ee},children:"The three latest posts published on your site"}),s.jsx("p",{className:"m-0 text-base text-grey-700",style:{color:q},children:"Posts sent as an email only will never be shown here."})]}),s.jsx("div",{className:"aspect-square h-auto w-full max-w-[100px] bg-cover bg-no-repeat",children:s.jsx("img",{alt:"Latest post",className:we(he==="square"&&"rounded-none",he==="rounded"&&"rounded-md"),src:FE})})]}),s.jsxs("div",{className:"flex justify-between gap-4 py-2",children:[s.jsxs("div",{children:[s.jsx("h4",{className:we("mt-0.5 text-[1.9rem] text-black",u==="serif"&&"font-serif",p==="normal"&&"font-normal",p==="medium"&&"font-medium",p==="semibold"&&"font-semibold",p==="bold"&&"font-bold"),style:{color:ee},children:"Displayed at the bottom of each newsletter"}),s.jsx("p",{className:"m-0 text-base text-grey-700",style:{color:q},children:"Giving your readers one more place to discover your stories."})]}),s.jsx("div",{className:"aspect-square h-auto w-full max-w-[100px] bg-cover bg-no-repeat",children:s.jsx("img",{alt:"Latest post",className:we(he==="square"&&"rounded-none",he==="rounded"&&"rounded-md"),src:UE})})]}),s.jsxs("div",{className:"flex justify-between gap-4 py-2",children:[s.jsxs("div",{children:[s.jsx("h4",{className:we("mt-0.5 text-[1.9rem] text-black",u==="serif"&&"font-serif",p==="normal"&&"font-normal",p==="medium"&&"font-medium",p==="semibold"&&"font-semibold",p==="bold"&&"font-bold"),style:{color:ee},children:"To keep your work front and center"}),s.jsx("p",{className:"m-0 text-base text-grey-700",style:{color:q},children:"Making sure that your audience stays engaged."})]}),s.jsx("div",{className:"aspect-square h-auto w-full max-w-[100px] bg-cover bg-no-repeat",children:s.jsx("img",{alt:"Latest post",className:we(he==="square"&&"rounded-none",he==="rounded"&&"rounded-md"),src:zE})})]})]}),A&&s.jsxs("div",{className:we("border-b border-grey-200 py-8",F==="dashed"&&"border-dashed",F==="dotted"&&"border-b-2 border-dotted"),style:{borderColor:re},children:[s.jsx("h4",{className:"mb-3 text-[1.2rem] uppercase tracking-wide text-black",style:{color:X},children:"Subscription details"}),s.jsxs("p",{className:"m-0 mb-4 text-base",style:{color:X},children:["You are receiving this because you are a paid subscriber to ",C,". Your subscription will renew on 17 Jul 2024."]}),s.jsxs("div",{className:"flex",children:[s.jsxs("div",{className:"shrink-0 text-base",children:[s.jsx("p",{style:{color:X},children:"Name: Jamie Larson"}),s.jsx("p",{style:{color:X},children:"Email: jamie@example.com"}),s.jsx("p",{style:{color:X},children:"Member since: 17 July 2023"})]}),s.jsx("span",{className:we("w-full self-end whitespace-nowrap text-right text-base",ge==="underline"&&"underline",ge==="bold"&&"font-bold"),style:{color:be||Z},children:"Manage subscription"})]})]}),s.jsxs("div",{className:"flex flex-col items-center pt-10",children:[s.jsx("div",{dangerouslySetInnerHTML:{__html:De||""},className:"text break-words px-8 py-3 text-center text-[1.3rem] leading-base text-grey-700 [&_a]:underline",style:{color:q}}),s.jsxs("div",{className:"px-8 pb-14 pt-3 text-center text-[1.3rem] text-grey-700",children:[s.jsxs("span",{style:{color:q},children:[C," © ",Te," — "]}),s.jsx("span",{className:"pointer-events-none cursor-auto underline",style:{color:q},children:"Unsubscribe"})]}),$&&s.jsx("div",{className:"flex flex-col items-center pb-[40px] pt-[10px]",children:s.jsxs("a",{className:"pointer-events-none inline-flex cursor-auto items-center px-2 py-1 text-[1.25rem] font-semibold tracking-tight text-grey-900",href:"https://ghost.org",style:{color:X},children:[s.jsx(p2,{className:"mr-[6px] size-4"}),s.jsx("span",{children:"Powered by Ghost"})]})})]})]})]})]})})})},cl=(e,n,a)=>Qi(n)&&!Vf(n)&&a?a:e.sender_email||a||"",Gf=(e,n,a,o)=>e.sender_reply_to==="newsletter"?Qi(n)?"":cl(e,n,o):e.sender_reply_to==="support"?a||o||"":e.sender_reply_to,BE=({newsletter:e})=>{const{currentUser:n,settings:a,siteData:o,config:c}=Je(),[m,y,h,l,f]=gt(a,["title","icon","comments_enabled","support_email_address","default_email_address"]);let u=null;e.show_header_title?u=m||null:e.show_header_name&&(u=e.name);const p=e.show_header_title&&e.show_header_name?e.name:void 0,x=e.show_comment_cta&&h!=="off",v=e.feedback_enabled&&c.labs.audienceFeedback,_=()=>{const B=e.background_color;return/#([0-9a-f]{3}){1,2}$/i.test(B)?B:"#ffffff"},k=()=>{const B=e.header_background_color;return!B||B==="transparent"?"transparent":/#([0-9a-f]{3}){1,2}$/i.test(B)?B:"transparent"},M=()=>{const B=e.button_color;if(/#([0-9a-f]{3}){1,2}$/i.test(B||""))return B;if(B===null){const ae=_();return Nr(ae).hex()}return o.accent_color},T=()=>{const B=e.button_style,Y=M();if(Y&&B==="fill")return Nr(Y).hex()},A=()=>{const B=e.link_color===void 0?"accent":e.link_color,Y=/#([0-9a-f]{3}){1,2}$/i;return B==="accent"?o.accent_color:Y.test(B||"")?B:Nr(_()).hex()},C=()=>{const B=e.post_title_color;if(/#([0-9a-f]{3}){1,2}$/i.test(B||""))return B;if(B==="accent")return o.accent_color;const ae=k(),ee=ae==="transparent"?_():ae;return Nr(ee).hex()},O=()=>{const B=e.section_title_color;return/#([0-9a-f]{3}){1,2}$/i.test(B||"")?B:B==="accent"?o.accent_color:Nr(_()).hex()},$=()=>{const B=e.divider_color;return/#([0-9a-f]{3}){1,2}$/i.test(B||"")?B:B==="accent"?o.accent_color:"#e0e7eb"},W=Nr(_()).hex(),R=Nr(_()).alpha(.5).toString(),Z=k()==="transparent"?W:Nr(k()).hex(),X=k()==="transparent"?R:Nr(k()).alpha(.5).toString(),q={backgroundColor:_(),headerBackgroundColor:k(),postTitleColor:C()||void 0,sectionTitleColor:O()||void 0,buttonColor:M()||void 0,buttonTextColor:T()||void 0,linkColor:A()||void 0,dividerColor:$()||void 0,textColor:W,secondaryTextColor:R,headerTextColor:Z,secondaryHeaderTextColor:X};return s.jsx(HE,{accentColor:o.accent_color,authorPlaceholder:n.name||n.email,backgroundColor:q.backgroundColor||"#ffffff",bodyFontCategory:e.body_font_category,buttonCorners:e.button_corners||"rounded",buttonStyle:e.button_style||"fill",dividerStyle:e.divider_style||"solid",footerContent:e.footer_content,headerBackgroundColor:q.headerBackgroundColor||"transparent",headerIcon:e.show_header_icon?y:void 0,headerImage:e.header_image,headerSubtitle:p,headerTitle:u,imageCorners:e.image_corners||"square",linkStyle:e.link_style||"underline",senderEmail:cl(e,c,f),senderName:e.sender_name||m,senderReplyTo:Gf(e,c,l,f),showBadge:e.show_badge,showCommentCta:x,showExcerpt:e.show_excerpt,showFeatureImage:e.show_feature_image,showFeedback:v,showLatestPosts:e.show_latest_posts,showPostTitleSection:e.show_post_title_section,showSubscriptionDetails:e.show_subscription_details,siteTitle:m,titleAlignment:e.title_alignment,titleFontCategory:e.title_font_category,titleFontWeight:e.title_font_weight||"bold",...q})},WE=({newsletter:e,updateNewsletter:n,errors:a,clearError:o})=>{const{settings:c,config:m}=Je(),[y,h]=gt(c,["default_email_address","support_email_address"]),[l,f]=D.useState(Gf(e,m,h,y)||"");let u=cl(e,m,y);const p=D.useCallback(v=>{f(v.target.value),n({sender_reply_to:v.target.value||"newsletter"})},[n,f]),x=()=>{const v=Gf(e,m,h,y)||"";f(v)};return s.jsx(Ae,{error:!!a.sender_reply_to,hint:a.sender_reply_to,maxLength:191,placeholder:u||"",title:"Reply-to email",value:l,onBlur:x,onChange:p,onKeyDown:()=>o("sender_reply_to")})},qE=({newsletter:e,onlyOne:n,updateNewsletter:a,validate:o,errors:c,clearError:m})=>{const{updateRoute:y}=Qe(),{mutateAsync:h}=o0(),l=Ys(),{settings:f,config:u,siteData:p}=Je(),[x,v]=gt(f,["icon","default_email_address"]),{mutateAsync:_}=Xs(),[k,M]=D.useState("generalSettings"),{localSettings:T}=ss(),[A]=gt(T,["title"]),C=ot(),{data:{newsletters:O}={}}=a0(),$=["all","paid"].includes(dr(f,"comments_enabled")||"");let W=cl(e,u,v);const[R,Z]=D.useState(O||[]),X=R.filter(H=>H.status==="active");D.useEffect(()=>{Z(O||[])},[O]);const q=[{value:"serif",label:"Elegant serif",className:"font-serif"},{value:"sans_serif",label:"Clean sans-serif"}],B={sans_serif:{options:[{value:"normal",label:"Regular",className:"font-normal"},{value:"medium",label:"Medium",className:"font-medium"},{value:"semibold",label:"Semi-bold",className:"font-semibold"},{value:"bold",label:"Bold",className:"font-bold"}]},serif:{options:[{value:"normal",label:"Regular",className:"font-normal"},{value:"bold",label:"Bold",className:"font-bold"}],map:{medium:"normal",semibold:"bold"}}},Y=()=>e.background_color==="light"?!1:Nr(e.background_color).hex().toLowerCase()==="#ffffff",ae=async()=>{if(e.status==="active")ye.show(Et,{title:"Archive newsletter",prompt:s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"mb-6",children:["Your newsletter ",s.jsx("strong",{children:e.name})," will no longer be visible to members or available as an option when publishing new posts."]}),s.jsx("div",{children:"Existing posts previously sent as this newsletter will remain unchanged."})]}),okLabel:"Archive",okColor:"red",onOk:async H=>{try{await h({...e,status:"archived"}),H?.remove(),xt({type:"success",message:"Newsletter archived"})}catch(he){C(he)}}});else{try{await l?.errorIfWouldGoOverLimit("newsletters")}catch(H){if(H instanceof Gs){ye.show(Xr,{prompt:H.message||"Your current plan doesn't support more newsletters.",onOk:()=>y({route:"/pro",isExternal:!0})});return}else throw H}ye.show(Et,{title:"Reactivate newsletter",prompt:s.jsxs(s.Fragment,{children:["Reactivating ",s.jsx("strong",{children:e.name})," will immediately make it visible to members and re-enable it as an option when publishing new posts."]}),okLabel:"Reactivate",onOk:async H=>{await h({...e,status:"active"}),H?.remove(),xt({type:"success",message:"Newsletter reactivated"})}})}},ee=()=>{if(!Qi(u))return s.jsx(Ae,{error:!!c.sender_email,hint:c.sender_email,placeholder:W||"",title:"Sender email address",value:e.sender_email||"",onChange:H=>a({sender_email:H.target.value}),onKeyDown:()=>m("sender_email")});if(Vf(u))return s.jsx(Ae,{error:!!c.sender_email,hint:c.sender_email,maxLength:191,placeholder:v,title:"Sender email address",value:e.sender_email||"",onChange:H=>{a({sender_email:H.target.value})},onKeyDown:()=>m("sender_email")})},re=B[e.title_font_category||"sans_serif"].options,Q=()=>{const H=e.title_font_category||"sans_serif",he=e.title_font_weight,ge=B[H].map,F=ge&&ge[he]||he;return re.find(J=>J.value===F)||re[0]},ne=H=>{const he=H?.value||"sans_serif",ge=e.title_font_weight;let F=ge;return B[he].options.find(L=>L.value===ge)||(F=B[he].map?.[ge]||"bold"),a({title_font_category:he,title_font_weight:F})},be=[{id:"generalSettings",title:"General",contents:s.jsxs(s.Fragment,{children:[s.jsxs(tt,{className:"mt-6",gap:"sm",margins:"lg",title:"Name and description",children:[s.jsx(Ae,{error:!!c.name,hint:c.name,maxLength:191,placeholder:"Weekly Roundup",title:"Name",value:e.name||"",onChange:H=>a({name:H.target.value}),onKeyDown:()=>m("name")}),s.jsx($n,{maxLength:2e3,rows:2,title:"Description",value:e.description||"",onChange:H=>a({description:H.target.value})})]}),s.jsxs(tt,{className:"mt-6",gap:"sm",margins:"lg",title:"Email info",children:[s.jsx(Ae,{maxLength:191,placeholder:A,title:"Sender name",value:e.sender_name||"",onChange:H=>a({sender_name:H.target.value})}),ee(),s.jsx(WE,{clearError:m,errors:c,newsletter:e,updateNewsletter:a,validate:o})]}),s.jsx(tt,{className:"mt-6",gap:"sm",margins:"lg",title:"Member settings",children:s.jsx(st,{checked:e.subscribe_on_signup,direction:"rtl",label:"Subscribe new members on signup",labelStyle:"value",onChange:H=>a({subscribe_on_signup:H.target.checked})})}),s.jsx("div",{className:"mb-5 mt-10",children:e.status==="active"?!n&&s.jsx(Ue,{color:"red",disabled:X.length===1,label:"Archive newsletter",link:!0,onClick:ae}):s.jsx(Ue,{color:"green",label:"Reactivate newsletter",link:!0,onClick:ae})})]})},{id:"content",title:"Content",contents:s.jsxs(s.Fragment,{children:[s.jsxs(tt,{className:"mt-6",gap:"sm",margins:"lg",title:"Header",children:[s.jsxs("div",{children:[s.jsx("div",{children:s.jsx(bt,{className:"mb-2",level:6,children:"Header image"})}),s.jsxs("div",{className:"flex-column flex gap-1",children:[s.jsx(un,{deleteButtonClassName:"!top-1 !right-1",height:e.header_image?"66px":"64px",id:"logo",imageURL:e.header_image||void 0,onDelete:()=>{a({header_image:null})},onUpload:async H=>{try{const he=on(await _({file:H}));a({header_image:he})}catch(he){C(he)}},children:s.jsx(ut,{colorClass:"text-grey-700 dark:text-grey-300",name:"picture"})}),s.jsx(Gr,{children:"1200×600 recommended. Use a transparent PNG for best results on any background."})]})]}),s.jsxs(Yi,{children:[x&&s.jsx(st,{checked:e.show_header_icon,direction:"rtl",label:"Publication icon",onChange:H=>a({show_header_icon:H.target.checked})}),s.jsx(st,{checked:e.show_header_title,direction:"rtl",label:"Publication title",onChange:H=>a({show_header_title:H.target.checked})}),s.jsx(st,{checked:e.show_header_name,direction:"rtl",label:"Newsletter name",onChange:H=>a({show_header_name:H.target.checked})})]})]}),s.jsxs(tt,{className:"mt-6",gap:"xs",margins:"lg",title:"Title section",children:[s.jsx(st,{checked:e.show_post_title_section,direction:"rtl",label:"Post title",onChange:H=>a({show_post_title_section:H.target.checked})}),e.show_post_title_section&&s.jsx(st,{checked:e.show_excerpt,direction:"rtl",label:"Post excerpt",onChange:H=>a({show_excerpt:H.target.checked})}),s.jsx(st,{checked:e.show_feature_image,direction:"rtl",label:"Feature image",onChange:H=>a({show_feature_image:H.target.checked})})]}),s.jsxs(tt,{className:"mt-6",gap:"sm",margins:"lg",title:"Footer",children:[s.jsxs(Yi,{gap:"lg",children:[s.jsx(st,{checked:e.feedback_enabled,direction:"rtl",label:"Ask your readers for feedback",onChange:H=>a({feedback_enabled:H.target.checked})}),$&&s.jsx(st,{checked:e.show_comment_cta,direction:"rtl",label:"Add a link to your comments",onChange:H=>a({show_comment_cta:H.target.checked})}),s.jsx(st,{checked:e.show_latest_posts,direction:"rtl",label:"Share your latest posts",onChange:H=>a({show_latest_posts:H.target.checked})}),s.jsx(st,{checked:e.show_subscription_details,direction:"rtl",label:"Show subscription details",onChange:H=>a({show_subscription_details:H.target.checked})})]}),s.jsx(ld,{hint:"Any extra information or legal text",nodes:"MINIMAL_NODES",placeholder:" ",title:"Email footer",value:e.footer_content||"",onChange:H=>a({footer_content:H})})]}),s.jsx(Va,{}),s.jsxs("div",{className:"my-5 flex w-full items-start",children:[s.jsx("span",{children:s.jsx(ut,{className:"mr-2 mt-[-1px]",colorClass:"text-red",name:"heart"})}),s.jsx(tt,{marginBottom:!1,children:s.jsx(st,{checked:e.show_badge,direction:"rtl",label:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"text-sm md:text-base",children:"Promote independent publishing"}),s.jsx("span",{className:"text-[11px] leading-tight text-grey-700 md:text-xs md:leading-tight",children:"Show you're a part of the indie publishing movement with a small badge in the footer"})]}),labelStyle:"value",onChange:H=>a({show_badge:H.target.checked})})})]})]})},{id:"design",title:"Design",contents:s.jsxs(s.Fragment,{children:[s.jsxs(tt,{className:"mt-6",gap:"xs",margins:"lg",title:"Global",children:[s.jsx("div",{className:"mb-1",children:s.jsx(Yr,{direction:"rtl",eyedropper:!0,swatches:[{hex:"#ffffff",value:"light",title:"White"}],title:"Background color",value:e.background_color||"light",onChange:H=>a({background_color:H})})}),s.jsxs("div",{className:"flex w-full items-center justify-between gap-2",children:[s.jsx("div",{className:"shrink-0",children:"Heading font"}),s.jsx(Lt,{containerClassName:"max-w-[200px]",options:q,selectedOption:q.find(H=>H.value===e.title_font_category),onSelect:ne})]}),s.jsxs("div",{className:"flex w-full items-center justify-between gap-2",children:[s.jsx("div",{className:"shrink-0",children:"Heading weight"}),s.jsx(Lt,{containerClassName:"max-w-[200px]",options:re,selectedOption:Q(),onSelect:H=>a({title_font_weight:H?.value})})]}),s.jsxs("div",{className:"flex w-full items-center justify-between gap-2",children:[s.jsx("div",{className:"shrink-0",children:"Body font"}),s.jsx(Lt,{containerClassName:"max-w-[200px]",options:q,selectedOption:q.find(H=>H.value===e.body_font_category),testId:"body-font-select",onSelect:H=>a({body_font_category:H?.value})})]})]}),s.jsxs(tt,{className:"mt-6",gap:"xs",margins:"lg",title:"Header",children:[s.jsx("div",{className:"mb-1",children:s.jsx(Yr,{direction:"rtl",eyedropper:!0,swatches:[{value:"transparent",title:"Transparent",hex:"#00000000"}],title:"Header background color",value:e.header_background_color||"transparent",onChange:H=>a({header_background_color:H})})}),s.jsx("div",{className:"mb-1",children:s.jsx(Yr,{direction:"rtl",eyedropper:!0,swatches:[{value:null,title:"Auto",hex:Y()?"#ffffff":"#000000"},{value:"accent",title:"Accent",hex:p.accent_color}],title:"Post title color",value:e.post_title_color,onChange:H=>a({post_title_color:H})})}),s.jsxs("div",{className:"flex w-full justify-between",children:[s.jsx("div",{children:"Title alignment"}),s.jsx(an,{activeKey:e.title_alignment,buttons:[{key:"left",icon:"align-left",iconSize:14,label:"Align left",tooltip:"Left",hideLabel:!0,link:!1,size:"sm",onClick:()=>a({title_alignment:"left"}),disabled:!e.show_post_title_section},{key:"center",icon:"align-center",iconSize:14,label:"Align center",tooltip:"Center",hideLabel:!0,link:!1,size:"sm",onClick:()=>a({title_alignment:"center"}),disabled:!e.show_post_title_section}],clearBg:!1})]})]}),s.jsxs(tt,{className:"mt-6",gap:"xs",margins:"lg",title:"Body",children:[s.jsx("div",{className:"mb-1",children:s.jsx(Yr,{direction:"rtl",eyedropper:!0,swatches:[{value:null,title:"Auto",hex:Y()?"#ffffff":"#000000"},{value:"accent",title:"Accent",hex:p.accent_color}],title:"Section title color",value:e.section_title_color,onChange:H=>a({section_title_color:H})})}),s.jsx("div",{className:"mb-1",children:s.jsx(Yr,{direction:"rtl",eyedropper:!0,swatches:[{value:"accent",title:"Accent",hex:p.accent_color},{value:null,title:"Auto",hex:Y()?"#ffffff":"#000000"}],title:"Button color",value:e.button_color,onChange:H=>a({button_color:H})})}),s.jsxs("div",{className:"flex w-full justify-between",children:[s.jsx("div",{children:"Button style"}),s.jsx(an,{activeKey:e.button_style||"fill",buttons:[{key:"fill",icon:"squircle-fill",iconSize:14,label:"Fill",tooltip:"Fill",hideLabel:!0,link:!1,size:"sm",onClick:()=>a({button_style:"fill"})},{key:"outline",icon:"squircle",iconSize:14,label:"Outline",tooltip:"Outline",hideLabel:!0,link:!1,size:"sm",onClick:()=>a({button_style:"outline"})}],clearBg:!1})]}),s.jsxs("div",{className:"flex w-full justify-between",children:[s.jsx("div",{children:"Button corners"}),s.jsx(an,{activeKey:e.button_corners||"rounded",buttons:[{key:"square",icon:"square",iconSize:14,label:"Square",tooltip:"Squared",hideLabel:!0,link:!1,size:"sm",onClick:()=>a({button_corners:"square"})},{key:"rounded",icon:"squircle",iconSize:14,label:"Rounded",tooltip:"Rounded",hideLabel:!0,link:!1,size:"sm",onClick:()=>a({button_corners:"rounded"})},{key:"pill",icon:"circle",iconSize:14,label:"Pill",tooltip:"Pill",hideLabel:!0,link:!1,size:"sm",onClick:()=>a({button_corners:"pill"})}],clearBg:!1})]}),s.jsx("div",{className:"mb-1",children:s.jsx(Yr,{direction:"rtl",eyedropper:!0,swatches:[{value:"accent",title:"Accent",hex:p.accent_color},{value:null,title:"Auto",hex:Y()?"#ffffff":"#000000"}],title:"Link color",value:e.link_color,onChange:H=>a({link_color:H})})}),s.jsxs("div",{className:"flex w-full justify-between",children:[s.jsx("div",{children:"Link style"}),s.jsx(an,{activeKey:e.link_style||"underline",buttons:[{key:"underline",icon:"text-underline",iconSize:14,label:"Underline",tooltip:"Underline",hideLabel:!0,link:!1,size:"sm",onClick:()=>a({link_style:"underline"})},{key:"regular",icon:"text-regular",iconSize:14,label:"Regular",tooltip:"Regular",hideLabel:!0,link:!1,size:"sm",onClick:()=>a({link_style:"regular"})},{key:"bold",icon:"text-bold",iconSize:14,label:"Bold",tooltip:"Bold",hideLabel:!0,link:!1,size:"sm",onClick:()=>a({link_style:"bold"})}],clearBg:!1})]}),s.jsxs("div",{className:"flex w-full justify-between",children:[s.jsx("div",{children:"Image corners"}),s.jsx(an,{activeKey:e.image_corners||"square",buttons:[{key:"square",icon:"square",iconSize:14,label:"Square",tooltip:"Squared",hideLabel:!0,link:!1,size:"sm",onClick:()=>a({image_corners:"square"})},{key:"rounded",icon:"squircle",iconSize:14,label:"Rounded",tooltip:"Rounded",hideLabel:!0,link:!1,size:"sm",onClick:()=>a({image_corners:"rounded"})}],clearBg:!1})]}),s.jsx("div",{className:"mb-1",children:s.jsx(Yr,{direction:"rtl",eyedropper:!0,swatches:[{value:"light",title:"Light",hex:"#e0e7eb"},{value:"accent",title:"Accent",hex:p.accent_color}],title:"Divider color",value:e.divider_color||"light",onChange:H=>a({divider_color:H})})})]})]})}],je=H=>{M(H)};return s.jsx("div",{className:"flex flex-col",children:s.jsx("div",{className:"px-7 pb-7 pt-0",children:s.jsx(Dn,{selectedTab:k,stickyHeader:!0,tabs:be,onTabChange:je})})})},YE=({newsletter:e,onlyOne:n})=>{const{config:a}=Je(),{mutateAsync:o}=o0(),{updateRoute:c}=Qe(),m=ot(),{formState:y,saveState:h,updateForm:l,setFormState:f,handleSave:u,validate:p,errors:x,clearError:v,okProps:_}=kr({initialState:e,savingDelay:500,onSave:async()=>{const{meta:{sent_email_verification:[A]=[]}={}}=await o(y);let C;A&&A==="sender_email"?C=s.jsx("div",{children:"We‘ve sent a confirmation email to the new address."}):A&&A==="sender_reply_to"&&(C=s.jsx("div",{children:"We‘ve sent a confirmation email to the new address."})),C&&xt({icon:"email",message:C,type:"info"})},onSaveError:m,onValidate:()=>{const A={};return y.name||(A.name="A name is required for your newsletter"),y.sender_email&&!Nt.isEmail(y.sender_email)?A.sender_email="Enter a valid email address":y.sender_email&&Vf(a)&&y.sender_email.split("@")[1]!==oh(a)&&(A.sender_email=`Email address must end with @${oh(a)}`),y.sender_reply_to&&!Nt.isEmail(y.sender_reply_to)&&!["newsletter","support"].includes(y.sender_reply_to)&&(A.sender_reply_to="Enter a valid email address"),A}}),k=A=>{l(C=>({...C,...A}))};D.useEffect(()=>{f(()=>e)},[f,e]);const M=s.jsx(BE,{newsletter:y}),T=s.jsx(qE,{clearError:v,errors:x,newsletter:y,onlyOne:n,updateNewsletter:k,validate:p});return s.jsx(Zs,{afterClose:()=>c("newsletters"),buttonsDisabled:_.disabled,cancelLabel:"Close",deviceSelector:!1,dirty:h==="unsaved",okColor:_.color,okLabel:_.label||"Save",preview:M,previewBgColor:"grey",previewToolbar:!1,sidebar:T,sidebarPadding:!1,testId:"newsletter-modal",title:"Newsletter",onOk:async()=>{await u({fakeWhenUnchanged:!0})}})},GE=({params:e})=>{const{data:{newsletters:n,isEnd:a}={},fetchNextPage:o}=a0(),c=n?.find(({id:m})=>m===e?.id);return D.useEffect(()=>{!c&&!a&&o()},[o,a,c]),c?s.jsx(YE,{newsletter:c,onlyOne:n.length===1}):null},XE=ye.create(GE),wx=({id:e})=>{const{updateRoute:n}=Qe(),{data:{offers:a=[]}={}}=e0(e||""),[o,c]=D.useState(),[m,y]=D.useState(""),{siteData:h}=Je();D.useEffect(()=>{if(a.length>0){const k=a[0],M=`${ln(h)}${k?.code}`;y(M),c(k)}},[a,h]);const[l,f]=D.useState(!1),u=()=>{let k="";switch(o?.type){case"percent":k=o?.amount+"% discount";break;case"fixed":k=Wg(h2(o?.amount))+" "+o?.currency+" discount";break;case"trial":k=o?.amount+" days free trial";break}return`${encodeURIComponent(o?.name||"")} — Check out ${encodeURIComponent(k)} on:`},p=async()=>{await navigator.clipboard.writeText(m),f(!0),setTimeout(()=>f(!1),2e3)},x=()=>{window.open(`https://twitter.com/intent/tweet?url=${encodeURI(m)}&text=${u()}`,"_blank")},v=()=>{window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURI(m)}`,"_blank")},_=()=>{window.open(`http://www.linkedin.com/shareArticle?mini=true&url=${encodeURI(m)}&title=${u()}`,"_blank")};return s.jsx(yt,{afterClose:()=>{n("offers")},animate:!1,backDropClick:!1,footer:!1,height:"full",size:"lg",testId:"offer-success-modal",topRightContent:"close",width:1140,children:s.jsxs("div",{className:"-mt-6 flex h-full flex-col items-center justify-center text-center",children:[s.jsx("div",{className:"absolute left-6 top-5",children:s.jsx(fd,{activeItemClassName:"hidden md:!block md:!visible",containerClassName:"whitespace-nowrap",itemClassName:"hidden md:!block md:!visible",items:[{label:"Offers",onClick:()=>{n("offers/edit")}},{label:o?.name||""}],separatorClassName:"hidden md:!block md:!visible",backIcon:!0,onBack:()=>{n("offers/edit")}})}),s.jsx(ut,{colorClass:"text-grey-700 -mt-4",name:"tags-check",size:"xl"}),s.jsx("h1",{className:"mt-6 text-4xl",children:"Your new offer is live!"}),s.jsx("p",{className:"mt-3 max-w-[510px] text-[1.6rem]",children:"You can share the link anywhere. In your newsletter, social media, a podcast, or in-person. It all just works."}),s.jsxs("div",{className:"mt-8 flex w-full max-w-md flex-col gap-8",children:[s.jsxs("div",{className:"flex flex-col-reverse gap-2",children:[s.jsx(Ae,{name:"offer-url",type:"url",value:m,disabled:!0}),s.jsx(Ue,{color:"green",label:l?"Copied!":"Copy link",fullWidth:!0,onClick:p})]}),s.jsx("div",{className:'flex items-center gap-4 text-xs font-medium before:h-px before:grow before:bg-grey-300 before:content-[""] after:h-px after:grow after:bg-grey-300 after:content-[""] dark:before:bg-grey-800 dark:after:bg-grey-800',children:"OR"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Ue,{className:"h-8 border border-grey-300 dark:border-grey-800",icon:"twitter-x",iconColorClass:"w-[14px] h-[14px]",size:"sm",fullWidth:!0,onClick:x}),s.jsx(Ue,{className:"h-8 border border-grey-300 dark:border-grey-800",icon:"facebook",size:"sm",fullWidth:!0,onClick:v}),s.jsx(Ue,{className:"h-8 border border-grey-300 dark:border-grey-800",icon:"linkedin",size:"sm",fullWidth:!0,onClick:_})]})]})]})})},Zi=({href:e,onDestroyed:n,selectedTab:a,portalParent:o})=>{a||(a="signup");const c=D.useRef(null),[m,y]=D.useState(!1),[h,l]=D.useState(!0),f=D.useCallback(()=>{setTimeout(()=>{c.current&&l(!1)},300)},[c]);if(D.useEffect(()=>{const x=v=>{if(!e)return;new URL(v.origin).origin===new URL(e).origin&&v?.data?.type==="portal-preview-ready"&&f()};return window.addEventListener("message",x,!0),()=>{window.removeEventListener("message",x,!0),n?.()}},[e,n,f,m]),!e)return null;let u="mt-[-7%] flex h-screen items-center justify-center",p="hidden";return o==="preview"?(u="absolute z-50 mt-[-7%] flex h-screen items-center justify-center",p="invisible"):o==="offers"&&(u="absolute z-50 flex w-full h-full items-center justify-center",p="invisible"),s.jsxs(s.Fragment,{children:[h&&s.jsx("div",{className:u,children:s.jsx("span",{children:s.jsx(Wi,{})})}),s.jsx("iframe",{ref:c,className:!h&&m?"":p,"data-testid":"portal-preview",height:"100%",src:e,title:"Portal Preview",width:"100%",onLoad:()=>{y(!0)}})]})},yx=(e,n)=>{const{disableBackground:a=!1,name:o,code:c,displayTitle:m="",displayDescription:y="",type:h,cadence:l,amount:f=0,duration:u,durationInMonths:p,currency:x="usd",status:v,tierId:_}=e;n=n.replace(/\/$/,"");const k="/?v=modal-portal-offer#/portal/preview/offer",M=new URLSearchParams;return M.append("disableBackground","false"),M.append("name",encodeURIComponent(o)),M.append("code",encodeURIComponent(c)),M.append("display_title",encodeURIComponent(m)),M.append("display_description",encodeURIComponent(y)),M.append("type",encodeURIComponent(h)),M.append("cadence",encodeURIComponent(l)),M.append("amount",encodeURIComponent(f)),M.append("duration",encodeURIComponent(u)),M.append("duration_in_months",encodeURIComponent(p)),M.append("currency",encodeURIComponent(x)),M.append("status",encodeURIComponent(v)),M.append("tier_id",encodeURIComponent(_)),a&&M.append("disableBackground","true"),`${n}${k}?${M.toString()}`},KE=e=>{const n=[];return e.forEach(a=>{n.push({label:`${a.name} - Monthly`,value:`${a.id}-month-${a.currency}`}),n.push({label:`${a.name} - Yearly`,value:`${a.id}-year-${a.currency}`})}),n};function ZE(e){return e.toString().toLowerCase().trim().replace(/\s+/g,"-").replace(/[^\w\-]+/g,"").replace(/\-\-+/g,"-")}const Cg=({type:e,checked:n,onClick:a})=>{const o=n?"bg-black text-white dark:bg-white dark:text-black":"border border-grey-300 dark:border-grey-800";return s.jsx("button",{className:"text-left",type:"button",onClick:a,children:s.jsxs("div",{className:"flex gap-3",children:[s.jsx("div",{className:`mt-0.5 flex size-4 items-center justify-center rounded-full ${o}`,children:n?s.jsx(ut,{className:"w-[7px] stroke-[4]",name:"check",size:"custom"}):null}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{children:e.title}),s.jsx("span",{className:"text-sm",children:e.description})]})]})})},Dg=e=>{const{fixedAmount:n=0,percentAmount:a=0,trialAmount:o=0,amount:c=0}=e;switch(e.type){case"fixed":return n*100;case"percent":return a;case"trial":return o;default:return c}},VE=({tierOptions:e,handleTierChange:n,selectedTier:a,typeOptions:o,durationOptions:c,handleTypeChange:m,handleDurationChange:y,overrides:h,handleAmountTypeChange:l,handleNameInput:f,handleTextAreaInput:u,handleDisplayTitleInput:p,handleDurationInMonthsInput:x,handleAmountInput:v,handleCodeInput:_,clearError:k,errors:M,testId:T,handleTrialAmountInput:A,amountOptions:C})=>{const $=a?.label?.includes("Yearly")?c.filter(re=>re.value!=="repeating"):c,[W,R]=D.useState(0),Z=W>40?"text-red":"text-green",{siteData:X}=Je(),[q,B]=D.useState(!1),Y=ln(X),ae=`${Y}${h.code.value}`,ee=async()=>{await navigator.clipboard.writeText(ae),B(!0),setTimeout(()=>B(!1),2e3)};return s.jsx("div",{className:"pt-7","data-testId":T,children:s.jsxs(tt,{children:[s.jsxs("section",{children:[s.jsx("h2",{className:"mb-4 text-lg",children:"General"}),s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx(Ae,{error:!!M.name,hint:M.name||s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{children:"Visible to members on Stripe Checkout page"}),s.jsxs("strong",{children:[s.jsx("span",{className:`${Z}`,children:W})," / 40"]})]}),maxLength:40,placeholder:"Black Friday",title:"Offer name",onChange:re=>{f(re),R(re.target.value.length)},onKeyDown:()=>k("name")}),s.jsx(Ae,{error:!!M.displayTitle,hint:M.displayTitle,placeholder:"Black Friday Special",title:"Display title",value:h.displayTitle.value,onChange:re=>{p(re)},onKeyDown:()=>k("displayTitle")}),s.jsx($n,{placeholder:"Take advantage of this limited-time offer.",title:"Display description",value:h.displayDescription,onChange:re=>{u(re)}})]})]}),s.jsxs("section",{className:"mt-4",children:[s.jsx("h2",{className:"mb-4 text-lg",children:"Details"}),s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsxs("div",{className:"flex flex-col gap-4 rounded-md border border-grey-200 p-4 dark:border-grey-800",children:[s.jsx(Cg,{checked:h.type!=="trial",type:o[0],onClick:()=>{m("percent")}}),s.jsx(Cg,{checked:h.type==="trial",type:o[1],onClick:()=>{m("trial")}})]}),s.jsx(Lt,{options:e,selectedOption:a,testId:"tier-cadence-select-offers",title:"Tier — Cadence",onSelect:re=>{re&&n(re)}}),h.type!=="trial"&&s.jsxs(s.Fragment,{children:[" ",s.jsxs("div",{className:"relative",children:[s.jsx(Ae,{error:!!M.amount,hint:M.amount,title:"Amount off",type:"number",value:h.type==="fixed"?h.fixedAmount===0?"":h.fixedAmount?.toString():h.percentAmount===0?"":h.percentAmount?.toString(),onChange:re=>{v(re)},onKeyDown:()=>k("amount")}),s.jsx("div",{className:"absolute right-1.5 top-6 z-10",children:s.jsx(Lt,{clearBg:!0,controlClasses:{menu:"w-20 right-0"},options:C,selectedOption:h.type==="percent"?C[0]:C[1],testId:"amount-type-select-offers",onSelect:re=>{l(re?.value||"")}})})]}),s.jsx(Lt,{options:$,selectedOption:$.find(re=>re.value===h.duration),testId:"duration-select-offers",title:"Duration",onSelect:re=>y(re?.value||"")}),h.duration==="repeating"&&s.jsx(Ae,{title:"Duration in months",type:"number",onChange:re=>{x(re)}})]}),h.type==="trial"&&s.jsx(Ae,{error:!!M.amount,hint:M.amount,title:"Trial duration",type:"number",value:h.trialAmount?.toString(),onChange:re=>{A(re)},onKeyDown:()=>k("amount")}),s.jsx(Ae,{error:!!M.code,hint:M.code||(h.code.value!==""?s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[Y,s.jsx("span",{className:"font-bold",children:h.code.value})]}),s.jsx("span",{}),s.jsx(Ue,{className:"text-xs",color:"green",label:`${q?"Copied":"Copy"}`,size:"sm",link:!0,onClick:ee})]}):null),placeholder:"black-friday",title:"Offer code",value:h.code.value,onChange:re=>{_(re)},onKeyDown:()=>k("code")})]})]})]})})},Qn=e=>{const[n,a,o]=e.split("-");if(!n||!a||!o)throw new Error("Invalid input format. Expected format is: id-period-currency");return{id:n,period:a,currency:o}},QE=()=>{const{siteData:e}=Je(),n=[{title:"Discount",description:"Offer a special reduced price",value:"percent"},{title:"Free trial",description:"Give free access for a limited time",value:"trial"}],a=[{value:"once",label:"First-payment"},{value:"repeating",label:"Multiple-months"},{value:"forever",label:"Forever"}],[o,c]=D.useState(""),{updateRoute:m}=Qe(),{data:{tiers:y}={}}=so(),h=od(y||[]),l=KE(h),{mutateAsync:f}=m2(),[u,p]=D.useState({tier:l[0]||{},dataset:{id:l[0]?.value?Qn(l[0]?.value).id:"",period:l[0]?.value?Qn(l[0]?.value).period:"",currency:l[0]?.value?Qn(l[0]?.value).currency:""}}),{data:{offers:x=[]}={}}=g2(),{formState:v,updateForm:_,handleSave:k,saveState:M,okProps:T,validate:A,errors:C,clearError:O}=kr({initialState:{disableBackground:!1,name:"",code:{isDirty:!1,value:""},displayTitle:{isDirty:!1,value:""},displayDescription:"",type:"percent",cadence:u?.dataset?.period||"",amount:0,duration:"once",durationInMonths:0,currency:u?.dataset?.currency||"USD",status:"active",tierId:u?.dataset?.id||"",trialAmount:7,fixedAmount:0,percentAmount:0},onSave:async()=>{const he={name:v.name,code:v.code.value,display_title:v.displayTitle.value,display_description:v.displayDescription,cadence:v.cadence,amount:Dg(v)||0,duration:v.type==="trial"?"trial":v.duration,duration_in_months:Number(v.durationInMonths),currency:v.currency,status:v.status,redemption_type:"signup",tier:{id:v.tierId},type:v.type,currency_restriction:!1},ge=await f(he);ge&&ge.offers&&ge.offers.length>0&&m(`offers/success/${ge.offers[0].id}`)},onSaveError:()=>{},onValidate:()=>{const he={};return!v.name&&v.name.length===0&&(he.name="Name is required"),!v.code.value&&v.code.value.length===0&&(he.code="Code is required"),!v.displayTitle.value&&v.displayTitle.value.length===0&&(he.displayTitle="Display title is required"),v.type==="percent"&&v.percentAmount===0&&(he.amount="Enter an amount greater than 0."),v.type==="percent"&&(v.percentAmount<0||v.percentAmount>100)&&(he.amount="Amount must be between 0 and 100%."),(v.type==="fixed"&&v.fixedAmount===0||v.type==="fixed"&&v.fixedAmount<1)&&(he.amount="Enter an amount greater than 0."),v.type==="trial"&&v.trialAmount===0&&(he.amount="Enter an amount greater than 0."),v.type==="trial"&&v.trialAmount<1&&(he.amount="Free trial must be at least 1 day."),he},savingDelay:500}),$=[{value:"percent",label:"%"},{value:"fixed",label:v.currency}],W=he=>{p({tier:he,dataset:Qn(he.value)}),_(ge=>({...ge,cadence:Qn(he.value).period,currency:Qn(he.value).currency,tierId:Qn(he.value).id}))},R=he=>{_(ge=>({...ge,type:he}))},Z=he=>{_(ge=>({...ge,type:he==="percent"?"percent":"fixed"}))},X=he=>{const ge=he.target;v.type==="fixed"?_(F=>({...F,fixedAmount:Number(ge.value)})):v.type==="percent"?_(F=>({...F,percentAmount:Number(ge.value)})):_(F=>({...F,amount:Number(ge.value)}))},q=he=>{const ge=he.target;_(F=>({...F,durationInMonths:Number(ge.value)}))},B=he=>{const ge=he.target.value;_(F=>{let L={...F};return L.name=ge,F.code.isDirty||(O("code"),L.code={...F.code,value:ZE(ge)}),F.displayTitle.isDirty||(O("displayTitle"),L.displayTitle={...F.displayTitle,value:ge}),L})},Y=he=>{const ge=he.target;_(F=>({...F,displayTitle:{...F.displayTitle,isDirty:!0,value:ge.value}}))},ae=he=>{const ge=he.target;_(F=>({...F,displayDescription:ge.value}))},ee=he=>{const ge=he.target;_(F=>({...F,trialAmount:Number(ge.value)}))},re=he=>{_(ge=>({...ge,duration:he}))},Q=he=>{const ge=he.target;_(F=>({...F,code:{...F.code,isDirty:!0,value:ge.value}}))},ne=()=>{x.length>0?m("offers/edit"):m("offers")},be=D.useMemo(()=>({name:v.name||"",code:v.code.value||"",displayTitle:v.displayTitle.value||"",displayDescription:v.displayDescription||"",type:v.type||"percent",cadence:v.cadence||"month",amount:Dg(v)||0,duration:v.type==="trial"?"trial":v.duration||"once",durationInMonths:v.durationInMonths||0,currency:v.currency||"USD",status:v.status||"active",tierId:v.tierId||h[0]?.id}),[v,h]);D.useEffect(()=>{const he=yx(be,e.url);c(he)},[v,e.url,v.type,be]);const je=s.jsx(VE,{amountOptions:$,clearError:O,durationOptions:a,errors:C,handleAmountInput:X,handleAmountTypeChange:Z,handleCodeInput:Q,handleDisplayTitleInput:Y,handleDurationChange:re,handleDurationInMonthsInput:q,handleNameInput:B,handleTextAreaInput:ae,handleTierChange:W,handleTrialAmountInput:ee,handleTypeChange:R,overrides:v,selectedTier:u.tier,testId:"add-offer-sidebar",tierOptions:l,typeOptions:n,validate:A}),H=s.jsx(Zi,{href:o||"",portalParent:"offers"});return s.jsx(Zs,{afterClose:()=>{m("offers")},backDropClick:!1,cancelLabel:"Close",deviceSelector:!1,dirty:M==="unsaved",height:"full",okColor:T.color,okLabel:"Publish",preview:H,previewToolbar:!1,sidebar:je,size:"lg",testId:"add-offer-modal",title:"Offer",width:1140,onCancel:ne,onOk:async()=>{if(A(),!Object.values(C).every(ge=>!ge)){Za.remove(),xt({title:"Can't save offer",type:"info",message:"Make sure you filled all required fields"});return}try{if(await k({force:!0}))return}catch(ge){let F;ge instanceof ts&&ge.data&&ge.data.errors[0]&&(F=ge.data.errors[0].context||ge.data.errors[0].message),Za.remove(),F&&xt({title:"Can't save offer",type:"error",message:F||"Please try again later"})}}})};function Rg(e){return new Date(e).toLocaleDateString("default",{year:"numeric",month:"short",day:"2-digit"})}const JE=({clearError:e,errors:n,offer:a,updateOffer:o})=>{const{siteData:c}=Je(),[m,y]=D.useState(!1),h=ot(),{mutateAsync:l}=t0(),[f,u]=D.useState(a?.name.length||0),p=f>40?"text-red":"text-green",{updateRoute:x}=Qe();D.useEffect(()=>{a?.name&&u(a?.name.length)},[a?.name]);const v=ln(c),_=`${v}${a?.code}`,k=async()=>{await navigator.clipboard.writeText(_),y(!0),setTimeout(()=>y(!1),2e3)},M=async()=>{a?.status==="active"?ye.show(Et,{title:"Archive offer",prompt:s.jsxs(s.Fragment,{children:[s.jsx("p",{children:"New members will no longer be able to subscribe using this offer."}),s.jsxs("p",{children:["All members that previously redeemed ",s.jsx("strong",{children:a?.name})," will remain unchanged."]})]}),okLabel:"Archive",okColor:"red",onOk:async T=>{try{await l({...a,status:"archived"}),T?.remove(),xt({type:"success",title:"Offer archived"}),x("offers/edit")}catch(A){h(A)}}}):ye.show(Et,{title:"Reactivate offer",prompt:s.jsx(s.Fragment,{children:s.jsxs("p",{children:["Reactivating ",s.jsx("strong",{children:a?.name})," will allow new members to subscribe using this offer. Existing members will remain unchanged."]})}),okLabel:"Reactivate",onOk:async T=>{try{await l({...a,status:"active"}),T?.remove(),xt({type:"success",title:"Offer reactivated"}),x("offers/edit")}catch(A){h(A)}}})};return s.jsxs("div",{className:"flex grow flex-col pt-2",children:[s.jsxs(tt,{className:" grow",children:[s.jsx("section",{children:s.jsxs("div",{className:"flex flex-col gap-5 rounded-md border border-grey-300 p-4 pb-3.5 dark:border-grey-800",children:[s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("span",{className:"text-xs font-semibold leading-none text-grey-700",children:"Created on"}),s.jsx("span",{children:Rg(a?.created_at?a.created_at:"")})]}),s.jsxs("div",{className:"flex items-end justify-between",children:[s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("span",{className:"text-xs font-semibold leading-none text-grey-700",children:"Performance"}),s.jsxs("span",{children:[a?.redemption_count," ",a?.redemption_count===1?"redemption":"redemptions"]})]}),a?.redemption_count>0&&a?.last_redeemed?s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("span",{className:"text-xs font-semibold leading-none text-grey-700",children:"Last redemption"}),s.jsx("span",{children:Rg(a?.last_redeemed)})]}):null]}),a?.redemption_count>0?s.jsx("a",{className:"font-semibold text-green",href:x2(a?.id),children:"See members →"}):null]})]})}),s.jsxs("section",{className:"mt-4",children:[s.jsx("h2",{className:"mb-4 text-lg",children:"General"}),s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx(Ae,{error:!!n.name,hint:n.name||s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{children:"Visible to members on Stripe Checkout page"}),s.jsxs("strong",{children:[s.jsx("span",{className:`${p}`,children:f})," / 40"]})]}),maxLength:40,placeholder:"Black Friday",title:"Offer name",value:a?.name,onChange:T=>{u(T.target.value.length),o({name:T.target.value})},onKeyDown:()=>e("name")}),s.jsx(Ae,{error:!!n.displayTitle,hint:n.displayTitle,placeholder:"Black Friday Special",title:"Display title",value:a?.display_title,onChange:T=>o({display_title:T.target.value}),onKeyDown:()=>e("displayTitle")}),s.jsx($n,{placeholder:"Take advantage of this limited-time offer.",title:"Display description",value:a?.display_description,onChange:T=>o({display_description:T.target.value})}),s.jsx(Ae,{error:!!n.code,hint:n.code||(a?.code!==""?s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[v,s.jsx("span",{className:"font-bold",children:a?.code})]}),s.jsx("span",{}),s.jsx(Ue,{className:"text-xs",color:"green",label:`${m?"Copied":"Copy"}`,size:"sm",link:!0,onClick:k})]}):null),placeholder:"black-friday",title:"Offer code",value:a?.code,onChange:T=>o({code:T.target.value}),onKeyDown:()=>e("code")})]})]})]}),s.jsx("div",{className:"mb-2",children:a?.status==="active"?s.jsx(Ue,{color:"red",label:"Archive offer",link:!0,onClick:M}):s.jsx(Ue,{color:"green",label:"Reactivate offer",link:!0,onClick:M})})]})},e4=({id:e})=>{const{siteData:n}=Je(),{updateRoute:a}=Qe(),o=ot(),{mutateAsync:c}=t0(),[m,y]=D.useState(""),{data:{offers:h=[]}={}}=e0(e||""),{formState:l,saveState:f,updateForm:u,setFormState:p,handleSave:x,validate:v,errors:_,clearError:k,okProps:M}=kr({initialState:h[0],savingDelay:500,onSave:async()=>{await c(l)},onSaveError:o,onValidate:()=>{const O={};return l?.name||(O.name="Name is required"),l?.display_title||(O.displayTitle="Display title is required"),l?.code||(O.code="Please enter a code"),O}});D.useEffect(()=>{p(()=>h[0])},[p,h]);const T=O=>{u($=>({...$,...O}))},A=s.jsx(JE,{clearError:k,errors:_,offer:l,updateOffer:T,validate:v});D.useEffect(()=>{const O={name:l?.name||"",code:l?.code||"",displayTitle:l?.display_title||"",displayDescription:l?.display_description||"",type:l?.type||"",cadence:l?.cadence||"",amount:l?.amount,duration:l?.duration||"",durationInMonths:l?.duration_in_months||0,currency:l?.currency||"",status:l?.status||"",tierId:l?.tier?.id||""},$=yx(O,n.url);y($)},[l,n]);const C=s.jsx(Zi,{href:m||"",portalParent:"offers"});return h?s.jsx(Zs,{afterClose:()=>{a("offers")},backDropClick:!1,cancelLabel:"Close",deviceSelector:!1,dirty:f==="unsaved",height:"full",okColor:M.color,okLabel:M.label||"Save",preview:C,previewToolbar:!1,sidebar:A,size:"lg",testId:"offer-update-modal",title:"Offer",width:1140,onCancel:()=>{sessionStorage.getItem("editOfferPageSource")==="offers"?(sessionStorage.removeItem("editOfferPageSource"),a("offers")):(sessionStorage.removeItem("editOfferPageSource"),a("offers/edit"))},onOk:async()=>{try{if(await x({force:!0}))return}catch(O){let $;O instanceof ts&&O.data&&O.data.errors[0]&&($=O.data.errors[0].context||O.data.errors[0].message),Za.remove(),$&&xt({title:"Can't save offer",type:"error",message:"Please try again later"})}}}):null},t4=({route:e})=>{if(e==="offers/new")return s.jsx(QE,{});if(e.startsWith("offers/edit/")&&e.length>12){const n=e.split("/").pop();return s.jsx(e4,{id:n||""})}else if(e.startsWith("offers/success/")&&e.length>15){const n=e.split("/").pop();return s.jsx(wx,{id:n||""})}else if(e==="offers/edit")return s.jsx(b2,{})},r4=()=>{const{route:e}=Qe();return s.jsx(t4,{route:e})},n4=ye.create(r4),s4=""+new URL("pintura-screenshot-1gRQGS4m.png",import.meta.url).href,a4=ns({method:"POST",path:()=>"/files/upload/",body:({file:e})=>{const n=new FormData;return n.append("file",e),n}}),o4=ye.create(()=>{const{updateRoute:e}=Qe(),[n,a]=D.useState({js:!1,css:!1}),{settings:o,config:c}=Je(),[m]=gt(o,["pintura"]),{mutateAsync:y}=Rn(),{mutateAsync:h}=a4(),l=ot();D.useEffect(()=>{x(m||!1)},[m]);const[f,u]=D.useState("Save"),[p,x]=D.useState(!!m),v=async()=>{const C=[{key:"pintura",value:p}];try{u("Saving..."),await Promise.all([y(C),new Promise(O=>{setTimeout(O,1e3)})]),u("Saved")}catch(O){l(O)}finally{setTimeout(()=>u("Save"),1e3)}},_=D.useRef(null),k=D.useRef(null),M=C=>{C==="js"&&_.current?.click(),C==="css"&&k.current?.click()},T=async(C,O)=>{try{a(X=>({...X,[O]:!0}));const $=C.target?.files?.[0];if(!$)return;const{files:W}=await h({file:$}),R=W[0].url,Z=[{key:`pintura_${O}_url`,value:R}];await y(Z),a(X=>({...X,[O]:!1})),xt({type:"success",title:`Pintura ${O} uploaded`})}catch($){a({js:!1,css:!1}),l($)}},A=p!==m;return s.jsxs(yt,{afterClose:()=>{e("integrations")},cancelLabel:"Close",dirty:A,okColor:f==="Saved"?"green":"black",okLabel:f,testId:"pintura-modal",title:"",onOk:v,children:[s.jsx(Qs,{detail:"Advanced image editing",icon:s.jsx(ut,{name:"pintura",size:48}),title:"Pintura"}),s.jsxs("div",{className:"mt-7",children:[!c.pintura&&s.jsxs("div",{className:"mb-7 flex flex-col items-stretch justify-between gap-4 rounded-sm bg-grey-75 p-4 md:flex-row md:p-7 dark:bg-grey-950",children:[s.jsxs("div",{className:"md:basis-1/2",children:[s.jsx("p",{className:"mb-4 font-bold",children:"Add advanced image editing to Ghost, with Pintura"}),s.jsx("p",{className:"mb-4 text-sm",children:"Pintura is a powerful JavaScript image editor that allows you to crop, rotate, annotate and modify images directly inside Ghost."}),s.jsx("p",{className:"text-sm",children:"Try a demo, purchase a license, and download the required CSS/JS files from pqina.nl/pintura/ to activate this feature."})]}),s.jsxs("div",{className:"flex grow flex-col items-end justify-between gap-2 md:basis-1/2 md:gap-0",children:[s.jsx("img",{alt:"Pintura screenshot",src:s4}),s.jsx("a",{className:"-mb-1 text-sm font-bold text-green",href:"https://pqina.nl/pintura/ghost/?ref=ghost.org",rel:"noopener noreferrer",target:"_blank",children:"Find out more →"})]})]}),s.jsxs(tt,{marginBottom:!1,title:"Pintura configuration",grouped:!0,children:[s.jsx(st,{checked:p,direction:"rtl",hint:s.jsxs(s.Fragment,{children:["Enable ",s.jsx("a",{className:"text-green",href:"https://pqina.nl/pintura/ghost/?ref=ghost.org",rel:"noopener noreferrer",target:"_blank",children:"Pintura"})," for editing your images in Ghost"]}),label:"Enable Pintura",onChange:C=>{x(C.target.checked)}}),p&&!c.pintura&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex flex-col justify-between gap-1 md:flex-row md:items-center",children:[s.jsxs("div",{children:[s.jsx("div",{children:"Upload Pintura script"}),s.jsxs("div",{className:"text-xs text-grey-600",children:["Upload the ",s.jsx("code",{children:"pintura-umd.js"})," file from the Pintura package"]})]}),s.jsx("input",{ref:_,accept:".js",type:"file",hidden:!0,onChange:async C=>{await T(C,"js")}}),s.jsx(Ue,{color:"outline",disabled:n.js,label:"Upload",onClick:()=>{M("js")}})]}),s.jsxs("div",{className:"flex flex-col justify-between gap-1 md:flex-row md:items-center",children:[s.jsxs("div",{children:[s.jsx("div",{children:"Upload Pintura styles"}),s.jsxs("div",{className:"text-xs text-grey-600",children:["Upload the ",s.jsx("code",{children:"pintura.css"})," file from the Pintura package"]})]}),s.jsx("input",{ref:k,accept:".css",type:"file",hidden:!0,onChange:async C=>{await T(C,"css")}}),s.jsx(Ue,{color:"outline",disabled:n.css,label:"Upload",onClick:()=>{M("css")}})]})]})]})]})]})}),i4=({updateSetting:e,errors:n,setError:a})=>{const{siteData:o,settings:c,config:m}=Je(),[y,h]=gt(c,["members_support_address","support_email_address"]),l=h?.toString()||Nf(y?.toString()||"",o,m),f=__(o,m),[u,p]=D.useState(l),x=v=>{let _=v.target.value;_?Nt.isEmail(_)?a("members_support_address",""):a("members_support_address","Enter a valid email address"):a("members_support_address","Enter an email address");let k=f&&_===`noreply@${f}`?"noreply":_;e("members_support_address",k),p(Nf(k,o,m))};return D.useEffect(()=>{p(l)},[l]),s.jsx("div",{className:"mt-7",children:s.jsx(tt,{children:s.jsx(Ae,{error:!!n.members_support_address,hint:n.members_support_address,title:"Support email address",value:u,onBlur:x,onChange:v=>p(v.target.value)})})})},Tf=[{icon:"portal-icon-1",value:"icon-1"},{icon:"portal-icon-2",value:"icon-2"},{icon:"portal-icon-3",value:"icon-3"},{icon:"portal-icon-4",value:"icon-4"},{icon:"portal-icon-5",value:"icon-5"}],l4=({localSettings:e,updateSetting:n})=>{const{mutateAsync:a}=Xs(),o=ot(),[c,m,y,h]=gt(e,["portal_button","portal_button_style","portal_button_icon","portal_button_signup_text"]),l=y||Tf[0].value,f=Tf.map(({value:k})=>k).includes(l),[u,p]=D.useState(f?void 0:l),x=async k=>{try{const M=on(await a({file:k}));n("portal_button_icon",M),p(M)}catch(M){const T=M;T.response.status===415&&(T.message="Unsupported file type"),o(T)}},v=()=>{n("portal_button_icon",null),p(void 0)},_=[{value:"icon-and-text",label:"Icon and text"},{value:"icon-only",label:"Icon only"},{value:"text-only",label:"Text only"}];return s.jsx("div",{className:"mt-7",children:s.jsxs(tt,{children:[s.jsx(st,{checked:!!c,direction:"rtl",label:"Show portal button",onChange:k=>n("portal_button",k.target.checked)}),c&&s.jsxs(s.Fragment,{children:[s.jsx(Lt,{options:_,selectedOption:_.find(k=>k.value===m),title:"Button style",onSelect:k=>n("portal_button_style",k?.value||null)}),m?.toString()?.includes("icon")&&s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx(bt,{level:6,grey:!0,children:"Icon"}),s.jsxs("div",{className:"flex justify-between",children:[Tf.map(k=>s.jsx("button",{className:we("border p-3",l===k.value?"border-green":"border-transparent"),type:"button",onClick:()=>n("portal_button_icon",k.value),children:s.jsx(ut,{className:`size-5 ${l===k.value?"text-green":"text-black opacity-70 transition-all hover:opacity-100 dark:text-white"}`,name:k.icon})},k.value)),s.jsx("div",{className:we("relative w-[46px] border",l===u?"border-green":"border-transparent"),children:s.jsx(un,{deleteButtonClassName:"invisible absolute -right-2 -top-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-full bg-[rgba(0,0,0,0.75)] text-white hover:bg-black group-hover:!visible",deleteButtonContent:s.jsx(ut,{colorClass:"text-white",name:"trash",size:"sm"}),height:"46px",id:"test",imageClassName:"cursor-pointer",imageURL:u,width:"46px",deleteButtonUnstyled:!0,onDelete:v,onImageClick:()=>u&&n("portal_button_icon",u),onUpload:x,children:s.jsx(ut,{className:"dark:text-white",name:"upload",size:"md"})})})]})]}),m?.toString()?.includes("text")&&s.jsx(Ae,{title:"Signup button text",value:h,onChange:k=>n("portal_button_signup_text",k.target.value)})]})]})})},Lr=({name:e,value:n})=>{const a=D.useId();return s.jsx(On,{action:s.jsx(Ue,{color:"black",label:"Copy",link:!0,onClick:o=>{navigator.clipboard.writeText(n);const c=o?.target;c.innerText="Copied",setTimeout(()=>{c.innerText="Copy"},1e3)}}),separator:!0,children:s.jsxs("div",{className:"flex w-full grow flex-col py-3 lg:flex-row lg:items-center lg:gap-5",children:[s.jsxs("label",{className:"inline-block whitespace-nowrap lg:w-[180px] lg:min-w-[180px]",htmlFor:a,children:[e,":"]}),s.jsx(Ae,{className:"border-b-500 grow bg-transparent py-1 text-grey-700 lg:p-1",id:a,value:n,disabled:!0,unstyled:!0})]})})},c4=()=>{const[e,n]=D.useState(!1),[a,o]=D.useState(""),{siteData:c}=Je(),{data:{tiers:m}={}}=so(),y=od(m||[]),h=()=>{n(!e)};D.useEffect(()=>{y?.length&&!a&&o(y[0].id)},[y,a]);const l=y?.map(u=>({label:u.name,value:u.id})),f=ln(c);return s.jsxs(ud,{className:"max-w-[920px] text-base text-black dark:text-white",heading:"Links",children:[s.jsxs("p",{className:"-mt-6 mb-16",children:["Use these ",e?"data attributes":"links"," in your theme to show pages of Portal."]}),s.jsxs(cn,{actions:s.jsx(Ue,{color:"green",label:e?"Links":"Data attributes",link:!0,onClick:h}),title:"Generic",titleSize:"lg",children:[s.jsx(Lr,{name:"Default",value:e?"data-portal":`${f}#/portal`}),s.jsx(Lr,{name:"Sign in",value:e?'data-portal="signin"':`${f}#/portal/signin`}),s.jsx(Lr,{name:"Sign up",value:e?'data-portal="signup"':`${f}#/portal/signup`})]}),s.jsxs(cn,{className:"mt-14",title:"Tiers",titleSize:"lg",children:[s.jsx(On,{hideActions:!0,separator:!0,children:s.jsxs("div",{className:"flex w-full items-center gap-2 py-2",children:[s.jsx("span",{className:"inline-block w-[180px] min-w-[180px] shrink-0",children:"Tier:"}),s.jsx(Lt,{options:l,selectedOption:l.find(u=>u.value===a),onSelect:u=>{u&&o(u?.value)}})]})}),s.jsx(Lr,{name:"Signup / Monthly",value:e?`data-portal="signup/${a}/monthly"`:`${f}#/portal/signup/${a}/monthly`}),s.jsx(Lr,{name:"Signup / Yearly",value:e?`data-portal="signup/${a}/yearly"`:`${f}#/portal/signup/${a}/yearly`}),s.jsx(Lr,{name:"Signup / Free",value:e?'data-portal="signup/free"':`${f}#/portal/signup/free`})]}),s.jsxs(cn,{className:"mt-14",title:"Account",titleSize:"lg",children:[s.jsx(Lr,{name:"Account",value:e?'data-portal="account"':`${f}#/portal/account`}),s.jsx(Lr,{name:"Account / Plans",value:e?'data-portal="account/plans"':`${f}#/portal/account/plans`}),s.jsx(Lr,{name:"Account / Profile",value:e?'data-portal="account/profile"':`${f}#/portal/account/profile`}),s.jsx(Lr,{name:"Account / Newsletters",value:e?'data-portal="account/newsletters"':`${f}#/portal/account/newsletters`}),s.jsx(Lr,{name:"Account / Newsletter help",value:e?'data-portal="account/newsletters/help"':`${f}#/portal/account/newsletters/help`})]})]})},u4=({settings:e,config:n,tiers:a,siteData:o,selectedTab:c})=>{if(!o?.url)return null;let m=a.filter(v=>v.visibility==="public"&&v.type==="paid").map(v=>v.id);const y=o.url.replace(/\/$/,""),h="/?v=modal-portal-settings#/portal/preview",l=JSON.parse(dr(e,"portal_plans")||""),f=new URLSearchParams;f.append("button",dr(e,"portal_button")?"true":"false"),f.append("name",dr(e,"portal_name")?"true":"false"),f.append("isFree",l.includes("free")?"true":"false"),f.append("isMonthly",Ws(e,n)&&l.includes("monthly")?"true":"false"),f.append("isYearly",Ws(e,n)&&l.includes("yearly")?"true":"false"),f.append("page",c==="account"?"accountHome":"signup"),f.append("buttonIcon",encodeURIComponent(dr(e,"portal_button_icon")||"icon-1")),f.append("signupButtonText",encodeURIComponent(dr(e,"portal_button_signup_text")||"")),f.append("membersSignupAccess",dr(e,"members_signup_access")||"all"),f.append("allowSelfSignup",dr(e,"allow_self_signup")||"false"),f.append("signupTermsHtml",dr(e,"portal_signup_terms_html")||""),f.append("signupCheckboxRequired",dr(e,"portal_signup_checkbox_required")?"true":"false"),f.append("portalProducts",m.join(","));const u=dr(e,"portal_default_plan");u&&f.append("portalDefaultPlan",u),l&&l.length&&f.append("portalPrices",encodeURIComponent(l.join(",")));const p=dr(e,"accent_color");p!=null&&f.append("accentColor",encodeURIComponent(p));const x=dr(e,"portal_button_style");return x&&f.append("buttonStyle",encodeURIComponent(x)),f.append("disableBackground","false"),`${y}${h}?${f.toString()}`},f4=({selectedTab:e="signup",localSettings:n,localTiers:a})=>{const{siteData:o,config:c}=Je(),m=u4({settings:n,tiers:a,selectedTab:e,siteData:o,config:c});let y=s.jsx(s.Fragment,{});switch(e){case"account":y=s.jsx(s.Fragment,{children:s.jsx(Zi,{href:m||"",portalParent:"preview",selectedTab:e})});break;case"links":y=s.jsx(c4,{});break;default:y=s.jsx(s.Fragment,{children:s.jsx(Zi,{href:m||"",portalParent:"preview",selectedTab:e})});break}return y},d4=({localSettings:e,updateSetting:n,localTiers:a,updateTier:o,errors:c,setError:m})=>{const{config:y}=Je(),[h,l,f,u,p,x]=gt(e,["members_signup_access","portal_name","portal_signup_terms_html","portal_signup_checkbox_required","portal_plans","portal_default_plan"]),v=JSON.parse(p?.toString()||"[]"),_=115,k=D.useMemo(()=>{const X=document.createElement("div");return X.innerHTML=f?.toString()||"",X.innerText.length},[f]),M=D.useCallback((X,q)=>{m(X,q)},[]);D.useEffect(()=>{k>_?M("portal_signup_terms_html","Signup notice is too long"):M("portal_signup_terms_html",void 0)},[k,M]);const T=X=>{const q=v.indexOf(X);q===-1?v.push(X):v.splice(q,1),n("portal_plans",JSON.stringify(v)),x==="yearly"?!v.includes("yearly")&&v.includes("monthly")&&n("portal_default_plan","monthly"):x==="monthly"&&(v.includes("monthly")||n("portal_default_plan","yearly"))},A=h==="all"||h==="paid",C=h==="all",O=Ws(e,y);let $=[];a&&a.forEach(X=>{X.type==="free"&&C&&$.push({checked:v.includes("free"),disabled:!A,label:X.name,value:"free",testId:"free-tier-checkbox",onChange:q=>{v.includes("free")&&!q&&v.splice(v.indexOf("free"),1),!v.includes("free")&&q&&v.push("free"),n("portal_plans",JSON.stringify(v)),o({...X,visibility:q?"public":"none"})}})});const W=od(a)||[],R=[{value:"yearly",label:"Yearly"},{value:"monthly",label:"Monthly"}];O&&W.length>0&&W.forEach(X=>{$.push({checked:X.visibility==="public",label:X.name,value:X.id,onChange:(q=>o({...X,visibility:q?"public":"none"}))})});const Z=O&&W.length>0&&W.some(X=>X.visibility==="public");return s.jsx("div",{className:"mt-7",children:s.jsxs(tt,{children:[s.jsx(st,{checked:!!l,direction:"rtl",disabled:!A,label:"Display name in signup form",onChange:X=>n("portal_name",X.target.checked)}),s.jsx(Cf,{checkboxes:$,title:"Available tiers"}),Z&&s.jsxs(s.Fragment,{children:[s.jsx(Cf,{checkboxes:[{checked:v.includes("monthly"),disabled:!A,label:"Monthly",value:"monthly",onChange:()=>{T("monthly")}},{checked:v.includes("yearly"),disabled:!A,label:"Yearly",value:"yearly",onChange:()=>{T("yearly")}}],title:"Available prices"}),v.includes("yearly")&&v.includes("monthly")&&s.jsx(Lt,{options:R,selectedOption:R.find(X=>X.value===x),title:"Default price at signup",onSelect:X=>{n("portal_default_plan",X?.value??"yearly")}})]}),s.jsx(ld,{error:!!c.portal_signup_terms_html,hint:c.portal_signup_terms_html||s.jsxs(s.Fragment,{children:["Recommended: ",s.jsx("strong",{children:"115"})," characters. You've used ",s.jsx("strong",{className:"text-green",children:k})]}),nodes:"MINIMAL_NODES",placeholder:"By signing up, I agree to receive emails from ...",title:"Display notice at signup",value:f?.toString(),onChange:X=>n("portal_signup_terms_html",X)}),f?.toString()&&s.jsx(st,{checked:!!u,disabled:!A,label:"Require agreement",labelStyle:"heading",onChange:X=>n("portal_signup_checkbox_required",X.target.checked)})]})})},p4="SettingsResponseType",h4=ns({path:()=>"/settings/verifications",method:"PUT",body:({token:e})=>({token:e}),updateQueries:{dataType:p4,emberUpdateType:"createOrUpdate",update:e=>({...e,settings:e.settings})}}),m4=({localSettings:e,updateSetting:n,localTiers:a,updateTier:o,errors:c,setError:m})=>{const[y,h]=D.useState("signupOptions"),l=[{id:"signupOptions",title:"Signup options",contents:s.jsx(d4,{errors:c,localSettings:e,localTiers:a,setError:m,updateSetting:n,updateTier:o})},{id:"lookAndFeel",title:"Look & feel",contents:s.jsx(l4,{localSettings:e,updateSetting:n})},{id:"accountPage",title:"Account page",contents:s.jsx(i4,{errors:c,setError:m,updateSetting:n})}],f=u=>{h(u)};return s.jsx("div",{className:"pt-4",children:s.jsx(Dn,{selectedTab:y,tabs:l,onTabChange:f})})},g4=()=>{const{updateRoute:e}=Qe(),[n,a]=D.useState("signup"),o=ot(),{settings:c,siteData:m,config:y}=Je(),{mutateAsync:h}=Rn(),{data:{tiers:l}={}}=so(),{mutateAsync:f}=ad(),{mutateAsync:u}=h4(),{getParam:p}=Kg(),x=p("verifyEmail");D.useEffect(()=>{x&&(async({token:ae})=>{try{let{settings:ee}=await u({token:ae});const[re]=gt(ee,["members_support_address"]);ye.show(Et,{title:"Support address verified",prompt:s.jsxs(s.Fragment,{children:["Your support email address has been changed to ",s.jsx("strong",{children:re}),"."]}),okLabel:"Close",cancelLabel:"",onOk:Q=>Q?.remove()})}catch(ee){let re="There was an error verifying your email address. Please try again.";ee?.message==="Token expired"&&(re="Verification link has expired."),ye.show(Et,{title:"Error verifying support address",prompt:re,okLabel:"Close",cancelLabel:"",onOk:Q=>Q?.remove()}),o(ee,{withToast:!1})}})({token:x})},[o,x,u]);const{formState:v,setFormState:_,saveState:k,handleSave:M,updateForm:T,okProps:A}=kr({initialState:{settings:c,tiers:l||[]},savingDelay:500,onSave:async()=>{await Promise.all(v.tiers.filter(({dirty:re})=>re).map(re=>f(re))),_(re=>({...re,tiers:v.tiers.map(Q=>({...Q,dirty:!1}))}));const Y=v.settings.filter(re=>re.dirty);if(!Y.length)return;const{meta:ae,settings:ee}=await h(Y);if(_(re=>({...re,settings:v.settings.map(Q=>({...Q,dirty:!1}))})),ae?.sent_email_verification){const re=v.settings.find(ne=>ne.key==="members_support_address")?.value,Q=ee.find(ne=>ne.key==="support_email_address")?.value||Nf(ee.find(ne=>ne.key==="members_support_address")?.value?.toString()||"noreply",m,y);ye.show(Et,{title:"Confirm email address",prompt:s.jsxs(s.Fragment,{children:["We've sent a confirmation email to ",s.jsx("strong",{children:re}),". Until verified, your support email address will remain ",Q,"."]}),okLabel:"Close",cancelLabel:"",onOk:ne=>ne?.remove()})}},onSaveError:o});D.useEffect(()=>{!v.tiers.length&&l?.length&&_(Y=>({...Y,tiers:l}))},[l,v.tiers,_]);const[C,O]=D.useState({}),$=(Y,ae)=>{T(ee=>({...ee,settings:ee.settings.map(re=>re.key===Y?{...re,value:ae,dirty:!0}:re)}))},W=(Y,ae)=>{O(ee=>({...ee,[Y]:ae}))},R=Y=>{T(ae=>({...ae,tiers:ae.tiers.map(ee=>ee.id===Y.id?{...Y,dirty:!0}:ee)}))},Z=Y=>{a(Y)},X=s.jsx(m4,{errors:C,localSettings:v.settings,localTiers:v.tiers,setError:W,updateSetting:$,updateTier:R}),q=s.jsx(f4,{localSettings:v.settings,localTiers:v.tiers,selectedTab:n});let B=[{id:"signup",title:"Signup"},{id:"account",title:"Account page"},{id:"links",title:"Links"}];return s.jsx(Zs,{afterClose:()=>{e("portal")},buttonsDisabled:A.disabled,cancelLabel:"Close",deviceSelector:!1,dirty:k==="unsaved",okColor:A.color,okLabel:A.label||"Save",preview:q,previewBgColor:n==="links"?"white":"greygradient",previewToolbarTabs:B,selectedURL:n,sidebar:X,testId:"portal-modal",title:"Portal",onOk:async()=>{Object.values(C).filter(Boolean).length||await M({force:!0})},onSelectURL:Z})},x4=ye.create(g4),b4=ye.create(()=>{const{updateRoute:e}=Qe(),{localSettings:n,updateSetting:a,handleSave:o,validate:c,errors:m,clearError:y,okProps:h}=ss({onValidate:()=>{const v={};return l&&!Nt.isURL(l,{require_protocol:!0})&&(v.slackUrl="The URL must be in a format like https://hooks.slack.com/services/<your personal key>"),v},savingDelay:500}),[l,f]=gt(n,["slack_url","slack_username"]),{mutateAsync:u}=k_(),p=async()=>{Za.remove(),await o()&&(await u(null),xt({title:"Check your Slack channel for the test message",type:"info"}))},x=n.some(v=>v.dirty);return s.jsxs(yt,{afterClose:()=>{e("integrations")},cancelLabel:"Close",dirty:x,okColor:h.color,okLabel:h.label||"Save",testId:"slack-modal",title:"",onOk:async()=>{Za.remove(),await o()},children:[s.jsx(Qs,{detail:"A messaging app for teams",icon:s.jsx(ut,{name:"slack",size:56}),title:"Slack"}),s.jsx("div",{className:"mt-7",children:s.jsxs(tt,{marginBottom:!1,title:"Slack configuration",grouped:!0,children:[s.jsx(Ae,{error:!!m.slackUrl,hint:m.slackUrl||s.jsxs(s.Fragment,{children:["Automatically send newly published posts to a channel in Slack or any Slack-compatible service like Discord or Mattermost. Set up a new incoming webhook ",s.jsx("a",{href:"https://my.slack.com/apps/new/A0F7XDUAZ-incoming-webhooks",children:"here"}),", and grab the URL."]}),placeholder:"https://hooks.slack.com/services/...",title:"Webhook URL",value:l,onBlur:c,onChange:v=>a("slack_url",v.target.value),onKeyDown:()=>y("slackUrl")}),s.jsxs("div",{className:"flex w-full flex-col gap-2 md:flex-row md:items-center",children:[s.jsx(Ae,{containerClassName:"flex-grow",hint:"The username to display messages from",title:"Username",value:f,onChange:v=>a("slack_username",v.target.value)}),s.jsx(Ue,{color:"outline",label:"Send test notification",onClick:p})]})]})})]})}),v4=""+new URL("stripe-thumb-Cu2h4McY.jpg",import.meta.url).href,w4=""+new URL("orb-squircle-e1heFqOI.png",import.meta.url).href,y4="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20400%20400'%20style='enable-background:new%200%200%20400%20400'%20xml:space='preserve'%3e%3cpath%20style='fill-rule:evenodd;clip-rule:evenodd;fill:%23635bff'%20d='M0%200h400v400H0z'/%3e%3cpath%20d='M184.4%20155.5c0-9.4%207.7-13.1%2020.5-13.1%2018.4%200%2041.6%205.6%2060%2015.5v-56.8C244.8%2093.1%20225%2090%20205%2090c-49.1%200-81.7%2025.6-81.7%2068.4%200%2066.7%2091.9%2056.1%2091.9%2084.9%200%2011.1-9.7%2014.7-23.2%2014.7-20.1%200-45.7-8.2-66-19.3v57.5c22.5%209.7%2045.2%2013.8%2066%2013.8%2050.3%200%2084.9-24.9%2084.9-68.2-.4-72-92.5-59.2-92.5-86.3z'%20style='fill-rule:evenodd;clip-rule:evenodd;fill:%23fff'/%3e%3c/svg%3e",_4=""+new URL("stripe-verified-DM7Q8nrY.svg",import.meta.url).href,Xf=1e3,k4=15*Xf,M4=({onNext:e})=>s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(bt,{level:3,children:"Getting paid"}),s.jsx("img",{alt:"Stripe Verified Partner Badge",src:_4})]}),s.jsxs("div",{className:"mb-7 mt-6",children:["Stripe is our exclusive direct payments partner. Ghost collects ",s.jsx("strong",{children:"no fees"})," on any payments! If you don’t have a Stripe account yet, you can ",s.jsx("a",{className:"underline",href:"https://stripe.com",rel:"noopener noreferrer",target:"_blank",children:"sign up here"}),"."]}),s.jsx(r0,{label:s.jsx(s.Fragment,{children:"I have a Stripe account, let's go →"}),onClick:e})]}),j4=()=>{const[e,n]=D.useState(!1),[a,o]=D.useState(""),[c,m]=D.useState(!1),[y,h]=D.useState(""),{refetch:l}=so({searchParams:{filter:"type:paid+active:true"},enabled:!1}),{mutateAsync:f}=ad(),{mutateAsync:u}=Rn(),p=ot(),x=T=>{o(T.target.value),n(!!T.target.value)},v=async()=>{const{data:T}=await l(),A=T?.pages[0].tiers[0];if(A){A.monthly_price=500,A.yearly_price=5e3,A.currency="USD";let C=0;for(;C<k4;){await new Promise(O=>{setTimeout(O,Xf)});try{await f(A);break}catch(O){if(O instanceof ts&&O.data?.errors?.[0].code==="STRIPE_NOT_CONFIGURED"){C+=Xf;continue}else{p(O);return}}}}},_=async()=>{if(h(""),a)try{await u([{key:"stripe_connect_integration_token",value:a}]),await v(),await u([{key:"portal_plans",value:JSON.stringify(["free","monthly","yearly"])}])}catch(T){if(T instanceof ts&&T.data?.errors){h("Invalid secure key");return}else{p(T);return}}else h("Please enter a secure key")},{apiRoot:k}=no(),M=`${k}/members/stripe_connect?mode=${c?"test":"live"}`;return s.jsxs("div",{children:[s.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[s.jsx(bt,{level:3,children:"Connect with Stripe"}),s.jsx(st,{direction:"rtl",label:"Test mode",labelClasses:`text-sm translate-y-[1px] ${c?"text-[#EC6803]":"text-grey-800"}`,toggleBg:"stripetest",onChange:T=>m(T.target.checked)})]}),s.jsxs(bt,{level:6,grey:!0,children:["Step 1 — ",s.jsx("span",{className:"text-black dark:text-white",children:"Generate secure key"})]}),s.jsxs("div",{className:"mb-4 mt-2",children:["Click on the ",s.jsx("strong",{children:"“Connect with Stripe”"})," button to generate a secure key that connects your Ghost site with Stripe."]}),s.jsx(r0,{href:M,tag:"a",target:"_blank"}),s.jsxs(bt,{className:"mb-2 mt-8",level:6,grey:!0,children:["Step 2 — ",s.jsx("span",{className:"text-black dark:text-white",children:"Paste secure key"})]}),s.jsx($n,{error:!!y,hint:y||void 0,placeholder:"Paste your secure key here",onChange:x}),e&&s.jsx(Ue,{className:"mt-5",color:"green",label:"Save Stripe settings",onClick:_})]})},E4=({onClose:e})=>{const{settings:n}=Je(),[a,o]=gt(n,["stripe_connect_display_name","stripe_connect_livemode"]),{refetch:c,isFetching:m}=Fg({searchParams:{filter:"status:paid",limit:"0"},enabled:!1}),{mutateAsync:y}=M_(),h=ot(),l=async()=>{const{data:f}=await c(),u=!!f?.meta?.pagination.total;ye.show(Et,{title:"Disconnect Stripe",prompt:u?"Cannot disconnect while there are members with active Stripe subscriptions.":s.jsxs(s.Fragment,{children:["You‘re about to disconnect your Stripe account ",a," from this site. This will automatically turn off paid memberships on this site."]}),okLabel:u?"":"Disconnect",onOk:async p=>{try{await y(null),p?.remove(),e?.()}catch(x){h(x)}}})};return s.jsxs("section",{children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Ue,{color:"red",disabled:m,icon:"link-broken",iconColorClass:"text-red",label:"Disconnect",link:!0,onClick:l}),s.jsx(Ue,{icon:"close",iconColorClass:"dark:text-white",label:"Close",size:"sm",hideLabel:!0,link:!0,onClick:e})]}),s.jsxs("div",{className:"my-20 flex flex-col items-center",children:[s.jsxs("div",{className:"relative h-20 w-[200px]",children:[s.jsx("img",{alt:"Ghost Logo",className:"absolute left-10 size-16",src:w4}),s.jsx("img",{alt:"Stripe Logo",className:"absolute right-10 size-16 rounded-2xl shadow-[-1.5px_0_0_1.5px_#fff] dark:shadow-[-1.5px_0_0_1.5px_black]",src:y4})]}),s.jsxs(bt,{className:"text-center",level:3,children:["You are connected with Stripe!",o?null:" (Test mode)"]}),s.jsxs("div",{className:"mt-1",children:["Connected to ",s.jsx("strong",{children:a||"Test mode"})]})]}),s.jsxs("div",{className:"flex flex-col items-center",children:[s.jsx(bt,{level:6,children:"Read next"}),s.jsxs("a",{className:"w-100 mt-5 flex flex-col items-stretch justify-between rounded-sm border border-grey-200 transition-all hover:border-grey-400 md:flex-row dark:border-grey-900",href:"https://ghost.org/resources/managing-your-stripe-account/?ref=admin",rel:"noopener noreferrer",target:"_blank",children:[s.jsxs("div",{className:"order-2 p-4 md:order-1",children:[s.jsx("div",{className:"font-bold",children:"How to setup and manage your Stripe account"}),s.jsx("div",{className:"mt-1 text-sm text-grey-800 dark:text-grey-500",children:"Learn how to configure your Stripe account to work with Ghost, from custom branding to payment receipt emails."}),s.jsxs("div",{className:"mt-3 flex items-center gap-1 text-sm text-grey-800 dark:text-grey-500",children:[s.jsx("img",{alt:"Ghost Logo",className:"size-4",src:v2}),s.jsx("strong",{children:"Ghost Resources"}),s.jsx("span",{children:"·"}),s.jsx("span",{children:"by Kym Ellis"})]})]}),s.jsx("div",{className:"order-1 hidden w-[200px] shrink-0 items-center justify-center overflow-hidden md:!visible md:order-2 md:!flex",children:s.jsx("img",{alt:"Bookmark Thumb",className:"min-h-full min-w-full shrink-0",src:v4})})]})]})]})},T4=({onClose:e})=>{const{localSettings:n,updateSetting:a,handleSave:o,saveState:c}=ss(),[m,y]=gt(n,["stripe_publishable_key","stripe_secret_key"]),h=async()=>{try{j_.remove(),await o(),e()}catch(l){if(l instanceof ts){xt({title:"Failed to save settings",type:"error",message:"Check you copied both keys correctly"});return}throw l}};return s.jsxs("div",{children:[s.jsx(bt,{level:3,children:"Connect Stripe"}),s.jsxs(tt,{marginBottom:!1,marginTop:!0,children:[s.jsx(Ae,{title:"Publishable key",value:m?.toString(),onChange:l=>a("stripe_publishable_key",l.target.value)}),s.jsx(Ae,{title:"Secure key",value:y?.toString(),onChange:l=>a("stripe_secret_key",l.target.value)}),s.jsx(Ue,{className:"mt-5",color:"green",disabled:c==="saving",label:"Save Stripe settings",onClick:h})]})]})},S4=()=>{const{config:e,settings:n}=Je(),a=dr(n,"stripe_connect_account_id"),{updateRoute:o}=Qe(),[c,m]=D.useState("start"),y=Zt(),h=Ys(),l=Ws(n,e),f=h?.isDisabled("limitStripeConnect");D.useEffect(()=>{(async()=>{if(f&&!l)try{await h?.errorIfWouldGoOverLimit("limitStripeConnect")}catch(_){_ instanceof Gs&&(y.remove(),ye.show(Xr,{prompt:_.message||"Your current plan doesn't support Stripe Connect.",onOk:()=>o({route:"/pro",isExternal:!0})}))}})()},[h,y,o,l,f]);const u=()=>{m("connect")},p=()=>{y.remove(),o("tiers")};let x;return e?.stripeDirect||Ws(n||[],e||{})&&!a?x=s.jsx(T4,{onClose:p}):a?x=s.jsx(E4,{onClose:p}):c==="start"?x=s.jsx(M4,{onNext:u}):x=s.jsx(j4,{}),s.jsx(yt,{afterClose:()=>{o("tiers")},cancelLabel:"",footer:s.jsx("div",{className:"mt-8"}),testId:"stripe-modal",title:"",width:a?740:520,hideXOnMobile:!0,children:x})},N4=ye.create(S4),A4=""+new URL("ali-abdaal-C_tOLbSs.png",import.meta.url).href,I4=""+new URL("isaac-saul-DhERrV-4.png",import.meta.url).href,C4=""+new URL("joel-warner-CHe_ZipQ.png",import.meta.url).href,D4=ye.create(()=>{const{updateRoute:e}=Qe(),n=ot(),a=Zt(),{settings:o,currentUser:c,siteData:m,config:y}=Je(),h=y.exploreTestimonialsUrl,l=m.site_uuid,[f]=gt(o,["title"]),u=c.name,p=c.email,x=c.roles[0].name,v=c.profile_image,{formState:_,updateForm:k,saveState:M,handleSave:T,errors:A,clearError:C}=kr({initialState:{content:"",prev_platform:""},onSave:async()=>{const $=["none","other",""].includes(_.prev_platform)?void 0:_.prev_platform,W={ghost_uuid:l,staff_user_email:p,content:_.content,prev_platform:$};if(!h)throw new Error("Something went wrong, please try again later.");if(!(await fetch(h,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(W)})).ok)throw new Error("Something went wrong, please try again later.");xt({message:"Thank you for your testimonial!",type:"success"}),e("explore"),a.remove()},onSaveError:n,onValidate:()=>{const $={};return _.content.trim()||($.content="This field is required"),$}}),O=[{value:"none",label:"None - This is a new site"},{value:"substack",label:"Substack"},{value:"beehiiv",label:"BeeHiiv"},{value:"wordpress",label:"WordPress"},{value:"newspack",label:"Newspack"},{value:"medium",label:"Medium"},{value:"squarespace",label:"Squarespace"},{value:"wix",label:"Wix"},{value:"patreon",label:"Patreon"},{value:"memberful",label:"Memberful"},{value:"other",label:"Other"}];return s.jsx(yt,{afterClose:()=>{e("explore")},cancelLabel:"",footer:!1,padding:!1,testId:"explore-testimonials-modal",title:"",topRightContent:"close",width:920,children:s.jsx(tt,{className:"!mb-0",children:s.jsxs("div",{className:"flex items-stretch",children:[s.jsxs("div",{className:"hidden w-full flex-col justify-between bg-gradient-to-tl from-grey-100/50 to-grey-100/80 p-8 dark:from-grey-900/40 dark:to-grey-900/60 [@media(min-width:905px)]:!visible [@media(min-width:905px)]:!flex",children:[s.jsxs("div",{className:"pr-6",children:[s.jsx("div",{className:"relative rounded-xl bg-white px-3 py-2.5 italic text-grey-700 shadow-lg before:absolute before:-bottom-1.5 before:left-5 before:block before:size-3 before:rotate-45 before:bg-white dark:bg-black dark:text-grey-300 before:dark:bg-black",children:"Moving to Ghost has proven to be one of the best business decisions we’ve made as an independent media outlet."}),s.jsxs("div",{className:"ml-2 mt-[14px] flex items-center gap-2 text-sm",children:[s.jsx("div",{className:"size-9 rounded-full bg-white bg-cover bg-center opacity-90 grayscale",style:{backgroundImage:`url(${C4})`}}),s.jsxs("div",{children:[s.jsx("div",{className:"font-medium text-black dark:text-white",children:"Joel Warner"}),s.jsx("div",{className:"-mt-0.5 text-grey-700",children:"Lever News"})]})]})]}),s.jsxs("div",{className:"ml-6 mt-8",children:[s.jsx("div",{className:"relative rounded-xl bg-white px-3 py-2.5 italic text-grey-700 shadow-lg before:absolute before:-bottom-1.5 before:right-5 before:block before:size-3 before:rotate-45 before:bg-white dark:bg-black dark:text-grey-300 before:dark:bg-black",children:"It has now been one year since I quit my full-time job to go all in on Tangle. Today, we have 50,000+ paying subscribers. That’s roughly $5M in gross yearly revenue ... it’s the best paying job I’ve ever had."}),s.jsxs("div",{className:"mr-2 mt-[14px] flex items-center justify-end gap-2 text-sm",children:[s.jsxs("div",{className:"flex flex-col items-end",children:[s.jsx("div",{className:"font-medium text-black dark:text-white",children:"Isaac Saul"}),s.jsx("div",{className:"-mt-0.5 text-grey-700",children:"Tangle"})]}),s.jsx("div",{className:"size-9 rounded-full bg-white bg-cover bg-center opacity-90 grayscale",style:{backgroundImage:`url(${I4})`}})]})]}),s.jsxs("div",{className:"mt-8 hidden pr-6 [@media(min-width:940px)]:!visible [@media(min-width:940px)]:!block",children:[s.jsx("div",{className:"relative rounded-xl bg-white px-3 py-2.5 italic text-grey-700 shadow-lg before:absolute before:-bottom-1.5 before:left-5 before:block before:size-3 before:rotate-45 before:bg-white dark:bg-black dark:text-grey-300 before:dark:bg-black",children:"You should be using Ghost because it’s absolutely amazing and I love it. It’s what I’ve been using for all my sites since 2016."}),s.jsxs("div",{className:"ml-2 mt-[14px] flex items-center gap-2 text-sm",children:[s.jsx("div",{className:"size-9 rounded-full bg-white bg-cover bg-center opacity-90 grayscale",style:{backgroundImage:`url(${A4})`}}),s.jsxs("div",{children:[s.jsx("div",{className:"font-medium text-black dark:text-white",children:"Ali Abdaal"}),s.jsx("div",{className:"-mt-0.5 text-grey-700",children:"YouTuber"})]})]})]})]}),s.jsxs("div",{className:"flex grow flex-col justify-between gap-6 p-8 [@media(min-width:905px)]:min-w-[520px] [@media(min-width:940px)]:min-w-[460px]",children:[s.jsxs("div",{children:[s.jsx("div",{className:"flex size-[60px] items-center justify-center rounded-full bg-gradient-to-t from-[#CFB0FF] to-[#B27EFF]",children:s.jsx("svg",{fill:"none",height:"26",viewBox:"0 0 32 26",width:"32",xmlns:"http://www.w3.org/2000/svg",children:s.jsx("path",{d:"M19.9967 26L18.1562 21.4542C23.4268 19.1176 25.7693 16.5261 26.2712 11.7255C25.5183 12.3627 24.5562 12.7026 23.3431 12.7026C20.1641 12.7026 17.4869 10.1536 17.4869 6.41503C17.4869 2.80392 20.3732 9.72736e-07 24.2634 6.32644e-07C28.2791 2.81581e-07 31.5 3.10131 31.5 8.96405C31.5 17.5458 27.4425 23.0261 19.9967 26ZM3.0098 26L1.12745 21.4543C6.43987 19.1176 8.78235 16.5261 9.24248 11.7255C8.53137 12.3627 7.56928 12.7026 6.35621 12.7026C3.17712 12.7026 0.499999 10.1536 0.499998 6.41504C0.499998 2.80393 3.38627 2.45778e-06 7.23464 2.12135e-06C11.2503 1.77028e-06 14.5131 3.10131 14.5131 8.96405C14.5131 17.5458 10.4556 23.0261 3.0098 26Z",fill:"white"})})}),s.jsxs("div",{className:"mt-6",children:[s.jsx("div",{className:"text-2xl font-semibold tracking-tight",children:"A quote about Ghost"}),s.jsx("div",{className:"mt-2 text-pretty",children:"We feature quotes from publishers to showcase their work, including a logo and a link! If you'd like to be included, share a quote we can use to highlight you."})]}),s.jsx("div",{className:"mt-8",children:s.jsx($n,{error:!!A.content,hint:A.content,placeholder:"What changed for the better since you switched to Ghost?",rows:7,value:_.content,autoFocus:!0,onChange:$=>k(W=>({...W,content:$.target.value})),onKeyDown:()=>C("content")})}),s.jsx("div",{className:"ml-0.5 mt-4",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Vg,{bgColor:Jg(u||p),image:v??void 0,label:Qg(u),labelColor:"white",size:"md"}),s.jsxs("div",{className:"flex flex-col",children:[s.jsxs("span",{className:"text-sm font-medium",children:["By ",u||p]}),s.jsxs("span",{className:"text-xs text-grey-700",children:[x," — ",f]})]})]})})]}),s.jsx("div",{children:s.jsxs("div",{className:"mt-2 flex items-center gap-4",children:[s.jsx("div",{className:"grow",children:s.jsx(Lt,{error:!!A.prev_platform,hint:A.prev_platform,options:O,placeholder:"Previous platform",selectedOption:O.find($=>$.value===_.prev_platform),testId:"migrated-from",onSelect:$=>{k(W=>({...W,prev_platform:$?.value||""})),C("prev_platform")}})}),s.jsx(Ue,{className:"!h-[38px] rounded-lg",color:"black",disabled:M==="saving",label:"Send testimonial",loading:M==="saving",onClick:async()=>{await T()}})]})})]})]})})})}),R4=ye.create(()=>{const{updateRoute:e}=Qe(),{settings:n}=Je(),{mutateAsync:a}=Rn(),{data:{integrations:o}={integrations:[]}}=Qf(),{mutateAsync:c}=dd(),m=ot(),[y,h]=D.useState(!1),[l]=gt(n,["transistor"]),[f,u]=D.useState(!!l),[p,x]=D.useState("Save");D.useEffect(()=>{u(l||!1)},[l]);const v=o.find(({slug:T})=>T==="transistor"),_=v?.api_keys?.find(T=>T.type==="admin"),k=()=>{if(!v||!_)throw new Error("Transistor integration or Admin API key not found");h(!1),ye.show(Et,{title:"Regenerate Admin API Key",prompt:"You will need to update the API key in your Transistor account settings after regenerating.",okLabel:"Regenerate Admin API Key",onOk:async T=>{try{await c({integrationId:v.id,apiKeyId:_.id}),h(!0),T?.remove()}catch(A){m(A)}}})},M=async()=>{const T=[{key:"transistor",value:f}];try{x("Saving..."),await Promise.all([a(T),new Promise(A=>{setTimeout(A,1e3)})]),x("Saved")}catch(A){m(A)}finally{setTimeout(()=>x("Save"),1e3)}};return s.jsxs(yt,{afterClose:()=>{e("integrations")},cancelLabel:"Close",dirty:f!==l,okColor:p==="Saved"?"green":"black",okLabel:p,testId:"transistor-modal",title:"",onOk:M,children:[s.jsx(Qs,{detail:"Podcast hosting platform",icon:s.jsx(ut,{name:"transistor",size:56}),title:"Transistor"}),s.jsx("div",{className:"mt-7",children:s.jsxs(tt,{marginBottom:!1,title:"Transistor configuration",grouped:!0,children:[s.jsx(st,{checked:f,direction:"rtl",hint:s.jsxs(s.Fragment,{children:["Connect your Ghost site with ",s.jsx("a",{className:"text-green",href:"https://transistor.fm",rel:"noopener noreferrer",target:"_blank",children:"Transistor.fm"})," to start offering members private podcasts."]}),label:"Enable Transistor",onChange:T=>{u(T.target.checked)}}),f&&s.jsx(al,{keys:[{label:"Admin API key",text:_?.secret,hint:y?s.jsx("div",{className:"text-green",children:"Admin API Key was successfully regenerated"}):void 0,onRegenerate:k},{label:"API URL",text:window.location.origin+no().subdir}]})]})})]})}),O4=ye.create(()=>{const{updateRoute:e}=Qe(),{settings:n}=Je(),[a]=gt(n,["unsplash"]),{mutateAsync:o}=Rn(),c=ot(),[m,y]=D.useState("Save"),[h,l]=D.useState(!!a);D.useEffect(()=>{l(a||!1)},[a]);const f=async()=>{const p=[{key:"unsplash",value:h}];try{y("Saving..."),await Promise.all([o(p),new Promise(x=>{setTimeout(x,1e3)})]),y("Saved")}catch(x){c(x)}finally{setTimeout(()=>y("Save"),1e3)}},u=h!==a;return s.jsxs(yt,{afterClose:()=>{e("integrations")},cancelLabel:"Close",dirty:u,okColor:m==="Saved"?"green":"black",okLabel:m,testId:"unsplash-modal",title:"",onOk:f,children:[s.jsx(Qs,{detail:"Beautiful, free photos",icon:s.jsx(ut,{name:"unsplash",size:48}),title:"Unsplash"}),s.jsx("div",{className:"mt-7",children:s.jsx(tt,{marginBottom:!1,grouped:!0,children:s.jsx(st,{checked:h,direction:"rtl",hint:s.jsxs(s.Fragment,{children:["Enable ",s.jsx("a",{className:"text-green",href:"https://unsplash.com",rel:"noopener noreferrer",target:"_blank",children:"Unsplash"})," image integration for your posts"]}),label:"Enable Unsplash",onChange:p=>{l(p.target.checked)}})})})]})}),$4=({user:e,setUserData:n})=>{const{config:a,settings:o}=Je(),c=w2("webmentions"),m=Ws(o||[],a||{});return s.jsxs(sd,{children:[s.jsx(st,{checked:e.comment_notifications,direction:"rtl",hint:"Every time a member comments on one of your posts",label:"Comments",onChange:y=>{n?.({...e,comment_notifications:y.target.checked})}}),Hi(e)&&s.jsxs(s.Fragment,{children:[c&&s.jsx(st,{checked:e.mention_notifications,direction:"rtl",hint:"Every time another site links to your work",label:"Mentions",onChange:y=>{n?.({...e,mention_notifications:y.target.checked})}}),s.jsx(st,{checked:e.recommendation_notifications,direction:"rtl",hint:"Every time another publisher recommends you to their audience",label:"Recommendations",onChange:y=>{n?.({...e,recommendation_notifications:y.target.checked})}}),s.jsx(st,{checked:e.free_member_signup_notification,direction:"rtl",hint:"Every time a new free member signs up",label:"New signups",onChange:y=>{n?.({...e,free_member_signup_notification:y.target.checked})}}),m&&s.jsxs(s.Fragment,{children:[s.jsx(st,{checked:e.paid_subscription_started_notification,direction:"rtl",hint:"Every time a member starts a new paid subscription",label:"New paid members",onChange:y=>{n?.({...e,paid_subscription_started_notification:y.target.checked})}}),s.jsx(st,{checked:e.paid_subscription_canceled_notification,direction:"rtl",hint:"Every time a member cancels their paid subscription",label:"Paid member cancellations",onChange:y=>{n?.({...e,paid_subscription_canceled_notification:y.target.checked})}})]}),s.jsx(st,{checked:e.milestone_notifications,direction:"rtl",hint:m?"Occasional summaries of your audience & revenue growth":"Occasional summaries of your audience growth",label:"Milestones",onChange:y=>{n?.({...e,milestone_notifications:y.target.checked})}}),m&&s.jsx(st,{checked:e.donation_notifications,direction:"rtl",hint:"Every time you receive a one-time payment",label:"Tips & donations",onChange:y=>{n?.({...e,donation_notifications:y.target.checked})}})]})]})},L4=({user:e,setUserData:n})=>s.jsx(nd,{border:!1,children:s.jsx($4,{setUserData:n,user:e})}),P4=["1234567890","qwertyuiop","qwertzuiop","asdfghjkl;","abcdefghij","0987654321","1q2w3e4r5t","12345asdfg"],F4=["ghost","password","passw0rd"],U4=e=>{let n={},a,o=!0;a=e.length/2;for(let c=0;c<e.length;c+=1)n[e[c]]?n[e[c]]+=1:n[e[c]]=1;for(let c in n)if(n[c]>=a)return o=!1,o;return o},z4=({user:e})=>{const{currentUser:n,config:a,siteData:o}=Je(),[c,m]=D.useState(!1),[y,h]=D.useState(""),[l,f]=D.useState(""),[u,p]=D.useState(""),[x,v]=D.useState(""),[_,k]=D.useState({}),M=D.useRef(null),T=D.useRef(null),A=D.useRef(null),{mutateAsync:C}=E_(),O=ot(),$=e.id===n.id,W=({password:B,confirmPassword:Y})=>{if($&&!y)return{oldPassword:"Your current password is required to set a new one"};if(B!==Y)return{newPassword:"Your new passwords do not match",confirmNewPassword:"Your new passwords do not match"};let ae=a.blogUrl||window.location.host,ee=o.title,re;if(ae=ae.replace(/^http(s?):\/\//,""),re=ae.match(/\/$/)?ae:`${ae}/`,ee=ee&&ee.trim().toLowerCase(),B.length<10)return{newPassword:"Password must be at least 10 characters long."};B=B.toString();for(const Q of P4)if(Q===B)return{newPassword:"Sorry, you cannot use an insecure password."};if(B.toLowerCase()===e.email.toLowerCase())return{newPassword:"Sorry, you cannot use an insecure password."};for(const Q of F4)if(B.toLowerCase().indexOf(Q)>=0)return{newPassword:"Sorry, you cannot use an insecure password."};return B.toLowerCase()===ee?{newPassword:"Sorry, you cannot use an insecure password."}:B.toLowerCase()===ae||B.toLowerCase()===re?{newPassword:"Sorry, you cannot use an insecure password."}:U4(B)?{}:{newPassword:"Sorry, you cannot use an insecure password."}};D.useEffect(()=>{x==="saved"&&setTimeout(()=>{v(""),m(!1)},2500)},[x]),D.useEffect(()=>{c&&setTimeout(()=>{$?A.current?.focus():M.current?.focus()},100)},[c,$]);const R=()=>{m(!0)};let Z="Save password";x==="saving"?Z="Saving...":x==="saved"&&(Z="Saved");const X=s.jsxs(s.Fragment,{children:[$&&s.jsx(Ae,{"data-testid":"old-password",error:!!_.oldPassword,hint:_.oldPassword,inputRef:A,title:"Old password",type:"password",value:y,onChange:B=>{h(B.target.value)}}),s.jsx(Ae,{"data-testid":"new-password",error:!!_.newPassword,hint:_.newPassword,inputRef:M,title:"New password",type:"password",value:l,onChange:B=>{f(B.target.value)}}),s.jsx(Ae,{"data-testid":"confirm-password",error:!!_.confirmNewPassword,hint:_.confirmNewPassword,inputRef:T,title:"Confirm new password",type:"password",value:u,onChange:B=>{p(B.target.value)}}),s.jsxs("div",{className:"mt-1 flex items-center justify-end gap-3",children:[s.jsx(Ue,{color:"outline",label:"Cancel",onClick:()=>{m(!1),h(""),f(""),p(""),k({})}}),s.jsx(Ue,{color:"green","data-testid":"save-password-button",label:Z,onClick:async()=>{v("saving");const B=W({password:l,confirmPassword:u});if(k(B),Object.keys(B).length>0){v("");return}try{await C({newPassword:l,confirmNewPassword:u,oldPassword:y,userId:e?.id}),v("saved")}catch(Y){v(""),xt({type:"error",title:Y instanceof T_?Y.message:"Couldn't update password. Please try again."}),O(Y,{withToast:!1})}}})]})]}),q=s.jsxs("div",{className:"relative flex flex-col",children:[s.jsx(Ae,{containerClassName:"grow",disabled:!0,title:"Password",type:"password",value:"••••••••••••"}),s.jsx(Ue,{className:"absolute right-0 top-0",color:"green","data-testid":"change-password-button",label:"Change",link:!0,onClick:R})]});return s.jsx(s.Fragment,{children:c?X:q})},H4=({user:e,setUserData:n})=>{const{data:{roles:a}={}}=If(),{config:o}=Je(),c=o.labs.superEditors;let m=[{hint:"Can write and edit their own posts, but cannot publish them.",label:"Contributor",value:"contributor"},{hint:"Can create, edit and publish their own posts, but can’t modify others.",label:"Author",value:"author"},{hint:"Can edit and publish any posts, and manage Authors and Contributors.",label:"Editor",value:"editor"},{hint:"Trusted user who has full access to all content, settings, and user management.",label:"Administrator",value:"administrator"}];if(c&&(m=m.map(y=>y.value==="editor"?{...y,label:"Editor (beta mode)",value:"super editor",hint:"Can invite and manage other Authors and Contributors, as well as edit and publish any posts on the site. Can manage members and moderate comments."}:y)),Af(e)){const y={label:"Owner",value:"owner"};return s.jsx("div",{children:s.jsx(Lt,{disabled:!0,hint:s.jsxs(s.Fragment,{children:["This user is the owner of the site. ",s.jsx("a",{className:"font-medium text-grey-800 transition-colors hover:text-grey-900 dark:text-grey-500 dark:hover:text-grey-400",href:"https://ghost.org/help/transfer-publication-ownership/",rel:"noopener noreferrer",target:"_blank",children:"Transfer ownership"})," first to change their role."]}),options:[y],selectedOption:y,title:"Role",onSelect:()=>{}})})}return s.jsx(Lt,{options:m,selectedOption:m.find(y=>y.value===e.roles[0].name.toLowerCase()),testId:"role-select",title:"Role",onSelect:y=>{if(y){const h=a?.find(l=>l.name.toLowerCase()===y.value.toLowerCase());h&&n?.({...e,roles:[h]})}}})},B4="StaffTokenResponseType",W4=S_({dataType:B4,path:"/users/me/token/"}),q4=ns({path:()=>"/users/me/token/",method:"PUT"}),Y4=()=>{const{refetch:e}=W4({enabled:!1}),n=ot(),[a,o]=D.useState(""),{mutateAsync:c}=q4();D.useEffect(()=>{(async()=>{const h=await e();h?.data?.apiKey&&o(`${h.data.apiKey.id}:${h.data.apiKey.secret}`)})()},[e]);const m=()=>{ye.show(Et,{title:"Regenerate your Staff Access Token",prompt:"You can regenerate your Staff Access Token any time, but any scripts or applications using it will need to be updated.",okLabel:"Regenerate your Staff Access Token",okColor:"red",onOk:async y=>{try{const h=await c([]);o(`${h.apiKey.id}:${h.apiKey.secret}`),y?.remove()}catch(h){n(h)}}})};return s.jsxs("div",{children:[s.jsx(bt,{className:"mb-2",level:6,grey:!0,children:"Staff access token"}),s.jsx(al,{hasLabel:!1,keys:[{text:a||"",onRegenerate:m}]})]})},G4=({errors:e,clearError:n,user:a,setUserData:o})=>{const{currentUser:c}=Je();return s.jsxs(sd,{children:[s.jsx(Ae,{error:!!e?.email,hint:e?.email||"Used for notifications",maxLength:191,title:"Email",value:a.email,onChange:m=>{o({...a,email:m.target.value})},onKeyDown:()=>n("email")}),s.jsx(z4,{user:a}),Hi(c)&&s.jsx(H4,{setUserData:o,user:a}),s.jsx(Ae,{error:!!e?.name,hint:e?.name||"Use your real name so people can recognize you",maxLength:191,title:"Full name",value:a.name,onChange:m=>{o({...a,name:m.target.value})},onKeyDown:()=>n("name")}),s.jsx(Ae,{hint:`https://example.com/author/${a.slug}`,maxLength:191,title:"Slug",value:a.slug,onChange:m=>{o({...a,slug:m.target.value})}}),s.jsx(Ae,{error:!!e?.location,hint:e?.location||"Where in the world do you live?",maxLength:65535,title:"Location",value:a.location||"",onChange:m=>{o({...a,location:m.target.value})},onKeyDown:()=>n("location")}),s.jsx($n,{error:!!e?.bio,hint:e?.bio||s.jsxs(s.Fragment,{children:["Recommended: 250 characters. You‘ve used ",s.jsx("span",{className:"font-bold",children:a.bio?.length||0})]}),maxLength:65535,title:"Bio",value:a.bio||"",onChange:m=>{o({...a,bio:m.target.value})},onKeyDown:()=>n("bio")}),a.id===c.id&&s.jsx(Y4,{})]})},X4=e=>s.jsx(nd,{border:!1,children:s.jsx(G4,{...e})}),K4=({errors:e,clearError:n,validateField:a,user:o,setUserData:c})=>{const[m,y]=D.useState(o.facebook?y2(o.facebook):""),[h,l]=D.useState(o.twitter?_2(o.twitter):""),[f,u]=D.useState(o.threads?oM(o.threads):""),[p,x]=D.useState(o.bluesky?lM(o.bluesky):""),[v,_]=D.useState(o.linkedin?pM(o.linkedin):""),[k,M]=D.useState(o.instagram?mM(o.instagram):""),[T,A]=D.useState(o.youtube?xM(o.youtube):""),[C,O]=D.useState(o.tiktok?vM(o.tiktok):""),[$,W]=D.useState(o.mastodon?yM(o.mastodon):"");return s.jsxs(sd,{children:[s.jsx(Ae,{"data-testid":"website-input",error:!!e?.website,hint:e?.website,maxLength:2e3,placeholder:"https://example.com",title:"Website",value:o.website||"",onChange:R=>{c({...o,website:R.target.value})},onKeyDown:()=>n("url")}),s.jsx(Ae,{"data-testid":"x-input",error:!!e?.twitter,hint:e?.twitter,maxLength:2e3,placeholder:"https://x.com/username",title:"X",value:h,onBlur:R=>{if(a("twitter",R.target.value)){const Z=n0(R.target.value);l(Z),c({...o,twitter:k2(Z)})}},onChange:R=>{l(R.target.value)},onKeyDown:()=>n("twitter")}),s.jsx(Ae,{"data-testid":"facebook-input",error:!!e?.facebook,hint:e?.facebook,maxLength:2e3,placeholder:"https://www.facebook.com/username",title:"Facebook",value:m,onBlur:R=>{if(a("facebook",R.target.value)){const Z=s0(R.target.value);y(Z),c({...o,facebook:M2(Z)})}},onChange:R=>{y(R.target.value)},onKeyDown:()=>n("facebook")}),s.jsx(Ae,{"data-testid":"linkedin-input",error:!!e?.linkedin,hint:e?.linkedin,maxLength:2e3,placeholder:"https://www.linkedin.com/in/username",title:"LinkedIn",value:v,onBlur:R=>{if(a("linkedin",R.target.value)){const Z=X0(R.target.value);_(Z),c({...o,linkedin:hM(Z)})}},onChange:R=>{_(R.target.value)},onKeyDown:()=>n("linkedin")}),s.jsx(Ae,{"data-testid":"bluesky-input",error:!!e?.bluesky,hint:e?.bluesky,maxLength:2e3,placeholder:"https://bsky.app/profile/username",title:"Bluesky",value:p,onBlur:R=>{if(a("bluesky",R.target.value)){const Z=B0(R.target.value);x(Z),c({...o,bluesky:cM(Z)})}},onChange:R=>{x(R.target.value)},onKeyDown:()=>n("bluesky")}),s.jsx(Ae,{"data-testid":"threads-input",error:!!e?.threads,hint:e?.threads,maxLength:2e3,placeholder:"https://threads.net/@username",title:"Threads",value:f,onBlur:R=>{if(a("threads",R.target.value)){const Z=z0(R.target.value);u(Z),c({...o,threads:iM(Z)})}},onChange:R=>{u(R.target.value)},onKeyDown:()=>n("threads")}),s.jsx(Ae,{"data-testid":"mastodon-input",error:!!e?.mastodon,hint:e?.mastodon,maxLength:2e3,placeholder:"https://mastodon.social/@username",title:"Mastodon",value:$,onBlur:R=>{if(a("mastodon",R.target.value)){const Z=Q0(R.target.value);W(Z),c({...o,mastodon:_M(Z)})}},onChange:R=>{W(R.target.value)},onKeyDown:()=>n("mastodon")}),s.jsx(Ae,{"data-testid":"tiktok-input",error:!!e?.tiktok,hint:e?.tiktok,maxLength:2e3,placeholder:"https://www.tiktok.com/@username",title:"TikTok",value:C,onBlur:R=>{if(a("tiktok",R.target.value)){const Z=V0(R.target.value);O(Z),c({...o,tiktok:wM(Z)})}},onChange:R=>{O(R.target.value)},onKeyDown:()=>n("tiktok")}),s.jsx(Ae,{"data-testid":"youtube-input",error:!!e?.youtube,hint:e?.youtube,maxLength:2e3,placeholder:"https://www.youtube.com/@channel",title:"YouTube",value:T,onBlur:R=>{if(a("youtube",R.target.value)){const Z=Z0(R.target.value);A(Z),c({...o,youtube:bM(Z)})}},onChange:R=>{A(R.target.value)},onKeyDown:()=>n("youtube")}),s.jsx(Ae,{"data-testid":"instagram-input",error:!!e?.instagram,hint:e?.instagram,maxLength:2e3,placeholder:"https://www.instagram.com/username",title:"Instagram",value:k,onBlur:R=>{if(a("instagram",R.target.value)){const Z=K0(R.target.value);M(Z),c({...o,instagram:gM(Z)})}},onChange:R=>{M(R.target.value)},onKeyDown:()=>n("instagram")})]})},Z4=e=>s.jsx(nd,{border:!1,children:s.jsx(K4,{...e})}),Og={name:({name:e})=>{let n="";return e||(n="Name is required"),e&&e.length>191&&(n="Name is too long"),n},email:({email:e})=>Nt.isEmail(e||"")?"":"Enter a valid email address",url:({url:e})=>!e||Nt.isURL(e,{require_tld:!1})?"":"Enter a valid URL",bio:({bio:e})=>!e||e.length<=250?"":"Bio is too long",location:({location:e})=>!e||e.length<=150?"":"Location is too long",website:({website:e})=>!e||Nt.isURL(e)&&e.length<=2e3?"":"Enter a valid URL",facebook:({facebook:e})=>{try{return s0(e||""),""}catch(n){return n instanceof Error?n.message:""}},twitter:({twitter:e})=>{try{return n0(e||""),""}catch(n){return n instanceof Error?n.message:""}},threads:({threads:e})=>{try{return z0(e||""),""}catch(n){return n instanceof Error?n.message:""}},bluesky:({bluesky:e})=>{try{return B0(e||""),""}catch(n){return n instanceof Error?n.message:""}},linkedin:({linkedin:e})=>{try{return X0(e||""),""}catch(n){return n instanceof Error?n.message:""}},instagram:({instagram:e})=>{try{return K0(e||""),""}catch(n){return n instanceof Error?n.message:""}},youtube:({youtube:e})=>{try{return Z0(e||""),""}catch(n){return n instanceof Error?n.message:""}},tiktok:({tiktok:e})=>{try{return V0(e||""),""}catch(n){return n instanceof Error?n.message:""}},mastodon:({mastodon:e})=>{try{return Q0(e||""),""}catch(n){return n instanceof Error?n.message:""}}},V4=({user:e})=>{const{updateRoute:n,route:a}=Qe(),o=L=>{const J=L.split("/").pop()||"";return J==="social-links"||J==="email-notifications"?J:"profile"},{ownerUser:c}=j2(),{currentUser:m}=Je(),y=ot(),{formState:h,setFormState:l,saveState:f,handleSave:u,updateForm:p,errors:x,setErrors:v,clearError:_,okProps:k}=kr({initialState:e,savingDelay:500,savedDelay:500,onValidate:L=>Object.entries(Og).reduce((J,[xe,Te])=>{const De=Te(L);return De&&(J[xe]=De),J},{}),onSave:async L=>{await O?.(L)},onSaveError:y}),M=L=>p(()=>L),T=(L,J)=>{const xe=Og[L]?.({[L]:J});return xe?(v({...x,[L]:xe}),!1):(_(L),!0)},A=Zt(),{mutateAsync:C}=Xs(),{mutateAsync:O}=A_(),{mutateAsync:$}=I_(),{mutateAsync:W}=C_(),R=Ys(),Z=Gg(),X=D.useCallback(()=>{Nn(m)?n("staff"):n({isExternal:!0,route:""})},[m,n]),q=async L=>{if(L.status==="inactive"&&L.roles[0].name!=="Contributor")try{await R?.errorIfWouldGoOverLimit("staff")}catch(xe){if(xe instanceof Gs){ye.show(Xr,{formSheet:!0,prompt:xe.message||"Your current plan doesn't support more users.",onOk:()=>n({route:"/pro",isExternal:!0})});return}else throw xe}let J="This user will no longer be able to log in but their posts will be kept.";L.status==="inactive"&&(J="This user will be able to log in again and will have the same permissions they had previously."),ye.show(Et,{title:"Are you sure you want to suspend this user?",prompt:s.jsxs(s.Fragment,{children:[s.jsx("strong",{children:"WARNING:"})," ",J]}),okLabel:L.status==="inactive"?"Un-suspend":"Suspend",okRunningLabel:L.status==="inactive"?"Un-suspending...":"Suspending...",okColor:"red",onOk:async xe=>{const Te={...L,status:L.status==="inactive"?"active":"inactive"};try{await O(Te),l(()=>Te),xe?.remove(),xt({title:L.status==="inactive"?"User un-suspended":"User suspended",type:"success"})}catch(De){y(De)}}})},B=(L,{owner:J})=>{ye.show(Et,{title:"Are you sure you want to delete this user?",prompt:s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"mb-3",children:[s.jsx("span",{className:"font-bold",children:L.name||L.email})," will be permanently deleted and all their posts will be automatically assigned to the ",s.jsx("span",{className:"font-bold",children:J.name}),"."]}),s.jsxs("p",{children:["To make these easy to find in the future, each post will be given an internal tag of ",s.jsxs("span",{className:"font-bold",children:["#",e.slug]})]})]}),okLabel:"Delete user",okColor:"red",onOk:async xe=>{try{await $(L?.id),xe?.remove(),A?.remove(),X(),xt({title:"User deleted",type:"success"})}catch(Te){y(Te)}}})},Y=()=>{ye.show(Et,{title:"Transfer Ownership",prompt:"Are you sure you want to transfer the ownership of this blog? You will not be able to undo this action.",okLabel:"Yep — I'm sure",okColor:"red",onOk:async L=>{try{await W(e.id),L?.remove(),xt({title:"Ownership transferred",type:"success"})}catch(J){y(J)}}})},ae=async(L,J)=>{try{const xe=on(await C({file:J}));switch(L){case"cover_image":p(Te=>({...Te,cover_image:xe}));break;case"profile_image":p(Te=>({...Te,profile_image:xe}));break}}catch(xe){const Te=xe;Te.response.status===415&&(Te.message="Unsupported file type"),y(Te)}},ee=L=>{switch(L){case"cover_image":p(J=>({...J,cover_image:""}));break;case"profile_image":p(J=>({...J,profile_image:""}));break}},re=Hi(m)||ih(m)&&lh(e);let Q=[];if(Af(m)&&D_(h)&&h.status!=="inactive"&&Q.push({id:"make-owner",label:"Make owner",onClick:Y}),h.id!==m.id&&(Hi(m)&&!Af(e)||ih(m)&&lh(e))){let L=h.status==="inactive"?"Un-suspend user":"Suspend user";Q.push({id:"delete-user",label:"Delete user",onClick:()=>{B(e,{owner:c})}},{id:"suspend-user",label:L,onClick:()=>{q(h)}})}Q.push({id:"view-user-activity",label:"View user activity",onClick:()=>{A.remove(),n(`history/view/${h.id}`)}});const ne="rounded text-sm flex flex-nowrap items-center justify-center px-3 h-8 transition-all cursor-pointer font-medium border border-grey-300 bg-transparent text-black dark:border-grey-800 dark:text-white",be="flex flex-nowrap items-center justify-center px-3 h-8 opacity-80 hover:opacity-100 bg-[rgba(0,0,0,0.75)] rounded text-sm text-white transition-all cursor-pointer font-medium nowrap",je=h.status==="inactive"?" (Suspended)":"",H=o(a),[he,ge]=D.useState(H),F=L=>{const J=L==="profile"?"":`/${L}`;n(`staff/${e.slug}${J}`),ge(L)};return s.jsx(yt,{afterClose:X,animate:Nn(m),backDrop:Nn(m),buttonsDisabled:k.disabled,cancelLabel:"Close",dirty:f==="unsaved",okColor:k.color,okLabel:k.label||"Save",size:Nn(m)?"md":"bleed",stickyFooter:!0,testId:"user-detail-modal",width:Nn(m)?600:"full",onOk:async()=>{await u({fakeWhenUnchanged:!0})},children:s.jsxs("div",{children:[s.jsx("div",{className:`relative ${Nn(m)?"-mx-8 -mt-8 rounded-t":"-mx-10 -mt-10"}`,children:s.jsx("div",{className:`flex flex-wrap items-end justify-between gap-8 p-8 ${h.cover_image?"bg-cover bg-center":""} ${!Nn(m)&&"min-h-[30vmin]"}`,style:{backgroundImage:h.cover_image?`url(${h.cover_image})`:"none"},children:s.jsxs("div",{className:"flex w-full flex-col gap-2",children:[s.jsxs("div",{className:"flex flex-nowrap items-start justify-between gap-3",children:[s.jsx("div",{children:s.jsx(un,{deleteButtonClassName:"md:invisible absolute pr-3 -right-2 -top-2 flex h-8 w-10 cursor-pointer items-center justify-end rounded-full bg-[rgba(0,0,0,0.75)] text-white group-hover:!visible",deleteButtonContent:s.jsx(ut,{colorClass:"text-white",name:"trash",size:"sm"}),editButtonClassName:"md:invisible absolute right-[22px] -top-2 flex h-8 w-8 cursor-pointer items-center justify-center text-white group-hover:!visible z-20",fileUploadClassName:"rounded-full bg-black flex items-center justify-center opacity-80 transition hover:opacity-100 -ml-2 cursor-pointer h-[80px] w-[80px]",fileUploadProps:{dragIndicatorClassName:"rounded-full"},id:"avatar",imageClassName:"w-full h-full object-cover rounded-full shrink-0",imageContainerClassName:"relative group bg-cover bg-center -ml-1 h-16 w-16 md:h-18 md:w-18 shrink-0",imageURL:h.profile_image??void 0,pintura:{isEnabled:Z.isEnabled,openEditor:async()=>Z.openEditor({image:h.profile_image||"",handleSave:async L=>{ae("profile_image",L)}})},unstyled:!0,width:"80px",onDelete:()=>{ee("profile_image")},onUpload:L=>{ae("profile_image",L)},children:s.jsx(ut,{colorClass:"black",name:"user-add",size:"lg"})})}),s.jsxs("div",{className:"flex flex-nowrap items-start gap-3",children:[s.jsx(un,{buttonContainerClassName:"flex items-end gap-4 justify-end flex-nowrap",deleteButtonClassName:be,deleteButtonContent:"Delete cover image",editButtonClassName:be,fileUploadClassName:ne,id:"cover-image",imageClassName:"hidden",imageURL:h.cover_image||"",pintura:{isEnabled:Z.isEnabled,openEditor:async()=>Z.openEditor({image:h.cover_image||"",handleSave:async L=>{ae("cover_image",L)}})},unstyled:!0,onDelete:()=>{ee("cover_image")},onUpload:L=>{ae("cover_image",L)},children:"Upload cover image"}),re&&s.jsx("div",{className:"z-10",children:s.jsx(E0,{items:Q,position:"end",trigger:s.jsxs("button",{className:we("flex h-8 cursor-pointer items-center justify-center rounded px-3",h.cover_image?"bg-[rgba(0,0,0,0.75)] opacity-80 hover:opacity-100":"border border-grey-300 bg-transparent text-black dark:border-grey-800 dark:text-white"),type:"button",children:[s.jsx("span",{className:"sr-only",children:"Actions"}),s.jsx(ut,{colorClass:h.cover_image?"text-white":void 0,name:"ellipsis",size:"md"})]})})})]})]}),s.jsxs("div",{children:[s.jsxs(bt,{level:3,styles:we("break-words md:break-normal",h.cover_image?"text-white":"text-black dark:text-white"),children:[e.name,je]}),s.jsx("span",{className:we("text-md font-medium capitalize",h.cover_image?"text-white":"text-black dark:text-white"),children:e.roles[0].name.toLowerCase()})]})]})})}),s.jsx("div",{className:`${!Nn(m)&&"mx-auto max-w-[536px]"} mt-6 flex flex-col`,children:s.jsx(Dn,{selectedTab:he,tabs:[{id:"profile",title:"Profile",contents:s.jsx(X4,{clearError:_,errors:x,setUserData:M,user:h,validateField:T})},{id:"social-links",title:"Social Links",contents:s.jsx(Z4,{clearError:_,errors:x,setUserData:M,user:h,validateField:T})},{id:"email-notifications",title:"Email Notifications",contents:s.jsx(L4,{setUserData:M,user:h})}],onTabChange:F})})]})})},Q4=({params:e})=>{const{currentUser:n}=Je(),a=n.slug===e?.slug,{data:o}=N_(e?.slug||"",{enabled:!a&&!!e?.slug}),c=a?n:o?.users?.[0];return c?s.jsx(V4,{user:c}):null},J4=ye.create(Q4),iT={AddIntegrationModal:$M,AddNewsletterModal:PM,AddRecommendationModal:tx,CustomIntegrationModal:nj,DesignAndThemeModal:iE,EditRecommendationModal:E2,FirstPromoterModal:kE,HistoryModal:OE,InviteUserModal:$E,NavigationModal:LE,NewsletterDetailModal:XE,PinturaModal:o4,PortalModal:x4,SlackModal:b4,StripeConnectModal:N4,TestimonialsModal:D4,TierDetailModal:jM,TransistorModal:R4,UnsplashModal:O4,UserDetailModal:J4,ZapierModal:aM,AnnouncementBarModal:XM,EmbedSignupFormModal:_E,OffersContainerModal:n4,AboutModal:RM,OfferSuccess:wx};export{iT as default};
|