1import{S as Te}from"./app.save_draft-zZe1Yr6E.js";import{j as ee,r as O}from"./jsx-runtime-DNGZQ4GM.js";import{c as F}from"./_commonjsHelpers-BosuxZz1.js";import{r as Ve}from"./index-e2j1I1QX.js";import{G as fe}from"./index-BJR1AStw.js";import{_ as $e}from"./lodash-qUBZfgSu.js";const rt=()=>{const e=new Te({length:10}),o=Date.now().toString(36).slice(-5);return`${e.rnd()}${o}`},nt=({isOpen:e,message:o})=>e?ee.jsx("div",{className:"overlay",children:ee.jsxs("div",{className:"modal",children:[ee.jsx("div",{className:"spinner"}),o&&ee.jsx("p",{children:o})]})}):null,it=()=>{const[e,o]=O.useState({isOpen:!1,message:""}),i=n=>{o({isOpen:!0,message:n})},a=()=>{o({isOpen:!1})};return{isOpen:e.isOpen,openSpinner:i,closeSpinner:a,message:e.message}};var Le={},he={};Object.defineProperty(he,"__esModule",{value:!0});he.PopoverPortal=void 0;var xe=O,He=Ve,Ie=function(e){var o=e.container,i=e.element,a=e.scoutElement,n=e.children;return(0,xe.useLayoutEffect)(function(){return o.appendChild(i),o.appendChild(a),function(){o.removeChild(i),o.removeChild(a)}},[o,i,a]),(0,He.createPortal)(n,i)};he.PopoverPortal=Ie;var ge={};(function(e){var o=F&&F.__assign||function(){return o=Object.assign||function(r){for(var t,s=1,l=arguments.length;s<l;s++){t=arguments[s];for(var c in t)Object.prototype.hasOwnProperty.call(t,c)&&(r[c]=t[c])}return r},o.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.getNudgedPopoverRect=e.getNewPopoverRect=e.popoverRectForPosition=e.createContainer=e.rectsAreEqual=e.createRect=e.EMPTY_RECT=void 0,e.EMPTY_RECT={top:0,left:0,right:0,bottom:0,width:0,height:0};var i=function(r){var t=r.top,s=r.left,l=r.width,c=r.height;return{top:t,left:s,width:l,height:c,right:s+l,bottom:t+c}};e.createRect=i;var a=function(r,t){return r===t||(r==null?void 0:r.bottom)===(t==null?void 0:t.bottom)&&(r==null?void 0:r.height)===(t==null?void 0:t.height)&&(r==null?void 0:r.left)===(t==null?void 0:t.left)&&(r==null?void 0:r.right)===(t==null?void 0:t.right)&&(r==null?void 0:r.top)===(t==null?void 0:t.top)&&(r==null?void 0:r.width)===(t==null?void 0:t.width)};e.rectsAreEqual=a;var n=function(r){var t=r.containerStyle,s=r.containerClassName,l=window.document.createElement("div");return s&&(l.className=s),Object.assign(l.style,t),l};e.createContainer=n;var p=function(r,t,s,l,c){var u=t.left+t.width/2,v=t.top+t.height/2,d=s.width,m=s.height,h,b;switch(r){case"left":h=v-m/2,b=t.left-l-d,c==="start"&&(h=t.top),c==="end"&&(h=t.bottom-m);break;case"bottom":h=t.bottom+l,b=u-d/2,c==="start"&&(b=t.left),c==="end"&&(b=t.right-d);break;case"right":h=v-m/2,b=t.right+l,c==="start"&&(h=t.top),c==="end"&&(h=t.bottom-m);break;default:h=t.top-m-l,b=u-d/2,c==="start"&&(b=t.left),c==="end"&&(b=t.right-d);break}return(0,e.createRect)({left:b,top:h,width:d,height:m})};e.popoverRectForPosition=p;var f=function(r,t){var s=r.position,l=r.align,c=r.childRect,u=r.popoverRect,v=r.boundaryRect,d=r.padding,m=r.reposition,h=(0,e.popoverRectForPosition)(s,c,u,d,l),b=m&&(s==="top"&&h.top<v.top+t||s==="left"&&h.left<v.left+t||s==="right"&&h.right>v.right-t||s==="bottom"&&h.bottom>v.bottom-t);return{rect:h,boundaryViolation:b}};e.getNewPopoverRect=f;var R=function(r,t,s){var l=t.top+s,c=t.left+s,u=t.right-s,v=t.bottom-s,d=r.top<l?l:r.top;d=d+r.height>v?v-r.height:d;var m=r.left<c?c:r.left;return m=m+r.width>u?u-r.width:m,(0,e.createRect)(o(o({},r),{top:d,left:m}))};e.getNudgedPopoverRect=R})(ge);var me={},be={};Object.defineProperty(be,"__esModule",{value:!0});be.useElementRef=void 0;var pe=O,ze=ge,Ae=function(e){var o=e.containerClassName,i=e.containerStyle,a=(0,pe.useRef)(),n=(0,pe.useState)(function(){return(0,ze.createContainer)({containerStyle:i,containerClassName:o})})[0];return(0,pe.useLayoutEffect)(function(){n.className=o},[o,n]),(0,pe.useLayoutEffect)(function(){Object.assign(n.style,i)},[i,n]),a.current=n,a};be.useElementRef=Ae;Object.defineProperty(me,"__esModule",{value:!0});me.usePopover=void 0;var Fe=O,ne=ge,Se=be,Ye={position:"fixed",overflow:"visible",top:"0px",left:"0px"},Ze={position:"fixed",top:"0px",left:"0px",width:"0px",height:"0px",visibility:"hidden"},qe=function(e){var o=e.isOpen,i=e.childRef,a=e.positions,n=e.containerClassName,p=e.parentElement,f=e.transform,R=e.transformMode,r=e.align,t=e.padding,s=e.reposition,l=e.boundaryInset,c=e.boundaryElement,u=e.onPositionPopover,v=(0,Se.useElementRef)({containerClassName:"react-tiny-popover-scout",containerStyle:Ze}),d=(0,Se.useElementRef)({containerClassName:n!=null&&n.length>0&&n!=="react-tiny-popover-container"?"react-tiny-popover-container ".concat(n):"react-tiny-popover-container",containerStyle:Ye}),m=(0,Fe.useCallback)(function(h){var b,Y,N=h===void 0?{}:h,Z=N.positionIndex,te=Z===void 0?0:Z,q=N.parentRect,M=q===void 0?p.getBoundingClientRect():q,D=N.childRect,k=D===void 0?(b=i==null?void 0:i.current)===null||b===void 0?void 0:b.getBoundingClientRect():D,$=N.scoutRect,U=$===void 0?(Y=v==null?void 0:v.current)===null||Y===void 0?void 0:Y.getBoundingClientRect():$,B=N.popoverRect,W=B===void 0?d.current.getBoundingClientRect():B,L=N.boundaryRect,P=L===void 0?c===p?M:c.getBoundingClientRect():L;if(!(!k||!M||!o)){if(f&&R==="absolute"){var ae=typeof f=="function"?f({childRect:k,popoverRect:W,parentRect:M,boundaryRect:P,padding:t,align:r,nudgedTop:0,nudgedLeft:0,boundaryInset:l,violations:ne.EMPTY_RECT,hasViolations:!1}):f,G=ae.top,se=ae.left,x=Math.round(M.left+se-U.left),K=Math.round(M.top+G-U.top);d.current.style.transform="translate(".concat(x,"px, ").concat(K,"px)"),u({childRect:k,popoverRect:(0,ne.createRect)({left:x,top:K,width:W.width,height:W.height}),parentRect:M,boundaryRect:P,padding:t,align:r,transform:{top:G,left:se},nudgedTop:0,nudgedLeft:0,boundaryInset:l,violations:ne.EMPTY_RECT,hasViolations:!1});return}var oe=te===a.length,H=oe?a[0]:a[te],I=(0,ne.getNewPopoverRect)({childRect:k,popoverRect:W,boundaryRect:P,position:H,align:r,padding:t,reposition:s},l),z=I.rect,C=I.boundaryViolation;if(C&&s&&!oe){m({positionIndex:te+1,childRect:k,popoverRect:W,parentRect:M,boundaryRect:P});return}var ue=z.top,S=z.left,le=z.width,E=z.height,Re=s&&!oe,ce=(0,ne.getNudgedPopoverRect)(z,P,l),re=ce.left,X=ce.top,y=ue,_=S;Re&&(y=X,_=re),y=Math.round(y-U.top),_=Math.round(_-U.left),d.current.style.transform="translate(".concat(_,"px, ").concat(y,"px)");var w={top:P.top+l-y,left:P.left+l-_,right:_+le-P.right+l,bottom:y+E-P.bottom+l},j={childRect:k,popoverRect:(0,ne.createRect)({left:_,top:y,width:le,height:E}),parentRect:M,boundaryRect:P,position:H,align:r,padding:t,nudgedTop:X-ue,nudgedLeft:re-S,boundaryInset:l,violations:{top:w.top<=0?0:w.top,left
1:w.left<=0?0:w.left,right:w.right<=0?0:w.right,bottom:w.bottom<=0?0:w.bottom},hasViolations:w.top>0||w.left>0||w.right>0||w.bottom>0};if(f){u(j);var ve=typeof f=="function"?f(j):f,T=ve.top,V=ve.left;d.current.style.transform="translate(".concat(Math.round(_+(V??0)),"px, ").concat(Math.round(y+(T??0)),"px)"),j.nudgedLeft+=V??0,j.nudgedTop+=T??0,j.transform={top:T,left:V}}u(j)}},[p,i,v,d,c,o,f,R,a,r,t,s,l,u]);return{positionPopover:m,popoverRef:d,scoutRef:v}};me.usePopover=qe;var ye={};Object.defineProperty(ye,"__esModule",{value:!0});ye.useMemoizedArray=void 0;var _e=O,De=function(e){var o=(0,_e.useRef)(e),i=(0,_e.useMemo)(function(){if(o.current===e)return o.current;if(o.current.length!==e.length)return o.current=e,e;for(var a=0;a<e.length;a+=1)if(e[a]!==o.current[a])return o.current=e,e;return o.current},[e]);return i};ye.useMemoizedArray=De;var we={};Object.defineProperty(we,"__esModule",{value:!0});we.useHandlePrevValues=void 0;var Q=O,Ue=function(e){var o=(0,Q.useRef)(e.positions),i=(0,Q.useRef)(e.reposition),a=(0,Q.useRef)(e.transformMode),n=(0,Q.useRef)(e.transform),p=(0,Q.useRef)(e.boundaryElement),f=(0,Q.useRef)(e.boundaryInset),R=(0,Q.useCallback)(function(){o.current=e.positions,i.current=e.reposition,a.current=e.transformMode,n.current=e.transform,p.current=e.boundaryElement,f.current=e.boundaryInset},[e.boundaryElement,e.boundaryInset,e.positions,e.reposition,e.transform,e.transformMode]);return{prev:{positions:o.current,reposition:i.current,transformMode:a.current,transform:n.current,boundaryElement:p.current,boundaryInset:f.current},updatePrevValues:R}};we.useHandlePrevValues=Ue;var de={},Me=F&&F.__assign||function(){return Me=Object.assign||function(e){for(var o,i=1,a=arguments.length;i<a;i++){o=arguments[i];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},Me.apply(this,arguments)};Object.defineProperty(de,"__esModule",{value:!0});de.useArrowContainer=void 0;var je=O,Be=function(e){var o=e.childRect,i=e.popoverRect,a=e.position,n=e.arrowSize,p=e.arrowColor,f=(0,je.useMemo)(function(){return{padding:n}},[n]),R=(0,je.useMemo)(function(){return Me({position:"absolute"},function(){var r=n*2,t=o.top-i.top+o.height/2-r/2,s=o.left-i.left+o.width/2-r/2,l=n,c=i.width-n,u=i.height-n;switch(s=s<l?l:s,s=s+r>c?c-r:s,t=t<l?l:t,t=t+r>u?u-r:t,t=Number.isNaN(t)?0:t,s=Number.isNaN(s)?0:s,a){case"right":return{borderTop:"".concat(n,"px solid transparent"),borderBottom:"".concat(n,"px solid transparent"),borderRight:"".concat(n,"px solid ").concat(p),left:0,top:t};case"left":return{borderTop:"".concat(n,"px solid transparent"),borderBottom:"".concat(n,"px solid transparent"),borderLeft:"".concat(n,"px solid ").concat(p),right:0,top:t};case"bottom":return{borderLeft:"".concat(n,"px solid transparent"),borderRight:"".concat(n,"px solid transparent"),borderBottom:"".concat(n,"px solid ").concat(p),top:0,left:s};case"top":return{borderLeft:"".concat(n,"px solid transparent"),borderRight:"".concat(n,"px solid transparent"),borderTop:"".concat(n,"px solid ").concat(p),bottom:0,left:s};default:return{display:"hidden"}}}())},[p,n,o.height,o.left,o.top,o.width,i.height,i.left,i.top,i.width,a]);return{arrowContainerStyle:f,arrowStyle:R}};de.useArrowContainer=Be;var Pe={},ie=F&&F.__assign||function(){return ie=Object.assign||function(e){for(var o,i=1,a=arguments.length;i<a;i++){o=arguments[i];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},ie.apply(this,arguments)};Object.defineProperty(Pe,"__esModule",{value:!0});Pe.ArrowContainer=void 0;var Ne=ee,ke=O,We=de,Ge=function(e){var o=e.childRect,i=e.popoverRect,a=e.position,n=e.arrowColor,p=e.arrowSize,f=e.arrowClassName,R=e.arrowStyle,r=e.className,t=e.children,s=e.style,l=(0,We.useArrowContainer)({childRect:o,popoverRect:i,position:a,arrowColor:n,arrowSize:p}),c=l.arrowContainerStyle,u=l.arrowStyle,v=(0,ke.useMemo)(function(){return ie(ie({},c),s)},[c,s]),d=(0,ke.useMemo)(function(){return ie(ie({},u),R)},[u,R]);return(0,Ne.jsxs)("div",{className:r,style:v,children:[(0,Ne.jsx)("div",{style:d,className:f}),t]})};Pe.ArrowContainer=Ge;(function(e){var o=F&&F.__assign||function(){return o=Object.assign||function(u){for(var v,d=1,m=arguments.length;d<m;d++){v=arguments[d];for(var h in v)Object.prototype.hasOwnProperty.call(v,h)&&(u[h]=v[h])}return u},o.apply(this,arguments)};
1Object.defineProperty(e,"__esModule",{value:!0}),e.Popover=e.usePopover=e.ArrowContainer=e.useArrowContainer=void 0;var i=ee,a=O,n=he,p=ge,f=me;Object.defineProperty(e,"usePopover",{enumerable:!0,get:function(){return f.usePopover}});var R=ye,r=we,t=de;Object.defineProperty(e,"useArrowContainer",{enumerable:!0,get:function(){return t.useArrowContainer}});var s=Pe;Object.defineProperty(e,"ArrowContainer",{enumerable:!0,get:function(){return s.ArrowContainer}});var l=["top","left","right","bottom"],c=(0,a.forwardRef)(function(u,v){var d=u.isOpen,m=u.children,h=u.content,b=u.positions,Y=b===void 0?l:b,N=u.align,Z=N===void 0?"center":N,te=u.padding,q=te===void 0?0:te,M=u.reposition,D=M===void 0?!0:M,k=u.parentElement,$=k===void 0?window.document.body:k,U=u.boundaryElement,B=U===void 0?$:U,W=u.containerClassName,L=u.containerStyle,P=u.transform,ae=u.transformMode,G=ae===void 0?"absolute":ae,se=u.boundaryInset,x=se===void 0?0:se,K=u.onClickOutside,oe=u.clickOutsideCapture,H=oe===void 0?!1:oe,I=(0,R.useMemoizedArray)(Array.isArray(Y)?Y:[Y]),z=(0,r.useHandlePrevValues)({positions:I,reposition:D,transformMode:G,transform:P,boundaryElement:B,boundaryInset:x}),C=z.prev,ue=z.updatePrevValues,S=(0,a.useRef)(),le=(0,a.useState)({align:Z,nudgedLeft:0,nudgedTop:0,position:I[0],padding:q,childRect:p.EMPTY_RECT,popoverRect:p.EMPTY_RECT,parentRect:p.EMPTY_RECT,boundaryRect:p.EMPTY_RECT,boundaryInset:x,violations:p.EMPTY_RECT,hasViolations:!1}),E=le[0],Re=le[1],ce=(0,a.useCallback)(function(g){return Re(g)},[]),re=(0,f.usePopover)({isOpen:d,childRef:S,containerClassName:W,parentElement:$,boundaryElement:B,transform:P,transformMode:G,positions:I,align:Z,padding:q,boundaryInset:x,reposition:D,onPositionPopover:ce}),X=re.positionPopover,y=re.popoverRef,_=re.scoutRef;(0,a.useLayoutEffect)(function(){var g=!0,A=function(){var J,Ce;if(d&&g){var Oe=(J=S==null?void 0:S.current)===null||J===void 0?void 0:J.getBoundingClientRect(),Ee=(Ce=y==null?void 0:y.current)===null||Ce===void 0?void 0:Ce.getBoundingClientRect();Oe!=null&&Ee!=null&&(!(0,p.rectsAreEqual)(Oe,E.childRect)||Ee.width!==E.popoverRect.width||Ee.height!==E.popoverRect.height||E.padding!==q||E.align!==Z||I!==C.positions||D!==C.reposition||G!==C.transformMode||P!==C.transform||B!==C.boundaryElement||x!==C.boundaryInset)&&X(),ue(),g&&window.requestAnimationFrame(A)}};return window.requestAnimationFrame(A),function(){g=!1}},[Z,B,x,d,q,y,E.align,E.childRect,E.padding,E.popoverRect.height,E.popoverRect.width,X,I,C.boundaryElement,C.boundaryInset,C.positions,C.reposition,C.transform,C.transformMode,D,P,G,ue]),(0,a.useEffect)(function(){var g=y.current;return Object.assign(g.style,L),function(){Object.keys(L??{}).forEach(function(A){return delete g.style[A]})}},[L,d,y]);var w=(0,a.useCallback)(function(g){var A,J;d&&!(!((A=y.current)===null||A===void 0)&&A.contains(g.target))&&!(!((J=S.current)===null||J===void 0)&&J.contains(g.target))&&(K==null||K(g))},[d,K,y]),j=(0,a.useCallback)(function(){S.current&&window.requestAnimationFrame(function(){return X()})},[X]);(0,a.useEffect)(function(){var g=$.ownerDocument.body;return g.addEventListener("click",w,H),g.addEventListener("contextmenu",w,H),g.addEventListener("resize",j),function(){g.removeEventListener("click",w,H),g.removeEventListener("contextmenu",w,H),g.removeEventListener("resize",j)}},[H,w,j,$]);var ve=(0,a.useCallback)(function(g){S.current=g,v!=null&&(typeof v=="object"?v.current=g:typeof v=="function"&&v(g))},[v]),T=function(){return(0,a.cloneElement)(m,{ref:ve})},V=function(){return d?(0,i.jsx)(n.PopoverPortal,{element:y.current,scoutElement:_.current,container:$,children:typeof h=="function"?h(E):h}):null};return(0,i.jsxs)(i.Fragment,{children:[T(),V()]})});e.Popover=(0,a.forwardRef)(function(u,v){return typeof window>"u"?u.children:(0,i.jsx)(c,o({},u,{ref:v}))})})(Le);function at(e){return fe({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Edit"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:"M3.548,20.938h16.9a.5.5,0,0,0,0-1H3.548a.5.5,0,0,0,0,1Z"},child:[]},{tag:"path",attr:{d:"M9.71,17.18a2.587,2.587,0,0,0,1.12-.65l9.54-9.54a1.75,1.75,0,0,0,0-2.47l-.94-.93a1.788,1.788,0,0,0-2.47,0L7.42,13.12a2.473,2.473,0,0,0-.64,1.12L6.04,17a.737.737,0,0,0,.19.72.767.767,0,0,0,.53.22Zm.41-1.36a1.468,1.468,0,0,1-.67.39l-.97.26-1-1,.26-.97a1.521,1.521,0,0,1,.39-.67l.38-.37,1.99,1.99Zm1.09-1.08L9.22,12.75l6.73-6.73,1.99,1.99Zm8.45-8.45L18.65,7.3,16.66,5.31l1.01-1.02a.748.748,0,0,1,1.06,0l.93.94A.754.754,0,0,1,19.66,6.29Z"},child:[]}]}]}]})(e)}function st(e){return fe({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"View_Table"},child:[{tag:"path",attr:{d:"M18.44,3.06H5.56a2.507,2.507,0,0,0-2.5,2.5V18.44a2.507,2.507,0,0,0,2.5,2.5H18.44a2.514,2.514,0,0,0,2.5-2.5V5.56A2.514,2.514,0,0,0,18.44,3.06ZM8.71,19.94H5.56a1.5,1.5,0,0,1-1.5-1.5V15.33H8.71Zm0-5.61H4.06V9.67H8.71Zm0-5.66H4.06V5.56a1.5,1.5,0,0,1,1.5-1.5H8.71Zm11.23,9.77a1.511,1.511,0,0,1-1.5,1.5H9.71V15.33H19.94Zm0-4.11H9.71V9.67H19.94Zm0-5.66H9.71V4.06h8.73a1.511,1.511,0,0,1,1.5,1.5Z"},child:[]}]}]})(e)}function ut(e){return fe({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 20h9"},child:[]},{tag:"path",attr:{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"},child:[]}]})(e)}function lt(e){return fe({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polygon",attr:{points:"23 7 16 12 23 17 23 7"},child:[]},{tag:"rect",attr:{x:"1",y:"5",width:"15",height:"14",rx:"2",ry:"2"},child:[]}]})(e)}const Ke=O.createContext();function dt({children:e,initialValue:o}){const[i,a]=O.useState(o),n=p=>{const f=$e.cloneDeep(i);a({...f,...p})};return ee.jsx(Ke.Provider,{value:{page:i,setPage:a,updatePage:n},children:e})}const ct=async(e,o,i,a,n)=>{let p="/app/save";const f=new FormData;e==="collection"?p="/app/save_collection":e==="article"&&(p="/app/save_article",f.append("blogID",n)),f.append("id",a),f.append("description",o+i);const r=await(await fetch(p,{method:"post",body:f})).json();return r&&(r==null?void 0:r.status)==="OK"},vt=(e,o)=>{window.open(`https://${e}/collections/${o}`,"_blank").focus()},pt=(e,o,i)=>{window.open(`https://${e}/${i}s/${o}`,"_blank").focus()},ft=(e,o)=>{switch(o.linkedPageType){case"product":window.open(`https://${e}/products/${o.handle}`);return;case"collection":window.open(`https://${e}/collections/${o.handle}`);return;case"article":window.open(`https://${e}/blogs/${o.blogHandle}/${o.handle}`);return}};export{at as C,ut as F,Le as P,nt as S,ft as a,vt as b,Ke as c,dt as d,st as e,lt as f,rt as g,pt as o,ct as s,it as u};
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.