1import{x as t,r as u,w as Yr,j as i,A as Qr,C as Jr}from"./components-Hjxm1_JN.js";import{h as Fn,b as On,T as Kr,e as ea,g as ta,c as na,j as pt,k as Mt,u as Zt,L as ra,l as gn,I as aa,a as oa,P as Wn,m as ia,R as qt,d as sa,f as la,s as $n,S as ca,o as ot,p as da,E as Bt,q as Hn,r as ua,v as pa,w as ma,x as fa,M as ha}from"./context-BPX_t8_y.js";let Pe;(function(e){e[e.Backspace=8]="Backspace",e[e.Tab=9]="Tab",e[e.Enter=13]="Enter",e[e.Shift=16]="Shift",e[e.Ctrl=17]="Ctrl",e[e.Alt=18]="Alt",e[e.Pause=19]="Pause",e[e.CapsLock=20]="CapsLock",e[e.Escape=27]="Escape",e[e.Space=32]="Space",e[e.PageUp=33]="PageUp",e[e.PageDown=34]="PageDown",e[e.End=35]="End",e[e.Home=36]="Home",e[e.LeftArrow=37]="LeftArrow",e[e.UpArrow=38]="UpArrow",e[e.RightArrow=39]="RightArrow",e[e.DownArrow=40]="DownArrow",e[e.Insert=45]="Insert",e[e.Delete=46]="Delete",e[e.Key0=48]="Key0",e[e.Key1=49]="Key1",e[e.Key2=50]="Key2",e[e.Key3=51]="Key3",e[e.Key4=52]="Key4",e[e.Key5=53]="Key5",e[e.Key6=54]="Key6",e[e.Key7=55]="Key7",e[e.Key8=56]="Key8",e[e.Key9=57]="Key9",e[e.KeyA=65]="KeyA",e[e.KeyB=66]="KeyB",e[e.KeyC=67]="KeyC",e[e.KeyD=68]="KeyD",e[e.KeyE=69]="KeyE",e[e.KeyF=70]="KeyF",e[e.KeyG=71]="KeyG",e[e.KeyH=72]="KeyH",e[e.KeyI=73]="KeyI",e[e.KeyJ=74]="KeyJ",e[e.KeyK=75]="KeyK",e[e.KeyL=76]="KeyL",e[e.KeyM=77]="KeyM",e[e.KeyN=78]="KeyN",e[e.KeyO=79]="KeyO",e[e.KeyP=80]="KeyP",e[e.KeyQ=81]="KeyQ",e[e.KeyR=82]="KeyR",e[e.KeyS=83]="KeyS",e[e.KeyT=84]="KeyT",e[e.KeyU=85]="KeyU",e[e.KeyV=86]="KeyV",e[e.KeyW=87]="KeyW",e[e.KeyX=88]="KeyX",e[e.KeyY=89]="KeyY",e[e.KeyZ=90]="KeyZ",e[e.LeftMeta=91]="LeftMeta",e[e.RightMeta=92]="RightMeta",e[e.Select=93]="Select",e[e.Numpad0=96]="Numpad0",e[e.Numpad1=97]="Numpad1",e[e.Numpad2=98]="Numpad2",e[e.Numpad3=99]="Numpad3",e[e.Numpad4=100]="Numpad4",e[e.Numpad5=101]="Numpad5",e[e.Numpad6=102]="Numpad6",e[e.Numpad7=103]="Numpad7",e[e.Numpad8=104]="Numpad8",e[e.Numpad9=105]="Numpad9",e[e.Multiply=106]="Multiply",e[e.Add=107]="Add",e[e.Subtract=109]="Subtract",e[e.Decimal=110]="Decimal",e[e.Divide=111]="Divide",e[e.F1=112]="F1",e[e.F2=113]="F2",e[e.F3=114]="F3",e[e.F4=115]="F4",e[e.F5=116]="F5",e[e.F6=117]="F6",e[e.F7=118]="F7",e[e.F8=119]="F8",e[e.F9=120]="F9",e[e.F10=121]="F10",e[e.F11=122]="F11",e[e.F12=123]="F12",e[e.NumLock=144]="NumLock",e[e.ScrollLock=145]="ScrollLock",e[e.Semicolon=186]="Semicolon",e[e.Equals=187]="Equals",e[e.Comma=188]="Comma",e[e.Dash=189]="Dash",e[e.Period=190]="Period",e[e.ForwardSlash=191]="ForwardSlash",e[e.GraveAccent=192]="GraveAccent",e[e.OpenBracket=219]="OpenBracket",e[e.BackSlash=220]="BackSlash",e[e.CloseBracket=221]="CloseBracket",e[e.SingleQuote=222]="SingleQuote"})(Pe||(Pe={}));function Dn(e){const n=typeof e;return e!=null&&(n==="object"||n==="function")}function M(...e){return e.filter(Boolean).join(" ")}function ie(e,n){return`${e}${n.charAt(0).toUpperCase()}${n.slice(1)}`}function Vt(e){const n=Object.entries(e).filter(([r,a])=>a!=null);return n.length?Object.fromEntries(n):void 0}function Me(e,n,r,a){if(!a)return{};let o;return Dn(a)?o=Object.fromEntries(Object.entries(a).map(([s,c])=>[s,`var(--p-${r}-${c})`])):o={[Fn[0]]:`var(--p-${r}-${a})`},Object.fromEntries(Object.entries(o).map(([s,c])=>[`--pc-${e}-${n}-${s}`,c]))}function Tt(e,n,r){return r?Dn(r)?Object.fromEntries(Object.entries(r).map(([a,o])=>[`--pc-${e}-${n}-${a}`,o])):{[`--pc-${e}-${n}-${Fn[0]}`]:r}:{}}var ga={themeContainer:"Polaris-ThemeProvider--themeContainer"};const ba=["light","dark-experimental"],va=e=>ba.includes(e);function xa(e){const{as:n="div",children:r,className:a,theme:o=On}=e;return t.createElement(Kr.Provider,{value:o},t.createElement(ea.Provider,{value:ta(o)},t.createElement(n,{"data-portal-id":e["data-portal-id"],className:M(na(o),ga.themeContainer,a)},r)))}const Xt=u.createContext(!1);function Yt(e,n,r,a){const o=u.useRef(n),s=u.useRef(a);pt(()=>{o.current=n},[n]),pt(()=>{s.current=a},[a]),u.useEffect(()=>{if(!(typeof e=="string"&&r!==null))return;let c;if(typeof r>"u")c=window;else if("current"in r){if(r.current===null)return;c=r.current}else c=r;const l=s.current,d=p=>o.current(p);return c.addEventListener(e,d,l),()=>{c.removeEventListener(e,d,l)}},[e,r])}var Un=function(n){return t.createElement("svg",Object.assign({viewBox:"0 0 20 20"},n),t.createElement("path",{d:"M10 6a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5a.75.75 0 0 1 .75-.75Z"}),t.createElement("path",{d:"M11 13a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"}),t.createElement("path",{fillRule:"evenodd",d:"M17 10a7 7 0 1 1-14 0 7 7 0 0 1 14 0Zm-1.5 0a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0Z"}))};Un.displayName="AlertCircleIcon";var zn=function(n){return t.createElement("svg",Object.assign({viewBox:"0 0 20 20"},n),t.createElement("path",{d:"M10 6a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5a.75.75 0 0 1 .75-.75Z"}),t.createElement("path",{d:"M11 13a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"}),t.createElement("path",{fillRule:"evenodd",d:"M11.237 3.177a1.75 1.75 0 0 0-2.474 0l-5.586 5.585a1.75 1.75 0 0 0 0 2.475l5.586 5.586a1.75 1.75 0 0 0 2.474 0l5.586-5.586a1.75 1.75 0 0 0 0-2.475l-5.586-5.585Zm-1.414 1.06a.25.25 0 0 1 .354 0l5.586 5.586a.25.25 0 0 1 0 .354l-5.586 5.585a.25.25 0 0 1-.354 0l
1-5.586-5.585a.25.25 0 0 1 0-.354l5.586-5.586Z"}))};zn.displayName="AlertDiamondIcon";var Gn=function(n){return t.createElement("svg",Object.assign({viewBox:"0 0 20 20"},n),t.createElement("path",{d:"M10 6.75a.75.75 0 0 1 .75.75v3.5a.75.75 0 1 1-1.5 0v-3.5a.75.75 0 0 1 .75-.75Z"}),t.createElement("path",{d:"M11 13.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"}),t.createElement("path",{fillRule:"evenodd",d:"M10 3.5c-1.045 0-1.784.702-2.152 1.447a449.26 449.26 0 0 1-2.005 3.847l-.028.052a403.426 403.426 0 0 0-2.008 3.856c-.372.752-.478 1.75.093 2.614.57.863 1.542 1.184 2.464 1.184h7.272c.922 0 1.895-.32 2.464-1.184.57-.864.465-1.862.093-2.614-.21-.424-1.113-2.147-2.004-3.847l-.032-.061a429.497 429.497 0 0 1-2.005-3.847c-.368-.745-1.107-1.447-2.152-1.447Zm-.808 2.112c.404-.816 1.212-.816 1.616 0 .202.409 1.112 2.145 2.022 3.88a418.904 418.904 0 0 1 2.018 3.875c.404.817 0 1.633-1.212 1.633h-7.272c-1.212 0-1.617-.816-1.212-1.633.202-.408 1.113-2.147 2.023-3.883a421.932 421.932 0 0 0 2.017-3.872Z"}))};Gn.displayName="AlertTriangleIcon";var Zn=function(n){return t.createElement("svg",Object.assign({viewBox:"0 0 20 20"},n),t.createElement("path",{fillRule:"evenodd",d:"M16.5 10a.75.75 0 0 1-.75.75h-9.69l2.72 2.72a.75.75 0 0 1-1.06 1.06l-4-4a.75.75 0 0 1 0-1.06l4-4a.75.75 0 1 1 1.06 1.06l-2.72 2.72h9.69a.75.75 0 0 1 .75.75Z"}))};Zn.displayName="ArrowLeftIcon";var qn=function(n){return t.createElement("svg",Object.assign({viewBox:"0 0 20 20"},n),t.createElement("path",{fillRule:"evenodd",d:"M15.78 5.97a.75.75 0 0 1 0 1.06l-6.5 6.5a.75.75 0 0 1-1.06 0l-3.25-3.25a.75.75 0 1 1 1.06-1.06l2.72 2.72 5.97-5.97a.75.75 0 0 1 1.06 0Z"}))};qn.displayName="CheckIcon";var Qt=function(n){return t.createElement("svg",Object.assign({viewBox:"0 0 20 20"},n),t.createElement("path",{fillRule:"evenodd",d:"M5.72 8.47a.75.75 0 0 1 1.06 0l3.47 3.47 3.47-3.47a.75.75 0 1 1 1.06 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 0-1.06Z"}))};Qt.displayName="ChevronDownIcon";var Vn=function(n){return t.createElement("svg",Object.assign({viewBox:"0 0 20 20"},n),t.createElement("path",{fillRule:"evenodd",d:"M11.764 5.204a.75.75 0 0 1 .032 1.06l-3.516 3.736 3.516 3.736a.75.75 0 1 1-1.092 1.028l-4-4.25a.75.75 0 0 1 0-1.028l4-4.25a.75.75 0 0 1 1.06-.032Z"}))};Vn.displayName="ChevronLeftIcon";var Xn=function(n){return t.createElement("svg",Object.assign({viewBox:"0 0 20 20"},n),t.createElement("path",{fillRule:"evenodd",d:"M7.72 14.53a.75.75 0 0 1 0-1.06l3.47-3.47-3.47-3.47a.75.75 0 0 1 1.06-1.06l4 4a.75.75 0 0 1 0 1.06l-4 4a.75.75 0 0 1-1.06 0Z"}))};Xn.displayName="ChevronRightIcon";var Jt=function(n){return t.createElement("svg",Object.assign({viewBox:"0 0 20 20"},n),t.createElement("path",{fillRule:"evenodd",d:"M14.53 12.28a.75.75 0 0 1-1.06 0l-3.47-3.47-3.47 3.47a.75.75 0 0 1-1.06-1.06l4-4a.75.75 0 0 1 1.06 0l4 4a.75.75 0 0 1 0 1.06Z"}))};Jt.displayName="ChevronUpIcon";var Yn=function(n){return t.createElement("svg",Object.assign({viewBox:"0 0 20 20"},n),t.createElement("path",{d:"M10 14a.75.75 0 0 1-.75-.75v-3.5a.75.75 0 0 1 1.5 0v3.5a.75.75 0 0 1-.75.75Z"}),t.createElement("path",{d:"M9 7a1 1 0 1 1 2 0 1 1 0 0 1-2 0Z"}),t.createElement("path",{fillRule:"evenodd",d:"M17 10a7 7 0 1 1-14 0 7 7 0 0 1 14 0Zm-1.5 0a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0Z"}))};Yn.displayName="InfoIcon";var Qn=function(n){return t.createElement("svg",Object.assign({viewBox:"0 0 20 20"},n),t.createElement("path",{d:"M6 10a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z"}),t.createElement("path",{d:"M11.5 10a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z"}),t.createElement("path",{d:"M17 10a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z"}))};Qn.displayName="MenuHorizontalIcon";var Jn=function(n){return t.createElement("svg",Object.assign({viewBox:"0 0 20 20"},n),t.createElement("path",{fillRule:"evenodd",d:"M12.323 13.383a5.5 5.5 0 1 1 1.06-1.06l2.897 2.897a.75.75 0 1 1-1.06 1.06l-2.897-2.897Zm.677-4.383a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"}))};Jn.displayName="SearchIcon";var Kn=function(n){return t.createElement("svg",Object.assign({viewBox:"0 0 20 20"},n),t.createElement("path",{d:"M10.884 4.323a1.25 1.25 0 0 0-1.768 0l-2.646 2.647a.75.75 0 0 0 1.06 1.06l2.47-2.47 2.47 2.47a.75.75 0 1 0 1.06-1.06l-2.646-2.647Z"}),t.createElement("path",{d:"m13.53 13.03-2.646 2.647a1.25 1.25 0 0 1-1.768 0l-2.646-2.647a.75.75 0 0 1 1.06-1.06l2.47 2.47 2.47-2.47a.75.75 0 0 1 1.06 1.06Z"}))};Kn.displayName="SelectIcon";var er=function(n){return t.createElement("svg",Object.assign({viewBox:"0 0 20 20"},n),t.createElement("path",{d:"M13.03 6.97a.75.75 0 0 1 0 1.06l-1.97 1.97 1.97 1.97a.75.75 0 1 1-1.06 1.06l-1.97-1.97-1.97 1.97a.75.75 0 0 1-1.06-1.06l1.97-1.97-1.97-1.97a.75.75 0 0 1 1.06-1.06l1.97 1.97 1.97-1.97a.75.75 0 0 1 1.06 0Z"}),t.createElement("path",{fillRule:"evenodd",d:"M10 17a7 7 0 1 0 0-14 7 7 0 0 0 0 14Zm0-1.5a5.5 5.5 0 1 0 0-11 5.5 5.5 0 0 0 0 11Z"}))};er.displayName="XCircleIcon";var tr=function(n){return t.createElement("svg",Object.assign({viewBox:"0 0 20 20"},n),t.createElement("path",{d:"M12.72 13.78a.75.75 0 1 0 1.06-1.06l-2.72-2.72 2.72-2.72a.75.75 0 0 0-1.06-1.06l-2.72 2.72-2.72-2.72a.75.75 0 0 0-1.06 1.06l2.72 2.72-2.72 2.72a.75.75 0 1 0 1.06 1.06l2.72-2.72 2.72 2.72Z"}))};
1tr.displayName="XIcon";function Ea(e){const{top:n,left:r,bottom:a,right:o}=e.getBoundingClientRect();return n>=0&&o<=window.innerWidth&&a<=window.innerHeight&&r>=0}const zt='a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not([aria-disabled="true"]):not([tabindex="-1"]):not(:disabled),*[tabindex]',bn='a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not([aria-disabled="true"]):not([tabindex="-1"]):not(:disabled),*[tabindex]:not([tabindex="-1"])',ya='a[role="menuitem"],frame[role="menuitem"],iframe[role="menuitem"],input[role="menuitem"]:not([type=hidden]):not(:disabled),select[role="menuitem"]:not(:disabled),textarea[role="menuitem"]:not(:disabled),button[role="menuitem"]:not(:disabled),*[tabindex]:not([tabindex="-1"])',Nt=({currentTarget:e})=>e.blur();function Pa(e,n){const r=[...document.querySelectorAll(zt)],a=r.indexOf(e)+1,o=r.slice(a);for(const s of o)if(Ea(s)&&(!n||n&&n(s)))return s;return null}function Sa(e,n=!0){return!n&&Kt(e,zt)?e:e.querySelector(zt)}function it(e){const n="a,button,frame,iframe,input:not([type=hidden]),select,textarea,*[tabindex]";return Kt(e,n)?e:e.querySelector(n)}function vn(e,n){const r=Pa(e,n);return r&&r instanceof HTMLElement?(r.focus(),!0):!1}function wa(e,n=!0){return!n&&Kt(e,bn)?e:e.querySelector(bn)}function Ca(e,n){const r=nr(e),a=rr(r,n);a===-1?r[0].focus():r[(a-1+r.length)%r.length].focus()}function ka(e,n){const r=nr(e),a=rr(r,n);a===-1?r[0].focus():r[(a+1)%r.length].focus()}function nr(e){return e.querySelectorAll(ya)}function rr(e,n){let r=0;for(const a of e){if(a===n)break;r++}return r===e.length?-1:r}function Kt(e,n){if(e.matches)return e.matches(n);const r=(e.ownerDocument||document).querySelectorAll(n);let a=r.length;for(;--a>=0&&r.item(a)!==e;)return a>-1}var ne={Button:"Polaris-Button",disabled:"Polaris-Button--disabled",pressed:"Polaris-Button--pressed",variantPrimary:"Polaris-Button--variantPrimary",variantSecondary:"Polaris-Button--variantSecondary",variantTertiary:"Polaris-Button--variantTertiary",variantPlain:"Polaris-Button--variantPlain",removeUnderline:"Polaris-Button--removeUnderline",variantMonochromePlain:"Polaris-Button--variantMonochromePlain",toneSuccess:"Polaris-Button--toneSuccess",toneCritical:"Polaris-Button--toneCritical",sizeMicro:"Polaris-Button--sizeMicro",sizeSlim:"Polaris-Button--sizeSlim",sizeMedium:"Polaris-Button--sizeMedium",sizeLarge:"Polaris-Button--sizeLarge",textAlignCenter:"Polaris-Button--textAlignCenter",textAlignStart:"Polaris-Button--textAlignStart",textAlignLeft:"Polaris-Button--textAlignLeft",textAlignEnd:"Polaris-Button--textAlignEnd",textAlignRight:"Polaris-Button--textAlignRight",fullWidth:"Polaris-Button--fullWidth",iconOnly:"Polaris-Button--iconOnly",iconWithText:"Polaris-Button--iconWithText",disclosure:"Polaris-Button--disclosure",loading:"Polaris-Button--loading",pressable:"Polaris-Button--pressable",hidden:"Polaris-Button--hidden",Icon:"Polaris-Button__Icon",Spinner:"Polaris-Button__Spinner"},st={Icon:"Polaris-Icon",toneInherit:"Polaris-Icon--toneInherit",toneBase:"Polaris-Icon--toneBase",toneSubdued:"Polaris-Icon--toneSubdued",toneCaution:"Polaris-Icon--toneCaution",toneWarning:"Polaris-Icon--toneWarning",toneCritical:"Polaris-Icon--toneCritical",toneInteractive:"Polaris-Icon--toneInteractive",toneInfo:"Polaris-Icon--toneInfo",toneSuccess:"Polaris-Icon--toneSuccess",tonePrimary:"Polaris-Icon--tonePrimary",toneEmphasis:"Polaris-Icon--toneEmphasis",toneMagic:"Polaris-Icon--toneMagic",toneTextCaution:"Polaris-Icon--toneTextCaution",toneTextWarning:"Polaris-Icon--toneTextWarning",toneTextCritical:"Polaris-Icon--toneTextCritical",toneTextInfo:"Polaris-Icon--toneTextInfo",toneTextPrimary:"Polaris-Icon--toneTextPrimary",toneTextSuccess:"Polaris-Icon--toneTextSuccess",toneTextMagic:"Polaris-Icon--toneTextMagic",Svg:"Polaris-Icon__Svg",Img:"Polaris-Icon__Img",Placeholder:"Polaris-Icon__Placeholder"},Te={root:"Polaris-Text--root",block:"Polaris-Text--block",truncate:"Polaris-Text--truncate",visuallyHidden:"Polaris-Text--visuallyHidden",start:"Polaris-Text--start",center:"Polaris-Text--center",end:"Polaris-Text--end",justify:"Polaris-Text--justify",base
1:"Polaris-Text--base",inherit:"Polaris-Text--inherit",disabled:"Polaris-Text--disabled",success:"Polaris-Text--success",critical:"Polaris-Text--critical",caution:"Polaris-Text--caution",subdued:"Polaris-Text--subdued",magic:"Polaris-Text--magic","magic-subdued":"Polaris-Text__magic--subdued","text-inverse":"Polaris-Text__text--inverse","text-inverse-secondary":"Polaris-Text--textInverseSecondary",headingXs:"Polaris-Text--headingXs",headingSm:"Polaris-Text--headingSm",headingMd:"Polaris-Text--headingMd",headingLg:"Polaris-Text--headingLg",headingXl:"Polaris-Text--headingXl",heading2xl:"Polaris-Text--heading2xl",heading3xl:"Polaris-Text--heading3xl",bodyXs:"Polaris-Text--bodyXs",bodySm:"Polaris-Text--bodySm",bodyMd:"Polaris-Text--bodyMd",bodyLg:"Polaris-Text--bodyLg",regular:"Polaris-Text--regular",medium:"Polaris-Text--medium",semibold:"Polaris-Text--semibold",bold:"Polaris-Text--bold",break:"Polaris-Text--break",numeric:"Polaris-Text--numeric","line-through":"Polaris-Text__line--through"};const x=({alignment:e,as:n,breakWord:r,children:a,tone:o,fontWeight:s,id:c,numeric:l=!1,truncate:d=!1,variant:p,visuallyHidden:m=!1,textDecorationLine:b})=>{const h=n||(m?"span":"p"),f=M(Te.root,p&&Te[p],s&&Te[s],(e||d)&&Te.block,e&&Te[e],r&&Te.break,o&&Te[o],l&&Te.numeric,d&&Te.truncate,m&&Te.visuallyHidden,b&&Te[b]);return t.createElement(h,Object.assign({className:f},c&&{id:c}),a)};function Ee({source:e,tone:n,accessibilityLabel:r}){let a;typeof e=="function"?a="function":e==="placeholder"?a="placeholder":a="external";const o=M(st.Icon,n&&st[ie("tone",n)]),{mdDown:s}=Mt(),c=e,l={function:t.createElement(c,Object.assign({className:st.Svg,focusable:"false","aria-hidden":"true"},s?{viewBox:"1 1 18 18"}:{})),placeholder:t.createElement("div",{className:st.Placeholder}),external:t.createElement("img",{className:st.Img,src:`data:image/svg+xml;utf8,${e}`,alt:"","aria-hidden":"true"})};return t.createElement("span",{className:o},r&&t.createElement(x,{as:"span",visuallyHidden:!0},r),l[a])}var xn={Spinner:"Polaris-Spinner",sizeSmall:"Polaris-Spinner--sizeSmall",sizeLarge:"Polaris-Spinner--sizeLarge"};function ar({size:e="large",accessibilityLabel:n,hasFocusableParent:r}){const a=Zt(),o=M(xn.Spinner,e&&xn[ie("size",e)]),s=e==="large"?t.createElement("svg",{viewBox:"0 0 44 44",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M15.542 1.487A21.507 21.507 0 00.5 22c0 11.874 9.626 21.5 21.5 21.5 9.847 0 18.364-6.675 20.809-16.072a1.5 1.5 0 00-2.904-.756C37.803 34.755 30.473 40.5 22 40.5 11.783 40.5 3.5 32.217 3.5 22c0-8.137 5.3-15.247 12.942-17.65a1.5 1.5 0 10-.9-2.863z"})):t.createElement("svg",{viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M7.229 1.173a9.25 9.25 0 1011.655 11.412 1.25 1.25 0 10-2.4-.698 6.75 6.75 0 11-8.506-8.329 1.25 1.25 0 10-.75-2.385z"})),c={...!r&&{role:"status"}},l=(a||!r)&&t.createElement(x,{as:"span",visuallyHidden:!0},n);return t.createElement(t.Fragment,null,t.createElement("span",{className:o},s),t.createElement("span",c,l))}function Ta(e,n){const r=u.useCallback(a=>{e&&(a.preventDefault(),a.stopPropagation())},[e]);return e?r:n}function Ia(){return u.useContext(ra)}const or=u.memo(u.forwardRef(function(n,r){const a=Ia();if(a)return t.createElement(a,Object.assign({},gn.props,n,{ref:r}));const{external:o,url:s,target:c,...l}=n;let d;o?d="_blank":d=c??void 0;const p=d==="_blank"?"noopener noreferrer":void 0;return t.createElement("a",Object.assign({target:d},l,{href:s,rel:p},gn.props,{ref:r}))}));function Aa({id:e,children:n,className:r,url:a,external:o,target:s,download:c,submit:l,disabled:d,loading:p,pressed:m,accessibilityLabel:b,role:h,ariaControls:f,ariaExpanded:v,ariaDescribedBy:S,ariaChecked:w,onClick:I,onFocus:y,onBlur:N,onKeyDown:T,onKeyPress:B,onKeyUp:k,onMouseEnter:E,onTouchStart:P,...A}){let _;const Z={id:e,className:r,"aria-label":b},R={...Z,role:h,onClick:I,onFocus:y,onBlur:N,onMouseUp:Nt,onMouseEnter:E,onTouchStart:P},D=Ta(d,I);return a?_=d?t.createElement("a",Z,n):t.createElement(or,Object.assign({},R,{url:a,external:o,target:s,download:c},A),n):_=t.createElement("button",Object.assign({},R,{"aria-disabled":d,type:l?"submit":"button","aria-busy":p?!0:void 0,"aria-controls":f,"aria-expanded":v,"aria-describedby":S,"aria-checked":w,"aria-pressed":m,onKeyDown:T,onKeyUp:k,onKeyPress:B,onClick:D,tabIndex:d?-1:void 0},A),n),_}
1class Ba extends Error{constructor(n=""){super(`${n&&`${n} `}Your application must be wrapped in an <AppProvider> component. See https://polaris.shopify.com/components/app-provider for implementation instructions.`),this.name="MissingAppProviderError"}}function we(){const e=u.useContext(aa);if(!e)throw new Ba("No i18n was provided.");return e}function oe({id:e,children:n,url:r,disabled:a,external:o,download:s,target:c,submit:l,loading:d,pressed:p,accessibilityLabel:m,role:b,ariaControls:h,ariaExpanded:f,ariaDescribedBy:v,ariaChecked:S,onClick:w,onFocus:I,onBlur:y,onKeyDown:N,onKeyPress:T,onKeyUp:B,onMouseEnter:k,onTouchStart:E,onPointerDown:P,icon:A,disclosure:_,removeUnderline:Z,size:R="medium",textAlign:D="center",fullWidth:j,dataPrimaryLink:O,tone:U,variant:$="secondary"}){const X=we(),te=a||d,{mdUp:se}=Mt(),Y=M(ne.Button,ne.pressable,ne[ie("variant",$)],ne[ie("size",R)],ne[ie("textAlign",D)],j&&ne.fullWidth,_&&ne.disclosure,A&&n&&ne.iconWithText,A&&n==null&&ne.iconOnly,te&&ne.disabled,d&&ne.loading,p&&!a&&!r&&ne.pressed,Z&&ne.removeUnderline,U&&ne[ie("tone",U)]),K=_?t.createElement("span",{className:d?ne.hidden:ne.Icon},t.createElement(Ee,{source:d?"placeholder":Na(_,Jt,Qt)})):null,ue=Ma(A)?t.createElement(Ee,{source:d?"placeholder":A}):A,G=ue?t.createElement("span",{className:d?ne.hidden:ne.Icon},ue):null,V=["plain","monochromePlain"].includes($);let ge="medium";V?ge="regular":$==="primary"&&(ge=se?"medium":"semibold");let re="bodySm";(R==="large"||V&&R!=="micro")&&(re="bodyMd");const ye=n?t.createElement(x,{as:"span",variant:re,fontWeight:ge,key:a?"text-disabled":"text"},n):null,pe=d?t.createElement("span",{className:ne.Spinner},t.createElement(ar,{size:"small",accessibilityLabel:X.translate("Polaris.Button.spinnerAccessibilityLabel")})):null,le={id:e,className:Y,accessibilityLabel:m,ariaDescribedBy:v,role:b,onClick:w,onFocus:I,onBlur:y,onMouseUp:Nt,onMouseEnter:k,onTouchStart:E,"data-primary-link":O},ce={url:r,external:o,download:s,target:c},ee={submit:l,disabled:te,loading:d,ariaControls:h,ariaExpanded:f,ariaChecked:S,pressed:p,onKeyDown:N,onKeyUp:B,onKeyPress:T,onPointerDown:P};return t.createElement(Aa,Object.assign({},le,ce,ee),pe,G,ye,K)}function Ma(e){return typeof e=="string"||typeof e=="object"&&e.body||typeof e=="function"}function Na(e,n,r){return e==="select"?Kn:e==="up"?n:r}function ir({content:e,onAction:n,plain:r,destructive:a,...o},s,c){const l=r?"plain":void 0,d=a?"primary":void 0,p=!(s!=null&&s.tone)&&a?"critical":s==null?void 0:s.tone;return t.createElement(oe,Object.assign({key:c,onClick:n,tone:p,variant:l||d},o,s),e)}var ja={ShadowBevel:"Polaris-ShadowBevel"};function _a(e){const{as:n="div",bevel:r=!0,borderRadius:a,boxShadow:o,children:s,zIndex:c="0"}=e,l=n;return t.createElement(l,{className:ja.ShadowBevel,style:{"--pc-shadow-bevel-z-index":c,...Tt("shadow-bevel","content",Ft(r,d=>d?'""':"none")),...Tt("shadow-bevel","box-shadow",Ft(r,d=>d?`var(--p-shadow-${o})`:"none")),...Tt("shadow-bevel","border-radius",Ft(r,d=>d?`var(--p-border-radius-${a})`:"var(--p-border-radius-0)"))}},s)}function Ft(e,n){return typeof e=="boolean"?n(e):Object.fromEntries(Object.entries(e).map(([r,a])=>[r,n(a)]))}var Et={listReset:"Polaris-Box--listReset",Box:"Polaris-Box",visuallyHidden:"Polaris-Box--visuallyHidden",printHidden:"Polaris-Box--printHidden"};const H=u.forwardRef(({as:e="div",background:n,borderColor:r,borderStyle:a,borderWidth:o,borderBlockStartWidth:s,borderBlockEndWidth:c,borderInlineStartWidth:l,borderInlineEndWidth:d,borderRadius:p,borderEndStartRadius:m,borderEndEndRadius:b,borderStartStartRadius:h,borderStartEndRadius:f,children:v,color:S,id:w,minHeight:I,minWidth:y,maxWidth:N,overflowX:T,overflowY:B,outlineColor:k,outlineStyle:E,outlineWidth:P,padding:A,paddingBlock:_,paddingBlockStart:Z,paddingBlockEnd:R,paddingInline:D,paddingInlineStart:j,paddingInlineEnd:O,role:U,shadow:$,tabIndex:X,width:te,printHidden:se,visuallyHidden:Y,position:K,insetBlockStart:ue,insetBlockEnd:G,insetInlineStart:V,insetInlineEnd:ge,zIndex:re,opacity:ye,...pe},le)=>{const ce=a||(r||o||s||c||l||d?"solid":void 0),ee=E||(k||P?"solid":void 0),Le={"--pc-box-color":S?`var(--p-color-${S})`:void 0,"--pc-box-background":n?`var(--p-color-${n})`:void 0,"--pc-box-border-color":r?r==="transparent"?"transparent":`var(--p-color-${r})`:void 0,"--pc-box-border-style":ce,"--pc-box-border-radius":p?`var(--p-border-radius-${p})`:void 0,"--pc-box-border-end-start-radius":m?`var(--p-border-radius-${m})`:void 0,"--pc-box-border-end-end-radius":b?`var(--p-border-radius-${b})`:void 0,"--pc-box-border-start-start-radius":h?`var(--p-border-radius-${h})`:void 0,"--pc-box-border-start-end-radius":f?`var(--p-border-radius-${f})`:void 0,"--pc-box-border-width":o?`var(--p-border-width-${o})`:void 0,"--pc-box-border-block-start-width":s?`var(--p-border-width-${s})`:void 0,"--pc-box-border-block-end-width":c?`var(--p-border-width-${c})`:void 0,"--pc-box-border-inline-start-width":l?`var(--p-border-width-${l})`:void 0,"--pc-box-border-inline-end-width":d?`var(--p-border-width-${d})`:void 0,"--pc-box-min-height":I,"--pc-box-min-width":y,"--pc-box-max-width":N,"--pc-box-outline-color":k?`var(--p-color-${k})`:void 0,"--pc-box-outline-style":ee,"--pc-box-outline-width":P?`var(--p-border-width-${P})`:void 0,"--pc-box-overflow-x":T,"--pc-box-overflow-y":B,...Me("box","padding-block-start","space",Z||_||A),...Me("box","padding-block-end","space",R||_||A),...Me("box","padding-inline-start","space",j||D||A),...Me("box","padding-inline-end","space",O||D||A),"--pc-box-sha
1dow":$?`var(--p-shadow-${$})`:void 0,"--pc-box-width":te,position:K,"--pc-box-inset-block-start":ue?`var(--p-space-${ue})`:void 0,"--pc-box-inset-block-end":G?`var(--p-space-${G})`:void 0,"--pc-box-inset-inline-start":V?`var(--p-space-${V})`:void 0,"--pc-box-inset-inline-end":ge?`var(--p-space-${ge})`:void 0,zIndex:re,opacity:ye},We=M(Et.Box,Y&&Et.visuallyHidden,se&&Et.printHidden,e==="ul"&&Et.listReset);return t.createElement(e,{className:We,id:w,ref:le,style:Vt(Le),role:U,tabIndex:X,...pe},v)});H.displayName="Box";const He=({children:e,background:n="bg-surface",padding:r={xs:"400"},roundedAbove:a="sm"})=>{const o=Mt(),s="300",c=!!o[`${a}Up`];return t.createElement(Xt.Provider,{value:!0},t.createElement(_a,{boxShadow:"100",borderRadius:c?s:"0",zIndex:"32"},t.createElement(H,{background:n,padding:r,overflowX:"clip",overflowY:"clip",minHeight:"100%"},e)))};var La={InlineStack:"Polaris-InlineStack"};const Se=function({as:n="div",align:r,direction:a="row",blockAlign:o,gap:s,wrap:c=!0,children:l}){const d={"--pc-inline-stack-align":r,"--pc-inline-stack-block-align":o,"--pc-inline-stack-wrap":c?"wrap":"nowrap",...Me("inline-stack","gap","space",s),...Tt("inline-stack","flex-direction",a)};return t.createElement(n,{className:La.InlineStack,style:d},l)};var Ot={BlockStack:"Polaris-BlockStack",listReset:"Polaris-BlockStack--listReset",fieldsetReset:"Polaris-BlockStack--fieldsetReset"};const xe=({as:e="div",children:n,align:r,inlineAlign:a,gap:o,id:s,reverseOrder:c=!1,...l})=>{const d=M(Ot.BlockStack,(e==="ul"||e==="ol")&&Ot.listReset,e==="fieldset"&&Ot.fieldsetReset),p={"--pc-block-stack-align":r?`${r}`:null,"--pc-block-stack-inline-align":a?`${a}`:null,"--pc-block-stack-order":c?"column-reverse":"column",...Me("block-stack","gap","space",o)};return t.createElement(e,{className:d,id:s,style:Vt(p),...l},n)},sr=u.createContext(!1);function Ra({children:e,filterActions:n}){return t.createElement(sr.Provider,{value:n},e)}var be={Item:"Polaris-ActionList__Item",default:"Polaris-ActionList--default",active:"Polaris-ActionList--active",destructive:"Polaris-ActionList--destructive",disabled:"Polaris-ActionList--disabled",Prefix:"Polaris-ActionList__Prefix",Suffix:"Polaris-ActionList__Suffix",indented:"Polaris-ActionList--indented",menu:"Polaris-ActionList--menu",Text:"Polaris-ActionList__Text"};const Fa=u.createContext(!1);var Ye={Badge:"Polaris-Badge",toneSuccess:"Polaris-Badge--toneSuccess","toneSuccess-strong":"Polaris-Badge__toneSuccess--strong",toneInfo:"Polaris-Badge--toneInfo","toneInfo-strong":"Polaris-Badge__toneInfo--strong",toneAttention:"Polaris-Badge--toneAttention","toneAttention-strong":"Polaris-Badge__toneAttention--strong",toneWarning:"Polaris-Badge--toneWarning","toneWarning-strong":"Polaris-Badge__toneWarning--strong",toneCritical:"Polaris-Badge--toneCritical","toneCritical-strong":"Polaris-Badge__toneCritical--strong",toneNew:"Polaris-Badge--toneNew",toneMagic:"Polaris-Badge--toneMagic","toneRead-only":"Polaris-Badge__toneRead--only",toneEnabled:"Polaris-Badge--toneEnabled",sizeLarge:"Polaris-Badge--sizeLarge",withinFilter:"Polaris-Badge--withinFilter",Icon:"Polaris-Badge__Icon",PipContainer:"Polaris-Badge__PipContainer"};let fe;(function(e){e.Info="info",e.Success="success",e.Warning="warning",e.Critical="critical",e.Attention="attention",e.New="new",e.Magic="magic",e.InfoStrong="info-strong",e.SuccessStrong="success-strong",e.WarningStrong="warning-strong",e.CriticalStrong="critical-strong",e.AttentionStrong="attention-strong",e.ReadOnly="read-only",e.Enabled="enabled"})(fe||(fe={}));let ct;(function(e){e.Incomplete="incomplete",e.PartiallyComplete="partiallyComplete",e.Complete="complete"})(ct||(ct={}));function lr(e,n,r){let a="",o="";if(!n&&!r)return"";switch(n){case ct.Incomplete:a=e.translate("Polaris.Badge.PROGRESS_LABELS.incomplete");break;case ct.PartiallyComplete:a=e.translate("Polaris.Badge.PROGRESS_LABELS.partiallyComplete");break;case ct.Complete:a=e.translate("Polaris.Badge.PROGRESS_LABELS.complete");break}switch(r){case fe.Info:case fe.InfoStrong:o=e.translate("Polaris.Badge.TONE_LABELS.info");break;case fe.Success:case fe.SuccessStrong:o=e.translate("Polaris.Badge.TONE_LABELS.success");break;case fe.Warning:case fe.WarningStrong:o=e.translate("Polaris.Badge.TONE_LABELS.warning");break;
1case fe.Critical:case fe.CriticalStrong:o=e.translate("Polaris.Badge.TONE_LABELS.critical");break;case fe.Attention:case fe.AttentionStrong:o=e.translate("Polaris.Badge.TONE_LABELS.attention");break;case fe.New:o=e.translate("Polaris.Badge.TONE_LABELS.new");break;case fe.ReadOnly:o=e.translate("Polaris.Badge.TONE_LABELS.readOnly");break;case fe.Enabled:o=e.translate("Polaris.Badge.TONE_LABELS.enabled");break}return!r&&n?a:r&&!n?o:e.translate("Polaris.Badge.progressAndTone",{progressLabel:a,toneLabel:o})}var Wt={Pip:"Polaris-Badge-Pip",toneInfo:"Polaris-Badge-Pip--toneInfo",toneSuccess:"Polaris-Badge-Pip--toneSuccess",toneNew:"Polaris-Badge-Pip--toneNew",toneAttention:"Polaris-Badge-Pip--toneAttention",toneWarning:"Polaris-Badge-Pip--toneWarning",toneCritical:"Polaris-Badge-Pip--toneCritical",progressIncomplete:"Polaris-Badge-Pip--progressIncomplete",progressPartiallyComplete:"Polaris-Badge-Pip--progressPartiallyComplete",progressComplete:"Polaris-Badge-Pip--progressComplete"};function Oa({tone:e,progress:n="complete",accessibilityLabelOverride:r}){const a=we(),o=M(Wt.Pip,e&&Wt[ie("tone",e)],n&&Wt[ie("progress",n)]),s=r||lr(a,n,e);return t.createElement("span",{className:o},t.createElement(x,{as:"span",visuallyHidden:!0},s))}const En="medium",Wa={complete:()=>t.createElement("svg",{viewBox:"0 0 20 20"},t.createElement("path",{d:"M6 10c0-.93 0-1.395.102-1.776a3 3 0 0 1 2.121-2.122C8.605 6 9.07 6 10 6c.93 0 1.395 0 1.776.102a3 3 0 0 1 2.122 2.122C14 8.605 14 9.07 14 10s0 1.395-.102 1.777a3 3 0 0 1-2.122 2.12C11.395 14 10.93 14 10 14s-1.395 0-1.777-.102a3 3 0 0 1-2.12-2.121C6 11.395 6 10.93 6 10Z"})),partiallyComplete:()=>t.createElement("svg",{viewBox:"0 0 20 20"},t.createElement("path",{fillRule:"evenodd",d:"m8.888 6.014-.017-.018-.02.02c-.253.013-.45.038-.628.086a3 3 0 0 0-2.12 2.122C6 8.605 6 9.07 6 10s0 1.395.102 1.777a3 3 0 0 0 2.121 2.12C8.605 14 9.07 14 10 14c.93 0 1.395 0 1.776-.102a3 3 0 0 0 2.122-2.121C14 11.395 14 10.93 14 10c0-.93 0-1.395-.102-1.776a3 3 0 0 0-2.122-2.122C11.395 6 10.93 6 10 6c-.475 0-.829 0-1.112.014ZM8.446 7.34a1.75 1.75 0 0 0-1.041.94l4.314 4.315c.443-.2.786-.576.941-1.042L8.446 7.34Zm4.304 2.536L10.124 7.25c.908.001 1.154.013 1.329.06a1.75 1.75 0 0 1 1.237 1.237c.047.175.059.42.06 1.329ZM8.547 12.69c.182.05.442.06 1.453.06h.106L7.25 9.894V10c0 1.01.01 1.27.06 1.453a1.75 1.75 0 0 0 1.237 1.237Z"})),incomplete:()=>t.createElement("svg",{viewBox:"0 0 20 20"},t.createElement("path",{fillRule:"evenodd",d:"M8.547 12.69c.183.05.443.06 1.453.06s1.27-.01 1.453-.06a1.75 1.75 0 0 0 1.237-1.237c.05-.182.06-.443.06-1.453s-.01-1.27-.06-1.453a1.75 1.75 0 0 0-1.237-1.237c-.182-.05-.443-.06-1.453-.06s-1.27.01-1.453.06A1.75 1.75 0 0 0 7.31 8.547c-.05.183-.06.443-.06 1.453s.01 1.27.06 1.453a1.75 1.75 0 0 0 1.237 1.237ZM6.102 8.224C6 8.605 6 9.07 6 10s0 1.395.102 1.777a3 3 0 0 0 2.122 2.12C8.605 14 9.07 14 10 14s1.395 0 1.777-.102a3 3 0 0 0 2.12-2.121C14 11.395 14 10.93 14 10c0-.93 0-1.395-.102-1.776a3 3 0 0 0-2.121-2.122C11.395 6 10.93 6 10 6c-.93 0-1.395 0-1.776.102a3 3 0 0 0-2.122 2.122Z"}))};function cr({children:e,tone:n,progress:r,icon:a,size:o=En,toneAndProgressLabelOverride:s}){const c=we(),l=u.useContext(Fa),d=M(Ye.Badge,n&&Ye[ie("tone",n)],o&&o!==En&&Ye[ie("size",o)],l&&Ye.withinFilter),p=s||lr(c,r,n);let m=!!p&&t.createElement(x,{as:"span",visuallyHidden:!0},p);return r&&!a&&(m=t.createElement("span",{className:Ye.Icon},t.createElement(Ee,{accessibilityLabel:p,source:Wa[r]}))),t.createElement("span",{className:d},m,a&&t.createElement("span",{className:Ye.Icon},t.createElement(Ee,{source:a})),e&&t.createElement(x,{as:"span",variant:"bodySm",fontWeight:n==="new"?"medium":void 0},e))}cr.Pip=Oa;function mt(e){const[n,r]=u.useState(e);return{value:n,toggle:u.useCallback(()=>r(a=>!a),[]),setTrue:u.useCallback(()=>r(!0),[]),setFalse:u.useCallback(()=>r(!1),[])}}var yn={TooltipContainer:"Polaris-Tooltip__TooltipContainer",HasUnderline:"Polaris-Tooltip__HasUnderline"};function $a(){const e=u.useContext(oa);if(!e)throw new Error("No ephemeral presence manager was provided. Your application must be wrapped in an <AppProvider>
1 component. See https://polaris.shopify.com/components/app-provider for implementation instructions.");return e}function Ha(){const e=u.useContext(Wn);if(!e)throw new Error("No portals manager was provided. Your application must be wrapped in an <AppProvider> component. See https://polaris.shopify.com/components/app-provider for implementation instructions.");return e}function dr({children:e,idPrefix:n="",onPortalCreated:r=Da}){const a=ia(),{container:o}=Ha(),s=u.useId(),c=n!==""?`${n}-${s}`:s;return u.useEffect(()=>{r()},[r]),o?Yr.createPortal(t.createElement(xa,{theme:va(a)?a:On,"data-portal-id":c},e),o):null}function Da(){}var Fe={TooltipOverlay:"Polaris-Tooltip-TooltipOverlay",Tail:"Polaris-Tooltip-TooltipOverlay__Tail",positionedAbove:"Polaris-Tooltip-TooltipOverlay--positionedAbove",measuring:"Polaris-Tooltip-TooltipOverlay--measuring",measured:"Polaris-Tooltip-TooltipOverlay--measured",instant:"Polaris-Tooltip-TooltipOverlay--instant",Content:"Polaris-Tooltip-TooltipOverlay__Content",default:"Polaris-Tooltip-TooltipOverlay--default",wide:"Polaris-Tooltip-TooltipOverlay--wide"};function Ua(e,n,r,a,o,s,c,l=0){const d=e.top,p=d+e.height,m=e.top-l,b=o.height-e.top-e.height,h=n.height,f=r.activator+r.container,v=r.container,S=e.top-Math.max(a.top,0),w=o.top+Math.min(o.height,a.top+a.height)-(e.top+e.height),I=S>=v,y=w>=v,N=Math.min(m,h),T=Math.min(b,h),B=Math.min(m+e.height,h),k=Math.min(b+e.height,h),E=c?0:o.top,P={height:N-f,top:d+E-N,positioning:"above"},A={height:T-f,top:p+E,positioning:"below"},_={height:k-f,top:d+E,positioning:"cover"},Z={height:B-f,top:d+E-N+e.height+f,positioning:"cover"};return s==="above"?(I||S>=w&&!y)&&(m>h||m>b)?P:A:s==="below"?(y||w>=S&&!I)&&(b>h||b>m)?A:P:s==="cover"?(y||w>=S&&!I)&&(b+e.height>h||b>m)?_:Z:I&&y?m>b?P:A:S>v?P:A}function za(e,n,r,a,o){const s=r.width-n.width;if(o==="left")return Math.min(s,Math.max(0,e.left-a.horizontal));if(o==="right"){const c=r.width-(e.left+e.width);return Math.min(s,Math.max(0,c-a.horizontal))}return Math.min(s,Math.max(0,e.center.x-n.width/2))}function Ga(e,n){const{center:r}=e;return r.y<n.top||r.y>n.top+n.height}function Za(e,n=ur()){const r=Math.max(e.top,0),a=Math.max(e.left,0),o=Math.min(e.top+e.height,n.height),s=Math.min(e.left+e.width,n.width);return new qt({top:r,left:a,height:o-r,width:s-a})}function ur(){return new qt({top:window.scrollY,left:window.scrollX,height:window.innerHeight,width:document.body.clientWidth})}var $t={PositionedOverlay:"Polaris-PositionedOverlay",fixed:"Polaris-PositionedOverlay--fixed",preventInteraction:"Polaris-PositionedOverlay--preventInteraction"};const Pn=Symbol("unique_identifier");function qa(e){const n=u.useRef(Pn);return n.current===Pn&&(n.current=e()),n}function Va(e){const n=Zt(),r=u.useRef(!1);if(n&&!r.current)return r.current=!0,e()}const pr=u.createContext(void 0);var De={Scrollable:"Polaris-Scrollable",hasTopShadow:"Polaris-Scrollable--hasTopShadow",hasBottomShadow:"Polaris-Scrollable--hasBottomShadow",horizontal:"Polaris-Scrollable--horizontal",vertical:"Polaris-Scrollable--vertical",scrollbarWidthThin:"Polaris-Scrollable--scrollbarWidthThin",scrollbarWidthNone:"Polaris-Scrollable--scrollbarWidthNone",scrollbarWidthAuto:"Polaris-Scrollable--scrollbarWidthAuto",scrollbarGutterStable:"Polaris-Scrollable--scrollbarGutterStable","scrollbarGutterStableboth-edges":"Polaris-Scrollable__scrollbarGutterStableboth--edges"};function Xa(){const e=u.useRef(null),n=u.useContext(pr);u.useEffect(()=>{!n||!e.current||n(e.current.offsetTop)},[n]);const r=u.useId();return t.createElement("a",{id:r,ref:e})}const Sn=100,mr=2,fr=u.forwardRef(({children:e,className:n,horizontal:r=!0,vertical:a=!0,shadow:o,hint:s,focusable:c,scrollbarWidth:l="thin",scrollbarGutter:d,onScrolledToBottom:p,...m},b)=>{const[h,f]=u.useState(!1),[v,S]=u.useState(!1),w=qa(()=>new ca),I=u.useRef(null),y=u.useCallback((k,E={})=>{var _;const P=E.behavior||"smooth",A=hr()?"auto":P;(_=I.current)==null||_.scrollTo({top:k,behavior:A})},[]),N=u.useRef();u.useImperativeHandle(b||N,()=>({scrollTo:y}));const T=u.useCallback(()=>{const k=I.current;k&&requestAnimationFrame(()=>{const{scrollTop:E,clientHeight:P,scrollHeight:A}=k,_=A>P,Z=E>0,R=E+P>=A-mr;f(Z),S(!R),_&&R&&p&&p()})},[p]);Va(()=>{T(),s&&requestAnimationFrame(()=>Ya(I.current))}),u.useEffect(()=>{var P;const k=I.current;if(!k)return;const E=sa(T,50,{trailing:!0});return(P=w.current)==null||P.setContainer(k),k.addEventListener("scroll",T),globalThis.addEventListener("resize",E),()=>{k.removeEventListener("scroll",T),globalThis.removeEventListener("resize",E)}},[w,T]);const B=M(n,De.Scrollable,a&&De.vertical,r&&De.horizontal,o&&h&&De.hasTopShadow,o&&v&&De.hasBottomShadow,l&&De[ie("scrollbarWidth",l)],d&&De[ie("scrollbarGutter",d.replace(" ",""))]);return t.createElement(pr.Provider,{value:y},t.createElement(la.Provider,{value:w.current},t.createElement("div",Object.assign({className:B},$n.props,m,{ref:I,tabIndex:c?0:void 0}),e)))});fr.displayName="Scrollable";function hr(){try{return window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}function Ya(e){if(!e||hr())return;const n=e.scrollHeight-e.clientHeight,r=Math.min(Sn,n)-mr,a=()=>{requestAnimationFrame(()=>{e.scrollTop>=r&&(e.removeEventListener("scroll",a),e.scrollTo({top:0,behavior:"smooth"}))})};e.addEventListener("scroll",a),e.scrollTo({top:Sn,behavior:"smooth"})}const Qa=e=>{const n=e.closest($n.selector);return n instanceof HTMLElement?n:document},Ke=fr;Ke.ScrollTo=Xa;Ke.forNode=Qa;const wn={childList:!0,subtree:!0,characterData:!0,attributeFilter:["style"]};class gr extends u.PureComponent{constructor(n){super(n),this.state={measuring:!0,activatorRect:ot(this.props.activator),right:void 0,left:void 0,top:0,height:0,width:null,positioning:"below",zIndex:null,outsideScrollableContainer:!1,lockPosition:!1,chevronOffset:0},this.overlay=null,this.scrollableContainers=[],this.overlayDetails=()=>{const{measuring:r,left:a,right:o,positioning:s,height:c,activatorRect:l,chevronOffset:d}=this.state;return{measuring:r,left:a,right:o,desiredHeight:c,positioning:s,activatorRect:l,chevronOffset:d}},this.setOverlay=r=>{this.overlay=r},this.setScrollableContainers=()=>{const r=[];let a=Ke.forNode(this.props.activator);if(a)for(r.push(a);a!=null&&a.parentElement;)a=Ke.forNode(a.parentElement),r.push(a);this.scrollableContainers=r},this.registerScrollHandlers=()=>
1{this.scrollableContainers.forEach(r=>{r.addEventListener("scroll",this.handleMeasurement)})},this.unregisterScrollHandlers=()=>{this.scrollableContainers.forEach(r=>{r.removeEventListener("scroll",this.handleMeasurement)})},this.handleMeasurement=()=>{const{lockPosition:r,top:a}=this.state;this.observer.disconnect(),this.setState(({left:o,top:s,right:c})=>({left:o,right:c,top:s,height:0,positioning:"below",measuring:!0}),()=>{if(this.overlay==null||this.firstScrollableContainer==null)return;const{activator:o,preferredPosition:s="below",preferredAlignment:c="center",onScrollOut:l,fullWidth:d,fixed:p,preferInputActivator:m=!0}=this.props,b=m&&o.querySelector("input")||o,h=ot(b),f=ot(this.overlay),v=eo(this.firstScrollableContainer)?document.body:this.firstScrollableContainer,S=ot(v),w=d||s==="cover"?new qt({...f,width:h.width}):f;v===document.body&&(S.height=document.body.scrollHeight);let I=0;const y=v.querySelector(`${da.selector}`);y&&(I=y.clientHeight);const N=this.overlay.firstElementChild&&this.overlay.firstChild instanceof HTMLElement?Ja(this.overlay.firstElementChild):{activator:0,container:0,horizontal:0},T=ur(),B=Ka(o),k=B==null?B:B+1,E=Ua(h,w,N,S,T,s,p,I),P=za(h,w,T,N,c),A=h.center.x-P+N.horizontal*2;this.setState({measuring:!1,activatorRect:ot(o),left:c!=="right"?P:void 0,right:c==="right"?P:void 0,top:r?a:E.top,lockPosition:!!p,height:E.height||0,width:d||s==="cover"?w.width:null,positioning:E.positioning,outsideScrollableContainer:l!=null&&Ga(h,Za(S)),zIndex:k,chevronOffset:A},()=>{this.overlay&&(this.observer.observe(this.overlay,wn),this.observer.observe(o,wn))})})},this.observer=new MutationObserver(this.handleMeasurement)}componentDidMount(){this.setScrollableContainers(),this.scrollableContainers.length&&!this.props.fixed&&this.registerScrollHandlers(),this.handleMeasurement()}componentWillUnmount(){this.observer.disconnect(),this.scrollableContainers.length&&!this.props.fixed&&this.unregisterScrollHandlers()}componentDidUpdate(){const{outsideScrollableContainer:n,top:r}=this.state,{onScrollOut:a,active:o}=this.props;o&&a!=null&&r!==0&&n&&a()}render(){const{left:n,right:r,top:a,zIndex:o,width:s}=this.state,{render:c,fixed:l,preventInteraction:d,classNames:p,zIndexOverride:m}=this.props,b={top:a==null||isNaN(a)?void 0:a,left:n==null||isNaN(n)?void 0:n,right:r==null||isNaN(r)?void 0:r,width:s==null||isNaN(s)?void 0:s,zIndex:m||o||void 0},h=M($t.PositionedOverlay,l&&$t.fixed,d&&$t.preventInteraction,p);return t.createElement("div",{className:h,style:b,ref:this.setOverlay},t.createElement(Bt,{event:"resize",handler:this.handleMeasurement}),c(this.overlayDetails()))}get firstScrollableContainer(){return this.scrollableContainers[0]??null}forceUpdatePosition(){requestAnimationFrame(this.handleMeasurement)}}function Ja(e){const n=window.getComputedStyle(e);return{activator:parseFloat(n.marginTop||"0"),container:parseFloat(n.marginBottom||"0"),horizontal:parseFloat(n.marginLeft||"0")}}function Ka(e){const n=e.closest(Hn.selector)||document.body,r=n===document.body?"auto":parseInt(window.getComputedStyle(n).zIndex||"0",10);return r==="auto"||isNaN(r)?null:r}function eo(e){return e===document}const to=t.createElement(t.Fragment,null,t.createElement("path",{d:"M18.829 8.171 11.862.921A3 3 0 0 0 7.619.838L0 8.171h1.442l6.87-6.612a2 2 0 0 1 2.83.055l6.3 6.557h1.387Z",fill:"var(--p-color-tooltip-tail-up-border-experimental)"}),t.createElement("path",{d:"M17.442 10.171h-16v-2l6.87-6.612a2 2 0 0 1 2.83.055l6.3 6.557v2Z",fill:"var(--p-color-bg-surface)"})),no=t.createElement(t.Fragment,null,t.createElement("path",{d:"m0 2 6.967 7.25a3 3 0 0 0 4.243.083L18.829 2h-1.442l-6.87 6.612a2 2 0 0 1-2.83-.055L1.387 2H0Z",fill:"var(--p-color-tooltip-tail-down-border-experimental)"}),t.createElement("path",{d:"M1.387 0h16v2l-6.87 6.612a2 2 0 0 1-2.83-.055L1.387 2V0Z",fill:"var(--p-color-bg-surface)"}));function ro({active:e,activator:n,preferredPosition:r="above",preventInteraction:a,id:o,children:s,accessibilityLabel:c,width:l,padding:d,borderRadius:p,zIndexOverride:m,instant:b}){const h=we();return e?t.createElement(gr,{active:e,activator:n,preferredPosition:r,preventInteraction:a,render:v,zIndexOverride:m}):null;function v(S){const{measuring:w,desiredHeight:I,positioning:y,chevronOffset:N}=S,T=M(Fe.TooltipOverlay,w&&Fe.measuring,!w&&Fe.measured,b&&Fe.instant,y==="above"&&Fe.positionedAbove),B=M(Fe.Content,l&&Fe[l]),k=w?void 0:{minHeight:I},E={"--pc-tooltip-chevron-x-pos":`${N}px`,"--pc-tooltip-border-radius":p?`var(--p-border-radius-${p})`:void 0,"--pc-tooltip-padding":d&&d==="default"?"var(--p-space-100) var(--p-space-200)":`var(--p-space-${d})`};return t.createElement("div",Object.assign({style:E,className:T},Hn.props),t.createElement("svg",{className:Fe.Tail,width:"19",height:"11",fill:"none"},y==="above"?no:to),t.createElement("div",{id:o,role:"tooltip",className:B,style:{...k,...E},"aria-label":c?h.translate("Polaris.TooltipOverlay.accessibilityLabel",{label:c}):void 0},s))}}const ao=150;function ft({children:e,content:n,dismissOnMouseOut:r,active:a,hoverDelay:o,preferredPosition:s="above",activatorWrapper:c="span",accessibilityLabel:l,width:d="default",padding:p="default",borderRadius:m,zIndexOverride:b,hasUnderline:h,persistOnClick:f,onOpen:v,onClose:S}){const w=m||"200",I=c,{value:y,setTrue:N,setFalse:T}=mt(!!a),{value:B,toggle:k}=mt(!!a&&!!f),[E,P]=u.useState(null),{presenceList:A,addPresence:_,removePresence:Z}=$a(),R=u.useId(),D=u.useRef(null),j=u.useRef(!1),[O,U]=u.useState(!a),$=u.useRef(null),X=u.useRef(null),te=u.useCallback(()=>{a!==!1&&N()},[a,N]);u.useEffect(()=>{const le=(D.current?Sa(D.current):null)||D.current;le&&(le.tabIndex=0,le.setAttribute("aria-describedby",R),le.setAttribute("data-polaris-tooltip-activator","true"))},[R,e]),u.useEffect(()=>()=>{$.current&&clearTimeout($.current),X.current&&clearTimeout(X.current)},[]);const se=u.useCallback(()=>{U(!A.tooltip&&!y),v==null||v(),_("tooltip")},[_,A.tooltip,v,y]),Y=u.useCallback(()=>{S==null||S(),U(!1),X.current=setTimeout(()=>{Z("tooltip")},ao)},[Z,S]),K=u.useCallback(pe=>{pe.key==="Escape"&&(Y==null||Y(),T(),f&&k())},[T,Y,f,k]);u.useEffect(()=>{a===!1&&y&&(Y(),T())},[a,y,Y,T]);const ue=E?t.createElement(dr,{idPrefix:"tooltip"},t.createElement(ro,{id:R,preferredPosition:s,activator:E,active:y,accessibilityLabel:l,onClose:oo,preventInteraction:r,width:d,padding:p,borderRadius:w,zIndexOverride:b,instant:!O},t.createElement(x,{as:"span",variant:"bodyMd"},n))):null,G=M(c==="div"&&yn.TooltipContainer,h&&yn.HasUnderline);return t.createElement(I,{onFocus:()=>{se(),te()},onBlur:()=>{Y(),T(),f&&k()},onMouseLeave:re,onMouseOver:ye,onMouseDown:f?k:void 0,ref:V,onKeyUp:K,className:G},e,ue);function V(pe){const le=D;if(pe==null){le.current=null,P(null);return}pe.firstElementChild instanceof HTMLElement&&P(pe.firstElementChild),le.current=pe}function ge(){j.current=!0,o&&!A.tooltip?$.current=setTimeout(()=>{se(),te()},o):(se(),te())}function re(){$.current&&(clearTimeout($.current),$.current=null),j.current=!1,Y(),B||T()}function ye(){!j.current&&ge()}}function oo(){}function br({id:e,badge:n,content:r,accessibilityLabel:a,helpText:o,url:s,onAction:c,onMouseEnter:l,icon:d,image:p,prefix:m,suffix:b,disabled:h,external:f,destructive:v,ellipsis:S,truncate:w,active:I,role:y,variant:N="default"}
1){const T=M(be.Item,h&&be.disabled,v&&be.destructive,I&&be.active,N==="default"&&be.default,N==="indented"&&be.indented,N==="menu"&&be.menu);let B=null;m?B=t.createElement("span",{className:be.Prefix},m):d?B=t.createElement("span",{className:be.Prefix},t.createElement(Ee,{source:d})):p&&(B=t.createElement("span",{role:"presentation",className:be.Prefix,style:{backgroundImage:`url(${p}`}}));let k=r||"";w&&r?k=t.createElement(io,null,r):S&&(k=`${r}â¦`);const E=o?t.createElement(t.Fragment,null,t.createElement(H,null,k),t.createElement(x,{as:"span",variant:"bodySm",tone:I||h?void 0:"subdued"},o)):t.createElement(x,{as:"span",variant:"bodyMd",fontWeight:I?"semibold":"regular"},k),P=n&&t.createElement("span",{className:be.Suffix},t.createElement(cr,{tone:n.tone},n.content)),A=b&&t.createElement(H,null,t.createElement("span",{className:be.Suffix},b)),_=t.createElement("span",{className:be.Text},t.createElement(x,{as:"span",variant:"bodyMd",fontWeight:I?"semibold":"regular"},E)),Z=t.createElement(Se,{blockAlign:"center",gap:"150",wrap:!1},B,_,P,A),R=t.createElement(H,{width:"100%"},Z),D=I?t.createElement(Ke.ScrollTo,null):null,j=s?t.createElement(or,{id:e,url:h?null:s,className:T,external:f,"aria-label":a,onClick:h?null:c,role:y},R):t.createElement("button",{id:e,type:"button",className:T,disabled:h,"aria-label":a,onClick:c,onMouseUp:Nt,role:y,onMouseEnter:l},R);return t.createElement(t.Fragment,null,D,j)}const io=({children:e})=>{const n=ua(),r=u.useRef(null),[a,o]=u.useState(!1);return pt(()=>{r.current&&o(r.current.scrollWidth>r.current.offsetWidth)},[e]),a?t.createElement(ft,{zIndexOverride:Number(n.zIndex["z-index-11"]),preferredPosition:"above",hoverDelay:1e3,content:e,dismissOnMouseOut:!0},t.createElement(x,{as:"span",truncate:!0},e)):t.createElement(x,{as:"span",truncate:!0},t.createElement(H,{width:"100%",ref:r},e))};function so({section:e,hasMultipleSections:n,isFirst:r,actionRole:a,onActionAnyItem:o}){const s=m=>()=>{m&&m(),o&&o()},c=e.items.map(({content:m,helpText:b,onAction:h,...f},v)=>{const S=t.createElement(br,Object.assign({content:m,helpText:b,role:a,onAction:s(h)},f));return t.createElement(H,{as:"li",key:`${m}-${v}`,role:a==="menuitem"?"presentation":void 0},t.createElement(Se,{wrap:!1},S))});let l=null;e.title&&(l=typeof e.title=="string"?t.createElement(H,{paddingBlockStart:"300",paddingBlockEnd:"100",paddingInlineStart:"300",paddingInlineEnd:"300"},t.createElement(x,{as:"p",variant:"headingSm"},e.title)):t.createElement(H,{padding:"200",paddingInlineEnd:"150"},e.title));let d;switch(a){case"option":d="presentation";break;case"menuitem":d=n?"presentation":"menu";break;default:d=void 0;break}const p=t.createElement(t.Fragment,null,l,t.createElement(H,Object.assign({as:"div",padding:"150"},n&&{paddingBlockStart:"0"},{tabIndex:n?void 0:-1}),t.createElement(xe,Object.assign({gap:"050",as:"ul"},d&&{role:d}),c)));return n?t.createElement(H,Object.assign({as:"li",role:"presentation",borderColor:"border-secondary"},!r&&{borderBlockStartWidth:"025"},!e.title&&{paddingBlockStart:"150"}),p):p}function ht({keyCode:e,handler:n,keyEvent:r="keyup",options:a,useCapture:o}){const s=u.useRef({handler:n,keyCode:e});pt(()=>{s.current={handler:n,keyCode:e}},[n,e]);const c=u.useCallback(l=>{const{handler:d,keyCode:p}=s.current;l.keyCode===p&&d(l)},[]);return u.useEffect(()=>(document.addEventListener(r,c,o||a),()=>{document.removeEventListener(r,c,o||a)}),[r,c,o,a]),null}var L={TextField:"Polaris-TextField",ClearButton:"Polaris-TextField__ClearButton",Loading:"Polaris-TextField__Loading",disabled:"Polaris-TextField--disabled",error:"Polaris-TextField--error",readOnly:"Polaris-TextField--readOnly",Input:"Polaris-TextField__Input",Backdrop:"Polaris-TextField__Backdrop",multiline:"Polaris-TextField--multiline",hasValue:"Polaris-TextField--hasValue",focus:"Polaris-TextField--focus",VerticalContent:"Polaris-TextField__VerticalContent",InputAndSuffixWrapper:"Polaris-TextField__InputAndSuffixWrapper",toneMagic:"Polaris-TextField--toneMagic",Prefix:"Polaris-TextField__Prefix",Suffix:"Polaris-TextField__Suffix",AutoSizeWrapper:"Polaris-TextField__AutoSizeWrapper",AutoSizeWrapperWithSuffix:"Polaris-TextField__AutoSizeWrapperWithSuffix",suggestion:"Polaris-TextField--suggestion",borderless:"Polaris-TextField--borderless",slim:"Polaris-TextField--slim","Input-hasClearButton":"Polaris-TextField__Input--hasClearButton","Input-suffixed":"Polaris-TextField__Input--suffixed","Input-alignRight":"Polaris-TextField__Input--alignRight","Input-alignLeft":"Polaris-TextField__Input--alignLeft","Input-alignCenter":"Polaris-TextField__Input--alignCenter","Input-autoSize":"Polaris-TextField__Input--autoSize",PrefixIcon:"Polaris-TextField__PrefixIcon",CharacterCount:"Polaris-TextField__CharacterCount",AlignFieldBottom:"Polaris-TextField__AlignFieldBottom",Spinner:"Polaris-TextField__Spinner",SpinnerIcon:"Polaris-TextField__SpinnerIcon",Resizer:"Polaris-TextField__Resizer",DummyInput:"Polaris-TextField__DummyInput",Segment:"Polaris-TextField__Segment",monospaced:"Polaris-TextField--monospaced"};const lo=t.forwardRef(function({onChange:n,onClick:r,onMouseDown:a,onMouseUp:o,onBlur:s},c){function l(p){return()=>n(p)}function d(p){return m=>
1{m.button===0&&(a==null||a(p))}}return t.createElement("div",{className:L.Spinner,onClick:r,"aria-hidden":!0,ref:c},t.createElement("div",{role:"button",className:L.Segment,tabIndex:-1,onClick:l(1),onMouseDown:d(l(1)),onMouseUp:o,onBlur:s},t.createElement("div",{className:L.SpinnerIcon},t.createElement(Ee,{source:Jt}))),t.createElement("div",{role:"button",className:L.Segment,tabIndex:-1,onClick:l(-1),onMouseDown:d(l(-1)),onMouseUp:o,onBlur:s},t.createElement("div",{className:L.SpinnerIcon},t.createElement(Ee,{source:Qt}))))});var Ue={hidden:"Polaris-Labelled--hidden",LabelWrapper:"Polaris-Labelled__LabelWrapper",disabled:"Polaris-Labelled--disabled",HelpText:"Polaris-Labelled__HelpText",readOnly:"Polaris-Labelled--readOnly",Error:"Polaris-Labelled__Error",Action:"Polaris-Labelled__Action"},Cn={InlineError:"Polaris-InlineError",Icon:"Polaris-InlineError__Icon"};function co({message:e,fieldID:n}){return e?t.createElement("div",{id:uo(n),className:Cn.InlineError},t.createElement("div",{className:Cn.Icon},t.createElement(Ee,{source:Un})),t.createElement(x,{as:"span",variant:"bodyMd"},e)):null}function uo(e){return`${e}Error`}var yt={Label:"Polaris-Label",hidden:"Polaris-Label--hidden",Text:"Polaris-Label__Text",RequiredIndicator:"Polaris-Label__RequiredIndicator"};function vr(e){return`${e}Label`}function po({children:e,id:n,hidden:r,requiredIndicator:a}){const o=M(yt.Label,r&&yt.hidden);return t.createElement("div",{className:o},t.createElement("label",{id:vr(n),htmlFor:n,className:M(yt.Text,a&&yt.RequiredIndicator)},t.createElement(x,{as:"span",variant:"bodyMd"},e)))}function mo({id:e,label:n,error:r,action:a,helpText:o,children:s,labelHidden:c,requiredIndicator:l,disabled:d,readOnly:p,...m}){const b=M(c&&Ue.hidden,d&&Ue.disabled,p&&Ue.readOnly),h=a?t.createElement("div",{className:Ue.Action},ir(a,{variant:"plain"})):null,f=o?t.createElement("div",{className:Ue.HelpText,id:xr(e),"aria-disabled":d},t.createElement(x,{as:"span",tone:"subdued",variant:"bodyMd",breakWord:!0},o)):null,v=r&&typeof r!="boolean"&&t.createElement("div",{className:Ue.Error},t.createElement(co,{message:r,fieldID:e})),S=n?t.createElement("div",{className:Ue.LabelWrapper},t.createElement(po,Object.assign({id:e,requiredIndicator:l},m,{hidden:!1}),n),h):null;return t.createElement("div",{className:b},S,s,v,f)}function xr(e){return`${e}HelpText`}var lt={Connected:"Polaris-Connected",Item:"Polaris-Connected__Item","Item-primary":"Polaris-Connected__Item--primary","Item-focused":"Polaris-Connected__Item--focused"};function Ht({children:e,position:n}){const{value:r,setTrue:a,setFalse:o}=mt(!1),s=M(lt.Item,r&<["Item-focused"],n==="primary"?lt["Item-primary"]:lt["Item-connection"]);return t.createElement("div",{onBlur:o,onFocus:a,className:s},e)}function fo({children:e,left:n,right:r}){const a=n?t.createElement(Ht,{position:"left"},n):null,o=r?t.createElement(Ht,{position:"right"},r):null;return t.createElement("div",{className:lt.Connected},a,t.createElement(Ht,{position:"primary"},e),o)}function ho({contents:e,currentHeight:n=null,minimumLines:r,onHeightChange:a}){const o=u.useRef(null),s=u.useRef(null),c=u.useRef(),l=u.useRef(n);n!==l.current&&(l.current=n),u.useEffect(()=>()=>{c.current&&cancelAnimationFrame(c.current)},[]);const d=r?t.createElement("div",{ref:s,className:L.DummyInput,dangerouslySetInnerHTML:{__html:vo(r)}}):null,p=u.useCallback(()=>{c.current&&cancelAnimationFrame(c.current),c.current=requestAnimationFrame(()=>{if(!o.current||!s.current)return;const m=Math.max(o.current.offsetHeight,s.current.offsetHeight);m!==l.current&&a(m)})},[a]);return pt(()=>{p()}),t.createElement("div",{"aria-hidden":!0,className:L.Resizer},t.createElement(Bt,{event:"resize",handler:p}),t.createElement("div",{ref:o,className:L.DummyInput,dangerouslySetInnerHTML:{__html:xo(e)}}),d)}const Er={"&":"&","<":"<",">":">","\n":"<br>","\r":""},go=new RegExp(`[${Object.keys(Er).join()}]`,"g");function bo(e){return Er[e]}function vo(e){let n="";for(let r=0;r<e;r++)n+="<br>";return n}function xo(e){return e?`${e.replace(go,bo)}<br>`:"<br>"}function Eo({prefix:e,suffix:n,verticalContent:r,placeholder:a,value:o="",helpText:s,label:c,labelAction:l,labelHidden:d,disabled:p,clearButton:m,readOnly:b,autoFocus:h,focused:f,multiline:v,error:S,connectedRight:w,connectedLeft:I,type:y="text",name:N,id:T,role:B,step:k,largeStep:E,autoComplete:P,max:A,maxLength:_,maxHeight:Z,min:R,minLength:D,pattern:j,inputMode:O,spellCheck:U,ariaOwns:$,ariaControl
1s:X,ariaExpanded:te,ariaActiveDescendant:se,ariaAutocomplete:Y,showCharacterCount:K,align:ue,requiredIndicator:G,monospaced:V,selectTextOnFocus:ge,suggestion:re,variant:ye="inherit",size:pe="medium",onClearButtonClick:le,onChange:ce,onSpinnerChange:ee,onFocus:Le,onBlur:We,tone:gt,autoSize:Ze,loading:bt}){const qe=we(),[g,q]=u.useState(null),[W,Q]=u.useState(!!f),Ce=Zt(),ke=u.useId(),z=T??ke,Ie=u.useRef(null),he=u.useRef(null),Ne=u.useRef(null),je=u.useRef(null),$e=u.useRef(null),Re=u.useRef(null),Ve=u.useRef(null),jt=u.useRef(),_t=u.useRef(null),Xe=u.useCallback(()=>v?Ne.current:he.current,[v]);u.useEffect(()=>{const C=Xe();!C||f===void 0||(f?C.focus():C.blur())},[f,r,Xe]),u.useEffect(()=>{const C=he.current;!C||!(y==="text"||y==="tel"||y==="search"||y==="url"||y==="password")||!re||C.setSelectionRange(o.length,re.length)},[W,o,y,re]);const et=re||o,tn=k??1,nn=A??1/0,rn=R??-1/0,Ar=M(L.TextField,!!et&&L.hasValue,p&&L.disabled,b&&L.readOnly,S&&L.error,gt&&L[ie("tone",gt)],v&&L.multiline,W&&!p&&L.focus,ye!=="inherit"&&L[ye],pe==="slim"&&L.slim),Br=y==="currency"?"text":y,vt=y==="number"||y==="integer",Mr=t.isValidElement(e)&&e.type===Ee,Nr=e?t.createElement("div",{className:M(L.Prefix,Mr&&L.PrefixIcon),id:`${z}-Prefix`,ref:je},t.createElement(x,{as:"span",variant:"bodyMd"},e)):null,an=n?t.createElement("div",{className:L.Suffix,id:`${z}-Suffix`,ref:$e},t.createElement(x,{as:"span",variant:"bodyMd"},n)):null,jr=bt?t.createElement("div",{className:L.Loading,id:`${z}-Loading`,ref:Re},t.createElement(ar,{size:"small"})):null;let on=null;if(K){const C=et.length,F=_?qe.translate("Polaris.TextField.characterCountWithMaxLength",{count:C,limit:_}):qe.translate("Polaris.TextField.characterCount",{count:C}),de=M(L.CharacterCount,v&&L.AlignFieldBottom),me=_?`${C}/${_}`:C;on=t.createElement("div",{id:`${z}-CharacterCounter`,className:de,"aria-label":F,"aria-live":W?"polite":"off","aria-atomic":"true",onClick:xt},t.createElement(x,{as:"span",variant:"bodyMd"},me))}const _r=m&&et!==""?t.createElement("button",{type:"button",className:L.ClearButton,onClick:Zr,disabled:p},t.createElement(x,{as:"span",visuallyHidden:!0},qe.translate("Polaris.Common.clear")),t.createElement(Ee,{source:er,tone:"base"})):null,tt=u.useCallback((C,F=tn)=>{if(ce==null&&ee==null)return;const de=Xr=>(Xr.toString().split(".")[1]||[]).length,me=o?parseFloat(o):0;if(isNaN(me))return;const Ae=y==="integer"?0:Math.max(de(me),de(F)),at=Math.min(Number(nn),Math.max(me+C*F,Number(rn)));ee!=null?ee(String(at.toFixed(Ae)),z):ce!=null&&ce(String(at.toFixed(Ae)),z)},[z,nn,rn,ce,ee,tn,y,o]),Lt=u.useCallback(()=>{clearTimeout(jt.current)},[]),Lr=u.useCallback(C=>{let me=200;const Ae=()=>{me>50&&(me-=10),C(0),jt.current=window.setTimeout(Ae,me)};jt.current=window.setTimeout(Ae,me),document.addEventListener("mouseup",Lt,{once:!0})},[Lt]),Rr=vt&&k!==0&&!p&&!b?t.createElement(lo,{onClick:xt,onChange:tt,onMouseDown:Lr,onMouseUp:Lt,ref:_t,onBlur:un}):null,Fr=v&&g?{height:g,maxHeight:Z}:null,Or=u.useCallback(C=>{q(C)},[]),Wr=v&&Ce?t.createElement(ho,{contents:et||a,currentHeight:g,minimumLines:typeof v=="number"?v:1,onHeightChange:Or}):null,nt=[];S&&nt.push(`${z}Error`),s&&nt.push(xr(z)),K&&nt.push(`${z}-CharacterCounter`);const rt=[];e&&rt.push(`${z}-Prefix`),n&&rt.push(`${z}-Suffix`),r&&rt.push(`${z}-VerticalContent`),rt.unshift(vr(z));const $r=M(L.Input,ue&&L[ie("Input-align",ue)],n&&L["Input-suffixed"],m&&L["Input-hasClearButton"],V&&L.monospaced,re&&L.suggestion,Ze&&L["Input-autoSize"]),sn=C=>{if(Q(!0),ge&&!re){const F=Xe();F==null||F.select()}Le&&Le(C)};Yt("wheel",Hr,he);function Hr(C){document.activeElement===C.target&&vt&&C.stopPropagation()}const ln=u.createElement(v?"textarea":"input",{name:N,id:z,disabled:p,readOnly:b,role:B,autoFocus:h,value:et,placeholder:a,style:Fr,autoComplete:P,className:$r,ref:v?Ne:he,min:R,max:A,step:k,minLength:D,maxLength:_,spellCheck:U,pattern:j,inputMode:O,type:Br,rows:yo(v),size:Ze?1:void 0,"aria-describedby":nt.length?nt.join(" "):void 0,"aria-labelledby":rt.join(" "),"aria-invalid":!!S,"aria-owns":$,"aria-activedescendant":se,"aria-autocomplete":Y,"aria-controls":X,"aria-expanded":te,"aria-required":G,...Po(v),onFocus:sn,onBlur:un,onClick:xt,onKeyPress:qr,onKeyDown:Vr,onChange:re?void 0:dn,onInput:re?dn:void 0,"data-1p-ignore":P==="off"||void 0,"data-lpignore":P==="off"||void 0,"data-form-type":P==="off"?"other":void 0}),Dr=r?t.createElement("div",{className:L.VerticalContent,id:`${z}-VerticalContent`,ref:Ve,onClick:xt},r,ln):null,cn=r?Dr:ln,Ur=t.createElement("div",{className:M(L.Backdrop,I&&L["Backdrop-connectedLeft"],w&&L["Backdrop-connectedRight"])}),zr=Ze?t.createElement("div",{className:L.InputAndSuffixWrapper},t.createElement("div",{className:M(L.AutoSizeWrapper,n&&L.AutoSizeWrapperWithSuffix),"data-auto-size-value":o||a},cn),an):t.createElement(t.Fragment,null,cn,an);return t.createElement(mo,{label:c,id:z,error:S,action:l,labelHidden:d,helpText:s,requiredIndicator:G,disabled:p,readOnly:b},t.createElement(fo,{left:I,right:w},t.createElement("div",{className:Ar,onClick:Gr,ref:Ie},Nr,zr,on,jr,_r,Rr,Ur,Wr)));function dn(C){ce&&ce(C.currentTarget.value,z)}function Gr(C){var me,Ae,at;const{target:F}=C,de=(me=he==null?void 0:he.current)==null?void 0:me.getAttribute("role");
1if(F===he.current&&de==="combobox"){(Ae=he.current)==null||Ae.focus(),sn(C);return}pn(F)||hn(F)||Rt(F)||mn(F)||fn(F)||W||(at=Xe())==null||at.focus()}function xt(C){var F;!mn(C.target)&&!Rt(C.target)&&C.stopPropagation(),!(pn(C.target)||hn(C.target)||Rt(C.target)||fn(C.target)||W)&&(Q(!0),(F=Xe())==null||F.focus())}function Zr(){le&&le(z)}function qr(C){const{key:F,which:de}=C,me=/[\d.,eE+-]$/,Ae=/[\deE+-]$/;!vt||de===Pe.Enter||y==="number"&&me.test(F)||y==="integer"&&Ae.test(F)||C.preventDefault()}function Vr(C){if(!vt)return;const{key:F,which:de}=C;y==="integer"&&(F==="ArrowUp"||de===Pe.UpArrow)&&(tt(1),C.preventDefault()),y==="integer"&&(F==="ArrowDown"||de===Pe.DownArrow)&&(tt(-1),C.preventDefault()),(de===Pe.Home||F==="Home")&&R!==void 0&&(ee!=null?ee(String(R),z):ce!=null&&ce(String(R),z)),(de===Pe.End||F==="End")&&A!==void 0&&(ee!=null?ee(String(A),z):ce!=null&&ce(String(A),z)),(de===Pe.PageUp||F==="PageUp")&&E!==void 0&&tt(1,E),(de===Pe.PageDown||F==="PageDown")&&E!==void 0&&tt(-1,E)}function un(C){var F;Q(!1),!((F=Ie.current)!=null&&F.contains(C==null?void 0:C.relatedTarget))&&We&&We(C)}function Rt(C){const F=Xe();return C instanceof HTMLElement&&F&&(F.contains(C)||F.contains(document.activeElement))}function pn(C){return C instanceof Element&&(je.current&&je.current.contains(C)||$e.current&&$e.current.contains(C))}function mn(C){return C instanceof Element&&_t.current&&_t.current.contains(C)}function fn(C){return C instanceof Element&&Re.current&&Re.current.contains(C)}function hn(C){return C instanceof Element&&Ve.current&&(Ve.current.contains(C)||Ve.current.contains(document.activeElement))}}function yo(e){if(e)return typeof e=="number"?e:1}function Po(e){if(e)return e||typeof e=="number"&&e>0?{"aria-multiline":!0}:void 0}const So=8;function en({items:e,sections:n=[],actionRole:r,allowFiltering:a,onActionAnyItem:o}){const s=we(),c=u.useContext(sr);let l=[];const d=u.useRef(null),[p,m]=u.useState("");e?l=[{items:e},...n]:n&&(l=n);const b=l==null?void 0:l.some(E=>E.items.some(P=>typeof P.content=="string")),h=l.length>1,f=h&&r==="menuitem"?"menu":void 0,v=h&&r==="menuitem"?-1:void 0,S=l==null?void 0:l.map(E=>({...E,items:E.items.filter(({content:P})=>typeof P=="string"?P==null?void 0:P.toLowerCase().includes(p.toLowerCase()):P)})),w=S.map((E,P)=>E.items.length>0?t.createElement(so,{key:typeof E.title=="string"?E.title:P,section:E,hasMultipleSections:h,actionRole:r,onActionAnyItem:o,isFirst:P===0}):null),I=E=>{E.preventDefault(),d.current&&E.target&&d.current.contains(E.target)&&Ca(d.current,E.target)},y=E=>{E.preventDefault(),d.current&&E.target&&d.current.contains(E.target)&&ka(d.current,E.target)},N=r==="menuitem"?t.createElement(t.Fragment,null,t.createElement(ht,{keyEvent:"keydown",keyCode:Pe.DownArrow,handler:y}),t.createElement(ht,{keyEvent:"keydown",keyCode:Pe.UpArrow,handler:I})):null,T=u.useMemo(()=>(S==null?void 0:S.reduce((P,A)=>P+A.items.length,0))||0,[S]),k=((l==null?void 0:l.reduce((E,P)=>E+P.items.length,0))||0)>=So;return t.createElement(t.Fragment,null,(a||c)&&k&&b&&t.createElement(H,{padding:"200",paddingBlockEnd:T>0?"0":"200"},t.createElement(Eo,{clearButton:!0,labelHidden:!0,label:s.translate("Polaris.ActionList.SearchField.placeholder"),placeholder:s.translate("Polaris.ActionList.SearchField.placeholder"),autoComplete:"off",value:p,onChange:E=>m(E),prefix:t.createElement(Ee,{source:Jn}),onClearButtonClick:()=>m("")})),t.createElement(H,{as:h?"ul":"div",ref:d,role:f,tabIndex:v},N,w))}en.Item=br;var kn={ActionMenu:"Polaris-ActionMenu"},wo={RollupActivator:"Polaris-ActionMenu-RollupActions__RollupActivator"};function Co(e,{id:n,active:r=!1,ariaHaspopup:a,activatorDisabled:o=!1}){o||(e.tabIndex=e.tabIndex||0),e.setAttribute("aria-controls",n),e.setAttribute("aria-owns",n),e.setAttribute("aria-expanded",String(r)),e.setAttribute("data-state",r?"open":"closed"),a!=null&&e.setAttribute("aria-haspopup",String(a))}function yr(e,n,r){return e==null?null:Pr(e,n)?e:t.createElement(n,r,e)}const ko=(e,n)=>e===n;function Pr(e,n){var c;if(e==null||!u.isValidElement(e)||typeof e.type=="string")return!1;const{type:r}=e,o=((c=e.props)==null?void 0:c.__type__)||r;return(Array.isArray(n)?n:[n]).some(l=>typeof o!="string"&&ko(l,o))}function To(e,n=()=>!0){return u.Children.toArray(e).filter(r=>u.isValidElement(r)&&n(r))}function Io({condition:e,wrapper:n,children:r}){return e?n(r):r}function Dt({condition:e,children:n}){return e?n:null}var J={Popover:"Polaris-Popover",PopoverOverlay:"Polaris-Popover__PopoverOverlay","PopoverOverlay-noAnimation":"Polaris-Popover__PopoverOverlay--noAnimation","PopoverOverlay-entering":"Polaris-Popover__PopoverOverlay--entering","PopoverOverlay-open":"Polaris-Popover__PopoverOverlay--open",measuring:"Polaris-Popover--measuring","PopoverOverlay-exiting":"Polaris-Popover__PopoverOverlay--exiting",fullWidth:"Polaris-Popover--fullWidth",Content:"Polaris-Popover__Content",positionedAbove:"Polaris-Popover--positionedAbove",positionedCover:"Polaris-Popover--positionedCover",ContentContainer:"Polaris-Popover__ContentContainer","Content-fullHeight":"Polaris-Popover__Content--fullHeight","Content-fluidContent":"Polaris-Popover__Content--fluidContent",Pane:"Polaris-Popover__Pane","Pane-fixed":"Polaris-Popover__Pane--fi
1xed","Pane-subdued":"Polaris-Popover__Pane--subdued","Pane-captureOverscroll":"Polaris-Popover__Pane--captureOverscroll",Section:"Polaris-Popover__Section",FocusTracker:"Polaris-Popover__FocusTracker","PopoverOverlay-hideOnPrint":"Polaris-Popover__PopoverOverlay--hideOnPrint"};function Sr({children:e}){return t.createElement("div",{className:J.Section},t.createElement(H,{paddingInlineStart:"300",paddingInlineEnd:"300",paddingBlockStart:"200",paddingBlockEnd:"150"},e))}function Gt({captureOverscroll:e=!1,fixed:n,sectioned:r,children:a,height:o,subdued:s,onScrolledToBottom:c}){const l=M(J.Pane,n&&J["Pane-fixed"],s&&J["Pane-subdued"],e&&J["Pane-captureOverscroll"]),d=r?yr(a,Sr,{}):a,p=o?{height:o,maxHeight:o,minHeight:o}:void 0;return n?t.createElement("div",{style:p,className:l},d):t.createElement(Ke,{shadow:!0,className:l,style:p,onScrolledToBottom:c,scrollbarWidth:"thin"},d)}let _e;(function(e){e[e.Click=0]="Click",e[e.EscapeKeypress=1]="EscapeKeypress",e[e.FocusOut=2]="FocusOut",e[e.ScrollOut=3]="ScrollOut"})(_e||(_e={}));var ve;(function(e){e.Entering="entering",e.Entered="entered",e.Exiting="exiting",e.Exited="exited"})(ve||(ve={}));class wr extends u.PureComponent{constructor(n){super(n),this.state={transitionStatus:this.props.active?ve.Entering:ve.Exited},this.contentNode=u.createRef(),this.renderPopover=r=>{const{measuring:a,desiredHeight:o,positioning:s}=r,{id:c,children:l,sectioned:d,fullWidth:p,fullHeight:m,fluidContent:b,hideOnPrint:h,autofocusTarget:f,captureOverscroll:v}=this.props,S=s==="cover",w=M(J.Popover,a&&J.measuring,(p||S)&&J.fullWidth,h&&J["PopoverOverlay-hideOnPrint"],s&&J[ie("positioned",s)]),I=a?void 0:{height:o},y=M(J.Content,m&&J["Content-fullHeight"],b&&J["Content-fluidContent"]);return t.createElement("div",Object.assign({className:w},pa.props),t.createElement(Bt,{event:"click",handler:this.handleClick}),t.createElement(Bt,{event:"touchstart",handler:this.handleClick}),t.createElement(ht,{keyCode:Pe.Escape,handler:this.handleEscape}),t.createElement("div",{className:J.FocusTracker,tabIndex:0,onFocus:this.handleFocusFirstItem}),t.createElement("div",{className:J.ContentContainer},t.createElement("div",{id:c,tabIndex:f==="none"?void 0:-1,className:y,style:I,ref:this.contentNode},Ao(l,{captureOverscroll:v,sectioned:d}))),t.createElement("div",{className:J.FocusTracker,tabIndex:0,onFocus:this.handleFocusLastItem}))},this.handleClick=r=>{const a=r.target,{contentNode:o,props:{activator:s,onClose:c,preventCloseOnChildOverlayClick:l}}=this,d=r.composedPath(),p=l?Bo(d,this.context.container):In(d,o),m=Tn(s,a);p||m||this.state.transitionStatus!==ve.Entered||c(_e.Click)},this.handleScrollOut=()=>{this.props.onClose(_e.ScrollOut)},this.handleEscape=r=>{const a=r.target,{contentNode:o,props:{activator:s}}=this,c=r.composedPath(),l=In(c,o),d=Tn(s,a);(l||d)&&this.props.onClose(_e.EscapeKeypress)},this.handleFocusFirstItem=()=>{this.props.onClose(_e.FocusOut)},this.handleFocusLastItem=()=>{this.props.onClose(_e.FocusOut)},this.overlayRef=u.createRef()}forceUpdatePosition(){var n;(n=this.overlayRef.current)==null||n.forceUpdatePosition()}changeTransitionStatus(n,r){this.setState({transitionStatus:n},r),this.contentNode.current&&this.contentNode.current.getBoundingClientRect()}componentDidMount(){this.props.active&&(this.focusContent(),this.changeTransitionStatus(ve.Entered))}componentDidUpdate(n){this.props.active&&!n.active&&(this.focusContent(),this.changeTransitionStatus(ve.Entering,()=>{this.clearTransitionTimeout(),this.enteringTimer=window.setTimeout(()=>{this.setState({transitionStatus:ve.Entered})},parseInt(ma.motion["motion-duration-100"],10))})),!this.props.active&&n.active&&(this.clearTransitionTimeout(),this.setState({transitionStatus:ve.Exited}))}componentWillUnmount(){this.clearTransitionTimeout()}render(){const{active:n,activator:r,fullWidth:a,preferredPosition:o="below",preferredAlignment:s="center",preferInputActivator:c=!0,fixed:l,zIndexOverride:d}=this.props,{transitionStatus:p}=this.state;if(p===ve.Exited&&!n)return null;const m=M(J.PopoverOverlay,p===ve.Entering&&J["PopoverOverlay-entering"],p===ve.Entered&&J["PopoverOverlay-open"],p===ve.Exiting&&J["PopoverOverlay-exiting"],o==="cover"&&J["PopoverOverlay-noAnimation"]);return t.createElement(gr,{ref:this.overlayRef,fullWidth:a,active:n,activator:r,preferInputActivator:c,preferredPosition:o,preferredAlignment:s,render:this.renderPopover.bind(this),fixed:l,onScrollOut:this.handleScrollOut,classNames:m,zIndexOverride:d})}clearTransitionTimeout(){this.enteringTimer&&window.clearTimeout(this.enteringTimer)}focusContent(){const{autofocusTarget:n="container"}=this.props;n==="none"||this.contentNode==null||requestAnimationFrame(()=>{if(this.contentNode.current==null)return;const r=wa(this.contentNode.current);r&&n==="first-node"?r.focus({preventScroll:!1}):this.contentNode.current.focus({preventScroll:!1})})}}wr.contextType=Wn;function Ao(e,n){const r=u.Children.toArray(e);return Pr(r[0],Gt)?r:yr(r,Gt,n)}function Tn(e,n){if(e===n)return!0;let r=n.parentNode;for(;r!=null;){if(r===e)return!0;r=r.parentNode}return!1}function In(e,n){return n.current!=null&&e.includes(n.current)}function Bo(e,n){return e.some(r=>r instanceof Node&&(n==null?void 0:n.contains(r)))}const Mo=u.forwardRef(function({activatorWrapper:n="div",children:r,onClose:a,activator:o,preventFocusOnClose
1:s,active:c,fixed:l,ariaHaspopup:d,preferInputActivator:p=!0,zIndexOverride:m,...b},h){const[f,v]=u.useState(),S=u.useRef(null),w=u.useRef(null),I=n,y=u.useId();function N(){var E;(E=S.current)==null||E.forceUpdatePosition()}u.useImperativeHandle(h,()=>({forceUpdatePosition:N}));const T=u.useCallback(()=>{if(w.current==null)return;const P=it(w.current)||w.current,A="disabled"in P&&!!P.disabled;Co(P,{id:y,active:c,ariaHaspopup:d,activatorDisabled:A})},[y,c,d]),B=E=>{if(a(E),!(w.current==null||s)){if(E===_e.FocusOut&&f){const P=it(f)||it(w.current)||w.current;vn(P,An)||P.focus()}else if(E===_e.EscapeKeypress&&f){const P=it(f)||it(w.current)||w.current;P?P.focus():vn(P,An)}}};u.useEffect(()=>{(!f&&w.current||f&&w.current&&!w.current.contains(f))&&v(w.current.firstElementChild),T()},[f,T]),u.useEffect(()=>{f&&w.current&&v(w.current.firstElementChild),T()},[f,T]);const k=f?t.createElement(dr,{idPrefix:"popover"},t.createElement(wr,Object.assign({ref:S,id:y,activator:f,preferInputActivator:p,onClose:B,active:c,fixed:l,zIndexOverride:m},b),r)):null;return t.createElement(I,{ref:w},u.Children.only(o),k)});function An(e){let n=e.parentElement;for(;n;){if(n.matches(fa.selector))return!1;n=n.parentElement}return!0}const Cr=Object.assign(Mo,{Pane:Gt,Section:Sr});function No({accessibilityLabel:e,items:n=[],sections:r=[]}){const a=we(),{value:o,toggle:s}=mt(!1);if(n.length===0&&r.length===0)return null;const c=t.createElement("div",{className:wo.RollupActivator},t.createElement(oe,{icon:Qn,accessibilityLabel:e||a.translate("Polaris.ActionMenu.RollupActions.rollupButton"),onClick:s}));return t.createElement(Cr,{active:o,activator:c,preferredAlignment:"right",onClose:s,hideOnPrint:!0},t.createElement(en,{items:n,sections:r,onActionAnyItem:s}))}var It={ActionsLayoutOuter:"Polaris-ActionMenu-Actions__ActionsLayoutOuter",ActionsLayout:"Polaris-ActionMenu-Actions__ActionsLayout","ActionsLayout--measuring":"Polaris-ActionMenu-Actions--actionsLayoutMeasuring",ActionsLayoutMeasurer:"Polaris-ActionMenu-Actions__ActionsLayoutMeasurer"};function Bn(e=[],n=[],r,a,o){const s=a.reduce((h,f)=>h+f,0),c=e.map((h,f)=>f),l=n.map((h,f)=>f),d=[],p=[],m=[],b=[];if(o>s)d.push(...c),m.push(...l);else{let h=0;
1c.forEach(f=>{const v=a[f];if(h+v>=o-r){p.push(f);return}d.push(f),h+=v}),l.forEach(f=>{const v=a[f+e.length];if(h+v>=o-r){b.push(f);return}m.push(f),h+=v})}return{visibleActions:d,hiddenActions:p,visibleGroups:m,hiddenGroups:b}}var jo={Details:"Polaris-ActionMenu-MenuGroup__Details"},Mn={SecondaryAction:"Polaris-ActionMenu-SecondaryAction",critical:"Polaris-ActionMenu-SecondaryAction--critical"};function dt({children:e,tone:n,helpText:r,onAction:a,destructive:o,...s}){const c=t.createElement(oe,Object.assign({onClick:a,tone:o?"critical":void 0},s),e),l=r?t.createElement(ft,{preferredPosition:"below",content:r},c):c;return t.createElement("div",{className:M(Mn.SecondaryAction,n==="critical"&&Mn.critical)},l)}function Nn({accessibilityLabel:e,active:n,actions:r,details:a,title:o,icon:s,disabled:c,onClick:l,onClose:d,onOpen:p,sections:m}){const b=u.useCallback(()=>{d(o)},[d,o]),h=u.useCallback(()=>{p(o)},[p,o]),f=u.useCallback(()=>{l?l(h):h()},[l,h]),v=t.createElement(dt,{disclosure:!0,disabled:c,icon:s,accessibilityLabel:e,onClick:f},o);return t.createElement(Cr,{active:!!n,activator:v,preferredAlignment:"left",onClose:b,hideOnPrint:!0},t.createElement(en,{items:r,sections:m,onActionAnyItem:b}),a&&t.createElement("div",{className:jo.Details},a))}const _o=8;function Lo({actions:e=[],groups:n=[],handleMeasurement:r}){const a=we(),o=u.useRef(null),s={title:a.translate("Polaris.ActionMenu.Actions.moreActions")},c=t.createElement(dt,{disclosure:!0},s.title),l=u.useCallback(()=>{if(!o.current)return;const m=o.current.offsetWidth,b=o.current.children,f=Array.from(b).map(S=>Math.ceil(S.getBoundingClientRect().width)+_o),v=f.pop()||0;r({containerWidth:m,disclosureWidth:v,hiddenActionsWidths:f})},[r]);u.useEffect(()=>{l()},[l,e,n]);const d=e.map(m=>{const{content:b,onAction:h,...f}=m;return t.createElement(dt,Object.assign({key:b,onClick:h},f),b)}),p=n.map(m=>{const{title:b,icon:h}=m;return t.createElement(dt,{key:b,disclosure:!0,icon:h},b)});return Yt("resize",l),t.createElement("div",{className:It.ActionsLayoutMeasurer,ref:o},d,p,c)}function Ro({actions:e,groups:n,onActionRollup:r}){const a=we(),o=u.useRef(null),[s,c]=u.useState(void 0),[l,d]=u.useReducer((j,O)=>({...j,...O}),{disclosureWidth:0,containerWidth:1/0,actionsWidths:[],visibleActions:[],hiddenActions:[],visibleGroups:[],hiddenGroups:[],hasMeasured:!1}),{visibleActions:p,hiddenActions:m,visibleGroups:b,hiddenGroups:h,containerWidth:f,disclosureWidth:v,actionsWidths:S,hasMeasured:w}=l,I={title:a.translate("Polaris.ActionMenu.Actions.moreActions"),actions:[]},y=u.useCallback(j=>c(s?void 0:j),[s]),N=u.useCallback(()=>c(void 0),[]);u.useEffect(()=>{if(f===0)return;const{visibleActions:j,visibleGroups:O,hiddenActions:U,hiddenGroups:$}=Bn(e,n,v,S,f);d({visibleActions:j,visibleGroups:O,hiddenActions:U,hiddenGroups:$,hasMeasured:f!==1/0})},[f,v,e,n,S,d]);const T=u.useMemo(()=>e??[],[e]),B=u.useMemo(()=>n??[],[n]),k=T.filter((j,O)=>!!p.includes(O)).map(j=>{const{content:O,onAction:U,...$}=j;return t.createElement(dt,Object.assign({key:O,onClick:U},$),O)}),P=(h.length>0||m.length>0?[...B,I]:[...B]).filter((j,O)=>{const U=B.length===0,$=b.includes(O),X=j===I;return U?m.length>0:X?!0:$}),A=m.map(j=>T[j]).filter(j=>j!=null),_=h.map(j=>B[j]).filter(j=>j!=null),Z=P.map(j=>{const{title:O,actions:U,...$}=j,X=j===I,te=[...A,..._],[se,Y]=te.reduce(([K,ue],G)=>(Fo(G)?ue.push({title:G.title,items:G.actions.map(V=>({...V,disabled:G.disabled||V.disabled}))}):K.push(G),[K,ue]),[[],[]]);return X?t.createElement(Nn,Object.assign({key:O,title:O,active:O===s,actions:[...se,...U],sections:Y},$,{onOpen:y,onClose:N})):t.createElement(Nn,Object.assign({key:O,title:O,active:O===s,actions:U},$,{onOpen:y,onClose:N}))}),R=u.useCallback(j=>{const{hiddenActionsWidths:O,containerWidth:U,disclosureWidth:$}=j,{visibleActions:X,hiddenActions:te,visibleGroups:se,hiddenGroups:Y}=Bn(T,B,$,O,U);if(r){const K=te.length>0||Y.length>0;o.current!==K&&(r(K),o.current=K)}d({visibleActions:X,hiddenActions:te,visibleGroups:se,hiddenGroups:Y,actionsWidths:O,containerWidth:U,disclosureWidth:$,hasMeasured:!0})},[T,B,r]),D=t.createElement(Lo,{actions:e,groups:n,handleMeasurement:R});return t.createElement("div",{className:It.ActionsLayoutOuter},D,t.createElement("div",{className:M(It.ActionsLayout,!w&&It["ActionsLayout--measuring"])},k,Z))}function Fo(e){return"title"in e}function Oo({actions:e=[],groups:n=[],rollup:r,rollupActionsLabel:a,onActionRollup:o}
1){if(e.length===0&&n.length===0)return null;const s=M(kn.ActionMenu,r&&kn.rollup),c=n.map(l=>$o(l));return t.createElement("div",{className:s},r?t.createElement(No,{accessibilityLabel:a,items:e,sections:c}):t.createElement(Ro,{actions:e,groups:n,onActionRollup:o}))}function Wo(e=[]){return e.length===0?!1:e.some(n=>n.actions.length>0)}function $o({title:e,actions:n,disabled:r}){return{title:e,items:n.map(a=>({...a,disabled:r||a.disabled}))}}const Ho=u.createContext(!1);var ze={Banner:"Polaris-Banner",keyFocused:"Polaris-Banner--keyFocused",withinContentContainer:"Polaris-Banner--withinContentContainer",withinPage:"Polaris-Banner--withinPage",DismissIcon:"Polaris-Banner__DismissIcon","text-success-on-bg-fill":"Polaris-Banner--textSuccessOnBgFill","text-success":"Polaris-Banner__text--success","text-warning-on-bg-fill":"Polaris-Banner--textWarningOnBgFill","text-warning":"Polaris-Banner__text--warning","text-critical-on-bg-fill":"Polaris-Banner--textCriticalOnBgFill","text-critical":"Polaris-Banner__text--critical","text-info-on-bg-fill":"Polaris-Banner--textInfoOnBgFill","text-info":"Polaris-Banner__text--info","icon-secondary":"Polaris-Banner__icon--secondary"};const Ut={success:{withinPage:{background:"bg-fill-success",text:"text-success-on-bg-fill",icon:"text-success-on-bg-fill"},withinContentContainer:{background:"bg-surface-success",text:"text-success",icon:"text-success"},icon:qn},warning:{withinPage:{background:"bg-fill-warning",text:"text-warning-on-bg-fill",icon:"text-warning-on-bg-fill"},withinContentContainer:{background:"bg-surface-warning",text:"text-warning",icon:"text-warning"},icon:Gn},critical:{withinPage:{background:"bg-fill-critical",text:"text-critical-on-bg-fill",icon:"text-critical-on-bg-fill"},withinContentContainer:{background:"bg-surface-critical",text:"text-critical",icon:"text-critical"},icon:zn},info:{withinPage:{background:"bg-fill-info",text:"text-info-on-bg-fill",icon:"text-info-on-bg-fill"},withinContentContainer:{background:"bg-surface-info",text:"text-info",icon:"text-info"},icon:Yn}};function Do(e){const n=u.useRef(null),[r,a]=u.useState(!1);return u.useImperativeHandle(e,()=>({focus:()=>{var l;(l=n.current)==null||l.focus(),a(!0)}}),[]),{wrapperRef:n,handleKeyUp:l=>{l.target===n.current&&a(!0)},handleBlur:()=>a(!1),handleMouseUp:l=>{l.currentTarget.blur(),a(!1)},shouldShowFocus:r}}var Oe={ButtonGroup:"Polaris-ButtonGroup",Item:"Polaris-ButtonGroup__Item","Item-plain":"Polaris-ButtonGroup__Item--plain",variantSegmented:"Polaris-ButtonGroup--variantSegmented","Item-focused":"Polaris-ButtonGroup__Item--focused",fullWidth:"Polaris-ButtonGroup--fullWidth",extraTight:"Polaris-ButtonGroup--extraTight",tight:"Polaris-ButtonGroup--tight",loose:"Polaris-ButtonGroup--loose",noWrap:"Polaris-ButtonGroup--noWrap"};function Uo({button:e}){const{value:n,setTrue:r,setFalse:a}=mt(!1),o=M(Oe.Item,n&&Oe["Item-focused"],e.props.variant==="plain"&&Oe["Item-plain"]);return t.createElement("div",{className:o,onFocus:r,onBlur:a},e)}function kr({children:e,gap:n,variant:r,fullWidth:a,connectedTop:o,noWrap:s}){const c=M(Oe.ButtonGroup,n&&Oe[n],r&&Oe[ie("variant",r)],a&&Oe.fullWidth,s&&Oe.noWrap),l=To(e).map((d,p)=>t.createElement(Uo,{button:d,key:p}));return t.createElement("div",{className:c,"data-buttongroup-variant":r,"data-buttongroup-connected-top":o,"data-buttongroup-full-width":a,"data-buttongroup-no-wrap":s},l)}const zo=u.forwardRef(function(n,r){const{tone:a,stopAnnouncements:o}=n,s=u.useContext(Xt),{wrapperRef:c,handleKeyUp:l,handleBlur:d,handleMouseUp:p,shouldShowFocus:m}=Do(r),b=M(ze.Banner,m&&ze.keyFocused,s?ze.withinContentContainer:ze.withinPage);return t.createElement(Ho.Provider,{value:!0},t.createElement("div",{className:b,tabIndex:0,ref:c,role:a==="warning"||a==="critical"?"alert":"status","aria-live":o?"off":"polite",onMouseUp:p,onKeyUp:l,onBlur:d},t.createElement(Go,n)))});function Go({tone:e="info",icon:n,hideIcon:r,onDismiss:a,action:o,secondaryAction:s,title:c,children:l}){const d=we(),p=u.useContext(Xt),m=!c&&!p,b=Object.keys(Ut).includes(e)?e:"info",h=Ut[b][p?"withinContentContainer":"withinPage"],f={backgroundColor:h.background,textColor:h.text,bannerTitle:c?t.createElement(x,{as:"h2",variant:"headingSm",breakWord:!0}
1,c):null,bannerIcon:r?null:t.createElement("span",{className:ze[h.icon]},t.createElement(Ee,{source:n??Ut[b].icon})),actionButtons:o||s?t.createElement(kr,null,o&&t.createElement(oe,Object.assign({onClick:o.onAction},o),o.content),s&&t.createElement(oe,Object.assign({onClick:s.onAction},s),s.content)):null,dismissButton:a?t.createElement(oe,{variant:"tertiary",icon:t.createElement("span",{className:ze[m?"icon-secondary":h.icon]},t.createElement(Ee,{source:tr})),onClick:a,accessibilityLabel:d.translate("Polaris.Banner.dismissButton")}):null},v=l?t.createElement(x,{as:"span",variant:"bodyMd"},l):null;return p?t.createElement(Vo,f,v):m?t.createElement(qo,f,v):t.createElement(Zo,f,v)}function Zo({backgroundColor:e,textColor:n,bannerTitle:r,bannerIcon:a,actionButtons:o,dismissButton:s,children:c}){const{smUp:l}=Mt(),d=c||o;return t.createElement(H,{width:"100%"},t.createElement(xe,{align:"space-between"},t.createElement(H,{background:e,color:n,borderStartStartRadius:l?"300":void 0,borderStartEndRadius:l?"300":void 0,borderEndStartRadius:!d&&l?"300":void 0,borderEndEndRadius:!d&&l?"300":void 0,padding:"300"},t.createElement(Se,{align:"space-between",blockAlign:"center",gap:"200",wrap:!1},t.createElement(Se,{gap:"100",wrap:!1},a,r),s)),d&&t.createElement(H,{padding:{xs:"300",md:"400"},paddingBlockStart:"300"},t.createElement(xe,{gap:"200"},t.createElement("div",null,c),o))))}function qo({backgroundColor:e,bannerIcon:n,actionButtons:r,dismissButton:a,children:o}){const[s,c]=u.useState("center"),l=u.useRef(null),d=u.useRef(null),p=u.useRef(null),m=u.useCallback(()=>{var f,v,S;const b=(f=l.current)==null?void 0:f.offsetHeight,h=((v=d.current)==null?void 0:v.offsetHeight)||((S=p.current)==null?void 0:S.offsetHeight);!b||!h||(b>h?c("start"):c("center"))},[]);return u.useEffect(()=>m(),[m]),Yt("resize",m),t.createElement(H,{width:"100%",padding:"300",borderRadius:"300"},t.createElement(Se,{align:"space-between",blockAlign:s,wrap:!1},t.createElement(H,{width:"100%"},t.createElement(Se,{gap:"200",wrap:!1,blockAlign:s},n?t.createElement("div",{ref:d},t.createElement(H,{background:e,borderRadius:"200",padding:"100"},n)):null,t.createElement(H,{ref:l,width:"100%"},t.createElement(xe,{gap:"200"},t.createElement("div",null,o),r)))),t.createElement("div",{ref:p,className:ze.DismissIcon},a)))}function Vo({backgroundColor:e,textColor:n,bannerTitle:r,bannerIcon:a,actionButtons:o,dismissButton:s,children:c}){return t.createElement(H,{width:"100%",background:e,padding:"200",borderRadius:"200",color:n},t.createElement(Se,{align:"space-between",blockAlign:"start",wrap:!1,gap:"200"},t.createElement(Se,{gap:"150",wrap:!1},a,t.createElement(H,{width:"100%"},t.createElement(xe,{gap:"200"},t.createElement(xe,{gap:"050"},r,t.createElement("div",null,c)),o))),s))}var Xo={Bleed:"Polaris-Bleed"};const Yo=({marginInline:e,marginBlock:n,marginBlockStart:r,marginBlockEnd:a,marginInlineStart:o,marginInlineEnd:s,children:c})=>{const l=f=>{const v=["marginInlineStart","marginInlineEnd"],S=["marginBlockStart","marginBlockEnd"],w={marginBlockStart:r,marginBlockEnd:a,marginInlineStart:o,marginInlineEnd:s,marginInline:e,marginBlock:n};if(w[f])return w[f];if(v.includes(f)&&e)return w.marginInline;if(S.includes(f)&&n)return w.marginBlock},d=l("marginBlockStart"),p=l("marginBlockEnd"),m=l("marginInlineStart"),b=l("marginInlineEnd"),h={...Me("bleed","margin-block-start","space",d),...Me("bleed","margin-block-end","space",p),...Me("bleed","margin-inline-start","space",m),...Me("bleed","margin-inline-end","space",b)};return t.createElement("div",{className:Xo.Bleed,style:Vt(h)},c)};function Qo({backAction:e}){const{content:n}=e;return t.createElement(oe,{key:n,url:"url"in e?e.url:void 0,onClick:"onAction"in e?e.onAction:void 0,onPointerDown:Nt,icon:Zn,accessibilityLabel:e.accessibilityLabel??n})}var Je;(function(e){e.Input="INPUT",e.Textarea="TEXTAREA",e.Select="SELECT",e.ContentEditable="contenteditable"})(Je||(Je={}));function Jo(){if(document==null||document.activeElement==null)return!1;const{tagName:e}=document.activeElement;return e===Je.Input||e===Je.Textarea||e===Je.Select||document.activeElement.hasAttribute(Je.ContentEditable)}var Pt={Pagination:"Polaris-Pagination",table:"Polaris-Pagination--table",TablePaginationActions:"Polaris-Pagination__TablePaginationActions"};function Ko({hasNext:e,hasPrevious:n,nextURL:r,previousURL:a,onNext:o,onPrevious:s,nextTooltip:c,previousTooltip:l,nextKeys:d,previousKeys:p,accessibilityLabel:m,accessibilityLabels:b,label:h,type:f="page"}){const v=we(),S=u.createRef(),w=m||v.translate("Polaris.Pagination.pagination"),I=(b==null?void 0:b.previous)||v.translate("Polaris.Pagination.previous"),y=(b==null?void 0:b.next)||v.translate("Polaris.Pagination.next"),N=t.createElement(oe,{icon:Vn,accessibilityLabel:I,url:a,onClick:s,disabled:!n,id:"previousURL"}),T=l&&n?t.createElement(ft,{activatorWrapper:"span",content:l,preferredPosition:"below"},N):N,B=t.createElement(oe,{icon:Xn,accessibilityLabel:y,url:r,onClick:o,disabled:!e,id:"nextURL"}),k=c&&e?t.createElement(ft,{activatorWrapper:"span",content:c,preferredPosition:"below"},B):B,E=s||_n,P=p&&(a||s)&&n&&p.map(D=>t.createElement(ht,{key:D,keyCode:D,handler:St(a?jn("previousURL",S):E)})),A=o||_n,_=d&&(r||o)&&e&&d.map(D=>t.createElement(ht,{key:D,keyCode:D,handler:St(r?jn("nextURL",S):A)}));if(f==="table"){const D=h?t.createElement(H,{padding:"300",paddingBlockStart:"0",paddingBlockEnd:"0"},t.createElement(x,{as:"span",variant:"bodySm",fontWeight:"medium"},h)):null;return t.createElement("nav",{"aria-label":w,ref:S,className:M(Pt.Pagination,Pt.table)},P,_,t.createElement(H,{background:"bg-surface-secondary",paddingBlockStart:"150",paddingBlockEnd:"150",paddingInlineStart:"300",paddingInlineEnd:"200"},t.createElement(Se,{align:"center",blockAlign:"center"},t.createElement("div",{className:Pt.TablePaginationActions,"data-buttongroup-variant":"segmented"},t.createElement("div",null,T),D,t.createElement("div",null,k)))))}const Z=e&&n?t.createElement("span",null,h):t.createElement(x,{tone:"subdued",as:"span"},h),R=h?t.createElement(H,{padding:"300",paddingBlockStart:"0",paddingBlockEnd:"0"},t.createElement("div",{"aria-live":"polite"},Z)):null;return t.createElement("nav",{"aria-label":w,ref:S,className:Pt.Pagination},P,_,t.createElement(kr,{variant:"segmented"},T,R,k))}function jn(e,n){return()=>{if(n.current==null)return;const r=n.current.querySelector(`#${e}`);r&&r.click()}}function St(e){return()=>{Jo()||e()}}function _n(){}function Tr(){const e=u.useContext(ha);if(!e)throw new Error("No mediaQuery was provided. Your application must be wrapped in an <AppProvider>
1 component. See https://polaris.shopify.com/components/app-provider for implementation instructions.");return e}var Ge={Layout:"Polaris-Layout",Section:"Polaris-Layout__Section","Section-fullWidth":"Polaris-Layout__Section--fullWidth","Section-oneHalf":"Polaris-Layout__Section--oneHalf","Section-oneThird":"Polaris-Layout__Section--oneThird",AnnotatedSection:"Polaris-Layout__AnnotatedSection",AnnotationWrapper:"Polaris-Layout__AnnotationWrapper",AnnotationContent:"Polaris-Layout__AnnotationContent",Annotation:"Polaris-Layout__Annotation"},Ln={TextContainer:"Polaris-TextContainer",spacingTight:"Polaris-TextContainer--spacingTight",spacingLoose:"Polaris-TextContainer--spacingLoose"};function ei({spacing:e,children:n}){const r=M(Ln.TextContainer,e&&Ln[ie("spacing",e)]);return t.createElement("div",{className:r},n)}function ti({children:e,title:n,description:r,id:a}){const o=typeof r=="string"?t.createElement(x,{as:"p",variant:"bodyMd"},r):r;return t.createElement("div",{className:Ge.AnnotatedSection},t.createElement("div",{className:Ge.AnnotationWrapper},t.createElement("div",{className:Ge.Annotation},t.createElement(ei,{spacing:"tight"},t.createElement(x,{id:a,variant:"headingMd",as:"h2"},n),o&&t.createElement(H,{color:"text-secondary"},o))),t.createElement("div",{className:Ge.AnnotationContent},e)))}function Ir({children:e,variant:n}){const r=M(Ge.Section,Ge[`Section-${n}`]);return t.createElement("div",{className:r},e)}const Be=function({sectioned:n,children:r}){const a=n?t.createElement(Ir,null,r):r;return t.createElement("div",{className:Ge.Layout},a)};Be.AnnotatedSection=ti;Be.Section=Ir;function ut(e){return!u.isValidElement(e)&&e!==void 0}function At(e){return u.isValidElement(e)&&e!==void 0}var wt={Page:"Polaris-Page",fullWidth:"Polaris-Page--fullWidth",narrowWidth:"Polaris-Page--narrowWidth",Content:"Polaris-Page__Content"},ae={TitleWrapper:"Polaris-Page-Header__TitleWrapper",TitleWrapperExpand:"Polaris-Page-Header__TitleWrapperExpand",BreadcrumbWrapper:"Polaris-Page-Header__BreadcrumbWrapper",PaginationWrapper:"Polaris-Page-Header__PaginationWrapper",PrimaryActionWrapper:"Polaris-Page-Header__PrimaryActionWrapper",Row:"Polaris-Page-Header__Row",mobileView:"Polaris-Page-Header--mobileView",RightAlign:"Polaris-Page-Header__RightAlign",noBreadcrumbs:"Polaris-Page-Header--noBreadcrumbs",AdditionalMetaData:"Polaris-Page-Header__AdditionalMetaData",Actions:"Polaris-Page-Header__Actions",longTitle:"Polaris-Page-Header--longTitle",mediumTitle:"Polaris-Page-Header--mediumTitle",isSingleRow:"Polaris-Page-Header--isSingleRow"},Qe={Title:"Polaris-Header-Title",TitleWithSubtitle:"Polaris-Header-Title__TitleWithSubtitle",TitleWrapper:"Polaris-Header-Title__TitleWrapper",SubTitle:"Polaris-Header-Title__SubTitle",SubtitleCompact:"Polaris-Header-Title__SubtitleCompact",SubtitleMaxWidth:"Polaris-Header-Title__SubtitleMaxWidth"};function ni({title:e,subtitle:n,titleMetadata:r,compactTitle:a,hasSubtitleMaxWidth:o}){const s=M(Qe.Title,n&&Qe.TitleWithSubtitle),c=e?t.createElement("h1",{className:s},t.createElement(x,{as:"span",variant:"headingLg",fontWeight:"bold"},e)):null,l=r?t.createElement(Yo,{marginBlock:"100"},r):null,d=t.createElement("div",{className:Qe.TitleWrapper},c,l),p=n?t.createElement("div",{className:M(Qe.SubTitle,a&&Qe.SubtitleCompact,o&&Qe.SubtitleMaxWidth)},t.createElement(x,{as:"p",variant:"bodySm",tone:"subdued"},n)):null;return t.createElement(t.Fragment,null,d,p)}const ri=20,ai=8,Rn=34;function oi({title:e,subtitle:n,pageReadyAccessibilityLabel:r,titleMetadata:a,additionalMetadata:o,titleHidden:s=!1,primaryAction:c,pagination:l,filterActions:d,backAction:p,secondaryActions:m=[],actionGroups:b=[],compactTitle:h=!1,onActionRollup:f}){const v=we(),{isNavigationCollapsed:S}=Tr(),w=!c&&!l&&(ut(m)&&!m.length||At(m))&&!b.length,I=b.length>0||ut(m)&&m.length>0||At(m),y=p?t.createElement("div",{className:ae.BreadcrumbWrapper},t.createElement(H,{maxWidth:"100%",paddingInlineEnd:"100",printHidden:!0},t.createElement(Qo,{backAction:p}))):null,N=l&&!S?t.createElement("div",{className:ae.PaginationWrapper},t.createElement(H,{printHidden:!0},t.createElement(Ko,Object.assign({},l,{hasPrevious:l.hasPrevious,hasNext:l.hasNext})))):null,T=t.createElement("div",{className:M(ae.TitleWrapper,!I&&ae.TitleWrapperExpand)}
1,t.createElement(ni,{title:e,subtitle:n,titleMetadata:a,compactTitle:h,hasSubtitleMaxWidth:I})),B=r||e,k=B?t.createElement("div",{role:"status"},t.createElement(x,{visuallyHidden:!0,as:"p"},v.translate("Polaris.Page.Header.pageReadyAccessibilityLabel",{title:B}))):void 0,E=c?t.createElement(ii,{primaryAction:c}):null;let P=null;ut(m)&&(m.length>0||Wo(b))?P=t.createElement(Oo,{actions:m,groups:b,rollup:S,rollupActionsLabel:e?v.translate("Polaris.Page.Header.rollupActionsLabel",{title:e}):void 0,onActionRollup:f}):At(m)&&(P=t.createElement(t.Fragment,null,m));const A=y||N?t.createElement(H,{printHidden:!0,paddingBlockEnd:"100",paddingInlineEnd:P&&S?"1000":void 0},t.createElement(Se,{gap:"400",align:"space-between",blockAlign:"center"},y,N)):null,_=o?t.createElement("div",{className:ae.AdditionalMetaData},t.createElement(x,{tone:"subdued",as:"span",variant:"bodySm"},o)):null,Z=M(w&&ae.isSingleRow,A&&ae.hasNavigation,P&&ae.hasActionMenu,S&&ae.mobileView,!p&&ae.noBreadcrumbs,e&&e.length<Rn&&ae.mediumTitle,e&&e.length>Rn&&ae.longTitle),{slot1:R,slot2:D,slot3:j,slot4:O,slot5:U}=li({actionMenuMarkup:P,additionalMetadataMarkup:_,breadcrumbMarkup:y,isNavigationCollapsed:S,pageTitleMarkup:T,paginationMarkup:N,primaryActionMarkup:E,title:e});return t.createElement(H,{position:"relative",paddingBlockStart:{xs:"400",md:"600"},paddingBlockEnd:{xs:"400",md:"600"},paddingInlineStart:{xs:"400",sm:"0"},paddingInlineEnd:{xs:"400",sm:"0"},visuallyHidden:s},k,t.createElement("div",{className:Z},t.createElement(Ra,{filterActions:!!d},t.createElement(Dt,{condition:[R,D,j,O].some(Ct)},t.createElement("div",{className:ae.Row},R,D,t.createElement(Dt,{condition:[j,O].some(Ct)},t.createElement("div",{className:ae.RightAlign},t.createElement(Io,{condition:[j,O].every(Ct),wrapper:$=>t.createElement("div",{className:ae.Actions},$)},j,O))))),t.createElement(Dt,{condition:[U].some(Ct)},t.createElement("div",{className:ae.Row},t.createElement(Se,{gap:"400"},U))))))}function ii({primaryAction:e}){const{isNavigationCollapsed:n}=Tr();let r;if(ut(e)){const{primary:a,helpText:o}=e,s=a===void 0?!0:a,c=ir(si(n,e),{variant:s?"primary":void 0});r=o?t.createElement(ft,{content:o},c):c}else r=e;return t.createElement("div",{className:ae.PrimaryActionWrapper},t.createElement(H,{printHidden:!0},r))}function si(e,n){let{content:r,accessibilityLabel:a}=n;const{icon:o}=n;return o==null?{...n,icon:void 0}:(e&&(a=a||r,r=void 0),{...n,content:r,accessibilityLabel:a,icon:o})}function Ct(e){return e!=null}function li({actionMenuMarkup:e,additionalMetadataMarkup:n,breadcrumbMarkup:r,isNavigationCollapsed:a,pageTitleMarkup:o,paginationMarkup:s,primaryActionMarkup:c,title:l}){const d={mobileCompact:{slots:{slot1:null,slot2:o,slot3:e,slot4:c,slot5:n},condition:a&&r==null&&l!=null&&l.length<=ai},mobileDefault:{slots:{slot1:r,slot2:o,slot3:e,slot4:c,slot5:n},condition:a},desktopCompact:{slots:{slot1:r,slot2:o,slot3:e,slot4:c,slot5:n},condition:!a&&s==null&&e==null&&l!=null&&l.length<=ri},desktopDefault:{slots:{slot1:r,slot2:o,slot3:t.createElement(t.Fragment,null,e,c),slot4:s,slot5:n},condition:!a}};return(Object.values(d).find(m=>m.condition)||d.desktopDefault).slots}function ci({children:e,fullWidth:n,narrowWidth:r,...a}
1){const o=M(wt.Page,n&&wt.fullWidth,r&&wt.narrowWidth),s=a.title!=null&&a.title!==""||a.subtitle!=null&&a.subtitle!==""||a.primaryAction!=null||a.secondaryActions!=null&&(ut(a.secondaryActions)&&a.secondaryActions.length>0||At(a.secondaryActions))||a.actionGroups!=null&&a.actionGroups.length>0||a.backAction!=null,c=M(!s&&wt.Content),l=s?t.createElement(oi,Object.assign({filterActions:!0},a)):null;return t.createElement("div",{className:o},l,t.createElement("div",{className:c},e))}function di({eligible:e,appStoreReviewUrl:n}){const[r,a]=u.useState(!1),[o,s]=u.useState(!1);if(!e||r)return null;const c=p=>{const m=new FormData;m.append("action",p),fetch("/api/review-prompt",{method:"POST",body:m}).catch(()=>{})},l=()=>{a(!0),c("dismiss")},d=async p=>{var h;const m=typeof window<"u"?window.shopify:null,b=(h=m==null?void 0:m.reviews)==null?void 0:h.request;if(!b){c("dismiss"),a(!0);return}p.preventDefault(),s(!0);try{const f=await b.call(m.reviews);(f==null?void 0:f.code)==="already-reviewed"?c("responded"):(c("dismiss"),f!=null&&f.success||window.open(n,"_blank","noopener,noreferrer"))}catch(f){console.warn("App Bridge review request failed â opening the App Store review page instead.",f),c("dismiss"),window.open(n,"_blank","noopener,noreferrer")}finally{s(!1),a(!0)}};return i.jsx(zo,{tone:"info",title:"How's it going so far?",onDismiss:l,children:i.jsxs(xe,{gap:"300",children:[i.jsx(x,{as:"p",children:"We value your feedback! It helps us improve our product. Let us know how we're doing."}),i.jsxs(Se,{gap:"200",children:[i.jsx(oe,{variant:"primary",url:n,external:!0,onClick:d,loading:o,children:"Leave a review"}),i.jsx(oe,{onClick:l,children:"Not now"})]})]})})}const kt={free:"Free",starter:"Starter",growth:"Growth",enterprise:"Enterprise"};function fi(){var Ze,bt,qe;const{shopDomain:e,appUrl:n,products:r,galleryProducts:a,aiCredits:o,activeTemplateName:s,templates:c,access:l,productCount:d,pricingUrl:p,showReviewPrompt:m,appStoreReviewUrl:b}=Qr(),h=Jr(),[f,v]=u.useState(s||"Tech Neon Accent"),S=c.filter(g=>g.group==="core"),w=c.filter(g=>g.group==="occasion"),I=new Set(c.filter(g=>g.allowed).map(g=>g.name)),y=!(l!=null&&l.active),N=(l==null?void 0:l.productLimit)==null?"Unlimited":l.productLimit,[T,B]=u.useState("idle"),[k,E]=u.useState(0),[P,A]=u.useState(null),[_,Z]=u.useState("idle"),[R,D]=u.useState(0),[j,O]=u.useState(null),[U,$]=u.useState(!1),[X,te]=u.useState(new Set),[se,Y]=u.useState(((Ze=c.find(g=>g.allowed))==null?void 0:Ze.name)||c[0].name),[K,ue]=u.useState(((bt=w.find(g=>g.allowed))==null?void 0:bt.name)||((qe=w[0])==null?void 0:qe.name)||""),G=_==="running",V=T==="running",ge=`${n}/feeds/${e}/meta.xml`,re=g=>{te(q=>{const W=new Set(q);return W.has(g)?W.delete(g):W.add(g),W})},ye=async(g,q)=>{if(!(G||V||y)&&I.has(g)){q||v(g),Z("running"),D(0),O(null);try{const W=new FormData;W.append("mode","set"),W.append("templateName",g),q&&W.append("productIds",JSON.stringify(q));const Q=await fetch("/api/template",{method:"POST",body:W});if(Q.status===402)throw h.revalidate(),new Error("You don't have an active plan â choose one to keep restyling.");if(Q.status===409)throw new Error("Another restyle is already running for this shop â wait for it to finish and try again.");if(!Q.ok)throw new Error(`Could not switch template (HTTP ${Q.status})`);const Ce=await Q.json();if(Ce.error)throw new Error(Ce.error);const ke=Ce.cutoff,z=Ce.jobId;let Ie=0;for(let he=0;he<500;he++){const Ne=new FormData;Ne.append("mode","regen"),Ne.append("cutoff",ke),Ne.append("templateName",g),Ne.append("jobId",z),q&&Ne.append("productIds",JSON.stringify(q));let je=null;for(let $e=0;$e<3;$e++){const Re=await fetch("/api/template",{method:"POST",body:Ne});if(Re.status===409)throw new Error("This restyle was superseded by another run â please retry.");if(Re.ok){je=await Re.json();break}if($e===2)throw new Error(`Image regeneration failed (HTTP ${Re.status})`);await new Promise(Ve=>setTimeout(Ve,1500))}if(je.error)throw new Error(je.error);if(Ie+=je.processedInBatch||0,D(Ie),!je.hasMore)break}Z("done"),q&&(te(new Set),$(!1)),h.revalidate()}catch(W){O(W.message||"Could not switch template"),Z("error")}}},pe=g=>ye(g,null),le=()=>ye(se,Array.from(X)),ce=()=>ye(K,null),ee=r.length>0,Le=ee?r.map(g=>{var q;return{id:g.id,title:g.title,rawImageUrl:g.rawImageUrl,adImageUrl:g.adImageUrl,tags:((q=g.aiGeneratedTags)==null?void 0:q.join(", "))||""}}):[],We=async()=>
1{if(G||V||y)return;B("running"),E(0),A(null);let g=null,q=0,W=!1;try{for(let Q=0;Q<500;Q++){const Ce=new FormData;g&&Ce.append("cursor",g);let ke=null;for(let z=0;z<3;z++){const Ie=await fetch("/api/sync",{method:"POST",body:Ce});if(Ie.status===402)throw h.revalidate(),new Error("You don't have an active plan â choose one to keep syncing.");if(Ie.ok){ke=await Ie.json();break}if(z===2)throw new Error(`Sync request failed (HTTP ${Ie.status})`);await new Promise(he=>setTimeout(he,1500))}if(ke.error)throw new Error(ke.error);if(q+=ke.processedInBatch||0,E(q),ke.limitReached){W=!0;break}if(!ke.hasNextPage)break;g=ke.endCursor}B(W?"limit":"done"),h.revalidate()}catch(Q){A(Q.message||"Sync failed"),B("error")}},gt=[{n:1,done:ee,title:"Sync your catalog",body:"Click âSync Entire Catalogâ to pull in your products and generate their ad creatives."},{n:2,done:ee,title:"Pick your ad style",body:"Choose a template â including seasonal styles for major occasions â every ad restyles instantly."},{n:3,done:!1,title:"Copy your feed URL",body:"Use the âCopy to Clipboardâ button in the feed box below."},{n:4,done:!1,title:"Connect it to Meta & TikTok",body:"Paste the feed URL into your Meta or TikTok catalog (expand the guide below)."}];return i.jsx(ci,{title:"Dynamic Catalog Creative Factory",children:i.jsxs(Be,{children:[i.jsx(Be.Section,{children:y?i.jsx(He,{children:i.jsxs(xe,{gap:"300",children:[i.jsx(x,{variant:"headingLg",as:"h2",children:"ð Get started"}),i.jsxs(x,{variant:"bodyMd",as:"p",tone:"subdued",children:["Pick a plan to start generating your ad creatives â try ",i.jsx("strong",{children:"Free"})," with no commitment, or subscribe to a paid plan for a higher product limit and more templates (cancel anytime). Billing is handled securely by Shopify on your regular invoice."]}),i.jsx("div",{style:{display:"flex",gap:"1rem",flexWrap:"wrap",marginTop:"0.25rem"},children:[{name:"Free",price:"$0/mo",limit:"Up to 10 products, 2 templates"},{name:"Starter",price:"$49/mo",limit:"Up to 500 products"},{name:"Growth",price:"$149/mo",limit:"Up to 2,500 products + seasonal templates"},{name:"Enterprise",price:"$399/mo",limit:"Unlimited + real-time stock sync + every template"}].map(g=>i.jsxs("div",{style:{flex:"1 1 200px",border:"1px solid var(--app-border)",borderRadius:"12px",padding:"1.25rem",textAlign:"center",background:"var(--app-card)"},children:[i.jsx(x,{variant:"headingMd",as:"h3",children:g.name}),i.jsx("div",{style:{fontSize:"24px",fontWeight:700,color:"var(--app-neon-green)",margin:"0.35rem 0"},children:g.price}),i.jsx(x,{variant:"bodySm",as:"p",tone:"subdued",children:g.limit})]},g.name))}),i.jsx("div",{children:i.jsx("a",{href:p,target:"_top",style:{display:"inline-block",background:"var(--app-neon-green)",color:"#0d0d14",fontWeight:600,padding:"0.7rem 1.4rem",borderRadius:"8px",textDecoration:"none"},children:"Choose your plan â"})}),i.jsx(x,{variant:"bodySm",as:"p",tone:"subdued",children:"Cancelled or between plans? Any existing feed keeps serving live ads even without an active plan."})]})}):i.jsx(He,{children:i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:"1rem",flexWrap:"wrap"},children:[i.jsxs(x,{variant:"bodyMd",as:"p",children:[l.source==="trial"?`ð ${l.plan} â free trial, ${l.trialDaysLeft} day${l.trialDaysLeft===1?"":"s"} left. `:`â ${l.plan} plan active. `,i.jsxs("span",{style:{color:"var(--app-text-subdued)"},children:[d," / ",N," products used."]})]}),i.jsx("a",{href:p,target:"_top",style:{fontWeight:600,color:"var(--app-neon-green)",textDecoration:"none"},children:l.source==="trial"?"Manage / change plan â":"Manage plan â"})]})})}),i.jsx(Be.Section,{children:i.jsx(di,{eligible:m,appStoreReviewUrl:b})}),i.jsx(Be.Section,{children:i.jsx(He,{children:i.jsxs(xe,{gap:"300",children:[i.jsx(x,{variant:"headingMd",as:"h2",children:"ð Getting Started"}),i.jsx(x,{variant:"bodyMd",as:"p",tone:"subdued",children:"New to product ad feeds? Follow these four steps â it takes about 5 minutes, no design or ad experience needed."}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.85rem",marginTop:"0.25rem"},children:gt.map(g=>i.jsxs("div",{style:{display:"flex",gap:"0.75rem",alignItems:"flex-start"},children:[i.jsx("div",{style:{flex:"0 0 auto",width:"28px",height:"28px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",background:g.done?"var(--app-neon-green)":"var(--app-border)",color:g.done?"#fff":"var(--app-text-subdued)",fontWeight:700,fontSize:"14px"},children:g.done?"â":g.n}),i.jsxs("div",{children:[i.jsx(x,{variant:"headingSm",as:"h3",children:g.title}),i.jsx(x,{variant:"bodySm",as:"p",tone:"subdued",children:g.body})]})]},g.n))}),!ee&&i.jsx("div",{children:i.jsx(oe,{variant:"primary",loading:V,disabled:y,onClick:We,children:V?`Syncing⦠${k} done`:"Sync Entire Catalog"})}),i.jsxs("details",{style:{border:"1px solid var(--app-border)",borderRadius:"8px",padding:"0.85rem 1rem",background:"var(--app-card)"},children:[i.jsx("summary",{style:{cursor:"pointer",fontWeight:600},children:"ð¡ How to connect your feed to Meta & TikTok"}),i.jsxs("div",{style:{marginTop:"0.85rem"},children:[i.jsx(x,{variant:"headingSm",as:"h4",children:"Meta (Facebook & Instagram)"}),i.jsxs("ol",{style:{paddingLeft:"1.25rem",marginTop:"0.4rem",marginBottom:"0.85rem",lineHeight:1.6},children:[i.jsxs("li",{children:[i.jsx("strong",{children:"Sync your catalog in this app first"}),' (button above) â an empty feed uploads fine but shows "0 products" in Meta.']}),i.jsxs("li",{children:["Open ",i.jsx("a",{href:"https://business.facebook.com/commerce",target:"_blank",rel:"noopener noreferrer",children:"Meta Commerce Manager"}),". No catalog yet? Click ",i.jsx("strong",{children:"Add products"}),' on the "Get started" page, choose ',i.jsx("strong",{children:"Online products"}),", leave ",i.jsx("strong",{children:'"Connect to a partner platform" OFF'}),", then skip through tracking/permissions and pick ",i.jsx("strong",{children:'"Connect to a data feed"'}),". Already have a catalog? Go to ",i.jsx("strong",{children:"Catalog â Data sources â Add items â Data file"})," instead."]}),i.jsxs("li",{children:["Keep ",i.jsx("strong",{children:'"Use a URL or Google sheets"'})," selected and ",i.jsx("strong",{children:"type your feed URL in manually"})," (don't rely on autofill â it can substitute an old URL). Set currency to match your store's actual currency and frequency to Daily, then upload."]})]}),i.jsx(x,{variant:"headingSm",as:"h4",children:"TikTok"}),i.jsxs("ol",{style:{paddingLeft:"1.25rem",marginTop:"0.4rem",marginBottom:"0.6rem",lineHeight:1.6},children:[i.jsxs("li",{children:["Open ",i.jsx("a",{href:"https://ads.tiktok.com",target:"_blank",rel:"noopener noreferrer",children:"TikTok Ads Manager"}),". Use the app launcher (9-dot grid) â ",i.jsx("strong",{children:"Ads Manager"}
1),' (not "Business Center") â pick your account, then ',i.jsx("strong",{children:"Assets â Catalog Manager"}),"."]}),i.jsxs("li",{children:['Existing catalog synced via "partner platform" (native Shopify)? Its Add Products will be greyed out â ',i.jsx("strong",{children:"create a new catalog"}),' instead (catalog dropdown â Create catalog â "Manual creation"). ',i.jsx("strong",{children:"Set Default Currency to match your store's real currency"})," â it can't be changed later."]}),i.jsxs("li",{children:["Choose ",i.jsx("strong",{children:'"Data Feed Schedule"'}),", type the feed URL in manually, set Daily, and pick ",i.jsx("strong",{children:'"Replace your feed"'})," as the update method so deleted products actually drop off."]})]}),i.jsx("a",{href:`${n}/help`,target:"_blank",rel:"noopener noreferrer",style:{fontWeight:600,color:"var(--app-neon-green)"},children:"Open the full step-by-step setup guide & FAQ â"})]})]})]})})}),i.jsx(Be.Section,{children:i.jsx(He,{children:i.jsxs(xe,{gap:"300",children:[i.jsx(x,{variant:"headingMd",as:"h2",children:"Catalog Sync & AI Credits"}),i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:"20px",flexWrap:"wrap"},children:[i.jsxs("div",{style:{flex:"1 1 300px"},children:[i.jsxs(x,{variant:"headingMd",as:"h3",children:["Available AI Credits: ",i.jsx("span",{style:{color:o>0?"var(--app-neon-green)":"var(--app-neon-pink)"},children:o})]}),i.jsx("div",{style:{marginTop:"0.5rem"},children:i.jsx(x,{variant:"bodySm",as:"p",tone:"subdued",children:'Each product synced uses 1 AI Credit to generate smart marketing tags via Google Gemini. If you run out, the app will continue to work perfectly using generic fallback tags (e.g. "BEST SELLER") at no cost to you.'})})]}),i.jsx("div",{style:{flex:"0 0 auto"},children:i.jsx(oe,{variant:"primary",loading:V,disabled:y,onClick:We,children:V?`Syncing⦠${k} done`:"Sync Entire Catalog"})})]}),T==="limit"&&i.jsx("div",{style:{padding:"0.75rem",backgroundColor:"rgba(255, 184, 77, 0.1)",borderRadius:"8px",border:"1px solid rgba(255, 184, 77, 0.5)"},children:i.jsxs(x,{variant:"bodyMd",as:"p",children:["Synced ",k," product",k===1?"":"s"," â youâve reached your planâs product limit (",N,"). ",i.jsx("a",{href:p,target:"_top",style:{fontWeight:600,color:"var(--app-neon-green)"},children:"Upgrade your plan"})," to sync more."]})}),T==="running"&&i.jsx("div",{style:{padding:"0.75rem",backgroundColor:"rgba(0, 230, 118, 0.05)",borderRadius:"8px",border:"1px solid rgba(0, 230, 118, 0.2)"},children:i.jsxs(x,{variant:"bodyMd",as:"p",children:["âï¸ Generating ad creatives⦠",k," product",k===1?"":"s"," done so far. This can take a moment for large catalogs â please keep this tab open."]})}),T==="done"&&i.jsx("div",{style:{padding:"0.75rem",backgroundColor:"rgba(0, 230, 118, 0.1)",borderRadius:"8px",border:"1px solid var(--app-neon-green)"},children:i.jsxs(x,{variant:"bodyMd",as:"p",fontWeight:"bold",children:["â Synced ",k," product",k===1?"":"s",". Your ad creatives are ready below."]})}),T==="error"&&i.jsx("div",{style:{padding:"0.75rem",backgroundColor:"rgba(255, 23, 101, 0.1)",borderRadius:"8px",border:"1px solid var(--app-neon-pink)"},children:i.jsxs(x,{variant:"bodyMd",as:"p",children:["Sync stopped: ",P,". ",k>0?`${k} product${k===1?"":"s"} were synced before it stopped. `:"","Click âSync Entire Catalogâ again to resume â already-synced products are skipped, so no credits are wasted."]})})]})})}),i.jsx(Be.Section,{children:i.jsx(He,{children:i.jsxs(xe,{gap:"300",children:[i.jsx(x,{variant:"headingMd",as:"h2",children:"Your Ad Feed â connect it to Meta & TikTok"}),i.jsx(x,{variant:"bodyMd",as:"p",children:"This is the one link that delivers your generated ad creatives to your ad platforms. Copy it, then follow the steps below for each platform you run ads on. You only do this once â after that, your ads stay in sync automatically."}),i.jsx("input",{type:"text",value:ge,readOnly:!0,style:{width:"100%",padding:"0.8rem",borderRadius:"4px",border:"1px solid var(--app-border)",fontSize:"14px",fontFamily:"monospace"},onClick:g=>g.target.select()}),i.jsx("div",{children:i.jsx(oe,{variant:"primary",onClick:()=>navigator.clipboard.writeText(ge),children:"Copy feed URL"})}),i.jsxs("div",{style:{display:"flex",gap:"1rem",flexWrap:"wrap",marginTop:"0.25rem"},children:[i.jsxs("div",{style:{flex:"1 1 280px",border:"1px solid var(--app-border)",borderRadius:"10px",padding:"1rem 1.1rem",background:"var(--app-card)"},children:[i.jsx(x,{variant:"headingSm",as:"h3",children:"ð Facebook & Instagram (Meta)"}),i.jsxs("ol",{style:{paddingLeft:"1.1rem",marginTop:"0.5rem",fontSize:"14px",lineHeight:1.6,color:"var(--app-text-subdued)"},children:[i.jsxs("li",{children:[i.jsx("strong",{children:"Sync your catalog in this app first"}),' â an empty feed uploads fine but shows "0 products" in Meta.']}),i.jsxs("li",{children:["Open ",i.jsx("a",{href:"https://business.facebook.com/commerce",target:"_blank",rel:"noopener noreferrer",style:{color:"var(--app-neon-green)"},children:"Meta Commerce Manager"}),". No catalog yet? Click ",i.jsx("strong",{children:"Add products"}),' on the "Get started" page, choose ',i.jsx("strong",{children:"Online products"}),", leave ",i.jsx("strong",{children:'"Connect to a partner platform" OFF'}),", then skip through tracking/permissions and pick ",i.jsx("strong",{children:'"Connect to a data feed."'})," Already have a catalog? Go to ",i.jsx("strong",{children:"Catalog â Data sources â Add items â Data file"})," instead."]}),i.jsxs("li",{children:["Keep ",i.jsx("strong",{children:'"Use a URL or Google sheets"'})," selected and ",i.jsx("strong",{children:"type the feed URL in manually"})," (autofill can substitute an old URL). Set a ",i.jsx("strong",{children:"Daily"})," schedule and upload."]})]}),i.jsx(x,{variant:"bodySm",as:"p",tone:"subdued",children:"One catalog powers ads on both Facebook and Instagram."})]}),i.jsxs("div",{style:{flex:"1 1 280px",border:"1px solid var(--app-border)",borderRadius:"10px",padding:"1rem 1.1rem",background:"var(--app-card)"},children:[i.jsx(x,{variant:"headingSm",as:"h3",children:"ðµ TikTok"}),i.jsxs("ol",{style:{paddingLeft:"1.1rem",marginTop:"0.5rem",fontSize:"14px",lineHeight:1.6,color:"var(--app-text-subdued)"},children:[i.jsxs("li",{children:["Open ",i.jsx("a",{href:"https://ads.tiktok.com",target:"_blank",rel:"noopener noreferrer",style:{color:"var(--app-neon-green)"},children:"TikTok Ads Manager"}),". Use the app launcher (9-dot grid) â ",i.jsx("strong",{children:"Ads Manager"}
1),' (not "Business Center") â pick your account, then ',i.jsx("strong",{children:"Assets â Catalog Manager"}),"."]}),i.jsxs("li",{children:['Existing catalog synced via "partner platform" (native Shopify)? Add Products will be greyed out â ',i.jsx("strong",{children:"create a new catalog"}),' instead (catalog dropdown â Create catalog â "Manual creation"). ',i.jsx("strong",{children:"Set Default Currency to match your store's real currency"})," â it can't be changed later."]}),i.jsxs("li",{children:["Choose ",i.jsx("strong",{children:'"Data Feed Schedule,"'})," type the feed URL in manually, set ",i.jsx("strong",{children:"Daily"}),", and pick ",i.jsx("strong",{children:'"Replace your feed"'})," as the update method so deleted products actually drop off."]})]}),i.jsx(x,{variant:"bodySm",as:"p",tone:"subdued",children:"Use the catalog in TikTok Video Shopping / catalog ads."})]})]}),i.jsxs(x,{variant:"bodySm",as:"p",children:["Need the full walkthrough with screenshots and FAQ? ",i.jsx("a",{href:`${n}/help`,target:"_blank",rel:"noopener noreferrer",style:{fontWeight:600,color:"var(--app-neon-green)"},children:"Open the complete setup guide â"}),"  (The feed is a standard Google-Shopping XML, so it also works with Google, Pinterest, and Snapchat catalogs.)"]})]})})}),i.jsx(Be.Section,{children:i.jsx(He,{children:i.jsxs(xe,{gap:"300",children:[i.jsx(x,{variant:"headingMd",as:"h2",children:"Template Selection"}),i.jsxs(x,{variant:"bodyMd",as:"p",children:["Choose the default visual style for your catalog. Clicking a template here regenerates ",i.jsx("strong",{children:"every"})," product ad in that style â including any you've individually restyled below. To style only specific products, use ",i.jsx("strong",{children:'"Select products to restyle"'})," in the gallery further down instead."]}),y&&i.jsx("div",{style:{padding:"0.6rem 0.9rem",background:"rgba(255, 184, 77, 0.1)",border:"1px solid rgba(255, 184, 77, 0.5)",borderRadius:"8px"},children:i.jsx(x,{variant:"bodySm",as:"p",children:"ð Choose a plan (at the top of the page) to generate and restyle ad creatives."})}),i.jsx("div",{style:{display:"flex",gap:"1rem",flexWrap:"wrap"},children:S.map(({name:g,tier:q,allowed:W})=>{const Q=G||V||y,Ce=Q||!W;return i.jsxs("div",{onClick:()=>!Ce&&pe(g),title:W?void 0:`Requires the ${kt[q]} plan or higher`,style:{flex:"1 1 200px",padding:"1.25rem",border:f===g?"2px solid var(--app-neon-green)":"1px solid var(--app-border)",borderRadius:"12px",cursor:W?y?"not-allowed":Q?"wait":"pointer":"not-allowed",opacity:W?Q?.5:1:.45,background:f===g?"rgba(0, 230, 118, 0.1)":"var(--app-card)",transition:"all 0.2s ease",textAlign:"center"},children:[i.jsx(x,{variant:"headingMd",as:"h3",children:g}),f===g&&i.jsx("div",{style:{marginTop:"0.25rem",color:"var(--app-neon-green)",fontWeight:600,fontSize:"13px"},children:"â Active"}),!W&&i.jsxs("div",{style:{marginTop:"0.25rem",color:"var(--app-text-subdued)",fontWeight:600,fontSize:"12px"},children:["ð ",kt[q],"+"]})]},g)})}),_==="done"&&i.jsxs(x,{variant:"bodySm",as:"p",tone:"success",children:["â Restyled ",R," product",R===1?"":"s"," with the â",f,"â template."]}),_==="error"&&i.jsxs(x,{variant:"bodySm",as:"p",tone:"critical",children:["Couldnât finish restyling: ",j,". ",R>0?`${R} done before it stopped. `:"","Click the template again to resume."]}),i.jsxs("div",{style:{borderTop:"1px solid var(--app-border)",marginTop:"0.5rem",paddingTop:"1rem"},children:[i.jsx(x,{variant:"headingSm",as:"h3",children:"ð Seasonal & Occasion Templates"}),i.jsx(x,{variant:"bodySm",as:"p",tone:"subdued",children:"Special styles for major shopping occasions â Diwali, Lunar New Year, Eid, Easter, July 4th, and more. Locked styles are greyed out below; upgrading unlocks them instantly."}),i.jsxs("div",{style:{display:"flex",gap:"0.75rem",alignItems:"center",flexWrap:"wrap",marginTop:"0.75rem"},children:[i.jsx("select",{value:K,onChange:g=>ue(g.target.value),disabled:G||V||y,style:{padding:"0.5rem 0.7rem",borderRadius:"6px",border:"1px solid var(--app-border)",minWidth:"220px"},children:w.map(({name:g,tier:q,allowed:W})=>i.jsxs("option",{value:g,disabled:!W,children:[g,W?"":` (ð ${kt[q]}+ required)`]},g))}),i.jsx(oe,{variant:"primary",loading:G,disabled:G||V||y||!I.has(K),onClick:ce,children:f===K?"â Active":"Apply to entire catalog"})]})]})]})})}),i.jsx(Be.Section,{children:i.jsx(He,{children:i.jsxs(xe,{gap:"300",children:[i.jsx(x,{variant:"headingMd",as:"h2",children:"Ad Creative Preview"}),G&&i.jsxs("div",{style:{padding:"1rem",background:"linear-gradient(90deg, rgba(0, 230, 118, 0.1), rgba(0, 230, 118, 0.2), rgba(0, 230, 118, 0.1))",backgroundSize:"200% 100%",animation:"shimmer 1.5s infinite",borderRadius:"8px",textAlign:"center",fontWeight:600,color:"var(--app-neon-green)"},children:['âï¸ Regenerating images with the "',f,'" template⦠',R," done so far."]}),i.jsx("style",{children:"@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }"}),i.jsxs(x,{variant:"bodyMd",as:"p",tone:"subdued",children:["These are the ad creatives we generate for your Meta & TikTok feed. This app does ",i.jsx("strong",{children:"not"})," change your Shopify product photos â it creates these new ad images and serves them in your feed above."]}),ee&&i.jsx("div",{style:{padding:"0.6rem 0.9rem",background:"rgba(0, 230, 118, 0.1)",border:"1px solid var(--app-neon-green)",borderRadius:"8px"},children:i.jsxs(x,{variant:"bodySm",as:"p",children:["â ",d," product",d===1?"":"s"," generated. Showing the ",Le.length," most recent below â ",i.jsxs("strong",{children:["all ",d," are included in your XML feed."]})," Open the feed URL above to see every one."]})}),!ee&&i.jsxs("div",{style:{marginTop:"0.5rem",padding:"2.5rem 1.5rem",border:"1px dashed var(--app-border)",borderRadius:"12px",background:"var(--app-card)",textAlign:"center"},children:[i.jsx("div",{style:{fontSize:"34px",marginBottom:"0.5rem"},children:"ð"}),i.jsx(x,{variant:"headingMd",as:"h3",children:"No ad creatives yet"}),i.jsx("div",{style:{marginTop:"0.5rem",maxWidth:"440px",marginInline:"auto"},children:i.jsxs(x,{variant:"bodyMd",as:"p",tone:"subdued",children:["Click ",i.jsx("strong",{children:"Sync Entire Catalog"})," (in âGetting Startedâ at the top, or in the Catalog Sync card above) to pull in y
1our products and generate their first ad creatives. It only takes a few seconds."]})})]}),Le.map(g=>i.jsxs("div",{style:{marginTop:"1.5rem",padding:"1.5rem",border:"1px solid var(--app-border)",borderRadius:"12px",background:"var(--app-card)"},children:[i.jsxs("div",{style:{marginBottom:"1rem"},children:[i.jsx(x,{variant:"headingSm",as:"h3",children:g.title}),i.jsxs(x,{variant:"bodySm",as:"p",tone:"success",children:["AI Tags: ",g.tags]})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"1.5rem",flexWrap:"wrap"},children:[i.jsxs("div",{style:{flex:"1 1 250px",textAlign:"center"},children:[i.jsx(x,{variant:"bodySm",as:"p",tone:"subdued",children:"Original Product Image"}),i.jsx("img",{src:g.rawImageUrl,alt:`Original ${g.title}`,loading:"lazy",style:{width:"100%",maxWidth:"300px",borderRadius:"8px",border:"1px solid var(--app-border)",marginTop:"0.5rem",boxShadow:"0 1px 3px rgba(0,0,0,0.08)"}})]}),i.jsx("div",{style:{fontSize:"32px",flex:"0 0 auto"},children:"â"}),i.jsxs("div",{style:{flex:"1 1 250px",textAlign:"center"},children:[i.jsx(x,{variant:"bodySm",as:"p",tone:"subdued",children:"Generated Ad Creative"}),i.jsx("a",{href:g.adImageUrl,target:"_blank",rel:"noopener noreferrer",title:"Click to view full size",children:i.jsx("img",{src:g.adImageUrl,alt:`Generated Ad for ${g.title}`,loading:"lazy",style:{width:"100%",maxWidth:"300px",aspectRatio:"1 / 1",objectFit:"cover",borderRadius:"8px",border:"2px solid var(--app-neon-green)",marginTop:"0.5rem",boxShadow:"0 2px 8px rgba(0, 230, 118,0.15)",cursor:"pointer",opacity:G?.4:1,transition:"opacity 0.3s ease"}})}),G&&i.jsx("div",{style:{marginTop:"0.5rem",color:"var(--app-text-subdued)",fontSize:"13px"},children:"Updating..."})]})]})]},g.id)),ee&&a&&a.length>0&&i.jsxs("div",{style:{marginTop:"1.5rem"},children:[i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:"0.5rem"},children:[i.jsx(x,{variant:"headingSm",as:"h3",children:"All your generated ad creatives"}),i.jsx(oe,{size:"slim",disabled:y||G||V,onClick:()=>{$(g=>!g),te(new Set)},children:U?"Cancel selection":"Select products to restyle"})]}),i.jsx("div",{style:{marginTop:"0.25rem",marginBottom:"0.75rem"},children:i.jsxs(x,{variant:"bodySm",as:"p",tone:"subdued",children:[d," generated · showing ",a.length,". Every one is in your feed.",U?" Click thumbnails to select which ones to restyle.":" Click any to view full size."]})}),U&&X.size>0&&i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem",flexWrap:"wrap",padding:"0.75rem 1rem",marginBottom:"0.75rem",background:"rgba(0, 230, 118, 0.1)",border:"1px solid var(--app-neon-green)",borderRadius:"8px"},children:[i.jsxs(x,{variant:"bodyMd",as:"p",fontWeight:"bold",children:[X.size," selected"]}),i.jsx("select",{value:se,onChange:g=>Y(g.target.value),disabled:G,style:{padding:"0.4rem 0.6rem",borderRadius:"6px",border:"1px solid var(--app-border)"},children:c.map(({name:g,tier:q,allowed:W})=>i.jsxs("option",{value:g,disabled:!W,children:[g,W?"":` (ð ${kt[q]}+ required)`]},g))}),i.jsxs(oe,{variant:"primary",loading:G,onClick:le,children:["Apply to ",X.size," selected"]})]}),i.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(120px, 1fr))",gap:"0.6rem"},children:a.map(g=>{const q=X.has(g.id),W=`${g.title} â ${g.templateName||s}`,Q=i.jsx("img",{src:g.adImageUrl,alt:`Ad creative for ${g.title}`,loading:"lazy",style:{width:"100%",aspectRatio:"1 / 1",objectFit:"cover",borderRadius:"8px",border:q?"3px solid var(--app-neon-green)":"1px solid var(--app-border)",cursor:"pointer"}});return U?i.jsxs("div",{onClick:()=>re(g.id),style:{position:"relative"},title:W,children:[Q,i.jsx("div",{style:{position:"absolute",top:"6px",left:"6px",width:"20px",height:"20px",borderRadius:"4px",border:"2px solid var(--app-card)",background:q?"var(--app-neon-green)":"rgba(0,0,0,0.5)",color:"#0d0d14",fontSize:"13px",fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 1px 3px rgba(0,0,0,0.3)"},children:q?"â":""})]},g.id):i.jsx("a",{href:g.adImageUrl,target:"_blank",rel:"noopener noreferrer",title:W,children:Q},g.id)})}),d>a.length&&i.jsx("div",{style:{marginTop:"0.6rem"},children:i.jsxs(x,{variant:"bodySm",as:"p",tone:"subdued",children:["+ ",d-a.length," more in y
1our feed."]})})]})]})})})]})})}export{fi as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.